diff --git a/src/main/java/org/dominokit/domino/ui/datatable/DataTable.java b/src/main/java/org/dominokit/domino/ui/datatable/DataTable.java index 351dabf6c..394a0f035 100644 --- a/src/main/java/org/dominokit/domino/ui/datatable/DataTable.java +++ b/src/main/java/org/dominokit/domino/ui/datatable/DataTable.java @@ -17,14 +17,17 @@ import java.util.stream.Collectors; import static java.util.Objects.nonNull; +import static org.dominokit.domino.ui.datatable.DataTableStyles.*; import static org.jboss.gwt.elemento.core.Elements.*; public class DataTable extends BaseDominoElement> implements HasSelectionSupport> { public static final String ANY = "*"; + public static final String DATA_TABLE_ROW_FILTERED = "data-table-row-filtered"; + private final DataStore dataStore; - private DominoElement element = DominoElement.of(div().css("table-responsive")); - private DominoElement tableElement = DominoElement.of(table().css("table", "table-hover", "table-striped")); + private DominoElement root = DominoElement.of(div().css(TABLE_RESPONSIVE)); + private DominoElement tableElement = DominoElement.of(table().css(TABLE, TABLE_HOVER, TABLE_STRIPED)); private TableConfig tableConfig; private DominoElement tbody = DominoElement.of(tbody()); private DominoElement thead = DominoElement.of(thead()); @@ -71,18 +74,15 @@ private DataTable init() { tableConfig.onAfterHeaders(this); tableElement.appendChild(tbody); tableConfig.getPlugins().forEach(plugin -> plugin.onBodyAdded(DataTable.this)); - element.appendChild(tableElement); + root.appendChild(tableElement); tableConfig.getPlugins().forEach(plugin -> plugin.onAfterAddTable(DataTable.this)); if (!tableConfig.isLazyLoad()) { this.dataStore.load(); } if (tableConfig.isFixed()) { - element.style() - .setPosition("relative") - .setOverFlowY("hidden"); - thead.style().setDisplay("block"); + root.style().add(TABLE_FIXED); tbody.style() - .add("tbody-fixed") + .add(TBODY_FIXED) .setMaxHeight(tableConfig.getFixedBodyHeight()); } super.init(this); @@ -126,53 +126,53 @@ public Collection getData() { } public DataTable expand() { - tableElement.style().remove("table-condensed"); + tableElement.style().remove(TABLE_CONDENSED); this.condensed = false; return this; } public DataTable condense() { expand(); - tableElement.style().add("table-condensed"); + tableElement.style().add(TABLE_CONDENSED); this.condensed = true; return this; } public DataTable noHover() { - tableElement.style().remove("table-hover"); + tableElement.style().remove(TABLE_HOVER); this.hoverable = false; return this; } public DataTable hovered() { noHover(); - tableElement.style().add("table-hover"); + tableElement.style().add(TABLE_HOVER); this.hoverable = true; return this; } public DataTable noBorder() { - tableElement.style().remove("table-bordered"); + tableElement.style().remove(TABLE_BORDERED); this.bordered = false; return this; } public DataTable bordered() { noBorder(); - tableElement.style().add("table-bordered"); + tableElement.style().add(TABLE_BORDERED); this.bordered = true; return this; } public DataTable noStripes() { - tableElement.style().remove("table-striped"); + tableElement.style().remove(TABLE_STRIPED); this.striped = false; return this; } public DataTable striped() { noStripes(); - tableElement.style().add("table-striped"); + tableElement.style().add(TABLE_STRIPED); this.striped = true; return this; } @@ -212,12 +212,12 @@ public boolean isBordered() { public void filterRows(LocalRowFilter rowFilter) { tableRows.forEach(tableRow -> { if (rowFilter.filter(tableRow)) { - tableRow.style().removeProperty("display"); - tableRow.removeFlag("data-table-row-filtered"); + tableRow.style().remove(TABLE_ROW_FILTERED); + tableRow.removeFlag(DATA_TABLE_ROW_FILTERED); tableRow.fireUpdate(); } else { - tableRow.style().setDisplay("none"); - tableRow.setFlag("data-table-row-filtered", "true"); + tableRow.style().add(TABLE_ROW_FILTERED); + tableRow.setFlag(DATA_TABLE_ROW_FILTERED, "true"); tableRow.deselect(); tableRow.fireUpdate(); } @@ -225,17 +225,17 @@ public void filterRows(LocalRowFilter rowFilter) { } public void clearRowFilters() { - tableRows.stream().filter(tableRow -> nonNull(tableRow.getFlag("data-table-row-filtered"))) + tableRows.stream().filter(tableRow -> nonNull(tableRow.getFlag(DATA_TABLE_ROW_FILTERED))) .forEach(tableRow -> { - tableRow.style().removeProperty("display"); - tableRow.removeFlag("data-table-row-filtered"); + tableRow.style().remove(TABLE_ROW_FILTERED); + tableRow.removeFlag(DATA_TABLE_ROW_FILTERED); tableRow.fireUpdate(); }); } @Override public HTMLDivElement asElement() { - return element.asElement(); + return root.asElement(); } @Override diff --git a/src/main/java/org/dominokit/domino/ui/datatable/DataTableStyles.java b/src/main/java/org/dominokit/domino/ui/datatable/DataTableStyles.java new file mode 100644 index 000000000..79ea89b16 --- /dev/null +++ b/src/main/java/org/dominokit/domino/ui/datatable/DataTableStyles.java @@ -0,0 +1,20 @@ +package org.dominokit.domino.ui.datatable; + +public class DataTableStyles { + public static final String TABLE_RESPONSIVE = "table-responsive"; + public static final String TABLE = "table"; + public static final String TABLE_HOVER = "table-hover"; + public static final String TABLE_STRIPED = "table-striped"; + public static final String TABLE_CONDENSED = "table-condensed"; + public static final String TABLE_BORDERED = "table-bordered"; + public static final String TABLE_ROW_FILTERED = "table-row-filtered"; + public static final String TABLE_FIXED = "table-fixed"; + public static final String TBODY_FIXED = "tbody-fixed"; + public static final String TABLE_CM_HEADER = "table-cm-header"; + public static final String FIXED_WIDTH = "fixed-width"; + public static final String HEADER = "table-header"; + public static final String RECORD_DETAILS_BUTTON = "record-details-button"; + public static final String DETAILS_TD = "details-td"; + public static final String DETAILS_TR = "details-tr"; + public static final String SELECT_CHECKBOX = "select-checkbox"; +} diff --git a/src/main/java/org/dominokit/domino/ui/datatable/TableConfig.java b/src/main/java/org/dominokit/domino/ui/datatable/TableConfig.java index b2b57e1ed..fce7b3f86 100644 --- a/src/main/java/org/dominokit/domino/ui/datatable/TableConfig.java +++ b/src/main/java/org/dominokit/domino/ui/datatable/TableConfig.java @@ -32,12 +32,16 @@ public void drawHeaders(DataTable dataTable, DominoElement { + //TODO replace with FlexLayout Node element = columnConfig.getHeaderElement().asElement(columnConfig.getTitle()); columnConfig.contextMenu = div().style("width: 15px; display: none;").asElement(); - HtmlContentBuilder add = div().style("display: flex;") - .add(div().style("width:100%").add(element)) + HtmlContentBuilder headerContent = div() + .style("display: flex;") + .add(div() + .style("width:100%") + .add(element)) .add(columnConfig.contextMenu); - HtmlContentBuilder th = th().css("table-cm-header").add(add.asElement()); + HtmlContentBuilder th = th().css(DataTableStyles.TABLE_CM_HEADER).add(headerContent.asElement()); tr.add(th); columnConfig.setHeadElement(th.asElement()); if (dataTable.getTableConfig().isFixed() || columnConfig.isFixed()) { @@ -61,9 +65,7 @@ private void fixElementWidth(ColumnConfig column, HTMLElement element) { .setWidth(fixedWidth) .setMinWidth(fixedWidth) .setMaxWidth(fixedWidth) - .setProperty("overflow", "hidden") - .setProperty("text-overflow", "ellipsis") - .setProperty("white-space", "nowrap"); + .add(DataTableStyles.FIXED_WIDTH); } @@ -173,7 +175,7 @@ public void setMultiSelect(boolean multiSelect) { } public void setRowAppender(RowAppender rowAppender) { - if(nonNull(rowAppender)) { + if (nonNull(rowAppender)) { this.rowAppender = rowAppender; } } @@ -199,7 +201,7 @@ public DataTable getDataTable() { } @FunctionalInterface - public interface RowAppender{ + public interface RowAppender { void appendRow(DataTable dataTable, TableRow tableRow); } } diff --git a/src/main/java/org/dominokit/domino/ui/datatable/TableRow.java b/src/main/java/org/dominokit/domino/ui/datatable/TableRow.java index 01b582257..5e43f986d 100644 --- a/src/main/java/org/dominokit/domino/ui/datatable/TableRow.java +++ b/src/main/java/org/dominokit/domino/ui/datatable/TableRow.java @@ -32,7 +32,7 @@ public TableRow(T record, int index) { @Override public T select() { - if (!hasFalg("data-table-row-filtered")) { + if (!hasFalg(DataTable.DATA_TABLE_ROW_FILTERED)) { this.selected = true; selectionHandlers.forEach(selectionHandler -> selectionHandler.onSelectionChanged(TableRow.this)); } diff --git a/src/main/java/org/dominokit/domino/ui/datatable/plugins/ColumnHeaderFilterPlugin.java b/src/main/java/org/dominokit/domino/ui/datatable/plugins/ColumnHeaderFilterPlugin.java index c7b67b466..8ce1f75e7 100644 --- a/src/main/java/org/dominokit/domino/ui/datatable/plugins/ColumnHeaderFilterPlugin.java +++ b/src/main/java/org/dominokit/domino/ui/datatable/plugins/ColumnHeaderFilterPlugin.java @@ -6,6 +6,7 @@ import elemental2.dom.HTMLTableSectionElement; import org.dominokit.domino.ui.datatable.ColumnConfig; import org.dominokit.domino.ui.datatable.DataTable; +import org.dominokit.domino.ui.datatable.DataTableStyles; import org.dominokit.domino.ui.datatable.TableConfig; import org.dominokit.domino.ui.datatable.events.SearchClearedEvent; import org.dominokit.domino.ui.datatable.events.TableEvent; @@ -41,7 +42,7 @@ public void onAfterAddHeaders(DataTable dataTable) { columns.forEach(columnConfig -> { - HtmlContentBuilder th = th().css("table-cm-filter"); + HtmlContentBuilder th = th().css(DataTableStyles.TABLE_CM_HEADER); columnConfig.getHeaderStyler() .styleCell(th.asElement()); tr.add(th); @@ -64,9 +65,7 @@ private void fixElementWidth(ColumnConfig column, HTMLElement element) { .setWidth(fixedWidth) .setMinWidth(fixedWidth) .setMaxWidth(fixedWidth) - .setProperty("overflow", "hidden") - .setProperty("text-overflow", "ellipsis") - .setProperty("white-space", "nowrap"); + .add(DataTableStyles.FIXED_WIDTH); } diff --git a/src/main/java/org/dominokit/domino/ui/datatable/plugins/HeaderBarPlugin.java b/src/main/java/org/dominokit/domino/ui/datatable/plugins/HeaderBarPlugin.java index dbf9adc87..5b166315e 100644 --- a/src/main/java/org/dominokit/domino/ui/datatable/plugins/HeaderBarPlugin.java +++ b/src/main/java/org/dominokit/domino/ui/datatable/plugins/HeaderBarPlugin.java @@ -2,8 +2,8 @@ import elemental2.dom.*; import jsinterop.base.Js; -import org.dominokit.domino.ui.button.Button; import org.dominokit.domino.ui.datatable.DataTable; +import org.dominokit.domino.ui.datatable.DataTableStyles; import org.dominokit.domino.ui.datatable.events.SearchClearedEvent; import org.dominokit.domino.ui.datatable.events.TableEvent; import org.dominokit.domino.ui.datatable.model.Category; @@ -18,7 +18,6 @@ import org.dominokit.domino.ui.icons.Icon; import org.dominokit.domino.ui.icons.Icons; import org.dominokit.domino.ui.icons.MdiIcon; -import org.dominokit.domino.ui.popover.Tooltip; import org.dominokit.domino.ui.style.Style; import org.dominokit.domino.ui.style.Styles; import org.dominokit.domino.ui.utils.ElementUtil; @@ -36,7 +35,8 @@ public class HeaderBarPlugin implements DataTablePlugin { private Column titleColumn = Column.span6(); private Column actionsBarColumn = Column.span6(); - private HTMLHeadingElement title = Style.of(h(2)).setMarginBottom("0px").asElement(); + private HTMLHeadingElement title = Style.of(h(2)) + .setMarginBottom("0px").asElement(); private FlexLayout actionsBar = FlexLayout.create() .setJustifyContent(FlexJustifyContent.END); @@ -45,7 +45,7 @@ public class HeaderBarPlugin implements DataTablePlugin { .appendChild(titleColumn.appendChild(title)) .appendChild(actionsBarColumn.appendChild(actionsBar)) .asElement()) - .css("header") + .css(DataTableStyles.HEADER) .style("padding-bottom: 5px;") .asElement(); diff --git a/src/main/java/org/dominokit/domino/ui/datatable/plugins/RecordDetailsPlugin.java b/src/main/java/org/dominokit/domino/ui/datatable/plugins/RecordDetailsPlugin.java index e6aef4474..1660d2e37 100644 --- a/src/main/java/org/dominokit/domino/ui/datatable/plugins/RecordDetailsPlugin.java +++ b/src/main/java/org/dominokit/domino/ui/datatable/plugins/RecordDetailsPlugin.java @@ -5,10 +5,7 @@ import elemental2.dom.HTMLTableCellElement; import elemental2.dom.HTMLTableRowElement; import org.dominokit.domino.ui.button.Button; -import org.dominokit.domino.ui.datatable.CellRenderer; -import org.dominokit.domino.ui.datatable.ColumnConfig; -import org.dominokit.domino.ui.datatable.DataTable; -import org.dominokit.domino.ui.datatable.TableRow; +import org.dominokit.domino.ui.datatable.*; import org.dominokit.domino.ui.datatable.events.ExpandRecordEvent; import org.dominokit.domino.ui.datatable.events.TableEvent; import org.dominokit.domino.ui.icons.BaseIcon; @@ -21,12 +18,12 @@ public class RecordDetailsPlugin implements DataTablePlugin { - public static final String RECORD_DETAILS_BUTTON = "record-details-button"; + public static final String DATA_TABLE_DETAILS_CM = "data-table-details-cm"; private final BaseIcon collapseIcon; private final BaseIcon expandIcon; private HTMLDivElement element = div().asElement(); - private HTMLTableCellElement td = td().css("details-td").add(element).asElement(); - private HTMLTableRowElement tr = tr().css("details-tr").add(td).asElement(); + private HTMLTableCellElement td = td().css(DataTableStyles.DETAILS_TD).add(element).asElement(); + private HTMLTableRowElement tr = tr().css(DataTableStyles.DETAILS_TR).add(td).asElement(); private final CellRenderer cellRenderer; private DetailsButtonElement buttonElement; @@ -46,7 +43,7 @@ public RecordDetailsPlugin(CellRenderer cellRenderer, BaseIcon collapseIco @Override public void onBeforeAddHeaders(DataTable dataTable) { this.dataTable = dataTable; - ColumnConfig column = ColumnConfig.create("data-table-details-cm") + ColumnConfig column = ColumnConfig.create(DATA_TABLE_DETAILS_CM) .setSortable(false) .setWidth("60px") .setFixed(true) @@ -79,7 +76,7 @@ public void handleEvent(TableEvent event) { } private void expandRow(ExpandRecordEvent event) { - DetailsButtonElement detailsButtonElement = event.getTableRow().getMetaObject(RECORD_DETAILS_BUTTON); + DetailsButtonElement detailsButtonElement = event.getTableRow().getMetaObject(DataTableStyles.RECORD_DETAILS_BUTTON); setExpanded(detailsButtonElement); } @@ -153,7 +150,7 @@ public HTMLElement asElement() { @Override public String getKey() { - return RECORD_DETAILS_BUTTON; + return DataTableStyles.RECORD_DETAILS_BUTTON; } } diff --git a/src/main/java/org/dominokit/domino/ui/datatable/plugins/SelectionPlugin.java b/src/main/java/org/dominokit/domino/ui/datatable/plugins/SelectionPlugin.java index 53842020f..1aa4e4529 100644 --- a/src/main/java/org/dominokit/domino/ui/datatable/plugins/SelectionPlugin.java +++ b/src/main/java/org/dominokit/domino/ui/datatable/plugins/SelectionPlugin.java @@ -4,10 +4,7 @@ import elemental2.dom.HTMLElement; import elemental2.dom.Node; import jsinterop.base.Js; -import org.dominokit.domino.ui.datatable.CellRenderer; -import org.dominokit.domino.ui.datatable.ColumnConfig; -import org.dominokit.domino.ui.datatable.DataTable; -import org.dominokit.domino.ui.datatable.TableRow; +import org.dominokit.domino.ui.datatable.*; import org.dominokit.domino.ui.forms.CheckBox; import org.dominokit.domino.ui.icons.BaseIcon; import org.dominokit.domino.ui.icons.Icons; @@ -158,7 +155,7 @@ private CheckBox createCheckBox() { if (nonNull(colorScheme)) { checkBox.setColor(colorScheme.color()); } - Style.of(checkBox).add("select-checkbox"); + Style.of(checkBox).add(DataTableStyles.SELECT_CHECKBOX); return checkBox; } diff --git a/src/main/java/org/dominokit/domino/ui/public/css/datatable/datatable.css b/src/main/java/org/dominokit/domino/ui/public/css/datatable/datatable.css new file mode 100644 index 000000000..f26356576 --- /dev/null +++ b/src/main/java/org/dominokit/domino/ui/public/css/datatable/datatable.css @@ -0,0 +1,460 @@ + +table { + border-spacing: 0; + border-collapse: collapse; + background-color: transparent; +} + +td, +th { + padding: 0; +} + +caption { + padding-top: 8px; + padding-bottom: 8px; + color: #777; + text-align: left; +} + +th { + text-align: left; +} + +.table { + width: 100%; + max-width: 100%; + border-bottom: 1px solid #eee; + margin-bottom: 0px; +} + +.table > thead > tr > th, +.table > tbody > tr > th, +.table > tfoot > tr > th, +.table > thead > tr > td, +.table > tbody > tr > td, +.table > tfoot > tr > td { + padding: 8px; + line-height: 1.42857143; + border-top: 1px solid #ddd; +} + +.table > thead > tr > th { + vertical-align: bottom; + border-bottom: 2px solid #ddd; +} + +.table > caption + thead > tr:first-child > th, +.table > colgroup + thead > tr:first-child > th, +.table > thead:first-child > tr:first-child > th, +.table > caption + thead > tr:first-child > td, +.table > colgroup + thead > tr:first-child > td, +.table > thead:first-child > tr:first-child > td { + border-top: 0; +} + +.table > tbody + tbody { + border-top: 2px solid #ddd; +} + +.table .table { + background-color: #fff; +} + +.table.table-condensed > thead > tr > th, +.table.table-condensed > tbody > tr > th, +.table.table-condensed > tfoot > tr > th, +.table.table-condensed > thead > tr > td, +.table.table-condensed > tbody > tr > td, +.table.table-condensed > tfoot > tr > td { + padding: 5px; +} + +.table-bordered { + border: 1px solid #ddd; +} + +.table-bordered > thead > tr > th, +.table-bordered > tbody > tr > th, +.table-bordered > tfoot > tr > th, +.table-bordered > thead > tr > td, +.table-bordered > tbody > tr > td, +.table-bordered > tfoot > tr > td { + border: 1px solid #ddd; +} + +.table-bordered > thead > tr > th, +.table-bordered > thead > tr > td { + border-bottom-width: 2px; +} + +table col[class*="col-"] { + position: static; + display: table-column; + float: none; +} + +table td[class*="col-"], +table th[class*="col-"] { + position: static; + display: table-cell; + float: none; +} + +.table > thead > tr > td.active, +.table > tbody > tr > td.active, +.table > tfoot > tr > td.active, +.table > thead > tr > th.active, +.table > tbody > tr > th.active, +.table > tfoot > tr > th.active, +.table > thead > tr.active > td, +.table > tbody > tr.active > td, +.table > tfoot > tr.active > td, +.table > thead > tr.active > th, +.table > tbody > tr.active > th, +.table > tfoot > tr.active > th { + background-color: #f5f5f5; +} + +.table-hover > tbody > tr > td.active:hover, +.table-hover > tbody > tr > th.active:hover, +.table-hover > tbody > tr.active:hover > td, +.table-hover > tbody > tr:hover > .active, +.table-hover > tbody > tr.active:hover > th { + background-color: #e8e8e8; +} + +.table > thead > tr > td.success, +.table > tbody > tr > td.success, +.table > tfoot > tr > td.success, +.table > thead > tr > th.success, +.table > tbody > tr > th.success, +.table > tfoot > tr > th.success, +.table > thead > tr.success > td, +.table > tbody > tr.success > td, +.table > tfoot > tr.success > td, +.table > thead > tr.success > th, +.table > tbody > tr.success > th, +.table > tfoot > tr.success > th { + background-color: #dff0d8; +} + +.table-hover > tbody > tr > td.success:hover, +.table-hover > tbody > tr > th.success:hover, +.table-hover > tbody > tr.success:hover > td, +.table-hover > tbody > tr:hover > .success, +.table-hover > tbody > tr.success:hover > th { + background-color: #d0e9c6; +} + +.table > thead > tr > td.info, +.table > tbody > tr > td.info, +.table > tfoot > tr > td.info, +.table > thead > tr > th.info, +.table > tbody > tr > th.info, +.table > tfoot > tr > th.info, +.table > thead > tr.info > td, +.table > tbody > tr.info > td, +.table > tfoot > tr.info > td, +.table > thead > tr.info > th, +.table > tbody > tr.info > th, +.table > tfoot > tr.info > th { + background-color: #d9edf7; +} + +.table-hover > tbody > tr > td.info:hover, +.table-hover > tbody > tr > th.info:hover, +.table-hover > tbody > tr.info:hover > td, +.table-hover > tbody > tr:hover > .info, +.table-hover > tbody > tr.info:hover > th { + background-color: #c4e3f3; +} + +.table > thead > tr > td.warning, +.table > tbody > tr > td.warning, +.table > tfoot > tr > td.warning, +.table > thead > tr > th.warning, +.table > tbody > tr > th.warning, +.table > tfoot > tr > th.warning, +.table > thead > tr.warning > td, +.table > tbody > tr.warning > td, +.table > tfoot > tr.warning > td, +.table > thead > tr.warning > th, +.table > tbody > tr.warning > th, +.table > tfoot > tr.warning > th { + background-color: #fcf8e3; +} + +.table-hover > tbody > tr > td.warning:hover, +.table-hover > tbody > tr > th.warning:hover, +.table-hover > tbody > tr.warning:hover > td, +.table-hover > tbody > tr:hover > .warning, +.table-hover > tbody > tr.warning:hover > th { + background-color: #faf2cc; +} + +.table > thead > tr > td.danger, +.table > tbody > tr > td.danger, +.table > tfoot > tr > td.danger, +.table > thead > tr > th.danger, +.table > tbody > tr > th.danger, +.table > tfoot > tr > th.danger, +.table > thead > tr.danger > td, +.table > tbody > tr.danger > td, +.table > tfoot > tr.danger > td, +.table > thead > tr.danger > th, +.table > tbody > tr.danger > th, +.table > tfoot > tr.danger > th { + background-color: #f2dede; +} + +.table-hover > tbody > tr > td.danger:hover, +.table-hover > tbody > tr > th.danger:hover, +.table-hover > tbody > tr.danger:hover > td, +.table-hover > tbody > tr:hover > .danger, +.table-hover > tbody > tr.danger:hover > th { + background-color: #ebcccc; +} + +.table-responsive { + min-height: .01%; + overflow-x: auto; +} + +.table-responsive.table-fixed { + position: relative; + overflow-y: hidden; +} + +.table-responsive.table-fixed thead { + display: block; +} + +.table .fixed-width { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +@media screen and (max-width: 767px) { + .table-responsive { + width: 100%; + margin-bottom: 15px; + overflow-y: hidden; + -ms-overflow-style: -ms-autohiding-scrollbar; + border: 1px solid #ddd; + } + + .table-responsive > .table { + margin-bottom: 0; + } + + .table-responsive > .table > thead > tr > th, + .table-responsive > .table > tbody > tr > th, + .table-responsive > .table > tfoot > tr > th, + .table-responsive > .table > thead > tr > td, + .table-responsive > .table > tbody > tr > td, + .table-responsive > .table > tfoot > tr > td { + white-space: nowrap; + } + + .table-responsive > .table-bordered { + border: 0; + } + + .table-responsive > .table-bordered > thead > tr > th:first-child, + .table-responsive > .table-bordered > tbody > tr > th:first-child, + .table-responsive > .table-bordered > tfoot > tr > th:first-child, + .table-responsive > .table-bordered > thead > tr > td:first-child, + .table-responsive > .table-bordered > tbody > tr > td:first-child, + .table-responsive > .table-bordered > tfoot > tr > td:first-child { + border-left: 0; + } + + .table-responsive > .table-bordered > thead > tr > th:last-child, + .table-responsive > .table-bordered > tbody > tr > th:last-child, + .table-responsive > .table-bordered > tfoot > tr > th:last-child, + .table-responsive > .table-bordered > thead > tr > td:last-child, + .table-responsive > .table-bordered > tbody > tr > td:last-child, + .table-responsive > .table-bordered > tfoot > tr > td:last-child { + border-right: 0; + } + + .table-responsive > .table-bordered > tbody > tr:last-child > th, + .table-responsive > .table-bordered > tfoot > tr:last-child > th, + .table-responsive > .table-bordered > tbody > tr:last-child > td, + .table-responsive > .table-bordered > tfoot > tr:last-child > td { + border-bottom: 0; + } +} + +.table tbody tr.table-row-filtered { + display: none; +} + +.table tbody tr td, .table tbody tr th { + padding: 10px; + border-top: 1px solid #eee; + border-bottom: 1px solid #eee; +} + +.table tbody tr.primary td, .table tbody tr.primary th { + background-color: #1f91f3; + color: #fff; +} + +.table tbody tr.success td, .table tbody tr.success th { + background-color: #2b982b; + color: #fff; +} + +.table tbody tr.info td, .table tbody tr.info th { + background-color: #00b0e4; + color: #fff; +} + +.table tbody tr.warning td, .table tbody tr.warning th { + background-color: #ff9600; + color: #fff; +} + +.table tbody tr.danger td, .table tbody tr.danger th { + background-color: #fb483a; + color: #fff; +} + +.table thead tr th { + padding: 10px; + border-bottom: 1px solid #eee; +} + +.table-bordered { + border-top: 1px solid #eee; +} + + +.table-striped > tbody > tr:nth-of-type(odd):not([class*="details-tr"]):not([class*="bg-"]) { + background-color: #f9f9f9; +} + +.table-hover > tbody > tr:hover:not([class*="details-tr"]):not([class*="bg-"]) { + background-color: #f5f5f5; +} + +.table-bordered tbody tr td, .table-bordered tbody tr th { + padding: 10px; + border: 1px solid #eee; +} + +.table-bordered thead tr th { + padding: 10px; + border: 1px solid #eee; +} + +.table-cm-header:HOVER { + background-color: rgba(0, 0, 0, 0.04) !important; +} + +.table thead tr th.table-cm-filter { + padding: 5px; + font-weight: 300; +} + +.table-search-box { + background-color: #efefef; + border-radius: 3px; +} + +.table-responsive .table-header{ + padding: 20px; + position: relative; +} + +.table-responsive .table-header h2{ + margin: 0; + font-size: 18px; + font-weight: normal; +} + +.table-responsive .table-header h2 small{ + display: block; + font-size: 12px; + margin-top: 5px; + line-height: 15px; +} + +.table-responsive .table-header:not([class*="bg-"]) { + border-bottom: 1px solid rgba(204, 204, 204, 0.35); +} + +.table-responsive .table-header:not([class*="bg-"]) h2, +.table-responsive .table-header:not([class*="bg-"]) small { + color: #202020; +} + +.table-search-box .form-line .form-control { + background-color: #efefef; + border-bottom: 0px; + box-shadow: none; +} + +.details-td { + max-width: 200px; +} + +.details-tr { + border-top: 1px double #c3c3c3; +} + +.table td .form-group { + margin-bottom: 0px; +} + +.table .marker { + padding: 0px !important; + width: 3px !important; +} + +.table .table-checkbox:before { + margin-top: 4px !important; +} + +.tbody-fixed { + display: block; + overflow: auto; + /*border-bottom: 1px solid #eee;*/ +} + +.details-td { + max-width: 200px; +} + +.table .marker { + padding: 0px !important; + width: 3px !important; +} + +.table .table-checkbox:before { + margin-top: 4px !important; +} + +.table .select-checkbox { + margin: 0px; + height: 20px; +} + +.table .select-checkbox .checkbox { + margin: 0px; + height: 20px; +} + +.table .select-checkbox .form-control { + height: 20px; + padding: 0px; + background: transparent; +} + +.table .select-checkbox .form-control label { + height: 20px; + margin-bottom: 0px; +} \ No newline at end of file diff --git a/src/main/java/org/dominokit/domino/ui/public/css/domino-ui.css b/src/main/java/org/dominokit/domino/ui/public/css/domino-ui.css index 7d6f48b66..050710963 100644 --- a/src/main/java/org/dominokit/domino/ui/public/css/domino-ui.css +++ b/src/main/java/org/dominokit/domino/ui/public/css/domino-ui.css @@ -16,5 +16,6 @@ @import url(carousel/carousel.css); @import url(chips/chips.css); @import url(collapsible/collapsible.css); +@import url(datatable/datatable.css); @import url(style.css); @import url(colors.css); \ No newline at end of file diff --git a/src/main/java/org/dominokit/domino/ui/public/css/style.css b/src/main/java/org/dominokit/domino/ui/public/css/style.css index 74ab128ec..d5a713af9 100644 --- a/src/main/java/org/dominokit/domino/ui/public/css/style.css +++ b/src/main/java/org/dominokit/domino/ui/public/css/style.css @@ -3219,10 +3219,6 @@ input[type=range] + .thumb.active .value { display: none; } -.switch[readonly] { - pointer-events: none; -} - .form-group { width: 100%; margin-bottom: 25px; @@ -3820,55 +3816,7 @@ fieldset[disabled] .form-control { } /* Tables ====================================== */ -.table tbody tr td, .table tbody tr th { - padding: 10px; - border-top: 1px solid #eee; - border-bottom: 1px solid #eee; -} - -.table tbody tr.primary td, .table tbody tr.primary th { - background-color: #1f91f3; - color: #fff; -} - -.table tbody tr.success td, .table tbody tr.success th { - background-color: #2b982b; - color: #fff; -} - -.table tbody tr.info td, .table tbody tr.info th { - background-color: #00b0e4; - color: #fff; -} - -.table tbody tr.warning td, .table tbody tr.warning th { - background-color: #ff9600; - color: #fff; -} -.table tbody tr.danger td, .table tbody tr.danger th { - background-color: #fb483a; - color: #fff; -} - -.table thead tr th { - padding: 10px; - border-bottom: 1px solid #eee; -} - -.table-bordered { - border-top: 1px solid #eee; -} - -.table-bordered tbody tr td, .table-bordered tbody tr th { - padding: 10px; - border: 1px solid #eee; -} - -.table-bordered thead tr th { - padding: 10px; - border: 1px solid #eee; -} /* Panel ======================================= */ @@ -6213,105 +6161,7 @@ a.list-group-item:not([class*="bg-"]):not([class*="-success"]):not([class*="-dan } /* Jquery DataTable ============================ */ -.dataTables_wrapper { - position: relative; -} - -.dataTables_wrapper select { - border: none; - border-bottom: 1px solid #ddd; - -webkit-border-radius: 0; - -moz-border-radius: 0; - -ms-border-radius: 0; - border-radius: 0; - -webkit-box-shadow: none; - -moz-box-shadow: none; - -ms-box-shadow: none; - box-shadow: none; -} - -.dataTables_wrapper select:active, .dataTables_wrapper select:focus { - -webkit-box-shadow: none; - -moz-box-shadow: none; - -ms-box-shadow: none; - box-shadow: none; -} - -.dataTables_wrapper input[type="search"] { - -webkit-border-radius: 0; - -moz-border-radius: 0; - -ms-border-radius: 0; - border-radius: 0; - -webkit-box-shadow: none; - -moz-box-shadow: none; - -ms-box-shadow: none; - box-shadow: none; - border: none; - font-size: 12px; - border-bottom: 1px solid #ddd; -} -.dataTables_wrapper input[type="search"]:focus, .dataTables_wrapper input[type="search"]:active { - border-bottom: 2px solid #1f91f3; -} - -.dataTables_wrapper .dt-buttons { - float: left; -} - -.dataTables_wrapper .dt-buttons a.dt-button { - background-color: #607D8B; - color: #fff; - padding: 7px 12px; - margin-right: 5px; - text-decoration: none; - box-shadow: 0 2px 5px rgba(0, 0, 0, 0.16), 0 2px 10px rgba(0, 0, 0, 0.12); - -webkit-border-radius: 2px; - -moz-border-radius: 2px; - -ms-border-radius: 2px; - border-radius: 2px; - border: none; - font-size: 13px; - outline: none; -} - -.dataTables_wrapper .dt-buttons a.dt-button:active { - opacity: 0.8; -} - -.dt-button-info { - position: fixed; - top: 50%; - left: 50%; - min-width: 400px; - text-align: center; - background-color: #fff; - border: 2px solid #999; - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - -ms-border-radius: 3px; - border-radius: 3px; - margin-top: -100px; - margin-left: -200px; - z-index: 21; -} - -.dt-button-info h2 { - color: #777; -} - -.dt-button-info div { - color: #777; - margin-bottom: 20px; -} - -.table-striped > tbody > tr:nth-of-type(odd):not([class*="details-tr"]):not([class*="bg-"]) { - background-color: #f9f9f9; -} - -.table-hover > tbody > tr:hover:not([class*="details-tr"]):not([class*="bg-"]) { - background-color: #f5f5f5; -} /* Light Gallery ================================ */ .lg-outer .lg-thumb-item, @@ -6845,92 +6695,6 @@ a.disabled { -webkit-touch-callout: none; /* Disable Android and iOS callouts*/ } -.table-cm-header:HOVER { - background-color: rgba(0, 0, 0, 0.04) !important; -} - -.table thead tr th.table-cm-filter { - padding: 5px; - font-weight: 300; -} - -.table-search-box { - background-color: #efefef; - border-radius: 3px; -} - -.table-search-box .form-line .form-control { - background-color: #efefef; - border-bottom: 0px; - box-shadow: none; -} - -.details-td { - max-width: 200px; -} - -.details-tr { - border-top: 1px double #c3c3c3; -} - -.table td .form-group { - margin-bottom: 0px; -} - -.table { - border-bottom: 1px solid #eee; - margin-bottom: 0px !important; -} - -.table .marker { - padding: 0px !important; - width: 3px !important; -} - -.table .table-checkbox:before { - margin-top: 4px !important; -} - -.tbody-fixed { - display: block; - overflow: auto; - /*border-bottom: 1px solid #eee;*/ -} - -.details-td { - max-width: 200px; -} - -.table .marker { - padding: 0px !important; - width: 3px !important; -} - -.table .table-checkbox:before { - margin-top: 4px !important; -} - -.table .select-checkbox { - margin: 0px; - height: 20px; -} - -.table .select-checkbox .checkbox { - margin: 0px; - height: 20px; -} - -.table .select-checkbox .form-control { - height: 20px; - padding: 0px; - background: transparent; -} - -.table .select-checkbox .form-control label { - height: 20px; - margin-bottom: 0px; -} - .material-icons { font-feature-settings: 'liga’; } diff --git a/src/main/java/org/dominokit/domino/ui/public/plugins/bootstrap/css/bootstrap.css b/src/main/java/org/dominokit/domino/ui/public/plugins/bootstrap/css/bootstrap.css index e7b3811eb..07bc68599 100644 --- a/src/main/java/org/dominokit/domino/ui/public/plugins/bootstrap/css/bootstrap.css +++ b/src/main/java/org/dominokit/domino/ui/public/plugins/bootstrap/css/bootstrap.css @@ -166,14 +166,6 @@ textarea { optgroup { font-weight: bold; } -table { - border-spacing: 0; - border-collapse: collapse; -} -td, -th { - padding: 0; -} /*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */ @media print { *, @@ -2383,240 +2375,7 @@ pre code { margin-left: 0; } } -table { - background-color: transparent; -} -caption { - padding-top: 8px; - padding-bottom: 8px; - color: #777; - text-align: left; -} -th { - text-align: left; -} -.table { - width: 100%; - max-width: 100%; - margin-bottom: 20px; -} -.table > thead > tr > th, -.table > tbody > tr > th, -.table > tfoot > tr > th, -.table > thead > tr > td, -.table > tbody > tr > td, -.table > tfoot > tr > td { - padding: 8px; - line-height: 1.42857143; - border-top: 1px solid #ddd; -} -.table > thead > tr > th { - vertical-align: bottom; - border-bottom: 2px solid #ddd; -} -.table > caption + thead > tr:first-child > th, -.table > colgroup + thead > tr:first-child > th, -.table > thead:first-child > tr:first-child > th, -.table > caption + thead > tr:first-child > td, -.table > colgroup + thead > tr:first-child > td, -.table > thead:first-child > tr:first-child > td { - border-top: 0; -} -.table > tbody + tbody { - border-top: 2px solid #ddd; -} -.table .table { - background-color: #fff; -} -.table-condensed > thead > tr > th, -.table-condensed > tbody > tr > th, -.table-condensed > tfoot > tr > th, -.table-condensed > thead > tr > td, -.table-condensed > tbody > tr > td, -.table-condensed > tfoot > tr > td { - padding: 5px !important; -} -.table-bordered { - border: 1px solid #ddd; -} -.table-bordered > thead > tr > th, -.table-bordered > tbody > tr > th, -.table-bordered > tfoot > tr > th, -.table-bordered > thead > tr > td, -.table-bordered > tbody > tr > td, -.table-bordered > tfoot > tr > td { - border: 1px solid #ddd; -} -.table-bordered > thead > tr > th, -.table-bordered > thead > tr > td { - border-bottom-width: 2px; -} -table col[class*="col-"] { - position: static; - display: table-column; - float: none; -} -table td[class*="col-"], -table th[class*="col-"] { - position: static; - display: table-cell; - float: none; -} -.table > thead > tr > td.active, -.table > tbody > tr > td.active, -.table > tfoot > tr > td.active, -.table > thead > tr > th.active, -.table > tbody > tr > th.active, -.table > tfoot > tr > th.active, -.table > thead > tr.active > td, -.table > tbody > tr.active > td, -.table > tfoot > tr.active > td, -.table > thead > tr.active > th, -.table > tbody > tr.active > th, -.table > tfoot > tr.active > th { - background-color: #f5f5f5; -} -.table-hover > tbody > tr > td.active:hover, -.table-hover > tbody > tr > th.active:hover, -.table-hover > tbody > tr.active:hover > td, -.table-hover > tbody > tr:hover > .active, -.table-hover > tbody > tr.active:hover > th { - background-color: #e8e8e8; -} -.table > thead > tr > td.success, -.table > tbody > tr > td.success, -.table > tfoot > tr > td.success, -.table > thead > tr > th.success, -.table > tbody > tr > th.success, -.table > tfoot > tr > th.success, -.table > thead > tr.success > td, -.table > tbody > tr.success > td, -.table > tfoot > tr.success > td, -.table > thead > tr.success > th, -.table > tbody > tr.success > th, -.table > tfoot > tr.success > th { - background-color: #dff0d8; -} -.table-hover > tbody > tr > td.success:hover, -.table-hover > tbody > tr > th.success:hover, -.table-hover > tbody > tr.success:hover > td, -.table-hover > tbody > tr:hover > .success, -.table-hover > tbody > tr.success:hover > th { - background-color: #d0e9c6; -} -.table > thead > tr > td.info, -.table > tbody > tr > td.info, -.table > tfoot > tr > td.info, -.table > thead > tr > th.info, -.table > tbody > tr > th.info, -.table > tfoot > tr > th.info, -.table > thead > tr.info > td, -.table > tbody > tr.info > td, -.table > tfoot > tr.info > td, -.table > thead > tr.info > th, -.table > tbody > tr.info > th, -.table > tfoot > tr.info > th { - background-color: #d9edf7; -} -.table-hover > tbody > tr > td.info:hover, -.table-hover > tbody > tr > th.info:hover, -.table-hover > tbody > tr.info:hover > td, -.table-hover > tbody > tr:hover > .info, -.table-hover > tbody > tr.info:hover > th { - background-color: #c4e3f3; -} -.table > thead > tr > td.warning, -.table > tbody > tr > td.warning, -.table > tfoot > tr > td.warning, -.table > thead > tr > th.warning, -.table > tbody > tr > th.warning, -.table > tfoot > tr > th.warning, -.table > thead > tr.warning > td, -.table > tbody > tr.warning > td, -.table > tfoot > tr.warning > td, -.table > thead > tr.warning > th, -.table > tbody > tr.warning > th, -.table > tfoot > tr.warning > th { - background-color: #fcf8e3; -} -.table-hover > tbody > tr > td.warning:hover, -.table-hover > tbody > tr > th.warning:hover, -.table-hover > tbody > tr.warning:hover > td, -.table-hover > tbody > tr:hover > .warning, -.table-hover > tbody > tr.warning:hover > th { - background-color: #faf2cc; -} -.table > thead > tr > td.danger, -.table > tbody > tr > td.danger, -.table > tfoot > tr > td.danger, -.table > thead > tr > th.danger, -.table > tbody > tr > th.danger, -.table > tfoot > tr > th.danger, -.table > thead > tr.danger > td, -.table > tbody > tr.danger > td, -.table > tfoot > tr.danger > td, -.table > thead > tr.danger > th, -.table > tbody > tr.danger > th, -.table > tfoot > tr.danger > th { - background-color: #f2dede; -} -.table-hover > tbody > tr > td.danger:hover, -.table-hover > tbody > tr > th.danger:hover, -.table-hover > tbody > tr.danger:hover > td, -.table-hover > tbody > tr:hover > .danger, -.table-hover > tbody > tr.danger:hover > th { - background-color: #ebcccc; -} -.table-responsive { - min-height: .01%; - overflow-x: auto; -} -@media screen and (max-width: 767px) { - .table-responsive { - width: 100%; - margin-bottom: 15px; - overflow-y: hidden; - -ms-overflow-style: -ms-autohiding-scrollbar; - border: 1px solid #ddd; - } - .table-responsive > .table { - margin-bottom: 0; - } - .table-responsive > .table > thead > tr > th, - .table-responsive > .table > tbody > tr > th, - .table-responsive > .table > tfoot > tr > th, - .table-responsive > .table > thead > tr > td, - .table-responsive > .table > tbody > tr > td, - .table-responsive > .table > tfoot > tr > td { - white-space: nowrap; - } - .table-responsive > .table-bordered { - border: 0; - } - .table-responsive > .table-bordered > thead > tr > th:first-child, - .table-responsive > .table-bordered > tbody > tr > th:first-child, - .table-responsive > .table-bordered > tfoot > tr > th:first-child, - .table-responsive > .table-bordered > thead > tr > td:first-child, - .table-responsive > .table-bordered > tbody > tr > td:first-child, - .table-responsive > .table-bordered > tfoot > tr > td:first-child { - border-left: 0; - } - .table-responsive > .table-bordered > thead > tr > th:last-child, - .table-responsive > .table-bordered > tbody > tr > th:last-child, - .table-responsive > .table-bordered > tfoot > tr > th:last-child, - .table-responsive > .table-bordered > thead > tr > td:last-child, - .table-responsive > .table-bordered > tbody > tr > td:last-child, - .table-responsive > .table-bordered > tfoot > tr > td:last-child { - border-right: 0; - } - .table-responsive > .table-bordered > tbody > tr:last-child > th, - .table-responsive > .table-bordered > tfoot > tr:last-child > th, - .table-responsive > .table-bordered > tbody > tr:last-child > td, - .table-responsive > .table-bordered > tfoot > tr:last-child > td { - border-bottom: 0; - } -} fieldset { min-width: 0; padding: 0;