@sankhyalabs/ezui 4.0.4 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/ez-grid.cjs.entry.js +131 -4
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/ez-grid/ez-grid.css +52 -7
- package/dist/collection/components/ez-grid/ez-grid.js +105 -5
- package/dist/collection/components/ez-grid/subcomponents/selection-counter.js +23 -0
- package/dist/custom-elements/index.js +132 -5
- package/dist/esm/ez-grid.entry.js +133 -6
- package/dist/esm/ezui.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/{p-dc15b6d1.entry.js → p-468799e1.entry.js} +2 -2
- package/dist/types/components/ez-grid/ez-grid.d.ts +16 -0
- package/dist/types/components/ez-grid/subcomponents/selection-counter.d.ts +12 -0
- package/package.json +1 -1
|
@@ -119624,7 +119624,37 @@ class AgGridController {
|
|
|
119624
119624
|
}
|
|
119625
119625
|
}
|
|
119626
119626
|
|
|
119627
|
-
const
|
|
119627
|
+
const SelectionCounter = (props) => {
|
|
119628
|
+
const { selectionCount, total, pageSize, onSelectAll, onSelectPage, onClearAll, onClose } = props;
|
|
119629
|
+
const pageSelectedRecords = selectionCount === pageSize;
|
|
119630
|
+
const allSelectedRecords = selectionCount === total;
|
|
119631
|
+
return (index.h("div", Object.assign({ class: "ez-box ez-box--shadow-small" }, getElementID("ezGridSelectionCounter")),
|
|
119632
|
+
index.h("div", { class: "ez-flex ez-flex--align-items-center ez-size-width--full ez-padding-horizontal--medium" },
|
|
119633
|
+
index.h("div", { class: "ez-flex ez-flex--wrap ez-flex--align-items-baseline ez-flex--justify-center" },
|
|
119634
|
+
index.h("label", Object.assign({ innerHTML: getText(selectionCount, allSelectedRecords), class: "ez-text ez-text--primary ez-text--medium ez-margin-right--medium ez-margin-top--medium" }, getElementID("ezGridSelectionCounter_label"))),
|
|
119635
|
+
index.h("div", { class: "ez-flex ez-margin-right--medium" },
|
|
119636
|
+
(pageSelectedRecords || allSelectedRecords) &&
|
|
119637
|
+
index.h("ez-button", Object.assign({ class: "ez-margin-right--medium", label: `Selecionar ${allSelectedRecords ? "apenas a página atual" : `todos os ${total} registros`}`, mode: "link", onClick: allSelectedRecords ? onSelectPage : onSelectAll }, getElementID(`ezGridSelectionCounter_select${allSelectedRecords ? "Page" : "All"}`))),
|
|
119638
|
+
index.h("ez-button", Object.assign({ class: "grid__btn-clear", label: "Limpar", mode: "link", onClick: onClearAll }, getElementID("ezGridSelectionCounter_clearAll"))))),
|
|
119639
|
+
index.h("button", Object.assign({ class: "grid__btn-close", title: "Fechar", onClick: onClose }, getElementID("ezGridSelectionCounter_close")),
|
|
119640
|
+
index.h("ez-icon", { iconName: "close" })))));
|
|
119641
|
+
};
|
|
119642
|
+
function getText(selectionCount, allSelectedRecords) {
|
|
119643
|
+
if (allSelectedRecords) {
|
|
119644
|
+
return `Todos os <strong>${selectionCount} registros</strong> da grade estão selecionados.`;
|
|
119645
|
+
}
|
|
119646
|
+
else {
|
|
119647
|
+
const pluralChar = selectionCount > 1 ? "s" : "";
|
|
119648
|
+
return `Há <strong>${selectionCount} registro${pluralChar}</strong> selecionado${pluralChar}.`;
|
|
119649
|
+
}
|
|
119650
|
+
}
|
|
119651
|
+
function getElementID(sufix) {
|
|
119652
|
+
return {
|
|
119653
|
+
[core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: core.ElementIDUtils.getInternalIDInfo(sufix)
|
|
119654
|
+
};
|
|
119655
|
+
}
|
|
119656
|
+
|
|
119657
|
+
const ezGridCss = ".sc-ez-grid-h{display:grid;grid-template-rows:auto 1fr auto;height:100%;width:100%;--ez-grid__header--background-color:var(--background--xlight, #FFF);--ez-grid__selection-counter--z-index:var(--more-visible, 2);--ez-grid__container--shadow:0 0 16px 0 rgb(0 38 111 / 12%)}.grid-header.sc-ez-grid{display:flex;justify-content:space-between;align-items:center;background-color:var(--ez-grid__header--background-color, #FFF);z-index:var(--visible)}.grid__container.sc-ez-grid{padding-top:15px;margin-top:-12px;box-shadow:var(--ez-grid__container--shadow);background-color:var(--ez-grid__header--background-color)}.grid-header__container.sc-ez-grid{display:flex;align-items:center}.grid__selection-counter.sc-ez-grid{position:fixed;white-space:nowrap;transform:translate(-50%, 0px);left:50%;opacity:0;bottom:-100%;transition:opacity 0.1s, bottom 0.5s;z-index:var(--ez-grid__selection-counter--z-index)}.grid__selection-counter--opened.sc-ez-grid{opacity:1;bottom:0px}.grid__btn-close.sc-ez-grid{display:flex;align-items:center;justify-content:center;padding:0;outline:none;width:20px;height:20px;border:none;background-color:unset;cursor:pointer}.grid__btn-clear.sc-ez-grid{--ez-button--link-color:var(--color--alert-warning-900, #8C6B00);--ez-button--link--hover-color:var(--color--alert-warning-900, #8C6B00)}";
|
|
119628
119658
|
|
|
119629
119659
|
const EzGrid = class {
|
|
119630
119660
|
constructor(hostRef) {
|
|
@@ -119634,8 +119664,11 @@ const EzGrid = class {
|
|
|
119634
119664
|
this.ezDoubleClick = index.createEvent(this, "ezDoubleClick", 7);
|
|
119635
119665
|
this.configChange = index.createEvent(this, "configChange", 7);
|
|
119636
119666
|
this._gridController = new AgGridController(false);
|
|
119667
|
+
this._debounceTimer = 500;
|
|
119637
119668
|
this._paginationInfo = undefined;
|
|
119638
119669
|
this._paginationChangedByKeyboard = true;
|
|
119670
|
+
this._selectionCount = 0;
|
|
119671
|
+
this._showSelectionCounter = false;
|
|
119639
119672
|
this.multipleSelection = undefined;
|
|
119640
119673
|
this.config = undefined;
|
|
119641
119674
|
this.serverUrl = undefined;
|
|
@@ -119691,9 +119724,54 @@ const EzGrid = class {
|
|
|
119691
119724
|
this._gridController.quickFilter(term);
|
|
119692
119725
|
}
|
|
119693
119726
|
onSelectionChange(evt) {
|
|
119694
|
-
|
|
119695
|
-
|
|
119727
|
+
var _a, _b, _c;
|
|
119728
|
+
(_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.setSelection((_c = (_b = evt === null || evt === void 0 ? void 0 : evt.detail) === null || _b === void 0 ? void 0 : _b.selection) === null || _c === void 0 ? void 0 : _c.map((r) => r.__record__id__));
|
|
119729
|
+
this.controlSelectionCount();
|
|
119730
|
+
}
|
|
119731
|
+
controlSelectionCount() {
|
|
119732
|
+
if (!this.multipleSelection || !this.isPaginationActived()) {
|
|
119733
|
+
this._showSelectionCounter = false;
|
|
119734
|
+
setTimeout(this.setSelectionCount.bind(this), this._debounceTimer);
|
|
119735
|
+
return;
|
|
119736
|
+
}
|
|
119737
|
+
this.getSelection()
|
|
119738
|
+
.then((records) => {
|
|
119739
|
+
var _a;
|
|
119740
|
+
const counter = (_a = records === null || records === void 0 ? void 0 : records.length) !== null && _a !== void 0 ? _a : 0;
|
|
119741
|
+
this._showSelectionCounter = counter > 1;
|
|
119742
|
+
if (this._showSelectionCounter) {
|
|
119743
|
+
this.setSelectionCount(counter);
|
|
119744
|
+
}
|
|
119745
|
+
else {
|
|
119746
|
+
setTimeout(this.setSelectionCount.bind(this, counter), this._debounceTimer);
|
|
119747
|
+
}
|
|
119748
|
+
});
|
|
119749
|
+
}
|
|
119750
|
+
setSelectionCount(value = 0) {
|
|
119751
|
+
this._selectionCount = value;
|
|
119752
|
+
}
|
|
119753
|
+
isPaginationActived() {
|
|
119754
|
+
var _a;
|
|
119755
|
+
const { total, lastRecord, firstRecord } = (_a = this._paginationInfo) !== null && _a !== void 0 ? _a : {};
|
|
119756
|
+
if (total == undefined || lastRecord == undefined || firstRecord == undefined) {
|
|
119757
|
+
return false;
|
|
119758
|
+
}
|
|
119759
|
+
return Math.ceil(total / (lastRecord - firstRecord + 1)) > 1;
|
|
119760
|
+
}
|
|
119761
|
+
onSelectAllRecords() {
|
|
119762
|
+
var _a;
|
|
119763
|
+
const { total } = (_a = this._paginationInfo) !== null && _a !== void 0 ? _a : {};
|
|
119764
|
+
if (total == undefined) {
|
|
119765
|
+
return;
|
|
119696
119766
|
}
|
|
119767
|
+
this._selectionCount = total;
|
|
119768
|
+
}
|
|
119769
|
+
onSelectPageRecords() {
|
|
119770
|
+
this.controlSelectionCount();
|
|
119771
|
+
}
|
|
119772
|
+
onClearSelectedRecords() {
|
|
119773
|
+
var _a;
|
|
119774
|
+
(_a = this._gridController) === null || _a === void 0 ? void 0 : _a.selectRows([]);
|
|
119697
119775
|
}
|
|
119698
119776
|
onColumnStateChange(type, state, info) {
|
|
119699
119777
|
var _a;
|
|
@@ -119758,6 +119836,48 @@ const EzGrid = class {
|
|
|
119758
119836
|
});
|
|
119759
119837
|
return newConfig;
|
|
119760
119838
|
}
|
|
119839
|
+
positionSelectionCounter() {
|
|
119840
|
+
var _a;
|
|
119841
|
+
if (this._gridSelectionCounter == undefined) {
|
|
119842
|
+
return;
|
|
119843
|
+
}
|
|
119844
|
+
if (this._showSelectionCounter) {
|
|
119845
|
+
const boundingContainer = (_a = this._container) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
119846
|
+
if (boundingContainer == undefined) {
|
|
119847
|
+
return;
|
|
119848
|
+
}
|
|
119849
|
+
const limitBottom = boundingContainer.bottom - 30;
|
|
119850
|
+
this._gridSelectionCounter.style.bottom = (document.body.clientHeight - limitBottom) + 'px';
|
|
119851
|
+
}
|
|
119852
|
+
else {
|
|
119853
|
+
this._gridSelectionCounter.style.bottom = "";
|
|
119854
|
+
}
|
|
119855
|
+
}
|
|
119856
|
+
setEvents() {
|
|
119857
|
+
window.removeEventListener("scroll", this.positionSelectionCounter.bind(this));
|
|
119858
|
+
window.addEventListener("scroll", this.positionSelectionCounter.bind(this));
|
|
119859
|
+
}
|
|
119860
|
+
resizeSelectionCounter() {
|
|
119861
|
+
if (this._gridSelectionCounter == undefined) {
|
|
119862
|
+
return;
|
|
119863
|
+
}
|
|
119864
|
+
this._gridSelectionCounter.style.width = "";
|
|
119865
|
+
if (this._gridSelectionCounter.clientHeight > 42) {
|
|
119866
|
+
this._gridSelectionCounter.style.width = "min-content";
|
|
119867
|
+
}
|
|
119868
|
+
this.positionSelectionCounter();
|
|
119869
|
+
}
|
|
119870
|
+
configSelectionCounter() {
|
|
119871
|
+
if (this._element == undefined) {
|
|
119872
|
+
return;
|
|
119873
|
+
}
|
|
119874
|
+
if (this._resizeObserver != undefined) {
|
|
119875
|
+
this._resizeObserver.unobserve(this._element);
|
|
119876
|
+
}
|
|
119877
|
+
this._resizeObserver = new ResizeObserver(core.JSUtils.debounce(this.resizeSelectionCounter.bind(this), 200));
|
|
119878
|
+
this._resizeObserver.observe(this._element);
|
|
119879
|
+
this.resizeSelectionCounter();
|
|
119880
|
+
}
|
|
119761
119881
|
componentDidLoad() {
|
|
119762
119882
|
this._gridController.initDatagrid(this._container, {
|
|
119763
119883
|
onColumnStateChange: (type, state, info) => this.onColumnStateChange(type, state, info),
|
|
@@ -119785,6 +119905,7 @@ const EzGrid = class {
|
|
|
119785
119905
|
this.observeConfig(this.config);
|
|
119786
119906
|
}
|
|
119787
119907
|
this.buildDataElementId();
|
|
119908
|
+
this.setEvents();
|
|
119788
119909
|
}
|
|
119789
119910
|
buildDataElementId() {
|
|
119790
119911
|
const dataInfo = { dataUnit: this.dataUnit };
|
|
@@ -119818,8 +119939,14 @@ const EzGrid = class {
|
|
|
119818
119939
|
observeConfig(config) {
|
|
119819
119940
|
this._gridController.setColumnsState(config.columns);
|
|
119820
119941
|
}
|
|
119942
|
+
componentWillRender() {
|
|
119943
|
+
this.configSelectionCounter();
|
|
119944
|
+
}
|
|
119821
119945
|
render() {
|
|
119822
|
-
|
|
119946
|
+
var _a, _b;
|
|
119947
|
+
return (index.h(index.Host, null, index.h("div", { class: "ez-box ez-box--shadow ez-padding--medium grid-header" }, index.h("div", { class: "grid-header__container" }, index.h("slot", { name: "leftButtons" })), index.h("div", { class: "grid-header__container", ref: ref => this._refPaginationControl = ref }, this.getPaginationControl())), index.h("div", { ref: (ref) => this._gridSelectionCounter = ref, class: `grid__selection-counter
|
|
119948
|
+
${this._showSelectionCounter ? "grid__selection-counter--opened" : ""}
|
|
119949
|
+
` }, index.h(SelectionCounter, { selectionCount: this._selectionCount, total: (_a = this._paginationInfo) === null || _a === void 0 ? void 0 : _a.total, pageSize: (_b = this.dataUnit) === null || _b === void 0 ? void 0 : _b.pageSize, onSelectAll: this.onSelectAllRecords.bind(this), onSelectPage: this.onSelectPageRecords.bind(this), onClearAll: this.onClearSelectedRecords.bind(this), onClose: () => this._showSelectionCounter = false })), index.h("div", { class: "grid__container ez-grid", ref: elem => this._container = elem }), index.h("div", { class: "grid__footer" })));
|
|
119823
119950
|
}
|
|
119824
119951
|
static get assetsDirs() { return ["../assets"]; }
|
|
119825
119952
|
get _element() { return index.getElement(this); }
|
package/dist/cjs/ezui.cjs.js
CHANGED
|
@@ -17,7 +17,7 @@ const patchBrowser = () => {
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
patchBrowser().then(options => {
|
|
20
|
-
return index.bootstrapLazy([["ez-actions-button.cjs",[[1,"ez-actions-button",{"enabled":[516],"actions":[1040],"size":[513],"showLabel":[516,"show-label"],"displayIcon":[513,"display-icon"],"checkOption":[516,"check-option"],"value":[513],"isTransparent":[516,"is-transparent"],"arrowActive":[516,"arrow-active"],"_selectedAction":[32],"hideActions":[64],"isOpened":[64]}]]],["ez-breadcrumb.cjs",[[1,"ez-breadcrumb",{"items":[1040],"fillMode":[1025,"fill-mode"],"maxItems":[1026,"max-items"],"positionEllipsis":[1026,"position-ellipsis"],"visibleItems":[32],"hiddenItems":[32],"showDropdown":[32],"collapseConfigPosition":[32]}]]],["ez-dialog.cjs",[[1,"ez-dialog",{"confirm":[1028],"dialogType":[1025,"dialog-type"],"message":[1025],"opened":[1540],"personalizedIconPath":[1025,"personalized-icon-path"],"ezTitle":[1025,"ez-title"],"show":[64]}]]],["ez-grid.cjs",[[6,"ez-grid",{"multipleSelection":[4,"multiple-selection"],"config":[1040],"serverUrl":[1,"server-url"],"dataUnit":[16],"statusResolver":[16],"_paginationInfo":[32],"_paginationChangedByKeyboard":[32],"setColumnsDef":[64],"addColumnMenuItem":[64],"setColumnsState":[64],"setData":[64],"getSelection":[64],"getColumnsState":[64],"getColumns":[64],"quickFilter":[64]},[[0,"ezSelectionChange","onSelectionChange"]]]]],["ez-modal-container.cjs",[[6,"ez-modal-container",{"modalTitle":[1,"modal-title"],"modalSubTitle":[1,"modal-sub-title"],"showTitleBar":[4,"show-title-bar"],"cancelButtonLabel":[1,"cancel-button-label"],"okButtonLabel":[1,"ok-button-label"],"cancelButtonStatus":[1,"cancel-button-status"],"okButtonStatus":[1,"ok-button-status"]}]]],["ez-alert.cjs",[[1,"ez-alert",{"alertType":[513,"alert-type"]}]]],["ez-chip.cjs",[[1,"ez-chip",{"label":[513],"enabled":[516],"removePosition":[513,"remove-position"],"mode":[513],"value":[1540],"setFocus":[64],"setBlur":[64]}]]],["ez-file-item.cjs",[[1,"ez-file-item",{"canRemove":[4,"can-remove"],"fileName":[1,"file-name"],"iconName":[1,"icon-name"],"fileSize":[2,"file-size"],"progress":[2]}]]],["ez-application.cjs",[[0,"ez-application"]]],["ez-card-item.cjs",[[1,"ez-card-item",{"item":[16]}]]],["ez-list.cjs",[[1,"ez-list",{"dataSource":[1040],"useGroups":[1540,"use-groups"],"ezDraggable":[1028,"ez-draggable"],"ezSelectable":[1028,"ez-selectable"],"itemSlotBuilder":[1040],"hoverFeedback":[1028,"hover-feedback"],"_listItems":[32],"_listGroupItems":[32],"clearHistory":[64],"scrollToTop":[64],"setSelection":[64],"getSelection":[64],"getList":[64]}]]],["ez-loading-bar.cjs",[[1,"ez-loading-bar",{"_showLoading":[32],"hide":[64],"show":[64]}]]],["ez-modal.cjs",[[1,"ez-modal",{"modalSize":[1,"modal-size"],"align":[1],"opened":[1028],"closeEsc":[4,"close-esc"],"closeOutsideClick":[4,"close-outside-click"]}]]],["ez-popover.cjs",[[1,"ez-popover",{"autoClose":[516,"auto-close"],"top":[1537],"left":[1537],"bottom":[1537],"right":[1537],"boxWidth":[513,"box-width"],"opened":[1540],"innerElement":[1537,"inner-element"],"overlayType":[513,"overlay-type"],"updatePosition":[64],"show":[64],"hide":[64]}]]],["ez-popup.cjs",[[1,"ez-popup",{"size":[1],"opened":[1540],"useHeader":[516,"use-header"],"heightMode":[513,"height-mode"],"ezTitle":[1,"ez-title"]}]]],["ez-radio-button.cjs",[[1,"ez-radio-button",{"value":[1544],"options":[1040],"enabled":[516],"label":[513],"direction":[1537]}]]],["ez-toast.cjs",[[1,"ez-toast",{"message":[1025],"fadeTime":[1026,"fade-time"],"useIcon":[1028,"use-icon"],"canClose":[1028,"can-close"],"show":[64]}]]],["ez-view-stack.cjs",[[0,"ez-view-stack",{"show":[64],"getSelectedIndex":[64]}]]],["ez-form-view.cjs",[[2,"ez-form-view",{"fields":[16],"showUp":[64]}]]],["ez-tabselector.cjs",[[1,"ez-tabselector",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1],"_processedTabs":[32]}]]],["ez-text-input.cjs",[[1,"ez-text-input",{"label":[513],"value":[1537],"enabled":[516],"errorMessage":[1537,"error-message"],"mask":[1],"canShowError":[516,"can-show-error"],"restrict":[1],"mode":[513],"noBorder":[516,"no-border"],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["ez-guide-navigator.cjs",[[1,"ez-guide-navigator",{"open":[1540],"selectedId":[1537,"selected-id"],"items":[16],"tooltipResolver":[16],"filterText":[32],"disableItem":[64],"enableItem":[64],"updateItem":[64],"getItem":[64],"getCurrentPath":[64],"selectGuide":[64],"getParent":[64]}]]],["ez-dropdown.cjs",[[1,"ez-dropdown",{"items":[1040],"value":[1040],"itemBuilder":[16]}]]],["ez-collapsible-box.cjs",[[1,"ez-collapsible-box",{"value":[1540],"label":[513],"headerSize":[513,"header-size"],"iconPlacement":[513,"icon-placement"],"headerAlign":[513,"header-align"],"removable":[516],"editable":[516],"conditionalSave":[16],"_activeEditText":[32],"showHide":[64],"applyFocusTextEdit":[64],"cancelEdition":[64]}]]],["ez-search.cjs",[[1,"ez-search",{"value":[1537],"label":[1537],"enabled":[1540],"errorMessage":[1537,"error-message"],"optionLoader":[16],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"suppressEmptyOption":[4,"suppress-empty-option"],"mode":[513],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["ez-date-input.cjs",[[1,"ez-date-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"mode":[513],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["ez-date-time-input.cjs",[[1,"ez-date-time-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"showSeconds":[516,"show-seconds"],"mode":[513],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["ez-time-input.cjs",[[1,"ez-time-input",{"label":[513],"value":[1026],"enabled":[516],"errorMessage":[1537,"error-message"],"showSeconds":[516,"show-seconds"],"mode":[513],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["ez-number-input.cjs",[[1,"ez-number-input",{"label":[1],"value":[1538],"enabled":[4],"errorMessage":[1537,"error-message"],"precision":[2],"prettyPrecision":[2,"pretty-precision"],"mode":[513],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["ez-check.cjs",[[1,"ez-check",{"label":[513],"value":[1540],"enabled":[1540],"indeterminate":[516],"mode":[513],"getMode":[64],"setFocus":[64]}]]],["ez-text-area.cjs",[[1,"ez-text-area",{"label":[513],"value":[1537],"enabled":[516],"errorMessage":[1537,"error-message"],"rows":[1538],"canShowError":[516,"can-show-error"],"mode":[513],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["ez-upload.cjs",[[1,"ez-upload",{"label":[1],"enabled":[4],"maxFileSize":[2,"max-file-size"],"maxFiles":[2,"max-files"],"requestHeaders":[8,"request-headers"],"urlUpload":[1,"url-upload"],"urlDelete":[1,"url-delete"],"value":[1040],"addFiles":[64],"setFocus":[64],"setBlur":[64]}]]],["ez-text-edit.cjs",[[1,"ez-text-edit",{"value":[1],"styled":[16],"_newValue":[32],"applyFocusSelect":[64]}]]],["ez-combo-box.cjs",[[1,"ez-combo-box",{"value":[1537],"label":[513],"enabled":[516],"options":[1040],"errorMessage":[1537,"error-message"],"searchMode":[4,"search-mode"],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"suppressSearch":[4,"suppress-search"],"optionLoader":[16],"suppressEmptyOption":[4,"suppress-empty-option"],"canShowError":[516,"can-show-error"],"mode":[513],"_preSelection":[32],"_visibleOptions":[32],"_startLoading":[32],"_showLoading":[32],"_criteria":[32],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["ez-filter-input_4.cjs",[[1,"ez-filter-input",{"label":[1],"value":[1537],"enabled":[4],"errorMessage":[1537,"error-message"],"restrict":[1],"mode":[513],"asyncSearch":[516,"async-search"],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"setValue":[64],"endSearch":[64]}],[1,"ez-tree",{"items":[1040],"value":[1040],"selectedId":[1537,"selected-id"],"iconResolver":[16],"tooltipResolver":[16],"_tree":[32],"_waintingForLoad":[32],"selectItem":[64],"openItem":[64],"disableItem":[64],"enableItem":[64],"addChild":[64],"applyFilter":[64],"updateItem":[64],"getItem":[64],"getCurrentPath":[64],"getParent":[64]},[[2,"keydown","onKeyDownListener"]]],[1,"ez-scroller",{"direction":[1],"locked":[4],"activeShadow":[4,"active-shadow"],"isActive":[32]},[[2,"click","clickListener"],[1,"mousedown","mouseDownHandler"],[1,"mouseup","mouseUpHandler"],[1,"mousemove","mouseMoveHandler"]]],[1,"ez-sidebar-button"]]],["ez-calendar.cjs",[[1,"ez-calendar",{"value":[1040],"floating":[516],"time":[516],"showSeconds":[516,"show-seconds"],"show":[64],"fitVertical":[64],"hide":[64]}]]],["ez-icon.cjs",[[1,"ez-icon",{"size":[513],"href":[513],"iconName":[513,"icon-name"]}]]],["ez-button.cjs",[[1,"ez-button",{"label":[513],"enabled":[516],"mode":[513],"image":[513],"iconName":[513,"icon-name"],"size":[513],"setFocus":[64],"setBlur":[64]},[[2,"click","clickListener"]]]]],["ez-form.cjs",[[2,"ez-form",{"dataUnit":[1040],"config":[16],"recordsValidator":[16],"validate":[64]}]]]], options);
|
|
20
|
+
return index.bootstrapLazy([["ez-actions-button.cjs",[[1,"ez-actions-button",{"enabled":[516],"actions":[1040],"size":[513],"showLabel":[516,"show-label"],"displayIcon":[513,"display-icon"],"checkOption":[516,"check-option"],"value":[513],"isTransparent":[516,"is-transparent"],"arrowActive":[516,"arrow-active"],"_selectedAction":[32],"hideActions":[64],"isOpened":[64]}]]],["ez-breadcrumb.cjs",[[1,"ez-breadcrumb",{"items":[1040],"fillMode":[1025,"fill-mode"],"maxItems":[1026,"max-items"],"positionEllipsis":[1026,"position-ellipsis"],"visibleItems":[32],"hiddenItems":[32],"showDropdown":[32],"collapseConfigPosition":[32]}]]],["ez-dialog.cjs",[[1,"ez-dialog",{"confirm":[1028],"dialogType":[1025,"dialog-type"],"message":[1025],"opened":[1540],"personalizedIconPath":[1025,"personalized-icon-path"],"ezTitle":[1025,"ez-title"],"show":[64]}]]],["ez-grid.cjs",[[6,"ez-grid",{"multipleSelection":[4,"multiple-selection"],"config":[1040],"serverUrl":[1,"server-url"],"dataUnit":[16],"statusResolver":[16],"_paginationInfo":[32],"_paginationChangedByKeyboard":[32],"_selectionCount":[32],"_showSelectionCounter":[32],"setColumnsDef":[64],"addColumnMenuItem":[64],"setColumnsState":[64],"setData":[64],"getSelection":[64],"getColumnsState":[64],"getColumns":[64],"quickFilter":[64]},[[0,"ezSelectionChange","onSelectionChange"]]]]],["ez-modal-container.cjs",[[6,"ez-modal-container",{"modalTitle":[1,"modal-title"],"modalSubTitle":[1,"modal-sub-title"],"showTitleBar":[4,"show-title-bar"],"cancelButtonLabel":[1,"cancel-button-label"],"okButtonLabel":[1,"ok-button-label"],"cancelButtonStatus":[1,"cancel-button-status"],"okButtonStatus":[1,"ok-button-status"]}]]],["ez-alert.cjs",[[1,"ez-alert",{"alertType":[513,"alert-type"]}]]],["ez-chip.cjs",[[1,"ez-chip",{"label":[513],"enabled":[516],"removePosition":[513,"remove-position"],"mode":[513],"value":[1540],"setFocus":[64],"setBlur":[64]}]]],["ez-file-item.cjs",[[1,"ez-file-item",{"canRemove":[4,"can-remove"],"fileName":[1,"file-name"],"iconName":[1,"icon-name"],"fileSize":[2,"file-size"],"progress":[2]}]]],["ez-application.cjs",[[0,"ez-application"]]],["ez-card-item.cjs",[[1,"ez-card-item",{"item":[16]}]]],["ez-list.cjs",[[1,"ez-list",{"dataSource":[1040],"useGroups":[1540,"use-groups"],"ezDraggable":[1028,"ez-draggable"],"ezSelectable":[1028,"ez-selectable"],"itemSlotBuilder":[1040],"hoverFeedback":[1028,"hover-feedback"],"_listItems":[32],"_listGroupItems":[32],"clearHistory":[64],"scrollToTop":[64],"setSelection":[64],"getSelection":[64],"getList":[64]}]]],["ez-loading-bar.cjs",[[1,"ez-loading-bar",{"_showLoading":[32],"hide":[64],"show":[64]}]]],["ez-modal.cjs",[[1,"ez-modal",{"modalSize":[1,"modal-size"],"align":[1],"opened":[1028],"closeEsc":[4,"close-esc"],"closeOutsideClick":[4,"close-outside-click"]}]]],["ez-popover.cjs",[[1,"ez-popover",{"autoClose":[516,"auto-close"],"top":[1537],"left":[1537],"bottom":[1537],"right":[1537],"boxWidth":[513,"box-width"],"opened":[1540],"innerElement":[1537,"inner-element"],"overlayType":[513,"overlay-type"],"updatePosition":[64],"show":[64],"hide":[64]}]]],["ez-popup.cjs",[[1,"ez-popup",{"size":[1],"opened":[1540],"useHeader":[516,"use-header"],"heightMode":[513,"height-mode"],"ezTitle":[1,"ez-title"]}]]],["ez-radio-button.cjs",[[1,"ez-radio-button",{"value":[1544],"options":[1040],"enabled":[516],"label":[513],"direction":[1537]}]]],["ez-toast.cjs",[[1,"ez-toast",{"message":[1025],"fadeTime":[1026,"fade-time"],"useIcon":[1028,"use-icon"],"canClose":[1028,"can-close"],"show":[64]}]]],["ez-view-stack.cjs",[[0,"ez-view-stack",{"show":[64],"getSelectedIndex":[64]}]]],["ez-form-view.cjs",[[2,"ez-form-view",{"fields":[16],"showUp":[64]}]]],["ez-tabselector.cjs",[[1,"ez-tabselector",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1],"_processedTabs":[32]}]]],["ez-text-input.cjs",[[1,"ez-text-input",{"label":[513],"value":[1537],"enabled":[516],"errorMessage":[1537,"error-message"],"mask":[1],"canShowError":[516,"can-show-error"],"restrict":[1],"mode":[513],"noBorder":[516,"no-border"],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["ez-guide-navigator.cjs",[[1,"ez-guide-navigator",{"open":[1540],"selectedId":[1537,"selected-id"],"items":[16],"tooltipResolver":[16],"filterText":[32],"disableItem":[64],"enableItem":[64],"updateItem":[64],"getItem":[64],"getCurrentPath":[64],"selectGuide":[64],"getParent":[64]}]]],["ez-dropdown.cjs",[[1,"ez-dropdown",{"items":[1040],"value":[1040],"itemBuilder":[16]}]]],["ez-collapsible-box.cjs",[[1,"ez-collapsible-box",{"value":[1540],"label":[513],"headerSize":[513,"header-size"],"iconPlacement":[513,"icon-placement"],"headerAlign":[513,"header-align"],"removable":[516],"editable":[516],"conditionalSave":[16],"_activeEditText":[32],"showHide":[64],"applyFocusTextEdit":[64],"cancelEdition":[64]}]]],["ez-search.cjs",[[1,"ez-search",{"value":[1537],"label":[1537],"enabled":[1540],"errorMessage":[1537,"error-message"],"optionLoader":[16],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"suppressEmptyOption":[4,"suppress-empty-option"],"mode":[513],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["ez-date-input.cjs",[[1,"ez-date-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"mode":[513],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["ez-date-time-input.cjs",[[1,"ez-date-time-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"showSeconds":[516,"show-seconds"],"mode":[513],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["ez-time-input.cjs",[[1,"ez-time-input",{"label":[513],"value":[1026],"enabled":[516],"errorMessage":[1537,"error-message"],"showSeconds":[516,"show-seconds"],"mode":[513],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["ez-number-input.cjs",[[1,"ez-number-input",{"label":[1],"value":[1538],"enabled":[4],"errorMessage":[1537,"error-message"],"precision":[2],"prettyPrecision":[2,"pretty-precision"],"mode":[513],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["ez-check.cjs",[[1,"ez-check",{"label":[513],"value":[1540],"enabled":[1540],"indeterminate":[516],"mode":[513],"getMode":[64],"setFocus":[64]}]]],["ez-text-area.cjs",[[1,"ez-text-area",{"label":[513],"value":[1537],"enabled":[516],"errorMessage":[1537,"error-message"],"rows":[1538],"canShowError":[516,"can-show-error"],"mode":[513],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["ez-upload.cjs",[[1,"ez-upload",{"label":[1],"enabled":[4],"maxFileSize":[2,"max-file-size"],"maxFiles":[2,"max-files"],"requestHeaders":[8,"request-headers"],"urlUpload":[1,"url-upload"],"urlDelete":[1,"url-delete"],"value":[1040],"addFiles":[64],"setFocus":[64],"setBlur":[64]}]]],["ez-text-edit.cjs",[[1,"ez-text-edit",{"value":[1],"styled":[16],"_newValue":[32],"applyFocusSelect":[64]}]]],["ez-combo-box.cjs",[[1,"ez-combo-box",{"value":[1537],"label":[513],"enabled":[516],"options":[1040],"errorMessage":[1537,"error-message"],"searchMode":[4,"search-mode"],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"suppressSearch":[4,"suppress-search"],"optionLoader":[16],"suppressEmptyOption":[4,"suppress-empty-option"],"canShowError":[516,"can-show-error"],"mode":[513],"_preSelection":[32],"_visibleOptions":[32],"_startLoading":[32],"_showLoading":[32],"_criteria":[32],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["ez-filter-input_4.cjs",[[1,"ez-filter-input",{"label":[1],"value":[1537],"enabled":[4],"errorMessage":[1537,"error-message"],"restrict":[1],"mode":[513],"asyncSearch":[516,"async-search"],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"setValue":[64],"endSearch":[64]}],[1,"ez-tree",{"items":[1040],"value":[1040],"selectedId":[1537,"selected-id"],"iconResolver":[16],"tooltipResolver":[16],"_tree":[32],"_waintingForLoad":[32],"selectItem":[64],"openItem":[64],"disableItem":[64],"enableItem":[64],"addChild":[64],"applyFilter":[64],"updateItem":[64],"getItem":[64],"getCurrentPath":[64],"getParent":[64]},[[2,"keydown","onKeyDownListener"]]],[1,"ez-scroller",{"direction":[1],"locked":[4],"activeShadow":[4,"active-shadow"],"isActive":[32]},[[2,"click","clickListener"],[1,"mousedown","mouseDownHandler"],[1,"mouseup","mouseUpHandler"],[1,"mousemove","mouseMoveHandler"]]],[1,"ez-sidebar-button"]]],["ez-calendar.cjs",[[1,"ez-calendar",{"value":[1040],"floating":[516],"time":[516],"showSeconds":[516,"show-seconds"],"show":[64],"fitVertical":[64],"hide":[64]}]]],["ez-icon.cjs",[[1,"ez-icon",{"size":[513],"href":[513],"iconName":[513,"icon-name"]}]]],["ez-button.cjs",[[1,"ez-button",{"label":[513],"enabled":[516],"mode":[513],"image":[513],"iconName":[513,"icon-name"],"size":[513],"setFocus":[64],"setBlur":[64]},[[2,"click","clickListener"]]]]],["ez-form.cjs",[[2,"ez-form",{"dataUnit":[1040],"config":[16],"recordsValidator":[16],"validate":[64]}]]]], options);
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
exports.setNonce = index.setNonce;
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -14,7 +14,7 @@ const patchEsm = () => {
|
|
|
14
14
|
const defineCustomElements = (win, options) => {
|
|
15
15
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
16
|
return patchEsm().then(() => {
|
|
17
|
-
return index.bootstrapLazy([["ez-actions-button.cjs",[[1,"ez-actions-button",{"enabled":[516],"actions":[1040],"size":[513],"showLabel":[516,"show-label"],"displayIcon":[513,"display-icon"],"checkOption":[516,"check-option"],"value":[513],"isTransparent":[516,"is-transparent"],"arrowActive":[516,"arrow-active"],"_selectedAction":[32],"hideActions":[64],"isOpened":[64]}]]],["ez-breadcrumb.cjs",[[1,"ez-breadcrumb",{"items":[1040],"fillMode":[1025,"fill-mode"],"maxItems":[1026,"max-items"],"positionEllipsis":[1026,"position-ellipsis"],"visibleItems":[32],"hiddenItems":[32],"showDropdown":[32],"collapseConfigPosition":[32]}]]],["ez-dialog.cjs",[[1,"ez-dialog",{"confirm":[1028],"dialogType":[1025,"dialog-type"],"message":[1025],"opened":[1540],"personalizedIconPath":[1025,"personalized-icon-path"],"ezTitle":[1025,"ez-title"],"show":[64]}]]],["ez-grid.cjs",[[6,"ez-grid",{"multipleSelection":[4,"multiple-selection"],"config":[1040],"serverUrl":[1,"server-url"],"dataUnit":[16],"statusResolver":[16],"_paginationInfo":[32],"_paginationChangedByKeyboard":[32],"setColumnsDef":[64],"addColumnMenuItem":[64],"setColumnsState":[64],"setData":[64],"getSelection":[64],"getColumnsState":[64],"getColumns":[64],"quickFilter":[64]},[[0,"ezSelectionChange","onSelectionChange"]]]]],["ez-modal-container.cjs",[[6,"ez-modal-container",{"modalTitle":[1,"modal-title"],"modalSubTitle":[1,"modal-sub-title"],"showTitleBar":[4,"show-title-bar"],"cancelButtonLabel":[1,"cancel-button-label"],"okButtonLabel":[1,"ok-button-label"],"cancelButtonStatus":[1,"cancel-button-status"],"okButtonStatus":[1,"ok-button-status"]}]]],["ez-alert.cjs",[[1,"ez-alert",{"alertType":[513,"alert-type"]}]]],["ez-chip.cjs",[[1,"ez-chip",{"label":[513],"enabled":[516],"removePosition":[513,"remove-position"],"mode":[513],"value":[1540],"setFocus":[64],"setBlur":[64]}]]],["ez-file-item.cjs",[[1,"ez-file-item",{"canRemove":[4,"can-remove"],"fileName":[1,"file-name"],"iconName":[1,"icon-name"],"fileSize":[2,"file-size"],"progress":[2]}]]],["ez-application.cjs",[[0,"ez-application"]]],["ez-card-item.cjs",[[1,"ez-card-item",{"item":[16]}]]],["ez-list.cjs",[[1,"ez-list",{"dataSource":[1040],"useGroups":[1540,"use-groups"],"ezDraggable":[1028,"ez-draggable"],"ezSelectable":[1028,"ez-selectable"],"itemSlotBuilder":[1040],"hoverFeedback":[1028,"hover-feedback"],"_listItems":[32],"_listGroupItems":[32],"clearHistory":[64],"scrollToTop":[64],"setSelection":[64],"getSelection":[64],"getList":[64]}]]],["ez-loading-bar.cjs",[[1,"ez-loading-bar",{"_showLoading":[32],"hide":[64],"show":[64]}]]],["ez-modal.cjs",[[1,"ez-modal",{"modalSize":[1,"modal-size"],"align":[1],"opened":[1028],"closeEsc":[4,"close-esc"],"closeOutsideClick":[4,"close-outside-click"]}]]],["ez-popover.cjs",[[1,"ez-popover",{"autoClose":[516,"auto-close"],"top":[1537],"left":[1537],"bottom":[1537],"right":[1537],"boxWidth":[513,"box-width"],"opened":[1540],"innerElement":[1537,"inner-element"],"overlayType":[513,"overlay-type"],"updatePosition":[64],"show":[64],"hide":[64]}]]],["ez-popup.cjs",[[1,"ez-popup",{"size":[1],"opened":[1540],"useHeader":[516,"use-header"],"heightMode":[513,"height-mode"],"ezTitle":[1,"ez-title"]}]]],["ez-radio-button.cjs",[[1,"ez-radio-button",{"value":[1544],"options":[1040],"enabled":[516],"label":[513],"direction":[1537]}]]],["ez-toast.cjs",[[1,"ez-toast",{"message":[1025],"fadeTime":[1026,"fade-time"],"useIcon":[1028,"use-icon"],"canClose":[1028,"can-close"],"show":[64]}]]],["ez-view-stack.cjs",[[0,"ez-view-stack",{"show":[64],"getSelectedIndex":[64]}]]],["ez-form-view.cjs",[[2,"ez-form-view",{"fields":[16],"showUp":[64]}]]],["ez-tabselector.cjs",[[1,"ez-tabselector",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1],"_processedTabs":[32]}]]],["ez-text-input.cjs",[[1,"ez-text-input",{"label":[513],"value":[1537],"enabled":[516],"errorMessage":[1537,"error-message"],"mask":[1],"canShowError":[516,"can-show-error"],"restrict":[1],"mode":[513],"noBorder":[516,"no-border"],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["ez-guide-navigator.cjs",[[1,"ez-guide-navigator",{"open":[1540],"selectedId":[1537,"selected-id"],"items":[16],"tooltipResolver":[16],"filterText":[32],"disableItem":[64],"enableItem":[64],"updateItem":[64],"getItem":[64],"getCurrentPath":[64],"selectGuide":[64],"getParent":[64]}]]],["ez-dropdown.cjs",[[1,"ez-dropdown",{"items":[1040],"value":[1040],"itemBuilder":[16]}]]],["ez-collapsible-box.cjs",[[1,"ez-collapsible-box",{"value":[1540],"label":[513],"headerSize":[513,"header-size"],"iconPlacement":[513,"icon-placement"],"headerAlign":[513,"header-align"],"removable":[516],"editable":[516],"conditionalSave":[16],"_activeEditText":[32],"showHide":[64],"applyFocusTextEdit":[64],"cancelEdition":[64]}]]],["ez-search.cjs",[[1,"ez-search",{"value":[1537],"label":[1537],"enabled":[1540],"errorMessage":[1537,"error-message"],"optionLoader":[16],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"suppressEmptyOption":[4,"suppress-empty-option"],"mode":[513],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["ez-date-input.cjs",[[1,"ez-date-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"mode":[513],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["ez-date-time-input.cjs",[[1,"ez-date-time-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"showSeconds":[516,"show-seconds"],"mode":[513],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["ez-time-input.cjs",[[1,"ez-time-input",{"label":[513],"value":[1026],"enabled":[516],"errorMessage":[1537,"error-message"],"showSeconds":[516,"show-seconds"],"mode":[513],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["ez-number-input.cjs",[[1,"ez-number-input",{"label":[1],"value":[1538],"enabled":[4],"errorMessage":[1537,"error-message"],"precision":[2],"prettyPrecision":[2,"pretty-precision"],"mode":[513],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["ez-check.cjs",[[1,"ez-check",{"label":[513],"value":[1540],"enabled":[1540],"indeterminate":[516],"mode":[513],"getMode":[64],"setFocus":[64]}]]],["ez-text-area.cjs",[[1,"ez-text-area",{"label":[513],"value":[1537],"enabled":[516],"errorMessage":[1537,"error-message"],"rows":[1538],"canShowError":[516,"can-show-error"],"mode":[513],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["ez-upload.cjs",[[1,"ez-upload",{"label":[1],"enabled":[4],"maxFileSize":[2,"max-file-size"],"maxFiles":[2,"max-files"],"requestHeaders":[8,"request-headers"],"urlUpload":[1,"url-upload"],"urlDelete":[1,"url-delete"],"value":[1040],"addFiles":[64],"setFocus":[64],"setBlur":[64]}]]],["ez-text-edit.cjs",[[1,"ez-text-edit",{"value":[1],"styled":[16],"_newValue":[32],"applyFocusSelect":[64]}]]],["ez-combo-box.cjs",[[1,"ez-combo-box",{"value":[1537],"label":[513],"enabled":[516],"options":[1040],"errorMessage":[1537,"error-message"],"searchMode":[4,"search-mode"],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"suppressSearch":[4,"suppress-search"],"optionLoader":[16],"suppressEmptyOption":[4,"suppress-empty-option"],"canShowError":[516,"can-show-error"],"mode":[513],"_preSelection":[32],"_visibleOptions":[32],"_startLoading":[32],"_showLoading":[32],"_criteria":[32],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["ez-filter-input_4.cjs",[[1,"ez-filter-input",{"label":[1],"value":[1537],"enabled":[4],"errorMessage":[1537,"error-message"],"restrict":[1],"mode":[513],"asyncSearch":[516,"async-search"],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"setValue":[64],"endSearch":[64]}],[1,"ez-tree",{"items":[1040],"value":[1040],"selectedId":[1537,"selected-id"],"iconResolver":[16],"tooltipResolver":[16],"_tree":[32],"_waintingForLoad":[32],"selectItem":[64],"openItem":[64],"disableItem":[64],"enableItem":[64],"addChild":[64],"applyFilter":[64],"updateItem":[64],"getItem":[64],"getCurrentPath":[64],"getParent":[64]},[[2,"keydown","onKeyDownListener"]]],[1,"ez-scroller",{"direction":[1],"locked":[4],"activeShadow":[4,"active-shadow"],"isActive":[32]},[[2,"click","clickListener"],[1,"mousedown","mouseDownHandler"],[1,"mouseup","mouseUpHandler"],[1,"mousemove","mouseMoveHandler"]]],[1,"ez-sidebar-button"]]],["ez-calendar.cjs",[[1,"ez-calendar",{"value":[1040],"floating":[516],"time":[516],"showSeconds":[516,"show-seconds"],"show":[64],"fitVertical":[64],"hide":[64]}]]],["ez-icon.cjs",[[1,"ez-icon",{"size":[513],"href":[513],"iconName":[513,"icon-name"]}]]],["ez-button.cjs",[[1,"ez-button",{"label":[513],"enabled":[516],"mode":[513],"image":[513],"iconName":[513,"icon-name"],"size":[513],"setFocus":[64],"setBlur":[64]},[[2,"click","clickListener"]]]]],["ez-form.cjs",[[2,"ez-form",{"dataUnit":[1040],"config":[16],"recordsValidator":[16],"validate":[64]}]]]], options);
|
|
17
|
+
return index.bootstrapLazy([["ez-actions-button.cjs",[[1,"ez-actions-button",{"enabled":[516],"actions":[1040],"size":[513],"showLabel":[516,"show-label"],"displayIcon":[513,"display-icon"],"checkOption":[516,"check-option"],"value":[513],"isTransparent":[516,"is-transparent"],"arrowActive":[516,"arrow-active"],"_selectedAction":[32],"hideActions":[64],"isOpened":[64]}]]],["ez-breadcrumb.cjs",[[1,"ez-breadcrumb",{"items":[1040],"fillMode":[1025,"fill-mode"],"maxItems":[1026,"max-items"],"positionEllipsis":[1026,"position-ellipsis"],"visibleItems":[32],"hiddenItems":[32],"showDropdown":[32],"collapseConfigPosition":[32]}]]],["ez-dialog.cjs",[[1,"ez-dialog",{"confirm":[1028],"dialogType":[1025,"dialog-type"],"message":[1025],"opened":[1540],"personalizedIconPath":[1025,"personalized-icon-path"],"ezTitle":[1025,"ez-title"],"show":[64]}]]],["ez-grid.cjs",[[6,"ez-grid",{"multipleSelection":[4,"multiple-selection"],"config":[1040],"serverUrl":[1,"server-url"],"dataUnit":[16],"statusResolver":[16],"_paginationInfo":[32],"_paginationChangedByKeyboard":[32],"_selectionCount":[32],"_showSelectionCounter":[32],"setColumnsDef":[64],"addColumnMenuItem":[64],"setColumnsState":[64],"setData":[64],"getSelection":[64],"getColumnsState":[64],"getColumns":[64],"quickFilter":[64]},[[0,"ezSelectionChange","onSelectionChange"]]]]],["ez-modal-container.cjs",[[6,"ez-modal-container",{"modalTitle":[1,"modal-title"],"modalSubTitle":[1,"modal-sub-title"],"showTitleBar":[4,"show-title-bar"],"cancelButtonLabel":[1,"cancel-button-label"],"okButtonLabel":[1,"ok-button-label"],"cancelButtonStatus":[1,"cancel-button-status"],"okButtonStatus":[1,"ok-button-status"]}]]],["ez-alert.cjs",[[1,"ez-alert",{"alertType":[513,"alert-type"]}]]],["ez-chip.cjs",[[1,"ez-chip",{"label":[513],"enabled":[516],"removePosition":[513,"remove-position"],"mode":[513],"value":[1540],"setFocus":[64],"setBlur":[64]}]]],["ez-file-item.cjs",[[1,"ez-file-item",{"canRemove":[4,"can-remove"],"fileName":[1,"file-name"],"iconName":[1,"icon-name"],"fileSize":[2,"file-size"],"progress":[2]}]]],["ez-application.cjs",[[0,"ez-application"]]],["ez-card-item.cjs",[[1,"ez-card-item",{"item":[16]}]]],["ez-list.cjs",[[1,"ez-list",{"dataSource":[1040],"useGroups":[1540,"use-groups"],"ezDraggable":[1028,"ez-draggable"],"ezSelectable":[1028,"ez-selectable"],"itemSlotBuilder":[1040],"hoverFeedback":[1028,"hover-feedback"],"_listItems":[32],"_listGroupItems":[32],"clearHistory":[64],"scrollToTop":[64],"setSelection":[64],"getSelection":[64],"getList":[64]}]]],["ez-loading-bar.cjs",[[1,"ez-loading-bar",{"_showLoading":[32],"hide":[64],"show":[64]}]]],["ez-modal.cjs",[[1,"ez-modal",{"modalSize":[1,"modal-size"],"align":[1],"opened":[1028],"closeEsc":[4,"close-esc"],"closeOutsideClick":[4,"close-outside-click"]}]]],["ez-popover.cjs",[[1,"ez-popover",{"autoClose":[516,"auto-close"],"top":[1537],"left":[1537],"bottom":[1537],"right":[1537],"boxWidth":[513,"box-width"],"opened":[1540],"innerElement":[1537,"inner-element"],"overlayType":[513,"overlay-type"],"updatePosition":[64],"show":[64],"hide":[64]}]]],["ez-popup.cjs",[[1,"ez-popup",{"size":[1],"opened":[1540],"useHeader":[516,"use-header"],"heightMode":[513,"height-mode"],"ezTitle":[1,"ez-title"]}]]],["ez-radio-button.cjs",[[1,"ez-radio-button",{"value":[1544],"options":[1040],"enabled":[516],"label":[513],"direction":[1537]}]]],["ez-toast.cjs",[[1,"ez-toast",{"message":[1025],"fadeTime":[1026,"fade-time"],"useIcon":[1028,"use-icon"],"canClose":[1028,"can-close"],"show":[64]}]]],["ez-view-stack.cjs",[[0,"ez-view-stack",{"show":[64],"getSelectedIndex":[64]}]]],["ez-form-view.cjs",[[2,"ez-form-view",{"fields":[16],"showUp":[64]}]]],["ez-tabselector.cjs",[[1,"ez-tabselector",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1],"_processedTabs":[32]}]]],["ez-text-input.cjs",[[1,"ez-text-input",{"label":[513],"value":[1537],"enabled":[516],"errorMessage":[1537,"error-message"],"mask":[1],"canShowError":[516,"can-show-error"],"restrict":[1],"mode":[513],"noBorder":[516,"no-border"],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["ez-guide-navigator.cjs",[[1,"ez-guide-navigator",{"open":[1540],"selectedId":[1537,"selected-id"],"items":[16],"tooltipResolver":[16],"filterText":[32],"disableItem":[64],"enableItem":[64],"updateItem":[64],"getItem":[64],"getCurrentPath":[64],"selectGuide":[64],"getParent":[64]}]]],["ez-dropdown.cjs",[[1,"ez-dropdown",{"items":[1040],"value":[1040],"itemBuilder":[16]}]]],["ez-collapsible-box.cjs",[[1,"ez-collapsible-box",{"value":[1540],"label":[513],"headerSize":[513,"header-size"],"iconPlacement":[513,"icon-placement"],"headerAlign":[513,"header-align"],"removable":[516],"editable":[516],"conditionalSave":[16],"_activeEditText":[32],"showHide":[64],"applyFocusTextEdit":[64],"cancelEdition":[64]}]]],["ez-search.cjs",[[1,"ez-search",{"value":[1537],"label":[1537],"enabled":[1540],"errorMessage":[1537,"error-message"],"optionLoader":[16],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"suppressEmptyOption":[4,"suppress-empty-option"],"mode":[513],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["ez-date-input.cjs",[[1,"ez-date-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"mode":[513],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["ez-date-time-input.cjs",[[1,"ez-date-time-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"showSeconds":[516,"show-seconds"],"mode":[513],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["ez-time-input.cjs",[[1,"ez-time-input",{"label":[513],"value":[1026],"enabled":[516],"errorMessage":[1537,"error-message"],"showSeconds":[516,"show-seconds"],"mode":[513],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["ez-number-input.cjs",[[1,"ez-number-input",{"label":[1],"value":[1538],"enabled":[4],"errorMessage":[1537,"error-message"],"precision":[2],"prettyPrecision":[2,"pretty-precision"],"mode":[513],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["ez-check.cjs",[[1,"ez-check",{"label":[513],"value":[1540],"enabled":[1540],"indeterminate":[516],"mode":[513],"getMode":[64],"setFocus":[64]}]]],["ez-text-area.cjs",[[1,"ez-text-area",{"label":[513],"value":[1537],"enabled":[516],"errorMessage":[1537,"error-message"],"rows":[1538],"canShowError":[516,"can-show-error"],"mode":[513],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["ez-upload.cjs",[[1,"ez-upload",{"label":[1],"enabled":[4],"maxFileSize":[2,"max-file-size"],"maxFiles":[2,"max-files"],"requestHeaders":[8,"request-headers"],"urlUpload":[1,"url-upload"],"urlDelete":[1,"url-delete"],"value":[1040],"addFiles":[64],"setFocus":[64],"setBlur":[64]}]]],["ez-text-edit.cjs",[[1,"ez-text-edit",{"value":[1],"styled":[16],"_newValue":[32],"applyFocusSelect":[64]}]]],["ez-combo-box.cjs",[[1,"ez-combo-box",{"value":[1537],"label":[513],"enabled":[516],"options":[1040],"errorMessage":[1537,"error-message"],"searchMode":[4,"search-mode"],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"suppressSearch":[4,"suppress-search"],"optionLoader":[16],"suppressEmptyOption":[4,"suppress-empty-option"],"canShowError":[516,"can-show-error"],"mode":[513],"_preSelection":[32],"_visibleOptions":[32],"_startLoading":[32],"_showLoading":[32],"_criteria":[32],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["ez-filter-input_4.cjs",[[1,"ez-filter-input",{"label":[1],"value":[1537],"enabled":[4],"errorMessage":[1537,"error-message"],"restrict":[1],"mode":[513],"asyncSearch":[516,"async-search"],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"setValue":[64],"endSearch":[64]}],[1,"ez-tree",{"items":[1040],"value":[1040],"selectedId":[1537,"selected-id"],"iconResolver":[16],"tooltipResolver":[16],"_tree":[32],"_waintingForLoad":[32],"selectItem":[64],"openItem":[64],"disableItem":[64],"enableItem":[64],"addChild":[64],"applyFilter":[64],"updateItem":[64],"getItem":[64],"getCurrentPath":[64],"getParent":[64]},[[2,"keydown","onKeyDownListener"]]],[1,"ez-scroller",{"direction":[1],"locked":[4],"activeShadow":[4,"active-shadow"],"isActive":[32]},[[2,"click","clickListener"],[1,"mousedown","mouseDownHandler"],[1,"mouseup","mouseUpHandler"],[1,"mousemove","mouseMoveHandler"]]],[1,"ez-sidebar-button"]]],["ez-calendar.cjs",[[1,"ez-calendar",{"value":[1040],"floating":[516],"time":[516],"showSeconds":[516,"show-seconds"],"show":[64],"fitVertical":[64],"hide":[64]}]]],["ez-icon.cjs",[[1,"ez-icon",{"size":[513],"href":[513],"iconName":[513,"icon-name"]}]]],["ez-button.cjs",[[1,"ez-button",{"label":[513],"enabled":[516],"mode":[513],"image":[513],"iconName":[513,"icon-name"],"size":[513],"setFocus":[64],"setBlur":[64]},[[2,"click","clickListener"]]]]],["ez-form.cjs",[[2,"ez-form",{"dataUnit":[1040],"config":[16],"recordsValidator":[16],"validate":[64]}]]]], options);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
:host {
|
|
2
|
+
/*private*/
|
|
2
3
|
display: grid;
|
|
3
4
|
grid-template-rows: auto 1fr auto;
|
|
4
5
|
height: 100%;
|
|
@@ -6,9 +7,11 @@
|
|
|
6
7
|
|
|
7
8
|
/*public*/
|
|
8
9
|
/*@doc Define a cor de fundo do header do componente.*/
|
|
9
|
-
--
|
|
10
|
+
--ez-grid__header--background-color: var(--background--xlight, #FFF);
|
|
11
|
+
/*@doc Define o z-index do componente selection counter.*/
|
|
12
|
+
--ez-grid__selection-counter--z-index: var(--more-visible, 2);
|
|
10
13
|
/*@doc Define o sombreamento usado como borda.*/
|
|
11
|
-
--
|
|
14
|
+
--ez-grid__container--shadow: 0 0 16px 0 rgb(0 38 111 / 12%);
|
|
12
15
|
}
|
|
13
16
|
|
|
14
17
|
.grid-header {
|
|
@@ -18,20 +21,62 @@
|
|
|
18
21
|
align-items: center;
|
|
19
22
|
|
|
20
23
|
/*public*/
|
|
21
|
-
background-color: var(--
|
|
24
|
+
background-color: var(--ez-grid__header--background-color, #FFF);
|
|
22
25
|
z-index: var(--visible);
|
|
23
26
|
}
|
|
24
27
|
|
|
25
|
-
.grid__container{
|
|
26
|
-
|
|
28
|
+
.grid__container {
|
|
29
|
+
/*private*/
|
|
27
30
|
padding-top: 15px;
|
|
28
31
|
margin-top: -12px;
|
|
29
32
|
|
|
30
33
|
/*public*/
|
|
31
|
-
|
|
34
|
+
box-shadow: var(--ez-grid__container--shadow);
|
|
35
|
+
background-color: var(--ez-grid__header--background-color);
|
|
32
36
|
}
|
|
33
37
|
|
|
34
|
-
.grid-header__container{
|
|
38
|
+
.grid-header__container {
|
|
39
|
+
/*private*/
|
|
35
40
|
display: flex;
|
|
36
41
|
align-items: center;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.grid__selection-counter {
|
|
45
|
+
/*private*/
|
|
46
|
+
position: fixed;
|
|
47
|
+
white-space: nowrap;
|
|
48
|
+
transform: translate(-50%, 0px);
|
|
49
|
+
left: 50%;
|
|
50
|
+
opacity: 0;
|
|
51
|
+
bottom: -100%;
|
|
52
|
+
transition: opacity 0.1s, bottom 0.5s;
|
|
53
|
+
|
|
54
|
+
/*public*/
|
|
55
|
+
z-index: var(--ez-grid__selection-counter--z-index);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.grid__selection-counter--opened {
|
|
59
|
+
/*private*/
|
|
60
|
+
opacity: 1;
|
|
61
|
+
bottom: 0px;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.grid__btn-close {
|
|
65
|
+
/*private*/
|
|
66
|
+
display: flex;
|
|
67
|
+
align-items: center;
|
|
68
|
+
justify-content: center;
|
|
69
|
+
padding: 0;
|
|
70
|
+
outline: none;
|
|
71
|
+
width: 20px;
|
|
72
|
+
height: 20px;
|
|
73
|
+
border: none;
|
|
74
|
+
background-color: unset;
|
|
75
|
+
cursor: pointer;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.grid__btn-clear {
|
|
79
|
+
/*public*/
|
|
80
|
+
--ez-button--link-color: var(--color--alert-warning-900, #8C6B00);
|
|
81
|
+
--ez-button--link--hover-color: var(--color--alert-warning-900, #8C6B00);
|
|
37
82
|
}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import { ElementIDUtils } from "@sankhyalabs/core";
|
|
1
|
+
import { ElementIDUtils, JSUtils } from "@sankhyalabs/core";
|
|
2
2
|
import { h, Host } from "@stencil/core";
|
|
3
3
|
import AgGridController from "./controller/ag-grid/AgGridController";
|
|
4
|
+
import { SelectionCounter } from "./subcomponents/selection-counter";
|
|
4
5
|
export class EzGrid {
|
|
5
6
|
constructor() {
|
|
6
7
|
this._gridController = new AgGridController(false);
|
|
8
|
+
this._debounceTimer = 500;
|
|
7
9
|
this._paginationInfo = undefined;
|
|
8
10
|
this._paginationChangedByKeyboard = true;
|
|
11
|
+
this._selectionCount = 0;
|
|
12
|
+
this._showSelectionCounter = false;
|
|
9
13
|
this.multipleSelection = undefined;
|
|
10
14
|
this.config = undefined;
|
|
11
15
|
this.serverUrl = undefined;
|
|
@@ -61,9 +65,54 @@ export class EzGrid {
|
|
|
61
65
|
this._gridController.quickFilter(term);
|
|
62
66
|
}
|
|
63
67
|
onSelectionChange(evt) {
|
|
64
|
-
|
|
65
|
-
|
|
68
|
+
var _a, _b, _c;
|
|
69
|
+
(_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.setSelection((_c = (_b = evt === null || evt === void 0 ? void 0 : evt.detail) === null || _b === void 0 ? void 0 : _b.selection) === null || _c === void 0 ? void 0 : _c.map((r) => r.__record__id__));
|
|
70
|
+
this.controlSelectionCount();
|
|
71
|
+
}
|
|
72
|
+
controlSelectionCount() {
|
|
73
|
+
if (!this.multipleSelection || !this.isPaginationActived()) {
|
|
74
|
+
this._showSelectionCounter = false;
|
|
75
|
+
setTimeout(this.setSelectionCount.bind(this), this._debounceTimer);
|
|
76
|
+
return;
|
|
66
77
|
}
|
|
78
|
+
this.getSelection()
|
|
79
|
+
.then((records) => {
|
|
80
|
+
var _a;
|
|
81
|
+
const counter = (_a = records === null || records === void 0 ? void 0 : records.length) !== null && _a !== void 0 ? _a : 0;
|
|
82
|
+
this._showSelectionCounter = counter > 1;
|
|
83
|
+
if (this._showSelectionCounter) {
|
|
84
|
+
this.setSelectionCount(counter);
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
setTimeout(this.setSelectionCount.bind(this, counter), this._debounceTimer);
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
setSelectionCount(value = 0) {
|
|
92
|
+
this._selectionCount = value;
|
|
93
|
+
}
|
|
94
|
+
isPaginationActived() {
|
|
95
|
+
var _a;
|
|
96
|
+
const { total, lastRecord, firstRecord } = (_a = this._paginationInfo) !== null && _a !== void 0 ? _a : {};
|
|
97
|
+
if (total == undefined || lastRecord == undefined || firstRecord == undefined) {
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
100
|
+
return Math.ceil(total / (lastRecord - firstRecord + 1)) > 1;
|
|
101
|
+
}
|
|
102
|
+
onSelectAllRecords() {
|
|
103
|
+
var _a;
|
|
104
|
+
const { total } = (_a = this._paginationInfo) !== null && _a !== void 0 ? _a : {};
|
|
105
|
+
if (total == undefined) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
this._selectionCount = total;
|
|
109
|
+
}
|
|
110
|
+
onSelectPageRecords() {
|
|
111
|
+
this.controlSelectionCount();
|
|
112
|
+
}
|
|
113
|
+
onClearSelectedRecords() {
|
|
114
|
+
var _a;
|
|
115
|
+
(_a = this._gridController) === null || _a === void 0 ? void 0 : _a.selectRows([]);
|
|
67
116
|
}
|
|
68
117
|
onColumnStateChange(type, state, info) {
|
|
69
118
|
var _a;
|
|
@@ -128,6 +177,48 @@ export class EzGrid {
|
|
|
128
177
|
});
|
|
129
178
|
return newConfig;
|
|
130
179
|
}
|
|
180
|
+
positionSelectionCounter() {
|
|
181
|
+
var _a;
|
|
182
|
+
if (this._gridSelectionCounter == undefined) {
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
if (this._showSelectionCounter) {
|
|
186
|
+
const boundingContainer = (_a = this._container) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
187
|
+
if (boundingContainer == undefined) {
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
const limitBottom = boundingContainer.bottom - 30;
|
|
191
|
+
this._gridSelectionCounter.style.bottom = (document.body.clientHeight - limitBottom) + 'px';
|
|
192
|
+
}
|
|
193
|
+
else {
|
|
194
|
+
this._gridSelectionCounter.style.bottom = "";
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
setEvents() {
|
|
198
|
+
window.removeEventListener("scroll", this.positionSelectionCounter.bind(this));
|
|
199
|
+
window.addEventListener("scroll", this.positionSelectionCounter.bind(this));
|
|
200
|
+
}
|
|
201
|
+
resizeSelectionCounter() {
|
|
202
|
+
if (this._gridSelectionCounter == undefined) {
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
this._gridSelectionCounter.style.width = "";
|
|
206
|
+
if (this._gridSelectionCounter.clientHeight > 42) {
|
|
207
|
+
this._gridSelectionCounter.style.width = "min-content";
|
|
208
|
+
}
|
|
209
|
+
this.positionSelectionCounter();
|
|
210
|
+
}
|
|
211
|
+
configSelectionCounter() {
|
|
212
|
+
if (this._element == undefined) {
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
if (this._resizeObserver != undefined) {
|
|
216
|
+
this._resizeObserver.unobserve(this._element);
|
|
217
|
+
}
|
|
218
|
+
this._resizeObserver = new ResizeObserver(JSUtils.debounce(this.resizeSelectionCounter.bind(this), 200));
|
|
219
|
+
this._resizeObserver.observe(this._element);
|
|
220
|
+
this.resizeSelectionCounter();
|
|
221
|
+
}
|
|
131
222
|
componentDidLoad() {
|
|
132
223
|
this._gridController.initDatagrid(this._container, {
|
|
133
224
|
onColumnStateChange: (type, state, info) => this.onColumnStateChange(type, state, info),
|
|
@@ -155,6 +246,7 @@ export class EzGrid {
|
|
|
155
246
|
this.observeConfig(this.config);
|
|
156
247
|
}
|
|
157
248
|
this.buildDataElementId();
|
|
249
|
+
this.setEvents();
|
|
158
250
|
}
|
|
159
251
|
buildDataElementId() {
|
|
160
252
|
const dataInfo = { dataUnit: this.dataUnit };
|
|
@@ -188,8 +280,14 @@ export class EzGrid {
|
|
|
188
280
|
observeConfig(config) {
|
|
189
281
|
this._gridController.setColumnsState(config.columns);
|
|
190
282
|
}
|
|
283
|
+
componentWillRender() {
|
|
284
|
+
this.configSelectionCounter();
|
|
285
|
+
}
|
|
191
286
|
render() {
|
|
192
|
-
|
|
287
|
+
var _a, _b;
|
|
288
|
+
return (h(Host, null, h("div", { class: "ez-box ez-box--shadow ez-padding--medium grid-header" }, h("div", { class: "grid-header__container" }, h("slot", { name: "leftButtons" })), h("div", { class: "grid-header__container", ref: ref => this._refPaginationControl = ref }, this.getPaginationControl())), h("div", { ref: (ref) => this._gridSelectionCounter = ref, class: `grid__selection-counter
|
|
289
|
+
${this._showSelectionCounter ? "grid__selection-counter--opened" : ""}
|
|
290
|
+
` }, h(SelectionCounter, { selectionCount: this._selectionCount, total: (_a = this._paginationInfo) === null || _a === void 0 ? void 0 : _a.total, pageSize: (_b = this.dataUnit) === null || _b === void 0 ? void 0 : _b.pageSize, onSelectAll: this.onSelectAllRecords.bind(this), onSelectPage: this.onSelectPageRecords.bind(this), onClearAll: this.onClearSelectedRecords.bind(this), onClose: () => this._showSelectionCounter = false })), h("div", { class: "grid__container ez-grid", ref: elem => this._container = elem }), h("div", { class: "grid__footer" })));
|
|
193
291
|
}
|
|
194
292
|
static get is() { return "ez-grid"; }
|
|
195
293
|
static get encapsulation() { return "scoped"; }
|
|
@@ -305,7 +403,9 @@ export class EzGrid {
|
|
|
305
403
|
static get states() {
|
|
306
404
|
return {
|
|
307
405
|
"_paginationInfo": {},
|
|
308
|
-
"_paginationChangedByKeyboard": {}
|
|
406
|
+
"_paginationChangedByKeyboard": {},
|
|
407
|
+
"_selectionCount": {},
|
|
408
|
+
"_showSelectionCounter": {}
|
|
309
409
|
};
|
|
310
410
|
}
|
|
311
411
|
static get events() {
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ElementIDUtils } from "@sankhyalabs/core";
|
|
2
|
+
import { h } from "@stencil/core";
|
|
3
|
+
export const SelectionCounter = (props) => {
|
|
4
|
+
const { selectionCount, total, pageSize, onSelectAll, onSelectPage, onClearAll, onClose } = props;
|
|
5
|
+
const pageSelectedRecords = selectionCount === pageSize;
|
|
6
|
+
const allSelectedRecords = selectionCount === total;
|
|
7
|
+
return (h("div", Object.assign({ class: "ez-box ez-box--shadow-small" }, getElementID("ezGridSelectionCounter")), h("div", { class: "ez-flex ez-flex--align-items-center ez-size-width--full ez-padding-horizontal--medium" }, h("div", { class: "ez-flex ez-flex--wrap ez-flex--align-items-baseline ez-flex--justify-center" }, h("label", Object.assign({ innerHTML: getText(selectionCount, allSelectedRecords), class: "ez-text ez-text--primary ez-text--medium ez-margin-right--medium ez-margin-top--medium" }, getElementID("ezGridSelectionCounter_label"))), h("div", { class: "ez-flex ez-margin-right--medium" }, (pageSelectedRecords || allSelectedRecords) &&
|
|
8
|
+
h("ez-button", Object.assign({ class: "ez-margin-right--medium", label: `Selecionar ${allSelectedRecords ? "apenas a página atual" : `todos os ${total} registros`}`, mode: "link", onClick: allSelectedRecords ? onSelectPage : onSelectAll }, getElementID(`ezGridSelectionCounter_select${allSelectedRecords ? "Page" : "All"}`))), h("ez-button", Object.assign({ class: "grid__btn-clear", label: "Limpar", mode: "link", onClick: onClearAll }, getElementID("ezGridSelectionCounter_clearAll"))))), h("button", Object.assign({ class: "grid__btn-close", title: "Fechar", onClick: onClose }, getElementID("ezGridSelectionCounter_close")), h("ez-icon", { iconName: "close" })))));
|
|
9
|
+
};
|
|
10
|
+
function getText(selectionCount, allSelectedRecords) {
|
|
11
|
+
if (allSelectedRecords) {
|
|
12
|
+
return `Todos os <strong>${selectionCount} registros</strong> da grade estão selecionados.`;
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
const pluralChar = selectionCount > 1 ? "s" : "";
|
|
16
|
+
return `Há <strong>${selectionCount} registro${pluralChar}</strong> selecionado${pluralChar}.`;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
function getElementID(sufix) {
|
|
20
|
+
return {
|
|
21
|
+
[ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: ElementIDUtils.getInternalIDInfo(sufix)
|
|
22
|
+
};
|
|
23
|
+
}
|