@slotted/react 0.1.0-beta.31 → 0.1.0-beta.32
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/dist/{chart-CbOswR3s.js → chart-BXwHG9tX.js} +339 -339
- package/dist/chart.js +1 -1
- package/dist/docs/chart.examples.md +21 -1
- package/dist/docs/chart.json +36 -2
- package/dist/docs/chart.md +7 -3
- package/dist/docs/index.md +1 -1
- package/dist/docs/table.json +7 -0
- package/dist/docs/table.md +1 -0
- package/dist/{import-export-center-Do0zrdSV.js → import-export-center-CV11dYvN.js} +1 -1
- package/dist/import-export-center.js +1 -1
- package/dist/index.js +3 -3
- package/dist/styles/import-export-center.css +1 -1
- package/dist/styles/index.css +1 -1
- package/dist/styles/table.css +1 -1
- package/dist/styles.css +1 -1
- package/dist/{table-Bm-PAtCn.js → table-CAhIaFxs.js} +259 -258
- package/dist/table.js +1 -1
- package/dist/types/chart/chart.d.ts +2 -1
- package/dist/types/chart/chart.d.ts.map +1 -1
- package/dist/types/table/table-parts.d.ts +1 -1
- package/dist/types/table/table-parts.d.ts.map +1 -1
- package/dist/types/table/table.types.d.ts +6 -0
- package/dist/types/table/table.types.d.ts.map +1 -1
- package/package.json +6 -6
|
@@ -15,28 +15,28 @@ import { t as ne } from "./number-field-DzOcs9uG.js";
|
|
|
15
15
|
import { c as re, i as ie, n as ae, o as oe, s as se } from "./select-jdqT8lFi.js";
|
|
16
16
|
import { t as v } from "./time-picker-Cw9NezUE.js";
|
|
17
17
|
import { t as y } from "./time-range-picker-DmmUqGjV.js";
|
|
18
|
-
import { n as ce, t as
|
|
19
|
-
import { t as
|
|
20
|
-
import { keyedProps as
|
|
21
|
-
import { createFocusOrigin as
|
|
22
|
-
import { createControllable as
|
|
23
|
-
import { createContext as
|
|
24
|
-
import { Fragment as
|
|
25
|
-
import { createScrollAffordance as
|
|
26
|
-
import { tableMessages as
|
|
27
|
-
import { createFilter as
|
|
28
|
-
import { isRowAction as
|
|
18
|
+
import { n as ce, t as b } from "./radio-group-doL7tde1.js";
|
|
19
|
+
import { t as x } from "./tags-input-_cYR2JSK.js";
|
|
20
|
+
import { keyedProps as S, withSelectorKey as C } from "@slotted/core/selector-key";
|
|
21
|
+
import { createFocusOrigin as w } from "@slotted/core/focus";
|
|
22
|
+
import { createControllable as le } from "@slotted/core/state";
|
|
23
|
+
import { createContext as T, useCallback as E, useContext as D, useEffect as O, useId as ue, useImperativeHandle as de, useMemo as k, useRef as fe, useState as A } from "react";
|
|
24
|
+
import { Fragment as j, jsx as M, jsxs as N } from "react/jsx-runtime";
|
|
25
|
+
import { createScrollAffordance as pe } from "@slotted/core/overflow";
|
|
26
|
+
import { tableMessages as me } from "@slotted/core/i18n";
|
|
27
|
+
import { createFilter as P, nextSelection as he } from "@slotted/core/collection";
|
|
28
|
+
import { isRowAction as ge } from "@slotted/core/pointer-intent";
|
|
29
29
|
import { getLiveAnnouncer as _e } from "@slotted/core/live-announcer";
|
|
30
|
-
import { isPlainDate as F, isPlainDateTime as I, isPlainTime as ve, parseISODate as
|
|
31
|
-
import { defaultOperator as
|
|
30
|
+
import { isPlainDate as F, isPlainDateTime as I, isPlainTime as ve, parseISODate as ye, parseISODateTime as L, parseISOTime as be, toISODate as R, toISOTime as z } from "@slotted/core/date";
|
|
31
|
+
import { defaultOperator as xe, describeFilter as Se, emptyFilter as Ce, isConditionActive as B, isFilterActive as we, normalizeFilter as Te, operandCount as V, operatorsFor as Ee, serializeFilter as H, withCondition as De, withJoin as Oe } from "@slotted/core/filter";
|
|
32
32
|
//#region src/table/table-defaults.tsx
|
|
33
|
-
var U =
|
|
33
|
+
var U = T({});
|
|
34
34
|
function W() {
|
|
35
|
-
return
|
|
35
|
+
return D(U);
|
|
36
36
|
}
|
|
37
37
|
function ke({ children: e, ...t }) {
|
|
38
38
|
let n = W();
|
|
39
|
-
return /* @__PURE__ */
|
|
39
|
+
return /* @__PURE__ */ M(U.Provider, {
|
|
40
40
|
value: {
|
|
41
41
|
cellAlign: t.cellAlign ?? n.cellAlign,
|
|
42
42
|
columns: t.columns ?? n.columns,
|
|
@@ -54,123 +54,123 @@ function ke({ children: e, ...t }) {
|
|
|
54
54
|
}
|
|
55
55
|
//#endregion
|
|
56
56
|
//#region src/table/table.tsx
|
|
57
|
-
var Ae = "[data-part=\"body\"] > [data-part=\"row\"][data-value]", G =
|
|
57
|
+
var Ae = "[data-part=\"body\"] > [data-part=\"row\"][data-value]", G = T(void 0);
|
|
58
58
|
function K() {
|
|
59
|
-
let e =
|
|
59
|
+
let e = D(G);
|
|
60
60
|
if (e === void 0) throw Error("Every Table part must be rendered inside Table.");
|
|
61
61
|
return e;
|
|
62
62
|
}
|
|
63
63
|
function je() {
|
|
64
|
-
return
|
|
64
|
+
return D(G);
|
|
65
65
|
}
|
|
66
66
|
function Me({ children: t, columns: n, defaultExpanded: r, defaultSort: i, defaultValue: a, edges: o, expanded: s, layout: c, loading: l, messages: u, onExpandedChange: d, onSortChange: f, onValueChange: p, ref: m, render: h, selectionMode: g, sort: _, cellAlign: ee, stickyFooter: te, stickyHeader: ne, stickyTo: re, striped: ie, value: ae, variant: oe, ...se }) {
|
|
67
|
-
let v = W(), y = e(
|
|
68
|
-
|
|
69
|
-
}, [m]),
|
|
70
|
-
function
|
|
71
|
-
|
|
67
|
+
let v = W(), y = e(me, u), ce = ue(), [b, x] = A(i ?? null), [C, w] = A(a ?? []), [T, D] = A(r ?? []), O = fe(null), de = fe(void 0), k = _ === void 0 ? b : _, j = ae ?? C, N = s ?? T, pe = n ?? v.columns ?? 1, P = o ?? v.edges ?? "inset", ge = c ?? v.layout ?? "auto", F = g ?? v.selectionMode ?? "none", I = (ne ?? v.stickyHeader ?? !1) === !0, ve = (te ?? v.stickyFooter ?? !1) === !0, ye = ee ?? v.cellAlign ?? "center", L = re ?? v.stickyTo ?? "scroll", be = (ie ?? v.striped ?? !1) === !0, R = oe ?? v.variant ?? "ruled", z = E((e) => {
|
|
68
|
+
O.current = e, typeof m == "function" ? m(e) : m != null && (m.current = e);
|
|
69
|
+
}, [m]), xe = E(() => [...O.current?.querySelectorAll("[data-part=\"body\"] > [data-part=\"row\"][data-value]") ?? []].filter((e) => !e.hasAttribute("data-disabled")).map((e) => e.getAttribute("data-value") ?? ""), []);
|
|
70
|
+
function Se(e, t, n) {
|
|
71
|
+
le({
|
|
72
72
|
controlled: ae,
|
|
73
|
-
initial:
|
|
73
|
+
initial: j,
|
|
74
74
|
equals: (e, t) => e.length === t.length && e.every((e, n) => e === t[n]),
|
|
75
75
|
onRequest: (e) => p?.(e.value, e)
|
|
76
|
-
}).request(e, t, n) &&
|
|
76
|
+
}).request(e, t, n) && w(e);
|
|
77
77
|
}
|
|
78
|
-
let
|
|
79
|
-
columns:
|
|
80
|
-
expanded:
|
|
78
|
+
let Ce = {
|
|
79
|
+
columns: pe,
|
|
80
|
+
expanded: N,
|
|
81
81
|
id: ce,
|
|
82
|
-
isExpanded: (e) =>
|
|
83
|
-
isSelected: (e) =>
|
|
82
|
+
isExpanded: (e) => N.includes(e),
|
|
83
|
+
isSelected: (e) => j.includes(e),
|
|
84
84
|
loading: l === !0,
|
|
85
|
-
rows:
|
|
85
|
+
rows: xe,
|
|
86
86
|
requestSort(e, t) {
|
|
87
|
-
let n =
|
|
87
|
+
let n = k?.column === e ? k.direction === "ascending" ? {
|
|
88
88
|
column: e,
|
|
89
89
|
direction: "descending"
|
|
90
90
|
} : null : {
|
|
91
91
|
column: e,
|
|
92
92
|
direction: "ascending"
|
|
93
|
-
}, r =
|
|
93
|
+
}, r = le({
|
|
94
94
|
controlled: _,
|
|
95
|
-
initial:
|
|
95
|
+
initial: k,
|
|
96
96
|
equals: (e, t) => e?.column === t?.column && e?.direction === t?.direction,
|
|
97
97
|
onRequest: (e) => f?.(e.value, e)
|
|
98
98
|
}), i = n === null ? "clear" : "pointer", a = r.request(n, i, t), o = t?.currentTarget?.textContent?.trim() ?? e, s = n === null ? y("sortCleared", { column: o }) : n.direction === "ascending" ? y("sortedAscending", { column: o }) : y("sortedDescending", { column: o });
|
|
99
|
-
_e(
|
|
99
|
+
_e(O.current?.ownerDocument).announce(s), a && x(n);
|
|
100
100
|
},
|
|
101
101
|
selectionMode: F,
|
|
102
|
-
sort:
|
|
103
|
-
stickyTo:
|
|
102
|
+
sort: k,
|
|
103
|
+
stickyTo: L,
|
|
104
104
|
toggleExpanded(e, t) {
|
|
105
|
-
let n =
|
|
106
|
-
|
|
105
|
+
let n = N.includes(e) ? N.filter((t) => t !== e) : [...N, e];
|
|
106
|
+
le({
|
|
107
107
|
controlled: s,
|
|
108
|
-
initial:
|
|
108
|
+
initial: N,
|
|
109
109
|
equals: (e, t) => e.length === t.length && e.every((e, n) => e === t[n]),
|
|
110
110
|
onRequest: (e) => d?.(e.value, e)
|
|
111
|
-
}).request(n, "pointer", t) &&
|
|
111
|
+
}).request(n, "pointer", t) && D(n);
|
|
112
112
|
},
|
|
113
113
|
toggleSelected(e, { range: t, source: n }) {
|
|
114
|
-
let r =
|
|
114
|
+
let r = he({
|
|
115
115
|
action: t && F === "multiple" ? "range" : "toggle",
|
|
116
|
-
anchor:
|
|
116
|
+
anchor: de.current,
|
|
117
117
|
behavior: "toggle",
|
|
118
118
|
key: e,
|
|
119
|
-
keys:
|
|
119
|
+
keys: xe(),
|
|
120
120
|
mode: F,
|
|
121
|
-
selected:
|
|
121
|
+
selected: j
|
|
122
122
|
});
|
|
123
|
-
t || (
|
|
123
|
+
t || (de.current = e), Se(r.selected, t ? "select" : "pointer", n);
|
|
124
124
|
},
|
|
125
125
|
toggleSelectAll(e) {
|
|
126
|
-
let t =
|
|
126
|
+
let t = he({
|
|
127
127
|
action: "all",
|
|
128
|
-
keys:
|
|
128
|
+
keys: xe(),
|
|
129
129
|
mode: F,
|
|
130
|
-
selected:
|
|
130
|
+
selected: j
|
|
131
131
|
});
|
|
132
|
-
|
|
132
|
+
Se(t.selected, t.selected.length === 0 ? "clear" : "select", e);
|
|
133
133
|
},
|
|
134
134
|
t: y,
|
|
135
|
-
value:
|
|
136
|
-
},
|
|
135
|
+
value: j
|
|
136
|
+
}, B = S({
|
|
137
137
|
...se,
|
|
138
138
|
children: t,
|
|
139
|
-
"data-cell-align":
|
|
140
|
-
"data-edges":
|
|
141
|
-
"data-layout":
|
|
139
|
+
"data-cell-align": ye,
|
|
140
|
+
"data-edges": P,
|
|
141
|
+
"data-layout": ge,
|
|
142
142
|
...l === !0 ? { "data-loading": "" } : {},
|
|
143
143
|
"data-part": "root",
|
|
144
144
|
...I ? { "data-sticky-header": "" } : {},
|
|
145
145
|
...ve ? { "data-sticky-footer": "" } : {},
|
|
146
|
-
"data-sticky-to":
|
|
147
|
-
...
|
|
146
|
+
"data-sticky-to": L,
|
|
147
|
+
...be ? { "data-striped": "" } : {},
|
|
148
148
|
"data-ui": "table",
|
|
149
|
-
"data-variant":
|
|
150
|
-
ref:
|
|
149
|
+
"data-variant": R,
|
|
150
|
+
ref: z
|
|
151
151
|
});
|
|
152
|
-
return /* @__PURE__ */
|
|
153
|
-
value:
|
|
154
|
-
children: h === void 0 ? /* @__PURE__ */
|
|
152
|
+
return /* @__PURE__ */ M(G.Provider, {
|
|
153
|
+
value: Ce,
|
|
154
|
+
children: h === void 0 ? /* @__PURE__ */ M("div", { ...B }) : h(B)
|
|
155
155
|
});
|
|
156
156
|
}
|
|
157
157
|
//#endregion
|
|
158
158
|
//#region src/table/table-content.tsx
|
|
159
159
|
function Ne({ children: e, handleRef: t, ref: n, scrollLabelledBy: r, scrollProps: i, totalRowCount: a, ...o }) {
|
|
160
|
-
let s = K(), [c, l] =
|
|
160
|
+
let s = K(), [c, l] = A(null), [u, d] = A({
|
|
161
161
|
overflowing: !1,
|
|
162
162
|
atStart: !0,
|
|
163
163
|
atEnd: !0
|
|
164
|
-
}), f =
|
|
164
|
+
}), f = fe(null), { ref: p, ...m } = i ?? {}, h = E((e) => {
|
|
165
165
|
l(e), typeof p == "function" ? p(e) : p != null && (p.current = e);
|
|
166
166
|
}, [p]);
|
|
167
|
-
|
|
167
|
+
O(() => {
|
|
168
168
|
if (c === null || s.stickyTo === "page") return;
|
|
169
|
-
let e =
|
|
169
|
+
let e = pe(c, { onChange: d });
|
|
170
170
|
return f.current = e, d(e.state()), () => {
|
|
171
171
|
e.destroy(), f.current = null;
|
|
172
172
|
};
|
|
173
|
-
}, [c, s.stickyTo]),
|
|
173
|
+
}, [c, s.stickyTo]), O(() => c === null ? void 0 : w(c).destroy, [c]), de(t, () => ({
|
|
174
174
|
overflowing: () => f.current?.state().overflowing ?? !1,
|
|
175
175
|
refresh: () => f.current?.refresh(),
|
|
176
176
|
scrollToRow: (e) => {
|
|
@@ -178,17 +178,17 @@ function Ne({ children: e, handleRef: t, ref: n, scrollLabelledBy: r, scrollProp
|
|
|
178
178
|
t != null && f.current?.reveal(t);
|
|
179
179
|
}
|
|
180
180
|
}), [c]);
|
|
181
|
-
let g =
|
|
181
|
+
let g = S({
|
|
182
182
|
...m,
|
|
183
183
|
"data-part": "scroll",
|
|
184
184
|
ref: h
|
|
185
185
|
});
|
|
186
|
-
return u.overflowing && (g["data-overflowing"] = "", u.atStart && (g["data-at-start"] = ""), u.atEnd && (g["data-at-end"] = ""), g.role = m.role ?? "region", g.tabIndex = m.tabIndex ?? 0, r === void 0 ? m["aria-label"] === void 0 && (g["aria-label"] = s.t("scroll")) : g["aria-labelledby"] = r), /* @__PURE__ */
|
|
186
|
+
return u.overflowing && (g["data-overflowing"] = "", u.atStart && (g["data-at-start"] = ""), u.atEnd && (g["data-at-end"] = ""), g.role = m.role ?? "region", g.tabIndex = m.tabIndex ?? 0, r === void 0 ? m["aria-label"] === void 0 && (g["aria-label"] = s.t("scroll")) : g["aria-labelledby"] = r), /* @__PURE__ */ M("div", {
|
|
187
187
|
...g,
|
|
188
|
-
children: /* @__PURE__ */
|
|
188
|
+
children: /* @__PURE__ */ M("table", {
|
|
189
189
|
...o,
|
|
190
190
|
...a === void 0 ? {} : { "aria-rowcount": a },
|
|
191
|
-
...
|
|
191
|
+
...C(s.loading ? { "aria-busy": !0 } : {}, "part", "table"),
|
|
192
192
|
ref: n,
|
|
193
193
|
children: e
|
|
194
194
|
})
|
|
@@ -196,12 +196,12 @@ function Ne({ children: e, handleRef: t, ref: n, scrollLabelledBy: r, scrollProp
|
|
|
196
196
|
}
|
|
197
197
|
//#endregion
|
|
198
198
|
//#region src/table/table-parts.tsx
|
|
199
|
-
var Pe =
|
|
199
|
+
var Pe = T(void 0), Fe = T(void 0);
|
|
200
200
|
function Ie() {
|
|
201
|
-
return
|
|
201
|
+
return D(Fe);
|
|
202
202
|
}
|
|
203
203
|
function q() {
|
|
204
|
-
let e =
|
|
204
|
+
let e = D(Pe);
|
|
205
205
|
if (e === void 0) throw Error("TableSelect, TableExpander and TableRowHeader belong inside TableRow.");
|
|
206
206
|
return e;
|
|
207
207
|
}
|
|
@@ -219,76 +219,77 @@ function J({ align: e, blockAlign: t, numeric: n, sticky: r, stickyOffset: i, te
|
|
|
219
219
|
};
|
|
220
220
|
}
|
|
221
221
|
function Le({ ref: e, ...t }) {
|
|
222
|
-
return /* @__PURE__ */
|
|
223
|
-
...
|
|
222
|
+
return /* @__PURE__ */ M("caption", {
|
|
223
|
+
...C(t, "part", "caption"),
|
|
224
224
|
ref: e
|
|
225
225
|
});
|
|
226
226
|
}
|
|
227
227
|
function Re({ ref: e, ...t }) {
|
|
228
|
-
return /* @__PURE__ */
|
|
229
|
-
...
|
|
228
|
+
return /* @__PURE__ */ M("thead", {
|
|
229
|
+
...C(t, "part", "head"),
|
|
230
230
|
ref: e
|
|
231
231
|
});
|
|
232
232
|
}
|
|
233
233
|
function ze({ ref: e, ...t }) {
|
|
234
|
-
return /* @__PURE__ */
|
|
235
|
-
...
|
|
234
|
+
return /* @__PURE__ */ M("tbody", {
|
|
235
|
+
...C(t, "part", "body"),
|
|
236
236
|
ref: e
|
|
237
237
|
});
|
|
238
238
|
}
|
|
239
239
|
function Be({ ref: e, ...t }) {
|
|
240
|
-
return /* @__PURE__ */
|
|
241
|
-
...
|
|
240
|
+
return /* @__PURE__ */ M("tfoot", {
|
|
241
|
+
...C(t, "part", "summary"),
|
|
242
242
|
ref: e
|
|
243
243
|
});
|
|
244
244
|
}
|
|
245
245
|
function Ve({ ref: e, ...t }) {
|
|
246
|
-
return /* @__PURE__ */
|
|
247
|
-
...
|
|
246
|
+
return /* @__PURE__ */ M("div", {
|
|
247
|
+
...C(t, "part", "footer"),
|
|
248
248
|
ref: e
|
|
249
249
|
});
|
|
250
250
|
}
|
|
251
|
-
function He({ children: e, current: t, disabled: n, interactive: r,
|
|
252
|
-
let
|
|
253
|
-
|
|
254
|
-
},
|
|
255
|
-
...
|
|
251
|
+
function He({ children: e, current: t, disabled: n, interactive: r, muted: i, onAction: a, onClick: o, ref: s, render: c, rowIndex: l, value: u, ...d }) {
|
|
252
|
+
let f = K(), p = u !== void 0 && f.isSelected(u), m = u !== void 0 && f.isExpanded(u), h = r ?? a !== void 0, g = a === void 0 ? o : (e) => {
|
|
253
|
+
o?.(e), !(e.defaultPrevented || n === !0) && ge(e.currentTarget, e.target) && a(e);
|
|
254
|
+
}, _ = S({
|
|
255
|
+
...d,
|
|
256
256
|
children: e,
|
|
257
257
|
...t === !0 ? {
|
|
258
258
|
"aria-current": "true",
|
|
259
259
|
"data-current": ""
|
|
260
260
|
} : {},
|
|
261
261
|
...n === !0 ? { "data-disabled": "" } : {},
|
|
262
|
-
...
|
|
263
|
-
...
|
|
264
|
-
...
|
|
262
|
+
...m ? { "data-expanded": "" } : {},
|
|
263
|
+
...h ? { "data-interactive": "" } : {},
|
|
264
|
+
...i === !0 ? { "data-muted": "" } : {},
|
|
265
|
+
...g === void 0 ? {} : { onClick: g },
|
|
265
266
|
"data-part": "row",
|
|
266
|
-
...
|
|
267
|
-
...
|
|
268
|
-
...
|
|
269
|
-
}),
|
|
270
|
-
detailId: `${
|
|
267
|
+
...p ? { "data-selected": "" } : {},
|
|
268
|
+
...u === void 0 ? {} : { "data-value": u },
|
|
269
|
+
...l === void 0 ? {} : { "aria-rowindex": l }
|
|
270
|
+
}), ee = {
|
|
271
|
+
detailId: `${f.id}detail${u ?? ""}`,
|
|
271
272
|
disabled: n === !0,
|
|
272
|
-
expanded:
|
|
273
|
-
selected:
|
|
274
|
-
value:
|
|
273
|
+
expanded: m,
|
|
274
|
+
selected: p,
|
|
275
|
+
value: u
|
|
275
276
|
};
|
|
276
|
-
return /* @__PURE__ */
|
|
277
|
-
value:
|
|
278
|
-
children:
|
|
279
|
-
...
|
|
280
|
-
ref:
|
|
281
|
-
}) :
|
|
277
|
+
return /* @__PURE__ */ M(Pe.Provider, {
|
|
278
|
+
value: ee,
|
|
279
|
+
children: c === void 0 ? /* @__PURE__ */ M("tr", {
|
|
280
|
+
..._,
|
|
281
|
+
ref: s
|
|
282
|
+
}) : c(_)
|
|
282
283
|
});
|
|
283
284
|
}
|
|
284
285
|
function Ue(e, ...t) {
|
|
285
286
|
for (let n of t) typeof n == "function" ? n(e) : n != null && (n.current = e);
|
|
286
287
|
}
|
|
287
288
|
function We({ header: e }) {
|
|
288
|
-
return /* @__PURE__ */ j
|
|
289
|
+
return /* @__PURE__ */ M(j, { children: (e.current?.textContent ?? "").trim() });
|
|
289
290
|
}
|
|
290
291
|
function Ge({ align: e, blockAlign: t, children: n, column: r, numeric: c, ref: l, scope: u, sticky: d, stickyOffset: f, style: p, text: m, ...h }) {
|
|
291
|
-
let g = K(), _ =
|
|
292
|
+
let g = K(), _ = fe(null), ee = r !== void 0 && g.sort?.column === r, te = S({
|
|
292
293
|
...h,
|
|
293
294
|
...J({
|
|
294
295
|
align: e,
|
|
@@ -303,27 +304,27 @@ function Ge({ align: e, blockAlign: t, children: n, column: r, numeric: c, ref:
|
|
|
303
304
|
"data-part": "column-header",
|
|
304
305
|
scope: u ?? "col"
|
|
305
306
|
});
|
|
306
|
-
return /* @__PURE__ */
|
|
307
|
+
return /* @__PURE__ */ M(Fe.Provider, {
|
|
307
308
|
value: r,
|
|
308
|
-
children: /* @__PURE__ */
|
|
309
|
+
children: /* @__PURE__ */ N(i, {
|
|
309
310
|
describes: "none",
|
|
310
311
|
openOn: "hover",
|
|
311
312
|
side: "bottom",
|
|
312
313
|
whenClipped: !0,
|
|
313
|
-
children: [/* @__PURE__ */
|
|
314
|
+
children: [/* @__PURE__ */ M(a, {
|
|
314
315
|
...te,
|
|
315
|
-
render: (e) => /* @__PURE__ */
|
|
316
|
+
render: (e) => /* @__PURE__ */ M("th", {
|
|
316
317
|
...e,
|
|
317
318
|
ref: (t) => {
|
|
318
319
|
e.ref?.(t), _.current = t, Ue(t, l);
|
|
319
320
|
}
|
|
320
321
|
})
|
|
321
|
-
}), /* @__PURE__ */
|
|
322
|
+
}), /* @__PURE__ */ M(s, { children: /* @__PURE__ */ M(o, { children: /* @__PURE__ */ M(We, { header: _ }) }) })]
|
|
322
323
|
})
|
|
323
324
|
});
|
|
324
325
|
}
|
|
325
326
|
function Ke({ align: e, blockAlign: t, numeric: n, ref: r, scope: i, sticky: a, stickyOffset: o, style: s, text: c, ...l }) {
|
|
326
|
-
return /* @__PURE__ */
|
|
327
|
+
return /* @__PURE__ */ M("th", {
|
|
327
328
|
...l,
|
|
328
329
|
...J({
|
|
329
330
|
align: e,
|
|
@@ -340,7 +341,7 @@ function Ke({ align: e, blockAlign: t, numeric: n, ref: r, scope: i, sticky: a,
|
|
|
340
341
|
});
|
|
341
342
|
}
|
|
342
343
|
function qe({ align: e, blockAlign: t, numeric: n, ref: r, sticky: i, stickyOffset: a, style: o, text: s, ...c }) {
|
|
343
|
-
return /* @__PURE__ */
|
|
344
|
+
return /* @__PURE__ */ M("td", {
|
|
344
345
|
...c,
|
|
345
346
|
...J({
|
|
346
347
|
align: e,
|
|
@@ -356,31 +357,31 @@ function qe({ align: e, blockAlign: t, numeric: n, ref: r, sticky: i, stickyOffs
|
|
|
356
357
|
});
|
|
357
358
|
}
|
|
358
359
|
function Je({ children: e, column: r, onClick: i, ref: a, render: o, ...s }) {
|
|
359
|
-
let c = K(), l =
|
|
360
|
+
let c = K(), l = D(Fe), u = r ?? l;
|
|
360
361
|
function d(e) {
|
|
361
362
|
i?.(e), !(e.defaultPrevented || u === void 0) && c.requestSort(u, e);
|
|
362
363
|
}
|
|
363
|
-
let f =
|
|
364
|
+
let f = S({
|
|
364
365
|
...s,
|
|
365
|
-
children: /* @__PURE__ */
|
|
366
|
+
children: /* @__PURE__ */ N(j, { children: [e, /* @__PURE__ */ M(n, { children: /* @__PURE__ */ M(t, { name: "chevron-down" }) })] }),
|
|
366
367
|
"data-part": "sort",
|
|
367
368
|
onClick: d,
|
|
368
369
|
type: "button"
|
|
369
370
|
});
|
|
370
|
-
return o === void 0 ? /* @__PURE__ */
|
|
371
|
+
return o === void 0 ? /* @__PURE__ */ M("button", {
|
|
371
372
|
...f,
|
|
372
373
|
ref: a
|
|
373
374
|
}) : o(f);
|
|
374
375
|
}
|
|
375
376
|
function Ye({ ref: e, ...t }) {
|
|
376
|
-
return /* @__PURE__ */
|
|
377
|
-
...
|
|
377
|
+
return /* @__PURE__ */ M("span", {
|
|
378
|
+
...C(t, "part", "column-actions"),
|
|
378
379
|
ref: e
|
|
379
380
|
});
|
|
380
381
|
}
|
|
381
382
|
function Xe({ align: e, blockAlign: t, numeric: n, ref: r, sticky: i, stickyOffset: a, style: o, text: s, value: l, ...u }) {
|
|
382
383
|
let d = K(), f = q(), p = l ?? f.value;
|
|
383
|
-
return /* @__PURE__ */
|
|
384
|
+
return /* @__PURE__ */ M("td", {
|
|
384
385
|
...u,
|
|
385
386
|
...J({
|
|
386
387
|
align: e,
|
|
@@ -393,7 +394,7 @@ function Xe({ align: e, blockAlign: t, numeric: n, ref: r, sticky: i, stickyOffs
|
|
|
393
394
|
"data-part": "selection",
|
|
394
395
|
"data-part-selection": "",
|
|
395
396
|
ref: r,
|
|
396
|
-
children: /* @__PURE__ */
|
|
397
|
+
children: /* @__PURE__ */ M(c, {
|
|
397
398
|
checked: p !== void 0 && d.isSelected(p),
|
|
398
399
|
disabled: f.disabled,
|
|
399
400
|
onCheckedChange: (e, t) => {
|
|
@@ -404,13 +405,13 @@ function Xe({ align: e, blockAlign: t, numeric: n, ref: r, sticky: i, stickyOffs
|
|
|
404
405
|
source: t.source
|
|
405
406
|
});
|
|
406
407
|
},
|
|
407
|
-
children: /* @__PURE__ */
|
|
408
|
+
children: /* @__PURE__ */ M(h, { children: d.t("selectRow", { row: p ?? "" }).trim() })
|
|
408
409
|
})
|
|
409
410
|
});
|
|
410
411
|
}
|
|
411
412
|
function Ze({ align: e, blockAlign: t, numeric: n, ref: r, sticky: i, stickyOffset: a, style: o, text: s, ...l }) {
|
|
412
413
|
let u = K(), d = u.value.length;
|
|
413
|
-
return /* @__PURE__ */
|
|
414
|
+
return /* @__PURE__ */ M("th", {
|
|
414
415
|
...l,
|
|
415
416
|
...J({
|
|
416
417
|
align: e,
|
|
@@ -424,11 +425,11 @@ function Ze({ align: e, blockAlign: t, numeric: n, ref: r, sticky: i, stickyOffs
|
|
|
424
425
|
"data-part-selection": "",
|
|
425
426
|
ref: r,
|
|
426
427
|
scope: "col",
|
|
427
|
-
children: /* @__PURE__ */
|
|
428
|
+
children: /* @__PURE__ */ M(c, {
|
|
428
429
|
checked: d > 0 && d === u.rows().length,
|
|
429
430
|
indeterminate: d > 0 && d < u.rows().length,
|
|
430
431
|
onCheckedChange: (e, t) => u.toggleSelectAll(t.source),
|
|
431
|
-
children: /* @__PURE__ */
|
|
432
|
+
children: /* @__PURE__ */ M(h, { children: u.t("selectAll", { count: d }) })
|
|
432
433
|
})
|
|
433
434
|
});
|
|
434
435
|
}
|
|
@@ -437,12 +438,12 @@ function Qe({ onClick: e, ref: r, value: i, ...a }) {
|
|
|
437
438
|
function u(t) {
|
|
438
439
|
e?.(t), !(t.defaultPrevented || c === void 0) && o.toggleExpanded(c, t);
|
|
439
440
|
}
|
|
440
|
-
return /* @__PURE__ */
|
|
441
|
+
return /* @__PURE__ */ M("button", {
|
|
441
442
|
...a,
|
|
442
443
|
"aria-controls": l ? s.detailId : void 0,
|
|
443
444
|
"aria-expanded": l,
|
|
444
445
|
"aria-label": a["aria-label"] ?? (l ? o.t("collapse") : o.t("expand")),
|
|
445
|
-
children: a.children ?? /* @__PURE__ */
|
|
446
|
+
children: a.children ?? /* @__PURE__ */ M(n, { children: /* @__PURE__ */ M(t, { name: "chevron-right" }) }),
|
|
446
447
|
"data-part": "expander",
|
|
447
448
|
"data-part-expander": "",
|
|
448
449
|
onClick: u,
|
|
@@ -452,11 +453,11 @@ function Qe({ onClick: e, ref: r, value: i, ...a }) {
|
|
|
452
453
|
}
|
|
453
454
|
function $e({ children: e, colSpan: t, ref: n, value: r, ...i }) {
|
|
454
455
|
let a = K();
|
|
455
|
-
return a.isExpanded(r) ? /* @__PURE__ */
|
|
456
|
-
...
|
|
456
|
+
return a.isExpanded(r) ? /* @__PURE__ */ M("tr", {
|
|
457
|
+
...C(i, "part", "detail"),
|
|
457
458
|
id: `${a.id}detail${r}`,
|
|
458
459
|
ref: n,
|
|
459
|
-
children: /* @__PURE__ */
|
|
460
|
+
children: /* @__PURE__ */ M("td", {
|
|
460
461
|
colSpan: t ?? a.columns,
|
|
461
462
|
"data-part": "cell",
|
|
462
463
|
"data-part-cell": "",
|
|
@@ -466,23 +467,23 @@ function $e({ children: e, colSpan: t, ref: n, value: r, ...i }) {
|
|
|
466
467
|
}
|
|
467
468
|
function et({ children: e, colSpan: t, end: n, ref: r, sticky: i, ...a }) {
|
|
468
469
|
let o = K();
|
|
469
|
-
return /* @__PURE__ */
|
|
470
|
-
...
|
|
470
|
+
return /* @__PURE__ */ M("tr", {
|
|
471
|
+
...C(a, "part", "group-row"),
|
|
471
472
|
...i === !0 ? { "data-sticky": "" } : {},
|
|
472
473
|
ref: r,
|
|
473
|
-
children: /* @__PURE__ */
|
|
474
|
+
children: /* @__PURE__ */ M("th", {
|
|
474
475
|
colSpan: t ?? o.columns,
|
|
475
476
|
"data-part": "group-header",
|
|
476
477
|
"data-part-group-header": "",
|
|
477
478
|
scope: "rowgroup",
|
|
478
|
-
children: /* @__PURE__ */
|
|
479
|
+
children: /* @__PURE__ */ N("div", {
|
|
479
480
|
"data-part": "group-content",
|
|
480
481
|
"data-part-group-content": "",
|
|
481
|
-
children: [/* @__PURE__ */
|
|
482
|
+
children: [/* @__PURE__ */ M("span", {
|
|
482
483
|
"data-part": "group-start",
|
|
483
484
|
"data-part-group-start": "",
|
|
484
485
|
children: e
|
|
485
|
-
}), n == null ? null : /* @__PURE__ */
|
|
486
|
+
}), n == null ? null : /* @__PURE__ */ M("span", {
|
|
486
487
|
"data-part": "group-end",
|
|
487
488
|
"data-part-group-end": "",
|
|
488
489
|
children: n
|
|
@@ -493,25 +494,25 @@ function et({ children: e, colSpan: t, end: n, ref: r, sticky: i, ...a }) {
|
|
|
493
494
|
}
|
|
494
495
|
function tt({ colSpan: e, ref: t, ...n }) {
|
|
495
496
|
let r = K();
|
|
496
|
-
return /* @__PURE__ */
|
|
497
|
-
...
|
|
497
|
+
return /* @__PURE__ */ M("tr", { children: /* @__PURE__ */ M("td", {
|
|
498
|
+
...C(n, "part", "empty"),
|
|
498
499
|
colSpan: e ?? r.columns,
|
|
499
500
|
ref: t
|
|
500
501
|
}) });
|
|
501
502
|
}
|
|
502
503
|
function nt({ children: e, ref: t, skeletonRows: n, ...r }) {
|
|
503
504
|
let i = K();
|
|
504
|
-
return /* @__PURE__ */
|
|
505
|
-
...
|
|
505
|
+
return /* @__PURE__ */ M("tbody", {
|
|
506
|
+
...C(r, "part", "loader"),
|
|
506
507
|
"aria-hidden": !0,
|
|
507
508
|
ref: t,
|
|
508
|
-
children: e ?? Array.from({ length: n ?? 5 }, (e, t) => /* @__PURE__ */
|
|
509
|
+
children: e ?? Array.from({ length: n ?? 5 }, (e, t) => /* @__PURE__ */ M("tr", {
|
|
509
510
|
"data-part": "row",
|
|
510
511
|
"data-part-row": "",
|
|
511
|
-
children: Array.from({ length: i.columns }, (e, t) => /* @__PURE__ */
|
|
512
|
+
children: Array.from({ length: i.columns }, (e, t) => /* @__PURE__ */ M("td", {
|
|
512
513
|
"data-part": "cell",
|
|
513
514
|
"data-part-cell": "",
|
|
514
|
-
children: /* @__PURE__ */
|
|
515
|
+
children: /* @__PURE__ */ M(l, {
|
|
515
516
|
inlineSize: "100%",
|
|
516
517
|
loading: !0
|
|
517
518
|
})
|
|
@@ -522,7 +523,7 @@ function nt({ children: e, ref: t, skeletonRows: n, ...r }) {
|
|
|
522
523
|
//#endregion
|
|
523
524
|
//#region src/table/table-filter.tsx
|
|
524
525
|
function rt() {
|
|
525
|
-
return /* @__PURE__ */
|
|
526
|
+
return /* @__PURE__ */ M("svg", {
|
|
526
527
|
"aria-hidden": "true",
|
|
527
528
|
fill: "none",
|
|
528
529
|
stroke: "currentColor",
|
|
@@ -530,93 +531,93 @@ function rt() {
|
|
|
530
531
|
strokeLinejoin: "round",
|
|
531
532
|
strokeWidth: "2",
|
|
532
533
|
viewBox: "0 0 24 24",
|
|
533
|
-
children: /* @__PURE__ */
|
|
534
|
+
children: /* @__PURE__ */ M("path", { d: "M22 3H2l8 9.46V19l4 2v-8.54L22 3z" })
|
|
534
535
|
});
|
|
535
536
|
}
|
|
536
537
|
function it(e, t) {
|
|
537
|
-
return
|
|
538
|
+
return H(e) === H(t);
|
|
538
539
|
}
|
|
539
540
|
function Y({ body: e, kind: t, operandName: n, operators: i, props: a, rangeOperand: o, singleCondition: s }) {
|
|
540
|
-
let { align: c, collisionPadding: l, columnLabel: u, conditions: h = 2, defaultOpen: g, defaultOperator: _, defaultValue: ee, label: te, mount: ne, onOpenChange: v, onValueChange: y, open:
|
|
541
|
+
let { align: c, collisionPadding: l, columnLabel: u, conditions: h = 2, defaultOpen: g, defaultOperator: _, defaultValue: ee, label: te, mount: ne, onOpenChange: v, onValueChange: y, open: x, portal: S, renderOperand: w, side: T, sideOffset: E, value: D } = a, O = K(), de = Ie(), k = ue(), [pe, me] = A(ee ?? null), P = D === void 0 ? pe : D, he = _ ?? xe(t), ge = () => Ce(t, he), [F, I] = A(P ?? ge()), [ve, ye] = A(!1), L = x ?? ve, be = fe(null), R = O.t, z = u ?? de ?? "", Ee = we(P), H = s ? 1 : h;
|
|
541
542
|
function U(e) {
|
|
542
|
-
_e(
|
|
543
|
+
_e(be.current?.ownerDocument).announce(e);
|
|
543
544
|
}
|
|
544
545
|
let W = {
|
|
545
|
-
join: (e) =>
|
|
546
|
-
operator: (e) =>
|
|
546
|
+
join: (e) => R(`filterJoins.${e}`),
|
|
547
|
+
operator: (e) => R(`filterOperators.${e}`)
|
|
547
548
|
};
|
|
548
549
|
function ke(e, t, n) {
|
|
549
|
-
|
|
550
|
-
controlled:
|
|
551
|
-
initial:
|
|
550
|
+
le({
|
|
551
|
+
controlled: D,
|
|
552
|
+
initial: P,
|
|
552
553
|
equals: it,
|
|
553
554
|
onRequest: (e) => y?.(e.value, e)
|
|
554
|
-
}).request(e, t, n) &&
|
|
555
|
+
}).request(e, t, n) && me(e);
|
|
555
556
|
}
|
|
556
557
|
function Ae(e, t) {
|
|
557
|
-
|
|
558
|
+
x === void 0 && ye(e), v?.(e, t), I(P ?? ge());
|
|
558
559
|
}
|
|
559
|
-
let G = (e) => F.conditions[e] ?? { operator:
|
|
560
|
+
let G = (e) => F.conditions[e] ?? { operator: he }, je = G(0), Me = H === 2 && B(t, je);
|
|
560
561
|
function Ne(e, t) {
|
|
561
|
-
let n = G(e), r =
|
|
562
|
+
let n = G(e), r = V(n.operator), i = V(t), a = {
|
|
562
563
|
operator: t,
|
|
563
564
|
...i >= 1 && r >= 1 ? { value: n.value } : {},
|
|
564
565
|
...i === 2 && r === 2 ? { end: n.end } : {}
|
|
565
566
|
};
|
|
566
|
-
I(De(F, e, a)), i !== r && U(
|
|
567
|
+
I(De(F, e, a)), i !== r && U(R("filterOperands", {
|
|
567
568
|
operator: W.operator(t),
|
|
568
569
|
count: i
|
|
569
570
|
}));
|
|
570
571
|
}
|
|
571
572
|
function Pe(e, n, r) {
|
|
572
|
-
let i = G(e), a =
|
|
573
|
+
let i = G(e), a = B(t, i), o = n === 0 ? {
|
|
573
574
|
...i,
|
|
574
575
|
value: r
|
|
575
576
|
} : {
|
|
576
577
|
...i,
|
|
577
578
|
end: r
|
|
578
579
|
};
|
|
579
|
-
I(De(F, e, o)), e === 0 &&
|
|
580
|
+
I(De(F, e, o)), e === 0 && H === 2 && !a && B(t, o) && U(R("filterConditionAdded"));
|
|
580
581
|
}
|
|
581
582
|
function Fe(e, n, r) {
|
|
582
|
-
let i = G(e), a =
|
|
583
|
+
let i = G(e), a = B(t, i), o = {
|
|
583
584
|
...i,
|
|
584
585
|
value: n,
|
|
585
586
|
end: r
|
|
586
587
|
};
|
|
587
|
-
I(De(F, e, o)), e === 0 &&
|
|
588
|
+
I(De(F, e, o)), e === 0 && H === 2 && !a && B(t, o) && U(R("filterConditionAdded"));
|
|
588
589
|
}
|
|
589
590
|
function q(e, t) {
|
|
590
|
-
let n =
|
|
591
|
-
ke(n, t, e), U(n ?
|
|
592
|
-
column:
|
|
593
|
-
filter:
|
|
594
|
-
}) :
|
|
591
|
+
let n = Te(F);
|
|
592
|
+
ke(n, t, e), U(n ? R("filterApplied", {
|
|
593
|
+
column: z,
|
|
594
|
+
filter: Se(n, W)
|
|
595
|
+
}) : R("filterCleared", { column: z })), x === void 0 && ye(!1), v?.(!1, e);
|
|
595
596
|
}
|
|
596
597
|
function J(e) {
|
|
597
|
-
I(
|
|
598
|
+
I(ge()), U(R("filterCleared", { column: z })), ke(null, "clear", e), x === void 0 && ye(!1), v?.(!1, e);
|
|
598
599
|
}
|
|
599
|
-
let Le = te ?? (
|
|
600
|
-
column:
|
|
601
|
-
filter:
|
|
602
|
-
}) :
|
|
600
|
+
let Le = te ?? (Ee ? R("filterApplied", {
|
|
601
|
+
column: z,
|
|
602
|
+
filter: Se(P, W)
|
|
603
|
+
}) : R("filterColumn", { column: z }).trim());
|
|
603
604
|
function Re(r) {
|
|
604
|
-
let a = G(r), s =
|
|
605
|
+
let a = G(r), s = V(a.operator), c = (e) => ({
|
|
605
606
|
apply: () => q(null, "keyboard"),
|
|
606
607
|
index: e,
|
|
607
|
-
label:
|
|
608
|
+
label: R(s === 2 ? e === 0 ? "filterFrom" : "filterTo" : "filterValue"),
|
|
608
609
|
onValueChange: (t) => Pe(r, e, t),
|
|
609
610
|
operator: a.operator,
|
|
610
611
|
value: (e === 0 ? a.value : a.end) ?? null
|
|
611
612
|
});
|
|
612
|
-
return /* @__PURE__ */
|
|
613
|
+
return /* @__PURE__ */ N("div", {
|
|
613
614
|
"data-operands": s,
|
|
614
615
|
"data-part": "filter-condition",
|
|
615
616
|
"data-part-filter-condition": "",
|
|
616
|
-
children: [/* @__PURE__ */
|
|
617
|
+
children: [/* @__PURE__ */ M("div", {
|
|
617
618
|
"data-part": "filter-operator",
|
|
618
619
|
"data-part-filter-operator": "",
|
|
619
|
-
children: /* @__PURE__ */
|
|
620
|
+
children: /* @__PURE__ */ N(re, {
|
|
620
621
|
fullWidth: !0,
|
|
621
622
|
items: i.map((e) => ({
|
|
622
623
|
label: W.operator(e),
|
|
@@ -625,94 +626,94 @@ function Y({ body: e, kind: t, operandName: n, operators: i, props: a, rangeOper
|
|
|
625
626
|
onValueChange: (e) => Ne(r, e),
|
|
626
627
|
size: "sm",
|
|
627
628
|
value: a.operator,
|
|
628
|
-
children: [/* @__PURE__ */
|
|
629
|
-
"aria-label":
|
|
630
|
-
children: /* @__PURE__ */
|
|
631
|
-
}), /* @__PURE__ */
|
|
629
|
+
children: [/* @__PURE__ */ M(oe, {
|
|
630
|
+
"aria-label": R("filterOperator"),
|
|
631
|
+
children: /* @__PURE__ */ M(se, {})
|
|
632
|
+
}), /* @__PURE__ */ M(ie, { children: i.map((e) => /* @__PURE__ */ M(ae, {
|
|
632
633
|
value: e,
|
|
633
634
|
children: W.operator(e)
|
|
634
635
|
}, e)) })]
|
|
635
636
|
})
|
|
636
|
-
}), s === 0 ? null : /* @__PURE__ */
|
|
637
|
+
}), s === 0 ? null : /* @__PURE__ */ M("div", {
|
|
637
638
|
"data-kind": t,
|
|
638
639
|
"data-part": "filter-operand",
|
|
639
640
|
"data-part-filter-operand": "",
|
|
640
|
-
...n === void 0 ||
|
|
641
|
-
...o && s === 2 && !
|
|
642
|
-
children:
|
|
641
|
+
...n === void 0 || w ? {} : { "data-operand": n },
|
|
642
|
+
...o && s === 2 && !w ? { "data-range": "" } : {},
|
|
643
|
+
children: w ? Array.from({ length: s }, (e, t) => w(c(t))) : e({
|
|
643
644
|
announce: U,
|
|
644
645
|
apply: () => q(null, "keyboard"),
|
|
645
646
|
condition: a,
|
|
646
647
|
setOperand: (e, t) => Pe(r, e, t),
|
|
647
648
|
setOperands: (e, t) => Fe(r, e, t),
|
|
648
|
-
t:
|
|
649
|
+
t: R
|
|
649
650
|
})
|
|
650
651
|
})]
|
|
651
652
|
}, r);
|
|
652
653
|
}
|
|
653
|
-
return /* @__PURE__ */
|
|
654
|
+
return /* @__PURE__ */ N(p, {
|
|
654
655
|
onOpenChange: (e, t) => Ae(e, t),
|
|
655
|
-
open:
|
|
656
|
+
open: L,
|
|
656
657
|
...c === void 0 ? {} : { align: c },
|
|
657
658
|
...l === void 0 ? {} : { collisionPadding: l },
|
|
658
659
|
...g === void 0 ? {} : { defaultOpen: g },
|
|
659
660
|
...ne === void 0 ? {} : { mount: ne },
|
|
660
|
-
...
|
|
661
|
-
...
|
|
662
|
-
...
|
|
663
|
-
children: [/* @__PURE__ */
|
|
664
|
-
...
|
|
661
|
+
...S === void 0 ? {} : { portal: S },
|
|
662
|
+
...T === void 0 ? {} : { side: T },
|
|
663
|
+
...E === void 0 ? {} : { sideOffset: E },
|
|
664
|
+
children: [/* @__PURE__ */ M(f, { render: (e) => /* @__PURE__ */ M("button", {
|
|
665
|
+
...C(e, "part", "filter"),
|
|
665
666
|
"aria-label": Le,
|
|
666
|
-
...
|
|
667
|
+
...Ee ? { "data-filtered": "" } : {},
|
|
667
668
|
type: "button",
|
|
668
|
-
children: /* @__PURE__ */
|
|
669
|
-
}) }), /* @__PURE__ */
|
|
669
|
+
children: /* @__PURE__ */ M(rt, {})
|
|
670
|
+
}) }), /* @__PURE__ */ M(m, { children: /* @__PURE__ */ M(d, {
|
|
670
671
|
"aria-label": Le,
|
|
671
|
-
children: /* @__PURE__ */
|
|
672
|
+
children: /* @__PURE__ */ N("div", {
|
|
672
673
|
"data-kind": t,
|
|
673
674
|
"data-part": "filter-panel",
|
|
674
675
|
"data-part-filter-panel": "",
|
|
675
676
|
"data-ui": "table",
|
|
676
677
|
"data-ui-table": "",
|
|
677
|
-
id:
|
|
678
|
-
ref:
|
|
678
|
+
id: k,
|
|
679
|
+
ref: be,
|
|
679
680
|
children: [
|
|
680
681
|
Re(0),
|
|
681
|
-
Me ? /* @__PURE__ */
|
|
682
|
+
Me ? /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ N("div", {
|
|
682
683
|
"data-part": "filter-join",
|
|
683
684
|
"data-part-filter-join": "",
|
|
684
|
-
children: [/* @__PURE__ */
|
|
685
|
+
children: [/* @__PURE__ */ M("span", {
|
|
685
686
|
"data-label": "",
|
|
686
|
-
children:
|
|
687
|
-
}), /* @__PURE__ */
|
|
688
|
-
"aria-label":
|
|
687
|
+
children: R("filterJoin")
|
|
688
|
+
}), /* @__PURE__ */ N(ce, {
|
|
689
|
+
"aria-label": R("filterJoin"),
|
|
689
690
|
onValueChange: (e) => I(Oe(F, e)),
|
|
690
691
|
orientation: "horizontal",
|
|
691
692
|
size: "sm",
|
|
692
693
|
value: F.join,
|
|
693
|
-
children: [/* @__PURE__ */
|
|
694
|
+
children: [/* @__PURE__ */ M(b, {
|
|
694
695
|
value: "and",
|
|
695
696
|
children: W.join("and")
|
|
696
|
-
}), /* @__PURE__ */
|
|
697
|
+
}), /* @__PURE__ */ M(b, {
|
|
697
698
|
value: "or",
|
|
698
699
|
children: W.join("or")
|
|
699
700
|
})]
|
|
700
701
|
})]
|
|
701
702
|
}), Re(1)] }) : null,
|
|
702
|
-
/* @__PURE__ */
|
|
703
|
+
/* @__PURE__ */ N("div", {
|
|
703
704
|
"data-part": "filter-actions",
|
|
704
705
|
"data-part-filter-actions": "",
|
|
705
|
-
children: [/* @__PURE__ */
|
|
706
|
-
disabled: !
|
|
706
|
+
children: [/* @__PURE__ */ M(r, {
|
|
707
|
+
disabled: !we(F),
|
|
707
708
|
onClick: (e) => J(e),
|
|
708
709
|
size: "sm",
|
|
709
710
|
tone: "secondary",
|
|
710
711
|
variant: "ghost",
|
|
711
|
-
children:
|
|
712
|
-
}), /* @__PURE__ */
|
|
712
|
+
children: R("filterClear")
|
|
713
|
+
}), /* @__PURE__ */ M(r, {
|
|
713
714
|
onClick: (e) => q(e, "pointer"),
|
|
714
715
|
size: "sm",
|
|
715
|
-
children:
|
|
716
|
+
children: R("filterApply")
|
|
716
717
|
})]
|
|
717
718
|
})
|
|
718
719
|
]
|
|
@@ -726,11 +727,11 @@ function X(e) {
|
|
|
726
727
|
};
|
|
727
728
|
}
|
|
728
729
|
function Z(e, t) {
|
|
729
|
-
return t ??
|
|
730
|
+
return t ?? Ee(e);
|
|
730
731
|
}
|
|
731
732
|
function at(e) {
|
|
732
|
-
return /* @__PURE__ */
|
|
733
|
-
body: ({ apply: e, condition: t, setOperand: n, t: r }) => /* @__PURE__ */
|
|
733
|
+
return /* @__PURE__ */ M(Y, {
|
|
734
|
+
body: ({ apply: e, condition: t, setOperand: n, t: r }) => /* @__PURE__ */ M(u, {
|
|
734
735
|
"aria-label": r("filterValue"),
|
|
735
736
|
onChange: (e) => n(0, e.target.value),
|
|
736
737
|
onKeyDown: X(e),
|
|
@@ -746,12 +747,12 @@ function at(e) {
|
|
|
746
747
|
}
|
|
747
748
|
function ot(e) {
|
|
748
749
|
let { format: t, locale: n, step: r } = e;
|
|
749
|
-
return /* @__PURE__ */
|
|
750
|
-
body: ({ apply: e, condition: i, setOperand: a, t: o }) => /* @__PURE__ */ j
|
|
751
|
-
"aria-label":
|
|
750
|
+
return /* @__PURE__ */ M(Y, {
|
|
751
|
+
body: ({ apply: e, condition: i, setOperand: a, t: o }) => /* @__PURE__ */ M(j, { children: [0, 1].slice(0, V(i.operator)).map((s) => /* @__PURE__ */ M(ne, {
|
|
752
|
+
"aria-label": V(i.operator) === 2 ? o(s === 0 ? "filterFrom" : "filterTo") : o("filterValue"),
|
|
752
753
|
onKeyDown: X(e),
|
|
753
754
|
onValueChange: (e) => a(s, e),
|
|
754
|
-
placeholder:
|
|
755
|
+
placeholder: V(i.operator) === 2 ? o(s === 0 ? "filterFrom" : "filterTo") : o("filterValue"),
|
|
755
756
|
size: "sm",
|
|
756
757
|
value: (s === 0 ? i.value : i.end) ?? null,
|
|
757
758
|
...t === void 0 ? {} : { format: t },
|
|
@@ -765,9 +766,9 @@ function ot(e) {
|
|
|
765
766
|
});
|
|
766
767
|
}
|
|
767
768
|
function st(e) {
|
|
768
|
-
let { locale: t, max: n, min: r, presets: i } = e, a = (e) => e ?
|
|
769
|
-
return /* @__PURE__ */
|
|
770
|
-
body: ({ apply: e, condition: s, setOperand: c, setOperands: l, t: u }) =>
|
|
769
|
+
let { locale: t, max: n, min: r, presets: i } = e, a = (e) => e ? ye(String(e)) : null, o = (e) => F(e) ? R(e) : null;
|
|
770
|
+
return /* @__PURE__ */ M(Y, {
|
|
771
|
+
body: ({ apply: e, condition: s, setOperand: c, setOperands: l, t: u }) => V(s.operator) === 2 ? /* @__PURE__ */ M(_, {
|
|
771
772
|
messages: {
|
|
772
773
|
end: u("filterTo"),
|
|
773
774
|
start: u("filterFrom")
|
|
@@ -783,7 +784,7 @@ function st(e) {
|
|
|
783
784
|
...a(r) ? { min: a(r) } : {},
|
|
784
785
|
...a(n) ? { max: a(n) } : {},
|
|
785
786
|
...i === void 0 ? {} : { presets: i }
|
|
786
|
-
}) : /* @__PURE__ */
|
|
787
|
+
}) : /* @__PURE__ */ M(g, {
|
|
787
788
|
"aria-label": u("filterValue"),
|
|
788
789
|
onKeyDown: X(e),
|
|
789
790
|
onValueChange: (e) => c(0, o(e)),
|
|
@@ -803,15 +804,15 @@ function st(e) {
|
|
|
803
804
|
function Q(e) {
|
|
804
805
|
if (!e) return null;
|
|
805
806
|
let t = String(e);
|
|
806
|
-
return
|
|
807
|
+
return be(/^\d{2}$/.test(t) ? `${t}:00` : t);
|
|
807
808
|
}
|
|
808
809
|
function $(e) {
|
|
809
810
|
if (!e) return null;
|
|
810
811
|
let t = String(e);
|
|
811
|
-
return /^\d{4}-\d{2}-\d{2}$/.test(t) ?
|
|
812
|
+
return /^\d{4}-\d{2}-\d{2}$/.test(t) ? L(`${t}T00:00`) : /^\d{4}-\d{2}-\d{2}T\d{2}$/.test(t) ? L(`${t}:00`) : L(t);
|
|
812
813
|
}
|
|
813
814
|
function ct(e) {
|
|
814
|
-
let { granularity: t, hourCycle: n, locale: r, max: i, min: a, options: o, presets: s, step: c } = e, l = (e) => ve(e) ?
|
|
815
|
+
let { granularity: t, hourCycle: n, locale: r, max: i, min: a, options: o, presets: s, step: c } = e, l = (e) => ve(e) ? z(e, t ?? "minute") : null, u = {
|
|
815
816
|
...t === void 0 ? {} : { granularity: t },
|
|
816
817
|
...n === void 0 ? {} : { hourCycle: n },
|
|
817
818
|
...r === void 0 ? {} : { locale: r },
|
|
@@ -820,8 +821,8 @@ function ct(e) {
|
|
|
820
821
|
...Q(a) ? { min: Q(a) } : {},
|
|
821
822
|
...Q(i) ? { max: Q(i) } : {}
|
|
822
823
|
};
|
|
823
|
-
return /* @__PURE__ */
|
|
824
|
-
body: ({ apply: e, condition: t, setOperand: n, setOperands: r, t: i }) =>
|
|
824
|
+
return /* @__PURE__ */ M(Y, {
|
|
825
|
+
body: ({ apply: e, condition: t, setOperand: n, setOperands: r, t: i }) => V(t.operator) === 2 ? /* @__PURE__ */ M(y, {
|
|
825
826
|
messages: {
|
|
826
827
|
start: i("filterFrom"),
|
|
827
828
|
end: i("filterTo")
|
|
@@ -834,7 +835,7 @@ function ct(e) {
|
|
|
834
835
|
},
|
|
835
836
|
...u,
|
|
836
837
|
...s === void 0 ? {} : { presets: s }
|
|
837
|
-
}) : /* @__PURE__ */
|
|
838
|
+
}) : /* @__PURE__ */ M(v, {
|
|
838
839
|
"aria-label": i("filterValue"),
|
|
839
840
|
onKeyDown: X(e),
|
|
840
841
|
onValueChange: (e) => n(0, l(e)),
|
|
@@ -850,7 +851,7 @@ function ct(e) {
|
|
|
850
851
|
});
|
|
851
852
|
}
|
|
852
853
|
function lt(e) {
|
|
853
|
-
let { granularity: t, hourCycle: n, locale: r, max: i, min: a, presets: o, step: s, timeZone: c } = e, l = (e) => I(e) ? `${
|
|
854
|
+
let { granularity: t, hourCycle: n, locale: r, max: i, min: a, presets: o, step: s, timeZone: c } = e, l = (e) => I(e) ? `${R(e.date)}T${z(e.time, t ?? "minute")}` : null, u = {
|
|
854
855
|
...t === void 0 ? {} : { granularity: t },
|
|
855
856
|
...n === void 0 ? {} : { hourCycle: n },
|
|
856
857
|
...r === void 0 ? {} : { locale: r },
|
|
@@ -859,8 +860,8 @@ function lt(e) {
|
|
|
859
860
|
...$(a) ? { min: $(a) } : {},
|
|
860
861
|
...$(i) ? { max: $(i) } : {}
|
|
861
862
|
};
|
|
862
|
-
return /* @__PURE__ */
|
|
863
|
-
body: ({ apply: e, condition: t, setOperand: n, setOperands: r, t: i }) =>
|
|
863
|
+
return /* @__PURE__ */ M(Y, {
|
|
864
|
+
body: ({ apply: e, condition: t, setOperand: n, setOperands: r, t: i }) => V(t.operator) === 2 ? /* @__PURE__ */ M(te, {
|
|
864
865
|
messages: {
|
|
865
866
|
start: i("filterFrom"),
|
|
866
867
|
end: i("filterTo")
|
|
@@ -873,7 +874,7 @@ function lt(e) {
|
|
|
873
874
|
},
|
|
874
875
|
...u,
|
|
875
876
|
...o === void 0 ? {} : { presets: o }
|
|
876
|
-
}) : /* @__PURE__ */
|
|
877
|
+
}) : /* @__PURE__ */ M(ee, {
|
|
877
878
|
"aria-label": i("filterValue"),
|
|
878
879
|
onKeyDown: X(e),
|
|
879
880
|
onValueChange: (e) => n(0, l(e)),
|
|
@@ -889,17 +890,17 @@ function lt(e) {
|
|
|
889
890
|
});
|
|
890
891
|
}
|
|
891
892
|
function ut(e) {
|
|
892
|
-
return /* @__PURE__ */
|
|
893
|
-
body: ({ condition: e, setOperand: t, t: n }) => /* @__PURE__ */
|
|
893
|
+
return /* @__PURE__ */ M(Y, {
|
|
894
|
+
body: ({ condition: e, setOperand: t, t: n }) => /* @__PURE__ */ N(ce, {
|
|
894
895
|
"aria-label": n("filterValue"),
|
|
895
896
|
onValueChange: (e) => t(0, e === "true"),
|
|
896
897
|
orientation: "horizontal",
|
|
897
898
|
size: "sm",
|
|
898
899
|
value: e.value === void 0 || e.value === null ? "" : String(e.value),
|
|
899
|
-
children: [/* @__PURE__ */
|
|
900
|
+
children: [/* @__PURE__ */ M(b, {
|
|
900
901
|
value: "true",
|
|
901
902
|
children: n("true")
|
|
902
|
-
}), /* @__PURE__ */
|
|
903
|
+
}), /* @__PURE__ */ M(b, {
|
|
903
904
|
value: "false",
|
|
904
905
|
children: n("false")
|
|
905
906
|
})]
|
|
@@ -912,14 +913,14 @@ function ut(e) {
|
|
|
912
913
|
}
|
|
913
914
|
function dt(e) {
|
|
914
915
|
let { operand: t = "list", options: n = [], searchThreshold: r = 8, searchable: i } = e;
|
|
915
|
-
return /* @__PURE__ */
|
|
916
|
-
body: ({ announce: e, apply: a, condition: o, setOperand: s, t: c }) => t === "tags" ? /* @__PURE__ */
|
|
916
|
+
return /* @__PURE__ */ M(Y, {
|
|
917
|
+
body: ({ announce: e, apply: a, condition: o, setOperand: s, t: c }) => t === "tags" ? /* @__PURE__ */ M(ft, {
|
|
917
918
|
apply: a,
|
|
918
919
|
chosen: o.value ?? [],
|
|
919
920
|
onChange: (e) => s(0, e),
|
|
920
921
|
options: n,
|
|
921
922
|
t: c
|
|
922
|
-
}) : /* @__PURE__ */
|
|
923
|
+
}) : /* @__PURE__ */ M(pt, {
|
|
923
924
|
announce: e,
|
|
924
925
|
chosen: o.value ?? [],
|
|
925
926
|
onChange: (e) => s(0, e),
|
|
@@ -936,8 +937,8 @@ function dt(e) {
|
|
|
936
937
|
});
|
|
937
938
|
}
|
|
938
939
|
function ft({ apply: e, chosen: t, onChange: n, options: r, t: i }) {
|
|
939
|
-
let a =
|
|
940
|
-
return /* @__PURE__ */
|
|
940
|
+
let a = ue(), o = k(() => new Map(r.map((e) => [e.value, e])), [r]), s = r.length > 0;
|
|
941
|
+
return /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ M(x, {
|
|
941
942
|
"aria-label": i("filterValue"),
|
|
942
943
|
formatLabel: (e) => o.get(e)?.label ?? e,
|
|
943
944
|
fullWidth: !0,
|
|
@@ -952,20 +953,20 @@ function ft({ apply: e, chosen: t, onChange: n, options: r, t: i }) {
|
|
|
952
953
|
list: `${a}-options`,
|
|
953
954
|
validate: (e) => o.has(e)
|
|
954
955
|
} : {}
|
|
955
|
-
}), s ? /* @__PURE__ */
|
|
956
|
+
}), s ? /* @__PURE__ */ M("datalist", {
|
|
956
957
|
id: `${a}-options`,
|
|
957
|
-
children: r.map((e) => /* @__PURE__ */
|
|
958
|
+
children: r.map((e) => /* @__PURE__ */ M("option", {
|
|
958
959
|
value: e.value,
|
|
959
960
|
children: e.label ?? e.value
|
|
960
961
|
}, e.value))
|
|
961
962
|
}) : null] });
|
|
962
963
|
}
|
|
963
964
|
function pt({ announce: e, chosen: t, onChange: n, options: r, searchThreshold: i, searchable: a, t: o }) {
|
|
964
|
-
let s =
|
|
965
|
-
return /* @__PURE__ */
|
|
965
|
+
let s = ue(), [l, d] = A(""), f = k(() => P({ sensitivity: "base" }), []), p = (e) => e === "" ? r : r.filter((t) => f.contains(t.label ?? t.value, e)), m = p(l), h = m.filter((e) => t.includes(e.value)), g = a ?? r.length >= i;
|
|
966
|
+
return /* @__PURE__ */ N(j, { children: [g ? /* @__PURE__ */ M("div", {
|
|
966
967
|
"data-part": "filter-search",
|
|
967
968
|
"data-part-filter-search": "",
|
|
968
|
-
children: /* @__PURE__ */
|
|
969
|
+
children: /* @__PURE__ */ M(u, {
|
|
969
970
|
"aria-controls": `${s}-list`,
|
|
970
971
|
"aria-label": o("filterSearch"),
|
|
971
972
|
clearable: !0,
|
|
@@ -977,19 +978,19 @@ function pt({ announce: e, chosen: t, onChange: n, options: r, searchThreshold:
|
|
|
977
978
|
size: "sm",
|
|
978
979
|
value: l
|
|
979
980
|
})
|
|
980
|
-
}) : null, m.length === 0 ? /* @__PURE__ */
|
|
981
|
+
}) : null, m.length === 0 ? /* @__PURE__ */ M("p", {
|
|
981
982
|
"data-part": "filter-empty",
|
|
982
983
|
"data-part-filter-empty": "",
|
|
983
984
|
children: o("filterEmpty")
|
|
984
|
-
}) : /* @__PURE__ */
|
|
985
|
+
}) : /* @__PURE__ */ N("div", {
|
|
985
986
|
"data-part": "filter-list",
|
|
986
987
|
"data-part-filter-list": "",
|
|
987
988
|
id: `${s}-list`,
|
|
988
|
-
children: [/* @__PURE__ */
|
|
989
|
+
children: [/* @__PURE__ */ N("div", {
|
|
989
990
|
"data-covering": "",
|
|
990
991
|
"data-part": "filter-option",
|
|
991
992
|
"data-part-filter-option": "",
|
|
992
|
-
children: [/* @__PURE__ */
|
|
993
|
+
children: [/* @__PURE__ */ M(c, {
|
|
993
994
|
checked: h.length > 0 && h.length === m.length,
|
|
994
995
|
indeterminate: h.length > 0 && h.length < m.length,
|
|
995
996
|
onCheckedChange: (e) => {
|
|
@@ -997,18 +998,18 @@ function pt({ announce: e, chosen: t, onChange: n, options: r, searchThreshold:
|
|
|
997
998
|
n(e ? [.../* @__PURE__ */ new Set([...t, ...r])] : t.filter((e) => !r.includes(e)));
|
|
998
999
|
},
|
|
999
1000
|
children: o("filterSelectAll")
|
|
1000
|
-
}), /* @__PURE__ */
|
|
1001
|
+
}), /* @__PURE__ */ M("span", {
|
|
1001
1002
|
"data-count": "",
|
|
1002
1003
|
children: m.length
|
|
1003
1004
|
})]
|
|
1004
|
-
}), m.map((e) => /* @__PURE__ */
|
|
1005
|
+
}), m.map((e) => /* @__PURE__ */ N("div", {
|
|
1005
1006
|
"data-part": "filter-option",
|
|
1006
1007
|
"data-part-filter-option": "",
|
|
1007
|
-
children: [/* @__PURE__ */
|
|
1008
|
+
children: [/* @__PURE__ */ M(c, {
|
|
1008
1009
|
checked: t.includes(e.value),
|
|
1009
1010
|
onCheckedChange: (r) => n(r ? [...t, e.value] : t.filter((t) => t !== e.value)),
|
|
1010
1011
|
children: e.label ?? e.value
|
|
1011
|
-
}), e.count === void 0 ? null : /* @__PURE__ */
|
|
1012
|
+
}), e.count === void 0 ? null : /* @__PURE__ */ M("span", {
|
|
1012
1013
|
"data-count": "",
|
|
1013
1014
|
children: e.count
|
|
1014
1015
|
})]
|