package pl.treksoft.kvision import pl.treksoft.kvision.basic.Label import pl.treksoft.kvision.core.Container import pl.treksoft.kvision.core.Img import pl.treksoft.kvision.core.KVManager import pl.treksoft.kvision.core.Root 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.routing.routing class Showcase : ApplicationBase() { override fun start(state: Map) { val root = Root("showcase") val container = Container(setOf("abc", "def")) val h1 = Tag(H1, "To jest test pisania tekstu", false, ALIGN.NONE, classes = setOf("test", "test2")) container.add(h1) val label = Label("KVLabel1") container.add(label) val label2 = Label("KVLabel2") container.add(label2) root.add(container) label.hide() label.show() val link = Link("test", "http://www.google.pl") link.add(Tag(TAG.P, "Cośtam")) root.add(link) val dd = DropDown("Dropdown", listOf("abc" to "#!/x", "def" to "#!/y"), "flag") root.add(dd) val dd2 = DropDown("Dropdown2", listOf("abc" to "#!/abc", "def" to "#!/def", "xyz" to DISABLED.POS, "Header" to HEADER.POS, "Separtatorek" to SEPARATOR.POS ), "flag", dropup = true) root.add(dd2) val p = Tag(TAG.P, "To jest prawo", align = ALIGN.RIGHT) p.title = "Tytuł" root.add(p) val del = Tag(TAG.DEL, "To jest deleted") root.add(del) val list = ListTag(LIST.DL_HORIZ, listOf("abc", "defdasdasdasddasdtdasdas", "Dasdsada", "dasdasdads"), true) root.add(list) val list2 = ListTag(LIST.OL, null) list2.add(Tag(TAG.H4, "ABC")) list2.add(Button("To jest button")) list2.add(Image(Img("kotlin.png"))) root.add(list2) val img = Image(Img("kotlin.png"), "Image", true, IMAGESHAPE.ROUNDED) root.add(img) val button = Button("To jest przycisk FA", "fa-flag", BUTTONSTYLE.DANGER) button.setEventListener