@sankhyalabs/ezui 4.0.4 → 4.2.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-5a75e2f3.js → constants-5d588e38.js} +2 -0
- package/dist/cjs/ez-check.cjs.entry.js +12 -1
- 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 +64 -36
- package/dist/cjs/ez-grid.cjs.entry.js +331 -72
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/ez-check/ez-check.js +14 -1
- package/dist/collection/components/ez-grid/controller/DataUnitBridge.js +16 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +72 -15
- package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js +9 -1
- package/dist/collection/components/ez-grid/ez-grid.css +52 -7
- package/dist/collection/components/ez-grid/ez-grid.js +226 -57
- package/dist/collection/components/ez-grid/subcomponents/selection-counter.js +23 -0
- package/dist/collection/utils/constants.js +1 -0
- package/dist/collection/utils/form/DataBinder.js +47 -30
- package/dist/collection/utils/form/FormMetadata.js +17 -6
- package/dist/custom-elements/index.js +409 -111
- package/dist/esm/constants-76d2e931.js +4 -0
- package/dist/esm/ez-check.entry.js +12 -1
- 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 +64 -36
- package/dist/esm/ez-grid.entry.js +333 -74
- 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-1f841f3c.entry.js +1 -0
- package/dist/ezui/{p-dc15b6d1.entry.js → p-8105c967.entry.js} +2 -2
- package/dist/ezui/{p-50883460.entry.js → p-878646a0.entry.js} +1 -1
- package/dist/ezui/p-a3ce3710.entry.js +1 -0
- package/dist/ezui/p-b01e3085.js +1 -0
- package/dist/ezui/{p-e748b5d3.entry.js → p-b7ea9791.entry.js} +1 -1
- package/dist/types/components/ez-check/ez-check.d.ts +1 -0
- package/dist/types/components/ez-grid/controller/EzGridController.d.ts +10 -2
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +5 -2
- package/dist/types/components/ez-grid/ez-grid.d.ts +32 -11
- package/dist/types/components/ez-grid/subcomponents/selection-counter.d.ts +13 -0
- package/dist/types/utils/constants.d.ts +1 -0
- package/dist/types/utils/form/DataBinder.d.ts +3 -2
- package/package.json +1 -1
- package/dist/esm/constants-ca136201.js +0 -3
- package/dist/ezui/p-08f4a048.entry.js +0 -1
- package/dist/ezui/p-3f4ae3a3.js +0 -1
- package/dist/ezui/p-a323b415.entry.js +0 -1
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":[
|
|
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],"_showSelectionCounter":[32],"_selectionCount":[32],"_selectionPageCount":[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":[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],"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
|
|
|
@@ -15,6 +15,16 @@ export class EzCheck {
|
|
|
15
15
|
if (newValue != oldValue) {
|
|
16
16
|
this._inputElem.checked = newValue;
|
|
17
17
|
}
|
|
18
|
+
if (this._inputElem.indeterminate != this.indeterminate) {
|
|
19
|
+
this._inputElem.indeterminate = this.indeterminate;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
observeIndeterminate(newValue, oldValue) {
|
|
23
|
+
if (!this._inputElem)
|
|
24
|
+
return;
|
|
25
|
+
if (newValue != oldValue) {
|
|
26
|
+
this._inputElem.indeterminate = newValue;
|
|
27
|
+
}
|
|
18
28
|
}
|
|
19
29
|
//---------------------------------------------
|
|
20
30
|
// Public methods
|
|
@@ -125,7 +135,7 @@ export class EzCheck {
|
|
|
125
135
|
},
|
|
126
136
|
"indeterminate": {
|
|
127
137
|
"type": "boolean",
|
|
128
|
-
"mutable":
|
|
138
|
+
"mutable": true,
|
|
129
139
|
"complexType": {
|
|
130
140
|
"original": "boolean",
|
|
131
141
|
"resolved": "boolean",
|
|
@@ -228,6 +238,9 @@ export class EzCheck {
|
|
|
228
238
|
return [{
|
|
229
239
|
"propName": "value",
|
|
230
240
|
"methodName": "observeValue"
|
|
241
|
+
}, {
|
|
242
|
+
"propName": "indeterminate",
|
|
243
|
+
"methodName": "observeIndeterminate"
|
|
231
244
|
}];
|
|
232
245
|
}
|
|
233
246
|
}
|
|
@@ -18,9 +18,24 @@ export default class DataUnitBridge {
|
|
|
18
18
|
const { selection } = action.payload;
|
|
19
19
|
this._gridController.selectRows(selection);
|
|
20
20
|
break;
|
|
21
|
+
case Action.SELECTION_REMOVED:
|
|
22
|
+
const { unselection } = action.payload;
|
|
23
|
+
const filteredRecords = this._dataUnit.getAllSelection()
|
|
24
|
+
.filter((selectedRecord) => {
|
|
25
|
+
return !unselection.some((unselectedRecord) => {
|
|
26
|
+
return unselectedRecord.__record__id__ === selectedRecord.__record__id__;
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
if ((filteredRecords === null || filteredRecords === void 0 ? void 0 : filteredRecords.length) > 0) {
|
|
30
|
+
this._gridController.selectRows(filteredRecords);
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
this._gridController.deselectAll();
|
|
34
|
+
}
|
|
35
|
+
break;
|
|
21
36
|
case Action.NEXT_SELECTED:
|
|
22
37
|
case Action.PREVIOUS_SELECTED:
|
|
23
|
-
this._gridController.selectRows(this._dataUnit.
|
|
38
|
+
this._gridController.selectRows(this._dataUnit.getAllSelection());
|
|
24
39
|
break;
|
|
25
40
|
case Action.DATA_CHANGED:
|
|
26
41
|
const changes = Object.assign({}, action.payload);
|
|
@@ -6,6 +6,7 @@ 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";
|
|
9
10
|
export default class AgGridController {
|
|
10
11
|
constructor(enterprise) {
|
|
11
12
|
this.DEFAULT_ROW_HEIGHT = 30;
|
|
@@ -87,7 +88,7 @@ export default class AgGridController {
|
|
|
87
88
|
else {
|
|
88
89
|
this._grid = new Grid(container, this._gridOptions);
|
|
89
90
|
}
|
|
90
|
-
const selection = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.
|
|
91
|
+
const selection = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getAllSelection();
|
|
91
92
|
if (selection) {
|
|
92
93
|
this.selectRows(selection);
|
|
93
94
|
}
|
|
@@ -161,30 +162,72 @@ export default class AgGridController {
|
|
|
161
162
|
opt.suppressDragLeaveHidesColumns = true;
|
|
162
163
|
opt.suppressMenuHide = true;
|
|
163
164
|
}
|
|
165
|
+
isAllRecordSetted(allSelection) {
|
|
166
|
+
return allSelection === null || allSelection === void 0 ? void 0 : allSelection.some((selectedRecord) => {
|
|
167
|
+
return selectedRecord.__record__id__ === ALL_RECORD;
|
|
168
|
+
});
|
|
169
|
+
}
|
|
164
170
|
getSelectionHeaderStatus() {
|
|
165
171
|
const records = this._dataUnit.records;
|
|
166
172
|
if (records && records.length === 0) {
|
|
167
173
|
return false;
|
|
168
174
|
}
|
|
169
|
-
const
|
|
170
|
-
if (
|
|
175
|
+
const allSelection = this._dataUnit.getAllSelection();
|
|
176
|
+
if (allSelection == undefined || allSelection.length === 0) {
|
|
171
177
|
return false;
|
|
172
178
|
}
|
|
173
|
-
if (
|
|
179
|
+
if (this.isAllRecordSetted(allSelection)) {
|
|
180
|
+
return true;
|
|
181
|
+
}
|
|
182
|
+
if (allSelection.length != records.length) {
|
|
183
|
+
return undefined;
|
|
184
|
+
}
|
|
185
|
+
const selectedRecords = this._dataUnit.getSelectedRecords();
|
|
186
|
+
if (selectedRecords.length < allSelection.length) {
|
|
174
187
|
return undefined;
|
|
175
188
|
}
|
|
176
189
|
let status = undefined;
|
|
177
190
|
for (let i = 0; i < records.length; i++) {
|
|
178
|
-
const current =
|
|
191
|
+
const current = allSelection.some((selectedRecord) => {
|
|
192
|
+
return selectedRecord.__record__id__ === records[i].__record__id__;
|
|
193
|
+
});
|
|
179
194
|
if (status != undefined && current !== status) {
|
|
180
|
-
return
|
|
195
|
+
return;
|
|
181
196
|
}
|
|
182
197
|
status = current;
|
|
183
198
|
}
|
|
184
199
|
return status;
|
|
185
200
|
}
|
|
186
|
-
updateSelectionForAll(selectAll) {
|
|
187
|
-
|
|
201
|
+
async updateSelectionForAll(selectAll) {
|
|
202
|
+
if (this._dataUnit == undefined) {
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
let allSelection = this._dataUnit.getAllSelection();
|
|
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.getAllSelection();
|
|
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);
|
|
188
231
|
}
|
|
189
232
|
setData(data) {
|
|
190
233
|
if (this._grid === undefined) {
|
|
@@ -208,7 +251,7 @@ export default class AgGridController {
|
|
|
208
251
|
}
|
|
209
252
|
this._gridOptions.api.forEachNode(node => {
|
|
210
253
|
var _a;
|
|
211
|
-
if (rowIds && rowIds.
|
|
254
|
+
if (rowIds && rowIds.find(row => row.__record__id__ === node.id)) {
|
|
212
255
|
node.setSelected(true);
|
|
213
256
|
(_a = this._gridOptions.api) === null || _a === void 0 ? void 0 : _a.ensureNodeVisible(node);
|
|
214
257
|
}
|
|
@@ -216,10 +259,7 @@ export default class AgGridController {
|
|
|
216
259
|
node.setSelected(false);
|
|
217
260
|
}
|
|
218
261
|
});
|
|
219
|
-
|
|
220
|
-
if (selectionHeader) {
|
|
221
|
-
selectionHeader.updateCheckbox();
|
|
222
|
-
}
|
|
262
|
+
this.updateCheckbox();
|
|
223
263
|
}
|
|
224
264
|
removeRows() {
|
|
225
265
|
if (this._grid === undefined) {
|
|
@@ -314,7 +354,7 @@ export default class AgGridController {
|
|
|
314
354
|
if (this._grid === undefined) {
|
|
315
355
|
throw new Error("Erro interno: Grid ainda não inicializado.");
|
|
316
356
|
}
|
|
317
|
-
const colDef = this._gridOptions.columnApi.
|
|
357
|
+
const colDef = this._gridOptions.columnApi.getColumns();
|
|
318
358
|
return colDef.filter(c => ![this.CHECK_BOX_COL_ID, this.STATUS_COL_ID].includes(c.getColId())).map(c => {
|
|
319
359
|
const def = c.getColDef();
|
|
320
360
|
const colDef = { name: def.field, label: def.headerName };
|
|
@@ -332,12 +372,16 @@ export default class AgGridController {
|
|
|
332
372
|
if (this._grid === undefined) {
|
|
333
373
|
throw new Error("Erro interno: Grid ainda não inicializado.");
|
|
334
374
|
}
|
|
375
|
+
const colDef = this._gridOptions.columnApi.getColumns();
|
|
335
376
|
let columns = this.getColumnsDef();
|
|
336
377
|
let visibleColumns = [];
|
|
378
|
+
//Existem colunas implícitas que não tem estado, essas colunas são sempre as primeiras.
|
|
379
|
+
//Como vamos reordenar, precisamos considerar o deslocamento provocado por elas.
|
|
380
|
+
const columnsOffset = colDef.length - columns.length;
|
|
337
381
|
let sort = [];
|
|
338
382
|
state.forEach((cfgColumn, index) => {
|
|
339
383
|
const colWidth = this.getColumnWidth(cfgColumn);
|
|
340
|
-
this._gridOptions.columnApi.moveColumn(cfgColumn.name, index +
|
|
384
|
+
this._gridOptions.columnApi.moveColumn(cfgColumn.name, index + columnsOffset);
|
|
341
385
|
this._gridOptions.columnApi.setColumnWidth(cfgColumn.name, colWidth);
|
|
342
386
|
visibleColumns.push(cfgColumn.name);
|
|
343
387
|
if (cfgColumn.ascending !== undefined) {
|
|
@@ -398,6 +442,19 @@ export default class AgGridController {
|
|
|
398
442
|
var _a;
|
|
399
443
|
(_a = this._gridOptions.api.getDisplayedRowAtIndex(index)) === null || _a === void 0 ? void 0 : _a.setSelected(true);
|
|
400
444
|
}
|
|
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
|
+
}
|
|
401
458
|
buildColDef(source) {
|
|
402
459
|
var _a, _b, _c;
|
|
403
460
|
let tooltip = undefined;
|
|
@@ -25,6 +25,7 @@ export default class DataSource {
|
|
|
25
25
|
this._controller.refresh();
|
|
26
26
|
break;
|
|
27
27
|
case Action.SELECTION_CHANGED:
|
|
28
|
+
case Action.SELECTION_REMOVED:
|
|
28
29
|
case Action.NEXT_SELECTED:
|
|
29
30
|
case Action.PREVIOUS_SELECTED:
|
|
30
31
|
this.updateSelection();
|
|
@@ -38,7 +39,14 @@ export default class DataSource {
|
|
|
38
39
|
this._dataUnit.subscribe(this.duObserver);
|
|
39
40
|
}
|
|
40
41
|
updateSelection() {
|
|
41
|
-
|
|
42
|
+
var _a;
|
|
43
|
+
const selection = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getAllSelection();
|
|
44
|
+
if ((selection === null || selection === void 0 ? void 0 : selection.length) > 0) {
|
|
45
|
+
this._controller.selectRows(selection);
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
this._controller.deselectAll();
|
|
49
|
+
}
|
|
42
50
|
}
|
|
43
51
|
getRows(params) {
|
|
44
52
|
if (this.needReload(params)) {
|
|
@@ -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
|
}
|