Update kotlin version, update to kotlin-komponent 1.0.0
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,2 +1,3 @@
|
|||||||
# Created by .ignore support plugin (hsz.mobi)
|
# Created by .ignore support plugin (hsz.mobi)
|
||||||
gradle.properties
|
gradle.properties
|
||||||
|
web
|
||||||
|
|||||||
6
.idea/artifacts/komp_todo_js_0_1_0_SNAPSHOT.xml
generated
Normal file
6
.idea/artifacts/komp_todo_js_0_1_0_SNAPSHOT.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<component name="ArtifactManager">
|
||||||
|
<artifact type="jar" name="komp-todo-js-0.1.0-SNAPSHOT">
|
||||||
|
<output-path>$PROJECT_DIR$/build/libs</output-path>
|
||||||
|
<root id="archive" name="komp-todo-js-0.1.0-SNAPSHOT.jar" />
|
||||||
|
</artifact>
|
||||||
|
</component>
|
||||||
8
.idea/artifacts/komp_todo_js_0_2_0_SNAPSHOT.xml
generated
Normal file
8
.idea/artifacts/komp_todo_js_0_2_0_SNAPSHOT.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<component name="ArtifactManager">
|
||||||
|
<artifact type="jar" name="komp-todo-js-0.2.0-SNAPSHOT">
|
||||||
|
<output-path>$PROJECT_DIR$/build/libs</output-path>
|
||||||
|
<root id="archive" name="komp-todo-js-0.2.0-SNAPSHOT.jar">
|
||||||
|
<element id="module-output" name="komp-todo.jsMain" />
|
||||||
|
</root>
|
||||||
|
</artifact>
|
||||||
|
</component>
|
||||||
11
.idea/aws.xml
generated
Normal file
11
.idea/aws.xml
generated
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="accountSettings">
|
||||||
|
<option name="activeRegion" value="us-east-1" />
|
||||||
|
<option name="recentlyUsedRegions">
|
||||||
|
<list>
|
||||||
|
<option value="us-east-1" />
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
5
.idea/jarRepositories.xml
generated
5
.idea/jarRepositories.xml
generated
@@ -31,5 +31,10 @@
|
|||||||
<option name="name" value="BintrayJCenter" />
|
<option name="name" value="BintrayJCenter" />
|
||||||
<option name="url" value="https://jcenter.bintray.com/" />
|
<option name="url" value="https://jcenter.bintray.com/" />
|
||||||
</remote-repository>
|
</remote-repository>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="MavenLocal" />
|
||||||
|
<option name="name" value="MavenLocal" />
|
||||||
|
<option name="url" value="file:$MAVEN_REPOSITORY$/" />
|
||||||
|
</remote-repository>
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
2
.idea/komp-todo.iml
generated
Normal file
2
.idea/komp-todo.iml
generated
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module external.linked.project.id="komp-todo" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="nl.astraeus" external.system.module.version="0.1.0-SNAPSHOT" type="JAVA_MODULE" version="4" />
|
||||||
65
.idea/libraries-with-intellij-classes.xml
generated
Normal file
65
.idea/libraries-with-intellij-classes.xml
generated
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="libraries-with-intellij-classes">
|
||||||
|
<option name="intellijApiContainingLibraries">
|
||||||
|
<list>
|
||||||
|
<LibraryCoordinatesState>
|
||||||
|
<option name="artifactId" value="ideaIU" />
|
||||||
|
<option name="groupId" value="com.jetbrains.intellij.idea" />
|
||||||
|
</LibraryCoordinatesState>
|
||||||
|
<LibraryCoordinatesState>
|
||||||
|
<option name="artifactId" value="ideaIU" />
|
||||||
|
<option name="groupId" value="com.jetbrains" />
|
||||||
|
</LibraryCoordinatesState>
|
||||||
|
<LibraryCoordinatesState>
|
||||||
|
<option name="artifactId" value="ideaIC" />
|
||||||
|
<option name="groupId" value="com.jetbrains.intellij.idea" />
|
||||||
|
</LibraryCoordinatesState>
|
||||||
|
<LibraryCoordinatesState>
|
||||||
|
<option name="artifactId" value="ideaIC" />
|
||||||
|
<option name="groupId" value="com.jetbrains" />
|
||||||
|
</LibraryCoordinatesState>
|
||||||
|
<LibraryCoordinatesState>
|
||||||
|
<option name="artifactId" value="pycharmPY" />
|
||||||
|
<option name="groupId" value="com.jetbrains.intellij.pycharm" />
|
||||||
|
</LibraryCoordinatesState>
|
||||||
|
<LibraryCoordinatesState>
|
||||||
|
<option name="artifactId" value="pycharmPY" />
|
||||||
|
<option name="groupId" value="com.jetbrains" />
|
||||||
|
</LibraryCoordinatesState>
|
||||||
|
<LibraryCoordinatesState>
|
||||||
|
<option name="artifactId" value="pycharmPC" />
|
||||||
|
<option name="groupId" value="com.jetbrains.intellij.pycharm" />
|
||||||
|
</LibraryCoordinatesState>
|
||||||
|
<LibraryCoordinatesState>
|
||||||
|
<option name="artifactId" value="pycharmPC" />
|
||||||
|
<option name="groupId" value="com.jetbrains" />
|
||||||
|
</LibraryCoordinatesState>
|
||||||
|
<LibraryCoordinatesState>
|
||||||
|
<option name="artifactId" value="clion" />
|
||||||
|
<option name="groupId" value="com.jetbrains.intellij.clion" />
|
||||||
|
</LibraryCoordinatesState>
|
||||||
|
<LibraryCoordinatesState>
|
||||||
|
<option name="artifactId" value="clion" />
|
||||||
|
<option name="groupId" value="com.jetbrains" />
|
||||||
|
</LibraryCoordinatesState>
|
||||||
|
<LibraryCoordinatesState>
|
||||||
|
<option name="artifactId" value="riderRD" />
|
||||||
|
<option name="groupId" value="com.jetbrains.intellij.rider" />
|
||||||
|
</LibraryCoordinatesState>
|
||||||
|
<LibraryCoordinatesState>
|
||||||
|
<option name="artifactId" value="riderRD" />
|
||||||
|
<option name="groupId" value="com.jetbrains" />
|
||||||
|
</LibraryCoordinatesState>
|
||||||
|
<LibraryCoordinatesState>
|
||||||
|
<option name="artifactId" value="goland" />
|
||||||
|
<option name="groupId" value="com.jetbrains.intellij.goland" />
|
||||||
|
</LibraryCoordinatesState>
|
||||||
|
<LibraryCoordinatesState>
|
||||||
|
<option name="artifactId" value="goland" />
|
||||||
|
<option name="groupId" value="com.jetbrains" />
|
||||||
|
</LibraryCoordinatesState>
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
8
.idea/misc.xml
generated
8
.idea/misc.xml
generated
@@ -5,12 +5,4 @@
|
|||||||
<file type="web" url="file://$PROJECT_DIR$" />
|
<file type="web" url="file://$PROJECT_DIR$" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK" />
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK" />
|
||||||
<component name="accountSettings">
|
|
||||||
<option name="activeRegion" value="us-east-1" />
|
|
||||||
<option name="recentlyUsedRegions">
|
|
||||||
<list>
|
|
||||||
<option value="us-east-1" />
|
|
||||||
</list>
|
|
||||||
</option>
|
|
||||||
</component>
|
|
||||||
</project>
|
</project>
|
||||||
@@ -1,25 +1,22 @@
|
|||||||
|
import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpackOutput.Target.VAR
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
kotlin("multiplatform") version "1.4.30"
|
kotlin("multiplatform") version "1.6.10"
|
||||||
`maven-publish`
|
`maven-publish`
|
||||||
}
|
}
|
||||||
|
|
||||||
group = "nl.astraeus"
|
group = "nl.astraeus"
|
||||||
version = "0.1.0-SNAPSHOT"
|
version = "1.0.0"
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
jcenter()
|
|
||||||
maven {
|
|
||||||
url = uri("http://nexus.astraeus.nl/nexus/content/groups/public")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
kotlin {
|
kotlin {
|
||||||
/* Targets configuration omitted.
|
/* Targets configuration omitted.
|
||||||
* To find out how to configure the targets, please follow the link:
|
* To find out how to configure the targets, please follow the link:
|
||||||
* https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html#setting-up-targets */
|
* https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html#setting-up-targets */
|
||||||
js(IR) {
|
js((IR)) {
|
||||||
binaries.executable()
|
binaries.executable()
|
||||||
browser {
|
browser {
|
||||||
//produceKotlinLibrary()
|
//produceKotlinLibrary()
|
||||||
@@ -37,13 +34,9 @@ kotlin {
|
|||||||
sourceSets {
|
sourceSets {
|
||||||
val commonMain by getting {
|
val commonMain by getting {
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation("nl.astraeus:komp:0.2.5-SNAPSHOT")
|
implementation("nl.astraeus:kotlin-komponent:1.0.0")
|
||||||
}
|
|
||||||
}
|
|
||||||
val jsMain by getting {
|
|
||||||
dependencies {
|
|
||||||
implementation(kotlin("stdlib-js"))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
val jsMain by getting
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import kotlinx.html.js.onDoubleClickFunction
|
|||||||
import kotlinx.html.js.onKeyPressFunction
|
import kotlinx.html.js.onKeyPressFunction
|
||||||
import nl.astraeus.komp.HtmlBuilder
|
import nl.astraeus.komp.HtmlBuilder
|
||||||
import nl.astraeus.komp.Komponent
|
import nl.astraeus.komp.Komponent
|
||||||
import nl.astraeus.komp.include
|
|
||||||
import org.w3c.dom.HTMLInputElement
|
import org.w3c.dom.HTMLInputElement
|
||||||
import org.w3c.dom.events.Event
|
import org.w3c.dom.events.Event
|
||||||
import org.w3c.dom.events.KeyboardEvent
|
import org.w3c.dom.events.KeyboardEvent
|
||||||
@@ -38,7 +37,7 @@ class TodoKomponent(
|
|||||||
override fun HtmlBuilder.render() {
|
override fun HtmlBuilder.render() {
|
||||||
li {
|
li {
|
||||||
if (todo.editing) {
|
if (todo.editing) {
|
||||||
classes += "editing"
|
classes = classes + "editing"
|
||||||
input(classes = "edit") {
|
input(classes = "edit") {
|
||||||
value = todo.title
|
value = todo.title
|
||||||
onKeyPressFunction = { e ->
|
onKeyPressFunction = { e ->
|
||||||
@@ -50,15 +49,15 @@ class TodoKomponent(
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (todo.completed) {
|
if (todo.completed) {
|
||||||
classes += "completed"
|
classes = classes + "completed"
|
||||||
}
|
}
|
||||||
attributes["data-id"] = todo.dataId
|
|
||||||
div(classes = "view") {
|
div(classes = "view") {
|
||||||
input(classes = "toggle") {
|
input(classes = "toggle") {
|
||||||
type = InputType.checkBox
|
type = InputType.checkBox
|
||||||
checked = todo.completed
|
checked = todo.completed
|
||||||
onClickFunction = {
|
onClickFunction = {
|
||||||
app.todoClicked(todo)
|
app.todoClicked(todo)
|
||||||
|
it.preventDefault()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
label(classes = "todo-content") {
|
label(classes = "todo-content") {
|
||||||
@@ -162,7 +161,14 @@ class TodoApp : Komponent() {
|
|||||||
autoFocus = true
|
autoFocus = true
|
||||||
onKeyPressFunction = { e ->
|
onKeyPressFunction = { e ->
|
||||||
val target = e.target
|
val target = e.target
|
||||||
if (target is HTMLInputElement && e is KeyboardEvent && e.keyCode == 13 && target.value.isNotBlank()) {
|
if (target is HTMLInputElement &&
|
||||||
|
e is KeyboardEvent &&
|
||||||
|
e.keyCode == 13 &&
|
||||||
|
target.value.isNotBlank()
|
||||||
|
) {
|
||||||
|
e.preventDefault()
|
||||||
|
e.stopPropagation()
|
||||||
|
|
||||||
addTodo(e)
|
addTodo(e)
|
||||||
|
|
||||||
target.value = ""
|
target.value = ""
|
||||||
@@ -201,7 +207,7 @@ class TodoApp : Komponent() {
|
|||||||
li {
|
li {
|
||||||
a {
|
a {
|
||||||
if (selection == selected) {
|
if (selection == selected) {
|
||||||
classes += "selected"
|
classes = classes + "selected"
|
||||||
}
|
}
|
||||||
href = "#"
|
href = "#"
|
||||||
+selection.title
|
+selection.title
|
||||||
@@ -225,5 +231,10 @@ class TodoApp : Komponent() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun main() {
|
fun main() {
|
||||||
Komponent.create(document.body!!, TodoApp(), true)
|
Komponent.logReplaceEvent = false
|
||||||
|
Komponent.logRenderEvent = false
|
||||||
|
|
||||||
|
println("Create TodoApp()")
|
||||||
|
|
||||||
|
Komponent.create(document.body!!, TodoApp())
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user