@sankhyalabs/ezui 5.22.0-dev.8 → 5.22.0-dev.80
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/DataBinder-e92314c2.js +445 -0
- package/dist/cjs/FocusResolver-885f2173.js +35 -0
- package/dist/cjs/ez-actions-button.cjs.entry.js +3 -2
- package/dist/cjs/ez-button.cjs.entry.js +11 -5
- package/dist/cjs/ez-card-item_2.cjs.entry.js +76 -0
- package/dist/cjs/ez-check.cjs.entry.js +1 -1
- package/dist/cjs/ez-collapsible-box.cjs.entry.js +1 -1
- package/dist/cjs/ez-combo-box.cjs.entry.js +67 -13
- package/dist/cjs/ez-custom-form-input_2.cjs.entry.js +35 -5
- package/dist/cjs/ez-date-input.cjs.entry.js +14 -4
- package/dist/cjs/ez-date-time-input.cjs.entry.js +11 -4
- package/dist/cjs/ez-dialog.cjs.entry.js +14 -7
- package/dist/cjs/ez-double-list.cjs.entry.js +287 -0
- package/dist/cjs/{ez-dropdown.cjs.entry.js → ez-dropdown_2.cjs.entry.js} +75 -8
- package/dist/cjs/ez-filter-input.cjs.entry.js +130 -0
- package/dist/cjs/ez-form-view.cjs.entry.js +29 -22
- package/dist/cjs/ez-form.cjs.entry.js +6 -325
- package/dist/cjs/ez-grid.cjs.entry.js +14861 -69696
- 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 -1
- package/dist/cjs/ez-modal.cjs.entry.js +19 -4
- package/dist/cjs/ez-multi-selection-list.cjs.entry.js +2 -2
- package/dist/cjs/ez-number-input.cjs.entry.js +15 -2
- 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 +108 -47
- 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 +5 -2
- 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 +153 -16
- package/dist/cjs/ez-time-input.cjs.entry.js +8 -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 +2 -2
- package/dist/cjs/index-a7b0c73d.js +16 -8
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +3 -1
- package/dist/collection/components/ez-actions-button/ez-actions-button.js +3 -2
- package/dist/collection/components/ez-button/ez-button.css +23 -13
- package/dist/collection/components/ez-button/ez-button.js +12 -6
- package/dist/collection/components/ez-card-item/ez-card-item.css +60 -10
- package/dist/collection/components/ez-card-item/ez-card-item.js +30 -3
- package/dist/collection/components/ez-check/ez-check.css +1 -6
- package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.css +2 -2
- package/dist/collection/components/ez-combo-box/ez-combo-box.css +13 -1
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +130 -15
- package/dist/collection/components/ez-date-input/ez-date-input.css +1 -1
- package/dist/collection/components/ez-date-input/ez-date-input.js +58 -5
- 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 +55 -5
- 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.js +55 -5
- package/dist/collection/components/ez-form/ez-form.js +1 -0
- package/dist/collection/components/ez-form-view/custom-input/ez-custom-form-input.js +49 -6
- package/dist/collection/components/ez-form-view/ez-form-view.css +5 -2
- package/dist/collection/components/ez-form-view/fieldbuilder/FieldBuilder.js +2 -1
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/CheckBox.tpl.js +1 -1
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/ComboBox.tpl.js +1 -1
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/DateInput.tpl.js +8 -4
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/FileInput.tpl.js +1 -1
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/NumberInput.tpl.js +1 -1
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/SearchInput.tpl.js +3 -2
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/TextArea.tpl.js +1 -1
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/TextInput.tpl.js +2 -2
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +292 -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/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 +47 -8
- package/dist/collection/components/ez-grid/ez-grid.js +280 -9
- package/dist/collection/components/ez-grid/subcomponents/filter-column.css +4 -0
- package/dist/collection/components/ez-grid/subcomponents/filter-column.js +1 -1
- package/dist/collection/components/ez-icon/ez-icon.css +155 -149
- package/dist/collection/components/ez-list/ez-list.css +2 -1
- 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 +5 -1
- package/dist/collection/components/ez-modal/ez-modal.js +38 -5
- package/dist/collection/components/ez-modal-container/ez-modal-container.js +20 -1
- package/dist/collection/components/ez-multi-selection-list/ez-multi-selection-list.css +2 -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 +68 -1
- package/dist/collection/components/ez-popup/ez-popup.css +8 -3
- package/dist/collection/components/ez-popup/ez-popup.js +43 -3
- package/dist/collection/components/ez-scroller/ez-scroller.css +1 -0
- package/dist/collection/components/ez-search/ez-search.css +21 -10
- package/dist/collection/components/ez-search/ez-search.js +211 -53
- package/dist/collection/components/ez-sidebar-button/ez-sidebar-button.css +3 -0
- package/dist/collection/components/ez-sidebar-button/ez-sidebar-button.js +1 -1
- package/dist/collection/components/ez-sidebar-navigator/ez-sidebar-navigator.css +3 -1
- package/dist/collection/components/ez-skeleton/ez-skeleton.css +54 -34
- package/dist/collection/components/ez-split-button/ez-split-button.css +50 -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 +185 -15
- package/dist/collection/components/ez-time-input/ez-time-input.js +44 -1
- 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/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 +12 -0
- package/dist/custom-elements/index.js +16502 -70294
- package/dist/esm/DataBinder-9c877244.js +441 -0
- package/dist/esm/FocusResolver-1ccbf850.js +33 -0
- package/dist/esm/ez-actions-button.entry.js +3 -2
- package/dist/esm/ez-button.entry.js +11 -5
- package/dist/esm/ez-card-item_2.entry.js +71 -0
- package/dist/esm/ez-check.entry.js +1 -1
- package/dist/esm/ez-collapsible-box.entry.js +1 -1
- package/dist/esm/ez-combo-box.entry.js +68 -14
- package/dist/esm/ez-custom-form-input_2.entry.js +36 -6
- package/dist/esm/ez-date-input.entry.js +14 -4
- package/dist/esm/ez-date-time-input.entry.js +11 -4
- package/dist/esm/ez-dialog.entry.js +15 -8
- package/dist/esm/ez-double-list.entry.js +283 -0
- package/dist/esm/{ez-dropdown.entry.js → ez-dropdown_2.entry.js} +75 -9
- package/dist/esm/ez-filter-input.entry.js +126 -0
- package/dist/esm/ez-form-view.entry.js +29 -22
- package/dist/esm/ez-form.entry.js +5 -324
- package/dist/esm/ez-grid.entry.js +14891 -69726
- 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 -1
- package/dist/esm/ez-modal.entry.js +19 -4
- package/dist/esm/ez-multi-selection-list.entry.js +2 -2
- package/dist/esm/ez-number-input.entry.js +15 -2
- 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 +108 -47
- 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 +5 -2
- 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 +153 -16
- package/dist/esm/ez-time-input.entry.js +8 -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 +2 -2
- package/dist/esm/index-baa5e267.js +16 -8
- package/dist/esm/loader.js +1 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-14b769d7.entry.js +1 -0
- package/dist/ezui/p-16e612fc.entry.js +1 -0
- package/dist/ezui/p-17eabf46.entry.js +1 -0
- package/dist/ezui/p-2475fd6e.entry.js +1 -0
- package/dist/ezui/p-2bb2a0c4.entry.js +1 -0
- package/dist/ezui/p-2f45506d.entry.js +1 -0
- package/dist/ezui/p-35464ae8.entry.js +1 -0
- package/dist/ezui/p-354abfe8.entry.js +1 -0
- package/dist/ezui/{p-baf80b13.entry.js → p-35d467a8.entry.js} +1 -1
- package/dist/ezui/p-3f2dd525.entry.js +1 -0
- package/dist/ezui/p-420f97ff.entry.js +1 -0
- package/dist/ezui/p-50d83a46.entry.js +1 -0
- package/dist/ezui/p-654b3f99.entry.js +1 -0
- package/dist/ezui/p-65f471bc.entry.js +1 -0
- package/dist/ezui/p-6cdd3e0a.entry.js +1 -0
- package/dist/ezui/p-6d79930d.entry.js +1 -0
- package/dist/ezui/p-6f22a385.entry.js +1 -0
- package/dist/ezui/p-7409eeaa.entry.js +1 -0
- package/dist/ezui/p-7e677b7b.entry.js +1 -0
- package/dist/ezui/{p-bf79aaa1.entry.js → p-7fdd479f.entry.js} +1 -1
- package/dist/ezui/p-80dfc50b.js +1 -0
- package/dist/ezui/p-990b4318.entry.js +1 -0
- package/dist/ezui/p-a6fe527a.entry.js +1 -0
- package/dist/ezui/p-acddfb2e.js +1 -0
- package/dist/ezui/p-b6597f49.entry.js +309 -0
- package/dist/ezui/p-b6a4e6de.entry.js +1 -0
- package/dist/ezui/p-c3045972.entry.js +1 -0
- package/dist/ezui/p-ca6340a9.entry.js +1 -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-dc8b36c3.entry.js +1 -0
- package/dist/ezui/{p-84e439b9.entry.js → p-e347df9c.entry.js} +1 -1
- package/dist/ezui/p-e3e3fd7a.entry.js +1 -0
- package/dist/ezui/p-ea54d056.entry.js +1 -0
- package/dist/ezui/p-f43dbada.entry.js +1 -0
- package/dist/ezui/p-fa6732f2.entry.js +1 -0
- package/dist/ezui/p-fec696ab.entry.js +1 -0
- package/dist/types/components/ez-button/ez-button.d.ts +2 -1
- package/dist/types/components/ez-card-item/ez-card-item.d.ts +5 -0
- package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +16 -1
- package/dist/types/components/ez-date-input/ez-date-input.d.ts +10 -1
- package/dist/types/components/ez-date-time-input/ez-date-time-input.d.ts +10 -1
- package/dist/types/components/ez-dialog/ez-dialog.d.ts +2 -1
- package/dist/types/components/ez-double-list/doubleListHelper.d.ts +10 -0
- package/dist/types/components/ez-double-list/ez-double-list.d.ts +87 -0
- package/dist/types/components/ez-dropdown/ez-dropdown.d.ts +4 -0
- package/dist/types/components/ez-dropdown/structure/DropdownItem.d.ts +1 -1
- package/dist/types/components/ez-filter-input/ez-filter-input.d.ts +10 -1
- package/dist/types/components/ez-form-view/custom-input/ez-custom-form-input.d.ts +7 -1
- package/dist/types/components/ez-form-view/fieldbuilder/templates/DateInput.tpl.d.ts +2 -1
- package/dist/types/components/ez-form-view/fieldbuilder/templates/SearchInput.tpl.d.ts +1 -1
- package/dist/types/components/ez-form-view/fieldbuilder/templates/TextInput.tpl.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/EzGridController.d.ts +71 -4
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +36 -4
- package/dist/types/components/ez-grid/controller/ag-grid/DataSource.d.ts +25 -2
- package/dist/types/components/ez-grid/controller/ag-grid/GridEditionManager.d.ts +33 -7
- package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomCellEditor.d.ts +4 -1
- package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomCellRender.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomHeader.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/ag-grid/components/cellRendererStatus.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/ag-grid/components/selectionHeader.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/ag-grid/editor/EzCellEditor.d.ts +2 -1
- package/dist/types/components/ez-grid/controller/ag-grid/editor/EzCellRender.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/ag-grid/editor/IUICellEditor.d.ts +1 -0
- package/dist/types/components/ez-grid/controller/ag-grid/mock/Server.d.ts +1 -1
- package/dist/types/components/ez-grid/ez-grid.d.ts +49 -1
- 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 +7 -1
- package/dist/types/components/ez-modal-container/ez-modal-container.d.ts +4 -0
- package/dist/types/components/ez-number-input/ez-number-input.d.ts +12 -0
- package/dist/types/components/ez-popup/ez-popup.d.ts +8 -1
- package/dist/types/components/ez-search/ez-search.d.ts +34 -6
- package/dist/types/components/ez-split-button/ez-split-button.d.ts +1 -1
- package/dist/types/components/ez-split-panel/ez-split-panel.d.ts +11 -0
- package/dist/types/components/ez-split-panel/interfaces/IPanelSizeInfo.d.ts +9 -0
- package/dist/types/components/ez-split-panel/structure/item/ez-split-item.d.ts +5 -0
- package/dist/types/components/ez-text-area/ez-text-area.d.ts +17 -0
- package/dist/types/components/ez-text-input/ez-text-input.d.ts +28 -2
- package/dist/types/components/ez-time-input/ez-time-input.d.ts +8 -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 +486 -27
- 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 +12 -4
- package/react/components.d.ts +2 -0
- package/react/components.js +2 -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-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-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-30775e7f.entry.js +0 -1
- package/dist/ezui/p-32e553e5.entry.js +0 -304
- package/dist/ezui/p-3b4eeeb6.entry.js +0 -1
- package/dist/ezui/p-3faa2b46.entry.js +0 -1
- package/dist/ezui/p-49456b34.entry.js +0 -1
- package/dist/ezui/p-4d5235f1.entry.js +0 -1
- package/dist/ezui/p-5bd5e68f.entry.js +0 -1
- package/dist/ezui/p-784fe207.entry.js +0 -1
- package/dist/ezui/p-7922142b.entry.js +0 -1
- package/dist/ezui/p-7af81663.entry.js +0 -1
- package/dist/ezui/p-7bc07c31.entry.js +0 -1
- package/dist/ezui/p-85c8baae.entry.js +0 -1
- package/dist/ezui/p-8888d9ed.entry.js +0 -1
- package/dist/ezui/p-8f0144f6.entry.js +0 -1
- package/dist/ezui/p-9050d2cd.entry.js +0 -1
- package/dist/ezui/p-922ac38b.entry.js +0 -1
- package/dist/ezui/p-9ab22a07.entry.js +0 -1
- package/dist/ezui/p-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-bcb53f27.entry.js +0 -1
- package/dist/ezui/p-d9401ea0.entry.js +0 -1
- package/dist/ezui/p-e85c48d7.entry.js +0 -1
- package/dist/ezui/p-ecc2c1ec.entry.js +0 -1
- package/dist/ezui/p-f3c526cc.entry.js +0 -1
- package/dist/ezui/p-fcf0acce.entry.js +0 -1
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-a7b0c73d.js');
|
|
6
|
-
const core = require('@sankhyalabs/core');
|
|
7
|
-
const CSSVarsUtils = require('./CSSVarsUtils-10c9d5b4.js');
|
|
8
|
-
|
|
9
|
-
const ezCardItemCss = ":host {\n /*@doc Define o tamanho da fonte do componente.*/\n --ez-card-item--font-size: var(--text--medium, 14px);\n\n /*@doc Define a família da fonte do componente.*/\n --ez-card-item--font-family: var(--font-pattern, Arial);\n\n /*@doc Define o peso da fonte do componente.*/\n --ez-card-item--font-weight: var(--text-weight--medium, 400);\n\n /*@doc Define o peso da fonte do title do componente.*/\n --ez-card-item--font-weight-large: var(--text-weight--large, 600);\n\n /*@doc Define a cor da fonte do componente.*/\n --ez-card-item--color: var(--title--primary, #2B3A54);\n\n /*@doc Define a cor da fonte da key do componente.*/\n --ez-card-item__key--color: var(--text--primary, #626e82);\n\n /*@doc Define a cor da fonte do label do detalhe do componente.*/\n --ez-card-item__detail-label--color: var(--text--secondary, #A2ABB9);\n\n /*@doc Define o espaçamento inferior dos detalhes do componente.*/\n --ez-card-item__detail--padding-bottom: var(--space--extra-small, 3px);\n\n /*@doc Define o espaçamento inferior do title do componente.*/\n --ez-card-item__title--padding-bottom: var(--space--extra-small, 3px);\n\n /*@doc Define a cor do highlight / marcação nos textos do componente.*/\n --ez-card-item__highlight--color: var(--color--primary-300, #E2F4EF);\n\n width: 100%;\n display: flex;\n cursor: pointer;\n}\n\n.card-item {\n display: flex;\n flex-direction: column;\n width: 100%;\n cursor: pointer;\n padding: 12px;\n z-index: 0;\n position: relative;\n container-type: inline-size;\n container-name: box;\n white-space: pre-line;\n}\n\n.card-item:hover {\n background: #F0F3F7;\n border-radius: 12px;\n}\n\n.card-item__title {\n display: flex;\n align-items: center;\n line-height: 18px;\n cursor: pointer;\n\n /*public*/\n font-size: var(--ez-card-item--font-size);\n font-family: var(--ez-card-item--font-family);\n font-weight: var(--ez-card-item--font-weight-large);\n color: var(--ez-card-item--color);\n padding-bottom: var(--ez-card-item__title--padding-bottom);\n gap: var(--space--small, 6px);\n}\n\n.card-item__key {\n /*public*/\n color: var(--ez-card-item__key--color);\n}\n\n.card-item__details {\n display: flex;\n flex-direction: column;\n cursor: pointer;\n justify-content: space-between;\n width: 100%;\n}\n\n.card-item__details-container__left {\n white-space: pre-line;\n cursor: pointer;\n width: 50%;\n}\n\n.card-item__details-container__right {\n white-space: pre-line;\n width: 50%;\n cursor: pointer;\n}\n\n.card-item__detail:not(:last-child) {\n cursor: pointer;\n white-space: pre-line;\n\n /*public*/\n padding-bottom: var(--ez-card-item__detail--padding-bottom);\n}\n\n.card-item__detail-label {\n cursor: pointer;\n\n /*public*/\n font-size: var(--ez-card-item--font-size);\n font-family: var(--ez-card-item--font-family);\n font-weight: var(--ez-card-item--font-weight);\n color: var(--ez-card-item__detail-label--color);\n}\n\n.card-item__detail-value {\n cursor: pointer;\n line-break: anywhere;\n\n /*public*/\n font-size: var(--ez-card-item--font-size);\n font-family: var(--ez-card-item--font-family);\n font-weight: var(--ez-card-item--font-weight);\n color: var(--ez-card-item--color);\n}\n\n.card-item__highlight {\n position: relative;\n border-radius: 8px;\n z-index: -1;\n\n /*public*/\n background-color: var(--ez-card-item__highlight--color);\n outline: 2px solid var(--ez-card-item__highlight--color);\n box-shadow: -4px 0px 0px 0px var(--ez-card-item__highlight--color), \n 4px 0px 0px 0px var(--ez-card-item__highlight--color);\n}\n\n.card-item__content{\n display: flex;\n align-items: center;\n}\n\n.card-item__details-container{\n display: flex;\n}\n\n.card-item__details-slot{\n margin-left: auto;\n}\n\n@container box (max-width: 550px) {\n .card-item__details {\n flex-direction: column;\n }\n\n .card-item__details-container__left {\n width: 100%;\n }\n \n .card-item__details-container__right {\n width: 100%;\n }\n}\n\n@container box (max-width: 200px) {\n .card-item__title {\n font-size: 10px;\n }\n\n .card-item__detail-label {\n font-size: 10px;\n }\n\n .card-item__detail-value {\n font-size: 10px;\n }\n\n}";
|
|
10
|
-
|
|
11
|
-
const EzCardItem = class {
|
|
12
|
-
constructor(hostRef) {
|
|
13
|
-
index.registerInstance(this, hostRef);
|
|
14
|
-
this.ezClick = index.createEvent(this, "ezClick", 7);
|
|
15
|
-
this.item = undefined;
|
|
16
|
-
this.enableKey = true;
|
|
17
|
-
}
|
|
18
|
-
componentWillRender() {
|
|
19
|
-
this.createDetailList();
|
|
20
|
-
}
|
|
21
|
-
componentDidLoad() {
|
|
22
|
-
var _a, _b;
|
|
23
|
-
const dataInfo = { id: core.StringUtils.toCamelCase(((_a = this.item) === null || _a === void 0 ? void 0 : _a.key) || ((_b = this.item) === null || _b === void 0 ? void 0 : _b.title) || "") };
|
|
24
|
-
core.ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
|
25
|
-
}
|
|
26
|
-
createDetailList() {
|
|
27
|
-
var _a, _b, _c;
|
|
28
|
-
this._details = { detailsLeft: [], detailsRight: [] };
|
|
29
|
-
let cont = 0;
|
|
30
|
-
if ((_a = this.item) === null || _a === void 0 ? void 0 : _a.details) {
|
|
31
|
-
for (const attribute in this.item.details) {
|
|
32
|
-
cont < 3 ?
|
|
33
|
-
this._details.detailsLeft.push({ label: attribute, value: (_b = this.item.details[attribute]) === null || _b === void 0 ? void 0 : _b.toString() }) :
|
|
34
|
-
this._details.detailsRight.push({ label: attribute, value: (_c = this.item.details[attribute]) === null || _c === void 0 ? void 0 : _c.toString() });
|
|
35
|
-
cont++;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
buildDetailContent(detail) {
|
|
40
|
-
return index.h("div", { class: "card-item__detail" }, index.h("label", { class: "card-item__detail-label" }, detail.label), ": ", index.h("label", { class: "card-item__detail-value", innerHTML: detail.value }));
|
|
41
|
-
}
|
|
42
|
-
render() {
|
|
43
|
-
return (index.h(index.Host, null, this.item &&
|
|
44
|
-
index.h("div", { class: "card-item", onClick: () => { this.ezClick.emit(this.item); } }, index.h("div", { class: "ez-row card-item__content" }, index.h("div", { class: "ez-col ez-col--sd-11 card-item__details" }, index.h("label", { class: "card-item__title" }, this.enableKey && (index.h("span", { class: "card-item__key", innerHTML: this.item.key })), index.h("span", { innerHTML: this.item.title })), index.h("div", { class: "card-item__details-container" }, index.h("div", { class: "card-item__details-container__left" }, this._details.detailsLeft.map(detail => {
|
|
45
|
-
return this.buildDetailContent(detail);
|
|
46
|
-
})), index.h("div", { class: "card-item__details-container__right" }, this._details.detailsRight.map(detail => {
|
|
47
|
-
return this.buildDetailContent(detail);
|
|
48
|
-
})))), index.h("div", { class: "ez-col ez-col--sd-1 card-item__details-slot" }, index.h("slot", { name: "rightSlot" }))))));
|
|
49
|
-
}
|
|
50
|
-
get _element() { return index.getElement(this); }
|
|
51
|
-
};
|
|
52
|
-
EzCardItem.style = ezCardItemCss;
|
|
53
|
-
|
|
54
|
-
const ezFilterInputCss = ":host{display:block;width:100%}";
|
|
55
|
-
|
|
56
|
-
const EzFilterInput = class {
|
|
57
|
-
constructor(hostRef) {
|
|
58
|
-
index.registerInstance(this, hostRef);
|
|
59
|
-
this.ezChange = index.createEvent(this, "ezChange", 7);
|
|
60
|
-
this.ezSearching = index.createEvent(this, "ezSearching", 7);
|
|
61
|
-
this.ezFocusIn = index.createEvent(this, "ezFocusIn", 7);
|
|
62
|
-
this._searchingText = "";
|
|
63
|
-
this.handleFocus = () => {
|
|
64
|
-
if (this._searchingText === "") {
|
|
65
|
-
this._textInput.value = "";
|
|
66
|
-
}
|
|
67
|
-
else {
|
|
68
|
-
this._textInput.value = this._searchingText;
|
|
69
|
-
}
|
|
70
|
-
this.ezFocusIn.emit();
|
|
71
|
-
};
|
|
72
|
-
this.label = undefined;
|
|
73
|
-
this.value = undefined;
|
|
74
|
-
this.enabled = true;
|
|
75
|
-
this.errorMessage = undefined;
|
|
76
|
-
this.restrict = undefined;
|
|
77
|
-
this.mode = "regular";
|
|
78
|
-
this.asyncSearch = false;
|
|
79
|
-
this.canShowError = true;
|
|
80
|
-
}
|
|
81
|
-
observeLabel() {
|
|
82
|
-
if (this._textInput) {
|
|
83
|
-
this._textInput.label = this.label;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
observeErrorMessage() {
|
|
87
|
-
if (this._textInput) {
|
|
88
|
-
this._textInput.errorMessage = this.errorMessage;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
observeValue(newValue, oldValue) {
|
|
92
|
-
if (this._textInput && newValue != oldValue) {
|
|
93
|
-
this._textInput.value = newValue;
|
|
94
|
-
this.ezChange.emit(newValue);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Aplica o foco no campo.
|
|
99
|
-
*/
|
|
100
|
-
async setFocus() {
|
|
101
|
-
this._textInput.setFocus();
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Remove o foco do campo.
|
|
105
|
-
*/
|
|
106
|
-
async setBlur() {
|
|
107
|
-
this._textInput.setBlur();
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* Retorna se o conteúdo é inválido.
|
|
111
|
-
*/
|
|
112
|
-
async isInvalid() {
|
|
113
|
-
return typeof this.errorMessage === "string" && this.errorMessage.trim() !== "";
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* Método responsável por setar um novo valor ao campo.
|
|
117
|
-
*/
|
|
118
|
-
async setValue(newValue) {
|
|
119
|
-
if (!this.asyncSearch || this._textInput == undefined) {
|
|
120
|
-
return;
|
|
121
|
-
}
|
|
122
|
-
if (newValue !== this.value) {
|
|
123
|
-
this.value = newValue;
|
|
124
|
-
this._searchingText = "";
|
|
125
|
-
}
|
|
126
|
-
else {
|
|
127
|
-
this._textInput.value = newValue;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
/**
|
|
131
|
-
* Método responsável por resetar o valor do campo para o ultimo valor inputado.
|
|
132
|
-
*/
|
|
133
|
-
async endSearch() {
|
|
134
|
-
if (!this.asyncSearch || this._textInput == undefined) {
|
|
135
|
-
return;
|
|
136
|
-
}
|
|
137
|
-
if (this._textInput.value !== this.value) {
|
|
138
|
-
this._textInput.value = this.value;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
handleChange(evt) {
|
|
142
|
-
const newValue = evt.detail;
|
|
143
|
-
this.errorMessage = "";
|
|
144
|
-
if (this.asyncSearch) {
|
|
145
|
-
this._searchingText = newValue;
|
|
146
|
-
this.ezSearching.emit(newValue);
|
|
147
|
-
}
|
|
148
|
-
else if (newValue !== this.value) {
|
|
149
|
-
this.value = newValue;
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
componentDidLoad() {
|
|
153
|
-
CSSVarsUtils.CSSVarsUtils.applyVarsTextInput(this._elem, this._textInput);
|
|
154
|
-
}
|
|
155
|
-
render() {
|
|
156
|
-
core.ElementIDUtils.addIDInfoIfNotExists(this._elem, 'input');
|
|
157
|
-
return (index.h("ez-text-input", { "data-element-id": core.ElementIDUtils.getInternalIDInfo("textInput"), ref: elem => this._textInput = elem, label: this.label, onEzChange: evt => this.handleChange(evt), value: this.value, enabled: this.enabled, errorMessage: this.errorMessage, restrict: this.restrict, mode: this.mode, onFocusin: this.handleFocus, canShowError: this.canShowError }, index.h("ez-icon", { slot: "leftIcon", iconName: "search" })));
|
|
158
|
-
}
|
|
159
|
-
get _elem() { return index.getElement(this); }
|
|
160
|
-
static get watchers() { return {
|
|
161
|
-
"label": ["observeLabel"],
|
|
162
|
-
"errorMessage": ["observeErrorMessage"],
|
|
163
|
-
"value": ["observeValue"]
|
|
164
|
-
}; }
|
|
165
|
-
};
|
|
166
|
-
EzFilterInput.style = ezFilterInputCss;
|
|
167
|
-
|
|
168
|
-
const multiSelectionBoxMessageCss = ".multi-selection__message{display:flex;flex-direction:row;align-items:center;justify-content:center;width:100%;min-height:320px;text-align:center}.multi-selection__text-message{margin-top:-30px;font-family:var(--font-pattern);font-size:var(--text--meduim);padding:var(--space-xs);color:var(--text--primary)}";
|
|
169
|
-
|
|
170
|
-
const MultiSelectionBoxMessage = class {
|
|
171
|
-
constructor(hostRef) {
|
|
172
|
-
index.registerInstance(this, hostRef);
|
|
173
|
-
this.message = undefined;
|
|
174
|
-
}
|
|
175
|
-
render() {
|
|
176
|
-
return (index.h("div", { class: "multi-selection__message" }, index.h("span", { class: "multi-selection__text-message" }, this.message)));
|
|
177
|
-
}
|
|
178
|
-
};
|
|
179
|
-
MultiSelectionBoxMessage.style = multiSelectionBoxMessageCss;
|
|
180
|
-
|
|
181
|
-
exports.ez_card_item = EzCardItem;
|
|
182
|
-
exports.ez_filter_input = EzFilterInput;
|
|
183
|
-
exports.multi_selection_box_message = MultiSelectionBoxMessage;
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-a7b0c73d.js');
|
|
6
|
-
|
|
7
|
-
const ALLOWED_ANIMATIONS = ['progress', 'progress-dark', 'pulse', 'false'];
|
|
8
|
-
|
|
9
|
-
const ezSkeletonCss = ".skeleton {\n\tbox-sizing: border-box;\n\toutline: none;\n\toverflow: hidden;\n\tposition: relative;\n\n\tbackground:var(--skeleton-background, #eff1f6) no-repeat;\n\n\tborder-radius: var(--skeleton-border-radius, 4px);\n\twidth: var(--skeleton-width, 100%);\n\theight: var(--skeleton-height, 20px);\n\tdisplay: inline-block;\n\tmargin-bottom: var(--skeleton-margin-bottom, 0px);\n\twill-change: transform;\n\n\t&:after,\n\t&:before {\n\t\tbox-sizing: border-box;\n\t}\n\n\t&.circle {\n\t\twidth: var(--skeleton-width, 40px);\n\t\theight: var(--skeleton-height, 40px);\n\t\tmargin-bottom: var(--skeleton-margin-bottom, 5px);\n\t\tborder-radius: var(--skeleton-border-radius, 50%);\n\t}\n\n\t&.rect {\n\t\tborder-radius: var(--skeleton-border-radius, 0px);\n\t}\n\n\t&.progress,\n\t&.progress-dark {\n\t\tanimation: progress 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;\n\t\tbackground-size: 200px 100%;\n\t}\n\n\t&.progress {\n\t\tbackground-image: linear-gradient(\n\t\t\t90deg,\n\t\t\trgba(255, 255, 255, 0),\n\t\t\trgba(255, 255, 255, 0.6),\n\t\t\trgba(255, 255, 255, 0)\n\t\t);\n\t}\n\n\t&.progress-dark {\n\t\tbackground-image: linear-gradient(\n\t\t\t90deg,\n\t\t\ttransparent,\n\t\t\trgba(0, 0, 0, 0.2),\n\t\t\ttransparent\n\t\t);\n\t}\n\n\t&.pulse {\n\t\tanimation: pulse 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;\n\t\tanimation-delay: 0.5s;\n\t}\n\n\t@media (prefers-reduced-motion: reduce) {\n\t\t&.pulse,\n\t\t&.progress-dark,\n\t\t&.progress {\n\t\t\tanimation: none;\n\t\t}\n\n\t\t&.progress,\n\t\t&.progress-dark {\n\t\t\tbackground-image: none;\n\t\t}\n\t}\n}\n\n@keyframes progress {\n\t0% {\n\t\tbackground-position: -200px 0;\n\t}\n\t100% {\n\t\tbackground-position: calc(200px + 100%) 0;\n\t}\n}\n\n@keyframes pulse {\n\t0% {\n\t\topacity: 1;\n\t}\n\t50% {\n\t\topacity: 0.4;\n\t}\n\t100% {\n\t\topacity: 1;\n\t}\n}";
|
|
10
|
-
|
|
11
|
-
const EzSkeleton = class {
|
|
12
|
-
constructor(hostRef) {
|
|
13
|
-
index.registerInstance(this, hostRef);
|
|
14
|
-
this.items = [];
|
|
15
|
-
this.count = 1;
|
|
16
|
-
this.variant = 'text';
|
|
17
|
-
this.width = null;
|
|
18
|
-
this.height = null;
|
|
19
|
-
this.marginBottom = null;
|
|
20
|
-
this.animation = 'progress';
|
|
21
|
-
}
|
|
22
|
-
componentWillLoad() {
|
|
23
|
-
this.init();
|
|
24
|
-
}
|
|
25
|
-
componentWillUpdate() {
|
|
26
|
-
this.init();
|
|
27
|
-
}
|
|
28
|
-
init() {
|
|
29
|
-
this.items.length = this.count;
|
|
30
|
-
this.items.fill(1);
|
|
31
|
-
if (!ALLOWED_ANIMATIONS.includes(this.animation)) {
|
|
32
|
-
this.animation = 'progress';
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
get style() {
|
|
36
|
-
let dimenssionsStyles = {
|
|
37
|
-
width: null,
|
|
38
|
-
height: null,
|
|
39
|
-
marginBottom: null
|
|
40
|
-
};
|
|
41
|
-
if (this.width) {
|
|
42
|
-
dimenssionsStyles.width = this.width;
|
|
43
|
-
}
|
|
44
|
-
if (this.height) {
|
|
45
|
-
dimenssionsStyles.height = this.height;
|
|
46
|
-
}
|
|
47
|
-
if (this.marginBottom) {
|
|
48
|
-
dimenssionsStyles.marginBottom = this.marginBottom;
|
|
49
|
-
}
|
|
50
|
-
return dimenssionsStyles;
|
|
51
|
-
}
|
|
52
|
-
render() {
|
|
53
|
-
return this.items.map((_, index$1) => {
|
|
54
|
-
return (index.h("span", { key: index$1, class: {
|
|
55
|
-
circle: this.variant === 'circle',
|
|
56
|
-
rect: this.variant === 'rect',
|
|
57
|
-
progress: this.animation === 'progress',
|
|
58
|
-
'progress-dark': this.animation === 'progress-dark',
|
|
59
|
-
pulse: this.animation === 'pulse',
|
|
60
|
-
skeleton: true
|
|
61
|
-
}, "data-busy": "true", "data-valuemin": "0", "data-valuemax": "100", "data-valuetext": "Loading...", role: "progressbar", tabindex: "0", style: this.style }));
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
EzSkeleton.style = ezSkeletonCss;
|
|
66
|
-
|
|
67
|
-
exports.ez_skeleton = EzSkeleton;
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { UserInterface } from '@sankhyalabs/core';
|
|
2
|
-
import { A as ApplicationUtils } from './ApplicationUtils-eaf91331.js';
|
|
3
|
-
|
|
4
|
-
const buildFieldMetadata = (descriptor, config) => {
|
|
5
|
-
let { name, label, group } = Object.assign({}, config);
|
|
6
|
-
let { readOnly, required } = Object.assign({}, config);
|
|
7
|
-
let props;
|
|
8
|
-
let userInterface;
|
|
9
|
-
if (descriptor) {
|
|
10
|
-
label = label || descriptor.label;
|
|
11
|
-
name = name || descriptor.name;
|
|
12
|
-
required = descriptor.required || (config === null || config === void 0 ? void 0 : config.required);
|
|
13
|
-
readOnly = descriptor.readOnly || (config === null || config === void 0 ? void 0 : config.readOnly);
|
|
14
|
-
props = descriptor.properties;
|
|
15
|
-
userInterface = descriptor.userInterface;
|
|
16
|
-
}
|
|
17
|
-
return {
|
|
18
|
-
name, label, group,
|
|
19
|
-
readOnly, required,
|
|
20
|
-
props,
|
|
21
|
-
userInterface: userInterface || UserInterface.SHORTTEXT
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
class RecordValidationProcessor {
|
|
26
|
-
constructor(dataUnit, validationSource, validator) {
|
|
27
|
-
this._dataUnit = dataUnit;
|
|
28
|
-
this._validationSource = validationSource;
|
|
29
|
-
this._validator = validator;
|
|
30
|
-
}
|
|
31
|
-
validate() {
|
|
32
|
-
return new Promise((accept, reject) => {
|
|
33
|
-
const records = this._dataUnit.getModifiedRecords();
|
|
34
|
-
for (let i = 0; i < records.length; i++) {
|
|
35
|
-
const record = records[i];
|
|
36
|
-
const invalidResults = [];
|
|
37
|
-
let validationResult = this.validateRequired(record);
|
|
38
|
-
if (validationResult && !validationResult.isValid) {
|
|
39
|
-
invalidResults.push(validationResult);
|
|
40
|
-
}
|
|
41
|
-
if (this._validator) {
|
|
42
|
-
validationResult = this._validator.validateRecord(record);
|
|
43
|
-
if (validationResult && !validationResult.isValid) {
|
|
44
|
-
invalidResults.push(validationResult);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
if (invalidResults.length > 0) {
|
|
48
|
-
this.processValidationResult(invalidResults, record.__record__id__);
|
|
49
|
-
reject();
|
|
50
|
-
break;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
return accept();
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
validateRequired(record) {
|
|
57
|
-
const requiredFields = this._validationSource.getRequiredFields();
|
|
58
|
-
const invalidFields = [];
|
|
59
|
-
new Set(requiredFields).forEach(field => {
|
|
60
|
-
const value = record[field];
|
|
61
|
-
if (value == undefined || value === "") {
|
|
62
|
-
const errorMessage = this._validationSource.getMessageForField(field, record.__record__id__);
|
|
63
|
-
if (errorMessage) {
|
|
64
|
-
invalidFields.push({ name: field, message: errorMessage });
|
|
65
|
-
}
|
|
66
|
-
else {
|
|
67
|
-
invalidFields.push({ name: field, message: "Essa informação é obrigatória" });
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
if (invalidFields.length > 0) {
|
|
72
|
-
return { isValid: false, invalidFields, infoMessage: "Há pelo menos um campo obrigatório não preenchido." };
|
|
73
|
-
}
|
|
74
|
-
return undefined;
|
|
75
|
-
}
|
|
76
|
-
processValidationResult(validationResult, recordId) {
|
|
77
|
-
validationResult.forEach(invalidResult => {
|
|
78
|
-
const invalidFields = invalidResult.invalidFields;
|
|
79
|
-
if (invalidFields) {
|
|
80
|
-
invalidFields.forEach(field => {
|
|
81
|
-
this.markAsInvalid(field, recordId);
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
if (invalidResult.infoMessage) {
|
|
85
|
-
ApplicationUtils.info(invalidResult.infoMessage);
|
|
86
|
-
}
|
|
87
|
-
if (invalidResult.errorMessage) {
|
|
88
|
-
const { errorTitle, errorMessage } = invalidResult;
|
|
89
|
-
ApplicationUtils.error(errorTitle, errorMessage);
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
markAsInvalid(field, recordId) {
|
|
94
|
-
this._dataUnit.setInvalidField(field.name, field.message, recordId);
|
|
95
|
-
this._validationSource.markAsInvalid(field, recordId);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
export { RecordValidationProcessor as R, buildFieldMetadata as b };
|
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-baa5e267.js';
|
|
2
|
-
import { StringUtils, ElementIDUtils } from '@sankhyalabs/core';
|
|
3
|
-
import { C as CSSVarsUtils } from './CSSVarsUtils-71ce76be.js';
|
|
4
|
-
|
|
5
|
-
const ezCardItemCss = ":host {\n /*@doc Define o tamanho da fonte do componente.*/\n --ez-card-item--font-size: var(--text--medium, 14px);\n\n /*@doc Define a família da fonte do componente.*/\n --ez-card-item--font-family: var(--font-pattern, Arial);\n\n /*@doc Define o peso da fonte do componente.*/\n --ez-card-item--font-weight: var(--text-weight--medium, 400);\n\n /*@doc Define o peso da fonte do title do componente.*/\n --ez-card-item--font-weight-large: var(--text-weight--large, 600);\n\n /*@doc Define a cor da fonte do componente.*/\n --ez-card-item--color: var(--title--primary, #2B3A54);\n\n /*@doc Define a cor da fonte da key do componente.*/\n --ez-card-item__key--color: var(--text--primary, #626e82);\n\n /*@doc Define a cor da fonte do label do detalhe do componente.*/\n --ez-card-item__detail-label--color: var(--text--secondary, #A2ABB9);\n\n /*@doc Define o espaçamento inferior dos detalhes do componente.*/\n --ez-card-item__detail--padding-bottom: var(--space--extra-small, 3px);\n\n /*@doc Define o espaçamento inferior do title do componente.*/\n --ez-card-item__title--padding-bottom: var(--space--extra-small, 3px);\n\n /*@doc Define a cor do highlight / marcação nos textos do componente.*/\n --ez-card-item__highlight--color: var(--color--primary-300, #E2F4EF);\n\n width: 100%;\n display: flex;\n cursor: pointer;\n}\n\n.card-item {\n display: flex;\n flex-direction: column;\n width: 100%;\n cursor: pointer;\n padding: 12px;\n z-index: 0;\n position: relative;\n container-type: inline-size;\n container-name: box;\n white-space: pre-line;\n}\n\n.card-item:hover {\n background: #F0F3F7;\n border-radius: 12px;\n}\n\n.card-item__title {\n display: flex;\n align-items: center;\n line-height: 18px;\n cursor: pointer;\n\n /*public*/\n font-size: var(--ez-card-item--font-size);\n font-family: var(--ez-card-item--font-family);\n font-weight: var(--ez-card-item--font-weight-large);\n color: var(--ez-card-item--color);\n padding-bottom: var(--ez-card-item__title--padding-bottom);\n gap: var(--space--small, 6px);\n}\n\n.card-item__key {\n /*public*/\n color: var(--ez-card-item__key--color);\n}\n\n.card-item__details {\n display: flex;\n flex-direction: column;\n cursor: pointer;\n justify-content: space-between;\n width: 100%;\n}\n\n.card-item__details-container__left {\n white-space: pre-line;\n cursor: pointer;\n width: 50%;\n}\n\n.card-item__details-container__right {\n white-space: pre-line;\n width: 50%;\n cursor: pointer;\n}\n\n.card-item__detail:not(:last-child) {\n cursor: pointer;\n white-space: pre-line;\n\n /*public*/\n padding-bottom: var(--ez-card-item__detail--padding-bottom);\n}\n\n.card-item__detail-label {\n cursor: pointer;\n\n /*public*/\n font-size: var(--ez-card-item--font-size);\n font-family: var(--ez-card-item--font-family);\n font-weight: var(--ez-card-item--font-weight);\n color: var(--ez-card-item__detail-label--color);\n}\n\n.card-item__detail-value {\n cursor: pointer;\n line-break: anywhere;\n\n /*public*/\n font-size: var(--ez-card-item--font-size);\n font-family: var(--ez-card-item--font-family);\n font-weight: var(--ez-card-item--font-weight);\n color: var(--ez-card-item--color);\n}\n\n.card-item__highlight {\n position: relative;\n border-radius: 8px;\n z-index: -1;\n\n /*public*/\n background-color: var(--ez-card-item__highlight--color);\n outline: 2px solid var(--ez-card-item__highlight--color);\n box-shadow: -4px 0px 0px 0px var(--ez-card-item__highlight--color), \n 4px 0px 0px 0px var(--ez-card-item__highlight--color);\n}\n\n.card-item__content{\n display: flex;\n align-items: center;\n}\n\n.card-item__details-container{\n display: flex;\n}\n\n.card-item__details-slot{\n margin-left: auto;\n}\n\n@container box (max-width: 550px) {\n .card-item__details {\n flex-direction: column;\n }\n\n .card-item__details-container__left {\n width: 100%;\n }\n \n .card-item__details-container__right {\n width: 100%;\n }\n}\n\n@container box (max-width: 200px) {\n .card-item__title {\n font-size: 10px;\n }\n\n .card-item__detail-label {\n font-size: 10px;\n }\n\n .card-item__detail-value {\n font-size: 10px;\n }\n\n}";
|
|
6
|
-
|
|
7
|
-
const EzCardItem = class {
|
|
8
|
-
constructor(hostRef) {
|
|
9
|
-
registerInstance(this, hostRef);
|
|
10
|
-
this.ezClick = createEvent(this, "ezClick", 7);
|
|
11
|
-
this.item = undefined;
|
|
12
|
-
this.enableKey = true;
|
|
13
|
-
}
|
|
14
|
-
componentWillRender() {
|
|
15
|
-
this.createDetailList();
|
|
16
|
-
}
|
|
17
|
-
componentDidLoad() {
|
|
18
|
-
var _a, _b;
|
|
19
|
-
const dataInfo = { id: StringUtils.toCamelCase(((_a = this.item) === null || _a === void 0 ? void 0 : _a.key) || ((_b = this.item) === null || _b === void 0 ? void 0 : _b.title) || "") };
|
|
20
|
-
ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
|
21
|
-
}
|
|
22
|
-
createDetailList() {
|
|
23
|
-
var _a, _b, _c;
|
|
24
|
-
this._details = { detailsLeft: [], detailsRight: [] };
|
|
25
|
-
let cont = 0;
|
|
26
|
-
if ((_a = this.item) === null || _a === void 0 ? void 0 : _a.details) {
|
|
27
|
-
for (const attribute in this.item.details) {
|
|
28
|
-
cont < 3 ?
|
|
29
|
-
this._details.detailsLeft.push({ label: attribute, value: (_b = this.item.details[attribute]) === null || _b === void 0 ? void 0 : _b.toString() }) :
|
|
30
|
-
this._details.detailsRight.push({ label: attribute, value: (_c = this.item.details[attribute]) === null || _c === void 0 ? void 0 : _c.toString() });
|
|
31
|
-
cont++;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
buildDetailContent(detail) {
|
|
36
|
-
return h("div", { class: "card-item__detail" }, h("label", { class: "card-item__detail-label" }, detail.label), ": ", h("label", { class: "card-item__detail-value", innerHTML: detail.value }));
|
|
37
|
-
}
|
|
38
|
-
render() {
|
|
39
|
-
return (h(Host, null, this.item &&
|
|
40
|
-
h("div", { class: "card-item", onClick: () => { this.ezClick.emit(this.item); } }, h("div", { class: "ez-row card-item__content" }, h("div", { class: "ez-col ez-col--sd-11 card-item__details" }, h("label", { class: "card-item__title" }, this.enableKey && (h("span", { class: "card-item__key", innerHTML: this.item.key })), h("span", { innerHTML: this.item.title })), h("div", { class: "card-item__details-container" }, h("div", { class: "card-item__details-container__left" }, this._details.detailsLeft.map(detail => {
|
|
41
|
-
return this.buildDetailContent(detail);
|
|
42
|
-
})), h("div", { class: "card-item__details-container__right" }, this._details.detailsRight.map(detail => {
|
|
43
|
-
return this.buildDetailContent(detail);
|
|
44
|
-
})))), h("div", { class: "ez-col ez-col--sd-1 card-item__details-slot" }, h("slot", { name: "rightSlot" }))))));
|
|
45
|
-
}
|
|
46
|
-
get _element() { return getElement(this); }
|
|
47
|
-
};
|
|
48
|
-
EzCardItem.style = ezCardItemCss;
|
|
49
|
-
|
|
50
|
-
const ezFilterInputCss = ":host{display:block;width:100%}";
|
|
51
|
-
|
|
52
|
-
const EzFilterInput = class {
|
|
53
|
-
constructor(hostRef) {
|
|
54
|
-
registerInstance(this, hostRef);
|
|
55
|
-
this.ezChange = createEvent(this, "ezChange", 7);
|
|
56
|
-
this.ezSearching = createEvent(this, "ezSearching", 7);
|
|
57
|
-
this.ezFocusIn = createEvent(this, "ezFocusIn", 7);
|
|
58
|
-
this._searchingText = "";
|
|
59
|
-
this.handleFocus = () => {
|
|
60
|
-
if (this._searchingText === "") {
|
|
61
|
-
this._textInput.value = "";
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
this._textInput.value = this._searchingText;
|
|
65
|
-
}
|
|
66
|
-
this.ezFocusIn.emit();
|
|
67
|
-
};
|
|
68
|
-
this.label = undefined;
|
|
69
|
-
this.value = undefined;
|
|
70
|
-
this.enabled = true;
|
|
71
|
-
this.errorMessage = undefined;
|
|
72
|
-
this.restrict = undefined;
|
|
73
|
-
this.mode = "regular";
|
|
74
|
-
this.asyncSearch = false;
|
|
75
|
-
this.canShowError = true;
|
|
76
|
-
}
|
|
77
|
-
observeLabel() {
|
|
78
|
-
if (this._textInput) {
|
|
79
|
-
this._textInput.label = this.label;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
observeErrorMessage() {
|
|
83
|
-
if (this._textInput) {
|
|
84
|
-
this._textInput.errorMessage = this.errorMessage;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
observeValue(newValue, oldValue) {
|
|
88
|
-
if (this._textInput && newValue != oldValue) {
|
|
89
|
-
this._textInput.value = newValue;
|
|
90
|
-
this.ezChange.emit(newValue);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Aplica o foco no campo.
|
|
95
|
-
*/
|
|
96
|
-
async setFocus() {
|
|
97
|
-
this._textInput.setFocus();
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Remove o foco do campo.
|
|
101
|
-
*/
|
|
102
|
-
async setBlur() {
|
|
103
|
-
this._textInput.setBlur();
|
|
104
|
-
}
|
|
105
|
-
/**
|
|
106
|
-
* Retorna se o conteúdo é inválido.
|
|
107
|
-
*/
|
|
108
|
-
async isInvalid() {
|
|
109
|
-
return typeof this.errorMessage === "string" && this.errorMessage.trim() !== "";
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* Método responsável por setar um novo valor ao campo.
|
|
113
|
-
*/
|
|
114
|
-
async setValue(newValue) {
|
|
115
|
-
if (!this.asyncSearch || this._textInput == undefined) {
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
|
-
if (newValue !== this.value) {
|
|
119
|
-
this.value = newValue;
|
|
120
|
-
this._searchingText = "";
|
|
121
|
-
}
|
|
122
|
-
else {
|
|
123
|
-
this._textInput.value = newValue;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
127
|
-
* Método responsável por resetar o valor do campo para o ultimo valor inputado.
|
|
128
|
-
*/
|
|
129
|
-
async endSearch() {
|
|
130
|
-
if (!this.asyncSearch || this._textInput == undefined) {
|
|
131
|
-
return;
|
|
132
|
-
}
|
|
133
|
-
if (this._textInput.value !== this.value) {
|
|
134
|
-
this._textInput.value = this.value;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
handleChange(evt) {
|
|
138
|
-
const newValue = evt.detail;
|
|
139
|
-
this.errorMessage = "";
|
|
140
|
-
if (this.asyncSearch) {
|
|
141
|
-
this._searchingText = newValue;
|
|
142
|
-
this.ezSearching.emit(newValue);
|
|
143
|
-
}
|
|
144
|
-
else if (newValue !== this.value) {
|
|
145
|
-
this.value = newValue;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
componentDidLoad() {
|
|
149
|
-
CSSVarsUtils.applyVarsTextInput(this._elem, this._textInput);
|
|
150
|
-
}
|
|
151
|
-
render() {
|
|
152
|
-
ElementIDUtils.addIDInfoIfNotExists(this._elem, 'input');
|
|
153
|
-
return (h("ez-text-input", { "data-element-id": ElementIDUtils.getInternalIDInfo("textInput"), ref: elem => this._textInput = elem, label: this.label, onEzChange: evt => this.handleChange(evt), value: this.value, enabled: this.enabled, errorMessage: this.errorMessage, restrict: this.restrict, mode: this.mode, onFocusin: this.handleFocus, canShowError: this.canShowError }, h("ez-icon", { slot: "leftIcon", iconName: "search" })));
|
|
154
|
-
}
|
|
155
|
-
get _elem() { return getElement(this); }
|
|
156
|
-
static get watchers() { return {
|
|
157
|
-
"label": ["observeLabel"],
|
|
158
|
-
"errorMessage": ["observeErrorMessage"],
|
|
159
|
-
"value": ["observeValue"]
|
|
160
|
-
}; }
|
|
161
|
-
};
|
|
162
|
-
EzFilterInput.style = ezFilterInputCss;
|
|
163
|
-
|
|
164
|
-
const multiSelectionBoxMessageCss = ".multi-selection__message{display:flex;flex-direction:row;align-items:center;justify-content:center;width:100%;min-height:320px;text-align:center}.multi-selection__text-message{margin-top:-30px;font-family:var(--font-pattern);font-size:var(--text--meduim);padding:var(--space-xs);color:var(--text--primary)}";
|
|
165
|
-
|
|
166
|
-
const MultiSelectionBoxMessage = class {
|
|
167
|
-
constructor(hostRef) {
|
|
168
|
-
registerInstance(this, hostRef);
|
|
169
|
-
this.message = undefined;
|
|
170
|
-
}
|
|
171
|
-
render() {
|
|
172
|
-
return (h("div", { class: "multi-selection__message" }, h("span", { class: "multi-selection__text-message" }, this.message)));
|
|
173
|
-
}
|
|
174
|
-
};
|
|
175
|
-
MultiSelectionBoxMessage.style = multiSelectionBoxMessageCss;
|
|
176
|
-
|
|
177
|
-
export { EzCardItem as ez_card_item, EzFilterInput as ez_filter_input, MultiSelectionBoxMessage as multi_selection_box_message };
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, h } from './index-baa5e267.js';
|
|
2
|
-
|
|
3
|
-
const ALLOWED_ANIMATIONS = ['progress', 'progress-dark', 'pulse', 'false'];
|
|
4
|
-
|
|
5
|
-
const ezSkeletonCss = ".skeleton {\n\tbox-sizing: border-box;\n\toutline: none;\n\toverflow: hidden;\n\tposition: relative;\n\n\tbackground:var(--skeleton-background, #eff1f6) no-repeat;\n\n\tborder-radius: var(--skeleton-border-radius, 4px);\n\twidth: var(--skeleton-width, 100%);\n\theight: var(--skeleton-height, 20px);\n\tdisplay: inline-block;\n\tmargin-bottom: var(--skeleton-margin-bottom, 0px);\n\twill-change: transform;\n\n\t&:after,\n\t&:before {\n\t\tbox-sizing: border-box;\n\t}\n\n\t&.circle {\n\t\twidth: var(--skeleton-width, 40px);\n\t\theight: var(--skeleton-height, 40px);\n\t\tmargin-bottom: var(--skeleton-margin-bottom, 5px);\n\t\tborder-radius: var(--skeleton-border-radius, 50%);\n\t}\n\n\t&.rect {\n\t\tborder-radius: var(--skeleton-border-radius, 0px);\n\t}\n\n\t&.progress,\n\t&.progress-dark {\n\t\tanimation: progress 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;\n\t\tbackground-size: 200px 100%;\n\t}\n\n\t&.progress {\n\t\tbackground-image: linear-gradient(\n\t\t\t90deg,\n\t\t\trgba(255, 255, 255, 0),\n\t\t\trgba(255, 255, 255, 0.6),\n\t\t\trgba(255, 255, 255, 0)\n\t\t);\n\t}\n\n\t&.progress-dark {\n\t\tbackground-image: linear-gradient(\n\t\t\t90deg,\n\t\t\ttransparent,\n\t\t\trgba(0, 0, 0, 0.2),\n\t\t\ttransparent\n\t\t);\n\t}\n\n\t&.pulse {\n\t\tanimation: pulse 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;\n\t\tanimation-delay: 0.5s;\n\t}\n\n\t@media (prefers-reduced-motion: reduce) {\n\t\t&.pulse,\n\t\t&.progress-dark,\n\t\t&.progress {\n\t\t\tanimation: none;\n\t\t}\n\n\t\t&.progress,\n\t\t&.progress-dark {\n\t\t\tbackground-image: none;\n\t\t}\n\t}\n}\n\n@keyframes progress {\n\t0% {\n\t\tbackground-position: -200px 0;\n\t}\n\t100% {\n\t\tbackground-position: calc(200px + 100%) 0;\n\t}\n}\n\n@keyframes pulse {\n\t0% {\n\t\topacity: 1;\n\t}\n\t50% {\n\t\topacity: 0.4;\n\t}\n\t100% {\n\t\topacity: 1;\n\t}\n}";
|
|
6
|
-
|
|
7
|
-
const EzSkeleton = class {
|
|
8
|
-
constructor(hostRef) {
|
|
9
|
-
registerInstance(this, hostRef);
|
|
10
|
-
this.items = [];
|
|
11
|
-
this.count = 1;
|
|
12
|
-
this.variant = 'text';
|
|
13
|
-
this.width = null;
|
|
14
|
-
this.height = null;
|
|
15
|
-
this.marginBottom = null;
|
|
16
|
-
this.animation = 'progress';
|
|
17
|
-
}
|
|
18
|
-
componentWillLoad() {
|
|
19
|
-
this.init();
|
|
20
|
-
}
|
|
21
|
-
componentWillUpdate() {
|
|
22
|
-
this.init();
|
|
23
|
-
}
|
|
24
|
-
init() {
|
|
25
|
-
this.items.length = this.count;
|
|
26
|
-
this.items.fill(1);
|
|
27
|
-
if (!ALLOWED_ANIMATIONS.includes(this.animation)) {
|
|
28
|
-
this.animation = 'progress';
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
get style() {
|
|
32
|
-
let dimenssionsStyles = {
|
|
33
|
-
width: null,
|
|
34
|
-
height: null,
|
|
35
|
-
marginBottom: null
|
|
36
|
-
};
|
|
37
|
-
if (this.width) {
|
|
38
|
-
dimenssionsStyles.width = this.width;
|
|
39
|
-
}
|
|
40
|
-
if (this.height) {
|
|
41
|
-
dimenssionsStyles.height = this.height;
|
|
42
|
-
}
|
|
43
|
-
if (this.marginBottom) {
|
|
44
|
-
dimenssionsStyles.marginBottom = this.marginBottom;
|
|
45
|
-
}
|
|
46
|
-
return dimenssionsStyles;
|
|
47
|
-
}
|
|
48
|
-
render() {
|
|
49
|
-
return this.items.map((_, index) => {
|
|
50
|
-
return (h("span", { key: index, class: {
|
|
51
|
-
circle: this.variant === 'circle',
|
|
52
|
-
rect: this.variant === 'rect',
|
|
53
|
-
progress: this.animation === 'progress',
|
|
54
|
-
'progress-dark': this.animation === 'progress-dark',
|
|
55
|
-
pulse: this.animation === 'pulse',
|
|
56
|
-
skeleton: true
|
|
57
|
-
}, "data-busy": "true", "data-valuemin": "0", "data-valuemax": "100", "data-valuetext": "Loading...", role: "progressbar", tabindex: "0", style: this.style }));
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
EzSkeleton.style = ezSkeletonCss;
|
|
62
|
-
|
|
63
|
-
export { EzSkeleton as ez_skeleton };
|
package/dist/ezui/p-04f24913.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{UserInterface as e}from"@sankhyalabs/core";import{A as s}from"./p-2187f86c.js";const r=(s,r)=>{let t,i,{name:o,label:a,group:n}=Object.assign({},r),{readOnly:l,required:c}=Object.assign({},r);return s&&(a=a||s.label,o=o||s.name,c=s.required||(null==r?void 0:r.required),l=s.readOnly||(null==r?void 0:r.readOnly),t=s.properties,i=s.userInterface),{name:o,label:a,group:n,readOnly:l,required:c,props:t,userInterface:i||e.SHORTTEXT}};class t{constructor(e,s,r){this._dataUnit=e,this._validationSource=s,this._validator=r}validate(){return new Promise(((e,s)=>{const r=this._dataUnit.getModifiedRecords();for(let e=0;e<r.length;e++){const t=r[e],i=[];let o=this.validateRequired(t);if(o&&!o.isValid&&i.push(o),this._validator&&(o=this._validator.validateRecord(t),o&&!o.isValid&&i.push(o)),i.length>0){this.processValidationResult(i,t.__record__id__),s();break}}return e()}))}validateRequired(e){const s=this._validationSource.getRequiredFields(),r=[];if(new Set(s).forEach((s=>{const t=e[s];if(null==t||""===t){const t=this._validationSource.getMessageForField(s,e.__record__id__);r.push(t?{name:s,message:t}:{name:s,message:"Essa informação é obrigatória"})}})),r.length>0)return{isValid:!1,invalidFields:r,infoMessage:"Há pelo menos um campo obrigatório não preenchido."}}processValidationResult(e,r){e.forEach((e=>{const t=e.invalidFields;if(t&&t.forEach((e=>{this.markAsInvalid(e,r)})),e.infoMessage&&s.info(e.infoMessage),e.errorMessage){const{errorTitle:r,errorMessage:t}=e;s.error(r,t)}}))}markAsInvalid(e,s){this._dataUnit.setInvalidField(e.name,e.message,s),this._validationSource.markAsInvalid(e,s)}}export{t as R,r as b}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as o,r,c as e,H as d,g as n}from"./p-23a36bb6.js";import{ElementIDUtils as i,ObjectUtils as t}from"@sankhyalabs/core";const l=({item:r,hasIcon:e,hasChildren:d,isLockedLevels:n,onSubActionClick:i})=>o("div",{class:"ez-dropdown__item-wrapper",title:r.label},a(r,e),o("span",{class:"ez-dropdown__item-label"},r.label),s(r,d,n,i)),a=(r,e)=>{if(null!=r&&e)return o("ez-icon",r.iconName?Object.assign({class:"ez-dropdown__icon-left",iconName:r.iconName,size:"medium"},{[i.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:`${r.id}_ezDropdownItemIcon`}):{class:"ez-dropdown__icon-left ez-dropdown__hidden",size:"medium"})},s=(r,e,d,n)=>{var t,l;if(null!=r){if(!(null===(t=r.children)||void 0===t?void 0:t.length)&&null!=r.subAction&&Object.keys(r.subAction).length>0)return o("span",Object.assign({onClick:()=>n(r),title:r.subAction.label,class:`ez-dropdown__link ez-dropdown__link--${r.subAction.type||"primary"}`},{[i.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:`${r.subAction.id}_ezDropdownItemSubAction`}),r.subAction.label);if(!d&&e)return(null===(l=r.children)||void 0===l?void 0:l.length)>0?o("ez-icon",Object.assign({class:"ez-dropdown__icon-right",iconName:"chevron-right",size:"medium"},{[i.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:`${r.id}_ezDropdownIconOpenChildren`})):o("ez-icon",{class:"ez-dropdown__icon-right ez-dropdown__hidden",size:"medium"})}};class p{constructor(){}show(o){const r=null==o?void 0:o.querySelector(".ez-dropdown__submenu");null!=o&&null!=r&&(r.classList.remove("ez-dropdown__submenu--hide"),this.setPosition(o),this.setScrollContainer(o),this.setMaxHeight(r))}hide(o){if(null==o)return;const r=o.querySelector(".ez-dropdown__submenu:not(.ez-dropdown__submenu--hide)");this.reset(r),this.hideChild(r)}hideChild(o){null!=o&&o.querySelectorAll(".ez-dropdown__submenu").forEach((o=>{this.reset(o)}))}setPosition(o){const r=null==o?void 0:o.querySelector(".ez-dropdown__submenu"),e=null==o?void 0:o.closest(".ez-dropdown");if(null==r||null==e)return;r.style.top=this.getPositionTop(o),r.style.left=this.getPositionRight(e);const d=null==r?void 0:r.getBoundingClientRect(),n=document.body.clientWidth;(null==d?void 0:d.right)>n&&this.updatePosition(e,r)}setMaxHeight(o){var r;const e=(null==o?void 0:o.shadowRoot)||o,d=null==e?void 0:e.querySelector(".ez-dropdown"),n=document.body.clientHeight;let i,t;if(null!=(null==e?void 0:e.tagName)?(i=e,t=null==i?void 0:i.getBoundingClientRect()):t=null==d?void 0:d.getBoundingClientRect(),null!=d&&null!=t){if(t.y+t.height>n)if(null!=i){const o=i.closest(".ez-dropdown"),e=null==o?void 0:o.getBoundingClientRect(),l=parseFloat((null===(r=getComputedStyle(i))||void 0===r?void 0:r.marginTop)||"0");if(null==o||null==e)return;e.y+t.height>n?(i.style.top=e.y-l+"px",d.style.maxHeight=n-e.y+"px"):i.style.top=n-t.height-l+"px"}else{let o=n-t.y;o<0&&(o=t.height-n),d.style.maxHeight=o+"px"}this.setSpacerContainer(d)}}setSpacerContainer(o){const r=null==o?void 0:o.querySelector(".ez-dropdown__container");null!=r&&(r.scrollHeight>r.clientHeight?r.classList.add("ez-dropdown__container--spacer"):r.classList.remove("ez-dropdown__container--spacer"))}reset(o){if(null==o)return;o.classList.add("ez-dropdown__submenu--hide"),o.style.left="",o.style.top="";const r=o.querySelector(".ez-dropdown");this.resetDropdown(r)}resetDropdown(o){null!=o&&(o.style.maxHeight="",this.setSpacerContainer(o))}setScrollContainer(o){const r=null==o?void 0:o.closest(".ez-dropdown__container");null!=r&&(r.onscroll=this.onScrollContainer.bind(this))}onScrollContainer(o){this.hideChild(null==o?void 0:o.target)}getPositionTop(o){const r=null==o?void 0:o.getBoundingClientRect();if(null!=r)return r.y+"px"}getPositionRight(o){const r=null==o?void 0:o.getBoundingClientRect();if(null!=r)return r.x+r.width+"px"}getPositionLeft(o,r){const e=null==o?void 0:o.getBoundingClientRect(),d=null==r?void 0:r.getBoundingClientRect();if(null!=e&&null!=d)return e.x-d.width+"px"}updatePosition(o,r){const e=null==o?void 0:o.getBoundingClientRect(),d=null==r?void 0:r.getBoundingClientRect();null!=e&&null!=d&&e.x<d.right&&(r.style.left=this.getPositionLeft(o,r),this.updatePosition(o,r))}}const c=class{constructor(o){r(this,o),this.ezClick=e(this,"ezClick",7),this.ezSubActionClick=e(this,"ezSubActionClick",7),this.ezOutsideClick=e(this,"ezOutsideClick",7),this._itemList={},this._submenuList=[],this._openedMenuList={},this._levelLimits=3,this.items=[],this.value=void 0,this.itemBuilder=void 0}handleClickOutside(o){this._element.contains(o.target)||this.ezOutsideClick.emit()}defaultItemBuilder(r,e,d,n){return o(l,{item:r,hasIcon:d,hasChildren:n,isLockedLevels:e,onSubActionClick:this.onSubActionClick.bind(this)})}getMaxOrder(o){return null==o||0===o.length?-1:Math.max(...o.map((o=>{var r;const e=null===(r=o.group)||void 0===r?void 0:r.order;return null!=e&&e>=0?e:-1})))}hasIcon(o){return null==o?void 0:o.some((o=>""!==(o.iconName||"")))}hasGroup(o){return null==o?void 0:o.some((o=>""!==(o.group||"")))}hasChildren(o){return null==o?void 0:o.some((o=>(o.children||[]).length>0))}isLockedLevels(o){return!!this._levelLimits&&o===this._levelLimits+1}getItemsByGroup(o,r){let e={};const d=this.getMaxOrder(o);return o.forEach((o=>{const n=o.group&&null!=o.group.label?o.group.label||"noGroup":o.group||"noGroup";let i=e[n];null==i&&(i={items:[],order:o.group&&null!=o.group.order?o.group.order:o.group?d+1:d+2}),this.validateItem(o,r),i.items.push(o),e[n]=i})),t.sortByProperty(e,"order")}validateItem(o,r){if(null==this._itemList&&(this._itemList={}),null==o.type&&(o.type="item"),null==o.id){const e=`level_${r}_${o.type}`,d=Object.keys(this._itemList).filter((o=>o.includes(e))).length;o.id=`${e}_${d+1}`}null==o.label&&(o.label=""),null!=o.subAction&&(null==o.subAction.id&&(o.subAction.id=`subAction_${o.id}`),null==o.subAction.label&&(o.subAction.label="")),null==this._itemList[o.id]&&(this._itemList[o.id]={})}getContainerItemBuilder(r,e,d,n,i){if(null==this.itemBuilder)return;const t=this.itemBuilder(r,e);return null==t?this.defaultItemBuilder(r,d,n,i):"string"!=typeof t?o("div",{class:"ez-dropdown__item-builder"},t):o("div",{class:"ez-dropdown__item-builder",innerHTML:t})}getItemsRender(r,e,d,n){if(null==r)return;let t=e,l=!1;return n&&(t++,l=this.isLockedLevels(t)),r.map((r=>{var a;return"divider"!==r.type?o("div",Object.assign({ref:o=>this._itemList[r.id]=o,class:"ez-dropdown__item","data-level":e},{[i.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:i.getInternalIDInfo(`${r.id}_ezDropdownItem`)}),o("div",{class:"ez-dropdown__item-content",onClick:o=>this.onItemClick(o,r),onMouseOver:o=>this.onShowSubmenu(o,r)},this.itemBuilder?this.getContainerItemBuilder(r,e,l,d,n):this.defaultItemBuilder(r,l,d,n)),(null===(a=r.children)||void 0===a?void 0:a.length)>0&&!l&&n&&o("div",{ref:o=>this._submenuList.push(o),class:"ez-dropdown__submenu ez-dropdown__submenu--hide"},this.renderDropdown(r.children,t))):o("hr",Object.assign({class:"ez-dropdown__divider"},{[i.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:i.getInternalIDInfo(`${r.id}_ezDropdownDivider`)}))}))}renderDropdown(r=this.items,e=1){if(null==r||this.isLockedLevels(e))return;const d=this.getItemsByGroup(r,e),n=this.hasGroup(r),t=this.hasIcon(r),l=this.hasChildren(r);return o("div",{class:"ez-dropdown ez-dropdown__max-height","data-level":e},o("div",{class:"ez-dropdown__container"},Object.keys(d).map((r=>o("div",Object.assign({class:"ez-dropdown__group"},{[i.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:i.getInternalIDInfo(`${r}_ezDropdownGroup`)}),"noGroup"!==r&&o("label",{class:"ez-dropdown__group-label",title:r},r),n&&"noGroup"===r&&o("hr",Object.assign({class:"ez-dropdown__divider"},{[i.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:i.getInternalIDInfo(`${r}_ezDropdownDivider`)})),this.getItemsRender(d[r].items,e,t,l))))))}hasOpenedSubmenu(o){const r=Object.keys(this._openedMenuList);return r.includes(o.toString())||r.some((r=>Number(r)>o))}hasSubmenuOpened(){var o;return null===(o=this._submenuList)||void 0===o?void 0:o.some((o=>!o.classList.contains("ez-dropdown__submenu--hide")))}setEvents(){document.removeEventListener("click",this.onHideAllSubmenu.bind(this)),document.addEventListener("click",this.onHideAllSubmenu.bind(this)),document.removeEventListener("scroll",this.onSubmenuReposition.bind(this)),document.addEventListener("scroll",this.onSubmenuReposition.bind(this))}onShowSubmenu(o,r){var e;if(null==o)return;const d=this._itemList[r.id];if(!(null==d?void 0:d.classList.contains("ez-dropdown__item")))return;const n=Number(d.dataset.level||"0");this.hasOpenedSubmenu(n)&&(this._submenuControl.hide(this._openedMenuList[n]),delete this._openedMenuList[n]),(null===(e=r.children)||void 0===e?void 0:e.length)&&(this._openedMenuList[d.dataset.level]=d,this._submenuControl.show(d))}onItemClick(o,r){const e=null==o?void 0:o.target;(null==e?void 0:e.classList.contains("ez-dropdown__link"))||(this.value=r,this.ezClick.emit(r))}onSubActionClick(o){this.ezSubActionClick.emit(o.subAction)}onHideAllSubmenu(o){const r=null==o?void 0:o.target;this.hasSubmenuOpened()&&(null==r||!r.closest(".ez-dropdown")&&"EZ-DROPDOWN"!==r.tagName)&&(this._openedMenuList={},this._submenuList.forEach(this._submenuControl.reset.bind(this._submenuControl)))}onSubmenuReposition(){null!=this._openedMenuList&&Object.keys(this._openedMenuList).forEach((o=>{this._submenuControl.setPosition(this._openedMenuList[o])}))}componentDidLoad(){i.addIDInfo(this._element),this._submenuControl=new p,this._submenuControl.setMaxHeight(this._element)}componentDidUpdate(){this._submenuControl.setMaxHeight(this._element)}componentDidRender(){this.setEvents()}render(){return o(d,null,this.renderDropdown())}get _element(){return n(this)}};c.style=":host{--ez-dropdown--z-index:var(--more-visible, 2);--ez-dropdown--padding:var(--space--small, 6px);--ez-dropdown--box-shadow:var(--shadow--medium, 0px 8px 24px rgba(0, 38, 111, 0.1));--ez-dropdown--border-radius:var(--border--radius-medium, 12px);--ez-dropdown--background-color:var(--background--xlight, #fff);--ez-dropdown--font-family:var(--font-pattern, 'Roboto');--ez-dropdown--max-height:415px;--ez-dropdown__item--padding:var(--space--small, 6px);--ez-dropdown__item--gap:var(--space--small, 6px);--ez-dropdown__item--border-radius:var(--border--radius-small, 6px);--ez-dropdown__item--color:var(--title--primary, #2b3a54);--ez-dropdown__item--font-weight:var(--text-weight--medium, 400);--ez-dropdown__item--font-size:var(--text--medium, 14px);--ez-dropdown__item--line-height:calc(var(--ez-dropdown__item--font-size) + 4px);--ez-dropdown__item--background-color:var(--background--medium, #f0f3f7);--ez-dropdown__item--transition:var(--transition, .2s linear);--ez-dropdown__item-label--margin-right:var(--space--medium, 12px);--ez-dropdown__icon--size:var(--icon--medium, 18px);--ez-dropdown__divider--background-color:var(--color--disable-secondary, #f2f5f8);--ez-dropdown__divider--margin:var(--space--extra-small, 3px) 0;--ez-dropdown__group-label--color:var(--text--secondary, #A2ABB9);--ez-dropdown__group-label--font-weight:var(--text-weight--large, 600);--ez-dropdown__group-label--font-size:var(--text--small, 12px);--ez-dropdown__group-label--line-height:var(--text--medium, 14px);--ez-dropdown__group-label--padding:var(--space--small, 6px);--ez-dropdown__submenu--z-index:var(--most-visible, 3);--ez-dropdown__link--font-weight:var(--text-weight--large, 600);--ez-dropdown__link--primary--color:var(--color--primary, #008561);--ez-dropdown__link--critical--color:var(--color-alert--error-800, #BD0025);--ez-dropdown__scrollbar--color-default:var(--scrollbar--default, #626e82);--ez-dropdown__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--ez-dropdown__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--ez-dropdown__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--ez-dropdown__scrollbar--border-radius:var(--border--radius-small, 6px);--ez-dropdown__scrollbar--width:var(--space--small, 6px);--ez-dropdown__scrollbar--padding-right:var(--space--extra-small, 3px);display:flex;flex-direction:column;height:fit-content;user-select:none;box-sizing:border-box;position:fixed;z-index:var(--ez-dropdown--z-index)}:host *{box-sizing:border-box}.ez-dropdown{display:flex;padding:var(--ez-dropdown--padding);box-shadow:var(--ez-dropdown--box-shadow);border-radius:var(--ez-dropdown--border-radius);background-color:var(--ez-dropdown--background-color);max-width:var(--ez-dropdown--max-width)}.ez-dropdown__max-height{max-height:var(--ez-dropdown--max-height)}.ez-dropdown *{font-family:var(--ez-dropdown--font-family)}.ez-dropdown__container{display:flex;flex-direction:column;overflow-y:auto;scrollbar-width:thin;flex:auto;scrollbar-color:var(--ez-dropdown__scrollbar--color-clicked) var(--ez-dropdown__scrollbar--color-background)}.ez-dropdown__container::-webkit-scrollbar{background-color:var(--ez-dropdown__scrollbar--color-background);width:var(--ez-dropdown__scrollbar--width);max-width:var(--ez-dropdown__scrollbar--width);min-width:var(--ez-dropdown__scrollbar--width)}.ez-dropdown__container::-webkit-scrollbar-track{background-color:var(--ez-dropdown__scrollbar--color-background);border-radius:var(--ez-dropdown__scrollbar--border-radius)}.ez-dropdown__container::-webkit-scrollbar-thumb{background-color:var(--ez-dropdown__scrollbar--color-default);border-radius:var(--ez-dropdown__scrollbar--border-radius)}.ez-dropdown__container::-webkit-scrollbar-thumb:vertical:hover,.ez-dropdown__container::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--ez-dropdown__scrollbar--color-hover)}.ez-dropdown__container::-webkit-scrollbar-thumb:vertical:active,.ez-dropdown__container::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--ez-dropdown__scrollbar--color-clicked)}.ez-dropdown__container--spacer{padding-right:var(--ez-dropdown__scrollbar--padding-right)}.ez-dropdown__item{display:flex;align-items:center;background-color:transparent;border-radius:var(--ez-dropdown__item--border-radius);transition:var(--ez-dropdown__item--transition)}.ez-dropdown__item:hover{background-color:var(--ez-dropdown__item--background-color)}.ez-dropdown__item-wrapper{display:flex;align-items:center;position:relative;cursor:pointer;width:100%;margin:0;white-space:nowrap;gap:var(--ez-dropdown__item--gap);color:var(--ez-dropdown__item--color);font-weight:var(--ez-dropdown__item--font-weight);font-size:var(--ez-dropdown__item--font-size);line-height:var(--ez-dropdown__item--line-height);padding:var(--ez-dropdown__item--padding)}.ez-dropdown__item-wrapper ez-icon{display:flex;justify-content:center;align-items:center;width:var(--ez-dropdown__icon--size);height:var(--ez-dropdown__icon--size);min-width:var(--ez-dropdown__icon--size);min-height:var(--ez-dropdown__icon--size)}.ez-dropdown__item-content{display:flex;align-items:center;flex:auto;overflow:hidden;gap:var(--ez-dropdown__item--gap)}.ez-dropdown__item-label{text-align:left;text-overflow:ellipsis;overflow:hidden;flex:auto}.ez-dropdown__item-label:not(:last-child){margin-right:var(--ez-dropdown__item-label--margin-right)}.ez-dropdown__item-content+.ez-dropdown__link{margin-left:var(--ez-dropdown__item-label--margin-right);margin-right:var(--ez-dropdown__item--padding)}.ez-dropdown__item-builder{flex:auto}.ez-dropdown__divider{width:100%;height:2px;border-radius:1px;border:none;display:block;background-color:var(--ez-dropdown__divider--background-color);margin:var(--ez-dropdown__divider--margin)}.ez-dropdown__hidden{visibility:hidden}.ez-dropdown__group{display:flex;flex-direction:column}.ez-dropdown__group-label{display:block;width:100%;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--ez-dropdown__group-label--color);font-weight:var(--ez-dropdown__group-label--font-weight);font-size:var(--ez-dropdown__group-label--font-size);line-height:var(--ez-dropdown__group-label--line-height);padding:var(--ez-dropdown__group-label--padding)}.ez-dropdown__icon-right{margin-left:auto}.ez-dropdown__submenu{position:fixed;z-index:var(--ez-dropdown__submenu--z-index);margin-top:calc(var(--ez-dropdown__item--padding) * -1)}.ez-dropdown__submenu--hide{display:none}.ez-dropdown__link{display:block;margin-left:auto;cursor:pointer;text-overflow:ellipsis;overflow:hidden;font-weight:var(--ez-dropdown__link--font-weight);max-width:calc(var(--ez-dropdown--max-width) * 0.43)}.ez-dropdown__link--primary{color:var(--ez-dropdown__link--primary--color)}.ez-dropdown__link--critical{color:var(--ez-dropdown__link--critical--color)}.ez-dropdown__link:hover{text-decoration:underline}";export{c as ez_dropdown}
|