mirror of
https://github.com/InsanusMokrassar/JSUIKitKBindings.git
synced 2024-12-22 16:47:24 +00:00
commit
9f342f428a
@ -1,3 +1,7 @@
|
|||||||
|
## 0.0.7
|
||||||
|
|
||||||
|
Rewrite project onto multiplatform paradigm and return back varargs instead of most `Array<UIKitModifier>`
|
||||||
|
|
||||||
## 0.0.6
|
## 0.0.6
|
||||||
|
|
||||||
Changes in signatures of text field and list
|
Changes in signatures of text field and list
|
||||||
|
31
build.gradle
31
build.gradle
@ -15,35 +15,44 @@ buildscript {
|
|||||||
}
|
}
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
alias(libs.plugins.kt.js)
|
alias(libs.plugins.kt.multiplatform)
|
||||||
alias(libs.plugins.jb.compose)
|
alias(libs.plugins.jb.compose)
|
||||||
}
|
}
|
||||||
|
|
||||||
project.version = "$version"
|
project.version = "$version"
|
||||||
project.group = "$group"
|
project.group = "$group"
|
||||||
|
|
||||||
allprojects {
|
repositories {
|
||||||
repositories {
|
|
||||||
mavenLocal()
|
mavenLocal()
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
google()
|
google()
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
kotlin {
|
kotlin {
|
||||||
js(IR) {
|
js(IR) {
|
||||||
browser()
|
browser()
|
||||||
binaries.executable()
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
sourceSets {
|
||||||
dependencies {
|
commonMain {
|
||||||
|
dependencies {
|
||||||
implementation libs.kt.stdlib
|
implementation libs.kt.stdlib
|
||||||
implementation compose.web.core
|
|
||||||
implementation compose.runtime
|
implementation compose.runtime
|
||||||
testImplementation libs.kt.test.js
|
}
|
||||||
testImplementation libs.kt.test.junit
|
}
|
||||||
|
jsMain {
|
||||||
|
dependencies {
|
||||||
|
implementation compose.web.core
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
jsTest {
|
||||||
|
dependencies {
|
||||||
|
implementation libs.kt.test.js
|
||||||
|
implementation libs.kt.test.junit
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
apply from: "./github_release.gradle"
|
apply from: "./github_release.gradle"
|
||||||
|
@ -9,4 +9,4 @@ android.enableJetifier=true
|
|||||||
# Project data
|
# Project data
|
||||||
|
|
||||||
group=dev.inmo
|
group=dev.inmo
|
||||||
version=0.0.6
|
version=0.0.7
|
||||||
|
@ -18,5 +18,5 @@ buildscript-gh-release = { module = "com.github.breadmoirai:github-release", ver
|
|||||||
|
|
||||||
[plugins]
|
[plugins]
|
||||||
|
|
||||||
kt-js = { id = "org.jetbrains.kotlin.js", version.ref = "kt" }
|
kt-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kt" }
|
||||||
jb-compose = { id = "org.jetbrains.compose", version.ref = "jb-compose" }
|
jb-compose = { id = "org.jetbrains.compose", version.ref = "jb-compose" }
|
||||||
|
@ -1,28 +1,14 @@
|
|||||||
apply plugin: 'maven-publish'
|
apply plugin: 'maven-publish'
|
||||||
|
|
||||||
task javadocJar(type: Jar) {
|
task javadocsJar(type: Jar) {
|
||||||
classifier = 'javadoc'
|
classifier = 'javadoc'
|
||||||
}
|
}
|
||||||
task sourcesJar(type: Jar) {
|
|
||||||
kotlin.sourceSets.all {
|
|
||||||
from(kotlin)
|
|
||||||
}
|
|
||||||
classifier = 'sources'
|
|
||||||
}
|
|
||||||
|
|
||||||
publishing {
|
publishing {
|
||||||
publications {
|
publications.all {
|
||||||
maven(MavenPublication) {
|
artifact javadocsJar
|
||||||
kotlin.js().components.forEach {
|
|
||||||
from(it)
|
|
||||||
}
|
|
||||||
|
|
||||||
artifact javadocJar
|
|
||||||
artifact sourcesJar
|
|
||||||
|
|
||||||
pom {
|
pom {
|
||||||
resolveStrategy = Closure.DELEGATE_FIRST
|
|
||||||
|
|
||||||
description = "${project.name}"
|
description = "${project.name}"
|
||||||
name = "${project.name}"
|
name = "${project.name}"
|
||||||
url = "https://github.com/InsanusMokrassar/JSUIKitKBindings"
|
url = "https://github.com/InsanusMokrassar/JSUIKitKBindings"
|
||||||
@ -64,7 +50,6 @@ publishing {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (project.hasProperty("signing.gnupg.keyName")) {
|
if (project.hasProperty("signing.gnupg.keyName")) {
|
||||||
|
@ -1 +1 @@
|
|||||||
{"licenses":[{"id":"Apache-2.0","title":"Apache Software License 2.0","url":"https://opensource.org/licenses/Apache-2.0"}],"mavenConfig":{"name":"${project.name}","description":"${project.name}","url":"https://github.com/InsanusMokrassar/JSUIKitKBindings","vcsUrl":"https://github.com/InsanusMokrassar/JSUIKitKBindings.git","developers":[{"id":"InsanusMokrassar","name":"Ovsiannikov Aleksei","eMail":"ovsyannikov.alexey95@gmail.com"}],"repositories":[{"name":"sonatype","url":"https://oss.sonatype.org/service/local/staging/deploy/maven2/"}],"gpgSigning":{"type":"dev.inmo.kmppscriptbuilder.core.models.GpgSigning.Optional"}},"type":"JS"}
|
{"licenses":[{"id":"Apache-2.0","title":"Apache Software License 2.0","url":"https://opensource.org/licenses/Apache-2.0"}],"mavenConfig":{"name":"${project.name}","description":"${project.name}","url":"https://github.com/InsanusMokrassar/JSUIKitKBindings","vcsUrl":"https://github.com/InsanusMokrassar/JSUIKitKBindings.git","developers":[{"id":"InsanusMokrassar","name":"Ovsiannikov Aleksei","eMail":"ovsyannikov.alexey95@gmail.com"}],"repositories":[{"name":"sonatype","url":"https://oss.sonatype.org/service/local/staging/deploy/maven2/"}],"gpgSigning":{"type":"dev.inmo.kmppscriptbuilder.core.models.GpgSigning.Optional"}}}
|
@ -12,7 +12,7 @@ import org.w3c.dom.events.Event
|
|||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun DefaultButton(
|
fun DefaultButton(
|
||||||
modifiers: Array<UIKitModifier> = emptyArray(),
|
vararg modifiers: UIKitModifier,
|
||||||
disabled: Boolean = false,
|
disabled: Boolean = false,
|
||||||
buttonType: UIKitButton.Type = UIKitButton.Type.Default,
|
buttonType: UIKitButton.Type = UIKitButton.Type.Default,
|
||||||
onClick: ((SyntheticMouseEvent) -> Unit)? = null,
|
onClick: ((SyntheticMouseEvent) -> Unit)? = null,
|
||||||
@ -37,14 +37,14 @@ fun DefaultButton(
|
|||||||
@Composable
|
@Composable
|
||||||
fun DefaultButton(
|
fun DefaultButton(
|
||||||
text: String,
|
text: String,
|
||||||
modifiers: Array<UIKitModifier> = emptyArray(),
|
vararg modifiers: UIKitModifier,
|
||||||
disabled: Boolean = false,
|
disabled: Boolean = false,
|
||||||
buttonType: UIKitButton.Type = UIKitButton.Type.Default,
|
buttonType: UIKitButton.Type = UIKitButton.Type.Default,
|
||||||
preTextContentAllocator: ContentBuilder<HTMLButtonElement>? = null,
|
preTextContentAllocator: ContentBuilder<HTMLButtonElement>? = null,
|
||||||
afterTextContentAllocator: ContentBuilder<HTMLButtonElement>? = null,
|
afterTextContentAllocator: ContentBuilder<HTMLButtonElement>? = null,
|
||||||
attributesCustomizer: AttrBuilderContext<HTMLButtonElement> = {},
|
attributesCustomizer: AttrBuilderContext<HTMLButtonElement> = {},
|
||||||
onClick: ((SyntheticMouseEvent) -> Unit)? = null
|
onClick: ((SyntheticMouseEvent) -> Unit)? = null
|
||||||
) = DefaultButton(modifiers, disabled = disabled, buttonType = buttonType, onClick = onClick, attributesCustomizer = attributesCustomizer) {
|
) = DefaultButton(*modifiers, disabled = disabled, buttonType = buttonType, onClick = onClick, attributesCustomizer = attributesCustomizer) {
|
||||||
preTextContentAllocator ?.apply { preTextContentAllocator() }
|
preTextContentAllocator ?.apply { preTextContentAllocator() }
|
||||||
Text(text)
|
Text(text)
|
||||||
afterTextContentAllocator ?.apply { afterTextContentAllocator() }
|
afterTextContentAllocator ?.apply { afterTextContentAllocator() }
|
||||||
@ -53,7 +53,7 @@ fun DefaultButton(
|
|||||||
@Composable
|
@Composable
|
||||||
fun UploadButton(
|
fun UploadButton(
|
||||||
text: String,
|
text: String,
|
||||||
buttonModifiers: Array<UIKitModifier> = emptyArray(),
|
vararg buttonModifiers: UIKitModifier,
|
||||||
containerModifiers: Array<UIKitModifier> = emptyArray(),
|
containerModifiers: Array<UIKitModifier> = emptyArray(),
|
||||||
disabled: Boolean = false,
|
disabled: Boolean = false,
|
||||||
buttonType: UIKitButton.Type = UIKitButton.Type.Default,
|
buttonType: UIKitButton.Type = UIKitButton.Type.Default,
|
@ -26,7 +26,7 @@ private class DialogDisposableEffectResult(
|
|||||||
@Composable
|
@Composable
|
||||||
fun Dialog(
|
fun Dialog(
|
||||||
title: String? = null,
|
title: String? = null,
|
||||||
modifiers: Array<UIKitModifier> = emptyArray(),
|
vararg modifiers: UIKitModifier,
|
||||||
hide: (() -> Unit)? = null,
|
hide: (() -> Unit)? = null,
|
||||||
hidden: (() -> Unit)? = null,
|
hidden: (() -> Unit)? = null,
|
||||||
footerBuilder: (@Composable () -> Unit)? = null,
|
footerBuilder: (@Composable () -> Unit)? = null,
|
@ -9,7 +9,7 @@ import org.w3c.dom.HTMLDivElement
|
|||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun Dropdown(
|
fun Dropdown(
|
||||||
modifiers: Array<UIKitModifier> = emptyArray(),
|
vararg modifiers: UIKitModifier,
|
||||||
toggle: String? = null,
|
toggle: String? = null,
|
||||||
pos: UIKitDropdown.Position? = null,
|
pos: UIKitDropdown.Position? = null,
|
||||||
mode: UIKitDropdown.Mode? = null,
|
mode: UIKitDropdown.Mode? = null,
|
@ -8,7 +8,7 @@ import org.w3c.dom.HTMLDivElement
|
|||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun Flex(
|
fun Flex(
|
||||||
modifiers: Array<UIKitModifier> = emptyArray(),
|
vararg modifiers: UIKitModifier,
|
||||||
attributesCustomizer: AttrBuilderContext<HTMLDivElement> = {},
|
attributesCustomizer: AttrBuilderContext<HTMLDivElement> = {},
|
||||||
filler: @Composable ElementScope<HTMLDivElement>.() -> Unit
|
filler: @Composable ElementScope<HTMLDivElement>.() -> Unit
|
||||||
) {
|
) {
|
@ -8,7 +8,7 @@ import org.w3c.dom.HTMLDivElement
|
|||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun GridColumn(
|
fun GridColumn(
|
||||||
modifiers: Array<UIKitModifier> = emptyArray(),
|
vararg modifiers: UIKitModifier,
|
||||||
attributesCustomizer: AttrBuilderContext<HTMLDivElement> = {},
|
attributesCustomizer: AttrBuilderContext<HTMLDivElement> = {},
|
||||||
builder: @Composable ElementScope<HTMLDivElement>.() -> Unit
|
builder: @Composable ElementScope<HTMLDivElement>.() -> Unit
|
||||||
) {
|
) {
|
||||||
@ -24,7 +24,7 @@ fun GridColumn(
|
|||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun Grid(
|
fun Grid(
|
||||||
modifiers: Array<UIKitModifier> = emptyArray(),
|
vararg modifiers: UIKitModifier,
|
||||||
masonry: Boolean = false,
|
masonry: Boolean = false,
|
||||||
parallax: Int? = null,
|
parallax: Int? = null,
|
||||||
marginClass: String? = null,
|
marginClass: String? = null,
|
@ -204,7 +204,7 @@ sealed class Icon(val name: String) {
|
|||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
operator fun invoke(
|
operator fun invoke(
|
||||||
modifiers: Array<UIKitModifier> = emptyArray(),
|
vararg modifiers: UIKitModifier,
|
||||||
type: UIKitIconType = UIKitIconType.Default,
|
type: UIKitIconType = UIKitIconType.Default,
|
||||||
ratio: Float? = null,
|
ratio: Float? = null,
|
||||||
attributesCustomizer: AttrBuilderContext<out HTMLElement> = {},
|
attributesCustomizer: AttrBuilderContext<out HTMLElement> = {},
|
||||||
@ -228,17 +228,17 @@ sealed class Icon(val name: String) {
|
|||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun drawAsButton(
|
fun drawAsButton(
|
||||||
modifiers: Array<UIKitModifier> = emptyArray(),
|
vararg modifiers: UIKitModifier,
|
||||||
ratio: Float? = null,
|
ratio: Float? = null,
|
||||||
attributesCustomizer: AttrBuilderContext<out HTMLElement> = {},
|
attributesCustomizer: AttrBuilderContext<out HTMLElement> = {},
|
||||||
onClick: ((Event) -> Unit)? = null
|
onClick: ((Event) -> Unit)? = null
|
||||||
) = invoke(modifiers, type = UIKitIconType.Button, ratio = ratio, onClick = onClick, attributesCustomizer = attributesCustomizer)
|
) = invoke(*modifiers, type = UIKitIconType.Button, ratio = ratio, onClick = onClick, attributesCustomizer = attributesCustomizer)
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun drawAsIcon(
|
fun drawAsIcon(
|
||||||
modifiers: Array<UIKitModifier> = emptyArray(),
|
vararg modifiers: UIKitModifier,
|
||||||
ratio: Float? = null,
|
ratio: Float? = null,
|
||||||
attributesCustomizer: AttrBuilderContext<out HTMLElement> = {},
|
attributesCustomizer: AttrBuilderContext<out HTMLElement> = {},
|
||||||
onClick: ((Event) -> Unit)? = null
|
onClick: ((Event) -> Unit)? = null
|
||||||
) = invoke(modifiers, type = UIKitIconType.Default, ratio = ratio, onClick = onClick, attributesCustomizer = attributesCustomizer)
|
) = invoke(*modifiers, type = UIKitIconType.Default, ratio = ratio, onClick = onClick, attributesCustomizer = attributesCustomizer)
|
||||||
}
|
}
|
@ -10,9 +10,9 @@ sealed interface Label {
|
|||||||
val suffix: String
|
val suffix: String
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
operator fun invoke(
|
fun draw(
|
||||||
text: String,
|
text: String,
|
||||||
modifiers: Array<UIKitModifier> = emptyArray(),
|
vararg modifiers: UIKitModifier,
|
||||||
attributesCustomizer: AttrBuilderContext<HTMLSpanElement> = {},
|
attributesCustomizer: AttrBuilderContext<HTMLSpanElement> = {},
|
||||||
) = Span(
|
) = Span(
|
||||||
{
|
{
|
@ -12,7 +12,7 @@ import org.w3c.dom.HTMLUListElement
|
|||||||
fun <T> List(
|
fun <T> List(
|
||||||
title: String,
|
title: String,
|
||||||
data: SnapshotStateList<T>,
|
data: SnapshotStateList<T>,
|
||||||
titleModifiers: Array<UIKitModifier> = emptyArray(),
|
vararg titleModifiers: UIKitModifier,
|
||||||
ulModifiers: Array<UIKitModifier> = emptyArray(),
|
ulModifiers: Array<UIKitModifier> = emptyArray(),
|
||||||
besidesTitleAndList: (@Composable () -> Unit)? = null,
|
besidesTitleAndList: (@Composable () -> Unit)? = null,
|
||||||
titleCustomizer: AttrBuilderContext<HTMLHeadingElement> = {},
|
titleCustomizer: AttrBuilderContext<HTMLHeadingElement> = {},
|
@ -10,7 +10,7 @@ import org.w3c.dom.HTMLUListElement
|
|||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun Nav(
|
fun Nav(
|
||||||
modifiers: Array<UIKitModifier> = emptyArray(),
|
vararg modifiers: UIKitModifier,
|
||||||
multiple: Boolean? = null,
|
multiple: Boolean? = null,
|
||||||
collapsible: Boolean? = null,
|
collapsible: Boolean? = null,
|
||||||
animation: UIKitAnimation? = null,
|
animation: UIKitAnimation? = null,
|
||||||
@ -37,7 +37,7 @@ fun Nav(
|
|||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun NavElement(
|
fun NavElement(
|
||||||
modifiers: Array<UIKitModifier> = emptyArray(),
|
vararg modifiers: UIKitModifier,
|
||||||
attributesCustomizer: AttrBuilderContext<HTMLLIElement> = {},
|
attributesCustomizer: AttrBuilderContext<HTMLLIElement> = {},
|
||||||
contentAllocator: ContentBuilder<HTMLLIElement>
|
contentAllocator: ContentBuilder<HTMLLIElement>
|
||||||
) {
|
) {
|
@ -11,7 +11,7 @@ fun Navbar(
|
|||||||
leftBuilder: NavbarNavBuilder? = null,
|
leftBuilder: NavbarNavBuilder? = null,
|
||||||
centerBuilder: NavbarNavBuilder? = null,
|
centerBuilder: NavbarNavBuilder? = null,
|
||||||
rightBuilder: NavbarNavBuilder? = null,
|
rightBuilder: NavbarNavBuilder? = null,
|
||||||
navModifiers: Array<UIKitModifier> = emptyArray(),
|
vararg navModifiers: UIKitModifier,
|
||||||
attributesCustomizer: AttrBuilderContext<HTMLElement> = {},
|
attributesCustomizer: AttrBuilderContext<HTMLElement> = {},
|
||||||
) {
|
) {
|
||||||
Nav(
|
Nav(
|
@ -10,7 +10,7 @@ import org.w3c.dom.HTMLProgressElement
|
|||||||
@Composable
|
@Composable
|
||||||
fun Progress(
|
fun Progress(
|
||||||
value: Int,
|
value: Int,
|
||||||
modifiers: Array<UIKitModifier> = emptyArray(),
|
vararg modifiers: UIKitModifier,
|
||||||
max: Int = 100,
|
max: Int = 100,
|
||||||
attributesCustomizer: AttrBuilderContext<HTMLProgressElement> = {}
|
attributesCustomizer: AttrBuilderContext<HTMLProgressElement> = {}
|
||||||
) {
|
) {
|
@ -8,7 +8,7 @@ import org.w3c.dom.HTMLDivElement
|
|||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun Spinner(
|
fun Spinner(
|
||||||
modifiers: Array<UIKitModifier> = emptyArray(),
|
vararg modifiers: UIKitModifier,
|
||||||
ratio: Float? = null,
|
ratio: Float? = null,
|
||||||
attributesCustomizer: AttrBuilderContext<HTMLDivElement> = {}
|
attributesCustomizer: AttrBuilderContext<HTMLDivElement> = {}
|
||||||
) {
|
) {
|
||||||
@ -23,6 +23,4 @@ fun Spinner(
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun DefaultSpinner() = Spinner(
|
fun DefaultSpinner() = Spinner(UIKitAlign.Center, UIKitMargin.Small, UIKitText.Alignment.Center)
|
||||||
arrayOf(UIKitAlign.Center, UIKitMargin.Small, UIKitText.Alignment.Center)
|
|
||||||
)
|
|
@ -11,7 +11,7 @@ import org.w3c.dom.HTMLTableElement
|
|||||||
fun <T> DefaultTable(
|
fun <T> DefaultTable(
|
||||||
heading: List<String>,
|
heading: List<String>,
|
||||||
dataList: SnapshotStateList<T>,
|
dataList: SnapshotStateList<T>,
|
||||||
tableModifiers: Array<UIKitModifier> = emptyArray(),
|
vararg tableModifiers: UIKitModifier,
|
||||||
attributesCustomizer: AttrBuilderContext<HTMLTableElement> = {},
|
attributesCustomizer: AttrBuilderContext<HTMLTableElement> = {},
|
||||||
cellFiller: @Composable (i: Int, t: T) -> Unit
|
cellFiller: @Composable (i: Int, t: T) -> Unit
|
||||||
) {
|
) {
|
@ -14,7 +14,7 @@ fun <T> TextField(
|
|||||||
state: MutableState<T>,
|
state: MutableState<T>,
|
||||||
disabledState: State<Boolean>? = null,
|
disabledState: State<Boolean>? = null,
|
||||||
placeholder: String? = null,
|
placeholder: String? = null,
|
||||||
modifiers: Array<UIKitModifier> = emptyArray(),
|
vararg modifiers: UIKitModifier,
|
||||||
attributesCustomizer: AttrBuilderContext<HTMLInputElement> = {},
|
attributesCustomizer: AttrBuilderContext<HTMLInputElement> = {},
|
||||||
) {
|
) {
|
||||||
Input(type) {
|
Input(type) {
|
Loading…
Reference in New Issue
Block a user