Skip to content

Commit

Permalink
update demo
Browse files Browse the repository at this point in the history
  • Loading branch information
vegegoku committed Oct 29, 2023
1 parent 0b78a89 commit 4a2b266
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<HTMLDivElement> 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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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());
);
}
}
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 -> {
Expand All @@ -115,7 +115,7 @@ private void coloredBreadcrumb() {
})
)
.appendChild(Breadcrumb.create()
.addCss(dui_accent_teal)
.addCss(dui_fg_teal)
.appendChild(" Home ", evt -> {
})
.appendChild(" Library ", evt -> {
Expand All @@ -126,7 +126,7 @@ private void coloredBreadcrumb() {
})
)
.appendChild(Breadcrumb.create()
.addCss(dui_accent_orange)
.addCss(dui_fg_orange)
.appendChild(" Home ", evt -> {
})
.appendChild(" Library ", evt -> {
Expand All @@ -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 -> {
Expand All @@ -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 -> {
Expand All @@ -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 -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -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)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<link href="${appRootPath}/prettify/prettify.css" rel="stylesheet" type="text/css">
<link href="${appRootPath}/prettify/desert.css" rel="stylesheet" type="text/css">

<title>ui-demo</title>
<title>Domino-ui demo</title>
<script src="${appRootPath}/prettify/prettify.js" type="text/javascript"></script>
<script src="${appRootPath}/app.nocache.js"></script>
</head>
Expand Down

0 comments on commit 4a2b266

Please sign in to comment.