@sylwellsoftware/fray 0.2.0 → 0.3.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/README.md +79 -11
- package/dist/Components/Placeholder.d.ts +1 -1
- package/dist/Components/Placeholder.d.ts.map +1 -1
- package/dist/Components/controlUtils.d.ts.map +1 -1
- package/dist/Components/data/filterState.d.ts +38 -0
- package/dist/Components/data/filterState.d.ts.map +1 -0
- package/dist/Components/data/listview/listview.d.ts +16 -5
- package/dist/Components/data/listview/listview.d.ts.map +1 -1
- package/dist/Components/data/selectionhandler.d.ts +24 -5
- package/dist/Components/data/selectionhandler.d.ts.map +1 -1
- package/dist/Components/data/table/DataTable.d.ts +36 -30
- package/dist/Components/data/table/DataTable.d.ts.map +1 -1
- package/dist/Components/data/table/FilterPanel.d.ts +8 -1
- package/dist/Components/data/table/FilterPanel.d.ts.map +1 -1
- package/dist/Components/data/table/TableHeaderCell.d.ts.map +1 -1
- package/dist/Components/data/table/tableDataSource.d.ts +49 -0
- package/dist/Components/data/table/tableDataSource.d.ts.map +1 -0
- package/dist/Components/data/table/tableQuery.d.ts +6 -2
- package/dist/Components/data/table/tableQuery.d.ts.map +1 -1
- package/dist/Components/data/treeview/treeModel.d.ts +23 -0
- package/dist/Components/data/treeview/treeModel.d.ts.map +1 -0
- package/dist/Components/data/treeview/treeview.d.ts +1 -1
- package/dist/Components/data/treeview/treeview.d.ts.map +1 -1
- package/dist/Components/dialog/dialog.d.ts +1 -1
- package/dist/Components/dialog/dialog.d.ts.map +1 -1
- package/dist/Components/lineinputs/checkbox/Checkbox.d.ts +1 -1
- package/dist/Components/lineinputs/checkbox/Checkbox.d.ts.map +1 -1
- package/dist/Components/lineinputs/checkbox/QuadCheckbox.d.ts +2 -2
- package/dist/Components/lineinputs/checkbox/QuadCheckbox.d.ts.map +1 -1
- package/dist/Components/lineinputs/checkbox/TriCheckbox.d.ts +2 -2
- package/dist/Components/lineinputs/checkbox/TriCheckbox.d.ts.map +1 -1
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2676 -726
- package/dist/index.js.map +1 -1
- package/dist/util/filterMode.d.ts +6 -4
- package/dist/util/filterMode.d.ts.map +1 -1
- package/package.json +4 -9
- package/styles/structural.css +9 -3
- package/EXPERIMENTAL.md +0 -75
- package/dist/button-CqDGmkBt.js +0 -212
- package/dist/button-CqDGmkBt.js.map +0 -1
- package/dist/experimental.d.ts +0 -16
- package/dist/experimental.d.ts.map +0 -1
- package/dist/experimental.js +0 -1399
- package/dist/experimental.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,29 +1,69 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { C as
|
|
5
|
-
import { F as
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
import { Emitter as me } from "@sylwellsoftware/glue";
|
|
9
|
-
class ie extends b {
|
|
1
|
+
var Ye = Object.defineProperty;
|
|
2
|
+
var _e = (t, r, e) => r in t ? Ye(t, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[r] = e;
|
|
3
|
+
var s = (t, r, e) => _e(t, typeof r != "symbol" ? r + "" : r, e);
|
|
4
|
+
import { C as g, j as u, c as v, a as w, i as ie } from "./jsx-dev-runtime-DukiDpV9.js";
|
|
5
|
+
import { F as pr, b as mr, S as br, d as yr, e as gr, f as wr, h as Er, g as vr, l as Sr, s as kr } from "./jsx-dev-runtime-DukiDpV9.js";
|
|
6
|
+
import { Emitter as I, DerivedEmitter as le, FetchState as k, QueryArg as ke, LiveQuery as Xe, RestQueryHandler as Ze } from "@sylwellsoftware/glue";
|
|
7
|
+
class ze extends g {
|
|
10
8
|
render() {
|
|
11
9
|
return this.props.children ?? [];
|
|
12
10
|
}
|
|
13
11
|
}
|
|
14
|
-
|
|
12
|
+
const y = {
|
|
13
|
+
/** Deny mode: Excludes items that match the filter. */
|
|
14
|
+
Deny: "deny",
|
|
15
|
+
/** Require mode: Includes only items that match the filter. */
|
|
16
|
+
Require: "require",
|
|
17
|
+
/** Prefer mode: If there are any filter options that are set to Prefer, at least one of the preferred filter options must match. Otherwise, it is treated as Neutral. */
|
|
18
|
+
Prefer: "prefer",
|
|
19
|
+
/** Neutral mode: Does not affect the inclusion or exclusion of items. */
|
|
20
|
+
Neutral: "neutral"
|
|
21
|
+
};
|
|
22
|
+
function de(t) {
|
|
23
|
+
return Object.values(y).some((r) => r === t);
|
|
24
|
+
}
|
|
25
|
+
let et = 1;
|
|
26
|
+
function j(t, r) {
|
|
27
|
+
return r != null && String(r).length > 0 ? String(r) : `fray-${t}-${et++}`;
|
|
28
|
+
}
|
|
29
|
+
function M(t, r, e, a) {
|
|
30
|
+
if (r.valueEmitter != null)
|
|
31
|
+
return tt(r.valueEmitter, "valueEmitter"), r.valueEmitter;
|
|
32
|
+
const i = r.defaultValue ?? r.value ?? r.initialValue ?? e, n = { owner: t, purpose: a };
|
|
33
|
+
return new I(i, n);
|
|
34
|
+
}
|
|
35
|
+
function tt(t, r = "emitter") {
|
|
36
|
+
if (t == null || typeof t != "object" && typeof t != "function" || typeof Reflect.get(t, "get") != "function" || typeof Reflect.get(t, "set") != "function" || typeof Reflect.get(t, "subscribe") != "function")
|
|
37
|
+
throw new TypeError(`${r} must be an emitter`);
|
|
38
|
+
}
|
|
39
|
+
function E(t) {
|
|
40
|
+
return t.className ?? t.class ?? "";
|
|
41
|
+
}
|
|
42
|
+
function C(t, ...r) {
|
|
43
|
+
if (t != null) {
|
|
44
|
+
if (typeof t != "function") throw new TypeError("Control callback must be a function");
|
|
45
|
+
t(...r);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function fe(t, r = "options") {
|
|
49
|
+
if (!Array.isArray(t)) throw new TypeError(`${r} must be an array`);
|
|
50
|
+
}
|
|
51
|
+
function rt(t) {
|
|
52
|
+
return de(t) ? t : String(t);
|
|
53
|
+
}
|
|
54
|
+
class L extends g {
|
|
15
55
|
constructor(e = {}) {
|
|
16
|
-
var
|
|
56
|
+
var n;
|
|
17
57
|
super(e);
|
|
18
|
-
|
|
19
|
-
|
|
58
|
+
s(this, "valueEmitter");
|
|
59
|
+
s(this, "activeTabEmitter");
|
|
20
60
|
const a = e.tabs ?? [];
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
|
|
61
|
+
Ie(a);
|
|
62
|
+
const i = { ...e };
|
|
63
|
+
i.valueEmitter == null && e.activeTabEmitter != null && (i.valueEmitter = e.activeTabEmitter), i.defaultValue == null && e.initialActiveTabId != null && (i.defaultValue = e.initialActiveTabId), this.valueEmitter = M(
|
|
24
64
|
this,
|
|
25
|
-
|
|
26
|
-
((
|
|
65
|
+
i,
|
|
66
|
+
((n = a.find((o) => !o.disabled)) == null ? void 0 : n.id) ?? null,
|
|
27
67
|
"active tab"
|
|
28
68
|
), this.activeTabEmitter = this.valueEmitter;
|
|
29
69
|
}
|
|
@@ -31,62 +71,62 @@ class T extends b {
|
|
|
31
71
|
this.watch(this.valueEmitter);
|
|
32
72
|
}
|
|
33
73
|
selectTab(e, a = null) {
|
|
34
|
-
e == null || e.disabled || (this.valueEmitter.set(e.id, "tab selected"),
|
|
74
|
+
e == null || e.disabled || (this.valueEmitter.set(e.id, "tab selected"), C(this.props.onChange, e.id, a));
|
|
35
75
|
}
|
|
36
76
|
render() {
|
|
37
|
-
const { tabs: e = [], label: a = "Sections", baseId:
|
|
38
|
-
|
|
39
|
-
const
|
|
77
|
+
const { tabs: e = [], label: a = "Sections", baseId: i = "fray-tabs" } = this.props;
|
|
78
|
+
Ie(e);
|
|
79
|
+
const n = this.valueEmitter.get(), o = this.Host;
|
|
40
80
|
return /* @__PURE__ */ u(
|
|
41
|
-
|
|
81
|
+
o,
|
|
42
82
|
{
|
|
43
83
|
role: "tablist",
|
|
44
|
-
className:
|
|
84
|
+
className: E(this.props) || null,
|
|
45
85
|
"aria-label": a,
|
|
46
|
-
children: e.map((
|
|
86
|
+
children: e.map((l, d) => /* @__PURE__ */ u(
|
|
47
87
|
"button",
|
|
48
88
|
{
|
|
49
|
-
id:
|
|
89
|
+
id: qe(i, l.id),
|
|
50
90
|
type: "button",
|
|
51
91
|
role: "tab",
|
|
52
|
-
disabled: !!
|
|
92
|
+
disabled: !!l.disabled,
|
|
53
93
|
"data-part": "tab",
|
|
54
|
-
"aria-selected": Object.is(
|
|
55
|
-
"aria-controls":
|
|
56
|
-
tabIndex: Object.is(
|
|
57
|
-
onClick: (h) => this.selectTab(
|
|
58
|
-
onKeyDown: (h) => this.handleKeyDown(h,
|
|
59
|
-
children:
|
|
94
|
+
"aria-selected": Object.is(n, l.id) ? "true" : "false",
|
|
95
|
+
"aria-controls": Le(i, l.id),
|
|
96
|
+
tabIndex: Object.is(n, l.id) ? 0 : -1,
|
|
97
|
+
onClick: (h) => this.selectTab(l, h),
|
|
98
|
+
onKeyDown: (h) => this.handleKeyDown(h, d, e),
|
|
99
|
+
children: l.label ?? String(l.id)
|
|
60
100
|
},
|
|
61
|
-
String(
|
|
101
|
+
String(l.id)
|
|
62
102
|
))
|
|
63
103
|
}
|
|
64
104
|
);
|
|
65
105
|
}
|
|
66
|
-
handleKeyDown(e, a,
|
|
67
|
-
const
|
|
68
|
-
if (
|
|
69
|
-
const
|
|
106
|
+
handleKeyDown(e, a, i) {
|
|
107
|
+
const n = i.map((d, h) => ({ tab: d, tabIndex: h })).filter(({ tab: d }) => !d.disabled);
|
|
108
|
+
if (n.length === 0) return;
|
|
109
|
+
const o = Math.max(
|
|
70
110
|
0,
|
|
71
|
-
|
|
111
|
+
n.findIndex(({ tabIndex: d }) => d === a)
|
|
72
112
|
);
|
|
73
|
-
let
|
|
113
|
+
let l;
|
|
74
114
|
if (e.key === "ArrowRight" || e.key === "ArrowDown")
|
|
75
|
-
|
|
115
|
+
l = n[(o + 1) % n.length];
|
|
76
116
|
else if (e.key === "ArrowLeft" || e.key === "ArrowUp")
|
|
77
|
-
|
|
78
|
-
else if (e.key === "Home")
|
|
79
|
-
else if (e.key === "End")
|
|
117
|
+
l = n[(o - 1 + n.length) % n.length];
|
|
118
|
+
else if (e.key === "Home") l = n[0];
|
|
119
|
+
else if (e.key === "End") l = n.at(-1);
|
|
80
120
|
else return;
|
|
81
|
-
if (
|
|
82
|
-
const
|
|
83
|
-
|
|
121
|
+
if (l != null && (e.preventDefault(), this.selectTab(l.tab, e), this.dom instanceof Element)) {
|
|
122
|
+
const d = this.dom.querySelectorAll('[role="tab"]')[l.tabIndex];
|
|
123
|
+
d == null || d.focus();
|
|
84
124
|
}
|
|
85
125
|
}
|
|
86
126
|
}
|
|
87
|
-
|
|
127
|
+
s(L, "hostName", "tab-line"), s(L, "standaloneHostName", "tab-line"), s(L, "baseStyles", [
|
|
88
128
|
['& > [data-part="tab"]', ["uiline", "button"]]
|
|
89
|
-
]),
|
|
129
|
+
]), s(L, "css", v`
|
|
90
130
|
& {
|
|
91
131
|
display: flex;
|
|
92
132
|
flex-flow: row wrap;
|
|
@@ -106,62 +146,62 @@ n(T, "hostName", "tab-line"), n(T, "standaloneHostName", "tab-line"), n(T, "base
|
|
|
106
146
|
);
|
|
107
147
|
}
|
|
108
148
|
`);
|
|
109
|
-
function
|
|
110
|
-
return `${
|
|
149
|
+
function qe(t, r) {
|
|
150
|
+
return `${t}-tab-${Ve(r)}`;
|
|
111
151
|
}
|
|
112
|
-
function
|
|
113
|
-
return `${
|
|
152
|
+
function Le(t, r) {
|
|
153
|
+
return `${t}-panel-${Ve(r)}`;
|
|
114
154
|
}
|
|
115
|
-
function
|
|
116
|
-
return encodeURIComponent(String(
|
|
155
|
+
function Ve(t) {
|
|
156
|
+
return encodeURIComponent(String(t)).replaceAll("%", "-");
|
|
117
157
|
}
|
|
118
|
-
function
|
|
119
|
-
if (!Array.isArray(
|
|
120
|
-
const
|
|
121
|
-
for (const e of
|
|
158
|
+
function Ie(t) {
|
|
159
|
+
if (!Array.isArray(t)) throw new TypeError("TabLine tabs must be an array");
|
|
160
|
+
const r = /* @__PURE__ */ new Set();
|
|
161
|
+
for (const e of t) {
|
|
122
162
|
if (e == null || e.id == null) throw new TypeError("Each tab requires an id");
|
|
123
|
-
if (
|
|
124
|
-
|
|
163
|
+
if (r.has(e.id)) throw new Error(`Duplicate tab id: ${String(e.id)}`);
|
|
164
|
+
r.add(e.id);
|
|
125
165
|
}
|
|
126
166
|
}
|
|
127
|
-
class
|
|
167
|
+
class J extends g {
|
|
128
168
|
constructor(e = {}) {
|
|
129
|
-
var
|
|
169
|
+
var n;
|
|
130
170
|
super(e);
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
const a =
|
|
135
|
-
|
|
171
|
+
s(this, "valueEmitter");
|
|
172
|
+
s(this, "activeTabEmitter");
|
|
173
|
+
s(this, "baseId");
|
|
174
|
+
const a = Y(e), i = { ...e };
|
|
175
|
+
i.valueEmitter == null && e.activeTabEmitter != null && (i.valueEmitter = e.activeTabEmitter), i.defaultValue == null && e.initialActiveTabId != null && (i.defaultValue = e.initialActiveTabId), this.valueEmitter = M(
|
|
136
176
|
this,
|
|
137
|
-
|
|
138
|
-
((
|
|
177
|
+
i,
|
|
178
|
+
((n = a.find((o) => !o.disabled)) == null ? void 0 : n.id) ?? null,
|
|
139
179
|
"active tab"
|
|
140
|
-
), this.activeTabEmitter = this.valueEmitter, this.baseId =
|
|
180
|
+
), this.activeTabEmitter = this.valueEmitter, this.baseId = j("tabs", e.id);
|
|
141
181
|
}
|
|
142
182
|
initialize() {
|
|
143
183
|
var a;
|
|
144
|
-
const e =
|
|
145
|
-
e.some(({ id:
|
|
184
|
+
const e = Y(this.props);
|
|
185
|
+
e.some(({ id: i }) => Object.is(i, this.valueEmitter.get())) || this.valueEmitter.set(((a = e.find((i) => !i.disabled)) == null ? void 0 : a.id) ?? null), this.watch(this.valueEmitter);
|
|
146
186
|
}
|
|
147
187
|
setProps(e) {
|
|
148
|
-
var
|
|
188
|
+
var i;
|
|
149
189
|
super.setProps(e);
|
|
150
|
-
const a =
|
|
151
|
-
return a.some(({ id:
|
|
190
|
+
const a = Y(e);
|
|
191
|
+
return a.some(({ id: n }) => Object.is(n, this.valueEmitter.get())) || this.valueEmitter.set(((i = a.find((n) => !n.disabled)) == null ? void 0 : i.id) ?? null), this;
|
|
152
192
|
}
|
|
153
193
|
render() {
|
|
154
|
-
const e =
|
|
155
|
-
return /* @__PURE__ */
|
|
156
|
-
|
|
194
|
+
const e = Y(this.props), a = e.find(({ id: n }) => Object.is(n, this.valueEmitter.get())) ?? e.find((n) => !n.disabled) ?? null, i = this.Host;
|
|
195
|
+
return /* @__PURE__ */ w(
|
|
196
|
+
i,
|
|
157
197
|
{
|
|
158
198
|
id: this.baseId,
|
|
159
|
-
className:
|
|
199
|
+
className: E(this.props) || null,
|
|
160
200
|
children: [
|
|
161
201
|
/* @__PURE__ */ u(
|
|
162
|
-
|
|
202
|
+
L,
|
|
163
203
|
{
|
|
164
|
-
tabs: e.map(({ id:
|
|
204
|
+
tabs: e.map(({ id: n, label: o, disabled: l }) => ({ id: n, label: o, disabled: l })),
|
|
165
205
|
valueEmitter: this.valueEmitter,
|
|
166
206
|
baseId: this.baseId,
|
|
167
207
|
...this.props.label == null ? {} : { label: this.props.label },
|
|
@@ -172,10 +212,10 @@ class $ extends b {
|
|
|
172
212
|
a == null ? null : /* @__PURE__ */ u(
|
|
173
213
|
"div",
|
|
174
214
|
{
|
|
175
|
-
id:
|
|
215
|
+
id: Le(this.baseId, a.id),
|
|
176
216
|
role: "tabpanel",
|
|
177
217
|
"data-part": "content",
|
|
178
|
-
"aria-labelledby":
|
|
218
|
+
"aria-labelledby": qe(this.baseId, a.id),
|
|
179
219
|
tabIndex: 0,
|
|
180
220
|
children: a.content
|
|
181
221
|
},
|
|
@@ -186,7 +226,7 @@ class $ extends b {
|
|
|
186
226
|
);
|
|
187
227
|
}
|
|
188
228
|
}
|
|
189
|
-
|
|
229
|
+
s(J, "dependencies", [L, ze]), s(J, "hostName", "tab-panel"), s(J, "standaloneHostName", "tab-panel"), s(J, "css", v`
|
|
190
230
|
& {
|
|
191
231
|
display: flex;
|
|
192
232
|
flex-direction: column;
|
|
@@ -206,356 +246,2232 @@ n($, "dependencies", [T, ie]), n($, "hostName", "tab-panel"), n($, "standaloneHo
|
|
|
206
246
|
background: var(--fray-panel-background, var(--panel-bg, transparent));
|
|
207
247
|
}
|
|
208
248
|
`);
|
|
209
|
-
function
|
|
210
|
-
const
|
|
211
|
-
if (!Array.isArray(
|
|
212
|
-
const a = (Array.isArray(
|
|
213
|
-
if (!
|
|
214
|
-
const
|
|
249
|
+
function Y(t) {
|
|
250
|
+
const r = t.tabs ?? [];
|
|
251
|
+
if (!Array.isArray(r)) throw new TypeError("TabPanel tabs must be an array");
|
|
252
|
+
const a = (Array.isArray(t.children) ? t.children : t.children == null ? [] : [t.children]).filter((o) => ie(o) && o.type === ze).map((o, l) => {
|
|
253
|
+
if (!ie(o)) throw new TypeError("TabPanel children must be Tab nodes");
|
|
254
|
+
const d = o.props;
|
|
215
255
|
return {
|
|
216
|
-
id:
|
|
217
|
-
label:
|
|
218
|
-
disabled: !!
|
|
219
|
-
content:
|
|
256
|
+
id: d.id ?? `tab-${l + 1}`,
|
|
257
|
+
label: d.label ?? `Tab ${l + 1}`,
|
|
258
|
+
disabled: !!d.disabled,
|
|
259
|
+
content: d.children ?? []
|
|
220
260
|
};
|
|
221
|
-
}),
|
|
222
|
-
...
|
|
223
|
-
label:
|
|
224
|
-
disabled: !!
|
|
225
|
-
content:
|
|
226
|
-
})) : a,
|
|
227
|
-
for (const
|
|
228
|
-
if ((
|
|
229
|
-
if (
|
|
230
|
-
|
|
261
|
+
}), i = r.length > 0 ? r.map((o) => ({
|
|
262
|
+
...o,
|
|
263
|
+
label: o.label ?? String(o.id),
|
|
264
|
+
disabled: !!o.disabled,
|
|
265
|
+
content: o.content ?? o.component ?? []
|
|
266
|
+
})) : a, n = /* @__PURE__ */ new Set();
|
|
267
|
+
for (const o of i) {
|
|
268
|
+
if ((o == null ? void 0 : o.id) == null) throw new TypeError("Each tab requires an id");
|
|
269
|
+
if (n.has(o.id)) throw new Error(`Duplicate tab id: ${String(o.id)}`);
|
|
270
|
+
n.add(o.id);
|
|
231
271
|
}
|
|
232
|
-
return
|
|
272
|
+
return i;
|
|
233
273
|
}
|
|
234
|
-
class
|
|
274
|
+
class _ extends g {
|
|
235
275
|
constructor(e = {}) {
|
|
236
276
|
super(e);
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
this.panelId =
|
|
277
|
+
s(this, "panelId");
|
|
278
|
+
s(this, "headerId");
|
|
279
|
+
this.panelId = j("panel", e.id), this.headerId = `${this.panelId}-title`;
|
|
240
280
|
}
|
|
241
281
|
render() {
|
|
242
282
|
const {
|
|
243
283
|
header: e = null,
|
|
244
284
|
toolbar: a = null,
|
|
245
|
-
children:
|
|
246
|
-
orientation:
|
|
247
|
-
disabled:
|
|
285
|
+
children: i = [],
|
|
286
|
+
orientation: n = "vertical",
|
|
287
|
+
disabled: o = !1
|
|
248
288
|
} = this.props;
|
|
249
|
-
if (!["horizontal", "vertical"].includes(
|
|
289
|
+
if (!["horizontal", "vertical"].includes(n))
|
|
250
290
|
throw new TypeError("Panel orientation must be horizontal or vertical");
|
|
251
|
-
const
|
|
252
|
-
return /* @__PURE__ */
|
|
253
|
-
|
|
291
|
+
const l = this.Host, d = e == null ? null : /* @__PURE__ */ u("header", { "data-part": "header", children: typeof e == "string" || typeof e == "number" ? /* @__PURE__ */ u("h2", { id: this.headerId, children: e }) : /* @__PURE__ */ u("div", { id: this.headerId, children: e }) });
|
|
292
|
+
return /* @__PURE__ */ w(
|
|
293
|
+
l,
|
|
254
294
|
{
|
|
255
295
|
id: this.panelId,
|
|
256
296
|
role: e == null ? null : "region",
|
|
257
|
-
className:
|
|
258
|
-
"data-orientation":
|
|
259
|
-
"data-disabled":
|
|
260
|
-
"aria-disabled":
|
|
297
|
+
className: E(this.props) || null,
|
|
298
|
+
"data-orientation": n,
|
|
299
|
+
"data-disabled": o ? "" : null,
|
|
300
|
+
"aria-disabled": o ? "true" : null,
|
|
261
301
|
"aria-labelledby": e == null ? null : this.headerId,
|
|
262
302
|
children: [
|
|
263
|
-
|
|
303
|
+
d,
|
|
264
304
|
a,
|
|
265
|
-
/* @__PURE__ */ u("div", { "data-part": "content", "data-orientation":
|
|
305
|
+
/* @__PURE__ */ u("div", { "data-part": "content", "data-orientation": n, children: i })
|
|
306
|
+
]
|
|
307
|
+
}
|
|
308
|
+
);
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
s(_, "hostName", "panel"), s(_, "standaloneHostName", "layout-panel"), s(_, "baseStyles", [
|
|
312
|
+
["&", ["panel"]],
|
|
313
|
+
['& > [data-part="header"]', ["sectionheader"]]
|
|
314
|
+
]), s(_, "css", v`
|
|
315
|
+
& {
|
|
316
|
+
display: flex;
|
|
317
|
+
flex-direction: column;
|
|
318
|
+
overflow: auto;
|
|
319
|
+
flex: 0 0 auto;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
& > [data-part="header"] h2 {
|
|
323
|
+
margin: 0;
|
|
324
|
+
font: inherit;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
& > [data-part="header"] {
|
|
328
|
+
background: var(
|
|
329
|
+
--fray-panel-header-background,
|
|
330
|
+
var(--fray-section-header-background, var(--fray-header-background))
|
|
331
|
+
);
|
|
332
|
+
color: var(
|
|
333
|
+
--fray-panel-header-color,
|
|
334
|
+
var(--fray-section-header-color, var(--fray-header-color))
|
|
335
|
+
);
|
|
336
|
+
border: var(--fray-section-header-border, var(--fray-header-border));
|
|
337
|
+
box-shadow: var(--fray-section-header-shadow, var(--fray-header-shadow));
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
& > [data-part="content"] {
|
|
341
|
+
display: flex;
|
|
342
|
+
flex: 1;
|
|
343
|
+
overflow: auto;
|
|
344
|
+
padding: var(--panel-padding, 0.75rem);
|
|
345
|
+
gap: var(--spacing-medium, 1rem);
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
& > [data-part="content"][data-orientation="horizontal"] {
|
|
349
|
+
flex-direction: row;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
& > [data-part="content"][data-orientation="vertical"] {
|
|
353
|
+
flex-direction: column;
|
|
354
|
+
}
|
|
355
|
+
`);
|
|
356
|
+
class xe extends g {
|
|
357
|
+
constructor(e = {}) {
|
|
358
|
+
super(e);
|
|
359
|
+
s(this, "sidebarId");
|
|
360
|
+
s(this, "headerId");
|
|
361
|
+
this.sidebarId = j("sidebar", e.id), this.headerId = `${this.sidebarId}-title`;
|
|
362
|
+
}
|
|
363
|
+
render() {
|
|
364
|
+
const {
|
|
365
|
+
header: e = null,
|
|
366
|
+
toolbar: a = null,
|
|
367
|
+
ariaLabel: i,
|
|
368
|
+
children: n = []
|
|
369
|
+
} = this.props, o = e == null ? null : /* @__PURE__ */ u("header", { "data-part": "header", children: typeof e == "string" || typeof e == "number" ? /* @__PURE__ */ u("h2", { id: this.headerId, children: e }) : /* @__PURE__ */ u("div", { id: this.headerId, children: e }) });
|
|
370
|
+
return /* @__PURE__ */ w(
|
|
371
|
+
"aside",
|
|
372
|
+
{
|
|
373
|
+
id: this.sidebarId,
|
|
374
|
+
className: E(this.props) || void 0,
|
|
375
|
+
"data-fray-component": "sidebar",
|
|
376
|
+
"aria-label": e == null ? i : null,
|
|
377
|
+
"aria-labelledby": e == null ? null : this.headerId,
|
|
378
|
+
children: [
|
|
379
|
+
o,
|
|
380
|
+
a == null ? null : /* @__PURE__ */ u("div", { "data-part": "toolbar", children: a }),
|
|
381
|
+
/* @__PURE__ */ u("div", { "data-part": "content", tabIndex: 0, children: n })
|
|
382
|
+
]
|
|
383
|
+
}
|
|
384
|
+
);
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
s(xe, "baseStyles", [
|
|
388
|
+
['aside[data-fray-component="sidebar"]', ["panel"]],
|
|
389
|
+
['aside[data-fray-component="sidebar"] > [data-part="header"]', ["sectionheader"]]
|
|
390
|
+
]), s(xe, "css", v`
|
|
391
|
+
aside[data-fray-component="sidebar"] {
|
|
392
|
+
display: flex;
|
|
393
|
+
flex-direction: column;
|
|
394
|
+
min-width: 0;
|
|
395
|
+
min-height: 0;
|
|
396
|
+
overflow: hidden;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
aside[data-fray-component="sidebar"] > [data-part="header"],
|
|
400
|
+
aside[data-fray-component="sidebar"] > [data-part="toolbar"] {
|
|
401
|
+
flex: 0 0 auto;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
aside[data-fray-component="sidebar"] > [data-part="header"] h2 {
|
|
405
|
+
margin: 0;
|
|
406
|
+
font: inherit;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
aside[data-fray-component="sidebar"] > [data-part="content"] {
|
|
410
|
+
flex: 1 1 auto;
|
|
411
|
+
min-width: 0;
|
|
412
|
+
min-height: 0;
|
|
413
|
+
overflow-x: hidden;
|
|
414
|
+
overflow-y: auto;
|
|
415
|
+
}
|
|
416
|
+
`);
|
|
417
|
+
class ce extends g {
|
|
418
|
+
render() {
|
|
419
|
+
const {
|
|
420
|
+
primary: r = null,
|
|
421
|
+
secondary: e = null,
|
|
422
|
+
direction: a = "horizontal",
|
|
423
|
+
primarySize: i,
|
|
424
|
+
primaryLabel: n,
|
|
425
|
+
secondaryLabel: o
|
|
426
|
+
} = this.props;
|
|
427
|
+
if (a !== "horizontal" && a !== "vertical")
|
|
428
|
+
throw new TypeError("SplitView direction must be horizontal or vertical");
|
|
429
|
+
if (i != null && (typeof i != "string" || i.length === 0))
|
|
430
|
+
throw new TypeError("SplitView primarySize must be a non-empty CSS size");
|
|
431
|
+
const l = this.Host;
|
|
432
|
+
return /* @__PURE__ */ w(
|
|
433
|
+
l,
|
|
434
|
+
{
|
|
435
|
+
className: E(this.props) || null,
|
|
436
|
+
"data-direction": a,
|
|
437
|
+
style: i == null ? void 0 : { "--split-primary-size": i },
|
|
438
|
+
children: [
|
|
439
|
+
/* @__PURE__ */ u(
|
|
440
|
+
"div",
|
|
441
|
+
{
|
|
442
|
+
"data-part": "primary",
|
|
443
|
+
role: n == null ? null : "region",
|
|
444
|
+
"aria-label": n,
|
|
445
|
+
children: r
|
|
446
|
+
}
|
|
447
|
+
),
|
|
448
|
+
/* @__PURE__ */ u(
|
|
449
|
+
"div",
|
|
450
|
+
{
|
|
451
|
+
"data-part": "secondary",
|
|
452
|
+
role: o == null ? null : "region",
|
|
453
|
+
"aria-label": o,
|
|
454
|
+
children: e ?? this.props.children ?? []
|
|
455
|
+
}
|
|
456
|
+
)
|
|
457
|
+
]
|
|
458
|
+
}
|
|
459
|
+
);
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
s(ce, "hostName", "split-view"), s(ce, "standaloneHostName", "split-view"), s(ce, "css", v`
|
|
463
|
+
& {
|
|
464
|
+
display: grid;
|
|
465
|
+
flex: 1 1 auto;
|
|
466
|
+
min-width: 0;
|
|
467
|
+
min-height: 0;
|
|
468
|
+
overflow: hidden;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
&[data-direction="horizontal"] {
|
|
472
|
+
grid-template-columns:
|
|
473
|
+
var(--split-primary-size, minmax(16rem, 0.8fr))
|
|
474
|
+
minmax(0, 1.2fr);
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
&[data-direction="vertical"] {
|
|
478
|
+
grid-template-rows:
|
|
479
|
+
var(--split-primary-size, minmax(12rem, 0.8fr))
|
|
480
|
+
minmax(0, 1.2fr);
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
& > [data-part] {
|
|
484
|
+
min-width: 0;
|
|
485
|
+
min-height: 0;
|
|
486
|
+
overflow: auto;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
&[data-direction="horizontal"] > [data-part="primary"] {
|
|
490
|
+
border-inline-end: 1px solid var(--ui-border-color);
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
&[data-direction="vertical"] > [data-part="primary"] {
|
|
494
|
+
border-block-end: 1px solid var(--ui-border-color);
|
|
495
|
+
}
|
|
496
|
+
`);
|
|
497
|
+
class Ue extends g {
|
|
498
|
+
render() {
|
|
499
|
+
const { term: r, value: e, children: a = [] } = this.props;
|
|
500
|
+
return /* @__PURE__ */ w(
|
|
501
|
+
"div",
|
|
502
|
+
{
|
|
503
|
+
className: E(this.props) || void 0,
|
|
504
|
+
"data-fray-component": "description-item",
|
|
505
|
+
children: [
|
|
506
|
+
/* @__PURE__ */ u("dt", { children: r }),
|
|
507
|
+
/* @__PURE__ */ u("dd", { children: e ?? a })
|
|
266
508
|
]
|
|
267
509
|
}
|
|
268
510
|
);
|
|
269
511
|
}
|
|
270
512
|
}
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
513
|
+
s(Ue, "css", v`
|
|
514
|
+
div[data-fray-component="description-item"] {
|
|
515
|
+
display: grid;
|
|
516
|
+
grid-template-columns: minmax(7rem, 0.7fr) minmax(0, 1.3fr);
|
|
517
|
+
gap: var(--spacing-small, 0.5rem);
|
|
518
|
+
padding-block: var(--spacing-small, 0.5rem);
|
|
519
|
+
border-block-end: 1px solid var(--ui-border-color);
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
div[data-fray-component="description-item"] > dt {
|
|
523
|
+
color: var(--ui-muted-text-color, var(--ui-text-color));
|
|
524
|
+
font-weight: 600;
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
div[data-fray-component="description-item"] > dd {
|
|
528
|
+
min-width: 0;
|
|
529
|
+
margin: 0;
|
|
530
|
+
overflow-wrap: anywhere;
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
@media (max-width: 36rem) {
|
|
534
|
+
div[data-fray-component="description-item"] {
|
|
535
|
+
grid-template-columns: minmax(0, 1fr);
|
|
536
|
+
gap: 0.15rem;
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
`);
|
|
540
|
+
class Te extends g {
|
|
541
|
+
render() {
|
|
542
|
+
return /* @__PURE__ */ u(
|
|
543
|
+
"dl",
|
|
544
|
+
{
|
|
545
|
+
className: E(this.props) || void 0,
|
|
546
|
+
"data-fray-component": "description-list",
|
|
547
|
+
"aria-label": this.props.label,
|
|
548
|
+
children: this.props.children ?? []
|
|
549
|
+
}
|
|
550
|
+
);
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
s(Te, "dependencies", [Ue]), s(Te, "css", v`
|
|
554
|
+
dl[data-fray-component="description-list"] {
|
|
555
|
+
display: grid;
|
|
556
|
+
margin: 0;
|
|
557
|
+
}
|
|
558
|
+
`);
|
|
559
|
+
class H extends g {
|
|
560
|
+
render() {
|
|
561
|
+
const r = at(this.props.width ?? 65), e = this.Host;
|
|
562
|
+
return /* @__PURE__ */ u(e, { style: { width: `${r}%` }, "aria-hidden": "true" });
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
s(H, "hostName", "placeholder"), s(H, "standaloneHostName", "loading-placeholder"), s(H, "baseStyles", [
|
|
566
|
+
["&::after", ["after", "working"]]
|
|
567
|
+
]), s(H, "css", v`
|
|
568
|
+
& {
|
|
569
|
+
display: block;
|
|
570
|
+
min-width: 3rem;
|
|
571
|
+
height: 1em;
|
|
572
|
+
overflow: hidden;
|
|
573
|
+
background: currentColor;
|
|
574
|
+
border-radius: var(--ui-border-radius);
|
|
575
|
+
opacity: 0.18;
|
|
576
|
+
position: relative;
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
@keyframes fray-placeholder-progress {
|
|
580
|
+
from { background-position: 0 0; }
|
|
581
|
+
to { background-position: 2rem 0; }
|
|
582
|
+
}
|
|
583
|
+
`);
|
|
584
|
+
function at(t) {
|
|
585
|
+
const r = Number(t);
|
|
586
|
+
if (!Number.isFinite(r)) throw new TypeError("Placeholder width must be numeric");
|
|
587
|
+
return Math.min(100, Math.max(10, r));
|
|
588
|
+
}
|
|
589
|
+
function Pe(t, r, e) {
|
|
590
|
+
ye(e);
|
|
591
|
+
for (const a of e) {
|
|
592
|
+
const i = r[a.key];
|
|
593
|
+
if (i == null) continue;
|
|
594
|
+
const n = a.options.flatMap((d) => {
|
|
595
|
+
const h = i[d.key];
|
|
596
|
+
return h == null || h === y.Neutral ? [] : [{ option: d, mode: h }];
|
|
597
|
+
});
|
|
598
|
+
if (n.some(({ option: d, mode: h }) => h === y.Deny && d.matches(t)) || n.filter(({ mode: d }) => d === y.Require).some(({ option: d }) => !d.matches(t)))
|
|
599
|
+
return !1;
|
|
600
|
+
const l = n.filter(({ mode: d }) => d === y.Prefer);
|
|
601
|
+
if (l.length > 0 && !l.some(({ option: d }) => d.matches(t)))
|
|
602
|
+
return !1;
|
|
603
|
+
}
|
|
604
|
+
return !0;
|
|
605
|
+
}
|
|
606
|
+
function it(t, r, e) {
|
|
607
|
+
if (!Array.isArray(t)) throw new TypeError("Filtered items must be an array");
|
|
608
|
+
return t.filter((a) => Pe(a, r, e));
|
|
609
|
+
}
|
|
610
|
+
function ar(t, r, e = null) {
|
|
611
|
+
return ye(r), new le(
|
|
612
|
+
[t],
|
|
613
|
+
([a]) => (i) => Pe(i, a, r),
|
|
614
|
+
{ owner: e, purpose: "filter predicate" }
|
|
615
|
+
);
|
|
616
|
+
}
|
|
617
|
+
function ir(t, r, e, a = null) {
|
|
618
|
+
return ye(e), new le(
|
|
619
|
+
[t, r],
|
|
620
|
+
([i, n]) => it(i, n, e),
|
|
621
|
+
{ owner: a, purpose: "filtered items" }
|
|
622
|
+
);
|
|
623
|
+
}
|
|
624
|
+
function nr(t) {
|
|
625
|
+
nt(t);
|
|
626
|
+
const r = {};
|
|
627
|
+
for (const e of Object.keys(t).sort()) {
|
|
628
|
+
const a = {}, i = t[e];
|
|
629
|
+
for (const n of Object.keys(i).sort())
|
|
630
|
+
a[n] = i[n];
|
|
631
|
+
r[e] = a;
|
|
632
|
+
}
|
|
633
|
+
return { version: 1, dimensions: r };
|
|
634
|
+
}
|
|
635
|
+
function sr(t) {
|
|
636
|
+
if (!Q(t) || t.version !== 1 || !Q(t.dimensions))
|
|
637
|
+
throw new TypeError("Filter state must use version 1 with a dimensions object");
|
|
638
|
+
const r = {};
|
|
639
|
+
for (const [e, a] of Object.entries(t.dimensions)) {
|
|
640
|
+
if (U(e, "Filter dimension"), !Q(a))
|
|
641
|
+
throw new TypeError(`Filter dimension ${e} must be an object`);
|
|
642
|
+
const i = {};
|
|
643
|
+
for (const [n, o] of Object.entries(a)) {
|
|
644
|
+
if (U(n, `Filter option in ${e}`), !de(o))
|
|
645
|
+
throw new TypeError(
|
|
646
|
+
`Unknown filter mode for ${e}.${n}: ${String(o)}`
|
|
647
|
+
);
|
|
648
|
+
i[n] = o;
|
|
649
|
+
}
|
|
650
|
+
r[e] = i;
|
|
651
|
+
}
|
|
652
|
+
return r;
|
|
653
|
+
}
|
|
654
|
+
function nt(t) {
|
|
655
|
+
if (!Q(t)) throw new TypeError("Filter state must be an object");
|
|
656
|
+
for (const [r, e] of Object.entries(t)) {
|
|
657
|
+
if (U(r, "Filter dimension"), !Q(e))
|
|
658
|
+
throw new TypeError(`Filter dimension ${r} must be an object`);
|
|
659
|
+
for (const [a, i] of Object.entries(e))
|
|
660
|
+
if (U(a, `Filter option in ${r}`), !de(i))
|
|
661
|
+
throw new TypeError(
|
|
662
|
+
`Unknown filter mode for ${r}.${a}: ${String(i)}`
|
|
663
|
+
);
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
function ye(t) {
|
|
667
|
+
if (!Array.isArray(t)) throw new TypeError("Filter dimensions must be an array");
|
|
668
|
+
const r = /* @__PURE__ */ new Set();
|
|
669
|
+
for (const e of t) {
|
|
670
|
+
if (U(e.key, "Filter dimension"), r.has(e.key))
|
|
671
|
+
throw new Error(`Duplicate filter dimension: ${e.key}`);
|
|
672
|
+
if (r.add(e.key), !Array.isArray(e.options))
|
|
673
|
+
throw new TypeError(`Filter dimension ${e.key} options must be an array`);
|
|
674
|
+
const a = /* @__PURE__ */ new Set();
|
|
675
|
+
for (const i of e.options) {
|
|
676
|
+
if (U(i.key, `Filter option in ${e.key}`), a.has(i.key))
|
|
677
|
+
throw new Error(`Duplicate filter option: ${e.key}.${i.key}`);
|
|
678
|
+
if (a.add(i.key), typeof i.matches != "function")
|
|
679
|
+
throw new TypeError(`Filter matcher ${e.key}.${i.key} must be a function`);
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
function U(t, r) {
|
|
684
|
+
if (t.length === 0 || t === "__proto__" || t === "prototype" || t === "constructor")
|
|
685
|
+
throw new TypeError(`${r} key is not safe for persisted state`);
|
|
686
|
+
}
|
|
687
|
+
function Q(t) {
|
|
688
|
+
return t != null && typeof t == "object" && !Array.isArray(t);
|
|
689
|
+
}
|
|
690
|
+
class Be {
|
|
691
|
+
constructor({
|
|
692
|
+
getItems: r,
|
|
693
|
+
getKey: e = we,
|
|
694
|
+
selectedItemsEmitter: a,
|
|
695
|
+
owner: i = null
|
|
696
|
+
}) {
|
|
697
|
+
s(this, "getItems");
|
|
698
|
+
s(this, "getKey");
|
|
699
|
+
s(this, "selectedItemsEmitter");
|
|
700
|
+
s(this, "selectedItems$");
|
|
701
|
+
s(this, "ownsSelectedItemsEmitter");
|
|
702
|
+
s(this, "rows", []);
|
|
703
|
+
s(this, "rowCleanups", []);
|
|
704
|
+
s(this, "activeIndex", 0);
|
|
705
|
+
s(this, "anchorIndex", null);
|
|
706
|
+
s(this, "dragStartIndex", null);
|
|
707
|
+
s(this, "dragOriginEvent", null);
|
|
708
|
+
s(this, "dragMoved", !1);
|
|
709
|
+
s(this, "dragCleanup", null);
|
|
710
|
+
s(this, "suppressNextClick", !1);
|
|
711
|
+
s(this, "suppressClickTimer", null);
|
|
712
|
+
s(this, "destroyed", !1);
|
|
713
|
+
s(this, "ownedSelectedItemsEmitter");
|
|
714
|
+
if (typeof r != "function")
|
|
715
|
+
throw new TypeError("Selection handler getItems must be a function");
|
|
716
|
+
if (typeof e != "function")
|
|
717
|
+
throw new TypeError("Selection handler getKey must be a function");
|
|
718
|
+
this.getItems = r, this.getKey = e, this.ownedSelectedItemsEmitter = a == null ? new I([], { owner: i, purpose: "selected items" }) : null, this.selectedItemsEmitter = a ?? this.ownedSelectedItemsEmitter, this.selectedItems$ = this.selectedItemsEmitter, this.ownsSelectedItemsEmitter = this.ownedSelectedItemsEmitter != null;
|
|
719
|
+
}
|
|
720
|
+
rowsUpdated(r) {
|
|
721
|
+
this.destroyed || (this.releaseRows(), this.rows = Array.from(r ?? []), this.rows.forEach((e, a) => this.wireRow(e, a)), this.activeIndex = lt(this.activeIndex, this.rows.length), this.reconcileSelectedItems(), this.syncRows());
|
|
722
|
+
}
|
|
723
|
+
wireRow(r, e) {
|
|
724
|
+
const a = (l) => this.handleClick(e, l), i = (l) => this.handleKeyDown(e, l), n = (l) => this.handleMouseDown(e, l, r), o = (l) => this.handleMouseEnter(e, l);
|
|
725
|
+
r.addEventListener("click", a), r.addEventListener("keydown", i), r.addEventListener("mousedown", n), r.addEventListener("mouseenter", o), this.rowCleanups.push(() => {
|
|
726
|
+
r.removeEventListener("click", a), r.removeEventListener("keydown", i), r.removeEventListener("mousedown", n), r.removeEventListener("mouseenter", o);
|
|
727
|
+
});
|
|
728
|
+
}
|
|
729
|
+
handleClick(r, e) {
|
|
730
|
+
var a;
|
|
731
|
+
if (e.preventDefault(), this.suppressNextClick) {
|
|
732
|
+
this.clearClickSuppression();
|
|
733
|
+
return;
|
|
734
|
+
}
|
|
735
|
+
this.activeIndex = r, this.selectIndex(r, e), (a = this.rows[r]) == null || a.focus();
|
|
736
|
+
}
|
|
737
|
+
handleMouseDown(r, e, a) {
|
|
738
|
+
if (e.button !== 0 || !this.supportsDragSelection()) return;
|
|
739
|
+
this.finishDrag(!1), this.clearClickSuppression(), this.dragStartIndex = r, this.dragOriginEvent = e, this.dragMoved = !1;
|
|
740
|
+
const i = a.ownerDocument, n = () => this.finishDrag(this.dragMoved);
|
|
741
|
+
i.addEventListener("mouseup", n), this.dragCleanup = () => i.removeEventListener("mouseup", n);
|
|
742
|
+
}
|
|
743
|
+
handleMouseEnter(r, e) {
|
|
744
|
+
var a;
|
|
745
|
+
this.dragStartIndex != null && (r === this.dragStartIndex && !this.dragMoved || r === this.activeIndex && this.dragMoved || (e.preventDefault(), this.dragMoved = !0, this.activeIndex = r, this.selectDragRange(this.dragStartIndex, r, this.dragOriginEvent ?? e), (a = this.rows[r]) == null || a.focus()));
|
|
746
|
+
}
|
|
747
|
+
handleKeyDown(r, e) {
|
|
748
|
+
var n;
|
|
749
|
+
const a = this.rows.length - 1;
|
|
750
|
+
let i;
|
|
751
|
+
if (e.key === "ArrowDown") i = Math.min(r + 1, a);
|
|
752
|
+
else if (e.key === "ArrowUp") i = Math.max(r - 1, 0);
|
|
753
|
+
else if (e.key === "Home") i = 0;
|
|
754
|
+
else if (e.key === "End") i = a;
|
|
755
|
+
else if (e.key === " " || e.key === "Enter") {
|
|
756
|
+
e.preventDefault(), this.activeIndex = r, this.selectIndex(r, e);
|
|
757
|
+
return;
|
|
758
|
+
} else return;
|
|
759
|
+
e.preventDefault(), this.activeIndex = i, this.onKeyboardMove(i, e), this.syncRows(), (n = this.rows[i]) == null || n.focus();
|
|
760
|
+
}
|
|
761
|
+
onKeyboardMove(r, e) {
|
|
762
|
+
this.selectIndex(r, e);
|
|
763
|
+
}
|
|
764
|
+
supportsDragSelection() {
|
|
765
|
+
return !1;
|
|
766
|
+
}
|
|
767
|
+
selectDragRange(r, e, a) {
|
|
768
|
+
}
|
|
769
|
+
selectIndex(r, e) {
|
|
770
|
+
}
|
|
771
|
+
setSelectedItems(r, e = "selection changed") {
|
|
772
|
+
this.selectedItemsEmitter.set(r, e), this.syncRows();
|
|
773
|
+
}
|
|
774
|
+
getSelectedItems() {
|
|
775
|
+
return this.selectedItemsEmitter.get() ?? [];
|
|
776
|
+
}
|
|
777
|
+
getSelectedItemsEmitter() {
|
|
778
|
+
return this.selectedItemsEmitter;
|
|
779
|
+
}
|
|
780
|
+
reconcileSelectedItems() {
|
|
781
|
+
const r = this.getSelectedItems();
|
|
782
|
+
if (r.length === 0) return;
|
|
783
|
+
const e = new Set(r.map((i, n) => this.getKey(i, n))), a = this.getItems().filter((i, n) => e.has(this.getKey(i, n)));
|
|
784
|
+
(a.length !== r.length || a.some((i, n) => !Object.is(i, r[n]))) && this.selectedItemsEmitter.set([...a], "selection reconciled with rows");
|
|
785
|
+
}
|
|
786
|
+
syncRows() {
|
|
787
|
+
const r = new Set(this.getSelectedItems().map((a, i) => this.getKey(a, i))), e = this.getItems();
|
|
788
|
+
this.rows.forEach((a, i) => {
|
|
789
|
+
const n = e[i], o = n !== void 0 && r.has(this.getKey(n, i));
|
|
790
|
+
a.classList.toggle("selected", o), a.setAttribute("aria-selected", String(o)), a.tabIndex = i === this.activeIndex ? 0 : -1;
|
|
791
|
+
});
|
|
792
|
+
}
|
|
793
|
+
releaseRows() {
|
|
794
|
+
for (const r of this.rowCleanups.splice(0)) r();
|
|
795
|
+
this.rows = [];
|
|
796
|
+
}
|
|
797
|
+
finishDrag(r) {
|
|
798
|
+
var e;
|
|
799
|
+
(e = this.dragCleanup) == null || e.call(this), this.dragCleanup = null, this.dragStartIndex = null, this.dragOriginEvent = null, this.dragMoved = !1, r && (this.suppressNextClick = !0, this.suppressClickTimer != null && clearTimeout(this.suppressClickTimer), this.suppressClickTimer = setTimeout(() => this.clearClickSuppression(), 0));
|
|
800
|
+
}
|
|
801
|
+
clearClickSuppression() {
|
|
802
|
+
this.suppressNextClick = !1, this.suppressClickTimer != null && clearTimeout(this.suppressClickTimer), this.suppressClickTimer = null;
|
|
803
|
+
}
|
|
804
|
+
destroy() {
|
|
805
|
+
var r;
|
|
806
|
+
this.destroyed || (this.destroyed = !0, this.finishDrag(!1), this.clearClickSuppression(), this.releaseRows(), (r = this.ownedSelectedItemsEmitter) == null || r.dispose());
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
class ge extends Be {
|
|
810
|
+
constructor(e) {
|
|
811
|
+
const a = e.selectedItemEmitter == null ? new I(null, {
|
|
812
|
+
owner: e.owner,
|
|
813
|
+
purpose: "selected item"
|
|
814
|
+
}) : null, i = e.selectedItemEmitter ?? a;
|
|
815
|
+
super({
|
|
816
|
+
getItems: e.getItems,
|
|
817
|
+
...e.getKey == null ? {} : { getKey: e.getKey },
|
|
818
|
+
...e.owner === void 0 ? {} : { owner: e.owner },
|
|
819
|
+
selectedItemsEmitter: new ot(i)
|
|
820
|
+
});
|
|
821
|
+
s(this, "selectedItemEmitter");
|
|
822
|
+
s(this, "selectedItem$");
|
|
823
|
+
s(this, "ownedSelectedItemEmitter");
|
|
824
|
+
this.ownedSelectedItemEmitter = a, this.selectedItemEmitter = i, this.selectedItem$ = i;
|
|
825
|
+
}
|
|
826
|
+
selectIndex(e) {
|
|
827
|
+
const a = this.getItems()[e];
|
|
828
|
+
a !== void 0 && (this.anchorIndex = e, this.setSelectedItems([a], "single selection changed"));
|
|
829
|
+
}
|
|
830
|
+
getSelectedItem() {
|
|
831
|
+
return this.selectedItemEmitter.get();
|
|
832
|
+
}
|
|
833
|
+
destroy() {
|
|
834
|
+
var e;
|
|
835
|
+
super.destroy(), (e = this.ownedSelectedItemEmitter) == null || e.dispose();
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
class st extends Be {
|
|
839
|
+
selectIndex(r, e) {
|
|
840
|
+
const a = this.getItems(), i = a[r];
|
|
841
|
+
if (i !== void 0) {
|
|
842
|
+
if (e.shiftKey && this.anchorIndex != null) {
|
|
843
|
+
const n = Math.min(this.anchorIndex, r), o = Math.max(this.anchorIndex, r), l = a.slice(n, o + 1), d = ue(e) ? Re(this.getSelectedItems(), l, this.getKey) : [...l];
|
|
844
|
+
this.setSelectedItems(d, "range selection changed");
|
|
845
|
+
return;
|
|
846
|
+
}
|
|
847
|
+
if (ue(e) || "key" in e && e.key === " ") {
|
|
848
|
+
const n = this.getSelectedItems(), o = this.getKey(i, r), d = n.some((h, f) => Object.is(this.getKey(h, f), o)) ? n.filter((h, f) => !Object.is(this.getKey(h, f), o)) : [...n, i];
|
|
849
|
+
this.anchorIndex = r, this.setSelectedItems(d, "multi selection toggled");
|
|
850
|
+
return;
|
|
851
|
+
}
|
|
852
|
+
this.anchorIndex = r, this.setSelectedItems([i], "multi selection changed");
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
onKeyboardMove(r, e) {
|
|
856
|
+
e.shiftKey && this.selectIndex(r, e);
|
|
857
|
+
}
|
|
858
|
+
supportsDragSelection() {
|
|
859
|
+
return !0;
|
|
860
|
+
}
|
|
861
|
+
selectDragRange(r, e, a) {
|
|
862
|
+
const i = this.getItems(), n = Math.min(r, e), o = Math.max(r, e), l = i.slice(n, o + 1), d = ue(a) ? Re(this.getSelectedItems(), l, this.getKey) : [...l];
|
|
863
|
+
this.anchorIndex = r, this.setSelectedItems(d, "drag selection changed");
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
function ne(t) {
|
|
867
|
+
return t.multiSelect ? new st(t) : new ge(t);
|
|
868
|
+
}
|
|
869
|
+
class ot {
|
|
870
|
+
constructor(r) {
|
|
871
|
+
this.source = r;
|
|
872
|
+
}
|
|
873
|
+
get() {
|
|
874
|
+
const r = this.source.get();
|
|
875
|
+
return r == null ? [] : [r];
|
|
876
|
+
}
|
|
877
|
+
getError() {
|
|
878
|
+
return this.source.getError();
|
|
879
|
+
}
|
|
880
|
+
getFetchState() {
|
|
881
|
+
return this.source.getFetchState();
|
|
882
|
+
}
|
|
883
|
+
set(r, e) {
|
|
884
|
+
return this.source.set(r[0] ?? null, e);
|
|
885
|
+
}
|
|
886
|
+
subscribe(r, e) {
|
|
887
|
+
return this.source.subscribe((a) => r({
|
|
888
|
+
...a,
|
|
889
|
+
value: a.value == null ? [] : [a.value]
|
|
890
|
+
}), e);
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
function we(t, r) {
|
|
894
|
+
if (t != null && typeof t == "object") {
|
|
895
|
+
const e = Reflect.get(t, "id");
|
|
896
|
+
if (e != null) return e;
|
|
897
|
+
}
|
|
898
|
+
if (typeof t == "string" || typeof t == "number") return t;
|
|
899
|
+
throw new TypeError(
|
|
900
|
+
`Selection item at index ${r} needs an id or an explicit itemKey/rowKey`
|
|
901
|
+
);
|
|
902
|
+
}
|
|
903
|
+
function ue(t) {
|
|
904
|
+
return !!(t.ctrlKey || t.metaKey);
|
|
905
|
+
}
|
|
906
|
+
function lt(t, r) {
|
|
907
|
+
return r <= 0 ? 0 : Math.min(Math.max(t, 0), r - 1);
|
|
908
|
+
}
|
|
909
|
+
function Re(t, r, e) {
|
|
910
|
+
const a = [...t], i = new Set(t.map((n, o) => e(n, o)));
|
|
911
|
+
for (const n of r) {
|
|
912
|
+
const o = e(n, a.length);
|
|
913
|
+
i.has(o) || (i.add(o), a.push(n));
|
|
914
|
+
}
|
|
915
|
+
return a;
|
|
916
|
+
}
|
|
917
|
+
class G extends g {
|
|
918
|
+
constructor(e = {}) {
|
|
919
|
+
super(e);
|
|
920
|
+
s(this, "itemsEmitter");
|
|
921
|
+
s(this, "items$");
|
|
922
|
+
s(this, "selectedItemsEmitter");
|
|
923
|
+
s(this, "selectedItems$");
|
|
924
|
+
s(this, "selectedItemEmitter");
|
|
925
|
+
s(this, "selectedItem$");
|
|
926
|
+
s(this, "getItemKey");
|
|
927
|
+
s(this, "selectionHandler");
|
|
928
|
+
s(this, "ownedItemsEmitter");
|
|
929
|
+
ct(e.items) ? (this.itemsEmitter = e.items, this.ownedItemsEmitter = null) : (this.ownedItemsEmitter = new I(e.items ?? [], {
|
|
930
|
+
owner: this,
|
|
931
|
+
purpose: "list items"
|
|
932
|
+
}), this.itemsEmitter = this.ownedItemsEmitter), this.items$ = this.itemsEmitter, this.getItemKey = dt(e.itemKey), this.selectionHandler = e.multiSelect === !0 ? ne({
|
|
933
|
+
owner: this,
|
|
934
|
+
multiSelect: !0,
|
|
935
|
+
...e.selectedItemsEmitter == null ? {} : { selectedItemsEmitter: e.selectedItemsEmitter },
|
|
936
|
+
getItems: () => this.itemsEmitter.get(),
|
|
937
|
+
getKey: this.getItemKey
|
|
938
|
+
}) : ne({
|
|
939
|
+
owner: this,
|
|
940
|
+
...e.selectedItemEmitter == null ? {} : { selectedItemEmitter: e.selectedItemEmitter },
|
|
941
|
+
getItems: () => this.itemsEmitter.get(),
|
|
942
|
+
getKey: this.getItemKey
|
|
943
|
+
}), this.selectedItemsEmitter = this.selectionHandler.selectedItemsEmitter, this.selectedItems$ = this.selectedItemsEmitter, this.selectedItemEmitter = this.selectionHandler instanceof ge ? this.selectionHandler.selectedItemEmitter : null, this.selectedItem$ = this.selectedItemEmitter;
|
|
944
|
+
}
|
|
945
|
+
initialize() {
|
|
946
|
+
this.watch(this.itemsEmitter, this.selectedItemsEmitter);
|
|
947
|
+
}
|
|
948
|
+
render() {
|
|
949
|
+
const e = this.itemsEmitter.get();
|
|
950
|
+
if (!Array.isArray(e)) throw new TypeError("ListView items must be an array");
|
|
951
|
+
const a = this.itemsEmitter.getFetchState(), i = this.itemsEmitter.getError(), n = a === k.Initial || a === k.Loading, o = new Set(this.selectedItemsEmitter.get().map((d, h) => this.getItemKey(d, h))), l = this.Host;
|
|
952
|
+
return /* @__PURE__ */ w(
|
|
953
|
+
l,
|
|
954
|
+
{
|
|
955
|
+
className: E(this.props) || null,
|
|
956
|
+
children: [
|
|
957
|
+
a === k.Error ? /* @__PURE__ */ u("p", { role: "alert", "data-part": "error", children: ft(i, "Unable to load items") }) : null,
|
|
958
|
+
n && e.length === 0 ? /* @__PURE__ */ w("div", { role: "status", "data-part": "loading", children: [
|
|
959
|
+
/* @__PURE__ */ u("span", { children: "Loading items…" }),
|
|
960
|
+
Array.from({ length: this.props.placeholderCount ?? 5 }, (d, h) => /* @__PURE__ */ u("div", { "data-part": "placeholder-row", children: /* @__PURE__ */ u(H, { width: 45 + h * 7 }) }, `placeholder-${h}`))
|
|
961
|
+
] }) : null,
|
|
962
|
+
a === k.Ready && e.length === 0 ? /* @__PURE__ */ u("p", { role: "status", "data-part": "empty", children: "No items" }) : null,
|
|
963
|
+
e.length > 0 ? /* @__PURE__ */ u(
|
|
964
|
+
"div",
|
|
965
|
+
{
|
|
966
|
+
role: "listbox",
|
|
967
|
+
"data-part": "list",
|
|
968
|
+
"aria-label": this.props.label ?? "Items",
|
|
969
|
+
"aria-busy": n ? "true" : null,
|
|
970
|
+
"aria-multiselectable": this.props.multiSelect ? "true" : null,
|
|
971
|
+
children: e.map((d, h) => {
|
|
972
|
+
const f = this.getItemKey(d, h), p = o.has(f), m = this.props.renderItem ? this.props.renderItem(d, h) : ut(d);
|
|
973
|
+
return /* @__PURE__ */ u(
|
|
974
|
+
"div",
|
|
975
|
+
{
|
|
976
|
+
role: "option",
|
|
977
|
+
"data-part": "row",
|
|
978
|
+
"data-fray-selectable-row": "",
|
|
979
|
+
"data-index": h,
|
|
980
|
+
"aria-selected": String(p),
|
|
981
|
+
tabIndex: h === 0 ? 0 : -1,
|
|
982
|
+
children: m
|
|
983
|
+
},
|
|
984
|
+
String(f)
|
|
985
|
+
);
|
|
986
|
+
})
|
|
987
|
+
}
|
|
988
|
+
) : null
|
|
989
|
+
]
|
|
990
|
+
}
|
|
991
|
+
);
|
|
992
|
+
}
|
|
993
|
+
afterUpdate(e) {
|
|
994
|
+
const a = e instanceof Element ? e.querySelectorAll("[data-fray-selectable-row]") : [];
|
|
995
|
+
this.selectionHandler.rowsUpdated(a);
|
|
996
|
+
}
|
|
997
|
+
getSelectedItems() {
|
|
998
|
+
return this.selectionHandler.getSelectedItems();
|
|
999
|
+
}
|
|
1000
|
+
getSelectedItemsEmitter() {
|
|
1001
|
+
return this.selectedItemsEmitter;
|
|
1002
|
+
}
|
|
1003
|
+
getSelectedItem() {
|
|
1004
|
+
var e;
|
|
1005
|
+
return ((e = this.selectedItemEmitter) == null ? void 0 : e.get()) ?? null;
|
|
1006
|
+
}
|
|
1007
|
+
getSelectedItemEmitter() {
|
|
1008
|
+
return this.selectedItemEmitter;
|
|
1009
|
+
}
|
|
1010
|
+
onDestroy() {
|
|
1011
|
+
var e;
|
|
1012
|
+
this.selectionHandler.destroy(), (e = this.ownedItemsEmitter) == null || e.dispose();
|
|
1013
|
+
}
|
|
1014
|
+
}
|
|
1015
|
+
s(G, "dependencies", [H]), s(G, "hostName", "list-view"), s(G, "standaloneHostName", "list-view"), s(G, "baseStyles", [
|
|
1016
|
+
["&", "inputlike"],
|
|
1017
|
+
['& > [data-part="list"] > [data-part="row"]', "inputline"]
|
|
1018
|
+
]), s(G, "css", v`
|
|
1019
|
+
& {
|
|
1020
|
+
display: flex;
|
|
1021
|
+
flex-direction: column;
|
|
1022
|
+
overflow-y: auto;
|
|
1023
|
+
min-height: 0;
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1026
|
+
& > [data-part="list"],
|
|
1027
|
+
& > [data-part="loading"] {
|
|
1028
|
+
display: flex;
|
|
1029
|
+
flex-direction: column;
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1032
|
+
& > [data-part="list"] > [data-part="row"] {
|
|
1033
|
+
cursor: default;
|
|
1034
|
+
user-select: none;
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1037
|
+
& > [data-part="list"] > [data-part="row"]:hover,
|
|
1038
|
+
& > [data-part="list"] > [data-part="row"]:focus-visible {
|
|
1039
|
+
background: var(--button-background-hover);
|
|
1040
|
+
outline: 2px solid var(--ui-accent-color);
|
|
1041
|
+
outline-offset: -2px;
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1044
|
+
& > [data-part="list"] > [data-part="row"][aria-selected="true"] {
|
|
1045
|
+
color: var(--toggle-selected-text);
|
|
1046
|
+
background: var(--toggle-selected-bg);
|
|
1047
|
+
}
|
|
1048
|
+
|
|
1049
|
+
& > [data-part="empty"],
|
|
1050
|
+
& > [data-part="error"] {
|
|
1051
|
+
margin: 0;
|
|
1052
|
+
padding: var(--ui-padding);
|
|
1053
|
+
}
|
|
1054
|
+
|
|
1055
|
+
& > [data-part="error"] {
|
|
1056
|
+
color: var(--error-color);
|
|
1057
|
+
}
|
|
1058
|
+
`);
|
|
1059
|
+
function dt(t) {
|
|
1060
|
+
if (t == null) return we;
|
|
1061
|
+
if (typeof t == "function") return t;
|
|
1062
|
+
if (typeof t == "string" && t.length > 0)
|
|
1063
|
+
return (r, e) => {
|
|
1064
|
+
if (r == null || typeof r != "object" && typeof r != "function")
|
|
1065
|
+
throw new TypeError(`ListView item at index ${e} lacks ${t}`);
|
|
1066
|
+
const a = Reflect.get(r, t);
|
|
1067
|
+
if (a == null)
|
|
1068
|
+
throw new TypeError(`ListView item at index ${e} lacks ${t}`);
|
|
1069
|
+
return a;
|
|
1070
|
+
};
|
|
1071
|
+
throw new TypeError("ListView itemKey must be a function or property name");
|
|
1072
|
+
}
|
|
1073
|
+
function ct(t) {
|
|
1074
|
+
return t != null && (typeof t == "object" || typeof t == "function") && typeof Reflect.get(t, "get") == "function" && typeof Reflect.get(t, "subscribe") == "function";
|
|
1075
|
+
}
|
|
1076
|
+
function ut(t) {
|
|
1077
|
+
if (t != null && (typeof t == "object" || typeof t == "function")) {
|
|
1078
|
+
const r = Reflect.get(t, "label");
|
|
1079
|
+
if (ht(r)) return r;
|
|
1080
|
+
}
|
|
1081
|
+
return String(t);
|
|
1082
|
+
}
|
|
1083
|
+
function ht(t) {
|
|
1084
|
+
return t == null || typeof t == "string" || typeof t == "number";
|
|
1085
|
+
}
|
|
1086
|
+
function ft(t, r) {
|
|
1087
|
+
return t instanceof Error ? t.message : t == null ? r : String(t);
|
|
1088
|
+
}
|
|
1089
|
+
class D extends g {
|
|
1090
|
+
constructor(e = {}) {
|
|
1091
|
+
super(e);
|
|
1092
|
+
s(this, "symbols");
|
|
1093
|
+
s(this, "valueEmitter");
|
|
1094
|
+
s(this, "semanticStateEmitter");
|
|
1095
|
+
const a = this.constructor;
|
|
1096
|
+
this.symbols = e.symbols ?? a.symbols, pt(this.symbols);
|
|
1097
|
+
const i = e.initialSemanticState ?? a.defaultSemanticState ?? this.symbols[0][1], n = { ...e };
|
|
1098
|
+
n.defaultValue == null && e.initialSemanticState != null && (n.defaultValue = e.initialSemanticState), this.valueEmitter = M(
|
|
1099
|
+
this,
|
|
1100
|
+
n,
|
|
1101
|
+
i,
|
|
1102
|
+
"checkbox semantic state"
|
|
1103
|
+
), this.semanticStateEmitter = this.valueEmitter;
|
|
1104
|
+
}
|
|
1105
|
+
initialize() {
|
|
1106
|
+
this.watch(this.valueEmitter);
|
|
1107
|
+
}
|
|
1108
|
+
cycleState(e = 1, a = null) {
|
|
1109
|
+
if (this.props.disabled) return;
|
|
1110
|
+
const i = this.symbols.findIndex(([, d]) => Object.is(d, this.valueEmitter.get())), o = ((i < 0 ? 0 : i) + e + this.symbols.length) % this.symbols.length, l = this.symbols[o][1];
|
|
1111
|
+
this.valueEmitter.set(l, "checkbox state changed"), C(this.props.onChange, l, a);
|
|
1112
|
+
}
|
|
1113
|
+
render() {
|
|
1114
|
+
const {
|
|
1115
|
+
label: e = this.props.value ?? "Option",
|
|
1116
|
+
disabled: a = !1,
|
|
1117
|
+
required: i = !1,
|
|
1118
|
+
name: n,
|
|
1119
|
+
value: o
|
|
1120
|
+
} = this.props, l = this.valueEmitter.get(), [d] = this.symbols.find(([, m]) => Object.is(m, l)) ?? ["?", l], h = rt(l), f = l === y.Prefer || l === y.Require, p = this.Host;
|
|
1121
|
+
return /* @__PURE__ */ u(
|
|
1122
|
+
p,
|
|
1123
|
+
{
|
|
1124
|
+
className: E(this.props) || null,
|
|
1125
|
+
"data-disabled": a ? "" : null,
|
|
1126
|
+
"data-required": i ? "" : null,
|
|
1127
|
+
"data-state": h,
|
|
1128
|
+
children: /* @__PURE__ */ w(
|
|
1129
|
+
"button",
|
|
1130
|
+
{
|
|
1131
|
+
type: "button",
|
|
1132
|
+
role: "checkbox",
|
|
1133
|
+
disabled: a,
|
|
1134
|
+
name: n,
|
|
1135
|
+
value: o == null ? void 0 : String(o),
|
|
1136
|
+
"data-part": "control",
|
|
1137
|
+
"aria-checked": f ? "true" : "false",
|
|
1138
|
+
"aria-required": i ? "true" : null,
|
|
1139
|
+
"aria-label": `${e}: ${h}`,
|
|
1140
|
+
onClick: (m) => this.cycleState(1, m),
|
|
1141
|
+
onKeyDown: (m) => {
|
|
1142
|
+
m.key === "ArrowRight" || m.key === "ArrowDown" ? (m.preventDefault(), this.cycleState(1, m)) : (m.key === "ArrowLeft" || m.key === "ArrowUp") && (m.preventDefault(), this.cycleState(-1, m));
|
|
1143
|
+
},
|
|
1144
|
+
children: [
|
|
1145
|
+
/* @__PURE__ */ u("span", { "data-part": "symbol", "aria-hidden": "true", children: d }),
|
|
1146
|
+
/* @__PURE__ */ u("span", { "data-part": "label", children: e })
|
|
1147
|
+
]
|
|
1148
|
+
}
|
|
1149
|
+
)
|
|
1150
|
+
}
|
|
1151
|
+
);
|
|
1152
|
+
}
|
|
1153
|
+
}
|
|
1154
|
+
s(D, "symbols", [
|
|
1155
|
+
["☐", y.Neutral],
|
|
1156
|
+
["✓", y.Prefer]
|
|
1157
|
+
]), s(D, "defaultSemanticState", y.Neutral), s(D, "hostName", "checkbox"), s(D, "standaloneHostName", "check-box"), s(D, "baseStyles", [
|
|
1158
|
+
["&", ["inputline"]],
|
|
1159
|
+
['& > [data-part="control"]', ["input", "inputline"]],
|
|
1160
|
+
["&[data-disabled]", ["disabled"]]
|
|
1161
|
+
]), s(D, "css", v`
|
|
1162
|
+
& > [data-part="control"] {
|
|
1163
|
+
display: inline-flex;
|
|
1164
|
+
align-items: center;
|
|
1165
|
+
gap: 0.35em;
|
|
1166
|
+
width: auto;
|
|
1167
|
+
font-family: inherit;
|
|
1168
|
+
}
|
|
1169
|
+
|
|
1170
|
+
& [data-part="symbol"] {
|
|
1171
|
+
display: inline-grid;
|
|
1172
|
+
width: 1em;
|
|
1173
|
+
height: 1em;
|
|
1174
|
+
line-height: 1;
|
|
1175
|
+
place-items: center;
|
|
1176
|
+
color: var(--fray-checkbox-symbol-color, currentColor);
|
|
1177
|
+
background: var(--fray-checkbox-box-background, transparent);
|
|
1178
|
+
border: var(--fray-checkbox-box-border, var(--cbx-o-border));
|
|
1179
|
+
border-radius: var(--cbx-border-radius, var(--fray-radius-sm));
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1182
|
+
& [data-part="control"][aria-checked="true"] [data-part="symbol"] {
|
|
1183
|
+
background: var(
|
|
1184
|
+
--fray-checkbox-box-background-checked,
|
|
1185
|
+
var(--fray-selection-background)
|
|
1186
|
+
);
|
|
1187
|
+
}
|
|
1188
|
+
`);
|
|
1189
|
+
function pt(t) {
|
|
1190
|
+
if (!Array.isArray(t) || t.length === 0)
|
|
1191
|
+
throw new TypeError("Checkbox symbols must be a non-empty tuple array");
|
|
1192
|
+
for (const r of t)
|
|
1193
|
+
if (!Array.isArray(r) || r.length < 2)
|
|
1194
|
+
throw new TypeError("Checkbox symbols must be [symbol, state] tuples");
|
|
1195
|
+
}
|
|
1196
|
+
class V extends g {
|
|
1197
|
+
constructor(e = {}) {
|
|
1198
|
+
super(e);
|
|
1199
|
+
s(this, "optionsEmitter");
|
|
1200
|
+
s(this, "optionStateEmitters", /* @__PURE__ */ new Map());
|
|
1201
|
+
s(this, "staleOptionValues", /* @__PURE__ */ new Set());
|
|
1202
|
+
s(this, "placementTimer", null);
|
|
1203
|
+
this.optionsEmitter = wt(e.options) ? e.options : null;
|
|
1204
|
+
}
|
|
1205
|
+
initialize() {
|
|
1206
|
+
this.optionsEmitter && this.watch(this.optionsEmitter);
|
|
1207
|
+
}
|
|
1208
|
+
render() {
|
|
1209
|
+
var f, p, m;
|
|
1210
|
+
const e = ((f = this.optionsEmitter) == null ? void 0 : f.get()) ?? (Array.isArray(this.props.options) ? this.props.options : []);
|
|
1211
|
+
if (!Array.isArray(e))
|
|
1212
|
+
throw new TypeError("FilterPanel options must be an array or emitter of arrays");
|
|
1213
|
+
const a = ((p = this.optionsEmitter) == null ? void 0 : p.getFetchState()) ?? k.Ready, i = (m = this.optionsEmitter) == null ? void 0 : m.getError(), n = Ne(this.props.filters), o = this.props.filterModes ?? D.symbols, l = this.props.defaultSemanticState ?? y.Neutral, d = new Set(e.map(pe));
|
|
1214
|
+
this.staleOptionValues = new Set(
|
|
1215
|
+
[...this.optionStateEmitters.keys()].filter((b) => !d.has(b))
|
|
1216
|
+
);
|
|
1217
|
+
const h = this.Host;
|
|
1218
|
+
return a === k.Error ? /* @__PURE__ */ u(
|
|
1219
|
+
h,
|
|
1220
|
+
{
|
|
1221
|
+
className: E(this.props) || null,
|
|
1222
|
+
role: "alert",
|
|
1223
|
+
"data-state": "error",
|
|
1224
|
+
children: Et(i, "Unable to load filter options")
|
|
1225
|
+
}
|
|
1226
|
+
) : (a === k.Initial || a === k.Loading) && e.length === 0 ? /* @__PURE__ */ u(
|
|
1227
|
+
h,
|
|
1228
|
+
{
|
|
1229
|
+
className: E(this.props) || null,
|
|
1230
|
+
role: "status",
|
|
1231
|
+
"data-state": "loading",
|
|
1232
|
+
children: "Loading filter options…"
|
|
1233
|
+
}
|
|
1234
|
+
) : /* @__PURE__ */ u(
|
|
1235
|
+
h,
|
|
1236
|
+
{
|
|
1237
|
+
className: E(this.props) || null,
|
|
1238
|
+
role: "group",
|
|
1239
|
+
"aria-label": this.props.label ?? "Filter options",
|
|
1240
|
+
children: e.length === 0 ? /* @__PURE__ */ u("span", { children: "No filter options" }) : e.map((b) => {
|
|
1241
|
+
const S = pe(b), x = bt(b), O = n.get(S) ?? l, $ = this.optionEmitter(S, O);
|
|
1242
|
+
return /* @__PURE__ */ u(
|
|
1243
|
+
mt,
|
|
1244
|
+
{
|
|
1245
|
+
label: x,
|
|
1246
|
+
valueEmitter: $,
|
|
1247
|
+
symbols: o,
|
|
1248
|
+
onChange: (K, A) => {
|
|
1249
|
+
var T, B;
|
|
1250
|
+
A == null || A.stopPropagation();
|
|
1251
|
+
const F = Ne(this.props.filters);
|
|
1252
|
+
K === y.Neutral ? F.delete(S) : F.set(S, K), (B = (T = this.props).onChange) == null || B.call(T, F, A);
|
|
1253
|
+
}
|
|
1254
|
+
},
|
|
1255
|
+
yt(S)
|
|
1256
|
+
);
|
|
1257
|
+
})
|
|
1258
|
+
}
|
|
1259
|
+
);
|
|
1260
|
+
}
|
|
1261
|
+
afterUpdate(e) {
|
|
1262
|
+
var a;
|
|
1263
|
+
for (const i of this.staleOptionValues)
|
|
1264
|
+
(a = this.optionStateEmitters.get(i)) == null || a.dispose(), this.optionStateEmitters.delete(i);
|
|
1265
|
+
this.staleOptionValues.clear(), this.placementTimer != null && clearTimeout(this.placementTimer), this.placementTimer = setTimeout(() => {
|
|
1266
|
+
this.placementTimer = null, this.placeInsideViewport(e);
|
|
1267
|
+
}, 0);
|
|
1268
|
+
}
|
|
1269
|
+
onDestroy() {
|
|
1270
|
+
this.placementTimer != null && clearTimeout(this.placementTimer), this.placementTimer = null;
|
|
1271
|
+
for (const e of this.optionStateEmitters.values()) e.dispose();
|
|
1272
|
+
this.optionStateEmitters.clear();
|
|
1273
|
+
}
|
|
1274
|
+
optionEmitter(e, a) {
|
|
1275
|
+
const i = this.optionStateEmitters.get(e);
|
|
1276
|
+
if (i != null)
|
|
1277
|
+
return i.get() !== a && i.set(a, "filter option synchronized"), i;
|
|
1278
|
+
const n = new I(a, { owner: this, purpose: `filter option ${String(e)}` });
|
|
1279
|
+
return this.optionStateEmitters.set(e, n), n;
|
|
1280
|
+
}
|
|
1281
|
+
placeInsideViewport(e) {
|
|
1282
|
+
if (!(e instanceof HTMLElement) || e.parentElement == null) return;
|
|
1283
|
+
const a = e.ownerDocument.defaultView;
|
|
1284
|
+
if (a == null || a.innerHeight <= 0) return;
|
|
1285
|
+
const i = e.parentElement.getBoundingClientRect();
|
|
1286
|
+
e.style.removeProperty("max-height");
|
|
1287
|
+
const n = e.getBoundingClientRect(), o = i.top, l = Math.max(0, a.innerHeight - i.bottom), d = n.height > l && o > l;
|
|
1288
|
+
d ? (e.dataset.placement = "above", e.style.insetBlockStart = `${Math.max(8, i.top - n.height)}px`) : (delete e.dataset.placement, e.style.insetBlockStart = `${i.bottom}px`), e.style.insetInlineEnd = `${Math.max(8, a.innerWidth - i.right)}px`;
|
|
1289
|
+
const h = d ? o : l;
|
|
1290
|
+
e.style.maxHeight = `${Math.max(48, h - 8)}px`;
|
|
1291
|
+
}
|
|
1292
|
+
}
|
|
1293
|
+
s(V, "dependencies", [D]), s(V, "hostName", "filter-panel"), s(V, "standaloneHostName", "filter-panel"), s(V, "css", v`
|
|
1294
|
+
& {
|
|
1295
|
+
position: fixed;
|
|
1296
|
+
z-index: 1100;
|
|
1297
|
+
inset-block-start: 0;
|
|
1298
|
+
inset-inline-end: 0;
|
|
1299
|
+
display: flex;
|
|
1300
|
+
min-width: 12rem;
|
|
1301
|
+
padding: var(--ui-padding);
|
|
1302
|
+
flex-flow: column nowrap;
|
|
1303
|
+
align-items: stretch;
|
|
1304
|
+
color: var(--panel-color);
|
|
1305
|
+
background: var(--panel-bg);
|
|
1306
|
+
border: var(--panel-border);
|
|
1307
|
+
border-radius: var(--panel-radius);
|
|
1308
|
+
box-shadow: var(--panel-shadow);
|
|
1309
|
+
overflow-y: auto;
|
|
1310
|
+
}
|
|
1311
|
+
|
|
1312
|
+
`);
|
|
1313
|
+
const mt = D;
|
|
1314
|
+
function Ne(t) {
|
|
1315
|
+
if (t == null) return /* @__PURE__ */ new Map();
|
|
1316
|
+
if (t instanceof Map) return new Map(t);
|
|
1317
|
+
if (Array.isArray(t)) return new Map(t);
|
|
1318
|
+
throw new TypeError("FilterPanel filters must be a Map or tuple array");
|
|
1319
|
+
}
|
|
1320
|
+
function pe(t) {
|
|
1321
|
+
if (typeof t == "string" || typeof t == "number") return t;
|
|
1322
|
+
if (t != null && typeof t == "object") {
|
|
1323
|
+
const r = Reflect.get(t, "value");
|
|
1324
|
+
if (typeof r == "string" || typeof r == "number") return r;
|
|
1325
|
+
}
|
|
1326
|
+
throw new TypeError("Filter options must be strings, numbers, or value/label objects");
|
|
1327
|
+
}
|
|
1328
|
+
function bt(t) {
|
|
1329
|
+
if (t != null && typeof t == "object") {
|
|
1330
|
+
const r = Reflect.get(t, "label");
|
|
1331
|
+
if (r != null) return gt(r) ? r : String(r);
|
|
1332
|
+
}
|
|
1333
|
+
return String(pe(t));
|
|
1334
|
+
}
|
|
1335
|
+
function yt(t) {
|
|
1336
|
+
return `${typeof t}:${String(t)}`;
|
|
1337
|
+
}
|
|
1338
|
+
function gt(t) {
|
|
1339
|
+
return typeof t == "string" || typeof t == "number";
|
|
1340
|
+
}
|
|
1341
|
+
function wt(t) {
|
|
1342
|
+
return t != null && (typeof t == "object" || typeof t == "function") && typeof Reflect.get(t, "get") == "function" && typeof Reflect.get(t, "subscribe") == "function";
|
|
1343
|
+
}
|
|
1344
|
+
function Et(t, r) {
|
|
1345
|
+
return t instanceof Error ? t.message : t == null ? r : String(t);
|
|
1346
|
+
}
|
|
1347
|
+
class W extends g {
|
|
1348
|
+
constructor() {
|
|
1349
|
+
super(...arguments);
|
|
1350
|
+
s(this, "filterVisible", !1);
|
|
1351
|
+
s(this, "onGlobalClick", (e) => {
|
|
1352
|
+
this.filterVisible && this.dom instanceof Node && e.target instanceof Node && !this.dom.contains(e.target) && (this.filterVisible = !1, this.update());
|
|
1353
|
+
});
|
|
1354
|
+
}
|
|
1355
|
+
initialize() {
|
|
1356
|
+
this.watch(this.props.sortEmitter, this.props.filtersEmitter), this.props.filterOptions != null && this.listen(document, "click", this.onGlobalClick);
|
|
1357
|
+
}
|
|
1358
|
+
toggleSort() {
|
|
1359
|
+
if (!this.props.sortable) return;
|
|
1360
|
+
const e = this.props.sortEmitter.get();
|
|
1361
|
+
let a;
|
|
1362
|
+
(e == null ? void 0 : e.field) !== this.props.field ? a = { field: this.props.field, direction: "asc" } : e.direction === "asc" ? a = { field: this.props.field, direction: "desc" } : a = null, this.props.sortEmitter.set(a, "table sort changed");
|
|
1363
|
+
}
|
|
1364
|
+
toggleFilterPanel(e) {
|
|
1365
|
+
e.stopPropagation(), this.filterVisible = !this.filterVisible, this.update();
|
|
1366
|
+
}
|
|
1367
|
+
updateFilters(e, a) {
|
|
1368
|
+
var n, o;
|
|
1369
|
+
const i = { ...this.props.filtersEmitter.get() };
|
|
1370
|
+
e.size === 0 ? delete i[this.props.field] : i[this.props.field] = [...e.entries()], this.props.filtersEmitter.set(i, "table filters changed"), (o = (n = this.props).onFilterChange) == null || o.call(n, i, a);
|
|
1371
|
+
}
|
|
1372
|
+
render() {
|
|
1373
|
+
const e = this.props.sortEmitter.get(), a = (e == null ? void 0 : e.field) === this.props.field ? e.direction : null, i = new Map(
|
|
1374
|
+
(this.props.filtersEmitter.get()[this.props.field] ?? []).filter(vt)
|
|
1375
|
+
), n = this.props.label ?? String(this.props.field), o = `Filter ${String(n)}`;
|
|
1376
|
+
let l = null;
|
|
1377
|
+
return this.filterVisible && this.props.filterOptions != null && (l = /* @__PURE__ */ u(
|
|
1378
|
+
V,
|
|
1379
|
+
{
|
|
1380
|
+
label: o,
|
|
1381
|
+
options: this.props.filterOptions,
|
|
1382
|
+
filters: i,
|
|
1383
|
+
onChange: (d, h) => this.updateFilters(d, h),
|
|
1384
|
+
...this.props.filterModes == null ? {} : { filterModes: this.props.filterModes },
|
|
1385
|
+
...this.props.defaultSemanticState == null ? {} : { defaultSemanticState: this.props.defaultSemanticState }
|
|
1386
|
+
},
|
|
1387
|
+
"filter-panel"
|
|
1388
|
+
)), /* @__PURE__ */ w(
|
|
1389
|
+
"th",
|
|
1390
|
+
{
|
|
1391
|
+
scope: "col",
|
|
1392
|
+
"data-fray-component": "table-header-cell",
|
|
1393
|
+
"aria-sort": a === "asc" ? "ascending" : a === "desc" ? "descending" : "none",
|
|
1394
|
+
style: { zIndex: this.filterVisible ? 1200 : null },
|
|
1395
|
+
children: [
|
|
1396
|
+
this.props.sortable ? /* @__PURE__ */ w(
|
|
1397
|
+
"button",
|
|
1398
|
+
{
|
|
1399
|
+
type: "button",
|
|
1400
|
+
"data-part": "sort",
|
|
1401
|
+
onClick: () => this.toggleSort(),
|
|
1402
|
+
children: [
|
|
1403
|
+
n,
|
|
1404
|
+
a === "asc" ? " ▲" : a === "desc" ? " ▼" : ""
|
|
1405
|
+
]
|
|
1406
|
+
}
|
|
1407
|
+
) : /* @__PURE__ */ u("span", { "data-part": "label", children: n }),
|
|
1408
|
+
this.props.filterOptions == null ? null : /* @__PURE__ */ u(
|
|
1409
|
+
"button",
|
|
1410
|
+
{
|
|
1411
|
+
type: "button",
|
|
1412
|
+
"data-part": "filter-toggle",
|
|
1413
|
+
"aria-label": o,
|
|
1414
|
+
"aria-expanded": String(this.filterVisible),
|
|
1415
|
+
onClick: (d) => this.toggleFilterPanel(d),
|
|
1416
|
+
children: "Filter"
|
|
1417
|
+
}
|
|
1418
|
+
),
|
|
1419
|
+
l
|
|
1420
|
+
]
|
|
1421
|
+
}
|
|
1422
|
+
);
|
|
1423
|
+
}
|
|
1424
|
+
}
|
|
1425
|
+
s(W, "dependencies", [V]), s(W, "baseStyles", [
|
|
1426
|
+
['th[data-fray-component="table-header-cell"]', "noselect"],
|
|
1427
|
+
['th[data-fray-component="table-header-cell"] > [data-part="sort"]', ["uiline", "button"]],
|
|
1428
|
+
['th[data-fray-component="table-header-cell"] > [data-part="filter-toggle"]', ["uiline", "button"]]
|
|
1429
|
+
]), s(W, "css", v`
|
|
1430
|
+
th[data-fray-component="table-header-cell"] {
|
|
1431
|
+
position: relative;
|
|
1432
|
+
text-align: start;
|
|
1433
|
+
color: var(
|
|
1434
|
+
--fray-table-header-color,
|
|
1435
|
+
var(--fray-section-header-color, var(--fray-header-color))
|
|
1436
|
+
);
|
|
1437
|
+
background: var(
|
|
1438
|
+
--fray-table-header-background,
|
|
1439
|
+
var(--fray-section-header-background, var(--fray-header-background))
|
|
1440
|
+
);
|
|
1441
|
+
border-block-end: var(--fray-section-header-border, var(--fray-header-border));
|
|
1442
|
+
box-shadow: var(--fray-section-header-shadow, var(--fray-header-shadow));
|
|
1443
|
+
}
|
|
1444
|
+
|
|
1445
|
+
th[data-fray-component="table-header-cell"] > [data-part="sort"],
|
|
1446
|
+
th[data-fray-component="table-header-cell"] > [data-part="filter-toggle"] {
|
|
1447
|
+
width: auto;
|
|
1448
|
+
font-family: inherit;
|
|
1449
|
+
color: inherit;
|
|
1450
|
+
background: var(
|
|
1451
|
+
--fray-table-header-button-background,
|
|
1452
|
+
var(--fray-button-background)
|
|
1453
|
+
);
|
|
1454
|
+
}
|
|
1455
|
+
|
|
1456
|
+
th[data-fray-component="table-header-cell"] > [data-part="filter-toggle"] {
|
|
1457
|
+
margin-inline-start: var(--ui-padding-h);
|
|
1458
|
+
font-size: 0.75em;
|
|
1459
|
+
}
|
|
1460
|
+
`);
|
|
1461
|
+
function vt(t) {
|
|
1462
|
+
return typeof t[0] == "string" || typeof t[0] == "number";
|
|
1463
|
+
}
|
|
1464
|
+
class me extends g {
|
|
1465
|
+
render() {
|
|
1466
|
+
return /* @__PURE__ */ u("thead", { "data-fray-component": "table-header", children: /* @__PURE__ */ u("tr", { children: this.props.columns.map((r) => /* @__PURE__ */ u(
|
|
1467
|
+
W,
|
|
1468
|
+
{
|
|
1469
|
+
field: r.field,
|
|
1470
|
+
sortEmitter: this.props.sortEmitter,
|
|
1471
|
+
filtersEmitter: this.props.filtersEmitter,
|
|
1472
|
+
...r.label == null ? {} : { label: r.label },
|
|
1473
|
+
...r.sortable == null ? {} : { sortable: r.sortable },
|
|
1474
|
+
...r.filterOptions == null ? {} : { filterOptions: r.filterOptions },
|
|
1475
|
+
...this.props.filterModes == null ? {} : { filterModes: this.props.filterModes },
|
|
1476
|
+
...this.props.defaultSemanticState == null ? {} : { defaultSemanticState: this.props.defaultSemanticState },
|
|
1477
|
+
...this.props.onFilterChange == null ? {} : { onFilterChange: this.props.onFilterChange }
|
|
1478
|
+
},
|
|
1479
|
+
String(r.field)
|
|
1480
|
+
)) }) });
|
|
1481
|
+
}
|
|
1482
|
+
}
|
|
1483
|
+
s(me, "dependencies", [W]);
|
|
1484
|
+
const St = {
|
|
1485
|
+
[y.Neutral]: "☐",
|
|
1486
|
+
[y.Prefer]: "",
|
|
1487
|
+
[y.Require]: "_",
|
|
1488
|
+
[y.Deny]: "!"
|
|
1489
|
+
};
|
|
1490
|
+
function kt(t, { sort: r = null, filters: e = {} } = {}) {
|
|
1491
|
+
Nt(t), r != null && (Ge(r), t.searchParams.set("sort", `${r.field}:${r.direction}`));
|
|
1492
|
+
for (const [a, i] of Object.entries(e))
|
|
1493
|
+
for (const [n, o] of i) {
|
|
1494
|
+
if (!de(o))
|
|
1495
|
+
throw new TypeError(`Unknown filter mode for ${a}: ${String(o)}`);
|
|
1496
|
+
t.searchParams.append(
|
|
1497
|
+
"filter",
|
|
1498
|
+
`${a}:${St[o]}:${JSON.stringify(n)}`
|
|
1499
|
+
);
|
|
1500
|
+
}
|
|
1501
|
+
return t;
|
|
1502
|
+
}
|
|
1503
|
+
function It(t, r, e) {
|
|
1504
|
+
if (!Array.isArray(t)) throw new TypeError("Local table data must be an array");
|
|
1505
|
+
const a = t.filter((n) => xt(n, e));
|
|
1506
|
+
if (r == null) return a;
|
|
1507
|
+
Ge(r);
|
|
1508
|
+
const i = r.direction === "asc" ? 1 : -1;
|
|
1509
|
+
return [...a].sort((n, o) => Rt(be(n, r.field), be(o, r.field)) * i);
|
|
1510
|
+
}
|
|
1511
|
+
function xt(t, r) {
|
|
1512
|
+
for (const [e, a] of Object.entries(r)) {
|
|
1513
|
+
const i = be(t, e);
|
|
1514
|
+
if (a.filter(([, d]) => d === y.Deny).some(([d]) => Object.is(d, i))) return !1;
|
|
1515
|
+
const o = a.filter(([, d]) => d === y.Require);
|
|
1516
|
+
if (o.length > 0 && !o.some(([d]) => Object.is(d, i))) return !1;
|
|
1517
|
+
const l = a.filter(([, d]) => d === y.Prefer);
|
|
1518
|
+
if (l.length > 0 && !l.some(([d]) => Object.is(d, i))) return !1;
|
|
1519
|
+
}
|
|
1520
|
+
return !0;
|
|
1521
|
+
}
|
|
1522
|
+
function Ge(t) {
|
|
1523
|
+
if (t == null || typeof t != "object" || typeof Reflect.get(t, "field") != "string" || !Tt(Reflect.get(t, "direction")))
|
|
1524
|
+
throw new TypeError("Table sort must contain a field and asc/desc direction");
|
|
1525
|
+
}
|
|
1526
|
+
function Tt(t) {
|
|
1527
|
+
return t === "asc" || t === "desc";
|
|
1528
|
+
}
|
|
1529
|
+
function Rt(t, r) {
|
|
1530
|
+
return Object.is(t, r) ? 0 : t == null ? -1 : r == null ? 1 : typeof t == "number" && typeof r == "number" ? t - r : String(t).localeCompare(String(r));
|
|
1531
|
+
}
|
|
1532
|
+
function be(t, r) {
|
|
1533
|
+
if (!(t == null || typeof t != "object" && typeof t != "function"))
|
|
1534
|
+
return Reflect.get(t, r);
|
|
1535
|
+
}
|
|
1536
|
+
function Nt(t) {
|
|
1537
|
+
if (t == null || typeof t != "object" && typeof t != "function" || typeof Reflect.get(t, "toString") != "function")
|
|
1538
|
+
throw new TypeError("Table serializer requires a URL");
|
|
1539
|
+
const r = Reflect.get(t, "searchParams");
|
|
1540
|
+
if (r == null || typeof Reflect.get(r, "set") != "function" || typeof Reflect.get(r, "append") != "function")
|
|
1541
|
+
throw new TypeError("Table serializer requires URL search parameters");
|
|
1542
|
+
}
|
|
1543
|
+
function Dt(t) {
|
|
1544
|
+
const r = ve(t), e = Qe(t.data) ? null : new I(t.data, {
|
|
1545
|
+
owner: t.owner,
|
|
1546
|
+
purpose: "local table data"
|
|
1547
|
+
}), a = e ?? t.data, i = new le(
|
|
1548
|
+
[a, r.sortEmitter, r.filtersEmitter],
|
|
1549
|
+
([n, o, l]) => It(n, o, l),
|
|
1550
|
+
{ owner: t.owner, purpose: "local table view" }
|
|
1551
|
+
);
|
|
1552
|
+
return new Ee(i, r, () => {
|
|
1553
|
+
i.dispose(), e == null || e.dispose();
|
|
1554
|
+
});
|
|
1555
|
+
}
|
|
1556
|
+
function or(t) {
|
|
1557
|
+
Ct(t.query);
|
|
1558
|
+
const r = ve(t);
|
|
1559
|
+
return new Ee(t.query, r);
|
|
1560
|
+
}
|
|
1561
|
+
function Ot(t) {
|
|
1562
|
+
if (t.handler == null || typeof t.handler.fetch != "function")
|
|
1563
|
+
throw new TypeError("Table data-source handler must implement fetch");
|
|
1564
|
+
const r = ve(t), e = new ke("sort", r.sortEmitter, {
|
|
1565
|
+
owner: t.owner,
|
|
1566
|
+
purpose: "table sort argument"
|
|
1567
|
+
}), a = new ke("filters", r.filtersEmitter, {
|
|
1568
|
+
owner: t.owner,
|
|
1569
|
+
purpose: "table filters argument"
|
|
1570
|
+
}), i = new Xe({
|
|
1571
|
+
handler: t.handler,
|
|
1572
|
+
args: { sort: e, filters: a },
|
|
1573
|
+
owner: t.owner,
|
|
1574
|
+
purpose: "table query",
|
|
1575
|
+
keepPreviousValue: !0
|
|
1576
|
+
});
|
|
1577
|
+
return new Ee(i, r, () => {
|
|
1578
|
+
i.dispose(), e.dispose(), a.dispose();
|
|
1579
|
+
});
|
|
1580
|
+
}
|
|
1581
|
+
function $t(t) {
|
|
1582
|
+
if (typeof t.url != "string" || t.url.length === 0)
|
|
1583
|
+
throw new TypeError("REST table data source requires a URL");
|
|
1584
|
+
const r = {
|
|
1585
|
+
url: t.url,
|
|
1586
|
+
serialize: t.serializeQuery ?? kt
|
|
1587
|
+
};
|
|
1588
|
+
return t.baseUrl != null && (r.baseUrl = t.baseUrl), t.fetch != null && (r.fetch = t.fetch), Ot({
|
|
1589
|
+
handler: new Ze(r),
|
|
1590
|
+
...t.sortEmitter == null ? {} : { sortEmitter: t.sortEmitter },
|
|
1591
|
+
...t.filtersEmitter == null ? {} : { filtersEmitter: t.filtersEmitter },
|
|
1592
|
+
...t.owner === void 0 ? {} : { owner: t.owner }
|
|
1593
|
+
});
|
|
1594
|
+
}
|
|
1595
|
+
class Ee {
|
|
1596
|
+
constructor(r, e, a = null) {
|
|
1597
|
+
s(this, "sortEmitter");
|
|
1598
|
+
s(this, "filtersEmitter");
|
|
1599
|
+
s(this, "retry");
|
|
1600
|
+
s(this, "disposed", !1);
|
|
1601
|
+
this.query = r, this.state = e, this.disposeQuery = a, this.sortEmitter = e.sortEmitter, this.filtersEmitter = e.filtersEmitter, r.retry != null && (this.retry = (i) => {
|
|
1602
|
+
var n;
|
|
1603
|
+
return (n = r.retry) == null ? void 0 : n.call(r, i);
|
|
1604
|
+
});
|
|
1605
|
+
}
|
|
1606
|
+
dispose() {
|
|
1607
|
+
var r, e, a;
|
|
1608
|
+
this.disposed || (this.disposed = !0, (r = this.disposeQuery) == null || r.call(this), (e = this.state.ownedSortEmitter) == null || e.dispose(), (a = this.state.ownedFiltersEmitter) == null || a.dispose());
|
|
1609
|
+
}
|
|
1610
|
+
}
|
|
1611
|
+
function ve(t) {
|
|
1612
|
+
const r = t.sortEmitter == null ? new I(null, {
|
|
1613
|
+
owner: t.owner,
|
|
1614
|
+
purpose: "table sort"
|
|
1615
|
+
}) : null, e = t.filtersEmitter == null ? new I({}, {
|
|
1616
|
+
owner: t.owner,
|
|
1617
|
+
purpose: "table filters"
|
|
1618
|
+
}) : null;
|
|
1619
|
+
return {
|
|
1620
|
+
sortEmitter: t.sortEmitter ?? r,
|
|
1621
|
+
filtersEmitter: t.filtersEmitter ?? e,
|
|
1622
|
+
ownedSortEmitter: r,
|
|
1623
|
+
ownedFiltersEmitter: e
|
|
1624
|
+
};
|
|
1625
|
+
}
|
|
1626
|
+
function Qe(t) {
|
|
1627
|
+
return t != null && (typeof t == "object" || typeof t == "function") && typeof Reflect.get(t, "get") == "function" && typeof Reflect.get(t, "subscribe") == "function" && typeof Reflect.get(t, "getFetchState") == "function" && typeof Reflect.get(t, "getError") == "function";
|
|
1628
|
+
}
|
|
1629
|
+
function Ct(t) {
|
|
1630
|
+
if (!Qe(t))
|
|
1631
|
+
throw new TypeError("Table query must be an emitter");
|
|
1632
|
+
}
|
|
1633
|
+
class X extends g {
|
|
1634
|
+
constructor(e) {
|
|
1635
|
+
var a, i;
|
|
1636
|
+
super(e);
|
|
1637
|
+
s(this, "columns");
|
|
1638
|
+
s(this, "rowKey");
|
|
1639
|
+
s(this, "sortEmitter");
|
|
1640
|
+
s(this, "filtersEmitter");
|
|
1641
|
+
s(this, "selectedItemsEmitter");
|
|
1642
|
+
s(this, "selectedItemEmitter");
|
|
1643
|
+
s(this, "selectionHandler");
|
|
1644
|
+
s(this, "query", null);
|
|
1645
|
+
s(this, "dataSource", null);
|
|
1646
|
+
s(this, "suppliedDataSource");
|
|
1647
|
+
s(this, "ownedSortEmitter");
|
|
1648
|
+
s(this, "ownedFiltersEmitter");
|
|
1649
|
+
s(this, "ownedDataSource", null);
|
|
1650
|
+
At(e), this.columns = Kt(e.columns), this.rowKey = jt(e.rowKey), this.suppliedDataSource = e.dataSource ?? null, this.ownedSortEmitter = this.suppliedDataSource == null ? new I(null, { owner: this, purpose: "table sort" }) : null, this.ownedFiltersEmitter = this.suppliedDataSource == null ? new I({}, { owner: this, purpose: "table filters" }) : null, this.sortEmitter = ((a = this.suppliedDataSource) == null ? void 0 : a.sortEmitter) ?? this.ownedSortEmitter, this.filtersEmitter = ((i = this.suppliedDataSource) == null ? void 0 : i.filtersEmitter) ?? this.ownedFiltersEmitter, this.selectionHandler = e.multiSelect === !0 ? ne({
|
|
1651
|
+
owner: this,
|
|
1652
|
+
multiSelect: !0,
|
|
1653
|
+
...e.selectedItemsEmitter == null ? {} : { selectedItemsEmitter: e.selectedItemsEmitter },
|
|
1654
|
+
getItems: () => {
|
|
1655
|
+
var n;
|
|
1656
|
+
return ((n = this.query) == null ? void 0 : n.get()) ?? [];
|
|
1657
|
+
},
|
|
1658
|
+
getKey: this.rowKey
|
|
1659
|
+
}) : ne({
|
|
1660
|
+
owner: this,
|
|
1661
|
+
...e.selectedItemEmitter == null ? {} : { selectedItemEmitter: e.selectedItemEmitter },
|
|
1662
|
+
getItems: () => {
|
|
1663
|
+
var n;
|
|
1664
|
+
return ((n = this.query) == null ? void 0 : n.get()) ?? [];
|
|
1665
|
+
},
|
|
1666
|
+
getKey: this.rowKey
|
|
1667
|
+
}), this.selectedItemsEmitter = this.selectionHandler.selectedItemsEmitter, this.selectedItemEmitter = this.selectionHandler instanceof ge ? this.selectionHandler.selectedItemEmitter : null;
|
|
1668
|
+
}
|
|
1669
|
+
initialize() {
|
|
1670
|
+
this.suppliedDataSource != null ? this.dataSource = this.suppliedDataSource : this.props.rest != null ? (this.ownedDataSource = $t({
|
|
1671
|
+
...this.props.rest,
|
|
1672
|
+
sortEmitter: this.sortEmitter,
|
|
1673
|
+
filtersEmitter: this.filtersEmitter,
|
|
1674
|
+
owner: this
|
|
1675
|
+
}), this.dataSource = this.ownedDataSource) : (this.ownedDataSource = Dt({
|
|
1676
|
+
data: this.props.data ?? [],
|
|
1677
|
+
sortEmitter: this.sortEmitter,
|
|
1678
|
+
filtersEmitter: this.filtersEmitter,
|
|
1679
|
+
owner: this
|
|
1680
|
+
}), this.dataSource = this.ownedDataSource), this.query = this.dataSource.query, this.watch(this.query, this.selectedItemsEmitter);
|
|
1681
|
+
}
|
|
1682
|
+
render() {
|
|
1683
|
+
var d, h, f, p;
|
|
1684
|
+
const e = ((d = this.query) == null ? void 0 : d.get()) ?? [];
|
|
1685
|
+
if (!Array.isArray(e)) throw new TypeError("DataTable query value must be an array");
|
|
1686
|
+
const a = ((h = this.query) == null ? void 0 : h.getFetchState()) ?? k.Initial, i = (f = this.query) == null ? void 0 : f.getError(), n = a === k.Initial || a === k.Loading, o = new Set(
|
|
1687
|
+
this.selectedItemsEmitter.get().map((m, b) => this.rowKey(m, b))
|
|
1688
|
+
), l = this.Host;
|
|
1689
|
+
return /* @__PURE__ */ w(
|
|
1690
|
+
l,
|
|
1691
|
+
{
|
|
1692
|
+
className: E(this.props) || null,
|
|
1693
|
+
"data-loading": n ? "" : null,
|
|
1694
|
+
"data-error": a === k.Error ? "" : null,
|
|
1695
|
+
children: [
|
|
1696
|
+
n ? /* @__PURE__ */ u("p", { role: "status", "data-part": "status", children: "Loading rows…" }) : null,
|
|
1697
|
+
a === k.Error ? /* @__PURE__ */ w("div", { "data-part": "error", role: "alert", children: [
|
|
1698
|
+
/* @__PURE__ */ u("span", { children: Ht(i, "Unable to load rows") }),
|
|
1699
|
+
typeof ((p = this.dataSource) == null ? void 0 : p.retry) == "function" ? /* @__PURE__ */ u(
|
|
1700
|
+
"button",
|
|
1701
|
+
{
|
|
1702
|
+
type: "button",
|
|
1703
|
+
onClick: () => {
|
|
1704
|
+
var m, b;
|
|
1705
|
+
return (b = (m = this.dataSource) == null ? void 0 : m.retry) == null ? void 0 : b.call(m, "table retry");
|
|
1706
|
+
},
|
|
1707
|
+
children: "Retry"
|
|
1708
|
+
}
|
|
1709
|
+
) : null
|
|
1710
|
+
] }) : null,
|
|
1711
|
+
/* @__PURE__ */ w("table", { "data-part": "table", "aria-busy": n ? "true" : null, children: [
|
|
1712
|
+
this.props.caption == null ? null : /* @__PURE__ */ u("caption", { children: this.props.caption }),
|
|
1713
|
+
/* @__PURE__ */ u(
|
|
1714
|
+
me,
|
|
1715
|
+
{
|
|
1716
|
+
columns: this.columns,
|
|
1717
|
+
sortEmitter: this.sortEmitter,
|
|
1718
|
+
filtersEmitter: this.filtersEmitter,
|
|
1719
|
+
...this.props.filterModes == null ? {} : { filterModes: this.props.filterModes },
|
|
1720
|
+
...this.props.defaultSemanticState == null ? {} : { defaultSemanticState: this.props.defaultSemanticState },
|
|
1721
|
+
...this.props.onFilterChange == null ? {} : { onFilterChange: this.props.onFilterChange }
|
|
1722
|
+
},
|
|
1723
|
+
"header"
|
|
1724
|
+
),
|
|
1725
|
+
/* @__PURE__ */ u("tbody", { children: e.length > 0 ? e.map((m, b) => this.renderRow(m, b, o)) : n ? this.renderPlaceholders() : a === k.Error ? null : /* @__PURE__ */ u("tr", { children: /* @__PURE__ */ u("td", { colSpan: this.columns.length, children: this.props.emptyMessage ?? "No rows" }) }, "empty") })
|
|
1726
|
+
] })
|
|
1727
|
+
]
|
|
1728
|
+
}
|
|
1729
|
+
);
|
|
1730
|
+
}
|
|
1731
|
+
renderRow(e, a, i) {
|
|
1732
|
+
const n = this.rowKey(e, a), o = i.has(n);
|
|
1733
|
+
return /* @__PURE__ */ u(
|
|
1734
|
+
"tr",
|
|
1735
|
+
{
|
|
1736
|
+
"data-fray-selectable-row": "",
|
|
1737
|
+
"data-index": a,
|
|
1738
|
+
"aria-selected": String(o),
|
|
1739
|
+
tabIndex: a === 0 ? 0 : -1,
|
|
1740
|
+
children: this.columns.map((l) => /* @__PURE__ */ u("td", { children: l.render ? l.render(e, a) : Ft(e[l.field]) }, String(l.field)))
|
|
1741
|
+
},
|
|
1742
|
+
String(n)
|
|
1743
|
+
);
|
|
1744
|
+
}
|
|
1745
|
+
renderPlaceholders() {
|
|
1746
|
+
const e = this.props.placeholderCount ?? 5;
|
|
1747
|
+
return Array.from({ length: e }, (a, i) => /* @__PURE__ */ u("tr", { children: this.columns.map((n, o) => /* @__PURE__ */ u("td", { children: /* @__PURE__ */ u(
|
|
1748
|
+
H,
|
|
1749
|
+
{
|
|
1750
|
+
width: 45 + (i + o) % 6 * 8
|
|
1751
|
+
}
|
|
1752
|
+
) }, String(n.field))) }, `placeholder-${i}`));
|
|
1753
|
+
}
|
|
1754
|
+
afterUpdate(e) {
|
|
1755
|
+
const a = e instanceof Element ? e.querySelectorAll("tbody [data-fray-selectable-row]") : [];
|
|
1756
|
+
this.selectionHandler.rowsUpdated(a);
|
|
1757
|
+
}
|
|
1758
|
+
getSelectedRows() {
|
|
1759
|
+
return this.selectionHandler.getSelectedItems();
|
|
1760
|
+
}
|
|
1761
|
+
getSelectedRowsEmitter() {
|
|
1762
|
+
return this.selectedItemsEmitter;
|
|
1763
|
+
}
|
|
1764
|
+
getSelectedRow() {
|
|
1765
|
+
var e;
|
|
1766
|
+
return ((e = this.selectedItemEmitter) == null ? void 0 : e.get()) ?? null;
|
|
1767
|
+
}
|
|
1768
|
+
getSelectedRowEmitter() {
|
|
1769
|
+
return this.selectedItemEmitter;
|
|
1770
|
+
}
|
|
1771
|
+
onDestroy() {
|
|
1772
|
+
var e, a, i;
|
|
1773
|
+
this.selectionHandler.destroy(), (e = this.ownedDataSource) == null || e.dispose(), (a = this.ownedSortEmitter) == null || a.dispose(), (i = this.ownedFiltersEmitter) == null || i.dispose();
|
|
1774
|
+
}
|
|
1775
|
+
}
|
|
1776
|
+
s(X, "dependencies", [H, me]), s(X, "hostName", "data-table"), s(X, "standaloneHostName", "data-table"), s(X, "css", v`
|
|
1777
|
+
& {
|
|
1778
|
+
overflow: auto;
|
|
1779
|
+
color: var(--ui-text-color);
|
|
1780
|
+
}
|
|
1781
|
+
|
|
1782
|
+
& > table {
|
|
1783
|
+
width: 100%;
|
|
1784
|
+
border-collapse: collapse;
|
|
1785
|
+
}
|
|
1786
|
+
|
|
1787
|
+
& thead:has([data-fray-component="filter-panel"]) {
|
|
1788
|
+
position: relative;
|
|
1789
|
+
z-index: 1100;
|
|
1790
|
+
}
|
|
1791
|
+
|
|
1792
|
+
& th,
|
|
1793
|
+
& td {
|
|
1794
|
+
padding: var(--ui-padding-v) var(--ui-padding-h);
|
|
1795
|
+
text-align: start;
|
|
1796
|
+
}
|
|
1797
|
+
|
|
1798
|
+
& tbody tr[data-fray-selectable-row] {
|
|
1799
|
+
cursor: default;
|
|
1800
|
+
user-select: none;
|
|
1801
|
+
}
|
|
1802
|
+
|
|
1803
|
+
& tbody tr:nth-child(odd) {
|
|
1804
|
+
background: var(--fray-table-row-background, transparent);
|
|
1805
|
+
}
|
|
1806
|
+
|
|
1807
|
+
& tbody tr:nth-child(even) {
|
|
1808
|
+
background: var(--fray-table-row-alt-background, transparent);
|
|
1809
|
+
}
|
|
1810
|
+
|
|
1811
|
+
& tbody tr[data-fray-selectable-row]:hover {
|
|
1812
|
+
background: var(--fray-row-hover-background, var(--button-background-hover));
|
|
1813
|
+
}
|
|
1814
|
+
|
|
1815
|
+
& tbody tr[data-fray-selectable-row]:focus-visible {
|
|
1816
|
+
outline: 2px solid var(--fray-color-focus, var(--ui-accent-color));
|
|
1817
|
+
outline-offset: -2px;
|
|
1818
|
+
}
|
|
1819
|
+
|
|
1820
|
+
& tbody tr[data-fray-selectable-row][aria-selected="true"] {
|
|
1821
|
+
color: var(--fray-selection-color, var(--toggle-selected-text));
|
|
1822
|
+
background: var(--fray-selection-background, var(--toggle-selected-bg));
|
|
1823
|
+
}
|
|
1824
|
+
|
|
1825
|
+
& > [data-part="error"] {
|
|
1826
|
+
color: var(--error-color);
|
|
1827
|
+
}
|
|
1828
|
+
`);
|
|
1829
|
+
function Kt(t) {
|
|
1830
|
+
if (!Array.isArray(t) || t.length === 0)
|
|
1831
|
+
throw new TypeError("DataTable columns must be a non-empty array");
|
|
1832
|
+
const r = /* @__PURE__ */ new Set();
|
|
1833
|
+
return t.map((e) => {
|
|
1834
|
+
if (e == null || typeof e != "object")
|
|
1835
|
+
throw new TypeError("Every DataTable column requires a field");
|
|
1836
|
+
const a = Reflect.get(e, "field");
|
|
1837
|
+
if (typeof a != "string" || a.length === 0)
|
|
1838
|
+
throw new TypeError("Every DataTable column requires a field");
|
|
1839
|
+
if (r.has(a)) throw new Error(`Duplicate DataTable column: ${a}`);
|
|
1840
|
+
r.add(a);
|
|
1841
|
+
const i = Reflect.get(e, "render");
|
|
1842
|
+
if (i != null && typeof i != "function")
|
|
1843
|
+
throw new TypeError(`DataTable column ${a} render must be a function`);
|
|
1844
|
+
return e;
|
|
1845
|
+
});
|
|
1846
|
+
}
|
|
1847
|
+
function At(t) {
|
|
1848
|
+
var o, l;
|
|
1849
|
+
const e = [
|
|
1850
|
+
"mode",
|
|
1851
|
+
"query",
|
|
1852
|
+
"queryHandler",
|
|
1853
|
+
"queryUrl",
|
|
1854
|
+
"baseUrl",
|
|
1855
|
+
"fetch",
|
|
1856
|
+
"serializeQuery"
|
|
1857
|
+
].find((d) => Object.hasOwn(t, d));
|
|
1858
|
+
if (e != null)
|
|
1859
|
+
throw new TypeError(
|
|
1860
|
+
`DataTable ${e} moved to dataSource/rest; see the 0.3 migration guide`
|
|
1861
|
+
);
|
|
1862
|
+
const a = t.data !== void 0, i = t.dataSource !== void 0, n = t.rest !== void 0;
|
|
1863
|
+
if (Number(a) + Number(i) + Number(n) > 1)
|
|
1864
|
+
throw new TypeError("DataTable accepts exactly one of data, dataSource, or rest");
|
|
1865
|
+
if (i) {
|
|
1866
|
+
const d = t.dataSource;
|
|
1867
|
+
if (d == null || typeof d != "object" || d.query == null || typeof ((o = d.sortEmitter) == null ? void 0 : o.set) != "function" || typeof ((l = d.filtersEmitter) == null ? void 0 : l.set) != "function" || typeof d.dispose != "function")
|
|
1868
|
+
throw new TypeError("DataTable dataSource must implement the table data-source contract");
|
|
1869
|
+
}
|
|
1870
|
+
}
|
|
1871
|
+
function jt(t) {
|
|
1872
|
+
if (t == null) return we;
|
|
1873
|
+
if (typeof t == "function") return t;
|
|
1874
|
+
if (typeof t == "string" && t.length > 0)
|
|
1875
|
+
return (r, e) => {
|
|
1876
|
+
const a = r[t];
|
|
1877
|
+
if (a == null)
|
|
1878
|
+
throw new TypeError(`DataTable row at index ${e} lacks ${t}`);
|
|
1879
|
+
return a;
|
|
1880
|
+
};
|
|
1881
|
+
throw new TypeError("DataTable rowKey must be a function or property name");
|
|
1882
|
+
}
|
|
1883
|
+
function Ft(t) {
|
|
1884
|
+
return t == null || typeof t == "string" || typeof t == "number" ? t : String(t);
|
|
1885
|
+
}
|
|
1886
|
+
function Ht(t, r) {
|
|
1887
|
+
return t instanceof Error ? t.message : t == null ? r : String(t);
|
|
1888
|
+
}
|
|
1889
|
+
class We extends g {
|
|
1890
|
+
render() {
|
|
1891
|
+
return this.props.children ?? [];
|
|
1892
|
+
}
|
|
1893
|
+
}
|
|
1894
|
+
function P(t) {
|
|
1895
|
+
if (!Array.isArray(t)) throw new TypeError("Tree nodes must be an array");
|
|
1896
|
+
const r = /* @__PURE__ */ new Set(), e = (a) => {
|
|
1897
|
+
for (const i of a) {
|
|
1898
|
+
if (i == null || typeof i != "object" || i.id == null)
|
|
1899
|
+
throw new TypeError("Each tree node requires an id");
|
|
1900
|
+
if (r.has(i.id)) throw new Error(`Duplicate tree item id: ${String(i.id)}`);
|
|
1901
|
+
if (r.add(i.id), !Array.isArray(i.children ?? []))
|
|
1902
|
+
throw new TypeError(`Tree node ${String(i.id)} children must be an array`);
|
|
1903
|
+
e(i.children ?? []);
|
|
1904
|
+
}
|
|
1905
|
+
};
|
|
1906
|
+
e(t);
|
|
1907
|
+
}
|
|
1908
|
+
function lr(t, r) {
|
|
1909
|
+
return P(t), Se(t, r);
|
|
1910
|
+
}
|
|
1911
|
+
function dr(t, r, e = null) {
|
|
1912
|
+
return new le(
|
|
1913
|
+
[t, r],
|
|
1914
|
+
([a, i]) => (P(a), i == null ? null : Se(a, i)),
|
|
1915
|
+
{ owner: e, purpose: "tree node projection" }
|
|
1916
|
+
);
|
|
1917
|
+
}
|
|
1918
|
+
function Mt(t, r, e) {
|
|
1919
|
+
if (P(t), typeof e != "function") throw new TypeError("Tree node update must be a function");
|
|
1920
|
+
const a = (n) => {
|
|
1921
|
+
for (let o = 0; o < n.length; o += 1) {
|
|
1922
|
+
const l = n[o];
|
|
1923
|
+
if (Object.is(l.id, r)) {
|
|
1924
|
+
const f = e(l);
|
|
1925
|
+
if (f == null || typeof f != "object")
|
|
1926
|
+
throw new TypeError("Tree node update must return a tree node");
|
|
1927
|
+
if (!Object.is(f.id, l.id))
|
|
1928
|
+
throw new Error("Tree node update cannot change the stable id");
|
|
1929
|
+
if (Object.is(f, l)) return n;
|
|
1930
|
+
const p = [...n];
|
|
1931
|
+
return p[o] = f, p;
|
|
1932
|
+
}
|
|
1933
|
+
const d = l.children ?? [], h = a(d);
|
|
1934
|
+
if (!Object.is(h, d)) {
|
|
1935
|
+
const f = [...n];
|
|
1936
|
+
return f[o] = { ...l, children: h }, f;
|
|
1937
|
+
}
|
|
1938
|
+
}
|
|
1939
|
+
return n;
|
|
1940
|
+
}, i = a(t);
|
|
1941
|
+
return Object.is(i, t) || P(i), i;
|
|
1942
|
+
}
|
|
1943
|
+
function cr(t, r, e, a = "tree node updated") {
|
|
1944
|
+
const i = t.get(), n = Mt(i, r, e);
|
|
1945
|
+
return Object.is(n, i) ? !1 : t.set(n, a);
|
|
1946
|
+
}
|
|
1947
|
+
function Se(t, r) {
|
|
1948
|
+
for (const e of t) {
|
|
1949
|
+
if (Object.is(e.id, r)) return e;
|
|
1950
|
+
const a = Se(e.children ?? [], r);
|
|
1951
|
+
if (a != null) return a;
|
|
1952
|
+
}
|
|
1953
|
+
return null;
|
|
1954
|
+
}
|
|
1955
|
+
class Z extends g {
|
|
1956
|
+
constructor(e) {
|
|
1957
|
+
super(e);
|
|
1958
|
+
s(this, "nodesEmitter");
|
|
1959
|
+
s(this, "selectedKeyEmitter");
|
|
1960
|
+
s(this, "expandedKeysEmitter");
|
|
1961
|
+
s(this, "ownedNodesEmitter");
|
|
1962
|
+
s(this, "ownedSelectedEmitter");
|
|
1963
|
+
s(this, "ownedExpandedEmitter");
|
|
1964
|
+
s(this, "focusedKey", null);
|
|
1965
|
+
s(this, "typeahead", "");
|
|
1966
|
+
s(this, "typeaheadTimer", null);
|
|
1967
|
+
if (Vt(e.nodes))
|
|
1968
|
+
this.nodesEmitter = e.nodes, this.ownedNodesEmitter = null;
|
|
1969
|
+
else {
|
|
1970
|
+
const a = e.nodes ?? Je(e.children);
|
|
1971
|
+
this.ownedNodesEmitter = new I(a, {
|
|
1972
|
+
owner: this,
|
|
1973
|
+
purpose: "tree nodes"
|
|
1974
|
+
}), this.nodesEmitter = this.ownedNodesEmitter;
|
|
1975
|
+
}
|
|
1976
|
+
this.ownedSelectedEmitter = e.selectedKeyEmitter == null ? new I(null, { owner: this, purpose: "selected tree key" }) : null, this.selectedKeyEmitter = e.selectedKeyEmitter ?? this.ownedSelectedEmitter, this.ownedExpandedEmitter = e.expandedKeysEmitter == null ? new I([], { owner: this, purpose: "expanded tree keys" }) : null, this.expandedKeysEmitter = e.expandedKeysEmitter ?? this.ownedExpandedEmitter;
|
|
1977
|
+
}
|
|
1978
|
+
initialize() {
|
|
1979
|
+
this.reconcile(this.nodesEmitter.get()), this.watch(this.nodesEmitter, this.selectedKeyEmitter, this.expandedKeysEmitter), this.onCleanup(this.nodesEmitter.subscribe(({ value: e }) => this.reconcile(e), {
|
|
1980
|
+
emitCurrent: !1
|
|
1981
|
+
}));
|
|
1982
|
+
}
|
|
1983
|
+
render() {
|
|
1984
|
+
const e = this.nodesEmitter.get();
|
|
1985
|
+
P(e);
|
|
1986
|
+
const a = new Set(this.expandedKeysEmitter.get()), i = De(e, a), n = this.selectedKeyEmitter.get(), o = i.find(({ node: d }) => Object.is(d.id, this.focusedKey)) ?? i.find(({ node: d }) => Object.is(d.id, n)) ?? i[0] ?? null;
|
|
1987
|
+
this.focusedKey = (o == null ? void 0 : o.node.id) ?? null;
|
|
1988
|
+
const l = this.Host;
|
|
1989
|
+
return /* @__PURE__ */ u(l, { className: E(this.props) || null, children: i.length === 0 ? /* @__PURE__ */ u("p", { role: "status", "data-part": "empty", children: "No tree items" }) : /* @__PURE__ */ u("div", { role: "tree", "aria-label": this.props.label, "data-part": "tree", children: i.map((d, h) => {
|
|
1990
|
+
var K, A, F;
|
|
1991
|
+
const { node: f, depth: p, position: m, setSize: b } = d, S = (((K = f.children) == null ? void 0 : K.length) ?? 0) > 0, x = S && a.has(f.id), O = Object.is(f.id, n), $ = ((F = (A = this.props).renderItem) == null ? void 0 : F.call(A, f, p)) ?? f.label;
|
|
1992
|
+
return /* @__PURE__ */ w(
|
|
1993
|
+
"div",
|
|
1994
|
+
{
|
|
1995
|
+
role: "treeitem",
|
|
1996
|
+
"data-part": "item",
|
|
1997
|
+
"data-index": h,
|
|
1998
|
+
"data-depth": p,
|
|
1999
|
+
"aria-level": p + 1,
|
|
2000
|
+
"aria-posinset": m,
|
|
2001
|
+
"aria-setsize": b,
|
|
2002
|
+
"aria-expanded": S ? String(x) : null,
|
|
2003
|
+
"aria-selected": String(O),
|
|
2004
|
+
tabIndex: Object.is(f.id, o == null ? void 0 : o.node.id) ? 0 : -1,
|
|
2005
|
+
style: { "--tree-depth": p },
|
|
2006
|
+
onClick: (T) => {
|
|
2007
|
+
if (this.focusedKey = f.id, Ut(T.target) && S) {
|
|
2008
|
+
this.toggleExpanded(f.id), this.focusRow(f.id);
|
|
2009
|
+
return;
|
|
2010
|
+
}
|
|
2011
|
+
this.selectNode(f, T);
|
|
2012
|
+
},
|
|
2013
|
+
onFocus: () => this.focusedKey = f.id,
|
|
2014
|
+
onKeyDown: (T) => this.handleKeyDown(T, h, i),
|
|
2015
|
+
children: [
|
|
2016
|
+
/* @__PURE__ */ u(
|
|
2017
|
+
"span",
|
|
2018
|
+
{
|
|
2019
|
+
"data-part": "expander",
|
|
2020
|
+
"data-expandable": S ? "" : null,
|
|
2021
|
+
"aria-hidden": "true",
|
|
2022
|
+
children: S ? x ? "▾" : "▸" : "•"
|
|
2023
|
+
}
|
|
2024
|
+
),
|
|
2025
|
+
/* @__PURE__ */ u("span", { "data-part": "label", children: $ })
|
|
2026
|
+
]
|
|
2027
|
+
},
|
|
2028
|
+
f.id
|
|
2029
|
+
);
|
|
2030
|
+
}) }) });
|
|
2031
|
+
}
|
|
2032
|
+
onDestroy() {
|
|
2033
|
+
var e, a, i;
|
|
2034
|
+
this.typeaheadTimer != null && clearTimeout(this.typeaheadTimer), (e = this.ownedNodesEmitter) == null || e.dispose(), (a = this.ownedSelectedEmitter) == null || a.dispose(), (i = this.ownedExpandedEmitter) == null || i.dispose();
|
|
2035
|
+
}
|
|
2036
|
+
reconcile(e) {
|
|
2037
|
+
P(e);
|
|
2038
|
+
const a = new Set(zt(e).map(({ node: l }) => l.id)), i = this.selectedKeyEmitter.get();
|
|
2039
|
+
this.ownedSelectedEmitter != null && i != null && !a.has(i) && this.selectedKeyEmitter.set(null, "selected tree item removed");
|
|
2040
|
+
const n = this.expandedKeysEmitter.get(), o = n.filter((l) => a.has(l));
|
|
2041
|
+
this.ownedExpandedEmitter != null && !Lt(n, o) && this.expandedKeysEmitter.set(o, "removed tree expansions reconciled"), this.focusedKey != null && !a.has(this.focusedKey) && (this.focusedKey = null);
|
|
2042
|
+
}
|
|
2043
|
+
selectNode(e, a) {
|
|
2044
|
+
this.selectedKeyEmitter.set(e.id, "tree item selected"), C(this.props.onSelect, e, a), this.focusRow(e.id);
|
|
2045
|
+
}
|
|
2046
|
+
toggleExpanded(e) {
|
|
2047
|
+
const a = this.expandedKeysEmitter.get(), i = a.some((n) => Object.is(n, e));
|
|
2048
|
+
this.expandedKeysEmitter.set(
|
|
2049
|
+
i ? a.filter((n) => !Object.is(n, e)) : [...a, e],
|
|
2050
|
+
i ? "tree item collapsed" : "tree item expanded"
|
|
2051
|
+
);
|
|
2052
|
+
}
|
|
2053
|
+
handleKeyDown(e, a, i) {
|
|
2054
|
+
var o, l, d, h;
|
|
2055
|
+
const n = i[a];
|
|
2056
|
+
if (n != null) {
|
|
2057
|
+
if (e.key === "ArrowDown") return this.move(e, (o = i[a + 1]) == null ? void 0 : o.node.id);
|
|
2058
|
+
if (e.key === "ArrowUp") return this.move(e, (l = i[a - 1]) == null ? void 0 : l.node.id);
|
|
2059
|
+
if (e.key === "Home") return this.move(e, (d = i[0]) == null ? void 0 : d.node.id);
|
|
2060
|
+
if (e.key === "End") return this.move(e, (h = i.at(-1)) == null ? void 0 : h.node.id);
|
|
2061
|
+
if (e.key === "ArrowRight") {
|
|
2062
|
+
e.preventDefault();
|
|
2063
|
+
const f = n.node.children ?? [];
|
|
2064
|
+
if (f.length === 0) return;
|
|
2065
|
+
this.expandedKeysEmitter.get().some((m) => Object.is(m, n.node.id)) ? this.focusRow(f[0].id) : this.toggleExpanded(n.node.id);
|
|
2066
|
+
return;
|
|
2067
|
+
}
|
|
2068
|
+
if (e.key === "ArrowLeft") {
|
|
2069
|
+
e.preventDefault(), this.expandedKeysEmitter.get().some((p) => Object.is(p, n.node.id)) ? this.toggleExpanded(n.node.id) : n.parentId != null && this.focusRow(n.parentId);
|
|
2070
|
+
return;
|
|
2071
|
+
}
|
|
2072
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
2073
|
+
e.preventDefault(), this.selectNode(n.node, e);
|
|
2074
|
+
return;
|
|
2075
|
+
}
|
|
2076
|
+
e.key.length === 1 && !e.altKey && !e.ctrlKey && !e.metaKey && this.handleTypeahead(e, i, a);
|
|
2077
|
+
}
|
|
2078
|
+
}
|
|
2079
|
+
move(e, a) {
|
|
2080
|
+
a !== void 0 && (e.preventDefault(), this.focusRow(a));
|
|
2081
|
+
}
|
|
2082
|
+
focusRow(e) {
|
|
2083
|
+
var i;
|
|
2084
|
+
this.focusedKey = e;
|
|
2085
|
+
const a = this.dom instanceof Element ? [...this.dom.querySelectorAll('[role="treeitem"]')] : [];
|
|
2086
|
+
for (const n of a) {
|
|
2087
|
+
const o = Number(n.dataset.index), l = De(
|
|
2088
|
+
this.nodesEmitter.get(),
|
|
2089
|
+
new Set(this.expandedKeysEmitter.get())
|
|
2090
|
+
), d = Object.is((i = l[o]) == null ? void 0 : i.node.id, e);
|
|
2091
|
+
n.tabIndex = d ? 0 : -1, d && n.focus();
|
|
2092
|
+
}
|
|
2093
|
+
}
|
|
2094
|
+
handleTypeahead(e, a, i) {
|
|
2095
|
+
e.preventDefault(), this.typeaheadTimer != null && clearTimeout(this.typeaheadTimer), this.typeahead += e.key.toLocaleLowerCase(), this.typeaheadTimer = setTimeout(() => {
|
|
2096
|
+
this.typeahead = "", this.typeaheadTimer = null;
|
|
2097
|
+
}, 650);
|
|
2098
|
+
const o = [...a.slice(i + 1), ...a.slice(0, i + 1)].find(({ node: l }) => qt(l).toLocaleLowerCase().startsWith(this.typeahead));
|
|
2099
|
+
o != null && this.focusRow(o.node.id);
|
|
2100
|
+
}
|
|
2101
|
+
}
|
|
2102
|
+
s(Z, "dependencies", [We]), s(Z, "hostName", "tree-view"), s(Z, "standaloneHostName", "tree-view"), s(Z, "css", v`
|
|
275
2103
|
& {
|
|
276
2104
|
display: flex;
|
|
277
2105
|
flex-direction: column;
|
|
2106
|
+
min-width: 0;
|
|
2107
|
+
min-height: 0;
|
|
278
2108
|
overflow: auto;
|
|
279
|
-
flex: 0 0 auto;
|
|
280
2109
|
}
|
|
281
2110
|
|
|
282
|
-
& > [data-part="
|
|
283
|
-
|
|
284
|
-
|
|
2111
|
+
& > [data-part="tree"] {
|
|
2112
|
+
display: grid;
|
|
2113
|
+
align-content: start;
|
|
285
2114
|
}
|
|
286
2115
|
|
|
287
|
-
&
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
border: var(--fray-section-header-border, var(--fray-header-border));
|
|
297
|
-
box-shadow: var(--fray-section-header-shadow, var(--fray-header-shadow));
|
|
2116
|
+
& [data-part="item"] {
|
|
2117
|
+
display: flex;
|
|
2118
|
+
align-items: flex-start;
|
|
2119
|
+
gap: 0.35rem;
|
|
2120
|
+
min-width: 0;
|
|
2121
|
+
padding: 0.38rem 0.5rem;
|
|
2122
|
+
padding-inline-start: calc(0.5rem + var(--tree-depth) * 1.1rem);
|
|
2123
|
+
cursor: default;
|
|
2124
|
+
user-select: none;
|
|
298
2125
|
}
|
|
299
2126
|
|
|
300
|
-
&
|
|
301
|
-
|
|
302
|
-
flex: 1;
|
|
303
|
-
overflow: auto;
|
|
304
|
-
padding: var(--panel-padding, 0.75rem);
|
|
305
|
-
gap: var(--spacing-medium, 1rem);
|
|
2127
|
+
& [data-part="item"]:hover {
|
|
2128
|
+
background: var(--button-background-hover);
|
|
306
2129
|
}
|
|
307
2130
|
|
|
308
|
-
&
|
|
309
|
-
|
|
2131
|
+
& [data-part="item"]:focus-visible {
|
|
2132
|
+
outline: 2px solid var(--ui-accent-color);
|
|
2133
|
+
outline-offset: -2px;
|
|
310
2134
|
}
|
|
311
2135
|
|
|
312
|
-
&
|
|
313
|
-
|
|
2136
|
+
& [data-part="item"][aria-selected="true"] {
|
|
2137
|
+
color: var(--toggle-selected-text);
|
|
2138
|
+
background: var(--toggle-selected-bg);
|
|
2139
|
+
}
|
|
2140
|
+
|
|
2141
|
+
& [data-part="expander"] {
|
|
2142
|
+
flex: 0 0 1rem;
|
|
2143
|
+
text-align: center;
|
|
2144
|
+
}
|
|
2145
|
+
|
|
2146
|
+
& [data-part="expander"][data-expandable] {
|
|
2147
|
+
cursor: pointer;
|
|
2148
|
+
}
|
|
2149
|
+
|
|
2150
|
+
& [data-part="label"] {
|
|
2151
|
+
min-width: 0;
|
|
2152
|
+
overflow-wrap: anywhere;
|
|
2153
|
+
}
|
|
2154
|
+
|
|
2155
|
+
& > [data-part="empty"] {
|
|
2156
|
+
margin: 0;
|
|
2157
|
+
padding: var(--ui-padding, 0.75rem);
|
|
2158
|
+
}
|
|
2159
|
+
|
|
2160
|
+
@media (forced-colors: active) {
|
|
2161
|
+
& [data-part="item"][aria-selected="true"] {
|
|
2162
|
+
outline: 2px solid Highlight;
|
|
2163
|
+
forced-color-adjust: auto;
|
|
2164
|
+
}
|
|
314
2165
|
}
|
|
315
2166
|
`);
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
2167
|
+
function Je(t) {
|
|
2168
|
+
return (Array.isArray(t) ? t : t == null ? [] : [t]).filter((e) => ie(e) && e.type === We).map((e) => {
|
|
2169
|
+
if (!ie(e)) throw new TypeError("TreeView children must be TreeItem nodes");
|
|
2170
|
+
const a = e.props;
|
|
2171
|
+
return {
|
|
2172
|
+
id: a.id,
|
|
2173
|
+
label: a.label,
|
|
2174
|
+
...a.textValue == null ? {} : { textValue: a.textValue },
|
|
2175
|
+
...a.value === void 0 ? {} : { value: a.value },
|
|
2176
|
+
children: Je(a.children)
|
|
2177
|
+
};
|
|
2178
|
+
});
|
|
2179
|
+
}
|
|
2180
|
+
function De(t, r) {
|
|
2181
|
+
const e = [], a = (i, n, o) => {
|
|
2182
|
+
i.forEach((l, d) => {
|
|
2183
|
+
var h;
|
|
2184
|
+
e.push({ node: l, depth: n, parentId: o, position: d + 1, setSize: i.length }), (((h = l.children) == null ? void 0 : h.length) ?? 0) > 0 && r.has(l.id) && a(l.children ?? [], n + 1, l.id);
|
|
2185
|
+
});
|
|
2186
|
+
};
|
|
2187
|
+
return a(t, 0, null), e;
|
|
2188
|
+
}
|
|
2189
|
+
function zt(t) {
|
|
2190
|
+
const r = /* @__PURE__ */ new Set(), e = [], a = (i, n, o) => {
|
|
2191
|
+
i.forEach((l, d) => {
|
|
2192
|
+
if (r.has(l.id)) throw new Error(`Duplicate tree item id: ${String(l.id)}`);
|
|
2193
|
+
r.add(l.id), e.push({ node: l, depth: n, parentId: o, position: d + 1, setSize: i.length }), a(l.children ?? [], n + 1, l.id);
|
|
2194
|
+
});
|
|
2195
|
+
};
|
|
2196
|
+
return a(t, 0, null), e;
|
|
2197
|
+
}
|
|
2198
|
+
function qt(t) {
|
|
2199
|
+
return t.textValue != null ? t.textValue : typeof t.label == "string" || typeof t.label == "number" ? String(t.label) : String(t.id);
|
|
2200
|
+
}
|
|
2201
|
+
function Lt(t, r) {
|
|
2202
|
+
return t.length === r.length && t.every((e, a) => Object.is(e, r[a]));
|
|
2203
|
+
}
|
|
2204
|
+
function Vt(t) {
|
|
2205
|
+
return t != null && (typeof t == "object" || typeof t == "function") && typeof Reflect.get(t, "get") == "function" && typeof Reflect.get(t, "subscribe") == "function";
|
|
2206
|
+
}
|
|
2207
|
+
function Ut(t) {
|
|
2208
|
+
return t instanceof Element && t.closest('[data-part="expander"]') != null;
|
|
2209
|
+
}
|
|
2210
|
+
class se extends g {
|
|
2211
|
+
constructor(r = {}) {
|
|
2212
|
+
if (super(r), r.onClick != null && typeof r.onClick != "function")
|
|
2213
|
+
throw new TypeError("Button onClick must be a function");
|
|
322
2214
|
}
|
|
323
2215
|
render() {
|
|
324
2216
|
const {
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
2217
|
+
children: r = [],
|
|
2218
|
+
label: e,
|
|
2219
|
+
type: a = "button",
|
|
2220
|
+
disabled: i = !1,
|
|
2221
|
+
pressed: n,
|
|
2222
|
+
busy: o = !1,
|
|
2223
|
+
busyLabel: l,
|
|
2224
|
+
id: d,
|
|
2225
|
+
name: h,
|
|
2226
|
+
value: f,
|
|
2227
|
+
title: p,
|
|
2228
|
+
ariaLabel: m,
|
|
2229
|
+
onClick: b
|
|
2230
|
+
} = this.props, x = (Array.isArray(r) ? r.length > 0 : r != null && typeof r != "boolean") ? r : e ?? "", O = o ? l ?? x : x, $ = i || o;
|
|
2231
|
+
return /* @__PURE__ */ u(
|
|
2232
|
+
"button",
|
|
332
2233
|
{
|
|
333
|
-
id:
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
2234
|
+
id: d,
|
|
2235
|
+
name: h,
|
|
2236
|
+
value: f == null ? void 0 : String(f),
|
|
2237
|
+
title: p,
|
|
2238
|
+
type: a,
|
|
2239
|
+
disabled: $,
|
|
2240
|
+
className: E(this.props) || void 0,
|
|
2241
|
+
"data-fray-component": "button",
|
|
2242
|
+
"aria-label": m,
|
|
2243
|
+
"aria-pressed": n == null ? null : String(!!n),
|
|
2244
|
+
"aria-busy": o ? "true" : null,
|
|
2245
|
+
onClick: (K) => {
|
|
2246
|
+
$ || C(b, K);
|
|
2247
|
+
},
|
|
2248
|
+
children: O
|
|
343
2249
|
}
|
|
344
2250
|
);
|
|
345
2251
|
}
|
|
346
2252
|
}
|
|
347
|
-
|
|
348
|
-
['
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
display: flex;
|
|
353
|
-
flex-direction: column;
|
|
354
|
-
min-width: 0;
|
|
355
|
-
min-height: 0;
|
|
356
|
-
overflow: hidden;
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
aside[data-fray-component="sidebar"] > [data-part="header"],
|
|
360
|
-
aside[data-fray-component="sidebar"] > [data-part="toolbar"] {
|
|
361
|
-
flex: 0 0 auto;
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
aside[data-fray-component="sidebar"] > [data-part="header"] h2 {
|
|
365
|
-
margin: 0;
|
|
366
|
-
font: inherit;
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
aside[data-fray-component="sidebar"] > [data-part="content"] {
|
|
370
|
-
flex: 1 1 auto;
|
|
371
|
-
min-width: 0;
|
|
372
|
-
min-height: 0;
|
|
373
|
-
overflow-x: hidden;
|
|
374
|
-
overflow-y: auto;
|
|
2253
|
+
s(se, "baseStyles", [
|
|
2254
|
+
['button[data-fray-component="button"]', ["uiline", "button"]]
|
|
2255
|
+
]), s(se, "css", v`
|
|
2256
|
+
button[data-fray-component="button"] {
|
|
2257
|
+
font-family: inherit;
|
|
375
2258
|
}
|
|
376
2259
|
`);
|
|
377
|
-
class
|
|
2260
|
+
class Oe extends g {
|
|
2261
|
+
constructor(e) {
|
|
2262
|
+
super(e);
|
|
2263
|
+
s(this, "openEmitter");
|
|
2264
|
+
s(this, "dialogId");
|
|
2265
|
+
s(this, "titleId");
|
|
2266
|
+
s(this, "descriptionId");
|
|
2267
|
+
s(this, "dialogElement", null);
|
|
2268
|
+
s(this, "restoreFocusTo", null);
|
|
2269
|
+
s(this, "synchronizedOpen", !1);
|
|
2270
|
+
this.openEmitter = M(this, e, !1, "dialog open state"), this.dialogId = j("dialog", e.id), this.titleId = `${this.dialogId}-title`, this.descriptionId = `${this.dialogId}-description`;
|
|
2271
|
+
}
|
|
2272
|
+
initialize() {
|
|
2273
|
+
this.watch(this.openEmitter);
|
|
2274
|
+
}
|
|
378
2275
|
render() {
|
|
379
2276
|
const {
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
2277
|
+
title: e,
|
|
2278
|
+
description: a,
|
|
2279
|
+
actions: i,
|
|
2280
|
+
closeLabel: n = "Close",
|
|
2281
|
+
showCloseButton: o = !0,
|
|
2282
|
+
children: l = []
|
|
386
2283
|
} = this.props;
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
if (r != null && (typeof r != "string" || r.length === 0))
|
|
390
|
-
throw new TypeError("SplitView primarySize must be a non-empty CSS size");
|
|
391
|
-
const d = this.Host;
|
|
392
|
-
return /* @__PURE__ */ v(
|
|
393
|
-
d,
|
|
2284
|
+
return /* @__PURE__ */ w(
|
|
2285
|
+
"dialog",
|
|
394
2286
|
{
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
2287
|
+
id: this.dialogId,
|
|
2288
|
+
className: E(this.props) || void 0,
|
|
2289
|
+
"data-fray-component": "dialog",
|
|
2290
|
+
"aria-labelledby": this.titleId,
|
|
2291
|
+
"aria-describedby": a == null ? null : this.descriptionId,
|
|
2292
|
+
"aria-modal": "true",
|
|
2293
|
+
ref: (d) => this.dialogElement = d,
|
|
398
2294
|
children: [
|
|
399
|
-
/* @__PURE__ */ u(
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
role: s == null ? null : "region",
|
|
413
|
-
"aria-label": s,
|
|
414
|
-
children: e ?? this.props.children ?? []
|
|
415
|
-
}
|
|
416
|
-
)
|
|
2295
|
+
/* @__PURE__ */ u("header", { "data-part": "header", children: /* @__PURE__ */ u("h2", { id: this.titleId, children: e }) }),
|
|
2296
|
+
a == null ? null : /* @__PURE__ */ u("p", { id: this.descriptionId, "data-part": "description", children: a }),
|
|
2297
|
+
/* @__PURE__ */ u("div", { "data-part": "content", children: l }),
|
|
2298
|
+
i == null && !o ? null : /* @__PURE__ */ w("footer", { "data-part": "actions", children: [
|
|
2299
|
+
i,
|
|
2300
|
+
o ? /* @__PURE__ */ u(
|
|
2301
|
+
se,
|
|
2302
|
+
{
|
|
2303
|
+
label: n,
|
|
2304
|
+
onClick: () => this.requestClose()
|
|
2305
|
+
}
|
|
2306
|
+
) : null
|
|
2307
|
+
] })
|
|
417
2308
|
]
|
|
418
2309
|
}
|
|
419
2310
|
);
|
|
420
2311
|
}
|
|
2312
|
+
afterMount() {
|
|
2313
|
+
const e = this.dialogElement;
|
|
2314
|
+
e != null && (this.listen(e, "cancel", (a) => {
|
|
2315
|
+
a.preventDefault(), this.requestClose();
|
|
2316
|
+
}), this.listen(e, "close", () => {
|
|
2317
|
+
this.openEmitter.get() && this.openEmitter.set(!1, "native dialog closed"), this.finishClose();
|
|
2318
|
+
}), this.syncOpenState());
|
|
2319
|
+
}
|
|
2320
|
+
afterUpdate() {
|
|
2321
|
+
this.syncOpenState();
|
|
2322
|
+
}
|
|
2323
|
+
close() {
|
|
2324
|
+
this.requestClose();
|
|
2325
|
+
}
|
|
2326
|
+
onDestroy() {
|
|
2327
|
+
const e = this.dialogElement;
|
|
2328
|
+
(e == null ? void 0 : e.open) === !0 && typeof e.close == "function" && e.close(), this.finishClose(), this.dialogElement = null;
|
|
2329
|
+
}
|
|
2330
|
+
requestClose() {
|
|
2331
|
+
this.openEmitter.get() && this.openEmitter.set(!1, "dialog close requested");
|
|
2332
|
+
}
|
|
2333
|
+
syncOpenState() {
|
|
2334
|
+
const e = this.dialogElement;
|
|
2335
|
+
if (e == null) return;
|
|
2336
|
+
const a = this.openEmitter.get();
|
|
2337
|
+
if (a && !this.synchronizedOpen) {
|
|
2338
|
+
const i = document.activeElement;
|
|
2339
|
+
this.restoreFocusTo = i instanceof HTMLElement ? i : null, Pt(e), this.synchronizedOpen = !0, Bt(e, this.props.initialFocusRef);
|
|
2340
|
+
return;
|
|
2341
|
+
}
|
|
2342
|
+
!a && this.synchronizedOpen && (e.open && typeof e.close == "function" ? e.close() : e.removeAttribute("open"), this.finishClose());
|
|
2343
|
+
}
|
|
2344
|
+
finishClose() {
|
|
2345
|
+
if (!this.synchronizedOpen && this.restoreFocusTo == null) return;
|
|
2346
|
+
this.synchronizedOpen = !1;
|
|
2347
|
+
const e = this.restoreFocusTo;
|
|
2348
|
+
this.restoreFocusTo = null, (e == null ? void 0 : e.isConnected) === !0 && e.focus(), C(this.props.onClose);
|
|
2349
|
+
}
|
|
421
2350
|
}
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
2351
|
+
s(Oe, "dependencies", [se]), s(Oe, "css", v`
|
|
2352
|
+
dialog[data-fray-component="dialog"] {
|
|
2353
|
+
width: min(38rem, calc(100vw - 2rem));
|
|
2354
|
+
max-height: min(42rem, calc(100dvh - 2rem));
|
|
2355
|
+
padding: 0;
|
|
2356
|
+
color: var(--fray-panel-color, var(--ui-text-color));
|
|
2357
|
+
background: var(--fray-panel-background, var(--panel-bg));
|
|
2358
|
+
border: var(--fray-panel-border, var(--panel-border));
|
|
2359
|
+
border-radius: var(--fray-panel-radius, var(--panel-radius));
|
|
2360
|
+
box-shadow: var(--fray-dialog-shadow, var(--fray-panel-shadow));
|
|
429
2361
|
}
|
|
430
2362
|
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
var(--split-primary-size, minmax(16rem, 0.8fr))
|
|
434
|
-
minmax(0, 1.2fr);
|
|
2363
|
+
dialog[data-fray-component="dialog"]::backdrop {
|
|
2364
|
+
background: var(--fray-dialog-backdrop-background);
|
|
435
2365
|
}
|
|
436
2366
|
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
var(--split-primary-size, minmax(12rem, 0.8fr))
|
|
440
|
-
minmax(0, 1.2fr);
|
|
2367
|
+
dialog[data-fray-component="dialog"] > [data-part] {
|
|
2368
|
+
padding: var(--panel-padding, 0.75rem);
|
|
441
2369
|
}
|
|
442
2370
|
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
2371
|
+
dialog[data-fray-component="dialog"] > [data-part="header"] {
|
|
2372
|
+
color: var(
|
|
2373
|
+
--fray-dialog-header-color,
|
|
2374
|
+
var(--fray-section-header-color, var(--fray-header-color))
|
|
2375
|
+
);
|
|
2376
|
+
background: var(
|
|
2377
|
+
--fray-dialog-header-background,
|
|
2378
|
+
var(--fray-section-header-background, var(--fray-header-background))
|
|
2379
|
+
);
|
|
2380
|
+
border-block-end: var(
|
|
2381
|
+
--fray-section-header-border,
|
|
2382
|
+
var(--fray-header-border)
|
|
2383
|
+
);
|
|
447
2384
|
}
|
|
448
2385
|
|
|
449
|
-
|
|
450
|
-
|
|
2386
|
+
dialog[data-fray-component="dialog"] > [data-part="header"] h2,
|
|
2387
|
+
dialog[data-fray-component="dialog"] > [data-part="description"] {
|
|
2388
|
+
margin: 0;
|
|
451
2389
|
}
|
|
452
2390
|
|
|
453
|
-
|
|
454
|
-
|
|
2391
|
+
dialog[data-fray-component="dialog"] > [data-part="content"] {
|
|
2392
|
+
overflow: auto;
|
|
455
2393
|
}
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
return /* @__PURE__ */ v(
|
|
461
|
-
"div",
|
|
462
|
-
{
|
|
463
|
-
className: y(this.props) || void 0,
|
|
464
|
-
"data-fray-component": "description-item",
|
|
465
|
-
children: [
|
|
466
|
-
/* @__PURE__ */ u("dt", { children: l }),
|
|
467
|
-
/* @__PURE__ */ u("dd", { children: e ?? a })
|
|
468
|
-
]
|
|
469
|
-
}
|
|
470
|
-
);
|
|
471
|
-
}
|
|
472
|
-
}
|
|
473
|
-
n(ce, "css", m`
|
|
474
|
-
div[data-fray-component="description-item"] {
|
|
475
|
-
display: grid;
|
|
476
|
-
grid-template-columns: minmax(7rem, 0.7fr) minmax(0, 1.3fr);
|
|
2394
|
+
|
|
2395
|
+
dialog[data-fray-component="dialog"] > [data-part="actions"] {
|
|
2396
|
+
display: flex;
|
|
2397
|
+
justify-content: flex-end;
|
|
477
2398
|
gap: var(--spacing-small, 0.5rem);
|
|
478
|
-
|
|
479
|
-
border-block-end: 1px solid var(--ui-border-color);
|
|
2399
|
+
border-block-start: 1px solid var(--ui-border-color);
|
|
480
2400
|
}
|
|
481
2401
|
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
2402
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
2403
|
+
dialog[data-fray-component="dialog"][open] {
|
|
2404
|
+
animation: fray-dialog-enter 120ms ease-out;
|
|
2405
|
+
}
|
|
485
2406
|
}
|
|
486
2407
|
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
2408
|
+
@keyframes fray-dialog-enter {
|
|
2409
|
+
from {
|
|
2410
|
+
transform: translateY(0.4rem);
|
|
2411
|
+
}
|
|
491
2412
|
}
|
|
492
2413
|
|
|
493
|
-
@media (
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
gap: 0.15rem;
|
|
2414
|
+
@media (forced-colors: active) {
|
|
2415
|
+
dialog[data-fray-component="dialog"] {
|
|
2416
|
+
border: 2px solid CanvasText;
|
|
497
2417
|
}
|
|
498
2418
|
}
|
|
499
2419
|
`);
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
"aria-label": this.props.label,
|
|
508
|
-
children: this.props.children ?? []
|
|
509
|
-
}
|
|
510
|
-
);
|
|
2420
|
+
function Pt(t) {
|
|
2421
|
+
if (!t.open) {
|
|
2422
|
+
if (typeof t.showModal == "function") {
|
|
2423
|
+
t.showModal();
|
|
2424
|
+
return;
|
|
2425
|
+
}
|
|
2426
|
+
t.setAttribute("open", "");
|
|
511
2427
|
}
|
|
512
2428
|
}
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
const
|
|
520
|
-
constructor(
|
|
521
|
-
super({ ...
|
|
2429
|
+
function Bt(t, r) {
|
|
2430
|
+
const a = (r == null || typeof r == "function" ? null : r.current) ?? t.querySelector(
|
|
2431
|
+
'[autofocus], button, input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
2432
|
+
);
|
|
2433
|
+
a == null || a.focus();
|
|
2434
|
+
}
|
|
2435
|
+
const z = class z extends D {
|
|
2436
|
+
constructor(r = {}) {
|
|
2437
|
+
super({ ...r, symbols: z.symbols });
|
|
522
2438
|
}
|
|
523
2439
|
};
|
|
524
|
-
|
|
525
|
-
["✖",
|
|
526
|
-
["☐",
|
|
527
|
-
["✓",
|
|
528
|
-
["+",
|
|
529
|
-
]),
|
|
530
|
-
let
|
|
531
|
-
const
|
|
532
|
-
constructor(
|
|
533
|
-
super({ ...
|
|
2440
|
+
s(z, "hostName", "quad-checkbox"), s(z, "standaloneHostName", "quad-checkbox"), s(z, "symbols", [
|
|
2441
|
+
["✖", y.Deny],
|
|
2442
|
+
["☐", y.Neutral],
|
|
2443
|
+
["✓", y.Prefer],
|
|
2444
|
+
["+", y.Require]
|
|
2445
|
+
]), s(z, "defaultSemanticState", y.Neutral);
|
|
2446
|
+
let $e = z;
|
|
2447
|
+
const q = class q extends D {
|
|
2448
|
+
constructor(r = {}) {
|
|
2449
|
+
super({ ...r, symbols: q.symbols });
|
|
534
2450
|
}
|
|
535
2451
|
};
|
|
536
|
-
|
|
537
|
-
["✖",
|
|
538
|
-
["☐",
|
|
539
|
-
["✓",
|
|
540
|
-
]),
|
|
541
|
-
let
|
|
542
|
-
class
|
|
2452
|
+
s(q, "hostName", "tri-checkbox"), s(q, "standaloneHostName", "tri-checkbox"), s(q, "symbols", [
|
|
2453
|
+
["✖", y.Deny],
|
|
2454
|
+
["☐", y.Neutral],
|
|
2455
|
+
["✓", y.Prefer]
|
|
2456
|
+
]), s(q, "defaultSemanticState", y.Neutral);
|
|
2457
|
+
let Ce = q;
|
|
2458
|
+
class ee extends g {
|
|
543
2459
|
constructor(e = {}) {
|
|
544
|
-
var
|
|
2460
|
+
var n;
|
|
545
2461
|
super(e);
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
this.inputId =
|
|
2462
|
+
s(this, "inputId");
|
|
2463
|
+
s(this, "errorId");
|
|
2464
|
+
s(this, "optionsEmitter");
|
|
2465
|
+
s(this, "valueEmitter");
|
|
2466
|
+
s(this, "ownsOptionsEmitter");
|
|
2467
|
+
this.inputId = j("dropdown", e.id), this.errorId = `${this.inputId}-error`;
|
|
552
2468
|
const a = e.options ?? [];
|
|
553
|
-
|
|
2469
|
+
Gt(a) ? (this.optionsEmitter = a, this.ownsOptionsEmitter = !1) : (fe(a), this.optionsEmitter = new I(a, {
|
|
554
2470
|
owner: this,
|
|
555
2471
|
purpose: "dropdown options"
|
|
556
2472
|
}), this.ownsOptionsEmitter = !0);
|
|
557
|
-
const
|
|
558
|
-
this.valueEmitter =
|
|
2473
|
+
const i = ((n = this.optionsEmitter.get()[0]) == null ? void 0 : n.value) ?? "";
|
|
2474
|
+
this.valueEmitter = M(this, e, i, "dropdown value");
|
|
559
2475
|
}
|
|
560
2476
|
initialize() {
|
|
561
2477
|
this.watch(this.valueEmitter, this.optionsEmitter);
|
|
@@ -564,65 +2480,65 @@ class C extends b {
|
|
|
564
2480
|
const {
|
|
565
2481
|
label: e,
|
|
566
2482
|
name: a,
|
|
567
|
-
disabled:
|
|
568
|
-
required:
|
|
569
|
-
error:
|
|
570
|
-
placeholder:
|
|
571
|
-
ariaLabel:
|
|
2483
|
+
disabled: i = !1,
|
|
2484
|
+
required: n = !1,
|
|
2485
|
+
error: o = null,
|
|
2486
|
+
placeholder: l = "Select…",
|
|
2487
|
+
ariaLabel: d,
|
|
572
2488
|
onChange: h
|
|
573
|
-
} = this.props,
|
|
574
|
-
|
|
575
|
-
const p = this.valueEmitter.get(),
|
|
576
|
-
return /* @__PURE__ */
|
|
577
|
-
|
|
2489
|
+
} = this.props, f = this.optionsEmitter.get() ?? [];
|
|
2490
|
+
fe(f);
|
|
2491
|
+
const p = this.valueEmitter.get(), m = this.Host;
|
|
2492
|
+
return /* @__PURE__ */ w(
|
|
2493
|
+
m,
|
|
578
2494
|
{
|
|
579
|
-
className:
|
|
580
|
-
"data-disabled":
|
|
581
|
-
"data-required":
|
|
582
|
-
"data-error":
|
|
2495
|
+
className: E(this.props) || null,
|
|
2496
|
+
"data-disabled": i ? "" : null,
|
|
2497
|
+
"data-required": n ? "" : null,
|
|
2498
|
+
"data-error": o == null ? null : "",
|
|
583
2499
|
children: [
|
|
584
2500
|
e == null ? null : /* @__PURE__ */ u("label", { htmlFor: this.inputId, children: e }),
|
|
585
|
-
/* @__PURE__ */
|
|
2501
|
+
/* @__PURE__ */ w(
|
|
586
2502
|
"select",
|
|
587
2503
|
{
|
|
588
2504
|
id: this.inputId,
|
|
589
2505
|
name: a,
|
|
590
2506
|
value: p == null ? "" : String(p),
|
|
591
|
-
disabled:
|
|
592
|
-
required:
|
|
593
|
-
"aria-label": e == null ?
|
|
594
|
-
"aria-invalid":
|
|
595
|
-
"aria-describedby":
|
|
596
|
-
onChange: (
|
|
597
|
-
const
|
|
598
|
-
this.valueEmitter.set(
|
|
2507
|
+
disabled: i,
|
|
2508
|
+
required: n,
|
|
2509
|
+
"aria-label": e == null ? d : null,
|
|
2510
|
+
"aria-invalid": o == null ? null : "true",
|
|
2511
|
+
"aria-describedby": o == null ? null : this.errorId,
|
|
2512
|
+
onChange: (b) => {
|
|
2513
|
+
const S = Qt(b, "dropdown change"), x = f.find(({ value: $ }) => String($) === S), O = (x == null ? void 0 : x.value) ?? S;
|
|
2514
|
+
this.valueEmitter.set(O, "dropdown selection"), C(h, O, b);
|
|
599
2515
|
},
|
|
600
2516
|
children: [
|
|
601
|
-
p == null || p === "" ? /* @__PURE__ */ u("option", { value: "", disabled:
|
|
602
|
-
|
|
603
|
-
if (
|
|
2517
|
+
p == null || p === "" ? /* @__PURE__ */ u("option", { value: "", disabled: n, selected: !0, children: l }) : null,
|
|
2518
|
+
f.map((b) => {
|
|
2519
|
+
if (b == null || !Object.hasOwn(b, "value"))
|
|
604
2520
|
throw new TypeError("Dropdown options require value and label fields");
|
|
605
2521
|
return /* @__PURE__ */ u(
|
|
606
2522
|
"option",
|
|
607
2523
|
{
|
|
608
|
-
value: String(
|
|
609
|
-
disabled: !!
|
|
610
|
-
selected: Object.is(p,
|
|
611
|
-
children:
|
|
2524
|
+
value: String(b.value),
|
|
2525
|
+
disabled: !!b.disabled,
|
|
2526
|
+
selected: Object.is(p, b.value),
|
|
2527
|
+
children: b.label ?? String(b.value)
|
|
612
2528
|
},
|
|
613
|
-
String(
|
|
2529
|
+
String(b.value)
|
|
614
2530
|
);
|
|
615
2531
|
})
|
|
616
2532
|
]
|
|
617
2533
|
}
|
|
618
2534
|
),
|
|
619
|
-
|
|
2535
|
+
o == null ? null : /* @__PURE__ */ u(
|
|
620
2536
|
"p",
|
|
621
2537
|
{
|
|
622
2538
|
id: this.errorId,
|
|
623
2539
|
"data-part": "error",
|
|
624
2540
|
role: "alert",
|
|
625
|
-
children: String(
|
|
2541
|
+
children: String(o)
|
|
626
2542
|
}
|
|
627
2543
|
)
|
|
628
2544
|
]
|
|
@@ -630,33 +2546,33 @@ class C extends b {
|
|
|
630
2546
|
);
|
|
631
2547
|
}
|
|
632
2548
|
}
|
|
633
|
-
|
|
2549
|
+
s(ee, "hostName", "dropdown"), s(ee, "standaloneHostName", "drop-down"), s(ee, "baseStyles", [
|
|
634
2550
|
["&", ["labeledinput", "inputline"]],
|
|
635
2551
|
["& > label", ["label"]],
|
|
636
2552
|
["& > select", ["input", "inputline"]],
|
|
637
2553
|
["&[data-disabled]", ["disabled"]],
|
|
638
2554
|
["&[data-error]", ["error"]]
|
|
639
|
-
]),
|
|
2555
|
+
]), s(ee, "css", v`
|
|
640
2556
|
& {
|
|
641
2557
|
position: relative;
|
|
642
2558
|
}
|
|
643
2559
|
`);
|
|
644
|
-
function
|
|
645
|
-
return
|
|
2560
|
+
function Gt(t) {
|
|
2561
|
+
return t != null && (typeof t == "object" || typeof t == "function") && typeof Reflect.get(t, "get") == "function" && typeof Reflect.get(t, "subscribe") == "function";
|
|
646
2562
|
}
|
|
647
|
-
function
|
|
648
|
-
const e =
|
|
2563
|
+
function Qt(t, r) {
|
|
2564
|
+
const e = t.currentTarget;
|
|
649
2565
|
if (e == null || typeof Reflect.get(e, "value") != "string")
|
|
650
|
-
throw new TypeError(`${
|
|
2566
|
+
throw new TypeError(`${r} requires a value-bearing event target`);
|
|
651
2567
|
return Reflect.get(e, "value");
|
|
652
2568
|
}
|
|
653
|
-
class
|
|
2569
|
+
class te extends g {
|
|
654
2570
|
constructor(e = {}) {
|
|
655
2571
|
super(e);
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
this.inputId =
|
|
2572
|
+
s(this, "inputId");
|
|
2573
|
+
s(this, "errorId");
|
|
2574
|
+
s(this, "valueEmitter");
|
|
2575
|
+
this.inputId = j("textbox", e.id), this.errorId = `${this.inputId}-error`, this.valueEmitter = M(this, e, "", "textbox value");
|
|
660
2576
|
}
|
|
661
2577
|
initialize() {
|
|
662
2578
|
this.watch(this.valueEmitter);
|
|
@@ -665,28 +2581,28 @@ class F extends b {
|
|
|
665
2581
|
const {
|
|
666
2582
|
label: e,
|
|
667
2583
|
placeholder: a,
|
|
668
|
-
type:
|
|
669
|
-
name:
|
|
670
|
-
disabled:
|
|
671
|
-
required:
|
|
672
|
-
readOnly:
|
|
2584
|
+
type: i = "text",
|
|
2585
|
+
name: n,
|
|
2586
|
+
disabled: o = !1,
|
|
2587
|
+
required: l = !1,
|
|
2588
|
+
readOnly: d = !1,
|
|
673
2589
|
error: h = null,
|
|
674
|
-
autoComplete:
|
|
2590
|
+
autoComplete: f,
|
|
675
2591
|
inputMode: p,
|
|
676
|
-
minLength:
|
|
677
|
-
maxLength:
|
|
678
|
-
pattern:
|
|
679
|
-
ariaLabel:
|
|
680
|
-
inputRef:
|
|
681
|
-
onInput:
|
|
682
|
-
onChange:
|
|
683
|
-
} = this.props,
|
|
684
|
-
return /* @__PURE__ */
|
|
685
|
-
|
|
2592
|
+
minLength: m,
|
|
2593
|
+
maxLength: b,
|
|
2594
|
+
pattern: S,
|
|
2595
|
+
ariaLabel: x,
|
|
2596
|
+
inputRef: O,
|
|
2597
|
+
onInput: $,
|
|
2598
|
+
onChange: K
|
|
2599
|
+
} = this.props, A = this.valueEmitter.get() ?? "", F = this.Host;
|
|
2600
|
+
return /* @__PURE__ */ w(
|
|
2601
|
+
F,
|
|
686
2602
|
{
|
|
687
|
-
className:
|
|
688
|
-
"data-disabled":
|
|
689
|
-
"data-required":
|
|
2603
|
+
className: E(this.props) || null,
|
|
2604
|
+
"data-disabled": o ? "" : null,
|
|
2605
|
+
"data-required": l ? "" : null,
|
|
690
2606
|
"data-error": h == null ? null : "",
|
|
691
2607
|
children: [
|
|
692
2608
|
e == null ? null : /* @__PURE__ */ u("label", { htmlFor: this.inputId, children: e }),
|
|
@@ -694,30 +2610,30 @@ class F extends b {
|
|
|
694
2610
|
"input",
|
|
695
2611
|
{
|
|
696
2612
|
id: this.inputId,
|
|
697
|
-
name:
|
|
698
|
-
type:
|
|
699
|
-
value:
|
|
2613
|
+
name: n,
|
|
2614
|
+
type: i,
|
|
2615
|
+
value: A,
|
|
700
2616
|
placeholder: a,
|
|
701
|
-
disabled:
|
|
702
|
-
required:
|
|
703
|
-
readOnly:
|
|
704
|
-
autoComplete:
|
|
2617
|
+
disabled: o,
|
|
2618
|
+
required: l,
|
|
2619
|
+
readOnly: d,
|
|
2620
|
+
autoComplete: f,
|
|
705
2621
|
inputMode: p,
|
|
706
|
-
minLength:
|
|
707
|
-
maxLength:
|
|
708
|
-
pattern:
|
|
709
|
-
ref:
|
|
710
|
-
"aria-label": e == null ?
|
|
2622
|
+
minLength: m,
|
|
2623
|
+
maxLength: b,
|
|
2624
|
+
pattern: S,
|
|
2625
|
+
ref: O,
|
|
2626
|
+
"aria-label": e == null ? x : null,
|
|
711
2627
|
"aria-invalid": h == null ? null : "true",
|
|
712
2628
|
"aria-describedby": h == null ? null : this.errorId,
|
|
713
|
-
onInput: (
|
|
714
|
-
const
|
|
715
|
-
this.valueEmitter.set(
|
|
2629
|
+
onInput: (T) => {
|
|
2630
|
+
const B = Ke(T, "textbox input");
|
|
2631
|
+
this.valueEmitter.set(B, "textbox input"), C($, B, T);
|
|
716
2632
|
},
|
|
717
|
-
onChange: (
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
2633
|
+
onChange: (T) => C(
|
|
2634
|
+
K,
|
|
2635
|
+
Ke(T, "textbox change"),
|
|
2636
|
+
T
|
|
721
2637
|
)
|
|
722
2638
|
}
|
|
723
2639
|
),
|
|
@@ -735,13 +2651,13 @@ class F extends b {
|
|
|
735
2651
|
);
|
|
736
2652
|
}
|
|
737
2653
|
}
|
|
738
|
-
|
|
2654
|
+
s(te, "hostName", "textbox"), s(te, "standaloneHostName", "text-box"), s(te, "baseStyles", [
|
|
739
2655
|
["&", ["labeledinput", "inputline"]],
|
|
740
2656
|
["& > label", ["label"]],
|
|
741
2657
|
["& > input", ["input", "inputline"]],
|
|
742
2658
|
["&[data-disabled]", ["disabled"]],
|
|
743
2659
|
["&[data-error]", ["error"]]
|
|
744
|
-
]),
|
|
2660
|
+
]), s(te, "css", v`
|
|
745
2661
|
& input {
|
|
746
2662
|
cursor: text;
|
|
747
2663
|
}
|
|
@@ -751,56 +2667,56 @@ n(F, "hostName", "textbox"), n(F, "standaloneHostName", "text-box"), n(F, "baseS
|
|
|
751
2667
|
color: var(--fray-color-error, var(--error-color));
|
|
752
2668
|
}
|
|
753
2669
|
`);
|
|
754
|
-
function
|
|
755
|
-
const e =
|
|
2670
|
+
function Ke(t, r) {
|
|
2671
|
+
const e = t.currentTarget;
|
|
756
2672
|
if (e == null || typeof Reflect.get(e, "value") != "string")
|
|
757
|
-
throw new TypeError(`${
|
|
2673
|
+
throw new TypeError(`${r} requires a value-bearing event target`);
|
|
758
2674
|
return Reflect.get(e, "value");
|
|
759
2675
|
}
|
|
760
|
-
class
|
|
2676
|
+
class Ae extends g {
|
|
761
2677
|
constructor(e = {}) {
|
|
762
|
-
var
|
|
2678
|
+
var n;
|
|
763
2679
|
super(e);
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
2680
|
+
s(this, "valueEmitter");
|
|
2681
|
+
s(this, "groupId");
|
|
2682
|
+
s(this, "legendId");
|
|
767
2683
|
const a = e.options ?? [];
|
|
768
|
-
|
|
769
|
-
const
|
|
770
|
-
this.valueEmitter =
|
|
2684
|
+
je(a);
|
|
2685
|
+
const i = ((n = a[0]) == null ? void 0 : n[0]) ?? null;
|
|
2686
|
+
this.valueEmitter = M(
|
|
771
2687
|
this,
|
|
772
2688
|
e,
|
|
773
|
-
|
|
2689
|
+
i ?? null,
|
|
774
2690
|
"toggle value"
|
|
775
|
-
), this.groupId =
|
|
2691
|
+
), this.groupId = j("toggle", e.id), this.legendId = `${this.groupId}-label`;
|
|
776
2692
|
}
|
|
777
2693
|
initialize() {
|
|
778
2694
|
this.watch(this.valueEmitter);
|
|
779
2695
|
}
|
|
780
2696
|
selectOption(e, a = null) {
|
|
781
|
-
this.props.disabled || (this.valueEmitter.set(e, "toggle option selected"),
|
|
2697
|
+
this.props.disabled || (this.valueEmitter.set(e, "toggle option selected"), C(this.props.onChange, e, a));
|
|
782
2698
|
}
|
|
783
2699
|
render() {
|
|
784
2700
|
const {
|
|
785
2701
|
options: e = [],
|
|
786
2702
|
label: a,
|
|
787
|
-
disabled:
|
|
788
|
-
required:
|
|
2703
|
+
disabled: i = !1,
|
|
2704
|
+
required: n = !1
|
|
789
2705
|
} = this.props;
|
|
790
|
-
|
|
791
|
-
const
|
|
2706
|
+
je(e);
|
|
2707
|
+
const o = this.valueEmitter.get(), l = Math.max(
|
|
792
2708
|
0,
|
|
793
|
-
e.findIndex(([
|
|
2709
|
+
e.findIndex(([d]) => Object.is(d, o))
|
|
794
2710
|
);
|
|
795
|
-
return /* @__PURE__ */
|
|
2711
|
+
return /* @__PURE__ */ w(
|
|
796
2712
|
"fieldset",
|
|
797
2713
|
{
|
|
798
2714
|
id: this.groupId,
|
|
799
|
-
disabled:
|
|
800
|
-
className:
|
|
2715
|
+
disabled: i,
|
|
2716
|
+
className: E(this.props) || void 0,
|
|
801
2717
|
"data-fray-component": "toggle",
|
|
802
|
-
"data-disabled":
|
|
803
|
-
"aria-required":
|
|
2718
|
+
"data-disabled": i ? "" : null,
|
|
2719
|
+
"aria-required": n ? "true" : null,
|
|
804
2720
|
children: [
|
|
805
2721
|
a == null ? null : /* @__PURE__ */ u("legend", { id: this.legendId, children: a }),
|
|
806
2722
|
/* @__PURE__ */ u(
|
|
@@ -810,21 +2726,21 @@ class ee extends b {
|
|
|
810
2726
|
role: "radiogroup",
|
|
811
2727
|
"aria-label": a == null ? this.props.ariaLabel : null,
|
|
812
2728
|
"aria-labelledby": a == null ? null : this.legendId,
|
|
813
|
-
children: e.map(([
|
|
2729
|
+
children: e.map(([d, h], f) => /* @__PURE__ */ u(
|
|
814
2730
|
"button",
|
|
815
2731
|
{
|
|
816
2732
|
type: "button",
|
|
817
2733
|
role: "radio",
|
|
818
|
-
disabled:
|
|
2734
|
+
disabled: i,
|
|
819
2735
|
"data-part": "option",
|
|
820
|
-
"aria-checked": Object.is(
|
|
821
|
-
"data-value": String(
|
|
822
|
-
tabIndex:
|
|
823
|
-
onClick: (p) => this.selectOption(
|
|
824
|
-
onKeyDown: (p) => this.handleKeyDown(p,
|
|
2736
|
+
"aria-checked": Object.is(o, d) ? "true" : "false",
|
|
2737
|
+
"data-value": String(d),
|
|
2738
|
+
tabIndex: f === l ? 0 : -1,
|
|
2739
|
+
onClick: (p) => this.selectOption(d, p),
|
|
2740
|
+
onKeyDown: (p) => this.handleKeyDown(p, f, e),
|
|
825
2741
|
children: h
|
|
826
2742
|
},
|
|
827
|
-
String(
|
|
2743
|
+
String(d)
|
|
828
2744
|
))
|
|
829
2745
|
}
|
|
830
2746
|
)
|
|
@@ -832,27 +2748,27 @@ class ee extends b {
|
|
|
832
2748
|
}
|
|
833
2749
|
);
|
|
834
2750
|
}
|
|
835
|
-
handleKeyDown(e, a,
|
|
836
|
-
const { key:
|
|
837
|
-
let
|
|
838
|
-
if (
|
|
839
|
-
else if (
|
|
840
|
-
|
|
841
|
-
else if (
|
|
842
|
-
else if (
|
|
2751
|
+
handleKeyDown(e, a, i) {
|
|
2752
|
+
const { key: n } = e;
|
|
2753
|
+
let o;
|
|
2754
|
+
if (n === "ArrowRight" || n === "ArrowDown") o = (a + 1) % i.length;
|
|
2755
|
+
else if (n === "ArrowLeft" || n === "ArrowUp")
|
|
2756
|
+
o = (a - 1 + i.length) % i.length;
|
|
2757
|
+
else if (n === "Home") o = 0;
|
|
2758
|
+
else if (n === "End") o = i.length - 1;
|
|
843
2759
|
else return;
|
|
844
2760
|
e.preventDefault();
|
|
845
|
-
const
|
|
846
|
-
if (
|
|
847
|
-
const
|
|
848
|
-
|
|
2761
|
+
const l = i[o];
|
|
2762
|
+
if (l != null && (this.selectOption(l[0], e), this.dom instanceof Element)) {
|
|
2763
|
+
const d = this.dom.querySelectorAll('[role="radio"]')[o];
|
|
2764
|
+
d == null || d.focus();
|
|
849
2765
|
}
|
|
850
2766
|
}
|
|
851
2767
|
}
|
|
852
|
-
|
|
2768
|
+
s(Ae, "baseStyles", [
|
|
853
2769
|
['fieldset[data-fray-component="toggle"] > [data-part="options"]', ["uiline"]],
|
|
854
2770
|
['fieldset[data-fray-component="toggle"] [data-part="option"]', ["uiline", "button"]]
|
|
855
|
-
]),
|
|
2771
|
+
]), s(Ae, "css", v`
|
|
856
2772
|
fieldset[data-fray-component="toggle"] {
|
|
857
2773
|
margin: 0;
|
|
858
2774
|
padding: 0;
|
|
@@ -885,40 +2801,40 @@ n(ee, "baseStyles", [
|
|
|
885
2801
|
color: var(--fray-selection-color, var(--toggle-selected-text));
|
|
886
2802
|
}
|
|
887
2803
|
`);
|
|
888
|
-
function
|
|
889
|
-
|
|
890
|
-
for (const
|
|
891
|
-
if (!Array.isArray(
|
|
2804
|
+
function je(t) {
|
|
2805
|
+
fe(t);
|
|
2806
|
+
for (const r of t)
|
|
2807
|
+
if (!Array.isArray(r) || r.length < 2)
|
|
892
2808
|
throw new TypeError("Toggle options must be [value, label] tuples");
|
|
893
2809
|
}
|
|
894
|
-
class
|
|
2810
|
+
class re extends g {
|
|
895
2811
|
render() {
|
|
896
2812
|
const {
|
|
897
|
-
children:
|
|
2813
|
+
children: r = [],
|
|
898
2814
|
id: e,
|
|
899
2815
|
label: a = "Actions",
|
|
900
|
-
orientation:
|
|
2816
|
+
orientation: i = "horizontal"
|
|
901
2817
|
} = this.props;
|
|
902
|
-
if (!["horizontal", "vertical"].includes(
|
|
2818
|
+
if (!["horizontal", "vertical"].includes(i))
|
|
903
2819
|
throw new TypeError("Toolbar orientation must be horizontal or vertical");
|
|
904
|
-
const
|
|
2820
|
+
const n = this.Host;
|
|
905
2821
|
return /* @__PURE__ */ u(
|
|
906
|
-
|
|
2822
|
+
n,
|
|
907
2823
|
{
|
|
908
2824
|
id: e,
|
|
909
2825
|
role: "toolbar",
|
|
910
|
-
className:
|
|
911
|
-
"data-orientation":
|
|
2826
|
+
className: E(this.props) || null,
|
|
2827
|
+
"data-orientation": i,
|
|
912
2828
|
"aria-label": a,
|
|
913
|
-
"aria-orientation":
|
|
914
|
-
children:
|
|
2829
|
+
"aria-orientation": i,
|
|
2830
|
+
children: r
|
|
915
2831
|
}
|
|
916
2832
|
);
|
|
917
2833
|
}
|
|
918
2834
|
}
|
|
919
|
-
|
|
2835
|
+
s(re, "hostName", "toolbar"), s(re, "standaloneHostName", "tool-bar"), s(re, "baseStyles", [
|
|
920
2836
|
["&", ["toolbar"]]
|
|
921
|
-
]),
|
|
2837
|
+
]), s(re, "css", v`
|
|
922
2838
|
& {
|
|
923
2839
|
display: flex;
|
|
924
2840
|
flex-wrap: wrap;
|
|
@@ -932,11 +2848,11 @@ n(P, "hostName", "toolbar"), n(P, "standaloneHostName", "tool-bar"), n(P, "baseS
|
|
|
932
2848
|
align-items: stretch;
|
|
933
2849
|
}
|
|
934
2850
|
`);
|
|
935
|
-
class
|
|
2851
|
+
class he extends g {
|
|
936
2852
|
constructor(e) {
|
|
937
2853
|
super(e);
|
|
938
|
-
|
|
939
|
-
if (this.progressId =
|
|
2854
|
+
s(this, "progressId");
|
|
2855
|
+
if (this.progressId = j("progress", e.id), e.valueEmitter != null && !Wt(e.valueEmitter))
|
|
940
2856
|
throw new TypeError("ProgressBar valueEmitter must be a readable emitter");
|
|
941
2857
|
}
|
|
942
2858
|
render() {
|
|
@@ -946,26 +2862,26 @@ class B extends b {
|
|
|
946
2862
|
const a = this.props.valueEmitter == null ? this.props.value ?? null : this.read(this.props.valueEmitter);
|
|
947
2863
|
if (a != null && (!Number.isFinite(a) || a < 0))
|
|
948
2864
|
throw new RangeError("ProgressBar value must be null or a non-negative finite number");
|
|
949
|
-
const
|
|
950
|
-
return /* @__PURE__ */
|
|
951
|
-
/* @__PURE__ */
|
|
2865
|
+
const i = a == null ? null : Math.min(a, e), n = this.props.valueText ?? (i == null ? "In progress" : `${Math.round(i / e * 100)}%`), o = this.Host;
|
|
2866
|
+
return /* @__PURE__ */ w(o, { className: E(this.props) || null, children: [
|
|
2867
|
+
/* @__PURE__ */ w("div", { "data-part": "label-line", children: [
|
|
952
2868
|
/* @__PURE__ */ u("label", { htmlFor: this.progressId, children: this.props.label }),
|
|
953
|
-
/* @__PURE__ */ u("span", { "data-part": "value", children:
|
|
2869
|
+
/* @__PURE__ */ u("span", { "data-part": "value", children: n })
|
|
954
2870
|
] }),
|
|
955
2871
|
/* @__PURE__ */ u(
|
|
956
2872
|
"progress",
|
|
957
2873
|
{
|
|
958
2874
|
id: this.progressId,
|
|
959
|
-
value:
|
|
2875
|
+
value: i ?? void 0,
|
|
960
2876
|
max: e,
|
|
961
|
-
"aria-valuetext":
|
|
962
|
-
children:
|
|
2877
|
+
"aria-valuetext": n,
|
|
2878
|
+
children: n
|
|
963
2879
|
}
|
|
964
2880
|
)
|
|
965
2881
|
] });
|
|
966
2882
|
}
|
|
967
2883
|
}
|
|
968
|
-
|
|
2884
|
+
s(he, "hostName", "progress-bar"), s(he, "standaloneHostName", "progress-bar"), s(he, "css", v`
|
|
969
2885
|
& {
|
|
970
2886
|
display: grid;
|
|
971
2887
|
gap: var(--spacing-small, 0.5rem);
|
|
@@ -995,195 +2911,195 @@ n(B, "hostName", "progress-bar"), n(B, "standaloneHostName", "progress-bar"), n(
|
|
|
995
2911
|
}
|
|
996
2912
|
}
|
|
997
2913
|
`);
|
|
998
|
-
function
|
|
999
|
-
return
|
|
1000
|
-
}
|
|
1001
|
-
const
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
]),
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
]),
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
2914
|
+
function Wt(t) {
|
|
2915
|
+
return t != null && (typeof t == "object" || typeof t == "function") && typeof Reflect.get(t, "get") == "function" && typeof Reflect.get(t, "subscribe") == "function";
|
|
2916
|
+
}
|
|
2917
|
+
const ur = Object.freeze([
|
|
2918
|
+
c("--fray-color-canvas", "color", "palette", "color", "Application canvas"),
|
|
2919
|
+
c("--fray-color-surface", "color", "palette", "color", "Primary surface"),
|
|
2920
|
+
c("--fray-color-surface-muted", "color", "palette", "color", "Subdued surface"),
|
|
2921
|
+
c("--fray-color-surface-raised", "color", "palette", "color", "Raised surface"),
|
|
2922
|
+
c("--fray-color-surface-inset", "color", "palette", "color", "Inset surface"),
|
|
2923
|
+
c("--fray-color-text", "color", "palette", "color", "Primary text"),
|
|
2924
|
+
c("--fray-color-text-muted", "color", "palette", "color", "Secondary text"),
|
|
2925
|
+
c("--fray-color-border", "color", "palette", "color", "Ordinary border"),
|
|
2926
|
+
c("--fray-color-border-strong", "color", "palette", "color", "Emphasized border"),
|
|
2927
|
+
c("--fray-color-primary", "color", "palette", "color", "Primary accent"),
|
|
2928
|
+
c("--fray-color-primary-hover", "color", "palette", "color", "Hovered accent"),
|
|
2929
|
+
c("--fray-color-primary-active", "color", "palette", "color", "Active accent"),
|
|
2930
|
+
c("--fray-color-primary-soft", "color", "palette", "color", "Subtle accent surface"),
|
|
2931
|
+
c("--fray-color-on-primary", "color", "palette", "color", "Content on primary accent"),
|
|
2932
|
+
c("--fray-color-focus", "color", "palette", "color", "Keyboard focus indication"),
|
|
2933
|
+
c("--fray-color-selection", "color", "palette", "color", "Selected item surface"),
|
|
2934
|
+
c("--fray-color-on-selection", "color", "palette", "color", "Content on selection"),
|
|
2935
|
+
c("--fray-color-disabled", "color", "palette", "color", "Disabled surface"),
|
|
2936
|
+
c("--fray-color-on-disabled", "color", "palette", "color", "Disabled content"),
|
|
2937
|
+
c("--fray-color-error", "color", "status", "color", "Error state"),
|
|
2938
|
+
c("--fray-color-on-error", "color", "status", "color", "Content on error"),
|
|
2939
|
+
c("--fray-color-success", "color", "status", "color", "Success state"),
|
|
2940
|
+
c("--fray-color-on-success", "color", "status", "color", "Content on success"),
|
|
2941
|
+
c("--fray-color-highlight", "color", "palette", "color", "Light reflection/highlight"),
|
|
2942
|
+
c("--fray-color-shadow", "color", "palette", "color", "Shadow tint"),
|
|
2943
|
+
c("--fray-font-family", "theme", "typography", "font", "UI font stack"),
|
|
2944
|
+
c("--fray-font-size", "theme", "typography", "dimension", "Base UI font size"),
|
|
2945
|
+
c("--fray-line-height", "theme", "typography", "dimension", "Base UI line height"),
|
|
2946
|
+
c("--fray-control-min-height", "theme", "control", "dimension", "Minimum control height"),
|
|
2947
|
+
c("--fray-space-xs", "theme", "spacing", "dimension", "Extra-small spacing"),
|
|
2948
|
+
c("--fray-space-sm", "theme", "spacing", "dimension", "Small spacing"),
|
|
2949
|
+
c("--fray-space-md", "theme", "spacing", "dimension", "Medium spacing"),
|
|
2950
|
+
c("--fray-space-lg", "theme", "spacing", "dimension", "Large spacing"),
|
|
2951
|
+
c("--fray-radius-sm", "theme", "shape", "radius", "Small corner radius"),
|
|
2952
|
+
c("--fray-radius-md", "theme", "shape", "radius", "Ordinary corner radius"),
|
|
2953
|
+
c("--fray-radius-lg", "theme", "shape", "radius", "Large corner radius"),
|
|
2954
|
+
c("--fray-motion-fast", "theme", "motion", "duration", "Fast interaction transition"),
|
|
2955
|
+
c("--fray-ui-background", "theme", "surface", "background", "Default UI background"),
|
|
2956
|
+
c("--fray-ui-color", "theme", "surface", "color", "Default UI text"),
|
|
2957
|
+
c("--fray-ui-border", "theme", "surface", "border", "Default UI border"),
|
|
2958
|
+
c("--fray-ui-shadow", "theme", "surface", "shadow", "Default raised shadow"),
|
|
2959
|
+
c("--fray-focus-ring", "theme", "focus", "shadow", "Keyboard focus ring"),
|
|
2960
|
+
c("--fray-panel-background", "theme", "panel", "background", "Panel surface", "--fray-ui-background"),
|
|
2961
|
+
c("--fray-panel-color", "theme", "panel", "color", "Panel content", "--fray-ui-color"),
|
|
2962
|
+
c("--fray-panel-border", "theme", "panel", "border", "Panel border", "--fray-ui-border"),
|
|
2963
|
+
c("--fray-panel-shadow", "theme", "panel", "shadow", "Panel shadow", "--fray-ui-shadow"),
|
|
2964
|
+
c("--fray-panel-radius", "theme", "panel", "radius", "Panel radius", "--fray-radius-md"),
|
|
2965
|
+
c("--fray-dialog-shadow", "theme", "dialog", "shadow", "Modal dialog shadow", "--fray-panel-shadow"),
|
|
2966
|
+
c("--fray-dialog-backdrop-background", "theme", "dialog", "background", "Modal backdrop"),
|
|
2967
|
+
c("--fray-header-background", "theme", "header", "background", "Generic header surface"),
|
|
2968
|
+
c("--fray-header-color", "theme", "header", "color", "Generic header content"),
|
|
2969
|
+
c("--fray-header-border", "theme", "header", "border", "Generic header border"),
|
|
2970
|
+
c("--fray-header-shadow", "theme", "header", "shadow", "Generic header shadow"),
|
|
2971
|
+
c("--fray-section-header-background", "theme", "header", "background", "Section header surface", "--fray-header-background"),
|
|
2972
|
+
c("--fray-section-header-color", "theme", "header", "color", "Section header content", "--fray-header-color"),
|
|
2973
|
+
c("--fray-section-header-border", "theme", "header", "border", "Section header border", "--fray-header-border"),
|
|
2974
|
+
c("--fray-section-header-shadow", "theme", "header", "shadow", "Section header shadow", "--fray-header-shadow"),
|
|
2975
|
+
c("--fray-panel-header-background", "theme", "header", "background", "Panel header surface", "--fray-section-header-background"),
|
|
2976
|
+
c("--fray-panel-header-color", "theme", "header", "color", "Panel header content", "--fray-section-header-color"),
|
|
2977
|
+
c("--fray-table-header-background", "theme", "header", "background", "Table header surface", "--fray-section-header-background"),
|
|
2978
|
+
c("--fray-table-header-color", "theme", "header", "color", "Table header content", "--fray-section-header-color"),
|
|
2979
|
+
c("--fray-dialog-header-background", "theme", "header", "background", "Dialog header surface", "--fray-section-header-background"),
|
|
2980
|
+
c("--fray-dialog-header-color", "theme", "header", "color", "Dialog header content", "--fray-section-header-color"),
|
|
2981
|
+
c("--fray-button-background", "theme", "button", "background", "Generic button surface"),
|
|
2982
|
+
c("--fray-button-background-hover", "theme", "button", "background", "Hovered button surface"),
|
|
2983
|
+
c("--fray-button-background-active", "theme", "button", "background", "Pressed button surface"),
|
|
2984
|
+
c("--fray-button-background-disabled", "theme", "button", "background", "Disabled button surface"),
|
|
2985
|
+
c("--fray-button-color", "theme", "button", "color", "Generic button content"),
|
|
2986
|
+
c("--fray-button-border", "theme", "button", "border", "Generic button border"),
|
|
2987
|
+
c("--fray-button-shadow", "theme", "button", "shadow", "Generic button shadow"),
|
|
2988
|
+
c("--fray-button-shadow-active", "theme", "button", "shadow", "Pressed button shadow"),
|
|
2989
|
+
c("--fray-toggle-button-background", "theme", "button", "background", "Toggle option surface", "--fray-button-background"),
|
|
2990
|
+
c("--fray-toggle-button-background-checked", "theme", "button", "background", "Selected toggle option", "--fray-selection-background"),
|
|
2991
|
+
c("--fray-tab-button-background", "theme", "button", "background", "Tab surface", "--fray-button-background"),
|
|
2992
|
+
c("--fray-tab-button-background-active", "theme", "button", "background", "Active tab surface", "--fray-tab-active-background"),
|
|
2993
|
+
c("--fray-menu-button-background", "theme", "button", "background", "Menu action surface", "--fray-button-background"),
|
|
2994
|
+
c("--fray-dropdown-trigger-background", "theme", "button", "background", "Dropdown arrow/trigger surface", "--fray-button-background"),
|
|
2995
|
+
c("--fray-table-header-button-background", "theme", "button", "background", "Table-header action surface", "--fray-button-background"),
|
|
2996
|
+
c("--fray-input-background", "theme", "input", "background", "Input surface"),
|
|
2997
|
+
c("--fray-input-color", "theme", "input", "color", "Input content"),
|
|
2998
|
+
c("--fray-input-border", "theme", "input", "border", "Input border"),
|
|
2999
|
+
c("--fray-input-shadow", "theme", "input", "shadow", "Input shadow"),
|
|
3000
|
+
c("--fray-input-background-disabled", "theme", "input", "background", "Disabled input surface"),
|
|
3001
|
+
c("--fray-input-color-disabled", "theme", "input", "color", "Disabled input content"),
|
|
3002
|
+
c("--fray-selection-background", "theme", "selection", "background", "Selected item surface"),
|
|
3003
|
+
c("--fray-selection-color", "theme", "selection", "color", "Selected item content"),
|
|
3004
|
+
c("--fray-row-hover-background", "theme", "row", "background", "Hovered list/table/tree row"),
|
|
3005
|
+
c("--fray-table-row-background", "theme", "table", "background", "Odd table row surface"),
|
|
3006
|
+
c("--fray-table-row-alt-background", "theme", "table", "background", "Even table row surface"),
|
|
3007
|
+
c("--fray-checkbox-box-background", "theme", "checkbox", "background", "Unchecked checkbox box", "--fray-input-background"),
|
|
3008
|
+
c("--fray-checkbox-box-background-checked", "theme", "checkbox", "background", "Checked checkbox box", "--fray-selection-background"),
|
|
3009
|
+
c("--fray-checkbox-box-border", "theme", "checkbox", "border", "Checkbox box border", "--fray-input-border"),
|
|
3010
|
+
c("--fray-checkbox-symbol-color", "theme", "checkbox", "color", "Checkbox symbol", "--fray-selection-color"),
|
|
3011
|
+
c("--fray-radio-background", "theme", "radio", "background", "Radio/toggle option surface", "--fray-toggle-button-background"),
|
|
3012
|
+
c("--fray-radio-background-checked", "theme", "radio", "background", "Selected radio/toggle option", "--fray-selection-background"),
|
|
3013
|
+
c("--fray-toolbar-background", "theme", "toolbar", "background", "Toolbar surface", "--fray-panel-background"),
|
|
3014
|
+
c("--fray-toolbar-color", "theme", "toolbar", "color", "Toolbar content", "--fray-panel-color"),
|
|
3015
|
+
c("--fray-toolbar-border", "theme", "toolbar", "border", "Toolbar border", "--fray-panel-border"),
|
|
3016
|
+
c("--fray-toolbar-shadow", "theme", "toolbar", "shadow", "Toolbar shadow", "--fray-panel-shadow"),
|
|
3017
|
+
c("--fray-tabline-background", "theme", "tabs", "background", "Tab strip surface", "--fray-panel-background"),
|
|
3018
|
+
c("--fray-tab-active-background", "theme", "tabs", "background", "Active tab surface", "--fray-panel-background"),
|
|
3019
|
+
c("--fray-progress-track-background", "theme", "progress", "background", "Progress track"),
|
|
3020
|
+
c("--fray-progress-value-background", "theme", "progress", "background", "Progress value"),
|
|
3021
|
+
c("--fray-working-background-image", "theme", "status", "background", "Indeterminate/loading texture")
|
|
3022
|
+
]), Jt = Object.freeze([
|
|
3023
|
+
R("shiny", "Shiny", N("themes/shiny/theme.css")),
|
|
3024
|
+
R("java", "Java", N("themes/java/theme.css")),
|
|
3025
|
+
R("minimal", "Minimal", N("themes/minimal/theme.css"))
|
|
3026
|
+
]), Yt = Object.freeze([
|
|
3027
|
+
R("iceblue", "Ice blue", N("colors/iceblue/colors.css")),
|
|
3028
|
+
R("ocean", "Ocean", N("colors/ocean/colors.css")),
|
|
3029
|
+
R("green", "Green", N("colors/green/colors.css")),
|
|
3030
|
+
R("gray", "Gray", N("colors/gray/colors.css")),
|
|
3031
|
+
R("orange", "Orange", N("colors/orange/colors.css")),
|
|
3032
|
+
R("purple", "Purple", N("colors/purple/colors.css")),
|
|
3033
|
+
R("red", "Red", N("colors/red/colors.css")),
|
|
3034
|
+
R("yellow", "Yellow", N("colors/yellow/colors.css"))
|
|
1119
3035
|
]);
|
|
1120
|
-
function
|
|
1121
|
-
if (
|
|
3036
|
+
function _t(t, r, e = globalThis.document) {
|
|
3037
|
+
if (Xt(r), (e == null ? void 0 : e.head) == null || e.documentElement == null)
|
|
1122
3038
|
throw new TypeError("replaceFrayStylesheet requires a document with a head and root");
|
|
1123
|
-
const a = `link[data-fray-stylesheet="${
|
|
1124
|
-
let
|
|
1125
|
-
return
|
|
3039
|
+
const a = `link[data-fray-stylesheet="${t}"]`;
|
|
3040
|
+
let i = e.head.querySelector(a);
|
|
3041
|
+
return i == null && (i = e.createElement("link"), i.rel = "stylesheet", i.dataset.frayStylesheet = t, e.head.append(i)), i.dataset.fraySelection = r.value, i.getAttribute("href") !== r.href && i.setAttribute("href", r.href), t === "theme" ? e.documentElement.dataset.frayTheme = r.value : e.documentElement.dataset.frayColor = r.value, i;
|
|
1126
3042
|
}
|
|
1127
|
-
function
|
|
1128
|
-
const e =
|
|
1129
|
-
if (e == null) throw new RangeError(`Unknown Fray stylesheet selection: ${
|
|
3043
|
+
function ae(t, r) {
|
|
3044
|
+
const e = t.find((a) => a.value === r);
|
|
3045
|
+
if (e == null) throw new RangeError(`Unknown Fray stylesheet selection: ${r}`);
|
|
1130
3046
|
return e;
|
|
1131
3047
|
}
|
|
1132
|
-
function t
|
|
1133
|
-
return
|
|
3048
|
+
function c(t, r, e, a, i, n) {
|
|
3049
|
+
return n == null ? Object.freeze({ name: t, layer: r, family: e, value: a, description: i }) : Object.freeze({ name: t, layer: r, family: e, value: a, description: i, fallback: n });
|
|
1134
3050
|
}
|
|
1135
|
-
function
|
|
1136
|
-
return Object.freeze({ value:
|
|
3051
|
+
function R(t, r, e) {
|
|
3052
|
+
return Object.freeze({ value: t, label: r, href: e });
|
|
1137
3053
|
}
|
|
1138
|
-
function
|
|
1139
|
-
const
|
|
1140
|
-
return new URL(
|
|
3054
|
+
function N(t) {
|
|
3055
|
+
const r = import.meta.url.includes("/src/styling/") ? `../../${t}` : `../${t}`;
|
|
3056
|
+
return new URL(r, import.meta.url).href;
|
|
1141
3057
|
}
|
|
1142
|
-
function
|
|
1143
|
-
if (
|
|
3058
|
+
function Xt(t) {
|
|
3059
|
+
if (t == null || typeof t != "object")
|
|
1144
3060
|
throw new TypeError("Fray stylesheet selection must be an option");
|
|
1145
|
-
for (const
|
|
1146
|
-
if (typeof Reflect.get(
|
|
1147
|
-
throw new TypeError(`Fray stylesheet option ${
|
|
3061
|
+
for (const r of ["value", "label", "href"])
|
|
3062
|
+
if (typeof Reflect.get(t, r) != "string" || String(Reflect.get(t, r)).length === 0)
|
|
3063
|
+
throw new TypeError(`Fray stylesheet option ${r} must be a non-empty string`);
|
|
1148
3064
|
}
|
|
1149
|
-
class
|
|
1150
|
-
constructor(e, a,
|
|
1151
|
-
var
|
|
3065
|
+
class oe extends g {
|
|
3066
|
+
constructor(e, a, i) {
|
|
3067
|
+
var l;
|
|
1152
3068
|
super(e);
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
const
|
|
1158
|
-
|
|
1159
|
-
const
|
|
1160
|
-
if (
|
|
1161
|
-
this.kind = a, this.defaults =
|
|
3069
|
+
s(this, "valueEmitter");
|
|
3070
|
+
s(this, "inputId");
|
|
3071
|
+
s(this, "kind");
|
|
3072
|
+
s(this, "defaults");
|
|
3073
|
+
const n = e.options ?? i;
|
|
3074
|
+
Me(n);
|
|
3075
|
+
const o = (l = n[0]) == null ? void 0 : l.value;
|
|
3076
|
+
if (o == null) throw new TypeError(`${a} picker requires at least one option`);
|
|
3077
|
+
this.kind = a, this.defaults = i, this.inputId = j(`${a}-picker`, e.id), this.valueEmitter = M(this, e, o, `${a} selection`), ae(n, this.valueEmitter.get());
|
|
1162
3078
|
}
|
|
1163
3079
|
initialize() {
|
|
1164
3080
|
this.watch(this.valueEmitter);
|
|
1165
3081
|
}
|
|
1166
3082
|
render() {
|
|
1167
|
-
const e = this.options, a =
|
|
1168
|
-
return /* @__PURE__ */
|
|
1169
|
-
|
|
3083
|
+
const e = this.options, a = ae(e, this.valueEmitter.get()), { label: i, ariaLabel: n, disabled: o = !1, onChange: l } = this.props, d = this.Host;
|
|
3084
|
+
return /* @__PURE__ */ w(
|
|
3085
|
+
d,
|
|
1170
3086
|
{
|
|
1171
|
-
className:
|
|
3087
|
+
className: E(this.props) || null,
|
|
1172
3088
|
"data-kind": this.kind,
|
|
1173
|
-
"data-disabled":
|
|
3089
|
+
"data-disabled": o ? "" : null,
|
|
1174
3090
|
children: [
|
|
1175
|
-
|
|
3091
|
+
i == null ? null : /* @__PURE__ */ u("label", { htmlFor: this.inputId, children: i }),
|
|
1176
3092
|
/* @__PURE__ */ u(
|
|
1177
3093
|
"select",
|
|
1178
3094
|
{
|
|
1179
3095
|
id: this.inputId,
|
|
1180
3096
|
"data-part": "control",
|
|
1181
3097
|
value: a.value,
|
|
1182
|
-
disabled:
|
|
1183
|
-
"aria-label":
|
|
3098
|
+
disabled: o,
|
|
3099
|
+
"aria-label": i == null ? n : null,
|
|
1184
3100
|
onChange: (h) => {
|
|
1185
|
-
const
|
|
1186
|
-
this.valueEmitter.set(
|
|
3101
|
+
const f = Zt(h), p = ae(e, f);
|
|
3102
|
+
this.valueEmitter.set(f, `${this.kind} selected`), C(l, f, p, h);
|
|
1187
3103
|
},
|
|
1188
3104
|
children: e.map((h) => /* @__PURE__ */ u(
|
|
1189
3105
|
"option",
|
|
@@ -1208,23 +3124,23 @@ class D extends b {
|
|
|
1208
3124
|
}
|
|
1209
3125
|
get options() {
|
|
1210
3126
|
const e = this.props.options ?? this.defaults;
|
|
1211
|
-
return
|
|
3127
|
+
return Me(e), e;
|
|
1212
3128
|
}
|
|
1213
3129
|
applySelection() {
|
|
1214
3130
|
const e = this.props.targetDocument ?? (typeof document > "u" ? null : document);
|
|
1215
|
-
e != null &&
|
|
3131
|
+
e != null && _t(
|
|
1216
3132
|
this.kind,
|
|
1217
|
-
|
|
3133
|
+
ae(this.options, this.valueEmitter.get()),
|
|
1218
3134
|
e
|
|
1219
3135
|
);
|
|
1220
3136
|
}
|
|
1221
3137
|
}
|
|
1222
|
-
|
|
3138
|
+
s(oe, "baseStyles", [
|
|
1223
3139
|
["&", ["labeledinput", "inputline"]],
|
|
1224
3140
|
["& > label", ["label"]],
|
|
1225
3141
|
["& > select", ["input", "inputline"]],
|
|
1226
3142
|
["&[data-disabled]", ["disabled"]]
|
|
1227
|
-
]),
|
|
3143
|
+
]), s(oe, "css", v`
|
|
1228
3144
|
& {
|
|
1229
3145
|
position: relative;
|
|
1230
3146
|
}
|
|
@@ -1233,80 +3149,114 @@ n(D, "baseStyles", [
|
|
|
1233
3149
|
min-width: 8rem;
|
|
1234
3150
|
}
|
|
1235
3151
|
`);
|
|
1236
|
-
class
|
|
1237
|
-
constructor(
|
|
1238
|
-
super(
|
|
3152
|
+
class Fe extends oe {
|
|
3153
|
+
constructor(r = {}) {
|
|
3154
|
+
super(r, "theme", Jt);
|
|
1239
3155
|
}
|
|
1240
3156
|
}
|
|
1241
|
-
|
|
1242
|
-
class
|
|
1243
|
-
constructor(
|
|
1244
|
-
super(
|
|
3157
|
+
s(Fe, "hostName", "theme-picker"), s(Fe, "standaloneHostName", "theme-picker");
|
|
3158
|
+
class He extends oe {
|
|
3159
|
+
constructor(r = {}) {
|
|
3160
|
+
super(r, "colors", Yt);
|
|
1245
3161
|
}
|
|
1246
3162
|
}
|
|
1247
|
-
|
|
1248
|
-
function
|
|
1249
|
-
if (!Array.isArray(
|
|
3163
|
+
s(He, "hostName", "color-picker"), s(He, "standaloneHostName", "color-picker");
|
|
3164
|
+
function Me(t) {
|
|
3165
|
+
if (!Array.isArray(t) || t.length === 0)
|
|
1250
3166
|
throw new TypeError("Stylesheet picker options must be a non-empty array");
|
|
1251
|
-
const
|
|
1252
|
-
for (const e of
|
|
3167
|
+
const r = /* @__PURE__ */ new Set();
|
|
3168
|
+
for (const e of t) {
|
|
1253
3169
|
if (e == null || typeof e != "object")
|
|
1254
3170
|
throw new TypeError("Stylesheet picker options must be objects");
|
|
1255
3171
|
for (const a of ["value", "label", "href"])
|
|
1256
3172
|
if (typeof e[a] != "string" || e[a].length === 0)
|
|
1257
3173
|
throw new TypeError(`Stylesheet picker option ${a} must be a string`);
|
|
1258
|
-
if (
|
|
3174
|
+
if (r.has(e.value))
|
|
1259
3175
|
throw new Error(`Duplicate stylesheet picker value: ${e.value}`);
|
|
1260
|
-
|
|
3176
|
+
r.add(e.value);
|
|
1261
3177
|
}
|
|
1262
3178
|
}
|
|
1263
|
-
function
|
|
1264
|
-
const
|
|
1265
|
-
if (typeof
|
|
3179
|
+
function Zt(t) {
|
|
3180
|
+
const r = t.currentTarget == null ? null : Reflect.get(t.currentTarget, "value");
|
|
3181
|
+
if (typeof r != "string")
|
|
1266
3182
|
throw new TypeError("Stylesheet picker change requires a select element");
|
|
1267
|
-
return
|
|
3183
|
+
return r;
|
|
1268
3184
|
}
|
|
1269
3185
|
export {
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
X as
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
3186
|
+
Be as BaseSelectionHandler,
|
|
3187
|
+
se as Button,
|
|
3188
|
+
D as Checkbox,
|
|
3189
|
+
He as ColorPicker,
|
|
3190
|
+
g as Component,
|
|
3191
|
+
X as DataTable,
|
|
3192
|
+
St as DefaultTableFilterEncoding,
|
|
3193
|
+
Ue as DescriptionItem,
|
|
3194
|
+
Te as DescriptionList,
|
|
3195
|
+
Oe as Dialog,
|
|
3196
|
+
ee as Dropdown,
|
|
3197
|
+
y as FilterMode,
|
|
3198
|
+
V as FilterPanel,
|
|
3199
|
+
pr as Fragment,
|
|
3200
|
+
mr as FrayRuntime,
|
|
3201
|
+
G as ListView,
|
|
3202
|
+
st as MultiSelectionHandler,
|
|
3203
|
+
_ as Panel,
|
|
3204
|
+
H as Placeholder,
|
|
3205
|
+
he as ProgressBar,
|
|
3206
|
+
$e as QuadCheckbox,
|
|
3207
|
+
xe as Sidebar,
|
|
3208
|
+
ge as SingleSelectionHandler,
|
|
3209
|
+
ce as SplitView,
|
|
3210
|
+
br as StyleRegistry,
|
|
3211
|
+
ze as Tab,
|
|
3212
|
+
L as TabLine,
|
|
3213
|
+
J as TabPanel,
|
|
3214
|
+
me as TableHeader,
|
|
3215
|
+
W as TableHeaderCell,
|
|
3216
|
+
te as Textbox,
|
|
3217
|
+
Fe as ThemePicker,
|
|
3218
|
+
Ae as Toggle,
|
|
3219
|
+
re as Toolbar,
|
|
3220
|
+
We as TreeItem,
|
|
3221
|
+
Z as TreeView,
|
|
3222
|
+
Ce as TriCheckbox,
|
|
3223
|
+
It as applyLocalTableState,
|
|
3224
|
+
Ge as assertSort,
|
|
3225
|
+
P as assertTreeNodes,
|
|
3226
|
+
yr as createFrayRuntime,
|
|
3227
|
+
Ot as createHandlerTableDataSource,
|
|
3228
|
+
Dt as createLocalTableDataSource,
|
|
3229
|
+
or as createQueryTableDataSource,
|
|
3230
|
+
$t as createRestTableDataSource,
|
|
3231
|
+
ne as createSelectionHandler,
|
|
3232
|
+
gr as createStyleRegistry,
|
|
3233
|
+
v as css,
|
|
3234
|
+
wr as defaultFrayRuntime,
|
|
3235
|
+
we as defaultItemKey,
|
|
3236
|
+
ar as deriveFilterPredicate,
|
|
3237
|
+
ir as deriveFilteredItems,
|
|
3238
|
+
dr as deriveTreeNode,
|
|
3239
|
+
it as filterByState,
|
|
3240
|
+
ae as findFrayStylesheetOption,
|
|
3241
|
+
lr as findTreeNode,
|
|
3242
|
+
Yt as frayColorOptions,
|
|
3243
|
+
Jt as frayThemeOptions,
|
|
3244
|
+
ur as frayThemeVariableCatalog,
|
|
3245
|
+
Er as h,
|
|
3246
|
+
de as isFilterMode,
|
|
1303
3247
|
u as jsx,
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
3248
|
+
vr as jsxDEV,
|
|
3249
|
+
w as jsxs,
|
|
3250
|
+
Sr as live,
|
|
3251
|
+
Pe as matchesFilterState,
|
|
3252
|
+
sr as parseFilterState,
|
|
3253
|
+
_t as replaceFrayStylesheet,
|
|
3254
|
+
nr as serializeFilterState,
|
|
3255
|
+
kt as serializeTableQuery,
|
|
3256
|
+
kr as styleRegistry,
|
|
3257
|
+
qe as tabButtonId,
|
|
3258
|
+
Le as tabPanelId,
|
|
3259
|
+
Mt as updateTreeNode,
|
|
3260
|
+
cr as updateWritableTreeNode
|
|
1311
3261
|
};
|
|
1312
3262
|
//# sourceMappingURL=index.js.map
|