@sixbell-telco/sdk 4.2.0 → 4.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +108 -1
- package/README.md +98 -66
- package/_index.css +2 -1586
- package/components/accordion/accordion-item/accordion-item.component.d.ts +1 -1
- package/components/alert/README.md +27 -0
- package/components/alert/index.d.ts +5 -0
- package/components/alert/public-api.d.ts +1 -0
- package/components/alert/src/alert.component.d.ts +85 -0
- package/components/audio-player/audio-timeline/audio-timeline.component.d.ts +1 -1
- package/components/audio-player/button-play/button-play.component.d.ts +7 -7
- package/components/audio-player/src/audio-player.component.d.ts +2 -2
- package/components/audio-player/volume-control/volume-control.component.d.ts +1 -1
- package/components/avatar/README.md +1 -0
- package/components/avatar/src/avatar.component.d.ts +2 -2
- package/components/badge/src/badge.component.d.ts +4 -4
- package/components/button/README.md +5 -4
- package/components/button/src/button.component.d.ts +38 -16
- package/components/card/README.md +2 -0
- package/components/card/card-footer/card-footer.component.d.ts +37 -2
- package/components/card/card-section-group/card-section-group.component.d.ts +1 -1
- package/components/card/src/card.component.d.ts +6 -6
- package/components/countdown/src/countdown.component.d.ts +4 -4
- package/components/data-table/README.md +26 -0
- package/components/data-table/expandable/expandable.component.d.ts +4 -4
- package/components/data-table/sortable-header/sortable-header.component.d.ts +1 -1
- package/components/data-table/src/data-table.component.d.ts +15 -8
- package/components/data-table/sub-component-toggle/sub-component-toggle.component.d.ts +1 -1
- package/components/description-list/README.md +27 -0
- package/components/description-list/index.d.ts +5 -0
- package/components/description-list/public-api.d.ts +1 -0
- package/components/description-list/src/description-list.component.d.ts +90 -0
- package/components/dialog/README.md +10 -6
- package/components/dialog/dialog-actions/dialog-actions.component.d.ts +4 -0
- package/components/dialog/src/dialog.component.d.ts +27 -6
- package/components/dialog/src/fullscreen-block-scroll-strategy.d.ts +31 -0
- package/components/divider/src/divider.component.d.ts +1 -1
- package/components/dropdown/README.md +2 -2
- package/components/dropdown/dropdown-chevron/dropdown-chevron.component.d.ts +1 -1
- package/components/dropdown/dropdown-content/dropdown-content.component.d.ts +1 -1
- package/components/dropdown/dropdown-item/dropdown-item.component.d.ts +4 -4
- package/components/dropdown/dropdown-item-checkbox/dropdown-item-checkbox.component.d.ts +5 -5
- package/components/dropdown/dropdown-item-radio/dropdown-item-radio.component.d.ts +5 -5
- package/components/dropdown/dropdown-trigger/dropdown-trigger.component.d.ts +11 -14
- package/components/dropdown-menu/README.md +2 -2
- package/components/dropdown-menu/bar/dropdown-menu-bar/dropdown-menu-bar.component.d.ts +1 -1
- package/components/dropdown-menu/bar/dropdown-menu-bar-content/dropdown-menu-bar-content.component.d.ts +6 -2
- package/components/dropdown-menu/bar/dropdown-menu-bar-item/dropdown-menu-bar-item.component.d.ts +3 -3
- package/components/dropdown-menu/bar/dropdown-menu-bar-item-checkbox/dropdown-menu-bar-item-checkbox.component.d.ts +4 -4
- package/components/dropdown-menu/bar/dropdown-menu-bar-item-radio/dropdown-menu-bar-item-radio.component.d.ts +4 -4
- package/components/dropdown-menu/bar/dropdown-menu-bar-sub-trigger/dropdown-menu-bar-sub-trigger.component.d.ts +3 -1
- package/components/dropdown-menu/bar/dropdown-menu-bar-trigger/dropdown-menu-bar-trigger.component.d.ts +3 -1
- package/components/dropdown-menu/context/dropdown-context-menu-trigger/dropdown-context-menu-trigger.component.d.ts +2 -1
- package/components/dropdown-menu/dropdown-menu-chevron/dropdown-menu-chevron.component.d.ts +1 -1
- package/components/dropdown-menu/src/dropdown-menu-content/dropdown-menu-content.component.d.ts +2 -0
- package/components/dropdown-menu/src/dropdown-menu-item/dropdown-menu-item.component.d.ts +3 -3
- package/components/dropdown-menu/src/dropdown-menu-sub-content/dropdown-menu-sub-content.component.d.ts +2 -0
- package/components/dropdown-menu/src/dropdown-menu-sub-trigger/dropdown-menu-sub-trigger.component.d.ts +2 -1
- package/components/dropdown-menu/src/dropdown-menu-trigger/dropdown-menu-trigger.component.d.ts +1 -0
- package/components/empty-state/README.md +40 -0
- package/components/empty-state/index.d.ts +5 -0
- package/components/empty-state/public-api.d.ts +1 -0
- package/components/empty-state/src/empty-state.component.d.ts +73 -0
- package/components/file-upload/file-dropzone/file-dropzone.component.d.ts +4 -4
- package/components/file-upload/file-uploader/file-uploader.component.d.ts +2 -2
- package/components/forms/checkbox/src/checkbox.component.d.ts +1 -1
- package/components/forms/combobox/README.md +2 -1
- package/components/forms/combobox/src/combobox.component.d.ts +31 -18
- package/components/forms/date-picker/src/date-picker.component.d.ts +16 -9
- package/components/forms/form-hint/README.md +29 -0
- package/components/forms/form-hint/index.d.ts +5 -0
- package/components/forms/form-hint/public-api.d.ts +1 -0
- package/components/forms/form-hint/src/form-hint.component.d.ts +38 -0
- package/components/forms/form-item/src/form-item.component.d.ts +45 -1
- package/components/forms/input/src/input.component.d.ts +15 -8
- package/components/forms/radio/src/radio.component.d.ts +1 -1
- package/components/forms/range/src/range.component.d.ts +18 -4
- package/components/forms/select/README.md +2 -1
- package/components/forms/select/src/select.component.d.ts +30 -16
- package/components/forms/switch/src/switch.component.d.ts +1 -1
- package/components/forms/textarea/src/textarea.component.d.ts +12 -5
- package/components/forms/toggle/src/toggle.component.d.ts +1 -1
- package/components/notification/src/notification.component.d.ts +1 -1
- package/components/overlay/README.md +7 -2
- package/components/overlay/overlay-trigger/overlay-trigger.component.d.ts +1 -1
- package/components/overlay/src/overlay.component.d.ts +10 -9
- package/components/paginator/components/pagination-item/pagination-item.component.d.ts +3 -3
- package/components/progress/src/progress.component.d.ts +1 -1
- package/components/segmented-button/README.md +57 -0
- package/components/segmented-button/index.d.ts +5 -0
- package/components/segmented-button/public-api.d.ts +1 -0
- package/components/segmented-button/src/segmented-button.component.d.ts +110 -0
- package/components/sonner/toaster/src/toaster.component.d.ts +3 -3
- package/components/tab/src/tab.component.d.ts +2 -2
- package/components/table/README.md +51 -3
- package/components/table/public-api.d.ts +1 -0
- package/components/table/src/table.component.d.ts +20 -13
- package/components/table/table-action/table-action.component.d.ts +14 -3
- package/components/table/table-actions/table-actions.component.d.ts +12 -1
- package/components/table/tokens/README.md +7 -0
- package/components/table/tokens/index.d.ts +5 -0
- package/components/table/tokens/public-api.d.ts +1 -0
- package/components/table/tokens/table-empty-state.d.ts +6 -0
- package/components/tooltip/README.md +25 -7
- package/components/tooltip/src/tooltip.component.d.ts +44 -12
- package/components/tree/README.md +73 -0
- package/components/tree/index.d.ts +5 -0
- package/components/tree/public-api.d.ts +1 -0
- package/components/tree/src/tree.component.d.ts +180 -0
- package/components/wizard/README.md +9 -0
- package/components/wizard/wizard-content/wizard-content.component.d.ts +1 -1
- package/components/wizard/wizard-wrapper/wizard-wrapper.component.d.ts +15 -6
- package/directives/auto-focus/src/auto-focus.directive.d.ts +1 -1
- package/directives/only-numbers/src/only-numbers.directive.d.ts +1 -1
- package/directives/truncate/README.md +49 -0
- package/directives/truncate/index.d.ts +5 -0
- package/directives/truncate/public-api.d.ts +1 -0
- package/directives/truncate/src/truncate-popover.component.d.ts +11 -0
- package/directives/truncate/src/truncate.directive.d.ts +96 -0
- package/fesm2022/sixbell-telco-sdk-components-accordion.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-accordion.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-alert.mjs +152 -0
- package/fesm2022/sixbell-telco-sdk-components-alert.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-audio-player.mjs +15 -15
- package/fesm2022/sixbell-telco-sdk-components-audio-player.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-avatar.mjs +4 -4
- package/fesm2022/sixbell-telco-sdk-components-avatar.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-badge.mjs +5 -5
- package/fesm2022/sixbell-telco-sdk-components-badge.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-button.mjs +53 -19
- package/fesm2022/sixbell-telco-sdk-components-button.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-card.mjs +61 -14
- package/fesm2022/sixbell-telco-sdk-components-card.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-countdown.mjs +5 -5
- package/fesm2022/sixbell-telco-sdk-components-countdown.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-data-table-sub-component-toggle.mjs +3 -3
- package/fesm2022/sixbell-telco-sdk-components-data-table-sub-component-toggle.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-data-table.mjs +34 -33
- package/fesm2022/sixbell-telco-sdk-components-data-table.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-description-list.mjs +200 -0
- package/fesm2022/sixbell-telco-sdk-components-description-list.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-dialog.mjs +128 -17
- package/fesm2022/sixbell-telco-sdk-components-dialog.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-divider.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-divider.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu-bar.mjs +33 -24
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu-bar.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu-context.mjs +7 -3
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu-context.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu.mjs +25 -14
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dropdown.mjs +43 -72
- package/fesm2022/sixbell-telco-sdk-components-dropdown.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dual-list.mjs +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dual-list.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-empty-state.mjs +131 -0
- package/fesm2022/sixbell-telco-sdk-components-empty-state.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-file-upload.mjs +9 -9
- package/fesm2022/sixbell-telco-sdk-components-file-upload.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-checkbox.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-forms-checkbox.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-combobox.mjs +104 -72
- package/fesm2022/sixbell-telco-sdk-components-forms-combobox.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-date-picker.mjs +23 -12
- package/fesm2022/sixbell-telco-sdk-components-forms-date-picker.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-form-hint.mjs +81 -0
- package/fesm2022/sixbell-telco-sdk-components-forms-form-hint.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-forms-form-item.mjs +45 -3
- package/fesm2022/sixbell-telco-sdk-components-forms-form-item.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-input.mjs +27 -13
- package/fesm2022/sixbell-telco-sdk-components-forms-input.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-radio.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-forms-radio.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-range.mjs +29 -7
- package/fesm2022/sixbell-telco-sdk-components-forms-range.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-select.mjs +84 -56
- package/fesm2022/sixbell-telco-sdk-components-forms-select.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-switch.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-forms-switch.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-textarea.mjs +27 -22
- package/fesm2022/sixbell-telco-sdk-components-forms-textarea.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-toggle.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-forms-toggle.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-notification.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-notification.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-overlay.mjs +41 -79
- package/fesm2022/sixbell-telco-sdk-components-overlay.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-paginator.mjs +4 -4
- package/fesm2022/sixbell-telco-sdk-components-paginator.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-progress.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-progress.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-segmented-button.mjs +329 -0
- package/fesm2022/sixbell-telco-sdk-components-segmented-button.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-sonner-toaster.mjs +4 -4
- package/fesm2022/sixbell-telco-sdk-components-sonner-toaster.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-sonner.mjs +4 -4
- package/fesm2022/sixbell-telco-sdk-components-sonner.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-tab.mjs +3 -3
- package/fesm2022/sixbell-telco-sdk-components-tab.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-table-tokens.mjs +14 -0
- package/fesm2022/sixbell-telco-sdk-components-table-tokens.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-table.mjs +63 -32
- package/fesm2022/sixbell-telco-sdk-components-table.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-tooltip.mjs +187 -75
- package/fesm2022/sixbell-telco-sdk-components-tooltip.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-tree.mjs +478 -0
- package/fesm2022/sixbell-telco-sdk-components-tree.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-wizard.mjs +18 -9
- package/fesm2022/sixbell-telco-sdk-components-wizard.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-directives-auto-focus.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-directives-auto-focus.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-directives-only-numbers.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-directives-only-numbers.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-directives-truncate.mjs +339 -0
- package/fesm2022/sixbell-telco-sdk-directives-truncate.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-layouts.mjs +69 -41
- package/fesm2022/sixbell-telco-sdk-layouts.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-utils-date.mjs +15 -2
- package/fesm2022/sixbell-telco-sdk-utils-date.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-utils-mfe.mjs +87 -2
- package/fesm2022/sixbell-telco-sdk-utils-mfe.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-utils-popover-motion.mjs +186 -0
- package/fesm2022/sixbell-telco-sdk-utils-popover-motion.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-utils-theme.mjs +234 -4
- package/fesm2022/sixbell-telco-sdk-utils-theme.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-utils-translation-testing.mjs +203 -0
- package/fesm2022/sixbell-telco-sdk-utils-translation-testing.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-utils-translation.mjs +129 -14
- package/fesm2022/sixbell-telco-sdk-utils-translation.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-utils-unsaved-changes.mjs +150 -0
- package/fesm2022/sixbell-telco-sdk-utils-unsaved-changes.mjs.map +1 -0
- package/i18n/sdk/en.json +224 -0
- package/i18n/sdk/es.json +224 -0
- package/i18n/sdk/pt.json +224 -0
- package/layouts/README.md +18 -11
- package/layouts/public-api.d.ts +1 -1
- package/layouts/src/app-layout/app-layout.component.d.ts +11 -8
- package/layouts/src/layout.config.d.ts +1 -1
- package/layouts/src/menu/menu-active.d.ts +2 -1
- package/layouts/src/menu/menu-url.d.ts +2 -0
- package/layouts/src/navbar/navbar.component.d.ts +5 -5
- package/layouts/src/page-banner/page-banner.component.d.ts +19 -2
- package/layouts/src/side-menu/side-menu.component.d.ts +2 -2
- package/layouts/src/user-menu/user-menu.component.d.ts +5 -5
- package/package.json +64 -20
- package/src/_index.css +1701 -0
- package/utils/mfe/README.md +1 -0
- package/utils/mfe/src/hoist-property-rules.d.ts +13 -0
- package/utils/mfe/src/mfe-shadow-shell.component.d.ts +3 -0
- package/utils/popover-motion/README.md +38 -0
- package/utils/popover-motion/index.d.ts +5 -0
- package/utils/popover-motion/public-api.d.ts +2 -0
- package/utils/popover-motion/src/popover-menu-motion.d.ts +37 -0
- package/utils/popover-motion/src/popover-motion.d.ts +31 -0
- package/utils/theme/README.md +94 -1
- package/utils/theme/public-api.d.ts +2 -1
- package/utils/theme/src/models/theme.d.ts +32 -0
- package/utils/theme/src/overlay/theme-overlay.d.ts +33 -0
- package/utils/theme/src/providers/theme.provider.types.d.ts +7 -0
- package/utils/translation/README.md +63 -0
- package/utils/translation/src/translation.service.d.ts +24 -0
- package/utils/translation/testing/index.d.ts +5 -0
- package/utils/translation/testing/public-api.d.ts +2 -0
- package/utils/translation/testing/src/translation-testing.d.ts +96 -0
- package/utils/unsaved-changes/README.md +33 -0
- package/utils/unsaved-changes/index.d.ts +5 -0
- package/utils/unsaved-changes/public-api.d.ts +1 -0
- package/utils/unsaved-changes/src/unsaved-changes-dialog.component.d.ts +24 -0
- package/utils/unsaved-changes/src/unsaved-changes.d.ts +50 -0
|
@@ -9,17 +9,47 @@ Data table with optional pagination, footer, and row actions.
|
|
|
9
9
|
## Usage
|
|
10
10
|
|
|
11
11
|
```html
|
|
12
|
-
<st-table [data]="
|
|
13
|
-
<
|
|
12
|
+
<st-table [data]="users" [pagination]="pagination">
|
|
13
|
+
<tbody>
|
|
14
|
+
@for (user of users; track user.id) {
|
|
15
|
+
<tr>
|
|
16
|
+
<td>{{ user.name }}</td>
|
|
17
|
+
<td>
|
|
18
|
+
<st-table-actions
|
|
19
|
+
[actions]="actions"
|
|
20
|
+
mode="dropdown"
|
|
21
|
+
size="sm"
|
|
22
|
+
[contextLabel]="'usuario ' + user.name"
|
|
23
|
+
(actionTriggered)="handleAction($event, user)"
|
|
24
|
+
/>
|
|
25
|
+
</td>
|
|
26
|
+
</tr>
|
|
27
|
+
}
|
|
28
|
+
</tbody>
|
|
14
29
|
</st-table>
|
|
15
30
|
```
|
|
16
31
|
|
|
32
|
+
```ts
|
|
33
|
+
actions: TableActionConfig[] = [
|
|
34
|
+
{ id: 'view', icon: viewIcon, label: 'Ver', tooltip: 'Ver', variant: 'primary' },
|
|
35
|
+
{ id: 'edit', icon: editIcon, label: 'Editar', tooltip: 'Editar', variant: 'warning' },
|
|
36
|
+
{ id: 'delete', icon: deleteIcon, label: 'Eliminar', tooltip: 'Eliminar', variant: 'error' },
|
|
37
|
+
];
|
|
38
|
+
```
|
|
39
|
+
|
|
17
40
|
## Notes
|
|
18
41
|
|
|
42
|
+
- Row actions keep their role colors: view `primary`, edit `warning`, delete `error`. Give every action a `tooltip` and set `contextLabel` to the row's name. With three or more actions per row, use `mode="dropdown"` (the kebab menu).
|
|
19
43
|
- `st-table-actions` supports `inline` or `dropdown` modes, or projected `st-table-action` children.
|
|
20
|
-
- `st-table-action` default `variant` is `base
|
|
44
|
+
- `st-table-action` default `variant` is `base`; always set the role variant on row actions. Prefer `(triggered)` or `(clicked)`.
|
|
21
45
|
- `st-table-action` tooltip default `tooltipVariant` is `base`; override per action when needed.
|
|
22
46
|
- Accessible names: an `st-table-action` uses its translated `tooltip` as the button's `aria-label`, so give icon-only actions a `tooltip` (or a `tooltip` in each `TableActionConfig`). The `dropdown` mode trigger is named by the `sdk.table.actions` key.
|
|
47
|
+
- Row context: set `contextLabel` (on `st-table-action` or `st-table-actions`) to the row's name so each row's actions are told apart. The accessible name becomes "<tooltip> <contextLabel>" ("Editar producto ABC"), starting with the visible tooltip as WCAG 2.5.3 requires, while the tooltip still shows "Editar". In `dropdown` mode the trigger becomes "<actions label> <contextLabel>".
|
|
48
|
+
|
|
49
|
+
```html
|
|
50
|
+
<st-table-action variant="warning" [icon]="editIcon" tooltip="Editar" [contextLabel]="'producto ' + row.name" (triggered)="edit(row)" />
|
|
51
|
+
```
|
|
52
|
+
|
|
23
53
|
- `height` presets: `auto` (default), `full`, `sm` (18rem), `md` (20rem), `lg` (24rem), `xl` (36rem). The height container is the only scroll container, so `pinRows` keeps the header in view.
|
|
24
54
|
- `pinColumns` pins the first column, whether its cells are `th` or `td`.
|
|
25
55
|
|
|
@@ -44,3 +74,21 @@ Data table with optional pagination, footer, and row actions.
|
|
|
44
74
|
## Row hover
|
|
45
75
|
|
|
46
76
|
`rowHover` (default `true`) tints the hovered body row with `--color-table-row-hover`, layered over each cell's own background, so zebra rows and the pinned first column follow it. The default tint is `color-mix(in oklch, var(--color-base-content) 12%, transparent)`: it darkens rows in light schemes and lightens them in dark ones, whichever base step is lighter, and keeps at least 1.2:1 between hovered and resting rows with body text above 4.5:1 in the shipped themes. Override `--color-table-row-hover` in a theme to change it. Set `[rowHover]="false"` to turn it off. Remove per-row `hover:bg-*` workarounds.
|
|
77
|
+
|
|
78
|
+
## Empty state
|
|
79
|
+
|
|
80
|
+
Project an `st-empty-state` (from `@sixbell-telco/sdk/components/empty-state`) into `st-table` to replace the built-in "no data" and "no results" blocks. Use `size="sm"` and at most one CTA. It is never shown while `loading`.
|
|
81
|
+
|
|
82
|
+
```html
|
|
83
|
+
<st-table [data]="rows()" [totalItems]="total()">
|
|
84
|
+
<thead>
|
|
85
|
+
…
|
|
86
|
+
</thead>
|
|
87
|
+
<tbody>
|
|
88
|
+
…
|
|
89
|
+
</tbody>
|
|
90
|
+
<st-empty-state size="sm" heading="No tables yet" description="Create a table to store lookup values." />
|
|
91
|
+
</st-table>
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
The table finds the projected component through the `TABLE_EMPTY_STATE` injection token. The token lives in the dependency-free entry `@sixbell-telco/sdk/components/table/tokens` (re-exported from `@sixbell-telco/sdk/components/table`), so `st-table` and `st-empty-state` do not load each other's shared bundle in Native Federation. A custom empty-state component can provide it: `providers: [{ provide: TABLE_EMPTY_STATE, useExisting: MyEmptyStateComponent }]`.
|
|
@@ -102,35 +102,35 @@ export declare class TableComponent {
|
|
|
102
102
|
* Enable sticky header row
|
|
103
103
|
* @defaultValue false
|
|
104
104
|
*/
|
|
105
|
-
pinRows: import("@angular/core").
|
|
105
|
+
pinRows: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
106
106
|
/**
|
|
107
107
|
* Enable sticky first column
|
|
108
108
|
* @defaultValue false
|
|
109
109
|
*/
|
|
110
|
-
pinColumns: import("@angular/core").
|
|
110
|
+
pinColumns: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
111
111
|
/**
|
|
112
112
|
* Apply zebra-striping to rows
|
|
113
113
|
* @defaultValue false
|
|
114
114
|
*/
|
|
115
|
-
zebra: import("@angular/core").
|
|
115
|
+
zebra: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
116
116
|
/**
|
|
117
117
|
* Show row dividers (borders) between rows
|
|
118
118
|
* @defaultValue false
|
|
119
119
|
*/
|
|
120
|
-
bordered: import("@angular/core").
|
|
120
|
+
bordered: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
121
121
|
/**
|
|
122
122
|
* Highlight body rows on hover with the `--color-table-row-hover` tint (12% `base-content` by default)
|
|
123
123
|
* layered over each cell's own background, so zebra rows and pinned first-column cells follow it
|
|
124
124
|
* @defaultValue true
|
|
125
125
|
*/
|
|
126
|
-
rowHover: import("@angular/core").
|
|
126
|
+
rowHover: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
127
127
|
/**
|
|
128
128
|
* Show a loading state: the projected header and the table frame stay in place and the body
|
|
129
129
|
* shows skeleton rows. The table is marked `aria-busy` and a status message is announced.
|
|
130
130
|
* The empty states are not shown while loading.
|
|
131
131
|
* @defaultValue false
|
|
132
132
|
*/
|
|
133
|
-
loading: import("@angular/core").
|
|
133
|
+
loading: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
134
134
|
/**
|
|
135
135
|
* Number of skeleton rows shown while loading. Defaults to the page size (`pagination.itemsPerPage`).
|
|
136
136
|
* @defaultValue null
|
|
@@ -176,30 +176,31 @@ export declare class TableComponent {
|
|
|
176
176
|
/** Event emitted when page size changes */
|
|
177
177
|
pageSizeChanged: import("@angular/core").OutputEmitterRef<number>;
|
|
178
178
|
readonly ENTRIES: readonly [5, 10, 20, 50, 100];
|
|
179
|
+
private readonly translateLabel;
|
|
179
180
|
readonly entriesPerPageOptions: import("@angular/core").Signal<{
|
|
180
181
|
value: 10 | 5 | 20 | 50 | 100;
|
|
181
|
-
text:
|
|
182
|
+
text: string;
|
|
182
183
|
}[]>;
|
|
183
184
|
/**
|
|
184
185
|
* Show items per page selector
|
|
185
186
|
* @defaultValue true
|
|
186
187
|
*/
|
|
187
|
-
showItemsPerPage: import("@angular/core").
|
|
188
|
+
showItemsPerPage: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
188
189
|
/**
|
|
189
190
|
* Show entries count display
|
|
190
191
|
* @defaultValue true
|
|
191
192
|
*/
|
|
192
|
-
showEntries: import("@angular/core").
|
|
193
|
+
showEntries: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
193
194
|
/**
|
|
194
195
|
* Show pagination controls
|
|
195
196
|
* @defaultValue true
|
|
196
197
|
*/
|
|
197
|
-
showPagination: import("@angular/core").
|
|
198
|
+
showPagination: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
198
199
|
/**
|
|
199
200
|
* Show footer with additional information
|
|
200
201
|
* @defaultValue true
|
|
201
202
|
*/
|
|
202
|
-
showFooter: import("@angular/core").
|
|
203
|
+
showFooter: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
203
204
|
/**
|
|
204
205
|
* Function to determine if any filters are currently active
|
|
205
206
|
* This allows the parent component to define what constitutes an "active filter"
|
|
@@ -210,7 +211,7 @@ export declare class TableComponent {
|
|
|
210
211
|
* or wrap text normally (false)
|
|
211
212
|
* @defaultValue false
|
|
212
213
|
*/
|
|
213
|
-
allowHeaderOverflow: import("@angular/core").
|
|
214
|
+
allowHeaderOverflow: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
214
215
|
/**
|
|
215
216
|
* Computed total number of pages for the internal paginator.
|
|
216
217
|
* Calculated from totalItems and itemsPerPage.
|
|
@@ -281,6 +282,12 @@ export declare class TableComponent {
|
|
|
281
282
|
footerWrapperClass: import("@angular/core").Signal<string>;
|
|
282
283
|
footerDividerClass: import("@angular/core").Signal<string>;
|
|
283
284
|
footerContentClass: import("@angular/core").Signal<string>;
|
|
285
|
+
/**
|
|
286
|
+
* @internal
|
|
287
|
+
* A projected `st-empty-state` replaces the built-in "no data" and "no results" blocks.
|
|
288
|
+
* Only a direct child counts, the same nodes `<ng-content select="st-empty-state">` projects.
|
|
289
|
+
*/
|
|
290
|
+
readonly customEmptyState: import("@angular/core").Signal<unknown>;
|
|
284
291
|
/** @internal Reference to header checkbox component */
|
|
285
292
|
header: import("@angular/core").Signal<TableHeaderCheckboxComponent | undefined>;
|
|
286
293
|
/** @internal List of row checkbox components */
|
|
@@ -304,5 +311,5 @@ export declare class TableComponent {
|
|
|
304
311
|
/** @internal Clear all selections */
|
|
305
312
|
private clearList;
|
|
306
313
|
static ɵfac: i0.ɵɵFactoryDeclaration<TableComponent, never>;
|
|
307
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<TableComponent, "st-table", never, { "size": { "alias": "size"; "required": false; "isSignal": true; }; "height": { "alias": "height"; "required": false; "isSignal": true; }; "pinRows": { "alias": "pinRows"; "required": false; "isSignal": true; }; "pinColumns": { "alias": "pinColumns"; "required": false; "isSignal": true; }; "zebra": { "alias": "zebra"; "required": false; "isSignal": true; }; "bordered": { "alias": "bordered"; "required": false; "isSignal": true; }; "rowHover": { "alias": "rowHover"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "loadingRows": { "alias": "loadingRows"; "required": false; "isSignal": true; }; "paginatorType": { "alias": "paginatorType"; "required": false; "isSignal": true; }; "noDataIcon": { "alias": "noDataIcon"; "required": false; "isSignal": true; }; "noResultsIcon": { "alias": "noResultsIcon"; "required": false; "isSignal": true; }; "data": { "alias": "data"; "required": false; "isSignal": true; }; "totalItems": { "alias": "totalItems"; "required": false; "isSignal": true; }; "pagination": { "alias": "pagination"; "required": false; "isSignal": true; }; "maxSize": { "alias": "maxSize"; "required": false; "isSignal": true; }; "showItemsPerPage": { "alias": "showItemsPerPage"; "required": false; "isSignal": true; }; "showEntries": { "alias": "showEntries"; "required": false; "isSignal": true; }; "showPagination": { "alias": "showPagination"; "required": false; "isSignal": true; }; "showFooter": { "alias": "showFooter"; "required": false; "isSignal": true; }; "hasActiveFiltersCallback": { "alias": "hasActiveFiltersCallback"; "required": false; "isSignal": true; }; "allowHeaderOverflow": { "alias": "allowHeaderOverflow"; "required": false; "isSignal": true; }; }, { "pageChanged": "pageChanged"; "pageSizeChanged": "pageSizeChanged"; "checkedItems": "checkedItems"; }, ["header", "rows"], ["st-table-empty-actions", "thead", "tbody", "tfoot"], true, never>;
|
|
314
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TableComponent, "st-table", never, { "size": { "alias": "size"; "required": false; "isSignal": true; }; "height": { "alias": "height"; "required": false; "isSignal": true; }; "pinRows": { "alias": "pinRows"; "required": false; "isSignal": true; }; "pinColumns": { "alias": "pinColumns"; "required": false; "isSignal": true; }; "zebra": { "alias": "zebra"; "required": false; "isSignal": true; }; "bordered": { "alias": "bordered"; "required": false; "isSignal": true; }; "rowHover": { "alias": "rowHover"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "loadingRows": { "alias": "loadingRows"; "required": false; "isSignal": true; }; "paginatorType": { "alias": "paginatorType"; "required": false; "isSignal": true; }; "noDataIcon": { "alias": "noDataIcon"; "required": false; "isSignal": true; }; "noResultsIcon": { "alias": "noResultsIcon"; "required": false; "isSignal": true; }; "data": { "alias": "data"; "required": false; "isSignal": true; }; "totalItems": { "alias": "totalItems"; "required": false; "isSignal": true; }; "pagination": { "alias": "pagination"; "required": false; "isSignal": true; }; "maxSize": { "alias": "maxSize"; "required": false; "isSignal": true; }; "showItemsPerPage": { "alias": "showItemsPerPage"; "required": false; "isSignal": true; }; "showEntries": { "alias": "showEntries"; "required": false; "isSignal": true; }; "showPagination": { "alias": "showPagination"; "required": false; "isSignal": true; }; "showFooter": { "alias": "showFooter"; "required": false; "isSignal": true; }; "hasActiveFiltersCallback": { "alias": "hasActiveFiltersCallback"; "required": false; "isSignal": true; }; "allowHeaderOverflow": { "alias": "allowHeaderOverflow"; "required": false; "isSignal": true; }; }, { "pageChanged": "pageChanged"; "pageSizeChanged": "pageSizeChanged"; "checkedItems": "checkedItems"; }, ["customEmptyState", "header", "rows"], ["st-empty-state", "st-table-empty-actions", "thead", "tbody", "tfoot"], true, never>;
|
|
308
315
|
}
|
|
@@ -27,6 +27,12 @@ export declare class TableActionComponent {
|
|
|
27
27
|
* Tooltip text (optional).
|
|
28
28
|
*/
|
|
29
29
|
tooltip: import("@angular/core").InputSignal<string | undefined>;
|
|
30
|
+
/**
|
|
31
|
+
* What the action applies to, such as the row's name ("producto ABC"). When set with `tooltip`, the
|
|
32
|
+
* accessible name becomes "<tooltip> <contextLabel>" ("Editar producto ABC") while the tooltip still
|
|
33
|
+
* shows only "Editar", so the name starts with the visible label (WCAG 2.5.3).
|
|
34
|
+
*/
|
|
35
|
+
contextLabel: import("@angular/core").InputSignal<string | null | undefined>;
|
|
30
36
|
/**
|
|
31
37
|
* Tooltip color variant.
|
|
32
38
|
* @defaultValue 'base'
|
|
@@ -45,12 +51,12 @@ export declare class TableActionComponent {
|
|
|
45
51
|
* Disabled state forwarded to the inner button.
|
|
46
52
|
* @defaultValue false
|
|
47
53
|
*/
|
|
48
|
-
disabled: import("@angular/core").
|
|
54
|
+
disabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
49
55
|
/**
|
|
50
56
|
* Stop event propagation for activation events.
|
|
51
57
|
* @defaultValue false
|
|
52
58
|
*/
|
|
53
|
-
stopPropagation: import("@angular/core").
|
|
59
|
+
stopPropagation: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
54
60
|
/**
|
|
55
61
|
* Event emitted on click of the inner button.
|
|
56
62
|
*/
|
|
@@ -64,11 +70,16 @@ export declare class TableActionComponent {
|
|
|
64
70
|
*/
|
|
65
71
|
tableActionClass: import("@angular/core").Signal<string>;
|
|
66
72
|
textPreset: import("@angular/core").Signal<TextPreset>;
|
|
73
|
+
/**
|
|
74
|
+
* @internal
|
|
75
|
+
* The visible tooltip text, followed by the context when one is set.
|
|
76
|
+
*/
|
|
77
|
+
accessibleName(label: string): string;
|
|
67
78
|
/**
|
|
68
79
|
* @internal
|
|
69
80
|
* Forward inner button click as SDK activation outputs.
|
|
70
81
|
*/
|
|
71
82
|
onClicked(event: MouseEvent): void;
|
|
72
83
|
static ɵfac: i0.ɵɵFactoryDeclaration<TableActionComponent, never>;
|
|
73
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<TableActionComponent, "st-table-action", never, { "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "tooltip": { "alias": "tooltip"; "required": false; "isSignal": true; }; "tooltipVariant": { "alias": "tooltipVariant"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "stopPropagation": { "alias": "stopPropagation"; "required": false; "isSignal": true; }; }, { "clicked": "clicked"; "triggered": "triggered"; }, never, ["*"], true, never>;
|
|
84
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TableActionComponent, "st-table-action", never, { "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "tooltip": { "alias": "tooltip"; "required": false; "isSignal": true; }; "contextLabel": { "alias": "contextLabel"; "required": false; "isSignal": true; }; "tooltipVariant": { "alias": "tooltipVariant"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "stopPropagation": { "alias": "stopPropagation"; "required": false; "isSignal": true; }; }, { "clicked": "clicked"; "triggered": "triggered"; }, never, ["*"], true, never>;
|
|
74
85
|
}
|
|
@@ -46,11 +46,22 @@ export declare class TableActionsComponent {
|
|
|
46
46
|
* @defaultValue matMoreVert (Material vertical dots icon)
|
|
47
47
|
*/
|
|
48
48
|
triggerIcon: import("@angular/core").InputSignal<string>;
|
|
49
|
+
/**
|
|
50
|
+
* What the actions apply to, such as the row's name ("producto ABC"). Inline buttons are named
|
|
51
|
+
* "<tooltip> <contextLabel>" and the dropdown trigger "<actions label> <contextLabel>"; the visible
|
|
52
|
+
* tooltips and item labels stay unchanged.
|
|
53
|
+
*/
|
|
54
|
+
contextLabel: import("@angular/core").InputSignal<string | null | undefined>;
|
|
49
55
|
/**
|
|
50
56
|
* Emitted when a data-driven action is triggered/clicked.
|
|
51
57
|
* Emits the full `TableActionConfig` of the triggered action.
|
|
52
58
|
*/
|
|
53
59
|
actionTriggered: import("@angular/core").OutputEmitterRef<TableActionConfig>;
|
|
60
|
+
/**
|
|
61
|
+
* @internal
|
|
62
|
+
* The trigger's own name, followed by the context when one is set.
|
|
63
|
+
*/
|
|
64
|
+
triggerName(label: string): string;
|
|
54
65
|
/**
|
|
55
66
|
* @internal
|
|
56
67
|
* Computed class string for the table actions container (inline mode and ng-content fallback).
|
|
@@ -67,5 +78,5 @@ export declare class TableActionsComponent {
|
|
|
67
78
|
*/
|
|
68
79
|
onActionClick(action: TableActionConfig): void;
|
|
69
80
|
static ɵfac: i0.ɵɵFactoryDeclaration<TableActionsComponent, never>;
|
|
70
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<TableActionsComponent, "st-table-actions", never, { "actions": { "alias": "actions"; "required": false; "isSignal": true; }; "mode": { "alias": "mode"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "triggerIcon": { "alias": "triggerIcon"; "required": false; "isSignal": true; }; }, { "actionTriggered": "actionTriggered"; }, never, ["*"], true, never>;
|
|
81
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TableActionsComponent, "st-table-actions", never, { "actions": { "alias": "actions"; "required": false; "isSignal": true; }; "mode": { "alias": "mode"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "triggerIcon": { "alias": "triggerIcon"; "required": false; "isSignal": true; }; "contextLabel": { "alias": "contextLabel"; "required": false; "isSignal": true; }; }, { "actionTriggered": "actionTriggered"; }, never, ["*"], true, never>;
|
|
71
82
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Table tokens
|
|
2
|
+
|
|
3
|
+
Import: `@sixbell-telco/sdk/components/table/tokens`
|
|
4
|
+
|
|
5
|
+
Dependency-free injection tokens shared by `st-table` and the components it projects.
|
|
6
|
+
|
|
7
|
+
- `TABLE_EMPTY_STATE`: provided by `st-empty-state`; `st-table` queries it to replace its built-in "no data" / "no results" blocks. Also re-exported from `@sixbell-telco/sdk/components/table`.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './table-empty-state';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
/**
|
|
3
|
+
* Marker an empty-state component provides so `st-table` can project it in place of its built-in
|
|
4
|
+
* "no data" / "no results" blocks without importing that component.
|
|
5
|
+
*/
|
|
6
|
+
export declare const TABLE_EMPTY_STATE: InjectionToken<unknown>;
|
|
@@ -10,20 +10,38 @@ Hover or focus hint backed by direct CDK connected-overlay positioning. Use
|
|
|
10
10
|
## Usage
|
|
11
11
|
|
|
12
12
|
```html
|
|
13
|
-
<st-tooltip label="
|
|
14
|
-
<st-button>
|
|
13
|
+
<st-tooltip label="Ctrl+K opens search" position="top">
|
|
14
|
+
<st-button variant="tertiary" [outline]="true">Show shortcut</st-button>
|
|
15
15
|
</st-tooltip>
|
|
16
16
|
```
|
|
17
17
|
|
|
18
18
|
## Behavior
|
|
19
19
|
|
|
20
|
+
- It shows on pointer hover and on keyboard focus (`:focus-visible`), not on the
|
|
21
|
+
focus a mouse click leaves behind. It hides on pointer leave, blur and Escape
|
|
22
|
+
(Escape works while hovered, wherever focus is). The tooltip is hoverable: it
|
|
23
|
+
waits `closeDelay` ms (default 120, `0` hides at once) after the pointer leaves,
|
|
24
|
+
so the pointer can move onto it. Pressing or activating the
|
|
25
|
+
trigger (mouse, Enter or Space) hides it until the next hover or keyboard
|
|
26
|
+
focus, even when the projected control stops propagation, so a click never
|
|
27
|
+
leaves it pinned (WCAG 1.4.13, APG tooltip pattern).
|
|
20
28
|
- `position` selects the primary side; CDK repositions through the opposite and
|
|
21
29
|
orthogonal sides when the viewport requires it, and closes when the origin is
|
|
22
30
|
outside the view.
|
|
23
|
-
-
|
|
24
|
-
|
|
25
|
-
|
|
31
|
+
- Escape comes through the CDK overlay keyboard stack, so it reaches the tooltip
|
|
32
|
+
only while it is the top layer: inside `st-dialog` the first Escape closes the
|
|
33
|
+
tooltip and the next one the dialog.
|
|
34
|
+
- The tooltip portal inherits the trigger's `data-theme`. A `hidden`
|
|
35
|
+
`role="tooltip"` element next to the trigger carries the text at all times. It
|
|
36
|
+
stays out of the reading order, but the trigger's `aria-describedby` still
|
|
37
|
+
resolves it, also while the tooltip is closed (for example after a mouse
|
|
38
|
+
click). The visible portaled pane is `aria-hidden`, so the text is announced
|
|
39
|
+
once. Focused triggers receive the `aria-describedby` reference, and it is
|
|
40
|
+
removed on blur. A trigger whose accessible name already contains the tooltip
|
|
41
|
+
text (an icon button with its own label, `st-table-action` with `contextLabel`)
|
|
42
|
+
is not described, so the text is not read twice.
|
|
26
43
|
- Rich content is descriptive and portal-only. Keep interactive controls in the
|
|
27
44
|
trigger or use a component designed for interactive overlays.
|
|
28
|
-
- Open and close states settle after the
|
|
29
|
-
|
|
45
|
+
- Open and close states settle after the shared popover motion
|
|
46
|
+
(`popover-motion`), which starts once the CDK placed the pane. Under reduced
|
|
47
|
+
motion the pane only fades, without changing tooltip semantics.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CdkOverlayOrigin, ConnectedOverlayPositionChange, ConnectedPosition, FlexibleConnectedPositionStrategy, ScrollStrategy } from '@angular/cdk/overlay';
|
|
2
|
+
import { PopoverMotionState, PopoverPlacement } from '@sixbell-telco/sdk/utils/popover-motion';
|
|
2
3
|
import { ThemeDomService } from '@sixbell-telco/sdk/utils/theme';
|
|
3
4
|
import { TooltipContentComponent } from '../tooltip-content/tooltip-content.component';
|
|
4
5
|
import * as i0 from "@angular/core";
|
|
@@ -19,8 +20,6 @@ export type TooltipProps = {
|
|
|
19
20
|
variant?: TooltipVariantProps;
|
|
20
21
|
position?: TooltipPositionProps;
|
|
21
22
|
};
|
|
22
|
-
type TooltipSide = 'top' | 'bottom' | 'right' | 'left';
|
|
23
|
-
type TooltipPhase = 'closed' | 'opening' | 'open' | 'closing';
|
|
24
23
|
/**
|
|
25
24
|
* A customizable tooltip component with multiple variants and content options
|
|
26
25
|
*
|
|
@@ -81,6 +80,12 @@ export declare class TooltipComponent {
|
|
|
81
80
|
* @defaultValue 'left'
|
|
82
81
|
*/
|
|
83
82
|
iconPosition: import("@angular/core").InputSignal<"right" | "left" | null | undefined>;
|
|
83
|
+
/**
|
|
84
|
+
* Delay in milliseconds before the tooltip hides after the pointer leaves the trigger or the tooltip,
|
|
85
|
+
* so the pointer can cross the gap onto the tooltip (WCAG 1.4.13 hoverable). `0` hides immediately.
|
|
86
|
+
* @defaultValue 120
|
|
87
|
+
*/
|
|
88
|
+
closeDelay: import("@angular/core").InputSignalWithTransform<number, unknown>;
|
|
84
89
|
/**
|
|
85
90
|
* @internal
|
|
86
91
|
* Reference to custom tooltip content component
|
|
@@ -93,17 +98,24 @@ export declare class TooltipComponent {
|
|
|
93
98
|
* Computed flag indicating presence of custom content
|
|
94
99
|
*/
|
|
95
100
|
hasCustomContent: import("@angular/core").Signal<boolean>;
|
|
101
|
+
/** @internal Plain-text description the trigger's `aria-describedby` resolves to, open or closed. */
|
|
102
|
+
protected readonly descriptionText: import("@angular/core").Signal<string>;
|
|
96
103
|
private readonly hasTooltipContent;
|
|
97
104
|
private readonly requestedOpen;
|
|
98
105
|
private readonly pointerInside;
|
|
106
|
+
private readonly pointerOverPane;
|
|
107
|
+
private closeTimer;
|
|
99
108
|
private readonly focusedTarget;
|
|
100
|
-
private readonly
|
|
109
|
+
private readonly keyboardFocused;
|
|
110
|
+
/** Set by a press, an activation or Escape; only a fresh pointer enter or keyboard focus clears it. */
|
|
111
|
+
private readonly dismissed;
|
|
101
112
|
protected readonly renderedOpen: import("@angular/core").WritableSignal<boolean>;
|
|
102
|
-
protected readonly phase: import("@angular/core").WritableSignal<
|
|
113
|
+
protected readonly phase: import("@angular/core").WritableSignal<PopoverMotionState>;
|
|
103
114
|
private readonly activePosition;
|
|
104
|
-
private readonly
|
|
115
|
+
private readonly closingPlacement;
|
|
105
116
|
private transitionToken;
|
|
106
117
|
protected readonly tooltipId: string;
|
|
118
|
+
protected readonly paneId: string;
|
|
107
119
|
protected readonly origin: import("@angular/core").Signal<CdkOverlayOrigin>;
|
|
108
120
|
private animationFallbackHandle;
|
|
109
121
|
protected readonly triggerTabIndexValue: import("@angular/core").WritableSignal<number | null>;
|
|
@@ -113,16 +125,20 @@ export declare class TooltipComponent {
|
|
|
113
125
|
*/
|
|
114
126
|
componentClass: import("@angular/core").Signal<string>;
|
|
115
127
|
constructor();
|
|
128
|
+
/**
|
|
129
|
+
* Capture phase, so a projected control that stops propagation (`st-button [stopPropagation]`) still
|
|
130
|
+
* dismisses it. `click` also covers keyboard activation (Enter/Space), which has no pointerdown.
|
|
131
|
+
*/
|
|
132
|
+
private listenForPress;
|
|
116
133
|
protected readonly positions: import("@angular/core").Signal<ConnectedPosition[]>;
|
|
117
134
|
private primaryPosition;
|
|
118
135
|
private oppositeSide;
|
|
119
136
|
private orthogonalSides;
|
|
120
137
|
private sideFromPair;
|
|
121
|
-
|
|
138
|
+
/** Real placement of the pane, bound to `data-side` / `data-align`; null until the CDK places it */
|
|
139
|
+
protected readonly placement: import("@angular/core").Signal<PopoverPlacement | null>;
|
|
122
140
|
protected readonly tooltipClasses: import("@angular/core").Signal<string>;
|
|
123
|
-
protected readonly transformOrigin: import("@angular/core").Signal<string>;
|
|
124
141
|
protected tooltipAnimationClass(): string;
|
|
125
|
-
private expectedTooltipAnimationName;
|
|
126
142
|
private hasFocusableDescendant;
|
|
127
143
|
protected resolveFocusTarget(event: FocusEvent): HTMLElement | null;
|
|
128
144
|
protected syncDescribedBy(target: HTMLElement | null): void;
|
|
@@ -130,11 +146,26 @@ export declare class TooltipComponent {
|
|
|
130
146
|
protected requestOpen(next: boolean): void;
|
|
131
147
|
protected onPointerEnter(): void;
|
|
132
148
|
protected onPointerLeave(): void;
|
|
149
|
+
/** The pointer may move onto the tooltip without hiding it (WCAG 1.4.13 hoverable). */
|
|
150
|
+
protected onPaneEnter(): void;
|
|
151
|
+
protected onPaneLeave(): void;
|
|
152
|
+
private scheduleClose;
|
|
153
|
+
private clearCloseTimer;
|
|
154
|
+
/**
|
|
155
|
+
* Only keyboard focus (`:focus-visible`) opens or keeps the tooltip open. Focus caused by a mouse press,
|
|
156
|
+
* or restored by a dialog after one, describes the control but never shows or pins the tooltip.
|
|
157
|
+
*/
|
|
133
158
|
protected onFocusIn(event: FocusEvent): void;
|
|
134
|
-
/** Pressing the trigger dismisses the tooltip until a fresh pointer enter or keyboard focus. */
|
|
159
|
+
/** Pressing or activating the trigger dismisses the tooltip until a fresh pointer enter or keyboard focus. */
|
|
135
160
|
protected onPress(): void;
|
|
136
161
|
protected onFocusOut(event: FocusEvent): void;
|
|
137
|
-
|
|
162
|
+
/**
|
|
163
|
+
* Escape arrives through the CDK overlay keyboard stack, which hands it only to the topmost overlay that
|
|
164
|
+
* listens. While the tooltip is the top layer it closes the tooltip alone; an enclosing `st-dialog`
|
|
165
|
+
* keeps its own Escape for the next press, and a menu opened above the tooltip keeps this one.
|
|
166
|
+
*/
|
|
167
|
+
protected onOverlayKeydown(event: KeyboardEvent): void;
|
|
168
|
+
/** The first position of an open cycle starts the entrance (`data-side`), so its fallback is measured then */
|
|
138
169
|
protected onTooltipPositionChange(event: ConnectedOverlayPositionChange): void;
|
|
139
170
|
protected tooltipPositionStrategy(): FlexibleConnectedPositionStrategy;
|
|
140
171
|
private isOriginOutsideView;
|
|
@@ -143,9 +174,10 @@ export declare class TooltipComponent {
|
|
|
143
174
|
protected onTooltipDetach(): void;
|
|
144
175
|
private settleTooltipOpening;
|
|
145
176
|
private settleTooltipClosing;
|
|
177
|
+
/** Measure the fallback once the next render applied the phase (and `data-side`), so the computed animation is the real one */
|
|
178
|
+
private deferTooltipAnimationFallback;
|
|
146
179
|
private scheduleTooltipAnimationFallback;
|
|
147
180
|
private clearTooltipAnimationFallback;
|
|
148
181
|
static ɵfac: i0.ɵɵFactoryDeclaration<TooltipComponent, never>;
|
|
149
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<TooltipComponent, "st-tooltip", never, { "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "position": { "alias": "position"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "iconPosition": { "alias": "iconPosition"; "required": false; "isSignal": true; }; }, {}, ["customContent", "richContentElement"], ["st-tooltip-content", "*"], true, never>;
|
|
182
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TooltipComponent, "st-tooltip", never, { "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "position": { "alias": "position"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "iconPosition": { "alias": "iconPosition"; "required": false; "isSignal": true; }; "closeDelay": { "alias": "closeDelay"; "required": false; "isSignal": true; }; }, {}, ["customContent", "richContentElement"], ["st-tooltip-content", "*"], true, never>;
|
|
150
183
|
}
|
|
151
|
-
export {};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Tree
|
|
2
|
+
|
|
3
|
+
Import: `@sixbell-telco/sdk/components/tree`
|
|
4
|
+
|
|
5
|
+
Selector: `st-tree` (actions template: `ng-template[stTreeNodeActions]`)
|
|
6
|
+
|
|
7
|
+
Single-select tree for hierarchies of any depth (categories, groups), with a
|
|
8
|
+
filter, count badges, controlled selection and expansion, an empty state and
|
|
9
|
+
optional per-node actions.
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```html
|
|
14
|
+
<st-tree label="Categories" [nodes]="nodes" [filter]="query()" [(selectedId)]="selectedId" [(expandedIds)]="expandedIds">
|
|
15
|
+
<ng-template stTreeNodeActions let-node let-level="level">
|
|
16
|
+
<st-button
|
|
17
|
+
variant="primary"
|
|
18
|
+
size="xs"
|
|
19
|
+
[ghost]="true"
|
|
20
|
+
[square]="true"
|
|
21
|
+
[icon]="plus"
|
|
22
|
+
[ariaLabel]="'Add under ' + node.label"
|
|
23
|
+
(triggered)="add(node)"
|
|
24
|
+
/>
|
|
25
|
+
<st-button variant="warning" size="xs" [ghost]="true" [square]="true" [icon]="edit" [ariaLabel]="'Edit ' + node.label" (triggered)="edit(node)" />
|
|
26
|
+
</ng-template>
|
|
27
|
+
</st-tree>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
```ts
|
|
31
|
+
nodes: TreeNode[] = [
|
|
32
|
+
{ id: 'delivery', label: 'Delivery', badge: 12, children: [{ id: 'express', label: 'Express', badge: 4 }] },
|
|
33
|
+
{ id: 'billing', label: 'Billing' },
|
|
34
|
+
];
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
| Input | Default | Purpose |
|
|
38
|
+
| --------------------- | ------- | -------------------------------------------------------------------------- |
|
|
39
|
+
| `nodes` | - | Required. `{ id, label, badge?, icon?, children?, data? }`, any depth |
|
|
40
|
+
| `label` | `Tree` | Accessible name of the tree (translated default `sdk.tree.label`) |
|
|
41
|
+
| `filter` | `''` | Case-insensitive label filter; matches keep their ancestors, expanded |
|
|
42
|
+
| `selectedId` (model) | `null` | Selected node id, two-way with `[(selectedId)]` |
|
|
43
|
+
| `expandedIds` (model) | `[]` | Expanded branch ids, two-way with `[(expandedIds)]` (ignored if filtering) |
|
|
44
|
+
| `actionsLabel` | auto | Name of the actions group (default `sdk.tree.actions`, "Actions for ...") |
|
|
45
|
+
| `emptyHeading` | auto | Empty-state heading (defaults `sdk.tree.empty` / `sdk.tree.noResults`) |
|
|
46
|
+
| `emptyDescription` | auto | Empty-state description |
|
|
47
|
+
| `class` | `''` | Extra classes merged onto the host |
|
|
48
|
+
|
|
49
|
+
Rows are 32px, indented 20px per level, with a layers icon for branches and a
|
|
50
|
+
tune icon for leaves (override per node with `icon`). Selected rows use the soft
|
|
51
|
+
primary tint, hover uses `base-content/10`.
|
|
52
|
+
|
|
53
|
+
`TreeNode<T>` carries your own payload in `data`; the actions template receives
|
|
54
|
+
the node (`$implicit`), its zero-based `level` and `expanded`.
|
|
55
|
+
|
|
56
|
+
## Node actions
|
|
57
|
+
|
|
58
|
+
The template renders for the node whose actions hold focus, else the **hovered** one, else the **selected** one, inside a `role="group"`
|
|
59
|
+
toolbar that is a sibling of the tree (never inside a treeitem), laid over the end
|
|
60
|
+
of that row and next in the tab order. Hovering a row shows its actions too (as in the Figma Tree / Item); this adds to the keyboard path, which is unchanged. While focus is inside the actions, hover cannot move them to another row (not even when focus moves between two action buttons), and a click always acts on the node the group is showing. Tab from a tree row goes to the actions of the **selected** node even if the pointer rests on another row, Shift+Tab returns, and Escape inside the actions returns focus to the row they belong to. Give every action button an accessible name that includes the node label. Node actions follow the row-action roles: add `primary`, edit `warning`, delete `error`, all `ghost`.
|
|
61
|
+
|
|
62
|
+
## Accessibility
|
|
63
|
+
|
|
64
|
+
- WAI-ARIA APG treeview: `role="tree"` / `treeitem`, `aria-level`, `aria-setsize`,
|
|
65
|
+
`aria-posinset`, `aria-expanded` on branches, `aria-selected` on every row.
|
|
66
|
+
- One tab stop (roving tabindex): the last focused row, else the selected one, else the first.
|
|
67
|
+
- Up/Down move, Right expands or enters the first child, Left collapses or returns
|
|
68
|
+
to the parent, Home/End jump, typing a character jumps to the next label that
|
|
69
|
+
starts with it (Space joins the typed text while a type-ahead is in progress), `*` expands every sibling branch, Enter/Space select. Clicking the chevron toggles; clicking the row selects.
|
|
70
|
+
- While filtering, Left/Right still collapse and expand matches until the filter changes.
|
|
71
|
+
- The badge is read with the label (for example "Delivery 12"); keep it meaningful.
|
|
72
|
+
- With no rows (no nodes, or no match) the tree is replaced by `st-empty-state`, since an empty `role="tree"` is invalid.
|
|
73
|
+
- The focus ring stays visible and transitions respect `motion-reduce`.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src/tree.component';
|