@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 @@
|
|
|
1
|
+
{"version":3,"file":"fragiola-primitives-angular-color-slider.mjs","names":[],"sources":["../../color-slider/utils/write-labelled-by.ts","../../color-slider/directives/color-slider-root.directive.ts","../../color-slider/directives/color-slider-label.directive.ts","../../color-slider/directives/color-slider-output.directive.ts","../../color-slider/directives/color-slider-thumb.directive.ts","../../color-slider/directives/color-slider-track.directive.ts"],"sourcesContent":["import {\n DestroyRef,\n effect,\n inject,\n type Signal,\n signal,\n untracked,\n} from \"@angular/core\";\nimport { ownAttribute } from \"@fragiola/primitives-angular/internal\";\n\n/**\n * Writes `aria-labelledby` on a slider's element from its namers (spec/slider.md): the Field's\n * label, else the Slider's Label (the first id given), in its directive's injection context. A\n * consumer's own static `aria-labelledby` wins. With no namer, the element's attribute stays the\n * consumer's, static or bound; one that names it and then goes leaves none.\n */\nexport function writeLabelledBy(\n host: HTMLElement,\n namers: readonly Signal<string | null | undefined>[],\n): void {\n const own = ownAttribute(\"aria-labelledby\");\n if (own !== null) {\n return;\n }\n let wrote = false;\n effect(() => {\n const id = firstId(namers);\n if (id) {\n host.setAttribute(\"aria-labelledby\", id);\n wrote = true;\n } else if (wrote) {\n host.removeAttribute(\"aria-labelledby\");\n wrote = false;\n }\n });\n}\n\n/**\n * A Thumb's `aria-labelledby` (spec/slider.md, \"API\"): the first namer's id, only while the element\n * has no `aria-label` or `aria-labelledby` of the consumer's, read live (Epic #49). A bound\n * `[attr.aria-label]`, or a name the consumer sets later, wins, as in React and Vue; the id this\n * wrote (or a server render wrote before a hydration: the namer's id) is not the consumer's. In its\n * directive's injection context.\n */\nexport function writeThumbLabelledBy(\n host: HTMLElement,\n namers: readonly Signal<string | null | undefined>[],\n): void {\n // the host's name attributes, followed in the browser (a binding is applied after the\n // directive's first effect run, and a later change is no input of the thumb's)\n const names = signal(0);\n const Observer = host.ownerDocument.defaultView?.MutationObserver;\n if (Observer !== undefined) {\n const observer = new Observer(() => names.update((count) => count + 1));\n observer.observe(host, {\n attributes: true,\n attributeFilter: [\"aria-label\", \"aria-labelledby\"],\n });\n inject(DestroyRef).onDestroy(() => observer.disconnect());\n }\n let written: string | null = null;\n effect(() => {\n names();\n const id = firstId(namers);\n untracked(() => {\n const current = host.getAttribute(\"aria-labelledby\");\n // the namer's own id is never the consumer's: after a hydration, the server wrote it\n // and nothing was written here yet\n const consumer =\n host.hasAttribute(\"aria-label\") ||\n (current !== null && current !== written && current !== id);\n if (consumer || !id) {\n if (written !== null && current === written) {\n host.removeAttribute(\"aria-labelledby\");\n }\n written = null;\n return;\n }\n // the same value is not written again: each write is a mutation the observer reports\n if (current !== id) {\n host.setAttribute(\"aria-labelledby\", id);\n }\n written = id;\n });\n });\n}\n\nfunction firstId(\n namers: readonly Signal<string | null | undefined>[],\n): string | null | undefined {\n return namers.map((namer) => namer()).find((value) => value);\n}\n","import {\n afterNextRender,\n booleanAttribute,\n computed,\n DestroyRef,\n Directive,\n effect,\n inject,\n input,\n output,\n PLATFORM_ID,\n signal,\n untracked,\n} from \"@angular/core\";\nimport {\n type Color,\n type ColorChannel,\n type ColorSpace,\n colorChannelRange,\n colorSpaceFor,\n convertColor,\n formatColor,\n formatColorChannel,\n getColorChannel,\n isSameColor,\n parseColor,\n setColorChannel,\n} from \"@fragiola/primitives/color\";\nimport { bridgeForm } from \"@fragiola/primitives/form\";\nimport { snapToStep } from \"@fragiola/primitives/range\";\nimport { fieldControl } from \"@fragiola/primitives-angular/field\";\nimport {\n type ChangeDetails,\n type ChangeReason,\n controllable,\n dataValues,\n injectColorPickerBinding,\n injectHost,\n injectProvidedDirection,\n type ValueChangeEvent,\n} from \"@fragiola/primitives-angular/internal\";\nimport { writeLabelledBy } from \"../utils/write-labelled-by.ts\";\n\nconst BLACK: Color = { space: \"rgb\", red: 0, green: 0, blue: 0, alpha: 1 };\n\n/** A `Color`, or a string `parseColor` reads (black when it reads none). */\nfunction toColor(value: Color | string): Color {\n return parseColor(value) ?? BLACK;\n}\n\n/** The state every color slider part shares. */\nexport interface ColorSliderState {\n /** The value, in the slider's space. */\n color: Color;\n channel: ColorChannel;\n /** The channel's value. */\n value: number;\n orientation: \"horizontal\" | \"vertical\";\n disabled: boolean;\n dragging: boolean;\n}\n\n/**\n * Holds a color slider's value; the `group` with the hidden input holding the color as hex at its\n * end (spec/color-slider.md, the APG slider): `<div colorSliderRoot channel=\"hue\"\n * [(value)]=\"color\" name=\"color\">`. A `[colorSliderLabel]` names the group and its Thumb.\n */\n@Directive({\n selector: \"[colorSliderRoot]\",\n exportAs: \"colorSliderRoot\",\n host: {\n role: \"group\",\n \"data-primitives-part\": \"color-slider-root\",\n \"[attr.data-invalid]\": \"field.data().invalid\",\n \"[attr.data-valid]\": \"field.data().valid\",\n \"[attr.data-dirty]\": \"field.data().dirty\",\n \"[attr.data-touched]\": \"field.data().touched\",\n \"[attr.data-filled]\": \"field.data().filled\",\n \"[attr.data-focused]\": \"field.data().focused\",\n \"[attr.data-orientation]\": \"data().orientation\",\n \"[attr.data-channel]\": \"data().channel\",\n \"[attr.data-disabled]\": \"data().disabled\",\n \"[attr.data-dragging]\": \"data().dragging\",\n },\n})\nexport class ColorSliderRoot {\n /** A `Color`, or a string `parseColor` reads; bound, the slider is controlled. */\n readonly value = input<Color | string | undefined>(undefined);\n readonly valueChange = output<Color>();\n readonly defaultValue = input<Color | string | undefined>(undefined);\n readonly valueChangeDetails = output<ValueChangeEvent<Color>>();\n /** When a drag ends, or after a key changed the value. */\n readonly valueCommit = output<Color>();\n /** The channel the slider edits. */\n readonly channel = input.required<ColorChannel>();\n /** The space it edits the channel in (default: the value's, else the channel's own). */\n readonly colorSpace = input<ColorSpace | undefined>(undefined);\n readonly orientation = input<\"horizontal\" | \"vertical\">(\"horizontal\");\n readonly disabled = input(false, { transform: booleanAttribute });\n readonly name = input<string | undefined>(undefined);\n /** The locale of the channel's text (BCP 47; default: the runtime's). */\n readonly locale = input<string | undefined>(undefined);\n\n private readonly own = controllable<Color, ChangeDetails>(\n computed(() => {\n const value = this.value();\n return value === undefined ? undefined : toColor(value);\n }),\n this.valueChange,\n () => toColor(this.defaultValue() ?? \"#000000\"),\n (value, details) => this.valueChangeDetails.emit({ value, details }),\n );\n\n /** The enclosing ColorPicker's binding (spec/color-picker.md, \"Sharing the color\"). */\n private readonly picker = injectColorPickerBinding();\n /** Bound to the picker's color: inside one, with neither `value` nor `defaultValue`. */\n private readonly bound = computed(() =>\n this.picker !== null &&\n this.value() === undefined &&\n this.defaultValue() === undefined\n ? this.picker\n : null,\n );\n /** The value: the picker's when bound, else its own. */\n private readonly current = {\n value: computed(() => {\n const bound = this.bound();\n return bound === null ? this.own.value() : bound.value();\n }),\n set: (next: Color, details: ChangeDetails) => {\n const bound = untracked(this.bound);\n if (bound === null) {\n this.own.set(next, details);\n return;\n }\n this.valueChange.emit(next);\n this.valueChangeDetails.emit({ value: next, details });\n bound.setValue(next, details);\n },\n };\n /** The space the channel is edited in. */\n readonly space = computed(() =>\n colorSpaceFor(this.channel(), this.current.value(), this.colorSpace()),\n );\n /** The value, in the slider's space. */\n readonly color = computed(() =>\n convertColor(this.current.value(), this.space()),\n );\n /** The channel's value. */\n readonly channelValue = computed(() =>\n getColorChannel(this.color(), this.channel()),\n );\n readonly range = computed(() => colorChannelRange(this.channel()));\n private readonly hex = computed(() => formatColor(this.color(), \"hex\"));\n /** The channel's text (`Intl`, spec/color.md): the Output's and the Thumb's `aria-valuetext`. */\n readonly valueText = computed(() =>\n formatColorChannel(\n this.color(),\n this.channel(),\n this.locale(),\n this.channelValue(),\n ),\n );\n /** The hidden input, once created (in the browser). */\n private hidden: HTMLInputElement | null = null;\n /** The Thumb, while one is rendered. */\n readonly thumb = signal<HTMLElement | null>(null);\n /** The Thumb's id: the Output's `for`. */\n readonly thumbId = signal<string | undefined>(undefined);\n /** The Label's id while one is rendered. */\n readonly labelId = signal<string | undefined>(undefined);\n readonly dragging = signal(false);\n /** The enclosing field's binding, for the root and the thumb (spec/field.md). */\n readonly field = fieldControl({\n id: signal(undefined),\n labelable: false,\n value: this.hex,\n // a slider always has a value\n filled: signal(true),\n input: () => this.hidden,\n focusTarget: () => untracked(this.thumb),\n // inside a ColorPicker, the picker is the field's control\n part: this.picker !== null,\n });\n /** Its own `disabled`, the field's, or the enclosing picker's. */\n readonly isDisabled = computed(\n () =>\n this.disabled() ||\n this.field.disabled() ||\n (this.picker?.disabled() ?? false),\n );\n /** A DirectionProvider's direction, else `null` (the computed one is read). */\n readonly providedDirection = injectProvidedDirection();\n readonly state = computed<ColorSliderState>(() => ({\n color: this.color(),\n channel: this.channel(),\n value: this.channelValue(),\n orientation: this.orientation(),\n disabled: this.isDisabled(),\n dragging: this.dragging(),\n }));\n protected readonly data = computed(() => {\n const state = this.state();\n return dataValues({\n orientation: state.orientation,\n channel: state.channel,\n disabled: state.disabled,\n dragging: state.dragging,\n });\n });\n\n constructor() {\n const host = injectHost();\n writeLabelledBy(host, [this.field.labelledBy, this.labelId]);\n // the `type=\"hidden\"` input with the color as hex, after the consumer's children (as React\n // renders it); in the browser only, as Slider's (a server's would be a second one once the\n // page is hydrated)\n const browser = inject(PLATFORM_ID) === \"browser\";\n effect(() => {\n if (!browser) {\n return;\n }\n const hex = this.hex();\n const name =\n this.bound() === null\n ? (this.field.name() ?? this.name())\n : undefined;\n untracked(() => {\n if (this.hidden === null) {\n const element = host.ownerDocument.createElement(\"input\");\n element.type = \"hidden\";\n element.setAttribute(\n \"data-primitives-part\",\n \"color-slider-input\",\n );\n host.appendChild(element);\n this.hidden = element;\n }\n const hidden = this.hidden;\n if (name === undefined) {\n hidden.removeAttribute(\"name\");\n } else {\n hidden.name = name;\n }\n hidden.value = hex;\n });\n });\n // a form reset: back to the default (spec/README.md, \"Forms\")\n let stop: (() => void) | null = null;\n afterNextRender(() => {\n const hidden = this.hidden;\n if (hidden !== null) {\n stop = bridgeForm(hidden, {\n reset: () => {\n // a bound control is reset by its picker\n if (untracked(this.bound) !== null) {\n return;\n }\n const next = toColor(\n untracked(this.defaultValue) ?? \"#000000\",\n );\n // no change reported when the slider already is at its default\n if (!isSameColor(next, untracked(this.current.value))) {\n this.field.reset();\n this.current.set(next, { reason: \"none\" });\n }\n },\n });\n }\n });\n inject(DestroyRef).onDestroy(() => {\n stop?.();\n this.hidden?.remove();\n });\n }\n\n /** Sets the channel to `value` (snapped, clamped), reports it, returns the color. */\n setChannelValue(value: number, reason: ChangeReason): Color {\n const before = untracked(this.color);\n const channel = untracked(this.channel);\n const snapped = snapToStep(value, colorChannelRange(channel));\n if (snapped === getColorChannel(before, channel)) {\n return before;\n }\n const changed = setColorChannel(before, channel, snapped);\n this.current.set(changed, { reason });\n return changed;\n }\n\n /** Reports the color (default: the current one) as committed. */\n commit(color?: Color): void {\n const committed = color ?? untracked(this.color);\n this.valueCommit.emit(committed);\n untracked(this.bound)?.commit(committed, { reason: \"none\" });\n }\n}\n","import { computed, Directive, inject, input } from \"@angular/core\";\nimport { dataValues, labelId } from \"@fragiola/primitives-angular/internal\";\nimport { ColorSliderRoot } from \"./color-slider-root.directive.ts\";\n\n/**\n * Names the slider and its Thumb while it has no name of its own (`aria-labelledby`;\n * spec/color-slider.md): `<div colorSliderLabel>Hue</div>`. A press on it focuses the Thumb (a\n * `div` has no `for`, Slider's Label).\n */\n@Directive({\n selector: \"[colorSliderLabel]\",\n exportAs: \"colorSliderLabel\",\n host: {\n \"data-primitives-part\": \"color-slider-label\",\n \"[attr.id]\": \"resolvedId()\",\n \"[attr.data-orientation]\": \"data().orientation\",\n \"[attr.data-channel]\": \"data().channel\",\n \"[attr.data-disabled]\": \"data().disabled\",\n \"(click)\": \"onClick()\",\n },\n})\nexport class ColorSliderLabel {\n readonly id = input<string | undefined>(undefined);\n private readonly root = inject(ColorSliderRoot);\n readonly state = this.root.state;\n protected readonly data = computed(() => {\n const state = this.state();\n return dataValues({\n orientation: state.orientation,\n channel: state.channel,\n disabled: state.disabled,\n });\n });\n protected readonly resolvedId = labelId(\n this.id,\n this.root.labelId,\n \"primitives-color-slider-label\",\n );\n\n protected onClick(): void {\n if (!this.root.isDisabled()) {\n this.root.thumb()?.focus();\n }\n }\n}\n","import { afterRenderEffect, computed, Directive, inject } from \"@angular/core\";\nimport { dataValues, injectHost } from \"@fragiola/primitives-angular/internal\";\nimport { ColorSliderRoot } from \"./color-slider-root.directive.ts\";\n\n/**\n * Shows the channel's value as text (`Intl`: `\"120°\"`, `\"50%\"`; spec/color-slider.md), on the\n * consumer's own `<output>`: `<output colorSliderOutput></output>` shows it; content of its own\n * replaces it, reading `valueText()` through `exportAs` (`#output=\"colorSliderOutput\"`).\n */\n@Directive({\n selector: \"output[colorSliderOutput]\",\n exportAs: \"colorSliderOutput\",\n host: {\n \"data-primitives-part\": \"color-slider-output\",\n \"aria-live\": \"off\",\n \"[attr.for]\": \"htmlFor()\",\n \"[attr.data-orientation]\": \"data().orientation\",\n \"[attr.data-channel]\": \"data().channel\",\n \"[attr.data-disabled]\": \"data().disabled\",\n },\n})\nexport class ColorSliderOutput {\n private readonly root = inject(ColorSliderRoot);\n readonly state = this.root.state;\n /** The channel's text, as the default content shows it. */\n readonly valueText = this.root.valueText;\n protected readonly data = computed(() => {\n const state = this.state();\n return dataValues({\n orientation: state.orientation,\n channel: state.channel,\n disabled: state.disabled,\n });\n });\n /** The Thumb's id. */\n protected readonly htmlFor = computed(() => this.root.thumbId() || null);\n\n constructor() {\n const host = injectHost();\n // the default content, in the browser only (a server renders none, so hydration finds no\n // node its template does not have): content of the consumer's own keeps its place\n let own: boolean | null = null;\n afterRenderEffect(() => {\n const text = this.valueText();\n own ??= host.childNodes.length > 0;\n if (!own && host.textContent !== text) {\n host.textContent = text;\n }\n });\n }\n}\n","import {\n afterNextRender,\n computed,\n DestroyRef,\n Directive,\n effect,\n inject,\n input,\n signal,\n untracked,\n} from \"@angular/core\";\nimport { formatColor, setColorChannel } from \"@fragiola/primitives/color\";\nimport { getDirection } from \"@fragiola/primitives/direction\";\nimport { sliderKeyTarget, valueToPercent } from \"@fragiola/primitives/range\";\nimport { writeFieldAria } from \"@fragiola/primitives-angular/field\";\nimport {\n dataValues,\n injectFlush,\n injectHost,\n injectId,\n} from \"@fragiola/primitives-angular/internal\";\nimport { writeThumbLabelledBy } from \"../utils/write-labelled-by.ts\";\nimport { ColorSliderRoot } from \"./color-slider-root.directive.ts\";\n\n/**\n * The `slider`: the channel's value (spec/color-slider.md): `<div colorSliderThumb>`. With no name\n * of its own (`aria-label`, `aria-labelledby`), the field's label or the slider's Label names it.\n */\n@Directive({\n selector: \"[colorSliderThumb]\",\n exportAs: \"colorSliderThumb\",\n host: {\n role: \"slider\",\n \"data-primitives-part\": \"color-slider-thumb\",\n \"[attr.id]\": \"resolvedId()\",\n \"[attr.tabindex]\": \"state().disabled ? null : 0\",\n \"[attr.aria-valuenow]\": \"state().value\",\n \"[attr.aria-valuemin]\": \"root.range().min\",\n \"[attr.aria-valuemax]\": \"root.range().max\",\n \"[attr.aria-valuetext]\": \"root.valueText()\",\n \"[attr.aria-orientation]\": \"state().orientation\",\n \"[attr.aria-disabled]\": \"state().disabled ? 'true' : null\",\n \"[attr.data-orientation]\": \"data().orientation\",\n \"[attr.data-channel]\": \"data().channel\",\n \"[attr.data-disabled]\": \"data().disabled\",\n \"[attr.data-dragging]\": \"data().dragging\",\n \"[style]\": \"style()\",\n \"[style.--color-slider-thumb-color]\": \"thumbColor()\",\n \"(keydown)\": \"onKeyDown($event)\",\n \"(focus)\": \"root.field.focused()\",\n \"(blur)\": \"root.field.blurred()\",\n },\n})\nexport class ColorSliderThumb {\n protected readonly root = inject(ColorSliderRoot);\n /** Its id (generated unless given): the Output's `for`. */\n readonly id = input<string | undefined>(undefined);\n readonly state = this.root.state;\n private readonly host = injectHost();\n private readonly generated = injectId(\"primitives-color-slider-thumb\");\n protected readonly resolvedId = computed(() => this.id() ?? this.generated);\n private readonly flush = injectFlush();\n /** Rendered in the browser: the computed direction can be read (React reads it once mounted). */\n private readonly mounted = signal(false);\n protected readonly data = computed(() => {\n const state = this.state();\n return dataValues({\n orientation: state.orientation,\n channel: state.channel,\n disabled: state.disabled,\n dragging: state.dragging,\n });\n });\n /** The color the recipe draws the thumb with: opaque, but on an alpha slider. */\n protected readonly thumbColor = computed(() => {\n const root = this.root;\n const color = root.color();\n return formatColor(\n root.channel() === \"alpha\"\n ? color\n : setColorChannel(color, \"alpha\", 1),\n );\n });\n /** Structural: the thumb's centre on its value. */\n protected readonly style = computed(() => {\n const root = this.root;\n const { min, max } = root.range();\n const percent = valueToPercent(root.channelValue(), min, max);\n if (root.orientation() === \"vertical\") {\n return {\n position: \"absolute\",\n \"inset-block-end\": `${percent}%`,\n left: \"50%\",\n translate: \"-50% 50%\",\n };\n }\n // the centring translate is physical: the layout's (computed) direction (Slider's Thumb)\n const rtl = this.mounted() && getDirection(this.host) === \"rtl\";\n return {\n position: \"absolute\",\n \"inset-inline-start\": `${percent}%`,\n top: \"50%\",\n translate: rtl ? \"50% -50%\" : \"-50% -50%\",\n };\n });\n\n constructor() {\n const root = this.root;\n root.thumb.set(this.host);\n afterNextRender(() => this.mounted.set(true));\n effect(() => {\n const id = this.resolvedId();\n untracked(() => root.thumbId.set(id));\n });\n inject(DestroyRef).onDestroy(() => {\n if (untracked(root.thumb) === this.host) {\n root.thumb.set(null);\n root.thumbId.set(undefined);\n }\n });\n const { field } = root;\n writeFieldAria(field, this.host, {\n \"aria-describedby\": field.describedBy,\n \"aria-invalid\": field.ariaInvalid,\n });\n // the field's label, or the Label, names a thumb that has no name of its own, read live\n // (a bound or later `aria-label` wins)\n writeThumbLabelledBy(this.host, [field.labelledBy, root.labelId]);\n }\n\n protected onKeyDown(event: KeyboardEvent): void {\n const root = this.root;\n if (root.isDisabled()) {\n return;\n }\n const range = root.range();\n const target = sliderKeyTarget(\n event.key,\n event.shiftKey,\n root.channelValue(),\n {\n step: range.step,\n largeStep: range.largeStep,\n min: range.min,\n max: range.max,\n orientation: root.orientation(),\n rtl:\n getDirection(this.host, root.providedDirection()) === \"rtl\",\n },\n );\n if (target === null) {\n return;\n }\n event.preventDefault();\n root.commit(root.setChannelValue(target, \"keyboard\"));\n // the new value before the next key\n this.flush();\n }\n}\n","import {\n afterNextRender,\n computed,\n DestroyRef,\n Directive,\n inject,\n signal,\n} from \"@angular/core\";\nimport { colorChannelGradient } from \"@fragiola/primitives/color\";\nimport { getDirection } from \"@fragiola/primitives/direction\";\nimport { startDrag } from \"@fragiola/primitives/pointer\";\nimport { fractionAlong, valueAtFraction } from \"@fragiola/primitives/range\";\nimport {\n dataValues,\n injectFlush,\n injectHost,\n} from \"@fragiola/primitives-angular/internal\";\nimport { ColorSliderRoot } from \"./color-slider-root.directive.ts\";\n\n/**\n * The interactive area and the channel's gradient (spec/color-slider.md, \"Pointer\"): a press\n * moves the thumb there, then drags it with pointer capture: `<div colorSliderTrack>`. Every move\n * renders within its event (`injectFlush`): zoneless Angular would render it a task later.\n */\n@Directive({\n selector: \"[colorSliderTrack]\",\n exportAs: \"colorSliderTrack\",\n host: {\n \"data-primitives-part\": \"color-slider-track\",\n \"[attr.data-orientation]\": \"data().orientation\",\n \"[attr.data-channel]\": \"data().channel\",\n \"[attr.data-disabled]\": \"data().disabled\",\n \"[attr.data-dragging]\": \"data().dragging\",\n // structural: the thumb's box, no page scroll under a touch drag, the gradient a recipe\n // draws\n \"[style.position]\": \"'relative'\",\n \"[style.touch-action]\": \"'none'\",\n \"[style.--color-slider-track-background]\": \"gradient()\",\n \"(pointerdown)\": \"onPointerDown($event)\",\n },\n})\nexport class ColorSliderTrack {\n private readonly root = inject(ColorSliderRoot);\n readonly state = this.root.state;\n protected readonly data = computed(() => {\n const state = this.state();\n return dataValues({\n orientation: state.orientation,\n channel: state.channel,\n disabled: state.disabled,\n dragging: state.dragging,\n });\n });\n private readonly host = injectHost();\n private readonly flush = injectFlush();\n /** Rendered in the browser: the computed direction can be read (React reads it once mounted). */\n private readonly mounted = signal(false);\n private endDrag: (() => void) | null = null;\n protected readonly gradient = computed(() => {\n const root = this.root;\n const provided = root.providedDirection();\n const rtl =\n provided !== null\n ? provided === \"rtl\"\n : this.mounted() && getDirection(this.host) === \"rtl\";\n return colorChannelGradient(\n root.color(),\n root.channel(),\n root.orientation() === \"vertical\"\n ? \"to top\"\n : rtl\n ? \"to left\"\n : \"to right\",\n );\n });\n\n constructor() {\n afterNextRender(() => this.mounted.set(true));\n inject(DestroyRef).onDestroy(() => this.endDrag?.());\n }\n\n private valueAt(x: number, y: number): number {\n const root = this.root;\n const fraction = fractionAlong(\n this.host.getBoundingClientRect(),\n { x, y },\n root.orientation(),\n getDirection(this.host, root.providedDirection()) === \"rtl\",\n );\n return valueAtFraction(fraction, root.range());\n }\n\n protected onPointerDown(event: PointerEvent): void {\n const root = this.root;\n if (\n root.isDisabled() ||\n (event.pointerType === \"mouse\" && event.button !== 0)\n ) {\n return;\n }\n event.preventDefault();\n root.setChannelValue(\n this.valueAt(event.clientX, event.clientY),\n \"track-press\",\n );\n root.thumb()?.focus();\n root.dragging.set(true);\n this.flush();\n this.endDrag?.();\n this.endDrag = startDrag(this.host, event, {\n onMove: (move) => {\n root.setChannelValue(\n this.valueAt(move.clientX, move.clientY),\n \"drag\",\n );\n this.flush();\n },\n onEnd: () => {\n this.endDrag = null;\n root.dragging.set(false);\n root.commit();\n this.flush();\n },\n });\n }\n}\n"],"mappings":";;;;;;;;;AAgBA,SAAgB,gBACZ,MACA,QAAoD;CAGpD,IADY,aAAa,iBACrB,MAAQ,MACR;CAEJ,IAAI,QAAQ;CACZ,aAAY;EACR,MAAM,KAAK,QAAQ,MAAM;EACzB,IAAI,IAAI;GACJ,KAAK,aAAa,mBAAmB,EAAE;GACvC,QAAQ;EACZ,OAAO,IAAI,OAAO;GACd,KAAK,gBAAgB,iBAAiB;GACtC,QAAQ;EACZ;CACJ,CAAC;AACL;AASA,SAAgB,qBACZ,MACA,QAAoD;CAIpD,MAAM,QAAQ,OAAO,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CACvB,MAAM,WAAW,KAAK,cAAc,aAAa;CACjD,IAAI,aAAa,QAAW;EACxB,MAAM,WAAW,IAAI,eAAe,MAAM,QAAQ,UAAU,QAAQ,CAAC,CAAC;EACtE,SAAS,QAAQ,MAAM;GACnB,YAAY;GACZ,iBAAiB,CAAC,cAAc,iBAAiB;EACpD,CAAA;EACD,OAAO,UAAU,CAAC,CAAC,gBAAgB,SAAS,WAAU,CAAE;CAC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cAAA;GAAA,UAAA;GAAA,MAAA;IAAA,YAAA,EAAA,wBAAA,qBAAA;IAAA,WAAA,EAAA,eAAA,wBAAA;IAAA,YAAA;KAAA,yBAAA;KAAA,qBAAA;KAAA,sBAAA;KAAA,sBAAA;KAAA,kBAAA;KAAA,sBAAA;KAAA,yCAAA;IAAA;GAAA;GAAA,UAAA,CAAA,kBAAA;GAAA,UAAA;EAAA,CAAA;CAAA;;AAAhB,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAgB,YAAA,CAAA;EAjB5B,MAAA;EAAU,MAAA,CAAA;GACP,UAAU;GACV,UAAU;GACV,MAAM;IACF,wBAAwB;IACxB,2BAA2B;IAC3B,uBAAuB;IACvB,wBAAwB;IACxB,wBAAwB;IAGxB,oBAAoB;IACpB,wBAAwB;IACxB,2CAA2C;IAC3C,iBAAiB;GACpB;EACJ,CAAA"}
|
|
@@ -0,0 +1,503 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { DestroyRef, Directive, afterNextRender, afterRenderEffect, booleanAttribute, computed, effect, inject, input, output, signal, untracked } from "@angular/core";
|
|
3
|
+
import { formatColor, parseColor } from "@fragiola/primitives/color";
|
|
4
|
+
import { controllable, dataValues, injectColorPickerBinding, injectEnclosing, injectFlush, injectHost, injectId, injectProvidedDirection } from "@fragiola/primitives-angular/internal";
|
|
5
|
+
import { getDirection } from "@fragiola/primitives/direction";
|
|
6
|
+
import { bridgeForm } from "@fragiola/primitives/form";
|
|
7
|
+
import { createListModel, listKeyTarget, rowTarget } from "@fragiola/primitives/selection";
|
|
8
|
+
import { fieldControl, writeFieldAria } from "@fragiola/primitives-angular/field";
|
|
9
|
+
function toColor(value) {
|
|
10
|
+
return value === null ? null : parseColor(value);
|
|
11
|
+
}
|
|
12
|
+
function inOrder(entries) {
|
|
13
|
+
return [...entries].sort((a, b) => a.element.compareDocumentPosition(b.element) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1);
|
|
14
|
+
}
|
|
15
|
+
function modelOf(entries) {
|
|
16
|
+
return createListModel(entries.map((entry) => ({
|
|
17
|
+
key: entry.key,
|
|
18
|
+
textValue: "",
|
|
19
|
+
disabled: entry.disabled
|
|
20
|
+
})));
|
|
21
|
+
}
|
|
22
|
+
var ColorSwatchPickerRoot = class ColorSwatchPickerRoot {
|
|
23
|
+
constructor() {
|
|
24
|
+
this.value = input(void 0, ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
|
|
25
|
+
this.valueChange = output();
|
|
26
|
+
this.defaultValue = input(void 0, ...ngDevMode ? [{ debugName: "defaultValue" }] : /* istanbul ignore next */ []);
|
|
27
|
+
this.valueChangeDetails = output();
|
|
28
|
+
this.disabled = input(false, {
|
|
29
|
+
...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
|
|
30
|
+
transform: booleanAttribute
|
|
31
|
+
});
|
|
32
|
+
this.name = input(void 0, ...ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []);
|
|
33
|
+
this.host = injectHost();
|
|
34
|
+
this.direction = injectProvidedDirection();
|
|
35
|
+
this.flush = injectFlush();
|
|
36
|
+
this.picker = injectColorPickerBinding();
|
|
37
|
+
this.bound = computed(() => this.picker !== null && this.value() === void 0 && this.defaultValue() === void 0 ? this.picker : null, ...ngDevMode ? [{ debugName: "bound" }] : /* istanbul ignore next */ []);
|
|
38
|
+
this.own = controllable(computed(() => {
|
|
39
|
+
const value = this.value();
|
|
40
|
+
return value === void 0 ? void 0 : toColor(value);
|
|
41
|
+
}), this.valueChange, () => toColor(this.defaultValue() ?? null), (value, details) => this.valueChangeDetails.emit({
|
|
42
|
+
value,
|
|
43
|
+
details
|
|
44
|
+
}));
|
|
45
|
+
this.color = computed(() => {
|
|
46
|
+
const bound = this.bound();
|
|
47
|
+
return bound === null ? this.own.value() : bound.value();
|
|
48
|
+
}, ...ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []);
|
|
49
|
+
this.selected = computed(() => {
|
|
50
|
+
const color = this.color();
|
|
51
|
+
return color === null ? null : formatColor(color, "hexa");
|
|
52
|
+
}, ...ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []);
|
|
53
|
+
this.entries = signal([], ...ngDevMode ? [{ debugName: "entries" }] : /* istanbul ignore next */ []);
|
|
54
|
+
this.ordered = () => inOrder(this.entries());
|
|
55
|
+
this.active = signal(null, ...ngDevMode ? [{ debugName: "active" }] : /* istanbul ignore next */ []);
|
|
56
|
+
this.within = signal(false, ...ngDevMode ? [{ debugName: "within" }] : /* istanbul ignore next */ []);
|
|
57
|
+
this.hidden = null;
|
|
58
|
+
this.field = fieldControl({
|
|
59
|
+
id: signal(void 0),
|
|
60
|
+
labelable: false,
|
|
61
|
+
value: this.color,
|
|
62
|
+
filled: computed(() => this.color() !== null),
|
|
63
|
+
input: () => this.hidden,
|
|
64
|
+
element: () => this.host,
|
|
65
|
+
focusTarget: () => this.tabStopElement(),
|
|
66
|
+
part: this.picker !== null
|
|
67
|
+
});
|
|
68
|
+
this.isDisabled = computed(() => this.disabled() || this.field.disabled() || (this.picker?.disabled() ?? false), ...ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []);
|
|
69
|
+
this.formName = computed(() => this.bound() === null ? this.field.name() ?? this.name() : void 0, ...ngDevMode ? [{ debugName: "formName" }] : /* istanbul ignore next */ []);
|
|
70
|
+
this.tabStop = computed(() => this.isDisabled() ? null : this.tabStopOf(this.ordered()), ...ngDevMode ? [{ debugName: "tabStop" }] : /* istanbul ignore next */ []);
|
|
71
|
+
this.highlighted = computed(() => this.within() && !this.isDisabled() ? this.active() : null, ...ngDevMode ? [{ debugName: "highlighted" }] : /* istanbul ignore next */ []);
|
|
72
|
+
this.state = computed(() => ({
|
|
73
|
+
value: this.color(),
|
|
74
|
+
disabled: this.isDisabled()
|
|
75
|
+
}), ...ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []);
|
|
76
|
+
this.data = computed(() => dataValues({ disabled: this.isDisabled() }), ...ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []);
|
|
77
|
+
const host = this.host;
|
|
78
|
+
writeFieldAria(this.field, host, {
|
|
79
|
+
"aria-labelledby": this.field.labelledBy,
|
|
80
|
+
"aria-describedby": this.field.describedBy,
|
|
81
|
+
"aria-invalid": this.field.ariaInvalid
|
|
82
|
+
});
|
|
83
|
+
const hidden = host.ownerDocument.createElement("input");
|
|
84
|
+
hidden.type = "hidden";
|
|
85
|
+
hidden.setAttribute("data-primitives-part", "color-swatch-picker-input");
|
|
86
|
+
let mounted = false;
|
|
87
|
+
let stop = null;
|
|
88
|
+
afterNextRender(() => {
|
|
89
|
+
mounted = true;
|
|
90
|
+
host.appendChild(hidden);
|
|
91
|
+
this.hidden = hidden;
|
|
92
|
+
this.writeInput(hidden);
|
|
93
|
+
stop = bridgeForm(hidden, {
|
|
94
|
+
reset: () => {
|
|
95
|
+
if (untracked(this.bound) !== null) return;
|
|
96
|
+
this.field.reset();
|
|
97
|
+
this.own.set(toColor(untracked(this.defaultValue) ?? null), { reason: "none" });
|
|
98
|
+
},
|
|
99
|
+
invalid: () => this.tabStopElement()
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
afterRenderEffect({ write: () => {
|
|
103
|
+
this.color();
|
|
104
|
+
this.formName();
|
|
105
|
+
this.isDisabled();
|
|
106
|
+
if (mounted) untracked(() => this.writeInput(hidden));
|
|
107
|
+
} });
|
|
108
|
+
inject(DestroyRef).onDestroy(() => {
|
|
109
|
+
stop?.();
|
|
110
|
+
hidden.remove();
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
writeInput(hidden) {
|
|
114
|
+
const name = this.formName();
|
|
115
|
+
if (name === void 0) hidden.removeAttribute("name");
|
|
116
|
+
else hidden.name = name;
|
|
117
|
+
const color = this.color();
|
|
118
|
+
hidden.value = color === null ? "" : formatColor(color, "hex");
|
|
119
|
+
hidden.disabled = this.isDisabled();
|
|
120
|
+
}
|
|
121
|
+
tabStopOf(items) {
|
|
122
|
+
if (items.length === 0) return null;
|
|
123
|
+
const active = this.active();
|
|
124
|
+
if (this.within() && active !== null) {
|
|
125
|
+
const focused = items.find((entry) => entry.element === active);
|
|
126
|
+
if (focused !== void 0) return focused.element;
|
|
127
|
+
}
|
|
128
|
+
const selected = this.selected();
|
|
129
|
+
return items.find((entry) => entry.key === selected)?.element ?? items[0]?.element ?? null;
|
|
130
|
+
}
|
|
131
|
+
tabStopElement() {
|
|
132
|
+
return untracked(() => this.tabStopOf(this.ordered()));
|
|
133
|
+
}
|
|
134
|
+
choose(key, reason, event) {
|
|
135
|
+
const entry = untracked(this.ordered).find((candidate) => candidate.key === key);
|
|
136
|
+
if (entry === void 0 || entry.disabled || key === untracked(this.selected)) return;
|
|
137
|
+
const details = {
|
|
138
|
+
reason,
|
|
139
|
+
event
|
|
140
|
+
};
|
|
141
|
+
const bound = untracked(this.bound);
|
|
142
|
+
if (bound === null) {
|
|
143
|
+
this.own.set(entry.color, details);
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
this.valueChange.emit(entry.color);
|
|
147
|
+
this.valueChangeDetails.emit({
|
|
148
|
+
value: entry.color,
|
|
149
|
+
details
|
|
150
|
+
});
|
|
151
|
+
bound.setValue(entry.color, details);
|
|
152
|
+
bound.commit(entry.color, details);
|
|
153
|
+
}
|
|
154
|
+
onKeyDown(event) {
|
|
155
|
+
if (untracked(this.isDisabled) || event.defaultPrevented) return;
|
|
156
|
+
const items = untracked(this.ordered);
|
|
157
|
+
const index = items.findIndex((entry) => entry.element === event.target);
|
|
158
|
+
if (index === -1) return;
|
|
159
|
+
const elements = items.map((entry) => entry.element);
|
|
160
|
+
if ((event.key === "ArrowDown" || event.key === "ArrowUp") && !event.altKey) {
|
|
161
|
+
event.preventDefault();
|
|
162
|
+
elements[rowTarget(elements, index, event.key === "ArrowDown" ? 1 : -1)]?.focus();
|
|
163
|
+
this.flush();
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
const result = listKeyTarget(event, modelOf(items), index, {
|
|
167
|
+
orientation: "horizontal",
|
|
168
|
+
rtl: getDirection(this.host, this.direction()) === "rtl",
|
|
169
|
+
loop: true,
|
|
170
|
+
mode: "single",
|
|
171
|
+
behavior: "toggle"
|
|
172
|
+
});
|
|
173
|
+
if (result === null) return;
|
|
174
|
+
event.preventDefault();
|
|
175
|
+
elements[result.index]?.focus();
|
|
176
|
+
if (result.selection?.type === "replace") this.choose(result.selection.key, "keyboard", event);
|
|
177
|
+
this.flush();
|
|
178
|
+
}
|
|
179
|
+
onFocusOut(event) {
|
|
180
|
+
const next = event.relatedTarget;
|
|
181
|
+
if (next instanceof Node && this.host.contains(next)) return;
|
|
182
|
+
this.within.set(false);
|
|
183
|
+
this.field.blurred();
|
|
184
|
+
}
|
|
185
|
+
register(entry) {
|
|
186
|
+
this.entries.update((current) => [...current, entry]);
|
|
187
|
+
return () => this.entries.update((current) => current.filter((item) => item !== entry));
|
|
188
|
+
}
|
|
189
|
+
focused(element) {
|
|
190
|
+
this.active.set(element);
|
|
191
|
+
this.within.set(true);
|
|
192
|
+
}
|
|
193
|
+
press(element, event) {
|
|
194
|
+
const entry = untracked(this.ordered).find((candidate) => candidate.element === element);
|
|
195
|
+
if (entry === void 0 || untracked(this.isDisabled)) return;
|
|
196
|
+
element.focus();
|
|
197
|
+
this.choose(entry.key, "item-press", event);
|
|
198
|
+
this.flush();
|
|
199
|
+
}
|
|
200
|
+
static {
|
|
201
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
202
|
+
minVersion: "12.0.0",
|
|
203
|
+
version: "22.2.6",
|
|
204
|
+
ngImport: i0,
|
|
205
|
+
type: ColorSwatchPickerRoot,
|
|
206
|
+
deps: [],
|
|
207
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
static {
|
|
211
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
212
|
+
minVersion: "17.1.0",
|
|
213
|
+
version: "22.2.6",
|
|
214
|
+
type: ColorSwatchPickerRoot,
|
|
215
|
+
isStandalone: true,
|
|
216
|
+
selector: "[colorSwatchPickerRoot]",
|
|
217
|
+
inputs: {
|
|
218
|
+
value: {
|
|
219
|
+
classPropertyName: "value",
|
|
220
|
+
publicName: "value",
|
|
221
|
+
isSignal: true,
|
|
222
|
+
isRequired: false,
|
|
223
|
+
transformFunction: null
|
|
224
|
+
},
|
|
225
|
+
defaultValue: {
|
|
226
|
+
classPropertyName: "defaultValue",
|
|
227
|
+
publicName: "defaultValue",
|
|
228
|
+
isSignal: true,
|
|
229
|
+
isRequired: false,
|
|
230
|
+
transformFunction: null
|
|
231
|
+
},
|
|
232
|
+
disabled: {
|
|
233
|
+
classPropertyName: "disabled",
|
|
234
|
+
publicName: "disabled",
|
|
235
|
+
isSignal: true,
|
|
236
|
+
isRequired: false,
|
|
237
|
+
transformFunction: null
|
|
238
|
+
},
|
|
239
|
+
name: {
|
|
240
|
+
classPropertyName: "name",
|
|
241
|
+
publicName: "name",
|
|
242
|
+
isSignal: true,
|
|
243
|
+
isRequired: false,
|
|
244
|
+
transformFunction: null
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
outputs: {
|
|
248
|
+
valueChange: "valueChange",
|
|
249
|
+
valueChangeDetails: "valueChangeDetails"
|
|
250
|
+
},
|
|
251
|
+
host: {
|
|
252
|
+
attributes: {
|
|
253
|
+
"role": "listbox",
|
|
254
|
+
"aria-orientation": "horizontal",
|
|
255
|
+
"data-primitives-part": "color-swatch-picker-root"
|
|
256
|
+
},
|
|
257
|
+
listeners: {
|
|
258
|
+
"keydown": "onKeyDown($event)",
|
|
259
|
+
"focusin": "field.focused()",
|
|
260
|
+
"focusout": "onFocusOut($event)"
|
|
261
|
+
},
|
|
262
|
+
properties: {
|
|
263
|
+
"attr.aria-disabled": "isDisabled() ? 'true' : null",
|
|
264
|
+
"attr.data-invalid": "field.data().invalid",
|
|
265
|
+
"attr.data-valid": "field.data().valid",
|
|
266
|
+
"attr.data-dirty": "field.data().dirty",
|
|
267
|
+
"attr.data-touched": "field.data().touched",
|
|
268
|
+
"attr.data-filled": "field.data().filled",
|
|
269
|
+
"attr.data-focused": "field.data().focused",
|
|
270
|
+
"attr.data-disabled": "data().disabled"
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
exportAs: ["colorSwatchPickerRoot"],
|
|
274
|
+
ngImport: i0
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
};
|
|
278
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
279
|
+
minVersion: "12.0.0",
|
|
280
|
+
version: "22.2.6",
|
|
281
|
+
ngImport: i0,
|
|
282
|
+
type: ColorSwatchPickerRoot,
|
|
283
|
+
decorators: [{
|
|
284
|
+
type: Directive,
|
|
285
|
+
args: [{
|
|
286
|
+
selector: "[colorSwatchPickerRoot]",
|
|
287
|
+
exportAs: "colorSwatchPickerRoot",
|
|
288
|
+
host: {
|
|
289
|
+
role: "listbox",
|
|
290
|
+
"aria-orientation": "horizontal",
|
|
291
|
+
"data-primitives-part": "color-swatch-picker-root",
|
|
292
|
+
"[attr.aria-disabled]": "isDisabled() ? 'true' : null",
|
|
293
|
+
"[attr.data-invalid]": "field.data().invalid",
|
|
294
|
+
"[attr.data-valid]": "field.data().valid",
|
|
295
|
+
"[attr.data-dirty]": "field.data().dirty",
|
|
296
|
+
"[attr.data-touched]": "field.data().touched",
|
|
297
|
+
"[attr.data-filled]": "field.data().filled",
|
|
298
|
+
"[attr.data-focused]": "field.data().focused",
|
|
299
|
+
"[attr.data-disabled]": "data().disabled",
|
|
300
|
+
"(keydown)": "onKeyDown($event)",
|
|
301
|
+
"(focusin)": "field.focused()",
|
|
302
|
+
"(focusout)": "onFocusOut($event)"
|
|
303
|
+
}
|
|
304
|
+
}]
|
|
305
|
+
}],
|
|
306
|
+
ctorParameters: () => [],
|
|
307
|
+
propDecorators: {
|
|
308
|
+
value: [{
|
|
309
|
+
type: i0.Input,
|
|
310
|
+
args: [{
|
|
311
|
+
isSignal: true,
|
|
312
|
+
alias: "value",
|
|
313
|
+
required: false
|
|
314
|
+
}]
|
|
315
|
+
}],
|
|
316
|
+
valueChange: [{
|
|
317
|
+
type: i0.Output,
|
|
318
|
+
args: ["valueChange"]
|
|
319
|
+
}],
|
|
320
|
+
defaultValue: [{
|
|
321
|
+
type: i0.Input,
|
|
322
|
+
args: [{
|
|
323
|
+
isSignal: true,
|
|
324
|
+
alias: "defaultValue",
|
|
325
|
+
required: false
|
|
326
|
+
}]
|
|
327
|
+
}],
|
|
328
|
+
valueChangeDetails: [{
|
|
329
|
+
type: i0.Output,
|
|
330
|
+
args: ["valueChangeDetails"]
|
|
331
|
+
}],
|
|
332
|
+
disabled: [{
|
|
333
|
+
type: i0.Input,
|
|
334
|
+
args: [{
|
|
335
|
+
isSignal: true,
|
|
336
|
+
alias: "disabled",
|
|
337
|
+
required: false
|
|
338
|
+
}]
|
|
339
|
+
}],
|
|
340
|
+
name: [{
|
|
341
|
+
type: i0.Input,
|
|
342
|
+
args: [{
|
|
343
|
+
isSignal: true,
|
|
344
|
+
alias: "name",
|
|
345
|
+
required: false
|
|
346
|
+
}]
|
|
347
|
+
}]
|
|
348
|
+
}
|
|
349
|
+
});
|
|
350
|
+
const BLACK = {
|
|
351
|
+
space: "rgb",
|
|
352
|
+
red: 0,
|
|
353
|
+
green: 0,
|
|
354
|
+
blue: 0,
|
|
355
|
+
alpha: 1
|
|
356
|
+
};
|
|
357
|
+
var ColorSwatchPickerItem = class ColorSwatchPickerItem {
|
|
358
|
+
constructor() {
|
|
359
|
+
this.value = input.required(...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
|
|
360
|
+
this.disabled = input(false, {
|
|
361
|
+
...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
|
|
362
|
+
transform: booleanAttribute
|
|
363
|
+
});
|
|
364
|
+
this.root = injectEnclosing(ColorSwatchPickerRoot, "colorSwatchPickerRoot", "colorSwatchPickerItem");
|
|
365
|
+
this.host = injectHost();
|
|
366
|
+
this.itemId = injectId("primitives-color-swatch-picker-item");
|
|
367
|
+
this.color = computed(() => parseColor(this.value()) ?? BLACK, ...ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []);
|
|
368
|
+
this.key = computed(() => formatColor(this.color(), "hexa"), ...ngDevMode ? [{ debugName: "key" }] : /* istanbul ignore next */ []);
|
|
369
|
+
this.css = computed(() => formatColor(this.color(), "css"), ...ngDevMode ? [{ debugName: "css" }] : /* istanbul ignore next */ []);
|
|
370
|
+
this.state = computed(() => ({
|
|
371
|
+
color: this.color(),
|
|
372
|
+
selected: this.root.selected() === this.key(),
|
|
373
|
+
highlighted: this.root.highlighted() === this.host,
|
|
374
|
+
disabled: this.disabled() || this.root.isDisabled()
|
|
375
|
+
}), ...ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []);
|
|
376
|
+
this.data = computed(() => dataValues({
|
|
377
|
+
selected: this.state().selected,
|
|
378
|
+
highlighted: this.state().highlighted,
|
|
379
|
+
disabled: this.state().disabled
|
|
380
|
+
}), ...ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []);
|
|
381
|
+
this.tabIndex = computed(() => {
|
|
382
|
+
if (this.root.isDisabled()) return null;
|
|
383
|
+
return this.root.tabStop() === this.host ? 0 : -1;
|
|
384
|
+
}, ...ngDevMode ? [{ debugName: "tabIndex" }] : /* istanbul ignore next */ []);
|
|
385
|
+
const host = this.host;
|
|
386
|
+
const root = this.root;
|
|
387
|
+
effect((onCleanup) => {
|
|
388
|
+
const entry = {
|
|
389
|
+
element: host,
|
|
390
|
+
key: this.key(),
|
|
391
|
+
color: this.color(),
|
|
392
|
+
disabled: this.disabled()
|
|
393
|
+
};
|
|
394
|
+
onCleanup(untracked(() => root.register(entry)));
|
|
395
|
+
});
|
|
396
|
+
}
|
|
397
|
+
static {
|
|
398
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
399
|
+
minVersion: "12.0.0",
|
|
400
|
+
version: "22.2.6",
|
|
401
|
+
ngImport: i0,
|
|
402
|
+
type: ColorSwatchPickerItem,
|
|
403
|
+
deps: [],
|
|
404
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
405
|
+
});
|
|
406
|
+
}
|
|
407
|
+
static {
|
|
408
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
409
|
+
minVersion: "17.1.0",
|
|
410
|
+
version: "22.2.6",
|
|
411
|
+
type: ColorSwatchPickerItem,
|
|
412
|
+
isStandalone: true,
|
|
413
|
+
selector: "[colorSwatchPickerItem]",
|
|
414
|
+
inputs: {
|
|
415
|
+
value: {
|
|
416
|
+
classPropertyName: "value",
|
|
417
|
+
publicName: "value",
|
|
418
|
+
isSignal: true,
|
|
419
|
+
isRequired: true,
|
|
420
|
+
transformFunction: null
|
|
421
|
+
},
|
|
422
|
+
disabled: {
|
|
423
|
+
classPropertyName: "disabled",
|
|
424
|
+
publicName: "disabled",
|
|
425
|
+
isSignal: true,
|
|
426
|
+
isRequired: false,
|
|
427
|
+
transformFunction: null
|
|
428
|
+
}
|
|
429
|
+
},
|
|
430
|
+
host: {
|
|
431
|
+
attributes: {
|
|
432
|
+
"role": "option",
|
|
433
|
+
"data-primitives-part": "color-swatch-picker-item"
|
|
434
|
+
},
|
|
435
|
+
listeners: {
|
|
436
|
+
"focus": "root.focused(host)",
|
|
437
|
+
"click": "root.press(host, $event)"
|
|
438
|
+
},
|
|
439
|
+
properties: {
|
|
440
|
+
"attr.id": "itemId",
|
|
441
|
+
"attr.tabindex": "tabIndex()",
|
|
442
|
+
"attr.aria-selected": "state().selected ? 'true' : 'false'",
|
|
443
|
+
"attr.aria-disabled": "state().disabled ? 'true' : null",
|
|
444
|
+
"attr.data-selected": "data().selected",
|
|
445
|
+
"attr.data-highlighted": "data().highlighted",
|
|
446
|
+
"attr.data-disabled": "data().disabled",
|
|
447
|
+
"style.--color-swatch-picker-item-color": "css()"
|
|
448
|
+
}
|
|
449
|
+
},
|
|
450
|
+
exportAs: ["colorSwatchPickerItem"],
|
|
451
|
+
ngImport: i0
|
|
452
|
+
});
|
|
453
|
+
}
|
|
454
|
+
};
|
|
455
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
456
|
+
minVersion: "12.0.0",
|
|
457
|
+
version: "22.2.6",
|
|
458
|
+
ngImport: i0,
|
|
459
|
+
type: ColorSwatchPickerItem,
|
|
460
|
+
decorators: [{
|
|
461
|
+
type: Directive,
|
|
462
|
+
args: [{
|
|
463
|
+
selector: "[colorSwatchPickerItem]",
|
|
464
|
+
exportAs: "colorSwatchPickerItem",
|
|
465
|
+
host: {
|
|
466
|
+
role: "option",
|
|
467
|
+
"data-primitives-part": "color-swatch-picker-item",
|
|
468
|
+
"[attr.id]": "itemId",
|
|
469
|
+
"[attr.tabindex]": "tabIndex()",
|
|
470
|
+
"[attr.aria-selected]": "state().selected ? 'true' : 'false'",
|
|
471
|
+
"[attr.aria-disabled]": "state().disabled ? 'true' : null",
|
|
472
|
+
"[attr.data-selected]": "data().selected",
|
|
473
|
+
"[attr.data-highlighted]": "data().highlighted",
|
|
474
|
+
"[attr.data-disabled]": "data().disabled",
|
|
475
|
+
"[style.--color-swatch-picker-item-color]": "css()",
|
|
476
|
+
"(focus)": "root.focused(host)",
|
|
477
|
+
"(click)": "root.press(host, $event)"
|
|
478
|
+
}
|
|
479
|
+
}]
|
|
480
|
+
}],
|
|
481
|
+
ctorParameters: () => [],
|
|
482
|
+
propDecorators: {
|
|
483
|
+
value: [{
|
|
484
|
+
type: i0.Input,
|
|
485
|
+
args: [{
|
|
486
|
+
isSignal: true,
|
|
487
|
+
alias: "value",
|
|
488
|
+
required: true
|
|
489
|
+
}]
|
|
490
|
+
}],
|
|
491
|
+
disabled: [{
|
|
492
|
+
type: i0.Input,
|
|
493
|
+
args: [{
|
|
494
|
+
isSignal: true,
|
|
495
|
+
alias: "disabled",
|
|
496
|
+
required: false
|
|
497
|
+
}]
|
|
498
|
+
}]
|
|
499
|
+
}
|
|
500
|
+
});
|
|
501
|
+
export { ColorSwatchPickerItem, ColorSwatchPickerRoot };
|
|
502
|
+
|
|
503
|
+
//# sourceMappingURL=fragiola-primitives-angular-color-swatch-picker.mjs.map
|