@sankhyalabs/ezui 5.22.0-dev.11 → 5.22.0-dev.110
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-c2060474.js +446 -0
- package/dist/cjs/FocusResolver-885f2173.js +35 -0
- package/dist/cjs/FormLayout-c2451c7f.js +7 -0
- package/dist/cjs/{constants-2714478b.js → constants-569271bc.js} +4 -0
- package/dist/cjs/ez-actions-button.cjs.entry.js +6 -4
- package/dist/cjs/ez-badge.cjs.entry.js +14 -2
- package/dist/cjs/ez-button.cjs.entry.js +11 -5
- package/dist/cjs/ez-card-item_2.cjs.entry.js +270 -0
- package/dist/cjs/ez-check.cjs.entry.js +1 -1
- package/dist/cjs/ez-chip.cjs.entry.js +1 -1
- package/dist/cjs/ez-collapsible-box.cjs.entry.js +3 -2
- package/dist/cjs/ez-combo-box-list_3.cjs.entry.js +388 -0
- package/dist/cjs/ez-combo-box.cjs.entry.js +78 -156
- package/dist/cjs/ez-date-input.cjs.entry.js +15 -19
- package/dist/cjs/ez-date-time-input.cjs.entry.js +14 -20
- 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 +41 -27
- package/dist/cjs/ez-form.cjs.entry.js +34 -327
- package/dist/cjs/ez-grid.cjs.entry.js +15147 -69779
- 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 +13 -4
- 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-plus_3.cjs.entry.js +209 -0
- package/dist/cjs/ez-popup.cjs.entry.js +25 -3
- package/dist/cjs/ez-scroller_2.cjs.entry.js +3 -3
- package/dist/cjs/ez-search-plus.cjs.entry.js +369 -0
- package/dist/cjs/ez-search-result-list.cjs.entry.js +98 -0
- package/dist/cjs/ez-search.cjs.entry.js +123 -191
- 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 +8 -4
- 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 +85 -16
- package/dist/cjs/ez-time-input.cjs.entry.js +7 -1
- package/dist/cjs/ez-tooltip.cjs.entry.js +130 -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/floating-ui.dom.esm-017acce4.js +1404 -0
- package/dist/cjs/index-a7b0c73d.js +30 -10
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/searchFormatters-b7e1ed1e.js +23 -0
- package/dist/cjs/{ICustomRender-6fafffce.js → types-6a5df0c7.js} +8 -0
- package/dist/collection/collection-manifest.json +20 -2
- package/dist/collection/components/ez-actions-button/ez-actions-button.js +3 -2
- package/dist/collection/components/ez-badge/ez-badge.css +12 -1
- package/dist/collection/components/ez-badge/ez-badge.js +31 -1
- package/dist/collection/components/ez-button/ez-button.css +24 -14
- package/dist/collection/components/ez-button/ez-button.js +12 -6
- package/dist/collection/components/ez-card-item/ez-card-item.css +58 -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-chip/ez-chip.css +5 -1
- 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 +426 -0
- package/dist/collection/components/ez-combo-box/ez-combo-box.css +8 -247
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +121 -165
- package/dist/collection/components/ez-date-input/ez-date-input.css +1 -1
- package/dist/collection/components/ez-date-input/ez-date-input.js +40 -19
- 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 +39 -20
- 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 +32 -4
- 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 +13 -2
- package/dist/collection/components/ez-form-view/ez-form-view.js +21 -2
- package/dist/collection/components/ez-form-view/fieldbuilder/FieldBuilder.js +5 -2
- 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 +1 -1
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/SearchInputPlus.tpl.js +6 -0
- 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 +387 -73
- package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js +170 -33
- package/dist/collection/components/ez-grid/controller/ag-grid/DataSourceInterceptor.js +2 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/GridEditionManager.js +244 -43
- 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 +10 -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/SearchPlus.tpl.js +15 -0
- 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 +375 -12
- 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-grid/utils/ColumnFilterManager.js +7 -54
- package/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource.js +20 -4
- 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 +14 -5
- 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 +434 -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 +527 -0
- package/dist/collection/components/ez-popup/ez-popup.css +8 -3
- package/dist/collection/components/ez-popup/ez-popup.js +44 -4
- package/dist/collection/components/ez-scroller/ez-scroller.css +4 -0
- package/dist/collection/components/ez-search/ez-search.css +2 -210
- package/dist/collection/components/ez-search/ez-search.js +205 -204
- package/dist/collection/components/ez-search/subcomponent/search-list/search-list.css +227 -0
- package/dist/collection/components/ez-search/subcomponent/search-list/search-list.js +289 -0
- package/dist/collection/components/ez-search/utils/searchFormatters.js +18 -0
- package/dist/collection/components/ez-search-plus/ez-search-plus.css +373 -0
- package/dist/collection/components/ez-search-plus/ez-search-plus.js +952 -0
- package/dist/collection/components/ez-search-plus/subcomponent/ez-search-result-list/ez-search-result-list.css +227 -0
- package/dist/collection/components/ez-search-plus/subcomponent/ez-search-result-list/ez-search-result-list.js +279 -0
- 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 +124 -93
- package/dist/collection/components/ez-text-input/ez-text-input.js +145 -15
- package/dist/collection/components/ez-time-input/ez-time-input.js +24 -0
- package/dist/collection/components/ez-tooltip/ez-tooltip.css +60 -0
- package/dist/collection/components/ez-tooltip/ez-tooltip.js +287 -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/constants.js +2 -0
- package/dist/collection/utils/form/DataBinder.js +25 -9
- package/dist/collection/utils/form/FormMetadata.js +2 -1
- package/dist/collection/utils/form/interfaces/FormLayout.js +5 -0
- package/dist/collection/utils/form/interfaces/index.js +1 -1
- package/dist/collection/utils/index.js +2 -0
- package/dist/collection/utils/interfaces/AbstractFieldMetadata.js +1 -1
- package/dist/collection/utils/search/types.js +7 -0
- 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 +48 -0
- package/dist/custom-elements/index.js +21426 -72860
- package/dist/esm/{CSSVarsUtils-71ce76be.js → CSSVarsUtils-acba92d7.js} +1 -0
- package/dist/esm/DataBinder-89946126.js +442 -0
- package/dist/esm/FocusResolver-1ccbf850.js +33 -0
- package/dist/esm/FormLayout-54092963.js +7 -0
- package/dist/esm/constants-b036528f.js +7 -0
- package/dist/esm/ez-actions-button.entry.js +6 -4
- package/dist/esm/ez-badge.entry.js +14 -2
- package/dist/esm/ez-button.entry.js +11 -5
- package/dist/esm/ez-card-item_2.entry.js +265 -0
- package/dist/esm/ez-check.entry.js +1 -1
- package/dist/esm/ez-chip.entry.js +1 -1
- package/dist/esm/ez-collapsible-box.entry.js +3 -2
- package/dist/esm/ez-combo-box-list_3.entry.js +382 -0
- package/dist/esm/ez-combo-box.entry.js +79 -157
- package/dist/esm/ez-date-input.entry.js +15 -19
- package/dist/esm/ez-date-time-input.entry.js +14 -20
- 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 +42 -28
- package/dist/esm/ez-form.entry.js +33 -326
- package/dist/esm/ez-grid.entry.js +15146 -69778
- 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 +13 -4
- 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-plus_3.entry.js +203 -0
- package/dist/esm/ez-popup.entry.js +25 -3
- package/dist/esm/ez-scroller_2.entry.js +3 -3
- package/dist/esm/ez-search-plus.entry.js +365 -0
- package/dist/esm/ez-search-result-list.entry.js +94 -0
- package/dist/esm/ez-search.entry.js +124 -192
- 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 +8 -4
- 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 +85 -16
- package/dist/esm/ez-time-input.entry.js +7 -1
- package/dist/esm/ez-tooltip.entry.js +126 -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/floating-ui.dom.esm-5d3da819.js +1398 -0
- package/dist/esm/index-baa5e267.js +30 -10
- package/dist/esm/loader.js +1 -1
- package/dist/esm/searchFormatters-8229207e.js +20 -0
- package/dist/esm/{ICustomRender-875b5a40.js → types-6f6b2650.js} +9 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-0bffeffc.entry.js +1 -0
- package/dist/ezui/p-0fa52b0f.entry.js +1 -0
- package/dist/ezui/p-173f68ea.js +1 -0
- package/dist/ezui/p-17de16e5.entry.js +1 -0
- package/dist/ezui/p-1a060042.entry.js +1 -0
- package/dist/ezui/p-1ec8bdd2.entry.js +309 -0
- package/dist/ezui/p-20c024f7.entry.js +1 -0
- package/dist/ezui/p-248d4f54.entry.js +1 -0
- package/dist/ezui/p-2872fd16.entry.js +1 -0
- package/dist/ezui/p-288631d1.entry.js +1 -0
- package/dist/ezui/p-2f45506d.entry.js +1 -0
- package/dist/ezui/p-3176a6ef.entry.js +1 -0
- package/dist/ezui/p-31b71e50.entry.js +1 -0
- package/dist/ezui/p-40a60148.js +1 -0
- package/dist/ezui/p-4e0628a7.entry.js +1 -0
- package/dist/ezui/p-56fe5341.entry.js +1 -0
- package/dist/ezui/p-5895e687.js +1 -0
- package/dist/ezui/p-5a14f506.entry.js +1 -0
- package/dist/ezui/p-5ec0ae79.entry.js +1 -0
- package/dist/ezui/p-5eea9886.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-81145609.entry.js +1 -0
- package/dist/ezui/p-84b1c99e.entry.js +1 -0
- package/dist/ezui/p-8ac8093c.entry.js +1 -0
- package/dist/ezui/p-9142b27a.entry.js +1 -0
- package/dist/ezui/p-9567b31a.entry.js +1 -0
- package/dist/ezui/p-9f22e1dc.entry.js +1 -0
- package/dist/ezui/p-a4cee65d.entry.js +1 -0
- package/dist/ezui/p-a64cfcfc.js +1 -0
- package/dist/ezui/p-bf9dec89.entry.js +1 -0
- package/dist/ezui/p-c1527804.entry.js +1 -0
- package/dist/ezui/p-c5df78be.entry.js +1 -0
- package/dist/ezui/p-cd07f8be.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-17be134a.entry.js → p-e06a9886.entry.js} +1 -1
- package/dist/ezui/p-e07e4671.js +1 -0
- package/dist/ezui/p-e3544d23.entry.js +1 -0
- package/dist/ezui/p-e6a9041d.entry.js +1 -0
- package/dist/ezui/p-e75c7a23.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-ecaac11f.entry.js +1 -0
- package/dist/ezui/p-f4861c6a.entry.js +1 -0
- package/dist/ezui/p-f5a30e35.entry.js +1 -0
- package/dist/ezui/p-fa6732f2.entry.js +1 -0
- package/dist/types/components/ez-badge/ez-badge.d.ts +5 -0
- package/dist/types/components/ez-button/ez-button.d.ts +2 -1
- package/dist/types/components/ez-calendar/ez-calendar.d.ts +3 -3
- 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 +15 -15
- package/dist/types/components/ez-date-input/ez-date-input.d.ts +8 -3
- package/dist/types/components/ez-date-time-input/ez-date-time-input.d.ts +8 -3
- 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/ez-form.d.ts +5 -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/ez-form-view.d.ts +4 -0
- package/dist/types/components/ez-form-view/fieldbuilder/templates/DateInput.tpl.d.ts +2 -1
- package/dist/types/components/ez-form-view/fieldbuilder/templates/SearchInputPlus.tpl.d.ts +2 -0
- 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 +75 -4
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +42 -6
- package/dist/types/components/ez-grid/controller/ag-grid/DataSource.d.ts +26 -2
- package/dist/types/components/ez-grid/controller/ag-grid/GridEditionManager.d.ts +34 -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/editor/templates/SearchPlus.tpl.d.ts +3 -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 +59 -1
- package/dist/types/components/ez-grid/subcomponents/filter-column.d.ts +0 -11
- package/dist/types/components/ez-grid/utils/ColumnFilterManager.d.ts +1 -1
- package/dist/types/components/ez-grid/utils/InMemoryFilterColumnDataSource.d.ts +3 -0
- 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 +74 -0
- package/dist/types/components/ez-popover-plus/subcomponent/ez-popover-core.d.ts +91 -0
- package/dist/types/components/ez-popup/ez-popup.d.ts +8 -1
- package/dist/types/components/ez-search/ez-search.d.ts +32 -18
- package/dist/types/components/ez-search/subcomponent/search-list/search-list.d.ts +23 -0
- package/dist/types/components/ez-search/utils/searchFormatters.d.ts +2 -0
- package/dist/types/components/ez-search-plus/ez-search-plus.d.ts +184 -0
- package/dist/types/components/ez-search-plus/subcomponent/ez-search-result-list/ez-search-result-list.d.ts +26 -0
- 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 +21 -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 +53 -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 +1162 -72
- package/dist/types/utils/FocusResolver.d.ts +5 -0
- package/dist/types/utils/constants.d.ts +2 -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/form/interfaces/FormLayout.d.ts +4 -0
- package/dist/types/utils/form/interfaces/index.d.ts +1 -0
- package/dist/types/utils/index.d.ts +2 -0
- package/dist/types/utils/search/types.d.ts +12 -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 +62 -54
- package/react/components.js +8 -0
- package/react/components.js.map +1 -1
- package/react/react-component-lib/createComponent.d.ts +1 -1
- package/react/react-component-lib/createComponent.js.map +1 -1
- package/react/react-component-lib/createOverlayComponent.js.map +1 -1
- package/react/react-component-lib/interfaces.js +1 -0
- package/react/react-component-lib/utils/attachProps.d.ts +1 -1
- package/react/react-component-lib/utils/attachProps.js.map +1 -1
- package/react/react-component-lib/utils/dev.js.map +1 -1
- package/react/react-component-lib/utils/index.d.ts +2 -2
- package/react/react-component-lib/utils/index.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/constants-4e0d35b7.js +0 -5
- 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-05e1f4e7.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-33286e5f.entry.js +0 -1
- 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-4607fb89.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-650e4b6d.entry.js +0 -1
- package/dist/ezui/p-784fe207.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-84e439b9.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-8d4d90ec.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-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-cdc472cc.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
|
@@ -1,7 +1,94 @@
|
|
|
1
|
-
import { Action, ObjectUtils } from '@sankhyalabs/core';
|
|
2
|
-
import { EZ_GRID_LOADING_SOURCE } from "../../../../utils/constants";
|
|
1
|
+
import { Action, ObjectUtils, UserInterface } from '@sankhyalabs/core';
|
|
2
|
+
import { EZ_GRID_LOADING_SOURCE, PRESENTATION_COL_ID_PROP_NAME, PRESENTATION_FROM_COL_PROP_NAME } 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,54 @@ 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, _b;
|
|
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
|
+
const col = { 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 };
|
|
256
|
+
columnDefs.push(col);
|
|
257
|
+
if (f.userInterface === UserInterface.SEARCHPLUS && ((_b = f.properties) === null || _b === void 0 ? void 0 : _b.DESCRIPTIONFIELD)) {
|
|
258
|
+
const descriptionCol = this.buildDescriptionColumn(f);
|
|
259
|
+
columnDefs.push(descriptionCol);
|
|
260
|
+
f.properties[PRESENTATION_COL_ID_PROP_NAME] = descriptionCol.name;
|
|
261
|
+
}
|
|
138
262
|
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
return columnDefs;
|
|
266
|
+
}
|
|
267
|
+
catch (error) {
|
|
268
|
+
console.warn(error);
|
|
142
269
|
}
|
|
143
|
-
|
|
270
|
+
}
|
|
271
|
+
buildDescriptionColumn(field) {
|
|
272
|
+
var _a, _b, _c, _d;
|
|
273
|
+
const props = new Map();
|
|
274
|
+
props.set(PRESENTATION_FROM_COL_PROP_NAME, field.name);
|
|
275
|
+
return {
|
|
276
|
+
label: `${(_a = field.properties) === null || _a === void 0 ? void 0 : _a.DESCRIPTIONFIELDLABEL} (${(_b = field.properties) === null || _b === void 0 ? void 0 : _b.DESCRIPTIONENTITY})`,
|
|
277
|
+
name: `${(_c = field.properties) === null || _c === void 0 ? void 0 : _c.ENTITYNAME}.${(_d = field.properties) === null || _d === void 0 ? void 0 : _d.DESCRIPTIONFIELD}`,
|
|
278
|
+
userInterface: UserInterface.SHORTTEXT,
|
|
279
|
+
props
|
|
280
|
+
};
|
|
144
281
|
}
|
|
145
282
|
}
|
|
@@ -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,152 @@
|
|
|
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, StringUtils, 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';
|
|
8
|
+
import { PRESENTATION_COL_ID_PROP_NAME } from '../../../../utils/constants';
|
|
7
9
|
export default class GridEditionManager {
|
|
8
|
-
constructor(dataUnit, useEnterLikeTab, recordsValidator, editionIsDisabled, customEditors, customRenders) {
|
|
10
|
+
constructor(dataUnit, useEnterLikeTab, recordsValidator, editionIsDisabled, customEditors, customRenders, enableContinuousInsert, enableGridInsert, lockerId) {
|
|
11
|
+
this._inProgressChanges = [];
|
|
9
12
|
this._dataUnit = dataUnit;
|
|
10
13
|
this._recordValidationProcessor = new RecordValidationProcessor(this._dataUnit, {
|
|
11
14
|
getRequiredFields: () => this.getRequiredFields(),
|
|
12
|
-
markAsInvalid: () => { },
|
|
13
|
-
getMessageForField: () => null
|
|
15
|
+
markAsInvalid: (invalidField, recordId) => { this.pushInvalidCell(invalidField, recordId); },
|
|
16
|
+
getMessageForField: () => null,
|
|
14
17
|
}, recordsValidator);
|
|
15
18
|
this._useEnterLikeTab = useEnterLikeTab;
|
|
16
19
|
this._editionIsDisabled = editionIsDisabled;
|
|
20
|
+
this._enableContinuousInsert = enableContinuousInsert;
|
|
21
|
+
this._enableGridInsert = enableGridInsert;
|
|
17
22
|
this._customEditors = customEditors;
|
|
18
23
|
this._customRenders = customRenders;
|
|
24
|
+
this._lockerId = lockerId;
|
|
19
25
|
}
|
|
20
26
|
configureGrid(options) {
|
|
21
27
|
this._gridOptions = options;
|
|
22
28
|
options.readOnlyEdit = true;
|
|
23
29
|
options.onCellEditRequest = evt => this.onCellEditRequest(evt);
|
|
30
|
+
options.onCellEditingStarted = async (evt) => {
|
|
31
|
+
var _a;
|
|
32
|
+
if (this._dataUnit.hasNewRecord()) {
|
|
33
|
+
this.handleCellEditingStartedRowAdd(evt);
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
this._lastCellOpened = this._lastCellEdited = { rowIndex: evt.rowIndex, column: evt.column, rowPinned: undefined };
|
|
37
|
+
}
|
|
38
|
+
(_a = this._currentEditLock) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
39
|
+
this._currentEditLock = LockManager.lock(this._lockerId, LockManagerOperation.TASKBAR_CLICK);
|
|
40
|
+
};
|
|
41
|
+
options.onCellEditingStopped = () => {
|
|
42
|
+
var _a;
|
|
43
|
+
(_a = this._currentEditLock) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
44
|
+
};
|
|
24
45
|
options.onCellKeyDown = evt => {
|
|
25
46
|
if (evt.event && evt["column"]) {
|
|
26
47
|
this.onCellKeyDown(evt);
|
|
27
48
|
}
|
|
28
49
|
};
|
|
50
|
+
options.isRowSelectable = (node) => this.isSelectableRow(node);
|
|
51
|
+
options.onCellFocused = () => this.lockFocusWhenAddRow();
|
|
29
52
|
return options;
|
|
30
53
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
54
|
+
updateCurrentEditorGuiValue(updatedRowValue) {
|
|
55
|
+
const editorInstances = this._gridOptions.api.getCellEditorInstances();
|
|
56
|
+
if (!editorInstances || !editorInstances.length)
|
|
57
|
+
return;
|
|
58
|
+
const currentEditor = editorInstances[0];
|
|
59
|
+
const fieldMetadata = currentEditor.getFieldMetadata();
|
|
60
|
+
const fieldName = fieldMetadata.name;
|
|
61
|
+
const value = updatedRowValue[fieldName];
|
|
62
|
+
currentEditor.setGuiValue(value);
|
|
63
|
+
}
|
|
64
|
+
lockFocusWhenAddRow() {
|
|
65
|
+
var _a, _b, _c, _d;
|
|
66
|
+
const api = this._gridOptions.api;
|
|
67
|
+
const newFocusCell = api.getFocusedCell();
|
|
68
|
+
const rowIndex = newFocusCell === null || newFocusCell === void 0 ? void 0 : newFocusCell.rowIndex;
|
|
69
|
+
const recordId = (_b = (_a = this._dataUnit.getAddedRecords()) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.__record__id__;
|
|
70
|
+
const rowNode = api.getRowNode(recordId);
|
|
71
|
+
if (!this._dataUnit.hasNewRecord() || rowIndex == (rowNode === null || rowNode === void 0 ? void 0 : rowNode.rowIndex)) {
|
|
34
72
|
return;
|
|
35
73
|
}
|
|
36
|
-
|
|
74
|
+
const lastCell = (_d = (_c = this._lastCellOpened) !== null && _c !== void 0 ? _c : this._lastCellEdited) !== null && _d !== void 0 ? _d : this._lastCellClicked;
|
|
75
|
+
if ((lastCell === null || lastCell === void 0 ? void 0 : lastCell.rowIndex) < (rowNode === null || rowNode === void 0 ? void 0 : rowNode.rowIndex)) {
|
|
37
76
|
return;
|
|
38
77
|
}
|
|
39
|
-
|
|
40
|
-
if (
|
|
78
|
+
api.clearFocusedCell();
|
|
79
|
+
if (!lastCell || (rowNode === null || rowNode === void 0 ? void 0 : rowNode.rowIndex) == undefined) {
|
|
41
80
|
return;
|
|
42
81
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
82
|
+
lastCell.rowIndex = rowNode === null || rowNode === void 0 ? void 0 : rowNode.rowIndex;
|
|
83
|
+
this.focusOnCell(lastCell);
|
|
84
|
+
}
|
|
85
|
+
handleCellEditingStartedRowAdd(evt) {
|
|
86
|
+
var _a, _b, _c, _d, _e;
|
|
87
|
+
const nodeId = (_a = evt.node) === null || _a === void 0 ? void 0 : _a.id;
|
|
88
|
+
const addedRecordId = (_c = (_b = this._dataUnit.getAddedRecords()) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.__record__id__;
|
|
89
|
+
if (nodeId == addedRecordId) {
|
|
90
|
+
this._lastCellOpened = this._lastCellEdited = { rowIndex: evt.rowIndex, column: evt === null || evt === void 0 ? void 0 : evt.column, rowPinned: undefined };
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
evt.api.stopEditing();
|
|
94
|
+
const rowIndex = (_d = evt.api.getRowNode(addedRecordId)) === null || _d === void 0 ? void 0 : _d.rowIndex;
|
|
95
|
+
this._lastCellOpened = this._lastCellEdited = { rowIndex: rowIndex, column: (_e = this._lastCellEdited) === null || _e === void 0 ? void 0 : _e.column, rowPinned: undefined };
|
|
96
|
+
}
|
|
97
|
+
isSelectableRow(node) {
|
|
98
|
+
if (!this._dataUnit.hasNewRecord()) {
|
|
99
|
+
return true;
|
|
100
|
+
}
|
|
101
|
+
if (!this._dataUnit.isNewRecord(node.id)) {
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
104
|
+
return true;
|
|
105
|
+
}
|
|
106
|
+
canContinuousInsert() {
|
|
107
|
+
var _a;
|
|
108
|
+
return this._enableContinuousInsert && (this._dataUnit.records.length - 1) === ((_a = this._lastCellEdited) === null || _a === void 0 ? void 0 : _a.rowIndex);
|
|
109
|
+
}
|
|
110
|
+
async proceedAutoSave() {
|
|
111
|
+
var _a;
|
|
112
|
+
//Aguarda outras promises entrarem na fila
|
|
113
|
+
await new Promise(resolve => setTimeout(resolve, 100));
|
|
114
|
+
if (this._inProgressChanges.length) {
|
|
115
|
+
await Promise.all((_a = this._inProgressChanges) === null || _a === void 0 ? void 0 : _a.map(({ promise }) => promise));
|
|
116
|
+
}
|
|
117
|
+
if (!this._dataUnit.isDirty()) {
|
|
118
|
+
this.saveSuccess();
|
|
119
|
+
return true;
|
|
120
|
+
}
|
|
121
|
+
const currentRecord = this._dataUnit.getSelectedRecord();
|
|
122
|
+
if (currentRecord == undefined) {
|
|
123
|
+
return true;
|
|
124
|
+
}
|
|
125
|
+
this.clearInvalidCells(false);
|
|
126
|
+
try {
|
|
127
|
+
await this._recordValidationProcessor.validate(true);
|
|
128
|
+
await this.saveDataUnit();
|
|
129
|
+
this.saveSuccess();
|
|
130
|
+
return true;
|
|
131
|
+
}
|
|
132
|
+
catch (reason) {
|
|
133
|
+
this.saveFail(reason);
|
|
134
|
+
return false;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
async saveDataUnit() {
|
|
138
|
+
await this._dataUnit.saveData();
|
|
139
|
+
return true;
|
|
140
|
+
}
|
|
141
|
+
async recordValidate() {
|
|
142
|
+
if (!this._dataUnit.isDirty())
|
|
143
|
+
return;
|
|
144
|
+
try {
|
|
145
|
+
this.clearInvalidCells(false);
|
|
146
|
+
await this._recordValidationProcessor.validate(false);
|
|
147
|
+
}
|
|
148
|
+
catch (error) { }
|
|
149
|
+
this._gridOptions.api.refreshCells({ force: true });
|
|
51
150
|
}
|
|
52
151
|
navigateByEnterKey(keyboardEvent) {
|
|
53
152
|
const backwards = keyboardEvent.shiftKey;
|
|
@@ -71,6 +170,13 @@ export default class GridEditionManager {
|
|
|
71
170
|
return { ezCellEditor: EzCellEditor };
|
|
72
171
|
}
|
|
73
172
|
verifyClickToEdition(api, cellClicked) {
|
|
173
|
+
var _a, _b;
|
|
174
|
+
const selectedRecordID = (_a = this._dataUnit.getSelectedRecord()) === null || _a === void 0 ? void 0 : _a.__record__id__;
|
|
175
|
+
if (this._dataUnit.hasNewRecord() && selectedRecordID) {
|
|
176
|
+
const dataUnitRecordIndex = (_b = api.getRowNode(selectedRecordID)) === null || _b === void 0 ? void 0 : _b.rowIndex;
|
|
177
|
+
if (dataUnitRecordIndex != cellClicked.rowIndex)
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
74
180
|
if (this.isSecondClick(cellClicked)) {
|
|
75
181
|
api.startEditingCell({ rowIndex: cellClicked.rowIndex, colKey: cellClicked.column.getColId() });
|
|
76
182
|
}
|
|
@@ -78,8 +184,13 @@ export default class GridEditionManager {
|
|
|
78
184
|
}
|
|
79
185
|
configureColumn(col) {
|
|
80
186
|
col.cellEditor = 'ezCellEditor';
|
|
81
|
-
col.editable
|
|
187
|
+
if (col.editable != false) {
|
|
188
|
+
col.editable = params => this.canEdit(params);
|
|
189
|
+
}
|
|
82
190
|
col.suppressKeyboardEvent = (params) => {
|
|
191
|
+
if (params.event.key === KeyCode.ESCAPE && params.editing) {
|
|
192
|
+
return this._dataUnit.isDirty();
|
|
193
|
+
}
|
|
83
194
|
return params.event.key === KeyCode.ENTER;
|
|
84
195
|
};
|
|
85
196
|
col.cellEditorSelector = (params) => {
|
|
@@ -109,10 +220,21 @@ export default class GridEditionManager {
|
|
|
109
220
|
return col;
|
|
110
221
|
}
|
|
111
222
|
getRequiredFields() {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
223
|
+
const formRequiredFields = this.getFormRequiredFields();
|
|
224
|
+
return this._gridOptions.columnApi.getAllDisplayedColumns()
|
|
225
|
+
.filter(column => {
|
|
226
|
+
const fieldDefinition = this._dataUnit.getField(column.getColId());
|
|
227
|
+
return (fieldDefinition && fieldDefinition.required) || formRequiredFields.includes(column.getColId());
|
|
228
|
+
})
|
|
229
|
+
.map(column => column.getColId());
|
|
230
|
+
}
|
|
231
|
+
getFormRequiredFields() {
|
|
232
|
+
const formRequiredFields = [];
|
|
233
|
+
const dataBinders = DataBinder.getDataBindersByDataUnit(this._dataUnit);
|
|
234
|
+
dataBinders.forEach(dataBinder => {
|
|
235
|
+
formRequiredFields.push(...dataBinder.getFormRequiredFields());
|
|
236
|
+
});
|
|
237
|
+
return formRequiredFields;
|
|
116
238
|
}
|
|
117
239
|
saveSuccess() {
|
|
118
240
|
var _a;
|
|
@@ -125,18 +247,20 @@ export default class GridEditionManager {
|
|
|
125
247
|
this._isGridEdition = false;
|
|
126
248
|
}
|
|
127
249
|
saveFail(reason) {
|
|
128
|
-
|
|
250
|
+
var _a;
|
|
251
|
+
this.focusOnCell((_a = this._lastCellOpened) !== null && _a !== void 0 ? _a : this._lastCellEdited);
|
|
129
252
|
this._isGridEdition = false;
|
|
130
253
|
if (reason) {
|
|
131
|
-
|
|
254
|
+
throw reason;
|
|
132
255
|
}
|
|
133
256
|
}
|
|
134
257
|
focusOnCell(cell) {
|
|
258
|
+
var _a;
|
|
135
259
|
if (cell == undefined) {
|
|
136
260
|
return;
|
|
137
261
|
}
|
|
138
262
|
const { rowIndex, column } = cell;
|
|
139
|
-
this._gridOptions.api.getDisplayedRowAtIndex(rowIndex).setSelected(true, true);
|
|
263
|
+
(_a = this._gridOptions.api.getDisplayedRowAtIndex(rowIndex)) === null || _a === void 0 ? void 0 : _a.setSelected(true, true);
|
|
140
264
|
this._gridOptions.api.clearRangeSelection();
|
|
141
265
|
this._gridOptions.api.addCellRange({ rowStartIndex: rowIndex, rowEndIndex: rowIndex, columns: [column] });
|
|
142
266
|
this._gridOptions.api.startEditingCell({ colKey: column.getColId(), rowIndex });
|
|
@@ -176,9 +300,10 @@ export default class GridEditionManager {
|
|
|
176
300
|
}
|
|
177
301
|
}
|
|
178
302
|
else {
|
|
303
|
+
const actualRowIndex = rowIndex;
|
|
179
304
|
rowIndex = rowIndex + 1;
|
|
180
305
|
if (rowIndex >= this._dataUnit.records.length) {
|
|
181
|
-
rowIndex = 0;
|
|
306
|
+
rowIndex = !this._enableGridInsert ? 0 : actualRowIndex;
|
|
182
307
|
}
|
|
183
308
|
}
|
|
184
309
|
this._targetEditionCell = new TargetEdition(rowIndex, column, true);
|
|
@@ -191,6 +316,9 @@ export default class GridEditionManager {
|
|
|
191
316
|
this.moveEditionVertically(api, 1);
|
|
192
317
|
}
|
|
193
318
|
moveEditionVertically(api, offset) {
|
|
319
|
+
if (this._dataUnit.hasNewRecord() && this._isGridEdition) {
|
|
320
|
+
return;
|
|
321
|
+
}
|
|
194
322
|
const editionCell = api.getEditingCells()[0];
|
|
195
323
|
if (!editionCell) {
|
|
196
324
|
return;
|
|
@@ -235,28 +363,101 @@ export default class GridEditionManager {
|
|
|
235
363
|
return true;
|
|
236
364
|
}
|
|
237
365
|
onCellEditRequest(event) {
|
|
238
|
-
|
|
366
|
+
var _a;
|
|
239
367
|
const value = event.newValue;
|
|
240
|
-
if (event.oldValue
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
}
|
|
368
|
+
if (event.oldValue == value) {
|
|
369
|
+
(_a = this._currentEditLock) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
370
|
+
return;
|
|
371
|
+
}
|
|
372
|
+
if (value instanceof Promise) {
|
|
373
|
+
const progressChange = {
|
|
374
|
+
promise: undefined,
|
|
375
|
+
resolve: () => { }
|
|
376
|
+
};
|
|
377
|
+
progressChange.promise = new Promise((resolve) => {
|
|
378
|
+
progressChange.resolve = resolve;
|
|
379
|
+
});
|
|
380
|
+
this._inProgressChanges.push(progressChange);
|
|
381
|
+
this.handlePromiseValue(event, value);
|
|
382
|
+
return;
|
|
383
|
+
}
|
|
384
|
+
this.updateCellValue(event, value);
|
|
385
|
+
}
|
|
386
|
+
async handlePromiseValue(event, value) {
|
|
387
|
+
const fieldName = event.colDef.field;
|
|
388
|
+
const fieldDescriptor = this._dataUnit.getField(event.colDef.colId);
|
|
389
|
+
const initialValue = (fieldDescriptor === null || fieldDescriptor === void 0 ? void 0 : fieldDescriptor.userInterface) === UserInterface.SEARCH ? value : event.oldValue;
|
|
390
|
+
event.node.setData(Object.assign(Object.assign({}, event.data), { [fieldName]: initialValue }));
|
|
391
|
+
const resolved = await value;
|
|
392
|
+
return this.updateCellValue(event, resolved);
|
|
393
|
+
}
|
|
394
|
+
async updateCellValue(event, newValue) {
|
|
395
|
+
var _a, _b, _c, _d;
|
|
396
|
+
const fieldName = event.colDef.field;
|
|
397
|
+
const newData = { [fieldName]: newValue };
|
|
398
|
+
const descriptionColName = (_b = (_a = this._dataUnit.getField(fieldName)) === null || _a === void 0 ? void 0 : _a.properties) === null || _b === void 0 ? void 0 : _b[PRESENTATION_COL_ID_PROP_NAME];
|
|
399
|
+
if (!StringUtils.isEmpty(descriptionColName)) {
|
|
400
|
+
newData[descriptionColName] = newValue === null || newValue === void 0 ? void 0 : newValue.label;
|
|
401
|
+
}
|
|
402
|
+
event.node.setData(Object.assign(Object.assign({}, event.data), { newData }));
|
|
403
|
+
(_c = this._currentEditLock) === null || _c === void 0 ? void 0 : _c.call(this);
|
|
404
|
+
if (event.oldValue !== newValue) {
|
|
249
405
|
this._isGridEdition = true;
|
|
250
|
-
this._dataUnit.setFieldValue(fieldName,
|
|
406
|
+
await this._dataUnit.setFieldValue(fieldName, newValue, [event.data.__record__id__], { suppressCreateNewRecord: true });
|
|
251
407
|
this._lastCellEdited = { rowIndex: event.rowIndex, column: event.column, rowPinned: undefined };
|
|
252
408
|
}
|
|
409
|
+
(_d = this._inProgressChanges) === null || _d === void 0 ? void 0 : _d.forEach(({ resolve }) => resolve(newValue));
|
|
253
410
|
}
|
|
254
411
|
setCellEditors(customEditors) {
|
|
412
|
+
var _a;
|
|
255
413
|
this._customEditors = customEditors;
|
|
414
|
+
(_a = this._gridOptions) === null || _a === void 0 ? void 0 : _a.api.stopEditing();
|
|
256
415
|
}
|
|
257
416
|
setCellRenders(customRenders) {
|
|
258
417
|
this._customRenders = customRenders;
|
|
259
418
|
}
|
|
419
|
+
pushInvalidCell(invalidField, recordId) {
|
|
420
|
+
this._invalidCells.push({ field: invalidField, recordId });
|
|
421
|
+
this._nextInvalidCell = this._invalidCells[0];
|
|
422
|
+
}
|
|
423
|
+
getInvalidCells() {
|
|
424
|
+
return this._invalidCells;
|
|
425
|
+
}
|
|
426
|
+
getNextInvalidCell() {
|
|
427
|
+
return this._nextInvalidCell;
|
|
428
|
+
}
|
|
429
|
+
async processContinuousInsert() {
|
|
430
|
+
if (!this.canContinuousInsert())
|
|
431
|
+
return;
|
|
432
|
+
this._dataUnit.addRecord();
|
|
433
|
+
}
|
|
434
|
+
clearInvalidCells(stopEdition) {
|
|
435
|
+
this._invalidCells = [];
|
|
436
|
+
this._nextInvalidCell = undefined;
|
|
437
|
+
if (stopEdition) {
|
|
438
|
+
this._isGridEdition = false;
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
setEnableContinuousInsert(enable) {
|
|
442
|
+
this._enableContinuousInsert = enable;
|
|
443
|
+
}
|
|
444
|
+
hasInvalidField(fieldName, recordId) {
|
|
445
|
+
if (!this.hasInvalidCell())
|
|
446
|
+
return false;
|
|
447
|
+
this._nextInvalidCell = this._invalidCells[0];
|
|
448
|
+
const containsFieldName = this._nextInvalidCell.field.name === fieldName;
|
|
449
|
+
const containsRecordId = this._nextInvalidCell.recordId === recordId;
|
|
450
|
+
return containsFieldName && containsRecordId;
|
|
451
|
+
}
|
|
452
|
+
hasInvalidCell() {
|
|
453
|
+
var _a, _b, _c;
|
|
454
|
+
const hasInvalidCell = ((_a = this._invalidCells) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
455
|
+
const hasField = (_b = this._invalidCells) === null || _b === void 0 ? void 0 : _b.filter(invalidCell => { invalidCell.field; });
|
|
456
|
+
const hasRecordId = (_c = this._invalidCells) === null || _c === void 0 ? void 0 : _c.filter(invalidCell => { invalidCell.recordId; });
|
|
457
|
+
if (!hasInvalidCell || !hasField || !hasRecordId)
|
|
458
|
+
return false;
|
|
459
|
+
return true;
|
|
460
|
+
}
|
|
260
461
|
}
|
|
261
462
|
class TargetEdition {
|
|
262
463
|
constructor(rowIndex, column, backwards) {
|