@zeedhi/common 3.0.0 → 3.0.1
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/coverage/clover.xml +2570 -1531
- package/coverage/coverage-final.json +171 -158
- package/coverage/lcov-report/block-navigation.js +1 -1
- package/coverage/lcov-report/index.html +194 -44
- package/coverage/lcov-report/sorter.js +21 -7
- package/coverage/lcov-report/src/components/index.html +5 -5
- package/coverage/lcov-report/src/components/index.ts.html +244 -142
- package/coverage/lcov-report/src/components/tek-grid/columns-searcher.ts.html +2 -2
- package/coverage/lcov-report/src/components/tek-grid/dynamic-filter-datasource-factory.ts.html +3 -3
- package/coverage/lcov-report/src/components/tek-grid/filter-helper.ts.html +3 -3
- package/coverage/lcov-report/src/components/tek-grid/grid-filter-button.ts.html +6 -6
- package/coverage/lcov-report/src/components/tek-grid/grouped-data-manager.ts.html +6 -6
- package/coverage/lcov-report/src/components/tek-grid/grouped-data-selector.ts.html +3 -3
- package/coverage/lcov-report/src/components/tek-grid/grouped-view-navigator.ts.html +3 -3
- package/coverage/lcov-report/src/components/tek-grid/index.html +1 -1
- package/coverage/lcov-report/src/components/tek-grid/index.ts.html +19 -19
- package/coverage/lcov-report/src/components/tek-grid/interfaces.ts.html +3 -3
- package/coverage/lcov-report/src/components/tek-grid/keymap-grouped.ts.html +2 -2
- package/coverage/lcov-report/src/components/tek-grid/layout-options.ts.html +6 -6
- package/coverage/lcov-report/src/components/tek-grid/tek-datasource/index.html +1 -1
- package/coverage/lcov-report/src/components/tek-grid/tek-datasource/index.ts.html +4 -4
- package/coverage/lcov-report/src/components/tek-grid/tek-datasource/interfaces.ts.html +3 -3
- package/coverage/lcov-report/src/components/tek-grid/tek-datasource/tek-memory-datasource.ts.html +5 -5
- package/coverage/lcov-report/src/components/tek-grid/tek-datasource/tek-rest-datasource.ts.html +5 -5
- package/coverage/lcov-report/src/components/tek-grid/tek-grid-column.ts.html +4 -4
- package/coverage/lcov-report/src/components/tek-grid/tek-grid-columns-button/index.html +1 -1
- package/coverage/lcov-report/src/components/tek-grid/tek-grid-columns-button/tek-grid-columns-button-controller.ts.html +3 -3
- package/coverage/lcov-report/src/components/tek-grid/tek-grid-columns-button/tek-grid-columns-button.ts.html +6 -6
- package/coverage/lcov-report/src/components/tek-grid/tek-grid-controller.ts.html +2 -2
- package/coverage/lcov-report/src/components/tek-grid/tek-grid-events.ts.html +3 -3
- package/coverage/lcov-report/src/components/tek-grid/tek-grid-toolbar-provider/export-options/button-option.ts.html +2 -2
- package/coverage/lcov-report/src/components/tek-grid/tek-grid-toolbar-provider/export-options/index.html +1 -1
- package/coverage/lcov-report/src/components/tek-grid/tek-grid-toolbar-provider/export-options/index.ts.html +4 -4
- package/coverage/lcov-report/src/components/tek-grid/tek-grid-toolbar-provider/export-options/multi-option.ts.html +2 -2
- package/coverage/lcov-report/src/components/tek-grid/tek-grid-toolbar-provider/index.html +1 -1
- package/coverage/lcov-report/src/components/tek-grid/tek-grid-toolbar-provider/index.ts.html +3 -3
- package/coverage/lcov-report/src/components/tek-grid/tek-grid-toolbar-provider/tek-grid-toolbar-provider.ts.html +5 -5
- package/coverage/lcov-report/src/components/tek-grid/tek-grid.ts.html +22 -22
- package/coverage/lcov-report/src/components/zd-alert/alert.ts.html +3 -3
- package/coverage/lcov-report/src/components/zd-alert/index.html +1 -1
- package/coverage/lcov-report/src/components/zd-badge/badge.ts.html +3 -3
- package/coverage/lcov-report/src/components/zd-badge/index.html +1 -1
- package/coverage/lcov-report/src/components/zd-breadcrumbs/breadcrumbs.ts.html +3 -3
- package/coverage/lcov-report/src/components/zd-breadcrumbs/index.html +1 -1
- package/coverage/lcov-report/src/components/zd-button/button.ts.html +36 -36
- package/coverage/lcov-report/src/components/zd-button/index.html +1 -1
- package/coverage/lcov-report/src/components/zd-button-group/button-group.ts.html +113 -131
- package/coverage/lcov-report/src/components/zd-button-group/index.html +17 -17
- package/coverage/lcov-report/src/components/zd-card/card.ts.html +3 -3
- package/coverage/lcov-report/src/components/zd-card/index.html +1 -1
- package/coverage/lcov-report/src/components/zd-carousel/carousel.ts.html +3 -3
- package/coverage/lcov-report/src/components/zd-carousel/index.html +1 -1
- package/coverage/lcov-report/src/components/zd-checkbox/checkbox.ts.html +6 -6
- package/coverage/lcov-report/src/components/zd-checkbox/index.html +1 -1
- package/coverage/lcov-report/src/components/zd-checkbox-multiple/checkbox-multiple.ts.html +77 -122
- package/coverage/lcov-report/src/components/zd-checkbox-multiple/index.html +17 -17
- package/coverage/lcov-report/src/components/zd-chip/chip.ts.html +352 -0
- package/coverage/lcov-report/src/components/zd-chip/index.html +116 -0
- package/coverage/lcov-report/src/components/zd-code-viewer/code-viewer.ts.html +4 -4
- package/coverage/lcov-report/src/components/zd-code-viewer/index.html +1 -1
- package/coverage/lcov-report/src/components/zd-col/col.ts.html +3 -3
- package/coverage/lcov-report/src/components/zd-col/index.html +1 -1
- package/coverage/lcov-report/src/components/zd-collapse-card/collapse-card.ts.html +80 -68
- package/coverage/lcov-report/src/components/zd-collapse-card/index.html +1 -1
- package/coverage/lcov-report/src/components/zd-component/child-not-found.ts.html +2 -2
- package/coverage/lcov-report/src/components/zd-component/component-render.ts.html +5 -5
- package/coverage/lcov-report/src/components/zd-component/component.ts.html +117 -69
- package/coverage/lcov-report/src/components/zd-component/index.html +9 -9
- package/coverage/lcov-report/src/components/zd-container/container.ts.html +3 -3
- package/coverage/lcov-report/src/components/zd-container/index.html +1 -1
- package/coverage/lcov-report/src/components/zd-currency/currency.ts.html +259 -0
- package/coverage/lcov-report/src/components/zd-currency/index.html +116 -0
- package/coverage/lcov-report/src/components/zd-date-input/date-input.ts.html +113 -98
- package/coverage/lcov-report/src/components/zd-date-input/index.html +5 -5
- package/coverage/lcov-report/src/components/zd-date-range/date-range.ts.html +2059 -0
- package/coverage/lcov-report/src/components/zd-date-range/index.html +116 -0
- package/coverage/lcov-report/src/components/zd-dialog/dialog.ts.html +30 -30
- package/coverage/lcov-report/src/components/zd-dialog/index.html +1 -1
- package/coverage/lcov-report/src/components/zd-divider/divider.ts.html +3 -3
- package/coverage/lcov-report/src/components/zd-divider/index.html +1 -1
- package/coverage/lcov-report/src/components/zd-dropdown/dropdown.ts.html +3 -3
- package/coverage/lcov-report/src/components/zd-dropdown/index.html +1 -1
- package/coverage/lcov-report/src/components/zd-footer/footer.ts.html +3 -3
- package/coverage/lcov-report/src/components/zd-footer/index.html +1 -1
- package/coverage/lcov-report/src/components/zd-form/form.ts.html +288 -18
- package/coverage/lcov-report/src/components/zd-form/index.html +9 -9
- package/coverage/lcov-report/src/components/zd-frame/frame.ts.html +8 -8
- package/coverage/lcov-report/src/components/zd-frame/index.html +1 -1
- package/coverage/lcov-report/src/components/zd-frame-page/frame-page.ts.html +4 -4
- package/coverage/lcov-report/src/components/zd-frame-page/index.html +1 -1
- package/coverage/lcov-report/src/components/zd-grid/data-navigator.ts.html +3 -3
- package/coverage/lcov-report/src/components/zd-grid/data-selector.ts.html +3 -3
- package/coverage/lcov-report/src/components/zd-grid/grid-column.ts.html +10 -10
- package/coverage/lcov-report/src/components/zd-grid/grid-events.ts.html +4 -4
- package/coverage/lcov-report/src/components/zd-grid/grid.ts.html +84 -84
- package/coverage/lcov-report/src/components/zd-grid/index.html +1 -1
- package/coverage/lcov-report/src/components/zd-grid/index.ts.html +12 -12
- package/coverage/lcov-report/src/components/zd-grid/iterable-table.ts.html +6 -6
- package/coverage/lcov-report/src/components/zd-grid/keymap-merger.ts.html +14 -14
- package/coverage/lcov-report/src/components/zd-grid/keymap-navigation.ts.html +3 -3
- package/coverage/lcov-report/src/components/zd-grid/table-action-builder.ts.html +5 -5
- package/coverage/lcov-report/src/components/zd-grid/view-navigator.ts.html +3 -3
- package/coverage/lcov-report/src/components/zd-grid-editable/data-editor-with-add.ts.html +6 -6
- package/coverage/lcov-report/src/components/zd-grid-editable/data-editor.ts.html +7 -7
- package/coverage/lcov-report/src/components/zd-grid-editable/errors/index.html +1 -1
- package/coverage/lcov-report/src/components/zd-grid-editable/errors/index.ts.html +3 -3
- package/coverage/lcov-report/src/components/zd-grid-editable/errors/not-editing.ts.html +2 -2
- package/coverage/lcov-report/src/components/zd-grid-editable/errors/row-not-found.ts.html +2 -2
- package/coverage/lcov-report/src/components/zd-grid-editable/grid-column-editable.ts.html +3 -3
- package/coverage/lcov-report/src/components/zd-grid-editable/grid-editable-controller.ts.html +2 -2
- package/coverage/lcov-report/src/components/zd-grid-editable/grid-editable-events.ts.html +2 -2
- package/coverage/lcov-report/src/components/zd-grid-editable/grid-editable.ts.html +9 -9
- package/coverage/lcov-report/src/components/zd-grid-editable/index.html +1 -1
- package/coverage/lcov-report/src/components/zd-grid-editable/index.ts.html +8 -8
- package/coverage/lcov-report/src/components/zd-grid-editable/keymap-editing.ts.html +2 -2
- package/coverage/lcov-report/src/components/zd-header/header.ts.html +3 -3
- package/coverage/lcov-report/src/components/zd-header/index.html +1 -1
- package/coverage/lcov-report/src/components/zd-icon/icon.ts.html +3 -3
- package/coverage/lcov-report/src/components/zd-icon/index.html +1 -1
- package/coverage/lcov-report/src/components/zd-image/image.ts.html +3 -3
- package/coverage/lcov-report/src/components/zd-image/index.html +1 -1
- package/coverage/lcov-report/src/components/zd-increment/increment.ts.html +436 -0
- package/coverage/lcov-report/src/components/zd-increment/index.html +116 -0
- package/coverage/lcov-report/src/components/zd-input/index.html +5 -5
- package/coverage/lcov-report/src/components/zd-input/input-factory.ts.html +4 -4
- package/coverage/lcov-report/src/components/zd-input/input.ts.html +73 -61
- package/coverage/lcov-report/src/components/zd-iterable/column-not-found.ts.html +2 -2
- package/coverage/lcov-report/src/components/zd-iterable/column.ts.html +6 -6
- package/coverage/lcov-report/src/components/zd-iterable/conditions-manager.ts.html +9 -9
- package/coverage/lcov-report/src/components/zd-iterable/index.html +1 -1
- package/coverage/lcov-report/src/components/zd-iterable/iterable-columns-button-controller.ts.html +2 -2
- package/coverage/lcov-report/src/components/zd-iterable/iterable-columns-button.ts.html +6 -6
- package/coverage/lcov-report/src/components/zd-iterable/iterable-controller.ts.html +4 -4
- package/coverage/lcov-report/src/components/zd-iterable/iterable-page-component.ts.html +5 -5
- package/coverage/lcov-report/src/components/zd-iterable/iterable-page-info.ts.html +3 -3
- package/coverage/lcov-report/src/components/zd-iterable/iterable-page-size.ts.html +5 -5
- package/coverage/lcov-report/src/components/zd-iterable/iterable-pagination.ts.html +3 -3
- package/coverage/lcov-report/src/components/zd-iterable/iterable.ts.html +29 -29
- package/coverage/lcov-report/src/components/zd-iterable/search.ts.html +8 -8
- package/coverage/lcov-report/src/components/zd-iterable-component-render/index.html +1 -1
- package/coverage/lcov-report/src/components/zd-iterable-component-render/iterable-component-render.ts.html +5 -5
- package/coverage/lcov-report/src/components/zd-layout/index.html +1 -1
- package/coverage/lcov-report/src/components/zd-layout/layout.ts.html +3 -3
- package/coverage/lcov-report/src/components/zd-list/index.html +1 -1
- package/coverage/lcov-report/src/components/zd-list/item-not-found.ts.html +2 -2
- package/coverage/lcov-report/src/components/zd-list/list-group.ts.html +4 -4
- package/coverage/lcov-report/src/components/zd-list/list-item.ts.html +3 -3
- package/coverage/lcov-report/src/components/zd-list/list.ts.html +4 -4
- package/coverage/lcov-report/src/components/zd-loading/index.html +1 -1
- package/coverage/lcov-report/src/components/zd-loading/loading.ts.html +3 -3
- package/coverage/lcov-report/src/components/zd-login/index.html +1 -1
- package/coverage/lcov-report/src/components/zd-login/login-button.ts.html +4 -4
- package/coverage/lcov-report/src/components/zd-login/login.ts.html +3 -3
- package/coverage/lcov-report/src/components/zd-main/index.html +1 -1
- package/coverage/lcov-report/src/components/zd-main/main.ts.html +3 -3
- package/coverage/lcov-report/src/components/zd-master-detail/detail-not-found.ts.html +118 -0
- package/coverage/lcov-report/src/components/zd-master-detail/index.html +146 -0
- package/coverage/lcov-report/src/components/zd-master-detail/master-detail.ts.html +331 -0
- package/coverage/lcov-report/src/components/zd-master-detail/master-not-found.ts.html +118 -0
- package/coverage/lcov-report/src/components/zd-menu/index.html +1 -1
- package/coverage/lcov-report/src/components/zd-menu/menu-button.ts.html +4 -4
- package/coverage/lcov-report/src/components/zd-menu/menu-group.ts.html +3 -3
- package/coverage/lcov-report/src/components/zd-menu/menu-link.ts.html +3 -3
- package/coverage/lcov-report/src/components/zd-menu/menu-separator.ts.html +3 -3
- package/coverage/lcov-report/src/components/zd-menu/menu.ts.html +4 -4
- package/coverage/lcov-report/src/components/zd-modal/index.html +1 -1
- package/coverage/lcov-report/src/components/zd-modal/modal-close-button.ts.html +4 -4
- package/coverage/lcov-report/src/components/zd-modal/modal.ts.html +5 -5
- package/coverage/lcov-report/src/components/zd-month/index.html +116 -0
- package/coverage/lcov-report/src/components/zd-month/month.ts.html +568 -0
- package/coverage/lcov-report/src/components/zd-number-input/index.html +1 -1
- package/coverage/lcov-report/src/components/zd-number-input/number-input.ts.html +27 -27
- package/coverage/lcov-report/src/components/zd-password/index.html +1 -1
- package/coverage/lcov-report/src/components/zd-password/password.ts.html +7 -7
- package/coverage/lcov-report/src/components/zd-progress/index.html +116 -0
- package/coverage/lcov-report/src/components/zd-progress/progress.ts.html +262 -0
- package/coverage/lcov-report/src/components/zd-radio/index.html +1 -1
- package/coverage/lcov-report/src/components/zd-radio/radio.ts.html +6 -6
- package/coverage/lcov-report/src/components/zd-row/index.html +1 -1
- package/coverage/lcov-report/src/components/zd-row/row.ts.html +3 -3
- package/coverage/lcov-report/src/components/zd-select/index.html +1 -1
- package/coverage/lcov-report/src/components/zd-select/select.ts.html +9 -9
- package/coverage/lcov-report/src/components/zd-select-multiple/index.html +1 -1
- package/coverage/lcov-report/src/components/zd-select-multiple/select-multiple.ts.html +5 -5
- package/coverage/lcov-report/src/components/zd-svg-map/index.html +116 -0
- package/coverage/lcov-report/src/components/zd-svg-map/svg-map.ts.html +475 -0
- package/coverage/lcov-report/src/components/zd-switch/index.html +1 -1
- package/coverage/lcov-report/src/components/zd-switch/switch.ts.html +5 -5
- package/coverage/lcov-report/src/components/zd-table/index.html +1 -1
- package/coverage/lcov-report/src/components/zd-table/table.ts.html +4 -4
- package/coverage/lcov-report/src/components/zd-tabs/index.html +1 -1
- package/coverage/lcov-report/src/components/zd-tabs/tab-not-found.ts.html +2 -2
- package/coverage/lcov-report/src/components/zd-tabs/tab.ts.html +5 -5
- package/coverage/lcov-report/src/components/zd-tabs/tabs.ts.html +7 -7
- package/coverage/lcov-report/src/components/zd-tag/index.html +1 -1
- package/coverage/lcov-report/src/components/zd-tag/tag.ts.html +3 -3
- package/coverage/lcov-report/src/components/zd-text/index.html +1 -1
- package/coverage/lcov-report/src/components/zd-text/text.ts.html +3 -3
- package/coverage/lcov-report/src/components/zd-text-input/index.html +1 -1
- package/coverage/lcov-report/src/components/zd-text-input/text-input.ts.html +22 -22
- package/coverage/lcov-report/src/components/zd-textarea/index.html +1 -1
- package/coverage/lcov-report/src/components/zd-textarea/textarea.ts.html +5 -5
- package/coverage/lcov-report/src/components/zd-time/index.html +131 -0
- package/coverage/lcov-report/src/components/zd-time/time-format-selector.ts.html +157 -0
- package/coverage/lcov-report/src/components/zd-time/time.ts.html +1669 -0
- package/coverage/lcov-report/src/components/zd-toggleable/index.html +1 -1
- package/coverage/lcov-report/src/components/zd-toggleable/toggleable.ts.html +3 -3
- package/coverage/lcov-report/src/components/zd-tooltip/index.html +1 -1
- package/coverage/lcov-report/src/components/zd-tooltip/tooltip.ts.html +3 -3
- package/coverage/lcov-report/src/components/zd-tree/index.html +116 -0
- package/coverage/lcov-report/src/components/zd-tree/tree.ts.html +1849 -0
- package/coverage/lcov-report/src/components/zd-tree-grid/index.html +1 -1
- package/coverage/lcov-report/src/components/zd-tree-grid/index.ts.html +7 -7
- package/coverage/lcov-report/src/components/zd-tree-grid/iterable-tree.ts.html +9 -9
- package/coverage/lcov-report/src/components/zd-tree-grid/keymap-tree.ts.html +3 -3
- package/coverage/lcov-report/src/components/zd-tree-grid/tree-data-navigator.ts.html +5 -5
- package/coverage/lcov-report/src/components/zd-tree-grid/tree-data-selector.ts.html +5 -5
- package/coverage/lcov-report/src/components/zd-tree-grid/tree-grid.ts.html +108 -108
- package/coverage/lcov-report/src/error/delete-rows.ts.html +3 -3
- package/coverage/lcov-report/src/error/index.html +1 -1
- package/coverage/lcov-report/src/error/non-initialized.ts.html +3 -3
- package/coverage/lcov-report/src/error/tek-grid-delete-rows.ts.html +3 -3
- package/coverage/lcov-report/src/error/teknisa-common-error.ts.html +2 -2
- package/coverage/lcov-report/src/error/zeedhi-error.ts.html +3 -3
- package/coverage/lcov-report/src/index.html +1 -1
- package/coverage/lcov-report/src/index.ts.html +9 -27
- package/coverage/lcov-report/src/services/index.html +1 -1
- package/coverage/lcov-report/src/services/index.ts.html +5 -5
- package/coverage/lcov-report/src/services/zd-alert/alert-queue.ts.html +3 -3
- package/coverage/lcov-report/src/services/zd-alert/alert-replace.ts.html +3 -3
- package/coverage/lcov-report/src/services/zd-alert/alert-service.ts.html +5 -5
- package/coverage/lcov-report/src/services/zd-alert/alert-stack.ts.html +3 -3
- package/coverage/lcov-report/src/services/zd-alert/index.html +1 -1
- package/coverage/lcov-report/src/services/zd-alert/index.ts.html +6 -6
- package/coverage/lcov-report/src/services/zd-dialog/dialog-service.ts.html +4 -4
- package/coverage/lcov-report/src/services/zd-dialog/index.html +1 -1
- package/coverage/lcov-report/src/services/zd-loading/index.html +1 -1
- package/coverage/lcov-report/src/services/zd-loading/loading-service.ts.html +2 -2
- package/coverage/lcov-report/src/services/zd-modal/index.html +1 -1
- package/coverage/lcov-report/src/services/zd-modal/modal-service.ts.html +5 -5
- package/coverage/lcov-report/src/utils/data-value-out/data-value-out.ts.html +3 -3
- package/coverage/lcov-report/src/utils/data-value-out/index.html +1 -1
- package/coverage/lcov-report/src/utils/data-value-out/index.ts.html +3 -3
- package/coverage/lcov-report/src/utils/datasource-searcher/datasource-searcher.ts.html +3 -3
- package/coverage/lcov-report/src/utils/datasource-searcher/index.html +1 -1
- package/coverage/lcov-report/src/utils/datasource-searcher/index.ts.html +3 -3
- package/coverage/lcov-report/src/utils/icons/icons.ts.html +6 -6
- package/coverage/lcov-report/src/utils/icons/index.html +1 -1
- package/coverage/lcov-report/src/utils/index.html +1 -1
- package/coverage/lcov-report/src/utils/index.ts.html +11 -11
- package/coverage/lcov-report/src/utils/is-filled-object/index.html +1 -1
- package/coverage/lcov-report/src/utils/is-filled-object/is-filled-object.ts.html +3 -3
- package/coverage/lcov-report/src/utils/is-nil.ts.html +2 -2
- package/coverage/lcov-report/src/utils/omit/index.html +1 -1
- package/coverage/lcov-report/src/utils/omit/omit.ts.html +2 -2
- package/coverage/lcov-report/src/utils/theme/index.html +1 -1
- package/coverage/lcov-report/src/utils/theme/theme.ts.html +4 -4
- package/coverage/lcov-report/src/utils/tree-data-structure/index.html +7 -7
- package/coverage/lcov-report/src/utils/tree-data-structure/index.ts.html +3 -3
- package/coverage/lcov-report/src/utils/tree-data-structure/tree-data-structure.ts.html +90 -87
- package/coverage/lcov-report/src/utils/unique-by/index.html +1 -1
- package/coverage/lcov-report/src/utils/unique-by/unique-by.ts.html +3 -3
- package/coverage/lcov-report/tests/unit/components/zd-component/ComponentMock.ts.html +1 -1
- package/coverage/lcov-report/tests/unit/components/zd-component/index.html +1 -1
- package/coverage/lcov.info +3991 -2050
- package/dist/types/components/index.d.ts +2 -0
- package/dist/types/components/zd-date-range/date-range.d.ts +152 -0
- package/dist/types/components/zd-date-range/interfaces.d.ts +18 -0
- package/dist/types/components/zd-form/form.d.ts +15 -0
- package/dist/types/components/zd-form/interfaces.d.ts +3 -0
- package/dist/types/components/zd-input/input.d.ts +2 -0
- package/dist/types/components/zd-input/interfaces.d.ts +2 -0
- package/dist/types/components/zd-time/interfaces.d.ts +1 -1
- package/dist/types/components/zd-time/time.d.ts +6 -6
- package/dist/zd-common.js +632 -22
- package/dist/zd-common.min.js +632 -22
- package/package.json +3 -3
- package/src/components/index.ts +7 -5
- package/src/components/zd-date-range/date-range.ts +658 -0
- package/src/components/zd-date-range/interfaces.ts +19 -0
- package/src/components/zd-form/form.ts +91 -1
- package/src/components/zd-form/interfaces.ts +3 -0
- package/src/components/zd-input/input.ts +4 -0
- package/src/components/zd-input/interfaces.ts +2 -0
- package/src/components/zd-time/interfaces.ts +16 -16
- package/src/components/zd-time/time-format-selector.ts +13 -13
- package/src/components/zd-time/time.ts +510 -488
- package/src/index.ts +0 -6
- package/tests/unit/components/zd-date-range/date-range.spec.ts +1125 -0
- package/tests/unit/components/zd-form/form.spec.ts +30 -0
- package/tests/unit/components/zd-menu/menu-button.spec.ts +1 -1
package/dist/zd-common.js
CHANGED
|
@@ -1641,13 +1641,86 @@ class Form extends ComponentRender {
|
|
|
1641
1641
|
get childrenProps() {
|
|
1642
1642
|
return this.children.map(({ grid, ...otherAttrs }) => otherAttrs);
|
|
1643
1643
|
}
|
|
1644
|
+
/**
|
|
1645
|
+
* Checks if the value matches a col value (1, 2, ... 12) or auto
|
|
1646
|
+
*/
|
|
1647
|
+
matchColumn = (value) => (!Number.isNaN(Number(value)) || value === 'auto');
|
|
1648
|
+
breakpoints = ['lg', 'md', 'sm', 'xl', 'xxl'];
|
|
1649
|
+
matchBreakpoint = (value) => (this.breakpoints.includes(value));
|
|
1650
|
+
handleColClass(cssClass) {
|
|
1651
|
+
const dataString = cssClass.replace('zd-col-', '');
|
|
1652
|
+
const splittedData = dataString.split('-');
|
|
1653
|
+
const firstData = splittedData[0];
|
|
1654
|
+
const secondData = splittedData[1];
|
|
1655
|
+
// in this case the class is zd-col-{n} or zd-col-auto
|
|
1656
|
+
if (this.matchColumn(firstData)) {
|
|
1657
|
+
return { key: 'cols', value: firstData };
|
|
1658
|
+
}
|
|
1659
|
+
const matchWithBreakpoints = this.matchBreakpoint(firstData) && this.matchColumn(secondData);
|
|
1660
|
+
if (!matchWithBreakpoints)
|
|
1661
|
+
return null;
|
|
1662
|
+
// in this case the class is zd-col-{breakpoint}-{n} or zd-col-{breakpoint}-auto
|
|
1663
|
+
return { key: firstData, value: secondData };
|
|
1664
|
+
}
|
|
1665
|
+
handleOffsetClass(cssClass) {
|
|
1666
|
+
const dataString = cssClass.replace('zd-offset-', '');
|
|
1667
|
+
const splittedData = dataString.split('-');
|
|
1668
|
+
const firstData = splittedData[0];
|
|
1669
|
+
const secondData = splittedData[1];
|
|
1670
|
+
// in this case the class is zd-offset-{n} or zd-offset-auto
|
|
1671
|
+
if (this.matchColumn(firstData)) {
|
|
1672
|
+
return { key: 'offset', value: firstData };
|
|
1673
|
+
}
|
|
1674
|
+
const matchWithBreakpoints = this.matchBreakpoint(firstData) && this.matchColumn(secondData);
|
|
1675
|
+
if (!matchWithBreakpoints)
|
|
1676
|
+
return null;
|
|
1677
|
+
// in this case the class is zd-offset-{breakpoint}-{n} or zd-offset-{breakpoint}-auto
|
|
1678
|
+
return { key: `offset-${firstData}`, value: secondData };
|
|
1679
|
+
}
|
|
1680
|
+
/**
|
|
1681
|
+
* This method searches in a css class string to find classes related to grid cols \
|
|
1682
|
+
* Parses all of the grid cols classes found to form grid object entries, for example
|
|
1683
|
+
* the following class: 'zd-col-sm-12 zd-col-md-6' will become { sm: '12', md: '6' }
|
|
1684
|
+
*/
|
|
1685
|
+
parseGridClasses(classes) {
|
|
1686
|
+
const classesArray = classes.split(' ');
|
|
1687
|
+
const gridObject = {};
|
|
1688
|
+
classesArray.forEach((cssClass) => {
|
|
1689
|
+
if (cssClass.startsWith('zd-col-')) {
|
|
1690
|
+
const result = this.handleColClass(cssClass);
|
|
1691
|
+
if (!result)
|
|
1692
|
+
return;
|
|
1693
|
+
const { key, value } = result;
|
|
1694
|
+
gridObject[key] = value;
|
|
1695
|
+
return;
|
|
1696
|
+
}
|
|
1697
|
+
if (cssClass.startsWith('zd-offset-')) {
|
|
1698
|
+
const result = this.handleOffsetClass(cssClass);
|
|
1699
|
+
if (!result)
|
|
1700
|
+
return;
|
|
1701
|
+
const { key, value } = result;
|
|
1702
|
+
gridObject[key] = value;
|
|
1703
|
+
return;
|
|
1704
|
+
}
|
|
1705
|
+
return;
|
|
1706
|
+
});
|
|
1707
|
+
return gridObject;
|
|
1708
|
+
}
|
|
1709
|
+
getChildGrid(child) {
|
|
1710
|
+
if (child.grid && Object.keys(child.grid).length > 0)
|
|
1711
|
+
return child.grid;
|
|
1712
|
+
if (child.cssClass)
|
|
1713
|
+
return this.parseGridClasses(child.cssClass);
|
|
1714
|
+
return {};
|
|
1715
|
+
}
|
|
1644
1716
|
/**
|
|
1645
1717
|
* Grid system for each child.
|
|
1646
1718
|
*/
|
|
1647
1719
|
get childrenGrid() {
|
|
1648
1720
|
const childrenGrid = {};
|
|
1649
1721
|
this.children.forEach((child) => {
|
|
1650
|
-
|
|
1722
|
+
const grid = this.getChildGrid(child);
|
|
1723
|
+
childrenGrid[child.name] = { cols: '3', ...grid };
|
|
1651
1724
|
});
|
|
1652
1725
|
return childrenGrid;
|
|
1653
1726
|
}
|
|
@@ -1814,6 +1887,7 @@ class Input extends ComponentRender {
|
|
|
1814
1887
|
internalDisplayValue = '';
|
|
1815
1888
|
internalValue = null;
|
|
1816
1889
|
formParent = this.getFormParent();
|
|
1890
|
+
grid = {};
|
|
1817
1891
|
/* istanbul ignore next */
|
|
1818
1892
|
/**
|
|
1819
1893
|
* Creates a new Input.
|
|
@@ -1843,6 +1917,7 @@ class Input extends ComponentRender {
|
|
|
1843
1917
|
this.storePath = this.getInitValue('storePath', props.storePath, this.storePath);
|
|
1844
1918
|
this.value = this.getInitValue('value', props.value, this.value);
|
|
1845
1919
|
this.validations = this.getInitValue('validations', props.validations, this.validations);
|
|
1920
|
+
this.grid = this.getInitValue('grid', props.grid, this.grid);
|
|
1846
1921
|
this.parseValidations(props.validations || {});
|
|
1847
1922
|
}
|
|
1848
1923
|
onCreated() {
|
|
@@ -15480,8 +15555,12 @@ class Time extends TextInput {
|
|
|
15480
15555
|
}
|
|
15481
15556
|
return this.mask;
|
|
15482
15557
|
}
|
|
15483
|
-
formatter(value) {
|
|
15484
|
-
|
|
15558
|
+
formatter(value) {
|
|
15559
|
+
return this.formatterFn(value, this);
|
|
15560
|
+
}
|
|
15561
|
+
parser(value) {
|
|
15562
|
+
return this.parserFn(value, this);
|
|
15563
|
+
}
|
|
15485
15564
|
/**
|
|
15486
15565
|
* Triggered when date is clicked.
|
|
15487
15566
|
* @param event
|
|
@@ -15490,7 +15569,10 @@ class Time extends TextInput {
|
|
|
15490
15569
|
selectTime(time, event, element) {
|
|
15491
15570
|
if (this.events.onSelectTime && typeof this.events.onSelectTime === 'function') {
|
|
15492
15571
|
this.events.onSelectTime({
|
|
15493
|
-
time,
|
|
15572
|
+
time,
|
|
15573
|
+
event,
|
|
15574
|
+
element,
|
|
15575
|
+
component: this,
|
|
15494
15576
|
});
|
|
15495
15577
|
}
|
|
15496
15578
|
}
|
|
@@ -15569,11 +15651,11 @@ class Time extends TextInput {
|
|
|
15569
15651
|
return null;
|
|
15570
15652
|
}
|
|
15571
15653
|
/**
|
|
15572
|
-
|
|
15573
|
-
|
|
15574
|
-
|
|
15575
|
-
|
|
15576
|
-
|
|
15654
|
+
* Checks if a time format is simple.
|
|
15655
|
+
* Simple time formats are the ones that consists only of 'HH', 'mm', 'mm' or 'YYYY', and mask delimiters
|
|
15656
|
+
* @param format The format to be checked
|
|
15657
|
+
* @returns true if it is simple, false otherwise
|
|
15658
|
+
*/
|
|
15577
15659
|
isSimpleFormat(format) {
|
|
15578
15660
|
const simpleTokens = ['HH', 'mm', 'ss', 'hh', 'A', 'a', 'p', 'P'];
|
|
15579
15661
|
// remove the simple tokens from the string
|
|
@@ -15588,10 +15670,9 @@ class Time extends TextInput {
|
|
|
15588
15670
|
return I18n.translate('VALIDATION_INVALID_TIME');
|
|
15589
15671
|
}
|
|
15590
15672
|
timeAllowedValidation() {
|
|
15591
|
-
return !this.displayValue
|
|
15592
|
-
|
|
15593
|
-
|
|
15594
|
-
|| I18n.translate('VALIDATION_TIME_NOT_ALLOWED');
|
|
15673
|
+
return (!this.displayValue ||
|
|
15674
|
+
(this.isValidTime(this.displayValue, this.displayFormat) && this.isTimeAllowed()) ||
|
|
15675
|
+
I18n.translate('VALIDATION_TIME_NOT_ALLOWED'));
|
|
15595
15676
|
}
|
|
15596
15677
|
click(event, element) {
|
|
15597
15678
|
const clickEvent = event || new MouseEvent('click');
|
|
@@ -15622,8 +15703,10 @@ class Time extends TextInput {
|
|
|
15622
15703
|
* Removes the component mask if value is valid
|
|
15623
15704
|
*/
|
|
15624
15705
|
removeTimeMask() {
|
|
15625
|
-
if (isUndefined(this.initialMask) ||
|
|
15626
|
-
|
|
15706
|
+
if (isUndefined(this.initialMask) ||
|
|
15707
|
+
!this.value ||
|
|
15708
|
+
this.timeError ||
|
|
15709
|
+
!this.isValidTime(this.value, this.valueFormat)) {
|
|
15627
15710
|
return;
|
|
15628
15711
|
}
|
|
15629
15712
|
this.mask = '';
|
|
@@ -15640,9 +15723,11 @@ class Time extends TextInput {
|
|
|
15640
15723
|
*/
|
|
15641
15724
|
// private lastInvalid: string = '';
|
|
15642
15725
|
isTimeAllowed(value = this.value) {
|
|
15643
|
-
return this.isSameOrAfterMin(value) &&
|
|
15644
|
-
|
|
15645
|
-
|
|
15726
|
+
return (this.isSameOrAfterMin(value) &&
|
|
15727
|
+
this.isSameOrBeforeMax(value) &&
|
|
15728
|
+
this.isHourAllowed(value) &&
|
|
15729
|
+
this.isMinuteAllowed(value) &&
|
|
15730
|
+
this.isSecondAllowed(value));
|
|
15646
15731
|
}
|
|
15647
15732
|
isSameOrAfterMin(value) {
|
|
15648
15733
|
if (!this.minTime)
|
|
@@ -15751,7 +15836,534 @@ FormatterParserProvider.registerParser('ZdTime', (value, { displayFormat = Confi
|
|
|
15751
15836
|
});
|
|
15752
15837
|
InputFactory.register('ZdTime', Time);
|
|
15753
15838
|
|
|
15754
|
-
|
|
15839
|
+
class DateRange extends TextInput {
|
|
15840
|
+
/**
|
|
15841
|
+
* Input auto complete.
|
|
15842
|
+
*/
|
|
15843
|
+
autocomplete = false;
|
|
15844
|
+
/**
|
|
15845
|
+
* Defines the date format.
|
|
15846
|
+
*/
|
|
15847
|
+
dateFormat = Config.dateFormat;
|
|
15848
|
+
/**
|
|
15849
|
+
* Defines the date format displayed.
|
|
15850
|
+
*/
|
|
15851
|
+
displayFormat = Config.displayFormat;
|
|
15852
|
+
/**
|
|
15853
|
+
* Defines the date input format.
|
|
15854
|
+
*/
|
|
15855
|
+
inputFormat = Config.dateInputFormat;
|
|
15856
|
+
/**
|
|
15857
|
+
* Shows the date picker.
|
|
15858
|
+
*/
|
|
15859
|
+
showDatePicker = false;
|
|
15860
|
+
/**
|
|
15861
|
+
* Sets the first day of the week, starting with 0 for Sunday.
|
|
15862
|
+
*/
|
|
15863
|
+
firstDayOfWeek = 0;
|
|
15864
|
+
/**
|
|
15865
|
+
* Forces 100% width.
|
|
15866
|
+
*/
|
|
15867
|
+
fullWidth = false;
|
|
15868
|
+
/**
|
|
15869
|
+
* Sets the locale. Accepts a string with a BCP 47 language tag.
|
|
15870
|
+
*/
|
|
15871
|
+
locale = I18n.instance.language;
|
|
15872
|
+
/**
|
|
15873
|
+
* Allows changing displayed month with mouse scroll
|
|
15874
|
+
*/
|
|
15875
|
+
scrollable = false;
|
|
15876
|
+
/**
|
|
15877
|
+
* Toggles visibility of the week numbers in the body of the calendar.
|
|
15878
|
+
*/
|
|
15879
|
+
showWeek = false;
|
|
15880
|
+
/**
|
|
15881
|
+
* Character that will separate the two dates
|
|
15882
|
+
*/
|
|
15883
|
+
get splitter() {
|
|
15884
|
+
return I18n.translate(this.internalSplitter);
|
|
15885
|
+
}
|
|
15886
|
+
set splitter(splitter) {
|
|
15887
|
+
this.internalSplitter = splitter;
|
|
15888
|
+
}
|
|
15889
|
+
internalSplitter = ' ~ ';
|
|
15890
|
+
/**
|
|
15891
|
+
* Width of the picker.
|
|
15892
|
+
*/
|
|
15893
|
+
width = 248;
|
|
15894
|
+
/**
|
|
15895
|
+
* Helper options.
|
|
15896
|
+
*/
|
|
15897
|
+
helperOptions = [];
|
|
15898
|
+
/**
|
|
15899
|
+
* Max value allowed.
|
|
15900
|
+
*/
|
|
15901
|
+
max = '';
|
|
15902
|
+
/**
|
|
15903
|
+
* Min value allowed.
|
|
15904
|
+
*/
|
|
15905
|
+
min = '';
|
|
15906
|
+
/**
|
|
15907
|
+
* Helper value.
|
|
15908
|
+
*/
|
|
15909
|
+
helperValue = '';
|
|
15910
|
+
isoFormat = 'YYYY-MM-DD';
|
|
15911
|
+
dateError = false;
|
|
15912
|
+
formatterFn = FormatterParserProvider.getFormatter('ZdDateRange');
|
|
15913
|
+
parserFn = FormatterParserProvider.getParser('ZdDateRange');
|
|
15914
|
+
initialMask;
|
|
15915
|
+
unitMask;
|
|
15916
|
+
isSimpleDisplay;
|
|
15917
|
+
/* istanbul ignore next */
|
|
15918
|
+
/**
|
|
15919
|
+
* Creates a new Date.
|
|
15920
|
+
* @param props Date properties
|
|
15921
|
+
*/
|
|
15922
|
+
constructor(props) {
|
|
15923
|
+
super(props);
|
|
15924
|
+
// Add this logic to resolve template strings
|
|
15925
|
+
if (typeof props.appendIcon === 'string' && props.appendIcon.startsWith('{{') && props.appendIcon.endsWith('}}')) {
|
|
15926
|
+
const match = props.appendIcon.match(/{{(.*?)}}/);
|
|
15927
|
+
if (match) {
|
|
15928
|
+
const path = match[1].trim().split('.');
|
|
15929
|
+
let value = window;
|
|
15930
|
+
for (const key of path) {
|
|
15931
|
+
value = value?.[key];
|
|
15932
|
+
}
|
|
15933
|
+
this.appendIcon = value ?? props.appendIcon;
|
|
15934
|
+
}
|
|
15935
|
+
else {
|
|
15936
|
+
this.appendIcon = props.appendIcon;
|
|
15937
|
+
}
|
|
15938
|
+
}
|
|
15939
|
+
else {
|
|
15940
|
+
this.appendIcon = this.getInitValue('appendIcon', props.appendIcon, 'calendar');
|
|
15941
|
+
}
|
|
15942
|
+
this.autocomplete = this.getInitValue('autocomplete', props.autocomplete, this.autocomplete);
|
|
15943
|
+
this.dateFormat = this.getInitValue('dateFormat', props.dateFormat, this.dateFormat);
|
|
15944
|
+
this.dateValidation = this.dateValidation.bind(this);
|
|
15945
|
+
this.displayFormat = this.getInitValue('displayFormat', props.displayFormat, this.displayFormat);
|
|
15946
|
+
this.inputFormat = this.getInitValue('inputFormat', props.inputFormat, this.inputFormat);
|
|
15947
|
+
this.firstDayOfWeek = this.getInitValue('firstDayOfWeek', props.firstDayOfWeek, this.firstDayOfWeek);
|
|
15948
|
+
this.fullWidth = this.getInitValue('fullWidth', props.fullWidth, this.fullWidth);
|
|
15949
|
+
this.locale = this.getInitValue('locale', props.locale, this.locale);
|
|
15950
|
+
this.scrollable = this.getInitValue('scrollable', props.scrollable, this.scrollable);
|
|
15951
|
+
this.showDatePicker = this.getInitValue('showDatePicker', props.showDatePicker, this.showDatePicker);
|
|
15952
|
+
this.showWeek = this.getInitValue('showWeek', props.showWeek, this.showWeek);
|
|
15953
|
+
this.splitter = this.getInitValue('splitter', props.splitter, this.internalSplitter);
|
|
15954
|
+
this.width = this.getInitValue('width', props.width, this.width);
|
|
15955
|
+
this.mask = this.getInitValue('mask', props.mask, undefined);
|
|
15956
|
+
this.helperOptions = this.getInitValue('helperOptions', props.helperOptions, this.helperOptions);
|
|
15957
|
+
this.helperValue = this.getInitValue('helperValue', props.helperValue, this.helperValue);
|
|
15958
|
+
this.min = this.getInitValue('min', props.min, this.min);
|
|
15959
|
+
this.max = this.getInitValue('max', props.max, this.max);
|
|
15960
|
+
this.rules.push(this.dateValidation);
|
|
15961
|
+
this.unitMask = this.mask;
|
|
15962
|
+
this.initialMask = this.getInitialMask();
|
|
15963
|
+
this.isSimpleDisplay = this.isSimpleFormat(this.displayFormat);
|
|
15964
|
+
const userAppendIconClick = this.events.appendIconClick;
|
|
15965
|
+
this.events.appendIconClick = ({ event, element, component }) => {
|
|
15966
|
+
this.iconClick(event, element);
|
|
15967
|
+
if (userAppendIconClick && typeof userAppendIconClick === 'function') {
|
|
15968
|
+
userAppendIconClick({ event, element, component });
|
|
15969
|
+
}
|
|
15970
|
+
};
|
|
15971
|
+
}
|
|
15972
|
+
getInitialMask() {
|
|
15973
|
+
if (isUndefined(this.mask)) {
|
|
15974
|
+
this.unitMask = this.inputFormat && this.maskFormat(this.inputFormat);
|
|
15975
|
+
}
|
|
15976
|
+
if (!this.unitMask) {
|
|
15977
|
+
this.mask = this.unitMask;
|
|
15978
|
+
return this.unitMask;
|
|
15979
|
+
}
|
|
15980
|
+
this.mask = `${this.unitMask}${this.splitter}${this.unitMask}`;
|
|
15981
|
+
return this.mask;
|
|
15982
|
+
}
|
|
15983
|
+
formatter(value) {
|
|
15984
|
+
return this.formatterFn(value, this);
|
|
15985
|
+
}
|
|
15986
|
+
parser(value) {
|
|
15987
|
+
return this.parserFn(value, this);
|
|
15988
|
+
}
|
|
15989
|
+
get displayValue() {
|
|
15990
|
+
return this.internalDisplayValue;
|
|
15991
|
+
}
|
|
15992
|
+
set displayValue(newValue) {
|
|
15993
|
+
this.dateError = false;
|
|
15994
|
+
this.internalDisplayValue = newValue;
|
|
15995
|
+
if (newValue)
|
|
15996
|
+
this.internalValue = this.parser(newValue);
|
|
15997
|
+
else
|
|
15998
|
+
this.internalValue = [];
|
|
15999
|
+
this.value = this.internalValue; // forces value accessor to be called if necessary
|
|
16000
|
+
}
|
|
16001
|
+
get value() {
|
|
16002
|
+
return this.internalValue;
|
|
16003
|
+
}
|
|
16004
|
+
set value(value) {
|
|
16005
|
+
if (this.internalValue !== value) {
|
|
16006
|
+
this.internalDisplayValue = this.formatter(value);
|
|
16007
|
+
this.internalValue = value;
|
|
16008
|
+
}
|
|
16009
|
+
if (value === null) {
|
|
16010
|
+
this.internalValue = [];
|
|
16011
|
+
}
|
|
16012
|
+
}
|
|
16013
|
+
/**
|
|
16014
|
+
* Assign the updated mask to mask property
|
|
16015
|
+
*/
|
|
16016
|
+
updateMask() {
|
|
16017
|
+
this.isSimpleDisplay = this.isSimpleFormat(this.displayFormat);
|
|
16018
|
+
this.mask = this.getUpdatedMask();
|
|
16019
|
+
return this.mask;
|
|
16020
|
+
}
|
|
16021
|
+
/**
|
|
16022
|
+
* Gets the updated masked, based on displayFormat if the initial mask is undefined
|
|
16023
|
+
*/
|
|
16024
|
+
getUpdatedMask() {
|
|
16025
|
+
if (isUndefined(this.getInitialMask())) {
|
|
16026
|
+
return this.maskFormat(`${this.displayFormat}${this.splitter}${this.displayFormat}`);
|
|
16027
|
+
}
|
|
16028
|
+
return this.mask;
|
|
16029
|
+
}
|
|
16030
|
+
maskFormat(format) {
|
|
16031
|
+
return format.replace(/[A-Za-z]/gi, '#');
|
|
16032
|
+
}
|
|
16033
|
+
setDateValue(displayValue) {
|
|
16034
|
+
const lastValue = this.displayValue;
|
|
16035
|
+
const values = this.splitValues(displayValue);
|
|
16036
|
+
if (this.isValidDateArray(this.displayFormat, values)) {
|
|
16037
|
+
this.internalDisplayValue = displayValue;
|
|
16038
|
+
this.internalValue = this.parser(displayValue);
|
|
16039
|
+
this.dateError = false;
|
|
16040
|
+
if (lastValue !== this.displayValue)
|
|
16041
|
+
this.change(this.value);
|
|
16042
|
+
}
|
|
16043
|
+
else {
|
|
16044
|
+
if (!displayValue) {
|
|
16045
|
+
this.internalDisplayValue = displayValue;
|
|
16046
|
+
this.internalValue = [];
|
|
16047
|
+
if (lastValue !== this.displayValue)
|
|
16048
|
+
this.change(this.value);
|
|
16049
|
+
}
|
|
16050
|
+
this.dateError = !!displayValue;
|
|
16051
|
+
}
|
|
16052
|
+
this.value = this.internalValue; // forces value accessor to be called if necessary
|
|
16053
|
+
}
|
|
16054
|
+
/**
|
|
16055
|
+
* Faz a validação do array de datas
|
|
16056
|
+
* @param format o formato da data
|
|
16057
|
+
* @param values o array de datas
|
|
16058
|
+
* @returns true se todos os valores forem validados
|
|
16059
|
+
* */
|
|
16060
|
+
isValidDateArray(format, values) {
|
|
16061
|
+
if (!values || values.length < 2)
|
|
16062
|
+
return false;
|
|
16063
|
+
return values.every((value) => this.isValidDate(value, format));
|
|
16064
|
+
}
|
|
16065
|
+
splitValues(value) {
|
|
16066
|
+
let splitedValue = [];
|
|
16067
|
+
if (!value)
|
|
16068
|
+
return splitedValue;
|
|
16069
|
+
if (value.indexOf(this.splitter) !== -1) {
|
|
16070
|
+
splitedValue = value.split(this.splitter);
|
|
16071
|
+
if (splitedValue[1] === '')
|
|
16072
|
+
return [splitedValue[0]];
|
|
16073
|
+
return splitedValue;
|
|
16074
|
+
}
|
|
16075
|
+
return [value];
|
|
16076
|
+
}
|
|
16077
|
+
isValidDate(value, format, strict = true) {
|
|
16078
|
+
const date = dayjs(value, format, strict);
|
|
16079
|
+
const isValidFormat = date.isValid();
|
|
16080
|
+
if (!isValidFormat)
|
|
16081
|
+
return false;
|
|
16082
|
+
const minDate = this.min ? dayjs(this.min, this.dateFormat) : null;
|
|
16083
|
+
const isValidMin = !minDate || date.isAfter(minDate) || date.isSame(minDate);
|
|
16084
|
+
if (!isValidMin)
|
|
16085
|
+
return false;
|
|
16086
|
+
const maxDate = this.max ? dayjs(this.max, this.dateFormat) : null;
|
|
16087
|
+
const isValidMax = !maxDate || date.isBefore(maxDate) || date.isSame(maxDate);
|
|
16088
|
+
if (!isValidMax)
|
|
16089
|
+
return false;
|
|
16090
|
+
return true;
|
|
16091
|
+
}
|
|
16092
|
+
isValidFormatDate(value, format, strict = true) {
|
|
16093
|
+
return dayjs(value, format, strict).isValid();
|
|
16094
|
+
}
|
|
16095
|
+
get isoRangeValue() {
|
|
16096
|
+
return this.formatISODateRangeValue(this.value);
|
|
16097
|
+
}
|
|
16098
|
+
set isoRangeValue(newValue) {
|
|
16099
|
+
const lastValue = this.value;
|
|
16100
|
+
this.dateError = false;
|
|
16101
|
+
this.value = this.parseISODateRangeValue(newValue);
|
|
16102
|
+
if (!Utils.isEqual(lastValue, this.value))
|
|
16103
|
+
this.change(this.value);
|
|
16104
|
+
}
|
|
16105
|
+
formatISODateRangeValue(dates) {
|
|
16106
|
+
let splitedValue;
|
|
16107
|
+
if (Array.isArray(dates))
|
|
16108
|
+
splitedValue = dates;
|
|
16109
|
+
else
|
|
16110
|
+
splitedValue = this.splitValues(dates);
|
|
16111
|
+
const formattedValue = [];
|
|
16112
|
+
splitedValue.forEach((value) => {
|
|
16113
|
+
if (value && this.isValidFormatDate(value, this.dateFormat)) {
|
|
16114
|
+
formattedValue.push(dayjs(value, this.dateFormat, true).format(this.isoFormat));
|
|
16115
|
+
}
|
|
16116
|
+
});
|
|
16117
|
+
return formattedValue;
|
|
16118
|
+
}
|
|
16119
|
+
parseISODateRangeValue(values) {
|
|
16120
|
+
const parsedValue = [];
|
|
16121
|
+
if (values.length) {
|
|
16122
|
+
values.forEach((value) => {
|
|
16123
|
+
if (value && this.isValidFormatDate(value, this.isoFormat)) {
|
|
16124
|
+
parsedValue.push(dayjs(value, this.isoFormat, true).format(this.dateFormat));
|
|
16125
|
+
}
|
|
16126
|
+
});
|
|
16127
|
+
}
|
|
16128
|
+
return this.sortDates(parsedValue);
|
|
16129
|
+
}
|
|
16130
|
+
sortDates(parsedValue) {
|
|
16131
|
+
return parsedValue.sort((a, b) => dayjs(a, this.dateFormat).isAfter(dayjs(b, this.dateFormat)) ? 1 : -1);
|
|
16132
|
+
}
|
|
16133
|
+
dateValidation() {
|
|
16134
|
+
return !this.dateError || I18n.translate('VALIDATION_INVALID_DATE');
|
|
16135
|
+
}
|
|
16136
|
+
click(event, element) {
|
|
16137
|
+
const clickEvent = event || new MouseEvent('click');
|
|
16138
|
+
super.click(clickEvent, element);
|
|
16139
|
+
if (!clickEvent.defaultPrevented) {
|
|
16140
|
+
this.showDatePicker = !this.showDatePicker;
|
|
16141
|
+
}
|
|
16142
|
+
}
|
|
16143
|
+
blur(event, element) {
|
|
16144
|
+
if (this.value) {
|
|
16145
|
+
this.value = this.sortDates(this.value);
|
|
16146
|
+
this.removeDateMask();
|
|
16147
|
+
this.setDateValue(this.formatter(this.value));
|
|
16148
|
+
super.blur(event, element);
|
|
16149
|
+
}
|
|
16150
|
+
if (!Utils.isMobile()) {
|
|
16151
|
+
this.showDatePicker = false;
|
|
16152
|
+
}
|
|
16153
|
+
}
|
|
16154
|
+
focus(event, element) {
|
|
16155
|
+
this.addDateMask();
|
|
16156
|
+
super.focus(event, element);
|
|
16157
|
+
}
|
|
16158
|
+
/**
|
|
16159
|
+
* Add date mask
|
|
16160
|
+
*/
|
|
16161
|
+
addDateMask() {
|
|
16162
|
+
if (isUndefined(this.getInitialMask()) || !this.value)
|
|
16163
|
+
return;
|
|
16164
|
+
setTimeout(() => {
|
|
16165
|
+
this.mask = this.getInitialMask();
|
|
16166
|
+
const firstDate = this.value[0]
|
|
16167
|
+
? dayjs(this.value[0], this.dateFormat).format(this.inputFormat || this.displayFormat)
|
|
16168
|
+
: '';
|
|
16169
|
+
const lastDate = this.value[1]
|
|
16170
|
+
? dayjs(this.value[1], this.dateFormat).format(this.inputFormat || this.displayFormat)
|
|
16171
|
+
: '';
|
|
16172
|
+
this.internalDisplayValue = `${firstDate}${lastDate ? this.splitter : ''}${lastDate}`;
|
|
16173
|
+
});
|
|
16174
|
+
}
|
|
16175
|
+
/**
|
|
16176
|
+
* Removes the component mask if value is valid
|
|
16177
|
+
*/
|
|
16178
|
+
removeDateMask() {
|
|
16179
|
+
if (isUndefined(this.getInitialMask()) ||
|
|
16180
|
+
!this.value ||
|
|
16181
|
+
this.dateError ||
|
|
16182
|
+
!this.isValidDateArray(this.dateFormat, this.value)) {
|
|
16183
|
+
return;
|
|
16184
|
+
}
|
|
16185
|
+
this.mask = '';
|
|
16186
|
+
}
|
|
16187
|
+
/**
|
|
16188
|
+
* Toggle showDatePicker value
|
|
16189
|
+
*/
|
|
16190
|
+
togglePicker() {
|
|
16191
|
+
this.showDatePicker = !this.showDatePicker;
|
|
16192
|
+
}
|
|
16193
|
+
/**
|
|
16194
|
+
* Triggered when the appended icon is clicked.
|
|
16195
|
+
* @param event DOM event
|
|
16196
|
+
* @param element Text input
|
|
16197
|
+
*/
|
|
16198
|
+
iconClick(event, element) {
|
|
16199
|
+
super.click(event, element);
|
|
16200
|
+
if (!event.defaultPrevented) {
|
|
16201
|
+
this.togglePicker();
|
|
16202
|
+
}
|
|
16203
|
+
}
|
|
16204
|
+
/**
|
|
16205
|
+
* Checks if a date format is simple.
|
|
16206
|
+
* Simple date formats are the ones that consists only of 'DD', 'MM' or 'YYYY', and mask delimiters
|
|
16207
|
+
* @param format The format to be checked
|
|
16208
|
+
* @returns true if it is simple, false otherwise
|
|
16209
|
+
*/
|
|
16210
|
+
isSimpleFormat(format) {
|
|
16211
|
+
const simpleTokens = ['DD', 'MM', 'YYYY'];
|
|
16212
|
+
// remove the simple tokens from the string
|
|
16213
|
+
const replaced = simpleTokens.reduce((result, token) => result.replace(token, ''), format);
|
|
16214
|
+
const chars = replaced.split('');
|
|
16215
|
+
return chars.length ? chars.every((char) => Mask.isMaskDelimiter(char)) : true;
|
|
16216
|
+
}
|
|
16217
|
+
previousHint = '';
|
|
16218
|
+
previousPersistentHint = false;
|
|
16219
|
+
updateHelperHint(helperValue) {
|
|
16220
|
+
const previousHelperHint = this.helperValue ? DateHelper.getLabel(this.helperValue) : '';
|
|
16221
|
+
if (!this.hint || previousHelperHint !== this.hint) {
|
|
16222
|
+
this.previousHint = this.hint;
|
|
16223
|
+
this.previousPersistentHint = this.persistentHint;
|
|
16224
|
+
}
|
|
16225
|
+
this.helperValue = helperValue;
|
|
16226
|
+
const label = DateHelper.getLabel(helperValue);
|
|
16227
|
+
if (!helperValue || !label) {
|
|
16228
|
+
this.hint = this.previousHint;
|
|
16229
|
+
this.persistentHint = this.previousPersistentHint;
|
|
16230
|
+
return;
|
|
16231
|
+
}
|
|
16232
|
+
this.hint = label;
|
|
16233
|
+
this.persistentHint = true;
|
|
16234
|
+
}
|
|
16235
|
+
change(event, element) {
|
|
16236
|
+
super.change(event, element);
|
|
16237
|
+
this.updateHelperHint('');
|
|
16238
|
+
}
|
|
16239
|
+
getExtremities(arr) {
|
|
16240
|
+
if (arr.length === 0)
|
|
16241
|
+
return [];
|
|
16242
|
+
if (arr.length === 1)
|
|
16243
|
+
return [arr[0]];
|
|
16244
|
+
return [arr[0], arr[arr.length - 1]];
|
|
16245
|
+
}
|
|
16246
|
+
setNativeDate(date) {
|
|
16247
|
+
this.dateError = false;
|
|
16248
|
+
this.dateObject = date.map((obj) => dayjs(obj));
|
|
16249
|
+
const extremityDates = this.getExtremities(this.dateObject);
|
|
16250
|
+
this.value = extremityDates
|
|
16251
|
+
.filter((obj) => obj !== null)
|
|
16252
|
+
.map((obj) => obj.format(this.dateFormat));
|
|
16253
|
+
}
|
|
16254
|
+
dateObject = [null, null];
|
|
16255
|
+
getNativeDate() {
|
|
16256
|
+
return this.dateObject.filter((obj) => obj !== null).map((obj) => obj.toDate());
|
|
16257
|
+
}
|
|
16258
|
+
getMaskValue() {
|
|
16259
|
+
let mask = '';
|
|
16260
|
+
if (typeof this.mask === 'function') {
|
|
16261
|
+
mask = this.mask(Mask.getValueWithoutMask(this.value?.[0] || ''));
|
|
16262
|
+
}
|
|
16263
|
+
else if (typeof this.mask === 'string') {
|
|
16264
|
+
mask = this.mask.split(this.splitter)[0] || '';
|
|
16265
|
+
mask = Mask.getMaskArray(mask);
|
|
16266
|
+
if (Array.isArray(mask) && mask.length > 0) {
|
|
16267
|
+
mask = mask.concat(this.splitter.split('')).concat(mask);
|
|
16268
|
+
}
|
|
16269
|
+
}
|
|
16270
|
+
else if (Array.isArray(this.mask)) {
|
|
16271
|
+
mask = this.mask;
|
|
16272
|
+
}
|
|
16273
|
+
return mask;
|
|
16274
|
+
}
|
|
16275
|
+
}
|
|
16276
|
+
FormatterParserProvider.registerFormatter('ZdDateRange', (value, { dateFormat = Config.dateFormat, displayFormat = Config.displayFormat, inputFormat = Config.dateInputFormat, initialMask, splitter = ' ~ ', unitMask = '', mask = '', isSimpleDisplay = false, } = {}) => {
|
|
16277
|
+
if (!value || value.length === 0 || (value.length === 1 && !value[0])) {
|
|
16278
|
+
return '';
|
|
16279
|
+
}
|
|
16280
|
+
const formattedValue = [];
|
|
16281
|
+
value.forEach((date) => {
|
|
16282
|
+
if (date) {
|
|
16283
|
+
const isDateValid = dayjs(date, dateFormat, true).isValid();
|
|
16284
|
+
if (!isDateValid) {
|
|
16285
|
+
formattedValue.push(date);
|
|
16286
|
+
return;
|
|
16287
|
+
}
|
|
16288
|
+
if (initialMask && mask && unitMask) {
|
|
16289
|
+
if (inputFormat) {
|
|
16290
|
+
const formatted = dayjs(date, dateFormat).format(inputFormat);
|
|
16291
|
+
formattedValue.push(formatted);
|
|
16292
|
+
return;
|
|
16293
|
+
}
|
|
16294
|
+
let valueToUnmask = date;
|
|
16295
|
+
if (isSimpleDisplay) {
|
|
16296
|
+
valueToUnmask = dayjs(date, dateFormat).format(displayFormat);
|
|
16297
|
+
}
|
|
16298
|
+
const unmasked = Mask.getValueWithoutMask(valueToUnmask);
|
|
16299
|
+
const masked = Mask.getValueWithMask(unmasked, unitMask);
|
|
16300
|
+
formattedValue.push(masked);
|
|
16301
|
+
return;
|
|
16302
|
+
}
|
|
16303
|
+
const formatted = dayjs(date, dateFormat).format(displayFormat);
|
|
16304
|
+
formattedValue.push(formatted);
|
|
16305
|
+
}
|
|
16306
|
+
});
|
|
16307
|
+
let displayOutput = formattedValue[0];
|
|
16308
|
+
if (formattedValue.length === 2) {
|
|
16309
|
+
displayOutput += `${splitter}${formattedValue[1]}`;
|
|
16310
|
+
}
|
|
16311
|
+
return displayOutput;
|
|
16312
|
+
});
|
|
16313
|
+
FormatterParserProvider.registerParser('ZdDateRange', (value, { dateFormat = Config.dateFormat, displayFormat = Config.displayFormat, inputFormat = Config.dateInputFormat, splitter = ' ~ ', unitMask = '', mask = '', initialMask, isSimpleDisplay = false, } = {}) => {
|
|
16314
|
+
if (!value) {
|
|
16315
|
+
return [];
|
|
16316
|
+
}
|
|
16317
|
+
let splitedValue = [];
|
|
16318
|
+
if (value.indexOf(splitter) !== -1) {
|
|
16319
|
+
splitedValue = value.split(splitter);
|
|
16320
|
+
}
|
|
16321
|
+
else {
|
|
16322
|
+
splitedValue.push(value);
|
|
16323
|
+
}
|
|
16324
|
+
const formattedValue = [];
|
|
16325
|
+
splitedValue.forEach((date) => {
|
|
16326
|
+
if (date) {
|
|
16327
|
+
if (dayjs(date, displayFormat, true).isValid()) {
|
|
16328
|
+
const parsedDate = dayjs(date, displayFormat).format(dateFormat);
|
|
16329
|
+
formattedValue.push(parsedDate);
|
|
16330
|
+
return;
|
|
16331
|
+
}
|
|
16332
|
+
if (unitMask && mask && Mask.checkMask(date, unitMask)) {
|
|
16333
|
+
if (inputFormat) {
|
|
16334
|
+
if (dayjs(date, inputFormat, true).isValid()) {
|
|
16335
|
+
const parsedDate = dayjs(date, inputFormat).format(dateFormat);
|
|
16336
|
+
formattedValue.push(parsedDate);
|
|
16337
|
+
return;
|
|
16338
|
+
}
|
|
16339
|
+
formattedValue.push(date);
|
|
16340
|
+
return;
|
|
16341
|
+
}
|
|
16342
|
+
const unmasked = Mask.getValueWithoutMask(date);
|
|
16343
|
+
let masked;
|
|
16344
|
+
if (!initialMask || isSimpleDisplay) {
|
|
16345
|
+
const displayFmtMask = displayFormat.replace(/[A-Za-z]/gi, '#');
|
|
16346
|
+
masked = Mask.getValueWithMask(unmasked, displayFmtMask);
|
|
16347
|
+
if (dayjs(masked, displayFormat, true).format(displayFormat) === masked) {
|
|
16348
|
+
const parsedDate = dayjs(masked, displayFormat).format(dateFormat);
|
|
16349
|
+
formattedValue.push(parsedDate);
|
|
16350
|
+
return;
|
|
16351
|
+
}
|
|
16352
|
+
}
|
|
16353
|
+
const dateFmtMask = dateFormat.replace(/[A-Za-z]/gi, '#');
|
|
16354
|
+
masked = Mask.getValueWithMask(unmasked, dateFmtMask);
|
|
16355
|
+
if (dayjs(masked, dateFormat, true).isValid()) {
|
|
16356
|
+
formattedValue.push(masked);
|
|
16357
|
+
return;
|
|
16358
|
+
}
|
|
16359
|
+
}
|
|
16360
|
+
formattedValue.push(date);
|
|
16361
|
+
}
|
|
16362
|
+
});
|
|
16363
|
+
return formattedValue;
|
|
16364
|
+
});
|
|
16365
|
+
InputFactory.register('ZdDateRange', DateRange);
|
|
16366
|
+
|
|
15755
16367
|
const AutoNumeric = require('@zeedhi/autonumeric/dist/autoNumeric');
|
|
15756
16368
|
Icons.addIcons({
|
|
15757
16369
|
add: 'mdi-plus-box',
|
|
@@ -15763,7 +16375,5 @@ Icons.addIcons({
|
|
|
15763
16375
|
updateLayout: 'mdi-square-edit-outline',
|
|
15764
16376
|
layout: 'mdi-table-star',
|
|
15765
16377
|
});
|
|
15766
|
-
// const packageContent = require('../package.json');
|
|
15767
|
-
// VersionService.addPackageVersion(packageContent.name, packageContent.version);
|
|
15768
16378
|
|
|
15769
|
-
export { Alert, AlertQueue, AlertReplace, AlertService, AlertStack, AutoNumeric, Badge, Breadcrumbs, Button, ButtonGroup, ButtonOption, Card, Carousel, Checkbox, CheckboxMultiple, ChildNotFoundError, Chip, CodeViewer, Col, CollapseCard, Column, ColumnNotFoundError, ColumnsSearcher, Component, ComponentRender, ConditionsManager, Container, Currency, DataEditor, DataEditorWithAdd, DataNavigator, DataSelector, DataValueOutHelper, DatasourceSearcher, DateInput, DetailNotFoundError, Dialog, DialogService, Divider, Dropdown, DynamicFilterDatasourceFactory, DynamicFilterOperations, DynamicFilterRelations, Footer, Form, Frame, FramePage, Grid, GridColumn, GridColumnEditable, GridEditable, GridEditableController, GridEditableEvents, GridEvents, GroupedDataManager, GroupedDataSelector, GroupedViewNavigator, Header, Icon, Icons, Image, Increment, Input, InputFactory, Iterable, IterableColumnsButton, IterableColumnsButtonController, IterableComponentRender, IterablePageComponent, IterablePageInfo, IterablePageSize, IterablePagination, IterableTable, IterableTree, KeyMapGrouped, KeyMapMerger, KeyMapNavigation, KeyMapTree, Layout, List, ListGroup, ListItem, Loading, LoadingService, Login, LoginButton, Main, MasterDetail, MasterNotFoundError, Menu, MenuButton, MenuGroup, MenuLink, MenuSeparator, Modal, ModalCloseButton, ModalService, Month, MultiOption, NumberInput, Password, Progress, Radio, Row, Search, Select, SelectMultiple, SvgMap, Switch, Tab, TabNotFoundError, Table, TableActionBuilder, Tabs, Tag, TekFilterHelper, TekGrid, TekGridColumn, TekGridColumnsButton, TekGridColumnsButtonController, TekGridController, TekGridEvents, TekGridFilterButton, TekGridLayoutOptions, TekGridToolbarProvider, TekMemoryDatasource, TekRestDatasource, Text, TextInput, Textarea, Time, TimeFormatSelector, Toggleable, Tooltip, Tree, TreeDataNavigator, TreeDataSelector, TreeDataStructure, TreeGrid, ViewNavigator, columnAggregationValues, initTheme, isFilledObject, isNil, omit, uniqueBy };
|
|
16379
|
+
export { Alert, AlertQueue, AlertReplace, AlertService, AlertStack, AutoNumeric, Badge, Breadcrumbs, Button, ButtonGroup, ButtonOption, Card, Carousel, Checkbox, CheckboxMultiple, ChildNotFoundError, Chip, CodeViewer, Col, CollapseCard, Column, ColumnNotFoundError, ColumnsSearcher, Component, ComponentRender, ConditionsManager, Container, Currency, DataEditor, DataEditorWithAdd, DataNavigator, DataSelector, DataValueOutHelper, DatasourceSearcher, DateInput, DateRange, DetailNotFoundError, Dialog, DialogService, Divider, Dropdown, DynamicFilterDatasourceFactory, DynamicFilterOperations, DynamicFilterRelations, Footer, Form, Frame, FramePage, Grid, GridColumn, GridColumnEditable, GridEditable, GridEditableController, GridEditableEvents, GridEvents, GroupedDataManager, GroupedDataSelector, GroupedViewNavigator, Header, Icon, Icons, Image, Increment, Input, InputFactory, Iterable, IterableColumnsButton, IterableColumnsButtonController, IterableComponentRender, IterablePageComponent, IterablePageInfo, IterablePageSize, IterablePagination, IterableTable, IterableTree, KeyMapGrouped, KeyMapMerger, KeyMapNavigation, KeyMapTree, Layout, List, ListGroup, ListItem, Loading, LoadingService, Login, LoginButton, Main, MasterDetail, MasterNotFoundError, Menu, MenuButton, MenuGroup, MenuLink, MenuSeparator, Modal, ModalCloseButton, ModalService, Month, MultiOption, NumberInput, Password, Progress, Radio, Row, Search, Select, SelectMultiple, SvgMap, Switch, Tab, TabNotFoundError, Table, TableActionBuilder, Tabs, Tag, TekFilterHelper, TekGrid, TekGridColumn, TekGridColumnsButton, TekGridColumnsButtonController, TekGridController, TekGridEvents, TekGridFilterButton, TekGridLayoutOptions, TekGridToolbarProvider, TekMemoryDatasource, TekRestDatasource, Text, TextInput, Textarea, Time, TimeFormatSelector, Toggleable, Tooltip, Tree, TreeDataNavigator, TreeDataSelector, TreeDataStructure, TreeGrid, ViewNavigator, columnAggregationValues, initTheme, isFilledObject, isNil, omit, uniqueBy };
|