@ids-group-ltd/ids-design-system 1.0.3 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/CHANGELOG.md +423 -3
  2. package/agent/INDEX.md +12 -2
  3. package/agent/feedback/ds-alert.md +3 -2
  4. package/agent/feedback/ds-attachment.md +12 -0
  5. package/agent/feedback/ds-chat-attachment.md +10 -0
  6. package/agent/feedback/ds-chat-message.md +11 -0
  7. package/agent/feedback/ds-chat-step.md +10 -0
  8. package/agent/feedback/ds-chat-steps.md +10 -0
  9. package/agent/feedback/ds-chat-thread.md +11 -0
  10. package/agent/feedback/ds-timeline-item.md +3 -1
  11. package/agent/feedback/ds-timeline.md +9 -0
  12. package/agent/feedback/ds-toast.md +1 -1
  13. package/agent/feedback/ds-tree.md +3 -1
  14. package/agent/forms/ds-chat-input.md +16 -0
  15. package/agent/forms/ds-inline-edit.md +14 -0
  16. package/agent/foundations/tokens.md +3 -3
  17. package/agent/navigation/ds-splitter.md +14 -0
  18. package/agent/platform/toast-service.md +3 -2
  19. package/agent/tables/ds-table.md +1 -1
  20. package/components.md +110 -11
  21. package/fesm2022/ids-group-ltd-ids-design-system-components-alert.mjs +5 -3
  22. package/fesm2022/ids-group-ltd-ids-design-system-components-alert.mjs.map +1 -1
  23. package/fesm2022/ids-group-ltd-ids-design-system-components-app-layout.mjs +2 -2
  24. package/fesm2022/ids-group-ltd-ids-design-system-components-app-layout.mjs.map +1 -1
  25. package/fesm2022/ids-group-ltd-ids-design-system-components-autocomplete.mjs +2 -2
  26. package/fesm2022/ids-group-ltd-ids-design-system-components-autocomplete.mjs.map +1 -1
  27. package/fesm2022/ids-group-ltd-ids-design-system-components-button.mjs +2 -2
  28. package/fesm2022/ids-group-ltd-ids-design-system-components-button.mjs.map +1 -1
  29. package/fesm2022/ids-group-ltd-ids-design-system-components-chat.mjs +928 -0
  30. package/fesm2022/ids-group-ltd-ids-design-system-components-chat.mjs.map +1 -0
  31. package/fesm2022/ids-group-ltd-ids-design-system-components-color-picker.mjs +2 -2
  32. package/fesm2022/ids-group-ltd-ids-design-system-components-color-picker.mjs.map +1 -1
  33. package/fesm2022/ids-group-ltd-ids-design-system-components-date-picker.mjs +2 -2
  34. package/fesm2022/ids-group-ltd-ids-design-system-components-date-picker.mjs.map +1 -1
  35. package/fesm2022/ids-group-ltd-ids-design-system-components-drawer.mjs +2 -2
  36. package/fesm2022/ids-group-ltd-ids-design-system-components-drawer.mjs.map +1 -1
  37. package/fesm2022/ids-group-ltd-ids-design-system-components-field-group.mjs +2 -2
  38. package/fesm2022/ids-group-ltd-ids-design-system-components-field-group.mjs.map +1 -1
  39. package/fesm2022/ids-group-ltd-ids-design-system-components-inline-edit.mjs +107 -0
  40. package/fesm2022/ids-group-ltd-ids-design-system-components-inline-edit.mjs.map +1 -0
  41. package/fesm2022/ids-group-ltd-ids-design-system-components-input.mjs +2 -2
  42. package/fesm2022/ids-group-ltd-ids-design-system-components-input.mjs.map +1 -1
  43. package/fesm2022/ids-group-ltd-ids-design-system-components-list.mjs +2 -2
  44. package/fesm2022/ids-group-ltd-ids-design-system-components-list.mjs.map +1 -1
  45. package/fesm2022/ids-group-ltd-ids-design-system-components-menu.mjs +2 -2
  46. package/fesm2022/ids-group-ltd-ids-design-system-components-menu.mjs.map +1 -1
  47. package/fesm2022/ids-group-ltd-ids-design-system-components-modal.mjs +4 -4
  48. package/fesm2022/ids-group-ltd-ids-design-system-components-modal.mjs.map +1 -1
  49. package/fesm2022/ids-group-ltd-ids-design-system-components-multi-select.mjs +2 -2
  50. package/fesm2022/ids-group-ltd-ids-design-system-components-multi-select.mjs.map +1 -1
  51. package/fesm2022/ids-group-ltd-ids-design-system-components-number-stepper.mjs +2 -2
  52. package/fesm2022/ids-group-ltd-ids-design-system-components-number-stepper.mjs.map +1 -1
  53. package/fesm2022/ids-group-ltd-ids-design-system-components-otp-input.mjs +2 -2
  54. package/fesm2022/ids-group-ltd-ids-design-system-components-otp-input.mjs.map +1 -1
  55. package/fesm2022/ids-group-ltd-ids-design-system-components-popover.mjs +16 -12
  56. package/fesm2022/ids-group-ltd-ids-design-system-components-popover.mjs.map +1 -1
  57. package/fesm2022/ids-group-ltd-ids-design-system-components-search.mjs +2 -2
  58. package/fesm2022/ids-group-ltd-ids-design-system-components-search.mjs.map +1 -1
  59. package/fesm2022/ids-group-ltd-ids-design-system-components-select.mjs +2 -2
  60. package/fesm2022/ids-group-ltd-ids-design-system-components-select.mjs.map +1 -1
  61. package/fesm2022/ids-group-ltd-ids-design-system-components-splitter.mjs +465 -0
  62. package/fesm2022/ids-group-ltd-ids-design-system-components-splitter.mjs.map +1 -0
  63. package/fesm2022/ids-group-ltd-ids-design-system-components-stepper.mjs +2 -2
  64. package/fesm2022/ids-group-ltd-ids-design-system-components-stepper.mjs.map +1 -1
  65. package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs +2 -2
  66. package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs.map +1 -1
  67. package/fesm2022/ids-group-ltd-ids-design-system-components-textarea.mjs +4 -2
  68. package/fesm2022/ids-group-ltd-ids-design-system-components-textarea.mjs.map +1 -1
  69. package/fesm2022/ids-group-ltd-ids-design-system-components-time-picker.mjs +2 -2
  70. package/fesm2022/ids-group-ltd-ids-design-system-components-time-picker.mjs.map +1 -1
  71. package/fesm2022/ids-group-ltd-ids-design-system-components-timeline.mjs +74 -17
  72. package/fesm2022/ids-group-ltd-ids-design-system-components-timeline.mjs.map +1 -1
  73. package/fesm2022/ids-group-ltd-ids-design-system-components-toast.mjs +163 -20
  74. package/fesm2022/ids-group-ltd-ids-design-system-components-toast.mjs.map +1 -1
  75. package/fesm2022/ids-group-ltd-ids-design-system-components-tooltip.mjs +4 -19
  76. package/fesm2022/ids-group-ltd-ids-design-system-components-tooltip.mjs.map +1 -1
  77. package/fesm2022/ids-group-ltd-ids-design-system-components-tree.mjs +182 -24
  78. package/fesm2022/ids-group-ltd-ids-design-system-components-tree.mjs.map +1 -1
  79. package/fesm2022/ids-group-ltd-ids-design-system-components.mjs +31 -4
  80. package/fesm2022/ids-group-ltd-ids-design-system-components.mjs.map +1 -1
  81. package/fesm2022/ids-group-ltd-ids-design-system-core.mjs +74 -0
  82. package/fesm2022/ids-group-ltd-ids-design-system-core.mjs.map +1 -1
  83. package/fesm2022/ids-group-ltd-ids-design-system-icons.mjs +4 -2
  84. package/fesm2022/ids-group-ltd-ids-design-system-icons.mjs.map +1 -1
  85. package/fesm2022/ids-group-ltd-ids-design-system.mjs +4 -1
  86. package/fesm2022/ids-group-ltd-ids-design-system.mjs.map +1 -1
  87. package/migrations/0.11.2.json +1 -0
  88. package/migrations/1.0.1.json +4 -0
  89. package/migrations/1.0.2.json +37 -1
  90. package/migrations/1.1.0.json +208 -0
  91. package/migrations/1.1.1.json +190 -0
  92. package/migrations/README.md +6 -6
  93. package/package.json +25 -1
  94. package/schematics/check-overrides/surface.json +199 -6
  95. package/styles/_dropdown-overlay.scss +11 -6
  96. package/styles/_field-box.scss +2 -2
  97. package/styles/_step-marker.scss +51 -0
  98. package/styles/_tokens.scss +5 -3
  99. package/themes/README.md +2 -1
  100. package/themes/_semantic.scss +15 -0
  101. package/themes/dark/_palette.scss +1 -2
  102. package/themes/dark/_theme.scss +32 -3
  103. package/types/ids-group-ltd-ids-design-system-components-alert.d.ts +3 -1
  104. package/types/ids-group-ltd-ids-design-system-components-button.d.ts +2 -2
  105. package/types/ids-group-ltd-ids-design-system-components-chart.d.ts +1 -1
  106. package/types/ids-group-ltd-ids-design-system-components-chat.d.ts +377 -0
  107. package/types/ids-group-ltd-ids-design-system-components-inline-edit.d.ts +43 -0
  108. package/types/ids-group-ltd-ids-design-system-components-pie-chart.d.ts +1 -1
  109. package/types/ids-group-ltd-ids-design-system-components-splitter.d.ts +97 -0
  110. package/types/ids-group-ltd-ids-design-system-components-textarea.d.ts +2 -0
  111. package/types/ids-group-ltd-ids-design-system-components-timeline.d.ts +34 -5
  112. package/types/ids-group-ltd-ids-design-system-components-toast.d.ts +53 -4
  113. package/types/ids-group-ltd-ids-design-system-components-tree.d.ts +87 -7
  114. package/types/ids-group-ltd-ids-design-system-components.d.ts +8 -4
  115. package/types/ids-group-ltd-ids-design-system-core.d.ts +126 -0
  116. package/types/ids-group-ltd-ids-design-system.d.ts +6 -3
