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