@aeris-ui/core 22.0.0-alpha.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/LICENSE +21 -0
- package/README.md +189 -0
- package/fesm2022/aeris-ui-core-accordion.mjs +412 -0
- package/fesm2022/aeris-ui-core-accordion.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-animate-on-scroll.mjs +107 -0
- package/fesm2022/aeris-ui-core-animate-on-scroll.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-auto-complete.mjs +754 -0
- package/fesm2022/aeris-ui-core-auto-complete.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-auto-focus.mjs +63 -0
- package/fesm2022/aeris-ui-core-auto-focus.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-avatar.mjs +133 -0
- package/fesm2022/aeris-ui-core-avatar.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-badge.mjs +163 -0
- package/fesm2022/aeris-ui-core-badge.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-block-ui.mjs +139 -0
- package/fesm2022/aeris-ui-core-block-ui.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-breadcrumb.mjs +433 -0
- package/fesm2022/aeris-ui-core-breadcrumb.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-button-group.mjs +39 -0
- package/fesm2022/aeris-ui-core-button-group.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-button.mjs +246 -0
- package/fesm2022/aeris-ui-core-button.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-card.mjs +134 -0
- package/fesm2022/aeris-ui-core-card.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-carousel.mjs +542 -0
- package/fesm2022/aeris-ui-core-carousel.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-cascade-select.mjs +673 -0
- package/fesm2022/aeris-ui-core-cascade-select.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-chart.mjs +296 -0
- package/fesm2022/aeris-ui-core-chart.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-checkbox.mjs +220 -0
- package/fesm2022/aeris-ui-core-checkbox.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-chip.mjs +200 -0
- package/fesm2022/aeris-ui-core-chip.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-class-names.mjs +67 -0
- package/fesm2022/aeris-ui-core-class-names.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-color-picker.mjs +1192 -0
- package/fesm2022/aeris-ui-core-color-picker.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-compare.mjs +508 -0
- package/fesm2022/aeris-ui-core-compare.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-confirm-dialog.mjs +818 -0
- package/fesm2022/aeris-ui-core-confirm-dialog.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-confirm-popup.mjs +1010 -0
- package/fesm2022/aeris-ui-core-confirm-popup.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-context-menu.mjs +720 -0
- package/fesm2022/aeris-ui-core-context-menu.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-date-picker.mjs +1471 -0
- package/fesm2022/aeris-ui-core-date-picker.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-dialog.mjs +574 -0
- package/fesm2022/aeris-ui-core-dialog.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-divider.mjs +51 -0
- package/fesm2022/aeris-ui-core-divider.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-drawer.mjs +549 -0
- package/fesm2022/aeris-ui-core-drawer.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-dynamic-dialog.mjs +333 -0
- package/fesm2022/aeris-ui-core-dynamic-dialog.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-editor.mjs +1548 -0
- package/fesm2022/aeris-ui-core-editor.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-file-upload.mjs +965 -0
- package/fesm2022/aeris-ui-core-file-upload.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-filter-service.mjs +304 -0
- package/fesm2022/aeris-ui-core-filter-service.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-fluid.mjs +23 -0
- package/fesm2022/aeris-ui-core-fluid.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-focus-trap.mjs +185 -0
- package/fesm2022/aeris-ui-core-focus-trap.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-galleria.mjs +1657 -0
- package/fesm2022/aeris-ui-core-galleria.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-glass.mjs +35 -0
- package/fesm2022/aeris-ui-core-glass.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-icon-field.mjs +113 -0
- package/fesm2022/aeris-ui-core-icon-field.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-inplace.mjs +243 -0
- package/fesm2022/aeris-ui-core-inplace.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-input-group.mjs +110 -0
- package/fesm2022/aeris-ui-core-input-group.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-input-mask.mjs +343 -0
- package/fesm2022/aeris-ui-core-input-mask.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-input-number.mjs +497 -0
- package/fesm2022/aeris-ui-core-input-number.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-input-otp.mjs +361 -0
- package/fesm2022/aeris-ui-core-input-otp.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-input-text.mjs +226 -0
- package/fesm2022/aeris-ui-core-input-text.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-key-filter.mjs +208 -0
- package/fesm2022/aeris-ui-core-key-filter.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-mega-menu.mjs +835 -0
- package/fesm2022/aeris-ui-core-mega-menu.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-menu.mjs +796 -0
- package/fesm2022/aeris-ui-core-menu.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-menubar.mjs +729 -0
- package/fesm2022/aeris-ui-core-menubar.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-message.mjs +225 -0
- package/fesm2022/aeris-ui-core-message.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-meter-group.mjs +377 -0
- package/fesm2022/aeris-ui-core-meter-group.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-multi-select.mjs +1033 -0
- package/fesm2022/aeris-ui-core-multi-select.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-order-list.mjs +351 -0
- package/fesm2022/aeris-ui-core-order-list.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-organization-chart.mjs +382 -0
- package/fesm2022/aeris-ui-core-organization-chart.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-paginator.mjs +254 -0
- package/fesm2022/aeris-ui-core-paginator.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-panel.mjs +352 -0
- package/fesm2022/aeris-ui-core-panel.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-password.mjs +479 -0
- package/fesm2022/aeris-ui-core-password.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-pick-list.mjs +939 -0
- package/fesm2022/aeris-ui-core-pick-list.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-popover.mjs +535 -0
- package/fesm2022/aeris-ui-core-popover.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-progress-bar.mjs +260 -0
- package/fesm2022/aeris-ui-core-progress-bar.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-progress-spinner.mjs +218 -0
- package/fesm2022/aeris-ui-core-progress-spinner.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-radio-button.mjs +194 -0
- package/fesm2022/aeris-ui-core-radio-button.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-rating.mjs +385 -0
- package/fesm2022/aeris-ui-core-rating.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-scroll-panel.mjs +211 -0
- package/fesm2022/aeris-ui-core-scroll-panel.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-scroll-top.mjs +94 -0
- package/fesm2022/aeris-ui-core-scroll-top.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-select.mjs +1134 -0
- package/fesm2022/aeris-ui-core-select.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-skeleton.mjs +47 -0
- package/fesm2022/aeris-ui-core-skeleton.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-slider.mjs +724 -0
- package/fesm2022/aeris-ui-core-slider.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-speed-dial.mjs +589 -0
- package/fesm2022/aeris-ui-core-speed-dial.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-split-button.mjs +532 -0
- package/fesm2022/aeris-ui-core-split-button.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-splitter.mjs +488 -0
- package/fesm2022/aeris-ui-core-splitter.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-stepper.mjs +437 -0
- package/fesm2022/aeris-ui-core-stepper.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-style-class.mjs +344 -0
- package/fesm2022/aeris-ui-core-style-class.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-table.mjs +1580 -0
- package/fesm2022/aeris-ui-core-table.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-tabs.mjs +438 -0
- package/fesm2022/aeris-ui-core-tabs.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-textarea.mjs +349 -0
- package/fesm2022/aeris-ui-core-textarea.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-theme-builder.mjs +1565 -0
- package/fesm2022/aeris-ui-core-theme-builder.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-theming.mjs +150 -0
- package/fesm2022/aeris-ui-core-theming.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-tiered-menu.mjs +718 -0
- package/fesm2022/aeris-ui-core-tiered-menu.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-timeline.mjs +278 -0
- package/fesm2022/aeris-ui-core-timeline.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-toast.mjs +422 -0
- package/fesm2022/aeris-ui-core-toast.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-toggle-switch.mjs +202 -0
- package/fesm2022/aeris-ui-core-toggle-switch.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-toolbar.mjs +136 -0
- package/fesm2022/aeris-ui-core-toolbar.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-tooltip.mjs +365 -0
- package/fesm2022/aeris-ui-core-tooltip.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-tree-select.mjs +995 -0
- package/fesm2022/aeris-ui-core-tree-select.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-tree-table.mjs +1600 -0
- package/fesm2022/aeris-ui-core-tree-table.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-tree.mjs +962 -0
- package/fesm2022/aeris-ui-core-tree.mjs.map +1 -0
- package/fesm2022/aeris-ui-core.mjs +360 -0
- package/fesm2022/aeris-ui-core.mjs.map +1 -0
- package/package.json +432 -0
- package/schematics/aeris-setup.schema.json +52 -0
- package/schematics/collection.json +10 -0
- package/schematics/ng-add/schema.json +64 -0
- package/schematics/runtime/package.json +3 -0
- package/schematics/runtime/schematics/ng-add/index.js +13 -0
- package/schematics/runtime/schematics/ng-add/index.js.map +1 -0
- package/schematics/runtime/schematics/ng-add/options.js +338 -0
- package/schematics/runtime/schematics/ng-add/options.js.map +1 -0
- package/schematics/runtime/schematics/ng-add/schema.js +3 -0
- package/schematics/runtime/schematics/ng-add/schema.js.map +1 -0
- package/schematics/runtime/schematics/ng-add/workspace.js +273 -0
- package/schematics/runtime/schematics/ng-add/workspace.js.map +1 -0
- package/schematics/runtime/theme-builder/aeris-color-derivation.js +12 -0
- package/schematics/runtime/theme-builder/aeris-color-derivation.js.map +1 -0
- package/schematics/runtime/theme-builder/aeris-color.js +263 -0
- package/schematics/runtime/theme-builder/aeris-color.js.map +1 -0
- package/schematics/runtime/theme-builder/aeris-contrast.js +245 -0
- package/schematics/runtime/theme-builder/aeris-contrast.js.map +1 -0
- package/schematics/runtime/theme-builder/aeris-foundation.js +47 -0
- package/schematics/runtime/theme-builder/aeris-foundation.js.map +1 -0
- package/schematics/runtime/theme-builder/aeris-semantic-tones.js +121 -0
- package/schematics/runtime/theme-builder/aeris-semantic-tones.js.map +1 -0
- package/schematics/runtime/theme-builder/aeris-theme-generator.js +238 -0
- package/schematics/runtime/theme-builder/aeris-theme-generator.js.map +1 -0
- package/schematics/runtime/theme-builder/aeris-theme-resolver.js +101 -0
- package/schematics/runtime/theme-builder/aeris-theme-resolver.js.map +1 -0
- package/schematics/runtime/theme-builder/aeris-theme-tokens.js +82 -0
- package/schematics/runtime/theme-builder/aeris-theme-tokens.js.map +1 -0
- package/schematics/runtime/theme-builder/aeris-theme-validation.js +183 -0
- package/schematics/runtime/theme-builder/aeris-theme-validation.js.map +1 -0
- package/schematics/runtime/theme-builder/aeris-theme.js +322 -0
- package/schematics/runtime/theme-builder/aeris-theme.js.map +1 -0
- package/schematics/runtime/theme-builder/public-api.js +17 -0
- package/schematics/runtime/theme-builder/public-api.js.map +1 -0
- package/styles/_index.scss +1 -0
- package/styles/_tokens.scss +13 -0
- package/styles/aeris.css +555 -0
- package/styles/controls.css +169 -0
- package/tools/aeris-theme.mjs +149 -0
- package/tools/aeris-theme.schema.json +143 -0
- package/types/aeris-ui-core-accordion.d.ts +101 -0
- package/types/aeris-ui-core-animate-on-scroll.d.ts +34 -0
- package/types/aeris-ui-core-auto-complete.d.ts +154 -0
- package/types/aeris-ui-core-auto-focus.d.ts +17 -0
- package/types/aeris-ui-core-avatar.d.ts +44 -0
- package/types/aeris-ui-core-badge.d.ts +48 -0
- package/types/aeris-ui-core-block-ui.d.ts +28 -0
- package/types/aeris-ui-core-breadcrumb.d.ts +104 -0
- package/types/aeris-ui-core-button-group.d.ts +17 -0
- package/types/aeris-ui-core-button.d.ts +71 -0
- package/types/aeris-ui-core-card.d.ts +43 -0
- package/types/aeris-ui-core-carousel.d.ts +126 -0
- package/types/aeris-ui-core-cascade-select.d.ts +130 -0
- package/types/aeris-ui-core-chart.d.ts +92 -0
- package/types/aeris-ui-core-checkbox.d.ts +55 -0
- package/types/aeris-ui-core-chip.d.ts +56 -0
- package/types/aeris-ui-core-class-names.d.ts +21 -0
- package/types/aeris-ui-core-color-picker.d.ts +149 -0
- package/types/aeris-ui-core-compare.d.ts +109 -0
- package/types/aeris-ui-core-confirm-dialog.d.ts +263 -0
- package/types/aeris-ui-core-confirm-popup.d.ts +281 -0
- package/types/aeris-ui-core-context-menu.d.ts +156 -0
- package/types/aeris-ui-core-date-picker.d.ts +226 -0
- package/types/aeris-ui-core-dialog.d.ts +124 -0
- package/types/aeris-ui-core-divider.d.ts +21 -0
- package/types/aeris-ui-core-drawer.d.ts +119 -0
- package/types/aeris-ui-core-dynamic-dialog.d.ts +148 -0
- package/types/aeris-ui-core-editor.d.ts +130 -0
- package/types/aeris-ui-core-file-upload.d.ts +199 -0
- package/types/aeris-ui-core-filter-service.d.ts +54 -0
- package/types/aeris-ui-core-fluid.d.ts +10 -0
- package/types/aeris-ui-core-focus-trap.d.ts +32 -0
- package/types/aeris-ui-core-galleria.d.ts +273 -0
- package/types/aeris-ui-core-glass.d.ts +17 -0
- package/types/aeris-ui-core-icon-field.d.ts +36 -0
- package/types/aeris-ui-core-inplace.d.ts +68 -0
- package/types/aeris-ui-core-input-group.d.ts +38 -0
- package/types/aeris-ui-core-input-mask.d.ts +73 -0
- package/types/aeris-ui-core-input-number.d.ts +87 -0
- package/types/aeris-ui-core-input-otp.d.ts +88 -0
- package/types/aeris-ui-core-input-text.d.ts +63 -0
- package/types/aeris-ui-core-key-filter.d.ts +41 -0
- package/types/aeris-ui-core-mega-menu.d.ts +130 -0
- package/types/aeris-ui-core-menu.d.ts +182 -0
- package/types/aeris-ui-core-menubar.d.ts +145 -0
- package/types/aeris-ui-core-message.d.ts +65 -0
- package/types/aeris-ui-core-meter-group.d.ts +100 -0
- package/types/aeris-ui-core-multi-select.d.ts +193 -0
- package/types/aeris-ui-core-order-list.d.ts +73 -0
- package/types/aeris-ui-core-organization-chart.d.ts +85 -0
- package/types/aeris-ui-core-paginator.d.ts +39 -0
- package/types/aeris-ui-core-panel.d.ts +85 -0
- package/types/aeris-ui-core-password.d.ts +110 -0
- package/types/aeris-ui-core-pick-list.d.ts +193 -0
- package/types/aeris-ui-core-popover.d.ts +112 -0
- package/types/aeris-ui-core-progress-bar.d.ts +81 -0
- package/types/aeris-ui-core-progress-spinner.d.ts +51 -0
- package/types/aeris-ui-core-radio-button.d.ts +51 -0
- package/types/aeris-ui-core-rating.d.ts +80 -0
- package/types/aeris-ui-core-scroll-panel.d.ts +66 -0
- package/types/aeris-ui-core-scroll-top.d.ts +29 -0
- package/types/aeris-ui-core-select.d.ts +223 -0
- package/types/aeris-ui-core-skeleton.d.ts +18 -0
- package/types/aeris-ui-core-slider.d.ts +117 -0
- package/types/aeris-ui-core-speed-dial.d.ts +119 -0
- package/types/aeris-ui-core-split-button.d.ts +122 -0
- package/types/aeris-ui-core-splitter.d.ts +113 -0
- package/types/aeris-ui-core-stepper.d.ts +99 -0
- package/types/aeris-ui-core-style-class.d.ts +73 -0
- package/types/aeris-ui-core-table.d.ts +333 -0
- package/types/aeris-ui-core-tabs.d.ts +82 -0
- package/types/aeris-ui-core-textarea.d.ts +80 -0
- package/types/aeris-ui-core-theme-builder.d.ts +499 -0
- package/types/aeris-ui-core-theming.d.ts +47 -0
- package/types/aeris-ui-core-tiered-menu.d.ts +152 -0
- package/types/aeris-ui-core-timeline.d.ts +80 -0
- package/types/aeris-ui-core-toast.d.ts +127 -0
- package/types/aeris-ui-core-toggle-switch.d.ts +52 -0
- package/types/aeris-ui-core-toolbar.d.ts +47 -0
- package/types/aeris-ui-core-tooltip.d.ts +92 -0
- package/types/aeris-ui-core-tree-select.d.ts +187 -0
- package/types/aeris-ui-core-tree-table.d.ts +311 -0
- package/types/aeris-ui-core-tree.d.ts +179 -0
- package/types/aeris-ui-core.d.ts +85 -0
|
@@ -0,0 +1,1471 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { model, input, booleanAttribute, numberAttribute, output, signal, computed, viewChild, viewChildren, inject, Injector, afterNextRender, forwardRef, Component } from '@angular/core';
|
|
3
|
+
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
4
|
+
|
|
5
|
+
function dateAtMidnight(date) {
|
|
6
|
+
return new Date(date.getFullYear(), date.getMonth(), date.getDate());
|
|
7
|
+
}
|
|
8
|
+
function dateKey(date) {
|
|
9
|
+
const year = date.getFullYear();
|
|
10
|
+
const month = String(date.getMonth() + 1).padStart(2, '0');
|
|
11
|
+
const day = String(date.getDate()).padStart(2, '0');
|
|
12
|
+
return `${year}-${month}-${day}`;
|
|
13
|
+
}
|
|
14
|
+
function sameDate(left, right) {
|
|
15
|
+
return Boolean(left && right && dateKey(left) === dateKey(right));
|
|
16
|
+
}
|
|
17
|
+
function addDays(date, amount) {
|
|
18
|
+
const result = dateAtMidnight(date);
|
|
19
|
+
result.setDate(result.getDate() + amount);
|
|
20
|
+
return result;
|
|
21
|
+
}
|
|
22
|
+
function addMonths(date, amount) {
|
|
23
|
+
const target = new Date(date.getFullYear(), date.getMonth() + amount, 1);
|
|
24
|
+
const lastDay = new Date(target.getFullYear(), target.getMonth() + 1, 0).getDate();
|
|
25
|
+
target.setDate(Math.min(date.getDate(), lastDay));
|
|
26
|
+
return target;
|
|
27
|
+
}
|
|
28
|
+
function addYears(date, amount) {
|
|
29
|
+
const target = new Date(date.getFullYear() + amount, date.getMonth(), 1);
|
|
30
|
+
const lastDay = new Date(target.getFullYear(), target.getMonth() + 1, 0).getDate();
|
|
31
|
+
target.setDate(Math.min(date.getDate(), lastDay));
|
|
32
|
+
return target;
|
|
33
|
+
}
|
|
34
|
+
function startOfWeek(date, firstDayOfWeek) {
|
|
35
|
+
const normalized = dateAtMidnight(date);
|
|
36
|
+
const difference = (normalized.getDay() - firstDayOfWeek + 7) % 7;
|
|
37
|
+
return addDays(normalized, -difference);
|
|
38
|
+
}
|
|
39
|
+
function calendarCells(month, firstDayOfWeek, locale) {
|
|
40
|
+
const monthStart = new Date(month.getFullYear(), month.getMonth(), 1);
|
|
41
|
+
const gridStart = startOfWeek(monthStart, firstDayOfWeek);
|
|
42
|
+
const formatter = new Intl.DateTimeFormat(locale, { dateStyle: 'full' });
|
|
43
|
+
return Array.from({ length: 42 }, (_, index) => {
|
|
44
|
+
const date = addDays(gridStart, index);
|
|
45
|
+
return {
|
|
46
|
+
date,
|
|
47
|
+
key: dateKey(date),
|
|
48
|
+
label: formatter.format(date),
|
|
49
|
+
day: date.getDate(),
|
|
50
|
+
currentMonth: date.getMonth() === month.getMonth(),
|
|
51
|
+
};
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
function weekdayLabels(locale, firstDayOfWeek) {
|
|
55
|
+
const formatter = new Intl.DateTimeFormat(locale, { weekday: 'short' });
|
|
56
|
+
const sunday = new Date(2024, 0, 7);
|
|
57
|
+
return Array.from({ length: 7 }, (_, index) => formatter.format(addDays(sunday, (firstDayOfWeek + index) % 7)));
|
|
58
|
+
}
|
|
59
|
+
function weekNumber(date) {
|
|
60
|
+
const target = dateAtMidnight(date);
|
|
61
|
+
target.setDate(target.getDate() + 4 - (target.getDay() || 7));
|
|
62
|
+
const yearStart = new Date(target.getFullYear(), 0, 1);
|
|
63
|
+
return Math.ceil(((target.getTime() - yearStart.getTime()) / 86_400_000 + 1) / 7);
|
|
64
|
+
}
|
|
65
|
+
function isDateBetween(date, start, end) {
|
|
66
|
+
if (!start || !end)
|
|
67
|
+
return false;
|
|
68
|
+
const timestamp = dateAtMidnight(date).getTime();
|
|
69
|
+
return timestamp > dateAtMidnight(start).getTime() &&
|
|
70
|
+
timestamp < dateAtMidnight(end).getTime();
|
|
71
|
+
}
|
|
72
|
+
function isValidDate(value) {
|
|
73
|
+
return value instanceof Date && !Number.isNaN(value.getTime());
|
|
74
|
+
}
|
|
75
|
+
function clampDate(date, minDate, maxDate) {
|
|
76
|
+
const normalized = dateAtMidnight(date);
|
|
77
|
+
if (minDate && normalized < dateAtMidnight(minDate))
|
|
78
|
+
return dateAtMidnight(minDate);
|
|
79
|
+
if (maxDate && normalized > dateAtMidnight(maxDate))
|
|
80
|
+
return dateAtMidnight(maxDate);
|
|
81
|
+
return normalized;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
let datePickerId = 0;
|
|
85
|
+
class AerisDatePicker {
|
|
86
|
+
value = model(null, /* @ts-ignore */
|
|
87
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
88
|
+
selectionMode = input('single', /* @ts-ignore */
|
|
89
|
+
...(ngDevMode ? [{ debugName: "selectionMode" }] : /* istanbul ignore next */ []));
|
|
90
|
+
view = input('day', /* @ts-ignore */
|
|
91
|
+
...(ngDevMode ? [{ debugName: "view" }] : /* istanbul ignore next */ []));
|
|
92
|
+
mode = input('date', /* @ts-ignore */
|
|
93
|
+
...(ngDevMode ? [{ debugName: "mode" }] : /* istanbul ignore next */ []));
|
|
94
|
+
inputId = input('', /* @ts-ignore */
|
|
95
|
+
...(ngDevMode ? [{ debugName: "inputId" }] : /* istanbul ignore next */ []));
|
|
96
|
+
name = input('', /* @ts-ignore */
|
|
97
|
+
...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
98
|
+
placeholder = input('Choose a date', /* @ts-ignore */
|
|
99
|
+
...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
100
|
+
ariaLabel = input('', /* @ts-ignore */
|
|
101
|
+
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
102
|
+
ariaLabelledby = input('', /* @ts-ignore */
|
|
103
|
+
...(ngDevMode ? [{ debugName: "ariaLabelledby" }] : /* istanbul ignore next */ []));
|
|
104
|
+
ariaDescribedby = input('', /* @ts-ignore */
|
|
105
|
+
...(ngDevMode ? [{ debugName: "ariaDescribedby" }] : /* istanbul ignore next */ []));
|
|
106
|
+
calendarAriaLabel = input('Choose a date', /* @ts-ignore */
|
|
107
|
+
...(ngDevMode ? [{ debugName: "calendarAriaLabel" }] : /* istanbul ignore next */ []));
|
|
108
|
+
timeAriaLabel = input('Choose a time', /* @ts-ignore */
|
|
109
|
+
...(ngDevMode ? [{ debugName: "timeAriaLabel" }] : /* istanbul ignore next */ []));
|
|
110
|
+
size = input('md', /* @ts-ignore */
|
|
111
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
112
|
+
appearance = input('outline', /* @ts-ignore */
|
|
113
|
+
...(ngDevMode ? [{ debugName: "appearance" }] : /* istanbul ignore next */ []));
|
|
114
|
+
locale = input('en-US', /* @ts-ignore */
|
|
115
|
+
...(ngDevMode ? [{ debugName: "locale" }] : /* istanbul ignore next */ []));
|
|
116
|
+
dateStyle = input('medium', /* @ts-ignore */
|
|
117
|
+
...(ngDevMode ? [{ debugName: "dateStyle" }] : /* istanbul ignore next */ []));
|
|
118
|
+
hourCycle = input('24', /* @ts-ignore */
|
|
119
|
+
...(ngDevMode ? [{ debugName: "hourCycle" }] : /* istanbul ignore next */ []));
|
|
120
|
+
showSeconds = input(false, { ...(ngDevMode ? { debugName: "showSeconds" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
121
|
+
minuteStep = input(1, { ...(ngDevMode ? { debugName: "minuteStep" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
122
|
+
secondStep = input(1, { ...(ngDevMode ? { debugName: "secondStep" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
123
|
+
firstDayOfWeek = input(null, /* @ts-ignore */
|
|
124
|
+
...(ngDevMode ? [{ debugName: "firstDayOfWeek" }] : /* istanbul ignore next */ []));
|
|
125
|
+
minDate = input(/* @ts-ignore */
|
|
126
|
+
...(ngDevMode ? [undefined, { debugName: "minDate" }] : /* istanbul ignore next */ []));
|
|
127
|
+
maxDate = input(/* @ts-ignore */
|
|
128
|
+
...(ngDevMode ? [undefined, { debugName: "maxDate" }] : /* istanbul ignore next */ []));
|
|
129
|
+
disabledDates = input([], /* @ts-ignore */
|
|
130
|
+
...(ngDevMode ? [{ debugName: "disabledDates" }] : /* istanbul ignore next */ []));
|
|
131
|
+
disabledDays = input([], /* @ts-ignore */
|
|
132
|
+
...(ngDevMode ? [{ debugName: "disabledDays" }] : /* istanbul ignore next */ []));
|
|
133
|
+
dateDisabled = input(null, /* @ts-ignore */
|
|
134
|
+
...(ngDevMode ? [{ debugName: "dateDisabled" }] : /* istanbul ignore next */ []));
|
|
135
|
+
numberOfMonths = input(1, { ...(ngDevMode ? { debugName: "numberOfMonths" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
136
|
+
showOtherMonths = input(true, { ...(ngDevMode ? { debugName: "showOtherMonths" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
137
|
+
selectOtherMonths = input(true, { ...(ngDevMode ? { debugName: "selectOtherMonths" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
138
|
+
showWeekNumbers = input(false, { ...(ngDevMode ? { debugName: "showWeekNumbers" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
139
|
+
showButtonBar = input(false, { ...(ngDevMode ? { debugName: "showButtonBar" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
140
|
+
showIcon = input(true, { ...(ngDevMode ? { debugName: "showIcon" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
141
|
+
clearable = input(false, { ...(ngDevMode ? { debugName: "clearable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
142
|
+
inline = input(false, { ...(ngDevMode ? { debugName: "inline" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
143
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
144
|
+
required = input(false, { ...(ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
145
|
+
invalid = input(false, { ...(ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
146
|
+
fluid = input(false, { ...(ngDevMode ? { debugName: "fluid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
147
|
+
closeOnSelect = input(true, { ...(ngDevMode ? { debugName: "closeOnSelect" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
148
|
+
todayLabel = input('Today', /* @ts-ignore */
|
|
149
|
+
...(ngDevMode ? [{ debugName: "todayLabel" }] : /* istanbul ignore next */ []));
|
|
150
|
+
clearLabel = input('Clear', /* @ts-ignore */
|
|
151
|
+
...(ngDevMode ? [{ debugName: "clearLabel" }] : /* istanbul ignore next */ []));
|
|
152
|
+
hourLabel = input('Hour', /* @ts-ignore */
|
|
153
|
+
...(ngDevMode ? [{ debugName: "hourLabel" }] : /* istanbul ignore next */ []));
|
|
154
|
+
minuteLabel = input('Minute', /* @ts-ignore */
|
|
155
|
+
...(ngDevMode ? [{ debugName: "minuteLabel" }] : /* istanbul ignore next */ []));
|
|
156
|
+
secondLabel = input('Second', /* @ts-ignore */
|
|
157
|
+
...(ngDevMode ? [{ debugName: "secondLabel" }] : /* istanbul ignore next */ []));
|
|
158
|
+
periodLabel = input('Period', /* @ts-ignore */
|
|
159
|
+
...(ngDevMode ? [{ debugName: "periodLabel" }] : /* istanbul ignore next */ []));
|
|
160
|
+
clearButtonAriaLabel = input('Clear date', /* @ts-ignore */
|
|
161
|
+
...(ngDevMode ? [{ debugName: "clearButtonAriaLabel" }] : /* istanbul ignore next */ []));
|
|
162
|
+
previousButtonAriaLabel = input('Previous period', /* @ts-ignore */
|
|
163
|
+
...(ngDevMode ? [{ debugName: "previousButtonAriaLabel" }] : /* istanbul ignore next */ []));
|
|
164
|
+
nextButtonAriaLabel = input('Next period', /* @ts-ignore */
|
|
165
|
+
...(ngDevMode ? [{ debugName: "nextButtonAriaLabel" }] : /* istanbul ignore next */ []));
|
|
166
|
+
valueInput = output();
|
|
167
|
+
changed = output();
|
|
168
|
+
opened = output();
|
|
169
|
+
closed = output();
|
|
170
|
+
cleared = output();
|
|
171
|
+
monthChanged = output();
|
|
172
|
+
focused = output();
|
|
173
|
+
blurred = output();
|
|
174
|
+
touch = output();
|
|
175
|
+
open = signal(false, /* @ts-ignore */
|
|
176
|
+
...(ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []));
|
|
177
|
+
formDisabled = signal(false, /* @ts-ignore */
|
|
178
|
+
...(ngDevMode ? [{ debugName: "formDisabled" }] : /* istanbul ignore next */ []));
|
|
179
|
+
visibleDate = signal(new Date(new Date().getFullYear(), new Date().getMonth(), 1), /* @ts-ignore */
|
|
180
|
+
...(ngDevMode ? [{ debugName: "visibleDate" }] : /* istanbul ignore next */ []));
|
|
181
|
+
activeDate = signal(dateAtMidnight(new Date()), /* @ts-ignore */
|
|
182
|
+
...(ngDevMode ? [{ debugName: "activeDate" }] : /* istanbul ignore next */ []));
|
|
183
|
+
panelView = signal('day', /* @ts-ignore */
|
|
184
|
+
...(ngDevMode ? [{ debugName: "panelView" }] : /* istanbul ignore next */ []));
|
|
185
|
+
choiceIndex = signal(0, /* @ts-ignore */
|
|
186
|
+
...(ngDevMode ? [{ debugName: "choiceIndex" }] : /* istanbul ignore next */ []));
|
|
187
|
+
fallbackTime = signal(this.timeFromDate(new Date()), /* @ts-ignore */
|
|
188
|
+
...(ngDevMode ? [{ debugName: "fallbackTime" }] : /* istanbul ignore next */ []));
|
|
189
|
+
effectiveDisabled = computed(() => this.disabled() || this.formDisabled(), /* @ts-ignore */
|
|
190
|
+
...(ngDevMode ? [{ debugName: "effectiveDisabled" }] : /* istanbul ignore next */ []));
|
|
191
|
+
panelVisible = computed(() => this.inline() || this.open(), /* @ts-ignore */
|
|
192
|
+
...(ngDevMode ? [{ debugName: "panelVisible" }] : /* istanbul ignore next */ []));
|
|
193
|
+
timeOnly = computed(() => this.mode() === 'time', /* @ts-ignore */
|
|
194
|
+
...(ngDevMode ? [{ debugName: "timeOnly" }] : /* istanbul ignore next */ []));
|
|
195
|
+
showsTimeControls = computed(() => this.mode() !== 'date', /* @ts-ignore */
|
|
196
|
+
...(ngDevMode ? [{ debugName: "showsTimeControls" }] : /* istanbul ignore next */ []));
|
|
197
|
+
panelAriaLabel = computed(() => this.timeOnly() ? this.timeAriaLabel() : this.calendarAriaLabel(), /* @ts-ignore */
|
|
198
|
+
...(ngDevMode ? [{ debugName: "panelAriaLabel" }] : /* istanbul ignore next */ []));
|
|
199
|
+
resolvedFirstDay = computed(() => this.firstDayOfWeek() ?? this.localeFirstDay(), /* @ts-ignore */
|
|
200
|
+
...(ngDevMode ? [{ debugName: "resolvedFirstDay" }] : /* istanbul ignore next */ []));
|
|
201
|
+
weekdays = computed(() => weekdayLabels(this.locale(), this.resolvedFirstDay()), /* @ts-ignore */
|
|
202
|
+
...(ngDevMode ? [{ debugName: "weekdays" }] : /* istanbul ignore next */ []));
|
|
203
|
+
visibleMonthCount = computed(() => Math.max(1, Math.min(3, Math.trunc(this.numberOfMonths()) || 1)), /* @ts-ignore */
|
|
204
|
+
...(ngDevMode ? [{ debugName: "visibleMonthCount" }] : /* istanbul ignore next */ []));
|
|
205
|
+
renderedMonths = computed(() => Array.from({ length: this.visibleMonthCount() }, (_, index) => {
|
|
206
|
+
const monthDate = addMonths(this.visibleDate(), index);
|
|
207
|
+
const days = calendarCells(monthDate, this.resolvedFirstDay(), this.locale()).map((cell) => this.renderDay(cell));
|
|
208
|
+
return {
|
|
209
|
+
key: `${monthDate.getFullYear()}-${monthDate.getMonth()}`,
|
|
210
|
+
label: new Intl.DateTimeFormat(this.locale(), {
|
|
211
|
+
month: 'long',
|
|
212
|
+
year: 'numeric',
|
|
213
|
+
}).format(monthDate),
|
|
214
|
+
days,
|
|
215
|
+
weeks: Array.from({ length: 6 }, (_, week) => weekNumber(days[week * 7]?.date ?? monthDate)),
|
|
216
|
+
};
|
|
217
|
+
}), /* @ts-ignore */
|
|
218
|
+
...(ngDevMode ? [{ debugName: "renderedMonths" }] : /* istanbul ignore next */ []));
|
|
219
|
+
visibleMonthLabel = computed(() => new Intl.DateTimeFormat(this.locale(), { month: 'long' }).format(this.visibleDate()), /* @ts-ignore */
|
|
220
|
+
...(ngDevMode ? [{ debugName: "visibleMonthLabel" }] : /* istanbul ignore next */ []));
|
|
221
|
+
visibleYear = computed(() => this.visibleDate().getFullYear(), /* @ts-ignore */
|
|
222
|
+
...(ngDevMode ? [{ debugName: "visibleYear" }] : /* istanbul ignore next */ []));
|
|
223
|
+
yearRangeStart = computed(() => Math.floor(this.visibleYear() / 12) * 12, /* @ts-ignore */
|
|
224
|
+
...(ngDevMode ? [{ debugName: "yearRangeStart" }] : /* istanbul ignore next */ []));
|
|
225
|
+
yearRangeLabel = computed(() => `${this.yearRangeStart()}–${this.yearRangeStart() + 11}`, /* @ts-ignore */
|
|
226
|
+
...(ngDevMode ? [{ debugName: "yearRangeLabel" }] : /* istanbul ignore next */ []));
|
|
227
|
+
monthChoices = computed(() => {
|
|
228
|
+
const formatter = new Intl.DateTimeFormat(this.locale(), { month: 'short' });
|
|
229
|
+
return Array.from({ length: 12 }, (_, month) => {
|
|
230
|
+
const date = new Date(this.visibleYear(), month, 1);
|
|
231
|
+
return {
|
|
232
|
+
value: month,
|
|
233
|
+
label: formatter.format(date),
|
|
234
|
+
selected: this.selectedDates().some((selected) => selected.getFullYear() === date.getFullYear() &&
|
|
235
|
+
selected.getMonth() === month),
|
|
236
|
+
disabled: !this.periodHasEnabledDate(date, 'month'),
|
|
237
|
+
};
|
|
238
|
+
});
|
|
239
|
+
}, /* @ts-ignore */
|
|
240
|
+
...(ngDevMode ? [{ debugName: "monthChoices" }] : /* istanbul ignore next */ []));
|
|
241
|
+
yearChoices = computed(() => Array.from({ length: 12 }, (_, index) => {
|
|
242
|
+
const value = this.yearRangeStart() + index;
|
|
243
|
+
return {
|
|
244
|
+
value,
|
|
245
|
+
selected: this.selectedDates().some((selected) => selected.getFullYear() === value),
|
|
246
|
+
disabled: !this.periodHasEnabledDate(new Date(value, 0, 1), 'year'),
|
|
247
|
+
};
|
|
248
|
+
}), /* @ts-ignore */
|
|
249
|
+
...(ngDevMode ? [{ debugName: "yearChoices" }] : /* istanbul ignore next */ []));
|
|
250
|
+
previousDisabled = computed(() => this.timeOnly() || !this.canNavigate(-1), /* @ts-ignore */
|
|
251
|
+
...(ngDevMode ? [{ debugName: "previousDisabled" }] : /* istanbul ignore next */ []));
|
|
252
|
+
nextDisabled = computed(() => this.timeOnly() || !this.canNavigate(1), /* @ts-ignore */
|
|
253
|
+
...(ngDevMode ? [{ debugName: "nextDisabled" }] : /* istanbul ignore next */ []));
|
|
254
|
+
hasValue = computed(() => this.selectedDates().length > 0, /* @ts-ignore */
|
|
255
|
+
...(ngDevMode ? [{ debugName: "hasValue" }] : /* istanbul ignore next */ []));
|
|
256
|
+
showClearButton = computed(() => this.clearable() && this.hasValue() && !this.effectiveDisabled(), /* @ts-ignore */
|
|
257
|
+
...(ngDevMode ? [{ debugName: "showClearButton" }] : /* istanbul ignore next */ []));
|
|
258
|
+
todayDisabled = computed(() => this.isDisabled(new Date()), /* @ts-ignore */
|
|
259
|
+
...(ngDevMode ? [{ debugName: "todayDisabled" }] : /* istanbul ignore next */ []));
|
|
260
|
+
displayValue = computed(() => this.formatValue(this.value()), /* @ts-ignore */
|
|
261
|
+
...(ngDevMode ? [{ debugName: "displayValue" }] : /* istanbul ignore next */ []));
|
|
262
|
+
serializedValue = computed(() => this.serializeValue(this.value()), /* @ts-ignore */
|
|
263
|
+
...(ngDevMode ? [{ debugName: "serializedValue" }] : /* istanbul ignore next */ []));
|
|
264
|
+
normalizedMinuteStep = computed(() => this.normalizeStep(this.minuteStep()), /* @ts-ignore */
|
|
265
|
+
...(ngDevMode ? [{ debugName: "normalizedMinuteStep" }] : /* istanbul ignore next */ []));
|
|
266
|
+
normalizedSecondStep = computed(() => this.normalizeStep(this.secondStep()), /* @ts-ignore */
|
|
267
|
+
...(ngDevMode ? [{ debugName: "normalizedSecondStep" }] : /* istanbul ignore next */ []));
|
|
268
|
+
hourMinimum = computed(() => this.hourCycle() === '12' ? 1 : 0, /* @ts-ignore */
|
|
269
|
+
...(ngDevMode ? [{ debugName: "hourMinimum" }] : /* istanbul ignore next */ []));
|
|
270
|
+
hourMaximum = computed(() => this.hourCycle() === '12' ? 12 : 23, /* @ts-ignore */
|
|
271
|
+
...(ngDevMode ? [{ debugName: "hourMaximum" }] : /* istanbul ignore next */ []));
|
|
272
|
+
timeValue = computed(() => {
|
|
273
|
+
const value = this.value();
|
|
274
|
+
return isValidDate(value) ? this.timeFromDate(value) : this.fallbackTime();
|
|
275
|
+
}, /* @ts-ignore */
|
|
276
|
+
...(ngDevMode ? [{ debugName: "timeValue" }] : /* istanbul ignore next */ []));
|
|
277
|
+
timePeriod = computed(() => this.timeValue().hours >= 12 ? 'PM' : 'AM', /* @ts-ignore */
|
|
278
|
+
...(ngDevMode ? [{ debugName: "timePeriod" }] : /* istanbul ignore next */ []));
|
|
279
|
+
timeDisplayParts = computed(() => {
|
|
280
|
+
const time = this.timeValue();
|
|
281
|
+
const hour = this.hourCycle() === '12'
|
|
282
|
+
? this.toTwelveHour(time.hours)
|
|
283
|
+
: time.hours;
|
|
284
|
+
return {
|
|
285
|
+
hour: String(hour).padStart(2, '0'),
|
|
286
|
+
minute: String(time.minutes).padStart(2, '0'),
|
|
287
|
+
second: String(time.seconds).padStart(2, '0'),
|
|
288
|
+
};
|
|
289
|
+
}, /* @ts-ignore */
|
|
290
|
+
...(ngDevMode ? [{ debugName: "timeDisplayParts" }] : /* istanbul ignore next */ []));
|
|
291
|
+
panelId = `aeris-date-picker-panel-${++datePickerId}`;
|
|
292
|
+
resolvedInputId = computed(() => this.inputId() || `${this.panelId}-trigger`, /* @ts-ignore */
|
|
293
|
+
...(ngDevMode ? [{ debugName: "resolvedInputId" }] : /* istanbul ignore next */ []));
|
|
294
|
+
trigger = viewChild('trigger', /* @ts-ignore */
|
|
295
|
+
...(ngDevMode ? [{ debugName: "trigger" }] : /* istanbul ignore next */ []));
|
|
296
|
+
hourInput = viewChild('hourInput', /* @ts-ignore */
|
|
297
|
+
...(ngDevMode ? [{ debugName: "hourInput" }] : /* istanbul ignore next */ []));
|
|
298
|
+
dayButtons = viewChildren('dayButton', /* @ts-ignore */
|
|
299
|
+
...(ngDevMode ? [{ debugName: "dayButtons" }] : /* istanbul ignore next */ []));
|
|
300
|
+
choiceButtons = viewChildren('choiceButton', /* @ts-ignore */
|
|
301
|
+
...(ngDevMode ? [{ debugName: "choiceButtons" }] : /* istanbul ignore next */ []));
|
|
302
|
+
injector = inject(Injector);
|
|
303
|
+
onChange = () => undefined;
|
|
304
|
+
onTouched = () => undefined;
|
|
305
|
+
writeValue(value) {
|
|
306
|
+
const normalized = this.normalizeValue(value);
|
|
307
|
+
this.value.set(normalized);
|
|
308
|
+
const first = this.datesFromValue(normalized)[0];
|
|
309
|
+
if (first)
|
|
310
|
+
this.syncVisibleDate(first);
|
|
311
|
+
}
|
|
312
|
+
registerOnChange(callback) {
|
|
313
|
+
this.onChange = callback;
|
|
314
|
+
}
|
|
315
|
+
registerOnTouched(callback) {
|
|
316
|
+
this.onTouched = callback;
|
|
317
|
+
}
|
|
318
|
+
setDisabledState(disabled) {
|
|
319
|
+
this.formDisabled.set(disabled);
|
|
320
|
+
if (disabled)
|
|
321
|
+
this.close(false);
|
|
322
|
+
}
|
|
323
|
+
focus(options) {
|
|
324
|
+
this.trigger()?.nativeElement.focus(options);
|
|
325
|
+
}
|
|
326
|
+
openPanel() {
|
|
327
|
+
if (this.effectiveDisabled() || this.inline() || this.open())
|
|
328
|
+
return;
|
|
329
|
+
const initial = this.selectedDates()[0] ?? clampDate(new Date(), this.minDate(), this.maxDate());
|
|
330
|
+
this.activeDate.set(initial);
|
|
331
|
+
this.syncVisibleDate(initial);
|
|
332
|
+
const initialView = this.timeOnly() ? 'day' : this.view();
|
|
333
|
+
this.panelView.set(initialView);
|
|
334
|
+
this.open.set(true);
|
|
335
|
+
this.opened.emit();
|
|
336
|
+
if (this.timeOnly()) {
|
|
337
|
+
this.scheduleTimeFocus();
|
|
338
|
+
}
|
|
339
|
+
else if (initialView === 'day') {
|
|
340
|
+
this.scheduleActiveDayFocus();
|
|
341
|
+
}
|
|
342
|
+
else {
|
|
343
|
+
this.prepareChoiceFocus(initialView);
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
close(restoreFocus = false) {
|
|
347
|
+
if (!this.open())
|
|
348
|
+
return;
|
|
349
|
+
this.open.set(false);
|
|
350
|
+
this.closed.emit();
|
|
351
|
+
if (restoreFocus)
|
|
352
|
+
queueMicrotask(() => this.focus());
|
|
353
|
+
}
|
|
354
|
+
toggle() {
|
|
355
|
+
if (this.open())
|
|
356
|
+
this.close(false);
|
|
357
|
+
else
|
|
358
|
+
this.openPanel();
|
|
359
|
+
}
|
|
360
|
+
clear() {
|
|
361
|
+
if (this.effectiveDisabled() || !this.hasValue())
|
|
362
|
+
return;
|
|
363
|
+
this.setValue(null);
|
|
364
|
+
this.cleared.emit();
|
|
365
|
+
if (!this.inline())
|
|
366
|
+
queueMicrotask(() => this.focus());
|
|
367
|
+
}
|
|
368
|
+
reset() {
|
|
369
|
+
if (this.effectiveDisabled())
|
|
370
|
+
return;
|
|
371
|
+
this.setValue(null);
|
|
372
|
+
this.close(false);
|
|
373
|
+
}
|
|
374
|
+
sameActiveDate(date) {
|
|
375
|
+
return sameDate(this.activeDate(), date);
|
|
376
|
+
}
|
|
377
|
+
selectDay(day, event) {
|
|
378
|
+
if (day.disabled)
|
|
379
|
+
return;
|
|
380
|
+
this.selectDate(day.date, event);
|
|
381
|
+
}
|
|
382
|
+
selectMonth(month, event) {
|
|
383
|
+
const date = new Date(this.visibleYear(), month, 1);
|
|
384
|
+
this.visibleDate.set(date);
|
|
385
|
+
this.activeDate.set(date);
|
|
386
|
+
if (this.view() === 'month')
|
|
387
|
+
this.selectDate(date, event);
|
|
388
|
+
else {
|
|
389
|
+
this.panelView.set('day');
|
|
390
|
+
this.scheduleActiveDayFocus();
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
selectYear(year, event) {
|
|
394
|
+
const date = new Date(year, this.visibleDate().getMonth(), 1);
|
|
395
|
+
this.visibleDate.set(date);
|
|
396
|
+
this.activeDate.set(date);
|
|
397
|
+
if (this.view() === 'year')
|
|
398
|
+
this.selectDate(date, event);
|
|
399
|
+
else {
|
|
400
|
+
this.panelView.set('month');
|
|
401
|
+
this.prepareChoiceFocus('month');
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
showMonthView() {
|
|
405
|
+
this.panelView.set('month');
|
|
406
|
+
this.prepareChoiceFocus('month');
|
|
407
|
+
}
|
|
408
|
+
showYearView() {
|
|
409
|
+
this.panelView.set('year');
|
|
410
|
+
this.prepareChoiceFocus('year');
|
|
411
|
+
}
|
|
412
|
+
navigate(direction) {
|
|
413
|
+
if (!this.canNavigate(direction))
|
|
414
|
+
return;
|
|
415
|
+
const view = this.panelView();
|
|
416
|
+
const next = view === 'year'
|
|
417
|
+
? addYears(this.visibleDate(), direction * 12)
|
|
418
|
+
: view === 'month'
|
|
419
|
+
? addYears(this.visibleDate(), direction)
|
|
420
|
+
: addMonths(this.visibleDate(), direction);
|
|
421
|
+
this.visibleDate.set(next);
|
|
422
|
+
this.monthChanged.emit(next);
|
|
423
|
+
if (view !== 'day')
|
|
424
|
+
this.prepareChoiceFocus(view);
|
|
425
|
+
}
|
|
426
|
+
selectToday(event) {
|
|
427
|
+
if (!this.todayDisabled())
|
|
428
|
+
this.selectDate(new Date(), event);
|
|
429
|
+
}
|
|
430
|
+
handleClearClick(event) {
|
|
431
|
+
event.preventDefault();
|
|
432
|
+
event.stopPropagation();
|
|
433
|
+
this.clear();
|
|
434
|
+
}
|
|
435
|
+
handleTriggerKeydown(event) {
|
|
436
|
+
if (event.key === 'Enter' ||
|
|
437
|
+
event.key === ' ' ||
|
|
438
|
+
event.key === 'ArrowDown') {
|
|
439
|
+
event.preventDefault();
|
|
440
|
+
this.openPanel();
|
|
441
|
+
}
|
|
442
|
+
else if (event.key === 'Escape') {
|
|
443
|
+
this.close(false);
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
handlePanelKeydown(event) {
|
|
447
|
+
if (event.key === 'Escape' && !this.inline()) {
|
|
448
|
+
event.preventDefault();
|
|
449
|
+
this.close(true);
|
|
450
|
+
}
|
|
451
|
+
else if (event.key === 'Tab' && !this.inline()) {
|
|
452
|
+
this.close(false);
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
handleDayKeydown(event, date) {
|
|
456
|
+
let target = null;
|
|
457
|
+
if (event.key === 'ArrowLeft')
|
|
458
|
+
target = addDays(date, -1);
|
|
459
|
+
else if (event.key === 'ArrowRight')
|
|
460
|
+
target = addDays(date, 1);
|
|
461
|
+
else if (event.key === 'ArrowUp')
|
|
462
|
+
target = addDays(date, -7);
|
|
463
|
+
else if (event.key === 'ArrowDown')
|
|
464
|
+
target = addDays(date, 7);
|
|
465
|
+
else if (event.key === 'Home') {
|
|
466
|
+
target = addDays(date, -((date.getDay() - this.resolvedFirstDay() + 7) % 7));
|
|
467
|
+
}
|
|
468
|
+
else if (event.key === 'End') {
|
|
469
|
+
target = addDays(date, 6 - ((date.getDay() - this.resolvedFirstDay() + 7) % 7));
|
|
470
|
+
}
|
|
471
|
+
else if (event.key === 'PageUp') {
|
|
472
|
+
target = event.shiftKey ? addYears(date, -1) : addMonths(date, -1);
|
|
473
|
+
}
|
|
474
|
+
else if (event.key === 'PageDown') {
|
|
475
|
+
target = event.shiftKey ? addYears(date, 1) : addMonths(date, 1);
|
|
476
|
+
}
|
|
477
|
+
else if (event.key === 'Enter' || event.key === ' ') {
|
|
478
|
+
event.preventDefault();
|
|
479
|
+
if (!this.isDisabled(date))
|
|
480
|
+
this.selectDate(date, event);
|
|
481
|
+
return;
|
|
482
|
+
}
|
|
483
|
+
if (!target)
|
|
484
|
+
return;
|
|
485
|
+
event.preventDefault();
|
|
486
|
+
this.moveActiveDate(target);
|
|
487
|
+
}
|
|
488
|
+
handleChoiceKeydown(event, currentIndex) {
|
|
489
|
+
let targetIndex = null;
|
|
490
|
+
if (event.key === 'ArrowLeft')
|
|
491
|
+
targetIndex = currentIndex - 1;
|
|
492
|
+
else if (event.key === 'ArrowRight')
|
|
493
|
+
targetIndex = currentIndex + 1;
|
|
494
|
+
else if (event.key === 'ArrowUp')
|
|
495
|
+
targetIndex = currentIndex - 3;
|
|
496
|
+
else if (event.key === 'ArrowDown')
|
|
497
|
+
targetIndex = currentIndex + 3;
|
|
498
|
+
else if (event.key === 'Home')
|
|
499
|
+
targetIndex = 0;
|
|
500
|
+
else if (event.key === 'End')
|
|
501
|
+
targetIndex = 11;
|
|
502
|
+
else if (event.key === 'PageUp') {
|
|
503
|
+
event.preventDefault();
|
|
504
|
+
this.navigate(-1);
|
|
505
|
+
return;
|
|
506
|
+
}
|
|
507
|
+
else if (event.key === 'PageDown') {
|
|
508
|
+
event.preventDefault();
|
|
509
|
+
this.navigate(1);
|
|
510
|
+
return;
|
|
511
|
+
}
|
|
512
|
+
if (targetIndex === null)
|
|
513
|
+
return;
|
|
514
|
+
event.preventDefault();
|
|
515
|
+
this.moveChoiceFocus(targetIndex);
|
|
516
|
+
}
|
|
517
|
+
handleHourInput(event) {
|
|
518
|
+
const rawValue = this.numberFromEvent(event);
|
|
519
|
+
if (rawValue === null)
|
|
520
|
+
return;
|
|
521
|
+
const displayHour = this.clamp(rawValue, this.hourMinimum(), this.hourMaximum());
|
|
522
|
+
const hours = this.hourCycle() === '12'
|
|
523
|
+
? this.fromTwelveHour(displayHour, this.timePeriod())
|
|
524
|
+
: displayHour;
|
|
525
|
+
this.updateTime({ ...this.timeValue(), hours }, event);
|
|
526
|
+
}
|
|
527
|
+
handleMinuteInput(event) {
|
|
528
|
+
const rawValue = this.numberFromEvent(event);
|
|
529
|
+
if (rawValue === null)
|
|
530
|
+
return;
|
|
531
|
+
this.updateTime({ ...this.timeValue(), minutes: this.clamp(rawValue, 0, 59) }, event);
|
|
532
|
+
}
|
|
533
|
+
handleSecondInput(event) {
|
|
534
|
+
const rawValue = this.numberFromEvent(event);
|
|
535
|
+
if (rawValue === null)
|
|
536
|
+
return;
|
|
537
|
+
this.updateTime({ ...this.timeValue(), seconds: this.clamp(rawValue, 0, 59) }, event);
|
|
538
|
+
}
|
|
539
|
+
handlePeriodChange(event) {
|
|
540
|
+
const select = event.target;
|
|
541
|
+
const period = select?.value === 'PM' ? 'PM' : 'AM';
|
|
542
|
+
const displayHour = this.toTwelveHour(this.timeValue().hours);
|
|
543
|
+
this.updateTime({ ...this.timeValue(), hours: this.fromTwelveHour(displayHour, period) }, event);
|
|
544
|
+
}
|
|
545
|
+
handleBlur(event) {
|
|
546
|
+
this.onTouched();
|
|
547
|
+
this.touch.emit();
|
|
548
|
+
this.blurred.emit(event);
|
|
549
|
+
}
|
|
550
|
+
selectDate(date, event) {
|
|
551
|
+
const normalized = dateAtMidnight(date);
|
|
552
|
+
if (this.isDisabled(normalized))
|
|
553
|
+
return;
|
|
554
|
+
let next;
|
|
555
|
+
if (this.selectionMode() === 'multiple') {
|
|
556
|
+
const current = this.selectedDates();
|
|
557
|
+
next = current.some((selected) => sameDate(selected, normalized))
|
|
558
|
+
? current.filter((selected) => !sameDate(selected, normalized))
|
|
559
|
+
: [...current, normalized].sort((left, right) => left.getTime() - right.getTime());
|
|
560
|
+
}
|
|
561
|
+
else if (this.selectionMode() === 'range') {
|
|
562
|
+
const range = this.rangeValue();
|
|
563
|
+
if (!range.start || range.end) {
|
|
564
|
+
next = { start: normalized, end: null };
|
|
565
|
+
}
|
|
566
|
+
else if (normalized < range.start) {
|
|
567
|
+
next = { start: normalized, end: range.start };
|
|
568
|
+
}
|
|
569
|
+
else {
|
|
570
|
+
next = { start: range.start, end: normalized };
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
else {
|
|
574
|
+
next = this.mode() === 'dateTime'
|
|
575
|
+
? this.withTime(normalized, this.timeValue())
|
|
576
|
+
: normalized;
|
|
577
|
+
}
|
|
578
|
+
this.activeDate.set(normalized);
|
|
579
|
+
this.syncVisibleDate(normalized);
|
|
580
|
+
this.setValue(next);
|
|
581
|
+
this.changed.emit({ originalEvent: event, value: next });
|
|
582
|
+
const rangeComplete = this.selectionMode() !== 'range' || Boolean(this.rangeValueFrom(next).end);
|
|
583
|
+
if (!this.inline() &&
|
|
584
|
+
this.closeOnSelect() &&
|
|
585
|
+
this.selectionMode() !== 'multiple' &&
|
|
586
|
+
this.mode() !== 'dateTime' &&
|
|
587
|
+
rangeComplete) {
|
|
588
|
+
this.close(true);
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
setValue(value) {
|
|
592
|
+
this.value.set(value);
|
|
593
|
+
this.valueInput.emit(value);
|
|
594
|
+
this.onChange(value);
|
|
595
|
+
}
|
|
596
|
+
selectedDates() {
|
|
597
|
+
return this.datesFromValue(this.value());
|
|
598
|
+
}
|
|
599
|
+
datesFromValue(value) {
|
|
600
|
+
if (isValidDate(value))
|
|
601
|
+
return [value];
|
|
602
|
+
if (Array.isArray(value))
|
|
603
|
+
return value.filter(isValidDate);
|
|
604
|
+
if (this.isRange(value)) {
|
|
605
|
+
return [value.start, value.end].filter(isValidDate);
|
|
606
|
+
}
|
|
607
|
+
return [];
|
|
608
|
+
}
|
|
609
|
+
rangeValue() {
|
|
610
|
+
return this.rangeValueFrom(this.value());
|
|
611
|
+
}
|
|
612
|
+
rangeValueFrom(value) {
|
|
613
|
+
return this.isRange(value) ? value : { start: null, end: null };
|
|
614
|
+
}
|
|
615
|
+
isRange(value) {
|
|
616
|
+
return Boolean(value &&
|
|
617
|
+
typeof value === 'object' &&
|
|
618
|
+
!Array.isArray(value) &&
|
|
619
|
+
!(value instanceof Date) &&
|
|
620
|
+
'start' in value &&
|
|
621
|
+
'end' in value);
|
|
622
|
+
}
|
|
623
|
+
normalizeValue(value) {
|
|
624
|
+
if (isValidDate(value)) {
|
|
625
|
+
return this.mode() === 'date' ? dateAtMidnight(value) : new Date(value);
|
|
626
|
+
}
|
|
627
|
+
if (Array.isArray(value)) {
|
|
628
|
+
return value.filter(isValidDate).map(dateAtMidnight);
|
|
629
|
+
}
|
|
630
|
+
if (this.isRange(value)) {
|
|
631
|
+
return {
|
|
632
|
+
start: isValidDate(value.start) ? dateAtMidnight(value.start) : null,
|
|
633
|
+
end: isValidDate(value.end) ? dateAtMidnight(value.end) : null,
|
|
634
|
+
};
|
|
635
|
+
}
|
|
636
|
+
return null;
|
|
637
|
+
}
|
|
638
|
+
renderDay(cell) {
|
|
639
|
+
const range = this.rangeValue();
|
|
640
|
+
const selected = this.selectedDates().some((date) => sameDate(date, cell.date));
|
|
641
|
+
const visible = cell.currentMonth || this.showOtherMonths();
|
|
642
|
+
return {
|
|
643
|
+
...cell,
|
|
644
|
+
selected,
|
|
645
|
+
rangeStart: sameDate(range.start, cell.date),
|
|
646
|
+
rangeEnd: sameDate(range.end, cell.date),
|
|
647
|
+
inRange: isDateBetween(cell.date, range.start, range.end),
|
|
648
|
+
disabled: !visible ||
|
|
649
|
+
(!cell.currentMonth && !this.selectOtherMonths()) ||
|
|
650
|
+
this.isDisabled(cell.date),
|
|
651
|
+
today: sameDate(new Date(), cell.date),
|
|
652
|
+
};
|
|
653
|
+
}
|
|
654
|
+
isDisabled(date) {
|
|
655
|
+
const normalized = dateAtMidnight(date);
|
|
656
|
+
const min = this.minDate();
|
|
657
|
+
const max = this.maxDate();
|
|
658
|
+
return Boolean((min && normalized < dateAtMidnight(min)) ||
|
|
659
|
+
(max && normalized > dateAtMidnight(max)) ||
|
|
660
|
+
this.disabledDays().includes(normalized.getDay()) ||
|
|
661
|
+
this.disabledDates().some((disabled) => sameDate(disabled, normalized)) ||
|
|
662
|
+
this.dateDisabled()?.(normalized));
|
|
663
|
+
}
|
|
664
|
+
periodHasEnabledDate(date, period) {
|
|
665
|
+
const start = period === 'year'
|
|
666
|
+
? new Date(date.getFullYear(), 0, 1)
|
|
667
|
+
: new Date(date.getFullYear(), date.getMonth(), 1);
|
|
668
|
+
const end = period === 'year'
|
|
669
|
+
? new Date(date.getFullYear(), 11, 31)
|
|
670
|
+
: new Date(date.getFullYear(), date.getMonth() + 1, 0);
|
|
671
|
+
const min = this.minDate() ? dateAtMidnight(this.minDate()) : null;
|
|
672
|
+
const max = this.maxDate() ? dateAtMidnight(this.maxDate()) : null;
|
|
673
|
+
return !(max && start > max) && !(min && end < min);
|
|
674
|
+
}
|
|
675
|
+
formatValue(value) {
|
|
676
|
+
const dateFormatter = new Intl.DateTimeFormat(this.locale(), {
|
|
677
|
+
dateStyle: this.dateStyle(),
|
|
678
|
+
});
|
|
679
|
+
const timeFormatter = new Intl.DateTimeFormat(this.locale(), {
|
|
680
|
+
hour: '2-digit',
|
|
681
|
+
minute: '2-digit',
|
|
682
|
+
second: this.showSeconds() ? '2-digit' : undefined,
|
|
683
|
+
hour12: this.hourCycle() === '12',
|
|
684
|
+
});
|
|
685
|
+
if (isValidDate(value)) {
|
|
686
|
+
if (this.mode() === 'time')
|
|
687
|
+
return timeFormatter.format(value);
|
|
688
|
+
if (this.mode() === 'dateTime') {
|
|
689
|
+
return `${dateFormatter.format(value)} ${timeFormatter.format(value)}`;
|
|
690
|
+
}
|
|
691
|
+
return dateFormatter.format(value);
|
|
692
|
+
}
|
|
693
|
+
if (Array.isArray(value))
|
|
694
|
+
return value.filter(isValidDate).map((date) => dateFormatter.format(date)).join(', ');
|
|
695
|
+
if (this.isRange(value)) {
|
|
696
|
+
if (!value.start)
|
|
697
|
+
return '';
|
|
698
|
+
return value.end
|
|
699
|
+
? `${dateFormatter.format(value.start)} - ${dateFormatter.format(value.end)}`
|
|
700
|
+
: `${dateFormatter.format(value.start)} -`;
|
|
701
|
+
}
|
|
702
|
+
return '';
|
|
703
|
+
}
|
|
704
|
+
serializeValue(value) {
|
|
705
|
+
if (isValidDate(value)) {
|
|
706
|
+
if (this.mode() === 'time')
|
|
707
|
+
return this.timeKey(value);
|
|
708
|
+
if (this.mode() === 'dateTime') {
|
|
709
|
+
return `${dateKey(value)}T${this.timeKey(value)}`;
|
|
710
|
+
}
|
|
711
|
+
return dateKey(value);
|
|
712
|
+
}
|
|
713
|
+
return this.selectedDates()
|
|
714
|
+
.map((date) => dateKey(date))
|
|
715
|
+
.join(',');
|
|
716
|
+
}
|
|
717
|
+
updateTime(time, event) {
|
|
718
|
+
const normalized = {
|
|
719
|
+
hours: this.clamp(time.hours, 0, 23),
|
|
720
|
+
minutes: this.clamp(time.minutes, 0, 59),
|
|
721
|
+
seconds: this.clamp(time.seconds, 0, 59),
|
|
722
|
+
};
|
|
723
|
+
this.fallbackTime.set(normalized);
|
|
724
|
+
const next = this.withTime(this.singleDateBase(), normalized);
|
|
725
|
+
this.setValue(next);
|
|
726
|
+
this.changed.emit({ originalEvent: event, value: next });
|
|
727
|
+
}
|
|
728
|
+
singleDateBase() {
|
|
729
|
+
const value = this.value();
|
|
730
|
+
if (isValidDate(value))
|
|
731
|
+
return dateAtMidnight(value);
|
|
732
|
+
return dateAtMidnight(this.activeDate());
|
|
733
|
+
}
|
|
734
|
+
withTime(date, time) {
|
|
735
|
+
const result = dateAtMidnight(date);
|
|
736
|
+
result.setHours(time.hours, time.minutes, this.showSeconds() ? time.seconds : 0, 0);
|
|
737
|
+
return result;
|
|
738
|
+
}
|
|
739
|
+
timeFromDate(date) {
|
|
740
|
+
return {
|
|
741
|
+
hours: date.getHours(),
|
|
742
|
+
minutes: date.getMinutes(),
|
|
743
|
+
seconds: date.getSeconds(),
|
|
744
|
+
};
|
|
745
|
+
}
|
|
746
|
+
timeKey(date) {
|
|
747
|
+
const hours = String(date.getHours()).padStart(2, '0');
|
|
748
|
+
const minutes = String(date.getMinutes()).padStart(2, '0');
|
|
749
|
+
const seconds = String(date.getSeconds()).padStart(2, '0');
|
|
750
|
+
return this.showSeconds() ? `${hours}:${minutes}:${seconds}` : `${hours}:${minutes}`;
|
|
751
|
+
}
|
|
752
|
+
numberFromEvent(event) {
|
|
753
|
+
const inputElement = event.target;
|
|
754
|
+
const value = Number(inputElement?.value);
|
|
755
|
+
return Number.isFinite(value) ? Math.trunc(value) : null;
|
|
756
|
+
}
|
|
757
|
+
normalizeStep(value) {
|
|
758
|
+
return this.clamp(Math.trunc(value) || 1, 1, 59);
|
|
759
|
+
}
|
|
760
|
+
clamp(value, min, max) {
|
|
761
|
+
return Math.min(max, Math.max(min, value));
|
|
762
|
+
}
|
|
763
|
+
toTwelveHour(hours) {
|
|
764
|
+
const normalized = hours % 12;
|
|
765
|
+
return normalized === 0 ? 12 : normalized;
|
|
766
|
+
}
|
|
767
|
+
fromTwelveHour(displayHour, period) {
|
|
768
|
+
const normalized = displayHour === 12 ? 0 : displayHour;
|
|
769
|
+
return period === 'PM' ? normalized + 12 : normalized;
|
|
770
|
+
}
|
|
771
|
+
localeFirstDay() {
|
|
772
|
+
try {
|
|
773
|
+
const locale = new Intl.Locale(this.locale());
|
|
774
|
+
return (locale.weekInfo?.firstDay ?? 7) % 7;
|
|
775
|
+
}
|
|
776
|
+
catch {
|
|
777
|
+
return 0;
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
canNavigate(direction) {
|
|
781
|
+
const view = this.panelView();
|
|
782
|
+
const target = view === 'year'
|
|
783
|
+
? addYears(this.visibleDate(), direction * 12)
|
|
784
|
+
: view === 'month'
|
|
785
|
+
? addYears(this.visibleDate(), direction)
|
|
786
|
+
: addMonths(this.visibleDate(), direction);
|
|
787
|
+
return view === 'year'
|
|
788
|
+
? this.periodHasEnabledDate(target, 'year')
|
|
789
|
+
: this.periodHasEnabledDate(target, view === 'month' ? 'year' : 'month');
|
|
790
|
+
}
|
|
791
|
+
moveActiveDate(target) {
|
|
792
|
+
let candidate = clampDate(target, this.minDate(), this.maxDate());
|
|
793
|
+
const direction = candidate < this.activeDate() ? -1 : 1;
|
|
794
|
+
for (let attempts = 0; attempts < 366 && this.isDisabled(candidate); attempts += 1) {
|
|
795
|
+
candidate = addDays(candidate, direction);
|
|
796
|
+
}
|
|
797
|
+
this.activeDate.set(candidate);
|
|
798
|
+
this.syncVisibleDate(candidate);
|
|
799
|
+
this.scheduleActiveDayFocus();
|
|
800
|
+
}
|
|
801
|
+
syncVisibleDate(date) {
|
|
802
|
+
const firstVisible = this.visibleDate();
|
|
803
|
+
const lastVisible = addMonths(firstVisible, this.visibleMonthCount() - 1);
|
|
804
|
+
const month = new Date(date.getFullYear(), date.getMonth(), 1);
|
|
805
|
+
if (month < firstVisible || month > lastVisible) {
|
|
806
|
+
this.visibleDate.set(month);
|
|
807
|
+
this.monthChanged.emit(month);
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
focusActiveDay() {
|
|
811
|
+
const key = dateKey(this.activeDate());
|
|
812
|
+
this.dayButtons()
|
|
813
|
+
.find((button) => button.nativeElement.dataset['date'] === key &&
|
|
814
|
+
!button.nativeElement.disabled)
|
|
815
|
+
?.nativeElement.focus();
|
|
816
|
+
}
|
|
817
|
+
scheduleActiveDayFocus() {
|
|
818
|
+
afterNextRender(() => this.focusActiveDay(), { injector: this.injector });
|
|
819
|
+
}
|
|
820
|
+
scheduleTimeFocus() {
|
|
821
|
+
afterNextRender(() => this.hourInput()?.nativeElement.focus(), { injector: this.injector });
|
|
822
|
+
}
|
|
823
|
+
prepareChoiceFocus(view) {
|
|
824
|
+
this.choiceIndex.set(view === 'month'
|
|
825
|
+
? this.visibleDate().getMonth()
|
|
826
|
+
: this.visibleYear() - this.yearRangeStart());
|
|
827
|
+
this.scheduleChoiceFocus();
|
|
828
|
+
}
|
|
829
|
+
moveChoiceFocus(targetIndex) {
|
|
830
|
+
const buttons = this.choiceButtons();
|
|
831
|
+
if (!buttons.length)
|
|
832
|
+
return;
|
|
833
|
+
const direction = targetIndex < this.choiceIndex() ? -1 : 1;
|
|
834
|
+
let index = Math.max(0, Math.min(buttons.length - 1, targetIndex));
|
|
835
|
+
while (buttons[index]?.nativeElement.disabled) {
|
|
836
|
+
const next = index + direction;
|
|
837
|
+
if (next < 0 || next >= buttons.length)
|
|
838
|
+
return;
|
|
839
|
+
index = next;
|
|
840
|
+
}
|
|
841
|
+
this.choiceIndex.set(index);
|
|
842
|
+
buttons[index]?.nativeElement.focus();
|
|
843
|
+
}
|
|
844
|
+
scheduleChoiceFocus() {
|
|
845
|
+
afterNextRender(() => this.moveChoiceFocus(this.choiceIndex()), { injector: this.injector });
|
|
846
|
+
}
|
|
847
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: AerisDatePicker, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
848
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: AerisDatePicker, isStandalone: true, selector: "aeris-date-picker", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, selectionMode: { classPropertyName: "selectionMode", publicName: "selectionMode", isSignal: true, isRequired: false, transformFunction: null }, view: { classPropertyName: "view", publicName: "view", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "ariaLabelledby", isSignal: true, isRequired: false, transformFunction: null }, ariaDescribedby: { classPropertyName: "ariaDescribedby", publicName: "ariaDescribedby", isSignal: true, isRequired: false, transformFunction: null }, calendarAriaLabel: { classPropertyName: "calendarAriaLabel", publicName: "calendarAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, timeAriaLabel: { classPropertyName: "timeAriaLabel", publicName: "timeAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null }, dateStyle: { classPropertyName: "dateStyle", publicName: "dateStyle", isSignal: true, isRequired: false, transformFunction: null }, hourCycle: { classPropertyName: "hourCycle", publicName: "hourCycle", isSignal: true, isRequired: false, transformFunction: null }, showSeconds: { classPropertyName: "showSeconds", publicName: "showSeconds", isSignal: true, isRequired: false, transformFunction: null }, minuteStep: { classPropertyName: "minuteStep", publicName: "minuteStep", isSignal: true, isRequired: false, transformFunction: null }, secondStep: { classPropertyName: "secondStep", publicName: "secondStep", isSignal: true, isRequired: false, transformFunction: null }, firstDayOfWeek: { classPropertyName: "firstDayOfWeek", publicName: "firstDayOfWeek", isSignal: true, isRequired: false, transformFunction: null }, minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: true, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: true, isRequired: false, transformFunction: null }, disabledDates: { classPropertyName: "disabledDates", publicName: "disabledDates", isSignal: true, isRequired: false, transformFunction: null }, disabledDays: { classPropertyName: "disabledDays", publicName: "disabledDays", isSignal: true, isRequired: false, transformFunction: null }, dateDisabled: { classPropertyName: "dateDisabled", publicName: "dateDisabled", isSignal: true, isRequired: false, transformFunction: null }, numberOfMonths: { classPropertyName: "numberOfMonths", publicName: "numberOfMonths", isSignal: true, isRequired: false, transformFunction: null }, showOtherMonths: { classPropertyName: "showOtherMonths", publicName: "showOtherMonths", isSignal: true, isRequired: false, transformFunction: null }, selectOtherMonths: { classPropertyName: "selectOtherMonths", publicName: "selectOtherMonths", isSignal: true, isRequired: false, transformFunction: null }, showWeekNumbers: { classPropertyName: "showWeekNumbers", publicName: "showWeekNumbers", isSignal: true, isRequired: false, transformFunction: null }, showButtonBar: { classPropertyName: "showButtonBar", publicName: "showButtonBar", isSignal: true, isRequired: false, transformFunction: null }, showIcon: { classPropertyName: "showIcon", publicName: "showIcon", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, inline: { classPropertyName: "inline", publicName: "inline", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, fluid: { classPropertyName: "fluid", publicName: "fluid", isSignal: true, isRequired: false, transformFunction: null }, closeOnSelect: { classPropertyName: "closeOnSelect", publicName: "closeOnSelect", isSignal: true, isRequired: false, transformFunction: null }, todayLabel: { classPropertyName: "todayLabel", publicName: "todayLabel", isSignal: true, isRequired: false, transformFunction: null }, clearLabel: { classPropertyName: "clearLabel", publicName: "clearLabel", isSignal: true, isRequired: false, transformFunction: null }, hourLabel: { classPropertyName: "hourLabel", publicName: "hourLabel", isSignal: true, isRequired: false, transformFunction: null }, minuteLabel: { classPropertyName: "minuteLabel", publicName: "minuteLabel", isSignal: true, isRequired: false, transformFunction: null }, secondLabel: { classPropertyName: "secondLabel", publicName: "secondLabel", isSignal: true, isRequired: false, transformFunction: null }, periodLabel: { classPropertyName: "periodLabel", publicName: "periodLabel", isSignal: true, isRequired: false, transformFunction: null }, clearButtonAriaLabel: { classPropertyName: "clearButtonAriaLabel", publicName: "clearButtonAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, previousButtonAriaLabel: { classPropertyName: "previousButtonAriaLabel", publicName: "previousButtonAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, nextButtonAriaLabel: { classPropertyName: "nextButtonAriaLabel", publicName: "nextButtonAriaLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", valueInput: "valueInput", changed: "changed", opened: "opened", closed: "closed", cleared: "cleared", monthChanged: "monthChanged", focused: "focused", blurred: "blurred", touch: "touch" }, host: { properties: { "attr.data-open": "open() || null", "attr.data-inline": "inline() || null", "attr.data-disabled": "effectiveDisabled() || null", "attr.data-fluid": "fluid() || null" } }, providers: [
|
|
849
|
+
{
|
|
850
|
+
provide: NG_VALUE_ACCESSOR,
|
|
851
|
+
useExisting: forwardRef(() => AerisDatePicker),
|
|
852
|
+
multi: true,
|
|
853
|
+
},
|
|
854
|
+
], viewQueries: [{ propertyName: "trigger", first: true, predicate: ["trigger"], descendants: true, isSignal: true }, { propertyName: "hourInput", first: true, predicate: ["hourInput"], descendants: true, isSignal: true }, { propertyName: "dayButtons", predicate: ["dayButton"], descendants: true, isSignal: true }, { propertyName: "choiceButtons", predicate: ["choiceButton"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
855
|
+
<div
|
|
856
|
+
class="aeris-date-picker"
|
|
857
|
+
[attr.data-size]="size()"
|
|
858
|
+
[attr.data-appearance]="appearance()"
|
|
859
|
+
[attr.data-open]="panelVisible() || null"
|
|
860
|
+
[attr.data-inline]="inline() || null"
|
|
861
|
+
[attr.data-invalid]="invalid() || null"
|
|
862
|
+
[attr.data-disabled]="effectiveDisabled() || null"
|
|
863
|
+
[attr.data-fluid]="fluid() || null"
|
|
864
|
+
>
|
|
865
|
+
@if (name() && serializedValue()) {
|
|
866
|
+
<input type="hidden" [name]="name()" [value]="serializedValue()" />
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
@if (!inline()) {
|
|
870
|
+
<div class="aeris-date-picker__control">
|
|
871
|
+
<button
|
|
872
|
+
#trigger
|
|
873
|
+
class="aeris-date-picker__trigger"
|
|
874
|
+
type="button"
|
|
875
|
+
role="combobox"
|
|
876
|
+
aria-haspopup="dialog"
|
|
877
|
+
[id]="resolvedInputId()"
|
|
878
|
+
[attr.aria-expanded]="open()"
|
|
879
|
+
[attr.aria-controls]="panelId"
|
|
880
|
+
[attr.aria-label]="ariaLabel() || null"
|
|
881
|
+
[attr.aria-labelledby]="ariaLabelledby() || null"
|
|
882
|
+
[attr.aria-describedby]="ariaDescribedby() || null"
|
|
883
|
+
[attr.aria-invalid]="invalid() || null"
|
|
884
|
+
[attr.aria-required]="required() || null"
|
|
885
|
+
[disabled]="effectiveDisabled()"
|
|
886
|
+
(click)="toggle()"
|
|
887
|
+
(keydown)="handleTriggerKeydown($event)"
|
|
888
|
+
(focus)="focused.emit($event)"
|
|
889
|
+
(blur)="handleBlur($event)"
|
|
890
|
+
>
|
|
891
|
+
<span
|
|
892
|
+
class="aeris-date-picker__value"
|
|
893
|
+
[class.aeris-date-picker__placeholder]="!displayValue()"
|
|
894
|
+
>{{ displayValue() || placeholder() }}</span>
|
|
895
|
+
</button>
|
|
896
|
+
|
|
897
|
+
@if (showClearButton()) {
|
|
898
|
+
<button
|
|
899
|
+
class="aeris-date-picker__clear"
|
|
900
|
+
type="button"
|
|
901
|
+
[attr.aria-label]="clearButtonAriaLabel()"
|
|
902
|
+
(click)="handleClearClick($event)"
|
|
903
|
+
>
|
|
904
|
+
<span aria-hidden="true"></span>
|
|
905
|
+
</button>
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
@if (showIcon()) {
|
|
909
|
+
<span class="aeris-date-picker__calendar-icon" aria-hidden="true">
|
|
910
|
+
<span></span>
|
|
911
|
+
</span>
|
|
912
|
+
} @else {
|
|
913
|
+
<span class="aeris-date-picker__chevron" aria-hidden="true"></span>
|
|
914
|
+
}
|
|
915
|
+
</div>
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
@if (panelVisible()) {
|
|
919
|
+
@if (!inline()) {
|
|
920
|
+
<button
|
|
921
|
+
class="aeris-date-picker__dismiss"
|
|
922
|
+
type="button"
|
|
923
|
+
tabindex="-1"
|
|
924
|
+
aria-label="Close calendar"
|
|
925
|
+
(click)="close(true)"
|
|
926
|
+
></button>
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
<div
|
|
930
|
+
class="aeris-date-picker__panel"
|
|
931
|
+
[id]="panelId"
|
|
932
|
+
role="dialog"
|
|
933
|
+
aria-modal="false"
|
|
934
|
+
[attr.aria-label]="panelAriaLabel()"
|
|
935
|
+
(keydown)="handlePanelKeydown($event)"
|
|
936
|
+
>
|
|
937
|
+
@if (!timeOnly()) {
|
|
938
|
+
<div class="aeris-date-picker__header">
|
|
939
|
+
<button
|
|
940
|
+
class="aeris-date-picker__nav aeris-date-picker__nav--previous"
|
|
941
|
+
type="button"
|
|
942
|
+
[attr.aria-label]="previousButtonAriaLabel()"
|
|
943
|
+
[disabled]="previousDisabled()"
|
|
944
|
+
(click)="navigate(-1)"
|
|
945
|
+
><span aria-hidden="true"></span></button>
|
|
946
|
+
|
|
947
|
+
<div class="aeris-date-picker__heading">
|
|
948
|
+
@if (panelView() === 'day') {
|
|
949
|
+
<button type="button" (click)="showMonthView()">
|
|
950
|
+
{{ visibleMonthLabel() }}
|
|
951
|
+
</button>
|
|
952
|
+
<button type="button" (click)="showYearView()">
|
|
953
|
+
{{ visibleYear() }}
|
|
954
|
+
</button>
|
|
955
|
+
} @else if (panelView() === 'month') {
|
|
956
|
+
<span>{{ visibleYear() }}</span>
|
|
957
|
+
} @else {
|
|
958
|
+
<span>{{ yearRangeLabel() }}</span>
|
|
959
|
+
}
|
|
960
|
+
</div>
|
|
961
|
+
|
|
962
|
+
<button
|
|
963
|
+
class="aeris-date-picker__nav aeris-date-picker__nav--next"
|
|
964
|
+
type="button"
|
|
965
|
+
[attr.aria-label]="nextButtonAriaLabel()"
|
|
966
|
+
[disabled]="nextDisabled()"
|
|
967
|
+
(click)="navigate(1)"
|
|
968
|
+
><span aria-hidden="true"></span></button>
|
|
969
|
+
</div>
|
|
970
|
+
|
|
971
|
+
@if (panelView() === 'day') {
|
|
972
|
+
<div
|
|
973
|
+
class="aeris-date-picker__months"
|
|
974
|
+
[style.--aeris-date-picker-month-count]="visibleMonthCount()"
|
|
975
|
+
>
|
|
976
|
+
@for (month of renderedMonths(); track month.key) {
|
|
977
|
+
<section class="aeris-date-picker__month" [attr.aria-label]="month.label">
|
|
978
|
+
@if (visibleMonthCount() > 1) {
|
|
979
|
+
<h3>{{ month.label }}</h3>
|
|
980
|
+
}
|
|
981
|
+
<div class="aeris-date-picker__weekdays" aria-hidden="true">
|
|
982
|
+
@if (showWeekNumbers()) {
|
|
983
|
+
<span class="aeris-date-picker__week-label">Wk</span>
|
|
984
|
+
}
|
|
985
|
+
@for (weekday of weekdays(); track $index) {
|
|
986
|
+
<span>{{ weekday }}</span>
|
|
987
|
+
}
|
|
988
|
+
</div>
|
|
989
|
+
<div class="aeris-date-picker__calendar" role="grid">
|
|
990
|
+
@for (week of [0, 1, 2, 3, 4, 5]; track week) {
|
|
991
|
+
<div class="aeris-date-picker__week" role="row">
|
|
992
|
+
@if (showWeekNumbers()) {
|
|
993
|
+
<span class="aeris-date-picker__week-number" role="rowheader">
|
|
994
|
+
{{ month.weeks[week] }}
|
|
995
|
+
</span>
|
|
996
|
+
}
|
|
997
|
+
@for (
|
|
998
|
+
day of month.days.slice(week * 7, week * 7 + 7);
|
|
999
|
+
track day.key
|
|
1000
|
+
) {
|
|
1001
|
+
<button
|
|
1002
|
+
#dayButton
|
|
1003
|
+
class="aeris-date-picker__day"
|
|
1004
|
+
type="button"
|
|
1005
|
+
role="gridcell"
|
|
1006
|
+
[attr.data-date]="day.key"
|
|
1007
|
+
[attr.aria-label]="day.label"
|
|
1008
|
+
[attr.aria-selected]="day.selected"
|
|
1009
|
+
[attr.aria-current]="day.today ? 'date' : null"
|
|
1010
|
+
[attr.data-other-month]="!day.currentMonth || null"
|
|
1011
|
+
[attr.data-selected]="day.selected || null"
|
|
1012
|
+
[attr.data-range-start]="day.rangeStart || null"
|
|
1013
|
+
[attr.data-range-end]="day.rangeEnd || null"
|
|
1014
|
+
[attr.data-in-range]="day.inRange || null"
|
|
1015
|
+
[attr.data-today]="day.today || null"
|
|
1016
|
+
[disabled]="day.disabled"
|
|
1017
|
+
[tabindex]="sameActiveDate(day.date) ? 0 : -1"
|
|
1018
|
+
(click)="selectDay(day, $event)"
|
|
1019
|
+
(focus)="activeDate.set(day.date)"
|
|
1020
|
+
(keydown)="handleDayKeydown($event, day.date)"
|
|
1021
|
+
>{{ day.day }}</button>
|
|
1022
|
+
}
|
|
1023
|
+
</div>
|
|
1024
|
+
}
|
|
1025
|
+
</div>
|
|
1026
|
+
</section>
|
|
1027
|
+
}
|
|
1028
|
+
</div>
|
|
1029
|
+
} @else if (panelView() === 'month') {
|
|
1030
|
+
<div class="aeris-date-picker__choice-grid" role="listbox" aria-label="Choose month">
|
|
1031
|
+
@for (month of monthChoices(); track month.value; let index = $index) {
|
|
1032
|
+
<button
|
|
1033
|
+
#choiceButton
|
|
1034
|
+
type="button"
|
|
1035
|
+
role="option"
|
|
1036
|
+
[attr.aria-selected]="month.selected"
|
|
1037
|
+
[attr.data-selected]="month.selected || null"
|
|
1038
|
+
[disabled]="month.disabled"
|
|
1039
|
+
[tabindex]="choiceIndex() === index ? 0 : -1"
|
|
1040
|
+
(click)="selectMonth(month.value, $event)"
|
|
1041
|
+
(keydown)="handleChoiceKeydown($event, index)"
|
|
1042
|
+
>{{ month.label }}</button>
|
|
1043
|
+
}
|
|
1044
|
+
</div>
|
|
1045
|
+
} @else {
|
|
1046
|
+
<div class="aeris-date-picker__choice-grid" role="listbox" aria-label="Choose year">
|
|
1047
|
+
@for (year of yearChoices(); track year.value; let index = $index) {
|
|
1048
|
+
<button
|
|
1049
|
+
#choiceButton
|
|
1050
|
+
type="button"
|
|
1051
|
+
role="option"
|
|
1052
|
+
[attr.aria-selected]="year.selected"
|
|
1053
|
+
[attr.data-selected]="year.selected || null"
|
|
1054
|
+
[disabled]="year.disabled"
|
|
1055
|
+
[tabindex]="choiceIndex() === index ? 0 : -1"
|
|
1056
|
+
(click)="selectYear(year.value, $event)"
|
|
1057
|
+
(keydown)="handleChoiceKeydown($event, index)"
|
|
1058
|
+
>{{ year.value }}</button>
|
|
1059
|
+
}
|
|
1060
|
+
</div>
|
|
1061
|
+
}
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
@if (showsTimeControls()) {
|
|
1065
|
+
<div
|
|
1066
|
+
class="aeris-date-picker__time"
|
|
1067
|
+
role="group"
|
|
1068
|
+
[attr.aria-label]="timeAriaLabel()"
|
|
1069
|
+
[attr.data-time-only]="timeOnly() || null"
|
|
1070
|
+
>
|
|
1071
|
+
<label class="aeris-date-picker__time-field">
|
|
1072
|
+
<span>{{ hourLabel() }}</span>
|
|
1073
|
+
<input
|
|
1074
|
+
#hourInput
|
|
1075
|
+
type="number"
|
|
1076
|
+
inputmode="numeric"
|
|
1077
|
+
[min]="hourMinimum()"
|
|
1078
|
+
[max]="hourMaximum()"
|
|
1079
|
+
step="1"
|
|
1080
|
+
[value]="timeDisplayParts().hour"
|
|
1081
|
+
[disabled]="effectiveDisabled()"
|
|
1082
|
+
(input)="handleHourInput($event)"
|
|
1083
|
+
/>
|
|
1084
|
+
</label>
|
|
1085
|
+
|
|
1086
|
+
<span class="aeris-date-picker__time-separator" aria-hidden="true">:</span>
|
|
1087
|
+
|
|
1088
|
+
<label class="aeris-date-picker__time-field">
|
|
1089
|
+
<span>{{ minuteLabel() }}</span>
|
|
1090
|
+
<input
|
|
1091
|
+
type="number"
|
|
1092
|
+
inputmode="numeric"
|
|
1093
|
+
min="0"
|
|
1094
|
+
max="59"
|
|
1095
|
+
[step]="normalizedMinuteStep()"
|
|
1096
|
+
[value]="timeDisplayParts().minute"
|
|
1097
|
+
[disabled]="effectiveDisabled()"
|
|
1098
|
+
(input)="handleMinuteInput($event)"
|
|
1099
|
+
/>
|
|
1100
|
+
</label>
|
|
1101
|
+
|
|
1102
|
+
@if (showSeconds()) {
|
|
1103
|
+
<span class="aeris-date-picker__time-separator" aria-hidden="true">:</span>
|
|
1104
|
+
|
|
1105
|
+
<label class="aeris-date-picker__time-field">
|
|
1106
|
+
<span>{{ secondLabel() }}</span>
|
|
1107
|
+
<input
|
|
1108
|
+
type="number"
|
|
1109
|
+
inputmode="numeric"
|
|
1110
|
+
min="0"
|
|
1111
|
+
max="59"
|
|
1112
|
+
[step]="normalizedSecondStep()"
|
|
1113
|
+
[value]="timeDisplayParts().second"
|
|
1114
|
+
[disabled]="effectiveDisabled()"
|
|
1115
|
+
(input)="handleSecondInput($event)"
|
|
1116
|
+
/>
|
|
1117
|
+
</label>
|
|
1118
|
+
}
|
|
1119
|
+
|
|
1120
|
+
@if (hourCycle() === '12') {
|
|
1121
|
+
<label class="aeris-date-picker__time-field aeris-date-picker__time-field--period">
|
|
1122
|
+
<span>{{ periodLabel() }}</span>
|
|
1123
|
+
<select
|
|
1124
|
+
[value]="timePeriod()"
|
|
1125
|
+
[disabled]="effectiveDisabled()"
|
|
1126
|
+
(change)="handlePeriodChange($event)"
|
|
1127
|
+
>
|
|
1128
|
+
<option value="AM">AM</option>
|
|
1129
|
+
<option value="PM">PM</option>
|
|
1130
|
+
</select>
|
|
1131
|
+
</label>
|
|
1132
|
+
}
|
|
1133
|
+
</div>
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1136
|
+
@if (showButtonBar()) {
|
|
1137
|
+
<div class="aeris-date-picker__footer">
|
|
1138
|
+
@if (!timeOnly()) {
|
|
1139
|
+
<button type="button" [disabled]="todayDisabled()" (click)="selectToday($event)">
|
|
1140
|
+
{{ todayLabel() }}
|
|
1141
|
+
</button>
|
|
1142
|
+
}
|
|
1143
|
+
<button type="button" [disabled]="!hasValue()" (click)="clear()">
|
|
1144
|
+
{{ clearLabel() }}
|
|
1145
|
+
</button>
|
|
1146
|
+
</div>
|
|
1147
|
+
}
|
|
1148
|
+
</div>
|
|
1149
|
+
}
|
|
1150
|
+
</div>
|
|
1151
|
+
`, isInline: true, styles: [":host{--_aeris-chevron-mask: var( --aeris-icon-chevron, url(data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%2024%2024%27%3E%3Cpath%20d=%27M7%209.5%2012%2014.5%2017%209.5%27%20fill=%27none%27%20stroke=%27black%27%20stroke-width=%272.4%27%20stroke-linecap=%27round%27%20stroke-linejoin=%27round%27/%3E%3C/svg%3E) );display:inline-block;min-width:13rem;max-width:100%;color:var(--aeris-date-picker-text, var(--aeris-text, #222222));font:inherit}:host([data-fluid]),:host([data-inline]){width:100%}.aeris-date-picker{--aeris-date-picker-height: var(--aeris-control-height, 2.625rem);--aeris-date-picker-font-size: .875rem;--aeris-date-picker-padding: .75rem;position:relative;width:100%}.aeris-date-picker[data-size=xs]{--aeris-date-picker-height: 1.875rem;--aeris-date-picker-font-size: .75rem;--aeris-date-picker-padding: .5625rem}.aeris-date-picker[data-size=sm]{--aeris-date-picker-height: 2.25rem;--aeris-date-picker-font-size: .8125rem;--aeris-date-picker-padding: .6875rem}.aeris-date-picker[data-size=lg]{--aeris-date-picker-height: 3rem;--aeris-date-picker-font-size: .9375rem;--aeris-date-picker-padding: .875rem}.aeris-date-picker__control{position:relative}.aeris-date-picker__trigger{width:100%;min-height:var(--aeris-date-picker-height);display:flex;align-items:center;padding:0 3rem 0 var(--aeris-date-picker-padding);border:1px solid var(--aeris-date-picker-border, var(--aeris-border-strong, #c7c9c0));border-radius:var(--aeris-date-picker-radius, var(--aeris-radius-control, var(--aeris-radius-sm, .4375rem)));background:var(--aeris-date-picker-background, var(--aeris-surface, #fff));color:inherit;font:inherit;font-size:var(--aeris-date-picker-font-size);text-align:left;cursor:pointer;transition:border-color .15s ease,box-shadow .15s ease}.aeris-date-picker__control:has(.aeris-date-picker__clear) .aeris-date-picker__trigger{padding-right:4.625rem}.aeris-date-picker[data-appearance=filled] .aeris-date-picker__trigger{border-color:transparent;background:var(--aeris-date-picker-filled-background, var(--aeris-surface-2, #f2f0ec))}.aeris-date-picker__trigger:hover,.aeris-date-picker[data-open] .aeris-date-picker__trigger{border-color:var(--aeris-date-picker-focus, var(--aeris-focus, #536437))}.aeris-date-picker__trigger:focus-visible{outline:0;border-color:var(--aeris-date-picker-focus, var(--aeris-focus, #536437));box-shadow:0 0 0 3px color-mix(in srgb,var(--aeris-focus, #536437) 22%,transparent)}.aeris-date-picker[data-invalid] .aeris-date-picker__trigger{border-color:var(--aeris-danger, #c81e2a)}.aeris-date-picker[data-disabled] .aeris-date-picker__trigger{opacity:var(--aeris-disabled-opacity, .5);cursor:not-allowed}.aeris-date-picker__value{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.aeris-date-picker__placeholder{color:var(--aeris-date-picker-placeholder, var(--aeris-text-2, #555555))}.aeris-date-picker__clear{position:absolute;z-index:2;top:50%;right:2.25rem;width:1.5rem;height:1.5rem;display:grid;place-items:center;padding:0;border:0;border-radius:.375rem;background:transparent;color:var(--aeris-text-2, #555555);transform:translateY(-50%);cursor:pointer}.aeris-date-picker__clear:hover,.aeris-date-picker__clear:focus-visible{background:var(--aeris-surface-2, #f2f0ec);color:var(--aeris-text, #222222)}.aeris-date-picker__clear:focus-visible{outline:2px solid var(--aeris-focus, #536437);outline-offset:1px}.aeris-date-picker__clear span{width:var(--aeris-icon-size, 1rem);height:var(--aeris-icon-size, 1rem);background:currentColor;-webkit-mask:var(--aeris-icon-close) center/100% 100% no-repeat;mask:var(--aeris-icon-close) center/100% 100% no-repeat}.aeris-date-picker__calendar-icon{position:absolute;top:50%;right:var(--aeris-date-picker-padding);width:1rem;height:1rem;border:1.5px solid currentColor;border-radius:.1875rem;color:var(--aeris-text-2, #555555);transform:translateY(-50%);pointer-events:none}.aeris-date-picker__calendar-icon:before{position:absolute;inset:.1875rem -.09375rem auto;height:1.5px;background:currentColor;content:\"\"}.aeris-date-picker__calendar-icon:after{position:absolute;top:-.25rem;left:.1875rem;width:.5rem;height:.25rem;border-right:1.5px solid currentColor;border-left:1.5px solid currentColor;content:\"\"}.aeris-date-picker__calendar-icon span{position:absolute;right:.1875rem;bottom:.1875rem;width:.1875rem;height:.1875rem;border-radius:50%;background:currentColor;box-shadow:-.3125rem 0 currentColor}.aeris-date-picker__chevron{position:absolute;top:50%;right:var(--aeris-date-picker-padding);width:1rem;height:1rem;color:var(--aeris-text-2, #555555);transform:translateY(-50%);pointer-events:none}.aeris-date-picker__chevron:before{position:absolute;top:50%;left:50%;width:1rem;height:1rem;background:currentColor;content:\"\";transform:translate(-50%,-50%);-webkit-mask:var(--_aeris-chevron-mask) center/100% 100% no-repeat;mask:var(--_aeris-chevron-mask) center/100% 100% no-repeat}.aeris-date-picker__dismiss{position:fixed;z-index:89;inset:0;width:100vw;height:100vh;height:100dvh;padding:0;border:0;background:transparent;cursor:default}.aeris-date-picker__panel{position:absolute;z-index:90;top:calc(100% + .4375rem);left:0;width:max-content;max-width:calc(100vw - 2rem);padding:.75rem;border:1px solid var(--aeris-date-picker-panel-border, var(--aeris-border, #deddd7));border-radius:var(--aeris-date-picker-panel-radius, var(--aeris-radius-md, .6875rem));background:var(--aeris-date-picker-panel-background, var(--aeris-surface, #fff));box-shadow:var(--aeris-date-picker-panel-shadow, 0 1rem 2.5rem rgba(31, 35, 27, .16));scrollbar-color:var(--aeris-border-strong, #c7c9c0) transparent;scrollbar-width:thin}.aeris-date-picker__panel::-webkit-scrollbar{width:.75rem;height:.75rem}.aeris-date-picker__panel::-webkit-scrollbar-track,.aeris-date-picker__panel::-webkit-scrollbar-corner{background:transparent}.aeris-date-picker__panel::-webkit-scrollbar-thumb{border:3px solid transparent;border-radius:var(--aeris-radius-pill, 999px);background:var(--aeris-border-strong, #c7c9c0);background-clip:content-box}.aeris-date-picker[data-inline] .aeris-date-picker__panel{position:relative;z-index:auto;top:auto;width:100%;box-shadow:none}.aeris-date-picker__header{min-height:2.25rem;display:grid;grid-template-columns:2.25rem 1fr 2.25rem;align-items:center;gap:.375rem;margin-bottom:.625rem}.aeris-date-picker__heading{display:flex;align-items:center;justify-content:center;gap:.25rem;color:var(--aeris-text, #222222);font-size:.875rem;font-weight:700}.aeris-date-picker__heading button,.aeris-date-picker__nav,.aeris-date-picker__footer button,.aeris-date-picker__choice-grid button{border:0;border-radius:.4375rem;background:transparent;color:inherit;font:inherit;cursor:pointer}.aeris-date-picker__heading button{padding:.35rem .4rem;font-weight:700}.aeris-date-picker__heading button:hover,.aeris-date-picker__nav:hover:not(:disabled),.aeris-date-picker__footer button:hover:not(:disabled),.aeris-date-picker__choice-grid button:hover:not(:disabled){background:var(--aeris-date-picker-hover, color-mix(in srgb, var(--aeris-primary, #879566) 12%, transparent))}.aeris-date-picker__heading button:focus-visible,.aeris-date-picker__nav:focus-visible,.aeris-date-picker__footer button:focus-visible,.aeris-date-picker__choice-grid button:focus-visible{outline:2px solid var(--aeris-focus, #536437);outline-offset:1px}.aeris-date-picker__nav{width:2.25rem;height:2.25rem;display:grid;place-items:center;padding:0}.aeris-date-picker__nav:disabled,.aeris-date-picker__footer button:disabled,.aeris-date-picker__choice-grid button:disabled{opacity:var(--aeris-disabled-opacity, .5);cursor:not-allowed}.aeris-date-picker__nav span{position:relative;width:1rem;height:1rem}.aeris-date-picker__nav span:before{position:absolute;top:50%;left:50%;width:1rem;height:1rem;background:currentColor;content:\"\";transform:translate(-50%,-50%) rotate(90deg);-webkit-mask:var(--_aeris-chevron-mask) center/100% 100% no-repeat;mask:var(--_aeris-chevron-mask) center/100% 100% no-repeat}.aeris-date-picker__nav--next span:before{transform:translate(-50%,-50%) rotate(-90deg)}.aeris-date-picker__months{display:grid;grid-template-columns:repeat(var(--aeris-date-picker-month-count),minmax(15rem,1fr));gap:1rem}.aeris-date-picker__month{min-width:0}.aeris-date-picker__month h3{margin:0 0 .5rem;color:var(--aeris-text, #222222);font-size:.8125rem;text-align:center}.aeris-date-picker__weekdays,.aeris-date-picker__week{display:grid;grid-template-columns:repeat(7,minmax(1.75rem,1fr));gap:.125rem}.aeris-date-picker__weekdays:has(.aeris-date-picker__week-label),.aeris-date-picker__week:has(.aeris-date-picker__week-number){grid-template-columns:1.5rem repeat(7,minmax(1.75rem,1fr))}.aeris-date-picker__weekdays span,.aeris-date-picker__week-number{min-height:1.75rem;display:grid;place-items:center;color:var(--aeris-text-2, #555555);font-size:.6875rem;font-weight:650}.aeris-date-picker__day{position:relative;min-width:2rem;min-height:2rem;display:grid;place-items:center;padding:0;border:0;border-radius:.4375rem;background:transparent;color:var(--aeris-text, #222222);font:inherit;font-size:.8125rem;cursor:pointer}.aeris-date-picker__day:hover:not(:disabled),.aeris-date-picker__day:focus-visible{background:var(--aeris-date-picker-hover, color-mix(in srgb, var(--aeris-primary, #879566) 12%, transparent))}.aeris-date-picker__day:focus-visible{z-index:1;outline:2px solid var(--aeris-focus, #536437);outline-offset:0}.aeris-date-picker__day[data-other-month]{color:var(--aeris-text-2, #555555);opacity:.58}.aeris-date-picker__day[data-in-range]{border-radius:0;background:color-mix(in srgb,var(--aeris-date-picker-selected-background, var(--aeris-primary, #879566)) 16%,transparent)}.aeris-date-picker__day[data-selected],.aeris-date-picker__day[data-range-start],.aeris-date-picker__day[data-range-end]{border-radius:.4375rem;background:var(--aeris-date-picker-selected-background, var(--aeris-primary, #879566));color:var(--aeris-date-picker-selected-text, var(--aeris-on-primary, #ffffff));font-weight:700}.aeris-date-picker__day[data-selected]:hover:not(:disabled),.aeris-date-picker__day[data-selected]:focus-visible,.aeris-date-picker__day[data-range-start]:hover:not(:disabled),.aeris-date-picker__day[data-range-start]:focus-visible,.aeris-date-picker__day[data-range-end]:hover:not(:disabled),.aeris-date-picker__day[data-range-end]:focus-visible{background:var(--aeris-date-picker-selected-hover-background, var(--aeris-primary-hover, var(--aeris-primary, #879566)));color:var(--aeris-date-picker-selected-hover-text, var(--aeris-on-primary-hover, var(--aeris-on-primary, #ffffff)))}.aeris-date-picker__day[data-today]:not([data-selected]):after{position:absolute;bottom:.1875rem;width:.25rem;height:.25rem;border-radius:50%;background:var(--aeris-primary, #879566);content:\"\"}.aeris-date-picker__day:disabled{opacity:var(--aeris-disabled-opacity, .38);cursor:not-allowed}.aeris-date-picker__choice-grid{min-width:15rem;display:grid;grid-template-columns:repeat(3,minmax(4rem,1fr));gap:.25rem}.aeris-date-picker__choice-grid button{min-height:2.75rem;padding:.5rem;font-size:.8125rem}.aeris-date-picker__choice-grid button[data-selected]{background:var(--aeris-date-picker-selected-background, var(--aeris-primary, #879566));color:var(--aeris-date-picker-selected-text, var(--aeris-on-primary, #ffffff));font-weight:700}.aeris-date-picker__choice-grid button[data-selected]:hover:not(:disabled),.aeris-date-picker__choice-grid button[data-selected]:focus-visible{background:var(--aeris-date-picker-selected-hover-background, var(--aeris-primary-hover, var(--aeris-primary, #879566)));color:var(--aeris-date-picker-selected-hover-text, var(--aeris-on-primary-hover, var(--aeris-on-primary, #ffffff)))}.aeris-date-picker__time{min-width:15rem;display:flex;align-items:end;gap:.375rem;margin-top:.75rem;padding-top:.75rem;border-top:1px solid var(--aeris-border, #deddd7)}.aeris-date-picker__time[data-time-only]{margin-top:0;padding-top:0;border-top:0}.aeris-date-picker__time-field{min-width:0;flex:1 1 0;display:grid;gap:.3125rem;color:var(--aeris-text-2, #555555);font-size:.6875rem;font-weight:700}.aeris-date-picker__time-field--period{flex-basis:4.25rem}.aeris-date-picker__time-field input,.aeris-date-picker__time-field select{width:100%;min-height:2.25rem;padding:0 .5rem;border:1px solid var(--aeris-date-picker-border, var(--aeris-border-strong, #c7c9c0));border-radius:var(--aeris-radius-control, var(--aeris-radius-sm, .4375rem));background:var(--aeris-date-picker-background, var(--aeris-surface, #fff));color:var(--aeris-text, #222222);font:inherit;font-size:.8125rem}.aeris-date-picker__time-field input{text-align:center}.aeris-date-picker__time-field input:focus-visible,.aeris-date-picker__time-field select:focus-visible{outline:2px solid var(--aeris-focus, #536437);outline-offset:1px;border-color:var(--aeris-date-picker-focus, var(--aeris-focus, #536437))}.aeris-date-picker__time-field input:disabled,.aeris-date-picker__time-field select:disabled{opacity:var(--aeris-disabled-opacity, .5);cursor:not-allowed}.aeris-date-picker__time-separator{min-height:2.25rem;display:grid;place-items:center;color:var(--aeris-text-2, #555555);font-size:1rem;font-weight:800}.aeris-date-picker__footer{display:flex;justify-content:space-between;gap:.75rem;margin-top:.625rem;padding-top:.625rem;border-top:1px solid var(--aeris-border, #deddd7)}.aeris-date-picker__footer button{min-height:2rem;padding:.375rem .625rem;color:var(--aeris-primary-text, #566137);font-size:.8125rem;font-weight:700}@media(max-width:50rem){.aeris-date-picker__panel{width:min(100%,100vw - 2rem);overflow-x:auto}.aeris-date-picker__months{grid-template-columns:minmax(14rem,1fr)}}@media(prefers-reduced-motion:reduce){.aeris-date-picker__trigger{transition:none}}\n"] });
|
|
1152
|
+
}
|
|
1153
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: AerisDatePicker, decorators: [{
|
|
1154
|
+
type: Component,
|
|
1155
|
+
args: [{ selector: 'aeris-date-picker', template: `
|
|
1156
|
+
<div
|
|
1157
|
+
class="aeris-date-picker"
|
|
1158
|
+
[attr.data-size]="size()"
|
|
1159
|
+
[attr.data-appearance]="appearance()"
|
|
1160
|
+
[attr.data-open]="panelVisible() || null"
|
|
1161
|
+
[attr.data-inline]="inline() || null"
|
|
1162
|
+
[attr.data-invalid]="invalid() || null"
|
|
1163
|
+
[attr.data-disabled]="effectiveDisabled() || null"
|
|
1164
|
+
[attr.data-fluid]="fluid() || null"
|
|
1165
|
+
>
|
|
1166
|
+
@if (name() && serializedValue()) {
|
|
1167
|
+
<input type="hidden" [name]="name()" [value]="serializedValue()" />
|
|
1168
|
+
}
|
|
1169
|
+
|
|
1170
|
+
@if (!inline()) {
|
|
1171
|
+
<div class="aeris-date-picker__control">
|
|
1172
|
+
<button
|
|
1173
|
+
#trigger
|
|
1174
|
+
class="aeris-date-picker__trigger"
|
|
1175
|
+
type="button"
|
|
1176
|
+
role="combobox"
|
|
1177
|
+
aria-haspopup="dialog"
|
|
1178
|
+
[id]="resolvedInputId()"
|
|
1179
|
+
[attr.aria-expanded]="open()"
|
|
1180
|
+
[attr.aria-controls]="panelId"
|
|
1181
|
+
[attr.aria-label]="ariaLabel() || null"
|
|
1182
|
+
[attr.aria-labelledby]="ariaLabelledby() || null"
|
|
1183
|
+
[attr.aria-describedby]="ariaDescribedby() || null"
|
|
1184
|
+
[attr.aria-invalid]="invalid() || null"
|
|
1185
|
+
[attr.aria-required]="required() || null"
|
|
1186
|
+
[disabled]="effectiveDisabled()"
|
|
1187
|
+
(click)="toggle()"
|
|
1188
|
+
(keydown)="handleTriggerKeydown($event)"
|
|
1189
|
+
(focus)="focused.emit($event)"
|
|
1190
|
+
(blur)="handleBlur($event)"
|
|
1191
|
+
>
|
|
1192
|
+
<span
|
|
1193
|
+
class="aeris-date-picker__value"
|
|
1194
|
+
[class.aeris-date-picker__placeholder]="!displayValue()"
|
|
1195
|
+
>{{ displayValue() || placeholder() }}</span>
|
|
1196
|
+
</button>
|
|
1197
|
+
|
|
1198
|
+
@if (showClearButton()) {
|
|
1199
|
+
<button
|
|
1200
|
+
class="aeris-date-picker__clear"
|
|
1201
|
+
type="button"
|
|
1202
|
+
[attr.aria-label]="clearButtonAriaLabel()"
|
|
1203
|
+
(click)="handleClearClick($event)"
|
|
1204
|
+
>
|
|
1205
|
+
<span aria-hidden="true"></span>
|
|
1206
|
+
</button>
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1209
|
+
@if (showIcon()) {
|
|
1210
|
+
<span class="aeris-date-picker__calendar-icon" aria-hidden="true">
|
|
1211
|
+
<span></span>
|
|
1212
|
+
</span>
|
|
1213
|
+
} @else {
|
|
1214
|
+
<span class="aeris-date-picker__chevron" aria-hidden="true"></span>
|
|
1215
|
+
}
|
|
1216
|
+
</div>
|
|
1217
|
+
}
|
|
1218
|
+
|
|
1219
|
+
@if (panelVisible()) {
|
|
1220
|
+
@if (!inline()) {
|
|
1221
|
+
<button
|
|
1222
|
+
class="aeris-date-picker__dismiss"
|
|
1223
|
+
type="button"
|
|
1224
|
+
tabindex="-1"
|
|
1225
|
+
aria-label="Close calendar"
|
|
1226
|
+
(click)="close(true)"
|
|
1227
|
+
></button>
|
|
1228
|
+
}
|
|
1229
|
+
|
|
1230
|
+
<div
|
|
1231
|
+
class="aeris-date-picker__panel"
|
|
1232
|
+
[id]="panelId"
|
|
1233
|
+
role="dialog"
|
|
1234
|
+
aria-modal="false"
|
|
1235
|
+
[attr.aria-label]="panelAriaLabel()"
|
|
1236
|
+
(keydown)="handlePanelKeydown($event)"
|
|
1237
|
+
>
|
|
1238
|
+
@if (!timeOnly()) {
|
|
1239
|
+
<div class="aeris-date-picker__header">
|
|
1240
|
+
<button
|
|
1241
|
+
class="aeris-date-picker__nav aeris-date-picker__nav--previous"
|
|
1242
|
+
type="button"
|
|
1243
|
+
[attr.aria-label]="previousButtonAriaLabel()"
|
|
1244
|
+
[disabled]="previousDisabled()"
|
|
1245
|
+
(click)="navigate(-1)"
|
|
1246
|
+
><span aria-hidden="true"></span></button>
|
|
1247
|
+
|
|
1248
|
+
<div class="aeris-date-picker__heading">
|
|
1249
|
+
@if (panelView() === 'day') {
|
|
1250
|
+
<button type="button" (click)="showMonthView()">
|
|
1251
|
+
{{ visibleMonthLabel() }}
|
|
1252
|
+
</button>
|
|
1253
|
+
<button type="button" (click)="showYearView()">
|
|
1254
|
+
{{ visibleYear() }}
|
|
1255
|
+
</button>
|
|
1256
|
+
} @else if (panelView() === 'month') {
|
|
1257
|
+
<span>{{ visibleYear() }}</span>
|
|
1258
|
+
} @else {
|
|
1259
|
+
<span>{{ yearRangeLabel() }}</span>
|
|
1260
|
+
}
|
|
1261
|
+
</div>
|
|
1262
|
+
|
|
1263
|
+
<button
|
|
1264
|
+
class="aeris-date-picker__nav aeris-date-picker__nav--next"
|
|
1265
|
+
type="button"
|
|
1266
|
+
[attr.aria-label]="nextButtonAriaLabel()"
|
|
1267
|
+
[disabled]="nextDisabled()"
|
|
1268
|
+
(click)="navigate(1)"
|
|
1269
|
+
><span aria-hidden="true"></span></button>
|
|
1270
|
+
</div>
|
|
1271
|
+
|
|
1272
|
+
@if (panelView() === 'day') {
|
|
1273
|
+
<div
|
|
1274
|
+
class="aeris-date-picker__months"
|
|
1275
|
+
[style.--aeris-date-picker-month-count]="visibleMonthCount()"
|
|
1276
|
+
>
|
|
1277
|
+
@for (month of renderedMonths(); track month.key) {
|
|
1278
|
+
<section class="aeris-date-picker__month" [attr.aria-label]="month.label">
|
|
1279
|
+
@if (visibleMonthCount() > 1) {
|
|
1280
|
+
<h3>{{ month.label }}</h3>
|
|
1281
|
+
}
|
|
1282
|
+
<div class="aeris-date-picker__weekdays" aria-hidden="true">
|
|
1283
|
+
@if (showWeekNumbers()) {
|
|
1284
|
+
<span class="aeris-date-picker__week-label">Wk</span>
|
|
1285
|
+
}
|
|
1286
|
+
@for (weekday of weekdays(); track $index) {
|
|
1287
|
+
<span>{{ weekday }}</span>
|
|
1288
|
+
}
|
|
1289
|
+
</div>
|
|
1290
|
+
<div class="aeris-date-picker__calendar" role="grid">
|
|
1291
|
+
@for (week of [0, 1, 2, 3, 4, 5]; track week) {
|
|
1292
|
+
<div class="aeris-date-picker__week" role="row">
|
|
1293
|
+
@if (showWeekNumbers()) {
|
|
1294
|
+
<span class="aeris-date-picker__week-number" role="rowheader">
|
|
1295
|
+
{{ month.weeks[week] }}
|
|
1296
|
+
</span>
|
|
1297
|
+
}
|
|
1298
|
+
@for (
|
|
1299
|
+
day of month.days.slice(week * 7, week * 7 + 7);
|
|
1300
|
+
track day.key
|
|
1301
|
+
) {
|
|
1302
|
+
<button
|
|
1303
|
+
#dayButton
|
|
1304
|
+
class="aeris-date-picker__day"
|
|
1305
|
+
type="button"
|
|
1306
|
+
role="gridcell"
|
|
1307
|
+
[attr.data-date]="day.key"
|
|
1308
|
+
[attr.aria-label]="day.label"
|
|
1309
|
+
[attr.aria-selected]="day.selected"
|
|
1310
|
+
[attr.aria-current]="day.today ? 'date' : null"
|
|
1311
|
+
[attr.data-other-month]="!day.currentMonth || null"
|
|
1312
|
+
[attr.data-selected]="day.selected || null"
|
|
1313
|
+
[attr.data-range-start]="day.rangeStart || null"
|
|
1314
|
+
[attr.data-range-end]="day.rangeEnd || null"
|
|
1315
|
+
[attr.data-in-range]="day.inRange || null"
|
|
1316
|
+
[attr.data-today]="day.today || null"
|
|
1317
|
+
[disabled]="day.disabled"
|
|
1318
|
+
[tabindex]="sameActiveDate(day.date) ? 0 : -1"
|
|
1319
|
+
(click)="selectDay(day, $event)"
|
|
1320
|
+
(focus)="activeDate.set(day.date)"
|
|
1321
|
+
(keydown)="handleDayKeydown($event, day.date)"
|
|
1322
|
+
>{{ day.day }}</button>
|
|
1323
|
+
}
|
|
1324
|
+
</div>
|
|
1325
|
+
}
|
|
1326
|
+
</div>
|
|
1327
|
+
</section>
|
|
1328
|
+
}
|
|
1329
|
+
</div>
|
|
1330
|
+
} @else if (panelView() === 'month') {
|
|
1331
|
+
<div class="aeris-date-picker__choice-grid" role="listbox" aria-label="Choose month">
|
|
1332
|
+
@for (month of monthChoices(); track month.value; let index = $index) {
|
|
1333
|
+
<button
|
|
1334
|
+
#choiceButton
|
|
1335
|
+
type="button"
|
|
1336
|
+
role="option"
|
|
1337
|
+
[attr.aria-selected]="month.selected"
|
|
1338
|
+
[attr.data-selected]="month.selected || null"
|
|
1339
|
+
[disabled]="month.disabled"
|
|
1340
|
+
[tabindex]="choiceIndex() === index ? 0 : -1"
|
|
1341
|
+
(click)="selectMonth(month.value, $event)"
|
|
1342
|
+
(keydown)="handleChoiceKeydown($event, index)"
|
|
1343
|
+
>{{ month.label }}</button>
|
|
1344
|
+
}
|
|
1345
|
+
</div>
|
|
1346
|
+
} @else {
|
|
1347
|
+
<div class="aeris-date-picker__choice-grid" role="listbox" aria-label="Choose year">
|
|
1348
|
+
@for (year of yearChoices(); track year.value; let index = $index) {
|
|
1349
|
+
<button
|
|
1350
|
+
#choiceButton
|
|
1351
|
+
type="button"
|
|
1352
|
+
role="option"
|
|
1353
|
+
[attr.aria-selected]="year.selected"
|
|
1354
|
+
[attr.data-selected]="year.selected || null"
|
|
1355
|
+
[disabled]="year.disabled"
|
|
1356
|
+
[tabindex]="choiceIndex() === index ? 0 : -1"
|
|
1357
|
+
(click)="selectYear(year.value, $event)"
|
|
1358
|
+
(keydown)="handleChoiceKeydown($event, index)"
|
|
1359
|
+
>{{ year.value }}</button>
|
|
1360
|
+
}
|
|
1361
|
+
</div>
|
|
1362
|
+
}
|
|
1363
|
+
}
|
|
1364
|
+
|
|
1365
|
+
@if (showsTimeControls()) {
|
|
1366
|
+
<div
|
|
1367
|
+
class="aeris-date-picker__time"
|
|
1368
|
+
role="group"
|
|
1369
|
+
[attr.aria-label]="timeAriaLabel()"
|
|
1370
|
+
[attr.data-time-only]="timeOnly() || null"
|
|
1371
|
+
>
|
|
1372
|
+
<label class="aeris-date-picker__time-field">
|
|
1373
|
+
<span>{{ hourLabel() }}</span>
|
|
1374
|
+
<input
|
|
1375
|
+
#hourInput
|
|
1376
|
+
type="number"
|
|
1377
|
+
inputmode="numeric"
|
|
1378
|
+
[min]="hourMinimum()"
|
|
1379
|
+
[max]="hourMaximum()"
|
|
1380
|
+
step="1"
|
|
1381
|
+
[value]="timeDisplayParts().hour"
|
|
1382
|
+
[disabled]="effectiveDisabled()"
|
|
1383
|
+
(input)="handleHourInput($event)"
|
|
1384
|
+
/>
|
|
1385
|
+
</label>
|
|
1386
|
+
|
|
1387
|
+
<span class="aeris-date-picker__time-separator" aria-hidden="true">:</span>
|
|
1388
|
+
|
|
1389
|
+
<label class="aeris-date-picker__time-field">
|
|
1390
|
+
<span>{{ minuteLabel() }}</span>
|
|
1391
|
+
<input
|
|
1392
|
+
type="number"
|
|
1393
|
+
inputmode="numeric"
|
|
1394
|
+
min="0"
|
|
1395
|
+
max="59"
|
|
1396
|
+
[step]="normalizedMinuteStep()"
|
|
1397
|
+
[value]="timeDisplayParts().minute"
|
|
1398
|
+
[disabled]="effectiveDisabled()"
|
|
1399
|
+
(input)="handleMinuteInput($event)"
|
|
1400
|
+
/>
|
|
1401
|
+
</label>
|
|
1402
|
+
|
|
1403
|
+
@if (showSeconds()) {
|
|
1404
|
+
<span class="aeris-date-picker__time-separator" aria-hidden="true">:</span>
|
|
1405
|
+
|
|
1406
|
+
<label class="aeris-date-picker__time-field">
|
|
1407
|
+
<span>{{ secondLabel() }}</span>
|
|
1408
|
+
<input
|
|
1409
|
+
type="number"
|
|
1410
|
+
inputmode="numeric"
|
|
1411
|
+
min="0"
|
|
1412
|
+
max="59"
|
|
1413
|
+
[step]="normalizedSecondStep()"
|
|
1414
|
+
[value]="timeDisplayParts().second"
|
|
1415
|
+
[disabled]="effectiveDisabled()"
|
|
1416
|
+
(input)="handleSecondInput($event)"
|
|
1417
|
+
/>
|
|
1418
|
+
</label>
|
|
1419
|
+
}
|
|
1420
|
+
|
|
1421
|
+
@if (hourCycle() === '12') {
|
|
1422
|
+
<label class="aeris-date-picker__time-field aeris-date-picker__time-field--period">
|
|
1423
|
+
<span>{{ periodLabel() }}</span>
|
|
1424
|
+
<select
|
|
1425
|
+
[value]="timePeriod()"
|
|
1426
|
+
[disabled]="effectiveDisabled()"
|
|
1427
|
+
(change)="handlePeriodChange($event)"
|
|
1428
|
+
>
|
|
1429
|
+
<option value="AM">AM</option>
|
|
1430
|
+
<option value="PM">PM</option>
|
|
1431
|
+
</select>
|
|
1432
|
+
</label>
|
|
1433
|
+
}
|
|
1434
|
+
</div>
|
|
1435
|
+
}
|
|
1436
|
+
|
|
1437
|
+
@if (showButtonBar()) {
|
|
1438
|
+
<div class="aeris-date-picker__footer">
|
|
1439
|
+
@if (!timeOnly()) {
|
|
1440
|
+
<button type="button" [disabled]="todayDisabled()" (click)="selectToday($event)">
|
|
1441
|
+
{{ todayLabel() }}
|
|
1442
|
+
</button>
|
|
1443
|
+
}
|
|
1444
|
+
<button type="button" [disabled]="!hasValue()" (click)="clear()">
|
|
1445
|
+
{{ clearLabel() }}
|
|
1446
|
+
</button>
|
|
1447
|
+
</div>
|
|
1448
|
+
}
|
|
1449
|
+
</div>
|
|
1450
|
+
}
|
|
1451
|
+
</div>
|
|
1452
|
+
`, providers: [
|
|
1453
|
+
{
|
|
1454
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1455
|
+
useExisting: forwardRef(() => AerisDatePicker),
|
|
1456
|
+
multi: true,
|
|
1457
|
+
},
|
|
1458
|
+
], host: {
|
|
1459
|
+
'[attr.data-open]': 'open() || null',
|
|
1460
|
+
'[attr.data-inline]': 'inline() || null',
|
|
1461
|
+
'[attr.data-disabled]': 'effectiveDisabled() || null',
|
|
1462
|
+
'[attr.data-fluid]': 'fluid() || null',
|
|
1463
|
+
}, styles: [":host{--_aeris-chevron-mask: var( --aeris-icon-chevron, url(data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%2024%2024%27%3E%3Cpath%20d=%27M7%209.5%2012%2014.5%2017%209.5%27%20fill=%27none%27%20stroke=%27black%27%20stroke-width=%272.4%27%20stroke-linecap=%27round%27%20stroke-linejoin=%27round%27/%3E%3C/svg%3E) );display:inline-block;min-width:13rem;max-width:100%;color:var(--aeris-date-picker-text, var(--aeris-text, #222222));font:inherit}:host([data-fluid]),:host([data-inline]){width:100%}.aeris-date-picker{--aeris-date-picker-height: var(--aeris-control-height, 2.625rem);--aeris-date-picker-font-size: .875rem;--aeris-date-picker-padding: .75rem;position:relative;width:100%}.aeris-date-picker[data-size=xs]{--aeris-date-picker-height: 1.875rem;--aeris-date-picker-font-size: .75rem;--aeris-date-picker-padding: .5625rem}.aeris-date-picker[data-size=sm]{--aeris-date-picker-height: 2.25rem;--aeris-date-picker-font-size: .8125rem;--aeris-date-picker-padding: .6875rem}.aeris-date-picker[data-size=lg]{--aeris-date-picker-height: 3rem;--aeris-date-picker-font-size: .9375rem;--aeris-date-picker-padding: .875rem}.aeris-date-picker__control{position:relative}.aeris-date-picker__trigger{width:100%;min-height:var(--aeris-date-picker-height);display:flex;align-items:center;padding:0 3rem 0 var(--aeris-date-picker-padding);border:1px solid var(--aeris-date-picker-border, var(--aeris-border-strong, #c7c9c0));border-radius:var(--aeris-date-picker-radius, var(--aeris-radius-control, var(--aeris-radius-sm, .4375rem)));background:var(--aeris-date-picker-background, var(--aeris-surface, #fff));color:inherit;font:inherit;font-size:var(--aeris-date-picker-font-size);text-align:left;cursor:pointer;transition:border-color .15s ease,box-shadow .15s ease}.aeris-date-picker__control:has(.aeris-date-picker__clear) .aeris-date-picker__trigger{padding-right:4.625rem}.aeris-date-picker[data-appearance=filled] .aeris-date-picker__trigger{border-color:transparent;background:var(--aeris-date-picker-filled-background, var(--aeris-surface-2, #f2f0ec))}.aeris-date-picker__trigger:hover,.aeris-date-picker[data-open] .aeris-date-picker__trigger{border-color:var(--aeris-date-picker-focus, var(--aeris-focus, #536437))}.aeris-date-picker__trigger:focus-visible{outline:0;border-color:var(--aeris-date-picker-focus, var(--aeris-focus, #536437));box-shadow:0 0 0 3px color-mix(in srgb,var(--aeris-focus, #536437) 22%,transparent)}.aeris-date-picker[data-invalid] .aeris-date-picker__trigger{border-color:var(--aeris-danger, #c81e2a)}.aeris-date-picker[data-disabled] .aeris-date-picker__trigger{opacity:var(--aeris-disabled-opacity, .5);cursor:not-allowed}.aeris-date-picker__value{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.aeris-date-picker__placeholder{color:var(--aeris-date-picker-placeholder, var(--aeris-text-2, #555555))}.aeris-date-picker__clear{position:absolute;z-index:2;top:50%;right:2.25rem;width:1.5rem;height:1.5rem;display:grid;place-items:center;padding:0;border:0;border-radius:.375rem;background:transparent;color:var(--aeris-text-2, #555555);transform:translateY(-50%);cursor:pointer}.aeris-date-picker__clear:hover,.aeris-date-picker__clear:focus-visible{background:var(--aeris-surface-2, #f2f0ec);color:var(--aeris-text, #222222)}.aeris-date-picker__clear:focus-visible{outline:2px solid var(--aeris-focus, #536437);outline-offset:1px}.aeris-date-picker__clear span{width:var(--aeris-icon-size, 1rem);height:var(--aeris-icon-size, 1rem);background:currentColor;-webkit-mask:var(--aeris-icon-close) center/100% 100% no-repeat;mask:var(--aeris-icon-close) center/100% 100% no-repeat}.aeris-date-picker__calendar-icon{position:absolute;top:50%;right:var(--aeris-date-picker-padding);width:1rem;height:1rem;border:1.5px solid currentColor;border-radius:.1875rem;color:var(--aeris-text-2, #555555);transform:translateY(-50%);pointer-events:none}.aeris-date-picker__calendar-icon:before{position:absolute;inset:.1875rem -.09375rem auto;height:1.5px;background:currentColor;content:\"\"}.aeris-date-picker__calendar-icon:after{position:absolute;top:-.25rem;left:.1875rem;width:.5rem;height:.25rem;border-right:1.5px solid currentColor;border-left:1.5px solid currentColor;content:\"\"}.aeris-date-picker__calendar-icon span{position:absolute;right:.1875rem;bottom:.1875rem;width:.1875rem;height:.1875rem;border-radius:50%;background:currentColor;box-shadow:-.3125rem 0 currentColor}.aeris-date-picker__chevron{position:absolute;top:50%;right:var(--aeris-date-picker-padding);width:1rem;height:1rem;color:var(--aeris-text-2, #555555);transform:translateY(-50%);pointer-events:none}.aeris-date-picker__chevron:before{position:absolute;top:50%;left:50%;width:1rem;height:1rem;background:currentColor;content:\"\";transform:translate(-50%,-50%);-webkit-mask:var(--_aeris-chevron-mask) center/100% 100% no-repeat;mask:var(--_aeris-chevron-mask) center/100% 100% no-repeat}.aeris-date-picker__dismiss{position:fixed;z-index:89;inset:0;width:100vw;height:100vh;height:100dvh;padding:0;border:0;background:transparent;cursor:default}.aeris-date-picker__panel{position:absolute;z-index:90;top:calc(100% + .4375rem);left:0;width:max-content;max-width:calc(100vw - 2rem);padding:.75rem;border:1px solid var(--aeris-date-picker-panel-border, var(--aeris-border, #deddd7));border-radius:var(--aeris-date-picker-panel-radius, var(--aeris-radius-md, .6875rem));background:var(--aeris-date-picker-panel-background, var(--aeris-surface, #fff));box-shadow:var(--aeris-date-picker-panel-shadow, 0 1rem 2.5rem rgba(31, 35, 27, .16));scrollbar-color:var(--aeris-border-strong, #c7c9c0) transparent;scrollbar-width:thin}.aeris-date-picker__panel::-webkit-scrollbar{width:.75rem;height:.75rem}.aeris-date-picker__panel::-webkit-scrollbar-track,.aeris-date-picker__panel::-webkit-scrollbar-corner{background:transparent}.aeris-date-picker__panel::-webkit-scrollbar-thumb{border:3px solid transparent;border-radius:var(--aeris-radius-pill, 999px);background:var(--aeris-border-strong, #c7c9c0);background-clip:content-box}.aeris-date-picker[data-inline] .aeris-date-picker__panel{position:relative;z-index:auto;top:auto;width:100%;box-shadow:none}.aeris-date-picker__header{min-height:2.25rem;display:grid;grid-template-columns:2.25rem 1fr 2.25rem;align-items:center;gap:.375rem;margin-bottom:.625rem}.aeris-date-picker__heading{display:flex;align-items:center;justify-content:center;gap:.25rem;color:var(--aeris-text, #222222);font-size:.875rem;font-weight:700}.aeris-date-picker__heading button,.aeris-date-picker__nav,.aeris-date-picker__footer button,.aeris-date-picker__choice-grid button{border:0;border-radius:.4375rem;background:transparent;color:inherit;font:inherit;cursor:pointer}.aeris-date-picker__heading button{padding:.35rem .4rem;font-weight:700}.aeris-date-picker__heading button:hover,.aeris-date-picker__nav:hover:not(:disabled),.aeris-date-picker__footer button:hover:not(:disabled),.aeris-date-picker__choice-grid button:hover:not(:disabled){background:var(--aeris-date-picker-hover, color-mix(in srgb, var(--aeris-primary, #879566) 12%, transparent))}.aeris-date-picker__heading button:focus-visible,.aeris-date-picker__nav:focus-visible,.aeris-date-picker__footer button:focus-visible,.aeris-date-picker__choice-grid button:focus-visible{outline:2px solid var(--aeris-focus, #536437);outline-offset:1px}.aeris-date-picker__nav{width:2.25rem;height:2.25rem;display:grid;place-items:center;padding:0}.aeris-date-picker__nav:disabled,.aeris-date-picker__footer button:disabled,.aeris-date-picker__choice-grid button:disabled{opacity:var(--aeris-disabled-opacity, .5);cursor:not-allowed}.aeris-date-picker__nav span{position:relative;width:1rem;height:1rem}.aeris-date-picker__nav span:before{position:absolute;top:50%;left:50%;width:1rem;height:1rem;background:currentColor;content:\"\";transform:translate(-50%,-50%) rotate(90deg);-webkit-mask:var(--_aeris-chevron-mask) center/100% 100% no-repeat;mask:var(--_aeris-chevron-mask) center/100% 100% no-repeat}.aeris-date-picker__nav--next span:before{transform:translate(-50%,-50%) rotate(-90deg)}.aeris-date-picker__months{display:grid;grid-template-columns:repeat(var(--aeris-date-picker-month-count),minmax(15rem,1fr));gap:1rem}.aeris-date-picker__month{min-width:0}.aeris-date-picker__month h3{margin:0 0 .5rem;color:var(--aeris-text, #222222);font-size:.8125rem;text-align:center}.aeris-date-picker__weekdays,.aeris-date-picker__week{display:grid;grid-template-columns:repeat(7,minmax(1.75rem,1fr));gap:.125rem}.aeris-date-picker__weekdays:has(.aeris-date-picker__week-label),.aeris-date-picker__week:has(.aeris-date-picker__week-number){grid-template-columns:1.5rem repeat(7,minmax(1.75rem,1fr))}.aeris-date-picker__weekdays span,.aeris-date-picker__week-number{min-height:1.75rem;display:grid;place-items:center;color:var(--aeris-text-2, #555555);font-size:.6875rem;font-weight:650}.aeris-date-picker__day{position:relative;min-width:2rem;min-height:2rem;display:grid;place-items:center;padding:0;border:0;border-radius:.4375rem;background:transparent;color:var(--aeris-text, #222222);font:inherit;font-size:.8125rem;cursor:pointer}.aeris-date-picker__day:hover:not(:disabled),.aeris-date-picker__day:focus-visible{background:var(--aeris-date-picker-hover, color-mix(in srgb, var(--aeris-primary, #879566) 12%, transparent))}.aeris-date-picker__day:focus-visible{z-index:1;outline:2px solid var(--aeris-focus, #536437);outline-offset:0}.aeris-date-picker__day[data-other-month]{color:var(--aeris-text-2, #555555);opacity:.58}.aeris-date-picker__day[data-in-range]{border-radius:0;background:color-mix(in srgb,var(--aeris-date-picker-selected-background, var(--aeris-primary, #879566)) 16%,transparent)}.aeris-date-picker__day[data-selected],.aeris-date-picker__day[data-range-start],.aeris-date-picker__day[data-range-end]{border-radius:.4375rem;background:var(--aeris-date-picker-selected-background, var(--aeris-primary, #879566));color:var(--aeris-date-picker-selected-text, var(--aeris-on-primary, #ffffff));font-weight:700}.aeris-date-picker__day[data-selected]:hover:not(:disabled),.aeris-date-picker__day[data-selected]:focus-visible,.aeris-date-picker__day[data-range-start]:hover:not(:disabled),.aeris-date-picker__day[data-range-start]:focus-visible,.aeris-date-picker__day[data-range-end]:hover:not(:disabled),.aeris-date-picker__day[data-range-end]:focus-visible{background:var(--aeris-date-picker-selected-hover-background, var(--aeris-primary-hover, var(--aeris-primary, #879566)));color:var(--aeris-date-picker-selected-hover-text, var(--aeris-on-primary-hover, var(--aeris-on-primary, #ffffff)))}.aeris-date-picker__day[data-today]:not([data-selected]):after{position:absolute;bottom:.1875rem;width:.25rem;height:.25rem;border-radius:50%;background:var(--aeris-primary, #879566);content:\"\"}.aeris-date-picker__day:disabled{opacity:var(--aeris-disabled-opacity, .38);cursor:not-allowed}.aeris-date-picker__choice-grid{min-width:15rem;display:grid;grid-template-columns:repeat(3,minmax(4rem,1fr));gap:.25rem}.aeris-date-picker__choice-grid button{min-height:2.75rem;padding:.5rem;font-size:.8125rem}.aeris-date-picker__choice-grid button[data-selected]{background:var(--aeris-date-picker-selected-background, var(--aeris-primary, #879566));color:var(--aeris-date-picker-selected-text, var(--aeris-on-primary, #ffffff));font-weight:700}.aeris-date-picker__choice-grid button[data-selected]:hover:not(:disabled),.aeris-date-picker__choice-grid button[data-selected]:focus-visible{background:var(--aeris-date-picker-selected-hover-background, var(--aeris-primary-hover, var(--aeris-primary, #879566)));color:var(--aeris-date-picker-selected-hover-text, var(--aeris-on-primary-hover, var(--aeris-on-primary, #ffffff)))}.aeris-date-picker__time{min-width:15rem;display:flex;align-items:end;gap:.375rem;margin-top:.75rem;padding-top:.75rem;border-top:1px solid var(--aeris-border, #deddd7)}.aeris-date-picker__time[data-time-only]{margin-top:0;padding-top:0;border-top:0}.aeris-date-picker__time-field{min-width:0;flex:1 1 0;display:grid;gap:.3125rem;color:var(--aeris-text-2, #555555);font-size:.6875rem;font-weight:700}.aeris-date-picker__time-field--period{flex-basis:4.25rem}.aeris-date-picker__time-field input,.aeris-date-picker__time-field select{width:100%;min-height:2.25rem;padding:0 .5rem;border:1px solid var(--aeris-date-picker-border, var(--aeris-border-strong, #c7c9c0));border-radius:var(--aeris-radius-control, var(--aeris-radius-sm, .4375rem));background:var(--aeris-date-picker-background, var(--aeris-surface, #fff));color:var(--aeris-text, #222222);font:inherit;font-size:.8125rem}.aeris-date-picker__time-field input{text-align:center}.aeris-date-picker__time-field input:focus-visible,.aeris-date-picker__time-field select:focus-visible{outline:2px solid var(--aeris-focus, #536437);outline-offset:1px;border-color:var(--aeris-date-picker-focus, var(--aeris-focus, #536437))}.aeris-date-picker__time-field input:disabled,.aeris-date-picker__time-field select:disabled{opacity:var(--aeris-disabled-opacity, .5);cursor:not-allowed}.aeris-date-picker__time-separator{min-height:2.25rem;display:grid;place-items:center;color:var(--aeris-text-2, #555555);font-size:1rem;font-weight:800}.aeris-date-picker__footer{display:flex;justify-content:space-between;gap:.75rem;margin-top:.625rem;padding-top:.625rem;border-top:1px solid var(--aeris-border, #deddd7)}.aeris-date-picker__footer button{min-height:2rem;padding:.375rem .625rem;color:var(--aeris-primary-text, #566137);font-size:.8125rem;font-weight:700}@media(max-width:50rem){.aeris-date-picker__panel{width:min(100%,100vw - 2rem);overflow-x:auto}.aeris-date-picker__months{grid-template-columns:minmax(14rem,1fr)}}@media(prefers-reduced-motion:reduce){.aeris-date-picker__trigger{transition:none}}\n"] }]
|
|
1464
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], selectionMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectionMode", required: false }] }], view: [{ type: i0.Input, args: [{ isSignal: true, alias: "view", required: false }] }], mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputId", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], ariaLabelledby: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabelledby", required: false }] }], ariaDescribedby: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaDescribedby", required: false }] }], calendarAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "calendarAriaLabel", required: false }] }], timeAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "timeAriaLabel", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], locale: [{ type: i0.Input, args: [{ isSignal: true, alias: "locale", required: false }] }], dateStyle: [{ type: i0.Input, args: [{ isSignal: true, alias: "dateStyle", required: false }] }], hourCycle: [{ type: i0.Input, args: [{ isSignal: true, alias: "hourCycle", required: false }] }], showSeconds: [{ type: i0.Input, args: [{ isSignal: true, alias: "showSeconds", required: false }] }], minuteStep: [{ type: i0.Input, args: [{ isSignal: true, alias: "minuteStep", required: false }] }], secondStep: [{ type: i0.Input, args: [{ isSignal: true, alias: "secondStep", required: false }] }], firstDayOfWeek: [{ type: i0.Input, args: [{ isSignal: true, alias: "firstDayOfWeek", required: false }] }], minDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "minDate", required: false }] }], maxDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxDate", required: false }] }], disabledDates: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabledDates", required: false }] }], disabledDays: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabledDays", required: false }] }], dateDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "dateDisabled", required: false }] }], numberOfMonths: [{ type: i0.Input, args: [{ isSignal: true, alias: "numberOfMonths", required: false }] }], showOtherMonths: [{ type: i0.Input, args: [{ isSignal: true, alias: "showOtherMonths", required: false }] }], selectOtherMonths: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectOtherMonths", required: false }] }], showWeekNumbers: [{ type: i0.Input, args: [{ isSignal: true, alias: "showWeekNumbers", required: false }] }], showButtonBar: [{ type: i0.Input, args: [{ isSignal: true, alias: "showButtonBar", required: false }] }], showIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "showIcon", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], inline: [{ type: i0.Input, args: [{ isSignal: true, alias: "inline", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], fluid: [{ type: i0.Input, args: [{ isSignal: true, alias: "fluid", required: false }] }], closeOnSelect: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnSelect", required: false }] }], todayLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "todayLabel", required: false }] }], clearLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearLabel", required: false }] }], hourLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "hourLabel", required: false }] }], minuteLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "minuteLabel", required: false }] }], secondLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "secondLabel", required: false }] }], periodLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "periodLabel", required: false }] }], clearButtonAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearButtonAriaLabel", required: false }] }], previousButtonAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "previousButtonAriaLabel", required: false }] }], nextButtonAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "nextButtonAriaLabel", required: false }] }], valueInput: [{ type: i0.Output, args: ["valueInput"] }], changed: [{ type: i0.Output, args: ["changed"] }], opened: [{ type: i0.Output, args: ["opened"] }], closed: [{ type: i0.Output, args: ["closed"] }], cleared: [{ type: i0.Output, args: ["cleared"] }], monthChanged: [{ type: i0.Output, args: ["monthChanged"] }], focused: [{ type: i0.Output, args: ["focused"] }], blurred: [{ type: i0.Output, args: ["blurred"] }], touch: [{ type: i0.Output, args: ["touch"] }], trigger: [{ type: i0.ViewChild, args: ['trigger', { isSignal: true }] }], hourInput: [{ type: i0.ViewChild, args: ['hourInput', { isSignal: true }] }], dayButtons: [{ type: i0.ViewChildren, args: ['dayButton', { isSignal: true }] }], choiceButtons: [{ type: i0.ViewChildren, args: ['choiceButton', { isSignal: true }] }] } });
|
|
1465
|
+
|
|
1466
|
+
/**
|
|
1467
|
+
* Generated bundle index. Do not edit.
|
|
1468
|
+
*/
|
|
1469
|
+
|
|
1470
|
+
export { AerisDatePicker };
|
|
1471
|
+
//# sourceMappingURL=aeris-ui-core-date-picker.mjs.map
|