aboutsummaryrefslogtreecommitdiff
path: root/kvision-modules/kvision-common-remote
diff options
context:
space:
mode:
Diffstat (limited to 'kvision-modules/kvision-common-remote')
-rw-r--r--kvision-modules/kvision-common-remote/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt8
-rw-r--r--kvision-modules/kvision-common-remote/src/main/kotlin/pl/treksoft/kvision/remote/RemoteTypes.kt (renamed from kvision-modules/kvision-common-remote/src/main/kotlin/pl/treksoft/kvision/remote/RemoteSelectOption.kt)9
2 files changed, 17 insertions, 0 deletions
diff --git a/kvision-modules/kvision-common-remote/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt b/kvision-modules/kvision-common-remote/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt
index e89744f6..786143e8 100644
--- a/kvision-modules/kvision-common-remote/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt
+++ b/kvision-modules/kvision-common-remote/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt
@@ -119,6 +119,14 @@ expect open class KVServiceManager<T : Any>(serviceClass: KClass<T>) {
)
/**
+ * Binds a given function of the receiver as a tabulator component source
+ * @param function a function of the receiver
+ */
+ protected inline fun <reified RET> bind(
+ noinline function: T.(Int?, Int?, List<RemoteFilter>?, List<RemoteSorter>?) -> RemoteData<RET>
+ )
+
+ /**
* Binds a given function of the receiver as a web socket connection
* @param function a function of the receiver
*/
diff --git a/kvision-modules/kvision-common-remote/src/main/kotlin/pl/treksoft/kvision/remote/RemoteSelectOption.kt b/kvision-modules/kvision-common-remote/src/main/kotlin/pl/treksoft/kvision/remote/RemoteTypes.kt
index 24e68f63..7285295b 100644
--- a/kvision-modules/kvision-common-remote/src/main/kotlin/pl/treksoft/kvision/remote/RemoteSelectOption.kt
+++ b/kvision-modules/kvision-common-remote/src/main/kotlin/pl/treksoft/kvision/remote/RemoteTypes.kt
@@ -34,3 +34,12 @@ data class RemoteSelectOption(
val disabled: Boolean = false,
val divider: Boolean = false
)
+
+@Serializable
+data class RemoteData<T>(val data: List<T> = listOf(), val last_page: Int = 0)
+
+@Serializable
+data class RemoteFilter(val field: String, val type: String, val value: String?)
+
+@Serializable
+data class RemoteSorter(val field: String, val dir: String)