@slotted/angular 0.0.0-stage → 0.1.0-beta.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 +51 -2
- package/docs/AGENTS.snippet.md +10 -0
- package/docs/accordion.json +345 -0
- package/docs/accordion.md +207 -0
- package/docs/action-bar.json +421 -0
- package/docs/action-bar.md +364 -0
- package/docs/action-sheet.json +210 -0
- package/docs/action-sheet.md +19 -0
- package/docs/alert.json +407 -0
- package/docs/alert.md +239 -0
- package/docs/app-shell.examples.md +349 -0
- package/docs/app-shell.json +835 -0
- package/docs/app-shell.md +214 -0
- package/docs/aspect-ratio.json +159 -0
- package/docs/aspect-ratio.md +134 -0
- package/docs/attachment.json +486 -0
- package/docs/attachment.md +253 -0
- package/docs/avatar-group.json +208 -0
- package/docs/avatar-group.md +130 -0
- package/docs/avatar.json +342 -0
- package/docs/avatar.md +142 -0
- package/docs/badge.json +334 -0
- package/docs/badge.md +138 -0
- package/docs/breadcrumb.json +368 -0
- package/docs/breadcrumb.md +237 -0
- package/docs/button-group.json +158 -0
- package/docs/button-group.md +72 -0
- package/docs/button.examples.md +621 -0
- package/docs/button.json +977 -0
- package/docs/button.md +200 -0
- package/docs/calendar.json +592 -0
- package/docs/calendar.md +242 -0
- package/docs/card.json +283 -0
- package/docs/card.md +130 -0
- package/docs/carousel.json +560 -0
- package/docs/carousel.md +357 -0
- package/docs/cascader.json +933 -0
- package/docs/cascader.md +379 -0
- package/docs/chart.examples.md +582 -0
- package/docs/chart.json +1359 -0
- package/docs/chart.md +187 -0
- package/docs/checkbox-group.examples.md +612 -0
- package/docs/checkbox-group.json +395 -0
- package/docs/checkbox-group.md +106 -0
- package/docs/checkbox.examples.md +546 -0
- package/docs/checkbox.json +506 -0
- package/docs/checkbox.md +104 -0
- package/docs/code-block.json +616 -0
- package/docs/code-block.md +303 -0
- package/docs/collapsible.json +456 -0
- package/docs/collapsible.md +261 -0
- package/docs/color-picker.json +523 -0
- package/docs/color-picker.md +201 -0
- package/docs/column-manager.json +486 -0
- package/docs/column-manager.md +277 -0
- package/docs/combobox.examples.md +1732 -0
- package/docs/combobox.json +1250 -0
- package/docs/combobox.md +209 -0
- package/docs/command-palette.json +800 -0
- package/docs/command-palette.md +419 -0
- package/docs/container.json +156 -0
- package/docs/container.md +92 -0
- package/docs/context-menu.json +231 -0
- package/docs/context-menu.md +176 -0
- package/docs/currency-field.examples.md +321 -0
- package/docs/currency-field.json +649 -0
- package/docs/currency-field.md +128 -0
- package/docs/dashboard-grid.json +680 -0
- package/docs/dashboard-grid.md +265 -0
- package/docs/data-grid.examples.md +3064 -0
- package/docs/data-grid.json +1577 -0
- package/docs/data-grid.md +237 -0
- package/docs/data-grid.props.md +81 -0
- package/docs/data-list.json +685 -0
- package/docs/data-list.md +327 -0
- package/docs/date-field.json +490 -0
- package/docs/date-field.md +235 -0
- package/docs/date-picker.examples.md +1226 -0
- package/docs/date-picker.json +696 -0
- package/docs/date-picker.md +121 -0
- package/docs/date-range-picker.examples.md +1300 -0
- package/docs/date-range-picker.json +903 -0
- package/docs/date-range-picker.md +142 -0
- package/docs/datetime-field.json +665 -0
- package/docs/datetime-field.md +337 -0
- package/docs/datetime-picker.examples.md +1269 -0
- package/docs/datetime-picker.json +928 -0
- package/docs/datetime-picker.md +150 -0
- package/docs/datetime-range-picker.examples.md +225 -0
- package/docs/datetime-range-picker.json +1015 -0
- package/docs/datetime-range-picker.md +162 -0
- package/docs/description-list.json +471 -0
- package/docs/description-list.md +268 -0
- package/docs/detail-panel.json +530 -0
- package/docs/detail-panel.md +361 -0
- package/docs/dialog.examples.md +2467 -0
- package/docs/dialog.json +1141 -0
- package/docs/dialog.md +217 -0
- package/docs/dialog.props.md +63 -0
- package/docs/divider.json +148 -0
- package/docs/divider.md +83 -0
- package/docs/drawer.examples.md +1929 -0
- package/docs/drawer.json +753 -0
- package/docs/drawer.md +199 -0
- package/docs/entity-picker.json +946 -0
- package/docs/entity-picker.md +365 -0
- package/docs/event-calendar.examples.md +308 -0
- package/docs/event-calendar.json +1202 -0
- package/docs/event-calendar.md +201 -0
- package/docs/field-group.json +333 -0
- package/docs/field-group.md +181 -0
- package/docs/field.examples.md +676 -0
- package/docs/field.json +528 -0
- package/docs/field.md +127 -0
- package/docs/filter-bar.json +817 -0
- package/docs/filter-bar.md +380 -0
- package/docs/form.json +378 -0
- package/docs/form.md +235 -0
- package/docs/fullscreen.json +395 -0
- package/docs/fullscreen.md +225 -0
- package/docs/grid.json +176 -0
- package/docs/grid.md +74 -0
- package/docs/highlight.json +279 -0
- package/docs/highlight.md +210 -0
- package/docs/hover-card.json +254 -0
- package/docs/hover-card.md +213 -0
- package/docs/icon.json +173 -0
- package/docs/icon.md +101 -0
- package/docs/image.json +476 -0
- package/docs/image.md +254 -0
- package/docs/import-export-center.json +836 -0
- package/docs/import-export-center.md +345 -0
- package/docs/index.md +141 -0
- package/docs/inline-message.json +312 -0
- package/docs/inline-message.md +191 -0
- package/docs/inline.json +149 -0
- package/docs/inline.md +72 -0
- package/docs/kbd.json +350 -0
- package/docs/kbd.md +210 -0
- package/docs/link.json +264 -0
- package/docs/link.md +167 -0
- package/docs/list-item.json +463 -0
- package/docs/list-item.md +236 -0
- package/docs/list.json +321 -0
- package/docs/list.md +185 -0
- package/docs/listbox.json +807 -0
- package/docs/listbox.md +413 -0
- package/docs/loading-overlay.json +440 -0
- package/docs/loading-overlay.md +248 -0
- package/docs/markdown.json +461 -0
- package/docs/markdown.md +266 -0
- package/docs/menu.examples.md +1651 -0
- package/docs/menu.json +922 -0
- package/docs/menu.md +155 -0
- package/docs/menubar.json +292 -0
- package/docs/menubar.md +173 -0
- package/docs/message-scroller.json +401 -0
- package/docs/message-scroller.md +212 -0
- package/docs/message.json +862 -0
- package/docs/message.md +473 -0
- package/docs/multi-select.examples.md +1922 -0
- package/docs/multi-select.json +1314 -0
- package/docs/multi-select.md +213 -0
- package/docs/navigation-menu.json +529 -0
- package/docs/navigation-menu.md +329 -0
- package/docs/notification-center.json +664 -0
- package/docs/notification-center.md +372 -0
- package/docs/number-field.examples.md +1078 -0
- package/docs/number-field.json +668 -0
- package/docs/number-field.md +137 -0
- package/docs/otp-input.json +479 -0
- package/docs/otp-input.md +291 -0
- package/docs/page-header.json +574 -0
- package/docs/page-header.md +338 -0
- package/docs/page.json +332 -0
- package/docs/page.md +184 -0
- package/docs/pagination.json +434 -0
- package/docs/pagination.md +238 -0
- package/docs/popover.examples.md +1235 -0
- package/docs/popover.json +656 -0
- package/docs/popover.md +199 -0
- package/docs/progress-indicator.json +501 -0
- package/docs/progress-indicator.md +329 -0
- package/docs/prompt-composer.json +498 -0
- package/docs/prompt-composer.md +278 -0
- package/docs/prose.json +357 -0
- package/docs/prose.md +226 -0
- package/docs/radio-group.examples.md +626 -0
- package/docs/radio-group.json +541 -0
- package/docs/radio-group.md +112 -0
- package/docs/rating.json +1053 -0
- package/docs/rating.md +435 -0
- package/docs/result-state.json +376 -0
- package/docs/result-state.md +286 -0
- package/docs/saved-views.json +384 -0
- package/docs/saved-views.md +242 -0
- package/docs/scroll-area.json +120 -0
- package/docs/scroll-area.md +8 -0
- package/docs/section.json +344 -0
- package/docs/section.md +208 -0
- package/docs/segmented-control.json +429 -0
- package/docs/segmented-control.md +240 -0
- package/docs/select.examples.md +1214 -0
- package/docs/select.json +1147 -0
- package/docs/select.md +199 -0
- package/docs/side-navigation.json +632 -0
- package/docs/side-navigation.md +430 -0
- package/docs/skeleton.json +358 -0
- package/docs/skeleton.md +223 -0
- package/docs/slider.json +522 -0
- package/docs/slider.md +261 -0
- package/docs/sparkline.json +426 -0
- package/docs/sparkline.md +206 -0
- package/docs/split-button.json +361 -0
- package/docs/split-button.md +275 -0
- package/docs/splitter.json +142 -0
- package/docs/splitter.md +14 -0
- package/docs/stack.json +135 -0
- package/docs/stack.md +74 -0
- package/docs/stat-card.json +529 -0
- package/docs/stat-card.md +270 -0
- package/docs/status-indicator.json +314 -0
- package/docs/status-indicator.md +197 -0
- package/docs/stepper.json +451 -0
- package/docs/stepper.md +250 -0
- package/docs/switch.json +451 -0
- package/docs/switch.md +508 -0
- package/docs/table-of-contents.json +553 -0
- package/docs/table-of-contents.md +289 -0
- package/docs/table.examples.md +1981 -0
- package/docs/table.json +1059 -0
- package/docs/table.md +290 -0
- package/docs/tabs.examples.md +1370 -0
- package/docs/tabs.json +661 -0
- package/docs/tabs.md +211 -0
- package/docs/tag.json +813 -0
- package/docs/tag.md +241 -0
- package/docs/tags-input.json +771 -0
- package/docs/tags-input.md +361 -0
- package/docs/text-field.examples.md +821 -0
- package/docs/text-field.json +604 -0
- package/docs/text-field.md +125 -0
- package/docs/textarea.examples.md +612 -0
- package/docs/textarea.json +440 -0
- package/docs/textarea.md +98 -0
- package/docs/time-field.json +584 -0
- package/docs/time-field.md +291 -0
- package/docs/time-picker.json +679 -0
- package/docs/time-picker.md +315 -0
- package/docs/time-range-picker.examples.md +191 -0
- package/docs/time-range-picker.json +924 -0
- package/docs/time-range-picker.md +152 -0
- package/docs/timeline.json +839 -0
- package/docs/timeline.md +401 -0
- package/docs/toast.json +642 -0
- package/docs/toast.md +311 -0
- package/docs/toggle-group.json +417 -0
- package/docs/toggle-group.md +255 -0
- package/docs/toggle.json +326 -0
- package/docs/toggle.md +222 -0
- package/docs/toolbar.json +380 -0
- package/docs/toolbar.md +240 -0
- package/docs/tooltip.examples.md +664 -0
- package/docs/tooltip.json +604 -0
- package/docs/tooltip.md +146 -0
- package/docs/top-navigation.examples.md +287 -0
- package/docs/top-navigation.json +648 -0
- package/docs/top-navigation.md +138 -0
- package/docs/tour.json +759 -0
- package/docs/tour.md +337 -0
- package/docs/transfer.json +746 -0
- package/docs/transfer.md +273 -0
- package/docs/tree.json +918 -0
- package/docs/tree.md +397 -0
- package/docs/typography.json +317 -0
- package/docs/typography.md +107 -0
- package/docs/upload.examples.md +358 -0
- package/docs/upload.json +1103 -0
- package/docs/upload.md +166 -0
- package/docs/visually-hidden.json +71 -0
- package/docs/visually-hidden.md +42 -0
- package/docs/wizard.json +724 -0
- package/docs/wizard.md +295 -0
- package/fesm2022/slotted-angular-accordion.mjs +247 -0
- package/fesm2022/slotted-angular-accordion.mjs.map +1 -0
- package/fesm2022/slotted-angular-action-bar.mjs +639 -0
- package/fesm2022/slotted-angular-action-bar.mjs.map +1 -0
- package/fesm2022/slotted-angular-action-sheet.mjs +749 -0
- package/fesm2022/slotted-angular-action-sheet.mjs.map +1 -0
- package/fesm2022/slotted-angular-alert.mjs +427 -0
- package/fesm2022/slotted-angular-alert.mjs.map +1 -0
- package/fesm2022/slotted-angular-app-shell.mjs +1334 -0
- package/fesm2022/slotted-angular-app-shell.mjs.map +1 -0
- package/fesm2022/slotted-angular-aspect-ratio.mjs +63 -0
- package/fesm2022/slotted-angular-aspect-ratio.mjs.map +1 -0
- package/fesm2022/slotted-angular-attachment.mjs +595 -0
- package/fesm2022/slotted-angular-attachment.mjs.map +1 -0
- package/fesm2022/slotted-angular-avatar-group.mjs +230 -0
- package/fesm2022/slotted-angular-avatar-group.mjs.map +1 -0
- package/fesm2022/slotted-angular-avatar.mjs +330 -0
- package/fesm2022/slotted-angular-avatar.mjs.map +1 -0
- package/fesm2022/slotted-angular-badge.mjs +255 -0
- package/fesm2022/slotted-angular-badge.mjs.map +1 -0
- package/fesm2022/slotted-angular-breadcrumb.mjs +544 -0
- package/fesm2022/slotted-angular-breadcrumb.mjs.map +1 -0
- package/fesm2022/slotted-angular-button-group.mjs +146 -0
- package/fesm2022/slotted-angular-button-group.mjs.map +1 -0
- package/fesm2022/slotted-angular-button.mjs +692 -0
- package/fesm2022/slotted-angular-button.mjs.map +1 -0
- package/fesm2022/slotted-angular-calendar.mjs +916 -0
- package/fesm2022/slotted-angular-calendar.mjs.map +1 -0
- package/fesm2022/slotted-angular-card.mjs +225 -0
- package/fesm2022/slotted-angular-card.mjs.map +1 -0
- package/fesm2022/slotted-angular-carousel.mjs +840 -0
- package/fesm2022/slotted-angular-carousel.mjs.map +1 -0
- package/fesm2022/slotted-angular-cascader.mjs +1839 -0
- package/fesm2022/slotted-angular-cascader.mjs.map +1 -0
- package/fesm2022/slotted-angular-chart.mjs +974 -0
- package/fesm2022/slotted-angular-chart.mjs.map +1 -0
- package/fesm2022/slotted-angular-checkbox-group.mjs +283 -0
- package/fesm2022/slotted-angular-checkbox-group.mjs.map +1 -0
- package/fesm2022/slotted-angular-checkbox.mjs +468 -0
- package/fesm2022/slotted-angular-checkbox.mjs.map +1 -0
- package/fesm2022/slotted-angular-code-block.mjs +476 -0
- package/fesm2022/slotted-angular-code-block.mjs.map +1 -0
- package/fesm2022/slotted-angular-collapsible.mjs +479 -0
- package/fesm2022/slotted-angular-collapsible.mjs.map +1 -0
- package/fesm2022/slotted-angular-color-picker.mjs +910 -0
- package/fesm2022/slotted-angular-color-picker.mjs.map +1 -0
- package/fesm2022/slotted-angular-column-manager.mjs +1037 -0
- package/fesm2022/slotted-angular-column-manager.mjs.map +1 -0
- package/fesm2022/slotted-angular-combobox.mjs +1480 -0
- package/fesm2022/slotted-angular-combobox.mjs.map +1 -0
- package/fesm2022/slotted-angular-command-palette.mjs +1283 -0
- package/fesm2022/slotted-angular-command-palette.mjs.map +1 -0
- package/fesm2022/slotted-angular-container.mjs +105 -0
- package/fesm2022/slotted-angular-container.mjs.map +1 -0
- package/fesm2022/slotted-angular-context-menu.mjs +221 -0
- package/fesm2022/slotted-angular-context-menu.mjs.map +1 -0
- package/fesm2022/slotted-angular-currency-field.mjs +1131 -0
- package/fesm2022/slotted-angular-currency-field.mjs.map +1 -0
- package/fesm2022/slotted-angular-dashboard-grid.mjs +1928 -0
- package/fesm2022/slotted-angular-dashboard-grid.mjs.map +1 -0
- package/fesm2022/slotted-angular-data-grid.mjs +6697 -0
- package/fesm2022/slotted-angular-data-grid.mjs.map +1 -0
- package/fesm2022/slotted-angular-data-list.mjs +1418 -0
- package/fesm2022/slotted-angular-data-list.mjs.map +1 -0
- package/fesm2022/slotted-angular-date-field.mjs +772 -0
- package/fesm2022/slotted-angular-date-field.mjs.map +1 -0
- package/fesm2022/slotted-angular-date-picker.mjs +690 -0
- package/fesm2022/slotted-angular-date-picker.mjs.map +1 -0
- package/fesm2022/slotted-angular-date-range-picker.mjs +1150 -0
- package/fesm2022/slotted-angular-date-range-picker.mjs.map +1 -0
- package/fesm2022/slotted-angular-datetime-field.mjs +1058 -0
- package/fesm2022/slotted-angular-datetime-field.mjs.map +1 -0
- package/fesm2022/slotted-angular-datetime-picker.mjs +1362 -0
- package/fesm2022/slotted-angular-datetime-picker.mjs.map +1 -0
- package/fesm2022/slotted-angular-datetime-range-picker.mjs +1872 -0
- package/fesm2022/slotted-angular-datetime-range-picker.mjs.map +1 -0
- package/fesm2022/slotted-angular-description-list.mjs +545 -0
- package/fesm2022/slotted-angular-description-list.mjs.map +1 -0
- package/fesm2022/slotted-angular-detail-panel.mjs +754 -0
- package/fesm2022/slotted-angular-detail-panel.mjs.map +1 -0
- package/fesm2022/slotted-angular-dialog.mjs +980 -0
- package/fesm2022/slotted-angular-dialog.mjs.map +1 -0
- package/fesm2022/slotted-angular-divider.mjs +76 -0
- package/fesm2022/slotted-angular-divider.mjs.map +1 -0
- package/fesm2022/slotted-angular-drawer.mjs +1397 -0
- package/fesm2022/slotted-angular-drawer.mjs.map +1 -0
- package/fesm2022/slotted-angular-entity-picker.mjs +1987 -0
- package/fesm2022/slotted-angular-entity-picker.mjs.map +1 -0
- package/fesm2022/slotted-angular-event-calendar.mjs +2934 -0
- package/fesm2022/slotted-angular-event-calendar.mjs.map +1 -0
- package/fesm2022/slotted-angular-field-group.mjs +301 -0
- package/fesm2022/slotted-angular-field-group.mjs.map +1 -0
- package/fesm2022/slotted-angular-field.mjs +928 -0
- package/fesm2022/slotted-angular-field.mjs.map +1 -0
- package/fesm2022/slotted-angular-filter-bar.mjs +3107 -0
- package/fesm2022/slotted-angular-filter-bar.mjs.map +1 -0
- package/fesm2022/slotted-angular-form.mjs +592 -0
- package/fesm2022/slotted-angular-form.mjs.map +1 -0
- package/fesm2022/slotted-angular-fullscreen.mjs +314 -0
- package/fesm2022/slotted-angular-fullscreen.mjs.map +1 -0
- package/fesm2022/slotted-angular-grid.mjs +58 -0
- package/fesm2022/slotted-angular-grid.mjs.map +1 -0
- package/fesm2022/slotted-angular-highlight.mjs +123 -0
- package/fesm2022/slotted-angular-highlight.mjs.map +1 -0
- package/fesm2022/slotted-angular-hover-card.mjs +326 -0
- package/fesm2022/slotted-angular-hover-card.mjs.map +1 -0
- package/fesm2022/slotted-angular-i18n.mjs +75 -0
- package/fesm2022/slotted-angular-i18n.mjs.map +1 -0
- package/fesm2022/slotted-angular-icon.mjs +232 -0
- package/fesm2022/slotted-angular-icon.mjs.map +1 -0
- package/fesm2022/slotted-angular-image.mjs +442 -0
- package/fesm2022/slotted-angular-image.mjs.map +1 -0
- package/fesm2022/slotted-angular-import-export-center.mjs +1792 -0
- package/fesm2022/slotted-angular-import-export-center.mjs.map +1 -0
- package/fesm2022/slotted-angular-inline-message.mjs +280 -0
- package/fesm2022/slotted-angular-inline-message.mjs.map +1 -0
- package/fesm2022/slotted-angular-inline.mjs +52 -0
- package/fesm2022/slotted-angular-inline.mjs.map +1 -0
- package/fesm2022/slotted-angular-kbd.mjs +284 -0
- package/fesm2022/slotted-angular-kbd.mjs.map +1 -0
- package/fesm2022/slotted-angular-link.mjs +182 -0
- package/fesm2022/slotted-angular-link.mjs.map +1 -0
- package/fesm2022/slotted-angular-list-item.mjs +367 -0
- package/fesm2022/slotted-angular-list-item.mjs.map +1 -0
- package/fesm2022/slotted-angular-list.mjs +256 -0
- package/fesm2022/slotted-angular-list.mjs.map +1 -0
- package/fesm2022/slotted-angular-listbox.mjs +1274 -0
- package/fesm2022/slotted-angular-listbox.mjs.map +1 -0
- package/fesm2022/slotted-angular-loading-overlay.mjs +451 -0
- package/fesm2022/slotted-angular-loading-overlay.mjs.map +1 -0
- package/fesm2022/slotted-angular-markdown.mjs +914 -0
- package/fesm2022/slotted-angular-markdown.mjs.map +1 -0
- package/fesm2022/slotted-angular-menu.mjs +1211 -0
- package/fesm2022/slotted-angular-menu.mjs.map +1 -0
- package/fesm2022/slotted-angular-menubar.mjs +230 -0
- package/fesm2022/slotted-angular-menubar.mjs.map +1 -0
- package/fesm2022/slotted-angular-message-scroller.mjs +378 -0
- package/fesm2022/slotted-angular-message-scroller.mjs.map +1 -0
- package/fesm2022/slotted-angular-message.mjs +866 -0
- package/fesm2022/slotted-angular-message.mjs.map +1 -0
- package/fesm2022/slotted-angular-multi-select.mjs +1939 -0
- package/fesm2022/slotted-angular-multi-select.mjs.map +1 -0
- package/fesm2022/slotted-angular-navigation-menu.mjs +770 -0
- package/fesm2022/slotted-angular-navigation-menu.mjs.map +1 -0
- package/fesm2022/slotted-angular-notification-center.mjs +1172 -0
- package/fesm2022/slotted-angular-notification-center.mjs.map +1 -0
- package/fesm2022/slotted-angular-number-field.mjs +966 -0
- package/fesm2022/slotted-angular-number-field.mjs.map +1 -0
- package/fesm2022/slotted-angular-otp-input.mjs +629 -0
- package/fesm2022/slotted-angular-otp-input.mjs.map +1 -0
- package/fesm2022/slotted-angular-page-header.mjs +788 -0
- package/fesm2022/slotted-angular-page-header.mjs.map +1 -0
- package/fesm2022/slotted-angular-page.mjs +255 -0
- package/fesm2022/slotted-angular-page.mjs.map +1 -0
- package/fesm2022/slotted-angular-pagination.mjs +562 -0
- package/fesm2022/slotted-angular-pagination.mjs.map +1 -0
- package/fesm2022/slotted-angular-popover.mjs +799 -0
- package/fesm2022/slotted-angular-popover.mjs.map +1 -0
- package/fesm2022/slotted-angular-progress-indicator.mjs +572 -0
- package/fesm2022/slotted-angular-progress-indicator.mjs.map +1 -0
- package/fesm2022/slotted-angular-prompt-composer.mjs +596 -0
- package/fesm2022/slotted-angular-prompt-composer.mjs.map +1 -0
- package/fesm2022/slotted-angular-prose.mjs +314 -0
- package/fesm2022/slotted-angular-prose.mjs.map +1 -0
- package/fesm2022/slotted-angular-radio-group.mjs +469 -0
- package/fesm2022/slotted-angular-radio-group.mjs.map +1 -0
- package/fesm2022/slotted-angular-rating.mjs +1174 -0
- package/fesm2022/slotted-angular-rating.mjs.map +1 -0
- package/fesm2022/slotted-angular-result-state.mjs +330 -0
- package/fesm2022/slotted-angular-result-state.mjs.map +1 -0
- package/fesm2022/slotted-angular-saved-views.mjs +877 -0
- package/fesm2022/slotted-angular-saved-views.mjs.map +1 -0
- package/fesm2022/slotted-angular-scroll-area.mjs +294 -0
- package/fesm2022/slotted-angular-scroll-area.mjs.map +1 -0
- package/fesm2022/slotted-angular-section.mjs +266 -0
- package/fesm2022/slotted-angular-section.mjs.map +1 -0
- package/fesm2022/slotted-angular-segmented-control.mjs +454 -0
- package/fesm2022/slotted-angular-segmented-control.mjs.map +1 -0
- package/fesm2022/slotted-angular-select.mjs +1899 -0
- package/fesm2022/slotted-angular-select.mjs.map +1 -0
- package/fesm2022/slotted-angular-side-navigation.mjs +1042 -0
- package/fesm2022/slotted-angular-side-navigation.mjs.map +1 -0
- package/fesm2022/slotted-angular-skeleton.mjs +316 -0
- package/fesm2022/slotted-angular-skeleton.mjs.map +1 -0
- package/fesm2022/slotted-angular-slider.mjs +586 -0
- package/fesm2022/slotted-angular-slider.mjs.map +1 -0
- package/fesm2022/slotted-angular-sparkline.mjs +235 -0
- package/fesm2022/slotted-angular-sparkline.mjs.map +1 -0
- package/fesm2022/slotted-angular-split-button.mjs +331 -0
- package/fesm2022/slotted-angular-split-button.mjs.map +1 -0
- package/fesm2022/slotted-angular-splitter.mjs +516 -0
- package/fesm2022/slotted-angular-splitter.mjs.map +1 -0
- package/fesm2022/slotted-angular-stack.mjs +48 -0
- package/fesm2022/slotted-angular-stack.mjs.map +1 -0
- package/fesm2022/slotted-angular-stat-card.mjs +478 -0
- package/fesm2022/slotted-angular-stat-card.mjs.map +1 -0
- package/fesm2022/slotted-angular-status-indicator.mjs +155 -0
- package/fesm2022/slotted-angular-status-indicator.mjs.map +1 -0
- package/fesm2022/slotted-angular-stepper.mjs +536 -0
- package/fesm2022/slotted-angular-stepper.mjs.map +1 -0
- package/fesm2022/slotted-angular-switch.mjs +447 -0
- package/fesm2022/slotted-angular-switch.mjs.map +1 -0
- package/fesm2022/slotted-angular-table-of-contents.mjs +750 -0
- package/fesm2022/slotted-angular-table-of-contents.mjs.map +1 -0
- package/fesm2022/slotted-angular-table.mjs +2518 -0
- package/fesm2022/slotted-angular-table.mjs.map +1 -0
- package/fesm2022/slotted-angular-tabs.mjs +829 -0
- package/fesm2022/slotted-angular-tabs.mjs.map +1 -0
- package/fesm2022/slotted-angular-tag.mjs +595 -0
- package/fesm2022/slotted-angular-tag.mjs.map +1 -0
- package/fesm2022/slotted-angular-tags-input.mjs +1211 -0
- package/fesm2022/slotted-angular-tags-input.mjs.map +1 -0
- package/fesm2022/slotted-angular-text-field.mjs +674 -0
- package/fesm2022/slotted-angular-text-field.mjs.map +1 -0
- package/fesm2022/slotted-angular-textarea.mjs +275 -0
- package/fesm2022/slotted-angular-textarea.mjs.map +1 -0
- package/fesm2022/slotted-angular-theme.mjs +45 -0
- package/fesm2022/slotted-angular-theme.mjs.map +1 -0
- package/fesm2022/slotted-angular-time-field.mjs +895 -0
- package/fesm2022/slotted-angular-time-field.mjs.map +1 -0
- package/fesm2022/slotted-angular-time-picker.mjs +856 -0
- package/fesm2022/slotted-angular-time-picker.mjs.map +1 -0
- package/fesm2022/slotted-angular-time-range-picker.mjs +1534 -0
- package/fesm2022/slotted-angular-time-range-picker.mjs.map +1 -0
- package/fesm2022/slotted-angular-timeline.mjs +928 -0
- package/fesm2022/slotted-angular-timeline.mjs.map +1 -0
- package/fesm2022/slotted-angular-toast.mjs +917 -0
- package/fesm2022/slotted-angular-toast.mjs.map +1 -0
- package/fesm2022/slotted-angular-toggle-group.mjs +311 -0
- package/fesm2022/slotted-angular-toggle-group.mjs.map +1 -0
- package/fesm2022/slotted-angular-toggle.mjs +162 -0
- package/fesm2022/slotted-angular-toggle.mjs.map +1 -0
- package/fesm2022/slotted-angular-toolbar.mjs +536 -0
- package/fesm2022/slotted-angular-toolbar.mjs.map +1 -0
- package/fesm2022/slotted-angular-tooltip.mjs +798 -0
- package/fesm2022/slotted-angular-tooltip.mjs.map +1 -0
- package/fesm2022/slotted-angular-top-navigation.mjs +1308 -0
- package/fesm2022/slotted-angular-top-navigation.mjs.map +1 -0
- package/fesm2022/slotted-angular-tour.mjs +1330 -0
- package/fesm2022/slotted-angular-tour.mjs.map +1 -0
- package/fesm2022/slotted-angular-transfer.mjs +1406 -0
- package/fesm2022/slotted-angular-transfer.mjs.map +1 -0
- package/fesm2022/slotted-angular-tree.mjs +1448 -0
- package/fesm2022/slotted-angular-tree.mjs.map +1 -0
- package/fesm2022/slotted-angular-typography.mjs +184 -0
- package/fesm2022/slotted-angular-typography.mjs.map +1 -0
- package/fesm2022/slotted-angular-upload.mjs +1523 -0
- package/fesm2022/slotted-angular-upload.mjs.map +1 -0
- package/fesm2022/slotted-angular-visually-hidden.mjs +32 -0
- package/fesm2022/slotted-angular-visually-hidden.mjs.map +1 -0
- package/fesm2022/slotted-angular-wizard.mjs +1715 -0
- package/fesm2022/slotted-angular-wizard.mjs.map +1 -0
- package/fesm2022/slotted-angular.mjs +4 -0
- package/fesm2022/slotted-angular.mjs.map +1 -0
- package/package.json +537 -3
- package/types/slotted-angular-accordion.d.ts +156 -0
- package/types/slotted-angular-accordion.d.ts.map +1 -0
- package/types/slotted-angular-action-bar.d.ts +291 -0
- package/types/slotted-angular-action-bar.d.ts.map +1 -0
- package/types/slotted-angular-action-sheet.d.ts +294 -0
- package/types/slotted-angular-action-sheet.d.ts.map +1 -0
- package/types/slotted-angular-alert.d.ts +214 -0
- package/types/slotted-angular-alert.d.ts.map +1 -0
- package/types/slotted-angular-app-shell.d.ts +549 -0
- package/types/slotted-angular-app-shell.d.ts.map +1 -0
- package/types/slotted-angular-aspect-ratio.d.ts +57 -0
- package/types/slotted-angular-aspect-ratio.d.ts.map +1 -0
- package/types/slotted-angular-attachment.d.ts +294 -0
- package/types/slotted-angular-attachment.d.ts.map +1 -0
- package/types/slotted-angular-avatar-group.d.ts +119 -0
- package/types/slotted-angular-avatar-group.d.ts.map +1 -0
- package/types/slotted-angular-avatar.d.ts +202 -0
- package/types/slotted-angular-avatar.d.ts.map +1 -0
- package/types/slotted-angular-badge.d.ts +166 -0
- package/types/slotted-angular-badge.d.ts.map +1 -0
- package/types/slotted-angular-breadcrumb.d.ts +251 -0
- package/types/slotted-angular-breadcrumb.d.ts.map +1 -0
- package/types/slotted-angular-button-group.d.ts +89 -0
- package/types/slotted-angular-button-group.d.ts.map +1 -0
- package/types/slotted-angular-button.d.ts +390 -0
- package/types/slotted-angular-button.d.ts.map +1 -0
- package/types/slotted-angular-calendar.d.ts +280 -0
- package/types/slotted-angular-calendar.d.ts.map +1 -0
- package/types/slotted-angular-card.d.ts +140 -0
- package/types/slotted-angular-card.d.ts.map +1 -0
- package/types/slotted-angular-carousel.d.ts +288 -0
- package/types/slotted-angular-carousel.d.ts.map +1 -0
- package/types/slotted-angular-cascader.d.ts +351 -0
- package/types/slotted-angular-cascader.d.ts.map +1 -0
- package/types/slotted-angular-chart.d.ts +319 -0
- package/types/slotted-angular-chart.d.ts.map +1 -0
- package/types/slotted-angular-checkbox-group.d.ts +156 -0
- package/types/slotted-angular-checkbox-group.d.ts.map +1 -0
- package/types/slotted-angular-checkbox.d.ts +197 -0
- package/types/slotted-angular-checkbox.d.ts.map +1 -0
- package/types/slotted-angular-code-block.d.ts +158 -0
- package/types/slotted-angular-code-block.d.ts.map +1 -0
- package/types/slotted-angular-collapsible.d.ts +272 -0
- package/types/slotted-angular-collapsible.d.ts.map +1 -0
- package/types/slotted-angular-color-picker.d.ts +181 -0
- package/types/slotted-angular-color-picker.d.ts.map +1 -0
- package/types/slotted-angular-column-manager.d.ts +200 -0
- package/types/slotted-angular-column-manager.d.ts.map +1 -0
- package/types/slotted-angular-combobox.d.ts +449 -0
- package/types/slotted-angular-combobox.d.ts.map +1 -0
- package/types/slotted-angular-command-palette.d.ts +256 -0
- package/types/slotted-angular-command-palette.d.ts.map +1 -0
- package/types/slotted-angular-container.d.ts +84 -0
- package/types/slotted-angular-container.d.ts.map +1 -0
- package/types/slotted-angular-context-menu.d.ts +84 -0
- package/types/slotted-angular-context-menu.d.ts.map +1 -0
- package/types/slotted-angular-currency-field.d.ts +480 -0
- package/types/slotted-angular-currency-field.d.ts.map +1 -0
- package/types/slotted-angular-dashboard-grid.d.ts +341 -0
- package/types/slotted-angular-dashboard-grid.d.ts.map +1 -0
- package/types/slotted-angular-data-grid.d.ts +1077 -0
- package/types/slotted-angular-data-grid.d.ts.map +1 -0
- package/types/slotted-angular-data-list.d.ts +272 -0
- package/types/slotted-angular-data-list.d.ts.map +1 -0
- package/types/slotted-angular-date-field.d.ts +320 -0
- package/types/slotted-angular-date-field.d.ts.map +1 -0
- package/types/slotted-angular-date-picker.d.ts +224 -0
- package/types/slotted-angular-date-picker.d.ts.map +1 -0
- package/types/slotted-angular-date-range-picker.d.ts +310 -0
- package/types/slotted-angular-date-range-picker.d.ts.map +1 -0
- package/types/slotted-angular-datetime-field.d.ts +362 -0
- package/types/slotted-angular-datetime-field.d.ts.map +1 -0
- package/types/slotted-angular-datetime-picker.d.ts +370 -0
- package/types/slotted-angular-datetime-picker.d.ts.map +1 -0
- package/types/slotted-angular-datetime-range-picker.d.ts +459 -0
- package/types/slotted-angular-datetime-range-picker.d.ts.map +1 -0
- package/types/slotted-angular-description-list.d.ts +281 -0
- package/types/slotted-angular-description-list.d.ts.map +1 -0
- package/types/slotted-angular-detail-panel.d.ts +240 -0
- package/types/slotted-angular-detail-panel.d.ts.map +1 -0
- package/types/slotted-angular-dialog.d.ts +497 -0
- package/types/slotted-angular-dialog.d.ts.map +1 -0
- package/types/slotted-angular-divider.d.ts +40 -0
- package/types/slotted-angular-divider.d.ts.map +1 -0
- package/types/slotted-angular-drawer.d.ts +532 -0
- package/types/slotted-angular-drawer.d.ts.map +1 -0
- package/types/slotted-angular-entity-picker.d.ts +338 -0
- package/types/slotted-angular-entity-picker.d.ts.map +1 -0
- package/types/slotted-angular-event-calendar.d.ts +574 -0
- package/types/slotted-angular-event-calendar.d.ts.map +1 -0
- package/types/slotted-angular-field-group.d.ts +152 -0
- package/types/slotted-angular-field-group.d.ts.map +1 -0
- package/types/slotted-angular-field.d.ts +535 -0
- package/types/slotted-angular-field.d.ts.map +1 -0
- package/types/slotted-angular-filter-bar.d.ts +573 -0
- package/types/slotted-angular-filter-bar.d.ts.map +1 -0
- package/types/slotted-angular-form.d.ts +298 -0
- package/types/slotted-angular-form.d.ts.map +1 -0
- package/types/slotted-angular-fullscreen.d.ts +145 -0
- package/types/slotted-angular-fullscreen.d.ts.map +1 -0
- package/types/slotted-angular-grid.d.ts +50 -0
- package/types/slotted-angular-grid.d.ts.map +1 -0
- package/types/slotted-angular-highlight.d.ts +93 -0
- package/types/slotted-angular-highlight.d.ts.map +1 -0
- package/types/slotted-angular-hover-card.d.ts +140 -0
- package/types/slotted-angular-hover-card.d.ts.map +1 -0
- package/types/slotted-angular-i18n.d.ts +46 -0
- package/types/slotted-angular-i18n.d.ts.map +1 -0
- package/types/slotted-angular-icon.d.ts +94 -0
- package/types/slotted-angular-icon.d.ts.map +1 -0
- package/types/slotted-angular-image.d.ts +251 -0
- package/types/slotted-angular-image.d.ts.map +1 -0
- package/types/slotted-angular-import-export-center.d.ts +351 -0
- package/types/slotted-angular-import-export-center.d.ts.map +1 -0
- package/types/slotted-angular-inline-message.d.ts +195 -0
- package/types/slotted-angular-inline-message.d.ts.map +1 -0
- package/types/slotted-angular-inline.d.ts +41 -0
- package/types/slotted-angular-inline.d.ts.map +1 -0
- package/types/slotted-angular-kbd.d.ts +174 -0
- package/types/slotted-angular-kbd.d.ts.map +1 -0
- package/types/slotted-angular-link.d.ts +94 -0
- package/types/slotted-angular-link.d.ts.map +1 -0
- package/types/slotted-angular-list-item.d.ts +210 -0
- package/types/slotted-angular-list-item.d.ts.map +1 -0
- package/types/slotted-angular-list.d.ts +176 -0
- package/types/slotted-angular-list.d.ts.map +1 -0
- package/types/slotted-angular-listbox.d.ts +470 -0
- package/types/slotted-angular-listbox.d.ts.map +1 -0
- package/types/slotted-angular-loading-overlay.d.ts +219 -0
- package/types/slotted-angular-loading-overlay.d.ts.map +1 -0
- package/types/slotted-angular-markdown.d.ts +172 -0
- package/types/slotted-angular-markdown.d.ts.map +1 -0
- package/types/slotted-angular-menu.d.ts +448 -0
- package/types/slotted-angular-menu.d.ts.map +1 -0
- package/types/slotted-angular-menubar.d.ts +90 -0
- package/types/slotted-angular-menubar.d.ts.map +1 -0
- package/types/slotted-angular-message-scroller.d.ts +151 -0
- package/types/slotted-angular-message-scroller.d.ts.map +1 -0
- package/types/slotted-angular-message.d.ts +348 -0
- package/types/slotted-angular-message.d.ts.map +1 -0
- package/types/slotted-angular-multi-select.d.ts +462 -0
- package/types/slotted-angular-multi-select.d.ts.map +1 -0
- package/types/slotted-angular-navigation-menu.d.ts +309 -0
- package/types/slotted-angular-navigation-menu.d.ts.map +1 -0
- package/types/slotted-angular-notification-center.d.ts +318 -0
- package/types/slotted-angular-notification-center.d.ts.map +1 -0
- package/types/slotted-angular-number-field.d.ts +402 -0
- package/types/slotted-angular-number-field.d.ts.map +1 -0
- package/types/slotted-angular-otp-input.d.ts +286 -0
- package/types/slotted-angular-otp-input.d.ts.map +1 -0
- package/types/slotted-angular-page-header.d.ts +334 -0
- package/types/slotted-angular-page-header.d.ts.map +1 -0
- package/types/slotted-angular-page.d.ts +141 -0
- package/types/slotted-angular-page.d.ts.map +1 -0
- package/types/slotted-angular-pagination.d.ts +213 -0
- package/types/slotted-angular-pagination.d.ts.map +1 -0
- package/types/slotted-angular-popover.d.ts +366 -0
- package/types/slotted-angular-popover.d.ts.map +1 -0
- package/types/slotted-angular-progress-indicator.d.ts +312 -0
- package/types/slotted-angular-progress-indicator.d.ts.map +1 -0
- package/types/slotted-angular-prompt-composer.d.ts +242 -0
- package/types/slotted-angular-prompt-composer.d.ts.map +1 -0
- package/types/slotted-angular-prose.d.ts +171 -0
- package/types/slotted-angular-prose.d.ts.map +1 -0
- package/types/slotted-angular-radio-group.d.ts +268 -0
- package/types/slotted-angular-radio-group.d.ts.map +1 -0
- package/types/slotted-angular-rating.d.ts +374 -0
- package/types/slotted-angular-rating.d.ts.map +1 -0
- package/types/slotted-angular-result-state.d.ts +217 -0
- package/types/slotted-angular-result-state.d.ts.map +1 -0
- package/types/slotted-angular-saved-views.d.ts +198 -0
- package/types/slotted-angular-saved-views.d.ts.map +1 -0
- package/types/slotted-angular-scroll-area.d.ts +186 -0
- package/types/slotted-angular-scroll-area.d.ts.map +1 -0
- package/types/slotted-angular-section.d.ts +143 -0
- package/types/slotted-angular-section.d.ts.map +1 -0
- package/types/slotted-angular-segmented-control.d.ts +251 -0
- package/types/slotted-angular-segmented-control.d.ts.map +1 -0
- package/types/slotted-angular-select.d.ts +507 -0
- package/types/slotted-angular-select.d.ts.map +1 -0
- package/types/slotted-angular-side-navigation.d.ts +373 -0
- package/types/slotted-angular-side-navigation.d.ts.map +1 -0
- package/types/slotted-angular-skeleton.d.ts +198 -0
- package/types/slotted-angular-skeleton.d.ts.map +1 -0
- package/types/slotted-angular-slider.d.ts +216 -0
- package/types/slotted-angular-slider.d.ts.map +1 -0
- package/types/slotted-angular-sparkline.d.ts +106 -0
- package/types/slotted-angular-sparkline.d.ts.map +1 -0
- package/types/slotted-angular-split-button.d.ts +180 -0
- package/types/slotted-angular-split-button.d.ts.map +1 -0
- package/types/slotted-angular-splitter.d.ts +206 -0
- package/types/slotted-angular-splitter.d.ts.map +1 -0
- package/types/slotted-angular-stack.d.ts +38 -0
- package/types/slotted-angular-stack.d.ts.map +1 -0
- package/types/slotted-angular-stat-card.d.ts +232 -0
- package/types/slotted-angular-stat-card.d.ts.map +1 -0
- package/types/slotted-angular-status-indicator.d.ts +106 -0
- package/types/slotted-angular-status-indicator.d.ts.map +1 -0
- package/types/slotted-angular-stepper.d.ts +198 -0
- package/types/slotted-angular-stepper.d.ts.map +1 -0
- package/types/slotted-angular-switch.d.ts +243 -0
- package/types/slotted-angular-switch.d.ts.map +1 -0
- package/types/slotted-angular-table-of-contents.d.ts +210 -0
- package/types/slotted-angular-table-of-contents.d.ts.map +1 -0
- package/types/slotted-angular-table.d.ts +888 -0
- package/types/slotted-angular-table.d.ts.map +1 -0
- package/types/slotted-angular-tabs.d.ts +340 -0
- package/types/slotted-angular-tabs.d.ts.map +1 -0
- package/types/slotted-angular-tag.d.ts +279 -0
- package/types/slotted-angular-tag.d.ts.map +1 -0
- package/types/slotted-angular-tags-input.d.ts +302 -0
- package/types/slotted-angular-tags-input.d.ts.map +1 -0
- package/types/slotted-angular-text-field.d.ts +334 -0
- package/types/slotted-angular-text-field.d.ts.map +1 -0
- package/types/slotted-angular-textarea.d.ts +150 -0
- package/types/slotted-angular-textarea.d.ts.map +1 -0
- package/types/slotted-angular-theme.d.ts +26 -0
- package/types/slotted-angular-theme.d.ts.map +1 -0
- package/types/slotted-angular-time-field.d.ts +300 -0
- package/types/slotted-angular-time-field.d.ts.map +1 -0
- package/types/slotted-angular-time-picker.d.ts +260 -0
- package/types/slotted-angular-time-picker.d.ts.map +1 -0
- package/types/slotted-angular-time-range-picker.d.ts +401 -0
- package/types/slotted-angular-time-range-picker.d.ts.map +1 -0
- package/types/slotted-angular-timeline.d.ts +329 -0
- package/types/slotted-angular-timeline.d.ts.map +1 -0
- package/types/slotted-angular-toast.d.ts +340 -0
- package/types/slotted-angular-toast.d.ts.map +1 -0
- package/types/slotted-angular-toggle-group.d.ts +167 -0
- package/types/slotted-angular-toggle-group.d.ts.map +1 -0
- package/types/slotted-angular-toggle.d.ts +106 -0
- package/types/slotted-angular-toggle.d.ts.map +1 -0
- package/types/slotted-angular-toolbar.d.ts +252 -0
- package/types/slotted-angular-toolbar.d.ts.map +1 -0
- package/types/slotted-angular-tooltip.d.ts +388 -0
- package/types/slotted-angular-tooltip.d.ts.map +1 -0
- package/types/slotted-angular-top-navigation.d.ts +442 -0
- package/types/slotted-angular-top-navigation.d.ts.map +1 -0
- package/types/slotted-angular-tour.d.ts +440 -0
- package/types/slotted-angular-tour.d.ts.map +1 -0
- package/types/slotted-angular-transfer.d.ts +296 -0
- package/types/slotted-angular-transfer.d.ts.map +1 -0
- package/types/slotted-angular-tree.d.ts +499 -0
- package/types/slotted-angular-tree.d.ts.map +1 -0
- package/types/slotted-angular-typography.d.ts +89 -0
- package/types/slotted-angular-typography.d.ts.map +1 -0
- package/types/slotted-angular-upload.d.ts +365 -0
- package/types/slotted-angular-upload.d.ts.map +1 -0
- package/types/slotted-angular-visually-hidden.d.ts +19 -0
- package/types/slotted-angular-visually-hidden.d.ts.map +1 -0
- package/types/slotted-angular-wizard.d.ts +441 -0
- package/types/slotted-angular-wizard.d.ts.map +1 -0
- package/types/slotted-angular.d.ts +3 -0
- package/types/slotted-angular.d.ts.map +1 -0
|
@@ -0,0 +1,966 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { InjectionToken, inject, input, contentChild, computed, signal, DestroyRef, ViewEncapsulation, ChangeDetectionStrategy, Component, numberAttribute, booleanAttribute, output, ElementRef, HostAttributeToken, effect, forwardRef, Directive } from '@angular/core';
|
|
3
|
+
import { injectMessages, injectLocale } from '@slotted/angular/i18n';
|
|
4
|
+
import { SlGlyph, SlIcon } from '@slotted/angular/icon';
|
|
5
|
+
import { numberFieldMessages } from '@slotted/core/i18n';
|
|
6
|
+
import { STEP_REPEAT_DELAY_COARSE, STEP_REPEAT_DELAY, STEP_REPEAT_INTERVAL, createNumberFormat, snapToStep, stepNumber, SCRUB_SENSITIVITY, createScrub } from '@slotted/core/number';
|
|
7
|
+
import { SlField } from '@slotted/angular/field';
|
|
8
|
+
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
9
|
+
import { clamp } from '@slotted/core/measure';
|
|
10
|
+
import { createControllable } from '@slotted/core/state';
|
|
11
|
+
|
|
12
|
+
const FALLBACK = {
|
|
13
|
+
clamp: 'blur',
|
|
14
|
+
formatOn: 'change',
|
|
15
|
+
size: 'md',
|
|
16
|
+
stepper: 'stacked',
|
|
17
|
+
variant: 'outline',
|
|
18
|
+
};
|
|
19
|
+
const NUMBER_FIELD_DEFAULTS = new InjectionToken('slotted number field defaults', { providedIn: 'root', factory: () => FALLBACK });
|
|
20
|
+
/**
|
|
21
|
+
* An application decides once what its number fields look like, rather than
|
|
22
|
+
* repeating the same inputs on every amount in a form. A control that states
|
|
23
|
+
* any of them itself still wins.
|
|
24
|
+
*
|
|
25
|
+
* The locale and the two buttons' words come from the language in force
|
|
26
|
+
* (`provideSlotted`): one locale for the whole application decides the decimal
|
|
27
|
+
* separator, the grouping and the numbering system, and a form where one field
|
|
28
|
+
* reads `1.234` as a thousand and another as one point two three four is a
|
|
29
|
+
* form that loses money.
|
|
30
|
+
*/
|
|
31
|
+
function provideNumberFieldDefaults(defaults) {
|
|
32
|
+
return {
|
|
33
|
+
provide: NUMBER_FIELD_DEFAULTS,
|
|
34
|
+
useFactory: () => ({ ...FALLBACK, ...defaults }),
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/** What a number field renders as here, before it states anything of its own. */
|
|
38
|
+
function injectNumberFieldDefaults() {
|
|
39
|
+
return inject(NUMBER_FIELD_DEFAULTS);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* What the frame needs to know about the control inside it, and what the
|
|
43
|
+
* control needs the frame to call.
|
|
44
|
+
*
|
|
45
|
+
* It is an abstract class rather than an import so the two directives can
|
|
46
|
+
* depend on each other without a cycle — the shape `field` and `text-field`
|
|
47
|
+
* already have. The input provides itself as this, and the frame queries it.
|
|
48
|
+
*/
|
|
49
|
+
class SlNumberFieldControl {
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* The frame: one number, and the two buttons that move it.
|
|
54
|
+
*
|
|
55
|
+
* **It is not the control.** The element carrying `data-ui` is the consumer's
|
|
56
|
+
* own box with no role; the `input` inside it holds the value, the identifier
|
|
57
|
+
* and the APG's `spinbutton` role. WAI-ARIA settles the shape: a `spinbutton`
|
|
58
|
+
* may hold only non-interactive presentational children, so the two steppers
|
|
59
|
+
* are the control's siblings rather than its children.
|
|
60
|
+
*
|
|
61
|
+
* **The split arrangement is written in the order it is painted.** Decrement
|
|
62
|
+
* before the value and increment after it, rather than one box reordered with
|
|
63
|
+
* `order`, so the reading order and the painted order are the same one.
|
|
64
|
+
*
|
|
65
|
+
* **Angular pays one element for that frame, and React pays none.** React can
|
|
66
|
+
* render a wrapper from inside a component; an Angular directive cannot create
|
|
67
|
+
* a box around its own host. `slNumberFieldInput` injects this class, so a
|
|
68
|
+
* control written without the frame is a compile-time failure rather than a
|
|
69
|
+
* silent one.
|
|
70
|
+
*/
|
|
71
|
+
class SlNumberField {
|
|
72
|
+
/** Defaults to the field, then to the token, then to `md`. */
|
|
73
|
+
size = input(undefined, /* @ts-ignore */
|
|
74
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
75
|
+
/** Defaults to the token, then to `outline`. */
|
|
76
|
+
variant = input(undefined, /* @ts-ignore */
|
|
77
|
+
...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
78
|
+
/** Where the two steppers sit. Defaults to the token, then to `stacked`. */
|
|
79
|
+
stepper = input(undefined, /* @ts-ignore */
|
|
80
|
+
...(ngDevMode ? [{ debugName: "stepper" }] : /* istanbul ignore next */ []));
|
|
81
|
+
/**
|
|
82
|
+
* Words laid over the catalog of the language in force, key by key: the
|
|
83
|
+
* `increment` and `decrement` buttons' accessible names.
|
|
84
|
+
*/
|
|
85
|
+
messages = input(undefined, /* @ts-ignore */
|
|
86
|
+
...(ngDevMode ? [{ debugName: "messages" }] : /* istanbul ignore next */ []));
|
|
87
|
+
defaults = injectNumberFieldDefaults();
|
|
88
|
+
field = inject(SlField, { optional: true });
|
|
89
|
+
/**
|
|
90
|
+
* The control inside. It provides itself as `SlNumberFieldControl`, so the
|
|
91
|
+
* frame can read the bounds, the submission name and the shared states
|
|
92
|
+
* without either directive importing the other.
|
|
93
|
+
*/
|
|
94
|
+
control = contentChild(SlNumberFieldControl, { ...(ngDevMode ? { debugName: "control" } : /* istanbul ignore next */ {}), descendants: true });
|
|
95
|
+
resolvedSize = computed(() => this.size() ?? this.field?.resolvedSize() ?? this.defaults.size, /* @ts-ignore */
|
|
96
|
+
...(ngDevMode ? [{ debugName: "resolvedSize" }] : /* istanbul ignore next */ []));
|
|
97
|
+
resolvedVariant = computed(() => this.variant() ?? this.defaults.variant, /* @ts-ignore */
|
|
98
|
+
...(ngDevMode ? [{ debugName: "resolvedVariant" }] : /* istanbul ignore next */ []));
|
|
99
|
+
resolvedStepper = computed(() => this.stepper() ?? this.defaults.stepper, /* @ts-ignore */
|
|
100
|
+
...(ngDevMode ? [{ debugName: "resolvedStepper" }] : /* istanbul ignore next */ []));
|
|
101
|
+
/** The family's words in the language in force, with this field's `messages` laid over them. */
|
|
102
|
+
t = injectMessages(numberFieldMessages, this.messages);
|
|
103
|
+
/** Whether a `slNumberFieldScrub` inside is being dragged. */
|
|
104
|
+
scrubbing = signal(false, /* @ts-ignore */
|
|
105
|
+
...(ngDevMode ? [{ debugName: "scrubbing" }] : /* istanbul ignore next */ []));
|
|
106
|
+
/** A control nobody can change has two buttons that would lie about it. */
|
|
107
|
+
inert = computed(() => {
|
|
108
|
+
const control = this.control();
|
|
109
|
+
return control?.resolvedDisabled() === true || control?.resolvedReadOnly() === true;
|
|
110
|
+
}, /* @ts-ignore */
|
|
111
|
+
...(ngDevMode ? [{ debugName: "inert" }] : /* istanbul ignore next */ []));
|
|
112
|
+
incrementDisabled = computed(() => this.inert() || this.control()?.atMax() === true, /* @ts-ignore */
|
|
113
|
+
...(ngDevMode ? [{ debugName: "incrementDisabled" }] : /* istanbul ignore next */ []));
|
|
114
|
+
decrementDisabled = computed(() => this.inert() || this.control()?.atMin() === true, /* @ts-ignore */
|
|
115
|
+
...(ngDevMode ? [{ debugName: "decrementDisabled" }] : /* istanbul ignore next */ []));
|
|
116
|
+
hiddenValue = computed(() => {
|
|
117
|
+
const value = this.control()?.numberValue() ?? null;
|
|
118
|
+
return value === null ? '' : String(value);
|
|
119
|
+
}, /* @ts-ignore */
|
|
120
|
+
...(ngDevMode ? [{ debugName: "hiddenValue" }] : /* istanbul ignore next */ []));
|
|
121
|
+
delay;
|
|
122
|
+
interval;
|
|
123
|
+
constructor() {
|
|
124
|
+
/* A button unmounted mid-press would otherwise leave a timer running. */
|
|
125
|
+
inject(DestroyRef).onDestroy(() => this.release());
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* One step now, then repeating while the button is held. A coarse pointer
|
|
129
|
+
* waits longer before the first repeat, because a finger that is starting to
|
|
130
|
+
* scroll rests on the button first.
|
|
131
|
+
*/
|
|
132
|
+
press(direction, event) {
|
|
133
|
+
if (event.button !== 0)
|
|
134
|
+
return;
|
|
135
|
+
/* Focus stays on the value: the button is out of the tab order and the
|
|
136
|
+
caret is what the reader came back to. */
|
|
137
|
+
event.preventDefault();
|
|
138
|
+
const control = this.control();
|
|
139
|
+
if (control === undefined)
|
|
140
|
+
return;
|
|
141
|
+
control.stepBy(direction, event);
|
|
142
|
+
this.release();
|
|
143
|
+
const wait = event.pointerType === 'touch' ? STEP_REPEAT_DELAY_COARSE : STEP_REPEAT_DELAY;
|
|
144
|
+
this.delay = setTimeout(() => {
|
|
145
|
+
this.interval = setInterval(() => control.stepBy(direction, undefined), STEP_REPEAT_INTERVAL);
|
|
146
|
+
}, wait);
|
|
147
|
+
}
|
|
148
|
+
release() {
|
|
149
|
+
clearTimeout(this.delay);
|
|
150
|
+
clearInterval(this.interval);
|
|
151
|
+
this.delay = undefined;
|
|
152
|
+
this.interval = undefined;
|
|
153
|
+
}
|
|
154
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlNumberField, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
155
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: SlNumberField, isStandalone: true, selector: "[slNumberField]", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, stepper: { classPropertyName: "stepper", publicName: "stepper", isSignal: true, isRequired: false, transformFunction: null }, messages: { classPropertyName: "messages", publicName: "messages", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-ui": "number-field", "data-part": "root" }, properties: { "attr.data-size": "resolvedSize()", "attr.data-variant": "resolvedVariant()", "attr.data-stepper": "resolvedStepper()", "attr.data-disabled": "control()?.resolvedDisabled() === true ? '' : null", "attr.data-invalid": "control()?.resolvedInvalid() === true ? '' : null", "attr.data-readonly": "control()?.resolvedReadOnly() === true ? '' : null", "attr.data-scrubbing": "scrubbing() ? '' : null" } }, queries: [{ propertyName: "control", first: true, predicate: SlNumberFieldControl, descendants: true, isSignal: true }], exportAs: ["slNumberField"], ngImport: i0, template: `@if (resolvedStepper() === 'split') {
|
|
156
|
+
<button
|
|
157
|
+
data-part="decrement"
|
|
158
|
+
type="button"
|
|
159
|
+
tabindex="-1"
|
|
160
|
+
[attr.aria-controls]="control()?.controlId()"
|
|
161
|
+
[attr.aria-label]="t('decrement')"
|
|
162
|
+
[disabled]="decrementDisabled()"
|
|
163
|
+
(pointerdown)="press(-1, $event)"
|
|
164
|
+
(pointerup)="release()"
|
|
165
|
+
(pointerleave)="release()"
|
|
166
|
+
(pointercancel)="release()"
|
|
167
|
+
>
|
|
168
|
+
<span slIcon><svg slGlyph name="minus"></svg></span>
|
|
169
|
+
</button>
|
|
170
|
+
}
|
|
171
|
+
<ng-content select="[slNumberFieldStart]" />
|
|
172
|
+
<ng-content />
|
|
173
|
+
<ng-content select="[slNumberFieldEnd]" />
|
|
174
|
+
@if (resolvedStepper() === 'split') {
|
|
175
|
+
<button
|
|
176
|
+
data-part="increment"
|
|
177
|
+
type="button"
|
|
178
|
+
tabindex="-1"
|
|
179
|
+
[attr.aria-controls]="control()?.controlId()"
|
|
180
|
+
[attr.aria-label]="t('increment')"
|
|
181
|
+
[disabled]="incrementDisabled()"
|
|
182
|
+
(pointerdown)="press(1, $event)"
|
|
183
|
+
(pointerup)="release()"
|
|
184
|
+
(pointerleave)="release()"
|
|
185
|
+
(pointercancel)="release()"
|
|
186
|
+
>
|
|
187
|
+
<span slIcon><svg slGlyph name="plus"></svg></span>
|
|
188
|
+
</button>
|
|
189
|
+
} @else if (resolvedStepper() === 'stacked') {
|
|
190
|
+
<span data-part="stepper">
|
|
191
|
+
<button
|
|
192
|
+
data-part="increment"
|
|
193
|
+
type="button"
|
|
194
|
+
tabindex="-1"
|
|
195
|
+
[attr.aria-controls]="control()?.controlId()"
|
|
196
|
+
[attr.aria-label]="t('increment')"
|
|
197
|
+
[disabled]="incrementDisabled()"
|
|
198
|
+
(pointerdown)="press(1, $event)"
|
|
199
|
+
(pointerup)="release()"
|
|
200
|
+
(pointerleave)="release()"
|
|
201
|
+
(pointercancel)="release()"
|
|
202
|
+
>
|
|
203
|
+
<!-- Both halves draw the down chevron; the stylesheet turns the
|
|
204
|
+
increment's half a turn. -->
|
|
205
|
+
<span slIcon><svg slGlyph name="chevron-down"></svg></span>
|
|
206
|
+
</button>
|
|
207
|
+
<button
|
|
208
|
+
data-part="decrement"
|
|
209
|
+
type="button"
|
|
210
|
+
tabindex="-1"
|
|
211
|
+
[attr.aria-controls]="control()?.controlId()"
|
|
212
|
+
[attr.aria-label]="t('decrement')"
|
|
213
|
+
[disabled]="decrementDisabled()"
|
|
214
|
+
(pointerdown)="press(-1, $event)"
|
|
215
|
+
(pointerup)="release()"
|
|
216
|
+
(pointerleave)="release()"
|
|
217
|
+
(pointercancel)="release()"
|
|
218
|
+
>
|
|
219
|
+
<span slIcon><svg slGlyph name="chevron-down"></svg></span>
|
|
220
|
+
</button>
|
|
221
|
+
</span>
|
|
222
|
+
}
|
|
223
|
+
@if (control()?.submissionName(); as submissionName) {
|
|
224
|
+
<input
|
|
225
|
+
type="hidden"
|
|
226
|
+
[attr.name]="submissionName"
|
|
227
|
+
[attr.form]="control()?.submissionForm()"
|
|
228
|
+
[value]="hiddenValue()"
|
|
229
|
+
/>
|
|
230
|
+
}`, isInline: true, styles: ["@layer slotted.components{[data-ui=number-field][data-part=root]{--_font-size: var(--slotted-control-font-size-md, 13px);--_height: var(--slotted-control-height-md, 34px);--_padding-inline: var(--slotted-control-padding-inline-md, 13px);--_gap: var(--slotted-control-gap-md, 8px);--_icon-floor: var(--slotted-number-field-icon-size-min, 14px);--_icon-size: max(var(--_icon-floor), var(--slotted-control-icon-size-md, 16px));--_inner-size: var(--slotted-control-inner-size-md, 24px);--_stepper-size: var( --slotted-number-field-stepper-size, max( var(--slotted-target-min, 24px), min(calc(var(--_icon-size) + 2 * var(--slotted-space-2, .25rem)), var(--_inner-size)) ) );--_action-size: var( --slotted-number-field-action-size, min(calc(var(--_icon-size) + 2 * var(--slotted-space-2, .25rem)), var(--_inner-size)) );--_inset: max( 0px, calc( (var(--_height) - 2 * var(--slotted-control-border-width, 1px) - var(--_action-size)) / 2 ) );--_action-radius: max( var(--slotted-radius-xs, 2px), calc(var(--slotted-number-field-radius, var(--slotted-control-radius, 4px)) - var(--_inset)) );--_column-inset: var(--slotted-space-1, 2px);--_column-radius: max( var(--slotted-radius-xs, 2px), calc( var(--slotted-number-field-radius, var(--slotted-control-radius, 4px)) - var(--_column-inset) ) );align-items:center;background-color:var(--slotted-number-field-background, var(--slotted-control-surface, Field));border:var(--slotted-control-border-width, 1px) solid var(--slotted-number-field-border-color, var(--slotted-control-border-color, ButtonBorder));border-radius:var(--slotted-number-field-radius, var(--slotted-control-radius, 4px));box-shadow:var(--slotted-number-field-shadow, var(--slotted-control-shadow, none));box-sizing:border-box;color:var(--slotted-number-field-color, var(--slotted-text, CanvasText));display:flex;font-family:var(--slotted-control-font-family, system-ui, sans-serif);font-size:var(--_font-size);gap:var(--_gap);inline-size:100%;min-inline-size:0;min-block-size:var(--_height);padding-inline:var(--_padding-inline);transition:background-color var(--slotted-control-transition-duration) var(--slotted-control-transition-easing),border-color var(--slotted-control-transition-duration) var(--slotted-control-transition-easing),box-shadow var(--slotted-control-transition-duration) var(--slotted-control-transition-easing)}[data-ui=number-field]>[data-part=input]{background-color:transparent;align-self:stretch;margin-block:calc(var(--slotted-control-border-width, 1px) * -1);border:0;color:inherit;flex:1 1 auto;font:inherit;font-variant-numeric:tabular-nums;outline:none;padding:0;min-inline-size:0;text-overflow:ellipsis;unicode-bidi:plaintext}[data-ui=number-field]:dir(rtl)>[data-part=input]{text-align:right}[data-ui=number-field]>[data-part=input]::placeholder{color:var(--slotted-number-field-placeholder-color, var(--slotted-text-muted, GrayText));text-overflow:ellipsis}[data-ui=number-field][data-part=root][data-size=sm]{--_font-size: var(--slotted-control-font-size-sm, 12px);--_height: var(--slotted-control-height-sm, 30px);--_padding-inline: var(--slotted-control-padding-inline-sm, 10px);--_gap: var(--slotted-control-gap-sm, 6px);--_icon-size: max(var(--_icon-floor), var(--slotted-control-icon-size-sm, 14px));--_inner-size: var(--slotted-control-inner-size-sm, 22px)}[data-ui=number-field][data-part=root][data-size=md]{--_font-size: var(--slotted-control-font-size-md, 13px);--_height: var(--slotted-control-height-md, 34px);--_padding-inline: var(--slotted-control-padding-inline-md, 13px);--_gap: var(--slotted-control-gap-md, 8px);--_icon-size: max(var(--_icon-floor), var(--slotted-control-icon-size-md, 16px));--_inner-size: var(--slotted-control-inner-size-md, 24px)}[data-ui=number-field][data-part=root][data-size=lg]{--_font-size: var(--slotted-control-font-size-lg, 14px);--_height: var(--slotted-control-height-lg, 38px);--_padding-inline: var(--slotted-control-padding-inline-lg, 16px);--_gap: var(--slotted-control-gap-lg, 8px);--_icon-size: max(var(--_icon-floor), var(--slotted-control-icon-size-lg, 18px));--_inner-size: var(--slotted-control-inner-size-lg, 28px)}[data-ui=number-field][data-part=root][data-variant=subtle]{background-color:var( --slotted-number-field-subtle-background, var(--slotted-surface-sunken, Canvas) );border-color:var( --slotted-number-field-subtle-border-color, var(--slotted-border-subtle, ButtonBorder) )}[data-ui=number-field][data-part=root][data-variant=plain]{background-color:transparent;border-color:transparent;border-radius:var(--slotted-radius-none, 0px);box-shadow:none}@media(forced-colors:active){[data-ui=number-field][data-part=root][data-variant=plain]{border-color:ButtonBorder}}[data-ui=number-field]>[data-part=start],[data-ui=number-field]>[data-part=end]{align-items:center;color:var(--slotted-number-field-adornment-color, var(--slotted-text-muted, GrayText));display:inline-flex;flex:0 0 auto;gap:var(--slotted-space-2, .25rem);line-height:1;unicode-bidi:plaintext;--slotted-icon-size: var(--_icon-size)}[data-ui=number-field]>[data-part=start]>svg,[data-ui=number-field]>[data-part=end]>svg{block-size:var(--_icon-size);inline-size:var(--_icon-size)}[data-ui=number-field]>[data-part=start]:not(:has(svg,img,[data-ui=icon])),[data-ui=number-field]>[data-part=end]:not(:has(svg,img,[data-ui=icon])){padding-inline:calc(var(--_icon-size) / 8)}[data-ui=number-field]>:is([data-part=start],[data-part=end]):has(>[data-part=scrub]){align-self:stretch}[data-ui=number-field] [data-part=scrub]{align-items:center;align-self:stretch;cursor:ew-resize;display:inline-flex;gap:var(--slotted-space-2, .25rem);touch-action:none;transition:color var(--slotted-control-transition-duration) var(--slotted-control-transition-easing);user-select:none;-webkit-user-select:none}[data-ui=number-field]:not([data-disabled]):not([data-readonly]) [data-part=scrub]:is(:hover,[data-scrubbing]){color:var(--slotted-number-field-scrub-active-color, var(--slotted-text, CanvasText))}[data-ui=number-field]:is([data-disabled],[data-readonly]) [data-part=scrub]{cursor:default;touch-action:auto}[data-ui=number-field]>[data-part=stepper]>button,[data-ui=number-field]>[data-part=decrement],[data-ui=number-field]>[data-part=increment]{align-items:center;appearance:none;background-color:transparent;border:0;color:var(--slotted-number-field-stepper-color, var(--slotted-text-muted, GrayText));cursor:pointer;display:inline-flex;flex:0 0 auto;justify-content:center;padding:0;position:relative;touch-action:manipulation;transition:background-color var(--slotted-control-transition-duration) var(--slotted-control-transition-easing),color var(--slotted-control-transition-duration) var(--slotted-control-transition-easing);-webkit-tap-highlight-color:transparent}[data-ui=number-field] [data-part=decrement],[data-ui=number-field] [data-part=increment]{--slotted-icon-size: var(--_icon-size)}[data-ui=number-field][data-stepper=stacked] [data-part=increment]>[data-ui=icon]{rotate:.5turn}[data-ui=number-field][data-part=root][data-stepper=stacked]{padding-inline-end:0}[data-ui=number-field]>[data-part=stepper]{align-self:stretch;box-sizing:content-box;display:flex;flex:0 0 auto;flex-direction:column;inline-size:var(--_stepper-size);padding-block:var(--_column-inset);padding-inline-end:var(--_column-inset)}[data-ui=number-field]>[data-part=stepper]>button{block-size:50%;border-radius:var(--_column-radius);inline-size:100%}[data-ui=number-field]>[data-part=stepper]>:is([data-part=increment],[data-part=decrement]):after{content:\"\";inset-inline:0 calc(var(--_column-inset) * -1);position:absolute}[data-ui=number-field]>[data-part=stepper]>[data-part=increment]:after{inset-block:calc(var(--_column-inset) * -1) 0}[data-ui=number-field]>[data-part=stepper]>[data-part=decrement]:after{inset-block:0 calc(var(--_column-inset) * -1)}[data-ui=number-field]>[data-part=stepper]>button>[data-ui=icon]{block-size:min(var(--_icon-size),100%);contain:size}[data-ui=number-field][data-part=root][data-stepper=split]{gap:0;padding-inline:var(--_inset)}[data-ui=number-field][data-stepper=split]>[data-part=decrement],[data-ui=number-field][data-stepper=split]>[data-part=increment]{block-size:var(--_action-size);border-radius:var(--_action-radius);inline-size:var(--_action-size)}[data-ui=number-field][data-stepper=split]>[data-part=input]{padding-inline:var(--_gap);text-align:center}[data-ui=number-field][data-stepper=split]>[data-part=start]{padding-inline-start:var(--_gap)}[data-ui=number-field][data-stepper=split]>[data-part=end]{padding-inline-end:var(--_gap)}[data-ui=number-field][data-stepper=split]>[data-part=decrement]:after,[data-ui=number-field][data-stepper=split]>[data-part=increment]:after{content:\"\";inset:min(0px,calc((100% - var(--slotted-target-min, 24px)) / 2));position:absolute}@media(pointer:coarse){[data-ui=number-field][data-stepper=split]>:is([data-part=decrement],[data-part=increment]):after{inset:min(0px,calc((100% - var(--slotted-target-comfortable, 44px)) / 2))}[data-ui=number-field]>[data-part=stepper]>:is([data-part=increment],[data-part=decrement]):after{inset-inline:min(0px,calc((100% - var(--slotted-target-comfortable, 44px)) / 2))}}[data-ui=number-field] [data-part=decrement]:hover:not(:disabled),[data-ui=number-field] [data-part=increment]:hover:not(:disabled){background-color:var( --slotted-number-field-stepper-hover-background, var(--slotted-tone-secondary-subtle-hover) )}[data-ui=number-field] [data-part=decrement]:active:not(:disabled),[data-ui=number-field] [data-part=increment]:active:not(:disabled){background-color:var( --slotted-number-field-stepper-active-background, var(--slotted-tone-secondary-subtle-active) )}[data-ui=number-field] [data-part=decrement]:disabled,[data-ui=number-field] [data-part=increment]:disabled{background-color:var( --slotted-number-field-stepper-disabled-background, var(--slotted-disabled-background) );color:var(--slotted-number-field-stepper-disabled-color, var(--slotted-disabled-foreground));cursor:not-allowed}[data-ui=number-field] [data-part=decrement]:focus-visible,[data-ui=number-field] [data-part=increment]:focus-visible{outline:var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);outline-offset:calc(var(--slotted-focus-ring-offset, 2px) * -1)}[data-ui=number-field][data-part=root]:hover:not([data-disabled]):not([data-readonly]):not([data-invalid]){border-color:var(--slotted-number-field-hover-border-color, var(--slotted-tone-accent-border))}[data-ui=number-field][data-part=root][data-variant=subtle]:hover:not([data-disabled]):not([data-readonly]):not([data-invalid]){background-color:var( --slotted-number-field-subtle-hover-background, var(--slotted-tone-secondary-subtle-hover) )}[data-ui=number-field][data-part=root][data-variant=plain]:hover:not([data-disabled]):not([data-readonly]):not([data-invalid]){background-color:var( --slotted-number-field-plain-hover-background, var(--slotted-tone-secondary-subtle-hover) );border-color:transparent}[data-ui=number-field][data-part=root]:has(>[data-part=input]:focus-visible){box-shadow:var(--slotted-control-shadow-focus-geometry, 0 1px 4px -1px) var(--slotted-focus-ring-color, Highlight);outline:var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);outline-offset:var(--slotted-focus-ring-offset, 2px)}[data-ui=number-field][data-part=root][data-variant=plain]:has(>[data-part=input]:focus-visible){box-shadow:none;outline-offset:calc(var(--slotted-focus-ring-offset, 2px) * -1)}[data-ui=number-field][data-part=root][data-invalid]{--slotted-focus-ring-color: var( --slotted-number-field-invalid-focus-ring-color, var(--slotted-focus-ring-color-invalid, Highlight) );--_invalid-edge-width: var( --slotted-number-field-invalid-edge-width, var(--slotted-control-invalid-edge-width, 1px) );--_invalid-edge-color: var( --slotted-number-field-invalid-border-color, var(--slotted-tone-danger-border) );--_invalid-edge: inset 0 0 0 var(--_invalid-edge-width) var(--_invalid-edge-color);border-color:var( --slotted-number-field-invalid-border-color, var(--slotted-tone-danger-border) );box-shadow:var(--_invalid-edge)}[data-ui=number-field][data-part=root][data-invalid]:has(>[data-part=input]:focus-visible){box-shadow:var(--_invalid-edge),var(--slotted-control-shadow-focus-geometry, 0 1px 4px -1px) var(--slotted-focus-ring-color, Highlight)}[data-ui=number-field][data-part=root][data-variant=plain][data-invalid]:has(>[data-part=input]:focus-visible){box-shadow:inset 0 0 0 calc(var(--slotted-focus-ring-offset, 2px) - var(--slotted-control-border-width, 1px) + var(--_invalid-edge-width)) var(--_invalid-edge-color)}@media(forced-colors:active){[data-ui=number-field][data-part=root][data-invalid]{outline:var(--_invalid-edge-width) solid CanvasText;outline-offset:calc(-1 * (var(--slotted-control-border-width, 1px) + var(--_invalid-edge-width)))}[data-ui=number-field][data-part=root][data-invalid]:has(>[data-part=input]:focus-visible){outline:calc(var(--slotted-focus-ring-width, 2px) + var(--_invalid-edge-width)) double var(--slotted-focus-ring-color, Highlight);outline-offset:var(--slotted-focus-ring-offset, 2px)}[data-ui=number-field][data-part=root][data-variant=plain][data-invalid]:has(>[data-part=input]:focus-visible){outline:calc(var(--slotted-focus-ring-width, 2px) + var(--_invalid-edge-width)) double var(--slotted-focus-ring-color, Highlight);outline-offset:calc(-1 * (var(--slotted-focus-ring-width, 2px) + var(--_invalid-edge-width)))}}[data-ui=number-field][data-part=root][data-readonly]{background-color:var( --slotted-number-field-readonly-background, var(--slotted-tone-secondary-subtle-hover) );border-color:var( --slotted-number-field-readonly-border-color, var(--slotted-border-subtle, ButtonBorder) );cursor:default}[data-ui=number-field][data-part=root][data-disabled],[data-ui=number-field][data-part=root]:has(>[data-part=input]:disabled){background-color:var( --slotted-number-field-disabled-background, var(--slotted-disabled-background) );border-color:var(--slotted-number-field-disabled-border-color, var(--slotted-disabled-border));box-shadow:none;color:var(--slotted-number-field-disabled-color, var(--slotted-disabled-foreground));cursor:not-allowed}[data-ui=number-field][data-part=root][data-disabled]>[data-part=start],[data-ui=number-field][data-part=root][data-disabled]>[data-part=end]{color:var(--slotted-disabled-foreground)}}\n"], dependencies: [{ kind: "component", type: SlGlyph, selector: "svg[slGlyph]", inputs: ["name", "solid"] }, { kind: "component", type: SlIcon, selector: "[slIcon]", inputs: ["directional", "label", "size", "tone"], exportAs: ["slIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
231
|
+
}
|
|
232
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlNumberField, decorators: [{
|
|
233
|
+
type: Component,
|
|
234
|
+
args: [{ selector: '[slNumberField]', standalone: true, exportAs: 'slNumberField', imports: [SlGlyph, SlIcon], template: `@if (resolvedStepper() === 'split') {
|
|
235
|
+
<button
|
|
236
|
+
data-part="decrement"
|
|
237
|
+
type="button"
|
|
238
|
+
tabindex="-1"
|
|
239
|
+
[attr.aria-controls]="control()?.controlId()"
|
|
240
|
+
[attr.aria-label]="t('decrement')"
|
|
241
|
+
[disabled]="decrementDisabled()"
|
|
242
|
+
(pointerdown)="press(-1, $event)"
|
|
243
|
+
(pointerup)="release()"
|
|
244
|
+
(pointerleave)="release()"
|
|
245
|
+
(pointercancel)="release()"
|
|
246
|
+
>
|
|
247
|
+
<span slIcon><svg slGlyph name="minus"></svg></span>
|
|
248
|
+
</button>
|
|
249
|
+
}
|
|
250
|
+
<ng-content select="[slNumberFieldStart]" />
|
|
251
|
+
<ng-content />
|
|
252
|
+
<ng-content select="[slNumberFieldEnd]" />
|
|
253
|
+
@if (resolvedStepper() === 'split') {
|
|
254
|
+
<button
|
|
255
|
+
data-part="increment"
|
|
256
|
+
type="button"
|
|
257
|
+
tabindex="-1"
|
|
258
|
+
[attr.aria-controls]="control()?.controlId()"
|
|
259
|
+
[attr.aria-label]="t('increment')"
|
|
260
|
+
[disabled]="incrementDisabled()"
|
|
261
|
+
(pointerdown)="press(1, $event)"
|
|
262
|
+
(pointerup)="release()"
|
|
263
|
+
(pointerleave)="release()"
|
|
264
|
+
(pointercancel)="release()"
|
|
265
|
+
>
|
|
266
|
+
<span slIcon><svg slGlyph name="plus"></svg></span>
|
|
267
|
+
</button>
|
|
268
|
+
} @else if (resolvedStepper() === 'stacked') {
|
|
269
|
+
<span data-part="stepper">
|
|
270
|
+
<button
|
|
271
|
+
data-part="increment"
|
|
272
|
+
type="button"
|
|
273
|
+
tabindex="-1"
|
|
274
|
+
[attr.aria-controls]="control()?.controlId()"
|
|
275
|
+
[attr.aria-label]="t('increment')"
|
|
276
|
+
[disabled]="incrementDisabled()"
|
|
277
|
+
(pointerdown)="press(1, $event)"
|
|
278
|
+
(pointerup)="release()"
|
|
279
|
+
(pointerleave)="release()"
|
|
280
|
+
(pointercancel)="release()"
|
|
281
|
+
>
|
|
282
|
+
<!-- Both halves draw the down chevron; the stylesheet turns the
|
|
283
|
+
increment's half a turn. -->
|
|
284
|
+
<span slIcon><svg slGlyph name="chevron-down"></svg></span>
|
|
285
|
+
</button>
|
|
286
|
+
<button
|
|
287
|
+
data-part="decrement"
|
|
288
|
+
type="button"
|
|
289
|
+
tabindex="-1"
|
|
290
|
+
[attr.aria-controls]="control()?.controlId()"
|
|
291
|
+
[attr.aria-label]="t('decrement')"
|
|
292
|
+
[disabled]="decrementDisabled()"
|
|
293
|
+
(pointerdown)="press(-1, $event)"
|
|
294
|
+
(pointerup)="release()"
|
|
295
|
+
(pointerleave)="release()"
|
|
296
|
+
(pointercancel)="release()"
|
|
297
|
+
>
|
|
298
|
+
<span slIcon><svg slGlyph name="chevron-down"></svg></span>
|
|
299
|
+
</button>
|
|
300
|
+
</span>
|
|
301
|
+
}
|
|
302
|
+
@if (control()?.submissionName(); as submissionName) {
|
|
303
|
+
<input
|
|
304
|
+
type="hidden"
|
|
305
|
+
[attr.name]="submissionName"
|
|
306
|
+
[attr.form]="control()?.submissionForm()"
|
|
307
|
+
[value]="hiddenValue()"
|
|
308
|
+
/>
|
|
309
|
+
}`, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
|
|
310
|
+
'data-ui': 'number-field',
|
|
311
|
+
'data-part': 'root',
|
|
312
|
+
'[attr.data-size]': 'resolvedSize()',
|
|
313
|
+
'[attr.data-variant]': 'resolvedVariant()',
|
|
314
|
+
'[attr.data-stepper]': 'resolvedStepper()',
|
|
315
|
+
'[attr.data-disabled]': "control()?.resolvedDisabled() === true ? '' : null",
|
|
316
|
+
'[attr.data-invalid]': "control()?.resolvedInvalid() === true ? '' : null",
|
|
317
|
+
'[attr.data-readonly]': "control()?.resolvedReadOnly() === true ? '' : null",
|
|
318
|
+
'[attr.data-scrubbing]': "scrubbing() ? '' : null",
|
|
319
|
+
}, styles: ["@layer slotted.components{[data-ui=number-field][data-part=root]{--_font-size: var(--slotted-control-font-size-md, 13px);--_height: var(--slotted-control-height-md, 34px);--_padding-inline: var(--slotted-control-padding-inline-md, 13px);--_gap: var(--slotted-control-gap-md, 8px);--_icon-floor: var(--slotted-number-field-icon-size-min, 14px);--_icon-size: max(var(--_icon-floor), var(--slotted-control-icon-size-md, 16px));--_inner-size: var(--slotted-control-inner-size-md, 24px);--_stepper-size: var( --slotted-number-field-stepper-size, max( var(--slotted-target-min, 24px), min(calc(var(--_icon-size) + 2 * var(--slotted-space-2, .25rem)), var(--_inner-size)) ) );--_action-size: var( --slotted-number-field-action-size, min(calc(var(--_icon-size) + 2 * var(--slotted-space-2, .25rem)), var(--_inner-size)) );--_inset: max( 0px, calc( (var(--_height) - 2 * var(--slotted-control-border-width, 1px) - var(--_action-size)) / 2 ) );--_action-radius: max( var(--slotted-radius-xs, 2px), calc(var(--slotted-number-field-radius, var(--slotted-control-radius, 4px)) - var(--_inset)) );--_column-inset: var(--slotted-space-1, 2px);--_column-radius: max( var(--slotted-radius-xs, 2px), calc( var(--slotted-number-field-radius, var(--slotted-control-radius, 4px)) - var(--_column-inset) ) );align-items:center;background-color:var(--slotted-number-field-background, var(--slotted-control-surface, Field));border:var(--slotted-control-border-width, 1px) solid var(--slotted-number-field-border-color, var(--slotted-control-border-color, ButtonBorder));border-radius:var(--slotted-number-field-radius, var(--slotted-control-radius, 4px));box-shadow:var(--slotted-number-field-shadow, var(--slotted-control-shadow, none));box-sizing:border-box;color:var(--slotted-number-field-color, var(--slotted-text, CanvasText));display:flex;font-family:var(--slotted-control-font-family, system-ui, sans-serif);font-size:var(--_font-size);gap:var(--_gap);inline-size:100%;min-inline-size:0;min-block-size:var(--_height);padding-inline:var(--_padding-inline);transition:background-color var(--slotted-control-transition-duration) var(--slotted-control-transition-easing),border-color var(--slotted-control-transition-duration) var(--slotted-control-transition-easing),box-shadow var(--slotted-control-transition-duration) var(--slotted-control-transition-easing)}[data-ui=number-field]>[data-part=input]{background-color:transparent;align-self:stretch;margin-block:calc(var(--slotted-control-border-width, 1px) * -1);border:0;color:inherit;flex:1 1 auto;font:inherit;font-variant-numeric:tabular-nums;outline:none;padding:0;min-inline-size:0;text-overflow:ellipsis;unicode-bidi:plaintext}[data-ui=number-field]:dir(rtl)>[data-part=input]{text-align:right}[data-ui=number-field]>[data-part=input]::placeholder{color:var(--slotted-number-field-placeholder-color, var(--slotted-text-muted, GrayText));text-overflow:ellipsis}[data-ui=number-field][data-part=root][data-size=sm]{--_font-size: var(--slotted-control-font-size-sm, 12px);--_height: var(--slotted-control-height-sm, 30px);--_padding-inline: var(--slotted-control-padding-inline-sm, 10px);--_gap: var(--slotted-control-gap-sm, 6px);--_icon-size: max(var(--_icon-floor), var(--slotted-control-icon-size-sm, 14px));--_inner-size: var(--slotted-control-inner-size-sm, 22px)}[data-ui=number-field][data-part=root][data-size=md]{--_font-size: var(--slotted-control-font-size-md, 13px);--_height: var(--slotted-control-height-md, 34px);--_padding-inline: var(--slotted-control-padding-inline-md, 13px);--_gap: var(--slotted-control-gap-md, 8px);--_icon-size: max(var(--_icon-floor), var(--slotted-control-icon-size-md, 16px));--_inner-size: var(--slotted-control-inner-size-md, 24px)}[data-ui=number-field][data-part=root][data-size=lg]{--_font-size: var(--slotted-control-font-size-lg, 14px);--_height: var(--slotted-control-height-lg, 38px);--_padding-inline: var(--slotted-control-padding-inline-lg, 16px);--_gap: var(--slotted-control-gap-lg, 8px);--_icon-size: max(var(--_icon-floor), var(--slotted-control-icon-size-lg, 18px));--_inner-size: var(--slotted-control-inner-size-lg, 28px)}[data-ui=number-field][data-part=root][data-variant=subtle]{background-color:var( --slotted-number-field-subtle-background, var(--slotted-surface-sunken, Canvas) );border-color:var( --slotted-number-field-subtle-border-color, var(--slotted-border-subtle, ButtonBorder) )}[data-ui=number-field][data-part=root][data-variant=plain]{background-color:transparent;border-color:transparent;border-radius:var(--slotted-radius-none, 0px);box-shadow:none}@media(forced-colors:active){[data-ui=number-field][data-part=root][data-variant=plain]{border-color:ButtonBorder}}[data-ui=number-field]>[data-part=start],[data-ui=number-field]>[data-part=end]{align-items:center;color:var(--slotted-number-field-adornment-color, var(--slotted-text-muted, GrayText));display:inline-flex;flex:0 0 auto;gap:var(--slotted-space-2, .25rem);line-height:1;unicode-bidi:plaintext;--slotted-icon-size: var(--_icon-size)}[data-ui=number-field]>[data-part=start]>svg,[data-ui=number-field]>[data-part=end]>svg{block-size:var(--_icon-size);inline-size:var(--_icon-size)}[data-ui=number-field]>[data-part=start]:not(:has(svg,img,[data-ui=icon])),[data-ui=number-field]>[data-part=end]:not(:has(svg,img,[data-ui=icon])){padding-inline:calc(var(--_icon-size) / 8)}[data-ui=number-field]>:is([data-part=start],[data-part=end]):has(>[data-part=scrub]){align-self:stretch}[data-ui=number-field] [data-part=scrub]{align-items:center;align-self:stretch;cursor:ew-resize;display:inline-flex;gap:var(--slotted-space-2, .25rem);touch-action:none;transition:color var(--slotted-control-transition-duration) var(--slotted-control-transition-easing);user-select:none;-webkit-user-select:none}[data-ui=number-field]:not([data-disabled]):not([data-readonly]) [data-part=scrub]:is(:hover,[data-scrubbing]){color:var(--slotted-number-field-scrub-active-color, var(--slotted-text, CanvasText))}[data-ui=number-field]:is([data-disabled],[data-readonly]) [data-part=scrub]{cursor:default;touch-action:auto}[data-ui=number-field]>[data-part=stepper]>button,[data-ui=number-field]>[data-part=decrement],[data-ui=number-field]>[data-part=increment]{align-items:center;appearance:none;background-color:transparent;border:0;color:var(--slotted-number-field-stepper-color, var(--slotted-text-muted, GrayText));cursor:pointer;display:inline-flex;flex:0 0 auto;justify-content:center;padding:0;position:relative;touch-action:manipulation;transition:background-color var(--slotted-control-transition-duration) var(--slotted-control-transition-easing),color var(--slotted-control-transition-duration) var(--slotted-control-transition-easing);-webkit-tap-highlight-color:transparent}[data-ui=number-field] [data-part=decrement],[data-ui=number-field] [data-part=increment]{--slotted-icon-size: var(--_icon-size)}[data-ui=number-field][data-stepper=stacked] [data-part=increment]>[data-ui=icon]{rotate:.5turn}[data-ui=number-field][data-part=root][data-stepper=stacked]{padding-inline-end:0}[data-ui=number-field]>[data-part=stepper]{align-self:stretch;box-sizing:content-box;display:flex;flex:0 0 auto;flex-direction:column;inline-size:var(--_stepper-size);padding-block:var(--_column-inset);padding-inline-end:var(--_column-inset)}[data-ui=number-field]>[data-part=stepper]>button{block-size:50%;border-radius:var(--_column-radius);inline-size:100%}[data-ui=number-field]>[data-part=stepper]>:is([data-part=increment],[data-part=decrement]):after{content:\"\";inset-inline:0 calc(var(--_column-inset) * -1);position:absolute}[data-ui=number-field]>[data-part=stepper]>[data-part=increment]:after{inset-block:calc(var(--_column-inset) * -1) 0}[data-ui=number-field]>[data-part=stepper]>[data-part=decrement]:after{inset-block:0 calc(var(--_column-inset) * -1)}[data-ui=number-field]>[data-part=stepper]>button>[data-ui=icon]{block-size:min(var(--_icon-size),100%);contain:size}[data-ui=number-field][data-part=root][data-stepper=split]{gap:0;padding-inline:var(--_inset)}[data-ui=number-field][data-stepper=split]>[data-part=decrement],[data-ui=number-field][data-stepper=split]>[data-part=increment]{block-size:var(--_action-size);border-radius:var(--_action-radius);inline-size:var(--_action-size)}[data-ui=number-field][data-stepper=split]>[data-part=input]{padding-inline:var(--_gap);text-align:center}[data-ui=number-field][data-stepper=split]>[data-part=start]{padding-inline-start:var(--_gap)}[data-ui=number-field][data-stepper=split]>[data-part=end]{padding-inline-end:var(--_gap)}[data-ui=number-field][data-stepper=split]>[data-part=decrement]:after,[data-ui=number-field][data-stepper=split]>[data-part=increment]:after{content:\"\";inset:min(0px,calc((100% - var(--slotted-target-min, 24px)) / 2));position:absolute}@media(pointer:coarse){[data-ui=number-field][data-stepper=split]>:is([data-part=decrement],[data-part=increment]):after{inset:min(0px,calc((100% - var(--slotted-target-comfortable, 44px)) / 2))}[data-ui=number-field]>[data-part=stepper]>:is([data-part=increment],[data-part=decrement]):after{inset-inline:min(0px,calc((100% - var(--slotted-target-comfortable, 44px)) / 2))}}[data-ui=number-field] [data-part=decrement]:hover:not(:disabled),[data-ui=number-field] [data-part=increment]:hover:not(:disabled){background-color:var( --slotted-number-field-stepper-hover-background, var(--slotted-tone-secondary-subtle-hover) )}[data-ui=number-field] [data-part=decrement]:active:not(:disabled),[data-ui=number-field] [data-part=increment]:active:not(:disabled){background-color:var( --slotted-number-field-stepper-active-background, var(--slotted-tone-secondary-subtle-active) )}[data-ui=number-field] [data-part=decrement]:disabled,[data-ui=number-field] [data-part=increment]:disabled{background-color:var( --slotted-number-field-stepper-disabled-background, var(--slotted-disabled-background) );color:var(--slotted-number-field-stepper-disabled-color, var(--slotted-disabled-foreground));cursor:not-allowed}[data-ui=number-field] [data-part=decrement]:focus-visible,[data-ui=number-field] [data-part=increment]:focus-visible{outline:var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);outline-offset:calc(var(--slotted-focus-ring-offset, 2px) * -1)}[data-ui=number-field][data-part=root]:hover:not([data-disabled]):not([data-readonly]):not([data-invalid]){border-color:var(--slotted-number-field-hover-border-color, var(--slotted-tone-accent-border))}[data-ui=number-field][data-part=root][data-variant=subtle]:hover:not([data-disabled]):not([data-readonly]):not([data-invalid]){background-color:var( --slotted-number-field-subtle-hover-background, var(--slotted-tone-secondary-subtle-hover) )}[data-ui=number-field][data-part=root][data-variant=plain]:hover:not([data-disabled]):not([data-readonly]):not([data-invalid]){background-color:var( --slotted-number-field-plain-hover-background, var(--slotted-tone-secondary-subtle-hover) );border-color:transparent}[data-ui=number-field][data-part=root]:has(>[data-part=input]:focus-visible){box-shadow:var(--slotted-control-shadow-focus-geometry, 0 1px 4px -1px) var(--slotted-focus-ring-color, Highlight);outline:var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);outline-offset:var(--slotted-focus-ring-offset, 2px)}[data-ui=number-field][data-part=root][data-variant=plain]:has(>[data-part=input]:focus-visible){box-shadow:none;outline-offset:calc(var(--slotted-focus-ring-offset, 2px) * -1)}[data-ui=number-field][data-part=root][data-invalid]{--slotted-focus-ring-color: var( --slotted-number-field-invalid-focus-ring-color, var(--slotted-focus-ring-color-invalid, Highlight) );--_invalid-edge-width: var( --slotted-number-field-invalid-edge-width, var(--slotted-control-invalid-edge-width, 1px) );--_invalid-edge-color: var( --slotted-number-field-invalid-border-color, var(--slotted-tone-danger-border) );--_invalid-edge: inset 0 0 0 var(--_invalid-edge-width) var(--_invalid-edge-color);border-color:var( --slotted-number-field-invalid-border-color, var(--slotted-tone-danger-border) );box-shadow:var(--_invalid-edge)}[data-ui=number-field][data-part=root][data-invalid]:has(>[data-part=input]:focus-visible){box-shadow:var(--_invalid-edge),var(--slotted-control-shadow-focus-geometry, 0 1px 4px -1px) var(--slotted-focus-ring-color, Highlight)}[data-ui=number-field][data-part=root][data-variant=plain][data-invalid]:has(>[data-part=input]:focus-visible){box-shadow:inset 0 0 0 calc(var(--slotted-focus-ring-offset, 2px) - var(--slotted-control-border-width, 1px) + var(--_invalid-edge-width)) var(--_invalid-edge-color)}@media(forced-colors:active){[data-ui=number-field][data-part=root][data-invalid]{outline:var(--_invalid-edge-width) solid CanvasText;outline-offset:calc(-1 * (var(--slotted-control-border-width, 1px) + var(--_invalid-edge-width)))}[data-ui=number-field][data-part=root][data-invalid]:has(>[data-part=input]:focus-visible){outline:calc(var(--slotted-focus-ring-width, 2px) + var(--_invalid-edge-width)) double var(--slotted-focus-ring-color, Highlight);outline-offset:var(--slotted-focus-ring-offset, 2px)}[data-ui=number-field][data-part=root][data-variant=plain][data-invalid]:has(>[data-part=input]:focus-visible){outline:calc(var(--slotted-focus-ring-width, 2px) + var(--_invalid-edge-width)) double var(--slotted-focus-ring-color, Highlight);outline-offset:calc(-1 * (var(--slotted-focus-ring-width, 2px) + var(--_invalid-edge-width)))}}[data-ui=number-field][data-part=root][data-readonly]{background-color:var( --slotted-number-field-readonly-background, var(--slotted-tone-secondary-subtle-hover) );border-color:var( --slotted-number-field-readonly-border-color, var(--slotted-border-subtle, ButtonBorder) );cursor:default}[data-ui=number-field][data-part=root][data-disabled],[data-ui=number-field][data-part=root]:has(>[data-part=input]:disabled){background-color:var( --slotted-number-field-disabled-background, var(--slotted-disabled-background) );border-color:var(--slotted-number-field-disabled-border-color, var(--slotted-disabled-border));box-shadow:none;color:var(--slotted-number-field-disabled-color, var(--slotted-disabled-foreground));cursor:not-allowed}[data-ui=number-field][data-part=root][data-disabled]>[data-part=start],[data-ui=number-field][data-part=root][data-disabled]>[data-part=end]{color:var(--slotted-disabled-foreground)}}\n"] }]
|
|
320
|
+
}], ctorParameters: () => [], propDecorators: { size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], stepper: [{ type: i0.Input, args: [{ isSignal: true, alias: "stepper", required: false }] }], messages: [{ type: i0.Input, args: [{ isSignal: true, alias: "messages", required: false }] }], control: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SlNumberFieldControl), { ...{ descendants: true }, isSignal: true }] }] } });
|
|
321
|
+
|
|
322
|
+
/** `undefined` stays absent; anything else becomes a number. */
|
|
323
|
+
const optionalNumber = (value) => value === undefined || value === null || value === '' ? undefined : numberAttribute(value);
|
|
324
|
+
/**
|
|
325
|
+
* The control itself: the number, the identifier, and everything the field
|
|
326
|
+
* around it says.
|
|
327
|
+
*
|
|
328
|
+
* **The element is `type="text"` and carries the APG's `spinbutton` role.**
|
|
329
|
+
* `type="number"` empties itself whenever the text is not a valid
|
|
330
|
+
* floating-point number, so no grouping separator, no decimal comma and no
|
|
331
|
+
* currency affix survives it.
|
|
332
|
+
*
|
|
333
|
+
* **The text belongs to the element and the number belongs to the family.** The
|
|
334
|
+
* number moves on every keystroke that parses. Under `formatOn="change"`, the
|
|
335
|
+
* default, the text takes the locale's shape on that same keystroke: the
|
|
336
|
+
* grouping a long number is read by appears while it is being typed, and the
|
|
337
|
+
* caret comes back to the character it was on because it is counted in the
|
|
338
|
+
* reader's own characters rather than in string indices. Under
|
|
339
|
+
* `formatOn="commit"` the text is the reader's until blur, `Enter`, a stepper
|
|
340
|
+
* press, a key step or a wheel turn.
|
|
341
|
+
*
|
|
342
|
+
* Rounding, padding and clamping belong to the commit under both. A keystroke
|
|
343
|
+
* never takes away a nought the reader has just typed.
|
|
344
|
+
*
|
|
345
|
+
* **Unset means ask the field.** `disabled`, `readOnly` and `invalid` default to
|
|
346
|
+
* `undefined` rather than `false`. A value the consumer wrote as a static
|
|
347
|
+
* attribute is read before the host binding computes, so the binding never
|
|
348
|
+
* writes over it.
|
|
349
|
+
*/
|
|
350
|
+
class SlNumberFieldInput {
|
|
351
|
+
/**
|
|
352
|
+
* Present means the consumer owns the number, for the life of the component.
|
|
353
|
+
* `null` is empty, and `undefined` is the absence that makes the control
|
|
354
|
+
* uncontrolled — the two are different answers.
|
|
355
|
+
*/
|
|
356
|
+
value = input(undefined, { ...(ngDevMode ? { debugName: "value" } : /* istanbul ignore next */ {}), transform: (raw) => (raw === undefined ? undefined : (optionalNumber(raw) ?? null)) });
|
|
357
|
+
/** The number the control starts from when nobody else writes one. */
|
|
358
|
+
defaultValue = input(null, { ...(ngDevMode ? { debugName: "defaultValue" } : /* istanbul ignore next */ {}), transform: (raw) => (raw === undefined ? null : (optionalNumber(raw) ?? null)) });
|
|
359
|
+
min = input(undefined, { ...(ngDevMode ? { debugName: "min" } : /* istanbul ignore next */ {}), transform: optionalNumber });
|
|
360
|
+
max = input(undefined, { ...(ngDevMode ? { debugName: "max" } : /* istanbul ignore next */ {}), transform: optionalNumber });
|
|
361
|
+
step = input(1, { ...(ngDevMode ? { debugName: "step" } : /* istanbul ignore next */ {}), transform: (raw) => optionalNumber(raw) ?? 1 });
|
|
362
|
+
/** The amount `Shift` and the page keys move by. Defaults to `step * 10`. */
|
|
363
|
+
largeStep = input(undefined, { ...(ngDevMode ? { debugName: "largeStep" } : /* istanbul ignore next */ {}), transform: optionalNumber });
|
|
364
|
+
/** The amount `Alt` moves by. Defaults to `step / 10`. */
|
|
365
|
+
smallStep = input(undefined, { ...(ngDevMode ? { debugName: "smallStep" } : /* istanbul ignore next */ {}), transform: optionalNumber });
|
|
366
|
+
/** Where an empty control starts stepping from. Defaults to `min`, then nought. */
|
|
367
|
+
stepFrom = input(undefined, { ...(ngDevMode ? { debugName: "stepFrom" } : /* istanbul ignore next */ {}), transform: optionalNumber });
|
|
368
|
+
snapToStep = input(false, { ...(ngDevMode ? { debugName: "snapToStep" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
369
|
+
/** Where a value outside the range goes, and when. Defaults to the token, then `blur`. */
|
|
370
|
+
clamp = input(undefined, /* @ts-ignore */
|
|
371
|
+
...(ngDevMode ? [{ debugName: "clamp" }] : /* istanbul ignore next */ []));
|
|
372
|
+
/** How the value is written and read back, through `Intl.NumberFormat`. */
|
|
373
|
+
format = input(undefined, /* @ts-ignore */
|
|
374
|
+
...(ngDevMode ? [{ debugName: "format" }] : /* istanbul ignore next */ []));
|
|
375
|
+
/** When the text takes that shape. Defaults to the token, then `change`. */
|
|
376
|
+
formatOn = input(undefined, /* @ts-ignore */
|
|
377
|
+
...(ngDevMode ? [{ debugName: "formatOn" }] : /* istanbul ignore next */ []));
|
|
378
|
+
/** BCP 47. Defaults to the language in force (`provideSlotted`). */
|
|
379
|
+
locale = input(undefined, /* @ts-ignore */
|
|
380
|
+
...(ngDevMode ? [{ debugName: "locale" }] : /* istanbul ignore next */ []));
|
|
381
|
+
/**
|
|
382
|
+
* Lets the wheel move the value while the control has focus. Off by default:
|
|
383
|
+
* a reader scrolling a form must not change an amount by passing over it.
|
|
384
|
+
*/
|
|
385
|
+
wheel = input(false, { ...(ngDevMode ? { debugName: "wheel" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
386
|
+
/** Unstated rather than `false`, so the control defers to the field. */
|
|
387
|
+
disabled = input(undefined, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: (raw) => (raw === undefined ? undefined : booleanAttribute(raw)) });
|
|
388
|
+
readOnly = input(undefined, { ...(ngDevMode ? { debugName: "readOnly" } : /* istanbul ignore next */ {}), transform: (raw) => (raw === undefined ? undefined : booleanAttribute(raw)) });
|
|
389
|
+
invalid = input(undefined, { ...(ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {}), transform: (raw) => (raw === undefined ? undefined : booleanAttribute(raw)) });
|
|
390
|
+
/**
|
|
391
|
+
* One output for one transition, carrying the value, the value it replaces,
|
|
392
|
+
* the reason, the originating event and `cancel()`. There is no `[(value)]`,
|
|
393
|
+
* because a two-way binding has one slot and can carry none of those; a form
|
|
394
|
+
* gets the same movement through `ControlValueAccessor`.
|
|
395
|
+
*/
|
|
396
|
+
valueChange = output();
|
|
397
|
+
element = inject(ElementRef).nativeElement;
|
|
398
|
+
/**
|
|
399
|
+
* The frame around the control. Injected without `optional`, so an `input`
|
|
400
|
+
* written without it fails at construction rather than silently losing its
|
|
401
|
+
* border, its ring and the place its two buttons stand.
|
|
402
|
+
*/
|
|
403
|
+
numberField = inject(SlNumberField);
|
|
404
|
+
field = inject(SlField, { optional: true });
|
|
405
|
+
defaults = injectNumberFieldDefaults();
|
|
406
|
+
appLocale = injectLocale();
|
|
407
|
+
writtenId = inject(new HostAttributeToken('id'), { optional: true });
|
|
408
|
+
writtenName = inject(new HostAttributeToken('name'), { optional: true });
|
|
409
|
+
writtenForm = inject(new HostAttributeToken('form'), { optional: true });
|
|
410
|
+
writtenInputMode = inject(new HostAttributeToken('inputmode'), {
|
|
411
|
+
optional: true,
|
|
412
|
+
});
|
|
413
|
+
writtenDescribedBy = inject(new HostAttributeToken('aria-describedby'), {
|
|
414
|
+
optional: true,
|
|
415
|
+
});
|
|
416
|
+
writtenInvalid = inject(new HostAttributeToken('aria-invalid'), {
|
|
417
|
+
optional: true,
|
|
418
|
+
});
|
|
419
|
+
writtenRequired = inject(new HostAttributeToken('aria-required'), {
|
|
420
|
+
optional: true,
|
|
421
|
+
});
|
|
422
|
+
writtenReadonly = inject(new HostAttributeToken('readonly'), { optional: true });
|
|
423
|
+
/** What the family holds when nobody else owns it. */
|
|
424
|
+
own = signal(null, /* @ts-ignore */
|
|
425
|
+
...(ngDevMode ? [{ debugName: "own" }] : /* istanbul ignore next */ []));
|
|
426
|
+
/** What the element is showing. Never a second copy of the number. */
|
|
427
|
+
text = signal('', /* @ts-ignore */
|
|
428
|
+
...(ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []));
|
|
429
|
+
formDisabled = signal(undefined, /* @ts-ignore */
|
|
430
|
+
...(ngDevMode ? [{ debugName: "formDisabled" }] : /* istanbul ignore next */ []));
|
|
431
|
+
onChangeFn = () => undefined;
|
|
432
|
+
onTouchedFn = () => undefined;
|
|
433
|
+
/**
|
|
434
|
+
* One formatter, rebuilt only when the locale or the format changes. The
|
|
435
|
+
* options object is read through a signal, so an inline object handed on
|
|
436
|
+
* every change detection does not rebuild the parser.
|
|
437
|
+
*/
|
|
438
|
+
formatter = computed(() => {
|
|
439
|
+
const options = this.format();
|
|
440
|
+
return createNumberFormat({
|
|
441
|
+
locale: this.locale() ?? this.appLocale(),
|
|
442
|
+
...(options === undefined ? {} : { options }),
|
|
443
|
+
});
|
|
444
|
+
}, /* @ts-ignore */
|
|
445
|
+
...(ngDevMode ? [{ debugName: "formatter" }] : /* istanbul ignore next */ []));
|
|
446
|
+
/** Present means the consumer owns it; absent means the directive does. */
|
|
447
|
+
controlled = computed(() => this.value() !== undefined, /* @ts-ignore */
|
|
448
|
+
...(ngDevMode ? [{ debugName: "controlled" }] : /* istanbul ignore next */ []));
|
|
449
|
+
numberValue = computed(() => {
|
|
450
|
+
const bound = this.value();
|
|
451
|
+
return bound === undefined ? this.own() : bound;
|
|
452
|
+
}, /* @ts-ignore */
|
|
453
|
+
...(ngDevMode ? [{ debugName: "numberValue" }] : /* istanbul ignore next */ []));
|
|
454
|
+
valueText = computed(() => {
|
|
455
|
+
const shown = this.text();
|
|
456
|
+
return shown === '' ? null : shown;
|
|
457
|
+
}, /* @ts-ignore */
|
|
458
|
+
...(ngDevMode ? [{ debugName: "valueText" }] : /* istanbul ignore next */ []));
|
|
459
|
+
resolvedClamp = computed(() => this.clamp() ?? this.defaults.clamp, /* @ts-ignore */
|
|
460
|
+
...(ngDevMode ? [{ debugName: "resolvedClamp" }] : /* istanbul ignore next */ []));
|
|
461
|
+
resolvedFormatOn = computed(() => this.formatOn() ?? this.defaults.formatOn, /* @ts-ignore */
|
|
462
|
+
...(ngDevMode ? [{ debugName: "resolvedFormatOn" }] : /* istanbul ignore next */ []));
|
|
463
|
+
resolvedDisabled = computed(() => this.disabled() ?? this.formDisabled() ?? this.field?.resolvedDisabled(), /* @ts-ignore */
|
|
464
|
+
...(ngDevMode ? [{ debugName: "resolvedDisabled" }] : /* istanbul ignore next */ []));
|
|
465
|
+
resolvedReadOnly = computed(() => this.readOnly() ??
|
|
466
|
+
(this.writtenReadonly === null ? undefined : true) ??
|
|
467
|
+
this.field?.resolvedReadOnly(), /* @ts-ignore */
|
|
468
|
+
...(ngDevMode ? [{ debugName: "resolvedReadOnly" }] : /* istanbul ignore next */ []));
|
|
469
|
+
/**
|
|
470
|
+
* Unstated, the control asks the field. Under `clamp="none"` nothing returns
|
|
471
|
+
* a number outside `min`…`max` to the range, so the control reports it.
|
|
472
|
+
*/
|
|
473
|
+
outsideRange = computed(() => {
|
|
474
|
+
const current = this.numberValue();
|
|
475
|
+
const min = this.min();
|
|
476
|
+
const max = this.max();
|
|
477
|
+
return (this.resolvedClamp() === 'none' &&
|
|
478
|
+
current !== null &&
|
|
479
|
+
((min !== undefined && current < min) || (max !== undefined && current > max)));
|
|
480
|
+
}, /* @ts-ignore */
|
|
481
|
+
...(ngDevMode ? [{ debugName: "outsideRange" }] : /* istanbul ignore next */ []));
|
|
482
|
+
resolvedInvalid = computed(() => this.invalid() ?? (this.outsideRange() ? true : this.field?.invalid()), /* @ts-ignore */
|
|
483
|
+
...(ngDevMode ? [{ debugName: "resolvedInvalid" }] : /* istanbul ignore next */ []));
|
|
484
|
+
controlId = computed(() => this.writtenId ?? this.field?.ids().control ?? null, /* @ts-ignore */
|
|
485
|
+
...(ngDevMode ? [{ debugName: "controlId" }] : /* istanbul ignore next */ []));
|
|
486
|
+
submissionName = computed(() => this.writtenName, /* @ts-ignore */
|
|
487
|
+
...(ngDevMode ? [{ debugName: "submissionName" }] : /* istanbul ignore next */ []));
|
|
488
|
+
submissionForm = computed(() => this.writtenForm, /* @ts-ignore */
|
|
489
|
+
...(ngDevMode ? [{ debugName: "submissionForm" }] : /* istanbul ignore next */ []));
|
|
490
|
+
parsedText = computed(() => this.formatter().parse(this.text()), /* @ts-ignore */
|
|
491
|
+
...(ngDevMode ? [{ debugName: "parsedText" }] : /* istanbul ignore next */ []));
|
|
492
|
+
atMax = computed(() => {
|
|
493
|
+
const max = this.max();
|
|
494
|
+
const current = this.parsedText();
|
|
495
|
+
return max !== undefined && current !== null && current >= max;
|
|
496
|
+
}, /* @ts-ignore */
|
|
497
|
+
...(ngDevMode ? [{ debugName: "atMax" }] : /* istanbul ignore next */ []));
|
|
498
|
+
atMin = computed(() => {
|
|
499
|
+
const min = this.min();
|
|
500
|
+
const current = this.parsedText();
|
|
501
|
+
return min !== undefined && current !== null && current <= min;
|
|
502
|
+
}, /* @ts-ignore */
|
|
503
|
+
...(ngDevMode ? [{ debugName: "atMin" }] : /* istanbul ignore next */ []));
|
|
504
|
+
/**
|
|
505
|
+
* The software keyboard, derived from the props rather than from the user
|
|
506
|
+
* agent. Neither numeric keypad offers a minus sign on every platform, so a
|
|
507
|
+
* control that admits a negative asks for the full keyboard.
|
|
508
|
+
*/
|
|
509
|
+
resolvedInputMode = computed(() => {
|
|
510
|
+
if (this.writtenInputMode !== null)
|
|
511
|
+
return this.writtenInputMode;
|
|
512
|
+
const min = this.min();
|
|
513
|
+
if (min === undefined || min < 0)
|
|
514
|
+
return 'text';
|
|
515
|
+
return this.formatter().maximumFractionDigits > 0 ? 'decimal' : 'numeric';
|
|
516
|
+
}, /* @ts-ignore */
|
|
517
|
+
...(ngDevMode ? [{ debugName: "resolvedInputMode" }] : /* istanbul ignore next */ []));
|
|
518
|
+
describedBy = computed(() => {
|
|
519
|
+
const merged = [this.writtenDescribedBy, this.field?.describedBy()].filter(Boolean);
|
|
520
|
+
return merged.length === 0 ? null : merged.join(' ');
|
|
521
|
+
}, /* @ts-ignore */
|
|
522
|
+
...(ngDevMode ? [{ debugName: "describedBy" }] : /* istanbul ignore next */ []));
|
|
523
|
+
ariaInvalid = computed(() => this.writtenInvalid ?? (this.resolvedInvalid() === true ? 'true' : null), /* @ts-ignore */
|
|
524
|
+
...(ngDevMode ? [{ debugName: "ariaInvalid" }] : /* istanbul ignore next */ []));
|
|
525
|
+
ariaRequired = computed(() => this.writtenRequired ?? (this.field?.required() === true ? 'true' : null), /* @ts-ignore */
|
|
526
|
+
...(ngDevMode ? [{ debugName: "ariaRequired" }] : /* istanbul ignore next */ []));
|
|
527
|
+
disabledAttribute = computed(() => this.resolvedDisabled() === true ? '' : null, /* @ts-ignore */
|
|
528
|
+
...(ngDevMode ? [{ debugName: "disabledAttribute" }] : /* istanbul ignore next */ []));
|
|
529
|
+
readonlyAttribute = computed(() => this.resolvedReadOnly() === true ? '' : null, /* @ts-ignore */
|
|
530
|
+
...(ngDevMode ? [{ debugName: "readonlyAttribute" }] : /* istanbul ignore next */ []));
|
|
531
|
+
constructor() {
|
|
532
|
+
/* The element shows what the family holds, and the text is only rewritten
|
|
533
|
+
when it no longer means the same number — typing `1234` must not become
|
|
534
|
+
`1,234` between two keystrokes. */
|
|
535
|
+
effect(() => {
|
|
536
|
+
const next = this.numberValue();
|
|
537
|
+
const formatter = this.formatter();
|
|
538
|
+
if (Object.is(next, formatter.parse(this.text())))
|
|
539
|
+
return;
|
|
540
|
+
this.write(formatter.format(next));
|
|
541
|
+
});
|
|
542
|
+
this.attachWheel();
|
|
543
|
+
}
|
|
544
|
+
/**
|
|
545
|
+
* Angular creates every directive in a template before it binds any input, so
|
|
546
|
+
* the starting value is read here rather than in the constructor: read there,
|
|
547
|
+
* `defaultValue` is always its own default and the control starts empty.
|
|
548
|
+
*/
|
|
549
|
+
ngOnInit() {
|
|
550
|
+
const bound = this.value();
|
|
551
|
+
const initial = bound === undefined ? this.defaultValue() : bound;
|
|
552
|
+
if (bound === undefined)
|
|
553
|
+
this.own.set(initial);
|
|
554
|
+
this.write(this.formatter().format(initial));
|
|
555
|
+
}
|
|
556
|
+
/** The native element, for `focus()`, `select()` and `setSelectionRange()`. */
|
|
557
|
+
get inputElement() {
|
|
558
|
+
return this.element;
|
|
559
|
+
}
|
|
560
|
+
/** Steps up by one step and reports `programmatic`. */
|
|
561
|
+
increment() {
|
|
562
|
+
this.move(1, this.step(), 'programmatic', undefined);
|
|
563
|
+
}
|
|
564
|
+
/** Steps down by one step and reports `programmatic`. */
|
|
565
|
+
decrement() {
|
|
566
|
+
this.move(-1, this.step(), 'programmatic', undefined);
|
|
567
|
+
}
|
|
568
|
+
/** What a `slNumberFieldScrub` drag calls, once per whole step travelled. */
|
|
569
|
+
scrubBy(steps, source) {
|
|
570
|
+
if (steps === 0)
|
|
571
|
+
return;
|
|
572
|
+
const step = this.step();
|
|
573
|
+
const amount = source.shiftKey
|
|
574
|
+
? (this.largeStep() ?? step * 10)
|
|
575
|
+
: source.altKey
|
|
576
|
+
? (this.smallStep() ?? step / 10)
|
|
577
|
+
: step;
|
|
578
|
+
this.move(steps > 0 ? 1 : -1, amount * Math.abs(steps), 'pointer', source);
|
|
579
|
+
}
|
|
580
|
+
/** What the frame's two buttons call. Focus returns to the value. */
|
|
581
|
+
stepBy(direction, source) {
|
|
582
|
+
this.element.focus();
|
|
583
|
+
this.move(direction, this.step(), 'pointer', source);
|
|
584
|
+
}
|
|
585
|
+
writeValue(value) {
|
|
586
|
+
this.own.set(value ?? null);
|
|
587
|
+
this.write(this.formatter().format(value ?? null));
|
|
588
|
+
}
|
|
589
|
+
registerOnChange(fn) {
|
|
590
|
+
this.onChangeFn = fn;
|
|
591
|
+
}
|
|
592
|
+
registerOnTouched(fn) {
|
|
593
|
+
this.onTouchedFn = fn;
|
|
594
|
+
}
|
|
595
|
+
setDisabledState(isDisabled) {
|
|
596
|
+
this.formDisabled.set(isDisabled);
|
|
597
|
+
}
|
|
598
|
+
onInput(event) {
|
|
599
|
+
const raw = this.element.value;
|
|
600
|
+
const native = event;
|
|
601
|
+
/* An IME commits a whole run, and a run reshaped half way through is a run
|
|
602
|
+
the engine can no longer finish. The text is left alone until
|
|
603
|
+
`compositionend` sends a keystroke that is not composing. */
|
|
604
|
+
if (this.resolvedFormatOn() !== 'change' || native.isComposing) {
|
|
605
|
+
this.text.set(raw);
|
|
606
|
+
this.request(this.formatter().parse(raw), 'keyboard', undefined);
|
|
607
|
+
return;
|
|
608
|
+
}
|
|
609
|
+
const formatter = this.formatter();
|
|
610
|
+
const caret = this.element.selectionStart ?? raw.length;
|
|
611
|
+
const deletion = native.inputType?.startsWith('delete') === true;
|
|
612
|
+
const edited = deletion
|
|
613
|
+
? formatter.deleteAcrossSeparator(this.text(), { text: raw, caret }, native.inputType === 'deleteContentForward' ? 1 : -1)
|
|
614
|
+
: { text: raw, caret };
|
|
615
|
+
const shaped = formatter.formatWhileTyping(edited);
|
|
616
|
+
this.write(shaped.text);
|
|
617
|
+
/* Only while the reader is in the control: moving the selection of an
|
|
618
|
+
element nobody is typing in scrolls it into view on some engines. */
|
|
619
|
+
if (this.element.ownerDocument.activeElement === this.element) {
|
|
620
|
+
this.element.setSelectionRange(shaped.caret, shaped.caret);
|
|
621
|
+
}
|
|
622
|
+
this.request(formatter.parse(shaped.text), 'keyboard', undefined);
|
|
623
|
+
}
|
|
624
|
+
/**
|
|
625
|
+
* The keystroke filter. `beforeinput` is where a keystroke, a paste and a
|
|
626
|
+
* drop all arrive before the element changes, and it is the only place a
|
|
627
|
+
* character that cannot be part of a number can be refused without moving
|
|
628
|
+
* the caret.
|
|
629
|
+
*/
|
|
630
|
+
onBeforeInput(event) {
|
|
631
|
+
if (event.defaultPrevented)
|
|
632
|
+
return;
|
|
633
|
+
/* An IME commits a whole run; refusing it character by character would
|
|
634
|
+
make a full-width `123` untypeable. */
|
|
635
|
+
if (event.isComposing)
|
|
636
|
+
return;
|
|
637
|
+
if (event.inputType.startsWith('delete'))
|
|
638
|
+
return;
|
|
639
|
+
const start = this.element.selectionStart ?? this.element.value.length;
|
|
640
|
+
const finish = this.element.selectionEnd ?? this.element.value.length;
|
|
641
|
+
const next = this.element.value.slice(0, start) + (event.data ?? '') + this.element.value.slice(finish);
|
|
642
|
+
const formatter = this.formatter();
|
|
643
|
+
if (!formatter.isPartial(next)) {
|
|
644
|
+
event.preventDefault();
|
|
645
|
+
return;
|
|
646
|
+
}
|
|
647
|
+
if (this.resolvedClamp() !== 'strict')
|
|
648
|
+
return;
|
|
649
|
+
const parsed = formatter.parse(next);
|
|
650
|
+
if (parsed === null)
|
|
651
|
+
return;
|
|
652
|
+
const min = this.min();
|
|
653
|
+
const max = this.max();
|
|
654
|
+
if ((min !== undefined && parsed < min) || (max !== undefined && parsed > max)) {
|
|
655
|
+
event.preventDefault();
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
onKeyDown(event) {
|
|
659
|
+
if (event.defaultPrevented)
|
|
660
|
+
return;
|
|
661
|
+
if (this.resolvedDisabled() === true || this.resolvedReadOnly() === true)
|
|
662
|
+
return;
|
|
663
|
+
const step = this.step();
|
|
664
|
+
const large = this.largeStep() ?? step * 10;
|
|
665
|
+
const small = this.smallStep() ?? step / 10;
|
|
666
|
+
const amount = event.shiftKey ? large : event.altKey ? small : step;
|
|
667
|
+
switch (event.key) {
|
|
668
|
+
case 'ArrowUp':
|
|
669
|
+
event.preventDefault();
|
|
670
|
+
this.move(1, amount, 'keyboard', event);
|
|
671
|
+
return;
|
|
672
|
+
case 'ArrowDown':
|
|
673
|
+
event.preventDefault();
|
|
674
|
+
this.move(-1, amount, 'keyboard', event);
|
|
675
|
+
return;
|
|
676
|
+
case 'PageUp':
|
|
677
|
+
event.preventDefault();
|
|
678
|
+
this.move(1, large, 'keyboard', event);
|
|
679
|
+
return;
|
|
680
|
+
case 'PageDown':
|
|
681
|
+
event.preventDefault();
|
|
682
|
+
this.move(-1, large, 'keyboard', event);
|
|
683
|
+
return;
|
|
684
|
+
case 'Home': {
|
|
685
|
+
const min = this.min();
|
|
686
|
+
if (min === undefined || event.ctrlKey || event.metaKey)
|
|
687
|
+
return;
|
|
688
|
+
event.preventDefault();
|
|
689
|
+
this.settle(min, this.request(min, 'keyboard', event));
|
|
690
|
+
return;
|
|
691
|
+
}
|
|
692
|
+
case 'End': {
|
|
693
|
+
const max = this.max();
|
|
694
|
+
if (max === undefined || event.ctrlKey || event.metaKey)
|
|
695
|
+
return;
|
|
696
|
+
event.preventDefault();
|
|
697
|
+
this.settle(max, this.request(max, 'keyboard', event));
|
|
698
|
+
return;
|
|
699
|
+
}
|
|
700
|
+
case 'Enter':
|
|
701
|
+
/* Committed and not intercepted: a single-line control submits its
|
|
702
|
+
form, which is the platform's behaviour. */
|
|
703
|
+
this.commit('keyboard', event);
|
|
704
|
+
return;
|
|
705
|
+
default:
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
onBlur(event) {
|
|
709
|
+
this.onTouchedFn();
|
|
710
|
+
this.commit('blur', event);
|
|
711
|
+
}
|
|
712
|
+
/**
|
|
713
|
+
* The wheel, when it is asked for, and never otherwise. It is a native
|
|
714
|
+
* listener rather than a host binding because the event has to be cancelled,
|
|
715
|
+
* and a host listener on `wheel` is passive in some browsers.
|
|
716
|
+
*/
|
|
717
|
+
attachWheel() {
|
|
718
|
+
const onWheel = (event) => {
|
|
719
|
+
if (!this.wheel())
|
|
720
|
+
return;
|
|
721
|
+
if (this.resolvedDisabled() === true || this.resolvedReadOnly() === true)
|
|
722
|
+
return;
|
|
723
|
+
if (this.element.ownerDocument.activeElement !== this.element)
|
|
724
|
+
return;
|
|
725
|
+
if (event.deltaY === 0)
|
|
726
|
+
return;
|
|
727
|
+
event.preventDefault();
|
|
728
|
+
this.move(event.deltaY < 0 ? 1 : -1, this.step(), 'pointer', event);
|
|
729
|
+
};
|
|
730
|
+
this.element.addEventListener('wheel', onWheel, { passive: false });
|
|
731
|
+
inject(DestroyRef).onDestroy(() => this.element.removeEventListener('wheel', onWheel));
|
|
732
|
+
}
|
|
733
|
+
/** Formats what the reader typed and puts the value back in range. */
|
|
734
|
+
commit(reason, source) {
|
|
735
|
+
const formatter = this.formatter();
|
|
736
|
+
let next = formatter.parse(this.text());
|
|
737
|
+
const min = this.min();
|
|
738
|
+
const max = this.max();
|
|
739
|
+
if (next !== null) {
|
|
740
|
+
/* The number committed is the number shown: rounded to the precision
|
|
741
|
+
the format states, through the same formatter. */
|
|
742
|
+
next = formatter.parse(formatter.format(next)) ?? next;
|
|
743
|
+
/* A typed value goes to the nearest multiple of the grid. */
|
|
744
|
+
if (this.snapToStep())
|
|
745
|
+
next = snapToStep(next, this.step(), min ?? 0);
|
|
746
|
+
if (this.resolvedClamp() !== 'none') {
|
|
747
|
+
next = clamp(next, min ?? Number.NEGATIVE_INFINITY, max ?? Number.POSITIVE_INFINITY);
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
this.settle(next, this.request(next, reason, source));
|
|
751
|
+
}
|
|
752
|
+
move(direction, amount, reason, source) {
|
|
753
|
+
const min = this.min();
|
|
754
|
+
const max = this.max();
|
|
755
|
+
const stepFrom = this.stepFrom();
|
|
756
|
+
const next = stepNumber({
|
|
757
|
+
value: this.formatter().parse(this.text()),
|
|
758
|
+
direction,
|
|
759
|
+
step: amount,
|
|
760
|
+
...(min === undefined ? {} : { min }),
|
|
761
|
+
...(max === undefined ? {} : { max }),
|
|
762
|
+
...(stepFrom === undefined ? {} : { stepFrom }),
|
|
763
|
+
snapToStep: this.snapToStep(),
|
|
764
|
+
});
|
|
765
|
+
this.settle(next, this.request(next, reason, source));
|
|
766
|
+
}
|
|
767
|
+
/**
|
|
768
|
+
* Asks to move, and says whether anything did. A refused request answers
|
|
769
|
+
* `false`, and the caller uses that to decide what the element shows: a
|
|
770
|
+
* control that wrote the new number into the text regardless would show a
|
|
771
|
+
* value the consumer never accepted.
|
|
772
|
+
*/
|
|
773
|
+
request(next, reason, source) {
|
|
774
|
+
const current = this.numberValue();
|
|
775
|
+
if (Object.is(next, current))
|
|
776
|
+
return false;
|
|
777
|
+
let cancelled = false;
|
|
778
|
+
const state = createControllable({
|
|
779
|
+
controlled: undefined,
|
|
780
|
+
initial: current,
|
|
781
|
+
onRequest: (pending) => {
|
|
782
|
+
this.valueChange.emit(pending);
|
|
783
|
+
cancelled = pending.cancelled;
|
|
784
|
+
},
|
|
785
|
+
});
|
|
786
|
+
state.request(next, reason, source);
|
|
787
|
+
if (cancelled)
|
|
788
|
+
return false;
|
|
789
|
+
this.onChangeFn(next);
|
|
790
|
+
/* A controlled control never moves its own number: it asks, and waits for
|
|
791
|
+
the consumer's next value. */
|
|
792
|
+
if (this.controlled())
|
|
793
|
+
return false;
|
|
794
|
+
this.own.set(next);
|
|
795
|
+
return true;
|
|
796
|
+
}
|
|
797
|
+
settle(next, moved) {
|
|
798
|
+
const shown = moved ? next : this.numberValue();
|
|
799
|
+
this.write(this.formatter().format(shown));
|
|
800
|
+
}
|
|
801
|
+
/** One place the element's text is written, so the signal never drifts from it. */
|
|
802
|
+
write(value) {
|
|
803
|
+
if (this.element.value !== value)
|
|
804
|
+
this.element.value = value;
|
|
805
|
+
this.text.set(value);
|
|
806
|
+
}
|
|
807
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlNumberFieldInput, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
808
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.7", type: SlNumberFieldInput, isStandalone: true, selector: "input[slNumberFieldInput]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, defaultValue: { classPropertyName: "defaultValue", publicName: "defaultValue", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, largeStep: { classPropertyName: "largeStep", publicName: "largeStep", isSignal: true, isRequired: false, transformFunction: null }, smallStep: { classPropertyName: "smallStep", publicName: "smallStep", isSignal: true, isRequired: false, transformFunction: null }, stepFrom: { classPropertyName: "stepFrom", publicName: "stepFrom", isSignal: true, isRequired: false, transformFunction: null }, snapToStep: { classPropertyName: "snapToStep", publicName: "snapToStep", isSignal: true, isRequired: false, transformFunction: null }, clamp: { classPropertyName: "clamp", publicName: "clamp", isSignal: true, isRequired: false, transformFunction: null }, format: { classPropertyName: "format", publicName: "format", isSignal: true, isRequired: false, transformFunction: null }, formatOn: { classPropertyName: "formatOn", publicName: "formatOn", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null }, wheel: { classPropertyName: "wheel", publicName: "wheel", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange" }, host: { attributes: { "data-part": "input", "autocomplete": "off", "autocorrect": "off", "spellcheck": "false" }, listeners: { "input": "onInput($event)", "beforeinput": "onBeforeInput($event)", "keydown": "onKeyDown($event)", "blur": "onBlur($event)" }, properties: { "attr.type": "'text'", "attr.role": "'spinbutton'", "attr.id": "controlId()", "attr.inputmode": "resolvedInputMode()", "attr.aria-describedby": "describedBy()", "attr.aria-invalid": "ariaInvalid()", "attr.aria-required": "ariaRequired()", "attr.aria-valuenow": "numberValue()", "attr.aria-valuemin": "min() ?? null", "attr.aria-valuemax": "max() ?? null", "attr.aria-valuetext": "valueText()", "attr.name": "null", "attr.disabled": "disabledAttribute()", "attr.readonly": "readonlyAttribute()" } }, providers: [
|
|
809
|
+
{ provide: SlNumberFieldControl, useExisting: forwardRef(() => SlNumberFieldInput) },
|
|
810
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => SlNumberFieldInput), multi: true },
|
|
811
|
+
], exportAs: ["slNumberFieldInput"], ngImport: i0 });
|
|
812
|
+
}
|
|
813
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlNumberFieldInput, decorators: [{
|
|
814
|
+
type: Directive,
|
|
815
|
+
args: [{
|
|
816
|
+
selector: 'input[slNumberFieldInput]',
|
|
817
|
+
standalone: true,
|
|
818
|
+
exportAs: 'slNumberFieldInput',
|
|
819
|
+
providers: [
|
|
820
|
+
{ provide: SlNumberFieldControl, useExisting: forwardRef(() => SlNumberFieldInput) },
|
|
821
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => SlNumberFieldInput), multi: true },
|
|
822
|
+
],
|
|
823
|
+
host: {
|
|
824
|
+
'data-part': 'input',
|
|
825
|
+
autocomplete: 'off',
|
|
826
|
+
autocorrect: 'off',
|
|
827
|
+
spellcheck: 'false',
|
|
828
|
+
/* Bound rather than static, so a consumer who wrote `type="number"` on a
|
|
829
|
+
number field does not get the element that empties its own value. */
|
|
830
|
+
'[attr.type]': "'text'",
|
|
831
|
+
'[attr.role]': "'spinbutton'",
|
|
832
|
+
'[attr.id]': 'controlId()',
|
|
833
|
+
'[attr.inputmode]': 'resolvedInputMode()',
|
|
834
|
+
'[attr.aria-describedby]': 'describedBy()',
|
|
835
|
+
'[attr.aria-invalid]': 'ariaInvalid()',
|
|
836
|
+
'[attr.aria-required]': 'ariaRequired()',
|
|
837
|
+
'[attr.aria-valuenow]': 'numberValue()',
|
|
838
|
+
'[attr.aria-valuemin]': 'min() ?? null',
|
|
839
|
+
'[attr.aria-valuemax]': 'max() ?? null',
|
|
840
|
+
'[attr.aria-valuetext]': 'valueText()',
|
|
841
|
+
'[attr.name]': 'null',
|
|
842
|
+
'[attr.disabled]': 'disabledAttribute()',
|
|
843
|
+
'[attr.readonly]': 'readonlyAttribute()',
|
|
844
|
+
'(input)': 'onInput($event)',
|
|
845
|
+
'(beforeinput)': 'onBeforeInput($event)',
|
|
846
|
+
'(keydown)': 'onKeyDown($event)',
|
|
847
|
+
'(blur)': 'onBlur($event)',
|
|
848
|
+
},
|
|
849
|
+
}]
|
|
850
|
+
}], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], defaultValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultValue", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }], largeStep: [{ type: i0.Input, args: [{ isSignal: true, alias: "largeStep", required: false }] }], smallStep: [{ type: i0.Input, args: [{ isSignal: true, alias: "smallStep", required: false }] }], stepFrom: [{ type: i0.Input, args: [{ isSignal: true, alias: "stepFrom", required: false }] }], snapToStep: [{ type: i0.Input, args: [{ isSignal: true, alias: "snapToStep", required: false }] }], clamp: [{ type: i0.Input, args: [{ isSignal: true, alias: "clamp", required: false }] }], format: [{ type: i0.Input, args: [{ isSignal: true, alias: "format", required: false }] }], formatOn: [{ type: i0.Input, args: [{ isSignal: true, alias: "formatOn", required: false }] }], locale: [{ type: i0.Input, args: [{ isSignal: true, alias: "locale", required: false }] }], wheel: [{ type: i0.Input, args: [{ isSignal: true, alias: "wheel", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readOnly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readOnly", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }] } });
|
|
851
|
+
|
|
852
|
+
/**
|
|
853
|
+
* An adornment before the value in the reading direction: a currency mark, a
|
|
854
|
+
* unit, an icon. Named for the direction rather than for a side, so the same
|
|
855
|
+
* markup puts the mark before the amount in both directions.
|
|
856
|
+
*
|
|
857
|
+
* It is a sibling of the number rather than part of it. A symbol that belongs
|
|
858
|
+
* *inside* the value — the `R$` of a currency format, a percent sign — is
|
|
859
|
+
* `format`'s job and arrives through `Intl` as part of the string the control
|
|
860
|
+
* holds; this one is never selected, never copied and never parsed.
|
|
861
|
+
*/
|
|
862
|
+
class SlNumberFieldStart {
|
|
863
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlNumberFieldStart, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
864
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.7", type: SlNumberFieldStart, isStandalone: true, selector: "[slNumberFieldStart]", host: { attributes: { "data-part": "start" } }, exportAs: ["slNumberFieldStart"], ngImport: i0 });
|
|
865
|
+
}
|
|
866
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlNumberFieldStart, decorators: [{
|
|
867
|
+
type: Directive,
|
|
868
|
+
args: [{
|
|
869
|
+
selector: '[slNumberFieldStart]',
|
|
870
|
+
standalone: true,
|
|
871
|
+
exportAs: 'slNumberFieldStart',
|
|
872
|
+
host: { 'data-part': 'start' },
|
|
873
|
+
}]
|
|
874
|
+
}] });
|
|
875
|
+
/** An adornment after the value in the reading direction. */
|
|
876
|
+
class SlNumberFieldEnd {
|
|
877
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlNumberFieldEnd, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
878
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.7", type: SlNumberFieldEnd, isStandalone: true, selector: "[slNumberFieldEnd]", host: { attributes: { "data-part": "end" } }, exportAs: ["slNumberFieldEnd"], ngImport: i0 });
|
|
879
|
+
}
|
|
880
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlNumberFieldEnd, decorators: [{
|
|
881
|
+
type: Directive,
|
|
882
|
+
args: [{
|
|
883
|
+
selector: '[slNumberFieldEnd]',
|
|
884
|
+
standalone: true,
|
|
885
|
+
exportAs: 'slNumberFieldEnd',
|
|
886
|
+
host: { 'data-part': 'end' },
|
|
887
|
+
}]
|
|
888
|
+
}] });
|
|
889
|
+
/**
|
|
890
|
+
* A mark that moves the number when it is dragged sideways — the design
|
|
891
|
+
* tools' gesture. Placed inside `slNumberFieldStart` or `slNumberFieldEnd`,
|
|
892
|
+
* where the frame it belongs to is its ancestor:
|
|
893
|
+
*
|
|
894
|
+
* ```html
|
|
895
|
+
* <span slNumberFieldStart><span slNumberFieldScrub>W</span></span>
|
|
896
|
+
* ```
|
|
897
|
+
*
|
|
898
|
+
* Each `sensitivity` pixels towards the inline end is one step up; `Shift`
|
|
899
|
+
* moves by the large step and `Alt` by the small one, as on the keyboard. It
|
|
900
|
+
* is hidden from assistive technology and takes no focus: the input's arrow
|
|
901
|
+
* keys are the same movement.
|
|
902
|
+
*/
|
|
903
|
+
class SlNumberFieldScrub {
|
|
904
|
+
/** Pixels of horizontal travel per step. Defaults to 2. */
|
|
905
|
+
sensitivity = input(SCRUB_SENSITIVITY, /* @ts-ignore */
|
|
906
|
+
...(ngDevMode ? [{ debugName: "sensitivity" }] : /* istanbul ignore next */ []));
|
|
907
|
+
frame = inject(SlNumberField);
|
|
908
|
+
active = signal(false, /* @ts-ignore */
|
|
909
|
+
...(ngDevMode ? [{ debugName: "active" }] : /* istanbul ignore next */ []));
|
|
910
|
+
travel = null;
|
|
911
|
+
begin(event) {
|
|
912
|
+
const control = this.frame.control();
|
|
913
|
+
if (event.button !== 0 || control === undefined || this.frame.inert())
|
|
914
|
+
return;
|
|
915
|
+
/* No text selection, and the caret stays in the value the drag moves. */
|
|
916
|
+
event.preventDefault();
|
|
917
|
+
control.inputElement.focus();
|
|
918
|
+
event.currentTarget?.setPointerCapture?.(event.pointerId);
|
|
919
|
+
this.travel = createScrub({
|
|
920
|
+
clientX: event.clientX,
|
|
921
|
+
sensitivity: this.sensitivity(),
|
|
922
|
+
rtl: getComputedStyle(control.inputElement).direction === 'rtl',
|
|
923
|
+
});
|
|
924
|
+
this.active.set(true);
|
|
925
|
+
this.frame.scrubbing.set(true);
|
|
926
|
+
}
|
|
927
|
+
drag(event) {
|
|
928
|
+
if (this.travel === null)
|
|
929
|
+
return;
|
|
930
|
+
this.frame.control()?.scrubBy(this.travel.steps(event.clientX), event);
|
|
931
|
+
}
|
|
932
|
+
end() {
|
|
933
|
+
if (this.travel === null)
|
|
934
|
+
return;
|
|
935
|
+
this.travel = null;
|
|
936
|
+
this.active.set(false);
|
|
937
|
+
this.frame.scrubbing.set(false);
|
|
938
|
+
}
|
|
939
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlNumberFieldScrub, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
940
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.7", type: SlNumberFieldScrub, isStandalone: true, selector: "[slNumberFieldScrub]", inputs: { sensitivity: { classPropertyName: "sensitivity", publicName: "sensitivity", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-part": "scrub", "aria-hidden": "true" }, listeners: { "pointerdown": "begin($event)", "pointermove": "drag($event)", "pointerup": "end()", "pointercancel": "end()", "lostpointercapture": "end()" }, properties: { "attr.data-scrubbing": "active() ? '' : null" } }, exportAs: ["slNumberFieldScrub"], ngImport: i0 });
|
|
941
|
+
}
|
|
942
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlNumberFieldScrub, decorators: [{
|
|
943
|
+
type: Directive,
|
|
944
|
+
args: [{
|
|
945
|
+
selector: '[slNumberFieldScrub]',
|
|
946
|
+
standalone: true,
|
|
947
|
+
exportAs: 'slNumberFieldScrub',
|
|
948
|
+
host: {
|
|
949
|
+
'data-part': 'scrub',
|
|
950
|
+
'aria-hidden': 'true',
|
|
951
|
+
'[attr.data-scrubbing]': "active() ? '' : null",
|
|
952
|
+
'(pointerdown)': 'begin($event)',
|
|
953
|
+
'(pointermove)': 'drag($event)',
|
|
954
|
+
'(pointerup)': 'end()',
|
|
955
|
+
'(pointercancel)': 'end()',
|
|
956
|
+
'(lostpointercapture)': 'end()',
|
|
957
|
+
},
|
|
958
|
+
}]
|
|
959
|
+
}], propDecorators: { sensitivity: [{ type: i0.Input, args: [{ isSignal: true, alias: "sensitivity", required: false }] }] } });
|
|
960
|
+
|
|
961
|
+
/**
|
|
962
|
+
* Generated bundle index. Do not edit.
|
|
963
|
+
*/
|
|
964
|
+
|
|
965
|
+
export { NUMBER_FIELD_DEFAULTS, SlNumberField, SlNumberFieldControl, SlNumberFieldEnd, SlNumberFieldInput, SlNumberFieldScrub, SlNumberFieldStart, injectNumberFieldDefaults, provideNumberFieldDefaults };
|
|
966
|
+
//# sourceMappingURL=slotted-angular-number-field.mjs.map
|