@seniorsistemas/scala-ng 2.4.0 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -6
- package/autocomplete/README.md +5 -1
- package/autocomplete/public-api.d.ts +2 -2
- package/autocomplete/src/autocomplete/autocomplete.component.d.ts +6 -6
- package/autocomplete/src/autocomplete/autocomplete.models.d.ts +2 -2
- package/autocomplete/src/autocomplete/panel/autocomplete-panel.component.d.ts +1 -1
- package/avatar-summary/README.md +1 -1
- package/avatar-summary/public-api.d.ts +2 -2
- package/avatar-summary/src/avatar-summary/avatar-summary.component.d.ts +1 -1
- package/avatar-summary/src/avatar-summary/avatar-summary.models.d.ts +3 -3
- package/avatar-summary/src/avatar-summary/avatar-summary.tokens.d.ts +1 -1
- package/avatar-summary/src/avatar-summary/avatar-summary.utils.d.ts +1 -1
- package/badge/README.md +1 -1
- package/badge/public-api.d.ts +1 -1
- package/badge/src/badge/badge.component.d.ts +1 -1
- package/banner/README.md +1 -1
- package/banner/public-api.d.ts +3 -3
- package/banner/src/banner/banner.component.d.ts +2 -2
- package/banner/src/banner/banner.models.d.ts +1 -1
- package/banner/src/banner-trigger/banner-trigger.directive.d.ts +2 -2
- package/breadcrumb/README.md +7 -7
- package/breadcrumb/public-api.d.ts +5 -5
- package/breadcrumb/src/breadcrumb/breadcrumb.component.d.ts +2 -2
- package/breadcrumb/src/breadcrumb-router/breadcrumb-router.component.d.ts +2 -2
- package/breadcrumb/src/breadcrumb-truncator/breadcrumb-truncator.component.d.ts +3 -3
- package/button/README.md +5 -1
- package/button/public-api.d.ts +1 -1
- package/button/src/button/button.component.d.ts +1 -1
- package/card/README.md +1 -1
- package/card/public-api.d.ts +1 -1
- package/card/src/card/card.component.d.ts +4 -4
- package/checkbox/README.md +5 -5
- package/checkbox/public-api.d.ts +1 -1
- package/checkbox/src/checkbox/checkbox.component.d.ts +1 -1
- package/content-lifecycle/README.md +2 -2
- package/content-lifecycle/public-api.d.ts +2 -2
- package/content-lifecycle/src/content-lifecycle/content-lifecycle.component.d.ts +2 -2
- package/content-lifecycle/src/content-lifecycle/content-lifecycle.models.d.ts +2 -2
- package/date-picker/README.md +6 -6
- package/date-picker/public-api.d.ts +3 -3
- package/date-picker/src/date-picker/date-format.utils.d.ts +2 -2
- package/date-picker/src/date-picker/datepicker.component.d.ts +7 -7
- package/display-tag/README.md +2 -2
- package/display-tag/public-api.d.ts +2 -2
- package/display-tag/src/display-tag/display-tag.component.d.ts +5 -5
- package/drawer/README.md +9 -9
- package/drawer/public-api.d.ts +1 -1
- package/drawer/src/drawer/drawer.component.d.ts +4 -4
- package/empty-state/README.md +1 -1
- package/empty-state/public-api.d.ts +2 -2
- package/empty-state/src/empty-state/empty-state.component.d.ts +1 -1
- package/empty-state/src/empty-state/empty-state.models.d.ts +2 -2
- package/esm2022/autocomplete/public-api.mjs +2 -2
- package/esm2022/autocomplete/src/autocomplete/autocomplete.component.mjs +55 -55
- package/esm2022/autocomplete/src/autocomplete/autocomplete.models.mjs +1 -1
- package/esm2022/autocomplete/src/autocomplete/panel/autocomplete-panel.component.mjs +12 -12
- package/esm2022/avatar-summary/public-api.mjs +2 -2
- package/esm2022/avatar-summary/src/avatar-summary/avatar-summary.component.mjs +24 -24
- package/esm2022/avatar-summary/src/avatar-summary/avatar-summary.models.mjs +1 -1
- package/esm2022/avatar-summary/src/avatar-summary/avatar-summary.tokens.mjs +46 -46
- package/esm2022/avatar-summary/src/avatar-summary/avatar-summary.utils.mjs +4 -4
- package/esm2022/badge/public-api.mjs +2 -2
- package/esm2022/badge/src/badge/badge.component.mjs +25 -25
- package/esm2022/banner/public-api.mjs +3 -3
- package/esm2022/banner/src/banner/banner.component.mjs +33 -33
- package/esm2022/banner/src/banner/banner.models.mjs +1 -1
- package/esm2022/banner/src/banner-trigger/banner-trigger.directive.mjs +11 -11
- package/esm2022/breadcrumb/public-api.mjs +3 -3
- package/esm2022/breadcrumb/src/breadcrumb/breadcrumb.component.mjs +13 -13
- package/esm2022/breadcrumb/src/breadcrumb-item/breadcrumb-item.component.mjs +13 -13
- package/esm2022/breadcrumb/src/breadcrumb-router/breadcrumb-router.component.mjs +11 -11
- package/esm2022/breadcrumb/src/breadcrumb-truncator/breadcrumb-truncator.component.mjs +24 -24
- package/esm2022/button/public-api.mjs +2 -2
- package/esm2022/button/src/button/button.component.mjs +23 -23
- package/esm2022/card/public-api.mjs +2 -2
- package/esm2022/card/src/card/card.component.mjs +37 -37
- package/esm2022/checkbox/public-api.mjs +2 -2
- package/esm2022/checkbox/src/checkbox/checkbox.component.mjs +5 -5
- package/esm2022/content-lifecycle/public-api.mjs +2 -2
- package/esm2022/content-lifecycle/src/content-lifecycle/content-lifecycle.component.mjs +15 -15
- package/esm2022/content-lifecycle/src/content-lifecycle/content-lifecycle.models.mjs +1 -1
- package/esm2022/date-picker/public-api.mjs +3 -3
- package/esm2022/date-picker/src/date-picker/date-format.utils.mjs +39 -39
- package/esm2022/date-picker/src/date-picker/date.utils.mjs +15 -15
- package/esm2022/date-picker/src/date-picker/datepicker.component.mjs +122 -122
- package/esm2022/display-tag/public-api.mjs +2 -2
- package/esm2022/display-tag/src/display-tag/display-tag.component.mjs +36 -36
- package/esm2022/drawer/public-api.mjs +2 -2
- package/esm2022/drawer/src/drawer/drawer.component.mjs +37 -37
- package/esm2022/empty-state/public-api.mjs +2 -2
- package/esm2022/empty-state/src/empty-state/empty-state.component.mjs +26 -26
- package/esm2022/empty-state/src/empty-state/empty-state.models.mjs +1 -1
- package/esm2022/filter-tag/public-api.mjs +2 -2
- package/esm2022/filter-tag/src/filter-tag/filter-tag.component.mjs +12 -12
- package/esm2022/form-field/public-api.mjs +2 -2
- package/esm2022/form-field/src/form-field/form-field.component.mjs +26 -26
- package/esm2022/input/public-api.mjs +2 -2
- package/esm2022/input/src/input/input.component.mjs +55 -44
- package/esm2022/input-feedback/public-api.mjs +2 -2
- package/esm2022/input-feedback/src/input-feedback/input-feedback.component.mjs +12 -12
- package/esm2022/item-strip/public-api.mjs +2 -2
- package/esm2022/item-strip/src/item-strip/item-strip.component.mjs +14 -14
- package/esm2022/item-strip/src/item-strip-item/item-strip-item.component.mjs +37 -37
- package/esm2022/item-strip/src/item-strip-item/item-strip-item.mjs +1 -1
- package/esm2022/lib/a11y/focusable-item.utils.mjs +2 -2
- package/esm2022/lib/chip/chip.utils.mjs +15 -15
- package/esm2022/lib/combobox/combobox.utils.mjs +8 -8
- package/esm2022/lib/forms/control-state.utils.mjs +4 -4
- package/esm2022/lib/overlay/aria-hide.utils.mjs +10 -10
- package/esm2022/lib/overlay/exclusive-dialog.utils.mjs +22 -0
- package/esm2022/lib/overlay/scroll-lock.utils.mjs +5 -5
- package/esm2022/lib/overlay/scrollable-region.utils.mjs +34 -0
- package/esm2022/lib/theme/create-theme.mjs +7 -7
- package/esm2022/lib/theme/semantic-tokens.mjs +1 -1
- package/esm2022/lib/theme/theme.service.mjs +15 -15
- package/esm2022/list/public-api.mjs +2 -2
- package/esm2022/list/src/list/list-id-generator.mjs +4 -4
- package/esm2022/list/src/list/list.component.mjs +16 -16
- package/esm2022/list/src/list/list.models.mjs +2 -2
- package/esm2022/list/src/list/list.tokens.mjs +30 -30
- package/esm2022/list/src/list-group/list-group.component.mjs +7 -7
- package/esm2022/list/src/list-item/list-item-title.utils.mjs +3 -3
- package/esm2022/list/src/list-item/list-item.component.mjs +47 -47
- package/esm2022/loading-state/public-api.mjs +4 -0
- package/esm2022/loading-state/seniorsistemas-scala-ng-loading-state.mjs +5 -0
- package/esm2022/loading-state/src/loading-state/loading-state.directive.mjs +203 -0
- package/esm2022/loading-state/src/loading-state/loading-state.types.mjs +2 -0
- package/esm2022/loading-state/src/loading-state/loading-visibility.utils.mjs +60 -0
- package/esm2022/loading-state/src/pulse/pulse.component.mjs +71 -0
- package/esm2022/loading-state/src/pulse/senior-isotype.component.mjs +11 -0
- package/esm2022/loading-state/src/spinner/loading-spinner.component.mjs +13 -0
- package/esm2022/locale/fallback.mjs +135 -129
- package/esm2022/locale/public-api.mjs +2 -2
- package/esm2022/mask/public-api.mjs +5 -5
- package/esm2022/mask/src/mask/mask.directive.mjs +67 -67
- package/esm2022/mask/src/mask/mask.pipe.mjs +10 -10
- package/esm2022/mask/src/mask/mask.tokens.mjs +16 -16
- package/esm2022/mask/src/mask/mask.utils.mjs +25 -25
- package/esm2022/modal/public-api.mjs +4 -0
- package/esm2022/modal/seniorsistemas-scala-ng-modal.mjs +5 -0
- package/esm2022/modal/src/modal/modal-ref.mjs +84 -0
- package/esm2022/modal/src/modal/modal.component.mjs +262 -0
- package/esm2022/modal/src/modal/modal.service.mjs +119 -0
- package/esm2022/page-header/public-api.mjs +2 -2
- package/esm2022/page-header/src/page-header/page-header.component.mjs +14 -14
- package/esm2022/paginator/public-api.mjs +2 -2
- package/esm2022/paginator/src/paginator/paginator.component.mjs +29 -29
- package/esm2022/panel/public-api.mjs +2 -2
- package/esm2022/panel/src/panel/panel.component.mjs +21 -21
- package/esm2022/progress-bar/public-api.mjs +3 -3
- package/esm2022/progress-bar/src/progress-bar/progress-bar.component.mjs +33 -33
- package/esm2022/progress-bar/src/progress-bar/progress-bar.utils.mjs +5 -5
- package/esm2022/public-api.mjs +11 -9
- package/esm2022/radio-button/public-api.mjs +3 -3
- package/esm2022/radio-button/src/radio-button/radio-button.component.mjs +7 -7
- package/esm2022/radio-button/src/radio-button-group/radio-button-group-error.token.mjs +3 -3
- package/esm2022/radio-button/src/radio-button-group/radio-button-group.component.mjs +7 -7
- package/esm2022/radio-button/src/services/radio-button-registry.service.mjs +4 -4
- package/esm2022/select/public-api.mjs +2 -2
- package/esm2022/select/src/select/select.component.mjs +89 -89
- package/esm2022/select-button/public-api.mjs +2 -2
- package/esm2022/select-button/src/select-button/select-button.component.mjs +131 -131
- package/esm2022/selection-chip/public-api.mjs +2 -2
- package/esm2022/selection-chip/src/selection-chip/selection-chip.component.mjs +24 -24
- package/esm2022/slider/public-api.mjs +2 -2
- package/esm2022/slider/src/slider/slider.component.mjs +82 -82
- package/esm2022/slider/src/slider/slider.types.mjs +1 -1
- package/esm2022/spinner/public-api.mjs +2 -2
- package/esm2022/spinner/src/spinner/spinner.component.mjs +6 -3
- package/esm2022/split-button/public-api.mjs +2 -0
- package/esm2022/split-button/seniorsistemas-scala-ng-split-button.mjs +5 -0
- package/esm2022/split-button/src/split-button/split-button.component.mjs +71 -0
- package/esm2022/stats-card/public-api.mjs +2 -2
- package/esm2022/stats-card/src/stats-card/stats-card.component.mjs +63 -63
- package/esm2022/stats-card/src/stats-card/stats-card.models.mjs +1 -1
- package/esm2022/switch/public-api.mjs +2 -2
- package/esm2022/switch/src/switch/switch.component.mjs +8 -8
- package/esm2022/table/public-api.mjs +3 -3
- package/esm2022/table/src/components/actions-cell/table-actions-cell.component.mjs +7 -7
- package/esm2022/table/src/components/expand-cell/table-expand-cell.component.mjs +4 -4
- package/esm2022/table/src/components/fields/avatar-summary-field-table/avatar-summary-field-table.component.mjs +4 -4
- package/esm2022/table/src/components/fields/base-table-field-config.mjs +1 -1
- package/esm2022/table/src/components/fields/date-field-table/date-field-table.component.mjs +11 -11
- package/esm2022/table/src/components/fields/number-field-table/number-field-table.component.mjs +3 -3
- package/esm2022/table/src/components/fields/rich-field-table/rich-field-table.component.mjs +9 -9
- package/esm2022/table/src/components/fields/string-field-table/string-field-table.component.mjs +3 -3
- package/esm2022/table/src/components/filter-row/table-filter-row.component.mjs +10 -10
- package/esm2022/table/src/components/row-group-header/table-row-group-header.component.mjs +6 -6
- package/esm2022/table/src/components/selection-cell/table-selection-cell.component.mjs +10 -10
- package/esm2022/table/src/components/toolbar/table-toolbar.component.mjs +18 -18
- package/esm2022/table/src/directives/table-actions-column.directive.mjs +4 -4
- package/esm2022/table/src/directives/table-body.directive.mjs +3 -3
- package/esm2022/table/src/directives/table-cell.directive.mjs +9 -9
- package/esm2022/table/src/directives/table-container.directive.mjs +5 -5
- package/esm2022/table/src/directives/table-field.directive.mjs +10 -10
- package/esm2022/table/src/directives/table-grid.directive.mjs +4 -4
- package/esm2022/table/src/directives/table-header-cell.directive.mjs +17 -17
- package/esm2022/table/src/directives/table-header-row.directive.mjs +4 -4
- package/esm2022/table/src/directives/table-paginator-container.directive.mjs +4 -4
- package/esm2022/table/src/directives/table-row-detail-cell.directive.mjs +4 -4
- package/esm2022/table/src/directives/table-row.directive.mjs +10 -10
- package/esm2022/table/src/fields/avatar-summary-table-header.mjs +1 -1
- package/esm2022/table/src/fields/date-table-header.mjs +1 -1
- package/esm2022/table/src/fields/date-utc.utils.mjs +6 -6
- package/esm2022/table/src/fields/number-table-header.mjs +1 -1
- package/esm2022/table/src/fields/rich-table-header.mjs +1 -1
- package/esm2022/table/src/fields/string-table-header.mjs +1 -1
- package/esm2022/table/src/fields/table-header.mjs +1 -1
- package/esm2022/table/src/registry/built-in-field-types.mjs +11 -11
- package/esm2022/table/src/registry/table-field-registry.mjs +7 -7
- package/esm2022/table/src/table/table-toolbar.models.mjs +1 -1
- package/esm2022/table/src/table/table.component.mjs +58 -58
- package/esm2022/table/src/table/table.models.mjs +1 -1
- package/esm2022/table/src/utils/table-filter.utils.mjs +7 -7
- package/esm2022/table/src/utils/table-group.utils.mjs +6 -6
- package/esm2022/table/src/utils/table-lazy-event.utils.mjs +2 -2
- package/esm2022/table/src/utils/table-selection.utils.mjs +4 -4
- package/esm2022/table/src/utils/table-sort.utils.mjs +9 -9
- package/esm2022/tiered-menu/public-api.mjs +2 -2
- package/esm2022/tiered-menu/src/tiered-menu-item-row/tiered-menu-item-row.directive.mjs +8 -8
- package/esm2022/tiered-menu/src/tiered-menu-panel/tiered-menu-panel.component.mjs +16 -16
- package/esm2022/tiered-menu/src/tiered-menu-panel-host/tiered-menu-panel-host.component.mjs +10 -10
- package/esm2022/tiered-menu/src/tiered-menu-trigger/tiered-menu-trigger.directive.mjs +18 -18
- package/esm2022/toast/public-api.mjs +3 -3
- package/esm2022/toast/src/toast/toast.component.mjs +16 -16
- package/esm2022/toast/src/toast/toast.models.mjs +1 -1
- package/esm2022/toast/src/toast-container/toast-container.component.mjs +20 -20
- package/esm2022/toast/src/toast.service.mjs +31 -31
- package/esm2022/tooltip/public-api.mjs +2 -2
- package/esm2022/tooltip/src/tooltip/tooltip-collision-registry.service.mjs +4 -4
- package/esm2022/tooltip/src/tooltip/tooltip-focus-origin.service.mjs +5 -5
- package/esm2022/tooltip/src/tooltip/tooltip.types.mjs +1 -1
- package/esm2022/tooltip/src/tooltip-panel/tooltip-panel.component.mjs +23 -23
- package/esm2022/tooltip/src/tooltip-trigger/tooltip-trigger.directive.mjs +93 -93
- package/fesm2022/seniorsistemas-scala-ng-autocomplete.mjs +51 -51
- package/fesm2022/seniorsistemas-scala-ng-autocomplete.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-avatar-summary.mjs +64 -64
- package/fesm2022/seniorsistemas-scala-ng-avatar-summary.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-badge.mjs +22 -22
- package/fesm2022/seniorsistemas-scala-ng-badge.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-banner.mjs +32 -32
- package/fesm2022/seniorsistemas-scala-ng-banner.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-breadcrumb.mjs +33 -33
- package/fesm2022/seniorsistemas-scala-ng-breadcrumb.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-button.mjs +21 -21
- package/fesm2022/seniorsistemas-scala-ng-button.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-card.mjs +30 -30
- package/fesm2022/seniorsistemas-scala-ng-card.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-checkbox.mjs +1 -1
- package/fesm2022/seniorsistemas-scala-ng-checkbox.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-content-lifecycle.mjs +12 -12
- package/fesm2022/seniorsistemas-scala-ng-content-lifecycle.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-date-picker.mjs +159 -159
- package/fesm2022/seniorsistemas-scala-ng-date-picker.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-display-tag.mjs +33 -33
- package/fesm2022/seniorsistemas-scala-ng-display-tag.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-drawer.mjs +29 -29
- package/fesm2022/seniorsistemas-scala-ng-drawer.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-empty-state.mjs +23 -23
- package/fesm2022/seniorsistemas-scala-ng-empty-state.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-filter-tag.mjs +7 -7
- package/fesm2022/seniorsistemas-scala-ng-filter-tag.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-form-field.mjs +22 -22
- package/fesm2022/seniorsistemas-scala-ng-form-field.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-input-feedback.mjs +10 -10
- package/fesm2022/seniorsistemas-scala-ng-input-feedback.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-input.mjs +49 -38
- package/fesm2022/seniorsistemas-scala-ng-input.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-item-strip.mjs +39 -39
- package/fesm2022/seniorsistemas-scala-ng-item-strip.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-list.mjs +84 -84
- package/fesm2022/seniorsistemas-scala-ng-list.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-loading-state.mjs +354 -0
- package/fesm2022/seniorsistemas-scala-ng-loading-state.mjs.map +1 -0
- package/fesm2022/seniorsistemas-scala-ng-locale.mjs +134 -128
- package/fesm2022/seniorsistemas-scala-ng-locale.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-mask.mjs +106 -106
- package/fesm2022/seniorsistemas-scala-ng-mask.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-modal.mjs +466 -0
- package/fesm2022/seniorsistemas-scala-ng-modal.mjs.map +1 -0
- package/fesm2022/seniorsistemas-scala-ng-page-header.mjs +9 -9
- package/fesm2022/seniorsistemas-scala-ng-page-header.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-paginator.mjs +20 -20
- package/fesm2022/seniorsistemas-scala-ng-paginator.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-panel.mjs +14 -14
- package/fesm2022/seniorsistemas-scala-ng-panel.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-progress-bar.mjs +31 -31
- package/fesm2022/seniorsistemas-scala-ng-progress-bar.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-radio-button.mjs +6 -6
- package/fesm2022/seniorsistemas-scala-ng-radio-button.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-select-button.mjs +122 -122
- package/fesm2022/seniorsistemas-scala-ng-select-button.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-select.mjs +76 -76
- package/fesm2022/seniorsistemas-scala-ng-select.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-selection-chip.mjs +19 -19
- package/fesm2022/seniorsistemas-scala-ng-selection-chip.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-slider.mjs +72 -72
- package/fesm2022/seniorsistemas-scala-ng-slider.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-spinner.mjs +4 -1
- package/fesm2022/seniorsistemas-scala-ng-spinner.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-split-button.mjs +78 -0
- package/fesm2022/seniorsistemas-scala-ng-split-button.mjs.map +1 -0
- package/fesm2022/seniorsistemas-scala-ng-stats-card.mjs +58 -58
- package/fesm2022/seniorsistemas-scala-ng-stats-card.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-switch.mjs +4 -4
- package/fesm2022/seniorsistemas-scala-ng-switch.mjs.map +1 -1
- package/fesm2022/{seniorsistemas-scala-ng-table-table-actions-cell.component-DTzDhrMk.mjs → seniorsistemas-scala-ng-table-table-actions-cell.component-D_eZKncd.mjs} +2 -2
- package/fesm2022/seniorsistemas-scala-ng-table-table-actions-cell.component-D_eZKncd.mjs.map +1 -0
- package/fesm2022/seniorsistemas-scala-ng-table-table-filter-row.component-C0Y1KaWD.mjs +27 -0
- package/fesm2022/seniorsistemas-scala-ng-table-table-filter-row.component-C0Y1KaWD.mjs.map +1 -0
- package/fesm2022/seniorsistemas-scala-ng-table-table-toolbar.component-C9s1ObGb.mjs +68 -0
- package/fesm2022/seniorsistemas-scala-ng-table-table-toolbar.component-C9s1ObGb.mjs.map +1 -0
- package/fesm2022/seniorsistemas-scala-ng-table.mjs +138 -138
- package/fesm2022/seniorsistemas-scala-ng-table.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-tiered-menu.mjs +35 -35
- package/fesm2022/seniorsistemas-scala-ng-tiered-menu.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-toast.mjs +54 -54
- package/fesm2022/seniorsistemas-scala-ng-toast.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-tooltip.mjs +110 -110
- package/fesm2022/seniorsistemas-scala-ng-tooltip.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng.mjs +110 -54
- package/fesm2022/seniorsistemas-scala-ng.mjs.map +1 -1
- package/filter-tag/README.md +1 -1
- package/filter-tag/public-api.d.ts +1 -1
- package/filter-tag/src/filter-tag/filter-tag.component.d.ts +1 -1
- package/form-field/public-api.d.ts +2 -2
- package/form-field/src/form-field/form-field.component.d.ts +14 -14
- package/input/README.md +13 -10
- package/input/public-api.d.ts +1 -1
- package/input/src/input/input.component.d.ts +8 -5
- package/input-feedback/README.md +7 -7
- package/input-feedback/public-api.d.ts +1 -1
- package/input-feedback/src/input-feedback/input-feedback.component.d.ts +2 -2
- package/item-strip/README.md +1 -1
- package/item-strip/public-api.d.ts +2 -2
- package/item-strip/src/item-strip/item-strip.component.d.ts +1 -1
- package/item-strip/src/item-strip-item/item-strip-item.component.d.ts +27 -27
- package/item-strip/src/item-strip-item/item-strip-item.d.ts +1 -1
- package/lib/a11y/focusable-item.utils.d.ts +1 -1
- package/lib/chip/chip.utils.d.ts +3 -3
- package/lib/combobox/combobox.utils.d.ts +2 -2
- package/lib/forms/control-state.utils.d.ts +2 -2
- package/lib/overlay/exclusive-dialog.utils.d.ts +7 -0
- package/lib/overlay/scrollable-region.utils.d.ts +5 -0
- package/lib/theme/create-theme.d.ts +2 -2
- package/lib/theme/semantic-tokens.d.ts +1 -1
- package/lib/theme/theme.service.d.ts +1 -1
- package/list/README.md +1 -1
- package/list/public-api.d.ts +2 -2
- package/list/src/list/list.component.d.ts +1 -1
- package/list/src/list/list.models.d.ts +5 -5
- package/list/src/list/list.tokens.d.ts +1 -1
- package/list/src/list-group/list-group.component.d.ts +1 -1
- package/list/src/list-item/list-item.component.d.ts +11 -11
- package/loading-state/README.md +60 -0
- package/loading-state/index.d.ts +5 -0
- package/loading-state/package.json +3 -0
- package/loading-state/public-api.d.ts +5 -0
- package/loading-state/src/loading-state/loading-state.directive.d.ts +37 -0
- package/loading-state/src/loading-state/loading-state.types.d.ts +3 -0
- package/loading-state/src/loading-state/loading-visibility.utils.d.ts +11 -0
- package/loading-state/src/pulse/pulse.component.d.ts +27 -0
- package/loading-state/src/pulse/senior-isotype.component.d.ts +5 -0
- package/loading-state/src/spinner/loading-spinner.component.d.ts +8 -0
- package/locale/public-api.d.ts +1 -1
- package/mask/README.md +1 -1
- package/mask/public-api.d.ts +4 -4
- package/mask/src/mask/mask.directive.d.ts +2 -2
- package/mask/src/mask/mask.pipe.d.ts +2 -2
- package/mask/src/mask/mask.utils.d.ts +1 -1
- package/modal/README.md +435 -0
- package/modal/index.d.ts +5 -0
- package/modal/package.json +3 -0
- package/modal/public-api.d.ts +3 -0
- package/modal/src/modal/modal-ref.d.ts +51 -0
- package/modal/src/modal/modal.component.d.ts +82 -0
- package/modal/src/modal/modal.service.d.ts +62 -0
- package/package.json +22 -1
- package/page-header/README.md +1 -1
- package/page-header/public-api.d.ts +1 -1
- package/page-header/src/page-header/page-header.component.d.ts +2 -2
- package/paginator/public-api.d.ts +2 -2
- package/paginator/src/paginator/paginator.component.d.ts +3 -3
- package/panel/README.md +1 -1
- package/panel/public-api.d.ts +1 -1
- package/panel/src/panel/panel.component.d.ts +3 -3
- package/progress-bar/README.md +4 -4
- package/progress-bar/public-api.d.ts +4 -4
- package/progress-bar/src/progress-bar/progress-bar.component.d.ts +3 -3
- package/progress-bar/src/progress-bar/progress-bar.utils.d.ts +1 -1
- package/public-api.d.ts +11 -9
- package/radio-button/README.md +1 -1
- package/radio-button/public-api.d.ts +3 -3
- package/radio-button/src/radio-button/radio-button.component.d.ts +2 -2
- package/radio-button/src/radio-button-group/radio-button-group-error.token.d.ts +1 -1
- package/radio-button/src/radio-button-group/radio-button-group.component.d.ts +3 -3
- package/radio-button/src/services/radio-button-registry.service.d.ts +1 -1
- package/schematics/migrate-spinner-to-loading-state/index.js +75 -0
- package/schematics/migrate-spinner-to-loading-state/index.js.map +1 -0
- package/schematics/migrations.json +10 -0
- package/schematics/ng-add/index.js +29 -29
- package/select/README.md +19 -15
- package/select/public-api.d.ts +2 -2
- package/select/src/select/select.component.d.ts +11 -11
- package/select-button/README.md +1 -1
- package/select-button/public-api.d.ts +2 -2
- package/select-button/src/select-button/select-button.component.d.ts +7 -7
- package/selection-chip/README.md +1 -1
- package/selection-chip/public-api.d.ts +1 -1
- package/selection-chip/src/selection-chip/selection-chip.component.d.ts +3 -3
- package/slider/README.md +6 -6
- package/slider/public-api.d.ts +2 -2
- package/slider/src/slider/slider.component.d.ts +3 -3
- package/slider/src/slider/slider.types.d.ts +3 -3
- package/spinner/README.md +9 -1
- package/spinner/public-api.d.ts +1 -1
- package/spinner/src/spinner/spinner.component.d.ts +3 -0
- package/split-button/README.md +208 -0
- package/split-button/index.d.ts +5 -0
- package/split-button/package.json +3 -0
- package/split-button/public-api.d.ts +1 -0
- package/split-button/src/split-button/split-button.component.d.ts +29 -0
- package/stats-card/README.md +1 -1
- package/stats-card/public-api.d.ts +2 -2
- package/stats-card/src/stats-card/stats-card.component.d.ts +415 -415
- package/stats-card/src/stats-card/stats-card.models.d.ts +3 -3
- package/styles/tailwind-preset.js +30 -13
- package/styles/tailwind-tokens.js +286 -286
- package/styles/tokens/index.scss +7 -7
- package/styles/tokens/semantic-colors.scss +4 -2
- package/styles.scss +7 -7
- package/switch/README.md +5 -5
- package/switch/public-api.d.ts +1 -1
- package/switch/src/switch/switch.component.d.ts +1 -1
- package/table/README.md +21 -21
- package/table/public-api.d.ts +12 -12
- package/table/src/components/actions-cell/table-actions-cell.component.d.ts +2 -2
- package/table/src/components/fields/avatar-summary-field-table/avatar-summary-field-table.component.d.ts +2 -2
- package/table/src/components/fields/base-table-field-config.d.ts +2 -2
- package/table/src/components/fields/date-field-table/date-field-table.component.d.ts +2 -2
- package/table/src/components/fields/number-field-table/number-field-table.component.d.ts +2 -2
- package/table/src/components/fields/rich-field-table/rich-field-table.component.d.ts +2 -2
- package/table/src/components/fields/string-field-table/string-field-table.component.d.ts +2 -2
- package/table/src/components/filter-row/table-filter-row.component.d.ts +1 -1
- package/table/src/components/selection-cell/table-selection-cell.component.d.ts +2 -2
- package/table/src/components/toolbar/table-toolbar.component.d.ts +3 -3
- package/table/src/directives/table-field.directive.d.ts +1 -1
- package/table/src/fields/avatar-summary-table-header.d.ts +4 -4
- package/table/src/fields/date-table-header.d.ts +3 -3
- package/table/src/fields/number-table-header.d.ts +3 -3
- package/table/src/fields/rich-table-header.d.ts +4 -4
- package/table/src/fields/string-table-header.d.ts +4 -4
- package/table/src/fields/table-header.d.ts +2 -2
- package/table/src/registry/built-in-field-types.d.ts +1 -1
- package/table/src/registry/table-field-registry.d.ts +4 -4
- package/table/src/table/table-toolbar.models.d.ts +1 -1
- package/table/src/table/table.component.d.ts +11 -11
- package/table/src/table/table.models.d.ts +2 -2
- package/table/src/utils/table-filter.utils.d.ts +1 -1
- package/table/src/utils/table-group.utils.d.ts +4 -4
- package/table/src/utils/table-lazy-event.utils.d.ts +3 -3
- package/table/src/utils/table-selection.utils.d.ts +2 -2
- package/table/src/utils/table-sort.utils.d.ts +2 -2
- package/tiered-menu/README.md +2 -2
- package/tiered-menu/public-api.d.ts +2 -2
- package/tiered-menu/src/tiered-menu-panel/tiered-menu-panel.component.d.ts +2 -2
- package/tiered-menu/src/tiered-menu-panel-host/tiered-menu-panel-host.component.d.ts +2 -2
- package/tiered-menu/src/tiered-menu-trigger/tiered-menu-trigger.directive.d.ts +2 -2
- package/toast/README.md +17 -17
- package/toast/public-api.d.ts +3 -3
- package/toast/src/toast/toast.component.d.ts +1 -1
- package/toast/src/toast/toast.models.d.ts +3 -3
- package/toast/src/toast-container/toast-container.component.d.ts +1 -1
- package/toast/src/toast.service.d.ts +5 -5
- package/tooltip/README.md +1 -1
- package/tooltip/public-api.d.ts +2 -2
- package/tooltip/src/tooltip/tooltip-focus-origin.service.d.ts +2 -2
- package/tooltip/src/tooltip/tooltip.types.d.ts +3 -3
- package/tooltip/src/tooltip-panel/tooltip-panel.component.d.ts +4 -4
- package/tooltip/src/tooltip-trigger/tooltip-trigger.directive.d.ts +2 -2
- package/fesm2022/seniorsistemas-scala-ng-table-table-actions-cell.component-DTzDhrMk.mjs.map +0 -1
- package/fesm2022/seniorsistemas-scala-ng-table-table-filter-row.component-BgdQk6tM.mjs +0 -27
- package/fesm2022/seniorsistemas-scala-ng-table-table-filter-row.component-BgdQk6tM.mjs.map +0 -1
- package/fesm2022/seniorsistemas-scala-ng-table-table-toolbar.component-2YcqyPlh.mjs +0 -68
- package/fesm2022/seniorsistemas-scala-ng-table-table-toolbar.component-2YcqyPlh.mjs.map +0 -1
|
@@ -15,9 +15,9 @@ import { SdsInputFeedbackComponent } from '@seniorsistemas/scala-ng/input-feedba
|
|
|
15
15
|
import { startWith } from 'rxjs';
|
|
16
16
|
|
|
17
17
|
const DATE_FORMAT_TOKEN_RE = /yyyy|MM|dd/g;
|
|
18
|
-
const DAY_TOKEN_MASK =
|
|
19
|
-
const MONTH_TOKEN_MASK =
|
|
20
|
-
const YEAR_TOKEN_MASK =
|
|
18
|
+
const DAY_TOKEN_MASK = 'd0';
|
|
19
|
+
const MONTH_TOKEN_MASK = 'M0';
|
|
20
|
+
const YEAR_TOKEN_MASK = '0000';
|
|
21
21
|
const REGEX_SPECIAL_CHARS = /[.*+?^${}()|[\]\\]/g;
|
|
22
22
|
const MIN_VALID_YEAR = 1000;
|
|
23
23
|
const DAY_PAD_LENGTH = 2;
|
|
@@ -32,21 +32,21 @@ function tokenizeDateFormat(format) {
|
|
|
32
32
|
let match;
|
|
33
33
|
while ((match = DATE_FORMAT_TOKEN_RE.exec(format))) {
|
|
34
34
|
if (match.index > lastIndex) {
|
|
35
|
-
tokens.push({ kind:
|
|
35
|
+
tokens.push({ kind: 'literal', raw: format.slice(lastIndex, match.index) });
|
|
36
36
|
}
|
|
37
37
|
const raw = match[0];
|
|
38
38
|
let kind;
|
|
39
39
|
switch (raw) {
|
|
40
|
-
case
|
|
41
|
-
kind =
|
|
40
|
+
case 'yyyy': {
|
|
41
|
+
kind = 'year';
|
|
42
42
|
break;
|
|
43
43
|
}
|
|
44
|
-
case
|
|
45
|
-
kind =
|
|
44
|
+
case 'MM': {
|
|
45
|
+
kind = 'month';
|
|
46
46
|
break;
|
|
47
47
|
}
|
|
48
48
|
default: {
|
|
49
|
-
kind =
|
|
49
|
+
kind = 'day';
|
|
50
50
|
break;
|
|
51
51
|
}
|
|
52
52
|
}
|
|
@@ -54,7 +54,7 @@ function tokenizeDateFormat(format) {
|
|
|
54
54
|
lastIndex = DATE_FORMAT_TOKEN_RE.lastIndex;
|
|
55
55
|
}
|
|
56
56
|
if (lastIndex < format.length) {
|
|
57
|
-
tokens.push({ kind:
|
|
57
|
+
tokens.push({ kind: 'literal', raw: format.slice(lastIndex) });
|
|
58
58
|
}
|
|
59
59
|
return tokens;
|
|
60
60
|
}
|
|
@@ -63,17 +63,17 @@ function getDateSegmentRanges(format) {
|
|
|
63
63
|
const ranges = [];
|
|
64
64
|
let cursor = 0;
|
|
65
65
|
for (const token of tokenizeDateFormat(format)) {
|
|
66
|
-
if (token.kind ===
|
|
66
|
+
if (token.kind === 'literal') {
|
|
67
67
|
cursor += token.raw.length;
|
|
68
68
|
continue;
|
|
69
69
|
}
|
|
70
70
|
let length;
|
|
71
71
|
switch (token.kind) {
|
|
72
|
-
case
|
|
72
|
+
case 'year': {
|
|
73
73
|
length = YEAR_PAD_LENGTH;
|
|
74
74
|
break;
|
|
75
75
|
}
|
|
76
|
-
case
|
|
76
|
+
case 'month': {
|
|
77
77
|
length = MONTH_PAD_LENGTH;
|
|
78
78
|
break;
|
|
79
79
|
}
|
|
@@ -92,13 +92,13 @@ function dateFormatToMaskPattern(format) {
|
|
|
92
92
|
return tokenizeDateFormat(format)
|
|
93
93
|
.map((token) => {
|
|
94
94
|
switch (token.kind) {
|
|
95
|
-
case
|
|
95
|
+
case 'day': {
|
|
96
96
|
return DAY_TOKEN_MASK;
|
|
97
97
|
}
|
|
98
|
-
case
|
|
98
|
+
case 'month': {
|
|
99
99
|
return MONTH_TOKEN_MASK;
|
|
100
100
|
}
|
|
101
|
-
case
|
|
101
|
+
case 'year': {
|
|
102
102
|
return YEAR_TOKEN_MASK;
|
|
103
103
|
}
|
|
104
104
|
default: {
|
|
@@ -106,47 +106,47 @@ function dateFormatToMaskPattern(format) {
|
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
})
|
|
109
|
-
.join(
|
|
109
|
+
.join('');
|
|
110
110
|
}
|
|
111
111
|
/** Drops the day token (and one adjacent literal separator) from a `dateFormat`, for `month` mode. */
|
|
112
112
|
function stripDayToken(format) {
|
|
113
113
|
const tokens = tokenizeDateFormat(format);
|
|
114
|
-
const dayIndex = tokens.findIndex((token) => token.kind ===
|
|
114
|
+
const dayIndex = tokens.findIndex((token) => token.kind === 'day');
|
|
115
115
|
if (dayIndex === -1) {
|
|
116
116
|
return format;
|
|
117
117
|
}
|
|
118
118
|
const dropIndexes = new Set([dayIndex]);
|
|
119
|
-
if (tokens[dayIndex + 1]?.kind ===
|
|
119
|
+
if (tokens[dayIndex + 1]?.kind === 'literal') {
|
|
120
120
|
dropIndexes.add(dayIndex + 1);
|
|
121
121
|
}
|
|
122
|
-
else if (tokens[dayIndex - 1]?.kind ===
|
|
122
|
+
else if (tokens[dayIndex - 1]?.kind === 'literal') {
|
|
123
123
|
dropIndexes.add(dayIndex - 1);
|
|
124
124
|
}
|
|
125
125
|
return tokens
|
|
126
126
|
.filter((_, index) => !dropIndexes.has(index))
|
|
127
127
|
.map((token) => token.raw)
|
|
128
|
-
.join(
|
|
128
|
+
.join('');
|
|
129
129
|
}
|
|
130
130
|
/** Formats `date` according to a `dateFormat` token order. */
|
|
131
131
|
function formatDateByFormat(date, format) {
|
|
132
132
|
return tokenizeDateFormat(format)
|
|
133
133
|
.map((token) => {
|
|
134
134
|
switch (token.kind) {
|
|
135
|
-
case
|
|
136
|
-
return String(date.getDate()).padStart(DAY_PAD_LENGTH,
|
|
135
|
+
case 'day': {
|
|
136
|
+
return String(date.getDate()).padStart(DAY_PAD_LENGTH, '0');
|
|
137
137
|
}
|
|
138
|
-
case
|
|
139
|
-
return String(date.getMonth() + 1).padStart(MONTH_PAD_LENGTH,
|
|
138
|
+
case 'month': {
|
|
139
|
+
return String(date.getMonth() + 1).padStart(MONTH_PAD_LENGTH, '0');
|
|
140
140
|
}
|
|
141
|
-
case
|
|
142
|
-
return String(date.getFullYear()).padStart(YEAR_PAD_LENGTH,
|
|
141
|
+
case 'year': {
|
|
142
|
+
return String(date.getFullYear()).padStart(YEAR_PAD_LENGTH, '0');
|
|
143
143
|
}
|
|
144
144
|
default: {
|
|
145
145
|
return token.raw;
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
148
|
})
|
|
149
|
-
.join(
|
|
149
|
+
.join('');
|
|
150
150
|
}
|
|
151
151
|
/** Parses `raw` per a `dateFormat` token order. Returns `null` when unparsable or an impossible date. */
|
|
152
152
|
function parseDateByFormat(raw, format) {
|
|
@@ -154,16 +154,16 @@ function parseDateByFormat(raw, format) {
|
|
|
154
154
|
const patternSource = tokenizeDateFormat(format)
|
|
155
155
|
.map((token) => {
|
|
156
156
|
switch (token.kind) {
|
|
157
|
-
case
|
|
158
|
-
order.push(
|
|
157
|
+
case 'day': {
|
|
158
|
+
order.push('day');
|
|
159
159
|
return String.raw `(\d{2})`;
|
|
160
160
|
}
|
|
161
|
-
case
|
|
162
|
-
order.push(
|
|
161
|
+
case 'month': {
|
|
162
|
+
order.push('month');
|
|
163
163
|
return String.raw `(\d{2})`;
|
|
164
164
|
}
|
|
165
|
-
case
|
|
166
|
-
order.push(
|
|
165
|
+
case 'year': {
|
|
166
|
+
order.push('year');
|
|
167
167
|
return String.raw `(\d{4})`;
|
|
168
168
|
}
|
|
169
169
|
default: {
|
|
@@ -171,7 +171,7 @@ function parseDateByFormat(raw, format) {
|
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
173
|
})
|
|
174
|
-
.join(
|
|
174
|
+
.join('');
|
|
175
175
|
const match = new RegExp(`^${patternSource}$`).exec(raw.trim());
|
|
176
176
|
if (!match) {
|
|
177
177
|
return null;
|
|
@@ -194,14 +194,14 @@ function parseDateByFormat(raw, format) {
|
|
|
194
194
|
}
|
|
195
195
|
/** Formats a `date` + time as `<dateFormat> HH:mm`. */
|
|
196
196
|
function formatDateTimeByFormat(date, format) {
|
|
197
|
-
const hours = String(date.getHours()).padStart(TIME_PAD_LENGTH,
|
|
198
|
-
const minutes = String(date.getMinutes()).padStart(TIME_PAD_LENGTH,
|
|
197
|
+
const hours = String(date.getHours()).padStart(TIME_PAD_LENGTH, '0');
|
|
198
|
+
const minutes = String(date.getMinutes()).padStart(TIME_PAD_LENGTH, '0');
|
|
199
199
|
return `${formatDateByFormat(date, format)} ${hours}:${minutes}`;
|
|
200
200
|
}
|
|
201
201
|
/** Parses `<dateFormat> HH:mm`. Returns `null` when unparsable, an impossible date, or an out-of-range time. */
|
|
202
202
|
function parseDateTimeByFormat(raw, format, maxHours, maxMinutes) {
|
|
203
203
|
const trimmed = raw.trim();
|
|
204
|
-
const separatorIndex = trimmed.lastIndexOf(
|
|
204
|
+
const separatorIndex = trimmed.lastIndexOf(' ');
|
|
205
205
|
if (separatorIndex === -1) {
|
|
206
206
|
return null;
|
|
207
207
|
}
|
|
@@ -219,7 +219,7 @@ function parseDateTimeByFormat(raw, format, maxHours, maxMinutes) {
|
|
|
219
219
|
}
|
|
220
220
|
|
|
221
221
|
function formatTime(h, m) {
|
|
222
|
-
return `${String(h).padStart(2,
|
|
222
|
+
return `${String(h).padStart(2, '0')}:${String(m).padStart(2, '0')}`;
|
|
223
223
|
}
|
|
224
224
|
function isSameDay(a, b) {
|
|
225
225
|
return (a.getFullYear() === b.getFullYear() &&
|
|
@@ -230,7 +230,7 @@ function stripTime(date) {
|
|
|
230
230
|
return new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime();
|
|
231
231
|
}
|
|
232
232
|
function parseRangeInput(raw, dateFormat) {
|
|
233
|
-
const parts = raw.split(
|
|
233
|
+
const parts = raw.split('\u2014').map((part) => part.trim());
|
|
234
234
|
if (parts.length !== 2) {
|
|
235
235
|
return null;
|
|
236
236
|
}
|
|
@@ -259,16 +259,16 @@ function parseInput(mode, raw, base, maxHours, maxMinutes, dateFormat) {
|
|
|
259
259
|
return null;
|
|
260
260
|
}
|
|
261
261
|
switch (mode) {
|
|
262
|
-
case
|
|
262
|
+
case 'range': {
|
|
263
263
|
return parseRangeInput(raw, dateFormat);
|
|
264
264
|
}
|
|
265
|
-
case
|
|
265
|
+
case 'time': {
|
|
266
266
|
return parseTimeInput(raw, base, maxHours, maxMinutes);
|
|
267
267
|
}
|
|
268
|
-
case
|
|
268
|
+
case 'month': {
|
|
269
269
|
return parseDateByFormat(raw, stripDayToken(dateFormat));
|
|
270
270
|
}
|
|
271
|
-
case
|
|
271
|
+
case 'datetime': {
|
|
272
272
|
return parseDateTimeByFormat(raw, dateFormat, maxHours, maxMinutes);
|
|
273
273
|
}
|
|
274
274
|
default: {
|
|
@@ -278,28 +278,28 @@ function parseInput(mode, raw, base, maxHours, maxMinutes, dateFormat) {
|
|
|
278
278
|
}
|
|
279
279
|
function formatValueForInput(mode, value, dateFormat) {
|
|
280
280
|
if (!value) {
|
|
281
|
-
return
|
|
281
|
+
return '';
|
|
282
282
|
}
|
|
283
|
-
if (mode ===
|
|
283
|
+
if (mode === 'range') {
|
|
284
284
|
const range = value;
|
|
285
285
|
if (!range.start) {
|
|
286
|
-
return
|
|
286
|
+
return '';
|
|
287
287
|
}
|
|
288
288
|
return range.end
|
|
289
289
|
? `${formatDateByFormat(range.start, dateFormat)} \u2014 ${formatDateByFormat(range.end, dateFormat)}`
|
|
290
290
|
: formatDateByFormat(range.start, dateFormat);
|
|
291
291
|
}
|
|
292
292
|
if (!(value instanceof Date)) {
|
|
293
|
-
return
|
|
293
|
+
return '';
|
|
294
294
|
}
|
|
295
295
|
switch (mode) {
|
|
296
|
-
case
|
|
296
|
+
case 'time': {
|
|
297
297
|
return formatTime(value.getHours(), value.getMinutes());
|
|
298
298
|
}
|
|
299
|
-
case
|
|
299
|
+
case 'month': {
|
|
300
300
|
return formatDateByFormat(value, stripDayToken(dateFormat));
|
|
301
301
|
}
|
|
302
|
-
case
|
|
302
|
+
case 'datetime': {
|
|
303
303
|
return formatDateTimeByFormat(value, dateFormat);
|
|
304
304
|
}
|
|
305
305
|
default: {
|
|
@@ -312,7 +312,7 @@ function numericKeysOnly() {
|
|
|
312
312
|
return (_target, _key, descriptor) => {
|
|
313
313
|
const original = descriptor.value;
|
|
314
314
|
descriptor.value = function (event) {
|
|
315
|
-
const isValidKey = [
|
|
315
|
+
const isValidKey = ['ArrowUp', 'ArrowDown', 'Backspace', 'Delete', 'Tab'].includes(event.key) ||
|
|
316
316
|
/^\d$/.test(event.key);
|
|
317
317
|
if (!isValidKey) {
|
|
318
318
|
event.preventDefault();
|
|
@@ -330,9 +330,9 @@ class SdsDatePickerComponent {
|
|
|
330
330
|
static MONTHS_IN_YEAR = 12;
|
|
331
331
|
static MONTHS_PER_ROW = 3;
|
|
332
332
|
static DEFAULT_MINUTE_STEP = 5;
|
|
333
|
-
static DEFAULT_DATE_FORMAT =
|
|
334
|
-
static DATE_FORMAT_TRANSLATION_KEY =
|
|
335
|
-
static DATETIME_TIME_MASK_SUFFIX =
|
|
333
|
+
static DEFAULT_DATE_FORMAT = 'dd/MM/yyyy';
|
|
334
|
+
static DATE_FORMAT_TRANSLATION_KEY = 'platform.scala-ng.date_format';
|
|
335
|
+
static DATETIME_TIME_MASK_SUFFIX = ' H0:m0';
|
|
336
336
|
static TIME_SEGMENT_LENGTH = 2;
|
|
337
337
|
static ARROW_DAY_BOUNDS = { min: 1, max: 31 };
|
|
338
338
|
static ARROW_MONTH_BOUNDS = { min: 1, max: 12 };
|
|
@@ -347,9 +347,9 @@ class SdsDatePickerComponent {
|
|
|
347
347
|
/** Optional secondary label rendered in parentheses next to the main label. */
|
|
348
348
|
subtitle = input();
|
|
349
349
|
/** Field height: `"default"` = 40px, `"small"` = 32px. */
|
|
350
|
-
size = input(
|
|
350
|
+
size = input('default');
|
|
351
351
|
/** Picker mode: `date` | `month` | `datetime` | `time` | `range`. Defaults to `date`. */
|
|
352
|
-
mode = input(
|
|
352
|
+
mode = input('date');
|
|
353
353
|
/** Earliest selectable date. Days/months before this value are disabled. */
|
|
354
354
|
min = input();
|
|
355
355
|
/** Latest selectable date. Days/months after this value are disabled. */
|
|
@@ -369,7 +369,7 @@ class SdsDatePickerComponent {
|
|
|
369
369
|
* `platform.scala-ng.date_format` translation, then `"dd/MM/yyyy"`. Ignored in `time` mode.
|
|
370
370
|
*/
|
|
371
371
|
dateFormat = input(undefined);
|
|
372
|
-
inputDate =
|
|
372
|
+
inputDate = '';
|
|
373
373
|
ngControl = null;
|
|
374
374
|
maxHours = 24;
|
|
375
375
|
maxMinutes = 60;
|
|
@@ -377,17 +377,17 @@ class SdsDatePickerComponent {
|
|
|
377
377
|
value = signal(null);
|
|
378
378
|
isOpen = signal(false);
|
|
379
379
|
viewDate = signal(new Date());
|
|
380
|
-
pickerView = signal(
|
|
380
|
+
pickerView = signal('calendar');
|
|
381
381
|
hours = signal(0);
|
|
382
382
|
minutes = signal(0);
|
|
383
383
|
rangeValue = signal(null);
|
|
384
384
|
pendingRangeStart = signal(null);
|
|
385
385
|
hoverDate = signal(null);
|
|
386
386
|
disabled = false;
|
|
387
|
-
sdsInput = viewChild.required(
|
|
388
|
-
firstCalendarButton = viewChild(
|
|
389
|
-
firstMonthViewButton = viewChild(
|
|
390
|
-
increaseHourButton = viewChild(
|
|
387
|
+
sdsInput = viewChild.required('sdsInput');
|
|
388
|
+
firstCalendarButton = viewChild('firstCalendarButton', { read: ElementRef });
|
|
389
|
+
firstMonthViewButton = viewChild('firstMonthViewButton', { read: ElementRef });
|
|
390
|
+
increaseHourButton = viewChild('increaseHourButton', { read: ElementRef });
|
|
391
391
|
injector = inject(Injector);
|
|
392
392
|
destroyRef = inject(DestroyRef);
|
|
393
393
|
translate = inject(TranslateService);
|
|
@@ -397,12 +397,12 @@ class SdsDatePickerComponent {
|
|
|
397
397
|
isControlInvalid = signal(false);
|
|
398
398
|
fieldState = computed(() => {
|
|
399
399
|
if (this.isDisabledSignal()) {
|
|
400
|
-
return
|
|
400
|
+
return 'disabled';
|
|
401
401
|
}
|
|
402
402
|
if (!this.isControlTouched()) {
|
|
403
|
-
return
|
|
403
|
+
return 'default';
|
|
404
404
|
}
|
|
405
|
-
return this.isControlInvalid() ?
|
|
405
|
+
return this.isControlInvalid() ? 'invalid' : 'valid';
|
|
406
406
|
});
|
|
407
407
|
ngOnInit() {
|
|
408
408
|
this.ngControl = this.injector.get(NgControl, null, { self: true, optional: true });
|
|
@@ -423,24 +423,24 @@ class SdsDatePickerComponent {
|
|
|
423
423
|
}
|
|
424
424
|
}
|
|
425
425
|
positions = [
|
|
426
|
-
{ originX:
|
|
427
|
-
{ originX:
|
|
426
|
+
{ originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top', offsetY: 4 },
|
|
427
|
+
{ originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom', offsetY: -4 },
|
|
428
428
|
];
|
|
429
429
|
placeholderKey = computed(() => {
|
|
430
430
|
const mode = this.mode();
|
|
431
|
-
if (mode ===
|
|
432
|
-
return
|
|
431
|
+
if (mode === 'time') {
|
|
432
|
+
return 'platform.scala-ng.datepicker_placeholder_time';
|
|
433
433
|
}
|
|
434
|
-
if (mode ===
|
|
435
|
-
return
|
|
434
|
+
if (mode === 'month') {
|
|
435
|
+
return 'platform.scala-ng.datepicker_placeholder_month';
|
|
436
436
|
}
|
|
437
|
-
if (mode ===
|
|
438
|
-
return
|
|
437
|
+
if (mode === 'datetime') {
|
|
438
|
+
return 'platform.scala-ng.datepicker_placeholder_datetime';
|
|
439
439
|
}
|
|
440
|
-
if (mode ===
|
|
441
|
-
return
|
|
440
|
+
if (mode === 'range') {
|
|
441
|
+
return 'platform.scala-ng.datepicker_placeholder_range';
|
|
442
442
|
}
|
|
443
|
-
return
|
|
443
|
+
return 'platform.scala-ng.datepicker_placeholder_date';
|
|
444
444
|
});
|
|
445
445
|
currentMonthIndex = computed(() => this.viewDate().getMonth());
|
|
446
446
|
currentYear = computed(() => this.viewDate().getFullYear());
|
|
@@ -509,7 +509,7 @@ class SdsDatePickerComponent {
|
|
|
509
509
|
return false;
|
|
510
510
|
}
|
|
511
511
|
const view = this.viewDate();
|
|
512
|
-
if (this.pickerView() ===
|
|
512
|
+
if (this.pickerView() === 'months') {
|
|
513
513
|
return view.getFullYear() <= min.getFullYear();
|
|
514
514
|
}
|
|
515
515
|
return (view.getFullYear() < min.getFullYear() ||
|
|
@@ -521,15 +521,15 @@ class SdsDatePickerComponent {
|
|
|
521
521
|
return false;
|
|
522
522
|
}
|
|
523
523
|
const view = this.viewDate();
|
|
524
|
-
if (this.pickerView() ===
|
|
524
|
+
if (this.pickerView() === 'months') {
|
|
525
525
|
return view.getFullYear() >= max.getFullYear();
|
|
526
526
|
}
|
|
527
527
|
return (view.getFullYear() > max.getFullYear() ||
|
|
528
528
|
(view.getFullYear() === max.getFullYear() && view.getMonth() >= max.getMonth()));
|
|
529
529
|
});
|
|
530
|
-
showTimePicker = computed(() => this.mode() ===
|
|
531
|
-
showCalendar = computed(() => this.mode() !==
|
|
532
|
-
inputType = computed(() => (this.mode() ===
|
|
530
|
+
showTimePicker = computed(() => this.mode() === 'datetime' || this.mode() === 'time');
|
|
531
|
+
showCalendar = computed(() => this.mode() !== 'time');
|
|
532
|
+
inputType = computed(() => (this.mode() === 'time' ? 'time' : 'text'));
|
|
533
533
|
/** Explicit `dateFormat`, else the translated format, else `"dd/MM/yyyy"`. */
|
|
534
534
|
resolvedDateFormat = computed(() => {
|
|
535
535
|
this.langChange();
|
|
@@ -538,7 +538,7 @@ class SdsDatePickerComponent {
|
|
|
538
538
|
return explicit;
|
|
539
539
|
}
|
|
540
540
|
const translated = this.translate.instant(SdsDatePickerComponent.DATE_FORMAT_TRANSLATION_KEY);
|
|
541
|
-
const hasTranslation = typeof translated ===
|
|
541
|
+
const hasTranslation = typeof translated === 'string' &&
|
|
542
542
|
translated.length > 0 &&
|
|
543
543
|
translated !== SdsDatePickerComponent.DATE_FORMAT_TRANSLATION_KEY;
|
|
544
544
|
return hasTranslation ? translated : SdsDatePickerComponent.DEFAULT_DATE_FORMAT;
|
|
@@ -546,17 +546,17 @@ class SdsDatePickerComponent {
|
|
|
546
546
|
inputMask = computed(() => {
|
|
547
547
|
const format = this.resolvedDateFormat();
|
|
548
548
|
switch (this.mode()) {
|
|
549
|
-
case
|
|
549
|
+
case 'date': {
|
|
550
550
|
return dateFormatToMaskPattern(format);
|
|
551
551
|
}
|
|
552
|
-
case
|
|
552
|
+
case 'month': {
|
|
553
553
|
return dateFormatToMaskPattern(stripDayToken(format));
|
|
554
554
|
}
|
|
555
|
-
case
|
|
555
|
+
case 'datetime': {
|
|
556
556
|
return `${dateFormatToMaskPattern(format)}${SdsDatePickerComponent.DATETIME_TIME_MASK_SUFFIX}`;
|
|
557
557
|
}
|
|
558
558
|
default: {
|
|
559
|
-
return
|
|
559
|
+
return '';
|
|
560
560
|
}
|
|
561
561
|
}
|
|
562
562
|
});
|
|
@@ -564,18 +564,18 @@ class SdsDatePickerComponent {
|
|
|
564
564
|
syncDisplayOnFormatChange = effect(() => {
|
|
565
565
|
const format = this.resolvedDateFormat();
|
|
566
566
|
const mode = this.mode();
|
|
567
|
-
if (mode ===
|
|
567
|
+
if (mode === 'time') {
|
|
568
568
|
return;
|
|
569
569
|
}
|
|
570
|
-
if (mode ===
|
|
570
|
+
if (mode === 'range') {
|
|
571
571
|
this.inputDate = formatValueForInput(mode, this.rangeValue(), format);
|
|
572
572
|
return;
|
|
573
573
|
}
|
|
574
574
|
this.inputDate = formatValueForInput(mode, this.value(), format);
|
|
575
575
|
});
|
|
576
|
-
dialogAriaLabelKey = computed(() => this.mode() ===
|
|
577
|
-
?
|
|
578
|
-
:
|
|
576
|
+
dialogAriaLabelKey = computed(() => this.mode() === 'range'
|
|
577
|
+
? 'platform.scala-ng.datepicker_select_range'
|
|
578
|
+
: 'platform.scala-ng.datepicker_select_date');
|
|
579
579
|
popupId = computed(() => `${this.inputId()}-popup`);
|
|
580
580
|
parseInput(raw) {
|
|
581
581
|
return parseInput(this.mode(), raw, this.value(), this.maxHours, this.maxMinutes, this.resolvedDateFormat());
|
|
@@ -598,7 +598,7 @@ class SdsDatePickerComponent {
|
|
|
598
598
|
this._hasFormatError = false;
|
|
599
599
|
this._isBadInput = false;
|
|
600
600
|
this.onValidatorChange();
|
|
601
|
-
if (this.mode() ===
|
|
601
|
+
if (this.mode() === 'range' && 'start' in parsed) {
|
|
602
602
|
this.rangeValue.set(parsed);
|
|
603
603
|
this.onChange(parsed);
|
|
604
604
|
}
|
|
@@ -614,27 +614,27 @@ class SdsDatePickerComponent {
|
|
|
614
614
|
}
|
|
615
615
|
}
|
|
616
616
|
weekDayKeys = [
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
617
|
+
'platform.scala-ng.datepicker_day_sun',
|
|
618
|
+
'platform.scala-ng.datepicker_day_mon',
|
|
619
|
+
'platform.scala-ng.datepicker_day_tue',
|
|
620
|
+
'platform.scala-ng.datepicker_day_wed',
|
|
621
|
+
'platform.scala-ng.datepicker_day_thu',
|
|
622
|
+
'platform.scala-ng.datepicker_day_fri',
|
|
623
|
+
'platform.scala-ng.datepicker_day_sat',
|
|
624
624
|
];
|
|
625
625
|
monthKeys = [
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
626
|
+
'platform.scala-ng.datepicker_month_jan',
|
|
627
|
+
'platform.scala-ng.datepicker_month_feb',
|
|
628
|
+
'platform.scala-ng.datepicker_month_mar',
|
|
629
|
+
'platform.scala-ng.datepicker_month_apr',
|
|
630
|
+
'platform.scala-ng.datepicker_month_may',
|
|
631
|
+
'platform.scala-ng.datepicker_month_jun',
|
|
632
|
+
'platform.scala-ng.datepicker_month_jul',
|
|
633
|
+
'platform.scala-ng.datepicker_month_aug',
|
|
634
|
+
'platform.scala-ng.datepicker_month_sep',
|
|
635
|
+
'platform.scala-ng.datepicker_month_oct',
|
|
636
|
+
'platform.scala-ng.datepicker_month_nov',
|
|
637
|
+
'platform.scala-ng.datepicker_month_dec',
|
|
638
638
|
];
|
|
639
639
|
_hasFormatError = false;
|
|
640
640
|
_isBadInput = false;
|
|
@@ -647,10 +647,10 @@ class SdsDatePickerComponent {
|
|
|
647
647
|
if (!value) {
|
|
648
648
|
this.value.set(null);
|
|
649
649
|
this.rangeValue.set(null);
|
|
650
|
-
this.inputDate =
|
|
650
|
+
this.inputDate = '';
|
|
651
651
|
return;
|
|
652
652
|
}
|
|
653
|
-
if (
|
|
653
|
+
if ('start' in value) {
|
|
654
654
|
this.rangeValue.set(value);
|
|
655
655
|
this.inputDate = formatValueForInput(this.mode(), value, this.resolvedDateFormat());
|
|
656
656
|
if (value.start) {
|
|
@@ -675,7 +675,7 @@ class SdsDatePickerComponent {
|
|
|
675
675
|
}
|
|
676
676
|
validate(control) {
|
|
677
677
|
const mode = this.mode();
|
|
678
|
-
const value = mode ===
|
|
678
|
+
const value = mode === 'range' ? this.rangeValue() : this.value();
|
|
679
679
|
return this.computeValidationErrors(value, control);
|
|
680
680
|
}
|
|
681
681
|
registerOnValidatorChange(fn) {
|
|
@@ -690,7 +690,7 @@ class SdsDatePickerComponent {
|
|
|
690
690
|
return;
|
|
691
691
|
}
|
|
692
692
|
this.isOpen.set(true);
|
|
693
|
-
this.pickerView.set(this.mode() ===
|
|
693
|
+
this.pickerView.set(this.mode() === 'month' ? 'months' : 'calendar');
|
|
694
694
|
}
|
|
695
695
|
close() {
|
|
696
696
|
this.isOpen.set(false);
|
|
@@ -698,10 +698,10 @@ class SdsDatePickerComponent {
|
|
|
698
698
|
this.hoverDate.set(null);
|
|
699
699
|
this.isControlTouched.set(true);
|
|
700
700
|
this.onTouched();
|
|
701
|
-
if (this.mode() ===
|
|
701
|
+
if (this.mode() === 'time') {
|
|
702
702
|
const current = this.value();
|
|
703
703
|
if (current) {
|
|
704
|
-
this.inputDate = formatValueForInput(
|
|
704
|
+
this.inputDate = formatValueForInput('time', current, this.resolvedDateFormat());
|
|
705
705
|
}
|
|
706
706
|
}
|
|
707
707
|
this.sdsInput().focus();
|
|
@@ -729,14 +729,14 @@ class SdsDatePickerComponent {
|
|
|
729
729
|
}
|
|
730
730
|
}
|
|
731
731
|
handleOverlayKeydown(event) {
|
|
732
|
-
if (event.key ===
|
|
732
|
+
if (event.key === 'Escape') {
|
|
733
733
|
this.close();
|
|
734
734
|
}
|
|
735
735
|
}
|
|
736
736
|
navigatePrev() {
|
|
737
737
|
const focusedElement = document.activeElement;
|
|
738
738
|
const view = this.viewDate();
|
|
739
|
-
if (this.pickerView() ===
|
|
739
|
+
if (this.pickerView() === 'months') {
|
|
740
740
|
this.viewDate.set(new Date(view.getFullYear() - 1, view.getMonth(), 1));
|
|
741
741
|
}
|
|
742
742
|
else {
|
|
@@ -747,7 +747,7 @@ class SdsDatePickerComponent {
|
|
|
747
747
|
navigateNext() {
|
|
748
748
|
const focusedElement = document.activeElement;
|
|
749
749
|
const view = this.viewDate();
|
|
750
|
-
if (this.pickerView() ===
|
|
750
|
+
if (this.pickerView() === 'months') {
|
|
751
751
|
this.viewDate.set(new Date(view.getFullYear() + 1, view.getMonth(), 1));
|
|
752
752
|
}
|
|
753
753
|
else {
|
|
@@ -770,7 +770,7 @@ class SdsDatePickerComponent {
|
|
|
770
770
|
if (!element) {
|
|
771
771
|
return;
|
|
772
772
|
}
|
|
773
|
-
if (element.matches(
|
|
773
|
+
if (element.matches(':disabled')) {
|
|
774
774
|
this.focusNearestEnabledButton(element);
|
|
775
775
|
return;
|
|
776
776
|
}
|
|
@@ -778,21 +778,21 @@ class SdsDatePickerComponent {
|
|
|
778
778
|
}
|
|
779
779
|
focusNearestEnabledButton(element) {
|
|
780
780
|
const isOtherEnabledButton = (candidate) => candidate !== element && !candidate.disabled;
|
|
781
|
-
const rowButtons = Array.from(element.parentElement?.querySelectorAll(
|
|
782
|
-
const panelButtons = Array.from(element.closest('[role="dialog"]')?.querySelectorAll(
|
|
781
|
+
const rowButtons = Array.from(element.parentElement?.querySelectorAll('button') ?? []);
|
|
782
|
+
const panelButtons = Array.from(element.closest('[role="dialog"]')?.querySelectorAll('button') ?? []);
|
|
783
783
|
(rowButtons.find(isOtherEnabledButton) ?? panelButtons.find(isOtherEnabledButton))?.focus();
|
|
784
784
|
}
|
|
785
785
|
switchToMonths() {
|
|
786
|
-
this.pickerView.set(
|
|
786
|
+
this.pickerView.set('months');
|
|
787
787
|
}
|
|
788
788
|
backToCalendar() {
|
|
789
|
-
this.pickerView.set(
|
|
789
|
+
this.pickerView.set('calendar');
|
|
790
790
|
}
|
|
791
791
|
selectDate(day) {
|
|
792
792
|
if (day.isDisabled) {
|
|
793
793
|
return;
|
|
794
794
|
}
|
|
795
|
-
if (this.mode() ===
|
|
795
|
+
if (this.mode() === 'range') {
|
|
796
796
|
const pending = this.pendingRangeStart();
|
|
797
797
|
if (!pending) {
|
|
798
798
|
this.pendingRangeStart.set(day.date);
|
|
@@ -809,11 +809,11 @@ class SdsDatePickerComponent {
|
|
|
809
809
|
}
|
|
810
810
|
const newDate = new Date(day.date.getFullYear(), day.date.getMonth(), day.date.getDate(), this.hours(), this.minutes());
|
|
811
811
|
this.value.set(newDate);
|
|
812
|
-
if (this.mode() ===
|
|
812
|
+
if (this.mode() === 'date' || this.mode() === 'datetime') {
|
|
813
813
|
this.inputDate = formatValueForInput(this.mode(), newDate, this.resolvedDateFormat());
|
|
814
814
|
}
|
|
815
815
|
this.onChange(newDate);
|
|
816
|
-
if (this.mode() ===
|
|
816
|
+
if (this.mode() === 'date') {
|
|
817
817
|
this.close();
|
|
818
818
|
}
|
|
819
819
|
}
|
|
@@ -823,7 +823,7 @@ class SdsDatePickerComponent {
|
|
|
823
823
|
}
|
|
824
824
|
const year = this.currentYear();
|
|
825
825
|
const newViewDate = new Date(year, monthIndex, 1);
|
|
826
|
-
if (this.mode() ===
|
|
826
|
+
if (this.mode() === 'month') {
|
|
827
827
|
this.value.set(newViewDate);
|
|
828
828
|
this.inputDate = formatValueForInput(this.mode(), newViewDate, this.resolvedDateFormat());
|
|
829
829
|
this.onChange(newViewDate);
|
|
@@ -831,7 +831,7 @@ class SdsDatePickerComponent {
|
|
|
831
831
|
}
|
|
832
832
|
else {
|
|
833
833
|
this.viewDate.set(newViewDate);
|
|
834
|
-
this.pickerView.set(
|
|
834
|
+
this.pickerView.set('calendar');
|
|
835
835
|
}
|
|
836
836
|
}
|
|
837
837
|
selectToday() {
|
|
@@ -856,7 +856,7 @@ class SdsDatePickerComponent {
|
|
|
856
856
|
this.minutes.set(0);
|
|
857
857
|
this.rangeValue.set(null);
|
|
858
858
|
this.pendingRangeStart.set(null);
|
|
859
|
-
this.inputDate =
|
|
859
|
+
this.inputDate = '';
|
|
860
860
|
this.onChange(null);
|
|
861
861
|
this.close();
|
|
862
862
|
}
|
|
@@ -886,11 +886,11 @@ class SdsDatePickerComponent {
|
|
|
886
886
|
this.syncTimeToValue();
|
|
887
887
|
}
|
|
888
888
|
handleHoursKeydown(event) {
|
|
889
|
-
if (event.key ===
|
|
889
|
+
if (event.key === 'ArrowUp') {
|
|
890
890
|
event.preventDefault();
|
|
891
891
|
this.incrementHours();
|
|
892
892
|
}
|
|
893
|
-
else if (event.key ===
|
|
893
|
+
else if (event.key === 'ArrowDown') {
|
|
894
894
|
event.preventDefault();
|
|
895
895
|
this.decrementHours();
|
|
896
896
|
}
|
|
@@ -899,11 +899,11 @@ class SdsDatePickerComponent {
|
|
|
899
899
|
}
|
|
900
900
|
}
|
|
901
901
|
handleMinutesKeydown(event) {
|
|
902
|
-
if (event.key ===
|
|
902
|
+
if (event.key === 'ArrowUp') {
|
|
903
903
|
event.preventDefault();
|
|
904
904
|
this.incrementMinutes();
|
|
905
905
|
}
|
|
906
|
-
else if (event.key ===
|
|
906
|
+
else if (event.key === 'ArrowDown') {
|
|
907
907
|
event.preventDefault();
|
|
908
908
|
this.decrementMinutes();
|
|
909
909
|
}
|
|
@@ -932,26 +932,26 @@ class SdsDatePickerComponent {
|
|
|
932
932
|
const newDate = new Date(date.getFullYear(), date.getMonth(), date.getDate(), this.hours(), this.minutes());
|
|
933
933
|
this.value.set(newDate);
|
|
934
934
|
this.inputDate = formatValueForInput(this.mode(), newDate, this.resolvedDateFormat());
|
|
935
|
-
if (this.mode() ===
|
|
935
|
+
if (this.mode() === 'time') {
|
|
936
936
|
this.onChange(newDate);
|
|
937
937
|
}
|
|
938
938
|
}
|
|
939
939
|
onDayHover(date) {
|
|
940
|
-
if (this.mode() ===
|
|
940
|
+
if (this.mode() === 'range') {
|
|
941
941
|
this.hoverDate.set(date);
|
|
942
942
|
}
|
|
943
943
|
}
|
|
944
944
|
handleTriggerKeydown(event) {
|
|
945
|
-
if (event.key ===
|
|
945
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
946
946
|
event.preventDefault();
|
|
947
947
|
this.open();
|
|
948
948
|
return;
|
|
949
949
|
}
|
|
950
|
-
if (event.key ===
|
|
950
|
+
if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {
|
|
951
951
|
this.handleSegmentArrowKey(event);
|
|
952
952
|
return;
|
|
953
953
|
}
|
|
954
|
-
if (event.key ===
|
|
954
|
+
if (event.key === 'Tab') {
|
|
955
955
|
this.handleSegmentTabKey(event);
|
|
956
956
|
}
|
|
957
957
|
}
|
|
@@ -961,7 +961,7 @@ class SdsDatePickerComponent {
|
|
|
961
961
|
*/
|
|
962
962
|
handleSegmentTabKey(event) {
|
|
963
963
|
const mode = this.mode();
|
|
964
|
-
if (mode !==
|
|
964
|
+
if (mode !== 'date' && mode !== 'month' && mode !== 'datetime') {
|
|
965
965
|
return;
|
|
966
966
|
}
|
|
967
967
|
if (!(event.target instanceof HTMLInputElement)) {
|
|
@@ -988,7 +988,7 @@ class SdsDatePickerComponent {
|
|
|
988
988
|
*/
|
|
989
989
|
handleSegmentArrowKey(event) {
|
|
990
990
|
const mode = this.mode();
|
|
991
|
-
if (mode !==
|
|
991
|
+
if (mode !== 'date' && mode !== 'month' && mode !== 'datetime') {
|
|
992
992
|
return;
|
|
993
993
|
}
|
|
994
994
|
if (!(event.target instanceof HTMLInputElement)) {
|
|
@@ -1001,33 +1001,33 @@ class SdsDatePickerComponent {
|
|
|
1001
1001
|
return;
|
|
1002
1002
|
}
|
|
1003
1003
|
event.preventDefault();
|
|
1004
|
-
const delta = event.key ===
|
|
1004
|
+
const delta = event.key === 'ArrowUp' ? 1 : -1;
|
|
1005
1005
|
const currentText = inputElement.value.slice(segment.start, segment.end);
|
|
1006
1006
|
const nextValue = this.incrementArrowSegment(segment.kind, currentText, delta);
|
|
1007
|
-
const padded = String(nextValue).padStart(segment.length,
|
|
1007
|
+
const padded = String(nextValue).padStart(segment.length, '0');
|
|
1008
1008
|
const nextFullValue = inputElement.value.slice(0, segment.start) + padded + inputElement.value.slice(segment.end);
|
|
1009
1009
|
inputElement.value = nextFullValue;
|
|
1010
1010
|
// The mask directive's `input` handler moves the caret, so re-select the segment after it.
|
|
1011
|
-
inputElement.dispatchEvent(new Event(
|
|
1011
|
+
inputElement.dispatchEvent(new Event('input', { bubbles: true }));
|
|
1012
1012
|
inputElement.setSelectionRange(segment.start, segment.end);
|
|
1013
1013
|
}
|
|
1014
1014
|
buildArrowSegments(mode) {
|
|
1015
|
-
const format = mode ===
|
|
1015
|
+
const format = mode === 'month' ? stripDayToken(this.resolvedDateFormat()) : this.resolvedDateFormat();
|
|
1016
1016
|
const dateSegments = getDateSegmentRanges(format);
|
|
1017
|
-
if (mode !==
|
|
1017
|
+
if (mode !== 'datetime') {
|
|
1018
1018
|
return dateSegments;
|
|
1019
1019
|
}
|
|
1020
1020
|
const timeStart = format.length + 1;
|
|
1021
1021
|
return [
|
|
1022
1022
|
...dateSegments,
|
|
1023
1023
|
{
|
|
1024
|
-
kind:
|
|
1024
|
+
kind: 'hour',
|
|
1025
1025
|
start: timeStart,
|
|
1026
1026
|
end: timeStart + SdsDatePickerComponent.TIME_SEGMENT_LENGTH,
|
|
1027
1027
|
length: SdsDatePickerComponent.TIME_SEGMENT_LENGTH,
|
|
1028
1028
|
},
|
|
1029
1029
|
{
|
|
1030
|
-
kind:
|
|
1030
|
+
kind: 'minute',
|
|
1031
1031
|
start: timeStart + SdsDatePickerComponent.TIME_SEGMENT_LENGTH + 1,
|
|
1032
1032
|
end: timeStart + 2 * SdsDatePickerComponent.TIME_SEGMENT_LENGTH + 1,
|
|
1033
1033
|
length: SdsDatePickerComponent.TIME_SEGMENT_LENGTH,
|
|
@@ -1036,7 +1036,7 @@ class SdsDatePickerComponent {
|
|
|
1036
1036
|
}
|
|
1037
1037
|
incrementArrowSegment(kind, currentText, delta) {
|
|
1038
1038
|
const hasValue = currentText.length > 0 && /^\d+$/.test(currentText);
|
|
1039
|
-
if (kind ===
|
|
1039
|
+
if (kind === 'year') {
|
|
1040
1040
|
const current = hasValue ? Number.parseInt(currentText, 10) : new Date().getFullYear();
|
|
1041
1041
|
const next = hasValue ? current + delta : current;
|
|
1042
1042
|
return Math.min(SdsDatePickerComponent.ARROW_MAX_YEAR, Math.max(SdsDatePickerComponent.ARROW_MIN_YEAR, next));
|
|
@@ -1051,13 +1051,13 @@ class SdsDatePickerComponent {
|
|
|
1051
1051
|
}
|
|
1052
1052
|
arrowSegmentBounds(kind) {
|
|
1053
1053
|
switch (kind) {
|
|
1054
|
-
case
|
|
1054
|
+
case 'day': {
|
|
1055
1055
|
return SdsDatePickerComponent.ARROW_DAY_BOUNDS;
|
|
1056
1056
|
}
|
|
1057
|
-
case
|
|
1057
|
+
case 'month': {
|
|
1058
1058
|
return SdsDatePickerComponent.ARROW_MONTH_BOUNDS;
|
|
1059
1059
|
}
|
|
1060
|
-
case
|
|
1060
|
+
case 'hour': {
|
|
1061
1061
|
return { min: 0, max: this.maxHours - 1 };
|
|
1062
1062
|
}
|
|
1063
1063
|
default: {
|
|
@@ -1116,10 +1116,10 @@ class SdsDatePickerComponent {
|
|
|
1116
1116
|
return false;
|
|
1117
1117
|
}
|
|
1118
1118
|
padTime(value) {
|
|
1119
|
-
return String(value).padStart(2,
|
|
1119
|
+
return String(value).padStart(2, '0');
|
|
1120
1120
|
}
|
|
1121
1121
|
formatDayAriaLabel(date) {
|
|
1122
|
-
return this.translate.instant(
|
|
1122
|
+
return this.translate.instant('platform.scala-ng.datepicker_day_aria_label', {
|
|
1123
1123
|
weekday: this.translate.instant(this.weekDayKeys[date.getDay()]),
|
|
1124
1124
|
month: this.translate.instant(this.monthKeys[date.getMonth()]),
|
|
1125
1125
|
day: date.getDate(),
|
|
@@ -1168,7 +1168,7 @@ class SdsDatePickerComponent {
|
|
|
1168
1168
|
useExisting: SdsDatePickerComponent,
|
|
1169
1169
|
multi: true,
|
|
1170
1170
|
},
|
|
1171
|
-
], viewQueries: [{ propertyName: "sdsInput", first: true, predicate: ["sdsInput"], descendants: true, isSignal: true }, { propertyName: "firstCalendarButton", first: true, predicate: ["firstCalendarButton"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "firstMonthViewButton", first: true, predicate: ["firstMonthViewButton"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "increaseHourButton", first: true, predicate: ["increaseHourButton"], descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: "<div\n cdkOverlayOrigin\n #trigger=\"cdkOverlayOrigin\"\n role=\"combobox\"\n aria-haspopup=\"grid\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"popupId()\"\n>\n <sds-input\n #sdsInput\n [label]=\"label()\"\n [subtitle]=\"subtitle()\"\n [state]=\"fieldState()\"\n [showHelper]=\"false\"\n [size]=\"size()\"\n icon=\"fa-solid fa-calendar\"\n [(ngModel)]=\"inputDate\"\n (ngModelChange)=\"handleParsedValue($event)\"\n [placeholder]=\"placeholderKey() | translate\"\n [inputId]=\"inputId()\"\n [type]=\"inputType()\"\n [mask]=\"inputMask()\"\n [leadZeroDateTime]=\"true\"\n [readonly]=\"mode() === 'range'\"\n [disabled]=\"isDisabledSignal()\"\n [showDefaultIcon]=\"false\"\n [showNativeDropdown]=\"false\"\n [nativeInputAttrs]=\"{ autocomplete: 'off' }\"\n (inputClick)=\"open()\"\n (inputKeydown)=\"handleTriggerKeydown($event)\"\n (focusOut)=\"handleInputFocusOut($event)\"\n />\n\n @let _errorMessages = errorMessages();\n @let control = ngControl?.control;\n @let _adviceMessage = adviceMessage();\n @if (_errorMessages && control) {\n <sds-input-feedback\n [control]=\"control\"\n [errorMessages]=\"_errorMessages\"\n [validMessage]=\"validMessage()\"\n [adviceMessage]=\"_adviceMessage\"\n />\n } @else if (_adviceMessage) {\n <span\n class=\"text-[14px] font-normal leading-[1.5]\"\n [class]=\"isDisabledSignal() ? 'text-color-text-disable' : 'text-color-text-neutral-secondary'\"\n >{{ _adviceMessage }}</span\n >\n }\n</div>\n\n<ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"trigger\"\n [cdkConnectedOverlayOpen]=\"isOpen()\"\n [cdkConnectedOverlayHasBackdrop]=\"true\"\n cdkConnectedOverlayBackdropClass=\"cdk-overlay-transparent-backdrop\"\n [cdkConnectedOverlayPositions]=\"positions\"\n (backdropClick)=\"close()\"\n (overlayKeydown)=\"handleOverlayKeydown($event)\"\n (detach)=\"isOpen.set(false)\"\n>\n <div\n class=\"z-50 w-[304px] rounded-radius-xlarge border border-solid border-color-border bg-surface-default shadow-shadow-popover\"\n role=\"dialog\"\n cdkTrapFocus\n [id]=\"popupId()\"\n [attr.aria-label]=\"dialogAriaLabelKey() | translate\"\n >\n @if (showCalendar()) {\n @if (pickerView() === \"calendar\") {\n <div\n class=\"flex items-center justify-between border-b border-solid border-color-border px-4 py-3\"\n >\n <button\n #firstCalendarButton\n sdsButton\n type=\"secondary\"\n [disabled]=\"prevDisabled()\"\n [attr.aria-label]=\"'platform.scala-ng.datepicker_prev_month' | translate\"\n (click)=\"navigatePrev()\"\n >\n <i\n sdsLeadingIcon\n class=\"fa-solid fa-chevron-left text-xs\"\n aria-hidden=\"true\"\n ></i>\n </button>\n\n <button\n sdsButton\n type=\"ghost\"\n [attr.aria-label]=\"'platform.scala-ng.datepicker_select_month_year' | translate\"\n (click)=\"switchToMonths()\"\n >\n {{ currentMonthKey() | translate }} {{ currentYear() }}\n <i\n sdsTrailingIcon\n class=\"fa-solid fa-chevron-down text-[10px]\"\n aria-hidden=\"true\"\n ></i>\n </button>\n\n <button\n sdsButton\n type=\"secondary\"\n [disabled]=\"nextDisabled()\"\n [attr.aria-label]=\"'platform.scala-ng.datepicker_next_month' | translate\"\n (click)=\"navigateNext()\"\n >\n <i\n sdsLeadingIcon\n class=\"fa-solid fa-chevron-right text-xs\"\n aria-hidden=\"true\"\n ></i>\n </button>\n </div>\n\n <div\n class=\"grid grid-cols-7 gap-0 p-3\"\n role=\"grid\"\n >\n <div\n role=\"row\"\n class=\"contents\"\n >\n @for (dayKey of weekDayKeys; track dayKey) {\n <div\n class=\"flex h-8 items-center justify-center text-xs font-medium text-color-text-neutral-secondary\"\n role=\"columnheader\"\n [attr.aria-label]=\"dayKey | translate\"\n >\n {{ dayKey | translate }}\n </div>\n }\n </div>\n\n @for (week of calendarWeeks(); track $index) {\n <div\n role=\"row\"\n class=\"contents\"\n >\n @for (day of week; track day.date.toISOString()) {\n <button\n type=\"button\"\n role=\"gridcell\"\n class=\"group relative flex h-10 w-10 items-center justify-center text-sm font-normal transition-colors\"\n [attr.aria-label]=\"formatDayAriaLabel(day.date)\"\n [attr.aria-selected]=\"day.isSelected || day.isRangeStart || day.isRangeEnd\"\n [attr.aria-disabled]=\"day.isDisabled ? 'true' : null\"\n [disabled]=\"day.isDisabled\"\n [ngClass]=\"{\n 'bg-color-background-selected':\n day.isRangeStart || day.isRangeEnd || day.isInRange,\n 'rounded-l-full': day.isRangeStart && !day.isRangeEnd,\n 'rounded-r-full': day.isRangeEnd && !day.isRangeStart,\n 'rounded-full': day.isRangeStart && day.isRangeEnd,\n }\"\n (mouseenter)=\"onDayHover(day.date)\"\n (mouseleave)=\"onDayHover(null)\"\n (click)=\"selectDate(day)\"\n >\n <!-- Hover has its own key: ngClass drops a class shared by two keys when the later key is false. -->\n <span\n class=\"flex h-9 w-9 items-center justify-center rounded-full group-focus-visible:outline group-focus-visible:outline-2 group-focus-visible:outline-offset-[-2px] group-focus-visible:outline-color-border-focused\"\n [ngClass]=\"{\n 'bg-color-background-selected-bold text-color-text-inverse hover:bg-color-background-selected-bold-hovered':\n day.isSelected || day.isRangeStart || day.isRangeEnd,\n 'text-color-text-neutral-primary':\n !day.isSelected &&\n !day.isRangeStart &&\n !day.isRangeEnd &&\n !day.isDisabled &&\n day.isCurrentMonth,\n 'text-color-text-neutral-secondary':\n !day.isSelected &&\n !day.isRangeStart &&\n !day.isRangeEnd &&\n !day.isDisabled &&\n !day.isCurrentMonth,\n 'hover:bg-color-background-interactive-secondary-hovered':\n !day.isSelected && !day.isRangeStart && !day.isRangeEnd && !day.isDisabled,\n 'cursor-not-allowed text-color-text-disable': day.isDisabled,\n }\"\n >\n {{ day.dayOfMonth }}\n </span>\n @if (day.isToday && !day.isSelected && !day.isRangeStart && !day.isRangeEnd) {\n <span\n class=\"pointer-events-none absolute inset-0 m-auto h-9 w-9 rounded-full border border-solid border-color-border\"\n aria-hidden=\"true\"\n ></span>\n }\n </button>\n }\n </div>\n }\n </div>\n }\n\n @if (pickerView() === \"months\") {\n <div\n class=\"flex items-center justify-between border-b border-solid border-color-border px-4 py-3\"\n >\n <button\n #firstMonthViewButton\n sdsButton\n type=\"secondary\"\n [disabled]=\"prevDisabled()\"\n [attr.aria-label]=\"'platform.scala-ng.datepicker_prev_year' | translate\"\n (click)=\"navigatePrev()\"\n >\n <i\n sdsLeadingIcon\n class=\"fa-solid fa-chevron-left text-xs\"\n aria-hidden=\"true\"\n ></i>\n </button>\n\n <span class=\"text-sm font-medium text-color-text-neutral-primary\">{{\n currentYear()\n }}</span>\n\n <button\n sdsButton\n type=\"secondary\"\n [disabled]=\"nextDisabled()\"\n [attr.aria-label]=\"'platform.scala-ng.datepicker_next_year' | translate\"\n (click)=\"navigateNext()\"\n >\n <i\n sdsLeadingIcon\n class=\"fa-solid fa-chevron-right text-xs\"\n aria-hidden=\"true\"\n ></i>\n </button>\n </div>\n\n <div\n class=\"grid grid-cols-3 gap-2 px-4 py-3\"\n role=\"grid\"\n [attr.aria-label]=\"'platform.scala-ng.datepicker_select_month' | translate\"\n >\n @for (row of monthsGrid(); track $index) {\n @for (month of row; track month.index) {\n <button\n type=\"button\"\n role=\"gridcell\"\n class=\"flex h-9 items-center justify-center rounded-radius-large text-sm font-normal transition-colors focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-color-border-focused\"\n [attr.aria-selected]=\"isMonthSelected(month.index)\"\n [attr.aria-disabled]=\"isMonthDisabled(month.index) ? 'true' : null\"\n [disabled]=\"isMonthDisabled(month.index)\"\n [ngClass]=\"{\n 'bg-color-background-selected-bold text-color-text-inverse': isMonthSelected(\n month.index\n ),\n 'text-color-text-neutral-primary hover:bg-color-background-interactive-secondary-hovered':\n !isMonthSelected(month.index) && !isMonthDisabled(month.index),\n 'cursor-not-allowed text-color-text-disable': isMonthDisabled(month.index),\n }\"\n (click)=\"selectMonth(month.index)\"\n >\n {{ month.key | translate }}\n </button>\n }\n }\n </div>\n\n @if (mode() !== \"month\") {\n <div class=\"border-t border-solid border-color-border px-4 py-2\">\n <button\n sdsButton\n type=\"ghost\"\n (click)=\"backToCalendar()\"\n >\n <i\n sdsLeadingIcon\n class=\"fa-solid fa-arrow-left\"\n aria-hidden=\"true\"\n ></i>\n {{ \"platform.scala-ng.datepicker_back_to_calendar\" | translate }}\n </button>\n </div>\n }\n }\n }\n\n @if (showTimePicker()) {\n <div\n class=\"flex items-center justify-center gap-3 px-4 py-3\"\n [ngClass]=\"{\n 'border-t border-solid border-color-border': showCalendar(),\n }\"\n role=\"group\"\n [attr.aria-label]=\"'platform.scala-ng.datepicker_select_time' | translate\"\n >\n <div class=\"flex flex-col items-center gap-1\">\n <button\n sdsButton\n #increaseHourButton\n type=\"ghost\"\n [attr.aria-label]=\"'platform.scala-ng.datepicker_increment_hour' | translate\"\n (click)=\"incrementHours()\"\n >\n <i\n sdsLeadingIcon\n class=\"fa-solid fa-chevron-up text-xs\"\n aria-hidden=\"true\"\n ></i>\n </button>\n <input\n type=\"text\"\n inputmode=\"numeric\"\n [attr.maxlength]=\"timeInputMaxLength\"\n class=\"h-9 w-12 rounded-radius-medium border border-solid border-color-border-interactive-secondary bg-color-background-interactive-secondary text-center text-base font-medium text-color-text-neutral-primary outline-none focus:border-color-border-focused focus:shadow-[0px_0px_3px_1px_var(--sds-color-shadow-input-focused)] focus:outline focus:outline-2 focus:outline-offset-[-2px] focus:outline-color-border-focused\"\n [value]=\"padTime(hours())\"\n [attr.aria-label]=\"'platform.scala-ng.datepicker_hour' | translate\"\n pattern=\"[0-9]+\"\n (keydown)=\"handleHoursKeydown($event)\"\n (change)=\"handleHoursInput($event)\"\n />\n <button\n sdsButton\n type=\"ghost\"\n [attr.aria-label]=\"'platform.scala-ng.datepicker_decrement_hour' | translate\"\n (click)=\"decrementHours()\"\n >\n <i\n sdsLeadingIcon\n class=\"fa-solid fa-chevron-down text-xs\"\n aria-hidden=\"true\"\n ></i>\n </button>\n </div>\n\n <span\n class=\"text-xl font-bold text-color-text-neutral-secondary\"\n aria-hidden=\"true\"\n >:</span\n >\n\n <div class=\"flex flex-col items-center gap-1\">\n <button\n sdsButton\n type=\"ghost\"\n [attr.aria-label]=\"'platform.scala-ng.datepicker_increment_minute' | translate\"\n (click)=\"incrementMinutes()\"\n >\n <i\n sdsLeadingIcon\n class=\"fa-solid fa-chevron-up text-xs\"\n aria-hidden=\"true\"\n ></i>\n </button>\n <input\n type=\"text\"\n inputmode=\"numeric\"\n [attr.maxlength]=\"timeInputMaxLength\"\n class=\"h-9 w-12 rounded-radius-medium border border-solid border-color-border-interactive-secondary bg-color-background-interactive-secondary text-center text-base font-medium text-color-text-neutral-primary outline-none focus:border-color-border-focused focus:shadow-[0px_0px_3px_1px_var(--sds-color-shadow-input-focused)] focus:outline focus:outline-2 focus:outline-offset-[-2px] focus:outline-color-border-focused\"\n [value]=\"padTime(minutes())\"\n [attr.aria-label]=\"'platform.scala-ng.datepicker_minute' | translate\"\n pattern=\"[0-9]+\"\n (keydown)=\"handleMinutesKeydown($event)\"\n (change)=\"handleMinutesInput($event)\"\n />\n <button\n sdsButton\n type=\"ghost\"\n [attr.aria-label]=\"'platform.scala-ng.datepicker_decrement_minute' | translate\"\n (click)=\"decrementMinutes()\"\n >\n <i\n sdsLeadingIcon\n class=\"fa-solid fa-chevron-down text-xs\"\n aria-hidden=\"true\"\n ></i>\n </button>\n </div>\n </div>\n }\n\n <div\n class=\"flex items-center justify-between border-t border-solid border-color-border px-4 py-2\"\n >\n <div class=\"flex gap-2\">\n @if (mode() === \"date\" || mode() === \"datetime\" || mode() === \"range\") {\n <button\n sdsButton\n type=\"secondary\"\n (click)=\"selectToday()\"\n >\n {{ \"platform.scala-ng.datepicker_today\" | translate }}\n </button>\n }\n </div>\n\n <div class=\"flex gap-2\">\n <button\n sdsButton\n type=\"ghost\"\n (click)=\"clearValue()\"\n >\n {{ \"platform.scala-ng.datepicker_clear\" | translate }}\n </button>\n\n @if (mode() === \"datetime\" || mode() === \"time\") {\n <button\n sdsButton\n type=\"primary\"\n (click)=\"confirm()\"\n >\n {{ \"platform.scala-ng.datepicker_confirm\" | translate }}\n </button>\n }\n </div>\n </div>\n </div>\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "directive", type: CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }, { kind: "directive", type: CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "component", type: SdsButtonComponent, selector: "button[sdsButton], a[sdsButton]", inputs: ["type", "destructive", "disabled", "size"] }, { kind: "component", type: SdsInputComponent, selector: "sds-input", inputs: ["label", "subtitle", "icon", "type", "placeholder", "size", "readonly", "showDefaultIcon", "showNativeDropdown", "errorMessages", "validMessage", "adviceMessage", "inputClassName", "containerClassName", "showLabel", "showHelper", "required", "state", "nativeInputAttrs", "inputId", "mask", "unmask", "maskPatterns", "showMaskTyped", "placeHolderCharacter", "prefix", "suffix", "clearIfNotMatch", "leadZeroDateTime", "hiddenInput", "inputMode", "maskHint", "separator", "thousandSeparator", "decimalDigits"], outputs: ["focusIn", "focusOut", "inputClick", "inputKeydown", "maskFilled"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "component", type: SdsInputFeedbackComponent, selector: "sds-input-feedback", inputs: ["control", "errorMessages", "validMessage", "adviceMessage"] }] });
|
|
1171
|
+
], viewQueries: [{ propertyName: "sdsInput", first: true, predicate: ["sdsInput"], descendants: true, isSignal: true }, { propertyName: "firstCalendarButton", first: true, predicate: ["firstCalendarButton"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "firstMonthViewButton", first: true, predicate: ["firstMonthViewButton"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "increaseHourButton", first: true, predicate: ["increaseHourButton"], descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: "<div\n cdkOverlayOrigin\n #trigger=\"cdkOverlayOrigin\"\n role=\"combobox\"\n aria-haspopup=\"grid\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"popupId()\"\n>\n <sds-input\n #sdsInput\n [label]=\"label()\"\n [subtitle]=\"subtitle()\"\n [state]=\"fieldState()\"\n [showHelper]=\"false\"\n [size]=\"size()\"\n icon=\"fa-solid fa-calendar\"\n [(ngModel)]=\"inputDate\"\n (ngModelChange)=\"handleParsedValue($event)\"\n [placeholder]=\"placeholderKey() | translate\"\n [inputId]=\"inputId()\"\n [type]=\"inputType()\"\n [mask]=\"inputMask()\"\n [leadZeroDateTime]=\"true\"\n [readonly]=\"mode() === 'range'\"\n [disabled]=\"isDisabledSignal()\"\n [showDefaultIcon]=\"false\"\n [showNativeDropdown]=\"false\"\n [nativeInputAttrs]=\"{ autocomplete: 'off' }\"\n (inputClick)=\"open()\"\n (inputKeydown)=\"handleTriggerKeydown($event)\"\n (focusOut)=\"handleInputFocusOut($event)\"\n />\n\n @let _errorMessages = errorMessages();\n @let control = ngControl?.control;\n @let _adviceMessage = adviceMessage();\n @if (_errorMessages && control) {\n <sds-input-feedback\n [control]=\"control\"\n [errorMessages]=\"_errorMessages\"\n [validMessage]=\"validMessage()\"\n [adviceMessage]=\"_adviceMessage\"\n />\n } @else if (_adviceMessage) {\n <span\n class=\"text-[14px] font-normal leading-[1.5]\"\n [class]=\"isDisabledSignal() ? 'text-color-text-disable' : 'text-color-text-neutral-secondary'\"\n >{{ _adviceMessage }}</span\n >\n }\n</div>\n\n<ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"trigger\"\n [cdkConnectedOverlayOpen]=\"isOpen()\"\n [cdkConnectedOverlayHasBackdrop]=\"true\"\n cdkConnectedOverlayBackdropClass=\"cdk-overlay-transparent-backdrop\"\n [cdkConnectedOverlayPositions]=\"positions\"\n (backdropClick)=\"close()\"\n (overlayKeydown)=\"handleOverlayKeydown($event)\"\n (detach)=\"isOpen.set(false)\"\n>\n <div\n class=\"z-50 w-[304px] rounded-radius-xlarge border border-solid border-color-border bg-surface-default shadow-shadow-popover\"\n role=\"dialog\"\n cdkTrapFocus\n [id]=\"popupId()\"\n [attr.aria-label]=\"dialogAriaLabelKey() | translate\"\n >\n @if (showCalendar()) {\n @if (pickerView() === 'calendar') {\n <div\n class=\"flex items-center justify-between border-b border-solid border-color-border px-4 py-3\"\n >\n <button\n #firstCalendarButton\n sdsButton\n type=\"secondary\"\n [disabled]=\"prevDisabled()\"\n [attr.aria-label]=\"'platform.scala-ng.datepicker_prev_month' | translate\"\n (click)=\"navigatePrev()\"\n >\n <i\n sdsLeadingIcon\n class=\"fa-solid fa-chevron-left text-xs\"\n aria-hidden=\"true\"\n ></i>\n </button>\n\n <button\n sdsButton\n type=\"ghost\"\n [attr.aria-label]=\"'platform.scala-ng.datepicker_select_month_year' | translate\"\n (click)=\"switchToMonths()\"\n >\n {{ currentMonthKey() | translate }} {{ currentYear() }}\n <i\n sdsTrailingIcon\n class=\"fa-solid fa-chevron-down text-[10px]\"\n aria-hidden=\"true\"\n ></i>\n </button>\n\n <button\n sdsButton\n type=\"secondary\"\n [disabled]=\"nextDisabled()\"\n [attr.aria-label]=\"'platform.scala-ng.datepicker_next_month' | translate\"\n (click)=\"navigateNext()\"\n >\n <i\n sdsLeadingIcon\n class=\"fa-solid fa-chevron-right text-xs\"\n aria-hidden=\"true\"\n ></i>\n </button>\n </div>\n\n <div\n class=\"grid grid-cols-7 gap-0 p-3\"\n role=\"grid\"\n >\n <div\n role=\"row\"\n class=\"contents\"\n >\n @for (dayKey of weekDayKeys; track dayKey) {\n <div\n class=\"flex h-8 items-center justify-center text-xs font-medium text-color-text-neutral-secondary\"\n role=\"columnheader\"\n [attr.aria-label]=\"dayKey | translate\"\n >\n {{ dayKey | translate }}\n </div>\n }\n </div>\n\n @for (week of calendarWeeks(); track $index) {\n <div\n role=\"row\"\n class=\"contents\"\n >\n @for (day of week; track day.date.toISOString()) {\n <button\n type=\"button\"\n role=\"gridcell\"\n class=\"group relative flex h-10 w-10 items-center justify-center text-sm font-normal transition-colors\"\n [attr.aria-label]=\"formatDayAriaLabel(day.date)\"\n [attr.aria-selected]=\"day.isSelected || day.isRangeStart || day.isRangeEnd\"\n [attr.aria-disabled]=\"day.isDisabled ? 'true' : null\"\n [disabled]=\"day.isDisabled\"\n [ngClass]=\"{\n 'bg-color-background-selected':\n day.isRangeStart || day.isRangeEnd || day.isInRange,\n 'rounded-l-full': day.isRangeStart && !day.isRangeEnd,\n 'rounded-r-full': day.isRangeEnd && !day.isRangeStart,\n 'rounded-full': day.isRangeStart && day.isRangeEnd,\n }\"\n (mouseenter)=\"onDayHover(day.date)\"\n (mouseleave)=\"onDayHover(null)\"\n (click)=\"selectDate(day)\"\n >\n <!-- Hover has its own key: ngClass drops a class shared by two keys when the later key is false. -->\n <span\n class=\"flex h-9 w-9 items-center justify-center rounded-full group-focus-visible:outline group-focus-visible:outline-2 group-focus-visible:outline-offset-[-2px] group-focus-visible:outline-color-border-focused\"\n [ngClass]=\"{\n 'bg-color-background-selected-bold text-color-text-inverse hover:bg-color-background-selected-bold-hovered':\n day.isSelected || day.isRangeStart || day.isRangeEnd,\n 'text-color-text-neutral-primary':\n !day.isSelected &&\n !day.isRangeStart &&\n !day.isRangeEnd &&\n !day.isDisabled &&\n day.isCurrentMonth,\n 'text-color-text-neutral-secondary':\n !day.isSelected &&\n !day.isRangeStart &&\n !day.isRangeEnd &&\n !day.isDisabled &&\n !day.isCurrentMonth,\n 'hover:bg-color-background-interactive-secondary-hovered':\n !day.isSelected && !day.isRangeStart && !day.isRangeEnd && !day.isDisabled,\n 'cursor-not-allowed text-color-text-disable': day.isDisabled,\n }\"\n >\n {{ day.dayOfMonth }}\n </span>\n @if (day.isToday && !day.isSelected && !day.isRangeStart && !day.isRangeEnd) {\n <span\n class=\"pointer-events-none absolute inset-0 m-auto h-9 w-9 rounded-full border border-solid border-color-border\"\n aria-hidden=\"true\"\n ></span>\n }\n </button>\n }\n </div>\n }\n </div>\n }\n\n @if (pickerView() === 'months') {\n <div\n class=\"flex items-center justify-between border-b border-solid border-color-border px-4 py-3\"\n >\n <button\n #firstMonthViewButton\n sdsButton\n type=\"secondary\"\n [disabled]=\"prevDisabled()\"\n [attr.aria-label]=\"'platform.scala-ng.datepicker_prev_year' | translate\"\n (click)=\"navigatePrev()\"\n >\n <i\n sdsLeadingIcon\n class=\"fa-solid fa-chevron-left text-xs\"\n aria-hidden=\"true\"\n ></i>\n </button>\n\n <span class=\"text-sm font-medium text-color-text-neutral-primary\">{{\n currentYear()\n }}</span>\n\n <button\n sdsButton\n type=\"secondary\"\n [disabled]=\"nextDisabled()\"\n [attr.aria-label]=\"'platform.scala-ng.datepicker_next_year' | translate\"\n (click)=\"navigateNext()\"\n >\n <i\n sdsLeadingIcon\n class=\"fa-solid fa-chevron-right text-xs\"\n aria-hidden=\"true\"\n ></i>\n </button>\n </div>\n\n <div\n class=\"grid grid-cols-3 gap-2 px-4 py-3\"\n role=\"grid\"\n [attr.aria-label]=\"'platform.scala-ng.datepicker_select_month' | translate\"\n >\n @for (row of monthsGrid(); track $index) {\n @for (month of row; track month.index) {\n <button\n type=\"button\"\n role=\"gridcell\"\n class=\"flex h-9 items-center justify-center rounded-radius-large text-sm font-normal transition-colors focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-color-border-focused\"\n [attr.aria-selected]=\"isMonthSelected(month.index)\"\n [attr.aria-disabled]=\"isMonthDisabled(month.index) ? 'true' : null\"\n [disabled]=\"isMonthDisabled(month.index)\"\n [ngClass]=\"{\n 'bg-color-background-selected-bold text-color-text-inverse': isMonthSelected(\n month.index\n ),\n 'text-color-text-neutral-primary hover:bg-color-background-interactive-secondary-hovered':\n !isMonthSelected(month.index) && !isMonthDisabled(month.index),\n 'cursor-not-allowed text-color-text-disable': isMonthDisabled(month.index),\n }\"\n (click)=\"selectMonth(month.index)\"\n >\n {{ month.key | translate }}\n </button>\n }\n }\n </div>\n\n @if (mode() !== 'month') {\n <div class=\"border-t border-solid border-color-border px-4 py-2\">\n <button\n sdsButton\n type=\"ghost\"\n (click)=\"backToCalendar()\"\n >\n <i\n sdsLeadingIcon\n class=\"fa-solid fa-arrow-left\"\n aria-hidden=\"true\"\n ></i>\n {{ 'platform.scala-ng.datepicker_back_to_calendar' | translate }}\n </button>\n </div>\n }\n }\n }\n\n @if (showTimePicker()) {\n <div\n class=\"flex items-center justify-center gap-3 px-4 py-3\"\n [ngClass]=\"{\n 'border-t border-solid border-color-border': showCalendar(),\n }\"\n role=\"group\"\n [attr.aria-label]=\"'platform.scala-ng.datepicker_select_time' | translate\"\n >\n <div class=\"flex flex-col items-center gap-1\">\n <button\n sdsButton\n #increaseHourButton\n type=\"ghost\"\n [attr.aria-label]=\"'platform.scala-ng.datepicker_increment_hour' | translate\"\n (click)=\"incrementHours()\"\n >\n <i\n sdsLeadingIcon\n class=\"fa-solid fa-chevron-up text-xs\"\n aria-hidden=\"true\"\n ></i>\n </button>\n <input\n type=\"text\"\n inputmode=\"numeric\"\n [attr.maxlength]=\"timeInputMaxLength\"\n class=\"h-9 w-12 rounded-radius-medium border border-solid border-color-border-interactive-secondary bg-color-background-interactive-secondary text-center text-base font-medium text-color-text-neutral-primary outline-none focus:border-color-border-focused focus:shadow-[0px_0px_3px_1px_var(--sds-color-shadow-input-focused)] focus:outline focus:outline-2 focus:outline-offset-[-2px] focus:outline-color-border-focused\"\n [value]=\"padTime(hours())\"\n [attr.aria-label]=\"'platform.scala-ng.datepicker_hour' | translate\"\n pattern=\"[0-9]+\"\n (keydown)=\"handleHoursKeydown($event)\"\n (change)=\"handleHoursInput($event)\"\n />\n <button\n sdsButton\n type=\"ghost\"\n [attr.aria-label]=\"'platform.scala-ng.datepicker_decrement_hour' | translate\"\n (click)=\"decrementHours()\"\n >\n <i\n sdsLeadingIcon\n class=\"fa-solid fa-chevron-down text-xs\"\n aria-hidden=\"true\"\n ></i>\n </button>\n </div>\n\n <span\n class=\"text-xl font-bold text-color-text-neutral-secondary\"\n aria-hidden=\"true\"\n >:</span\n >\n\n <div class=\"flex flex-col items-center gap-1\">\n <button\n sdsButton\n type=\"ghost\"\n [attr.aria-label]=\"'platform.scala-ng.datepicker_increment_minute' | translate\"\n (click)=\"incrementMinutes()\"\n >\n <i\n sdsLeadingIcon\n class=\"fa-solid fa-chevron-up text-xs\"\n aria-hidden=\"true\"\n ></i>\n </button>\n <input\n type=\"text\"\n inputmode=\"numeric\"\n [attr.maxlength]=\"timeInputMaxLength\"\n class=\"h-9 w-12 rounded-radius-medium border border-solid border-color-border-interactive-secondary bg-color-background-interactive-secondary text-center text-base font-medium text-color-text-neutral-primary outline-none focus:border-color-border-focused focus:shadow-[0px_0px_3px_1px_var(--sds-color-shadow-input-focused)] focus:outline focus:outline-2 focus:outline-offset-[-2px] focus:outline-color-border-focused\"\n [value]=\"padTime(minutes())\"\n [attr.aria-label]=\"'platform.scala-ng.datepicker_minute' | translate\"\n pattern=\"[0-9]+\"\n (keydown)=\"handleMinutesKeydown($event)\"\n (change)=\"handleMinutesInput($event)\"\n />\n <button\n sdsButton\n type=\"ghost\"\n [attr.aria-label]=\"'platform.scala-ng.datepicker_decrement_minute' | translate\"\n (click)=\"decrementMinutes()\"\n >\n <i\n sdsLeadingIcon\n class=\"fa-solid fa-chevron-down text-xs\"\n aria-hidden=\"true\"\n ></i>\n </button>\n </div>\n </div>\n }\n\n <div\n class=\"flex items-center justify-between border-t border-solid border-color-border px-4 py-2\"\n >\n <div class=\"flex gap-2\">\n @if (mode() === 'date' || mode() === 'datetime' || mode() === 'range') {\n <button\n sdsButton\n type=\"secondary\"\n (click)=\"selectToday()\"\n >\n {{ 'platform.scala-ng.datepicker_today' | translate }}\n </button>\n }\n </div>\n\n <div class=\"flex gap-2\">\n <button\n sdsButton\n type=\"ghost\"\n (click)=\"clearValue()\"\n >\n {{ 'platform.scala-ng.datepicker_clear' | translate }}\n </button>\n\n @if (mode() === 'datetime' || mode() === 'time') {\n <button\n sdsButton\n type=\"primary\"\n (click)=\"confirm()\"\n >\n {{ 'platform.scala-ng.datepicker_confirm' | translate }}\n </button>\n }\n </div>\n </div>\n </div>\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "directive", type: CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }, { kind: "directive", type: CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "component", type: SdsButtonComponent, selector: "button[sdsButton], a[sdsButton]", inputs: ["type", "destructive", "disabled", "size"] }, { kind: "component", type: SdsInputComponent, selector: "sds-input", inputs: ["label", "subtitle", "icon", "type", "placeholder", "size", "readonly", "showDefaultIcon", "showNativeDropdown", "errorMessages", "validMessage", "adviceMessage", "inputClassName", "containerClassName", "showLabel", "showHelper", "required", "loading", "state", "nativeInputAttrs", "inputId", "mask", "unmask", "maskPatterns", "showMaskTyped", "placeHolderCharacter", "prefix", "suffix", "clearIfNotMatch", "leadZeroDateTime", "hiddenInput", "inputMode", "maskHint", "separator", "thousandSeparator", "decimalDigits"], outputs: ["focusIn", "focusOut", "inputClick", "inputKeydown", "maskFilled"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "component", type: SdsInputFeedbackComponent, selector: "sds-input-feedback", inputs: ["control", "errorMessages", "validMessage", "adviceMessage"] }] });
|
|
1172
1172
|
}
|
|
1173
1173
|
__decorate([
|
|
1174
1174
|
numericKeysOnly()
|
|
@@ -1178,7 +1178,7 @@ __decorate([
|
|
|
1178
1178
|
], SdsDatePickerComponent.prototype, "handleMinutesKeydown", null);
|
|
1179
1179
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SdsDatePickerComponent, decorators: [{
|
|
1180
1180
|
type: Component,
|
|
1181
|
-
args: [{ selector:
|
|
1181
|
+
args: [{ selector: 'sds-date-picker', standalone: true, imports: [
|
|
1182
1182
|
TranslateModule,
|
|
1183
1183
|
NgClass,
|
|
1184
1184
|
CdkTrapFocus,
|
|
@@ -1195,7 +1195,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
1195
1195
|
useExisting: SdsDatePickerComponent,
|
|
1196
1196
|
multi: true,
|
|
1197
1197
|
},
|
|
1198
|
-
], template: "<div\n cdkOverlayOrigin\n #trigger=\"cdkOverlayOrigin\"\n role=\"combobox\"\n aria-haspopup=\"grid\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"popupId()\"\n>\n <sds-input\n #sdsInput\n [label]=\"label()\"\n [subtitle]=\"subtitle()\"\n [state]=\"fieldState()\"\n [showHelper]=\"false\"\n [size]=\"size()\"\n icon=\"fa-solid fa-calendar\"\n [(ngModel)]=\"inputDate\"\n (ngModelChange)=\"handleParsedValue($event)\"\n [placeholder]=\"placeholderKey() | translate\"\n [inputId]=\"inputId()\"\n [type]=\"inputType()\"\n [mask]=\"inputMask()\"\n [leadZeroDateTime]=\"true\"\n [readonly]=\"mode() === 'range'\"\n [disabled]=\"isDisabledSignal()\"\n [showDefaultIcon]=\"false\"\n [showNativeDropdown]=\"false\"\n [nativeInputAttrs]=\"{ autocomplete: 'off' }\"\n (inputClick)=\"open()\"\n (inputKeydown)=\"handleTriggerKeydown($event)\"\n (focusOut)=\"handleInputFocusOut($event)\"\n />\n\n @let _errorMessages = errorMessages();\n @let control = ngControl?.control;\n @let _adviceMessage = adviceMessage();\n @if (_errorMessages && control) {\n <sds-input-feedback\n [control]=\"control\"\n [errorMessages]=\"_errorMessages\"\n [validMessage]=\"validMessage()\"\n [adviceMessage]=\"_adviceMessage\"\n />\n } @else if (_adviceMessage) {\n <span\n class=\"text-[14px] font-normal leading-[1.5]\"\n [class]=\"isDisabledSignal() ? 'text-color-text-disable' : 'text-color-text-neutral-secondary'\"\n >{{ _adviceMessage }}</span\n >\n }\n</div>\n\n<ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"trigger\"\n [cdkConnectedOverlayOpen]=\"isOpen()\"\n [cdkConnectedOverlayHasBackdrop]=\"true\"\n cdkConnectedOverlayBackdropClass=\"cdk-overlay-transparent-backdrop\"\n [cdkConnectedOverlayPositions]=\"positions\"\n (backdropClick)=\"close()\"\n (overlayKeydown)=\"handleOverlayKeydown($event)\"\n (detach)=\"isOpen.set(false)\"\n>\n <div\n class=\"z-50 w-[304px] rounded-radius-xlarge border border-solid border-color-border bg-surface-default shadow-shadow-popover\"\n role=\"dialog\"\n cdkTrapFocus\n [id]=\"popupId()\"\n [attr.aria-label]=\"dialogAriaLabelKey() | translate\"\n >\n @if (showCalendar()) {\n @if (pickerView() === \"calendar\") {\n <div\n class=\"flex items-center justify-between border-b border-solid border-color-border px-4 py-3\"\n >\n <button\n #firstCalendarButton\n sdsButton\n type=\"secondary\"\n [disabled]=\"prevDisabled()\"\n [attr.aria-label]=\"'platform.scala-ng.datepicker_prev_month' | translate\"\n (click)=\"navigatePrev()\"\n >\n <i\n sdsLeadingIcon\n class=\"fa-solid fa-chevron-left text-xs\"\n aria-hidden=\"true\"\n ></i>\n </button>\n\n <button\n sdsButton\n type=\"ghost\"\n [attr.aria-label]=\"'platform.scala-ng.datepicker_select_month_year' | translate\"\n (click)=\"switchToMonths()\"\n >\n {{ currentMonthKey() | translate }} {{ currentYear() }}\n <i\n sdsTrailingIcon\n class=\"fa-solid fa-chevron-down text-[10px]\"\n aria-hidden=\"true\"\n ></i>\n </button>\n\n <button\n sdsButton\n type=\"secondary\"\n [disabled]=\"nextDisabled()\"\n [attr.aria-label]=\"'platform.scala-ng.datepicker_next_month' | translate\"\n (click)=\"navigateNext()\"\n >\n <i\n sdsLeadingIcon\n class=\"fa-solid fa-chevron-right text-xs\"\n aria-hidden=\"true\"\n ></i>\n </button>\n </div>\n\n <div\n class=\"grid grid-cols-7 gap-0 p-3\"\n role=\"grid\"\n >\n <div\n role=\"row\"\n class=\"contents\"\n >\n @for (dayKey of weekDayKeys; track dayKey) {\n <div\n class=\"flex h-8 items-center justify-center text-xs font-medium text-color-text-neutral-secondary\"\n role=\"columnheader\"\n [attr.aria-label]=\"dayKey | translate\"\n >\n {{ dayKey | translate }}\n </div>\n }\n </div>\n\n @for (week of calendarWeeks(); track $index) {\n <div\n role=\"row\"\n class=\"contents\"\n >\n @for (day of week; track day.date.toISOString()) {\n <button\n type=\"button\"\n role=\"gridcell\"\n class=\"group relative flex h-10 w-10 items-center justify-center text-sm font-normal transition-colors\"\n [attr.aria-label]=\"formatDayAriaLabel(day.date)\"\n [attr.aria-selected]=\"day.isSelected || day.isRangeStart || day.isRangeEnd\"\n [attr.aria-disabled]=\"day.isDisabled ? 'true' : null\"\n [disabled]=\"day.isDisabled\"\n [ngClass]=\"{\n 'bg-color-background-selected':\n day.isRangeStart || day.isRangeEnd || day.isInRange,\n 'rounded-l-full': day.isRangeStart && !day.isRangeEnd,\n 'rounded-r-full': day.isRangeEnd && !day.isRangeStart,\n 'rounded-full': day.isRangeStart && day.isRangeEnd,\n }\"\n (mouseenter)=\"onDayHover(day.date)\"\n (mouseleave)=\"onDayHover(null)\"\n (click)=\"selectDate(day)\"\n >\n <!-- Hover has its own key: ngClass drops a class shared by two keys when the later key is false. -->\n <span\n class=\"flex h-9 w-9 items-center justify-center rounded-full group-focus-visible:outline group-focus-visible:outline-2 group-focus-visible:outline-offset-[-2px] group-focus-visible:outline-color-border-focused\"\n [ngClass]=\"{\n 'bg-color-background-selected-bold text-color-text-inverse hover:bg-color-background-selected-bold-hovered':\n day.isSelected || day.isRangeStart || day.isRangeEnd,\n 'text-color-text-neutral-primary':\n !day.isSelected &&\n !day.isRangeStart &&\n !day.isRangeEnd &&\n !day.isDisabled &&\n day.isCurrentMonth,\n 'text-color-text-neutral-secondary':\n !day.isSelected &&\n !day.isRangeStart &&\n !day.isRangeEnd &&\n !day.isDisabled &&\n !day.isCurrentMonth,\n 'hover:bg-color-background-interactive-secondary-hovered':\n !day.isSelected && !day.isRangeStart && !day.isRangeEnd && !day.isDisabled,\n 'cursor-not-allowed text-color-text-disable': day.isDisabled,\n }\"\n >\n {{ day.dayOfMonth }}\n </span>\n @if (day.isToday && !day.isSelected && !day.isRangeStart && !day.isRangeEnd) {\n <span\n class=\"pointer-events-none absolute inset-0 m-auto h-9 w-9 rounded-full border border-solid border-color-border\"\n aria-hidden=\"true\"\n ></span>\n }\n </button>\n }\n </div>\n }\n </div>\n }\n\n @if (pickerView() === \"months\") {\n <div\n class=\"flex items-center justify-between border-b border-solid border-color-border px-4 py-3\"\n >\n <button\n #firstMonthViewButton\n sdsButton\n type=\"secondary\"\n [disabled]=\"prevDisabled()\"\n [attr.aria-label]=\"'platform.scala-ng.datepicker_prev_year' | translate\"\n (click)=\"navigatePrev()\"\n >\n <i\n sdsLeadingIcon\n class=\"fa-solid fa-chevron-left text-xs\"\n aria-hidden=\"true\"\n ></i>\n </button>\n\n <span class=\"text-sm font-medium text-color-text-neutral-primary\">{{\n currentYear()\n }}</span>\n\n <button\n sdsButton\n type=\"secondary\"\n [disabled]=\"nextDisabled()\"\n [attr.aria-label]=\"'platform.scala-ng.datepicker_next_year' | translate\"\n (click)=\"navigateNext()\"\n >\n <i\n sdsLeadingIcon\n class=\"fa-solid fa-chevron-right text-xs\"\n aria-hidden=\"true\"\n ></i>\n </button>\n </div>\n\n <div\n class=\"grid grid-cols-3 gap-2 px-4 py-3\"\n role=\"grid\"\n [attr.aria-label]=\"'platform.scala-ng.datepicker_select_month' | translate\"\n >\n @for (row of monthsGrid(); track $index) {\n @for (month of row; track month.index) {\n <button\n type=\"button\"\n role=\"gridcell\"\n class=\"flex h-9 items-center justify-center rounded-radius-large text-sm font-normal transition-colors focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-color-border-focused\"\n [attr.aria-selected]=\"isMonthSelected(month.index)\"\n [attr.aria-disabled]=\"isMonthDisabled(month.index) ? 'true' : null\"\n [disabled]=\"isMonthDisabled(month.index)\"\n [ngClass]=\"{\n 'bg-color-background-selected-bold text-color-text-inverse': isMonthSelected(\n month.index\n ),\n 'text-color-text-neutral-primary hover:bg-color-background-interactive-secondary-hovered':\n !isMonthSelected(month.index) && !isMonthDisabled(month.index),\n 'cursor-not-allowed text-color-text-disable': isMonthDisabled(month.index),\n }\"\n (click)=\"selectMonth(month.index)\"\n >\n {{ month.key | translate }}\n </button>\n }\n }\n </div>\n\n @if (mode() !== \"month\") {\n <div class=\"border-t border-solid border-color-border px-4 py-2\">\n <button\n sdsButton\n type=\"ghost\"\n (click)=\"backToCalendar()\"\n >\n <i\n sdsLeadingIcon\n class=\"fa-solid fa-arrow-left\"\n aria-hidden=\"true\"\n ></i>\n {{ \"platform.scala-ng.datepicker_back_to_calendar\" | translate }}\n </button>\n </div>\n }\n }\n }\n\n @if (showTimePicker()) {\n <div\n class=\"flex items-center justify-center gap-3 px-4 py-3\"\n [ngClass]=\"{\n 'border-t border-solid border-color-border': showCalendar(),\n }\"\n role=\"group\"\n [attr.aria-label]=\"'platform.scala-ng.datepicker_select_time' | translate\"\n >\n <div class=\"flex flex-col items-center gap-1\">\n <button\n sdsButton\n #increaseHourButton\n type=\"ghost\"\n [attr.aria-label]=\"'platform.scala-ng.datepicker_increment_hour' | translate\"\n (click)=\"incrementHours()\"\n >\n <i\n sdsLeadingIcon\n class=\"fa-solid fa-chevron-up text-xs\"\n aria-hidden=\"true\"\n ></i>\n </button>\n <input\n type=\"text\"\n inputmode=\"numeric\"\n [attr.maxlength]=\"timeInputMaxLength\"\n class=\"h-9 w-12 rounded-radius-medium border border-solid border-color-border-interactive-secondary bg-color-background-interactive-secondary text-center text-base font-medium text-color-text-neutral-primary outline-none focus:border-color-border-focused focus:shadow-[0px_0px_3px_1px_var(--sds-color-shadow-input-focused)] focus:outline focus:outline-2 focus:outline-offset-[-2px] focus:outline-color-border-focused\"\n [value]=\"padTime(hours())\"\n [attr.aria-label]=\"'platform.scala-ng.datepicker_hour' | translate\"\n pattern=\"[0-9]+\"\n (keydown)=\"handleHoursKeydown($event)\"\n (change)=\"handleHoursInput($event)\"\n />\n <button\n sdsButton\n type=\"ghost\"\n [attr.aria-label]=\"'platform.scala-ng.datepicker_decrement_hour' | translate\"\n (click)=\"decrementHours()\"\n >\n <i\n sdsLeadingIcon\n class=\"fa-solid fa-chevron-down text-xs\"\n aria-hidden=\"true\"\n ></i>\n </button>\n </div>\n\n <span\n class=\"text-xl font-bold text-color-text-neutral-secondary\"\n aria-hidden=\"true\"\n >:</span\n >\n\n <div class=\"flex flex-col items-center gap-1\">\n <button\n sdsButton\n type=\"ghost\"\n [attr.aria-label]=\"'platform.scala-ng.datepicker_increment_minute' | translate\"\n (click)=\"incrementMinutes()\"\n >\n <i\n sdsLeadingIcon\n class=\"fa-solid fa-chevron-up text-xs\"\n aria-hidden=\"true\"\n ></i>\n </button>\n <input\n type=\"text\"\n inputmode=\"numeric\"\n [attr.maxlength]=\"timeInputMaxLength\"\n class=\"h-9 w-12 rounded-radius-medium border border-solid border-color-border-interactive-secondary bg-color-background-interactive-secondary text-center text-base font-medium text-color-text-neutral-primary outline-none focus:border-color-border-focused focus:shadow-[0px_0px_3px_1px_var(--sds-color-shadow-input-focused)] focus:outline focus:outline-2 focus:outline-offset-[-2px] focus:outline-color-border-focused\"\n [value]=\"padTime(minutes())\"\n [attr.aria-label]=\"'platform.scala-ng.datepicker_minute' | translate\"\n pattern=\"[0-9]+\"\n (keydown)=\"handleMinutesKeydown($event)\"\n (change)=\"handleMinutesInput($event)\"\n />\n <button\n sdsButton\n type=\"ghost\"\n [attr.aria-label]=\"'platform.scala-ng.datepicker_decrement_minute' | translate\"\n (click)=\"decrementMinutes()\"\n >\n <i\n sdsLeadingIcon\n class=\"fa-solid fa-chevron-down text-xs\"\n aria-hidden=\"true\"\n ></i>\n </button>\n </div>\n </div>\n }\n\n <div\n class=\"flex items-center justify-between border-t border-solid border-color-border px-4 py-2\"\n >\n <div class=\"flex gap-2\">\n @if (mode() === \"date\" || mode() === \"datetime\" || mode() === \"range\") {\n <button\n sdsButton\n type=\"secondary\"\n (click)=\"selectToday()\"\n >\n {{ \"platform.scala-ng.datepicker_today\" | translate }}\n </button>\n }\n </div>\n\n <div class=\"flex gap-2\">\n <button\n sdsButton\n type=\"ghost\"\n (click)=\"clearValue()\"\n >\n {{ \"platform.scala-ng.datepicker_clear\" | translate }}\n </button>\n\n @if (mode() === \"datetime\" || mode() === \"time\") {\n <button\n sdsButton\n type=\"primary\"\n (click)=\"confirm()\"\n >\n {{ \"platform.scala-ng.datepicker_confirm\" | translate }}\n </button>\n }\n </div>\n </div>\n </div>\n</ng-template>\n" }]
|
|
1198
|
+
], template: "<div\n cdkOverlayOrigin\n #trigger=\"cdkOverlayOrigin\"\n role=\"combobox\"\n aria-haspopup=\"grid\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"popupId()\"\n>\n <sds-input\n #sdsInput\n [label]=\"label()\"\n [subtitle]=\"subtitle()\"\n [state]=\"fieldState()\"\n [showHelper]=\"false\"\n [size]=\"size()\"\n icon=\"fa-solid fa-calendar\"\n [(ngModel)]=\"inputDate\"\n (ngModelChange)=\"handleParsedValue($event)\"\n [placeholder]=\"placeholderKey() | translate\"\n [inputId]=\"inputId()\"\n [type]=\"inputType()\"\n [mask]=\"inputMask()\"\n [leadZeroDateTime]=\"true\"\n [readonly]=\"mode() === 'range'\"\n [disabled]=\"isDisabledSignal()\"\n [showDefaultIcon]=\"false\"\n [showNativeDropdown]=\"false\"\n [nativeInputAttrs]=\"{ autocomplete: 'off' }\"\n (inputClick)=\"open()\"\n (inputKeydown)=\"handleTriggerKeydown($event)\"\n (focusOut)=\"handleInputFocusOut($event)\"\n />\n\n @let _errorMessages = errorMessages();\n @let control = ngControl?.control;\n @let _adviceMessage = adviceMessage();\n @if (_errorMessages && control) {\n <sds-input-feedback\n [control]=\"control\"\n [errorMessages]=\"_errorMessages\"\n [validMessage]=\"validMessage()\"\n [adviceMessage]=\"_adviceMessage\"\n />\n } @else if (_adviceMessage) {\n <span\n class=\"text-[14px] font-normal leading-[1.5]\"\n [class]=\"isDisabledSignal() ? 'text-color-text-disable' : 'text-color-text-neutral-secondary'\"\n >{{ _adviceMessage }}</span\n >\n }\n</div>\n\n<ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"trigger\"\n [cdkConnectedOverlayOpen]=\"isOpen()\"\n [cdkConnectedOverlayHasBackdrop]=\"true\"\n cdkConnectedOverlayBackdropClass=\"cdk-overlay-transparent-backdrop\"\n [cdkConnectedOverlayPositions]=\"positions\"\n (backdropClick)=\"close()\"\n (overlayKeydown)=\"handleOverlayKeydown($event)\"\n (detach)=\"isOpen.set(false)\"\n>\n <div\n class=\"z-50 w-[304px] rounded-radius-xlarge border border-solid border-color-border bg-surface-default shadow-shadow-popover\"\n role=\"dialog\"\n cdkTrapFocus\n [id]=\"popupId()\"\n [attr.aria-label]=\"dialogAriaLabelKey() | translate\"\n >\n @if (showCalendar()) {\n @if (pickerView() === 'calendar') {\n <div\n class=\"flex items-center justify-between border-b border-solid border-color-border px-4 py-3\"\n >\n <button\n #firstCalendarButton\n sdsButton\n type=\"secondary\"\n [disabled]=\"prevDisabled()\"\n [attr.aria-label]=\"'platform.scala-ng.datepicker_prev_month' | translate\"\n (click)=\"navigatePrev()\"\n >\n <i\n sdsLeadingIcon\n class=\"fa-solid fa-chevron-left text-xs\"\n aria-hidden=\"true\"\n ></i>\n </button>\n\n <button\n sdsButton\n type=\"ghost\"\n [attr.aria-label]=\"'platform.scala-ng.datepicker_select_month_year' | translate\"\n (click)=\"switchToMonths()\"\n >\n {{ currentMonthKey() | translate }} {{ currentYear() }}\n <i\n sdsTrailingIcon\n class=\"fa-solid fa-chevron-down text-[10px]\"\n aria-hidden=\"true\"\n ></i>\n </button>\n\n <button\n sdsButton\n type=\"secondary\"\n [disabled]=\"nextDisabled()\"\n [attr.aria-label]=\"'platform.scala-ng.datepicker_next_month' | translate\"\n (click)=\"navigateNext()\"\n >\n <i\n sdsLeadingIcon\n class=\"fa-solid fa-chevron-right text-xs\"\n aria-hidden=\"true\"\n ></i>\n </button>\n </div>\n\n <div\n class=\"grid grid-cols-7 gap-0 p-3\"\n role=\"grid\"\n >\n <div\n role=\"row\"\n class=\"contents\"\n >\n @for (dayKey of weekDayKeys; track dayKey) {\n <div\n class=\"flex h-8 items-center justify-center text-xs font-medium text-color-text-neutral-secondary\"\n role=\"columnheader\"\n [attr.aria-label]=\"dayKey | translate\"\n >\n {{ dayKey | translate }}\n </div>\n }\n </div>\n\n @for (week of calendarWeeks(); track $index) {\n <div\n role=\"row\"\n class=\"contents\"\n >\n @for (day of week; track day.date.toISOString()) {\n <button\n type=\"button\"\n role=\"gridcell\"\n class=\"group relative flex h-10 w-10 items-center justify-center text-sm font-normal transition-colors\"\n [attr.aria-label]=\"formatDayAriaLabel(day.date)\"\n [attr.aria-selected]=\"day.isSelected || day.isRangeStart || day.isRangeEnd\"\n [attr.aria-disabled]=\"day.isDisabled ? 'true' : null\"\n [disabled]=\"day.isDisabled\"\n [ngClass]=\"{\n 'bg-color-background-selected':\n day.isRangeStart || day.isRangeEnd || day.isInRange,\n 'rounded-l-full': day.isRangeStart && !day.isRangeEnd,\n 'rounded-r-full': day.isRangeEnd && !day.isRangeStart,\n 'rounded-full': day.isRangeStart && day.isRangeEnd,\n }\"\n (mouseenter)=\"onDayHover(day.date)\"\n (mouseleave)=\"onDayHover(null)\"\n (click)=\"selectDate(day)\"\n >\n <!-- Hover has its own key: ngClass drops a class shared by two keys when the later key is false. -->\n <span\n class=\"flex h-9 w-9 items-center justify-center rounded-full group-focus-visible:outline group-focus-visible:outline-2 group-focus-visible:outline-offset-[-2px] group-focus-visible:outline-color-border-focused\"\n [ngClass]=\"{\n 'bg-color-background-selected-bold text-color-text-inverse hover:bg-color-background-selected-bold-hovered':\n day.isSelected || day.isRangeStart || day.isRangeEnd,\n 'text-color-text-neutral-primary':\n !day.isSelected &&\n !day.isRangeStart &&\n !day.isRangeEnd &&\n !day.isDisabled &&\n day.isCurrentMonth,\n 'text-color-text-neutral-secondary':\n !day.isSelected &&\n !day.isRangeStart &&\n !day.isRangeEnd &&\n !day.isDisabled &&\n !day.isCurrentMonth,\n 'hover:bg-color-background-interactive-secondary-hovered':\n !day.isSelected && !day.isRangeStart && !day.isRangeEnd && !day.isDisabled,\n 'cursor-not-allowed text-color-text-disable': day.isDisabled,\n }\"\n >\n {{ day.dayOfMonth }}\n </span>\n @if (day.isToday && !day.isSelected && !day.isRangeStart && !day.isRangeEnd) {\n <span\n class=\"pointer-events-none absolute inset-0 m-auto h-9 w-9 rounded-full border border-solid border-color-border\"\n aria-hidden=\"true\"\n ></span>\n }\n </button>\n }\n </div>\n }\n </div>\n }\n\n @if (pickerView() === 'months') {\n <div\n class=\"flex items-center justify-between border-b border-solid border-color-border px-4 py-3\"\n >\n <button\n #firstMonthViewButton\n sdsButton\n type=\"secondary\"\n [disabled]=\"prevDisabled()\"\n [attr.aria-label]=\"'platform.scala-ng.datepicker_prev_year' | translate\"\n (click)=\"navigatePrev()\"\n >\n <i\n sdsLeadingIcon\n class=\"fa-solid fa-chevron-left text-xs\"\n aria-hidden=\"true\"\n ></i>\n </button>\n\n <span class=\"text-sm font-medium text-color-text-neutral-primary\">{{\n currentYear()\n }}</span>\n\n <button\n sdsButton\n type=\"secondary\"\n [disabled]=\"nextDisabled()\"\n [attr.aria-label]=\"'platform.scala-ng.datepicker_next_year' | translate\"\n (click)=\"navigateNext()\"\n >\n <i\n sdsLeadingIcon\n class=\"fa-solid fa-chevron-right text-xs\"\n aria-hidden=\"true\"\n ></i>\n </button>\n </div>\n\n <div\n class=\"grid grid-cols-3 gap-2 px-4 py-3\"\n role=\"grid\"\n [attr.aria-label]=\"'platform.scala-ng.datepicker_select_month' | translate\"\n >\n @for (row of monthsGrid(); track $index) {\n @for (month of row; track month.index) {\n <button\n type=\"button\"\n role=\"gridcell\"\n class=\"flex h-9 items-center justify-center rounded-radius-large text-sm font-normal transition-colors focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-color-border-focused\"\n [attr.aria-selected]=\"isMonthSelected(month.index)\"\n [attr.aria-disabled]=\"isMonthDisabled(month.index) ? 'true' : null\"\n [disabled]=\"isMonthDisabled(month.index)\"\n [ngClass]=\"{\n 'bg-color-background-selected-bold text-color-text-inverse': isMonthSelected(\n month.index\n ),\n 'text-color-text-neutral-primary hover:bg-color-background-interactive-secondary-hovered':\n !isMonthSelected(month.index) && !isMonthDisabled(month.index),\n 'cursor-not-allowed text-color-text-disable': isMonthDisabled(month.index),\n }\"\n (click)=\"selectMonth(month.index)\"\n >\n {{ month.key | translate }}\n </button>\n }\n }\n </div>\n\n @if (mode() !== 'month') {\n <div class=\"border-t border-solid border-color-border px-4 py-2\">\n <button\n sdsButton\n type=\"ghost\"\n (click)=\"backToCalendar()\"\n >\n <i\n sdsLeadingIcon\n class=\"fa-solid fa-arrow-left\"\n aria-hidden=\"true\"\n ></i>\n {{ 'platform.scala-ng.datepicker_back_to_calendar' | translate }}\n </button>\n </div>\n }\n }\n }\n\n @if (showTimePicker()) {\n <div\n class=\"flex items-center justify-center gap-3 px-4 py-3\"\n [ngClass]=\"{\n 'border-t border-solid border-color-border': showCalendar(),\n }\"\n role=\"group\"\n [attr.aria-label]=\"'platform.scala-ng.datepicker_select_time' | translate\"\n >\n <div class=\"flex flex-col items-center gap-1\">\n <button\n sdsButton\n #increaseHourButton\n type=\"ghost\"\n [attr.aria-label]=\"'platform.scala-ng.datepicker_increment_hour' | translate\"\n (click)=\"incrementHours()\"\n >\n <i\n sdsLeadingIcon\n class=\"fa-solid fa-chevron-up text-xs\"\n aria-hidden=\"true\"\n ></i>\n </button>\n <input\n type=\"text\"\n inputmode=\"numeric\"\n [attr.maxlength]=\"timeInputMaxLength\"\n class=\"h-9 w-12 rounded-radius-medium border border-solid border-color-border-interactive-secondary bg-color-background-interactive-secondary text-center text-base font-medium text-color-text-neutral-primary outline-none focus:border-color-border-focused focus:shadow-[0px_0px_3px_1px_var(--sds-color-shadow-input-focused)] focus:outline focus:outline-2 focus:outline-offset-[-2px] focus:outline-color-border-focused\"\n [value]=\"padTime(hours())\"\n [attr.aria-label]=\"'platform.scala-ng.datepicker_hour' | translate\"\n pattern=\"[0-9]+\"\n (keydown)=\"handleHoursKeydown($event)\"\n (change)=\"handleHoursInput($event)\"\n />\n <button\n sdsButton\n type=\"ghost\"\n [attr.aria-label]=\"'platform.scala-ng.datepicker_decrement_hour' | translate\"\n (click)=\"decrementHours()\"\n >\n <i\n sdsLeadingIcon\n class=\"fa-solid fa-chevron-down text-xs\"\n aria-hidden=\"true\"\n ></i>\n </button>\n </div>\n\n <span\n class=\"text-xl font-bold text-color-text-neutral-secondary\"\n aria-hidden=\"true\"\n >:</span\n >\n\n <div class=\"flex flex-col items-center gap-1\">\n <button\n sdsButton\n type=\"ghost\"\n [attr.aria-label]=\"'platform.scala-ng.datepicker_increment_minute' | translate\"\n (click)=\"incrementMinutes()\"\n >\n <i\n sdsLeadingIcon\n class=\"fa-solid fa-chevron-up text-xs\"\n aria-hidden=\"true\"\n ></i>\n </button>\n <input\n type=\"text\"\n inputmode=\"numeric\"\n [attr.maxlength]=\"timeInputMaxLength\"\n class=\"h-9 w-12 rounded-radius-medium border border-solid border-color-border-interactive-secondary bg-color-background-interactive-secondary text-center text-base font-medium text-color-text-neutral-primary outline-none focus:border-color-border-focused focus:shadow-[0px_0px_3px_1px_var(--sds-color-shadow-input-focused)] focus:outline focus:outline-2 focus:outline-offset-[-2px] focus:outline-color-border-focused\"\n [value]=\"padTime(minutes())\"\n [attr.aria-label]=\"'platform.scala-ng.datepicker_minute' | translate\"\n pattern=\"[0-9]+\"\n (keydown)=\"handleMinutesKeydown($event)\"\n (change)=\"handleMinutesInput($event)\"\n />\n <button\n sdsButton\n type=\"ghost\"\n [attr.aria-label]=\"'platform.scala-ng.datepicker_decrement_minute' | translate\"\n (click)=\"decrementMinutes()\"\n >\n <i\n sdsLeadingIcon\n class=\"fa-solid fa-chevron-down text-xs\"\n aria-hidden=\"true\"\n ></i>\n </button>\n </div>\n </div>\n }\n\n <div\n class=\"flex items-center justify-between border-t border-solid border-color-border px-4 py-2\"\n >\n <div class=\"flex gap-2\">\n @if (mode() === 'date' || mode() === 'datetime' || mode() === 'range') {\n <button\n sdsButton\n type=\"secondary\"\n (click)=\"selectToday()\"\n >\n {{ 'platform.scala-ng.datepicker_today' | translate }}\n </button>\n }\n </div>\n\n <div class=\"flex gap-2\">\n <button\n sdsButton\n type=\"ghost\"\n (click)=\"clearValue()\"\n >\n {{ 'platform.scala-ng.datepicker_clear' | translate }}\n </button>\n\n @if (mode() === 'datetime' || mode() === 'time') {\n <button\n sdsButton\n type=\"primary\"\n (click)=\"confirm()\"\n >\n {{ 'platform.scala-ng.datepicker_confirm' | translate }}\n </button>\n }\n </div>\n </div>\n </div>\n</ng-template>\n" }]
|
|
1199
1199
|
}], propDecorators: { handleHoursKeydown: [], handleMinutesKeydown: [] } });
|
|
1200
1200
|
|
|
1201
1201
|
/**
|