diff --git a/alerts/src/main/java/org/dominokit/domino/alerts/client/views/ui/AlertsViewImpl.java b/alerts/src/main/java/org/dominokit/domino/alerts/client/views/ui/AlertsViewImpl.java index 47338398..82679e50 100644 --- a/alerts/src/main/java/org/dominokit/domino/alerts/client/views/ui/AlertsViewImpl.java +++ b/alerts/src/main/java/org/dominokit/domino/alerts/client/views/ui/AlertsViewImpl.java @@ -11,36 +11,42 @@ import org.dominokit.domino.componentcase.client.ui.views.LinkToSourceCode; import org.dominokit.domino.ui.alerts.Alert; import org.dominokit.domino.ui.cards.Card; +import org.dominokit.domino.ui.elements.DivElement; +import org.dominokit.domino.ui.grid.flex.FlexDirection; +import org.dominokit.domino.ui.grid.flex.FlexItem; +import org.dominokit.domino.ui.grid.flex.FlexJustifyContent; +import org.dominokit.domino.ui.grid.flex.FlexLayout; import org.dominokit.domino.ui.style.Color; +import org.dominokit.domino.ui.style.CompositeCssClass; +import org.dominokit.domino.ui.style.DisplayCss; import org.dominokit.domino.ui.typography.BlockHeader; @UiView(presentable = AlertsProxy.class) @SampleClass public class AlertsViewImpl extends BaseDemoView implements AlertsView { - private HTMLDivElement element = div().element(); + private DivElement element = div(); @Override protected HTMLDivElement init() { - element.appendChild(LinkToSourceCode.createLink("alerts", AlertsViewImpl.class).element()); + element.appendChild(LinkToSourceCode.createLink("alerts", AlertsViewImpl.class)); element.appendChild(BlockHeader.create("Alerts") .element()); basicAlerts(); - element.appendChild(CodeCard.createCodeCard(CodeResource.INSTANCE.basicAlerts()).element()); + element.appendChild(CodeCard.createCodeCard(CodeResource.INSTANCE.basicAlerts())); customBackground(); - element.appendChild(CodeCard.createCodeCard(CodeResource.INSTANCE.customBackground()) - .element()); + element.appendChild(CodeCard.createCodeCard(CodeResource.INSTANCE.customBackground())); dismissibleAlerts(); - element.appendChild(CodeCard.createCodeCard(CodeResource.INSTANCE.dismissibleAlerts()).element()); + element.appendChild(CodeCard.createCodeCard(CodeResource.INSTANCE.dismissibleAlerts())); linksInAlerts(); - element.appendChild(CodeCard.createCodeCard(CodeResource.INSTANCE.linksInAlerts()).element()); + element.appendChild(CodeCard.createCodeCard(CodeResource.INSTANCE.linksInAlerts())); - return element; + return element.element(); } @SampleMethod @@ -62,7 +68,7 @@ private void basicAlerts() { .addCss(dui_m_b_4) .appendChild(strong().textContent("Oh snap! ")) .appendChild("Change a few things up and try submitting again.")) - .element()); + ); } @SampleMethod @@ -83,7 +89,7 @@ private void customBackground() { .appendChild(Alert.create() .addCss(dui_bg_red, dui_fg_white, dui_m_b_4) .appendChild("Lorem ipsum dolor sit amet, id fugit tollit pro, illud nostrud aliquando ad est, quo esse dolorum id")) - .element()); + ); } @SampleMethod @@ -106,7 +112,7 @@ private void dismissibleAlerts() { .addCss(dui_bg_green, dui_fg_white, dui_m_b_4) .appendChild("Lorem ipsum dolor sit amet, id fugit tollit pro, illud nostrud aliquando ad est, quo esse dolorum id") .dismissible()) - .element()); + ); } @SampleMethod @@ -137,6 +143,6 @@ private void linksInAlerts() { .addCss(dui_bg_pink, dui_fg_white, dui_m_b_4) .appendChild("Lorem ipsum dolor sit amet, id fugit tollit pro, illud nostrud aliquando ad est, quo esse dolorum id ") .appendChild(a().appendChild("alert link."))) - .element()); + ); } } \ No newline at end of file diff --git a/basic-forms/src/main/java/org/dominokit/domino/basicforms/client/views/ui/BasicFormsViewImpl.java b/basic-forms/src/main/java/org/dominokit/domino/basicforms/client/views/ui/BasicFormsViewImpl.java index 07dabb8a..d3ecae48 100644 --- a/basic-forms/src/main/java/org/dominokit/domino/basicforms/client/views/ui/BasicFormsViewImpl.java +++ b/basic-forms/src/main/java/org/dominokit/domino/basicforms/client/views/ui/BasicFormsViewImpl.java @@ -1,5 +1,6 @@ package org.dominokit.domino.basicforms.client.views.ui; +import elemental2.dom.DomGlobal; import elemental2.dom.HTMLDivElement; import org.dominokit.domino.SampleClass; import org.dominokit.domino.SampleMethod; diff --git a/breadcrumb/src/main/java/org/dominokit/domino/breadcrumb/client/views/ui/BreadcrumbViewImpl.java b/breadcrumb/src/main/java/org/dominokit/domino/breadcrumb/client/views/ui/BreadcrumbViewImpl.java index 3c1ad4fe..5d5ac344 100644 --- a/breadcrumb/src/main/java/org/dominokit/domino/breadcrumb/client/views/ui/BreadcrumbViewImpl.java +++ b/breadcrumb/src/main/java/org/dominokit/domino/breadcrumb/client/views/ui/BreadcrumbViewImpl.java @@ -99,14 +99,14 @@ private void coloredBreadcrumb() { .appendChild(Column.span6() .appendChild(Card.create("WITH MATERIAL DESIGN COLORS", "You can use material design colors") .appendChild(Breadcrumb.create() - .addCss(dui_accent_pink) + .addCss(dui_fg_pink) .appendChild(" Home ", evt -> { }) .appendChild(" Library ", evt -> { }) ) .appendChild(Breadcrumb.create() - .addCss(dui_accent_cyan) + .addCss(dui_fg_cyan) .appendChild(" Home ", evt -> { }) .appendChild(" Library ", evt -> { @@ -115,7 +115,7 @@ private void coloredBreadcrumb() { }) ) .appendChild(Breadcrumb.create() - .addCss(dui_accent_teal) + .addCss(dui_fg_teal) .appendChild(" Home ", evt -> { }) .appendChild(" Library ", evt -> { @@ -126,7 +126,7 @@ private void coloredBreadcrumb() { }) ) .appendChild(Breadcrumb.create() - .addCss(dui_accent_orange) + .addCss(dui_fg_orange) .appendChild(" Home ", evt -> { }) .appendChild(" Library ", evt -> { @@ -142,14 +142,14 @@ private void coloredBreadcrumb() { .appendChild(Column.span6() .appendChild(Card.create("WITH ICONS & MATERIAL DESIGN COLORS") .appendChild(Breadcrumb.create() - .addCss(dui_accent_pink) + .addCss(dui_fg_color_accent) .appendChild(Icons.home(), " Home ", evt -> { }) .appendChild(Icons.filmstrip_box(), " Library ", evt -> { }) ) .appendChild(Breadcrumb.create() - .addCss(dui_accent_cyan) + .addCss(dui_fg_cyan) .appendChild(Icons.home(), " Home ", evt -> { }) .appendChild(Icons.filmstrip_box(), " Library ", evt -> { @@ -158,7 +158,7 @@ private void coloredBreadcrumb() { }) ) .appendChild(Breadcrumb.create() - .addCss(dui_accent_teal) + .addCss(dui_fg_teal) .appendChild(Icons.home(), " Home ", evt -> { }) .appendChild(Icons.filmstrip_box(), " Library ", evt -> { @@ -169,7 +169,7 @@ private void coloredBreadcrumb() { }) ) .appendChild(Breadcrumb.create() - .addCss(dui_accent_orange) + .addCss(dui_fg_orange) .appendChild(Icons.home(), " Home ", evt -> { }) .appendChild(Icons.filmstrip_box(), " Library ", evt -> { diff --git a/collapse/src/main/java/org/dominokit/domino/collapse/client/views/ui/CollapseViewImpl.java b/collapse/src/main/java/org/dominokit/domino/collapse/client/views/ui/CollapseViewImpl.java index 10e6ac68..1068c751 100644 --- a/collapse/src/main/java/org/dominokit/domino/collapse/client/views/ui/CollapseViewImpl.java +++ b/collapse/src/main/java/org/dominokit/domino/collapse/client/views/ui/CollapseViewImpl.java @@ -14,13 +14,7 @@ import org.dominokit.domino.ui.button.Button; import org.dominokit.domino.ui.button.LinkButton; import org.dominokit.domino.ui.cards.Card; -import org.dominokit.domino.ui.collapsible.Accordion; -import org.dominokit.domino.ui.collapsible.AccordionPanel; -import org.dominokit.domino.ui.collapsible.AnimationCollapseStrategy; -import org.dominokit.domino.ui.collapsible.CollapseDuration; -import org.dominokit.domino.ui.collapsible.Collapsible; -import org.dominokit.domino.ui.collapsible.DisplayCollapseStrategy; -import org.dominokit.domino.ui.collapsible.HeightCollapseStrategy; +import org.dominokit.domino.ui.collapsible.*; import org.dominokit.domino.ui.elements.DivElement; import org.dominokit.domino.ui.grid.Column; import org.dominokit.domino.ui.grid.Row; @@ -79,13 +73,13 @@ private void example() { .textContent(SAMPLE_CONTENT)); Collapsible heightCollapsible = Collapsible.create(heightDiv) - .setStrategy(new HeightCollapseStrategy(CollapseDuration._300ms)); + .setStrategy(new HeightCollapseStrategy(CollapsibleDuration._300ms)); Collapsible displayCollapsible = Collapsible.create(displayDiv) .setStrategy(new DisplayCollapseStrategy()); Collapsible animationCollapsible = Collapsible.create(animationDiv) - .setStrategy(new AnimationCollapseStrategy(Transition.FADE_IN, Transition.FADE_OUT, CollapseDuration._500ms)); + .setStrategy(new AnimationCollapseStrategy(Transition.FADE_IN, Transition.FADE_OUT, CollapsibleDuration._500ms)); Button heightCollapseButton = Button.create("Height collapse"); heightCollapseButton.getClickableElement().addEventListener("click", evt -> heightCollapsible.toggleCollapse()); @@ -141,6 +135,7 @@ private void accordionSample() { .appendChild(b().textContent("Panel Accent")) .appendChild(Accordion.create().addCss(dui_accent, dui_ignore_bg, dui_ignore_fg) .appendChild(AccordionPanel.create("Collapsible item 1") + .withHeader((parent, header) -> header .appendChild(PrefixAddOn.of(Icons.bus_clock())) .appendChild(PostfixAddOn.of(Badge.create("15").addCss(dui_rounded_full, dui_bg_accent_d_3))) diff --git a/modals/src/main/java/org/dominokit/domino/modals/client/views/ui/ModalsViewImpl.java b/modals/src/main/java/org/dominokit/domino/modals/client/views/ui/ModalsViewImpl.java index 62a1570b..d8008da0 100644 --- a/modals/src/main/java/org/dominokit/domino/modals/client/views/ui/ModalsViewImpl.java +++ b/modals/src/main/java/org/dominokit/domino/modals/client/views/ui/ModalsViewImpl.java @@ -25,6 +25,7 @@ import org.dominokit.domino.ui.loaders.LoaderEffect; import org.dominokit.domino.ui.menu.Menu; import org.dominokit.domino.ui.menu.MenuItem; +import org.dominokit.domino.ui.style.SpacingCss; import org.dominokit.domino.ui.style.SwapCssClass; import org.dominokit.domino.ui.typography.BlockHeader; import org.dominokit.domino.ui.utils.FooterContent; diff --git a/ui-demo-frontend/src/main/java/org/dominokit/domino/ui/demo/AppClientModule.java b/ui-demo-frontend/src/main/java/org/dominokit/domino/ui/demo/AppClientModule.java index 1bc09ac7..81299328 100644 --- a/ui-demo-frontend/src/main/java/org/dominokit/domino/ui/demo/AppClientModule.java +++ b/ui-demo-frontend/src/main/java/org/dominokit/domino/ui/demo/AppClientModule.java @@ -3,23 +3,21 @@ import com.google.gwt.core.client.EntryPoint; import org.dominokit.domino.api.client.ClientApp; import org.dominokit.domino.gwt.client.app.DominoGWT; -import org.dominokit.domino.ui.elements.AnchorElement; import org.dominokit.domino.ui.themes.DominoThemeManager; -import org.dominokit.domino.ui.utils.DominoUIConfig; -import org.dominokit.domino.ui.utils.ElementsFactoryDelegate; import org.dominokit.domino.view.DominoViewOptions; import java.util.logging.Logger; -import static org.dominokit.domino.ui.utils.DomElements.dom; - public class AppClientModule implements EntryPoint { private static final Logger LOGGER = Logger.getLogger(AppClientModule.class.getName()); public void onModuleLoad() { - - DominoGWT.init(DominoViewOptions.getInstance().setRootPath("domino-ui/demo/v2")); + if (System.getProperty("superdevmode").equals("on")) { + DominoGWT.init(DominoViewOptions.getInstance()); + }else { + DominoGWT.init(DominoViewOptions.getInstance().setRootPath("domino-ui/demo/v2")); + } DominoThemeManager.INSTANCE.applyUserThemes(); ClientApp.make().run(); LOGGER.info("ui-demo Application frontend have been initialized."); diff --git a/ui-demo-server/ui-demo-server-backend/src/main/resources/templates/index.ftl b/ui-demo-server/ui-demo-server-backend/src/main/resources/templates/index.ftl index e72664a0..aa1a2ae0 100644 --- a/ui-demo-server/ui-demo-server-backend/src/main/resources/templates/index.ftl +++ b/ui-demo-server/ui-demo-server-backend/src/main/resources/templates/index.ftl @@ -11,7 +11,7 @@ - ui-demo + Domino-ui demo