@slotted/angular 0.0.0-stage → 0.1.0-beta.1
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,1078 @@
|
|
|
1
|
+
<!-- index: ./index.md -->
|
|
2
|
+
# number-field
|
|
3
|
+
|
|
4
|
+
`data-ui="number-field"` · Number input with steppers and formatting.
|
|
5
|
+
|
|
6
|
+
## Examples
|
|
7
|
+
|
|
8
|
+
### Playground
|
|
9
|
+
|
|
10
|
+
One control with every axis on it, driven by the controls below the canvas. Type a number, then hold the increment button: it steps once, waits, and then repeats.
|
|
11
|
+
|
|
12
|
+
Excerpt — not a complete module
|
|
13
|
+
|
|
14
|
+
```html
|
|
15
|
+
<div slField>
|
|
16
|
+
<label slFieldLabel>Quantidade</label>
|
|
17
|
+
<div slNumberField>
|
|
18
|
+
<input slNumberFieldInput defaultValue="3" min="1" max="99" />
|
|
19
|
+
</div>
|
|
20
|
+
<span slFieldDescription>Máximo de 99 unidades por pedido.</span>
|
|
21
|
+
</div>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### The step the control sits at
|
|
25
|
+
|
|
26
|
+
Three steps, and inside a field the control takes the field’s rather than its own: a small field holding a medium control is a field and a control disagreeing about one row.
|
|
27
|
+
|
|
28
|
+
Example
|
|
29
|
+
|
|
30
|
+
```ts
|
|
31
|
+
import { Component } from '@angular/core';
|
|
32
|
+
import { SlNumberField, SlNumberFieldInput } from '@slotted/angular/number-field';
|
|
33
|
+
import { SlStack } from '@slotted/angular/stack';
|
|
34
|
+
|
|
35
|
+
@Component({
|
|
36
|
+
selector: 'app-number-field-sizes',
|
|
37
|
+
imports: [SlNumberField, SlNumberFieldInput, SlStack],
|
|
38
|
+
template: `
|
|
39
|
+
<div slStack [gap]="4">
|
|
40
|
+
<div slNumberField size="sm">
|
|
41
|
+
<input slNumberFieldInput aria-label="Units per case" defaultValue="24" min="1" />
|
|
42
|
+
</div>
|
|
43
|
+
<div slNumberField size="md">
|
|
44
|
+
<input slNumberFieldInput aria-label="Cases ordered" defaultValue="12" min="1" />
|
|
45
|
+
</div>
|
|
46
|
+
<div slNumberField size="lg">
|
|
47
|
+
<input slNumberFieldInput aria-label="Pallets ordered" defaultValue="2" min="1" />
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
`,
|
|
51
|
+
})
|
|
52
|
+
export class NumberFieldSizes {}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### How much frame the control shows
|
|
56
|
+
|
|
57
|
+
outline takes the ground it is placed on, subtle sinks into the page, and plain shows nothing until the pointer or the caret arrives — which is what a dense table cell of amounts needs.
|
|
58
|
+
|
|
59
|
+
Example
|
|
60
|
+
|
|
61
|
+
```ts
|
|
62
|
+
import { Component } from '@angular/core';
|
|
63
|
+
import { SlField, SlFieldLabel } from '@slotted/angular/field';
|
|
64
|
+
import { SlNumberField, SlNumberFieldInput } from '@slotted/angular/number-field';
|
|
65
|
+
import { SlStack } from '@slotted/angular/stack';
|
|
66
|
+
|
|
67
|
+
@Component({
|
|
68
|
+
selector: 'app-number-field-variants',
|
|
69
|
+
imports: [SlField, SlFieldLabel, SlNumberField, SlNumberFieldInput, SlStack],
|
|
70
|
+
template: `
|
|
71
|
+
<div slStack [gap]="4">
|
|
72
|
+
<div slField>
|
|
73
|
+
<label slFieldLabel>Unit price</label>
|
|
74
|
+
<div slNumberField variant="outline">
|
|
75
|
+
<input
|
|
76
|
+
slNumberFieldInput
|
|
77
|
+
defaultValue="18"
|
|
78
|
+
min="0"
|
|
79
|
+
[format]="{ currency: 'USD', style: 'currency' }"
|
|
80
|
+
/>
|
|
81
|
+
</div>
|
|
82
|
+
</div>
|
|
83
|
+
<div slField>
|
|
84
|
+
<label slFieldLabel>Discount</label>
|
|
85
|
+
<div slNumberField variant="subtle">
|
|
86
|
+
<input
|
|
87
|
+
slNumberFieldInput
|
|
88
|
+
defaultValue="0.05"
|
|
89
|
+
min="0"
|
|
90
|
+
max="1"
|
|
91
|
+
step="0.01"
|
|
92
|
+
[format]="{ style: 'percent' }"
|
|
93
|
+
/>
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
<div slField>
|
|
97
|
+
<label slFieldLabel>Freight</label>
|
|
98
|
+
<div slNumberField variant="plain" stepper="none">
|
|
99
|
+
<input
|
|
100
|
+
slNumberFieldInput
|
|
101
|
+
defaultValue="32.38"
|
|
102
|
+
min="0"
|
|
103
|
+
[format]="{ currency: 'USD', style: 'currency' }"
|
|
104
|
+
/>
|
|
105
|
+
</div>
|
|
106
|
+
</div>
|
|
107
|
+
</div>
|
|
108
|
+
`,
|
|
109
|
+
})
|
|
110
|
+
export class NumberFieldVariants {}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Where the two buttons sit, and whether they sit at all
|
|
114
|
+
|
|
115
|
+
stacked is one column at the inline end; split puts decrement and increment at either end of the frame with the value centred between them, which is the only arrangement whose targets clear 24 pixels in both axes.
|
|
116
|
+
|
|
117
|
+
Excerpt — not a complete module
|
|
118
|
+
|
|
119
|
+
```html
|
|
120
|
+
<div slNumberField stepper="stacked"><input slNumberFieldInput defaultValue="12" /></div>
|
|
121
|
+
|
|
122
|
+
<!-- The arrangement a thumb can hit, and the one a quantity wants. -->
|
|
123
|
+
<div slNumberField stepper="split">
|
|
124
|
+
<input slNumberFieldInput defaultValue="3" min="1" max="99" />
|
|
125
|
+
</div>
|
|
126
|
+
|
|
127
|
+
<!-- Typed and never spun, which is what a dense table asks for. -->
|
|
128
|
+
<div slNumberField stepper="none"><input slNumberFieldInput defaultValue="1480" /></div>
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### The bounds, the step, and what happens at the edge
|
|
132
|
+
|
|
133
|
+
The stepper that would leave the range is disabled rather than silently inert. Type 400 into the first control and tab away: clamp="blur" brings it back, while clamp="none" leaves it where you put it and says so.
|
|
134
|
+
|
|
135
|
+
Example
|
|
136
|
+
|
|
137
|
+
```ts
|
|
138
|
+
import { Component } from '@angular/core';
|
|
139
|
+
import { SlField, SlFieldDescription, SlFieldLabel } from '@slotted/angular/field';
|
|
140
|
+
import { SlNumberField, SlNumberFieldInput } from '@slotted/angular/number-field';
|
|
141
|
+
import { SlStack } from '@slotted/angular/stack';
|
|
142
|
+
|
|
143
|
+
@Component({
|
|
144
|
+
selector: 'app-number-field-range',
|
|
145
|
+
imports: [SlField, SlFieldDescription, SlFieldLabel, SlNumberField, SlNumberFieldInput, SlStack],
|
|
146
|
+
template: `
|
|
147
|
+
<div slStack [gap]="5">
|
|
148
|
+
<div slField>
|
|
149
|
+
<label slFieldLabel>Pallets on the trailer</label>
|
|
150
|
+
<div slNumberField>
|
|
151
|
+
<input slNumberFieldInput defaultValue="26" min="0" max="26" />
|
|
152
|
+
</div>
|
|
153
|
+
<span slFieldDescription>A 53-foot trailer holds 26 pallets.</span>
|
|
154
|
+
</div>
|
|
155
|
+
<div slField>
|
|
156
|
+
<label slFieldLabel>Bottles of Chartreuse verte</label>
|
|
157
|
+
<div slNumberField>
|
|
158
|
+
<input slNumberFieldInput defaultValue="12" min="6" step="6" snapToStep />
|
|
159
|
+
</div>
|
|
160
|
+
<span slFieldDescription>Sold in cases of 6. Type 20 and leave the field.</span>
|
|
161
|
+
</div>
|
|
162
|
+
</div>
|
|
163
|
+
`,
|
|
164
|
+
})
|
|
165
|
+
export class NumberFieldRange {}
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### Currency, percent and unit are formattings, not types
|
|
169
|
+
|
|
170
|
+
One numeric value, written by Intl.NumberFormat. The symbol inside the value comes from format and is part of what a reader copies; a symbol beside the value is an adornment instead, and the two sit side by side below.
|
|
171
|
+
|
|
172
|
+
Example
|
|
173
|
+
|
|
174
|
+
```ts
|
|
175
|
+
import { Component } from '@angular/core';
|
|
176
|
+
import { SlField, SlFieldLabel } from '@slotted/angular/field';
|
|
177
|
+
import { SlNumberField, SlNumberFieldInput } from '@slotted/angular/number-field';
|
|
178
|
+
import { SlStack } from '@slotted/angular/stack';
|
|
179
|
+
|
|
180
|
+
@Component({
|
|
181
|
+
selector: 'app-number-field-format',
|
|
182
|
+
imports: [SlField, SlFieldLabel, SlNumberField, SlNumberFieldInput, SlStack],
|
|
183
|
+
template: `
|
|
184
|
+
<div slStack [gap]="4">
|
|
185
|
+
<div slField>
|
|
186
|
+
<label slFieldLabel>Credit limit</label>
|
|
187
|
+
<div slNumberField>
|
|
188
|
+
<input
|
|
189
|
+
slNumberFieldInput
|
|
190
|
+
defaultValue="25000"
|
|
191
|
+
min="0"
|
|
192
|
+
step="500"
|
|
193
|
+
[format]="{ currency: 'USD', style: 'currency' }"
|
|
194
|
+
/>
|
|
195
|
+
</div>
|
|
196
|
+
</div>
|
|
197
|
+
<div slField>
|
|
198
|
+
<label slFieldLabel>Sales tax</label>
|
|
199
|
+
<div slNumberField>
|
|
200
|
+
<input
|
|
201
|
+
slNumberFieldInput
|
|
202
|
+
defaultValue="0.0825"
|
|
203
|
+
min="0"
|
|
204
|
+
max="1"
|
|
205
|
+
step="0.0025"
|
|
206
|
+
[format]="{ maximumFractionDigits: 2, style: 'percent' }"
|
|
207
|
+
/>
|
|
208
|
+
</div>
|
|
209
|
+
</div>
|
|
210
|
+
<div slField>
|
|
211
|
+
<label slFieldLabel>Pallet volume</label>
|
|
212
|
+
<div slNumberField>
|
|
213
|
+
<input
|
|
214
|
+
slNumberFieldInput
|
|
215
|
+
defaultValue="1.8"
|
|
216
|
+
min="0"
|
|
217
|
+
step="0.1"
|
|
218
|
+
[format]="{ style: 'unit', unit: 'liter', unitDisplay: 'long' }"
|
|
219
|
+
/>
|
|
220
|
+
</div>
|
|
221
|
+
</div>
|
|
222
|
+
</div>
|
|
223
|
+
`,
|
|
224
|
+
})
|
|
225
|
+
export class NumberFieldFormat {}
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
### When the grouping appears
|
|
229
|
+
|
|
230
|
+
The two amounts below are the same under both settings; the axis decides only what the field shows between two keystrokes. The number itself moves on every keystroke that parses either way.
|
|
231
|
+
|
|
232
|
+
Excerpt — not a complete module
|
|
233
|
+
|
|
234
|
+
```html
|
|
235
|
+
<!-- The default. The caret stays on the character it was on, because it is
|
|
236
|
+
counted in the reader's own characters rather than in string indices. -->
|
|
237
|
+
<div slNumberField><input slNumberFieldInput locale="pt-BR" /></div>
|
|
238
|
+
|
|
239
|
+
<!-- The reader's own text until blur, Enter, a stepper press or a key step.
|
|
240
|
+
For an amount that is pasted and audited rather than typed. -->
|
|
241
|
+
<div slNumberField>
|
|
242
|
+
<input slNumberFieldInput locale="pt-BR" formatOn="commit" />
|
|
243
|
+
</div>
|
|
244
|
+
|
|
245
|
+
<!-- Rounding and padding belong to the commit under both: 1,50 keeps its
|
|
246
|
+
nought while it is being typed, and 1, keeps its separator. -->
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
### The separator, the grouping and the numerals
|
|
250
|
+
|
|
251
|
+
Paste “R$ 1.480,00” into the Brazilian control and “١٬٤٨٠” into the Arabic one: both parse, because the parser is built from the same Intl parts the formatter writes with.
|
|
252
|
+
|
|
253
|
+
Example
|
|
254
|
+
|
|
255
|
+
```ts
|
|
256
|
+
import { Component } from '@angular/core';
|
|
257
|
+
import { SlField, SlFieldLabel } from '@slotted/angular/field';
|
|
258
|
+
import { SlNumberField, SlNumberFieldInput } from '@slotted/angular/number-field';
|
|
259
|
+
import { SlStack } from '@slotted/angular/stack';
|
|
260
|
+
|
|
261
|
+
@Component({
|
|
262
|
+
selector: 'app-number-field-locale',
|
|
263
|
+
imports: [SlField, SlFieldLabel, SlNumberField, SlNumberFieldInput, SlStack],
|
|
264
|
+
template: `
|
|
265
|
+
<div slStack [gap]="4">
|
|
266
|
+
<div slField>
|
|
267
|
+
<label slFieldLabel>Invoice total, United States</label>
|
|
268
|
+
<div slNumberField>
|
|
269
|
+
<input
|
|
270
|
+
slNumberFieldInput
|
|
271
|
+
defaultValue="14800.5"
|
|
272
|
+
locale="en-US"
|
|
273
|
+
[format]="{ currency: 'USD', style: 'currency' }"
|
|
274
|
+
/>
|
|
275
|
+
</div>
|
|
276
|
+
</div>
|
|
277
|
+
<div slField>
|
|
278
|
+
<label slFieldLabel>Invoice total, Germany</label>
|
|
279
|
+
<div slNumberField>
|
|
280
|
+
<input
|
|
281
|
+
slNumberFieldInput
|
|
282
|
+
defaultValue="14800.5"
|
|
283
|
+
locale="de-DE"
|
|
284
|
+
[format]="{ currency: 'EUR', style: 'currency' }"
|
|
285
|
+
/>
|
|
286
|
+
</div>
|
|
287
|
+
</div>
|
|
288
|
+
<div slField>
|
|
289
|
+
<label slFieldLabel>Invoice total, Egypt</label>
|
|
290
|
+
<div slNumberField>
|
|
291
|
+
<input
|
|
292
|
+
slNumberFieldInput
|
|
293
|
+
defaultValue="14800.5"
|
|
294
|
+
locale="ar-EG"
|
|
295
|
+
[format]="{ currency: 'EGP', style: 'currency' }"
|
|
296
|
+
/>
|
|
297
|
+
</div>
|
|
298
|
+
</div>
|
|
299
|
+
</div>
|
|
300
|
+
`,
|
|
301
|
+
})
|
|
302
|
+
export class NumberFieldLocale {}
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
### What sits beside the number
|
|
306
|
+
|
|
307
|
+
start and end name the reading direction rather than a side, and neither is ever squeezed: the value gives up width first. Switch the toolbar to rtl and the mark stays before the amount.
|
|
308
|
+
|
|
309
|
+
Example
|
|
310
|
+
|
|
311
|
+
```ts
|
|
312
|
+
import { Component } from '@angular/core';
|
|
313
|
+
import { SlField, SlFieldLabel } from '@slotted/angular/field';
|
|
314
|
+
import {
|
|
315
|
+
SlNumberField,
|
|
316
|
+
SlNumberFieldEnd,
|
|
317
|
+
SlNumberFieldInput,
|
|
318
|
+
SlNumberFieldStart,
|
|
319
|
+
} from '@slotted/angular/number-field';
|
|
320
|
+
import { SlStack } from '@slotted/angular/stack';
|
|
321
|
+
|
|
322
|
+
@Component({
|
|
323
|
+
selector: 'app-number-field-adornments',
|
|
324
|
+
imports: [
|
|
325
|
+
SlField,
|
|
326
|
+
SlFieldLabel,
|
|
327
|
+
SlNumberField,
|
|
328
|
+
SlNumberFieldEnd,
|
|
329
|
+
SlNumberFieldInput,
|
|
330
|
+
SlNumberFieldStart,
|
|
331
|
+
SlStack,
|
|
332
|
+
],
|
|
333
|
+
template: `
|
|
334
|
+
<div slStack [gap]="4">
|
|
335
|
+
<div slField>
|
|
336
|
+
<label slFieldLabel>Purchase price</label>
|
|
337
|
+
<div slNumberField>
|
|
338
|
+
<span slNumberFieldStart>$</span>
|
|
339
|
+
<input
|
|
340
|
+
slNumberFieldInput
|
|
341
|
+
defaultValue="1480"
|
|
342
|
+
min="0"
|
|
343
|
+
[format]="{ minimumFractionDigits: 2 }"
|
|
344
|
+
/>
|
|
345
|
+
<span slNumberFieldEnd>USD</span>
|
|
346
|
+
</div>
|
|
347
|
+
</div>
|
|
348
|
+
<div slField>
|
|
349
|
+
<label slFieldLabel>Lead time</label>
|
|
350
|
+
<div slNumberField>
|
|
351
|
+
<input slNumberFieldInput defaultValue="14" min="0" max="120" />
|
|
352
|
+
<span slNumberFieldEnd>days</span>
|
|
353
|
+
</div>
|
|
354
|
+
</div>
|
|
355
|
+
</div>
|
|
356
|
+
`,
|
|
357
|
+
})
|
|
358
|
+
export class NumberFieldAdornments {}
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
### Drag the mark to move the number
|
|
362
|
+
|
|
363
|
+
The design tools’ gesture. Press the mark and drag sideways: two pixels per step, Shift for the large step, Alt for the small one. A right-to-left document steps up towards the left, the inline end.
|
|
364
|
+
|
|
365
|
+
Example
|
|
366
|
+
|
|
367
|
+
```ts
|
|
368
|
+
import { Component } from '@angular/core';
|
|
369
|
+
import { SlField, SlFieldLabel } from '@slotted/angular/field';
|
|
370
|
+
import { SlGrid } from '@slotted/angular/grid';
|
|
371
|
+
import {
|
|
372
|
+
SlNumberField,
|
|
373
|
+
SlNumberFieldEnd,
|
|
374
|
+
SlNumberFieldInput,
|
|
375
|
+
SlNumberFieldScrub,
|
|
376
|
+
SlNumberFieldStart,
|
|
377
|
+
} from '@slotted/angular/number-field';
|
|
378
|
+
|
|
379
|
+
@Component({
|
|
380
|
+
selector: 'app-number-field-scrub',
|
|
381
|
+
imports: [
|
|
382
|
+
SlField,
|
|
383
|
+
SlFieldLabel,
|
|
384
|
+
SlGrid,
|
|
385
|
+
SlNumberField,
|
|
386
|
+
SlNumberFieldEnd,
|
|
387
|
+
SlNumberFieldInput,
|
|
388
|
+
SlNumberFieldScrub,
|
|
389
|
+
SlNumberFieldStart,
|
|
390
|
+
],
|
|
391
|
+
template: `
|
|
392
|
+
<div slGrid [columns]="2" [gap]="4">
|
|
393
|
+
<div slField>
|
|
394
|
+
<label slFieldLabel>Label width</label>
|
|
395
|
+
<div slNumberField>
|
|
396
|
+
<span slNumberFieldStart><span slNumberFieldScrub>W</span></span>
|
|
397
|
+
<input slNumberFieldInput defaultValue="100" min="20" max="210" />
|
|
398
|
+
<span slNumberFieldEnd>mm</span>
|
|
399
|
+
</div>
|
|
400
|
+
</div>
|
|
401
|
+
<div slField>
|
|
402
|
+
<label slFieldLabel>Label height</label>
|
|
403
|
+
<div slNumberField>
|
|
404
|
+
<span slNumberFieldStart><span slNumberFieldScrub [sensitivity]="4">H</span></span>
|
|
405
|
+
<input slNumberFieldInput defaultValue="150" min="20" max="297" />
|
|
406
|
+
<span slNumberFieldEnd>mm</span>
|
|
407
|
+
</div>
|
|
408
|
+
</div>
|
|
409
|
+
</div>
|
|
410
|
+
`,
|
|
411
|
+
})
|
|
412
|
+
export class NumberFieldScrubExample {}
|
|
413
|
+
```
|
|
414
|
+
|
|
415
|
+
### The states the frame paints
|
|
416
|
+
|
|
417
|
+
Read-only keeps full-strength ink and softens its edge, because the value is real and still submitted; disabled is muted to a measured colour rather than faded, and both withdraw the steppers by disabling them rather than removing them.
|
|
418
|
+
|
|
419
|
+
Example
|
|
420
|
+
|
|
421
|
+
```ts
|
|
422
|
+
import { Component } from '@angular/core';
|
|
423
|
+
import { SlField, SlFieldDescription, SlFieldError, SlFieldLabel } from '@slotted/angular/field';
|
|
424
|
+
import { SlNumberField, SlNumberFieldInput } from '@slotted/angular/number-field';
|
|
425
|
+
import { SlStack } from '@slotted/angular/stack';
|
|
426
|
+
|
|
427
|
+
@Component({
|
|
428
|
+
selector: 'app-number-field-states',
|
|
429
|
+
imports: [
|
|
430
|
+
SlField,
|
|
431
|
+
SlFieldDescription,
|
|
432
|
+
SlFieldError,
|
|
433
|
+
SlFieldLabel,
|
|
434
|
+
SlNumberField,
|
|
435
|
+
SlNumberFieldInput,
|
|
436
|
+
SlStack,
|
|
437
|
+
],
|
|
438
|
+
template: `
|
|
439
|
+
<div slStack [gap]="5">
|
|
440
|
+
<div slField invalid>
|
|
441
|
+
<label slFieldLabel>Quantity to ship</label>
|
|
442
|
+
<div slNumberField><input slNumberFieldInput defaultValue="120" min="1" /></div>
|
|
443
|
+
<span slFieldError>Only 39 units of Chai are in stock.</span>
|
|
444
|
+
</div>
|
|
445
|
+
<div slField readOnly>
|
|
446
|
+
<label slFieldLabel>Units on order</label>
|
|
447
|
+
<div slNumberField><input slNumberFieldInput defaultValue="40" /></div>
|
|
448
|
+
<span slFieldDescription>Counted from open purchase orders.</span>
|
|
449
|
+
</div>
|
|
450
|
+
<div slField disabled>
|
|
451
|
+
<label slFieldLabel>Units reserved</label>
|
|
452
|
+
<div slNumberField><input slNumberFieldInput defaultValue="12" /></div>
|
|
453
|
+
<span slFieldDescription>Released when the order ships.</span>
|
|
454
|
+
</div>
|
|
455
|
+
</div>
|
|
456
|
+
`,
|
|
457
|
+
})
|
|
458
|
+
export class NumberFieldStates {}
|
|
459
|
+
```
|
|
460
|
+
|
|
461
|
+
### Numbers the family did not choose
|
|
462
|
+
|
|
463
|
+
A value longer than the control ellipsises rather than clipping mid-glyph; a negative keeps its sign in front of the digits in both directions; and at 240 pixels the value surrenders width while the steppers keep their target size.
|
|
464
|
+
|
|
465
|
+
Excerpt — not a complete module
|
|
466
|
+
|
|
467
|
+
```html
|
|
468
|
+
<div slNumberField>
|
|
469
|
+
<input slNumberFieldInput defaultValue="1480320559774.25" locale="pt-BR" />
|
|
470
|
+
</div>
|
|
471
|
+
|
|
472
|
+
<!-- The digits are tabular, so nothing shifts as they are typed over,
|
|
473
|
+
and the minus stays in front of the amount in an Arabic document. -->
|
|
474
|
+
<div slNumberField>
|
|
475
|
+
<span slNumberFieldStart>R$</span>
|
|
476
|
+
<input slNumberFieldInput defaultValue="-1480" locale="pt-BR" />
|
|
477
|
+
</div>
|
|
478
|
+
```
|
|
479
|
+
|
|
480
|
+
### Setting it once, reaching past it, and putting it in a form
|
|
481
|
+
|
|
482
|
+
ControlValueAccessor is the two-way binding the ecosystem expects; exportAs hands the template the directive, which carries increment(), decrement() and the native element; name submits the raw number through a hidden input.
|
|
483
|
+
|
|
484
|
+
Excerpt — not a complete module
|
|
485
|
+
|
|
486
|
+
```html
|
|
487
|
+
<div slNumberField>
|
|
488
|
+
<input slNumberFieldInput [formControl]="quantity" min="1" max="99" />
|
|
489
|
+
</div>
|
|
490
|
+
|
|
491
|
+
<div slNumberField>
|
|
492
|
+
<input slNumberFieldInput #campo="slNumberFieldInput" defaultValue="3" />
|
|
493
|
+
</div>
|
|
494
|
+
<button type="button" (click)="campo.increment()">Mais um</button>
|
|
495
|
+
|
|
496
|
+
<!-- The hidden input carries 1480, never "R$ 1.480,00". -->
|
|
497
|
+
<div slNumberField>
|
|
498
|
+
<input
|
|
499
|
+
slNumberFieldInput
|
|
500
|
+
name="amount"
|
|
501
|
+
defaultValue="1480"
|
|
502
|
+
[format]="{ style: 'currency', currency: 'BRL' }"
|
|
503
|
+
/>
|
|
504
|
+
</div>
|
|
505
|
+
```
|
|
506
|
+
|
|
507
|
+
### What the keyboard does, and what it deliberately does not
|
|
508
|
+
|
|
509
|
+
Arrows step, Shift and the page keys move by the large amount, Alt by the small one, Home and End reach the bounds. Tab never lands on a stepper: twenty amounts in a form would be forty extra stops.
|
|
510
|
+
|
|
511
|
+
Example
|
|
512
|
+
|
|
513
|
+
```ts
|
|
514
|
+
import { Component } from '@angular/core';
|
|
515
|
+
import { SlField, SlFieldDescription, SlFieldLabel } from '@slotted/angular/field';
|
|
516
|
+
import { SlNumberField, SlNumberFieldInput } from '@slotted/angular/number-field';
|
|
517
|
+
import { SlStack } from '@slotted/angular/stack';
|
|
518
|
+
|
|
519
|
+
@Component({
|
|
520
|
+
selector: 'app-number-field-keyboard',
|
|
521
|
+
imports: [SlField, SlFieldDescription, SlFieldLabel, SlNumberField, SlNumberFieldInput, SlStack],
|
|
522
|
+
template: `
|
|
523
|
+
<div slStack [gap]="5">
|
|
524
|
+
<div slField>
|
|
525
|
+
<label slFieldLabel>Shipping weight</label>
|
|
526
|
+
<div slNumberField>
|
|
527
|
+
<input
|
|
528
|
+
slNumberFieldInput
|
|
529
|
+
defaultValue="12.5"
|
|
530
|
+
min="0"
|
|
531
|
+
step="1"
|
|
532
|
+
largeStep="10"
|
|
533
|
+
smallStep="0.1"
|
|
534
|
+
[format]="{ maximumFractionDigits: 1, style: 'unit', unit: 'kilogram' }"
|
|
535
|
+
/>
|
|
536
|
+
</div>
|
|
537
|
+
<span slFieldDescription>Arrows: 1 kg. Shift or Page keys: 10 kg. Alt: 0.1 kg.</span>
|
|
538
|
+
</div>
|
|
539
|
+
<div slField>
|
|
540
|
+
<label slFieldLabel>Safety stock</label>
|
|
541
|
+
<div slNumberField>
|
|
542
|
+
<input slNumberFieldInput defaultValue="15" min="0" wheel />
|
|
543
|
+
</div>
|
|
544
|
+
<span slFieldDescription>With the field focused, the mouse wheel steps the value.</span>
|
|
545
|
+
</div>
|
|
546
|
+
</div>
|
|
547
|
+
`,
|
|
548
|
+
})
|
|
549
|
+
export class NumberFieldKeyboard {}
|
|
550
|
+
```
|
|
551
|
+
|
|
552
|
+
### clamp.ts
|
|
553
|
+
|
|
554
|
+
Example
|
|
555
|
+
|
|
556
|
+
```ts
|
|
557
|
+
import { Component } from '@angular/core';
|
|
558
|
+
import { SlField, SlFieldDescription, SlFieldLabel } from '@slotted/angular/field';
|
|
559
|
+
import { SlNumberField, SlNumberFieldEnd, SlNumberFieldInput } from '@slotted/angular/number-field';
|
|
560
|
+
import { SlStack } from '@slotted/angular/stack';
|
|
561
|
+
|
|
562
|
+
@Component({
|
|
563
|
+
selector: 'app-number-field-clamp',
|
|
564
|
+
imports: [
|
|
565
|
+
SlField,
|
|
566
|
+
SlFieldDescription,
|
|
567
|
+
SlFieldLabel,
|
|
568
|
+
SlNumberField,
|
|
569
|
+
SlNumberFieldEnd,
|
|
570
|
+
SlNumberFieldInput,
|
|
571
|
+
SlStack,
|
|
572
|
+
],
|
|
573
|
+
template: `
|
|
574
|
+
<div slStack [gap]="5">
|
|
575
|
+
<div slField>
|
|
576
|
+
<label slFieldLabel>Line discount</label>
|
|
577
|
+
<div slNumberField>
|
|
578
|
+
<input slNumberFieldInput clamp="blur" defaultValue="10" min="0" max="25" />
|
|
579
|
+
<span slNumberFieldEnd>%</span>
|
|
580
|
+
</div>
|
|
581
|
+
<span slFieldDescription>Type 40 and leave the field: it returns to 25.</span>
|
|
582
|
+
</div>
|
|
583
|
+
<div slField>
|
|
584
|
+
<label slFieldLabel>Order discount</label>
|
|
585
|
+
<div slNumberField>
|
|
586
|
+
<input slNumberFieldInput clamp="strict" defaultValue="10" min="0" max="25" />
|
|
587
|
+
<span slNumberFieldEnd>%</span>
|
|
588
|
+
</div>
|
|
589
|
+
<span slFieldDescription>A keystroke that would pass 25 is refused.</span>
|
|
590
|
+
</div>
|
|
591
|
+
<div slField>
|
|
592
|
+
<label slFieldLabel>Contract discount</label>
|
|
593
|
+
<div slNumberField>
|
|
594
|
+
<input slNumberFieldInput clamp="none" defaultValue="10" min="0" max="25" />
|
|
595
|
+
<span slNumberFieldEnd>%</span>
|
|
596
|
+
</div>
|
|
597
|
+
<span slFieldDescription>40 stays, and the field is marked invalid.</span>
|
|
598
|
+
</div>
|
|
599
|
+
</div>
|
|
600
|
+
`,
|
|
601
|
+
})
|
|
602
|
+
export class NumberFieldClamp {}
|
|
603
|
+
```
|
|
604
|
+
|
|
605
|
+
### controlled.ts
|
|
606
|
+
|
|
607
|
+
Example
|
|
608
|
+
|
|
609
|
+
```ts
|
|
610
|
+
import { Component, computed, signal } from '@angular/core';
|
|
611
|
+
import { SlButton } from '@slotted/angular/button';
|
|
612
|
+
import { SlField, SlFieldLabel } from '@slotted/angular/field';
|
|
613
|
+
import { SlInline } from '@slotted/angular/inline';
|
|
614
|
+
import { SlNumberField, SlNumberFieldInput } from '@slotted/angular/number-field';
|
|
615
|
+
import { SlStack } from '@slotted/angular/stack';
|
|
616
|
+
|
|
617
|
+
const USD = new Intl.NumberFormat('en-US', { currency: 'USD', style: 'currency' });
|
|
618
|
+
|
|
619
|
+
@Component({
|
|
620
|
+
selector: 'app-number-field-controlled',
|
|
621
|
+
imports: [SlButton, SlField, SlFieldLabel, SlInline, SlNumberField, SlNumberFieldInput, SlStack],
|
|
622
|
+
template: `
|
|
623
|
+
<div slStack [gap]="4">
|
|
624
|
+
<div slField>
|
|
625
|
+
<label slFieldLabel>Credit limit for Ernst Handel</label>
|
|
626
|
+
<div slNumberField>
|
|
627
|
+
<input
|
|
628
|
+
slNumberFieldInput
|
|
629
|
+
min="0"
|
|
630
|
+
step="500"
|
|
631
|
+
stepFrom="5000"
|
|
632
|
+
[format]="{ currency: 'USD', style: 'currency' }"
|
|
633
|
+
[value]="limit()"
|
|
634
|
+
(valueChange)="limit.set($event.value)"
|
|
635
|
+
/>
|
|
636
|
+
</div>
|
|
637
|
+
</div>
|
|
638
|
+
<div slInline [gap]="3" justify="between">
|
|
639
|
+
<span>{{ summary() }}</span>
|
|
640
|
+
<button slButton variant="outline" [disabled]="limit() === null" (click)="limit.set(null)">
|
|
641
|
+
Remove limit
|
|
642
|
+
</button>
|
|
643
|
+
</div>
|
|
644
|
+
</div>
|
|
645
|
+
`,
|
|
646
|
+
})
|
|
647
|
+
export class NumberFieldControlled {
|
|
648
|
+
readonly limit = signal<number | null>(5000);
|
|
649
|
+
readonly summary = computed(() => {
|
|
650
|
+
const limit = this.limit();
|
|
651
|
+
return limit === null ? 'No credit limit' : `Orders up to ${USD.format(limit)}`;
|
|
652
|
+
});
|
|
653
|
+
}
|
|
654
|
+
```
|
|
655
|
+
|
|
656
|
+
### decimals.ts
|
|
657
|
+
|
|
658
|
+
Example
|
|
659
|
+
|
|
660
|
+
```ts
|
|
661
|
+
import { Component } from '@angular/core';
|
|
662
|
+
import { SlField, SlFieldDescription, SlFieldLabel } from '@slotted/angular/field';
|
|
663
|
+
import { SlNumberField, SlNumberFieldInput } from '@slotted/angular/number-field';
|
|
664
|
+
import { SlStack } from '@slotted/angular/stack';
|
|
665
|
+
|
|
666
|
+
@Component({
|
|
667
|
+
selector: 'app-number-field-decimals',
|
|
668
|
+
imports: [SlField, SlFieldDescription, SlFieldLabel, SlNumberField, SlNumberFieldInput, SlStack],
|
|
669
|
+
template: `
|
|
670
|
+
<div slStack [gap]="5">
|
|
671
|
+
<div slField>
|
|
672
|
+
<label slFieldLabel>Exchange rate, EUR to USD</label>
|
|
673
|
+
<div slNumberField>
|
|
674
|
+
<input
|
|
675
|
+
slNumberFieldInput
|
|
676
|
+
defaultValue="1.0842"
|
|
677
|
+
min="0"
|
|
678
|
+
step="0.0001"
|
|
679
|
+
[format]="{ maximumFractionDigits: 4, minimumFractionDigits: 4 }"
|
|
680
|
+
/>
|
|
681
|
+
</div>
|
|
682
|
+
<span slFieldDescription>Four decimals: 1.1 becomes 1.1000 on blur.</span>
|
|
683
|
+
</div>
|
|
684
|
+
<div slField>
|
|
685
|
+
<label slFieldLabel>Cartons</label>
|
|
686
|
+
<div slNumberField>
|
|
687
|
+
<input
|
|
688
|
+
slNumberFieldInput
|
|
689
|
+
defaultValue="40"
|
|
690
|
+
min="0"
|
|
691
|
+
[format]="{ maximumFractionDigits: 0 }"
|
|
692
|
+
/>
|
|
693
|
+
</div>
|
|
694
|
+
<span slFieldDescription>Whole cartons: the decimal separator is refused.</span>
|
|
695
|
+
</div>
|
|
696
|
+
</div>
|
|
697
|
+
`,
|
|
698
|
+
})
|
|
699
|
+
export class NumberFieldDecimals {}
|
|
700
|
+
```
|
|
701
|
+
|
|
702
|
+
### defaults.ts
|
|
703
|
+
|
|
704
|
+
Example
|
|
705
|
+
|
|
706
|
+
```ts
|
|
707
|
+
import { Component } from '@angular/core';
|
|
708
|
+
import { SlField, SlFieldLabel } from '@slotted/angular/field';
|
|
709
|
+
import { SlGrid } from '@slotted/angular/grid';
|
|
710
|
+
import {
|
|
711
|
+
provideNumberFieldDefaults,
|
|
712
|
+
SlNumberField,
|
|
713
|
+
SlNumberFieldInput,
|
|
714
|
+
} from '@slotted/angular/number-field';
|
|
715
|
+
|
|
716
|
+
@Component({
|
|
717
|
+
selector: 'app-number-field-defaults',
|
|
718
|
+
imports: [SlField, SlFieldLabel, SlGrid, SlNumberField, SlNumberFieldInput],
|
|
719
|
+
providers: [provideNumberFieldDefaults({ size: 'sm', stepper: 'split', variant: 'subtle' })],
|
|
720
|
+
template: `
|
|
721
|
+
<div slGrid [gap]="3" minItemWidth="xs">
|
|
722
|
+
<div slField>
|
|
723
|
+
<label slFieldLabel>Cases</label>
|
|
724
|
+
<div slNumberField><input slNumberFieldInput defaultValue="6" min="0" /></div>
|
|
725
|
+
</div>
|
|
726
|
+
<div slField>
|
|
727
|
+
<label slFieldLabel>Loose units</label>
|
|
728
|
+
<div slNumberField><input slNumberFieldInput defaultValue="11" min="0" /></div>
|
|
729
|
+
</div>
|
|
730
|
+
<div slField>
|
|
731
|
+
<label slFieldLabel>Pallets</label>
|
|
732
|
+
<div slNumberField stepper="stacked">
|
|
733
|
+
<input slNumberFieldInput defaultValue="1" min="0" />
|
|
734
|
+
</div>
|
|
735
|
+
</div>
|
|
736
|
+
</div>
|
|
737
|
+
`,
|
|
738
|
+
})
|
|
739
|
+
export class NumberFieldDefaults {}
|
|
740
|
+
```
|
|
741
|
+
|
|
742
|
+
### format-on.ts
|
|
743
|
+
|
|
744
|
+
Example
|
|
745
|
+
|
|
746
|
+
```ts
|
|
747
|
+
import { Component } from '@angular/core';
|
|
748
|
+
import { SlField, SlFieldDescription, SlFieldLabel } from '@slotted/angular/field';
|
|
749
|
+
import { SlNumberField, SlNumberFieldInput } from '@slotted/angular/number-field';
|
|
750
|
+
import { SlStack } from '@slotted/angular/stack';
|
|
751
|
+
|
|
752
|
+
@Component({
|
|
753
|
+
selector: 'app-number-field-format-on',
|
|
754
|
+
imports: [SlField, SlFieldDescription, SlFieldLabel, SlNumberField, SlNumberFieldInput, SlStack],
|
|
755
|
+
template: `
|
|
756
|
+
<div slStack [gap]="5">
|
|
757
|
+
<div slField>
|
|
758
|
+
<label slFieldLabel>Annual purchase budget</label>
|
|
759
|
+
<div slNumberField>
|
|
760
|
+
<input
|
|
761
|
+
slNumberFieldInput
|
|
762
|
+
formatOn="change"
|
|
763
|
+
min="0"
|
|
764
|
+
[format]="{ currency: 'USD', style: 'currency' }"
|
|
765
|
+
/>
|
|
766
|
+
</div>
|
|
767
|
+
<span slFieldDescription>Type 1250000: the grouping appears with each digit.</span>
|
|
768
|
+
</div>
|
|
769
|
+
<div slField>
|
|
770
|
+
<label slFieldLabel>Amount from bank statement</label>
|
|
771
|
+
<div slNumberField>
|
|
772
|
+
<input
|
|
773
|
+
slNumberFieldInput
|
|
774
|
+
formatOn="commit"
|
|
775
|
+
min="0"
|
|
776
|
+
[format]="{ currency: 'USD', style: 'currency' }"
|
|
777
|
+
/>
|
|
778
|
+
</div>
|
|
779
|
+
<span slFieldDescription>Your text stays as typed until Enter or blur.</span>
|
|
780
|
+
</div>
|
|
781
|
+
</div>
|
|
782
|
+
`,
|
|
783
|
+
})
|
|
784
|
+
export class NumberFieldFormatOn {}
|
|
785
|
+
```
|
|
786
|
+
|
|
787
|
+
### handle.ts
|
|
788
|
+
|
|
789
|
+
Example
|
|
790
|
+
|
|
791
|
+
```ts
|
|
792
|
+
import { Component } from '@angular/core';
|
|
793
|
+
import { SlButton } from '@slotted/angular/button';
|
|
794
|
+
import { SlField, SlFieldLabel } from '@slotted/angular/field';
|
|
795
|
+
import { SlInline } from '@slotted/angular/inline';
|
|
796
|
+
import { SlNumberField, SlNumberFieldInput } from '@slotted/angular/number-field';
|
|
797
|
+
import { SlStack } from '@slotted/angular/stack';
|
|
798
|
+
|
|
799
|
+
@Component({
|
|
800
|
+
selector: 'app-number-field-handle',
|
|
801
|
+
imports: [SlButton, SlField, SlFieldLabel, SlInline, SlNumberField, SlNumberFieldInput, SlStack],
|
|
802
|
+
template: `
|
|
803
|
+
<div slStack [gap]="3">
|
|
804
|
+
<div slField>
|
|
805
|
+
<label slFieldLabel>Cases of Chang</label>
|
|
806
|
+
<div slNumberField>
|
|
807
|
+
<input slNumberFieldInput #cases="slNumberFieldInput" defaultValue="4" min="0" max="48" />
|
|
808
|
+
</div>
|
|
809
|
+
</div>
|
|
810
|
+
<div slInline [gap]="2">
|
|
811
|
+
<button slButton variant="outline" (click)="cases.decrement()">Remove a case</button>
|
|
812
|
+
<button slButton variant="outline" (click)="cases.increment()">Add a case</button>
|
|
813
|
+
</div>
|
|
814
|
+
</div>
|
|
815
|
+
`,
|
|
816
|
+
})
|
|
817
|
+
export class NumberFieldHandleExample {}
|
|
818
|
+
```
|
|
819
|
+
|
|
820
|
+
### order-line.ts
|
|
821
|
+
|
|
822
|
+
Example
|
|
823
|
+
|
|
824
|
+
```ts
|
|
825
|
+
import { Component, computed, signal } from '@angular/core';
|
|
826
|
+
import { SlGrid } from '@slotted/angular/grid';
|
|
827
|
+
import { SlInline } from '@slotted/angular/inline';
|
|
828
|
+
import { SlNumberField, SlNumberFieldInput } from '@slotted/angular/number-field';
|
|
829
|
+
import { SlStack } from '@slotted/angular/stack';
|
|
830
|
+
import { SlText } from '@slotted/angular/typography';
|
|
831
|
+
|
|
832
|
+
const USD = new Intl.NumberFormat('en-US', { currency: 'USD', style: 'currency' });
|
|
833
|
+
|
|
834
|
+
const LINES = [
|
|
835
|
+
{ id: 'cabrales', product: 'Queso Cabrales', price: 14, stock: 22 },
|
|
836
|
+
{ id: 'hokkien', product: 'Singaporean Hokkien Fried Mee', price: 9.8, stock: 26 },
|
|
837
|
+
{ id: 'mozzarella', product: 'Mozzarella di Giovanni', price: 34.8, stock: 14 },
|
|
838
|
+
];
|
|
839
|
+
|
|
840
|
+
@Component({
|
|
841
|
+
selector: 'app-number-field-order-line',
|
|
842
|
+
imports: [SlGrid, SlInline, SlNumberField, SlNumberFieldInput, SlStack, SlText],
|
|
843
|
+
template: `
|
|
844
|
+
<div slStack [gap]="5">
|
|
845
|
+
<div slStack [gap]="4">
|
|
846
|
+
@for (line of lines; track line.id) {
|
|
847
|
+
<div slGrid [columns]="3" [gap]="4" minItemWidth="xs">
|
|
848
|
+
<div slStack [gap]="1">
|
|
849
|
+
<span slText weight="medium">{{ line.product }}</span>
|
|
850
|
+
<span slText size="sm" tone="muted"
|
|
851
|
+
>{{ usd(line.price) }} each · {{ line.stock }} in stock</span
|
|
852
|
+
>
|
|
853
|
+
</div>
|
|
854
|
+
<div slStack justify="center">
|
|
855
|
+
<div slNumberField size="sm" stepper="split">
|
|
856
|
+
<input
|
|
857
|
+
slNumberFieldInput
|
|
858
|
+
min="0"
|
|
859
|
+
[attr.aria-label]="'Quantity of ' + line.product"
|
|
860
|
+
[max]="line.stock"
|
|
861
|
+
[value]="quantities()[line.id] ?? null"
|
|
862
|
+
(valueChange)="set(line.id, $event.value)"
|
|
863
|
+
/>
|
|
864
|
+
</div>
|
|
865
|
+
</div>
|
|
866
|
+
<div slStack justify="center">
|
|
867
|
+
<span slText align="end" numeric="tabular">{{
|
|
868
|
+
usd(line.price * (quantities()[line.id] ?? 0))
|
|
869
|
+
}}</span>
|
|
870
|
+
</div>
|
|
871
|
+
</div>
|
|
872
|
+
}
|
|
873
|
+
</div>
|
|
874
|
+
<div slInline [gap]="4" justify="between">
|
|
875
|
+
<span slText weight="semibold">Order total</span>
|
|
876
|
+
<span slText numeric="tabular" weight="semibold">{{ usd(total()) }}</span>
|
|
877
|
+
</div>
|
|
878
|
+
</div>
|
|
879
|
+
`,
|
|
880
|
+
})
|
|
881
|
+
export class NumberFieldOrderLine {
|
|
882
|
+
readonly lines = LINES;
|
|
883
|
+
readonly quantities = signal<Record<string, number | null>>({
|
|
884
|
+
cabrales: 12,
|
|
885
|
+
hokkien: 10,
|
|
886
|
+
mozzarella: 5,
|
|
887
|
+
});
|
|
888
|
+
readonly total = computed(() =>
|
|
889
|
+
LINES.reduce((sum, line) => sum + line.price * (this.quantities()[line.id] ?? 0), 0),
|
|
890
|
+
);
|
|
891
|
+
|
|
892
|
+
usd(amount: number): string {
|
|
893
|
+
return USD.format(amount);
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
set(id: string, value: number | null): void {
|
|
897
|
+
this.quantities.update((current) => ({ ...current, [id]: value }));
|
|
898
|
+
}
|
|
899
|
+
}
|
|
900
|
+
```
|
|
901
|
+
|
|
902
|
+
### price-editor.ts
|
|
903
|
+
|
|
904
|
+
Example
|
|
905
|
+
|
|
906
|
+
```ts
|
|
907
|
+
import { Component, computed, signal } from '@angular/core';
|
|
908
|
+
import { SlField, SlFieldDescription, SlFieldLabel } from '@slotted/angular/field';
|
|
909
|
+
import { SlGrid } from '@slotted/angular/grid';
|
|
910
|
+
import { SlNumberField, SlNumberFieldInput } from '@slotted/angular/number-field';
|
|
911
|
+
|
|
912
|
+
@Component({
|
|
913
|
+
selector: 'app-number-field-price-editor',
|
|
914
|
+
imports: [SlField, SlFieldDescription, SlFieldLabel, SlGrid, SlNumberField, SlNumberFieldInput],
|
|
915
|
+
template: `
|
|
916
|
+
<div slGrid [gap]="4" minItemWidth="xs">
|
|
917
|
+
<div slField required>
|
|
918
|
+
<label slFieldLabel>Unit cost</label>
|
|
919
|
+
<div slNumberField>
|
|
920
|
+
<input
|
|
921
|
+
slNumberFieldInput
|
|
922
|
+
min="0"
|
|
923
|
+
step="0.5"
|
|
924
|
+
[format]="currency"
|
|
925
|
+
[value]="cost()"
|
|
926
|
+
(valueChange)="cost.set($event.value)"
|
|
927
|
+
/>
|
|
928
|
+
</div>
|
|
929
|
+
</div>
|
|
930
|
+
<div slField required>
|
|
931
|
+
<label slFieldLabel>Markup</label>
|
|
932
|
+
<div slNumberField>
|
|
933
|
+
<input
|
|
934
|
+
slNumberFieldInput
|
|
935
|
+
min="0"
|
|
936
|
+
max="3"
|
|
937
|
+
step="0.01"
|
|
938
|
+
largeStep="0.1"
|
|
939
|
+
[format]="{ style: 'percent' }"
|
|
940
|
+
[value]="markup()"
|
|
941
|
+
(valueChange)="markup.set($event.value)"
|
|
942
|
+
/>
|
|
943
|
+
</div>
|
|
944
|
+
</div>
|
|
945
|
+
<div slField readOnly>
|
|
946
|
+
<label slFieldLabel>List price</label>
|
|
947
|
+
<div slNumberField stepper="none">
|
|
948
|
+
<input slNumberFieldInput [format]="currency" [value]="price()" />
|
|
949
|
+
</div>
|
|
950
|
+
<span slFieldDescription>Unit cost plus markup.</span>
|
|
951
|
+
</div>
|
|
952
|
+
</div>
|
|
953
|
+
`,
|
|
954
|
+
})
|
|
955
|
+
export class NumberFieldPriceEditor {
|
|
956
|
+
readonly currency: Intl.NumberFormatOptions = { currency: 'USD', style: 'currency' };
|
|
957
|
+
readonly cost = signal<number | null>(175);
|
|
958
|
+
readonly markup = signal<number | null>(0.5);
|
|
959
|
+
readonly price = computed(() => {
|
|
960
|
+
const cost = this.cost();
|
|
961
|
+
const markup = this.markup();
|
|
962
|
+
return cost === null || markup === null ? null : Math.round(cost * (1 + markup) * 100) / 100;
|
|
963
|
+
});
|
|
964
|
+
}
|
|
965
|
+
```
|
|
966
|
+
|
|
967
|
+
### steppers.ts
|
|
968
|
+
|
|
969
|
+
Example
|
|
970
|
+
|
|
971
|
+
```ts
|
|
972
|
+
import { Component } from '@angular/core';
|
|
973
|
+
import { SlField, SlFieldLabel } from '@slotted/angular/field';
|
|
974
|
+
import { SlNumberField, SlNumberFieldInput } from '@slotted/angular/number-field';
|
|
975
|
+
import { SlStack } from '@slotted/angular/stack';
|
|
976
|
+
|
|
977
|
+
@Component({
|
|
978
|
+
selector: 'app-number-field-steppers',
|
|
979
|
+
imports: [SlField, SlFieldLabel, SlNumberField, SlNumberFieldInput, SlStack],
|
|
980
|
+
template: `
|
|
981
|
+
<div slStack [gap]="4">
|
|
982
|
+
<div slField>
|
|
983
|
+
<label slFieldLabel>Reorder quantity</label>
|
|
984
|
+
<div slNumberField stepper="stacked">
|
|
985
|
+
<input slNumberFieldInput defaultValue="40" min="0" step="10" />
|
|
986
|
+
</div>
|
|
987
|
+
</div>
|
|
988
|
+
<div slField>
|
|
989
|
+
<label slFieldLabel>Quantity</label>
|
|
990
|
+
<div slNumberField stepper="split">
|
|
991
|
+
<input slNumberFieldInput defaultValue="3" min="1" max="99" />
|
|
992
|
+
</div>
|
|
993
|
+
</div>
|
|
994
|
+
<div slField>
|
|
995
|
+
<label slFieldLabel>Units in stock</label>
|
|
996
|
+
<div slNumberField stepper="none">
|
|
997
|
+
<input slNumberFieldInput defaultValue="39" min="0" />
|
|
998
|
+
</div>
|
|
999
|
+
</div>
|
|
1000
|
+
</div>
|
|
1001
|
+
`,
|
|
1002
|
+
})
|
|
1003
|
+
export class NumberFieldSteppers {}
|
|
1004
|
+
```
|
|
1005
|
+
|
|
1006
|
+
### validation.ts
|
|
1007
|
+
|
|
1008
|
+
Example
|
|
1009
|
+
|
|
1010
|
+
```ts
|
|
1011
|
+
import { Component, computed, signal } from '@angular/core';
|
|
1012
|
+
import { toSignal } from '@angular/core/rxjs-interop';
|
|
1013
|
+
import { FormControl, ReactiveFormsModule, Validators } from '@angular/forms';
|
|
1014
|
+
import { SlButton } from '@slotted/angular/button';
|
|
1015
|
+
import { SlField, SlFieldDescription, SlFieldError, SlFieldLabel } from '@slotted/angular/field';
|
|
1016
|
+
import { SlInline } from '@slotted/angular/inline';
|
|
1017
|
+
import { SlNumberField, SlNumberFieldInput } from '@slotted/angular/number-field';
|
|
1018
|
+
import { SlStack } from '@slotted/angular/stack';
|
|
1019
|
+
|
|
1020
|
+
@Component({
|
|
1021
|
+
selector: 'app-number-field-validation',
|
|
1022
|
+
imports: [
|
|
1023
|
+
ReactiveFormsModule,
|
|
1024
|
+
SlButton,
|
|
1025
|
+
SlField,
|
|
1026
|
+
SlFieldDescription,
|
|
1027
|
+
SlFieldError,
|
|
1028
|
+
SlFieldLabel,
|
|
1029
|
+
SlInline,
|
|
1030
|
+
SlNumberField,
|
|
1031
|
+
SlNumberFieldInput,
|
|
1032
|
+
SlStack,
|
|
1033
|
+
],
|
|
1034
|
+
template: `
|
|
1035
|
+
<form novalidate (submit)="submit($event)">
|
|
1036
|
+
<div slStack [gap]="4">
|
|
1037
|
+
<div slField required [invalid]="error() !== '' ? true : undefined">
|
|
1038
|
+
<label slFieldLabel>Units of Chai to ship</label>
|
|
1039
|
+
<div slNumberField>
|
|
1040
|
+
<input
|
|
1041
|
+
slNumberFieldInput
|
|
1042
|
+
name="quantity"
|
|
1043
|
+
min="1"
|
|
1044
|
+
max="39"
|
|
1045
|
+
[formControl]="quantity"
|
|
1046
|
+
(valueChange)="sent.set('')"
|
|
1047
|
+
/>
|
|
1048
|
+
</div>
|
|
1049
|
+
<span slFieldDescription>39 units in stock.</span>
|
|
1050
|
+
<span slFieldError live="polite" reserve>{{ error() }}</span>
|
|
1051
|
+
</div>
|
|
1052
|
+
<div slInline [gap]="3">
|
|
1053
|
+
<button slButton type="submit">Create shipment</button>
|
|
1054
|
+
@if (sent() !== '') {
|
|
1055
|
+
<span role="status">{{ sent() }}</span>
|
|
1056
|
+
}
|
|
1057
|
+
</div>
|
|
1058
|
+
</div>
|
|
1059
|
+
</form>
|
|
1060
|
+
`,
|
|
1061
|
+
})
|
|
1062
|
+
export class NumberFieldValidation {
|
|
1063
|
+
readonly quantity = new FormControl<number | null>(null, Validators.required);
|
|
1064
|
+
readonly value = toSignal(this.quantity.valueChanges, { initialValue: this.quantity.value });
|
|
1065
|
+
readonly submitted = signal(false);
|
|
1066
|
+
readonly sent = signal('');
|
|
1067
|
+
readonly error = computed(() =>
|
|
1068
|
+
this.submitted() && this.value() === null ? 'Enter how many units to ship.' : '',
|
|
1069
|
+
);
|
|
1070
|
+
|
|
1071
|
+
submit(event: Event): void {
|
|
1072
|
+
event.preventDefault();
|
|
1073
|
+
this.submitted.set(true);
|
|
1074
|
+
const data = new FormData(event.target as HTMLFormElement);
|
|
1075
|
+
this.sent.set(this.quantity.valid ? `Sent quantity=${String(data.get('quantity'))}` : '');
|
|
1076
|
+
}
|
|
1077
|
+
}
|
|
1078
|
+
```
|