aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/pl/treksoft
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/pl/treksoft')
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/core/Css.kt28
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/core/StyledComponent.kt7
2 files changed, 35 insertions, 0 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/core/Css.kt b/src/main/kotlin/pl/treksoft/kvision/core/Css.kt
index bfbfac7e..f3ff5d5e 100644
--- a/src/main/kotlin/pl/treksoft/kvision/core/Css.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/core/Css.kt
@@ -258,6 +258,34 @@ enum class BgClip(internal val clip: String) {
}
/**
+ * Definitions of CSS display options.
+ */
+enum class Display(internal val display: String) {
+ INLINE("inline"),
+ BLOCK("block"),
+ FLEX("flex"),
+ GRID("grid"),
+ INLINEBLOCK("inline-block"),
+ INLINEFLEX("inline-flex"),
+ INLINEGRID("inline-grid"),
+ INLINETABLE("inline-table"),
+ LISTITEM("list-item"),
+ RUNIN("run-in"),
+ TABLE("table"),
+ TABLECAPTION("table-caption"),
+ TABLECOLUMNGROUP("table-column-group"),
+ TABLEHEADERGROUP("table-header-group"),
+ TABLEFOOTERGROUP("table-footer-group"),
+ TABLEROWGROUP("table-row-group"),
+ TABLECELL("table-cell"),
+ TABLECOLUMN("table-column"),
+ TABLEROW("table-row"),
+ NONE("none"),
+ INITIAL("initial"),
+ INHERIT("inherit")
+}
+
+/**
* Definitions of CSS position options.
*/
enum class Position(internal val position: String) {
diff --git a/src/main/kotlin/pl/treksoft/kvision/core/StyledComponent.kt b/src/main/kotlin/pl/treksoft/kvision/core/StyledComponent.kt
index da1decf7..9b759f79 100644
--- a/src/main/kotlin/pl/treksoft/kvision/core/StyledComponent.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/core/StyledComponent.kt
@@ -55,6 +55,10 @@ abstract class StyledComponent : Component {
*/
open var maxHeight: CssSize? by refreshOnUpdate()
/**
+ * CSS display of the current component.
+ */
+ open var display: Display? by refreshOnUpdate()
+ /**
* CSS position of the current component.
*/
open var position: Position? by refreshOnUpdate()
@@ -313,6 +317,9 @@ abstract class StyledComponent : Component {
maxHeight?.let {
snstyle.add("max-height" to it.asString())
}
+ display?.let {
+ snstyle.add("display" to it.display)
+ }
position?.let {
snstyle.add("position" to it.position)
}