diff --git a/domino-ui/src/main/java/org/dominokit/domino/ui/datatable/plugins/summary/SummaryPluginConfig.java b/domino-ui/src/main/java/org/dominokit/domino/ui/datatable/plugins/summary/SummaryPluginConfig.java index f19c772ba..5247b3ff0 100644 --- a/domino-ui/src/main/java/org/dominokit/domino/ui/datatable/plugins/summary/SummaryPluginConfig.java +++ b/domino-ui/src/main/java/org/dominokit/domino/ui/datatable/plugins/summary/SummaryPluginConfig.java @@ -27,17 +27,19 @@ public SummaryPluginConfig(boolean removeOnEmptyData) { this.removeOnEmptyData = removeOnEmptyData; } - public static SummaryPluginConfig of(){ - return new SummaryPluginConfig(DominoUIConfig.CONFIG.getUIConfig().isRemoveSummaryRecordsForEmptyTable()); + public static SummaryPluginConfig of() { + return new SummaryPluginConfig( + DominoUIConfig.CONFIG.getUIConfig().isRemoveSummaryRecordsForEmptyTable()); } - public static SummaryPluginConfig of(boolean removeOnEmptyData){ + public static SummaryPluginConfig of(boolean removeOnEmptyData) { return new SummaryPluginConfig(removeOnEmptyData); } /** * @return boolean, true will cause the plugin to remove the summary records for empty data - * tables, false will keep them, default to {@link DatatableConfig#isRemoveSummaryRecordsForEmptyTable()} + * tables, false will keep them, default to {@link + * DatatableConfig#isRemoveSummaryRecordsForEmptyTable()} */ public boolean isRemoveOnEmptyData() { return removeOnEmptyData; diff --git a/domino-ui/src/main/java/org/dominokit/domino/ui/datepicker/Calendar.java b/domino-ui/src/main/java/org/dominokit/domino/ui/datepicker/Calendar.java index 4160f814b..78423aa6d 100644 --- a/domino-ui/src/main/java/org/dominokit/domino/ui/datepicker/Calendar.java +++ b/domino-ui/src/main/java/org/dominokit/domino/ui/datepicker/Calendar.java @@ -113,20 +113,21 @@ public Calendar(Date date, DateTimeFormatInfo dateTimeFormatInfo, CalendarInitCo this.dateTimeFormatInfo = dateTimeFormatInfo; this.config = config; - this.root = - div() - .addCss(dui_calendar) - .apply(calendar -> header = LazyChild.of(CalendarHeader.create(this), calendar)) - .appendChild(selectors = CalendarSelectors.create(this)) - .appendChild( - calendarBody = - div() - .addCss(dui_calendar_body) - .appendChild(calendarMonth = CalendarMonth.create(this)) - .appendChild(yearMonthPicker = YearMonthPicker.create(this).hide())) - .apply( - calendar -> - this.footer = LazyChild.of(div().addCss(dui_calendar_footer), calendar)); + this.root = div().addCss(dui_calendar); + + getConfig().getPlugins().forEach(plugin -> plugin.onInit(this)); + init(this); + + this.root + .apply(calendar -> header = LazyChild.of(CalendarHeader.create(this), calendar)) + .appendChild(selectors = CalendarSelectors.create(this)) + .appendChild( + calendarBody = + div() + .addCss(dui_calendar_body) + .appendChild(calendarMonth = CalendarMonth.create(this)) + .appendChild(yearMonthPicker = YearMonthPicker.create(this).hide())) + .apply(calendar -> this.footer = LazyChild.of(div().addCss(dui_calendar_footer), calendar)); this.root.addEventListener( CalendarCustomEvents.DATE_NAVIGATION_CHANGED, @@ -168,11 +169,10 @@ public Calendar(Date date, DateTimeFormatInfo dateTimeFormatInfo, CalendarInitCo calendarBody.removeCss(dui_p_x_1_5); } }); - init(this); + onDateViewUpdate(this.date); onDateSelectionChanged(this.date); onDateTimeFormatChanged(); - getConfig().getPlugins().forEach(plugin -> plugin.onInit(this)); } /** diff --git a/domino-ui/src/main/java/org/dominokit/domino/ui/datepicker/CalendarDay.java b/domino-ui/src/main/java/org/dominokit/domino/ui/datepicker/CalendarDay.java index 873552117..3798310ba 100644 --- a/domino-ui/src/main/java/org/dominokit/domino/ui/datepicker/CalendarDay.java +++ b/domino-ui/src/main/java/org/dominokit/domino/ui/datepicker/CalendarDay.java @@ -15,7 +15,6 @@ */ package org.dominokit.domino.ui.datepicker; -import static org.dominokit.domino.ui.utils.Domino.*; import static org.dominokit.domino.ui.utils.Domino.div; import static org.dominokit.domino.ui.utils.Domino.span; @@ -65,13 +64,6 @@ public CalendarDay(IsCalendar calendar, Date date, int day, boolean inRange) { root = div() - .addClickListener( - evt -> { - this.dispatchEvent( - CalendarCustomEvents.dateSelectionChanged( - new Date(this.date.getYear(), this.date.getMonth(), this.date.getDate()) - .getTime())); - }) .addCss( dui_calendar_day, BooleanCssClass.of(dui_month_day_in_range, inRange), @@ -84,6 +76,13 @@ public CalendarDay(IsCalendar calendar, Date date, int day, boolean inRange) { .addCss(dui_calendar_day_number) .textContent(String.valueOf(date.getDate()))); init(this); + addClickListener( + evt -> { + this.dispatchEvent( + CalendarCustomEvents.dateSelectionChanged( + new Date(this.date.getYear(), this.date.getMonth(), this.date.getDate()) + .getTime())); + }); } /**