@fragiola/primitives-angular 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +67 -0
- package/LICENSE +21 -0
- package/README.md +54 -2
- package/fesm2022/fragiola-primitives-angular-accordion.mjs +567 -0
- package/fesm2022/fragiola-primitives-angular-accordion.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-alert-dialog.mjs +562 -0
- package/fesm2022/fragiola-primitives-angular-alert-dialog.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-aspect-ratio.mjs +79 -0
- package/fesm2022/fragiola-primitives-angular-aspect-ratio.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-async-list.mjs +44 -0
- package/fesm2022/fragiola-primitives-angular-async-list.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-autocomplete-virtual.mjs +243 -0
- package/fesm2022/fragiola-primitives-angular-autocomplete-virtual.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-autocomplete.mjs +1751 -0
- package/fesm2022/fragiola-primitives-angular-autocomplete.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-avatar.mjs +308 -0
- package/fesm2022/fragiola-primitives-angular-avatar.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-breadcrumbs.mjs +355 -0
- package/fesm2022/fragiola-primitives-angular-breadcrumbs.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-button.mjs +156 -0
- package/fesm2022/fragiola-primitives-angular-button.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-calendar-preset.mjs +126 -0
- package/fesm2022/fragiola-primitives-angular-calendar-preset.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-calendar-view.mjs +289 -0
- package/fesm2022/fragiola-primitives-angular-calendar-view.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-calendar.mjs +1222 -0
- package/fesm2022/fragiola-primitives-angular-calendar.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-carousel.mjs +1031 -0
- package/fesm2022/fragiola-primitives-angular-carousel.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-cascade-select.mjs +1391 -0
- package/fesm2022/fragiola-primitives-angular-cascade-select.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-checkbox-group.mjs +221 -0
- package/fesm2022/fragiola-primitives-angular-checkbox-group.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-checkbox.mjs +474 -0
- package/fesm2022/fragiola-primitives-angular-checkbox.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-clipboard.mjs +389 -0
- package/fesm2022/fragiola-primitives-angular-clipboard.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-collapsible.mjs +314 -0
- package/fesm2022/fragiola-primitives-angular-collapsible.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-color-area.mjs +609 -0
- package/fesm2022/fragiola-primitives-angular-color-area.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-color-field.mjs +675 -0
- package/fesm2022/fragiola-primitives-angular-color-field.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-color-picker-popover.mjs +572 -0
- package/fesm2022/fragiola-primitives-angular-color-picker-popover.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-color-picker.mjs +528 -0
- package/fesm2022/fragiola-primitives-angular-color-picker.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-color-slider.mjs +868 -0
- package/fesm2022/fragiola-primitives-angular-color-slider.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-color-swatch-picker.mjs +503 -0
- package/fesm2022/fragiola-primitives-angular-color-swatch-picker.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-color-swatch.mjs +141 -0
- package/fesm2022/fragiola-primitives-angular-color-swatch.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-color-wheel.mjs +554 -0
- package/fesm2022/fragiola-primitives-angular-color-wheel.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-combobox-virtual.mjs +247 -0
- package/fesm2022/fragiola-primitives-angular-combobox-virtual.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-combobox.mjs +2083 -0
- package/fesm2022/fragiola-primitives-angular-combobox.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-command-virtual.mjs +263 -0
- package/fesm2022/fragiola-primitives-angular-command-virtual.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-command.mjs +977 -0
- package/fesm2022/fragiola-primitives-angular-command.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-context-menu.mjs +1012 -0
- package/fesm2022/fragiola-primitives-angular-context-menu.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-date-field.mjs +1030 -0
- package/fesm2022/fragiola-primitives-angular-date-field.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-date-picker-input.mjs +511 -0
- package/fesm2022/fragiola-primitives-angular-date-picker-input.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-date-picker.mjs +991 -0
- package/fesm2022/fragiola-primitives-angular-date-picker.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-date-range-field.mjs +847 -0
- package/fesm2022/fragiola-primitives-angular-date-range-field.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-date-range-picker-input.mjs +260 -0
- package/fesm2022/fragiola-primitives-angular-date-range-picker-input.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-date-range-picker.mjs +128 -0
- package/fesm2022/fragiola-primitives-angular-date-range-picker.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-dialog.mjs +1076 -0
- package/fesm2022/fragiola-primitives-angular-dialog.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-direction.mjs +82 -0
- package/fesm2022/fragiola-primitives-angular-direction.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-drawer.mjs +890 -0
- package/fesm2022/fragiola-primitives-angular-drawer.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-drop-zone.mjs +189 -0
- package/fesm2022/fragiola-primitives-angular-drop-zone.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-editable.mjs +955 -0
- package/fesm2022/fragiola-primitives-angular-editable.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-field.mjs +929 -0
- package/fesm2022/fragiola-primitives-angular-field.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-fieldset.mjs +164 -0
- package/fesm2022/fragiola-primitives-angular-fieldset.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-file-upload.mjs +1370 -0
- package/fesm2022/fragiola-primitives-angular-file-upload.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-form.mjs +162 -0
- package/fesm2022/fragiola-primitives-angular-form.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-hover-card.mjs +906 -0
- package/fesm2022/fragiola-primitives-angular-hover-card.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-internal.mjs +980 -0
- package/fesm2022/fragiola-primitives-angular-internal.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-label.mjs +65 -0
- package/fesm2022/fragiola-primitives-angular-label.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-link.mjs +109 -0
- package/fesm2022/fragiola-primitives-angular-link.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-listbox-virtual.mjs +657 -0
- package/fesm2022/fragiola-primitives-angular-listbox-virtual.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-listbox.mjs +851 -0
- package/fesm2022/fragiola-primitives-angular-listbox.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-menu.mjs +2258 -0
- package/fesm2022/fragiola-primitives-angular-menu.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-menubar.mjs +303 -0
- package/fesm2022/fragiola-primitives-angular-menubar.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-meter.mjs +410 -0
- package/fesm2022/fragiola-primitives-angular-meter.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-month-calendar.mjs +1066 -0
- package/fesm2022/fragiola-primitives-angular-month-calendar.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-month-picker.mjs +514 -0
- package/fesm2022/fragiola-primitives-angular-month-picker.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-month-range-calendar.mjs +163 -0
- package/fesm2022/fragiola-primitives-angular-month-range-calendar.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-month-range-picker.mjs +177 -0
- package/fesm2022/fragiola-primitives-angular-month-range-picker.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-multiple-calendar.mjs +216 -0
- package/fesm2022/fragiola-primitives-angular-multiple-calendar.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-navigation-menu.mjs +1413 -0
- package/fesm2022/fragiola-primitives-angular-navigation-menu.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-number-field.mjs +1210 -0
- package/fesm2022/fragiola-primitives-angular-number-field.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-otp-field.mjs +751 -0
- package/fesm2022/fragiola-primitives-angular-otp-field.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-pagination.mjs +758 -0
- package/fesm2022/fragiola-primitives-angular-pagination.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-password-input.mjs +542 -0
- package/fesm2022/fragiola-primitives-angular-password-input.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-popover.mjs +1011 -0
- package/fesm2022/fragiola-primitives-angular-popover.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-progress.mjs +472 -0
- package/fesm2022/fragiola-primitives-angular-progress.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-radio-group.mjs +321 -0
- package/fesm2022/fragiola-primitives-angular-radio-group.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-radio.mjs +273 -0
- package/fesm2022/fragiola-primitives-angular-radio.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-range-calendar.mjs +108 -0
- package/fesm2022/fragiola-primitives-angular-range-calendar.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-rating.mjs +643 -0
- package/fesm2022/fragiola-primitives-angular-rating.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-render.mjs +1 -0
- package/fesm2022/fragiola-primitives-angular-scroll-area.mjs +553 -0
- package/fesm2022/fragiola-primitives-angular-scroll-area.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-search-field.mjs +487 -0
- package/fesm2022/fragiola-primitives-angular-search-field.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-segmented-control.mjs +762 -0
- package/fesm2022/fragiola-primitives-angular-segmented-control.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-select-virtual.mjs +246 -0
- package/fesm2022/fragiola-primitives-angular-select-virtual.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-select.mjs +1433 -0
- package/fesm2022/fragiola-primitives-angular-select.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-separator.mjs +102 -0
- package/fesm2022/fragiola-primitives-angular-separator.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-slider.mjs +1090 -0
- package/fesm2022/fragiola-primitives-angular-slider.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-steps.mjs +819 -0
- package/fesm2022/fragiola-primitives-angular-steps.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-switch.mjs +422 -0
- package/fesm2022/fragiola-primitives-angular-switch.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-tabs.mjs +726 -0
- package/fesm2022/fragiola-primitives-angular-tabs.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-tag-group.mjs +768 -0
- package/fesm2022/fragiola-primitives-angular-tag-group.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-tags-input.mjs +1126 -0
- package/fesm2022/fragiola-primitives-angular-tags-input.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-time-field.mjs +187 -0
- package/fesm2022/fragiola-primitives-angular-time-field.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-time-range-field.mjs +188 -0
- package/fesm2022/fragiola-primitives-angular-time-range-field.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-toast.mjs +744 -0
- package/fesm2022/fragiola-primitives-angular-toast.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-toggle-group.mjs +245 -0
- package/fesm2022/fragiola-primitives-angular-toggle-group.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-toggle.mjs +229 -0
- package/fesm2022/fragiola-primitives-angular-toggle.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-toolbar.mjs +623 -0
- package/fesm2022/fragiola-primitives-angular-toolbar.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-tooltip.mjs +975 -0
- package/fesm2022/fragiola-primitives-angular-tooltip.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-year-calendar.mjs +163 -0
- package/fesm2022/fragiola-primitives-angular-year-calendar.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-year-picker.mjs +177 -0
- package/fesm2022/fragiola-primitives-angular-year-picker.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-year-range-calendar.mjs +163 -0
- package/fesm2022/fragiola-primitives-angular-year-range-calendar.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular-year-range-picker.mjs +177 -0
- package/fesm2022/fragiola-primitives-angular-year-range-picker.mjs.map +1 -0
- package/fesm2022/fragiola-primitives-angular.mjs +94 -0
- package/package.json +437 -3
- package/types/fragiola-primitives-angular-accordion.d.ts +154 -0
- package/types/fragiola-primitives-angular-alert-dialog.d.ts +176 -0
- package/types/fragiola-primitives-angular-aspect-ratio.d.ts +25 -0
- package/types/fragiola-primitives-angular-async-list.d.ts +32 -0
- package/types/fragiola-primitives-angular-autocomplete-virtual.d.ts +82 -0
- package/types/fragiola-primitives-angular-autocomplete.d.ts +496 -0
- package/types/fragiola-primitives-angular-avatar.d.ts +94 -0
- package/types/fragiola-primitives-angular-breadcrumbs.d.ts +62 -0
- package/types/fragiola-primitives-angular-button.d.ts +66 -0
- package/types/fragiola-primitives-angular-calendar-preset.d.ts +35 -0
- package/types/fragiola-primitives-angular-calendar-view.d.ts +80 -0
- package/types/fragiola-primitives-angular-calendar.d.ts +414 -0
- package/types/fragiola-primitives-angular-carousel.d.ts +300 -0
- package/types/fragiola-primitives-angular-cascade-select.d.ts +404 -0
- package/types/fragiola-primitives-angular-checkbox-group.d.ts +74 -0
- package/types/fragiola-primitives-angular-checkbox.d.ts +111 -0
- package/types/fragiola-primitives-angular-clipboard.d.ts +106 -0
- package/types/fragiola-primitives-angular-collapsible.d.ts +88 -0
- package/types/fragiola-primitives-angular-color-area.d.ts +174 -0
- package/types/fragiola-primitives-angular-color-field.d.ts +174 -0
- package/types/fragiola-primitives-angular-color-picker-popover.d.ts +180 -0
- package/types/fragiola-primitives-angular-color-picker.d.ts +137 -0
- package/types/fragiola-primitives-angular-color-slider.d.ts +228 -0
- package/types/fragiola-primitives-angular-color-swatch-picker.d.ts +146 -0
- package/types/fragiola-primitives-angular-color-swatch.d.ts +43 -0
- package/types/fragiola-primitives-angular-color-wheel.d.ts +144 -0
- package/types/fragiola-primitives-angular-combobox-virtual.d.ts +84 -0
- package/types/fragiola-primitives-angular-combobox.d.ts +582 -0
- package/types/fragiola-primitives-angular-command-virtual.d.ts +93 -0
- package/types/fragiola-primitives-angular-command.d.ts +283 -0
- package/types/fragiola-primitives-angular-context-menu.d.ts +278 -0
- package/types/fragiola-primitives-angular-date-field.d.ts +486 -0
- package/types/fragiola-primitives-angular-date-picker-input.d.ts +139 -0
- package/types/fragiola-primitives-angular-date-picker.d.ts +331 -0
- package/types/fragiola-primitives-angular-date-range-field.d.ts +333 -0
- package/types/fragiola-primitives-angular-date-range-picker-input.d.ts +89 -0
- package/types/fragiola-primitives-angular-date-range-picker.d.ts +35 -0
- package/types/fragiola-primitives-angular-dialog.d.ts +359 -0
- package/types/fragiola-primitives-angular-direction.d.ts +31 -0
- package/types/fragiola-primitives-angular-drawer.d.ts +242 -0
- package/types/fragiola-primitives-angular-drop-zone.d.ts +68 -0
- package/types/fragiola-primitives-angular-editable.d.ts +219 -0
- package/types/fragiola-primitives-angular-field.d.ts +397 -0
- package/types/fragiola-primitives-angular-fieldset.d.ts +47 -0
- package/types/fragiola-primitives-angular-file-upload.d.ts +351 -0
- package/types/fragiola-primitives-angular-form.d.ts +44 -0
- package/types/fragiola-primitives-angular-hover-card.d.ts +279 -0
- package/types/fragiola-primitives-angular-internal.d.ts +695 -0
- package/types/fragiola-primitives-angular-label.d.ts +14 -0
- package/types/fragiola-primitives-angular-link.d.ts +33 -0
- package/types/fragiola-primitives-angular-listbox-virtual.d.ts +193 -0
- package/types/fragiola-primitives-angular-listbox.d.ts +237 -0
- package/types/fragiola-primitives-angular-menu.d.ts +758 -0
- package/types/fragiola-primitives-angular-menubar.d.ts +76 -0
- package/types/fragiola-primitives-angular-meter.d.ts +117 -0
- package/types/fragiola-primitives-angular-month-calendar.d.ts +380 -0
- package/types/fragiola-primitives-angular-month-picker.d.ts +183 -0
- package/types/fragiola-primitives-angular-month-range-calendar.d.ts +54 -0
- package/types/fragiola-primitives-angular-month-range-picker.d.ts +56 -0
- package/types/fragiola-primitives-angular-multiple-calendar.d.ts +73 -0
- package/types/fragiola-primitives-angular-navigation-menu.d.ts +355 -0
- package/types/fragiola-primitives-angular-number-field.d.ts +305 -0
- package/types/fragiola-primitives-angular-otp-field.d.ts +210 -0
- package/types/fragiola-primitives-angular-pagination.d.ts +239 -0
- package/types/fragiola-primitives-angular-password-input.d.ts +149 -0
- package/types/fragiola-primitives-angular-popover.d.ts +303 -0
- package/types/fragiola-primitives-angular-progress.d.ts +126 -0
- package/types/fragiola-primitives-angular-radio-group.d.ts +123 -0
- package/types/fragiola-primitives-angular-radio.d.ts +67 -0
- package/types/fragiola-primitives-angular-range-calendar.d.ts +33 -0
- package/types/fragiola-primitives-angular-rating.d.ts +195 -0
- package/types/fragiola-primitives-angular-render.d.ts +2 -0
- package/types/fragiola-primitives-angular-scroll-area.d.ts +134 -0
- package/types/fragiola-primitives-angular-search-field.d.ts +129 -0
- package/types/fragiola-primitives-angular-segmented-control.d.ts +232 -0
- package/types/fragiola-primitives-angular-select-virtual.d.ts +81 -0
- package/types/fragiola-primitives-angular-select.d.ts +403 -0
- package/types/fragiola-primitives-angular-separator.d.ts +32 -0
- package/types/fragiola-primitives-angular-slider.d.ts +297 -0
- package/types/fragiola-primitives-angular-steps.d.ts +194 -0
- package/types/fragiola-primitives-angular-switch.d.ts +102 -0
- package/types/fragiola-primitives-angular-tabs.d.ts +215 -0
- package/types/fragiola-primitives-angular-tag-group.d.ts +232 -0
- package/types/fragiola-primitives-angular-tags-input.d.ts +318 -0
- package/types/fragiola-primitives-angular-time-field.d.ts +63 -0
- package/types/fragiola-primitives-angular-time-range-field.d.ts +65 -0
- package/types/fragiola-primitives-angular-toast.d.ts +196 -0
- package/types/fragiola-primitives-angular-toggle-group.d.ts +89 -0
- package/types/fragiola-primitives-angular-toggle.d.ts +86 -0
- package/types/fragiola-primitives-angular-toolbar.d.ts +187 -0
- package/types/fragiola-primitives-angular-tooltip.d.ts +330 -0
- package/types/fragiola-primitives-angular-year-calendar.d.ts +54 -0
- package/types/fragiola-primitives-angular-year-picker.d.ts +56 -0
- package/types/fragiola-primitives-angular-year-range-calendar.d.ts +54 -0
- package/types/fragiola-primitives-angular-year-range-picker.d.ts +56 -0
- package/types/fragiola-primitives-angular.d.ts +94 -0
|
@@ -0,0 +1,1030 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { DOCUMENT, DestroyRef, Directive, InjectionToken, PLATFORM_ID, afterNextRender, afterRenderEffect, booleanAttribute, computed, effect, forwardRef, inject, input, output, signal, untracked } from "@angular/core";
|
|
3
|
+
import { fieldControl, writeFieldAria } from "@fragiola/primitives-angular/field";
|
|
4
|
+
import { controllable, createHiddenInput, dataValues, injectFlush, injectHost, injectId, ownAttribute, registerHost, setInputAttribute } from "@fragiola/primitives-angular/internal";
|
|
5
|
+
import { toIsoDate, today, watchDocumentLanguage } from "@fragiola/primitives/date";
|
|
6
|
+
import { bridgeForm } from "@fragiola/primitives/form";
|
|
7
|
+
import { dateSegments, focusOnLabelPress, isSegmentsComplete, segmentFormat, segmentKeyDown, segmentTarget, segmentValuesOf, segmentsToDate, segmentsToDateTime, segmentsToTime, typeSegment } from "@fragiola/primitives/segments";
|
|
8
|
+
import { compareDateTimes, compareTimes, toIsoDateTime, toIsoTime } from "@fragiola/primitives/time";
|
|
9
|
+
function documentLocale(doc, browser) {
|
|
10
|
+
if (doc.documentElement.lang) return doc.documentElement.lang;
|
|
11
|
+
return browser && typeof navigator !== "undefined" ? navigator.language : "en-US";
|
|
12
|
+
}
|
|
13
|
+
function isoOf(kind, granularity, value, timeZone) {
|
|
14
|
+
if (value == null) return "";
|
|
15
|
+
const precision = granularity === "second" ? "second" : "minute";
|
|
16
|
+
if (timeZone && "offset" in value) return timeZone.toIso(value, precision);
|
|
17
|
+
if (kind === "time") return toIsoTime(value, precision);
|
|
18
|
+
if (granularity === "day") return toIsoDate(value);
|
|
19
|
+
const { hour = 0, minute = 0, second = 0, millisecond = 0 } = value;
|
|
20
|
+
return toIsoDateTime({
|
|
21
|
+
...value,
|
|
22
|
+
hour,
|
|
23
|
+
minute,
|
|
24
|
+
second,
|
|
25
|
+
millisecond
|
|
26
|
+
}, precision);
|
|
27
|
+
}
|
|
28
|
+
function compareValues(kind, a, b) {
|
|
29
|
+
return kind === "time" ? compareTimes(a, b) : compareDateTimes(a, b);
|
|
30
|
+
}
|
|
31
|
+
function isOutOfRange(kind, value, min, max, isDateUnavailable) {
|
|
32
|
+
return min != null && compareValues(kind, value, min) < 0 || max != null && compareValues(kind, value, max) > 0 || kind === "date" && isDateUnavailable?.(value) === true;
|
|
33
|
+
}
|
|
34
|
+
function composeSegments(format, kind, granularity, values) {
|
|
35
|
+
return !isSegmentsComplete(format, values) ? null : kind === "time" ? segmentsToTime(values) : granularity === "day" ? segmentsToDate(values, format) : segmentsToDateTime(values, format);
|
|
36
|
+
}
|
|
37
|
+
function boundIso(kind, granularity, edge) {
|
|
38
|
+
return edge == null ? null : isoOf(kind, granularity, edge);
|
|
39
|
+
}
|
|
40
|
+
function editReason(edit, value) {
|
|
41
|
+
return edit === "step" ? "keyboard" : edit === "erase" && value === null ? "input-clear" : "input-change";
|
|
42
|
+
}
|
|
43
|
+
const FIRST_SEGMENT = "[role=\"spinbutton\"][tabindex]";
|
|
44
|
+
var SegmentGroup = class {
|
|
45
|
+
constructor(owner, source) {
|
|
46
|
+
this.owner = owner;
|
|
47
|
+
this.source = source;
|
|
48
|
+
this.ownValues = signal(null, ...ngDevMode ? [{ debugName: "ownValues" }] : /* istanbul ignore next */ []);
|
|
49
|
+
this.values = computed(() => this.ownValues() ?? segmentValuesOf(this.owner.format(), this.source()), ...ngDevMode ? [{ debugName: "values" }] : /* istanbul ignore next */ []);
|
|
50
|
+
this.edit = signal(null, ...ngDevMode ? [{ debugName: "edit" }] : /* istanbul ignore next */ []);
|
|
51
|
+
this.segments = computed(() => dateSegments(this.owner.format(), this.values(), this.edit()), ...ngDevMode ? [{ debugName: "segments" }] : /* istanbul ignore next */ []);
|
|
52
|
+
this.composed = computed(() => composeSegments(this.owner.format(), this.owner.kind, this.owner.granularity(), this.values()), ...ngDevMode ? [{ debugName: "composed" }] : /* istanbul ignore next */ []);
|
|
53
|
+
this.inputElement = signal(null, ...ngDevMode ? [{ debugName: "inputElement" }] : /* istanbul ignore next */ []);
|
|
54
|
+
this.state = owner.state;
|
|
55
|
+
this.data = owner.data;
|
|
56
|
+
this.disabled = owner.disabled;
|
|
57
|
+
this.readOnly = owner.readOnly;
|
|
58
|
+
this.required = owner.required;
|
|
59
|
+
this.invalid = owner.invalid;
|
|
60
|
+
this.field = owner.field;
|
|
61
|
+
this.labelledBy = owner.labelledBy;
|
|
62
|
+
}
|
|
63
|
+
part(name) {
|
|
64
|
+
return name === "input" && this.owner.inputPart !== void 0 ? this.owner.inputPart : `${this.owner.component}-${name}`;
|
|
65
|
+
}
|
|
66
|
+
complete() {
|
|
67
|
+
return isSegmentsComplete(untracked(this.owner.format), untracked(this.values));
|
|
68
|
+
}
|
|
69
|
+
replace(value) {
|
|
70
|
+
this.ownValues.set(segmentValuesOf(untracked(this.owner.format), value));
|
|
71
|
+
this.edit.set(null);
|
|
72
|
+
}
|
|
73
|
+
firstSegment() {
|
|
74
|
+
return untracked(this.inputElement)?.querySelector(FIRST_SEGMENT) ?? null;
|
|
75
|
+
}
|
|
76
|
+
segmentKey(segment, event, element) {
|
|
77
|
+
if (!segment.editable || untracked(this.owner.disabled) || event.altKey || event.ctrlKey || event.metaKey) return false;
|
|
78
|
+
const result = segmentKeyDown(untracked(this.owner.format), untracked(this.values), segment.type, event.key, untracked(this.edit), {
|
|
79
|
+
seed: untracked(this.owner.seed),
|
|
80
|
+
readOnly: !this.editable()
|
|
81
|
+
});
|
|
82
|
+
if (result === null) return false;
|
|
83
|
+
if (result.kind !== "move") this.apply(result.values, result.edit, result.kind === "step" ? "step" : "erase", event);
|
|
84
|
+
if (result.move !== null) this.move(element, result.move);
|
|
85
|
+
return true;
|
|
86
|
+
}
|
|
87
|
+
segmentText(segment, text, event, element) {
|
|
88
|
+
if (!segment.editable || !this.editable()) return;
|
|
89
|
+
const format = untracked(this.owner.format);
|
|
90
|
+
const seed = untracked(this.owner.seed);
|
|
91
|
+
const before = untracked(this.values);
|
|
92
|
+
const typingBefore = untracked(this.edit);
|
|
93
|
+
let next = before;
|
|
94
|
+
let typing = typingBefore;
|
|
95
|
+
let advance = false;
|
|
96
|
+
for (const character of text) {
|
|
97
|
+
const result = typeSegment(format, next, segment.type, character, typing, seed);
|
|
98
|
+
if (result === null) continue;
|
|
99
|
+
next = result.values;
|
|
100
|
+
typing = result.edit;
|
|
101
|
+
advance = result.advance;
|
|
102
|
+
}
|
|
103
|
+
if (next === before && typing === typingBefore) return;
|
|
104
|
+
this.apply(next, typing, "type", event);
|
|
105
|
+
if (advance) this.move(element, "next");
|
|
106
|
+
}
|
|
107
|
+
segmentBlur(segment, event) {
|
|
108
|
+
const typing = untracked(this.edit);
|
|
109
|
+
if (typing !== null && typing.type === segment.type) this.edit.set(null);
|
|
110
|
+
const own = event.currentTarget?.closest("[role=\"group\"]");
|
|
111
|
+
const groups = this.owner.groups?.() ?? (own == null ? [] : [own]);
|
|
112
|
+
const to = event.relatedTarget;
|
|
113
|
+
if (to === null || !groups.some((group) => group.contains(to))) this.owner.onBlur();
|
|
114
|
+
}
|
|
115
|
+
editable() {
|
|
116
|
+
return !untracked(this.owner.disabled) && !untracked(this.owner.readOnly);
|
|
117
|
+
}
|
|
118
|
+
move(element, move) {
|
|
119
|
+
segmentTarget(element, move, this.owner.groups?.())?.focus();
|
|
120
|
+
}
|
|
121
|
+
apply(next, nextEdit, edit, event) {
|
|
122
|
+
this.ownValues.set(next);
|
|
123
|
+
this.edit.set(nextEdit);
|
|
124
|
+
this.owner.onEdit(untracked(this.composed), edit, event);
|
|
125
|
+
this.owner.flush();
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
function stateData(state, field) {
|
|
129
|
+
return computed(() => {
|
|
130
|
+
const current = state();
|
|
131
|
+
const own = dataValues({
|
|
132
|
+
disabled: current.disabled,
|
|
133
|
+
readonly: current.readOnly,
|
|
134
|
+
required: current.required,
|
|
135
|
+
invalid: current.invalid
|
|
136
|
+
});
|
|
137
|
+
const fieldData = field.data();
|
|
138
|
+
return {
|
|
139
|
+
...own,
|
|
140
|
+
valid: fieldData.valid,
|
|
141
|
+
dirty: fieldData.dirty,
|
|
142
|
+
touched: fieldData.touched,
|
|
143
|
+
filled: fieldData.filled,
|
|
144
|
+
focused: fieldData.focused
|
|
145
|
+
};
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
function systemFormat(system) {
|
|
149
|
+
return system === void 0 ? {} : {
|
|
150
|
+
calendar: system.calendar(),
|
|
151
|
+
timeZone: system.timeZone(),
|
|
152
|
+
hideTimeZone: system.hideTimeZone(),
|
|
153
|
+
disambiguation: system.disambiguation()
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
function hiddenType(kind, granularity, timeZone) {
|
|
157
|
+
return timeZone ? "text" : kind === "time" ? "time" : granularity === "day" ? "date" : "datetime-local";
|
|
158
|
+
}
|
|
159
|
+
const DATE_FIELD = new InjectionToken("DATE_FIELD");
|
|
160
|
+
var DateFieldRootState = class {
|
|
161
|
+
constructor(component, kind, inputs, emit, anchor) {
|
|
162
|
+
this.component = component;
|
|
163
|
+
this.kind = kind;
|
|
164
|
+
this.inputs = inputs;
|
|
165
|
+
this.emit = emit;
|
|
166
|
+
this.flush = injectFlush();
|
|
167
|
+
this.document = inject(DOCUMENT);
|
|
168
|
+
this.browser = inject(PLATFORM_ID) === "browser";
|
|
169
|
+
this.language = signal(0, ...ngDevMode ? [{ debugName: "language" }] : /* istanbul ignore next */ []);
|
|
170
|
+
this.own = controllable(this.inputs.value, this.inputs.valueChange, () => this.inputs.defaultValue(), (value, details) => this.emit(value, details));
|
|
171
|
+
this.value = this.own.value;
|
|
172
|
+
this.locale = computed(() => {
|
|
173
|
+
const own = this.inputs.locale();
|
|
174
|
+
if (own !== void 0) return own;
|
|
175
|
+
this.language();
|
|
176
|
+
return documentLocale(this.document, this.browser);
|
|
177
|
+
}, ...ngDevMode ? [{ debugName: "locale" }] : /* istanbul ignore next */ []);
|
|
178
|
+
this.format = computed(() => segmentFormat({
|
|
179
|
+
locale: this.locale(),
|
|
180
|
+
kind: this.kind,
|
|
181
|
+
granularity: this.inputs.granularity(),
|
|
182
|
+
hourCycle: this.inputs.hourCycle(),
|
|
183
|
+
...systemFormat(this.inputs.system)
|
|
184
|
+
}), ...ngDevMode ? [{ debugName: "format" }] : /* istanbul ignore next */ []);
|
|
185
|
+
this.timeZone = () => this.inputs.system?.timeZone();
|
|
186
|
+
this.seed = computed(() => segmentValuesOf(this.format(), this.inputs.placeholderValue()), ...ngDevMode ? [{ debugName: "seed" }] : /* istanbul ignore next */ []);
|
|
187
|
+
this.iso = computed(() => isoOf(this.kind, this.inputs.granularity(), this.value(), this.timeZone()), ...ngDevMode ? [{ debugName: "iso" }] : /* istanbul ignore next */ []);
|
|
188
|
+
this.reported = null;
|
|
189
|
+
const hidden = createHiddenInput(anchor, {
|
|
190
|
+
type: kind === "time" ? "time" : "date",
|
|
191
|
+
step: "any",
|
|
192
|
+
"data-primitives-part": `${component}-hidden-input`
|
|
193
|
+
});
|
|
194
|
+
this.field = fieldControl({
|
|
195
|
+
id: computed(() => void 0),
|
|
196
|
+
labelable: false,
|
|
197
|
+
value: this.value,
|
|
198
|
+
filled: computed(() => this.value() !== null),
|
|
199
|
+
input: () => hidden,
|
|
200
|
+
focusTarget: () => this.firstSegment()
|
|
201
|
+
});
|
|
202
|
+
const field = this.field;
|
|
203
|
+
this.labelledBy = field.labelledBy;
|
|
204
|
+
this.disabled = computed(() => this.inputs.disabled() || field.disabled(), ...ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []);
|
|
205
|
+
this.readOnly = computed(() => this.inputs.readOnly(), ...ngDevMode ? [{ debugName: "readOnly" }] : /* istanbul ignore next */ []);
|
|
206
|
+
this.required = computed(() => this.inputs.required(), ...ngDevMode ? [{ debugName: "required" }] : /* istanbul ignore next */ []);
|
|
207
|
+
this.invalid = computed(() => {
|
|
208
|
+
const value = this.value();
|
|
209
|
+
return value !== null && isOutOfRange(kind, value, this.inputs.min(), this.inputs.max(), this.inputs.isDateUnavailable()) || field.ariaInvalid() === "true";
|
|
210
|
+
}, ...ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []);
|
|
211
|
+
this.state = computed(() => ({
|
|
212
|
+
disabled: this.disabled(),
|
|
213
|
+
readOnly: this.readOnly(),
|
|
214
|
+
required: this.required(),
|
|
215
|
+
invalid: this.invalid()
|
|
216
|
+
}), ...ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []);
|
|
217
|
+
this.data = stateData(this.state, field);
|
|
218
|
+
this.group = new SegmentGroup({
|
|
219
|
+
component,
|
|
220
|
+
kind,
|
|
221
|
+
format: this.format,
|
|
222
|
+
granularity: this.inputs.granularity,
|
|
223
|
+
seed: this.seed,
|
|
224
|
+
state: this.state,
|
|
225
|
+
data: this.data,
|
|
226
|
+
disabled: this.disabled,
|
|
227
|
+
readOnly: this.readOnly,
|
|
228
|
+
required: this.required,
|
|
229
|
+
invalid: this.invalid,
|
|
230
|
+
field,
|
|
231
|
+
labelledBy: this.labelledBy,
|
|
232
|
+
onEdit: (composed, edit, event) => {
|
|
233
|
+
const after = isoOf(kind, untracked(this.inputs.granularity), composed, untracked(this.timeZone));
|
|
234
|
+
if (after === untracked(this.iso)) return;
|
|
235
|
+
this.reported = after;
|
|
236
|
+
this.own.set(composed, {
|
|
237
|
+
reason: editReason(edit, composed),
|
|
238
|
+
event
|
|
239
|
+
});
|
|
240
|
+
},
|
|
241
|
+
onBlur: () => field.blurred(),
|
|
242
|
+
flush: () => this.flush()
|
|
243
|
+
}, this.value);
|
|
244
|
+
this.segments = this.group.segments;
|
|
245
|
+
this.inputElement = this.group.inputElement;
|
|
246
|
+
let synced = null;
|
|
247
|
+
effect(() => {
|
|
248
|
+
const iso = this.iso();
|
|
249
|
+
untracked(() => {
|
|
250
|
+
if (synced === null || synced === iso) {
|
|
251
|
+
synced = iso;
|
|
252
|
+
return;
|
|
253
|
+
}
|
|
254
|
+
synced = iso;
|
|
255
|
+
if (iso === this.reported) return;
|
|
256
|
+
this.reported = null;
|
|
257
|
+
const value = this.value();
|
|
258
|
+
if (value !== null || this.group.complete()) this.group.replace(value);
|
|
259
|
+
});
|
|
260
|
+
});
|
|
261
|
+
const formName = computed(() => field.name() ?? this.inputs.name() ?? null, ...ngDevMode ? [{ debugName: "formName" }] : /* istanbul ignore next */ []);
|
|
262
|
+
effect(() => {
|
|
263
|
+
const granularity = this.inputs.granularity();
|
|
264
|
+
hidden.type = hiddenType(kind, granularity, this.timeZone());
|
|
265
|
+
setInputAttribute(hidden, "name", formName());
|
|
266
|
+
setInputAttribute(hidden, "min", boundIso(kind, granularity, this.inputs.min()));
|
|
267
|
+
setInputAttribute(hidden, "max", boundIso(kind, granularity, this.inputs.max()));
|
|
268
|
+
hidden.value = this.iso();
|
|
269
|
+
hidden.required = this.required();
|
|
270
|
+
hidden.disabled = this.disabled();
|
|
271
|
+
});
|
|
272
|
+
const onHiddenFocus = () => this.firstSegment()?.focus();
|
|
273
|
+
hidden.addEventListener("focus", onHiddenFocus);
|
|
274
|
+
const destroyRef = inject(DestroyRef);
|
|
275
|
+
if (this.browser) destroyRef.onDestroy(watchDocumentLanguage(this.document, () => this.language.update((count) => count + 1)));
|
|
276
|
+
let stop = null;
|
|
277
|
+
afterNextRender(() => {
|
|
278
|
+
stop = bridgeForm(hidden, {
|
|
279
|
+
reset: () => {
|
|
280
|
+
this.reset();
|
|
281
|
+
hidden.value = untracked(this.iso);
|
|
282
|
+
},
|
|
283
|
+
invalid: () => this.firstSegment()
|
|
284
|
+
});
|
|
285
|
+
});
|
|
286
|
+
afterRenderEffect((onCleanup) => {
|
|
287
|
+
const labelId = field.labelledBy();
|
|
288
|
+
const input = this.inputElement();
|
|
289
|
+
if (labelId === null || input === null) return;
|
|
290
|
+
const label = input.ownerDocument.getElementById(labelId);
|
|
291
|
+
if (label !== null) onCleanup(focusOnLabelPress(label, () => this.firstSegment()));
|
|
292
|
+
});
|
|
293
|
+
destroyRef.onDestroy(() => {
|
|
294
|
+
stop?.();
|
|
295
|
+
hidden.removeEventListener("focus", onHiddenFocus);
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
part(name) {
|
|
299
|
+
return `${this.component}-${name}`;
|
|
300
|
+
}
|
|
301
|
+
firstSegment() {
|
|
302
|
+
return this.group.firstSegment();
|
|
303
|
+
}
|
|
304
|
+
segmentKey(segment, event, element) {
|
|
305
|
+
return this.group.segmentKey(segment, event, element);
|
|
306
|
+
}
|
|
307
|
+
segmentText(segment, text, event, element) {
|
|
308
|
+
this.group.segmentText(segment, text, event, element);
|
|
309
|
+
}
|
|
310
|
+
segmentBlur(segment, event) {
|
|
311
|
+
this.group.segmentBlur(segment, event);
|
|
312
|
+
}
|
|
313
|
+
reset() {
|
|
314
|
+
this.field.reset();
|
|
315
|
+
this.reported = null;
|
|
316
|
+
const defaultValue = untracked(this.inputs.defaultValue);
|
|
317
|
+
this.group.replace(defaultValue);
|
|
318
|
+
this.own.set(defaultValue, { reason: "none" });
|
|
319
|
+
this.flush();
|
|
320
|
+
}
|
|
321
|
+
};
|
|
322
|
+
var DateFieldInput = class DateFieldInput {
|
|
323
|
+
constructor() {
|
|
324
|
+
this.dateField = inject(DATE_FIELD);
|
|
325
|
+
this.segments = this.dateField.segments;
|
|
326
|
+
this.state = this.dateField.state;
|
|
327
|
+
const host = registerHost(this.dateField.inputElement);
|
|
328
|
+
const { field } = this.dateField;
|
|
329
|
+
writeFieldAria(field, host, {
|
|
330
|
+
"aria-labelledby": field.labelledBy,
|
|
331
|
+
"aria-describedby": field.describedBy
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
static {
|
|
335
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
336
|
+
minVersion: "12.0.0",
|
|
337
|
+
version: "22.2.6",
|
|
338
|
+
ngImport: i0,
|
|
339
|
+
type: DateFieldInput,
|
|
340
|
+
deps: [],
|
|
341
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
static {
|
|
345
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
346
|
+
minVersion: "14.0.0",
|
|
347
|
+
version: "22.2.6",
|
|
348
|
+
type: DateFieldInput,
|
|
349
|
+
isStandalone: true,
|
|
350
|
+
selector: "[dateFieldInput]",
|
|
351
|
+
host: {
|
|
352
|
+
attributes: { "role": "group" },
|
|
353
|
+
properties: {
|
|
354
|
+
"attr.data-primitives-part": "dateField.part('input')",
|
|
355
|
+
"attr.data-disabled": "dateField.data().disabled",
|
|
356
|
+
"attr.data-readonly": "dateField.data().readonly",
|
|
357
|
+
"attr.data-required": "dateField.data().required",
|
|
358
|
+
"attr.data-invalid": "dateField.data().invalid",
|
|
359
|
+
"attr.data-valid": "dateField.data().valid",
|
|
360
|
+
"attr.data-dirty": "dateField.data().dirty",
|
|
361
|
+
"attr.data-touched": "dateField.data().touched",
|
|
362
|
+
"attr.data-filled": "dateField.data().filled",
|
|
363
|
+
"attr.data-focused": "dateField.data().focused"
|
|
364
|
+
}
|
|
365
|
+
},
|
|
366
|
+
exportAs: ["dateFieldInput"],
|
|
367
|
+
ngImport: i0
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
};
|
|
371
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
372
|
+
minVersion: "12.0.0",
|
|
373
|
+
version: "22.2.6",
|
|
374
|
+
ngImport: i0,
|
|
375
|
+
type: DateFieldInput,
|
|
376
|
+
decorators: [{
|
|
377
|
+
type: Directive,
|
|
378
|
+
args: [{
|
|
379
|
+
selector: "[dateFieldInput]",
|
|
380
|
+
exportAs: "dateFieldInput",
|
|
381
|
+
host: {
|
|
382
|
+
role: "group",
|
|
383
|
+
"[attr.data-primitives-part]": "dateField.part('input')",
|
|
384
|
+
"[attr.data-disabled]": "dateField.data().disabled",
|
|
385
|
+
"[attr.data-readonly]": "dateField.data().readonly",
|
|
386
|
+
"[attr.data-required]": "dateField.data().required",
|
|
387
|
+
"[attr.data-invalid]": "dateField.data().invalid",
|
|
388
|
+
"[attr.data-valid]": "dateField.data().valid",
|
|
389
|
+
"[attr.data-dirty]": "dateField.data().dirty",
|
|
390
|
+
"[attr.data-touched]": "dateField.data().touched",
|
|
391
|
+
"[attr.data-filled]": "dateField.data().filled",
|
|
392
|
+
"[attr.data-focused]": "dateField.data().focused"
|
|
393
|
+
}
|
|
394
|
+
}]
|
|
395
|
+
}],
|
|
396
|
+
ctorParameters: () => []
|
|
397
|
+
});
|
|
398
|
+
function hourCycleAttribute(value) {
|
|
399
|
+
if (value === void 0 || value === null || value === "") return;
|
|
400
|
+
return Number(value) === 12 ? 12 : 24;
|
|
401
|
+
}
|
|
402
|
+
var DateFieldRootBase = class DateFieldRootBase {
|
|
403
|
+
constructor() {
|
|
404
|
+
this.hourCycle = input(void 0, {
|
|
405
|
+
...ngDevMode ? { debugName: "hourCycle" } : /* istanbul ignore next */ {},
|
|
406
|
+
transform: hourCycleAttribute
|
|
407
|
+
});
|
|
408
|
+
this.locale = input(void 0, ...ngDevMode ? [{ debugName: "locale" }] : /* istanbul ignore next */ []);
|
|
409
|
+
this.required = input(false, {
|
|
410
|
+
...ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {},
|
|
411
|
+
transform: booleanAttribute
|
|
412
|
+
});
|
|
413
|
+
this.readOnly = input(false, {
|
|
414
|
+
...ngDevMode ? { debugName: "readOnly" } : /* istanbul ignore next */ {},
|
|
415
|
+
transform: booleanAttribute
|
|
416
|
+
});
|
|
417
|
+
this.disabled = input(false, {
|
|
418
|
+
...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
|
|
419
|
+
transform: booleanAttribute
|
|
420
|
+
});
|
|
421
|
+
this.name = input(void 0, ...ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []);
|
|
422
|
+
this.host = injectHost();
|
|
423
|
+
}
|
|
424
|
+
get state() {
|
|
425
|
+
return this.dateField.state;
|
|
426
|
+
}
|
|
427
|
+
stateInputs(own, system) {
|
|
428
|
+
return {
|
|
429
|
+
...own,
|
|
430
|
+
system,
|
|
431
|
+
hourCycle: this.hourCycle,
|
|
432
|
+
locale: this.locale,
|
|
433
|
+
required: this.required,
|
|
434
|
+
readOnly: this.readOnly,
|
|
435
|
+
disabled: this.disabled,
|
|
436
|
+
name: this.name
|
|
437
|
+
};
|
|
438
|
+
}
|
|
439
|
+
static {
|
|
440
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
441
|
+
minVersion: "12.0.0",
|
|
442
|
+
version: "22.2.6",
|
|
443
|
+
ngImport: i0,
|
|
444
|
+
type: DateFieldRootBase,
|
|
445
|
+
deps: [],
|
|
446
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
447
|
+
});
|
|
448
|
+
}
|
|
449
|
+
static {
|
|
450
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
451
|
+
minVersion: "17.1.0",
|
|
452
|
+
version: "22.2.6",
|
|
453
|
+
type: DateFieldRootBase,
|
|
454
|
+
isStandalone: true,
|
|
455
|
+
inputs: {
|
|
456
|
+
hourCycle: {
|
|
457
|
+
classPropertyName: "hourCycle",
|
|
458
|
+
publicName: "hourCycle",
|
|
459
|
+
isSignal: true,
|
|
460
|
+
isRequired: false,
|
|
461
|
+
transformFunction: null
|
|
462
|
+
},
|
|
463
|
+
locale: {
|
|
464
|
+
classPropertyName: "locale",
|
|
465
|
+
publicName: "locale",
|
|
466
|
+
isSignal: true,
|
|
467
|
+
isRequired: false,
|
|
468
|
+
transformFunction: null
|
|
469
|
+
},
|
|
470
|
+
required: {
|
|
471
|
+
classPropertyName: "required",
|
|
472
|
+
publicName: "required",
|
|
473
|
+
isSignal: true,
|
|
474
|
+
isRequired: false,
|
|
475
|
+
transformFunction: null
|
|
476
|
+
},
|
|
477
|
+
readOnly: {
|
|
478
|
+
classPropertyName: "readOnly",
|
|
479
|
+
publicName: "readOnly",
|
|
480
|
+
isSignal: true,
|
|
481
|
+
isRequired: false,
|
|
482
|
+
transformFunction: null
|
|
483
|
+
},
|
|
484
|
+
disabled: {
|
|
485
|
+
classPropertyName: "disabled",
|
|
486
|
+
publicName: "disabled",
|
|
487
|
+
isSignal: true,
|
|
488
|
+
isRequired: false,
|
|
489
|
+
transformFunction: null
|
|
490
|
+
},
|
|
491
|
+
name: {
|
|
492
|
+
classPropertyName: "name",
|
|
493
|
+
publicName: "name",
|
|
494
|
+
isSignal: true,
|
|
495
|
+
isRequired: false,
|
|
496
|
+
transformFunction: null
|
|
497
|
+
}
|
|
498
|
+
},
|
|
499
|
+
host: { properties: {
|
|
500
|
+
"attr.data-primitives-part": "dateField.part('root')",
|
|
501
|
+
"attr.data-disabled": "dateField.data().disabled",
|
|
502
|
+
"attr.data-readonly": "dateField.data().readonly",
|
|
503
|
+
"attr.data-required": "dateField.data().required",
|
|
504
|
+
"attr.data-invalid": "dateField.data().invalid",
|
|
505
|
+
"attr.data-valid": "dateField.data().valid",
|
|
506
|
+
"attr.data-dirty": "dateField.data().dirty",
|
|
507
|
+
"attr.data-touched": "dateField.data().touched",
|
|
508
|
+
"attr.data-filled": "dateField.data().filled",
|
|
509
|
+
"attr.data-focused": "dateField.data().focused"
|
|
510
|
+
} },
|
|
511
|
+
ngImport: i0
|
|
512
|
+
});
|
|
513
|
+
}
|
|
514
|
+
};
|
|
515
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
516
|
+
minVersion: "12.0.0",
|
|
517
|
+
version: "22.2.6",
|
|
518
|
+
ngImport: i0,
|
|
519
|
+
type: DateFieldRootBase,
|
|
520
|
+
decorators: [{
|
|
521
|
+
type: Directive,
|
|
522
|
+
args: [{ host: {
|
|
523
|
+
"[attr.data-primitives-part]": "dateField.part('root')",
|
|
524
|
+
"[attr.data-disabled]": "dateField.data().disabled",
|
|
525
|
+
"[attr.data-readonly]": "dateField.data().readonly",
|
|
526
|
+
"[attr.data-required]": "dateField.data().required",
|
|
527
|
+
"[attr.data-invalid]": "dateField.data().invalid",
|
|
528
|
+
"[attr.data-valid]": "dateField.data().valid",
|
|
529
|
+
"[attr.data-dirty]": "dateField.data().dirty",
|
|
530
|
+
"[attr.data-touched]": "dateField.data().touched",
|
|
531
|
+
"[attr.data-filled]": "dateField.data().filled",
|
|
532
|
+
"[attr.data-focused]": "dateField.data().focused"
|
|
533
|
+
} }]
|
|
534
|
+
}],
|
|
535
|
+
propDecorators: {
|
|
536
|
+
hourCycle: [{
|
|
537
|
+
type: i0.Input,
|
|
538
|
+
args: [{
|
|
539
|
+
isSignal: true,
|
|
540
|
+
alias: "hourCycle",
|
|
541
|
+
required: false
|
|
542
|
+
}]
|
|
543
|
+
}],
|
|
544
|
+
locale: [{
|
|
545
|
+
type: i0.Input,
|
|
546
|
+
args: [{
|
|
547
|
+
isSignal: true,
|
|
548
|
+
alias: "locale",
|
|
549
|
+
required: false
|
|
550
|
+
}]
|
|
551
|
+
}],
|
|
552
|
+
required: [{
|
|
553
|
+
type: i0.Input,
|
|
554
|
+
args: [{
|
|
555
|
+
isSignal: true,
|
|
556
|
+
alias: "required",
|
|
557
|
+
required: false
|
|
558
|
+
}]
|
|
559
|
+
}],
|
|
560
|
+
readOnly: [{
|
|
561
|
+
type: i0.Input,
|
|
562
|
+
args: [{
|
|
563
|
+
isSignal: true,
|
|
564
|
+
alias: "readOnly",
|
|
565
|
+
required: false
|
|
566
|
+
}]
|
|
567
|
+
}],
|
|
568
|
+
disabled: [{
|
|
569
|
+
type: i0.Input,
|
|
570
|
+
args: [{
|
|
571
|
+
isSignal: true,
|
|
572
|
+
alias: "disabled",
|
|
573
|
+
required: false
|
|
574
|
+
}]
|
|
575
|
+
}],
|
|
576
|
+
name: [{
|
|
577
|
+
type: i0.Input,
|
|
578
|
+
args: [{
|
|
579
|
+
isSignal: true,
|
|
580
|
+
alias: "name",
|
|
581
|
+
required: false
|
|
582
|
+
}]
|
|
583
|
+
}]
|
|
584
|
+
}
|
|
585
|
+
});
|
|
586
|
+
var DateFieldRoot = class DateFieldRoot extends DateFieldRootBase {
|
|
587
|
+
constructor() {
|
|
588
|
+
super(...arguments);
|
|
589
|
+
this.value = input(void 0, ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
|
|
590
|
+
this.valueChange = output();
|
|
591
|
+
this.defaultValue = input(null, ...ngDevMode ? [{ debugName: "defaultValue" }] : /* istanbul ignore next */ []);
|
|
592
|
+
this.valueChangeDetails = output();
|
|
593
|
+
this.granularity = input("day", ...ngDevMode ? [{ debugName: "granularity" }] : /* istanbul ignore next */ []);
|
|
594
|
+
this.placeholderValue = input(void 0, ...ngDevMode ? [{ debugName: "placeholderValue" }] : /* istanbul ignore next */ []);
|
|
595
|
+
this.min = input(void 0, ...ngDevMode ? [{ debugName: "min" }] : /* istanbul ignore next */ []);
|
|
596
|
+
this.max = input(void 0, ...ngDevMode ? [{ debugName: "max" }] : /* istanbul ignore next */ []);
|
|
597
|
+
this.isDateUnavailable = input(void 0, ...ngDevMode ? [{ debugName: "isDateUnavailable" }] : /* istanbul ignore next */ []);
|
|
598
|
+
this.calendar = input(void 0, ...ngDevMode ? [{ debugName: "calendar" }] : /* istanbul ignore next */ []);
|
|
599
|
+
this.timeZone = input(void 0, ...ngDevMode ? [{ debugName: "timeZone" }] : /* istanbul ignore next */ []);
|
|
600
|
+
this.hideTimeZone = input(false, {
|
|
601
|
+
...ngDevMode ? { debugName: "hideTimeZone" } : /* istanbul ignore next */ {},
|
|
602
|
+
transform: booleanAttribute
|
|
603
|
+
});
|
|
604
|
+
this.disambiguation = input(void 0, ...ngDevMode ? [{ debugName: "disambiguation" }] : /* istanbul ignore next */ []);
|
|
605
|
+
this.todayDate = today();
|
|
606
|
+
this.dateField = new DateFieldRootState("date-field", "date", this.stateInputs({
|
|
607
|
+
value: this.value,
|
|
608
|
+
valueChange: { emit: (value) => this.valueChange.emit(value) },
|
|
609
|
+
defaultValue: this.defaultValue,
|
|
610
|
+
granularity: this.granularity,
|
|
611
|
+
placeholderValue: computed(() => this.placeholderValue() ?? this.todayDate),
|
|
612
|
+
min: this.min,
|
|
613
|
+
max: this.max,
|
|
614
|
+
isDateUnavailable: this.isDateUnavailable
|
|
615
|
+
}, {
|
|
616
|
+
calendar: this.calendar,
|
|
617
|
+
timeZone: this.timeZone,
|
|
618
|
+
hideTimeZone: this.hideTimeZone,
|
|
619
|
+
disambiguation: this.disambiguation
|
|
620
|
+
}), (value, details) => this.valueChangeDetails.emit({
|
|
621
|
+
value,
|
|
622
|
+
details
|
|
623
|
+
}), this.host);
|
|
624
|
+
}
|
|
625
|
+
static {
|
|
626
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
627
|
+
minVersion: "12.0.0",
|
|
628
|
+
version: "22.2.6",
|
|
629
|
+
ngImport: i0,
|
|
630
|
+
type: DateFieldRoot,
|
|
631
|
+
deps: null,
|
|
632
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
633
|
+
});
|
|
634
|
+
}
|
|
635
|
+
static {
|
|
636
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
637
|
+
minVersion: "17.1.0",
|
|
638
|
+
version: "22.2.6",
|
|
639
|
+
type: DateFieldRoot,
|
|
640
|
+
isStandalone: true,
|
|
641
|
+
selector: "[dateFieldRoot]",
|
|
642
|
+
inputs: {
|
|
643
|
+
value: {
|
|
644
|
+
classPropertyName: "value",
|
|
645
|
+
publicName: "value",
|
|
646
|
+
isSignal: true,
|
|
647
|
+
isRequired: false,
|
|
648
|
+
transformFunction: null
|
|
649
|
+
},
|
|
650
|
+
defaultValue: {
|
|
651
|
+
classPropertyName: "defaultValue",
|
|
652
|
+
publicName: "defaultValue",
|
|
653
|
+
isSignal: true,
|
|
654
|
+
isRequired: false,
|
|
655
|
+
transformFunction: null
|
|
656
|
+
},
|
|
657
|
+
granularity: {
|
|
658
|
+
classPropertyName: "granularity",
|
|
659
|
+
publicName: "granularity",
|
|
660
|
+
isSignal: true,
|
|
661
|
+
isRequired: false,
|
|
662
|
+
transformFunction: null
|
|
663
|
+
},
|
|
664
|
+
placeholderValue: {
|
|
665
|
+
classPropertyName: "placeholderValue",
|
|
666
|
+
publicName: "placeholderValue",
|
|
667
|
+
isSignal: true,
|
|
668
|
+
isRequired: false,
|
|
669
|
+
transformFunction: null
|
|
670
|
+
},
|
|
671
|
+
min: {
|
|
672
|
+
classPropertyName: "min",
|
|
673
|
+
publicName: "min",
|
|
674
|
+
isSignal: true,
|
|
675
|
+
isRequired: false,
|
|
676
|
+
transformFunction: null
|
|
677
|
+
},
|
|
678
|
+
max: {
|
|
679
|
+
classPropertyName: "max",
|
|
680
|
+
publicName: "max",
|
|
681
|
+
isSignal: true,
|
|
682
|
+
isRequired: false,
|
|
683
|
+
transformFunction: null
|
|
684
|
+
},
|
|
685
|
+
isDateUnavailable: {
|
|
686
|
+
classPropertyName: "isDateUnavailable",
|
|
687
|
+
publicName: "isDateUnavailable",
|
|
688
|
+
isSignal: true,
|
|
689
|
+
isRequired: false,
|
|
690
|
+
transformFunction: null
|
|
691
|
+
},
|
|
692
|
+
calendar: {
|
|
693
|
+
classPropertyName: "calendar",
|
|
694
|
+
publicName: "calendar",
|
|
695
|
+
isSignal: true,
|
|
696
|
+
isRequired: false,
|
|
697
|
+
transformFunction: null
|
|
698
|
+
},
|
|
699
|
+
timeZone: {
|
|
700
|
+
classPropertyName: "timeZone",
|
|
701
|
+
publicName: "timeZone",
|
|
702
|
+
isSignal: true,
|
|
703
|
+
isRequired: false,
|
|
704
|
+
transformFunction: null
|
|
705
|
+
},
|
|
706
|
+
hideTimeZone: {
|
|
707
|
+
classPropertyName: "hideTimeZone",
|
|
708
|
+
publicName: "hideTimeZone",
|
|
709
|
+
isSignal: true,
|
|
710
|
+
isRequired: false,
|
|
711
|
+
transformFunction: null
|
|
712
|
+
},
|
|
713
|
+
disambiguation: {
|
|
714
|
+
classPropertyName: "disambiguation",
|
|
715
|
+
publicName: "disambiguation",
|
|
716
|
+
isSignal: true,
|
|
717
|
+
isRequired: false,
|
|
718
|
+
transformFunction: null
|
|
719
|
+
}
|
|
720
|
+
},
|
|
721
|
+
outputs: {
|
|
722
|
+
valueChange: "valueChange",
|
|
723
|
+
valueChangeDetails: "valueChangeDetails"
|
|
724
|
+
},
|
|
725
|
+
providers: [{
|
|
726
|
+
provide: DATE_FIELD,
|
|
727
|
+
useFactory: () => inject(forwardRef(() => DateFieldRoot)).dateField
|
|
728
|
+
}],
|
|
729
|
+
exportAs: ["dateFieldRoot"],
|
|
730
|
+
usesInheritance: true,
|
|
731
|
+
ngImport: i0
|
|
732
|
+
});
|
|
733
|
+
}
|
|
734
|
+
};
|
|
735
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
736
|
+
minVersion: "12.0.0",
|
|
737
|
+
version: "22.2.6",
|
|
738
|
+
ngImport: i0,
|
|
739
|
+
type: DateFieldRoot,
|
|
740
|
+
decorators: [{
|
|
741
|
+
type: Directive,
|
|
742
|
+
args: [{
|
|
743
|
+
selector: "[dateFieldRoot]",
|
|
744
|
+
exportAs: "dateFieldRoot",
|
|
745
|
+
providers: [{
|
|
746
|
+
provide: DATE_FIELD,
|
|
747
|
+
useFactory: () => inject(forwardRef(() => DateFieldRoot)).dateField
|
|
748
|
+
}]
|
|
749
|
+
}]
|
|
750
|
+
}],
|
|
751
|
+
propDecorators: {
|
|
752
|
+
value: [{
|
|
753
|
+
type: i0.Input,
|
|
754
|
+
args: [{
|
|
755
|
+
isSignal: true,
|
|
756
|
+
alias: "value",
|
|
757
|
+
required: false
|
|
758
|
+
}]
|
|
759
|
+
}],
|
|
760
|
+
valueChange: [{
|
|
761
|
+
type: i0.Output,
|
|
762
|
+
args: ["valueChange"]
|
|
763
|
+
}],
|
|
764
|
+
defaultValue: [{
|
|
765
|
+
type: i0.Input,
|
|
766
|
+
args: [{
|
|
767
|
+
isSignal: true,
|
|
768
|
+
alias: "defaultValue",
|
|
769
|
+
required: false
|
|
770
|
+
}]
|
|
771
|
+
}],
|
|
772
|
+
valueChangeDetails: [{
|
|
773
|
+
type: i0.Output,
|
|
774
|
+
args: ["valueChangeDetails"]
|
|
775
|
+
}],
|
|
776
|
+
granularity: [{
|
|
777
|
+
type: i0.Input,
|
|
778
|
+
args: [{
|
|
779
|
+
isSignal: true,
|
|
780
|
+
alias: "granularity",
|
|
781
|
+
required: false
|
|
782
|
+
}]
|
|
783
|
+
}],
|
|
784
|
+
placeholderValue: [{
|
|
785
|
+
type: i0.Input,
|
|
786
|
+
args: [{
|
|
787
|
+
isSignal: true,
|
|
788
|
+
alias: "placeholderValue",
|
|
789
|
+
required: false
|
|
790
|
+
}]
|
|
791
|
+
}],
|
|
792
|
+
min: [{
|
|
793
|
+
type: i0.Input,
|
|
794
|
+
args: [{
|
|
795
|
+
isSignal: true,
|
|
796
|
+
alias: "min",
|
|
797
|
+
required: false
|
|
798
|
+
}]
|
|
799
|
+
}],
|
|
800
|
+
max: [{
|
|
801
|
+
type: i0.Input,
|
|
802
|
+
args: [{
|
|
803
|
+
isSignal: true,
|
|
804
|
+
alias: "max",
|
|
805
|
+
required: false
|
|
806
|
+
}]
|
|
807
|
+
}],
|
|
808
|
+
isDateUnavailable: [{
|
|
809
|
+
type: i0.Input,
|
|
810
|
+
args: [{
|
|
811
|
+
isSignal: true,
|
|
812
|
+
alias: "isDateUnavailable",
|
|
813
|
+
required: false
|
|
814
|
+
}]
|
|
815
|
+
}],
|
|
816
|
+
calendar: [{
|
|
817
|
+
type: i0.Input,
|
|
818
|
+
args: [{
|
|
819
|
+
isSignal: true,
|
|
820
|
+
alias: "calendar",
|
|
821
|
+
required: false
|
|
822
|
+
}]
|
|
823
|
+
}],
|
|
824
|
+
timeZone: [{
|
|
825
|
+
type: i0.Input,
|
|
826
|
+
args: [{
|
|
827
|
+
isSignal: true,
|
|
828
|
+
alias: "timeZone",
|
|
829
|
+
required: false
|
|
830
|
+
}]
|
|
831
|
+
}],
|
|
832
|
+
hideTimeZone: [{
|
|
833
|
+
type: i0.Input,
|
|
834
|
+
args: [{
|
|
835
|
+
isSignal: true,
|
|
836
|
+
alias: "hideTimeZone",
|
|
837
|
+
required: false
|
|
838
|
+
}]
|
|
839
|
+
}],
|
|
840
|
+
disambiguation: [{
|
|
841
|
+
type: i0.Input,
|
|
842
|
+
args: [{
|
|
843
|
+
isSignal: true,
|
|
844
|
+
alias: "disambiguation",
|
|
845
|
+
required: false
|
|
846
|
+
}]
|
|
847
|
+
}]
|
|
848
|
+
}
|
|
849
|
+
});
|
|
850
|
+
var DateFieldSegment = class DateFieldSegment {
|
|
851
|
+
constructor() {
|
|
852
|
+
this.segment = input.required({
|
|
853
|
+
...ngDevMode ? { debugName: "segment" } : /* istanbul ignore next */ {},
|
|
854
|
+
alias: "dateFieldSegment"
|
|
855
|
+
});
|
|
856
|
+
this.dateField = inject(DATE_FIELD);
|
|
857
|
+
this.host = injectHost();
|
|
858
|
+
this.id = injectId("primitives-date-field-segment");
|
|
859
|
+
this.ownLabel = ownAttribute("aria-label");
|
|
860
|
+
this.editable = computed(() => this.segment().editable, ...ngDevMode ? [{ debugName: "editable" }] : /* istanbul ignore next */ []);
|
|
861
|
+
this.writable = computed(() => this.editable() && !this.dateField.disabled() && !this.dateField.readOnly(), ...ngDevMode ? [{ debugName: "writable" }] : /* istanbul ignore next */ []);
|
|
862
|
+
this.textual = () => this.segment().type === "dayPeriod" || this.segment().type === "era";
|
|
863
|
+
this.numeric = computed(() => this.editable() && !this.textual(), ...ngDevMode ? [{ debugName: "numeric" }] : /* istanbul ignore next */ []);
|
|
864
|
+
this.inputMode = computed(() => this.textual() ? "text" : "numeric", ...ngDevMode ? [{ debugName: "inputMode" }] : /* istanbul ignore next */ []);
|
|
865
|
+
this.ariaLabel = computed(() => this.ownLabel ?? (this.editable() ? this.segment().label : null) ?? null, ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
|
|
866
|
+
this.labelledBy = computed(() => {
|
|
867
|
+
const label = this.dateField.labelledBy();
|
|
868
|
+
return this.editable() && label !== null ? `${label} ${this.id}` : null;
|
|
869
|
+
}, ...ngDevMode ? [{ debugName: "labelledBy" }] : /* istanbul ignore next */ []);
|
|
870
|
+
this.state = computed(() => ({
|
|
871
|
+
...this.dateField.state(),
|
|
872
|
+
type: this.segment().type,
|
|
873
|
+
placeholder: this.segment().placeholder
|
|
874
|
+
}), ...ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []);
|
|
875
|
+
}
|
|
876
|
+
onKeyDown(event) {
|
|
877
|
+
if (this.editable() && this.dateField.segmentKey(this.segment(), event, this.host)) event.preventDefault();
|
|
878
|
+
}
|
|
879
|
+
onBeforeInput(event) {
|
|
880
|
+
if (!this.writable()) return;
|
|
881
|
+
event.preventDefault();
|
|
882
|
+
if (event.inputType === "deleteContentBackward") {
|
|
883
|
+
this.dateField.segmentKey(this.segment(), new KeyboardEvent("keydown", { key: "Backspace" }), this.host);
|
|
884
|
+
return;
|
|
885
|
+
}
|
|
886
|
+
if (event.data !== null && event.data !== "") this.dateField.segmentText(this.segment(), event.data, event, this.host);
|
|
887
|
+
}
|
|
888
|
+
onFocus() {
|
|
889
|
+
if (this.editable()) this.dateField.field.focused();
|
|
890
|
+
}
|
|
891
|
+
onBlur(event) {
|
|
892
|
+
if (this.editable()) this.dateField.segmentBlur(this.segment(), event);
|
|
893
|
+
}
|
|
894
|
+
static {
|
|
895
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
896
|
+
minVersion: "12.0.0",
|
|
897
|
+
version: "22.2.6",
|
|
898
|
+
ngImport: i0,
|
|
899
|
+
type: DateFieldSegment,
|
|
900
|
+
deps: [],
|
|
901
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
902
|
+
});
|
|
903
|
+
}
|
|
904
|
+
static {
|
|
905
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
906
|
+
minVersion: "17.1.0",
|
|
907
|
+
version: "22.2.6",
|
|
908
|
+
type: DateFieldSegment,
|
|
909
|
+
isStandalone: true,
|
|
910
|
+
selector: "[dateFieldSegment]",
|
|
911
|
+
inputs: { segment: {
|
|
912
|
+
classPropertyName: "segment",
|
|
913
|
+
publicName: "dateFieldSegment",
|
|
914
|
+
isSignal: true,
|
|
915
|
+
isRequired: true,
|
|
916
|
+
transformFunction: null
|
|
917
|
+
} },
|
|
918
|
+
host: {
|
|
919
|
+
listeners: {
|
|
920
|
+
"keydown": "onKeyDown($event)",
|
|
921
|
+
"beforeinput": "onBeforeInput($event)",
|
|
922
|
+
"focus": "onFocus()",
|
|
923
|
+
"blur": "onBlur($event)"
|
|
924
|
+
},
|
|
925
|
+
properties: {
|
|
926
|
+
"attr.id": "editable() ? id : null",
|
|
927
|
+
"attr.role": "editable() ? 'spinbutton' : null",
|
|
928
|
+
"attr.tabindex": "editable() && !dateField.disabled() ? 0 : null",
|
|
929
|
+
"attr.aria-label": "ariaLabel()",
|
|
930
|
+
"attr.aria-labelledby": "labelledBy()",
|
|
931
|
+
"attr.aria-valuenow": "editable() ? segment().value : null",
|
|
932
|
+
"attr.aria-valuetext": "editable() ? segment().valueText : null",
|
|
933
|
+
"attr.aria-valuemin": "editable() ? segment().min : null",
|
|
934
|
+
"attr.aria-valuemax": "editable() ? segment().max : null",
|
|
935
|
+
"attr.aria-invalid": "editable() && dateField.invalid() ? 'true' : null",
|
|
936
|
+
"attr.aria-required": "editable() && dateField.required() ? 'true' : null",
|
|
937
|
+
"attr.aria-readonly": "editable() && dateField.readOnly() ? 'true' : null",
|
|
938
|
+
"attr.aria-disabled": "editable() && dateField.disabled() ? 'true' : null",
|
|
939
|
+
"attr.aria-hidden": "segment().type === 'literal' ? 'true' : null",
|
|
940
|
+
"attr.contenteditable": "writable() ? 'true' : null",
|
|
941
|
+
"attr.inputmode": "editable() ? inputMode() : null",
|
|
942
|
+
"attr.spellcheck": "editable() ? 'false' : null",
|
|
943
|
+
"attr.autocorrect": "editable() ? 'off' : null",
|
|
944
|
+
"attr.autocapitalize": "editable() ? 'off' : null",
|
|
945
|
+
"attr.enterkeyhint": "editable() ? 'next' : null",
|
|
946
|
+
"style.unicode-bidi": "numeric() ? 'embed' : null",
|
|
947
|
+
"style.direction": "numeric() ? 'ltr' : null",
|
|
948
|
+
"attr.data-primitives-part": "dateField.part('segment')",
|
|
949
|
+
"attr.data-type": "segment().type",
|
|
950
|
+
"attr.data-placeholder": "editable() && segment().placeholder ? '' : null",
|
|
951
|
+
"attr.data-disabled": "dateField.data().disabled",
|
|
952
|
+
"attr.data-readonly": "dateField.data().readonly",
|
|
953
|
+
"attr.data-required": "dateField.data().required",
|
|
954
|
+
"attr.data-invalid": "dateField.data().invalid",
|
|
955
|
+
"attr.data-valid": "dateField.data().valid",
|
|
956
|
+
"attr.data-dirty": "dateField.data().dirty",
|
|
957
|
+
"attr.data-touched": "dateField.data().touched",
|
|
958
|
+
"attr.data-filled": "dateField.data().filled",
|
|
959
|
+
"attr.data-focused": "dateField.data().focused"
|
|
960
|
+
}
|
|
961
|
+
},
|
|
962
|
+
exportAs: ["dateFieldSegment"],
|
|
963
|
+
ngImport: i0
|
|
964
|
+
});
|
|
965
|
+
}
|
|
966
|
+
};
|
|
967
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
968
|
+
minVersion: "12.0.0",
|
|
969
|
+
version: "22.2.6",
|
|
970
|
+
ngImport: i0,
|
|
971
|
+
type: DateFieldSegment,
|
|
972
|
+
decorators: [{
|
|
973
|
+
type: Directive,
|
|
974
|
+
args: [{
|
|
975
|
+
selector: "[dateFieldSegment]",
|
|
976
|
+
exportAs: "dateFieldSegment",
|
|
977
|
+
host: {
|
|
978
|
+
"[attr.id]": "editable() ? id : null",
|
|
979
|
+
"[attr.role]": "editable() ? 'spinbutton' : null",
|
|
980
|
+
"[attr.tabindex]": "editable() && !dateField.disabled() ? 0 : null",
|
|
981
|
+
"[attr.aria-label]": "ariaLabel()",
|
|
982
|
+
"[attr.aria-labelledby]": "labelledBy()",
|
|
983
|
+
"[attr.aria-valuenow]": "editable() ? segment().value : null",
|
|
984
|
+
"[attr.aria-valuetext]": "editable() ? segment().valueText : null",
|
|
985
|
+
"[attr.aria-valuemin]": "editable() ? segment().min : null",
|
|
986
|
+
"[attr.aria-valuemax]": "editable() ? segment().max : null",
|
|
987
|
+
"[attr.aria-invalid]": "editable() && dateField.invalid() ? 'true' : null",
|
|
988
|
+
"[attr.aria-required]": "editable() && dateField.required() ? 'true' : null",
|
|
989
|
+
"[attr.aria-readonly]": "editable() && dateField.readOnly() ? 'true' : null",
|
|
990
|
+
"[attr.aria-disabled]": "editable() && dateField.disabled() ? 'true' : null",
|
|
991
|
+
"[attr.aria-hidden]": "segment().type === 'literal' ? 'true' : null",
|
|
992
|
+
"[attr.contenteditable]": "writable() ? 'true' : null",
|
|
993
|
+
"[attr.inputmode]": "editable() ? inputMode() : null",
|
|
994
|
+
"[attr.spellcheck]": "editable() ? 'false' : null",
|
|
995
|
+
"[attr.autocorrect]": "editable() ? 'off' : null",
|
|
996
|
+
"[attr.autocapitalize]": "editable() ? 'off' : null",
|
|
997
|
+
"[attr.enterkeyhint]": "editable() ? 'next' : null",
|
|
998
|
+
"[style.unicode-bidi]": "numeric() ? 'embed' : null",
|
|
999
|
+
"[style.direction]": "numeric() ? 'ltr' : null",
|
|
1000
|
+
"[attr.data-primitives-part]": "dateField.part('segment')",
|
|
1001
|
+
"[attr.data-type]": "segment().type",
|
|
1002
|
+
"[attr.data-placeholder]": "editable() && segment().placeholder ? '' : null",
|
|
1003
|
+
"[attr.data-disabled]": "dateField.data().disabled",
|
|
1004
|
+
"[attr.data-readonly]": "dateField.data().readonly",
|
|
1005
|
+
"[attr.data-required]": "dateField.data().required",
|
|
1006
|
+
"[attr.data-invalid]": "dateField.data().invalid",
|
|
1007
|
+
"[attr.data-valid]": "dateField.data().valid",
|
|
1008
|
+
"[attr.data-dirty]": "dateField.data().dirty",
|
|
1009
|
+
"[attr.data-touched]": "dateField.data().touched",
|
|
1010
|
+
"[attr.data-filled]": "dateField.data().filled",
|
|
1011
|
+
"[attr.data-focused]": "dateField.data().focused",
|
|
1012
|
+
"(keydown)": "onKeyDown($event)",
|
|
1013
|
+
"(beforeinput)": "onBeforeInput($event)",
|
|
1014
|
+
"(focus)": "onFocus()",
|
|
1015
|
+
"(blur)": "onBlur($event)"
|
|
1016
|
+
}
|
|
1017
|
+
}]
|
|
1018
|
+
}],
|
|
1019
|
+
propDecorators: { segment: [{
|
|
1020
|
+
type: i0.Input,
|
|
1021
|
+
args: [{
|
|
1022
|
+
isSignal: true,
|
|
1023
|
+
alias: "dateFieldSegment",
|
|
1024
|
+
required: true
|
|
1025
|
+
}]
|
|
1026
|
+
}] }
|
|
1027
|
+
});
|
|
1028
|
+
export { DATE_FIELD, DateFieldInput, DateFieldRoot, DateFieldRootBase, DateFieldRootState, DateFieldSegment, SegmentGroup, boundIso, compareValues, composeSegments, documentLocale, editReason, hiddenType, isOutOfRange, isoOf, stateData, systemFormat };
|
|
1029
|
+
|
|
1030
|
+
//# sourceMappingURL=fragiola-primitives-angular-date-field.mjs.map
|