@sankhyalabs/ezui 4.6.0 → 4.7.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/{constants-5d588e38.js → constants-5a75e2f3.js} +0 -2
- package/dist/cjs/ez-combo-box.cjs.entry.js +1 -1
- package/dist/cjs/ez-form-view.cjs.entry.js +1 -1
- package/dist/cjs/ez-form.cjs.entry.js +0 -1
- package/dist/cjs/ez-grid.cjs.entry.js +112 -213
- package/dist/cjs/ez-modal.cjs.entry.js +5 -2
- package/dist/cjs/ez-upload.cjs.entry.js +4 -2
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +86 -84
- package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js +5 -16
- package/dist/collection/components/ez-grid/ez-grid.js +21 -110
- package/dist/collection/components/ez-grid/subcomponents/selection-counter.js +3 -5
- package/dist/collection/components/ez-modal/ez-modal.css +4 -2
- package/dist/collection/components/ez-modal/ez-modal.js +26 -1
- package/dist/collection/components/ez-upload/ez-upload.css +14 -1
- package/dist/collection/components/ez-upload/ez-upload.js +20 -1
- package/dist/collection/utils/form/DataBinder.js +0 -1
- package/dist/custom-elements/index.js +124 -221
- package/dist/esm/constants-ca136201.js +3 -0
- package/dist/esm/ez-combo-box.entry.js +1 -1
- package/dist/esm/ez-form-view.entry.js +1 -1
- package/dist/esm/ez-form.entry.js +0 -1
- package/dist/esm/ez-grid.entry.js +112 -213
- package/dist/esm/ez-modal.entry.js +5 -2
- package/dist/esm/ez-upload.entry.js +4 -2
- 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-03164b9f.entry.js +1 -0
- package/dist/ezui/p-22f4210d.entry.js +1 -0
- package/dist/ezui/p-3f4ae3a3.js +1 -0
- package/dist/ezui/{p-878646a0.entry.js → p-50883460.entry.js} +1 -1
- package/dist/ezui/{p-ef705232.entry.js → p-8654802d.entry.js} +2 -2
- package/dist/ezui/{p-b7ea9791.entry.js → p-e748b5d3.entry.js} +1 -1
- package/dist/ezui/p-f1dc3514.entry.js +1 -0
- package/dist/types/components/ez-grid/controller/EzGridController.d.ts +6 -10
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +3 -5
- package/dist/types/components/ez-grid/controller/ag-grid/DataSource.d.ts +0 -1
- package/dist/types/components/ez-grid/ez-grid.d.ts +2 -9
- package/dist/types/components/ez-grid/subcomponents/selection-counter.d.ts +2 -2
- package/dist/types/components/ez-modal/ez-modal.d.ts +9 -0
- package/dist/types/components/ez-upload/ez-upload.d.ts +4 -0
- package/dist/types/components.d.ts +16 -0
- package/package.json +1 -1
- package/dist/collection/components/ez-grid/controller/DataUnitBridge.js +0 -73
- package/dist/esm/constants-76d2e931.js +0 -4
- package/dist/ezui/p-1f841f3c.entry.js +0 -1
- package/dist/ezui/p-622c2d53.entry.js +0 -1
- package/dist/ezui/p-b01e3085.js +0 -1
- package/dist/ezui/p-eceb9382.entry.js +0 -1
- package/dist/types/components/ez-grid/controller/DataUnitBridge.d.ts +0 -11
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-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-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],"_showSelectionCounter":[32],"
|
|
20
|
+
return index.bootstrapLazy([["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-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],"_showSelectionCounter":[32],"_isAllSelection":[32],"_currentPageSelected":[32],"_selectionCount":[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-badge.cjs",[[1,"ez-badge",{"size":[513],"label":[513],"iconLeft":[513,"icon-left"],"iconRight":[513,"icon-right"],"position":[1040],"hasSlot":[32]}]]],["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],"heightMode":[1,"height-mode"],"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-dropdown.cjs",[[1,"ez-dropdown",{"items":[1040],"value":[1040],"itemBuilder":[16]}]]],["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-collapsible-box.cjs",[[1,"ez-collapsible-box",{"value":[1540],"label":[513],"subtitle":[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":[1540],"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],"subtitle":[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"],"canShowError":[516,"can-show-error"],"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-view.cjs",[[2,"ez-form-view",{"fields":[16],"showUp":[64]}]]],["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-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-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],"_showSelectionCounter":[32],"
|
|
17
|
+
return index.bootstrapLazy([["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-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],"_showSelectionCounter":[32],"_isAllSelection":[32],"_currentPageSelected":[32],"_selectionCount":[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-badge.cjs",[[1,"ez-badge",{"size":[513],"label":[513],"iconLeft":[513,"icon-left"],"iconRight":[513,"icon-right"],"position":[1040],"hasSlot":[32]}]]],["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],"heightMode":[1,"height-mode"],"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-dropdown.cjs",[[1,"ez-dropdown",{"items":[1040],"value":[1040],"itemBuilder":[16]}]]],["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-collapsible-box.cjs",[[1,"ez-collapsible-box",{"value":[1540],"label":[513],"subtitle":[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":[1540],"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],"subtitle":[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"],"canShowError":[516,"can-show-error"],"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-view.cjs",[[2,"ez-form-view",{"fields":[16],"showUp":[64]}]]],["ez-form.cjs",[[2,"ez-form",{"dataUnit":[1040],"config":[16],"recordsValidator":[16],"validate":[64]}]]]], options);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -6,7 +6,6 @@ import getHeaderColumnTemplate from "./template/HeaderColumnTemplate.js";
|
|
|
6
6
|
import DataSource from "./DataSource";
|
|
7
7
|
import { CellRenderer } from "./components/cellRenderer";
|
|
8
8
|
import SelectionHeader from "./components/selectionHeader";
|
|
9
|
-
import { ALL_RECORD } from "../../../../utils/constants";
|
|
10
9
|
export default class AgGridController {
|
|
11
10
|
constructor(enterprise) {
|
|
12
11
|
this.DEFAULT_ROW_HEIGHT = 30;
|
|
@@ -88,9 +87,12 @@ export default class AgGridController {
|
|
|
88
87
|
else {
|
|
89
88
|
this._grid = new Grid(container, this._gridOptions);
|
|
90
89
|
}
|
|
91
|
-
const selection = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.
|
|
92
|
-
if (selection) {
|
|
93
|
-
this.
|
|
90
|
+
const selection = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getSelectionInfo();
|
|
91
|
+
if (selection === null || selection === void 0 ? void 0 : selection.isAllRecords()) {
|
|
92
|
+
this.selectAll(true);
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
this.selectRows((selection === null || selection === void 0 ? void 0 : selection.recordIds) || [], true);
|
|
94
96
|
}
|
|
95
97
|
this._gridOptions.api.setHeaderHeight(this.getHeaderRowHeight());
|
|
96
98
|
}
|
|
@@ -154,7 +156,7 @@ export default class AgGridController {
|
|
|
154
156
|
opt.onColumnPinned = e => this.onCallStateChange("columnPinned", e);
|
|
155
157
|
opt.onColumnMoved = e => this.onCallStateChange("columnMoved", e);
|
|
156
158
|
opt.onColumnVisible = e => this.onCallStateChange("visibleChange", e);
|
|
157
|
-
opt.onSelectionChanged =
|
|
159
|
+
opt.onSelectionChanged = e => this.onSelectionChange(e);
|
|
158
160
|
opt.onRowDoubleClicked = evt => this.onRowDoubleClick(evt);
|
|
159
161
|
opt.onDragStopped = evt => this.onCallStateChange("columnMovedEnd", evt);
|
|
160
162
|
}
|
|
@@ -162,72 +164,31 @@ export default class AgGridController {
|
|
|
162
164
|
opt.suppressDragLeaveHidesColumns = true;
|
|
163
165
|
opt.suppressMenuHide = true;
|
|
164
166
|
}
|
|
165
|
-
isAllRecordSetted(allSelection) {
|
|
166
|
-
return allSelection === null || allSelection === void 0 ? void 0 : allSelection.some((selectedRecord) => {
|
|
167
|
-
return selectedRecord.__record__id__ === ALL_RECORD;
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
167
|
getSelectionHeaderStatus() {
|
|
171
168
|
const records = this._dataUnit.records;
|
|
172
169
|
if (records && records.length === 0) {
|
|
173
170
|
return false;
|
|
174
171
|
}
|
|
175
|
-
const
|
|
176
|
-
if (
|
|
177
|
-
return false;
|
|
178
|
-
}
|
|
179
|
-
if (this.isAllRecordSetted(allSelection)) {
|
|
172
|
+
const selectionInfo = this._dataUnit.getSelectionInfo();
|
|
173
|
+
if (selectionInfo.isAllRecords()) {
|
|
180
174
|
return true;
|
|
181
175
|
}
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
const selectedRecords = this._dataUnit.getSelectedRecords();
|
|
186
|
-
if (selectedRecords.length < allSelection.length) {
|
|
187
|
-
return undefined;
|
|
176
|
+
const selection = selectionInfo.recordIds;
|
|
177
|
+
if (selection == undefined || selection.length === 0) {
|
|
178
|
+
return false;
|
|
188
179
|
}
|
|
189
180
|
let status = undefined;
|
|
190
181
|
for (let i = 0; i < records.length; i++) {
|
|
191
|
-
const current =
|
|
192
|
-
return selectedRecord.__record__id__ === records[i].__record__id__;
|
|
193
|
-
});
|
|
182
|
+
const current = selection.includes(records[i].__record__id__);
|
|
194
183
|
if (status != undefined && current !== status) {
|
|
195
|
-
return;
|
|
184
|
+
return undefined;
|
|
196
185
|
}
|
|
197
186
|
status = current;
|
|
198
187
|
}
|
|
199
188
|
return status;
|
|
200
189
|
}
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
return;
|
|
204
|
-
}
|
|
205
|
-
let allSelection = this._dataUnit.getSelection();
|
|
206
|
-
if (allSelection === null || allSelection === void 0 ? void 0 : allSelection.some((sel) => sel.__record__id__ === ALL_RECORD)) {
|
|
207
|
-
await this._dataUnit.clearSelection();
|
|
208
|
-
}
|
|
209
|
-
let updateSelection = [];
|
|
210
|
-
const records = this._dataUnit.records;
|
|
211
|
-
const selectedRecords = this._dataUnit.getSelectedRecords();
|
|
212
|
-
allSelection = this._dataUnit.getSelection();
|
|
213
|
-
if (selectAll && selectedRecords.length < records.length) {
|
|
214
|
-
updateSelection = records;
|
|
215
|
-
allSelection.forEach((selectedRecord) => {
|
|
216
|
-
const recordIds = updateSelection.map((record) => record.__record__id__);
|
|
217
|
-
if (!recordIds.includes(selectedRecord.__record__id__)) {
|
|
218
|
-
updateSelection.push(selectedRecord);
|
|
219
|
-
}
|
|
220
|
-
});
|
|
221
|
-
}
|
|
222
|
-
else {
|
|
223
|
-
updateSelection = allSelection.filter((selectedRecord) => {
|
|
224
|
-
return !(records || [])
|
|
225
|
-
.some((record) => {
|
|
226
|
-
return record.__record__id__ === selectedRecord.__record__id__;
|
|
227
|
-
});
|
|
228
|
-
});
|
|
229
|
-
}
|
|
230
|
-
this._dataUnit.setSelection(updateSelection);
|
|
190
|
+
updateSelectionForAll(selectAll) {
|
|
191
|
+
this._dataUnit.updatePageSelection(selectAll ? this._dataUnit.records.map(r => r.__record__id__) : []);
|
|
231
192
|
}
|
|
232
193
|
setData(data) {
|
|
233
194
|
if (this._grid === undefined) {
|
|
@@ -245,21 +206,55 @@ export default class AgGridController {
|
|
|
245
206
|
throw new Error("Erro interno: Grid ainda não inicializado.");
|
|
246
207
|
}
|
|
247
208
|
}
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
209
|
+
selectAll(quietly = false) {
|
|
210
|
+
try {
|
|
211
|
+
this._gridOptions.context.selectionChangeQuietly = quietly;
|
|
212
|
+
this._gridOptions.api.forEachNode(node => {
|
|
213
|
+
if (!node.isSelected()) {
|
|
214
|
+
node.setSelected(true);
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
finally {
|
|
219
|
+
const newContext = Object.assign({}, this._gridOptions.context);
|
|
220
|
+
delete newContext.selectionChangeQuietly;
|
|
221
|
+
this._gridOptions.context = newContext;
|
|
251
222
|
}
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
223
|
+
}
|
|
224
|
+
selectRows(rowIds, quietly = false) {
|
|
225
|
+
var _a;
|
|
226
|
+
try {
|
|
227
|
+
this._gridOptions.context.selectionChangeQuietly = quietly;
|
|
228
|
+
if (this._grid === undefined) {
|
|
229
|
+
throw new Error("Erro interno: Grid ainda não inicializado.");
|
|
257
230
|
}
|
|
258
|
-
|
|
259
|
-
|
|
231
|
+
let lastSelected;
|
|
232
|
+
this._gridOptions.api.forEachNode(node => {
|
|
233
|
+
if (rowIds && rowIds.includes(node.id)) {
|
|
234
|
+
if (!node.isSelected()) {
|
|
235
|
+
node.setSelected(true);
|
|
236
|
+
lastSelected = node;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
else {
|
|
240
|
+
if (node.isSelected()) {
|
|
241
|
+
node.setSelected(false);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
});
|
|
245
|
+
const selectionHeader = this._gridOptions.context.selectionHeader;
|
|
246
|
+
if (selectionHeader) {
|
|
247
|
+
selectionHeader.updateCheckbox();
|
|
260
248
|
}
|
|
261
|
-
|
|
262
|
-
|
|
249
|
+
if (lastSelected) {
|
|
250
|
+
(_a = this._gridOptions.api) === null || _a === void 0 ? void 0 : _a.ensureNodeVisible(lastSelected);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
finally {
|
|
254
|
+
const newContext = Object.assign({}, this._gridOptions.context);
|
|
255
|
+
delete newContext.selectionChangeQuietly;
|
|
256
|
+
this._gridOptions.context = newContext;
|
|
257
|
+
}
|
|
263
258
|
}
|
|
264
259
|
removeRows() {
|
|
265
260
|
if (this._grid === undefined) {
|
|
@@ -442,19 +437,6 @@ export default class AgGridController {
|
|
|
442
437
|
var _a;
|
|
443
438
|
(_a = this._gridOptions.api.getDisplayedRowAtIndex(index)) === null || _a === void 0 ? void 0 : _a.setSelected(true);
|
|
444
439
|
}
|
|
445
|
-
deselectAll() {
|
|
446
|
-
var _a, _b;
|
|
447
|
-
(_b = (_a = this._gridOptions) === null || _a === void 0 ? void 0 : _a.api) === null || _b === void 0 ? void 0 : _b.deselectAll();
|
|
448
|
-
this.updateCheckbox();
|
|
449
|
-
}
|
|
450
|
-
updateCheckbox() {
|
|
451
|
-
var _a, _b;
|
|
452
|
-
const selectionHeader = (_b = (_a = this._gridOptions) === null || _a === void 0 ? void 0 : _a.context) === null || _b === void 0 ? void 0 : _b.selectionHeader;
|
|
453
|
-
if (selectionHeader == undefined) {
|
|
454
|
-
return;
|
|
455
|
-
}
|
|
456
|
-
selectionHeader.updateCheckbox();
|
|
457
|
-
}
|
|
458
440
|
buildColDef(source) {
|
|
459
441
|
var _a, _b, _c;
|
|
460
442
|
let tooltip = undefined;
|
|
@@ -575,13 +557,33 @@ export default class AgGridController {
|
|
|
575
557
|
}
|
|
576
558
|
return false;
|
|
577
559
|
}
|
|
578
|
-
onSelectionChange() {
|
|
560
|
+
onSelectionChange(event) {
|
|
579
561
|
if (this._selectionChangeCallback) {
|
|
580
562
|
clearTimeout(this._selectionChangeDeboucing);
|
|
581
563
|
this._selectionChangeDeboucing = window.setTimeout(() => {
|
|
582
|
-
this.
|
|
583
|
-
|
|
584
|
-
|
|
564
|
+
if (this._dataUnit) {
|
|
565
|
+
if (event.context.selectionChangeQuietly) {
|
|
566
|
+
const selectionInfo = this._dataUnit;
|
|
567
|
+
this._selectionChangeCallback({
|
|
568
|
+
selection: selectionInfo.records,
|
|
569
|
+
selectionHeaderStatus: this.getSelectionHeaderStatus()
|
|
570
|
+
});
|
|
571
|
+
}
|
|
572
|
+
else {
|
|
573
|
+
this._dataUnit.updatePageSelection(this._gridOptions.api.getSelectedRows().map((r) => r.__record__id__)).then(selectionInfo => {
|
|
574
|
+
this._selectionChangeCallback({
|
|
575
|
+
selection: selectionInfo.records,
|
|
576
|
+
selectionHeaderStatus: this.getSelectionHeaderStatus()
|
|
577
|
+
});
|
|
578
|
+
});
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
else {
|
|
582
|
+
this._selectionChangeCallback({
|
|
583
|
+
selection: this._gridOptions.api.getSelectedRows(),
|
|
584
|
+
selectionHeaderStatus: this.getSelectionHeaderStatus()
|
|
585
|
+
});
|
|
586
|
+
}
|
|
585
587
|
}, 0);
|
|
586
588
|
}
|
|
587
589
|
}
|
|
@@ -17,6 +17,7 @@ export default class DataSource {
|
|
|
17
17
|
if (this._options) {
|
|
18
18
|
this._options.onPaginationChange(this._dataUnit.getPaginationInfo());
|
|
19
19
|
}
|
|
20
|
+
this.updateSelection();
|
|
20
21
|
break;
|
|
21
22
|
case Action.RECORDS_REMOVED:
|
|
22
23
|
case Action.DATA_SAVED:
|
|
@@ -25,7 +26,6 @@ export default class DataSource {
|
|
|
25
26
|
this._controller.refresh();
|
|
26
27
|
break;
|
|
27
28
|
case Action.SELECTION_CHANGED:
|
|
28
|
-
case Action.SELECTION_REMOVED:
|
|
29
29
|
case Action.NEXT_SELECTED:
|
|
30
30
|
case Action.PREVIOUS_SELECTED:
|
|
31
31
|
this.updateSelection();
|
|
@@ -39,25 +39,14 @@ export default class DataSource {
|
|
|
39
39
|
this._dataUnit.subscribe(this.duObserver);
|
|
40
40
|
}
|
|
41
41
|
updateSelection() {
|
|
42
|
-
|
|
43
|
-
if (
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
const dataSelection = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getSelection();
|
|
47
|
-
if ((dataSelection === null || dataSelection === void 0 ? void 0 : dataSelection.length) > 0) {
|
|
48
|
-
this._controller.selectRows(dataSelection);
|
|
42
|
+
const selectionInfo = this._dataUnit.getSelectionInfo();
|
|
43
|
+
if (selectionInfo.isAllRecords()) {
|
|
44
|
+
this._controller.selectAll(true);
|
|
49
45
|
}
|
|
50
46
|
else {
|
|
51
|
-
this._controller.
|
|
47
|
+
this._controller.selectRows(selectionInfo.recordIds, true);
|
|
52
48
|
}
|
|
53
49
|
}
|
|
54
|
-
isSelectionEquals() {
|
|
55
|
-
var _a, _b;
|
|
56
|
-
const dataSelection = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getSelection();
|
|
57
|
-
const controlSelection = (_b = this._controller) === null || _b === void 0 ? void 0 : _b.getSelection();
|
|
58
|
-
return ObjectUtils.objectToString(dataSelection || []) ===
|
|
59
|
-
ObjectUtils.objectToString(controlSelection || []);
|
|
60
|
-
}
|
|
61
50
|
getRows(params) {
|
|
62
51
|
if (this.needReload(params)) {
|
|
63
52
|
this._lastLoadingParams = params;
|
|
@@ -2,17 +2,16 @@ import { ElementIDUtils, JSUtils } from "@sankhyalabs/core";
|
|
|
2
2
|
import { h, Host } from "@stencil/core";
|
|
3
3
|
import AgGridController from "./controller/ag-grid/AgGridController";
|
|
4
4
|
import { SelectionCounter } from "./subcomponents/selection-counter";
|
|
5
|
-
import {
|
|
5
|
+
import { SelectionMode } from "@sankhyalabs/core/dist/dataunit/DataUnit";
|
|
6
6
|
export class EzGrid {
|
|
7
7
|
constructor() {
|
|
8
8
|
this._gridController = new AgGridController(false);
|
|
9
|
-
this._debounceTimer = 500;
|
|
10
|
-
this._selectionAll = false;
|
|
11
9
|
this._paginationInfo = undefined;
|
|
12
10
|
this._paginationChangedByKeyboard = true;
|
|
13
11
|
this._showSelectionCounter = false;
|
|
14
|
-
this.
|
|
15
|
-
this.
|
|
12
|
+
this._isAllSelection = false;
|
|
13
|
+
this._currentPageSelected = undefined;
|
|
14
|
+
this._selectionCount = undefined;
|
|
16
15
|
this.multipleSelection = undefined;
|
|
17
16
|
this.config = undefined;
|
|
18
17
|
this.serverUrl = undefined;
|
|
@@ -71,117 +70,30 @@ export class EzGrid {
|
|
|
71
70
|
this._gridController.setColumnsState(config.columns);
|
|
72
71
|
}
|
|
73
72
|
onSelectionChange(evt) {
|
|
74
|
-
|
|
75
|
-
if (
|
|
76
|
-
|
|
77
|
-
}
|
|
78
|
-
if (this.isAllRecordSetted()) {
|
|
79
|
-
this.updateSelectionPage(selection);
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
this.setSelection(selection);
|
|
83
|
-
}
|
|
84
|
-
updateSelectionPage(selection) {
|
|
85
|
-
if (this._selectionAll) {
|
|
86
|
-
this._selectionAll = false;
|
|
87
|
-
}
|
|
88
|
-
else {
|
|
89
|
-
this.dataUnit.clearSelection()
|
|
90
|
-
.then(() => {
|
|
91
|
-
const records = this.dataUnit.records;
|
|
92
|
-
const selectionPage = selection.filter((selectedRecord) => {
|
|
93
|
-
return records.some((record) => {
|
|
94
|
-
return record.__record__id__ === selectedRecord.__record__id__;
|
|
95
|
-
});
|
|
96
|
-
});
|
|
97
|
-
this._gridController.selectRows(selectionPage);
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
isAllRecordSetted() {
|
|
102
|
-
var _a;
|
|
103
|
-
const allSelection = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getSelection();
|
|
104
|
-
return allSelection === null || allSelection === void 0 ? void 0 : allSelection.some((selectedRecord) => {
|
|
105
|
-
return selectedRecord.__record__id__ === ALL_RECORD;
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
setSelection(selection) {
|
|
109
|
-
if ((selection === null || selection === void 0 ? void 0 : selection.length) > 0) {
|
|
110
|
-
this.dataUnit.setSelection(selection)
|
|
111
|
-
.then(this.controlSelectionCounter.bind(this));
|
|
112
|
-
}
|
|
113
|
-
else {
|
|
114
|
-
this.dataUnit.clearSelection()
|
|
115
|
-
.then(this.controlSelectionCounter.bind(this));
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
setAutoSelectAll() {
|
|
119
|
-
var _a, _b, _c, _d;
|
|
120
|
-
const { total } = (_a = this._paginationInfo) !== null && _a !== void 0 ? _a : {};
|
|
121
|
-
if (total == undefined) {
|
|
122
|
-
return;
|
|
123
|
-
}
|
|
124
|
-
this._selectionCount = total;
|
|
125
|
-
this._selectionAll = true;
|
|
126
|
-
this._showSelectionCounter = true;
|
|
127
|
-
(_b = this._gridController) === null || _b === void 0 ? void 0 : _b.selectRows((_d = (_c = this.dataUnit) === null || _c === void 0 ? void 0 : _c.records) !== null && _d !== void 0 ? _d : []);
|
|
128
|
-
}
|
|
129
|
-
controlSelectionCounter() {
|
|
130
|
-
var _a, _b;
|
|
131
|
-
const allSelection = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getSelection();
|
|
132
|
-
const counter = (_b = allSelection === null || allSelection === void 0 ? void 0 : allSelection.length) !== null && _b !== void 0 ? _b : 0;
|
|
133
|
-
if (this.isAllRecordSetted()) {
|
|
134
|
-
this.setAutoSelectAll();
|
|
135
|
-
return;
|
|
136
|
-
}
|
|
137
|
-
if (!this.multipleSelection || !this.isPaginationActived()) {
|
|
138
|
-
this._showSelectionCounter = false;
|
|
139
|
-
setTimeout(this.setSelectionCount.bind(this), this._debounceTimer);
|
|
140
|
-
return;
|
|
141
|
-
}
|
|
142
|
-
if (counter > 1) {
|
|
143
|
-
setTimeout(() => {
|
|
144
|
-
this.setSelectionCount(counter);
|
|
145
|
-
this._showSelectionCounter = true;
|
|
146
|
-
}, this._debounceTimer);
|
|
147
|
-
}
|
|
148
|
-
else {
|
|
149
|
-
this._showSelectionCounter = false;
|
|
150
|
-
setTimeout(this.setSelectionCount.bind(this, counter), this._debounceTimer);
|
|
73
|
+
this._currentPageSelected = evt.detail.selectionHeaderStatus === true;
|
|
74
|
+
if (this.dataUnit) {
|
|
75
|
+
this.setSelection(this.dataUnit.getSelectionInfo());
|
|
151
76
|
}
|
|
152
77
|
}
|
|
153
|
-
|
|
154
|
-
var _a, _b;
|
|
155
|
-
this._selectionCount = value;
|
|
156
|
-
const selectPageRecords = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getSelectedRecords();
|
|
157
|
-
this._selectionPageCount = (_b = selectPageRecords === null || selectPageRecords === void 0 ? void 0 : selectPageRecords.length) !== null && _b !== void 0 ? _b : 0;
|
|
158
|
-
}
|
|
159
|
-
isPaginationActived() {
|
|
78
|
+
setSelection(selectionInfo) {
|
|
160
79
|
var _a;
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
}
|
|
165
|
-
return Math.ceil(total / (lastRecord - firstRecord + 1)) > 1;
|
|
80
|
+
this._selectionCount = (_a = selectionInfo === null || selectionInfo === void 0 ? void 0 : selectionInfo.length) !== null && _a !== void 0 ? _a : 0;
|
|
81
|
+
this._isAllSelection = selectionInfo === null || selectionInfo === void 0 ? void 0 : selectionInfo.isAllRecords();
|
|
82
|
+
this._showSelectionCounter = this._selectionCount > 1 || this._isAllSelection;
|
|
166
83
|
}
|
|
167
84
|
onSelectAllRecords() {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
filter: this.dataUnit.getFilters(),
|
|
171
|
-
sort: this.dataUnit.getSort()
|
|
172
|
-
};
|
|
173
|
-
this.setSelection([allRecord]);
|
|
85
|
+
var _a;
|
|
86
|
+
(_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.setSelection(SelectionMode.ALL_RECORDS).then(selection => this.setSelection(selection));
|
|
174
87
|
}
|
|
175
88
|
onSelectPageRecords() {
|
|
176
89
|
var _a;
|
|
177
|
-
(_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.
|
|
178
|
-
|
|
179
|
-
(_a = this._gridController) === null || _a === void 0 ? void 0 : _a.selectRows((_c = (_b = this.dataUnit) === null || _b === void 0 ? void 0 : _b.records) !== null && _c !== void 0 ? _c : []);
|
|
180
|
-
});
|
|
90
|
+
(_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.setSelection(this.dataUnit.records.map(record => record.__record__id__)).then(selection => this.setSelection(selection));
|
|
91
|
+
;
|
|
181
92
|
}
|
|
182
93
|
onClearSelectedRecords() {
|
|
183
94
|
var _a;
|
|
184
95
|
(_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.clearSelection();
|
|
96
|
+
this.setSelection(undefined);
|
|
185
97
|
}
|
|
186
98
|
createConfigFromState(state) {
|
|
187
99
|
let newConfig = { columns: [] };
|
|
@@ -331,8 +243,6 @@ export class EzGrid {
|
|
|
331
243
|
this._paginationChangedByKeyboard = true;
|
|
332
244
|
}
|
|
333
245
|
this._paginationInfo = paginationInfo;
|
|
334
|
-
this._gridController.updateCheckbox();
|
|
335
|
-
this.controlSelectionCounter();
|
|
336
246
|
},
|
|
337
247
|
onDoubleClick: (row) => {
|
|
338
248
|
this.ezDoubleClick.emit(row);
|
|
@@ -352,10 +262,10 @@ export class EzGrid {
|
|
|
352
262
|
this.configSelectionCounter();
|
|
353
263
|
}
|
|
354
264
|
render() {
|
|
355
|
-
var _a
|
|
265
|
+
var _a;
|
|
356
266
|
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
|
|
357
267
|
${this._showSelectionCounter ? "grid__selection-counter--opened" : ""}
|
|
358
|
-
` }, h(SelectionCounter, { selectionCount: this._selectionCount,
|
|
268
|
+
` }, h(SelectionCounter, { selectionCount: this._selectionCount, currentPageSelected: this._currentPageSelected, total: (_a = this._paginationInfo) === null || _a === void 0 ? void 0 : _a.total, allRecordSelected: this._isAllSelection, onSelectAll: () => this.onSelectAllRecords(), onSelectPage: () => this.onSelectPageRecords(), onClearAll: () => this.onClearSelectedRecords(), onClose: () => this._showSelectionCounter = false })), h("div", { class: "grid__container ez-grid", ref: elem => this._container = elem }), h("div", { class: "grid__footer" }, h("slot", { name: "footer" }))));
|
|
359
269
|
}
|
|
360
270
|
static get is() { return "ez-grid"; }
|
|
361
271
|
static get encapsulation() { return "scoped"; }
|
|
@@ -473,8 +383,9 @@ export class EzGrid {
|
|
|
473
383
|
"_paginationInfo": {},
|
|
474
384
|
"_paginationChangedByKeyboard": {},
|
|
475
385
|
"_showSelectionCounter": {},
|
|
476
|
-
"
|
|
477
|
-
"
|
|
386
|
+
"_isAllSelection": {},
|
|
387
|
+
"_currentPageSelected": {},
|
|
388
|
+
"_selectionCount": {}
|
|
478
389
|
};
|
|
479
390
|
}
|
|
480
391
|
static get events() {
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { ElementIDUtils } from "@sankhyalabs/core";
|
|
2
2
|
import { h } from "@stencil/core";
|
|
3
3
|
export const SelectionCounter = (props) => {
|
|
4
|
-
const { selectionCount,
|
|
5
|
-
|
|
6
|
-
|
|
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" })))));
|
|
4
|
+
const { selectionCount, currentPageSelected, total, allRecordSelected, onSelectAll, onSelectPage, onClearAll, onClose } = props;
|
|
5
|
+
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, allRecordSelected), 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" }, (currentPageSelected || allRecordSelected) &&
|
|
6
|
+
h("ez-button", Object.assign({ class: "ez-margin-right--medium", label: `Selecionar ${allRecordSelected ? "apenas a página atual" : `todos os ${total} registros`}`, mode: "link", onClick: allRecordSelected ? onSelectPage : onSelectAll }, getElementID(`ezGridSelectionCounter_select${allRecordSelected ? "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
7
|
};
|
|
10
8
|
function getText(selectionCount, allSelectedRecords) {
|
|
11
9
|
if (allSelectedRecords) {
|