diff --git a/.gitignore b/.gitignore index d972be1..1063874 100644 --- a/.gitignore +++ b/.gitignore @@ -17,4 +17,6 @@ types.d.ts /frontend/index.html vite.generated.ts vite.config.ts -/src/main/bundles \ No newline at end of file +/src/main/bundles +/src/main/frontend/generated +/src/main/frontend/index.html \ No newline at end of file diff --git a/pom.xml b/pom.xml index 3d79bba..9532c4d 100644 --- a/pom.xml +++ b/pom.xml @@ -4,12 +4,12 @@ com.flowingcode.vaadin.addons.chipfield chipfield-addon - 2.6.2-SNAPSHOT + 2.7.0-SNAPSHOT ChipField Addon Integration of paper-chip for Vaadin 14 as a field - 14.8.11 + 14.11.13 1.8 1.8 UTF-8 @@ -125,6 +125,11 @@ + + com.flowingcode.vaadin + json-migration-helper + 0.0.1-SNAPSHOT + org.slf4j slf4j-simple @@ -150,7 +155,7 @@ io.github.bonigarcia webdrivermanager - 4.3.1 + 6.3.2 test @@ -163,7 +168,7 @@ com.flowingcode.vaadin.addons.demo commons-demo - 3.5.1 + 3.10.0 test @@ -472,7 +477,7 @@ 17 17 24.4.12 - 11.0.12 + 11.0.26 diff --git a/src/main/java/com/flowingcode/vaadin/addons/chipfield/ChipField.java b/src/main/java/com/flowingcode/vaadin/addons/chipfield/ChipField.java index c216b08..4665646 100644 --- a/src/main/java/com/flowingcode/vaadin/addons/chipfield/ChipField.java +++ b/src/main/java/com/flowingcode/vaadin/addons/chipfield/ChipField.java @@ -27,6 +27,7 @@ import java.util.Optional; import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Stream; +import com.flowingcode.vaadin.jsonmigration.JsonMigration; import com.vaadin.flow.component.AbstractField; import com.vaadin.flow.component.AttachEvent; import com.vaadin.flow.component.ComponentEvent; @@ -151,7 +152,7 @@ private void configure() { .addEventListener( "chip-created", e -> { - JsonObject eventData = e.getEventData(); + JsonObject eventData = JsonMigration.getEventData(e); String chipLabel = eventData.get(CHIP_LABEL).asString(); T newItem = findItemByLabel(chipLabel) @@ -178,7 +179,7 @@ private void configure() { .addEventListener( "chip-removed", e -> { - JsonObject eventData = e.getEventData(); + JsonObject eventData = JsonMigration.getEventData(e); String chipLabel = eventData.get(CHIP_LABEL).asString(); findItemByLabel(chipLabel).ifPresent(item -> removeSelectedItem(item, true)); }) @@ -197,7 +198,7 @@ private void configureItems() { object.put("value", itemLabelGenerator.apply(item)); array.set(index.getAndIncrement(), object); }); - getElement().setPropertyJson("source", array); + JsonMigration.setPropertyJson(getElement(), "source", array); } @Override