Skip to content

Commit

Permalink
Merge branch 'main' of github.com:lightningkite/kiteui
Browse files Browse the repository at this point in the history
  • Loading branch information
WesleyEdwards committed Jul 9, 2024
2 parents aa57bf4 + b1515e3 commit 0c4e39e
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,9 @@ actual fun ViewWriter.selectActual(setup: Select.() -> Unit) {
}
})
}

actual var Select.enabled: Boolean
get() = native.isEnabled
set(value) {
native.isEnabled = value
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ actual var TextArea.hint: String
this@hint.native.hint = value
}

actual var TextArea.enabled: Boolean
get() = native.isEnabled
set(value) {
native.isEnabled = value
}

@ViewDsl
actual inline fun ViewWriter.textAreaActual(crossinline setup: TextArea.() -> Unit) {
return viewElement(factory = ::EditText, wrapper = ::TextArea, setup = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ value class Select(override val native: NSelect) : RView<NSelect>
@ViewDsl
expect fun ViewWriter.selectActual(setup: Select.()->Unit = {}): Unit
@OptIn(ExperimentalContracts::class) @ViewDsl inline fun ViewWriter.select(noinline setup: Select.() -> Unit = {}) { contract { callsInPlace(setup, InvocationKind.EXACTLY_ONCE) }; selectActual(setup) }
expect fun <T> Select.bind(edits: Writable<T>, data: Readable<List<T>>, render: (T)->String)
expect fun <T> Select.bind(edits: Writable<T>, data: Readable<List<T>>, render: (T)->String)

expect var Select.enabled: Boolean
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ expect fun ViewWriter.textAreaActual(setup: TextArea.()->Unit = {}): Unit
@OptIn(ExperimentalContracts::class) @ViewDsl inline fun ViewWriter.textArea(noinline setup: TextArea.() -> Unit = {}) { contract { callsInPlace(setup, InvocationKind.EXACTLY_ONCE) }; textAreaActual(setup) }
expect val TextArea.content: Writable<String>
expect var TextArea.keyboardHints: KeyboardHints
expect var TextArea.hint: String
expect var TextArea.hint: String
expect var TextArea.enabled: Boolean
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,10 @@ actual fun <T> Select.bind(
picker.setDataSource(source)
picker.setDelegate(source)
native.extensionStrongRef = source
}
}

actual var Select.enabled: Boolean
get() = native.enabled
set(value) {
native.enabled = value
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,10 @@ actual inline var TextArea.keyboardHints: KeyboardHints
}
actual inline var TextArea.hint: String
get() = TODO()
set(value) {}
set(value) {}

actual inline var TextArea.enabled: Boolean
get() = native.editable
set(value) {
native.editable = value
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,10 @@ actual fun <T> Select.bind(
alreadyHandled = false
}
}
}
}

actual inline var Select.enabled: Boolean
get() = !native.disabled
set(value) {
native.disabled = !value
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,10 @@ actual inline var TextArea.keyboardHints: KeyboardHints
}
actual inline var TextArea.hint: String
get() = TODO()
set(value) {}
set(value) {}

actual inline var TextArea.enabled: Boolean
get() = !native.readOnly
set(value) {
native.readOnly = !value
}
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,9 @@ actual inline var TextArea.keyboardHints: KeyboardHints
actual inline var TextArea.hint: String
get() = TODO()
set(value) {}
actual inline var TextArea.enabled: Boolean
get() = TODO()
set(value) {}

@Suppress("ACTUAL_WITHOUT_EXPECT")
actual typealias NSelect = HTMLElement
Expand All @@ -331,6 +334,9 @@ actual fun <T> Select.bind(
render: (T) -> String
) {
}
actual inline var Select.enabled: Boolean
get() = TODO()
set(value) {}

@Suppress("ACTUAL_WITHOUT_EXPECT")
actual typealias NAutoCompleteTextField = HTMLElement
Expand Down

0 comments on commit 0c4e39e

Please sign in to comment.