Browse Source
Co-authored-by: Oleksandr Karpovich <oleksandr.karpovich@jetbrains.com>pull/2297/head
Oleksandr Karpovich
2 years ago
committed by
GitHub
87 changed files with 505 additions and 1934 deletions
@ -1,45 +0,0 @@
|
||||
import org.jetbrains.compose.gradle.standardConf |
||||
|
||||
plugins { |
||||
kotlin("multiplatform") |
||||
id("org.jetbrains.compose") |
||||
} |
||||
|
||||
|
||||
kotlin { |
||||
js(IR) { |
||||
browser() { |
||||
testTask { |
||||
useKarma { |
||||
standardConf() |
||||
} |
||||
} |
||||
} |
||||
binaries.executable() |
||||
} |
||||
|
||||
sourceSets { |
||||
val commonMain by getting { |
||||
dependencies { |
||||
implementation(compose.runtime) |
||||
implementation(kotlin("stdlib-common")) |
||||
|
||||
implementation(project(":web-core")) |
||||
implementation(project(":web-widgets")) |
||||
} |
||||
} |
||||
|
||||
val jsMain by getting { |
||||
dependencies { |
||||
implementation(kotlin("stdlib-js")) |
||||
implementation(npm("highlight.js", "10.7.2")) |
||||
} |
||||
} |
||||
|
||||
val jsTest by getting { |
||||
dependencies { |
||||
implementation(kotlin("test-js")) |
||||
} |
||||
} |
||||
} |
||||
} |
@ -1,128 +0,0 @@
|
||||
package org.jetbrainsc.compose.common.demo |
||||
|
||||
import androidx.compose.runtime.Composable |
||||
import org.jetbrains.compose.common.foundation.layout.Box |
||||
import org.jetbrains.compose.common.ui.unit.dp |
||||
import org.jetbrains.compose.common.core.graphics.Color |
||||
import org.jetbrains.compose.common.foundation.layout.Row |
||||
import org.jetbrains.compose.common.foundation.layout.Column |
||||
import org.jetbrains.compose.common.foundation.layout.Arrangement |
||||
import org.jetbrains.compose.common.foundation.border |
||||
import org.jetbrains.compose.common.material.Text |
||||
import org.jetbrains.compose.common.ui.unit.em |
||||
import org.jetbrains.compose.common.material.Slider |
||||
import androidx.compose.runtime.mutableStateOf |
||||
import androidx.compose.runtime.remember |
||||
import org.jetbrains.compose.common.material.Button |
||||
import org.jetbrains.compose.common.foundation.layout.width |
||||
import org.jetbrains.compose.common.foundation.clickable |
||||
import org.jetbrains.compose.common.ui.draw.clip |
||||
import jetbrains.compose.common.shapes.CircleShape |
||||
import org.jetbrains.compose.common.ui.* |
||||
|
||||
@OptIn(ExperimentalComposeWebWidgetsApi::class) |
||||
object LayoutSamples { |
||||
@Composable |
||||
fun TwoTexts() { |
||||
Text("Alfred Sisley") |
||||
Text("3 minutes ago") |
||||
} |
||||
|
||||
@Composable |
||||
fun TwoTextsInColumn() { |
||||
val defaultFontSize = 0.79f |
||||
val fontSize = remember { mutableStateOf(defaultFontSize) } |
||||
val subtitleColor = remember { mutableStateOf(Color(0, 0, 200)) } |
||||
Column { |
||||
Text("Alfred Sisley") |
||||
Text( |
||||
"3 minutes ago", |
||||
color = subtitleColor.value, |
||||
size = fontSize.value.em, |
||||
modifier = Modifier.clickable { |
||||
subtitleColor.value = Color.Yellow |
||||
} |
||||
) |
||||
Slider( |
||||
fontSize.value, |
||||
onValueChange = { value -> |
||||
fontSize.value = value |
||||
}, |
||||
valueRange = 0.1f..1.2f, |
||||
steps = 80, |
||||
modifier = Modifier.width(200.dp) |
||||
) |
||||
Button( |
||||
onClick = { |
||||
fontSize.value = defaultFontSize |
||||
} |
||||
) { |
||||
Text("reset view") |
||||
} |
||||
} |
||||
} |
||||
|
||||
@Composable |
||||
fun TwoTextsInRow() { |
||||
Text("Alfred Sisley") |
||||
Text("3 minutes ago") |
||||
} |
||||
|
||||
@Composable |
||||
fun Layouts() { |
||||
val horizontalArrangements = listOf(Arrangement.Start, Arrangement.End) |
||||
val verticalAlignments = listOf(Alignment.Top, Alignment.CenterVertically, Alignment.Bottom) |
||||
Column() { |
||||
horizontalArrangements.forEach { horizontalArrangement -> |
||||
verticalAlignments.forEach { verticalAlignment -> |
||||
Row( |
||||
modifier = Modifier |
||||
.size(150.dp) |
||||
.padding(4.dp) |
||||
.border(1.dp, Color(0, 0, 200)) |
||||
.background(Color.Yellow), |
||||
horizontalArrangement = horizontalArrangement, |
||||
verticalAlignment = verticalAlignment |
||||
) { |
||||
Box(Modifier.size(50.dp).background(Color.Red)) { } |
||||
Box(Modifier.size(30.dp).background(Color.Blue)) { } |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
@Composable |
||||
fun LayoutsClipped() { |
||||
val horizontalArrangements = listOf(Arrangement.Start, Arrangement.End) |
||||
val verticalAlignments = listOf(Alignment.Top, Alignment.CenterVertically, Alignment.Bottom) |
||||
Column() { |
||||
horizontalArrangements.forEach { horizontalArrangement -> |
||||
verticalAlignments.forEach { verticalAlignment -> |
||||
Row( |
||||
modifier = Modifier |
||||
.size(150.dp) |
||||
.padding(4.dp) |
||||
.border(1.dp, Color(0, 0, 200)) |
||||
.background(Color.Yellow), |
||||
horizontalArrangement = horizontalArrangement, |
||||
verticalAlignment = verticalAlignment |
||||
) { |
||||
Box(Modifier.size(50.dp).background(Color.Red)) { } |
||||
Box( |
||||
Modifier |
||||
.clip(CircleShape) |
||||
.size(30.dp) |
||||
.background(Color.Blue) |
||||
) { } |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
@Composable |
||||
fun App() { |
||||
LayoutSamples.TwoTextsInColumn() |
||||
} |
@ -1,33 +0,0 @@
|
||||
/* |
||||
* Copyright 2021 The Android Open Source Project |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0 |
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
package org.jetbrainsc.compose.common.demo |
||||
|
||||
import org.jetbrains.compose.web.renderComposable |
||||
import kotlinx.browser.document |
||||
import org.w3c.dom.HTMLElement |
||||
import org.jetbrains.compose.web.css.Style |
||||
import org.jetbrains.compose.web.ui.Styles |
||||
|
||||
fun main() { |
||||
val root = document.getElementById("root") as HTMLElement |
||||
|
||||
renderComposable( |
||||
root = root |
||||
) { |
||||
Style(Styles) |
||||
App() |
||||
} |
||||
} |
@ -1,49 +0,0 @@
|
||||
<!-- |
||||
~ Copyright 2021 The Android Open Source Project |
||||
~ |
||||
~ Licensed under the Apache License, Version 2.0 (the "License"); |
||||
~ you may not use this file except in compliance with the License. |
||||
~ You may obtain a copy of the License at |
||||
~ |
||||
~ http://www.apache.org/licenses/LICENSE-2.0 |
||||
~ |
||||
~ Unless required by applicable law or agreed to in writing, software |
||||
~ distributed under the License is distributed on an "AS IS" BASIS, |
||||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
~ See the License for the specific language governing permissions and |
||||
~ limitations under the License. |
||||
--> |
||||
|
||||
<!DOCTYPE html> |
||||
<html lang="en"> |
||||
<head> |
||||
<meta charset="UTF-8"> |
||||
<title>compose-browser-with-web-demo</title> |
||||
<link type="text/css" rel="stylesheet" href="styles.css"> |
||||
</head> |
||||
<body> |
||||
<h1>with web demo</h1> |
||||
|
||||
<div id="container"> |
||||
<div id = "rootParent"> |
||||
<div id="root"></div> |
||||
</div> |
||||
<div id= "raw"> |
||||
<div> |
||||
<span> |
||||
Alfred Sisley |
||||
</span> |
||||
<span> |
||||
3 minutes ago |
||||
</span> |
||||
<div class="row"> |
||||
<div class="box-a box"></div> |
||||
<div class="box-b box"></div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<script src="web-integration-widgets.js"> |
||||
</script> |
||||
</body> |
||||
</html> |
@ -1,49 +0,0 @@
|
||||
/* |
||||
* Copyright 2021 The Android Open Source Project |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0 |
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
#container { |
||||
display: flex; |
||||
} |
||||
|
||||
#rootParent { |
||||
background: lemonchiffon; |
||||
flex: 1 1 0px; |
||||
} |
||||
|
||||
#raw { |
||||
background: powderblue; |
||||
flex: 1 1 0px; |
||||
} |
||||
|
||||
.row { |
||||
width: 150px; |
||||
height: 150px; |
||||
background: yellow; |
||||
display: flex; |
||||
align-items: end; |
||||
} |
||||
|
||||
.box-a { |
||||
background: red; |
||||
width: 50px; |
||||
height: 50px; |
||||
} |
||||
|
||||
.box-b { |
||||
background: blue; |
||||
width: 30px; |
||||
height: 30px; |
||||
} |
@ -1,25 +0,0 @@
|
||||
/* |
||||
* Copyright 2021 The Android Open Source Project |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0 |
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
package org.jetbrainsc.compose.common.demo |
||||
|
||||
import androidx.compose.desktop.Window |
||||
import androidx.compose.ui.unit.IntSize |
||||
|
||||
fun main() { |
||||
Window(title = "Demo", size = IntSize(800, 800)) { |
||||
App() |
||||
} |
||||
} |
@ -1,47 +0,0 @@
|
||||
import org.jetbrains.compose.gradle.standardConf |
||||
|
||||
plugins { |
||||
kotlin("multiplatform") |
||||
id("org.jetbrains.compose") |
||||
} |
||||
|
||||
|
||||
kotlin { |
||||
jvm() |
||||
js(IR) { |
||||
browser() { |
||||
testTask { |
||||
useKarma { |
||||
standardConf() |
||||
} |
||||
} |
||||
} |
||||
binaries.executable() |
||||
} |
||||
|
||||
sourceSets { |
||||
val commonMain by getting { |
||||
dependencies { |
||||
implementation(compose.runtime) |
||||
} |
||||
} |
||||
|
||||
val jsMain by getting { |
||||
dependencies { |
||||
implementation(project(":web-core")) |
||||
} |
||||
} |
||||
|
||||
val jsTest by getting { |
||||
dependencies { |
||||
implementation(kotlin("test-js")) |
||||
} |
||||
} |
||||
|
||||
val jvmMain by getting { |
||||
dependencies { |
||||
implementation(compose.desktop.currentOs) |
||||
} |
||||
} |
||||
} |
||||
} |
@ -1,32 +0,0 @@
|
||||
package org.jetbrains.compose.common.ui |
||||
|
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
interface Alignment { |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
interface Vertical : Alignment |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
interface Horizontal : Alignment |
||||
|
||||
companion object { |
||||
val TopStart = object : Alignment {} |
||||
val TopCenter = object : Alignment {} |
||||
val TopEnd = object : Alignment {} |
||||
val CenterStart = object : Alignment {} |
||||
val Center = object : Alignment {} |
||||
val CenterEnd = object : Alignment {} |
||||
val BottomStart = object : Alignment {} |
||||
val BottomCenter = object : Alignment {} |
||||
val BottomEnd = object : Alignment {} |
||||
|
||||
val Top = object : Alignment.Vertical {} |
||||
val CenterVertically = object : Alignment.Vertical {} |
||||
val Bottom = object : Alignment.Vertical {} |
||||
|
||||
val Start = object : Alignment.Horizontal {} |
||||
val CenterHorizontally = object : Alignment.Horizontal {} |
||||
val End = object : Alignment.Horizontal {} |
||||
} |
||||
} |
@ -1,21 +0,0 @@
|
||||
package org.jetbrains.compose.common.foundation.layout |
||||
|
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
object Arrangement { |
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
interface Horizontal |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
interface Vertical |
||||
|
||||
val End = object : Horizontal {} |
||||
val Start = object : Horizontal {} |
||||
val Top = object : Vertical {} |
||||
val Bottom = object : Vertical {} |
||||
} |
@ -1,34 +0,0 @@
|
||||
package org.jetbrains.compose.common.core.graphics |
||||
|
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
public data class Color(val red: Int, val green: Int, val blue: Int) { |
||||
|
||||
companion object { |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
val Black = Color(0, 0, 0) |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
val DarkGray = Color(0x44, 0x44, 0x44) |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
val Gray = Color(0x88, 0x88, 0x88) |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
val LightGray = Color(0xCC, 0xCC, 0xCC) |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
val White = Color(0xFF, 0xFF, 0xFF) |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
val Red = Color(0xFF, 0, 0) |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
val Green = Color(0, 0xFF, 0) |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
val Blue = Color(0, 0, 0xFF) |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
val Yellow = Color(0xFF, 0xFF, 0x00) |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
val Cyan = Color(0, 0xFF, 0xFF) |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
val Magenta = Color(0xFF, 0, 0xFF) |
||||
} |
||||
} |
@ -1,4 +0,0 @@
|
||||
package org.jetbrains.compose.common.ui |
||||
|
||||
@RequiresOptIn("This API is experimental and is likely to change in the future.") |
||||
annotation class ExperimentalComposeWebWidgetsApi() |
@ -1,21 +0,0 @@
|
||||
package org.jetbrains.compose.common.ui |
||||
|
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.unit.Dp |
||||
import org.jetbrains.compose.common.core.graphics.Color |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
interface Modifier { |
||||
open class Element : Modifier |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
companion object : Element() |
||||
} |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
expect fun Modifier.background(color: Color): Modifier |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
expect fun Modifier.padding(all: Dp): Modifier |
@ -1,8 +0,0 @@
|
||||
/* |
||||
* Copyright 2020-2021 JetBrains s.r.o. and respective authors and developers. |
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE.txt file. |
||||
*/ |
||||
|
||||
package org.jetbrains.compose.annotations |
||||
|
||||
const val webWidgetsDeprecationMessage = "compose.web.web-widgets API is deprecated" |
@ -1,11 +0,0 @@
|
||||
package org.jetbrains.compose.common.foundation.layout |
||||
|
||||
import org.jetbrains.compose.common.ui.Modifier |
||||
import androidx.compose.runtime.Composable |
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
|
||||
@Composable |
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
internal expect fun BoxActual(modifier: Modifier, content: @Composable () -> Unit) |
@ -1,15 +0,0 @@
|
||||
package org.jetbrains.compose.common.material |
||||
|
||||
import org.jetbrains.compose.common.ui.Modifier |
||||
import androidx.compose.runtime.Composable |
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
|
||||
@Composable |
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
internal expect fun ButtonActual( |
||||
modifier: Modifier, |
||||
onClick: () -> Unit, |
||||
content: @Composable () -> Unit |
||||
) |
@ -1,11 +0,0 @@
|
||||
package org.jetbrains.compose.common.foundation.layout |
||||
|
||||
import org.jetbrains.compose.common.ui.Modifier |
||||
import androidx.compose.runtime.Composable |
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
|
||||
@Composable |
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
internal expect fun ColumnActual(modifier: Modifier, content: @Composable () -> Unit) |
@ -1,14 +0,0 @@
|
||||
package org.jetbrains.compose.common.foundation.layout |
||||
|
||||
import org.jetbrains.compose.common.ui.Modifier |
||||
import androidx.compose.runtime.Composable |
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
|
||||
@Composable |
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
fun Box( |
||||
modifier: Modifier = Modifier.Companion, |
||||
content: @Composable () -> Unit |
||||
) { BoxActual(modifier, content) } |
@ -1,17 +0,0 @@
|
||||
package org.jetbrains.compose.common.material |
||||
|
||||
import org.jetbrains.compose.common.ui.Modifier |
||||
import androidx.compose.runtime.Composable |
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
|
||||
@Composable |
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
fun Button( |
||||
modifier: Modifier = Modifier.Companion, |
||||
onClick: () -> Unit, |
||||
content: @Composable () -> Unit |
||||
) { |
||||
ButtonActual(modifier, onClick, content) |
||||
} |
@ -1,14 +0,0 @@
|
||||
package org.jetbrains.compose.common.foundation.layout |
||||
|
||||
import org.jetbrains.compose.common.ui.Modifier |
||||
import androidx.compose.runtime.Composable |
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
|
||||
@Composable |
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
fun Column( |
||||
modifier: Modifier = Modifier.Companion, |
||||
content: @Composable () -> Unit |
||||
) { ColumnActual(modifier, content) } |
@ -1,10 +0,0 @@
|
||||
package org.jetbrains.compose.common.ui |
||||
|
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.unit.Dp |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
fun Modifier.size(size: Dp): Modifier { |
||||
return size(size, size) |
||||
} |
@ -1,17 +0,0 @@
|
||||
package org.jetbrains.compose.common.foundation.layout |
||||
|
||||
import org.jetbrains.compose.common.ui.Modifier |
||||
import androidx.compose.runtime.Composable |
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.Alignment |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
|
||||
@Composable |
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
fun Row( |
||||
modifier: Modifier = Modifier.Companion, |
||||
horizontalArrangement: Arrangement.Horizontal = Arrangement.Start, |
||||
verticalAlignment: Alignment.Vertical = Alignment.Top, |
||||
content: @Composable () -> Unit |
||||
) { RowActual(modifier, horizontalArrangement, verticalAlignment, content) } |
@ -1,25 +0,0 @@
|
||||
package org.jetbrains.compose.common.material |
||||
|
||||
import androidx.compose.runtime.Composable |
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
import org.jetbrains.compose.common.ui.Modifier |
||||
|
||||
@Composable |
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
fun Slider( |
||||
value: Float, |
||||
onValueChange: (Float) -> Unit = {}, |
||||
valueRange: ClosedFloatingPointRange<Float> = 0f..1f, |
||||
steps: Int = 0, |
||||
modifier: Modifier = Modifier.Companion |
||||
) { |
||||
SliderActual( |
||||
value, |
||||
onValueChange, |
||||
valueRange, |
||||
steps, |
||||
modifier |
||||
) |
||||
} |
@ -1,20 +0,0 @@
|
||||
package org.jetbrains.compose.common.material |
||||
|
||||
import androidx.compose.runtime.Composable |
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.Modifier |
||||
import org.jetbrains.compose.common.core.graphics.Color |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
import org.jetbrains.compose.common.ui.unit.TextUnit |
||||
|
||||
@Composable |
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
fun Text( |
||||
text: String, |
||||
modifier: Modifier = Modifier.Companion, |
||||
color: Color = Color.Black, |
||||
size: TextUnit = TextUnit.Unspecified |
||||
) { |
||||
TextActual(text, modifier, color, size) |
||||
} |
@ -1,17 +0,0 @@
|
||||
package org.jetbrains.compose.common.foundation.layout |
||||
|
||||
import org.jetbrains.compose.common.ui.Modifier |
||||
import androidx.compose.runtime.Composable |
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.Alignment |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
|
||||
@Composable |
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
internal expect fun RowActual( |
||||
modifier: Modifier, |
||||
horizontalArrangement: Arrangement.Horizontal, |
||||
verticalAlignment: Alignment.Vertical, |
||||
content: @Composable () -> Unit |
||||
) |
@ -1,12 +0,0 @@
|
||||
package jetbrains.compose.common.shapes |
||||
|
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
interface Shape |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
object CircleShape : Shape |
@ -1,17 +0,0 @@
|
||||
package org.jetbrains.compose.common.material |
||||
|
||||
import androidx.compose.runtime.Composable |
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
import org.jetbrains.compose.common.ui.Modifier |
||||
|
||||
@Composable |
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
internal expect fun SliderActual( |
||||
value: Float, |
||||
onValueChange: (Float) -> Unit, |
||||
valueRange: ClosedFloatingPointRange<Float>, |
||||
steps: Int, |
||||
modifier: Modifier, |
||||
) |
@ -1,18 +0,0 @@
|
||||
package org.jetbrains.compose.common.material |
||||
|
||||
import androidx.compose.runtime.Composable |
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.Modifier |
||||
import org.jetbrains.compose.common.core.graphics.Color |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
import org.jetbrains.compose.common.ui.unit.TextUnit |
||||
|
||||
@Composable |
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
internal expect fun TextActual( |
||||
text: String, |
||||
modifier: Modifier, |
||||
color: Color, |
||||
size: TextUnit |
||||
) |
@ -1,11 +0,0 @@
|
||||
package org.jetbrains.compose.common.foundation |
||||
|
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.unit.Dp |
||||
import org.jetbrains.compose.common.core.graphics.Color |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
import org.jetbrains.compose.common.ui.Modifier |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
expect fun Modifier.border(size: Dp, color: Color): Modifier |
@ -1,9 +0,0 @@
|
||||
package org.jetbrains.compose.common.foundation |
||||
|
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
import org.jetbrains.compose.common.ui.Modifier |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
expect fun Modifier.clickable(onClick: () -> Unit): Modifier |
@ -1,10 +0,0 @@
|
||||
package org.jetbrains.compose.common.ui.draw |
||||
|
||||
import org.jetbrains.compose.common.ui.Modifier |
||||
import jetbrains.compose.common.shapes.Shape |
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
expect fun Modifier.clip(shape: Shape): Modifier |
@ -1,9 +0,0 @@
|
||||
package org.jetbrains.compose.common.foundation.layout |
||||
|
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
import org.jetbrains.compose.common.ui.Modifier |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
expect fun Modifier.fillMaxHeight(fraction: Float): Modifier |
@ -1,9 +0,0 @@
|
||||
package org.jetbrains.compose.common.foundation.layout |
||||
|
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
import org.jetbrains.compose.common.ui.Modifier |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
expect fun Modifier.fillMaxWidth(): Modifier |
@ -1,10 +0,0 @@
|
||||
package org.jetbrains.compose.common.foundation.layout |
||||
|
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
import org.jetbrains.compose.common.ui.unit.Dp |
||||
import org.jetbrains.compose.common.ui.Modifier |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
expect fun Modifier.offset(x: Dp, y: Dp): Modifier |
@ -1,12 +0,0 @@
|
||||
package org.jetbrains.compose.common.ui.layout |
||||
|
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
import org.jetbrains.compose.common.ui.Modifier |
||||
import org.jetbrains.compose.common.ui.unit.IntSize |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
expect fun Modifier.onSizeChanged( |
||||
onSizeChanged: (IntSize) -> Unit |
||||
): Modifier |
@ -1,8 +0,0 @@
|
||||
package org.jetbrains.compose.common.ui |
||||
|
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.unit.Dp |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
expect fun Modifier.size(width: Dp, height: Dp): Modifier |
@ -1,10 +0,0 @@
|
||||
package org.jetbrains.compose.common.foundation.layout |
||||
|
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
import org.jetbrains.compose.common.ui.unit.Dp |
||||
import org.jetbrains.compose.common.ui.Modifier |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
expect fun Modifier.width(size: Dp): Modifier |
@ -1,8 +0,0 @@
|
||||
package org.jetbrains.compose.common.ui.unit |
||||
|
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
data class Dp(val value: Float) |
@ -1,8 +0,0 @@
|
||||
package org.jetbrains.compose.common.ui.unit |
||||
|
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
data class IntSize(val width: Int, val height: Int) |
@ -1,21 +0,0 @@
|
||||
package org.jetbrains.compose.common.ui.unit |
||||
|
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
enum class TextUnitType { |
||||
Unspecified, |
||||
Em, |
||||
Sp |
||||
} |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
data class TextUnit(val value: Float, val unitType: TextUnitType) { |
||||
companion object { |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
val Unspecified = TextUnit(Float.NaN, TextUnitType.Unspecified) |
||||
} |
||||
} |
@ -1,30 +0,0 @@
|
||||
package org.jetbrains.compose.common.ui.unit |
||||
|
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
|
||||
// TODO: this have to be in a separate package otherwise there's an error for in cross-module usage (for JVM target) |
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
val Int.dp: Dp |
||||
get() = Dp(this.toFloat()) |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
val Int.em: TextUnit |
||||
get() = TextUnit(toFloat(), TextUnitType.Em) |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
val Float.em: TextUnit |
||||
get() = TextUnit(this, TextUnitType.Em) |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
val Int.sp: TextUnit |
||||
get() = TextUnit(toFloat(), TextUnitType.Sp) |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
val Float.sp: TextUnit |
||||
get() = TextUnit(this, TextUnitType.Sp) |
@ -1,47 +0,0 @@
|
||||
package org.jetbrains.compose.common.ui |
||||
|
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.unit.Dp |
||||
import org.jetbrains.compose.common.core.graphics.Color |
||||
import org.jetbrains.compose.web.css.backgroundColor |
||||
import org.jetbrains.compose.web.css.margin |
||||
import org.jetbrains.compose.web.css.px |
||||
import org.jetbrains.compose.web.css.Color.RGB |
||||
import org.jetbrains.compose.common.internal.castOrCreate |
||||
import org.jetbrains.compose.web.attributes.AttrsScope |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
actual fun Modifier.background(color: Color): Modifier = castOrCreate().apply { |
||||
add { |
||||
backgroundColor(RGB(color.red, color.green, color.blue)) |
||||
} |
||||
} |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
fun Modifier.asAttributeBuilderApplier( |
||||
passThroughHandler: (AttrsScope<*>.() -> Unit)? = null |
||||
): AttrsScope<*>.() -> Unit = |
||||
castOrCreate().let { modifier -> |
||||
val st: AttrsScope<*>.() -> Unit = { |
||||
modifier.attrHandlers.forEach { it.invoke(this) } |
||||
|
||||
style { |
||||
modifier.styleHandlers.forEach { it.invoke(this) } |
||||
} |
||||
|
||||
passThroughHandler?.invoke(this) |
||||
} |
||||
|
||||
st |
||||
} |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
actual fun Modifier.padding(all: Dp): Modifier = castOrCreate().apply { |
||||
// yes, it's not a typo, what Modifier.padding does is actually adding margin |
||||
add { |
||||
margin(all.value.px) |
||||
} |
||||
} |
@ -1,50 +0,0 @@
|
||||
package org.jetbrains.compose.web.ui |
||||
|
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.web.css.justifyContent |
||||
import org.jetbrains.compose.web.css.JustifyContent |
||||
import org.jetbrains.compose.web.css.alignItems |
||||
import org.jetbrains.compose.web.css.AlignItems |
||||
import org.jetbrains.compose.web.css.flexDirection |
||||
import org.jetbrains.compose.web.css.FlexDirection |
||||
import org.jetbrains.compose.web.css.display |
||||
import org.jetbrains.compose.web.css.DisplayStyle |
||||
import org.jetbrains.compose.web.css.left |
||||
import org.jetbrains.compose.web.css.px |
||||
|
||||
import org.jetbrains.compose.web.css.StyleSheet |
||||
|
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
object Styles : StyleSheet() { |
||||
val columnClass = "compose-web-column" |
||||
|
||||
val textClass by style { |
||||
display(DisplayStyle.Block) |
||||
left(0.px) |
||||
} |
||||
|
||||
val rowClass by style { |
||||
display(DisplayStyle.Flex) |
||||
flexDirection(FlexDirection.Row) |
||||
} |
||||
|
||||
val composeWebArrangementHorizontalStart by style { |
||||
justifyContent(JustifyContent.FlexStart) |
||||
} |
||||
|
||||
val composeWebArrangementHorizontalEnd by style { |
||||
justifyContent(JustifyContent.FlexEnd) |
||||
} |
||||
|
||||
val composeWebAlignmentVerticalTop by style { |
||||
alignItems(AlignItems.FlexStart) |
||||
} |
||||
|
||||
val composeWebAlignmentVerticalCenter by style { |
||||
alignItems(AlignItems.Center) |
||||
} |
||||
|
||||
val composeWebAlignmentVerticalBottom by style { |
||||
alignItems(AlignItems.FlexEnd) |
||||
} |
||||
} |
@ -1,26 +0,0 @@
|
||||
package org.jetbrains.compose.common.internal |
||||
|
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
import org.jetbrains.compose.common.ui.Modifier |
||||
import org.jetbrains.compose.web.css.StyleBuilder |
||||
import org.jetbrains.compose.web.attributes.AttrsScope |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
class ActualModifier : Modifier { |
||||
val styleHandlers = mutableListOf<StyleBuilder.() -> Unit>() |
||||
val attrHandlers = mutableListOf<AttrsScope<*>.() -> Unit>() |
||||
|
||||
fun add(builder: StyleBuilder.() -> Unit) { |
||||
styleHandlers.add(builder) |
||||
} |
||||
|
||||
fun addAttributeBuilder(builder: AttrsScope<*>.() -> Unit) { |
||||
attrHandlers.add(builder) |
||||
} |
||||
} |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
fun Modifier.castOrCreate(): ActualModifier = (this as? ActualModifier) ?: ActualModifier() |
@ -1,19 +0,0 @@
|
||||
package org.jetbrains.compose.common.foundation.layout |
||||
|
||||
import org.jetbrains.compose.common.ui.Modifier |
||||
import androidx.compose.runtime.Composable |
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
import org.jetbrains.compose.web.dom.Div |
||||
import org.jetbrains.compose.common.ui.asAttributeBuilderApplier |
||||
|
||||
@Composable |
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
internal actual fun BoxActual(modifier: Modifier, content: @Composable () -> Unit) { |
||||
Div( |
||||
attrs = modifier.asAttributeBuilderApplier() |
||||
) { |
||||
content() |
||||
} |
||||
} |
@ -1,24 +0,0 @@
|
||||
package org.jetbrains.compose.common.material |
||||
|
||||
import org.jetbrains.compose.common.ui.Modifier |
||||
import androidx.compose.runtime.Composable |
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
import org.jetbrains.compose.web.dom.Button |
||||
|
||||
@Composable |
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
actual fun ButtonActual( |
||||
modifier: Modifier, |
||||
onClick: () -> Unit, |
||||
content: @Composable () -> Unit |
||||
) { |
||||
Button( |
||||
attrs = { |
||||
onClick { onClick() } |
||||
} |
||||
) { |
||||
content() |
||||
} |
||||
} |
@ -1,21 +0,0 @@
|
||||
package org.jetbrains.compose.common.foundation.layout |
||||
|
||||
import org.jetbrains.compose.common.ui.Modifier |
||||
import androidx.compose.runtime.Composable |
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
import org.jetbrains.compose.web.dom.Div |
||||
import org.jetbrains.compose.web.ui.Styles |
||||
|
||||
@Composable |
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
internal actual fun ColumnActual(modifier: Modifier, content: @Composable () -> Unit) { |
||||
Div( |
||||
attrs = { |
||||
classes(Styles.columnClass) |
||||
} |
||||
) { |
||||
content() |
||||
} |
||||
} |
@ -1,46 +0,0 @@
|
||||
package org.jetbrains.compose.common.foundation.layout |
||||
|
||||
import org.jetbrains.compose.common.ui.Modifier |
||||
import androidx.compose.runtime.Composable |
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.web.dom.Div |
||||
import org.jetbrains.compose.common.ui.Alignment |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
import org.jetbrains.compose.web.ui.Styles |
||||
|
||||
@OptIn(ExperimentalComposeWebWidgetsApi::class) |
||||
private fun Arrangement.Horizontal.asClassName() = when (this) { |
||||
Arrangement.End -> Styles.composeWebArrangementHorizontalEnd |
||||
else -> Styles.composeWebArrangementHorizontalStart |
||||
} |
||||
|
||||
@OptIn(ExperimentalComposeWebWidgetsApi::class) |
||||
private fun Alignment.Vertical.asClassName() = when (this) { |
||||
Alignment.Top -> Styles.composeWebAlignmentVerticalTop |
||||
Alignment.CenterVertically -> Styles.composeWebAlignmentVerticalCenter |
||||
else -> Styles.composeWebAlignmentVerticalBottom |
||||
} |
||||
|
||||
@Composable |
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
internal actual fun RowActual( |
||||
modifier: Modifier, |
||||
horizontalArrangement: Arrangement.Horizontal, |
||||
verticalAlignment: Alignment.Vertical, |
||||
content: @Composable () -> Unit |
||||
) { |
||||
Div( |
||||
attrs = { |
||||
classes( |
||||
*arrayOf( |
||||
Styles.rowClass, |
||||
horizontalArrangement.asClassName(), |
||||
verticalAlignment.asClassName() |
||||
) |
||||
) |
||||
} |
||||
) { |
||||
content() |
||||
} |
||||
} |
@ -1,35 +0,0 @@
|
||||
package org.jetbrains.compose.common.material |
||||
|
||||
import androidx.compose.runtime.Composable |
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
import org.jetbrains.compose.common.ui.Modifier |
||||
import org.jetbrains.compose.web.dom.Input |
||||
import org.jetbrains.compose.web.attributes.InputType |
||||
|
||||
@Composable |
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
actual fun SliderActual( |
||||
value: Float, |
||||
onValueChange: (Float) -> Unit, |
||||
valueRange: ClosedFloatingPointRange<Float>, |
||||
steps: Int, |
||||
modifier: Modifier, |
||||
) { |
||||
val stepCount = if (steps == 0) 100 else steps |
||||
val step = (valueRange.endInclusive - valueRange.start) / stepCount |
||||
|
||||
Input( |
||||
type = InputType.Range, |
||||
attrs = { |
||||
value(value.toString()) |
||||
attr("min", valueRange.start.toString()) |
||||
attr("max", valueRange.endInclusive.toString()) |
||||
attr("step", step.toString()) |
||||
onInput { |
||||
onValueChange(it.value?.toFloat() ?: 0f) |
||||
} |
||||
} |
||||
) |
||||
} |
@ -1,45 +0,0 @@
|
||||
package org.jetbrains.compose.common.material |
||||
|
||||
import androidx.compose.runtime.Composable |
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.web.dom.Text as TextNode |
||||
import org.jetbrains.compose.web.dom.Span |
||||
import org.jetbrains.compose.web.ui.Styles |
||||
import org.jetbrains.compose.common.ui.Modifier |
||||
import org.jetbrains.compose.common.ui.asAttributeBuilderApplier |
||||
import org.jetbrains.compose.common.core.graphics.Color |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
import org.jetbrains.compose.web.css.color |
||||
import org.jetbrains.compose.web.css.fontSize |
||||
import org.jetbrains.compose.web.css.Color.RGB |
||||
import org.jetbrains.compose.common.ui.unit.TextUnit |
||||
import org.jetbrains.compose.common.ui.unit.TextUnitType |
||||
import org.jetbrains.compose.web.css.em |
||||
import org.jetbrains.compose.web.css.px |
||||
|
||||
@Composable |
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
internal actual fun TextActual( |
||||
text: String, |
||||
modifier: Modifier, |
||||
color: Color, |
||||
size: TextUnit |
||||
) { |
||||
Span( |
||||
modifier.asAttributeBuilderApplier { |
||||
style { |
||||
color(RGB(color.red, color.green, color.blue)) |
||||
when (size.unitType) { |
||||
TextUnitType.Em -> fontSize(size.value.em) |
||||
TextUnitType.Sp -> fontSize(size.value.px) |
||||
else -> fontSize(size.value.px) |
||||
} |
||||
} |
||||
|
||||
classes(Styles.textClass) |
||||
} |
||||
) { |
||||
TextNode(text) |
||||
} |
||||
} |
@ -1,20 +0,0 @@
|
||||
package org.jetbrains.compose.common.foundation |
||||
|
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.unit.Dp |
||||
import org.jetbrains.compose.common.core.graphics.Color |
||||
import org.jetbrains.compose.common.ui.Modifier |
||||
import org.jetbrains.compose.common.internal.castOrCreate |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
import org.jetbrains.compose.web.css.px |
||||
import org.jetbrains.compose.web.css.LineStyle |
||||
import org.jetbrains.compose.web.css.border |
||||
import org.jetbrains.compose.web.css.Color.RGB |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
actual fun Modifier.border(size: Dp, color: Color): Modifier = castOrCreate().apply { |
||||
add { |
||||
border(size.value.px, LineStyle.Solid, RGB(color.red, color.green, color.blue)) |
||||
} |
||||
} |
@ -1,14 +0,0 @@
|
||||
package org.jetbrains.compose.common.foundation |
||||
|
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.Modifier |
||||
import org.jetbrains.compose.common.internal.castOrCreate |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
actual fun Modifier.clickable(onClick: () -> Unit): Modifier = castOrCreate().apply { |
||||
addAttributeBuilder { |
||||
onClick { onClick() } |
||||
} |
||||
} |
@ -1,20 +0,0 @@
|
||||
package org.jetbrains.compose.common.ui.draw |
||||
|
||||
import org.jetbrains.compose.common.ui.Modifier |
||||
import jetbrains.compose.common.shapes.Shape |
||||
import jetbrains.compose.common.shapes.CircleShape |
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.internal.castOrCreate |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
import org.jetbrains.compose.web.css.borderRadius |
||||
import org.jetbrains.compose.web.css.percent |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
actual fun Modifier.clip(shape: Shape): Modifier = castOrCreate().apply { |
||||
when (shape) { |
||||
CircleShape -> add { |
||||
borderRadius(50.percent) |
||||
} |
||||
} |
||||
} |
@ -1,16 +0,0 @@
|
||||
package org.jetbrains.compose.common.foundation.layout |
||||
|
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.Modifier |
||||
import org.jetbrains.compose.common.internal.castOrCreate |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
import org.jetbrains.compose.web.css.height |
||||
import org.jetbrains.compose.web.css.percent |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
actual fun Modifier.fillMaxHeight(fraction: Float): Modifier = castOrCreate().apply { |
||||
add { |
||||
height((100 * fraction).percent) |
||||
} |
||||
} |
@ -1,16 +0,0 @@
|
||||
package org.jetbrains.compose.common.foundation.layout |
||||
|
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.Modifier |
||||
import org.jetbrains.compose.common.internal.castOrCreate |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
import org.jetbrains.compose.web.css.width |
||||
import org.jetbrains.compose.web.css.percent |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
actual fun Modifier.fillMaxWidth(): Modifier = castOrCreate().apply { |
||||
add { |
||||
width(100.percent) |
||||
} |
||||
} |
@ -1,19 +0,0 @@
|
||||
package org.jetbrains.compose.common.foundation.layout |
||||
|
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.unit.Dp |
||||
import org.jetbrains.compose.common.ui.Modifier |
||||
import org.jetbrains.compose.common.internal.castOrCreate |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
import org.jetbrains.compose.web.css.marginTop |
||||
import org.jetbrains.compose.web.css.marginLeft |
||||
import org.jetbrains.compose.web.css.px |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
actual fun Modifier.offset(x: Dp, y: Dp): Modifier = castOrCreate().apply { |
||||
add { |
||||
marginLeft(x.value.px) |
||||
marginTop(y.value.px) |
||||
} |
||||
} |
@ -1,14 +0,0 @@
|
||||
package org.jetbrains.compose.common.ui.layout |
||||
|
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
import org.jetbrains.compose.common.ui.Modifier |
||||
import org.jetbrains.compose.common.ui.unit.IntSize |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
actual fun Modifier.onSizeChanged( |
||||
onSizeChanged: (IntSize) -> Unit |
||||
): Modifier { |
||||
return this |
||||
} |
@ -1,17 +0,0 @@
|
||||
package org.jetbrains.compose.common.ui |
||||
|
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.unit.Dp |
||||
import org.jetbrains.compose.web.css.width |
||||
import org.jetbrains.compose.web.css.height |
||||
import org.jetbrains.compose.web.css.px |
||||
import org.jetbrains.compose.common.internal.castOrCreate |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
actual fun Modifier.size(width: Dp, height: Dp): Modifier = castOrCreate().apply { |
||||
add { |
||||
width(width.value.px) |
||||
height(height.value.px) |
||||
} |
||||
} |
@ -1,17 +0,0 @@
|
||||
package org.jetbrains.compose.common.foundation.layout |
||||
|
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.unit.Dp |
||||
import org.jetbrains.compose.common.ui.Modifier |
||||
import org.jetbrains.compose.common.internal.castOrCreate |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
import org.jetbrains.compose.web.css.px |
||||
import org.jetbrains.compose.web.css.width |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
actual fun Modifier.width(size: Dp): Modifier = castOrCreate().apply { |
||||
add { |
||||
width(size.value.px) |
||||
} |
||||
} |
@ -1,35 +0,0 @@
|
||||
import org.jetbrains.compose.web.renderComposable |
||||
import org.jetbrains.compose.common.core.graphics.Color |
||||
import org.jetbrains.compose.common.foundation.layout.Box |
||||
import org.jetbrains.compose.common.ui.Modifier |
||||
import org.jetbrains.compose.common.ui.background |
||||
import org.jetbrains.compose.common.ui.size |
||||
import org.jetbrains.compose.common.ui.unit.dp |
||||
import org.w3c.dom.HTMLElement |
||||
import kotlin.test.Test |
||||
import kotlin.test.assertEquals |
||||
import kotlin.test.assertTrue |
||||
|
||||
class ModifierTests { |
||||
@Test |
||||
fun backgroundModifier() = runTest { |
||||
{ |
||||
Box( |
||||
Modifier.background(Color(255, 0, 0)) |
||||
) { } |
||||
} |
||||
|
||||
assertEquals("background-color: rgb(255, 0, 0);", nextChild().style.cssText) |
||||
} |
||||
|
||||
@Test |
||||
fun size() = runTest { |
||||
composition { |
||||
Box( |
||||
Modifier.size(40.dp) |
||||
) { } |
||||
} |
||||
|
||||
assertEquals("width: 40px; height: 40px;", nextChild().style.cssText) |
||||
} |
||||
} |
@ -1,13 +0,0 @@
|
||||
package org.jetbrains.compose.common.ui |
||||
|
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import androidx.compose.ui.Alignment as JAlignment |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
val Alignment.Vertical.implementation: JAlignment.Vertical |
||||
get() = when (this) { |
||||
Alignment.Top -> JAlignment.Top |
||||
Alignment.CenterVertically -> JAlignment.CenterVertically |
||||
else -> JAlignment.Bottom |
||||
} |
@ -1,13 +0,0 @@
|
||||
package org.jetbrains.compose.common.foundation.layout |
||||
|
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
import androidx.compose.foundation.layout.Arrangement as JArrangement |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
val Arrangement.Horizontal.implementation: JArrangement.Horizontal |
||||
get() = when (this) { |
||||
Arrangement.End -> JArrangement.End |
||||
else -> JArrangement.Start |
||||
} |
@ -1,10 +0,0 @@
|
||||
package org.jetbrains.compose.common.core.graphics |
||||
|
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
import androidx.compose.ui.graphics.Color as JColor |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
val Color.implementation |
||||
get() = JColor(red, green, blue) |
@ -1,27 +0,0 @@
|
||||
package org.jetbrains.compose.common.ui |
||||
|
||||
import org.jetbrains.compose.common.ui.unit.Dp |
||||
import org.jetbrains.compose.common.ui.unit.implementation |
||||
import androidx.compose.foundation.background |
||||
import org.jetbrains.compose.common.core.graphics.Color |
||||
import org.jetbrains.compose.common.core.graphics.implementation |
||||
import org.jetbrains.compose.common.internal.castOrCreate |
||||
import androidx.compose.foundation.layout.padding |
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
actual fun Modifier.background(color: Color): Modifier = castOrCreate().apply { |
||||
modifier = modifier.background(color.implementation) |
||||
} |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
actual fun Modifier.padding(all: Dp): Modifier = castOrCreate().apply { |
||||
modifier = modifier.padding(all.implementation) |
||||
} |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
val Modifier.implementation |
||||
get() = castOrCreate().modifier |
@ -1,19 +0,0 @@
|
||||
package org.jetbrains.compose.common.internal |
||||
|
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
import androidx.compose.ui.Modifier as JModifier |
||||
import org.jetbrains.compose.common.ui.Modifier |
||||
|
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
private class ModifierElement : JModifier.Element |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
class ActualModifier : Modifier { |
||||
var modifier: JModifier = ModifierElement() |
||||
} |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
fun Modifier.castOrCreate(): ActualModifier = (this as? ActualModifier) ?: ActualModifier() |
@ -1,17 +0,0 @@
|
||||
package org.jetbrains.compose.common.foundation.layout |
||||
|
||||
import org.jetbrains.compose.common.ui.Modifier |
||||
import org.jetbrains.compose.common.ui.implementation |
||||
import androidx.compose.runtime.Composable |
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
import androidx.compose.foundation.layout.Box as JBox |
||||
|
||||
@Composable |
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
internal actual fun BoxActual(modifier: Modifier, content: @Composable () -> Unit) { |
||||
JBox(modifier.implementation) { |
||||
content.invoke() |
||||
} |
||||
} |
@ -1,21 +0,0 @@
|
||||
package org.jetbrains.compose.common.material |
||||
|
||||
import org.jetbrains.compose.common.ui.Modifier |
||||
import androidx.compose.runtime.Composable |
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
import org.jetbrains.compose.common.ui.implementation |
||||
import androidx.compose.material.Button as JButton |
||||
|
||||
@Composable |
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
internal actual fun ButtonActual( |
||||
modifier: Modifier, |
||||
onClick: () -> Unit, |
||||
content: @Composable () -> Unit |
||||
) { |
||||
JButton(onClick, modifier.implementation) { |
||||
content() |
||||
} |
||||
} |
@ -1,17 +0,0 @@
|
||||
package org.jetbrains.compose.common.foundation.layout |
||||
|
||||
import org.jetbrains.compose.common.ui.Modifier |
||||
import androidx.compose.runtime.Composable |
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
import androidx.compose.foundation.layout.Column as JColumn |
||||
import org.jetbrains.compose.common.ui.implementation |
||||
|
||||
@Composable |
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
internal actual fun ColumnActual(modifier: Modifier, content: @Composable () -> Unit) { |
||||
JColumn(modifier = modifier.implementation) { |
||||
content.invoke() |
||||
} |
||||
} |
@ -1,24 +0,0 @@
|
||||
package org.jetbrains.compose.common.foundation.layout |
||||
|
||||
import androidx.compose.runtime.Composable |
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.* |
||||
import androidx.compose.foundation.layout.Row as JRow |
||||
|
||||
@Composable |
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
internal actual fun RowActual( |
||||
modifier: Modifier, |
||||
horizontalArrangement: Arrangement.Horizontal, |
||||
verticalAlignment: Alignment.Vertical, |
||||
content: @Composable () -> Unit |
||||
) { |
||||
JRow( |
||||
modifier.implementation, |
||||
horizontalArrangement.implementation, |
||||
verticalAlignment.implementation |
||||
) { |
||||
content.invoke() |
||||
} |
||||
} |
@ -1,14 +0,0 @@
|
||||
package jetbrains.compose.common.shapes |
||||
|
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
import androidx.compose.ui.graphics.Shape as JShape |
||||
import androidx.compose.foundation.shape.CircleShape as JCircleShape |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
val Shape.implementation: JShape |
||||
get() = when (this) { |
||||
CircleShape -> JCircleShape |
||||
else -> throw ClassCastException("Currently supporting only circle shape") |
||||
} |
@ -1,27 +0,0 @@
|
||||
package org.jetbrains.compose.common.material |
||||
|
||||
import androidx.compose.runtime.Composable |
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
import org.jetbrains.compose.common.ui.Modifier |
||||
import androidx.compose.material.Slider as JSlider |
||||
import org.jetbrains.compose.common.ui.implementation |
||||
|
||||
@Composable |
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
internal actual fun SliderActual( |
||||
value: Float, |
||||
onValueChange: (Float) -> Unit, |
||||
valueRange: ClosedFloatingPointRange<Float>, |
||||
steps: Int, |
||||
modifier: Modifier |
||||
) { |
||||
JSlider( |
||||
value, |
||||
onValueChange = onValueChange, |
||||
modifier = modifier.implementation, |
||||
valueRange = valueRange, |
||||
steps = steps |
||||
) |
||||
} |
@ -1,29 +0,0 @@
|
||||
package org.jetbrains.compose.common.material |
||||
|
||||
import androidx.compose.runtime.Composable |
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import androidx.compose.material.Text as JText |
||||
import org.jetbrains.compose.common.ui.Modifier |
||||
import org.jetbrains.compose.common.ui.implementation |
||||
import org.jetbrains.compose.common.core.graphics.Color |
||||
import org.jetbrains.compose.common.core.graphics.implementation |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
import org.jetbrains.compose.common.ui.unit.TextUnit |
||||
import org.jetbrains.compose.common.ui.unit.implementation |
||||
|
||||
@Composable |
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
internal actual fun TextActual( |
||||
text: String, |
||||
modifier: Modifier, |
||||
color: Color, |
||||
size: TextUnit |
||||
) { |
||||
JText( |
||||
text, |
||||
modifier = modifier.implementation, |
||||
color = color.implementation, |
||||
fontSize = size.implementation |
||||
) |
||||
} |
@ -1,17 +0,0 @@
|
||||
package org.jetbrains.compose.common.foundation |
||||
|
||||
import org.jetbrains.compose.common.ui.unit.Dp |
||||
import org.jetbrains.compose.common.core.graphics.Color |
||||
import org.jetbrains.compose.common.ui.Modifier |
||||
import org.jetbrains.compose.common.internal.castOrCreate |
||||
import org.jetbrains.compose.common.core.graphics.implementation |
||||
import org.jetbrains.compose.common.ui.unit.implementation |
||||
import androidx.compose.foundation.border |
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
actual fun Modifier.border(size: Dp, color: Color): Modifier = castOrCreate().apply { |
||||
modifier = modifier.border(size.implementation, color.implementation) |
||||
} |
@ -1,13 +0,0 @@
|
||||
package org.jetbrains.compose.common.foundation |
||||
|
||||
import org.jetbrains.compose.common.ui.Modifier |
||||
import org.jetbrains.compose.common.internal.castOrCreate |
||||
import androidx.compose.foundation.clickable |
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
actual fun Modifier.clickable(onClick: () -> Unit): Modifier = castOrCreate().apply { |
||||
modifier = modifier.clickable(onClick = onClick) |
||||
} |
@ -1,15 +0,0 @@
|
||||
package org.jetbrains.compose.common.ui.draw |
||||
|
||||
import org.jetbrains.compose.common.ui.Modifier |
||||
import jetbrains.compose.common.shapes.Shape |
||||
import jetbrains.compose.common.shapes.implementation |
||||
import org.jetbrains.compose.common.internal.castOrCreate |
||||
import androidx.compose.ui.draw.clip |
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
actual fun Modifier.clip(shape: Shape): Modifier = castOrCreate().apply { |
||||
modifier = modifier.clip(shape.implementation) |
||||
} |
@ -1,13 +0,0 @@
|
||||
package org.jetbrains.compose.common.foundation.layout |
||||
|
||||
import org.jetbrains.compose.common.ui.Modifier |
||||
import org.jetbrains.compose.common.internal.castOrCreate |
||||
import androidx.compose.foundation.layout.fillMaxHeight |
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
actual fun Modifier.fillMaxHeight(fraction: Float): Modifier = castOrCreate().apply { |
||||
modifier = modifier.fillMaxHeight(fraction) |
||||
} |
@ -1,13 +0,0 @@
|
||||
package org.jetbrains.compose.common.foundation.layout |
||||
|
||||
import org.jetbrains.compose.common.ui.Modifier |
||||
import org.jetbrains.compose.common.internal.castOrCreate |
||||
import androidx.compose.foundation.layout.fillMaxWidth |
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
actual fun Modifier.fillMaxWidth(): Modifier = castOrCreate().apply { |
||||
modifier = modifier.fillMaxWidth() |
||||
} |
@ -1,15 +0,0 @@
|
||||
package org.jetbrains.compose.common.foundation.layout |
||||
|
||||
import org.jetbrains.compose.common.ui.unit.Dp |
||||
import org.jetbrains.compose.common.ui.Modifier |
||||
import org.jetbrains.compose.common.internal.castOrCreate |
||||
import androidx.compose.foundation.layout.offset |
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
import org.jetbrains.compose.common.ui.unit.implementation |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
actual fun Modifier.offset(x: Dp, y: Dp): Modifier = castOrCreate().apply { |
||||
modifier = modifier.offset(x.implementation, y.implementation) |
||||
} |
@ -1,18 +0,0 @@
|
||||
package org.jetbrains.compose.common.ui.layout |
||||
|
||||
import org.jetbrains.compose.common.ui.Modifier |
||||
import org.jetbrains.compose.common.ui.unit.IntSize |
||||
import org.jetbrains.compose.common.internal.castOrCreate |
||||
import androidx.compose.ui.layout.onSizeChanged |
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
actual fun Modifier.onSizeChanged( |
||||
onSizeChanged: (IntSize) -> Unit |
||||
): Modifier = castOrCreate().apply { |
||||
modifier = modifier.onSizeChanged { |
||||
onSizeChanged(IntSize(it.width, it.height)) |
||||
} |
||||
} |
@ -1,13 +0,0 @@
|
||||
package org.jetbrains.compose.common.ui |
||||
|
||||
import org.jetbrains.compose.common.ui.unit.Dp |
||||
import org.jetbrains.compose.common.ui.unit.implementation |
||||
import androidx.compose.foundation.layout.size |
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.internal.castOrCreate |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
actual fun Modifier.size(width: Dp, height: Dp): Modifier = castOrCreate().apply { |
||||
modifier = modifier.size(width.implementation, height.implementation) |
||||
} |
@ -1,15 +0,0 @@
|
||||
package org.jetbrains.compose.common.foundation.layout |
||||
|
||||
import org.jetbrains.compose.common.ui.unit.Dp |
||||
import org.jetbrains.compose.common.ui.Modifier |
||||
import org.jetbrains.compose.common.internal.castOrCreate |
||||
import androidx.compose.foundation.layout.width |
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
import org.jetbrains.compose.common.ui.unit.implementation |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
actual fun Modifier.width(size: Dp): Modifier = castOrCreate().apply { |
||||
modifier = modifier.width(size.implementation) |
||||
} |
@ -1,10 +0,0 @@
|
||||
package org.jetbrains.compose.common.ui.unit |
||||
|
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
import androidx.compose.ui.unit.Dp as JDp |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
val Dp.implementation: JDp |
||||
get() = JDp(value) |
@ -1,16 +0,0 @@
|
||||
package org.jetbrains.compose.common.ui.unit |
||||
|
||||
import androidx.compose.ui.unit.TextUnit as JTextUnit |
||||
import androidx.compose.ui.unit.em |
||||
import androidx.compose.ui.unit.sp |
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
val TextUnit.implementation: JTextUnit |
||||
get() = when (unitType) { |
||||
TextUnitType.Em -> (value).em |
||||
TextUnitType.Sp -> (value).sp |
||||
else -> JTextUnit.Unspecified |
||||
} |
Loading…
Reference in new issue