@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,1928 @@
|
|
|
1
|
+
import { NgTemplateOutlet } from '@angular/common';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { InjectionToken, inject, Injectable, numberAttribute, booleanAttribute, Directive, input, ElementRef, afterNextRender, output, viewChild, contentChild, signal, effect, untracked, DestroyRef, ViewEncapsulation, ChangeDetectionStrategy, Component, model, contentChildren, computed, afterEveryRender } from '@angular/core';
|
|
4
|
+
import { SlButton, SlButtonStart, SlIconButton } from '@slotted/angular/button';
|
|
5
|
+
import { SlCard, SlCardActions, SlCardBody, SlCardFooter, SlCardHeader } from '@slotted/angular/card';
|
|
6
|
+
import { injectMessages } from '@slotted/angular/i18n';
|
|
7
|
+
import { SlGlyph, SlIcon } from '@slotted/angular/icon';
|
|
8
|
+
import { SlMenu, SlMenuItem, SlMenuSeparator, SlMenuTrigger } from '@slotted/angular/menu';
|
|
9
|
+
import { SlResultState, SlResultStateActions, SlResultStateContent, SlResultStateDescription, SlResultStateTitle } from '@slotted/angular/result-state';
|
|
10
|
+
import { injectSkeletonDefaults, SlSkeleton } from '@slotted/angular/skeleton';
|
|
11
|
+
import { sizeClassOf, handleShortcuts, resolveColumns, resolveTiles, materializeLayout, layoutsEqual, moveTileBy, resizeTileBy, tileStyle, measureTiles, setTileHidden, dashboardKeyIntent, spanFromTravel, resizeTileInClass, swapTiles, moveTile, cellAt, parseDuration, playFlip, playResize, parseDashboardLayout, serializeDashboardLayout } from '@slotted/core/dashboard-grid';
|
|
12
|
+
import { createDragController } from '@slotted/core/drag';
|
|
13
|
+
import { dashboardGridMessages, dragMessages } from '@slotted/core/i18n';
|
|
14
|
+
import { getLiveAnnouncer } from '@slotted/core/live-announcer';
|
|
15
|
+
import { initialLoadingVisibility, nextLoadingVisibility } from '@slotted/core/loading';
|
|
16
|
+
|
|
17
|
+
const FALLBACK = {
|
|
18
|
+
columns: 12,
|
|
19
|
+
editBar: true,
|
|
20
|
+
headingLevel: 3,
|
|
21
|
+
};
|
|
22
|
+
const DASHBOARD_GRID_DEFAULTS = new InjectionToken('slotted dashboard-grid defaults', { providedIn: 'root', factory: () => FALLBACK });
|
|
23
|
+
/**
|
|
24
|
+
* An application decides once how many columns its dashboards have, whether
|
|
25
|
+
* the family draws the edit bar and the level of a widget's title. A grid that
|
|
26
|
+
* states any of it itself still wins. Its words come from the language in force
|
|
27
|
+
* (`provideSlotted`).
|
|
28
|
+
*/
|
|
29
|
+
function provideDashboardGridDefaults(defaults) {
|
|
30
|
+
return {
|
|
31
|
+
provide: DASHBOARD_GRID_DEFAULTS,
|
|
32
|
+
useFactory: () => ({ ...FALLBACK, ...defaults }),
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function injectDashboardGridDefaults() {
|
|
36
|
+
return inject(DASHBOARD_GRID_DEFAULTS);
|
|
37
|
+
}
|
|
38
|
+
class SlDashboardGridIdFactory {
|
|
39
|
+
count = 0;
|
|
40
|
+
next() {
|
|
41
|
+
this.count += 1;
|
|
42
|
+
return `slotted-dashboard-grid-${this.count}`;
|
|
43
|
+
}
|
|
44
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlDashboardGridIdFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
45
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlDashboardGridIdFactory, providedIn: 'root' });
|
|
46
|
+
}
|
|
47
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlDashboardGridIdFactory, decorators: [{
|
|
48
|
+
type: Injectable,
|
|
49
|
+
args: [{ providedIn: 'root' }]
|
|
50
|
+
}] });
|
|
51
|
+
|
|
52
|
+
const optionalNumber = (given) => given === undefined ? undefined : numberAttribute(given);
|
|
53
|
+
const optionalBoolean = (given) => given === undefined ? undefined : booleanAttribute(given);
|
|
54
|
+
/** Controls in the header's corner, before the detail action: `<button slDashboardWidgetActions>`. */
|
|
55
|
+
class SlDashboardWidgetActions {
|
|
56
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlDashboardWidgetActions, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
57
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.7", type: SlDashboardWidgetActions, isStandalone: true, selector: "[slDashboardWidgetActions]", ngImport: i0 });
|
|
58
|
+
}
|
|
59
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlDashboardWidgetActions, decorators: [{
|
|
60
|
+
type: Directive,
|
|
61
|
+
args: [{ selector: '[slDashboardWidgetActions]', standalone: true }]
|
|
62
|
+
}] });
|
|
63
|
+
/** The skeleton of the body's own anatomy, shown while the widget loads. */
|
|
64
|
+
class SlDashboardWidgetSkeleton {
|
|
65
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlDashboardWidgetSkeleton, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
66
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.7", type: SlDashboardWidgetSkeleton, isStandalone: true, selector: "[slDashboardWidgetSkeleton]", ngImport: i0 });
|
|
67
|
+
}
|
|
68
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlDashboardWidgetSkeleton, decorators: [{
|
|
69
|
+
type: Directive,
|
|
70
|
+
args: [{ selector: '[slDashboardWidgetSkeleton]', standalone: true }]
|
|
71
|
+
}] });
|
|
72
|
+
/** The action under the empty message: the one that creates the first entry. */
|
|
73
|
+
class SlDashboardWidgetEmptyAction {
|
|
74
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlDashboardWidgetEmptyAction, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
75
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.7", type: SlDashboardWidgetEmptyAction, isStandalone: true, selector: "[slDashboardWidgetEmptyAction]", ngImport: i0 });
|
|
76
|
+
}
|
|
77
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlDashboardWidgetEmptyAction, decorators: [{
|
|
78
|
+
type: Directive,
|
|
79
|
+
args: [{ selector: '[slDashboardWidgetEmptyAction]', standalone: true }]
|
|
80
|
+
}] });
|
|
81
|
+
/** Content under the body. */
|
|
82
|
+
class SlDashboardWidgetFooter {
|
|
83
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlDashboardWidgetFooter, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
84
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.7", type: SlDashboardWidgetFooter, isStandalone: true, selector: "[slDashboardWidgetFooter]", ngImport: i0 });
|
|
85
|
+
}
|
|
86
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlDashboardWidgetFooter, decorators: [{
|
|
87
|
+
type: Directive,
|
|
88
|
+
args: [{ selector: '[slDashboardWidgetFooter]', standalone: true }]
|
|
89
|
+
}] });
|
|
90
|
+
/**
|
|
91
|
+
* Writes this family's part name on a control of another family. `slButton`
|
|
92
|
+
* and `slIconButton` write `data-part="root"` as a static host attribute, and
|
|
93
|
+
* `slMenuTriggerFor` binds the attribute to `null` on a lone trigger; both
|
|
94
|
+
* erase the part the template wrote, so it is written back after the first
|
|
95
|
+
* render. The erasing expressions are constants, so nothing writes over it
|
|
96
|
+
* again.
|
|
97
|
+
*/
|
|
98
|
+
class SlDashboardPart {
|
|
99
|
+
part = input.required({ ...(ngDevMode ? { debugName: "part" } : /* istanbul ignore next */ {}), alias: 'slDashboardPart' });
|
|
100
|
+
host = inject(ElementRef);
|
|
101
|
+
constructor() {
|
|
102
|
+
afterNextRender(() => this.host.nativeElement.setAttribute('data-part', this.part()));
|
|
103
|
+
}
|
|
104
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlDashboardPart, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
105
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.7", type: SlDashboardPart, isStandalone: true, selector: "[slDashboardPart]", inputs: { part: { classPropertyName: "part", publicName: "slDashboardPart", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 });
|
|
106
|
+
}
|
|
107
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlDashboardPart, decorators: [{
|
|
108
|
+
type: Directive,
|
|
109
|
+
args: [{ selector: '[slDashboardPart]', standalone: true }]
|
|
110
|
+
}], ctorParameters: () => [], propDecorators: { part: [{ type: i0.Input, args: [{ isSignal: true, alias: "slDashboardPart", required: true }] }] } });
|
|
111
|
+
/**
|
|
112
|
+
* One widget, declared. It draws nothing where it is written: its content is
|
|
113
|
+
* kept in templates the grid renders inside its own `li` and card, in the
|
|
114
|
+
* order the layout says — the way `mat-tab` hands its content to the tab
|
|
115
|
+
* group. `value` is the widget's key in the layout.
|
|
116
|
+
*/
|
|
117
|
+
class SlDashboardWidget {
|
|
118
|
+
value = input.required(/* @ts-ignore */
|
|
119
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
120
|
+
/** The widget's name: its heading, its accessible name and its entry in Add widget. */
|
|
121
|
+
title = input.required(/* @ts-ignore */
|
|
122
|
+
...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
123
|
+
description = input(undefined, /* @ts-ignore */
|
|
124
|
+
...(ngDevMode ? [{ debugName: "description" }] : /* istanbul ignore next */ []));
|
|
125
|
+
headingLevel = input(undefined, /* @ts-ignore */
|
|
126
|
+
...(ngDevMode ? [{ debugName: "headingLevel" }] : /* istanbul ignore next */ []));
|
|
127
|
+
defaultColumns = input(undefined, { ...(ngDevMode ? { debugName: "defaultColumns" } : /* istanbul ignore next */ {}), transform: optionalNumber });
|
|
128
|
+
defaultRows = input(undefined, { ...(ngDevMode ? { debugName: "defaultRows" } : /* istanbul ignore next */ {}), transform: optionalNumber });
|
|
129
|
+
minColumns = input(undefined, { ...(ngDevMode ? { debugName: "minColumns" } : /* istanbul ignore next */ {}), transform: optionalNumber });
|
|
130
|
+
maxColumns = input(undefined, { ...(ngDevMode ? { debugName: "maxColumns" } : /* istanbul ignore next */ {}), transform: optionalNumber });
|
|
131
|
+
minRows = input(undefined, { ...(ngDevMode ? { debugName: "minRows" } : /* istanbul ignore next */ {}), transform: optionalNumber });
|
|
132
|
+
maxRows = input(undefined, { ...(ngDevMode ? { debugName: "maxRows" } : /* istanbul ignore next */ {}), transform: optionalNumber });
|
|
133
|
+
movable = input(undefined, { ...(ngDevMode ? { debugName: "movable" } : /* istanbul ignore next */ {}), transform: optionalBoolean });
|
|
134
|
+
resizable = input(undefined, { ...(ngDevMode ? { debugName: "resizable" } : /* istanbul ignore next */ {}), transform: optionalBoolean });
|
|
135
|
+
removable = input(undefined, { ...(ngDevMode ? { debugName: "removable" } : /* istanbul ignore next */ {}), transform: optionalBoolean });
|
|
136
|
+
/** The first answer has not arrived: the body shows a skeleton. */
|
|
137
|
+
loading = input(false, { ...(ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
138
|
+
/** A refresh of data already shown: the content stays and the region is busy. */
|
|
139
|
+
busy = input(false, { ...(ngDevMode ? { debugName: "busy" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
140
|
+
status = input('ready', /* @ts-ignore */
|
|
141
|
+
...(ngDevMode ? [{ debugName: "status" }] : /* istanbul ignore next */ []));
|
|
142
|
+
emptyTitle = input(undefined, /* @ts-ignore */
|
|
143
|
+
...(ngDevMode ? [{ debugName: "emptyTitle" }] : /* istanbul ignore next */ []));
|
|
144
|
+
emptyDescription = input(undefined, /* @ts-ignore */
|
|
145
|
+
...(ngDevMode ? [{ debugName: "emptyDescription" }] : /* istanbul ignore next */ []));
|
|
146
|
+
errorTitle = input(undefined, /* @ts-ignore */
|
|
147
|
+
...(ngDevMode ? [{ debugName: "errorTitle" }] : /* istanbul ignore next */ []));
|
|
148
|
+
errorDescription = input(undefined, /* @ts-ignore */
|
|
149
|
+
...(ngDevMode ? [{ debugName: "errorDescription" }] : /* istanbul ignore next */ []));
|
|
150
|
+
/** Draws Try again under the error message; `retry` fires when it is pressed. */
|
|
151
|
+
retryable = input(false, { ...(ngDevMode ? { debugName: "retryable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
152
|
+
/** The widget's own page. */
|
|
153
|
+
detailHref = input(undefined, /* @ts-ignore */
|
|
154
|
+
...(ngDevMode ? [{ debugName: "detailHref" }] : /* istanbul ignore next */ []));
|
|
155
|
+
/** Draws the detail action as a button; `detail` fires when it is pressed. */
|
|
156
|
+
detailable = input(false, { ...(ngDevMode ? { debugName: "detailable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
157
|
+
fill = input(undefined, /* @ts-ignore */
|
|
158
|
+
...(ngDevMode ? [{ debugName: "fill" }] : /* istanbul ignore next */ []));
|
|
159
|
+
size = input(undefined, /* @ts-ignore */
|
|
160
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
161
|
+
retry = output();
|
|
162
|
+
detail = output();
|
|
163
|
+
bodyTemplate = viewChild.required('body', /* @ts-ignore */
|
|
164
|
+
...(ngDevMode ? [{ debugName: "bodyTemplate" }] : /* istanbul ignore next */ []));
|
|
165
|
+
actionsTemplate = viewChild.required('actions', /* @ts-ignore */
|
|
166
|
+
...(ngDevMode ? [{ debugName: "actionsTemplate" }] : /* istanbul ignore next */ []));
|
|
167
|
+
skeletonTemplate = viewChild.required('skeleton', /* @ts-ignore */
|
|
168
|
+
...(ngDevMode ? [{ debugName: "skeletonTemplate" }] : /* istanbul ignore next */ []));
|
|
169
|
+
emptyActionTemplate = viewChild.required('emptyAction', /* @ts-ignore */
|
|
170
|
+
...(ngDevMode ? [{ debugName: "emptyActionTemplate" }] : /* istanbul ignore next */ []));
|
|
171
|
+
footerTemplate = viewChild.required('footer', /* @ts-ignore */
|
|
172
|
+
...(ngDevMode ? [{ debugName: "footerTemplate" }] : /* istanbul ignore next */ []));
|
|
173
|
+
hasActions = contentChild(SlDashboardWidgetActions, /* @ts-ignore */
|
|
174
|
+
...(ngDevMode ? [{ debugName: "hasActions" }] : /* istanbul ignore next */ []));
|
|
175
|
+
hasSkeleton = contentChild(SlDashboardWidgetSkeleton, /* @ts-ignore */
|
|
176
|
+
...(ngDevMode ? [{ debugName: "hasSkeleton" }] : /* istanbul ignore next */ []));
|
|
177
|
+
hasEmptyAction = contentChild(SlDashboardWidgetEmptyAction, /* @ts-ignore */
|
|
178
|
+
...(ngDevMode ? [{ debugName: "hasEmptyAction" }] : /* istanbul ignore next */ []));
|
|
179
|
+
hasFooter = contentChild(SlDashboardWidgetFooter, /* @ts-ignore */
|
|
180
|
+
...(ngDevMode ? [{ debugName: "hasFooter" }] : /* istanbul ignore next */ []));
|
|
181
|
+
/** Whether the skeleton is on screen: `loading` held back by the skeleton family's timing. */
|
|
182
|
+
painted = signal(false, /* @ts-ignore */
|
|
183
|
+
...(ngDevMode ? [{ debugName: "painted" }] : /* istanbul ignore next */ []));
|
|
184
|
+
skeletonDefaults = injectSkeletonDefaults();
|
|
185
|
+
visibility = initialLoadingVisibility;
|
|
186
|
+
timer;
|
|
187
|
+
constructor() {
|
|
188
|
+
effect(() => {
|
|
189
|
+
const loading = this.loading();
|
|
190
|
+
untracked(() => this.tick(loading));
|
|
191
|
+
});
|
|
192
|
+
inject(DestroyRef).onDestroy(() => clearTimeout(this.timer));
|
|
193
|
+
}
|
|
194
|
+
/** What the grid's layout arithmetic reads. */
|
|
195
|
+
spec() {
|
|
196
|
+
const given = {
|
|
197
|
+
defaultColumns: this.defaultColumns(),
|
|
198
|
+
defaultRows: this.defaultRows(),
|
|
199
|
+
minColumns: this.minColumns(),
|
|
200
|
+
maxColumns: this.maxColumns(),
|
|
201
|
+
minRows: this.minRows(),
|
|
202
|
+
maxRows: this.maxRows(),
|
|
203
|
+
movable: this.movable(),
|
|
204
|
+
resizable: this.resizable(),
|
|
205
|
+
removable: this.removable(),
|
|
206
|
+
};
|
|
207
|
+
return {
|
|
208
|
+
key: this.value(),
|
|
209
|
+
...Object.fromEntries(Object.entries(given).filter(([, value]) => value !== undefined)),
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
tick(loading) {
|
|
213
|
+
const answer = nextLoadingVisibility({
|
|
214
|
+
delay: this.skeletonDefaults.delay ?? 0,
|
|
215
|
+
loading,
|
|
216
|
+
minDuration: this.skeletonDefaults.minDuration ?? 0,
|
|
217
|
+
now: Date.now(),
|
|
218
|
+
state: this.visibility,
|
|
219
|
+
});
|
|
220
|
+
this.visibility = answer.state;
|
|
221
|
+
this.painted.set(answer.state.visible);
|
|
222
|
+
clearTimeout(this.timer);
|
|
223
|
+
if (answer.wait !== null) {
|
|
224
|
+
this.timer = setTimeout(() => this.tick(this.loading()), answer.wait);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlDashboardWidget, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
228
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.1.7", type: SlDashboardWidget, isStandalone: true, selector: "sl-dashboard-widget", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, headingLevel: { classPropertyName: "headingLevel", publicName: "headingLevel", isSignal: true, isRequired: false, transformFunction: null }, defaultColumns: { classPropertyName: "defaultColumns", publicName: "defaultColumns", isSignal: true, isRequired: false, transformFunction: null }, defaultRows: { classPropertyName: "defaultRows", publicName: "defaultRows", isSignal: true, isRequired: false, transformFunction: null }, minColumns: { classPropertyName: "minColumns", publicName: "minColumns", isSignal: true, isRequired: false, transformFunction: null }, maxColumns: { classPropertyName: "maxColumns", publicName: "maxColumns", isSignal: true, isRequired: false, transformFunction: null }, minRows: { classPropertyName: "minRows", publicName: "minRows", isSignal: true, isRequired: false, transformFunction: null }, maxRows: { classPropertyName: "maxRows", publicName: "maxRows", isSignal: true, isRequired: false, transformFunction: null }, movable: { classPropertyName: "movable", publicName: "movable", isSignal: true, isRequired: false, transformFunction: null }, resizable: { classPropertyName: "resizable", publicName: "resizable", isSignal: true, isRequired: false, transformFunction: null }, removable: { classPropertyName: "removable", publicName: "removable", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, busy: { classPropertyName: "busy", publicName: "busy", isSignal: true, isRequired: false, transformFunction: null }, status: { classPropertyName: "status", publicName: "status", isSignal: true, isRequired: false, transformFunction: null }, emptyTitle: { classPropertyName: "emptyTitle", publicName: "emptyTitle", isSignal: true, isRequired: false, transformFunction: null }, emptyDescription: { classPropertyName: "emptyDescription", publicName: "emptyDescription", isSignal: true, isRequired: false, transformFunction: null }, errorTitle: { classPropertyName: "errorTitle", publicName: "errorTitle", isSignal: true, isRequired: false, transformFunction: null }, errorDescription: { classPropertyName: "errorDescription", publicName: "errorDescription", isSignal: true, isRequired: false, transformFunction: null }, retryable: { classPropertyName: "retryable", publicName: "retryable", isSignal: true, isRequired: false, transformFunction: null }, detailHref: { classPropertyName: "detailHref", publicName: "detailHref", isSignal: true, isRequired: false, transformFunction: null }, detailable: { classPropertyName: "detailable", publicName: "detailable", isSignal: true, isRequired: false, transformFunction: null }, fill: { classPropertyName: "fill", publicName: "fill", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { retry: "retry", detail: "detail" }, host: { styleAttribute: "display: none" }, queries: [{ propertyName: "hasActions", first: true, predicate: SlDashboardWidgetActions, descendants: true, isSignal: true }, { propertyName: "hasSkeleton", first: true, predicate: SlDashboardWidgetSkeleton, descendants: true, isSignal: true }, { propertyName: "hasEmptyAction", first: true, predicate: SlDashboardWidgetEmptyAction, descendants: true, isSignal: true }, { propertyName: "hasFooter", first: true, predicate: SlDashboardWidgetFooter, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "bodyTemplate", first: true, predicate: ["body"], descendants: true, isSignal: true }, { propertyName: "actionsTemplate", first: true, predicate: ["actions"], descendants: true, isSignal: true }, { propertyName: "skeletonTemplate", first: true, predicate: ["skeleton"], descendants: true, isSignal: true }, { propertyName: "emptyActionTemplate", first: true, predicate: ["emptyAction"], descendants: true, isSignal: true }, { propertyName: "footerTemplate", first: true, predicate: ["footer"], descendants: true, isSignal: true }], exportAs: ["slDashboardWidget"], ngImport: i0, template: `
|
|
229
|
+
<ng-template #body><ng-content /></ng-template>
|
|
230
|
+
<ng-template #actions><ng-content select="[slDashboardWidgetActions]" /></ng-template>
|
|
231
|
+
<ng-template #skeleton><ng-content select="[slDashboardWidgetSkeleton]" /></ng-template>
|
|
232
|
+
<ng-template #emptyAction><ng-content select="[slDashboardWidgetEmptyAction]" /></ng-template>
|
|
233
|
+
<ng-template #footer><ng-content select="[slDashboardWidgetFooter]" /></ng-template>
|
|
234
|
+
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
235
|
+
}
|
|
236
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlDashboardWidget, decorators: [{
|
|
237
|
+
type: Component,
|
|
238
|
+
args: [{
|
|
239
|
+
selector: 'sl-dashboard-widget',
|
|
240
|
+
standalone: true,
|
|
241
|
+
exportAs: 'slDashboardWidget',
|
|
242
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
243
|
+
encapsulation: ViewEncapsulation.None,
|
|
244
|
+
host: { style: 'display: none' },
|
|
245
|
+
template: `
|
|
246
|
+
<ng-template #body><ng-content /></ng-template>
|
|
247
|
+
<ng-template #actions><ng-content select="[slDashboardWidgetActions]" /></ng-template>
|
|
248
|
+
<ng-template #skeleton><ng-content select="[slDashboardWidgetSkeleton]" /></ng-template>
|
|
249
|
+
<ng-template #emptyAction><ng-content select="[slDashboardWidgetEmptyAction]" /></ng-template>
|
|
250
|
+
<ng-template #footer><ng-content select="[slDashboardWidgetFooter]" /></ng-template>
|
|
251
|
+
`,
|
|
252
|
+
}]
|
|
253
|
+
}], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: true }] }], description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: false }] }], headingLevel: [{ type: i0.Input, args: [{ isSignal: true, alias: "headingLevel", required: false }] }], defaultColumns: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultColumns", required: false }] }], defaultRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultRows", required: false }] }], minColumns: [{ type: i0.Input, args: [{ isSignal: true, alias: "minColumns", required: false }] }], maxColumns: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxColumns", required: false }] }], minRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "minRows", required: false }] }], maxRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxRows", required: false }] }], movable: [{ type: i0.Input, args: [{ isSignal: true, alias: "movable", required: false }] }], resizable: [{ type: i0.Input, args: [{ isSignal: true, alias: "resizable", required: false }] }], removable: [{ type: i0.Input, args: [{ isSignal: true, alias: "removable", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], busy: [{ type: i0.Input, args: [{ isSignal: true, alias: "busy", required: false }] }], status: [{ type: i0.Input, args: [{ isSignal: true, alias: "status", required: false }] }], emptyTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyTitle", required: false }] }], emptyDescription: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyDescription", required: false }] }], errorTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorTitle", required: false }] }], errorDescription: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorDescription", required: false }] }], retryable: [{ type: i0.Input, args: [{ isSignal: true, alias: "retryable", required: false }] }], detailHref: [{ type: i0.Input, args: [{ isSignal: true, alias: "detailHref", required: false }] }], detailable: [{ type: i0.Input, args: [{ isSignal: true, alias: "detailable", required: false }] }], fill: [{ type: i0.Input, args: [{ isSignal: true, alias: "fill", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], retry: [{ type: i0.Output, args: ["retry"] }], detail: [{ type: i0.Output, args: ["detail"] }], bodyTemplate: [{ type: i0.ViewChild, args: ['body', { isSignal: true }] }], actionsTemplate: [{ type: i0.ViewChild, args: ['actions', { isSignal: true }] }], skeletonTemplate: [{ type: i0.ViewChild, args: ['skeleton', { isSignal: true }] }], emptyActionTemplate: [{ type: i0.ViewChild, args: ['emptyAction', { isSignal: true }] }], footerTemplate: [{ type: i0.ViewChild, args: ['footer', { isSignal: true }] }], hasActions: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SlDashboardWidgetActions), { isSignal: true }] }], hasSkeleton: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SlDashboardWidgetSkeleton), { isSignal: true }] }], hasEmptyAction: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SlDashboardWidgetEmptyAction), { isSignal: true }] }], hasFooter: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SlDashboardWidgetFooter), { isSignal: true }] }] } });
|
|
254
|
+
|
|
255
|
+
const EMPTY_LAYOUT = [];
|
|
256
|
+
const GRID = 'dashboard-grid';
|
|
257
|
+
const ADD = `${GRID}:add`;
|
|
258
|
+
const PLACEHOLDER = '\u0000placeholder';
|
|
259
|
+
const EDGES = ['start', 'end', 'bottom', 'bottom-start', 'bottom-end'];
|
|
260
|
+
/** A click with no coordinates is a key. */
|
|
261
|
+
function pressReason(event) {
|
|
262
|
+
return event.detail === 0 ? 'keyboard' : 'pointer';
|
|
263
|
+
}
|
|
264
|
+
function directionOf(element) {
|
|
265
|
+
return getComputedStyle(element).direction === 'rtl' ? 'rtl' : 'ltr';
|
|
266
|
+
}
|
|
267
|
+
/** A grid not laid out yet — hidden, or in a test — is drawn in its stored class. */
|
|
268
|
+
function classOf(root) {
|
|
269
|
+
return root.clientWidth > 0 ? sizeClassOf(root.clientWidth) : 'expanded';
|
|
270
|
+
}
|
|
271
|
+
function makeRequest(value, previous, reason, source, extra) {
|
|
272
|
+
let cancelled = false;
|
|
273
|
+
return {
|
|
274
|
+
value,
|
|
275
|
+
previous,
|
|
276
|
+
reason,
|
|
277
|
+
source,
|
|
278
|
+
...extra,
|
|
279
|
+
get cancelled() {
|
|
280
|
+
return cancelled;
|
|
281
|
+
},
|
|
282
|
+
cancel() {
|
|
283
|
+
cancelled = true;
|
|
284
|
+
},
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
function tracksOf(list, columns) {
|
|
288
|
+
const styles = getComputedStyle(list);
|
|
289
|
+
const columnGap = parseFloat(styles.columnGap) || 0;
|
|
290
|
+
const rowGap = parseFloat(styles.rowGap) || 0;
|
|
291
|
+
const track = (list.clientWidth - columnGap * (columns - 1)) / Math.max(1, columns);
|
|
292
|
+
return { columns, track, columnGap, row: parseFloat(styles.gridAutoRows) || 0, rowGap };
|
|
293
|
+
}
|
|
294
|
+
function originOf(element, list, rtl) {
|
|
295
|
+
const box = element.getBoundingClientRect();
|
|
296
|
+
const frame = list.getBoundingClientRect();
|
|
297
|
+
return {
|
|
298
|
+
inlineStart: rtl ? frame.right - box.right : box.left - frame.left,
|
|
299
|
+
blockStart: box.top - frame.top,
|
|
300
|
+
inlineSize: box.width,
|
|
301
|
+
blockSize: box.height,
|
|
302
|
+
};
|
|
303
|
+
}
|
|
304
|
+
function writeOrigin(element, origin) {
|
|
305
|
+
element.style.setProperty('--_dg-origin-inline-start', `${origin.inlineStart}px`);
|
|
306
|
+
element.style.setProperty('--_dg-origin-block-start', `${origin.blockStart}px`);
|
|
307
|
+
element.style.setProperty('--_dg-origin-inline-size', `${origin.inlineSize}px`);
|
|
308
|
+
element.style.setProperty('--_dg-origin-block-size', `${origin.blockSize}px`);
|
|
309
|
+
}
|
|
310
|
+
function clearLift(element) {
|
|
311
|
+
if (element === undefined)
|
|
312
|
+
return;
|
|
313
|
+
for (const name of [
|
|
314
|
+
'--_dg-origin-inline-start',
|
|
315
|
+
'--_dg-origin-block-start',
|
|
316
|
+
'--_dg-origin-inline-size',
|
|
317
|
+
'--_dg-origin-block-size',
|
|
318
|
+
'--_dg-lift-x',
|
|
319
|
+
'--_dg-lift-y',
|
|
320
|
+
]) {
|
|
321
|
+
element.style.removeProperty(name);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
function boxOf(element) {
|
|
325
|
+
const { left, top, width, height } = element.getBoundingClientRect();
|
|
326
|
+
return { left, top, width, height };
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* A surface of widgets the reader places and sizes. The widgets are
|
|
330
|
+
* `sl-dashboard-widget` children, each with its own `value`; the grid draws
|
|
331
|
+
* them where the layout puts them, by row and then column, which is the
|
|
332
|
+
* reading order, the focus order and the picture at every width.
|
|
333
|
+
*
|
|
334
|
+
* The host is the root. `aria-label` and `aria-labelledby` written on it name
|
|
335
|
+
* the list inside, which is what a reader meets.
|
|
336
|
+
*/
|
|
337
|
+
class SlDashboardGrid {
|
|
338
|
+
/**
|
|
339
|
+
* Where each widget stands and how big it is: `[{ key, x, y, w, h, hidden? }]`
|
|
340
|
+
* in cells of the expanded class. Bound at all, it is the value; unbound,
|
|
341
|
+
* the grid keeps its own.
|
|
342
|
+
*/
|
|
343
|
+
layout = model(undefined, /* @ts-ignore */
|
|
344
|
+
...(ngDevMode ? [{ debugName: "layout" }] : /* istanbul ignore next */ []));
|
|
345
|
+
/** The layout an unbound grid starts from. Default: every widget at its defaults. */
|
|
346
|
+
defaultLayout = input(undefined, /* @ts-ignore */
|
|
347
|
+
...(ngDevMode ? [{ debugName: "defaultLayout" }] : /* istanbul ignore next */ []));
|
|
348
|
+
editing = model(undefined, /* @ts-ignore */
|
|
349
|
+
...(ngDevMode ? [{ debugName: "editing" }] : /* istanbul ignore next */ []));
|
|
350
|
+
defaultEditing = input(false, { ...(ngDevMode ? { debugName: "defaultEditing" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
351
|
+
/** Columns of the expanded class, or one count per class. Default 12, 6, 1. */
|
|
352
|
+
columns = input(undefined, /* @ts-ignore */
|
|
353
|
+
...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
|
|
354
|
+
editBar = input(undefined, { ...(ngDevMode ? { debugName: "editBar" } : /* istanbul ignore next */ {}), transform: (given) => (given === undefined ? undefined : booleanAttribute(given)) });
|
|
355
|
+
headingLevel = input(undefined, /* @ts-ignore */
|
|
356
|
+
...(ngDevMode ? [{ debugName: "headingLevel" }] : /* istanbul ignore next */ []));
|
|
357
|
+
/** Words laid over the catalog of the language in force, key by key. */
|
|
358
|
+
messages = input(undefined, /* @ts-ignore */
|
|
359
|
+
...(ngDevMode ? [{ debugName: "messages" }] : /* istanbul ignore next */ []));
|
|
360
|
+
ariaLabel = input(undefined, { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: 'aria-label' });
|
|
361
|
+
ariaLabelledBy = input(undefined, { ...(ngDevMode ? { debugName: "ariaLabelledBy" } : /* istanbul ignore next */ {}), alias: 'aria-labelledby' });
|
|
362
|
+
layoutChangeRequest = output();
|
|
363
|
+
editingChangeRequest = output();
|
|
364
|
+
/* ── State ────────────────────────────────────────────────────────── */
|
|
365
|
+
defaults = injectDashboardGridDefaults();
|
|
366
|
+
base = inject(SlDashboardGridIdFactory).next();
|
|
367
|
+
host = inject(ElementRef);
|
|
368
|
+
destroyRef = inject(DestroyRef);
|
|
369
|
+
list = viewChild('list', /* @ts-ignore */
|
|
370
|
+
...(ngDevMode ? [{ debugName: "list" }] : /* istanbul ignore next */ []));
|
|
371
|
+
widgets = contentChildren(SlDashboardWidget, /* @ts-ignore */
|
|
372
|
+
...(ngDevMode ? [{ debugName: "widgets" }] : /* istanbul ignore next */ []));
|
|
373
|
+
statusId = `${this.base}-edit-status`;
|
|
374
|
+
edges = EDGES;
|
|
375
|
+
pressReason = pressReason;
|
|
376
|
+
shortcuts = handleShortcuts;
|
|
377
|
+
/** The family's words in the language in force, with this grid's `messages` laid over them. */
|
|
378
|
+
t = injectMessages(dashboardGridMessages, this.messages);
|
|
379
|
+
/** What a drag of a widget says when no position is left, in the language in force. */
|
|
380
|
+
dragT = injectMessages(dragMessages);
|
|
381
|
+
grid = computed(() => resolveColumns(this.columns() ?? this.defaults.columns), /* @ts-ignore */
|
|
382
|
+
...(ngDevMode ? [{ debugName: "grid" }] : /* istanbul ignore next */ []));
|
|
383
|
+
resolvedEditBar = computed(() => this.editBar() ?? this.defaults.editBar, /* @ts-ignore */
|
|
384
|
+
...(ngDevMode ? [{ debugName: "resolvedEditBar" }] : /* istanbul ignore next */ []));
|
|
385
|
+
currentLayout = computed(() => this.layout() ?? this.defaultLayout() ?? EMPTY_LAYOUT, /* @ts-ignore */
|
|
386
|
+
...(ngDevMode ? [{ debugName: "currentLayout" }] : /* istanbul ignore next */ []));
|
|
387
|
+
isEditing = computed(() => this.editing() ?? this.defaultEditing(), /* @ts-ignore */
|
|
388
|
+
...(ngDevMode ? [{ debugName: "isEditing" }] : /* istanbul ignore next */ []));
|
|
389
|
+
specs = computed(() => this.widgets().map((widget) => widget.spec()), /* @ts-ignore */
|
|
390
|
+
...(ngDevMode ? [{ debugName: "specs" }] : /* istanbul ignore next */ []));
|
|
391
|
+
byKey = computed(() => new Map(this.widgets().map((widget) => [widget.value(), widget])), /* @ts-ignore */
|
|
392
|
+
...(ngDevMode ? [{ debugName: "byKey" }] : /* istanbul ignore next */ []));
|
|
393
|
+
tiles = computed(() => resolveTiles(this.currentLayout(), this.specs(), this.grid()), /* @ts-ignore */
|
|
394
|
+
...(ngDevMode ? [{ debugName: "tiles" }] : /* istanbul ignore next */ []));
|
|
395
|
+
visible = computed(() => this.tiles().filter((tile) => !tile.hidden), /* @ts-ignore */
|
|
396
|
+
...(ngDevMode ? [{ debugName: "visible" }] : /* istanbul ignore next */ []));
|
|
397
|
+
hiddenTiles = computed(() => this.tiles().filter((tile) => tile.hidden), /* @ts-ignore */
|
|
398
|
+
...(ngDevMode ? [{ debugName: "hiddenTiles" }] : /* istanbul ignore next */ []));
|
|
399
|
+
gesture = signal(null, /* @ts-ignore */
|
|
400
|
+
...(ngDevMode ? [{ debugName: "gesture" }] : /* istanbul ignore next */ []));
|
|
401
|
+
/* The class the grid is drawn in, observed after the first render, so a
|
|
402
|
+
server render and the first client render agree on `expanded`. */
|
|
403
|
+
drawnClass = signal('expanded', /* @ts-ignore */
|
|
404
|
+
...(ngDevMode ? [{ debugName: "drawnClass" }] : /* istanbul ignore next */ []));
|
|
405
|
+
flows = computed(() => this.drawnClass() !== 'expanded', /* @ts-ignore */
|
|
406
|
+
...(ngDevMode ? [{ debugName: "flows" }] : /* istanbul ignore next */ []));
|
|
407
|
+
/** What is drawn: the committed layout, or the one a gesture previews. */
|
|
408
|
+
drawn = computed(() => {
|
|
409
|
+
const gesture = this.gesture();
|
|
410
|
+
return gesture === null
|
|
411
|
+
? this.tiles()
|
|
412
|
+
: resolveTiles(gesture.preview, this.specs(), this.grid());
|
|
413
|
+
}, /* @ts-ignore */
|
|
414
|
+
...(ngDevMode ? [{ debugName: "drawn" }] : /* istanbul ignore next */ []));
|
|
415
|
+
drawnVisible = computed(() => this.drawn().filter((tile) => !tile.hidden), /* @ts-ignore */
|
|
416
|
+
...(ngDevMode ? [{ debugName: "drawnVisible" }] : /* istanbul ignore next */ []));
|
|
417
|
+
slots = computed(() => {
|
|
418
|
+
const gesture = this.gesture();
|
|
419
|
+
const drawn = this.drawn();
|
|
420
|
+
const order = new Map(this.drawnVisible().map((tile, index) => [tile.key, index]));
|
|
421
|
+
const widgets = this.byKey();
|
|
422
|
+
const editing = this.isEditing();
|
|
423
|
+
const drawnClass = this.drawnClass();
|
|
424
|
+
const layout = this.currentLayout();
|
|
425
|
+
const specs = this.specs();
|
|
426
|
+
const grid = this.grid();
|
|
427
|
+
const committed = materializeLayout(layout, specs, grid);
|
|
428
|
+
const differs = (next) => !layoutsEqual(materializeLayout(next, specs, grid), committed);
|
|
429
|
+
const slots = [];
|
|
430
|
+
for (const tile of this.visible()) {
|
|
431
|
+
const widget = widgets.get(tile.key);
|
|
432
|
+
if (widget === undefined)
|
|
433
|
+
continue;
|
|
434
|
+
const shown = drawn.find((each) => each.key === tile.key) ?? tile;
|
|
435
|
+
const inHand = gesture !== null && gesture.key === tile.key;
|
|
436
|
+
const resizing = inHand && gesture.kind === 'resize';
|
|
437
|
+
const sizable = tile.resizable && drawnClass !== 'compact';
|
|
438
|
+
const at = (direction) => editing && differs(moveTileBy(layout, specs, grid, tile.key, direction, drawnClass));
|
|
439
|
+
const by = (columns, rows) => editing &&
|
|
440
|
+
differs(resizeTileBy(layout, specs, grid, tile.key, { columns, rows }, drawnClass));
|
|
441
|
+
const style = tileStyle(shown);
|
|
442
|
+
if (gesture !== null)
|
|
443
|
+
style['order'] = String(order.get(tile.key) ?? 0);
|
|
444
|
+
slots.push({
|
|
445
|
+
widget,
|
|
446
|
+
tile: shown,
|
|
447
|
+
style,
|
|
448
|
+
dragging: inHand && gesture.kind === 'move',
|
|
449
|
+
resizing,
|
|
450
|
+
edge: resizing ? gesture.edge : null,
|
|
451
|
+
readout: resizing
|
|
452
|
+
? this.t('size', {
|
|
453
|
+
columns: gesture.sizeClass === 'medium' ? shown.medium : shown.w,
|
|
454
|
+
rows: shown.h,
|
|
455
|
+
})
|
|
456
|
+
: null,
|
|
457
|
+
sizable,
|
|
458
|
+
handle: editing && (tile.movable || sizable || tile.removable),
|
|
459
|
+
can: {
|
|
460
|
+
up: at('up'),
|
|
461
|
+
down: at('down'),
|
|
462
|
+
left: at('left'),
|
|
463
|
+
right: at('right'),
|
|
464
|
+
wider: by(1, 0),
|
|
465
|
+
narrower: by(-1, 0),
|
|
466
|
+
taller: by(0, 1),
|
|
467
|
+
shorter: by(0, -1),
|
|
468
|
+
},
|
|
469
|
+
});
|
|
470
|
+
}
|
|
471
|
+
return slots;
|
|
472
|
+
}, /* @ts-ignore */
|
|
473
|
+
...(ngDevMode ? [{ debugName: "slots" }] : /* istanbul ignore next */ []));
|
|
474
|
+
/** The cells the widget in hand will land in, while a gesture lasts. */
|
|
475
|
+
placeholder = computed(() => {
|
|
476
|
+
const gesture = this.gesture();
|
|
477
|
+
if (gesture === null)
|
|
478
|
+
return null;
|
|
479
|
+
const visible = this.drawnVisible();
|
|
480
|
+
const index = visible.findIndex((tile) => tile.key === gesture.key);
|
|
481
|
+
const tile = visible[index];
|
|
482
|
+
return tile === undefined ? null : { ...tileStyle(tile), order: String(index) };
|
|
483
|
+
}, /* @ts-ignore */
|
|
484
|
+
...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
485
|
+
/** Measured before a change of what is drawn, played after it lands. */
|
|
486
|
+
flipFrom = null;
|
|
487
|
+
settleFrom = null;
|
|
488
|
+
focusAfter = null;
|
|
489
|
+
snapshot = null;
|
|
490
|
+
returnFocus = null;
|
|
491
|
+
wasEditing = false;
|
|
492
|
+
resizeTeardown = null;
|
|
493
|
+
dragTeardown = null;
|
|
494
|
+
dragKeys = '';
|
|
495
|
+
constructor() {
|
|
496
|
+
const onKeyDown = (event) => this.onHandleKeyDown(event);
|
|
497
|
+
afterNextRender(() => {
|
|
498
|
+
this.host.nativeElement.addEventListener('keydown', onKeyDown, true);
|
|
499
|
+
if (typeof ResizeObserver === 'undefined')
|
|
500
|
+
return;
|
|
501
|
+
const root = this.host.nativeElement;
|
|
502
|
+
const observer = new ResizeObserver(() => this.drawnClass.set(classOf(root)));
|
|
503
|
+
observer.observe(root);
|
|
504
|
+
this.drawnClass.set(classOf(root));
|
|
505
|
+
this.destroyRef.onDestroy(() => observer.disconnect());
|
|
506
|
+
});
|
|
507
|
+
this.destroyRef.onDestroy(() => {
|
|
508
|
+
this.host.nativeElement.removeEventListener('keydown', onKeyDown, true);
|
|
509
|
+
this.resizeTeardown?.();
|
|
510
|
+
this.dragTeardown?.();
|
|
511
|
+
});
|
|
512
|
+
afterEveryRender(() => {
|
|
513
|
+
this.syncEditing();
|
|
514
|
+
this.syncDrag();
|
|
515
|
+
this.settle();
|
|
516
|
+
});
|
|
517
|
+
}
|
|
518
|
+
/* ── Reading ──────────────────────────────────────────────────────── */
|
|
519
|
+
titleId(key) {
|
|
520
|
+
return `${this.base}-${key}-title`;
|
|
521
|
+
}
|
|
522
|
+
titleOf(key) {
|
|
523
|
+
return this.byKey().get(key)?.title() ?? key;
|
|
524
|
+
}
|
|
525
|
+
levelOf(widget) {
|
|
526
|
+
return widget.headingLevel() ?? this.headingLevel() ?? this.defaults.headingLevel;
|
|
527
|
+
}
|
|
528
|
+
reasonOf(event) {
|
|
529
|
+
return event.reason === 'keyboard' ? 'keyboard' : 'pointer';
|
|
530
|
+
}
|
|
531
|
+
sizeClass() {
|
|
532
|
+
return classOf(this.host.nativeElement);
|
|
533
|
+
}
|
|
534
|
+
widgetNodes() {
|
|
535
|
+
const nodes = new Map();
|
|
536
|
+
for (const node of this.list()?.nativeElement.querySelectorAll(':scope > [data-part="widget"]') ?? []) {
|
|
537
|
+
const key = node.dataset['key'];
|
|
538
|
+
if (key !== undefined)
|
|
539
|
+
nodes.set(key, node);
|
|
540
|
+
}
|
|
541
|
+
return nodes;
|
|
542
|
+
}
|
|
543
|
+
placeholderNode() {
|
|
544
|
+
return (this.list()?.nativeElement.querySelector(':scope > [data-part="placeholder"]') ??
|
|
545
|
+
null);
|
|
546
|
+
}
|
|
547
|
+
handleOf(key) {
|
|
548
|
+
return (this.widgetNodes().get(key)?.querySelector(':scope > [data-handle]') ?? null);
|
|
549
|
+
}
|
|
550
|
+
cardOf(key) {
|
|
551
|
+
return (this.widgetNodes().get(key)?.querySelector(':scope > [data-ui="card"]') ?? null);
|
|
552
|
+
}
|
|
553
|
+
/** The widgets that glide, and the placeholder; not the one in hand. */
|
|
554
|
+
flipNodes() {
|
|
555
|
+
const nodes = this.widgetNodes();
|
|
556
|
+
const key = this.gesture()?.key;
|
|
557
|
+
if (key !== undefined)
|
|
558
|
+
nodes.delete(key);
|
|
559
|
+
const placeholder = this.placeholderNode();
|
|
560
|
+
if (placeholder !== null)
|
|
561
|
+
nodes.set(PLACEHOLDER, placeholder);
|
|
562
|
+
return nodes;
|
|
563
|
+
}
|
|
564
|
+
measureAll() {
|
|
565
|
+
this.flipFrom = measureTiles(this.flipNodes());
|
|
566
|
+
}
|
|
567
|
+
setGesture(next) {
|
|
568
|
+
this.measureAll();
|
|
569
|
+
this.gesture.set(next);
|
|
570
|
+
}
|
|
571
|
+
/* ── Requests ─────────────────────────────────────────────────────── */
|
|
572
|
+
announce(message) {
|
|
573
|
+
if (message !== '')
|
|
574
|
+
getLiveAnnouncer(this.host.nativeElement.ownerDocument).announce(message);
|
|
575
|
+
}
|
|
576
|
+
full(layout) {
|
|
577
|
+
return materializeLayout(layout, this.specs(), this.grid());
|
|
578
|
+
}
|
|
579
|
+
change(next, reason, change, source, message) {
|
|
580
|
+
const full = this.full(next);
|
|
581
|
+
const previous = this.full(this.currentLayout());
|
|
582
|
+
if (layoutsEqual(full, previous))
|
|
583
|
+
return false;
|
|
584
|
+
if (this.flipFrom === null)
|
|
585
|
+
this.measureAll();
|
|
586
|
+
const request = makeRequest(full, previous, reason, source, { change });
|
|
587
|
+
this.layoutChangeRequest.emit(request);
|
|
588
|
+
if (request.cancelled) {
|
|
589
|
+
this.flipFrom = null;
|
|
590
|
+
return false;
|
|
591
|
+
}
|
|
592
|
+
this.layout.set(full);
|
|
593
|
+
this.announce(message(full));
|
|
594
|
+
return true;
|
|
595
|
+
}
|
|
596
|
+
requestEditing(next, reason, source) {
|
|
597
|
+
const previous = this.isEditing();
|
|
598
|
+
if (previous === next)
|
|
599
|
+
return;
|
|
600
|
+
const request = makeRequest(next, previous, reason, source, {});
|
|
601
|
+
this.editingChangeRequest.emit(request);
|
|
602
|
+
if (request.cancelled)
|
|
603
|
+
return;
|
|
604
|
+
this.editing.set(next);
|
|
605
|
+
}
|
|
606
|
+
movedMessage(key, drawnIn) {
|
|
607
|
+
return (layout) => {
|
|
608
|
+
const placed = resolveTiles(layout, this.specs(), this.grid()).filter((tile) => !tile.hidden);
|
|
609
|
+
const index = placed.findIndex((tile) => tile.key === key);
|
|
610
|
+
const tile = placed[index];
|
|
611
|
+
if (tile === undefined)
|
|
612
|
+
return '';
|
|
613
|
+
return drawnIn === 'expanded'
|
|
614
|
+
? this.t('moved', {
|
|
615
|
+
title: this.titleOf(key),
|
|
616
|
+
row: tile.y + 1,
|
|
617
|
+
column: tile.x + 1,
|
|
618
|
+
})
|
|
619
|
+
: this.t('movedInOrder', {
|
|
620
|
+
title: this.titleOf(key),
|
|
621
|
+
position: index + 1,
|
|
622
|
+
total: placed.length,
|
|
623
|
+
});
|
|
624
|
+
};
|
|
625
|
+
}
|
|
626
|
+
resizedMessage(key, drawnIn) {
|
|
627
|
+
return (layout) => {
|
|
628
|
+
const tile = resolveTiles(layout, this.specs(), this.grid()).find((each) => each.key === key);
|
|
629
|
+
return tile === undefined
|
|
630
|
+
? ''
|
|
631
|
+
: this.t('resized', {
|
|
632
|
+
title: this.titleOf(key),
|
|
633
|
+
columns: drawnIn === 'medium' ? tile.medium : tile.w,
|
|
634
|
+
rows: tile.h,
|
|
635
|
+
});
|
|
636
|
+
};
|
|
637
|
+
}
|
|
638
|
+
move(key, direction, reason, source) {
|
|
639
|
+
const drawnIn = this.sizeClass();
|
|
640
|
+
const next = moveTileBy(this.currentLayout(), this.specs(), this.grid(), key, direction, drawnIn);
|
|
641
|
+
this.focusAfter = key;
|
|
642
|
+
if (!this.change(next, reason, { kind: 'move', key }, source, this.movedMessage(key, drawnIn))) {
|
|
643
|
+
this.focusAfter = null;
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
resize(key, columns, rows, reason, source) {
|
|
647
|
+
const drawnIn = this.sizeClass();
|
|
648
|
+
const next = resizeTileBy(this.currentLayout(), this.specs(), this.grid(), key, { columns, rows }, drawnIn);
|
|
649
|
+
this.focusAfter = key;
|
|
650
|
+
const message = this.resizedMessage(key, drawnIn);
|
|
651
|
+
if (!this.change(next, reason, { kind: 'resize', key }, source, message)) {
|
|
652
|
+
this.focusAfter = null;
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
hide(key, reason, source) {
|
|
656
|
+
const visible = this.visible();
|
|
657
|
+
const at = visible.findIndex((tile) => tile.key === key);
|
|
658
|
+
const tile = visible[at];
|
|
659
|
+
if (tile === undefined || !tile.removable)
|
|
660
|
+
return;
|
|
661
|
+
this.focusAfter = (visible[at + 1] ?? visible[at - 1])?.key ?? ADD;
|
|
662
|
+
const next = setTileHidden(this.currentLayout(), this.specs(), this.grid(), key, true);
|
|
663
|
+
const done = this.change(next, reason, { kind: 'hide', key }, source, () => this.t('hidden', { title: this.titleOf(key) }));
|
|
664
|
+
if (!done)
|
|
665
|
+
this.focusAfter = null;
|
|
666
|
+
}
|
|
667
|
+
show(key, reason, source) {
|
|
668
|
+
this.focusAfter = key;
|
|
669
|
+
const next = setTileHidden(this.currentLayout(), this.specs(), this.grid(), key, false);
|
|
670
|
+
this.change(next, reason, { kind: 'show', key }, source, () => this.t('shown', { title: this.titleOf(key) }));
|
|
671
|
+
}
|
|
672
|
+
reset(reason, source) {
|
|
673
|
+
this.change(EMPTY_LAYOUT, reason, { kind: 'reset', key: null }, source, () => this.t('resetDone'));
|
|
674
|
+
}
|
|
675
|
+
/** Leaves editing, as Done does. */
|
|
676
|
+
commitEditing(reason = 'programmatic', source) {
|
|
677
|
+
this.requestEditing(false, reason, source);
|
|
678
|
+
}
|
|
679
|
+
/** Asks for the layout editing began from, then leaves, as Cancel does. */
|
|
680
|
+
cancelEditing(reason = 'programmatic', source) {
|
|
681
|
+
const back = this.snapshot;
|
|
682
|
+
if (back !== null) {
|
|
683
|
+
this.change(back, 'dismiss', { kind: 'cancel', key: null }, source, () => this.t('cancelled'));
|
|
684
|
+
}
|
|
685
|
+
this.requestEditing(false, reason, source);
|
|
686
|
+
}
|
|
687
|
+
/** Focuses a widget's handle while editing, or the widget's first control. */
|
|
688
|
+
focusWidget(key) {
|
|
689
|
+
const target = (this.isEditing() ? this.handleOf(key) : null) ??
|
|
690
|
+
this.widgetNodes()
|
|
691
|
+
.get(key)
|
|
692
|
+
?.querySelector('a[href], button:not([disabled]), [tabindex]:not([tabindex="-1"])');
|
|
693
|
+
target?.focus();
|
|
694
|
+
}
|
|
695
|
+
/* ── Keyboard ─────────────────────────────────────────────────────── */
|
|
696
|
+
/**
|
|
697
|
+
* Taken in the capture phase, before the handle's menu trigger reads
|
|
698
|
+
* ArrowDown and ArrowUp: `Alt` and `Shift` with an arrow belong to the
|
|
699
|
+
* layout, and the trigger does not look at modifiers.
|
|
700
|
+
*/
|
|
701
|
+
onHandleKeyDown(event) {
|
|
702
|
+
const handle = event.target?.closest('[data-handle]');
|
|
703
|
+
const key = handle?.getAttribute('data-handle');
|
|
704
|
+
if (!handle || !key || !this.isEditing())
|
|
705
|
+
return;
|
|
706
|
+
const intent = dashboardKeyIntent(event, directionOf(handle));
|
|
707
|
+
if (intent === null)
|
|
708
|
+
return;
|
|
709
|
+
const tile = this.visible().find((each) => each.key === key);
|
|
710
|
+
if (tile === undefined)
|
|
711
|
+
return;
|
|
712
|
+
event.preventDefault();
|
|
713
|
+
event.stopPropagation();
|
|
714
|
+
if (intent.kind === 'move' && tile.movable)
|
|
715
|
+
this.move(key, intent.direction, 'keyboard', event);
|
|
716
|
+
if (intent.kind === 'resize' && tile.resizable) {
|
|
717
|
+
this.resize(key, intent.columns, intent.rows, 'keyboard', event);
|
|
718
|
+
}
|
|
719
|
+
if (intent.kind === 'hide')
|
|
720
|
+
this.hide(key, 'remove', event);
|
|
721
|
+
}
|
|
722
|
+
/* ── Pointer: resize ──────────────────────────────────────────────── */
|
|
723
|
+
onResizePointerDown(key, edge, event) {
|
|
724
|
+
if (event.button !== 0 || this.resizeTeardown !== null)
|
|
725
|
+
return;
|
|
726
|
+
const tile = this.visible().find((each) => each.key === key);
|
|
727
|
+
const list = this.list()?.nativeElement;
|
|
728
|
+
const element = this.widgetNodes().get(key);
|
|
729
|
+
if (tile === undefined || !tile.resizable || list === undefined || element === undefined) {
|
|
730
|
+
return;
|
|
731
|
+
}
|
|
732
|
+
event.preventDefault();
|
|
733
|
+
event.stopPropagation();
|
|
734
|
+
const drawnIn = this.sizeClass();
|
|
735
|
+
if (drawnIn === 'compact')
|
|
736
|
+
return;
|
|
737
|
+
const handle = event.currentTarget;
|
|
738
|
+
const rtl = directionOf(list) === 'rtl';
|
|
739
|
+
const tracks = tracksOf(list, this.grid()[drawnIn]);
|
|
740
|
+
const origin = originOf(element, list, rtl);
|
|
741
|
+
const start = { x: event.clientX, y: event.clientY };
|
|
742
|
+
const span = drawnIn === 'medium' ? tile.medium : tile.w;
|
|
743
|
+
const pullsStart = edge === 'start' || edge === 'bottom-start';
|
|
744
|
+
const pullsEnd = edge === 'end' || edge === 'bottom-end';
|
|
745
|
+
const pullsBottom = edge !== 'start' && edge !== 'end';
|
|
746
|
+
let snapped = { x: tile.x, y: tile.y, w: span, h: tile.h };
|
|
747
|
+
let preview = this.full(this.currentLayout());
|
|
748
|
+
writeOrigin(element, origin);
|
|
749
|
+
this.setGesture({ kind: 'resize', key, edge, preview, sizeClass: drawnIn });
|
|
750
|
+
const onMove = (moved) => {
|
|
751
|
+
const dx = moved.clientX - start.x;
|
|
752
|
+
const dy = moved.clientY - start.y;
|
|
753
|
+
/* Travel toward the inline end, whichever way the document reads. */
|
|
754
|
+
const along = rtl ? -dx : dx;
|
|
755
|
+
const floor = tracks.track;
|
|
756
|
+
const inlineSize = pullsEnd
|
|
757
|
+
? Math.max(floor, origin.inlineSize + along)
|
|
758
|
+
: pullsStart
|
|
759
|
+
? Math.max(floor, origin.inlineSize - along)
|
|
760
|
+
: origin.inlineSize;
|
|
761
|
+
const blockSize = pullsBottom
|
|
762
|
+
? Math.max(tracks.row, origin.blockSize + dy)
|
|
763
|
+
: origin.blockSize;
|
|
764
|
+
element.style.setProperty('--_dg-origin-inline-size', `${inlineSize}px`);
|
|
765
|
+
element.style.setProperty('--_dg-origin-block-size', `${blockSize}px`);
|
|
766
|
+
/* Pulled by its start, the widget keeps its end still: the element is
|
|
767
|
+
anchored at its start, so it moves by what it grew. */
|
|
768
|
+
const shift = pullsStart ? origin.inlineSize - inlineSize : 0;
|
|
769
|
+
element.style.setProperty('--_dg-lift-x', `${rtl ? -shift : shift}px`);
|
|
770
|
+
const w = spanFromTravel({
|
|
771
|
+
span,
|
|
772
|
+
track: tracks.track,
|
|
773
|
+
gap: tracks.columnGap,
|
|
774
|
+
travel: inlineSize - origin.inlineSize,
|
|
775
|
+
});
|
|
776
|
+
const h = pullsBottom
|
|
777
|
+
? spanFromTravel({
|
|
778
|
+
span: tile.h,
|
|
779
|
+
track: tracks.row,
|
|
780
|
+
gap: tracks.rowGap,
|
|
781
|
+
travel: blockSize - origin.blockSize,
|
|
782
|
+
})
|
|
783
|
+
: tile.h;
|
|
784
|
+
const x = pullsStart ? tile.x + tile.w - w : tile.x;
|
|
785
|
+
if (w === snapped.w && h === snapped.h && x === snapped.x)
|
|
786
|
+
return;
|
|
787
|
+
snapped = { x, y: tile.y, w, h };
|
|
788
|
+
preview = resizeTileInClass(this.currentLayout(), this.specs(), this.grid(), key, snapped, drawnIn);
|
|
789
|
+
this.setGesture({ kind: 'resize', key, edge, preview, sizeClass: drawnIn });
|
|
790
|
+
};
|
|
791
|
+
const finish = (commit, source) => {
|
|
792
|
+
this.resizeTeardown?.();
|
|
793
|
+
this.settleFrom = { key, box: boxOf(element) };
|
|
794
|
+
clearLift(element);
|
|
795
|
+
this.setGesture(null);
|
|
796
|
+
if (!commit)
|
|
797
|
+
return;
|
|
798
|
+
this.change(preview, 'pointer', { kind: 'resize', key }, source, this.resizedMessage(key, drawnIn));
|
|
799
|
+
};
|
|
800
|
+
const onUp = (up) => finish(true, up);
|
|
801
|
+
const onCancel = () => finish(false);
|
|
802
|
+
const onKey = (down) => {
|
|
803
|
+
if (down.key !== 'Escape')
|
|
804
|
+
return;
|
|
805
|
+
down.preventDefault();
|
|
806
|
+
down.stopPropagation();
|
|
807
|
+
finish(false);
|
|
808
|
+
};
|
|
809
|
+
const document = handle.ownerDocument;
|
|
810
|
+
handle.setPointerCapture?.(event.pointerId);
|
|
811
|
+
handle.addEventListener('pointermove', onMove);
|
|
812
|
+
handle.addEventListener('pointerup', onUp);
|
|
813
|
+
handle.addEventListener('pointercancel', onCancel);
|
|
814
|
+
document.addEventListener('keydown', onKey, true);
|
|
815
|
+
this.resizeTeardown = () => {
|
|
816
|
+
this.resizeTeardown = null;
|
|
817
|
+
handle.removeEventListener('pointermove', onMove);
|
|
818
|
+
handle.removeEventListener('pointerup', onUp);
|
|
819
|
+
handle.removeEventListener('pointercancel', onCancel);
|
|
820
|
+
document.removeEventListener('keydown', onKey, true);
|
|
821
|
+
if (handle.hasPointerCapture?.(event.pointerId)) {
|
|
822
|
+
handle.releasePointerCapture(event.pointerId);
|
|
823
|
+
}
|
|
824
|
+
};
|
|
825
|
+
}
|
|
826
|
+
/* ── Pointer: move ────────────────────────────────────────────────── */
|
|
827
|
+
/**
|
|
828
|
+
* One drag controller while editing, rebuilt when the set of widgets that
|
|
829
|
+
* can be picked up changes, and never while one is carried. A widget is
|
|
830
|
+
* picked up by its card, by a mouse or a pen — a finger on a card scrolls
|
|
831
|
+
* the page — and by its handle, by anything.
|
|
832
|
+
*/
|
|
833
|
+
syncDrag() {
|
|
834
|
+
const list = this.list()?.nativeElement;
|
|
835
|
+
const keys = this.isEditing()
|
|
836
|
+
? this.visible()
|
|
837
|
+
.filter((tile) => tile.movable)
|
|
838
|
+
.map((tile) => tile.key)
|
|
839
|
+
.sort()
|
|
840
|
+
.join('\n')
|
|
841
|
+
: '';
|
|
842
|
+
if (keys === this.dragKeys && (keys === '' || this.dragTeardown !== null))
|
|
843
|
+
return;
|
|
844
|
+
if (this.gesture()?.kind === 'move')
|
|
845
|
+
return;
|
|
846
|
+
this.dragTeardown?.();
|
|
847
|
+
this.dragTeardown = null;
|
|
848
|
+
this.dragKeys = keys;
|
|
849
|
+
if (keys === '' || list === undefined)
|
|
850
|
+
return;
|
|
851
|
+
const root = this.host.nativeElement;
|
|
852
|
+
const document = root.ownerDocument;
|
|
853
|
+
/** Where the press landed, and where in the widget. */
|
|
854
|
+
let press = null;
|
|
855
|
+
let target = null;
|
|
856
|
+
let drawnIn = 'expanded';
|
|
857
|
+
let rtl = false;
|
|
858
|
+
let tracks = null;
|
|
859
|
+
const onPress = (event) => {
|
|
860
|
+
const element = event.target?.closest('[data-part="widget"]');
|
|
861
|
+
if (!element || element.parentElement !== list)
|
|
862
|
+
return;
|
|
863
|
+
const box = element.getBoundingClientRect();
|
|
864
|
+
press = {
|
|
865
|
+
x: event.clientX,
|
|
866
|
+
y: event.clientY,
|
|
867
|
+
grabX: event.clientX - box.left,
|
|
868
|
+
grabY: event.clientY - box.top,
|
|
869
|
+
};
|
|
870
|
+
};
|
|
871
|
+
list.addEventListener('pointerdown', onPress, true);
|
|
872
|
+
/** The preview a target stands for. */
|
|
873
|
+
const previewOf = (key, at) => {
|
|
874
|
+
if (at.startsWith('swap:')) {
|
|
875
|
+
return swapTiles(this.currentLayout(), this.specs(), this.grid(), key, at.slice(5));
|
|
876
|
+
}
|
|
877
|
+
const [x, y] = at.split(',').map(Number);
|
|
878
|
+
return moveTile(this.currentLayout(), this.specs(), this.grid(), key, {
|
|
879
|
+
x: x ?? 0,
|
|
880
|
+
y: y ?? 0,
|
|
881
|
+
});
|
|
882
|
+
};
|
|
883
|
+
const controller = createDragController({
|
|
884
|
+
document,
|
|
885
|
+
restoreFocus: false,
|
|
886
|
+
preview: false,
|
|
887
|
+
autoScroll: { axis: 'y' },
|
|
888
|
+
t: this.dragT,
|
|
889
|
+
/* The move says what happened once, in the family's own words. */
|
|
890
|
+
silent: ['pickedUp', 'moved', 'dropped', 'cancelled'],
|
|
891
|
+
/**
|
|
892
|
+
* In the expanded class the target is a cell: the one the card's leading
|
|
893
|
+
* corner is nearest, so a widget lands where it is drawn under the
|
|
894
|
+
* pointer. In the classes that flow the target is the widget under the
|
|
895
|
+
* pointer, which the carried one exchanges places with.
|
|
896
|
+
*/
|
|
897
|
+
resolveTarget: (point) => {
|
|
898
|
+
const carried = controller.state.items[0];
|
|
899
|
+
if (carried === undefined || press === null || tracks === null)
|
|
900
|
+
return null;
|
|
901
|
+
const frame = list.getBoundingClientRect();
|
|
902
|
+
if (drawnIn === 'expanded') {
|
|
903
|
+
const left = point.x - press.grabX;
|
|
904
|
+
const top = point.y - press.grabY;
|
|
905
|
+
const tile = this.visible().find((each) => each.key === carried);
|
|
906
|
+
const width = tile ? tile.w * tracks.track + (tile.w - 1) * tracks.columnGap : 0;
|
|
907
|
+
const lead = rtl ? left + width - tracks.track / 2 : left + tracks.track / 2;
|
|
908
|
+
const cell = cellAt({ x: lead, y: top + tracks.row / 2 }, { left: frame.left, top: frame.top, width: frame.width }, { columns: tracks.columns, row: tracks.row, gap: tracks.columnGap }, rtl ? 'rtl' : 'ltr');
|
|
909
|
+
target = `${cell.x},${cell.y}`;
|
|
910
|
+
}
|
|
911
|
+
else {
|
|
912
|
+
for (const [key, element] of this.widgetNodes()) {
|
|
913
|
+
if (key === carried)
|
|
914
|
+
continue;
|
|
915
|
+
const rect = element.getBoundingClientRect();
|
|
916
|
+
if (point.x >= rect.left &&
|
|
917
|
+
point.x <= rect.right &&
|
|
918
|
+
point.y >= rect.top &&
|
|
919
|
+
point.y <= rect.bottom) {
|
|
920
|
+
target = `swap:${key}`;
|
|
921
|
+
break;
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
return target === null
|
|
926
|
+
? null
|
|
927
|
+
: { kind: 'on', container: GRID, key: target };
|
|
928
|
+
},
|
|
929
|
+
onTargetChange: ({ state }) => {
|
|
930
|
+
const key = state.items[0];
|
|
931
|
+
if (key === undefined || state.target?.kind !== 'on')
|
|
932
|
+
return;
|
|
933
|
+
this.setGesture({ kind: 'move', key, preview: previewOf(key, state.target.key) });
|
|
934
|
+
},
|
|
935
|
+
onDrop: ({ items, target: dropped, reason, event }) => {
|
|
936
|
+
const key = items[0];
|
|
937
|
+
if (key === undefined || dropped.kind !== 'on')
|
|
938
|
+
return;
|
|
939
|
+
this.focusAfter = null;
|
|
940
|
+
this.change(previewOf(key, dropped.key), reason === 'keyboard' ? 'keyboard' : 'pointer', { kind: 'move', key }, event, this.movedMessage(key, drawnIn));
|
|
941
|
+
},
|
|
942
|
+
});
|
|
943
|
+
const unregister = controller.registerContainer({
|
|
944
|
+
key: GRID,
|
|
945
|
+
items: () => this.visible().map((tile) => tile.key),
|
|
946
|
+
orientation: 'grid',
|
|
947
|
+
targets: ['on'],
|
|
948
|
+
element: () => list,
|
|
949
|
+
itemElement: (key) => this.widgetNodes().get(key) ?? null,
|
|
950
|
+
label: () => this.t('editBar'),
|
|
951
|
+
itemLabel: (key) => this.titleOf(key),
|
|
952
|
+
});
|
|
953
|
+
/* The click the browser fires after a pointer drag belongs to the drag,
|
|
954
|
+
not to the handle it started on, which would open the handle's menu. */
|
|
955
|
+
let swallow = false;
|
|
956
|
+
let dragging = null;
|
|
957
|
+
const onClick = (event) => {
|
|
958
|
+
if (!swallow)
|
|
959
|
+
return;
|
|
960
|
+
swallow = false;
|
|
961
|
+
event.preventDefault();
|
|
962
|
+
event.stopPropagation();
|
|
963
|
+
};
|
|
964
|
+
root.addEventListener('click', onClick, true);
|
|
965
|
+
const unsubscribe = controller.subscribe((state) => {
|
|
966
|
+
if (state.status !== 'dragging') {
|
|
967
|
+
if (dragging !== null) {
|
|
968
|
+
const element = this.widgetNodes().get(dragging);
|
|
969
|
+
if (element)
|
|
970
|
+
this.settleFrom = { key: dragging, box: boxOf(element) };
|
|
971
|
+
clearLift(element);
|
|
972
|
+
swallow = state.reason === 'pointer' || state.reason === null;
|
|
973
|
+
setTimeout(() => (swallow = false), 0);
|
|
974
|
+
dragging = null;
|
|
975
|
+
target = null;
|
|
976
|
+
if (this.gesture()?.kind === 'move')
|
|
977
|
+
this.setGesture(null);
|
|
978
|
+
}
|
|
979
|
+
return;
|
|
980
|
+
}
|
|
981
|
+
const key = state.items[0];
|
|
982
|
+
if (key === undefined || press === null)
|
|
983
|
+
return;
|
|
984
|
+
const element = this.widgetNodes().get(key);
|
|
985
|
+
if (element === undefined)
|
|
986
|
+
return;
|
|
987
|
+
if (dragging === null) {
|
|
988
|
+
dragging = key;
|
|
989
|
+
drawnIn = classOf(root);
|
|
990
|
+
rtl = directionOf(list) === 'rtl';
|
|
991
|
+
tracks = tracksOf(list, this.grid()[drawnIn]);
|
|
992
|
+
writeOrigin(element, originOf(element, list, rtl));
|
|
993
|
+
this.setGesture({ kind: 'move', key, preview: this.full(this.currentLayout()) });
|
|
994
|
+
}
|
|
995
|
+
if (state.point !== null) {
|
|
996
|
+
element.style.setProperty('--_dg-lift-x', `${state.point.x - press.x}px`);
|
|
997
|
+
element.style.setProperty('--_dg-lift-y', `${state.point.y - press.y}px`);
|
|
998
|
+
}
|
|
999
|
+
});
|
|
1000
|
+
const detachments = [];
|
|
1001
|
+
const nodes = this.widgetNodes();
|
|
1002
|
+
for (const tile of this.visible()) {
|
|
1003
|
+
if (!tile.movable)
|
|
1004
|
+
continue;
|
|
1005
|
+
const element = nodes.get(tile.key);
|
|
1006
|
+
if (element === undefined)
|
|
1007
|
+
continue;
|
|
1008
|
+
const card = this.cardOf(tile.key);
|
|
1009
|
+
const handle = this.handleOf(tile.key);
|
|
1010
|
+
if (card !== null) {
|
|
1011
|
+
detachments.push(controller.attachDraggable(element, {
|
|
1012
|
+
container: GRID,
|
|
1013
|
+
key: tile.key,
|
|
1014
|
+
handle: () => card,
|
|
1015
|
+
canDrag: (event) => event.pointerType !== 'touch',
|
|
1016
|
+
}));
|
|
1017
|
+
}
|
|
1018
|
+
if (handle !== null) {
|
|
1019
|
+
detachments.push(controller.attachDraggable(element, {
|
|
1020
|
+
container: GRID,
|
|
1021
|
+
key: tile.key,
|
|
1022
|
+
handle: () => handle,
|
|
1023
|
+
delay: { touch: 0 },
|
|
1024
|
+
}));
|
|
1025
|
+
}
|
|
1026
|
+
}
|
|
1027
|
+
this.dragTeardown = () => {
|
|
1028
|
+
for (const detach of detachments)
|
|
1029
|
+
detach();
|
|
1030
|
+
list.removeEventListener('pointerdown', onPress, true);
|
|
1031
|
+
root.removeEventListener('click', onClick, true);
|
|
1032
|
+
unsubscribe();
|
|
1033
|
+
unregister();
|
|
1034
|
+
controller.destroy();
|
|
1035
|
+
};
|
|
1036
|
+
}
|
|
1037
|
+
/* ── After a render ───────────────────────────────────────────────── */
|
|
1038
|
+
syncEditing() {
|
|
1039
|
+
const editing = this.isEditing();
|
|
1040
|
+
const document = this.host.nativeElement.ownerDocument;
|
|
1041
|
+
if (editing && !this.wasEditing) {
|
|
1042
|
+
this.snapshot = this.full(this.currentLayout());
|
|
1043
|
+
this.returnFocus = document.activeElement;
|
|
1044
|
+
}
|
|
1045
|
+
if (!editing && this.wasEditing) {
|
|
1046
|
+
const active = document.activeElement;
|
|
1047
|
+
const lost = active === null || active === document.body || !active.isConnected;
|
|
1048
|
+
const back = this.returnFocus;
|
|
1049
|
+
if (lost && back instanceof HTMLElement && back.isConnected)
|
|
1050
|
+
back.focus();
|
|
1051
|
+
this.snapshot = null;
|
|
1052
|
+
this.returnFocus = null;
|
|
1053
|
+
}
|
|
1054
|
+
this.wasEditing = editing;
|
|
1055
|
+
}
|
|
1056
|
+
timing() {
|
|
1057
|
+
const styles = getComputedStyle(this.host.nativeElement);
|
|
1058
|
+
return {
|
|
1059
|
+
duration: parseDuration(styles.getPropertyValue('--slotted-duration-medium')),
|
|
1060
|
+
easing: styles.getPropertyValue('--slotted-easing-standard').trim() || 'ease',
|
|
1061
|
+
};
|
|
1062
|
+
}
|
|
1063
|
+
settle() {
|
|
1064
|
+
const root = this.host.nativeElement;
|
|
1065
|
+
const before = this.flipFrom;
|
|
1066
|
+
if (before !== null) {
|
|
1067
|
+
this.flipFrom = null;
|
|
1068
|
+
playFlip(this.flipNodes(), before, this.timing());
|
|
1069
|
+
}
|
|
1070
|
+
const settling = this.settleFrom;
|
|
1071
|
+
if (settling !== null && this.gesture() === null) {
|
|
1072
|
+
this.settleFrom = null;
|
|
1073
|
+
const element = this.widgetNodes().get(settling.key);
|
|
1074
|
+
if (element)
|
|
1075
|
+
playResize(element, settling.box, this.timing());
|
|
1076
|
+
}
|
|
1077
|
+
const key = this.focusAfter;
|
|
1078
|
+
if (key === null)
|
|
1079
|
+
return;
|
|
1080
|
+
this.focusAfter = null;
|
|
1081
|
+
const target = key === ADD
|
|
1082
|
+
? root.querySelector('[data-dashboard-add]')
|
|
1083
|
+
: this.isEditing()
|
|
1084
|
+
? this.handleOf(key)
|
|
1085
|
+
: null;
|
|
1086
|
+
if (target && target !== root.ownerDocument.activeElement)
|
|
1087
|
+
target.focus();
|
|
1088
|
+
}
|
|
1089
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlDashboardGrid, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1090
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: SlDashboardGrid, isStandalone: true, selector: "[slDashboardGrid]", inputs: { layout: { classPropertyName: "layout", publicName: "layout", isSignal: true, isRequired: false, transformFunction: null }, defaultLayout: { classPropertyName: "defaultLayout", publicName: "defaultLayout", isSignal: true, isRequired: false, transformFunction: null }, editing: { classPropertyName: "editing", publicName: "editing", isSignal: true, isRequired: false, transformFunction: null }, defaultEditing: { classPropertyName: "defaultEditing", publicName: "defaultEditing", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, editBar: { classPropertyName: "editBar", publicName: "editBar", isSignal: true, isRequired: false, transformFunction: null }, headingLevel: { classPropertyName: "headingLevel", publicName: "headingLevel", isSignal: true, isRequired: false, transformFunction: null }, messages: { classPropertyName: "messages", publicName: "messages", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { layout: "layoutChange", editing: "editingChange", layoutChangeRequest: "layoutChangeRequest", editingChangeRequest: "editingChangeRequest" }, host: { attributes: { "data-ui": "dashboard-grid", "data-part": "root" }, properties: { "attr.data-editing": "isEditing() ? \"\" : null", "attr.data-gesture": "gesture() === null ? null : \"\"", "attr.aria-label": "null", "attr.aria-labelledby": "null", "style.--_dg-columns-expanded": "grid().expanded", "style.--_dg-columns-medium": "grid().medium", "style.--_dg-columns-compact": "grid().compact" } }, queries: [{ propertyName: "widgets", predicate: SlDashboardWidget, isSignal: true }], viewQueries: [{ propertyName: "list", first: true, predicate: ["list"], descendants: true, isSignal: true }], exportAs: ["slDashboardGrid"], ngImport: i0, template: `
|
|
1091
|
+
@if (isEditing() && resolvedEditBar()) {
|
|
1092
|
+
<div data-part="edit-bar" role="group" [attr.aria-label]="t('editBar')">
|
|
1093
|
+
<p data-part="edit-status" [id]="statusId">{{ t('editStatus') }}</p>
|
|
1094
|
+
<div data-part="edit-actions">
|
|
1095
|
+
@if (hiddenTiles().length > 0) {
|
|
1096
|
+
<button
|
|
1097
|
+
slButton
|
|
1098
|
+
slDashboardPart="add"
|
|
1099
|
+
data-dashboard-add
|
|
1100
|
+
size="sm"
|
|
1101
|
+
tone="secondary"
|
|
1102
|
+
variant="outline"
|
|
1103
|
+
[slMenuTriggerFor]="addMenu"
|
|
1104
|
+
>
|
|
1105
|
+
<span slButtonStart
|
|
1106
|
+
><span slIcon><svg slGlyph name="plus"></svg></span></span
|
|
1107
|
+
>{{ t('add') }}
|
|
1108
|
+
</button>
|
|
1109
|
+
<sl-menu #addMenu>
|
|
1110
|
+
@for (tile of hiddenTiles(); track tile.key) {
|
|
1111
|
+
<button slMenuItem (select)="show(tile.key, reasonOf($event), $event.source)">
|
|
1112
|
+
{{ titleOf(tile.key) }}
|
|
1113
|
+
</button>
|
|
1114
|
+
}
|
|
1115
|
+
</sl-menu>
|
|
1116
|
+
}
|
|
1117
|
+
<button
|
|
1118
|
+
slButton
|
|
1119
|
+
slDashboardPart="reset"
|
|
1120
|
+
size="sm"
|
|
1121
|
+
tone="secondary"
|
|
1122
|
+
variant="ghost"
|
|
1123
|
+
(click)="reset(pressReason($event), $event)"
|
|
1124
|
+
>
|
|
1125
|
+
{{ t('reset') }}
|
|
1126
|
+
</button>
|
|
1127
|
+
<button
|
|
1128
|
+
slButton
|
|
1129
|
+
slDashboardPart="cancel"
|
|
1130
|
+
size="sm"
|
|
1131
|
+
tone="secondary"
|
|
1132
|
+
variant="outline"
|
|
1133
|
+
(click)="cancelEditing(pressReason($event), $event)"
|
|
1134
|
+
>
|
|
1135
|
+
{{ t('cancel') }}
|
|
1136
|
+
</button>
|
|
1137
|
+
<button
|
|
1138
|
+
slButton
|
|
1139
|
+
slDashboardPart="done"
|
|
1140
|
+
size="sm"
|
|
1141
|
+
tone="accent"
|
|
1142
|
+
variant="solid"
|
|
1143
|
+
(click)="commitEditing('submit', $event)"
|
|
1144
|
+
>
|
|
1145
|
+
{{ t('done') }}
|
|
1146
|
+
</button>
|
|
1147
|
+
</div>
|
|
1148
|
+
</div>
|
|
1149
|
+
}
|
|
1150
|
+
@if (isEditing() && !resolvedEditBar()) {
|
|
1151
|
+
<p data-part="edit-status" data-ui="visually-hidden" [id]="statusId">
|
|
1152
|
+
{{ t('editStatus') }}
|
|
1153
|
+
</p>
|
|
1154
|
+
}
|
|
1155
|
+
<ul
|
|
1156
|
+
#list
|
|
1157
|
+
data-part="grid"
|
|
1158
|
+
role="list"
|
|
1159
|
+
[attr.aria-label]="ariaLabel() ?? null"
|
|
1160
|
+
[attr.aria-labelledby]="ariaLabelledBy() ?? null"
|
|
1161
|
+
[hidden]="slots().length === 0"
|
|
1162
|
+
>
|
|
1163
|
+
@for (slot of slots(); track slot.tile.key) {
|
|
1164
|
+
<li
|
|
1165
|
+
data-part="widget"
|
|
1166
|
+
[attr.data-key]="slot.tile.key"
|
|
1167
|
+
[attr.data-status]="slot.widget.status()"
|
|
1168
|
+
[attr.data-loading]="slot.widget.painted() ? '' : null"
|
|
1169
|
+
[attr.data-movable]="slot.tile.movable ? '' : null"
|
|
1170
|
+
[attr.data-resizable]="slot.tile.resizable ? '' : null"
|
|
1171
|
+
[attr.data-dragging]="slot.dragging ? '' : null"
|
|
1172
|
+
[attr.data-resizing]="slot.resizing ? '' : null"
|
|
1173
|
+
[style]="slot.style"
|
|
1174
|
+
>
|
|
1175
|
+
<article
|
|
1176
|
+
slCard
|
|
1177
|
+
[fill]="slot.widget.fill()"
|
|
1178
|
+
[size]="slot.widget.size()"
|
|
1179
|
+
[attr.aria-labelledby]="titleId(slot.tile.key)"
|
|
1180
|
+
[attr.aria-describedby]="
|
|
1181
|
+
slot.widget.description() === undefined
|
|
1182
|
+
? null
|
|
1183
|
+
: titleId(slot.tile.key) + '-description'
|
|
1184
|
+
"
|
|
1185
|
+
[attr.aria-busy]="slot.widget.painted() || slot.widget.busy() ? true : null"
|
|
1186
|
+
>
|
|
1187
|
+
<div slCardHeader>
|
|
1188
|
+
@switch (levelOf(slot.widget)) {
|
|
1189
|
+
@case (2) {
|
|
1190
|
+
<h2 data-part="title" [id]="titleId(slot.tile.key)">{{ slot.widget.title() }}</h2>
|
|
1191
|
+
}
|
|
1192
|
+
@case (4) {
|
|
1193
|
+
<h4 data-part="title" [id]="titleId(slot.tile.key)">{{ slot.widget.title() }}</h4>
|
|
1194
|
+
}
|
|
1195
|
+
@case (5) {
|
|
1196
|
+
<h5 data-part="title" [id]="titleId(slot.tile.key)">{{ slot.widget.title() }}</h5>
|
|
1197
|
+
}
|
|
1198
|
+
@case (6) {
|
|
1199
|
+
<h6 data-part="title" [id]="titleId(slot.tile.key)">{{ slot.widget.title() }}</h6>
|
|
1200
|
+
}
|
|
1201
|
+
@default {
|
|
1202
|
+
<h3 data-part="title" [id]="titleId(slot.tile.key)">{{ slot.widget.title() }}</h3>
|
|
1203
|
+
}
|
|
1204
|
+
}
|
|
1205
|
+
@if (slot.widget.description(); as description) {
|
|
1206
|
+
<p data-part="description" [id]="titleId(slot.tile.key) + '-description'">
|
|
1207
|
+
{{ description }}
|
|
1208
|
+
</p>
|
|
1209
|
+
}
|
|
1210
|
+
@if (
|
|
1211
|
+
slot.widget.hasActions() ||
|
|
1212
|
+
slot.widget.detailHref() !== undefined ||
|
|
1213
|
+
slot.widget.detailable()
|
|
1214
|
+
) {
|
|
1215
|
+
<div slCardActions>
|
|
1216
|
+
<ng-container [ngTemplateOutlet]="slot.widget.actionsTemplate()" />
|
|
1217
|
+
@if (slot.widget.detailHref(); as href) {
|
|
1218
|
+
<a
|
|
1219
|
+
data-ui="button"
|
|
1220
|
+
data-part="detail"
|
|
1221
|
+
data-tone="secondary"
|
|
1222
|
+
data-variant="ghost"
|
|
1223
|
+
data-size="sm"
|
|
1224
|
+
data-shape="square"
|
|
1225
|
+
[attr.href]="href"
|
|
1226
|
+
[attr.aria-label]="t('detail', { title: slot.widget.title() })"
|
|
1227
|
+
(click)="slot.widget.detail.emit($event)"
|
|
1228
|
+
><span data-part="icon" aria-hidden="true"
|
|
1229
|
+
><span slIcon directional><svg slGlyph name="external"></svg></span></span
|
|
1230
|
+
></a>
|
|
1231
|
+
} @else if (slot.widget.detailable()) {
|
|
1232
|
+
<button
|
|
1233
|
+
slIconButton
|
|
1234
|
+
slDashboardPart="detail"
|
|
1235
|
+
size="sm"
|
|
1236
|
+
tone="secondary"
|
|
1237
|
+
variant="ghost"
|
|
1238
|
+
[attr.aria-label]="t('detail', { title: slot.widget.title() })"
|
|
1239
|
+
(click)="slot.widget.detail.emit($event)"
|
|
1240
|
+
>
|
|
1241
|
+
<span slIcon directional><svg slGlyph name="external"></svg></span>
|
|
1242
|
+
</button>
|
|
1243
|
+
}
|
|
1244
|
+
</div>
|
|
1245
|
+
}
|
|
1246
|
+
</div>
|
|
1247
|
+
<div slCardBody>
|
|
1248
|
+
@if (slot.widget.busy() && !slot.widget.painted()) {
|
|
1249
|
+
<span data-part="busy-indicator" aria-hidden="true"></span>
|
|
1250
|
+
}
|
|
1251
|
+
@if (slot.widget.painted()) {
|
|
1252
|
+
<div data-part="skeleton">
|
|
1253
|
+
@if (slot.widget.hasSkeleton()) {
|
|
1254
|
+
<ng-container [ngTemplateOutlet]="slot.widget.skeletonTemplate()" />
|
|
1255
|
+
} @else {
|
|
1256
|
+
<span slSkeleton shape="block"></span>
|
|
1257
|
+
}
|
|
1258
|
+
</div>
|
|
1259
|
+
} @else if (slot.widget.status() === 'empty') {
|
|
1260
|
+
<div data-part="message">
|
|
1261
|
+
<section slResultState status="empty" reach="section" align="center" live="off">
|
|
1262
|
+
<div slResultStateContent>
|
|
1263
|
+
<div slResultStateTitle>
|
|
1264
|
+
{{ slot.widget.emptyTitle() ?? t('emptyTitle') }}
|
|
1265
|
+
</div>
|
|
1266
|
+
@if (slot.widget.emptyDescription(); as description) {
|
|
1267
|
+
<p slResultStateDescription>{{ description }}</p>
|
|
1268
|
+
}
|
|
1269
|
+
</div>
|
|
1270
|
+
@if (slot.widget.hasEmptyAction()) {
|
|
1271
|
+
<div slResultStateActions>
|
|
1272
|
+
<ng-container [ngTemplateOutlet]="slot.widget.emptyActionTemplate()" />
|
|
1273
|
+
</div>
|
|
1274
|
+
}
|
|
1275
|
+
</section>
|
|
1276
|
+
</div>
|
|
1277
|
+
} @else if (slot.widget.status() === 'error') {
|
|
1278
|
+
<div data-part="message">
|
|
1279
|
+
<section
|
|
1280
|
+
slResultState
|
|
1281
|
+
status="error"
|
|
1282
|
+
reach="section"
|
|
1283
|
+
align="center"
|
|
1284
|
+
live="polite"
|
|
1285
|
+
>
|
|
1286
|
+
<div slResultStateContent>
|
|
1287
|
+
<div slResultStateTitle>
|
|
1288
|
+
{{ slot.widget.errorTitle() ?? t('errorTitle') }}
|
|
1289
|
+
</div>
|
|
1290
|
+
@if (slot.widget.errorDescription(); as description) {
|
|
1291
|
+
<p slResultStateDescription>{{ description }}</p>
|
|
1292
|
+
}
|
|
1293
|
+
</div>
|
|
1294
|
+
@if (slot.widget.retryable()) {
|
|
1295
|
+
<div slResultStateActions>
|
|
1296
|
+
<button
|
|
1297
|
+
slButton
|
|
1298
|
+
slDashboardPart="retry"
|
|
1299
|
+
size="sm"
|
|
1300
|
+
tone="secondary"
|
|
1301
|
+
variant="outline"
|
|
1302
|
+
(click)="slot.widget.retry.emit($event)"
|
|
1303
|
+
>
|
|
1304
|
+
<span slButtonStart
|
|
1305
|
+
><span slIcon><svg slGlyph name="rotate-ccw"></svg></span></span
|
|
1306
|
+
>{{ t('retry') }}
|
|
1307
|
+
</button>
|
|
1308
|
+
</div>
|
|
1309
|
+
}
|
|
1310
|
+
</section>
|
|
1311
|
+
</div>
|
|
1312
|
+
} @else {
|
|
1313
|
+
<ng-container [ngTemplateOutlet]="slot.widget.bodyTemplate()" />
|
|
1314
|
+
}
|
|
1315
|
+
</div>
|
|
1316
|
+
@if (slot.widget.hasFooter()) {
|
|
1317
|
+
<div slCardFooter>
|
|
1318
|
+
<ng-container [ngTemplateOutlet]="slot.widget.footerTemplate()" />
|
|
1319
|
+
</div>
|
|
1320
|
+
}
|
|
1321
|
+
</article>
|
|
1322
|
+
@if (slot.handle) {
|
|
1323
|
+
<button
|
|
1324
|
+
slDashboardPart="handle"
|
|
1325
|
+
[attr.data-handle]="slot.tile.key"
|
|
1326
|
+
[attr.aria-label]="t('handle', { title: slot.widget.title() })"
|
|
1327
|
+
[attr.aria-describedby]="statusId"
|
|
1328
|
+
[attr.aria-keyshortcuts]="shortcuts(slot.tile.removable)"
|
|
1329
|
+
[slMenuTriggerFor]="handleMenu"
|
|
1330
|
+
>
|
|
1331
|
+
<span slIcon><svg slGlyph name="grip-horizontal"></svg></span>
|
|
1332
|
+
</button>
|
|
1333
|
+
<sl-menu #handleMenu>
|
|
1334
|
+
@if (slot.tile.movable) {
|
|
1335
|
+
<button
|
|
1336
|
+
slMenuItem
|
|
1337
|
+
shortcut="Alt+ArrowUp"
|
|
1338
|
+
[disabled]="!slot.can.up"
|
|
1339
|
+
(select)="move(slot.tile.key, 'up', reasonOf($event), $event.source)"
|
|
1340
|
+
>
|
|
1341
|
+
{{ t('moveUp') }}
|
|
1342
|
+
</button>
|
|
1343
|
+
<button
|
|
1344
|
+
slMenuItem
|
|
1345
|
+
shortcut="Alt+ArrowDown"
|
|
1346
|
+
[disabled]="!slot.can.down"
|
|
1347
|
+
(select)="move(slot.tile.key, 'down', reasonOf($event), $event.source)"
|
|
1348
|
+
>
|
|
1349
|
+
{{ t('moveDown') }}
|
|
1350
|
+
</button>
|
|
1351
|
+
@if (!flows()) {
|
|
1352
|
+
<button
|
|
1353
|
+
slMenuItem
|
|
1354
|
+
shortcut="Alt+ArrowLeft"
|
|
1355
|
+
[disabled]="!slot.can.left"
|
|
1356
|
+
(select)="move(slot.tile.key, 'left', reasonOf($event), $event.source)"
|
|
1357
|
+
>
|
|
1358
|
+
{{ t('moveStart') }}
|
|
1359
|
+
</button>
|
|
1360
|
+
<button
|
|
1361
|
+
slMenuItem
|
|
1362
|
+
shortcut="Alt+ArrowRight"
|
|
1363
|
+
[disabled]="!slot.can.right"
|
|
1364
|
+
(select)="move(slot.tile.key, 'right', reasonOf($event), $event.source)"
|
|
1365
|
+
>
|
|
1366
|
+
{{ t('moveEnd') }}
|
|
1367
|
+
</button>
|
|
1368
|
+
}
|
|
1369
|
+
}
|
|
1370
|
+
@if (slot.tile.movable && slot.sizable) {
|
|
1371
|
+
<hr slMenuSeparator />
|
|
1372
|
+
}
|
|
1373
|
+
@if (slot.sizable) {
|
|
1374
|
+
<button
|
|
1375
|
+
slMenuItem
|
|
1376
|
+
shortcut="Shift+ArrowRight"
|
|
1377
|
+
[disabled]="!slot.can.wider"
|
|
1378
|
+
(select)="resize(slot.tile.key, 1, 0, reasonOf($event), $event.source)"
|
|
1379
|
+
>
|
|
1380
|
+
{{ t('wider') }}
|
|
1381
|
+
</button>
|
|
1382
|
+
<button
|
|
1383
|
+
slMenuItem
|
|
1384
|
+
shortcut="Shift+ArrowLeft"
|
|
1385
|
+
[disabled]="!slot.can.narrower"
|
|
1386
|
+
(select)="resize(slot.tile.key, -1, 0, reasonOf($event), $event.source)"
|
|
1387
|
+
>
|
|
1388
|
+
{{ t('narrower') }}
|
|
1389
|
+
</button>
|
|
1390
|
+
<button
|
|
1391
|
+
slMenuItem
|
|
1392
|
+
shortcut="Shift+ArrowDown"
|
|
1393
|
+
[disabled]="!slot.can.taller"
|
|
1394
|
+
(select)="resize(slot.tile.key, 0, 1, reasonOf($event), $event.source)"
|
|
1395
|
+
>
|
|
1396
|
+
{{ t('taller') }}
|
|
1397
|
+
</button>
|
|
1398
|
+
<button
|
|
1399
|
+
slMenuItem
|
|
1400
|
+
shortcut="Shift+ArrowUp"
|
|
1401
|
+
[disabled]="!slot.can.shorter"
|
|
1402
|
+
(select)="resize(slot.tile.key, 0, -1, reasonOf($event), $event.source)"
|
|
1403
|
+
>
|
|
1404
|
+
{{ t('shorter') }}
|
|
1405
|
+
</button>
|
|
1406
|
+
}
|
|
1407
|
+
@if (slot.tile.removable) {
|
|
1408
|
+
@if (slot.tile.movable || slot.sizable) {
|
|
1409
|
+
<hr slMenuSeparator />
|
|
1410
|
+
}
|
|
1411
|
+
<button
|
|
1412
|
+
slMenuItem
|
|
1413
|
+
tone="danger"
|
|
1414
|
+
shortcut="Delete"
|
|
1415
|
+
(select)="hide(slot.tile.key, 'remove', $event.source)"
|
|
1416
|
+
>
|
|
1417
|
+
{{ t('hide') }}
|
|
1418
|
+
</button>
|
|
1419
|
+
}
|
|
1420
|
+
</sl-menu>
|
|
1421
|
+
}
|
|
1422
|
+
@if (isEditing() && slot.sizable) {
|
|
1423
|
+
@for (edge of edges; track edge) {
|
|
1424
|
+
<span
|
|
1425
|
+
data-part="resize-handle"
|
|
1426
|
+
aria-hidden="true"
|
|
1427
|
+
[attr.data-edge]="edge"
|
|
1428
|
+
[attr.data-active]="slot.edge === edge ? '' : null"
|
|
1429
|
+
(pointerdown)="onResizePointerDown(slot.tile.key, edge, $event)"
|
|
1430
|
+
></span>
|
|
1431
|
+
}
|
|
1432
|
+
}
|
|
1433
|
+
@if (slot.readout !== null) {
|
|
1434
|
+
<span data-part="size-readout" aria-hidden="true" [attr.data-edge]="slot.edge">{{
|
|
1435
|
+
slot.readout
|
|
1436
|
+
}}</span>
|
|
1437
|
+
}
|
|
1438
|
+
</li>
|
|
1439
|
+
}
|
|
1440
|
+
@if (placeholder(); as style) {
|
|
1441
|
+
<li data-part="placeholder" aria-hidden="true" [style]="style"></li>
|
|
1442
|
+
}
|
|
1443
|
+
</ul>
|
|
1444
|
+
@if (slots().length === 0) {
|
|
1445
|
+
<div data-part="empty">
|
|
1446
|
+
<section slResultState status="empty" reach="section" live="polite">
|
|
1447
|
+
<div slResultStateContent>
|
|
1448
|
+
<div slResultStateTitle>{{ t('empty') }}</div>
|
|
1449
|
+
@if (isEditing()) {
|
|
1450
|
+
<p slResultStateDescription>{{ t('emptyEditing') }}</p>
|
|
1451
|
+
}
|
|
1452
|
+
</div>
|
|
1453
|
+
</section>
|
|
1454
|
+
</div>
|
|
1455
|
+
}
|
|
1456
|
+
`, isInline: true, styles: ["@layer slotted.components{[data-ui=dashboard-grid]{--_gap: var(--slotted-dashboard-grid-gap, var(--slotted-space-6, 1rem));--_row: var(--slotted-dashboard-grid-row-size, 4.5rem);--_cols: var(--_dg-columns-expanded, 12);--_radius: var(--slotted-card-radius, var(--slotted-radius-lg, 8px));--_accent: var(--slotted-dashboard-grid-accent, var(--slotted-tone-accent-solid, Highlight));container:dashboard-grid / inline-size;display:flex;flex-direction:column;gap:var(--_gap);min-inline-size:0}[data-ui=dashboard-grid]>[data-part=grid]{display:grid;gap:var(--_gap);grid-auto-rows:var(--_row);grid-template-columns:repeat(var(--_cols),minmax(0,1fr));list-style:none;margin:0;min-inline-size:0;padding:0;position:relative}[data-ui=dashboard-grid] [data-part=grid][hidden],[data-ui=dashboard-grid] [data-part=widget][hidden]{display:none}[data-ui=dashboard-grid] :is([data-part=widget],[data-part=placeholder]){grid-column:var(--_dg-x, auto) / span var(--_dg-w, 4);grid-row:var(--_dg-y, auto) / span var(--_dg-h, 2);min-block-size:0;min-inline-size:0}[data-ui=dashboard-grid] [data-part=widget]{display:flex;position:relative}@container dashboard-grid (width < 1024px){[data-ui=dashboard-grid]>[data-part=grid]{--_cols: var(--_dg-columns-medium, 6)}[data-ui=dashboard-grid] :is([data-part=widget],[data-part=placeholder]){grid-column:auto / span var(--_dg-span-medium, 3);grid-row:auto / span var(--_dg-h, 2)}}@container dashboard-grid (width < 600px){[data-ui=dashboard-grid]>[data-part=grid]{--_cols: var(--_dg-columns-compact, 1);grid-auto-rows:auto}[data-ui=dashboard-grid] :is([data-part=widget],[data-part=placeholder]){grid-column:1 / -1;grid-row:auto}[data-ui=dashboard-grid] [data-part=placeholder]{min-block-size:calc(var(--_row) * 2)}}[data-ui=dashboard-grid] [data-part=widget]>[data-ui=card]{flex:1 1 auto;min-block-size:0;min-inline-size:0;transition:box-shadow var(--slotted-duration-medium) var(--slotted-easing-standard)}[data-ui=dashboard-grid] [data-part=widget]>[data-ui=card]>[data-part=body]{--slotted-chart-plot-block-size: calc(var(--_row) * 1.5);display:flex;flex-direction:column;overflow:auto;position:relative}[data-ui=dashboard-grid] [data-part=widget]>[data-ui=card]>[data-part=body]>:not([data-part=busy-indicator]){flex:1 0 auto}[data-ui=dashboard-grid] [data-part=widget] [data-part=title]{-webkit-box-orient:vertical;color:var(--slotted-dashboard-grid-title-color, var(--slotted-text, CanvasText));display:-webkit-box;font-family:var( --slotted-dashboard-grid-title-font-family, var( --slotted-font-family-heading, var(--slotted-font-family-sans, ui-sans-serif, system-ui, sans-serif) ) );font-size:var( --slotted-dashboard-grid-title-font-size, var(--slotted-font-size-md, .8125rem) );font-weight:var(--slotted-font-weight-semibold, 600);-webkit-line-clamp:2;line-clamp:2;line-height:var(--slotted-line-height-md, 1.5);margin:0;overflow:hidden;overflow-wrap:anywhere}[data-ui=dashboard-grid] [data-part=widget] [data-part=description]{color:var(--slotted-dashboard-grid-description-color, var(--slotted-text-muted, GrayText));font-size:var(--slotted-font-size-sm, .75rem);line-height:var(--slotted-line-height-sm, 1.5);margin:0;overflow-wrap:anywhere}[data-ui=dashboard-grid] [data-part=widget] [data-part=actions]{flex-wrap:nowrap;gap:var(--slotted-space-1, .125rem);margin-block:calc((var(--slotted-control-height-sm, 1.75rem) - var(--slotted-font-size-md, .8125rem) * var(--slotted-line-height-md, 1.5)) / -2)}[data-ui=dashboard-grid] [data-part=widget] [data-part=skeleton]{display:flex;flex-direction:column;min-block-size:var(--slotted-space-12, 4rem)}[data-ui=dashboard-grid] [data-part=widget] [data-part=skeleton]>[data-ui=skeleton]{block-size:auto;flex:1 1 auto;inline-size:100%}[data-ui=dashboard-grid] [data-part=widget] [data-part=message]{align-content:center;display:grid;justify-items:center}[data-ui=dashboard-grid] [data-part=widget] [data-part=busy-indicator]{background-color:var(--_accent);block-size:var(--slotted-border-width-medium, 2px);inset-block-start:0;inset-inline:0;opacity:.35;pointer-events:none;position:absolute}@media(prefers-reduced-motion:no-preference){[data-ui=dashboard-grid] [data-part=widget] [data-part=busy-indicator]{animation:slotted-dashboard-grid-busy var(--slotted-duration-loop-slow) linear infinite;background-color:transparent;background-image:linear-gradient(to right,transparent,var(--_accent) 50%,transparent);background-repeat:no-repeat;background-size:40% 100%;opacity:1}}@media(prefers-reduced-motion:reduce){[data-ui=dashboard-grid] [data-part=widget] [data-part=busy-indicator]{animation:none}}@keyframes slotted-dashboard-grid-busy{0%{background-position:-40% 0}to{background-position:140% 0}}[data-ui=dashboard-grid]>[data-part=edit-bar]{align-items:center;background-color:var( --slotted-dashboard-grid-edit-bar-background, var(--slotted-surface-raised, Canvas) );border:var(--slotted-border-width-thin, 1px) solid var(--slotted-dashboard-grid-edit-bar-border, var(--slotted-border-subtle, CanvasText));border-radius:var(--_radius);box-shadow:var(--slotted-shadow-xs);display:flex;flex-wrap:wrap;gap:var(--slotted-space-4, .5rem) var(--slotted-space-6, 1rem);padding-block:var(--slotted-space-4, .5rem);padding-inline:var(--slotted-space-6, 1rem) var(--slotted-space-4, .5rem)}@starting-style{[data-ui=dashboard-grid]>[data-part=edit-bar]{opacity:0;translate:0 calc(var(--slotted-space-4, .5rem) * -1)}}[data-ui=dashboard-grid]>[data-part=edit-bar]{transition:opacity var(--slotted-duration-medium) var(--slotted-easing-enter),translate var(--slotted-duration-medium) var(--slotted-easing-enter)}[data-ui=dashboard-grid]>[data-part=edit-bar]>[data-part=edit-status]{color:var(--slotted-text-muted, GrayText);flex:1 1 20rem;font-size:var(--slotted-font-size-sm, .75rem);line-height:var(--slotted-line-height-sm, 1.5);margin:0;min-inline-size:0}[data-ui=dashboard-grid]>[data-part=edit-bar]>[data-part=edit-actions]{align-items:center;display:flex;flex-wrap:wrap;gap:var(--slotted-space-3, .375rem);justify-content:flex-end;margin-inline-start:auto}[data-ui=dashboard-grid]>[data-part=grid]:before{background-image:radial-gradient(circle at calc((100% - var(--_gap)) / 2) calc((100% - var(--_gap)) / 2),var(--slotted-dashboard-grid-lattice-color, var(--slotted-border-strong, currentColor)) var(--slotted-dashboard-grid-lattice-dot, 1.5px),transparent calc(var(--slotted-dashboard-grid-lattice-dot, 1.5px) + .75px));background-size:calc((100% + var(--_gap)) / var(--_cols)) calc(var(--_row) + var(--_gap));content:\"\";inset:0;opacity:0;pointer-events:none;position:absolute;transition:opacity var(--slotted-duration-medium) var(--slotted-easing-standard)}[data-ui=dashboard-grid][data-editing]>[data-part=grid]{min-block-size:calc(var(--_row) * 2 + var(--_gap))}[data-ui=dashboard-grid][data-editing]>[data-part=grid]:before{opacity:.7}[data-ui=dashboard-grid][data-gesture]>[data-part=grid]:before{opacity:1}@container dashboard-grid (width < 1024px){[data-ui=dashboard-grid]>[data-part=grid]:before{display:none}}[data-ui=dashboard-grid][data-editing] [data-part=widget][data-movable]>[data-ui=card]{cursor:grab}[data-ui=dashboard-grid][data-editing] [data-part=widget][data-movable]>[data-ui=card] :is(a,button,input,select,textarea,[tabindex]){cursor:auto}[data-ui=dashboard-grid][data-editing] [data-part=widget]:not([data-loading]):hover>[data-ui=card]{box-shadow:var(--slotted-shadow-sm)}[data-ui=dashboard-grid] [data-part=widget]>[data-part=handle]{--_pill-inline: var(--slotted-dashboard-grid-handle-inline-size, 2.25rem);--_pill-block: var(--slotted-dashboard-grid-handle-block-size, 1rem);align-items:center;appearance:none;background-color:var(--slotted-control-surface, Canvas);block-size:var(--_pill-block);border:var(--slotted-border-width-thin, 1px) solid var(--slotted-control-border-color, ButtonBorder);border-radius:var(--slotted-radius-full, 9999px);box-shadow:var(--slotted-control-shadow);box-sizing:border-box;color:var(--slotted-text-muted, GrayText);cursor:grab;display:flex;font:inherit;inline-size:var(--_pill-inline);inset-block-start:calc(var(--_pill-block) / -2);inset-inline:0;justify-content:center;margin:0 auto;padding:0;position:absolute;touch-action:none;transition:background-color var(--slotted-duration-short) var(--slotted-easing-standard),border-color var(--slotted-duration-short) var(--slotted-easing-standard),color var(--slotted-duration-short) var(--slotted-easing-standard),opacity var(--slotted-duration-medium) var(--slotted-easing-enter),translate var(--slotted-duration-medium) var(--slotted-easing-enter);z-index:2}@starting-style{[data-ui=dashboard-grid] [data-part=widget]>[data-part=handle]{opacity:0;translate:0 var(--slotted-space-3, .375rem)}}[data-ui=dashboard-grid] [data-part=widget]>[data-part=handle]:before{content:\"\";inset:calc((var(--slotted-target-min, 24px) - var(--_pill-block)) / -2) calc(var(--slotted-space-4, .5rem) * -1);position:absolute}[data-ui=dashboard-grid] [data-part=widget]>[data-part=handle]>[data-ui=icon]{--slotted-icon-size: var(--slotted-dashboard-grid-handle-glyph-size, .875rem)}[data-ui=dashboard-grid][data-editing] [data-part=widget]:not([data-loading]):hover>[data-part=handle]{border-color:var(--slotted-border-strong, ButtonBorder);color:var(--slotted-text, CanvasText)}[data-ui=dashboard-grid] [data-part=widget]>[data-part=handle]:focus-visible{outline:var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);outline-offset:var(--slotted-focus-ring-offset, 2px)}[data-ui=dashboard-grid] [data-part=widget]:is([data-dragging],[data-resizing])>[data-part=handle],[data-ui=dashboard-grid] [data-part=widget]>[data-part=handle][aria-expanded=true]{background-color:var(--_accent);border-color:var(--_accent);color:var(--slotted-tone-accent-on-solid, HighlightText)}[data-ui=dashboard-grid] [data-part=widget]>[data-part=resize-handle]{--_hit: var(--slotted-dashboard-grid-resize-hit, .75rem);--_mark: var(--slotted-border-strong, currentColor);opacity:0;position:absolute;touch-action:none;transition:opacity var(--slotted-duration-short) var(--slotted-easing-standard);z-index:2}[data-ui=dashboard-grid][data-editing] [data-part=widget]:not([data-loading]):hover>[data-part=resize-handle],[data-ui=dashboard-grid][data-editing] [data-part=widget]:focus-within>[data-part=resize-handle],[data-ui=dashboard-grid] [data-part=widget][data-resizing]>[data-part=resize-handle]{opacity:1}@media(pointer:coarse){[data-ui=dashboard-grid] [data-part=widget]>[data-part=resize-handle]{--_hit: var(--slotted-target-comfortable, 44px);opacity:1}[data-ui=dashboard-grid] [data-part=widget]>[data-part=handle]{--_pill-inline: var(--slotted-dashboard-grid-handle-inline-size-coarse, 2.75rem);--_pill-block: var(--slotted-dashboard-grid-handle-block-size-coarse, 1.25rem)}}[data-ui=dashboard-grid] [data-part=resize-handle]:before{background-color:var(--_mark);border-radius:var(--slotted-radius-full, 9999px);content:\"\";inset:0;margin:auto;position:absolute;transition:background-color var(--slotted-duration-short) var(--slotted-easing-standard),block-size var(--slotted-duration-short) var(--slotted-easing-standard),inline-size var(--slotted-duration-short) var(--slotted-easing-standard)}[data-ui=dashboard-grid] [data-part=resize-handle]:is([data-edge=start],[data-edge=end]){cursor:ew-resize;inline-size:var(--_hit);inset-block:calc(var(--_radius) + var(--_hit) / 2)}[data-ui=dashboard-grid] [data-part=resize-handle][data-edge=start]{inset-inline-start:calc(var(--_hit) / -2)}[data-ui=dashboard-grid] [data-part=resize-handle][data-edge=end]{inset-inline-end:calc(var(--_hit) / -2)}[data-ui=dashboard-grid] [data-part=resize-handle]:is([data-edge=start],[data-edge=end]):before{block-size:var(--slotted-dashboard-grid-resize-pill, 1.75rem);inline-size:var(--slotted-border-width-thick, 3px)}[data-ui=dashboard-grid] [data-part=resize-handle][data-edge=bottom]{block-size:var(--_hit);cursor:ns-resize;inset-block-end:calc(var(--_hit) / -2);inset-inline:calc(var(--_radius) + var(--_hit) / 2)}[data-ui=dashboard-grid] [data-part=resize-handle][data-edge=bottom]:before{block-size:var(--slotted-border-width-thick, 3px);inline-size:var(--slotted-dashboard-grid-resize-pill, 1.75rem)}[data-ui=dashboard-grid] [data-part=resize-handle]:is([data-edge=bottom-start],[data-edge=bottom-end]){block-size:calc(var(--_hit) * 1.5);inline-size:calc(var(--_hit) * 1.5);inset-block-end:calc(var(--_hit) / -2)}[data-ui=dashboard-grid] [data-part=resize-handle][data-edge=bottom-end]{cursor:nwse-resize;inset-inline-end:calc(var(--_hit) / -2)}[data-ui=dashboard-grid] [data-part=resize-handle][data-edge=bottom-start]{cursor:nesw-resize;inset-inline-start:calc(var(--_hit) / -2)}[data-ui=dashboard-grid] [data-part=resize-handle][data-edge=bottom-end]:dir(rtl){cursor:nesw-resize}[data-ui=dashboard-grid] [data-part=resize-handle][data-edge=bottom-start]:dir(rtl){cursor:nwse-resize}[data-ui=dashboard-grid] [data-part=resize-handle]:is([data-edge=bottom-start],[data-edge=bottom-end]):before{background-color:transparent;block-size:var(--_radius);border-block-end:var(--slotted-border-width-thick, 3px) solid var(--_mark);border-radius:0;inline-size:var(--_radius);inset:auto;inset-block-end:calc(var(--_hit) / 2 - var(--slotted-border-width-thin, 1px));margin:0}[data-ui=dashboard-grid] [data-part=resize-handle][data-edge=bottom-end]:before{border-end-end-radius:var(--_radius);border-inline-end:var(--slotted-border-width-thick, 3px) solid var(--_mark);inset-inline-end:calc(var(--_hit) / 2 - var(--slotted-border-width-thin, 1px))}[data-ui=dashboard-grid] [data-part=resize-handle][data-edge=bottom-start]:before{border-end-start-radius:var(--_radius);border-inline-start:var(--slotted-border-width-thick, 3px) solid var(--_mark);inset-inline-start:calc(var(--_hit) / 2 - var(--slotted-border-width-thin, 1px))}[data-ui=dashboard-grid] [data-part=resize-handle]:not([data-disabled]):hover,[data-ui=dashboard-grid] [data-part=resize-handle][data-active]{--_mark: var(--_accent)}[data-ui=dashboard-grid] [data-part=resize-handle]:is([data-edge=start],[data-edge=end]):is(:not([data-disabled]):hover,[data-active]):before{block-size:var(--slotted-dashboard-grid-resize-pill-active, 2.75rem)}[data-ui=dashboard-grid] [data-part=resize-handle][data-edge=bottom]:is(:not([data-disabled]):hover,[data-active]):before{inline-size:var(--slotted-dashboard-grid-resize-pill-active, 2.75rem)}@container dashboard-grid (width < 1024px){[data-ui=dashboard-grid] [data-part=widget]>[data-part=resize-handle]:is([data-edge=start],[data-edge=bottom-start]){display:none}}@container dashboard-grid (width < 600px){[data-ui=dashboard-grid] [data-part=widget]>[data-part=resize-handle]{display:none}}[data-ui=dashboard-grid] [data-part=widget]:is([data-dragging],[data-resizing]){block-size:var(--_dg-origin-block-size);grid-column:auto;grid-row:auto;inline-size:var(--_dg-origin-inline-size);inset-block-start:var(--_dg-origin-block-start);inset-inline-start:var(--_dg-origin-inline-start);position:absolute;translate:var(--_dg-lift-x, 0) var(--_dg-lift-y, 0);z-index:3}[data-ui=dashboard-grid] [data-part=widget][data-dragging]{cursor:grabbing}[data-ui=dashboard-grid] [data-part=widget][data-dragging]>[data-ui=card]{box-shadow:var(--slotted-shadow-lg),0 0 0 var(--slotted-border-width-thin, 1px) color-mix(in oklab,var(--_accent) 60%,transparent)}[data-ui=dashboard-grid] [data-part=widget][data-resizing]>[data-ui=card]{box-shadow:var(--slotted-shadow-md),0 0 0 var(--slotted-border-width-thin, 1px) color-mix(in oklab,var(--_accent) 60%,transparent)}[data-ui=dashboard-grid]>[data-part=grid]>[data-part=placeholder]{background-color:color-mix(in oklab,var(--_accent) 10%,transparent);border:var(--slotted-border-width-thin, 1px) solid color-mix(in oklab,var(--_accent) 55%,transparent);border-radius:var(--_radius);box-sizing:border-box;pointer-events:none}[data-ui=dashboard-grid] [data-part=widget]>[data-part=size-readout]{background-color:var(--_accent);border-radius:var(--slotted-radius-full, 9999px);box-shadow:var(--slotted-shadow-sm);color:var(--slotted-tone-accent-on-solid, HighlightText);font-size:var(--slotted-font-size-xs, .6875rem);font-variant-numeric:tabular-nums;font-weight:var(--slotted-font-weight-semibold, 600);inset-block-end:var(--slotted-space-5, .75rem);inset-inline-end:var(--slotted-space-5, .75rem);line-height:var(--slotted-line-height-xs, 1.4);padding-block:var(--slotted-space-1, .125rem);padding-inline:var(--slotted-space-4, .5rem);pointer-events:none;position:absolute;white-space:nowrap;z-index:4}[data-ui=dashboard-grid] [data-part=widget]>[data-part=size-readout][data-edge=start],[data-ui=dashboard-grid] [data-part=widget]>[data-part=size-readout][data-edge=bottom-start]{inset-inline:var(--slotted-space-5, .75rem) auto}[data-ui=dashboard-grid]>[data-part=empty]{min-block-size:calc(var(--_row) * 2 + var(--_gap))}}\n", "@layer slotted.components{[data-ui=visually-hidden]:not([data-focusable]:focus-within){block-size:1px;border:0;clip-path:inset(50%);inline-size:1px;inset-block-start:0;inset-inline-start:0;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap}}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: SlButton, selector: "button[slButton]", inputs: ["disabled", "focusableWhenDisabled", "fullWidth", "loading", "loadingDelay", "messages", "size", "tone", "type", "variant"], exportAs: ["slButton"] }, { kind: "component", type: SlButtonStart, selector: "[slButtonStart]", exportAs: ["slButtonStart"] }, { kind: "component", type: SlCard, selector: "[slCard]", inputs: ["orientation", "fill", "size", "selected", "disabled"], exportAs: ["slCard"] }, { kind: "directive", type: SlCardActions, selector: "[slCardActions]", exportAs: ["slCardActions"] }, { kind: "directive", type: SlCardBody, selector: "[slCardBody]", exportAs: ["slCardBody"] }, { kind: "directive", type: SlCardFooter, selector: "[slCardFooter]", exportAs: ["slCardFooter"] }, { kind: "directive", type: SlCardHeader, selector: "[slCardHeader]", exportAs: ["slCardHeader"] }, { kind: "directive", type: SlDashboardPart, selector: "[slDashboardPart]", inputs: ["slDashboardPart"] }, { kind: "component", type: SlGlyph, selector: "svg[slGlyph]", inputs: ["name", "solid"] }, { kind: "component", type: SlIcon, selector: "[slIcon]", inputs: ["directional", "label", "size", "tone"], exportAs: ["slIcon"] }, { kind: "component", type: SlIconButton, selector: "button[slIconButton]", inputs: ["disabled", "focusableWhenDisabled", "loading", "loadingDelay", "messages", "shape", "size", "tone", "type", "variant", "pressed", "defaultPressed"], outputs: ["pressedChange"], exportAs: ["slIconButton"] }, { kind: "component", type: SlMenu, selector: "sl-menu", inputs: ["value", "aria-label", "aria-describedby", "open", "align", "side", "size", "mount", "strategy", "sideOffset", "alignOffset", "collisionPadding", "submenuOpenDelay", "submenuCloseDelay", "typeaheadTimeout", "disabled", "loop", "typeahead", "openOnHover", "closeOnSelect", "closeOnEscape", "closeOnOutsidePress", "flip", "shift", "hideWhenDetached", "portal", "loading"], outputs: ["openChange", "openChangeRequest"], exportAs: ["slMenu"] }, { kind: "component", type: SlMenuItem, selector: "button[slMenuItem], a[slMenuItem], button[slMenuCheckboxItem], button[slMenuRadioItem]", inputs: ["disabled", "textValue", "tone", "shortcut", "closeOnSelect", "value", "checked"], outputs: ["checkedChange", "checkedChangeRequest", "select"], exportAs: ["slMenuItem"] }, { kind: "directive", type: SlMenuSeparator, selector: "hr[slMenuSeparator]" }, { kind: "directive", type: SlMenuTrigger, selector: "[slMenuTriggerFor]", inputs: ["slMenuTriggerFor"], exportAs: ["slMenuTrigger"] }, { kind: "component", type: SlResultState, selector: "[slResultState]", inputs: ["status", "reach", "align", "live", "illustration"], exportAs: ["slResultState"] }, { kind: "directive", type: SlResultStateActions, selector: "[slResultStateActions]", exportAs: ["slResultStateActions"] }, { kind: "directive", type: SlResultStateContent, selector: "[slResultStateContent]", exportAs: ["slResultStateContent"] }, { kind: "directive", type: SlResultStateDescription, selector: "[slResultStateDescription]", exportAs: ["slResultStateDescription"] }, { kind: "component", type: SlResultStateTitle, selector: "[slResultStateTitle]", exportAs: ["slResultStateTitle"] }, { kind: "component", type: SlSkeleton, selector: "[slSkeleton]", inputs: ["shape", "size", "animation", "loading", "inlineSize", "blockSize"], exportAs: ["slSkeleton"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
1457
|
+
}
|
|
1458
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlDashboardGrid, decorators: [{
|
|
1459
|
+
type: Component,
|
|
1460
|
+
args: [{ selector: '[slDashboardGrid]', standalone: true, exportAs: 'slDashboardGrid', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [
|
|
1461
|
+
NgTemplateOutlet,
|
|
1462
|
+
SlButton,
|
|
1463
|
+
SlButtonStart,
|
|
1464
|
+
SlCard,
|
|
1465
|
+
SlCardActions,
|
|
1466
|
+
SlCardBody,
|
|
1467
|
+
SlCardFooter,
|
|
1468
|
+
SlCardHeader,
|
|
1469
|
+
SlDashboardPart,
|
|
1470
|
+
SlGlyph,
|
|
1471
|
+
SlIcon,
|
|
1472
|
+
SlIconButton,
|
|
1473
|
+
SlMenu,
|
|
1474
|
+
SlMenuItem,
|
|
1475
|
+
SlMenuSeparator,
|
|
1476
|
+
SlMenuTrigger,
|
|
1477
|
+
SlResultState,
|
|
1478
|
+
SlResultStateActions,
|
|
1479
|
+
SlResultStateContent,
|
|
1480
|
+
SlResultStateDescription,
|
|
1481
|
+
SlResultStateTitle,
|
|
1482
|
+
SlSkeleton,
|
|
1483
|
+
], host: {
|
|
1484
|
+
'data-ui': 'dashboard-grid',
|
|
1485
|
+
'data-part': 'root',
|
|
1486
|
+
'[attr.data-editing]': 'isEditing() ? "" : null',
|
|
1487
|
+
'[attr.data-gesture]': 'gesture() === null ? null : ""',
|
|
1488
|
+
'[attr.aria-label]': 'null',
|
|
1489
|
+
'[attr.aria-labelledby]': 'null',
|
|
1490
|
+
'[style.--_dg-columns-expanded]': 'grid().expanded',
|
|
1491
|
+
'[style.--_dg-columns-medium]': 'grid().medium',
|
|
1492
|
+
'[style.--_dg-columns-compact]': 'grid().compact',
|
|
1493
|
+
}, template: `
|
|
1494
|
+
@if (isEditing() && resolvedEditBar()) {
|
|
1495
|
+
<div data-part="edit-bar" role="group" [attr.aria-label]="t('editBar')">
|
|
1496
|
+
<p data-part="edit-status" [id]="statusId">{{ t('editStatus') }}</p>
|
|
1497
|
+
<div data-part="edit-actions">
|
|
1498
|
+
@if (hiddenTiles().length > 0) {
|
|
1499
|
+
<button
|
|
1500
|
+
slButton
|
|
1501
|
+
slDashboardPart="add"
|
|
1502
|
+
data-dashboard-add
|
|
1503
|
+
size="sm"
|
|
1504
|
+
tone="secondary"
|
|
1505
|
+
variant="outline"
|
|
1506
|
+
[slMenuTriggerFor]="addMenu"
|
|
1507
|
+
>
|
|
1508
|
+
<span slButtonStart
|
|
1509
|
+
><span slIcon><svg slGlyph name="plus"></svg></span></span
|
|
1510
|
+
>{{ t('add') }}
|
|
1511
|
+
</button>
|
|
1512
|
+
<sl-menu #addMenu>
|
|
1513
|
+
@for (tile of hiddenTiles(); track tile.key) {
|
|
1514
|
+
<button slMenuItem (select)="show(tile.key, reasonOf($event), $event.source)">
|
|
1515
|
+
{{ titleOf(tile.key) }}
|
|
1516
|
+
</button>
|
|
1517
|
+
}
|
|
1518
|
+
</sl-menu>
|
|
1519
|
+
}
|
|
1520
|
+
<button
|
|
1521
|
+
slButton
|
|
1522
|
+
slDashboardPart="reset"
|
|
1523
|
+
size="sm"
|
|
1524
|
+
tone="secondary"
|
|
1525
|
+
variant="ghost"
|
|
1526
|
+
(click)="reset(pressReason($event), $event)"
|
|
1527
|
+
>
|
|
1528
|
+
{{ t('reset') }}
|
|
1529
|
+
</button>
|
|
1530
|
+
<button
|
|
1531
|
+
slButton
|
|
1532
|
+
slDashboardPart="cancel"
|
|
1533
|
+
size="sm"
|
|
1534
|
+
tone="secondary"
|
|
1535
|
+
variant="outline"
|
|
1536
|
+
(click)="cancelEditing(pressReason($event), $event)"
|
|
1537
|
+
>
|
|
1538
|
+
{{ t('cancel') }}
|
|
1539
|
+
</button>
|
|
1540
|
+
<button
|
|
1541
|
+
slButton
|
|
1542
|
+
slDashboardPart="done"
|
|
1543
|
+
size="sm"
|
|
1544
|
+
tone="accent"
|
|
1545
|
+
variant="solid"
|
|
1546
|
+
(click)="commitEditing('submit', $event)"
|
|
1547
|
+
>
|
|
1548
|
+
{{ t('done') }}
|
|
1549
|
+
</button>
|
|
1550
|
+
</div>
|
|
1551
|
+
</div>
|
|
1552
|
+
}
|
|
1553
|
+
@if (isEditing() && !resolvedEditBar()) {
|
|
1554
|
+
<p data-part="edit-status" data-ui="visually-hidden" [id]="statusId">
|
|
1555
|
+
{{ t('editStatus') }}
|
|
1556
|
+
</p>
|
|
1557
|
+
}
|
|
1558
|
+
<ul
|
|
1559
|
+
#list
|
|
1560
|
+
data-part="grid"
|
|
1561
|
+
role="list"
|
|
1562
|
+
[attr.aria-label]="ariaLabel() ?? null"
|
|
1563
|
+
[attr.aria-labelledby]="ariaLabelledBy() ?? null"
|
|
1564
|
+
[hidden]="slots().length === 0"
|
|
1565
|
+
>
|
|
1566
|
+
@for (slot of slots(); track slot.tile.key) {
|
|
1567
|
+
<li
|
|
1568
|
+
data-part="widget"
|
|
1569
|
+
[attr.data-key]="slot.tile.key"
|
|
1570
|
+
[attr.data-status]="slot.widget.status()"
|
|
1571
|
+
[attr.data-loading]="slot.widget.painted() ? '' : null"
|
|
1572
|
+
[attr.data-movable]="slot.tile.movable ? '' : null"
|
|
1573
|
+
[attr.data-resizable]="slot.tile.resizable ? '' : null"
|
|
1574
|
+
[attr.data-dragging]="slot.dragging ? '' : null"
|
|
1575
|
+
[attr.data-resizing]="slot.resizing ? '' : null"
|
|
1576
|
+
[style]="slot.style"
|
|
1577
|
+
>
|
|
1578
|
+
<article
|
|
1579
|
+
slCard
|
|
1580
|
+
[fill]="slot.widget.fill()"
|
|
1581
|
+
[size]="slot.widget.size()"
|
|
1582
|
+
[attr.aria-labelledby]="titleId(slot.tile.key)"
|
|
1583
|
+
[attr.aria-describedby]="
|
|
1584
|
+
slot.widget.description() === undefined
|
|
1585
|
+
? null
|
|
1586
|
+
: titleId(slot.tile.key) + '-description'
|
|
1587
|
+
"
|
|
1588
|
+
[attr.aria-busy]="slot.widget.painted() || slot.widget.busy() ? true : null"
|
|
1589
|
+
>
|
|
1590
|
+
<div slCardHeader>
|
|
1591
|
+
@switch (levelOf(slot.widget)) {
|
|
1592
|
+
@case (2) {
|
|
1593
|
+
<h2 data-part="title" [id]="titleId(slot.tile.key)">{{ slot.widget.title() }}</h2>
|
|
1594
|
+
}
|
|
1595
|
+
@case (4) {
|
|
1596
|
+
<h4 data-part="title" [id]="titleId(slot.tile.key)">{{ slot.widget.title() }}</h4>
|
|
1597
|
+
}
|
|
1598
|
+
@case (5) {
|
|
1599
|
+
<h5 data-part="title" [id]="titleId(slot.tile.key)">{{ slot.widget.title() }}</h5>
|
|
1600
|
+
}
|
|
1601
|
+
@case (6) {
|
|
1602
|
+
<h6 data-part="title" [id]="titleId(slot.tile.key)">{{ slot.widget.title() }}</h6>
|
|
1603
|
+
}
|
|
1604
|
+
@default {
|
|
1605
|
+
<h3 data-part="title" [id]="titleId(slot.tile.key)">{{ slot.widget.title() }}</h3>
|
|
1606
|
+
}
|
|
1607
|
+
}
|
|
1608
|
+
@if (slot.widget.description(); as description) {
|
|
1609
|
+
<p data-part="description" [id]="titleId(slot.tile.key) + '-description'">
|
|
1610
|
+
{{ description }}
|
|
1611
|
+
</p>
|
|
1612
|
+
}
|
|
1613
|
+
@if (
|
|
1614
|
+
slot.widget.hasActions() ||
|
|
1615
|
+
slot.widget.detailHref() !== undefined ||
|
|
1616
|
+
slot.widget.detailable()
|
|
1617
|
+
) {
|
|
1618
|
+
<div slCardActions>
|
|
1619
|
+
<ng-container [ngTemplateOutlet]="slot.widget.actionsTemplate()" />
|
|
1620
|
+
@if (slot.widget.detailHref(); as href) {
|
|
1621
|
+
<a
|
|
1622
|
+
data-ui="button"
|
|
1623
|
+
data-part="detail"
|
|
1624
|
+
data-tone="secondary"
|
|
1625
|
+
data-variant="ghost"
|
|
1626
|
+
data-size="sm"
|
|
1627
|
+
data-shape="square"
|
|
1628
|
+
[attr.href]="href"
|
|
1629
|
+
[attr.aria-label]="t('detail', { title: slot.widget.title() })"
|
|
1630
|
+
(click)="slot.widget.detail.emit($event)"
|
|
1631
|
+
><span data-part="icon" aria-hidden="true"
|
|
1632
|
+
><span slIcon directional><svg slGlyph name="external"></svg></span></span
|
|
1633
|
+
></a>
|
|
1634
|
+
} @else if (slot.widget.detailable()) {
|
|
1635
|
+
<button
|
|
1636
|
+
slIconButton
|
|
1637
|
+
slDashboardPart="detail"
|
|
1638
|
+
size="sm"
|
|
1639
|
+
tone="secondary"
|
|
1640
|
+
variant="ghost"
|
|
1641
|
+
[attr.aria-label]="t('detail', { title: slot.widget.title() })"
|
|
1642
|
+
(click)="slot.widget.detail.emit($event)"
|
|
1643
|
+
>
|
|
1644
|
+
<span slIcon directional><svg slGlyph name="external"></svg></span>
|
|
1645
|
+
</button>
|
|
1646
|
+
}
|
|
1647
|
+
</div>
|
|
1648
|
+
}
|
|
1649
|
+
</div>
|
|
1650
|
+
<div slCardBody>
|
|
1651
|
+
@if (slot.widget.busy() && !slot.widget.painted()) {
|
|
1652
|
+
<span data-part="busy-indicator" aria-hidden="true"></span>
|
|
1653
|
+
}
|
|
1654
|
+
@if (slot.widget.painted()) {
|
|
1655
|
+
<div data-part="skeleton">
|
|
1656
|
+
@if (slot.widget.hasSkeleton()) {
|
|
1657
|
+
<ng-container [ngTemplateOutlet]="slot.widget.skeletonTemplate()" />
|
|
1658
|
+
} @else {
|
|
1659
|
+
<span slSkeleton shape="block"></span>
|
|
1660
|
+
}
|
|
1661
|
+
</div>
|
|
1662
|
+
} @else if (slot.widget.status() === 'empty') {
|
|
1663
|
+
<div data-part="message">
|
|
1664
|
+
<section slResultState status="empty" reach="section" align="center" live="off">
|
|
1665
|
+
<div slResultStateContent>
|
|
1666
|
+
<div slResultStateTitle>
|
|
1667
|
+
{{ slot.widget.emptyTitle() ?? t('emptyTitle') }}
|
|
1668
|
+
</div>
|
|
1669
|
+
@if (slot.widget.emptyDescription(); as description) {
|
|
1670
|
+
<p slResultStateDescription>{{ description }}</p>
|
|
1671
|
+
}
|
|
1672
|
+
</div>
|
|
1673
|
+
@if (slot.widget.hasEmptyAction()) {
|
|
1674
|
+
<div slResultStateActions>
|
|
1675
|
+
<ng-container [ngTemplateOutlet]="slot.widget.emptyActionTemplate()" />
|
|
1676
|
+
</div>
|
|
1677
|
+
}
|
|
1678
|
+
</section>
|
|
1679
|
+
</div>
|
|
1680
|
+
} @else if (slot.widget.status() === 'error') {
|
|
1681
|
+
<div data-part="message">
|
|
1682
|
+
<section
|
|
1683
|
+
slResultState
|
|
1684
|
+
status="error"
|
|
1685
|
+
reach="section"
|
|
1686
|
+
align="center"
|
|
1687
|
+
live="polite"
|
|
1688
|
+
>
|
|
1689
|
+
<div slResultStateContent>
|
|
1690
|
+
<div slResultStateTitle>
|
|
1691
|
+
{{ slot.widget.errorTitle() ?? t('errorTitle') }}
|
|
1692
|
+
</div>
|
|
1693
|
+
@if (slot.widget.errorDescription(); as description) {
|
|
1694
|
+
<p slResultStateDescription>{{ description }}</p>
|
|
1695
|
+
}
|
|
1696
|
+
</div>
|
|
1697
|
+
@if (slot.widget.retryable()) {
|
|
1698
|
+
<div slResultStateActions>
|
|
1699
|
+
<button
|
|
1700
|
+
slButton
|
|
1701
|
+
slDashboardPart="retry"
|
|
1702
|
+
size="sm"
|
|
1703
|
+
tone="secondary"
|
|
1704
|
+
variant="outline"
|
|
1705
|
+
(click)="slot.widget.retry.emit($event)"
|
|
1706
|
+
>
|
|
1707
|
+
<span slButtonStart
|
|
1708
|
+
><span slIcon><svg slGlyph name="rotate-ccw"></svg></span></span
|
|
1709
|
+
>{{ t('retry') }}
|
|
1710
|
+
</button>
|
|
1711
|
+
</div>
|
|
1712
|
+
}
|
|
1713
|
+
</section>
|
|
1714
|
+
</div>
|
|
1715
|
+
} @else {
|
|
1716
|
+
<ng-container [ngTemplateOutlet]="slot.widget.bodyTemplate()" />
|
|
1717
|
+
}
|
|
1718
|
+
</div>
|
|
1719
|
+
@if (slot.widget.hasFooter()) {
|
|
1720
|
+
<div slCardFooter>
|
|
1721
|
+
<ng-container [ngTemplateOutlet]="slot.widget.footerTemplate()" />
|
|
1722
|
+
</div>
|
|
1723
|
+
}
|
|
1724
|
+
</article>
|
|
1725
|
+
@if (slot.handle) {
|
|
1726
|
+
<button
|
|
1727
|
+
slDashboardPart="handle"
|
|
1728
|
+
[attr.data-handle]="slot.tile.key"
|
|
1729
|
+
[attr.aria-label]="t('handle', { title: slot.widget.title() })"
|
|
1730
|
+
[attr.aria-describedby]="statusId"
|
|
1731
|
+
[attr.aria-keyshortcuts]="shortcuts(slot.tile.removable)"
|
|
1732
|
+
[slMenuTriggerFor]="handleMenu"
|
|
1733
|
+
>
|
|
1734
|
+
<span slIcon><svg slGlyph name="grip-horizontal"></svg></span>
|
|
1735
|
+
</button>
|
|
1736
|
+
<sl-menu #handleMenu>
|
|
1737
|
+
@if (slot.tile.movable) {
|
|
1738
|
+
<button
|
|
1739
|
+
slMenuItem
|
|
1740
|
+
shortcut="Alt+ArrowUp"
|
|
1741
|
+
[disabled]="!slot.can.up"
|
|
1742
|
+
(select)="move(slot.tile.key, 'up', reasonOf($event), $event.source)"
|
|
1743
|
+
>
|
|
1744
|
+
{{ t('moveUp') }}
|
|
1745
|
+
</button>
|
|
1746
|
+
<button
|
|
1747
|
+
slMenuItem
|
|
1748
|
+
shortcut="Alt+ArrowDown"
|
|
1749
|
+
[disabled]="!slot.can.down"
|
|
1750
|
+
(select)="move(slot.tile.key, 'down', reasonOf($event), $event.source)"
|
|
1751
|
+
>
|
|
1752
|
+
{{ t('moveDown') }}
|
|
1753
|
+
</button>
|
|
1754
|
+
@if (!flows()) {
|
|
1755
|
+
<button
|
|
1756
|
+
slMenuItem
|
|
1757
|
+
shortcut="Alt+ArrowLeft"
|
|
1758
|
+
[disabled]="!slot.can.left"
|
|
1759
|
+
(select)="move(slot.tile.key, 'left', reasonOf($event), $event.source)"
|
|
1760
|
+
>
|
|
1761
|
+
{{ t('moveStart') }}
|
|
1762
|
+
</button>
|
|
1763
|
+
<button
|
|
1764
|
+
slMenuItem
|
|
1765
|
+
shortcut="Alt+ArrowRight"
|
|
1766
|
+
[disabled]="!slot.can.right"
|
|
1767
|
+
(select)="move(slot.tile.key, 'right', reasonOf($event), $event.source)"
|
|
1768
|
+
>
|
|
1769
|
+
{{ t('moveEnd') }}
|
|
1770
|
+
</button>
|
|
1771
|
+
}
|
|
1772
|
+
}
|
|
1773
|
+
@if (slot.tile.movable && slot.sizable) {
|
|
1774
|
+
<hr slMenuSeparator />
|
|
1775
|
+
}
|
|
1776
|
+
@if (slot.sizable) {
|
|
1777
|
+
<button
|
|
1778
|
+
slMenuItem
|
|
1779
|
+
shortcut="Shift+ArrowRight"
|
|
1780
|
+
[disabled]="!slot.can.wider"
|
|
1781
|
+
(select)="resize(slot.tile.key, 1, 0, reasonOf($event), $event.source)"
|
|
1782
|
+
>
|
|
1783
|
+
{{ t('wider') }}
|
|
1784
|
+
</button>
|
|
1785
|
+
<button
|
|
1786
|
+
slMenuItem
|
|
1787
|
+
shortcut="Shift+ArrowLeft"
|
|
1788
|
+
[disabled]="!slot.can.narrower"
|
|
1789
|
+
(select)="resize(slot.tile.key, -1, 0, reasonOf($event), $event.source)"
|
|
1790
|
+
>
|
|
1791
|
+
{{ t('narrower') }}
|
|
1792
|
+
</button>
|
|
1793
|
+
<button
|
|
1794
|
+
slMenuItem
|
|
1795
|
+
shortcut="Shift+ArrowDown"
|
|
1796
|
+
[disabled]="!slot.can.taller"
|
|
1797
|
+
(select)="resize(slot.tile.key, 0, 1, reasonOf($event), $event.source)"
|
|
1798
|
+
>
|
|
1799
|
+
{{ t('taller') }}
|
|
1800
|
+
</button>
|
|
1801
|
+
<button
|
|
1802
|
+
slMenuItem
|
|
1803
|
+
shortcut="Shift+ArrowUp"
|
|
1804
|
+
[disabled]="!slot.can.shorter"
|
|
1805
|
+
(select)="resize(slot.tile.key, 0, -1, reasonOf($event), $event.source)"
|
|
1806
|
+
>
|
|
1807
|
+
{{ t('shorter') }}
|
|
1808
|
+
</button>
|
|
1809
|
+
}
|
|
1810
|
+
@if (slot.tile.removable) {
|
|
1811
|
+
@if (slot.tile.movable || slot.sizable) {
|
|
1812
|
+
<hr slMenuSeparator />
|
|
1813
|
+
}
|
|
1814
|
+
<button
|
|
1815
|
+
slMenuItem
|
|
1816
|
+
tone="danger"
|
|
1817
|
+
shortcut="Delete"
|
|
1818
|
+
(select)="hide(slot.tile.key, 'remove', $event.source)"
|
|
1819
|
+
>
|
|
1820
|
+
{{ t('hide') }}
|
|
1821
|
+
</button>
|
|
1822
|
+
}
|
|
1823
|
+
</sl-menu>
|
|
1824
|
+
}
|
|
1825
|
+
@if (isEditing() && slot.sizable) {
|
|
1826
|
+
@for (edge of edges; track edge) {
|
|
1827
|
+
<span
|
|
1828
|
+
data-part="resize-handle"
|
|
1829
|
+
aria-hidden="true"
|
|
1830
|
+
[attr.data-edge]="edge"
|
|
1831
|
+
[attr.data-active]="slot.edge === edge ? '' : null"
|
|
1832
|
+
(pointerdown)="onResizePointerDown(slot.tile.key, edge, $event)"
|
|
1833
|
+
></span>
|
|
1834
|
+
}
|
|
1835
|
+
}
|
|
1836
|
+
@if (slot.readout !== null) {
|
|
1837
|
+
<span data-part="size-readout" aria-hidden="true" [attr.data-edge]="slot.edge">{{
|
|
1838
|
+
slot.readout
|
|
1839
|
+
}}</span>
|
|
1840
|
+
}
|
|
1841
|
+
</li>
|
|
1842
|
+
}
|
|
1843
|
+
@if (placeholder(); as style) {
|
|
1844
|
+
<li data-part="placeholder" aria-hidden="true" [style]="style"></li>
|
|
1845
|
+
}
|
|
1846
|
+
</ul>
|
|
1847
|
+
@if (slots().length === 0) {
|
|
1848
|
+
<div data-part="empty">
|
|
1849
|
+
<section slResultState status="empty" reach="section" live="polite">
|
|
1850
|
+
<div slResultStateContent>
|
|
1851
|
+
<div slResultStateTitle>{{ t('empty') }}</div>
|
|
1852
|
+
@if (isEditing()) {
|
|
1853
|
+
<p slResultStateDescription>{{ t('emptyEditing') }}</p>
|
|
1854
|
+
}
|
|
1855
|
+
</div>
|
|
1856
|
+
</section>
|
|
1857
|
+
</div>
|
|
1858
|
+
}
|
|
1859
|
+
`, styles: ["@layer slotted.components{[data-ui=dashboard-grid]{--_gap: var(--slotted-dashboard-grid-gap, var(--slotted-space-6, 1rem));--_row: var(--slotted-dashboard-grid-row-size, 4.5rem);--_cols: var(--_dg-columns-expanded, 12);--_radius: var(--slotted-card-radius, var(--slotted-radius-lg, 8px));--_accent: var(--slotted-dashboard-grid-accent, var(--slotted-tone-accent-solid, Highlight));container:dashboard-grid / inline-size;display:flex;flex-direction:column;gap:var(--_gap);min-inline-size:0}[data-ui=dashboard-grid]>[data-part=grid]{display:grid;gap:var(--_gap);grid-auto-rows:var(--_row);grid-template-columns:repeat(var(--_cols),minmax(0,1fr));list-style:none;margin:0;min-inline-size:0;padding:0;position:relative}[data-ui=dashboard-grid] [data-part=grid][hidden],[data-ui=dashboard-grid] [data-part=widget][hidden]{display:none}[data-ui=dashboard-grid] :is([data-part=widget],[data-part=placeholder]){grid-column:var(--_dg-x, auto) / span var(--_dg-w, 4);grid-row:var(--_dg-y, auto) / span var(--_dg-h, 2);min-block-size:0;min-inline-size:0}[data-ui=dashboard-grid] [data-part=widget]{display:flex;position:relative}@container dashboard-grid (width < 1024px){[data-ui=dashboard-grid]>[data-part=grid]{--_cols: var(--_dg-columns-medium, 6)}[data-ui=dashboard-grid] :is([data-part=widget],[data-part=placeholder]){grid-column:auto / span var(--_dg-span-medium, 3);grid-row:auto / span var(--_dg-h, 2)}}@container dashboard-grid (width < 600px){[data-ui=dashboard-grid]>[data-part=grid]{--_cols: var(--_dg-columns-compact, 1);grid-auto-rows:auto}[data-ui=dashboard-grid] :is([data-part=widget],[data-part=placeholder]){grid-column:1 / -1;grid-row:auto}[data-ui=dashboard-grid] [data-part=placeholder]{min-block-size:calc(var(--_row) * 2)}}[data-ui=dashboard-grid] [data-part=widget]>[data-ui=card]{flex:1 1 auto;min-block-size:0;min-inline-size:0;transition:box-shadow var(--slotted-duration-medium) var(--slotted-easing-standard)}[data-ui=dashboard-grid] [data-part=widget]>[data-ui=card]>[data-part=body]{--slotted-chart-plot-block-size: calc(var(--_row) * 1.5);display:flex;flex-direction:column;overflow:auto;position:relative}[data-ui=dashboard-grid] [data-part=widget]>[data-ui=card]>[data-part=body]>:not([data-part=busy-indicator]){flex:1 0 auto}[data-ui=dashboard-grid] [data-part=widget] [data-part=title]{-webkit-box-orient:vertical;color:var(--slotted-dashboard-grid-title-color, var(--slotted-text, CanvasText));display:-webkit-box;font-family:var( --slotted-dashboard-grid-title-font-family, var( --slotted-font-family-heading, var(--slotted-font-family-sans, ui-sans-serif, system-ui, sans-serif) ) );font-size:var( --slotted-dashboard-grid-title-font-size, var(--slotted-font-size-md, .8125rem) );font-weight:var(--slotted-font-weight-semibold, 600);-webkit-line-clamp:2;line-clamp:2;line-height:var(--slotted-line-height-md, 1.5);margin:0;overflow:hidden;overflow-wrap:anywhere}[data-ui=dashboard-grid] [data-part=widget] [data-part=description]{color:var(--slotted-dashboard-grid-description-color, var(--slotted-text-muted, GrayText));font-size:var(--slotted-font-size-sm, .75rem);line-height:var(--slotted-line-height-sm, 1.5);margin:0;overflow-wrap:anywhere}[data-ui=dashboard-grid] [data-part=widget] [data-part=actions]{flex-wrap:nowrap;gap:var(--slotted-space-1, .125rem);margin-block:calc((var(--slotted-control-height-sm, 1.75rem) - var(--slotted-font-size-md, .8125rem) * var(--slotted-line-height-md, 1.5)) / -2)}[data-ui=dashboard-grid] [data-part=widget] [data-part=skeleton]{display:flex;flex-direction:column;min-block-size:var(--slotted-space-12, 4rem)}[data-ui=dashboard-grid] [data-part=widget] [data-part=skeleton]>[data-ui=skeleton]{block-size:auto;flex:1 1 auto;inline-size:100%}[data-ui=dashboard-grid] [data-part=widget] [data-part=message]{align-content:center;display:grid;justify-items:center}[data-ui=dashboard-grid] [data-part=widget] [data-part=busy-indicator]{background-color:var(--_accent);block-size:var(--slotted-border-width-medium, 2px);inset-block-start:0;inset-inline:0;opacity:.35;pointer-events:none;position:absolute}@media(prefers-reduced-motion:no-preference){[data-ui=dashboard-grid] [data-part=widget] [data-part=busy-indicator]{animation:slotted-dashboard-grid-busy var(--slotted-duration-loop-slow) linear infinite;background-color:transparent;background-image:linear-gradient(to right,transparent,var(--_accent) 50%,transparent);background-repeat:no-repeat;background-size:40% 100%;opacity:1}}@media(prefers-reduced-motion:reduce){[data-ui=dashboard-grid] [data-part=widget] [data-part=busy-indicator]{animation:none}}@keyframes slotted-dashboard-grid-busy{0%{background-position:-40% 0}to{background-position:140% 0}}[data-ui=dashboard-grid]>[data-part=edit-bar]{align-items:center;background-color:var( --slotted-dashboard-grid-edit-bar-background, var(--slotted-surface-raised, Canvas) );border:var(--slotted-border-width-thin, 1px) solid var(--slotted-dashboard-grid-edit-bar-border, var(--slotted-border-subtle, CanvasText));border-radius:var(--_radius);box-shadow:var(--slotted-shadow-xs);display:flex;flex-wrap:wrap;gap:var(--slotted-space-4, .5rem) var(--slotted-space-6, 1rem);padding-block:var(--slotted-space-4, .5rem);padding-inline:var(--slotted-space-6, 1rem) var(--slotted-space-4, .5rem)}@starting-style{[data-ui=dashboard-grid]>[data-part=edit-bar]{opacity:0;translate:0 calc(var(--slotted-space-4, .5rem) * -1)}}[data-ui=dashboard-grid]>[data-part=edit-bar]{transition:opacity var(--slotted-duration-medium) var(--slotted-easing-enter),translate var(--slotted-duration-medium) var(--slotted-easing-enter)}[data-ui=dashboard-grid]>[data-part=edit-bar]>[data-part=edit-status]{color:var(--slotted-text-muted, GrayText);flex:1 1 20rem;font-size:var(--slotted-font-size-sm, .75rem);line-height:var(--slotted-line-height-sm, 1.5);margin:0;min-inline-size:0}[data-ui=dashboard-grid]>[data-part=edit-bar]>[data-part=edit-actions]{align-items:center;display:flex;flex-wrap:wrap;gap:var(--slotted-space-3, .375rem);justify-content:flex-end;margin-inline-start:auto}[data-ui=dashboard-grid]>[data-part=grid]:before{background-image:radial-gradient(circle at calc((100% - var(--_gap)) / 2) calc((100% - var(--_gap)) / 2),var(--slotted-dashboard-grid-lattice-color, var(--slotted-border-strong, currentColor)) var(--slotted-dashboard-grid-lattice-dot, 1.5px),transparent calc(var(--slotted-dashboard-grid-lattice-dot, 1.5px) + .75px));background-size:calc((100% + var(--_gap)) / var(--_cols)) calc(var(--_row) + var(--_gap));content:\"\";inset:0;opacity:0;pointer-events:none;position:absolute;transition:opacity var(--slotted-duration-medium) var(--slotted-easing-standard)}[data-ui=dashboard-grid][data-editing]>[data-part=grid]{min-block-size:calc(var(--_row) * 2 + var(--_gap))}[data-ui=dashboard-grid][data-editing]>[data-part=grid]:before{opacity:.7}[data-ui=dashboard-grid][data-gesture]>[data-part=grid]:before{opacity:1}@container dashboard-grid (width < 1024px){[data-ui=dashboard-grid]>[data-part=grid]:before{display:none}}[data-ui=dashboard-grid][data-editing] [data-part=widget][data-movable]>[data-ui=card]{cursor:grab}[data-ui=dashboard-grid][data-editing] [data-part=widget][data-movable]>[data-ui=card] :is(a,button,input,select,textarea,[tabindex]){cursor:auto}[data-ui=dashboard-grid][data-editing] [data-part=widget]:not([data-loading]):hover>[data-ui=card]{box-shadow:var(--slotted-shadow-sm)}[data-ui=dashboard-grid] [data-part=widget]>[data-part=handle]{--_pill-inline: var(--slotted-dashboard-grid-handle-inline-size, 2.25rem);--_pill-block: var(--slotted-dashboard-grid-handle-block-size, 1rem);align-items:center;appearance:none;background-color:var(--slotted-control-surface, Canvas);block-size:var(--_pill-block);border:var(--slotted-border-width-thin, 1px) solid var(--slotted-control-border-color, ButtonBorder);border-radius:var(--slotted-radius-full, 9999px);box-shadow:var(--slotted-control-shadow);box-sizing:border-box;color:var(--slotted-text-muted, GrayText);cursor:grab;display:flex;font:inherit;inline-size:var(--_pill-inline);inset-block-start:calc(var(--_pill-block) / -2);inset-inline:0;justify-content:center;margin:0 auto;padding:0;position:absolute;touch-action:none;transition:background-color var(--slotted-duration-short) var(--slotted-easing-standard),border-color var(--slotted-duration-short) var(--slotted-easing-standard),color var(--slotted-duration-short) var(--slotted-easing-standard),opacity var(--slotted-duration-medium) var(--slotted-easing-enter),translate var(--slotted-duration-medium) var(--slotted-easing-enter);z-index:2}@starting-style{[data-ui=dashboard-grid] [data-part=widget]>[data-part=handle]{opacity:0;translate:0 var(--slotted-space-3, .375rem)}}[data-ui=dashboard-grid] [data-part=widget]>[data-part=handle]:before{content:\"\";inset:calc((var(--slotted-target-min, 24px) - var(--_pill-block)) / -2) calc(var(--slotted-space-4, .5rem) * -1);position:absolute}[data-ui=dashboard-grid] [data-part=widget]>[data-part=handle]>[data-ui=icon]{--slotted-icon-size: var(--slotted-dashboard-grid-handle-glyph-size, .875rem)}[data-ui=dashboard-grid][data-editing] [data-part=widget]:not([data-loading]):hover>[data-part=handle]{border-color:var(--slotted-border-strong, ButtonBorder);color:var(--slotted-text, CanvasText)}[data-ui=dashboard-grid] [data-part=widget]>[data-part=handle]:focus-visible{outline:var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);outline-offset:var(--slotted-focus-ring-offset, 2px)}[data-ui=dashboard-grid] [data-part=widget]:is([data-dragging],[data-resizing])>[data-part=handle],[data-ui=dashboard-grid] [data-part=widget]>[data-part=handle][aria-expanded=true]{background-color:var(--_accent);border-color:var(--_accent);color:var(--slotted-tone-accent-on-solid, HighlightText)}[data-ui=dashboard-grid] [data-part=widget]>[data-part=resize-handle]{--_hit: var(--slotted-dashboard-grid-resize-hit, .75rem);--_mark: var(--slotted-border-strong, currentColor);opacity:0;position:absolute;touch-action:none;transition:opacity var(--slotted-duration-short) var(--slotted-easing-standard);z-index:2}[data-ui=dashboard-grid][data-editing] [data-part=widget]:not([data-loading]):hover>[data-part=resize-handle],[data-ui=dashboard-grid][data-editing] [data-part=widget]:focus-within>[data-part=resize-handle],[data-ui=dashboard-grid] [data-part=widget][data-resizing]>[data-part=resize-handle]{opacity:1}@media(pointer:coarse){[data-ui=dashboard-grid] [data-part=widget]>[data-part=resize-handle]{--_hit: var(--slotted-target-comfortable, 44px);opacity:1}[data-ui=dashboard-grid] [data-part=widget]>[data-part=handle]{--_pill-inline: var(--slotted-dashboard-grid-handle-inline-size-coarse, 2.75rem);--_pill-block: var(--slotted-dashboard-grid-handle-block-size-coarse, 1.25rem)}}[data-ui=dashboard-grid] [data-part=resize-handle]:before{background-color:var(--_mark);border-radius:var(--slotted-radius-full, 9999px);content:\"\";inset:0;margin:auto;position:absolute;transition:background-color var(--slotted-duration-short) var(--slotted-easing-standard),block-size var(--slotted-duration-short) var(--slotted-easing-standard),inline-size var(--slotted-duration-short) var(--slotted-easing-standard)}[data-ui=dashboard-grid] [data-part=resize-handle]:is([data-edge=start],[data-edge=end]){cursor:ew-resize;inline-size:var(--_hit);inset-block:calc(var(--_radius) + var(--_hit) / 2)}[data-ui=dashboard-grid] [data-part=resize-handle][data-edge=start]{inset-inline-start:calc(var(--_hit) / -2)}[data-ui=dashboard-grid] [data-part=resize-handle][data-edge=end]{inset-inline-end:calc(var(--_hit) / -2)}[data-ui=dashboard-grid] [data-part=resize-handle]:is([data-edge=start],[data-edge=end]):before{block-size:var(--slotted-dashboard-grid-resize-pill, 1.75rem);inline-size:var(--slotted-border-width-thick, 3px)}[data-ui=dashboard-grid] [data-part=resize-handle][data-edge=bottom]{block-size:var(--_hit);cursor:ns-resize;inset-block-end:calc(var(--_hit) / -2);inset-inline:calc(var(--_radius) + var(--_hit) / 2)}[data-ui=dashboard-grid] [data-part=resize-handle][data-edge=bottom]:before{block-size:var(--slotted-border-width-thick, 3px);inline-size:var(--slotted-dashboard-grid-resize-pill, 1.75rem)}[data-ui=dashboard-grid] [data-part=resize-handle]:is([data-edge=bottom-start],[data-edge=bottom-end]){block-size:calc(var(--_hit) * 1.5);inline-size:calc(var(--_hit) * 1.5);inset-block-end:calc(var(--_hit) / -2)}[data-ui=dashboard-grid] [data-part=resize-handle][data-edge=bottom-end]{cursor:nwse-resize;inset-inline-end:calc(var(--_hit) / -2)}[data-ui=dashboard-grid] [data-part=resize-handle][data-edge=bottom-start]{cursor:nesw-resize;inset-inline-start:calc(var(--_hit) / -2)}[data-ui=dashboard-grid] [data-part=resize-handle][data-edge=bottom-end]:dir(rtl){cursor:nesw-resize}[data-ui=dashboard-grid] [data-part=resize-handle][data-edge=bottom-start]:dir(rtl){cursor:nwse-resize}[data-ui=dashboard-grid] [data-part=resize-handle]:is([data-edge=bottom-start],[data-edge=bottom-end]):before{background-color:transparent;block-size:var(--_radius);border-block-end:var(--slotted-border-width-thick, 3px) solid var(--_mark);border-radius:0;inline-size:var(--_radius);inset:auto;inset-block-end:calc(var(--_hit) / 2 - var(--slotted-border-width-thin, 1px));margin:0}[data-ui=dashboard-grid] [data-part=resize-handle][data-edge=bottom-end]:before{border-end-end-radius:var(--_radius);border-inline-end:var(--slotted-border-width-thick, 3px) solid var(--_mark);inset-inline-end:calc(var(--_hit) / 2 - var(--slotted-border-width-thin, 1px))}[data-ui=dashboard-grid] [data-part=resize-handle][data-edge=bottom-start]:before{border-end-start-radius:var(--_radius);border-inline-start:var(--slotted-border-width-thick, 3px) solid var(--_mark);inset-inline-start:calc(var(--_hit) / 2 - var(--slotted-border-width-thin, 1px))}[data-ui=dashboard-grid] [data-part=resize-handle]:not([data-disabled]):hover,[data-ui=dashboard-grid] [data-part=resize-handle][data-active]{--_mark: var(--_accent)}[data-ui=dashboard-grid] [data-part=resize-handle]:is([data-edge=start],[data-edge=end]):is(:not([data-disabled]):hover,[data-active]):before{block-size:var(--slotted-dashboard-grid-resize-pill-active, 2.75rem)}[data-ui=dashboard-grid] [data-part=resize-handle][data-edge=bottom]:is(:not([data-disabled]):hover,[data-active]):before{inline-size:var(--slotted-dashboard-grid-resize-pill-active, 2.75rem)}@container dashboard-grid (width < 1024px){[data-ui=dashboard-grid] [data-part=widget]>[data-part=resize-handle]:is([data-edge=start],[data-edge=bottom-start]){display:none}}@container dashboard-grid (width < 600px){[data-ui=dashboard-grid] [data-part=widget]>[data-part=resize-handle]{display:none}}[data-ui=dashboard-grid] [data-part=widget]:is([data-dragging],[data-resizing]){block-size:var(--_dg-origin-block-size);grid-column:auto;grid-row:auto;inline-size:var(--_dg-origin-inline-size);inset-block-start:var(--_dg-origin-block-start);inset-inline-start:var(--_dg-origin-inline-start);position:absolute;translate:var(--_dg-lift-x, 0) var(--_dg-lift-y, 0);z-index:3}[data-ui=dashboard-grid] [data-part=widget][data-dragging]{cursor:grabbing}[data-ui=dashboard-grid] [data-part=widget][data-dragging]>[data-ui=card]{box-shadow:var(--slotted-shadow-lg),0 0 0 var(--slotted-border-width-thin, 1px) color-mix(in oklab,var(--_accent) 60%,transparent)}[data-ui=dashboard-grid] [data-part=widget][data-resizing]>[data-ui=card]{box-shadow:var(--slotted-shadow-md),0 0 0 var(--slotted-border-width-thin, 1px) color-mix(in oklab,var(--_accent) 60%,transparent)}[data-ui=dashboard-grid]>[data-part=grid]>[data-part=placeholder]{background-color:color-mix(in oklab,var(--_accent) 10%,transparent);border:var(--slotted-border-width-thin, 1px) solid color-mix(in oklab,var(--_accent) 55%,transparent);border-radius:var(--_radius);box-sizing:border-box;pointer-events:none}[data-ui=dashboard-grid] [data-part=widget]>[data-part=size-readout]{background-color:var(--_accent);border-radius:var(--slotted-radius-full, 9999px);box-shadow:var(--slotted-shadow-sm);color:var(--slotted-tone-accent-on-solid, HighlightText);font-size:var(--slotted-font-size-xs, .6875rem);font-variant-numeric:tabular-nums;font-weight:var(--slotted-font-weight-semibold, 600);inset-block-end:var(--slotted-space-5, .75rem);inset-inline-end:var(--slotted-space-5, .75rem);line-height:var(--slotted-line-height-xs, 1.4);padding-block:var(--slotted-space-1, .125rem);padding-inline:var(--slotted-space-4, .5rem);pointer-events:none;position:absolute;white-space:nowrap;z-index:4}[data-ui=dashboard-grid] [data-part=widget]>[data-part=size-readout][data-edge=start],[data-ui=dashboard-grid] [data-part=widget]>[data-part=size-readout][data-edge=bottom-start]{inset-inline:var(--slotted-space-5, .75rem) auto}[data-ui=dashboard-grid]>[data-part=empty]{min-block-size:calc(var(--_row) * 2 + var(--_gap))}}\n", "@layer slotted.components{[data-ui=visually-hidden]:not([data-focusable]:focus-within){block-size:1px;border:0;clip-path:inset(50%);inline-size:1px;inset-block-start:0;inset-inline-start:0;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap}}\n"] }]
|
|
1860
|
+
}], ctorParameters: () => [], propDecorators: { layout: [{ type: i0.Input, args: [{ isSignal: true, alias: "layout", required: false }] }, { type: i0.Output, args: ["layoutChange"] }], defaultLayout: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultLayout", required: false }] }], editing: [{ type: i0.Input, args: [{ isSignal: true, alias: "editing", required: false }] }, { type: i0.Output, args: ["editingChange"] }], defaultEditing: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultEditing", required: false }] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: false }] }], editBar: [{ type: i0.Input, args: [{ isSignal: true, alias: "editBar", required: false }] }], headingLevel: [{ type: i0.Input, args: [{ isSignal: true, alias: "headingLevel", required: false }] }], messages: [{ type: i0.Input, args: [{ isSignal: true, alias: "messages", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], ariaLabelledBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-labelledby", required: false }] }], layoutChangeRequest: [{ type: i0.Output, args: ["layoutChangeRequest"] }], editingChangeRequest: [{ type: i0.Output, args: ["editingChangeRequest"] }], list: [{ type: i0.ViewChild, args: ['list', { isSignal: true }] }], widgets: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => SlDashboardWidget), { isSignal: true }] }] } });
|
|
1861
|
+
|
|
1862
|
+
/** What the store holds under the key; a store that throws holds nothing. */
|
|
1863
|
+
function readStored(store, key) {
|
|
1864
|
+
try {
|
|
1865
|
+
return store?.getItem(key) ?? null;
|
|
1866
|
+
}
|
|
1867
|
+
catch {
|
|
1868
|
+
return null;
|
|
1869
|
+
}
|
|
1870
|
+
}
|
|
1871
|
+
function defaultStorage() {
|
|
1872
|
+
try {
|
|
1873
|
+
return typeof window === 'undefined' ? null : window.localStorage;
|
|
1874
|
+
}
|
|
1875
|
+
catch {
|
|
1876
|
+
return null;
|
|
1877
|
+
}
|
|
1878
|
+
}
|
|
1879
|
+
/**
|
|
1880
|
+
* The reader's layout, kept across visits. The store is reached inside `try`
|
|
1881
|
+
* both ways — a private window, a full quota or a blocked origin reads as
|
|
1882
|
+
* nothing stored and writes nothing. The component itself never writes; the
|
|
1883
|
+
* store and its key are the application's to name.
|
|
1884
|
+
*/
|
|
1885
|
+
function persistedDashboardLayout({ key, storage, defaultLayout = [], injector, }) {
|
|
1886
|
+
const store = storage === undefined ? defaultStorage() : storage;
|
|
1887
|
+
const text = readStored(store, key);
|
|
1888
|
+
const layout = signal((text === null ? null : parseDashboardLayout(text)) ?? defaultLayout, /* @ts-ignore */
|
|
1889
|
+
...(ngDevMode ? [{ debugName: "layout" }] : /* istanbul ignore next */ []));
|
|
1890
|
+
/* What the store already holds: the value just read is not written back,
|
|
1891
|
+
so a reader who never changed anything stores nothing. An effect's first
|
|
1892
|
+
run is deferred, so this compares values rather than counting runs. */
|
|
1893
|
+
let held = layout();
|
|
1894
|
+
effect(() => {
|
|
1895
|
+
const next = layout();
|
|
1896
|
+
untracked(() => {
|
|
1897
|
+
if (next === held)
|
|
1898
|
+
return;
|
|
1899
|
+
held = next;
|
|
1900
|
+
try {
|
|
1901
|
+
store?.setItem(key, serializeDashboardLayout(next));
|
|
1902
|
+
}
|
|
1903
|
+
catch {
|
|
1904
|
+
/* Nothing stored: the next visit starts from the default. */
|
|
1905
|
+
}
|
|
1906
|
+
});
|
|
1907
|
+
}, injector === undefined ? {} : { injector });
|
|
1908
|
+
return {
|
|
1909
|
+
layout,
|
|
1910
|
+
clear() {
|
|
1911
|
+
try {
|
|
1912
|
+
store?.removeItem(key);
|
|
1913
|
+
}
|
|
1914
|
+
catch {
|
|
1915
|
+
/* Nothing to forget. */
|
|
1916
|
+
}
|
|
1917
|
+
held = defaultLayout;
|
|
1918
|
+
layout.set(defaultLayout);
|
|
1919
|
+
},
|
|
1920
|
+
};
|
|
1921
|
+
}
|
|
1922
|
+
|
|
1923
|
+
/**
|
|
1924
|
+
* Generated bundle index. Do not edit.
|
|
1925
|
+
*/
|
|
1926
|
+
|
|
1927
|
+
export { DASHBOARD_GRID_DEFAULTS, SlDashboardGrid, SlDashboardGridIdFactory, SlDashboardPart, SlDashboardWidget, SlDashboardWidgetActions, SlDashboardWidgetEmptyAction, SlDashboardWidgetFooter, SlDashboardWidgetSkeleton, injectDashboardGridDefaults, persistedDashboardLayout, provideDashboardGridDefaults };
|
|
1928
|
+
//# sourceMappingURL=slotted-angular-dashboard-grid.mjs.map
|