@ids-group-ltd/ids-design-system 0.14.8 → 0.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1145 -234
- package/components.md +122 -53
- package/docs/agent/INDEX.md +5 -3
- package/docs/agent/charts/column-series-component.md +1 -1
- package/docs/agent/charts/ds-bar-chart.md +7 -4
- package/docs/agent/charts/ds-chart.md +1 -1
- package/docs/agent/charts/ds-column-chart.md +2 -1
- package/docs/agent/charts/ds-funnel-chart.md +1 -1
- package/docs/agent/charts/ds-heatmap-chart.md +2 -1
- package/docs/agent/charts/ds-line-chart.md +3 -3
- package/docs/agent/charts/ds-pie-chart.md +3 -2
- package/docs/agent/charts/ds-scatter-chart.md +2 -1
- package/docs/agent/charts/ds-waterfall-chart.md +2 -2
- package/docs/agent/charts/line-series-component.md +1 -1
- package/docs/agent/feedback/ds-alert.md +1 -0
- package/docs/agent/feedback/ds-banner.md +1 -0
- package/docs/agent/feedback/ds-loading-overlay.md +2 -0
- package/docs/agent/feedback/ds-skeleton.md +1 -1
- package/docs/agent/feedback/ds-toast.md +2 -0
- package/docs/agent/forms/ds-autocomplete.md +1 -1
- package/docs/agent/forms/ds-button.md +1 -0
- package/docs/agent/forms/ds-checkbox.md +1 -1
- package/docs/agent/forms/ds-color-picker.md +1 -1
- package/docs/agent/forms/ds-date-picker.md +2 -1
- package/docs/agent/forms/ds-icon-button.md +1 -1
- package/docs/agent/forms/ds-input.md +1 -1
- package/docs/agent/forms/ds-multi-select.md +1 -1
- package/docs/agent/forms/ds-otp-input.md +1 -1
- package/docs/agent/forms/ds-radio-group.md +1 -1
- package/docs/agent/forms/ds-segmented.md +1 -1
- package/docs/agent/forms/ds-select.md +1 -1
- package/docs/agent/forms/ds-slider.md +1 -1
- package/docs/agent/forms/ds-switch.md +1 -1
- package/docs/agent/forms/ds-textarea.md +1 -1
- package/docs/agent/forms/ds-time-picker.md +1 -1
- package/docs/agent/forms/the-picker-family-ds-select-ds-multi-select-ds-autocomplete.md +1 -1
- package/docs/agent/foundations/global-helper-classes.md +4 -4
- package/docs/agent/foundations/tokens.md +1 -1
- package/docs/agent/navigation/ds-pagination.md +2 -1
- package/docs/agent/overlays/ds-bottom-sheet.md +1 -1
- package/docs/agent/overlays/ds-definition-term.md +10 -0
- package/docs/agent/overlays/ds-drawer.md +1 -1
- package/docs/agent/overlays/ds-info-hint.md +29 -0
- package/docs/agent/overlays/ds-menu.md +1 -1
- package/docs/agent/overlays/ds-modal-card.md +1 -1
- package/docs/agent/overlays/ds-modal.md +19 -1
- package/docs/agent/overlays/ds-tooltip-panel.md +1 -1
- package/docs/agent/overlays/ds-tooltip.md +3 -3
- package/docs/agent/tables/ds-table-columns.md +2 -0
- package/docs/agent/tables/ds-table.md +4 -3
- package/eslint/deprecated-api.json +889 -0
- package/eslint/index.mjs +394 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-accordion.mjs +4 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-accordion.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-alert.mjs +6 -3
- package/fesm2022/ids-group-ltd-ids-design-system-components-alert.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-app-layout.mjs +6 -12
- package/fesm2022/ids-group-ltd-ids-design-system-components-app-layout.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-auth-layout.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-auth-layout.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-autocomplete.mjs +27 -9
- package/fesm2022/ids-group-ltd-ids-design-system-components-autocomplete.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-avatar-group.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-avatar-group.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-avatar.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-avatar.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-badge.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-badge.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-banner.mjs +6 -3
- package/fesm2022/ids-group-ltd-ids-design-system-components-banner.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-bar-chart.mjs +169 -37
- package/fesm2022/ids-group-ltd-ids-design-system-components-bar-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-bar.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-bar.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-bottom-sheet.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-bottom-sheet.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-breadcrumbs.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-breadcrumbs.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-button-group.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-button-group.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-button.mjs +8 -9
- package/fesm2022/ids-group-ltd-ids-design-system-components-button.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-calendar-day.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-calendar-day.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-card.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-card.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-data-table.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-data-table.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-legend.mjs +7 -17
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-legend.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-tooltip.mjs +875 -90
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-tooltip.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart.mjs +2183 -1232
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-checkbox.mjs +10 -5
- package/fesm2022/ids-group-ltd-ids-design-system-components-checkbox.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-color-picker.mjs +15 -5
- package/fesm2022/ids-group-ltd-ids-design-system-components-color-picker.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-column-chart.mjs +50 -11
- package/fesm2022/ids-group-ltd-ids-design-system-components-column-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-date-picker.mjs +22 -6
- package/fesm2022/ids-group-ltd-ids-design-system-components-date-picker.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-definition-term.mjs +107 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-definition-term.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-description-list.mjs +4 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-description-list.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-divider.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-divider.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-drawer.mjs +5 -15
- package/fesm2022/ids-group-ltd-ids-design-system-components-drawer.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-dropzone.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-dropzone.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-empty-state.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-empty-state.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-field-group.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-field-group.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-field-message.mjs +44 -5
- package/fesm2022/ids-group-ltd-ids-design-system-components-field-message.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-filter-bar.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-filter-bar.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-funnel-chart.mjs +11 -22
- package/fesm2022/ids-group-ltd-ids-design-system-components-funnel-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-heatmap-chart.mjs +51 -21
- package/fesm2022/ids-group-ltd-ids-design-system-components-heatmap-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-icon-button.mjs +5 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-icon-button.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-info-hint.mjs +110 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-info-hint.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-input.mjs +11 -7
- package/fesm2022/ids-group-ltd-ids-design-system-components-input.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-layout.mjs +6 -6
- package/fesm2022/ids-group-ltd-ids-design-system-components-layout.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-line-chart.mjs +41 -46
- package/fesm2022/ids-group-ltd-ids-design-system-components-line-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-list.mjs +4 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-list.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-loading-overlay.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-loading-overlay.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-menu.mjs +183 -31
- package/fesm2022/ids-group-ltd-ids-design-system-components-menu.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-modal.mjs +21 -26
- package/fesm2022/ids-group-ltd-ids-design-system-components-modal.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-multi-select.mjs +27 -9
- package/fesm2022/ids-group-ltd-ids-design-system-components-multi-select.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-number-stepper.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-number-stepper.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-otp-input.mjs +10 -5
- package/fesm2022/ids-group-ltd-ids-design-system-components-otp-input.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-page-footer.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-page-footer.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-page-header.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-page-header.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-pagination.mjs +14 -6
- package/fesm2022/ids-group-ltd-ids-design-system-components-pagination.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-password-rules.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-password-rules.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-pie-chart.mjs +106 -29
- package/fesm2022/ids-group-ltd-ids-design-system-components-pie-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-popover.mjs +7 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-popover.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-radio-group.mjs +12 -7
- package/fesm2022/ids-group-ltd-ids-design-system-components-radio-group.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-scatter-chart.mjs +140 -26
- package/fesm2022/ids-group-ltd-ids-design-system-components-scatter-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-search.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-search.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-segmented.mjs +10 -5
- package/fesm2022/ids-group-ltd-ids-design-system-components-segmented.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-select.mjs +29 -9
- package/fesm2022/ids-group-ltd-ids-design-system-components-select.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-show-dirty.mjs +55 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-show-dirty.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav-footer.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav-footer.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav.mjs +6 -6
- package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-skeleton.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-skeleton.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-slider.mjs +10 -5
- package/fesm2022/ids-group-ltd-ids-design-system-components-slider.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-sparkline.mjs +5 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-sparkline.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-spinner.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-spinner.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-split-button.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-split-button.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-stat.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-stat.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-status-dot.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-status-dot.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-stepper.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-stepper.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-switch.mjs +10 -5
- package/fesm2022/ids-group-ltd-ids-design-system-components-switch.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-table-columns.mjs +36 -18
- package/fesm2022/ids-group-ltd-ids-design-system-components-table-columns.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-table-export.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-table-export.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-table-resize.mjs +17 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-table-resize.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs +193 -19
- package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-tabs.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-tabs.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-tag.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-tag.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-textarea.mjs +15 -5
- package/fesm2022/ids-group-ltd-ids-design-system-components-textarea.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-time-picker.mjs +26 -9
- package/fesm2022/ids-group-ltd-ids-design-system-components-time-picker.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-timeline.mjs +4 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-timeline.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-toast.mjs +20 -5
- package/fesm2022/ids-group-ltd-ids-design-system-components-toast.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-toggle-button.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-toggle-button.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-tooltip.mjs +434 -157
- package/fesm2022/ids-group-ltd-ids-design-system-components-tooltip.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-topbar.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-topbar.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-tree.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-tree.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-w3w.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-w3w.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-waterfall-chart.mjs +18 -11
- package/fesm2022/ids-group-ltd-ids-design-system-components-waterfall-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components.mjs +323 -68
- package/fesm2022/ids-group-ltd-ids-design-system-components.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-core.mjs +27 -83
- package/fesm2022/ids-group-ltd-ids-design-system-core.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-icons.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-icons.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-overlay.mjs +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-overlay.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system.mjs +3 -0
- package/fesm2022/ids-group-ltd-ids-design-system.mjs.map +1 -1
- package/migrations/0.10.0.json +79 -21
- package/migrations/0.10.1.json +38 -21
- package/migrations/0.10.2.json +44 -7
- package/migrations/0.10.3.json +7 -5
- package/migrations/0.11.0.json +10 -7
- package/migrations/0.11.1.json +25 -14
- package/migrations/0.11.2.json +3 -3
- package/migrations/0.11.3.json +9 -6
- package/migrations/0.11.4.json +13 -12
- package/migrations/0.12.1.json +41 -14
- package/migrations/0.12.2.json +7 -6
- package/migrations/0.12.3.json +3 -3
- package/migrations/0.13.0.json +11 -11
- package/migrations/0.13.1.json +60 -8
- package/migrations/0.13.2.json +98 -44
- package/migrations/0.13.3.json +46 -16
- package/migrations/0.13.4.json +23 -22
- package/migrations/0.14.0.json +5 -5
- package/migrations/0.14.1.json +5 -5
- package/migrations/0.14.2.json +1 -1
- package/migrations/0.14.4.json +6 -5
- package/migrations/0.14.5.json +13 -7
- package/migrations/0.14.6.json +2 -2
- package/migrations/0.14.8.json +26 -2
- package/migrations/0.15.0.json +999 -0
- package/migrations/0.15.1.json +738 -0
- package/migrations/0.2.0.json +2 -2
- package/migrations/0.3.0.json +43 -6
- package/migrations/0.4.0.json +95 -13
- package/migrations/0.5.0.json +116 -10
- package/migrations/0.5.1.json +97 -11
- package/migrations/0.6.0.json +30 -1
- package/migrations/0.6.1.json +22 -1
- package/migrations/0.6.2.json +8 -4
- package/migrations/0.6.3.json +17 -5
- package/migrations/0.7.0.json +58 -9
- package/migrations/0.7.1.json +62 -8
- package/migrations/0.8.0.json +60 -12
- package/migrations/0.9.0.json +68 -25
- package/migrations/0.9.1.json +1 -1
- package/migrations/README.md +57 -3
- package/package.json +27 -1
- package/schematics/check-overrides/index.cjs +4 -11
- package/schematics/check-overrides/scan.cjs +12 -1
- package/schematics/check-overrides/surface.json +94 -11
- package/schematics/ng-add/index.cjs +7 -1
- package/stylelint/deprecated-tokens.json +2711 -0
- package/stylelint/index.mjs +94 -0
- package/stylelint/since-version.mjs +26 -0
- package/styles/_chart-frame.scss +14 -0
- package/styles/_chart-interactive.scss +26 -1
- package/styles/_chart-motion.scss +50 -17
- package/styles/_chip-row.scss +5 -2
- package/styles/_clear-button.scss +2 -0
- package/styles/_component-base.scss +56 -0
- package/styles/_dismiss-button.scss +16 -0
- package/styles/_dropdown-overlay.scss +19 -0
- package/styles/_focus.scss +4 -1
- package/styles/_link.scss +35 -12
- package/styles/_overlay-motion.scss +4 -6
- package/styles/_pinned.scss +43 -0
- package/styles/_skeleton-shimmer.scss +2 -8
- package/styles/_table-controls.scss +4 -0
- package/styles/_target.scss +40 -0
- package/styles/_text-clip.scss +23 -4
- package/styles/_tokens.scss +3 -1
- package/styles/_typography.scss +2 -0
- package/styles/_visually-hidden.scss +2 -0
- package/styles/ds.scss +0 -1
- package/themes/README.md +60 -7
- package/themes/_semantic.scss +5 -8
- package/themes/dark/_theme.scss +5 -8
- package/types/ids-group-ltd-ids-design-system-components-alert.d.ts +1 -1
- package/types/ids-group-ltd-ids-design-system-components-autocomplete.d.ts +6 -1
- package/types/ids-group-ltd-ids-design-system-components-banner.d.ts +1 -1
- package/types/ids-group-ltd-ids-design-system-components-bar-chart.d.ts +74 -4
- package/types/ids-group-ltd-ids-design-system-components-button.d.ts +3 -2
- package/types/ids-group-ltd-ids-design-system-components-chart-legend.d.ts +4 -4
- package/types/ids-group-ltd-ids-design-system-components-chart-tooltip.d.ts +87 -7
- package/types/ids-group-ltd-ids-design-system-components-chart.d.ts +207 -29
- package/types/ids-group-ltd-ids-design-system-components-checkbox.d.ts +2 -0
- package/types/ids-group-ltd-ids-design-system-components-color-picker.d.ts +2 -0
- package/types/ids-group-ltd-ids-design-system-components-column-chart.d.ts +30 -4
- package/types/ids-group-ltd-ids-design-system-components-date-picker.d.ts +3 -1
- package/types/ids-group-ltd-ids-design-system-components-definition-term.d.ts +22 -0
- package/types/ids-group-ltd-ids-design-system-components-drawer.d.ts +0 -1
- package/types/ids-group-ltd-ids-design-system-components-field-message.d.ts +19 -2
- package/types/ids-group-ltd-ids-design-system-components-funnel-chart.d.ts +7 -6
- package/types/ids-group-ltd-ids-design-system-components-heatmap-chart.d.ts +22 -8
- package/types/ids-group-ltd-ids-design-system-components-icon-button.d.ts +3 -2
- package/types/ids-group-ltd-ids-design-system-components-info-hint.d.ts +23 -0
- package/types/ids-group-ltd-ids-design-system-components-input.d.ts +2 -0
- package/types/ids-group-ltd-ids-design-system-components-line-chart.d.ts +18 -7
- package/types/ids-group-ltd-ids-design-system-components-menu.d.ts +14 -3
- package/types/ids-group-ltd-ids-design-system-components-modal.d.ts +0 -2
- package/types/ids-group-ltd-ids-design-system-components-multi-select.d.ts +6 -1
- package/types/ids-group-ltd-ids-design-system-components-otp-input.d.ts +2 -0
- package/types/ids-group-ltd-ids-design-system-components-pagination.d.ts +5 -3
- package/types/ids-group-ltd-ids-design-system-components-pie-chart.d.ts +26 -7
- package/types/ids-group-ltd-ids-design-system-components-popover.d.ts +2 -1
- package/types/ids-group-ltd-ids-design-system-components-radio-group.d.ts +2 -0
- package/types/ids-group-ltd-ids-design-system-components-scatter-chart.d.ts +52 -10
- package/types/ids-group-ltd-ids-design-system-components-segmented.d.ts +2 -0
- package/types/ids-group-ltd-ids-design-system-components-select.d.ts +6 -1
- package/types/ids-group-ltd-ids-design-system-components-show-dirty.d.ts +29 -0
- package/types/ids-group-ltd-ids-design-system-components-slider.d.ts +2 -0
- package/types/ids-group-ltd-ids-design-system-components-switch.d.ts +2 -0
- package/types/ids-group-ltd-ids-design-system-components-table-resize.d.ts +2 -0
- package/types/ids-group-ltd-ids-design-system-components-table.d.ts +39 -9
- package/types/ids-group-ltd-ids-design-system-components-textarea.d.ts +2 -0
- package/types/ids-group-ltd-ids-design-system-components-time-picker.d.ts +3 -1
- package/types/ids-group-ltd-ids-design-system-components-toast.d.ts +2 -0
- package/types/ids-group-ltd-ids-design-system-components-tooltip.d.ts +54 -24
- package/types/ids-group-ltd-ids-design-system-components-waterfall-chart.d.ts +9 -2
- package/types/ids-group-ltd-ids-design-system-components.d.ts +135 -35
- package/types/ids-group-ltd-ids-design-system-core.d.ts +46 -23
- package/types/ids-group-ltd-ids-design-system.d.ts +6 -3
|
@@ -1,31 +1,274 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, ViewEncapsulation, Component, inject, ElementRef, booleanAttribute, afterNextRender, HostListener, Directive } from '@angular/core';
|
|
2
|
+
import { input, computed, TemplateRef, ViewEncapsulation, Component, InjectionToken, inject, ElementRef, DOCUMENT, booleanAttribute, afterNextRender, HostListener, Directive } from '@angular/core';
|
|
3
3
|
import { Overlay } from '@angular/cdk/overlay';
|
|
4
4
|
import { ComponentPortal } from '@angular/cdk/portal';
|
|
5
|
-
import {
|
|
5
|
+
import { NgTemplateOutlet } from '@angular/common';
|
|
6
6
|
import { isTextClipped } from '@ids-group-ltd/ids-design-system/core';
|
|
7
|
+
import { listenForEscape, prepareOverlayEnter, closeOnScroll, overlayPlacementOf } from '@ids-group-ltd/ids-design-system/components';
|
|
8
|
+
|
|
9
|
+
const TOKEN = /(\\\*\\\*|\*\*)/;
|
|
10
|
+
const ESCAPED = '\\*\\*';
|
|
11
|
+
const BOLD = '**';
|
|
12
|
+
/** Splits tip text on `**` into plain and bold runs. `\*\*` is a literal `**`; an unpaired `**` is literal too. */
|
|
13
|
+
function parseTooltipMarkup(text) {
|
|
14
|
+
const tokens = text.split(TOKEN);
|
|
15
|
+
const markerCount = tokens.filter((token) => token === BOLD).length;
|
|
16
|
+
const pairedMarkers = markerCount - (markerCount % 2);
|
|
17
|
+
const segments = [];
|
|
18
|
+
let bold = false;
|
|
19
|
+
let seen = 0;
|
|
20
|
+
for (const token of tokens) {
|
|
21
|
+
let piece = token;
|
|
22
|
+
if (token === ESCAPED) {
|
|
23
|
+
piece = BOLD;
|
|
24
|
+
}
|
|
25
|
+
else if (token === BOLD && seen++ < pairedMarkers) {
|
|
26
|
+
bold = !bold;
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
if (!piece) {
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
const last = segments[segments.length - 1];
|
|
33
|
+
if (last?.bold === bold) {
|
|
34
|
+
last.text += piece;
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
segments.push({ text: piece, bold });
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return segments;
|
|
41
|
+
}
|
|
42
|
+
function escapeTooltipMarkup(text) {
|
|
43
|
+
return text.replaceAll(BOLD, ESCAPED);
|
|
44
|
+
}
|
|
45
|
+
function plainTooltipText(text) {
|
|
46
|
+
return parseTooltipMarkup(text)
|
|
47
|
+
.map((segment) => segment.text)
|
|
48
|
+
.join('');
|
|
49
|
+
}
|
|
7
50
|
|
|
8
51
|
class TooltipPanelComponent {
|
|
9
|
-
/** Tooltip text
|
|
52
|
+
/** Tooltip text, where `**bold**` runs render bold; or a template, rendered as given. */
|
|
10
53
|
text = input.required(...(ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []));
|
|
54
|
+
template = computed(() => {
|
|
55
|
+
const text = this.text();
|
|
56
|
+
return text instanceof TemplateRef ? text : null;
|
|
57
|
+
}, ...(ngDevMode ? [{ debugName: "template" }] : /* istanbul ignore next */ []));
|
|
58
|
+
segments = computed(() => {
|
|
59
|
+
const text = this.text();
|
|
60
|
+
return typeof text === 'string' ? parseTooltipMarkup(text) : [];
|
|
61
|
+
}, ...(ngDevMode ? [{ debugName: "segments" }] : /* istanbul ignore next */ []));
|
|
11
62
|
/** Side of the trigger the panel is positioned on; also drives the arrow class. */
|
|
12
63
|
placement = input.required(...(ngDevMode ? [{ debugName: "placement" }] : /* istanbul ignore next */ []));
|
|
64
|
+
/** Whether the arrow pointing at the trigger is drawn. */
|
|
65
|
+
arrow = input(true, ...(ngDevMode ? [{ debugName: "arrow" }] : /* istanbul ignore next */ []));
|
|
13
66
|
/** Element `id`, referenced by the trigger's `aria-describedby`. */
|
|
14
67
|
panelId = input('', ...(ngDevMode ? [{ debugName: "panelId" }] : /* istanbul ignore next */ []));
|
|
15
68
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: TooltipPanelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
16
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.
|
|
69
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: TooltipPanelComponent, isStandalone: true, selector: "ds-tooltip-panel", inputs: { text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: true, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "placement", isSignal: true, isRequired: true, transformFunction: null }, arrow: { classPropertyName: "arrow", publicName: "arrow", isSignal: true, isRequired: false, transformFunction: null }, panelId: { classPropertyName: "panelId", publicName: "panelId", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "tooltip" }, properties: { "attr.id": "panelId()", "class.top": "placement() === 'top'", "class.bottom": "placement() === 'bottom'", "class.left": "placement() === 'left'", "class.right": "placement() === 'right'", "class.no-arrow": "!arrow()" } }, ngImport: i0, template: `
|
|
70
|
+
@if (template(); as template) {
|
|
71
|
+
<ng-container [ngTemplateOutlet]="template" />
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
@for (segment of segments(); track $index) {
|
|
75
|
+
@if (segment.bold) {
|
|
76
|
+
<strong [textContent]="segment.text"></strong>
|
|
77
|
+
} @else {
|
|
78
|
+
<span [textContent]="segment.text"></span>
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
`, isInline: true, styles: ["@layer ds-component-base{:host{box-sizing:border-box;interpolate-size:allow-keywords}*,*:before,*:after{box-sizing:border-box}button,input,select,textarea{font-family:inherit}h1,h2,h3,h4,h5,h6{margin:0}:host(:where(:focus-visible)),:where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard);border-radius:var(--focus-ring-radius)}@media(forced-colors:active){:host(:where(:focus-visible)),:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}}:host{--_tooltip-bg-color: var(--ds-tooltip-bg-color, var(--tooltip-bg-color));--_tooltip-text-color: var(--ds-tooltip-text-color, var(--tooltip-text-color));--_tooltip-border-color: var(--ds-tooltip-border-color, var(--tooltip-border-color));--_tooltip-radius: var(--ds-tooltip-radius, var(--ds-radius-control));--_tooltip-shadow: var(--ds-tooltip-shadow, var(--ds-elevation-overlay));--_tooltip-max-width: var(--ds-tooltip-max-width, var(--tooltip-maxw));--_tooltip-padding: var(--ds-tooltip-padding, var(--space-1-5) var(--space-2-5));--_tooltip-arrow-inset: calc(var(--_tooltip-radius) + var(--tooltip-arrow));--_tooltip-arrow-left: clamp(min(var(--_tooltip-arrow-inset), 50%), var(--_tooltip-arrow-x, 50%), max(100% - var(--_tooltip-arrow-inset), 50%));--_tooltip-arrow-top: clamp(min(var(--_tooltip-arrow-inset), 50%), var(--_tooltip-arrow-y, 50%), max(100% - var(--_tooltip-arrow-inset), 50%));display:block;position:relative;background:var(--_tooltip-bg-color);color:var(--_tooltip-text-color);border:var(--border-width-default) solid var(--_tooltip-border-color);font:var(--font-weight-medium) var(--font-size-xs)/var(--line-height-base) var(--font-sans);padding:var(--_tooltip-padding);border-radius:var(--_tooltip-radius);max-width:var(--_tooltip-max-width);overflow-wrap:anywhere;white-space:pre-line;z-index:var(--layer-tooltip);box-shadow:var(--_tooltip-shadow)}:host strong{font-weight:var(--font-weight-bold)}:host:after{content:\"\";position:absolute;width:var(--space-2);height:var(--space-2);background:var(--_tooltip-bg-color);border:0 solid var(--_tooltip-border-color);transform:rotate(45deg)}:host(.no-arrow):after{display:none}:host(.bottom):after{top:calc(var(--tooltip-arrow) / -2 - var(--border-width-default));left:var(--_tooltip-arrow-left);margin-left:calc(var(--tooltip-arrow) / -2);border-top-width:var(--border-width-default);border-left-width:var(--border-width-default)}:host(.top):after{bottom:calc(var(--tooltip-arrow) / -2 - var(--border-width-default));left:var(--_tooltip-arrow-left);margin-left:calc(var(--tooltip-arrow) / -2);border-bottom-width:var(--border-width-default);border-right-width:var(--border-width-default)}:host(.left):after{right:calc(var(--tooltip-arrow) / -2 - var(--border-width-default));top:var(--_tooltip-arrow-top);margin-top:calc(var(--tooltip-arrow) / -2);border-top-width:var(--border-width-default);border-right-width:var(--border-width-default)}:host(.right):after{left:calc(var(--tooltip-arrow) / -2 - var(--border-width-default));top:var(--_tooltip-arrow-top);margin-top:calc(var(--tooltip-arrow) / -2);border-bottom-width:var(--border-width-default);border-left-width:var(--border-width-default)}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
17
82
|
}
|
|
18
83
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: TooltipPanelComponent, decorators: [{
|
|
19
84
|
type: Component,
|
|
20
|
-
args: [{ selector: 'ds-tooltip-panel', standalone: true,
|
|
85
|
+
args: [{ selector: 'ds-tooltip-panel', standalone: true, imports: [NgTemplateOutlet], template: `
|
|
86
|
+
@if (template(); as template) {
|
|
87
|
+
<ng-container [ngTemplateOutlet]="template" />
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
@for (segment of segments(); track $index) {
|
|
91
|
+
@if (segment.bold) {
|
|
92
|
+
<strong [textContent]="segment.text"></strong>
|
|
93
|
+
} @else {
|
|
94
|
+
<span [textContent]="segment.text"></span>
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
`, host: {
|
|
21
98
|
role: 'tooltip',
|
|
22
99
|
'[attr.id]': 'panelId()',
|
|
23
100
|
'[class.top]': "placement() === 'top'",
|
|
24
101
|
'[class.bottom]': "placement() === 'bottom'",
|
|
25
102
|
'[class.left]': "placement() === 'left'",
|
|
26
103
|
'[class.right]': "placement() === 'right'",
|
|
27
|
-
|
|
28
|
-
|
|
104
|
+
'[class.no-arrow]': '!arrow()',
|
|
105
|
+
}, encapsulation: ViewEncapsulation.Emulated, styles: ["@layer ds-component-base{:host{box-sizing:border-box;interpolate-size:allow-keywords}*,*:before,*:after{box-sizing:border-box}button,input,select,textarea{font-family:inherit}h1,h2,h3,h4,h5,h6{margin:0}:host(:where(:focus-visible)),:where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard);border-radius:var(--focus-ring-radius)}@media(forced-colors:active){:host(:where(:focus-visible)),:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}}:host{--_tooltip-bg-color: var(--ds-tooltip-bg-color, var(--tooltip-bg-color));--_tooltip-text-color: var(--ds-tooltip-text-color, var(--tooltip-text-color));--_tooltip-border-color: var(--ds-tooltip-border-color, var(--tooltip-border-color));--_tooltip-radius: var(--ds-tooltip-radius, var(--ds-radius-control));--_tooltip-shadow: var(--ds-tooltip-shadow, var(--ds-elevation-overlay));--_tooltip-max-width: var(--ds-tooltip-max-width, var(--tooltip-maxw));--_tooltip-padding: var(--ds-tooltip-padding, var(--space-1-5) var(--space-2-5));--_tooltip-arrow-inset: calc(var(--_tooltip-radius) + var(--tooltip-arrow));--_tooltip-arrow-left: clamp(min(var(--_tooltip-arrow-inset), 50%), var(--_tooltip-arrow-x, 50%), max(100% - var(--_tooltip-arrow-inset), 50%));--_tooltip-arrow-top: clamp(min(var(--_tooltip-arrow-inset), 50%), var(--_tooltip-arrow-y, 50%), max(100% - var(--_tooltip-arrow-inset), 50%));display:block;position:relative;background:var(--_tooltip-bg-color);color:var(--_tooltip-text-color);border:var(--border-width-default) solid var(--_tooltip-border-color);font:var(--font-weight-medium) var(--font-size-xs)/var(--line-height-base) var(--font-sans);padding:var(--_tooltip-padding);border-radius:var(--_tooltip-radius);max-width:var(--_tooltip-max-width);overflow-wrap:anywhere;white-space:pre-line;z-index:var(--layer-tooltip);box-shadow:var(--_tooltip-shadow)}:host strong{font-weight:var(--font-weight-bold)}:host:after{content:\"\";position:absolute;width:var(--space-2);height:var(--space-2);background:var(--_tooltip-bg-color);border:0 solid var(--_tooltip-border-color);transform:rotate(45deg)}:host(.no-arrow):after{display:none}:host(.bottom):after{top:calc(var(--tooltip-arrow) / -2 - var(--border-width-default));left:var(--_tooltip-arrow-left);margin-left:calc(var(--tooltip-arrow) / -2);border-top-width:var(--border-width-default);border-left-width:var(--border-width-default)}:host(.top):after{bottom:calc(var(--tooltip-arrow) / -2 - var(--border-width-default));left:var(--_tooltip-arrow-left);margin-left:calc(var(--tooltip-arrow) / -2);border-bottom-width:var(--border-width-default);border-right-width:var(--border-width-default)}:host(.left):after{right:calc(var(--tooltip-arrow) / -2 - var(--border-width-default));top:var(--_tooltip-arrow-top);margin-top:calc(var(--tooltip-arrow) / -2);border-top-width:var(--border-width-default);border-right-width:var(--border-width-default)}:host(.right):after{left:calc(var(--tooltip-arrow) / -2 - var(--border-width-default));top:var(--_tooltip-arrow-top);margin-top:calc(var(--tooltip-arrow) / -2);border-bottom-width:var(--border-width-default);border-left-width:var(--border-width-default)}\n"] }]
|
|
106
|
+
}], propDecorators: { text: [{ type: i0.Input, args: [{ isSignal: true, alias: "text", required: true }] }], placement: [{ type: i0.Input, args: [{ isSignal: true, alias: "placement", required: true }] }], arrow: [{ type: i0.Input, args: [{ isSignal: true, alias: "arrow", required: false }] }], panelId: [{ type: i0.Input, args: [{ isSignal: true, alias: "panelId", required: false }] }] } });
|
|
107
|
+
|
|
108
|
+
const NATIVELY_FOCUSABLE = 'a[href], button, input, select, textarea, summary';
|
|
109
|
+
const FOCUSABLE = `${NATIVELY_FOCUSABLE}, [tabindex]`;
|
|
110
|
+
const KEYBOARD_FOCUSABLE = `${NATIVELY_FOCUSABLE}, [tabindex]:not([tabindex^="-"])`;
|
|
111
|
+
const WIDGET_ROLES = [
|
|
112
|
+
'button',
|
|
113
|
+
'link',
|
|
114
|
+
'tab',
|
|
115
|
+
'option',
|
|
116
|
+
'menuitem',
|
|
117
|
+
'menuitemcheckbox',
|
|
118
|
+
'menuitemradio',
|
|
119
|
+
'row',
|
|
120
|
+
'gridcell',
|
|
121
|
+
'combobox',
|
|
122
|
+
'checkbox',
|
|
123
|
+
'radio',
|
|
124
|
+
'switch',
|
|
125
|
+
'treeitem',
|
|
126
|
+
]
|
|
127
|
+
.map((role) => `[role="${role}"]`)
|
|
128
|
+
.join(', ');
|
|
129
|
+
const INTERACTIVE = `${NATIVELY_FOCUSABLE}, tr:not([role]), ${WIDGET_ROLES}`;
|
|
130
|
+
// A widget role owns its focus (a listbox moves it by `aria-activedescendant`), and a hidden subtree must hold no tab stop.
|
|
131
|
+
const REACHED_OR_HIDDEN = `${NATIVELY_FOCUSABLE}, tr[tabindex]:not([role]), ${WIDGET_ROLES}, [aria-hidden="true"], [inert]`;
|
|
132
|
+
const clippedHostsByAncestor = new WeakMap();
|
|
133
|
+
function firstClippedHost(triggers) {
|
|
134
|
+
return [...triggers]
|
|
135
|
+
.sort((a, b) => a.host.compareDocumentPosition(b.host) & Node.DOCUMENT_POSITION_FOLLOWING
|
|
136
|
+
? -1
|
|
137
|
+
: 1)
|
|
138
|
+
.find((trigger) => trigger.isClipped());
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* A clipped host that is not focusable itself opens its tip when its focusable ancestor takes
|
|
142
|
+
* keyboard focus. `:focus-visible` keeps a click from opening it. Only the first clipped host of
|
|
143
|
+
* one ancestor opens. Returns the teardown, or null when the host needs no listening.
|
|
144
|
+
*/
|
|
145
|
+
function watchFocusableAncestor(trigger) {
|
|
146
|
+
const host = trigger.host;
|
|
147
|
+
if (host.matches(FOCUSABLE)) {
|
|
148
|
+
return null;
|
|
149
|
+
}
|
|
150
|
+
const ancestor = host.parentElement?.closest(FOCUSABLE);
|
|
151
|
+
if (!ancestor?.matches(INTERACTIVE)) {
|
|
152
|
+
return null;
|
|
153
|
+
}
|
|
154
|
+
let triggers = clippedHostsByAncestor.get(ancestor);
|
|
155
|
+
if (!triggers) {
|
|
156
|
+
triggers = new Set();
|
|
157
|
+
clippedHostsByAncestor.set(ancestor, triggers);
|
|
158
|
+
}
|
|
159
|
+
triggers.add(trigger);
|
|
160
|
+
const open = (event) => {
|
|
161
|
+
if (event.target !== ancestor ||
|
|
162
|
+
// Tested here, not at registration: a disabled trigger carries tabindex="-1" until enabled.
|
|
163
|
+
!ancestor.matches(KEYBOARD_FOCUSABLE) ||
|
|
164
|
+
!ancestor.matches(':focus-visible') ||
|
|
165
|
+
firstClippedHost(triggers) !== trigger) {
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
trigger.openFor(ancestor);
|
|
169
|
+
};
|
|
170
|
+
const close = () => trigger.close();
|
|
171
|
+
ancestor.addEventListener('focusin', open);
|
|
172
|
+
ancestor.addEventListener('focusout', close);
|
|
173
|
+
ancestor.addEventListener('click', close);
|
|
174
|
+
ancestor.addEventListener('keydown', close);
|
|
175
|
+
return () => {
|
|
176
|
+
triggers.delete(trigger);
|
|
177
|
+
ancestor.removeEventListener('focusin', open);
|
|
178
|
+
ancestor.removeEventListener('focusout', close);
|
|
179
|
+
ancestor.removeEventListener('click', close);
|
|
180
|
+
ancestor.removeEventListener('keydown', close);
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
const tabStopSyncs = new Map();
|
|
184
|
+
let resizes = null;
|
|
185
|
+
let mutations = null;
|
|
186
|
+
function syncOf(node) {
|
|
187
|
+
for (let current = node; current; current = current.parentElement) {
|
|
188
|
+
const sync = tabStopSyncs.get(current);
|
|
189
|
+
if (sync) {
|
|
190
|
+
return sync;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
return undefined;
|
|
194
|
+
}
|
|
195
|
+
// Every isClipped() read forces layout once a tabindex write has dirtied it, so all reads go first.
|
|
196
|
+
function syncAll(targets) {
|
|
197
|
+
const syncs = [...new Set(targets.map(syncOf))].filter((sync) => sync !== undefined);
|
|
198
|
+
const decided = syncs.map((sync) => [sync, sync.isNeeded()]);
|
|
199
|
+
decided.forEach(([sync, needed]) => sync.apply(needed));
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* A clipped host that no keyboard path reaches - not focusable, inside no control or widget role,
|
|
203
|
+
* holding no focusable descendant - takes `tabindex="0"` while it is clipped, and loses it once its
|
|
204
|
+
* text fits and it does not hold focus. A tabindex it did not write is never touched. One observer
|
|
205
|
+
* pair serves every host. Returns the teardown, or null when the host is reached another way.
|
|
206
|
+
*/
|
|
207
|
+
function tabStopWhileClipped(trigger) {
|
|
208
|
+
const host = trigger.host;
|
|
209
|
+
if (host.matches(FOCUSABLE) || host.closest(REACHED_OR_HIDDEN)) {
|
|
210
|
+
return null;
|
|
211
|
+
}
|
|
212
|
+
let written = false;
|
|
213
|
+
const isNeeded = () => trigger.isClipped() && !host.querySelector(KEYBOARD_FOCUSABLE);
|
|
214
|
+
const apply = (needed) => {
|
|
215
|
+
if (needed && !host.hasAttribute('tabindex')) {
|
|
216
|
+
host.setAttribute('tabindex', '0');
|
|
217
|
+
written = true;
|
|
218
|
+
}
|
|
219
|
+
else if (!needed &&
|
|
220
|
+
written &&
|
|
221
|
+
host.ownerDocument.activeElement !== host) {
|
|
222
|
+
written = false;
|
|
223
|
+
if (host.getAttribute('tabindex') === '0') {
|
|
224
|
+
host.removeAttribute('tabindex');
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
};
|
|
228
|
+
const sync = () => apply(isNeeded());
|
|
229
|
+
resizes ??= new ResizeObserver((entries) => syncAll(entries.map((entry) => entry.target)));
|
|
230
|
+
mutations ??= new MutationObserver((records) => syncAll(records.map((record) => record.target)));
|
|
231
|
+
tabStopSyncs.set(host, { isNeeded, apply });
|
|
232
|
+
resizes.observe(host);
|
|
233
|
+
mutations.observe(host, {
|
|
234
|
+
characterData: true,
|
|
235
|
+
childList: true,
|
|
236
|
+
subtree: true,
|
|
237
|
+
});
|
|
238
|
+
host.addEventListener('focusout', sync);
|
|
239
|
+
return () => {
|
|
240
|
+
tabStopSyncs.delete(host);
|
|
241
|
+
resizes?.unobserve(host);
|
|
242
|
+
host.removeEventListener('focusout', sync);
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* `''`, `true` and `'true'` test the host itself; any other string is a selector for the element
|
|
248
|
+
* inside the host to test; `false`, `'false'`, `null` and `undefined` turn the test off.
|
|
249
|
+
*/
|
|
250
|
+
function toClipTarget(value) {
|
|
251
|
+
if (value === true || value === '' || value === 'true') {
|
|
252
|
+
return { selector: null };
|
|
253
|
+
}
|
|
254
|
+
return !value || value === 'false' ? null : { selector: value };
|
|
255
|
+
}
|
|
256
|
+
function clipElement(host, target) {
|
|
257
|
+
return target?.selector
|
|
258
|
+
? host.querySelector(target.selector)
|
|
259
|
+
: host;
|
|
260
|
+
}
|
|
261
|
+
function isHostClipped(host, target) {
|
|
262
|
+
const element = clipElement(host, target);
|
|
263
|
+
return element !== null && isTextClipped(element);
|
|
264
|
+
}
|
|
265
|
+
function ownTextOf(element) {
|
|
266
|
+
return (element?.textContent ?? '').trim();
|
|
267
|
+
}
|
|
268
|
+
function textContains(haystack, needle) {
|
|
269
|
+
const collapse = (value) => value.replace(/\s+/g, ' ').trim();
|
|
270
|
+
return collapse(haystack).includes(collapse(needle));
|
|
271
|
+
}
|
|
29
272
|
|
|
30
273
|
const TRIGGER_GAP_PX = 8;
|
|
31
274
|
const VIEWPORT_MARGIN_PX = 8;
|
|
@@ -35,95 +278,142 @@ const OPPOSITE_PLACEMENT = {
|
|
|
35
278
|
left: 'right',
|
|
36
279
|
right: 'left',
|
|
37
280
|
};
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
'
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
'
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
281
|
+
function positionFor(placement) {
|
|
282
|
+
switch (placement) {
|
|
283
|
+
case 'top':
|
|
284
|
+
return {
|
|
285
|
+
originX: 'center',
|
|
286
|
+
originY: 'top',
|
|
287
|
+
overlayX: 'center',
|
|
288
|
+
overlayY: 'bottom',
|
|
289
|
+
offsetY: -TRIGGER_GAP_PX,
|
|
290
|
+
};
|
|
291
|
+
case 'bottom':
|
|
292
|
+
return {
|
|
293
|
+
originX: 'center',
|
|
294
|
+
originY: 'bottom',
|
|
295
|
+
overlayX: 'center',
|
|
296
|
+
overlayY: 'top',
|
|
297
|
+
offsetY: TRIGGER_GAP_PX,
|
|
298
|
+
};
|
|
299
|
+
case 'left':
|
|
300
|
+
return {
|
|
301
|
+
originX: 'start',
|
|
302
|
+
originY: 'center',
|
|
303
|
+
overlayX: 'end',
|
|
304
|
+
overlayY: 'center',
|
|
305
|
+
offsetX: -TRIGGER_GAP_PX,
|
|
306
|
+
};
|
|
307
|
+
case 'right':
|
|
308
|
+
return {
|
|
309
|
+
originX: 'end',
|
|
310
|
+
originY: 'center',
|
|
311
|
+
overlayX: 'start',
|
|
312
|
+
overlayY: 'center',
|
|
313
|
+
offsetX: TRIGGER_GAP_PX,
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
function positionsFor(placement) {
|
|
318
|
+
return [positionFor(placement), positionFor(OPPOSITE_PLACEMENT[placement])];
|
|
319
|
+
}
|
|
320
|
+
// positionChanges skips a re-apply that only pushes the pane; the styles CDK writes do not.
|
|
321
|
+
// The pane is measured, not the panel: the panel's enter animation scales it.
|
|
322
|
+
function pointArrowAtHost(ref, panel, host) {
|
|
323
|
+
const pane = ref.overlayElement;
|
|
324
|
+
const point = () => {
|
|
325
|
+
const trigger = host.getBoundingClientRect();
|
|
326
|
+
const box = pane.getBoundingClientRect();
|
|
327
|
+
panel.style.setProperty('--_tooltip-arrow-x', `${trigger.left + trigger.width / 2 - box.left - panel.clientLeft}px`);
|
|
328
|
+
panel.style.setProperty('--_tooltip-arrow-y', `${trigger.top + trigger.height / 2 - box.top - panel.clientTop}px`);
|
|
329
|
+
};
|
|
330
|
+
const observer = new MutationObserver(point);
|
|
331
|
+
observer.observe(ref.hostElement, { attributeFilter: ['style'] });
|
|
332
|
+
observer.observe(pane, { attributeFilter: ['style'] });
|
|
333
|
+
ref.detachments().subscribe({ complete: () => observer.disconnect() });
|
|
69
334
|
}
|
|
335
|
+
|
|
336
|
+
const PINNED_ATTRIBUTE = 'data-ds-tooltip-pinned';
|
|
70
337
|
let nextId = 0;
|
|
338
|
+
/** @internal Lets a component that hosts the tooltip make a clipped host lead the tip with its own text. */
|
|
339
|
+
const TOOLTIP_LEADS_WITH_OWN_TEXT = new InjectionToken('TOOLTIP_LEADS_WITH_OWN_TEXT');
|
|
340
|
+
/** @internal Lets a component that hosts the tooltip decide `dsTooltipPinOnClick` for it. */
|
|
341
|
+
const TOOLTIP_PIN_ON_CLICK = new InjectionToken('TOOLTIP_PIN_ON_CLICK');
|
|
71
342
|
class TooltipDirective {
|
|
72
343
|
overlay = inject(Overlay);
|
|
73
344
|
host = inject((ElementRef));
|
|
74
|
-
|
|
345
|
+
document = inject(DOCUMENT);
|
|
346
|
+
hostPinOnClick = inject(TOOLTIP_PIN_ON_CLICK, {
|
|
347
|
+
self: true,
|
|
348
|
+
optional: true,
|
|
349
|
+
});
|
|
350
|
+
leadsWithOwnText = inject(TOOLTIP_LEADS_WITH_OWN_TEXT, { self: true, optional: true }) ??
|
|
351
|
+
false;
|
|
352
|
+
/** Tip text, or a template the panel renders as given. An empty string turns the tooltip off.
|
|
353
|
+
* Keep a template's content non-interactive: the panel is `role="tooltip"` and never takes focus. */
|
|
75
354
|
dsTooltip = input('', ...(ngDevMode ? [{ debugName: "dsTooltip" }] : /* istanbul ignore next */ []));
|
|
76
355
|
/** Which side the tip opens on. With no room there it opens on the opposite side. */
|
|
77
356
|
dsTooltipPlacement = input('top', ...(ngDevMode ? [{ debugName: "dsTooltipPlacement" }] : /* istanbul ignore next */ []));
|
|
78
357
|
/** Milliseconds before the tip appears. Hiding is immediate. */
|
|
79
358
|
dsTooltipDelay = input(120, ...(ngDevMode ? [{ debugName: "dsTooltipDelay" }] : /* istanbul ignore next */ []));
|
|
359
|
+
/** Draws the arrow that points at the host. Turn it off where the tip sits flush against it. */
|
|
360
|
+
dsTooltipArrow = input(true, { ...(ngDevMode ? { debugName: "dsTooltipArrow" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
80
361
|
/** Show the tip only while the host shows less text than it holds. Re-tested on every open.
|
|
362
|
+
* A boolean or the bare attribute tests the host. A selector tests the element it matches inside
|
|
363
|
+
* the host and discloses that element's text; while nothing matches, no clipped tip opens.
|
|
81
364
|
*
|
|
82
|
-
* Applies the tooltip on its own: without a `dsTooltip` the
|
|
365
|
+
* Applies the tooltip on its own: without a `dsTooltip` the tested text is disclosed. A tip
|
|
83
366
|
* whose text the host already contains sets no `aria-describedby`; one given a `dsTooltip`
|
|
84
|
-
* that says more than the host does describes it as usual.
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
*
|
|
88
|
-
|
|
89
|
-
/** Opens the tip with
|
|
90
|
-
*
|
|
91
|
-
|
|
367
|
+
* that says more than the host does describes it as usual.
|
|
368
|
+
*
|
|
369
|
+
* Keyboard focus opens it too: on the host, on a control or widget around it, or on a control
|
|
370
|
+
* inside it. A clipped host that none of these reaches takes `tabindex="0"` while it is clipped. */
|
|
371
|
+
dsTooltipWhenClipped = input(null, { ...(ngDevMode ? { debugName: "dsTooltipWhenClipped" } : /* istanbul ignore next */ {}), transform: toClipTarget });
|
|
372
|
+
/** Opens the tip with no delay, and a click on the host keeps it open after the pointer leaves
|
|
373
|
+
* until a click outside, `Escape` or blur; a second click closes it. Without it a click closes the tip.
|
|
374
|
+
* While pinned the host carries `data-ds-tooltip-pinned`, a hook for styling the pinned trigger. */
|
|
375
|
+
dsTooltipPinOnClick = input(false, { ...(ngDevMode ? { debugName: "dsTooltipPinOnClick" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
376
|
+
isClipped() {
|
|
377
|
+
return isHostClipped(this.hostElement, this.dsTooltipWhenClipped());
|
|
378
|
+
}
|
|
92
379
|
get hostElement() {
|
|
93
380
|
return this.host.nativeElement;
|
|
94
381
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
return selector
|
|
98
|
-
? this.hostElement.querySelector(selector)
|
|
99
|
-
: this.hostElement;
|
|
382
|
+
pinsOnClick() {
|
|
383
|
+
return this.hostPinOnClick?.() ?? this.dsTooltipPinOnClick();
|
|
100
384
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
return textElement !== null && isTextClipped(textElement);
|
|
385
|
+
ownText() {
|
|
386
|
+
return ownTextOf(clipElement(this.hostElement, this.dsTooltipWhenClipped()));
|
|
104
387
|
}
|
|
105
|
-
|
|
388
|
+
/** A host that leads with its own text puts it, in bold, above the tip while it is clipped, unless the tip already says it. */
|
|
389
|
+
tipContent() {
|
|
106
390
|
const given = this.dsTooltip();
|
|
107
|
-
|
|
108
|
-
if (given && lead && this.isClipped()) {
|
|
109
|
-
return `${lead}
|
|
110
|
-
${given}`;
|
|
111
|
-
}
|
|
112
|
-
if (given || !this.dsTooltipWhenClipped()) {
|
|
391
|
+
if (given instanceof TemplateRef) {
|
|
113
392
|
return given;
|
|
114
393
|
}
|
|
115
|
-
|
|
394
|
+
const own = this.ownText();
|
|
395
|
+
if (!given) {
|
|
396
|
+
return this.dsTooltipWhenClipped() ? escapeTooltipMarkup(own) : '';
|
|
397
|
+
}
|
|
398
|
+
if (this.leadsWithOwnText &&
|
|
399
|
+
own &&
|
|
400
|
+
this.isClipped() &&
|
|
401
|
+
!textContains(plainTooltipText(given), own)) {
|
|
402
|
+
return `**${escapeTooltipMarkup(own)}**
|
|
403
|
+
${given}`;
|
|
404
|
+
}
|
|
405
|
+
return given;
|
|
116
406
|
}
|
|
117
407
|
/** A clipped host's full text is already in the DOM; describing it again would announce it twice. */
|
|
118
408
|
disclosesOwnText(text) {
|
|
119
409
|
if (!this.dsTooltipWhenClipped()) {
|
|
120
410
|
return false;
|
|
121
411
|
}
|
|
122
|
-
|
|
123
|
-
return collapse(this.textElement()?.textContent ?? '').includes(collapse(text));
|
|
412
|
+
return textContains(this.ownText(), plainTooltipText(text));
|
|
124
413
|
}
|
|
125
414
|
ref = null;
|
|
126
415
|
timer = null;
|
|
416
|
+
unpin = null;
|
|
127
417
|
tipId = `ds-tooltip-${++nextId}`;
|
|
128
418
|
/**
|
|
129
419
|
* Where `aria-describedby` belongs when focus is involved: a non-focusable host
|
|
@@ -137,51 +427,26 @@ ${given}`;
|
|
|
137
427
|
*/
|
|
138
428
|
describedElement = null;
|
|
139
429
|
detachAncestor = null;
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
listenToFocusableAncestor() {
|
|
145
|
-
const host = this.host.nativeElement;
|
|
146
|
-
if (!this.dsTooltipWhenClipped() || host.matches(FOCUSABLE)) {
|
|
147
|
-
return;
|
|
148
|
-
}
|
|
149
|
-
const ancestor = host.parentElement?.closest(FOCUSABLE);
|
|
150
|
-
if (!ancestor?.matches(INTERACTIVE)) {
|
|
151
|
-
return;
|
|
152
|
-
}
|
|
153
|
-
let tooltips = clippedHostsByAncestor.get(ancestor);
|
|
154
|
-
if (!tooltips) {
|
|
155
|
-
tooltips = new Set();
|
|
156
|
-
clippedHostsByAncestor.set(ancestor, tooltips);
|
|
157
|
-
}
|
|
158
|
-
tooltips.add(this);
|
|
159
|
-
const open = (event) => {
|
|
160
|
-
if (event.target !== ancestor ||
|
|
161
|
-
// Tested here, not at registration: a disabled trigger carries tabindex="-1" until enabled.
|
|
162
|
-
!ancestor.matches(KEYBOARD_FOCUSABLE) ||
|
|
163
|
-
!ancestor.matches(':focus-visible') ||
|
|
164
|
-
firstClippedHost(tooltips) !== this) {
|
|
165
|
-
return;
|
|
166
|
-
}
|
|
430
|
+
ancestorFocusTrigger = {
|
|
431
|
+
host: this.hostElement,
|
|
432
|
+
isClipped: () => this.isClipped(),
|
|
433
|
+
openFor: (ancestor) => {
|
|
167
434
|
this.focusedTarget = ancestor;
|
|
168
435
|
this.scheduleShow();
|
|
169
|
-
}
|
|
170
|
-
|
|
436
|
+
},
|
|
437
|
+
close: () => {
|
|
171
438
|
this.focusedTarget = null;
|
|
172
439
|
this.onClose();
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
ancestor.removeEventListener('keydown', close);
|
|
184
|
-
};
|
|
440
|
+
},
|
|
441
|
+
};
|
|
442
|
+
constructor() {
|
|
443
|
+
afterNextRender(() => {
|
|
444
|
+
if (this.dsTooltipWhenClipped()) {
|
|
445
|
+
this.detachAncestor =
|
|
446
|
+
watchFocusableAncestor(this.ancestorFocusTrigger) ??
|
|
447
|
+
tabStopWhileClipped(this.ancestorFocusTrigger);
|
|
448
|
+
}
|
|
449
|
+
});
|
|
185
450
|
}
|
|
186
451
|
onPointerEnter() {
|
|
187
452
|
this.scheduleShow();
|
|
@@ -204,7 +469,10 @@ ${given}`;
|
|
|
204
469
|
this.onClose();
|
|
205
470
|
}
|
|
206
471
|
scheduleShow() {
|
|
207
|
-
if (!this.
|
|
472
|
+
if (this.unpin || !this.tipContent()) {
|
|
473
|
+
return;
|
|
474
|
+
}
|
|
475
|
+
if (this.pinsOnClick() && this.ref?.hasAttached()) {
|
|
208
476
|
return;
|
|
209
477
|
}
|
|
210
478
|
if (this.dsTooltipWhenClipped() && !this.isClipped()) {
|
|
@@ -213,16 +481,58 @@ ${given}`;
|
|
|
213
481
|
if (this.timer !== null) {
|
|
214
482
|
clearTimeout(this.timer);
|
|
215
483
|
}
|
|
216
|
-
this.timer = window.setTimeout(() => this.show(), this.dsTooltipDelay());
|
|
484
|
+
this.timer = window.setTimeout(() => this.show(), this.pinsOnClick() ? 0 : this.dsTooltipDelay());
|
|
485
|
+
}
|
|
486
|
+
onPointerLeave() {
|
|
487
|
+
if (!this.unpin) {
|
|
488
|
+
this.onClose();
|
|
489
|
+
}
|
|
217
490
|
}
|
|
218
491
|
// Close on click too: a re-rendered anchor under a stationary cursor fires no mouseleave.
|
|
492
|
+
onClick() {
|
|
493
|
+
if (this.pinsOnClick() && !this.unpin) {
|
|
494
|
+
this.pin();
|
|
495
|
+
}
|
|
496
|
+
else {
|
|
497
|
+
this.onClose();
|
|
498
|
+
}
|
|
499
|
+
}
|
|
219
500
|
onClose() {
|
|
220
501
|
if (this.timer !== null) {
|
|
221
502
|
clearTimeout(this.timer);
|
|
222
503
|
this.timer = null;
|
|
223
504
|
}
|
|
505
|
+
this.unpin?.();
|
|
224
506
|
this.disposeRef();
|
|
225
507
|
}
|
|
508
|
+
pin() {
|
|
509
|
+
if (this.timer !== null) {
|
|
510
|
+
clearTimeout(this.timer);
|
|
511
|
+
this.timer = null;
|
|
512
|
+
}
|
|
513
|
+
if (!this.ref?.hasAttached()) {
|
|
514
|
+
if (!this.tipContent()) {
|
|
515
|
+
return;
|
|
516
|
+
}
|
|
517
|
+
this.show();
|
|
518
|
+
}
|
|
519
|
+
const closeOutside = (event) => {
|
|
520
|
+
const target = event.target;
|
|
521
|
+
if (!this.hostElement.contains(target) &&
|
|
522
|
+
!this.ref?.overlayElement.contains(target)) {
|
|
523
|
+
this.onClose();
|
|
524
|
+
}
|
|
525
|
+
};
|
|
526
|
+
this.document.addEventListener('pointerdown', closeOutside, true);
|
|
527
|
+
const stopEscape = listenForEscape(this.document, () => this.onClose());
|
|
528
|
+
this.hostElement.setAttribute(PINNED_ATTRIBUTE, '');
|
|
529
|
+
this.unpin = () => {
|
|
530
|
+
this.unpin = null;
|
|
531
|
+
this.hostElement.removeAttribute(PINNED_ATTRIBUTE);
|
|
532
|
+
this.document.removeEventListener('pointerdown', closeOutside, true);
|
|
533
|
+
stopEscape();
|
|
534
|
+
};
|
|
535
|
+
}
|
|
226
536
|
disposeRef() {
|
|
227
537
|
this.ref?.dispose();
|
|
228
538
|
this.ref = null;
|
|
@@ -259,10 +569,7 @@ ${given}`;
|
|
|
259
569
|
const positionStrategy = this.overlay
|
|
260
570
|
.position()
|
|
261
571
|
.flexibleConnectedTo(this.host)
|
|
262
|
-
.withPositions(
|
|
263
|
-
this.positionFor(placement),
|
|
264
|
-
this.positionFor(OPPOSITE_PLACEMENT[placement]),
|
|
265
|
-
])
|
|
572
|
+
.withPositions(positionsFor(placement))
|
|
266
573
|
.withViewportMargin(VIEWPORT_MARGIN_PX);
|
|
267
574
|
this.ref = this.overlay.create({
|
|
268
575
|
positionStrategy,
|
|
@@ -270,13 +577,19 @@ ${given}`;
|
|
|
270
577
|
scrollStrategy: this.overlay.scrollStrategies.close(),
|
|
271
578
|
});
|
|
272
579
|
prepareOverlayEnter(this.ref, this.host.nativeElement, positionStrategy);
|
|
580
|
+
// The CDK strategy sees only the window and cdkScrollable ancestors, not a plain overflow container.
|
|
581
|
+
const stopScrollClose = closeOnScroll(this.ref, () => this.onClose());
|
|
582
|
+
this.ref.detachments().subscribe(stopScrollClose);
|
|
273
583
|
const cmpRef = this.ref.attach(new ComponentPortal(TooltipPanelComponent));
|
|
274
|
-
const
|
|
275
|
-
cmpRef.setInput('text',
|
|
584
|
+
const tip = this.tipContent();
|
|
585
|
+
cmpRef.setInput('text', tip);
|
|
276
586
|
cmpRef.setInput('placement', placement);
|
|
587
|
+
cmpRef.setInput('arrow', this.dsTooltipArrow());
|
|
277
588
|
positionStrategy.positionChanges.subscribe(({ connectionPair }) => cmpRef.setInput('placement', overlayPlacementOf(connectionPair.overlayY, connectionPair.overlayX)));
|
|
278
589
|
cmpRef.setInput('panelId', this.tipId);
|
|
279
|
-
|
|
590
|
+
pointArrowAtHost(this.ref, cmpRef.location.nativeElement, this.hostElement);
|
|
591
|
+
this.ref.detachments().subscribe(() => this.unpin?.());
|
|
592
|
+
if (typeof tip === 'string' && this.disclosesOwnText(tip)) {
|
|
280
593
|
return;
|
|
281
594
|
}
|
|
282
595
|
const described = this.focusedTarget ?? this.host.nativeElement;
|
|
@@ -284,48 +597,12 @@ ${given}`;
|
|
|
284
597
|
const existing = described.getAttribute('aria-describedby');
|
|
285
598
|
described.setAttribute('aria-describedby', existing ? `${existing} ${this.tipId}` : this.tipId);
|
|
286
599
|
}
|
|
287
|
-
positionFor(placement) {
|
|
288
|
-
switch (placement) {
|
|
289
|
-
case 'top':
|
|
290
|
-
return {
|
|
291
|
-
originX: 'center',
|
|
292
|
-
originY: 'top',
|
|
293
|
-
overlayX: 'center',
|
|
294
|
-
overlayY: 'bottom',
|
|
295
|
-
offsetY: -TRIGGER_GAP_PX,
|
|
296
|
-
};
|
|
297
|
-
case 'bottom':
|
|
298
|
-
return {
|
|
299
|
-
originX: 'center',
|
|
300
|
-
originY: 'bottom',
|
|
301
|
-
overlayX: 'center',
|
|
302
|
-
overlayY: 'top',
|
|
303
|
-
offsetY: TRIGGER_GAP_PX,
|
|
304
|
-
};
|
|
305
|
-
case 'left':
|
|
306
|
-
return {
|
|
307
|
-
originX: 'start',
|
|
308
|
-
originY: 'center',
|
|
309
|
-
overlayX: 'end',
|
|
310
|
-
overlayY: 'center',
|
|
311
|
-
offsetX: -TRIGGER_GAP_PX,
|
|
312
|
-
};
|
|
313
|
-
case 'right':
|
|
314
|
-
return {
|
|
315
|
-
originX: 'end',
|
|
316
|
-
originY: 'center',
|
|
317
|
-
overlayX: 'start',
|
|
318
|
-
overlayY: 'center',
|
|
319
|
-
offsetX: TRIGGER_GAP_PX,
|
|
320
|
-
};
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
600
|
ngOnDestroy() {
|
|
324
601
|
this.detachAncestor?.();
|
|
325
602
|
this.onClose();
|
|
326
603
|
}
|
|
327
604
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: TooltipDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
328
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.22", type: TooltipDirective, isStandalone: true, selector: "[dsTooltip], [dsTooltipWhenClipped]", inputs: { dsTooltip: { classPropertyName: "dsTooltip", publicName: "dsTooltip", isSignal: true, isRequired: false, transformFunction: null }, dsTooltipPlacement: { classPropertyName: "dsTooltipPlacement", publicName: "dsTooltipPlacement", isSignal: true, isRequired: false, transformFunction: null }, dsTooltipDelay: { classPropertyName: "dsTooltipDelay", publicName: "dsTooltipDelay", isSignal: true, isRequired: false, transformFunction: null },
|
|
605
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.22", type: TooltipDirective, isStandalone: true, selector: "[dsTooltip], [dsTooltipWhenClipped]", inputs: { dsTooltip: { classPropertyName: "dsTooltip", publicName: "dsTooltip", isSignal: true, isRequired: false, transformFunction: null }, dsTooltipPlacement: { classPropertyName: "dsTooltipPlacement", publicName: "dsTooltipPlacement", isSignal: true, isRequired: false, transformFunction: null }, dsTooltipDelay: { classPropertyName: "dsTooltipDelay", publicName: "dsTooltipDelay", isSignal: true, isRequired: false, transformFunction: null }, dsTooltipArrow: { classPropertyName: "dsTooltipArrow", publicName: "dsTooltipArrow", isSignal: true, isRequired: false, transformFunction: null }, dsTooltipWhenClipped: { classPropertyName: "dsTooltipWhenClipped", publicName: "dsTooltipWhenClipped", isSignal: true, isRequired: false, transformFunction: null }, dsTooltipPinOnClick: { classPropertyName: "dsTooltipPinOnClick", publicName: "dsTooltipPinOnClick", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "mouseenter": "onPointerEnter()", "focusin": "onFocusIn($event)", "focusout": "onFocusOut()", "mouseleave": "onPointerLeave()", "click": "onClick()", "keydown": "onKeydown()", "keydown.escape": "onEscape()" } }, ngImport: i0 });
|
|
329
606
|
}
|
|
330
607
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: TooltipDirective, decorators: [{
|
|
331
608
|
type: Directive,
|
|
@@ -333,7 +610,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
333
610
|
selector: '[dsTooltip], [dsTooltipWhenClipped]',
|
|
334
611
|
standalone: true,
|
|
335
612
|
}]
|
|
336
|
-
}], ctorParameters: () => [], propDecorators: { dsTooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "dsTooltip", required: false }] }], dsTooltipPlacement: [{ type: i0.Input, args: [{ isSignal: true, alias: "dsTooltipPlacement", required: false }] }], dsTooltipDelay: [{ type: i0.Input, args: [{ isSignal: true, alias: "dsTooltipDelay", required: false }] }],
|
|
613
|
+
}], ctorParameters: () => [], propDecorators: { dsTooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "dsTooltip", required: false }] }], dsTooltipPlacement: [{ type: i0.Input, args: [{ isSignal: true, alias: "dsTooltipPlacement", required: false }] }], dsTooltipDelay: [{ type: i0.Input, args: [{ isSignal: true, alias: "dsTooltipDelay", required: false }] }], dsTooltipArrow: [{ type: i0.Input, args: [{ isSignal: true, alias: "dsTooltipArrow", required: false }] }], dsTooltipWhenClipped: [{ type: i0.Input, args: [{ isSignal: true, alias: "dsTooltipWhenClipped", required: false }] }], dsTooltipPinOnClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "dsTooltipPinOnClick", required: false }] }], onPointerEnter: [{
|
|
337
614
|
type: HostListener,
|
|
338
615
|
args: ['mouseenter']
|
|
339
616
|
}], onFocusIn: [{
|
|
@@ -342,10 +619,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
342
619
|
}], onFocusOut: [{
|
|
343
620
|
type: HostListener,
|
|
344
621
|
args: ['focusout']
|
|
345
|
-
}],
|
|
622
|
+
}], onPointerLeave: [{
|
|
346
623
|
type: HostListener,
|
|
347
624
|
args: ['mouseleave']
|
|
348
|
-
}, {
|
|
625
|
+
}], onClick: [{
|
|
349
626
|
type: HostListener,
|
|
350
627
|
args: ['click']
|
|
351
628
|
}], onKeydown: [{
|
|
@@ -360,5 +637,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
360
637
|
* Generated bundle index. Do not edit.
|
|
361
638
|
*/
|
|
362
639
|
|
|
363
|
-
export { TooltipDirective, TooltipPanelComponent };
|
|
640
|
+
export { TOOLTIP_LEADS_WITH_OWN_TEXT, TOOLTIP_PIN_ON_CLICK, TooltipDirective, TooltipPanelComponent };
|
|
364
641
|
//# sourceMappingURL=ids-group-ltd-ids-design-system-components-tooltip.mjs.map
|