@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,18 +1,99 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, ElementRef, input, model, output, signal, computed, ViewEncapsulation, Component } from '@angular/core';
2
+ import { inject, TemplateRef, Directive, ElementRef, input, model, output, contentChild, signal, computed, afterEveryRender, ViewEncapsulation, Component } from '@angular/core';
3
+ import { NgTemplateOutlet } from '@angular/common';
3
4
  import { IconComponent } from '@ids-group-ltd/ids-design-system/icons';
4
5
 
6
+ /**
7
+ * Content drawn in place of a `ds-tree` row's label, for a label of more than one line or one
8
+ * that mixes styles.
9
+ *
10
+ * ```html
11
+ * <ds-tree [nodes]="layers">
12
+ * <ng-template dsTreeLabel let-node>
13
+ * <span class="tag">{{ tags[node.id] }}</span>
14
+ * <span class="text">{{ node.label }}</span>
15
+ * </ng-template>
16
+ * </ds-tree>
17
+ * ```
18
+ *
19
+ * The row grows to the template's height and the label takes the width between the icon and
20
+ * the trailing content, so an element inside it can cut its text with an ellipsis. The text the
21
+ * template renders is the row's accessible name; a template that draws no text needs a
22
+ * visually hidden element with the name in it. A click inside it selects the row as a click on
23
+ * the default label does.
24
+ */
25
+ class TreeLabelDirective {
26
+ template = inject(TemplateRef);
27
+ static ngTemplateContextGuard(_directive, _context) {
28
+ return true;
29
+ }
30
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: TreeLabelDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
31
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.22", type: TreeLabelDirective, isStandalone: true, selector: "ng-template[dsTreeLabel]", ngImport: i0 });
32
+ }
33
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: TreeLabelDirective, decorators: [{
34
+ type: Directive,
35
+ args: [{
36
+ selector: 'ng-template[dsTreeLabel]',
37
+ standalone: true,
38
+ }]
39
+ }] });
40
+
41
+ /**
42
+ * Content drawn at the end of every `ds-tree` row: a badge, a count, a small icon button.
43
+ *
44
+ * ```html
45
+ * <ds-tree [nodes]="layers">
46
+ * <ng-template dsTreeTrailing let-node>
47
+ * <ds-badge size="sm">{{ node.id }}</ds-badge>
48
+ * </ng-template>
49
+ * </ds-tree>
50
+ * ```
51
+ *
52
+ * A click inside it neither selects nor toggles the row. Its controls are tab stops only on
53
+ * the focused row: Tab from that row reaches them, and the other rows' controls stay out of
54
+ * the tab order.
55
+ */
56
+ class TreeTrailingDirective {
57
+ template = inject(TemplateRef);
58
+ static ngTemplateContextGuard(_directive, _context) {
59
+ return true;
60
+ }
61
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: TreeTrailingDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
62
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.22", type: TreeTrailingDirective, isStandalone: true, selector: "ng-template[dsTreeTrailing]", ngImport: i0 });
63
+ }
64
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: TreeTrailingDirective, decorators: [{
65
+ type: Directive,
66
+ args: [{
67
+ selector: 'ng-template[dsTreeTrailing]',
68
+ standalone: true,
69
+ }]
70
+ }] });
71
+
72
+ const FOCUSABLE = 'a[href], button, input, select, textarea, [tabindex]:not([tabindex="-1"])';
73
+ const PARKED_TABINDEX = 'data-ds-tree-tabindex';
74
+ let nextId = 0;
5
75
  class TreeComponent {
6
76
  host = inject(ElementRef);
7
77
  /** Root-level nodes; nest via `children`. */
8
78
  nodes = input([], ...(ngDevMode ? [{ debugName: "nodes" }] : /* istanbul ignore next */ []));
9
79
  /** Ids of the expanded nodes. */
10
80
  expandedIds = model(new Set(), ...(ngDevMode ? [{ debugName: "expandedIds" }] : /* istanbul ignore next */ []));
11
- /** Id of the selected node. */
81
+ /** `'multiple'` reads and writes `selectedIds`; `'single'` reads and writes `selectedId`. */
82
+ selection = input('single', ...(ngDevMode ? [{ debugName: "selection" }] : /* istanbul ignore next */ []));
83
+ /** Id of the selected node, in `'single'` selection. */
12
84
  selectedId = model(null, ...(ngDevMode ? [{ debugName: "selectedId" }] : /* istanbul ignore next */ []));
13
- /** Fires with the node when a row is selected (click or Enter/Space). */
85
+ /** Ids of the selected nodes, in `'multiple'` selection. */
86
+ selectedIds = model([], ...(ngDevMode ? [{ debugName: "selectedIds" }] : /* istanbul ignore next */ []));
87
+ /** Fires with the node when a row is selected (click or Enter/Space), not when one is deselected. */
14
88
  nodeSelected = output();
89
+ /** Fires with the node under the pointer or newly focused, and `null` when the pointer leaves the tree. */
90
+ nodeHover = output();
91
+ label = contentChild(TreeLabelDirective, ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
92
+ trailing = contentChild(TreeTrailingDirective, ...(ngDevMode ? [{ debugName: "trailing" }] : /* istanbul ignore next */ []));
93
+ idPrefix = `ds-tree-${++nextId}`;
15
94
  activeId = signal(null, ...(ngDevMode ? [{ debugName: "activeId" }] : /* istanbul ignore next */ []));
95
+ hoveredId = null;
96
+ multiple = computed(() => this.selection() === 'multiple', ...(ngDevMode ? [{ debugName: "multiple" }] : /* istanbul ignore next */ []));
16
97
  visibleNodes = computed(() => {
17
98
  const out = [];
18
99
  const walk = (list, level) => {
@@ -29,25 +110,44 @@ class TreeComponent {
29
110
  return out;
30
111
  }, ...(ngDevMode ? [{ debugName: "visibleNodes" }] : /* istanbul ignore next */ []));
31
112
  effectiveActiveId = computed(() => this.activeId() ?? this.visibleNodes()[0]?.node.id ?? null, ...(ngDevMode ? [{ debugName: "effectiveActiveId" }] : /* istanbul ignore next */ []));
113
+ constructor() {
114
+ // Content inside a trailing template can change without a signal of the tree changing,
115
+ // so its tab stops are re-parked after every render.
116
+ afterEveryRender({ write: () => this.parkTrailingTabStops() });
117
+ }
32
118
  isExpanded(id) {
33
119
  return this.expandedIds().has(id);
34
120
  }
35
121
  isSelected(id) {
36
- return this.selectedId() === id;
122
+ return this.multiple()
123
+ ? this.selectedIds().includes(id)
124
+ : this.selectedId() === id;
37
125
  }
38
126
  isActive(id) {
39
127
  return this.effectiveActiveId() === id;
40
128
  }
41
- onRowClick(entry) {
42
- if (entry.node.disabled) {
129
+ onRowClick(entry, event) {
130
+ if (this.fromTrailing(event)) {
43
131
  return;
44
132
  }
45
- this.select(entry.node);
46
- if (entry.hasChildren) {
47
- this.toggle(entry.node);
133
+ this.activate(entry, event.shiftKey || event.ctrlKey || event.metaKey);
134
+ }
135
+ onRowFocus(entry) {
136
+ this.activeId.set(entry.node.id);
137
+ this.hover(entry.node);
138
+ }
139
+ hover(node) {
140
+ const id = node?.id ?? null;
141
+ if (id === this.hoveredId) {
142
+ return;
48
143
  }
144
+ this.hoveredId = id;
145
+ this.nodeHover.emit(node);
49
146
  }
50
147
  onKeydown(event) {
148
+ if (this.fromTrailing(event)) {
149
+ return;
150
+ }
51
151
  const visible = this.visibleNodes();
52
152
  const index = visible.findIndex((entry) => entry.node.id === this.effectiveActiveId());
53
153
  if (index < 0) {
@@ -83,12 +183,47 @@ class TreeComponent {
83
183
  this.moveToParent(visible, index);
84
184
  }
85
185
  break;
186
+ case 'Enter':
187
+ case ' ':
188
+ if (!event.repeat) {
189
+ this.activate(current, event.shiftKey || event.ctrlKey || event.metaKey);
190
+ }
191
+ break;
86
192
  default:
87
- // Enter and Space activate through the row button's native click.
88
193
  return;
89
194
  }
90
195
  event.preventDefault();
91
196
  }
197
+ // A modified activation in multiple selection only adds or removes the node; every other
198
+ // activation selects the node alone and toggles a parent.
199
+ activate(entry, modified) {
200
+ const node = entry.node;
201
+ if (node.disabled) {
202
+ return;
203
+ }
204
+ this.activeId.set(node.id);
205
+ if (this.multiple() && modified) {
206
+ const ids = this.selectedIds();
207
+ if (ids.includes(node.id)) {
208
+ this.selectedIds.set(ids.filter((id) => id !== node.id));
209
+ }
210
+ else {
211
+ this.selectedIds.set([...ids, node.id]);
212
+ this.nodeSelected.emit(node);
213
+ }
214
+ return;
215
+ }
216
+ if (this.multiple()) {
217
+ this.selectedIds.set([node.id]);
218
+ }
219
+ else {
220
+ this.selectedId.set(node.id);
221
+ }
222
+ this.nodeSelected.emit(node);
223
+ if (entry.hasChildren) {
224
+ this.toggle(node);
225
+ }
226
+ }
92
227
  toggle(node) {
93
228
  if (node.disabled || !node.children?.length) {
94
229
  return;
@@ -102,14 +237,6 @@ class TreeComponent {
102
237
  }
103
238
  this.expandedIds.set(next);
104
239
  }
105
- select(node) {
106
- if (node.disabled) {
107
- return;
108
- }
109
- this.selectedId.set(node.id);
110
- this.activeId.set(node.id);
111
- this.nodeSelected.emit(node);
112
- }
113
240
  moveActive(targetIndex) {
114
241
  const visible = this.visibleNodes();
115
242
  if (targetIndex < 0 || targetIndex >= visible.length) {
@@ -129,23 +256,54 @@ class TreeComponent {
129
256
  focusNode(id) {
130
257
  this.activeId.set(id);
131
258
  this.host.nativeElement
132
- .querySelector(`[data-node-id="${id}"]`)
259
+ .querySelector(`[data-node-id="${CSS.escape(id)}"]`)
133
260
  ?.focus();
134
261
  }
262
+ fromTrailing(event) {
263
+ return (event.target instanceof Element && !!event.target.closest('.trailing'));
264
+ }
265
+ // The tree keeps one tab stop: controls in a trailing template are tabbable on the active
266
+ // row only, and get their own tabindex back when their row becomes active.
267
+ parkTrailingTabStops() {
268
+ const activeId = this.effectiveActiveId();
269
+ for (const area of this.host.nativeElement.querySelectorAll('.trailing')) {
270
+ const onActiveRow = area.closest('[data-node-id]')?.getAttribute('data-node-id') ===
271
+ activeId;
272
+ const controls = area.querySelectorAll(onActiveRow ? `[${PARKED_TABINDEX}]` : FOCUSABLE);
273
+ for (const control of controls) {
274
+ if (onActiveRow) {
275
+ const own = control.getAttribute(PARKED_TABINDEX);
276
+ control.removeAttribute(PARKED_TABINDEX);
277
+ if (own) {
278
+ control.setAttribute('tabindex', own);
279
+ }
280
+ else {
281
+ control.removeAttribute('tabindex');
282
+ }
283
+ }
284
+ else if (!control.hasAttribute(PARKED_TABINDEX)) {
285
+ control.setAttribute(PARKED_TABINDEX, control.getAttribute('tabindex') ?? '');
286
+ control.setAttribute('tabindex', '-1');
287
+ }
288
+ }
289
+ }
290
+ }
135
291
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: TreeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
136
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: TreeComponent, isStandalone: true, selector: "ds-tree", inputs: { nodes: { classPropertyName: "nodes", publicName: "nodes", isSignal: true, isRequired: false, transformFunction: null }, expandedIds: { classPropertyName: "expandedIds", publicName: "expandedIds", isSignal: true, isRequired: false, transformFunction: null }, selectedId: { classPropertyName: "selectedId", publicName: "selectedId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { expandedIds: "expandedIdsChange", selectedId: "selectedIdChange", nodeSelected: "nodeSelected" }, host: { attributes: { "role": "tree" }, listeners: { "keydown": "onKeydown($event)" } }, ngImport: i0, template: "@for (entry of visibleNodes(); track entry.node.id) {\n <button\n type=\"button\"\n class=\"row\"\n role=\"treeitem\"\n [attr.data-node-id]=\"entry.node.id\"\n [attr.aria-level]=\"entry.level + 1\"\n [attr.aria-expanded]=\"entry.hasChildren ? entry.expanded : null\"\n [attr.aria-selected]=\"isSelected(entry.node.id)\"\n [attr.tabindex]=\"isActive(entry.node.id) ? 0 : -1\"\n [class.selected]=\"isSelected(entry.node.id)\"\n [disabled]=\"entry.node.disabled\"\n [style.--_level]=\"entry.level\"\n (click)=\"onRowClick(entry)\">\n @if (entry.hasChildren) {\n <ds-icon\n class=\"caret\"\n [name]=\"entry.expanded ? 'chevronDown' : 'chevronRight'\"\n [size]=\"16\" />\n } @else {\n <span class=\"caret-spacer\"></span>\n }\n\n @if (entry.node.icon; as icon) {\n <ds-icon\n class=\"node-icon\"\n [name]=\"icon\"\n [size]=\"16\" />\n }\n\n <span class=\"label\">\n {{ entry.node.label }}\n </span>\n </button>\n}\n", 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{--_tree-indent: var(--ds-tree-indent, var(--tree-indent));--_tree-row-padding-y: var(--ds-tree-row-padding-y, var(--tree-row-pad-y));--_tree-row-padding-x: var(--ds-tree-row-padding-x, var(--tree-row-pad-x));--_tree-row-hover-bg-color: var(--ds-tree-row-hover-bg-color, var(--surface-secondary));--_tree-row-selected-bg-color: var(--ds-tree-row-selected-bg-color, var(--accent-surface-tint));--_tree-row-selected-text-color: var(--ds-tree-row-selected-text-color, var(--accent-strong));--_tree-row-selected-icon-color: var(--ds-tree-row-selected-icon-color, var(--_tree-row-selected-text-color));--_tree-row-text-color: var(--ds-tree-row-text-color, var(--text-primary));--_tree-caret-icon-color: var(--ds-tree-caret-icon-color, var(--text-tertiary));display:flex;flex-direction:column}.row{display:flex;align-items:center;gap:var(--space-2);width:100%;padding:var(--_tree-row-padding-y) var(--_tree-row-padding-x) var(--_tree-row-padding-y) calc(var(--_tree-row-padding-x) + var(--_level, 0) * var(--_tree-indent));border:0;background:transparent;border-radius:var(--focus-ring-radius);color:var(--_tree-row-text-color);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);text-align:left;cursor:pointer;transition:background-color var(--duration-fast) var(--ease-standard)}.row:hover{background-color:var(--_tree-row-hover-bg-color)}.row:active:not(:disabled){background-color:var(--surface-muted)}.row:focus-visible{outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:calc(-1 * var(--focus-ring-width));animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}.row:disabled{color:var(--text-disabled);cursor:not-allowed}.row.selected{background-color:var(--_tree-row-selected-bg-color);color:var(--_tree-row-selected-text-color);font-weight:var(--font-weight-semibold)}.caret{flex:none;color:var(--_tree-caret-icon-color)}.caret-spacer{flex:none;width:var(--space-4)}.node-icon{flex:none;color:var(--icon-default, var(--text-secondary))}.row.selected .node-icon{color:var(--_tree-row-selected-icon-color)}.label{min-width:0;overflow:clip visible;text-overflow:ellipsis;white-space:nowrap}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }] });
292
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: TreeComponent, isStandalone: true, selector: "ds-tree", inputs: { nodes: { classPropertyName: "nodes", publicName: "nodes", isSignal: true, isRequired: false, transformFunction: null }, expandedIds: { classPropertyName: "expandedIds", publicName: "expandedIds", isSignal: true, isRequired: false, transformFunction: null }, selection: { classPropertyName: "selection", publicName: "selection", isSignal: true, isRequired: false, transformFunction: null }, selectedId: { classPropertyName: "selectedId", publicName: "selectedId", isSignal: true, isRequired: false, transformFunction: null }, selectedIds: { classPropertyName: "selectedIds", publicName: "selectedIds", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { expandedIds: "expandedIdsChange", selectedId: "selectedIdChange", selectedIds: "selectedIdsChange", nodeSelected: "nodeSelected", nodeHover: "nodeHover" }, host: { attributes: { "role": "tree" }, listeners: { "keydown": "onKeydown($event)", "pointerleave": "hover(null)" }, properties: { "attr.aria-multiselectable": "multiple() ? 'true' : null" } }, queries: [{ propertyName: "label", first: true, predicate: TreeLabelDirective, descendants: true, isSignal: true }, { propertyName: "trailing", first: true, predicate: TreeTrailingDirective, descendants: true, isSignal: true }], ngImport: i0, template: "@for (entry of visibleNodes(); track entry.node.id; let index = $index) {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events -- Enter and Space reach the host keydown handler, which activates the focused row -->\n <div\n class=\"row\"\n role=\"treeitem\"\n [attr.data-node-id]=\"entry.node.id\"\n [attr.aria-level]=\"entry.level + 1\"\n [attr.aria-expanded]=\"entry.hasChildren ? entry.expanded : null\"\n [attr.aria-selected]=\"isSelected(entry.node.id)\"\n [attr.aria-disabled]=\"entry.node.disabled ? 'true' : null\"\n [attr.aria-labelledby]=\"idPrefix + '-' + index\"\n [attr.aria-describedby]=\"\n trailing() ? idPrefix + '-' + index + '-trailing' : null\n \"\n [attr.tabindex]=\"isActive(entry.node.id) ? 0 : -1\"\n [class.selected]=\"isSelected(entry.node.id)\"\n [style.--_level]=\"entry.level\"\n (click)=\"onRowClick(entry, $event)\"\n (focus)=\"onRowFocus(entry)\"\n (pointerenter)=\"hover(entry.node)\">\n @if (entry.hasChildren) {\n <ds-icon\n class=\"caret\"\n [name]=\"entry.expanded ? 'chevronDown' : 'chevronRight'\"\n [size]=\"16\" />\n } @else if (!entry.node.icon) {\n <span class=\"caret-spacer\"></span>\n }\n\n @if (entry.node.icon; as icon) {\n <ds-icon\n class=\"node-icon\"\n [name]=\"icon\"\n [size]=\"16\" />\n }\n\n @if (label(); as label) {\n <span\n class=\"custom-label\"\n [id]=\"idPrefix + '-' + index\">\n <ng-container\n *ngTemplateOutlet=\"\n label.template;\n context: {\n $implicit: entry.node,\n node: entry.node,\n level: entry.level,\n selected: isSelected(entry.node.id),\n disabled: !!entry.node.disabled,\n }\n \" />\n </span>\n } @else {\n <span\n class=\"label\"\n [id]=\"idPrefix + '-' + index\">\n {{ entry.node.label }}\n </span>\n }\n\n @if (trailing(); as trailing) {\n <span\n class=\"trailing\"\n [id]=\"idPrefix + '-' + index + '-trailing'\">\n <ng-container\n *ngTemplateOutlet=\"\n trailing.template;\n context: { $implicit: entry.node, node: entry.node }\n \" />\n </span>\n }\n </div>\n}\n", 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{--_tree-indent: var(--ds-tree-indent, var(--tree-indent));--_tree-row-padding-y: var(--ds-tree-row-padding-y, var(--tree-row-pad-y));--_tree-row-padding-x: var(--ds-tree-row-padding-x, var(--tree-row-pad-x));--_tree-row-hover-bg-color: var(--ds-tree-row-hover-bg-color, var(--surface-secondary));--_tree-row-selected-bg-color: var(--ds-tree-row-selected-bg-color, var(--accent-surface-tint));--_tree-row-selected-text-color: var(--ds-tree-row-selected-text-color, var(--accent-strong));--_tree-row-selected-icon-color: var(--ds-tree-row-selected-icon-color, var(--_tree-row-selected-text-color));--_tree-row-text-color: var(--ds-tree-row-text-color, var(--text-primary));--_tree-caret-icon-color: var(--ds-tree-caret-icon-color, var(--text-tertiary));display:flex;flex-direction:column}.row{display:flex;align-items:center;gap:var(--space-2);width:100%;padding:var(--_tree-row-padding-y) var(--_tree-row-padding-x) var(--_tree-row-padding-y) calc(var(--_tree-row-padding-x) + var(--_level, 0) * var(--_tree-indent));border:0;background:transparent;border-radius:var(--focus-ring-radius);color:var(--_tree-row-text-color);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);text-align:left;cursor:pointer;-webkit-user-select:none;user-select:none;transition:background-color var(--duration-fast) var(--ease-standard)}.row:hover{background-color:var(--_tree-row-hover-bg-color)}.row:active:not([aria-disabled=true],:has(.trailing:active)){background-color:var(--surface-muted)}.row:focus-visible{outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:calc(-1 * var(--focus-ring-width));animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}.row[aria-disabled=true]{color:var(--text-disabled);cursor:not-allowed}.row.selected{background-color:var(--_tree-row-selected-bg-color);color:var(--_tree-row-selected-text-color);font-weight:var(--font-weight-semibold)}.caret{flex:none;color:var(--_tree-caret-icon-color)}.caret-spacer{flex:none;width:var(--space-4)}.node-icon{flex:none;color:var(--icon-default, var(--text-secondary))}.row.selected .node-icon{color:var(--_tree-row-selected-icon-color)}.label{min-width:0;overflow:clip visible;text-overflow:ellipsis;white-space:nowrap}.custom-label{flex:1;min-width:0}.trailing{display:flex;flex:none;align-items:center;gap:var(--space-1);margin-block:calc(-1 * var(--_tree-row-padding-y));margin-inline-start:auto;font-weight:var(--font-weight-regular);cursor:default}.trailing:focus-within{position:relative;z-index:1}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
137
293
  }
138
294
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: TreeComponent, decorators: [{
139
295
  type: Component,
140
- args: [{ selector: 'ds-tree', standalone: true, imports: [IconComponent], encapsulation: ViewEncapsulation.Emulated, host: {
296
+ args: [{ selector: 'ds-tree', standalone: true, imports: [IconComponent, NgTemplateOutlet], encapsulation: ViewEncapsulation.Emulated, host: {
141
297
  role: 'tree',
298
+ '[attr.aria-multiselectable]': "multiple() ? 'true' : null",
142
299
  '(keydown)': 'onKeydown($event)',
143
- }, template: "@for (entry of visibleNodes(); track entry.node.id) {\n <button\n type=\"button\"\n class=\"row\"\n role=\"treeitem\"\n [attr.data-node-id]=\"entry.node.id\"\n [attr.aria-level]=\"entry.level + 1\"\n [attr.aria-expanded]=\"entry.hasChildren ? entry.expanded : null\"\n [attr.aria-selected]=\"isSelected(entry.node.id)\"\n [attr.tabindex]=\"isActive(entry.node.id) ? 0 : -1\"\n [class.selected]=\"isSelected(entry.node.id)\"\n [disabled]=\"entry.node.disabled\"\n [style.--_level]=\"entry.level\"\n (click)=\"onRowClick(entry)\">\n @if (entry.hasChildren) {\n <ds-icon\n class=\"caret\"\n [name]=\"entry.expanded ? 'chevronDown' : 'chevronRight'\"\n [size]=\"16\" />\n } @else {\n <span class=\"caret-spacer\"></span>\n }\n\n @if (entry.node.icon; as icon) {\n <ds-icon\n class=\"node-icon\"\n [name]=\"icon\"\n [size]=\"16\" />\n }\n\n <span class=\"label\">\n {{ entry.node.label }}\n </span>\n </button>\n}\n", 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{--_tree-indent: var(--ds-tree-indent, var(--tree-indent));--_tree-row-padding-y: var(--ds-tree-row-padding-y, var(--tree-row-pad-y));--_tree-row-padding-x: var(--ds-tree-row-padding-x, var(--tree-row-pad-x));--_tree-row-hover-bg-color: var(--ds-tree-row-hover-bg-color, var(--surface-secondary));--_tree-row-selected-bg-color: var(--ds-tree-row-selected-bg-color, var(--accent-surface-tint));--_tree-row-selected-text-color: var(--ds-tree-row-selected-text-color, var(--accent-strong));--_tree-row-selected-icon-color: var(--ds-tree-row-selected-icon-color, var(--_tree-row-selected-text-color));--_tree-row-text-color: var(--ds-tree-row-text-color, var(--text-primary));--_tree-caret-icon-color: var(--ds-tree-caret-icon-color, var(--text-tertiary));display:flex;flex-direction:column}.row{display:flex;align-items:center;gap:var(--space-2);width:100%;padding:var(--_tree-row-padding-y) var(--_tree-row-padding-x) var(--_tree-row-padding-y) calc(var(--_tree-row-padding-x) + var(--_level, 0) * var(--_tree-indent));border:0;background:transparent;border-radius:var(--focus-ring-radius);color:var(--_tree-row-text-color);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);text-align:left;cursor:pointer;transition:background-color var(--duration-fast) var(--ease-standard)}.row:hover{background-color:var(--_tree-row-hover-bg-color)}.row:active:not(:disabled){background-color:var(--surface-muted)}.row:focus-visible{outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:calc(-1 * var(--focus-ring-width));animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}.row:disabled{color:var(--text-disabled);cursor:not-allowed}.row.selected{background-color:var(--_tree-row-selected-bg-color);color:var(--_tree-row-selected-text-color);font-weight:var(--font-weight-semibold)}.caret{flex:none;color:var(--_tree-caret-icon-color)}.caret-spacer{flex:none;width:var(--space-4)}.node-icon{flex:none;color:var(--icon-default, var(--text-secondary))}.row.selected .node-icon{color:var(--_tree-row-selected-icon-color)}.label{min-width:0;overflow:clip visible;text-overflow:ellipsis;white-space:nowrap}\n"] }]
144
- }], propDecorators: { nodes: [{ type: i0.Input, args: [{ isSignal: true, alias: "nodes", required: false }] }], expandedIds: [{ type: i0.Input, args: [{ isSignal: true, alias: "expandedIds", required: false }] }, { type: i0.Output, args: ["expandedIdsChange"] }], selectedId: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedId", required: false }] }, { type: i0.Output, args: ["selectedIdChange"] }], nodeSelected: [{ type: i0.Output, args: ["nodeSelected"] }] } });
300
+ '(pointerleave)': 'hover(null)',
301
+ }, template: "@for (entry of visibleNodes(); track entry.node.id; let index = $index) {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events -- Enter and Space reach the host keydown handler, which activates the focused row -->\n <div\n class=\"row\"\n role=\"treeitem\"\n [attr.data-node-id]=\"entry.node.id\"\n [attr.aria-level]=\"entry.level + 1\"\n [attr.aria-expanded]=\"entry.hasChildren ? entry.expanded : null\"\n [attr.aria-selected]=\"isSelected(entry.node.id)\"\n [attr.aria-disabled]=\"entry.node.disabled ? 'true' : null\"\n [attr.aria-labelledby]=\"idPrefix + '-' + index\"\n [attr.aria-describedby]=\"\n trailing() ? idPrefix + '-' + index + '-trailing' : null\n \"\n [attr.tabindex]=\"isActive(entry.node.id) ? 0 : -1\"\n [class.selected]=\"isSelected(entry.node.id)\"\n [style.--_level]=\"entry.level\"\n (click)=\"onRowClick(entry, $event)\"\n (focus)=\"onRowFocus(entry)\"\n (pointerenter)=\"hover(entry.node)\">\n @if (entry.hasChildren) {\n <ds-icon\n class=\"caret\"\n [name]=\"entry.expanded ? 'chevronDown' : 'chevronRight'\"\n [size]=\"16\" />\n } @else if (!entry.node.icon) {\n <span class=\"caret-spacer\"></span>\n }\n\n @if (entry.node.icon; as icon) {\n <ds-icon\n class=\"node-icon\"\n [name]=\"icon\"\n [size]=\"16\" />\n }\n\n @if (label(); as label) {\n <span\n class=\"custom-label\"\n [id]=\"idPrefix + '-' + index\">\n <ng-container\n *ngTemplateOutlet=\"\n label.template;\n context: {\n $implicit: entry.node,\n node: entry.node,\n level: entry.level,\n selected: isSelected(entry.node.id),\n disabled: !!entry.node.disabled,\n }\n \" />\n </span>\n } @else {\n <span\n class=\"label\"\n [id]=\"idPrefix + '-' + index\">\n {{ entry.node.label }}\n </span>\n }\n\n @if (trailing(); as trailing) {\n <span\n class=\"trailing\"\n [id]=\"idPrefix + '-' + index + '-trailing'\">\n <ng-container\n *ngTemplateOutlet=\"\n trailing.template;\n context: { $implicit: entry.node, node: entry.node }\n \" />\n </span>\n }\n </div>\n}\n", 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{--_tree-indent: var(--ds-tree-indent, var(--tree-indent));--_tree-row-padding-y: var(--ds-tree-row-padding-y, var(--tree-row-pad-y));--_tree-row-padding-x: var(--ds-tree-row-padding-x, var(--tree-row-pad-x));--_tree-row-hover-bg-color: var(--ds-tree-row-hover-bg-color, var(--surface-secondary));--_tree-row-selected-bg-color: var(--ds-tree-row-selected-bg-color, var(--accent-surface-tint));--_tree-row-selected-text-color: var(--ds-tree-row-selected-text-color, var(--accent-strong));--_tree-row-selected-icon-color: var(--ds-tree-row-selected-icon-color, var(--_tree-row-selected-text-color));--_tree-row-text-color: var(--ds-tree-row-text-color, var(--text-primary));--_tree-caret-icon-color: var(--ds-tree-caret-icon-color, var(--text-tertiary));display:flex;flex-direction:column}.row{display:flex;align-items:center;gap:var(--space-2);width:100%;padding:var(--_tree-row-padding-y) var(--_tree-row-padding-x) var(--_tree-row-padding-y) calc(var(--_tree-row-padding-x) + var(--_level, 0) * var(--_tree-indent));border:0;background:transparent;border-radius:var(--focus-ring-radius);color:var(--_tree-row-text-color);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);text-align:left;cursor:pointer;-webkit-user-select:none;user-select:none;transition:background-color var(--duration-fast) var(--ease-standard)}.row:hover{background-color:var(--_tree-row-hover-bg-color)}.row:active:not([aria-disabled=true],:has(.trailing:active)){background-color:var(--surface-muted)}.row:focus-visible{outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:calc(-1 * var(--focus-ring-width));animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}.row[aria-disabled=true]{color:var(--text-disabled);cursor:not-allowed}.row.selected{background-color:var(--_tree-row-selected-bg-color);color:var(--_tree-row-selected-text-color);font-weight:var(--font-weight-semibold)}.caret{flex:none;color:var(--_tree-caret-icon-color)}.caret-spacer{flex:none;width:var(--space-4)}.node-icon{flex:none;color:var(--icon-default, var(--text-secondary))}.row.selected .node-icon{color:var(--_tree-row-selected-icon-color)}.label{min-width:0;overflow:clip visible;text-overflow:ellipsis;white-space:nowrap}.custom-label{flex:1;min-width:0}.trailing{display:flex;flex:none;align-items:center;gap:var(--space-1);margin-block:calc(-1 * var(--_tree-row-padding-y));margin-inline-start:auto;font-weight:var(--font-weight-regular);cursor:default}.trailing:focus-within{position:relative;z-index:1}\n"] }]
302
+ }], ctorParameters: () => [], propDecorators: { nodes: [{ type: i0.Input, args: [{ isSignal: true, alias: "nodes", required: false }] }], expandedIds: [{ type: i0.Input, args: [{ isSignal: true, alias: "expandedIds", required: false }] }, { type: i0.Output, args: ["expandedIdsChange"] }], selection: [{ type: i0.Input, args: [{ isSignal: true, alias: "selection", required: false }] }], selectedId: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedId", required: false }] }, { type: i0.Output, args: ["selectedIdChange"] }], selectedIds: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedIds", required: false }] }, { type: i0.Output, args: ["selectedIdsChange"] }], nodeSelected: [{ type: i0.Output, args: ["nodeSelected"] }], nodeHover: [{ type: i0.Output, args: ["nodeHover"] }], label: [{ type: i0.ContentChild, args: [i0.forwardRef(() => TreeLabelDirective), { isSignal: true }] }], trailing: [{ type: i0.ContentChild, args: [i0.forwardRef(() => TreeTrailingDirective), { isSignal: true }] }] } });
145
303
 
146
304
  /**
147
305
  * Generated bundle index. Do not edit.
148
306
  */
149
307
 
150
- export { TreeComponent };
308
+ export { TreeComponent, TreeLabelDirective, TreeTrailingDirective };
151
309
  //# sourceMappingURL=ids-group-ltd-ids-design-system-components-tree.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ids-group-ltd-ids-design-system-components-tree.mjs","sources":["../../../src/lib/components/tree/tree.component.ts","../../../src/lib/components/tree/tree.component.html","../../../src/lib/components/tree/ids-group-ltd-ids-design-system-components-tree.ts"],"sourcesContent":["import {\n Component,\n ElementRef,\n ViewEncapsulation,\n computed,\n inject,\n input,\n model,\n output,\n signal,\n} from '@angular/core';\nimport { IconComponent } from '@ids-group-ltd/ids-design-system/icons';\nimport type { TreeNode } from './tree.types';\n\ninterface VisibleNode {\n node: TreeNode;\n level: number;\n hasChildren: boolean;\n expanded: boolean;\n}\n\n@Component({\n selector: 'ds-tree',\n standalone: true,\n imports: [IconComponent],\n templateUrl: './tree.component.html',\n styleUrl: './tree.component.scss',\n encapsulation: ViewEncapsulation.Emulated,\n host: {\n role: 'tree',\n '(keydown)': 'onKeydown($event)',\n },\n})\nexport class TreeComponent {\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /** Root-level nodes; nest via `children`. */\n readonly nodes = input<readonly TreeNode[]>([]);\n /** Ids of the expanded nodes. */\n readonly expandedIds = model<Set<string>>(new Set());\n /** Id of the selected node. */\n readonly selectedId = model<string | null>(null);\n /** Fires with the node when a row is selected (click or Enter/Space). */\n readonly nodeSelected = output<TreeNode>();\n\n private readonly activeId = signal<string | null>(null);\n\n protected readonly visibleNodes = computed<VisibleNode[]>(() => {\n const out: VisibleNode[] = [];\n const walk = (list: readonly TreeNode[], level: number): void => {\n for (const node of list) {\n const hasChildren = !!node.children?.length;\n const expanded = this.isExpanded(node.id);\n out.push({ node, level, hasChildren, expanded });\n if (hasChildren && expanded) {\n walk(node.children ?? [], level + 1);\n }\n }\n };\n walk(this.nodes(), 0);\n\n return out;\n });\n\n protected readonly effectiveActiveId = computed(\n () => this.activeId() ?? this.visibleNodes()[0]?.node.id ?? null,\n );\n\n protected isExpanded(id: string): boolean {\n return this.expandedIds().has(id);\n }\n\n protected isSelected(id: string): boolean {\n return this.selectedId() === id;\n }\n\n protected isActive(id: string): boolean {\n return this.effectiveActiveId() === id;\n }\n\n protected onRowClick(entry: VisibleNode): void {\n if (entry.node.disabled) {\n return;\n }\n this.select(entry.node);\n if (entry.hasChildren) {\n this.toggle(entry.node);\n }\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n const visible = this.visibleNodes();\n const index = visible.findIndex(\n (entry) => entry.node.id === this.effectiveActiveId(),\n );\n if (index < 0) {\n return;\n }\n const current = visible[index];\n switch (event.key) {\n case 'ArrowDown':\n this.moveActive(index + 1);\n break;\n case 'ArrowUp':\n this.moveActive(index - 1);\n break;\n case 'Home':\n this.moveActive(0);\n break;\n case 'End':\n this.moveActive(visible.length - 1);\n break;\n case 'ArrowRight':\n if (current.hasChildren && !current.expanded) {\n this.toggle(current.node);\n } else if (current.hasChildren) {\n this.moveActive(index + 1);\n }\n break;\n case 'ArrowLeft':\n if (current.hasChildren && current.expanded) {\n this.toggle(current.node);\n } else {\n this.moveToParent(visible, index);\n }\n break;\n default:\n // Enter and Space activate through the row button's native click.\n return;\n }\n event.preventDefault();\n }\n\n private toggle(node: TreeNode): void {\n if (node.disabled || !node.children?.length) {\n return;\n }\n const next = new Set(this.expandedIds());\n if (next.has(node.id)) {\n next.delete(node.id);\n } else {\n next.add(node.id);\n }\n this.expandedIds.set(next);\n }\n\n private select(node: TreeNode): void {\n if (node.disabled) {\n return;\n }\n this.selectedId.set(node.id);\n this.activeId.set(node.id);\n this.nodeSelected.emit(node);\n }\n\n private moveActive(targetIndex: number): void {\n const visible = this.visibleNodes();\n if (targetIndex < 0 || targetIndex >= visible.length) {\n return;\n }\n this.focusNode(visible[targetIndex].node.id);\n }\n\n private moveToParent(visible: VisibleNode[], index: number): void {\n const level = visible[index].level;\n for (let i = index - 1; i >= 0; i--) {\n if (visible[i].level < level) {\n this.focusNode(visible[i].node.id);\n\n return;\n }\n }\n }\n\n private focusNode(id: string): void {\n this.activeId.set(id);\n this.host.nativeElement\n .querySelector<HTMLElement>(`[data-node-id=\"${id}\"]`)\n ?.focus();\n }\n}\n","@for (entry of visibleNodes(); track entry.node.id) {\n <button\n type=\"button\"\n class=\"row\"\n role=\"treeitem\"\n [attr.data-node-id]=\"entry.node.id\"\n [attr.aria-level]=\"entry.level + 1\"\n [attr.aria-expanded]=\"entry.hasChildren ? entry.expanded : null\"\n [attr.aria-selected]=\"isSelected(entry.node.id)\"\n [attr.tabindex]=\"isActive(entry.node.id) ? 0 : -1\"\n [class.selected]=\"isSelected(entry.node.id)\"\n [disabled]=\"entry.node.disabled\"\n [style.--_level]=\"entry.level\"\n (click)=\"onRowClick(entry)\">\n @if (entry.hasChildren) {\n <ds-icon\n class=\"caret\"\n [name]=\"entry.expanded ? 'chevronDown' : 'chevronRight'\"\n [size]=\"16\" />\n } @else {\n <span class=\"caret-spacer\"></span>\n }\n\n @if (entry.node.icon; as icon) {\n <ds-icon\n class=\"node-icon\"\n [name]=\"icon\"\n [size]=\"16\" />\n }\n\n <span class=\"label\">\n {{ entry.node.label }}\n </span>\n </button>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAiCa,aAAa,CAAA;AACP,IAAA,IAAI,GAAG,MAAM,CAA0B,UAAU,CAAC;;AAG1D,IAAA,KAAK,GAAG,KAAK,CAAsB,EAAE,4EAAC;;AAEtC,IAAA,WAAW,GAAG,KAAK,CAAc,IAAI,GAAG,EAAE,kFAAC;;AAE3C,IAAA,UAAU,GAAG,KAAK,CAAgB,IAAI,iFAAC;;IAEvC,YAAY,GAAG,MAAM,EAAY;AAEzB,IAAA,QAAQ,GAAG,MAAM,CAAgB,IAAI,+EAAC;AAEpC,IAAA,YAAY,GAAG,QAAQ,CAAgB,MAAK;QAC7D,MAAM,GAAG,GAAkB,EAAE;AAC7B,QAAA,MAAM,IAAI,GAAG,CAAC,IAAyB,EAAE,KAAa,KAAU;AAC9D,YAAA,KAAK,MAAM,IAAI,IAAI,IAAI,EAAE;gBACvB,MAAM,WAAW,GAAG,CAAC,C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EAAA,kBAAA,EAAA,YAAA,EAAA,cAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,MAAA,EAAA,MAAA,EAAA,EAAA,SAAA,EAAA,EAAA,SAAA,EAAA,mBAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECjC1B,ygCAmCA,EAAA,MAAA,EAAA,CAAA,ouFAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDXY,aAAa,EAAA,QAAA,EAAA,SAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,MAAA,EAAA,QAAA,EAAA,WAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;4FASZ,aAAa,EAAA,UAAA,EAAA,CAAA;kBAZzB,SAAS;+BACE,SAAS,EAAA,UAAA,EACP,IAAI,EAAA,OAAA,EACP,CAAC,aAAa,CAAC,EAAA,aAAA,EAGT,iBAAiB,CAAC,QAAQ,EAAA,IAAA,EACnC;AACJ,wBAAA,IAAI,EAAE,MAAM;AACZ,wBAAA,WAAW,EAAE,mBAAmB;AACjC,qBAAA,EAAA,QAAA,EAAA,ygCAAA,EAAA,MAAA,EAAA,CAAA,ouFAAA,CAAA,EAAA;;;AE/BH;;AAEG;;;;"}
1
+ {"version":3,"file":"ids-group-ltd-ids-design-system-components-tree.mjs","sources":["../../../src/lib/components/tree/tree-label.directive.ts","../../../src/lib/components/tree/tree-trailing.directive.ts","../../../src/lib/components/tree/tree.component.ts","../../../src/lib/components/tree/tree.component.html","../../../src/lib/components/tree/ids-group-ltd-ids-design-system-components-tree.ts"],"sourcesContent":["import { Directive, TemplateRef, inject } from '@angular/core';\nimport type { TreeNode } from './tree.types';\n\n/** What a `dsTreeLabel` template is handed: the row's node, its nesting level (`0` for a root\n * node) and whether the row is selected and disabled. */\nexport interface TreeLabelContext {\n readonly $implicit: TreeNode;\n readonly node: TreeNode;\n readonly level: number;\n readonly selected: boolean;\n readonly disabled: boolean;\n}\n\n/**\n * Content drawn in place of a `ds-tree` row's label, for a label of more than one line or one\n * that mixes styles.\n *\n * ```html\n * <ds-tree [nodes]=\"layers\">\n * <ng-template dsTreeLabel let-node>\n * <span class=\"tag\">{{ tags[node.id] }}</span>\n * <span class=\"text\">{{ node.label }}</span>\n * </ng-template>\n * </ds-tree>\n * ```\n *\n * The row grows to the template's height and the label takes the width between the icon and\n * the trailing content, so an element inside it can cut its text with an ellipsis. The text the\n * template renders is the row's accessible name; a template that draws no text needs a\n * visually hidden element with the name in it. A click inside it selects the row as a click on\n * the default label does.\n */\n@Directive({\n selector: 'ng-template[dsTreeLabel]',\n standalone: true,\n})\nexport class TreeLabelDirective {\n readonly template = inject<TemplateRef<TreeLabelContext>>(TemplateRef);\n\n static ngTemplateContextGuard(\n _directive: TreeLabelDirective,\n _context: unknown,\n ): _context is TreeLabelContext {\n return true;\n }\n}\n","import { Directive, TemplateRef, inject } from '@angular/core';\nimport type { TreeNode } from './tree.types';\n\n/** What a `dsTreeTrailing` template is handed: the row's node, as `$implicit` and again as `node`. */\nexport interface TreeTrailingContext {\n readonly $implicit: TreeNode;\n readonly node: TreeNode;\n}\n\n/**\n * Content drawn at the end of every `ds-tree` row: a badge, a count, a small icon button.\n *\n * ```html\n * <ds-tree [nodes]=\"layers\">\n * <ng-template dsTreeTrailing let-node>\n * <ds-badge size=\"sm\">{{ node.id }}</ds-badge>\n * </ng-template>\n * </ds-tree>\n * ```\n *\n * A click inside it neither selects nor toggles the row. Its controls are tab stops only on\n * the focused row: Tab from that row reaches them, and the other rows' controls stay out of\n * the tab order.\n */\n@Directive({\n selector: 'ng-template[dsTreeTrailing]',\n standalone: true,\n})\nexport class TreeTrailingDirective {\n readonly template = inject<TemplateRef<TreeTrailingContext>>(TemplateRef);\n\n static ngTemplateContextGuard(\n _directive: TreeTrailingDirective,\n _context: unknown,\n ): _context is TreeTrailingContext {\n return true;\n }\n}\n","import {\n Component,\n ElementRef,\n ViewEncapsulation,\n afterEveryRender,\n computed,\n contentChild,\n inject,\n input,\n model,\n output,\n signal,\n} from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { IconComponent } from '@ids-group-ltd/ids-design-system/icons';\nimport { TreeLabelDirective } from './tree-label.directive';\nimport { TreeTrailingDirective } from './tree-trailing.directive';\nimport type { TreeNode, TreeSelection } from './tree.types';\n\ninterface VisibleNode {\n node: TreeNode;\n level: number;\n hasChildren: boolean;\n expanded: boolean;\n}\n\nconst FOCUSABLE =\n 'a[href], button, input, select, textarea, [tabindex]:not([tabindex=\"-1\"])';\nconst PARKED_TABINDEX = 'data-ds-tree-tabindex';\n\nlet nextId = 0;\n\n@Component({\n selector: 'ds-tree',\n standalone: true,\n imports: [IconComponent, NgTemplateOutlet],\n templateUrl: './tree.component.html',\n styleUrl: './tree.component.scss',\n encapsulation: ViewEncapsulation.Emulated,\n host: {\n role: 'tree',\n '[attr.aria-multiselectable]': \"multiple() ? 'true' : null\",\n '(keydown)': 'onKeydown($event)',\n '(pointerleave)': 'hover(null)',\n },\n})\nexport class TreeComponent {\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /** Root-level nodes; nest via `children`. */\n readonly nodes = input<readonly TreeNode[]>([]);\n /** Ids of the expanded nodes. */\n readonly expandedIds = model<Set<string>>(new Set());\n /** `'multiple'` reads and writes `selectedIds`; `'single'` reads and writes `selectedId`. */\n readonly selection = input<TreeSelection>('single');\n /** Id of the selected node, in `'single'` selection. */\n readonly selectedId = model<string | null>(null);\n /** Ids of the selected nodes, in `'multiple'` selection. */\n readonly selectedIds = model<string[]>([]);\n /** Fires with the node when a row is selected (click or Enter/Space), not when one is deselected. */\n readonly nodeSelected = output<TreeNode>();\n /** Fires with the node under the pointer or newly focused, and `null` when the pointer leaves the tree. */\n readonly nodeHover = output<TreeNode | null>();\n\n protected readonly label = contentChild(TreeLabelDirective);\n protected readonly trailing = contentChild(TreeTrailingDirective);\n protected readonly idPrefix = `ds-tree-${++nextId}`;\n\n private readonly activeId = signal<string | null>(null);\n private hoveredId: string | null = null;\n\n protected readonly multiple = computed(() => this.selection() === 'multiple');\n\n protected readonly visibleNodes = computed<VisibleNode[]>(() => {\n const out: VisibleNode[] = [];\n const walk = (list: readonly TreeNode[], level: number): void => {\n for (const node of list) {\n const hasChildren = !!node.children?.length;\n const expanded = this.isExpanded(node.id);\n out.push({ node, level, hasChildren, expanded });\n if (hasChildren && expanded) {\n walk(node.children ?? [], level + 1);\n }\n }\n };\n walk(this.nodes(), 0);\n\n return out;\n });\n\n protected readonly effectiveActiveId = computed(\n () => this.activeId() ?? this.visibleNodes()[0]?.node.id ?? null,\n );\n\n constructor() {\n // Content inside a trailing template can change without a signal of the tree changing,\n // so its tab stops are re-parked after every render.\n afterEveryRender({ write: () => this.parkTrailingTabStops() });\n }\n\n protected isExpanded(id: string): boolean {\n return this.expandedIds().has(id);\n }\n\n protected isSelected(id: string): boolean {\n return this.multiple()\n ? this.selectedIds().includes(id)\n : this.selectedId() === id;\n }\n\n protected isActive(id: string): boolean {\n return this.effectiveActiveId() === id;\n }\n\n protected onRowClick(entry: VisibleNode, event: MouseEvent): void {\n if (this.fromTrailing(event)) {\n return;\n }\n this.activate(entry, event.shiftKey || event.ctrlKey || event.metaKey);\n }\n\n protected onRowFocus(entry: VisibleNode): void {\n this.activeId.set(entry.node.id);\n this.hover(entry.node);\n }\n\n protected hover(node: TreeNode | null): void {\n const id = node?.id ?? null;\n if (id === this.hoveredId) {\n return;\n }\n this.hoveredId = id;\n this.nodeHover.emit(node);\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n if (this.fromTrailing(event)) {\n return;\n }\n const visible = this.visibleNodes();\n const index = visible.findIndex(\n (entry) => entry.node.id === this.effectiveActiveId(),\n );\n if (index < 0) {\n return;\n }\n const current = visible[index];\n switch (event.key) {\n case 'ArrowDown':\n this.moveActive(index + 1);\n break;\n case 'ArrowUp':\n this.moveActive(index - 1);\n break;\n case 'Home':\n this.moveActive(0);\n break;\n case 'End':\n this.moveActive(visible.length - 1);\n break;\n case 'ArrowRight':\n if (current.hasChildren && !current.expanded) {\n this.toggle(current.node);\n } else if (current.hasChildren) {\n this.moveActive(index + 1);\n }\n break;\n case 'ArrowLeft':\n if (current.hasChildren && current.expanded) {\n this.toggle(current.node);\n } else {\n this.moveToParent(visible, index);\n }\n break;\n case 'Enter':\n case ' ':\n if (!event.repeat) {\n this.activate(\n current,\n event.shiftKey || event.ctrlKey || event.metaKey,\n );\n }\n break;\n default:\n return;\n }\n event.preventDefault();\n }\n\n // A modified activation in multiple selection only adds or removes the node; every other\n // activation selects the node alone and toggles a parent.\n private activate(entry: VisibleNode, modified: boolean): void {\n const node = entry.node;\n if (node.disabled) {\n return;\n }\n this.activeId.set(node.id);\n if (this.multiple() && modified) {\n const ids = this.selectedIds();\n if (ids.includes(node.id)) {\n this.selectedIds.set(ids.filter((id) => id !== node.id));\n } else {\n this.selectedIds.set([...ids, node.id]);\n this.nodeSelected.emit(node);\n }\n\n return;\n }\n if (this.multiple()) {\n this.selectedIds.set([node.id]);\n } else {\n this.selectedId.set(node.id);\n }\n this.nodeSelected.emit(node);\n if (entry.hasChildren) {\n this.toggle(node);\n }\n }\n\n private toggle(node: TreeNode): void {\n if (node.disabled || !node.children?.length) {\n return;\n }\n const next = new Set(this.expandedIds());\n if (next.has(node.id)) {\n next.delete(node.id);\n } else {\n next.add(node.id);\n }\n this.expandedIds.set(next);\n }\n\n private moveActive(targetIndex: number): void {\n const visible = this.visibleNodes();\n if (targetIndex < 0 || targetIndex >= visible.length) {\n return;\n }\n this.focusNode(visible[targetIndex].node.id);\n }\n\n private moveToParent(visible: VisibleNode[], index: number): void {\n const level = visible[index].level;\n for (let i = index - 1; i >= 0; i--) {\n if (visible[i].level < level) {\n this.focusNode(visible[i].node.id);\n\n return;\n }\n }\n }\n\n private focusNode(id: string): void {\n this.activeId.set(id);\n this.host.nativeElement\n .querySelector<HTMLElement>(`[data-node-id=\"${CSS.escape(id)}\"]`)\n ?.focus();\n }\n\n private fromTrailing(event: Event): boolean {\n return (\n event.target instanceof Element && !!event.target.closest('.trailing')\n );\n }\n\n // The tree keeps one tab stop: controls in a trailing template are tabbable on the active\n // row only, and get their own tabindex back when their row becomes active.\n private parkTrailingTabStops(): void {\n const activeId = this.effectiveActiveId();\n for (const area of this.host.nativeElement.querySelectorAll('.trailing')) {\n const onActiveRow =\n area.closest('[data-node-id]')?.getAttribute('data-node-id') ===\n activeId;\n const controls = area.querySelectorAll<HTMLElement>(\n onActiveRow ? `[${PARKED_TABINDEX}]` : FOCUSABLE,\n );\n for (const control of controls) {\n if (onActiveRow) {\n const own = control.getAttribute(PARKED_TABINDEX);\n control.removeAttribute(PARKED_TABINDEX);\n if (own) {\n control.setAttribute('tabindex', own);\n } else {\n control.removeAttribute('tabindex');\n }\n } else if (!control.hasAttribute(PARKED_TABINDEX)) {\n control.setAttribute(\n PARKED_TABINDEX,\n control.getAttribute('tabindex') ?? '',\n );\n control.setAttribute('tabindex', '-1');\n }\n }\n }\n }\n}\n","@for (entry of visibleNodes(); track entry.node.id; let index = $index) {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events -- Enter and Space reach the host keydown handler, which activates the focused row -->\n <div\n class=\"row\"\n role=\"treeitem\"\n [attr.data-node-id]=\"entry.node.id\"\n [attr.aria-level]=\"entry.level + 1\"\n [attr.aria-expanded]=\"entry.hasChildren ? entry.expanded : null\"\n [attr.aria-selected]=\"isSelected(entry.node.id)\"\n [attr.aria-disabled]=\"entry.node.disabled ? 'true' : null\"\n [attr.aria-labelledby]=\"idPrefix + '-' + index\"\n [attr.aria-describedby]=\"\n trailing() ? idPrefix + '-' + index + '-trailing' : null\n \"\n [attr.tabindex]=\"isActive(entry.node.id) ? 0 : -1\"\n [class.selected]=\"isSelected(entry.node.id)\"\n [style.--_level]=\"entry.level\"\n (click)=\"onRowClick(entry, $event)\"\n (focus)=\"onRowFocus(entry)\"\n (pointerenter)=\"hover(entry.node)\">\n @if (entry.hasChildren) {\n <ds-icon\n class=\"caret\"\n [name]=\"entry.expanded ? 'chevronDown' : 'chevronRight'\"\n [size]=\"16\" />\n } @else if (!entry.node.icon) {\n <span class=\"caret-spacer\"></span>\n }\n\n @if (entry.node.icon; as icon) {\n <ds-icon\n class=\"node-icon\"\n [name]=\"icon\"\n [size]=\"16\" />\n }\n\n @if (label(); as label) {\n <span\n class=\"custom-label\"\n [id]=\"idPrefix + '-' + index\">\n <ng-container\n *ngTemplateOutlet=\"\n label.template;\n context: {\n $implicit: entry.node,\n node: entry.node,\n level: entry.level,\n selected: isSelected(entry.node.id),\n disabled: !!entry.node.disabled,\n }\n \" />\n </span>\n } @else {\n <span\n class=\"label\"\n [id]=\"idPrefix + '-' + index\">\n {{ entry.node.label }}\n </span>\n }\n\n @if (trailing(); as trailing) {\n <span\n class=\"trailing\"\n [id]=\"idPrefix + '-' + index + '-trailing'\">\n <ng-container\n *ngTemplateOutlet=\"\n trailing.template;\n context: { $implicit: entry.node, node: entry.node }\n \" />\n </span>\n }\n </div>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAaA;;;;;;;;;;;;;;;;;;AAkBG;MAKU,kBAAkB,CAAA;AACpB,IAAA,QAAQ,GAAG,MAAM,CAAgC,WAAW,CAAC;AAEtE,IAAA,OAAO,sBAAsB,CAC3B,UAA8B,EAC9B,QAAiB,EAAA;AAEjB,QAAA,OAAO,IAAI;IACb;wGARW,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;4FAAlB,kBAAkB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,0BAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;4FAAlB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAJ9B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,0BAA0B;AACpC,oBAAA,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AA,EAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,cAAA,CAAA,EAAA,CAAA,EAAA,SAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,WAAA,CAAA,EAAA,CAAA,EAAA,KAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,YAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,UAAA,CAAA,MAAA,kBAAkB,0FACf,qBAAqB,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEjElE;;AAEG;;;;"}
@@ -2375,10 +2375,19 @@ function forwardOverlayTokens(overlayRef, host, tokens) {
2375
2375
  }
2376
2376
  }
2377
2377
  }
2378
- /** `overlayY` is the panel edge pinned to the trigger, so `top` means the panel hangs BELOW it.
2378
+ /** The side of the trigger a connection pair puts the panel on. An axis decides only where the
2379
+ * pair pins opposite edges together: a side pair aligning top edges keeps `overlayY: 'top'`.
2380
+ * A pair covering the trigger falls back to `overlayY`, so `top` means it hangs BELOW.
2379
2381
  * @internal
2380
2382
  */
2381
- function overlayPlacementOf(overlayY, overlayX) {
2383
+ function overlayPlacementOf({ originX, originY, overlayX, overlayY, }) {
2384
+ const opposite = (origin, overlay) => origin !== overlay && origin !== 'center' && overlay !== 'center';
2385
+ if (opposite(originY, overlayY)) {
2386
+ return overlayY === 'top' ? 'bottom' : 'top';
2387
+ }
2388
+ if (opposite(originX, overlayX)) {
2389
+ return overlayX === 'start' ? 'right' : 'left';
2390
+ }
2382
2391
  if (overlayY === 'top') {
2383
2392
  return 'bottom';
2384
2393
  }
@@ -2390,6 +2399,23 @@ function overlayPlacementOf(overlayY, overlayX) {
2390
2399
  }
2391
2400
  return 'left';
2392
2401
  }
2402
+ // Sets `--_overlay-arrow-x/y` on the panel: the trigger's centre in the panel's padding box.
2403
+ // positionChanges skips a re-apply that only pushes the pane; the styles CDK writes do not.
2404
+ // The pane is measured, not the panel: the panel's enter animation scales it.
2405
+ /** @internal */
2406
+ function pointArrowAtHost(ref, panel, host) {
2407
+ const pane = ref.overlayElement;
2408
+ const point = () => {
2409
+ const trigger = host.getBoundingClientRect();
2410
+ const box = pane.getBoundingClientRect();
2411
+ panel.style.setProperty('--_overlay-arrow-x', `${trigger.left + trigger.width / 2 - box.left - panel.clientLeft}px`);
2412
+ panel.style.setProperty('--_overlay-arrow-y', `${trigger.top + trigger.height / 2 - box.top - panel.clientTop}px`);
2413
+ };
2414
+ const observer = new MutationObserver(point);
2415
+ observer.observe(ref.hostElement, { attributeFilter: ['style'] });
2416
+ observer.observe(pane, { attributeFilter: ['style'] });
2417
+ ref.detachments().subscribe({ complete: () => observer.disconnect() });
2418
+ }
2393
2419
  /**
2394
2420
  * Primes a `ds-overlay-pane` for its enter animation. Call right after `overlay.create()`:
2395
2421
  * CDK positions in `afterNextRender`, so the placement stamp lands before the first painted
@@ -2402,7 +2428,8 @@ function prepareOverlayEnter(overlayRef, host, positionStrategy) {
2402
2428
  forwardOverlayTokens(overlayRef, host, OVERLAY_MOTION_TOKENS);
2403
2429
  forwardOverlayTokens(overlayRef, host, DROPDOWN_PANEL_TOKENS);
2404
2430
  positionStrategy?.positionChanges.subscribe(({ connectionPair }) => {
2405
- overlayRef.overlayElement.dataset['dsPlacement'] = overlayPlacementOf(connectionPair.overlayY, connectionPair.overlayX);
2431
+ overlayRef.overlayElement.dataset['dsPlacement'] =
2432
+ overlayPlacementOf(connectionPair);
2406
2433
  });
2407
2434
  }
2408
2435
  /** Closes a non-modal overlay on a pointer press outside it, EXCEPT on its trigger. Use with `hasBackdrop: false`.
@@ -2702,5 +2729,5 @@ function createTypeAhead() {
2702
2729
  * Generated bundle index. Do not edit.
2703
2730
  */
2704
2731
 
2705
- export { CHART_GLIDE_HEAD_START_MS, CHART_HEAT_COLORS, CHART_RAMP_COLORS, CHART_RENDER_GATE_PASSED, CHART_SERIES_COLORS, CHART_SKELETON_COUNT, CHART_TOOLTIP_LINGER_MS, DS_FIELD_WARNING_KIND, DsBooleanControlValueAccessor, DsChartBase, DsChipTemplateDirective, DsControlValueAccessor, DsCreateTemplateDirective, DsEmptyTemplateDirective, DsFieldBase, DsFormControlBase, DsGroupLabelTemplateDirective, DsMessageBase, DsOptionTemplateDirective, DsPanelFooterTemplateDirective, DsPanelHeaderTemplateDirective, DsPickerTriggerDirective, DsStaticPreview, FieldClickFocusDirective, ProjectionDroppedDirective, afterTwoFrames, announceOptionCount, areaPath, bandPath, bandScale, chartColors, chartDelay, chartDwell, chartHoverDelayMs, chartOf, chartRenderGate, chartTiming, chartValueFormat, chipFit, clearOnDetach, closeOnOutsidePointer, closeOnScroll, createTypeAhead, decimationTarget, describeSeries, describeShare, dimmedBy, disposeWithLeave, domainMinOf, dropdownMinWidth, dropdownOverlay, dsAriaCurrent, dsDestination, dwellHighlight, elementWidth, focusIsInside, focusMark, focusRescue, fontsLoaded, formatPercent, formatTick, formatValue, formatWholePercent, forwardOverlayTokens, labelInterval, largestRemainder, leaveMark, leftMark, linePath, lineSegments, linearScale, listenForEscape, listenForMarkFocus, lttbDecimate, markAt, markOf, minMaxDecimate, moveFocusOutOf, needsDecimating, nextControlId, nextRovingIndex, niceDomain, overlayPlacementOf, panelClassesOf, prepareOverlayEnter, readOnHostResize, resolveBrandValue, resolveChartDefaults, resolveFieldMessage, rotationWouldFit, roundStepAtLeast, rovingMarks, scrollActiveOptionIntoView, shareOfTotal, skeletonColumnHeights, skeletonFunnelClips, skeletonLineClip, skeletonMarkCount, skeletonWaterfallSteps, staggerDelay, tickValues, trimmedText, tweenMarks, valueControlBridge, watchElementWidth };
2732
+ export { CHART_GLIDE_HEAD_START_MS, CHART_HEAT_COLORS, CHART_RAMP_COLORS, CHART_RENDER_GATE_PASSED, CHART_SERIES_COLORS, CHART_SKELETON_COUNT, CHART_TOOLTIP_LINGER_MS, DS_FIELD_WARNING_KIND, DsBooleanControlValueAccessor, DsChartBase, DsChipTemplateDirective, DsControlValueAccessor, DsCreateTemplateDirective, DsEmptyTemplateDirective, DsFieldBase, DsFormControlBase, DsGroupLabelTemplateDirective, DsMessageBase, DsOptionTemplateDirective, DsPanelFooterTemplateDirective, DsPanelHeaderTemplateDirective, DsPickerTriggerDirective, DsStaticPreview, FieldClickFocusDirective, ProjectionDroppedDirective, afterTwoFrames, announceOptionCount, areaPath, bandPath, bandScale, chartColors, chartDelay, chartDwell, chartHoverDelayMs, chartOf, chartRenderGate, chartTiming, chartValueFormat, chipFit, clearOnDetach, closeOnOutsidePointer, closeOnScroll, createTypeAhead, decimationTarget, describeSeries, describeShare, dimmedBy, disposeWithLeave, domainMinOf, dropdownMinWidth, dropdownOverlay, dsAriaCurrent, dsDestination, dwellHighlight, elementWidth, focusIsInside, focusMark, focusRescue, fontsLoaded, formatPercent, formatTick, formatValue, formatWholePercent, forwardOverlayTokens, labelInterval, largestRemainder, leaveMark, leftMark, linePath, lineSegments, linearScale, listenForEscape, listenForMarkFocus, lttbDecimate, markAt, markOf, minMaxDecimate, moveFocusOutOf, needsDecimating, nextControlId, nextRovingIndex, niceDomain, overlayPlacementOf, panelClassesOf, pointArrowAtHost, prepareOverlayEnter, readOnHostResize, resolveBrandValue, resolveChartDefaults, resolveFieldMessage, rotationWouldFit, roundStepAtLeast, rovingMarks, scrollActiveOptionIntoView, shareOfTotal, skeletonColumnHeights, skeletonFunnelClips, skeletonLineClip, skeletonMarkCount, skeletonWaterfallSteps, staggerDelay, tickValues, trimmedText, tweenMarks, valueControlBridge, watchElementWidth };
2706
2733
  //# sourceMappingURL=ids-group-ltd-ids-design-system-components.mjs.map