@ids-group-ltd/ids-design-system 0.11.4 → 0.12.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/CHANGELOG.md +53 -3
- package/components/README.md +86 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-accordion.mjs +85 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-accordion.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-alert.mjs +70 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-alert.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-app-layout.mjs +573 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-app-layout.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-auth-layout.mjs +86 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-auth-layout.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-autocomplete.mjs +615 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-autocomplete.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-avatar-group.mjs +30 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-avatar-group.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-avatar.mjs +188 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-avatar.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-badge.mjs +59 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-badge.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-banner.mjs +92 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-banner.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-bottom-sheet.mjs +204 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-bottom-sheet.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-breadcrumbs.mjs +100 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-breadcrumbs.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-button-group.mjs +23 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-button-group.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-button.mjs +180 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-button.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-calendar-day.mjs +78 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-calendar-day.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-card.mjs +49 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-card.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-checkbox.mjs +73 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-checkbox.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-color-picker.mjs +397 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-color-picker.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-date-picker.mjs +1231 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-date-picker.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-description-list.mjs +51 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-description-list.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-divider.mjs +35 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-divider.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-drawer.mjs +109 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-drawer.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-dropzone.mjs +111 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-dropzone.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-empty-state.mjs +52 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-empty-state.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-field-group.mjs +92 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-field-group.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-field-message.mjs +62 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-field-message.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-filter-bar.mjs +164 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-filter-bar.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-icon-button.mjs +85 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-icon-button.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-input.mjs +223 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-input.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-layout.mjs +63 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-layout.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-list.mjs +53 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-list.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-loading-overlay.mjs +43 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-loading-overlay.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-menu.mjs +286 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-menu.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-modal.mjs +329 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-modal.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-multi-select.mjs +612 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-multi-select.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-number-stepper.mjs +69 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-number-stepper.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-otp-input.mjs +191 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-otp-input.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-page-footer.mjs +23 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-page-footer.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-page-header.mjs +43 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-page-header.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-pagination.mjs +85 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-pagination.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-password-rules.mjs +95 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-password-rules.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-popover.mjs +240 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-popover.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-progress.mjs +41 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-progress.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-radio-group.mjs +235 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-radio-group.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-reserve-messages.mjs +62 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-reserve-messages.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-search.mjs +173 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-search.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-segmented.mjs +123 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-segmented.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-select.mjs +461 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-select.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav-footer.mjs +107 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav-footer.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav.mjs +185 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-skeleton.mjs +32 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-skeleton.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-slider.mjs +204 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-slider.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-spinner.mjs +25 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-spinner.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-split-button.mjs +53 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-split-button.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-stat.mjs +99 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-stat.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-status-dot.mjs +26 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-status-dot.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-stepper.mjs +74 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-stepper.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-switch.mjs +76 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-switch.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs +1802 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-tabs.mjs +381 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-tabs.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-tag.mjs +44 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-tag.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-textarea.mjs +158 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-textarea.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-time-picker.mjs +671 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-time-picker.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-timeline.mjs +41 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-timeline.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-toast.mjs +547 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-toast.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-toggle-button.mjs +34 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-toggle-button.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-tooltip.mjs +218 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-tooltip.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-topbar.mjs +18 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-topbar.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-tree.mjs +153 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-tree.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-w3w.mjs +48 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-w3w.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components.mjs +1338 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-core.mjs +325 -0
- package/fesm2022/ids-group-ltd-ids-design-system-core.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-icons.mjs +101 -0
- package/fesm2022/ids-group-ltd-ids-design-system-icons.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-overlay.mjs +56 -0
- package/fesm2022/ids-group-ltd-ids-design-system-overlay.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-theme.mjs +37 -0
- package/fesm2022/ids-group-ltd-ids-design-system-theme.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system.mjs +72 -14267
- package/fesm2022/ids-group-ltd-ids-design-system.mjs.map +1 -1
- package/migrations/0.11.0.json +0 -2
- package/migrations/0.11.1.json +2 -1
- package/migrations/0.11.2.json +2 -1
- package/migrations/0.11.3.json +3 -2
- package/migrations/0.11.4.json +7 -1
- package/migrations/0.12.0.json +22 -0
- package/migrations/0.4.0.json +2 -1
- package/migrations/0.7.1.json +2 -1
- package/package.json +573 -1
- package/themes/README.md +4 -4
- package/types/ids-group-ltd-ids-design-system-components-accordion.d.ts +48 -0
- package/types/ids-group-ltd-ids-design-system-components-alert.d.ts +32 -0
- package/types/ids-group-ltd-ids-design-system-components-app-layout.d.ts +260 -0
- package/types/ids-group-ltd-ids-design-system-components-auth-layout.d.ts +75 -0
- package/types/ids-group-ltd-ids-design-system-components-autocomplete.d.ts +226 -0
- package/types/ids-group-ltd-ids-design-system-components-avatar-group.d.ts +13 -0
- package/types/ids-group-ltd-ids-design-system-components-avatar.d.ts +99 -0
- package/types/ids-group-ltd-ids-design-system-components-badge.d.ts +25 -0
- package/types/ids-group-ltd-ids-design-system-components-banner.d.ts +41 -0
- package/types/ids-group-ltd-ids-design-system-components-bottom-sheet.d.ts +61 -0
- package/types/ids-group-ltd-ids-design-system-components-breadcrumbs.d.ts +66 -0
- package/types/ids-group-ltd-ids-design-system-components-button-group.d.ts +10 -0
- package/types/ids-group-ltd-ids-design-system-components-button.d.ts +90 -0
- package/types/ids-group-ltd-ids-design-system-components-calendar-day.d.ts +41 -0
- package/types/ids-group-ltd-ids-design-system-components-card.d.ts +24 -0
- package/types/ids-group-ltd-ids-design-system-components-checkbox.d.ts +41 -0
- package/types/ids-group-ltd-ids-design-system-components-color-picker.d.ts +79 -0
- package/types/ids-group-ltd-ids-design-system-components-date-picker.d.ts +251 -0
- package/types/ids-group-ltd-ids-design-system-components-description-list.d.ts +25 -0
- package/types/ids-group-ltd-ids-design-system-components-divider.d.ts +22 -0
- package/types/ids-group-ltd-ids-design-system-components-drawer.d.ts +38 -0
- package/types/ids-group-ltd-ids-design-system-components-dropzone.d.ts +45 -0
- package/types/ids-group-ltd-ids-design-system-components-empty-state.d.ts +22 -0
- package/types/ids-group-ltd-ids-design-system-components-field-group.d.ts +73 -0
- package/types/ids-group-ltd-ids-design-system-components-field-message.d.ts +36 -0
- package/types/ids-group-ltd-ids-design-system-components-filter-bar.d.ts +83 -0
- package/types/ids-group-ltd-ids-design-system-components-icon-button.d.ts +56 -0
- package/types/ids-group-ltd-ids-design-system-components-input.d.ts +121 -0
- package/types/ids-group-ltd-ids-design-system-components-layout.d.ts +39 -0
- package/types/ids-group-ltd-ids-design-system-components-list.d.ts +29 -0
- package/types/ids-group-ltd-ids-design-system-components-loading-overlay.d.ts +31 -0
- package/types/ids-group-ltd-ids-design-system-components-menu.d.ts +82 -0
- package/types/ids-group-ltd-ids-design-system-components-modal.d.ts +124 -0
- package/types/ids-group-ltd-ids-design-system-components-multi-select.d.ts +213 -0
- package/types/ids-group-ltd-ids-design-system-components-number-stepper.d.ts +31 -0
- package/types/ids-group-ltd-ids-design-system-components-otp-input.d.ts +52 -0
- package/types/ids-group-ltd-ids-design-system-components-page-footer.d.ts +13 -0
- package/types/ids-group-ltd-ids-design-system-components-page-header.d.ts +21 -0
- package/types/ids-group-ltd-ids-design-system-components-pagination.d.ts +32 -0
- package/types/ids-group-ltd-ids-design-system-components-password-rules.d.ts +80 -0
- package/types/ids-group-ltd-ids-design-system-components-popover.d.ts +48 -0
- package/types/ids-group-ltd-ids-design-system-components-progress.d.ts +22 -0
- package/types/ids-group-ltd-ids-design-system-components-radio-group.d.ts +106 -0
- package/types/ids-group-ltd-ids-design-system-components-reserve-messages.d.ts +33 -0
- package/types/ids-group-ltd-ids-design-system-components-search.d.ts +82 -0
- package/types/ids-group-ltd-ids-design-system-components-segmented.d.ts +40 -0
- package/types/ids-group-ltd-ids-design-system-components-select.d.ts +152 -0
- package/types/ids-group-ltd-ids-design-system-components-sidenav-footer.d.ts +92 -0
- package/types/ids-group-ltd-ids-design-system-components-sidenav.d.ts +131 -0
- package/types/ids-group-ltd-ids-design-system-components-skeleton.d.ts +16 -0
- package/types/ids-group-ltd-ids-design-system-components-slider.d.ts +51 -0
- package/types/ids-group-ltd-ids-design-system-components-spinner.d.ts +11 -0
- package/types/ids-group-ltd-ids-design-system-components-split-button.d.ts +38 -0
- package/types/ids-group-ltd-ids-design-system-components-stat.d.ts +44 -0
- package/types/ids-group-ltd-ids-design-system-components-status-dot.d.ts +12 -0
- package/types/ids-group-ltd-ids-design-system-components-stepper.d.ts +32 -0
- package/types/ids-group-ltd-ids-design-system-components-switch.d.ts +40 -0
- package/types/ids-group-ltd-ids-design-system-components-table.d.ts +791 -0
- package/types/ids-group-ltd-ids-design-system-components-tabs.d.ts +118 -0
- package/types/ids-group-ltd-ids-design-system-components-tag.d.ts +26 -0
- package/types/ids-group-ltd-ids-design-system-components-textarea.d.ts +85 -0
- package/types/ids-group-ltd-ids-design-system-components-time-picker.d.ts +188 -0
- package/types/ids-group-ltd-ids-design-system-components-timeline.d.ts +24 -0
- package/types/ids-group-ltd-ids-design-system-components-toast.d.ts +167 -0
- package/types/ids-group-ltd-ids-design-system-components-toggle-button.d.ts +18 -0
- package/types/ids-group-ltd-ids-design-system-components-tooltip.d.ts +66 -0
- package/types/ids-group-ltd-ids-design-system-components-topbar.d.ts +8 -0
- package/types/ids-group-ltd-ids-design-system-components-tree.d.ts +46 -0
- package/types/ids-group-ltd-ids-design-system-components-w3w.d.ts +18 -0
- package/types/ids-group-ltd-ids-design-system-components.d.ts +604 -0
- package/types/ids-group-ltd-ids-design-system-core.d.ts +428 -0
- package/types/ids-group-ltd-ids-design-system-icons.d.ts +52 -0
- package/types/ids-group-ltd-ids-design-system-overlay.d.ts +32 -0
- package/types/ids-group-ltd-ids-design-system-theme.d.ts +29 -0
- package/types/ids-group-ltd-ids-design-system.d.ts +72 -5594
- package/LICENSE +0 -21
- package/README.md +0 -73
|
@@ -0,0 +1,671 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, numberAttribute, output, viewChildren, computed, ViewEncapsulation, Component, inject, ViewContainerRef, Injector, ElementRef, model, booleanAttribute, signal, viewChild, afterNextRender, forwardRef } from '@angular/core';
|
|
3
|
+
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
4
|
+
import { Overlay } from '@angular/cdk/overlay';
|
|
5
|
+
import { TemplatePortal } from '@angular/cdk/portal';
|
|
6
|
+
import { DsControlValueAccessor, trimmedText, resolveFieldMessage, dropdownOverlay, prepareOverlayEnter, forwardOverlayTokens, closeOnOutsidePointer, closeOnScroll, focusIsInside, disposeWithLeave } from '@ids-group-ltd/ids-design-system/components';
|
|
7
|
+
import { IconComponent } from '@ids-group-ltd/ids-design-system/icons';
|
|
8
|
+
import { FieldMessageComponent } from '@ids-group-ltd/ids-design-system/components/field-message';
|
|
9
|
+
import { DS_CONFIG, resolveWithConfig } from '@ids-group-ltd/ids-design-system/core';
|
|
10
|
+
|
|
11
|
+
function pad2(value) {
|
|
12
|
+
return value < 10 ? `0${value}` : `${value}`;
|
|
13
|
+
}
|
|
14
|
+
/** Parse "HH:MM" (24h) → {h,m}, or null when malformed / out of range. */
|
|
15
|
+
function parseTime(value) {
|
|
16
|
+
if (!value) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
const match = /^(\d{1,2}):(\d{2})$/.exec(value.trim());
|
|
20
|
+
if (!match) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
const hours = Number(match[1]);
|
|
24
|
+
const minutes = Number(match[2]);
|
|
25
|
+
if (hours < 0 || hours > 23 || minutes < 0 || minutes > 59) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
return { h: hours, m: minutes };
|
|
29
|
+
}
|
|
30
|
+
function toMinutes(value) {
|
|
31
|
+
const parsed = parseTime(value);
|
|
32
|
+
return parsed ? parsed.h * 60 + parsed.m : null;
|
|
33
|
+
}
|
|
34
|
+
function fromMinutes(total) {
|
|
35
|
+
const wrapped = ((total % 1440) + 1440) % 1440;
|
|
36
|
+
return `${pad2(Math.floor(wrapped / 60))}:${pad2(wrapped % 60)}`;
|
|
37
|
+
}
|
|
38
|
+
function to12h(h24) {
|
|
39
|
+
const period = h24 < 12 ? 'AM' : 'PM';
|
|
40
|
+
const hours = h24 % 12 === 0 ? 12 : h24 % 12;
|
|
41
|
+
return { h: hours, period };
|
|
42
|
+
}
|
|
43
|
+
function from12h(h12, period) {
|
|
44
|
+
const base = h12 % 12; // 12 → 0
|
|
45
|
+
return period === 'PM' ? base + 12 : base;
|
|
46
|
+
}
|
|
47
|
+
/** Display string for the trigger; '' when value is null/invalid. */
|
|
48
|
+
function formatTime(value, format) {
|
|
49
|
+
const parsed = parseTime(value);
|
|
50
|
+
if (!parsed) {
|
|
51
|
+
return '';
|
|
52
|
+
}
|
|
53
|
+
if (format === '24h') {
|
|
54
|
+
return `${pad2(parsed.h)}:${pad2(parsed.m)}`;
|
|
55
|
+
}
|
|
56
|
+
const { h: hours, period } = to12h(parsed.h);
|
|
57
|
+
return `${pad2(hours)}:${pad2(parsed.m)} ${period}`;
|
|
58
|
+
}
|
|
59
|
+
function genHours(format) {
|
|
60
|
+
return format === '24h'
|
|
61
|
+
? Array.from({ length: 24 }, (_, index) => index)
|
|
62
|
+
: Array.from({ length: 12 }, (_, index) => index + 1);
|
|
63
|
+
}
|
|
64
|
+
function genMinutes(step) {
|
|
65
|
+
const stepSize = step >= 1 ? Math.floor(step) : 1;
|
|
66
|
+
const out = [];
|
|
67
|
+
for (let minute = 0; minute < 60; minute += stepSize) {
|
|
68
|
+
out.push(minute);
|
|
69
|
+
}
|
|
70
|
+
return out;
|
|
71
|
+
}
|
|
72
|
+
function snapToStep(value, step) {
|
|
73
|
+
const mins = toMinutes(value);
|
|
74
|
+
if (mins === null) {
|
|
75
|
+
return value;
|
|
76
|
+
}
|
|
77
|
+
const stepSize = step >= 1 ? Math.floor(step) : 1;
|
|
78
|
+
return fromMinutes(Math.round(mins / stepSize) * stepSize);
|
|
79
|
+
}
|
|
80
|
+
function isTimeDisabled(value, constraints) {
|
|
81
|
+
const mins = toMinutes(value);
|
|
82
|
+
if (mins === null) {
|
|
83
|
+
return true;
|
|
84
|
+
}
|
|
85
|
+
const min = toMinutes(constraints.minTime ?? null);
|
|
86
|
+
const max = toMinutes(constraints.maxTime ?? null);
|
|
87
|
+
if (min !== null && mins < min) {
|
|
88
|
+
return true;
|
|
89
|
+
}
|
|
90
|
+
if (max !== null && mins > max) {
|
|
91
|
+
return true;
|
|
92
|
+
}
|
|
93
|
+
return constraints.disabledTime ? constraints.disabledTime(value) : false;
|
|
94
|
+
}
|
|
95
|
+
function clampToRange(value, constraints) {
|
|
96
|
+
const mins = toMinutes(value);
|
|
97
|
+
if (mins === null) {
|
|
98
|
+
return value;
|
|
99
|
+
}
|
|
100
|
+
const min = toMinutes(constraints.minTime ?? null);
|
|
101
|
+
const max = toMinutes(constraints.maxTime ?? null);
|
|
102
|
+
let out = mins;
|
|
103
|
+
if (min !== null) {
|
|
104
|
+
out = Math.max(out, min);
|
|
105
|
+
}
|
|
106
|
+
if (max !== null) {
|
|
107
|
+
out = Math.min(out, max);
|
|
108
|
+
}
|
|
109
|
+
return fromMinutes(out);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/** Internal (not public API): Hours / Minutes / AM-PM listbox columns.
|
|
113
|
+
* Reused by ds-time-picker's overlay and the date-picker time footer. */
|
|
114
|
+
class TimeColumnsComponent {
|
|
115
|
+
/** Current time as `HH:mm` (24h, always — `format` changes only what is DISPLAYED). */
|
|
116
|
+
value = input(null, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
117
|
+
/** Display clock. `12h` adds an AM/PM column; the emitted value stays 24h either way. */
|
|
118
|
+
format = input('24h', ...(ngDevMode ? [{ debugName: "format" }] : /* istanbul ignore next */ []));
|
|
119
|
+
/** Minute granularity — 15 gives four rows an hour instead of sixty. */
|
|
120
|
+
minuteStep = input(1, { ...(ngDevMode ? { debugName: "minuteStep" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
121
|
+
/** Earliest selectable time, `HH:mm`. Earlier rows render disabled rather than being removed,
|
|
122
|
+
* so the columns do not reflow as the bound changes. */
|
|
123
|
+
minTime = input(null, ...(ngDevMode ? [{ debugName: "minTime" }] : /* istanbul ignore next */ []));
|
|
124
|
+
/** Latest selectable time, `HH:mm`. */
|
|
125
|
+
maxTime = input(null, ...(ngDevMode ? [{ debugName: "maxTime" }] : /* istanbul ignore next */ []));
|
|
126
|
+
/** Per-time predicate for what a range cannot express — booked slots, a lunch break.
|
|
127
|
+
* Receives `HH:mm`; return true to disable. */
|
|
128
|
+
disabledTime = input(null, ...(ngDevMode ? [{ debugName: "disabledTime" }] : /* istanbul ignore next */ []));
|
|
129
|
+
/** A complete time was picked, as `HH:mm`. Not emitted while only one column has moved. */
|
|
130
|
+
timeChange = output();
|
|
131
|
+
/** Which column the pick came from. `timeChange` alone cannot say: it carries a
|
|
132
|
+
* whole time, and a host that wants to close once the user has been through
|
|
133
|
+
* both columns cannot infer the difference between "chose the same hour again"
|
|
134
|
+
* and "did not touch hours". Emitted immediately after `timeChange`. */
|
|
135
|
+
partPicked = output();
|
|
136
|
+
hourButtons = viewChildren('hourOpt', ...(ngDevMode ? [{ debugName: "hourButtons" }] : /* istanbul ignore next */ []));
|
|
137
|
+
minuteButtons = viewChildren('minOpt', ...(ngDevMode ? [{ debugName: "minuteButtons" }] : /* istanbul ignore next */ []));
|
|
138
|
+
periodButtons = viewChildren('periodOpt', ...(ngDevMode ? [{ debugName: "periodButtons" }] : /* istanbul ignore next */ []));
|
|
139
|
+
is12h = computed(() => this.format() === '12h', ...(ngDevMode ? [{ debugName: "is12h" }] : /* istanbul ignore next */ []));
|
|
140
|
+
periods = ['AM', 'PM'];
|
|
141
|
+
constraints = computed(() => ({
|
|
142
|
+
minTime: this.minTime(),
|
|
143
|
+
maxTime: this.maxTime(),
|
|
144
|
+
disabledTime: this.disabledTime(),
|
|
145
|
+
}), ...(ngDevMode ? [{ debugName: "constraints" }] : /* istanbul ignore next */ []));
|
|
146
|
+
parsedValue = computed(() => parseTime(this.value()), ...(ngDevMode ? [{ debugName: "parsedValue" }] : /* istanbul ignore next */ []));
|
|
147
|
+
hourNums = computed(() => genHours(this.format()), ...(ngDevMode ? [{ debugName: "hourNums" }] : /* istanbul ignore next */ []));
|
|
148
|
+
minuteNums = computed(() => genMinutes(this.minuteStep()), ...(ngDevMode ? [{ debugName: "minuteNums" }] : /* istanbul ignore next */ []));
|
|
149
|
+
currentPeriod = computed(() => {
|
|
150
|
+
const parsed = this.parsedValue();
|
|
151
|
+
return parsed ? to12h(parsed.h).period : 'AM';
|
|
152
|
+
}, ...(ngDevMode ? [{ debugName: "currentPeriod" }] : /* istanbul ignore next */ []));
|
|
153
|
+
hourCells = computed(() => {
|
|
154
|
+
const parsed = this.parsedValue();
|
|
155
|
+
const selectedHour = parsed
|
|
156
|
+
? this.is12h()
|
|
157
|
+
? to12h(parsed.h).h
|
|
158
|
+
: parsed.h
|
|
159
|
+
: null;
|
|
160
|
+
return this.hourNums().map((hours) => ({
|
|
161
|
+
value: hours,
|
|
162
|
+
label: pad2(hours),
|
|
163
|
+
disabled: this.allMinutesDisabled(this.toH24(hours)),
|
|
164
|
+
selected: hours === selectedHour,
|
|
165
|
+
}));
|
|
166
|
+
}, ...(ngDevMode ? [{ debugName: "hourCells" }] : /* istanbul ignore next */ []));
|
|
167
|
+
minuteCells = computed(() => {
|
|
168
|
+
const parsed = this.parsedValue();
|
|
169
|
+
const hour24 = this.baseHour();
|
|
170
|
+
return this.minuteNums().map((minute) => ({
|
|
171
|
+
value: minute,
|
|
172
|
+
label: pad2(minute),
|
|
173
|
+
disabled: isTimeDisabled(`${pad2(hour24)}:${pad2(minute)}`, this.constraints()),
|
|
174
|
+
selected: parsed ? parsed.m === minute : false,
|
|
175
|
+
}));
|
|
176
|
+
}, ...(ngDevMode ? [{ debugName: "minuteCells" }] : /* istanbul ignore next */ []));
|
|
177
|
+
periodCells = computed(() => {
|
|
178
|
+
const parsed = this.parsedValue();
|
|
179
|
+
return this.periods.map((period) => ({
|
|
180
|
+
value: period,
|
|
181
|
+
label: period,
|
|
182
|
+
disabled: this.hourNums().every((hours) => this.allMinutesDisabled(from12h(hours, period))),
|
|
183
|
+
selected: parsed ? to12h(parsed.h).period === period : false,
|
|
184
|
+
}));
|
|
185
|
+
}, ...(ngDevMode ? [{ debugName: "periodCells" }] : /* istanbul ignore next */ []));
|
|
186
|
+
hourEntry = computed(() => this.entryIndex(this.hourCells()), ...(ngDevMode ? [{ debugName: "hourEntry" }] : /* istanbul ignore next */ []));
|
|
187
|
+
minuteEntry = computed(() => this.entryIndex(this.minuteCells()), ...(ngDevMode ? [{ debugName: "minuteEntry" }] : /* istanbul ignore next */ []));
|
|
188
|
+
periodEntry = computed(() => this.entryIndex(this.periodCells()), ...(ngDevMode ? [{ debugName: "periodEntry" }] : /* istanbul ignore next */ []));
|
|
189
|
+
selectHour(cell) {
|
|
190
|
+
if (cell.disabled) {
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
const hour24 = this.toH24(cell.value);
|
|
194
|
+
const parsed = this.parsedValue();
|
|
195
|
+
this.emit(hour24, parsed ? parsed.m : this.firstEnabledMinute(hour24), 'hours');
|
|
196
|
+
}
|
|
197
|
+
selectMinute(cell) {
|
|
198
|
+
if (cell.disabled) {
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
this.emit(this.baseHour(), cell.value, 'minutes');
|
|
202
|
+
}
|
|
203
|
+
selectPeriod(cell) {
|
|
204
|
+
if (cell.disabled) {
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
const parsed = this.parsedValue();
|
|
208
|
+
const hour12 = parsed
|
|
209
|
+
? to12h(parsed.h).h
|
|
210
|
+
: this.firstEnabledHour12(cell.value);
|
|
211
|
+
const hour24 = from12h(hour12, cell.value);
|
|
212
|
+
this.emit(hour24, parsed ? parsed.m : this.firstEnabledMinute(hour24), 'period');
|
|
213
|
+
}
|
|
214
|
+
onKey(event, column, index) {
|
|
215
|
+
const cells = this.cellsFor(column);
|
|
216
|
+
let target = -1;
|
|
217
|
+
switch (event.key) {
|
|
218
|
+
case 'ArrowDown':
|
|
219
|
+
target = this.nextEnabled(cells, index, 1);
|
|
220
|
+
break;
|
|
221
|
+
case 'ArrowUp':
|
|
222
|
+
target = this.nextEnabled(cells, index, -1);
|
|
223
|
+
break;
|
|
224
|
+
case 'Home':
|
|
225
|
+
target = this.nextEnabled(cells, -1, 1);
|
|
226
|
+
break;
|
|
227
|
+
case 'End':
|
|
228
|
+
target = this.nextEnabled(cells, cells.length, -1);
|
|
229
|
+
break;
|
|
230
|
+
case 'ArrowRight':
|
|
231
|
+
event.preventDefault();
|
|
232
|
+
this.focusColumn(this.siblingColumn(column, 1));
|
|
233
|
+
return;
|
|
234
|
+
case 'ArrowLeft':
|
|
235
|
+
event.preventDefault();
|
|
236
|
+
this.focusColumn(this.siblingColumn(column, -1));
|
|
237
|
+
return;
|
|
238
|
+
default:
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
if (target < 0) {
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
event.preventDefault();
|
|
245
|
+
this.selectAt(column, target);
|
|
246
|
+
this.buttonsFor(column)()[target]?.nativeElement.focus();
|
|
247
|
+
}
|
|
248
|
+
/** Called by the parent after the overlay renders. */
|
|
249
|
+
focusSelected() {
|
|
250
|
+
this.hourButtons()[Math.max(this.hourEntry(), 0)]?.nativeElement.focus();
|
|
251
|
+
this.scrollSelectedIntoView();
|
|
252
|
+
}
|
|
253
|
+
scrollSelectedIntoView() {
|
|
254
|
+
this.scrollColumn(this.hourButtons(), this.hourEntry());
|
|
255
|
+
this.scrollColumn(this.minuteButtons(), this.minuteEntry());
|
|
256
|
+
this.scrollColumn(this.periodButtons(), this.periodEntry());
|
|
257
|
+
}
|
|
258
|
+
toH24(hourCol) {
|
|
259
|
+
return this.is12h() ? from12h(hourCol, this.currentPeriod()) : hourCol;
|
|
260
|
+
}
|
|
261
|
+
allMinutesDisabled(hour24) {
|
|
262
|
+
return this.minuteNums().every((minute) => isTimeDisabled(`${pad2(hour24)}:${pad2(minute)}`, this.constraints()));
|
|
263
|
+
}
|
|
264
|
+
baseHour() {
|
|
265
|
+
const parsed = this.parsedValue();
|
|
266
|
+
if (parsed) {
|
|
267
|
+
return parsed.h;
|
|
268
|
+
}
|
|
269
|
+
const first = this.hourCells().find((cell) => !cell.disabled);
|
|
270
|
+
return first ? this.toH24(first.value) : 0;
|
|
271
|
+
}
|
|
272
|
+
firstEnabledMinute(hour24) {
|
|
273
|
+
const minute = this.minuteNums().find((candidate) => !isTimeDisabled(`${pad2(hour24)}:${pad2(candidate)}`, this.constraints()));
|
|
274
|
+
return minute ?? 0;
|
|
275
|
+
}
|
|
276
|
+
firstEnabledHour12(period) {
|
|
277
|
+
const hours = this.hourNums().find((candidate) => !this.allMinutesDisabled(from12h(candidate, period)));
|
|
278
|
+
return hours ?? 12;
|
|
279
|
+
}
|
|
280
|
+
emit(hour24, minute, part) {
|
|
281
|
+
this.timeChange.emit(`${pad2(hour24)}:${pad2(minute)}`);
|
|
282
|
+
this.partPicked.emit(part);
|
|
283
|
+
}
|
|
284
|
+
entryIndex(cells) {
|
|
285
|
+
const selected = cells.findIndex((cell) => cell.selected && !cell.disabled);
|
|
286
|
+
return selected >= 0 ? selected : cells.findIndex((cell) => !cell.disabled);
|
|
287
|
+
}
|
|
288
|
+
nextEnabled(cells, from, step) {
|
|
289
|
+
const count = cells.length;
|
|
290
|
+
if (count === 0) {
|
|
291
|
+
return -1;
|
|
292
|
+
}
|
|
293
|
+
let index = from;
|
|
294
|
+
for (let i = 0; i < count; i++) {
|
|
295
|
+
index = (index + step + count) % count;
|
|
296
|
+
if (!cells[index].disabled) {
|
|
297
|
+
return index;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
return -1;
|
|
301
|
+
}
|
|
302
|
+
cellsFor(column) {
|
|
303
|
+
if (column === 'hours') {
|
|
304
|
+
return this.hourCells();
|
|
305
|
+
}
|
|
306
|
+
if (column === 'minutes') {
|
|
307
|
+
return this.minuteCells();
|
|
308
|
+
}
|
|
309
|
+
return this.periodCells();
|
|
310
|
+
}
|
|
311
|
+
buttonsFor(column) {
|
|
312
|
+
if (column === 'hours') {
|
|
313
|
+
return this.hourButtons;
|
|
314
|
+
}
|
|
315
|
+
if (column === 'minutes') {
|
|
316
|
+
return this.minuteButtons;
|
|
317
|
+
}
|
|
318
|
+
return this.periodButtons;
|
|
319
|
+
}
|
|
320
|
+
selectAt(column, index) {
|
|
321
|
+
if (column === 'hours') {
|
|
322
|
+
this.selectHour(this.hourCells()[index]);
|
|
323
|
+
}
|
|
324
|
+
else if (column === 'minutes') {
|
|
325
|
+
this.selectMinute(this.minuteCells()[index]);
|
|
326
|
+
}
|
|
327
|
+
else {
|
|
328
|
+
this.selectPeriod(this.periodCells()[index]);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
siblingColumn(column, step) {
|
|
332
|
+
const order = this.is12h()
|
|
333
|
+
? ['hours', 'minutes', 'period']
|
|
334
|
+
: ['hours', 'minutes'];
|
|
335
|
+
const next = order.indexOf(column) + step;
|
|
336
|
+
return order[Math.min(Math.max(next, 0), order.length - 1)];
|
|
337
|
+
}
|
|
338
|
+
focusColumn(column) {
|
|
339
|
+
const entry = column === 'hours'
|
|
340
|
+
? this.hourEntry()
|
|
341
|
+
: column === 'minutes'
|
|
342
|
+
? this.minuteEntry()
|
|
343
|
+
: this.periodEntry();
|
|
344
|
+
this.buttonsFor(column)()[Math.max(entry, 0)]?.nativeElement.focus();
|
|
345
|
+
}
|
|
346
|
+
scrollColumn(buttons, index) {
|
|
347
|
+
buttons[Math.max(index, 0)]?.nativeElement.scrollIntoView({
|
|
348
|
+
block: 'center',
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: TimeColumnsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
352
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: TimeColumnsComponent, isStandalone: true, selector: "ds-time-columns", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, format: { classPropertyName: "format", publicName: "format", isSignal: true, isRequired: false, transformFunction: null }, minuteStep: { classPropertyName: "minuteStep", publicName: "minuteStep", isSignal: true, isRequired: false, transformFunction: null }, minTime: { classPropertyName: "minTime", publicName: "minTime", isSignal: true, isRequired: false, transformFunction: null }, maxTime: { classPropertyName: "maxTime", publicName: "maxTime", isSignal: true, isRequired: false, transformFunction: null }, disabledTime: { classPropertyName: "disabledTime", publicName: "disabledTime", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { timeChange: "timeChange", partPicked: "partPicked" }, host: { attributes: { "role": "group" }, properties: { "attr.aria-label": "'Time'" }, classAttribute: "ds-time-columns" }, viewQueries: [{ propertyName: "hourButtons", predicate: ["hourOpt"], descendants: true, isSignal: true }, { propertyName: "minuteButtons", predicate: ["minOpt"], descendants: true, isSignal: true }, { propertyName: "periodButtons", predicate: ["periodOpt"], descendants: true, isSignal: true }], ngImport: i0, template: "<div\n class=\"col\"\n role=\"listbox\"\n aria-label=\"Hours\"\n>\n @for (cell of hourCells(); track cell.value; let i = $index) {\n <button\n #hourOpt\n type=\"button\"\n role=\"option\"\n class=\"opt\"\n [class.is-selected]=\"cell.selected\"\n [attr.aria-selected]=\"cell.selected\"\n [attr.tabindex]=\"i === hourEntry() ? 0 : -1\"\n [disabled]=\"cell.disabled\"\n (click)=\"selectHour(cell)\"\n (keydown)=\"onKey($event, 'hours', i)\"\n >\n {{ cell.label }}\n </button>\n }\n</div>\n\n<div\n class=\"col\"\n role=\"listbox\"\n aria-label=\"Minutes\"\n>\n @for (cell of minuteCells(); track cell.value; let i = $index) {\n <button\n #minOpt\n type=\"button\"\n role=\"option\"\n class=\"opt\"\n [class.is-selected]=\"cell.selected\"\n [attr.aria-selected]=\"cell.selected\"\n [attr.tabindex]=\"i === minuteEntry() ? 0 : -1\"\n [disabled]=\"cell.disabled\"\n (click)=\"selectMinute(cell)\"\n (keydown)=\"onKey($event, 'minutes', i)\"\n >\n {{ cell.label }}\n </button>\n }\n</div>\n\n@if (is12h()) {\n <div\n class=\"col\"\n role=\"listbox\"\n aria-label=\"AM/PM\"\n >\n @for (cell of periodCells(); track cell.value; let i = $index) {\n <button\n #periodOpt\n type=\"button\"\n role=\"option\"\n class=\"opt\"\n [class.is-selected]=\"cell.selected\"\n [attr.aria-selected]=\"cell.selected\"\n [attr.tabindex]=\"i === periodEntry() ? 0 : -1\"\n [disabled]=\"cell.disabled\"\n (click)=\"selectPeriod(cell)\"\n (keydown)=\"onKey($event, 'period', i)\"\n >\n {{ cell.label }}\n </button>\n }\n </div>\n}\n", styles: [":host{--_time-picker-option-bg-color-selected: var( --ds-time-picker-option-bg-color-selected, var(--accent) );--_time-picker-option-text-color-selected: var( --ds-time-picker-option-text-color-selected, var(--accent-on) );--_time-picker-option-bg-color-hover: var( --ds-time-picker-option-bg-color-hover, var(--surface-secondary) );display:flex;gap:var(--space-1);align-items:stretch}.col{display:flex;flex-direction:column;gap:var(--space-0-5);min-width:var(--ds-time-picker-column-width, 3rem);max-height:var(--ds-time-picker-column-height, 13.5rem);overflow-y:auto;scrollbar-width:thin;padding-inline:var(--space-0-5)}.col:not(:last-child){border-right:var(--border-width-default) solid var(--border-subtitle);padding-right:var(--space-1)}.opt{flex:none;appearance:none;border:0;cursor:pointer;width:100%;padding:var(--space-1-5) var(--space-3);border-radius:var(--ds-radius-inner);background-color:transparent;color:var(--text-primary);font:inherit;font-variant-numeric:tabular-nums;text-align:center;transition:background-color var(--duration-fast) var(--ease-standard)}.opt:hover:not(:disabled,.is-selected){background-color:var(--_time-picker-option-bg-color-hover)}.opt.is-selected{background-color:var(--_time-picker-option-bg-color-selected);color:var(--_time-picker-option-text-color-selected)}.opt:focus-visible{outline:none;box-shadow:var(--ds-time-picker-focus-shadow, var(--ds-control-focus-shadow, var(--focus-ring)))}.opt:disabled{color:var(--text-disabled);cursor:default}\n"] });
|
|
353
|
+
}
|
|
354
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: TimeColumnsComponent, decorators: [{
|
|
355
|
+
type: Component,
|
|
356
|
+
args: [{ selector: 'ds-time-columns', standalone: true, encapsulation: ViewEncapsulation.Emulated, host: {
|
|
357
|
+
class: 'ds-time-columns',
|
|
358
|
+
role: 'group',
|
|
359
|
+
'[attr.aria-label]': "'Time'",
|
|
360
|
+
}, template: "<div\n class=\"col\"\n role=\"listbox\"\n aria-label=\"Hours\"\n>\n @for (cell of hourCells(); track cell.value; let i = $index) {\n <button\n #hourOpt\n type=\"button\"\n role=\"option\"\n class=\"opt\"\n [class.is-selected]=\"cell.selected\"\n [attr.aria-selected]=\"cell.selected\"\n [attr.tabindex]=\"i === hourEntry() ? 0 : -1\"\n [disabled]=\"cell.disabled\"\n (click)=\"selectHour(cell)\"\n (keydown)=\"onKey($event, 'hours', i)\"\n >\n {{ cell.label }}\n </button>\n }\n</div>\n\n<div\n class=\"col\"\n role=\"listbox\"\n aria-label=\"Minutes\"\n>\n @for (cell of minuteCells(); track cell.value; let i = $index) {\n <button\n #minOpt\n type=\"button\"\n role=\"option\"\n class=\"opt\"\n [class.is-selected]=\"cell.selected\"\n [attr.aria-selected]=\"cell.selected\"\n [attr.tabindex]=\"i === minuteEntry() ? 0 : -1\"\n [disabled]=\"cell.disabled\"\n (click)=\"selectMinute(cell)\"\n (keydown)=\"onKey($event, 'minutes', i)\"\n >\n {{ cell.label }}\n </button>\n }\n</div>\n\n@if (is12h()) {\n <div\n class=\"col\"\n role=\"listbox\"\n aria-label=\"AM/PM\"\n >\n @for (cell of periodCells(); track cell.value; let i = $index) {\n <button\n #periodOpt\n type=\"button\"\n role=\"option\"\n class=\"opt\"\n [class.is-selected]=\"cell.selected\"\n [attr.aria-selected]=\"cell.selected\"\n [attr.tabindex]=\"i === periodEntry() ? 0 : -1\"\n [disabled]=\"cell.disabled\"\n (click)=\"selectPeriod(cell)\"\n (keydown)=\"onKey($event, 'period', i)\"\n >\n {{ cell.label }}\n </button>\n }\n </div>\n}\n", styles: [":host{--_time-picker-option-bg-color-selected: var( --ds-time-picker-option-bg-color-selected, var(--accent) );--_time-picker-option-text-color-selected: var( --ds-time-picker-option-text-color-selected, var(--accent-on) );--_time-picker-option-bg-color-hover: var( --ds-time-picker-option-bg-color-hover, var(--surface-secondary) );display:flex;gap:var(--space-1);align-items:stretch}.col{display:flex;flex-direction:column;gap:var(--space-0-5);min-width:var(--ds-time-picker-column-width, 3rem);max-height:var(--ds-time-picker-column-height, 13.5rem);overflow-y:auto;scrollbar-width:thin;padding-inline:var(--space-0-5)}.col:not(:last-child){border-right:var(--border-width-default) solid var(--border-subtitle);padding-right:var(--space-1)}.opt{flex:none;appearance:none;border:0;cursor:pointer;width:100%;padding:var(--space-1-5) var(--space-3);border-radius:var(--ds-radius-inner);background-color:transparent;color:var(--text-primary);font:inherit;font-variant-numeric:tabular-nums;text-align:center;transition:background-color var(--duration-fast) var(--ease-standard)}.opt:hover:not(:disabled,.is-selected){background-color:var(--_time-picker-option-bg-color-hover)}.opt.is-selected{background-color:var(--_time-picker-option-bg-color-selected);color:var(--_time-picker-option-text-color-selected)}.opt:focus-visible{outline:none;box-shadow:var(--ds-time-picker-focus-shadow, var(--ds-control-focus-shadow, var(--focus-ring)))}.opt:disabled{color:var(--text-disabled);cursor:default}\n"] }]
|
|
361
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], format: [{ type: i0.Input, args: [{ isSignal: true, alias: "format", required: false }] }], minuteStep: [{ type: i0.Input, args: [{ isSignal: true, alias: "minuteStep", required: false }] }], minTime: [{ type: i0.Input, args: [{ isSignal: true, alias: "minTime", required: false }] }], maxTime: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxTime", required: false }] }], disabledTime: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabledTime", required: false }] }], timeChange: [{ type: i0.Output, args: ["timeChange"] }], partPicked: [{ type: i0.Output, args: ["partPicked"] }], hourButtons: [{ type: i0.ViewChildren, args: ['hourOpt', { isSignal: true }] }], minuteButtons: [{ type: i0.ViewChildren, args: ['minOpt', { isSignal: true }] }], periodButtons: [{ type: i0.ViewChildren, args: ['periodOpt', { isSignal: true }] }] } });
|
|
362
|
+
|
|
363
|
+
let nextId = 0;
|
|
364
|
+
class TimePickerComponent extends DsControlValueAccessor {
|
|
365
|
+
constructor() {
|
|
366
|
+
super();
|
|
367
|
+
}
|
|
368
|
+
config = inject(DS_CONFIG);
|
|
369
|
+
overlay = inject(Overlay);
|
|
370
|
+
vcr = inject(ViewContainerRef);
|
|
371
|
+
injector = inject(Injector);
|
|
372
|
+
host = inject((ElementRef));
|
|
373
|
+
/** Public panel tokens forwarded onto the portaled overlay pane on open so
|
|
374
|
+
* a consumer's `ds-time-picker { --ds-time-picker-panel-*: … }` reaches it. */
|
|
375
|
+
panelTokens = [
|
|
376
|
+
'--ds-time-picker-bg-color',
|
|
377
|
+
'--ds-time-picker-border',
|
|
378
|
+
'--ds-time-picker-shadow',
|
|
379
|
+
'--ds-time-picker-panel-radius',
|
|
380
|
+
];
|
|
381
|
+
/** Selected time, or `[start, end]` tuple when `mode="range"`. Two-way bound. */
|
|
382
|
+
value = model(null, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
383
|
+
/** Single time or `[start, end]` range picker. */
|
|
384
|
+
mode = input('single', ...(ngDevMode ? [{ debugName: "mode" }] : /* istanbul ignore next */ []));
|
|
385
|
+
/** Minute increment shown in the picker columns. */
|
|
386
|
+
minuteStep = input(1, { ...(ngDevMode ? { debugName: "minuteStep" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
387
|
+
/** Earliest selectable time ("HH:MM"). */
|
|
388
|
+
minTime = input(null, ...(ngDevMode ? [{ debugName: "minTime" }] : /* istanbul ignore next */ []));
|
|
389
|
+
/** Latest selectable time ("HH:MM"). */
|
|
390
|
+
maxTime = input(null, ...(ngDevMode ? [{ debugName: "maxTime" }] : /* istanbul ignore next */ []));
|
|
391
|
+
/** Predicate marking individual times unselectable. */
|
|
392
|
+
disabledTime = input(null, ...(ngDevMode ? [{ debugName: "disabledTime" }] : /* istanbul ignore next */ []));
|
|
393
|
+
/** Trigger height — sm/md/lg.
|
|
394
|
+
* Unset falls back to `DS_CONFIG.control.size`, then `'md'`. */
|
|
395
|
+
size = input(null, ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
396
|
+
sizeResolved = resolveWithConfig(this.size, (config) => config.control?.size, 'md');
|
|
397
|
+
/** Stretch the trigger to fill its container instead of hugging its content —
|
|
398
|
+
* opt in when the field shares a grid/flex track with inputs. */
|
|
399
|
+
fullWidth = input(false, { ...(ngDevMode ? { debugName: "fullWidth" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
400
|
+
/** Field label shown above the trigger — same row a `ds-date-picker` label
|
|
401
|
+
* occupies, so date + time in one form row line up without a hand-rolled label. */
|
|
402
|
+
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
403
|
+
/** Marks the field required — shows an asterisk and sets `aria-required`. */
|
|
404
|
+
required = input(false, { ...(ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
405
|
+
/** Shows an "(optional)" marker beside the label — ignored when `required` is set. */
|
|
406
|
+
optional = input(false, { ...(ngDevMode ? { debugName: "optional" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
407
|
+
/** Disables the picker and blocks all interaction. */
|
|
408
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
409
|
+
/** Confirmation text, shown when there is no error or warning — and it paints
|
|
410
|
+
* the field's success border. A string like `warning`: the text IS the state. */
|
|
411
|
+
success = input('', { ...(ngDevMode ? { debugName: "success" } : /* istanbul ignore next */ {}), transform: trimmedText });
|
|
412
|
+
/** Shown in the trigger when no time is set. */
|
|
413
|
+
placeholder = input('--:--', ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
414
|
+
/** Shows an inline clear button when a value is set — single mode only. */
|
|
415
|
+
clearable = input(false, { ...(ngDevMode ? { debugName: "clearable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
416
|
+
/** Accessible name for the trigger(s), suffixed "(from)"/"(to)" in range mode. */
|
|
417
|
+
ariaLabel = input(null, ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
418
|
+
/** Override the DS-config format for this instance. */
|
|
419
|
+
format = input(null, ...(ngDevMode ? [{ debugName: "format" }] : /* istanbul ignore next */ []));
|
|
420
|
+
uid = `ds-timepicker-${++nextId}`;
|
|
421
|
+
labelId = `${this.uid}-label`;
|
|
422
|
+
openSegment = signal(null, ...(ngDevMode ? [{ debugName: "openSegment" }] : /* istanbul ignore next */ []));
|
|
423
|
+
// Which columns the user has been through since THIS opening. In single mode
|
|
424
|
+
// the panel has no Done button, so it closes itself once both halves of a time
|
|
425
|
+
// have been chosen — "picked an hour and a minute" is the completion. Reset on
|
|
426
|
+
// open, so re-opening a field that already holds a value asks for both again
|
|
427
|
+
// rather than closing on the first tap.
|
|
428
|
+
pickedParts = signal(new Set(), ...(ngDevMode ? [{ debugName: "pickedParts" }] : /* istanbul ignore next */ []));
|
|
429
|
+
overlayRef = null;
|
|
430
|
+
singleTrigger = viewChild('singleTrigger', ...(ngDevMode ? [{ debugName: "singleTrigger" }] : /* istanbul ignore next */ []));
|
|
431
|
+
startTrigger = viewChild('startTrigger', ...(ngDevMode ? [{ debugName: "startTrigger" }] : /* istanbul ignore next */ []));
|
|
432
|
+
endTrigger = viewChild('endTrigger', ...(ngDevMode ? [{ debugName: "endTrigger" }] : /* istanbul ignore next */ []));
|
|
433
|
+
panelTpl = viewChild.required('panel');
|
|
434
|
+
columns = viewChild(TimeColumnsComponent, ...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
|
|
435
|
+
/** Any of the three trigger boxes, not the host: a range renders two and a single
|
|
436
|
+
* one renders one, while the host also carries the label and the message row —
|
|
437
|
+
* clicking those has to dismiss the panel. */
|
|
438
|
+
insideATrigger(target) {
|
|
439
|
+
return [this.singleTrigger(), this.startTrigger(), this.endTrigger()].some((trigger) => trigger?.nativeElement.contains(target) ?? false);
|
|
440
|
+
}
|
|
441
|
+
isDisabled = computed(() => this.disabled() || this.formDisabled(), ...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
|
|
442
|
+
hintId = computed(() => this.message().text ? `${this.uid}-hint` : null, ...(ngDevMode ? [{ debugName: "hintId" }] : /* istanbul ignore next */ []));
|
|
443
|
+
fieldMessage = resolveFieldMessage({
|
|
444
|
+
hint: this.hint,
|
|
445
|
+
warning: this.warning,
|
|
446
|
+
error: this.error,
|
|
447
|
+
errors: this.errors,
|
|
448
|
+
invalid: this.invalid,
|
|
449
|
+
success: this.success,
|
|
450
|
+
touchedSelf: this.touchedSelf,
|
|
451
|
+
touched: this.touched,
|
|
452
|
+
});
|
|
453
|
+
message = this.fieldMessage.message;
|
|
454
|
+
controlState = this.fieldMessage.controlState;
|
|
455
|
+
invalidResolved = this.fieldMessage.invalid;
|
|
456
|
+
resolvedFormat = computed(() => this.format() ?? this.config.timePicker?.format ?? '24h', ...(ngDevMode ? [{ debugName: "resolvedFormat" }] : /* istanbul ignore next */ []));
|
|
457
|
+
singleValue = computed(() => {
|
|
458
|
+
const value = this.value();
|
|
459
|
+
return typeof value === 'string' ? value : null;
|
|
460
|
+
}, ...(ngDevMode ? [{ debugName: "singleValue" }] : /* istanbul ignore next */ []));
|
|
461
|
+
rangeValue = computed(() => {
|
|
462
|
+
const value = this.value();
|
|
463
|
+
return Array.isArray(value) ? value : [null, null];
|
|
464
|
+
}, ...(ngDevMode ? [{ debugName: "rangeValue" }] : /* istanbul ignore next */ []));
|
|
465
|
+
hasValue = computed(() => !!this.singleValue(), ...(ngDevMode ? [{ debugName: "hasValue" }] : /* istanbul ignore next */ []));
|
|
466
|
+
displayValue = computed(() => this.formatFor(this.singleValue()) || this.placeholder(), ...(ngDevMode ? [{ debugName: "displayValue" }] : /* istanbul ignore next */ []));
|
|
467
|
+
triggerClasses = computed(() => {
|
|
468
|
+
const parts = ['trigger'];
|
|
469
|
+
const size = this.sizeResolved();
|
|
470
|
+
if (size !== 'md') {
|
|
471
|
+
parts.push(size);
|
|
472
|
+
}
|
|
473
|
+
if (this.isDisabled()) {
|
|
474
|
+
parts.push('disabled');
|
|
475
|
+
}
|
|
476
|
+
if (this.invalidResolved()) {
|
|
477
|
+
parts.push('error');
|
|
478
|
+
}
|
|
479
|
+
if (this.mode() === 'single' && this.clearable() && this.hasValue()) {
|
|
480
|
+
parts.push('has-clear');
|
|
481
|
+
}
|
|
482
|
+
return parts.join(' ');
|
|
483
|
+
}, ...(ngDevMode ? [{ debugName: "triggerClasses" }] : /* istanbul ignore next */ []));
|
|
484
|
+
/** Value the open column set edits (the active segment's value). */
|
|
485
|
+
panelValue = computed(() => {
|
|
486
|
+
const segment = this.openSegment();
|
|
487
|
+
if (segment === 'start') {
|
|
488
|
+
return this.rangeValue()[0];
|
|
489
|
+
}
|
|
490
|
+
if (segment === 'end') {
|
|
491
|
+
return this.rangeValue()[1];
|
|
492
|
+
}
|
|
493
|
+
return this.singleValue();
|
|
494
|
+
}, ...(ngDevMode ? [{ debugName: "panelValue" }] : /* istanbul ignore next */ []));
|
|
495
|
+
/** The end segment cannot precede the chosen start. */
|
|
496
|
+
panelMinTime = computed(() => {
|
|
497
|
+
if (this.openSegment() !== 'end') {
|
|
498
|
+
return this.minTime();
|
|
499
|
+
}
|
|
500
|
+
return this.laterOf(this.minTime(), this.rangeValue()[0]);
|
|
501
|
+
}, ...(ngDevMode ? [{ debugName: "panelMinTime" }] : /* istanbul ignore next */ []));
|
|
502
|
+
panelMaxTime = computed(() => this.maxTime(), ...(ngDevMode ? [{ debugName: "panelMaxTime" }] : /* istanbul ignore next */ []));
|
|
503
|
+
ariaLabelFor(segment) {
|
|
504
|
+
// A visible label is the accessible name; range segments still need the
|
|
505
|
+
// from/to suffix, so they keep an aria-label built from it.
|
|
506
|
+
const base = this.ariaLabel() ?? (this.label() || 'Select time');
|
|
507
|
+
if (segment === 'start') {
|
|
508
|
+
return `${base} (from)`;
|
|
509
|
+
}
|
|
510
|
+
if (segment === 'end') {
|
|
511
|
+
return `${base} (to)`;
|
|
512
|
+
}
|
|
513
|
+
return base;
|
|
514
|
+
}
|
|
515
|
+
formatFor(value) {
|
|
516
|
+
return formatTime(value, this.resolvedFormat());
|
|
517
|
+
}
|
|
518
|
+
open(segment) {
|
|
519
|
+
if (this.isDisabled() || this.overlayRef) {
|
|
520
|
+
return;
|
|
521
|
+
}
|
|
522
|
+
const triggerRef = this.triggerFor(segment);
|
|
523
|
+
if (!triggerRef) {
|
|
524
|
+
return;
|
|
525
|
+
}
|
|
526
|
+
const { positionStrategy, config } = dropdownOverlay(this.overlay, triggerRef.nativeElement, 'ds-overlay-pane');
|
|
527
|
+
this.overlayRef = this.overlay.create(config);
|
|
528
|
+
prepareOverlayEnter(this.overlayRef, this.host.nativeElement, positionStrategy);
|
|
529
|
+
forwardOverlayTokens(this.overlayRef, this.host.nativeElement, this.panelTokens);
|
|
530
|
+
closeOnOutsidePointer(this.overlayRef, (target) => this.insideATrigger(target), () => this.close('dismiss'));
|
|
531
|
+
// No backdrop catches a page scroll and CDK's scroll strategies miss a plain
|
|
532
|
+
// overflow container, so close on any outside scroll ourselves.
|
|
533
|
+
const removeScrollClose = closeOnScroll(this.overlayRef, () => this.close('dismiss'));
|
|
534
|
+
this.overlayRef.detachments().subscribe(() => {
|
|
535
|
+
removeScrollClose();
|
|
536
|
+
this.overlayRef = null;
|
|
537
|
+
this.openSegment.set(null);
|
|
538
|
+
});
|
|
539
|
+
this.overlayRef.keydownEvents().subscribe((event) => {
|
|
540
|
+
if (event.key === 'Escape') {
|
|
541
|
+
event.preventDefault();
|
|
542
|
+
this.onEscape('dismiss');
|
|
543
|
+
}
|
|
544
|
+
});
|
|
545
|
+
this.overlayRef.attach(new TemplatePortal(this.panelTpl(), this.vcr));
|
|
546
|
+
this.openSegment.set(segment);
|
|
547
|
+
this.pickedParts.set(new Set());
|
|
548
|
+
afterNextRender(() => this.columns()?.focusSelected(), {
|
|
549
|
+
injector: this.injector,
|
|
550
|
+
});
|
|
551
|
+
}
|
|
552
|
+
onTriggerClick(segment) {
|
|
553
|
+
if (this.isDisabled()) {
|
|
554
|
+
return;
|
|
555
|
+
}
|
|
556
|
+
if (this.overlayRef) {
|
|
557
|
+
const wasSameSegment = this.openSegment() === segment;
|
|
558
|
+
this.close();
|
|
559
|
+
if (wasSameSegment) {
|
|
560
|
+
return;
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
this.open(segment);
|
|
564
|
+
}
|
|
565
|
+
close(cause = 'select') {
|
|
566
|
+
const segment = this.openSegment();
|
|
567
|
+
const focusWasInPanel = this.overlayRef
|
|
568
|
+
? focusIsInside(this.overlayRef)
|
|
569
|
+
: false;
|
|
570
|
+
disposeWithLeave(this.overlayRef, cause);
|
|
571
|
+
this.overlayRef = null;
|
|
572
|
+
this.openSegment.set(null);
|
|
573
|
+
this.markTouched();
|
|
574
|
+
if (focusWasInPanel && segment) {
|
|
575
|
+
this.triggerFor(segment)?.nativeElement.focus({ preventScroll: true });
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
ngOnDestroy() {
|
|
579
|
+
// Host torn down while open → close() never runs. Dispose the overlay so
|
|
580
|
+
// its pane and event subscriptions don't leak.
|
|
581
|
+
this.overlayRef?.dispose();
|
|
582
|
+
this.overlayRef = null;
|
|
583
|
+
}
|
|
584
|
+
onEscape(cause = 'dismiss') {
|
|
585
|
+
this.close(cause);
|
|
586
|
+
}
|
|
587
|
+
onPick(next) {
|
|
588
|
+
const segment = this.openSegment();
|
|
589
|
+
if (segment === 'start') {
|
|
590
|
+
const end = this.rangeValue()[1];
|
|
591
|
+
const bumped = end && this.minutesOf(end) < this.minutesOf(next);
|
|
592
|
+
this.value.set([next, bumped ? next : end]);
|
|
593
|
+
return;
|
|
594
|
+
}
|
|
595
|
+
if (segment === 'end') {
|
|
596
|
+
this.value.set([this.rangeValue()[0], next]);
|
|
597
|
+
return;
|
|
598
|
+
}
|
|
599
|
+
this.value.set(next);
|
|
600
|
+
}
|
|
601
|
+
onPartPicked(part) {
|
|
602
|
+
const seen = new Set(this.pickedParts()).add(part);
|
|
603
|
+
this.pickedParts.set(seen);
|
|
604
|
+
if (this.mode() === 'single' && seen.has('hours') && seen.has('minutes')) {
|
|
605
|
+
this.close('select');
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
setNow() {
|
|
609
|
+
const now = new Date();
|
|
610
|
+
const raw = `${pad2(now.getHours())}:${pad2(now.getMinutes())}`;
|
|
611
|
+
const constraints = {
|
|
612
|
+
minTime: this.panelMinTime(),
|
|
613
|
+
maxTime: this.panelMaxTime(),
|
|
614
|
+
disabledTime: this.disabledTime(),
|
|
615
|
+
};
|
|
616
|
+
this.onPick(clampToRange(snapToStep(raw, this.minuteStep()), constraints));
|
|
617
|
+
}
|
|
618
|
+
clear(event) {
|
|
619
|
+
event.stopPropagation();
|
|
620
|
+
this.value.set(null);
|
|
621
|
+
}
|
|
622
|
+
triggerFor(segment) {
|
|
623
|
+
if (segment === 'start') {
|
|
624
|
+
return this.startTrigger();
|
|
625
|
+
}
|
|
626
|
+
if (segment === 'end') {
|
|
627
|
+
return this.endTrigger();
|
|
628
|
+
}
|
|
629
|
+
return this.singleTrigger();
|
|
630
|
+
}
|
|
631
|
+
minutesOf(value) {
|
|
632
|
+
return toMinutes(value) ?? 0;
|
|
633
|
+
}
|
|
634
|
+
laterOf(a, b) {
|
|
635
|
+
if (!a) {
|
|
636
|
+
return b;
|
|
637
|
+
}
|
|
638
|
+
if (!b) {
|
|
639
|
+
return a;
|
|
640
|
+
}
|
|
641
|
+
return this.minutesOf(a) >= this.minutesOf(b) ? a : b;
|
|
642
|
+
}
|
|
643
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: TimePickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
644
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: TimePickerComponent, isStandalone: true, selector: "ds-time-picker", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, minuteStep: { classPropertyName: "minuteStep", publicName: "minuteStep", isSignal: true, isRequired: false, transformFunction: null }, minTime: { classPropertyName: "minTime", publicName: "minTime", isSignal: true, isRequired: false, transformFunction: null }, maxTime: { classPropertyName: "maxTime", publicName: "maxTime", isSignal: true, isRequired: false, transformFunction: null }, disabledTime: { classPropertyName: "disabledTime", publicName: "disabledTime", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, fullWidth: { classPropertyName: "fullWidth", publicName: "fullWidth", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, optional: { classPropertyName: "optional", publicName: "optional", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, success: { classPropertyName: "success", publicName: "success", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, format: { classPropertyName: "format", publicName: "format", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { properties: { "attr.data-field-state": "controlState()", "class.full-width": "fullWidth()" } }, providers: [
|
|
645
|
+
{
|
|
646
|
+
provide: NG_VALUE_ACCESSOR,
|
|
647
|
+
useExisting: forwardRef(() => TimePickerComponent),
|
|
648
|
+
multi: true,
|
|
649
|
+
},
|
|
650
|
+
], viewQueries: [{ propertyName: "singleTrigger", first: true, predicate: ["singleTrigger"], descendants: true, isSignal: true }, { propertyName: "startTrigger", first: true, predicate: ["startTrigger"], descendants: true, isSignal: true }, { propertyName: "endTrigger", first: true, predicate: ["endTrigger"], descendants: true, isSignal: true }, { propertyName: "panelTpl", first: true, predicate: ["panel"], descendants: true, isSignal: true }, { propertyName: "columns", first: true, predicate: TimeColumnsComponent, descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"field\">\n @if (label()) {\n <span\n class=\"label\"\n [id]=\"labelId\"\n >\n {{ label() }}\n @if (required()) {\n <span\n class=\"req\"\n aria-hidden=\"true\"\n >\n *\n </span>\n } @else if (optional()) {\n <span\n class=\"optional-marker\"\n aria-hidden=\"true\"\n >\n (optional)\n </span>\n }\n </span>\n }\n\n @if (mode() === 'range') {\n <div class=\"range-wrap\">\n <div class=\"trigger-wrap\">\n <button\n #startTrigger\n type=\"button\"\n aria-haspopup=\"dialog\"\n [class]=\"triggerClasses()\"\n [disabled]=\"isDisabled()\"\n [attr.aria-expanded]=\"openSegment() === 'start'\"\n [attr.aria-label]=\"ariaLabelFor('start')\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-invalid]=\"invalidResolved() ? 'true' : null\"\n [attr.aria-describedby]=\"hintId()\"\n (click)=\"onTriggerClick('start')\"\n >\n <span class=\"time-value\">\n {{ formatFor(rangeValue()[0]) || placeholder() }}\n </span>\n\n <ds-icon\n name=\"clock\"\n [size]=\"16\"\n />\n </button>\n </div>\n\n <span\n class=\"range-sep\"\n aria-hidden=\"true\"\n >\n \u2013\n </span>\n\n <div class=\"trigger-wrap\">\n <button\n #endTrigger\n type=\"button\"\n aria-haspopup=\"dialog\"\n [class]=\"triggerClasses()\"\n [disabled]=\"isDisabled()\"\n [attr.aria-expanded]=\"openSegment() === 'end'\"\n [attr.aria-label]=\"ariaLabelFor('end')\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-invalid]=\"invalidResolved() ? 'true' : null\"\n [attr.aria-describedby]=\"hintId()\"\n (click)=\"onTriggerClick('end')\"\n >\n <span class=\"time-value\">\n {{ formatFor(rangeValue()[1]) || placeholder() }}\n </span>\n\n <ds-icon\n name=\"clock\"\n [size]=\"16\"\n />\n </button>\n </div>\n </div>\n } @else {\n <div class=\"trigger-wrap\">\n <button\n #singleTrigger\n type=\"button\"\n aria-haspopup=\"dialog\"\n [class]=\"triggerClasses()\"\n [disabled]=\"isDisabled()\"\n [attr.aria-expanded]=\"openSegment() === 'single'\"\n [attr.aria-labelledby]=\"label() ? labelId : null\"\n [attr.aria-label]=\"label() ? null : ariaLabelFor('single')\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-invalid]=\"invalidResolved() ? 'true' : null\"\n [attr.aria-describedby]=\"hintId()\"\n (click)=\"onTriggerClick('single')\"\n >\n <span class=\"time-value\">\n {{ displayValue() }}\n </span>\n\n <ds-icon\n name=\"clock\"\n [size]=\"16\"\n />\n </button>\n\n @if (clearable() && hasValue()) {\n <button\n type=\"button\"\n class=\"time-clear\"\n aria-label=\"Clear\"\n [disabled]=\"isDisabled()\"\n (click)=\"clear($event)\"\n >\n <ds-icon\n name=\"x\"\n [size]=\"14\"\n />\n </button>\n }\n </div>\n }\n\n <ds-field-message\n [icon]=\"messageIcon()\"\n [text]=\"message().text\"\n [state]=\"message().state\"\n [messageId]=\"hintId()\"\n [reserve]=\"reserveMessageResolved()\"\n />\n</div>\n\n<ng-template #panel>\n <div class=\"time-panel\">\n <ds-time-columns\n [value]=\"panelValue()\"\n [format]=\"resolvedFormat()\"\n [minuteStep]=\"minuteStep()\"\n [minTime]=\"panelMinTime()\"\n [maxTime]=\"panelMaxTime()\"\n [disabledTime]=\"disabledTime()\"\n (timeChange)=\"onPick($event)\"\n (partPicked)=\"onPartPicked($event)\"\n />\n\n <div class=\"time-footer\">\n <button\n type=\"button\"\n class=\"time-action\"\n (click)=\"setNow()\"\n >\n Now\n </button>\n\n @if (mode() === 'range') {\n <button\n type=\"button\"\n class=\"time-action primary\"\n (click)=\"onEscape()\"\n >\n Done\n </button>\n }\n </div>\n </div>\n</ng-template>\n", styles: ["@charset \"UTF-8\";:host{--_time-picker-focus-shadow: var( --ds-time-picker-focus-shadow, var(--ds-control-focus-shadow) );--_time-picker-trigger-bg-color: var( --ds-time-picker-trigger-bg-color, var(--surface-default) );--_time-picker-trigger-border: var( --ds-time-picker-trigger-border, var(--border-default) );--_time-picker-trigger-color: var( --ds-time-picker-trigger-color, var(--text-primary) );--_time-picker-trigger-radius: var(--ds-time-picker-trigger-radius, var(--ds-radius-control));--_time-picker-trigger-pad-x: var(--ds-time-picker-trigger-pad-x, var(--field-pad-x));--_time-picker-required-color: var(--ds-time-picker-required-color, var(--error));--_time-picker-value-font-family: var(--ds-time-picker-value-font-family, var(--font-sans));--_time-picker-value-font-size: var(--ds-time-picker-value-font-size, var(--font-size-s));--_time-picker-value-weight: var(--ds-time-picker-value-weight, var(--font-weight-regular));display:block}.field{display:flex;flex-direction:column;gap:var(--field-label-gap);width:100%}.field .label{--_field-label-font-size: var(--ds-field-label-font-size, var(--font-size-xs));--_field-label-weight: var(--ds-field-label-weight, var(--font-weight-bold));--_field-label-color: var(--ds-field-label-color, var(--text-secondary));--_field-label-transform: var(--ds-field-label-transform, none);--_field-label-tracking: var(--ds-field-label-tracking, normal);display:flex;align-items:center;gap:var(--field-gap-req);font:var(--_field-label-weight) var(--_field-label-font-size)/var(--line-height-base) var(--font-sans);color:var(--_field-label-color);text-transform:var(--_field-label-transform);letter-spacing:var(--_field-label-tracking)}.field .label .req{color:var(--_time-picker-required-color);font-weight:var(--font-weight-semibold)}.field .label .optional-marker{color:var(--text-tertiary);font-weight:var(--font-weight-regular)}.trigger-wrap{position:relative;display:inline-flex;width:fit-content}:host(.full-width) .trigger-wrap,:host(.full-width) .range-wrap,:host(.full-width) .trigger{width:100%}.range-wrap{display:inline-flex;align-items:center;gap:var(--space-2);width:fit-content}.range-sep{color:var(--text-tertiary)}.trigger{display:inline-flex;align-items:center;gap:var(--space-1);background:var(--_time-picker-trigger-bg-color);border:var(--border-width-default) solid var(--_time-picker-trigger-border);border-radius:var(--_time-picker-trigger-radius);padding:0 var(--_time-picker-trigger-pad-x);--_field-box-height: var(--ds-field-height, var(--field-h-md));height:var(--_field-box-height);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--_time-picker-trigger-color);cursor:pointer;transition:border-color var(--duration-fast) var(--ease-standard)}.trigger:hover{border-color:var(--border-strong)}.trigger:focus-visible{outline:none;box-shadow:var(--_time-picker-focus-shadow)}.trigger.sm{--_field-box-height: var(--ds-field-height, var(--field-h-sm));height:var(--_field-box-height);padding:0 var(--space-2);font-size:var(--font-size-xs)}.trigger.lg{--_field-box-height: var(--ds-field-height, var(--field-h-lg));height:var(--_field-box-height);padding:0 var(--space-4);font-size:var(--font-size-m)}.trigger.disabled,.trigger:disabled{background:var(--surface-disabled);border-color:var(--border-disabled);color:var(--text-disabled);cursor:not-allowed}.trigger.has-clear{padding-right:var(--space-8)}.trigger.lg.has-clear{padding-right:var(--space-10)}.time-value{flex:1;text-align:left;font-family:var(--_time-picker-value-font-family);font-size:var(--_time-picker-value-font-size);font-weight:var(--_time-picker-value-weight);font-variant-numeric:tabular-nums}.time-clear{position:absolute;top:50%;right:var(--space-2);transform:translateY(-50%);display:inline-flex;align-items:center;justify-content:center;border:0;padding:var(--space-1);border-radius:var(--ds-radius-inner);background:transparent;color:var(--text-tertiary);cursor:pointer;transition:color var(--duration-fast) var(--ease-standard)}.time-clear:hover:not(:disabled){color:var(--text-primary)}.time-clear:focus-visible{outline:none;box-shadow:var(--_time-picker-focus-shadow)}.time-clear:active:not(:disabled,[disabled],.is-disabled){filter:brightness(var(--ds-press-brightness, .9));transform:scale(var(--ds-press-scale, .97))}.time-panel{display:flex;flex-direction:column;background:var(--ds-time-picker-bg-color, var(--surface-overlay));border:var(--border-width-default) solid var(--ds-time-picker-border, var(--border-default));border-radius:var(--ds-time-picker-panel-radius, var(--ds-radius-panel));box-shadow:var(--ds-time-picker-shadow, var(--ds-elevation-overlay));padding:var(--space-2);gap:var(--space-1)}.time-footer{display:flex;justify-content:flex-end;gap:var(--space-2);padding-top:var(--space-1);border-top:var(--border-width-default) solid var(--border-subtitle)}.time-footer:not(:has(.primary)) .time-action{flex:1;text-align:center}.time-action{appearance:none;border:0;background:transparent;cursor:pointer;padding:var(--space-1) var(--space-2);border-radius:var(--ds-radius-inner);font:var(--font-weight-medium) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--text-secondary);transition:background-color var(--duration-fast) var(--ease-standard)}.time-action:hover{background-color:var(--surface-secondary)}.time-action.primary{color:var(--accent)}.time-action:focus-visible{outline:none;box-shadow:var(--ds-time-picker-focus-shadow, var(--ds-control-focus-shadow))}:host([data-field-state=error]:not(.in-group)) .trigger{border-color:var(--error);background-color:var(--error-subtitle)}:host([data-field-state=error]:not(.in-group)) .trigger:focus-within,:host([data-field-state=error]:not(.in-group)) .trigger:focus-visible{box-shadow:var(--ds-field-focus-shadow-error)}:host([data-field-state=warning]:not(.in-group)) .trigger{border-color:var(--warning-text)}:host([data-field-state=success]:not(.in-group)) .trigger{border-color:var(--success)}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }, { kind: "component", type: FieldMessageComponent, selector: "ds-field-message", inputs: ["text", "state", "messageId", "icon", "reserve"] }, { kind: "component", type: TimeColumnsComponent, selector: "ds-time-columns", inputs: ["value", "format", "minuteStep", "minTime", "maxTime", "disabledTime"], outputs: ["timeChange", "partPicked"] }] });
|
|
651
|
+
}
|
|
652
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: TimePickerComponent, decorators: [{
|
|
653
|
+
type: Component,
|
|
654
|
+
args: [{ selector: 'ds-time-picker', standalone: true, imports: [IconComponent, FieldMessageComponent, TimeColumnsComponent], encapsulation: ViewEncapsulation.Emulated, providers: [
|
|
655
|
+
{
|
|
656
|
+
provide: NG_VALUE_ACCESSOR,
|
|
657
|
+
useExisting: forwardRef(() => TimePickerComponent),
|
|
658
|
+
multi: true,
|
|
659
|
+
},
|
|
660
|
+
], host: {
|
|
661
|
+
'[attr.data-field-state]': 'controlState()',
|
|
662
|
+
'[class.full-width]': 'fullWidth()',
|
|
663
|
+
}, template: "<div class=\"field\">\n @if (label()) {\n <span\n class=\"label\"\n [id]=\"labelId\"\n >\n {{ label() }}\n @if (required()) {\n <span\n class=\"req\"\n aria-hidden=\"true\"\n >\n *\n </span>\n } @else if (optional()) {\n <span\n class=\"optional-marker\"\n aria-hidden=\"true\"\n >\n (optional)\n </span>\n }\n </span>\n }\n\n @if (mode() === 'range') {\n <div class=\"range-wrap\">\n <div class=\"trigger-wrap\">\n <button\n #startTrigger\n type=\"button\"\n aria-haspopup=\"dialog\"\n [class]=\"triggerClasses()\"\n [disabled]=\"isDisabled()\"\n [attr.aria-expanded]=\"openSegment() === 'start'\"\n [attr.aria-label]=\"ariaLabelFor('start')\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-invalid]=\"invalidResolved() ? 'true' : null\"\n [attr.aria-describedby]=\"hintId()\"\n (click)=\"onTriggerClick('start')\"\n >\n <span class=\"time-value\">\n {{ formatFor(rangeValue()[0]) || placeholder() }}\n </span>\n\n <ds-icon\n name=\"clock\"\n [size]=\"16\"\n />\n </button>\n </div>\n\n <span\n class=\"range-sep\"\n aria-hidden=\"true\"\n >\n \u2013\n </span>\n\n <div class=\"trigger-wrap\">\n <button\n #endTrigger\n type=\"button\"\n aria-haspopup=\"dialog\"\n [class]=\"triggerClasses()\"\n [disabled]=\"isDisabled()\"\n [attr.aria-expanded]=\"openSegment() === 'end'\"\n [attr.aria-label]=\"ariaLabelFor('end')\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-invalid]=\"invalidResolved() ? 'true' : null\"\n [attr.aria-describedby]=\"hintId()\"\n (click)=\"onTriggerClick('end')\"\n >\n <span class=\"time-value\">\n {{ formatFor(rangeValue()[1]) || placeholder() }}\n </span>\n\n <ds-icon\n name=\"clock\"\n [size]=\"16\"\n />\n </button>\n </div>\n </div>\n } @else {\n <div class=\"trigger-wrap\">\n <button\n #singleTrigger\n type=\"button\"\n aria-haspopup=\"dialog\"\n [class]=\"triggerClasses()\"\n [disabled]=\"isDisabled()\"\n [attr.aria-expanded]=\"openSegment() === 'single'\"\n [attr.aria-labelledby]=\"label() ? labelId : null\"\n [attr.aria-label]=\"label() ? null : ariaLabelFor('single')\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-invalid]=\"invalidResolved() ? 'true' : null\"\n [attr.aria-describedby]=\"hintId()\"\n (click)=\"onTriggerClick('single')\"\n >\n <span class=\"time-value\">\n {{ displayValue() }}\n </span>\n\n <ds-icon\n name=\"clock\"\n [size]=\"16\"\n />\n </button>\n\n @if (clearable() && hasValue()) {\n <button\n type=\"button\"\n class=\"time-clear\"\n aria-label=\"Clear\"\n [disabled]=\"isDisabled()\"\n (click)=\"clear($event)\"\n >\n <ds-icon\n name=\"x\"\n [size]=\"14\"\n />\n </button>\n }\n </div>\n }\n\n <ds-field-message\n [icon]=\"messageIcon()\"\n [text]=\"message().text\"\n [state]=\"message().state\"\n [messageId]=\"hintId()\"\n [reserve]=\"reserveMessageResolved()\"\n />\n</div>\n\n<ng-template #panel>\n <div class=\"time-panel\">\n <ds-time-columns\n [value]=\"panelValue()\"\n [format]=\"resolvedFormat()\"\n [minuteStep]=\"minuteStep()\"\n [minTime]=\"panelMinTime()\"\n [maxTime]=\"panelMaxTime()\"\n [disabledTime]=\"disabledTime()\"\n (timeChange)=\"onPick($event)\"\n (partPicked)=\"onPartPicked($event)\"\n />\n\n <div class=\"time-footer\">\n <button\n type=\"button\"\n class=\"time-action\"\n (click)=\"setNow()\"\n >\n Now\n </button>\n\n @if (mode() === 'range') {\n <button\n type=\"button\"\n class=\"time-action primary\"\n (click)=\"onEscape()\"\n >\n Done\n </button>\n }\n </div>\n </div>\n</ng-template>\n", styles: ["@charset \"UTF-8\";:host{--_time-picker-focus-shadow: var( --ds-time-picker-focus-shadow, var(--ds-control-focus-shadow) );--_time-picker-trigger-bg-color: var( --ds-time-picker-trigger-bg-color, var(--surface-default) );--_time-picker-trigger-border: var( --ds-time-picker-trigger-border, var(--border-default) );--_time-picker-trigger-color: var( --ds-time-picker-trigger-color, var(--text-primary) );--_time-picker-trigger-radius: var(--ds-time-picker-trigger-radius, var(--ds-radius-control));--_time-picker-trigger-pad-x: var(--ds-time-picker-trigger-pad-x, var(--field-pad-x));--_time-picker-required-color: var(--ds-time-picker-required-color, var(--error));--_time-picker-value-font-family: var(--ds-time-picker-value-font-family, var(--font-sans));--_time-picker-value-font-size: var(--ds-time-picker-value-font-size, var(--font-size-s));--_time-picker-value-weight: var(--ds-time-picker-value-weight, var(--font-weight-regular));display:block}.field{display:flex;flex-direction:column;gap:var(--field-label-gap);width:100%}.field .label{--_field-label-font-size: var(--ds-field-label-font-size, var(--font-size-xs));--_field-label-weight: var(--ds-field-label-weight, var(--font-weight-bold));--_field-label-color: var(--ds-field-label-color, var(--text-secondary));--_field-label-transform: var(--ds-field-label-transform, none);--_field-label-tracking: var(--ds-field-label-tracking, normal);display:flex;align-items:center;gap:var(--field-gap-req);font:var(--_field-label-weight) var(--_field-label-font-size)/var(--line-height-base) var(--font-sans);color:var(--_field-label-color);text-transform:var(--_field-label-transform);letter-spacing:var(--_field-label-tracking)}.field .label .req{color:var(--_time-picker-required-color);font-weight:var(--font-weight-semibold)}.field .label .optional-marker{color:var(--text-tertiary);font-weight:var(--font-weight-regular)}.trigger-wrap{position:relative;display:inline-flex;width:fit-content}:host(.full-width) .trigger-wrap,:host(.full-width) .range-wrap,:host(.full-width) .trigger{width:100%}.range-wrap{display:inline-flex;align-items:center;gap:var(--space-2);width:fit-content}.range-sep{color:var(--text-tertiary)}.trigger{display:inline-flex;align-items:center;gap:var(--space-1);background:var(--_time-picker-trigger-bg-color);border:var(--border-width-default) solid var(--_time-picker-trigger-border);border-radius:var(--_time-picker-trigger-radius);padding:0 var(--_time-picker-trigger-pad-x);--_field-box-height: var(--ds-field-height, var(--field-h-md));height:var(--_field-box-height);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--_time-picker-trigger-color);cursor:pointer;transition:border-color var(--duration-fast) var(--ease-standard)}.trigger:hover{border-color:var(--border-strong)}.trigger:focus-visible{outline:none;box-shadow:var(--_time-picker-focus-shadow)}.trigger.sm{--_field-box-height: var(--ds-field-height, var(--field-h-sm));height:var(--_field-box-height);padding:0 var(--space-2);font-size:var(--font-size-xs)}.trigger.lg{--_field-box-height: var(--ds-field-height, var(--field-h-lg));height:var(--_field-box-height);padding:0 var(--space-4);font-size:var(--font-size-m)}.trigger.disabled,.trigger:disabled{background:var(--surface-disabled);border-color:var(--border-disabled);color:var(--text-disabled);cursor:not-allowed}.trigger.has-clear{padding-right:var(--space-8)}.trigger.lg.has-clear{padding-right:var(--space-10)}.time-value{flex:1;text-align:left;font-family:var(--_time-picker-value-font-family);font-size:var(--_time-picker-value-font-size);font-weight:var(--_time-picker-value-weight);font-variant-numeric:tabular-nums}.time-clear{position:absolute;top:50%;right:var(--space-2);transform:translateY(-50%);display:inline-flex;align-items:center;justify-content:center;border:0;padding:var(--space-1);border-radius:var(--ds-radius-inner);background:transparent;color:var(--text-tertiary);cursor:pointer;transition:color var(--duration-fast) var(--ease-standard)}.time-clear:hover:not(:disabled){color:var(--text-primary)}.time-clear:focus-visible{outline:none;box-shadow:var(--_time-picker-focus-shadow)}.time-clear:active:not(:disabled,[disabled],.is-disabled){filter:brightness(var(--ds-press-brightness, .9));transform:scale(var(--ds-press-scale, .97))}.time-panel{display:flex;flex-direction:column;background:var(--ds-time-picker-bg-color, var(--surface-overlay));border:var(--border-width-default) solid var(--ds-time-picker-border, var(--border-default));border-radius:var(--ds-time-picker-panel-radius, var(--ds-radius-panel));box-shadow:var(--ds-time-picker-shadow, var(--ds-elevation-overlay));padding:var(--space-2);gap:var(--space-1)}.time-footer{display:flex;justify-content:flex-end;gap:var(--space-2);padding-top:var(--space-1);border-top:var(--border-width-default) solid var(--border-subtitle)}.time-footer:not(:has(.primary)) .time-action{flex:1;text-align:center}.time-action{appearance:none;border:0;background:transparent;cursor:pointer;padding:var(--space-1) var(--space-2);border-radius:var(--ds-radius-inner);font:var(--font-weight-medium) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--text-secondary);transition:background-color var(--duration-fast) var(--ease-standard)}.time-action:hover{background-color:var(--surface-secondary)}.time-action.primary{color:var(--accent)}.time-action:focus-visible{outline:none;box-shadow:var(--ds-time-picker-focus-shadow, var(--ds-control-focus-shadow))}:host([data-field-state=error]:not(.in-group)) .trigger{border-color:var(--error);background-color:var(--error-subtitle)}:host([data-field-state=error]:not(.in-group)) .trigger:focus-within,:host([data-field-state=error]:not(.in-group)) .trigger:focus-visible{box-shadow:var(--ds-field-focus-shadow-error)}:host([data-field-state=warning]:not(.in-group)) .trigger{border-color:var(--warning-text)}:host([data-field-state=success]:not(.in-group)) .trigger{border-color:var(--success)}\n"] }]
|
|
664
|
+
}], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], minuteStep: [{ type: i0.Input, args: [{ isSignal: true, alias: "minuteStep", required: false }] }], minTime: [{ type: i0.Input, args: [{ isSignal: true, alias: "minTime", required: false }] }], maxTime: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxTime", required: false }] }], disabledTime: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabledTime", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], fullWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullWidth", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], optional: [{ type: i0.Input, args: [{ isSignal: true, alias: "optional", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], success: [{ type: i0.Input, args: [{ isSignal: true, alias: "success", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], format: [{ type: i0.Input, args: [{ isSignal: true, alias: "format", required: false }] }], singleTrigger: [{ type: i0.ViewChild, args: ['singleTrigger', { isSignal: true }] }], startTrigger: [{ type: i0.ViewChild, args: ['startTrigger', { isSignal: true }] }], endTrigger: [{ type: i0.ViewChild, args: ['endTrigger', { isSignal: true }] }], panelTpl: [{ type: i0.ViewChild, args: ['panel', { isSignal: true }] }], columns: [{ type: i0.ViewChild, args: [i0.forwardRef(() => TimeColumnsComponent), { isSignal: true }] }] } });
|
|
665
|
+
|
|
666
|
+
/**
|
|
667
|
+
* Generated bundle index. Do not edit.
|
|
668
|
+
*/
|
|
669
|
+
|
|
670
|
+
export { TimePickerComponent };
|
|
671
|
+
//# sourceMappingURL=ids-group-ltd-ids-design-system-components-time-picker.mjs.map
|