diff --git a/pom.xml b/pom.xml index ca7881a..3eeb8d1 100644 --- a/pom.xml +++ b/pom.xml @@ -139,6 +139,17 @@ + + org.projectlombok + lombok + provided + 1.18.34 + + + com.flowingcode.vaadin + json-migration-helper + 0.9.2 + org.slf4j slf4j-simple @@ -543,14 +554,19 @@ 21 21 - 25.0.0-beta2 + 25.0.3 11.0.26 + + com.vaadin + vaadin-dev + true + com.flowingcode.vaadin.addons.demo commons-demo - 5.0.0 + 5.1.0 test diff --git a/src/main/java/com/flowingcode/vaadin/addons/orgchart/OrgChart.java b/src/main/java/com/flowingcode/vaadin/addons/orgchart/OrgChart.java index 4a83b55..b91e1ca 100644 --- a/src/main/java/com/flowingcode/vaadin/addons/orgchart/OrgChart.java +++ b/src/main/java/com/flowingcode/vaadin/addons/orgchart/OrgChart.java @@ -2,7 +2,7 @@ * #%L * OrgChart Add-on * %% - * Copyright (C) 2017 - 2025 Flowing Code S.A. + * Copyright (C) 2017 - 2026 Flowing Code S.A. * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,6 +28,7 @@ import com.flowingcode.vaadin.addons.orgchart.event.NodesRemovedEvent; import com.flowingcode.vaadin.addons.orgchart.event.ParentAddedEvent; import com.flowingcode.vaadin.addons.orgchart.event.SiblingsAddedEvent; +import com.flowingcode.vaadin.jsonmigration.JsonMigration; import com.vaadin.flow.component.AttachEvent; import com.vaadin.flow.component.ClientCallable; import com.vaadin.flow.component.ComponentEvent; @@ -44,6 +45,7 @@ import java.util.List; import java.util.Objects; import java.util.stream.Collectors; +import lombok.experimental.ExtensionMethod; /** * OrgChart component definition.
@@ -57,6 +59,7 @@ @NpmPackage(value = "orgchart", version = "3.7.0") @NpmPackage(value = "html2canvas", version = "1.4.1") @NpmPackage(value = "jquery", version = "3.6.2") +@NpmPackage(value = "@polymer/polymer", version = "3.5.2") @JsModule("jquery/dist/jquery.js") @JsModule("orgchart/dist/js/jquery.orgchart.js") @CssImport("orgchart/dist/css/jquery.orgchart.min.css") @@ -64,6 +67,7 @@ @JsModule("./fc-orgchart.js") @CssImport("./fc-orgchart-styles.css") @NpmPackage(value = "json-digger", version = "2.0.2") +@ExtensionMethod(value = JsonMigration.class, suppressBaseMethods = true) public class OrgChart extends Div { private OrgChartItem orgChartItem; diff --git a/src/main/java/com/flowingcode/vaadin/addons/orgchart/OrgChartItem.java b/src/main/java/com/flowingcode/vaadin/addons/orgchart/OrgChartItem.java index b781a87..17221de 100644 --- a/src/main/java/com/flowingcode/vaadin/addons/orgchart/OrgChartItem.java +++ b/src/main/java/com/flowingcode/vaadin/addons/orgchart/OrgChartItem.java @@ -2,7 +2,7 @@ * #%L * OrgChart Add-on * %% - * Copyright (C) 2017 - 2025 Flowing Code S.A. + * Copyright (C) 2017 - 2026 Flowing Code S.A. * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/flowingcode/vaadin/addons/orgchart/client/OrgChartState.java b/src/main/java/com/flowingcode/vaadin/addons/orgchart/client/OrgChartState.java index b599474..dc2746d 100644 --- a/src/main/java/com/flowingcode/vaadin/addons/orgchart/client/OrgChartState.java +++ b/src/main/java/com/flowingcode/vaadin/addons/orgchart/client/OrgChartState.java @@ -2,7 +2,7 @@ * #%L * OrgChart Add-on * %% - * Copyright (C) 2017 - 2025 Flowing Code S.A. + * Copyright (C) 2017 - 2026 Flowing Code S.A. * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/flowingcode/vaadin/addons/orgchart/client/constants/ChartConstants.java b/src/main/java/com/flowingcode/vaadin/addons/orgchart/client/constants/ChartConstants.java index e83a902..b9c7d43 100644 --- a/src/main/java/com/flowingcode/vaadin/addons/orgchart/client/constants/ChartConstants.java +++ b/src/main/java/com/flowingcode/vaadin/addons/orgchart/client/constants/ChartConstants.java @@ -2,7 +2,7 @@ * #%L * OrgChart Add-on * %% - * Copyright (C) 2017 - 2025 Flowing Code S.A. + * Copyright (C) 2017 - 2026 Flowing Code S.A. * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/flowingcode/vaadin/addons/orgchart/client/enums/ChartDirectionEnum.java b/src/main/java/com/flowingcode/vaadin/addons/orgchart/client/enums/ChartDirectionEnum.java index 68b6e16..6c1e78e 100644 --- a/src/main/java/com/flowingcode/vaadin/addons/orgchart/client/enums/ChartDirectionEnum.java +++ b/src/main/java/com/flowingcode/vaadin/addons/orgchart/client/enums/ChartDirectionEnum.java @@ -2,7 +2,7 @@ * #%L * OrgChart Add-on * %% - * Copyright (C) 2017 - 2025 Flowing Code S.A. + * Copyright (C) 2017 - 2026 Flowing Code S.A. * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/flowingcode/vaadin/addons/orgchart/event/ChildrenAddedEvent.java b/src/main/java/com/flowingcode/vaadin/addons/orgchart/event/ChildrenAddedEvent.java index 8c7db8f..1f1d120 100644 --- a/src/main/java/com/flowingcode/vaadin/addons/orgchart/event/ChildrenAddedEvent.java +++ b/src/main/java/com/flowingcode/vaadin/addons/orgchart/event/ChildrenAddedEvent.java @@ -2,7 +2,7 @@ * #%L * OrgChart Add-on * %% - * Copyright (C) 2017 - 2025 Flowing Code S.A. + * Copyright (C) 2017 - 2026 Flowing Code S.A. * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/flowingcode/vaadin/addons/orgchart/event/NodeUpdatedEvent.java b/src/main/java/com/flowingcode/vaadin/addons/orgchart/event/NodeUpdatedEvent.java index 5f2982f..cb86a14 100644 --- a/src/main/java/com/flowingcode/vaadin/addons/orgchart/event/NodeUpdatedEvent.java +++ b/src/main/java/com/flowingcode/vaadin/addons/orgchart/event/NodeUpdatedEvent.java @@ -1,3 +1,22 @@ +/*- + * #%L + * OrgChart Add-on + * %% + * Copyright (C) 2017 - 2026 Flowing Code S.A. + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ package com.flowingcode.vaadin.addons.orgchart.event; import com.flowingcode.vaadin.addons.orgchart.OrgChart; diff --git a/src/main/java/com/flowingcode/vaadin/addons/orgchart/event/NodesRemovedEvent.java b/src/main/java/com/flowingcode/vaadin/addons/orgchart/event/NodesRemovedEvent.java index 05f552e..d955c09 100644 --- a/src/main/java/com/flowingcode/vaadin/addons/orgchart/event/NodesRemovedEvent.java +++ b/src/main/java/com/flowingcode/vaadin/addons/orgchart/event/NodesRemovedEvent.java @@ -2,7 +2,7 @@ * #%L * OrgChart Add-on * %% - * Copyright (C) 2017 - 2025 Flowing Code S.A. + * Copyright (C) 2017 - 2026 Flowing Code S.A. * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/flowingcode/vaadin/addons/orgchart/event/ParentAddedEvent.java b/src/main/java/com/flowingcode/vaadin/addons/orgchart/event/ParentAddedEvent.java index 33856eb..86638fd 100644 --- a/src/main/java/com/flowingcode/vaadin/addons/orgchart/event/ParentAddedEvent.java +++ b/src/main/java/com/flowingcode/vaadin/addons/orgchart/event/ParentAddedEvent.java @@ -2,7 +2,7 @@ * #%L * OrgChart Add-on * %% - * Copyright (C) 2017 - 2025 Flowing Code S.A. + * Copyright (C) 2017 - 2026 Flowing Code S.A. * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/flowingcode/vaadin/addons/orgchart/event/SiblingsAddedEvent.java b/src/main/java/com/flowingcode/vaadin/addons/orgchart/event/SiblingsAddedEvent.java index e2e6fc3..1b331e1 100644 --- a/src/main/java/com/flowingcode/vaadin/addons/orgchart/event/SiblingsAddedEvent.java +++ b/src/main/java/com/flowingcode/vaadin/addons/orgchart/event/SiblingsAddedEvent.java @@ -2,7 +2,7 @@ * #%L * OrgChart Add-on * %% - * Copyright (C) 2017 - 2025 Flowing Code S.A. + * Copyright (C) 2017 - 2026 Flowing Code S.A. * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/flowingcode/vaadin/addons/orgchart/extra/TemplateLiteralRewriter.java b/src/main/java/com/flowingcode/vaadin/addons/orgchart/extra/TemplateLiteralRewriter.java index a09dafc..35e73aa 100644 --- a/src/main/java/com/flowingcode/vaadin/addons/orgchart/extra/TemplateLiteralRewriter.java +++ b/src/main/java/com/flowingcode/vaadin/addons/orgchart/extra/TemplateLiteralRewriter.java @@ -2,7 +2,7 @@ * #%L * OrgChart Add-on * %% - * Copyright (C) 2017 - 2025 Flowing Code S.A. + * Copyright (C) 2017 - 2026 Flowing Code S.A. * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/resources/META-INF/frontend/fc-orgchart.js b/src/main/resources/META-INF/frontend/fc-orgchart.js index 9ddf115..f685e03 100644 --- a/src/main/resources/META-INF/frontend/fc-orgchart.js +++ b/src/main/resources/META-INF/frontend/fc-orgchart.js @@ -2,7 +2,7 @@ * #%L * OrgChart Add-on * %% - * Copyright (C) 2017 - 2025 Flowing Code S.A. + * Copyright (C) 2017 - 2026 Flowing Code S.A. * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/resources/META-INF/resources/frontend/fc-orgchart-styles.css b/src/main/resources/META-INF/resources/frontend/fc-orgchart-styles.css index 29c2f0e..84be1bc 100644 --- a/src/main/resources/META-INF/resources/frontend/fc-orgchart-styles.css +++ b/src/main/resources/META-INF/resources/frontend/fc-orgchart-styles.css @@ -2,7 +2,7 @@ * #%L * OrgChart Add-on * %% - * Copyright (C) 2017 - 2025 Flowing Code S.A. + * Copyright (C) 2017 - 2026 Flowing Code S.A. * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/com/flowingcode/vaadin/addons/DemoLayout.java b/src/test/java/com/flowingcode/vaadin/addons/DemoLayout.java index 44c729d..3eac2a1 100644 --- a/src/test/java/com/flowingcode/vaadin/addons/DemoLayout.java +++ b/src/test/java/com/flowingcode/vaadin/addons/DemoLayout.java @@ -2,7 +2,7 @@ * #%L * OrgChart Add-on * %% - * Copyright (C) 2017 - 2025 Flowing Code S.A. + * Copyright (C) 2017 - 2026 Flowing Code S.A. * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/com/flowingcode/vaadin/addons/orgchart/BottomTopDemo.java b/src/test/java/com/flowingcode/vaadin/addons/orgchart/BottomTopDemo.java index c1ff4aa..c8adf34 100644 --- a/src/test/java/com/flowingcode/vaadin/addons/orgchart/BottomTopDemo.java +++ b/src/test/java/com/flowingcode/vaadin/addons/orgchart/BottomTopDemo.java @@ -2,7 +2,7 @@ * #%L * OrgChart Add-on * %% - * Copyright (C) 2017 - 2025 Flowing Code S.A. + * Copyright (C) 2017 - 2026 Flowing Code S.A. * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/com/flowingcode/vaadin/addons/orgchart/DemoView.java b/src/test/java/com/flowingcode/vaadin/addons/orgchart/DemoView.java index 95f40fc..40cf3a8 100644 --- a/src/test/java/com/flowingcode/vaadin/addons/orgchart/DemoView.java +++ b/src/test/java/com/flowingcode/vaadin/addons/orgchart/DemoView.java @@ -2,7 +2,7 @@ * #%L * OrgChart Add-on * %% - * Copyright (C) 2017 - 2025 Flowing Code S.A. + * Copyright (C) 2017 - 2026 Flowing Code S.A. * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/com/flowingcode/vaadin/addons/orgchart/DragAndDropExportDemo.java b/src/test/java/com/flowingcode/vaadin/addons/orgchart/DragAndDropExportDemo.java index 2e309b8..d38122d 100644 --- a/src/test/java/com/flowingcode/vaadin/addons/orgchart/DragAndDropExportDemo.java +++ b/src/test/java/com/flowingcode/vaadin/addons/orgchart/DragAndDropExportDemo.java @@ -2,7 +2,7 @@ * #%L * OrgChart Add-on * %% - * Copyright (C) 2017 - 2025 Flowing Code S.A. + * Copyright (C) 2017 - 2026 Flowing Code S.A. * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/com/flowingcode/vaadin/addons/orgchart/EditChartDemo.java b/src/test/java/com/flowingcode/vaadin/addons/orgchart/EditChartDemo.java index 411a89c..7012a2f 100644 --- a/src/test/java/com/flowingcode/vaadin/addons/orgchart/EditChartDemo.java +++ b/src/test/java/com/flowingcode/vaadin/addons/orgchart/EditChartDemo.java @@ -2,7 +2,7 @@ * #%L * OrgChart Add-on * %% - * Copyright (C) 2017 - 2025 Flowing Code S.A. + * Copyright (C) 2017 - 2026 Flowing Code S.A. * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -177,7 +177,10 @@ private VerticalLayout getEditionLayout() { // Action Selector actionSelector = new RadioButtonGroup<>(); actionSelector.setLabel("Select Action"); - actionSelector.setItems("Add", "Edit", "Delete"); + // #if vaadin eq 0 + ReflectionUtil.setItems(actionSelector,"Add", "Edit", "Delete"); + // #endif + // show-source actionSelector.setItems("Add", "Edit", "Delete"); actionSelector.addValueChangeListener(event -> updateComponentStates()); Div separator = new Div(); @@ -204,7 +207,10 @@ private VerticalLayout getEditionLayout() { // Relation type selector typeSelector = new RadioButtonGroup(); typeSelector.setLabel("Select Relation Type:"); - typeSelector.setItems("Parent(root)", "Child", "Sibling"); + // #if vaadin eq 0 + ReflectionUtil.setItems(typeSelector, "Parent(root)", "Child", "Sibling"); + // #endif + // show-source typeSelector.setItems("Parent(root)", "Child", "Sibling"); typeSelector.setValue("Child"); typeSelector.addThemeVariants(RadioGroupVariant.LUMO_VERTICAL); diff --git a/src/test/java/com/flowingcode/vaadin/addons/orgchart/HybridDataPropertyDemo.java b/src/test/java/com/flowingcode/vaadin/addons/orgchart/HybridDataPropertyDemo.java index 556bded..9803da2 100644 --- a/src/test/java/com/flowingcode/vaadin/addons/orgchart/HybridDataPropertyDemo.java +++ b/src/test/java/com/flowingcode/vaadin/addons/orgchart/HybridDataPropertyDemo.java @@ -2,7 +2,7 @@ * #%L * OrgChart Add-on * %% - * Copyright (C) 2017 - 2025 Flowing Code S.A. + * Copyright (C) 2017 - 2026 Flowing Code S.A. * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/com/flowingcode/vaadin/addons/orgchart/HybridEnhancedChartDemo.java b/src/test/java/com/flowingcode/vaadin/addons/orgchart/HybridEnhancedChartDemo.java index 2d404b2..90ea0a4 100644 --- a/src/test/java/com/flowingcode/vaadin/addons/orgchart/HybridEnhancedChartDemo.java +++ b/src/test/java/com/flowingcode/vaadin/addons/orgchart/HybridEnhancedChartDemo.java @@ -2,7 +2,7 @@ * #%L * OrgChart Add-on * %% - * Copyright (C) 2017 - 2025 Flowing Code S.A. + * Copyright (C) 2017 - 2026 Flowing Code S.A. * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/com/flowingcode/vaadin/addons/orgchart/ImageInTitleDemo.java b/src/test/java/com/flowingcode/vaadin/addons/orgchart/ImageInTitleDemo.java index 45186e6..b9d4322 100644 --- a/src/test/java/com/flowingcode/vaadin/addons/orgchart/ImageInTitleDemo.java +++ b/src/test/java/com/flowingcode/vaadin/addons/orgchart/ImageInTitleDemo.java @@ -2,7 +2,7 @@ * #%L * OrgChart Add-on * %% - * Copyright (C) 2017 - 2025 Flowing Code S.A. + * Copyright (C) 2017 - 2026 Flowing Code S.A. * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/com/flowingcode/vaadin/addons/orgchart/OrgchartDemoView.java b/src/test/java/com/flowingcode/vaadin/addons/orgchart/OrgchartDemoView.java index d1bb147..7245c77 100644 --- a/src/test/java/com/flowingcode/vaadin/addons/orgchart/OrgchartDemoView.java +++ b/src/test/java/com/flowingcode/vaadin/addons/orgchart/OrgchartDemoView.java @@ -2,7 +2,7 @@ * #%L * OrgChart Add-on * %% - * Copyright (C) 2017 - 2025 Flowing Code S.A. + * Copyright (C) 2017 - 2026 Flowing Code S.A. * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/com/flowingcode/vaadin/addons/orgchart/ReflectionUtil.java b/src/test/java/com/flowingcode/vaadin/addons/orgchart/ReflectionUtil.java new file mode 100644 index 0000000..85e2a23 --- /dev/null +++ b/src/test/java/com/flowingcode/vaadin/addons/orgchart/ReflectionUtil.java @@ -0,0 +1,41 @@ +/*- + * #%L + * OrgChart Add-on + * %% + * Copyright (C) 2017 - 2026 Flowing Code S.A. + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ +package com.flowingcode.vaadin.addons.orgchart; + +import java.util.Arrays; +import java.util.Collection; + +import com.vaadin.flow.component.radiobutton.RadioButtonGroup; + +public class ReflectionUtil { + + /** Reflective call in order to maintain binary compatibility with Vaadin 14 - 24+ */ + static void setItems(RadioButtonGroup radioButtonGroup, + String... items) { + try { + RadioButtonGroup.class + .getMethod("setItems", Collection.class) + .invoke(radioButtonGroup, Arrays.asList(items)); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + +} diff --git a/src/test/resources/META-INF/resources/frontend/styles/orgchart/demo-styles.css b/src/test/resources/META-INF/resources/frontend/styles/orgchart/demo-styles.css index d583080..b470b93 100644 --- a/src/test/resources/META-INF/resources/frontend/styles/orgchart/demo-styles.css +++ b/src/test/resources/META-INF/resources/frontend/styles/orgchart/demo-styles.css @@ -2,7 +2,7 @@ * #%L * OrgChart Add-on * %% - * Copyright (C) 2017 - 2025 Flowing Code S.A. + * Copyright (C) 2017 - 2026 Flowing Code S.A. * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/resources/META-INF/resources/frontend/styles/orgchart/edit-chart-demo-styles.css b/src/test/resources/META-INF/resources/frontend/styles/orgchart/edit-chart-demo-styles.css index 9f21b17..9f905d3 100644 --- a/src/test/resources/META-INF/resources/frontend/styles/orgchart/edit-chart-demo-styles.css +++ b/src/test/resources/META-INF/resources/frontend/styles/orgchart/edit-chart-demo-styles.css @@ -2,7 +2,7 @@ * #%L * OrgChart Add-on * %% - * Copyright (C) 2017 - 2025 Flowing Code S.A. + * Copyright (C) 2017 - 2026 Flowing Code S.A. * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/resources/META-INF/resources/frontend/styles/orgchart/hybrid-demo-styles.css b/src/test/resources/META-INF/resources/frontend/styles/orgchart/hybrid-demo-styles.css index 2b20bca..c42802f 100644 --- a/src/test/resources/META-INF/resources/frontend/styles/orgchart/hybrid-demo-styles.css +++ b/src/test/resources/META-INF/resources/frontend/styles/orgchart/hybrid-demo-styles.css @@ -2,7 +2,7 @@ * #%L * OrgChart Add-on * %% - * Copyright (C) 2017 - 2025 Flowing Code S.A. + * Copyright (C) 2017 - 2026 Flowing Code S.A. * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.