@fragiola/primitives-angular 0.0.0-stage → 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +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,1090 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { DestroyRef, Directive, PLATFORM_ID, afterNextRender, afterRenderEffect, booleanAttribute, computed, effect, inject, input, output, signal, untracked } from "@angular/core";
|
|
3
|
+
import { getDirection } from "@fragiola/primitives/direction";
|
|
4
|
+
import { startDrag } from "@fragiola/primitives/pointer";
|
|
5
|
+
import { fractionAlong, moveThumb, nearestThumb, sliderKeyTarget, thumbBounds, valueAtFraction, valueToPercent } from "@fragiola/primitives/range";
|
|
6
|
+
import { controllable, dataValues, injectFlush, injectHost, injectId, injectProvidedDirection, labelId, ownAttribute } from "@fragiola/primitives-angular/internal";
|
|
7
|
+
import { bridgeForm } from "@fragiola/primitives/form";
|
|
8
|
+
import { fieldControl, writeFieldAria } from "@fragiola/primitives-angular/field";
|
|
9
|
+
function writeLabelledBy(host, namers) {
|
|
10
|
+
if (ownAttribute("aria-labelledby") !== null) return;
|
|
11
|
+
let wrote = false;
|
|
12
|
+
effect(() => {
|
|
13
|
+
const id = firstId(namers);
|
|
14
|
+
if (id) {
|
|
15
|
+
host.setAttribute("aria-labelledby", id);
|
|
16
|
+
wrote = true;
|
|
17
|
+
} else if (wrote) {
|
|
18
|
+
host.removeAttribute("aria-labelledby");
|
|
19
|
+
wrote = false;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function writeThumbLabelledBy(host, namers) {
|
|
24
|
+
const names = signal(0, ...ngDevMode ? [{ debugName: "names" }] : /* istanbul ignore next */ []);
|
|
25
|
+
const Observer = host.ownerDocument.defaultView?.MutationObserver;
|
|
26
|
+
if (Observer !== void 0) {
|
|
27
|
+
const observer = new Observer(() => names.update((count) => count + 1));
|
|
28
|
+
observer.observe(host, {
|
|
29
|
+
attributes: true,
|
|
30
|
+
attributeFilter: ["aria-label", "aria-labelledby"]
|
|
31
|
+
});
|
|
32
|
+
inject(DestroyRef).onDestroy(() => observer.disconnect());
|
|
33
|
+
}
|
|
34
|
+
let written = null;
|
|
35
|
+
effect(() => {
|
|
36
|
+
names();
|
|
37
|
+
const id = firstId(namers);
|
|
38
|
+
untracked(() => {
|
|
39
|
+
const current = host.getAttribute("aria-labelledby");
|
|
40
|
+
if (host.hasAttribute("aria-label") || current !== null && current !== written && current !== id || !id) {
|
|
41
|
+
if (written !== null && current === written) host.removeAttribute("aria-labelledby");
|
|
42
|
+
written = null;
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
if (current !== id) host.setAttribute("aria-labelledby", id);
|
|
46
|
+
written = id;
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
function firstId(namers) {
|
|
51
|
+
return namers.map((namer) => namer()).find((value) => value);
|
|
52
|
+
}
|
|
53
|
+
function toArray(value) {
|
|
54
|
+
return typeof value === "number" ? [value] : value;
|
|
55
|
+
}
|
|
56
|
+
function sameValues(a, b) {
|
|
57
|
+
return a.length === b.length && a.every((entry, index) => entry === b[index]);
|
|
58
|
+
}
|
|
59
|
+
var SliderRoot = class SliderRoot {
|
|
60
|
+
constructor() {
|
|
61
|
+
this.value = input(void 0, ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
|
|
62
|
+
this.valueChange = output();
|
|
63
|
+
this.defaultValue = input(void 0, ...ngDevMode ? [{ debugName: "defaultValue" }] : /* istanbul ignore next */ []);
|
|
64
|
+
this.valueChangeDetails = output();
|
|
65
|
+
this.valueCommit = output();
|
|
66
|
+
this.min = input(0, ...ngDevMode ? [{ debugName: "min" }] : /* istanbul ignore next */ []);
|
|
67
|
+
this.max = input(100, ...ngDevMode ? [{ debugName: "max" }] : /* istanbul ignore next */ []);
|
|
68
|
+
this.step = input(1, ...ngDevMode ? [{ debugName: "step" }] : /* istanbul ignore next */ []);
|
|
69
|
+
this.largeStep = input(10, ...ngDevMode ? [{ debugName: "largeStep" }] : /* istanbul ignore next */ []);
|
|
70
|
+
this.minStepsBetweenValues = input(0, ...ngDevMode ? [{ debugName: "minStepsBetweenValues" }] : /* istanbul ignore next */ []);
|
|
71
|
+
this.orientation = input("horizontal", ...ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []);
|
|
72
|
+
this.disabled = input(false, {
|
|
73
|
+
...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
|
|
74
|
+
transform: booleanAttribute
|
|
75
|
+
});
|
|
76
|
+
this.name = input(void 0, ...ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []);
|
|
77
|
+
this.format = input(void 0, ...ngDevMode ? [{ debugName: "format" }] : /* istanbul ignore next */ []);
|
|
78
|
+
this.locale = input(void 0, ...ngDevMode ? [{ debugName: "locale" }] : /* istanbul ignore next */ []);
|
|
79
|
+
this.range = computed(() => Array.isArray(this.value() ?? this.defaultValue()), ...ngDevMode ? [{ debugName: "range" }] : /* istanbul ignore next */ []);
|
|
80
|
+
this.current = controllable(computed(() => {
|
|
81
|
+
const value = this.value();
|
|
82
|
+
return value === void 0 ? void 0 : toArray(value);
|
|
83
|
+
}), { emit: (next) => this.valueChange.emit(this.shape(next)) }, () => toArray(this.defaultValue() ?? this.min()), (next, details) => this.valueChangeDetails.emit({
|
|
84
|
+
value: this.shape(next),
|
|
85
|
+
details
|
|
86
|
+
}));
|
|
87
|
+
this.values = this.current.value;
|
|
88
|
+
this.inputs = [];
|
|
89
|
+
this.field = fieldControl({
|
|
90
|
+
id: signal(void 0),
|
|
91
|
+
labelable: false,
|
|
92
|
+
value: computed(() => {
|
|
93
|
+
const values = this.values();
|
|
94
|
+
return this.range() ? [...values] : values[0] ?? 0;
|
|
95
|
+
}),
|
|
96
|
+
filled: signal(true),
|
|
97
|
+
input: () => this.inputs[0] ?? null,
|
|
98
|
+
focusTarget: () => untracked(this.thumbs)[0] ?? null
|
|
99
|
+
});
|
|
100
|
+
this.isDisabled = computed(() => this.disabled() || this.field.disabled(), ...ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []);
|
|
101
|
+
this.dragging = signal(false, ...ngDevMode ? [{ debugName: "dragging" }] : /* istanbul ignore next */ []);
|
|
102
|
+
this.activeIndex = signal(-1, ...ngDevMode ? [{ debugName: "activeIndex" }] : /* istanbul ignore next */ []);
|
|
103
|
+
this.thumbs = signal([], ...ngDevMode ? [{ debugName: "thumbs" }] : /* istanbul ignore next */ []);
|
|
104
|
+
this.thumbIds = signal({}, ...ngDevMode ? [{ debugName: "thumbIds" }] : /* istanbul ignore next */ []);
|
|
105
|
+
this.labelId = signal(void 0, ...ngDevMode ? [{ debugName: "labelId" }] : /* istanbul ignore next */ []);
|
|
106
|
+
this.providedDirection = injectProvidedDirection();
|
|
107
|
+
this.formatter = computed(() => {
|
|
108
|
+
const format = this.format();
|
|
109
|
+
return format === void 0 ? null : new Intl.NumberFormat(this.locale(), format);
|
|
110
|
+
}, ...ngDevMode ? [{ debugName: "formatter" }] : /* istanbul ignore next */ []);
|
|
111
|
+
this.formattedValues = computed(() => {
|
|
112
|
+
const formatter = this.formatter();
|
|
113
|
+
return this.values().map((value) => formatter?.format(value) ?? String(value));
|
|
114
|
+
}, ...ngDevMode ? [{ debugName: "formattedValues" }] : /* istanbul ignore next */ []);
|
|
115
|
+
this.state = computed(() => ({
|
|
116
|
+
orientation: this.orientation(),
|
|
117
|
+
disabled: this.isDisabled(),
|
|
118
|
+
dragging: this.dragging()
|
|
119
|
+
}), ...ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []);
|
|
120
|
+
this.data = computed(() => dataValues(this.state()), ...ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []);
|
|
121
|
+
const host = injectHost();
|
|
122
|
+
writeLabelledBy(host, [this.field.labelledBy, this.labelId]);
|
|
123
|
+
const inputs = this.inputs;
|
|
124
|
+
const browser = inject(PLATFORM_ID) === "browser";
|
|
125
|
+
effect(() => {
|
|
126
|
+
if (!browser) return;
|
|
127
|
+
const values = this.values();
|
|
128
|
+
const name = this.field.name() ?? this.name();
|
|
129
|
+
untracked(() => {
|
|
130
|
+
while (inputs.length > values.length) inputs.pop()?.remove();
|
|
131
|
+
while (inputs.length < values.length) {
|
|
132
|
+
const input = host.ownerDocument.createElement("input");
|
|
133
|
+
input.type = "hidden";
|
|
134
|
+
input.setAttribute("data-primitives-part", "slider-input");
|
|
135
|
+
host.appendChild(input);
|
|
136
|
+
inputs.push(input);
|
|
137
|
+
}
|
|
138
|
+
values.forEach((value, index) => {
|
|
139
|
+
const input = inputs[index];
|
|
140
|
+
input.value = String(value);
|
|
141
|
+
if (name === void 0) input.removeAttribute("name");
|
|
142
|
+
else input.name = name;
|
|
143
|
+
});
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
let stop = null;
|
|
147
|
+
afterNextRender(() => {
|
|
148
|
+
const first = inputs[0];
|
|
149
|
+
if (first !== void 0) stop = bridgeForm(first, { reset: () => {
|
|
150
|
+
const initial = toArray(this.defaultValue() ?? this.min());
|
|
151
|
+
if (!sameValues(initial, untracked(this.values))) {
|
|
152
|
+
this.field.reset();
|
|
153
|
+
this.current.set(initial, { reason: "none" });
|
|
154
|
+
}
|
|
155
|
+
} });
|
|
156
|
+
});
|
|
157
|
+
inject(DestroyRef).onDestroy(() => stop?.());
|
|
158
|
+
}
|
|
159
|
+
valueText(value) {
|
|
160
|
+
const formatter = this.formatter();
|
|
161
|
+
return formatter === null ? null : formatter.format(value);
|
|
162
|
+
}
|
|
163
|
+
shape(values) {
|
|
164
|
+
return untracked(this.range) ? [...values] : values[0] ?? 0;
|
|
165
|
+
}
|
|
166
|
+
setThumb(index, value, reason) {
|
|
167
|
+
const before = untracked(this.values);
|
|
168
|
+
const next = moveThumb(before, index, value, {
|
|
169
|
+
min: this.min(),
|
|
170
|
+
max: this.max(),
|
|
171
|
+
step: this.step(),
|
|
172
|
+
minStepsBetweenValues: this.minStepsBetweenValues()
|
|
173
|
+
});
|
|
174
|
+
if (!sameValues(next, before)) this.current.set(next, { reason });
|
|
175
|
+
return next;
|
|
176
|
+
}
|
|
177
|
+
commit(values) {
|
|
178
|
+
this.valueCommit.emit(this.shape(values ?? untracked(this.values)));
|
|
179
|
+
}
|
|
180
|
+
registerThumb(element) {
|
|
181
|
+
this.thumbs.update((list) => [...list.filter((entry) => entry !== element), element].sort((a, b) => a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1));
|
|
182
|
+
return () => this.thumbs.update((list) => list.filter((entry) => entry !== element));
|
|
183
|
+
}
|
|
184
|
+
static {
|
|
185
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
186
|
+
minVersion: "12.0.0",
|
|
187
|
+
version: "22.2.6",
|
|
188
|
+
ngImport: i0,
|
|
189
|
+
type: SliderRoot,
|
|
190
|
+
deps: [],
|
|
191
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
static {
|
|
195
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
196
|
+
minVersion: "17.1.0",
|
|
197
|
+
version: "22.2.6",
|
|
198
|
+
type: SliderRoot,
|
|
199
|
+
isStandalone: true,
|
|
200
|
+
selector: "[sliderRoot]",
|
|
201
|
+
inputs: {
|
|
202
|
+
value: {
|
|
203
|
+
classPropertyName: "value",
|
|
204
|
+
publicName: "value",
|
|
205
|
+
isSignal: true,
|
|
206
|
+
isRequired: false,
|
|
207
|
+
transformFunction: null
|
|
208
|
+
},
|
|
209
|
+
defaultValue: {
|
|
210
|
+
classPropertyName: "defaultValue",
|
|
211
|
+
publicName: "defaultValue",
|
|
212
|
+
isSignal: true,
|
|
213
|
+
isRequired: false,
|
|
214
|
+
transformFunction: null
|
|
215
|
+
},
|
|
216
|
+
min: {
|
|
217
|
+
classPropertyName: "min",
|
|
218
|
+
publicName: "min",
|
|
219
|
+
isSignal: true,
|
|
220
|
+
isRequired: false,
|
|
221
|
+
transformFunction: null
|
|
222
|
+
},
|
|
223
|
+
max: {
|
|
224
|
+
classPropertyName: "max",
|
|
225
|
+
publicName: "max",
|
|
226
|
+
isSignal: true,
|
|
227
|
+
isRequired: false,
|
|
228
|
+
transformFunction: null
|
|
229
|
+
},
|
|
230
|
+
step: {
|
|
231
|
+
classPropertyName: "step",
|
|
232
|
+
publicName: "step",
|
|
233
|
+
isSignal: true,
|
|
234
|
+
isRequired: false,
|
|
235
|
+
transformFunction: null
|
|
236
|
+
},
|
|
237
|
+
largeStep: {
|
|
238
|
+
classPropertyName: "largeStep",
|
|
239
|
+
publicName: "largeStep",
|
|
240
|
+
isSignal: true,
|
|
241
|
+
isRequired: false,
|
|
242
|
+
transformFunction: null
|
|
243
|
+
},
|
|
244
|
+
minStepsBetweenValues: {
|
|
245
|
+
classPropertyName: "minStepsBetweenValues",
|
|
246
|
+
publicName: "minStepsBetweenValues",
|
|
247
|
+
isSignal: true,
|
|
248
|
+
isRequired: false,
|
|
249
|
+
transformFunction: null
|
|
250
|
+
},
|
|
251
|
+
orientation: {
|
|
252
|
+
classPropertyName: "orientation",
|
|
253
|
+
publicName: "orientation",
|
|
254
|
+
isSignal: true,
|
|
255
|
+
isRequired: false,
|
|
256
|
+
transformFunction: null
|
|
257
|
+
},
|
|
258
|
+
disabled: {
|
|
259
|
+
classPropertyName: "disabled",
|
|
260
|
+
publicName: "disabled",
|
|
261
|
+
isSignal: true,
|
|
262
|
+
isRequired: false,
|
|
263
|
+
transformFunction: null
|
|
264
|
+
},
|
|
265
|
+
name: {
|
|
266
|
+
classPropertyName: "name",
|
|
267
|
+
publicName: "name",
|
|
268
|
+
isSignal: true,
|
|
269
|
+
isRequired: false,
|
|
270
|
+
transformFunction: null
|
|
271
|
+
},
|
|
272
|
+
format: {
|
|
273
|
+
classPropertyName: "format",
|
|
274
|
+
publicName: "format",
|
|
275
|
+
isSignal: true,
|
|
276
|
+
isRequired: false,
|
|
277
|
+
transformFunction: null
|
|
278
|
+
},
|
|
279
|
+
locale: {
|
|
280
|
+
classPropertyName: "locale",
|
|
281
|
+
publicName: "locale",
|
|
282
|
+
isSignal: true,
|
|
283
|
+
isRequired: false,
|
|
284
|
+
transformFunction: null
|
|
285
|
+
}
|
|
286
|
+
},
|
|
287
|
+
outputs: {
|
|
288
|
+
valueChange: "valueChange",
|
|
289
|
+
valueChangeDetails: "valueChangeDetails",
|
|
290
|
+
valueCommit: "valueCommit"
|
|
291
|
+
},
|
|
292
|
+
host: {
|
|
293
|
+
attributes: {
|
|
294
|
+
"role": "group",
|
|
295
|
+
"data-primitives-part": "slider-root"
|
|
296
|
+
},
|
|
297
|
+
properties: {
|
|
298
|
+
"attr.data-invalid": "field.data().invalid",
|
|
299
|
+
"attr.data-valid": "field.data().valid",
|
|
300
|
+
"attr.data-dirty": "field.data().dirty",
|
|
301
|
+
"attr.data-touched": "field.data().touched",
|
|
302
|
+
"attr.data-filled": "field.data().filled",
|
|
303
|
+
"attr.data-focused": "field.data().focused",
|
|
304
|
+
"attr.data-orientation": "data().orientation",
|
|
305
|
+
"attr.data-disabled": "data().disabled",
|
|
306
|
+
"attr.data-dragging": "data().dragging"
|
|
307
|
+
}
|
|
308
|
+
},
|
|
309
|
+
exportAs: ["sliderRoot"],
|
|
310
|
+
ngImport: i0
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
};
|
|
314
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
315
|
+
minVersion: "12.0.0",
|
|
316
|
+
version: "22.2.6",
|
|
317
|
+
ngImport: i0,
|
|
318
|
+
type: SliderRoot,
|
|
319
|
+
decorators: [{
|
|
320
|
+
type: Directive,
|
|
321
|
+
args: [{
|
|
322
|
+
selector: "[sliderRoot]",
|
|
323
|
+
exportAs: "sliderRoot",
|
|
324
|
+
host: {
|
|
325
|
+
role: "group",
|
|
326
|
+
"data-primitives-part": "slider-root",
|
|
327
|
+
"[attr.data-invalid]": "field.data().invalid",
|
|
328
|
+
"[attr.data-valid]": "field.data().valid",
|
|
329
|
+
"[attr.data-dirty]": "field.data().dirty",
|
|
330
|
+
"[attr.data-touched]": "field.data().touched",
|
|
331
|
+
"[attr.data-filled]": "field.data().filled",
|
|
332
|
+
"[attr.data-focused]": "field.data().focused",
|
|
333
|
+
"[attr.data-orientation]": "data().orientation",
|
|
334
|
+
"[attr.data-disabled]": "data().disabled",
|
|
335
|
+
"[attr.data-dragging]": "data().dragging"
|
|
336
|
+
}
|
|
337
|
+
}]
|
|
338
|
+
}],
|
|
339
|
+
ctorParameters: () => [],
|
|
340
|
+
propDecorators: {
|
|
341
|
+
value: [{
|
|
342
|
+
type: i0.Input,
|
|
343
|
+
args: [{
|
|
344
|
+
isSignal: true,
|
|
345
|
+
alias: "value",
|
|
346
|
+
required: false
|
|
347
|
+
}]
|
|
348
|
+
}],
|
|
349
|
+
valueChange: [{
|
|
350
|
+
type: i0.Output,
|
|
351
|
+
args: ["valueChange"]
|
|
352
|
+
}],
|
|
353
|
+
defaultValue: [{
|
|
354
|
+
type: i0.Input,
|
|
355
|
+
args: [{
|
|
356
|
+
isSignal: true,
|
|
357
|
+
alias: "defaultValue",
|
|
358
|
+
required: false
|
|
359
|
+
}]
|
|
360
|
+
}],
|
|
361
|
+
valueChangeDetails: [{
|
|
362
|
+
type: i0.Output,
|
|
363
|
+
args: ["valueChangeDetails"]
|
|
364
|
+
}],
|
|
365
|
+
valueCommit: [{
|
|
366
|
+
type: i0.Output,
|
|
367
|
+
args: ["valueCommit"]
|
|
368
|
+
}],
|
|
369
|
+
min: [{
|
|
370
|
+
type: i0.Input,
|
|
371
|
+
args: [{
|
|
372
|
+
isSignal: true,
|
|
373
|
+
alias: "min",
|
|
374
|
+
required: false
|
|
375
|
+
}]
|
|
376
|
+
}],
|
|
377
|
+
max: [{
|
|
378
|
+
type: i0.Input,
|
|
379
|
+
args: [{
|
|
380
|
+
isSignal: true,
|
|
381
|
+
alias: "max",
|
|
382
|
+
required: false
|
|
383
|
+
}]
|
|
384
|
+
}],
|
|
385
|
+
step: [{
|
|
386
|
+
type: i0.Input,
|
|
387
|
+
args: [{
|
|
388
|
+
isSignal: true,
|
|
389
|
+
alias: "step",
|
|
390
|
+
required: false
|
|
391
|
+
}]
|
|
392
|
+
}],
|
|
393
|
+
largeStep: [{
|
|
394
|
+
type: i0.Input,
|
|
395
|
+
args: [{
|
|
396
|
+
isSignal: true,
|
|
397
|
+
alias: "largeStep",
|
|
398
|
+
required: false
|
|
399
|
+
}]
|
|
400
|
+
}],
|
|
401
|
+
minStepsBetweenValues: [{
|
|
402
|
+
type: i0.Input,
|
|
403
|
+
args: [{
|
|
404
|
+
isSignal: true,
|
|
405
|
+
alias: "minStepsBetweenValues",
|
|
406
|
+
required: false
|
|
407
|
+
}]
|
|
408
|
+
}],
|
|
409
|
+
orientation: [{
|
|
410
|
+
type: i0.Input,
|
|
411
|
+
args: [{
|
|
412
|
+
isSignal: true,
|
|
413
|
+
alias: "orientation",
|
|
414
|
+
required: false
|
|
415
|
+
}]
|
|
416
|
+
}],
|
|
417
|
+
disabled: [{
|
|
418
|
+
type: i0.Input,
|
|
419
|
+
args: [{
|
|
420
|
+
isSignal: true,
|
|
421
|
+
alias: "disabled",
|
|
422
|
+
required: false
|
|
423
|
+
}]
|
|
424
|
+
}],
|
|
425
|
+
name: [{
|
|
426
|
+
type: i0.Input,
|
|
427
|
+
args: [{
|
|
428
|
+
isSignal: true,
|
|
429
|
+
alias: "name",
|
|
430
|
+
required: false
|
|
431
|
+
}]
|
|
432
|
+
}],
|
|
433
|
+
format: [{
|
|
434
|
+
type: i0.Input,
|
|
435
|
+
args: [{
|
|
436
|
+
isSignal: true,
|
|
437
|
+
alias: "format",
|
|
438
|
+
required: false
|
|
439
|
+
}]
|
|
440
|
+
}],
|
|
441
|
+
locale: [{
|
|
442
|
+
type: i0.Input,
|
|
443
|
+
args: [{
|
|
444
|
+
isSignal: true,
|
|
445
|
+
alias: "locale",
|
|
446
|
+
required: false
|
|
447
|
+
}]
|
|
448
|
+
}]
|
|
449
|
+
}
|
|
450
|
+
});
|
|
451
|
+
var SliderControl = class SliderControl {
|
|
452
|
+
constructor() {
|
|
453
|
+
this.root = inject(SliderRoot);
|
|
454
|
+
this.state = this.root.state;
|
|
455
|
+
this.data = computed(() => dataValues(this.state()), ...ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []);
|
|
456
|
+
this.host = injectHost();
|
|
457
|
+
this.flush = injectFlush();
|
|
458
|
+
this.endDrag = null;
|
|
459
|
+
inject(DestroyRef).onDestroy(() => this.endDrag?.());
|
|
460
|
+
}
|
|
461
|
+
valueAt(x, y) {
|
|
462
|
+
const root = this.root;
|
|
463
|
+
const fraction = fractionAlong(this.host.getBoundingClientRect(), {
|
|
464
|
+
x,
|
|
465
|
+
y
|
|
466
|
+
}, root.orientation(), getDirection(this.host, root.providedDirection()) === "rtl");
|
|
467
|
+
return valueAtFraction(fraction, {
|
|
468
|
+
min: root.min(),
|
|
469
|
+
max: root.max(),
|
|
470
|
+
step: root.step()
|
|
471
|
+
});
|
|
472
|
+
}
|
|
473
|
+
onPointerDown(event) {
|
|
474
|
+
const root = this.root;
|
|
475
|
+
if (root.isDisabled() || event.pointerType === "mouse" && event.button !== 0) return;
|
|
476
|
+
event.preventDefault();
|
|
477
|
+
const value = this.valueAt(event.clientX, event.clientY);
|
|
478
|
+
const index = nearestThumb(root.values(), value);
|
|
479
|
+
root.setThumb(index, value, "track-press");
|
|
480
|
+
root.thumbs()[index]?.focus();
|
|
481
|
+
root.activeIndex.set(index);
|
|
482
|
+
root.dragging.set(true);
|
|
483
|
+
this.flush();
|
|
484
|
+
this.endDrag?.();
|
|
485
|
+
this.endDrag = startDrag(this.host, event, {
|
|
486
|
+
onMove: (move) => {
|
|
487
|
+
root.setThumb(index, this.valueAt(move.clientX, move.clientY), "drag");
|
|
488
|
+
this.flush();
|
|
489
|
+
},
|
|
490
|
+
onEnd: () => {
|
|
491
|
+
this.endDrag = null;
|
|
492
|
+
root.dragging.set(false);
|
|
493
|
+
root.commit();
|
|
494
|
+
this.flush();
|
|
495
|
+
}
|
|
496
|
+
});
|
|
497
|
+
}
|
|
498
|
+
static {
|
|
499
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
500
|
+
minVersion: "12.0.0",
|
|
501
|
+
version: "22.2.6",
|
|
502
|
+
ngImport: i0,
|
|
503
|
+
type: SliderControl,
|
|
504
|
+
deps: [],
|
|
505
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
506
|
+
});
|
|
507
|
+
}
|
|
508
|
+
static {
|
|
509
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
510
|
+
minVersion: "14.0.0",
|
|
511
|
+
version: "22.2.6",
|
|
512
|
+
type: SliderControl,
|
|
513
|
+
isStandalone: true,
|
|
514
|
+
selector: "[sliderControl]",
|
|
515
|
+
host: {
|
|
516
|
+
attributes: { "data-primitives-part": "slider-control" },
|
|
517
|
+
listeners: { "pointerdown": "onPointerDown($event)" },
|
|
518
|
+
properties: {
|
|
519
|
+
"attr.data-orientation": "data().orientation",
|
|
520
|
+
"attr.data-disabled": "data().disabled",
|
|
521
|
+
"attr.data-dragging": "data().dragging",
|
|
522
|
+
"style.touch-action": "'none'"
|
|
523
|
+
}
|
|
524
|
+
},
|
|
525
|
+
exportAs: ["sliderControl"],
|
|
526
|
+
ngImport: i0
|
|
527
|
+
});
|
|
528
|
+
}
|
|
529
|
+
};
|
|
530
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
531
|
+
minVersion: "12.0.0",
|
|
532
|
+
version: "22.2.6",
|
|
533
|
+
ngImport: i0,
|
|
534
|
+
type: SliderControl,
|
|
535
|
+
decorators: [{
|
|
536
|
+
type: Directive,
|
|
537
|
+
args: [{
|
|
538
|
+
selector: "[sliderControl]",
|
|
539
|
+
exportAs: "sliderControl",
|
|
540
|
+
host: {
|
|
541
|
+
"data-primitives-part": "slider-control",
|
|
542
|
+
"[attr.data-orientation]": "data().orientation",
|
|
543
|
+
"[attr.data-disabled]": "data().disabled",
|
|
544
|
+
"[attr.data-dragging]": "data().dragging",
|
|
545
|
+
"[style.touch-action]": "'none'",
|
|
546
|
+
"(pointerdown)": "onPointerDown($event)"
|
|
547
|
+
}
|
|
548
|
+
}]
|
|
549
|
+
}],
|
|
550
|
+
ctorParameters: () => []
|
|
551
|
+
});
|
|
552
|
+
var SliderIndicator = class SliderIndicator {
|
|
553
|
+
constructor() {
|
|
554
|
+
this.root = inject(SliderRoot);
|
|
555
|
+
this.state = this.root.state;
|
|
556
|
+
this.style = computed(() => {
|
|
557
|
+
const root = this.root;
|
|
558
|
+
const percents = root.values().map((entry) => valueToPercent(entry, root.min(), root.max()));
|
|
559
|
+
const start = percents.length > 1 ? percents[0] ?? 0 : 0;
|
|
560
|
+
const end = percents.at(-1) ?? 0;
|
|
561
|
+
return root.orientation() === "vertical" ? {
|
|
562
|
+
position: "absolute",
|
|
563
|
+
"inset-block-end": `${start}%`,
|
|
564
|
+
"block-size": `${end - start}%`
|
|
565
|
+
} : {
|
|
566
|
+
position: "absolute",
|
|
567
|
+
"inset-inline-start": `${start}%`,
|
|
568
|
+
"inline-size": `${end - start}%`
|
|
569
|
+
};
|
|
570
|
+
}, ...ngDevMode ? [{ debugName: "style" }] : /* istanbul ignore next */ []);
|
|
571
|
+
}
|
|
572
|
+
static {
|
|
573
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
574
|
+
minVersion: "12.0.0",
|
|
575
|
+
version: "22.2.6",
|
|
576
|
+
ngImport: i0,
|
|
577
|
+
type: SliderIndicator,
|
|
578
|
+
deps: [],
|
|
579
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
580
|
+
});
|
|
581
|
+
}
|
|
582
|
+
static {
|
|
583
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
584
|
+
minVersion: "14.0.0",
|
|
585
|
+
version: "22.2.6",
|
|
586
|
+
type: SliderIndicator,
|
|
587
|
+
isStandalone: true,
|
|
588
|
+
selector: "[sliderIndicator]",
|
|
589
|
+
host: {
|
|
590
|
+
attributes: { "data-primitives-part": "slider-indicator" },
|
|
591
|
+
properties: {
|
|
592
|
+
"attr.data-orientation": "state().orientation",
|
|
593
|
+
"style": "style()"
|
|
594
|
+
}
|
|
595
|
+
},
|
|
596
|
+
exportAs: ["sliderIndicator"],
|
|
597
|
+
ngImport: i0
|
|
598
|
+
});
|
|
599
|
+
}
|
|
600
|
+
};
|
|
601
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
602
|
+
minVersion: "12.0.0",
|
|
603
|
+
version: "22.2.6",
|
|
604
|
+
ngImport: i0,
|
|
605
|
+
type: SliderIndicator,
|
|
606
|
+
decorators: [{
|
|
607
|
+
type: Directive,
|
|
608
|
+
args: [{
|
|
609
|
+
selector: "[sliderIndicator]",
|
|
610
|
+
exportAs: "sliderIndicator",
|
|
611
|
+
host: {
|
|
612
|
+
"data-primitives-part": "slider-indicator",
|
|
613
|
+
"[attr.data-orientation]": "state().orientation",
|
|
614
|
+
"[style]": "style()"
|
|
615
|
+
}
|
|
616
|
+
}]
|
|
617
|
+
}]
|
|
618
|
+
});
|
|
619
|
+
var SliderLabel = class SliderLabel {
|
|
620
|
+
constructor() {
|
|
621
|
+
this.id = input(void 0, ...ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []);
|
|
622
|
+
this.root = inject(SliderRoot);
|
|
623
|
+
this.state = this.root.state;
|
|
624
|
+
this.data = computed(() => {
|
|
625
|
+
const state = this.state();
|
|
626
|
+
return dataValues({
|
|
627
|
+
orientation: state.orientation,
|
|
628
|
+
disabled: state.disabled
|
|
629
|
+
});
|
|
630
|
+
}, ...ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []);
|
|
631
|
+
this.resolvedId = labelId(this.id, this.root.labelId, "primitives-slider-label");
|
|
632
|
+
}
|
|
633
|
+
onClick() {
|
|
634
|
+
this.root.thumbs()[0]?.focus();
|
|
635
|
+
}
|
|
636
|
+
static {
|
|
637
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
638
|
+
minVersion: "12.0.0",
|
|
639
|
+
version: "22.2.6",
|
|
640
|
+
ngImport: i0,
|
|
641
|
+
type: SliderLabel,
|
|
642
|
+
deps: [],
|
|
643
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
644
|
+
});
|
|
645
|
+
}
|
|
646
|
+
static {
|
|
647
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
648
|
+
minVersion: "17.1.0",
|
|
649
|
+
version: "22.2.6",
|
|
650
|
+
type: SliderLabel,
|
|
651
|
+
isStandalone: true,
|
|
652
|
+
selector: "[sliderLabel]",
|
|
653
|
+
inputs: { id: {
|
|
654
|
+
classPropertyName: "id",
|
|
655
|
+
publicName: "id",
|
|
656
|
+
isSignal: true,
|
|
657
|
+
isRequired: false,
|
|
658
|
+
transformFunction: null
|
|
659
|
+
} },
|
|
660
|
+
host: {
|
|
661
|
+
attributes: { "data-primitives-part": "slider-label" },
|
|
662
|
+
listeners: { "click": "onClick()" },
|
|
663
|
+
properties: {
|
|
664
|
+
"attr.id": "resolvedId()",
|
|
665
|
+
"attr.data-orientation": "data().orientation",
|
|
666
|
+
"attr.data-disabled": "data().disabled"
|
|
667
|
+
}
|
|
668
|
+
},
|
|
669
|
+
exportAs: ["sliderLabel"],
|
|
670
|
+
ngImport: i0
|
|
671
|
+
});
|
|
672
|
+
}
|
|
673
|
+
};
|
|
674
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
675
|
+
minVersion: "12.0.0",
|
|
676
|
+
version: "22.2.6",
|
|
677
|
+
ngImport: i0,
|
|
678
|
+
type: SliderLabel,
|
|
679
|
+
decorators: [{
|
|
680
|
+
type: Directive,
|
|
681
|
+
args: [{
|
|
682
|
+
selector: "[sliderLabel]",
|
|
683
|
+
exportAs: "sliderLabel",
|
|
684
|
+
host: {
|
|
685
|
+
"data-primitives-part": "slider-label",
|
|
686
|
+
"[attr.id]": "resolvedId()",
|
|
687
|
+
"[attr.data-orientation]": "data().orientation",
|
|
688
|
+
"[attr.data-disabled]": "data().disabled",
|
|
689
|
+
"(click)": "onClick()"
|
|
690
|
+
}
|
|
691
|
+
}]
|
|
692
|
+
}],
|
|
693
|
+
propDecorators: { id: [{
|
|
694
|
+
type: i0.Input,
|
|
695
|
+
args: [{
|
|
696
|
+
isSignal: true,
|
|
697
|
+
alias: "id",
|
|
698
|
+
required: false
|
|
699
|
+
}]
|
|
700
|
+
}] }
|
|
701
|
+
});
|
|
702
|
+
var SliderThumb = class SliderThumb {
|
|
703
|
+
constructor() {
|
|
704
|
+
this.root = inject(SliderRoot);
|
|
705
|
+
this.index = input(void 0, ...ngDevMode ? [{ debugName: "index" }] : /* istanbul ignore next */ []);
|
|
706
|
+
this.getAriaValueText = input(void 0, ...ngDevMode ? [{ debugName: "getAriaValueText" }] : /* istanbul ignore next */ []);
|
|
707
|
+
this.disabled = input(false, {
|
|
708
|
+
...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
|
|
709
|
+
transform: booleanAttribute
|
|
710
|
+
});
|
|
711
|
+
this.id = input(void 0, ...ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []);
|
|
712
|
+
this.host = injectHost();
|
|
713
|
+
this.generated = injectId("primitives-slider-thumb");
|
|
714
|
+
this.resolvedId = computed(() => this.id() ?? this.generated, ...ngDevMode ? [{ debugName: "resolvedId" }] : /* istanbul ignore next */ []);
|
|
715
|
+
this.flush = injectFlush();
|
|
716
|
+
this.position = computed(() => this.index() ?? Math.max(this.root.thumbs().indexOf(this.host), 0), ...ngDevMode ? [{ debugName: "position" }] : /* istanbul ignore next */ []);
|
|
717
|
+
this.state = computed(() => {
|
|
718
|
+
const root = this.root;
|
|
719
|
+
const index = this.position();
|
|
720
|
+
return {
|
|
721
|
+
value: root.values()[index] ?? root.min(),
|
|
722
|
+
index,
|
|
723
|
+
orientation: root.orientation(),
|
|
724
|
+
disabled: this.disabled() || root.isDisabled(),
|
|
725
|
+
dragging: root.dragging() && root.activeIndex() === index
|
|
726
|
+
};
|
|
727
|
+
}, ...ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []);
|
|
728
|
+
this.data = computed(() => {
|
|
729
|
+
const state = this.state();
|
|
730
|
+
return dataValues({
|
|
731
|
+
orientation: state.orientation,
|
|
732
|
+
index: String(state.index),
|
|
733
|
+
disabled: state.disabled,
|
|
734
|
+
dragging: state.dragging
|
|
735
|
+
});
|
|
736
|
+
}, ...ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []);
|
|
737
|
+
this.bounds = computed(() => {
|
|
738
|
+
const root = this.root;
|
|
739
|
+
return thumbBounds(root.values(), this.position(), {
|
|
740
|
+
min: root.min(),
|
|
741
|
+
max: root.max(),
|
|
742
|
+
step: root.step(),
|
|
743
|
+
minStepsBetweenValues: root.minStepsBetweenValues()
|
|
744
|
+
});
|
|
745
|
+
}, ...ngDevMode ? [{ debugName: "bounds" }] : /* istanbul ignore next */ []);
|
|
746
|
+
this.valueText = computed(() => {
|
|
747
|
+
const state = this.state();
|
|
748
|
+
const own = this.getAriaValueText();
|
|
749
|
+
return own === void 0 ? this.root.valueText(state.value) : own(state.value, state.index);
|
|
750
|
+
}, ...ngDevMode ? [{ debugName: "valueText" }] : /* istanbul ignore next */ []);
|
|
751
|
+
this.style = computed(() => {
|
|
752
|
+
const root = this.root;
|
|
753
|
+
const percent = valueToPercent(this.state().value, root.min(), root.max());
|
|
754
|
+
if (root.orientation() === "vertical") return {
|
|
755
|
+
position: "absolute",
|
|
756
|
+
"inset-block-end": `${percent}%`,
|
|
757
|
+
left: "50%",
|
|
758
|
+
translate: "-50% 50%"
|
|
759
|
+
};
|
|
760
|
+
const rtl = getDirection(this.host) === "rtl";
|
|
761
|
+
return {
|
|
762
|
+
position: "absolute",
|
|
763
|
+
"inset-inline-start": `${percent}%`,
|
|
764
|
+
top: "50%",
|
|
765
|
+
translate: rtl ? "50% -50%" : "-50% -50%"
|
|
766
|
+
};
|
|
767
|
+
}, ...ngDevMode ? [{ debugName: "style" }] : /* istanbul ignore next */ []);
|
|
768
|
+
inject(DestroyRef).onDestroy(this.root.registerThumb(this.host));
|
|
769
|
+
const { field } = this.root;
|
|
770
|
+
writeFieldAria(field, this.host, {
|
|
771
|
+
"aria-describedby": field.describedBy,
|
|
772
|
+
"aria-invalid": field.ariaInvalid
|
|
773
|
+
});
|
|
774
|
+
writeThumbLabelledBy(this.host, [field.labelledBy, this.root.labelId]);
|
|
775
|
+
effect((onCleanup) => {
|
|
776
|
+
const index = this.position();
|
|
777
|
+
const id = this.resolvedId();
|
|
778
|
+
untracked(() => {
|
|
779
|
+
this.root.thumbIds.update((ids) => ({
|
|
780
|
+
...ids,
|
|
781
|
+
[index]: id
|
|
782
|
+
}));
|
|
783
|
+
onCleanup(() => this.root.thumbIds.update((ids) => {
|
|
784
|
+
const { [index]: _, ...rest } = ids;
|
|
785
|
+
return rest;
|
|
786
|
+
}));
|
|
787
|
+
});
|
|
788
|
+
});
|
|
789
|
+
}
|
|
790
|
+
onKeyDown(event) {
|
|
791
|
+
const state = this.state();
|
|
792
|
+
if (state.disabled) return;
|
|
793
|
+
const root = this.root;
|
|
794
|
+
const bounds = this.bounds();
|
|
795
|
+
const target = sliderKeyTarget(event.key, event.shiftKey, state.value, {
|
|
796
|
+
step: root.step(),
|
|
797
|
+
largeStep: root.largeStep(),
|
|
798
|
+
min: bounds.min,
|
|
799
|
+
max: bounds.max,
|
|
800
|
+
orientation: root.orientation(),
|
|
801
|
+
rtl: getDirection(this.host, root.providedDirection()) === "rtl"
|
|
802
|
+
});
|
|
803
|
+
if (target === null) return;
|
|
804
|
+
event.preventDefault();
|
|
805
|
+
root.commit(root.setThumb(state.index, target, "keyboard"));
|
|
806
|
+
this.flush();
|
|
807
|
+
}
|
|
808
|
+
static {
|
|
809
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
810
|
+
minVersion: "12.0.0",
|
|
811
|
+
version: "22.2.6",
|
|
812
|
+
ngImport: i0,
|
|
813
|
+
type: SliderThumb,
|
|
814
|
+
deps: [],
|
|
815
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
816
|
+
});
|
|
817
|
+
}
|
|
818
|
+
static {
|
|
819
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
820
|
+
minVersion: "17.1.0",
|
|
821
|
+
version: "22.2.6",
|
|
822
|
+
type: SliderThumb,
|
|
823
|
+
isStandalone: true,
|
|
824
|
+
selector: "[sliderThumb]",
|
|
825
|
+
inputs: {
|
|
826
|
+
index: {
|
|
827
|
+
classPropertyName: "index",
|
|
828
|
+
publicName: "index",
|
|
829
|
+
isSignal: true,
|
|
830
|
+
isRequired: false,
|
|
831
|
+
transformFunction: null
|
|
832
|
+
},
|
|
833
|
+
getAriaValueText: {
|
|
834
|
+
classPropertyName: "getAriaValueText",
|
|
835
|
+
publicName: "getAriaValueText",
|
|
836
|
+
isSignal: true,
|
|
837
|
+
isRequired: false,
|
|
838
|
+
transformFunction: null
|
|
839
|
+
},
|
|
840
|
+
disabled: {
|
|
841
|
+
classPropertyName: "disabled",
|
|
842
|
+
publicName: "disabled",
|
|
843
|
+
isSignal: true,
|
|
844
|
+
isRequired: false,
|
|
845
|
+
transformFunction: null
|
|
846
|
+
},
|
|
847
|
+
id: {
|
|
848
|
+
classPropertyName: "id",
|
|
849
|
+
publicName: "id",
|
|
850
|
+
isSignal: true,
|
|
851
|
+
isRequired: false,
|
|
852
|
+
transformFunction: null
|
|
853
|
+
}
|
|
854
|
+
},
|
|
855
|
+
host: {
|
|
856
|
+
attributes: {
|
|
857
|
+
"role": "slider",
|
|
858
|
+
"data-primitives-part": "slider-thumb"
|
|
859
|
+
},
|
|
860
|
+
listeners: {
|
|
861
|
+
"keydown": "onKeyDown($event)",
|
|
862
|
+
"focus": "root.field.focused()",
|
|
863
|
+
"blur": "root.field.blurred()"
|
|
864
|
+
},
|
|
865
|
+
properties: {
|
|
866
|
+
"attr.id": "resolvedId()",
|
|
867
|
+
"attr.tabindex": "state().disabled ? null : 0",
|
|
868
|
+
"attr.aria-valuenow": "state().value",
|
|
869
|
+
"attr.aria-valuemin": "bounds().min",
|
|
870
|
+
"attr.aria-valuemax": "bounds().max",
|
|
871
|
+
"attr.aria-valuetext": "valueText()",
|
|
872
|
+
"attr.aria-orientation": "state().orientation",
|
|
873
|
+
"attr.aria-disabled": "state().disabled ? 'true' : null",
|
|
874
|
+
"attr.data-orientation": "data().orientation",
|
|
875
|
+
"attr.data-index": "data().index",
|
|
876
|
+
"attr.data-disabled": "data().disabled",
|
|
877
|
+
"attr.data-dragging": "data().dragging",
|
|
878
|
+
"style": "style()"
|
|
879
|
+
}
|
|
880
|
+
},
|
|
881
|
+
exportAs: ["sliderThumb"],
|
|
882
|
+
ngImport: i0
|
|
883
|
+
});
|
|
884
|
+
}
|
|
885
|
+
};
|
|
886
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
887
|
+
minVersion: "12.0.0",
|
|
888
|
+
version: "22.2.6",
|
|
889
|
+
ngImport: i0,
|
|
890
|
+
type: SliderThumb,
|
|
891
|
+
decorators: [{
|
|
892
|
+
type: Directive,
|
|
893
|
+
args: [{
|
|
894
|
+
selector: "[sliderThumb]",
|
|
895
|
+
exportAs: "sliderThumb",
|
|
896
|
+
host: {
|
|
897
|
+
role: "slider",
|
|
898
|
+
"data-primitives-part": "slider-thumb",
|
|
899
|
+
"[attr.id]": "resolvedId()",
|
|
900
|
+
"[attr.tabindex]": "state().disabled ? null : 0",
|
|
901
|
+
"[attr.aria-valuenow]": "state().value",
|
|
902
|
+
"[attr.aria-valuemin]": "bounds().min",
|
|
903
|
+
"[attr.aria-valuemax]": "bounds().max",
|
|
904
|
+
"[attr.aria-valuetext]": "valueText()",
|
|
905
|
+
"[attr.aria-orientation]": "state().orientation",
|
|
906
|
+
"[attr.aria-disabled]": "state().disabled ? 'true' : null",
|
|
907
|
+
"[attr.data-orientation]": "data().orientation",
|
|
908
|
+
"[attr.data-index]": "data().index",
|
|
909
|
+
"[attr.data-disabled]": "data().disabled",
|
|
910
|
+
"[attr.data-dragging]": "data().dragging",
|
|
911
|
+
"[style]": "style()",
|
|
912
|
+
"(keydown)": "onKeyDown($event)",
|
|
913
|
+
"(focus)": "root.field.focused()",
|
|
914
|
+
"(blur)": "root.field.blurred()"
|
|
915
|
+
}
|
|
916
|
+
}]
|
|
917
|
+
}],
|
|
918
|
+
ctorParameters: () => [],
|
|
919
|
+
propDecorators: {
|
|
920
|
+
index: [{
|
|
921
|
+
type: i0.Input,
|
|
922
|
+
args: [{
|
|
923
|
+
isSignal: true,
|
|
924
|
+
alias: "index",
|
|
925
|
+
required: false
|
|
926
|
+
}]
|
|
927
|
+
}],
|
|
928
|
+
getAriaValueText: [{
|
|
929
|
+
type: i0.Input,
|
|
930
|
+
args: [{
|
|
931
|
+
isSignal: true,
|
|
932
|
+
alias: "getAriaValueText",
|
|
933
|
+
required: false
|
|
934
|
+
}]
|
|
935
|
+
}],
|
|
936
|
+
disabled: [{
|
|
937
|
+
type: i0.Input,
|
|
938
|
+
args: [{
|
|
939
|
+
isSignal: true,
|
|
940
|
+
alias: "disabled",
|
|
941
|
+
required: false
|
|
942
|
+
}]
|
|
943
|
+
}],
|
|
944
|
+
id: [{
|
|
945
|
+
type: i0.Input,
|
|
946
|
+
args: [{
|
|
947
|
+
isSignal: true,
|
|
948
|
+
alias: "id",
|
|
949
|
+
required: false
|
|
950
|
+
}]
|
|
951
|
+
}]
|
|
952
|
+
}
|
|
953
|
+
});
|
|
954
|
+
var SliderTrack = class SliderTrack {
|
|
955
|
+
constructor() {
|
|
956
|
+
this.state = inject(SliderRoot).state;
|
|
957
|
+
this.data = computed(() => dataValues(this.state()), ...ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []);
|
|
958
|
+
}
|
|
959
|
+
static {
|
|
960
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
961
|
+
minVersion: "12.0.0",
|
|
962
|
+
version: "22.2.6",
|
|
963
|
+
ngImport: i0,
|
|
964
|
+
type: SliderTrack,
|
|
965
|
+
deps: [],
|
|
966
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
967
|
+
});
|
|
968
|
+
}
|
|
969
|
+
static {
|
|
970
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
971
|
+
minVersion: "14.0.0",
|
|
972
|
+
version: "22.2.6",
|
|
973
|
+
type: SliderTrack,
|
|
974
|
+
isStandalone: true,
|
|
975
|
+
selector: "[sliderTrack]",
|
|
976
|
+
host: {
|
|
977
|
+
attributes: { "data-primitives-part": "slider-track" },
|
|
978
|
+
properties: {
|
|
979
|
+
"attr.data-orientation": "data().orientation",
|
|
980
|
+
"attr.data-disabled": "data().disabled",
|
|
981
|
+
"attr.data-dragging": "data().dragging"
|
|
982
|
+
}
|
|
983
|
+
},
|
|
984
|
+
exportAs: ["sliderTrack"],
|
|
985
|
+
ngImport: i0
|
|
986
|
+
});
|
|
987
|
+
}
|
|
988
|
+
};
|
|
989
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
990
|
+
minVersion: "12.0.0",
|
|
991
|
+
version: "22.2.6",
|
|
992
|
+
ngImport: i0,
|
|
993
|
+
type: SliderTrack,
|
|
994
|
+
decorators: [{
|
|
995
|
+
type: Directive,
|
|
996
|
+
args: [{
|
|
997
|
+
selector: "[sliderTrack]",
|
|
998
|
+
exportAs: "sliderTrack",
|
|
999
|
+
host: {
|
|
1000
|
+
"data-primitives-part": "slider-track",
|
|
1001
|
+
"[attr.data-orientation]": "data().orientation",
|
|
1002
|
+
"[attr.data-disabled]": "data().disabled",
|
|
1003
|
+
"[attr.data-dragging]": "data().dragging"
|
|
1004
|
+
}
|
|
1005
|
+
}]
|
|
1006
|
+
}]
|
|
1007
|
+
});
|
|
1008
|
+
const SEPARATOR = " – ";
|
|
1009
|
+
var SliderValue = class SliderValue {
|
|
1010
|
+
constructor() {
|
|
1011
|
+
this.root = inject(SliderRoot);
|
|
1012
|
+
this.state = this.root.state;
|
|
1013
|
+
this.formattedValues = this.root.formattedValues;
|
|
1014
|
+
this.values = this.root.values;
|
|
1015
|
+
this.data = computed(() => {
|
|
1016
|
+
const state = this.state();
|
|
1017
|
+
return dataValues({
|
|
1018
|
+
orientation: state.orientation,
|
|
1019
|
+
disabled: state.disabled
|
|
1020
|
+
});
|
|
1021
|
+
}, ...ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []);
|
|
1022
|
+
this.htmlFor = computed(() => {
|
|
1023
|
+
const ids = this.root.thumbIds();
|
|
1024
|
+
return Object.keys(ids).map(Number).sort((a, b) => a - b).map((index) => ids[index]).join(" ") || null;
|
|
1025
|
+
}, ...ngDevMode ? [{ debugName: "htmlFor" }] : /* istanbul ignore next */ []);
|
|
1026
|
+
const host = injectHost();
|
|
1027
|
+
let own = null;
|
|
1028
|
+
afterRenderEffect(() => {
|
|
1029
|
+
const text = this.formattedValues().join(SEPARATOR);
|
|
1030
|
+
own ??= host.childNodes.length > 0;
|
|
1031
|
+
if (!own && host.textContent !== text) host.textContent = text;
|
|
1032
|
+
});
|
|
1033
|
+
}
|
|
1034
|
+
static {
|
|
1035
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
1036
|
+
minVersion: "12.0.0",
|
|
1037
|
+
version: "22.2.6",
|
|
1038
|
+
ngImport: i0,
|
|
1039
|
+
type: SliderValue,
|
|
1040
|
+
deps: [],
|
|
1041
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
1042
|
+
});
|
|
1043
|
+
}
|
|
1044
|
+
static {
|
|
1045
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
1046
|
+
minVersion: "14.0.0",
|
|
1047
|
+
version: "22.2.6",
|
|
1048
|
+
type: SliderValue,
|
|
1049
|
+
isStandalone: true,
|
|
1050
|
+
selector: "[sliderValue]",
|
|
1051
|
+
host: {
|
|
1052
|
+
attributes: {
|
|
1053
|
+
"data-primitives-part": "slider-value",
|
|
1054
|
+
"aria-live": "off"
|
|
1055
|
+
},
|
|
1056
|
+
properties: {
|
|
1057
|
+
"attr.for": "htmlFor()",
|
|
1058
|
+
"attr.data-orientation": "data().orientation",
|
|
1059
|
+
"attr.data-disabled": "data().disabled"
|
|
1060
|
+
}
|
|
1061
|
+
},
|
|
1062
|
+
exportAs: ["sliderValue"],
|
|
1063
|
+
ngImport: i0
|
|
1064
|
+
});
|
|
1065
|
+
}
|
|
1066
|
+
};
|
|
1067
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1068
|
+
minVersion: "12.0.0",
|
|
1069
|
+
version: "22.2.6",
|
|
1070
|
+
ngImport: i0,
|
|
1071
|
+
type: SliderValue,
|
|
1072
|
+
decorators: [{
|
|
1073
|
+
type: Directive,
|
|
1074
|
+
args: [{
|
|
1075
|
+
selector: "[sliderValue]",
|
|
1076
|
+
exportAs: "sliderValue",
|
|
1077
|
+
host: {
|
|
1078
|
+
"data-primitives-part": "slider-value",
|
|
1079
|
+
"aria-live": "off",
|
|
1080
|
+
"[attr.for]": "htmlFor()",
|
|
1081
|
+
"[attr.data-orientation]": "data().orientation",
|
|
1082
|
+
"[attr.data-disabled]": "data().disabled"
|
|
1083
|
+
}
|
|
1084
|
+
}]
|
|
1085
|
+
}],
|
|
1086
|
+
ctorParameters: () => []
|
|
1087
|
+
});
|
|
1088
|
+
export { SliderControl, SliderIndicator, SliderLabel, SliderRoot, SliderThumb, SliderTrack, SliderValue };
|
|
1089
|
+
|
|
1090
|
+
//# sourceMappingURL=fragiola-primitives-angular-slider.mjs.map
|