@sankhyalabs/ezui 5.22.0-dev.9 → 5.22.0-dev.91
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/{CSSVarsUtils-10c9d5b4.js → CSSVarsUtils-f20973d1.js} +1 -0
- package/dist/cjs/DataBinder-e92314c2.js +445 -0
- package/dist/cjs/FocusResolver-885f2173.js +35 -0
- package/dist/cjs/ez-actions-button.cjs.entry.js +4 -3
- package/dist/cjs/ez-button.cjs.entry.js +11 -5
- package/dist/cjs/ez-card-item_2.cjs.entry.js +76 -0
- package/dist/cjs/ez-check.cjs.entry.js +1 -1
- package/dist/cjs/ez-collapsible-box.cjs.entry.js +1 -1
- package/dist/cjs/ez-combo-box-list_3.cjs.entry.js +366 -0
- package/dist/cjs/ez-combo-box.cjs.entry.js +82 -155
- package/dist/cjs/ez-date-input.cjs.entry.js +13 -4
- package/dist/cjs/ez-date-time-input.cjs.entry.js +10 -4
- package/dist/cjs/ez-dialog.cjs.entry.js +14 -7
- package/dist/cjs/ez-double-list.cjs.entry.js +287 -0
- package/dist/cjs/{ez-dropdown.cjs.entry.js → ez-dropdown_2.cjs.entry.js} +75 -8
- package/dist/cjs/ez-filter-input.cjs.entry.js +129 -0
- package/dist/cjs/ez-form-view.cjs.entry.js +28 -21
- package/dist/cjs/ez-form.cjs.entry.js +6 -325
- package/dist/cjs/ez-grid.cjs.entry.js +14959 -69757
- package/dist/cjs/ez-icon.cjs.entry.js +1 -1
- package/dist/cjs/ez-list.cjs.entry.js +258 -211
- package/dist/cjs/ez-modal-container.cjs.entry.js +2 -2
- package/dist/cjs/ez-modal.cjs.entry.js +12 -3
- package/dist/cjs/ez-multi-selection-list.cjs.entry.js +2 -2
- package/dist/cjs/ez-number-input.cjs.entry.js +15 -3
- package/dist/cjs/ez-popover-core_2.cjs.entry.js +1504 -0
- package/dist/cjs/ez-popup.cjs.entry.js +24 -2
- package/dist/cjs/ez-scroller_2.cjs.entry.js +3 -3
- package/dist/cjs/ez-search.cjs.entry.js +109 -48
- package/dist/cjs/ez-sidebar-navigator.cjs.entry.js +1 -1
- package/dist/cjs/ez-split-button.cjs.entry.js +2 -2
- package/dist/cjs/ez-split-item.cjs.entry.js +6 -3
- package/dist/cjs/ez-split-panel.cjs.entry.js +68 -6
- package/dist/cjs/ez-text-area.cjs.entry.js +68 -6
- package/dist/cjs/ez-text-input.cjs.entry.js +152 -16
- package/dist/cjs/ez-time-input.cjs.entry.js +7 -1
- package/dist/cjs/ez-tooltip.cjs.entry.js +55 -0
- package/dist/cjs/ez-tree.cjs.entry.js +5 -4
- package/dist/cjs/ezListHelper-0d3970b4.js +90 -0
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/filter-column.cjs.entry.js +10 -47
- package/dist/cjs/index-a7b0c73d.js +22 -10
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +6 -1
- package/dist/collection/components/ez-actions-button/ez-actions-button.js +3 -2
- package/dist/collection/components/ez-button/ez-button.css +23 -13
- package/dist/collection/components/ez-button/ez-button.js +12 -6
- package/dist/collection/components/ez-card-item/ez-card-item.css +60 -10
- package/dist/collection/components/ez-card-item/ez-card-item.js +30 -3
- package/dist/collection/components/ez-check/ez-check.css +1 -6
- package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.css +2 -2
- package/dist/collection/components/ez-combo-box/ez-combo-box-list/ez-combo-box-list.css +205 -0
- package/dist/collection/components/ez-combo-box/ez-combo-box-list/ez-combo-box-list.js +405 -0
- package/dist/collection/components/ez-combo-box/ez-combo-box.css +8 -246
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +129 -166
- package/dist/collection/components/ez-date-input/ez-date-input.css +1 -1
- package/dist/collection/components/ez-date-input/ez-date-input.js +38 -4
- package/dist/collection/components/ez-date-time-input/ez-date-time-input.css +1 -1
- package/dist/collection/components/ez-date-time-input/ez-date-time-input.js +35 -4
- package/dist/collection/components/ez-dialog/ez-dialog.css +3 -3
- package/dist/collection/components/ez-dialog/ez-dialog.js +14 -16
- package/dist/collection/components/ez-double-list/doubleListHelper.js +82 -0
- package/dist/collection/components/ez-double-list/ez-double-list.css +62 -0
- package/dist/collection/components/ez-double-list/ez-double-list.js +440 -0
- package/dist/collection/components/ez-dropdown/ez-dropdown.js +33 -8
- package/dist/collection/components/ez-filter-input/ez-filter-input.css +1 -1
- package/dist/collection/components/ez-filter-input/ez-filter-input.js +35 -4
- package/dist/collection/components/ez-form/ez-form.js +1 -0
- package/dist/collection/components/ez-form-view/custom-input/ez-custom-form-input.js +49 -6
- package/dist/collection/components/ez-form-view/ez-form-view.css +5 -2
- package/dist/collection/components/ez-form-view/fieldbuilder/FieldBuilder.js +2 -1
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/CheckBox.tpl.js +1 -1
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/ComboBox.tpl.js +1 -1
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/DateInput.tpl.js +8 -4
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/FileInput.tpl.js +1 -1
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/NumberInput.tpl.js +1 -1
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/SearchInput.tpl.js +3 -2
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/TextArea.tpl.js +1 -1
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/TextInput.tpl.js +2 -2
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +295 -63
- package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js +151 -31
- package/dist/collection/components/ez-grid/controller/ag-grid/DataSourceInterceptor.js +2 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/GridEditionManager.js +219 -42
- package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomCellEditor.js +16 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomHeader.js +1 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/EzCellEditor.js +8 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/ComboBox.tpl.js +2 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/DateInput.tpl.js +1 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/NumberInput.tpl.js +1 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/Search.tpl.js +8 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/TextInput.tpl.js +4 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/test/constants/GridEditionMock.js +2 -0
- package/dist/collection/components/ez-grid/ez-grid.css +95 -10
- package/dist/collection/components/ez-grid/ez-grid.js +315 -10
- package/dist/collection/components/ez-grid/subcomponents/filter-column.css +4 -0
- package/dist/collection/components/ez-grid/subcomponents/filter-column.js +9 -46
- package/dist/collection/components/ez-icon/ez-icon.css +156 -149
- package/dist/collection/components/ez-list/ez-list.css +5 -4
- package/dist/collection/components/ez-list/ez-list.js +301 -212
- package/dist/collection/components/ez-list/ezListHelper.js +85 -0
- package/dist/collection/components/ez-modal/ez-modal.css +7 -2
- package/dist/collection/components/ez-modal/ez-modal.js +13 -4
- package/dist/collection/components/ez-modal-container/ez-modal-container.css +1 -0
- package/dist/collection/components/ez-modal-container/ez-modal-container.js +1 -1
- package/dist/collection/components/ez-multi-selection-list/ez-multi-selection-list.css +3 -3
- package/dist/collection/components/ez-multi-selection-list/ez-multi-selection-list.js +1 -1
- package/dist/collection/components/ez-number-input/ez-number-input.css +8 -0
- package/dist/collection/components/ez-number-input/ez-number-input.js +49 -1
- package/dist/collection/components/ez-popover-plus/ez-popover-plus.css +3 -0
- package/dist/collection/components/ez-popover-plus/ez-popover-plus.js +385 -0
- package/dist/collection/components/ez-popover-plus/subcomponent/ez-popover-core.css +67 -0
- package/dist/collection/components/ez-popover-plus/subcomponent/ez-popover-core.js +468 -0
- package/dist/collection/components/ez-popup/ez-popup.css +8 -3
- package/dist/collection/components/ez-popup/ez-popup.js +43 -3
- package/dist/collection/components/ez-scroller/ez-scroller.css +1 -0
- package/dist/collection/components/ez-search/ez-search.css +22 -11
- package/dist/collection/components/ez-search/ez-search.js +193 -53
- package/dist/collection/components/ez-sidebar-button/ez-sidebar-button.css +3 -0
- package/dist/collection/components/ez-sidebar-button/ez-sidebar-button.js +1 -1
- package/dist/collection/components/ez-sidebar-navigator/ez-sidebar-navigator.css +4 -1
- package/dist/collection/components/ez-skeleton/ez-skeleton.css +54 -34
- package/dist/collection/components/ez-split-button/ez-split-button.css +52 -14
- package/dist/collection/components/ez-split-button/ez-split-button.js +3 -3
- package/dist/collection/components/ez-split-panel/ez-split-panel.css +15 -0
- package/dist/collection/components/ez-split-panel/ez-split-panel.js +106 -5
- package/dist/collection/components/ez-split-panel/interfaces/IPanelSizeInfo.js +1 -0
- package/dist/collection/components/ez-split-panel/structure/item/ez-split-item.css +14 -2
- package/dist/collection/components/ez-split-panel/structure/item/ez-split-item.js +22 -1
- package/dist/collection/components/ez-text-area/ez-text-area.css +78 -29
- package/dist/collection/components/ez-text-area/ez-text-area.js +104 -4
- package/dist/collection/components/ez-text-input/ez-text-input.css +106 -91
- package/dist/collection/components/ez-text-input/ez-text-input.js +166 -15
- package/dist/collection/components/ez-time-input/ez-time-input.js +24 -0
- package/dist/collection/components/ez-tooltip/ez-tooltip.css +20 -0
- package/dist/collection/components/ez-tooltip/ez-tooltip.js +116 -0
- package/dist/collection/components/ez-tree/ez-tree.js +21 -1
- package/dist/collection/components/ez-tree/subcomponents/TreeItem.js +3 -3
- package/dist/collection/sw.js +46 -0
- package/dist/collection/utils/CSSVarsUtils.js +1 -0
- package/dist/collection/utils/FocusResolver.js +31 -0
- package/dist/collection/utils/ResponsiveInputUtils.js +26 -0
- package/dist/collection/utils/form/DataBinder.js +22 -7
- package/dist/collection/utils/form/FormMetadata.js +2 -1
- package/dist/collection/utils/interfaces/AbstractFieldMetadata.js +1 -1
- package/dist/collection/utils/validators/recordvalidator/IInvalidCells.js +1 -0
- package/dist/collection/utils/validators/recordvalidator/RecordValidationProcessor.js +7 -1
- package/dist/custom-elements/index.d.ts +30 -0
- package/dist/custom-elements/index.js +19539 -71833
- package/dist/esm/{CSSVarsUtils-71ce76be.js → CSSVarsUtils-acba92d7.js} +1 -0
- package/dist/esm/DataBinder-9c877244.js +441 -0
- package/dist/esm/FocusResolver-1ccbf850.js +33 -0
- package/dist/esm/ez-actions-button.entry.js +4 -3
- package/dist/esm/ez-button.entry.js +11 -5
- package/dist/esm/ez-card-item_2.entry.js +71 -0
- package/dist/esm/ez-check.entry.js +1 -1
- package/dist/esm/ez-collapsible-box.entry.js +1 -1
- package/dist/esm/ez-combo-box-list_3.entry.js +360 -0
- package/dist/esm/ez-combo-box.entry.js +83 -156
- package/dist/esm/ez-date-input.entry.js +13 -4
- package/dist/esm/ez-date-time-input.entry.js +10 -4
- package/dist/esm/ez-dialog.entry.js +15 -8
- package/dist/esm/ez-double-list.entry.js +283 -0
- package/dist/esm/{ez-dropdown.entry.js → ez-dropdown_2.entry.js} +75 -9
- package/dist/esm/ez-filter-input.entry.js +125 -0
- package/dist/esm/ez-form-view.entry.js +28 -21
- package/dist/esm/ez-form.entry.js +5 -324
- package/dist/esm/ez-grid.entry.js +14899 -69697
- package/dist/esm/ez-icon.entry.js +1 -1
- package/dist/esm/ez-list.entry.js +258 -211
- package/dist/esm/ez-modal-container.entry.js +2 -2
- package/dist/esm/ez-modal.entry.js +12 -3
- package/dist/esm/ez-multi-selection-list.entry.js +2 -2
- package/dist/esm/ez-number-input.entry.js +15 -3
- package/dist/esm/ez-popover-core_2.entry.js +1499 -0
- package/dist/esm/ez-popup.entry.js +24 -2
- package/dist/esm/ez-scroller_2.entry.js +3 -3
- package/dist/esm/ez-search.entry.js +109 -48
- package/dist/esm/ez-sidebar-navigator.entry.js +1 -1
- package/dist/esm/ez-split-button.entry.js +2 -2
- package/dist/esm/ez-split-item.entry.js +6 -3
- package/dist/esm/ez-split-panel.entry.js +69 -7
- package/dist/esm/ez-text-area.entry.js +68 -6
- package/dist/esm/ez-text-input.entry.js +152 -16
- package/dist/esm/ez-time-input.entry.js +7 -1
- package/dist/esm/ez-tooltip.entry.js +51 -0
- package/dist/esm/ez-tree.entry.js +5 -4
- package/dist/esm/ezListHelper-00fb9b8d.js +87 -0
- package/dist/esm/ezui.js +1 -1
- package/dist/esm/filter-column.entry.js +10 -47
- package/dist/esm/index-baa5e267.js +22 -10
- package/dist/esm/loader.js +1 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-0fa52b0f.entry.js +1 -0
- package/dist/ezui/p-0faf71c5.entry.js +1 -0
- package/dist/ezui/p-15134d97.entry.js +1 -0
- package/dist/ezui/p-17de16e5.entry.js +1 -0
- package/dist/ezui/p-17eabf46.entry.js +1 -0
- package/dist/ezui/p-1ad6c61b.entry.js +1 -0
- package/dist/ezui/p-20c024f7.entry.js +1 -0
- package/dist/ezui/p-2bb2a0c4.entry.js +1 -0
- package/dist/ezui/p-2f45506d.entry.js +1 -0
- package/dist/ezui/p-3195a7a7.entry.js +1 -0
- package/dist/ezui/p-31b71e50.entry.js +1 -0
- package/dist/ezui/p-3429080c.entry.js +1 -0
- package/dist/ezui/p-463be973.entry.js +309 -0
- package/dist/ezui/p-556468d9.entry.js +1 -0
- package/dist/ezui/p-56fe5341.entry.js +1 -0
- package/dist/ezui/p-58783dcf.entry.js +1 -0
- package/dist/ezui/p-65f471bc.entry.js +1 -0
- package/dist/ezui/p-6cdd3e0a.entry.js +1 -0
- package/dist/ezui/p-7bd15498.entry.js +1 -0
- package/dist/ezui/p-7e677b7b.entry.js +1 -0
- package/dist/ezui/{p-bf79aaa1.entry.js → p-7fdd479f.entry.js} +1 -1
- package/dist/ezui/p-80dfc50b.js +1 -0
- package/dist/ezui/p-990b4318.entry.js +1 -0
- package/dist/ezui/p-a4cee65d.entry.js +1 -0
- package/dist/ezui/p-acddfb2e.js +1 -0
- package/dist/ezui/p-b26f6c5b.entry.js +1 -0
- package/dist/ezui/p-c1527804.entry.js +1 -0
- package/dist/ezui/p-cb1535f7.entry.js +1 -0
- package/dist/ezui/p-cf87aacb.entry.js +1 -0
- package/dist/ezui/p-d9548bdf.entry.js +1 -0
- package/dist/ezui/p-da1b4a38.entry.js +1 -0
- package/dist/ezui/p-dc628ed3.js +1 -0
- package/dist/ezui/p-dc73e1fe.entry.js +1 -0
- package/dist/ezui/{p-84e439b9.entry.js → p-e347df9c.entry.js} +1 -1
- package/dist/ezui/p-e6a9041d.entry.js +1 -0
- package/dist/ezui/p-ea54d056.entry.js +1 -0
- package/dist/ezui/p-ec7db713.js +1 -0
- package/dist/ezui/p-f5931caa.entry.js +1 -0
- package/dist/ezui/p-fa6732f2.entry.js +1 -0
- package/dist/ezui/p-fd0a19d6.entry.js +1 -0
- package/dist/types/components/ez-button/ez-button.d.ts +2 -1
- package/dist/types/components/ez-card-item/ez-card-item.d.ts +5 -0
- package/dist/types/components/ez-combo-box/ez-combo-box-list/ez-combo-box-list.d.ts +104 -0
- package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +17 -15
- package/dist/types/components/ez-date-input/ez-date-input.d.ts +6 -1
- package/dist/types/components/ez-date-time-input/ez-date-time-input.d.ts +6 -1
- package/dist/types/components/ez-dialog/ez-dialog.d.ts +2 -1
- package/dist/types/components/ez-double-list/doubleListHelper.d.ts +10 -0
- package/dist/types/components/ez-double-list/ez-double-list.d.ts +87 -0
- package/dist/types/components/ez-dropdown/ez-dropdown.d.ts +4 -0
- package/dist/types/components/ez-dropdown/structure/DropdownItem.d.ts +1 -1
- package/dist/types/components/ez-filter-input/ez-filter-input.d.ts +6 -1
- package/dist/types/components/ez-form-view/custom-input/ez-custom-form-input.d.ts +7 -1
- package/dist/types/components/ez-form-view/fieldbuilder/templates/DateInput.tpl.d.ts +2 -1
- package/dist/types/components/ez-form-view/fieldbuilder/templates/SearchInput.tpl.d.ts +1 -1
- package/dist/types/components/ez-form-view/fieldbuilder/templates/TextInput.tpl.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/EzGridController.d.ts +71 -4
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +36 -4
- package/dist/types/components/ez-grid/controller/ag-grid/DataSource.d.ts +25 -2
- package/dist/types/components/ez-grid/controller/ag-grid/GridEditionManager.d.ts +33 -7
- package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomCellEditor.d.ts +4 -1
- package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomCellRender.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomHeader.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/ag-grid/components/cellRendererStatus.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/ag-grid/components/selectionHeader.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/ag-grid/editor/EzCellEditor.d.ts +2 -1
- package/dist/types/components/ez-grid/controller/ag-grid/editor/EzCellRender.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/ag-grid/editor/IUICellEditor.d.ts +1 -0
- package/dist/types/components/ez-grid/controller/ag-grid/mock/Server.d.ts +1 -1
- package/dist/types/components/ez-grid/ez-grid.d.ts +54 -1
- package/dist/types/components/ez-grid/subcomponents/filter-column.d.ts +0 -11
- package/dist/types/components/ez-list/ez-list.d.ts +23 -2
- package/dist/types/components/ez-list/ezListHelper.d.ts +20 -0
- package/dist/types/components/ez-modal/ez-modal.d.ts +2 -1
- package/dist/types/components/ez-number-input/ez-number-input.d.ts +8 -0
- package/dist/types/components/ez-popover-plus/ez-popover-plus.d.ts +68 -0
- package/dist/types/components/ez-popover-plus/subcomponent/ez-popover-core.d.ts +81 -0
- package/dist/types/components/ez-popup/ez-popup.d.ts +8 -1
- package/dist/types/components/ez-search/ez-search.d.ts +30 -6
- package/dist/types/components/ez-split-button/ez-split-button.d.ts +1 -1
- package/dist/types/components/ez-split-panel/ez-split-panel.d.ts +11 -0
- package/dist/types/components/ez-split-panel/interfaces/IPanelSizeInfo.d.ts +9 -0
- package/dist/types/components/ez-split-panel/structure/item/ez-split-item.d.ts +5 -0
- package/dist/types/components/ez-text-area/ez-text-area.d.ts +17 -0
- package/dist/types/components/ez-text-input/ez-text-input.d.ts +24 -2
- package/dist/types/components/ez-time-input/ez-time-input.d.ts +4 -0
- package/dist/types/components/ez-tooltip/ez-tooltip.d.ts +21 -0
- package/dist/types/components/ez-tree/ez-tree.d.ts +4 -0
- package/dist/types/components/ez-tree/interfaces/ITreeItem.d.ts +1 -0
- package/dist/types/components/ez-tree/subcomponents/TreeItem.d.ts +1 -0
- package/dist/types/components.d.ts +717 -29
- package/dist/types/utils/FocusResolver.d.ts +5 -0
- package/dist/types/utils/ResponsiveInputUtils.d.ts +6 -0
- package/dist/types/utils/customEditor/interfaces/ICustomEditor.d.ts +2 -0
- package/dist/types/utils/form/DataBinder.d.ts +3 -0
- package/dist/types/utils/validators/recordvalidator/IInvalidCells.d.ts +5 -0
- package/dist/types/utils/validators/recordvalidator/RecordValidationProcessor.d.ts +1 -1
- package/package.json +11 -3
- package/react/components.d.ts +5 -0
- package/react/components.js +5 -0
- package/react/components.js.map +1 -1
- package/dist/cjs/RecordValidationProcessor-4c893e04.js +0 -102
- package/dist/cjs/ez-card-item_3.cjs.entry.js +0 -183
- package/dist/cjs/ez-custom-form-input_2.cjs.entry.js +0 -206
- package/dist/cjs/ez-skeleton.cjs.entry.js +0 -67
- package/dist/esm/RecordValidationProcessor-b00b8b77.js +0 -99
- package/dist/esm/ez-card-item_3.entry.js +0 -177
- package/dist/esm/ez-custom-form-input_2.entry.js +0 -201
- package/dist/esm/ez-skeleton.entry.js +0 -63
- package/dist/ezui/p-04f24913.js +0 -1
- package/dist/ezui/p-072e6347.entry.js +0 -1
- package/dist/ezui/p-1285c902.entry.js +0 -1
- package/dist/ezui/p-13d2fe2d.entry.js +0 -1
- package/dist/ezui/p-2097d0cf.entry.js +0 -1
- package/dist/ezui/p-32e553e5.entry.js +0 -304
- package/dist/ezui/p-34b6916c.entry.js +0 -1
- package/dist/ezui/p-3b4eeeb6.entry.js +0 -1
- package/dist/ezui/p-3faa2b46.entry.js +0 -1
- package/dist/ezui/p-42533ea4.entry.js +0 -1
- package/dist/ezui/p-49456b34.entry.js +0 -1
- package/dist/ezui/p-4d5235f1.entry.js +0 -1
- package/dist/ezui/p-5bd5e68f.entry.js +0 -1
- package/dist/ezui/p-784fe207.entry.js +0 -1
- package/dist/ezui/p-7922142b.entry.js +0 -1
- package/dist/ezui/p-7af81663.entry.js +0 -1
- package/dist/ezui/p-7bc07c31.entry.js +0 -1
- package/dist/ezui/p-85c8baae.entry.js +0 -1
- package/dist/ezui/p-8888d9ed.entry.js +0 -1
- package/dist/ezui/p-8f0144f6.entry.js +0 -1
- package/dist/ezui/p-9050d2cd.entry.js +0 -1
- package/dist/ezui/p-922ac38b.entry.js +0 -1
- package/dist/ezui/p-9ab22a07.entry.js +0 -1
- package/dist/ezui/p-9e11fc7b.js +0 -1
- package/dist/ezui/p-a31b9c90.entry.js +0 -1
- package/dist/ezui/p-af95cd16.entry.js +0 -1
- package/dist/ezui/p-bae4e180.entry.js +0 -1
- package/dist/ezui/p-baf80b13.entry.js +0 -1
- package/dist/ezui/p-bcb53f27.entry.js +0 -1
- package/dist/ezui/p-d9401ea0.entry.js +0 -1
- package/dist/ezui/p-e85c48d7.entry.js +0 -1
- package/dist/ezui/p-ecc2c1ec.entry.js +0 -1
- package/dist/ezui/p-fcf0acce.entry.js +0 -1
|
@@ -2,6 +2,93 @@ import { Action, ObjectUtils } from '@sankhyalabs/core';
|
|
|
2
2
|
import { EZ_GRID_LOADING_SOURCE } from "../../../../utils/constants";
|
|
3
3
|
import { DataSourceInterceptor } from "./DataSourceInterceptor";
|
|
4
4
|
export default class DataSource {
|
|
5
|
+
handleDataSaved(action) {
|
|
6
|
+
if (this._options) {
|
|
7
|
+
this._options.onPaginationUpdate(this._dataUnit.getPaginationInfo());
|
|
8
|
+
}
|
|
9
|
+
this._controller.clearInvalidCells();
|
|
10
|
+
this.handleRefreshOrReload(action);
|
|
11
|
+
this._controller.processContinuousInsert();
|
|
12
|
+
this._controller.showSelectionColumn();
|
|
13
|
+
}
|
|
14
|
+
handleEditionCanceled(action) {
|
|
15
|
+
if (this._options.enableGridInsert) {
|
|
16
|
+
this._controller.processEditionCanceled();
|
|
17
|
+
}
|
|
18
|
+
this.handleRefreshOrReload(action);
|
|
19
|
+
this._controller.showSelectionColumn();
|
|
20
|
+
}
|
|
21
|
+
handleSavingCanceled(action) {
|
|
22
|
+
var _a, _b, _c, _d;
|
|
23
|
+
if (!((_a = action.payload) === null || _a === void 0 ? void 0 : _a.fields) || !((_b = action.payload) === null || _b === void 0 ? void 0 : _b.recordId))
|
|
24
|
+
return;
|
|
25
|
+
this._controller.savingCanceled((_c = action.payload) === null || _c === void 0 ? void 0 : _c.fields, (_d = action.payload) === null || _d === void 0 ? void 0 : _d.recordId);
|
|
26
|
+
}
|
|
27
|
+
handleDataChanged(action) {
|
|
28
|
+
if (!this._options.enableGridInsert) {
|
|
29
|
+
this.handleRefresh(action);
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
this.updateGridRowNodes(this.createRecordIdList(action));
|
|
33
|
+
}
|
|
34
|
+
createRecordIdList(action) {
|
|
35
|
+
var _a, _b;
|
|
36
|
+
if ((_a = action.payload) === null || _a === void 0 ? void 0 : _a.records)
|
|
37
|
+
return (_b = action.payload) === null || _b === void 0 ? void 0 : _b.records;
|
|
38
|
+
return this._dataUnit.getSelectedRecord() ? [this._dataUnit.getSelectedRecord().__record__id__] : [];
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Nesse ponto, o registro já se encontra atualizado no DU,
|
|
42
|
+
* basta então passar seu valor para que a garde possa atualizar sua linha.
|
|
43
|
+
*/
|
|
44
|
+
updateGridRowNodes(recordIDList) {
|
|
45
|
+
const recordsToUpdate = recordIDList === null || recordIDList === void 0 ? void 0 : recordIDList.map(id => this.getRecordById(id));
|
|
46
|
+
this._controller.updateRows(recordsToUpdate);
|
|
47
|
+
}
|
|
48
|
+
getRecordById(recordId) {
|
|
49
|
+
return this._dataUnit.records.find(record => record['__record__id__'] === recordId);
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Em caso de necessidade de reload (isWaitingToReload), eh preciso chamar o dataUnit.gotoPage, pois ele aplica tambem a ordenacao dos registros,
|
|
53
|
+
* enquanto que o _controller.refresh apenas recarrega os dados na ordem que atua.
|
|
54
|
+
*/
|
|
55
|
+
handleRefreshOrReload(action) {
|
|
56
|
+
if (this._dataUnit.isWaitingToReload()) {
|
|
57
|
+
this.handleReload();
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
this.handleRefresh(action);
|
|
61
|
+
}
|
|
62
|
+
handleReload() {
|
|
63
|
+
this._dataUnit.setWaitingToReload(false);
|
|
64
|
+
this._dataUnit.gotoPage(0);
|
|
65
|
+
}
|
|
66
|
+
handleRefresh(action) {
|
|
67
|
+
if (this.isSilentChange(action)) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
this._controller.refresh(action.type === Action.DATA_SAVED);
|
|
71
|
+
}
|
|
72
|
+
handleRecordsAdded() {
|
|
73
|
+
if (this._options.enableGridInsert) {
|
|
74
|
+
this._controller.hideSelectionColumn();
|
|
75
|
+
this._controller.refresh();
|
|
76
|
+
this.focusOnNewRecord();
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
focusOnNewRecord() {
|
|
80
|
+
/**
|
|
81
|
+
* O SetTimeout eh utilizado pois é preciso aguardar que o novo registro seja renderizado na grade.
|
|
82
|
+
* Tentamos utilizar a api da grade para adicionar um event listener, porém na versão que utilizamos, não existe
|
|
83
|
+
* algo que resolva nosso cenário.
|
|
84
|
+
*
|
|
85
|
+
* Sugiro no futuro utilizar algo como o applyServerSideTransaction, porém será preciso lidar com os handlers
|
|
86
|
+
* e callbacks implementados no AgGridController e GridEditionManager.
|
|
87
|
+
*/
|
|
88
|
+
setTimeout(() => {
|
|
89
|
+
this._controller.startEditionOnLastRow();
|
|
90
|
+
}, 1000);
|
|
91
|
+
}
|
|
5
92
|
updateLoadedRecords(action) {
|
|
6
93
|
const records = action.payload;
|
|
7
94
|
if ((records === null || records === void 0 ? void 0 : records.length) > 0) {
|
|
@@ -28,12 +115,15 @@ export default class DataSource {
|
|
|
28
115
|
return ((_b = action === null || action === void 0 ? void 0 : action.payload) === null || _b === void 0 ? void 0 : _b.silent) === true;
|
|
29
116
|
}
|
|
30
117
|
}
|
|
31
|
-
constructor(dataUnit, controller, options) {
|
|
118
|
+
constructor(dataUnit, controller, options, resolveLoading) {
|
|
119
|
+
var _a;
|
|
32
120
|
this.RECORD_ARCHIVE = "__RECORD_ARCHIVE__";
|
|
33
121
|
this.duObserver = (action) => {
|
|
122
|
+
var _a;
|
|
34
123
|
switch (action.type) {
|
|
35
124
|
case Action.METADATA_LOADED:
|
|
36
125
|
this._controller.setColumnsDef(this.buildColumnDefs());
|
|
126
|
+
(_a = this._resolveLoading) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
37
127
|
break;
|
|
38
128
|
case Action.LOADING_DATA:
|
|
39
129
|
this._waitingForLoad = true;
|
|
@@ -53,15 +143,22 @@ export default class DataSource {
|
|
|
53
143
|
this._options.onPaginationUpdate(this._dataUnit.getPaginationInfo());
|
|
54
144
|
}
|
|
55
145
|
break;
|
|
56
|
-
case Action.
|
|
146
|
+
case Action.RECORDS_ADDED:
|
|
147
|
+
case Action.RECORDS_COPIED:
|
|
148
|
+
this.handleRecordsAdded();
|
|
149
|
+
break;
|
|
57
150
|
case Action.DATA_SAVED:
|
|
151
|
+
this.handleDataSaved(action);
|
|
152
|
+
break;
|
|
58
153
|
case Action.EDITION_CANCELED:
|
|
154
|
+
this.handleEditionCanceled(action);
|
|
155
|
+
break;
|
|
59
156
|
case Action.DATA_CHANGED:
|
|
60
157
|
case Action.DATA_RESOLVED:
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
this.
|
|
158
|
+
this.handleDataChanged(action);
|
|
159
|
+
break;
|
|
160
|
+
case Action.RECORDS_REMOVED:
|
|
161
|
+
this.handleRefresh(action);
|
|
65
162
|
break;
|
|
66
163
|
case Action.SELECTION_CHANGED:
|
|
67
164
|
case Action.NEXT_SELECTED:
|
|
@@ -71,14 +168,24 @@ export default class DataSource {
|
|
|
71
168
|
case Action.RECORD_LOADED:
|
|
72
169
|
this.updateLoadedRecords(action);
|
|
73
170
|
break;
|
|
171
|
+
case Action.SAVING_CANCELED:
|
|
172
|
+
this.handleSavingCanceled(action);
|
|
173
|
+
break;
|
|
74
174
|
}
|
|
75
175
|
};
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
176
|
+
try {
|
|
177
|
+
this._resolveLoading = resolveLoading;
|
|
178
|
+
this._dataUnit = dataUnit;
|
|
179
|
+
this._controller = controller;
|
|
180
|
+
this._controller.setColumnsDef(this.buildColumnDefs());
|
|
181
|
+
this._options = options;
|
|
182
|
+
this._dataUnit.subscribe(this.duObserver);
|
|
183
|
+
this._dataUnit.addInterceptor(new DataSourceInterceptor(this._controller));
|
|
184
|
+
}
|
|
185
|
+
finally {
|
|
186
|
+
if (this._dataUnit.metadata)
|
|
187
|
+
(_a = this._resolveLoading) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
188
|
+
}
|
|
82
189
|
}
|
|
83
190
|
updateSelection() {
|
|
84
191
|
const selectionInfo = this._dataUnit.getSelectionInfo();
|
|
@@ -92,6 +199,9 @@ export default class DataSource {
|
|
|
92
199
|
setAutoFocus(autoFocus) {
|
|
93
200
|
this._options.autoFocus = autoFocus;
|
|
94
201
|
}
|
|
202
|
+
setEnableGridInsert(enable) {
|
|
203
|
+
this._options.enableGridInsert = enable;
|
|
204
|
+
}
|
|
95
205
|
getRows(params) {
|
|
96
206
|
if (this.needReload(params)) {
|
|
97
207
|
this._lastLoadingParams = params;
|
|
@@ -119,27 +229,37 @@ export default class DataSource {
|
|
|
119
229
|
destroy() {
|
|
120
230
|
this._dataUnit.unsubscribe(this.duObserver);
|
|
121
231
|
}
|
|
232
|
+
registryListeners() {
|
|
233
|
+
var _a, _b;
|
|
234
|
+
(_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.unsubscribe(this.duObserver);
|
|
235
|
+
(_b = this._dataUnit) === null || _b === void 0 ? void 0 : _b.subscribe(this.duObserver);
|
|
236
|
+
}
|
|
122
237
|
buildColumnDefs() {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
this._dataUnit.metadata
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
238
|
+
try {
|
|
239
|
+
const gridConfig = this._controller.getGridConfig() || [];
|
|
240
|
+
const columnDefs = [];
|
|
241
|
+
if (this._dataUnit.metadata) {
|
|
242
|
+
this._dataUnit.metadata.fields.sort((a, b) => {
|
|
243
|
+
const indexA = gridConfig.findIndex(value => value.name === a.name);
|
|
244
|
+
const indexB = gridConfig.findIndex(value => value.name === b.name);
|
|
245
|
+
return indexA - indexB;
|
|
246
|
+
});
|
|
247
|
+
this._dataUnit.metadata.fields.forEach(f => {
|
|
248
|
+
var _a;
|
|
249
|
+
if (f.visible !== false && f.name !== this.RECORD_ARCHIVE) {
|
|
250
|
+
const props = new Map();
|
|
251
|
+
const properties = this._dataUnit.getField(f.name).properties;
|
|
252
|
+
for (const value in properties) {
|
|
253
|
+
props.set(value, properties[value]);
|
|
254
|
+
}
|
|
255
|
+
columnDefs.push({ label: f.label, name: f.name, userInterface: f.userInterface, options: (_a = this._dataUnit.getField(f.name).properties) === null || _a === void 0 ? void 0 : _a.options, props });
|
|
138
256
|
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
return columnDefs;
|
|
260
|
+
}
|
|
261
|
+
catch (error) {
|
|
262
|
+
console.warn(error);
|
|
142
263
|
}
|
|
143
|
-
return columnDefs;
|
|
144
264
|
}
|
|
145
265
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Action } from "@sankhyalabs/core";
|
|
2
2
|
import { DISTINCT_FILTER_NAME_PREFIX, EZ_GRID_LOADING_SOURCE } from "../../../../utils/constants";
|
|
3
|
+
import { DataUnit } from "@sankhyalabs/core";
|
|
3
4
|
export class DataSourceInterceptor {
|
|
4
5
|
constructor(controller) {
|
|
5
6
|
this._controller = controller;
|
|
@@ -11,7 +12,7 @@ export class DataSourceInterceptor {
|
|
|
11
12
|
interceptAction(action) {
|
|
12
13
|
var _a;
|
|
13
14
|
if (action.type === Action.LOADING_DATA) {
|
|
14
|
-
if (EZ_GRID_LOADING_SOURCE !== action.payload.source) {
|
|
15
|
+
if (EZ_GRID_LOADING_SOURCE !== action.payload.source && DataUnit.CHANGING_PAGE_LOADING_SOURCE !== action.payload.source) {
|
|
15
16
|
action.payload.filters = ((_a = action.payload) === null || _a === void 0 ? void 0 : _a.filters) !== undefined ? this.clearColumnFilter(action.payload.filters) : action.payload.filters;
|
|
16
17
|
this._controller.clearFilter();
|
|
17
18
|
}
|
|
@@ -1,53 +1,144 @@
|
|
|
1
|
-
import { UserInterface } from
|
|
2
|
-
import { KeyCode } from "ag-grid-community";
|
|
3
|
-
import { RecordValidationProcessor } from
|
|
4
|
-
import EzCellEditor from
|
|
5
|
-
import EzGridCustomCellEditor from
|
|
6
|
-
import EzGridCustomCellRender from
|
|
1
|
+
import { LockManager, LockManagerOperation, UserInterface } from '@sankhyalabs/core';
|
|
2
|
+
import { KeyCode, } from "@ag-grid-community/core";
|
|
3
|
+
import { RecordValidationProcessor } from '../../../../utils/validators/recordvalidator/RecordValidationProcessor';
|
|
4
|
+
import EzCellEditor from './editor/EzCellEditor';
|
|
5
|
+
import EzGridCustomCellEditor from './components/EzGridCustomCellEditor';
|
|
6
|
+
import EzGridCustomCellRender from './components/EzGridCustomCellRender';
|
|
7
|
+
import { DataBinder } from '../../../../utils';
|
|
7
8
|
export default class GridEditionManager {
|
|
8
|
-
constructor(dataUnit, useEnterLikeTab, recordsValidator, editionIsDisabled, customEditors, customRenders) {
|
|
9
|
+
constructor(dataUnit, useEnterLikeTab, recordsValidator, editionIsDisabled, customEditors, customRenders, enableContinuousInsert, enableGridInsert, lockerId) {
|
|
9
10
|
this._dataUnit = dataUnit;
|
|
10
11
|
this._recordValidationProcessor = new RecordValidationProcessor(this._dataUnit, {
|
|
11
12
|
getRequiredFields: () => this.getRequiredFields(),
|
|
12
|
-
markAsInvalid: () => { },
|
|
13
|
-
getMessageForField: () => null
|
|
13
|
+
markAsInvalid: (invalidField, recordId) => { this.pushInvalidCell(invalidField, recordId); },
|
|
14
|
+
getMessageForField: () => null,
|
|
14
15
|
}, recordsValidator);
|
|
15
16
|
this._useEnterLikeTab = useEnterLikeTab;
|
|
16
17
|
this._editionIsDisabled = editionIsDisabled;
|
|
18
|
+
this._enableContinuousInsert = enableContinuousInsert;
|
|
19
|
+
this._enableGridInsert = enableGridInsert;
|
|
17
20
|
this._customEditors = customEditors;
|
|
18
21
|
this._customRenders = customRenders;
|
|
22
|
+
this._lockerId = lockerId;
|
|
19
23
|
}
|
|
20
24
|
configureGrid(options) {
|
|
21
25
|
this._gridOptions = options;
|
|
22
26
|
options.readOnlyEdit = true;
|
|
23
27
|
options.onCellEditRequest = evt => this.onCellEditRequest(evt);
|
|
28
|
+
options.onCellEditingStarted = async (evt) => {
|
|
29
|
+
var _a;
|
|
30
|
+
if (this._dataUnit.hasNewRecord()) {
|
|
31
|
+
this.handleCellEditingStartedRowAdd(evt);
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
this._lastCellOpened = this._lastCellEdited = { rowIndex: evt.rowIndex, column: evt.column, rowPinned: undefined };
|
|
35
|
+
}
|
|
36
|
+
(_a = this._currentEditLock) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
37
|
+
this._currentEditLock = LockManager.lock(this._lockerId, LockManagerOperation.TASKBAR_CLICK);
|
|
38
|
+
};
|
|
39
|
+
options.onCellEditingStopped = () => {
|
|
40
|
+
var _a;
|
|
41
|
+
(_a = this._currentEditLock) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
42
|
+
};
|
|
24
43
|
options.onCellKeyDown = evt => {
|
|
25
44
|
if (evt.event && evt["column"]) {
|
|
26
45
|
this.onCellKeyDown(evt);
|
|
27
46
|
}
|
|
28
47
|
};
|
|
48
|
+
options.isRowSelectable = (node) => this.isSelectableRow(node);
|
|
49
|
+
options.onCellFocused = () => this.lockFocusWhenAddRow();
|
|
29
50
|
return options;
|
|
30
51
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
52
|
+
updateCurrentEditorGuiValue(updatedRowValue) {
|
|
53
|
+
const editorInstances = this._gridOptions.api.getCellEditorInstances();
|
|
54
|
+
if (!editorInstances || !editorInstances.length)
|
|
55
|
+
return;
|
|
56
|
+
const currentEditor = editorInstances[0];
|
|
57
|
+
const fieldMetadata = currentEditor.getFieldMetadata();
|
|
58
|
+
const fieldName = fieldMetadata.name;
|
|
59
|
+
const value = updatedRowValue[fieldName];
|
|
60
|
+
currentEditor.setGuiValue(value);
|
|
61
|
+
}
|
|
62
|
+
lockFocusWhenAddRow() {
|
|
63
|
+
var _a, _b, _c, _d;
|
|
64
|
+
const api = this._gridOptions.api;
|
|
65
|
+
const newFocusCell = api.getFocusedCell();
|
|
66
|
+
const rowIndex = newFocusCell === null || newFocusCell === void 0 ? void 0 : newFocusCell.rowIndex;
|
|
67
|
+
const recordId = (_b = (_a = this._dataUnit.getAddedRecords()) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.__record__id__;
|
|
68
|
+
const rowNode = api.getRowNode(recordId);
|
|
69
|
+
if (!this._dataUnit.hasNewRecord() || rowIndex == (rowNode === null || rowNode === void 0 ? void 0 : rowNode.rowIndex)) {
|
|
34
70
|
return;
|
|
35
71
|
}
|
|
36
|
-
|
|
72
|
+
const lastCell = (_d = (_c = this._lastCellOpened) !== null && _c !== void 0 ? _c : this._lastCellEdited) !== null && _d !== void 0 ? _d : this._lastCellClicked;
|
|
73
|
+
if ((lastCell === null || lastCell === void 0 ? void 0 : lastCell.rowIndex) < (rowNode === null || rowNode === void 0 ? void 0 : rowNode.rowIndex)) {
|
|
37
74
|
return;
|
|
38
75
|
}
|
|
39
|
-
|
|
40
|
-
if (
|
|
76
|
+
api.clearFocusedCell();
|
|
77
|
+
if (!lastCell || (rowNode === null || rowNode === void 0 ? void 0 : rowNode.rowIndex) == undefined) {
|
|
41
78
|
return;
|
|
42
79
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
80
|
+
lastCell.rowIndex = rowNode === null || rowNode === void 0 ? void 0 : rowNode.rowIndex;
|
|
81
|
+
this.focusOnCell(lastCell);
|
|
82
|
+
}
|
|
83
|
+
handleCellEditingStartedRowAdd(evt) {
|
|
84
|
+
var _a, _b, _c, _d, _e;
|
|
85
|
+
const nodeId = (_a = evt.node) === null || _a === void 0 ? void 0 : _a.id;
|
|
86
|
+
const addedRecordId = (_c = (_b = this._dataUnit.getAddedRecords()) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.__record__id__;
|
|
87
|
+
if (nodeId == addedRecordId) {
|
|
88
|
+
this._lastCellOpened = this._lastCellEdited = { rowIndex: evt.rowIndex, column: evt === null || evt === void 0 ? void 0 : evt.column, rowPinned: undefined };
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
evt.api.stopEditing();
|
|
92
|
+
const rowIndex = (_d = evt.api.getRowNode(addedRecordId)) === null || _d === void 0 ? void 0 : _d.rowIndex;
|
|
93
|
+
this._lastCellOpened = this._lastCellEdited = { rowIndex: rowIndex, column: (_e = this._lastCellEdited) === null || _e === void 0 ? void 0 : _e.column, rowPinned: undefined };
|
|
94
|
+
}
|
|
95
|
+
isSelectableRow(node) {
|
|
96
|
+
if (!this._dataUnit.hasNewRecord()) {
|
|
97
|
+
return true;
|
|
98
|
+
}
|
|
99
|
+
if (!this._dataUnit.isNewRecord(node.id)) {
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
return true;
|
|
103
|
+
}
|
|
104
|
+
canContinuousInsert() {
|
|
105
|
+
var _a;
|
|
106
|
+
return this._enableContinuousInsert && (this._dataUnit.records.length - 1) === ((_a = this._lastCellEdited) === null || _a === void 0 ? void 0 : _a.rowIndex);
|
|
107
|
+
}
|
|
108
|
+
async proceedAutoSave() {
|
|
109
|
+
if (!this._dataUnit.isDirty()) {
|
|
110
|
+
this.saveSuccess();
|
|
111
|
+
return true;
|
|
112
|
+
}
|
|
113
|
+
const currentRecord = this._dataUnit.getSelectedRecord();
|
|
114
|
+
if (currentRecord == undefined) {
|
|
115
|
+
return true;
|
|
116
|
+
}
|
|
117
|
+
this.clearInvalidCells(false);
|
|
118
|
+
try {
|
|
119
|
+
await this._recordValidationProcessor.validate(true);
|
|
120
|
+
await this.saveDataUnit();
|
|
121
|
+
this.saveSuccess();
|
|
122
|
+
return true;
|
|
123
|
+
}
|
|
124
|
+
catch (reason) {
|
|
125
|
+
this.saveFail(reason);
|
|
126
|
+
return false;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
async saveDataUnit() {
|
|
130
|
+
await this._dataUnit.saveData();
|
|
131
|
+
return true;
|
|
132
|
+
}
|
|
133
|
+
async recordValidate() {
|
|
134
|
+
if (!this._dataUnit.isDirty())
|
|
135
|
+
return;
|
|
136
|
+
try {
|
|
137
|
+
this.clearInvalidCells(false);
|
|
138
|
+
await this._recordValidationProcessor.validate(false);
|
|
139
|
+
}
|
|
140
|
+
catch (error) { }
|
|
141
|
+
this._gridOptions.api.refreshCells({ force: true });
|
|
51
142
|
}
|
|
52
143
|
navigateByEnterKey(keyboardEvent) {
|
|
53
144
|
const backwards = keyboardEvent.shiftKey;
|
|
@@ -71,6 +162,13 @@ export default class GridEditionManager {
|
|
|
71
162
|
return { ezCellEditor: EzCellEditor };
|
|
72
163
|
}
|
|
73
164
|
verifyClickToEdition(api, cellClicked) {
|
|
165
|
+
var _a, _b;
|
|
166
|
+
const selectedRecordID = (_a = this._dataUnit.getSelectedRecord()) === null || _a === void 0 ? void 0 : _a.__record__id__;
|
|
167
|
+
if (this._dataUnit.hasNewRecord() && selectedRecordID) {
|
|
168
|
+
const dataUnitRecordIndex = (_b = api.getRowNode(selectedRecordID)) === null || _b === void 0 ? void 0 : _b.rowIndex;
|
|
169
|
+
if (dataUnitRecordIndex != cellClicked.rowIndex)
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
74
172
|
if (this.isSecondClick(cellClicked)) {
|
|
75
173
|
api.startEditingCell({ rowIndex: cellClicked.rowIndex, colKey: cellClicked.column.getColId() });
|
|
76
174
|
}
|
|
@@ -80,6 +178,9 @@ export default class GridEditionManager {
|
|
|
80
178
|
col.cellEditor = 'ezCellEditor';
|
|
81
179
|
col.editable = params => this.canEdit(params);
|
|
82
180
|
col.suppressKeyboardEvent = (params) => {
|
|
181
|
+
if (params.event.key === KeyCode.ESCAPE && params.editing) {
|
|
182
|
+
return this._dataUnit.isDirty();
|
|
183
|
+
}
|
|
83
184
|
return params.event.key === KeyCode.ENTER;
|
|
84
185
|
};
|
|
85
186
|
col.cellEditorSelector = (params) => {
|
|
@@ -109,10 +210,21 @@ export default class GridEditionManager {
|
|
|
109
210
|
return col;
|
|
110
211
|
}
|
|
111
212
|
getRequiredFields() {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
213
|
+
const formRequiredFields = this.getFormRequiredFields();
|
|
214
|
+
return this._gridOptions.columnApi.getAllDisplayedColumns()
|
|
215
|
+
.filter(column => {
|
|
216
|
+
const fieldDefinition = this._dataUnit.getField(column.getColId());
|
|
217
|
+
return (fieldDefinition && fieldDefinition.required) || formRequiredFields.includes(column.getColId());
|
|
218
|
+
})
|
|
219
|
+
.map(column => column.getColId());
|
|
220
|
+
}
|
|
221
|
+
getFormRequiredFields() {
|
|
222
|
+
const formRequiredFields = [];
|
|
223
|
+
const dataBinders = DataBinder.getDataBindersByDataUnit(this._dataUnit);
|
|
224
|
+
dataBinders.forEach(dataBinder => {
|
|
225
|
+
formRequiredFields.push(...dataBinder.getFormRequiredFields());
|
|
226
|
+
});
|
|
227
|
+
return formRequiredFields;
|
|
116
228
|
}
|
|
117
229
|
saveSuccess() {
|
|
118
230
|
var _a;
|
|
@@ -125,18 +237,20 @@ export default class GridEditionManager {
|
|
|
125
237
|
this._isGridEdition = false;
|
|
126
238
|
}
|
|
127
239
|
saveFail(reason) {
|
|
128
|
-
|
|
240
|
+
var _a;
|
|
241
|
+
this.focusOnCell((_a = this._lastCellOpened) !== null && _a !== void 0 ? _a : this._lastCellEdited);
|
|
129
242
|
this._isGridEdition = false;
|
|
130
243
|
if (reason) {
|
|
131
|
-
|
|
244
|
+
throw reason;
|
|
132
245
|
}
|
|
133
246
|
}
|
|
134
247
|
focusOnCell(cell) {
|
|
248
|
+
var _a;
|
|
135
249
|
if (cell == undefined) {
|
|
136
250
|
return;
|
|
137
251
|
}
|
|
138
252
|
const { rowIndex, column } = cell;
|
|
139
|
-
this._gridOptions.api.getDisplayedRowAtIndex(rowIndex).setSelected(true, true);
|
|
253
|
+
(_a = this._gridOptions.api.getDisplayedRowAtIndex(rowIndex)) === null || _a === void 0 ? void 0 : _a.setSelected(true, true);
|
|
140
254
|
this._gridOptions.api.clearRangeSelection();
|
|
141
255
|
this._gridOptions.api.addCellRange({ rowStartIndex: rowIndex, rowEndIndex: rowIndex, columns: [column] });
|
|
142
256
|
this._gridOptions.api.startEditingCell({ colKey: column.getColId(), rowIndex });
|
|
@@ -176,9 +290,10 @@ export default class GridEditionManager {
|
|
|
176
290
|
}
|
|
177
291
|
}
|
|
178
292
|
else {
|
|
293
|
+
const actualRowIndex = rowIndex;
|
|
179
294
|
rowIndex = rowIndex + 1;
|
|
180
295
|
if (rowIndex >= this._dataUnit.records.length) {
|
|
181
|
-
rowIndex = 0;
|
|
296
|
+
rowIndex = !this._enableGridInsert ? 0 : actualRowIndex;
|
|
182
297
|
}
|
|
183
298
|
}
|
|
184
299
|
this._targetEditionCell = new TargetEdition(rowIndex, column, true);
|
|
@@ -191,6 +306,9 @@ export default class GridEditionManager {
|
|
|
191
306
|
this.moveEditionVertically(api, 1);
|
|
192
307
|
}
|
|
193
308
|
moveEditionVertically(api, offset) {
|
|
309
|
+
if (this._dataUnit.hasNewRecord() && this._isGridEdition) {
|
|
310
|
+
return;
|
|
311
|
+
}
|
|
194
312
|
const editionCell = api.getEditingCells()[0];
|
|
195
313
|
if (!editionCell) {
|
|
196
314
|
return;
|
|
@@ -235,28 +353,87 @@ export default class GridEditionManager {
|
|
|
235
353
|
return true;
|
|
236
354
|
}
|
|
237
355
|
onCellEditRequest(event) {
|
|
238
|
-
|
|
356
|
+
var _a;
|
|
239
357
|
const value = event.newValue;
|
|
240
|
-
if (event.oldValue
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
358
|
+
if (event.oldValue == value) {
|
|
359
|
+
(_a = this._currentEditLock) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
360
|
+
return;
|
|
361
|
+
}
|
|
362
|
+
if (value instanceof Promise) {
|
|
363
|
+
this.handlePromiseValue(event, value);
|
|
364
|
+
return;
|
|
365
|
+
}
|
|
366
|
+
this.updateCellValue(event, value);
|
|
367
|
+
}
|
|
368
|
+
async handlePromiseValue(event, value) {
|
|
369
|
+
const fieldName = event.colDef.field;
|
|
370
|
+
const fieldDescriptor = this._dataUnit.getField(event.colDef.colId);
|
|
371
|
+
const initialValue = (fieldDescriptor === null || fieldDescriptor === void 0 ? void 0 : fieldDescriptor.userInterface) === UserInterface.SEARCH ? value : event.oldValue;
|
|
372
|
+
event.node.setData(Object.assign(Object.assign({}, event.data), { [fieldName]: initialValue }));
|
|
373
|
+
const resolved = await value;
|
|
374
|
+
return this.updateCellValue(event, resolved);
|
|
375
|
+
}
|
|
376
|
+
updateCellValue(event, newValue) {
|
|
377
|
+
var _a;
|
|
378
|
+
const fieldName = event.colDef.field;
|
|
379
|
+
event.node.setData(Object.assign(Object.assign({}, event.data), { [fieldName]: newValue }));
|
|
380
|
+
(_a = this._currentEditLock) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
381
|
+
if (event.oldValue !== newValue) {
|
|
249
382
|
this._isGridEdition = true;
|
|
250
|
-
this._dataUnit.setFieldValue(fieldName,
|
|
383
|
+
this._dataUnit.setFieldValue(fieldName, newValue, [event.data.__record__id__], { suppressCreateNewRecord: true });
|
|
251
384
|
this._lastCellEdited = { rowIndex: event.rowIndex, column: event.column, rowPinned: undefined };
|
|
252
385
|
}
|
|
253
386
|
}
|
|
254
387
|
setCellEditors(customEditors) {
|
|
388
|
+
var _a;
|
|
255
389
|
this._customEditors = customEditors;
|
|
390
|
+
(_a = this._gridOptions) === null || _a === void 0 ? void 0 : _a.api.stopEditing();
|
|
256
391
|
}
|
|
257
392
|
setCellRenders(customRenders) {
|
|
258
393
|
this._customRenders = customRenders;
|
|
259
394
|
}
|
|
395
|
+
pushInvalidCell(invalidField, recordId) {
|
|
396
|
+
this._invalidCells.push({ field: invalidField, recordId });
|
|
397
|
+
this._nextInvalidCell = this._invalidCells[0];
|
|
398
|
+
}
|
|
399
|
+
getInvalidCells() {
|
|
400
|
+
return this._invalidCells;
|
|
401
|
+
}
|
|
402
|
+
getNextInvalidCell() {
|
|
403
|
+
return this._nextInvalidCell;
|
|
404
|
+
}
|
|
405
|
+
async processContinuousInsert() {
|
|
406
|
+
if (!this.canContinuousInsert())
|
|
407
|
+
return;
|
|
408
|
+
this._dataUnit.addRecord();
|
|
409
|
+
}
|
|
410
|
+
clearInvalidCells(stopEdition) {
|
|
411
|
+
this._invalidCells = [];
|
|
412
|
+
this._nextInvalidCell = undefined;
|
|
413
|
+
if (stopEdition) {
|
|
414
|
+
this._isGridEdition = false;
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
setEnableContinuousInsert(enable) {
|
|
418
|
+
this._enableContinuousInsert = enable;
|
|
419
|
+
}
|
|
420
|
+
hasInvalidField(fieldName, recordId) {
|
|
421
|
+
if (!this.hasInvalidCell())
|
|
422
|
+
return false;
|
|
423
|
+
this._nextInvalidCell = this._invalidCells[0];
|
|
424
|
+
const containsFieldName = this._nextInvalidCell.field.name === fieldName;
|
|
425
|
+
const containsRecordId = this._nextInvalidCell.recordId === recordId;
|
|
426
|
+
return containsFieldName && containsRecordId;
|
|
427
|
+
}
|
|
428
|
+
hasInvalidCell() {
|
|
429
|
+
var _a, _b, _c;
|
|
430
|
+
const hasInvalidCell = ((_a = this._invalidCells) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
431
|
+
const hasField = (_b = this._invalidCells) === null || _b === void 0 ? void 0 : _b.filter(invalidCell => { invalidCell.field; });
|
|
432
|
+
const hasRecordId = (_c = this._invalidCells) === null || _c === void 0 ? void 0 : _c.filter(invalidCell => { invalidCell.recordId; });
|
|
433
|
+
if (!hasInvalidCell || !hasField || !hasRecordId)
|
|
434
|
+
return false;
|
|
435
|
+
return true;
|
|
436
|
+
}
|
|
260
437
|
}
|
|
261
438
|
class TargetEdition {
|
|
262
439
|
constructor(rowIndex, column, backwards) {
|
package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomCellEditor.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { HTMLBuilder } from "@sankhyalabs/core";
|
|
2
2
|
import { CustomEditorSource } from "../../../../../utils/customEditor/interfaces/ICustomEditor";
|
|
3
3
|
import EzCellEditor from "../editor/EzCellEditor";
|
|
4
|
+
import { getViewPortHeight } from "../editor/GridEditorUtils";
|
|
5
|
+
import FocusResolver from "../../../../../utils/FocusResolver";
|
|
4
6
|
export default class EzGridCustomCellEditor extends EzCellEditor {
|
|
5
7
|
init(params) {
|
|
6
8
|
var _a, _b;
|
|
@@ -11,6 +13,8 @@ export default class EzGridCustomCellEditor extends EzCellEditor {
|
|
|
11
13
|
this._defaultGui = this.getDefaultGui();
|
|
12
14
|
const fieldMetadata = super.getFieldMetadata();
|
|
13
15
|
this._params = {
|
|
16
|
+
cellPossition: getViewPortHeight(params.eGridCell),
|
|
17
|
+
eGridCell: params.eGridCell,
|
|
14
18
|
value: params.value,
|
|
15
19
|
charPress: params.charPress,
|
|
16
20
|
currentEditor: this._defaultGui,
|
|
@@ -48,12 +52,24 @@ export default class EzGridCustomCellEditor extends EzCellEditor {
|
|
|
48
52
|
const element = HTMLBuilder.parseElement(editorElement);
|
|
49
53
|
return element;
|
|
50
54
|
}
|
|
55
|
+
this._customGui = editorElement;
|
|
51
56
|
return editorElement;
|
|
52
57
|
}
|
|
53
58
|
setValue(value) {
|
|
54
59
|
this._value = value;
|
|
55
60
|
}
|
|
56
61
|
getValue() {
|
|
62
|
+
var _a, _b;
|
|
63
|
+
if ((_a = this._customGui) === null || _a === void 0 ? void 0 : _a.getValue)
|
|
64
|
+
return this._customGui.getValue();
|
|
65
|
+
if ((_b = this._customGui) === null || _b === void 0 ? void 0 : _b.hasAttribute('value'))
|
|
66
|
+
return this._customGui.value;
|
|
57
67
|
return this._value;
|
|
58
68
|
}
|
|
69
|
+
afterGuiAttached() {
|
|
70
|
+
this.focusIn();
|
|
71
|
+
}
|
|
72
|
+
focusIn() {
|
|
73
|
+
FocusResolver.resolveFocus(this._customGui);
|
|
74
|
+
}
|
|
59
75
|
}
|
package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomHeader.js
CHANGED
|
@@ -6,7 +6,7 @@ export class EzGridCustomHeader {
|
|
|
6
6
|
this.element.classList.add('ag-cell-label-container');
|
|
7
7
|
this.element.setAttribute('title', (_a = this.params.tooltip) !== null && _a !== void 0 ? _a : '');
|
|
8
8
|
this.element.innerHTML = `
|
|
9
|
-
<div class='ez-flex ez-flex--justify-between'>
|
|
9
|
+
<div id='filter-column-${agParams.column.getColId()}-${agParams.context.dataUnit.dataUnitId}' class='ez-flex ez-flex--justify-between'>
|
|
10
10
|
<i id='ez-grid-filter-icon' class='ez-icon-filter' style='color:#008561'></i>
|
|
11
11
|
<i id='ez-grid-menu-icon' class='ez-icon-dots-vertical'></i>
|
|
12
12
|
</div>
|