@star-ng/ui 0.0.0-stage → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (217) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +162 -2
  3. package/fesm2022/star-ng-ui-accordion.mjs +376 -0
  4. package/fesm2022/star-ng-ui-accordion.mjs.map +1 -0
  5. package/fesm2022/star-ng-ui-autocomplete.mjs +786 -0
  6. package/fesm2022/star-ng-ui-autocomplete.mjs.map +1 -0
  7. package/fesm2022/star-ng-ui-avatar.mjs +154 -0
  8. package/fesm2022/star-ng-ui-avatar.mjs.map +1 -0
  9. package/fesm2022/star-ng-ui-badge.mjs +153 -0
  10. package/fesm2022/star-ng-ui-badge.mjs.map +1 -0
  11. package/fesm2022/star-ng-ui-breadcrumb.mjs +199 -0
  12. package/fesm2022/star-ng-ui-breadcrumb.mjs.map +1 -0
  13. package/fesm2022/star-ng-ui-button.mjs +282 -0
  14. package/fesm2022/star-ng-ui-button.mjs.map +1 -0
  15. package/fesm2022/star-ng-ui-card.mjs +112 -0
  16. package/fesm2022/star-ng-ui-card.mjs.map +1 -0
  17. package/fesm2022/star-ng-ui-chart.mjs +1904 -0
  18. package/fesm2022/star-ng-ui-chart.mjs.map +1 -0
  19. package/fesm2022/star-ng-ui-checkbox.mjs +345 -0
  20. package/fesm2022/star-ng-ui-checkbox.mjs.map +1 -0
  21. package/fesm2022/star-ng-ui-core.mjs +484 -0
  22. package/fesm2022/star-ng-ui-core.mjs.map +1 -0
  23. package/fesm2022/star-ng-ui-data-display.mjs +1870 -0
  24. package/fesm2022/star-ng-ui-data-display.mjs.map +1 -0
  25. package/fesm2022/star-ng-ui-date-picker.mjs +2786 -0
  26. package/fesm2022/star-ng-ui-date-picker.mjs.map +1 -0
  27. package/fesm2022/star-ng-ui-dialog.mjs +948 -0
  28. package/fesm2022/star-ng-ui-dialog.mjs.map +1 -0
  29. package/fesm2022/star-ng-ui-drawer.mjs +158 -0
  30. package/fesm2022/star-ng-ui-drawer.mjs.map +1 -0
  31. package/fesm2022/star-ng-ui-editor.mjs +416 -0
  32. package/fesm2022/star-ng-ui-editor.mjs.map +1 -0
  33. package/fesm2022/star-ng-ui-field.mjs +378 -0
  34. package/fesm2022/star-ng-ui-field.mjs.map +1 -0
  35. package/fesm2022/star-ng-ui-file-upload.mjs +762 -0
  36. package/fesm2022/star-ng-ui-file-upload.mjs.map +1 -0
  37. package/fesm2022/star-ng-ui-i18n-de.mjs +179 -0
  38. package/fesm2022/star-ng-ui-i18n-de.mjs.map +1 -0
  39. package/fesm2022/star-ng-ui-i18n-es.mjs +179 -0
  40. package/fesm2022/star-ng-ui-i18n-es.mjs.map +1 -0
  41. package/fesm2022/star-ng-ui-input-group.mjs +188 -0
  42. package/fesm2022/star-ng-ui-input-group.mjs.map +1 -0
  43. package/fesm2022/star-ng-ui-input-mask.mjs +434 -0
  44. package/fesm2022/star-ng-ui-input-mask.mjs.map +1 -0
  45. package/fesm2022/star-ng-ui-input-number.mjs +691 -0
  46. package/fesm2022/star-ng-ui-input-number.mjs.map +1 -0
  47. package/fesm2022/star-ng-ui-input-otp.mjs +343 -0
  48. package/fesm2022/star-ng-ui-input-otp.mjs.map +1 -0
  49. package/fesm2022/star-ng-ui-input-tags.mjs +616 -0
  50. package/fesm2022/star-ng-ui-input-tags.mjs.map +1 -0
  51. package/fesm2022/star-ng-ui-knob.mjs +514 -0
  52. package/fesm2022/star-ng-ui-knob.mjs.map +1 -0
  53. package/fesm2022/star-ng-ui-layout.mjs +608 -0
  54. package/fesm2022/star-ng-ui-layout.mjs.map +1 -0
  55. package/fesm2022/star-ng-ui-listbox.mjs +886 -0
  56. package/fesm2022/star-ng-ui-listbox.mjs.map +1 -0
  57. package/fesm2022/star-ng-ui-media.mjs +833 -0
  58. package/fesm2022/star-ng-ui-media.mjs.map +1 -0
  59. package/fesm2022/star-ng-ui-menu.mjs +1840 -0
  60. package/fesm2022/star-ng-ui-menu.mjs.map +1 -0
  61. package/fesm2022/star-ng-ui-message.mjs +191 -0
  62. package/fesm2022/star-ng-ui-message.mjs.map +1 -0
  63. package/fesm2022/star-ng-ui-paginator.mjs +387 -0
  64. package/fesm2022/star-ng-ui-paginator.mjs.map +1 -0
  65. package/fesm2022/star-ng-ui-panel.mjs +324 -0
  66. package/fesm2022/star-ng-ui-panel.mjs.map +1 -0
  67. package/fesm2022/star-ng-ui-password.mjs +517 -0
  68. package/fesm2022/star-ng-ui-password.mjs.map +1 -0
  69. package/fesm2022/star-ng-ui-popover.mjs +241 -0
  70. package/fesm2022/star-ng-ui-popover.mjs.map +1 -0
  71. package/fesm2022/star-ng-ui-progress-bar.mjs +183 -0
  72. package/fesm2022/star-ng-ui-progress-bar.mjs.map +1 -0
  73. package/fesm2022/star-ng-ui-radio.mjs +411 -0
  74. package/fesm2022/star-ng-ui-radio.mjs.map +1 -0
  75. package/fesm2022/star-ng-ui-rating.mjs +211 -0
  76. package/fesm2022/star-ng-ui-rating.mjs.map +1 -0
  77. package/fesm2022/star-ng-ui-select-button.mjs +613 -0
  78. package/fesm2022/star-ng-ui-select-button.mjs.map +1 -0
  79. package/fesm2022/star-ng-ui-select.mjs +2547 -0
  80. package/fesm2022/star-ng-ui-select.mjs.map +1 -0
  81. package/fesm2022/star-ng-ui-skeleton.mjs +160 -0
  82. package/fesm2022/star-ng-ui-skeleton.mjs.map +1 -0
  83. package/fesm2022/star-ng-ui-slider.mjs +552 -0
  84. package/fesm2022/star-ng-ui-slider.mjs.map +1 -0
  85. package/fesm2022/star-ng-ui-spinner.mjs +148 -0
  86. package/fesm2022/star-ng-ui-spinner.mjs.map +1 -0
  87. package/fesm2022/star-ng-ui-stepper.mjs +360 -0
  88. package/fesm2022/star-ng-ui-stepper.mjs.map +1 -0
  89. package/fesm2022/star-ng-ui-table.mjs +3531 -0
  90. package/fesm2022/star-ng-ui-table.mjs.map +1 -0
  91. package/fesm2022/star-ng-ui-tabs.mjs +464 -0
  92. package/fesm2022/star-ng-ui-tabs.mjs.map +1 -0
  93. package/fesm2022/star-ng-ui-tag.mjs +129 -0
  94. package/fesm2022/star-ng-ui-tag.mjs.map +1 -0
  95. package/fesm2022/star-ng-ui-theme-switch.mjs +105 -0
  96. package/fesm2022/star-ng-ui-theme-switch.mjs.map +1 -0
  97. package/fesm2022/star-ng-ui-theme.mjs +98 -0
  98. package/fesm2022/star-ng-ui-theme.mjs.map +1 -0
  99. package/fesm2022/star-ng-ui-toast.mjs +298 -0
  100. package/fesm2022/star-ng-ui-toast.mjs.map +1 -0
  101. package/fesm2022/star-ng-ui-toggle-switch.mjs +316 -0
  102. package/fesm2022/star-ng-ui-toggle-switch.mjs.map +1 -0
  103. package/fesm2022/star-ng-ui-tooltip.mjs +297 -0
  104. package/fesm2022/star-ng-ui-tooltip.mjs.map +1 -0
  105. package/fesm2022/star-ng-ui-transloco.mjs +40 -0
  106. package/fesm2022/star-ng-ui-transloco.mjs.map +1 -0
  107. package/fesm2022/star-ng-ui-tree.mjs +1446 -0
  108. package/fesm2022/star-ng-ui-tree.mjs.map +1 -0
  109. package/fesm2022/star-ng-ui-utility.mjs +2134 -0
  110. package/fesm2022/star-ng-ui-utility.mjs.map +1 -0
  111. package/fesm2022/star-ng-ui.mjs +51 -0
  112. package/package.json +285 -3
  113. package/styles/_base.scss +70 -0
  114. package/styles/_shared.scss +2 -0
  115. package/styles/_tokens.scss +190 -0
  116. package/styles/controls/_accordion.scss +75 -0
  117. package/styles/controls/_autocomplete.scss +44 -0
  118. package/styles/controls/_avatar.scss +39 -0
  119. package/styles/controls/_breadcrumb.scss +45 -0
  120. package/styles/controls/_button.scss +137 -0
  121. package/styles/controls/_card.scss +38 -0
  122. package/styles/controls/_chart.scss +214 -0
  123. package/styles/controls/_chip.scss +51 -0
  124. package/styles/controls/_choice.scss +153 -0
  125. package/styles/controls/_data-display.scss +124 -0
  126. package/styles/controls/_date-picker.scss +300 -0
  127. package/styles/controls/_dialog.scss +123 -0
  128. package/styles/controls/_drawer.scss +118 -0
  129. package/styles/controls/_editor.scss +74 -0
  130. package/styles/controls/_field.scss +92 -0
  131. package/styles/controls/_file-upload.scss +136 -0
  132. package/styles/controls/_input-group.scss +104 -0
  133. package/styles/controls/_input-mask.scss +46 -0
  134. package/styles/controls/_input-number.scss +125 -0
  135. package/styles/controls/_knob.scss +76 -0
  136. package/styles/controls/_layout.scss +182 -0
  137. package/styles/controls/_listbox.scss +38 -0
  138. package/styles/controls/_media.scss +222 -0
  139. package/styles/controls/_menu.scss +254 -0
  140. package/styles/controls/_message.scss +48 -0
  141. package/styles/controls/_org-chart.scss +128 -0
  142. package/styles/controls/_paginator.scss +59 -0
  143. package/styles/controls/_panel.scss +83 -0
  144. package/styles/controls/_popover.scss +40 -0
  145. package/styles/controls/_progress-bar.scss +74 -0
  146. package/styles/controls/_select-button.scss +61 -0
  147. package/styles/controls/_select.scss +216 -0
  148. package/styles/controls/_skeleton.scss +43 -0
  149. package/styles/controls/_slider.scss +163 -0
  150. package/styles/controls/_spinner.scss +34 -0
  151. package/styles/controls/_stepper.scss +109 -0
  152. package/styles/controls/_table.scss +523 -0
  153. package/styles/controls/_tabs.scss +93 -0
  154. package/styles/controls/_tag.scss +84 -0
  155. package/styles/controls/_toast.scss +141 -0
  156. package/styles/controls/_tooltip.scss +14 -0
  157. package/styles/controls/_tree.scss +113 -0
  158. package/styles/controls/_utility.scss +654 -0
  159. package/styles/star-ng.css +5807 -0
  160. package/styles/star-ng.min.css +1 -0
  161. package/styles/star-ng.scss +50 -0
  162. package/theme/star-theme-first-paint.js +1 -0
  163. package/types/star-ng-ui-accordion.d.ts +82 -0
  164. package/types/star-ng-ui-autocomplete.d.ts +171 -0
  165. package/types/star-ng-ui-avatar.d.ts +43 -0
  166. package/types/star-ng-ui-badge.d.ts +46 -0
  167. package/types/star-ng-ui-breadcrumb.d.ts +39 -0
  168. package/types/star-ng-ui-button.d.ts +79 -0
  169. package/types/star-ng-ui-card.d.ts +29 -0
  170. package/types/star-ng-ui-chart.d.ts +337 -0
  171. package/types/star-ng-ui-checkbox.d.ts +92 -0
  172. package/types/star-ng-ui-core.d.ts +373 -0
  173. package/types/star-ng-ui-data-display.d.ts +438 -0
  174. package/types/star-ng-ui-date-picker.d.ts +701 -0
  175. package/types/star-ng-ui-dialog.d.ts +254 -0
  176. package/types/star-ng-ui-drawer.d.ts +29 -0
  177. package/types/star-ng-ui-editor.d.ts +96 -0
  178. package/types/star-ng-ui-field.d.ts +146 -0
  179. package/types/star-ng-ui-file-upload.d.ts +192 -0
  180. package/types/star-ng-ui-i18n-de.d.ts +7 -0
  181. package/types/star-ng-ui-i18n-es.d.ts +7 -0
  182. package/types/star-ng-ui-input-group.d.ts +58 -0
  183. package/types/star-ng-ui-input-mask.d.ts +126 -0
  184. package/types/star-ng-ui-input-number.d.ts +193 -0
  185. package/types/star-ng-ui-input-otp.d.ts +86 -0
  186. package/types/star-ng-ui-input-tags.d.ts +159 -0
  187. package/types/star-ng-ui-knob.d.ts +121 -0
  188. package/types/star-ng-ui-layout.d.ts +154 -0
  189. package/types/star-ng-ui-listbox.d.ts +170 -0
  190. package/types/star-ng-ui-media.d.ts +161 -0
  191. package/types/star-ng-ui-menu.d.ts +332 -0
  192. package/types/star-ng-ui-message.d.ts +52 -0
  193. package/types/star-ng-ui-paginator.d.ts +85 -0
  194. package/types/star-ng-ui-panel.d.ts +65 -0
  195. package/types/star-ng-ui-password.d.ts +129 -0
  196. package/types/star-ng-ui-popover.d.ts +57 -0
  197. package/types/star-ng-ui-progress-bar.d.ts +49 -0
  198. package/types/star-ng-ui-radio.d.ts +116 -0
  199. package/types/star-ng-ui-rating.d.ts +52 -0
  200. package/types/star-ng-ui-select-button.d.ts +169 -0
  201. package/types/star-ng-ui-select.d.ts +563 -0
  202. package/types/star-ng-ui-skeleton.d.ts +47 -0
  203. package/types/star-ng-ui-slider.d.ts +145 -0
  204. package/types/star-ng-ui-spinner.d.ts +29 -0
  205. package/types/star-ng-ui-stepper.d.ts +89 -0
  206. package/types/star-ng-ui-table.d.ts +885 -0
  207. package/types/star-ng-ui-tabs.d.ts +109 -0
  208. package/types/star-ng-ui-tag.d.ts +35 -0
  209. package/types/star-ng-ui-theme-switch.d.ts +36 -0
  210. package/types/star-ng-ui-theme.d.ts +95 -0
  211. package/types/star-ng-ui-toast.d.ts +84 -0
  212. package/types/star-ng-ui-toggle-switch.d.ts +81 -0
  213. package/types/star-ng-ui-tooltip.d.ts +66 -0
  214. package/types/star-ng-ui-transloco.d.ts +14 -0
  215. package/types/star-ng-ui-tree.d.ts +343 -0
  216. package/types/star-ng-ui-utility.d.ts +533 -0
  217. package/types/star-ng-ui.d.ts +51 -0
