File tree Expand file tree Collapse file tree 4 files changed +7
-17
lines changed
compose-multiplatform-material
src/jsMain/kotlin/com/huanshankeji/compose/material Expand file tree Collapse file tree 4 files changed +7
-17
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,6 @@ kotlin {
1616 dependencies {
1717 api(compose.runtime)
1818 implementation(" org.jetbrains.compose.annotation-internal:annotation:${DependencyVersions .composeMultiplatform} " )
19- api(project(" :compose-multiplatform-common:compose-multiplatform-common-legacy" )) // TODO remove
2019 api(project(" :compose-multiplatform-common" ))
2120 // compileOnly(compose.material) // for KDoc element links only
2221 }
Original file line number Diff line number Diff line change @@ -6,11 +6,8 @@ import com.huanshankeji.compose.foundation.layout.RowScope
66import com.huanshankeji.compose.material.ext.ButtonType
77import com.huanshankeji.compose.material.ext.toMDCButtonType
88import com.huanshankeji.compose.ui.Modifier
9- import com.huanshankeji.compose.web.attributes.attrs
10- import com.huanshankeji.compose.web.attributes.plus
119import com.varabyte.kobweb.compose.ui.toAttrs
1210import dev.petuska.kmdc.button.MDCButton
13- import org.w3c.dom.HTMLButtonElement
1411
1512@Composable
1613private fun Button (
@@ -20,9 +17,9 @@ private fun Button(
2017 content : @Composable RowScope .() -> Unit
2118) =
2219 MDCButton (buttonType.toMDCButtonType(),
23- attrs = attrs< HTMLButtonElement > {
20+ attrs = modifier.platformModifier.toAttrs {
2421 onClick { onClick() }
25- } + modifier.platformModifier.toAttrs() ) {
22+ }) {
2623 Row (content = content)
2724 }
2825
Original file line number Diff line number Diff line change @@ -2,15 +2,11 @@ package com.huanshankeji.compose.material
22
33import androidx.compose.runtime.Composable
44import com.huanshankeji.compose.ui.Modifier
5- import com.huanshankeji.compose.web.css.FIT_CONTENT
6- import com.huanshankeji.compose.web.css.width
5+ import com.huanshankeji.kobweb.compose.ui.modifiers.sizeFitContent
76import com.varabyte.kobweb.compose.ui.toAttrs
87import dev.petuska.kmdc.card.MDCCard
8+ import com.varabyte.kobweb.compose.ui.Modifier as PlatformModifier
99
1010@Composable
1111actual fun Card (modifier : Modifier , content : @Composable () -> Unit ) =
12- MDCCard (attrs = modifier.platformModifier.toAttrs {
13- style {
14- width(FIT_CONTENT )
15- }
16- }) { content() }
12+ MDCCard (attrs = PlatformModifier .sizeFitContent().then(modifier.platformModifier).toAttrs()) { content() }
Original file line number Diff line number Diff line change @@ -3,8 +3,6 @@ package com.huanshankeji.compose.material.ext
33import androidx.compose.runtime.Composable
44import com.huanshankeji.compose.material.ext.ButtonType.*
55import com.huanshankeji.compose.ui.Modifier
6- import com.huanshankeji.compose.web.attributes.attrs
7- import com.huanshankeji.compose.web.attributes.plus
86import com.varabyte.kobweb.compose.ui.toAttrs
97import dev.petuska.kmdc.button.Label
108import dev.petuska.kmdc.button.MDCButton
@@ -20,9 +18,9 @@ actual fun Button(
2018 content : @Composable ButtonScope .() -> Unit
2119) =
2220 MDCButton (buttonType.toMDCButtonType(),
23- attrs = attrs< HTMLButtonElement > {
21+ attrs = modifier.platformModifier.toAttrs {
2422 onClick { onClick() }
25- } + modifier.platformModifier.toAttrs() ) {
23+ }) {
2624 ButtonScope (this ).content()
2725 }
2826
You can’t perform that action at this time.
0 commit comments