From ab12f9a29f7517e6ad5923b687f8ff476fc83a93 Mon Sep 17 00:00:00 2001 From: Robert Jaros Date: Sun, 17 Sep 2017 04:28:09 +0200 Subject: Modals --- src/main/kotlin/pl/treksoft/kvision/Showcase.kt | 39 ++++- src/main/kotlin/pl/treksoft/kvision/core/Root.kt | 25 ++- .../pl/treksoft/kvision/dropdown/DropDown.kt | 6 +- .../pl/treksoft/kvision/helpers/CloseIcon.kt | 25 +++ src/main/kotlin/pl/treksoft/kvision/html/Tag.kt | 1 + src/main/kotlin/pl/treksoft/kvision/modal/Alert.kt | 54 ++++++ .../kotlin/pl/treksoft/kvision/modal/Confirm.kt | 84 +++++++++ src/main/kotlin/pl/treksoft/kvision/modal/Modal.kt | 191 +++++++++++++++++++++ .../kotlin/pl/treksoft/kvision/snabbdom/Types.kt | 4 + 9 files changed, 419 insertions(+), 10 deletions(-) create mode 100644 src/main/kotlin/pl/treksoft/kvision/helpers/CloseIcon.kt create mode 100644 src/main/kotlin/pl/treksoft/kvision/modal/Alert.kt create mode 100644 src/main/kotlin/pl/treksoft/kvision/modal/Confirm.kt create mode 100644 src/main/kotlin/pl/treksoft/kvision/modal/Modal.kt (limited to 'src/main/kotlin/pl/treksoft') diff --git a/src/main/kotlin/pl/treksoft/kvision/Showcase.kt b/src/main/kotlin/pl/treksoft/kvision/Showcase.kt index 258e870d..1e93d95a 100644 --- a/src/main/kotlin/pl/treksoft/kvision/Showcase.kt +++ b/src/main/kotlin/pl/treksoft/kvision/Showcase.kt @@ -8,7 +8,12 @@ import pl.treksoft.kvision.dropdown.DD.* import pl.treksoft.kvision.dropdown.DropDown import pl.treksoft.kvision.html.* import pl.treksoft.kvision.html.TAG.H1 +import pl.treksoft.kvision.modal.Alert +import pl.treksoft.kvision.modal.Confirm +import pl.treksoft.kvision.modal.MODALSIZE +import pl.treksoft.kvision.modal.Modal import pl.treksoft.kvision.routing.routing +import kotlin.browser.window class Showcase : ApplicationBase() { @@ -73,6 +78,11 @@ class Showcase : ApplicationBase() { val img = Image(Img("kotlin.png"), "Image", true, IMAGESHAPE.ROUNDED) root.add(img) + val modal = Modal("Test okienka") + modal.add(Tag(TAG.H4, "ABC")) + modal.add(Image(Img("kotlin.png"))) + modal.addButton(Button("To jest button")) + val button = Button("To jest przycisk FA", "fa-flag", BUTTONSTYLE.DANGER) button.setEventListener