@sankhyalabs/ezui 5.22.0-dev.10 → 5.22.0-dev.100
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-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 +1485 -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 +1 -1
- package/dist/cjs/ez-combo-box-list_3.cjs.entry.js +387 -0
- package/dist/cjs/ez-combo-box.cjs.entry.js +82 -155
- 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 +26 -20
- package/dist/cjs/ez-form.cjs.entry.js +6 -325
- package/dist/cjs/ez-grid.cjs.entry.js +15067 -69836
- 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-plus_3.cjs.entry.js +198 -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 +119 -188
- 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/cjs/searchFormatters-b7e1ed1e.js +23 -0
- package/dist/collection/collection-manifest.json +8 -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 -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 +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 +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 +1 -1
- 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 +297 -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 +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 +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 +432 -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 +528 -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 +4 -0
- package/dist/collection/components/ez-search/ez-search.css +2 -210
- package/dist/collection/components/ez-search/ez-search.js +204 -203
- 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-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 +36 -0
- package/dist/custom-elements/index.js +18612 -70878
- 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-badge.entry.js +14 -2
- package/dist/esm/ez-button.entry.js +11 -5
- package/dist/esm/ez-card-item_2.entry.js +1480 -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 +1 -1
- package/dist/esm/ez-combo-box-list_3.entry.js +381 -0
- package/dist/esm/ez-combo-box.entry.js +83 -156
- 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 +26 -20
- package/dist/esm/ez-form.entry.js +5 -324
- package/dist/esm/ez-grid.entry.js +14989 -69758
- 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-plus_3.entry.js +192 -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 +120 -189
- 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/esm/searchFormatters-8229207e.js +20 -0
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-0fa52b0f.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-20cb13fa.entry.js +1 -0
- package/dist/ezui/p-23b6128c.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-3195a7a7.entry.js +1 -0
- package/dist/ezui/p-31b71e50.entry.js +1 -0
- package/dist/ezui/p-31da1b57.entry.js +1 -0
- package/dist/ezui/p-40a60148.js +1 -0
- package/dist/ezui/p-556468d9.entry.js +1 -0
- package/dist/ezui/p-56fe5341.entry.js +1 -0
- package/dist/ezui/p-5aca7386.entry.js +1 -0
- package/dist/ezui/p-6cdd3e0a.entry.js +1 -0
- package/dist/ezui/p-788467fe.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-a4cee65d.entry.js +1 -0
- package/dist/ezui/p-acddfb2e.js +1 -0
- package/dist/ezui/p-b7706b43.entry.js +1 -0
- package/dist/ezui/p-c1527804.entry.js +1 -0
- package/dist/ezui/p-c297aa52.entry.js +1 -0
- package/dist/ezui/p-cb1535f7.entry.js +1 -0
- package/dist/ezui/p-cb5cd243.entry.js +309 -0
- package/dist/ezui/p-cf87aacb.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-dcf3c8e5.entry.js +1 -0
- package/dist/ezui/{p-17be134a.entry.js → p-e06a9886.entry.js} +1 -1
- 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-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-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-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 +17 -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-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/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 +37 -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 +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 +76 -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-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 +793 -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 +6 -0
- package/react/components.js +6 -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-650e4b6d.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-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-aba3da00.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,8 +1,9 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
2
|
import CSSVarsUtils from "../../utils/CSSVarsUtils";
|
|
3
|
-
import { ElementIDUtils,
|
|
3
|
+
import { ElementIDUtils, ObjectUtils, StringUtils } from "@sankhyalabs/core";
|
|
4
4
|
import { ApplicationUtils } from "../../utils";
|
|
5
5
|
import { REQUIRED_INFO } from "../../utils/constants";
|
|
6
|
+
import { replaceHighlight, replaceQuotes } from "./utils/searchFormatters";
|
|
6
7
|
export class EzSearch {
|
|
7
8
|
constructor() {
|
|
8
9
|
this._changeDeboucingTimeout = null;
|
|
@@ -18,15 +19,18 @@ export class EzSearch {
|
|
|
18
19
|
this._visibleOptions = undefined;
|
|
19
20
|
this._startLoading = false;
|
|
20
21
|
this._showLoading = true;
|
|
22
|
+
this._showLoadingDescription = false;
|
|
21
23
|
this._criteria = undefined;
|
|
22
24
|
this.value = undefined;
|
|
23
25
|
this.label = undefined;
|
|
24
26
|
this.enabled = true;
|
|
25
27
|
this.errorMessage = undefined;
|
|
26
28
|
this.optionLoader = undefined;
|
|
29
|
+
this.contextProperties = undefined;
|
|
27
30
|
this.showSelectedValue = true;
|
|
28
31
|
this.showOptionValue = true;
|
|
29
32
|
this.suppressEmptyOption = false;
|
|
33
|
+
this.stopPropagateEnterKeyEvent = false;
|
|
30
34
|
this.mode = "regular";
|
|
31
35
|
this.canShowError = true;
|
|
32
36
|
this.hideErrorOnFocusOut = true;
|
|
@@ -35,7 +39,9 @@ export class EzSearch {
|
|
|
35
39
|
this.ignoreLimitCharsToSearch = false;
|
|
36
40
|
this.options = undefined;
|
|
37
41
|
this.suppressSearch = false;
|
|
38
|
-
this.
|
|
42
|
+
this.ensureClearButtonVisible = false;
|
|
43
|
+
this.suppressPreLoad = true;
|
|
44
|
+
this.autoFocus = false;
|
|
39
45
|
}
|
|
40
46
|
observeErrorMessage() {
|
|
41
47
|
var _a;
|
|
@@ -46,12 +52,21 @@ export class EzSearch {
|
|
|
46
52
|
}
|
|
47
53
|
}
|
|
48
54
|
}
|
|
55
|
+
getValue(val) {
|
|
56
|
+
return typeof val === 'object' ? val === null || val === void 0 ? void 0 : val.value : val;
|
|
57
|
+
}
|
|
49
58
|
validateNewValue(newValue, oldValue) {
|
|
50
|
-
const
|
|
51
|
-
|
|
59
|
+
const parsedNewValue = this.getValue(newValue);
|
|
60
|
+
const parsedOldValue = this.getValue(oldValue);
|
|
61
|
+
const newValueIsValid = parsedNewValue !== "[object Object]";
|
|
62
|
+
const valuesIsDifferent = parsedNewValue !== parsedOldValue;
|
|
63
|
+
if (newValueIsValid && valuesIsDifferent) {
|
|
64
|
+
return true;
|
|
65
|
+
}
|
|
66
|
+
return false;
|
|
52
67
|
}
|
|
53
68
|
async observeValue(newValue, oldValue) {
|
|
54
|
-
if (this._textInput &&
|
|
69
|
+
if (this._textInput && this.validateNewValue(newValue, oldValue)) {
|
|
55
70
|
if (typeof newValue === "string") {
|
|
56
71
|
await this.handleValueAsString(newValue);
|
|
57
72
|
return;
|
|
@@ -68,7 +83,7 @@ export class EzSearch {
|
|
|
68
83
|
}
|
|
69
84
|
}
|
|
70
85
|
observeOptions(newOptions, oldOptions) {
|
|
71
|
-
if (!newOptions.length && this.
|
|
86
|
+
if (!newOptions.length && this.suppressPreLoad)
|
|
72
87
|
return;
|
|
73
88
|
if ((newOptions === null || newOptions === void 0 ? void 0 : newOptions.join('')) === (oldOptions === null || oldOptions === void 0 ? void 0 : oldOptions.join('')))
|
|
74
89
|
return;
|
|
@@ -94,9 +109,9 @@ export class EzSearch {
|
|
|
94
109
|
/**
|
|
95
110
|
* Aplica o foco no campo.
|
|
96
111
|
*/
|
|
97
|
-
async setFocus() {
|
|
112
|
+
async setFocus(options) {
|
|
98
113
|
if (this._textInput) {
|
|
99
|
-
this._textInput.setFocus();
|
|
114
|
+
this._textInput.setFocus(options);
|
|
100
115
|
}
|
|
101
116
|
}
|
|
102
117
|
/**
|
|
@@ -119,73 +134,19 @@ export class EzSearch {
|
|
|
119
134
|
async clearValue() {
|
|
120
135
|
this.clearSearch();
|
|
121
136
|
}
|
|
122
|
-
scrollListener() {
|
|
123
|
-
var _a;
|
|
124
|
-
if (this._floatingID == undefined) {
|
|
125
|
-
return;
|
|
126
|
-
}
|
|
127
|
-
if ((_a = this.listOptionsPosition) === null || _a === void 0 ? void 0 : _a.hardPosition) {
|
|
128
|
-
this.hideOptions();
|
|
129
|
-
}
|
|
130
|
-
else {
|
|
131
|
-
window.requestAnimationFrame(() => {
|
|
132
|
-
this.updateListPosition();
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
137
|
async handleValueAsString(value) {
|
|
137
138
|
if (this.getSelectedOption(value)) {
|
|
138
139
|
this.setInputValue();
|
|
139
140
|
return;
|
|
140
141
|
}
|
|
141
142
|
await this.loadDescriptionValue(value);
|
|
143
|
+
if (!this._currentValue) {
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
142
146
|
this.setInputValue();
|
|
143
147
|
this.ezChange.emit(this.value);
|
|
144
148
|
this._currentValue = this.value;
|
|
145
149
|
}
|
|
146
|
-
updateListPosition() {
|
|
147
|
-
let { verticalPosition, horizontalPosition, fromBottom, fromRight, bottomLimit, hardPosition } = this.getListPosition();
|
|
148
|
-
const elementRect = this._listWrapper.getBoundingClientRect();
|
|
149
|
-
const containerRect = this._listContainer.getBoundingClientRect();
|
|
150
|
-
const textInputRect = this._textInput.getBoundingClientRect();
|
|
151
|
-
const limitHeight = bottomLimit || window.innerHeight;
|
|
152
|
-
const neededHeight = containerRect.bottom + elementRect.height;
|
|
153
|
-
if (!fromBottom && (elementRect.top < 0 || neededHeight > limitHeight)) {
|
|
154
|
-
fromBottom = true;
|
|
155
|
-
}
|
|
156
|
-
if (!hardPosition) {
|
|
157
|
-
verticalPosition = verticalPosition || 0;
|
|
158
|
-
horizontalPosition = horizontalPosition || 0;
|
|
159
|
-
if (fromBottom) {
|
|
160
|
-
verticalPosition = window.innerHeight - textInputRect.top + verticalPosition;
|
|
161
|
-
}
|
|
162
|
-
else {
|
|
163
|
-
verticalPosition += containerRect.top;
|
|
164
|
-
}
|
|
165
|
-
if (fromRight) {
|
|
166
|
-
horizontalPosition = window.innerWidth - textInputRect.right + horizontalPosition;
|
|
167
|
-
}
|
|
168
|
-
else {
|
|
169
|
-
horizontalPosition += containerRect.left;
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
if (verticalPosition != undefined) {
|
|
173
|
-
this._listWrapper.style[fromBottom ? "bottom" : "top"] = `${verticalPosition}px`;
|
|
174
|
-
this._listWrapper.style[fromBottom ? "top" : "bottom"] = "";
|
|
175
|
-
}
|
|
176
|
-
if (horizontalPosition != undefined) {
|
|
177
|
-
this._listWrapper.style[fromRight ? "right" : "left"] = `${horizontalPosition}px`;
|
|
178
|
-
this._listWrapper.style[fromRight ? "left" : "right"] = "";
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
getListPosition() {
|
|
182
|
-
if (this.listOptionsPosition) {
|
|
183
|
-
return this.listOptionsPosition;
|
|
184
|
-
}
|
|
185
|
-
return {
|
|
186
|
-
verticalPosition: (this.errorMessage || !this.canShowError || this.mode === "slim") ? 6 : -13
|
|
187
|
-
};
|
|
188
|
-
}
|
|
189
150
|
isDifferentValues(firstValue, secondValue) {
|
|
190
151
|
return ObjectUtils.objectToString(firstValue || {}) !== ObjectUtils.objectToString(secondValue || {});
|
|
191
152
|
}
|
|
@@ -193,28 +154,21 @@ export class EzSearch {
|
|
|
193
154
|
if (currentValue == undefined) {
|
|
194
155
|
return;
|
|
195
156
|
}
|
|
196
|
-
let text = (!this.showSelectedValue || currentValue.value == undefined) ? currentValue.label : `${currentValue.value} - ${currentValue.label}
|
|
197
|
-
text = text.replace(new RegExp(this._startHighlightTag, 'g'), '').replace(new RegExp(this._endHighlightTag, 'g'), '');
|
|
157
|
+
let text = (!this.showSelectedValue || currentValue.value == undefined) ? currentValue.label : currentValue.label ? `${currentValue.value} - ${currentValue.label}` : currentValue.value;
|
|
158
|
+
text = text === null || text === void 0 ? void 0 : text.replace(new RegExp(this._startHighlightTag, 'g'), '').replace(new RegExp(this._endHighlightTag, 'g'), '');
|
|
198
159
|
return text;
|
|
199
160
|
}
|
|
200
161
|
getText() {
|
|
201
162
|
const currentValue = this.getSelectedOption(this._currentValue);
|
|
202
163
|
const text = this.getFormattedText(currentValue);
|
|
203
|
-
|
|
204
|
-
return;
|
|
205
|
-
}
|
|
206
|
-
return String(text)
|
|
207
|
-
.replace(/&/g, '&')
|
|
208
|
-
.replace(/</g, '<')
|
|
209
|
-
.replace(/>/g, '>')
|
|
210
|
-
.replace(/"/g, '"');
|
|
164
|
+
return replaceQuotes(text);
|
|
211
165
|
}
|
|
212
166
|
getSelectedOption(value) {
|
|
213
167
|
if (typeof value === "string" || value instanceof String) {
|
|
214
168
|
return this._visibleOptions.find(o => o.value === value);
|
|
215
169
|
}
|
|
216
170
|
if (value) {
|
|
217
|
-
return Object.assign(Object.assign({}, value), { value:
|
|
171
|
+
return Object.assign(Object.assign({}, value), { value: replaceHighlight(value === null || value === void 0 ? void 0 : value.value), label: replaceHighlight(value === null || value === void 0 ? void 0 : value.label) });
|
|
218
172
|
}
|
|
219
173
|
return value;
|
|
220
174
|
}
|
|
@@ -252,75 +206,19 @@ export class EzSearch {
|
|
|
252
206
|
}
|
|
253
207
|
return 0;
|
|
254
208
|
}
|
|
255
|
-
createOption(detail) {
|
|
256
|
-
let { key, title } = detail;
|
|
257
|
-
const startHighlight = new RegExp(this._startHighlightTag, 'g');
|
|
258
|
-
const endHighlight = new RegExp(this._endHighlightTag, 'g');
|
|
259
|
-
title = StringUtils.decodeHtmlEntities(title);
|
|
260
|
-
const option = {
|
|
261
|
-
value: key === null || key === void 0 ? void 0 : key.replace(startHighlight, '').replace(endHighlight, ''),
|
|
262
|
-
label: title === null || title === void 0 ? void 0 : title.replace(startHighlight, '').replace(endHighlight, '')
|
|
263
|
-
};
|
|
264
|
-
this.selectOption(option);
|
|
265
|
-
}
|
|
266
|
-
buildItem(opt, index) {
|
|
267
|
-
opt.label = opt.label || opt.value;
|
|
268
|
-
const card = {
|
|
269
|
-
key: opt.value,
|
|
270
|
-
title: opt.label,
|
|
271
|
-
details: opt.details
|
|
272
|
-
};
|
|
273
|
-
return h("div", { style: { "height": "100%" }, class: index === this._preSelection ? "item preselected" : "item", id: `item_${opt.value}`, onMouseDown: () => this.createOption(card), onMouseOver: () => this._preSelection = index }, h("ez-card-item", { item: card }));
|
|
274
|
-
}
|
|
275
209
|
showOptions() {
|
|
276
210
|
if (!this.enabled)
|
|
277
211
|
return;
|
|
278
212
|
if (this.isOptionsVisible()) {
|
|
279
213
|
return;
|
|
280
214
|
}
|
|
281
|
-
|
|
282
|
-
this._resizeObserver.observe(this._textInput);
|
|
283
|
-
this._floatingID = FloatingManager.float(this._listWrapper, this._listContainer, { autoClose: false, isFixed: true, backClickListener: () => this.hideOptions() });
|
|
284
|
-
this.setFocus();
|
|
285
|
-
window.requestAnimationFrame(() => {
|
|
286
|
-
this.updateListPosition();
|
|
287
|
-
if (!this.listOptionsPosition) {
|
|
288
|
-
this._listWrapper.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "nearest" });
|
|
289
|
-
}
|
|
290
|
-
});
|
|
215
|
+
this._ezPopOverPlusElement.showUnder(this._textInput);
|
|
291
216
|
}
|
|
292
217
|
hideOptions() {
|
|
293
|
-
|
|
294
|
-
FloatingManager.close(this._floatingID);
|
|
295
|
-
}
|
|
296
|
-
this._floatingID = undefined;
|
|
297
|
-
if (!!this._resizeObserver)
|
|
298
|
-
this._resizeObserver.unobserve(this._textInput);
|
|
218
|
+
this._ezPopOverPlusElement.hide();
|
|
299
219
|
}
|
|
300
220
|
isOptionsVisible() {
|
|
301
|
-
return this.
|
|
302
|
-
}
|
|
303
|
-
nextOption() {
|
|
304
|
-
if (!this.isOptionsVisible()) {
|
|
305
|
-
return;
|
|
306
|
-
}
|
|
307
|
-
this.showOptions();
|
|
308
|
-
this._preSelection = this._preSelection === undefined ? 0 : Math.min(this._preSelection + 1, this._visibleOptions.length - 1);
|
|
309
|
-
this.scrollToOption(this._visibleOptions[this._preSelection]);
|
|
310
|
-
}
|
|
311
|
-
previousOption() {
|
|
312
|
-
this._preSelection = this._preSelection === undefined ? 0 : Math.max(this._preSelection - 1, 0);
|
|
313
|
-
this.scrollToOption(this._visibleOptions[this._preSelection]);
|
|
314
|
-
}
|
|
315
|
-
scrollToOption(opt) {
|
|
316
|
-
window.requestAnimationFrame(() => {
|
|
317
|
-
const liElem = (opt === null || opt === void 0 ? void 0 : opt.value)
|
|
318
|
-
? this._optionsList.querySelector(`div#item_${opt.value.replace(/([ #;&,.+*~':"!^$[\]()=<>|/\\])/g, '\\$1')}`)
|
|
319
|
-
: undefined;
|
|
320
|
-
if (liElem) {
|
|
321
|
-
liElem.scrollIntoView({ behavior: "smooth", block: "nearest" });
|
|
322
|
-
}
|
|
323
|
-
});
|
|
221
|
+
return this._ezPopOverPlusElement.opened;
|
|
324
222
|
}
|
|
325
223
|
selectCurrentOption() {
|
|
326
224
|
if (this._preSelection !== undefined) {
|
|
@@ -335,10 +233,13 @@ export class EzSearch {
|
|
|
335
233
|
this._startLoading = false;
|
|
336
234
|
if (source instanceof Promise) {
|
|
337
235
|
this._showLoading = true;
|
|
236
|
+
this._showLoadingDescription = true;
|
|
338
237
|
source.then(result => {
|
|
339
|
-
this._showLoading = false;
|
|
340
238
|
this.updateSource(result);
|
|
341
|
-
}).
|
|
239
|
+
}).finally(() => {
|
|
240
|
+
this._showLoading = false;
|
|
241
|
+
this._showLoadingDescription = false;
|
|
242
|
+
});
|
|
342
243
|
this.updateVisibleOptions();
|
|
343
244
|
}
|
|
344
245
|
else {
|
|
@@ -348,7 +249,7 @@ export class EzSearch {
|
|
|
348
249
|
this.updateVisibleOptions();
|
|
349
250
|
if (this._tabPressed) {
|
|
350
251
|
this._tabPressed = false;
|
|
351
|
-
this.controlEmptySearch();
|
|
252
|
+
this.controlEmptySearch(false);
|
|
352
253
|
}
|
|
353
254
|
}
|
|
354
255
|
else {
|
|
@@ -360,18 +261,14 @@ export class EzSearch {
|
|
|
360
261
|
this._source = [];
|
|
361
262
|
this.updateVisibleOptions();
|
|
362
263
|
}
|
|
363
|
-
|
|
364
|
-
const startHighlight = new RegExp(this._startHighlightTag, 'g');
|
|
365
|
-
const endHighlight = new RegExp(this._endHighlightTag, 'g');
|
|
366
|
-
return (value !== null && value !== void 0 ? value : "").replace(startHighlight, '').replace(endHighlight, '');
|
|
367
|
-
}
|
|
368
|
-
selectOption(newOption) {
|
|
264
|
+
selectOption(newOption, focusOnInput = true) {
|
|
369
265
|
var _a, _b;
|
|
370
266
|
const currentValue = this.getSelectedOption(this.value);
|
|
371
|
-
const newOptionsReplaced = Object.assign(Object.assign({}, newOption), { value:
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
267
|
+
const newOptionsReplaced = Object.assign(Object.assign({}, newOption), { value: replaceHighlight(newOption === null || newOption === void 0 ? void 0 : newOption.value), label: replaceHighlight(newOption === null || newOption === void 0 ? void 0 : newOption.label) });
|
|
268
|
+
const newOptionsFormatted = Object.assign(Object.assign({}, newOptionsReplaced), { value: replaceQuotes(newOptionsReplaced === null || newOptionsReplaced === void 0 ? void 0 : newOptionsReplaced.value), label: replaceQuotes(newOptionsReplaced === null || newOptionsReplaced === void 0 ? void 0 : newOptionsReplaced.label) });
|
|
269
|
+
if ((((_a = currentValue === null || currentValue === void 0 ? void 0 : currentValue.value) === null || _a === void 0 ? void 0 : _a.toString()) !== ((_b = newOptionsFormatted === null || newOptionsFormatted === void 0 ? void 0 : newOptionsFormatted.value) === null || _b === void 0 ? void 0 : _b.toString()))
|
|
270
|
+
|| (currentValue == undefined && newOptionsFormatted != undefined && "value" in newOptionsFormatted)) {
|
|
271
|
+
const adjustedOpt = !(newOptionsFormatted === null || newOptionsFormatted === void 0 ? void 0 : newOptionsFormatted.value) ? undefined : newOptionsFormatted;
|
|
375
272
|
this.value = adjustedOpt;
|
|
376
273
|
this._currentValue = adjustedOpt;
|
|
377
274
|
}
|
|
@@ -381,13 +278,18 @@ export class EzSearch {
|
|
|
381
278
|
}
|
|
382
279
|
this._visibleOptions = [];
|
|
383
280
|
this.clearSource();
|
|
281
|
+
if (focusOnInput) {
|
|
282
|
+
setTimeout(() => {
|
|
283
|
+
this.setFocus();
|
|
284
|
+
}, 0);
|
|
285
|
+
}
|
|
384
286
|
}
|
|
385
287
|
loadOptions(mode, argument = "") {
|
|
386
288
|
this._criteria = argument;
|
|
387
289
|
this._startLoading = true;
|
|
388
290
|
if (this.optionLoader) {
|
|
389
291
|
const searchArgument = { mode, argument };
|
|
390
|
-
this.updateSource(this.optionLoader(searchArgument));
|
|
292
|
+
this.updateSource(this.optionLoader(searchArgument, this.contextProperties));
|
|
391
293
|
}
|
|
392
294
|
else {
|
|
393
295
|
this.updateSource(this.options);
|
|
@@ -417,7 +319,7 @@ export class EzSearch {
|
|
|
417
319
|
this.value = null;
|
|
418
320
|
this._currentValue = null;
|
|
419
321
|
}
|
|
420
|
-
controlListWithOnlyOne() {
|
|
322
|
+
controlListWithOnlyOne(focusOnInput = true) {
|
|
421
323
|
var _a, _b;
|
|
422
324
|
const source = (_a = this._visibleOptions) === null || _a === void 0 ? void 0 : _a.filter((opt) => opt.label !== "" && opt.value != undefined);
|
|
423
325
|
if ((source === null || source === void 0 ? void 0 : source.length) > 0) {
|
|
@@ -428,32 +330,19 @@ export class EzSearch {
|
|
|
428
330
|
value: (_b = source[0].value) === null || _b === void 0 ? void 0 : _b.replace(startHighlight, '').replace(endHighlight, ''),
|
|
429
331
|
label: title === null || title === void 0 ? void 0 : title.replace(startHighlight, '').replace(endHighlight, '')
|
|
430
332
|
};
|
|
431
|
-
this.selectOption(option);
|
|
333
|
+
this.selectOption(option, focusOnInput);
|
|
432
334
|
}
|
|
433
335
|
}
|
|
434
|
-
controlEmptySearch() {
|
|
336
|
+
controlEmptySearch(focusOnInput = true) {
|
|
435
337
|
var _a;
|
|
436
338
|
if (!((_a = this._visibleOptions) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
437
339
|
this.clearSearch();
|
|
438
340
|
ApplicationUtils.info(this._textEmptyList);
|
|
439
341
|
}
|
|
440
342
|
else {
|
|
441
|
-
this.controlListWithOnlyOne();
|
|
343
|
+
this.controlListWithOnlyOne(focusOnInput);
|
|
442
344
|
}
|
|
443
345
|
}
|
|
444
|
-
validateDescriptionValue() {
|
|
445
|
-
if (StringUtils.isEmpty(this.value)) {
|
|
446
|
-
return;
|
|
447
|
-
}
|
|
448
|
-
if (!this.validateNewValue(this.value, this._currentValue)) {
|
|
449
|
-
return;
|
|
450
|
-
}
|
|
451
|
-
let value = this.value;
|
|
452
|
-
if (typeof value === "object") {
|
|
453
|
-
return;
|
|
454
|
-
}
|
|
455
|
-
this.loadDescriptionValue(value);
|
|
456
|
-
}
|
|
457
346
|
async loadDescriptionValue(argument) {
|
|
458
347
|
var _a, _b;
|
|
459
348
|
if (argument == undefined) {
|
|
@@ -467,7 +356,7 @@ export class EzSearch {
|
|
|
467
356
|
mode: SearchMode.PREDICTIVE,
|
|
468
357
|
argument
|
|
469
358
|
};
|
|
470
|
-
const source = await ((_b = this.optionLoader) === null || _b === void 0 ? void 0 : _b.call(this, searchArgument));
|
|
359
|
+
const source = await ((_b = this.optionLoader) === null || _b === void 0 ? void 0 : _b.call(this, searchArgument, this.contextProperties));
|
|
471
360
|
if (source == undefined) {
|
|
472
361
|
return;
|
|
473
362
|
}
|
|
@@ -486,8 +375,17 @@ export class EzSearch {
|
|
|
486
375
|
this.showNoResultMessage();
|
|
487
376
|
return;
|
|
488
377
|
}
|
|
489
|
-
this._currentValue = value ? Object.assign(Object.assign({}, value), { value:
|
|
378
|
+
this._currentValue = value ? Object.assign(Object.assign({}, value), { value: replaceHighlight(value.value), label: replaceHighlight(value.label) }) : value;
|
|
490
379
|
this.value = this._currentValue;
|
|
380
|
+
this.setTextInputValue();
|
|
381
|
+
}
|
|
382
|
+
setTextInputValue() {
|
|
383
|
+
if (this._textInput && (this._textInput.value === null || this._textInput.value === undefined)) {
|
|
384
|
+
if (this.value === undefined || this.value === null)
|
|
385
|
+
return;
|
|
386
|
+
const textValue = (typeof this.value === 'string') ? this.value : this.getFormattedText(this.value);
|
|
387
|
+
this._textInput.value = replaceQuotes(textValue);
|
|
388
|
+
}
|
|
491
389
|
}
|
|
492
390
|
loadOptionValue(argument) {
|
|
493
391
|
var _a;
|
|
@@ -513,6 +411,19 @@ export class EzSearch {
|
|
|
513
411
|
this._preSelection = undefined;
|
|
514
412
|
this.updateVisibleOptions();
|
|
515
413
|
}
|
|
414
|
+
async handleInitialValue() {
|
|
415
|
+
const valueIsValid = !!this.getValue(this.value);
|
|
416
|
+
if (!valueIsValid) {
|
|
417
|
+
return;
|
|
418
|
+
}
|
|
419
|
+
if (typeof this.value === "string") {
|
|
420
|
+
await this.handleValueAsString(this.value);
|
|
421
|
+
return;
|
|
422
|
+
}
|
|
423
|
+
let text = this.getFormattedText(this.value);
|
|
424
|
+
text = replaceQuotes(text);
|
|
425
|
+
this._textInput.value = text;
|
|
426
|
+
}
|
|
516
427
|
//---------------------------------------------
|
|
517
428
|
// Lifecycle web component
|
|
518
429
|
//---------------------------------------------
|
|
@@ -537,28 +448,29 @@ export class EzSearch {
|
|
|
537
448
|
}
|
|
538
449
|
componentDidRender() {
|
|
539
450
|
var _a;
|
|
540
|
-
if (this._floatingID === undefined) {
|
|
541
|
-
this._listWrapper.remove();
|
|
542
|
-
}
|
|
543
451
|
(_a = this._optionsList) === null || _a === void 0 ? void 0 : _a.querySelectorAll(".item").forEach((elem) => {
|
|
544
452
|
ElementIDUtils.addIDInfoIfNotExists(elem, "itemSearch");
|
|
545
453
|
});
|
|
546
|
-
this.validateDescriptionValue();
|
|
547
454
|
}
|
|
548
|
-
componentDidLoad() {
|
|
455
|
+
async componentDidLoad() {
|
|
549
456
|
this._currentValue = this.value;
|
|
550
457
|
CSSVarsUtils.applyVarsTextInput(this.el, this._textInput);
|
|
551
|
-
this.setInputValue(false);
|
|
552
458
|
this._resizeObserver = new ResizeObserver((entries) => {
|
|
553
459
|
window.requestAnimationFrame(() => {
|
|
554
460
|
if (!Array.isArray(entries) || !entries.length)
|
|
555
461
|
return;
|
|
556
|
-
const { clientWidth } = this._listContainer;
|
|
557
|
-
if (clientWidth > 0 && !!this._listWrapper) {
|
|
558
|
-
this._listWrapper.style.width = `${clientWidth}px`;
|
|
559
|
-
}
|
|
560
462
|
});
|
|
561
463
|
});
|
|
464
|
+
await this.handleInitialValue();
|
|
465
|
+
if (this.autoFocus) {
|
|
466
|
+
requestAnimationFrame(() => {
|
|
467
|
+
this.setFocus({ selectText: true });
|
|
468
|
+
});
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
disconnectedCallback() {
|
|
472
|
+
var _a;
|
|
473
|
+
(_a = this._resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
562
474
|
}
|
|
563
475
|
//---------------------------------------------
|
|
564
476
|
// Event handlers
|
|
@@ -613,7 +525,7 @@ export class EzSearch {
|
|
|
613
525
|
this._changeDeboucingTimeout = null;
|
|
614
526
|
}
|
|
615
527
|
}
|
|
616
|
-
keyDownHandler(event) {
|
|
528
|
+
async keyDownHandler(event) {
|
|
617
529
|
this._tabPressed = false;
|
|
618
530
|
if (event.ctrlKey) {
|
|
619
531
|
if (event.key === "f" || event.key === "F") {
|
|
@@ -628,14 +540,24 @@ export class EzSearch {
|
|
|
628
540
|
}
|
|
629
541
|
switch (event.key) {
|
|
630
542
|
case "ArrowDown":
|
|
631
|
-
this.nextOption();
|
|
632
543
|
event.stopPropagation();
|
|
544
|
+
if (this.canShowListOptions()) {
|
|
545
|
+
event.preventDefault();
|
|
546
|
+
}
|
|
547
|
+
if (!this.isOptionsVisible()) {
|
|
548
|
+
this.showOptions();
|
|
549
|
+
}
|
|
550
|
+
await this._searchList.nextOption();
|
|
633
551
|
break;
|
|
634
552
|
case "ArrowUp":
|
|
635
|
-
this.previousOption();
|
|
636
553
|
event.stopPropagation();
|
|
554
|
+
if (this.canShowListOptions()) {
|
|
555
|
+
event.preventDefault();
|
|
556
|
+
}
|
|
557
|
+
await this._searchList.previousOption();
|
|
637
558
|
break;
|
|
638
559
|
case "Enter":
|
|
560
|
+
this.handleEventPropagation(event);
|
|
639
561
|
this.selectCurrentOption();
|
|
640
562
|
break;
|
|
641
563
|
case "Escape":
|
|
@@ -643,7 +565,7 @@ export class EzSearch {
|
|
|
643
565
|
break;
|
|
644
566
|
case "Tab":
|
|
645
567
|
this._tabPressed = true;
|
|
646
|
-
this.controlListWithOnlyOne();
|
|
568
|
+
this.controlListWithOnlyOne(false);
|
|
647
569
|
break;
|
|
648
570
|
}
|
|
649
571
|
//ATENÇÃO: Existe a necessidade de propagar o evento de teclado.
|
|
@@ -652,6 +574,12 @@ export class EzSearch {
|
|
|
652
574
|
//e o contexto pode reagir (fechar um popup por exemplo).
|
|
653
575
|
//event.stopPropagation();
|
|
654
576
|
}
|
|
577
|
+
//O evento deve ter sua propagação interrompida, apenas se a lista de opções estiver sendo exibida.
|
|
578
|
+
handleEventPropagation(event) {
|
|
579
|
+
if (this._ezPopOverPlusElement.opened && this.stopPropagateEnterKeyEvent) {
|
|
580
|
+
event.stopPropagation();
|
|
581
|
+
}
|
|
582
|
+
}
|
|
655
583
|
onTextInputFocusOutHandler() {
|
|
656
584
|
if (this.hideErrorOnFocusOut)
|
|
657
585
|
this.cancelPreselection();
|
|
@@ -659,15 +587,18 @@ export class EzSearch {
|
|
|
659
587
|
canShowListOptions() {
|
|
660
588
|
return !this._showLoading && this._visibleOptions.length > 0;
|
|
661
589
|
}
|
|
590
|
+
canShowLoadSpinDescription() {
|
|
591
|
+
return this._showLoadingDescription && !this._ezPopOverPlusElement.opened;
|
|
592
|
+
}
|
|
593
|
+
onChangePreSelection(value) {
|
|
594
|
+
this._preSelection = value;
|
|
595
|
+
}
|
|
662
596
|
render() {
|
|
663
597
|
var _a;
|
|
664
598
|
ElementIDUtils.addIDInfoIfNotExists(this.el, 'input');
|
|
665
|
-
return (h(Host, null, h("ez-text-input", { "data-element-id": ElementIDUtils.getInternalIDInfo("textInput"), class: this.suppressSearch ? "suppressed-search-input" : "", ref: elem => this._textInput = elem, "data-slave-mode": "true", enabled: this.enabled && !this.suppressSearch, onInput: event => this.onTextInputChangeHandler(event), onFocusout: () => this.onTextInputFocusOutHandler(), onKeyDown: event => this.keyDownHandler(event), label: this.label, canShowError: this.canShowError, errorMessage: this.errorMessage, mode: this.mode }, h("button", { class: "btn", slot: "leftIcon", disabled: !this.enabled, tabindex: -1, onClick: () => this.handlerIconClick() }, h("ez-icon", { iconName: "search" })), (((_a = this._textInput) === null || _a === void 0 ? void 0 : _a.value) && (this._criteria || this.value) || this.
|
|
599
|
+
return (h(Host, null, h("ez-text-input", { "data-element-id": ElementIDUtils.getInternalIDInfo("textInput"), class: this.suppressSearch ? "suppressed-search-input" : "", ref: elem => this._textInput = elem, "data-slave-mode": "true", enabled: this.enabled && !this.suppressSearch, onInput: event => this.onTextInputChangeHandler(event), onFocusout: () => this.onTextInputFocusOutHandler(), onKeyDown: event => this.keyDownHandler(event), label: this.label, canShowError: this.canShowError, errorMessage: this.errorMessage, mode: this.mode }, h("button", { class: "btn", slot: "leftIcon", disabled: !this.enabled, tabindex: -1, onClick: () => this.handlerIconClick() }, this.canShowLoadSpinDescription() ? h("div", { class: "message__loading" }) : h("ez-icon", { iconName: "search" })), (((_a = this._textInput) === null || _a === void 0 ? void 0 : _a.value) && (this._criteria || this.value) || this.ensureClearButtonVisible)
|
|
666
600
|
? h("button", { class: "btn btn__close", slot: "rightIcon", disabled: !this.enabled, tabindex: -1, onClick: () => this.clearSearch() }, h("ez-icon", { iconName: "close" }))
|
|
667
|
-
: undefined), h("
|
|
668
|
-
&& this._visibleOptions.length === 0
|
|
669
|
-
&& h("div", { class: "message" }, h("span", { class: "message__no-result" }, this._textEmptyList)), this._showLoading
|
|
670
|
-
&& h("div", { class: "message" }, h("div", { class: "message__loading" })), h("span", { class: "item__value item__value--hidden", ref: elem => this._itemValueBasis = elem }), this.canShowListOptions() && this._visibleOptions.map((opt, index) => this.buildItem(opt, index)))))));
|
|
601
|
+
: undefined), h("ez-popover-plus", { ref: elem => this._ezPopOverPlusElement = elem, autoClose: false, overlayType: "none", useAnchorSize: true, anchorElement: [this._textInput, this.el] }, h("search-list", { ref: (ref) => this._searchList = ref, showLoading: this._showLoading, visibleOptions: this._visibleOptions, textEmptyList: this._textEmptyList, canShowListOptions: this.canShowListOptions(), value: this.value, showOptionValue: this.showOptionValue, preSelection: this._preSelection, onChangeValue: ({ detail }) => this.selectOption(detail), onChangePreSelection: ({ detail }) => this.onChangePreSelection(detail) }))));
|
|
671
602
|
}
|
|
672
603
|
static get is() { return "ez-search"; }
|
|
673
604
|
static get encapsulation() { return "shadow"; }
|
|
@@ -760,8 +691,8 @@ export class EzSearch {
|
|
|
760
691
|
"type": "unknown",
|
|
761
692
|
"mutable": false,
|
|
762
693
|
"complexType": {
|
|
763
|
-
"original": "(argument: ISearchArgument) => Promise<Array<IOption>> | Array<IOption> | IOption",
|
|
764
|
-
"resolved": "(argument: ISearchArgument) => IOption | IOption[] | Promise<IOption[]>",
|
|
694
|
+
"original": "(argument: ISearchArgument, ctxProperties?: any) => Promise<Array<IOption>> | Array<IOption> | IOption",
|
|
695
|
+
"resolved": "(argument: ISearchArgument, ctxProperties?: any) => IOption | IOption[] | Promise<IOption[]>",
|
|
765
696
|
"references": {
|
|
766
697
|
"ISearchArgument": {
|
|
767
698
|
"location": "local"
|
|
@@ -784,6 +715,23 @@ export class EzSearch {
|
|
|
784
715
|
"text": "Carrega as op\u00E7\u00F5es dinamicamente."
|
|
785
716
|
}
|
|
786
717
|
},
|
|
718
|
+
"contextProperties": {
|
|
719
|
+
"type": "any",
|
|
720
|
+
"mutable": false,
|
|
721
|
+
"complexType": {
|
|
722
|
+
"original": "any",
|
|
723
|
+
"resolved": "any",
|
|
724
|
+
"references": {}
|
|
725
|
+
},
|
|
726
|
+
"required": false,
|
|
727
|
+
"optional": true,
|
|
728
|
+
"docs": {
|
|
729
|
+
"tags": [],
|
|
730
|
+
"text": "Propriedades de contexto da aplica\u00E7\u00E3o."
|
|
731
|
+
},
|
|
732
|
+
"attribute": "context-properties",
|
|
733
|
+
"reflect": false
|
|
734
|
+
},
|
|
787
735
|
"showSelectedValue": {
|
|
788
736
|
"type": "boolean",
|
|
789
737
|
"mutable": false,
|
|
@@ -838,6 +786,24 @@ export class EzSearch {
|
|
|
838
786
|
"reflect": false,
|
|
839
787
|
"defaultValue": "false"
|
|
840
788
|
},
|
|
789
|
+
"stopPropagateEnterKeyEvent": {
|
|
790
|
+
"type": "boolean",
|
|
791
|
+
"mutable": false,
|
|
792
|
+
"complexType": {
|
|
793
|
+
"original": "boolean",
|
|
794
|
+
"resolved": "boolean",
|
|
795
|
+
"references": {}
|
|
796
|
+
},
|
|
797
|
+
"required": false,
|
|
798
|
+
"optional": false,
|
|
799
|
+
"docs": {
|
|
800
|
+
"tags": [],
|
|
801
|
+
"text": "Se true, ineterrompe a propaga\u00E7\u00E3o do evento de KeyDown da tecla enter"
|
|
802
|
+
},
|
|
803
|
+
"attribute": "stop-propagate-enter-key-event",
|
|
804
|
+
"reflect": false,
|
|
805
|
+
"defaultValue": "false"
|
|
806
|
+
},
|
|
841
807
|
"mode": {
|
|
842
808
|
"type": "string",
|
|
843
809
|
"mutable": false,
|
|
@@ -988,7 +954,25 @@ export class EzSearch {
|
|
|
988
954
|
"reflect": false,
|
|
989
955
|
"defaultValue": "false"
|
|
990
956
|
},
|
|
991
|
-
"
|
|
957
|
+
"ensureClearButtonVisible": {
|
|
958
|
+
"type": "boolean",
|
|
959
|
+
"mutable": false,
|
|
960
|
+
"complexType": {
|
|
961
|
+
"original": "boolean",
|
|
962
|
+
"resolved": "boolean",
|
|
963
|
+
"references": {}
|
|
964
|
+
},
|
|
965
|
+
"required": false,
|
|
966
|
+
"optional": false,
|
|
967
|
+
"docs": {
|
|
968
|
+
"tags": [],
|
|
969
|
+
"text": "Garante que o bot\u00E3o de limpar pesquisa est\u00E1 sempre vis\u00EDvel"
|
|
970
|
+
},
|
|
971
|
+
"attribute": "ensure-clear-button-visible",
|
|
972
|
+
"reflect": false,
|
|
973
|
+
"defaultValue": "false"
|
|
974
|
+
},
|
|
975
|
+
"suppressPreLoad": {
|
|
992
976
|
"type": "boolean",
|
|
993
977
|
"mutable": false,
|
|
994
978
|
"complexType": {
|
|
@@ -1000,9 +984,27 @@ export class EzSearch {
|
|
|
1000
984
|
"optional": false,
|
|
1001
985
|
"docs": {
|
|
1002
986
|
"tags": [],
|
|
1003
|
-
"text": "
|
|
987
|
+
"text": "Se true, desabilita pr\u00E9-load das op\u00E7\u00F5es ao carregar componente"
|
|
1004
988
|
},
|
|
1005
|
-
"attribute": "
|
|
989
|
+
"attribute": "suppress-pre-load",
|
|
990
|
+
"reflect": false,
|
|
991
|
+
"defaultValue": "true"
|
|
992
|
+
},
|
|
993
|
+
"autoFocus": {
|
|
994
|
+
"type": "boolean",
|
|
995
|
+
"mutable": false,
|
|
996
|
+
"complexType": {
|
|
997
|
+
"original": "boolean",
|
|
998
|
+
"resolved": "boolean",
|
|
999
|
+
"references": {}
|
|
1000
|
+
},
|
|
1001
|
+
"required": false,
|
|
1002
|
+
"optional": false,
|
|
1003
|
+
"docs": {
|
|
1004
|
+
"tags": [],
|
|
1005
|
+
"text": "Se true o campo de texto receber\u00E1 o foco ao ser renderizado."
|
|
1006
|
+
},
|
|
1007
|
+
"attribute": "auto-focus",
|
|
1006
1008
|
"reflect": false,
|
|
1007
1009
|
"defaultValue": "false"
|
|
1008
1010
|
}
|
|
@@ -1014,6 +1016,7 @@ export class EzSearch {
|
|
|
1014
1016
|
"_visibleOptions": {},
|
|
1015
1017
|
"_startLoading": {},
|
|
1016
1018
|
"_showLoading": {},
|
|
1019
|
+
"_showLoadingDescription": {},
|
|
1017
1020
|
"_criteria": {}
|
|
1018
1021
|
};
|
|
1019
1022
|
}
|
|
@@ -1059,11 +1062,18 @@ export class EzSearch {
|
|
|
1059
1062
|
},
|
|
1060
1063
|
"setFocus": {
|
|
1061
1064
|
"complexType": {
|
|
1062
|
-
"signature": "() => Promise<void>",
|
|
1063
|
-
"parameters": [
|
|
1065
|
+
"signature": "(options?: TFocusOptions) => Promise<void>",
|
|
1066
|
+
"parameters": [{
|
|
1067
|
+
"tags": [],
|
|
1068
|
+
"text": ""
|
|
1069
|
+
}],
|
|
1064
1070
|
"references": {
|
|
1065
1071
|
"Promise": {
|
|
1066
1072
|
"location": "global"
|
|
1073
|
+
},
|
|
1074
|
+
"TFocusOptions": {
|
|
1075
|
+
"location": "import",
|
|
1076
|
+
"path": "../ez-text-input/ez-text-input"
|
|
1067
1077
|
}
|
|
1068
1078
|
},
|
|
1069
1079
|
"return": "Promise<void>"
|
|
@@ -1136,15 +1146,6 @@ export class EzSearch {
|
|
|
1136
1146
|
"methodName": "observeOptions"
|
|
1137
1147
|
}];
|
|
1138
1148
|
}
|
|
1139
|
-
static get listeners() {
|
|
1140
|
-
return [{
|
|
1141
|
-
"name": "scroll",
|
|
1142
|
-
"method": "scrollListener",
|
|
1143
|
-
"target": "window",
|
|
1144
|
-
"capture": true,
|
|
1145
|
-
"passive": true
|
|
1146
|
-
}];
|
|
1147
|
-
}
|
|
1148
1149
|
}
|
|
1149
1150
|
var SearchMode;
|
|
1150
1151
|
(function (SearchMode) {
|