aboutsummaryrefslogtreecommitdiff
path: root/kvision-modules/kvision-tabulator-remote/src/main
diff options
context:
space:
mode:
authorRobert Jaros <rjaros@finn.pl>2019-10-17 21:58:34 +0200
committerRobert Jaros <rjaros@finn.pl>2019-10-17 21:58:34 +0200
commit736b80835f67c9c34657074ebcfbe0752bef1c18 (patch)
tree82d1e18a9ec07692dfe5dd31f470b842a9950a89 /kvision-modules/kvision-tabulator-remote/src/main
parent53b325d52208bfd44ba6a524ce3dda5379aed699 (diff)
downloadkvision-736b80835f67c9c34657074ebcfbe0752bef1c18.tar.gz
kvision-736b80835f67c9c34657074ebcfbe0752bef1c18.tar.bz2
kvision-736b80835f67c9c34657074ebcfbe0752bef1c18.zip
Move DSL builder functions out of the companion objects (#93)
Diffstat (limited to 'kvision-modules/kvision-tabulator-remote/src/main')
-rw-r--r--kvision-modules/kvision-tabulator-remote/src/main/kotlin/pl/treksoft/kvision/tabulator/TabulatorRemote.kt39
1 files changed, 18 insertions, 21 deletions
diff --git a/kvision-modules/kvision-tabulator-remote/src/main/kotlin/pl/treksoft/kvision/tabulator/TabulatorRemote.kt b/kvision-modules/kvision-tabulator-remote/src/main/kotlin/pl/treksoft/kvision/tabulator/TabulatorRemote.kt
index 4478b942..d37f3ea9 100644
--- a/kvision-modules/kvision-tabulator-remote/src/main/kotlin/pl/treksoft/kvision/tabulator/TabulatorRemote.kt
+++ b/kvision-modules/kvision-tabulator-remote/src/main/kotlin/pl/treksoft/kvision/tabulator/TabulatorRemote.kt
@@ -89,26 +89,23 @@ open class TabulatorRemote<T : Any, E : Any>(
}
}
}
+}
- companion object {
- /**
- * DSL builder extension function.
- *
- * It takes the same parameters as the constructor of the built component.
- */
- fun <T : Any, E : Any> Container.tabulatorRemote(
- serviceManager: KVServiceManager<E>,
- function: E.(Int?, Int?, List<RemoteFilter>?, List<RemoteSorter>?) -> RemoteData<T>,
- options: TabulatorOptions<T> = TabulatorOptions(),
- types: Set<TableType> = setOf(),
- classes: Set<String> = setOf(),
- init: (TabulatorRemote<T, E>.() -> Unit)? = null
- ): TabulatorRemote<T, E> {
- val tabulatorRemote = TabulatorRemote(serviceManager, function, options, types, classes)
- init?.invoke(tabulatorRemote)
- this.add(tabulatorRemote)
- return tabulatorRemote
- }
- }
-
+/**
+ * DSL builder extension function.
+ *
+ * It takes the same parameters as the constructor of the built component.
+ */
+fun <T : Any, E : Any> Container.tabulatorRemote(
+ serviceManager: KVServiceManager<E>,
+ function: E.(Int?, Int?, List<RemoteFilter>?, List<RemoteSorter>?) -> RemoteData<T>,
+ options: TabulatorOptions<T> = TabulatorOptions(),
+ types: Set<TableType> = setOf(),
+ classes: Set<String> = setOf(),
+ init: (TabulatorRemote<T, E>.() -> Unit)? = null
+): TabulatorRemote<T, E> {
+ val tabulatorRemote = TabulatorRemote(serviceManager, function, options, types, classes)
+ init?.invoke(tabulatorRemote)
+ this.add(tabulatorRemote)
+ return tabulatorRemote
}