@@ -1 +1 @@
1
- {"version":3,"file":"ids-group-ltd-ids-design-system-components-toast.mjs","sources":["../../../src/lib/components/toast/toast.config.ts","../../../src/lib/components/toast/toast.component.ts","../../../src/lib/components/toast/toast.component.html","../../../src/lib/components/toast/toast-region.component.ts","../../../src/lib/components/toast/toast-region.component.html","../../../src/lib/components/toast/toast.service.ts","../../../src/lib/components/toast/ids-group-ltd-ids-design-system-components-toast.ts"],"sourcesContent":["import type { DsToastPosition } from '@ids-group-ltd/ids-design-system/core';\n\nexport const DS_TOAST_POSITION_DEFAULT: DsToastPosition = {\n horizontalPosition: 'right',\n verticalPosition: 'top',\n offset: 'var(--space-6)',\n};\n","import {\n Component,\n ViewEncapsulation,\n booleanAttribute,\n computed,\n inject,\n input,\n output,\n} from '@angular/core';\nimport { IconComponent } from '@ids-group-ltd/ids-design-system/icons';\nimport { SpinnerComponent } from '@ids-group-ltd/ids-design-system/components/spinner';\nimport { DS_INTL, retainStyles } from '@ids-group-ltd/ids-design-system/core';\nimport type { IconName } from '@ids-group-ltd/ids-design-system/core';\nimport type { ToastAction, ToastVariant } from './toast.types';\n\n/**\n * Single toast pill, rendered by ToastRegion for service-driven toasts or placed inline as a specimen.\n */\n@Component({\n selector: 'ds-toast',\n standalone: true,\n imports: [IconComponent, SpinnerComponent],\n templateUrl: './toast.component.html',\n styleUrl: './toast.component.scss',\n // Keeps a static `title` attribute from becoming a native tooltip on the host.\n host: { '[attr.title]': 'null' },\n encapsulation: ViewEncapsulation.Emulated,\n})\nexport class ToastComponent {\n protected readonly intl = inject(DS_INTL);\n\n /** Severity: drives colour and the default icon or spinner. */\n readonly variant = input<ToastVariant>('info');\n /** Optional bold heading above the message. */\n readonly title = input<string>('');\n /** Message text; the same field as `ToastOptions.body`. */\n readonly body = input<string>('');\n /** Show a close button that emits `closed`. */\n readonly dismissible = input(false, { transform: booleanAttribute });\n /** Override the variant's default icon. */\n readonly icon = input<IconName | null>(null);\n /** Optional action button rendered before the dismiss control. */\n readonly action = input<ToastAction | null>(null);\n /** Fires when the toast is dismissed or its action is invoked. */\n readonly closed = output<void>();\n\n protected readonly isLoading = computed(() => this.variant() === 'loading');\n\n constructor() {\n retainStyles(ToastComponent);\n }\n\n protected onAction(action: ToastAction): void {\n action.handler();\n this.closed.emit();\n }\n\n protected readonly classes = computed(() => `toast ${this.variant()}`);\n\n protected readonly defaultIcon = computed<IconName>(() => {\n switch (this.variant()) {\n case 'success':\n return 'success';\n case 'warning':\n return 'warn';\n case 'error':\n return 'error';\n default:\n return 'info';\n }\n });\n\n protected onDismiss(): void {\n this.closed.emit();\n }\n}\n","<!-- No role or aria-live: a region created with its text already in it announces nothing;\n ToastService speaks through the CDK LiveAnnouncer. A hand-placed <ds-toast> is silent. -->\n<div [class]=\"classes()\">\n @if (isLoading()) {\n <!-- aria-hidden because ds-spinner is a role=\"status\" of its own: the message is\n announced by ToastService, and a nested live region would speak twice. -->\n <ds-spinner\n class=\"icon\"\n size=\"sm\"\n aria-hidden=\"true\" />\n } @else {\n <ds-icon\n class=\"icon\"\n [name]=\"icon() ?? defaultIcon()\"\n [size]=\"16\" />\n }\n\n <div class=\"body\">\n @if (title()) {\n <div class=\"title\">\n {{ title() }}\n </div>\n }\n {{ body() }}\n <ng-content></ng-content>\n </div>\n\n @if (action(); as act) {\n <button\n type=\"button\"\n class=\"action\"\n (click)=\"onAction(act)\">\n {{ act.label }}\n </button>\n }\n\n <span class=\"actions\">\n <ng-content select=\"[actions]\"></ng-content>\n </span>\n\n @if (dismissible()) {\n <button\n type=\"button\"\n class=\"close\"\n [attr.aria-label]=\"intl().dialog.dismiss\"\n (click)=\"onDismiss()\">\n <ds-icon\n name=\"x\"\n [size]=\"14\" />\n </button>\n }\n</div>\n","import {\n DestroyRef,\n ElementRef,\n Component,\n ViewEncapsulation,\n booleanAttribute,\n computed,\n effect,\n inject,\n input,\n signal,\n} from '@angular/core';\nimport { DS_CONFIG, DS_INTL } from '@ids-group-ltd/ids-design-system/core';\nimport { devWarn } from '@ids-group-ltd/ids-design-system/core';\nimport { moveFocusOutOf } from '@ids-group-ltd/ids-design-system/components';\nimport { DS_TOAST_POSITION_DEFAULT } from './toast.config';\nimport { ToastComponent } from './toast.component';\nimport type { ToastEntry } from './toast.types';\n\n// Fallback floor; leaveDuration() reads the real length off the node.\nconst LEAVE_FALLBACK_MS = 180;\n\n// Grace period once the pointer leaves a toast whose clock ran out under it.\nconst MIN_RESUME_MS = 600;\n\nconst DEFAULT_MAX_VISIBLE = 5;\n\nconst QUEUE_COUNT_CAP = 99;\n\n@Component({\n selector: 'ds-toast-region',\n standalone: true,\n imports: [ToastComponent],\n templateUrl: './toast-region.component.html',\n styleUrl: './toast-region.component.scss',\n encapsulation: ViewEncapsulation.Emulated,\n host: {\n role: 'region',\n '[attr.aria-label]': 'intl().toast.region',\n '(mouseenter)': 'onHover(true)',\n '(mouseleave)': 'onHover(false)',\n '(focusin)': 'onFocusIn($event)',\n '(focusout)': 'onFocusWithin($event)',\n '[class.stack-newest-last]': '!newestFirst',\n },\n})\nexport class ToastRegionComponent {\n protected readonly intl = inject(DS_INTL);\n\n /** Cap on concurrently visible toasts. Extras are queued and shown as\n * earlier ones dismiss. `0` = unlimited. */\n readonly maxVisible = input<number>(DEFAULT_MAX_VISIBLE);\n /** Show a `+N` strip while toasts wait behind `maxVisible`. */\n readonly showQueueCount = input(true, { transform: booleanAttribute });\n\n protected readonly visibleEntries = signal<readonly ToastEntry[]>([]);\n protected readonly leaving = signal<ReadonlySet<number>>(new Set());\n\n private readonly pendingQueue = signal<readonly ToastEntry[]>([]);\n\n protected readonly queuedLabel = computed(() => {\n const waiting = this.pendingQueue().length;\n if (waiting === 0 || !this.showQueueCount()) {\n return null;\n }\n\n return waiting > QUEUE_COUNT_CAP ? `+${QUEUE_COUNT_CAP}+` : `+${waiting}`;\n });\n private readonly timers = new Map<number, number>();\n private readonly leaveTimers = new Map<number, number>();\n private readonly remaining = new Map<number, number>();\n private readonly startedAt = new Map<number, number>();\n private hovered = false;\n private focusWithin = false;\n private focusOrigin: HTMLElement | null = null;\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly position = inject(DS_CONFIG).toast?.position;\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n devWarn(() =>\n this.maxVisible() < 0\n ? `<ds-toast-region> maxVisible is ${this.maxVisible()}; a negative cap means unlimited, which is what 0 says. Pass 0 if that is the intent.`\n : null,\n );\n }\n effect(() => {\n this.maxVisible();\n this.drainQueue();\n });\n // An uncancelled timer fires into a destroyed component.\n inject(DestroyRef).onDestroy(() => {\n this.timers.forEach((timer) => window.clearTimeout(timer));\n this.leaveTimers.forEach((timer) => window.clearTimeout(timer));\n this.timers.clear();\n this.leaveTimers.clear();\n });\n }\n\n /** Newest goes NEAREST the anchor; DOM order is the visual and reading order. */\n protected readonly newestFirst =\n (this.position?.verticalPosition ??\n DS_TOAST_POSITION_DEFAULT.verticalPosition) === 'top';\n\n add(entry: ToastEntry): void {\n const limit = this.maxVisible();\n if (limit > 0 && this.visibleEntries().length >= limit) {\n this.pendingQueue.update((queue) => [...queue, entry]);\n\n return;\n }\n\n this.show(entry);\n }\n\n private show(entry: ToastEntry): void {\n const before = this.measureTops();\n this.visibleEntries.update((existing) =>\n this.newestFirst ? [entry, ...existing] : [...existing, entry],\n );\n this.arm(entry.id, entry.durationMs);\n this.slideNeighbours(before);\n }\n\n /** FLIP, not an absolute stack: that collapses the region to zero height inside the content-sized CDK pane. */\n private slideNeighbours(before: Map<number, number>): void {\n if (!before.size) {\n return;\n }\n requestAnimationFrame(() => {\n const nodes = this.toastNodes();\n const deltas: [HTMLElement, number][] = [];\n for (const [id, node] of nodes) {\n const previousTop = before.get(id);\n if (previousTop === undefined) {\n continue;\n }\n const delta = previousTop - node.getBoundingClientRect().top;\n if (delta) {\n deltas.push([node, delta]);\n }\n }\n for (const [node, delta] of deltas) {\n node.style.setProperty('--_toast-shift', `${delta}px`);\n node.classList.add('shifting');\n }\n requestAnimationFrame(() => {\n for (const [node] of deltas) {\n node.classList.remove('shifting');\n node.style.removeProperty('--_toast-shift');\n }\n });\n });\n }\n\n private toastNodes(): Map<number, HTMLElement> {\n const nodes = new Map<number, HTMLElement>();\n const elements =\n this.host.nativeElement.querySelectorAll<HTMLElement>('ds-toast');\n this.visibleEntries().forEach((entry, index) => {\n const node = elements[index];\n if (node) {\n nodes.set(entry.id, node);\n }\n });\n\n return nodes;\n }\n\n private measureTops(): Map<number, number> {\n const tops = new Map<number, number>();\n for (const [id, node] of this.toastNodes()) {\n tops.set(id, node.getBoundingClientRect().top);\n }\n\n return tops;\n }\n\n private arm(id: number, remaining: number): void {\n if (remaining <= 0) {\n return;\n }\n this.remaining.set(id, remaining);\n // drainQueue arms from a timeout, with no user event nearby, so bank the pause state here.\n if (this.hovered || this.focusWithin) {\n this.startedAt.delete(id);\n\n return;\n }\n this.startedAt.set(id, Date.now());\n const existing = this.timers.get(id);\n if (existing !== undefined) {\n window.clearTimeout(existing);\n }\n this.timers.set(\n id,\n window.setTimeout(() => this.remove(id), remaining),\n );\n }\n\n private clearCountdown(id: number): void {\n const timer = this.timers.get(id);\n if (timer !== undefined) {\n window.clearTimeout(timer);\n this.timers.delete(id);\n }\n this.remaining.delete(id);\n this.startedAt.delete(id);\n }\n\n protected onHover(entered: boolean): void {\n this.hovered = entered;\n this.syncPause();\n }\n\n protected onFocusIn(event: FocusEvent): void {\n const from = event.relatedTarget;\n if (\n from instanceof HTMLElement &&\n !this.host.nativeElement.contains(from)\n ) {\n this.focusOrigin = from;\n }\n this.onFocusWithin(true);\n }\n\n // `focusout` also fires when focus moves BETWEEN elements inside the region; the containment check avoids re-flooring at MIN_RESUME_MS.\n protected onFocusWithin(event: FocusEvent | true): void {\n this.focusWithin =\n event === true ||\n (event.relatedTarget instanceof Node &&\n this.host.nativeElement.contains(event.relatedTarget));\n this.syncPause();\n }\n\n private syncPause(): void {\n const shouldPause = this.hovered || this.focusWithin;\n if (shouldPause === this.paused) {\n return;\n }\n if (shouldPause) {\n this.pauseAll();\n } else {\n this.resumeAll();\n }\n }\n\n private get paused(): boolean {\n return this.timers.size === 0 && this.remaining.size > 0;\n }\n\n private pauseAll(): void {\n const now = Date.now();\n for (const [id, timer] of this.timers) {\n window.clearTimeout(timer);\n const left =\n (this.remaining.get(id) ?? 0) - (now - (this.startedAt.get(id) ?? now));\n this.remaining.set(id, Math.max(left, MIN_RESUME_MS));\n }\n this.timers.clear();\n }\n\n private resumeAll(): void {\n for (const [id, left] of [...this.remaining]) {\n this.arm(id, left);\n }\n }\n\n /** Replaces fields of a visible or queued toast in place. Patching `durationMs`\n * restarts the clock; on a QUEUED toast it takes effect on promotion. */\n update(\n id: number,\n patch: Partial<\n Pick<\n ToastEntry,\n 'body' | 'title' | 'variant' | 'dismissible' | 'action' | 'durationMs'\n >\n >,\n ): void {\n const inVisible = this.visibleEntries().some((entry) => entry.id === id);\n if (inVisible) {\n this.visibleEntries.update((entries) =>\n entries.map((entry) =>\n entry.id === id ? { ...entry, ...patch } : entry,\n ),\n );\n if (patch.durationMs !== undefined) {\n this.clearCountdown(id);\n this.arm(id, patch.durationMs);\n }\n\n return;\n }\n this.pendingQueue.update((queue) =>\n queue.map((entry) => (entry.id === id ? { ...entry, ...patch } : entry)),\n );\n }\n\n remove(id: number): void {\n // A `ToastRef` outlives its toast, so dismiss() can arrive for an id nothing holds.\n const isVisible = this.visibleEntries().some((entry) => entry.id === id);\n const queued = this.pendingQueue().some((entry) => entry.id === id);\n if (!isVisible && !queued) {\n return;\n }\n\n this.clearCountdown(id);\n if (queued) {\n this.pendingQueue.update((queue) =>\n queue.filter((entry) => entry.id !== id),\n );\n\n return;\n }\n if (this.leaving().has(id)) {\n return;\n }\n const node = this.toastNodes().get(id);\n if (node) {\n // A neighbouring toast first, then where focus came from, as a dialog returns it.\n moveFocusOutOf(node, this.host.nativeElement, this.focusOrigin);\n }\n this.leaving.update((set) => new Set(set).add(id));\n this.leaveTimers.set(\n id,\n window.setTimeout(() => {\n this.leaveTimers.delete(id);\n this.visibleEntries.update((existing) =>\n existing.filter((entry) => entry.id !== id),\n );\n this.leaving.update((set) => {\n const next = new Set(set);\n next.delete(id);\n\n return next;\n });\n this.drainQueue();\n }, this.leaveDuration(id)),\n );\n }\n\n /** The leave transition length is a public token, so read it off the node. Reduced\n * motion zeroes it, so the floor applies only when there is nothing to measure. */\n private leaveDuration(id: number): number {\n const node = this.toastNodes().get(id);\n if (!node) {\n return LEAVE_FALLBACK_MS;\n }\n const declared = getComputedStyle(node)\n .transitionDuration.split(',')\n .map((part) => parseFloat(part) * 1000)\n .filter((ms) => !Number.isNaN(ms));\n\n return declared.length ? Math.max(...declared) : LEAVE_FALLBACK_MS;\n }\n\n protected isLeaving(id: number): boolean {\n return this.leaving().has(id);\n }\n\n clear(): void {\n this.timers.forEach((timer) => window.clearTimeout(timer));\n this.leaveTimers.forEach((timer) => window.clearTimeout(timer));\n this.timers.clear();\n this.leaveTimers.clear();\n this.remaining.clear();\n this.startedAt.clear();\n this.visibleEntries.set([]);\n this.leaving.set(new Set());\n this.pendingQueue.set([]);\n }\n\n private drainQueue(): void {\n while (this.pendingQueue().length) {\n const limit = this.maxVisible();\n if (limit > 0 && this.visibleEntries().length >= limit) {\n return;\n }\n const [next, ...rest] = this.pendingQueue();\n this.pendingQueue.set(rest);\n this.show(next);\n }\n }\n}\n","@if (queuedLabel(); as label) {\n <!-- aria-hidden: ToastService already announced every toast, queued ones included. -->\n <div\n class=\"queue-count\"\n aria-hidden=\"true\">\n {{ label }}\n </div>\n}\n\n@for (entry of visibleEntries(); track entry.id) {\n <ds-toast\n [variant]=\"entry.variant\"\n [title]=\"entry.title ?? ''\"\n [body]=\"entry.body\"\n [dismissible]=\"entry.dismissible\"\n [action]=\"entry.action ?? null\"\n [class.leaving]=\"isLeaving(entry.id)\"\n (closed)=\"remove(entry.id)\" />\n}\n","import { ComponentRef, DestroyRef, Injectable, inject } from '@angular/core';\nimport {\n Overlay,\n OverlayRef,\n GlobalPositionStrategy,\n} from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport { LiveAnnouncer } from '@angular/cdk/a11y';\nimport {\n DS_CONFIG,\n addDevWarningSink,\n} from '@ids-group-ltd/ids-design-system/core';\nimport { ToastRegionComponent } from './toast-region.component';\nimport { DS_TOAST_POSITION_DEFAULT } from './toast.config';\nimport type {\n ToastEntry,\n ToastVariant,\n ToastOptions,\n ToastPromiseMessages,\n ToastRef,\n} from './toast.types';\n\nconst SETTLED_SUCCESS_MS = 4000;\nconst SETTLED_ERROR_MS = 6000;\n\n// Must outlast the loop that fires a burst.\nconst ANNOUNCE_COALESCE_MS = 120;\nconst DEV_WARNING_MS = 10000;\n\n@Injectable({ providedIn: 'root' })\nexport class ToastService {\n private readonly overlay = inject(Overlay);\n private readonly toastConfig = inject(DS_CONFIG).toast;\n private readonly announcer = inject(LiveAnnouncer);\n private overlayRef: OverlayRef | null = null;\n private regionRef: ComponentRef<ToastRegionComponent> | null = null;\n private nextId = 1;\n private pendingAnnouncements: string[] = [];\n private pendingAssertive = false;\n private announceTimer: number | undefined;\n private scrimWatcher: MutationObserver | null = null;\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (this.toastConfig?.mirrorDevWarnings ?? true) {\n // Deferred: a warning raised inside an effect or a render hook must not build the toast region there.\n const unregister = addDevWarningSink((message) =>\n setTimeout(() =>\n this.show({\n title: 'Dev warning',\n body: message,\n variant: 'warning',\n durationMs: DEV_WARNING_MS,\n }),\n ),\n );\n inject(DestroyRef).onDestroy(unregister);\n }\n }\n inject(DestroyRef).onDestroy(() => {\n clearTimeout(this.announceTimer);\n this.scrimWatcher?.disconnect();\n this.overlayRef?.dispose();\n this.overlayRef = null;\n this.regionRef = null;\n });\n }\n\n show(opts: ToastOptions): ToastRef {\n this.ensureRegion();\n const id = this.nextId++;\n const variant = opts.variant ?? 'info';\n // An `action` toast cannot expire: the region is the last child of `body`, so a\n // keyboard user cannot reach the button in time.\n const durationMs =\n variant === 'loading' || opts.action ? 0 : (opts.durationMs ?? 5000);\n const entry: ToastEntry = {\n id,\n title: opts.title,\n body: opts.body,\n variant,\n // Nothing that cannot expire may also be unclosable, or it holds a slot for the page's life.\n dismissible: durationMs > 0 ? (opts.dismissible ?? true) : true,\n action: opts.action,\n durationMs,\n };\n // The region runs the countdown: a toast queued behind `maxVisible` would expire unseen if started here.\n this.regionRef!.instance.add(entry);\n this.announce(variant, entry.body, entry.title);\n\n return {\n id,\n dismiss: () => this.regionRef?.instance.remove(id),\n };\n }\n\n /** Shows a loading toast for the duration of `source`; resolution and rejection turn the\n * same toast into a success/error variant with its own auto-dismiss delay.\n *\n * Returns `source` itself, so the caller still owns rejection handling. */\n promise<T>(\n source: Promise<T>,\n messages: ToastPromiseMessages<T>,\n ): Promise<T> {\n const ref = this.show({\n body: messages.loading,\n variant: 'loading',\n durationMs: 0,\n });\n\n source.then(\n (value) => {\n const successBody =\n typeof messages.success === 'function'\n ? messages.success(value)\n : messages.success;\n this.regionRef?.instance.update(ref.id, {\n body: successBody,\n variant: 'success',\n dismissible: true,\n durationMs: SETTLED_SUCCESS_MS,\n });\n this.announce('success', successBody);\n },\n (reason: unknown) => {\n const errorBody =\n typeof messages.error === 'function'\n ? messages.error(reason)\n : messages.error;\n this.regionRef?.instance.update(ref.id, {\n body: errorBody,\n variant: 'error',\n dismissible: true,\n durationMs: SETTLED_ERROR_MS,\n });\n this.announce('error', errorBody);\n },\n );\n\n return source;\n }\n\n /** The announcement must NOT ride the visual toast: `aria-live` on an element created\n * together with its text announces nothing in NVDA or JAWS.\n *\n * Serialising a burst does not work either: `announce()` clears the region and writes\n * on a timeout, so the next message wipes the previous one. One region change carrying\n * every message is the only shape that survives. */\n private announce(variant: ToastVariant, body: string, title?: string): void {\n const spoken = [title, body].filter(Boolean).join('. ');\n if (!spoken) {\n return;\n }\n this.pendingAnnouncements.push(spoken);\n if (variant === 'error' || variant === 'warning') {\n this.pendingAssertive = true;\n }\n clearTimeout(this.announceTimer);\n this.announceTimer = window.setTimeout(() => {\n const message = this.pendingAnnouncements.join('. ');\n const politeness = this.pendingAssertive ? 'assertive' : 'polite';\n this.pendingAnnouncements = [];\n this.pendingAssertive = false;\n this.announcer.announce(message, politeness);\n }, ANNOUNCE_COALESCE_MS);\n }\n\n dismissAll(): void {\n this.regionRef?.instance.clear();\n }\n\n private ensureRegion(): void {\n if (this.overlayRef) {\n return;\n }\n this.overlayRef = this.overlay.create({\n hasBackdrop: false,\n panelClass: 'ds-toast-panel',\n positionStrategy: this.buildPositionStrategy(),\n });\n this.regionRef = this.overlayRef.attach(\n new ComponentPortal(ToastRegionComponent),\n );\n // `>= 0`, not truthiness: 0 asks for an uncapped stack and must not read as \"unset\".\n const maxVisible = this.toastConfig?.maxVisible;\n if (typeof maxVisible === 'number' && maxVisible >= 0) {\n this.regionRef.setInput('maxVisible', maxVisible);\n }\n const showQueueCount = this.toastConfig?.showQueueCount;\n if (typeof showQueueCount === 'boolean') {\n this.regionRef.setInput('showQueueCount', showQueueCount);\n }\n this.keepAboveScrims();\n }\n\n /** Keeps the toast above a scrim opened AFTER it. `--layer-toast` cannot: CDK overlay hosts\n * are `popover=\"manual\"` and the top layer paints in show order, ignoring z-index.\n * Scrimmed overlays only: `--layer-tooltip` sits above the toast. */\n private keepAboveScrims(): void {\n const host = this.overlayRef?.hostElement;\n const container = host?.parentElement;\n if (!host || !container || typeof host.showPopover !== 'function') {\n return;\n }\n this.scrimWatcher = new MutationObserver((records) => {\n const scrimAppeared = records.some((record) =>\n [...record.addedNodes].some(\n (node) =>\n node instanceof HTMLElement &&\n node !== host &&\n (node.classList.contains('cdk-overlay-backdrop') ||\n node.querySelector?.('.cdk-overlay-backdrop')),\n ),\n );\n if (!scrimAppeared || !host.isConnected) {\n return;\n }\n // The top layer has no \"raise\"; re-showing is the only lever.\n try {\n host.hidePopover();\n host.showPopover();\n } catch {\n // The host may not be showing, and hidePopover() throws when it is not.\n }\n });\n this.scrimWatcher.observe(container, { childList: true, subtree: true });\n }\n\n private buildPositionStrategy(): GlobalPositionStrategy {\n const config = {\n ...DS_TOAST_POSITION_DEFAULT,\n ...this.toastConfig?.position,\n };\n const strategy = this.overlay.position().global();\n if (config.verticalPosition === 'top') {\n strategy.top(config.offset);\n } else {\n strategy.bottom(config.offset);\n }\n if (config.horizontalPosition === 'left') {\n strategy.left(config.offset);\n } else if (config.horizontalPosition === 'right') {\n strategy.right(config.offset);\n } else {\n strategy.centerHorizontally();\n }\n\n return strategy;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAEO,MAAM,yBAAyB,GAAoB;AACxD,IAAA,kBAAkB,EAAE,OAAO;AAC3B,IAAA,gBAAgB,EAAE,KAAK;AACvB,IAAA,MAAM,EAAE,gBAAgB;;;ACU1B;;AAEG;MAWU,cAAc,CAAA;AACN,IAAA,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC;;AAGhC,IAAA,OAAO,GAAG,KAAK,CAAe,MAAM,8EAAC;;AAErC,IAAA,KAAK,GAAG,KAAK,CAAS,EAAE,4EAAC;;AAEzB,IAAA,IAAI,GAAG,KAAK,CAAS,EAAE,2EAAC;;IAExB,WAAW,GAAG,KAAK,CAAC,KAAK,mFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;AAE3D,IAAA,IAAI,GAAG,KAAK,CAAkB,IAAI,2EAAC;;AAEnC,IAAA,MAAM,GAAG,KAAK,CAAqB,IAAI,6EAAC;;IAExC,MAAM,GAAG,MAAM,EAAQ;AAEb,IAAA,SAAS,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,OAAO,EAA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AQ;SAC9B;QACD,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE;AACjD,QAAA,IAAI,MAAM,CAAC,gBAAgB,KAAK,KAAK,EAAE;AACrC,YAAA,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC;QAC7B;aAAO;AACL,YAAA,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;QAChC;AACA,QAAA,IAAI,MAAM,CAAC,kBAAkB,KAAK,MAAM,EAAE;AACxC,YAAA,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;QAC9B;AAAO,aAAA,IAAI,MAAM,CAAC,kBAAkB,KAAK,OAAO,EAAE;AAChD,YAAA,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC;QAC/B;aAAO;YACL,QAAQ,CAAC,kBAAkB,EAAE;QAC/B;AAEA,QAAA,OAAO,QAAQ;IACjB;wGA1NW,YAAY,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAZ,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,YAAY,cADC,MAAM,EAAA,CAAA;;4FACnB,YAAY,EAAA,UAAA,EAAA,CAAA;kBADxB,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;AC7BlC;;AAEG;;;;"}
1
+ {"version":3,"file":"ids-group-ltd-ids-design-system-components-toast.mjs","sources":["../../../src/lib/components/toast/toast.config.ts","../../../src/lib/components/toast/toast.component.ts","../../../src/lib/components/toast/toast.component.html","../../../src/lib/components/toast/toast-group.ts","../../../src/lib/components/toast/toast-region.component.ts","../../../src/lib/components/toast/toast-region.component.html","../../../src/lib/components/toast/toast.service.ts","../../../src/lib/components/toast/ids-group-ltd-ids-design-system-components-toast.ts"],"sourcesContent":["import type { DsToastPosition } from '@ids-group-ltd/ids-design-system/core';\n\nexport const DS_TOAST_POSITION_DEFAULT: DsToastPosition = {\n horizontalPosition: 'right',\n verticalPosition: 'top',\n offset: 'var(--space-6)',\n};\n","import {\n Component,\n ViewEncapsulation,\n booleanAttribute,\n computed,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\nimport { IconComponent } from '@ids-group-ltd/ids-design-system/icons';\nimport { SpinnerComponent } from '@ids-group-ltd/ids-design-system/components/spinner';\nimport {\n DS_INTL,\n DS_INTL_DEFAULTS,\n injectDsLocale,\n retainStyles,\n} from '@ids-group-ltd/ids-design-system/core';\nimport type { IconName } from '@ids-group-ltd/ids-design-system/core';\nimport type { ToastAction, ToastOccurrence, ToastVariant } from './toast.types';\n\n/**\n * Single toast pill, rendered by ToastRegion for service-driven toasts or placed inline as a specimen.\n */\n@Component({\n selector: 'ds-toast',\n standalone: true,\n imports: [IconComponent, SpinnerComponent],\n templateUrl: './toast.component.html',\n styleUrl: './toast.component.scss',\n // Keeps a static `title` attribute from becoming a native tooltip on the host.\n host: { '[attr.title]': 'null', '[class.piled]': 'stacked() && !expanded()' },\n encapsulation: ViewEncapsulation.Emulated,\n})\nexport class ToastComponent {\n protected readonly intl = inject(DS_INTL);\n\n /** Severity: drives colour and the default icon or spinner. */\n readonly variant = input<ToastVariant>('info');\n /** Optional bold heading above the message. */\n readonly title = input<string>('');\n /** Message text; the same field as `ToastOptions.body`. */\n readonly body = input<string>('');\n /** Show a close button that emits `closed`. */\n readonly dismissible = input(false, { transform: booleanAttribute });\n /** Override the variant's default icon. */\n readonly icon = input<IconName | null>(null);\n /** Optional action button rendered before the dismiss control. */\n readonly action = input<ToastAction | null>(null);\n /** Every call folded into this toast; two or more draw a `×N` stack that lists them. */\n readonly occurrences = input<readonly ToastOccurrence[]>([]);\n /** Fires when the toast is dismissed or its action is invoked. */\n readonly closed = output<void>();\n /** Fires with an occurrence's `id` when its own close button in the list is pressed. */\n readonly occurrenceClosed = output<number>();\n\n protected readonly count = computed(() => this.occurrences().length);\n protected readonly stacked = computed(() => this.count() > 1);\n protected readonly expanded = signal(false);\n protected readonly toastIntl = computed(() => ({\n ...DS_INTL_DEFAULTS.toast,\n ...this.intl().toast,\n }));\n private readonly timeFormat = new Intl.DateTimeFormat(injectDsLocale(), {\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit',\n });\n\n protected readonly isLoading = computed(() => this.variant() === 'loading');\n\n constructor() {\n retainStyles(ToastComponent);\n }\n\n protected onAction(action: ToastAction): void {\n action.handler();\n this.closed.emit();\n }\n\n protected readonly classes = computed(() => `toast ${this.variant()}`);\n\n protected readonly defaultIcon = computed<IconName>(() => {\n switch (this.variant()) {\n case 'success':\n return 'success';\n case 'warning':\n return 'warn';\n case 'error':\n return 'error';\n default:\n return 'info';\n }\n });\n\n protected formatTime(at: number): string {\n return this.timeFormat.format(at);\n }\n\n protected onDismiss(): void {\n this.closed.emit();\n }\n}\n","<!-- No role or aria-live: a region created with its text already in it announces nothing;\n ToastService speaks through the CDK LiveAnnouncer. A hand-placed <ds-toast> is silent. -->\n@if (stacked() && !expanded()) {\n <div\n class=\"ghost ghost-far\"\n aria-hidden=\"true\">\n </div>\n\n <div\n class=\"ghost ghost-near\"\n aria-hidden=\"true\">\n </div>\n}\n\n<div [class]=\"classes()\">\n @if (isLoading()) {\n <!-- aria-hidden because ds-spinner is a role=\"status\" of its own: the message is\n announced by ToastService, and a nested live region would speak twice. -->\n <ds-spinner\n class=\"icon\"\n size=\"sm\"\n aria-hidden=\"true\" />\n } @else {\n <ds-icon\n class=\"icon\"\n [name]=\"icon() ?? defaultIcon()\"\n [size]=\"16\" />\n }\n\n <div class=\"body\">\n @if (title()) {\n <div class=\"title\">\n {{ title() }}\n @if (stacked()) {\n <span class=\"count\">\n ×{{ count() }}\n </span>\n }\n </div>\n }\n {{ body() }}\n @if (stacked() && !title()) {\n <span class=\"count\">\n ×{{ count() }}\n </span>\n }\n\n <ng-content></ng-content>\n\n @if (stacked()) {\n <button\n type=\"button\"\n class=\"more\"\n [attr.aria-expanded]=\"expanded()\"\n (click)=\"expanded.set(!expanded())\">\n {{ expanded() ? toastIntl().hide : toastIntl().showAll }}\n </button>\n }\n </div>\n\n @if (action(); as act) {\n <button\n type=\"button\"\n class=\"action\"\n (click)=\"onAction(act)\">\n {{ act.label }}\n </button>\n }\n\n <span class=\"actions\">\n <ng-content select=\"[actions]\"></ng-content>\n </span>\n\n @if (dismissible()) {\n <button\n type=\"button\"\n class=\"close\"\n [attr.aria-label]=\"\n stacked() ? toastIntl().dismissAll : intl().dialog.dismiss\n \"\n (click)=\"onDismiss()\">\n <ds-icon\n name=\"x\"\n [size]=\"14\" />\n </button>\n }\n</div>\n\n@if (stacked() && expanded()) {\n <div class=\"occurrences\">\n @for (occurrence of occurrences(); track occurrence.id) {\n <div [class]=\"classes()\">\n <ds-icon\n class=\"icon\"\n [name]=\"icon() ?? defaultIcon()\"\n [size]=\"16\" />\n\n <div class=\"body\">\n {{ occurrence.body }}\n <span class=\"time\">\n {{ formatTime(occurrence.at) }}\n </span>\n </div>\n\n @if (dismissible()) {\n <button\n type=\"button\"\n class=\"close\"\n [attr.aria-label]=\"intl().dialog.dismiss\"\n (click)=\"occurrenceClosed.emit(occurrence.id)\">\n <ds-icon\n name=\"x\"\n [size]=\"14\" />\n </button>\n }\n </div>\n }\n </div>\n}\n","import type { DsConfig } from '@ids-group-ltd/ids-design-system/core';\nimport type {\n ToastEntry,\n ToastOccurrence,\n ToastOptions,\n ToastUpdate,\n ToastVariant,\n} from './toast.types';\n\n/** @internal */\nexport const TOAST_DEFAULT_DURATION_MS = 5000;\n\nfunction toastTextKey(\n variant: ToastVariant,\n title: string | undefined,\n body: string,\n): string {\n return JSON.stringify([variant, title ?? '', body]);\n}\n\n/** @internal */\nexport function toastGroupKey(\n config: DsConfig['toast'],\n options: ToastOptions,\n variant: ToastVariant,\n): string | undefined {\n if (!config?.groupDuplicates || variant === 'loading') {\n return undefined;\n }\n\n return options.groupKey ?? toastTextKey(variant, options.title, options.body);\n}\n\n/** @internal */\nexport type ToastEntryPatch = Partial<\n Pick<\n ToastEntry,\n 'title' | 'body' | 'variant' | 'dismissible' | 'durationMs' | 'groupKey'\n >\n>;\n\n/** `null` when the region no longer holds the toast. @internal */\nexport function toastUpdatePatch(\n current: ToastEntry | undefined,\n update: ToastUpdate,\n): { patch: ToastEntryPatch; announce: boolean } | null {\n if (!current) {\n return null;\n }\n const variant = update.variant ?? current.variant;\n const title = update.title ?? current.title;\n const body = update.body ?? current.body;\n const neverExpires = variant === 'loading' || current.action !== undefined;\n const leavesLoading = current.variant === 'loading' && variant !== 'loading';\n const durationMs = neverExpires\n ? 0\n : (update.durationMs ??\n (leavesLoading ? TOAST_DEFAULT_DURATION_MS : current.durationMs));\n // Re-sending `durationMs` restarts the countdown, so a text-only change leaves it out.\n const restartsCountdown =\n update.durationMs !== undefined || durationMs !== current.durationMs;\n // A key derived from the old text would fold a later repeat of that text into this toast.\n const keyFollowsText =\n current.groupKey !== undefined &&\n current.groupKey ===\n toastTextKey(current.variant, current.title, current.body);\n const patch: ToastEntryPatch = {\n title,\n body,\n variant,\n dismissible:\n durationMs > 0 ? (update.dismissible ?? current.dismissible) : true,\n ...(restartsCountdown ? { durationMs } : {}),\n ...(keyFollowsText\n ? {\n groupKey:\n variant === 'loading'\n ? undefined\n : toastTextKey(variant, title, body),\n }\n : {}),\n };\n\n return {\n patch,\n announce:\n variant !== current.variant &&\n (variant === 'success' || variant === 'error'),\n };\n}\n\n/** @internal */\nexport function findToastStack(\n entries: readonly ToastEntry[],\n key: string,\n): ToastEntry | undefined {\n return entries.find((entry) => entry.groupKey === key);\n}\n\n// Re-sending `durationMs` is what restarts the countdown in `ToastRegionComponent.update`.\n/** @internal */\nexport function toastRepeatPatch(\n stack: ToastEntry,\n occurrence: ToastOccurrence,\n): { occurrences: readonly ToastOccurrence[]; durationMs: number } {\n return {\n occurrences: [...(stack.occurrences ?? []), occurrence],\n durationMs: stack.durationMs,\n };\n}\n\n/** `null` when the closed occurrence was the last: the whole toast goes. @internal */\nexport function withoutToastOccurrence(\n entry: ToastEntry,\n occurrenceId: number,\n): readonly ToastOccurrence[] | null {\n const left = (entry.occurrences ?? []).filter(\n (occurrence) => occurrence.id !== occurrenceId,\n );\n\n return left.length ? left : null;\n}\n","import {\n DestroyRef,\n ElementRef,\n Component,\n ViewEncapsulation,\n booleanAttribute,\n computed,\n effect,\n inject,\n input,\n signal,\n} from '@angular/core';\nimport { DS_CONFIG, DS_INTL } from '@ids-group-ltd/ids-design-system/core';\nimport { devWarn } from '@ids-group-ltd/ids-design-system/core';\nimport { moveFocusOutOf } from '@ids-group-ltd/ids-design-system/components';\nimport { DS_TOAST_POSITION_DEFAULT } from './toast.config';\nimport { ToastComponent } from './toast.component';\nimport { findToastStack, withoutToastOccurrence } from './toast-group';\nimport type { ToastEntry } from './toast.types';\n\n// Fallback floor; leaveDuration() reads the real length off the node.\nconst LEAVE_FALLBACK_MS = 180;\n\n// Grace period once the pointer leaves a toast whose clock ran out under it.\nconst MIN_RESUME_MS = 600;\n\nconst DEFAULT_MAX_VISIBLE = 5;\n\nconst QUEUE_COUNT_CAP = 99;\n\n@Component({\n selector: 'ds-toast-region',\n standalone: true,\n imports: [ToastComponent],\n templateUrl: './toast-region.component.html',\n styleUrl: './toast-region.component.scss',\n encapsulation: ViewEncapsulation.Emulated,\n host: {\n role: 'region',\n '[attr.aria-label]': 'intl().toast.region',\n '(mouseenter)': 'onHover(true)',\n '(mouseleave)': 'onHover(false)',\n '(focusin)': 'onFocusIn($event)',\n '(focusout)': 'onFocusWithin($event)',\n '[class.stack-newest-last]': '!newestFirst',\n },\n})\nexport class ToastRegionComponent {\n protected readonly intl = inject(DS_INTL);\n\n /** Cap on concurrently visible toasts. Extras are queued and shown as\n * earlier ones dismiss. `0` = unlimited. */\n readonly maxVisible = input<number>(DEFAULT_MAX_VISIBLE);\n /** Show a `+N` strip while toasts wait behind `maxVisible`. */\n readonly showQueueCount = input(true, { transform: booleanAttribute });\n\n protected readonly visibleEntries = signal<readonly ToastEntry[]>([]);\n protected readonly leaving = signal<ReadonlySet<number>>(new Set());\n\n private readonly pendingQueue = signal<readonly ToastEntry[]>([]);\n\n protected readonly queuedLabel = computed(() => {\n const waiting = this.pendingQueue().length;\n if (waiting === 0 || !this.showQueueCount()) {\n return null;\n }\n\n return waiting > QUEUE_COUNT_CAP ? `+${QUEUE_COUNT_CAP}+` : `+${waiting}`;\n });\n private readonly timers = new Map<number, number>();\n private readonly leaveTimers = new Map<number, number>();\n private readonly remaining = new Map<number, number>();\n private readonly startedAt = new Map<number, number>();\n private hovered = false;\n private focusWithin = false;\n private focusOrigin: HTMLElement | null = null;\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly position = inject(DS_CONFIG).toast?.position;\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n devWarn(() =>\n this.maxVisible() < 0\n ? `<ds-toast-region> maxVisible is ${this.maxVisible()}; a negative cap means unlimited, which is what 0 says. Pass 0 if that is the intent.`\n : null,\n );\n }\n effect(() => {\n this.maxVisible();\n this.drainQueue();\n });\n // An uncancelled timer fires into a destroyed component.\n inject(DestroyRef).onDestroy(() => {\n this.timers.forEach((timer) => window.clearTimeout(timer));\n this.leaveTimers.forEach((timer) => window.clearTimeout(timer));\n this.timers.clear();\n this.leaveTimers.clear();\n });\n }\n\n /** Newest goes NEAREST the anchor; DOM order is the visual and reading order. */\n protected readonly newestFirst =\n (this.position?.verticalPosition ??\n DS_TOAST_POSITION_DEFAULT.verticalPosition) === 'top';\n\n add(entry: ToastEntry): void {\n const limit = this.maxVisible();\n if (limit > 0 && this.visibleEntries().length >= limit) {\n this.pendingQueue.update((queue) => [...queue, entry]);\n\n return;\n }\n\n this.show(entry);\n }\n\n private show(entry: ToastEntry): void {\n const before = this.measureTops();\n this.visibleEntries.update((existing) =>\n this.newestFirst ? [entry, ...existing] : [...existing, entry],\n );\n this.arm(entry.id, entry.durationMs);\n this.slideNeighbours(before);\n }\n\n /** FLIP, not an absolute stack: that collapses the region to zero height inside the content-sized CDK pane. */\n private slideNeighbours(before: Map<number, number>): void {\n if (!before.size) {\n return;\n }\n requestAnimationFrame(() => {\n const nodes = this.toastNodes();\n const deltas: [HTMLElement, number][] = [];\n for (const [id, node] of nodes) {\n const previousTop = before.get(id);\n if (previousTop === undefined) {\n continue;\n }\n const delta = previousTop - node.getBoundingClientRect().top;\n if (delta) {\n deltas.push([node, delta]);\n }\n }\n for (const [node, delta] of deltas) {\n node.style.setProperty('--_toast-shift', `${delta}px`);\n node.classList.add('shifting');\n }\n requestAnimationFrame(() => {\n for (const [node] of deltas) {\n node.classList.remove('shifting');\n node.style.removeProperty('--_toast-shift');\n }\n });\n });\n }\n\n private toastNodes(): Map<number, HTMLElement> {\n const nodes = new Map<number, HTMLElement>();\n const elements =\n this.host.nativeElement.querySelectorAll<HTMLElement>('ds-toast');\n this.visibleEntries().forEach((entry, index) => {\n const node = elements[index];\n if (node) {\n nodes.set(entry.id, node);\n }\n });\n\n return nodes;\n }\n\n private measureTops(): Map<number, number> {\n const tops = new Map<number, number>();\n for (const [id, node] of this.toastNodes()) {\n tops.set(id, node.getBoundingClientRect().top);\n }\n\n return tops;\n }\n\n private arm(id: number, remaining: number): void {\n if (remaining <= 0) {\n return;\n }\n this.remaining.set(id, remaining);\n // drainQueue arms from a timeout, with no user event nearby, so bank the pause state here.\n if (this.hovered || this.focusWithin) {\n this.startedAt.delete(id);\n\n return;\n }\n this.startedAt.set(id, Date.now());\n const existing = this.timers.get(id);\n if (existing !== undefined) {\n window.clearTimeout(existing);\n }\n this.timers.set(\n id,\n window.setTimeout(() => this.remove(id), remaining),\n );\n }\n\n private clearCountdown(id: number): void {\n const timer = this.timers.get(id);\n if (timer !== undefined) {\n window.clearTimeout(timer);\n this.timers.delete(id);\n }\n this.remaining.delete(id);\n this.startedAt.delete(id);\n }\n\n protected onHover(entered: boolean): void {\n this.hovered = entered;\n this.syncPause();\n }\n\n protected onFocusIn(event: FocusEvent): void {\n const from = event.relatedTarget;\n if (\n from instanceof HTMLElement &&\n !this.host.nativeElement.contains(from)\n ) {\n this.focusOrigin = from;\n }\n this.onFocusWithin(true);\n }\n\n // `focusout` also fires when focus moves BETWEEN elements inside the region; the containment check avoids re-flooring at MIN_RESUME_MS.\n protected onFocusWithin(event: FocusEvent | true): void {\n this.focusWithin =\n event === true ||\n (event.relatedTarget instanceof Node &&\n this.host.nativeElement.contains(event.relatedTarget));\n this.syncPause();\n }\n\n private syncPause(): void {\n const shouldPause = this.hovered || this.focusWithin;\n if (shouldPause === this.paused) {\n return;\n }\n if (shouldPause) {\n this.pauseAll();\n } else {\n this.resumeAll();\n }\n }\n\n private get paused(): boolean {\n return this.timers.size === 0 && this.remaining.size > 0;\n }\n\n private pauseAll(): void {\n const now = Date.now();\n for (const [id, timer] of this.timers) {\n window.clearTimeout(timer);\n const left =\n (this.remaining.get(id) ?? 0) - (now - (this.startedAt.get(id) ?? now));\n this.remaining.set(id, Math.max(left, MIN_RESUME_MS));\n }\n this.timers.clear();\n }\n\n private resumeAll(): void {\n for (const [id, left] of [...this.remaining]) {\n this.arm(id, left);\n }\n }\n\n /** Replaces fields of a visible or queued toast in place. Patching `durationMs`\n * restarts the clock; on a QUEUED toast it takes effect on promotion. */\n update(\n id: number,\n patch: Partial<\n Pick<\n ToastEntry,\n | 'body'\n | 'title'\n | 'variant'\n | 'dismissible'\n | 'action'\n | 'durationMs'\n | 'occurrences'\n | 'groupKey'\n >\n >,\n ): void {\n const inVisible = this.visibleEntries().some((entry) => entry.id === id);\n if (inVisible) {\n this.visibleEntries.update((entries) =>\n entries.map((entry) =>\n entry.id === id ? { ...entry, ...patch } : entry,\n ),\n );\n if (patch.durationMs !== undefined) {\n this.clearCountdown(id);\n this.arm(id, patch.durationMs);\n }\n\n return;\n }\n this.pendingQueue.update((queue) =>\n queue.map((entry) => (entry.id === id ? { ...entry, ...patch } : entry)),\n );\n }\n\n /** The visible or queued toast with this id; one already leaving is gone. */\n entryFor(id: number): ToastEntry | undefined {\n return [...this.visibleEntries(), ...this.pendingQueue()].find(\n (entry) => entry.id === id && !this.isLeaving(id),\n );\n }\n\n /** The visible or queued toast a repeat with this `groupKey` folds into; one already leaving\n * takes no more. */\n stackFor(key: string): ToastEntry | undefined {\n return findToastStack(\n [\n ...this.visibleEntries().filter((entry) => !this.isLeaving(entry.id)),\n ...this.pendingQueue(),\n ],\n key,\n );\n }\n\n protected closeOccurrence(entry: ToastEntry, occurrenceId: number): void {\n const occurrences = withoutToastOccurrence(entry, occurrenceId);\n if (occurrences) {\n this.update(entry.id, { occurrences });\n } else {\n this.remove(entry.id);\n }\n }\n\n remove(id: number): void {\n // A `ToastRef` outlives its toast, so dismiss() can arrive for an id nothing holds.\n const isVisible = this.visibleEntries().some((entry) => entry.id === id);\n const queued = this.pendingQueue().some((entry) => entry.id === id);\n if (!isVisible && !queued) {\n return;\n }\n\n this.clearCountdown(id);\n if (queued) {\n this.pendingQueue.update((queue) =>\n queue.filter((entry) => entry.id !== id),\n );\n\n return;\n }\n if (this.leaving().has(id)) {\n return;\n }\n const node = this.toastNodes().get(id);\n if (node) {\n // A neighbouring toast first, then where focus came from, as a dialog returns it.\n moveFocusOutOf(node, this.host.nativeElement, this.focusOrigin);\n }\n this.leaving.update((set) => new Set(set).add(id));\n this.leaveTimers.set(\n id,\n window.setTimeout(() => {\n this.leaveTimers.delete(id);\n this.visibleEntries.update((existing) =>\n existing.filter((entry) => entry.id !== id),\n );\n this.leaving.update((set) => {\n const next = new Set(set);\n next.delete(id);\n\n return next;\n });\n this.drainQueue();\n }, this.leaveDuration(id)),\n );\n }\n\n /** The leave transition length is a public token, so read it off the node. Reduced\n * motion zeroes it, so the floor applies only when there is nothing to measure. */\n private leaveDuration(id: number): number {\n const node = this.toastNodes().get(id);\n if (!node) {\n return LEAVE_FALLBACK_MS;\n }\n const declared = getComputedStyle(node)\n .transitionDuration.split(',')\n .map((part) => parseFloat(part) * 1000)\n .filter((ms) => !Number.isNaN(ms));\n\n return declared.length ? Math.max(...declared) : LEAVE_FALLBACK_MS;\n }\n\n protected isLeaving(id: number): boolean {\n return this.leaving().has(id);\n }\n\n clear(): void {\n this.timers.forEach((timer) => window.clearTimeout(timer));\n this.leaveTimers.forEach((timer) => window.clearTimeout(timer));\n this.timers.clear();\n this.leaveTimers.clear();\n this.remaining.clear();\n this.startedAt.clear();\n this.visibleEntries.set([]);\n this.leaving.set(new Set());\n this.pendingQueue.set([]);\n }\n\n private drainQueue(): void {\n while (this.pendingQueue().length) {\n const limit = this.maxVisible();\n if (limit > 0 && this.visibleEntries().length >= limit) {\n return;\n }\n const [next, ...rest] = this.pendingQueue();\n this.pendingQueue.set(rest);\n this.show(next);\n }\n }\n}\n","@if (queuedLabel(); as label) {\n <!-- aria-hidden: ToastService already announced every toast, queued ones included. -->\n <div\n class=\"queue-count\"\n aria-hidden=\"true\">\n {{ label }}\n </div>\n}\n\n@for (entry of visibleEntries(); track entry.id) {\n <ds-toast\n [variant]=\"entry.variant\"\n [title]=\"entry.title ?? ''\"\n [body]=\"entry.body\"\n [dismissible]=\"entry.dismissible\"\n [action]=\"entry.action ?? null\"\n [occurrences]=\"entry.occurrences ?? []\"\n [class.leaving]=\"isLeaving(entry.id)\"\n (closed)=\"remove(entry.id)\"\n (occurrenceClosed)=\"closeOccurrence(entry, $event)\" />\n}\n","import { ComponentRef, DestroyRef, Injectable, inject } from '@angular/core';\nimport {\n Overlay,\n OverlayRef,\n GlobalPositionStrategy,\n} from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport { LiveAnnouncer } from '@angular/cdk/a11y';\nimport {\n DS_CONFIG,\n DS_INTL,\n DS_INTL_DEFAULTS,\n addDevWarningSink,\n} from '@ids-group-ltd/ids-design-system/core';\nimport { ToastRegionComponent } from './toast-region.component';\nimport { DS_TOAST_POSITION_DEFAULT } from './toast.config';\nimport {\n TOAST_DEFAULT_DURATION_MS,\n toastGroupKey,\n toastRepeatPatch,\n toastUpdatePatch,\n} from './toast-group';\nimport type {\n ToastEntry,\n ToastVariant,\n ToastOptions,\n ToastPromiseMessages,\n ToastRef,\n ToastUpdate,\n} from './toast.types';\n\nconst SETTLED_SUCCESS_MS = 4000;\nconst SETTLED_ERROR_MS = 6000;\n\n// Must outlast the loop that fires a burst.\nconst ANNOUNCE_COALESCE_MS = 120;\nconst DEV_WARNING_MS = 10000;\n\n@Injectable({ providedIn: 'root' })\nexport class ToastService {\n private readonly overlay = inject(Overlay);\n private readonly toastConfig = inject(DS_CONFIG).toast;\n private readonly announcer = inject(LiveAnnouncer);\n private readonly intl = inject(DS_INTL);\n private overlayRef: OverlayRef | null = null;\n private regionRef: ComponentRef<ToastRegionComponent> | null = null;\n private nextId = 1;\n // Keyed so a burst of repeats of one stack leaves only its latest count to speak.\n private readonly pendingAnnouncements = new Map<unknown, string>();\n private pendingAssertive = false;\n private announceTimer: number | undefined;\n private scrimWatcher: MutationObserver | null = null;\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (this.toastConfig?.mirrorDevWarnings ?? true) {\n // Deferred: a warning raised inside an effect or a render hook must not build the toast region there.\n const unregister = addDevWarningSink((message) =>\n setTimeout(() =>\n this.show({\n title: 'Dev warning',\n body: message,\n variant: 'warning',\n durationMs: DEV_WARNING_MS,\n }),\n ),\n );\n inject(DestroyRef).onDestroy(unregister);\n }\n }\n inject(DestroyRef).onDestroy(() => {\n clearTimeout(this.announceTimer);\n this.scrimWatcher?.disconnect();\n this.overlayRef?.dispose();\n this.overlayRef = null;\n this.regionRef = null;\n });\n }\n\n show(opts: ToastOptions): ToastRef {\n this.ensureRegion();\n const id = this.nextId++;\n const variant = opts.variant ?? 'info';\n const groupKey = toastGroupKey(this.toastConfig, opts, variant);\n const occurrence = { id, body: opts.body, at: Date.now() };\n const stack =\n groupKey === undefined\n ? undefined\n : this.regionRef!.instance.stackFor(groupKey);\n if (stack) {\n const patch = toastRepeatPatch(stack, occurrence);\n this.regionRef!.instance.update(stack.id, patch);\n const repeated =\n this.intl().toast.repeated ?? DS_INTL_DEFAULTS.toast.repeated;\n const message = [stack.title, stack.body].filter(Boolean).join('. ');\n this.announce(\n variant,\n repeated(message, patch.occurrences.length),\n undefined,\n groupKey,\n );\n\n return this.refFor(stack.id);\n }\n // An `action` toast cannot expire: the region is the last child of `body`, so a\n // keyboard user cannot reach the button in time.\n const durationMs =\n variant === 'loading' || opts.action\n ? 0\n : (opts.durationMs ?? TOAST_DEFAULT_DURATION_MS);\n const entry: ToastEntry = {\n id,\n title: opts.title,\n body: opts.body,\n variant,\n // Nothing that cannot expire may also be unclosable, or it holds a slot for the page's life.\n dismissible: durationMs > 0 ? (opts.dismissible ?? true) : true,\n action: opts.action,\n durationMs,\n ...(groupKey === undefined\n ? {}\n : { groupKey, occurrences: [occurrence] }),\n };\n // The region runs the countdown: a toast queued behind `maxVisible` would expire unseen if started here.\n this.regionRef!.instance.add(entry);\n this.announce(variant, entry.body, entry.title, groupKey);\n\n return this.refFor(id);\n }\n\n private refFor(id: number): ToastRef {\n return {\n id,\n dismiss: () => this.regionRef?.instance.remove(id),\n update: (patch) => this.updateToast(id, patch),\n };\n }\n\n private updateToast(id: number, update: ToastUpdate): void {\n const region = this.regionRef?.instance;\n const current = region?.entryFor(id);\n const planned = toastUpdatePatch(current, update);\n if (!region || !current || !planned) {\n return;\n }\n region.update(id, planned.patch);\n if (planned.announce) {\n const next = { ...current, ...planned.patch };\n this.announce(next.variant, next.body, next.title);\n }\n }\n\n /** Shows a loading toast for the duration of `source`; resolution and rejection turn the\n * same toast into a success/error variant with its own auto-dismiss delay.\n *\n * Returns `source` itself, so the caller still owns rejection handling. */\n promise<T>(\n source: Promise<T>,\n messages: ToastPromiseMessages<T>,\n ): Promise<T> {\n const ref = this.show({\n body: messages.loading,\n variant: 'loading',\n durationMs: 0,\n });\n\n source.then(\n (value) => {\n const successBody =\n typeof messages.success === 'function'\n ? messages.success(value)\n : messages.success;\n ref.update({\n body: successBody,\n variant: 'success',\n durationMs: SETTLED_SUCCESS_MS,\n });\n },\n (reason: unknown) => {\n const errorBody =\n typeof messages.error === 'function'\n ? messages.error(reason)\n : messages.error;\n ref.update({\n body: errorBody,\n variant: 'error',\n durationMs: SETTLED_ERROR_MS,\n });\n },\n );\n\n return source;\n }\n\n /** The announcement must NOT ride the visual toast: `aria-live` on an element created\n * together with its text announces nothing in NVDA or JAWS.\n *\n * Serialising a burst does not work either: `announce()` clears the region and writes\n * on a timeout, so the next message wipes the previous one. One region change carrying\n * every message is the only shape that survives. */\n private announce(\n variant: ToastVariant,\n body: string,\n title?: string,\n key: unknown = Symbol(),\n ): void {\n const spoken = [title, body].filter(Boolean).join('. ');\n if (!spoken) {\n return;\n }\n this.pendingAnnouncements.set(key, spoken);\n if (variant === 'error' || variant === 'warning') {\n this.pendingAssertive = true;\n }\n clearTimeout(this.announceTimer);\n this.announceTimer = window.setTimeout(() => {\n const message = [...this.pendingAnnouncements.values()].join('. ');\n const politeness = this.pendingAssertive ? 'assertive' : 'polite';\n this.pendingAnnouncements.clear();\n this.pendingAssertive = false;\n this.announcer.announce(message, politeness);\n }, ANNOUNCE_COALESCE_MS);\n }\n\n dismissAll(): void {\n this.regionRef?.instance.clear();\n }\n\n private ensureRegion(): void {\n if (this.overlayRef) {\n return;\n }\n this.overlayRef = this.overlay.create({\n hasBackdrop: false,\n panelClass: 'ds-toast-panel',\n positionStrategy: this.buildPositionStrategy(),\n });\n this.regionRef = this.overlayRef.attach(\n new ComponentPortal(ToastRegionComponent),\n );\n // `>= 0`, not truthiness: 0 asks for an uncapped stack and must not read as \"unset\".\n const maxVisible = this.toastConfig?.maxVisible;\n if (typeof maxVisible === 'number' && maxVisible >= 0) {\n this.regionRef.setInput('maxVisible', maxVisible);\n }\n const showQueueCount = this.toastConfig?.showQueueCount;\n if (typeof showQueueCount === 'boolean') {\n this.regionRef.setInput('showQueueCount', showQueueCount);\n }\n this.keepAboveScrims();\n }\n\n /** Keeps the toast above a scrim opened AFTER it. `--layer-toast` cannot: CDK overlay hosts\n * are `popover=\"manual\"` and the top layer paints in show order, ignoring z-index.\n * Scrimmed overlays only: `--layer-tooltip` sits above the toast. */\n private keepAboveScrims(): void {\n const host = this.overlayRef?.hostElement;\n const container = host?.parentElement;\n if (!host || !container || typeof host.showPopover !== 'function') {\n return;\n }\n this.scrimWatcher = new MutationObserver((records) => {\n const scrimAppeared = records.some((record) =>\n [...record.addedNodes].some(\n (node) =>\n node instanceof HTMLElement &&\n node !== host &&\n (node.classList.contains('cdk-overlay-backdrop') ||\n node.querySelector?.('.cdk-overlay-backdrop')),\n ),\n );\n if (!scrimAppeared || !host.isConnected) {\n return;\n }\n // The top layer has no \"raise\"; re-showing is the only lever.\n try {\n host.hidePopover();\n host.showPopover();\n } catch {\n // The host may not be showing, and hidePopover() throws when it is not.\n }\n });\n this.scrimWatcher.observe(container, { childList: true, subtree: true });\n }\n\n private buildPositionStrategy(): GlobalPositionStrategy {\n const config = {\n ...DS_TOAST_POSITION_DEFAULT,\n ...this.toastConfig?.position,\n };\n const strategy = this.overlay.position().global();\n if (config.verticalPosition === 'top') {\n strategy.top(config.offset);\n } else {\n strategy.bottom(config.offset);\n }\n if (config.horizontalPosition === 'left') {\n strategy.left(config.offset);\n } else if (config.horizontalPosition === 'right') {\n strategy.right(config.offset);\n } else {\n strategy.centerHorizontally();\n }\n\n return strategy;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAEO,MAAM,yBAAyB,GAAoB;AACxD,IAAA,kBAAkB,EAAE,OAAO;AAC3B,IAAA,gBAAgB,EAAE,KAAK;AACvB,IAAA,MAAM,EAAE,gBAAgB;;;ACgB1B;;AAEG;MAWU,cAAc,CAAA;AACN,IAAA,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC;;AAGhC,IAAA,OA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A,EAAA,YAAY,cADC,MAAM,EAAA,CAAA;;4FACnB,YAAY,EAAA,UAAA,EAAA,CAAA;kBADxB,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACtClC;;AAEG;;;;"}
@@ -4,7 +4,7 @@ import { Overlay } from '@angular/cdk/overlay';
4
4
  import { ComponentPortal } from '@angular/cdk/portal';
5
5
  import { retainStyles, isTextClipped, DS_CONFIG } from '@ids-group-ltd/ids-design-system/core';
6
6
  import { NgTemplateOutlet } from '@angular/common';
7
- import { listenForEscape, prepareOverlayEnter, closeOnScroll, overlayPlacementOf } from '@ids-group-ltd/ids-design-system/components';
7
+ import { listenForEscape, prepareOverlayEnter, closeOnScroll, overlayPlacementOf, pointArrowAtHost } from '@ids-group-ltd/ids-design-system/components';
8
8
 
9
9
  const TOKEN = /(\\\*\\\*|\*\*)/;
10
10
  const ESCAPED = '\\*\\*';
@@ -81,7 +81,7 @@ class TooltipPanelComponent {
81
81
  <span [textContent]="segment.text"></span>
82
82
  }
83
83
  }
84
- `, isInline: true, styles: [":where(:host){box-sizing:border-box;interpolate-size:allow-keywords}:where(*){box-sizing:border-box}:where(button,input,select,textarea){font-family:inherit}:where(h1,h2,h3,h4,h5,h6){margin:0}:where(:host(:focus-visible),:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard);border-radius:var(--focus-ring-radius)}@media(forced-colors:active){:where(:host(:focus-visible),:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}:host{--_tooltip-bg-color: var(--ds-tooltip-bg-color, var(--tooltip-bg-color));--_tooltip-text-color: var(--ds-tooltip-text-color, var(--tooltip-text-color));--_tooltip-border-color: var(--ds-tooltip-border-color, var(--tooltip-border-color));--_tooltip-radius: var(--ds-tooltip-radius, var(--ds-radius-control));--_tooltip-shadow: var(--ds-tooltip-shadow, var(--ds-elevation-overlay));--_tooltip-max-width: var(--ds-tooltip-max-width, var(--tooltip-maxw));--_tooltip-padding: var(--ds-tooltip-padding, var(--space-1-5) var(--space-2-5));--_tooltip-arrow-inset: calc(var(--_tooltip-radius) + var(--tooltip-arrow));--_tooltip-arrow-left: clamp(min(var(--_tooltip-arrow-inset), 50%), var(--_tooltip-arrow-x, 50%), max(100% - var(--_tooltip-arrow-inset), 50%));--_tooltip-arrow-top: clamp(min(var(--_tooltip-arrow-inset), 50%), var(--_tooltip-arrow-y, 50%), max(100% - var(--_tooltip-arrow-inset), 50%));display:block;position:relative;background:var(--_tooltip-bg-color);color:var(--_tooltip-text-color);border:var(--border-width-default) solid var(--_tooltip-border-color);font:var(--font-weight-medium) var(--font-size-xs)/var(--line-height-base) var(--font-sans);padding:var(--_tooltip-padding);border-radius:var(--_tooltip-radius);max-width:var(--_tooltip-max-width);overflow-wrap:anywhere;white-space:pre-line;z-index:var(--layer-tooltip);box-shadow:var(--_tooltip-shadow)}:host strong{font-weight:var(--font-weight-bold)}:host:after{content:\"\";box-sizing:border-box;position:absolute;width:var(--space-2);height:var(--space-2);background:var(--_tooltip-bg-color);border:0 solid var(--_tooltip-border-color);transform:rotate(45deg)}:host(.no-arrow):after{display:none}:host(.bottom):after{top:calc(var(--tooltip-arrow) / -2 - var(--border-width-default));left:var(--_tooltip-arrow-left);margin-left:calc(var(--tooltip-arrow) / -2);border-top-width:var(--border-width-default);border-left-width:var(--border-width-default)}:host(.top):after{bottom:calc(var(--tooltip-arrow) / -2 - var(--border-width-default));left:var(--_tooltip-arrow-left);margin-left:calc(var(--tooltip-arrow) / -2);border-bottom-width:var(--border-width-default);border-right-width:var(--border-width-default)}:host(.left):after{right:calc(var(--tooltip-arrow) / -2 - var(--border-width-default));top:var(--_tooltip-arrow-top);margin-top:calc(var(--tooltip-arrow) / -2);border-top-width:var(--border-width-default);border-right-width:var(--border-width-default)}:host(.right):after{left:calc(var(--tooltip-arrow) / -2 - var(--border-width-default));top:var(--_tooltip-arrow-top);margin-top:calc(var(--tooltip-arrow) / -2);border-bottom-width:var(--border-width-default);border-left-width:var(--border-width-default)}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
84
+ `, isInline: true, styles: [":where(:host){box-sizing:border-box;interpolate-size:allow-keywords}:where(*){box-sizing:border-box}:where(button,input,select,textarea){font-family:inherit}:where(h1,h2,h3,h4,h5,h6){margin:0}:where(:host(:focus-visible),:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard);border-radius:var(--focus-ring-radius)}@media(forced-colors:active){:where(:host(:focus-visible),:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}:host{--_tooltip-bg-color: var(--ds-tooltip-bg-color, var(--tooltip-bg-color));--_tooltip-text-color: var(--ds-tooltip-text-color, var(--tooltip-text-color));--_tooltip-border-color: var(--ds-tooltip-border-color, var(--tooltip-border-color));--surface-secondary: var(--surface-overlay-raised-secondary);--surface-muted: var(--surface-overlay-raised-muted);--_tooltip-radius: var(--ds-tooltip-radius, var(--ds-radius-control));--_tooltip-shadow: var(--ds-tooltip-shadow, var(--ds-elevation-overlay));--_tooltip-max-width: var(--ds-tooltip-max-width, var(--tooltip-maxw));--_tooltip-padding: var(--ds-tooltip-padding, var(--space-1-5) var(--space-2-5));--_tooltip-arrow-inset: calc(var(--_tooltip-radius) + var(--tooltip-arrow));--_tooltip-arrow-left: clamp(min(var(--_tooltip-arrow-inset), 50%), var(--_overlay-arrow-x, 50%), max(100% - var(--_tooltip-arrow-inset), 50%));--_tooltip-arrow-top: clamp(min(var(--_tooltip-arrow-inset), 50%), var(--_overlay-arrow-y, 50%), max(100% - var(--_tooltip-arrow-inset), 50%));display:block;position:relative;background:var(--_tooltip-bg-color);color:var(--_tooltip-text-color);border:var(--border-width-default) solid var(--_tooltip-border-color);font:var(--font-weight-medium) var(--font-size-xs)/var(--line-height-base) var(--font-sans);padding:var(--_tooltip-padding);border-radius:var(--_tooltip-radius);max-width:var(--_tooltip-max-width);overflow-wrap:anywhere;white-space:pre-line;z-index:var(--layer-tooltip);box-shadow:var(--_tooltip-shadow)}:host strong{font-weight:var(--font-weight-bold)}:host:after{content:\"\";box-sizing:border-box;position:absolute;width:var(--space-2);height:var(--space-2);background:var(--_tooltip-bg-color);border:0 solid var(--_tooltip-border-color);transform:rotate(45deg)}:host(.no-arrow):after{display:none}:host(.bottom):after{top:calc(var(--tooltip-arrow) / -2 - var(--border-width-default));left:var(--_tooltip-arrow-left);margin-left:calc(var(--tooltip-arrow) / -2);border-top-width:var(--border-width-default);border-left-width:var(--border-width-default)}:host(.top):after{bottom:calc(var(--tooltip-arrow) / -2 - var(--border-width-default));left:var(--_tooltip-arrow-left);margin-left:calc(var(--tooltip-arrow) / -2);border-bottom-width:var(--border-width-default);border-right-width:var(--border-width-default)}:host(.left):after{right:calc(var(--tooltip-arrow) / -2 - var(--border-width-default));top:var(--_tooltip-arrow-top);margin-top:calc(var(--tooltip-arrow) / -2);border-top-width:var(--border-width-default);border-right-width:var(--border-width-default)}:host(.right):after{left:calc(var(--tooltip-arrow) / -2 - var(--border-width-default));top:var(--_tooltip-arrow-top);margin-top:calc(var(--tooltip-arrow) / -2);border-bottom-width:var(--border-width-default);border-left-width:var(--border-width-default)}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
85
85
  }
86
86
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: TooltipPanelComponent, decorators: [{
87
87
  type: Component,
@@ -105,7 +105,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
105
105
  '[class.left]': "placement() === 'left'",
106
106
  '[class.right]': "placement() === 'right'",
107
107
  '[class.no-arrow]': '!arrow()',
108
- }, encapsulation: ViewEncapsulation.Emulated, styles: [":where(:host){box-sizing:border-box;interpolate-size:allow-keywords}:where(*){box-sizing:border-box}:where(button,input,select,textarea){font-family:inherit}:where(h1,h2,h3,h4,h5,h6){margin:0}:where(:host(:focus-visible),:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard);border-radius:var(--focus-ring-radius)}@media(forced-colors:active){:where(:host(:focus-visible),:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}:host{--_tooltip-bg-color: var(--ds-tooltip-bg-color, var(--tooltip-bg-color));--_tooltip-text-color: var(--ds-tooltip-text-color, var(--tooltip-text-color));--_tooltip-border-color: var(--ds-tooltip-border-color, var(--tooltip-border-color));--_tooltip-radius: var(--ds-tooltip-radius, var(--ds-radius-control));--_tooltip-shadow: var(--ds-tooltip-shadow, var(--ds-elevation-overlay));--_tooltip-max-width: var(--ds-tooltip-max-width, var(--tooltip-maxw));--_tooltip-padding: var(--ds-tooltip-padding, var(--space-1-5) var(--space-2-5));--_tooltip-arrow-inset: calc(var(--_tooltip-radius) + var(--tooltip-arrow));--_tooltip-arrow-left: clamp(min(var(--_tooltip-arrow-inset), 50%), var(--_tooltip-arrow-x, 50%), max(100% - var(--_tooltip-arrow-inset), 50%));--_tooltip-arrow-top: clamp(min(var(--_tooltip-arrow-inset), 50%), var(--_tooltip-arrow-y, 50%), max(100% - var(--_tooltip-arrow-inset), 50%));display:block;position:relative;background:var(--_tooltip-bg-color);color:var(--_tooltip-text-color);border:var(--border-width-default) solid var(--_tooltip-border-color);font:var(--font-weight-medium) var(--font-size-xs)/var(--line-height-base) var(--font-sans);padding:var(--_tooltip-padding);border-radius:var(--_tooltip-radius);max-width:var(--_tooltip-max-width);overflow-wrap:anywhere;white-space:pre-line;z-index:var(--layer-tooltip);box-shadow:var(--_tooltip-shadow)}:host strong{font-weight:var(--font-weight-bold)}:host:after{content:\"\";box-sizing:border-box;position:absolute;width:var(--space-2);height:var(--space-2);background:var(--_tooltip-bg-color);border:0 solid var(--_tooltip-border-color);transform:rotate(45deg)}:host(.no-arrow):after{display:none}:host(.bottom):after{top:calc(var(--tooltip-arrow) / -2 - var(--border-width-default));left:var(--_tooltip-arrow-left);margin-left:calc(var(--tooltip-arrow) / -2);border-top-width:var(--border-width-default);border-left-width:var(--border-width-default)}:host(.top):after{bottom:calc(var(--tooltip-arrow) / -2 - var(--border-width-default));left:var(--_tooltip-arrow-left);margin-left:calc(var(--tooltip-arrow) / -2);border-bottom-width:var(--border-width-default);border-right-width:var(--border-width-default)}:host(.left):after{right:calc(var(--tooltip-arrow) / -2 - var(--border-width-default));top:var(--_tooltip-arrow-top);margin-top:calc(var(--tooltip-arrow) / -2);border-top-width:var(--border-width-default);border-right-width:var(--border-width-default)}:host(.right):after{left:calc(var(--tooltip-arrow) / -2 - var(--border-width-default));top:var(--_tooltip-arrow-top);margin-top:calc(var(--tooltip-arrow) / -2);border-bottom-width:var(--border-width-default);border-left-width:var(--border-width-default)}\n"] }]
108
+ }, encapsulation: ViewEncapsulation.Emulated, styles: [":where(:host){box-sizing:border-box;interpolate-size:allow-keywords}:where(*){box-sizing:border-box}:where(button,input,select,textarea){font-family:inherit}:where(h1,h2,h3,h4,h5,h6){margin:0}:where(:host(:focus-visible),:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard);border-radius:var(--focus-ring-radius)}@media(forced-colors:active){:where(:host(:focus-visible),:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}:host{--_tooltip-bg-color: var(--ds-tooltip-bg-color, var(--tooltip-bg-color));--_tooltip-text-color: var(--ds-tooltip-text-color, var(--tooltip-text-color));--_tooltip-border-color: var(--ds-tooltip-border-color, var(--tooltip-border-color));--surface-secondary: var(--surface-overlay-raised-secondary);--surface-muted: var(--surface-overlay-raised-muted);--_tooltip-radius: var(--ds-tooltip-radius, var(--ds-radius-control));--_tooltip-shadow: var(--ds-tooltip-shadow, var(--ds-elevation-overlay));--_tooltip-max-width: var(--ds-tooltip-max-width, var(--tooltip-maxw));--_tooltip-padding: var(--ds-tooltip-padding, var(--space-1-5) var(--space-2-5));--_tooltip-arrow-inset: calc(var(--_tooltip-radius) + var(--tooltip-arrow));--_tooltip-arrow-left: clamp(min(var(--_tooltip-arrow-inset), 50%), var(--_overlay-arrow-x, 50%), max(100% - var(--_tooltip-arrow-inset), 50%));--_tooltip-arrow-top: clamp(min(var(--_tooltip-arrow-inset), 50%), var(--_overlay-arrow-y, 50%), max(100% - var(--_tooltip-arrow-inset), 50%));display:block;position:relative;background:var(--_tooltip-bg-color);color:var(--_tooltip-text-color);border:var(--border-width-default) solid var(--_tooltip-border-color);font:var(--font-weight-medium) var(--font-size-xs)/var(--line-height-base) var(--font-sans);padding:var(--_tooltip-padding);border-radius:var(--_tooltip-radius);max-width:var(--_tooltip-max-width);overflow-wrap:anywhere;white-space:pre-line;z-index:var(--layer-tooltip);box-shadow:var(--_tooltip-shadow)}:host strong{font-weight:var(--font-weight-bold)}:host:after{content:\"\";box-sizing:border-box;position:absolute;width:var(--space-2);height:var(--space-2);background:var(--_tooltip-bg-color);border:0 solid var(--_tooltip-border-color);transform:rotate(45deg)}:host(.no-arrow):after{display:none}:host(.bottom):after{top:calc(var(--tooltip-arrow) / -2 - var(--border-width-default));left:var(--_tooltip-arrow-left);margin-left:calc(var(--tooltip-arrow) / -2);border-top-width:var(--border-width-default);border-left-width:var(--border-width-default)}:host(.top):after{bottom:calc(var(--tooltip-arrow) / -2 - var(--border-width-default));left:var(--_tooltip-arrow-left);margin-left:calc(var(--tooltip-arrow) / -2);border-bottom-width:var(--border-width-default);border-right-width:var(--border-width-default)}:host(.left):after{right:calc(var(--tooltip-arrow) / -2 - var(--border-width-default));top:var(--_tooltip-arrow-top);margin-top:calc(var(--tooltip-arrow) / -2);border-top-width:var(--border-width-default);border-right-width:var(--border-width-default)}:host(.right):after{left:calc(var(--tooltip-arrow) / -2 - var(--border-width-default));top:var(--_tooltip-arrow-top);margin-top:calc(var(--tooltip-arrow) / -2);border-bottom-width:var(--border-width-default);border-left-width:var(--border-width-default)}\n"] }]
109
109
  }], ctorParameters: () => [], propDecorators: { text: [{ type: i0.Input, args: [{ isSignal: true, alias: "text", required: true }] }], placement: [{ type: i0.Input, args: [{ isSignal: true, alias: "placement", required: true }] }], arrow: [{ type: i0.Input, args: [{ isSignal: true, alias: "arrow", required: false }] }], panelId: [{ type: i0.Input, args: [{ isSignal: true, alias: "panelId", required: false }] }] } });
