aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/pl/treksoft/kvision/form
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/pl/treksoft/kvision/form')
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/form/Form.kt4
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/form/FormPanel.kt2
2 files changed, 5 insertions, 1 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/form/Form.kt b/src/main/kotlin/pl/treksoft/kvision/form/Form.kt
index 8f93c7ea..e2f5d730 100644
--- a/src/main/kotlin/pl/treksoft/kvision/form/Form.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/form/Form.kt
@@ -21,6 +21,7 @@
*/
package pl.treksoft.kvision.form
+import kotlinx.serialization.ImplicitReflectionSerializer
import kotlinx.serialization.KSerializer
import kotlinx.serialization.Mapper
import kotlinx.serialization.context.MutableSerialContextImpl
@@ -106,7 +107,7 @@ class Form<K : Any>(private val panel: FormPanel<K>? = null, private val seriali
else -> listOf(entry.key to entry.value)
}
}.toMap()
- val mapper = Mapper.InNullableMapper(FormMapWrapper(map))
+ val mapper = Mapper().InNullableMapper(FormMapWrapper(map))
mapper.context = MutableSerialContextImpl().apply { registerSerializer(Date::class, DateSerializer) }
mapper.decode(serializer)
}
@@ -320,6 +321,7 @@ class Form<K : Any>(private val panel: FormPanel<K>? = null, private val seriali
}
companion object {
+ @UseExperimental(ImplicitReflectionSerializer::class)
inline fun <reified K : Any> create(
panel: FormPanel<K>? = null,
noinline init: (Form<K>.() -> Unit)? = null
diff --git a/src/main/kotlin/pl/treksoft/kvision/form/FormPanel.kt b/src/main/kotlin/pl/treksoft/kvision/form/FormPanel.kt
index 3533dee5..c9b33572 100644
--- a/src/main/kotlin/pl/treksoft/kvision/form/FormPanel.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/form/FormPanel.kt
@@ -22,6 +22,7 @@
package pl.treksoft.kvision.form
import com.github.snabbdom.VNode
+import kotlinx.serialization.ImplicitReflectionSerializer
import kotlinx.serialization.KSerializer
import kotlinx.serialization.serializer
import pl.treksoft.kvision.core.Container
@@ -407,6 +408,7 @@ open class FormPanel<K : Any>(
return formPanel
}
+ @UseExperimental(ImplicitReflectionSerializer::class)
inline fun <reified K : Any> create(
method: FormMethod? = null, action: String? = null, enctype: FormEnctype? = null,
type: FormType? = null, classes: Set<String> = setOf(),