From f3ce0f6b6be2f7b84b9fc03b7b346d732524bbae Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Tue, 26 Apr 2022 14:54:26 +0600 Subject: [PATCH] Improve work with UIKitModifiers --- CHANGELOG.md | 2 ++ .../kotlin/dev/inmo/jsuikit/modifiers/UIKitModifier.kt | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4984955..9b60097 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## 0.0.52 +* Improve work with UIKitModifiers + ## 0.0.51 * New interface `Dropdown` which will be used to create (or retrieve) dropdown for an element diff --git a/src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitModifier.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitModifier.kt index bfffeb6..d202890 100644 --- a/src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitModifier.kt +++ b/src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitModifier.kt @@ -26,8 +26,8 @@ operator fun UIKitModifier.plus(other: UIKitModifier): UIKitModifier = UIKitCust classes + other.classes, otherAttrs + other.otherAttrs ) -fun UIKitModifier.builder() = Attrs(this).builder -fun Array.builder() = Attrs(*this).builder -inline fun attrsBuilder(vararg modifiers: UIKitModifier) = modifiers.builder() +fun UIKitModifier?.builder() = Attrs(this).builder +fun Array.builder() = Attrs(*this).builder +inline fun attrsBuilder(vararg modifiers: UIKitModifier?) = modifiers.builder() @JsName("plusBuilder") -operator fun UIKitModifier.plus(other: UIKitModifier): AttrBuilderContext = Attrs(this@plus, other).builder +operator fun UIKitModifier?.plus(other: UIKitModifier?): AttrBuilderContext = Attrs(this@plus, other).builder