From 0c6da96f0ce5ddbbfa58d9efed96ac62f2a22221 Mon Sep 17 00:00:00 2001 From: Robbie Cronin Date: Wed, 1 May 2019 09:13:53 +0800 Subject: Fix namespace issue Rename 2 conflicting Options variables in Charts and Tabulator packages to ChartOptions and TabulatorOptions respectively --- .../main/kotlin/pl/treksoft/kvision/tabulator/Options.kt | 2 +- .../kotlin/pl/treksoft/kvision/tabulator/Tabulator.kt | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'kvision-modules/kvision-tabulator/src/main/kotlin/pl') diff --git a/kvision-modules/kvision-tabulator/src/main/kotlin/pl/treksoft/kvision/tabulator/Options.kt b/kvision-modules/kvision-tabulator/src/main/kotlin/pl/treksoft/kvision/tabulator/Options.kt index c00af9cb..bb13372d 100644 --- a/kvision-modules/kvision-tabulator/src/main/kotlin/pl/treksoft/kvision/tabulator/Options.kt +++ b/kvision-modules/kvision-tabulator/src/main/kotlin/pl/treksoft/kvision/tabulator/Options.kt @@ -411,7 +411,7 @@ fun ColumnDefinition.toJs(i18nTranslator: (String) -> (String)): Tabulator.Colum /** * Tabulator options. */ -data class Options( +data class TabulatorOptions( val height: String? = null, val virtualDom: Boolean? = null, val virtualDomBuffer: Int? = null, diff --git a/kvision-modules/kvision-tabulator/src/main/kotlin/pl/treksoft/kvision/tabulator/Tabulator.kt b/kvision-modules/kvision-tabulator/src/main/kotlin/pl/treksoft/kvision/tabulator/Tabulator.kt index 1b8becff..249c578f 100644 --- a/kvision-modules/kvision-tabulator/src/main/kotlin/pl/treksoft/kvision/tabulator/Tabulator.kt +++ b/kvision-modules/kvision-tabulator/src/main/kotlin/pl/treksoft/kvision/tabulator/Tabulator.kt @@ -54,7 +54,7 @@ import pl.treksoft.kvision.tabulator.js.Tabulator as JsTabulator @Suppress("LargeClass", "TooManyFunctions") open class Tabulator( protected val data: List? = null, - val options: Options = Options(), + val options: TabulatorOptions = TabulatorOptions(), types: Set = setOf(), classes: Set = setOf(), protected val dataSerializer: KSerializer? = null @@ -561,7 +561,7 @@ open class Tabulator( */ inline fun Container.tabulator( data: List? = null, - options: Options = Options(), + options: TabulatorOptions = TabulatorOptions(), types: Set = setOf(), classes: Set = setOf(), noinline init: (Tabulator.() -> Unit)? = null @@ -578,7 +578,7 @@ open class Tabulator( inline fun Container.tabulator( store: ReduxStore, noinline dataFactory: (S) -> List, - options: Options = Options(), + options: TabulatorOptions = TabulatorOptions(), types: Set = setOf(), classes: Set = setOf(), noinline init: (Tabulator.() -> Unit)? = null @@ -594,7 +594,7 @@ open class Tabulator( */ inline fun Container.tabulator( store: ReduxStore, A>, - options: Options = Options(), + options: TabulatorOptions = TabulatorOptions(), types: Set = setOf(), classes: Set = setOf(), noinline init: (Tabulator.() -> Unit)? = null @@ -609,7 +609,7 @@ open class Tabulator( * DSL builder extension function for dynamic data (send within options parameter). */ fun Container.tabulator( - options: Options = Options(), + options: TabulatorOptions = TabulatorOptions(), types: Set = setOf(), classes: Set = setOf(), init: (Tabulator.() -> Unit)? = null @@ -625,7 +625,7 @@ open class Tabulator( */ @UseExperimental(ImplicitReflectionSerializer::class) inline fun create( - data: List? = null, options: Options = Options(), + data: List? = null, options: TabulatorOptions = TabulatorOptions(), types: Set = setOf(), classes: Set = setOf(), noinline init: (Tabulator.() -> Unit)? = null @@ -642,7 +642,7 @@ open class Tabulator( inline fun create( store: ReduxStore, noinline dataFactory: (S) -> List, - options: Options = Options(), + options: TabulatorOptions = TabulatorOptions(), types: Set = setOf(), classes: Set = setOf(), noinline init: (Tabulator.() -> Unit)? = null @@ -662,7 +662,7 @@ open class Tabulator( @UseExperimental(ImplicitReflectionSerializer::class) inline fun create( store: ReduxStore, A>, - options: Options = Options(), + options: TabulatorOptions = TabulatorOptions(), types: Set = setOf(), classes: Set = setOf(), noinline init: (Tabulator.() -> Unit)? = null -- cgit From 6971a2b7383b376223a49c7eb5e900e36fcd6e8f Mon Sep 17 00:00:00 2001 From: Robbie Cronin Date: Wed, 1 May 2019 17:22:33 +0800 Subject: Update Options name to TabulatorOptions in toJs extension --- .../src/main/kotlin/pl/treksoft/kvision/tabulator/Options.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'kvision-modules/kvision-tabulator/src/main/kotlin/pl') diff --git a/kvision-modules/kvision-tabulator/src/main/kotlin/pl/treksoft/kvision/tabulator/Options.kt b/kvision-modules/kvision-tabulator/src/main/kotlin/pl/treksoft/kvision/tabulator/Options.kt index bb13372d..dac29ab9 100644 --- a/kvision-modules/kvision-tabulator/src/main/kotlin/pl/treksoft/kvision/tabulator/Options.kt +++ b/kvision-modules/kvision-tabulator/src/main/kotlin/pl/treksoft/kvision/tabulator/Options.kt @@ -572,7 +572,7 @@ data class TabulatorOptions( * An extension function to convert tabulator options class to JS object. */ @Suppress("UNCHECKED_CAST_TO_EXTERNAL_INTERFACE", "ComplexMethod") -fun Options.toJs(i18nTranslator: (String) -> (String)): Tabulator.Options { +fun TabulatorOptions.toJs(i18nTranslator: (String) -> (String)): Tabulator.Options { return obj { if (height != null) this.height = height if (virtualDom != null) this.virtualDom = virtualDom -- cgit