From 343390df5a0e01f45539939291c35d535a1b8af6 Mon Sep 17 00:00:00 2001 From: Robert Jaros Date: Sat, 25 Nov 2017 13:39:39 +0100 Subject: Form validation --- src/main/kotlin/pl/treksoft/kvision/panel/GridPanel.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/main/kotlin/pl/treksoft/kvision/panel/GridPanel.kt') diff --git a/src/main/kotlin/pl/treksoft/kvision/panel/GridPanel.kt b/src/main/kotlin/pl/treksoft/kvision/panel/GridPanel.kt index cac5c79b..dac5867c 100644 --- a/src/main/kotlin/pl/treksoft/kvision/panel/GridPanel.kt +++ b/src/main/kotlin/pl/treksoft/kvision/panel/GridPanel.kt @@ -1,6 +1,6 @@ package pl.treksoft.kvision.panel -import pl.treksoft.kvision.core.Widget +import pl.treksoft.kvision.core.Component import pl.treksoft.kvision.core.WidgetWrapper import pl.treksoft.kvision.snabbdom.StringPair @@ -112,23 +112,23 @@ open class GridPanel(autoColumns: String? = null, autoRows: String? = null, auto } @Suppress("LongParameterList") - fun add(child: Widget, columnStart: Int? = null, rowStart: Int? = null, + fun add(child: Component, columnStart: Int? = null, rowStart: Int? = null, columnEnd: String? = null, rowEnd: String? = null, area: String? = null, justifySelf: GRIDJUSTIFY? = null, alignSelf: GRIDALIGN? = null, classes: Set = setOf()): GridPanel { addInternal(GridWrapper(child, columnStart, rowStart, columnEnd, rowEnd, area, justifySelf, alignSelf, classes)) return this } - override fun add(child: Widget): GridPanel { + override fun add(child: Component): GridPanel { return add(child, null, null) } - override fun addAll(children: List): GridPanel { + override fun addAll(children: List): GridPanel { children.forEach { add(it, null, null) } return this } - override fun remove(child: Widget): GridPanel { + override fun remove(child: Component): GridPanel { children.find { (it as GridWrapper).delegate == child }?.let { super.remove(it) it.dispose() @@ -190,7 +190,7 @@ open class GridPanel(autoColumns: String? = null, autoRows: String? = null, auto } } -class GridWrapper(delegate: Widget, private val columnStart: Int? = null, private val rowStart: Int? = null, +class GridWrapper(delegate: Component, private val columnStart: Int? = null, private val rowStart: Int? = null, private val columnEnd: String? = null, private val rowEnd: String? = null, private val area: String? = null, private val justifySelf: GRIDJUSTIFY? = null, private val alignSelf: GRIDALIGN? = null, -- cgit