@@ -0,0 +1,1870 @@
1
+ import { _IdGenerator } from "@angular/cdk/a11y";
2
+ import { DOCUMENT, NgTemplateOutlet } from "@angular/common";
3
+ import * as i0 from "@angular/core";
4
+ import { ChangeDetectionStrategy, Component, Directive, TemplateRef, afterEveryRender, booleanAttribute, computed, contentChild, effect, inject, input, isDevMode, linkedSignal, model, numberAttribute, output, signal, untracked, viewChild } from "@angular/core";
5
+ import { STAR_UI_TEXT, optionText, readOption, starInlineKey } from "@star-ng/ui/core";
6
+ import { StarPaginator } from "@star-ng/ui/paginator";
7
+ import { flattenVisible, navigationTarget, parentsOf, rowIndexOf, scrollOffsetToReveal, stillFocusable } from "@star-ng/ui/tree";
8
+ function rowWindow(count, itemSize, scrollTop, viewportSize, bufferRows) {
9
+ if (count <= 0 || itemSize <= 0) return {
10
+ start: 0,
11
+ end: 0,
12
+ before: 0,
13
+ after: 0
14
+ };
15
+ const visible = Math.ceil(Math.max(0, viewportSize) / itemSize) + 1;
16
+ const first = Math.min(Math.max(0, Math.floor(Math.max(0, scrollTop) / itemSize)), Math.max(0, count - visible));
17
+ const start = Math.max(0, first - bufferRows);
18
+ const end = Math.min(count, first + visible + bufferRows);
19
+ return {
20
+ start,
21
+ end,
22
+ before: start * itemSize,
23
+ after: (count - end) * itemSize
24
+ };
25
+ }
26
+ function revealRowOffset(index, itemSize, scrollTop, viewportSize, headerSize) {
27
+ return scrollOffsetToReveal(index, itemSize, scrollTop, Math.max(itemSize, viewportSize - headerSize));
28
+ }
29
+ function ariaRowIndex(index) {
30
+ return index + 2;
31
+ }
32
+ function ariaRowCount(rowCount) {
33
+ return rowCount + 1;
34
+ }
35
+ const TREE_TABLE_ROW_HEIGHT = 53;
36
+ const BUFFER_ROWS = 8;
37
+ const FALLBACK_VIEWPORT = 600;
38
+ var StarTreeTable = class StarTreeTable {
39
+ text = inject(STAR_UI_TEXT);
40
+ doc = inject(DOCUMENT);
41
+ nodes = input([], ...ngDevMode ? [{ debugName: "nodes" }] : /* istanbul ignore next */ []);
42
+ columns = input.required(...ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []);
43
+ expanded = model([], ...ngDevMode ? [{ debugName: "expanded" }] : /* istanbul ignore next */ []);
44
+ ariaLabel = input(null, ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
45
+ scrollHeight = input(null, ...ngDevMode ? [{ debugName: "scrollHeight" }] : /* istanbul ignore next */ []);
46
+ virtualScroll = input(false, {
47
+ ...ngDevMode ? { debugName: "virtualScroll" } : /* istanbul ignore next */ {},
48
+ transform: booleanAttribute
49
+ });
50
+ virtualItemSize = input(TREE_TABLE_ROW_HEIGHT, {
51
+ ...ngDevMode ? { debugName: "virtualItemSize" } : /* istanbul ignore next */ {},
52
+ transform: numberAttribute
53
+ });
54
+ scroller = viewChild("scroller", ...ngDevMode ? [{ debugName: "scroller" }] : /* istanbul ignore next */ []);
55
+ header = viewChild("header", ...ngDevMode ? [{ debugName: "header" }] : /* istanbul ignore next */ []);
56
+ openKeys = computed(() => new Set(this.expanded()), ...ngDevMode ? [{ debugName: "openKeys" }] : /* istanbul ignore next */ []);
57
+ parents = computed(() => parentsOf(this.nodes()), ...ngDevMode ? [{ debugName: "parents" }] : /* istanbul ignore next */ []);
58
+ rows = computed(() => flattenVisible(this.nodes(), this.openKeys()), ...ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []);
59
+ rowIndex = computed(() => rowIndexOf(this.rows()), ...ngDevMode ? [{ debugName: "rowIndex" }] : /* istanbul ignore next */ []);
60
+ focusKey = linkedSignal({
61
+ ...ngDevMode ? { debugName: "focusKey" } : /* istanbul ignore next */ {},
62
+ source: this.rows,
63
+ computation: (rows, previous) => stillFocusable(previous?.value, this.rowIndex(), this.parents(), rows[0]?.node.key ?? null)
64
+ });
65
+ windowed = computed(() => this.virtualScroll() && !!this.scrollHeight() && this.virtualItemSize() > 0, ...ngDevMode ? [{ debugName: "windowed" }] : /* istanbul ignore next */ []);
66
+ scrollTop = signal(0, ...ngDevMode ? [{ debugName: "scrollTop" }] : /* istanbul ignore next */ []);
67
+ viewportHeight = signal(0, ...ngDevMode ? [{ debugName: "viewportHeight" }] : /* istanbul ignore next */ []);
68
+ window = computed(() => {
69
+ if (!this.windowed()) return {
70
+ start: 0,
71
+ end: this.rows().length,
72
+ before: 0,
73
+ after: 0
74
+ };
75
+ return rowWindow(this.rows().length, this.virtualItemSize(), this.scrollTop(), this.viewportHeight() || FALLBACK_VIEWPORT, BUFFER_ROWS);
76
+ }, {
77
+ ...ngDevMode ? { debugName: "window" } : /* istanbul ignore next */ {},
78
+ equal: (a, b) => a.start === b.start && a.end === b.end && a.before === b.before && a.after === b.after
79
+ });
80
+ entries = computed(() => {
81
+ const rows = this.rows();
82
+ if (!this.windowed()) return rows.map((row) => ({
83
+ row,
84
+ aria: null
85
+ }));
86
+ const { start, end } = this.window();
87
+ return rows.slice(start, end).map((row, i) => ({
88
+ row,
89
+ aria: ariaRowIndex(start + i)
90
+ }));
91
+ }, ...ngDevMode ? [{ debugName: "entries" }] : /* istanbul ignore next */ []);
92
+ activeRendered = computed(() => {
93
+ const index = this.rowIndex().get(this.focusKey() ?? "");
94
+ const { start, end } = this.window();
95
+ return index !== void 0 && index >= start && index < end;
96
+ }, ...ngDevMode ? [{ debugName: "activeRendered" }] : /* istanbul ignore next */ []);
97
+ ariaRowCount = ariaRowCount;
98
+ pendingFocus = null;
99
+ parked = false;
100
+ constructor() {
101
+ effect(() => {
102
+ const window = this.window();
103
+ this.rowIndex();
104
+ untracked(() => {
105
+ if (this.windowed()) this.parkFocus(window);
106
+ });
107
+ });
108
+ effect((onCleanup) => {
109
+ const scroller = this.scroller()?.nativeElement;
110
+ if (!this.windowed() || !scroller || typeof ResizeObserver === "undefined") return;
111
+ const observer = new ResizeObserver(() => this.syncScroll());
112
+ observer.observe(scroller);
113
+ onCleanup(() => observer.disconnect());
114
+ });
115
+ afterEveryRender({ read: () => this.syncScroll() });
116
+ afterEveryRender(() => {
117
+ this.applyPendingFocus();
118
+ if (this.parked) this.restoreParkedFocus();
119
+ });
120
+ if (isDevMode()) effect(() => {
121
+ if (this.virtualScroll() && !this.scrollHeight()) console.warn("star-tree-table: virtualScroll needs scrollHeight. Without it the table renders all rows.");
122
+ });
123
+ }
124
+ isOpen(key) {
125
+ return this.openKeys().has(key);
126
+ }
127
+ toggle(key, open = !this.isOpen(key)) {
128
+ this.expanded.update((keys) => {
129
+ if (!open) return keys.filter((k) => k !== key);
130
+ return keys.includes(key) ? keys : [...keys, key];
131
+ });
132
+ }
133
+ syncScroll() {
134
+ const scroller = this.scroller()?.nativeElement;
135
+ if (!scroller || !this.windowed()) return;
136
+ this.scrollTop.set(scroller.scrollTop);
137
+ if (scroller.clientHeight) this.viewportHeight.set(scroller.clientHeight);
138
+ }
139
+ onRowFocus(event, key) {
140
+ this.focusKey.set(key);
141
+ this.pendingFocus = null;
142
+ this.parked = false;
143
+ if (event.target === event.currentTarget && this.windowed()) this.revealRow(key);
144
+ }
145
+ focusRow(key) {
146
+ if (!key) return;
147
+ this.focusKey.set(key);
148
+ this.pendingFocus = key;
149
+ if (this.windowed()) this.revealRow(key);
150
+ queueMicrotask(() => this.applyPendingFocus());
151
+ }
152
+ revealRow(key) {
153
+ const scroller = this.scroller()?.nativeElement;
154
+ const index = this.rowIndex().get(key);
155
+ if (!scroller || index === void 0) return;
156
+ const offset = revealRowOffset(index, this.virtualItemSize(), scroller.scrollTop, scroller.clientHeight, this.header()?.nativeElement.offsetHeight ?? 0);
157
+ if (offset === null) return;
158
+ scroller.scrollTop = offset;
159
+ this.syncScroll();
160
+ }
161
+ rowElement(key) {
162
+ return this.scroller()?.nativeElement.querySelector(`tbody > tr[data-key="${CSS.escape(key)}"]`) ?? null;
163
+ }
164
+ applyPendingFocus() {
165
+ const key = this.pendingFocus;
166
+ if (key === null) return;
167
+ if (!this.rowIndex().has(key)) {
168
+ this.pendingFocus = null;
169
+ return;
170
+ }
171
+ const row = this.rowElement(key);
172
+ if (!row) return;
173
+ this.pendingFocus = null;
174
+ row.focus({ preventScroll: this.windowed() });
175
+ }
176
+ parkFocus(window) {
177
+ const scroller = this.scroller()?.nativeElement;
178
+ const active = this.doc.activeElement;
179
+ if (!scroller || !active || active === scroller || !scroller.contains(active)) return;
180
+ const key = active.closest("tbody > tr[data-key]")?.dataset["key"];
181
+ const index = key === void 0 ? void 0 : this.rowIndex().get(key);
182
+ if (index !== void 0 && index >= window.start && index < window.end) return;
183
+ this.parked = true;
184
+ scroller.focus({ preventScroll: true });
185
+ }
186
+ restoreParkedFocus() {
187
+ const scroller = this.scroller()?.nativeElement;
188
+ if (!scroller || this.doc.activeElement !== scroller) {
189
+ this.parked = false;
190
+ return;
191
+ }
192
+ const key = this.focusKey();
193
+ if (key === null) return;
194
+ this.rowElement(key)?.focus({ preventScroll: true });
195
+ }
196
+ onScrollerFocus() {
197
+ if (this.windowed() && !this.parked) this.focusRow(this.focusKey());
198
+ }
199
+ onScrollerKeydown(event) {
200
+ if (!this.windowed() || event.target !== event.currentTarget) return;
201
+ const row = this.rows()[this.rowIndex().get(this.focusKey() ?? "") ?? -1];
202
+ if (row) this.onKeydown(event, row);
203
+ }
204
+ onKeydown(event, row) {
205
+ const rows = this.rows();
206
+ const item = this.pendingFocus === null ? row : rows[this.rowIndex().get(this.pendingFocus) ?? -1] ?? row;
207
+ const index = this.rowIndex().get(item.node.key) ?? -1;
208
+ const hasChildren = !!item.node.children?.length;
209
+ const expanded = hasChildren && this.isOpen(item.node.key);
210
+ const key = starInlineKey(event);
211
+ const move = (target) => {
212
+ if (target === null) return;
213
+ event.preventDefault();
214
+ this.focusRow(target);
215
+ };
216
+ switch (key) {
217
+ case "ArrowDown":
218
+ case "ArrowUp":
219
+ case "Home":
220
+ case "End": return move(navigationTarget(rows, index, key, {
221
+ hasChildren,
222
+ expanded
223
+ }));
224
+ case "ArrowRight":
225
+ if (hasChildren) {
226
+ event.preventDefault();
227
+ if (!expanded) this.toggle(item.node.key, true);
228
+ }
229
+ return;
230
+ case "ArrowLeft":
231
+ event.preventDefault();
232
+ if (expanded) this.toggle(item.node.key, false);
233
+ else move(item.parentKey);
234
+ return;
235
+ }
236
+ }
237
+ static ɵfac = i0.ɵɵngDeclareFactory({
238
+ minVersion: "12.0.0",
239
+ version: "22.2.6",
240
+ ngImport: i0,
241
+ type: StarTreeTable,
242
+ deps: [],
243
+ target: i0.ɵɵFactoryTarget.Component
244
+ });
245
+ static ɵcmp = i0.ɵɵngDeclareComponent({
246
+ minVersion: "17.0.0",
247
+ version: "22.2.6",
248
+ type: StarTreeTable,
249
+ isStandalone: true,
250
+ selector: "star-tree-table",
251
+ inputs: {
252
+ nodes: {
253
+ classPropertyName: "nodes",
254
+ publicName: "nodes",
255
+ isSignal: true,
256
+ isRequired: false,
257
+ transformFunction: null
258
+ },
259
+ columns: {
260
+ classPropertyName: "columns",
261
+ publicName: "columns",
262
+ isSignal: true,
263
+ isRequired: true,
264
+ transformFunction: null
265
+ },
266
+ expanded: {
267
+ classPropertyName: "expanded",
268
+ publicName: "expanded",
269
+ isSignal: true,
270
+ isRequired: false,
271
+ transformFunction: null
272
+ },
273
+ ariaLabel: {
274
+ classPropertyName: "ariaLabel",
275
+ publicName: "ariaLabel",
276
+ isSignal: true,
277
+ isRequired: false,
278
+ transformFunction: null
279
+ },
280
+ scrollHeight: {
281
+ classPropertyName: "scrollHeight",
282
+ publicName: "scrollHeight",
283
+ isSignal: true,
284
+ isRequired: false,
285
+ transformFunction: null
286
+ },
287
+ virtualScroll: {
288
+ classPropertyName: "virtualScroll",
289
+ publicName: "virtualScroll",
290
+ isSignal: true,
291
+ isRequired: false,
292
+ transformFunction: null
293
+ },
294
+ virtualItemSize: {
295
+ classPropertyName: "virtualItemSize",
296
+ publicName: "virtualItemSize",
297
+ isSignal: true,
298
+ isRequired: false,
299
+ transformFunction: null
300
+ }
301
+ },
302
+ outputs: { expanded: "expandedChange" },
303
+ host: {
304
+ properties: {
305
+ "class.star-table--sticky": "!!scrollHeight()",
306
+ "class.star-table--virtual": "windowed()",
307
+ "style.--star-table-row-height.px": "windowed() ? virtualItemSize() : null"
308
+ },
309
+ classAttribute: "star-table star-tree-table"
310
+ },
311
+ viewQueries: [{
312
+ propertyName: "scroller",
313
+ first: true,
314
+ predicate: ["scroller"],
315
+ descendants: true,
316
+ isSignal: true
317
+ }, {
318
+ propertyName: "header",
319
+ first: true,
320
+ predicate: ["header"],
321
+ descendants: true,
322
+ isSignal: true
323
+ }],
324
+ ngImport: i0,
325
+ template: `
326
+ <div
327
+ #scroller
328
+ class="star-table__scroll"
329
+ [attr.role]="windowed() ? 'group' : null"
330
+ [attr.aria-label]="windowed() ? ariaLabel() : null"
331
+ [attr.tabindex]="windowed() ? (activeRendered() ? -1 : 0) : null"
332
+ [style.max-height]="scrollHeight()"
333
+ (scroll)="syncScroll()"
334
+ (focus)="onScrollerFocus()"
335
+ (blur)="parked = false"
336
+ (keydown)="onScrollerKeydown($event)"
337
+ >
338
+ <table
339
+ role="treegrid"
340
+ [attr.aria-label]="ariaLabel()"
341
+ [attr.aria-rowcount]="windowed() ? ariaRowCount(rows().length) : null"
342
+ >
343
+ <thead #header>
344
+ <tr [attr.aria-rowindex]="windowed() ? 1 : null">
345
+ @for (column of columns(); track column.field) {
346
+ <th
347
+ scope="col"
348
+ [style.width]="column.width"
349
+ [class]="'star-table__th star-table__cell--' + (column.align ?? 'start')"
350
+ >
351
+ {{ column.header }}
352
+ </th>
353
+ }
354
+ </tr>
355
+ </thead>
356
+ <tbody>
357
+ @if (window().before > 0) {
358
+ <tr class="star-table__spacer" aria-hidden="true">
359
+ <td [attr.colspan]="columns().length" [style.height.px]="window().before"></td>
360
+ </tr>
361
+ }
362
+ @for (entry of entries(); track entry.row.node.key) {
363
+ @let row = entry.row;
364
+ <tr
365
+ class="star-table__row"
366
+ [attr.aria-rowindex]="entry.aria"
367
+ [attr.aria-level]="row.level"
368
+ [attr.aria-setsize]="row.setSize"
369
+ [attr.aria-posinset]="row.position"
370
+ [attr.aria-expanded]="row.node.children?.length ? isOpen(row.node.key) : null"
371
+ [attr.tabindex]="focusKey() === row.node.key ? 0 : -1"
372
+ [attr.data-key]="row.node.key"
373
+ (keydown)="onKeydown($event, row)"
374
+ (focusin)="onRowFocus($event, row.node.key)"
375
+ >
376
+ @for (column of columns(); track column.field; let first = $first) {
377
+ <td [class]="'star-table__cell--' + (column.align ?? 'start')">
378
+ @if (first) {
379
+ <span class="star-tree-table__first" [style.--star-tree-level]="row.level - 1">
380
+ @if (row.node.children?.length) {
381
+ <button
382
+ type="button"
383
+ class="star-tree__toggle star-tree-table__toggle"
384
+ tabindex="-1"
385
+ [attr.aria-label]="
386
+ isOpen(row.node.key)
387
+ ? text.collapseItem(row.node.label)
388
+ : text.expandItem(row.node.label)
389
+ "
390
+ (click)="toggle(row.node.key)"
391
+ >
392
+ <i class="ph-bold ph-caret-right" aria-hidden="true"></i>
393
+ </button>
394
+ } @else {
395
+ <span class="star-tree__toggle star-tree__toggle--leaf"></span>
396
+ }
397
+ {{ row.node.data?.[column.field] ?? row.node.label }}
398
+ </span>
399
+ } @else {
400
+ {{ row.node.data?.[column.field] }}
401
+ }
402
+ </td>
403
+ }
404
+ </tr>
405
+ }
406
+ @if (window().after > 0) {
407
+ <tr class="star-table__spacer" aria-hidden="true">
408
+ <td [attr.colspan]="columns().length" [style.height.px]="window().after"></td>
409
+ </tr>
410
+ }
411
+ </tbody>
412
+ </table>
413
+ </div>
414
+ `,
415
+ isInline: true,
416
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
417
+ });
418
+ };
419
+ i0.ɵɵngDeclareClassMetadata({
420
+ minVersion: "12.0.0",
421
+ version: "22.2.6",
422
+ ngImport: i0,
423
+ type: StarTreeTable,
424
+ decorators: [{
425
+ type: Component,
426
+ args: [{
427
+ selector: "star-tree-table",
428
+ changeDetection: ChangeDetectionStrategy.OnPush,
429
+ host: {
430
+ class: "star-table star-tree-table",
431
+ "[class.star-table--sticky]": "!!scrollHeight()",
432
+ "[class.star-table--virtual]": "windowed()",
433
+ "[style.--star-table-row-height.px]": "windowed() ? virtualItemSize() : null"
434
+ },
435
+ template: `
436
+ <div
437
+ #scroller
438
+ class="star-table__scroll"
439
+ [attr.role]="windowed() ? 'group' : null"
440
+ [attr.aria-label]="windowed() ? ariaLabel() : null"
441
+ [attr.tabindex]="windowed() ? (activeRendered() ? -1 : 0) : null"
442
+ [style.max-height]="scrollHeight()"
443
+ (scroll)="syncScroll()"
444
+ (focus)="onScrollerFocus()"
445
+ (blur)="parked = false"
446
+ (keydown)="onScrollerKeydown($event)"
447
+ >
448
+ <table
449
+ role="treegrid"
450
+ [attr.aria-label]="ariaLabel()"
451
+ [attr.aria-rowcount]="windowed() ? ariaRowCount(rows().length) : null"
452
+ >
453
+ <thead #header>
454
+ <tr [attr.aria-rowindex]="windowed() ? 1 : null">
455
+ @for (column of columns(); track column.field) {
456
+ <th
457
+ scope="col"
458
+ [style.width]="column.width"
459
+ [class]="'star-table__th star-table__cell--' + (column.align ?? 'start')"
460
+ >
461
+ {{ column.header }}
462
+ </th>
463
+ }
464
+ </tr>
465
+ </thead>
466
+ <tbody>
467
+ @if (window().before > 0) {
468
+ <tr class="star-table__spacer" aria-hidden="true">
469
+ <td [attr.colspan]="columns().length" [style.height.px]="window().before"></td>
470
+ </tr>
471
+ }
472
+ @for (entry of entries(); track entry.row.node.key) {
473
+ @let row = entry.row;
474
+ <tr
475
+ class="star-table__row"
476
+ [attr.aria-rowindex]="entry.aria"
477
+ [attr.aria-level]="row.level"
478
+ [attr.aria-setsize]="row.setSize"
479
+ [attr.aria-posinset]="row.position"
480
+ [attr.aria-expanded]="row.node.children?.length ? isOpen(row.node.key) : null"
481
+ [attr.tabindex]="focusKey() === row.node.key ? 0 : -1"
482
+ [attr.data-key]="row.node.key"
483
+ (keydown)="onKeydown($event, row)"
484
+ (focusin)="onRowFocus($event, row.node.key)"
485
+ >
486
+ @for (column of columns(); track column.field; let first = $first) {
487
+ <td [class]="'star-table__cell--' + (column.align ?? 'start')">
488
+ @if (first) {
489
+ <span class="star-tree-table__first" [style.--star-tree-level]="row.level - 1">
490
+ @if (row.node.children?.length) {
491
+ <button
492
+ type="button"
493
+ class="star-tree__toggle star-tree-table__toggle"
494
+ tabindex="-1"
495
+ [attr.aria-label]="
496
+ isOpen(row.node.key)
497
+ ? text.collapseItem(row.node.label)
498
+ : text.expandItem(row.node.label)
499
+ "
500
+ (click)="toggle(row.node.key)"
501
+ >
502
+ <i class="ph-bold ph-caret-right" aria-hidden="true"></i>
503
+ </button>
504
+ } @else {
505
+ <span class="star-tree__toggle star-tree__toggle--leaf"></span>
506
+ }
507
+ {{ row.node.data?.[column.field] ?? row.node.label }}
508
+ </span>
509
+ } @else {
510
+ {{ row.node.data?.[column.field] }}
511
+ }
512
+ </td>
513
+ }
514
+ </tr>
515
+ }
516
+ @if (window().after > 0) {
517
+ <tr class="star-table__spacer" aria-hidden="true">
518
+ <td [attr.colspan]="columns().length" [style.height.px]="window().after"></td>
519
+ </tr>
520
+ }
521
+ </tbody>
522
+ </table>
523
+ </div>
524
+ `
525
+ }]
526
+ }],
527
+ ctorParameters: () => [],
528
+ propDecorators: {
529
+ nodes: [{
530
+ type: i0.Input,
531
+ args: [{
532
+ isSignal: true,
533
+ alias: "nodes",
534
+ required: false
535
+ }]
536
+ }],
537
+ columns: [{
538
+ type: i0.Input,
539
+ args: [{
540
+ isSignal: true,
541
+ alias: "columns",
542
+ required: true
543
+ }]
544
+ }],
545
+ expanded: [{
546
+ type: i0.Input,
547
+ args: [{
548
+ isSignal: true,
549
+ alias: "expanded",
550
+ required: false
551
+ }]
552
+ }, {
553
+ type: i0.Output,
554
+ args: ["expandedChange"]
555
+ }],
556
+ ariaLabel: [{
557
+ type: i0.Input,
558
+ args: [{
559
+ isSignal: true,
560
+ alias: "ariaLabel",
561
+ required: false
562
+ }]
563
+ }],
564
+ scrollHeight: [{
565
+ type: i0.Input,
566
+ args: [{
567
+ isSignal: true,
568
+ alias: "scrollHeight",
569
+ required: false
570
+ }]
571
+ }],
572
+ virtualScroll: [{
573
+ type: i0.Input,
574
+ args: [{
575
+ isSignal: true,
576
+ alias: "virtualScroll",
577
+ required: false
578
+ }]
579
+ }],
580
+ virtualItemSize: [{
581
+ type: i0.Input,
582
+ args: [{
583
+ isSignal: true,
584
+ alias: "virtualItemSize",
585
+ required: false
586
+ }]
587
+ }],
588
+ scroller: [{
589
+ type: i0.ViewChild,
590
+ args: ["scroller", { isSignal: true }]
591
+ }],
592
+ header: [{
593
+ type: i0.ViewChild,
594
+ args: ["header", { isSignal: true }]
595
+ }]
596
+ }
597
+ });
598
+ var StarDataViewItem = class StarDataViewItem {
599
+ starDataViewItemOf = input(null, ...ngDevMode ? [{ debugName: "starDataViewItemOf" }] : /* istanbul ignore next */ []);
600
+ template = inject(TemplateRef);
601
+ static ngTemplateContextGuard(_dir, _ctx) {
602
+ return true;
603
+ }
604
+ static ɵfac = i0.ɵɵngDeclareFactory({
605
+ minVersion: "12.0.0",
606
+ version: "22.2.6",
607
+ ngImport: i0,
608
+ type: StarDataViewItem,
609
+ deps: [],
610
+ target: i0.ɵɵFactoryTarget.Directive
611
+ });
612
+ static ɵdir = i0.ɵɵngDeclareDirective({
613
+ minVersion: "17.1.0",
614
+ version: "22.2.6",
615
+ type: StarDataViewItem,
616
+ isStandalone: true,
617
+ selector: "ng-template[starDataViewItem]",
618
+ inputs: { starDataViewItemOf: {
619
+ classPropertyName: "starDataViewItemOf",
620
+ publicName: "starDataViewItemOf",
621
+ isSignal: true,
622
+ isRequired: false,
623
+ transformFunction: null
624
+ } },
625
+ ngImport: i0
626
+ });
627
+ };
628
+ i0.ɵɵngDeclareClassMetadata({
629
+ minVersion: "12.0.0",
630
+ version: "22.2.6",
631
+ ngImport: i0,
632
+ type: StarDataViewItem,
633
+ decorators: [{
634
+ type: Directive,
635
+ args: [{ selector: "ng-template[starDataViewItem]" }]
636
+ }],
637
+ propDecorators: { starDataViewItemOf: [{
638
+ type: i0.Input,
639
+ args: [{
640
+ isSignal: true,
641
+ alias: "starDataViewItemOf",
642
+ required: false
643
+ }]
644
+ }] }
645
+ });
646
+ var StarDataView = class StarDataView {
647
+ text = inject(STAR_UI_TEXT);
648
+ layouts = [{
649
+ id: "list",
650
+ label: this.text.layoutList,
651
+ icon: "ph-bold ph-list"
652
+ }, {
653
+ id: "grid",
654
+ label: this.text.layoutGrid,
655
+ icon: "ph-bold ph-squares-four"
656
+ }];
657
+ items = input([], ...ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []);
658
+ layout = model("list", ...ngDevMode ? [{ debugName: "layout" }] : /* istanbul ignore next */ []);
659
+ paginator = input(false, {
660
+ ...ngDevMode ? { debugName: "paginator" } : /* istanbul ignore next */ {},
661
+ transform: booleanAttribute
662
+ });
663
+ rows = model(6, ...ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []);
664
+ first = model(0, ...ngDevMode ? [{ debugName: "first" }] : /* istanbul ignore next */ []);
665
+ emptyMessage = input(null, ...ngDevMode ? [{ debugName: "emptyMessage" }] : /* istanbul ignore next */ []);
666
+ itemTemplate = contentChild(StarDataViewItem, ...ngDevMode ? [{ debugName: "itemTemplate" }] : /* istanbul ignore next */ []);
667
+ pageItems = computed(() => this.paginator() ? this.items().slice(this.first(), this.first() + this.rows()) : this.items(), ...ngDevMode ? [{ debugName: "pageItems" }] : /* istanbul ignore next */ []);
668
+ static ɵfac = i0.ɵɵngDeclareFactory({
669
+ minVersion: "12.0.0",
670
+ version: "22.2.6",
671
+ ngImport: i0,
672
+ type: StarDataView,
673
+ deps: [],
674
+ target: i0.ɵɵFactoryTarget.Component
675
+ });
676
+ static ɵcmp = i0.ɵɵngDeclareComponent({
677
+ minVersion: "17.0.0",
678
+ version: "22.2.6",
679
+ type: StarDataView,
680
+ isStandalone: true,
681
+ selector: "star-data-view",
682
+ inputs: {
683
+ items: {
684
+ classPropertyName: "items",
685
+ publicName: "items",
686
+ isSignal: true,
687
+ isRequired: false,
688
+ transformFunction: null
689
+ },
690
+ layout: {
691
+ classPropertyName: "layout",
692
+ publicName: "layout",
693
+ isSignal: true,
694
+ isRequired: false,
695
+ transformFunction: null
696
+ },
697
+ paginator: {
698
+ classPropertyName: "paginator",
699
+ publicName: "paginator",
700
+ isSignal: true,
701
+ isRequired: false,
702
+ transformFunction: null
703
+ },
704
+ rows: {
705
+ classPropertyName: "rows",
706
+ publicName: "rows",
707
+ isSignal: true,
708
+ isRequired: false,
709
+ transformFunction: null
710
+ },
711
+ first: {
712
+ classPropertyName: "first",
713
+ publicName: "first",
714
+ isSignal: true,
715
+ isRequired: false,
716
+ transformFunction: null
717
+ },
718
+ emptyMessage: {
719
+ classPropertyName: "emptyMessage",
720
+ publicName: "emptyMessage",
721
+ isSignal: true,
722
+ isRequired: false,
723
+ transformFunction: null
724
+ }
725
+ },
726
+ outputs: {
727
+ layout: "layoutChange",
728
+ rows: "rowsChange",
729
+ first: "firstChange"
730
+ },
731
+ host: { classAttribute: "star-data-view" },
732
+ queries: [{
733
+ propertyName: "itemTemplate",
734
+ first: true,
735
+ predicate: StarDataViewItem,
736
+ descendants: true,
737
+ isSignal: true
738
+ }],
739
+ ngImport: i0,
740
+ template: `
741
+ <div class="star-data-view__header">
742
+ <ng-content select="[starDataViewHeader]" />
743
+ <div
744
+ class="star-segmented star-segmented--sm"
745
+ role="radiogroup"
746
+ [attr.aria-label]="text.layout"
747
+ >
748
+ @for (option of layouts; track option.id) {
749
+ <button
750
+ type="button"
751
+ role="radio"
752
+ class="star-segmented__item"
753
+ [class.star-segmented__item--on]="layout() === option.id"
754
+ [attr.aria-checked]="layout() === option.id"
755
+ [attr.aria-label]="option.label"
756
+ (click)="layout.set(option.id)"
757
+ >
758
+ <i [class]="option.icon" aria-hidden="true"></i>
759
+ </button>
760
+ }
761
+ </div>
762
+ </div>
763
+ <ul class="star-data-view__items" [class.star-data-view__items--grid]="layout() === 'grid'">
764
+ @for (item of pageItems(); track $index; let i = $index) {
765
+ <li class="star-data-view__item">
766
+ @if (itemTemplate(); as custom) {
767
+ <ng-container
768
+ *ngTemplateOutlet="
769
+ custom.template;
770
+ context: { $implicit: item, layout: layout(), index: i }
771
+ "
772
+ />
773
+ }
774
+ </li>
775
+ } @empty {
776
+ <li class="star-table__empty">
777
+ <i class="ph-bold ph-tray" aria-hidden="true"></i>
778
+ {{ emptyMessage() ?? text.noData }}
779
+ </li>
780
+ }
781
+ </ul>
782
+ @if (paginator() && items().length > rows()) {
783
+ <star-paginator
784
+ [totalRecords]="items().length"
785
+ [(first)]="first"
786
+ [(rows)]="rows"
787
+ [rowsPerPageOptions]="[]"
788
+ />
789
+ }
790
+ `,
791
+ isInline: true,
792
+ dependencies: [{
793
+ kind: "directive",
794
+ type: NgTemplateOutlet,
795
+ selector: "[ngTemplateOutlet]",
796
+ inputs: [
797
+ "ngTemplateOutletContext",
798
+ "ngTemplateOutlet",
799
+ "ngTemplateOutletInjector"
800
+ ]
801
+ }, {
802
+ kind: "component",
803
+ type: StarPaginator,
804
+ selector: "star-paginator",
805
+ inputs: [
806
+ "totalRecords",
807
+ "first",
808
+ "rows",
809
+ "rowsPerPageOptions",
810
+ "pageLinkSize",
811
+ "showCurrentPageReport",
812
+ "showFirstLast",
813
+ "ariaLabel"
814
+ ],
815
+ outputs: [
816
+ "firstChange",
817
+ "rowsChange",
818
+ "pageChange"
819
+ ]
820
+ }],
821
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
822
+ });
823
+ };
824
+ i0.ɵɵngDeclareClassMetadata({
825
+ minVersion: "12.0.0",
826
+ version: "22.2.6",
827
+ ngImport: i0,
828
+ type: StarDataView,
829
+ decorators: [{
830
+ type: Component,
831
+ args: [{
832
+ selector: "star-data-view",
833
+ imports: [NgTemplateOutlet, StarPaginator],
834
+ changeDetection: ChangeDetectionStrategy.OnPush,
835
+ host: { class: "star-data-view" },
836
+ template: `
837
+ <div class="star-data-view__header">
838
+ <ng-content select="[starDataViewHeader]" />
839
+ <div
840
+ class="star-segmented star-segmented--sm"
841
+ role="radiogroup"
842
+ [attr.aria-label]="text.layout"
843
+ >
844
+ @for (option of layouts; track option.id) {
845
+ <button
846
+ type="button"
847
+ role="radio"
848
+ class="star-segmented__item"
849
+ [class.star-segmented__item--on]="layout() === option.id"
850
+ [attr.aria-checked]="layout() === option.id"
851
+ [attr.aria-label]="option.label"
852
+ (click)="layout.set(option.id)"
853
+ >
854
+ <i [class]="option.icon" aria-hidden="true"></i>
855
+ </button>
856
+ }
857
+ </div>
858
+ </div>
859
+ <ul class="star-data-view__items" [class.star-data-view__items--grid]="layout() === 'grid'">
860
+ @for (item of pageItems(); track $index; let i = $index) {
861
+ <li class="star-data-view__item">
862
+ @if (itemTemplate(); as custom) {
863
+ <ng-container
864
+ *ngTemplateOutlet="
865
+ custom.template;
866
+ context: { $implicit: item, layout: layout(), index: i }
867
+ "
868
+ />
869
+ }
870
+ </li>
871
+ } @empty {
872
+ <li class="star-table__empty">
873
+ <i class="ph-bold ph-tray" aria-hidden="true"></i>
874
+ {{ emptyMessage() ?? text.noData }}
875
+ </li>
876
+ }
877
+ </ul>
878
+ @if (paginator() && items().length > rows()) {
879
+ <star-paginator
880
+ [totalRecords]="items().length"
881
+ [(first)]="first"
882
+ [(rows)]="rows"
883
+ [rowsPerPageOptions]="[]"
884
+ />
885
+ }
886
+ `
887
+ }]
888
+ }],
889
+ propDecorators: {
890
+ items: [{
891
+ type: i0.Input,
892
+ args: [{
893
+ isSignal: true,
894
+ alias: "items",
895
+ required: false
896
+ }]
897
+ }],
898
+ layout: [{
899
+ type: i0.Input,
900
+ args: [{
901
+ isSignal: true,
902
+ alias: "layout",
903
+ required: false
904
+ }]
905
+ }, {
906
+ type: i0.Output,
907
+ args: ["layoutChange"]
908
+ }],
909
+ paginator: [{
910
+ type: i0.Input,
911
+ args: [{
912
+ isSignal: true,
913
+ alias: "paginator",
914
+ required: false
915
+ }]
916
+ }],
917
+ rows: [{
918
+ type: i0.Input,
919
+ args: [{
920
+ isSignal: true,
921
+ alias: "rows",
922
+ required: false
923
+ }]
924
+ }, {
925
+ type: i0.Output,
926
+ args: ["rowsChange"]
927
+ }],
928
+ first: [{
929
+ type: i0.Input,
930
+ args: [{
931
+ isSignal: true,
932
+ alias: "first",
933
+ required: false
934
+ }]
935
+ }, {
936
+ type: i0.Output,
937
+ args: ["firstChange"]
938
+ }],
939
+ emptyMessage: [{
940
+ type: i0.Input,
941
+ args: [{
942
+ isSignal: true,
943
+ alias: "emptyMessage",
944
+ required: false
945
+ }]
946
+ }],
947
+ itemTemplate: [{
948
+ type: i0.ContentChild,
949
+ args: [i0.forwardRef(() => StarDataViewItem), { isSignal: true }]
950
+ }]
951
+ }
952
+ });
953
+ var StarOrderList = class StarOrderList {
954
+ text = inject(STAR_UI_TEXT);
955
+ hintId = inject(_IdGenerator).getId("star-order-hint-");
956
+ value = model([], ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
957
+ optionLabel = input(null, ...ngDevMode ? [{ debugName: "optionLabel" }] : /* istanbul ignore next */ []);
958
+ ariaLabel = input(null, ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
959
+ selected = signal(-1, ...ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []);
960
+ announcement = signal("", ...ngDevMode ? [{ debugName: "announcement" }] : /* istanbul ignore next */ []);
961
+ actions = [
962
+ {
963
+ id: "top",
964
+ label: this.text.moveTop,
965
+ icon: "ph-bold ph-caret-double-up"
966
+ },
967
+ {
968
+ id: "up",
969
+ label: this.text.moveUp,
970
+ icon: "ph-bold ph-caret-up"
971
+ },
972
+ {
973
+ id: "down",
974
+ label: this.text.moveDown,
975
+ icon: "ph-bold ph-caret-down"
976
+ },
977
+ {
978
+ id: "bottom",
979
+ label: this.text.moveBottom,
980
+ icon: "ph-bold ph-caret-double-down"
981
+ }
982
+ ];
983
+ labelOf(item) {
984
+ return optionText(item, this.optionLabel());
985
+ }
986
+ canMove(direction) {
987
+ const i = this.selected();
988
+ return direction === "top" || direction === "up" ? i > 0 : i < this.value().length - 1;
989
+ }
990
+ move(direction) {
991
+ const from = this.selected();
992
+ if (from < 0 || !this.canMove(direction)) return;
993
+ const last = this.value().length - 1;
994
+ const to = {
995
+ top: 0,
996
+ up: from - 1,
997
+ down: from + 1,
998
+ bottom: last
999
+ }[direction];
1000
+ const items = [...this.value()];
1001
+ const [item] = items.splice(from, 1);
1002
+ items.splice(to, 0, item);
1003
+ this.value.set(items);
1004
+ this.selected.set(to);
1005
+ this.announcement.set(this.text.itemPosition(this.labelOf(item), to + 1, items.length));
1006
+ }
1007
+ onKeydown(event, index) {
1008
+ const list = event.currentTarget.parentElement;
1009
+ const focusAt = (i) => queueMicrotask(() => list.children[i]?.focus());
1010
+ if (event.altKey && (event.key === "ArrowUp" || event.key === "ArrowDown")) {
1011
+ event.preventDefault();
1012
+ this.selected.set(index);
1013
+ this.move(event.key === "ArrowUp" ? "up" : "down");
1014
+ focusAt(this.selected());
1015
+ } else if (event.key === "ArrowUp" || event.key === "ArrowDown") {
1016
+ event.preventDefault();
1017
+ focusAt(Math.min(Math.max(index + (event.key === "ArrowUp" ? -1 : 1), 0), this.value().length - 1));
1018
+ }
1019
+ }
1020
+ static ɵfac = i0.ɵɵngDeclareFactory({
1021
+ minVersion: "12.0.0",
1022
+ version: "22.2.6",
1023
+ ngImport: i0,
1024
+ type: StarOrderList,
1025
+ deps: [],
1026
+ target: i0.ɵɵFactoryTarget.Component
1027
+ });
1028
+ static ɵcmp = i0.ɵɵngDeclareComponent({
1029
+ minVersion: "17.0.0",
1030
+ version: "22.2.6",
1031
+ type: StarOrderList,
1032
+ isStandalone: true,
1033
+ selector: "star-order-list",
1034
+ inputs: {
1035
+ value: {
1036
+ classPropertyName: "value",
1037
+ publicName: "value",
1038
+ isSignal: true,
1039
+ isRequired: false,
1040
+ transformFunction: null
1041
+ },
1042
+ optionLabel: {
1043
+ classPropertyName: "optionLabel",
1044
+ publicName: "optionLabel",
1045
+ isSignal: true,
1046
+ isRequired: false,
1047
+ transformFunction: null
1048
+ },
1049
+ ariaLabel: {
1050
+ classPropertyName: "ariaLabel",
1051
+ publicName: "ariaLabel",
1052
+ isSignal: true,
1053
+ isRequired: false,
1054
+ transformFunction: null
1055
+ }
1056
+ },
1057
+ outputs: { value: "valueChange" },
1058
+ host: { classAttribute: "star-order-list" },
1059
+ ngImport: i0,
1060
+ template: `
1061
+ <div class="star-order-list__buttons" role="group" [attr.aria-label]="text.moveSelectedItem">
1062
+ @for (action of actions; track action.id) {
1063
+ <button
1064
+ type="button"
1065
+ class="star-select__icon-btn star-order-list__btn"
1066
+ [attr.aria-label]="action.label"
1067
+ [disabled]="selected() < 0 || !canMove(action.id)"
1068
+ (click)="move(action.id)"
1069
+ >
1070
+ <i [class]="action.icon" aria-hidden="true"></i>
1071
+ </button>
1072
+ }
1073
+ </div>
1074
+ <ul
1075
+ class="star-listbox star-order-list__list"
1076
+ role="listbox"
1077
+ [attr.aria-label]="ariaLabel()"
1078
+ [attr.aria-describedby]="hintId"
1079
+ >
1080
+ @for (item of value(); track $index; let i = $index) {
1081
+ <li
1082
+ role="option"
1083
+ class="star-listbox__option"
1084
+ tabindex="0"
1085
+ [attr.aria-selected]="selected() === i"
1086
+ [class.star-listbox__option--selected]="selected() === i"
1087
+ (click)="selected.set(i)"
1088
+ (focus)="selected.set(i)"
1089
+ (keydown)="onKeydown($event, i)"
1090
+ >
1091
+ <i class="ph-bold ph-dots-six-vertical star-order-list__grip" aria-hidden="true"></i>
1092
+ {{ labelOf(item) }}
1093
+ </li>
1094
+ }
1095
+ </ul>
1096
+ <p class="star-sr-only" [id]="hintId">{{ text.orderListHint }}</p>
1097
+ <p class="star-sr-only" aria-live="polite">{{ announcement() }}</p>
1098
+ `,
1099
+ isInline: true,
1100
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
1101
+ });
1102
+ };
1103
+ i0.ɵɵngDeclareClassMetadata({
1104
+ minVersion: "12.0.0",
1105
+ version: "22.2.6",
1106
+ ngImport: i0,
1107
+ type: StarOrderList,
1108
+ decorators: [{
1109
+ type: Component,
1110
+ args: [{
1111
+ selector: "star-order-list",
1112
+ changeDetection: ChangeDetectionStrategy.OnPush,
1113
+ host: { class: "star-order-list" },
1114
+ template: `
1115
+ <div class="star-order-list__buttons" role="group" [attr.aria-label]="text.moveSelectedItem">
1116
+ @for (action of actions; track action.id) {
1117
+ <button
1118
+ type="button"
1119
+ class="star-select__icon-btn star-order-list__btn"
1120
+ [attr.aria-label]="action.label"
1121
+ [disabled]="selected() < 0 || !canMove(action.id)"
1122
+ (click)="move(action.id)"
1123
+ >
1124
+ <i [class]="action.icon" aria-hidden="true"></i>
1125
+ </button>
1126
+ }
1127
+ </div>
1128
+ <ul
1129
+ class="star-listbox star-order-list__list"
1130
+ role="listbox"
1131
+ [attr.aria-label]="ariaLabel()"
1132
+ [attr.aria-describedby]="hintId"
1133
+ >
1134
+ @for (item of value(); track $index; let i = $index) {
1135
+ <li
1136
+ role="option"
1137
+ class="star-listbox__option"
1138
+ tabindex="0"
1139
+ [attr.aria-selected]="selected() === i"
1140
+ [class.star-listbox__option--selected]="selected() === i"
1141
+ (click)="selected.set(i)"
1142
+ (focus)="selected.set(i)"
1143
+ (keydown)="onKeydown($event, i)"
1144
+ >
1145
+ <i class="ph-bold ph-dots-six-vertical star-order-list__grip" aria-hidden="true"></i>
1146
+ {{ labelOf(item) }}
1147
+ </li>
1148
+ }
1149
+ </ul>
1150
+ <p class="star-sr-only" [id]="hintId">{{ text.orderListHint }}</p>
1151
+ <p class="star-sr-only" aria-live="polite">{{ announcement() }}</p>
1152
+ `
1153
+ }]
1154
+ }],
1155
+ propDecorators: {
1156
+ value: [{
1157
+ type: i0.Input,
1158
+ args: [{
1159
+ isSignal: true,
1160
+ alias: "value",
1161
+ required: false
1162
+ }]
1163
+ }, {
1164
+ type: i0.Output,
1165
+ args: ["valueChange"]
1166
+ }],
1167
+ optionLabel: [{
1168
+ type: i0.Input,
1169
+ args: [{
1170
+ isSignal: true,
1171
+ alias: "optionLabel",
1172
+ required: false
1173
+ }]
1174
+ }],
1175
+ ariaLabel: [{
1176
+ type: i0.Input,
1177
+ args: [{
1178
+ isSignal: true,
1179
+ alias: "ariaLabel",
1180
+ required: false
1181
+ }]
1182
+ }]
1183
+ }
1184
+ });
1185
+ var StarPickList = class StarPickList {
1186
+ text = inject(STAR_UI_TEXT);
1187
+ idGen = inject(_IdGenerator);
1188
+ ids = {
1189
+ source: this.idGen.getId("star-pick-src-"),
1190
+ target: this.idGen.getId("star-pick-tgt-")
1191
+ };
1192
+ sides = ["source", "target"];
1193
+ source = model([], ...ngDevMode ? [{ debugName: "source" }] : /* istanbul ignore next */ []);
1194
+ target = model([], ...ngDevMode ? [{ debugName: "target" }] : /* istanbul ignore next */ []);
1195
+ optionLabel = input(null, ...ngDevMode ? [{ debugName: "optionLabel" }] : /* istanbul ignore next */ []);
1196
+ sourceHeader = input(null, ...ngDevMode ? [{ debugName: "sourceHeader" }] : /* istanbul ignore next */ []);
1197
+ targetHeader = input(null, ...ngDevMode ? [{ debugName: "targetHeader" }] : /* istanbul ignore next */ []);
1198
+ selection = signal({
1199
+ source: [],
1200
+ target: []
1201
+ }, ...ngDevMode ? [{ debugName: "selection" }] : /* istanbul ignore next */ []);
1202
+ labelOf(item) {
1203
+ return optionText(item, this.optionLabel());
1204
+ }
1205
+ picked(side) {
1206
+ return this.selection()[side];
1207
+ }
1208
+ isPicked(side, item) {
1209
+ return this.selection()[side].includes(item);
1210
+ }
1211
+ pick(side, item) {
1212
+ this.selection.update((sel) => ({
1213
+ ...sel,
1214
+ [side]: sel[side].includes(item) ? sel[side].filter((i) => i !== item) : [...sel[side], item]
1215
+ }));
1216
+ }
1217
+ transfer(from, items) {
1218
+ if (!items.length) return;
1219
+ const moving = new Set(items);
1220
+ const [fromModel, toModel] = from === "source" ? [this.source, this.target] : [this.target, this.source];
1221
+ fromModel.update((list) => list.filter((item) => !moving.has(item)));
1222
+ toModel.update((list) => [...list, ...items]);
1223
+ this.selection.update((sel) => ({
1224
+ ...sel,
1225
+ [from]: []
1226
+ }));
1227
+ }
1228
+ read(item, key) {
1229
+ return readOption(item, key);
1230
+ }
1231
+ static ɵfac = i0.ɵɵngDeclareFactory({
1232
+ minVersion: "12.0.0",
1233
+ version: "22.2.6",
1234
+ ngImport: i0,
1235
+ type: StarPickList,
1236
+ deps: [],
1237
+ target: i0.ɵɵFactoryTarget.Component
1238
+ });
1239
+ static ɵcmp = i0.ɵɵngDeclareComponent({
1240
+ minVersion: "17.0.0",
1241
+ version: "22.2.6",
1242
+ type: StarPickList,
1243
+ isStandalone: true,
1244
+ selector: "star-pick-list",
1245
+ inputs: {
1246
+ source: {
1247
+ classPropertyName: "source",
1248
+ publicName: "source",
1249
+ isSignal: true,
1250
+ isRequired: false,
1251
+ transformFunction: null
1252
+ },
1253
+ target: {
1254
+ classPropertyName: "target",
1255
+ publicName: "target",
1256
+ isSignal: true,
1257
+ isRequired: false,
1258
+ transformFunction: null
1259
+ },
1260
+ optionLabel: {
1261
+ classPropertyName: "optionLabel",
1262
+ publicName: "optionLabel",
1263
+ isSignal: true,
1264
+ isRequired: false,
1265
+ transformFunction: null
1266
+ },
1267
+ sourceHeader: {
1268
+ classPropertyName: "sourceHeader",
1269
+ publicName: "sourceHeader",
1270
+ isSignal: true,
1271
+ isRequired: false,
1272
+ transformFunction: null
1273
+ },
1274
+ targetHeader: {
1275
+ classPropertyName: "targetHeader",
1276
+ publicName: "targetHeader",
1277
+ isSignal: true,
1278
+ isRequired: false,
1279
+ transformFunction: null
1280
+ }
1281
+ },
1282
+ outputs: {
1283
+ source: "sourceChange",
1284
+ target: "targetChange"
1285
+ },
1286
+ host: { classAttribute: "star-pick-list" },
1287
+ ngImport: i0,
1288
+ template: `
1289
+ @for (side of sides; track side) {
1290
+ @let items = side === 'source' ? source() : target();
1291
+ <section class="star-pick-list__side" [attr.aria-labelledby]="ids[side]">
1292
+ <h3 class="star-pick-list__header" [id]="ids[side]">
1293
+ {{
1294
+ side === 'source'
1295
+ ? (sourceHeader() ?? text.pickListSource)
1296
+ : (targetHeader() ?? text.pickListTarget)
1297
+ }}
1298
+ <span class="star-badge star-badge--secondary star-badge--sm">{{ items.length }}</span>
1299
+ </h3>
1300
+ <div class="star-pick-list__box">
1301
+ <ul
1302
+ class="star-listbox star-pick-list__list"
1303
+ role="listbox"
1304
+ aria-multiselectable="true"
1305
+ [attr.aria-labelledby]="ids[side]"
1306
+ >
1307
+ @for (item of items; track $index; let i = $index) {
1308
+ <li
1309
+ role="option"
1310
+ class="star-listbox__option"
1311
+ tabindex="0"
1312
+ [attr.aria-selected]="isPicked(side, item)"
1313
+ [class.star-listbox__option--selected]="isPicked(side, item)"
1314
+ (click)="pick(side, item)"
1315
+ (dblclick)="transfer(side, [item])"
1316
+ (keydown.enter)="transfer(side, [item])"
1317
+ (keydown.space)="$event.preventDefault(); pick(side, item)"
1318
+ >
1319
+ {{ labelOf(item) }}
1320
+ </li>
1321
+ }
1322
+ </ul>
1323
+ <!-- Outside the listbox: a listbox may contain options and groups only. -->
1324
+ @if (!items.length) {
1325
+ <div class="star-listbox__empty star-pick-list__empty" role="presentation">
1326
+ {{ text.emptyMessage }}
1327
+ </div>
1328
+ }
1329
+ </div>
1330
+ </section>
1331
+ @if (side === 'source') {
1332
+ <div class="star-pick-list__buttons" role="group" [attr.aria-label]="text.transfer">
1333
+ <button
1334
+ type="button"
1335
+ class="star-select__icon-btn"
1336
+ [attr.aria-label]="text.moveSelectedToTarget"
1337
+ [disabled]="!picked('source').length"
1338
+ (click)="transfer('source', picked('source'))"
1339
+ >
1340
+ <i class="ph-bold ph-caret-right star-icon-mirror" aria-hidden="true"></i>
1341
+ </button>
1342
+ <button
1343
+ type="button"
1344
+ class="star-select__icon-btn"
1345
+ [attr.aria-label]="text.moveAllToTarget"
1346
+ [disabled]="!source().length"
1347
+ (click)="transfer('source', source())"
1348
+ >
1349
+ <i class="ph-bold ph-caret-double-right star-icon-mirror" aria-hidden="true"></i>
1350
+ </button>
1351
+ <button
1352
+ type="button"
1353
+ class="star-select__icon-btn"
1354
+ [attr.aria-label]="text.moveSelectedToSource"
1355
+ [disabled]="!picked('target').length"
1356
+ (click)="transfer('target', picked('target'))"
1357
+ >
1358
+ <i class="ph-bold ph-caret-left star-icon-mirror" aria-hidden="true"></i>
1359
+ </button>
1360
+ <button
1361
+ type="button"
1362
+ class="star-select__icon-btn"
1363
+ [attr.aria-label]="text.moveAllToSource"
1364
+ [disabled]="!target().length"
1365
+ (click)="transfer('target', target())"
1366
+ >
1367
+ <i class="ph-bold ph-caret-double-left star-icon-mirror" aria-hidden="true"></i>
1368
+ </button>
1369
+ </div>
1370
+ }
1371
+ }
1372
+ `,
1373
+ isInline: true,
1374
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
1375
+ });
1376
+ };
1377
+ i0.ɵɵngDeclareClassMetadata({
1378
+ minVersion: "12.0.0",
1379
+ version: "22.2.6",
1380
+ ngImport: i0,
1381
+ type: StarPickList,
1382
+ decorators: [{
1383
+ type: Component,
1384
+ args: [{
1385
+ selector: "star-pick-list",
1386
+ changeDetection: ChangeDetectionStrategy.OnPush,
1387
+ host: { class: "star-pick-list" },
1388
+ template: `
1389
+ @for (side of sides; track side) {
1390
+ @let items = side === 'source' ? source() : target();
1391
+ <section class="star-pick-list__side" [attr.aria-labelledby]="ids[side]">
1392
+ <h3 class="star-pick-list__header" [id]="ids[side]">
1393
+ {{
1394
+ side === 'source'
1395
+ ? (sourceHeader() ?? text.pickListSource)
1396
+ : (targetHeader() ?? text.pickListTarget)
1397
+ }}
1398
+ <span class="star-badge star-badge--secondary star-badge--sm">{{ items.length }}</span>
1399
+ </h3>
1400
+ <div class="star-pick-list__box">
1401
+ <ul
1402
+ class="star-listbox star-pick-list__list"
1403
+ role="listbox"
1404
+ aria-multiselectable="true"
1405
+ [attr.aria-labelledby]="ids[side]"
1406
+ >
1407
+ @for (item of items; track $index; let i = $index) {
1408
+ <li
1409
+ role="option"
1410
+ class="star-listbox__option"
1411
+ tabindex="0"
1412
+ [attr.aria-selected]="isPicked(side, item)"
1413
+ [class.star-listbox__option--selected]="isPicked(side, item)"
1414
+ (click)="pick(side, item)"
1415
+ (dblclick)="transfer(side, [item])"
1416
+ (keydown.enter)="transfer(side, [item])"
1417
+ (keydown.space)="$event.preventDefault(); pick(side, item)"
1418
+ >
1419
+ {{ labelOf(item) }}
1420
+ </li>
1421
+ }
1422
+ </ul>
1423
+ <!-- Outside the listbox: a listbox may contain options and groups only. -->
1424
+ @if (!items.length) {
1425
+ <div class="star-listbox__empty star-pick-list__empty" role="presentation">
1426
+ {{ text.emptyMessage }}
1427
+ </div>
1428
+ }
1429
+ </div>
1430
+ </section>
1431
+ @if (side === 'source') {
1432
+ <div class="star-pick-list__buttons" role="group" [attr.aria-label]="text.transfer">
1433
+ <button
1434
+ type="button"
1435
+ class="star-select__icon-btn"
1436
+ [attr.aria-label]="text.moveSelectedToTarget"
1437
+ [disabled]="!picked('source').length"
1438
+ (click)="transfer('source', picked('source'))"
1439
+ >
1440
+ <i class="ph-bold ph-caret-right star-icon-mirror" aria-hidden="true"></i>
1441
+ </button>
1442
+ <button
1443
+ type="button"
1444
+ class="star-select__icon-btn"
1445
+ [attr.aria-label]="text.moveAllToTarget"
1446
+ [disabled]="!source().length"
1447
+ (click)="transfer('source', source())"
1448
+ >
1449
+ <i class="ph-bold ph-caret-double-right star-icon-mirror" aria-hidden="true"></i>
1450
+ </button>
1451
+ <button
1452
+ type="button"
1453
+ class="star-select__icon-btn"
1454
+ [attr.aria-label]="text.moveSelectedToSource"
1455
+ [disabled]="!picked('target').length"
1456
+ (click)="transfer('target', picked('target'))"
1457
+ >
1458
+ <i class="ph-bold ph-caret-left star-icon-mirror" aria-hidden="true"></i>
1459
+ </button>
1460
+ <button
1461
+ type="button"
1462
+ class="star-select__icon-btn"
1463
+ [attr.aria-label]="text.moveAllToSource"
1464
+ [disabled]="!target().length"
1465
+ (click)="transfer('target', target())"
1466
+ >
1467
+ <i class="ph-bold ph-caret-double-left star-icon-mirror" aria-hidden="true"></i>
1468
+ </button>
1469
+ </div>
1470
+ }
1471
+ }
1472
+ `
1473
+ }]
1474
+ }],
1475
+ propDecorators: {
1476
+ source: [{
1477
+ type: i0.Input,
1478
+ args: [{
1479
+ isSignal: true,
1480
+ alias: "source",
1481
+ required: false
1482
+ }]
1483
+ }, {
1484
+ type: i0.Output,
1485
+ args: ["sourceChange"]
1486
+ }],
1487
+ target: [{
1488
+ type: i0.Input,
1489
+ args: [{
1490
+ isSignal: true,
1491
+ alias: "target",
1492
+ required: false
1493
+ }]
1494
+ }, {
1495
+ type: i0.Output,
1496
+ args: ["targetChange"]
1497
+ }],
1498
+ optionLabel: [{
1499
+ type: i0.Input,
1500
+ args: [{
1501
+ isSignal: true,
1502
+ alias: "optionLabel",
1503
+ required: false
1504
+ }]
1505
+ }],
1506
+ sourceHeader: [{
1507
+ type: i0.Input,
1508
+ args: [{
1509
+ isSignal: true,
1510
+ alias: "sourceHeader",
1511
+ required: false
1512
+ }]
1513
+ }],
1514
+ targetHeader: [{
1515
+ type: i0.Input,
1516
+ args: [{
1517
+ isSignal: true,
1518
+ alias: "targetHeader",
1519
+ required: false
1520
+ }]
1521
+ }]
1522
+ }
1523
+ });
1524
+ var StarOrgNodeTemplate = class StarOrgNodeTemplate {
1525
+ template = inject(TemplateRef);
1526
+ static ngTemplateContextGuard(_dir, _ctx) {
1527
+ return true;
1528
+ }
1529
+ static ɵfac = i0.ɵɵngDeclareFactory({
1530
+ minVersion: "12.0.0",
1531
+ version: "22.2.6",
1532
+ ngImport: i0,
1533
+ type: StarOrgNodeTemplate,
1534
+ deps: [],
1535
+ target: i0.ɵɵFactoryTarget.Directive
1536
+ });
1537
+ static ɵdir = i0.ɵɵngDeclareDirective({
1538
+ minVersion: "14.0.0",
1539
+ version: "22.2.6",
1540
+ type: StarOrgNodeTemplate,
1541
+ isStandalone: true,
1542
+ selector: "ng-template[starOrgNode]",
1543
+ ngImport: i0
1544
+ });
1545
+ };
1546
+ i0.ɵɵngDeclareClassMetadata({
1547
+ minVersion: "12.0.0",
1548
+ version: "22.2.6",
1549
+ ngImport: i0,
1550
+ type: StarOrgNodeTemplate,
1551
+ decorators: [{
1552
+ type: Directive,
1553
+ args: [{ selector: "ng-template[starOrgNode]" }]
1554
+ }]
1555
+ });
1556
+ var StarOrgChart = class StarOrgChart {
1557
+ text = inject(STAR_UI_TEXT);
1558
+ value = input.required(...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
1559
+ ariaLabel = input(null, ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
1560
+ collapsedKeys = model([], ...ngDevMode ? [{ debugName: "collapsedKeys" }] : /* istanbul ignore next */ []);
1561
+ selectable = input(false, {
1562
+ ...ngDevMode ? { debugName: "selectable" } : /* istanbul ignore next */ {},
1563
+ transform: (value) => value === "" || value
1564
+ });
1565
+ selectedKey = model(null, ...ngDevMode ? [{ debugName: "selectedKey" }] : /* istanbul ignore next */ []);
1566
+ nodeSelect = output();
1567
+ nodeTemplate = contentChild(StarOrgNodeTemplate, ...ngDevMode ? [{ debugName: "nodeTemplate" }] : /* istanbul ignore next */ []);
1568
+ isCollapsed(node) {
1569
+ return this.collapsedKeys().includes(node.key);
1570
+ }
1571
+ toggle(node) {
1572
+ this.collapsedKeys.update((keys) => keys.includes(node.key) ? keys.filter((key) => key !== node.key) : [...keys, node.key]);
1573
+ }
1574
+ select(node) {
1575
+ this.selectedKey.set(node.key);
1576
+ this.nodeSelect.emit(node);
1577
+ }
1578
+ static ɵfac = i0.ɵɵngDeclareFactory({
1579
+ minVersion: "12.0.0",
1580
+ version: "22.2.6",
1581
+ ngImport: i0,
1582
+ type: StarOrgChart,
1583
+ deps: [],
1584
+ target: i0.ɵɵFactoryTarget.Component
1585
+ });
1586
+ static ɵcmp = i0.ɵɵngDeclareComponent({
1587
+ minVersion: "17.0.0",
1588
+ version: "22.2.6",
1589
+ type: StarOrgChart,
1590
+ isStandalone: true,
1591
+ selector: "star-org-chart",
1592
+ inputs: {
1593
+ value: {
1594
+ classPropertyName: "value",
1595
+ publicName: "value",
1596
+ isSignal: true,
1597
+ isRequired: true,
1598
+ transformFunction: null
1599
+ },
1600
+ ariaLabel: {
1601
+ classPropertyName: "ariaLabel",
1602
+ publicName: "ariaLabel",
1603
+ isSignal: true,
1604
+ isRequired: false,
1605
+ transformFunction: null
1606
+ },
1607
+ collapsedKeys: {
1608
+ classPropertyName: "collapsedKeys",
1609
+ publicName: "collapsedKeys",
1610
+ isSignal: true,
1611
+ isRequired: false,
1612
+ transformFunction: null
1613
+ },
1614
+ selectable: {
1615
+ classPropertyName: "selectable",
1616
+ publicName: "selectable",
1617
+ isSignal: true,
1618
+ isRequired: false,
1619
+ transformFunction: null
1620
+ },
1621
+ selectedKey: {
1622
+ classPropertyName: "selectedKey",
1623
+ publicName: "selectedKey",
1624
+ isSignal: true,
1625
+ isRequired: false,
1626
+ transformFunction: null
1627
+ }
1628
+ },
1629
+ outputs: {
1630
+ collapsedKeys: "collapsedKeysChange",
1631
+ selectedKey: "selectedKeyChange",
1632
+ nodeSelect: "nodeSelect"
1633
+ },
1634
+ host: { classAttribute: "star-org" },
1635
+ queries: [{
1636
+ propertyName: "nodeTemplate",
1637
+ first: true,
1638
+ predicate: StarOrgNodeTemplate,
1639
+ descendants: true,
1640
+ isSignal: true
1641
+ }],
1642
+ ngImport: i0,
1643
+ template: `
1644
+ <div class="star-org__scroll">
1645
+ <ul class="star-org__level star-org__level--root" [attr.aria-label]="ariaLabel()">
1646
+ <ng-container *ngTemplateOutlet="branch; context: { $implicit: value(), level: 0 }" />
1647
+ </ul>
1648
+ </div>
1649
+
1650
+ <ng-template #branch let-node let-level="level">
1651
+ <li class="star-org__branch">
1652
+ <div
1653
+ class="star-org__node"
1654
+ [class.star-org__node--selected]="selectedKey() === node.key"
1655
+ [class.star-org__node--parent]="!!node.children?.length && !isCollapsed(node)"
1656
+ >
1657
+ @if (selectable()) {
1658
+ <button
1659
+ type="button"
1660
+ class="star-org__card star-org__card--button"
1661
+ [attr.aria-pressed]="selectedKey() === node.key"
1662
+ (click)="select(node)"
1663
+ >
1664
+ <ng-container *ngTemplateOutlet="content; context: { $implicit: node, level }" />
1665
+ </button>
1666
+ } @else {
1667
+ <div class="star-org__card">
1668
+ <ng-container *ngTemplateOutlet="content; context: { $implicit: node, level }" />
1669
+ </div>
1670
+ }
1671
+ @if (node.children?.length) {
1672
+ <button
1673
+ type="button"
1674
+ class="star-org__toggle"
1675
+ [attr.aria-expanded]="!isCollapsed(node)"
1676
+ [attr.aria-label]="
1677
+ (isCollapsed(node) ? text.expandRow : text.collapseRow) + ': ' + node.label
1678
+ "
1679
+ (click)="toggle(node)"
1680
+ >
1681
+ <i
1682
+ class="ph-bold"
1683
+ [class.ph-caret-down]="isCollapsed(node)"
1684
+ [class.ph-caret-up]="!isCollapsed(node)"
1685
+ aria-hidden="true"
1686
+ ></i>
1687
+ </button>
1688
+ }
1689
+ </div>
1690
+ @if (node.children?.length && !isCollapsed(node)) {
1691
+ <ul class="star-org__level">
1692
+ @for (child of node.children; track child.key) {
1693
+ <ng-container
1694
+ *ngTemplateOutlet="branch; context: { $implicit: child, level: level + 1 }"
1695
+ />
1696
+ }
1697
+ </ul>
1698
+ }
1699
+ </li>
1700
+ </ng-template>
1701
+
1702
+ <ng-template #content let-node let-level="level">
1703
+ @if (nodeTemplate(); as custom) {
1704
+ <ng-container *ngTemplateOutlet="custom.template; context: { $implicit: node, level }" />
1705
+ } @else {
1706
+ <span class="star-org__label">{{ node.label }}</span>
1707
+ @if (node.subtitle) {
1708
+ <span class="star-org__subtitle">{{ node.subtitle }}</span>
1709
+ }
1710
+ }
1711
+ </ng-template>
1712
+ `,
1713
+ isInline: true,
1714
+ dependencies: [{
1715
+ kind: "directive",
1716
+ type: NgTemplateOutlet,
1717
+ selector: "[ngTemplateOutlet]",
1718
+ inputs: [
1719
+ "ngTemplateOutletContext",
1720
+ "ngTemplateOutlet",
1721
+ "ngTemplateOutletInjector"
1722
+ ]
1723
+ }],
1724
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
1725
+ });
1726
+ };
1727
+ i0.ɵɵngDeclareClassMetadata({
1728
+ minVersion: "12.0.0",
1729
+ version: "22.2.6",
1730
+ ngImport: i0,
1731
+ type: StarOrgChart,
1732
+ decorators: [{
1733
+ type: Component,
1734
+ args: [{
1735
+ selector: "star-org-chart",
1736
+ imports: [NgTemplateOutlet],
1737
+ changeDetection: ChangeDetectionStrategy.OnPush,
1738
+ host: { class: "star-org" },
1739
+ template: `
1740
+ <div class="star-org__scroll">
1741
+ <ul class="star-org__level star-org__level--root" [attr.aria-label]="ariaLabel()">
1742
+ <ng-container *ngTemplateOutlet="branch; context: { $implicit: value(), level: 0 }" />
1743
+ </ul>
1744
+ </div>
1745
+
1746
+ <ng-template #branch let-node let-level="level">
1747
+ <li class="star-org__branch">
1748
+ <div
1749
+ class="star-org__node"
1750
+ [class.star-org__node--selected]="selectedKey() === node.key"
1751
+ [class.star-org__node--parent]="!!node.children?.length && !isCollapsed(node)"
1752
+ >
1753
+ @if (selectable()) {
1754
+ <button
1755
+ type="button"
1756
+ class="star-org__card star-org__card--button"
1757
+ [attr.aria-pressed]="selectedKey() === node.key"
1758
+ (click)="select(node)"
1759
+ >
1760
+ <ng-container *ngTemplateOutlet="content; context: { $implicit: node, level }" />
1761
+ </button>
1762
+ } @else {
1763
+ <div class="star-org__card">
1764
+ <ng-container *ngTemplateOutlet="content; context: { $implicit: node, level }" />
1765
+ </div>
1766
+ }
1767
+ @if (node.children?.length) {
1768
+ <button
1769
+ type="button"
1770
+ class="star-org__toggle"
1771
+ [attr.aria-expanded]="!isCollapsed(node)"
1772
+ [attr.aria-label]="
1773
+ (isCollapsed(node) ? text.expandRow : text.collapseRow) + ': ' + node.label
1774
+ "
1775
+ (click)="toggle(node)"
1776
+ >
1777
+ <i
1778
+ class="ph-bold"
1779
+ [class.ph-caret-down]="isCollapsed(node)"
1780
+ [class.ph-caret-up]="!isCollapsed(node)"
1781
+ aria-hidden="true"
1782
+ ></i>
1783
+ </button>
1784
+ }
1785
+ </div>
1786
+ @if (node.children?.length && !isCollapsed(node)) {
1787
+ <ul class="star-org__level">
1788
+ @for (child of node.children; track child.key) {
1789
+ <ng-container
1790
+ *ngTemplateOutlet="branch; context: { $implicit: child, level: level + 1 }"
1791
+ />
1792
+ }
1793
+ </ul>
1794
+ }
1795
+ </li>
1796
+ </ng-template>
1797
+
1798
+ <ng-template #content let-node let-level="level">
1799
+ @if (nodeTemplate(); as custom) {
1800
+ <ng-container *ngTemplateOutlet="custom.template; context: { $implicit: node, level }" />
1801
+ } @else {
1802
+ <span class="star-org__label">{{ node.label }}</span>
1803
+ @if (node.subtitle) {
1804
+ <span class="star-org__subtitle">{{ node.subtitle }}</span>
1805
+ }
1806
+ }
1807
+ </ng-template>
1808
+ `
1809
+ }]
1810
+ }],
1811
+ propDecorators: {
1812
+ value: [{
1813
+ type: i0.Input,
1814
+ args: [{
1815
+ isSignal: true,
1816
+ alias: "value",
1817
+ required: true
1818
+ }]
1819
+ }],
1820
+ ariaLabel: [{
1821
+ type: i0.Input,
1822
+ args: [{
1823
+ isSignal: true,
1824
+ alias: "ariaLabel",
1825
+ required: false
1826
+ }]
1827
+ }],
1828
+ collapsedKeys: [{
1829
+ type: i0.Input,
1830
+ args: [{
1831
+ isSignal: true,
1832
+ alias: "collapsedKeys",
1833
+ required: false
1834
+ }]
1835
+ }, {
1836
+ type: i0.Output,
1837
+ args: ["collapsedKeysChange"]
1838
+ }],
1839
+ selectable: [{
1840
+ type: i0.Input,
1841
+ args: [{
1842
+ isSignal: true,
1843
+ alias: "selectable",
1844
+ required: false
1845
+ }]
1846
+ }],
1847
+ selectedKey: [{
1848
+ type: i0.Input,
1849
+ args: [{
1850
+ isSignal: true,
1851
+ alias: "selectedKey",
1852
+ required: false
1853
+ }]
1854
+ }, {
1855
+ type: i0.Output,
1856
+ args: ["selectedKeyChange"]
1857
+ }],
1858
+ nodeSelect: [{
1859
+ type: i0.Output,
1860
+ args: ["nodeSelect"]
1861
+ }],
1862
+ nodeTemplate: [{
1863
+ type: i0.ContentChild,
1864
+ args: [i0.forwardRef(() => StarOrgNodeTemplate), { isSignal: true }]
1865
+ }]
1866
+ }
1867
+ });
1868
+ export { StarDataView, StarDataViewItem, StarOrderList, StarOrgChart, StarOrgNodeTemplate, StarPickList, StarTreeTable };
1869
+
1870
+ //# sourceMappingURL=star-ng-ui-data-display.mjs.map