@yuuvis/client-framework 2.0.0-beta.0 → 2.0.0-beta.10
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/actions/lib/actions/delete-action/delete/delete.component.d.ts +3 -3
- package/actions/lib/actions/delete-action/delete-action.d.ts +1 -1
- package/actions/lib/actions.service.d.ts +7 -3
- package/actions/lib/components/contextmenu/contextmenu.component.d.ts +3 -1
- package/autocomplete/README.md +3 -0
- package/autocomplete/index.d.ts +3 -0
- package/autocomplete/lib/autocomplete.component.d.ts +72 -0
- package/autocomplete/lib/autocomplete.interface.d.ts +4 -0
- package/autocomplete/lib/autocomplete.module.d.ts +7 -0
- package/common/index.d.ts +4 -4
- package/common/lib/common.module.d.ts +19 -0
- package/common/lib/common.utils.d.ts +2 -0
- package/common/lib/components/confirm/confirm.component.d.ts +7 -0
- package/common/lib/components/confirm/confirm.interface.d.ts +7 -0
- package/common/lib/components/confirm/confirm.service.d.ts +9 -0
- package/common/lib/components/dialog/dialog.component.d.ts +6 -0
- package/common/lib/components/dialog/dialog.options.d.ts +7 -0
- package/common/lib/components/index.d.ts +5 -0
- package/common/lib/directives/autofocus-child.directive.d.ts +13 -0
- package/common/lib/directives/autofocus-delayed.directive.d.ts +18 -0
- package/common/lib/directives/drag-scroll.directive.d.ts +20 -0
- package/common/lib/directives/index.d.ts +8 -4
- package/common/lib/directives/noop-value-accessor.directive.d.ts +2 -2
- package/common/lib/mat-form-field.abstract.d.ts +41 -0
- package/common/lib/services/index.d.ts +1 -1
- package/common/lib/services/layout-settings/layout-settings.service.d.ts +18 -0
- package/datepicker/README.md +3 -0
- package/datepicker/index.d.ts +5 -0
- package/datepicker/lib/calendar/calendar.component.d.ts +72 -0
- package/datepicker/lib/date-input/date-input-element/date-input-element.component.d.ts +43 -0
- package/datepicker/lib/date-input/date-input-hour-element/date-input-hour-element.component.d.ts +11 -0
- package/datepicker/lib/date-input/date-input.component.d.ts +61 -0
- package/datepicker/lib/datepicker-calendar/datepicker-calendar-trigger.component.d.ts +7 -0
- package/datepicker/lib/datepicker-calendar/datepicker-calendar.component.d.ts +12 -0
- package/datepicker/lib/datepicker.component.d.ts +80 -0
- package/datepicker/lib/datepicker.interface.d.ts +34 -0
- package/datepicker/lib/datepicker.module.d.ts +9 -0
- package/datepicker/lib/datepicker.service.d.ts +46 -0
- package/datepicker/lib/datepicker.utils.d.ts +23 -0
- package/datepicker/lib/time-input/time-input.component.d.ts +36 -0
- package/datepicker/lib/time-input/time-input.interface.d.ts +6 -0
- package/fesm2022/yuuvis-client-framework-actions.mjs +147 -105
- package/fesm2022/yuuvis-client-framework-actions.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-app-bar.mjs +7 -8
- package/fesm2022/yuuvis-client-framework-app-bar.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-autocomplete.mjs +210 -0
- package/fesm2022/yuuvis-client-framework-autocomplete.mjs.map +1 -0
- package/fesm2022/yuuvis-client-framework-clipboard.mjs +9 -9
- package/fesm2022/yuuvis-client-framework-clipboard.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-common.mjs +853 -780
- package/fesm2022/yuuvis-client-framework-common.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-datepicker.mjs +1688 -0
- package/fesm2022/yuuvis-client-framework-datepicker.mjs.map +1 -0
- package/fesm2022/yuuvis-client-framework-forms.mjs +945 -1157
- package/fesm2022/yuuvis-client-framework-forms.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-icons.mjs +85 -12
- package/fesm2022/yuuvis-client-framework-icons.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-list.mjs +81 -45
- package/fesm2022/yuuvis-client-framework-list.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-master-details.mjs +112 -0
- package/fesm2022/yuuvis-client-framework-master-details.mjs.map +1 -0
- package/fesm2022/yuuvis-client-framework-metadata-form-defaults.mjs +60 -0
- package/fesm2022/yuuvis-client-framework-metadata-form-defaults.mjs.map +1 -0
- package/fesm2022/yuuvis-client-framework-metadata-form.mjs +125 -100
- package/fesm2022/yuuvis-client-framework-metadata-form.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-object-details.mjs +49 -59
- package/fesm2022/yuuvis-client-framework-object-details.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-object-flavor.mjs +188 -77
- package/fesm2022/yuuvis-client-framework-object-flavor.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-object-form.mjs +99 -184
- package/fesm2022/yuuvis-client-framework-object-form.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-object-preview.mjs +12 -12
- package/fesm2022/yuuvis-client-framework-object-preview.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-object-summary.mjs +46 -42
- package/fesm2022/yuuvis-client-framework-object-summary.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-overflow-menu.mjs +126 -0
- package/fesm2022/yuuvis-client-framework-overflow-menu.mjs.map +1 -0
- package/fesm2022/yuuvis-client-framework-pagination.mjs +7 -9
- package/fesm2022/yuuvis-client-framework-pagination.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-panel.mjs +8 -7
- package/fesm2022/yuuvis-client-framework-panel.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-popout.mjs +212 -0
- package/fesm2022/yuuvis-client-framework-popout.mjs.map +1 -0
- package/fesm2022/yuuvis-client-framework-renderer.mjs +99 -72
- package/fesm2022/yuuvis-client-framework-renderer.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-sequence-list.mjs +29 -112
- package/fesm2022/yuuvis-client-framework-sequence-list.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-simple-search.mjs +40 -21
- package/fesm2022/yuuvis-client-framework-simple-search.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-split-view.mjs +188 -0
- package/fesm2022/yuuvis-client-framework-split-view.mjs.map +1 -0
- package/fesm2022/yuuvis-client-framework-tile-list.mjs +100 -93
- package/fesm2022/yuuvis-client-framework-tile-list.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-tree.mjs +15 -15
- package/fesm2022/yuuvis-client-framework-tree.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-upload-progress.mjs +16 -21
- package/fesm2022/yuuvis-client-framework-upload-progress.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework.mjs +4 -4
- package/fesm2022/yuuvis-client-framework.mjs.map +1 -1
- package/forms/index.d.ts +7 -1
- package/forms/lib/elements/catalog/catalog.component.d.ts +17 -56
- package/forms/lib/elements/data-grid/edit-table-data/edit-data.component.d.ts +5 -4
- package/forms/lib/elements/datetime/datetime.component.d.ts +19 -10
- package/forms/lib/elements/datetime-range/datetime-range.component.d.ts +12 -27
- package/forms/lib/elements/index.d.ts +0 -1
- package/forms/lib/elements/number/number.component.d.ts +21 -30
- package/forms/lib/elements/number-range/number-range.component.d.ts +12 -7
- package/forms/lib/elements/organization/organization.component.d.ts +23 -51
- package/forms/lib/elements/range-select-date/range-select-date.component.d.ts +12 -7
- package/forms/lib/elements/range-select-filesize/range-select-filesize.component.d.ts +12 -7
- package/forms/lib/elements/string/string.component.d.ts +15 -20
- package/forms/lib/forms.module.d.ts +8 -11
- package/icons/index.d.ts +1 -0
- package/icons/lib/icon.component.d.ts +20 -0
- package/lib/assets/i18n/de.json +7 -23
- package/lib/assets/i18n/en.json +10 -26
- package/list/index.d.ts +1 -0
- package/list/lib/list-item.directive.d.ts +5 -4
- package/list/lib/list.component.d.ts +6 -3
- package/list/lib/list.module.d.ts +8 -0
- package/master-details/README.md +3 -0
- package/master-details/index.d.ts +2 -0
- package/master-details/lib/master-details.component.d.ts +58 -0
- package/master-details/lib/master-details.interface.d.ts +7 -0
- package/master-details/lib/master-details.module.d.ts +7 -0
- package/metadata-form/index.d.ts +4 -1
- package/metadata-form/lib/metadata-form-field/metadata-form-field.component.d.ts +4 -17
- package/metadata-form/lib/metadata-form-field/metadata-form-field.interface.d.ts +11 -0
- package/metadata-form/lib/object-metadata-element-error.directive.d.ts +13 -0
- package/metadata-form/lib/object-metadata-element-label.directive.d.ts +10 -0
- package/metadata-form/lib/object-metadata-element-template.directive.d.ts +3 -3
- package/metadata-form-defaults/README.md +3 -0
- package/metadata-form-defaults/index.d.ts +2 -0
- package/metadata-form-defaults/lib/metadata-form-defaults.module.d.ts +7 -0
- package/object-details/lib/object-audit/object-audit.component.d.ts +3 -9
- package/object-details/lib/object-details.component.d.ts +0 -2
- package/object-details/lib/object-metadata/object-metadata.component.d.ts +4 -3
- package/object-details/lib/retention-badge/retention-badge.component.d.ts +0 -3
- package/object-flavor/index.d.ts +1 -0
- package/object-flavor/lib/abstract-apply-create-flavor/abstract-apply-create-flavor.component.d.ts +1 -2
- package/object-flavor/lib/abstract-apply-object-flavor/abstract-apply-object-flavor.component.d.ts +3 -2
- package/object-flavor/lib/default-apply-flavor/default-apply-flavor.component.d.ts +19 -0
- package/object-flavor/lib/flavor-chip/flavor-chip.component.d.ts +1 -1
- package/object-flavor/lib/object-flavor/object-flavor.component.d.ts +3 -6
- package/object-flavor/lib/object-flavor-picker/object-flavor-picker.component.d.ts +0 -1
- package/object-form/index.d.ts +1 -1
- package/object-form/lib/object-form-element/object-form-element.component.d.ts +2 -2
- package/object-form/lib/object-form-group/object-form-group.component.d.ts +1 -3
- package/object-form/lib/object-form.component.d.ts +2 -2
- package/object-form/lib/object-form.interface.d.ts +0 -44
- package/object-form/lib/object-form.module.d.ts +7 -0
- package/object-form/lib/object-form.service.d.ts +1 -2
- package/object-form/lib/object-form.utils.d.ts +1 -1
- package/object-summary/lib/object-summary/object-summary.component.d.ts +13 -15
- package/overflow-menu/README.md +3 -0
- package/overflow-menu/index.d.ts +3 -0
- package/overflow-menu/lib/overflow-menu.component.d.ts +31 -0
- package/overflow-menu/lib/overflow-menu.interface.d.ts +9 -0
- package/overflow-menu/lib/overflow-menu.module.d.ts +7 -0
- package/package.json +44 -70
- package/popout/README.md +3 -0
- package/popout/index.d.ts +3 -0
- package/popout/lib/popout.component.d.ts +58 -0
- package/popout/lib/popout.interface.d.ts +17 -0
- package/popout/lib/popout.module.d.ts +7 -0
- package/renderer/lib/property-renderer/abstract.renderer.d.ts +4 -4
- package/renderer/lib/property-renderer/icon.renderer.component.d.ts +2 -0
- package/renderer/lib/renderer.directive.d.ts +4 -3
- package/sequence-list/index.d.ts +0 -1
- package/sequence-list/lib/sequence-list.component.d.ts +0 -4
- package/simple-search/index.d.ts +0 -1
- package/simple-search/lib/simple-search/simple-search.component.d.ts +6 -10
- package/split-view/README.md +3 -0
- package/split-view/index.d.ts +4 -0
- package/split-view/lib/split-area.directive.d.ts +16 -0
- package/split-view/lib/split-view.component.d.ts +76 -0
- package/split-view/lib/split-view.interface.d.ts +10 -0
- package/split-view/lib/split-view.module.d.ts +8 -0
- package/styles/client-framework.scss +21 -67
- package/tile-list/lib/tile/tile.component.d.ts +1 -2
- package/tile-list/lib/tile-config/property-select/property-select.component.d.ts +0 -1
- package/tile-list/lib/tile-config/tile-config-trigger/tile-config-trigger.component.d.ts +1 -2
- package/tile-list/lib/tile-config/tile-config.component.d.ts +0 -3
- package/tile-list/lib/tile-list/tile-list.component.d.ts +5 -5
- package/upload-progress/lib/upload-progress/upload-progress-overlay/upload-progress-overlay.component.d.ts +0 -5
- package/upload-progress/lib/upload-progress/upload-progress.component.d.ts +0 -4
- package/common/lib/components/focus-indicator/focus-indicator.component.d.ts +0 -7
- package/common/lib/components/token-input/token-input.component.d.ts +0 -55
- package/common/lib/components/token-input/token-input.interface.d.ts +0 -8
- package/common/lib/services/error-messages/error-messages.service.d.ts +0 -7
- package/esm2022/actions/index.mjs +0 -7
- package/esm2022/actions/lib/actions/copy-action/copy-action.mjs +0 -31
- package/esm2022/actions/lib/actions/cut-action/cut-action.mjs +0 -30
- package/esm2022/actions/lib/actions/delete-action/delete/delete.component.mjs +0 -67
- package/esm2022/actions/lib/actions/delete-action/delete-action.mjs +0 -38
- package/esm2022/actions/lib/actions/download-action/download-action.mjs +0 -33
- package/esm2022/actions/lib/actions.icon.mjs +0 -8
- package/esm2022/actions/lib/actions.interface.mjs +0 -19
- package/esm2022/actions/lib/actions.module.mjs +0 -16
- package/esm2022/actions/lib/actions.service.mjs +0 -89
- package/esm2022/actions/lib/components/contextmenu/contextmenu.component.mjs +0 -27
- package/esm2022/actions/yuuvis-client-framework-actions.mjs +0 -5
- package/esm2022/app-bar/index.mjs +0 -2
- package/esm2022/app-bar/lib/app-bar.component.mjs +0 -89
- package/esm2022/app-bar/yuuvis-client-framework-app-bar.mjs +0 -5
- package/esm2022/clipboard/index.mjs +0 -2
- package/esm2022/clipboard/lib/clipboard.component.mjs +0 -48
- package/esm2022/clipboard/yuuvis-client-framework-clipboard.mjs +0 -5
- package/esm2022/common/index.mjs +0 -7
- package/esm2022/common/lib/components/focus-indicator/focus-indicator.component.mjs +0 -41
- package/esm2022/common/lib/components/token-input/token-input.component.mjs +0 -324
- package/esm2022/common/lib/components/token-input/token-input.interface.mjs +0 -2
- package/esm2022/common/lib/directives/busy-overlay.directive.mjs +0 -88
- package/esm2022/common/lib/directives/click-double.directive.mjs +0 -61
- package/esm2022/common/lib/directives/container-size.directive.mjs +0 -56
- package/esm2022/common/lib/directives/drag-select.directive.mjs +0 -114
- package/esm2022/common/lib/directives/file-drop-zone/file-drop-zone.directive.mjs +0 -153
- package/esm2022/common/lib/directives/file-drop-zone/file-drop-zone.interface.mjs +0 -2
- package/esm2022/common/lib/directives/focus-within.directive.mjs +0 -81
- package/esm2022/common/lib/directives/index.mjs +0 -9
- package/esm2022/common/lib/directives/light-dismiss.directive.mjs +0 -44
- package/esm2022/common/lib/directives/longpress.directive.mjs +0 -36
- package/esm2022/common/lib/directives/noop-value-accessor.directive.mjs +0 -42
- package/esm2022/common/lib/services/error-messages/error-messages.service.mjs +0 -68
- package/esm2022/common/lib/services/index.mjs +0 -2
- package/esm2022/common/yuuvis-client-framework-common.mjs +0 -5
- package/esm2022/forms/index.mjs +0 -24
- package/esm2022/forms/lib/elements/catalog/catalog.component.mjs +0 -118
- package/esm2022/forms/lib/elements/data-grid/data-grid/data-grid.component.mjs +0 -172
- package/esm2022/forms/lib/elements/data-grid/edit-table-data/edit-data.component.mjs +0 -95
- package/esm2022/forms/lib/elements/data-grid/model/data-grid.interface.mjs +0 -9
- package/esm2022/forms/lib/elements/datetime/datetime.component.mjs +0 -82
- package/esm2022/forms/lib/elements/datetime-range/datetime-range.component.mjs +0 -166
- package/esm2022/forms/lib/elements/index.mjs +0 -11
- package/esm2022/forms/lib/elements/number/number.component.mjs +0 -195
- package/esm2022/forms/lib/elements/number-range/number-range.component.mjs +0 -176
- package/esm2022/forms/lib/elements/organization/organization.component.mjs +0 -286
- package/esm2022/forms/lib/elements/range-select-date/date-range-picker/date-range-picker.component.mjs +0 -38
- package/esm2022/forms/lib/elements/range-select-date/range-select-date.component.mjs +0 -181
- package/esm2022/forms/lib/elements/range-select-date/range-select-date.interface.mjs +0 -2
- package/esm2022/forms/lib/elements/range-select-filesize/range-select-filesize.component.mjs +0 -98
- package/esm2022/forms/lib/elements/range-select-filesize/range-select-filesize.interface.mjs +0 -2
- package/esm2022/forms/lib/elements/string/string.component.mjs +0 -261
- package/esm2022/forms/lib/form-input/form-input.component.mjs +0 -88
- package/esm2022/forms/lib/forms.module.mjs +0 -58
- package/esm2022/forms/yuuvis-client-framework-forms.mjs +0 -5
- package/esm2022/icons/index.mjs +0 -4
- package/esm2022/icons/lib/icon.service.mjs +0 -59
- package/esm2022/icons/lib/icons.mjs +0 -32
- package/esm2022/icons/lib/object-type-icon/object-type-icon.component.mjs +0 -29
- package/esm2022/icons/yuuvis-client-framework-icons.mjs +0 -5
- package/esm2022/index.mjs +0 -2
- package/esm2022/lib/yuuvis-client-framework.module.mjs +0 -15
- package/esm2022/list/index.mjs +0 -3
- package/esm2022/list/lib/list-item.directive.mjs +0 -72
- package/esm2022/list/lib/list.component.mjs +0 -135
- package/esm2022/list/yuuvis-client-framework-list.mjs +0 -5
- package/esm2022/metadata-form/index.mjs +0 -4
- package/esm2022/metadata-form/lib/metadata-default-templates/metadata-default-templates.component.mjs +0 -32
- package/esm2022/metadata-form/lib/metadata-form-element-registry.service.mjs +0 -99
- package/esm2022/metadata-form/lib/metadata-form-field/metadata-form-field.component.mjs +0 -83
- package/esm2022/metadata-form/lib/object-metadata-element-template.directive.mjs +0 -52
- package/esm2022/metadata-form/yuuvis-client-framework-metadata-form.mjs +0 -5
- package/esm2022/object-details/index.mjs +0 -8
- package/esm2022/object-details/lib/object-audit/object-audit.component.mjs +0 -195
- package/esm2022/object-details/lib/object-details-shell/object-details-shell.component.mjs +0 -127
- package/esm2022/object-details/lib/object-details.component.mjs +0 -61
- package/esm2022/object-details/lib/object-metadata/form-section-group.pipe.mjs +0 -17
- package/esm2022/object-details/lib/object-metadata/object-metadata.component.mjs +0 -202
- package/esm2022/object-details/lib/object-metadata/object-metadata.interface.mjs +0 -2
- package/esm2022/object-details/lib/retention-badge/retention-badge.component.mjs +0 -27
- package/esm2022/object-details/yuuvis-client-framework-object-details.mjs +0 -5
- package/esm2022/object-flavor/index.mjs +0 -6
- package/esm2022/object-flavor/lib/abstract-apply-create-flavor/abstract-apply-create-flavor.component.mjs +0 -25
- package/esm2022/object-flavor/lib/abstract-apply-object-flavor/abstract-apply-object-flavor.component.mjs +0 -21
- package/esm2022/object-flavor/lib/flavor-chip/flavor-chip.component.mjs +0 -35
- package/esm2022/object-flavor/lib/object-flavor/object-flavor.component.mjs +0 -93
- package/esm2022/object-flavor/lib/object-flavor-picker/object-flavor-picker.component.mjs +0 -43
- package/esm2022/object-flavor/yuuvis-client-framework-object-flavor.mjs +0 -5
- package/esm2022/object-form/index.mjs +0 -5
- package/esm2022/object-form/lib/form-scripting.api.interface.mjs +0 -2
- package/esm2022/object-form/lib/form-scripting.service.mjs +0 -160
- package/esm2022/object-form/lib/object-form-element/object-form-element.component.mjs +0 -87
- package/esm2022/object-form/lib/object-form-extension.interface.mjs +0 -36
- package/esm2022/object-form/lib/object-form-group/object-form-group.component.mjs +0 -85
- package/esm2022/object-form/lib/object-form-script/form-scripting-element-extension/form-scripting-element-extension.component.mjs +0 -23
- package/esm2022/object-form/lib/object-form-script/object-form-script.service.mjs +0 -115
- package/esm2022/object-form/lib/object-form-script/object-form-scripting-scope.mjs +0 -251
- package/esm2022/object-form/lib/object-form-translate.service.mjs +0 -73
- package/esm2022/object-form/lib/object-form.component.mjs +0 -628
- package/esm2022/object-form/lib/object-form.interface.mjs +0 -9
- package/esm2022/object-form/lib/object-form.model.mjs +0 -20
- package/esm2022/object-form/lib/object-form.service.mjs +0 -130
- package/esm2022/object-form/lib/object-form.utils.mjs +0 -55
- package/esm2022/object-form/lib/object-form.validation.mjs +0 -48
- package/esm2022/object-form/yuuvis-client-framework-object-form.mjs +0 -5
- package/esm2022/object-preview/index.mjs +0 -3
- package/esm2022/object-preview/lib/components/index.mjs +0 -3
- package/esm2022/object-preview/lib/components/object-email-preview/object-email-preview.component.mjs +0 -45
- package/esm2022/object-preview/lib/components/object-preview/object-preview.component.mjs +0 -78
- package/esm2022/object-preview/lib/services/object-preview.service.mjs +0 -119
- package/esm2022/object-preview/yuuvis-client-framework-object-preview.mjs +0 -5
- package/esm2022/object-summary/index.mjs +0 -5
- package/esm2022/object-summary/lib/multi-object-summary/multi-object-summary.component.mjs +0 -33
- package/esm2022/object-summary/lib/object-summary/object-summary.component.mjs +0 -275
- package/esm2022/object-summary/lib/object-summary-data/object-summary-data.component.mjs +0 -80
- package/esm2022/object-summary/lib/object-summary.module.mjs +0 -15
- package/esm2022/object-summary/yuuvis-client-framework-object-summary.mjs +0 -5
- package/esm2022/pagination/index.mjs +0 -3
- package/esm2022/pagination/lib/pagination.component.mjs +0 -46
- package/esm2022/pagination/lib/pagination.interface.mjs +0 -2
- package/esm2022/pagination/yuuvis-client-framework-pagination.mjs +0 -5
- package/esm2022/panel/index.mjs +0 -2
- package/esm2022/panel/lib/panel.component.mjs +0 -20
- package/esm2022/panel/yuuvis-client-framework-panel.mjs +0 -5
- package/esm2022/renderer/index.mjs +0 -11
- package/esm2022/renderer/lib/property-renderer/abstract.renderer.mjs +0 -29
- package/esm2022/renderer/lib/property-renderer/datetime.renderer.mjs +0 -13
- package/esm2022/renderer/lib/property-renderer/decimal.renderer.component.mjs +0 -12
- package/esm2022/renderer/lib/property-renderer/filesize.renderer.component.mjs +0 -28
- package/esm2022/renderer/lib/property-renderer/icon.renderer.component.mjs +0 -23
- package/esm2022/renderer/lib/property-renderer/integer.renderer.component.mjs +0 -12
- package/esm2022/renderer/lib/property-renderer/organization.renderer.mjs +0 -19
- package/esm2022/renderer/lib/property-renderer/string.renderer.component.mjs +0 -12
- package/esm2022/renderer/lib/property-renderer/unknown.renderer.mjs +0 -12
- package/esm2022/renderer/lib/renderer.directive.mjs +0 -51
- package/esm2022/renderer/lib/services/renderer/renderer.interface.mjs +0 -2
- package/esm2022/renderer/lib/services/renderer/renderer.service.mjs +0 -84
- package/esm2022/renderer/yuuvis-client-framework-renderer.mjs +0 -5
- package/esm2022/sequence-list/index.mjs +0 -4
- package/esm2022/sequence-list/lib/due-date-picker/due-date-picker.component.mjs +0 -99
- package/esm2022/sequence-list/lib/sequence-list.component.mjs +0 -141
- package/esm2022/sequence-list/lib/sequence-list.interface.mjs +0 -2
- package/esm2022/sequence-list/yuuvis-client-framework-sequence-list.mjs +0 -5
- package/esm2022/simple-search/index.mjs +0 -3
- package/esm2022/simple-search/lib/simple-search/simple-search.component.mjs +0 -111
- package/esm2022/simple-search/lib/simple-search/simple-search.interface.mjs +0 -2
- package/esm2022/simple-search/yuuvis-client-framework-simple-search.mjs +0 -5
- package/esm2022/tile-list/index.mjs +0 -11
- package/esm2022/tile-list/lib/tile/tile.component.mjs +0 -53
- package/esm2022/tile-list/lib/tile-config/action-select/action-select.component.mjs +0 -25
- package/esm2022/tile-list/lib/tile-config/icon-select/icon-select.component.mjs +0 -33
- package/esm2022/tile-list/lib/tile-config/property-select/property-select.component.mjs +0 -91
- package/esm2022/tile-list/lib/tile-config/tile-config-tile/tile-config-tile.component.mjs +0 -66
- package/esm2022/tile-list/lib/tile-config/tile-config-trigger/tile-config-trigger.component.mjs +0 -46
- package/esm2022/tile-list/lib/tile-config/tile-config.component.mjs +0 -156
- package/esm2022/tile-list/lib/tile-extension/directive/tile-extension.directive.mjs +0 -37
- package/esm2022/tile-list/lib/tile-extension/extensions/email.extension.mjs +0 -42
- package/esm2022/tile-list/lib/tile-extension/tile-extension.service.mjs +0 -35
- package/esm2022/tile-list/lib/tile-list/tile-list.component.mjs +0 -510
- package/esm2022/tile-list/lib/tile-list/tile-list.interface.mjs +0 -2
- package/esm2022/tile-list/yuuvis-client-framework-tile-list.mjs +0 -5
- package/esm2022/token-search/index.mjs +0 -3
- package/esm2022/token-search/token-search.component.mjs +0 -78
- package/esm2022/token-search/token-search.interface.mjs +0 -2
- package/esm2022/token-search/yuuvis-client-framework-token-search.mjs +0 -5
- package/esm2022/tree/index.mjs +0 -3
- package/esm2022/tree/lib/tree-node/tree-node.component.mjs +0 -65
- package/esm2022/tree/lib/tree.component.mjs +0 -148
- package/esm2022/tree/lib/tree.interface.mjs +0 -2
- package/esm2022/tree/lib/tree.service.mjs +0 -95
- package/esm2022/tree/yuuvis-client-framework-tree.mjs +0 -5
- package/esm2022/upload-progress/index.mjs +0 -2
- package/esm2022/upload-progress/lib/upload-progress/upload-progress-overlay/upload-progress-overlay.component.mjs +0 -49
- package/esm2022/upload-progress/lib/upload-progress/upload-progress.component.mjs +0 -37
- package/esm2022/upload-progress/yuuvis-client-framework-upload-progress.mjs +0 -5
- package/esm2022/user-avatar/index.mjs +0 -3
- package/esm2022/user-avatar/lib/user-avatar.component.mjs +0 -69
- package/esm2022/user-avatar/lib/user-avatar.module.mjs +0 -24
- package/esm2022/user-avatar/yuuvis-client-framework-user-avatar.mjs +0 -5
- package/esm2022/yuuvis-client-framework.mjs +0 -5
- package/fesm2022/yuuvis-client-framework-token-search.mjs +0 -85
- package/fesm2022/yuuvis-client-framework-token-search.mjs.map +0 -1
- package/fesm2022/yuuvis-client-framework-user-avatar.mjs +0 -96
- package/fesm2022/yuuvis-client-framework-user-avatar.mjs.map +0 -1
- package/forms/lib/form-input/form-input.component.d.ts +0 -48
- package/object-form/lib/object-form-translate.service.d.ts +0 -15
- package/object-form/lib/object-form.model.d.ts +0 -18
- package/sequence-list/lib/due-date-picker/due-date-picker.component.d.ts +0 -28
- package/simple-search/lib/simple-search/simple-search.interface.d.ts +0 -4
- package/token-search/README.md +0 -3
- package/token-search/index.d.ts +0 -2
- package/token-search/token-search.component.d.ts +0 -22
- package/token-search/token-search.interface.d.ts +0 -4
- package/user-avatar/README.md +0 -3
- package/user-avatar/index.d.ts +0 -2
- package/user-avatar/lib/user-avatar.component.d.ts +0 -44
- package/user-avatar/lib/user-avatar.module.d.ts +0 -8
- /package/{metadata-form → metadata-form-defaults}/lib/metadata-default-templates/metadata-default-templates.component.d.ts +0 -0
|
@@ -0,0 +1,1688 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Injectable, inject, input, EventEmitter, forwardRef, Output, Input, HostListener, Component, ViewChild, viewChild, model, effect, untracked, ElementRef, HostBinding, ViewChildren, signal, NgModule } from '@angular/core';
|
|
3
|
+
import * as i2 from '@angular/common';
|
|
4
|
+
import { CommonModule } from '@angular/common';
|
|
5
|
+
import * as i1 from '@angular/forms';
|
|
6
|
+
import { FormsModule, NG_VALUE_ACCESSOR, NG_VALIDATORS, Validators, ReactiveFormsModule } from '@angular/forms';
|
|
7
|
+
import * as i3 from '@angular/material/select';
|
|
8
|
+
import { MatSelectModule } from '@angular/material/select';
|
|
9
|
+
import { ReplaySubject } from 'rxjs';
|
|
10
|
+
import * as i4 from '@angular/material/button';
|
|
11
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
12
|
+
import * as i2$1 from '@angular/material/icon';
|
|
13
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
14
|
+
import * as i1$1 from '@angular/material/dialog';
|
|
15
|
+
import { MAT_DIALOG_DATA, MatDialogRef, MatDialogModule, MatDialog } from '@angular/material/dialog';
|
|
16
|
+
import * as i1$2 from '@yuuvis/client-framework/common';
|
|
17
|
+
import { FocusWithinDirective } from '@yuuvis/client-framework/common';
|
|
18
|
+
|
|
19
|
+
const DEFAULT_DAY_PERIOD_LABELS = {
|
|
20
|
+
am: 'AM',
|
|
21
|
+
pm: 'PM'
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
class DatepickerUtils {
|
|
25
|
+
/**
|
|
26
|
+
* Get preferred hour cycle for a given locale
|
|
27
|
+
* @param locale the locale to get the hour cycle for
|
|
28
|
+
*/
|
|
29
|
+
static getPreferredHourCycle(locale) {
|
|
30
|
+
const l = new Intl.Locale(locale);
|
|
31
|
+
const hc = l.hourCycles || l.getHourCycles
|
|
32
|
+
? // Chrome and Edge
|
|
33
|
+
l.hourCycles ||
|
|
34
|
+
// Safari
|
|
35
|
+
l.getHourCycles()
|
|
36
|
+
: // Not supported by Firefox right now
|
|
37
|
+
[];
|
|
38
|
+
return hc.length ? hc[0] : 'h23';
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Get week info for a given locale.
|
|
42
|
+
* Notice:
|
|
43
|
+
* @param locale the locale to get the weekinfo for
|
|
44
|
+
*/
|
|
45
|
+
static getWeekInfo(locale) {
|
|
46
|
+
const l = new Intl.Locale(locale);
|
|
47
|
+
const weekInfo = l.weekInfo || l.getWeekInfo
|
|
48
|
+
? // Chrome and Edge
|
|
49
|
+
l.weekInfo ||
|
|
50
|
+
// Safari
|
|
51
|
+
l.getWeekInfo()
|
|
52
|
+
: undefined;
|
|
53
|
+
// Not supported by Firefox right now so we'll return defaults
|
|
54
|
+
return {
|
|
55
|
+
firstDay: weekInfo?.firstDay || 7,
|
|
56
|
+
minimalDays: weekInfo?.minimalDays || 1,
|
|
57
|
+
weekend: weekInfo?.weekend || [6, 7]
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
static isFutureDate(d, withTime = false) {
|
|
61
|
+
const today = new Date();
|
|
62
|
+
if (!withTime) {
|
|
63
|
+
// future date without time also includes the whole current day
|
|
64
|
+
today.setDate(today.getDate() - 1);
|
|
65
|
+
today.setUTCHours(23, 59, 59);
|
|
66
|
+
}
|
|
67
|
+
return d.getTime() >= today.getTime();
|
|
68
|
+
}
|
|
69
|
+
static isValidDate(v) {
|
|
70
|
+
const date = new Date(v);
|
|
71
|
+
return !!date && Object.prototype.toString.call(date) === '[object Date]' && !isNaN(date.getTime());
|
|
72
|
+
}
|
|
73
|
+
static isValidValue(date, o) {
|
|
74
|
+
const err = DatepickerUtils.validateValue(date, o);
|
|
75
|
+
return !!err && Object.keys(err).length > 0;
|
|
76
|
+
}
|
|
77
|
+
static validateValue(date, o) {
|
|
78
|
+
const err = {};
|
|
79
|
+
if (date) {
|
|
80
|
+
if (o.onlyFutureDates && !DatepickerUtils.isFutureDate(date, o.withTime)) {
|
|
81
|
+
err['onlyFutureDates'] = { onlyFutureDates: false };
|
|
82
|
+
}
|
|
83
|
+
if (o.minDate && !(date > o.minDate)) {
|
|
84
|
+
err['minDate'] = { minDate: false };
|
|
85
|
+
}
|
|
86
|
+
if (o.maxDate && !(date < o.maxDate)) {
|
|
87
|
+
err['maxDate'] = { maxDate: false };
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return Object.keys(err).length ? err : null;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
class DatepickerService {
|
|
95
|
+
constructor() {
|
|
96
|
+
this._value = null;
|
|
97
|
+
this._valueChangeSource = new ReplaySubject();
|
|
98
|
+
this.valueChange$ = this._valueChangeSource.asObservable();
|
|
99
|
+
this._validationChangeSource = new ReplaySubject();
|
|
100
|
+
this.validationChange$ = this._validationChangeSource.asObservable();
|
|
101
|
+
this.DEFAULT_LANGUAGE = 'en';
|
|
102
|
+
this.yearOffset = 0;
|
|
103
|
+
this._language = this.DEFAULT_LANGUAGE;
|
|
104
|
+
this._languageSource = new ReplaySubject();
|
|
105
|
+
this.language$ = this._languageSource.asObservable();
|
|
106
|
+
this._validationErrors = null;
|
|
107
|
+
this._options = {};
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Handler for paste events from the components inputs. If the clipboard
|
|
111
|
+
* contains a whole date it will be covered by the service.
|
|
112
|
+
* @param event the ClipboardEvent
|
|
113
|
+
* @returns true if the paste event has been processed by the service, false otherwise
|
|
114
|
+
*/
|
|
115
|
+
onPaste(e) {
|
|
116
|
+
const paste = typeof e === 'string' ? e : (e.clipboardData || window.clipboardData).getData('text');
|
|
117
|
+
if (DatepickerUtils.isValidDate(paste)) {
|
|
118
|
+
this.setValue(new Date(paste));
|
|
119
|
+
return true;
|
|
120
|
+
}
|
|
121
|
+
else
|
|
122
|
+
return false;
|
|
123
|
+
}
|
|
124
|
+
setLanguage(isoCode) {
|
|
125
|
+
if (isoCode === this._language)
|
|
126
|
+
return;
|
|
127
|
+
this._language = isoCode || this.DEFAULT_LANGUAGE;
|
|
128
|
+
// check for year offset
|
|
129
|
+
// e.g. Taiwan has a year offset of +543 years (Thai solar calendar)
|
|
130
|
+
const d = new Date();
|
|
131
|
+
const dtf = new Intl.DateTimeFormat(this._language, {
|
|
132
|
+
year: 'numeric'
|
|
133
|
+
}).formatToParts(d);
|
|
134
|
+
const dtfYear = dtf.find((t) => t.type === 'year');
|
|
135
|
+
this.yearOffset = parseInt(dtfYear.value) - d.getFullYear();
|
|
136
|
+
this._languageSource.next(this._language);
|
|
137
|
+
this.setValue(this._value);
|
|
138
|
+
}
|
|
139
|
+
getDatePattern(locale, withTime, hour12) {
|
|
140
|
+
let pattern = '';
|
|
141
|
+
Intl.DateTimeFormat(locale, this.getIntlOptions(withTime, hour12))
|
|
142
|
+
.formatToParts(new Date())
|
|
143
|
+
.forEach((t) => {
|
|
144
|
+
switch (t.type) {
|
|
145
|
+
case 'day': {
|
|
146
|
+
pattern += 'dd';
|
|
147
|
+
break;
|
|
148
|
+
}
|
|
149
|
+
case 'month': {
|
|
150
|
+
pattern += 'MM';
|
|
151
|
+
break;
|
|
152
|
+
}
|
|
153
|
+
case 'year': {
|
|
154
|
+
pattern += 'yyyy';
|
|
155
|
+
break;
|
|
156
|
+
}
|
|
157
|
+
case 'hour': {
|
|
158
|
+
pattern += 'HH';
|
|
159
|
+
break;
|
|
160
|
+
}
|
|
161
|
+
case 'minute': {
|
|
162
|
+
pattern += 'mm';
|
|
163
|
+
break;
|
|
164
|
+
}
|
|
165
|
+
case 'dayPeriod': {
|
|
166
|
+
pattern += t.value;
|
|
167
|
+
break;
|
|
168
|
+
}
|
|
169
|
+
default: {
|
|
170
|
+
pattern += t.value;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
return pattern;
|
|
175
|
+
}
|
|
176
|
+
isDifferent(d1, d2) {
|
|
177
|
+
const x1 = d1 instanceof Date ? d1.getTime() : -1;
|
|
178
|
+
const x2 = d2 instanceof Date ? d2.getTime() : -1;
|
|
179
|
+
return x1 !== x2;
|
|
180
|
+
}
|
|
181
|
+
setValue(date, silent) {
|
|
182
|
+
if (this.isDifferent(date, this._value)) {
|
|
183
|
+
this._value = date;
|
|
184
|
+
if (date === null) {
|
|
185
|
+
this._validationErrors = {};
|
|
186
|
+
this._emitValidationChange();
|
|
187
|
+
}
|
|
188
|
+
this._validateValue();
|
|
189
|
+
this._valueChangeSource.next({
|
|
190
|
+
value: this._value,
|
|
191
|
+
propagateChange: !silent
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
setOption(options) {
|
|
196
|
+
this._options = {
|
|
197
|
+
...this._options,
|
|
198
|
+
...options
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
hasErrors() {
|
|
202
|
+
return this._validationErrors !== null;
|
|
203
|
+
}
|
|
204
|
+
getErrors() {
|
|
205
|
+
return this._validationErrors;
|
|
206
|
+
}
|
|
207
|
+
setErrors(err) {
|
|
208
|
+
this._validationErrors = { ...(this._validationErrors || {}), ...err };
|
|
209
|
+
this._emitValidationChange();
|
|
210
|
+
}
|
|
211
|
+
removeErrors(err) {
|
|
212
|
+
if (this._validationErrors) {
|
|
213
|
+
err.forEach((k) => {
|
|
214
|
+
delete this._validationErrors[k];
|
|
215
|
+
});
|
|
216
|
+
this._emitValidationChange();
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
_emitValidationChange() {
|
|
220
|
+
this._validationChangeSource.next(!!this._validationErrors && Object.keys(this._validationErrors).length > 0);
|
|
221
|
+
}
|
|
222
|
+
getIntlOptions(withTime = false, hour12 = false) {
|
|
223
|
+
const baseIntlOptions = {
|
|
224
|
+
day: '2-digit',
|
|
225
|
+
month: '2-digit',
|
|
226
|
+
year: 'numeric'
|
|
227
|
+
};
|
|
228
|
+
const timeIntlOptions = {
|
|
229
|
+
hour: '2-digit',
|
|
230
|
+
minute: '2-digit',
|
|
231
|
+
hourCycle: hour12 ? 'h12' : 'h23'
|
|
232
|
+
};
|
|
233
|
+
return withTime ? { ...baseIntlOptions, ...timeIntlOptions } : baseIntlOptions;
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Returns locale specific values for AM/PM
|
|
237
|
+
* @param locale locale string
|
|
238
|
+
* @returns
|
|
239
|
+
*/
|
|
240
|
+
getDayPeriodLabels(locale) {
|
|
241
|
+
const dtf = new Intl.DateTimeFormat(locale, this.getIntlOptions(true, true));
|
|
242
|
+
const amPart = dtf.formatToParts(new Date('2000-01-01T03:00:00')).find((p) => p.type === 'dayPeriod');
|
|
243
|
+
const pmPart = dtf.formatToParts(new Date('2000-01-01T15:00:00')).find((p) => p.type === 'dayPeriod');
|
|
244
|
+
return {
|
|
245
|
+
am: amPart?.value || 'AM',
|
|
246
|
+
pm: pmPart?.value || 'PM'
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
_validateValue() {
|
|
250
|
+
this._validationErrors = DatepickerUtils.validateValue(this._value, this._options);
|
|
251
|
+
}
|
|
252
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DatepickerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
253
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DatepickerService }); }
|
|
254
|
+
}
|
|
255
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DatepickerService, decorators: [{
|
|
256
|
+
type: Injectable
|
|
257
|
+
}] });
|
|
258
|
+
|
|
259
|
+
class DateInputElementComponent {
|
|
260
|
+
constructor() {
|
|
261
|
+
this.datepickerService = inject(DatepickerService);
|
|
262
|
+
this.maxLength = 2;
|
|
263
|
+
this.minValue = 1;
|
|
264
|
+
this.disabled = false;
|
|
265
|
+
this.placeholder = input('');
|
|
266
|
+
this.next = new EventEmitter();
|
|
267
|
+
this.prev = new EventEmitter();
|
|
268
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
269
|
+
this.propagateChange = (_) => { };
|
|
270
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
271
|
+
this.validationChange = () => { };
|
|
272
|
+
}
|
|
273
|
+
pasteHandler(event) {
|
|
274
|
+
const paste = (event.clipboardData || window.clipboardData).getData('text');
|
|
275
|
+
if (paste.length > this.maxLength && this.datepickerService.onPaste(paste))
|
|
276
|
+
event.preventDefault();
|
|
277
|
+
}
|
|
278
|
+
keyDownHandler(event) {
|
|
279
|
+
if (this.disabled)
|
|
280
|
+
return;
|
|
281
|
+
// increase value
|
|
282
|
+
else if (event.key === 'ArrowUp') {
|
|
283
|
+
this._stopEvent(event);
|
|
284
|
+
this.increaseValue(event.shiftKey ? 10 : 1);
|
|
285
|
+
}
|
|
286
|
+
// decrease value
|
|
287
|
+
else if (event.key === 'ArrowDown') {
|
|
288
|
+
this._stopEvent(event);
|
|
289
|
+
this.decreaseValue(event.shiftKey ? 10 : 1);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
_isNumber(v) {
|
|
293
|
+
return typeof v === 'number' && isFinite(v);
|
|
294
|
+
}
|
|
295
|
+
_stopEvent(event) {
|
|
296
|
+
event.preventDefault();
|
|
297
|
+
event.stopPropagation();
|
|
298
|
+
}
|
|
299
|
+
onInputChange(iv) {
|
|
300
|
+
this._propagate();
|
|
301
|
+
if (iv?.length === this.maxLength) {
|
|
302
|
+
this.next.emit();
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
onBlur() {
|
|
306
|
+
if (this._value && this._value.length < this.maxLength) {
|
|
307
|
+
this._setValue(this._value);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
wheelHandler(event) {
|
|
311
|
+
this._stopEvent(event);
|
|
312
|
+
if (event.deltaY < 0)
|
|
313
|
+
this.increaseValue();
|
|
314
|
+
else if (event.deltaY > 0)
|
|
315
|
+
this.decreaseValue();
|
|
316
|
+
}
|
|
317
|
+
keydownHandler(event) {
|
|
318
|
+
if (event.key === 'ArrowRight') {
|
|
319
|
+
const caretPos = event.target.selectionStart;
|
|
320
|
+
if (caretPos === this.maxLength) {
|
|
321
|
+
this.next.emit();
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
else if (event.key === 'ArrowLeft') {
|
|
325
|
+
const caretPos = event.target.selectionStart;
|
|
326
|
+
if (caretPos === 0) {
|
|
327
|
+
this.prev.emit();
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
focusHandler(event) {
|
|
332
|
+
const i = event.target;
|
|
333
|
+
}
|
|
334
|
+
_setValue(n, silent = false) {
|
|
335
|
+
const v = this._isValidInput(n) ? `${[...Array(this.maxLength - n.toString().length).keys()].map((_) => '0').join('')}${n.toString()}` : undefined;
|
|
336
|
+
if (v !== this._value) {
|
|
337
|
+
this._value = v;
|
|
338
|
+
if (!silent)
|
|
339
|
+
this._propagate();
|
|
340
|
+
// if (n.toString().length !== v?.length) this.validationChange();
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
increaseValue(step = 1) {
|
|
344
|
+
const v = (parseInt(this._value) || 0) + step;
|
|
345
|
+
this._setValue(this.maxValue ? (v <= this.maxValue ? v : this.minValue) : v);
|
|
346
|
+
}
|
|
347
|
+
decreaseValue(step = 1) {
|
|
348
|
+
const v = (parseInt(this._value) || 0) - step;
|
|
349
|
+
this._setValue(this.maxValue ? (v < this.minValue ? this.maxValue : v) : v);
|
|
350
|
+
}
|
|
351
|
+
_applyOffset() {
|
|
352
|
+
return this.maxLength === 4 && !!this.datepickerService.yearOffset;
|
|
353
|
+
}
|
|
354
|
+
_propagate() {
|
|
355
|
+
// being the year input (4 digits) also take yearOffset into accout
|
|
356
|
+
if (this._applyOffset()) {
|
|
357
|
+
let parsedValue = parseInt(this._value || '');
|
|
358
|
+
if (!isNaN(parsedValue)) {
|
|
359
|
+
parsedValue -= this.datepickerService.yearOffset;
|
|
360
|
+
this.propagateChange(`${parsedValue}`);
|
|
361
|
+
}
|
|
362
|
+
else
|
|
363
|
+
this.propagateChange(undefined);
|
|
364
|
+
}
|
|
365
|
+
else
|
|
366
|
+
this.propagateChange(this._value);
|
|
367
|
+
}
|
|
368
|
+
writeValue(value) {
|
|
369
|
+
if (value !== undefined && this._applyOffset()) {
|
|
370
|
+
let parsedValue = parseInt(value || '');
|
|
371
|
+
if (!isNaN(parsedValue)) {
|
|
372
|
+
parsedValue += this.datepickerService.yearOffset;
|
|
373
|
+
this._setValue(parsedValue);
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
else
|
|
377
|
+
this._setValue(value, true);
|
|
378
|
+
}
|
|
379
|
+
registerOnChange(fn) {
|
|
380
|
+
this.propagateChange = fn;
|
|
381
|
+
}
|
|
382
|
+
registerOnValidatorChange(fn) {
|
|
383
|
+
this.validationChange = fn;
|
|
384
|
+
}
|
|
385
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
386
|
+
registerOnTouched(fn) { }
|
|
387
|
+
setDisabledState(isDisabled) {
|
|
388
|
+
this.disabled = isDisabled;
|
|
389
|
+
}
|
|
390
|
+
_isValidInput(v) {
|
|
391
|
+
const n = parseInt(v);
|
|
392
|
+
return this._isNumber(n) && (!this.maxValue || n <= this.maxValue) && (!this.minValue || n >= this.minValue);
|
|
393
|
+
}
|
|
394
|
+
validate(c) {
|
|
395
|
+
return !this._value || this._isValidInput(this._value) ? null : { dateInputElement: { valid: false } };
|
|
396
|
+
}
|
|
397
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DateInputElementComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
398
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.11", type: DateInputElementComponent, isStandalone: true, selector: "yuv-date-input-element", inputs: { maxLength: { classPropertyName: "maxLength", publicName: "maxLength", isSignal: false, isRequired: false, transformFunction: null }, maxValue: { classPropertyName: "maxValue", publicName: "maxValue", isSignal: false, isRequired: false, transformFunction: null }, minValue: { classPropertyName: "minValue", publicName: "minValue", isSignal: false, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { next: "next", prev: "prev" }, host: { listeners: { "paste": "pasteHandler($event)", "keydown": "keyDownHandler($event)" } }, providers: [
|
|
399
|
+
{
|
|
400
|
+
provide: NG_VALUE_ACCESSOR,
|
|
401
|
+
useExisting: forwardRef(() => DateInputElementComponent),
|
|
402
|
+
multi: true
|
|
403
|
+
},
|
|
404
|
+
{
|
|
405
|
+
provide: NG_VALIDATORS,
|
|
406
|
+
useExisting: forwardRef(() => DateInputElementComponent),
|
|
407
|
+
multi: true
|
|
408
|
+
}
|
|
409
|
+
], ngImport: i0, template: "<input\n[placeholder]=\"placeholder()\"\n type=\"text\"\n (focus)=\"focusHandler($event)\"\n (keydown)=\"keydownHandler($event)\"\n (wheel)=\"wheelHandler($event)\"\n (blur)=\"onBlur()\"\n [readonly]=\"disabled\"\n pattern=\"[0-9]*\"\n [maxlength]=\"maxLength\"\n [(ngModel)]=\"_value\"\n (ngModelChange)=\"onInputChange($event)\"\n/>\n", styles: [":host{height:100%;display:flex;flex-flow:column;align-items:center;justify-content:flex-end;cursor:default}:host.year input{width:4ch}:host input{font-size:var(--_datepicker-font-size);color:var(--_datepicker-text-color);width:2ch;padding:0;flex:1;line-height:1em;text-align:end;border:0;background-color:transparent;outline:0}:host input::placeholder{font-size:.7em}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] }); }
|
|
410
|
+
}
|
|
411
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DateInputElementComponent, decorators: [{
|
|
412
|
+
type: Component,
|
|
413
|
+
args: [{ selector: 'yuv-date-input-element', standalone: true, imports: [CommonModule, FormsModule], providers: [
|
|
414
|
+
{
|
|
415
|
+
provide: NG_VALUE_ACCESSOR,
|
|
416
|
+
useExisting: forwardRef(() => DateInputElementComponent),
|
|
417
|
+
multi: true
|
|
418
|
+
},
|
|
419
|
+
{
|
|
420
|
+
provide: NG_VALIDATORS,
|
|
421
|
+
useExisting: forwardRef(() => DateInputElementComponent),
|
|
422
|
+
multi: true
|
|
423
|
+
}
|
|
424
|
+
], template: "<input\n[placeholder]=\"placeholder()\"\n type=\"text\"\n (focus)=\"focusHandler($event)\"\n (keydown)=\"keydownHandler($event)\"\n (wheel)=\"wheelHandler($event)\"\n (blur)=\"onBlur()\"\n [readonly]=\"disabled\"\n pattern=\"[0-9]*\"\n [maxlength]=\"maxLength\"\n [(ngModel)]=\"_value\"\n (ngModelChange)=\"onInputChange($event)\"\n/>\n", styles: [":host{height:100%;display:flex;flex-flow:column;align-items:center;justify-content:flex-end;cursor:default}:host.year input{width:4ch}:host input{font-size:var(--_datepicker-font-size);color:var(--_datepicker-text-color);width:2ch;padding:0;flex:1;line-height:1em;text-align:end;border:0;background-color:transparent;outline:0}:host input::placeholder{font-size:.7em}\n"] }]
|
|
425
|
+
}], propDecorators: { pasteHandler: [{
|
|
426
|
+
type: HostListener,
|
|
427
|
+
args: ['paste', ['$event']]
|
|
428
|
+
}], keyDownHandler: [{
|
|
429
|
+
type: HostListener,
|
|
430
|
+
args: ['keydown', ['$event']]
|
|
431
|
+
}], maxLength: [{
|
|
432
|
+
type: Input
|
|
433
|
+
}], maxValue: [{
|
|
434
|
+
type: Input
|
|
435
|
+
}], minValue: [{
|
|
436
|
+
type: Input
|
|
437
|
+
}], disabled: [{
|
|
438
|
+
type: Input
|
|
439
|
+
}], next: [{
|
|
440
|
+
type: Output
|
|
441
|
+
}], prev: [{
|
|
442
|
+
type: Output
|
|
443
|
+
}] } });
|
|
444
|
+
|
|
445
|
+
class DateInputHourElementComponent extends DateInputElementComponent {
|
|
446
|
+
set dayPeriod(p) {
|
|
447
|
+
if (p === 'am' || p === 'pm') {
|
|
448
|
+
this.maxValue = 12;
|
|
449
|
+
this.minValue = 1;
|
|
450
|
+
}
|
|
451
|
+
else {
|
|
452
|
+
this.maxValue = 23;
|
|
453
|
+
this.minValue = 0;
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
constructor() {
|
|
457
|
+
super();
|
|
458
|
+
this.dayPeriodChange = new EventEmitter();
|
|
459
|
+
}
|
|
460
|
+
writeValue(value) {
|
|
461
|
+
if (parseInt(value) === 0)
|
|
462
|
+
this._value = '12';
|
|
463
|
+
this._setValue(value, true);
|
|
464
|
+
}
|
|
465
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DateInputHourElementComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
466
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.11", type: DateInputHourElementComponent, isStandalone: true, selector: "yuv-date-input-hour-element", inputs: { dayPeriod: "dayPeriod" }, outputs: { dayPeriodChange: "dayPeriodChange" }, providers: [
|
|
467
|
+
{
|
|
468
|
+
provide: NG_VALUE_ACCESSOR,
|
|
469
|
+
useExisting: forwardRef(() => DateInputHourElementComponent),
|
|
470
|
+
multi: true
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
provide: NG_VALIDATORS,
|
|
474
|
+
useExisting: forwardRef(() => DateInputHourElementComponent),
|
|
475
|
+
multi: true
|
|
476
|
+
}
|
|
477
|
+
], usesInheritance: true, ngImport: i0, template: "<input\n[placeholder]=\"placeholder()\"\n type=\"text\"\n (focus)=\"focusHandler($event)\"\n (keydown)=\"keydownHandler($event)\"\n (wheel)=\"wheelHandler($event)\"\n (blur)=\"onBlur()\"\n [readonly]=\"disabled\"\n pattern=\"[0-9]*\"\n [maxlength]=\"maxLength\"\n [(ngModel)]=\"_value\"\n (ngModelChange)=\"onInputChange($event)\"\n/>\n", styles: [":host{height:100%;display:flex;flex-flow:column;align-items:center;justify-content:flex-end;cursor:default}:host.year input{width:4ch}:host input{font-size:var(--_datepicker-font-size);color:var(--_datepicker-text-color);width:2ch;padding:0;flex:1;line-height:1em;text-align:end;border:0;background-color:transparent;outline:0}:host input::placeholder{font-size:.7em}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] }); }
|
|
478
|
+
}
|
|
479
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DateInputHourElementComponent, decorators: [{
|
|
480
|
+
type: Component,
|
|
481
|
+
args: [{ selector: 'yuv-date-input-hour-element', standalone: true, imports: [CommonModule, FormsModule], providers: [
|
|
482
|
+
{
|
|
483
|
+
provide: NG_VALUE_ACCESSOR,
|
|
484
|
+
useExisting: forwardRef(() => DateInputHourElementComponent),
|
|
485
|
+
multi: true
|
|
486
|
+
},
|
|
487
|
+
{
|
|
488
|
+
provide: NG_VALIDATORS,
|
|
489
|
+
useExisting: forwardRef(() => DateInputHourElementComponent),
|
|
490
|
+
multi: true
|
|
491
|
+
}
|
|
492
|
+
], template: "<input\n[placeholder]=\"placeholder()\"\n type=\"text\"\n (focus)=\"focusHandler($event)\"\n (keydown)=\"keydownHandler($event)\"\n (wheel)=\"wheelHandler($event)\"\n (blur)=\"onBlur()\"\n [readonly]=\"disabled\"\n pattern=\"[0-9]*\"\n [maxlength]=\"maxLength\"\n [(ngModel)]=\"_value\"\n (ngModelChange)=\"onInputChange($event)\"\n/>\n", styles: [":host{height:100%;display:flex;flex-flow:column;align-items:center;justify-content:flex-end;cursor:default}:host.year input{width:4ch}:host input{font-size:var(--_datepicker-font-size);color:var(--_datepicker-text-color);width:2ch;padding:0;flex:1;line-height:1em;text-align:end;border:0;background-color:transparent;outline:0}:host input::placeholder{font-size:.7em}\n"] }]
|
|
493
|
+
}], ctorParameters: () => [], propDecorators: { dayPeriod: [{
|
|
494
|
+
type: Input
|
|
495
|
+
}], dayPeriodChange: [{
|
|
496
|
+
type: Output
|
|
497
|
+
}] } });
|
|
498
|
+
|
|
499
|
+
class TimeInputComponent {
|
|
500
|
+
get hour12() {
|
|
501
|
+
return this._hour12;
|
|
502
|
+
}
|
|
503
|
+
set hour12(b) {
|
|
504
|
+
this._hour12 = b;
|
|
505
|
+
if (this._hour12 && this._time)
|
|
506
|
+
this._patch(this._time, true);
|
|
507
|
+
}
|
|
508
|
+
set currentDayPeriod(p) {
|
|
509
|
+
if (p !== this._currentDayPeriod) {
|
|
510
|
+
this._currentDayPeriod = p;
|
|
511
|
+
this._propagate();
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
get currentDayPeriod() {
|
|
515
|
+
return this._currentDayPeriod;
|
|
516
|
+
}
|
|
517
|
+
constructor(fb) {
|
|
518
|
+
this.fb = fb;
|
|
519
|
+
this._subs = [];
|
|
520
|
+
this._hour12 = false;
|
|
521
|
+
this.dayPeriodLabels = DEFAULT_DAY_PERIOD_LABELS;
|
|
522
|
+
this.form = this.fb.group({
|
|
523
|
+
hour: ['', [Validators.required]],
|
|
524
|
+
minute: ['', [Validators.required, Validators.max(59)]]
|
|
525
|
+
});
|
|
526
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
527
|
+
this.propagateChange = (_) => { };
|
|
528
|
+
this._subs.push(this.form.valueChanges.subscribe({
|
|
529
|
+
next: (v) => this._propagate()
|
|
530
|
+
}));
|
|
531
|
+
}
|
|
532
|
+
_propagate() {
|
|
533
|
+
if (this.form.valid) {
|
|
534
|
+
const strHour = this.form.value.hour;
|
|
535
|
+
let hour = parseInt(strHour);
|
|
536
|
+
if (isNaN(hour))
|
|
537
|
+
hour = 0;
|
|
538
|
+
if (this.hour12 && hour === 0) {
|
|
539
|
+
hour = 12;
|
|
540
|
+
}
|
|
541
|
+
this._time = {
|
|
542
|
+
hour,
|
|
543
|
+
minute: parseInt(this.form.value.minute),
|
|
544
|
+
dayPeriod: this.currentDayPeriod
|
|
545
|
+
};
|
|
546
|
+
this.propagateChange(this._time);
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
increaseHour() {
|
|
550
|
+
this.hourInput.increaseValue();
|
|
551
|
+
}
|
|
552
|
+
decreaseHour() {
|
|
553
|
+
this.hourInput.decreaseValue();
|
|
554
|
+
}
|
|
555
|
+
increaseMinute() {
|
|
556
|
+
this.minuteInput.increaseValue();
|
|
557
|
+
}
|
|
558
|
+
decreaseMinute() {
|
|
559
|
+
this.minuteInput.decreaseValue();
|
|
560
|
+
}
|
|
561
|
+
_patch(value, silent) {
|
|
562
|
+
if (!this._time) {
|
|
563
|
+
const now = new Date();
|
|
564
|
+
this._time = {
|
|
565
|
+
hour: now.getHours(),
|
|
566
|
+
minute: now.getMinutes()
|
|
567
|
+
};
|
|
568
|
+
}
|
|
569
|
+
const patch = {
|
|
570
|
+
hour: value.hour,
|
|
571
|
+
minute: value.minute
|
|
572
|
+
};
|
|
573
|
+
if (this._hour12 && value) {
|
|
574
|
+
this.currentDayPeriod = value.dayPeriod;
|
|
575
|
+
if (this.currentDayPeriod === 'pm' && patch.hour >= 12) {
|
|
576
|
+
patch.hour -= 12;
|
|
577
|
+
}
|
|
578
|
+
if (patch.hour === 0)
|
|
579
|
+
patch.hour = 12;
|
|
580
|
+
}
|
|
581
|
+
this.form.patchValue(patch, { onlySelf: true, emitEvent: !silent });
|
|
582
|
+
}
|
|
583
|
+
writeValue(value) {
|
|
584
|
+
if (value === null)
|
|
585
|
+
return;
|
|
586
|
+
this._time = value;
|
|
587
|
+
this._patch(value, true);
|
|
588
|
+
}
|
|
589
|
+
registerOnChange(fn) {
|
|
590
|
+
this.propagateChange = fn;
|
|
591
|
+
}
|
|
592
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
593
|
+
registerOnTouched(fn) { }
|
|
594
|
+
ngOnDestroy() {
|
|
595
|
+
this._subs.forEach((s) => s.unsubscribe());
|
|
596
|
+
}
|
|
597
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: TimeInputComponent, deps: [{ token: i1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
598
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.11", type: TimeInputComponent, isStandalone: true, selector: "yuv-time-input", inputs: { hour12: "hour12", dayPeriodLabels: "dayPeriodLabels" }, providers: [
|
|
599
|
+
{
|
|
600
|
+
provide: NG_VALUE_ACCESSOR,
|
|
601
|
+
useExisting: forwardRef(() => TimeInputComponent),
|
|
602
|
+
multi: true
|
|
603
|
+
}
|
|
604
|
+
], viewQueries: [{ propertyName: "hourInput", first: true, predicate: ["dipHour"], descendants: true }, { propertyName: "minuteInput", first: true, predicate: ["dipMinute"], descendants: true }], ngImport: i0, template: "<form [formGroup]=\"form\">\n <button mat-icon-button type=\"button\" class=\"increase hour\" (click)=\"increaseHour()\">\n <mat-icon>keyboard_arrow_down</mat-icon>\n </button>\n\n <yuv-date-input-hour-element\n #dipHour\n class=\"hour focusable\"\n [(dayPeriod)]=\"currentDayPeriod\"\n formControlName=\"hour\"\n [maxLength]=\"2\"\n ></yuv-date-input-hour-element>\n\n <button mat-icon-button type=\"button\" class=\"decrease hour\" (click)=\"decreaseHour()\">\n <mat-icon>keyboard_arrow_down</mat-icon>\n </button>\n <div class=\"literal\">:</div>\n <button mat-icon-button type=\"button\" class=\"increase minute\" (click)=\"increaseMinute()\">\n <mat-icon>keyboard_arrow_down</mat-icon>\n </button>\n\n <yuv-date-input-element\n #dipMinute\n class=\"minute focusable\"\n [maxValue]=\"59\"\n [minValue]=\"0\"\n formControlName=\"minute\"\n [maxLength]=\"2\"\n ></yuv-date-input-element>\n\n <button mat-icon-button type=\"button\" class=\"decrease minute\" (click)=\"decreaseMinute()\">\n <mat-icon>keyboard_arrow_down</mat-icon>\n </button>\n\n @if (hour12) {\n <div class=\"dayPeriod\">\n <button\n type=\"button\"\n class=\"dp pm\"\n [ngClass]=\"{ active: currentDayPeriod === 'pm' }\"\n (click)=\"currentDayPeriod = 'pm'\"\n >\n {{ dayPeriodLabels.pm }}\n </button>\n <button\n type=\"button\"\n class=\"dp am\"\n [ngClass]=\"{ active: currentDayPeriod === 'am' }\"\n (click)=\"currentDayPeriod = 'am'\"\n >\n {{ dayPeriodLabels.am }}\n </button>\n </div>\n }\n</form>\n", styles: [":host{--time-input-border-color: var(--ymt-outline-variant)}:host form{display:grid;grid-template-rows:auto auto auto;grid-template-columns:max-content max-content max-content max-content;grid-template-areas:\"hup div mup period\" \"hin div min period\" \"hdown div mdown period\"}:host form .literal{grid-area:div;display:flex;padding:0 var(--ymt-spacing-2xs);align-items:center}:host form yuv-date-input-hour-element,:host form yuv-date-input-element{border:1px solid var(--time-input-border-color);border-width:0 1px;min-height:2em;justify-content:center}:host form yuv-date-input-hour-element.hour,:host form yuv-date-input-element.hour{grid-area:hin}:host form yuv-date-input-hour-element.minute,:host form yuv-date-input-element.minute{grid-area:min}:host form button{border:1px solid var(--time-input-border-color);border-radius:0;padding:0}:host form button.decrease.hour{grid-area:hdown}:host form button.decrease.minute{grid-area:mdown}:host form button.increase.hour{grid-area:hup}:host form button.increase.minute{grid-area:mup}:host form button.increase mat-icon{transform:rotate(180deg)}:host form .dayPeriod{grid-area:period;display:flex;flex-flow:column;justify-content:center;margin-inline-start:var(--ymt-spacing-xs)}:host form .dayPeriod>button.dp{padding:.2em;line-height:1em;margin:1px 0}:host form .dayPeriod>button.dp.active{background-color:var(--ymt-primary);border-color:var(--ymt-primary);color:var(--ymt-on-primary)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: DateInputHourElementComponent, selector: "yuv-date-input-hour-element", inputs: ["dayPeriod"], outputs: ["dayPeriodChange"] }, { kind: "component", type: DateInputElementComponent, selector: "yuv-date-input-element", inputs: ["maxLength", "maxValue", "minValue", "disabled", "placeholder"], outputs: ["next", "prev"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }] }); }
|
|
605
|
+
}
|
|
606
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: TimeInputComponent, decorators: [{
|
|
607
|
+
type: Component,
|
|
608
|
+
args: [{ selector: 'yuv-time-input', standalone: true, imports: [CommonModule, MatIconModule, DateInputHourElementComponent, DateInputElementComponent, MatButtonModule, ReactiveFormsModule], providers: [
|
|
609
|
+
{
|
|
610
|
+
provide: NG_VALUE_ACCESSOR,
|
|
611
|
+
useExisting: forwardRef(() => TimeInputComponent),
|
|
612
|
+
multi: true
|
|
613
|
+
}
|
|
614
|
+
], template: "<form [formGroup]=\"form\">\n <button mat-icon-button type=\"button\" class=\"increase hour\" (click)=\"increaseHour()\">\n <mat-icon>keyboard_arrow_down</mat-icon>\n </button>\n\n <yuv-date-input-hour-element\n #dipHour\n class=\"hour focusable\"\n [(dayPeriod)]=\"currentDayPeriod\"\n formControlName=\"hour\"\n [maxLength]=\"2\"\n ></yuv-date-input-hour-element>\n\n <button mat-icon-button type=\"button\" class=\"decrease hour\" (click)=\"decreaseHour()\">\n <mat-icon>keyboard_arrow_down</mat-icon>\n </button>\n <div class=\"literal\">:</div>\n <button mat-icon-button type=\"button\" class=\"increase minute\" (click)=\"increaseMinute()\">\n <mat-icon>keyboard_arrow_down</mat-icon>\n </button>\n\n <yuv-date-input-element\n #dipMinute\n class=\"minute focusable\"\n [maxValue]=\"59\"\n [minValue]=\"0\"\n formControlName=\"minute\"\n [maxLength]=\"2\"\n ></yuv-date-input-element>\n\n <button mat-icon-button type=\"button\" class=\"decrease minute\" (click)=\"decreaseMinute()\">\n <mat-icon>keyboard_arrow_down</mat-icon>\n </button>\n\n @if (hour12) {\n <div class=\"dayPeriod\">\n <button\n type=\"button\"\n class=\"dp pm\"\n [ngClass]=\"{ active: currentDayPeriod === 'pm' }\"\n (click)=\"currentDayPeriod = 'pm'\"\n >\n {{ dayPeriodLabels.pm }}\n </button>\n <button\n type=\"button\"\n class=\"dp am\"\n [ngClass]=\"{ active: currentDayPeriod === 'am' }\"\n (click)=\"currentDayPeriod = 'am'\"\n >\n {{ dayPeriodLabels.am }}\n </button>\n </div>\n }\n</form>\n", styles: [":host{--time-input-border-color: var(--ymt-outline-variant)}:host form{display:grid;grid-template-rows:auto auto auto;grid-template-columns:max-content max-content max-content max-content;grid-template-areas:\"hup div mup period\" \"hin div min period\" \"hdown div mdown period\"}:host form .literal{grid-area:div;display:flex;padding:0 var(--ymt-spacing-2xs);align-items:center}:host form yuv-date-input-hour-element,:host form yuv-date-input-element{border:1px solid var(--time-input-border-color);border-width:0 1px;min-height:2em;justify-content:center}:host form yuv-date-input-hour-element.hour,:host form yuv-date-input-element.hour{grid-area:hin}:host form yuv-date-input-hour-element.minute,:host form yuv-date-input-element.minute{grid-area:min}:host form button{border:1px solid var(--time-input-border-color);border-radius:0;padding:0}:host form button.decrease.hour{grid-area:hdown}:host form button.decrease.minute{grid-area:mdown}:host form button.increase.hour{grid-area:hup}:host form button.increase.minute{grid-area:mup}:host form button.increase mat-icon{transform:rotate(180deg)}:host form .dayPeriod{grid-area:period;display:flex;flex-flow:column;justify-content:center;margin-inline-start:var(--ymt-spacing-xs)}:host form .dayPeriod>button.dp{padding:.2em;line-height:1em;margin:1px 0}:host form .dayPeriod>button.dp.active{background-color:var(--ymt-primary);border-color:var(--ymt-primary);color:var(--ymt-on-primary)}\n"] }]
|
|
615
|
+
}], ctorParameters: () => [{ type: i1.FormBuilder }], propDecorators: { hourInput: [{
|
|
616
|
+
type: ViewChild,
|
|
617
|
+
args: ['dipHour']
|
|
618
|
+
}], minuteInput: [{
|
|
619
|
+
type: ViewChild,
|
|
620
|
+
args: ['dipMinute']
|
|
621
|
+
}], hour12: [{
|
|
622
|
+
type: Input
|
|
623
|
+
}], dayPeriodLabels: [{
|
|
624
|
+
type: Input
|
|
625
|
+
}] } });
|
|
626
|
+
|
|
627
|
+
class CalendarComponent {
|
|
628
|
+
// feature flag for immediately selecting a new (close) Date when
|
|
629
|
+
// navigating between years/months
|
|
630
|
+
#immediatelySelect;
|
|
631
|
+
#dateEffect;
|
|
632
|
+
#localeEffect;
|
|
633
|
+
#withTimeEffect;
|
|
634
|
+
keyDownHandler(event) {
|
|
635
|
+
this._handleKeyboardEvent(event);
|
|
636
|
+
}
|
|
637
|
+
constructor() {
|
|
638
|
+
this.datepickerService = inject(DatepickerService);
|
|
639
|
+
this.calEl = viewChild.required('cal');
|
|
640
|
+
this._initialized = false;
|
|
641
|
+
this.maxYear = 9999;
|
|
642
|
+
this.minYear = -9999;
|
|
643
|
+
// feature flag for immediately selecting a new (close) Date when
|
|
644
|
+
// navigating between years/months
|
|
645
|
+
this.#immediatelySelect = true;
|
|
646
|
+
/**
|
|
647
|
+
* Allow only date inputs after this date
|
|
648
|
+
*/
|
|
649
|
+
this.minDate = input();
|
|
650
|
+
/**
|
|
651
|
+
* Allow only date inputs before this date
|
|
652
|
+
*/
|
|
653
|
+
this.maxDate = input();
|
|
654
|
+
/**
|
|
655
|
+
* Allow only date inputs that are after today
|
|
656
|
+
*/
|
|
657
|
+
this.onlyFutureDates = input(false);
|
|
658
|
+
this.date = model();
|
|
659
|
+
this.#dateEffect = effect(() => {
|
|
660
|
+
const d = this.date();
|
|
661
|
+
untracked(() => {
|
|
662
|
+
// clone date
|
|
663
|
+
const dc = d ? new Date(d.toISOString()) : null;
|
|
664
|
+
if (this.datepickerService.isDifferent(d || null, dc)) {
|
|
665
|
+
if (this._initialized)
|
|
666
|
+
this.#buildDate();
|
|
667
|
+
}
|
|
668
|
+
});
|
|
669
|
+
});
|
|
670
|
+
this.months = [];
|
|
671
|
+
this.DEFAULT_FIRST_DAY_OF_WEEK = 7;
|
|
672
|
+
this._firstDayOfWeek = this.DEFAULT_FIRST_DAY_OF_WEEK;
|
|
673
|
+
this.daysOfWeek = [];
|
|
674
|
+
this.dayPeriodLabels = DEFAULT_DAY_PERIOD_LABELS;
|
|
675
|
+
this.locale = input();
|
|
676
|
+
this.#localeEffect = effect(() => {
|
|
677
|
+
this._setLocale(this.locale() || 'en');
|
|
678
|
+
});
|
|
679
|
+
this.withTime = input(false);
|
|
680
|
+
this.#withTimeEffect = effect(() => {
|
|
681
|
+
// keep to trigger effect
|
|
682
|
+
const wt = this.withTime();
|
|
683
|
+
untracked(() => {
|
|
684
|
+
const d = this.date();
|
|
685
|
+
if (d) {
|
|
686
|
+
this.time = this._dateToTime(d);
|
|
687
|
+
}
|
|
688
|
+
});
|
|
689
|
+
});
|
|
690
|
+
this.hour12 = input(false);
|
|
691
|
+
this.selectedIndex = -1;
|
|
692
|
+
this.focusedIndex = 0;
|
|
693
|
+
this._focusPos = {
|
|
694
|
+
col: 1,
|
|
695
|
+
row: 1
|
|
696
|
+
};
|
|
697
|
+
this.calendarDays = [];
|
|
698
|
+
this._numberOfWeeks = 4;
|
|
699
|
+
const d = this.date() || new Date();
|
|
700
|
+
this.selectMonthOfYear(d.getMonth(), d.getFullYear());
|
|
701
|
+
this.time = {
|
|
702
|
+
hour: d.getHours(),
|
|
703
|
+
minute: d.getMinutes()
|
|
704
|
+
};
|
|
705
|
+
}
|
|
706
|
+
_dateToTime(date) {
|
|
707
|
+
const hour = date.getHours();
|
|
708
|
+
const dayPeriod = this.hour12() ? (date.getHours() >= 12 ? 'pm' : 'am') : undefined;
|
|
709
|
+
return structuredClone({
|
|
710
|
+
hour: dayPeriod === 'pm' && hour > 12 ? hour - 12 : hour,
|
|
711
|
+
minute: date.getMinutes(),
|
|
712
|
+
dayPeriod
|
|
713
|
+
});
|
|
714
|
+
}
|
|
715
|
+
#buildDate() {
|
|
716
|
+
const _date = this.date();
|
|
717
|
+
const _withTime = this.withTime();
|
|
718
|
+
if (_date) {
|
|
719
|
+
this.selectedIndex = -1;
|
|
720
|
+
this.selectMonthOfYear(_date.getMonth(), _date.getFullYear(), true);
|
|
721
|
+
if (_withTime) {
|
|
722
|
+
this.time = this._dateToTime(_date);
|
|
723
|
+
_date.setSeconds(0, 0);
|
|
724
|
+
}
|
|
725
|
+
else {
|
|
726
|
+
_date.setHours(0, 0, 0, 0);
|
|
727
|
+
}
|
|
728
|
+
this.select(_date, true, true);
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
selectByIndex(i, setFocusPosition) {
|
|
732
|
+
const d = new Date(this.calendarDays[i].id);
|
|
733
|
+
if (this.time) {
|
|
734
|
+
d.setHours(this.time.dayPeriod === 'pm' && this.time.hour < 12 ? this.time.hour + 12 : this.time.hour);
|
|
735
|
+
d.setMinutes(this.time.minute);
|
|
736
|
+
}
|
|
737
|
+
this.select(d, setFocusPosition);
|
|
738
|
+
}
|
|
739
|
+
select(d, setFocusPosition, silent) {
|
|
740
|
+
const date = d instanceof Date ? d : new Date(d);
|
|
741
|
+
// also be aware of time
|
|
742
|
+
if (this.withTime()) {
|
|
743
|
+
const time = this._dateToTime(date);
|
|
744
|
+
if (this.time && this.time.hour === time.hour && this.time.minute === time.minute) {
|
|
745
|
+
let amPmShift = this.time.dayPeriod === 'pm' && this.time.hour !== 12 ? 12 : 0;
|
|
746
|
+
if (this.time.dayPeriod === 'am' && this.time.hour === 12)
|
|
747
|
+
amPmShift = -12;
|
|
748
|
+
date.setHours(this.time.hour + amPmShift);
|
|
749
|
+
date.setMinutes(this.time.minute, 0, 0);
|
|
750
|
+
}
|
|
751
|
+
else
|
|
752
|
+
this.time = time;
|
|
753
|
+
}
|
|
754
|
+
if (!this.onlyFutureDates() || DatepickerUtils.isFutureDate(date)) {
|
|
755
|
+
this.selectedIndex = this._getCalendarIndex(date);
|
|
756
|
+
if (setFocusPosition)
|
|
757
|
+
this._setFocusPosByCalendarIndex(this.selectedIndex);
|
|
758
|
+
this.date.update(() => date);
|
|
759
|
+
// if (!silent) this.dateChange.emit(date);
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
selectMonthOfYear(month, year, skipImmediateSelect) {
|
|
763
|
+
if (month < 0 || month > 11)
|
|
764
|
+
return;
|
|
765
|
+
if (month !== this.month)
|
|
766
|
+
this.month = month;
|
|
767
|
+
if (!this.year && !year)
|
|
768
|
+
this.year = new Date().getFullYear();
|
|
769
|
+
if (year && this.year !== year)
|
|
770
|
+
this.year = year;
|
|
771
|
+
if (this.year && this.datepickerService.yearOffset)
|
|
772
|
+
this._offsetYear = this.year + this.datepickerService.yearOffset;
|
|
773
|
+
else
|
|
774
|
+
this._offsetYear = this.year;
|
|
775
|
+
this._buildMonth(this.year, this.month);
|
|
776
|
+
const date = this.date();
|
|
777
|
+
if (!skipImmediateSelect && this.#immediatelySelect && date) {
|
|
778
|
+
let d = new Date(date);
|
|
779
|
+
d.setMonth(month);
|
|
780
|
+
if (d.getMonth() !== month) {
|
|
781
|
+
// already in the next month (e.g. going from the 31st of August to September)
|
|
782
|
+
// so we'll pick the last date of the month that has been selected
|
|
783
|
+
d = new Date(d.getFullYear(), month + 1, 0);
|
|
784
|
+
}
|
|
785
|
+
this.select(d, true);
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
selectYear(year, skipImmediateSelect) {
|
|
789
|
+
if (this.datepickerService.yearOffset)
|
|
790
|
+
year -= this.datepickerService.yearOffset;
|
|
791
|
+
if (year > this.maxYear || year < this.minYear)
|
|
792
|
+
return;
|
|
793
|
+
if (year && this.year !== year)
|
|
794
|
+
this.year = year;
|
|
795
|
+
this._buildMonth(this.year, this.month);
|
|
796
|
+
const date = this.date();
|
|
797
|
+
if (!skipImmediateSelect && this.#immediatelySelect && date) {
|
|
798
|
+
const d = new Date(date);
|
|
799
|
+
d.setFullYear(year);
|
|
800
|
+
this.select(d, true);
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
onYearInputKeydown(e) {
|
|
804
|
+
e.stopPropagation();
|
|
805
|
+
}
|
|
806
|
+
onTimeChange(e) {
|
|
807
|
+
const date = this.date();
|
|
808
|
+
if (date) {
|
|
809
|
+
let hour = e.dayPeriod === 'pm' && e.hour < 12 ? e.hour + 12 : e.hour;
|
|
810
|
+
hour = e.dayPeriod === 'am' && hour === 12 ? 0 : hour;
|
|
811
|
+
date.setHours(hour === 24 ? 0 : hour);
|
|
812
|
+
date.setMinutes(e.minute);
|
|
813
|
+
this.time = e;
|
|
814
|
+
}
|
|
815
|
+
this.date.update(() => date);
|
|
816
|
+
}
|
|
817
|
+
_setLocale(locale) {
|
|
818
|
+
this.dayPeriodLabels = this.datepickerService.getDayPeriodLabels(locale);
|
|
819
|
+
const mFormat = new Intl.DateTimeFormat(locale, { month: 'long' }).format;
|
|
820
|
+
this.months = [...Array(12).keys()].map((m) => mFormat(new Date(Date.UTC(2021, m % 12)))).map((label, index) => ({ label, value: index }));
|
|
821
|
+
const dFormat = new Intl.DateTimeFormat(locale, { weekday: 'short' }).format;
|
|
822
|
+
this._firstDayOfWeek = DatepickerUtils.getWeekInfo(this.locale() || 'en').firstDay - 1;
|
|
823
|
+
const daysOfWeekIdx = [];
|
|
824
|
+
for (let i = 0; i < 7; i++) {
|
|
825
|
+
let x = this._firstDayOfWeek + i;
|
|
826
|
+
if (x > 6)
|
|
827
|
+
x -= 7;
|
|
828
|
+
daysOfWeekIdx.push(x);
|
|
829
|
+
}
|
|
830
|
+
this.daysOfWeek = daysOfWeekIdx.map((day) => dFormat(new Date(Date.UTC(2021, 5, day))));
|
|
831
|
+
this._buildMonth(this.year, this.month);
|
|
832
|
+
}
|
|
833
|
+
_reset() {
|
|
834
|
+
this.selectedIndex = -1;
|
|
835
|
+
this.focusedIndex = 0;
|
|
836
|
+
}
|
|
837
|
+
_buildMonth(year, month) {
|
|
838
|
+
this._reset();
|
|
839
|
+
// TODO: find a more generic approach (if there actually are other first days of week than sonday and monday)
|
|
840
|
+
const startDayOffset = this._firstDayOfWeek === 0 ? -1 : 0;
|
|
841
|
+
let firstDayOfMonthInWeek = new Date(year, month).getDay() + startDayOffset;
|
|
842
|
+
if (firstDayOfMonthInWeek === -1)
|
|
843
|
+
firstDayOfMonthInWeek = 6;
|
|
844
|
+
const lastDateOfMonth = new Date(year, month + 1, 0).getDate(), lastDayOfMonthInWeek = new Date(year, month, lastDateOfMonth).getDay() + startDayOffset, lastDateOfPreviousMonth = new Date(year, month, 0).getDate();
|
|
845
|
+
const today = new Date();
|
|
846
|
+
today.setDate(today.getDate() - 1);
|
|
847
|
+
today.setHours(23, 59, 59);
|
|
848
|
+
const items = [];
|
|
849
|
+
// previous months last days
|
|
850
|
+
for (let i = firstDayOfMonthInWeek; i > 0; i--) {
|
|
851
|
+
const day = lastDateOfPreviousMonth - i + 1;
|
|
852
|
+
items.push({
|
|
853
|
+
day,
|
|
854
|
+
disabled: DatepickerUtils.isValidValue(new Date(year, month, i), {
|
|
855
|
+
onlyFutureDates: this.onlyFutureDates(),
|
|
856
|
+
withTime: this.withTime(),
|
|
857
|
+
maxDate: this.maxDate(),
|
|
858
|
+
minDate: this.minDate()
|
|
859
|
+
}),
|
|
860
|
+
inactive: true,
|
|
861
|
+
id: this._getDayId(year, month - 1, day)
|
|
862
|
+
});
|
|
863
|
+
}
|
|
864
|
+
// all days of current month
|
|
865
|
+
for (let i = 1; i <= lastDateOfMonth; i++) {
|
|
866
|
+
items.push({
|
|
867
|
+
day: i,
|
|
868
|
+
disabled: DatepickerUtils.isValidValue(new Date(year, month, i), {
|
|
869
|
+
onlyFutureDates: this.onlyFutureDates(),
|
|
870
|
+
withTime: this.withTime(),
|
|
871
|
+
maxDate: this.maxDate(),
|
|
872
|
+
minDate: this.minDate()
|
|
873
|
+
}),
|
|
874
|
+
id: this._getDayId(year, month, i)
|
|
875
|
+
});
|
|
876
|
+
}
|
|
877
|
+
// next months first days
|
|
878
|
+
for (let i = lastDayOfMonthInWeek; i < 6; i++) {
|
|
879
|
+
const day = i - lastDayOfMonthInWeek + 1;
|
|
880
|
+
items.push({
|
|
881
|
+
day,
|
|
882
|
+
inactive: true,
|
|
883
|
+
id: this._getDayId(year, month + 1, day)
|
|
884
|
+
});
|
|
885
|
+
}
|
|
886
|
+
this._numberOfWeeks = items.length / 7;
|
|
887
|
+
this.calendarDays = items;
|
|
888
|
+
const date = this.date();
|
|
889
|
+
if (date?.getMonth() === month && date?.getFullYear() === year) {
|
|
890
|
+
this.select(date, true, true);
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
_getDayId(year, month, day) {
|
|
894
|
+
const d = new Date(year, month, day);
|
|
895
|
+
return `${d.getFullYear()}-${d.getMonth() + 1}-${d.getDate()}`;
|
|
896
|
+
}
|
|
897
|
+
_handleKeyboardEvent(event) {
|
|
898
|
+
switch (event.code) {
|
|
899
|
+
case 'PageDown': {
|
|
900
|
+
// go to previous month
|
|
901
|
+
const d = new Date(this.year, this.month);
|
|
902
|
+
d.setMonth(this.month - 1);
|
|
903
|
+
this.selectMonthOfYear(d.getMonth(), d.getFullYear());
|
|
904
|
+
this._stopEvent(event);
|
|
905
|
+
break;
|
|
906
|
+
}
|
|
907
|
+
case 'PageUp': {
|
|
908
|
+
// go to next month
|
|
909
|
+
const d = new Date(this.year, this.month);
|
|
910
|
+
d.setMonth(this.month + 1);
|
|
911
|
+
this.selectMonthOfYear(d.getMonth(), d.getFullYear());
|
|
912
|
+
this._stopEvent(event);
|
|
913
|
+
break;
|
|
914
|
+
}
|
|
915
|
+
case 'Home': {
|
|
916
|
+
// focus first day of month
|
|
917
|
+
this._setFocusPosByCalendarIndex(this._getCalendarIndex(new Date(this.year, this.month, 1)));
|
|
918
|
+
this._stopEvent(event);
|
|
919
|
+
break;
|
|
920
|
+
}
|
|
921
|
+
case 'End': {
|
|
922
|
+
// focus last day of month
|
|
923
|
+
this._setFocusPosByCalendarIndex(this._getCalendarIndex(new Date(this.year, this.month + 1, 0)));
|
|
924
|
+
this._stopEvent(event);
|
|
925
|
+
break;
|
|
926
|
+
}
|
|
927
|
+
case 'Space': {
|
|
928
|
+
this.selectByIndex(this.focusedIndex, false);
|
|
929
|
+
this._stopEvent(event);
|
|
930
|
+
break;
|
|
931
|
+
}
|
|
932
|
+
case 'ArrowUp': {
|
|
933
|
+
let row = this._focusPos.row - 1;
|
|
934
|
+
if (row <= 0)
|
|
935
|
+
row = this._numberOfWeeks;
|
|
936
|
+
this._setFocusPos(row, undefined);
|
|
937
|
+
this._stopEvent(event);
|
|
938
|
+
break;
|
|
939
|
+
}
|
|
940
|
+
case 'ArrowDown': {
|
|
941
|
+
let row = this._focusPos.row + 1;
|
|
942
|
+
if (row > this._numberOfWeeks)
|
|
943
|
+
row = 1;
|
|
944
|
+
this._setFocusPos(row, undefined);
|
|
945
|
+
this._stopEvent(event);
|
|
946
|
+
break;
|
|
947
|
+
}
|
|
948
|
+
case 'ArrowRight': {
|
|
949
|
+
let col = this._focusPos.col + 1;
|
|
950
|
+
let row = this._focusPos.row;
|
|
951
|
+
if (col > 7) {
|
|
952
|
+
col = 1;
|
|
953
|
+
row++;
|
|
954
|
+
if (row > this._numberOfWeeks) {
|
|
955
|
+
// go to next month
|
|
956
|
+
const d = new Date(this.calendarDays[this.calendarDays.length - 1].id);
|
|
957
|
+
d.setDate(d.getDate() + 1);
|
|
958
|
+
row = col = 1;
|
|
959
|
+
this.selectMonthOfYear(d.getMonth(), d.getFullYear());
|
|
960
|
+
}
|
|
961
|
+
}
|
|
962
|
+
this._setFocusPos(row, col);
|
|
963
|
+
this._stopEvent(event);
|
|
964
|
+
break;
|
|
965
|
+
}
|
|
966
|
+
case 'ArrowLeft': {
|
|
967
|
+
let col = this._focusPos.col - 1;
|
|
968
|
+
let row = this._focusPos.row;
|
|
969
|
+
if (col <= 0) {
|
|
970
|
+
col = 7;
|
|
971
|
+
row--;
|
|
972
|
+
if (row <= 0) {
|
|
973
|
+
// go to previous month
|
|
974
|
+
const d = new Date(this.calendarDays[0].id);
|
|
975
|
+
d.setDate(d.getDate() - 1);
|
|
976
|
+
row = this._numberOfWeeks;
|
|
977
|
+
col = 7;
|
|
978
|
+
this.selectMonthOfYear(d.getMonth(), d.getFullYear());
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
this._setFocusPos(row, col);
|
|
982
|
+
this._stopEvent(event);
|
|
983
|
+
break;
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
}
|
|
987
|
+
_getCalendarIndex(date) {
|
|
988
|
+
return this.calendarDays.findIndex((cd) => cd.id === this._getDayId(date.getFullYear(), date.getMonth(), date.getDate()));
|
|
989
|
+
}
|
|
990
|
+
_stopEvent(e) {
|
|
991
|
+
if (e) {
|
|
992
|
+
e.stopPropagation();
|
|
993
|
+
e.preventDefault();
|
|
994
|
+
}
|
|
995
|
+
}
|
|
996
|
+
_setFocusPos(row, col) {
|
|
997
|
+
if (row !== undefined)
|
|
998
|
+
this._focusPos.row = row;
|
|
999
|
+
if (col !== undefined)
|
|
1000
|
+
this._focusPos.col = col;
|
|
1001
|
+
this.focusedIndex = (this._focusPos.row - 1) * 7 + this._focusPos.col - 1;
|
|
1002
|
+
}
|
|
1003
|
+
_setFocusPosByCalendarIndex(index) {
|
|
1004
|
+
this.focusedIndex = index;
|
|
1005
|
+
this._focusPos = {
|
|
1006
|
+
col: (this.focusedIndex % 7) + 1,
|
|
1007
|
+
row: Math.round(this.focusedIndex / this._numberOfWeeks)
|
|
1008
|
+
};
|
|
1009
|
+
}
|
|
1010
|
+
ngOnInit() {
|
|
1011
|
+
// this.locale = !this.locale ? 'en' : this.locale;
|
|
1012
|
+
this._initialized = true;
|
|
1013
|
+
this.#buildDate();
|
|
1014
|
+
}
|
|
1015
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: CalendarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1016
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.11", type: CalendarComponent, isStandalone: true, selector: "yuv-calendar", inputs: { minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: true, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: true, isRequired: false, transformFunction: null }, onlyFutureDates: { classPropertyName: "onlyFutureDates", publicName: "onlyFutureDates", isSignal: true, isRequired: false, transformFunction: null }, date: { classPropertyName: "date", publicName: "date", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null }, withTime: { classPropertyName: "withTime", publicName: "withTime", isSignal: true, isRequired: false, transformFunction: null }, hour12: { classPropertyName: "hour12", publicName: "hour12", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { date: "dateChange" }, host: { attributes: { "tabindex": "0" }, listeners: { "keydown": "keyDownHandler($event)" } }, providers: [DatepickerService], viewQueries: [{ propertyName: "calEl", first: true, predicate: ["cal"], descendants: true, isSignal: true }], ngImport: i0, template: "<section class=\"date\">\n <header>\n <div class=\"month-picker\">\n <mat-select [panelWidth]=\"null\" [(ngModel)]=\"month\" (ngModelChange)=\"selectMonthOfYear($event)\">\n <mat-select-trigger>\n {{ month !== undefined ? months[month].label : '' }} \n </mat-select-trigger>\n @for (m of months; track $index) {\n <mat-option [value]=\"m.value\">{{ m.label }}</mat-option>\n }\n </mat-select>\n </div>\n\n <input\n class=\"year-picker\"\n name=\"year\"\n type=\"number\"\n [min]=\"minYear\"\n [max]=\"maxYear\"\n [(ngModel)]=\"_offsetYear\"\n (keydown)=\"onYearInputKeydown($event)\"\n (ngModelChange)=\"selectYear($event)\"\n />\n </header>\n <main>\n <ul class=\"daysOfWeek\">\n @for (d of daysOfWeek; track d) {\n <li>{{ d }}</li>\n }\n </ul>\n <ul class=\"days\">\n @for (d of calendarDays; track d; let i = $index) {\n <li\n [attr.data-day]=\"d.id\"\n (click)=\"selectByIndex(i, true)\"\n [ngClass]=\"{\n disabled: d.disabled,\n inactive: d.inactive,\n focused: i === focusedIndex,\n selected: i === selectedIndex\n }\"\n >\n {{ d.day }}\n </li>\n }\n </ul>\n </main>\n</section>\n@if (withTime()) {\n <section class=\"time\">\n <yuv-time-input [(ngModel)]=\"time\" [hour12]=\"hour12()\" [dayPeriodLabels]=\"dayPeriodLabels\" (ngModelChange)=\"onTimeChange($event)\"></yuv-time-input>\n </section>\n}\n", styles: [":host{--_calendar-item-size: var(--calendar-item-size, 3em);--_calendar-item-border-size: var(--calendar-item-border-size, 2px);display:inline-flex;flex-flow:row wrap}:host section.date{max-width:calc(var(--_calendar-item-size) * 11)}:host section.time{display:flex;align-items:center;margin-inline-start:var(--ymt-spacing-m)}:host *:focus:not(:focus-visible){outline:none}:host header{display:flex;align-items:center;justify-content:space-between}:host header mat-select,:host header input.year-picker{border:1px solid transparent;border-radius:var(--ymt-corner-xs)}:host header mat-select:focus,:host header input.year-picker:focus{border-color:var(--ymt-primary)}:host header mat-select{padding:var(--ymt-spacing-2xs) var(--ymt-spacing-xs)}:host header input.year-picker{background-color:transparent;text-align:end;font-size:2.5em;width:5ch;color:var(--ymt-text-color-subtle);-moz-appearance:textfield}:host header input.year-picker::-webkit-outer-spin-button,:host header input.year-picker::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}:host main{padding:0}:host main ul li.focused:before{outline:var(--_calendar-item-border-size) solid var(--ymt-text-color-subtle);outline-offset:2px}:host ul{list-style:none;display:flex;flex-wrap:wrap;text-align:center;padding:0;min-width:calc(var(--_calendar-item-size) * 7 + .5em)}:host ul.daysOfWeek li{font-weight:700;color:var(--ymt-text-color-subtle)}:host ul.days li:before{display:block;position:absolute;content:\"\";width:calc(var(--_calendar-item-size) - var(--_calendar-item-border-size) * 4);height:calc(var(--_calendar-item-size) - var(--_calendar-item-border-size) * 4);border-radius:var(--ymt-corner-full);top:50%;left:50%;transform:translate(-50%,-50%);z-index:-1;opacity:0;pointer-events:none;transition:opacity .2s ease-in-out}:host ul.days li{position:relative;min-width:var(--_calendar-item-size);z-index:1;line-height:1em;cursor:pointer;color:var(--ymt-text-color);height:var(--_calendar-item-size);display:flex;flex-flow:column;align-items:center;justify-content:center}:host ul.days li.focused{color:var(--ymt-on-focus-background)}:host ul.days li.focused:before{background-color:var(--ymt-focus-background)}:host ul.days li.inactive:not(.disabled){opacity:.5}:host ul.days li.disabled{opacity:.5;cursor:default}:host ul.days li.selected{color:var(--ymt-on-selection-background)}:host ul.days li.selected:before{background-color:var(--ymt-selection-background);outline-color:var(--ymt-selection-background);opacity:1}:host ul.days li:not(.selected,.disabled).focused:before,:host ul.days li:not(.selected,.disabled):hover:before{opacity:1}:host ul li{position:relative;width:14.2857142857%}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i1.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i3.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "directive", type: i3.MatSelectTrigger, selector: "mat-select-trigger" }, { kind: "component", type: i3.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: TimeInputComponent, selector: "yuv-time-input", inputs: ["hour12", "dayPeriodLabels"] }] }); }
|
|
1017
|
+
}
|
|
1018
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: CalendarComponent, decorators: [{
|
|
1019
|
+
type: Component,
|
|
1020
|
+
args: [{ selector: 'yuv-calendar', standalone: true, imports: [CommonModule, FormsModule, MatSelectModule, TimeInputComponent], providers: [DatepickerService], host: {
|
|
1021
|
+
tabindex: '0'
|
|
1022
|
+
}, template: "<section class=\"date\">\n <header>\n <div class=\"month-picker\">\n <mat-select [panelWidth]=\"null\" [(ngModel)]=\"month\" (ngModelChange)=\"selectMonthOfYear($event)\">\n <mat-select-trigger>\n {{ month !== undefined ? months[month].label : '' }} \n </mat-select-trigger>\n @for (m of months; track $index) {\n <mat-option [value]=\"m.value\">{{ m.label }}</mat-option>\n }\n </mat-select>\n </div>\n\n <input\n class=\"year-picker\"\n name=\"year\"\n type=\"number\"\n [min]=\"minYear\"\n [max]=\"maxYear\"\n [(ngModel)]=\"_offsetYear\"\n (keydown)=\"onYearInputKeydown($event)\"\n (ngModelChange)=\"selectYear($event)\"\n />\n </header>\n <main>\n <ul class=\"daysOfWeek\">\n @for (d of daysOfWeek; track d) {\n <li>{{ d }}</li>\n }\n </ul>\n <ul class=\"days\">\n @for (d of calendarDays; track d; let i = $index) {\n <li\n [attr.data-day]=\"d.id\"\n (click)=\"selectByIndex(i, true)\"\n [ngClass]=\"{\n disabled: d.disabled,\n inactive: d.inactive,\n focused: i === focusedIndex,\n selected: i === selectedIndex\n }\"\n >\n {{ d.day }}\n </li>\n }\n </ul>\n </main>\n</section>\n@if (withTime()) {\n <section class=\"time\">\n <yuv-time-input [(ngModel)]=\"time\" [hour12]=\"hour12()\" [dayPeriodLabels]=\"dayPeriodLabels\" (ngModelChange)=\"onTimeChange($event)\"></yuv-time-input>\n </section>\n}\n", styles: [":host{--_calendar-item-size: var(--calendar-item-size, 3em);--_calendar-item-border-size: var(--calendar-item-border-size, 2px);display:inline-flex;flex-flow:row wrap}:host section.date{max-width:calc(var(--_calendar-item-size) * 11)}:host section.time{display:flex;align-items:center;margin-inline-start:var(--ymt-spacing-m)}:host *:focus:not(:focus-visible){outline:none}:host header{display:flex;align-items:center;justify-content:space-between}:host header mat-select,:host header input.year-picker{border:1px solid transparent;border-radius:var(--ymt-corner-xs)}:host header mat-select:focus,:host header input.year-picker:focus{border-color:var(--ymt-primary)}:host header mat-select{padding:var(--ymt-spacing-2xs) var(--ymt-spacing-xs)}:host header input.year-picker{background-color:transparent;text-align:end;font-size:2.5em;width:5ch;color:var(--ymt-text-color-subtle);-moz-appearance:textfield}:host header input.year-picker::-webkit-outer-spin-button,:host header input.year-picker::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}:host main{padding:0}:host main ul li.focused:before{outline:var(--_calendar-item-border-size) solid var(--ymt-text-color-subtle);outline-offset:2px}:host ul{list-style:none;display:flex;flex-wrap:wrap;text-align:center;padding:0;min-width:calc(var(--_calendar-item-size) * 7 + .5em)}:host ul.daysOfWeek li{font-weight:700;color:var(--ymt-text-color-subtle)}:host ul.days li:before{display:block;position:absolute;content:\"\";width:calc(var(--_calendar-item-size) - var(--_calendar-item-border-size) * 4);height:calc(var(--_calendar-item-size) - var(--_calendar-item-border-size) * 4);border-radius:var(--ymt-corner-full);top:50%;left:50%;transform:translate(-50%,-50%);z-index:-1;opacity:0;pointer-events:none;transition:opacity .2s ease-in-out}:host ul.days li{position:relative;min-width:var(--_calendar-item-size);z-index:1;line-height:1em;cursor:pointer;color:var(--ymt-text-color);height:var(--_calendar-item-size);display:flex;flex-flow:column;align-items:center;justify-content:center}:host ul.days li.focused{color:var(--ymt-on-focus-background)}:host ul.days li.focused:before{background-color:var(--ymt-focus-background)}:host ul.days li.inactive:not(.disabled){opacity:.5}:host ul.days li.disabled{opacity:.5;cursor:default}:host ul.days li.selected{color:var(--ymt-on-selection-background)}:host ul.days li.selected:before{background-color:var(--ymt-selection-background);outline-color:var(--ymt-selection-background);opacity:1}:host ul.days li:not(.selected,.disabled).focused:before,:host ul.days li:not(.selected,.disabled):hover:before{opacity:1}:host ul li{position:relative;width:14.2857142857%}\n"] }]
|
|
1023
|
+
}], ctorParameters: () => [], propDecorators: { keyDownHandler: [{
|
|
1024
|
+
type: HostListener,
|
|
1025
|
+
args: ['keydown', ['$event']]
|
|
1026
|
+
}] } });
|
|
1027
|
+
|
|
1028
|
+
/**
|
|
1029
|
+
*
|
|
1030
|
+
*/
|
|
1031
|
+
class DateInputComponent {
|
|
1032
|
+
set disabled(d) {
|
|
1033
|
+
this._disabled = d;
|
|
1034
|
+
if (d) {
|
|
1035
|
+
this.dateInputForm?.disable();
|
|
1036
|
+
}
|
|
1037
|
+
else {
|
|
1038
|
+
this.dateInputForm?.enable();
|
|
1039
|
+
}
|
|
1040
|
+
}
|
|
1041
|
+
set placeholder(p) {
|
|
1042
|
+
this._placeholder = p;
|
|
1043
|
+
this._refreshPlaceholder = false;
|
|
1044
|
+
}
|
|
1045
|
+
set withTime(b) {
|
|
1046
|
+
this._withTime = b;
|
|
1047
|
+
if (b !== undefined)
|
|
1048
|
+
this._init();
|
|
1049
|
+
}
|
|
1050
|
+
get withTime() {
|
|
1051
|
+
return this._withTime;
|
|
1052
|
+
}
|
|
1053
|
+
set hour12(b) {
|
|
1054
|
+
if (b === this._hour12)
|
|
1055
|
+
return;
|
|
1056
|
+
this._hour12 = b;
|
|
1057
|
+
if (b !== undefined)
|
|
1058
|
+
this._init(true);
|
|
1059
|
+
}
|
|
1060
|
+
get hour12() {
|
|
1061
|
+
return this._hour12;
|
|
1062
|
+
}
|
|
1063
|
+
get hoursControl() {
|
|
1064
|
+
return this.dateInputForm.controls['hour'];
|
|
1065
|
+
}
|
|
1066
|
+
constructor(datepickerService, fb, elRef) {
|
|
1067
|
+
this.datepickerService = datepickerService;
|
|
1068
|
+
this.fb = fb;
|
|
1069
|
+
this.elRef = elRef;
|
|
1070
|
+
this._subs = [];
|
|
1071
|
+
this._date = null;
|
|
1072
|
+
this._disabled = false;
|
|
1073
|
+
this._refreshPlaceholder = true;
|
|
1074
|
+
this._locale = this.datepickerService.DEFAULT_LANGUAGE;
|
|
1075
|
+
this._withTime = false;
|
|
1076
|
+
this._hour12 = false;
|
|
1077
|
+
// @Output() blur = new EventEmitter<any>();
|
|
1078
|
+
// @Output() focus = new EventEmitter<any>();
|
|
1079
|
+
this.dateTokens = [];
|
|
1080
|
+
this.dayPeriodLabels = {
|
|
1081
|
+
am: 'AM',
|
|
1082
|
+
pm: 'PM'
|
|
1083
|
+
};
|
|
1084
|
+
this._placeholderVisible = true;
|
|
1085
|
+
}
|
|
1086
|
+
_setupForm() {
|
|
1087
|
+
const dateTokens = this._getPatch(this._date);
|
|
1088
|
+
const dateCfg = {
|
|
1089
|
+
day: [dateTokens.day, [Validators.max(31), Validators.minLength(2)]],
|
|
1090
|
+
month: [dateTokens.month, [Validators.max(12), Validators.minLength(2)]],
|
|
1091
|
+
year: [dateTokens.year, [Validators.minLength(4)]]
|
|
1092
|
+
};
|
|
1093
|
+
const timeCfg = {
|
|
1094
|
+
hour: [dateTokens.hour, [Validators.minLength(2)]],
|
|
1095
|
+
minute: [dateTokens.minute, [Validators.max(59), Validators.minLength(2)]]
|
|
1096
|
+
};
|
|
1097
|
+
this.dateInputForm = this.fb.group(this.withTime ? { ...dateCfg, ...timeCfg } : dateCfg, {
|
|
1098
|
+
validators: (g) => {
|
|
1099
|
+
let valueCount = 0;
|
|
1100
|
+
Object.keys(g.value).forEach((k) => {
|
|
1101
|
+
if (g.value[k] && `${g.value[k]?.length}`)
|
|
1102
|
+
valueCount++;
|
|
1103
|
+
});
|
|
1104
|
+
return valueCount === 0 || valueCount === Object.keys(g.value).length
|
|
1105
|
+
? null
|
|
1106
|
+
: {
|
|
1107
|
+
missingValue: true
|
|
1108
|
+
};
|
|
1109
|
+
}
|
|
1110
|
+
});
|
|
1111
|
+
if (this._formValueSub) {
|
|
1112
|
+
this._formValueSub.unsubscribe();
|
|
1113
|
+
this._formValueSub = undefined;
|
|
1114
|
+
this._formStateSub.unsubscribe();
|
|
1115
|
+
this._formStateSub = undefined;
|
|
1116
|
+
}
|
|
1117
|
+
this._disabled && this.dateInputForm?.disable();
|
|
1118
|
+
this._formValueSub = this.dateInputForm.valueChanges.subscribe({
|
|
1119
|
+
next: (v) => {
|
|
1120
|
+
this._checkAndPropagateForm();
|
|
1121
|
+
}
|
|
1122
|
+
});
|
|
1123
|
+
this._formStateSub = this.dateInputForm.statusChanges.subscribe({
|
|
1124
|
+
next: (v) => {
|
|
1125
|
+
this._setInvalidInputError(v === 'INVALID');
|
|
1126
|
+
}
|
|
1127
|
+
});
|
|
1128
|
+
}
|
|
1129
|
+
_setInvalidInputError(isInvalid) {
|
|
1130
|
+
if (isInvalid) {
|
|
1131
|
+
this.datepickerService.setErrors({
|
|
1132
|
+
invalidInput: true
|
|
1133
|
+
});
|
|
1134
|
+
}
|
|
1135
|
+
else {
|
|
1136
|
+
this.datepickerService.removeErrors(['invalidInput']);
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
_checkAndPropagateForm() {
|
|
1140
|
+
if (this.dateInputForm?.status === 'VALID') {
|
|
1141
|
+
this._date = this._formToDate(this.dateInputForm);
|
|
1142
|
+
this.datepickerService.setValue(this._date);
|
|
1143
|
+
}
|
|
1144
|
+
}
|
|
1145
|
+
_formToDate(g) {
|
|
1146
|
+
// starting with a year of '0000' because there could be negative values
|
|
1147
|
+
// that would break the date creation using string parameter
|
|
1148
|
+
let dateString = `0000-${g.controls['month'].value}-${g.controls['day'].value}`;
|
|
1149
|
+
if (this.withTime) {
|
|
1150
|
+
const strHour = g.controls['hour'].value;
|
|
1151
|
+
let hour = strHour?.length ? parseInt(strHour) : -1;
|
|
1152
|
+
if (this.hour12) {
|
|
1153
|
+
hour = this.currentDayPeriod === 'pm' && hour < 12 ? hour + 12 : hour;
|
|
1154
|
+
hour = this.currentDayPeriod === 'am' && hour === 12 ? 0 : hour;
|
|
1155
|
+
hour = hour === 24 ? 0 : hour;
|
|
1156
|
+
}
|
|
1157
|
+
dateString += `T${hour < 10 ? `0${hour}` : `${hour}`}:${g.controls['minute'].value}:00`;
|
|
1158
|
+
}
|
|
1159
|
+
const date = new Date(dateString);
|
|
1160
|
+
let isValidDateObject = !!date && Object.prototype.toString.call(date) === '[object Date]' && !isNaN(date.getTime());
|
|
1161
|
+
if (isValidDateObject) {
|
|
1162
|
+
// set the year independently
|
|
1163
|
+
const parsedYear = parseInt(g.controls['year'].value);
|
|
1164
|
+
if (!isNaN(parsedYear)) {
|
|
1165
|
+
date.setFullYear(parsedYear);
|
|
1166
|
+
}
|
|
1167
|
+
else {
|
|
1168
|
+
isValidDateObject = false;
|
|
1169
|
+
}
|
|
1170
|
+
}
|
|
1171
|
+
this._setInvalidInputError(!isValidDateObject);
|
|
1172
|
+
return isValidDateObject ? date : null;
|
|
1173
|
+
}
|
|
1174
|
+
_focusInput(offset) {
|
|
1175
|
+
const inputs = this._getFocusableElements();
|
|
1176
|
+
let i = inputs.findIndex((i) => i === document.activeElement);
|
|
1177
|
+
i = i + offset;
|
|
1178
|
+
if (i > inputs.length - 1)
|
|
1179
|
+
i = 0;
|
|
1180
|
+
if (i < 0)
|
|
1181
|
+
i = inputs.length - 1;
|
|
1182
|
+
inputs[i].focus();
|
|
1183
|
+
}
|
|
1184
|
+
onPlaceholderFocus() {
|
|
1185
|
+
this.focusFirstInput();
|
|
1186
|
+
}
|
|
1187
|
+
onDateInputFocus() {
|
|
1188
|
+
// this.focus.emit();
|
|
1189
|
+
this._placeholderVisible = false;
|
|
1190
|
+
}
|
|
1191
|
+
onDateInputBlur() {
|
|
1192
|
+
let hasValue = false;
|
|
1193
|
+
Object.keys(this.dateInputForm?.value || {}).forEach((k) => {
|
|
1194
|
+
if (!hasValue && !!this.dateInputForm?.value[k])
|
|
1195
|
+
hasValue = true;
|
|
1196
|
+
});
|
|
1197
|
+
// if (hasValue) this.elRef.nativeElement.classList.add('is-dirty');
|
|
1198
|
+
// else this.elRef.nativeElement.classList.remove('is-dirty');
|
|
1199
|
+
this.elRef.nativeElement.classList.toggle('is-dirty', hasValue);
|
|
1200
|
+
this._placeholderVisible = !hasValue;
|
|
1201
|
+
// this.blur.emit();
|
|
1202
|
+
}
|
|
1203
|
+
focusFirstInput() {
|
|
1204
|
+
this._getFocusableElements()[0].focus();
|
|
1205
|
+
}
|
|
1206
|
+
_getFocusableElements() {
|
|
1207
|
+
return Array.from(this.elRef.nativeElement.querySelectorAll('input:not([inert])'));
|
|
1208
|
+
}
|
|
1209
|
+
_getPatch(d) {
|
|
1210
|
+
const patch = {
|
|
1211
|
+
day: undefined,
|
|
1212
|
+
month: undefined,
|
|
1213
|
+
year: undefined,
|
|
1214
|
+
hour: undefined,
|
|
1215
|
+
minute: undefined
|
|
1216
|
+
};
|
|
1217
|
+
if (d) {
|
|
1218
|
+
// year may have an offset (e.g. locale 'th')
|
|
1219
|
+
// Intl would return the offsetted value therefore we get the year from the date itself
|
|
1220
|
+
patch.year = d.getFullYear();
|
|
1221
|
+
const l = patch.year.length;
|
|
1222
|
+
if (l > 0 && l !== 4) {
|
|
1223
|
+
patch.year = `${[...Array(4 - l).keys()].map((_) => '0').join('')}${patch.year}`;
|
|
1224
|
+
}
|
|
1225
|
+
Intl.DateTimeFormat(this._locale, this._intlOptions)
|
|
1226
|
+
.formatToParts(d)
|
|
1227
|
+
.forEach((t) => {
|
|
1228
|
+
switch (t.type) {
|
|
1229
|
+
case 'day': {
|
|
1230
|
+
patch.day = t.value;
|
|
1231
|
+
break;
|
|
1232
|
+
}
|
|
1233
|
+
case 'month': {
|
|
1234
|
+
patch.month = t.value;
|
|
1235
|
+
break;
|
|
1236
|
+
}
|
|
1237
|
+
case 'hour': {
|
|
1238
|
+
patch.hour = t.value === '24' ? '0' : t.value;
|
|
1239
|
+
break;
|
|
1240
|
+
}
|
|
1241
|
+
case 'minute': {
|
|
1242
|
+
patch.minute = t.value;
|
|
1243
|
+
break;
|
|
1244
|
+
}
|
|
1245
|
+
case 'dayPeriod': {
|
|
1246
|
+
this.currentDayPeriod = t.value === 'AM' ? 'am' : 'pm';
|
|
1247
|
+
break;
|
|
1248
|
+
}
|
|
1249
|
+
}
|
|
1250
|
+
});
|
|
1251
|
+
}
|
|
1252
|
+
return patch;
|
|
1253
|
+
}
|
|
1254
|
+
reset() {
|
|
1255
|
+
this.datepickerService.setValue(null);
|
|
1256
|
+
}
|
|
1257
|
+
getFormattedValue() {
|
|
1258
|
+
return this._date ? Intl.DateTimeFormat(this._locale, this._intlOptions).format(this._date) : null;
|
|
1259
|
+
}
|
|
1260
|
+
onInputNext() {
|
|
1261
|
+
this._focusInput(1);
|
|
1262
|
+
}
|
|
1263
|
+
onInputPrev() {
|
|
1264
|
+
this._focusInput(-1);
|
|
1265
|
+
}
|
|
1266
|
+
toggleDayPeriod() {
|
|
1267
|
+
this.currentDayPeriod = this.currentDayPeriod === 'pm' ? 'am' : 'pm';
|
|
1268
|
+
this._checkAndPropagateForm();
|
|
1269
|
+
}
|
|
1270
|
+
_init(skipFormSetup = false) {
|
|
1271
|
+
this._setPlaceholder();
|
|
1272
|
+
this._intlOptions = this.datepickerService.getIntlOptions(this.withTime, this.hour12);
|
|
1273
|
+
const d = this._date || new Date();
|
|
1274
|
+
this.dateTokens = new Intl.DateTimeFormat(this._locale, this._intlOptions).formatToParts(d);
|
|
1275
|
+
if (this.hour12) {
|
|
1276
|
+
this.currentDayPeriod = d.getHours() > 12 ? 'pm' : 'am';
|
|
1277
|
+
this.dayPeriodLabels = this.datepickerService.getDayPeriodLabels(this._locale);
|
|
1278
|
+
}
|
|
1279
|
+
if (!skipFormSetup)
|
|
1280
|
+
this._setupForm();
|
|
1281
|
+
}
|
|
1282
|
+
_setPlaceholder() {
|
|
1283
|
+
this.placeholder = this.datepickerService.getDatePattern(this._locale, this.withTime, this.hour12);
|
|
1284
|
+
}
|
|
1285
|
+
ngOnInit() {
|
|
1286
|
+
this._subs.push(this.datepickerService.language$.subscribe({
|
|
1287
|
+
next: (lang) => {
|
|
1288
|
+
if (lang !== this._locale) {
|
|
1289
|
+
this._locale = lang;
|
|
1290
|
+
this._init(true);
|
|
1291
|
+
if (this._refreshPlaceholder)
|
|
1292
|
+
this._setPlaceholder();
|
|
1293
|
+
}
|
|
1294
|
+
}
|
|
1295
|
+
}));
|
|
1296
|
+
this._subs.push(this.datepickerService.valueChange$.subscribe({
|
|
1297
|
+
next: (vc) => {
|
|
1298
|
+
this._date = vc.value;
|
|
1299
|
+
this.dateAttribute = this.getFormattedValue() || undefined;
|
|
1300
|
+
this.dateInputForm.patchValue(this._getPatch(vc.value), {
|
|
1301
|
+
emitEvent: false
|
|
1302
|
+
});
|
|
1303
|
+
// this.dateInputForm?.updateValueAndValidity()
|
|
1304
|
+
}
|
|
1305
|
+
}));
|
|
1306
|
+
this._init();
|
|
1307
|
+
}
|
|
1308
|
+
ngOnDestroy() {
|
|
1309
|
+
if (this._formValueSub)
|
|
1310
|
+
this._formValueSub.unsubscribe();
|
|
1311
|
+
if (this._formStateSub)
|
|
1312
|
+
this._formStateSub.unsubscribe();
|
|
1313
|
+
this._subs.forEach((s) => s.unsubscribe());
|
|
1314
|
+
}
|
|
1315
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DateInputComponent, deps: [{ token: DatepickerService }, { token: i1.FormBuilder }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1316
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.11", type: DateInputComponent, isStandalone: true, selector: "yuv-date-input", inputs: { disabled: "disabled", placeholder: "placeholder", withTime: "withTime", hour12: "hour12" }, host: { properties: { "class.has-value": "this._date", "attr.data-datevalue": "this.dateAttribute" } }, viewQueries: [{ propertyName: "dateInputEls", predicate: DateInputElementComponent, descendants: true, read: ElementRef }], ngImport: i0, template: "@if (dateInputForm) {\n <form [formGroup]=\"dateInputForm!\" (yuvFocusWithin)=\"onDateInputFocus()\" (yuvFocusWithinBlur)=\"onDateInputBlur()\">\n @for (t of dateTokens; track t) {\n @switch (t.type) {\n <!-- day -->\n @case ('day') {\n <yuv-date-input-element\n placeholder=\"dd\"\n [ngClass]=\"{ disabled: dateInputForm.disabled }\"\n [attr.aria-disabled]=\"dateInputForm.disabled\"\n formControlName=\"day\"\n [maxLength]=\"2\"\n [minValue]=\"1\"\n [maxValue]=\"31\"\n (prev)=\"onInputPrev()\"\n (next)=\"onInputNext()\"\n ></yuv-date-input-element>\n }\n <!-- month -->\n @case ('month') {\n <yuv-date-input-element\n placeholder=\"MM\"\n [ngClass]=\"{ disabled: dateInputForm.disabled }\"\n [attr.aria-disabled]=\"dateInputForm.disabled\"\n formControlName=\"month\"\n [maxLength]=\"2\"\n [minValue]=\"1\"\n [maxValue]=\"12\"\n (prev)=\"onInputPrev()\"\n (next)=\"onInputNext()\"\n ></yuv-date-input-element>\n }\n <!-- year -->\n @case ('year') {\n <yuv-date-input-element\n placeholder=\"yyyy\"\n class=\"year\"\n [ngClass]=\"{ disabled: dateInputForm.disabled }\"\n [attr.aria-disabled]=\"dateInputForm.disabled\"\n formControlName=\"year\"\n [maxLength]=\"4\"\n (prev)=\"onInputPrev()\"\n (next)=\"onInputNext()\"\n ></yuv-date-input-element>\n }\n <!-- hours -->\n @case ('hour') {\n <yuv-date-input-hour-element\n placeholder=\"HH\"\n [ngClass]=\"{ disabled: dateInputForm.disabled }\"\n [attr.aria-disabled]=\"dateInputForm.disabled\"\n [(dayPeriod)]=\"currentDayPeriod\"\n formControlName=\"hour\"\n [maxLength]=\"2\"\n (prev)=\"onInputPrev()\"\n (next)=\"onInputNext()\"\n ></yuv-date-input-hour-element>\n }\n <!-- minutes -->\n @case ('minute') {\n <yuv-date-input-element\n placeholder=\"mm\"\n [ngClass]=\"{ disabled: dateInputForm.disabled }\"\n [attr.aria-disabled]=\"dateInputForm.disabled\"\n [minValue]=\"0\"\n [maxValue]=\"59\"\n formControlName=\"minute\"\n [maxLength]=\"2\"\n (prev)=\"onInputPrev()\"\n (next)=\"onInputNext()\"\n ></yuv-date-input-element>\n }\n @case ('literal') {\n <!-- <span>{{ t.value }}</span> -->\n <input type=\"text\" class=\"literal\" [value]=\"t.value\" readonly inert />\n }\n @case ('dayPeriod') {\n <button type=\"button\" class=\"dayPeriod\" [disabled]=\"dateInputForm.disabled\" (click)=\"toggleDayPeriod()\">\n {{ dayPeriodLabels[currentDayPeriod!] }}\n </button>\n }\n }\n }\n </form>\n}\n@if (_placeholderVisible) {\n <input class=\"placeholder\" [placeholder]=\"_placeholder\" (focus)=\"onPlaceholderFocus()\" />\n}\n", styles: [":host{display:inline-grid;outline:0;align-items:center;grid-template-rows:1fr;grid-template-columns:1fr}:host yuv-date-input-hour-element,:host yuv-date-input-element{border:0;border-block-end:1px solid transparent;box-sizing:border-box}:host input.literal{width:1ch;text-align:center;font-size:var(--_datepicker-font-size);padding:0;border:0;background-color:transparent;border-block-end:1px solid transparent;color:var(--_datepicker-text-color)}:host:focus-within yuv-date-input-hour-element,:host:focus-within yuv-date-input-element{border-color:var(--_datepicker-input-focus-border-color)}:host:focus-within form{opacity:1}:host:focus-within .placeholder{opacity:0;outline:2px solid red;pointer-events:none}:host.is-dirty form,:host.has-value form{opacity:1}:host.is-dirty .placeholder,:host.has-value .placeholder{opacity:0}:host .placeholder{grid-row:1;grid-column:1;font-size:var(--_datepicker-font-size);width:100%;padding:0;flex:1;line-height:1em;border:0;background-color:transparent;transition:opacity .2s ease-in-out}:host form{transition:opacity .2s ease-in-out;grid-row:1;grid-column:1;display:flex;opacity:0;align-items:flex-end;gap:.1em}:host form button.dayPeriod{font-family:monospace;padding:0}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: FocusWithinDirective, selector: "[yuvFocusWithin]", outputs: ["yuvFocusWithin", "yuvFocusWithinBlur"] }, { kind: "component", type: DateInputHourElementComponent, selector: "yuv-date-input-hour-element", inputs: ["dayPeriod"], outputs: ["dayPeriodChange"] }, { kind: "component", type: DateInputElementComponent, selector: "yuv-date-input-element", inputs: ["maxLength", "maxValue", "minValue", "disabled", "placeholder"], outputs: ["next", "prev"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }] }); }
|
|
1317
|
+
}
|
|
1318
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DateInputComponent, decorators: [{
|
|
1319
|
+
type: Component,
|
|
1320
|
+
args: [{ selector: 'yuv-date-input', standalone: true, imports: [CommonModule, FocusWithinDirective, DateInputHourElementComponent, DateInputElementComponent, ReactiveFormsModule], template: "@if (dateInputForm) {\n <form [formGroup]=\"dateInputForm!\" (yuvFocusWithin)=\"onDateInputFocus()\" (yuvFocusWithinBlur)=\"onDateInputBlur()\">\n @for (t of dateTokens; track t) {\n @switch (t.type) {\n <!-- day -->\n @case ('day') {\n <yuv-date-input-element\n placeholder=\"dd\"\n [ngClass]=\"{ disabled: dateInputForm.disabled }\"\n [attr.aria-disabled]=\"dateInputForm.disabled\"\n formControlName=\"day\"\n [maxLength]=\"2\"\n [minValue]=\"1\"\n [maxValue]=\"31\"\n (prev)=\"onInputPrev()\"\n (next)=\"onInputNext()\"\n ></yuv-date-input-element>\n }\n <!-- month -->\n @case ('month') {\n <yuv-date-input-element\n placeholder=\"MM\"\n [ngClass]=\"{ disabled: dateInputForm.disabled }\"\n [attr.aria-disabled]=\"dateInputForm.disabled\"\n formControlName=\"month\"\n [maxLength]=\"2\"\n [minValue]=\"1\"\n [maxValue]=\"12\"\n (prev)=\"onInputPrev()\"\n (next)=\"onInputNext()\"\n ></yuv-date-input-element>\n }\n <!-- year -->\n @case ('year') {\n <yuv-date-input-element\n placeholder=\"yyyy\"\n class=\"year\"\n [ngClass]=\"{ disabled: dateInputForm.disabled }\"\n [attr.aria-disabled]=\"dateInputForm.disabled\"\n formControlName=\"year\"\n [maxLength]=\"4\"\n (prev)=\"onInputPrev()\"\n (next)=\"onInputNext()\"\n ></yuv-date-input-element>\n }\n <!-- hours -->\n @case ('hour') {\n <yuv-date-input-hour-element\n placeholder=\"HH\"\n [ngClass]=\"{ disabled: dateInputForm.disabled }\"\n [attr.aria-disabled]=\"dateInputForm.disabled\"\n [(dayPeriod)]=\"currentDayPeriod\"\n formControlName=\"hour\"\n [maxLength]=\"2\"\n (prev)=\"onInputPrev()\"\n (next)=\"onInputNext()\"\n ></yuv-date-input-hour-element>\n }\n <!-- minutes -->\n @case ('minute') {\n <yuv-date-input-element\n placeholder=\"mm\"\n [ngClass]=\"{ disabled: dateInputForm.disabled }\"\n [attr.aria-disabled]=\"dateInputForm.disabled\"\n [minValue]=\"0\"\n [maxValue]=\"59\"\n formControlName=\"minute\"\n [maxLength]=\"2\"\n (prev)=\"onInputPrev()\"\n (next)=\"onInputNext()\"\n ></yuv-date-input-element>\n }\n @case ('literal') {\n <!-- <span>{{ t.value }}</span> -->\n <input type=\"text\" class=\"literal\" [value]=\"t.value\" readonly inert />\n }\n @case ('dayPeriod') {\n <button type=\"button\" class=\"dayPeriod\" [disabled]=\"dateInputForm.disabled\" (click)=\"toggleDayPeriod()\">\n {{ dayPeriodLabels[currentDayPeriod!] }}\n </button>\n }\n }\n }\n </form>\n}\n@if (_placeholderVisible) {\n <input class=\"placeholder\" [placeholder]=\"_placeholder\" (focus)=\"onPlaceholderFocus()\" />\n}\n", styles: [":host{display:inline-grid;outline:0;align-items:center;grid-template-rows:1fr;grid-template-columns:1fr}:host yuv-date-input-hour-element,:host yuv-date-input-element{border:0;border-block-end:1px solid transparent;box-sizing:border-box}:host input.literal{width:1ch;text-align:center;font-size:var(--_datepicker-font-size);padding:0;border:0;background-color:transparent;border-block-end:1px solid transparent;color:var(--_datepicker-text-color)}:host:focus-within yuv-date-input-hour-element,:host:focus-within yuv-date-input-element{border-color:var(--_datepicker-input-focus-border-color)}:host:focus-within form{opacity:1}:host:focus-within .placeholder{opacity:0;outline:2px solid red;pointer-events:none}:host.is-dirty form,:host.has-value form{opacity:1}:host.is-dirty .placeholder,:host.has-value .placeholder{opacity:0}:host .placeholder{grid-row:1;grid-column:1;font-size:var(--_datepicker-font-size);width:100%;padding:0;flex:1;line-height:1em;border:0;background-color:transparent;transition:opacity .2s ease-in-out}:host form{transition:opacity .2s ease-in-out;grid-row:1;grid-column:1;display:flex;opacity:0;align-items:flex-end;gap:.1em}:host form button.dayPeriod{font-family:monospace;padding:0}\n"] }]
|
|
1321
|
+
}], ctorParameters: () => [{ type: DatepickerService }, { type: i1.FormBuilder }, { type: i0.ElementRef }], propDecorators: { dateInputEls: [{
|
|
1322
|
+
type: ViewChildren,
|
|
1323
|
+
args: [DateInputElementComponent, { read: ElementRef }]
|
|
1324
|
+
}], _date: [{
|
|
1325
|
+
type: HostBinding,
|
|
1326
|
+
args: ['class.has-value']
|
|
1327
|
+
}], dateAttribute: [{
|
|
1328
|
+
type: HostBinding,
|
|
1329
|
+
args: ['attr.data-datevalue']
|
|
1330
|
+
}], disabled: [{
|
|
1331
|
+
type: Input
|
|
1332
|
+
}], placeholder: [{
|
|
1333
|
+
type: Input
|
|
1334
|
+
}], withTime: [{
|
|
1335
|
+
type: Input
|
|
1336
|
+
}], hour12: [{
|
|
1337
|
+
type: Input
|
|
1338
|
+
}] } });
|
|
1339
|
+
|
|
1340
|
+
class DatepickerCalendarComponent {
|
|
1341
|
+
constructor() {
|
|
1342
|
+
this.#dialogData = inject(MAT_DIALOG_DATA);
|
|
1343
|
+
this.#dialogRef = inject((MatDialogRef));
|
|
1344
|
+
this.date = this.#dialogData.date;
|
|
1345
|
+
this.options = this.#dialogData.options;
|
|
1346
|
+
}
|
|
1347
|
+
#dialogData;
|
|
1348
|
+
#dialogRef;
|
|
1349
|
+
enterKeyHandler(event) {
|
|
1350
|
+
this.applyDate();
|
|
1351
|
+
event.preventDefault();
|
|
1352
|
+
event.stopPropagation();
|
|
1353
|
+
}
|
|
1354
|
+
shortcut(key) {
|
|
1355
|
+
switch (key) {
|
|
1356
|
+
case 'today': {
|
|
1357
|
+
const today = new Date();
|
|
1358
|
+
if (this.options.withTime && this.date) {
|
|
1359
|
+
// keep time value
|
|
1360
|
+
today.setHours(this.date.getHours());
|
|
1361
|
+
today.setMinutes(this.date.getMinutes());
|
|
1362
|
+
}
|
|
1363
|
+
this.date = today;
|
|
1364
|
+
break;
|
|
1365
|
+
}
|
|
1366
|
+
}
|
|
1367
|
+
}
|
|
1368
|
+
applyDate() {
|
|
1369
|
+
this.#dialogRef.close(this.date);
|
|
1370
|
+
}
|
|
1371
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DatepickerCalendarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1372
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.11", type: DatepickerCalendarComponent, isStandalone: true, selector: "yuv-datepicker-calendar", host: { listeners: { "keydown.enter": "enterKeyHandler($event)" } }, ngImport: i0, template: "<mat-dialog-content>\n <yuv-calendar tabindex=\"0\"\n [locale]=\"options.locale\"\n [onlyFutureDates]=\"options.onlyFutureDates || false\"\n [(date)]=\"date\"\n [withTime]=\"options.withTime || false\"\n [minDate]=\"options.minDate\"\n [maxDate]=\"options.maxDate\"\n [hour12]=\"options.hour12 || false\"\n ></yuv-calendar>\n</mat-dialog-content>\n<mat-dialog-actions>\n <button type=\"button\" mat-button mat-dialog-close>{{ options.labels!.calendarCancel }}</button>\n <!-- <button type=\"button\" mat-button (click)=\"shortcut('today')\">{{ options.labels!.shortcut.today }}</button> -->\n <button type=\"button\" mat-flat-button [mat-dialog-close]=\"true\" (click)=\"applyDate()\">{{ options.labels!.calendarApply }}</button>\n</mat-dialog-actions>\n", styles: [":host{display:block;background-color:var(--ymt-surface)}\n"], dependencies: [{ kind: "component", type: CalendarComponent, selector: "yuv-calendar", inputs: ["minDate", "maxDate", "onlyFutureDates", "date", "locale", "withTime", "hour12"], outputs: ["dateChange"] }, { kind: "ngmodule", type: MatDialogModule }, { kind: "directive", type: i1$1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1$1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i1$1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }] }); }
|
|
1373
|
+
}
|
|
1374
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DatepickerCalendarComponent, decorators: [{
|
|
1375
|
+
type: Component,
|
|
1376
|
+
args: [{ selector: 'yuv-datepicker-calendar', standalone: true, imports: [CalendarComponent, MatDialogModule, MatButtonModule], template: "<mat-dialog-content>\n <yuv-calendar tabindex=\"0\"\n [locale]=\"options.locale\"\n [onlyFutureDates]=\"options.onlyFutureDates || false\"\n [(date)]=\"date\"\n [withTime]=\"options.withTime || false\"\n [minDate]=\"options.minDate\"\n [maxDate]=\"options.maxDate\"\n [hour12]=\"options.hour12 || false\"\n ></yuv-calendar>\n</mat-dialog-content>\n<mat-dialog-actions>\n <button type=\"button\" mat-button mat-dialog-close>{{ options.labels!.calendarCancel }}</button>\n <!-- <button type=\"button\" mat-button (click)=\"shortcut('today')\">{{ options.labels!.shortcut.today }}</button> -->\n <button type=\"button\" mat-flat-button [mat-dialog-close]=\"true\" (click)=\"applyDate()\">{{ options.labels!.calendarApply }}</button>\n</mat-dialog-actions>\n", styles: [":host{display:block;background-color:var(--ymt-surface)}\n"] }]
|
|
1377
|
+
}], propDecorators: { enterKeyHandler: [{
|
|
1378
|
+
type: HostListener,
|
|
1379
|
+
args: ['keydown.enter', ['$event']]
|
|
1380
|
+
}] } });
|
|
1381
|
+
|
|
1382
|
+
class DatepickerComponent {
|
|
1383
|
+
constructor() {
|
|
1384
|
+
this.#dialog = inject(MatDialog);
|
|
1385
|
+
this.#datepickerService = inject(DatepickerService);
|
|
1386
|
+
this._subs = [];
|
|
1387
|
+
this.allSelected = signal(false);
|
|
1388
|
+
/**
|
|
1389
|
+
* Whether or not to show a calendar picker
|
|
1390
|
+
*/
|
|
1391
|
+
this.calendar = false;
|
|
1392
|
+
/**
|
|
1393
|
+
* Whether or not the component is readonly
|
|
1394
|
+
*/
|
|
1395
|
+
this.readonly = false;
|
|
1396
|
+
this._hour12 = false;
|
|
1397
|
+
this._detectHourCycle = true;
|
|
1398
|
+
this._locale = this.#datepickerService.DEFAULT_LANGUAGE;
|
|
1399
|
+
this._defaultLabelslabels = {
|
|
1400
|
+
calendarApply: 'Apply',
|
|
1401
|
+
calendarCancel: 'Cancel',
|
|
1402
|
+
shortcut: { today: 'today' }
|
|
1403
|
+
};
|
|
1404
|
+
this._labels = this._defaultLabelslabels;
|
|
1405
|
+
this._withTime = false;
|
|
1406
|
+
this.disabled = false;
|
|
1407
|
+
this.calendarValue = null;
|
|
1408
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
1409
|
+
this.propagateChange = (_) => { };
|
|
1410
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
1411
|
+
this.validationChange = () => { };
|
|
1412
|
+
}
|
|
1413
|
+
#dialog;
|
|
1414
|
+
#datepickerService;
|
|
1415
|
+
keydownHandler(e) {
|
|
1416
|
+
if (e.key === 'a' && e.ctrlKey) {
|
|
1417
|
+
// select all
|
|
1418
|
+
e.preventDefault();
|
|
1419
|
+
this.allSelected.set(true);
|
|
1420
|
+
}
|
|
1421
|
+
else if (e.key === 'Delete' && this.allSelected) {
|
|
1422
|
+
// delete the whole date
|
|
1423
|
+
if (this.readonly || this.disabled)
|
|
1424
|
+
return;
|
|
1425
|
+
this.allSelected.set(false);
|
|
1426
|
+
this.clear();
|
|
1427
|
+
e.preventDefault();
|
|
1428
|
+
e.stopPropagation();
|
|
1429
|
+
}
|
|
1430
|
+
else if (this.allSelected() && e.key === 'c' && e.ctrlKey) {
|
|
1431
|
+
this.copyToClipboard();
|
|
1432
|
+
}
|
|
1433
|
+
else {
|
|
1434
|
+
this.allSelected.set(false);
|
|
1435
|
+
}
|
|
1436
|
+
}
|
|
1437
|
+
clickHandler() {
|
|
1438
|
+
this.allSelected.set(false);
|
|
1439
|
+
}
|
|
1440
|
+
focusOutHandler() {
|
|
1441
|
+
this.allSelected.set(false);
|
|
1442
|
+
}
|
|
1443
|
+
/**
|
|
1444
|
+
* Whether or not to 12-hour format vs. default 24h format.
|
|
1445
|
+
* By default the component will try to figure out which hour cycle to
|
|
1446
|
+
* use based on the locale. Setting hour12 property to either `
|
|
1447
|
+
* `true`or `false will overwrite that.
|
|
1448
|
+
*/
|
|
1449
|
+
set hour12(b) {
|
|
1450
|
+
if (b === true || b === false) {
|
|
1451
|
+
this._hour12 = b;
|
|
1452
|
+
this._detectHourCycle = false;
|
|
1453
|
+
}
|
|
1454
|
+
}
|
|
1455
|
+
set locale(iso) {
|
|
1456
|
+
if (iso !== this._locale) {
|
|
1457
|
+
this._locale = iso;
|
|
1458
|
+
if (this._detectHourCycle)
|
|
1459
|
+
this._getHourCycle();
|
|
1460
|
+
this.#datepickerService.setLanguage(iso);
|
|
1461
|
+
}
|
|
1462
|
+
}
|
|
1463
|
+
get locale() {
|
|
1464
|
+
return this._locale;
|
|
1465
|
+
}
|
|
1466
|
+
set labels(l) {
|
|
1467
|
+
this._labels = l || this._defaultLabelslabels;
|
|
1468
|
+
}
|
|
1469
|
+
get labels() {
|
|
1470
|
+
return this._labels;
|
|
1471
|
+
}
|
|
1472
|
+
/**
|
|
1473
|
+
* Whether or not to also include time
|
|
1474
|
+
*/
|
|
1475
|
+
set withTime(b) {
|
|
1476
|
+
this._withTime = b;
|
|
1477
|
+
this.#datepickerService.setOption({ withTime: b });
|
|
1478
|
+
}
|
|
1479
|
+
get withTime() {
|
|
1480
|
+
return this._withTime;
|
|
1481
|
+
}
|
|
1482
|
+
/**
|
|
1483
|
+
* Allow only date inputs that are after today
|
|
1484
|
+
*/
|
|
1485
|
+
set onlyFutureDates(b) {
|
|
1486
|
+
this.#datepickerService.setOption({ onlyFutureDates: b });
|
|
1487
|
+
}
|
|
1488
|
+
/**
|
|
1489
|
+
* Allow only date inputs after this date
|
|
1490
|
+
*/
|
|
1491
|
+
set minDate(d) {
|
|
1492
|
+
this.#datepickerService.setOption({ minDate: d || undefined });
|
|
1493
|
+
}
|
|
1494
|
+
/**
|
|
1495
|
+
* Allow only date inputs before this date
|
|
1496
|
+
*/
|
|
1497
|
+
set maxDate(d) {
|
|
1498
|
+
this.#datepickerService.setOption({ maxDate: d || undefined });
|
|
1499
|
+
}
|
|
1500
|
+
#dialogRef;
|
|
1501
|
+
copyToClipboard() {
|
|
1502
|
+
const fd = this.dateInputCmp.getFormattedValue();
|
|
1503
|
+
if (fd)
|
|
1504
|
+
navigator.clipboard.writeText(fd);
|
|
1505
|
+
}
|
|
1506
|
+
clear() {
|
|
1507
|
+
this.#datepickerService.setValue(null);
|
|
1508
|
+
this.dateInputCmp.focusFirstInput();
|
|
1509
|
+
}
|
|
1510
|
+
openCalendar() {
|
|
1511
|
+
if (!this.calendarValue)
|
|
1512
|
+
this.calendarValue = new Date();
|
|
1513
|
+
this.#dialogRef = this.#dialog.open(DatepickerCalendarComponent, {
|
|
1514
|
+
data: {
|
|
1515
|
+
date: this.calendarValue,
|
|
1516
|
+
options: {
|
|
1517
|
+
withTime: this.withTime,
|
|
1518
|
+
onlyFutureDates: this.onlyFutureDates,
|
|
1519
|
+
minDate: this.minDate,
|
|
1520
|
+
maxDate: this.maxDate,
|
|
1521
|
+
hour12: this._hour12,
|
|
1522
|
+
locale: this.locale,
|
|
1523
|
+
labels: this.labels
|
|
1524
|
+
}
|
|
1525
|
+
}
|
|
1526
|
+
});
|
|
1527
|
+
this.#dialogRef.afterClosed().subscribe({
|
|
1528
|
+
next: (date) => {
|
|
1529
|
+
if (date)
|
|
1530
|
+
this.onCalendarDateApply(date);
|
|
1531
|
+
}
|
|
1532
|
+
});
|
|
1533
|
+
}
|
|
1534
|
+
onCalendarDateApply(date) {
|
|
1535
|
+
this.calendarValue = date;
|
|
1536
|
+
this.#datepickerService.setValue(this.calendarValue);
|
|
1537
|
+
this.closeCalendar();
|
|
1538
|
+
}
|
|
1539
|
+
onTextInputStatusChange(e) {
|
|
1540
|
+
this.validationChange();
|
|
1541
|
+
}
|
|
1542
|
+
closeCalendar() {
|
|
1543
|
+
this.#dialogRef?.close();
|
|
1544
|
+
}
|
|
1545
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
1546
|
+
onDateInputBlur() { }
|
|
1547
|
+
validate(ac) {
|
|
1548
|
+
return this.#datepickerService.getErrors();
|
|
1549
|
+
}
|
|
1550
|
+
writeValue(value) {
|
|
1551
|
+
if (value && DatepickerUtils.isValidDate(value)) {
|
|
1552
|
+
this.#datepickerService.setValue(value || null, true);
|
|
1553
|
+
}
|
|
1554
|
+
}
|
|
1555
|
+
registerOnChange(fn) {
|
|
1556
|
+
this.propagateChange = fn;
|
|
1557
|
+
}
|
|
1558
|
+
registerOnValidatorChange(fn) {
|
|
1559
|
+
this.validationChange = fn;
|
|
1560
|
+
}
|
|
1561
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
1562
|
+
registerOnTouched(fn) { }
|
|
1563
|
+
_getHourCycle() {
|
|
1564
|
+
this._hour12 = DatepickerUtils.getPreferredHourCycle(this._locale) === 'h12';
|
|
1565
|
+
}
|
|
1566
|
+
ngOnInit() {
|
|
1567
|
+
if (this._detectHourCycle)
|
|
1568
|
+
this._getHourCycle();
|
|
1569
|
+
this._subs.push(this.#datepickerService.valueChange$.subscribe({
|
|
1570
|
+
next: (vc) => {
|
|
1571
|
+
this.calendarValue = vc.value;
|
|
1572
|
+
if (vc.propagateChange)
|
|
1573
|
+
this.propagateChange(vc.value);
|
|
1574
|
+
}
|
|
1575
|
+
}));
|
|
1576
|
+
this._subs.push(this.#datepickerService.validationChange$.subscribe({
|
|
1577
|
+
next: (valid) => {
|
|
1578
|
+
this.validationChange();
|
|
1579
|
+
}
|
|
1580
|
+
}));
|
|
1581
|
+
}
|
|
1582
|
+
ngOnDestroy() {
|
|
1583
|
+
this._subs.forEach((s) => s.unsubscribe());
|
|
1584
|
+
}
|
|
1585
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DatepickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1586
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.11", type: DatepickerComponent, isStandalone: true, selector: "yuv-datepicker", inputs: { calendar: "calendar", readonly: "readonly", hour12: "hour12", locale: "locale", labels: "labels", withTime: "withTime", onlyFutureDates: "onlyFutureDates", minDate: "minDate", maxDate: "maxDate", disabled: "disabled" }, host: { attributes: { "class.all-selected": "allSelected()" }, listeners: { "keydown": "keydownHandler($event)", "click": "clickHandler()", "focusout": "focusOutHandler()" }, properties: { "attr.aria-disabled": "this.disabled" } }, providers: [
|
|
1587
|
+
DatepickerService,
|
|
1588
|
+
{
|
|
1589
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1590
|
+
useExisting: forwardRef(() => DatepickerComponent),
|
|
1591
|
+
multi: true
|
|
1592
|
+
},
|
|
1593
|
+
{
|
|
1594
|
+
provide: NG_VALIDATORS,
|
|
1595
|
+
useExisting: forwardRef(() => DatepickerComponent),
|
|
1596
|
+
multi: true
|
|
1597
|
+
}
|
|
1598
|
+
], viewQueries: [{ propertyName: "dateInputCmp", first: true, predicate: DateInputComponent, descendants: true }], hostDirectives: [{ directive: i1$2.FocusWithinDirective }], ngImport: i0, template: "<yuv-date-input [disabled]=\"disabled\" [withTime]=\"withTime\" [hour12]=\"_hour12\"></yuv-date-input>\n\n@if (calendar) {\n <button mat-icon-button type=\"button\" class=\"calender\" [disabled]=\"disabled\" (click)=\"openCalendar()\">\n <mat-icon>calendar_month</mat-icon>\n </button>\n}\n", styles: [":host{--_datepicker-font-size: var(--datepicker-font-size, var(-ymt-font-body-size));--_datepicker-text-color: var(--datepicker-color, var(--ymt-on-surface));--_datepicker-input-focus-border-color: var(--datepicker-color, var(--_datepicker-text-color));font-size:var(--_datepicker-font-size);padding:.25em;display:inline-flex}:host.all-selected yuv-date-input,:host.all-selected yuv-date-input-text{background-color:var(--text-selection-background);color:var(--text-selection-color)}:host>button[disabled]{display:none}:host yuv-date-input-text,:host yuv-date-input{width:100%;margin:0 .25em}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: DateInputComponent, selector: "yuv-date-input", inputs: ["disabled", "placeholder", "withTime", "hour12"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "ngmodule", type: ReactiveFormsModule }] }); }
|
|
1599
|
+
}
|
|
1600
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DatepickerComponent, decorators: [{
|
|
1601
|
+
type: Component,
|
|
1602
|
+
args: [{ selector: 'yuv-datepicker', standalone: true, imports: [CommonModule, MatIconModule, DateInputComponent, MatButtonModule, ReactiveFormsModule], providers: [
|
|
1603
|
+
DatepickerService,
|
|
1604
|
+
{
|
|
1605
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1606
|
+
useExisting: forwardRef(() => DatepickerComponent),
|
|
1607
|
+
multi: true
|
|
1608
|
+
},
|
|
1609
|
+
{
|
|
1610
|
+
provide: NG_VALIDATORS,
|
|
1611
|
+
useExisting: forwardRef(() => DatepickerComponent),
|
|
1612
|
+
multi: true
|
|
1613
|
+
}
|
|
1614
|
+
], host: {
|
|
1615
|
+
'class.all-selected': 'allSelected()'
|
|
1616
|
+
}, hostDirectives: [FocusWithinDirective], template: "<yuv-date-input [disabled]=\"disabled\" [withTime]=\"withTime\" [hour12]=\"_hour12\"></yuv-date-input>\n\n@if (calendar) {\n <button mat-icon-button type=\"button\" class=\"calender\" [disabled]=\"disabled\" (click)=\"openCalendar()\">\n <mat-icon>calendar_month</mat-icon>\n </button>\n}\n", styles: [":host{--_datepicker-font-size: var(--datepicker-font-size, var(-ymt-font-body-size));--_datepicker-text-color: var(--datepicker-color, var(--ymt-on-surface));--_datepicker-input-focus-border-color: var(--datepicker-color, var(--_datepicker-text-color));font-size:var(--_datepicker-font-size);padding:.25em;display:inline-flex}:host.all-selected yuv-date-input,:host.all-selected yuv-date-input-text{background-color:var(--text-selection-background);color:var(--text-selection-color)}:host>button[disabled]{display:none}:host yuv-date-input-text,:host yuv-date-input{width:100%;margin:0 .25em}\n"] }]
|
|
1617
|
+
}], propDecorators: { dateInputCmp: [{
|
|
1618
|
+
type: ViewChild,
|
|
1619
|
+
args: [DateInputComponent]
|
|
1620
|
+
}], keydownHandler: [{
|
|
1621
|
+
type: HostListener,
|
|
1622
|
+
args: ['keydown', ['$event']]
|
|
1623
|
+
}], clickHandler: [{
|
|
1624
|
+
type: HostListener,
|
|
1625
|
+
args: ['click']
|
|
1626
|
+
}], focusOutHandler: [{
|
|
1627
|
+
type: HostListener,
|
|
1628
|
+
args: ['focusout']
|
|
1629
|
+
}], calendar: [{
|
|
1630
|
+
type: Input
|
|
1631
|
+
}], readonly: [{
|
|
1632
|
+
type: Input
|
|
1633
|
+
}], hour12: [{
|
|
1634
|
+
type: Input
|
|
1635
|
+
}], locale: [{
|
|
1636
|
+
type: Input
|
|
1637
|
+
}], labels: [{
|
|
1638
|
+
type: Input
|
|
1639
|
+
}], withTime: [{
|
|
1640
|
+
type: Input
|
|
1641
|
+
}], onlyFutureDates: [{
|
|
1642
|
+
type: Input
|
|
1643
|
+
}], minDate: [{
|
|
1644
|
+
type: Input
|
|
1645
|
+
}], maxDate: [{
|
|
1646
|
+
type: Input
|
|
1647
|
+
}], disabled: [{
|
|
1648
|
+
type: HostBinding,
|
|
1649
|
+
args: ['attr.aria-disabled']
|
|
1650
|
+
}, {
|
|
1651
|
+
type: Input
|
|
1652
|
+
}] } });
|
|
1653
|
+
|
|
1654
|
+
class DatepickerCalendarTriggerComponent {
|
|
1655
|
+
constructor() {
|
|
1656
|
+
this.for = input.required();
|
|
1657
|
+
}
|
|
1658
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DatepickerCalendarTriggerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1659
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.11", type: DatepickerCalendarTriggerComponent, isStandalone: true, selector: "yuv-datepicker-calendar-trigger", inputs: { for: { classPropertyName: "for", publicName: "for", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `<button mat-icon-button>
|
|
1660
|
+
<mat-icon (click)="for().openCalendar()">calendar_month</mat-icon>
|
|
1661
|
+
</button>`, isInline: true, styles: [""], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] }); }
|
|
1662
|
+
}
|
|
1663
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DatepickerCalendarTriggerComponent, decorators: [{
|
|
1664
|
+
type: Component,
|
|
1665
|
+
args: [{ selector: 'yuv-datepicker-calendar-trigger', template: `<button mat-icon-button>
|
|
1666
|
+
<mat-icon (click)="for().openCalendar()">calendar_month</mat-icon>
|
|
1667
|
+
</button>`, standalone: true, imports: [MatButtonModule, MatIconModule] }]
|
|
1668
|
+
}] });
|
|
1669
|
+
|
|
1670
|
+
class YuvDatepickerModule {
|
|
1671
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: YuvDatepickerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1672
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.11", ngImport: i0, type: YuvDatepickerModule, imports: [CalendarComponent, DatepickerComponent, DatepickerCalendarTriggerComponent], exports: [CalendarComponent, DatepickerComponent, DatepickerCalendarTriggerComponent] }); }
|
|
1673
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: YuvDatepickerModule, imports: [CalendarComponent, DatepickerComponent, DatepickerCalendarTriggerComponent] }); }
|
|
1674
|
+
}
|
|
1675
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: YuvDatepickerModule, decorators: [{
|
|
1676
|
+
type: NgModule,
|
|
1677
|
+
args: [{
|
|
1678
|
+
imports: [CalendarComponent, DatepickerComponent, DatepickerCalendarTriggerComponent],
|
|
1679
|
+
exports: [CalendarComponent, DatepickerComponent, DatepickerCalendarTriggerComponent],
|
|
1680
|
+
}]
|
|
1681
|
+
}] });
|
|
1682
|
+
|
|
1683
|
+
/**
|
|
1684
|
+
* Generated bundle index. Do not edit.
|
|
1685
|
+
*/
|
|
1686
|
+
|
|
1687
|
+
export { CalendarComponent, DEFAULT_DAY_PERIOD_LABELS, DatepickerCalendarTriggerComponent, DatepickerComponent, YuvDatepickerModule };
|
|
1688
|
+
//# sourceMappingURL=yuuvis-client-framework-datepicker.mjs.map
|