@slotted/angular 0.1.0-beta.29 → 0.1.0-beta.30
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/docs/AGENTS.snippet.md +1 -1
- package/docs/accordion.json +5 -5
- package/docs/accordion.md +12 -12
- package/docs/action-bar.json +20 -20
- package/docs/action-bar.md +28 -28
- package/docs/action-sheet.json +4 -4
- package/docs/action-sheet.md +12 -12
- package/docs/alert.json +10 -10
- package/docs/alert.md +16 -16
- package/docs/app-shell.examples.md +7 -7
- package/docs/app-shell.json +13 -13
- package/docs/app-shell.md +3 -3
- package/docs/avatar-group.json +1 -1
- package/docs/avatar-group.md +1 -1
- package/docs/avatar.json +10 -10
- package/docs/avatar.md +9 -9
- package/docs/badge.json +3 -3
- package/docs/badge.md +3 -3
- package/docs/breadcrumb.json +2 -2
- package/docs/breadcrumb.md +2 -2
- package/docs/button-group.json +1 -1
- package/docs/button-group.md +1 -1
- package/docs/button.json +11 -11
- package/docs/button.md +7 -7
- package/docs/calendar.json +4 -4
- package/docs/calendar.md +3 -3
- package/docs/card.json +2 -2
- package/docs/card.md +2 -2
- package/docs/carousel.json +10 -10
- package/docs/carousel.md +11 -11
- package/docs/chart.examples.md +32 -32
- package/docs/chart.json +33 -33
- package/docs/chart.md +4 -4
- package/docs/checkbox-group.examples.md +13 -13
- package/docs/checkbox-group.json +7 -7
- package/docs/checkbox-group.md +2 -2
- package/docs/checkbox.examples.md +7 -7
- package/docs/checkbox.json +6 -6
- package/docs/checkbox.md +3 -3
- package/docs/code-block.json +1 -1
- package/docs/code-block.md +1 -1
- package/docs/collapsible.json +11 -11
- package/docs/collapsible.md +19 -19
- package/docs/color-picker.json +26 -26
- package/docs/color-picker.md +16 -16
- package/docs/combobox.json +2 -2
- package/docs/combobox.md +2 -2
- package/docs/context-menu.json +1 -1
- package/docs/context-menu.md +1 -1
- package/docs/currency-field.examples.md +3 -3
- package/docs/currency-field.json +6 -6
- package/docs/currency-field.md +4 -4
- package/docs/dashboard-grid.json +1 -1
- package/docs/data-grid.examples.md +1 -1
- package/docs/data-grid.json +2 -2
- package/docs/data-grid.props.md +1 -1
- package/docs/date-field.json +3 -3
- package/docs/date-field.md +5 -5
- package/docs/date-picker.json +1 -1
- package/docs/date-range-picker.json +1 -1
- package/docs/datetime-field.json +4 -4
- package/docs/datetime-field.md +9 -9
- package/docs/datetime-picker.json +1 -1
- package/docs/datetime-range-picker.examples.md +3 -3
- package/docs/datetime-range-picker.json +4 -4
- package/docs/datetime-range-picker.md +2 -2
- package/docs/description-list.json +5 -5
- package/docs/description-list.md +4 -4
- package/docs/detail-panel.json +10 -10
- package/docs/detail-panel.md +12 -12
- package/docs/dialog.examples.md +5 -5
- package/docs/dialog.json +10 -10
- package/docs/dialog.md +2 -2
- package/docs/dialog.props.md +2 -2
- package/docs/drawer.examples.md +13 -13
- package/docs/drawer.json +6 -6
- package/docs/event-calendar.examples.md +3 -3
- package/docs/event-calendar.json +5 -5
- package/docs/event-calendar.md +2 -2
- package/docs/field-group.json +6 -6
- package/docs/field-group.md +11 -11
- package/docs/field.examples.md +3 -3
- package/docs/field.json +4 -4
- package/docs/field.md +1 -1
- package/docs/form.json +8 -8
- package/docs/form.md +12 -12
- package/docs/fullscreen.json +4 -4
- package/docs/fullscreen.md +7 -7
- package/docs/guidelines/async-feedback.md +2 -2
- package/docs/guidelines/builders.md +1 -1
- package/docs/guidelines/composition.md +4 -4
- package/docs/guidelines/conversations.md +1 -1
- package/docs/guidelines/index.md +2 -2
- package/docs/guidelines/layout-alignment.md +5 -5
- package/docs/guidelines/overviews.md +3 -3
- package/docs/guidelines/own-elements.md +7 -7
- package/docs/guidelines/record-pages.md +1 -1
- package/docs/highlight.json +9 -9
- package/docs/highlight.md +14 -14
- package/docs/icon.json +2 -2
- package/docs/icon.md +2 -2
- package/docs/image.json +3 -3
- package/docs/image.md +3 -3
- package/docs/import-export-center.json +23 -23
- package/docs/import-export-center.md +17 -17
- package/docs/inline-message.json +15 -15
- package/docs/inline-message.md +22 -22
- package/docs/inline.json +1 -1
- package/docs/inline.md +1 -1
- package/docs/kbd.json +2 -2
- package/docs/kbd.md +2 -2
- package/docs/link.json +6 -6
- package/docs/link.md +6 -6
- package/docs/list-item.json +1 -1
- package/docs/list-item.md +1 -1
- package/docs/list.json +1 -1
- package/docs/listbox.json +1 -1
- package/docs/listbox.md +1 -1
- package/docs/loading-overlay.json +3 -3
- package/docs/loading-overlay.md +3 -3
- package/docs/message-scroller.json +1 -1
- package/docs/message-scroller.md +1 -1
- package/docs/message.json +11 -11
- package/docs/message.md +17 -17
- package/docs/multi-select.json +1 -1
- package/docs/notification-center.json +16 -16
- package/docs/notification-center.md +18 -22
- package/docs/number-field.examples.md +3 -3
- package/docs/number-field.json +3 -3
- package/docs/otp-input.json +10 -10
- package/docs/otp-input.md +13 -13
- package/docs/page-header.json +9 -9
- package/docs/page-header.md +20 -22
- package/docs/pagination.json +2 -2
- package/docs/pagination.md +1 -1
- package/docs/popover.examples.md +1 -1
- package/docs/popover.json +3 -3
- package/docs/popover.md +1 -1
- package/docs/progress-indicator.json +4 -4
- package/docs/progress-indicator.md +4 -4
- package/docs/prompt-composer.json +4 -4
- package/docs/prompt-composer.md +5 -5
- package/docs/prose.json +1 -1
- package/docs/prose.md +1 -1
- package/docs/radio-group.examples.md +19 -19
- package/docs/radio-group.json +12 -12
- package/docs/radio-group.md +3 -3
- package/docs/rating.json +23 -23
- package/docs/rating.md +25 -34
- package/docs/result-state.json +12 -12
- package/docs/result-state.md +17 -17
- package/docs/saved-views.json +1 -1
- package/docs/scroll-area.json +5 -5
- package/docs/scroll-area.md +6 -6
- package/docs/section.json +6 -6
- package/docs/section.md +12 -12
- package/docs/segmented-control.json +14 -14
- package/docs/segmented-control.md +32 -32
- package/docs/skeleton.json +1 -1
- package/docs/skeleton.md +1 -1
- package/docs/skills/build-own-element/SKILL.md +3 -3
- package/docs/skills/compose-screen/SKILL.md +2 -2
- package/docs/skills/index.md +2 -2
- package/docs/skills/review-screen/SKILL.md +3 -3
- package/docs/skills/theme-app/SKILL.md +9 -9
- package/docs/skills/waiting-states/SKILL.md +1 -1
- package/docs/slider.json +8 -8
- package/docs/slider.md +12 -12
- package/docs/sparkline.json +8 -8
- package/docs/sparkline.md +6 -6
- package/docs/split-button.json +11 -11
- package/docs/split-button.md +25 -27
- package/docs/stack.json +1 -1
- package/docs/stack.md +1 -1
- package/docs/stat-card.json +3 -3
- package/docs/stat-card.md +2 -2
- package/docs/status-indicator.json +8 -8
- package/docs/status-indicator.md +5 -5
- package/docs/stepper.json +4 -4
- package/docs/stepper.md +4 -4
- package/docs/switch.json +5 -5
- package/docs/switch.md +7 -7
- package/docs/table-of-contents.json +11 -11
- package/docs/table-of-contents.md +12 -12
- package/docs/table.examples.md +1 -1
- package/docs/table.json +1 -1
- package/docs/tabs.json +1 -1
- package/docs/tabs.md +1 -1
- package/docs/tag.json +17 -17
- package/docs/tag.md +14 -14
- package/docs/tags-input.json +1 -1
- package/docs/tags-input.md +1 -1
- package/docs/text-field.examples.md +6 -6
- package/docs/text-field.json +4 -4
- package/docs/textarea.examples.md +7 -7
- package/docs/textarea.json +3 -3
- package/docs/time-field.json +3 -3
- package/docs/time-field.md +6 -6
- package/docs/time-picker.json +5 -5
- package/docs/time-picker.md +6 -6
- package/docs/time-range-picker.examples.md +5 -5
- package/docs/time-range-picker.json +5 -5
- package/docs/time-range-picker.md +1 -1
- package/docs/toast.json +6 -6
- package/docs/toast.md +6 -6
- package/docs/toggle-group.json +12 -12
- package/docs/toggle-group.md +28 -28
- package/docs/toggle.json +8 -8
- package/docs/toggle.md +7 -7
- package/docs/tokens.md +15 -15
- package/docs/toolbar.json +11 -11
- package/docs/toolbar.md +23 -23
- package/docs/tooltip.json +3 -3
- package/docs/tooltip.md +3 -3
- package/docs/top-navigation.examples.md +11 -15
- package/docs/top-navigation.json +9 -9
- package/docs/top-navigation.md +7 -7
- package/docs/tour.json +9 -9
- package/docs/tour.md +6 -6
- package/docs/typography.json +2 -2
- package/docs/typography.md +2 -2
- package/docs/upload.examples.md +3 -3
- package/docs/upload.json +9 -9
- package/docs/upload.md +4 -4
- package/fesm2022/slotted-angular-alert.mjs +2 -2
- package/fesm2022/slotted-angular-alert.mjs.map +1 -1
- package/fesm2022/slotted-angular-app-shell.mjs +10 -10
- package/fesm2022/slotted-angular-app-shell.mjs.map +1 -1
- package/fesm2022/slotted-angular-avatar-group.mjs +4 -4
- package/fesm2022/slotted-angular-avatar-group.mjs.map +1 -1
- package/fesm2022/slotted-angular-avatar.mjs +3 -3
- package/fesm2022/slotted-angular-avatar.mjs.map +1 -1
- package/fesm2022/slotted-angular-badge.mjs +1 -1
- package/fesm2022/slotted-angular-badge.mjs.map +1 -1
- package/fesm2022/slotted-angular-breadcrumb.mjs +1 -1
- package/fesm2022/slotted-angular-breadcrumb.mjs.map +1 -1
- package/fesm2022/slotted-angular-button-group.mjs +1 -1
- package/fesm2022/slotted-angular-button-group.mjs.map +1 -1
- package/fesm2022/slotted-angular-button.mjs +2 -2
- package/fesm2022/slotted-angular-button.mjs.map +1 -1
- package/fesm2022/slotted-angular-card.mjs +1 -1
- package/fesm2022/slotted-angular-card.mjs.map +1 -1
- package/fesm2022/slotted-angular-chart.mjs +2 -2
- package/fesm2022/slotted-angular-chart.mjs.map +1 -1
- package/fesm2022/slotted-angular-checkbox.mjs +1 -1
- package/fesm2022/slotted-angular-checkbox.mjs.map +1 -1
- package/fesm2022/slotted-angular-code-block.mjs +1 -1
- package/fesm2022/slotted-angular-code-block.mjs.map +1 -1
- package/fesm2022/slotted-angular-collapsible.mjs +1 -1
- package/fesm2022/slotted-angular-collapsible.mjs.map +1 -1
- package/fesm2022/slotted-angular-color-picker.mjs +6 -6
- package/fesm2022/slotted-angular-color-picker.mjs.map +1 -1
- package/fesm2022/slotted-angular-column-manager.mjs +3 -1
- package/fesm2022/slotted-angular-column-manager.mjs.map +1 -1
- package/fesm2022/slotted-angular-currency-field.mjs +2 -2
- package/fesm2022/slotted-angular-currency-field.mjs.map +1 -1
- package/fesm2022/slotted-angular-data-grid.mjs +1 -1
- package/fesm2022/slotted-angular-data-grid.mjs.map +1 -1
- package/fesm2022/slotted-angular-datetime-field.mjs +1 -1
- package/fesm2022/slotted-angular-datetime-field.mjs.map +1 -1
- package/fesm2022/slotted-angular-datetime-range-picker.mjs +6 -6
- package/fesm2022/slotted-angular-datetime-range-picker.mjs.map +1 -1
- package/fesm2022/slotted-angular-description-list.mjs +3 -3
- package/fesm2022/slotted-angular-description-list.mjs.map +1 -1
- package/fesm2022/slotted-angular-dialog.mjs +3 -3
- package/fesm2022/slotted-angular-dialog.mjs.map +1 -1
- package/fesm2022/slotted-angular-drawer.mjs +1 -1
- package/fesm2022/slotted-angular-drawer.mjs.map +1 -1
- package/fesm2022/slotted-angular-event-calendar.mjs +3 -3
- package/fesm2022/slotted-angular-event-calendar.mjs.map +1 -1
- package/fesm2022/slotted-angular-field.mjs +2 -2
- package/fesm2022/slotted-angular-field.mjs.map +1 -1
- package/fesm2022/slotted-angular-form.mjs +6 -6
- package/fesm2022/slotted-angular-form.mjs.map +1 -1
- package/fesm2022/slotted-angular-grid.mjs +2 -2
- package/fesm2022/slotted-angular-grid.mjs.map +1 -1
- package/fesm2022/slotted-angular-highlight.mjs +1 -1
- package/fesm2022/slotted-angular-highlight.mjs.map +1 -1
- package/fesm2022/slotted-angular-icon.mjs +3 -3
- package/fesm2022/slotted-angular-icon.mjs.map +1 -1
- package/fesm2022/slotted-angular-import-export-center.mjs +10 -10
- package/fesm2022/slotted-angular-import-export-center.mjs.map +1 -1
- package/fesm2022/slotted-angular-inline-message.mjs +4 -4
- package/fesm2022/slotted-angular-inline-message.mjs.map +1 -1
- package/fesm2022/slotted-angular-inline.mjs +3 -3
- package/fesm2022/slotted-angular-inline.mjs.map +1 -1
- package/fesm2022/slotted-angular-kbd.mjs.map +1 -1
- package/fesm2022/slotted-angular-list.mjs +1 -1
- package/fesm2022/slotted-angular-list.mjs.map +1 -1
- package/fesm2022/slotted-angular-listbox.mjs +2 -2
- package/fesm2022/slotted-angular-listbox.mjs.map +1 -1
- package/fesm2022/slotted-angular-loading-overlay.mjs +3 -3
- package/fesm2022/slotted-angular-loading-overlay.mjs.map +1 -1
- package/fesm2022/slotted-angular-menu.mjs +2 -2
- package/fesm2022/slotted-angular-menu.mjs.map +1 -1
- package/fesm2022/slotted-angular-message-scroller.mjs +1 -1
- package/fesm2022/slotted-angular-message-scroller.mjs.map +1 -1
- package/fesm2022/slotted-angular-notification-center.mjs +3 -3
- package/fesm2022/slotted-angular-notification-center.mjs.map +1 -1
- package/fesm2022/slotted-angular-number-field.mjs +1 -1
- package/fesm2022/slotted-angular-number-field.mjs.map +1 -1
- package/fesm2022/slotted-angular-otp-input.mjs +1 -1
- package/fesm2022/slotted-angular-otp-input.mjs.map +1 -1
- package/fesm2022/slotted-angular-popover.mjs +2 -2
- package/fesm2022/slotted-angular-popover.mjs.map +1 -1
- package/fesm2022/slotted-angular-progress-indicator.mjs +2 -2
- package/fesm2022/slotted-angular-progress-indicator.mjs.map +1 -1
- package/fesm2022/slotted-angular-radio-group.mjs +2 -2
- package/fesm2022/slotted-angular-radio-group.mjs.map +1 -1
- package/fesm2022/slotted-angular-rating.mjs +5 -5
- package/fesm2022/slotted-angular-rating.mjs.map +1 -1
- package/fesm2022/slotted-angular-result-state.mjs.map +1 -1
- package/fesm2022/slotted-angular-segmented-control.mjs +1 -1
- package/fesm2022/slotted-angular-segmented-control.mjs.map +1 -1
- package/fesm2022/slotted-angular-slider.mjs +3 -3
- package/fesm2022/slotted-angular-slider.mjs.map +1 -1
- package/fesm2022/slotted-angular-stack.mjs +2 -2
- package/fesm2022/slotted-angular-stack.mjs.map +1 -1
- package/fesm2022/slotted-angular-status-indicator.mjs +1 -1
- package/fesm2022/slotted-angular-status-indicator.mjs.map +1 -1
- package/fesm2022/slotted-angular-switch.mjs.map +1 -1
- package/fesm2022/slotted-angular-table.mjs +2 -2
- package/fesm2022/slotted-angular-table.mjs.map +1 -1
- package/fesm2022/slotted-angular-tabs.mjs.map +1 -1
- package/fesm2022/slotted-angular-tag.mjs +1 -1
- package/fesm2022/slotted-angular-tag.mjs.map +1 -1
- package/fesm2022/slotted-angular-tags-input.mjs +1 -1
- package/fesm2022/slotted-angular-tags-input.mjs.map +1 -1
- package/fesm2022/slotted-angular-theme.mjs.map +1 -1
- package/fesm2022/slotted-angular-time-range-picker.mjs +6 -6
- package/fesm2022/slotted-angular-time-range-picker.mjs.map +1 -1
- package/fesm2022/slotted-angular-toast.mjs +2 -2
- package/fesm2022/slotted-angular-toast.mjs.map +1 -1
- package/fesm2022/slotted-angular-toggle-group.mjs.map +1 -1
- package/fesm2022/slotted-angular-toggle.mjs.map +1 -1
- package/fesm2022/slotted-angular-tour.mjs +3 -3
- package/fesm2022/slotted-angular-tour.mjs.map +1 -1
- package/fesm2022/slotted-angular-typography.mjs +1 -1
- package/fesm2022/slotted-angular-typography.mjs.map +1 -1
- package/fesm2022/slotted-angular-upload.mjs +2 -2
- package/fesm2022/slotted-angular-upload.mjs.map +1 -1
- package/fesm2022/slotted-angular-wizard.mjs +6 -6
- package/fesm2022/slotted-angular-wizard.mjs.map +1 -1
- package/package.json +15 -3
- package/types/slotted-angular-alert.d.ts +3 -3
- package/types/slotted-angular-app-shell.d.ts +4 -4
- package/types/slotted-angular-avatar-group.d.ts +3 -3
- package/types/slotted-angular-avatar.d.ts +6 -6
- package/types/slotted-angular-badge.d.ts +3 -3
- package/types/slotted-angular-breadcrumb.d.ts +1 -1
- package/types/slotted-angular-button-group.d.ts +1 -1
- package/types/slotted-angular-button.d.ts +2 -2
- package/types/slotted-angular-card.d.ts +1 -1
- package/types/slotted-angular-chart.d.ts +2 -2
- package/types/slotted-angular-checkbox.d.ts +1 -1
- package/types/slotted-angular-code-block.d.ts +1 -1
- package/types/slotted-angular-collapsible.d.ts +1 -1
- package/types/slotted-angular-color-picker.d.ts +6 -6
- package/types/slotted-angular-column-manager.d.ts +1 -1
- package/types/slotted-angular-column-manager.d.ts.map +1 -1
- package/types/slotted-angular-currency-field.d.ts +1 -1
- package/types/slotted-angular-data-grid.d.ts +1 -1
- package/types/slotted-angular-datetime-range-picker.d.ts +1 -1
- package/types/slotted-angular-description-list.d.ts +1 -1
- package/types/slotted-angular-field.d.ts +2 -2
- package/types/slotted-angular-form.d.ts +1 -1
- package/types/slotted-angular-highlight.d.ts +1 -1
- package/types/slotted-angular-icon.d.ts +2 -2
- package/types/slotted-angular-import-export-center.d.ts +9 -9
- package/types/slotted-angular-inline-message.d.ts +3 -3
- package/types/slotted-angular-inline.d.ts +1 -1
- package/types/slotted-angular-kbd.d.ts +1 -1
- package/types/slotted-angular-list.d.ts +1 -1
- package/types/slotted-angular-listbox.d.ts +2 -2
- package/types/slotted-angular-loading-overlay.d.ts +3 -3
- package/types/slotted-angular-menu.d.ts +1 -1
- package/types/slotted-angular-message-scroller.d.ts +1 -1
- package/types/slotted-angular-notification-center.d.ts +4 -4
- package/types/slotted-angular-otp-input.d.ts +1 -1
- package/types/slotted-angular-progress-indicator.d.ts +2 -2
- package/types/slotted-angular-radio-group.d.ts +2 -2
- package/types/slotted-angular-rating.d.ts +2 -2
- package/types/slotted-angular-result-state.d.ts +1 -1
- package/types/slotted-angular-segmented-control.d.ts +2 -2
- package/types/slotted-angular-status-indicator.d.ts +2 -2
- package/types/slotted-angular-switch.d.ts +1 -1
- package/types/slotted-angular-table.d.ts +1 -1
- package/types/slotted-angular-tabs.d.ts +1 -1
- package/types/slotted-angular-tag.d.ts +3 -3
- package/types/slotted-angular-tags-input.d.ts +1 -1
- package/types/slotted-angular-theme.d.ts +1 -1
- package/types/slotted-angular-time-range-picker.d.ts +1 -1
- package/types/slotted-angular-toast.d.ts +4 -4
- package/types/slotted-angular-toggle-group.d.ts +1 -1
- package/types/slotted-angular-toggle.d.ts +1 -1
- package/types/slotted-angular-tour.d.ts +2 -2
- package/types/slotted-angular-wizard.d.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slotted-angular-avatar-group.mjs","sources":["../../avatar-group/src/avatar-group-host.ts","../../avatar-group/src/avatar-group-item.ts","../../avatar-group/src/avatar-group.ts","../../avatar-group/src/slotted-angular-avatar-group.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport type { Signal } from '@angular/core';\n\n/**\n * What a member is, to the group that holds it: a name, and a place in the row.\n *\n * The token exists so an item can ask the group whether it is beyond the limit\n * without importing the group, which imports the item for its own content\n * query. One direction each way is what keeps the two files out of a cycle.\n */\nexport interface AvatarGroupMember {\n /** The member's own name, read from the avatar inside it. */\n readonly memberName: Signal<string | undefined>;\n}\n\nexport interface AvatarGroupHost {\n isHiddenMember(member: AvatarGroupMember): boolean;\n}\n\nexport const AVATAR_GROUP = new InjectionToken<AvatarGroupHost>('slotted avatar group');\n","import { computed, contentChild, Directive, inject } from '@angular/core';\nimport { SlAvatar } from '@slotted/angular/avatar';\n\nimport { AVATAR_GROUP } from './avatar-group-host';\n\n/**\n * One member of the group: the list item that holds an avatar.\n *\n * React wraps each child itself, because it can. Angular cannot wrap projected\n * content one node at a time, so the item is written in the template — which is\n * the more honest of the two anyway: the `<li>` is the consumer's element, and\n * `*ngFor` puts it where the data says.\n *\n * A member past the group's limit is `hidden`, which takes it out of the layout\n * and out of the accessibility tree in one attribute. Its name is not lost: the\n * group reads it from here and puts it on the summary.\n */\n@Directive({\n selector: 'li[slAvatarGroupItem]',\n standalone: true,\n exportAs: 'slAvatarGroupItem',\n host: {\n 'data-part': 'item',\n 'data-part-item': '',\n '[attr.hidden]': \"hidden() ? '' : null\",\n },\n})\nexport class SlAvatarGroupItem {\n private readonly group = inject(AVATAR_GROUP);\n private readonly avatar = contentChild(SlAvatar);\n\n /** What the group calls this member when it has to summarise it away. */\n readonly memberName = computed(() => this.avatar()?.name());\n\n protected readonly hidden = computed(() => this.group.isHiddenMember(this));\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChildren,\n forwardRef,\n inject,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport { AVATAR_DEFAULTS, SlAvatar } from '@slotted/angular/avatar';\nimport type {\n AvatarDefaults,\n AvatarGroupLayout,\n AvatarShape,\n AvatarSize,\n AvatarVariant,\n} from '@slotted/angular/avatar';\nimport { formatCount } from '@slotted/core/count';\nimport { formatNameList } from '@slotted/core/identity';\n\nimport { AVATAR_GROUP, type AvatarGroupMember } from './avatar-group-host';\nimport { SlAvatarGroupItem } from './avatar-group-item';\n\n/**\n * The three axes the group hands down to the avatars inside it, through the\n * avatar family's own defaults token rather than through a second channel of\n * this family's invention. That is what keeps an explicit input on a member\n * winning over the group, because it is the rule `SlAvatar` already implements.\n *\n * `tone` is not among them, deliberately: a tone derived from a name is the\n * member's own identity, and a group that overrode it would paint eight people\n * the same colour.\n *\n * The values are read through getters so a member's `computed` tracks the\n * group's signals; a plain snapshot would fix the paint at the moment the first\n * member was created. The pattern `button-group` established.\n */\nfunction provideGroupPaint() {\n return {\n provide: AVATAR_DEFAULTS,\n useFactory: (): AvatarDefaults => {\n const group = inject(SlAvatarGroup);\n const inherited = inject(AVATAR_DEFAULTS, { skipSelf: true });\n\n return {\n get locale() {\n return group.locale() ?? inherited.locale;\n },\n get shape() {\n return group.shape() ?? inherited.shape;\n },\n get size() {\n return group.size() ?? inherited.size;\n },\n get tone() {\n return inherited.tone;\n },\n get variant() {\n return group.variant() ?? inherited.variant;\n },\n };\n },\n };\n}\n\n/**\n * A list of faces, overlapped or apart, ending in a summary of the ones it does\n * not show.\n *\n * It is written on a real `<ul>` whose members are real `<li>`s, so assistive\n * technology announces a list of N without the family inventing a role. There\n * is no `label` input: the element already accepts `aria-label`, and a second\n * way to name one thing is a second thing to get wrong — the decision\n * `button-group` took for the same question.\n *\n * The summary is an avatar rather than a fourth part painted to look like one,\n * so it takes the group's size, shape, edge and ring from the same rules as\n * every member beside it. Its accessible name is the hidden members' names,\n * joined for the locale: Atlassian's default there is the English string “N\n * more people”, and MUI, Ant, Fluent, Chakra and HeroUI leave `+3` as the whole\n * announcement.\n */\n@Component({\n selector: 'ul[slAvatarGroup]',\n standalone: true,\n exportAs: 'slAvatarGroup',\n imports: [SlAvatar],\n providers: [\n /* A decorator is evaluated before the class it decorates exists. */\n { provide: AVATAR_GROUP, useExisting: forwardRef(() => SlAvatarGroup) },\n provideGroupPaint(),\n ],\n template: `<ng-content></ng-content>\n @if (surplus() > 0 && summary() !== undefined) {\n <li data-part=\"overflow\" data-part-overflow=\"\">\n <span slAvatar tone=\"secondary\" [name]=\"overflowName()\" [initials]=\"'+' + summary()\"></span>\n </li>\n }`,\n styleUrl: '../../../styles/src/avatar-group/avatar-group.css',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n 'data-ui': 'avatar-group',\n 'data-ui-avatar-group': '',\n 'data-part': 'root',\n 'data-part-root': '',\n '[attr.data-layout]': 'layout()',\n '[attr.data-size]': 'resolvedSize()',\n '[attr.data-shape]': 'resolvedShape()',\n },\n})\nexport class SlAvatarGroup {\n /** `stack` overlaps the members; `spread` lays them apart and wraps. */\n readonly layout = input<AvatarGroupLayout>('stack');\n /**\n * The largest number of discs the group draws, the summary included. Above\n * it, one fewer member is shown and the rest are summarised. `false` shows\n * every member.\n */\n readonly max = input<number | false>(5);\n /**\n * How many members there really are, when the page renders fewer than it\n * has — a server-paged list showing three of forty. Defaults to the number of\n * items written.\n */\n readonly total = input<number | undefined>(undefined);\n /**\n * What the summary is called. Defaults to the hidden members' names, joined\n * for the locale — which is only possible while every hidden member is in the\n * DOM, so a group given a larger `total` supplies this itself.\n */\n readonly overflowLabel = input<string | undefined>(undefined);\n /** Provided to every member. An avatar that states its own still wins. */\n readonly size = input<AvatarSize | undefined>(undefined);\n /** Provided to every member. An avatar that states its own still wins. */\n readonly shape = input<AvatarShape | undefined>(undefined);\n /** Provided to every member. An avatar that states its own still wins. */\n readonly variant = input<AvatarVariant | undefined>(undefined);\n /** BCP 47, for the digits of the summary and for joining the hidden names. */\n readonly locale = input<string | undefined>(undefined);\n\n private readonly inherited = inject(AVATAR_DEFAULTS, { skipSelf: true });\n private readonly items = contentChildren(SlAvatarGroupItem);\n\n protected readonly resolvedSize = computed(() => this.size() ?? this.inherited.size);\n protected readonly resolvedShape = computed(() => this.shape() ?? this.inherited.shape);\n private readonly resolvedLocale = computed(() => this.locale() ?? this.inherited.locale);\n\n private readonly count = computed(() => this.total() ?? this.items().length);\n\n /**\n * `max` counts the discs the group draws, the summary included, so a limit of\n * five never puts six circles in a row. Below the limit nothing is\n * summarised: a `+1` beside four faces is one more circle than showing the\n * fifth, and says less.\n */\n private readonly shownCount = computed(() => {\n const max = this.max();\n const limit = max === false ? Number.POSITIVE_INFINITY : max;\n const items = this.items().length;\n return this.count() > limit ? Math.min(limit - 1, items) : items;\n });\n\n protected readonly surplus = computed(() => Math.max(this.count() - this.shownCount(), 0));\n\n protected readonly summary = computed(() =>\n formatCount({ count: this.surplus(), max: false, locale: this.resolvedLocale() }),\n );\n\n /**\n * The names of the members that were not drawn. They are only complete while\n * every hidden member is in the DOM: a group told it stands for forty and\n * given three items knows three names and no more, so it says nothing rather\n * than naming a third of them.\n */\n protected readonly overflowName = computed(() => {\n const label = this.overflowLabel();\n if (label !== undefined) return label;\n const total = this.total();\n if (total !== undefined && total !== this.items().length) return undefined;\n return formatNameList({\n names: this.items()\n .slice(this.shownCount())\n .map((item) => item.memberName()),\n locale: this.resolvedLocale(),\n });\n });\n\n /** Read from each item's own `computed`, so a member hides itself. */\n isHiddenMember(member: AvatarGroupMember) {\n return this.items().indexOf(member as SlAvatarGroupItem) >= this.shownCount();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;MAmBa,YAAY,GAAG,IAAI,cAAc,CAAkB,sBAAsB;;ACdtF;;;;;;;;;;;AAWG;MAWU,iBAAiB,CAAA;AACX,IAAA,KAAK,GAAG,MAAM,CAAC,YAAY,CAAC;IAC5B,MAAM,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AC/B;AACJ,wBAAA,SAAS,EAAE,cAAc;AACzB,wBAAA,sBAAsB,EAAE,EAAE;AAC1B,wBAAA,WAAW,EAAE,MAAM;AACnB,wBAAA,gBAAgB,EAAE,EAAE;AACpB,wBAAA,oBAAoB,EAAE,UAAU;AAChC,wBAAA,kBAAkB,EAAE,gBAAgB;AACpC,wBAAA,mBAAmB,EAAE,iBAAiB;AACvC,qBAAA,EAAA,MAAA,EAAA,CAAA,6rFAAA,CAAA,EAAA;+zBAiCwC,iBAAiB,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AC/I5D;;AAEG;;"}
|
|
1
|
+
{"version":3,"file":"slotted-angular-avatar-group.mjs","sources":["../../avatar-group/src/avatar-group-host.ts","../../avatar-group/src/avatar-group-item.ts","../../avatar-group/src/avatar-group.ts","../../avatar-group/src/slotted-angular-avatar-group.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport type { Signal } from '@angular/core';\n\n/**\n * What a member is, to the group that holds it: a name, and a place in the row.\n *\n * The token exists so an item can ask the group whether it is beyond the limit\n * without importing the group, which imports the item for its own content\n * query. One direction each way is what keeps the two files out of a cycle.\n */\nexport interface AvatarGroupMember {\n /** The member's own name, read from the avatar inside it. */\n readonly memberName: Signal<string | undefined>;\n}\n\nexport interface AvatarGroupHost {\n isHiddenMember(member: AvatarGroupMember): boolean;\n}\n\nexport const AVATAR_GROUP = new InjectionToken<AvatarGroupHost>('slotted avatar group');\n","import { computed, contentChild, Directive, inject } from '@angular/core';\nimport { SlAvatar } from '@slotted/angular/avatar';\n\nimport { AVATAR_GROUP } from './avatar-group-host';\n\n/**\n * One member of the group: the list item that holds an avatar.\n *\n * React wraps each child itself, because it can. Angular cannot wrap projected\n * content one node at a time, so the item is written in the template — which is\n * the more honest of the two anyway: the `<li>` is the consumer's element, and\n * `*ngFor` puts it where the data says.\n *\n * A member past the group's limit is `hidden`, which takes it out of the layout\n * and out of the accessibility tree in one attribute. Its name is not lost: the\n * group reads it from here and puts it on the summary.\n */\n@Directive({\n selector: 'li[slAvatarGroupItem]',\n standalone: true,\n exportAs: 'slAvatarGroupItem',\n host: {\n 'data-part': 'item',\n 'data-part-item': '',\n '[attr.hidden]': \"hidden() ? '' : null\",\n },\n})\nexport class SlAvatarGroupItem {\n private readonly group = inject(AVATAR_GROUP);\n private readonly avatar = contentChild(SlAvatar);\n\n /** What the group calls this member when it has to summarize it away. */\n readonly memberName = computed(() => this.avatar()?.name());\n\n protected readonly hidden = computed(() => this.group.isHiddenMember(this));\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChildren,\n forwardRef,\n inject,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport { AVATAR_DEFAULTS, SlAvatar } from '@slotted/angular/avatar';\nimport type {\n AvatarDefaults,\n AvatarGroupLayout,\n AvatarShape,\n AvatarSize,\n AvatarVariant,\n} from '@slotted/angular/avatar';\nimport { formatCount } from '@slotted/core/count';\nimport { formatNameList } from '@slotted/core/identity';\n\nimport { AVATAR_GROUP, type AvatarGroupMember } from './avatar-group-host';\nimport { SlAvatarGroupItem } from './avatar-group-item';\n\n/**\n * The three axes the group hands down to the avatars inside it, through the\n * avatar family's own defaults token rather than through a second channel of\n * this family's invention. That is what keeps an explicit input on a member\n * winning over the group, because it is the rule `SlAvatar` already implements.\n *\n * `tone` is not among them, deliberately: a tone derived from a name is the\n * member's own identity, and a group that overrode it would paint eight people\n * the same color.\n *\n * The values are read through getters so a member's `computed` tracks the\n * group's signals; a plain snapshot would fix the paint at the moment the first\n * member was created. The pattern `button-group` established.\n */\nfunction provideGroupPaint() {\n return {\n provide: AVATAR_DEFAULTS,\n useFactory: (): AvatarDefaults => {\n const group = inject(SlAvatarGroup);\n const inherited = inject(AVATAR_DEFAULTS, { skipSelf: true });\n\n return {\n get locale() {\n return group.locale() ?? inherited.locale;\n },\n get shape() {\n return group.shape() ?? inherited.shape;\n },\n get size() {\n return group.size() ?? inherited.size;\n },\n get tone() {\n return inherited.tone;\n },\n get variant() {\n return group.variant() ?? inherited.variant;\n },\n };\n },\n };\n}\n\n/**\n * A list of faces, overlapped or apart, ending in a summary of the ones it does\n * not show.\n *\n * It is written on a real `<ul>` whose members are real `<li>`s, so assistive\n * technology announces a list of N without the family inventing a role. There\n * is no `label` input: the element already accepts `aria-label`, and a second\n * way to name one thing is a second thing to get wrong — the decision\n * `button-group` took for the same question.\n *\n * The summary is an avatar rather than a fourth part painted to look like one,\n * so it takes the group's size, shape, edge and ring from the same rules as\n * every member beside it. Its accessible name is the hidden members' names,\n * joined for the locale: Atlassian's default there is the English string “N\n * more people”, and MUI, Ant, Fluent, Chakra and HeroUI leave `+3` as the whole\n * announcement.\n */\n@Component({\n selector: 'ul[slAvatarGroup]',\n standalone: true,\n exportAs: 'slAvatarGroup',\n imports: [SlAvatar],\n providers: [\n /* A decorator is evaluated before the class it decorates exists. */\n { provide: AVATAR_GROUP, useExisting: forwardRef(() => SlAvatarGroup) },\n provideGroupPaint(),\n ],\n template: `<ng-content></ng-content>\n @if (surplus() > 0 && summary() !== undefined) {\n <li data-part=\"overflow\" data-part-overflow=\"\">\n <span slAvatar tone=\"secondary\" [name]=\"overflowName()\" [initials]=\"'+' + summary()\"></span>\n </li>\n }`,\n styleUrl: '../../../styles/src/avatar-group/avatar-group.css',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n 'data-ui': 'avatar-group',\n 'data-ui-avatar-group': '',\n 'data-part': 'root',\n 'data-part-root': '',\n '[attr.data-layout]': 'layout()',\n '[attr.data-size]': 'resolvedSize()',\n '[attr.data-shape]': 'resolvedShape()',\n },\n})\nexport class SlAvatarGroup {\n /** `stack` overlaps the members; `spread` lays them apart and wraps. */\n readonly layout = input<AvatarGroupLayout>('stack');\n /**\n * The largest number of discs the group draws, the summary included. Above\n * it, one fewer member is shown and the rest are summarized. `false` shows\n * every member.\n */\n readonly max = input<number | false>(5);\n /**\n * How many members there really are, when the page renders fewer than it\n * has — a server-paged list showing three of forty. Defaults to the number of\n * items written.\n */\n readonly total = input<number | undefined>(undefined);\n /**\n * What the summary is called. Defaults to the hidden members' names, joined\n * for the locale — which is only possible while every hidden member is in the\n * DOM, so a group given a larger `total` supplies this itself.\n */\n readonly overflowLabel = input<string | undefined>(undefined);\n /** Provided to every member. An avatar that states its own still wins. */\n readonly size = input<AvatarSize | undefined>(undefined);\n /** Provided to every member. An avatar that states its own still wins. */\n readonly shape = input<AvatarShape | undefined>(undefined);\n /** Provided to every member. An avatar that states its own still wins. */\n readonly variant = input<AvatarVariant | undefined>(undefined);\n /** BCP 47, for the digits of the summary and for joining the hidden names. */\n readonly locale = input<string | undefined>(undefined);\n\n private readonly inherited = inject(AVATAR_DEFAULTS, { skipSelf: true });\n private readonly items = contentChildren(SlAvatarGroupItem);\n\n protected readonly resolvedSize = computed(() => this.size() ?? this.inherited.size);\n protected readonly resolvedShape = computed(() => this.shape() ?? this.inherited.shape);\n private readonly resolvedLocale = computed(() => this.locale() ?? this.inherited.locale);\n\n private readonly count = computed(() => this.total() ?? this.items().length);\n\n /**\n * `max` counts the discs the group draws, the summary included, so a limit of\n * five never puts six circles in a row. Below the limit nothing is\n * summarized: a `+1` beside four faces is one more circle than showing the\n * fifth, and says less.\n */\n private readonly shownCount = computed(() => {\n const max = this.max();\n const limit = max === false ? Number.POSITIVE_INFINITY : max;\n const items = this.items().length;\n return this.count() > limit ? Math.min(limit - 1, items) : items;\n });\n\n protected readonly surplus = computed(() => Math.max(this.count() - this.shownCount(), 0));\n\n protected readonly summary = computed(() =>\n formatCount({ count: this.surplus(), max: false, locale: this.resolvedLocale() }),\n );\n\n /**\n * The names of the members that were not drawn. They are only complete while\n * every hidden member is in the DOM: a group told it stands for forty and\n * given three items knows three names and no more, so it says nothing rather\n * than naming a third of them.\n */\n protected readonly overflowName = computed(() => {\n const label = this.overflowLabel();\n if (label !== undefined) return label;\n const total = this.total();\n if (total !== undefined && total !== this.items().length) return undefined;\n return formatNameList({\n names: this.items()\n .slice(this.shownCount())\n .map((item) => item.memberName()),\n locale: this.resolvedLocale(),\n });\n });\n\n /** Read from each item's own `computed`, so a member hides itself. */\n isHiddenMember(member: AvatarGroupMember) {\n return this.items().indexOf(member as SlAvatarGroupItem) >= this.shownCount();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;MAmBa,YAAY,GAAG,IAAI,cAAc,CAAkB,sBAAsB;;ACdtF;;;;;;;;;;;AAWG;MAWU,iBAAiB,CAAA;AACX,IAAA,KAAK,GAAG,MAAM,CAAC,YAAY,CAAC;IAC5B,MAAM,GAAG,YAAY,CAAC,QAAQ;+EAAC;;AAGvC,IAAA,UAAU,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE;mFAAC;AAExC,IAAA,MAAM,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC;+EAAC;uGAPhE,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAjB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,iBAAiB,iPAEW,QAAQ,EAAA,WAAA,EAAA,IAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAFpC,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAV7B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,uBAAuB;AACjC,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,QAAQ,EAAE,mBAAmB;AAC7B,oBAA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AAA,EAAA,CAAA;;2FAyBP,aAAa,EAAA,UAAA,EAAA,CAAA;kBA7BzB,SAAS;+BACE,mBAAmB,EAAA,UAAA,EACjB,IAAI,EAAA,QAAA,EACN,eAAe,WAChB,CAAC,QAAQ,CAAC,EAAA,SAAA,EACR;;AAET,wBAAA,EAAE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,CAAC,MAAK,aAAc,CAAC,EAAE;AACvE,wBAAA,iBAAiB,EAAE;qBACpB,EAAA,QAAA,EACS,CAAA;;;;;AAKN,KAAA,CAAA,EAAA,eAAA,EAEa,uBAAuB,CAAC,MAAM,iBAChC,iBAAiB,CAAC,IAAI,EAAA,IAAA,EAC/B;AACJ,wBAAA,SAAS,EAAE,cAAc;AACzB,wBAAA,sBAAsB,EAAE,EAAE;AAC1B,wBAAA,WAAW,EAAE,MAAM;AACnB,wBAAA,gBAAgB,EAAE,EAAE;AACpB,wBAAA,oBAAoB,EAAE,UAAU;AAChC,wBAAA,kBAAkB,EAAE,gBAAgB;AACpC,wBAAA,mBAAmB,EAAE,iBAAiB;AACvC,qBAAA,EAAA,MAAA,EAAA,CAAA,6rFAAA,CAAA,EAAA;+zBAiCwC,iBAAiB,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AC/I5D;;AAEG;;"}
|
|
@@ -119,7 +119,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImpor
|
|
|
119
119
|
/**
|
|
120
120
|
* The palette `tone="auto"` chooses from, in the order the hash indexes it.
|
|
121
121
|
* Five is a small palette and collisions are frequent by construction: the
|
|
122
|
-
*
|
|
122
|
+
* color is an aid to scanning a list of faces, and the name is what identifies
|
|
123
123
|
* the person — which is why it is on the root in every one of the four
|
|
124
124
|
* statuses.
|
|
125
125
|
*/
|
|
@@ -157,7 +157,7 @@ const INITIALS_MAX = { xs: 1, sm: 2, md: 2, lg: 2, xl: 2 };
|
|
|
157
157
|
class SlAvatar {
|
|
158
158
|
/**
|
|
159
159
|
* The person or entity this is a picture of. It is the accessible name in
|
|
160
|
-
* every status, the source of the initials, and the seed of the
|
|
160
|
+
* every status, the source of the initials, and the seed of the color.
|
|
161
161
|
*/
|
|
162
162
|
name = input(undefined, /* @ts-ignore */
|
|
163
163
|
...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
@@ -170,7 +170,7 @@ class SlAvatar {
|
|
|
170
170
|
*/
|
|
171
171
|
initialsOverride = input(undefined, { ...(ngDevMode ? { debugName: "initialsOverride" } : /* istanbul ignore next */ {}), alias: 'initials' });
|
|
172
172
|
/**
|
|
173
|
-
* A stable identifier to derive the
|
|
173
|
+
* A stable identifier to derive the color from, when the name is not stable
|
|
174
174
|
* or two people share one. Defaults to `name`.
|
|
175
175
|
*/
|
|
176
176
|
idFor = input(undefined, /* @ts-ignore */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slotted-angular-avatar.mjs","sources":["../../avatar/src/avatar-defaults.ts","../../avatar/src/avatar-fallback.ts","../../avatar/src/avatar-image-host.ts","../../avatar/src/avatar-image.ts","../../avatar/src/avatar.ts","../../avatar/src/slotted-angular-avatar.ts"],"sourcesContent":["import { inject, InjectionToken } from '@angular/core';\n\n/**\n * Which of the five semantic colours the fallback is painted in. `auto` derives\n * it from the name, so the same person keeps the same colour in a list that is\n * re-sorted and in a table that is paged.\n */\nexport type AvatarTone =\n 'auto' | 'accent' | 'secondary' | 'info' | 'success' | 'warning' | 'danger';\n\n/** The palette `auto` chooses from, in the order the hash indexes it. */\nexport type AvatarResolvedTone = Exclude<AvatarTone, 'auto'>;\n\n/** How that colour is painted. `soft` is the tinted disc an avatar usually is. */\nexport type AvatarVariant = 'soft' | 'solid';\n/**\n * The ground behind the avatar. `tone` paints the tone behind the fallback and\n * nothing behind a loaded picture; `none` paints nothing; `plate` paints a\n * light plate in every scheme, for a logo designed for a white ground.\n */\nexport type AvatarSurface = 'tone' | 'none' | 'plate';\n\nexport type AvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n\n/** A circle is a person; a square is a team, an organisation or a bot. */\nexport type AvatarShape = 'circle' | 'square';\n\n/** Where the picture is. Four values, because a boolean cannot say why there is none. */\nexport type AvatarStatus = 'idle' | 'loading' | 'loaded' | 'error';\n\nexport type AvatarGroupLayout = 'stack' | 'spread';\n\nexport interface AvatarDefaults {\n /** BCP 47. Used to case the initials, and by the group to join names. */\n locale: string | undefined;\n shape: AvatarShape;\n size: AvatarSize;\n tone: AvatarTone;\n variant: AvatarVariant;\n}\n\nconst FALLBACK: AvatarDefaults = {\n locale: undefined,\n shape: 'circle',\n size: 'md',\n tone: 'auto',\n variant: 'soft',\n};\n\nexport const AVATAR_DEFAULTS = new InjectionToken<AvatarDefaults>('slotted avatar defaults', {\n providedIn: 'root',\n factory: () => FALLBACK,\n});\n\n/**\n * An application decides once how its avatars are shaped, how large they are,\n * how they are painted and — the one that matters most — which locale cases\n * their initials, rather than repeating four inputs on every avatar. An avatar\n * that states any of them itself still wins: an explicit input is never\n * overridden by the token.\n *\n * `SlAvatarGroup` provides the same token rather than a channel of its own,\n * which is what keeps a member's explicit `size` winning over the group's.\n */\nexport function provideAvatarDefaults(defaults: Partial<AvatarDefaults>) {\n return {\n provide: AVATAR_DEFAULTS,\n useFactory: (): AvatarDefaults => ({\n locale: defaults.locale ?? FALLBACK.locale,\n shape: defaults.shape ?? FALLBACK.shape,\n size: defaults.size ?? FALLBACK.size,\n tone: defaults.tone ?? FALLBACK.tone,\n variant: defaults.variant ?? FALLBACK.variant,\n }),\n };\n}\n\n/** What an avatar renders as here, before it states anything of its own. */\nexport function injectAvatarDefaults(): AvatarDefaults {\n return inject(AVATAR_DEFAULTS);\n}\n","import { Directive } from '@angular/core';\n\n/**\n * Content that stands in for the picture, in place of the initials and the\n * glyph: a company mark, a product logo, an `sl-icon`.\n *\n * It is a marker rather than a bare `<ng-content>` because Angular cannot ask\n * whether anything was projected, and an avatar that wrote its initials\n * *and* the consumer's logo into the same disc would be drawing two fallbacks.\n * React answers the same question by looking at `children`.\n */\n@Directive({\n selector: '[slAvatarFallback]',\n standalone: true,\n exportAs: 'slAvatarFallback',\n})\nexport class SlAvatarFallback {}\n","import { InjectionToken } from '@angular/core';\n\nimport type { AvatarStatus } from './avatar-defaults';\n\n/**\n * What the picture tells the avatar it sits in.\n *\n * It is a token rather than the component's own class so that one directive can\n * serve both pictures the family knows about: the `<img>` the avatar renders\n * for its own `src`, and the `<img>` the consumer projects — which is the one\n * that carries `ngSrc`, and therefore the one `NgOptimizedImage` can reach. A\n * directive that injected the component directly would put a cycle between the\n * two files, and the component imports the directive for its own template.\n */\nexport interface AvatarImageHost {\n reportStatus(status: AvatarStatus): void;\n}\n\nexport const AVATAR_IMAGE_HOST = new InjectionToken<AvatarImageHost>('slotted avatar image host');\n","import { afterNextRender, Directive, ElementRef, HostAttributeToken, inject } from '@angular/core';\n\nimport { AVATAR_IMAGE_HOST } from './avatar-image-host';\n\n/**\n * The picture inside an avatar.\n *\n * It is written on an `<img>` the consumer owns, which is what lets\n * `NgOptimizedImage` do its work: `ngSrc`, the priority hint, the generated\n * `srcset` and the size warnings all belong to a real `<img>` in the\n * consumer's template, and none of them survive being handed a `src` string\n * through an input. React has no equivalent, and its `renderImage` is the other\n * half of the same idea.\n *\n * `alt` is written empty only when the consumer wrote none: the avatar's name\n * is on the root, so naming the picture as well would read the person twice —\n * and would name them differently before the picture arrives.\n */\n@Directive({\n selector: 'img[slAvatarImage]',\n standalone: true,\n exportAs: 'slAvatarImage',\n host: {\n 'data-part': 'image',\n 'data-part-image': '',\n '[attr.alt]': 'alt',\n '(load)': 'avatar.reportStatus(\"loaded\")',\n '(error)': 'avatar.reportStatus(\"error\")',\n },\n})\nexport class SlAvatarImage {\n protected readonly avatar = inject(AVATAR_IMAGE_HOST);\n\n /** A static `alt` the consumer wrote is read before the host binding writes one. */\n protected readonly alt = inject(new HostAttributeToken('alt'), { optional: true }) ?? '';\n\n private readonly element = inject<ElementRef<HTMLImageElement>>(ElementRef).nativeElement;\n\n constructor() {\n /**\n * A picture already in the browser cache finishes decoding before the\n * listener is attached, so the element is asked whether it is already\n * complete rather than waited on for an event that has been and gone.\n * Without it an avatar shows initials over a picture that is already there.\n */\n afterNextRender(() => {\n if (this.element.complete && this.element.naturalWidth > 0) {\n this.avatar.reportStatus('loaded');\n }\n });\n }\n}\n","import {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChild,\n forwardRef,\n HostAttributeToken,\n inject,\n input,\n linkedSignal,\n output,\n ViewEncapsulation,\n} from '@angular/core';\nimport { SlGlyph, SlIcon } from '@slotted/angular/icon';\n\nimport { initialsFrom, toneFrom } from '@slotted/core/identity';\n\nimport {\n injectAvatarDefaults,\n type AvatarResolvedTone,\n type AvatarShape,\n type AvatarSize,\n type AvatarStatus,\n type AvatarTone,\n type AvatarSurface,\n type AvatarVariant,\n} from './avatar-defaults';\nimport { SlAvatarFallback } from './avatar-fallback';\nimport { AVATAR_IMAGE_HOST } from './avatar-image-host';\nimport { SlAvatarImage } from './avatar-image';\n\nexport type {\n AvatarDefaults,\n AvatarGroupLayout,\n AvatarResolvedTone,\n AvatarShape,\n AvatarSize,\n AvatarStatus,\n AvatarTone,\n AvatarSurface,\n AvatarVariant,\n} from './avatar-defaults';\n\n/**\n * The palette `tone=\"auto\"` chooses from, in the order the hash indexes it.\n * Five is a small palette and collisions are frequent by construction: the\n * colour is an aid to scanning a list of faces, and the name is what identifies\n * the person — which is why it is on the root in every one of the four\n * statuses.\n */\nconst AUTO_TONES: readonly AvatarResolvedTone[] = [\n 'accent',\n 'secondary',\n 'success',\n 'warning',\n 'danger',\n];\n\n/** At the smallest step there is room for one letter, which is Fluent's rule at 16 pixels. */\nconst INITIALS_MAX: Record<AvatarSize, number> = { xs: 1, sm: 2, md: 2, lg: 2, xl: 2 };\n\n/**\n * A picture of a person or an entity, and what stands in when there is none:\n * the initials taken from the name, then a glyph the family owns. A request\n * that fails never paints the browser's torn-page mark, because the picture is\n * out of sight until it reports that it arrived.\n *\n * The component is written on the element the page chose, so a `span` in a\n * table cell, an `a` that opens a profile and a `button` that opens a menu are\n * all the same avatar.\n *\n * The name lives on the root and the picture takes an empty `alt`, so the\n * avatar announces the same thing before and after the photograph loads. Every\n * surveyed implementation names the image instead, which makes the same avatar\n * “Ada Lovelace” once the picture arrives and “AL” before it.\n *\n * `status` is an input with an output beside it rather than a `model()`. A\n * `model()` promises a two-way binding for a value the browser owns: the\n * component would write over whatever the consumer passed the first time an\n * image loaded. Here the consumer's value simply wins, and the output reports\n * the derivation — a load event is a fact rather than a request, so there is\n * nothing to cancel and no reason from the closed vocabulary that fits it.\n */\n@Component({\n selector: '[slAvatar]',\n standalone: true,\n exportAs: 'slAvatar',\n imports: [SlAvatarImage, SlGlyph, SlIcon],\n providers: [\n /* The component is its own image host, and a decorator is evaluated before\n the class it decorates exists. */\n { provide: AVATAR_IMAGE_HOST, useExisting: forwardRef(() => SlAvatar) },\n ],\n template: `@if (src(); as source) {\n <img slAvatarImage [src]=\"source\" />\n }\n <ng-content select=\"img\"></ng-content\n ><span data-part=\"fallback\" data-part-fallback=\"\">\n @if (custom() === undefined) {\n <!-- No picture and no name to take initials from: the person glyph. -->\n @if (initials() === '') {\n <span slIcon><svg slGlyph name=\"person\"></svg></span>\n } @else {\n {{ initials() }}\n }\n }\n <ng-content select=\"[slAvatarFallback]\"></ng-content\n ></span>`,\n styleUrl: '../../../styles/src/avatar/avatar.css',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n 'data-ui': 'avatar',\n 'data-ui-avatar': '',\n 'data-part': 'root',\n 'data-part-root': '',\n '[attr.data-size]': 'resolvedSize()',\n '[attr.data-shape]': 'resolvedShape()',\n '[attr.data-tone]': 'resolvedTone()',\n '[attr.data-variant]': 'resolvedVariant()',\n '[attr.data-surface]': 'surface()',\n '[attr.data-status]': 'resolvedStatus()',\n '[attr.data-disabled]': \"disabled() ? '' : null\",\n '[attr.role]': 'role()',\n '[attr.aria-label]': 'ariaLabel()',\n '[attr.aria-hidden]': 'ariaHidden()',\n },\n})\nexport class SlAvatar {\n /**\n * The person or entity this is a picture of. It is the accessible name in\n * every status, the source of the initials, and the seed of the colour.\n */\n readonly name = input<string | undefined>(undefined);\n /** The picture. Absent, the avatar is its fallback and nothing is requested. */\n readonly src = input<string | undefined>(undefined);\n /**\n * The letters to draw, in place of the ones derived from the name. Two\n * graphemes at most is what the box holds; `xs` draws one.\n */\n readonly initialsOverride = input<string | undefined>(undefined, { alias: 'initials' });\n /**\n * A stable identifier to derive the colour from, when the name is not stable\n * or two people share one. Defaults to `name`.\n */\n readonly idFor = input<string | undefined>(undefined);\n /** BCP 47, for the case of the initials. Defaults to the provider, then to the runtime. */\n readonly locale = input<string | undefined>(undefined);\n /** Defaults to the provider, then to `md`. */\n readonly size = input<AvatarSize | undefined>(undefined);\n /** Defaults to the provider, then to `circle`. */\n readonly shape = input<AvatarShape | undefined>(undefined);\n /** Defaults to the provider, then to `auto`, which derives it from the name. */\n readonly tone = input<AvatarTone | undefined>(undefined);\n /** Defaults to the provider, then to `soft`. */\n readonly variant = input<AvatarVariant | undefined>(undefined);\n /** The ground behind the avatar; `tone` by default. */\n readonly surface = input<AvatarSurface>('tone');\n /** A deactivated account, or an avatar inside a control the page has turned off. */\n readonly disabled = input(false, { transform: booleanAttribute });\n /**\n * Takes the avatar out of the accessibility tree. For an avatar beside the\n * name it belongs to, where announcing it would read the person twice.\n */\n readonly decorative = input(false, { transform: booleanAttribute });\n /**\n * Where the picture is. Supplied, it wins over what the component derives\n * from the element — for a server that already knows, or a loader the family\n * cannot see.\n */\n readonly status = input<AvatarStatus | undefined>(undefined);\n\n /** Reports the derived status. Never emits for a status passed in. */\n readonly statusChange = output<AvatarStatus>();\n\n private readonly defaults = injectAvatarDefaults();\n /** An explicit role the consumer wrote is never replaced by an inferred one. */\n private readonly writtenRole = inject(new HostAttributeToken('role'), { optional: true });\n\n protected readonly custom = contentChild(SlAvatarFallback);\n private readonly projected = contentChild(SlAvatarImage);\n\n protected readonly resolvedSize = computed(() => this.size() ?? this.defaults.size);\n protected readonly resolvedShape = computed(() => this.shape() ?? this.defaults.shape);\n protected readonly resolvedVariant = computed(() => this.variant() ?? this.defaults.variant);\n private readonly resolvedLocale = computed(() => this.locale() ?? this.defaults.locale);\n\n /**\n * The derivation, and the picture it belongs to. A new request makes the\n * previous answer describe nothing, so the status starts again from what the\n * props alone can say — which is also what a server render and the hydration\n * after it both compute, so nothing flashes between them.\n */\n private readonly derived = linkedSignal<string, AvatarStatus>({\n source: () => `${this.src() ?? ''}|${this.projected() === undefined ? '' : 'projected'}`,\n computation: (request) => (request === '|' ? 'idle' : 'loading'),\n });\n\n protected readonly resolvedStatus = computed(() => this.status() ?? this.derived());\n\n protected readonly resolvedTone = computed<AvatarResolvedTone>(() => {\n const tone = this.tone() ?? this.defaults.tone;\n if (tone !== 'auto') return tone;\n return toneFrom({ seed: this.idFor() ?? this.name(), tones: AUTO_TONES }) ?? 'secondary';\n });\n\n protected readonly initials = computed(\n () =>\n this.initialsOverride() ??\n initialsFrom({\n name: this.name(),\n max: INITIALS_MAX[this.resolvedSize()],\n locale: this.resolvedLocale(),\n }),\n );\n\n /**\n * The W3C `alt` decision tree, in this library's vocabulary and with the rule\n * `icon` already took: a name present decides `role=\"img\"`, an absent one\n * decides `aria-hidden`. `decorative` is the third case — a name that is\n * written beside the avatar, where announcing it reads the person twice.\n */\n private readonly silent = computed(() => {\n const name = this.name();\n return this.decorative() || name === undefined || name.trim() === '';\n });\n\n protected readonly role = computed(() => this.writtenRole ?? (this.silent() ? null : 'img'));\n protected readonly ariaLabel = computed(() => (this.silent() ? null : (this.name() ?? null)));\n protected readonly ariaHidden = computed(() => (this.silent() ? 'true' : null));\n\n /** Called by the picture, whichever of the two elements it turned out to be. */\n reportStatus(status: AvatarStatus) {\n this.derived.set(status);\n this.status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EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,YAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,QAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,cAAA,CAAA,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,YAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,UAAA,CAAA,MAAA,gBAAgB,2FACf,aAAa,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;ACrLzD;;AAEG;;"}
|
|
1
|
+
{"version":3,"file":"slotted-angular-avatar.mjs","sources":["../../avatar/src/avatar-defaults.ts","../../avatar/src/avatar-fallback.ts","../../avatar/src/avatar-image-host.ts","../../avatar/src/avatar-image.ts","../../avatar/src/avatar.ts","../../avatar/src/slotted-angular-avatar.ts"],"sourcesContent":["import { inject, InjectionToken } from '@angular/core';\n\n/**\n * Which of the five semantic colors the fallback is painted in. `auto` derives\n * it from the name, so the same person keeps the same color in a list that is\n * re-sorted and in a table that is paged.\n */\nexport type AvatarTone =\n 'auto' | 'accent' | 'secondary' | 'info' | 'success' | 'warning' | 'danger';\n\n/** The palette `auto` chooses from, in the order the hash indexes it. */\nexport type AvatarResolvedTone = Exclude<AvatarTone, 'auto'>;\n\n/** How that color is painted. `soft` is the tinted disc an avatar usually is. */\nexport type AvatarVariant = 'soft' | 'solid';\n/**\n * The ground behind the avatar. `tone` paints the tone behind the fallback and\n * nothing behind a loaded picture; `none` paints nothing; `plate` paints a\n * light plate in every scheme, for a logo designed for a white ground.\n */\nexport type AvatarSurface = 'tone' | 'none' | 'plate';\n\nexport type AvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n\n/** A circle is a person; a square is a team, an organization or a bot. */\nexport type AvatarShape = 'circle' | 'square';\n\n/** Where the picture is. Four values, because a boolean cannot say why there is none. */\nexport type AvatarStatus = 'idle' | 'loading' | 'loaded' | 'error';\n\nexport type AvatarGroupLayout = 'stack' | 'spread';\n\nexport interface AvatarDefaults {\n /** BCP 47. Used to case the initials, and by the group to join names. */\n locale: string | undefined;\n shape: AvatarShape;\n size: AvatarSize;\n tone: AvatarTone;\n variant: AvatarVariant;\n}\n\nconst FALLBACK: AvatarDefaults = {\n locale: undefined,\n shape: 'circle',\n size: 'md',\n tone: 'auto',\n variant: 'soft',\n};\n\nexport const AVATAR_DEFAULTS = new InjectionToken<AvatarDefaults>('slotted avatar defaults', {\n providedIn: 'root',\n factory: () => FALLBACK,\n});\n\n/**\n * An application decides once how its avatars are shaped, how large they are,\n * how they are painted and — the one that matters most — which locale cases\n * their initials, rather than repeating four inputs on every avatar. An avatar\n * that states any of them itself still wins: an explicit input is never\n * overridden by the token.\n *\n * `SlAvatarGroup` provides the same token rather than a channel of its own,\n * which is what keeps a member's explicit `size` winning over the group's.\n */\nexport function provideAvatarDefaults(defaults: Partial<AvatarDefaults>) {\n return {\n provide: AVATAR_DEFAULTS,\n useFactory: (): AvatarDefaults => ({\n locale: defaults.locale ?? FALLBACK.locale,\n shape: defaults.shape ?? FALLBACK.shape,\n size: defaults.size ?? FALLBACK.size,\n tone: defaults.tone ?? FALLBACK.tone,\n variant: defaults.variant ?? FALLBACK.variant,\n }),\n };\n}\n\n/** What an avatar renders as here, before it states anything of its own. */\nexport function injectAvatarDefaults(): AvatarDefaults {\n return inject(AVATAR_DEFAULTS);\n}\n","import { Directive } from '@angular/core';\n\n/**\n * Content that stands in for the picture, in place of the initials and the\n * glyph: a company mark, a product logo, an `sl-icon`.\n *\n * It is a marker rather than a bare `<ng-content>` because Angular cannot ask\n * whether anything was projected, and an avatar that wrote its initials\n * *and* the consumer's logo into the same disc would be drawing two fallbacks.\n * React answers the same question by looking at `children`.\n */\n@Directive({\n selector: '[slAvatarFallback]',\n standalone: true,\n exportAs: 'slAvatarFallback',\n})\nexport class SlAvatarFallback {}\n","import { InjectionToken } from '@angular/core';\n\nimport type { AvatarStatus } from './avatar-defaults';\n\n/**\n * What the picture tells the avatar it sits in.\n *\n * It is a token rather than the component's own class so that one directive can\n * serve both pictures the family knows about: the `<img>` the avatar renders\n * for its own `src`, and the `<img>` the consumer projects — which is the one\n * that carries `ngSrc`, and therefore the one `NgOptimizedImage` can reach. A\n * directive that injected the component directly would put a cycle between the\n * two files, and the component imports the directive for its own template.\n */\nexport interface AvatarImageHost {\n reportStatus(status: AvatarStatus): void;\n}\n\nexport const AVATAR_IMAGE_HOST = new InjectionToken<AvatarImageHost>('slotted avatar image host');\n","import { afterNextRender, Directive, ElementRef, HostAttributeToken, inject } from '@angular/core';\n\nimport { AVATAR_IMAGE_HOST } from './avatar-image-host';\n\n/**\n * The picture inside an avatar.\n *\n * It is written on an `<img>` the consumer owns, which is what lets\n * `NgOptimizedImage` do its work: `ngSrc`, the priority hint, the generated\n * `srcset` and the size warnings all belong to a real `<img>` in the\n * consumer's template, and none of them survive being handed a `src` string\n * through an input. React has no equivalent, and its `renderImage` is the other\n * half of the same idea.\n *\n * `alt` is written empty only when the consumer wrote none: the avatar's name\n * is on the root, so naming the picture as well would read the person twice —\n * and would name them differently before the picture arrives.\n */\n@Directive({\n selector: 'img[slAvatarImage]',\n standalone: true,\n exportAs: 'slAvatarImage',\n host: {\n 'data-part': 'image',\n 'data-part-image': '',\n '[attr.alt]': 'alt',\n '(load)': 'avatar.reportStatus(\"loaded\")',\n '(error)': 'avatar.reportStatus(\"error\")',\n },\n})\nexport class SlAvatarImage {\n protected readonly avatar = inject(AVATAR_IMAGE_HOST);\n\n /** A static `alt` the consumer wrote is read before the host binding writes one. */\n protected readonly alt = inject(new HostAttributeToken('alt'), { optional: true }) ?? '';\n\n private readonly element = inject<ElementRef<HTMLImageElement>>(ElementRef).nativeElement;\n\n constructor() {\n /**\n * A picture already in the browser cache finishes decoding before the\n * listener is attached, so the element is asked whether it is already\n * complete rather than waited on for an event that has been and gone.\n * Without it an avatar shows initials over a picture that is already there.\n */\n afterNextRender(() => {\n if (this.element.complete && this.element.naturalWidth > 0) {\n this.avatar.reportStatus('loaded');\n }\n });\n }\n}\n","import {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChild,\n forwardRef,\n HostAttributeToken,\n inject,\n input,\n linkedSignal,\n output,\n ViewEncapsulation,\n} from '@angular/core';\nimport { SlGlyph, SlIcon } from '@slotted/angular/icon';\n\nimport { initialsFrom, toneFrom } from '@slotted/core/identity';\n\nimport {\n injectAvatarDefaults,\n type AvatarResolvedTone,\n type AvatarShape,\n type AvatarSize,\n type AvatarStatus,\n type AvatarTone,\n type AvatarSurface,\n type AvatarVariant,\n} from './avatar-defaults';\nimport { SlAvatarFallback } from './avatar-fallback';\nimport { AVATAR_IMAGE_HOST } from './avatar-image-host';\nimport { SlAvatarImage } from './avatar-image';\n\nexport type {\n AvatarDefaults,\n AvatarGroupLayout,\n AvatarResolvedTone,\n AvatarShape,\n AvatarSize,\n AvatarStatus,\n AvatarTone,\n AvatarSurface,\n AvatarVariant,\n} from './avatar-defaults';\n\n/**\n * The palette `tone=\"auto\"` chooses from, in the order the hash indexes it.\n * Five is a small palette and collisions are frequent by construction: the\n * color is an aid to scanning a list of faces, and the name is what identifies\n * the person — which is why it is on the root in every one of the four\n * statuses.\n */\nconst AUTO_TONES: readonly AvatarResolvedTone[] = [\n 'accent',\n 'secondary',\n 'success',\n 'warning',\n 'danger',\n];\n\n/** At the smallest step there is room for one letter, which is Fluent's rule at 16 pixels. */\nconst INITIALS_MAX: Record<AvatarSize, number> = { xs: 1, sm: 2, md: 2, lg: 2, xl: 2 };\n\n/**\n * A picture of a person or an entity, and what stands in when there is none:\n * the initials taken from the name, then a glyph the family owns. A request\n * that fails never paints the browser's torn-page mark, because the picture is\n * out of sight until it reports that it arrived.\n *\n * The component is written on the element the page chose, so a `span` in a\n * table cell, an `a` that opens a profile and a `button` that opens a menu are\n * all the same avatar.\n *\n * The name lives on the root and the picture takes an empty `alt`, so the\n * avatar announces the same thing before and after the photograph loads. Every\n * surveyed implementation names the image instead, which makes the same avatar\n * “Ada Lovelace” once the picture arrives and “AL” before it.\n *\n * `status` is an input with an output beside it rather than a `model()`. A\n * `model()` promises a two-way binding for a value the browser owns: the\n * component would write over whatever the consumer passed the first time an\n * image loaded. Here the consumer's value simply wins, and the output reports\n * the derivation — a load event is a fact rather than a request, so there is\n * nothing to cancel and no reason from the closed vocabulary that fits it.\n */\n@Component({\n selector: '[slAvatar]',\n standalone: true,\n exportAs: 'slAvatar',\n imports: [SlAvatarImage, SlGlyph, SlIcon],\n providers: [\n /* The component is its own image host, and a decorator is evaluated before\n the class it decorates exists. */\n { provide: AVATAR_IMAGE_HOST, useExisting: forwardRef(() => SlAvatar) },\n ],\n template: `@if (src(); as source) {\n <img slAvatarImage [src]=\"source\" />\n }\n <ng-content select=\"img\"></ng-content\n ><span data-part=\"fallback\" data-part-fallback=\"\">\n @if (custom() === undefined) {\n <!-- No picture and no name to take initials from: the person glyph. -->\n @if (initials() === '') {\n <span slIcon><svg slGlyph name=\"person\"></svg></span>\n } @else {\n {{ initials() }}\n }\n }\n <ng-content select=\"[slAvatarFallback]\"></ng-content\n ></span>`,\n styleUrl: '../../../styles/src/avatar/avatar.css',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n 'data-ui': 'avatar',\n 'data-ui-avatar': '',\n 'data-part': 'root',\n 'data-part-root': '',\n '[attr.data-size]': 'resolvedSize()',\n '[attr.data-shape]': 'resolvedShape()',\n '[attr.data-tone]': 'resolvedTone()',\n '[attr.data-variant]': 'resolvedVariant()',\n '[attr.data-surface]': 'surface()',\n '[attr.data-status]': 'resolvedStatus()',\n '[attr.data-disabled]': \"disabled() ? '' : null\",\n '[attr.role]': 'role()',\n '[attr.aria-label]': 'ariaLabel()',\n '[attr.aria-hidden]': 'ariaHidden()',\n },\n})\nexport class SlAvatar {\n /**\n * The person or entity this is a picture of. It is the accessible name in\n * every status, the source of the initials, and the seed of the color.\n */\n readonly name = input<string | undefined>(undefined);\n /** The picture. Absent, the avatar is its fallback and nothing is requested. */\n readonly src = input<string | undefined>(undefined);\n /**\n * The letters to draw, in place of the ones derived from the name. Two\n * graphemes at most is what the box holds; `xs` draws one.\n */\n readonly initialsOverride = input<string | undefined>(undefined, { alias: 'initials' });\n /**\n * A stable identifier to derive the color from, when the name is not stable\n * or two people share one. Defaults to `name`.\n */\n readonly idFor = input<string | undefined>(undefined);\n /** BCP 47, for the case of the initials. Defaults to the provider, then to the runtime. */\n readonly locale = input<string | undefined>(undefined);\n /** Defaults to the provider, then to `md`. */\n readonly size = input<AvatarSize | undefined>(undefined);\n /** Defaults to the provider, then to `circle`. */\n readonly shape = input<AvatarShape | undefined>(undefined);\n /** Defaults to the provider, then to `auto`, which derives it from the name. */\n readonly tone = input<AvatarTone | undefined>(undefined);\n /** Defaults to the provider, then to `soft`. */\n readonly variant = input<AvatarVariant | undefined>(undefined);\n /** The ground behind the avatar; `tone` by default. */\n readonly surface = input<AvatarSurface>('tone');\n /** A deactivated account, or an avatar inside a control the page has turned off. */\n readonly disabled = input(false, { transform: booleanAttribute });\n /**\n * Takes the avatar out of the accessibility tree. For an avatar beside the\n * name it belongs to, where announcing it would read the person twice.\n */\n readonly decorative = input(false, { transform: booleanAttribute });\n /**\n * Where the picture is. Supplied, it wins over what the component derives\n * from the element — for a server that already knows, or a loader the family\n * cannot see.\n */\n readonly status = input<AvatarStatus | undefined>(undefined);\n\n /** Reports the derived status. Never emits for a status passed in. */\n readonly statusChange = output<AvatarStatus>();\n\n private readonly defaults = injectAvatarDefaults();\n /** An explicit role the consumer wrote is never replaced by an inferred one. */\n private readonly writtenRole = inject(new HostAttributeToken('role'), { optional: true });\n\n protected readonly custom = contentChild(SlAvatarFallback);\n private readonly projected = contentChild(SlAvatarImage);\n\n protected readonly resolvedSize = computed(() => this.size() ?? this.defaults.size);\n protected readonly resolvedShape = computed(() => this.shape() ?? this.defaults.shape);\n protected readonly resolvedVariant = computed(() => this.variant() ?? this.defaults.variant);\n private readonly resolvedLocale = computed(() => this.locale() ?? this.defaults.locale);\n\n /**\n * The derivation, and the picture it belongs to. A new request makes the\n * previous answer describe nothing, so the status starts again from what the\n * props alone can say — which is also what a server render and the hydration\n * after it both compute, so nothing flashes between them.\n */\n private readonly derived = linkedSignal<string, AvatarStatus>({\n source: () => `${this.src() ?? ''}|${this.projected() === undefined ? '' : 'projected'}`,\n computation: (request) => (request === '|' ? 'idle' : 'loading'),\n });\n\n protected readonly resolvedStatus = computed(() => this.status() ?? this.derived());\n\n protected readonly resolvedTone = computed<AvatarResolvedTone>(() => {\n const tone = this.tone() ?? this.defaults.tone;\n if (tone !== 'auto') return tone;\n return toneFrom({ seed: this.idFor() ?? this.name(), tones: AUTO_TONES }) ?? 'secondary';\n });\n\n protected readonly initials = computed(\n () =>\n this.initialsOverride() ??\n initialsFrom({\n name: this.name(),\n max: INITIALS_MAX[this.resolvedSize()],\n locale: this.resolvedLocale(),\n }),\n );\n\n /**\n * The W3C `alt` decision tree, in this library's vocabulary and with the rule\n * `icon` already took: a name present decides `role=\"img\"`, an absent one\n * decides `aria-hidden`. `decorative` is the third case — a name that is\n * written beside the avatar, where announcing it reads the person twice.\n */\n private readonly silent = computed(() => {\n const name = this.name();\n return this.decorative() || name === undefined || name.trim() === '';\n });\n\n protected readonly role = computed(() => this.writtenRole ?? (this.silent() ? null : 'img'));\n protected readonly ariaLabel = computed(() => (this.silent() ? null : (this.name() ?? null)));\n protected readonly ariaHidden = computed(() => (this.silent() ? 'true' : null));\n\n /** Called by the picture, whichever of the two elements it turned out to be. */\n reportStatus(status: AvatarStatus) {\n this.derived.set(status);\n this.statusChange.emit(status);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAyCA,MAAM,QAAQ,GAAmB;AAC/B,IAAA,MAAM,EAAE,SAAS;AACjB,IAAA,KAAK,EAAE,QAAQ;AACf,IAAA,IAAI,EAAE,IAAI;AACV,IAAA,IAAI,EAAE,MAAM;AACZ,IAAA,OAAO,EAAE,MAAM;CAChB;MAEY,eAAe,GAAG,IAAI,cAAc,CAAiB,yBAAyB,EAAE;AAC3F,IAAA,UAAU,EAAE,MAAM;AAClB,IAAA,OAAO,EAAE,MAAM,QAAQ;AACxB,CAAA;AAED;;;;;;;;;AASG;AACG,SAAU,qBAAqB,CAAC,QAAiC,EAAA;IACrE,OAAO;AACL,QAAA,OAAO,EAAE,eAAe;AACxB,QAAA,UAAU,EAAE,OAAuB;AACjC,YAAA,MAAM,EAAE,QAAQ,CAAC,MAAM,IAAI,QAAQ,CAAC,MAAM;AAC1C,YAAA,KAAK,EAAE,QAAQ,CAAC,KAAK,IAAI,QAAQ,CAAC,KAAK;AACvC,YAAA,IAAI,EAAE,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,IAAI;AACpC,YAAA,IAAI,EAAE,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,IAAI;AACpC,YAAA,OAAO,EAAE,QAAQ,CAAC,OAAO,IAAI,QAAQ,CAAC,OAAO;SAC9C,CAAC;KACH;AACH;AAEA;SACgB,oBAAoB,GAAA;AAClC,IAAA,OAAO,MAAM,CAAC,eAAe,CAAC;AAChC;;AC9EA;;;;;;;;AAQG;MAMU,gBAAgB,CAAA;uGAAhB,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAhB,gBAAgB,EAAA,YAAA,EAA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AA,UAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,UAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,YAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,QAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,cAAA,CAAA,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,YAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,UAAA,CAAA,MAAA,gBAAgB,2FACf,aAAa,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;ACrLzD;;AAEG;;"}
|
|
@@ -220,7 +220,7 @@ function length(value) {
|
|
|
220
220
|
|
|
221
221
|
/**
|
|
222
222
|
* A glyph before the words. The artwork is the consumer's, and the part gives
|
|
223
|
-
* it a box that is sized and
|
|
223
|
+
* it a box that is sized and centerd; the directive is written on the element
|
|
224
224
|
* the page already has, so nothing is wrapped.
|
|
225
225
|
*/
|
|
226
226
|
class SlBadgeStart {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slotted-angular-badge.mjs","sources":["../../badge/src/badge-defaults.ts","../../badge/src/badge.ts","../../badge/src/badge-anchor.ts","../../badge/src/badge-content.ts","../../badge/src/slotted-angular-badge.ts"],"sourcesContent":["import { inject, InjectionToken } from '@angular/core';\n\n/** Which of the five semantic colours the badge speaks in. */\nexport type BadgeTone = 'accent' | 'secondary' | 'info' | 'success' | 'warning' | 'danger';\n\n/** How that colour is painted. `soft` is the tinted chip a badge usually is. */\nexport type BadgeVariant = 'solid' | 'soft' | 'outline';\n\nexport type BadgeSize = 'sm' | 'md' | 'lg';\n\n/** `dot` is the same badge, tone and hidden text, drawn without a value. */\nexport type BadgeShape = 'pill' | 'square' | 'dot';\n\n/** Whether a changing badge is announced, and how urgently. */\nexport type BadgeLive = 'off' | 'polite' | 'assertive';\n\nexport type BadgePlacement = 'top-end' | 'top-start' | 'bottom-end' | 'bottom-start';\n\n/** The shape of the host, which decides how far in from the corner to sit. */\nexport type BadgeOverlap = 'rectangle' | 'circle';\n\n/**\n * The page's own correction of the corner, in CSS pixels.\n *\n * `x` runs along the inline axis, from the leading edge towards the trailing\n * one, so it mirrors with the document: a badge moved two pixels back along it\n * keeps the same relation to its host in a right-to-left page. `y` runs down\n * the block axis. Both default to nought.\n */\nexport interface BadgeOffset {\n x?: number | undefined;\n y?: number | undefined;\n}\n\nexport interface BadgeDefaults {\n /** BCP 47. Absent, the runtime's own default writes the digits. */\n locale: string | undefined;\n max: number | false;\n shape: BadgeShape;\n size: BadgeSize;\n tone: BadgeTone;\n variant: BadgeVariant;\n}\n\nconst FALLBACK: BadgeDefaults = {\n locale: undefined,\n max: 99,\n shape: 'pill',\n size: 'md',\n tone: 'secondary',\n variant: 'soft',\n};\n\nexport const BADGE_DEFAULTS = new InjectionToken<BadgeDefaults>('slotted badge defaults', {\n providedIn: 'root',\n factory: () => FALLBACK,\n});\n\n/**\n * An application decides once how its badges are painted, how large they are\n * and — the one that matters most — which locale writes their digits, rather\n * than repeating five inputs on every badge. A badge that states any of them\n * itself still wins: an explicit input is never overridden by the token.\n */\nexport function provideBadgeDefaults(defaults: Partial<BadgeDefaults>) {\n return {\n provide: BADGE_DEFAULTS,\n useFactory: (): BadgeDefaults => ({\n locale: defaults.locale ?? FALLBACK.locale,\n max: defaults.max ?? FALLBACK.max,\n shape: defaults.shape ?? FALLBACK.shape,\n size: defaults.size ?? FALLBACK.size,\n tone: defaults.tone ?? FALLBACK.tone,\n variant: defaults.variant ?? FALLBACK.variant,\n }),\n };\n}\n\n/** What a badge renders as here, before it states anything of its own. */\nexport function injectBadgeDefaults(): BadgeDefaults {\n return inject(BADGE_DEFAULTS);\n}\n","import {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n HostAttributeToken,\n inject,\n input,\n ViewEncapsulation,\n} from '@angular/core';\n\nimport { formatCount } from '@slotted/core/count';\n\nimport { injectBadgeDefaults } from './badge-defaults';\nimport type { BadgeLive, BadgeShape, BadgeSize, BadgeTone, BadgeVariant } from './badge-defaults';\n\nexport type {\n BadgeLive,\n BadgeOverlap,\n BadgePlacement,\n BadgeShape,\n BadgeSize,\n BadgeTone,\n BadgeVariant,\n} from './badge-defaults';\n\nconst ROLE: Record<BadgeLive, string | null> = { off: null, polite: 'status', assertive: 'alert' };\n\n/**\n * A short, non-editable piece of metadata: a count, a status, a label. It is\n * never a command — it answers no hover and gives no press feedback — and it\n * carries no role of its own, because what a badge means comes from where it\n * sits.\n *\n * The directive is written on the element the page chose, so a `span` in a\n * sentence, a `dd` in a description list and an `a` that navigates are all the\n * same badge.\n *\n * `count` is the one place the family does work rather than paint. The ceiling\n * above which a count becomes `99+`, whether nought is a value or an absence,\n * and which locale writes the digits are three decisions every consumer would\n * otherwise take again, and `@slotted/core/count` is where both bindings take\n * them once.\n */\n@Component({\n selector: '[slBadge]',\n standalone: true,\n exportAs: 'slBadge',\n /**\n * The text has a box of its own so `text-box` can trim its line to the cap\n * and the baseline: a flex container's own text lives in an anonymous item no\n * stylesheet can reach. The glyphs are projected by selector, so they stay\n * siblings of that box rather than joining the line inside it.\n */\n template: `<ng-content select=\"[slBadgeStart]\"></ng-content\n ><span data-part=\"label\" data-part-label=\"\">{{ value() }}<ng-content></ng-content></span\n ><ng-content select=\"[slBadgeEnd]\"></ng-content>`,\n styleUrl: '../../../styles/src/badge/badge.css',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n 'data-ui': 'badge',\n 'data-ui-badge': '',\n 'data-part': 'root',\n 'data-part-root': '',\n '[attr.data-tone]': 'resolvedTone()',\n '[attr.data-variant]': 'resolvedVariant()',\n '[attr.data-size]': 'resolvedSize()',\n '[attr.data-shape]': 'resolvedShape()',\n '[attr.role]': 'role()',\n /**\n * React returns nothing for a count that has fallen to nought. This\n * directive is written on an element the consumer owns, so it cannot\n * un-write it; `display: none` is the same outcome the platform can give\n * from here — no box, no layout, and nothing in the accessibility tree.\n * The inline style is what beats the family's own `display: inline-flex`,\n * which the `hidden` attribute would lose to.\n */\n '[style.display]': \"empty() ? 'none' : null\",\n },\n})\nexport class SlBadge {\n /** Defaults to the provider, then to `secondary`. */\n readonly tone = input<BadgeTone>();\n /** Defaults to the provider, then to `soft`. */\n readonly variant = input<BadgeVariant>();\n /** Defaults to the provider, then to `md`. */\n readonly size = input<BadgeSize>();\n /** `dot` draws no value; the words it cannot say are projected content. */\n readonly shape = input<BadgeShape>();\n /**\n * Whether a change to this badge is announced, and how urgently. `off` by\n * default: a page of twenty badges that all announce is a page no screen\n * reader user can read.\n */\n readonly live = input<BadgeLive>('off');\n /** The number the badge shows, written before any projected content. */\n readonly count = input<number | undefined>(undefined);\n /**\n * The largest count written in full; above it the badge shows the ceiling and\n * a `+`. `false` removes the ceiling. Defaults to the provider, then to `99`.\n */\n readonly max = input<number | false | undefined>(undefined);\n /** Whether a count of nought is a value worth showing or an absence worth hiding. */\n readonly showZero = input(false, { transform: booleanAttribute });\n /** BCP 47, for the digits of `count`. Defaults to the provider, then to the runtime. */\n readonly locale = input<string | undefined>(undefined);\n\n private readonly defaults = injectBadgeDefaults();\n /** An explicit role the consumer wrote is never replaced by an inferred one. */\n private readonly writtenRole = inject(new HostAttributeToken('role'), { optional: true });\n\n protected readonly resolvedTone = computed(() => this.tone() ?? this.defaults.tone);\n protected readonly resolvedVariant = computed(() => this.variant() ?? this.defaults.variant);\n protected readonly resolvedSize = computed(() => this.size() ?? this.defaults.size);\n protected readonly resolvedShape = computed(() => this.shape() ?? this.defaults.shape);\n\n protected readonly role = computed(() => this.writtenRole ?? ROLE[this.live()]);\n\n private readonly counted = computed(() => {\n const count = this.count();\n if (count === undefined) return undefined;\n return formatCount({\n count,\n max: this.max() ?? this.defaults.max,\n showZero: this.showZero(),\n locale: this.locale() ?? this.defaults.locale,\n });\n });\n\n /**\n * A count that has fallen to nought leaves the corner rather than sitting\n * there as a blank circle. A badge given no count at all is untouched by the\n * rule: an empty `dot` is the whole point of that shape.\n */\n protected readonly empty = computed(\n () => this.count() !== undefined && this.counted() === undefined,\n );\n\n /** A dot draws no value at any size. */\n protected readonly value = computed(() =>\n this.resolvedShape() === 'dot' ? '' : (this.counted() ?? ''),\n );\n}\n","import { computed, Directive, input } from '@angular/core';\n\nimport type { BadgeOffset, BadgeOverlap, BadgePlacement } from './badge-defaults';\n\n/**\n * The frame that places a badge on the corner of something else. It is written\n * on the element the page already has around the host — a `span`, a `div`, the\n * `li` of a list — rather than wrapping it, which is the one place this binding\n * is the smaller of the two: React must render a wrapper of its own.\n *\n * It does not rewrite the host's semantics. The badge is read after the host in\n * document order, and an interactive host whose name must carry the count wires\n * `aria-describedby` to the badge's own id, or names the count in its own\n * `aria-label`. Both wirings are on the reference page.\n */\n@Directive({\n selector: '[slBadgeAnchor]',\n standalone: true,\n exportAs: 'slBadgeAnchor',\n host: {\n 'data-ui': 'badge',\n 'data-ui-badge': '',\n 'data-part': 'anchor',\n 'data-part-anchor': '',\n '[attr.data-placement]': 'resolvedPlacement()',\n '[attr.data-overlap]': 'resolvedOverlap()',\n '[style.--slotted-badge-anchor-offset-x]': 'offsetX()',\n '[style.--slotted-badge-anchor-offset-y]': 'offsetY()',\n },\n})\nexport class SlBadgeAnchor {\n /** Which corner of the host the badge sits on. Mirrors in a right-to-left document. */\n readonly placement = input<BadgePlacement>();\n /** `circle` moves the badge in from the corner far enough to meet the curve. */\n readonly overlap = input<BadgeOverlap>();\n /**\n * Moves the badge off the corner the frame computed, in pixels. `overlap` has\n * two values and hosts have many: how far a badge sits into one depends on\n * that host's own curve, shadow and optical weight.\n */\n readonly offset = input<BadgeOffset>();\n\n protected readonly resolvedPlacement = computed(() => this.placement() ?? 'top-end');\n protected readonly resolvedOverlap = computed(() => this.overlap() ?? 'rectangle');\n /**\n * An axis the page did not state is `null`, which removes the property rather\n * than writing nought into it: the sheet's own default is what answers, and a\n * theme that moves it still wins.\n */\n protected readonly offsetX = computed(() => length(this.offset()?.x));\n protected readonly offsetY = computed(() => length(this.offset()?.y));\n}\n\nfunction length(value: number | undefined): string | null {\n return value === undefined ? null : `${value}px`;\n}\n","import { Directive } from '@angular/core';\n\n/**\n * A glyph before the words. The artwork is the consumer's, and the part gives\n * it a box that is sized and centred; the directive is written on the element\n * the page already has, so nothing is wrapped.\n */\n@Directive({\n selector: '[slBadgeStart]',\n standalone: true,\n exportAs: 'slBadgeStart',\n host: { 'data-part': 'start', 'data-part-start': '' },\n})\nexport class SlBadgeStart {}\n\n/** A glyph after the words. */\n@Directive({\n selector: '[slBadgeEnd]',\n standalone: true,\n exportAs: 'slBadgeEnd',\n host: { 'data-part': 'end', 'data-part-end': '' },\n})\nexport class SlBadgeEnd {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AA4CA,MAAM,QAAQ,GAAkB;AAC9B,IAAA,MAAM,EAAE,SAAS;AACjB,IAAA,GAAG,EAAE,EAAE;AACP,IAAA,KAAK,EAAE,MAAM;AACb,IAAA,IAAI,EAAE,IAAI;AACV,IAAA,IAAI,EAAE,WAAW;AACjB,IAAA,OAAO,EAAE,MAAM;CAChB;MAEY,cAAc,GAAG,IAAI,cAAc,CAAgB,wBAAwB,EAAE;AACxF,IAAA,UAAU,EAAE,MAAM;AAClB,IAAA,OAAO,EAAE,MAAM,QAAQ;AACxB,CAAA;AAED;;;;;AA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EAAA,WAAA,EAAA,KAAA,EAAA,eAAA,EAAA,EAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,YAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAV,UAAU,EAAA,UAAA,EAAA,CAAA;kBANtB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,cAAc;AACxB,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,QAAQ,EAAE,YAAY;oBACtB,IAAI,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,eAAe,EAAE,EAAE,EAAE;AAClD,iBAAA;;;ACrBD;;AAEG;;"}
|
|
1
|
+
{"version":3,"file":"slotted-angular-badge.mjs","sources":["../../badge/src/badge-defaults.ts","../../badge/src/badge.ts","../../badge/src/badge-anchor.ts","../../badge/src/badge-content.ts","../../badge/src/slotted-angular-badge.ts"],"sourcesContent":["import { inject, InjectionToken } from '@angular/core';\n\n/** Which of the five semantic colors the badge speaks in. */\nexport type BadgeTone = 'accent' | 'secondary' | 'info' | 'success' | 'warning' | 'danger';\n\n/** How that color is painted. `soft` is the tinted chip a badge usually is. */\nexport type BadgeVariant = 'solid' | 'soft' | 'outline';\n\nexport type BadgeSize = 'sm' | 'md' | 'lg';\n\n/** `dot` is the same badge, tone and hidden text, drawn without a value. */\nexport type BadgeShape = 'pill' | 'square' | 'dot';\n\n/** Whether a changing badge is announced, and how urgently. */\nexport type BadgeLive = 'off' | 'polite' | 'assertive';\n\nexport type BadgePlacement = 'top-end' | 'top-start' | 'bottom-end' | 'bottom-start';\n\n/** The shape of the host, which decides how far in from the corner to sit. */\nexport type BadgeOverlap = 'rectangle' | 'circle';\n\n/**\n * The page's own correction of the corner, in CSS pixels.\n *\n * `x` runs along the inline axis, from the leading edge towards the trailing\n * one, so it mirrors with the document: a badge moved two pixels back along it\n * keeps the same relation to its host in a right-to-left page. `y` runs down\n * the block axis. Both default to nought.\n */\nexport interface BadgeOffset {\n x?: number | undefined;\n y?: number | undefined;\n}\n\nexport interface BadgeDefaults {\n /** BCP 47. Absent, the runtime's own default writes the digits. */\n locale: string | undefined;\n max: number | false;\n shape: BadgeShape;\n size: BadgeSize;\n tone: BadgeTone;\n variant: BadgeVariant;\n}\n\nconst FALLBACK: BadgeDefaults = {\n locale: undefined,\n max: 99,\n shape: 'pill',\n size: 'md',\n tone: 'secondary',\n variant: 'soft',\n};\n\nexport const BADGE_DEFAULTS = new InjectionToken<BadgeDefaults>('slotted badge defaults', {\n providedIn: 'root',\n factory: () => FALLBACK,\n});\n\n/**\n * An application decides once how its badges are painted, how large they are\n * and — the one that matters most — which locale writes their digits, rather\n * than repeating five inputs on every badge. A badge that states any of them\n * itself still wins: an explicit input is never overridden by the token.\n */\nexport function provideBadgeDefaults(defaults: Partial<BadgeDefaults>) {\n return {\n provide: BADGE_DEFAULTS,\n useFactory: (): BadgeDefaults => ({\n locale: defaults.locale ?? FALLBACK.locale,\n max: defaults.max ?? FALLBACK.max,\n shape: defaults.shape ?? FALLBACK.shape,\n size: defaults.size ?? FALLBACK.size,\n tone: defaults.tone ?? FALLBACK.tone,\n variant: defaults.variant ?? FALLBACK.variant,\n }),\n };\n}\n\n/** What a badge renders as here, before it states anything of its own. */\nexport function injectBadgeDefaults(): BadgeDefaults {\n return inject(BADGE_DEFAULTS);\n}\n","import {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n HostAttributeToken,\n inject,\n input,\n ViewEncapsulation,\n} from '@angular/core';\n\nimport { formatCount } from '@slotted/core/count';\n\nimport { injectBadgeDefaults } from './badge-defaults';\nimport type { BadgeLive, BadgeShape, BadgeSize, BadgeTone, BadgeVariant } from './badge-defaults';\n\nexport type {\n BadgeLive,\n BadgeOverlap,\n BadgePlacement,\n BadgeShape,\n BadgeSize,\n BadgeTone,\n BadgeVariant,\n} from './badge-defaults';\n\nconst ROLE: Record<BadgeLive, string | null> = { off: null, polite: 'status', assertive: 'alert' };\n\n/**\n * A short, non-editable piece of metadata: a count, a status, a label. It is\n * never a command — it answers no hover and gives no press feedback — and it\n * carries no role of its own, because what a badge means comes from where it\n * sits.\n *\n * The directive is written on the element the page chose, so a `span` in a\n * sentence, a `dd` in a description list and an `a` that navigates are all the\n * same badge.\n *\n * `count` is the one place the family does work rather than paint. The ceiling\n * above which a count becomes `99+`, whether nought is a value or an absence,\n * and which locale writes the digits are three decisions every consumer would\n * otherwise take again, and `@slotted/core/count` is where both bindings take\n * them once.\n */\n@Component({\n selector: '[slBadge]',\n standalone: true,\n exportAs: 'slBadge',\n /**\n * The text has a box of its own so `text-box` can trim its line to the cap\n * and the baseline: a flex container's own text lives in an anonymous item no\n * stylesheet can reach. The glyphs are projected by selector, so they stay\n * siblings of that box rather than joining the line inside it.\n */\n template: `<ng-content select=\"[slBadgeStart]\"></ng-content\n ><span data-part=\"label\" data-part-label=\"\">{{ value() }}<ng-content></ng-content></span\n ><ng-content select=\"[slBadgeEnd]\"></ng-content>`,\n styleUrl: '../../../styles/src/badge/badge.css',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n 'data-ui': 'badge',\n 'data-ui-badge': '',\n 'data-part': 'root',\n 'data-part-root': '',\n '[attr.data-tone]': 'resolvedTone()',\n '[attr.data-variant]': 'resolvedVariant()',\n '[attr.data-size]': 'resolvedSize()',\n '[attr.data-shape]': 'resolvedShape()',\n '[attr.role]': 'role()',\n /**\n * React returns nothing for a count that has fallen to nought. This\n * directive is written on an element the consumer owns, so it cannot\n * un-write it; `display: none` is the same outcome the platform can give\n * from here — no box, no layout, and nothing in the accessibility tree.\n * The inline style is what beats the family's own `display: inline-flex`,\n * which the `hidden` attribute would lose to.\n */\n '[style.display]': \"empty() ? 'none' : null\",\n },\n})\nexport class SlBadge {\n /** Defaults to the provider, then to `secondary`. */\n readonly tone = input<BadgeTone>();\n /** Defaults to the provider, then to `soft`. */\n readonly variant = input<BadgeVariant>();\n /** Defaults to the provider, then to `md`. */\n readonly size = input<BadgeSize>();\n /** `dot` draws no value; the words it cannot say are projected content. */\n readonly shape = input<BadgeShape>();\n /**\n * Whether a change to this badge is announced, and how urgently. `off` by\n * default: a page of twenty badges that all announce is a page no screen\n * reader user can read.\n */\n readonly live = input<BadgeLive>('off');\n /** The number the badge shows, written before any projected content. */\n readonly count = input<number | undefined>(undefined);\n /**\n * The largest count written in full; above it the badge shows the ceiling and\n * a `+`. `false` removes the ceiling. Defaults to the provider, then to `99`.\n */\n readonly max = input<number | false | undefined>(undefined);\n /** Whether a count of nought is a value worth showing or an absence worth hiding. */\n readonly showZero = input(false, { transform: booleanAttribute });\n /** BCP 47, for the digits of `count`. Defaults to the provider, then to the runtime. */\n readonly locale = input<string | undefined>(undefined);\n\n private readonly defaults = injectBadgeDefaults();\n /** An explicit role the consumer wrote is never replaced by an inferred one. */\n private readonly writtenRole = inject(new HostAttributeToken('role'), { optional: true });\n\n protected readonly resolvedTone = computed(() => this.tone() ?? this.defaults.tone);\n protected readonly resolvedVariant = computed(() => this.variant() ?? this.defaults.variant);\n protected readonly resolvedSize = computed(() => this.size() ?? this.defaults.size);\n protected readonly resolvedShape = computed(() => this.shape() ?? this.defaults.shape);\n\n protected readonly role = computed(() => this.writtenRole ?? ROLE[this.live()]);\n\n private readonly counted = computed(() => {\n const count = this.count();\n if (count === undefined) return undefined;\n return formatCount({\n count,\n max: this.max() ?? this.defaults.max,\n showZero: this.showZero(),\n locale: this.locale() ?? this.defaults.locale,\n });\n });\n\n /**\n * A count that has fallen to nought leaves the corner rather than sitting\n * there as a blank circle. A badge given no count at all is untouched by the\n * rule: an empty `dot` is the whole point of that shape.\n */\n protected readonly empty = computed(\n () => this.count() !== undefined && this.counted() === undefined,\n );\n\n /** A dot draws no value at any size. */\n protected readonly value = computed(() =>\n this.resolvedShape() === 'dot' ? '' : (this.counted() ?? ''),\n );\n}\n","import { computed, Directive, input } from '@angular/core';\n\nimport type { BadgeOffset, BadgeOverlap, BadgePlacement } from './badge-defaults';\n\n/**\n * The frame that places a badge on the corner of something else. It is written\n * on the element the page already has around the host — a `span`, a `div`, the\n * `li` of a list — rather than wrapping it, which is the one place this binding\n * is the smaller of the two: React must render a wrapper of its own.\n *\n * It does not rewrite the host's semantics. The badge is read after the host in\n * document order, and an interactive host whose name must carry the count wires\n * `aria-describedby` to the badge's own id, or names the count in its own\n * `aria-label`. Both wirings are on the reference page.\n */\n@Directive({\n selector: '[slBadgeAnchor]',\n standalone: true,\n exportAs: 'slBadgeAnchor',\n host: {\n 'data-ui': 'badge',\n 'data-ui-badge': '',\n 'data-part': 'anchor',\n 'data-part-anchor': '',\n '[attr.data-placement]': 'resolvedPlacement()',\n '[attr.data-overlap]': 'resolvedOverlap()',\n '[style.--slotted-badge-anchor-offset-x]': 'offsetX()',\n '[style.--slotted-badge-anchor-offset-y]': 'offsetY()',\n },\n})\nexport class SlBadgeAnchor {\n /** Which corner of the host the badge sits on. Mirrors in a right-to-left document. */\n readonly placement = input<BadgePlacement>();\n /** `circle` moves the badge in from the corner far enough to meet the curve. */\n readonly overlap = input<BadgeOverlap>();\n /**\n * Moves the badge off the corner the frame computed, in pixels. `overlap` has\n * two values and hosts have many: how far a badge sits into one depends on\n * that host's own curve, shadow and optical weight.\n */\n readonly offset = input<BadgeOffset>();\n\n protected readonly resolvedPlacement = computed(() => this.placement() ?? 'top-end');\n protected readonly resolvedOverlap = computed(() => this.overlap() ?? 'rectangle');\n /**\n * An axis the page did not state is `null`, which removes the property rather\n * than writing nought into it: the sheet's own default is what answers, and a\n * theme that moves it still wins.\n */\n protected readonly offsetX = computed(() => length(this.offset()?.x));\n protected readonly offsetY = computed(() => length(this.offset()?.y));\n}\n\nfunction length(value: number | undefined): string | null {\n return value === undefined ? null : `${value}px`;\n}\n","import { Directive } from '@angular/core';\n\n/**\n * A glyph before the words. The artwork is the consumer's, and the part gives\n * it a box that is sized and centerd; the directive is written on the element\n * the page already has, so nothing is wrapped.\n */\n@Directive({\n selector: '[slBadgeStart]',\n standalone: true,\n exportAs: 'slBadgeStart',\n host: { 'data-part': 'start', 'data-part-start': '' },\n})\nexport class SlBadgeStart {}\n\n/** A glyph after the words. */\n@Directive({\n selector: '[slBadgeEnd]',\n standalone: true,\n exportAs: 'slBadgeEnd',\n host: { 'data-part': 'end', 'data-part-end': '' },\n})\nexport class SlBadgeEnd {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AA4CA,MAAM,QAAQ,GAAkB;AAC9B,IAAA,MAAM,EAAE,SAAS;AACjB,IAAA,GAAG,EAAE,EAAE;AACP,IAAA,KAAK,EAAE,MAAM;AACb,IAAA,IAAI,EAAE,IAAI;AACV,IAAA,IAAI,EAAE,WAAW;AACjB,IAAA,OAAO,EAAE,MAAM;CAChB;MAEY,cAAc,GAAG,IAAI,cAAc,CAAgB,wBAAwB,EAAE;AACxF,IAAA,UAAU,EAAE,MAAM;AAClB,IAAA,OAAO,EAAE,MAAM,QAAQ;AACxB,CAAA;AAED;;;;;AAKG;AACG,SAAU,oBAAoB,CAAC,QAAgC,EAAA;IACnE,OAAO;AACL,QAAA,OAAO,EAAE,cAAc;AACvB,QAAA,UAAU,EAAE,OAAsB;AAChC,YAAA,MAAM,EAAE,QAAQ,CAAC,MAAM,IAAI,QAAQ,CAAC,MAAM;AAC1C,YAAA,GAAG,EAAE,QAAQ,CAAC,GAAG,IAAI,QAAQ,CAAC,GAAG;AACjC,YAAA,KAAK,EAAE,QAAQ,CAAC,KAAK,IAAI,QAAQ,CAAC,KAAK;AACvC,YAAA,IAAI,EAAE,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,IAAI;AACpC,YAAA,IAAI,EAAE,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,IAAI;AACpC,YAAA,OAAO,EAAE,QAAQ,CAAC,OAAO,IAAI,QAAQ,CAAC,OAAO;SAC9C,CAAC;KACH;AACH;AAEA;SACgB,mBAAmB,GAAA;AACjC,IAAA,OAAO,MAAM,CAAC,c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EAAA,WAAA,EAAA,OAAA,EAAA,iBAAA,EAAA,EAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,cAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAZ,YAAY,EAAA,UAAA,EAAA,CAAA;kBANxB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,gBAAgB;AAC1B,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,QAAQ,EAAE,cAAc;oBACxB,IAAI,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,iBAAiB,EAAE,EAAE,EAAE;AACtD,iBAAA;;AAGD;MAOa,UAAU,CAAA;uGAAV,UAAU,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAV,UAAU,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,cAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,WAAA,EAAA,KAAA,EAAA,eAAA,EAAA,EAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,YAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAV,UAAU,EAAA,UAAA,EAAA,CAAA;kBANtB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,cAAc;AACxB,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,QAAQ,EAAE,YAAY;oBACtB,IAAI,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,eAAe,EAAE,EAAE,EAAE;AAClD,iBAAA;;;ACrBD;;AAEG;;"}
|
|
@@ -483,7 +483,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImpor
|
|
|
483
483
|
}]
|
|
484
484
|
}] });
|
|
485
485
|
/**
|
|
486
|
-
* A crumb that opens a menu of its siblings — the
|
|
486
|
+
* A crumb that opens a menu of its siblings — the organization, the project,
|
|
487
487
|
* the environment. It is a component on the consumer's own `button`, because an
|
|
488
488
|
* `a` without `href` takes no focus, and it draws the chevron after the label.
|
|
489
489
|
* The menu composes on the same element:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slotted-angular-breadcrumb.mjs","sources":["../../breadcrumb/src/breadcrumb.constants.ts","../../breadcrumb/src/breadcrumb.ts","../../breadcrumb/src/slotted-angular-breadcrumb.ts"],"sourcesContent":["import { InjectionToken, inject } from '@angular/core';\nimport type { TemplateRef } from '@angular/core';\n\n/**\n * What a trail does with crumbs its width cannot hold. `collapse` folds the\n * middle ones into the ellipsis; `wrap` lets the row break onto a second line\n * and only the count collapses.\n */\nexport type BreadcrumbOverflow = 'collapse' | 'wrap';\n\n/** Why the trail expanded. Only two things can ask: a press and a key. */\nexport type BreadcrumbExpandReason = 'pointer' | 'keyboard';\n\n/**\n * What every trail on the page does before it states anything of its own. The\n * three collapse numbers are here because how deep a trail may get before it\n * folds is a decision about the application rather than about one page.\n */\nexport interface BreadcrumbDefaults {\n itemsAfterCollapse?: number;\n itemsBeforeCollapse?: number;\n maxItems?: number;\n overflow?: BreadcrumbOverflow;\n /** The mark drawn between two crumbs, rendered once per item. */\n separator?: TemplateRef<unknown>;\n}\n\nexport const BREADCRUMB_DEFAULT_MAX_ITEMS = 8;\nexport const BREADCRUMB_DEFAULT_ITEMS_BEFORE = 1;\nexport const BREADCRUMB_DEFAULT_ITEMS_AFTER = 2;\nexport const BREADCRUMB_DEFAULT_OVERFLOW: BreadcrumbOverflow = 'collapse';\n\nexport const BREADCRUMB_DEFAULTS_TOKEN = new InjectionToken<BreadcrumbDefaults>(\n 'slotted breadcrumb defaults',\n { providedIn: 'root', factory: (): BreadcrumbDefaults => ({}) },\n);\n\n/**\n * An application decides once how deep its trails may get before they fold,\n * whether they fold for want of width, and what is drawn between two crumbs. A\n * trail that states any of those itself still wins: an explicit input is never\n * overridden by the token. Its words come from the language in force\n * (`provideSlotted`).\n */\nexport function provideBreadcrumbDefaults(defaults: BreadcrumbDefaults) {\n return { provide: BREADCRUMB_DEFAULTS_TOKEN, useValue: defaults };\n}\n\nexport function injectBreadcrumbDefaults(): BreadcrumbDefaults {\n return inject(BREADCRUMB_DEFAULTS_TOKEN);\n}\n\n/**\n * Which crumbs survive a collapse, as indices into the trail. Shared with the\n * React binding's own copy through the tests that assert the same table, and\n * deliberately not shared through `@slotted/core`: it is four lines, and a core\n * module exists for arithmetic two bindings would otherwise get *differently*\n * wrong, not for arithmetic they would each get right.\n */\nexport function collapsedRange(count: number, before: number, after: number) {\n const kept = Math.max(0, before) + Math.max(0, after);\n if (count <= kept) return undefined;\n return { start: Math.max(0, before), end: count - Math.max(0, after) };\n}\n","import { writeSelectorKey } from '@slotted/core/selector-key';\nimport {\n afterNextRender,\n afterRenderEffect,\n ApplicationRef,\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n type ComponentRef,\n computed,\n contentChildren,\n createComponent,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n EnvironmentInjector,\n forwardRef,\n HostAttributeToken,\n inject,\n Injector,\n input,\n numberAttribute,\n output,\n signal,\n TemplateRef,\n untracked,\n ViewEncapsulation,\n} from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { injectMessages } from '@slotted/angular/i18n';\nimport { SlGlyph, SlIcon } from '@slotted/angular/icon';\nimport {\n breadcrumbMessages,\n type BreadcrumbMessages,\n type PartialMessages,\n} from '@slotted/core/i18n';\nimport { createCollapse, type CollapseHandle } from '@slotted/core/overflow';\nimport { createControllable } from '@slotted/core/state';\nimport type { ChangeRequest } from '@slotted/core/state';\n\nimport {\n BREADCRUMB_DEFAULT_ITEMS_AFTER,\n BREADCRUMB_DEFAULT_ITEMS_BEFORE,\n BREADCRUMB_DEFAULT_MAX_ITEMS,\n BREADCRUMB_DEFAULT_OVERFLOW,\n collapsedRange,\n injectBreadcrumbDefaults,\n type BreadcrumbExpandReason,\n type BreadcrumbOverflow,\n} from './breadcrumb.constants';\n\n/**\n * The trail of ancestors above the current page.\n *\n * **The landmark and the list are the platform's.** `nav` makes the trail\n * findable and `ol` carries the hierarchy and the set size, which is the whole\n * of the APG's Breadcrumb pattern: it lists no keyboard interaction and two\n * attributes, and both are written here rather than reimplemented.\n *\n * **The collapse expands in place.** An overlay would need a layer, a\n * positioner and a dismissal policy; this needs none of them. The hidden\n * crumbs carry `hidden`, so they leave the accessibility tree with the page,\n * and the button that hides them names the count.\n *\n * **A trail that does not fit folds.** With `overflow=\"collapse\"` the list\n * measures itself and folds the middle crumbs its width cannot hold into the\n * same ellipsis, nearest the root first; what folded is read from the layout\n * and reported in `data-collapsed`, not owned by anyone.\n *\n * **It is a component on the consumer's own `nav`.** A directive carries no\n * `styleUrl`, and the element was never the family's to choose.\n */\n@Component({\n selector: 'nav[slBreadcrumb]',\n standalone: true,\n template: '<ng-content></ng-content>',\n styleUrls: ['../../../styles/src/breadcrumb/breadcrumb.css'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n exportAs: 'slBreadcrumb',\n host: {\n 'data-ui': 'breadcrumb',\n 'data-ui-breadcrumb': '',\n 'data-part': 'root',\n 'data-part-root': '',\n '[attr.aria-label]': 'accessibleLabel()',\n '[attr.data-expanded]': 'expanded() ? \"\" : null',\n '[attr.data-collapsed]': 'collapsedCount() > 0 ? collapsedCount() : null',\n },\n})\nexport class SlBreadcrumb {\n /**\n * Present means controlled, for the life of the component, which is why the\n * unset value is `undefined` rather than `false`: a family that read `false`\n * as a consumer's answer would never own its own state.\n */\n readonly expandedValue = input(undefined, {\n alias: 'expanded',\n transform: (value: boolean | string | undefined) =>\n value === undefined ? undefined : booleanAttribute(value),\n });\n /** What an uncontrolled trail starts from, read once. */\n readonly defaultExpanded = input(false, { transform: booleanAttribute });\n /**\n * Words laid over the catalog of the language in force, key by key: the\n * landmark's name (`label`) and the ellipsis. A static `aria-label` still wins.\n */\n readonly messages = input<PartialMessages<BreadcrumbMessages> | undefined>(undefined);\n readonly maxItems = input(undefined, { transform: optionalNumber });\n readonly itemsBeforeCollapse = input(undefined, { transform: optionalNumber });\n readonly itemsAfterCollapse = input(undefined, { transform: optionalNumber });\n readonly separator = input<TemplateRef<unknown> | undefined>(undefined);\n /** What the trail does with crumbs its width cannot hold. */\n readonly overflow = input<BreadcrumbOverflow | undefined>(undefined);\n\n /** How many crumbs are folded into the ellipsis, written by the list. */\n readonly collapsedCount = signal(0);\n\n /**\n * Emitted before the trail expands, carrying the value it replaces, the\n * reason and the event it came from. It is not the second half of\n * `[(expanded)]`: a two-way binding has one slot and can carry none of those.\n */\n readonly expandedChange = output<ChangeRequest<boolean>>();\n\n private readonly own = signal(false);\n readonly expanded = computed(() => this.expandedValue() ?? this.own());\n\n private readonly defaults = injectBreadcrumbDefaults();\n\n /** A static `aria-label` the consumer wrote survives the host binding. */\n private readonly ownLabel = inject(new HostAttributeToken('aria-label'), { optional: true });\n\n /** The family's words in the language in force, with this trail's `messages` laid over them. */\n readonly t = injectMessages(breadcrumbMessages, this.messages);\n readonly accessibleLabel = computed(() => this.ownLabel ?? this.t('label'));\n readonly maxItemsValue = computed(\n () => this.maxItems() ?? this.defaults.maxItems ?? BREADCRUMB_DEFAULT_MAX_ITEMS,\n );\n readonly beforeValue = computed(\n () =>\n this.itemsBeforeCollapse() ??\n this.defaults.itemsBeforeCollapse ??\n BREADCRUMB_DEFAULT_ITEMS_BEFORE,\n );\n readonly afterValue = computed(\n () =>\n this.itemsAfterCollapse() ??\n this.defaults.itemsAfterCollapse ??\n BREADCRUMB_DEFAULT_ITEMS_AFTER,\n );\n readonly separatorValue = computed(() => this.separator() ?? this.defaults.separator);\n readonly overflowValue = computed(\n () => this.overflow() ?? this.defaults.overflow ?? BREADCRUMB_DEFAULT_OVERFLOW,\n );\n\n /**\n * Where focus goes once the ellipsis stops existing, registered by the list —\n * the only part that can see which crumb the ellipsis replaced. React reaches\n * the same crumb through an id it generates; Angular reaches it through the\n * query it already has, and neither writes anything the other does not.\n */\n private focusAfterExpand: (() => void) | undefined;\n\n registerFocusTarget(focus: (() => void) | undefined) {\n this.focusAfterExpand = focus;\n }\n\n private readonly injector = inject(Injector);\n\n /**\n * The ellipsis stops existing the moment it is pressed, and focus on a\n * removed element is lost to the body — so it is given to the first crumb the\n * expansion revealed. The move waits a microtask because that crumb is still\n * hidden while this runs.\n */\n expand(reason: BreadcrumbExpandReason, source?: Event) {\n if (this.expanded()) return;\n const state = createControllable<boolean>({\n controlled: this.expandedValue(),\n initial: this.expanded(),\n onRequest: (request) => this.expandedChange.emit(request),\n });\n if (state.request(true, reason, source)) this.own.set(true);\n /**\n * After the render, not after a microtask: the crumb focus moves to is\n * still hidden while this runs, and a microtask fires before Angular has\n * written the DOM. Focus then stayed on a removed button and fell to the\n * body, which the spec caught and nothing else would have.\n */\n afterNextRender(() => this.focusAfterExpand?.(), { injector: this.injector });\n }\n}\n\n/**\n * The control that reveals what the collapse hides, in an item of its own.\n *\n * The list creates it rather than any crumb drawing it, because it has to be a\n * sibling of the crumbs: a crumb that drew it inside itself hid it together\n * with itself, since the first crumb the collapse hides is the one it stands\n * in front of. Its accessible name carries the count, because three dots say\n * nothing about how much is behind them.\n */\n@Component({\n selector: 'li[slBreadcrumbEllipsis]',\n standalone: true,\n imports: [NgTemplateOutlet, SlGlyph, SlIcon],\n template: `\n <button\n [attr.aria-label]=\"label()\"\n aria-expanded=\"false\"\n data-part=\"ellipsis\"\n data-part-ellipsis=\"\"\n type=\"button\"\n (click)=\"trail.expand('pointer', $event)\"\n (keydown)=\"onKeydown($event)\"\n >\n <span slIcon><svg slGlyph name=\"ellipsis\"></svg></span>\n </button>\n <span aria-hidden=\"true\" data-part=\"separator\" data-part-separator=\"\">\n <ng-container *ngTemplateOutlet=\"trail.separatorValue() ?? null\"></ng-container>\n </span>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: { 'data-part': 'item', 'data-part-item': '' },\n})\nclass SlBreadcrumbEllipsis {\n readonly trail = inject(SlBreadcrumb);\n /* Declared below this class, and read only when an instance is created. */\n private readonly list = inject(SlBreadcrumbList);\n\n readonly label = computed(() => this.trail.t('showHidden', { count: this.list.hiddenCount() }));\n\n onKeydown(event: KeyboardEvent) {\n /* `Enter` and `Space` both activate a button and the browser turns each\n into a click; this is what tells the two apart in the request. */\n if (event.key === 'Enter' || event.key === ' ') this.trail.expand('keyboard', event);\n }\n}\n\n/**\n * The ordered list, and the one part that knows how many crumbs there are.\n *\n * It queries its items rather than projecting them blindly, because two facts\n * about a crumb can only be known from the outside: whether it is the last —\n * the last draws no separator — and whether the count collapse is hiding it.\n * It also owns the ellipsis, which it places in front of the first crumb that\n * can fold, and the width collapse.\n *\n * That is where the two bindings differ and the DOM does not: React maps its\n * children, Angular writes the same facts back onto queried items and inserts\n * the ellipsis's item itself.\n */\n@Directive({\n selector: 'ol[slBreadcrumbList]',\n standalone: true,\n exportAs: 'slBreadcrumbList',\n host: { 'data-part': 'list', 'data-part-list': '' },\n})\nexport class SlBreadcrumbList {\n private readonly trail = inject(SlBreadcrumb);\n /* The crumb is declared below this class, and the dev-server transform puts\n the query predicate in a static initializer — a direct reference would read\n the binding before it exists. `forwardRef` defers the read to the query. */\n private readonly items = contentChildren<SlBreadcrumbItem>(forwardRef(() => SlBreadcrumbItem));\n private readonly host: HTMLOListElement = inject(ElementRef).nativeElement;\n private readonly injector = inject(Injector);\n private readonly environment = inject(EnvironmentInjector);\n private readonly application = inject(ApplicationRef);\n\n private ellipsis: ComponentRef<SlBreadcrumbEllipsis> | null = null;\n private collapse: CollapseHandle | null = null;\n private readonly folded = signal(0);\n\n /**\n * The range is computed whether or not the trail is expanded, because two\n * different things read it. The collapse reads it only while folded; the\n * focus target reads it afterwards, and it has to still be there — the id\n * used to disappear with the ellipsis, which left focus on a removed button\n * and therefore on the body.\n */\n private readonly range = computed(() => {\n const count = this.items().length;\n const maxItems = this.trail.maxItemsValue();\n return maxItems <= 0 || count <= maxItems\n ? undefined\n : collapsedRange(count, this.trail.beforeValue(), this.trail.afterValue());\n });\n private readonly counted = computed(() => (this.trail.expanded() ? undefined : this.range()));\n /** Whether there is a middle at all: crumbs outside the ones that never fold. */\n private readonly middle = computed(\n () =>\n this.items().length >\n Math.max(0, this.trail.beforeValue()) + Math.max(0, this.trail.afterValue()),\n );\n /**\n * The width collapse runs only while the count has hidden nothing: a trail\n * the count already folded shows only the crumbs that never fold. One writer\n * per `hidden` attribute keeps the two from undoing each other — the item's\n * host binding writes it for the count, `createCollapse` for the width.\n */\n private readonly measuring = computed(\n () =>\n this.trail.overflowValue() === 'collapse' &&\n !this.trail.expanded() &&\n this.range() === undefined &&\n this.middle(),\n );\n\n readonly hiddenCount = computed(() => {\n const counted = this.counted();\n return counted === undefined ? this.folded() : counted.end - counted.start;\n });\n\n constructor() {\n effect(() => {\n const items = this.items();\n const counted = this.counted();\n for (const [index, item] of items.entries()) {\n item.last.set(index === items.length - 1);\n item.collapsed.set(counted !== undefined && index >= counted.start && index < counted.end);\n }\n /* The first crumb an expansion reveals, whichever collapse hid it. */\n const revealed = this.middle() ? items[Math.max(0, this.trail.beforeValue())] : undefined;\n this.trail.registerFocusTarget(revealed === undefined ? undefined : () => revealed.focus());\n this.trail.collapsedCount.set(this.hiddenCount());\n });\n\n afterRenderEffect(() => {\n const items = this.items();\n const counted = this.counted() !== undefined;\n const measuring = this.measuring();\n const anchor =\n counted || measuring ? items[Math.max(0, this.trail.beforeValue())] : undefined;\n untracked(() => this.place(anchor?.element, counted, measuring));\n });\n\n inject(DestroyRef).onDestroy(() => {\n this.collapse?.destroy();\n this.ellipsis?.destroy();\n });\n }\n\n /**\n * Puts the ellipsis's item in front of the first crumb that can fold, or\n * takes it away, and starts or stops the width measurement.\n */\n private place(anchor: HTMLElement | undefined, counted: boolean, measuring: boolean) {\n if (!measuring) {\n this.collapse?.destroy();\n this.collapse = null;\n this.folded.set(0);\n }\n if (anchor === undefined) {\n if (this.ellipsis !== null) {\n this.application.detachView(this.ellipsis.hostView);\n this.ellipsis.destroy();\n this.ellipsis = null;\n }\n return;\n }\n\n const item = this.ensureEllipsis();\n if (item.nextElementSibling !== anchor) this.host.insertBefore(item, anchor);\n\n if (counted) {\n item.removeAttribute('hidden');\n return;\n }\n if (this.collapse === null) {\n /* Until the width has been measured the ellipsis stands for nothing. */\n item.setAttribute('hidden', '');\n const units = () =>\n [...this.host.children].filter(\n (unit): unit is HTMLElement => unit instanceof HTMLElement && unit !== item,\n );\n const before = Math.max(0, this.trail.beforeValue());\n const after = Math.max(0, this.trail.afterValue());\n this.collapse = createCollapse(this.host, {\n /* Only the middle folds: the first crumbs and the last ones never do. */\n collapsible: (unit) => {\n const index = units().indexOf(unit);\n return index >= before && index < units().length - after;\n },\n onChange: (hidden) => this.folded.set(hidden.length),\n /* Nearest the root first, so the folded run stays beside the ellipsis. */\n rank: (unit) => units().indexOf(unit),\n trigger: () => item,\n units,\n });\n } else {\n this.collapse.refresh();\n }\n }\n\n private ensureEllipsis(): HTMLElement {\n if (this.ellipsis === null) {\n this.ellipsis = createComponent(SlBreadcrumbEllipsis, {\n elementInjector: this.injector,\n environmentInjector: this.environment,\n hostElement: this.host.ownerDocument.createElement('li'),\n });\n this.application.attachView(this.ellipsis.hostView);\n }\n return this.ellipsis.location.nativeElement as HTMLElement;\n }\n}\n\n/**\n * One ancestor, or the current page. It carries the separator after it, so a\n * consumer writes none and never leaves a trailing one behind.\n */\n@Component({\n selector: 'li[slBreadcrumbItem]',\n standalone: true,\n imports: [NgTemplateOutlet],\n template: `\n <ng-content></ng-content>\n @if (!last()) {\n <span aria-hidden=\"true\" data-part=\"separator\" data-part-separator=\"\">\n <ng-container *ngTemplateOutlet=\"trail.separatorValue() ?? null\"></ng-container>\n </span>\n }\n `,\n styleUrls: ['../../../styles/src/breadcrumb/breadcrumb.css'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n exportAs: 'slBreadcrumbItem',\n host: {\n 'data-part': 'item',\n 'data-part-item': '',\n '[attr.hidden]': 'collapsed() ? \"\" : null',\n },\n})\nexport class SlBreadcrumbItem {\n readonly trail = inject(SlBreadcrumb);\n\n readonly element: HTMLElement = inject(ElementRef).nativeElement;\n\n /** Written by the list, which is the only part that can see the whole trail. */\n readonly last = signal(false);\n readonly collapsed = signal(false);\n\n /** The crumb's own control, whatever the consumer made it. */\n focus() {\n this.element.querySelector<HTMLElement>('a, button, [tabindex]')?.focus();\n }\n}\n\n/**\n * An ancestor that can be reached. The directive sits on the consumer's own\n * anchor, so the role, `Enter`, the context menu and every modified click are\n * the platform's — and `routerLink` composes on the same element, because the\n * element was never the family's to begin with.\n */\n@Directive({\n selector: 'a[slBreadcrumbLink]',\n standalone: true,\n exportAs: 'slBreadcrumbLink',\n host: { 'data-part': 'link', 'data-part-link': '' },\n})\nexport class SlBreadcrumbLink {\n private readonly element: HTMLAnchorElement = inject(ElementRef).nativeElement;\n\n focus() {\n this.element.focus();\n }\n}\n\n/**\n * The page the reader is on. It is text rather than a link, because a link to\n * the page you are already on goes nowhere, and it carries `aria-current=\"page\"`\n * — the value the ARIA specification names for a link within a set of pages.\n */\n@Directive({\n selector: '[slBreadcrumbPage]',\n standalone: true,\n exportAs: 'slBreadcrumbPage',\n host: {\n 'data-part': 'page',\n 'data-part-page': '',\n 'aria-current': 'page',\n },\n})\nexport class SlBreadcrumbPage {}\n\n/**\n * A crumb that opens a menu of its siblings — the organisation, the project,\n * the environment. It is a component on the consumer's own `button`, because an\n * `a` without `href` takes no focus, and it draws the chevron after the label.\n * The menu composes on the same element:\n *\n * ```html\n * <button slBreadcrumbTrigger current [slMenuTriggerFor]=\"environments\">Production</button>\n * ```\n *\n * `current` keeps `aria-current=\"page\"` on the switcher of the page the reader\n * is on, which a switcher does not stop being.\n */\n@Component({\n selector: 'button[slBreadcrumbTrigger]',\n standalone: true,\n imports: [SlGlyph, SlIcon],\n template: `<ng-content></ng-content><span slIcon><svg slGlyph name=\"chevron-down\"></svg></span>`,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n exportAs: 'slBreadcrumbTrigger',\n host: {\n 'data-part': 'trigger',\n 'data-part-trigger': '',\n '[attr.type]': 'ownType ?? \"button\"',\n '[attr.aria-current]': 'current() ? \"page\" : ownCurrent',\n },\n})\nexport class SlBreadcrumbTrigger {\n readonly current = input(false, { transform: booleanAttribute });\n\n protected readonly ownType = inject(new HostAttributeToken('type'), { optional: true });\n protected readonly ownCurrent = inject(new HostAttributeToken('aria-current'), {\n optional: true,\n });\n private readonly element: HTMLElement = inject(ElementRef).nativeElement;\n\n constructor() {\n /**\n * `slMenuTriggerFor` on the same element binds `data-part` to `null` when\n * its trigger is a plain control, which erased this part and the whole\n * crumb's styling with it. The erasing expression is a constant, so the\n * part written back after the first render is never erased again —\n * `docs/build-briefing.md` records the rule.\n */\n afterNextRender(() => writeSelectorKey(this.element, 'part', 'trigger'));\n }\n}\n\n/**\n * Absence has to survive the transform: `numberAttribute` maps an unset input\n * to `NaN`, and a family that read that would stop deferring to the provider.\n */\nfunction optionalNumber(value: number | string | undefined) {\n if (value === undefined || value === null || value === '') return undefined;\n const parsed = numberAttribute(value);\n return Number.isFinite(parsed) ? parsed : undefined;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;AA2BO,MAAM,4BAA4B,GAAG;AACrC,MAAM,+BAA+B,GAAG;AACxC,MAAM,8BAA8B,GAAG;AACvC,MAAM,2BAA2B,GAAuB;AAExD,MAAM,yBAAyB,GAAG,IAAI,cAAc,CACzD,6BAA6B,EAC7B,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,OAA2B,EAAE,CAAC,EAAE;AAGjE;;;;;;AAMG;AACG,SAAU,yBAAyB,CAAC,QAA4B,EAAA;IACpE,OAAO,EAAE,OAAO,EAAE,yBAAyB,EAAE,QAAQ,EAAE,QAAQ,EAAE;AACnE;SAEg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,KAAK,KAAK,EAAE;AAAE,QAAA,OAAO,SAAS;AAC3E,IAAA,MAAM,MAAM,GAAG,eAAe,CAAC,KAAK,CAAC;AACrC,IAAA,OAAO,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,MAAM,GAAG,SAAS;AACrD;;ACjiBA;;AAEG;;"}
|
|
1
|
+
{"version":3,"file":"slotted-angular-breadcrumb.mjs","sources":["../../breadcrumb/src/breadcrumb.constants.ts","../../breadcrumb/src/breadcrumb.ts","../../breadcrumb/src/slotted-angular-breadcrumb.ts"],"sourcesContent":["import { InjectionToken, inject } from '@angular/core';\nimport type { TemplateRef } from '@angular/core';\n\n/**\n * What a trail does with crumbs its width cannot hold. `collapse` folds the\n * middle ones into the ellipsis; `wrap` lets the row break onto a second line\n * and only the count collapses.\n */\nexport type BreadcrumbOverflow = 'collapse' | 'wrap';\n\n/** Why the trail expanded. Only two things can ask: a press and a key. */\nexport type BreadcrumbExpandReason = 'pointer' | 'keyboard';\n\n/**\n * What every trail on the page does before it states anything of its own. The\n * three collapse numbers are here because how deep a trail may get before it\n * folds is a decision about the application rather than about one page.\n */\nexport interface BreadcrumbDefaults {\n itemsAfterCollapse?: number;\n itemsBeforeCollapse?: number;\n maxItems?: number;\n overflow?: BreadcrumbOverflow;\n /** The mark drawn between two crumbs, rendered once per item. */\n separator?: TemplateRef<unknown>;\n}\n\nexport const BREADCRUMB_DEFAULT_MAX_ITEMS = 8;\nexport const BREADCRUMB_DEFAULT_ITEMS_BEFORE = 1;\nexport const BREADCRUMB_DEFAULT_ITEMS_AFTER = 2;\nexport const BREADCRUMB_DEFAULT_OVERFLOW: BreadcrumbOverflow = 'collapse';\n\nexport const BREADCRUMB_DEFAULTS_TOKEN = new InjectionToken<BreadcrumbDefaults>(\n 'slotted breadcrumb defaults',\n { providedIn: 'root', factory: (): BreadcrumbDefaults => ({}) },\n);\n\n/**\n * An application decides once how deep its trails may get before they fold,\n * whether they fold for want of width, and what is drawn between two crumbs. A\n * trail that states any of those itself still wins: an explicit input is never\n * overridden by the token. Its words come from the language in force\n * (`provideSlotted`).\n */\nexport function provideBreadcrumbDefaults(defaults: BreadcrumbDefaults) {\n return { provide: BREADCRUMB_DEFAULTS_TOKEN, useValue: defaults };\n}\n\nexport function injectBreadcrumbDefaults(): BreadcrumbDefaults {\n return inject(BREADCRUMB_DEFAULTS_TOKEN);\n}\n\n/**\n * Which crumbs survive a collapse, as indices into the trail. Shared with the\n * React binding's own copy through the tests that assert the same table, and\n * deliberately not shared through `@slotted/core`: it is four lines, and a core\n * module exists for arithmetic two bindings would otherwise get *differently*\n * wrong, not for arithmetic they would each get right.\n */\nexport function collapsedRange(count: number, before: number, after: number) {\n const kept = Math.max(0, before) + Math.max(0, after);\n if (count <= kept) return undefined;\n return { start: Math.max(0, before), end: count - Math.max(0, after) };\n}\n","import { writeSelectorKey } from '@slotted/core/selector-key';\nimport {\n afterNextRender,\n afterRenderEffect,\n ApplicationRef,\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n type ComponentRef,\n computed,\n contentChildren,\n createComponent,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n EnvironmentInjector,\n forwardRef,\n HostAttributeToken,\n inject,\n Injector,\n input,\n numberAttribute,\n output,\n signal,\n TemplateRef,\n untracked,\n ViewEncapsulation,\n} from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { injectMessages } from '@slotted/angular/i18n';\nimport { SlGlyph, SlIcon } from '@slotted/angular/icon';\nimport {\n breadcrumbMessages,\n type BreadcrumbMessages,\n type PartialMessages,\n} from '@slotted/core/i18n';\nimport { createCollapse, type CollapseHandle } from '@slotted/core/overflow';\nimport { createControllable } from '@slotted/core/state';\nimport type { ChangeRequest } from '@slotted/core/state';\n\nimport {\n BREADCRUMB_DEFAULT_ITEMS_AFTER,\n BREADCRUMB_DEFAULT_ITEMS_BEFORE,\n BREADCRUMB_DEFAULT_MAX_ITEMS,\n BREADCRUMB_DEFAULT_OVERFLOW,\n collapsedRange,\n injectBreadcrumbDefaults,\n type BreadcrumbExpandReason,\n type BreadcrumbOverflow,\n} from './breadcrumb.constants';\n\n/**\n * The trail of ancestors above the current page.\n *\n * **The landmark and the list are the platform's.** `nav` makes the trail\n * findable and `ol` carries the hierarchy and the set size, which is the whole\n * of the APG's Breadcrumb pattern: it lists no keyboard interaction and two\n * attributes, and both are written here rather than reimplemented.\n *\n * **The collapse expands in place.** An overlay would need a layer, a\n * positioner and a dismissal policy; this needs none of them. The hidden\n * crumbs carry `hidden`, so they leave the accessibility tree with the page,\n * and the button that hides them names the count.\n *\n * **A trail that does not fit folds.** With `overflow=\"collapse\"` the list\n * measures itself and folds the middle crumbs its width cannot hold into the\n * same ellipsis, nearest the root first; what folded is read from the layout\n * and reported in `data-collapsed`, not owned by anyone.\n *\n * **It is a component on the consumer's own `nav`.** A directive carries no\n * `styleUrl`, and the element was never the family's to choose.\n */\n@Component({\n selector: 'nav[slBreadcrumb]',\n standalone: true,\n template: '<ng-content></ng-content>',\n styleUrls: ['../../../styles/src/breadcrumb/breadcrumb.css'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n exportAs: 'slBreadcrumb',\n host: {\n 'data-ui': 'breadcrumb',\n 'data-ui-breadcrumb': '',\n 'data-part': 'root',\n 'data-part-root': '',\n '[attr.aria-label]': 'accessibleLabel()',\n '[attr.data-expanded]': 'expanded() ? \"\" : null',\n '[attr.data-collapsed]': 'collapsedCount() > 0 ? collapsedCount() : null',\n },\n})\nexport class SlBreadcrumb {\n /**\n * Present means controlled, for the life of the component, which is why the\n * unset value is `undefined` rather than `false`: a family that read `false`\n * as a consumer's answer would never own its own state.\n */\n readonly expandedValue = input(undefined, {\n alias: 'expanded',\n transform: (value: boolean | string | undefined) =>\n value === undefined ? undefined : booleanAttribute(value),\n });\n /** What an uncontrolled trail starts from, read once. */\n readonly defaultExpanded = input(false, { transform: booleanAttribute });\n /**\n * Words laid over the catalog of the language in force, key by key: the\n * landmark's name (`label`) and the ellipsis. A static `aria-label` still wins.\n */\n readonly messages = input<PartialMessages<BreadcrumbMessages> | undefined>(undefined);\n readonly maxItems = input(undefined, { transform: optionalNumber });\n readonly itemsBeforeCollapse = input(undefined, { transform: optionalNumber });\n readonly itemsAfterCollapse = input(undefined, { transform: optionalNumber });\n readonly separator = input<TemplateRef<unknown> | undefined>(undefined);\n /** What the trail does with crumbs its width cannot hold. */\n readonly overflow = input<BreadcrumbOverflow | undefined>(undefined);\n\n /** How many crumbs are folded into the ellipsis, written by the list. */\n readonly collapsedCount = signal(0);\n\n /**\n * Emitted before the trail expands, carrying the value it replaces, the\n * reason and the event it came from. It is not the second half of\n * `[(expanded)]`: a two-way binding has one slot and can carry none of those.\n */\n readonly expandedChange = output<ChangeRequest<boolean>>();\n\n private readonly own = signal(false);\n readonly expanded = computed(() => this.expandedValue() ?? this.own());\n\n private readonly defaults = injectBreadcrumbDefaults();\n\n /** A static `aria-label` the consumer wrote survives the host binding. */\n private readonly ownLabel = inject(new HostAttributeToken('aria-label'), { optional: true });\n\n /** The family's words in the language in force, with this trail's `messages` laid over them. */\n readonly t = injectMessages(breadcrumbMessages, this.messages);\n readonly accessibleLabel = computed(() => this.ownLabel ?? this.t('label'));\n readonly maxItemsValue = computed(\n () => this.maxItems() ?? this.defaults.maxItems ?? BREADCRUMB_DEFAULT_MAX_ITEMS,\n );\n readonly beforeValue = computed(\n () =>\n this.itemsBeforeCollapse() ??\n this.defaults.itemsBeforeCollapse ??\n BREADCRUMB_DEFAULT_ITEMS_BEFORE,\n );\n readonly afterValue = computed(\n () =>\n this.itemsAfterCollapse() ??\n this.defaults.itemsAfterCollapse ??\n BREADCRUMB_DEFAULT_ITEMS_AFTER,\n );\n readonly separatorValue = computed(() => this.separator() ?? this.defaults.separator);\n readonly overflowValue = computed(\n () => this.overflow() ?? this.defaults.overflow ?? BREADCRUMB_DEFAULT_OVERFLOW,\n );\n\n /**\n * Where focus goes once the ellipsis stops existing, registered by the list —\n * the only part that can see which crumb the ellipsis replaced. React reaches\n * the same crumb through an id it generates; Angular reaches it through the\n * query it already has, and neither writes anything the other does not.\n */\n private focusAfterExpand: (() => void) | undefined;\n\n registerFocusTarget(focus: (() => void) | undefined) {\n this.focusAfterExpand = focus;\n }\n\n private readonly injector = inject(Injector);\n\n /**\n * The ellipsis stops existing the moment it is pressed, and focus on a\n * removed element is lost to the body — so it is given to the first crumb the\n * expansion revealed. The move waits a microtask because that crumb is still\n * hidden while this runs.\n */\n expand(reason: BreadcrumbExpandReason, source?: Event) {\n if (this.expanded()) return;\n const state = createControllable<boolean>({\n controlled: this.expandedValue(),\n initial: this.expanded(),\n onRequest: (request) => this.expandedChange.emit(request),\n });\n if (state.request(true, reason, source)) this.own.set(true);\n /**\n * After the render, not after a microtask: the crumb focus moves to is\n * still hidden while this runs, and a microtask fires before Angular has\n * written the DOM. Focus then stayed on a removed button and fell to the\n * body, which the spec caught and nothing else would have.\n */\n afterNextRender(() => this.focusAfterExpand?.(), { injector: this.injector });\n }\n}\n\n/**\n * The control that reveals what the collapse hides, in an item of its own.\n *\n * The list creates it rather than any crumb drawing it, because it has to be a\n * sibling of the crumbs: a crumb that drew it inside itself hid it together\n * with itself, since the first crumb the collapse hides is the one it stands\n * in front of. Its accessible name carries the count, because three dots say\n * nothing about how much is behind them.\n */\n@Component({\n selector: 'li[slBreadcrumbEllipsis]',\n standalone: true,\n imports: [NgTemplateOutlet, SlGlyph, SlIcon],\n template: `\n <button\n [attr.aria-label]=\"label()\"\n aria-expanded=\"false\"\n data-part=\"ellipsis\"\n data-part-ellipsis=\"\"\n type=\"button\"\n (click)=\"trail.expand('pointer', $event)\"\n (keydown)=\"onKeydown($event)\"\n >\n <span slIcon><svg slGlyph name=\"ellipsis\"></svg></span>\n </button>\n <span aria-hidden=\"true\" data-part=\"separator\" data-part-separator=\"\">\n <ng-container *ngTemplateOutlet=\"trail.separatorValue() ?? null\"></ng-container>\n </span>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: { 'data-part': 'item', 'data-part-item': '' },\n})\nclass SlBreadcrumbEllipsis {\n readonly trail = inject(SlBreadcrumb);\n /* Declared below this class, and read only when an instance is created. */\n private readonly list = inject(SlBreadcrumbList);\n\n readonly label = computed(() => this.trail.t('showHidden', { count: this.list.hiddenCount() }));\n\n onKeydown(event: KeyboardEvent) {\n /* `Enter` and `Space` both activate a button and the browser turns each\n into a click; this is what tells the two apart in the request. */\n if (event.key === 'Enter' || event.key === ' ') this.trail.expand('keyboard', event);\n }\n}\n\n/**\n * The ordered list, and the one part that knows how many crumbs there are.\n *\n * It queries its items rather than projecting them blindly, because two facts\n * about a crumb can only be known from the outside: whether it is the last —\n * the last draws no separator — and whether the count collapse is hiding it.\n * It also owns the ellipsis, which it places in front of the first crumb that\n * can fold, and the width collapse.\n *\n * That is where the two bindings differ and the DOM does not: React maps its\n * children, Angular writes the same facts back onto queried items and inserts\n * the ellipsis's item itself.\n */\n@Directive({\n selector: 'ol[slBreadcrumbList]',\n standalone: true,\n exportAs: 'slBreadcrumbList',\n host: { 'data-part': 'list', 'data-part-list': '' },\n})\nexport class SlBreadcrumbList {\n private readonly trail = inject(SlBreadcrumb);\n /* The crumb is declared below this class, and the dev-server transform puts\n the query predicate in a static initializer — a direct reference would read\n the binding before it exists. `forwardRef` defers the read to the query. */\n private readonly items = contentChildren<SlBreadcrumbItem>(forwardRef(() => SlBreadcrumbItem));\n private readonly host: HTMLOListElement = inject(ElementRef).nativeElement;\n private readonly injector = inject(Injector);\n private readonly environment = inject(EnvironmentInjector);\n private readonly application = inject(ApplicationRef);\n\n private ellipsis: ComponentRef<SlBreadcrumbEllipsis> | null = null;\n private collapse: CollapseHandle | null = null;\n private readonly folded = signal(0);\n\n /**\n * The range is computed whether or not the trail is expanded, because two\n * different things read it. The collapse reads it only while folded; the\n * focus target reads it afterwards, and it has to still be there — the id\n * used to disappear with the ellipsis, which left focus on a removed button\n * and therefore on the body.\n */\n private readonly range = computed(() => {\n const count = this.items().length;\n const maxItems = this.trail.maxItemsValue();\n return maxItems <= 0 || count <= maxItems\n ? undefined\n : collapsedRange(count, this.trail.beforeValue(), this.trail.afterValue());\n });\n private readonly counted = computed(() => (this.trail.expanded() ? undefined : this.range()));\n /** Whether there is a middle at all: crumbs outside the ones that never fold. */\n private readonly middle = computed(\n () =>\n this.items().length >\n Math.max(0, this.trail.beforeValue()) + Math.max(0, this.trail.afterValue()),\n );\n /**\n * The width collapse runs only while the count has hidden nothing: a trail\n * the count already folded shows only the crumbs that never fold. One writer\n * per `hidden` attribute keeps the two from undoing each other — the item's\n * host binding writes it for the count, `createCollapse` for the width.\n */\n private readonly measuring = computed(\n () =>\n this.trail.overflowValue() === 'collapse' &&\n !this.trail.expanded() &&\n this.range() === undefined &&\n this.middle(),\n );\n\n readonly hiddenCount = computed(() => {\n const counted = this.counted();\n return counted === undefined ? this.folded() : counted.end - counted.start;\n });\n\n constructor() {\n effect(() => {\n const items = this.items();\n const counted = this.counted();\n for (const [index, item] of items.entries()) {\n item.last.set(index === items.length - 1);\n item.collapsed.set(counted !== undefined && index >= counted.start && index < counted.end);\n }\n /* The first crumb an expansion reveals, whichever collapse hid it. */\n const revealed = this.middle() ? items[Math.max(0, this.trail.beforeValue())] : undefined;\n this.trail.registerFocusTarget(revealed === undefined ? undefined : () => revealed.focus());\n this.trail.collapsedCount.set(this.hiddenCount());\n });\n\n afterRenderEffect(() => {\n const items = this.items();\n const counted = this.counted() !== undefined;\n const measuring = this.measuring();\n const anchor =\n counted || measuring ? items[Math.max(0, this.trail.beforeValue())] : undefined;\n untracked(() => this.place(anchor?.element, counted, measuring));\n });\n\n inject(DestroyRef).onDestroy(() => {\n this.collapse?.destroy();\n this.ellipsis?.destroy();\n });\n }\n\n /**\n * Puts the ellipsis's item in front of the first crumb that can fold, or\n * takes it away, and starts or stops the width measurement.\n */\n private place(anchor: HTMLElement | undefined, counted: boolean, measuring: boolean) {\n if (!measuring) {\n this.collapse?.destroy();\n this.collapse = null;\n this.folded.set(0);\n }\n if (anchor === undefined) {\n if (this.ellipsis !== null) {\n this.application.detachView(this.ellipsis.hostView);\n this.ellipsis.destroy();\n this.ellipsis = null;\n }\n return;\n }\n\n const item = this.ensureEllipsis();\n if (item.nextElementSibling !== anchor) this.host.insertBefore(item, anchor);\n\n if (counted) {\n item.removeAttribute('hidden');\n return;\n }\n if (this.collapse === null) {\n /* Until the width has been measured the ellipsis stands for nothing. */\n item.setAttribute('hidden', '');\n const units = () =>\n [...this.host.children].filter(\n (unit): unit is HTMLElement => unit instanceof HTMLElement && unit !== item,\n );\n const before = Math.max(0, this.trail.beforeValue());\n const after = Math.max(0, this.trail.afterValue());\n this.collapse = createCollapse(this.host, {\n /* Only the middle folds: the first crumbs and the last ones never do. */\n collapsible: (unit) => {\n const index = units().indexOf(unit);\n return index >= before && index < units().length - after;\n },\n onChange: (hidden) => this.folded.set(hidden.length),\n /* Nearest the root first, so the folded run stays beside the ellipsis. */\n rank: (unit) => units().indexOf(unit),\n trigger: () => item,\n units,\n });\n } else {\n this.collapse.refresh();\n }\n }\n\n private ensureEllipsis(): HTMLElement {\n if (this.ellipsis === null) {\n this.ellipsis = createComponent(SlBreadcrumbEllipsis, {\n elementInjector: this.injector,\n environmentInjector: this.environment,\n hostElement: this.host.ownerDocument.createElement('li'),\n });\n this.application.attachView(this.ellipsis.hostView);\n }\n return this.ellipsis.location.nativeElement as HTMLElement;\n }\n}\n\n/**\n * One ancestor, or the current page. It carries the separator after it, so a\n * consumer writes none and never leaves a trailing one behind.\n */\n@Component({\n selector: 'li[slBreadcrumbItem]',\n standalone: true,\n imports: [NgTemplateOutlet],\n template: `\n <ng-content></ng-content>\n @if (!last()) {\n <span aria-hidden=\"true\" data-part=\"separator\" data-part-separator=\"\">\n <ng-container *ngTemplateOutlet=\"trail.separatorValue() ?? null\"></ng-container>\n </span>\n }\n `,\n styleUrls: ['../../../styles/src/breadcrumb/breadcrumb.css'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n exportAs: 'slBreadcrumbItem',\n host: {\n 'data-part': 'item',\n 'data-part-item': '',\n '[attr.hidden]': 'collapsed() ? \"\" : null',\n },\n})\nexport class SlBreadcrumbItem {\n readonly trail = inject(SlBreadcrumb);\n\n readonly element: HTMLElement = inject(ElementRef).nativeElement;\n\n /** Written by the list, which is the only part that can see the whole trail. */\n readonly last = signal(false);\n readonly collapsed = signal(false);\n\n /** The crumb's own control, whatever the consumer made it. */\n focus() {\n this.element.querySelector<HTMLElement>('a, button, [tabindex]')?.focus();\n }\n}\n\n/**\n * An ancestor that can be reached. The directive sits on the consumer's own\n * anchor, so the role, `Enter`, the context menu and every modified click are\n * the platform's — and `routerLink` composes on the same element, because the\n * element was never the family's to begin with.\n */\n@Directive({\n selector: 'a[slBreadcrumbLink]',\n standalone: true,\n exportAs: 'slBreadcrumbLink',\n host: { 'data-part': 'link', 'data-part-link': '' },\n})\nexport class SlBreadcrumbLink {\n private readonly element: HTMLAnchorElement = inject(ElementRef).nativeElement;\n\n focus() {\n this.element.focus();\n }\n}\n\n/**\n * The page the reader is on. It is text rather than a link, because a link to\n * the page you are already on goes nowhere, and it carries `aria-current=\"page\"`\n * — the value the ARIA specification names for a link within a set of pages.\n */\n@Directive({\n selector: '[slBreadcrumbPage]',\n standalone: true,\n exportAs: 'slBreadcrumbPage',\n host: {\n 'data-part': 'page',\n 'data-part-page': '',\n 'aria-current': 'page',\n },\n})\nexport class SlBreadcrumbPage {}\n\n/**\n * A crumb that opens a menu of its siblings — the organization, the project,\n * the environment. It is a component on the consumer's own `button`, because an\n * `a` without `href` takes no focus, and it draws the chevron after the label.\n * The menu composes on the same element:\n *\n * ```html\n * <button slBreadcrumbTrigger current [slMenuTriggerFor]=\"environments\">Production</button>\n * ```\n *\n * `current` keeps `aria-current=\"page\"` on the switcher of the page the reader\n * is on, which a switcher does not stop being.\n */\n@Component({\n selector: 'button[slBreadcrumbTrigger]',\n standalone: true,\n imports: [SlGlyph, SlIcon],\n template: `<ng-content></ng-content><span slIcon><svg slGlyph name=\"chevron-down\"></svg></span>`,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n exportAs: 'slBreadcrumbTrigger',\n host: {\n 'data-part': 'trigger',\n 'data-part-trigger': '',\n '[attr.type]': 'ownType ?? \"button\"',\n '[attr.aria-current]': 'current() ? \"page\" : ownCurrent',\n },\n})\nexport class SlBreadcrumbTrigger {\n readonly current = input(false, { transform: booleanAttribute });\n\n protected readonly ownType = inject(new HostAttributeToken('type'), { optional: true });\n protected readonly ownCurrent = inject(new HostAttributeToken('aria-current'), {\n optional: true,\n });\n private readonly element: HTMLElement = inject(ElementRef).nativeElement;\n\n constructor() {\n /**\n * `slMenuTriggerFor` on the same element binds `data-part` to `null` when\n * its trigger is a plain control, which erased this part and the whole\n * crumb's styling with it. The erasing expression is a constant, so the\n * part written back after the first render is never erased again —\n * `docs/build-briefing.md` records the rule.\n */\n afterNextRender(() => writeSelectorKey(this.element, 'part', 'trigger'));\n }\n}\n\n/**\n * Absence has to survive the transform: `numberAttribute` maps an unset input\n * to `NaN`, and a family that read that would stop deferring to the provider.\n */\nfunction optionalNumber(value: number | string | undefined) {\n if (value === undefined || value === null || value === '') return undefined;\n const parsed = numberAttribute(value);\n return Number.isFinite(parsed) ? parsed : undefined;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;AA2BO,MAAM,4BAA4B,GAAG;AACrC,MAAM,+BAA+B,GAAG;AACxC,MAAM,8BAA8B,GAAG;AACvC,MAAM,2BAA2B,GAAuB;AAExD,MAAM,yBAAyB,GAAG,IAAI,cAAc,CACzD,6BAA6B,EAC7B,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,OAA2B,EAAE,CAAC,EAAE;AAGjE;;;;;;AAMG;AACG,SAAU,yBAAyB,CAAC,QAA4B,EAAA;IACpE,OAAO,EAAE,OAAO,EAAE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IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,EAAE;AAAE,QAAA,OAAO,SAAS;AAC3E,IAAA,MAAM,MAAM,GAAG,eAAe,CAAC,KAAK,CAAC;AACrC,IAAA,OAAO,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,MAAM,GAAG,SAAS;AACrD;;ACjiBA;;AAEG;;"}
|
|
@@ -103,7 +103,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImpor
|
|
|
103
103
|
|
|
104
104
|
/**
|
|
105
105
|
* A rule between two runs of actions. It takes no room at all: the bar is one
|
|
106
|
-
* shape, and a rule is not
|
|
106
|
+
* shape, and a rule is not license to cut it — what the rule marks is painted
|
|
107
107
|
* in the column the shared edge already occupies, one step stronger than the
|
|
108
108
|
* seams around it, so the boundary reads without the bar coming apart. A
|
|
109
109
|
* filled run keeps its seam, which is the darkest step of its own tone and the
|