@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,980 @@
|
|
|
1
|
+
import { injectMessages } from '@slotted/angular/i18n';
|
|
2
|
+
import { createDismissableLayer } from '@slotted/core/dismissable-layer';
|
|
3
|
+
import { createFocusScope } from '@slotted/core/focus';
|
|
4
|
+
import { dialogMessages } from '@slotted/core/i18n';
|
|
5
|
+
import { createPortalRoot } from '@slotted/core/portal';
|
|
6
|
+
import { createPresence } from '@slotted/core/presence';
|
|
7
|
+
import { createControllable } from '@slotted/core/state';
|
|
8
|
+
import * as i0 from '@angular/core';
|
|
9
|
+
import { InjectionToken, inject, Injectable, model, input, booleanAttribute, output, ElementRef, DestroyRef, HostAttributeToken, viewChild, signal, ChangeDetectorRef, computed, effect, Directive, forwardRef, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
10
|
+
import { SlGlyph, SlIcon } from '@slotted/angular/icon';
|
|
11
|
+
|
|
12
|
+
const FALLBACK = {
|
|
13
|
+
back: 'close',
|
|
14
|
+
escape: 'close',
|
|
15
|
+
fullScreen: 'narrow',
|
|
16
|
+
modal: true,
|
|
17
|
+
mount: 'active',
|
|
18
|
+
outsidePress: 'close',
|
|
19
|
+
placement: 'center',
|
|
20
|
+
scroll: 'content',
|
|
21
|
+
size: 'md',
|
|
22
|
+
surface: 'panel',
|
|
23
|
+
};
|
|
24
|
+
const DIALOG_DEFAULTS = new InjectionToken('slotted dialog defaults', {
|
|
25
|
+
providedIn: 'root',
|
|
26
|
+
factory: () => FALLBACK,
|
|
27
|
+
});
|
|
28
|
+
/**
|
|
29
|
+
* An application decides once how its dialogs behave and look, rather than
|
|
30
|
+
* repeating the same eight inputs on every one in a product. Angular Material
|
|
31
|
+
* is the only surveyed implementation with an equivalent —
|
|
32
|
+
* `MAT_DIALOG_DEFAULT_OPTIONS` — and React gets one here too rather than being
|
|
33
|
+
* levelled down to the smaller shape.
|
|
34
|
+
*/
|
|
35
|
+
function provideDialogDefaults(defaults) {
|
|
36
|
+
return {
|
|
37
|
+
provide: DIALOG_DEFAULTS,
|
|
38
|
+
useFactory: () => ({ ...FALLBACK, ...defaults }),
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
/** What a dialog renders as here, before it states anything of its own. */
|
|
42
|
+
function injectDialogDefaults() {
|
|
43
|
+
return inject(DIALOG_DEFAULTS);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Application-scoped rather than module-scoped, for the reason `field` records:
|
|
47
|
+
* a module-level counter produces colliding sequences when two applications
|
|
48
|
+
* render in one server process, and the server and the client sequences must
|
|
49
|
+
* match for hydration.
|
|
50
|
+
*/
|
|
51
|
+
class SlDialogIdFactory {
|
|
52
|
+
count = 0;
|
|
53
|
+
next() {
|
|
54
|
+
this.count += 1;
|
|
55
|
+
return `slotted-dialog-${this.count}`;
|
|
56
|
+
}
|
|
57
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlDialogIdFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
58
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlDialogIdFactory, providedIn: 'root' });
|
|
59
|
+
}
|
|
60
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlDialogIdFactory, decorators: [{
|
|
61
|
+
type: Injectable,
|
|
62
|
+
args: [{ providedIn: 'root' }]
|
|
63
|
+
}] });
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* A window over the page, and the scrim that says the page is out of reach.
|
|
67
|
+
*
|
|
68
|
+
* The layer is composed from `packages/core` and rewritten nowhere: `portal`
|
|
69
|
+
* decides where it lives and keeps the theme of the region that opened it,
|
|
70
|
+
* `dismissable-layer` owns Escape, outside press, `inert`, the scroll lock and
|
|
71
|
+
* the single z-index stack, `presence` keeps it mounted long enough to leave,
|
|
72
|
+
* and `focus` contains the keyboard and gives it back to the trigger.
|
|
73
|
+
*
|
|
74
|
+
* **The host is not the layer.** `<sl-dialog>` renders `display: contents` and
|
|
75
|
+
* stays exactly where the consumer wrote it; the layer is the `div` in the
|
|
76
|
+
* template, and it is that `div` which is moved into the portal. Two things
|
|
77
|
+
* follow, and both are better than the alternative: `mount="active"` can remove
|
|
78
|
+
* the layer outright, as React's does, and the host is the portal's *origin* —
|
|
79
|
+
* so the layer inherits the scheme, density, theme and direction of the region
|
|
80
|
+
* the consumer wrote it in, whether a trigger exists or not. React has to use
|
|
81
|
+
* the trigger for that, and the design document records the asymmetry.
|
|
82
|
+
*/
|
|
83
|
+
class SlDialogBase {
|
|
84
|
+
/** Whether the layer is open. Two-way, so a template may bind it directly. */
|
|
85
|
+
open = model(false, /* @ts-ignore */
|
|
86
|
+
...(ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []));
|
|
87
|
+
size = input(undefined, /* @ts-ignore */
|
|
88
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
89
|
+
placement = input(undefined, /* @ts-ignore */
|
|
90
|
+
...(ngDevMode ? [{ debugName: "placement" }] : /* istanbul ignore next */ []));
|
|
91
|
+
scroll = input(undefined, /* @ts-ignore */
|
|
92
|
+
...(ngDevMode ? [{ debugName: "scroll" }] : /* istanbul ignore next */ []));
|
|
93
|
+
surface = input(undefined, /* @ts-ignore */
|
|
94
|
+
...(ngDevMode ? [{ debugName: "surface" }] : /* istanbul ignore next */ []));
|
|
95
|
+
mount = input(undefined, /* @ts-ignore */
|
|
96
|
+
...(ngDevMode ? [{ debugName: "mount" }] : /* istanbul ignore next */ []));
|
|
97
|
+
fullScreen = input(undefined, /* @ts-ignore */
|
|
98
|
+
...(ngDevMode ? [{ debugName: "fullScreen" }] : /* istanbul ignore next */ []));
|
|
99
|
+
/**
|
|
100
|
+
* Whether the header renders the control that hands the layer to the panel.
|
|
101
|
+
* Off, because a dialog holds one task and most tasks are the size the
|
|
102
|
+
* consumer chose. `fullScreen` is the other question — the responsive rule
|
|
103
|
+
* set in advance — and this is the reader's own.
|
|
104
|
+
*/
|
|
105
|
+
fullscreenToggle = input(false, { ...(ngDevMode ? { debugName: "fullscreenToggle" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
106
|
+
/** Whether the reader has taken the layer. Two-way, as `open` is. */
|
|
107
|
+
fullscreen = model(false, /* @ts-ignore */
|
|
108
|
+
...(ngDevMode ? [{ debugName: "fullscreen" }] : /* istanbul ignore next */ []));
|
|
109
|
+
escape = input(undefined, /* @ts-ignore */
|
|
110
|
+
...(ngDevMode ? [{ debugName: "escape" }] : /* istanbul ignore next */ []));
|
|
111
|
+
/**
|
|
112
|
+
* The platform's way back — a phone's gesture, a browser's button — closes
|
|
113
|
+
* the layer instead of leaving the page, while the layer is modal.
|
|
114
|
+
*/
|
|
115
|
+
back = input(undefined, /* @ts-ignore */
|
|
116
|
+
...(ngDevMode ? [{ debugName: "back" }] : /* istanbul ignore next */ []));
|
|
117
|
+
/** Whether the layer's content is still on its way. */
|
|
118
|
+
loading = input(false, { ...(ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
119
|
+
/** A parent for this layer alone, instead of the shared portal root. */
|
|
120
|
+
container = input(undefined, /* @ts-ignore */
|
|
121
|
+
...(ngDevMode ? [{ debugName: "container" }] : /* istanbul ignore next */ []));
|
|
122
|
+
initialFocus = input(undefined, /* @ts-ignore */
|
|
123
|
+
...(ngDevMode ? [{ debugName: "initialFocus" }] : /* istanbul ignore next */ []));
|
|
124
|
+
finalFocus = input(undefined, /* @ts-ignore */
|
|
125
|
+
...(ngDevMode ? [{ debugName: "finalFocus" }] : /* istanbul ignore next */ []));
|
|
126
|
+
/**
|
|
127
|
+
* Words laid over the catalog of the language in force, key by key: the
|
|
128
|
+
* corner controls' names (`close`, `fullScreen`).
|
|
129
|
+
*/
|
|
130
|
+
messages = input(undefined, /* @ts-ignore */
|
|
131
|
+
...(ngDevMode ? [{ debugName: "messages" }] : /* istanbul ignore next */ []));
|
|
132
|
+
/** One output for one transition, carrying the reason, the result and the event. */
|
|
133
|
+
openChangeRequest = output();
|
|
134
|
+
/**
|
|
135
|
+
* What `afterClosed()` is in Angular Material, as an output. It fires once the
|
|
136
|
+
* layer has actually closed, with the result the close carried.
|
|
137
|
+
*/
|
|
138
|
+
closed = output();
|
|
139
|
+
/** One output for one transition of the state the toggle sets. */
|
|
140
|
+
fullscreenChangeRequest = output();
|
|
141
|
+
defaults = injectDialogDefaults();
|
|
142
|
+
/** The family's words in the language in force, with this layer's `messages` laid over them. */
|
|
143
|
+
t = injectMessages(dialogMessages, this.messages);
|
|
144
|
+
host = inject(ElementRef).nativeElement;
|
|
145
|
+
destroyRef = inject(DestroyRef);
|
|
146
|
+
baseId = inject(SlDialogIdFactory).next();
|
|
147
|
+
/** The element the consumer wrote us beside, recorded before anything moves. */
|
|
148
|
+
origin = this.host.parentElement;
|
|
149
|
+
/**
|
|
150
|
+
* A consumer's own `aria-label` on `<sl-dialog>`, read before the host
|
|
151
|
+
* bindings are written and moved to the panel, which is the element the role
|
|
152
|
+
* is on. Without this a label written on the host would name a box with
|
|
153
|
+
* `display: contents` and no role at all.
|
|
154
|
+
*/
|
|
155
|
+
writtenLabel = inject(new HostAttributeToken('aria-label'), {
|
|
156
|
+
optional: true,
|
|
157
|
+
});
|
|
158
|
+
layerRef = viewChild('layer', /* @ts-ignore */
|
|
159
|
+
...(ngDevMode ? [{ debugName: "layerRef" }] : /* istanbul ignore next */ []));
|
|
160
|
+
panelRef = viewChild('panel', /* @ts-ignore */
|
|
161
|
+
...(ngDevMode ? [{ debugName: "panelRef" }] : /* istanbul ignore next */ []));
|
|
162
|
+
/** The parts that have said they exist, so only what was rendered is wired. */
|
|
163
|
+
hasTitle = signal(false, /* @ts-ignore */
|
|
164
|
+
...(ngDevMode ? [{ debugName: "hasTitle" }] : /* istanbul ignore next */ []));
|
|
165
|
+
hasDescription = signal(false, /* @ts-ignore */
|
|
166
|
+
...(ngDevMode ? [{ debugName: "hasDescription" }] : /* istanbul ignore next */ []));
|
|
167
|
+
cancelNode = signal(null, /* @ts-ignore */
|
|
168
|
+
...(ngDevMode ? [{ debugName: "cancelNode" }] : /* istanbul ignore next */ []));
|
|
169
|
+
triggerNode = signal(null, /* @ts-ignore */
|
|
170
|
+
...(ngDevMode ? [{ debugName: "triggerNode" }] : /* istanbul ignore next */ []));
|
|
171
|
+
titleId = `${this.baseId}-title`;
|
|
172
|
+
descriptionId = `${this.baseId}-description`;
|
|
173
|
+
contentId = `${this.baseId}-content`;
|
|
174
|
+
triggerId = `${this.baseId}-trigger`;
|
|
175
|
+
/**
|
|
176
|
+
* The status rather than a boolean. `entering` is one frame long and it is
|
|
177
|
+
* the whole reason it exists: a layer that appears already open gives its CSS
|
|
178
|
+
* transition no closed style to start from.
|
|
179
|
+
*/
|
|
180
|
+
status = signal('unmounted', /* @ts-ignore */
|
|
181
|
+
...(ngDevMode ? [{ debugName: "status" }] : /* istanbul ignore next */ []));
|
|
182
|
+
/**
|
|
183
|
+
* The status is a signal and the template reads it, and that is not enough on
|
|
184
|
+
* its own. `presence` answers `sync` from inside the effect that watches
|
|
185
|
+
* `open`, which runs as part of this view's own change detection and after its
|
|
186
|
+
* bindings have been written: the write marked no consumer, no further pass
|
|
187
|
+
* followed, and the layer stayed in the document with `inert` and the closed
|
|
188
|
+
* attribute of a dialog that reported itself open. It was measured on a layer
|
|
189
|
+
* opened from a bound state rather than from a trigger — the family's own
|
|
190
|
+
* stories all open from a trigger, which is why it stood for nine rounds.
|
|
191
|
+
*/
|
|
192
|
+
changes = inject(ChangeDetectorRef);
|
|
193
|
+
presence = createPresence({
|
|
194
|
+
present: false,
|
|
195
|
+
onStatusChange: (next) => {
|
|
196
|
+
this.status.set(next);
|
|
197
|
+
this.changes.markForCheck();
|
|
198
|
+
},
|
|
199
|
+
});
|
|
200
|
+
/** Whether this layer has ever been open, which is what `lazy` reads. */
|
|
201
|
+
seen = signal(false, /* @ts-ignore */
|
|
202
|
+
...(ngDevMode ? [{ debugName: "seen" }] : /* istanbul ignore next */ []));
|
|
203
|
+
result = signal(undefined, /* @ts-ignore */
|
|
204
|
+
...(ngDevMode ? [{ debugName: "result" }] : /* istanbul ignore next */ []));
|
|
205
|
+
isAlert = computed(() => this.member === 'alertDialog', /* @ts-ignore */
|
|
206
|
+
...(ngDevMode ? [{ debugName: "isAlert" }] : /* istanbul ignore next */ []));
|
|
207
|
+
resolvedModal = computed(() => (this.isAlert() ? true : this.modalInput()), /* @ts-ignore */
|
|
208
|
+
...(ngDevMode ? [{ debugName: "resolvedModal" }] : /* istanbul ignore next */ []));
|
|
209
|
+
resolvedOutsidePress = computed(() => this.isAlert() ? 'none' : this.outsidePressInput(), /* @ts-ignore */
|
|
210
|
+
...(ngDevMode ? [{ debugName: "resolvedOutsidePress" }] : /* istanbul ignore next */ []));
|
|
211
|
+
resolvedMount = computed(() => this.mount() ?? this.defaults.mount, /* @ts-ignore */
|
|
212
|
+
...(ngDevMode ? [{ debugName: "resolvedMount" }] : /* istanbul ignore next */ []));
|
|
213
|
+
resolvedSize = computed(() => this.size() ?? (this.isAlert() ? 'sm' : this.defaults.size), /* @ts-ignore */
|
|
214
|
+
...(ngDevMode ? [{ debugName: "resolvedSize" }] : /* istanbul ignore next */ []));
|
|
215
|
+
resolvedPlacement = computed(() => this.placement() ?? this.defaults.placement, /* @ts-ignore */
|
|
216
|
+
...(ngDevMode ? [{ debugName: "resolvedPlacement" }] : /* istanbul ignore next */ []));
|
|
217
|
+
resolvedScroll = computed(() => this.scroll() ?? this.defaults.scroll, /* @ts-ignore */
|
|
218
|
+
...(ngDevMode ? [{ debugName: "resolvedScroll" }] : /* istanbul ignore next */ []));
|
|
219
|
+
resolvedSurface = computed(() => this.surface() ?? this.defaults.surface, /* @ts-ignore */
|
|
220
|
+
...(ngDevMode ? [{ debugName: "resolvedSurface" }] : /* istanbul ignore next */ []));
|
|
221
|
+
resolvedFullScreen = computed(() => this.fullScreen() ?? (this.isAlert() ? 'never' : this.defaults.fullScreen), /* @ts-ignore */
|
|
222
|
+
...(ngDevMode ? [{ debugName: "resolvedFullScreen" }] : /* istanbul ignore next */ []));
|
|
223
|
+
resolvedEscape = computed(() => this.escape() ?? this.defaults.escape, /* @ts-ignore */
|
|
224
|
+
...(ngDevMode ? [{ debugName: "resolvedEscape" }] : /* istanbul ignore next */ []));
|
|
225
|
+
resolvedBack = computed(() => this.back() ?? this.defaults.back, /* @ts-ignore */
|
|
226
|
+
...(ngDevMode ? [{ debugName: "resolvedBack" }] : /* istanbul ignore next */ []));
|
|
227
|
+
/**
|
|
228
|
+
* A confirmation has no corner controls at all, for the reason it has no
|
|
229
|
+
* close button, so neither the state nor the control that sets it is its.
|
|
230
|
+
*/
|
|
231
|
+
resolvedFullscreen = computed(() => !this.isAlert() && this.fullscreen(), /* @ts-ignore */
|
|
232
|
+
...(ngDevMode ? [{ debugName: "resolvedFullscreen" }] : /* istanbul ignore next */ []));
|
|
233
|
+
resolvedFullscreenToggle = computed(() => !this.isAlert() && this.fullscreenToggle(), /* @ts-ignore */
|
|
234
|
+
...(ngDevMode ? [{ debugName: "resolvedFullscreenToggle" }] : /* istanbul ignore next */ []));
|
|
235
|
+
resolvedInitialFocus = computed(() => this.initialFocus() ?? (this.isAlert() ? 'cancel' : 'first'), /* @ts-ignore */
|
|
236
|
+
...(ngDevMode ? [{ debugName: "resolvedInitialFocus" }] : /* istanbul ignore next */ []));
|
|
237
|
+
resolvedTone = computed(() => this.isAlert() ? this.toneInput() : null, /* @ts-ignore */
|
|
238
|
+
...(ngDevMode ? [{ debugName: "resolvedTone" }] : /* istanbul ignore next */ []));
|
|
239
|
+
/** Overridden by the member that has them; the base has neither. */
|
|
240
|
+
modalInput() {
|
|
241
|
+
return this.defaults.modal;
|
|
242
|
+
}
|
|
243
|
+
outsidePressInput() {
|
|
244
|
+
return this.defaults.outsidePress;
|
|
245
|
+
}
|
|
246
|
+
toneInput() {
|
|
247
|
+
return 'danger';
|
|
248
|
+
}
|
|
249
|
+
mounted = computed(() => {
|
|
250
|
+
const mount = this.resolvedMount();
|
|
251
|
+
if (mount === 'eager')
|
|
252
|
+
return true;
|
|
253
|
+
if (mount === 'lazy')
|
|
254
|
+
return this.seen();
|
|
255
|
+
return this.status() !== 'unmounted';
|
|
256
|
+
}, /* @ts-ignore */
|
|
257
|
+
...(ngDevMode ? [{ debugName: "mounted" }] : /* istanbul ignore next */ []));
|
|
258
|
+
/** What the stylesheet keys on, which is a frame behind what was asked. */
|
|
259
|
+
visible = computed(() => this.status() === 'open', /* @ts-ignore */
|
|
260
|
+
...(ngDevMode ? [{ debugName: "visible" }] : /* istanbul ignore next */ []));
|
|
261
|
+
/**
|
|
262
|
+
* Whether the layer takes focus and the pointer. `entering` counts: the
|
|
263
|
+
* focus scope enters in that frame, and a layer still `inert` then refuses
|
|
264
|
+
* the initial focus and leaves it on `body`.
|
|
265
|
+
*/
|
|
266
|
+
interactive = computed(() => {
|
|
267
|
+
const status = this.status();
|
|
268
|
+
return status === 'entering' || status === 'open';
|
|
269
|
+
}, /* @ts-ignore */
|
|
270
|
+
...(ngDevMode ? [{ debugName: "interactive" }] : /* istanbul ignore next */ []));
|
|
271
|
+
labelledBy = computed(() => this.hasTitle() && this.writtenLabel === null ? this.titleId : null, /* @ts-ignore */
|
|
272
|
+
...(ngDevMode ? [{ debugName: "labelledBy" }] : /* istanbul ignore next */ []));
|
|
273
|
+
describedBy = computed(() => (this.hasDescription() ? this.descriptionId : null), /* @ts-ignore */
|
|
274
|
+
...(ngDevMode ? [{ debugName: "describedBy" }] : /* istanbul ignore next */ []));
|
|
275
|
+
label = computed(() => this.writtenLabel, /* @ts-ignore */
|
|
276
|
+
...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
277
|
+
role = computed(() => (this.isAlert() ? 'alertdialog' : 'dialog'), /* @ts-ignore */
|
|
278
|
+
...(ngDevMode ? [{ debugName: "role" }] : /* istanbul ignore next */ []));
|
|
279
|
+
portal = null;
|
|
280
|
+
layer = null;
|
|
281
|
+
scope = null;
|
|
282
|
+
/** Whether the layer, the focus scope and the `closed` owed are standing. */
|
|
283
|
+
engaged = false;
|
|
284
|
+
/**
|
|
285
|
+
* The layer this one was written inside, and the layers written inside this
|
|
286
|
+
* one. A confirmation whose action also closes the dialog under it closes
|
|
287
|
+
* both in one change, and Angular runs the dialog's effect first: taken down
|
|
288
|
+
* from the bottom, the dialog found focus in the confirmation and restored
|
|
289
|
+
* nothing, and the confirmation then handed focus to a control in a layer
|
|
290
|
+
* already leaving — `body`, once that layer was gone. The layers come down
|
|
291
|
+
* from the top instead, as React's effects take them down.
|
|
292
|
+
*/
|
|
293
|
+
parent = inject(SlDialogBase, { optional: true, skipSelf: true });
|
|
294
|
+
nested = new Set();
|
|
295
|
+
constructor() {
|
|
296
|
+
this.parent?.nested.add(this);
|
|
297
|
+
effect(() => {
|
|
298
|
+
if (this.open())
|
|
299
|
+
this.seen.set(true);
|
|
300
|
+
this.presence.sync(this.open());
|
|
301
|
+
});
|
|
302
|
+
/** Where the layer lives, for as long as it is in the document. */
|
|
303
|
+
effect(() => {
|
|
304
|
+
const node = this.layerRef()?.nativeElement ?? null;
|
|
305
|
+
this.presence.setNode(node);
|
|
306
|
+
if (node === null) {
|
|
307
|
+
this.releasePortal();
|
|
308
|
+
return;
|
|
309
|
+
}
|
|
310
|
+
if (this.portal !== null)
|
|
311
|
+
return;
|
|
312
|
+
const named = this.container();
|
|
313
|
+
this.portal = createPortalRoot({
|
|
314
|
+
origin: this.origin,
|
|
315
|
+
...(named === undefined ? {} : { container: named }),
|
|
316
|
+
});
|
|
317
|
+
this.portal.container?.append(node);
|
|
318
|
+
});
|
|
319
|
+
/**
|
|
320
|
+
* Everything the layer does while it is open, taken down when it closes
|
|
321
|
+
* rather than when the node leaves — `presence` keeps the node mounted
|
|
322
|
+
* through the exit, and a layer still holding the scroll lock and the
|
|
323
|
+
* background's `inert` for those milliseconds is a page nobody can touch.
|
|
324
|
+
*/
|
|
325
|
+
effect((onCleanup) => {
|
|
326
|
+
const node = this.layerRef()?.nativeElement;
|
|
327
|
+
const panel = this.panelRef()?.nativeElement;
|
|
328
|
+
if (!this.open() || node === undefined || panel === undefined)
|
|
329
|
+
return;
|
|
330
|
+
const escape = this.resolvedEscape() === 'close';
|
|
331
|
+
const outsidePress = this.resolvedOutsidePress() === 'close';
|
|
332
|
+
const modal = this.resolvedModal();
|
|
333
|
+
/* A history entry is a modal layer's: a layer the page stays reachable
|
|
334
|
+
under has no claim on the way back. */
|
|
335
|
+
const back = modal && this.resolvedBack() === 'close';
|
|
336
|
+
const trigger = this.triggerNode();
|
|
337
|
+
/* The frame is the layer and the panel is what a press is inside of: the
|
|
338
|
+
scrim and the viewport around the panel are the way out. The click, not
|
|
339
|
+
the pointerdown, so a selection dragged out of the panel is not a press
|
|
340
|
+
on the scrim. */
|
|
341
|
+
this.layer = createDismissableLayer(node, {
|
|
342
|
+
back,
|
|
343
|
+
branches: trigger === null ? [] : [trigger],
|
|
344
|
+
content: panel,
|
|
345
|
+
escape,
|
|
346
|
+
modal,
|
|
347
|
+
onDismiss: (request) => {
|
|
348
|
+
if (request.reason === 'outsidePress' && !outsidePress)
|
|
349
|
+
return request.cancel();
|
|
350
|
+
this.request(false, request.reason, undefined, request.source);
|
|
351
|
+
},
|
|
352
|
+
outsidePress,
|
|
353
|
+
outsidePressEvent: 'click',
|
|
354
|
+
});
|
|
355
|
+
const wanted = this.resolvedInitialFocus();
|
|
356
|
+
const returnTo = this.finalFocus();
|
|
357
|
+
this.scope = createFocusScope(panel, {
|
|
358
|
+
contain: modal,
|
|
359
|
+
initial: wanted === 'cancel'
|
|
360
|
+
? () => this.cancelNode()
|
|
361
|
+
: wanted instanceof HTMLElement
|
|
362
|
+
? () => wanted
|
|
363
|
+
: wanted,
|
|
364
|
+
...(returnTo === undefined
|
|
365
|
+
? {}
|
|
366
|
+
: { restore: returnTo === false ? false : () => returnTo }),
|
|
367
|
+
});
|
|
368
|
+
this.scope.enter();
|
|
369
|
+
this.engaged = true;
|
|
370
|
+
onCleanup(() => this.takeDown());
|
|
371
|
+
});
|
|
372
|
+
this.destroyRef.onDestroy(() => {
|
|
373
|
+
this.parent?.nested.delete(this);
|
|
374
|
+
this.layer?.destroy();
|
|
375
|
+
this.scope?.destroy();
|
|
376
|
+
this.presence.destroy();
|
|
377
|
+
this.releasePortal();
|
|
378
|
+
});
|
|
379
|
+
}
|
|
380
|
+
/**
|
|
381
|
+
* Takes down what the layer does while it is open, once per opening. The
|
|
382
|
+
* nested layers that closed in the same change go first.
|
|
383
|
+
*
|
|
384
|
+
* The layer before the scope: it lifts the `inert` it wrote on the
|
|
385
|
+
* background, and a browser refuses focus inside an inert subtree, so a
|
|
386
|
+
* scope taken down first hands focus back to a trigger that cannot take it.
|
|
387
|
+
*/
|
|
388
|
+
takeDown() {
|
|
389
|
+
if (!this.engaged)
|
|
390
|
+
return;
|
|
391
|
+
this.engaged = false;
|
|
392
|
+
for (const layer of this.nested)
|
|
393
|
+
if (!layer.open())
|
|
394
|
+
layer.takeDown();
|
|
395
|
+
this.layer?.destroy();
|
|
396
|
+
this.layer = null;
|
|
397
|
+
this.scope?.destroy();
|
|
398
|
+
this.scope = null;
|
|
399
|
+
this.closed.emit(this.result());
|
|
400
|
+
this.result.set(undefined);
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* The layer element is given back to the host before the portal goes, so
|
|
404
|
+
* Angular removes a node that is where its own view expects it to be.
|
|
405
|
+
*/
|
|
406
|
+
releasePortal() {
|
|
407
|
+
if (this.portal === null)
|
|
408
|
+
return;
|
|
409
|
+
const node = this.layerRef()?.nativeElement;
|
|
410
|
+
if (node !== undefined)
|
|
411
|
+
this.host.append(node);
|
|
412
|
+
this.portal.release();
|
|
413
|
+
this.portal = null;
|
|
414
|
+
}
|
|
415
|
+
/** Asks to move, carrying the reason, the result and the originating event. */
|
|
416
|
+
request(next, reason, result, source) {
|
|
417
|
+
if (next === this.open())
|
|
418
|
+
return;
|
|
419
|
+
let cancelled = false;
|
|
420
|
+
const state = createControllable({
|
|
421
|
+
initial: this.open(),
|
|
422
|
+
onRequest: (raw) => {
|
|
423
|
+
cancelled = raw.cancelled;
|
|
424
|
+
this.openChangeRequest.emit({
|
|
425
|
+
cancel: () => raw.cancel(),
|
|
426
|
+
get cancelled() {
|
|
427
|
+
return raw.cancelled;
|
|
428
|
+
},
|
|
429
|
+
previous: raw.previous,
|
|
430
|
+
reason,
|
|
431
|
+
result,
|
|
432
|
+
source: raw.source,
|
|
433
|
+
value: raw.value,
|
|
434
|
+
});
|
|
435
|
+
},
|
|
436
|
+
});
|
|
437
|
+
if (!state.request(next, reason, source) || cancelled)
|
|
438
|
+
return;
|
|
439
|
+
if (!next)
|
|
440
|
+
this.result.set(result);
|
|
441
|
+
this.open.set(next);
|
|
442
|
+
}
|
|
443
|
+
/** Asks to take the layer or give it back, carrying the reason and the event. */
|
|
444
|
+
requestFullscreen(next, reason, source) {
|
|
445
|
+
if (next === this.resolvedFullscreen())
|
|
446
|
+
return;
|
|
447
|
+
let cancelled = false;
|
|
448
|
+
const state = createControllable({
|
|
449
|
+
initial: this.fullscreen(),
|
|
450
|
+
onRequest: (raw) => {
|
|
451
|
+
cancelled = raw.cancelled;
|
|
452
|
+
this.fullscreenChangeRequest.emit({
|
|
453
|
+
cancel: () => raw.cancel(),
|
|
454
|
+
get cancelled() {
|
|
455
|
+
return raw.cancelled;
|
|
456
|
+
},
|
|
457
|
+
previous: raw.previous,
|
|
458
|
+
reason,
|
|
459
|
+
source: raw.source,
|
|
460
|
+
value: raw.value,
|
|
461
|
+
});
|
|
462
|
+
},
|
|
463
|
+
});
|
|
464
|
+
if (!state.request(next, reason, source) || cancelled)
|
|
465
|
+
return;
|
|
466
|
+
this.fullscreen.set(next);
|
|
467
|
+
}
|
|
468
|
+
/** Opens the layer from code, carrying `programmatic`. */
|
|
469
|
+
openDialog() {
|
|
470
|
+
this.request(true, 'programmatic', undefined, undefined);
|
|
471
|
+
}
|
|
472
|
+
/** Closes it from code, carrying `programmatic` and the result given. */
|
|
473
|
+
close(result) {
|
|
474
|
+
this.request(false, 'programmatic', result, undefined);
|
|
475
|
+
}
|
|
476
|
+
/** Moves focus into the layer, as opening does. */
|
|
477
|
+
focus() {
|
|
478
|
+
this.panelRef()?.nativeElement.focus();
|
|
479
|
+
}
|
|
480
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlDialogBase, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
481
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "22.1.7", type: SlDialogBase, isStandalone: true, inputs: { open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "placement", isSignal: true, isRequired: false, transformFunction: null }, scroll: { classPropertyName: "scroll", publicName: "scroll", isSignal: true, isRequired: false, transformFunction: null }, surface: { classPropertyName: "surface", publicName: "surface", isSignal: true, isRequired: false, transformFunction: null }, mount: { classPropertyName: "mount", publicName: "mount", isSignal: true, isRequired: false, transformFunction: null }, fullScreen: { classPropertyName: "fullScreen", publicName: "fullScreen", isSignal: true, isRequired: false, transformFunction: null }, fullscreenToggle: { classPropertyName: "fullscreenToggle", publicName: "fullscreenToggle", isSignal: true, isRequired: false, transformFunction: null }, fullscreen: { classPropertyName: "fullscreen", publicName: "fullscreen", isSignal: true, isRequired: false, transformFunction: null }, escape: { classPropertyName: "escape", publicName: "escape", isSignal: true, isRequired: false, transformFunction: null }, back: { classPropertyName: "back", publicName: "back", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, container: { classPropertyName: "container", publicName: "container", isSignal: true, isRequired: false, transformFunction: null }, initialFocus: { classPropertyName: "initialFocus", publicName: "initialFocus", isSignal: true, isRequired: false, transformFunction: null }, finalFocus: { classPropertyName: "finalFocus", publicName: "finalFocus", isSignal: true, isRequired: false, transformFunction: null }, messages: { classPropertyName: "messages", publicName: "messages", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { open: "openChange", fullscreen: "fullscreenChange", openChangeRequest: "openChangeRequest", closed: "closed", fullscreenChangeRequest: "fullscreenChangeRequest" }, viewQueries: [{ propertyName: "layerRef", first: true, predicate: ["layer"], descendants: true, isSignal: true }, { propertyName: "panelRef", first: true, predicate: ["panel"], descendants: true, isSignal: true }], ngImport: i0 });
|
|
482
|
+
}
|
|
483
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlDialogBase, decorators: [{
|
|
484
|
+
type: Directive
|
|
485
|
+
}], ctorParameters: () => [], propDecorators: { open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }, { type: i0.Output, args: ["openChange"] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], placement: [{ type: i0.Input, args: [{ isSignal: true, alias: "placement", required: false }] }], scroll: [{ type: i0.Input, args: [{ isSignal: true, alias: "scroll", required: false }] }], surface: [{ type: i0.Input, args: [{ isSignal: true, alias: "surface", required: false }] }], mount: [{ type: i0.Input, args: [{ isSignal: true, alias: "mount", required: false }] }], fullScreen: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullScreen", required: false }] }], fullscreenToggle: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullscreenToggle", required: false }] }], fullscreen: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullscreen", required: false }] }, { type: i0.Output, args: ["fullscreenChange"] }], escape: [{ type: i0.Input, args: [{ isSignal: true, alias: "escape", required: false }] }], back: [{ type: i0.Input, args: [{ isSignal: true, alias: "back", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], container: [{ type: i0.Input, args: [{ isSignal: true, alias: "container", required: false }] }], initialFocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "initialFocus", required: false }] }], finalFocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "finalFocus", required: false }] }], messages: [{ type: i0.Input, args: [{ isSignal: true, alias: "messages", required: false }] }], openChangeRequest: [{ type: i0.Output, args: ["openChangeRequest"] }], closed: [{ type: i0.Output, args: ["closed"] }], fullscreenChangeRequest: [{ type: i0.Output, args: ["fullscreenChangeRequest"] }], layerRef: [{ type: i0.ViewChild, args: ['layer', { isSignal: true }] }], panelRef: [{ type: i0.ViewChild, args: ['panel', { isSignal: true }] }] } });
|
|
486
|
+
/**
|
|
487
|
+
* One template for the two members. `tag` already names its own the same way,
|
|
488
|
+
* which is what says the compiler folds it: `entry-points.source.test.mjs`
|
|
489
|
+
* refuses an identifier for `styleUrl` because that one needs a file resolved
|
|
490
|
+
* at build time, and a template string needs nothing resolved at all.
|
|
491
|
+
*/
|
|
492
|
+
const LAYER_TEMPLATE = `
|
|
493
|
+
@if (mounted()) {
|
|
494
|
+
<div
|
|
495
|
+
#layer
|
|
496
|
+
data-ui="dialog"
|
|
497
|
+
data-part="root"
|
|
498
|
+
[attr.data-size]="resolvedSize()"
|
|
499
|
+
[attr.data-placement]="resolvedPlacement()"
|
|
500
|
+
[attr.data-scroll]="resolvedScroll()"
|
|
501
|
+
[attr.data-surface]="resolvedSurface()"
|
|
502
|
+
[attr.data-mount]="resolvedMount()"
|
|
503
|
+
[attr.data-full-screen]="resolvedFullScreen()"
|
|
504
|
+
[attr.data-fullscreen]="resolvedFullscreen() ? '' : null"
|
|
505
|
+
[attr.data-outside-press]="resolvedOutsidePress()"
|
|
506
|
+
[attr.data-tone]="resolvedTone()"
|
|
507
|
+
[attr.data-modal]="resolvedModal() ? '' : null"
|
|
508
|
+
[attr.data-open]="visible() ? '' : null"
|
|
509
|
+
[attr.data-loading]="loading() ? '' : null"
|
|
510
|
+
[attr.inert]="interactive() ? null : ''"
|
|
511
|
+
>
|
|
512
|
+
<div data-part="backdrop"></div>
|
|
513
|
+
<div data-part="viewport">
|
|
514
|
+
<div
|
|
515
|
+
#panel
|
|
516
|
+
data-part="content"
|
|
517
|
+
[id]="contentId"
|
|
518
|
+
[attr.role]="role()"
|
|
519
|
+
[attr.aria-modal]="resolvedModal() ? 'true' : null"
|
|
520
|
+
[attr.aria-label]="label()"
|
|
521
|
+
[attr.aria-labelledby]="labelledBy()"
|
|
522
|
+
[attr.aria-describedby]="describedBy()"
|
|
523
|
+
>
|
|
524
|
+
<ng-content />
|
|
525
|
+
</div>
|
|
526
|
+
</div>
|
|
527
|
+
</div>
|
|
528
|
+
}`;
|
|
529
|
+
class SlDialog extends SlDialogBase {
|
|
530
|
+
member = 'dialog';
|
|
531
|
+
/**
|
|
532
|
+
* Whether the background is inert, the scroll is locked and focus is
|
|
533
|
+
* contained. A non-modal layer writes no `aria-modal`, which the APG requires
|
|
534
|
+
* of anything that does not actually make the background unreachable.
|
|
535
|
+
*/
|
|
536
|
+
modal = input(true, { ...(ngDevMode ? { debugName: "modal" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
537
|
+
outsidePress = input(undefined, /* @ts-ignore */
|
|
538
|
+
...(ngDevMode ? [{ debugName: "outsidePress" }] : /* istanbul ignore next */ []));
|
|
539
|
+
modalInput() {
|
|
540
|
+
return this.modal();
|
|
541
|
+
}
|
|
542
|
+
outsidePressInput() {
|
|
543
|
+
return this.outsidePress() ?? this.defaults.outsidePress;
|
|
544
|
+
}
|
|
545
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlDialog, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
546
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: SlDialog, isStandalone: true, selector: "sl-dialog", inputs: { modal: { classPropertyName: "modal", publicName: "modal", isSignal: true, isRequired: false, transformFunction: null }, outsidePress: { classPropertyName: "outsidePress", publicName: "outsidePress", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "style.display": "'contents'" } }, providers: [{ provide: SlDialogBase, useExisting: forwardRef(() => SlDialog) }], exportAs: ["slDialog"], usesInheritance: true, ngImport: i0, template: "\n @if (mounted()) {\n <div\n #layer\n data-ui=\"dialog\"\n data-part=\"root\"\n [attr.data-size]=\"resolvedSize()\"\n [attr.data-placement]=\"resolvedPlacement()\"\n [attr.data-scroll]=\"resolvedScroll()\"\n [attr.data-surface]=\"resolvedSurface()\"\n [attr.data-mount]=\"resolvedMount()\"\n [attr.data-full-screen]=\"resolvedFullScreen()\"\n [attr.data-fullscreen]=\"resolvedFullscreen() ? '' : null\"\n [attr.data-outside-press]=\"resolvedOutsidePress()\"\n [attr.data-tone]=\"resolvedTone()\"\n [attr.data-modal]=\"resolvedModal() ? '' : null\"\n [attr.data-open]=\"visible() ? '' : null\"\n [attr.data-loading]=\"loading() ? '' : null\"\n [attr.inert]=\"interactive() ? null : ''\"\n >\n <div data-part=\"backdrop\"></div>\n <div data-part=\"viewport\">\n <div\n #panel\n data-part=\"content\"\n [id]=\"contentId\"\n [attr.role]=\"role()\"\n [attr.aria-modal]=\"resolvedModal() ? 'true' : null\"\n [attr.aria-label]=\"label()\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-describedby]=\"describedBy()\"\n >\n <ng-content />\n </div>\n </div>\n </div>\n }", isInline: true, styles: ["@layer slotted.components{[data-ui=dialog]{--_measure: var(--slotted-dialog-measure, 32rem);--_layer-padding: var(--slotted-space-8, 1.5rem);--_padding-inline: var(--slotted-space-8, 1.5rem);--_padding-block: var(--slotted-space-7, 1.25rem);--_header-padding-block: var(--slotted-space-6, 1rem);--_footer-padding-block: var(--slotted-space-5, .75rem);--_gap: var(--slotted-space-5, .75rem);--_rule-size: var(--slotted-border-width-thin, 1px);--_title-font-size: var(--slotted-font-size-xl, 1.125rem);--_title-line-height: var(--slotted-line-height-md, 1.5);--_description-font-size: var(--slotted-font-size-md, .875rem);--_body-font-size: var(--slotted-font-size-md, .875rem);--_icon-size: var(--slotted-control-icon-size-lg, 18px);--_inner-size: var(--slotted-control-inner-size-lg, 28px);--_close-size: max( var(--slotted-target-min, 24px), min(calc(var(--_icon-size) + 2 * var(--slotted-space-2, .25rem)), var(--_inner-size)) );--_status-size: var(--_title-font-size);--_mark-gap: var(--slotted-space-4, .5rem);--_tone-color: var(--slotted-tone-danger-text, CanvasText);position:fixed;inset:0;z-index:calc(var(--slotted-z-index-overlay, 1000) + var(--slotted-layer-depth, 0));display:grid;grid-template:minmax(0,1fr) / minmax(0,1fr);container-type:inline-size;container-name:slotted-dialog;color:var(--slotted-dialog-color, var(--slotted-text, CanvasText));font-family:var(--slotted-control-font-family, var(--slotted-font-family-sans));content-visibility:visible;transition:content-visibility var(--slotted-duration-medium) allow-discrete}[data-ui=dialog][inert]{content-visibility:hidden;pointer-events:none}[data-ui=dialog]:not([data-modal]){pointer-events:none}[data-ui=dialog]:not([data-modal])>[data-part=backdrop]{visibility:hidden}[data-ui=dialog]:not([data-modal])>[data-part=viewport]>[data-part=content]{pointer-events:auto}[data-ui=dialog][data-size=sm]{--_measure: var(--slotted-dialog-measure, 24rem);--_padding-inline: var(--slotted-space-7, 1.25rem);--_padding-block: var(--slotted-space-6, 1rem);--_header-padding-block: var(--slotted-space-5, .75rem);--_footer-padding-block: var(--slotted-space-4, .5rem);--_title-font-size: var(--slotted-font-size-lg, 1rem)}[data-ui=dialog][data-size=lg]{--_measure: var(--slotted-dialog-measure, 42rem)}[data-ui=dialog][data-size=xl]{--_measure: var(--slotted-dialog-measure, 56rem)}[data-ui=dialog][data-size=full]{--_measure: var(--slotted-dialog-measure, none)}[data-ui=dialog]>[data-part=backdrop]{grid-area:1 / 1;background:var(--slotted-dialog-scrim, var(--slotted-scrim, Canvas));opacity:0;transition:opacity var(--slotted-duration-short) var(--slotted-easing-exit)}[data-ui=dialog][data-open]>[data-part=backdrop]{opacity:1;transition:opacity var(--slotted-duration-long) var(--slotted-easing-standard)}[data-ui=dialog]>[data-part=viewport]{grid-area:1 / 1;display:grid;grid-template-columns:minmax(0,1fr);align-content:safe center;justify-items:center;padding:var(--_layer-padding);overflow:auto;overscroll-behavior:contain}[data-ui=dialog][data-placement=top]>[data-part=viewport]{align-content:safe start}[data-ui=dialog]>[data-part=viewport]>[data-part=content]{display:grid;grid-template-rows:auto minmax(0,1fr) auto;inline-size:100%;max-inline-size:var(--_measure);max-block-size:100%;background:var(--slotted-dialog-surface, var(--slotted-surface-raised, Canvas));border:var(--_rule-size) solid var(--slotted-dialog-border-color, var(--slotted-border-subtle, ButtonBorder));border-radius:var(--slotted-dialog-radius, var(--slotted-radius-lg, 8px));box-shadow:var(--slotted-shadow-lg);overflow:hidden;opacity:0;transition:opacity var(--slotted-duration-short) var(--slotted-easing-exit)}[data-ui=dialog][data-open]>[data-part=viewport]>[data-part=content]{opacity:1;transition:opacity var(--slotted-duration-long) var(--slotted-easing-standard)}[data-ui=dialog][data-scroll=viewport]>[data-part=viewport]>[data-part=content]{max-block-size:none}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]{display:grid;grid-template-columns:auto minmax(0,1fr) auto auto;align-items:start;column-gap:0;row-gap:var(--slotted-space-2, .25rem);padding-block:var(--_header-padding-block);padding-inline:var(--_padding-inline)}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>*:not([data-part=icon],[data-part=title],[data-part=description],[data-part=fullscreen],[data-part=close]){grid-column:2;justify-self:start}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>[data-part=icon]{--slotted-icon-size: var(--_status-size);grid-column:1;grid-row:1 / span 2;align-self:start;display:inline-grid;place-items:center;color:var(--_tone-color);block-size:var(--_status-size);inline-size:var(--_status-size);flex:none;margin-block-start:calc((var(--_title-font-size) * var(--_title-line-height) - var(--_status-size)) / 2);margin-inline-end:var(--_mark-gap)}[data-ui=dialog][data-tone=accent]{--_tone-color: var(--slotted-tone-accent-text, CanvasText)}[data-ui=dialog][data-tone=secondary]{--_tone-color: var(--slotted-tone-secondary-text, CanvasText)}[data-ui=dialog][data-tone=success]{--_tone-color: var(--slotted-tone-success-text, CanvasText)}[data-ui=dialog][data-tone=warning]{--_tone-color: var(--slotted-tone-warning-text, CanvasText)}[data-ui=dialog][data-tone=danger]{--_tone-color: var(--slotted-tone-danger-text, CanvasText)}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>[data-part=title]{grid-column:2;grid-row:1;margin:0;min-inline-size:0;overflow-wrap:anywhere;font-family:var( --slotted-dialog-title-font-family, var( --slotted-font-family-heading, var(--slotted-font-family-sans, ui-sans-serif, system-ui, sans-serif) ) );font-size:var(--_title-font-size);font-weight:var(--slotted-font-weight-semibold, 600);line-height:var(--_title-line-height);color:var(--slotted-dialog-title-color, var(--slotted-text, CanvasText))}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>[data-part=description]{grid-column:2;grid-row:2;margin:0;min-inline-size:0;overflow-wrap:anywhere;font-size:var(--_description-font-size);line-height:var(--slotted-line-height-md, 1.5);color:var(--slotted-dialog-description-color, var(--slotted-text-muted, GrayText))}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>[data-part=description] :is(strong,b){font-weight:var(--slotted-font-weight-semibold, 600);color:var(--slotted-dialog-title-color, var(--slotted-text, CanvasText))}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>[data-part=close]{--slotted-icon-size: var(--_icon-size);grid-column:4;grid-row:1 / span 2;align-self:start;display:inline-grid;place-items:center;block-size:var(--_close-size);inline-size:var(--_close-size);margin-inline-end:calc(-1 * (var(--_close-size) - var(--_icon-size)) / 2);margin-inline-start:var(--_gap);padding:0;appearance:none;background-color:transparent;border:0;border-radius:var(--slotted-control-radius, var(--slotted-radius-sm, 4px));color:var(--slotted-dialog-close-color, var(--slotted-text-muted, GrayText));cursor:pointer;transition:background-color var(--slotted-control-transition-duration, var(--slotted-duration-short)) var(--slotted-control-transition-easing, var(--slotted-easing-standard)),color var(--slotted-control-transition-duration, var(--slotted-duration-short)) var(--slotted-control-transition-easing, var(--slotted-easing-standard))}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>[data-part=close]:not(:disabled):hover{background-color:var( --slotted-dialog-close-hover-background, var(--slotted-tone-secondary-subtle-hover) )}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>[data-part=close]:not(:disabled):active{background-color:var( --slotted-dialog-close-active-background, var(--slotted-tone-secondary-subtle-active) )}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>[data-part=close]:focus-visible{outline:var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);outline-offset:calc(-1 * var(--slotted-focus-ring-offset, 2px))}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>[data-part=fullscreen]{--slotted-icon-size: var(--_icon-size);grid-column:3;grid-row:1 / span 2;align-self:start;display:inline-grid;place-items:center;block-size:var(--_close-size);inline-size:var(--_close-size);margin-inline-start:var(--_gap);padding:0;appearance:none;background-color:transparent;border:0;border-radius:var(--slotted-control-radius, var(--slotted-radius-sm, 4px));color:var(--slotted-dialog-close-color, var(--slotted-text-muted, GrayText));cursor:pointer;transition:background-color var(--slotted-control-transition-duration, var(--slotted-duration-short)) var(--slotted-control-transition-easing, var(--slotted-easing-standard)),color var(--slotted-control-transition-duration, var(--slotted-duration-short)) var(--slotted-control-transition-easing, var(--slotted-easing-standard))}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>[data-part=fullscreen]+[data-part=close]{margin-inline-start:0}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>[data-part=fullscreen]:not(:disabled):hover{background-color:var( --slotted-dialog-close-hover-background, var(--slotted-tone-secondary-subtle-hover) )}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>[data-part=fullscreen]:not(:disabled):active{background-color:var( --slotted-dialog-close-active-background, var(--slotted-tone-secondary-subtle-active) )}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>[data-part=fullscreen]:focus-visible{outline:var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);outline-offset:calc(-1 * var(--slotted-focus-ring-offset, 2px))}@media(pointer:coarse){[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>:is([data-part=close],[data-part=fullscreen]){position:relative}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>:is([data-part=close],[data-part=fullscreen]):before{content:\"\";inset:min(0px,calc((100% - var(--slotted-target-comfortable, 44px)) / 2));position:absolute}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>[data-part=fullscreen]:has(+[data-part=close]):before{inset-inline-end:0}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>[data-part=fullscreen]+[data-part=close]:before{inset-inline-start:0}}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=body]:not(:first-child){border-block-start:var(--_rule-size) solid var(--slotted-dialog-rule-color, var(--slotted-border-subtle, ButtonBorder))}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=body]{min-block-size:0;overflow-x:hidden;overflow-y:auto;overflow-inline:hidden;overflow-block:auto;overscroll-behavior:contain;padding-block:var(--_padding-block);padding-inline:var(--_padding-inline);font-size:var(--_body-font-size);line-height:var(--slotted-line-height-md, 1.5);color:var(--slotted-dialog-body-color, var(--slotted-text, CanvasText))}[data-ui=dialog][data-scroll=viewport]>[data-part=viewport]>[data-part=content]>[data-part=body]{overflow:visible}[data-ui=dialog][data-loading]>[data-part=viewport]>[data-part=content]>[data-part=body]{min-block-size:var(--slotted-space-12, 4rem)}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=footer]{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:var(--_gap);padding-block:var(--_footer-padding-block);padding-inline:var(--_padding-inline);background:var(--slotted-dialog-footer-surface, var(--slotted-surface-sunken, Canvas))}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=footer]:not(:first-child){border-block-start:var(--_rule-size) solid var(--slotted-dialog-rule-color, var(--slotted-border-subtle, ButtonBorder))}[data-ui=dialog][data-surface=plain]>[data-part=viewport]>[data-part=content]{display:block;background:none;border:0;border-radius:0;box-shadow:none;overflow:visible}[data-ui=dialog][data-surface=plain]>[data-part=viewport]>[data-part=content]>:is([data-part=header],[data-part=body],[data-part=footer]){background:none;border:0;padding:0}@container slotted-dialog (max-inline-size: 30rem){[data-ui=dialog][data-full-screen=narrow]>[data-part=viewport]{align-content:stretch;padding:0}[data-ui=dialog][data-full-screen=narrow]>[data-part=viewport]>[data-part=content]{max-inline-size:none;block-size:100%;border-radius:0;border:0}}[data-ui=dialog][data-full-screen=always]>[data-part=viewport],[data-ui=dialog][data-fullscreen]>[data-part=viewport]{align-content:stretch;padding:0}[data-ui=dialog][data-full-screen=always]>[data-part=viewport]>[data-part=content],[data-ui=dialog][data-fullscreen]>[data-part=viewport]>[data-part=content]{max-inline-size:none;block-size:100%;border-radius:0;border:0}@media(forced-colors:active){[data-ui=dialog]>[data-part=viewport]>[data-part=content]{border-color:CanvasText;border-width:var(--slotted-border-width-thick, 2px)}}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
547
|
+
}
|
|
548
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlDialog, decorators: [{
|
|
549
|
+
type: Component,
|
|
550
|
+
args: [{ selector: 'sl-dialog', standalone: true, exportAs: 'slDialog', template: LAYER_TEMPLATE, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: { '[style.display]': "'contents'" }, providers: [{ provide: SlDialogBase, useExisting: forwardRef(() => SlDialog) }], styles: ["@layer slotted.components{[data-ui=dialog]{--_measure: var(--slotted-dialog-measure, 32rem);--_layer-padding: var(--slotted-space-8, 1.5rem);--_padding-inline: var(--slotted-space-8, 1.5rem);--_padding-block: var(--slotted-space-7, 1.25rem);--_header-padding-block: var(--slotted-space-6, 1rem);--_footer-padding-block: var(--slotted-space-5, .75rem);--_gap: var(--slotted-space-5, .75rem);--_rule-size: var(--slotted-border-width-thin, 1px);--_title-font-size: var(--slotted-font-size-xl, 1.125rem);--_title-line-height: var(--slotted-line-height-md, 1.5);--_description-font-size: var(--slotted-font-size-md, .875rem);--_body-font-size: var(--slotted-font-size-md, .875rem);--_icon-size: var(--slotted-control-icon-size-lg, 18px);--_inner-size: var(--slotted-control-inner-size-lg, 28px);--_close-size: max( var(--slotted-target-min, 24px), min(calc(var(--_icon-size) + 2 * var(--slotted-space-2, .25rem)), var(--_inner-size)) );--_status-size: var(--_title-font-size);--_mark-gap: var(--slotted-space-4, .5rem);--_tone-color: var(--slotted-tone-danger-text, CanvasText);position:fixed;inset:0;z-index:calc(var(--slotted-z-index-overlay, 1000) + var(--slotted-layer-depth, 0));display:grid;grid-template:minmax(0,1fr) / minmax(0,1fr);container-type:inline-size;container-name:slotted-dialog;color:var(--slotted-dialog-color, var(--slotted-text, CanvasText));font-family:var(--slotted-control-font-family, var(--slotted-font-family-sans));content-visibility:visible;transition:content-visibility var(--slotted-duration-medium) allow-discrete}[data-ui=dialog][inert]{content-visibility:hidden;pointer-events:none}[data-ui=dialog]:not([data-modal]){pointer-events:none}[data-ui=dialog]:not([data-modal])>[data-part=backdrop]{visibility:hidden}[data-ui=dialog]:not([data-modal])>[data-part=viewport]>[data-part=content]{pointer-events:auto}[data-ui=dialog][data-size=sm]{--_measure: var(--slotted-dialog-measure, 24rem);--_padding-inline: var(--slotted-space-7, 1.25rem);--_padding-block: var(--slotted-space-6, 1rem);--_header-padding-block: var(--slotted-space-5, .75rem);--_footer-padding-block: var(--slotted-space-4, .5rem);--_title-font-size: var(--slotted-font-size-lg, 1rem)}[data-ui=dialog][data-size=lg]{--_measure: var(--slotted-dialog-measure, 42rem)}[data-ui=dialog][data-size=xl]{--_measure: var(--slotted-dialog-measure, 56rem)}[data-ui=dialog][data-size=full]{--_measure: var(--slotted-dialog-measure, none)}[data-ui=dialog]>[data-part=backdrop]{grid-area:1 / 1;background:var(--slotted-dialog-scrim, var(--slotted-scrim, Canvas));opacity:0;transition:opacity var(--slotted-duration-short) var(--slotted-easing-exit)}[data-ui=dialog][data-open]>[data-part=backdrop]{opacity:1;transition:opacity var(--slotted-duration-long) var(--slotted-easing-standard)}[data-ui=dialog]>[data-part=viewport]{grid-area:1 / 1;display:grid;grid-template-columns:minmax(0,1fr);align-content:safe center;justify-items:center;padding:var(--_layer-padding);overflow:auto;overscroll-behavior:contain}[data-ui=dialog][data-placement=top]>[data-part=viewport]{align-content:safe start}[data-ui=dialog]>[data-part=viewport]>[data-part=content]{display:grid;grid-template-rows:auto minmax(0,1fr) auto;inline-size:100%;max-inline-size:var(--_measure);max-block-size:100%;background:var(--slotted-dialog-surface, var(--slotted-surface-raised, Canvas));border:var(--_rule-size) solid var(--slotted-dialog-border-color, var(--slotted-border-subtle, ButtonBorder));border-radius:var(--slotted-dialog-radius, var(--slotted-radius-lg, 8px));box-shadow:var(--slotted-shadow-lg);overflow:hidden;opacity:0;transition:opacity var(--slotted-duration-short) var(--slotted-easing-exit)}[data-ui=dialog][data-open]>[data-part=viewport]>[data-part=content]{opacity:1;transition:opacity var(--slotted-duration-long) var(--slotted-easing-standard)}[data-ui=dialog][data-scroll=viewport]>[data-part=viewport]>[data-part=content]{max-block-size:none}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]{display:grid;grid-template-columns:auto minmax(0,1fr) auto auto;align-items:start;column-gap:0;row-gap:var(--slotted-space-2, .25rem);padding-block:var(--_header-padding-block);padding-inline:var(--_padding-inline)}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>*:not([data-part=icon],[data-part=title],[data-part=description],[data-part=fullscreen],[data-part=close]){grid-column:2;justify-self:start}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>[data-part=icon]{--slotted-icon-size: var(--_status-size);grid-column:1;grid-row:1 / span 2;align-self:start;display:inline-grid;place-items:center;color:var(--_tone-color);block-size:var(--_status-size);inline-size:var(--_status-size);flex:none;margin-block-start:calc((var(--_title-font-size) * var(--_title-line-height) - var(--_status-size)) / 2);margin-inline-end:var(--_mark-gap)}[data-ui=dialog][data-tone=accent]{--_tone-color: var(--slotted-tone-accent-text, CanvasText)}[data-ui=dialog][data-tone=secondary]{--_tone-color: var(--slotted-tone-secondary-text, CanvasText)}[data-ui=dialog][data-tone=success]{--_tone-color: var(--slotted-tone-success-text, CanvasText)}[data-ui=dialog][data-tone=warning]{--_tone-color: var(--slotted-tone-warning-text, CanvasText)}[data-ui=dialog][data-tone=danger]{--_tone-color: var(--slotted-tone-danger-text, CanvasText)}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>[data-part=title]{grid-column:2;grid-row:1;margin:0;min-inline-size:0;overflow-wrap:anywhere;font-family:var( --slotted-dialog-title-font-family, var( --slotted-font-family-heading, var(--slotted-font-family-sans, ui-sans-serif, system-ui, sans-serif) ) );font-size:var(--_title-font-size);font-weight:var(--slotted-font-weight-semibold, 600);line-height:var(--_title-line-height);color:var(--slotted-dialog-title-color, var(--slotted-text, CanvasText))}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>[data-part=description]{grid-column:2;grid-row:2;margin:0;min-inline-size:0;overflow-wrap:anywhere;font-size:var(--_description-font-size);line-height:var(--slotted-line-height-md, 1.5);color:var(--slotted-dialog-description-color, var(--slotted-text-muted, GrayText))}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>[data-part=description] :is(strong,b){font-weight:var(--slotted-font-weight-semibold, 600);color:var(--slotted-dialog-title-color, var(--slotted-text, CanvasText))}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>[data-part=close]{--slotted-icon-size: var(--_icon-size);grid-column:4;grid-row:1 / span 2;align-self:start;display:inline-grid;place-items:center;block-size:var(--_close-size);inline-size:var(--_close-size);margin-inline-end:calc(-1 * (var(--_close-size) - var(--_icon-size)) / 2);margin-inline-start:var(--_gap);padding:0;appearance:none;background-color:transparent;border:0;border-radius:var(--slotted-control-radius, var(--slotted-radius-sm, 4px));color:var(--slotted-dialog-close-color, var(--slotted-text-muted, GrayText));cursor:pointer;transition:background-color var(--slotted-control-transition-duration, var(--slotted-duration-short)) var(--slotted-control-transition-easing, var(--slotted-easing-standard)),color var(--slotted-control-transition-duration, var(--slotted-duration-short)) var(--slotted-control-transition-easing, var(--slotted-easing-standard))}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>[data-part=close]:not(:disabled):hover{background-color:var( --slotted-dialog-close-hover-background, var(--slotted-tone-secondary-subtle-hover) )}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>[data-part=close]:not(:disabled):active{background-color:var( --slotted-dialog-close-active-background, var(--slotted-tone-secondary-subtle-active) )}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>[data-part=close]:focus-visible{outline:var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);outline-offset:calc(-1 * var(--slotted-focus-ring-offset, 2px))}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>[data-part=fullscreen]{--slotted-icon-size: var(--_icon-size);grid-column:3;grid-row:1 / span 2;align-self:start;display:inline-grid;place-items:center;block-size:var(--_close-size);inline-size:var(--_close-size);margin-inline-start:var(--_gap);padding:0;appearance:none;background-color:transparent;border:0;border-radius:var(--slotted-control-radius, var(--slotted-radius-sm, 4px));color:var(--slotted-dialog-close-color, var(--slotted-text-muted, GrayText));cursor:pointer;transition:background-color var(--slotted-control-transition-duration, var(--slotted-duration-short)) var(--slotted-control-transition-easing, var(--slotted-easing-standard)),color var(--slotted-control-transition-duration, var(--slotted-duration-short)) var(--slotted-control-transition-easing, var(--slotted-easing-standard))}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>[data-part=fullscreen]+[data-part=close]{margin-inline-start:0}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>[data-part=fullscreen]:not(:disabled):hover{background-color:var( --slotted-dialog-close-hover-background, var(--slotted-tone-secondary-subtle-hover) )}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>[data-part=fullscreen]:not(:disabled):active{background-color:var( --slotted-dialog-close-active-background, var(--slotted-tone-secondary-subtle-active) )}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>[data-part=fullscreen]:focus-visible{outline:var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);outline-offset:calc(-1 * var(--slotted-focus-ring-offset, 2px))}@media(pointer:coarse){[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>:is([data-part=close],[data-part=fullscreen]){position:relative}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>:is([data-part=close],[data-part=fullscreen]):before{content:\"\";inset:min(0px,calc((100% - var(--slotted-target-comfortable, 44px)) / 2));position:absolute}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>[data-part=fullscreen]:has(+[data-part=close]):before{inset-inline-end:0}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>[data-part=fullscreen]+[data-part=close]:before{inset-inline-start:0}}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=body]:not(:first-child){border-block-start:var(--_rule-size) solid var(--slotted-dialog-rule-color, var(--slotted-border-subtle, ButtonBorder))}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=body]{min-block-size:0;overflow-x:hidden;overflow-y:auto;overflow-inline:hidden;overflow-block:auto;overscroll-behavior:contain;padding-block:var(--_padding-block);padding-inline:var(--_padding-inline);font-size:var(--_body-font-size);line-height:var(--slotted-line-height-md, 1.5);color:var(--slotted-dialog-body-color, var(--slotted-text, CanvasText))}[data-ui=dialog][data-scroll=viewport]>[data-part=viewport]>[data-part=content]>[data-part=body]{overflow:visible}[data-ui=dialog][data-loading]>[data-part=viewport]>[data-part=content]>[data-part=body]{min-block-size:var(--slotted-space-12, 4rem)}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=footer]{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:var(--_gap);padding-block:var(--_footer-padding-block);padding-inline:var(--_padding-inline);background:var(--slotted-dialog-footer-surface, var(--slotted-surface-sunken, Canvas))}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=footer]:not(:first-child){border-block-start:var(--_rule-size) solid var(--slotted-dialog-rule-color, var(--slotted-border-subtle, ButtonBorder))}[data-ui=dialog][data-surface=plain]>[data-part=viewport]>[data-part=content]{display:block;background:none;border:0;border-radius:0;box-shadow:none;overflow:visible}[data-ui=dialog][data-surface=plain]>[data-part=viewport]>[data-part=content]>:is([data-part=header],[data-part=body],[data-part=footer]){background:none;border:0;padding:0}@container slotted-dialog (max-inline-size: 30rem){[data-ui=dialog][data-full-screen=narrow]>[data-part=viewport]{align-content:stretch;padding:0}[data-ui=dialog][data-full-screen=narrow]>[data-part=viewport]>[data-part=content]{max-inline-size:none;block-size:100%;border-radius:0;border:0}}[data-ui=dialog][data-full-screen=always]>[data-part=viewport],[data-ui=dialog][data-fullscreen]>[data-part=viewport]{align-content:stretch;padding:0}[data-ui=dialog][data-full-screen=always]>[data-part=viewport]>[data-part=content],[data-ui=dialog][data-fullscreen]>[data-part=viewport]>[data-part=content]{max-inline-size:none;block-size:100%;border-radius:0;border:0}@media(forced-colors:active){[data-ui=dialog]>[data-part=viewport]>[data-part=content]{border-color:CanvasText;border-width:var(--slotted-border-width-thick, 2px)}}}\n"] }]
|
|
551
|
+
}], propDecorators: { modal: [{ type: i0.Input, args: [{ isSignal: true, alias: "modal", required: false }] }], outsidePress: [{ type: i0.Input, args: [{ isSignal: true, alias: "outsidePress", required: false }] }] } });
|
|
552
|
+
/**
|
|
553
|
+
* A dialog that interrupts to confirm something irreversible.
|
|
554
|
+
*
|
|
555
|
+
* Two rules are fixed rather than left to an input: outside press never closes
|
|
556
|
+
* it, and it is always modal. Ark and React Aria make the role a prop, so a
|
|
557
|
+
* consumer who sets `role="alertdialog"` and forgets the dismissal policy ships
|
|
558
|
+
* a destructive confirmation a stray click dismisses.
|
|
559
|
+
*
|
|
560
|
+
* Focus lands on `slAlertDialogCancel` rather than on the first tabbable
|
|
561
|
+
* element, which is the APG's own advice for a step that is not easily
|
|
562
|
+
* reversible.
|
|
563
|
+
*/
|
|
564
|
+
class SlAlertDialog extends SlDialogBase {
|
|
565
|
+
member = 'alertDialog';
|
|
566
|
+
tone = input('danger', /* @ts-ignore */
|
|
567
|
+
...(ngDevMode ? [{ debugName: "tone" }] : /* istanbul ignore next */ []));
|
|
568
|
+
constructor() {
|
|
569
|
+
super();
|
|
570
|
+
/**
|
|
571
|
+
* The alert dialog pattern *requires* `aria-describedby`. A confirmation
|
|
572
|
+
* announced as a title and two buttons, with the sentence saying what is
|
|
573
|
+
* about to be destroyed left out, is the failure the requirement exists
|
|
574
|
+
* for — so it fails loudly rather than shipping.
|
|
575
|
+
*
|
|
576
|
+
* The DOM rather than the signal: projected content is created before this
|
|
577
|
+
* effect flushes, so the element is there and the signal it sets may not
|
|
578
|
+
* have been read yet.
|
|
579
|
+
*/
|
|
580
|
+
effect(() => {
|
|
581
|
+
const panel = this.panelRef()?.nativeElement;
|
|
582
|
+
if (!this.open() || panel === undefined)
|
|
583
|
+
return;
|
|
584
|
+
if (panel.querySelector('[data-part="description"]') !== null)
|
|
585
|
+
return;
|
|
586
|
+
throw new Error('sl-alert-dialog requires an element with slDialogDescription: the alertdialog pattern makes aria-describedby mandatory.');
|
|
587
|
+
});
|
|
588
|
+
}
|
|
589
|
+
toneInput() {
|
|
590
|
+
return this.tone();
|
|
591
|
+
}
|
|
592
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlAlertDialog, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
593
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: SlAlertDialog, isStandalone: true, selector: "sl-alert-dialog", inputs: { tone: { classPropertyName: "tone", publicName: "tone", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "style.display": "'contents'" } }, providers: [{ provide: SlDialogBase, useExisting: forwardRef(() => SlAlertDialog) }], exportAs: ["slAlertDialog"], usesInheritance: true, ngImport: i0, template: "\n @if (mounted()) {\n <div\n #layer\n data-ui=\"dialog\"\n data-part=\"root\"\n [attr.data-size]=\"resolvedSize()\"\n [attr.data-placement]=\"resolvedPlacement()\"\n [attr.data-scroll]=\"resolvedScroll()\"\n [attr.data-surface]=\"resolvedSurface()\"\n [attr.data-mount]=\"resolvedMount()\"\n [attr.data-full-screen]=\"resolvedFullScreen()\"\n [attr.data-fullscreen]=\"resolvedFullscreen() ? '' : null\"\n [attr.data-outside-press]=\"resolvedOutsidePress()\"\n [attr.data-tone]=\"resolvedTone()\"\n [attr.data-modal]=\"resolvedModal() ? '' : null\"\n [attr.data-open]=\"visible() ? '' : null\"\n [attr.data-loading]=\"loading() ? '' : null\"\n [attr.inert]=\"interactive() ? null : ''\"\n >\n <div data-part=\"backdrop\"></div>\n <div data-part=\"viewport\">\n <div\n #panel\n data-part=\"content\"\n [id]=\"contentId\"\n [attr.role]=\"role()\"\n [attr.aria-modal]=\"resolvedModal() ? 'true' : null\"\n [attr.aria-label]=\"label()\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-describedby]=\"describedBy()\"\n >\n <ng-content />\n </div>\n </div>\n </div>\n }", isInline: true, styles: ["@layer slotted.components{[data-ui=dialog]{--_measure: var(--slotted-dialog-measure, 32rem);--_layer-padding: var(--slotted-space-8, 1.5rem);--_padding-inline: var(--slotted-space-8, 1.5rem);--_padding-block: var(--slotted-space-7, 1.25rem);--_header-padding-block: var(--slotted-space-6, 1rem);--_footer-padding-block: var(--slotted-space-5, .75rem);--_gap: var(--slotted-space-5, .75rem);--_rule-size: var(--slotted-border-width-thin, 1px);--_title-font-size: var(--slotted-font-size-xl, 1.125rem);--_title-line-height: var(--slotted-line-height-md, 1.5);--_description-font-size: var(--slotted-font-size-md, .875rem);--_body-font-size: var(--slotted-font-size-md, .875rem);--_icon-size: var(--slotted-control-icon-size-lg, 18px);--_inner-size: var(--slotted-control-inner-size-lg, 28px);--_close-size: max( var(--slotted-target-min, 24px), min(calc(var(--_icon-size) + 2 * var(--slotted-space-2, .25rem)), var(--_inner-size)) );--_status-size: var(--_title-font-size);--_mark-gap: var(--slotted-space-4, .5rem);--_tone-color: var(--slotted-tone-danger-text, CanvasText);position:fixed;inset:0;z-index:calc(var(--slotted-z-index-overlay, 1000) + var(--slotted-layer-depth, 0));display:grid;grid-template:minmax(0,1fr) / minmax(0,1fr);container-type:inline-size;container-name:slotted-dialog;color:var(--slotted-dialog-color, var(--slotted-text, CanvasText));font-family:var(--slotted-control-font-family, var(--slotted-font-family-sans));content-visibility:visible;transition:content-visibility var(--slotted-duration-medium) allow-discrete}[data-ui=dialog][inert]{content-visibility:hidden;pointer-events:none}[data-ui=dialog]:not([data-modal]){pointer-events:none}[data-ui=dialog]:not([data-modal])>[data-part=backdrop]{visibility:hidden}[data-ui=dialog]:not([data-modal])>[data-part=viewport]>[data-part=content]{pointer-events:auto}[data-ui=dialog][data-size=sm]{--_measure: var(--slotted-dialog-measure, 24rem);--_padding-inline: var(--slotted-space-7, 1.25rem);--_padding-block: var(--slotted-space-6, 1rem);--_header-padding-block: var(--slotted-space-5, .75rem);--_footer-padding-block: var(--slotted-space-4, .5rem);--_title-font-size: var(--slotted-font-size-lg, 1rem)}[data-ui=dialog][data-size=lg]{--_measure: var(--slotted-dialog-measure, 42rem)}[data-ui=dialog][data-size=xl]{--_measure: var(--slotted-dialog-measure, 56rem)}[data-ui=dialog][data-size=full]{--_measure: var(--slotted-dialog-measure, none)}[data-ui=dialog]>[data-part=backdrop]{grid-area:1 / 1;background:var(--slotted-dialog-scrim, var(--slotted-scrim, Canvas));opacity:0;transition:opacity var(--slotted-duration-short) var(--slotted-easing-exit)}[data-ui=dialog][data-open]>[data-part=backdrop]{opacity:1;transition:opacity var(--slotted-duration-long) var(--slotted-easing-standard)}[data-ui=dialog]>[data-part=viewport]{grid-area:1 / 1;display:grid;grid-template-columns:minmax(0,1fr);align-content:safe center;justify-items:center;padding:var(--_layer-padding);overflow:auto;overscroll-behavior:contain}[data-ui=dialog][data-placement=top]>[data-part=viewport]{align-content:safe start}[data-ui=dialog]>[data-part=viewport]>[data-part=content]{display:grid;grid-template-rows:auto minmax(0,1fr) auto;inline-size:100%;max-inline-size:var(--_measure);max-block-size:100%;background:var(--slotted-dialog-surface, var(--slotted-surface-raised, Canvas));border:var(--_rule-size) solid var(--slotted-dialog-border-color, var(--slotted-border-subtle, ButtonBorder));border-radius:var(--slotted-dialog-radius, var(--slotted-radius-lg, 8px));box-shadow:var(--slotted-shadow-lg);overflow:hidden;opacity:0;transition:opacity var(--slotted-duration-short) var(--slotted-easing-exit)}[data-ui=dialog][data-open]>[data-part=viewport]>[data-part=content]{opacity:1;transition:opacity var(--slotted-duration-long) var(--slotted-easing-standard)}[data-ui=dialog][data-scroll=viewport]>[data-part=viewport]>[data-part=content]{max-block-size:none}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]{display:grid;grid-template-columns:auto minmax(0,1fr) auto auto;align-items:start;column-gap:0;row-gap:var(--slotted-space-2, .25rem);padding-block:var(--_header-padding-block);padding-inline:var(--_padding-inline)}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>*:not([data-part=icon],[data-part=title],[data-part=description],[data-part=fullscreen],[data-part=close]){grid-column:2;justify-self:start}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>[data-part=icon]{--slotted-icon-size: var(--_status-size);grid-column:1;grid-row:1 / span 2;align-self:start;display:inline-grid;place-items:center;color:var(--_tone-color);block-size:var(--_status-size);inline-size:var(--_status-size);flex:none;margin-block-start:calc((var(--_title-font-size) * var(--_title-line-height) - var(--_status-size)) / 2);margin-inline-end:var(--_mark-gap)}[data-ui=dialog][data-tone=accent]{--_tone-color: var(--slotted-tone-accent-text, CanvasText)}[data-ui=dialog][data-tone=secondary]{--_tone-color: var(--slotted-tone-secondary-text, CanvasText)}[data-ui=dialog][data-tone=success]{--_tone-color: var(--slotted-tone-success-text, CanvasText)}[data-ui=dialog][data-tone=warning]{--_tone-color: var(--slotted-tone-warning-text, CanvasText)}[data-ui=dialog][data-tone=danger]{--_tone-color: var(--slotted-tone-danger-text, CanvasText)}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>[data-part=title]{grid-column:2;grid-row:1;margin:0;min-inline-size:0;overflow-wrap:anywhere;font-family:var( --slotted-dialog-title-font-family, var( --slotted-font-family-heading, var(--slotted-font-family-sans, ui-sans-serif, system-ui, sans-serif) ) );font-size:var(--_title-font-size);font-weight:var(--slotted-font-weight-semibold, 600);line-height:var(--_title-line-height);color:var(--slotted-dialog-title-color, var(--slotted-text, CanvasText))}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>[data-part=description]{grid-column:2;grid-row:2;margin:0;min-inline-size:0;overflow-wrap:anywhere;font-size:var(--_description-font-size);line-height:var(--slotted-line-height-md, 1.5);color:var(--slotted-dialog-description-color, var(--slotted-text-muted, GrayText))}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>[data-part=description] :is(strong,b){font-weight:var(--slotted-font-weight-semibold, 600);color:var(--slotted-dialog-title-color, var(--slotted-text, CanvasText))}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>[data-part=close]{--slotted-icon-size: var(--_icon-size);grid-column:4;grid-row:1 / span 2;align-self:start;display:inline-grid;place-items:center;block-size:var(--_close-size);inline-size:var(--_close-size);margin-inline-end:calc(-1 * (var(--_close-size) - var(--_icon-size)) / 2);margin-inline-start:var(--_gap);padding:0;appearance:none;background-color:transparent;border:0;border-radius:var(--slotted-control-radius, var(--slotted-radius-sm, 4px));color:var(--slotted-dialog-close-color, var(--slotted-text-muted, GrayText));cursor:pointer;transition:background-color var(--slotted-control-transition-duration, var(--slotted-duration-short)) var(--slotted-control-transition-easing, var(--slotted-easing-standard)),color var(--slotted-control-transition-duration, var(--slotted-duration-short)) var(--slotted-control-transition-easing, var(--slotted-easing-standard))}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>[data-part=close]:not(:disabled):hover{background-color:var( --slotted-dialog-close-hover-background, var(--slotted-tone-secondary-subtle-hover) )}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>[data-part=close]:not(:disabled):active{background-color:var( --slotted-dialog-close-active-background, var(--slotted-tone-secondary-subtle-active) )}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>[data-part=close]:focus-visible{outline:var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);outline-offset:calc(-1 * var(--slotted-focus-ring-offset, 2px))}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>[data-part=fullscreen]{--slotted-icon-size: var(--_icon-size);grid-column:3;grid-row:1 / span 2;align-self:start;display:inline-grid;place-items:center;block-size:var(--_close-size);inline-size:var(--_close-size);margin-inline-start:var(--_gap);padding:0;appearance:none;background-color:transparent;border:0;border-radius:var(--slotted-control-radius, var(--slotted-radius-sm, 4px));color:var(--slotted-dialog-close-color, var(--slotted-text-muted, GrayText));cursor:pointer;transition:background-color var(--slotted-control-transition-duration, var(--slotted-duration-short)) var(--slotted-control-transition-easing, var(--slotted-easing-standard)),color var(--slotted-control-transition-duration, var(--slotted-duration-short)) var(--slotted-control-transition-easing, var(--slotted-easing-standard))}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>[data-part=fullscreen]+[data-part=close]{margin-inline-start:0}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>[data-part=fullscreen]:not(:disabled):hover{background-color:var( --slotted-dialog-close-hover-background, var(--slotted-tone-secondary-subtle-hover) )}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>[data-part=fullscreen]:not(:disabled):active{background-color:var( --slotted-dialog-close-active-background, var(--slotted-tone-secondary-subtle-active) )}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>[data-part=fullscreen]:focus-visible{outline:var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);outline-offset:calc(-1 * var(--slotted-focus-ring-offset, 2px))}@media(pointer:coarse){[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>:is([data-part=close],[data-part=fullscreen]){position:relative}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>:is([data-part=close],[data-part=fullscreen]):before{content:\"\";inset:min(0px,calc((100% - var(--slotted-target-comfortable, 44px)) / 2));position:absolute}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>[data-part=fullscreen]:has(+[data-part=close]):before{inset-inline-end:0}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>[data-part=fullscreen]+[data-part=close]:before{inset-inline-start:0}}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=body]:not(:first-child){border-block-start:var(--_rule-size) solid var(--slotted-dialog-rule-color, var(--slotted-border-subtle, ButtonBorder))}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=body]{min-block-size:0;overflow-x:hidden;overflow-y:auto;overflow-inline:hidden;overflow-block:auto;overscroll-behavior:contain;padding-block:var(--_padding-block);padding-inline:var(--_padding-inline);font-size:var(--_body-font-size);line-height:var(--slotted-line-height-md, 1.5);color:var(--slotted-dialog-body-color, var(--slotted-text, CanvasText))}[data-ui=dialog][data-scroll=viewport]>[data-part=viewport]>[data-part=content]>[data-part=body]{overflow:visible}[data-ui=dialog][data-loading]>[data-part=viewport]>[data-part=content]>[data-part=body]{min-block-size:var(--slotted-space-12, 4rem)}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=footer]{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:var(--_gap);padding-block:var(--_footer-padding-block);padding-inline:var(--_padding-inline);background:var(--slotted-dialog-footer-surface, var(--slotted-surface-sunken, Canvas))}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=footer]:not(:first-child){border-block-start:var(--_rule-size) solid var(--slotted-dialog-rule-color, var(--slotted-border-subtle, ButtonBorder))}[data-ui=dialog][data-surface=plain]>[data-part=viewport]>[data-part=content]{display:block;background:none;border:0;border-radius:0;box-shadow:none;overflow:visible}[data-ui=dialog][data-surface=plain]>[data-part=viewport]>[data-part=content]>:is([data-part=header],[data-part=body],[data-part=footer]){background:none;border:0;padding:0}@container slotted-dialog (max-inline-size: 30rem){[data-ui=dialog][data-full-screen=narrow]>[data-part=viewport]{align-content:stretch;padding:0}[data-ui=dialog][data-full-screen=narrow]>[data-part=viewport]>[data-part=content]{max-inline-size:none;block-size:100%;border-radius:0;border:0}}[data-ui=dialog][data-full-screen=always]>[data-part=viewport],[data-ui=dialog][data-fullscreen]>[data-part=viewport]{align-content:stretch;padding:0}[data-ui=dialog][data-full-screen=always]>[data-part=viewport]>[data-part=content],[data-ui=dialog][data-fullscreen]>[data-part=viewport]>[data-part=content]{max-inline-size:none;block-size:100%;border-radius:0;border:0}@media(forced-colors:active){[data-ui=dialog]>[data-part=viewport]>[data-part=content]{border-color:CanvasText;border-width:var(--slotted-border-width-thick, 2px)}}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
594
|
+
}
|
|
595
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlAlertDialog, decorators: [{
|
|
596
|
+
type: Component,
|
|
597
|
+
args: [{ selector: 'sl-alert-dialog', standalone: true, exportAs: 'slAlertDialog', template: LAYER_TEMPLATE, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: { '[style.display]': "'contents'" }, providers: [{ provide: SlDialogBase, useExisting: forwardRef(() => SlAlertDialog) }], styles: ["@layer slotted.components{[data-ui=dialog]{--_measure: var(--slotted-dialog-measure, 32rem);--_layer-padding: var(--slotted-space-8, 1.5rem);--_padding-inline: var(--slotted-space-8, 1.5rem);--_padding-block: var(--slotted-space-7, 1.25rem);--_header-padding-block: var(--slotted-space-6, 1rem);--_footer-padding-block: var(--slotted-space-5, .75rem);--_gap: var(--slotted-space-5, .75rem);--_rule-size: var(--slotted-border-width-thin, 1px);--_title-font-size: var(--slotted-font-size-xl, 1.125rem);--_title-line-height: var(--slotted-line-height-md, 1.5);--_description-font-size: var(--slotted-font-size-md, .875rem);--_body-font-size: var(--slotted-font-size-md, .875rem);--_icon-size: var(--slotted-control-icon-size-lg, 18px);--_inner-size: var(--slotted-control-inner-size-lg, 28px);--_close-size: max( var(--slotted-target-min, 24px), min(calc(var(--_icon-size) + 2 * var(--slotted-space-2, .25rem)), var(--_inner-size)) );--_status-size: var(--_title-font-size);--_mark-gap: var(--slotted-space-4, .5rem);--_tone-color: var(--slotted-tone-danger-text, CanvasText);position:fixed;inset:0;z-index:calc(var(--slotted-z-index-overlay, 1000) + var(--slotted-layer-depth, 0));display:grid;grid-template:minmax(0,1fr) / minmax(0,1fr);container-type:inline-size;container-name:slotted-dialog;color:var(--slotted-dialog-color, var(--slotted-text, CanvasText));font-family:var(--slotted-control-font-family, var(--slotted-font-family-sans));content-visibility:visible;transition:content-visibility var(--slotted-duration-medium) allow-discrete}[data-ui=dialog][inert]{content-visibility:hidden;pointer-events:none}[data-ui=dialog]:not([data-modal]){pointer-events:none}[data-ui=dialog]:not([data-modal])>[data-part=backdrop]{visibility:hidden}[data-ui=dialog]:not([data-modal])>[data-part=viewport]>[data-part=content]{pointer-events:auto}[data-ui=dialog][data-size=sm]{--_measure: var(--slotted-dialog-measure, 24rem);--_padding-inline: var(--slotted-space-7, 1.25rem);--_padding-block: var(--slotted-space-6, 1rem);--_header-padding-block: var(--slotted-space-5, .75rem);--_footer-padding-block: var(--slotted-space-4, .5rem);--_title-font-size: var(--slotted-font-size-lg, 1rem)}[data-ui=dialog][data-size=lg]{--_measure: var(--slotted-dialog-measure, 42rem)}[data-ui=dialog][data-size=xl]{--_measure: var(--slotted-dialog-measure, 56rem)}[data-ui=dialog][data-size=full]{--_measure: var(--slotted-dialog-measure, none)}[data-ui=dialog]>[data-part=backdrop]{grid-area:1 / 1;background:var(--slotted-dialog-scrim, var(--slotted-scrim, Canvas));opacity:0;transition:opacity var(--slotted-duration-short) var(--slotted-easing-exit)}[data-ui=dialog][data-open]>[data-part=backdrop]{opacity:1;transition:opacity var(--slotted-duration-long) var(--slotted-easing-standard)}[data-ui=dialog]>[data-part=viewport]{grid-area:1 / 1;display:grid;grid-template-columns:minmax(0,1fr);align-content:safe center;justify-items:center;padding:var(--_layer-padding);overflow:auto;overscroll-behavior:contain}[data-ui=dialog][data-placement=top]>[data-part=viewport]{align-content:safe start}[data-ui=dialog]>[data-part=viewport]>[data-part=content]{display:grid;grid-template-rows:auto minmax(0,1fr) auto;inline-size:100%;max-inline-size:var(--_measure);max-block-size:100%;background:var(--slotted-dialog-surface, var(--slotted-surface-raised, Canvas));border:var(--_rule-size) solid var(--slotted-dialog-border-color, var(--slotted-border-subtle, ButtonBorder));border-radius:var(--slotted-dialog-radius, var(--slotted-radius-lg, 8px));box-shadow:var(--slotted-shadow-lg);overflow:hidden;opacity:0;transition:opacity var(--slotted-duration-short) var(--slotted-easing-exit)}[data-ui=dialog][data-open]>[data-part=viewport]>[data-part=content]{opacity:1;transition:opacity var(--slotted-duration-long) var(--slotted-easing-standard)}[data-ui=dialog][data-scroll=viewport]>[data-part=viewport]>[data-part=content]{max-block-size:none}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]{display:grid;grid-template-columns:auto minmax(0,1fr) auto auto;align-items:start;column-gap:0;row-gap:var(--slotted-space-2, .25rem);padding-block:var(--_header-padding-block);padding-inline:var(--_padding-inline)}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>*:not([data-part=icon],[data-part=title],[data-part=description],[data-part=fullscreen],[data-part=close]){grid-column:2;justify-self:start}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>[data-part=icon]{--slotted-icon-size: var(--_status-size);grid-column:1;grid-row:1 / span 2;align-self:start;display:inline-grid;place-items:center;color:var(--_tone-color);block-size:var(--_status-size);inline-size:var(--_status-size);flex:none;margin-block-start:calc((var(--_title-font-size) * var(--_title-line-height) - var(--_status-size)) / 2);margin-inline-end:var(--_mark-gap)}[data-ui=dialog][data-tone=accent]{--_tone-color: var(--slotted-tone-accent-text, CanvasText)}[data-ui=dialog][data-tone=secondary]{--_tone-color: var(--slotted-tone-secondary-text, CanvasText)}[data-ui=dialog][data-tone=success]{--_tone-color: var(--slotted-tone-success-text, CanvasText)}[data-ui=dialog][data-tone=warning]{--_tone-color: var(--slotted-tone-warning-text, CanvasText)}[data-ui=dialog][data-tone=danger]{--_tone-color: var(--slotted-tone-danger-text, CanvasText)}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>[data-part=title]{grid-column:2;grid-row:1;margin:0;min-inline-size:0;overflow-wrap:anywhere;font-family:var( --slotted-dialog-title-font-family, var( --slotted-font-family-heading, var(--slotted-font-family-sans, ui-sans-serif, system-ui, sans-serif) ) );font-size:var(--_title-font-size);font-weight:var(--slotted-font-weight-semibold, 600);line-height:var(--_title-line-height);color:var(--slotted-dialog-title-color, var(--slotted-text, CanvasText))}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>[data-part=description]{grid-column:2;grid-row:2;margin:0;min-inline-size:0;overflow-wrap:anywhere;font-size:var(--_description-font-size);line-height:var(--slotted-line-height-md, 1.5);color:var(--slotted-dialog-description-color, var(--slotted-text-muted, GrayText))}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>[data-part=description] :is(strong,b){font-weight:var(--slotted-font-weight-semibold, 600);color:var(--slotted-dialog-title-color, var(--slotted-text, CanvasText))}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>[data-part=close]{--slotted-icon-size: var(--_icon-size);grid-column:4;grid-row:1 / span 2;align-self:start;display:inline-grid;place-items:center;block-size:var(--_close-size);inline-size:var(--_close-size);margin-inline-end:calc(-1 * (var(--_close-size) - var(--_icon-size)) / 2);margin-inline-start:var(--_gap);padding:0;appearance:none;background-color:transparent;border:0;border-radius:var(--slotted-control-radius, var(--slotted-radius-sm, 4px));color:var(--slotted-dialog-close-color, var(--slotted-text-muted, GrayText));cursor:pointer;transition:background-color var(--slotted-control-transition-duration, var(--slotted-duration-short)) var(--slotted-control-transition-easing, var(--slotted-easing-standard)),color var(--slotted-control-transition-duration, var(--slotted-duration-short)) var(--slotted-control-transition-easing, var(--slotted-easing-standard))}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>[data-part=close]:not(:disabled):hover{background-color:var( --slotted-dialog-close-hover-background, var(--slotted-tone-secondary-subtle-hover) )}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>[data-part=close]:not(:disabled):active{background-color:var( --slotted-dialog-close-active-background, var(--slotted-tone-secondary-subtle-active) )}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>[data-part=close]:focus-visible{outline:var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);outline-offset:calc(-1 * var(--slotted-focus-ring-offset, 2px))}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>[data-part=fullscreen]{--slotted-icon-size: var(--_icon-size);grid-column:3;grid-row:1 / span 2;align-self:start;display:inline-grid;place-items:center;block-size:var(--_close-size);inline-size:var(--_close-size);margin-inline-start:var(--_gap);padding:0;appearance:none;background-color:transparent;border:0;border-radius:var(--slotted-control-radius, var(--slotted-radius-sm, 4px));color:var(--slotted-dialog-close-color, var(--slotted-text-muted, GrayText));cursor:pointer;transition:background-color var(--slotted-control-transition-duration, var(--slotted-duration-short)) var(--slotted-control-transition-easing, var(--slotted-easing-standard)),color var(--slotted-control-transition-duration, var(--slotted-duration-short)) var(--slotted-control-transition-easing, var(--slotted-easing-standard))}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>[data-part=fullscreen]+[data-part=close]{margin-inline-start:0}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>[data-part=fullscreen]:not(:disabled):hover{background-color:var( --slotted-dialog-close-hover-background, var(--slotted-tone-secondary-subtle-hover) )}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>[data-part=fullscreen]:not(:disabled):active{background-color:var( --slotted-dialog-close-active-background, var(--slotted-tone-secondary-subtle-active) )}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>[data-part=fullscreen]:focus-visible{outline:var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);outline-offset:calc(-1 * var(--slotted-focus-ring-offset, 2px))}@media(pointer:coarse){[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>:is([data-part=close],[data-part=fullscreen]){position:relative}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>:is([data-part=close],[data-part=fullscreen]):before{content:\"\";inset:min(0px,calc((100% - var(--slotted-target-comfortable, 44px)) / 2));position:absolute}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>[data-part=fullscreen]:has(+[data-part=close]):before{inset-inline-end:0}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=header]>[data-part=fullscreen]+[data-part=close]:before{inset-inline-start:0}}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=body]:not(:first-child){border-block-start:var(--_rule-size) solid var(--slotted-dialog-rule-color, var(--slotted-border-subtle, ButtonBorder))}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=body]{min-block-size:0;overflow-x:hidden;overflow-y:auto;overflow-inline:hidden;overflow-block:auto;overscroll-behavior:contain;padding-block:var(--_padding-block);padding-inline:var(--_padding-inline);font-size:var(--_body-font-size);line-height:var(--slotted-line-height-md, 1.5);color:var(--slotted-dialog-body-color, var(--slotted-text, CanvasText))}[data-ui=dialog][data-scroll=viewport]>[data-part=viewport]>[data-part=content]>[data-part=body]{overflow:visible}[data-ui=dialog][data-loading]>[data-part=viewport]>[data-part=content]>[data-part=body]{min-block-size:var(--slotted-space-12, 4rem)}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=footer]{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:var(--_gap);padding-block:var(--_footer-padding-block);padding-inline:var(--_padding-inline);background:var(--slotted-dialog-footer-surface, var(--slotted-surface-sunken, Canvas))}[data-ui=dialog]>[data-part=viewport]>[data-part=content]>[data-part=footer]:not(:first-child){border-block-start:var(--_rule-size) solid var(--slotted-dialog-rule-color, var(--slotted-border-subtle, ButtonBorder))}[data-ui=dialog][data-surface=plain]>[data-part=viewport]>[data-part=content]{display:block;background:none;border:0;border-radius:0;box-shadow:none;overflow:visible}[data-ui=dialog][data-surface=plain]>[data-part=viewport]>[data-part=content]>:is([data-part=header],[data-part=body],[data-part=footer]){background:none;border:0;padding:0}@container slotted-dialog (max-inline-size: 30rem){[data-ui=dialog][data-full-screen=narrow]>[data-part=viewport]{align-content:stretch;padding:0}[data-ui=dialog][data-full-screen=narrow]>[data-part=viewport]>[data-part=content]{max-inline-size:none;block-size:100%;border-radius:0;border:0}}[data-ui=dialog][data-full-screen=always]>[data-part=viewport],[data-ui=dialog][data-fullscreen]>[data-part=viewport]{align-content:stretch;padding:0}[data-ui=dialog][data-full-screen=always]>[data-part=viewport]>[data-part=content],[data-ui=dialog][data-fullscreen]>[data-part=viewport]>[data-part=content]{max-inline-size:none;block-size:100%;border-radius:0;border:0}@media(forced-colors:active){[data-ui=dialog]>[data-part=viewport]>[data-part=content]{border-color:CanvasText;border-width:var(--slotted-border-width-thick, 2px)}}}\n"] }]
|
|
598
|
+
}], ctorParameters: () => [], propDecorators: { tone: [{ type: i0.Input, args: [{ isSignal: true, alias: "tone", required: false }] }] } });
|
|
599
|
+
|
|
600
|
+
/**
|
|
601
|
+
* A click synthesised by the keyboard reports no detail; a real one reports the
|
|
602
|
+
* click count. It is how `Enter`, `Space` and a pointer are told apart without
|
|
603
|
+
* a key listener existing for something the platform already handles.
|
|
604
|
+
*/
|
|
605
|
+
function activationReason(event) {
|
|
606
|
+
return event.detail === 0 ? 'keyboard' : 'pointer';
|
|
607
|
+
}
|
|
608
|
+
/**
|
|
609
|
+
* The part a control names. On an element another family draws — `slButton` —
|
|
610
|
+
* that family's root stays its part: two directives write one attribute, and
|
|
611
|
+
* the family the element is drawn by keeps it, as React's `render` does by
|
|
612
|
+
* spreading the button's props last.
|
|
613
|
+
*/
|
|
614
|
+
function ownPart(native, part) {
|
|
615
|
+
return native.hasAttribute('data-ui') ? native.getAttribute('data-part') : part;
|
|
616
|
+
}
|
|
617
|
+
/**
|
|
618
|
+
* The control that opens a layer.
|
|
619
|
+
*
|
|
620
|
+
* It is the consumer's own element, which is what this ecosystem composes with:
|
|
621
|
+
* `<button slButton slDialogTrigger [dialog]="d">` is the library's own button
|
|
622
|
+
* and this adds the wiring to it. React reaches the same place with `render`,
|
|
623
|
+
* because there the component owns the tag.
|
|
624
|
+
*
|
|
625
|
+
* The trigger is also the layer's *branch*: a press on it is inside the layer
|
|
626
|
+
* as far as `dismissable-layer` is concerned, or opening would immediately be
|
|
627
|
+
* read as an outside press and close what it just opened.
|
|
628
|
+
*/
|
|
629
|
+
class SlDialogTrigger {
|
|
630
|
+
/** The layer this control opens, reached with a template reference variable. */
|
|
631
|
+
dialog = input.required({ ...(ngDevMode ? { debugName: "dialog" } : /* istanbul ignore next */ {}), alias: 'slDialogTrigger' });
|
|
632
|
+
native = inject(ElementRef).nativeElement;
|
|
633
|
+
/** `trigger`, unless the element is another family's root. */
|
|
634
|
+
part = ownPart(this.native, 'trigger');
|
|
635
|
+
controls = computed(() => this.dialog().mounted() ? this.dialog().contentId : null, /* @ts-ignore */
|
|
636
|
+
...(ngDevMode ? [{ debugName: "controls" }] : /* istanbul ignore next */ []));
|
|
637
|
+
ngOnInit() {
|
|
638
|
+
this.dialog().triggerNode.set(this.native);
|
|
639
|
+
}
|
|
640
|
+
ngOnDestroy() {
|
|
641
|
+
if (this.dialog().triggerNode() === this.native)
|
|
642
|
+
this.dialog().triggerNode.set(null);
|
|
643
|
+
}
|
|
644
|
+
press(event) {
|
|
645
|
+
/* The consumer's own handler ran first, and `preventDefault()` refuses the
|
|
646
|
+
open — composed with, never replaced. */
|
|
647
|
+
if (event.defaultPrevented)
|
|
648
|
+
return;
|
|
649
|
+
this.dialog().request(true, activationReason(event), undefined, event);
|
|
650
|
+
}
|
|
651
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlDialogTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
652
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.7", type: SlDialogTrigger, isStandalone: true, selector: "[slDialogTrigger]", inputs: { dialog: { classPropertyName: "dialog", publicName: "slDialogTrigger", isSignal: true, isRequired: true, transformFunction: null } }, host: { attributes: { "type": "button" }, listeners: { "click": "press($event)" }, properties: { "attr.data-part": "part", "attr.aria-haspopup": "'dialog'", "attr.aria-expanded": "dialog().open()", "attr.aria-controls": "controls()", "attr.data-open": "dialog().open() ? '' : null", "id": "dialog().triggerId" } }, exportAs: ["slDialogTrigger"], ngImport: i0 });
|
|
653
|
+
}
|
|
654
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlDialogTrigger, decorators: [{
|
|
655
|
+
type: Directive,
|
|
656
|
+
args: [{
|
|
657
|
+
selector: '[slDialogTrigger]',
|
|
658
|
+
standalone: true,
|
|
659
|
+
exportAs: 'slDialogTrigger',
|
|
660
|
+
host: {
|
|
661
|
+
'[attr.data-part]': 'part',
|
|
662
|
+
type: 'button',
|
|
663
|
+
'[attr.aria-haspopup]': "'dialog'",
|
|
664
|
+
'[attr.aria-expanded]': 'dialog().open()',
|
|
665
|
+
'[attr.aria-controls]': 'controls()',
|
|
666
|
+
'[attr.data-open]': "dialog().open() ? '' : null",
|
|
667
|
+
'[id]': 'dialog().triggerId',
|
|
668
|
+
'(click)': 'press($event)',
|
|
669
|
+
},
|
|
670
|
+
}]
|
|
671
|
+
}], propDecorators: { dialog: [{ type: i0.Input, args: [{ isSignal: true, alias: "slDialogTrigger", required: true }] }] } });
|
|
672
|
+
/**
|
|
673
|
+
* The header, and the one part of it the family renders rather than the
|
|
674
|
+
* consumer: the full-screen toggle, when the layer was asked for one.
|
|
675
|
+
*
|
|
676
|
+
* It is written in the DOM after whatever the consumer projected. The title
|
|
677
|
+
* and the description come first for a reader moving through the header, and
|
|
678
|
+
* the two corner controls are adjacent peers whose order carries no meaning —
|
|
679
|
+
* a toggle written first would be announced ahead of the name of the dialog it
|
|
680
|
+
* belongs to. The stylesheet puts it in the column before the close, which is
|
|
681
|
+
* where a window's controls put it.
|
|
682
|
+
*
|
|
683
|
+
* It is a component on the consumer's own `<header>`, so the toggle is a child
|
|
684
|
+
* of that element written after the projected content, which is the DOM React
|
|
685
|
+
* reaches by rendering the part; the two have to land together.
|
|
686
|
+
*
|
|
687
|
+
* `aria-pressed` says which way the toggle is set, so the name stays one word
|
|
688
|
+
* in every state: a label that changed with the state would be read as a
|
|
689
|
+
* second control. The mark is the opposite of the state, because a mark on a
|
|
690
|
+
* control says what pressing it does.
|
|
691
|
+
*/
|
|
692
|
+
class SlDialogHeader {
|
|
693
|
+
dialog = inject(SlDialogBase);
|
|
694
|
+
toggle(event) {
|
|
695
|
+
if (event.defaultPrevented)
|
|
696
|
+
return;
|
|
697
|
+
this.dialog.requestFullscreen(!this.dialog.resolvedFullscreen(), activationReason(event) === 'keyboard' ? 'keyboard' : 'pointer', event);
|
|
698
|
+
}
|
|
699
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlDialogHeader, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
700
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: SlDialogHeader, isStandalone: true, selector: "[slDialogHeader]", host: { attributes: { "data-part": "header" } }, exportAs: ["slDialogHeader"], ngImport: i0, template: `<ng-content />
|
|
701
|
+
@if (dialog.resolvedFullscreenToggle()) {
|
|
702
|
+
<button
|
|
703
|
+
type="button"
|
|
704
|
+
data-part="fullscreen"
|
|
705
|
+
[attr.aria-label]="dialog.t('fullScreen')"
|
|
706
|
+
[attr.aria-pressed]="dialog.resolvedFullscreen()"
|
|
707
|
+
(click)="toggle($event)"
|
|
708
|
+
>
|
|
709
|
+
<span slIcon
|
|
710
|
+
><svg slGlyph [name]="dialog.resolvedFullscreen() ? 'minimize' : 'maximize'"></svg
|
|
711
|
+
></span>
|
|
712
|
+
</button>
|
|
713
|
+
}`, isInline: true, 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 });
|
|
714
|
+
}
|
|
715
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlDialogHeader, decorators: [{
|
|
716
|
+
type: Component,
|
|
717
|
+
args: [{
|
|
718
|
+
selector: '[slDialogHeader]',
|
|
719
|
+
standalone: true,
|
|
720
|
+
exportAs: 'slDialogHeader',
|
|
721
|
+
imports: [SlGlyph, SlIcon],
|
|
722
|
+
template: `<ng-content />
|
|
723
|
+
@if (dialog.resolvedFullscreenToggle()) {
|
|
724
|
+
<button
|
|
725
|
+
type="button"
|
|
726
|
+
data-part="fullscreen"
|
|
727
|
+
[attr.aria-label]="dialog.t('fullScreen')"
|
|
728
|
+
[attr.aria-pressed]="dialog.resolvedFullscreen()"
|
|
729
|
+
(click)="toggle($event)"
|
|
730
|
+
>
|
|
731
|
+
<span slIcon
|
|
732
|
+
><svg slGlyph [name]="dialog.resolvedFullscreen() ? 'minimize' : 'maximize'"></svg
|
|
733
|
+
></span>
|
|
734
|
+
</button>
|
|
735
|
+
}`,
|
|
736
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
737
|
+
host: { 'data-part': 'header' },
|
|
738
|
+
}]
|
|
739
|
+
}] });
|
|
740
|
+
/** The visible name, which `aria-labelledby` points at. */
|
|
741
|
+
class SlDialogTitle {
|
|
742
|
+
dialog = inject(SlDialogBase);
|
|
743
|
+
ngOnInit() {
|
|
744
|
+
this.dialog.hasTitle.set(true);
|
|
745
|
+
}
|
|
746
|
+
ngOnDestroy() {
|
|
747
|
+
this.dialog.hasTitle.set(false);
|
|
748
|
+
}
|
|
749
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlDialogTitle, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
750
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.7", type: SlDialogTitle, isStandalone: true, selector: "[slDialogTitle]", host: { attributes: { "data-part": "title" }, properties: { "id": "dialog.titleId" } }, exportAs: ["slDialogTitle"], ngImport: i0 });
|
|
751
|
+
}
|
|
752
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlDialogTitle, decorators: [{
|
|
753
|
+
type: Directive,
|
|
754
|
+
args: [{
|
|
755
|
+
selector: '[slDialogTitle]',
|
|
756
|
+
standalone: true,
|
|
757
|
+
exportAs: 'slDialogTitle',
|
|
758
|
+
host: { 'data-part': 'title', '[id]': 'dialog.titleId' },
|
|
759
|
+
}]
|
|
760
|
+
}] });
|
|
761
|
+
/**
|
|
762
|
+
* The sentence that says what the dialog is about. The alert dialog pattern
|
|
763
|
+
* makes it mandatory; the modal dialog pattern makes it optional and advises
|
|
764
|
+
* against it for structured content.
|
|
765
|
+
*/
|
|
766
|
+
class SlDialogDescription {
|
|
767
|
+
dialog = inject(SlDialogBase);
|
|
768
|
+
ngOnInit() {
|
|
769
|
+
this.dialog.hasDescription.set(true);
|
|
770
|
+
}
|
|
771
|
+
ngOnDestroy() {
|
|
772
|
+
this.dialog.hasDescription.set(false);
|
|
773
|
+
}
|
|
774
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlDialogDescription, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
775
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.7", type: SlDialogDescription, isStandalone: true, selector: "[slDialogDescription]", host: { attributes: { "data-part": "description" }, properties: { "id": "dialog.descriptionId" } }, exportAs: ["slDialogDescription"], ngImport: i0 });
|
|
776
|
+
}
|
|
777
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlDialogDescription, decorators: [{
|
|
778
|
+
type: Directive,
|
|
779
|
+
args: [{
|
|
780
|
+
selector: '[slDialogDescription]',
|
|
781
|
+
standalone: true,
|
|
782
|
+
exportAs: 'slDialogDescription',
|
|
783
|
+
host: { 'data-part': 'description', '[id]': 'dialog.descriptionId' },
|
|
784
|
+
}]
|
|
785
|
+
}] });
|
|
786
|
+
/**
|
|
787
|
+
* The one row that scrolls, and the row `aria-busy` belongs to while the
|
|
788
|
+
* content is still on its way — the header, the close button and Escape all
|
|
789
|
+
* stay operable, because a loading dialog a reader cannot leave is the worse
|
|
790
|
+
* failure of the two.
|
|
791
|
+
*/
|
|
792
|
+
class SlDialogBody {
|
|
793
|
+
dialog = inject(SlDialogBase);
|
|
794
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlDialogBody, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
795
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.7", type: SlDialogBody, isStandalone: true, selector: "[slDialogBody]", host: { attributes: { "data-part": "body" }, properties: { "attr.aria-busy": "dialog.loading() ? 'true' : null" } }, exportAs: ["slDialogBody"], ngImport: i0 });
|
|
796
|
+
}
|
|
797
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlDialogBody, decorators: [{
|
|
798
|
+
type: Directive,
|
|
799
|
+
args: [{
|
|
800
|
+
selector: '[slDialogBody]',
|
|
801
|
+
standalone: true,
|
|
802
|
+
exportAs: 'slDialogBody',
|
|
803
|
+
host: { 'data-part': 'body', '[attr.aria-busy]': "dialog.loading() ? 'true' : null" },
|
|
804
|
+
}]
|
|
805
|
+
}] });
|
|
806
|
+
class SlDialogFooter {
|
|
807
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlDialogFooter, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
808
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.7", type: SlDialogFooter, isStandalone: true, selector: "[slDialogFooter]", host: { attributes: { "data-part": "footer" } }, exportAs: ["slDialogFooter"], ngImport: i0 });
|
|
809
|
+
}
|
|
810
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlDialogFooter, decorators: [{
|
|
811
|
+
type: Directive,
|
|
812
|
+
args: [{
|
|
813
|
+
selector: '[slDialogFooter]',
|
|
814
|
+
standalone: true,
|
|
815
|
+
exportAs: 'slDialogFooter',
|
|
816
|
+
host: { 'data-part': 'footer' },
|
|
817
|
+
}]
|
|
818
|
+
}] });
|
|
819
|
+
/**
|
|
820
|
+
* The ✕ in the corner. It carries `dismiss`, which is the word the closed
|
|
821
|
+
* vocabulary in `docs/state-and-events.md` already has for what a close button
|
|
822
|
+
* means; `docs/component-features.md` §8 calls the source `closeButton`, and a
|
|
823
|
+
* twelfth reason would be a change to a contract outside this family.
|
|
824
|
+
*/
|
|
825
|
+
class SlDialogClose {
|
|
826
|
+
/** The result the close carries out, which is the platform's `returnValue`. */
|
|
827
|
+
value = input(undefined, /* @ts-ignore */
|
|
828
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
829
|
+
dialog = inject(SlDialogBase);
|
|
830
|
+
/** A consumer's own `aria-label`, which wins over the catalog. */
|
|
831
|
+
ownLabel = inject(new HostAttributeToken('aria-label'), { optional: true });
|
|
832
|
+
label = computed(() => this.ownLabel ?? this.dialog.t('close'), /* @ts-ignore */
|
|
833
|
+
...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
834
|
+
constructor() {
|
|
835
|
+
if (this.dialog.isAlert()) {
|
|
836
|
+
throw new Error('sl-alert-dialog has no close part: a confirmation is answered with slAlertDialogCancel or slAlertDialogAction, not dismissed by an ✕.');
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
press(event) {
|
|
840
|
+
if (event.defaultPrevented)
|
|
841
|
+
return;
|
|
842
|
+
this.dialog.request(false, 'dismiss', this.value(), event);
|
|
843
|
+
}
|
|
844
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlDialogClose, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
845
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.7", type: SlDialogClose, isStandalone: true, selector: "[slDialogClose]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-part": "close", "type": "button" }, listeners: { "click": "press($event)" }, properties: { "attr.aria-label": "label()" } }, exportAs: ["slDialogClose"], ngImport: i0, template: `<ng-content
|
|
846
|
+
><span slIcon><svg slGlyph name="x"></svg></span
|
|
847
|
+
></ng-content>`, isInline: true, 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 });
|
|
848
|
+
}
|
|
849
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlDialogClose, decorators: [{
|
|
850
|
+
type: Component,
|
|
851
|
+
args: [{
|
|
852
|
+
selector: '[slDialogClose]',
|
|
853
|
+
standalone: true,
|
|
854
|
+
exportAs: 'slDialogClose',
|
|
855
|
+
imports: [SlGlyph, SlIcon],
|
|
856
|
+
/* The cross is drawn unless the consumer wrote content of their own. */
|
|
857
|
+
template: `<ng-content
|
|
858
|
+
><span slIcon><svg slGlyph name="x"></svg></span
|
|
859
|
+
></ng-content>`,
|
|
860
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
861
|
+
host: {
|
|
862
|
+
'data-part': 'close',
|
|
863
|
+
type: 'button',
|
|
864
|
+
'[attr.aria-label]': 'label()',
|
|
865
|
+
'(click)': 'press($event)',
|
|
866
|
+
},
|
|
867
|
+
}]
|
|
868
|
+
}], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }] } });
|
|
869
|
+
/**
|
|
870
|
+
* The glyph each tone draws, and a triangle where no tone was resolved. Warning
|
|
871
|
+
* and danger differ in silhouette as well as colour, because under forced
|
|
872
|
+
* colours the silhouette is all that is left.
|
|
873
|
+
*/
|
|
874
|
+
const TONE_GLYPH = {
|
|
875
|
+
accent: 'circle-info',
|
|
876
|
+
secondary: 'circle-info',
|
|
877
|
+
success: 'circle-check',
|
|
878
|
+
warning: 'triangle-alert',
|
|
879
|
+
danger: 'circle-alert',
|
|
880
|
+
};
|
|
881
|
+
/**
|
|
882
|
+
* The tone's own mark, which is geometry rather than a character. A mark the
|
|
883
|
+
* consumer writes as content replaces the tone's.
|
|
884
|
+
*/
|
|
885
|
+
class SlAlertDialogIcon {
|
|
886
|
+
dialog = inject(SlDialogBase);
|
|
887
|
+
glyph = computed(() => {
|
|
888
|
+
const tone = this.dialog.resolvedTone();
|
|
889
|
+
return tone === null ? 'triangle-alert' : TONE_GLYPH[tone];
|
|
890
|
+
}, /* @ts-ignore */
|
|
891
|
+
...(ngDevMode ? [{ debugName: "glyph" }] : /* istanbul ignore next */ []));
|
|
892
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlAlertDialogIcon, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
893
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.7", type: SlAlertDialogIcon, isStandalone: true, selector: "[slAlertDialogIcon]", host: { attributes: { "data-part": "icon", "aria-hidden": "true" } }, exportAs: ["slAlertDialogIcon"], ngImport: i0, template: `<ng-content
|
|
894
|
+
><span slIcon><svg slGlyph [name]="glyph()"></svg></span
|
|
895
|
+
></ng-content>`, isInline: true, 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 });
|
|
896
|
+
}
|
|
897
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlAlertDialogIcon, decorators: [{
|
|
898
|
+
type: Component,
|
|
899
|
+
args: [{
|
|
900
|
+
selector: '[slAlertDialogIcon]',
|
|
901
|
+
standalone: true,
|
|
902
|
+
exportAs: 'slAlertDialogIcon',
|
|
903
|
+
imports: [SlGlyph, SlIcon],
|
|
904
|
+
template: `<ng-content
|
|
905
|
+
><span slIcon><svg slGlyph [name]="glyph()"></svg></span
|
|
906
|
+
></ng-content>`,
|
|
907
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
908
|
+
host: { 'data-part': 'icon', 'aria-hidden': 'true' },
|
|
909
|
+
}]
|
|
910
|
+
}] });
|
|
911
|
+
/**
|
|
912
|
+
* The least destructive action, and where focus lands when the layer opens.
|
|
913
|
+
* That is the APG's own advice for a step that is not easily reversible, and it
|
|
914
|
+
* is a default of the member rather than something a consumer remembers.
|
|
915
|
+
*/
|
|
916
|
+
class SlAlertDialogCancel {
|
|
917
|
+
value = input('cancel', /* @ts-ignore */
|
|
918
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
919
|
+
dialog = inject(SlDialogBase);
|
|
920
|
+
native = inject(ElementRef).nativeElement;
|
|
921
|
+
/** `cancel`, unless the element is another family's root. */
|
|
922
|
+
part = ownPart(this.native, 'cancel');
|
|
923
|
+
ngOnInit() {
|
|
924
|
+
this.dialog.cancelNode.set(this.native);
|
|
925
|
+
}
|
|
926
|
+
ngOnDestroy() {
|
|
927
|
+
if (this.dialog.cancelNode() === this.native)
|
|
928
|
+
this.dialog.cancelNode.set(null);
|
|
929
|
+
}
|
|
930
|
+
press(event) {
|
|
931
|
+
if (event.defaultPrevented)
|
|
932
|
+
return;
|
|
933
|
+
this.dialog.request(false, 'dismiss', this.value(), event);
|
|
934
|
+
}
|
|
935
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlAlertDialogCancel, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
936
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.7", type: SlAlertDialogCancel, isStandalone: true, selector: "[slAlertDialogCancel]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "type": "button" }, listeners: { "click": "press($event)" }, properties: { "attr.data-part": "part" } }, exportAs: ["slAlertDialogCancel"], ngImport: i0 });
|
|
937
|
+
}
|
|
938
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlAlertDialogCancel, decorators: [{
|
|
939
|
+
type: Directive,
|
|
940
|
+
args: [{
|
|
941
|
+
selector: '[slAlertDialogCancel]',
|
|
942
|
+
standalone: true,
|
|
943
|
+
exportAs: 'slAlertDialogCancel',
|
|
944
|
+
host: { '[attr.data-part]': 'part', type: 'button', '(click)': 'press($event)' },
|
|
945
|
+
}]
|
|
946
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }] } });
|
|
947
|
+
/**
|
|
948
|
+
* The action being confirmed. It carries `submit`, because confirming is what
|
|
949
|
+
* the reader came to do, and `dismiss` is what the other two controls mean.
|
|
950
|
+
*/
|
|
951
|
+
class SlAlertDialogAction {
|
|
952
|
+
value = input('confirm', /* @ts-ignore */
|
|
953
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
954
|
+
dialog = inject(SlDialogBase);
|
|
955
|
+
/** `action`, unless the element is another family's root. */
|
|
956
|
+
part = ownPart(inject(ElementRef).nativeElement, 'action');
|
|
957
|
+
press(event) {
|
|
958
|
+
if (event.defaultPrevented)
|
|
959
|
+
return;
|
|
960
|
+
this.dialog.request(false, 'submit', this.value(), event);
|
|
961
|
+
}
|
|
962
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlAlertDialogAction, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
963
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.7", type: SlAlertDialogAction, isStandalone: true, selector: "[slAlertDialogAction]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "type": "button" }, listeners: { "click": "press($event)" }, properties: { "attr.data-part": "part" } }, exportAs: ["slAlertDialogAction"], ngImport: i0 });
|
|
964
|
+
}
|
|
965
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlAlertDialogAction, decorators: [{
|
|
966
|
+
type: Directive,
|
|
967
|
+
args: [{
|
|
968
|
+
selector: '[slAlertDialogAction]',
|
|
969
|
+
standalone: true,
|
|
970
|
+
exportAs: 'slAlertDialogAction',
|
|
971
|
+
host: { '[attr.data-part]': 'part', type: 'button', '(click)': 'press($event)' },
|
|
972
|
+
}]
|
|
973
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }] } });
|
|
974
|
+
|
|
975
|
+
/**
|
|
976
|
+
* Generated bundle index. Do not edit.
|
|
977
|
+
*/
|
|
978
|
+
|
|
979
|
+
export { DIALOG_DEFAULTS, SlAlertDialog, SlAlertDialogAction, SlAlertDialogCancel, SlAlertDialogIcon, SlDialog, SlDialogBase, SlDialogBody, SlDialogClose, SlDialogDescription, SlDialogFooter, SlDialogHeader, SlDialogIdFactory, SlDialogTitle, SlDialogTrigger, injectDialogDefaults, provideDialogDefaults };
|
|
980
|
+
//# sourceMappingURL=slotted-angular-dialog.mjs.map
|