@sankhyalabs/ezui 0.0.0-bugfix-dev-KB-08202.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +78 -0
- package/dist/assets/actions-sprite.svg +257 -0
- package/dist/cjs/ApplicationUtils-2e444734.js +162 -0
- package/dist/cjs/CSSVarsUtils-b136a156.js +77 -0
- package/dist/cjs/CheckMode-ecb90b87.js +7 -0
- package/dist/cjs/DialogType-2114c337.js +9 -0
- package/dist/cjs/EzScrollDirection-b2c99895.js +8 -0
- package/dist/cjs/RecordValidationProcessor-edd23705.js +102 -0
- package/dist/cjs/constants-3a1d64fb.js +7 -0
- package/dist/cjs/ez-actions-button.cjs.entry.js +212 -0
- package/dist/cjs/ez-alert.cjs.entry.js +30 -0
- package/dist/cjs/ez-application.cjs.entry.js +26 -0
- package/dist/cjs/ez-badge.cjs.entry.js +120 -0
- package/dist/cjs/ez-breadcrumb.cjs.entry.js +285 -0
- package/dist/cjs/ez-button.cjs.entry.js +87 -0
- package/dist/cjs/ez-calendar.cjs.entry.js +238 -0
- package/dist/cjs/ez-card-item.cjs.entry.js +52 -0
- package/dist/cjs/ez-check.cjs.entry.js +95 -0
- package/dist/cjs/ez-chip.cjs.entry.js +116 -0
- package/dist/cjs/ez-collapsible-box.cjs.entry.js +133 -0
- package/dist/cjs/ez-combo-box.cjs.entry.js +690 -0
- package/dist/cjs/ez-date-input.cjs.entry.js +188 -0
- package/dist/cjs/ez-date-time-input.cjs.entry.js +242 -0
- package/dist/cjs/ez-dialog.cjs.entry.js +180 -0
- package/dist/cjs/ez-dropdown.cjs.entry.js +515 -0
- package/dist/cjs/ez-file-item.cjs.entry.js +74 -0
- package/dist/cjs/ez-filter-input_2.cjs.entry.js +137 -0
- package/dist/cjs/ez-form-view.cjs.entry.js +191 -0
- package/dist/cjs/ez-form.cjs.entry.js +933 -0
- package/dist/cjs/ez-grid.cjs.entry.js +120838 -0
- package/dist/cjs/ez-guide-navigator.cjs.entry.js +96 -0
- package/dist/cjs/ez-icon.cjs.entry.js +44 -0
- package/dist/cjs/ez-list.cjs.entry.js +558 -0
- package/dist/cjs/ez-loading-bar.cjs.entry.js +32 -0
- package/dist/cjs/ez-modal-container.cjs.entry.js +64 -0
- package/dist/cjs/ez-modal.cjs.entry.js +72 -0
- package/dist/cjs/ez-multi-selection-list.cjs.entry.js +183 -0
- package/dist/cjs/ez-number-input.cjs.entry.js +181 -0
- package/dist/cjs/ez-popover.cjs.entry.js +156 -0
- package/dist/cjs/ez-popup.cjs.entry.js +66 -0
- package/dist/cjs/ez-radio-button.cjs.entry.js +48 -0
- package/dist/cjs/ez-scroller_3.cjs.entry.js +792 -0
- package/dist/cjs/ez-search.cjs.entry.js +96 -0
- package/dist/cjs/ez-skeleton.cjs.entry.js +67 -0
- package/dist/cjs/ez-tabselector.cjs.entry.js +228 -0
- package/dist/cjs/ez-text-area.cjs.entry.js +179 -0
- package/dist/cjs/ez-text-edit.cjs.entry.js +107 -0
- package/dist/cjs/ez-text-input.cjs.entry.js +247 -0
- package/dist/cjs/ez-time-input.cjs.entry.js +168 -0
- package/dist/cjs/ez-toast.cjs.entry.js +101 -0
- package/dist/cjs/ez-upload.cjs.entry.js +395 -0
- package/dist/cjs/ez-view-stack.cjs.entry.js +86 -0
- package/dist/cjs/ezui.cjs.js +23 -0
- package/dist/cjs/filter-column.cjs.entry.js +151 -0
- package/dist/cjs/index-1064511f.js +2340 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +22 -0
- package/dist/collection/collection-manifest.json +184 -0
- package/dist/collection/components/assets/actions-sprite.svg +257 -0
- package/dist/collection/components/ez-actions-button/ez-actions-button.css +139 -0
- package/dist/collection/components/ez-actions-button/ez-actions-button.js +440 -0
- package/dist/collection/components/ez-alert/ez-alert.css +76 -0
- package/dist/collection/components/ez-alert/ez-alert.js +53 -0
- package/dist/collection/components/ez-application/ez-application.css +3 -0
- package/dist/collection/components/ez-application/ez-application.js +41 -0
- package/dist/collection/components/ez-badge/enum/sizes.js +9 -0
- package/dist/collection/components/ez-badge/ez-badge.css +165 -0
- package/dist/collection/components/ez-badge/ez-badge.js +211 -0
- package/dist/collection/components/ez-badge/interfaces/IPosition.js +1 -0
- package/dist/collection/components/ez-breadcrumb/ez-breadcrumb.css +66 -0
- package/dist/collection/components/ez-breadcrumb/ez-breadcrumb.js +373 -0
- package/dist/collection/components/ez-breadcrumb/subcomponents/breadcrumb-item.js +20 -0
- package/dist/collection/components/ez-button/ez-button.css +255 -0
- package/dist/collection/components/ez-button/ez-button.js +241 -0
- package/dist/collection/components/ez-calendar/ez-calendar.css +318 -0
- package/dist/collection/components/ez-calendar/ez-calendar.js +439 -0
- package/dist/collection/components/ez-card-item/ez-card-item.css +126 -0
- package/dist/collection/components/ez-card-item/ez-card-item.js +97 -0
- package/dist/collection/components/ez-check/CheckMode.js +5 -0
- package/dist/collection/components/ez-check/ez-check.css +366 -0
- package/dist/collection/components/ez-check/ez-check.js +272 -0
- package/dist/collection/components/ez-chip/ez-chip.css +163 -0
- package/dist/collection/components/ez-chip/ez-chip.js +312 -0
- package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.css +254 -0
- package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.js +442 -0
- package/dist/collection/components/ez-combo-box/ez-combo-box.css +334 -0
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +1125 -0
- package/dist/collection/components/ez-date-input/ez-date-input.css +49 -0
- package/dist/collection/components/ez-date-input/ez-date-input.js +432 -0
- package/dist/collection/components/ez-date-time-input/ez-date-time-input.css +44 -0
- package/dist/collection/components/ez-date-time-input/ez-date-time-input.js +504 -0
- package/dist/collection/components/ez-dialog/DialogType.js +7 -0
- package/dist/collection/components/ez-dialog/ez-dialog.css +544 -0
- package/dist/collection/components/ez-dialog/ez-dialog.js +401 -0
- package/dist/collection/components/ez-dropdown/ez-dropdown.css +349 -0
- package/dist/collection/components/ez-dropdown/ez-dropdown.js +356 -0
- package/dist/collection/components/ez-dropdown/structure/DropdownItem.js +30 -0
- package/dist/collection/components/ez-dropdown/structure/SubmenuControl.js +241 -0
- package/dist/collection/components/ez-file-item/ez-file-item.css +125 -0
- package/dist/collection/components/ez-file-item/ez-file-item.js +200 -0
- package/dist/collection/components/ez-filter-input/ez-filter-input.css +4 -0
- package/dist/collection/components/ez-filter-input/ez-filter-input.js +407 -0
- package/dist/collection/components/ez-form/ez-form.css +10 -0
- package/dist/collection/components/ez-form/ez-form.js +237 -0
- package/dist/collection/components/ez-form/store/form.slice.js +42 -0
- package/dist/collection/components/ez-form-view/ez-form-view.css +6 -0
- package/dist/collection/components/ez-form-view/ez-form-view.js +154 -0
- package/dist/collection/components/ez-form-view/fieldbuilder/FieldBuilder.js +30 -0
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/CheckBox.tpl.js +11 -0
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/ComboBox.tpl.js +13 -0
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/DateInput.tpl.js +10 -0
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/FileInput.tpl.js +11 -0
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/NumberInput.tpl.js +12 -0
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/SearchInput.tpl.js +4 -0
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/TextArea.tpl.js +4 -0
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/TextInput.tpl.js +4 -0
- package/dist/collection/components/ez-form-view/interfaces/IFormViewField.js +1 -0
- package/dist/collection/components/ez-form-view/interfaces/index.js +1 -0
- package/dist/collection/components/ez-form-view/structure/index.js +29 -0
- package/dist/collection/components/ez-grid/controller/EzGridController.js +1 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +791 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridUtils.js +8 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js +101 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/GridEditionManager.js +230 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomHeader.js +88 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/components/cellRendererStatus.js +43 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/components/selectionHeader.js +40 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/EzCellEditor.js +49 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/GridEditorUtils.js +10 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/IEditorMetadata.js +4 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/IUICellEditor.js +1 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/ComboBox.tpl.js +38 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/DateInput.tpl.js +40 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/NumberInput.tpl.js +20 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/Search.tpl.js +15 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/TextInput.tpl.js +41 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/i18n/pt-BR.js +75 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/mock/Server.js +69 -0
- package/dist/collection/components/ez-grid/ez-grid.css +97 -0
- package/dist/collection/components/ez-grid/ez-grid.js +833 -0
- package/dist/collection/components/ez-grid/interfaces/ISelection.js +1 -0
- package/dist/collection/components/ez-grid/interfaces/ISelectionToastConfig.js +1 -0
- package/dist/collection/components/ez-grid/interfaces/index.js +2 -0
- package/dist/collection/components/ez-grid/subcomponents/filter-column.css +34 -0
- package/dist/collection/components/ez-grid/subcomponents/filter-column.js +377 -0
- package/dist/collection/components/ez-grid/subcomponents/selection-counter.js +29 -0
- package/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource.js +78 -0
- package/dist/collection/components/ez-guide-navigator/ez-guide-navigator.css +66 -0
- package/dist/collection/components/ez-guide-navigator/ez-guide-navigator.js +385 -0
- package/dist/collection/components/ez-guide-navigator/interfaces/IGuideItem.js +1 -0
- package/dist/collection/components/ez-guide-navigator/interfaces/index.js +1 -0
- package/dist/collection/components/ez-icon/ez-icon.css +223 -0
- package/dist/collection/components/ez-icon/ez-icon.js +101 -0
- package/dist/collection/components/ez-list/ez-list.css +434 -0
- package/dist/collection/components/ez-list/ez-list.js +911 -0
- package/dist/collection/components/ez-loading-bar/ez-loading-bar.css +85 -0
- package/dist/collection/components/ez-loading-bar/ez-loading-bar.js +74 -0
- package/dist/collection/components/ez-modal/ez-modal.css +369 -0
- package/dist/collection/components/ez-modal/ez-modal.js +239 -0
- package/dist/collection/components/ez-modal-container/ez-modal-container.css +55 -0
- package/dist/collection/components/ez-modal-container/ez-modal-container.js +191 -0
- package/dist/collection/components/ez-modal-container/index.js +2 -0
- package/dist/collection/components/ez-modal-container/modal-action.js +8 -0
- package/dist/collection/components/ez-modal-container/modal-button-status.js +7 -0
- package/dist/collection/components/ez-multi-selection-list/ez-multi-selection-list.css +36 -0
- package/dist/collection/components/ez-multi-selection-list/ez-multi-selection-list.js +338 -0
- package/dist/collection/components/ez-multi-selection-list/interfaces/IMultiSelectionListDataSource.js +1 -0
- package/dist/collection/components/ez-multi-selection-list/interfaces/IMultiSelectionOption.js +1 -0
- package/dist/collection/components/ez-multi-selection-list/subcomponents/multi-selection-box-message.css +18 -0
- package/dist/collection/components/ez-multi-selection-list/subcomponents/multi-selection-box-message.js +41 -0
- package/dist/collection/components/ez-number-input/ez-number-input.css +8 -0
- package/dist/collection/components/ez-number-input/ez-number-input.js +457 -0
- package/dist/collection/components/ez-popover/ez-popover.css +42 -0
- package/dist/collection/components/ez-popover/ez-popover.js +365 -0
- package/dist/collection/components/ez-popup/ez-popup.css +418 -0
- package/dist/collection/components/ez-popup/ez-popup.js +180 -0
- package/dist/collection/components/ez-radio-button/ez-radio-button.css +217 -0
- package/dist/collection/components/ez-radio-button/ez-radio-button.js +163 -0
- package/dist/collection/components/ez-scroller/EzScrollDirection.js +6 -0
- package/dist/collection/components/ez-scroller/ez-scroller.css +192 -0
- package/dist/collection/components/ez-scroller/ez-scroller.js +293 -0
- package/dist/collection/components/ez-search/ez-search.css +3 -0
- package/dist/collection/components/ez-search/ez-search.js +462 -0
- package/dist/collection/components/ez-sidebar-button/ez-sidebar-button.css +63 -0
- package/dist/collection/components/ez-sidebar-button/ez-sidebar-button.js +47 -0
- package/dist/collection/components/ez-skeleton/ez-skeleton.constants.js +1 -0
- package/dist/collection/components/ez-skeleton/ez-skeleton.css +94 -0
- package/dist/collection/components/ez-skeleton/ez-skeleton.js +211 -0
- package/dist/collection/components/ez-tabselector/ez-tabselector.css +149 -0
- package/dist/collection/components/ez-tabselector/ez-tabselector.js +321 -0
- package/dist/collection/components/ez-text-area/ez-text-area.css +242 -0
- package/dist/collection/components/ez-text-area/ez-text-area.js +428 -0
- package/dist/collection/components/ez-text-edit/ez-text-edit.css +19 -0
- package/dist/collection/components/ez-text-edit/ez-text-edit.js +202 -0
- package/dist/collection/components/ez-text-input/ez-text-input.css +301 -0
- package/dist/collection/components/ez-text-input/ez-text-input.js +491 -0
- package/dist/collection/components/ez-time-input/ez-time-input.css +14 -0
- package/dist/collection/components/ez-time-input/ez-time-input.js +412 -0
- package/dist/collection/components/ez-toast/ez-toast.css +167 -0
- package/dist/collection/components/ez-toast/ez-toast.js +209 -0
- package/dist/collection/components/ez-tree/ez-tree.css +159 -0
- package/dist/collection/components/ez-tree/ez-tree.js +696 -0
- package/dist/collection/components/ez-tree/interfaces/ITree.js +1 -0
- package/dist/collection/components/ez-tree/interfaces/ITreeItem.js +1 -0
- package/dist/collection/components/ez-tree/subcomponents/DefaultIconResolver.js +8 -0
- package/dist/collection/components/ez-tree/subcomponents/DefaultTooltipResolver.js +3 -0
- package/dist/collection/components/ez-tree/subcomponents/TreeItem.js +24 -0
- package/dist/collection/components/ez-tree/subcomponents/index.js +2 -0
- package/dist/collection/components/ez-tree/types/Node.js +110 -0
- package/dist/collection/components/ez-tree/types/Tree.js +132 -0
- package/dist/collection/components/ez-upload/RemoteFile.js +94 -0
- package/dist/collection/components/ez-upload/ez-upload.css +582 -0
- package/dist/collection/components/ez-upload/ez-upload.js +587 -0
- package/dist/collection/components/ez-view-stack/ez-view-stack.css +9 -0
- package/dist/collection/components/ez-view-stack/ez-view-stack.js +126 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/servidor.js +101 -0
- package/dist/collection/setupTests.js +1 -0
- package/dist/collection/utils/ApplicationUtils.js +94 -0
- package/dist/collection/utils/AssetsUtils.js +19 -0
- package/dist/collection/utils/CSSVarsUtils.js +73 -0
- package/dist/collection/utils/constants.js +3 -0
- package/dist/collection/utils/form/DataBinder.js +287 -0
- package/dist/collection/utils/form/FormMetadata.js +176 -0
- package/dist/collection/utils/form/index.js +2 -0
- package/dist/collection/utils/form/interfaces/IDefaultConfig.js +1 -0
- package/dist/collection/utils/form/interfaces/IFormCardConfig.js +1 -0
- package/dist/collection/utils/form/interfaces/IFormConfig.js +1 -0
- package/dist/collection/utils/form/interfaces/IFormSheetMetadata.js +1 -0
- package/dist/collection/utils/form/interfaces/ISummaryField.js +1 -0
- package/dist/collection/utils/form/interfaces/ITabConfig.js +1 -0
- package/dist/collection/utils/form/interfaces/index.js +1 -0
- package/dist/collection/utils/index.js +6 -0
- package/dist/collection/utils/interfaces/AbstractFieldMetadata.js +21 -0
- package/dist/collection/utils/interfaces/IFieldConfig.js +1 -0
- package/dist/collection/utils/mock/ez-upload-mock.js +30 -0
- package/dist/collection/utils/utils.js +6 -0
- package/dist/collection/utils/validators/recordvalidator/IInvalidField.js +1 -0
- package/dist/collection/utils/validators/recordvalidator/IRecordValidator.js +1 -0
- package/dist/collection/utils/validators/recordvalidator/IValidationResult.js +1 -0
- package/dist/collection/utils/validators/recordvalidator/IValidationSource.js +1 -0
- package/dist/collection/utils/validators/recordvalidator/RecordValidationProcessor.js +74 -0
- package/dist/custom-elements/index.d.ts +321 -0
- package/dist/custom-elements/index.js +129655 -0
- package/dist/esm/ApplicationUtils-d9a34a16.js +160 -0
- package/dist/esm/CSSVarsUtils-a97cfa29.js +75 -0
- package/dist/esm/CheckMode-bdb2ec19.js +7 -0
- package/dist/esm/DialogType-54a62731.js +9 -0
- package/dist/esm/EzScrollDirection-2df26c93.js +8 -0
- package/dist/esm/RecordValidationProcessor-abc814af.js +99 -0
- package/dist/esm/constants-6dab64f7.js +4 -0
- package/dist/esm/ez-actions-button.entry.js +208 -0
- package/dist/esm/ez-alert.entry.js +26 -0
- package/dist/esm/ez-application.entry.js +22 -0
- package/dist/esm/ez-badge.entry.js +116 -0
- package/dist/esm/ez-breadcrumb.entry.js +281 -0
- package/dist/esm/ez-button.entry.js +83 -0
- package/dist/esm/ez-calendar.entry.js +234 -0
- package/dist/esm/ez-card-item.entry.js +48 -0
- package/dist/esm/ez-check.entry.js +91 -0
- package/dist/esm/ez-chip.entry.js +112 -0
- package/dist/esm/ez-collapsible-box.entry.js +129 -0
- package/dist/esm/ez-combo-box.entry.js +686 -0
- package/dist/esm/ez-date-input.entry.js +184 -0
- package/dist/esm/ez-date-time-input.entry.js +238 -0
- package/dist/esm/ez-dialog.entry.js +176 -0
- package/dist/esm/ez-dropdown.entry.js +511 -0
- package/dist/esm/ez-file-item.entry.js +70 -0
- package/dist/esm/ez-filter-input_2.entry.js +132 -0
- package/dist/esm/ez-form-view.entry.js +187 -0
- package/dist/esm/ez-form.entry.js +929 -0
- package/dist/esm/ez-grid.entry.js +120834 -0
- package/dist/esm/ez-guide-navigator.entry.js +92 -0
- package/dist/esm/ez-icon.entry.js +40 -0
- package/dist/esm/ez-list.entry.js +554 -0
- package/dist/esm/ez-loading-bar.entry.js +28 -0
- package/dist/esm/ez-modal-container.entry.js +60 -0
- package/dist/esm/ez-modal.entry.js +68 -0
- package/dist/esm/ez-multi-selection-list.entry.js +179 -0
- package/dist/esm/ez-number-input.entry.js +177 -0
- package/dist/esm/ez-popover.entry.js +152 -0
- package/dist/esm/ez-popup.entry.js +62 -0
- package/dist/esm/ez-radio-button.entry.js +44 -0
- package/dist/esm/ez-scroller_3.entry.js +786 -0
- package/dist/esm/ez-search.entry.js +92 -0
- package/dist/esm/ez-skeleton.entry.js +63 -0
- package/dist/esm/ez-tabselector.entry.js +224 -0
- package/dist/esm/ez-text-area.entry.js +175 -0
- package/dist/esm/ez-text-edit.entry.js +103 -0
- package/dist/esm/ez-text-input.entry.js +243 -0
- package/dist/esm/ez-time-input.entry.js +164 -0
- package/dist/esm/ez-toast.entry.js +97 -0
- package/dist/esm/ez-upload.entry.js +391 -0
- package/dist/esm/ez-view-stack.entry.js +82 -0
- package/dist/esm/ezui.js +18 -0
- package/dist/esm/filter-column.entry.js +147 -0
- package/dist/esm/index-296b8458.js +2309 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +18 -0
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/css-shim.js +1 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/ezui/ezui.esm.js +1 -0
- package/dist/ezui/index.esm.js +0 -0
- package/dist/ezui/p-028f264f.entry.js +1 -0
- package/dist/ezui/p-050247dc.entry.js +1 -0
- package/dist/ezui/p-061f4d73.entry.js +1 -0
- package/dist/ezui/p-1e7c4986.entry.js +1 -0
- package/dist/ezui/p-244dfe8a.entry.js +1 -0
- package/dist/ezui/p-25562cf8.entry.js +1 -0
- package/dist/ezui/p-27a01a26.js +1 -0
- package/dist/ezui/p-2da09f70.entry.js +1 -0
- package/dist/ezui/p-32b4163f.entry.js +1 -0
- package/dist/ezui/p-37673563.entry.js +1 -0
- package/dist/ezui/p-391de0e4.entry.js +1 -0
- package/dist/ezui/p-5ce6548c.entry.js +1 -0
- package/dist/ezui/p-5cef0264.entry.js +1 -0
- package/dist/ezui/p-5d6f2550.entry.js +1 -0
- package/dist/ezui/p-5e55a42b.entry.js +1 -0
- package/dist/ezui/p-60ba28ea.entry.js +1 -0
- package/dist/ezui/p-68352e41.entry.js +1 -0
- package/dist/ezui/p-6ab2f7c2.entry.js +1 -0
- package/dist/ezui/p-7525e604.entry.js +1 -0
- package/dist/ezui/p-7526f2b6.entry.js +1 -0
- package/dist/ezui/p-7eb3e1a5.js +1 -0
- package/dist/ezui/p-83885b21.entry.js +1 -0
- package/dist/ezui/p-86a2036d.js +1 -0
- package/dist/ezui/p-87e85160.entry.js +1 -0
- package/dist/ezui/p-8bd3903b.entry.js +1 -0
- package/dist/ezui/p-8fdff9cd.entry.js +1 -0
- package/dist/ezui/p-9285b53e.entry.js +1 -0
- package/dist/ezui/p-95426f93.entry.js +1 -0
- package/dist/ezui/p-964e5571.entry.js +304 -0
- package/dist/ezui/p-98bb8b16.js +1 -0
- package/dist/ezui/p-9b347f04.entry.js +1 -0
- package/dist/ezui/p-a01068e1.entry.js +1 -0
- package/dist/ezui/p-a510a4c5.entry.js +1 -0
- package/dist/ezui/p-a5e09759.entry.js +1 -0
- package/dist/ezui/p-ab574d59.js +1 -0
- package/dist/ezui/p-b11f035c.entry.js +1 -0
- package/dist/ezui/p-b853763b.js +1 -0
- package/dist/ezui/p-c49dbf23.entry.js +1 -0
- package/dist/ezui/p-ccb4ccd9.entry.js +1 -0
- package/dist/ezui/p-cd19a6f8.entry.js +1 -0
- package/dist/ezui/p-ce035beb.entry.js +1 -0
- package/dist/ezui/p-d43b22f3.entry.js +1 -0
- package/dist/ezui/p-d51aa09b.entry.js +1 -0
- package/dist/ezui/p-db528b31.entry.js +1 -0
- package/dist/ezui/p-e2dfd935.entry.js +1 -0
- package/dist/ezui/p-e318d280.js +2 -0
- package/dist/ezui/p-e67d0bd5.entry.js +1 -0
- package/dist/ezui/p-e7fa0ad6.entry.js +1 -0
- package/dist/ezui/p-f15ec3bb.js +1 -0
- package/dist/ezui/p-f4208819.entry.js +1 -0
- package/dist/ezui/p-fa571a4e.entry.js +1 -0
- package/dist/ezui/p-ff82b176.entry.js +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/types/components/ez-actions-button/ez-actions-button.d.ts +82 -0
- package/dist/types/components/ez-alert/ez-alert.d.ts +10 -0
- package/dist/types/components/ez-application/ez-application.d.ts +10 -0
- package/dist/types/components/ez-badge/enum/sizes.d.ts +8 -0
- package/dist/types/components/ez-badge/ez-badge.d.ts +35 -0
- package/dist/types/components/ez-badge/interfaces/IPosition.d.ts +4 -0
- package/dist/types/components/ez-breadcrumb/ez-breadcrumb.d.ts +71 -0
- package/dist/types/components/ez-breadcrumb/subcomponents/breadcrumb-item.d.ts +13 -0
- package/dist/types/components/ez-button/ez-button.d.ts +41 -0
- package/dist/types/components/ez-calendar/ez-calendar.d.ts +74 -0
- package/dist/types/components/ez-card-item/ez-card-item.d.ts +32 -0
- package/dist/types/components/ez-check/CheckMode.d.ts +4 -0
- package/dist/types/components/ez-check/ez-check.d.ts +49 -0
- package/dist/types/components/ez-chip/ez-chip.d.ts +60 -0
- package/dist/types/components/ez-collapsible-box/ez-collapsible-box.d.ts +91 -0
- package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +182 -0
- package/dist/types/components/ez-date-input/ez-date-input.d.ts +72 -0
- package/dist/types/components/ez-date-time-input/ez-date-time-input.d.ts +80 -0
- package/dist/types/components/ez-dialog/DialogType.d.ts +6 -0
- package/dist/types/components/ez-dialog/ez-dialog.d.ts +82 -0
- package/dist/types/components/ez-dropdown/ez-dropdown.d.ts +60 -0
- package/dist/types/components/ez-dropdown/structure/DropdownItem.d.ts +28 -0
- package/dist/types/components/ez-dropdown/structure/SubmenuControl.d.ts +78 -0
- package/dist/types/components/ez-file-item/ez-file-item.d.ts +36 -0
- package/dist/types/components/ez-filter-input/ez-filter-input.d.ts +77 -0
- package/dist/types/components/ez-form/ez-form.d.ts +47 -0
- package/dist/types/components/ez-form/store/form.slice.d.ts +27 -0
- package/dist/types/components/ez-form-view/ez-form-view.d.ts +22 -0
- package/dist/types/components/ez-form-view/fieldbuilder/FieldBuilder.d.ts +2 -0
- package/dist/types/components/ez-form-view/fieldbuilder/templates/CheckBox.tpl.d.ts +3 -0
- package/dist/types/components/ez-form-view/fieldbuilder/templates/ComboBox.tpl.d.ts +2 -0
- package/dist/types/components/ez-form-view/fieldbuilder/templates/DateInput.tpl.d.ts +4 -0
- package/dist/types/components/ez-form-view/fieldbuilder/templates/FileInput.tpl.d.ts +2 -0
- package/dist/types/components/ez-form-view/fieldbuilder/templates/NumberInput.tpl.d.ts +3 -0
- package/dist/types/components/ez-form-view/fieldbuilder/templates/SearchInput.tpl.d.ts +2 -0
- package/dist/types/components/ez-form-view/fieldbuilder/templates/TextArea.tpl.d.ts +2 -0
- package/dist/types/components/ez-form-view/fieldbuilder/templates/TextInput.tpl.d.ts +2 -0
- package/dist/types/components/ez-form-view/interfaces/IFormViewField.d.ts +3 -0
- package/dist/types/components/ez-form-view/interfaces/index.d.ts +1 -0
- package/dist/types/components/ez-form-view/structure/index.d.ts +14 -0
- package/dist/types/components/ez-grid/controller/EzGridController.d.ts +287 -0
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +89 -0
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridUtils.d.ts +1 -0
- package/dist/types/components/ez-grid/controller/ag-grid/DataSource.d.ts +20 -0
- package/dist/types/components/ez-grid/controller/ag-grid/GridEditionManager.d.ts +38 -0
- package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomHeader.d.ts +32 -0
- package/dist/types/components/ez-grid/controller/ag-grid/components/cellRendererStatus.d.ts +11 -0
- package/dist/types/components/ez-grid/controller/ag-grid/components/selectionHeader.d.ts +12 -0
- package/dist/types/components/ez-grid/controller/ag-grid/editor/EzCellEditor.d.ts +10 -0
- package/dist/types/components/ez-grid/controller/ag-grid/editor/GridEditorUtils.d.ts +1 -0
- package/dist/types/components/ez-grid/controller/ag-grid/editor/IEditorMetadata.d.ts +9 -0
- package/dist/types/components/ez-grid/controller/ag-grid/editor/IUICellEditor.d.ts +10 -0
- package/dist/types/components/ez-grid/controller/ag-grid/editor/templates/ComboBox.tpl.d.ts +4 -0
- package/dist/types/components/ez-grid/controller/ag-grid/editor/templates/DateInput.tpl.d.ts +5 -0
- package/dist/types/components/ez-grid/controller/ag-grid/editor/templates/NumberInput.tpl.d.ts +4 -0
- package/dist/types/components/ez-grid/controller/ag-grid/editor/templates/Search.tpl.d.ts +3 -0
- package/dist/types/components/ez-grid/controller/ag-grid/editor/templates/TextInput.tpl.d.ts +4 -0
- package/dist/types/components/ez-grid/controller/ag-grid/i18n/pt-BR.d.ts +2 -0
- package/dist/types/components/ez-grid/controller/ag-grid/mock/Server.d.ts +8 -0
- package/dist/types/components/ez-grid/ez-grid.d.ts +139 -0
- package/dist/types/components/ez-grid/interfaces/ISelection.d.ts +3 -0
- package/dist/types/components/ez-grid/interfaces/ISelectionToastConfig.d.ts +3 -0
- package/dist/types/components/ez-grid/interfaces/index.d.ts +2 -0
- package/dist/types/components/ez-grid/subcomponents/filter-column.d.ts +57 -0
- package/dist/types/components/ez-grid/subcomponents/selection-counter.d.ts +15 -0
- package/dist/types/components/ez-grid/utils/InMemoryFilterColumnDataSource.d.ts +16 -0
- package/dist/types/components/ez-guide-navigator/ez-guide-navigator.d.ts +64 -0
- package/dist/types/components/ez-guide-navigator/interfaces/IGuideItem.d.ts +4 -0
- package/dist/types/components/ez-guide-navigator/interfaces/index.d.ts +1 -0
- package/dist/types/components/ez-icon/ez-icon.d.ts +20 -0
- package/dist/types/components/ez-list/ez-list.d.ts +133 -0
- package/dist/types/components/ez-loading-bar/ez-loading-bar.d.ts +12 -0
- package/dist/types/components/ez-modal/ez-modal.d.ts +53 -0
- package/dist/types/components/ez-modal-container/ez-modal-container.d.ts +47 -0
- package/dist/types/components/ez-modal-container/index.d.ts +2 -0
- package/dist/types/components/ez-modal-container/modal-action.d.ts +7 -0
- package/dist/types/components/ez-modal-container/modal-button-status.d.ts +6 -0
- package/dist/types/components/ez-multi-selection-list/ez-multi-selection-list.d.ts +68 -0
- package/dist/types/components/ez-multi-selection-list/interfaces/IMultiSelectionListDataSource.d.ts +4 -0
- package/dist/types/components/ez-multi-selection-list/interfaces/IMultiSelectionOption.d.ts +4 -0
- package/dist/types/components/ez-multi-selection-list/subcomponents/multi-selection-box-message.d.ts +4 -0
- package/dist/types/components/ez-number-input/ez-number-input.d.ts +81 -0
- package/dist/types/components/ez-popover/ez-popover.d.ts +60 -0
- package/dist/types/components/ez-popup/ez-popup.d.ts +37 -0
- package/dist/types/components/ez-radio-button/ez-radio-button.d.ts +37 -0
- package/dist/types/components/ez-scroller/EzScrollDirection.d.ts +5 -0
- package/dist/types/components/ez-scroller/ez-scroller.d.ts +38 -0
- package/dist/types/components/ez-search/ez-search.d.ts +84 -0
- package/dist/types/components/ez-sidebar-button/ez-sidebar-button.d.ts +11 -0
- package/dist/types/components/ez-skeleton/ez-skeleton.constants.d.ts +1 -0
- package/dist/types/components/ez-skeleton/ez-skeleton.d.ts +54 -0
- package/dist/types/components/ez-tabselector/ez-tabselector.d.ts +52 -0
- package/dist/types/components/ez-text-area/ez-text-area.d.ts +78 -0
- package/dist/types/components/ez-text-edit/ez-text-edit.d.ts +41 -0
- package/dist/types/components/ez-text-input/ez-text-input.d.ts +82 -0
- package/dist/types/components/ez-time-input/ez-time-input.d.ts +74 -0
- package/dist/types/components/ez-toast/ez-toast.d.ts +45 -0
- package/dist/types/components/ez-tree/ez-tree.d.ts +101 -0
- package/dist/types/components/ez-tree/interfaces/ITree.d.ts +5 -0
- package/dist/types/components/ez-tree/interfaces/ITreeItem.d.ts +11 -0
- package/dist/types/components/ez-tree/subcomponents/DefaultIconResolver.d.ts +2 -0
- package/dist/types/components/ez-tree/subcomponents/DefaultTooltipResolver.d.ts +2 -0
- package/dist/types/components/ez-tree/subcomponents/TreeItem.d.ts +15 -0
- package/dist/types/components/ez-tree/subcomponents/index.d.ts +2 -0
- package/dist/types/components/ez-tree/types/Node.d.ts +22 -0
- package/dist/types/components/ez-tree/types/Tree.d.ts +21 -0
- package/dist/types/components/ez-upload/RemoteFile.d.ts +14 -0
- package/dist/types/components/ez-upload/ez-upload.d.ts +101 -0
- package/dist/types/components/ez-view-stack/ez-view-stack.d.ts +25 -0
- package/dist/types/components.d.ts +3464 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/stencil-public-runtime.d.ts +1637 -0
- package/dist/types/utils/ApplicationUtils.d.ts +31 -0
- package/dist/types/utils/AssetsUtils.d.ts +1 -0
- package/dist/types/utils/CSSVarsUtils.d.ts +6 -0
- package/dist/types/utils/constants.d.ts +3 -0
- package/dist/types/utils/form/DataBinder.d.ts +30 -0
- package/dist/types/utils/form/FormMetadata.d.ts +23 -0
- package/dist/types/utils/form/index.d.ts +2 -0
- package/dist/types/utils/form/interfaces/IDefaultConfig.d.ts +5 -0
- package/dist/types/utils/form/interfaces/IFormCardConfig.d.ts +5 -0
- package/dist/types/utils/form/interfaces/IFormConfig.d.ts +13 -0
- package/dist/types/utils/form/interfaces/IFormSheetMetadata.d.ts +6 -0
- package/dist/types/utils/form/interfaces/ISummaryField.d.ts +4 -0
- package/dist/types/utils/form/interfaces/ITabConfig.d.ts +6 -0
- package/dist/types/utils/form/interfaces/index.d.ts +10 -0
- package/dist/types/utils/index.d.ts +6 -0
- package/dist/types/utils/interfaces/AbstractFieldMetadata.d.ts +17 -0
- package/dist/types/utils/interfaces/IFieldConfig.d.ts +13 -0
- package/dist/types/utils/utils.d.ts +2 -0
- package/dist/types/utils/validators/recordvalidator/IInvalidField.d.ts +4 -0
- package/dist/types/utils/validators/recordvalidator/IRecordValidator.d.ts +5 -0
- package/dist/types/utils/validators/recordvalidator/IValidationResult.d.ts +8 -0
- package/dist/types/utils/validators/recordvalidator/IValidationSource.d.ts +6 -0
- package/dist/types/utils/validators/recordvalidator/RecordValidationProcessor.d.ts +13 -0
- package/loader/cdn.js +3 -0
- package/loader/index.cjs.js +3 -0
- package/loader/index.d.ts +21 -0
- package/loader/index.es2017.js +3 -0
- package/loader/index.js +4 -0
- package/loader/package.json +11 -0
- package/package.json +93 -0
- package/react/.keepfolder +0 -0
- package/react/components.d.ts +48 -0
- package/react/components.js +52 -0
- package/react/components.js.map +1 -0
- package/react/react-component-lib/createComponent.d.ts +10 -0
- package/react/react-component-lib/createComponent.js +59 -0
- package/react/react-component-lib/createComponent.js.map +1 -0
- package/react/react-component-lib/createOverlayComponent.d.ts +20 -0
- package/react/react-component-lib/createOverlayComponent.js +89 -0
- package/react/react-component-lib/createOverlayComponent.js.map +1 -0
- package/react/react-component-lib/index.d.ts +2 -0
- package/react/react-component-lib/index.js +3 -0
- package/react/react-component-lib/index.js.map +1 -0
- package/react/react-component-lib/interfaces.d.ts +29 -0
- package/react/react-component-lib/interfaces.js +1 -0
- package/react/react-component-lib/interfaces.js.map +1 -0
- package/react/react-component-lib/utils/attachProps.d.ts +12 -0
- package/react/react-component-lib/utils/attachProps.js +96 -0
- package/react/react-component-lib/utils/attachProps.js.map +1 -0
- package/react/react-component-lib/utils/case.d.ts +2 -0
- package/react/react-component-lib/utils/case.js +7 -0
- package/react/react-component-lib/utils/case.js.map +1 -0
- package/react/react-component-lib/utils/dev.d.ts +2 -0
- package/react/react-component-lib/utils/dev.js +13 -0
- package/react/react-component-lib/utils/dev.js.map +1 -0
- package/react/react-component-lib/utils/index.d.ts +7 -0
- package/react/react-component-lib/utils/index.js +21 -0
- package/react/react-component-lib/utils/index.js.map +1 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export function calcFilterColumnLeftPosition(leftReference) {
|
|
2
|
+
const FIX_MARGIN = 60;
|
|
3
|
+
const FILTER_COLUMN_WIDTH = 330;
|
|
4
|
+
const screenWidth = window.innerWidth;
|
|
5
|
+
const maxLeft = screenWidth - (FILTER_COLUMN_WIDTH + FIX_MARGIN);
|
|
6
|
+
const leftInt = leftReference - FIX_MARGIN;
|
|
7
|
+
return leftInt > maxLeft ? maxLeft : leftInt;
|
|
8
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { Action, ObjectUtils } from "@sankhyalabs/core";
|
|
2
|
+
export default class DataSource {
|
|
3
|
+
constructor(dataUnit, controller, options) {
|
|
4
|
+
this.RECORD_ARCHIVE = "__RECORD_ARCHIVE__";
|
|
5
|
+
this.duObserver = (action) => {
|
|
6
|
+
switch (action.type) {
|
|
7
|
+
case Action.METADATA_LOADED:
|
|
8
|
+
this._controller.setColumnsDef(this.buildColumnDefs());
|
|
9
|
+
break;
|
|
10
|
+
case Action.LOADING_DATA:
|
|
11
|
+
this._waitingForLoad = true;
|
|
12
|
+
this._controller.refresh();
|
|
13
|
+
break;
|
|
14
|
+
case Action.DATA_LOADED:
|
|
15
|
+
this._waitingForLoad = false;
|
|
16
|
+
this.callbackGetRows(this._lastLoadingParams);
|
|
17
|
+
if (this._options) {
|
|
18
|
+
this._options.onPaginationChange(this._dataUnit.getPaginationInfo());
|
|
19
|
+
}
|
|
20
|
+
this.updateSelection();
|
|
21
|
+
break;
|
|
22
|
+
case Action.RECORDS_REMOVED:
|
|
23
|
+
case Action.DATA_SAVED:
|
|
24
|
+
case Action.EDITION_CANCELED:
|
|
25
|
+
case Action.DATA_CHANGED:
|
|
26
|
+
case Action.DATA_RESOLVED:
|
|
27
|
+
this._controller.refresh();
|
|
28
|
+
break;
|
|
29
|
+
case Action.SELECTION_CHANGED:
|
|
30
|
+
case Action.NEXT_SELECTED:
|
|
31
|
+
case Action.PREVIOUS_SELECTED:
|
|
32
|
+
this.updateSelection();
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
this._dataUnit = dataUnit;
|
|
37
|
+
this._controller = controller;
|
|
38
|
+
this._controller.setColumnsDef(this.buildColumnDefs());
|
|
39
|
+
this._options = options;
|
|
40
|
+
this._dataUnit.subscribe(this.duObserver);
|
|
41
|
+
}
|
|
42
|
+
updateSelection() {
|
|
43
|
+
const selectionInfo = this._dataUnit.getSelectionInfo();
|
|
44
|
+
if (selectionInfo.isAllRecords()) {
|
|
45
|
+
this._controller.selectAll(true);
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
this._controller.selectRows(selectionInfo.recordIds, true);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
getRows(params) {
|
|
52
|
+
if (this.needReload(params)) {
|
|
53
|
+
this._lastLoadingParams = params;
|
|
54
|
+
this._dataUnit.loadData(this.quickFilter).then(() => this.updateSelection());
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
this._lastLoadingParams = params;
|
|
58
|
+
if (!this._waitingForLoad) {
|
|
59
|
+
this.callbackGetRows(params);
|
|
60
|
+
this.updateSelection();
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
needReload(currentLoading) {
|
|
65
|
+
if (this._lastLoadingParams) {
|
|
66
|
+
return ObjectUtils.objectToString(currentLoading.request) != ObjectUtils.objectToString(this._lastLoadingParams.request);
|
|
67
|
+
}
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
callbackGetRows(params) {
|
|
71
|
+
if (params) {
|
|
72
|
+
params.success({ rowData: this._dataUnit.records });
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
destroy() {
|
|
76
|
+
this._dataUnit.unsubscribe(this.duObserver);
|
|
77
|
+
}
|
|
78
|
+
buildColumnDefs() {
|
|
79
|
+
const gridConfig = this._controller.getGridConfig() || [];
|
|
80
|
+
const columnDefs = [];
|
|
81
|
+
if (this._dataUnit.metadata) {
|
|
82
|
+
this._dataUnit.metadata.fields.sort((a, b) => {
|
|
83
|
+
const indexA = gridConfig.findIndex(value => value.name === a.name);
|
|
84
|
+
const indexB = gridConfig.findIndex(value => value.name === b.name);
|
|
85
|
+
return indexA - indexB;
|
|
86
|
+
});
|
|
87
|
+
this._dataUnit.metadata.fields.forEach(f => {
|
|
88
|
+
var _a;
|
|
89
|
+
if (f.visible !== false && f.name !== this.RECORD_ARCHIVE) {
|
|
90
|
+
const props = new Map();
|
|
91
|
+
const properties = this._dataUnit.getField(f.name).properties;
|
|
92
|
+
for (const value in properties) {
|
|
93
|
+
props.set(value, properties[value]);
|
|
94
|
+
}
|
|
95
|
+
columnDefs.push({ label: f.label, name: f.name, userInterface: f.userInterface, options: (_a = this._dataUnit.getField(f.name).properties) === null || _a === void 0 ? void 0 : _a.options, props });
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
return columnDefs;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import { UserInterface } from "@sankhyalabs/core";
|
|
2
|
+
import { KeyCode } from "ag-grid-community";
|
|
3
|
+
import { RecordValidationProcessor } from "../../../../utils/validators/recordvalidator/RecordValidationProcessor";
|
|
4
|
+
import EzCellEditor from "./editor/EzCellEditor";
|
|
5
|
+
export default class GridEditionManager {
|
|
6
|
+
constructor(dataUnit, useEnterLikeTab, recordsValidator, editionIsDisabled) {
|
|
7
|
+
this._dataUnit = dataUnit;
|
|
8
|
+
this._recordValidationProcessor = new RecordValidationProcessor(this._dataUnit, {
|
|
9
|
+
getRequiredFields: () => this.getRequiredFields(),
|
|
10
|
+
markAsInvalid: () => { },
|
|
11
|
+
getMessageForField: () => null
|
|
12
|
+
}, recordsValidator);
|
|
13
|
+
this._useEnterLikeTab = useEnterLikeTab;
|
|
14
|
+
this._editionIsDisabled = editionIsDisabled;
|
|
15
|
+
}
|
|
16
|
+
configureGrid(options) {
|
|
17
|
+
this._gridOptions = options;
|
|
18
|
+
options.readOnlyEdit = true;
|
|
19
|
+
options.onCellEditRequest = evt => this.onCellEditRequest(evt);
|
|
20
|
+
options.onCellKeyDown = evt => {
|
|
21
|
+
if (evt.event && evt["column"]) {
|
|
22
|
+
this.onCellKeyDown(evt);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
return options;
|
|
26
|
+
}
|
|
27
|
+
proceedAutoSave() {
|
|
28
|
+
if (!this._dataUnit.isDirty()) {
|
|
29
|
+
this.saveSuccess();
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
if (!this._isGridEdition) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const currentRercord = this._dataUnit.getSelectedRecord();
|
|
36
|
+
if (currentRercord == undefined) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
this._recordValidationProcessor
|
|
40
|
+
.validate()
|
|
41
|
+
.then(() => {
|
|
42
|
+
this._dataUnit.saveData()
|
|
43
|
+
.then(() => this.saveSuccess())
|
|
44
|
+
.catch(reason => this.saveFail(reason));
|
|
45
|
+
})
|
|
46
|
+
.catch(reason => this.saveFail(reason));
|
|
47
|
+
}
|
|
48
|
+
navigateByEnterKey(keyboardEvent) {
|
|
49
|
+
const backwards = keyboardEvent.shiftKey;
|
|
50
|
+
if (this._useEnterLikeTab) {
|
|
51
|
+
if (backwards) {
|
|
52
|
+
this._gridOptions.api.tabToPreviousCell(keyboardEvent);
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
this._gridOptions.api.tabToNextCell(keyboardEvent);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
const editionCell = this._gridOptions.api.getEditingCells()[0];
|
|
60
|
+
if (editionCell) {
|
|
61
|
+
let { rowIndex } = editionCell;
|
|
62
|
+
this.nextEditionRow(rowIndex, editionCell.column, backwards);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
getComponents() {
|
|
67
|
+
return { ezCellEditor: EzCellEditor };
|
|
68
|
+
}
|
|
69
|
+
verifyClickToEdition(api, cellClicked) {
|
|
70
|
+
if (this.isSecondClick(cellClicked)) {
|
|
71
|
+
api.startEditingCell({ rowIndex: cellClicked.rowIndex, colKey: cellClicked.column.getColId() });
|
|
72
|
+
}
|
|
73
|
+
this._lastCellClicked = cellClicked;
|
|
74
|
+
}
|
|
75
|
+
configureColumn(col) {
|
|
76
|
+
col.cellEditor = 'ezCellEditor';
|
|
77
|
+
col.editable = params => this.canEdit(params);
|
|
78
|
+
col.suppressKeyboardEvent = (params) => {
|
|
79
|
+
return params.event.key === KeyCode.ENTER;
|
|
80
|
+
};
|
|
81
|
+
return col;
|
|
82
|
+
}
|
|
83
|
+
getRequiredFields() {
|
|
84
|
+
return this._gridOptions.columnApi.getAllDisplayedColumns().filter(c => {
|
|
85
|
+
const fieldDefinition = this._dataUnit.getField(c.getColId());
|
|
86
|
+
return fieldDefinition && fieldDefinition.required;
|
|
87
|
+
}).map(c => c.getColId());
|
|
88
|
+
}
|
|
89
|
+
saveSuccess() {
|
|
90
|
+
this.focusOnCell(this._targetEditionCell);
|
|
91
|
+
this._lastCellEdited = undefined;
|
|
92
|
+
this._targetEditionCell = undefined;
|
|
93
|
+
this._isGridEdition = false;
|
|
94
|
+
}
|
|
95
|
+
saveFail(reason) {
|
|
96
|
+
this.focusOnCell(this._lastCellEdited);
|
|
97
|
+
this._isGridEdition = false;
|
|
98
|
+
if (reason) {
|
|
99
|
+
Promise.reject(reason);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
focusOnCell(cell) {
|
|
103
|
+
if (cell == undefined) {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
const { rowIndex, column } = cell;
|
|
107
|
+
this._gridOptions.api.getDisplayedRowAtIndex(rowIndex).setSelected(true, true);
|
|
108
|
+
this._gridOptions.api.clearRangeSelection();
|
|
109
|
+
this._gridOptions.api.addCellRange({ rowStartIndex: rowIndex, rowEndIndex: rowIndex, columns: [column] });
|
|
110
|
+
this._gridOptions.api.startEditingCell({ colKey: column.getColId(), rowIndex });
|
|
111
|
+
this._gridOptions.api.setFocusedCell(rowIndex, column.getColId());
|
|
112
|
+
const cellEditor = this._gridOptions.api.getCellEditorInstances()[0];
|
|
113
|
+
if (cellEditor) {
|
|
114
|
+
cellEditor.focusIn();
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
onCellKeyDown(event) {
|
|
118
|
+
const keyboardEvent = event.event;
|
|
119
|
+
switch (keyboardEvent.key) {
|
|
120
|
+
case KeyCode.ENTER:
|
|
121
|
+
this.processEnterKey(keyboardEvent, event);
|
|
122
|
+
break;
|
|
123
|
+
case KeyCode.UP:
|
|
124
|
+
this.editPreviousRow(event.api);
|
|
125
|
+
break;
|
|
126
|
+
case KeyCode.DOWN:
|
|
127
|
+
this.editNextRow(event.api);
|
|
128
|
+
break;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
processEnterKey(keyboardEvent, event) {
|
|
132
|
+
const editionCell = event.api.getEditingCells()[0];
|
|
133
|
+
if (!editionCell) {
|
|
134
|
+
event.api.startEditingCell({ colKey: event.column.getColId(), rowIndex: event.rowIndex });
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
this.navigateByEnterKey(keyboardEvent);
|
|
138
|
+
}
|
|
139
|
+
nextEditionRow(rowIndex, column, backwards) {
|
|
140
|
+
if (backwards) {
|
|
141
|
+
rowIndex = rowIndex - 1;
|
|
142
|
+
if (rowIndex < 0) {
|
|
143
|
+
rowIndex = this._dataUnit.records.length - 1;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
rowIndex = rowIndex + 1;
|
|
148
|
+
if (rowIndex >= this._dataUnit.records.length) {
|
|
149
|
+
rowIndex = 0;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
this._targetEditionCell = new TargetEdition(rowIndex, column, true);
|
|
153
|
+
this.finishEdition();
|
|
154
|
+
}
|
|
155
|
+
editPreviousRow(api) {
|
|
156
|
+
this.moveEditionVertically(api, -1);
|
|
157
|
+
}
|
|
158
|
+
editNextRow(api) {
|
|
159
|
+
this.moveEditionVertically(api, 1);
|
|
160
|
+
}
|
|
161
|
+
moveEditionVertically(api, offset) {
|
|
162
|
+
const editionCell = api.getEditingCells()[0];
|
|
163
|
+
if (!editionCell) {
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
const rowIndex = editionCell.rowIndex + offset;
|
|
167
|
+
if (api.getDisplayedRowAtIndex(rowIndex)) {
|
|
168
|
+
this._targetEditionCell = new TargetEdition(rowIndex, editionCell.column, offset < 0);
|
|
169
|
+
this.finishEdition();
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
finishEdition() {
|
|
173
|
+
this._gridOptions.api.stopEditing();
|
|
174
|
+
setTimeout(() => {
|
|
175
|
+
//O Timeout foi inserido para permitir que o ciclo de finalização prossiga
|
|
176
|
+
//pois precisamos aguardar o fim da edição para executar o autosave.
|
|
177
|
+
this.proceedAutoSave();
|
|
178
|
+
}, 0);
|
|
179
|
+
}
|
|
180
|
+
canEdit(params) {
|
|
181
|
+
if (this._editionIsDisabled()) {
|
|
182
|
+
return false;
|
|
183
|
+
}
|
|
184
|
+
return this.isColEditable(params.colDef.field);
|
|
185
|
+
}
|
|
186
|
+
isColEditable(fieldName) {
|
|
187
|
+
const fieldDefinition = this._dataUnit.getField(fieldName);
|
|
188
|
+
if (fieldDefinition) {
|
|
189
|
+
return !fieldDefinition.readOnly;
|
|
190
|
+
}
|
|
191
|
+
return false;
|
|
192
|
+
}
|
|
193
|
+
isSecondClick(cellClicked) {
|
|
194
|
+
if (!this._lastCellClicked) {
|
|
195
|
+
return false;
|
|
196
|
+
}
|
|
197
|
+
if (this._lastCellClicked.column != cellClicked.column) {
|
|
198
|
+
return false;
|
|
199
|
+
}
|
|
200
|
+
if (this._lastCellClicked.rowIndex != cellClicked.rowIndex) {
|
|
201
|
+
return false;
|
|
202
|
+
}
|
|
203
|
+
return true;
|
|
204
|
+
}
|
|
205
|
+
onCellEditRequest(event) {
|
|
206
|
+
const fieldName = event.colDef.field;
|
|
207
|
+
const value = event.newValue;
|
|
208
|
+
if (event.oldValue != value) {
|
|
209
|
+
if (value instanceof Promise) {
|
|
210
|
+
const fieldDescriptor = this._dataUnit.getField(event.colDef.colId);
|
|
211
|
+
event.node.setData(Object.assign(Object.assign({}, event.data), { [fieldName]: (fieldDescriptor === null || fieldDescriptor === void 0 ? void 0 : fieldDescriptor.userInterface) === UserInterface.SEARCH ? value : event.oldValue }));
|
|
212
|
+
value.then(resolved => event.node.setData(Object.assign(Object.assign({}, event.data), { [fieldName]: resolved })));
|
|
213
|
+
}
|
|
214
|
+
else {
|
|
215
|
+
event.node.setData(Object.assign(Object.assign({}, event.data), { [fieldName]: value }));
|
|
216
|
+
}
|
|
217
|
+
this._isGridEdition = true;
|
|
218
|
+
this._dataUnit.setFieldValue(fieldName, value, [event.data.__record__id__]);
|
|
219
|
+
this._lastCellEdited = { rowIndex: event.rowIndex, column: event.column, rowPinned: undefined };
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
class TargetEdition {
|
|
224
|
+
constructor(rowIndex, column, backwards) {
|
|
225
|
+
this.rowPinned = null;
|
|
226
|
+
this.rowIndex = rowIndex;
|
|
227
|
+
this.column = column;
|
|
228
|
+
this.backwards = backwards;
|
|
229
|
+
}
|
|
230
|
+
}
|
package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomHeader.js
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { calcFilterColumnLeftPosition } from '../AgGridUtils';
|
|
2
|
+
export class EzGridCustomHeader {
|
|
3
|
+
init(agParams) {
|
|
4
|
+
var _a;
|
|
5
|
+
this.params = agParams;
|
|
6
|
+
this.element = document.createElement('div');
|
|
7
|
+
this.element.classList.add('ag-cell-label-container');
|
|
8
|
+
this.element.setAttribute('title', (_a = this.params.tooltip) !== null && _a !== void 0 ? _a : '');
|
|
9
|
+
this.element.innerHTML = `
|
|
10
|
+
<div class='ez-flex ez-flex--justify-between'>
|
|
11
|
+
<i id='ez-grid-filter-icon' class='ez-icon-filter' style='color:#008561'></i>
|
|
12
|
+
<i id='ez-grid-menu-icon' class='ez-icon-dots-vertical'></i>
|
|
13
|
+
</div>
|
|
14
|
+
<div id='ez-header-container' class='ez-flex ez-flex--justify-between ag-header-cell-text'>
|
|
15
|
+
<span class='ag-header-cell-text'>${this.params.displayName}</span>
|
|
16
|
+
<i id='ez-grid-sort-icon-down' class='ez-icon-arrow_downward' style='display: none;margin-left: 4px;font-size: var(--text--medium, 14px);align-self: center;'></i>
|
|
17
|
+
<i id='ez-grid-sort-icon-up' class='ez-icon-arrow_downward' style='display: none; transform: rotate(180deg);margin-left: 4px;font-size: var(--text--medium, 14px);align-self: center;'></i>
|
|
18
|
+
</div>
|
|
19
|
+
`;
|
|
20
|
+
this.configMenuClick();
|
|
21
|
+
this.configSortClick();
|
|
22
|
+
this.configSortListener();
|
|
23
|
+
this.configFilterButton();
|
|
24
|
+
}
|
|
25
|
+
refresh(agParams) {
|
|
26
|
+
this.params = agParams;
|
|
27
|
+
this.configFilterButton();
|
|
28
|
+
this.configSortIcon();
|
|
29
|
+
}
|
|
30
|
+
configFilterButton() {
|
|
31
|
+
this.filterButton = this.element.querySelector('#ez-grid-filter-icon');
|
|
32
|
+
this.filterButton.style.display = this.params.hasFilter() ? 'flex' : 'none';
|
|
33
|
+
this.onFilterButtonClickListener = this.onClickFilter.bind(this);
|
|
34
|
+
this.filterButton.addEventListener('click', this.onFilterButtonClickListener);
|
|
35
|
+
}
|
|
36
|
+
onClickFilter() {
|
|
37
|
+
var _a;
|
|
38
|
+
const iconLeft = (_a = this.filterButton) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().left;
|
|
39
|
+
this.params.showColumnFilter(`${calcFilterColumnLeftPosition(iconLeft)}px`, true);
|
|
40
|
+
}
|
|
41
|
+
configSortIcon() {
|
|
42
|
+
this.sortDownIcon.style.display = this.params.column.isSortDescending() ? 'flex' : 'none';
|
|
43
|
+
this.sortUpIcon.style.display = this.params.column.isSortAscending() ? 'flex' : 'none';
|
|
44
|
+
}
|
|
45
|
+
configSortListener() {
|
|
46
|
+
if (this.params.enableSorting) {
|
|
47
|
+
this.sortUpIcon = this.element.querySelector('#ez-grid-sort-icon-up');
|
|
48
|
+
this.sortDownIcon = this.element.querySelector('#ez-grid-sort-icon-down');
|
|
49
|
+
this.onSortChangedListener = this.configSortIcon.bind(this);
|
|
50
|
+
this.params.column.addEventListener('sortChanged', this.onSortChangedListener);
|
|
51
|
+
this.configSortIcon();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
onSortClick(event) {
|
|
55
|
+
this.params.progressSort(event.shiftKey);
|
|
56
|
+
}
|
|
57
|
+
configSortClick() {
|
|
58
|
+
if (this.params.column.getColDef().sortable) {
|
|
59
|
+
this.headerContainer = this.element.querySelector('#ez-header-container');
|
|
60
|
+
this.onSortClickListener = this.onSortClick.bind(this);
|
|
61
|
+
this.headerContainer.addEventListener('click', this.onSortClickListener);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
onMenuClick() {
|
|
65
|
+
this.params.showColumnMenu(this.menuButton);
|
|
66
|
+
}
|
|
67
|
+
configMenuClick() {
|
|
68
|
+
this.menuButton = this.element.querySelector('#ez-grid-menu-icon');
|
|
69
|
+
this.onMenuClickListener = this.onMenuClick.bind(this);
|
|
70
|
+
this.menuButton.addEventListener('click', this.onMenuClickListener);
|
|
71
|
+
}
|
|
72
|
+
getGui() {
|
|
73
|
+
return this.element;
|
|
74
|
+
}
|
|
75
|
+
destroy() {
|
|
76
|
+
if (this.onMenuClickListener) {
|
|
77
|
+
this.menuButton.removeEventListener('click', this.onMenuClickListener);
|
|
78
|
+
}
|
|
79
|
+
if (this.onSortClickListener) {
|
|
80
|
+
this.headerContainer.removeEventListener('click', this.onSortClickListener);
|
|
81
|
+
}
|
|
82
|
+
if (this.onFilterButtonClickListener) {
|
|
83
|
+
this.filterButton.removeEventListener('click', this.onFilterButtonClickListener);
|
|
84
|
+
}
|
|
85
|
+
this.params.column.removeEventListener('sortChanged', this.onSortChangedListener);
|
|
86
|
+
this.params.column.removeEventListener('applyFilterColumnOptions', this.onFilterAppliedListener);
|
|
87
|
+
}
|
|
88
|
+
}
|
package/dist/collection/components/ez-grid/controller/ag-grid/components/cellRendererStatus.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export class CellRendererStatus {
|
|
2
|
+
constructor() {
|
|
3
|
+
this.DEFAULT_COLOR = 'transparent';
|
|
4
|
+
this._eGui = undefined;
|
|
5
|
+
}
|
|
6
|
+
init(params) {
|
|
7
|
+
this.renderStatus(params);
|
|
8
|
+
}
|
|
9
|
+
refresh(params) {
|
|
10
|
+
this.renderStatus(params);
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
13
|
+
destroy() {
|
|
14
|
+
this._eGui = undefined;
|
|
15
|
+
}
|
|
16
|
+
getGui() {
|
|
17
|
+
return this._eGui;
|
|
18
|
+
}
|
|
19
|
+
resolveColor(statusResolver, data) {
|
|
20
|
+
let color;
|
|
21
|
+
if (statusResolver instanceof Function) {
|
|
22
|
+
color = statusResolver(data);
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
const statusKey = Object.keys(statusResolver)[0];
|
|
26
|
+
const statusValues = statusResolver[statusKey];
|
|
27
|
+
const value = data[statusKey];
|
|
28
|
+
color = statusValues != undefined && value != undefined && statusValues[value];
|
|
29
|
+
}
|
|
30
|
+
return color || this.DEFAULT_COLOR;
|
|
31
|
+
}
|
|
32
|
+
renderStatus(params) {
|
|
33
|
+
const { data, statusResolver } = params !== null && params !== void 0 ? params : {};
|
|
34
|
+
if (statusResolver == undefined) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
const color = this.resolveColor(statusResolver, data);
|
|
38
|
+
this._eGui = document.createElement('div');
|
|
39
|
+
this._eGui.innerHTML = `
|
|
40
|
+
<span class="ez-grid__cell-status" style="background-color: ${color || ""};"></span>
|
|
41
|
+
`;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export default class SelectionHeader {
|
|
2
|
+
updateCheckbox() {
|
|
3
|
+
this.updatingValue = true;
|
|
4
|
+
try {
|
|
5
|
+
const value = this.headerCheckStatusGetter();
|
|
6
|
+
this.checkBox.indeterminate = value == undefined;
|
|
7
|
+
this.checkBox.value = value;
|
|
8
|
+
}
|
|
9
|
+
finally {
|
|
10
|
+
this.updatingValue = false;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
init(params) {
|
|
14
|
+
params.context.selectionHeader = this;
|
|
15
|
+
const valueSetter = params.context.headerCheckStatusSetter;
|
|
16
|
+
this.headerCheckStatusGetter = params.context.headerCheckStatusGetter;
|
|
17
|
+
this.element = document.createElement('div');
|
|
18
|
+
this.element.classList.add("ag-header__selection-checkbox");
|
|
19
|
+
this.checkBox = document.createElement('ez-check');
|
|
20
|
+
this.checkBox.style.setProperty("--ez-check--focus--background-color", "transparent");
|
|
21
|
+
this.checkBox.style.setProperty("--ez-check--hover--background-color", "transparent");
|
|
22
|
+
this.element.append(this.checkBox);
|
|
23
|
+
this.updateCheckbox();
|
|
24
|
+
this.element.addEventListener('ezChange', (evt) => {
|
|
25
|
+
if (!this.updatingValue) {
|
|
26
|
+
valueSetter(evt.detail);
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
getGui() {
|
|
31
|
+
return this.element;
|
|
32
|
+
}
|
|
33
|
+
destroy() {
|
|
34
|
+
this.element.remove();
|
|
35
|
+
this.element = null;
|
|
36
|
+
}
|
|
37
|
+
refresh(_params) {
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { UserInterface } from "@sankhyalabs/core";
|
|
2
|
+
import { buildEditorMetadata } from "./IEditorMetadata";
|
|
3
|
+
import { buildTextAreaInput, buildTextInput } from "./templates/TextInput.tpl";
|
|
4
|
+
import { buildDate, buildDateTime, buildTime } from "./templates/DateInput.tpl";
|
|
5
|
+
import { buildDecimal, buildInteger } from "./templates/NumberInput.tpl";
|
|
6
|
+
import { buildComboBox, buildSwitch } from "./templates/ComboBox.tpl";
|
|
7
|
+
import { buildSearch } from "./templates/Search.tpl";
|
|
8
|
+
const uiBuilders = new Map();
|
|
9
|
+
uiBuilders.set(UserInterface.DATE, buildDate);
|
|
10
|
+
uiBuilders.set(UserInterface.TIME, buildTime);
|
|
11
|
+
uiBuilders.set(UserInterface.DATETIME, buildDateTime);
|
|
12
|
+
uiBuilders.set(UserInterface.DECIMALNUMBER, buildDecimal);
|
|
13
|
+
uiBuilders.set(UserInterface.INTEGERNUMBER, buildInteger);
|
|
14
|
+
uiBuilders.set(UserInterface.SWITCH, buildSwitch);
|
|
15
|
+
uiBuilders.set(UserInterface.CHECKBOX, buildSwitch);
|
|
16
|
+
uiBuilders.set(UserInterface.OPTIONSELECTOR, buildComboBox);
|
|
17
|
+
uiBuilders.set(UserInterface.LONGTEXT, buildTextAreaInput);
|
|
18
|
+
uiBuilders.set(UserInterface.SEARCH, buildSearch);
|
|
19
|
+
export default class EzCellEditor {
|
|
20
|
+
init(params) {
|
|
21
|
+
const fieldName = params.column.getColId();
|
|
22
|
+
const dataUnit = params.context.dataUnit;
|
|
23
|
+
const fieldMetadata = buildEditorMetadata(dataUnit.getField(fieldName), params.eGridCell, dataUnit, params.context.editionManager);
|
|
24
|
+
const builder = uiBuilders.get(fieldMetadata.userInterface) || buildTextInput;
|
|
25
|
+
this._gui = builder(fieldMetadata);
|
|
26
|
+
if (this._gui.valueSetter != undefined) {
|
|
27
|
+
this._gui.valueSetter(params.value);
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
this._gui.value = params.value;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
getGui() {
|
|
34
|
+
return this._gui;
|
|
35
|
+
}
|
|
36
|
+
afterGuiAttached() {
|
|
37
|
+
this.focusIn();
|
|
38
|
+
}
|
|
39
|
+
focusIn() {
|
|
40
|
+
this._gui.focus();
|
|
41
|
+
this._gui.setFocus({ selectText: true });
|
|
42
|
+
}
|
|
43
|
+
getValue() {
|
|
44
|
+
return this._gui.valueGetter != undefined ? this._gui.valueGetter() : this._gui.value;
|
|
45
|
+
}
|
|
46
|
+
isPopup() {
|
|
47
|
+
return this._gui.isPopUp;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export function getViewPortHeight(cell) {
|
|
2
|
+
let currentElem = cell;
|
|
3
|
+
while (currentElem) {
|
|
4
|
+
const viewPort = currentElem.querySelector("[ref=eBodyViewport]");
|
|
5
|
+
if (viewPort) {
|
|
6
|
+
return viewPort.getBoundingClientRect().bottom;
|
|
7
|
+
}
|
|
8
|
+
currentElem = currentElem.parentElement;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { buildFieldMetadata } from '../../../../../utils/interfaces/AbstractFieldMetadata';
|
|
2
|
+
export const buildEditorMetadata = (descriptor, eGridCell, dataUnit, editionManager) => {
|
|
3
|
+
return Object.assign(Object.assign({}, buildFieldMetadata(descriptor)), { eGridCell, dataUnit, editionManager });
|
|
4
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/ComboBox.tpl.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { HTMLBuilder } from "@sankhyalabs/core";
|
|
2
|
+
import { getViewPortHeight } from '../GridEditorUtils';
|
|
3
|
+
const BOOLEAN_OPTIONS = new Map([[true, { value: "S", label: "Sim" }], [false, { value: "N", label: "Não" }]]);
|
|
4
|
+
export const buildComboBox = ({ required, props, eGridCell }) => {
|
|
5
|
+
const prop = props === null || props === void 0 ? void 0 : props.options;
|
|
6
|
+
let options;
|
|
7
|
+
if (typeof prop === "string") {
|
|
8
|
+
const parsed = JSON.parse(prop);
|
|
9
|
+
options = Object.keys(parsed).map(key => { return { value: key, label: parsed[key] }; });
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
options = prop;
|
|
13
|
+
}
|
|
14
|
+
const combo = HTMLBuilder.parseElement(`<ez-combo-box
|
|
15
|
+
class="grid_editor"
|
|
16
|
+
suppress-empty-option=${required}
|
|
17
|
+
mode="slim"
|
|
18
|
+
/>`);
|
|
19
|
+
combo.options = options;
|
|
20
|
+
combo.listOptionsPosition = { verticalPosition: 29, bottomLimit: getViewPortHeight(eGridCell), hardPosition: true };
|
|
21
|
+
return combo;
|
|
22
|
+
};
|
|
23
|
+
export const buildSwitch = (fieldMetadata) => {
|
|
24
|
+
const combo = buildComboBox(Object.assign(Object.assign({}, fieldMetadata), { props: Object.assign(Object.assign({}, fieldMetadata.props), { options: Array.from(BOOLEAN_OPTIONS.values()) }) }));
|
|
25
|
+
combo.valueGetter = () => {
|
|
26
|
+
const value = combo.value;
|
|
27
|
+
if (value == undefined) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
return value.value == "S";
|
|
31
|
+
};
|
|
32
|
+
combo.valueSetter = (value) => {
|
|
33
|
+
if (value != undefined) {
|
|
34
|
+
combo.value = BOOLEAN_OPTIONS.get(value);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
return combo;
|
|
38
|
+
};
|
package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/DateInput.tpl.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { HTMLBuilder } from "@sankhyalabs/core";
|
|
2
|
+
const LIMIT_TIME_VALUE = 2359;
|
|
3
|
+
export const buildDate = () => {
|
|
4
|
+
const dateInput = HTMLBuilder.parseElement(`<ez-date-input
|
|
5
|
+
class="ez-grid grid_editor"
|
|
6
|
+
mode="slim"
|
|
7
|
+
data-is-fixed="true"
|
|
8
|
+
/>`);
|
|
9
|
+
dateInput.valueGetter = () => dateInput.getValueAsync();
|
|
10
|
+
return dateInput;
|
|
11
|
+
};
|
|
12
|
+
export const buildTime = ({ readOnly }) => {
|
|
13
|
+
const timeInputElement = HTMLBuilder.parseElement(`<ez-time-input
|
|
14
|
+
class="ez-grid grid_editor"
|
|
15
|
+
enabled=${!readOnly}
|
|
16
|
+
mode="slim"
|
|
17
|
+
/>`);
|
|
18
|
+
timeInputElement.valueGetter = () => {
|
|
19
|
+
const value = timeInputElement.value;
|
|
20
|
+
const isAllowedTime = parseInt(value) <= LIMIT_TIME_VALUE;
|
|
21
|
+
return isAllowedTime ? value : null;
|
|
22
|
+
};
|
|
23
|
+
timeInputElement.valueSetter = (value) => {
|
|
24
|
+
const isAllowedTime = parseInt(value) <= LIMIT_TIME_VALUE;
|
|
25
|
+
if (!isAllowedTime)
|
|
26
|
+
return timeInputElement.value = null;
|
|
27
|
+
return timeInputElement.value = value;
|
|
28
|
+
};
|
|
29
|
+
return timeInputElement;
|
|
30
|
+
};
|
|
31
|
+
export const buildDateTime = ({ readOnly }) => {
|
|
32
|
+
const dateTimeInput = HTMLBuilder.parseElement(`<ez-date-time-input
|
|
33
|
+
class="ez-grid grid_editor"
|
|
34
|
+
mode="slim"
|
|
35
|
+
enabled=${!readOnly}
|
|
36
|
+
data-is-fixed="true"
|
|
37
|
+
/>`);
|
|
38
|
+
dateTimeInput.valueGetter = () => dateTimeInput.getValueAsync();
|
|
39
|
+
return dateTimeInput;
|
|
40
|
+
};
|
package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/NumberInput.tpl.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { HTMLBuilder } from "@sankhyalabs/core";
|
|
2
|
+
export const buildDecimal = ({ readOnly, props }) => {
|
|
3
|
+
const precision = Number((props === null || props === void 0 ? void 0 : props.precision) || 2);
|
|
4
|
+
const prettyPrecision = Number((props === null || props === void 0 ? void 0 : props.prettyPrecision) || precision);
|
|
5
|
+
return buildNumeric(readOnly, precision, prettyPrecision);
|
|
6
|
+
};
|
|
7
|
+
export const buildInteger = ({ readOnly }) => {
|
|
8
|
+
return buildNumeric(readOnly, 0, 0);
|
|
9
|
+
};
|
|
10
|
+
function buildNumeric(readOnly, precision, prettyPrecision) {
|
|
11
|
+
const input = HTMLBuilder.parseElement(`<ez-number-input
|
|
12
|
+
class="ez-grid grid_editor"
|
|
13
|
+
enabled=${!readOnly}
|
|
14
|
+
precision=${precision}
|
|
15
|
+
pretty-precision=${prettyPrecision}
|
|
16
|
+
mode="slim"
|
|
17
|
+
/>`);
|
|
18
|
+
input.valueGetter = () => input.getValueAsync();
|
|
19
|
+
return input;
|
|
20
|
+
}
|