diff options
author | Robbie Cronin <robert.cronin@uqconnect.edu.au> | 2019-06-21 13:17:30 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-21 13:17:30 +0800 |
commit | 2f8e0060308b0f5b1eeac9541600bfed3ad5acc9 (patch) | |
tree | 80d40364c5f5957da8c82578dd1152adac06912e /kvision-modules/kvision-select | |
parent | 9038555f9e46a32a0a725112304e64cdd408bf8e (diff) | |
parent | d9f1a90c772719d14540eb2bf7bc3b8384fa7a72 (diff) | |
download | kvision-2f8e0060308b0f5b1eeac9541600bfed3ad5acc9.tar.gz kvision-2f8e0060308b0f5b1eeac9541600bfed3ad5acc9.tar.bz2 kvision-2f8e0060308b0f5b1eeac9541600bfed3ad5acc9.zip |
Merge pull request #1 from rjaros/master
merge
Diffstat (limited to 'kvision-modules/kvision-select')
8 files changed, 13 insertions, 12 deletions
diff --git a/kvision-modules/kvision-select/build.gradle b/kvision-modules/kvision-select/build.gradle index 65b8a83c..7525f037 100644 --- a/kvision-modules/kvision-select/build.gradle +++ b/kvision-modules/kvision-select/build.gradle @@ -7,6 +7,7 @@ kotlinFrontend { dependency("ajax-bootstrap-select", "1.4.3") devDependency("karma", "3.1.4") devDependency("karma-chrome-launcher", "2.2.0") + devDependency("karma-webpack", "3.0.5") devDependency("qunit", "2.8.0") } diff --git a/kvision-modules/kvision-select/src/main/kotlin/pl/treksoft/kvision/form/select/Select.kt b/kvision-modules/kvision-select/src/main/kotlin/pl/treksoft/kvision/form/select/Select.kt index f19081e1..db8a5b3b 100644 --- a/kvision-modules/kvision-select/src/main/kotlin/pl/treksoft/kvision/form/select/Select.kt +++ b/kvision-modules/kvision-select/src/main/kotlin/pl/treksoft/kvision/form/select/Select.kt @@ -39,7 +39,7 @@ import pl.treksoft.kvision.utils.SnOn * [SelectOption] or [SelectOptGroup] components to the container. * * @constructor - * @param options an optional list of options (label to value pairs) for the select control + * @param options an optional list of options (value to label pairs) for the select control * @param value selected value * @param name the name attribute of the generated HTML input element * @param multiple allows multiple value selection (multiple values are comma delimited) @@ -55,7 +55,7 @@ open class Select( ) : SimplePanel(setOf("form-group")), StringFormControl { /** - * A list of options (label to value pairs) for the select control. + * A list of options (value to label pairs) for the select control. */ var options get() = input.options diff --git a/kvision-modules/kvision-select/src/main/kotlin/pl/treksoft/kvision/form/select/SelectInput.kt b/kvision-modules/kvision-select/src/main/kotlin/pl/treksoft/kvision/form/select/SelectInput.kt index 7ffdf2c2..9ae1a4e9 100644 --- a/kvision-modules/kvision-select/src/main/kotlin/pl/treksoft/kvision/form/select/SelectInput.kt +++ b/kvision-modules/kvision-select/src/main/kotlin/pl/treksoft/kvision/form/select/SelectInput.kt @@ -50,7 +50,7 @@ enum class SelectWidthType(internal val value: String) { * [SelectOption] or [SelectOptGroup] components to the container. * * @constructor - * @param options an optional list of options (label to value pairs) for the select control + * @param options an optional list of options (value to label pairs) for the select control * @param value selected value * @param multiple allows multiple value selection (multiple values are comma delimited) * @param ajaxOptions additional options for remote (AJAX) data source @@ -64,9 +64,9 @@ open class SelectInput( ) : SimplePanel(classes), FormInput { /** - * A list of options (label to value pairs) for the select control. + * A list of options (value to label pairs) for the select control. */ - internal var options by refreshOnUpdate(options) { setChildrenFromOptions() } + var options by refreshOnUpdate(options) { setChildrenFromOptions() } /** * A value of the selected option. */ @@ -337,14 +337,14 @@ open class SelectInput( /** * Makes the input element focused. */ - open fun focus() { + override fun focus() { getElementJQuery()?.focus() } /** * Makes the input element blur. */ - open fun blur() { + override fun blur() { getElementJQuery()?.blur() } diff --git a/kvision-modules/kvision-select/src/test/kotlin/test/pl/treksoft/kvision/TestUtil.kt b/kvision-modules/kvision-select/src/test/kotlin/test/pl/treksoft/kvision/TestUtil.kt index 37d7a9df..13c8531b 100644 --- a/kvision-modules/kvision-select/src/test/kotlin/test/pl/treksoft/kvision/TestUtil.kt +++ b/kvision-modules/kvision-select/src/test/kotlin/test/pl/treksoft/kvision/TestUtil.kt @@ -86,7 +86,7 @@ interface WSpec : DomSpec { fun runW(code: (widget: Widget, element: Element?) -> Unit) { run { - val root = Root("test", true) + val root = Root("test", fixed = true) val widget = Widget() widget.id = "test_id" root.add(widget) diff --git a/kvision-modules/kvision-select/src/test/kotlin/test/pl/treksoft/kvision/form/select/SelectInputSpec.kt b/kvision-modules/kvision-select/src/test/kotlin/test/pl/treksoft/kvision/form/select/SelectInputSpec.kt index 30f42e9c..bfd93900 100644 --- a/kvision-modules/kvision-select/src/test/kotlin/test/pl/treksoft/kvision/form/select/SelectInputSpec.kt +++ b/kvision-modules/kvision-select/src/test/kotlin/test/pl/treksoft/kvision/form/select/SelectInputSpec.kt @@ -34,7 +34,7 @@ class SelectInputSpec : DomSpec { @Test fun render() { run { - val root = Root("test", true) + val root = Root("test", fixed = true) val selectInput = SelectInput(listOf("test1" to "Test 1", "test2" to "Test 2"), "test1", true).apply { liveSearch = true placeholder = "Choose ..." diff --git a/kvision-modules/kvision-select/src/test/kotlin/test/pl/treksoft/kvision/form/select/SelectOptGroupSpec.kt b/kvision-modules/kvision-select/src/test/kotlin/test/pl/treksoft/kvision/form/select/SelectOptGroupSpec.kt index bd88f560..33ccc843 100644 --- a/kvision-modules/kvision-select/src/test/kotlin/test/pl/treksoft/kvision/form/select/SelectOptGroupSpec.kt +++ b/kvision-modules/kvision-select/src/test/kotlin/test/pl/treksoft/kvision/form/select/SelectOptGroupSpec.kt @@ -33,7 +33,7 @@ class SelectOptGroupSpec : DomSpec { @Test fun render() { run { - val root = Root("test", true) + val root = Root("test", fixed = true) val selectOptGroup = SelectOptGroup("Group", listOf("test1" to "Test 1", "test2" to "Test 2"), 2) root.add(selectOptGroup) val element = document.getElementById("test") diff --git a/kvision-modules/kvision-select/src/test/kotlin/test/pl/treksoft/kvision/form/select/SelectOptionSpec.kt b/kvision-modules/kvision-select/src/test/kotlin/test/pl/treksoft/kvision/form/select/SelectOptionSpec.kt index f7e07d42..33c36576 100644 --- a/kvision-modules/kvision-select/src/test/kotlin/test/pl/treksoft/kvision/form/select/SelectOptionSpec.kt +++ b/kvision-modules/kvision-select/src/test/kotlin/test/pl/treksoft/kvision/form/select/SelectOptionSpec.kt @@ -32,7 +32,7 @@ class SelectOptionSpec : DomSpec { @Test fun render() { run { - val root = Root("test", true) + val root = Root("test", fixed = true) val selectOption = SelectOption("testValue", "testLabel") root.add(selectOption) val element = document.getElementById("test") diff --git a/kvision-modules/kvision-select/src/test/kotlin/test/pl/treksoft/kvision/form/select/SelectSpec.kt b/kvision-modules/kvision-select/src/test/kotlin/test/pl/treksoft/kvision/form/select/SelectSpec.kt index eaccd551..9eddff81 100644 --- a/kvision-modules/kvision-select/src/test/kotlin/test/pl/treksoft/kvision/form/select/SelectSpec.kt +++ b/kvision-modules/kvision-select/src/test/kotlin/test/pl/treksoft/kvision/form/select/SelectSpec.kt @@ -34,7 +34,7 @@ class SelectSpec : DomSpec { @Test fun render() { run { - val root = Root("test", true) + val root = Root("test", fixed = true) val select = Select(listOf("test1" to "Test 1", "test2" to "Test 2"), "test1", null, true, null, "Label").apply { liveSearch = true placeholder = "Choose ..." |