@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,751 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { DestroyRef, Directive, afterNextRender, booleanAttribute, computed, effect, inject, input, numberAttribute, output, signal, untracked } from "@angular/core";
|
|
3
|
+
import { controllable, createHiddenInput, dataValues, injectFlush, injectHost, injectId, injectProvidedDirection, setInputAttribute } from "@fragiola/primitives-angular/internal";
|
|
4
|
+
import { inDocumentOrder } from "@fragiola/primitives/collection";
|
|
5
|
+
import { getDirection } from "@fragiola/primitives/direction";
|
|
6
|
+
import { bridgeForm, normalizeOtp, otpInputMode, otpPattern, removeOtpCharacter, replaceOtp } from "@fragiola/primitives/form";
|
|
7
|
+
import { fieldControl, writeFieldAria } from "@fragiola/primitives-angular/field";
|
|
8
|
+
function writeSlotLabelledBy(field, host) {
|
|
9
|
+
if (!field.inField) return;
|
|
10
|
+
const names = signal(0, ...ngDevMode ? [{ debugName: "names" }] : /* istanbul ignore next */ []);
|
|
11
|
+
const Observer = host.ownerDocument.defaultView?.MutationObserver;
|
|
12
|
+
if (Observer !== void 0) {
|
|
13
|
+
const observer = new Observer(() => names.update((count) => count + 1));
|
|
14
|
+
observer.observe(host, {
|
|
15
|
+
attributes: true,
|
|
16
|
+
attributeFilter: ["aria-label", "aria-labelledby"]
|
|
17
|
+
});
|
|
18
|
+
inject(DestroyRef).onDestroy(() => observer.disconnect());
|
|
19
|
+
}
|
|
20
|
+
let written = null;
|
|
21
|
+
effect(() => {
|
|
22
|
+
names();
|
|
23
|
+
const id = field.labelledBy();
|
|
24
|
+
untracked(() => {
|
|
25
|
+
const current = host.getAttribute("aria-labelledby");
|
|
26
|
+
if (host.hasAttribute("aria-label") || current !== null && current !== written && current !== id || id === null) {
|
|
27
|
+
if (current !== null && (current === written || current === id)) host.removeAttribute("aria-labelledby");
|
|
28
|
+
written = null;
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
if (current !== id) host.setAttribute("aria-labelledby", id);
|
|
32
|
+
written = id;
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
var OTPFieldRoot = class OTPFieldRoot {
|
|
37
|
+
constructor() {
|
|
38
|
+
this.length = input.required({
|
|
39
|
+
...ngDevMode ? { debugName: "length" } : /* istanbul ignore next */ {},
|
|
40
|
+
transform: numberAttribute
|
|
41
|
+
});
|
|
42
|
+
this.value = input(void 0, ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
|
|
43
|
+
this.valueChange = output();
|
|
44
|
+
this.defaultValue = input("", ...ngDevMode ? [{ debugName: "defaultValue" }] : /* istanbul ignore next */ []);
|
|
45
|
+
this.valueChangeDetails = output();
|
|
46
|
+
this.valueComplete = output();
|
|
47
|
+
this.valueInvalid = output();
|
|
48
|
+
this.validationType = input("numeric", ...ngDevMode ? [{ debugName: "validationType" }] : /* istanbul ignore next */ []);
|
|
49
|
+
this.mask = input(false, {
|
|
50
|
+
...ngDevMode ? { debugName: "mask" } : /* istanbul ignore next */ {},
|
|
51
|
+
transform: booleanAttribute
|
|
52
|
+
});
|
|
53
|
+
this.autoComplete = input("one-time-code", ...ngDevMode ? [{ debugName: "autoComplete" }] : /* istanbul ignore next */ []);
|
|
54
|
+
this.inputMode = input(void 0, ...ngDevMode ? [{ debugName: "inputMode" }] : /* istanbul ignore next */ []);
|
|
55
|
+
this.required = input(false, {
|
|
56
|
+
...ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {},
|
|
57
|
+
transform: booleanAttribute
|
|
58
|
+
});
|
|
59
|
+
this.readOnly = input(false, {
|
|
60
|
+
...ngDevMode ? { debugName: "readOnly" } : /* istanbul ignore next */ {},
|
|
61
|
+
transform: booleanAttribute
|
|
62
|
+
});
|
|
63
|
+
this.disabled = input(false, {
|
|
64
|
+
...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
|
|
65
|
+
transform: booleanAttribute
|
|
66
|
+
});
|
|
67
|
+
this.name = input(void 0, ...ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []);
|
|
68
|
+
this.id = input(void 0, ...ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []);
|
|
69
|
+
this.host = injectHost();
|
|
70
|
+
this.flush = injectFlush();
|
|
71
|
+
this.direction = injectProvidedDirection();
|
|
72
|
+
this.generatedId = injectId("primitives-otp-field");
|
|
73
|
+
this.slotId = computed(() => this.id() ?? this.generatedId, ...ngDevMode ? [{ debugName: "slotId" }] : /* istanbul ignore next */ []);
|
|
74
|
+
this.own = controllable(this.value, this.valueChange, () => this.defaultValue(), (value, details) => this.valueChangeDetails.emit({
|
|
75
|
+
value,
|
|
76
|
+
details
|
|
77
|
+
}));
|
|
78
|
+
this.code = computed(() => normalizeOtp(this.own.value(), this.length(), this.validationType()).value, ...ngDevMode ? [{ debugName: "code" }] : /* istanbul ignore next */ []);
|
|
79
|
+
this.slots = signal([], ...ngDevMode ? [{ debugName: "slots" }] : /* istanbul ignore next */ []);
|
|
80
|
+
this.ordered = computed(() => inDocumentOrder(this.slots(), (slot) => slot), ...ngDevMode ? [{ debugName: "ordered" }] : /* istanbul ignore next */ []);
|
|
81
|
+
this.focusedIndex = signal(null, ...ngDevMode ? [{ debugName: "focusedIndex" }] : /* istanbul ignore next */ []);
|
|
82
|
+
this.last = computed(() => Math.max(this.length() - 1, 0), ...ngDevMode ? [{ debugName: "last" }] : /* istanbul ignore next */ []);
|
|
83
|
+
this.activeIndex = computed(() => this.focusedIndex() ?? Math.min(this.code().length, this.last()), ...ngDevMode ? [{ debugName: "activeIndex" }] : /* istanbul ignore next */ []);
|
|
84
|
+
this.hidden = createHiddenInput(this.host, {
|
|
85
|
+
type: "text",
|
|
86
|
+
"data-primitives-part": "otp-field-hidden-input"
|
|
87
|
+
});
|
|
88
|
+
this.field = fieldControl({
|
|
89
|
+
id: this.slotId,
|
|
90
|
+
labelable: true,
|
|
91
|
+
value: this.code,
|
|
92
|
+
filled: computed(() => this.code() !== ""),
|
|
93
|
+
input: () => this.hidden,
|
|
94
|
+
focusTarget: () => this.firstEmptySlot()
|
|
95
|
+
});
|
|
96
|
+
this.isDisabled = computed(() => this.disabled() || this.field.disabled(), ...ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []);
|
|
97
|
+
this.slotInputMode = computed(() => this.inputMode() ?? otpInputMode(this.validationType()), ...ngDevMode ? [{ debugName: "slotInputMode" }] : /* istanbul ignore next */ []);
|
|
98
|
+
this.state = computed(() => {
|
|
99
|
+
const value = this.code();
|
|
100
|
+
const length = this.length();
|
|
101
|
+
return {
|
|
102
|
+
value,
|
|
103
|
+
length,
|
|
104
|
+
complete: value.length === length && length > 0,
|
|
105
|
+
disabled: this.isDisabled(),
|
|
106
|
+
readOnly: this.readOnly(),
|
|
107
|
+
required: this.required()
|
|
108
|
+
};
|
|
109
|
+
}, ...ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []);
|
|
110
|
+
this.data = computed(() => {
|
|
111
|
+
const state = this.state();
|
|
112
|
+
const field = this.field.data();
|
|
113
|
+
return {
|
|
114
|
+
...dataValues({
|
|
115
|
+
disabled: state.disabled,
|
|
116
|
+
readonly: state.readOnly,
|
|
117
|
+
required: state.required,
|
|
118
|
+
complete: state.complete
|
|
119
|
+
}),
|
|
120
|
+
invalid: field.invalid,
|
|
121
|
+
valid: field.valid,
|
|
122
|
+
dirty: field.dirty,
|
|
123
|
+
touched: field.touched,
|
|
124
|
+
filled: field.filled,
|
|
125
|
+
focused: field.focused
|
|
126
|
+
};
|
|
127
|
+
}, ...ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []);
|
|
128
|
+
const host = this.host;
|
|
129
|
+
const hidden = this.hidden;
|
|
130
|
+
writeFieldAria(this.field, host, {
|
|
131
|
+
"aria-labelledby": this.field.labelledBy,
|
|
132
|
+
"aria-describedby": this.field.describedBy
|
|
133
|
+
});
|
|
134
|
+
const formName = computed(() => this.field.name() ?? this.name() ?? null, ...ngDevMode ? [{ debugName: "formName" }] : /* istanbul ignore next */ []);
|
|
135
|
+
effect(() => {
|
|
136
|
+
const state = this.state();
|
|
137
|
+
setInputAttribute(hidden, "name", formName());
|
|
138
|
+
setInputAttribute(hidden, "autocomplete", this.autoComplete());
|
|
139
|
+
setInputAttribute(hidden, "maxlength", String(state.length));
|
|
140
|
+
setInputAttribute(hidden, "pattern", otpPattern(this.validationType(), state.length));
|
|
141
|
+
hidden.value = state.value;
|
|
142
|
+
hidden.required = state.required;
|
|
143
|
+
hidden.disabled = state.disabled;
|
|
144
|
+
});
|
|
145
|
+
const onHiddenFocus = () => this.focusSlot(0);
|
|
146
|
+
const onHiddenInput = (event) => {
|
|
147
|
+
if (!this.interactive()) return;
|
|
148
|
+
const { value } = normalizeOtp(hidden.value, untracked(this.length), untracked(this.validationType));
|
|
149
|
+
this.setValue(value, "input-change", event);
|
|
150
|
+
};
|
|
151
|
+
hidden.addEventListener("focus", onHiddenFocus);
|
|
152
|
+
hidden.addEventListener("input", onHiddenInput);
|
|
153
|
+
const destroyRef = inject(DestroyRef);
|
|
154
|
+
let stop = null;
|
|
155
|
+
afterNextRender(() => {
|
|
156
|
+
stop = bridgeForm(hidden, {
|
|
157
|
+
reset: () => {
|
|
158
|
+
this.field.reset();
|
|
159
|
+
this.setValue(normalizeOtp(untracked(this.defaultValue), untracked(this.length), untracked(this.validationType)).value, "none", void 0);
|
|
160
|
+
hidden.value = untracked(this.code);
|
|
161
|
+
this.syncSlots();
|
|
162
|
+
},
|
|
163
|
+
invalid: () => this.firstEmptySlot()
|
|
164
|
+
});
|
|
165
|
+
});
|
|
166
|
+
destroyRef.onDestroy(() => {
|
|
167
|
+
stop?.();
|
|
168
|
+
hidden.removeEventListener("focus", onHiddenFocus);
|
|
169
|
+
hidden.removeEventListener("input", onHiddenInput);
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
register(element) {
|
|
173
|
+
this.slots.update((list) => [...list, element]);
|
|
174
|
+
return () => this.slots.update((list) => list.filter((slot) => slot !== element));
|
|
175
|
+
}
|
|
176
|
+
characterAt(index) {
|
|
177
|
+
return index < 0 ? "" : Array.from(this.code())[index] ?? "";
|
|
178
|
+
}
|
|
179
|
+
focusSlot(index) {
|
|
180
|
+
this.flush();
|
|
181
|
+
const target = Math.max(0, Math.min(index, untracked(this.code).length, untracked(this.last)));
|
|
182
|
+
const slot = untracked(this.ordered)[target];
|
|
183
|
+
if (slot !== void 0) {
|
|
184
|
+
slot.focus();
|
|
185
|
+
slot.select();
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
commit(index, text, reason, event) {
|
|
189
|
+
if (!this.interactive()) return;
|
|
190
|
+
const length = untracked(this.length);
|
|
191
|
+
const type = untracked(this.validationType);
|
|
192
|
+
const normalized = normalizeOtp(text, length, type);
|
|
193
|
+
if (normalized.rejected) this.valueInvalid.emit({
|
|
194
|
+
value: text,
|
|
195
|
+
details: {
|
|
196
|
+
reason,
|
|
197
|
+
event
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
const current = untracked(this.code);
|
|
201
|
+
if (normalized.value === "") {
|
|
202
|
+
if (reason === "input-change" && text === "") this.setValue(removeOtpCharacter(current, index), "input-clear", event);
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
this.setValue(replaceOtp(current, index, normalized.value, length, type), reason, event);
|
|
206
|
+
this.focusSlot(index + Array.from(normalized.value).length);
|
|
207
|
+
}
|
|
208
|
+
keydown(index, event) {
|
|
209
|
+
if (event.defaultPrevented || untracked(this.isDisabled)) return;
|
|
210
|
+
const length = untracked(this.length);
|
|
211
|
+
const current = untracked(this.code);
|
|
212
|
+
const end = Math.min(current.length, length - 1);
|
|
213
|
+
const boundary = (event.ctrlKey || event.metaKey) && !event.altKey;
|
|
214
|
+
const element = event.currentTarget;
|
|
215
|
+
const rtl = getDirection(element, this.direction()) === "rtl";
|
|
216
|
+
const previousKey = rtl ? "ArrowRight" : "ArrowLeft";
|
|
217
|
+
const nextKey = rtl ? "ArrowLeft" : "ArrowRight";
|
|
218
|
+
const move = (target) => {
|
|
219
|
+
event.preventDefault();
|
|
220
|
+
this.focusSlot(target);
|
|
221
|
+
};
|
|
222
|
+
if (event.key === previousKey) {
|
|
223
|
+
move(boundary ? 0 : Math.max(0, index - 1));
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
if (event.key === nextKey) {
|
|
227
|
+
move(boundary ? end : Math.min(length - 1, index + 1));
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
if (event.key === "Home" || event.key === "ArrowUp") {
|
|
231
|
+
move(0);
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
if (event.key === "End" || event.key === "ArrowDown") {
|
|
235
|
+
move(end);
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
if (untracked(this.readOnly)) return;
|
|
239
|
+
const character = Array.from(current)[index] ?? "";
|
|
240
|
+
if (event.key === "Backspace" && boundary) {
|
|
241
|
+
event.preventDefault();
|
|
242
|
+
this.setValue("", "keyboard", event);
|
|
243
|
+
this.focusSlot(0);
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
if (event.key === "Delete") {
|
|
247
|
+
event.preventDefault();
|
|
248
|
+
this.setValue(removeOtpCharacter(current, index), "keyboard", event);
|
|
249
|
+
this.focusSlot(index);
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
if (event.key === "Backspace") {
|
|
253
|
+
event.preventDefault();
|
|
254
|
+
const target = Math.max(0, index - 1);
|
|
255
|
+
this.setValue(removeOtpCharacter(current, character === "" ? target : index), "keyboard", event);
|
|
256
|
+
this.focusSlot(target);
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
const input = event.currentTarget;
|
|
260
|
+
const selectsAll = input.selectionStart === 0 && input.selectionEnd === input.value.length;
|
|
261
|
+
if (event.key.length === 1 && !boundary && selectsAll && character === event.key) {
|
|
262
|
+
event.preventDefault();
|
|
263
|
+
if (index < length - 1) this.focusSlot(index + 1);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
slotFocused(index, element) {
|
|
267
|
+
if (index > untracked(this.code).length) {
|
|
268
|
+
this.focusSlot(untracked(this.code).length);
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
this.focusedIndex.set(index);
|
|
272
|
+
element.select();
|
|
273
|
+
this.field.focused();
|
|
274
|
+
}
|
|
275
|
+
slotBlurred(related) {
|
|
276
|
+
if (related instanceof Node && this.host.contains(related)) return;
|
|
277
|
+
this.focusedIndex.set(null);
|
|
278
|
+
this.field.blurred();
|
|
279
|
+
}
|
|
280
|
+
syncSlots() {
|
|
281
|
+
this.flush();
|
|
282
|
+
untracked(this.ordered).forEach((slot, index) => {
|
|
283
|
+
const character = this.characterAt(index);
|
|
284
|
+
if (slot.value !== character) slot.value = character;
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
interactive() {
|
|
288
|
+
return !untracked(this.isDisabled) && !untracked(this.readOnly);
|
|
289
|
+
}
|
|
290
|
+
firstEmptySlot() {
|
|
291
|
+
return untracked(this.ordered)[Math.min(untracked(this.code).length, untracked(this.last))] ?? null;
|
|
292
|
+
}
|
|
293
|
+
setValue(next, reason, event) {
|
|
294
|
+
const details = {
|
|
295
|
+
reason,
|
|
296
|
+
event
|
|
297
|
+
};
|
|
298
|
+
const length = untracked(this.length);
|
|
299
|
+
if (next === untracked(this.code)) {
|
|
300
|
+
if (reason === "input-paste" && next.length === length) this.valueComplete.emit({
|
|
301
|
+
value: next,
|
|
302
|
+
details
|
|
303
|
+
});
|
|
304
|
+
return;
|
|
305
|
+
}
|
|
306
|
+
this.own.set(next, details);
|
|
307
|
+
if (next.length === length) this.valueComplete.emit({
|
|
308
|
+
value: next,
|
|
309
|
+
details
|
|
310
|
+
});
|
|
311
|
+
this.flush();
|
|
312
|
+
}
|
|
313
|
+
static {
|
|
314
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
315
|
+
minVersion: "12.0.0",
|
|
316
|
+
version: "22.2.6",
|
|
317
|
+
ngImport: i0,
|
|
318
|
+
type: OTPFieldRoot,
|
|
319
|
+
deps: [],
|
|
320
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
static {
|
|
324
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
325
|
+
minVersion: "17.1.0",
|
|
326
|
+
version: "22.2.6",
|
|
327
|
+
type: OTPFieldRoot,
|
|
328
|
+
isStandalone: true,
|
|
329
|
+
selector: "[otpFieldRoot]",
|
|
330
|
+
inputs: {
|
|
331
|
+
length: {
|
|
332
|
+
classPropertyName: "length",
|
|
333
|
+
publicName: "length",
|
|
334
|
+
isSignal: true,
|
|
335
|
+
isRequired: true,
|
|
336
|
+
transformFunction: null
|
|
337
|
+
},
|
|
338
|
+
value: {
|
|
339
|
+
classPropertyName: "value",
|
|
340
|
+
publicName: "value",
|
|
341
|
+
isSignal: true,
|
|
342
|
+
isRequired: false,
|
|
343
|
+
transformFunction: null
|
|
344
|
+
},
|
|
345
|
+
defaultValue: {
|
|
346
|
+
classPropertyName: "defaultValue",
|
|
347
|
+
publicName: "defaultValue",
|
|
348
|
+
isSignal: true,
|
|
349
|
+
isRequired: false,
|
|
350
|
+
transformFunction: null
|
|
351
|
+
},
|
|
352
|
+
validationType: {
|
|
353
|
+
classPropertyName: "validationType",
|
|
354
|
+
publicName: "validationType",
|
|
355
|
+
isSignal: true,
|
|
356
|
+
isRequired: false,
|
|
357
|
+
transformFunction: null
|
|
358
|
+
},
|
|
359
|
+
mask: {
|
|
360
|
+
classPropertyName: "mask",
|
|
361
|
+
publicName: "mask",
|
|
362
|
+
isSignal: true,
|
|
363
|
+
isRequired: false,
|
|
364
|
+
transformFunction: null
|
|
365
|
+
},
|
|
366
|
+
autoComplete: {
|
|
367
|
+
classPropertyName: "autoComplete",
|
|
368
|
+
publicName: "autoComplete",
|
|
369
|
+
isSignal: true,
|
|
370
|
+
isRequired: false,
|
|
371
|
+
transformFunction: null
|
|
372
|
+
},
|
|
373
|
+
inputMode: {
|
|
374
|
+
classPropertyName: "inputMode",
|
|
375
|
+
publicName: "inputMode",
|
|
376
|
+
isSignal: true,
|
|
377
|
+
isRequired: false,
|
|
378
|
+
transformFunction: null
|
|
379
|
+
},
|
|
380
|
+
required: {
|
|
381
|
+
classPropertyName: "required",
|
|
382
|
+
publicName: "required",
|
|
383
|
+
isSignal: true,
|
|
384
|
+
isRequired: false,
|
|
385
|
+
transformFunction: null
|
|
386
|
+
},
|
|
387
|
+
readOnly: {
|
|
388
|
+
classPropertyName: "readOnly",
|
|
389
|
+
publicName: "readOnly",
|
|
390
|
+
isSignal: true,
|
|
391
|
+
isRequired: false,
|
|
392
|
+
transformFunction: null
|
|
393
|
+
},
|
|
394
|
+
disabled: {
|
|
395
|
+
classPropertyName: "disabled",
|
|
396
|
+
publicName: "disabled",
|
|
397
|
+
isSignal: true,
|
|
398
|
+
isRequired: false,
|
|
399
|
+
transformFunction: null
|
|
400
|
+
},
|
|
401
|
+
name: {
|
|
402
|
+
classPropertyName: "name",
|
|
403
|
+
publicName: "name",
|
|
404
|
+
isSignal: true,
|
|
405
|
+
isRequired: false,
|
|
406
|
+
transformFunction: null
|
|
407
|
+
},
|
|
408
|
+
id: {
|
|
409
|
+
classPropertyName: "id",
|
|
410
|
+
publicName: "id",
|
|
411
|
+
isSignal: true,
|
|
412
|
+
isRequired: false,
|
|
413
|
+
transformFunction: null
|
|
414
|
+
}
|
|
415
|
+
},
|
|
416
|
+
outputs: {
|
|
417
|
+
valueChange: "valueChange",
|
|
418
|
+
valueChangeDetails: "valueChangeDetails",
|
|
419
|
+
valueComplete: "valueComplete",
|
|
420
|
+
valueInvalid: "valueInvalid"
|
|
421
|
+
},
|
|
422
|
+
host: {
|
|
423
|
+
attributes: {
|
|
424
|
+
"role": "group",
|
|
425
|
+
"data-primitives-part": "otp-field-root"
|
|
426
|
+
},
|
|
427
|
+
properties: {
|
|
428
|
+
"attr.data-disabled": "data().disabled",
|
|
429
|
+
"attr.data-readonly": "data().readonly",
|
|
430
|
+
"attr.data-required": "data().required",
|
|
431
|
+
"attr.data-complete": "data().complete",
|
|
432
|
+
"attr.data-invalid": "data().invalid",
|
|
433
|
+
"attr.data-valid": "data().valid",
|
|
434
|
+
"attr.data-dirty": "data().dirty",
|
|
435
|
+
"attr.data-touched": "data().touched",
|
|
436
|
+
"attr.data-filled": "data().filled",
|
|
437
|
+
"attr.data-focused": "data().focused"
|
|
438
|
+
}
|
|
439
|
+
},
|
|
440
|
+
exportAs: ["otpFieldRoot"],
|
|
441
|
+
ngImport: i0
|
|
442
|
+
});
|
|
443
|
+
}
|
|
444
|
+
};
|
|
445
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
446
|
+
minVersion: "12.0.0",
|
|
447
|
+
version: "22.2.6",
|
|
448
|
+
ngImport: i0,
|
|
449
|
+
type: OTPFieldRoot,
|
|
450
|
+
decorators: [{
|
|
451
|
+
type: Directive,
|
|
452
|
+
args: [{
|
|
453
|
+
selector: "[otpFieldRoot]",
|
|
454
|
+
exportAs: "otpFieldRoot",
|
|
455
|
+
host: {
|
|
456
|
+
role: "group",
|
|
457
|
+
"data-primitives-part": "otp-field-root",
|
|
458
|
+
"[attr.data-disabled]": "data().disabled",
|
|
459
|
+
"[attr.data-readonly]": "data().readonly",
|
|
460
|
+
"[attr.data-required]": "data().required",
|
|
461
|
+
"[attr.data-complete]": "data().complete",
|
|
462
|
+
"[attr.data-invalid]": "data().invalid",
|
|
463
|
+
"[attr.data-valid]": "data().valid",
|
|
464
|
+
"[attr.data-dirty]": "data().dirty",
|
|
465
|
+
"[attr.data-touched]": "data().touched",
|
|
466
|
+
"[attr.data-filled]": "data().filled",
|
|
467
|
+
"[attr.data-focused]": "data().focused"
|
|
468
|
+
}
|
|
469
|
+
}]
|
|
470
|
+
}],
|
|
471
|
+
ctorParameters: () => [],
|
|
472
|
+
propDecorators: {
|
|
473
|
+
length: [{
|
|
474
|
+
type: i0.Input,
|
|
475
|
+
args: [{
|
|
476
|
+
isSignal: true,
|
|
477
|
+
alias: "length",
|
|
478
|
+
required: true
|
|
479
|
+
}]
|
|
480
|
+
}],
|
|
481
|
+
value: [{
|
|
482
|
+
type: i0.Input,
|
|
483
|
+
args: [{
|
|
484
|
+
isSignal: true,
|
|
485
|
+
alias: "value",
|
|
486
|
+
required: false
|
|
487
|
+
}]
|
|
488
|
+
}],
|
|
489
|
+
valueChange: [{
|
|
490
|
+
type: i0.Output,
|
|
491
|
+
args: ["valueChange"]
|
|
492
|
+
}],
|
|
493
|
+
defaultValue: [{
|
|
494
|
+
type: i0.Input,
|
|
495
|
+
args: [{
|
|
496
|
+
isSignal: true,
|
|
497
|
+
alias: "defaultValue",
|
|
498
|
+
required: false
|
|
499
|
+
}]
|
|
500
|
+
}],
|
|
501
|
+
valueChangeDetails: [{
|
|
502
|
+
type: i0.Output,
|
|
503
|
+
args: ["valueChangeDetails"]
|
|
504
|
+
}],
|
|
505
|
+
valueComplete: [{
|
|
506
|
+
type: i0.Output,
|
|
507
|
+
args: ["valueComplete"]
|
|
508
|
+
}],
|
|
509
|
+
valueInvalid: [{
|
|
510
|
+
type: i0.Output,
|
|
511
|
+
args: ["valueInvalid"]
|
|
512
|
+
}],
|
|
513
|
+
validationType: [{
|
|
514
|
+
type: i0.Input,
|
|
515
|
+
args: [{
|
|
516
|
+
isSignal: true,
|
|
517
|
+
alias: "validationType",
|
|
518
|
+
required: false
|
|
519
|
+
}]
|
|
520
|
+
}],
|
|
521
|
+
mask: [{
|
|
522
|
+
type: i0.Input,
|
|
523
|
+
args: [{
|
|
524
|
+
isSignal: true,
|
|
525
|
+
alias: "mask",
|
|
526
|
+
required: false
|
|
527
|
+
}]
|
|
528
|
+
}],
|
|
529
|
+
autoComplete: [{
|
|
530
|
+
type: i0.Input,
|
|
531
|
+
args: [{
|
|
532
|
+
isSignal: true,
|
|
533
|
+
alias: "autoComplete",
|
|
534
|
+
required: false
|
|
535
|
+
}]
|
|
536
|
+
}],
|
|
537
|
+
inputMode: [{
|
|
538
|
+
type: i0.Input,
|
|
539
|
+
args: [{
|
|
540
|
+
isSignal: true,
|
|
541
|
+
alias: "inputMode",
|
|
542
|
+
required: false
|
|
543
|
+
}]
|
|
544
|
+
}],
|
|
545
|
+
required: [{
|
|
546
|
+
type: i0.Input,
|
|
547
|
+
args: [{
|
|
548
|
+
isSignal: true,
|
|
549
|
+
alias: "required",
|
|
550
|
+
required: false
|
|
551
|
+
}]
|
|
552
|
+
}],
|
|
553
|
+
readOnly: [{
|
|
554
|
+
type: i0.Input,
|
|
555
|
+
args: [{
|
|
556
|
+
isSignal: true,
|
|
557
|
+
alias: "readOnly",
|
|
558
|
+
required: false
|
|
559
|
+
}]
|
|
560
|
+
}],
|
|
561
|
+
disabled: [{
|
|
562
|
+
type: i0.Input,
|
|
563
|
+
args: [{
|
|
564
|
+
isSignal: true,
|
|
565
|
+
alias: "disabled",
|
|
566
|
+
required: false
|
|
567
|
+
}]
|
|
568
|
+
}],
|
|
569
|
+
name: [{
|
|
570
|
+
type: i0.Input,
|
|
571
|
+
args: [{
|
|
572
|
+
isSignal: true,
|
|
573
|
+
alias: "name",
|
|
574
|
+
required: false
|
|
575
|
+
}]
|
|
576
|
+
}],
|
|
577
|
+
id: [{
|
|
578
|
+
type: i0.Input,
|
|
579
|
+
args: [{
|
|
580
|
+
isSignal: true,
|
|
581
|
+
alias: "id",
|
|
582
|
+
required: false
|
|
583
|
+
}]
|
|
584
|
+
}]
|
|
585
|
+
}
|
|
586
|
+
});
|
|
587
|
+
var OTPFieldInput = class OTPFieldInput {
|
|
588
|
+
constructor() {
|
|
589
|
+
this.root = inject(OTPFieldRoot);
|
|
590
|
+
this.host = injectHost();
|
|
591
|
+
this.rendered = signal(false, ...ngDevMode ? [{ debugName: "rendered" }] : /* istanbul ignore next */ []);
|
|
592
|
+
this.index = computed(() => this.rendered() ? this.root.ordered().indexOf(this.host) : -1, ...ngDevMode ? [{ debugName: "index" }] : /* istanbul ignore next */ []);
|
|
593
|
+
this.known = computed(() => this.index() >= 0, ...ngDevMode ? [{ debugName: "known" }] : /* istanbul ignore next */ []);
|
|
594
|
+
this.state = computed(() => {
|
|
595
|
+
const index = this.index();
|
|
596
|
+
const character = this.root.characterAt(index);
|
|
597
|
+
return {
|
|
598
|
+
...this.root.state(),
|
|
599
|
+
index,
|
|
600
|
+
character,
|
|
601
|
+
filled: character !== ""
|
|
602
|
+
};
|
|
603
|
+
}, ...ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []);
|
|
604
|
+
this.slotId = computed(() => {
|
|
605
|
+
const index = this.index();
|
|
606
|
+
if (index < 0) return null;
|
|
607
|
+
const id = this.root.slotId();
|
|
608
|
+
return index === 0 ? id : `${id}-${index + 1}`;
|
|
609
|
+
}, ...ngDevMode ? [{ debugName: "slotId" }] : /* istanbul ignore next */ []);
|
|
610
|
+
this.tabIndex = computed(() => this.known() && this.index() === this.root.activeIndex() ? "0" : "-1", ...ngDevMode ? [{ debugName: "tabIndex" }] : /* istanbul ignore next */ []);
|
|
611
|
+
const host = this.host;
|
|
612
|
+
writeSlotLabelledBy(this.root.field, host);
|
|
613
|
+
afterNextRender(() => this.rendered.set(true));
|
|
614
|
+
effect((onCleanup) => {
|
|
615
|
+
if (this.rendered()) onCleanup(untracked(() => this.root.register(host)));
|
|
616
|
+
});
|
|
617
|
+
}
|
|
618
|
+
onMouseDown(event) {
|
|
619
|
+
if (event.button !== 0 || this.root.isDisabled() || !this.known()) return;
|
|
620
|
+
event.preventDefault();
|
|
621
|
+
this.root.focusSlot(this.index());
|
|
622
|
+
}
|
|
623
|
+
onFocus() {
|
|
624
|
+
if (this.known()) this.root.slotFocused(this.index(), this.host);
|
|
625
|
+
}
|
|
626
|
+
onInput(event) {
|
|
627
|
+
if (!this.known()) return;
|
|
628
|
+
this.root.commit(this.index(), this.host.value, "input-change", event);
|
|
629
|
+
this.root.syncSlots();
|
|
630
|
+
}
|
|
631
|
+
onPaste(event) {
|
|
632
|
+
if (!this.known() || this.root.isDisabled() || this.root.readOnly()) return;
|
|
633
|
+
event.preventDefault();
|
|
634
|
+
this.root.commit(this.index(), event.clipboardData?.getData("text/plain") ?? "", "input-paste", event);
|
|
635
|
+
}
|
|
636
|
+
onKeyDown(event) {
|
|
637
|
+
if (this.known()) this.root.keydown(this.index(), event);
|
|
638
|
+
}
|
|
639
|
+
static {
|
|
640
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
641
|
+
minVersion: "12.0.0",
|
|
642
|
+
version: "22.2.6",
|
|
643
|
+
ngImport: i0,
|
|
644
|
+
type: OTPFieldInput,
|
|
645
|
+
deps: [],
|
|
646
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
647
|
+
});
|
|
648
|
+
}
|
|
649
|
+
static {
|
|
650
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
651
|
+
minVersion: "14.0.0",
|
|
652
|
+
version: "22.2.6",
|
|
653
|
+
type: OTPFieldInput,
|
|
654
|
+
isStandalone: true,
|
|
655
|
+
selector: "input[otpFieldInput]",
|
|
656
|
+
host: {
|
|
657
|
+
attributes: {
|
|
658
|
+
"autocorrect": "off",
|
|
659
|
+
"spellcheck": "false",
|
|
660
|
+
"data-primitives-part": "otp-field-input"
|
|
661
|
+
},
|
|
662
|
+
listeners: {
|
|
663
|
+
"mousedown": "onMouseDown($event)",
|
|
664
|
+
"focus": "onFocus()",
|
|
665
|
+
"blur": "root.slotBlurred($event.relatedTarget)",
|
|
666
|
+
"input": "onInput($event)",
|
|
667
|
+
"paste": "onPaste($event)",
|
|
668
|
+
"keydown": "onKeyDown($event)"
|
|
669
|
+
},
|
|
670
|
+
properties: {
|
|
671
|
+
"attr.id": "slotId()",
|
|
672
|
+
"attr.type": "root.mask() ? 'password' : 'text'",
|
|
673
|
+
"attr.inputmode": "root.slotInputMode()",
|
|
674
|
+
"attr.autocomplete": "state().index === 0 ? root.autoComplete() : 'off'",
|
|
675
|
+
"attr.enterkeyhint": "state().index === state().length - 1 ? 'done' : 'next'",
|
|
676
|
+
"attr.maxlength": "state().index === 0 ? state().length : null",
|
|
677
|
+
"attr.tabindex": "tabIndex()",
|
|
678
|
+
"value": "state().character",
|
|
679
|
+
"attr.value": "state().character",
|
|
680
|
+
"attr.disabled": "root.data().disabled",
|
|
681
|
+
"attr.readonly": "root.data().readonly",
|
|
682
|
+
"attr.aria-invalid": "root.field.ariaInvalid()",
|
|
683
|
+
"attr.data-disabled": "root.data().disabled",
|
|
684
|
+
"attr.data-readonly": "root.data().readonly",
|
|
685
|
+
"attr.data-required": "root.data().required",
|
|
686
|
+
"attr.data-complete": "root.data().complete",
|
|
687
|
+
"attr.data-invalid": "root.data().invalid",
|
|
688
|
+
"attr.data-valid": "root.data().valid",
|
|
689
|
+
"attr.data-dirty": "root.data().dirty",
|
|
690
|
+
"attr.data-touched": "root.data().touched",
|
|
691
|
+
"attr.data-focused": "root.data().focused",
|
|
692
|
+
"attr.data-filled": "state().filled ? '' : null",
|
|
693
|
+
"attr.data-index": "known() ? state().index : null"
|
|
694
|
+
}
|
|
695
|
+
},
|
|
696
|
+
exportAs: ["otpFieldInput"],
|
|
697
|
+
ngImport: i0
|
|
698
|
+
});
|
|
699
|
+
}
|
|
700
|
+
};
|
|
701
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
702
|
+
minVersion: "12.0.0",
|
|
703
|
+
version: "22.2.6",
|
|
704
|
+
ngImport: i0,
|
|
705
|
+
type: OTPFieldInput,
|
|
706
|
+
decorators: [{
|
|
707
|
+
type: Directive,
|
|
708
|
+
args: [{
|
|
709
|
+
selector: "input[otpFieldInput]",
|
|
710
|
+
exportAs: "otpFieldInput",
|
|
711
|
+
host: {
|
|
712
|
+
autocorrect: "off",
|
|
713
|
+
spellcheck: "false",
|
|
714
|
+
"data-primitives-part": "otp-field-input",
|
|
715
|
+
"[attr.id]": "slotId()",
|
|
716
|
+
"[attr.type]": "root.mask() ? 'password' : 'text'",
|
|
717
|
+
"[attr.inputmode]": "root.slotInputMode()",
|
|
718
|
+
"[attr.autocomplete]": "state().index === 0 ? root.autoComplete() : 'off'",
|
|
719
|
+
"[attr.enterkeyhint]": "state().index === state().length - 1 ? 'done' : 'next'",
|
|
720
|
+
"[attr.maxlength]": "state().index === 0 ? state().length : null",
|
|
721
|
+
"[attr.tabindex]": "tabIndex()",
|
|
722
|
+
"[value]": "state().character",
|
|
723
|
+
"[attr.value]": "state().character",
|
|
724
|
+
"[attr.disabled]": "root.data().disabled",
|
|
725
|
+
"[attr.readonly]": "root.data().readonly",
|
|
726
|
+
"[attr.aria-invalid]": "root.field.ariaInvalid()",
|
|
727
|
+
"[attr.data-disabled]": "root.data().disabled",
|
|
728
|
+
"[attr.data-readonly]": "root.data().readonly",
|
|
729
|
+
"[attr.data-required]": "root.data().required",
|
|
730
|
+
"[attr.data-complete]": "root.data().complete",
|
|
731
|
+
"[attr.data-invalid]": "root.data().invalid",
|
|
732
|
+
"[attr.data-valid]": "root.data().valid",
|
|
733
|
+
"[attr.data-dirty]": "root.data().dirty",
|
|
734
|
+
"[attr.data-touched]": "root.data().touched",
|
|
735
|
+
"[attr.data-focused]": "root.data().focused",
|
|
736
|
+
"[attr.data-filled]": "state().filled ? '' : null",
|
|
737
|
+
"[attr.data-index]": "known() ? state().index : null",
|
|
738
|
+
"(mousedown)": "onMouseDown($event)",
|
|
739
|
+
"(focus)": "onFocus()",
|
|
740
|
+
"(blur)": "root.slotBlurred($event.relatedTarget)",
|
|
741
|
+
"(input)": "onInput($event)",
|
|
742
|
+
"(paste)": "onPaste($event)",
|
|
743
|
+
"(keydown)": "onKeyDown($event)"
|
|
744
|
+
}
|
|
745
|
+
}]
|
|
746
|
+
}],
|
|
747
|
+
ctorParameters: () => []
|
|
748
|
+
});
|
|
749
|
+
export { OTPFieldInput, OTPFieldRoot };
|
|
750
|
+
|
|
751
|
+
//# sourceMappingURL=fragiola-primitives-angular-otp-field.mjs.map
|