@ids-group-ltd/ids-design-system 0.11.3 → 0.12.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 +253 -13
- package/components/README.md +86 -0
- package/components.md +12 -4
- package/docs/agent/INDEX.md +1 -0
- package/docs/agent/platform/body-scroll-lock-service.md +12 -0
- package/docs/agent/platform/toast-service.md +4 -6
- package/fesm2022/ids-group-ltd-ids-design-system-components-accordion.mjs +85 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-accordion.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-alert.mjs +70 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-alert.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-app-layout.mjs +573 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-app-layout.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-auth-layout.mjs +86 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-auth-layout.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-autocomplete.mjs +615 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-autocomplete.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-avatar-group.mjs +30 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-avatar-group.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-avatar.mjs +188 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-avatar.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-badge.mjs +59 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-badge.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-banner.mjs +92 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-banner.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-bottom-sheet.mjs +204 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-bottom-sheet.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-breadcrumbs.mjs +100 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-breadcrumbs.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-button-group.mjs +23 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-button-group.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-button.mjs +180 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-button.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-calendar-day.mjs +78 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-calendar-day.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-card.mjs +49 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-card.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-checkbox.mjs +73 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-checkbox.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-color-picker.mjs +397 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-color-picker.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-date-picker.mjs +1231 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-date-picker.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-description-list.mjs +51 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-description-list.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-divider.mjs +35 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-divider.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-drawer.mjs +109 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-drawer.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-dropzone.mjs +111 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-dropzone.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-empty-state.mjs +52 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-empty-state.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-field-group.mjs +92 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-field-group.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-field-message.mjs +62 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-field-message.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-filter-bar.mjs +164 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-filter-bar.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-icon-button.mjs +85 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-icon-button.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-input.mjs +223 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-input.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-layout.mjs +63 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-layout.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-list.mjs +53 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-list.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-loading-overlay.mjs +43 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-loading-overlay.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-menu.mjs +286 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-menu.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-modal.mjs +329 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-modal.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-multi-select.mjs +612 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-multi-select.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-number-stepper.mjs +69 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-number-stepper.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-otp-input.mjs +191 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-otp-input.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-page-footer.mjs +23 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-page-footer.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-page-header.mjs +43 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-page-header.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-pagination.mjs +85 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-pagination.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-password-rules.mjs +95 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-password-rules.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-popover.mjs +240 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-popover.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-progress.mjs +41 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-progress.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-radio-group.mjs +235 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-radio-group.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-reserve-messages.mjs +62 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-reserve-messages.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-search.mjs +173 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-search.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-segmented.mjs +123 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-segmented.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-select.mjs +461 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-select.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav-footer.mjs +107 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav-footer.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav.mjs +185 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-skeleton.mjs +32 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-skeleton.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-slider.mjs +204 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-slider.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-spinner.mjs +25 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-spinner.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-split-button.mjs +53 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-split-button.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-stat.mjs +99 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-stat.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-status-dot.mjs +26 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-status-dot.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-stepper.mjs +74 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-stepper.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-switch.mjs +76 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-switch.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs +1802 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-tabs.mjs +381 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-tabs.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-tag.mjs +44 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-tag.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-textarea.mjs +158 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-textarea.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-time-picker.mjs +671 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-time-picker.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-timeline.mjs +41 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-timeline.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-toast.mjs +547 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-toast.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-toggle-button.mjs +34 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-toggle-button.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-tooltip.mjs +218 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-tooltip.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-topbar.mjs +18 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-topbar.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-tree.mjs +153 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-tree.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-w3w.mjs +48 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-w3w.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components.mjs +1338 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-core.mjs +325 -0
- package/fesm2022/ids-group-ltd-ids-design-system-core.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-icons.mjs +101 -0
- package/fesm2022/ids-group-ltd-ids-design-system-icons.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-overlay.mjs +56 -0
- package/fesm2022/ids-group-ltd-ids-design-system-overlay.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-theme.mjs +37 -0
- package/fesm2022/ids-group-ltd-ids-design-system-theme.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system.mjs +72 -14030
- package/fesm2022/ids-group-ltd-ids-design-system.mjs.map +1 -1
- package/migrations/0.11.0.json +0 -2
- package/migrations/0.11.1.json +2 -1
- package/migrations/0.11.2.json +2 -1
- package/migrations/0.11.3.json +3 -2
- package/migrations/0.11.4.json +247 -0
- package/migrations/0.12.0.json +22 -0
- package/migrations/0.4.0.json +2 -1
- package/migrations/0.7.1.json +2 -1
- package/migrations/0.8.0.json +6 -5
- package/package.json +573 -1
- package/styles/_control-label.scss +18 -0
- package/styles/_ds-color.scss +6 -0
- package/styles/_focus.scss +16 -0
- package/styles/_skeleton-shimmer.scss +10 -26
- package/themes/README.md +4 -4
- package/themes/_semantic.scss +11 -2
- package/types/ids-group-ltd-ids-design-system-components-accordion.d.ts +48 -0
- package/types/ids-group-ltd-ids-design-system-components-alert.d.ts +32 -0
- package/types/ids-group-ltd-ids-design-system-components-app-layout.d.ts +260 -0
- package/types/ids-group-ltd-ids-design-system-components-auth-layout.d.ts +75 -0
- package/types/ids-group-ltd-ids-design-system-components-autocomplete.d.ts +226 -0
- package/types/ids-group-ltd-ids-design-system-components-avatar-group.d.ts +13 -0
- package/types/ids-group-ltd-ids-design-system-components-avatar.d.ts +99 -0
- package/types/ids-group-ltd-ids-design-system-components-badge.d.ts +25 -0
- package/types/ids-group-ltd-ids-design-system-components-banner.d.ts +41 -0
- package/types/ids-group-ltd-ids-design-system-components-bottom-sheet.d.ts +61 -0
- package/types/ids-group-ltd-ids-design-system-components-breadcrumbs.d.ts +66 -0
- package/types/ids-group-ltd-ids-design-system-components-button-group.d.ts +10 -0
- package/types/ids-group-ltd-ids-design-system-components-button.d.ts +90 -0
- package/types/ids-group-ltd-ids-design-system-components-calendar-day.d.ts +41 -0
- package/types/ids-group-ltd-ids-design-system-components-card.d.ts +24 -0
- package/types/ids-group-ltd-ids-design-system-components-checkbox.d.ts +41 -0
- package/types/ids-group-ltd-ids-design-system-components-color-picker.d.ts +79 -0
- package/types/ids-group-ltd-ids-design-system-components-date-picker.d.ts +251 -0
- package/types/ids-group-ltd-ids-design-system-components-description-list.d.ts +25 -0
- package/types/ids-group-ltd-ids-design-system-components-divider.d.ts +22 -0
- package/types/ids-group-ltd-ids-design-system-components-drawer.d.ts +38 -0
- package/types/ids-group-ltd-ids-design-system-components-dropzone.d.ts +45 -0
- package/types/ids-group-ltd-ids-design-system-components-empty-state.d.ts +22 -0
- package/types/ids-group-ltd-ids-design-system-components-field-group.d.ts +73 -0
- package/types/ids-group-ltd-ids-design-system-components-field-message.d.ts +36 -0
- package/types/ids-group-ltd-ids-design-system-components-filter-bar.d.ts +83 -0
- package/types/ids-group-ltd-ids-design-system-components-icon-button.d.ts +56 -0
- package/types/ids-group-ltd-ids-design-system-components-input.d.ts +121 -0
- package/types/ids-group-ltd-ids-design-system-components-layout.d.ts +39 -0
- package/types/ids-group-ltd-ids-design-system-components-list.d.ts +29 -0
- package/types/ids-group-ltd-ids-design-system-components-loading-overlay.d.ts +31 -0
- package/types/ids-group-ltd-ids-design-system-components-menu.d.ts +82 -0
- package/types/ids-group-ltd-ids-design-system-components-modal.d.ts +124 -0
- package/types/ids-group-ltd-ids-design-system-components-multi-select.d.ts +213 -0
- package/types/ids-group-ltd-ids-design-system-components-number-stepper.d.ts +31 -0
- package/types/ids-group-ltd-ids-design-system-components-otp-input.d.ts +52 -0
- package/types/ids-group-ltd-ids-design-system-components-page-footer.d.ts +13 -0
- package/types/ids-group-ltd-ids-design-system-components-page-header.d.ts +21 -0
- package/types/ids-group-ltd-ids-design-system-components-pagination.d.ts +32 -0
- package/types/ids-group-ltd-ids-design-system-components-password-rules.d.ts +80 -0
- package/types/ids-group-ltd-ids-design-system-components-popover.d.ts +48 -0
- package/types/ids-group-ltd-ids-design-system-components-progress.d.ts +22 -0
- package/types/ids-group-ltd-ids-design-system-components-radio-group.d.ts +106 -0
- package/types/ids-group-ltd-ids-design-system-components-reserve-messages.d.ts +33 -0
- package/types/ids-group-ltd-ids-design-system-components-search.d.ts +82 -0
- package/types/ids-group-ltd-ids-design-system-components-segmented.d.ts +40 -0
- package/types/ids-group-ltd-ids-design-system-components-select.d.ts +152 -0
- package/types/ids-group-ltd-ids-design-system-components-sidenav-footer.d.ts +92 -0
- package/types/ids-group-ltd-ids-design-system-components-sidenav.d.ts +131 -0
- package/types/ids-group-ltd-ids-design-system-components-skeleton.d.ts +16 -0
- package/types/ids-group-ltd-ids-design-system-components-slider.d.ts +51 -0
- package/types/ids-group-ltd-ids-design-system-components-spinner.d.ts +11 -0
- package/types/ids-group-ltd-ids-design-system-components-split-button.d.ts +38 -0
- package/types/ids-group-ltd-ids-design-system-components-stat.d.ts +44 -0
- package/types/ids-group-ltd-ids-design-system-components-status-dot.d.ts +12 -0
- package/types/ids-group-ltd-ids-design-system-components-stepper.d.ts +32 -0
- package/types/ids-group-ltd-ids-design-system-components-switch.d.ts +40 -0
- package/types/ids-group-ltd-ids-design-system-components-table.d.ts +791 -0
- package/types/ids-group-ltd-ids-design-system-components-tabs.d.ts +118 -0
- package/types/ids-group-ltd-ids-design-system-components-tag.d.ts +26 -0
- package/types/ids-group-ltd-ids-design-system-components-textarea.d.ts +85 -0
- package/types/ids-group-ltd-ids-design-system-components-time-picker.d.ts +188 -0
- package/types/ids-group-ltd-ids-design-system-components-timeline.d.ts +24 -0
- package/types/ids-group-ltd-ids-design-system-components-toast.d.ts +167 -0
- package/types/ids-group-ltd-ids-design-system-components-toggle-button.d.ts +18 -0
- package/types/ids-group-ltd-ids-design-system-components-tooltip.d.ts +66 -0
- package/types/ids-group-ltd-ids-design-system-components-topbar.d.ts +8 -0
- package/types/ids-group-ltd-ids-design-system-components-tree.d.ts +46 -0
- package/types/ids-group-ltd-ids-design-system-components-w3w.d.ts +18 -0
- package/types/ids-group-ltd-ids-design-system-components.d.ts +604 -0
- package/types/ids-group-ltd-ids-design-system-core.d.ts +428 -0
- package/types/ids-group-ltd-ids-design-system-icons.d.ts +52 -0
- package/types/ids-group-ltd-ids-design-system-overlay.d.ts +32 -0
- package/types/ids-group-ltd-ids-design-system-theme.d.ts +29 -0
- package/types/ids-group-ltd-ids-design-system.d.ts +72 -5544
- package/LICENSE +0 -21
- package/README.md +0 -73
|
@@ -0,0 +1,381 @@
|
|
|
1
|
+
import { NgTemplateOutlet } from '@angular/common';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { input, booleanAttribute, viewChild, ViewEncapsulation, Component, model, output, inject, ElementRef, contentChildren, Injector, signal, isDevMode, effect, computed } from '@angular/core';
|
|
4
|
+
import { Router, ActivatedRoute } from '@angular/router';
|
|
5
|
+
import { IconComponent } from '@ids-group-ltd/ids-design-system/icons';
|
|
6
|
+
|
|
7
|
+
class TabComponent {
|
|
8
|
+
/** Text shown in the tab button. */
|
|
9
|
+
label = input.required(...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
10
|
+
/** Icon shown before the label. */
|
|
11
|
+
icon = input(null, ...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
12
|
+
/** Numeric badge shown after the label. */
|
|
13
|
+
count = input(null, ...(ngDevMode ? [{ debugName: "count" }] : /* istanbul ignore next */ []));
|
|
14
|
+
/** Excludes the tab from selection and keyboard navigation. */
|
|
15
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
16
|
+
/** Identifier emitted by tabClosed. Falls back to label when omitted. */
|
|
17
|
+
value = input(null, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
18
|
+
content = viewChild.required('content');
|
|
19
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: TabComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
20
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.22", type: TabComponent, isStandalone: true, selector: "ds-tab", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, count: { classPropertyName: "count", publicName: "count", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "content", first: true, predicate: ["content"], descendants: true, isSignal: true }], ngImport: i0, template: `<ng-template #content>
|
|
21
|
+
<ng-content></ng-content>
|
|
22
|
+
</ng-template>`, isInline: true, styles: [":host{display:none}\n"] });
|
|
23
|
+
}
|
|
24
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: TabComponent, decorators: [{
|
|
25
|
+
type: Component,
|
|
26
|
+
args: [{ selector: 'ds-tab', standalone: true, template: `<ng-template #content>
|
|
27
|
+
<ng-content></ng-content>
|
|
28
|
+
</ng-template>`, encapsulation: ViewEncapsulation.Emulated, styles: [":host{display:none}\n"] }]
|
|
29
|
+
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], count: [{ type: i0.Input, args: [{ isSignal: true, alias: "count", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], content: [{ type: i0.ViewChild, args: ['content', { isSignal: true }] }] } });
|
|
30
|
+
|
|
31
|
+
let nextId = 0;
|
|
32
|
+
// Which query parameters are already claimed, so two strips on one screen cannot
|
|
33
|
+
// quietly fight over the same one. Dev-only bookkeeping; nothing reads it in
|
|
34
|
+
// production.
|
|
35
|
+
const claimedUrlParams = new Map();
|
|
36
|
+
/** Label → URL name. Diacritics are decomposed and dropped so "Zusätze" gives
|
|
37
|
+
* `zusatze` rather than a percent-encoded umlaut. A label with nothing sluggable
|
|
38
|
+
* in it — CJK, or bare punctuation — keeps its raw text rather than becoming an
|
|
39
|
+
* empty parameter. */
|
|
40
|
+
function slugify(label) {
|
|
41
|
+
const slug = label
|
|
42
|
+
.normalize('NFKD')
|
|
43
|
+
.replace(/\p{M}/gu, '')
|
|
44
|
+
.toLowerCase()
|
|
45
|
+
.replace(/[^a-z0-9]+/g, '-')
|
|
46
|
+
.replace(/^-+|-+$/g, '');
|
|
47
|
+
return slug || label;
|
|
48
|
+
}
|
|
49
|
+
class TabsComponent {
|
|
50
|
+
/** Index of the active tab, two-way bound. */
|
|
51
|
+
selectedIndex = model(0, ...(ngDevMode ? [{ debugName: "selectedIndex" }] : /* istanbul ignore next */ []));
|
|
52
|
+
/** Visual style of the tab strip. */
|
|
53
|
+
variant = input('line', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
54
|
+
/** When true, a tab's content is instantiated only on first activation and
|
|
55
|
+
kept alive thereafter. When false (default), all panels render eagerly. */
|
|
56
|
+
lazy = input(false, { ...(ngDevMode ? { debugName: "lazy" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
57
|
+
/** When true, the tab strip scrolls horizontally instead of wrapping. The
|
|
58
|
+
active tab is scrolled into view on selection. */
|
|
59
|
+
scrollable = input(false, { ...(ngDevMode ? { debugName: "scrollable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
60
|
+
/** When true, each tab shows a close button. Clicking it emits tabClosed with
|
|
61
|
+
the tab's value (or label as fallback) and does not switch to that tab. */
|
|
62
|
+
closable = input(false, { ...(ngDevMode ? { debugName: "closable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
63
|
+
/** Controls whether the tab list and panel are stacked horizontally (default)
|
|
64
|
+
or the tab list runs vertically beside the panel. */
|
|
65
|
+
orientation = input('horizontal', ...(ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []));
|
|
66
|
+
/**
|
|
67
|
+
* Keep the active tab in a query parameter, so it survives F5, a shared link
|
|
68
|
+
* and the Back button: `urlParam="tab"` gives `?tab=activity`. Empty (the
|
|
69
|
+
* default) leaves the URL alone, and the strip works exactly as before.
|
|
70
|
+
*
|
|
71
|
+
* The names come from each `ds-tab`'s `value` (falling back to its `label`),
|
|
72
|
+
* so there is no second list to keep in step. **Names, not indices** — writing
|
|
73
|
+
* `?tab=1` would silently repoint every old link the moment a tab is inserted.
|
|
74
|
+
* The FIRST tab writes no parameter and every write REPLACES the history
|
|
75
|
+
* entry, so a pristine screen keeps a clean address and flipping tabs does not
|
|
76
|
+
* fill the Back button.
|
|
77
|
+
*
|
|
78
|
+
* An unknown or missing name lands on the first tab rather than throwing: a
|
|
79
|
+
* URL is user input, and a stale bookmark should still open the screen.
|
|
80
|
+
*
|
|
81
|
+
* Outside a routed context the input is inert. Nothing router-shaped is even
|
|
82
|
+
* resolved until you set it — no DI lookup and, more to the point, no
|
|
83
|
+
* subscription — so a strip that never uses this costs exactly what it did
|
|
84
|
+
* before the input existed.
|
|
85
|
+
*/
|
|
86
|
+
urlParam = input('', ...(ngDevMode ? [{ debugName: "urlParam" }] : /* istanbul ignore next */ []));
|
|
87
|
+
/** Reopen the tab this screen was last left on, per path, from `sessionStorage`.
|
|
88
|
+
* Off by default, and needs `urlParam` for the names — a remembered INDEX would
|
|
89
|
+
* repoint the moment a tab is inserted. A link always wins: the parameter is read
|
|
90
|
+
* first, memory only fills the gap the first tab leaves in the URL. Session, not
|
|
91
|
+
* local, so tomorrow is a fresh visit. */
|
|
92
|
+
rememberLastTab = input(false, { ...(ngDevMode ? { debugName: "rememberLastTab" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
93
|
+
/** Emitted when a close button is clicked. Carries the tab's value input, or
|
|
94
|
+
its label when value is not set. The host is responsible for removing the
|
|
95
|
+
tab from its list. */
|
|
96
|
+
tabClosed = output();
|
|
97
|
+
host = inject((ElementRef));
|
|
98
|
+
uid = `ds-tabs-${++nextId}`;
|
|
99
|
+
tabs = contentChildren(TabComponent, ...(ngDevMode ? [{ debugName: "tabs" }] : /* istanbul ignore next */ []));
|
|
100
|
+
// Nothing router-shaped is touched until `urlParam` is set: no DI lookup, and
|
|
101
|
+
// above all no subscription. A tab strip is perfectly valid outside a routed
|
|
102
|
+
// context — in a dialog, on a static page — and most are, so the default must
|
|
103
|
+
// cost nothing. Resolved through the component's own Injector rather than
|
|
104
|
+
// `inject(Router)` at construction, which would run for every instance.
|
|
105
|
+
injector = inject(Injector);
|
|
106
|
+
router = null;
|
|
107
|
+
route = null;
|
|
108
|
+
urlParams = signal(null, ...(ngDevMode ? [{ debugName: "urlParams" }] : /* istanbul ignore next */ []));
|
|
109
|
+
constructor() {
|
|
110
|
+
/**
|
|
111
|
+
* Two strips sharing a parameter is the failure mode of going round a screen
|
|
112
|
+
* turning this on: `tab` is the obvious name, so the second strip takes it
|
|
113
|
+
* too, and from then on each write erases the other's tab. Nothing throws and
|
|
114
|
+
* the URL looks plausible — it just restores the wrong tab on reload.
|
|
115
|
+
*/
|
|
116
|
+
if (isDevMode()) {
|
|
117
|
+
effect((onCleanup) => {
|
|
118
|
+
const param = this.urlParam();
|
|
119
|
+
if (!param) {
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
const held = claimedUrlParams.get(param) ?? 0;
|
|
123
|
+
if (held > 0) {
|
|
124
|
+
console.warn(`[ds-tabs] urlParam="${param}" is already used by another ds-tabs on this screen. Both strips write the same query parameter, so each one erases the other's tab and a reload restores whichever wrote last. Give each strip its own name.`);
|
|
125
|
+
}
|
|
126
|
+
claimedUrlParams.set(param, held + 1);
|
|
127
|
+
// onCleanup alone: it runs before every re-run AND on destroy, so
|
|
128
|
+
// releasing again from a DestroyRef would double-count the way out.
|
|
129
|
+
onCleanup(() => {
|
|
130
|
+
const now = (claimedUrlParams.get(param) ?? 1) - 1;
|
|
131
|
+
if (now > 0) {
|
|
132
|
+
claimedUrlParams.set(param, now);
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
claimedUrlParams.delete(param);
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
// Subscribe only while the feature is on, and drop the subscription again if
|
|
141
|
+
// `urlParam` is cleared.
|
|
142
|
+
effect((onCleanup) => {
|
|
143
|
+
if (!this.urlParam() || !this.resolveRouting()) {
|
|
144
|
+
this.urlParams.set(null);
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
const subscription = this.route.queryParamMap.subscribe((map) => this.urlParams.set(map));
|
|
148
|
+
onCleanup(() => subscription.unsubscribe());
|
|
149
|
+
});
|
|
150
|
+
// URL -> tab. Runs again when the tabs arrive (content children resolve
|
|
151
|
+
// after the first pass) and on every Back/Forward, which is what makes the
|
|
152
|
+
// history walk the tabs. Writing back is guarded by the equality check
|
|
153
|
+
// below, so this cannot loop with `writeUrl`.
|
|
154
|
+
effect(() => {
|
|
155
|
+
const param = this.urlParam();
|
|
156
|
+
const params = this.urlParams();
|
|
157
|
+
const tabs = this.tabs();
|
|
158
|
+
if (!param || !params || tabs.length === 0) {
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
const target = params.get(param) ?? this.rememberedName();
|
|
162
|
+
const found = target
|
|
163
|
+
? tabs.findIndex((tab) => this.tabName(tab) === target)
|
|
164
|
+
: 0;
|
|
165
|
+
const index = found < 0 ? 0 : found;
|
|
166
|
+
if (index !== this.selectedIndex()) {
|
|
167
|
+
this.selectedIndex.set(index);
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
/** Resolves the router pair on first use. Null outside a routed context, which
|
|
172
|
+
* makes `urlParam` inert there rather than an error. */
|
|
173
|
+
resolveRouting() {
|
|
174
|
+
this.router ??= this.injector.get(Router, null);
|
|
175
|
+
this.route ??= this.injector.get(ActivatedRoute, null);
|
|
176
|
+
return !!this.router && !!this.route;
|
|
177
|
+
}
|
|
178
|
+
/** The tab's name AS IT APPEARS IN THE URL, and deliberately NOT what
|
|
179
|
+
* `tabClosed` emits — that stays the label, because a host matches it against
|
|
180
|
+
* its own list. A slug is still derived from display copy, so renaming a tab
|
|
181
|
+
* still breaks saved links; `value` is the only fix for that. */
|
|
182
|
+
tabName(tab) {
|
|
183
|
+
return tab.value() ?? slugify(tab.label());
|
|
184
|
+
}
|
|
185
|
+
/** Storage key for `rememberLastTab`: the path plus the parameter name. Per
|
|
186
|
+
* path because that is the screen a reader returns to, and the parameter is
|
|
187
|
+
* what keeps two strips on one path apart — which the dev warning above
|
|
188
|
+
* already insists is unique. */
|
|
189
|
+
memoryKey() {
|
|
190
|
+
const param = this.urlParam();
|
|
191
|
+
if (!this.rememberLastTab() || !param || !this.resolveRouting()) {
|
|
192
|
+
return null;
|
|
193
|
+
}
|
|
194
|
+
return `ds-tabs:${this.router.url.split('?')[0]}:${param}`;
|
|
195
|
+
}
|
|
196
|
+
/** Every access is wrapped: Safari in private mode throws on write, and a
|
|
197
|
+
* quota error must not take a tab strip down with it. Same guard as
|
|
198
|
+
* `ds-table`'s persisted layout. */
|
|
199
|
+
rememberedName() {
|
|
200
|
+
const key = this.memoryKey();
|
|
201
|
+
if (!key) {
|
|
202
|
+
return null;
|
|
203
|
+
}
|
|
204
|
+
try {
|
|
205
|
+
return sessionStorage.getItem(key);
|
|
206
|
+
}
|
|
207
|
+
catch {
|
|
208
|
+
return null;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
remember(index) {
|
|
212
|
+
const key = this.memoryKey();
|
|
213
|
+
const tab = this.tabs()[index];
|
|
214
|
+
if (!key || !tab) {
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
try {
|
|
218
|
+
// Stored for the first tab too, which writes no parameter: without that,
|
|
219
|
+
// deliberately going back to tab one would be forgotten and the next visit
|
|
220
|
+
// would reopen the tab before it.
|
|
221
|
+
sessionStorage.setItem(key, this.tabName(tab));
|
|
222
|
+
}
|
|
223
|
+
catch {
|
|
224
|
+
// Storage unavailable — the strip simply stops remembering.
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
writeUrl(index) {
|
|
228
|
+
this.remember(index);
|
|
229
|
+
const param = this.urlParam();
|
|
230
|
+
if (!param || !this.resolveRouting()) {
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
const tab = this.tabs()[index];
|
|
234
|
+
void this.router.navigate([], {
|
|
235
|
+
relativeTo: this.route,
|
|
236
|
+
queryParams: { [param]: index === 0 || !tab ? null : this.tabName(tab) },
|
|
237
|
+
queryParamsHandling: 'merge',
|
|
238
|
+
replaceUrl: true,
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
/** Tracks which tab indices have ever been activated (for lazy rendering). */
|
|
242
|
+
activatedIndices = signal(new Set([0]), ...(ngDevMode ? [{ debugName: "activatedIndices" }] : /* istanbul ignore next */ []));
|
|
243
|
+
tabId(index) {
|
|
244
|
+
return `${this.uid}-tab-${index}`;
|
|
245
|
+
}
|
|
246
|
+
panelId(index) {
|
|
247
|
+
return `${this.uid}-panel-${index}`;
|
|
248
|
+
}
|
|
249
|
+
tablistClasses = computed(() => {
|
|
250
|
+
const parts = ['tabs'];
|
|
251
|
+
if (this.variant() === 'pills') {
|
|
252
|
+
parts.push('pills');
|
|
253
|
+
}
|
|
254
|
+
if (this.scrollable()) {
|
|
255
|
+
parts.push('scrollable');
|
|
256
|
+
}
|
|
257
|
+
if (this.orientation() === 'vertical') {
|
|
258
|
+
parts.push('vertical');
|
|
259
|
+
}
|
|
260
|
+
return parts.join(' ');
|
|
261
|
+
}, ...(ngDevMode ? [{ debugName: "tablistClasses" }] : /* istanbul ignore next */ []));
|
|
262
|
+
/** Whether the panel for a given index should be rendered (lazy gate). */
|
|
263
|
+
isPanelVisible(index) {
|
|
264
|
+
if (!this.lazy()) {
|
|
265
|
+
return index === this.selectedIndex();
|
|
266
|
+
}
|
|
267
|
+
return this.activatedIndices().has(index);
|
|
268
|
+
}
|
|
269
|
+
tabClasses(index, disabled) {
|
|
270
|
+
const parts = ['tab'];
|
|
271
|
+
if (index === this.selectedIndex()) {
|
|
272
|
+
parts.push('active');
|
|
273
|
+
}
|
|
274
|
+
if (disabled) {
|
|
275
|
+
parts.push('disabled');
|
|
276
|
+
}
|
|
277
|
+
return parts.join(' ');
|
|
278
|
+
}
|
|
279
|
+
select(index, disabled) {
|
|
280
|
+
if (disabled) {
|
|
281
|
+
return;
|
|
282
|
+
}
|
|
283
|
+
this.selectedIndex.set(index);
|
|
284
|
+
this.writeUrl(index);
|
|
285
|
+
if (this.lazy()) {
|
|
286
|
+
this.activatedIndices.update((previous) => {
|
|
287
|
+
if (previous.has(index)) {
|
|
288
|
+
return previous;
|
|
289
|
+
}
|
|
290
|
+
return new Set([...previous, index]);
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
if (this.scrollable()) {
|
|
294
|
+
setTimeout(() => {
|
|
295
|
+
const button = this.host.nativeElement.querySelector(`#${this.tabId(index)}`);
|
|
296
|
+
button?.scrollIntoView({ block: 'nearest', inline: 'nearest' });
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
onCloseClick(event, index) {
|
|
301
|
+
event.stopPropagation();
|
|
302
|
+
this.closeTab(index);
|
|
303
|
+
}
|
|
304
|
+
closeTab(index) {
|
|
305
|
+
const tab = this.tabs()[index];
|
|
306
|
+
if (!tab) {
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
this.tabClosed.emit(tab.value() ?? tab.label());
|
|
310
|
+
}
|
|
311
|
+
/** Roving keyboard navigation across the tablist (APG automatic activation).
|
|
312
|
+
Arrow axis follows orientation: Left/Right for horizontal, Up/Down for vertical. */
|
|
313
|
+
onKeydown(event, index) {
|
|
314
|
+
const count = this.tabs().length;
|
|
315
|
+
if (!count) {
|
|
316
|
+
return;
|
|
317
|
+
}
|
|
318
|
+
// APG: Delete removes the focused tab when the tablist is closable.
|
|
319
|
+
if (this.closable() && event.key === 'Delete') {
|
|
320
|
+
event.preventDefault();
|
|
321
|
+
this.closeTab(index);
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
324
|
+
const isVertical = this.orientation() === 'vertical';
|
|
325
|
+
const forwardKey = isVertical ? 'ArrowDown' : 'ArrowRight';
|
|
326
|
+
const backwardKey = isVertical ? 'ArrowUp' : 'ArrowLeft';
|
|
327
|
+
// Keep both axes active so vertical also responds to Left/Right and
|
|
328
|
+
// horizontal also responds to Up/Down for cross-axis discoverability,
|
|
329
|
+
// matching the ARIA APG recommendation for roving tabindex.
|
|
330
|
+
const forward = event.key === forwardKey ||
|
|
331
|
+
(!isVertical && event.key === 'ArrowDown') ||
|
|
332
|
+
(isVertical && event.key === 'ArrowRight');
|
|
333
|
+
const backward = event.key === backwardKey ||
|
|
334
|
+
(!isVertical && event.key === 'ArrowUp') ||
|
|
335
|
+
(isVertical && event.key === 'ArrowLeft');
|
|
336
|
+
let next;
|
|
337
|
+
if (forward) {
|
|
338
|
+
next = (index + 1) % count;
|
|
339
|
+
}
|
|
340
|
+
else if (backward) {
|
|
341
|
+
next = (index - 1 + count) % count;
|
|
342
|
+
}
|
|
343
|
+
else if (event.key === 'Home') {
|
|
344
|
+
next = 0;
|
|
345
|
+
}
|
|
346
|
+
else if (event.key === 'End') {
|
|
347
|
+
next = count - 1;
|
|
348
|
+
}
|
|
349
|
+
else {
|
|
350
|
+
return;
|
|
351
|
+
}
|
|
352
|
+
event.preventDefault();
|
|
353
|
+
// Skip disabled tabs in the travel direction.
|
|
354
|
+
const step = backward || event.key === 'End' ? -1 : 1;
|
|
355
|
+
let guard = 0;
|
|
356
|
+
while (this.tabs()[next]?.disabled() && guard < count) {
|
|
357
|
+
next = (next + step + count) % count;
|
|
358
|
+
guard++;
|
|
359
|
+
}
|
|
360
|
+
this.select(next, this.tabs()[next]?.disabled() ?? false);
|
|
361
|
+
setTimeout(() => {
|
|
362
|
+
const element = this.host.nativeElement.querySelector(`#${this.tabId(next)}`);
|
|
363
|
+
element?.focus();
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: TabsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
367
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: TabsComponent, isStandalone: true, selector: "ds-tabs", inputs: { selectedIndex: { classPropertyName: "selectedIndex", publicName: "selectedIndex", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, lazy: { classPropertyName: "lazy", publicName: "lazy", isSignal: true, isRequired: false, transformFunction: null }, scrollable: { classPropertyName: "scrollable", publicName: "scrollable", isSignal: true, isRequired: false, transformFunction: null }, closable: { classPropertyName: "closable", publicName: "closable", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, urlParam: { classPropertyName: "urlParam", publicName: "urlParam", isSignal: true, isRequired: false, transformFunction: null }, rememberLastTab: { classPropertyName: "rememberLastTab", publicName: "rememberLastTab", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectedIndex: "selectedIndexChange", tabClosed: "tabClosed" }, host: { properties: { "class.vertical-host": "orientation() === 'vertical'" } }, queries: [{ propertyName: "tabs", predicate: TabComponent, isSignal: true }], ngImport: i0, template: "<div\n role=\"tablist\"\n [class]=\"tablistClasses()\"\n [attr.aria-orientation]=\"orientation()\"\n>\n @for (tab of tabs(); track $index) {\n <button\n type=\"button\"\n role=\"tab\"\n [id]=\"tabId($index)\"\n [class]=\"tabClasses($index, tab.disabled())\"\n [attr.aria-selected]=\"$index === selectedIndex()\"\n [attr.aria-controls]=\"panelId($index)\"\n [attr.tabindex]=\"$index === selectedIndex() ? 0 : -1\"\n [disabled]=\"tab.disabled()\"\n (click)=\"select($index, tab.disabled())\"\n (keydown)=\"onKeydown($event, $index)\"\n >\n @if (tab.icon()) {\n <ds-icon\n [name]=\"tab.icon()!\"\n [size]=\"14\"\n >\n </ds-icon>\n }\n\n <span>\n {{ tab.label() }}\n </span>\n\n @if (tab.count() !== null) {\n <span class=\"badge neutral count\">\n {{ tab.count() }}\n </span>\n }\n\n @if (closable()) {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- mouse affordance; keyboard closes the focused tab via Delete (see onKeydown) -->\n <span\n class=\"tab-close\"\n [attr.aria-label]=\"'Close ' + tab.label()\"\n (click)=\"onCloseClick($event, $index)\"\n >\n <ds-icon\n name=\"x\"\n [size]=\"12\"\n >\n </ds-icon>\n </span>\n }\n </button>\n }\n</div>\n\n@for (tab of tabs(); track $index) {\n @if (isPanelVisible($index)) {\n <div\n class=\"panel\"\n role=\"tabpanel\"\n tabindex=\"0\"\n [id]=\"panelId($index)\"\n [attr.aria-labelledby]=\"tabId($index)\"\n [hidden]=\"$index !== selectedIndex()\"\n >\n <ng-container *ngTemplateOutlet=\"tab.content()\"></ng-container>\n </div>\n }\n}\n", styles: ["@charset \"UTF-8\";:host{--_tabs-divider: var(--ds-tabs-divider, var(--border-divider));--_tab-pad-x: var(--ds-tab-pad-x, var(--space-4));--_tab-pad-y: var(--ds-tab-pad-y, var(--space-3));--_tab-pad-top: var(--ds-tab-pad-top, var(--_tab-pad-y));--_tab-pad-bottom: var(--ds-tab-pad-bottom, var(--_tab-pad-y));--_tab-label-weight: var(--ds-tab-label-weight, var(--font-weight-semibold));--_tab-label-font-size: var(--ds-tab-label-font-size, var(--font-size-s));--_tabs-strip-gap: var(--ds-tabs-strip-gap, var(--space-2));--_tabs-panel-pad-top: var(--ds-tabs-panel-pad-top, var(--space-3));--_tab-label-color: var(--ds-tab-label-color, var(--text-secondary));--_tab-label-color-hover: var(--ds-tab-label-color-hover, var(--text-primary));--_tab-label-color-active: var(--ds-tab-label-color-active, var(--accent));--_tab-indicator-color: var(--ds-tab-indicator-color, var(--accent));--_tab-indicator-width: var(--ds-tab-indicator-width, var(--border-width-strong));--_tabs-pills-bg-color: var(--ds-tabs-pills-bg-color, var(--surface-secondary));--_tab-pill-bg-color-hover: var(--ds-tab-pill-bg-color-hover, var(--accent-subtitle));--_tab-pill-bg-color-active: var(--ds-tab-pill-bg-color-active, var(--surface-default));--_tab-pill-bg-color-active-hover: var(--ds-tab-pill-bg-color-active-hover, var(--accent-subtitle));--_tab-pill-label-color-active: var(--ds-tab-pill-label-color-active, var(--accent-strong));--_tab-pill-radius: var(--ds-tab-pill-radius, var(--ds-radius-control));--_tabs-focus-shadow: var(--ds-tabs-focus-shadow, var(--ds-control-focus-shadow));--_tab-badge-bg-color: var(--ds-tab-badge-bg-color, var(--surface-secondary));--_tab-badge-label-color: var(--ds-tab-badge-label-color, var(--text-secondary));--_tab-close-icon-color: var(--ds-tab-close-icon-color, var(--text-tertiary));--_tab-close-bg-color-hover: var(--ds-tab-close-bg-color-hover, var(--surface-secondary));display:block}.tabs{display:flex;gap:var(--_tabs-strip-gap);border-bottom:var(--border-width-default) solid var(--_tabs-divider)}.tabs.scrollable{overflow-x:auto;flex-wrap:nowrap;scrollbar-width:none}.tabs.scrollable::-webkit-scrollbar{display:none}.tabs .tab{display:inline-flex;align-items:center;gap:var(--space-2);padding:var(--_tab-pad-top) var(--_tab-pad-x) var(--_tab-pad-bottom);border:0;background:transparent;font:var(--_tab-label-weight) var(--_tab-label-font-size)/var(--line-height-flat) var(--font-sans);color:var(--_tab-label-color);cursor:pointer;border-bottom:var(--_tab-indicator-width) solid transparent;margin-bottom:calc(-1 * var(--border-width-default));white-space:nowrap;flex-shrink:0;transition:background-color var(--duration-fast) var(--ease-standard),color var(--duration-fast) var(--ease-standard),border-color var(--duration-fast) var(--ease-standard)}.tabs .tab:hover{color:var(--_tab-label-color-hover)}.tabs .tab.active{color:var(--_tab-label-color-active);border-bottom-color:var(--_tab-indicator-color)}.tabs .tab .badge{min-width:var(--badge-count-size);height:var(--badge-count-size);padding:0 var(--space-1-5);display:inline-grid;place-items:center;border-radius:var(--radius-pill);font:var(--font-weight-bold) var(--font-size-2xs)/var(--line-height-base) var(--font-sans);letter-spacing:var(--letter-spacing-wide);white-space:nowrap;background:var(--_tab-badge-bg-color);color:var(--_tab-badge-label-color);margin-left:var(--space-1)}.tabs .tab .tab-close{display:inline-flex;align-items:center;justify-content:center;width:var(--icon-md);height:var(--icon-md);border-radius:var(--ds-radius-inner);color:var(--_tab-close-icon-color);margin-left:var(--space-1);cursor:pointer;transition:background-color var(--duration-fast) var(--ease-standard),color var(--duration-fast) var(--ease-standard)}.tabs .tab .tab-close:hover{background-color:var(--_tab-close-bg-color-hover);color:var(--text-primary)}.tabs .tab:focus-visible{outline:none;box-shadow:var(--_tabs-focus-shadow);border-radius:var(--radius-sm)}.tabs .tab:active:not(:disabled,[disabled],.is-disabled){filter:brightness(var(--ds-press-brightness, .9));transform:scale(var(--ds-press-scale, .97))}.tabs .tab[disabled],.tabs .tab.disabled{color:var(--text-disabled);cursor:not-allowed}:host(.secondary) .tab.active{--_tab-label-color-active: var(--ds-tab-label-color-active, var(--secondary-strong));--_tab-indicator-color: var(--ds-tab-indicator-color, var(--secondary))}.tabs.pills{border-bottom:0;gap:var(--space-1);padding:var(--space-1);background-color:var(--_tabs-pills-bg-color);border-radius:var(--_tab-pill-radius);display:inline-flex}.tabs.pills .tab{padding:var(--space-2) var(--space-3);border-bottom:0;margin-bottom:0;border-radius:var(--_tab-pill-radius);color:var(--_tab-label-color)}.tabs.pills .tab:hover{background-color:var(--_tab-pill-bg-color-hover);color:var(--_tab-label-color-hover)}.tabs.pills .tab.active{background-color:var(--_tab-pill-bg-color-active);color:var(--_tab-pill-label-color-active);border-bottom:0;box-shadow:var(--shadow-1)}.tabs.pills .tab.active:hover{background-color:var(--_tab-pill-bg-color-active-hover)}.tabs.pills.scrollable{display:flex;width:100%}.tabs.vertical{flex-direction:column;border-bottom:0;border-right:var(--border-width-default) solid var(--_tabs-divider);gap:var(--space-1)}.tabs.vertical .tab{border-bottom:0;margin-bottom:0;border-right:var(--_tab-indicator-width) solid transparent;margin-right:calc(-1 * var(--border-width-default));text-align:left;justify-content:flex-start}.tabs.vertical .tab.active{color:var(--_tab-label-color-active);border-bottom-color:transparent;border-right-color:var(--_tab-indicator-color)}:host(.vertical-host){display:flex;flex-direction:row;align-items:flex-start;gap:var(--space-4)}.panel{padding-top:var(--_tabs-panel-pad-top)}.panel:empty{display:none}.panel[hidden]{display:none}:host(.vertical-host) .panel{padding-top:0;padding-left:var(--space-4);flex:1;min-width:0}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }] });
|
|
368
|
+
}
|
|
369
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: TabsComponent, decorators: [{
|
|
370
|
+
type: Component,
|
|
371
|
+
args: [{ selector: 'ds-tabs', standalone: true, imports: [NgTemplateOutlet, IconComponent], encapsulation: ViewEncapsulation.Emulated, host: {
|
|
372
|
+
'[class.vertical-host]': "orientation() === 'vertical'",
|
|
373
|
+
}, template: "<div\n role=\"tablist\"\n [class]=\"tablistClasses()\"\n [attr.aria-orientation]=\"orientation()\"\n>\n @for (tab of tabs(); track $index) {\n <button\n type=\"button\"\n role=\"tab\"\n [id]=\"tabId($index)\"\n [class]=\"tabClasses($index, tab.disabled())\"\n [attr.aria-selected]=\"$index === selectedIndex()\"\n [attr.aria-controls]=\"panelId($index)\"\n [attr.tabindex]=\"$index === selectedIndex() ? 0 : -1\"\n [disabled]=\"tab.disabled()\"\n (click)=\"select($index, tab.disabled())\"\n (keydown)=\"onKeydown($event, $index)\"\n >\n @if (tab.icon()) {\n <ds-icon\n [name]=\"tab.icon()!\"\n [size]=\"14\"\n >\n </ds-icon>\n }\n\n <span>\n {{ tab.label() }}\n </span>\n\n @if (tab.count() !== null) {\n <span class=\"badge neutral count\">\n {{ tab.count() }}\n </span>\n }\n\n @if (closable()) {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- mouse affordance; keyboard closes the focused tab via Delete (see onKeydown) -->\n <span\n class=\"tab-close\"\n [attr.aria-label]=\"'Close ' + tab.label()\"\n (click)=\"onCloseClick($event, $index)\"\n >\n <ds-icon\n name=\"x\"\n [size]=\"12\"\n >\n </ds-icon>\n </span>\n }\n </button>\n }\n</div>\n\n@for (tab of tabs(); track $index) {\n @if (isPanelVisible($index)) {\n <div\n class=\"panel\"\n role=\"tabpanel\"\n tabindex=\"0\"\n [id]=\"panelId($index)\"\n [attr.aria-labelledby]=\"tabId($index)\"\n [hidden]=\"$index !== selectedIndex()\"\n >\n <ng-container *ngTemplateOutlet=\"tab.content()\"></ng-container>\n </div>\n }\n}\n", styles: ["@charset \"UTF-8\";:host{--_tabs-divider: var(--ds-tabs-divider, var(--border-divider));--_tab-pad-x: var(--ds-tab-pad-x, var(--space-4));--_tab-pad-y: var(--ds-tab-pad-y, var(--space-3));--_tab-pad-top: var(--ds-tab-pad-top, var(--_tab-pad-y));--_tab-pad-bottom: var(--ds-tab-pad-bottom, var(--_tab-pad-y));--_tab-label-weight: var(--ds-tab-label-weight, var(--font-weight-semibold));--_tab-label-font-size: var(--ds-tab-label-font-size, var(--font-size-s));--_tabs-strip-gap: var(--ds-tabs-strip-gap, var(--space-2));--_tabs-panel-pad-top: var(--ds-tabs-panel-pad-top, var(--space-3));--_tab-label-color: var(--ds-tab-label-color, var(--text-secondary));--_tab-label-color-hover: var(--ds-tab-label-color-hover, var(--text-primary));--_tab-label-color-active: var(--ds-tab-label-color-active, var(--accent));--_tab-indicator-color: var(--ds-tab-indicator-color, var(--accent));--_tab-indicator-width: var(--ds-tab-indicator-width, var(--border-width-strong));--_tabs-pills-bg-color: var(--ds-tabs-pills-bg-color, var(--surface-secondary));--_tab-pill-bg-color-hover: var(--ds-tab-pill-bg-color-hover, var(--accent-subtitle));--_tab-pill-bg-color-active: var(--ds-tab-pill-bg-color-active, var(--surface-default));--_tab-pill-bg-color-active-hover: var(--ds-tab-pill-bg-color-active-hover, var(--accent-subtitle));--_tab-pill-label-color-active: var(--ds-tab-pill-label-color-active, var(--accent-strong));--_tab-pill-radius: var(--ds-tab-pill-radius, var(--ds-radius-control));--_tabs-focus-shadow: var(--ds-tabs-focus-shadow, var(--ds-control-focus-shadow));--_tab-badge-bg-color: var(--ds-tab-badge-bg-color, var(--surface-secondary));--_tab-badge-label-color: var(--ds-tab-badge-label-color, var(--text-secondary));--_tab-close-icon-color: var(--ds-tab-close-icon-color, var(--text-tertiary));--_tab-close-bg-color-hover: var(--ds-tab-close-bg-color-hover, var(--surface-secondary));display:block}.tabs{display:flex;gap:var(--_tabs-strip-gap);border-bottom:var(--border-width-default) solid var(--_tabs-divider)}.tabs.scrollable{overflow-x:auto;flex-wrap:nowrap;scrollbar-width:none}.tabs.scrollable::-webkit-scrollbar{display:none}.tabs .tab{display:inline-flex;align-items:center;gap:var(--space-2);padding:var(--_tab-pad-top) var(--_tab-pad-x) var(--_tab-pad-bottom);border:0;background:transparent;font:var(--_tab-label-weight) var(--_tab-label-font-size)/var(--line-height-flat) var(--font-sans);color:var(--_tab-label-color);cursor:pointer;border-bottom:var(--_tab-indicator-width) solid transparent;margin-bottom:calc(-1 * var(--border-width-default));white-space:nowrap;flex-shrink:0;transition:background-color var(--duration-fast) var(--ease-standard),color var(--duration-fast) var(--ease-standard),border-color var(--duration-fast) var(--ease-standard)}.tabs .tab:hover{color:var(--_tab-label-color-hover)}.tabs .tab.active{color:var(--_tab-label-color-active);border-bottom-color:var(--_tab-indicator-color)}.tabs .tab .badge{min-width:var(--badge-count-size);height:var(--badge-count-size);padding:0 var(--space-1-5);display:inline-grid;place-items:center;border-radius:var(--radius-pill);font:var(--font-weight-bold) var(--font-size-2xs)/var(--line-height-base) var(--font-sans);letter-spacing:var(--letter-spacing-wide);white-space:nowrap;background:var(--_tab-badge-bg-color);color:var(--_tab-badge-label-color);margin-left:var(--space-1)}.tabs .tab .tab-close{display:inline-flex;align-items:center;justify-content:center;width:var(--icon-md);height:var(--icon-md);border-radius:var(--ds-radius-inner);color:var(--_tab-close-icon-color);margin-left:var(--space-1);cursor:pointer;transition:background-color var(--duration-fast) var(--ease-standard),color var(--duration-fast) var(--ease-standard)}.tabs .tab .tab-close:hover{background-color:var(--_tab-close-bg-color-hover);color:var(--text-primary)}.tabs .tab:focus-visible{outline:none;box-shadow:var(--_tabs-focus-shadow);border-radius:var(--radius-sm)}.tabs .tab:active:not(:disabled,[disabled],.is-disabled){filter:brightness(var(--ds-press-brightness, .9));transform:scale(var(--ds-press-scale, .97))}.tabs .tab[disabled],.tabs .tab.disabled{color:var(--text-disabled);cursor:not-allowed}:host(.secondary) .tab.active{--_tab-label-color-active: var(--ds-tab-label-color-active, var(--secondary-strong));--_tab-indicator-color: var(--ds-tab-indicator-color, var(--secondary))}.tabs.pills{border-bottom:0;gap:var(--space-1);padding:var(--space-1);background-color:var(--_tabs-pills-bg-color);border-radius:var(--_tab-pill-radius);display:inline-flex}.tabs.pills .tab{padding:var(--space-2) var(--space-3);border-bottom:0;margin-bottom:0;border-radius:var(--_tab-pill-radius);color:var(--_tab-label-color)}.tabs.pills .tab:hover{background-color:var(--_tab-pill-bg-color-hover);color:var(--_tab-label-color-hover)}.tabs.pills .tab.active{background-color:var(--_tab-pill-bg-color-active);color:var(--_tab-pill-label-color-active);border-bottom:0;box-shadow:var(--shadow-1)}.tabs.pills .tab.active:hover{background-color:var(--_tab-pill-bg-color-active-hover)}.tabs.pills.scrollable{display:flex;width:100%}.tabs.vertical{flex-direction:column;border-bottom:0;border-right:var(--border-width-default) solid var(--_tabs-divider);gap:var(--space-1)}.tabs.vertical .tab{border-bottom:0;margin-bottom:0;border-right:var(--_tab-indicator-width) solid transparent;margin-right:calc(-1 * var(--border-width-default));text-align:left;justify-content:flex-start}.tabs.vertical .tab.active{color:var(--_tab-label-color-active);border-bottom-color:transparent;border-right-color:var(--_tab-indicator-color)}:host(.vertical-host){display:flex;flex-direction:row;align-items:flex-start;gap:var(--space-4)}.panel{padding-top:var(--_tabs-panel-pad-top)}.panel:empty{display:none}.panel[hidden]{display:none}:host(.vertical-host) .panel{padding-top:0;padding-left:var(--space-4);flex:1;min-width:0}\n"] }]
|
|
374
|
+
}], ctorParameters: () => [], propDecorators: { selectedIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedIndex", required: false }] }, { type: i0.Output, args: ["selectedIndexChange"] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], lazy: [{ type: i0.Input, args: [{ isSignal: true, alias: "lazy", required: false }] }], scrollable: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollable", required: false }] }], closable: [{ type: i0.Input, args: [{ isSignal: true, alias: "closable", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], urlParam: [{ type: i0.Input, args: [{ isSignal: true, alias: "urlParam", required: false }] }], rememberLastTab: [{ type: i0.Input, args: [{ isSignal: true, alias: "rememberLastTab", required: false }] }], tabClosed: [{ type: i0.Output, args: ["tabClosed"] }], tabs: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => TabComponent), { isSignal: true }] }] } });
|
|
375
|
+
|
|
376
|
+
/**
|
|
377
|
+
* Generated bundle index. Do not edit.
|
|
378
|
+
*/
|
|
379
|
+
|
|
380
|
+
export { TabComponent, TabsComponent };
|
|
381
|
+
//# sourceMappingURL=ids-group-ltd-ids-design-system-components-tabs.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ids-group-ltd-ids-design-system-components-tabs.mjs","sources":["../../../src/lib/components/tabs/tab.component.ts","../../../src/lib/components/tabs/tabs.component.ts","../../../src/lib/components/tabs/tabs.component.html","../../../src/lib/components/tabs/ids-group-ltd-ids-design-system-components-tabs.ts"],"sourcesContent":["import {\n Component,\n TemplateRef,\n ViewEncapsulation,\n booleanAttribute,\n input,\n viewChild,\n} from '@angular/core';\nimport type { IconName } from '@ids-group-ltd/ids-design-system/core';\n\n@Component({\n selector: 'ds-tab',\n standalone: true,\n template: `<ng-template #content>\n <ng-content></ng-content>\n </ng-template>`,\n styles: [':host { display: none; }'],\n encapsulation: ViewEncapsulation.Emulated,\n})\nexport class TabComponent {\n /** Text shown in the tab button. */\n readonly label = input.required<string>();\n /** Icon shown before the label. */\n readonly icon = input<IconName | null>(null);\n /** Numeric badge shown after the label. */\n readonly count = input<number | null>(null);\n /** Excludes the tab from selection and keyboard navigation. */\n readonly disabled = input(false, { transform: booleanAttribute });\n /** Identifier emitted by tabClosed. Falls back to label when omitted. */\n readonly value = input<string | null>(null);\n readonly content = viewChild.required<TemplateRef<unknown>>('content');\n}\n","import { NgTemplateOutlet } from '@angular/common';\nimport {\n Component,\n ElementRef,\n ViewEncapsulation,\n booleanAttribute,\n computed,\n contentChildren,\n effect,\n inject,\n Injector,\n input,\n isDevMode,\n model,\n output,\n signal,\n} from '@angular/core';\nimport { ActivatedRoute, Router, type ParamMap } from '@angular/router';\nimport { IconComponent } from '@ids-group-ltd/ids-design-system/icons';\nimport { TabComponent } from './tab.component';\nimport type { TabsOrientation, TabsVariant } from './tabs.types';\n\nlet nextId = 0;\n\n// Which query parameters are already claimed, so two strips on one screen cannot\n// quietly fight over the same one. Dev-only bookkeeping; nothing reads it in\n// production.\nconst claimedUrlParams = new Map<string, number>();\n\n/** Label → URL name. Diacritics are decomposed and dropped so \"Zusätze\" gives\n * `zusatze` rather than a percent-encoded umlaut. A label with nothing sluggable\n * in it — CJK, or bare punctuation — keeps its raw text rather than becoming an\n * empty parameter. */\nfunction slugify(label: string): string {\n const slug = label\n .normalize('NFKD')\n .replace(/\\p{M}/gu, '')\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, '-')\n .replace(/^-+|-+$/g, '');\n\n return slug || label;\n}\n\n@Component({\n selector: 'ds-tabs',\n standalone: true,\n imports: [NgTemplateOutlet, IconComponent],\n templateUrl: './tabs.component.html',\n styleUrl: './tabs.component.scss',\n encapsulation: ViewEncapsulation.Emulated,\n host: {\n '[class.vertical-host]': \"orientation() === 'vertical'\",\n },\n})\nexport class TabsComponent {\n /** Index of the active tab, two-way bound. */\n readonly selectedIndex = model<number>(0);\n /** Visual style of the tab strip. */\n readonly variant = input<TabsVariant>('line');\n\n /** When true, a tab's content is instantiated only on first activation and\n kept alive thereafter. When false (default), all panels render eagerly. */\n readonly lazy = input(false, { transform: booleanAttribute });\n\n /** When true, the tab strip scrolls horizontally instead of wrapping. The\n active tab is scrolled into view on selection. */\n readonly scrollable = input(false, { transform: booleanAttribute });\n\n /** When true, each tab shows a close button. Clicking it emits tabClosed with\n the tab's value (or label as fallback) and does not switch to that tab. */\n readonly closable = input(false, { transform: booleanAttribute });\n\n /** Controls whether the tab list and panel are stacked horizontally (default)\n or the tab list runs vertically beside the panel. */\n readonly orientation = input<TabsOrientation>('horizontal');\n\n /**\n * Keep the active tab in a query parameter, so it survives F5, a shared link\n * and the Back button: `urlParam=\"tab\"` gives `?tab=activity`. Empty (the\n * default) leaves the URL alone, and the strip works exactly as before.\n *\n * The names come from each `ds-tab`'s `value` (falling back to its `label`),\n * so there is no second list to keep in step. **Names, not indices** — writing\n * `?tab=1` would silently repoint every old link the moment a tab is inserted.\n * The FIRST tab writes no parameter and every write REPLACES the history\n * entry, so a pristine screen keeps a clean address and flipping tabs does not\n * fill the Back button.\n *\n * An unknown or missing name lands on the first tab rather than throwing: a\n * URL is user input, and a stale bookmark should still open the screen.\n *\n * Outside a routed context the input is inert. Nothing router-shaped is even\n * resolved until you set it — no DI lookup and, more to the point, no\n * subscription — so a strip that never uses this costs exactly what it did\n * before the input existed.\n */\n readonly urlParam = input<string>('');\n\n /** Reopen the tab this screen was last left on, per path, from `sessionStorage`.\n * Off by default, and needs `urlParam` for the names — a remembered INDEX would\n * repoint the moment a tab is inserted. A link always wins: the parameter is read\n * first, memory only fills the gap the first tab leaves in the URL. Session, not\n * local, so tomorrow is a fresh visit. */\n readonly rememberLastTab = input(false, { transform: booleanAttribute });\n\n /** Emitted when a close button is clicked. Carries the tab's value input, or\n its label when value is not set. The host is responsible for removing the\n tab from its list. */\n readonly tabClosed = output<string>();\n\n private readonly host = inject(ElementRef<HTMLElement>);\n private readonly uid = `ds-tabs-${++nextId}`;\n\n protected readonly tabs = contentChildren(TabComponent);\n\n // Nothing router-shaped is touched until `urlParam` is set: no DI lookup, and\n // above all no subscription. A tab strip is perfectly valid outside a routed\n // context — in a dialog, on a static page — and most are, so the default must\n // cost nothing. Resolved through the component's own Injector rather than\n // `inject(Router)` at construction, which would run for every instance.\n private readonly injector = inject(Injector);\n private router: Router | null = null;\n private route: ActivatedRoute | null = null;\n private readonly urlParams = signal<ParamMap | null>(null);\n\n constructor() {\n /**\n * Two strips sharing a parameter is the failure mode of going round a screen\n * turning this on: `tab` is the obvious name, so the second strip takes it\n * too, and from then on each write erases the other's tab. Nothing throws and\n * the URL looks plausible — it just restores the wrong tab on reload.\n */\n if (isDevMode()) {\n effect((onCleanup) => {\n const param = this.urlParam();\n if (!param) {\n return;\n }\n const held = claimedUrlParams.get(param) ?? 0;\n if (held > 0) {\n console.warn(\n `[ds-tabs] urlParam=\"${param}\" is already used by another ds-tabs on this screen. Both strips write the same query parameter, so each one erases the other's tab and a reload restores whichever wrote last. Give each strip its own name.`,\n );\n }\n claimedUrlParams.set(param, held + 1);\n // onCleanup alone: it runs before every re-run AND on destroy, so\n // releasing again from a DestroyRef would double-count the way out.\n onCleanup(() => {\n const now = (claimedUrlParams.get(param) ?? 1) - 1;\n if (now > 0) {\n claimedUrlParams.set(param, now);\n } else {\n claimedUrlParams.delete(param);\n }\n });\n });\n }\n\n // Subscribe only while the feature is on, and drop the subscription again if\n // `urlParam` is cleared.\n effect((onCleanup) => {\n if (!this.urlParam() || !this.resolveRouting()) {\n this.urlParams.set(null);\n\n return;\n }\n const subscription = this.route!.queryParamMap.subscribe((map) =>\n this.urlParams.set(map),\n );\n onCleanup(() => subscription.unsubscribe());\n });\n\n // URL -> tab. Runs again when the tabs arrive (content children resolve\n // after the first pass) and on every Back/Forward, which is what makes the\n // history walk the tabs. Writing back is guarded by the equality check\n // below, so this cannot loop with `writeUrl`.\n effect(() => {\n const param = this.urlParam();\n const params = this.urlParams();\n const tabs = this.tabs();\n if (!param || !params || tabs.length === 0) {\n return;\n }\n const target = params.get(param) ?? this.rememberedName();\n const found = target\n ? tabs.findIndex((tab) => this.tabName(tab) === target)\n : 0;\n const index = found < 0 ? 0 : found;\n if (index !== this.selectedIndex()) {\n this.selectedIndex.set(index);\n }\n });\n }\n\n /** Resolves the router pair on first use. Null outside a routed context, which\n * makes `urlParam` inert there rather than an error. */\n private resolveRouting(): boolean {\n this.router ??= this.injector.get(Router, null);\n this.route ??= this.injector.get(ActivatedRoute, null);\n\n return !!this.router && !!this.route;\n }\n\n /** The tab's name AS IT APPEARS IN THE URL, and deliberately NOT what\n * `tabClosed` emits — that stays the label, because a host matches it against\n * its own list. A slug is still derived from display copy, so renaming a tab\n * still breaks saved links; `value` is the only fix for that. */\n private tabName(tab: TabComponent): string {\n return tab.value() ?? slugify(tab.label());\n }\n\n /** Storage key for `rememberLastTab`: the path plus the parameter name. Per\n * path because that is the screen a reader returns to, and the parameter is\n * what keeps two strips on one path apart — which the dev warning above\n * already insists is unique. */\n private memoryKey(): string | null {\n const param = this.urlParam();\n if (!this.rememberLastTab() || !param || !this.resolveRouting()) {\n return null;\n }\n\n return `ds-tabs:${this.router!.url.split('?')[0]}:${param}`;\n }\n\n /** Every access is wrapped: Safari in private mode throws on write, and a\n * quota error must not take a tab strip down with it. Same guard as\n * `ds-table`'s persisted layout. */\n private rememberedName(): string | null {\n const key = this.memoryKey();\n if (!key) {\n return null;\n }\n try {\n return sessionStorage.getItem(key);\n } catch {\n return null;\n }\n }\n\n private remember(index: number): void {\n const key = this.memoryKey();\n const tab = this.tabs()[index];\n if (!key || !tab) {\n return;\n }\n try {\n // Stored for the first tab too, which writes no parameter: without that,\n // deliberately going back to tab one would be forgotten and the next visit\n // would reopen the tab before it.\n sessionStorage.setItem(key, this.tabName(tab));\n } catch {\n // Storage unavailable — the strip simply stops remembering.\n }\n }\n\n private writeUrl(index: number): void {\n this.remember(index);\n const param = this.urlParam();\n if (!param || !this.resolveRouting()) {\n return;\n }\n const tab = this.tabs()[index];\n void this.router!.navigate([], {\n relativeTo: this.route,\n queryParams: { [param]: index === 0 || !tab ? null : this.tabName(tab) },\n queryParamsHandling: 'merge',\n replaceUrl: true,\n });\n }\n\n /** Tracks which tab indices have ever been activated (for lazy rendering). */\n private readonly activatedIndices = signal<ReadonlySet<number>>(new Set([0]));\n\n protected tabId(index: number): string {\n return `${this.uid}-tab-${index}`;\n }\n\n protected panelId(index: number): string {\n return `${this.uid}-panel-${index}`;\n }\n\n protected readonly tablistClasses = computed(() => {\n const parts = ['tabs'];\n if (this.variant() === 'pills') {\n parts.push('pills');\n }\n if (this.scrollable()) {\n parts.push('scrollable');\n }\n if (this.orientation() === 'vertical') {\n parts.push('vertical');\n }\n\n return parts.join(' ');\n });\n\n /** Whether the panel for a given index should be rendered (lazy gate). */\n protected isPanelVisible(index: number): boolean {\n if (!this.lazy()) {\n return index === this.selectedIndex();\n }\n\n return this.activatedIndices().has(index);\n }\n\n protected tabClasses(index: number, disabled: boolean): string {\n const parts = ['tab'];\n if (index === this.selectedIndex()) {\n parts.push('active');\n }\n if (disabled) {\n parts.push('disabled');\n }\n\n return parts.join(' ');\n }\n\n protected select(index: number, disabled: boolean): void {\n if (disabled) {\n return;\n }\n this.selectedIndex.set(index);\n this.writeUrl(index);\n if (this.lazy()) {\n this.activatedIndices.update((previous) => {\n if (previous.has(index)) {\n return previous;\n }\n\n return new Set([...previous, index]);\n });\n }\n if (this.scrollable()) {\n setTimeout(() => {\n const button = this.host.nativeElement.querySelector(\n `#${this.tabId(index)}`,\n ) as HTMLElement | null;\n button?.scrollIntoView({ block: 'nearest', inline: 'nearest' });\n });\n }\n }\n\n protected onCloseClick(event: MouseEvent, index: number): void {\n event.stopPropagation();\n this.closeTab(index);\n }\n\n private closeTab(index: number): void {\n const tab = this.tabs()[index];\n if (!tab) {\n return;\n }\n this.tabClosed.emit(tab.value() ?? tab.label());\n }\n\n /** Roving keyboard navigation across the tablist (APG automatic activation).\n Arrow axis follows orientation: Left/Right for horizontal, Up/Down for vertical. */\n protected onKeydown(event: KeyboardEvent, index: number): void {\n const count = this.tabs().length;\n if (!count) {\n return;\n }\n // APG: Delete removes the focused tab when the tablist is closable.\n if (this.closable() && event.key === 'Delete') {\n event.preventDefault();\n this.closeTab(index);\n\n return;\n }\n const isVertical = this.orientation() === 'vertical';\n const forwardKey = isVertical ? 'ArrowDown' : 'ArrowRight';\n const backwardKey = isVertical ? 'ArrowUp' : 'ArrowLeft';\n // Keep both axes active so vertical also responds to Left/Right and\n // horizontal also responds to Up/Down for cross-axis discoverability,\n // matching the ARIA APG recommendation for roving tabindex.\n const forward =\n event.key === forwardKey ||\n (!isVertical && event.key === 'ArrowDown') ||\n (isVertical && event.key === 'ArrowRight');\n const backward =\n event.key === backwardKey ||\n (!isVertical && event.key === 'ArrowUp') ||\n (isVertical && event.key === 'ArrowLeft');\n\n let next: number;\n if (forward) {\n next = (index + 1) % count;\n } else if (backward) {\n next = (index - 1 + count) % count;\n } else if (event.key === 'Home') {\n next = 0;\n } else if (event.key === 'End') {\n next = count - 1;\n } else {\n return;\n }\n event.preventDefault();\n // Skip disabled tabs in the travel direction.\n const step = backward || event.key === 'End' ? -1 : 1;\n let guard = 0;\n while (this.tabs()[next]?.disabled() && guard < count) {\n next = (next + step + count) % count;\n guard++;\n }\n this.select(next, this.tabs()[next]?.disabled() ?? false);\n setTimeout(() => {\n const element = this.host.nativeElement.querySelector(\n `#${this.tabId(next)}`,\n ) as HTMLElement | null;\n element?.focus();\n });\n }\n}\n","<div\n role=\"tablist\"\n [class]=\"tablistClasses()\"\n [attr.aria-orientation]=\"orientation()\"\n>\n @for (tab of tabs(); track $index) {\n <button\n type=\"button\"\n role=\"tab\"\n [id]=\"tabId($index)\"\n [class]=\"tabClasses($index, tab.disabled())\"\n [attr.aria-selected]=\"$index === selectedIndex()\"\n [attr.aria-controls]=\"panelId($index)\"\n [attr.tabindex]=\"$index === selectedIndex() ? 0 : -1\"\n [disabled]=\"tab.disabled()\"\n (click)=\"select($index, tab.disabled())\"\n (keydown)=\"onKeydown($event, $index)\"\n >\n @if (tab.icon()) {\n <ds-icon\n [name]=\"tab.icon()!\"\n [size]=\"14\"\n >\n </ds-icon>\n }\n\n <span>\n {{ tab.label() }}\n </span>\n\n @if (tab.count() !== null) {\n <span class=\"badge neutral count\">\n {{ tab.count() }}\n </span>\n }\n\n @if (closable()) {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- mouse affordance; keyboard closes the focused tab via Delete (see onKeydown) -->\n <span\n class=\"tab-close\"\n [attr.aria-label]=\"'Close ' + tab.label()\"\n (click)=\"onCloseClick($event, $index)\"\n >\n <ds-icon\n name=\"x\"\n [size]=\"12\"\n >\n </ds-icon>\n </span>\n }\n </button>\n }\n</div>\n\n@for (tab of tabs(); track $index) {\n @if (isPanelVisible($index)) {\n <div\n class=\"panel\"\n role=\"tabpanel\"\n tabindex=\"0\"\n [id]=\"panelId($index)\"\n [attr.aria-labelledby]=\"tabId($index)\"\n [hidden]=\"$index !== selectedIndex()\"\n >\n <ng-container *ngTemplateOutlet=\"tab.content()\"></ng-container>\n </div>\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index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,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAb,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,aAAa,4yCA2DkB,YAAY,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EClHxD,+2DAoEA,EAAA,MAAA,EAAA,CAAA,suLAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDrBY,gBAAgB,oJAAE,aAAa,EAAA,QAAA,EAAA,SAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,MAAA,EAAA,QAAA,EAAA,WAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;4FAQ9B,aAAa,EAAA,UAAA,EAAA,CAAA;kBAXzB,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,SAAS,EAAA,UAAA,EACP,IAAI,EAAA,OAAA,EACP,CAAC,gBAAgB,EAAE,aAAa,CAAC,EAAA,aAAA,EAG3B,iBAAiB,CAAC,QAAQ,EAAA,IAAA,EACnC;AACJ,wBAAA,uBAAuB,EAAE,8BAA8B;AACxD,qBAAA,EAAA,QAAA,EAAA,+2DAAA,EAAA,MAAA,EAAA,CAAA,suLAAA,CAAA,EAAA;y/BA6DyC,YAAY,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AElHxD;;AAEG;;;;"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, booleanAttribute, output, ViewEncapsulation, Component } from '@angular/core';
|
|
3
|
+
import { IconComponent } from '@ids-group-ltd/ids-design-system/icons';
|
|
4
|
+
|
|
5
|
+
class TagComponent {
|
|
6
|
+
/** Fill style — `solid` for high-emphasis, `neutral` for low-emphasis chips. */
|
|
7
|
+
variant = input('solid', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
8
|
+
/** Shows a close button that emits `closed`. */
|
|
9
|
+
closable = input(false, { ...(ngDevMode ? { debugName: "closable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
10
|
+
/** Makes the tag clickable, emitting `toggled` on click. */
|
|
11
|
+
interactive = input(false, { ...(ngDevMode ? { debugName: "interactive" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
12
|
+
/** Applies the active/selected visual state. */
|
|
13
|
+
selected = input(false, { ...(ngDevMode ? { debugName: "selected" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
14
|
+
/** Accessible label for the close button (e.g. "Remove Source filter"). */
|
|
15
|
+
closeLabel = input('Remove', ...(ngDevMode ? [{ debugName: "closeLabel" }] : /* istanbul ignore next */ []));
|
|
16
|
+
/** Fires when the close button is clicked. */
|
|
17
|
+
closed = output();
|
|
18
|
+
/** Fires on click when `interactive` is true. */
|
|
19
|
+
toggled = output();
|
|
20
|
+
onClick() {
|
|
21
|
+
if (this.interactive()) {
|
|
22
|
+
this.toggled.emit();
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: TagComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
26
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: TagComponent, isStandalone: true, selector: "ds-tag", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, closable: { classPropertyName: "closable", publicName: "closable", isSignal: true, isRequired: false, transformFunction: null }, interactive: { classPropertyName: "interactive", publicName: "interactive", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, closeLabel: { classPropertyName: "closeLabel", publicName: "closeLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { closed: "closed", toggled: "toggled" }, host: { listeners: { "click": "onClick()" }, properties: { "class.neutral": "variant() === 'neutral'", "class.closable": "closable()", "class.interactive": "interactive()", "class.is-active": "selected()" } }, ngImport: i0, template: "<ng-content></ng-content>\n\n@if (closable()) {\n <button\n type=\"button\"\n class=\"close\"\n [attr.aria-label]=\"closeLabel()\"\n (click)=\"$event.stopPropagation(); closed.emit()\"\n >\n <ds-icon\n name=\"x\"\n [size]=\"12\"\n />\n </button>\n}\n", styles: [":where(:focus-visible){outline:none;box-shadow:var(--ds-control-focus-shadow)}:root[data-focus=ring]{--ds-field-focus-shadow: var(--focus-ring);--ds-field-focus-shadow-error: var(--focus-ring-error)}:root[data-focus=field]{--ds-control-focus-shadow: var(--focus-field);--ds-control-focus-shadow-error: var(--focus-field-error)}:root[data-focus=edge]{--ds-field-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);--ds-field-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error);--ds-control-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);--ds-control-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error)}[data-focus=inset]{--ds-field-focus-shadow: var(--focus-ring-inset);--ds-field-focus-shadow-error: var(--focus-ring-inset-error);--ds-control-focus-shadow: var(--focus-ring-inset);--ds-control-focus-shadow-error: var(--focus-ring-inset-error)}:root[data-focus=outline]{--ds-field-focus-shadow: none;--ds-field-focus-shadow-error: none;--ds-control-focus-shadow: none;--ds-control-focus-shadow-error: none}:root[data-focus=outline] :where(:focus-visible){outline:var(--border-width-strong) solid var(--primary);outline-offset:var(--focus-ring-offset)}@media(forced-colors:active){:where(:focus-visible){outline:var(--border-width-strong) solid CanvasText;outline-offset:var(--focus-ring-offset)}}:host{--_tag-pad-y: var(--ds-tag-pad-y, var(--tag-pad-y));--_tag-pad-x: var(--ds-tag-pad-x, var(--tag-pad-x));--_tag-radius: var(--ds-tag-radius, var(--ds-radius-control));--_tag-bg-color: var(--ds-tag-bg-color, var(--accent));--_tag-label-color: var(--ds-tag-label-color, var(--accent-on));--_tag-fw: var(--ds-tag-fw, var(--font-weight-bold));--_tag-fs: var(--ds-tag-fs, var(--font-size-xs));--_tag-lh: var(--ds-tag-lh, var(--line-height-base));--_tag-hover-bg-color: var(--ds-tag-hover-bg-color, var(--surface-muted));--_tag-hover-label-color: var(--ds-tag-hover-label-color, var(--text-primary));--_tag-active-bg-color: var(--ds-tag-active-bg-color, var(--accent-muted));--_tag-active-label-color: var(--ds-tag-active-label-color, var(--accent-strong));--_tag-active-border: var(--ds-tag-active-border, var(--accent));display:inline-flex;align-items:center;gap:var(--tag-gap);padding:var(--_tag-pad-y) var(--_tag-pad-x);border-radius:var(--_tag-radius);background-color:var(--_tag-bg-color);color:var(--_tag-label-color);font:var(--_tag-fw) var(--_tag-fs)/var(--_tag-lh) var(--font-sans)}:host(.closable){padding-right:var(--tag-pad-x-close)}:host(.neutral){--_tag-bg-color: var(--ds-tag-bg-color, var(--surface-secondary));--_tag-label-color: var(--ds-tag-label-color, var(--text-primary));--_tag-border-color: var(--ds-tag-border-color, var(--border-divider));background-color:var(--_tag-bg-color);color:var(--_tag-label-color);border:var(--border-width-default) solid var(--_tag-border-color);padding:calc(var(--_tag-pad-y) - var(--border-width-default)) calc(var(--_tag-pad-x) - var(--border-width-default))}:host(.neutral.closable){padding-right:calc(var(--tag-pad-x-close) - var(--border-width-default))}:host(.interactive){cursor:pointer;-webkit-user-select:none;user-select:none;transition:background var(--duration-fast) var(--ease-standard),color var(--duration-fast) var(--ease-standard),box-shadow var(--duration-fast) var(--ease-standard)}:host(.interactive:hover):not(.is-active){background-color:var(--_tag-hover-bg-color);color:var(--_tag-hover-label-color)}:host(.interactive.is-active){background-color:var(--_tag-active-bg-color);color:var(--_tag-active-label-color);box-shadow:inset 0 0 0 var(--border-width-default) var(--_tag-active-border)}.close{display:inline-flex;align-items:center;justify-content:center;border:0;color:inherit;font:inherit;cursor:pointer;border-radius:var(--ds-radius-inner);padding:var(--tag-close-pad);margin-left:var(--tag-close-pad);background:color-mix(in oklab,currentcolor calc(var(--opacity-state-hover) * 100%),transparent);transition:background-color var(--duration-fast) var(--ease-standard)}.close:hover{background:color-mix(in oklab,currentcolor calc(var(--opacity-state-pressed) * 100%),transparent)}.close:active:not(:disabled,[disabled],.is-disabled){filter:brightness(var(--ds-press-brightness, .9));transform:scale(var(--ds-press-scale, .97))}.close:focus-visible{outline:var(--border-width-strong) solid var(--focus-ring-color);outline-offset:1px;box-shadow:none}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }] });
|
|
27
|
+
}
|
|
28
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: TagComponent, decorators: [{
|
|
29
|
+
type: Component,
|
|
30
|
+
args: [{ selector: 'ds-tag', standalone: true, imports: [IconComponent], encapsulation: ViewEncapsulation.Emulated, host: {
|
|
31
|
+
'[class.neutral]': "variant() === 'neutral'",
|
|
32
|
+
'[class.closable]': 'closable()',
|
|
33
|
+
'[class.interactive]': 'interactive()',
|
|
34
|
+
'[class.is-active]': 'selected()',
|
|
35
|
+
'(click)': 'onClick()',
|
|
36
|
+
}, template: "<ng-content></ng-content>\n\n@if (closable()) {\n <button\n type=\"button\"\n class=\"close\"\n [attr.aria-label]=\"closeLabel()\"\n (click)=\"$event.stopPropagation(); closed.emit()\"\n >\n <ds-icon\n name=\"x\"\n [size]=\"12\"\n />\n </button>\n}\n", styles: [":where(:focus-visible){outline:none;box-shadow:var(--ds-control-focus-shadow)}:root[data-focus=ring]{--ds-field-focus-shadow: var(--focus-ring);--ds-field-focus-shadow-error: var(--focus-ring-error)}:root[data-focus=field]{--ds-control-focus-shadow: var(--focus-field);--ds-control-focus-shadow-error: var(--focus-field-error)}:root[data-focus=edge]{--ds-field-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);--ds-field-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error);--ds-control-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);--ds-control-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error)}[data-focus=inset]{--ds-field-focus-shadow: var(--focus-ring-inset);--ds-field-focus-shadow-error: var(--focus-ring-inset-error);--ds-control-focus-shadow: var(--focus-ring-inset);--ds-control-focus-shadow-error: var(--focus-ring-inset-error)}:root[data-focus=outline]{--ds-field-focus-shadow: none;--ds-field-focus-shadow-error: none;--ds-control-focus-shadow: none;--ds-control-focus-shadow-error: none}:root[data-focus=outline] :where(:focus-visible){outline:var(--border-width-strong) solid var(--primary);outline-offset:var(--focus-ring-offset)}@media(forced-colors:active){:where(:focus-visible){outline:var(--border-width-strong) solid CanvasText;outline-offset:var(--focus-ring-offset)}}:host{--_tag-pad-y: var(--ds-tag-pad-y, var(--tag-pad-y));--_tag-pad-x: var(--ds-tag-pad-x, var(--tag-pad-x));--_tag-radius: var(--ds-tag-radius, var(--ds-radius-control));--_tag-bg-color: var(--ds-tag-bg-color, var(--accent));--_tag-label-color: var(--ds-tag-label-color, var(--accent-on));--_tag-fw: var(--ds-tag-fw, var(--font-weight-bold));--_tag-fs: var(--ds-tag-fs, var(--font-size-xs));--_tag-lh: var(--ds-tag-lh, var(--line-height-base));--_tag-hover-bg-color: var(--ds-tag-hover-bg-color, var(--surface-muted));--_tag-hover-label-color: var(--ds-tag-hover-label-color, var(--text-primary));--_tag-active-bg-color: var(--ds-tag-active-bg-color, var(--accent-muted));--_tag-active-label-color: var(--ds-tag-active-label-color, var(--accent-strong));--_tag-active-border: var(--ds-tag-active-border, var(--accent));display:inline-flex;align-items:center;gap:var(--tag-gap);padding:var(--_tag-pad-y) var(--_tag-pad-x);border-radius:var(--_tag-radius);background-color:var(--_tag-bg-color);color:var(--_tag-label-color);font:var(--_tag-fw) var(--_tag-fs)/var(--_tag-lh) var(--font-sans)}:host(.closable){padding-right:var(--tag-pad-x-close)}:host(.neutral){--_tag-bg-color: var(--ds-tag-bg-color, var(--surface-secondary));--_tag-label-color: var(--ds-tag-label-color, var(--text-primary));--_tag-border-color: var(--ds-tag-border-color, var(--border-divider));background-color:var(--_tag-bg-color);color:var(--_tag-label-color);border:var(--border-width-default) solid var(--_tag-border-color);padding:calc(var(--_tag-pad-y) - var(--border-width-default)) calc(var(--_tag-pad-x) - var(--border-width-default))}:host(.neutral.closable){padding-right:calc(var(--tag-pad-x-close) - var(--border-width-default))}:host(.interactive){cursor:pointer;-webkit-user-select:none;user-select:none;transition:background var(--duration-fast) var(--ease-standard),color var(--duration-fast) var(--ease-standard),box-shadow var(--duration-fast) var(--ease-standard)}:host(.interactive:hover):not(.is-active){background-color:var(--_tag-hover-bg-color);color:var(--_tag-hover-label-color)}:host(.interactive.is-active){background-color:var(--_tag-active-bg-color);color:var(--_tag-active-label-color);box-shadow:inset 0 0 0 var(--border-width-default) var(--_tag-active-border)}.close{display:inline-flex;align-items:center;justify-content:center;border:0;color:inherit;font:inherit;cursor:pointer;border-radius:var(--ds-radius-inner);padding:var(--tag-close-pad);margin-left:var(--tag-close-pad);background:color-mix(in oklab,currentcolor calc(var(--opacity-state-hover) * 100%),transparent);transition:background-color var(--duration-fast) var(--ease-standard)}.close:hover{background:color-mix(in oklab,currentcolor calc(var(--opacity-state-pressed) * 100%),transparent)}.close:active:not(:disabled,[disabled],.is-disabled){filter:brightness(var(--ds-press-brightness, .9));transform:scale(var(--ds-press-scale, .97))}.close:focus-visible{outline:var(--border-width-strong) solid var(--focus-ring-color);outline-offset:1px;box-shadow:none}\n"] }]
|
|
37
|
+
}], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], closable: [{ type: i0.Input, args: [{ isSignal: true, alias: "closable", required: false }] }], interactive: [{ type: i0.Input, args: [{ isSignal: true, alias: "interactive", required: false }] }], selected: [{ type: i0.Input, args: [{ isSignal: true, alias: "selected", required: false }] }], closeLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeLabel", required: false }] }], closed: [{ type: i0.Output, args: ["closed"] }], toggled: [{ type: i0.Output, args: ["toggled"] }] } });
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Generated bundle index. Do not edit.
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
export { TagComponent };
|
|
44
|
+
//# sourceMappingURL=ids-group-ltd-ids-design-system-components-tag.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ids-group-ltd-ids-design-system-components-tag.mjs","sources":["../../../src/lib/components/tag/tag.component.ts","../../../src/lib/components/tag/tag.component.html","../../../src/lib/components/tag/ids-group-ltd-ids-design-system-components-tag.ts"],"sourcesContent":["import {\n Component,\n ViewEncapsulation,\n booleanAttribute,\n input,\n output,\n} from '@angular/core';\nimport { IconComponent } from '@ids-group-ltd/ids-design-system/icons';\nimport type { TagVariant } from './tag.types';\n\n@Component({\n selector: 'ds-tag',\n standalone: true,\n imports: [IconComponent],\n templateUrl: './tag.component.html',\n styleUrl: './tag.component.scss',\n encapsulation: ViewEncapsulation.Emulated,\n host: {\n '[class.neutral]': \"variant() === 'neutral'\",\n '[class.closable]': 'closable()',\n '[class.interactive]': 'interactive()',\n '[class.is-active]': 'selected()',\n '(click)': 'onClick()',\n },\n})\nexport class TagComponent {\n /** Fill style — `solid` for high-emphasis, `neutral` for low-emphasis chips. */\n readonly variant = input<TagVariant>('solid');\n /** Shows a close button that emits `closed`. */\n readonly closable = input(false, { transform: booleanAttribute });\n /** Makes the tag clickable, emitting `toggled` on click. */\n readonly interactive = input(false, { transform: booleanAttribute });\n /** Applies the active/selected visual state. */\n readonly selected = input(false, { transform: booleanAttribute });\n /** Accessible label for the close button (e.g. \"Remove Source filter\"). */\n readonly closeLabel = input<string>('Remove');\n /** Fires when the close button is clicked. */\n readonly closed = output<void>();\n /** Fires on click when `interactive` is true. */\n readonly toggled = output<void>();\n\n protected onClick(): void {\n if (this.interactive()) {\n this.toggled.emit();\n }\n }\n}\n","<ng-content></ng-content>\n\n@if (closable()) {\n <button\n type=\"button\"\n class=\"close\"\n [attr.aria-label]=\"closeLabel()\"\n (click)=\"$event.stopPropagation(); closed.emit()\"\n >\n <ds-icon\n name=\"x\"\n [size]=\"12\"\n />\n </button>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAyBa,YAAY,CAAA;;AAEd,IAAA,OAAO,GAAG,KAAK,CAAa,OAAO,8EAAC;;IAEpC,QAAQ,GAAG,KAAK,CAAC,KAAK,gFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;IAExD,WAAW,GAAG,KAAK,CAAC,KAAK,mFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;IAE3D,QAAQ,GAAG,KAAK,CAAC,KAAK,gFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;AAExD,IAAA,UAAU,GAAG,KAAK,CAAS,QAAQ,iFAAC;;IAEpC,MAAM,GAAG,MAAM,EAAQ;;IAEvB,OAAO,GAAG,MAAM,EAAQ;IAEvB,OAAO,GAAA;AACf,QAAA,IAAI,IAAI,CAAC,WAAW,EAAE,EAAE;AACtB,YAAA,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE;QACrB;IACF;wGApBW,YAAY,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;4FAAZ,YAAY,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,QAAA,EAAA,MAAA,EAAA,EAAA,OAAA,EAAA,EAAA,iBAAA,EAAA,SAAA,EAAA,UAAA,EAAA,SAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,QAAA,EAAA,EAAA,iBAAA,EAAA,UAAA,EAAA,UAAA,EAAA,UAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,E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