110
110
 
111
111
  const NATIVELY_FOCUSABLE = 'a[href], button, input, select, textarea, summary';
@@ -347,21 +347,6 @@ function positionFor(placement) {
347
347
  function positionsFor(placement) {
348
348
  return [positionFor(placement), positionFor(OPPOSITE_PLACEMENT[placement])];
349
349
  }
350
- // positionChanges skips a re-apply that only pushes the pane; the styles CDK writes do not.
351
- // The pane is measured, not the panel: the panel's enter animation scales it.
352
- function pointArrowAtHost(ref, panel, host) {
353
- const pane = ref.overlayElement;
354
- const point = () => {
355
- const trigger = host.getBoundingClientRect();
356
- const box = pane.getBoundingClientRect();
357
- panel.style.setProperty('--_tooltip-arrow-x', `${trigger.left + trigger.width / 2 - box.left - panel.clientLeft}px`);
358
- panel.style.setProperty('--_tooltip-arrow-y', `${trigger.top + trigger.height / 2 - box.top - panel.clientTop}px`);
359
- };
360
- const observer = new MutationObserver(point);
361
- observer.observe(ref.hostElement, { attributeFilter: ['style'] });
362
- observer.observe(pane, { attributeFilter: ['style'] });
363
- ref.detachments().subscribe({ complete: () => observer.disconnect() });
364
- }
365
350
 
366
351
  const toOptionalBoolean = (value) => value == null ? null : booleanAttribute(value);
367
352
  const PINNED_ATTRIBUTE = 'data-ds-tooltip-pinned';
@@ -638,7 +623,7 @@ ${given}`;
638
623
  cmpRef.setInput('text', tip);
639
624
  cmpRef.setInput('placement', placement);
640
625
  cmpRef.setInput('arrow', this.arrow());
641
- positionStrategy.positionChanges.subscribe(({ connectionPair }) => cmpRef.setInput('placement', overlayPlacementOf(connectionPair.overlayY, connectionPair.overlayX)));
626
+ positionStrategy.positionChanges.subscribe(({ connectionPair }) => cmpRef.setInput('placement', overlayPlacementOf(connectionPair)));
642
627
  cmpRef.setInput('panelId', this.tipId);
643
628
  pointArrowAtHost(this.ref, cmpRef.location.nativeElement, this.hostElement);
644
629
  this.ref.detachments().subscribe(() => this.unpin?.());
@@ -1 +1 @@
1
- {"version":3,"file":"ids-group-ltd-ids-design-system-components-tooltip.mjs","sources":["../../../src/lib/components/tooltip/tooltip-markup.ts","../../../src/lib/components/tooltip/tooltip-panel.component.ts","../../../src/lib/components/tooltip/tooltip-ancestor-focus.ts","../../../src/lib/components/tooltip/tooltip-clip.ts","../../../src/lib/components/tooltip/tooltip-position.ts","../../../src/lib/components/tooltip/tooltip.directive.ts","../../../src/lib/components/tooltip/ids-group-ltd-ids-design-system-components-tooltip.ts"],"sourcesContent":["export interface TooltipSegment {\n text: string;\n bold: boolean;\n}\n\nconst TOKEN = /(\\\\\\*\\\\\\*|\\*\\*)/;\nconst ESCAPED = '\\\\*\\\\*';\nconst BOLD = '**';\n\n/** Splits tip text on `**` into plain and bold runs. `\\*\\*` is a literal `**`; an unpaired `**` is literal too. */\nexport function parseTooltipMarkup(text: string): TooltipSegment[] {\n const tokens = text.split(TOKEN);\n const markerCount = tokens.filter((token) => token === BOLD).length;\n const pairedMarkers = markerCount - (markerCount % 2);\n const segments: TooltipSegment[] = [];\n let bold = false;\n let seen = 0;\n for (const token of tokens) {\n let piece = token;\n if (token === ESCAPED) {\n piece = BOLD;\n } else if (token === BOLD && seen++ < pairedMarkers) {\n bold = !bold;\n continue;\n }\n if (!piece) {\n continue;\n }\n const last = segments[segments.length - 1];\n if (last?.bold === bold) {\n last.text += piece;\n } else {\n segments.push({ text: piece, bold });\n }\n }\n\n return segments;\n}\n\nexport function escapeTooltipMarkup(text: string): string {\n return text.replaceAll(BOLD, ESCAPED);\n}\n\nexport function plainTooltipText(text: string): string {\n return parseTooltipMarkup(text)\n .map((segment) => segment.text)\n .join('');\n}\n","import {\n Component,\n TemplateRef,\n ViewEncapsulation,\n computed,\n input,\n} from '@angular/core';\nimport {\n retainStyles,\n type TooltipPlacement,\n} from '@ids-group-ltd/ids-design-system/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { parseTooltipMarkup } from './tooltip-markup';\n\n@Component({\n selector: 'ds-tooltip-panel',\n standalone: true,\n imports: [NgTemplateOutlet],\n template: `\n @if (template(); as template) {\n <ng-container [ngTemplateOutlet]=\"template\" />\n }\n\n @for (segment of segments(); track $index) {\n @if (segment.bold) {\n <strong [textContent]=\"segment.text\"></strong>\n } @else {\n <span [textContent]=\"segment.text\"></span>\n }\n }\n `,\n styleUrl: './tooltip-panel.component.scss',\n host: {\n role: 'tooltip',\n '[attr.id]': 'panelId()',\n '[class.top]': \"placement() === 'top'\",\n '[class.bottom]': \"placement() === 'bottom'\",\n '[class.left]': \"placement() === 'left'\",\n '[class.right]': \"placement() === 'right'\",\n '[class.no-arrow]': '!arrow()',\n },\n encapsulation: ViewEncapsulation.Emulated,\n})\nexport class TooltipPanelComponent {\n /** Tooltip text, where `**bold**` runs render bold; or a template, rendered as given. */\n readonly text = input.required<string | TemplateRef<unknown>>();\n protected readonly template = computed(() => {\n const text = this.text();\n\n return text instanceof TemplateRef ? text : null;\n });\n protected readonly segments = computed(() => {\n const text = this.text();\n\n return typeof text === 'string' ? parseTooltipMarkup(text) : [];\n });\n /** Side of the trigger the panel is positioned on; also drives the arrow class. */\n readonly placement = input.required<TooltipPlacement>();\n /** Whether the arrow pointing at the trigger is drawn. */\n readonly arrow = input(true);\n /** Element `id`, referenced by the trigger's `aria-describedby`. */\n readonly panelId = input<string>('');\n\n constructor() {\n retainStyles(TooltipPanelComponent);\n }\n}\n","const NATIVELY_FOCUSABLE = 'a[href], button, input, select, textarea, summary';\nexport const FOCUSABLE = `${NATIVELY_FOCUSABLE}, [tabindex]`;\nconst KEYBOARD_FOCUSABLE = `${NATIVELY_FOCUSABLE}, [tabindex]:not([tabindex^=\"-\"])`;\nconst WIDGET_ROLES = [\n 'button',\n 'link',\n 'tab',\n 'option',\n 'menuitem',\n 'menuitemcheckbox',\n 'menuitemradio',\n 'row',\n 'gridcell',\n 'combobox',\n 'checkbox',\n 'radio',\n 'switch',\n 'treeitem',\n]\n .map((role) => `[role=\"${role}\"]`)\n .join(', ');\n// Any other tab stop (a scroll region, a panel) opens nothing unless it opts in with dsTooltipAncestor.\nconst INTERACTIVE = `${NATIVELY_FOCUSABLE}, tr:not([role]), ${WIDGET_ROLES}, [dsTooltipAncestor]`;\n// A widget role owns its focus (a listbox moves it by `aria-activedescendant`), and a hidden subtree must hold no tab stop.\nconst REACHED_OR_HIDDEN = `${NATIVELY_FOCUSABLE}, tr[tabindex]:not([role]), ${WIDGET_ROLES}, [aria-hidden=\"true\"], [inert]`;\n\nexport interface AncestorFocusTrigger {\n readonly host: HTMLElement;\n isClipped(): boolean;\n openFor(ancestor: HTMLElement): void;\n close(): void;\n}\n\nconst clippedHostsByAncestor = new WeakMap<\n HTMLElement,\n Set<AncestorFocusTrigger>\n>();\n\nfunction firstClippedHost(\n triggers: Set<AncestorFocusTrigger>,\n): AncestorFocusTrigger | undefined {\n return [...triggers]\n .sort((a, b) =>\n a.host.compareDocumentPosition(b.host) & Node.DOCUMENT_POSITION_FOLLOWING\n ? -1\n : 1,\n )\n .find((trigger) => trigger.isClipped());\n}\n\n/**\n * A clipped host that is not focusable itself opens its tip when its focusable ancestor takes\n * keyboard focus. `:focus-visible` keeps a click from opening it. Only the first clipped host of\n * one ancestor opens. Returns the teardown, or null when the host needs no listening.\n */\nexport function watchFocusableAncestor(\n trigger: AncestorFocusTrigger,\n): (() => void) | null {\n const host = trigger.host;\n if (host.matches(FOCUSABLE)) {\n return null;\n }\n const ancestor = host.parentElement?.closest<HTMLElement>(FOCUSABLE);\n if (!ancestor?.matches(INTERACTIVE)) {\n return null;\n }\n let triggers = clippedHostsByAncestor.get(ancestor);\n if (!triggers) {\n triggers = new Set();\n clippedHostsByAncestor.set(ancestor, triggers);\n }\n triggers.add(trigger);\n const open = (event: FocusEvent) => {\n if (\n event.target !== ancestor ||\n // Tested here, not at registration: a disabled trigger carries tabindex=\"-1\" until enabled.\n !ancestor.matches(KEYBOARD_FOCUSABLE) ||\n !ancestor.matches(':focus-visible') ||\n firstClippedHost(triggers) !== trigger\n ) {\n return;\n }\n trigger.openFor(ancestor);\n };\n const close = () => trigger.close();\n ancestor.addEventListener('focusin', open);\n ancestor.addEventListener('focusout', close);\n ancestor.addEventListener('click', close);\n ancestor.addEventListener('keydown', close);\n\n return () => {\n triggers.delete(trigger);\n ancestor.removeEventListener('focusin', open);\n ancestor.removeEventListener('focusout', close);\n ancestor.removeEventListener('click', close);\n ancestor.removeEventListener('keydown', close);\n };\n}\n\ninterface TabStopSync {\n isNeeded(): boolean;\n apply(needed: boolean): void;\n}\n\nconst tabStopSyncs = new Map<Node, TabStopSync>();\nlet resizes: ResizeObserver | null = null;\nlet mutations: MutationObserver | null = null;\nlet resizedNextFrame: Set<Node> | null = null;\n\nfunction syncOf(node: Node | null): TabStopSync | undefined {\n for (let current = node; current; current = current.parentElement) {\n const sync = tabStopSyncs.get(current);\n if (sync) {\n return sync;\n }\n }\n\n return undefined;\n}\n\n// Every isClipped() read forces layout once a tabindex write has dirtied it, so all reads go first.\nfunction syncAll(targets: Node[]): void {\n const syncs = [...new Set(targets.map(syncOf))].filter(\n (sync): sync is TabStopSync => sync !== undefined,\n );\n const decided = syncs.map((sync) => [sync, sync.isNeeded()] as const);\n decided.forEach(([sync, needed]) => sync.apply(needed));\n}\n\n// A tabindex written inside the ResizeObserver callback makes Firefox report \"ResizeObserver loop\n// completed with undelivered notifications\" for hosts under `content-visibility: auto`.\nfunction syncResizedNextFrame(targets: Node[]): void {\n if (!resizedNextFrame) {\n resizedNextFrame = new Set();\n requestAnimationFrame(() => {\n const resized = [...(resizedNextFrame ?? [])];\n resizedNextFrame = null;\n syncAll(resized);\n });\n }\n targets.forEach((target) => resizedNextFrame?.add(target));\n}\n\n/**\n * A clipped host that no keyboard path reaches - not focusable, inside no control or widget role,\n * holding no focusable descendant - takes `tabindex=\"0\"` while it is clipped, and loses it once its\n * text fits and it does not hold focus. A tabindex it did not write is never touched. One observer\n * pair serves every host. Returns the teardown, or null when the host is reached another way.\n */\nexport function tabStopWhileClipped(\n trigger: AncestorFocusTrigger,\n): (() => void) | null {\n const host = trigger.host;\n if (host.matches(FOCUSABLE) || host.closest(REACHED_OR_HIDDEN)) {\n return null;\n }\n let written = false;\n const isNeeded = () =>\n trigger.isClipped() && !host.querySelector(KEYBOARD_FOCUSABLE);\n const apply = (needed: boolean) => {\n if (needed && !host.hasAttribute('tabindex')) {\n host.setAttribute('tabindex', '0');\n written = true;\n } else if (\n !needed &&\n written &&\n host.ownerDocument.activeElement !== host\n ) {\n written = false;\n if (host.getAttribute('tabindex') === '0') {\n host.removeAttribute('tabindex');\n }\n }\n };\n const sync = () => apply(isNeeded());\n resizes ??= new ResizeObserver((entries) =>\n syncResizedNextFrame(entries.map((entry) => entry.target)),\n );\n mutations ??= new MutationObserver((records) =>\n syncAll(records.map((record) => record.target)),\n );\n tabStopSyncs.set(host, { isNeeded, apply });\n resizes.observe(host);\n mutations.observe(host, {\n characterData: true,\n childList: true,\n subtree: true,\n });\n host.addEventListener('focusout', sync);\n\n return () => {\n tabStopSyncs.delete(host);\n resizes?.unobserve(host);\n host.removeEventListener('focusout', sync);\n };\n}\n","import { isTextClipped } from '@ids-group-ltd/ids-design-system/core';\n\nexport interface TooltipClipTarget {\n readonly selector: string | null;\n}\n\n/**\n * `''`, `true` and `'true'` test the host itself; any other string is a selector for the element\n * inside the host to test; `false`, `'false'`, `null` and `undefined` turn the test off.\n */\nexport function toClipTarget(\n value: boolean | string | null | undefined,\n): TooltipClipTarget | null {\n if (value === true || value === '' || value === 'true') {\n return { selector: null };\n }\n\n return !value || value === 'false' ? null : { selector: value };\n}\n\nexport function clipElement(\n host: HTMLElement,\n target: TooltipClipTarget | null,\n): HTMLElement | null {\n return target?.selector\n ? host.querySelector<HTMLElement>(target.selector)\n : host;\n}\n\nexport function isHostClipped(\n host: HTMLElement,\n target: TooltipClipTarget | null,\n): boolean {\n const element = clipElement(host, target);\n if (element === null) {\n return false;\n }\n\n return isTextClipped(element) || isClippedByLines(element);\n}\n\n// A line clamp hides whole lines, so the block never overflows its width. Only hidden overflow\n// counts: text in a scroll box can still be reached. The pixel absorbs sub-pixel line heights.\nfunction isClippedByLines(element: HTMLElement): boolean {\n if (element.scrollHeight <= element.clientHeight + 1) {\n return false;\n }\n const overflow = getComputedStyle(element).overflowY;\n\n return overflow === 'hidden' || overflow === 'clip';\n}\n\nexport function ownTextOf(element: HTMLElement | null): string {\n return (element?.textContent ?? '').trim();\n}\n\nexport function textContains(haystack: string, needle: string): boolean {\n const collapse = (value: string) => value.replace(/\\s+/g, ' ').trim();\n\n return collapse(haystack).includes(collapse(needle));\n}\n","import type { OverlayRef } from '@angular/cdk/overlay';\nimport type { TooltipPlacement } from '@ids-group-ltd/ids-design-system/core';\n\nconst TRIGGER_GAP_PX = 8;\nexport const VIEWPORT_MARGIN_PX = 8;\nconst OPPOSITE_PLACEMENT: Record<TooltipPlacement, TooltipPlacement> = {\n top: 'bottom',\n bottom: 'top',\n left: 'right',\n right: 'left',\n};\n\nfunction positionFor(placement: TooltipPlacement) {\n switch (placement) {\n case 'top':\n return {\n originX: 'center' as const,\n originY: 'top' as const,\n overlayX: 'center' as const,\n overlayY: 'bottom' as const,\n offsetY: -TRIGGER_GAP_PX,\n };\n case 'bottom':\n return {\n originX: 'center' as const,\n originY: 'bottom' as const,\n overlayX: 'center' as const,\n overlayY: 'top' as const,\n offsetY: TRIGGER_GAP_PX,\n };\n case 'left':\n return {\n originX: 'start' as const,\n originY: 'center' as const,\n overlayX: 'end' as const,\n overlayY: 'center' as const,\n offsetX: -TRIGGER_GAP_PX,\n };\n case 'right':\n return {\n originX: 'end' as const,\n originY: 'center' as const,\n overlayX: 'start' as const,\n overlayY: 'center' as const,\n offsetX: TRIGGER_GAP_PX,\n };\n }\n}\n\nexport function positionsFor(placement: TooltipPlacement) {\n return [positionFor(placement), positionFor(OPPOSITE_PLACEMENT[placement])];\n}\n\n// positionChanges skips a re-apply that only pushes the pane; the styles CDK writes do not.\n// The pane is measured, not the panel: the panel's enter animation scales it.\nexport function pointArrowAtHost(\n ref: OverlayRef,\n panel: HTMLElement,\n host: HTMLElement,\n): void {\n const pane = ref.overlayElement;\n const point = () => {\n const trigger = host.getBoundingClientRect();\n const box = pane.getBoundingClientRect();\n panel.style.setProperty(\n '--_tooltip-arrow-x',\n `${trigger.left + trigger.width / 2 - box.left - panel.clientLeft}px`,\n );\n panel.style.setProperty(\n '--_tooltip-arrow-y',\n `${trigger.top + trigger.height / 2 - box.top - panel.clientTop}px`,\n );\n };\n const observer = new MutationObserver(point);\n observer.observe(ref.hostElement, { attributeFilter: ['style'] });\n observer.observe(pane, { attributeFilter: ['style'] });\n ref.detachments().subscribe({ complete: () => observer.disconnect() });\n}\n","import {\n DOCUMENT,\n Directive,\n ElementRef,\n HostListener,\n InjectionToken,\n OnDestroy,\n Signal,\n TemplateRef,\n afterNextRender,\n booleanAttribute,\n computed,\n inject,\n input,\n} from '@angular/core';\nimport { Overlay, OverlayRef } from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport { TooltipPanelComponent } from './tooltip-panel.component';\nimport { escapeTooltipMarkup, plainTooltipText } from './tooltip-markup';\nimport {\n FOCUSABLE,\n tabStopWhileClipped,\n watchFocusableAncestor,\n type AncestorFocusTrigger,\n} from './tooltip-ancestor-focus';\nimport {\n clipElement,\n isHostClipped,\n ownTextOf,\n textContains,\n toClipTarget,\n type TooltipClipTarget,\n} from './tooltip-clip';\nimport {\n closeOnScroll,\n listenForEscape,\n overlayPlacementOf,\n prepareOverlayEnter,\n} from '@ids-group-ltd/ids-design-system/components';\nimport {\n VIEWPORT_MARGIN_PX,\n pointArrowAtHost,\n positionsFor,\n} from './tooltip-position';\nimport {\n DS_CONFIG,\n type DsConfig,\n type TooltipPlacement,\n} from '@ids-group-ltd/ids-design-system/core';\nimport type { DsTooltipConfig } from './tooltip.types';\n\ntype TooltipOptions = NonNullable<DsConfig['tooltip']>;\n\nconst toOptionalBoolean = (value: unknown): boolean | null =>\n value == null ? null : booleanAttribute(value);\n\nconst PINNED_ATTRIBUTE = 'data-ds-tooltip-pinned';\n\nlet nextId = 0;\n\n/** @internal Lets a component that hosts the tooltip make a clipped host lead the tip with its own text. */\nexport const TOOLTIP_LEADS_WITH_OWN_TEXT = new InjectionToken<boolean>(\n 'TOOLTIP_LEADS_WITH_OWN_TEXT',\n);\n\n/** @internal Lets a component that hosts the tooltip decide `dsTooltipPinOnClick` for it. */\nexport const TOOLTIP_PIN_ON_CLICK = new InjectionToken<Signal<boolean>>(\n 'TOOLTIP_PIN_ON_CLICK',\n);\n\n@Directive({\n selector: '[dsTooltip], [dsTooltipWhenClipped]',\n standalone: true,\n})\nexport class TooltipDirective implements OnDestroy {\n private readonly overlay = inject(Overlay);\n private readonly host = inject(ElementRef<HTMLElement>);\n private readonly document = inject(DOCUMENT);\n private readonly config = inject(DS_CONFIG);\n private readonly hostPinOnClick = inject(TOOLTIP_PIN_ON_CLICK, {\n self: true,\n optional: true,\n });\n private readonly leadsWithOwnText =\n inject(TOOLTIP_LEADS_WITH_OWN_TEXT, { self: true, optional: true }) ??\n false;\n\n /** Tip text, or a template the panel renders as given. An empty string turns the tooltip off.\n * Keep a template's content non-interactive: the panel is `role=\"tooltip\"` and never takes focus. */\n readonly dsTooltip = input<string | TemplateRef<unknown>>('');\n /** Placement, delay, arrow, pin-on-click and the clipped test for this tip. An unset field falls\n * back to `DsConfig.tooltip`, then the built-in default. */\n readonly dsTooltipConfig = input<DsTooltipConfig | null>(null);\n /** Which side the tip opens on. Wins over `dsTooltipConfig.placement`.\n * @deprecated Use `[dsTooltipConfig]=\"{ placement }\"`, or `provideDsConfig({ tooltip: { placement } })` app-wide. */\n readonly dsTooltipPlacement = input<TooltipPlacement | null>(null);\n /** Milliseconds before the tip appears. Wins over `dsTooltipConfig.delay`.\n * @deprecated Use `[dsTooltipConfig]=\"{ delay }\"`, or `provideDsConfig({ tooltip: { delay } })` app-wide. */\n readonly dsTooltipDelay = input<number | null>(null);\n /** Draws the arrow that points at the host. Wins over `dsTooltipConfig.arrow`.\n * @deprecated Use `[dsTooltipConfig]=\"{ arrow }\"`, or `provideDsConfig({ tooltip: { arrow } })` app-wide. */\n readonly dsTooltipArrow = input<boolean | null, unknown>(null, {\n transform: toOptionalBoolean,\n });\n /** Show the tip only while the host shows less text than it holds: cut by width, or by lines\n * under `overflow: hidden` or `clip`, as with `line-clamp`. Re-tested on every open.\n * A boolean or the bare attribute tests the host. A selector tests the element it matches inside\n * the host and discloses that element's text; while nothing matches, no clipped tip opens.\n *\n * Applies the tooltip on its own: without a `dsTooltip` the tested text is disclosed. A tip\n * whose text the host already contains sets no `aria-describedby`; one given a `dsTooltip`\n * that says more than the host does describes it as usual.\n *\n * Keyboard focus opens it too: on the host, on a control or widget around it, or on a control\n * inside it. A clipped host that none of these reaches takes `tabindex=\"0\"` while it is clipped. */\n readonly dsTooltipWhenClipped = input<\n TooltipClipTarget | null,\n boolean | string | null | undefined\n >(null, { transform: toClipTarget });\n\n /** Opens the tip with no delay, and a click on the host keeps it open after the pointer leaves\n * until a click outside, `Escape` or blur; a second click closes it. Without it a click closes the tip.\n * While pinned the host carries `data-ds-tooltip-pinned`, a hook for styling the pinned trigger.\n * Wins over `dsTooltipConfig.pinOnClick`.\n * @deprecated Use `[dsTooltipConfig]=\"{ pinOnClick: true }\"`, or `provideDsConfig({ tooltip: { pinOnClick } })` app-wide. */\n readonly dsTooltipPinOnClick = input<boolean | null, unknown>(null, {\n transform: toOptionalBoolean,\n });\n\n private readonly placement = this.resolve(\n this.dsTooltipPlacement,\n 'placement',\n 'top',\n );\n private readonly delay = this.resolve(this.dsTooltipDelay, 'delay', 120);\n private readonly arrow = this.resolve(this.dsTooltipArrow, 'arrow', true);\n private readonly pinOnClick = this.resolve(\n this.dsTooltipPinOnClick,\n 'pinOnClick',\n false,\n );\n private readonly whenClipped = computed(\n () =>\n this.dsTooltipWhenClipped() ??\n toClipTarget(this.dsTooltipConfig()?.whenClipped),\n );\n\n private resolve<K extends keyof TooltipOptions>(\n deprecatedInput: Signal<TooltipOptions[K] | null>,\n key: K,\n fallback: NonNullable<TooltipOptions[K]>,\n ): Signal<NonNullable<TooltipOptions[K]>> {\n return computed(\n () =>\n deprecatedInput() ??\n this.dsTooltipConfig()?.[key] ??\n this.config.tooltip?.[key] ??\n fallback,\n );\n }\n\n private isClipped(): boolean {\n return isHostClipped(this.hostElement, this.whenClipped());\n }\n\n private get hostElement(): HTMLElement {\n return this.host.nativeElement;\n }\n\n private pinsOnClick(): boolean {\n return this.hostPinOnClick?.() ?? this.pinOnClick();\n }\n\n private ownText(): string {\n return ownTextOf(clipElement(this.hostElement, this.whenClipped()));\n }\n\n /** A host that leads with its own text puts it, in bold, above the tip while it is clipped, unless the tip already says it. */\n private tipContent(): string | TemplateRef<unknown> {\n const given = this.dsTooltip();\n if (given instanceof TemplateRef) {\n return given;\n }\n const own = this.ownText();\n if (!given) {\n return this.whenClipped() ? escapeTooltipMarkup(own) : '';\n }\n if (\n this.leadsWithOwnText &&\n own &&\n this.isClipped() &&\n !textContains(plainTooltipText(given), own)\n ) {\n return `**${escapeTooltipMarkup(own)}**\n${given}`;\n }\n\n return given;\n }\n\n /** A clipped host's full text is already in the DOM; describing it again would announce it twice. */\n private disclosesOwnText(text: string): boolean {\n if (!this.whenClipped()) {\n return false;\n }\n\n return textContains(this.ownText(), plainTooltipText(text));\n }\n\n private ref: OverlayRef | null = null;\n private timer: number | null = null;\n private unpin: (() => void) | null = null;\n private readonly tipId = `ds-tooltip-${++nextId}`;\n\n /**\n * Where `aria-describedby` belongs when focus is involved: a non-focusable host\n * (`ds-menu-item` is `role=\"none\"` around a real `<button>`) never reaches a screen\n * reader, so `focusin`'s target is recorded. A pointer-only open leaves it null.\n */\n private focusedTarget: HTMLElement | null = null;\n\n /**\n * Where `aria-describedby` was written, so teardown strips it from the same element\n * even if focus moved `focusedTarget` after the panel opened.\n */\n private describedElement: HTMLElement | null = null;\n\n private detachAncestor: (() => void) | null = null;\n\n private readonly ancestorFocusTrigger: AncestorFocusTrigger = {\n host: this.hostElement,\n isClipped: () => this.isClipped(),\n openFor: (ancestor) => {\n this.focusedTarget = ancestor;\n this.scheduleShow();\n },\n close: () => {\n this.focusedTarget = null;\n this.onClose();\n },\n };\n\n constructor() {\n afterNextRender(() => {\n if (this.whenClipped()) {\n this.detachAncestor =\n watchFocusableAncestor(this.ancestorFocusTrigger) ??\n tabStopWhileClipped(this.ancestorFocusTrigger);\n }\n });\n }\n\n @HostListener('mouseenter')\n protected onPointerEnter(): void {\n this.scheduleShow();\n }\n\n // Same rule as via a focusable ancestor: keyboard focus opens, a click's focus does not.\n @HostListener('focusin', ['$event'])\n protected onFocusIn(event: FocusEvent): void {\n const host = this.hostElement;\n if (\n this.whenClipped() &&\n host.matches(FOCUSABLE) &&\n (event.target !== host || !host.matches(':focus-visible'))\n ) {\n return;\n }\n if (event.target instanceof HTMLElement) {\n this.focusedTarget = event.target;\n }\n this.scheduleShow();\n }\n\n @HostListener('focusout')\n protected onFocusOut(): void {\n this.focusedTarget = null;\n this.onClose();\n }\n\n private scheduleShow(): void {\n if (this.unpin || !this.tipContent()) {\n return;\n }\n if (this.pinsOnClick() && this.ref?.hasAttached()) {\n return;\n }\n if (this.whenClipped() && !this.isClipped()) {\n return;\n }\n if (this.timer !== null) {\n clearTimeout(this.timer);\n }\n this.timer = window.setTimeout(\n () => this.show(),\n this.pinsOnClick() ? 0 : this.delay(),\n );\n }\n\n @HostListener('mouseleave')\n protected onPointerLeave(): void {\n if (!this.unpin) {\n this.onClose();\n }\n }\n\n // Close on click too: a re-rendered anchor under a stationary cursor fires no mouseleave.\n @HostListener('click')\n protected onClick(): void {\n if (this.pinsOnClick() && !this.unpin) {\n this.pin();\n } else {\n this.onClose();\n }\n }\n\n protected onClose(): void {\n if (this.timer !== null) {\n clearTimeout(this.timer);\n this.timer = null;\n }\n this.unpin?.();\n this.disposeRef();\n }\n\n private pin(): void {\n if (this.timer !== null) {\n clearTimeout(this.timer);\n this.timer = null;\n }\n if (!this.ref?.hasAttached()) {\n if (!this.tipContent()) {\n return;\n }\n this.show();\n }\n const closeOutside = (event: Event) => {\n const target = event.target as Node;\n if (\n !this.hostElement.contains(target) &&\n !this.ref?.overlayElement.contains(target)\n ) {\n this.onClose();\n }\n };\n this.document.addEventListener('pointerdown', closeOutside, true);\n const stopEscape = listenForEscape(this.document, () => this.onClose());\n this.hostElement.setAttribute(PINNED_ATTRIBUTE, '');\n this.unpin = () => {\n this.unpin = null;\n this.hostElement.removeAttribute(PINNED_ATTRIBUTE);\n this.document.removeEventListener('pointerdown', closeOutside, true);\n stopEscape();\n };\n }\n\n private disposeRef(): void {\n this.ref?.dispose();\n this.ref = null;\n const described = this.describedElement;\n if (!described) {\n return;\n }\n this.describedElement = null;\n const remaining = (described.getAttribute('aria-describedby') ?? '')\n .split(' ')\n .filter((id: string) => id && id !== this.tipId)\n .join(' ');\n if (remaining) {\n described.setAttribute('aria-describedby', remaining);\n } else {\n described.removeAttribute('aria-describedby');\n }\n }\n\n @HostListener('keydown')\n protected onKeydown(): void {\n if (this.whenClipped()) {\n this.onClose();\n }\n }\n\n @HostListener('keydown.escape')\n protected onEscape(): void {\n if (this.ref) {\n this.onClose();\n }\n }\n\n private show(): void {\n // show() can be re-entered with a panel open: dispose it first to avoid a leaked OverlayRef and a duplicate id.\n this.disposeRef();\n const placement = this.placement();\n const positionStrategy = this.overlay\n .position()\n .flexibleConnectedTo(this.host)\n .withPositions(positionsFor(placement))\n .withViewportMargin(VIEWPORT_MARGIN_PX);\n\n this.ref = this.overlay.create({\n positionStrategy,\n panelClass: 'ds-overlay-pane',\n scrollStrategy: this.overlay.scrollStrategies.close(),\n });\n prepareOverlayEnter(this.ref, this.host.nativeElement, positionStrategy);\n // The CDK strategy sees only the window and cdkScrollable ancestors, not a plain overflow container.\n const stopScrollClose = closeOnScroll(this.ref, () => this.onClose());\n this.ref.detachments().subscribe(stopScrollClose);\n\n const cmpRef = this.ref.attach(new ComponentPortal(TooltipPanelComponent));\n const tip = this.tipContent();\n cmpRef.setInput('text', tip);\n cmpRef.setInput('placement', placement);\n cmpRef.setInput('arrow', this.arrow());\n positionStrategy.positionChanges.subscribe(({ connectionPair }) =>\n cmpRef.setInput(\n 'placement',\n overlayPlacementOf(connectionPair.overlayY, connectionPair.overlayX),\n ),\n );\n cmpRef.setInput('panelId', this.tipId);\n pointArrowAtHost(this.ref, cmpRef.location.nativeElement, this.hostElement);\n this.ref.detachments().subscribe(() => this.unpin?.());\n if (typeof tip === 'string' && this.disclosesOwnText(tip)) {\n return;\n }\n const described = this.focusedTarget ?? this.host.nativeElement;\n this.describedElement = described;\n const existing = described.getAttribute('aria-describedby');\n described.setAttribute(\n 'aria-describedby',\n existing ? `${existing} ${this.tipId}` : this.tipId,\n );\n }\n\n ngOnDestroy(): void {\n this.detachAncestor?.();\n this.onClose();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAKA,MAAM,KAAK,GAAG,iBAAiB;AAC/B,MAAM,OAAO,GAAG,QAAQ;AACxB,MAAM,IAAI,GAAG,IAAI;AAEjB;AACM,SAAU,kBAAkB,CAAC,IAAY,EAAA;IAC7C,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;AAChC,IAAA,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,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AAA;;4FAAhB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAJ5B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,qCAAqC;AAC/C,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;sBAmLE,YAAY;uBAAC,YAAY;;sBAMzB,YAAY;uBAAC,SAAS,EAAE,CAAC,QAAQ,CAAC;;sBAgBlC,YAAY;uBAAC,UAAU;;sBAyBvB,YAAY;uBAAC,YAAY;;sBAQzB,YAAY;uBAAC,OAAO;;sBAoEpB,YAAY;uBAAC,SAAS;;sBAOtB,YAAY;uBAAC,gBAAgB;;;AC9XhC;;AAEG;;;;"}
1
+ {"version":3,"file":"ids-group-ltd-ids-design-system-components-tooltip.mjs","sources":["../../../src/lib/components/tooltip/tooltip-markup.ts","../../../src/lib/components/tooltip/tooltip-panel.component.ts","../../../src/lib/components/tooltip/tooltip-ancestor-focus.ts","../../../src/lib/components/tooltip/tooltip-clip.ts","../../../src/lib/components/tooltip/tooltip-position.ts","../../../src/lib/components/tooltip/tooltip.directive.ts","../../../src/lib/components/tooltip/ids-group-ltd-ids-design-system-components-tooltip.ts"],"sourcesContent":["export interface TooltipSegment {\n text: string;\n bold: boolean;\n}\n\nconst TOKEN = /(\\\\\\*\\\\\\*|\\*\\*)/;\nconst ESCAPED = '\\\\*\\\\*';\nconst BOLD = '**';\n\n/** Splits tip text on `**` into plain and bold runs. `\\*\\*` is a literal `**`; an unpaired `**` is literal too. */\nexport function parseTooltipMarkup(text: string): TooltipSegment[] {\n const tokens = text.split(TOKEN);\n const markerCount = tokens.filter((token) => token === BOLD).length;\n const pairedMarkers = markerCount - (markerCount % 2);\n const segments: TooltipSegment[] = [];\n let bold = false;\n let seen = 0;\n for (const token of tokens) {\n let piece = token;\n if (token === ESCAPED) {\n piece = BOLD;\n } else if (token === BOLD && seen++ < pairedMarkers) {\n bold = !bold;\n continue;\n }\n if (!piece) {\n continue;\n }\n const last = segments[segments.length - 1];\n if (last?.bold === bold) {\n last.text += piece;\n } else {\n segments.push({ text: piece, bold });\n }\n }\n\n return segments;\n}\n\nexport function escapeTooltipMarkup(text: string): string {\n return text.replaceAll(BOLD, ESCAPED);\n}\n\nexport function plainTooltipText(text: string): string {\n return parseTooltipMarkup(text)\n .map((segment) => segment.text)\n .join('');\n}\n","import {\n Component,\n TemplateRef,\n ViewEncapsulation,\n computed,\n input,\n} from '@angular/core';\nimport {\n retainStyles,\n type TooltipPlacement,\n} from '@ids-group-ltd/ids-design-system/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { parseTooltipMarkup } from './tooltip-markup';\n\n@Component({\n selector: 'ds-tooltip-panel',\n standalone: true,\n imports: [NgTemplateOutlet],\n template: `\n @if (template(); as template) {\n <ng-container [ngTemplateOutlet]=\"template\" />\n }\n\n @for (segment of segments(); track $index) {\n @if (segment.bold) {\n <strong [textContent]=\"segment.text\"></strong>\n } @else {\n <span [textContent]=\"segment.text\"></span>\n }\n }\n `,\n styleUrl: './tooltip-panel.component.scss',\n host: {\n role: 'tooltip',\n '[attr.id]': 'panelId()',\n '[class.top]': \"placement() === 'top'\",\n '[class.bottom]': \"placement() === 'bottom'\",\n '[class.left]': \"placement() === 'left'\",\n '[class.right]': \"placement() === 'right'\",\n '[class.no-arrow]': '!arrow()',\n },\n encapsulation: ViewEncapsulation.Emulated,\n})\nexport class TooltipPanelComponent {\n /** Tooltip text, where `**bold**` runs render bold; or a template, rendered as given. */\n readonly text = input.required<string | TemplateRef<unknown>>();\n protected readonly template = computed(() => {\n const text = this.text();\n\n return text instanceof TemplateRef ? text : null;\n });\n protected readonly segments = computed(() => {\n const text = this.text();\n\n return typeof text === 'string' ? parseTooltipMarkup(text) : [];\n });\n /** Side of the trigger the panel is positioned on; also drives the arrow class. */\n readonly placement = input.required<TooltipPlacement>();\n /** Whether the arrow pointing at the trigger is drawn. */\n readonly arrow = input(true);\n /** Element `id`, referenced by the trigger's `aria-describedby`. */\n readonly panelId = input<string>('');\n\n constructor() {\n retainStyles(TooltipPanelComponent);\n }\n}\n","const NATIVELY_FOCUSABLE = 'a[href], button, input, select, textarea, summary';\nexport const FOCUSABLE = `${NATIVELY_FOCUSABLE}, [tabindex]`;\nconst KEYBOARD_FOCUSABLE = `${NATIVELY_FOCUSABLE}, [tabindex]:not([tabindex^=\"-\"])`;\nconst WIDGET_ROLES = [\n 'button',\n 'link',\n 'tab',\n 'option',\n 'menuitem',\n 'menuitemcheckbox',\n 'menuitemradio',\n 'row',\n 'gridcell',\n 'combobox',\n 'checkbox',\n 'radio',\n 'switch',\n 'treeitem',\n]\n .map((role) => `[role=\"${role}\"]`)\n .join(', ');\n// Any other tab stop (a scroll region, a panel) opens nothing unless it opts in with dsTooltipAncestor.\nconst INTERACTIVE = `${NATIVELY_FOCUSABLE}, tr:not([role]), ${WIDGET_ROLES}, [dsTooltipAncestor]`;\n// A widget role owns its focus (a listbox moves it by `aria-activedescendant`), and a hidden subtree must hold no tab stop.\nconst REACHED_OR_HIDDEN = `${NATIVELY_FOCUSABLE}, tr[tabindex]:not([role]), ${WIDGET_ROLES}, [aria-hidden=\"true\"], [inert]`;\n\nexport interface AncestorFocusTrigger {\n readonly host: HTMLElement;\n isClipped(): boolean;\n openFor(ancestor: HTMLElement): void;\n close(): void;\n}\n\nconst clippedHostsByAncestor = new WeakMap<\n HTMLElement,\n Set<AncestorFocusTrigger>\n>();\n\nfunction firstClippedHost(\n triggers: Set<AncestorFocusTrigger>,\n): AncestorFocusTrigger | undefined {\n return [...triggers]\n .sort((a, b) =>\n a.host.compareDocumentPosition(b.host) & Node.DOCUMENT_POSITION_FOLLOWING\n ? -1\n : 1,\n )\n .find((trigger) => trigger.isClipped());\n}\n\n/**\n * A clipped host that is not focusable itself opens its tip when its focusable ancestor takes\n * keyboard focus. `:focus-visible` keeps a click from opening it. Only the first clipped host of\n * one ancestor opens. Returns the teardown, or null when the host needs no listening.\n */\nexport function watchFocusableAncestor(\n trigger: AncestorFocusTrigger,\n): (() => void) | null {\n const host = trigger.host;\n if (host.matches(FOCUSABLE)) {\n return null;\n }\n const ancestor = host.parentElement?.closest<HTMLElement>(FOCUSABLE);\n if (!ancestor?.matches(INTERACTIVE)) {\n return null;\n }\n let triggers = clippedHostsByAncestor.get(ancestor);\n if (!triggers) {\n triggers = new Set();\n clippedHostsByAncestor.set(ancestor, triggers);\n }\n triggers.add(trigger);\n const open = (event: FocusEvent) => {\n if (\n event.target !== ancestor ||\n // Tested here, not at registration: a disabled trigger carries tabindex=\"-1\" until enabled.\n !ancestor.matches(KEYBOARD_FOCUSABLE) ||\n !ancestor.matches(':focus-visible') ||\n firstClippedHost(triggers) !== trigger\n ) {\n return;\n }\n trigger.openFor(ancestor);\n };\n const close = () => trigger.close();\n ancestor.addEventListener('focusin', open);\n ancestor.addEventListener('focusout', close);\n ancestor.addEventListener('click', close);\n ancestor.addEventListener('keydown', close);\n\n return () => {\n triggers.delete(trigger);\n ancestor.removeEventListener('focusin', open);\n ancestor.removeEventListener('focusout', close);\n ancestor.removeEventListener('click', close);\n ancestor.removeEventListener('keydown', close);\n };\n}\n\ninterface TabStopSync {\n isNeeded(): boolean;\n apply(needed: boolean): void;\n}\n\nconst tabStopSyncs = new Map<Node, TabStopSync>();\nlet resizes: ResizeObserver | null = null;\nlet mutations: MutationObserver | null = null;\nlet resizedNextFrame: Set<Node> | null = null;\n\nfunction syncOf(node: Node | null): TabStopSync | undefined {\n for (let current = node; current; current = current.parentElement) {\n const sync = tabStopSyncs.get(current);\n if (sync) {\n return sync;\n }\n }\n\n return undefined;\n}\n\n// Every isClipped() read forces layout once a tabindex write has dirtied it, so all reads go first.\nfunction syncAll(targets: Node[]): void {\n const syncs = [...new Set(targets.map(syncOf))].filter(\n (sync): sync is TabStopSync => sync !== undefined,\n );\n const decided = syncs.map((sync) => [sync, sync.isNeeded()] as const);\n decided.forEach(([sync, needed]) => sync.apply(needed));\n}\n\n// A tabindex written inside the ResizeObserver callback makes Firefox report \"ResizeObserver loop\n// completed with undelivered notifications\" for hosts under `content-visibility: auto`.\nfunction syncResizedNextFrame(targets: Node[]): void {\n if (!resizedNextFrame) {\n resizedNextFrame = new Set();\n requestAnimationFrame(() => {\n const resized = [...(resizedNextFrame ?? [])];\n resizedNextFrame = null;\n syncAll(resized);\n });\n }\n targets.forEach((target) => resizedNextFrame?.add(target));\n}\n\n/**\n * A clipped host that no keyboard path reaches - not focusable, inside no control or widget role,\n * holding no focusable descendant - takes `tabindex=\"0\"` while it is clipped, and loses it once its\n * text fits and it does not hold focus. A tabindex it did not write is never touched. One observer\n * pair serves every host. Returns the teardown, or null when the host is reached another way.\n */\nexport function tabStopWhileClipped(\n trigger: AncestorFocusTrigger,\n): (() => void) | null {\n const host = trigger.host;\n if (host.matches(FOCUSABLE) || host.closest(REACHED_OR_HIDDEN)) {\n return null;\n }\n let written = false;\n const isNeeded = () =>\n trigger.isClipped() && !host.querySelector(KEYBOARD_FOCUSABLE);\n const apply = (needed: boolean) => {\n if (needed && !host.hasAttribute('tabindex')) {\n host.setAttribute('tabindex', '0');\n written = true;\n } else if (\n !needed &&\n written &&\n host.ownerDocument.activeElement !== host\n ) {\n written = false;\n if (host.getAttribute('tabindex') === '0') {\n host.removeAttribute('tabindex');\n }\n }\n };\n const sync = () => apply(isNeeded());\n resizes ??= new ResizeObserver((entries) =>\n syncResizedNextFrame(entries.map((entry) => entry.target)),\n );\n mutations ??= new MutationObserver((records) =>\n syncAll(records.map((record) => record.target)),\n );\n tabStopSyncs.set(host, { isNeeded, apply });\n resizes.observe(host);\n mutations.observe(host, {\n characterData: true,\n childList: true,\n subtree: true,\n });\n host.addEventListener('focusout', sync);\n\n return () => {\n tabStopSyncs.delete(host);\n resizes?.unobserve(host);\n host.removeEventListener('focusout', sync);\n };\n}\n","import { isTextClipped } from '@ids-group-ltd/ids-design-system/core';\n\nexport interface TooltipClipTarget {\n readonly selector: string | null;\n}\n\n/**\n * `''`, `true` and `'true'` test the host itself; any other string is a selector for the element\n * inside the host to test; `false`, `'false'`, `null` and `undefined` turn the test off.\n */\nexport function toClipTarget(\n value: boolean | string | null | undefined,\n): TooltipClipTarget | null {\n if (value === true || value === '' || value === 'true') {\n return { selector: null };\n }\n\n return !value || value === 'false' ? null : { selector: value };\n}\n\nexport function clipElement(\n host: HTMLElement,\n target: TooltipClipTarget | null,\n): HTMLElement | null {\n return target?.selector\n ? host.querySelector<HTMLElement>(target.selector)\n : host;\n}\n\nexport function isHostClipped(\n host: HTMLElement,\n target: TooltipClipTarget | null,\n): boolean {\n const element = clipElement(host, target);\n if (element === null) {\n return false;\n }\n\n return isTextClipped(element) || isClippedByLines(element);\n}\n\n// A line clamp hides whole lines, so the block never overflows its width. Only hidden overflow\n// counts: text in a scroll box can still be reached. The pixel absorbs sub-pixel line heights.\nfunction isClippedByLines(element: HTMLElement): boolean {\n if (element.scrollHeight <= element.clientHeight + 1) {\n return false;\n }\n const overflow = getComputedStyle(element).overflowY;\n\n return overflow === 'hidden' || overflow === 'clip';\n}\n\nexport function ownTextOf(element: HTMLElement | null): string {\n return (element?.textContent ?? '').trim();\n}\n\nexport function textContains(haystack: string, needle: string): boolean {\n const collapse = (value: string) => value.replace(/\\s+/g, ' ').trim();\n\n return collapse(haystack).includes(collapse(needle));\n}\n","import type { TooltipPlacement } from '@ids-group-ltd/ids-design-system/core';\n\nconst TRIGGER_GAP_PX = 8;\nexport const VIEWPORT_MARGIN_PX = 8;\nconst OPPOSITE_PLACEMENT: Record<TooltipPlacement, TooltipPlacement> = {\n top: 'bottom',\n bottom: 'top',\n left: 'right',\n right: 'left',\n};\n\nfunction positionFor(placement: TooltipPlacement) {\n switch (placement) {\n case 'top':\n return {\n originX: 'center' as const,\n originY: 'top' as const,\n overlayX: 'center' as const,\n overlayY: 'bottom' as const,\n offsetY: -TRIGGER_GAP_PX,\n };\n case 'bottom':\n return {\n originX: 'center' as const,\n originY: 'bottom' as const,\n overlayX: 'center' as const,\n overlayY: 'top' as const,\n offsetY: TRIGGER_GAP_PX,\n };\n case 'left':\n return {\n originX: 'start' as const,\n originY: 'center' as const,\n overlayX: 'end' as const,\n overlayY: 'center' as const,\n offsetX: -TRIGGER_GAP_PX,\n };\n case 'right':\n return {\n originX: 'end' as const,\n originY: 'center' as const,\n overlayX: 'start' as const,\n overlayY: 'center' as const,\n offsetX: TRIGGER_GAP_PX,\n };\n }\n}\n\nexport function positionsFor(placement: TooltipPlacement) {\n return [positionFor(placement), positionFor(OPPOSITE_PLACEMENT[placement])];\n}\n","import {\n DOCUMENT,\n Directive,\n ElementRef,\n HostListener,\n InjectionToken,\n OnDestroy,\n Signal,\n TemplateRef,\n afterNextRender,\n booleanAttribute,\n computed,\n inject,\n input,\n} from '@angular/core';\nimport { Overlay, OverlayRef } from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport { TooltipPanelComponent } from './tooltip-panel.component';\nimport { escapeTooltipMarkup, plainTooltipText } from './tooltip-markup';\nimport {\n FOCUSABLE,\n tabStopWhileClipped,\n watchFocusableAncestor,\n type AncestorFocusTrigger,\n} from './tooltip-ancestor-focus';\nimport {\n clipElement,\n isHostClipped,\n ownTextOf,\n textContains,\n toClipTarget,\n type TooltipClipTarget,\n} from './tooltip-clip';\nimport {\n closeOnScroll,\n listenForEscape,\n overlayPlacementOf,\n pointArrowAtHost,\n prepareOverlayEnter,\n} from '@ids-group-ltd/ids-design-system/components';\nimport { VIEWPORT_MARGIN_PX, positionsFor } from './tooltip-position';\nimport {\n DS_CONFIG,\n type DsConfig,\n type TooltipPlacement,\n} from '@ids-group-ltd/ids-design-system/core';\nimport type { DsTooltipConfig } from './tooltip.types';\n\ntype TooltipOptions = NonNullable<DsConfig['tooltip']>;\n\nconst toOptionalBoolean = (value: unknown): boolean | null =>\n value == null ? null : booleanAttribute(value);\n\nconst PINNED_ATTRIBUTE = 'data-ds-tooltip-pinned';\n\nlet nextId = 0;\n\n/** @internal Lets a component that hosts the tooltip make a clipped host lead the tip with its own text. */\nexport const TOOLTIP_LEADS_WITH_OWN_TEXT = new InjectionToken<boolean>(\n 'TOOLTIP_LEADS_WITH_OWN_TEXT',\n);\n\n/** @internal Lets a component that hosts the tooltip decide `dsTooltipPinOnClick` for it. */\nexport const TOOLTIP_PIN_ON_CLICK = new InjectionToken<Signal<boolean>>(\n 'TOOLTIP_PIN_ON_CLICK',\n);\n\n@Directive({\n selector: '[dsTooltip], [dsTooltipWhenClipped]',\n standalone: true,\n})\nexport class TooltipDirective implements OnDestroy {\n private readonly overlay = inject(Overlay);\n private readonly host = inject(ElementRef<HTMLElement>);\n private readonly document = inject(DOCUMENT);\n private readonly config = inject(DS_CONFIG);\n private readonly hostPinOnClick = inject(TOOLTIP_PIN_ON_CLICK, {\n self: true,\n optional: true,\n });\n private readonly leadsWithOwnText =\n inject(TOOLTIP_LEADS_WITH_OWN_TEXT, { self: true, optional: true }) ??\n false;\n\n /** Tip text, or a template the panel renders as given. An empty string turns the tooltip off.\n * Keep a template's content non-interactive: the panel is `role=\"tooltip\"` and never takes focus. */\n readonly dsTooltip = input<string | TemplateRef<unknown>>('');\n /** Placement, delay, arrow, pin-on-click and the clipped test for this tip. An unset field falls\n * back to `DsConfig.tooltip`, then the built-in default. */\n readonly dsTooltipConfig = input<DsTooltipConfig | null>(null);\n /** Which side the tip opens on. Wins over `dsTooltipConfig.placement`.\n * @deprecated Use `[dsTooltipConfig]=\"{ placement }\"`, or `provideDsConfig({ tooltip: { placement } })` app-wide. */\n readonly dsTooltipPlacement = input<TooltipPlacement | null>(null);\n /** Milliseconds before the tip appears. Wins over `dsTooltipConfig.delay`.\n * @deprecated Use `[dsTooltipConfig]=\"{ delay }\"`, or `provideDsConfig({ tooltip: { delay } })` app-wide. */\n readonly dsTooltipDelay = input<number | null>(null);\n /** Draws the arrow that points at the host. Wins over `dsTooltipConfig.arrow`.\n * @deprecated Use `[dsTooltipConfig]=\"{ arrow }\"`, or `provideDsConfig({ tooltip: { arrow } })` app-wide. */\n readonly dsTooltipArrow = input<boolean | null, unknown>(null, {\n transform: toOptionalBoolean,\n });\n /** Show the tip only while the host shows less text than it holds: cut by width, or by lines\n * under `overflow: hidden` or `clip`, as with `line-clamp`. Re-tested on every open.\n * A boolean or the bare attribute tests the host. A selector tests the element it matches inside\n * the host and discloses that element's text; while nothing matches, no clipped tip opens.\n *\n * Applies the tooltip on its own: without a `dsTooltip` the tested text is disclosed. A tip\n * whose text the host already contains sets no `aria-describedby`; one given a `dsTooltip`\n * that says more than the host does describes it as usual.\n *\n * Keyboard focus opens it too: on the host, on a control or widget around it, or on a control\n * inside it. A clipped host that none of these reaches takes `tabindex=\"0\"` while it is clipped. */\n readonly dsTooltipWhenClipped = input<\n TooltipClipTarget | null,\n boolean | string | null | undefined\n >(null, { transform: toClipTarget });\n\n /** Opens the tip with no delay, and a click on the host keeps it open after the pointer leaves\n * until a click outside, `Escape` or blur; a second click closes it. Without it a click closes the tip.\n * While pinned the host carries `data-ds-tooltip-pinned`, a hook for styling the pinned trigger.\n * Wins over `dsTooltipConfig.pinOnClick`.\n * @deprecated Use `[dsTooltipConfig]=\"{ pinOnClick: true }\"`, or `provideDsConfig({ tooltip: { pinOnClick } })` app-wide. */\n readonly dsTooltipPinOnClick = input<boolean | null, unknown>(null, {\n transform: toOptionalBoolean,\n });\n\n private readonly placement = this.resolve(\n this.dsTooltipPlacement,\n 'placement',\n 'top',\n );\n private readonly delay = this.resolve(this.dsTooltipDelay, 'delay', 120);\n private readonly arrow = this.resolve(this.dsTooltipArrow, 'arrow', true);\n private readonly pinOnClick = this.resolve(\n this.dsTooltipPinOnClick,\n 'pinOnClick',\n false,\n );\n private readonly whenClipped = computed(\n () =>\n this.dsTooltipWhenClipped() ??\n toClipTarget(this.dsTooltipConfig()?.whenClipped),\n );\n\n private resolve<K extends keyof TooltipOptions>(\n deprecatedInput: Signal<TooltipOptions[K] | null>,\n key: K,\n fallback: NonNullable<TooltipOptions[K]>,\n ): Signal<NonNullable<TooltipOptions[K]>> {\n return computed(\n () =>\n deprecatedInput() ??\n this.dsTooltipConfig()?.[key] ??\n this.config.tooltip?.[key] ??\n fallback,\n );\n }\n\n private isClipped(): boolean {\n return isHostClipped(this.hostElement, this.whenClipped());\n }\n\n private get hostElement(): HTMLElement {\n return this.host.nativeElement;\n }\n\n private pinsOnClick(): boolean {\n return this.hostPinOnClick?.() ?? this.pinOnClick();\n }\n\n private ownText(): string {\n return ownTextOf(clipElement(this.hostElement, this.whenClipped()));\n }\n\n /** A host that leads with its own text puts it, in bold, above the tip while it is clipped, unless the tip already says it. */\n private tipContent(): string | TemplateRef<unknown> {\n const given = this.dsTooltip();\n if (given instanceof TemplateRef) {\n return given;\n }\n const own = this.ownText();\n if (!given) {\n return this.whenClipped() ? escapeTooltipMarkup(own) : '';\n }\n if (\n this.leadsWithOwnText &&\n own &&\n this.isClipped() &&\n !textContains(plainTooltipText(given), own)\n ) {\n return `**${escapeTooltipMarkup(own)}**\n${given}`;\n }\n\n return given;\n }\n\n /** A clipped host's full text is already in the DOM; describing it again would announce it twice. */\n private disclosesOwnText(text: string): boolean {\n if (!this.whenClipped()) {\n return false;\n }\n\n return textContains(this.ownText(), plainTooltipText(text));\n }\n\n private ref: OverlayRef | null = null;\n private timer: number | null = null;\n private unpin: (() => void) | null = null;\n private readonly tipId = `ds-tooltip-${++nextId}`;\n\n /**\n * Where `aria-describedby` belongs when focus is involved: a non-focusable host\n * (`ds-menu-item` is `role=\"none\"` around a real `<button>`) never reaches a screen\n * reader, so `focusin`'s target is recorded. A pointer-only open leaves it null.\n */\n private focusedTarget: HTMLElement | null = null;\n\n /**\n * Where `aria-describedby` was written, so teardown strips it from the same element\n * even if focus moved `focusedTarget` after the panel opened.\n */\n private describedElement: HTMLElement | null = null;\n\n private detachAncestor: (() => void) | null = null;\n\n private readonly ancestorFocusTrigger: AncestorFocusTrigger = {\n host: this.hostElement,\n isClipped: () => this.isClipped(),\n openFor: (ancestor) => {\n this.focusedTarget = ancestor;\n this.scheduleShow();\n },\n close: () => {\n this.focusedTarget = null;\n this.onClose();\n },\n };\n\n constructor() {\n afterNextRender(() => {\n if (this.whenClipped()) {\n this.detachAncestor =\n watchFocusableAncestor(this.ancestorFocusTrigger) ??\n tabStopWhileClipped(this.ancestorFocusTrigger);\n }\n });\n }\n\n @HostListener('mouseenter')\n protected onPointerEnter(): void {\n this.scheduleShow();\n }\n\n // Same rule as via a focusable ancestor: keyboard focus opens, a click's focus does not.\n @HostListener('focusin', ['$event'])\n protected onFocusIn(event: FocusEvent): void {\n const host = this.hostElement;\n if (\n this.whenClipped() &&\n host.matches(FOCUSABLE) &&\n (event.target !== host || !host.matches(':focus-visible'))\n ) {\n return;\n }\n if (event.target instanceof HTMLElement) {\n this.focusedTarget = event.target;\n }\n this.scheduleShow();\n }\n\n @HostListener('focusout')\n protected onFocusOut(): void {\n this.focusedTarget = null;\n this.onClose();\n }\n\n private scheduleShow(): void {\n if (this.unpin || !this.tipContent()) {\n return;\n }\n if (this.pinsOnClick() && this.ref?.hasAttached()) {\n return;\n }\n if (this.whenClipped() && !this.isClipped()) {\n return;\n }\n if (this.timer !== null) {\n clearTimeout(this.timer);\n }\n this.timer = window.setTimeout(\n () => this.show(),\n this.pinsOnClick() ? 0 : this.delay(),\n );\n }\n\n @HostListener('mouseleave')\n protected onPointerLeave(): void {\n if (!this.unpin) {\n this.onClose();\n }\n }\n\n // Close on click too: a re-rendered anchor under a stationary cursor fires no mouseleave.\n @HostListener('click')\n protected onClick(): void {\n if (this.pinsOnClick() && !this.unpin) {\n this.pin();\n } else {\n this.onClose();\n }\n }\n\n protected onClose(): void {\n if (this.timer !== null) {\n clearTimeout(this.timer);\n this.timer = null;\n }\n this.unpin?.();\n this.disposeRef();\n }\n\n private pin(): void {\n if (this.timer !== null) {\n clearTimeout(this.timer);\n this.timer = null;\n }\n if (!this.ref?.hasAttached()) {\n if (!this.tipContent()) {\n return;\n }\n this.show();\n }\n const closeOutside = (event: Event) => {\n const target = event.target as Node;\n if (\n !this.hostElement.contains(target) &&\n !this.ref?.overlayElement.contains(target)\n ) {\n this.onClose();\n }\n };\n this.document.addEventListener('pointerdown', closeOutside, true);\n const stopEscape = listenForEscape(this.document, () => this.onClose());\n this.hostElement.setAttribute(PINNED_ATTRIBUTE, '');\n this.unpin = () => {\n this.unpin = null;\n this.hostElement.removeAttribute(PINNED_ATTRIBUTE);\n this.document.removeEventListener('pointerdown', closeOutside, true);\n stopEscape();\n };\n }\n\n private disposeRef(): void {\n this.ref?.dispose();\n this.ref = null;\n const described = this.describedElement;\n if (!described) {\n return;\n }\n this.describedElement = null;\n const remaining = (described.getAttribute('aria-describedby') ?? '')\n .split(' ')\n .filter((id: string) => id && id !== this.tipId)\n .join(' ');\n if (remaining) {\n described.setAttribute('aria-describedby', remaining);\n } else {\n described.removeAttribute('aria-describedby');\n }\n }\n\n @HostListener('keydown')\n protected onKeydown(): void {\n if (this.whenClipped()) {\n this.onClose();\n }\n }\n\n @HostListener('keydown.escape')\n protected onEscape(): void {\n if (this.ref) {\n this.onClose();\n }\n }\n\n private show(): void {\n // show() can be re-entered with a panel open: dispose it first to avoid a leaked OverlayRef and a duplicate id.\n this.disposeRef();\n const placement = this.placement();\n const positionStrategy = this.overlay\n .position()\n .flexibleConnectedTo(this.host)\n .withPositions(positionsFor(placement))\n .withViewportMargin(VIEWPORT_MARGIN_PX);\n\n this.ref = this.overlay.create({\n positionStrategy,\n panelClass: 'ds-overlay-pane',\n scrollStrategy: this.overlay.scrollStrategies.close(),\n });\n prepareOverlayEnter(this.ref, this.host.nativeElement, positionStrategy);\n // The CDK strategy sees only the window and cdkScrollable ancestors, not a plain overflow container.\n const stopScrollClose = closeOnScroll(this.ref, () => this.onClose());\n this.ref.detachments().subscribe(stopScrollClose);\n\n const cmpRef = this.ref.attach(new ComponentPortal(TooltipPanelComponent));\n const tip = this.tipContent();\n cmpRef.setInput('text', tip);\n cmpRef.setInput('placement', placement);\n cmpRef.setInput('arrow', this.arrow());\n positionStrategy.positionChanges.subscribe(({ connectionPair }) =>\n cmpRef.setInput('placement', overlayPlacementOf(connectionPair)),\n );\n cmpRef.setInput('panelId', this.tipId);\n pointArrowAtHost(this.ref, cmpRef.location.nativeElement, this.hostElement);\n this.ref.detachments().subscribe(() => this.unpin?.());\n if (typeof tip === 'string' && this.disclosesOwnText(tip)) {\n return;\n }\n const described = this.focusedTarget ?? this.host.nativeElement;\n this.describedElement = described;\n const existing = described.getAttribute('aria-describedby');\n described.setAttribute(\n 'aria-describedby',\n existing ? `${existing} ${this.tipId}` : this.tipId,\n );\n }\n\n ngOnDestroy(): void {\n this.detachAncestor?.();\n this.onClose();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAKA,MAAM,KAAK,GAAG,iBAAiB;AAC/B,MAAM,OAAO,GAAG,QAAQ;AACxB,MAAM,IAAI,GAAG,IAAI;AAEjB;AACM,SAAU,kBAAkB,CAAC,IAAY,EAAA;IAC7C,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;AAChC,IAAA,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,KAAK,KAAK,KAAK,IAAI,CAAC,CAAC,MAAM;IACnE,MAAM,aAAa,GAAG,WAAW,IAAI,WAAW,GAAG,CAAC,CAAC;IACrD,MAAM,QAAQ,GAAqB,EAAE;IACrC,IAAI,IAAI,GAAG,KAAK;IAChB,IAAI,IAAI,GAAG,CAAC;AACZ,IAAA,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE;QAC1B,IAAI,KAAK,GAAG,KAAK;AACjB,QAAA,IAAI,KAAK,KAAK,OAAO,EAAE;YACrB,KAAK,GAAG,IAAI;QACd;aAAO,IAAI,KAAK,KAAK,IAAI,IAAI,IAAI,EAAE,GAAG,aAAa,EAAE;YACnD,IAAI,GAAG,CAAC,IAAI;YACZ;QACF;QACA,IAAI,CAAC,KAAK,EAAE;YACV;QACF;QACA,MAAM,IAAI,GAAG,QAAQ,CAAC,QAAQ,CAAC,MAAM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