@slotted/react 0.1.0-beta.3 → 0.1.0-beta.4
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/{accordion-D-YuMJzk.js → accordion-lCqrmQ3w.js} +43 -43
- package/dist/accordion.js +1 -1
- package/dist/calendar-BZ6PP7Ke.js +436 -0
- package/dist/calendar.js +1 -1
- package/dist/{collapsible-CGo49NNW.js → collapsible-F-K36XbF.js} +17 -17
- package/dist/collapsible.js +1 -1
- package/dist/{data-grid-BKaGMqIm.js → data-grid-Eb-a4jg3.js} +6 -6
- package/dist/data-grid.js +1 -1
- package/dist/date-field-Hr-OCU-H.js +290 -0
- package/dist/date-field.js +1 -1
- package/dist/date-picker-D3-y2Jxw.js +295 -0
- package/dist/date-picker.js +1 -1
- package/dist/{date-range-picker-CNOAtHwU.js → date-range-picker-y3b82Wmf.js} +2 -2
- package/dist/date-range-picker.js +1 -1
- package/dist/{datetime-picker-HDVlUhzy.js → datetime-picker-CIRHVLQp.js} +1 -1
- package/dist/datetime-picker.js +1 -1
- package/dist/{datetime-range-picker-IqOFJtdW.js → datetime-range-picker-DM-1m98z.js} +1 -1
- package/dist/datetime-range-picker.js +1 -1
- package/dist/{detail-panel-qOJiNuzr.js → detail-panel-CW53lUjp.js} +3 -3
- package/dist/detail-panel.js +1 -1
- package/dist/docs/calendar.json +7 -0
- package/dist/docs/calendar.md +1 -0
- package/dist/docs/collapsible.json +1 -1
- package/dist/docs/collapsible.md +1 -1
- package/dist/docs/date-field.json +8 -1
- package/dist/docs/date-field.md +2 -1
- package/dist/docs/date-picker.examples.md +29 -0
- package/dist/docs/date-picker.json +16 -1
- package/dist/docs/date-picker.md +2 -1
- package/dist/docs/guidelines/composition.md +10 -0
- package/dist/docs/guidelines/index.md +2 -0
- package/dist/docs/guidelines/list-pages.md +12 -1
- package/dist/docs/page.json +1 -0
- package/dist/docs/page.md +1 -0
- package/dist/docs/select.json +1 -1
- package/dist/docs/select.md +1 -1
- package/dist/docs/skills/compose-screen/SKILL.md +7 -0
- package/dist/docs/table.json +13 -0
- package/dist/docs/table.md +3 -1
- package/dist/docs/tabs.json +9 -1
- package/dist/docs/tabs.md +3 -1
- package/dist/docs/text-field.json +1 -1
- package/dist/docs/text-field.md +1 -1
- package/dist/{entity-picker-CPDd73JR.js → entity-picker-Dn1T7JCq.js} +1 -1
- package/dist/entity-picker.js +1 -1
- package/dist/{filter-bar-D_xDcAp2.js → filter-bar-CHyy1o--.js} +3 -3
- package/dist/filter-bar.js +1 -1
- package/dist/{import-export-center-DpY2DGBZ.js → import-export-center-jF37b909.js} +2 -2
- package/dist/import-export-center.js +1 -1
- package/dist/index.js +19 -19
- package/dist/{notification-center-Sz54IziY.js → notification-center-C1iWWl5Y.js} +1 -1
- package/dist/notification-center.js +1 -1
- package/dist/{page-kQgLctsA.js → page-IiYXk1sz.js} +32 -32
- package/dist/{page-header-CWEBfMGq.js → page-header-Bn4nIGfF.js} +1 -1
- package/dist/page-header.js +1 -1
- package/dist/page.js +1 -1
- package/dist/{select-DOFqPy26.js → select-M7Io4UL9.js} +273 -260
- package/dist/select.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/{table-Cipi2c5X.js → table-U9eJYCuB.js} +167 -165
- package/dist/table.js +1 -1
- package/dist/tabs-BtHmjlnM.js +348 -0
- package/dist/tabs.js +1 -1
- package/dist/types/accordion/accordion.d.ts.map +1 -1
- package/dist/types/calendar/calendar.d.ts +1 -1
- package/dist/types/calendar/calendar.d.ts.map +1 -1
- package/dist/types/calendar/calendar.types.d.ts +9 -0
- package/dist/types/calendar/calendar.types.d.ts.map +1 -1
- package/dist/types/calendar/index.d.ts +1 -1
- package/dist/types/calendar/index.d.ts.map +1 -1
- package/dist/types/collapsible/collapsible-parts.d.ts.map +1 -1
- package/dist/types/date-field/date-field.d.ts +1 -1
- package/dist/types/date-field/date-field.d.ts.map +1 -1
- package/dist/types/date-field/date-field.types.d.ts +7 -0
- package/dist/types/date-field/date-field.types.d.ts.map +1 -1
- package/dist/types/date-picker/date-picker.d.ts +5 -1
- package/dist/types/date-picker/date-picker.d.ts.map +1 -1
- package/dist/types/date-picker/date-picker.types.d.ts +20 -2
- package/dist/types/date-picker/date-picker.types.d.ts.map +1 -1
- package/dist/types/date-picker/index.d.ts +1 -1
- package/dist/types/date-picker/index.d.ts.map +1 -1
- package/dist/types/page/page.d.ts.map +1 -1
- package/dist/types/select/select-items.d.ts.map +1 -1
- package/dist/types/select/select-parts.d.ts.map +1 -1
- package/dist/types/select/select.d.ts.map +1 -1
- package/dist/types/table/index.d.ts +1 -1
- package/dist/types/table/index.d.ts.map +1 -1
- package/dist/types/table/table-defaults.d.ts.map +1 -1
- package/dist/types/table/table.d.ts +1 -1
- package/dist/types/table/table.d.ts.map +1 -1
- package/dist/types/table/table.types.d.ts +15 -0
- package/dist/types/table/table.types.d.ts.map +1 -1
- package/dist/types/tabs/tabs-parts.d.ts.map +1 -1
- package/dist/types/tabs/tabs.d.ts +1 -1
- package/dist/types/tabs/tabs.d.ts.map +1 -1
- package/dist/types/tabs/tabs.types.d.ts +18 -0
- package/dist/types/tabs/tabs.types.d.ts.map +1 -1
- package/package.json +6 -6
- package/dist/calendar-B3mio8iQ.js +0 -387
- package/dist/date-field-CYcN6diW.js +0 -279
- package/dist/date-picker-4X-_2ltN.js +0 -264
- package/dist/tabs-DQ36APY-.js +0 -343
|
@@ -7,21 +7,21 @@ import { i as l } from "./skeleton-2LSpg84Z.js";
|
|
|
7
7
|
import { t as u } from "./text-field-DLfIZ0fk.js";
|
|
8
8
|
import { a as d, d as f, f as p, l as m } from "./popover-Be7JWbGJ.js";
|
|
9
9
|
import { t as h } from "./visually-hidden-CE6u5JLW.js";
|
|
10
|
-
import { t as g } from "./date-picker-
|
|
11
|
-
import { t as _ } from "./date-range-picker-
|
|
12
|
-
import { t as ee } from "./datetime-picker-
|
|
13
|
-
import { t as te } from "./datetime-range-picker-
|
|
10
|
+
import { t as g } from "./date-picker-D3-y2Jxw.js";
|
|
11
|
+
import { t as _ } from "./date-range-picker-y3b82Wmf.js";
|
|
12
|
+
import { t as ee } from "./datetime-picker-CIRHVLQp.js";
|
|
13
|
+
import { t as te } from "./datetime-range-picker-DM-1m98z.js";
|
|
14
14
|
import { t as ne } from "./number-field-BFIAmv-z.js";
|
|
15
|
-
import { c as re, i as ie, n as ae, o as oe, s as
|
|
16
|
-
import { t as
|
|
17
|
-
import { t as
|
|
15
|
+
import { c as re, i as ie, n as ae, o as oe, s as se } from "./select-M7Io4UL9.js";
|
|
16
|
+
import { t as v } from "./time-picker-CRQsMJbQ.js";
|
|
17
|
+
import { t as y } from "./time-range-picker-DlZJsj1e.js";
|
|
18
18
|
import { n as ce, t as b } from "./radio-group-BaVIP9UH.js";
|
|
19
19
|
import { t as x } from "./tags-input-CcOkm0AW.js";
|
|
20
20
|
import { createControllable as le } from "@slotted/core/state";
|
|
21
|
-
import { createContext as S, useCallback as C, useContext as w, useEffect as ue, useId as de, useImperativeHandle as T, useMemo as E, useRef as
|
|
22
|
-
import { Fragment as
|
|
23
|
-
import { createScrollAffordance as
|
|
24
|
-
import { isRowAction as
|
|
21
|
+
import { createContext as S, useCallback as C, useContext as w, useEffect as ue, useId as de, useImperativeHandle as T, useMemo as E, useRef as fe, useState as D } from "react";
|
|
22
|
+
import { Fragment as O, jsx as k, jsxs as A } from "react/jsx-runtime";
|
|
23
|
+
import { createScrollAffordance as j } from "@slotted/core/overflow";
|
|
24
|
+
import { isRowAction as M } from "@slotted/core/pointer-intent";
|
|
25
25
|
import { tableMessages as pe } from "@slotted/core/i18n";
|
|
26
26
|
import { getLiveAnnouncer as me } from "@slotted/core/live-announcer";
|
|
27
27
|
import { isPlainDate as he, isPlainDateTime as N, isPlainTime as ge, parseISODate as P, parseISODateTime as F, parseISOTime as I, toISODate as _e, toISOTime as L } from "@slotted/core/date";
|
|
@@ -34,10 +34,11 @@ function H() {
|
|
|
34
34
|
}
|
|
35
35
|
function U({ children: e, ...t }) {
|
|
36
36
|
let n = H();
|
|
37
|
-
return /* @__PURE__ */
|
|
37
|
+
return /* @__PURE__ */ k(De.Provider, {
|
|
38
38
|
value: {
|
|
39
39
|
cellAlign: t.cellAlign ?? n.cellAlign,
|
|
40
40
|
columns: t.columns ?? n.columns,
|
|
41
|
+
edges: t.edges ?? n.edges,
|
|
41
42
|
layout: t.layout ?? n.layout,
|
|
42
43
|
selectionMode: t.selectionMode ?? n.selectionMode,
|
|
43
44
|
stickyFooter: t.stickyFooter ?? n.stickyFooter,
|
|
@@ -60,109 +61,110 @@ function K() {
|
|
|
60
61
|
function Oe() {
|
|
61
62
|
return w(G);
|
|
62
63
|
}
|
|
63
|
-
function q({ children: e, columns: t, defaultExpanded: r, defaultSort: i, defaultValue: a,
|
|
64
|
-
let v = H(), y = n(pe,
|
|
65
|
-
|
|
66
|
-
}, [
|
|
67
|
-
function
|
|
64
|
+
function q({ children: e, columns: t, 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 }) {
|
|
65
|
+
let v = H(), y = n(pe, u), ce = de(), [b, x] = D(i ?? null), [S, w] = D(a ?? []), [ue, T] = D(r ?? []), E = fe(null), O = fe(void 0), A = _ === void 0 ? b : _, j = ae ?? S, M = s ?? ue, he = t ?? v.columns ?? 1, N = o ?? v.edges ?? "inset", ge = c ?? v.layout ?? "auto", P = g ?? v.selectionMode ?? "none", F = (ne ?? v.stickyHeader ?? !1) === !0, I = (te ?? v.stickyFooter ?? !1) === !0, _e = ee ?? v.cellAlign ?? "center", L = re ?? v.stickyTo ?? "scroll", ve = (ie ?? v.striped ?? !1) === !0, be = oe ?? v.variant ?? "ruled", xe = C((e) => {
|
|
66
|
+
E.current = e, typeof m == "function" ? m(e) : m != null && (m.current = e);
|
|
67
|
+
}, [m]), Se = C(() => [...E.current?.querySelectorAll("[data-part=\"body\"] > [data-part=\"row\"][data-value]") ?? []].filter((e) => !e.hasAttribute("data-disabled")).map((e) => e.getAttribute("data-value") ?? ""), []);
|
|
68
|
+
function R(e, t, n) {
|
|
68
69
|
le({
|
|
69
|
-
controlled:
|
|
70
|
+
controlled: ae,
|
|
70
71
|
initial: j,
|
|
71
72
|
equals: (e, t) => e.length === t.length && e.every((e, n) => e === t[n]),
|
|
72
|
-
onRequest: (e) =>
|
|
73
|
-
}).request(e, t, n) &&
|
|
73
|
+
onRequest: (e) => p?.(e.value, e)
|
|
74
|
+
}).request(e, t, n) && w(e);
|
|
74
75
|
}
|
|
75
|
-
let
|
|
76
|
-
columns:
|
|
76
|
+
let Ce = {
|
|
77
|
+
columns: he,
|
|
77
78
|
expanded: M,
|
|
78
|
-
id:
|
|
79
|
+
id: ce,
|
|
79
80
|
isExpanded: (e) => M.includes(e),
|
|
80
81
|
isSelected: (e) => j.includes(e),
|
|
81
|
-
loading:
|
|
82
|
-
rows:
|
|
82
|
+
loading: l === !0,
|
|
83
|
+
rows: Se,
|
|
83
84
|
requestSort(e, t) {
|
|
84
|
-
let n =
|
|
85
|
+
let n = A?.column === e ? A.direction === "ascending" ? {
|
|
85
86
|
column: e,
|
|
86
87
|
direction: "descending"
|
|
87
88
|
} : null : {
|
|
88
89
|
column: e,
|
|
89
90
|
direction: "ascending"
|
|
90
91
|
}, r = le({
|
|
91
|
-
controlled:
|
|
92
|
-
initial:
|
|
92
|
+
controlled: _,
|
|
93
|
+
initial: A,
|
|
93
94
|
equals: (e, t) => e?.column === t?.column && e?.direction === t?.direction,
|
|
94
|
-
onRequest: (e) =>
|
|
95
|
+
onRequest: (e) => f?.(e.value, e)
|
|
95
96
|
}), 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 });
|
|
96
|
-
me(
|
|
97
|
+
me(E.current?.ownerDocument).announce(s), a && x(n);
|
|
97
98
|
},
|
|
98
|
-
selectionMode:
|
|
99
|
-
sort:
|
|
100
|
-
stickyTo:
|
|
99
|
+
selectionMode: P,
|
|
100
|
+
sort: A,
|
|
101
|
+
stickyTo: L,
|
|
101
102
|
toggleExpanded(e, t) {
|
|
102
103
|
let n = M.includes(e) ? M.filter((t) => t !== e) : [...M, e];
|
|
103
104
|
le({
|
|
104
|
-
controlled:
|
|
105
|
+
controlled: s,
|
|
105
106
|
initial: M,
|
|
106
107
|
equals: (e, t) => e.length === t.length && e.every((e, n) => e === t[n]),
|
|
107
|
-
onRequest: (e) =>
|
|
108
|
-
}).request(n, "pointer", t) &&
|
|
108
|
+
onRequest: (e) => d?.(e.value, e)
|
|
109
|
+
}).request(n, "pointer", t) && T(n);
|
|
109
110
|
},
|
|
110
111
|
toggleSelected(e, { range: t, source: n }) {
|
|
111
112
|
let r = ye({
|
|
112
|
-
action: t &&
|
|
113
|
-
anchor:
|
|
113
|
+
action: t && P === "multiple" ? "range" : "toggle",
|
|
114
|
+
anchor: O.current,
|
|
114
115
|
behavior: "toggle",
|
|
115
116
|
key: e,
|
|
116
|
-
keys:
|
|
117
|
-
mode:
|
|
117
|
+
keys: Se(),
|
|
118
|
+
mode: P,
|
|
118
119
|
selected: j
|
|
119
120
|
});
|
|
120
|
-
t || (
|
|
121
|
+
t || (O.current = e), R(r.selected, t ? "select" : "pointer", n);
|
|
121
122
|
},
|
|
122
123
|
toggleSelectAll(e) {
|
|
123
124
|
let t = ye({
|
|
124
125
|
action: "all",
|
|
125
|
-
keys:
|
|
126
|
-
mode:
|
|
126
|
+
keys: Se(),
|
|
127
|
+
mode: P,
|
|
127
128
|
selected: j
|
|
128
129
|
});
|
|
129
|
-
|
|
130
|
+
R(t.selected, t.selected.length === 0 ? "clear" : "select", e);
|
|
130
131
|
},
|
|
131
132
|
t: y,
|
|
132
133
|
value: j
|
|
133
|
-
},
|
|
134
|
-
...
|
|
134
|
+
}, we = {
|
|
135
|
+
...se,
|
|
135
136
|
children: e,
|
|
136
|
-
"data-cell-align":
|
|
137
|
-
"data-
|
|
138
|
-
|
|
137
|
+
"data-cell-align": _e,
|
|
138
|
+
"data-edges": N,
|
|
139
|
+
"data-layout": ge,
|
|
140
|
+
...l === !0 ? { "data-loading": "" } : {},
|
|
139
141
|
"data-part": "root",
|
|
140
|
-
...
|
|
141
|
-
...
|
|
142
|
-
"data-sticky-to":
|
|
143
|
-
...
|
|
142
|
+
...F ? { "data-sticky-header": "" } : {},
|
|
143
|
+
...I ? { "data-sticky-footer": "" } : {},
|
|
144
|
+
"data-sticky-to": L,
|
|
145
|
+
...ve ? { "data-striped": "" } : {},
|
|
144
146
|
"data-ui": "table",
|
|
145
|
-
"data-variant":
|
|
146
|
-
ref:
|
|
147
|
+
"data-variant": be,
|
|
148
|
+
ref: xe
|
|
147
149
|
};
|
|
148
|
-
return /* @__PURE__ */
|
|
149
|
-
value:
|
|
150
|
-
children:
|
|
150
|
+
return /* @__PURE__ */ k(G.Provider, {
|
|
151
|
+
value: Ce,
|
|
152
|
+
children: h === void 0 ? /* @__PURE__ */ k("div", { ...we }) : h(we)
|
|
151
153
|
});
|
|
152
154
|
}
|
|
153
155
|
//#endregion
|
|
154
156
|
//#region src/table/table-content.tsx
|
|
155
157
|
function ke({ children: e, handleRef: t, ref: n, scrollLabelledBy: r, scrollProps: i, totalRowCount: a, ...o }) {
|
|
156
|
-
let s = K(), [c, l] =
|
|
158
|
+
let s = K(), [c, l] = D(null), [u, d] = D({
|
|
157
159
|
overflowing: !1,
|
|
158
160
|
atStart: !0,
|
|
159
161
|
atEnd: !0
|
|
160
|
-
}), f =
|
|
162
|
+
}), f = fe(null), { ref: p, ...m } = i ?? {}, h = C((e) => {
|
|
161
163
|
l(e), typeof p == "function" ? p(e) : p != null && (p.current = e);
|
|
162
164
|
}, [p]);
|
|
163
165
|
ue(() => {
|
|
164
166
|
if (c === null || s.stickyTo === "page") return;
|
|
165
|
-
let e =
|
|
167
|
+
let e = j(c, { onChange: d });
|
|
166
168
|
return f.current = e, d(e.state()), () => {
|
|
167
169
|
e.destroy(), f.current = null;
|
|
168
170
|
};
|
|
@@ -179,9 +181,9 @@ function ke({ children: e, handleRef: t, ref: n, scrollLabelledBy: r, scrollProp
|
|
|
179
181
|
"data-part": "scroll",
|
|
180
182
|
ref: h
|
|
181
183
|
};
|
|
182
|
-
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__ */
|
|
184
|
+
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__ */ k("div", {
|
|
183
185
|
...g,
|
|
184
|
-
children: /* @__PURE__ */
|
|
186
|
+
children: /* @__PURE__ */ k("table", {
|
|
185
187
|
...o,
|
|
186
188
|
...a === void 0 ? {} : { "aria-rowcount": a },
|
|
187
189
|
...s.loading ? { "aria-busy": !0 } : {},
|
|
@@ -216,35 +218,35 @@ function J({ align: e, blockAlign: t, numeric: n, sticky: r, stickyOffset: i, te
|
|
|
216
218
|
};
|
|
217
219
|
}
|
|
218
220
|
function Pe({ ref: e, ...t }) {
|
|
219
|
-
return /* @__PURE__ */
|
|
221
|
+
return /* @__PURE__ */ k("caption", {
|
|
220
222
|
...t,
|
|
221
223
|
"data-part": "caption",
|
|
222
224
|
ref: e
|
|
223
225
|
});
|
|
224
226
|
}
|
|
225
227
|
function Fe({ ref: e, ...t }) {
|
|
226
|
-
return /* @__PURE__ */
|
|
228
|
+
return /* @__PURE__ */ k("thead", {
|
|
227
229
|
...t,
|
|
228
230
|
"data-part": "head",
|
|
229
231
|
ref: e
|
|
230
232
|
});
|
|
231
233
|
}
|
|
232
234
|
function Ie({ ref: e, ...t }) {
|
|
233
|
-
return /* @__PURE__ */
|
|
235
|
+
return /* @__PURE__ */ k("tbody", {
|
|
234
236
|
...t,
|
|
235
237
|
"data-part": "body",
|
|
236
238
|
ref: e
|
|
237
239
|
});
|
|
238
240
|
}
|
|
239
241
|
function Le({ ref: e, ...t }) {
|
|
240
|
-
return /* @__PURE__ */
|
|
242
|
+
return /* @__PURE__ */ k("tfoot", {
|
|
241
243
|
...t,
|
|
242
244
|
"data-part": "summary",
|
|
243
245
|
ref: e
|
|
244
246
|
});
|
|
245
247
|
}
|
|
246
248
|
function Re({ ref: e, ...t }) {
|
|
247
|
-
return /* @__PURE__ */
|
|
249
|
+
return /* @__PURE__ */ k("div", {
|
|
248
250
|
...t,
|
|
249
251
|
"data-part": "footer",
|
|
250
252
|
ref: e
|
|
@@ -252,7 +254,7 @@ function Re({ ref: e, ...t }) {
|
|
|
252
254
|
}
|
|
253
255
|
function ze({ children: e, current: t, disabled: n, interactive: r, onAction: i, onClick: a, ref: o, render: s, rowIndex: c, value: l, ...u }) {
|
|
254
256
|
let d = K(), f = l !== void 0 && d.isSelected(l), p = l !== void 0 && d.isExpanded(l), m = r ?? i !== void 0, h = i === void 0 ? a : (e) => {
|
|
255
|
-
a?.(e), !(e.defaultPrevented || n === !0) &&
|
|
257
|
+
a?.(e), !(e.defaultPrevented || n === !0) && M(e.currentTarget, e.target) && i(e);
|
|
256
258
|
}, g = {
|
|
257
259
|
...u,
|
|
258
260
|
children: e,
|
|
@@ -275,9 +277,9 @@ function ze({ children: e, current: t, disabled: n, interactive: r, onAction: i,
|
|
|
275
277
|
selected: f,
|
|
276
278
|
value: l
|
|
277
279
|
};
|
|
278
|
-
return /* @__PURE__ */
|
|
280
|
+
return /* @__PURE__ */ k(Ae.Provider, {
|
|
279
281
|
value: _,
|
|
280
|
-
children: s === void 0 ? /* @__PURE__ */
|
|
282
|
+
children: s === void 0 ? /* @__PURE__ */ k("tr", {
|
|
281
283
|
...g,
|
|
282
284
|
ref: o
|
|
283
285
|
}) : s(g)
|
|
@@ -287,10 +289,10 @@ function Be(e, ...t) {
|
|
|
287
289
|
for (let n of t) typeof n == "function" ? n(e) : n != null && (n.current = e);
|
|
288
290
|
}
|
|
289
291
|
function Ve({ header: e }) {
|
|
290
|
-
return /* @__PURE__ */
|
|
292
|
+
return /* @__PURE__ */ k(O, { children: (e.current?.textContent ?? "").trim() });
|
|
291
293
|
}
|
|
292
294
|
function He({ align: e, blockAlign: t, children: n, column: r, numeric: c, ref: l, scope: u, sticky: d, stickyOffset: f, style: p, text: m, ...h }) {
|
|
293
|
-
let g = K(), _ =
|
|
295
|
+
let g = K(), _ = fe(null), ee = r !== void 0 && g.sort?.column === r, te = {
|
|
294
296
|
...h,
|
|
295
297
|
...J({
|
|
296
298
|
align: e,
|
|
@@ -305,27 +307,27 @@ function He({ align: e, blockAlign: t, children: n, column: r, numeric: c, ref:
|
|
|
305
307
|
"data-part": "column-header",
|
|
306
308
|
scope: u ?? "col"
|
|
307
309
|
};
|
|
308
|
-
return /* @__PURE__ */
|
|
310
|
+
return /* @__PURE__ */ k(je.Provider, {
|
|
309
311
|
value: r,
|
|
310
|
-
children: /* @__PURE__ */
|
|
312
|
+
children: /* @__PURE__ */ A(i, {
|
|
311
313
|
describes: "none",
|
|
312
314
|
openOn: "hover",
|
|
313
315
|
side: "bottom",
|
|
314
316
|
whenClipped: !0,
|
|
315
|
-
children: [/* @__PURE__ */
|
|
317
|
+
children: [/* @__PURE__ */ k(a, {
|
|
316
318
|
...te,
|
|
317
|
-
render: (e) => /* @__PURE__ */
|
|
319
|
+
render: (e) => /* @__PURE__ */ k("th", {
|
|
318
320
|
...e,
|
|
319
321
|
ref: (t) => {
|
|
320
322
|
e.ref?.(t), _.current = t, Be(t, l);
|
|
321
323
|
}
|
|
322
324
|
})
|
|
323
|
-
}), /* @__PURE__ */
|
|
325
|
+
}), /* @__PURE__ */ k(s, { children: /* @__PURE__ */ k(o, { children: /* @__PURE__ */ k(Ve, { header: _ }) }) })]
|
|
324
326
|
})
|
|
325
327
|
});
|
|
326
328
|
}
|
|
327
329
|
function Ue({ align: e, blockAlign: t, numeric: n, ref: r, scope: i, sticky: a, stickyOffset: o, style: s, text: c, ...l }) {
|
|
328
|
-
return /* @__PURE__ */
|
|
330
|
+
return /* @__PURE__ */ k("th", {
|
|
329
331
|
...l,
|
|
330
332
|
...J({
|
|
331
333
|
align: e,
|
|
@@ -341,7 +343,7 @@ function Ue({ align: e, blockAlign: t, numeric: n, ref: r, scope: i, sticky: a,
|
|
|
341
343
|
});
|
|
342
344
|
}
|
|
343
345
|
function We({ align: e, blockAlign: t, numeric: n, ref: r, sticky: i, stickyOffset: a, style: o, text: s, ...c }) {
|
|
344
|
-
return /* @__PURE__ */
|
|
346
|
+
return /* @__PURE__ */ k("td", {
|
|
345
347
|
...c,
|
|
346
348
|
...J({
|
|
347
349
|
align: e,
|
|
@@ -362,18 +364,18 @@ function Ge({ children: n, column: r, onClick: i, ref: a, render: o, ...s }) {
|
|
|
362
364
|
}
|
|
363
365
|
let f = {
|
|
364
366
|
...s,
|
|
365
|
-
children: /* @__PURE__ */
|
|
367
|
+
children: /* @__PURE__ */ A(O, { children: [n, /* @__PURE__ */ k(t, { children: /* @__PURE__ */ k(e, { name: "chevron-down" }) })] }),
|
|
366
368
|
"data-part": "sort",
|
|
367
369
|
onClick: d,
|
|
368
370
|
type: "button"
|
|
369
371
|
};
|
|
370
|
-
return o === void 0 ? /* @__PURE__ */
|
|
372
|
+
return o === void 0 ? /* @__PURE__ */ k("button", {
|
|
371
373
|
...f,
|
|
372
374
|
ref: a
|
|
373
375
|
}) : o(f);
|
|
374
376
|
}
|
|
375
377
|
function Ke({ ref: e, ...t }) {
|
|
376
|
-
return /* @__PURE__ */
|
|
378
|
+
return /* @__PURE__ */ k("span", {
|
|
377
379
|
...t,
|
|
378
380
|
"data-part": "column-actions",
|
|
379
381
|
ref: e
|
|
@@ -381,7 +383,7 @@ function Ke({ ref: e, ...t }) {
|
|
|
381
383
|
}
|
|
382
384
|
function qe({ align: e, blockAlign: t, numeric: n, ref: r, sticky: i, stickyOffset: a, style: o, text: s, value: l, ...u }) {
|
|
383
385
|
let d = K(), f = Ne(), p = l ?? f.value;
|
|
384
|
-
return /* @__PURE__ */
|
|
386
|
+
return /* @__PURE__ */ k("td", {
|
|
385
387
|
...u,
|
|
386
388
|
...J({
|
|
387
389
|
align: e,
|
|
@@ -393,7 +395,7 @@ function qe({ align: e, blockAlign: t, numeric: n, ref: r, sticky: i, stickyOffs
|
|
|
393
395
|
}, o),
|
|
394
396
|
"data-part": "selection",
|
|
395
397
|
ref: r,
|
|
396
|
-
children: /* @__PURE__ */
|
|
398
|
+
children: /* @__PURE__ */ k(c, {
|
|
397
399
|
checked: p !== void 0 && d.isSelected(p),
|
|
398
400
|
disabled: f.disabled,
|
|
399
401
|
onCheckedChange: (e, t) => {
|
|
@@ -404,13 +406,13 @@ function qe({ align: e, blockAlign: t, numeric: n, ref: r, sticky: i, stickyOffs
|
|
|
404
406
|
source: t.source
|
|
405
407
|
});
|
|
406
408
|
},
|
|
407
|
-
children: /* @__PURE__ */
|
|
409
|
+
children: /* @__PURE__ */ k(h, { children: d.t("selectRow", { row: p ?? "" }).trim() })
|
|
408
410
|
})
|
|
409
411
|
});
|
|
410
412
|
}
|
|
411
413
|
function Je({ align: e, blockAlign: t, numeric: n, ref: r, sticky: i, stickyOffset: a, style: o, text: s, ...l }) {
|
|
412
414
|
let u = K(), d = u.value.length;
|
|
413
|
-
return /* @__PURE__ */
|
|
415
|
+
return /* @__PURE__ */ k("th", {
|
|
414
416
|
...l,
|
|
415
417
|
...J({
|
|
416
418
|
align: e,
|
|
@@ -423,11 +425,11 @@ function Je({ align: e, blockAlign: t, numeric: n, ref: r, sticky: i, stickyOffs
|
|
|
423
425
|
"data-part": "selection",
|
|
424
426
|
ref: r,
|
|
425
427
|
scope: "col",
|
|
426
|
-
children: /* @__PURE__ */
|
|
428
|
+
children: /* @__PURE__ */ k(c, {
|
|
427
429
|
checked: d > 0 && d === u.rows().length,
|
|
428
430
|
indeterminate: d > 0 && d < u.rows().length,
|
|
429
431
|
onCheckedChange: (e, t) => u.toggleSelectAll(t.source),
|
|
430
|
-
children: /* @__PURE__ */
|
|
432
|
+
children: /* @__PURE__ */ k(h, { children: u.t("selectAll", { count: d }) })
|
|
431
433
|
})
|
|
432
434
|
});
|
|
433
435
|
}
|
|
@@ -436,12 +438,12 @@ function Ye({ onClick: n, ref: r, value: i, ...a }) {
|
|
|
436
438
|
function u(e) {
|
|
437
439
|
n?.(e), !(e.defaultPrevented || c === void 0) && o.toggleExpanded(c, e);
|
|
438
440
|
}
|
|
439
|
-
return /* @__PURE__ */
|
|
441
|
+
return /* @__PURE__ */ k("button", {
|
|
440
442
|
...a,
|
|
441
443
|
"aria-controls": l ? s.detailId : void 0,
|
|
442
444
|
"aria-expanded": l,
|
|
443
445
|
"aria-label": a["aria-label"] ?? (l ? o.t("collapse") : o.t("expand")),
|
|
444
|
-
children: a.children ?? /* @__PURE__ */
|
|
446
|
+
children: a.children ?? /* @__PURE__ */ k(t, { children: /* @__PURE__ */ k(e, { name: "chevron-right" }) }),
|
|
445
447
|
"data-part": "expander",
|
|
446
448
|
onClick: u,
|
|
447
449
|
ref: r,
|
|
@@ -450,12 +452,12 @@ function Ye({ onClick: n, ref: r, value: i, ...a }) {
|
|
|
450
452
|
}
|
|
451
453
|
function Xe({ children: e, colSpan: t, ref: n, value: r, ...i }) {
|
|
452
454
|
let a = K();
|
|
453
|
-
return a.isExpanded(r) ? /* @__PURE__ */
|
|
455
|
+
return a.isExpanded(r) ? /* @__PURE__ */ k("tr", {
|
|
454
456
|
...i,
|
|
455
457
|
"data-part": "detail",
|
|
456
458
|
id: `${a.id}detail${r}`,
|
|
457
459
|
ref: n,
|
|
458
|
-
children: /* @__PURE__ */
|
|
460
|
+
children: /* @__PURE__ */ k("td", {
|
|
459
461
|
colSpan: t ?? a.columns,
|
|
460
462
|
"data-part": "cell",
|
|
461
463
|
children: e
|
|
@@ -464,21 +466,21 @@ function Xe({ children: e, colSpan: t, ref: n, value: r, ...i }) {
|
|
|
464
466
|
}
|
|
465
467
|
function Ze({ children: e, colSpan: t, end: n, ref: r, sticky: i, ...a }) {
|
|
466
468
|
let o = K();
|
|
467
|
-
return /* @__PURE__ */
|
|
469
|
+
return /* @__PURE__ */ k("tr", {
|
|
468
470
|
...a,
|
|
469
471
|
"data-part": "group-row",
|
|
470
472
|
...i === !0 ? { "data-sticky": "" } : {},
|
|
471
473
|
ref: r,
|
|
472
|
-
children: /* @__PURE__ */
|
|
474
|
+
children: /* @__PURE__ */ k("th", {
|
|
473
475
|
colSpan: t ?? o.columns,
|
|
474
476
|
"data-part": "group-header",
|
|
475
477
|
scope: "rowgroup",
|
|
476
|
-
children: /* @__PURE__ */
|
|
478
|
+
children: /* @__PURE__ */ A("div", {
|
|
477
479
|
"data-part": "group-content",
|
|
478
|
-
children: [/* @__PURE__ */
|
|
480
|
+
children: [/* @__PURE__ */ k("span", {
|
|
479
481
|
"data-part": "group-start",
|
|
480
482
|
children: e
|
|
481
|
-
}), n == null ? null : /* @__PURE__ */
|
|
483
|
+
}), n == null ? null : /* @__PURE__ */ k("span", {
|
|
482
484
|
"data-part": "group-end",
|
|
483
485
|
children: n
|
|
484
486
|
})]
|
|
@@ -488,7 +490,7 @@ function Ze({ children: e, colSpan: t, end: n, ref: r, sticky: i, ...a }) {
|
|
|
488
490
|
}
|
|
489
491
|
function Qe({ colSpan: e, ref: t, ...n }) {
|
|
490
492
|
let r = K();
|
|
491
|
-
return /* @__PURE__ */
|
|
493
|
+
return /* @__PURE__ */ k("td", {
|
|
492
494
|
...n,
|
|
493
495
|
colSpan: e ?? r.columns,
|
|
494
496
|
"data-part": "empty",
|
|
@@ -497,16 +499,16 @@ function Qe({ colSpan: e, ref: t, ...n }) {
|
|
|
497
499
|
}
|
|
498
500
|
function $e({ children: e, ref: t, skeletonRows: n, ...r }) {
|
|
499
501
|
let i = K();
|
|
500
|
-
return /* @__PURE__ */
|
|
502
|
+
return /* @__PURE__ */ k("tbody", {
|
|
501
503
|
...r,
|
|
502
504
|
"aria-hidden": !0,
|
|
503
505
|
"data-part": "loader",
|
|
504
506
|
ref: t,
|
|
505
|
-
children: e ?? Array.from({ length: n ?? 5 }, (e, t) => /* @__PURE__ */
|
|
507
|
+
children: e ?? Array.from({ length: n ?? 5 }, (e, t) => /* @__PURE__ */ k("tr", {
|
|
506
508
|
"data-part": "row",
|
|
507
|
-
children: Array.from({ length: i.columns }, (e, t) => /* @__PURE__ */
|
|
509
|
+
children: Array.from({ length: i.columns }, (e, t) => /* @__PURE__ */ k("td", {
|
|
508
510
|
"data-part": "cell",
|
|
509
|
-
children: /* @__PURE__ */
|
|
511
|
+
children: /* @__PURE__ */ k(l, {
|
|
510
512
|
inlineSize: "100%",
|
|
511
513
|
loading: !0
|
|
512
514
|
})
|
|
@@ -517,7 +519,7 @@ function $e({ children: e, ref: t, skeletonRows: n, ...r }) {
|
|
|
517
519
|
//#endregion
|
|
518
520
|
//#region src/table/table-filter.tsx
|
|
519
521
|
function et() {
|
|
520
|
-
return /* @__PURE__ */
|
|
522
|
+
return /* @__PURE__ */ k("svg", {
|
|
521
523
|
"aria-hidden": "true",
|
|
522
524
|
fill: "none",
|
|
523
525
|
stroke: "currentColor",
|
|
@@ -525,14 +527,14 @@ function et() {
|
|
|
525
527
|
strokeLinejoin: "round",
|
|
526
528
|
strokeWidth: "2",
|
|
527
529
|
viewBox: "0 0 24 24",
|
|
528
|
-
children: /* @__PURE__ */
|
|
530
|
+
children: /* @__PURE__ */ k("path", { d: "M22 3H2l8 9.46V19l4 2v-8.54L22 3z" })
|
|
529
531
|
});
|
|
530
532
|
}
|
|
531
533
|
function tt(e, t) {
|
|
532
534
|
return V(e) === V(t);
|
|
533
535
|
}
|
|
534
536
|
function Y({ body: e, kind: t, operandName: n, operators: i, props: a, rangeOperand: o, singleCondition: s }) {
|
|
535
|
-
let { align: c, collisionPadding: l, columnLabel: u, conditions: h = 2, defaultOpen: g, defaultOperator: _, defaultValue: ee, label: te, mount: ne, onOpenChange:
|
|
537
|
+
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: C, side: w, sideOffset: ue, value: T } = a, E = K(), j = Me(), M = de(), [pe, he] = D(ee ?? null), N = T === void 0 ? pe : T, ge = _ ?? be(t), P = () => Se(t, ge), [F, I] = D(N ?? P()), [_e, L] = D(!1), ve = x ?? _e, ye = fe(null), B = E.t, V = u ?? j ?? "", De = Ce(N), H = s ? 1 : h;
|
|
536
538
|
function U(e) {
|
|
537
539
|
me(ye.current?.ownerDocument).announce(e);
|
|
538
540
|
}
|
|
@@ -545,11 +547,11 @@ function Y({ body: e, kind: t, operandName: n, operators: i, props: a, rangeOper
|
|
|
545
547
|
controlled: T,
|
|
546
548
|
initial: N,
|
|
547
549
|
equals: tt,
|
|
548
|
-
onRequest: (e) =>
|
|
550
|
+
onRequest: (e) => y?.(e.value, e)
|
|
549
551
|
}).request(e, t, n) && he(e);
|
|
550
552
|
}
|
|
551
553
|
function Oe(e, t) {
|
|
552
|
-
x === void 0 && L(e),
|
|
554
|
+
x === void 0 && L(e), v?.(e, t), I(N ?? P());
|
|
553
555
|
}
|
|
554
556
|
let q = (e) => F.conditions[e] ?? { operator: ge }, ke = q(0), Ae = H === 2 && R(t, ke);
|
|
555
557
|
function je(e, t) {
|
|
@@ -586,10 +588,10 @@ function Y({ body: e, kind: t, operandName: n, operators: i, props: a, rangeOper
|
|
|
586
588
|
G(n, t, e), U(n ? B("filterApplied", {
|
|
587
589
|
column: V,
|
|
588
590
|
filter: xe(n, W)
|
|
589
|
-
}) : B("filterCleared", { column: V })), x === void 0 && L(!1),
|
|
591
|
+
}) : B("filterCleared", { column: V })), x === void 0 && L(!1), v?.(!1, e);
|
|
590
592
|
}
|
|
591
593
|
function Fe(e) {
|
|
592
|
-
I(P()), U(B("filterCleared", { column: V })), G(null, "clear", e), x === void 0 && L(!1),
|
|
594
|
+
I(P()), U(B("filterCleared", { column: V })), G(null, "clear", e), x === void 0 && L(!1), v?.(!1, e);
|
|
593
595
|
}
|
|
594
596
|
let Ie = te ?? (De ? B("filterApplied", {
|
|
595
597
|
column: V,
|
|
@@ -604,12 +606,12 @@ function Y({ body: e, kind: t, operandName: n, operators: i, props: a, rangeOper
|
|
|
604
606
|
operator: a.operator,
|
|
605
607
|
value: (e === 0 ? a.value : a.end) ?? null
|
|
606
608
|
});
|
|
607
|
-
return /* @__PURE__ */
|
|
609
|
+
return /* @__PURE__ */ A("div", {
|
|
608
610
|
"data-operands": s,
|
|
609
611
|
"data-part": "filter-condition",
|
|
610
|
-
children: [/* @__PURE__ */
|
|
612
|
+
children: [/* @__PURE__ */ k("div", {
|
|
611
613
|
"data-part": "filter-operator",
|
|
612
|
-
children: /* @__PURE__ */
|
|
614
|
+
children: /* @__PURE__ */ A(re, {
|
|
613
615
|
fullWidth: !0,
|
|
614
616
|
items: i.map((e) => ({
|
|
615
617
|
label: W.operator(e),
|
|
@@ -618,15 +620,15 @@ function Y({ body: e, kind: t, operandName: n, operators: i, props: a, rangeOper
|
|
|
618
620
|
onValueChange: (e) => je(r, e),
|
|
619
621
|
size: "sm",
|
|
620
622
|
value: a.operator,
|
|
621
|
-
children: [/* @__PURE__ */
|
|
623
|
+
children: [/* @__PURE__ */ k(oe, {
|
|
622
624
|
"aria-label": B("filterOperator"),
|
|
623
|
-
children: /* @__PURE__ */
|
|
624
|
-
}), /* @__PURE__ */
|
|
625
|
+
children: /* @__PURE__ */ k(se, {})
|
|
626
|
+
}), /* @__PURE__ */ k(ie, { children: i.map((e) => /* @__PURE__ */ k(ae, {
|
|
625
627
|
value: e,
|
|
626
628
|
children: W.operator(e)
|
|
627
629
|
}, e)) })]
|
|
628
630
|
})
|
|
629
|
-
}), s === 0 ? null : /* @__PURE__ */
|
|
631
|
+
}), s === 0 ? null : /* @__PURE__ */ k("div", {
|
|
630
632
|
"data-kind": t,
|
|
631
633
|
"data-part": "filter-operand",
|
|
632
634
|
...n === void 0 || C ? {} : { "data-operand": n },
|
|
@@ -642,7 +644,7 @@ function Y({ body: e, kind: t, operandName: n, operators: i, props: a, rangeOper
|
|
|
642
644
|
})]
|
|
643
645
|
}, r);
|
|
644
646
|
}
|
|
645
|
-
return /* @__PURE__ */
|
|
647
|
+
return /* @__PURE__ */ A(p, {
|
|
646
648
|
onOpenChange: (e, t) => Oe(e, t),
|
|
647
649
|
open: ve,
|
|
648
650
|
...c === void 0 ? {} : { align: c },
|
|
@@ -652,53 +654,53 @@ function Y({ body: e, kind: t, operandName: n, operators: i, props: a, rangeOper
|
|
|
652
654
|
...S === void 0 ? {} : { portal: S },
|
|
653
655
|
...w === void 0 ? {} : { side: w },
|
|
654
656
|
...ue === void 0 ? {} : { sideOffset: ue },
|
|
655
|
-
children: [/* @__PURE__ */
|
|
657
|
+
children: [/* @__PURE__ */ k(f, { render: (e) => /* @__PURE__ */ k("button", {
|
|
656
658
|
...e,
|
|
657
659
|
"aria-label": Ie,
|
|
658
660
|
"data-part": "filter",
|
|
659
661
|
...De ? { "data-filtered": "" } : {},
|
|
660
662
|
type: "button",
|
|
661
|
-
children: /* @__PURE__ */
|
|
662
|
-
}) }), /* @__PURE__ */
|
|
663
|
+
children: /* @__PURE__ */ k(et, {})
|
|
664
|
+
}) }), /* @__PURE__ */ k(m, { children: /* @__PURE__ */ k(d, {
|
|
663
665
|
"aria-label": Ie,
|
|
664
|
-
children: /* @__PURE__ */
|
|
666
|
+
children: /* @__PURE__ */ A("div", {
|
|
665
667
|
"data-kind": t,
|
|
666
668
|
"data-part": "filter-panel",
|
|
667
669
|
"data-ui": "table",
|
|
668
|
-
id:
|
|
670
|
+
id: M,
|
|
669
671
|
ref: ye,
|
|
670
672
|
children: [
|
|
671
673
|
Le(0),
|
|
672
|
-
Ae ? /* @__PURE__ */
|
|
674
|
+
Ae ? /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ A("div", {
|
|
673
675
|
"data-part": "filter-join",
|
|
674
|
-
children: [/* @__PURE__ */
|
|
676
|
+
children: [/* @__PURE__ */ k("span", {
|
|
675
677
|
"data-label": "",
|
|
676
678
|
children: B("filterJoin")
|
|
677
|
-
}), /* @__PURE__ */
|
|
679
|
+
}), /* @__PURE__ */ A(ce, {
|
|
678
680
|
"aria-label": B("filterJoin"),
|
|
679
681
|
onValueChange: (e) => I(Ee(F, e)),
|
|
680
682
|
orientation: "horizontal",
|
|
681
683
|
size: "sm",
|
|
682
684
|
value: F.join,
|
|
683
|
-
children: [/* @__PURE__ */
|
|
685
|
+
children: [/* @__PURE__ */ k(b, {
|
|
684
686
|
value: "and",
|
|
685
687
|
children: W.join("and")
|
|
686
|
-
}), /* @__PURE__ */
|
|
688
|
+
}), /* @__PURE__ */ k(b, {
|
|
687
689
|
value: "or",
|
|
688
690
|
children: W.join("or")
|
|
689
691
|
})]
|
|
690
692
|
})]
|
|
691
693
|
}), Le(1)] }) : null,
|
|
692
|
-
/* @__PURE__ */
|
|
694
|
+
/* @__PURE__ */ A("div", {
|
|
693
695
|
"data-part": "filter-actions",
|
|
694
|
-
children: [/* @__PURE__ */
|
|
696
|
+
children: [/* @__PURE__ */ k(r, {
|
|
695
697
|
disabled: !Ce(F),
|
|
696
698
|
onClick: (e) => Fe(e),
|
|
697
699
|
size: "sm",
|
|
698
700
|
tone: "secondary",
|
|
699
701
|
variant: "ghost",
|
|
700
702
|
children: B("filterClear")
|
|
701
|
-
}), /* @__PURE__ */
|
|
703
|
+
}), /* @__PURE__ */ k(r, {
|
|
702
704
|
onClick: (e) => Pe(e, "pointer"),
|
|
703
705
|
size: "sm",
|
|
704
706
|
children: B("filterApply")
|
|
@@ -718,8 +720,8 @@ function Z(e, t) {
|
|
|
718
720
|
return t ?? B(e);
|
|
719
721
|
}
|
|
720
722
|
function nt(e) {
|
|
721
|
-
return /* @__PURE__ */
|
|
722
|
-
body: ({ apply: e, condition: t, setOperand: n, t: r }) => /* @__PURE__ */
|
|
723
|
+
return /* @__PURE__ */ k(Y, {
|
|
724
|
+
body: ({ apply: e, condition: t, setOperand: n, t: r }) => /* @__PURE__ */ k(u, {
|
|
723
725
|
"aria-label": r("filterValue"),
|
|
724
726
|
onChange: (e) => n(0, e.target.value),
|
|
725
727
|
onKeyDown: X(e),
|
|
@@ -735,8 +737,8 @@ function nt(e) {
|
|
|
735
737
|
}
|
|
736
738
|
function rt(e) {
|
|
737
739
|
let { format: t, locale: n, step: r } = e;
|
|
738
|
-
return /* @__PURE__ */
|
|
739
|
-
body: ({ apply: e, condition: i, setOperand: a, t: o }) => /* @__PURE__ */
|
|
740
|
+
return /* @__PURE__ */ k(Y, {
|
|
741
|
+
body: ({ apply: e, condition: i, setOperand: a, t: o }) => /* @__PURE__ */ k(O, { children: [0, 1].slice(0, z(i.operator)).map((s) => /* @__PURE__ */ k(ne, {
|
|
740
742
|
"aria-label": z(i.operator) === 2 ? o(s === 0 ? "filterFrom" : "filterTo") : o("filterValue"),
|
|
741
743
|
onKeyDown: X(e),
|
|
742
744
|
onValueChange: (e) => a(s, e),
|
|
@@ -755,8 +757,8 @@ function rt(e) {
|
|
|
755
757
|
}
|
|
756
758
|
function it(e) {
|
|
757
759
|
let { locale: t, max: n, min: r, presets: i } = e, a = (e) => e ? P(String(e)) : null, o = (e) => he(e) ? _e(e) : null;
|
|
758
|
-
return /* @__PURE__ */
|
|
759
|
-
body: ({ apply: e, condition: s, setOperand: c, setOperands: l, t: u }) => z(s.operator) === 2 ? /* @__PURE__ */
|
|
760
|
+
return /* @__PURE__ */ k(Y, {
|
|
761
|
+
body: ({ apply: e, condition: s, setOperand: c, setOperands: l, t: u }) => z(s.operator) === 2 ? /* @__PURE__ */ k(_, {
|
|
760
762
|
messages: {
|
|
761
763
|
end: u("filterTo"),
|
|
762
764
|
start: u("filterFrom")
|
|
@@ -772,7 +774,7 @@ function it(e) {
|
|
|
772
774
|
...a(r) ? { min: a(r) } : {},
|
|
773
775
|
...a(n) ? { max: a(n) } : {},
|
|
774
776
|
...i === void 0 ? {} : { presets: i }
|
|
775
|
-
}) : /* @__PURE__ */
|
|
777
|
+
}) : /* @__PURE__ */ k(g, {
|
|
776
778
|
"aria-label": u("filterValue"),
|
|
777
779
|
onKeyDown: X(e),
|
|
778
780
|
onValueChange: (e) => c(0, o(e)),
|
|
@@ -809,8 +811,8 @@ function at(e) {
|
|
|
809
811
|
...Q(a) ? { min: Q(a) } : {},
|
|
810
812
|
...Q(i) ? { max: Q(i) } : {}
|
|
811
813
|
};
|
|
812
|
-
return /* @__PURE__ */
|
|
813
|
-
body: ({ apply: e, condition: t, setOperand: n, setOperands: r, t: i }) => z(t.operator) === 2 ? /* @__PURE__ */
|
|
814
|
+
return /* @__PURE__ */ k(Y, {
|
|
815
|
+
body: ({ apply: e, condition: t, setOperand: n, setOperands: r, t: i }) => z(t.operator) === 2 ? /* @__PURE__ */ k(y, {
|
|
814
816
|
messages: {
|
|
815
817
|
start: i("filterFrom"),
|
|
816
818
|
end: i("filterTo")
|
|
@@ -823,7 +825,7 @@ function at(e) {
|
|
|
823
825
|
},
|
|
824
826
|
...u,
|
|
825
827
|
...s === void 0 ? {} : { presets: s }
|
|
826
|
-
}) : /* @__PURE__ */
|
|
828
|
+
}) : /* @__PURE__ */ k(v, {
|
|
827
829
|
"aria-label": i("filterValue"),
|
|
828
830
|
onKeyDown: X(e),
|
|
829
831
|
onValueChange: (e) => n(0, l(e)),
|
|
@@ -848,8 +850,8 @@ function ot(e) {
|
|
|
848
850
|
...$(a) ? { min: $(a) } : {},
|
|
849
851
|
...$(i) ? { max: $(i) } : {}
|
|
850
852
|
};
|
|
851
|
-
return /* @__PURE__ */
|
|
852
|
-
body: ({ apply: e, condition: t, setOperand: n, setOperands: r, t: i }) => z(t.operator) === 2 ? /* @__PURE__ */
|
|
853
|
+
return /* @__PURE__ */ k(Y, {
|
|
854
|
+
body: ({ apply: e, condition: t, setOperand: n, setOperands: r, t: i }) => z(t.operator) === 2 ? /* @__PURE__ */ k(te, {
|
|
853
855
|
messages: {
|
|
854
856
|
start: i("filterFrom"),
|
|
855
857
|
end: i("filterTo")
|
|
@@ -862,7 +864,7 @@ function ot(e) {
|
|
|
862
864
|
},
|
|
863
865
|
...u,
|
|
864
866
|
...o === void 0 ? {} : { presets: o }
|
|
865
|
-
}) : /* @__PURE__ */
|
|
867
|
+
}) : /* @__PURE__ */ k(ee, {
|
|
866
868
|
"aria-label": i("filterValue"),
|
|
867
869
|
onKeyDown: X(e),
|
|
868
870
|
onValueChange: (e) => n(0, l(e)),
|
|
@@ -878,17 +880,17 @@ function ot(e) {
|
|
|
878
880
|
});
|
|
879
881
|
}
|
|
880
882
|
function st(e) {
|
|
881
|
-
return /* @__PURE__ */
|
|
882
|
-
body: ({ condition: e, setOperand: t, t: n }) => /* @__PURE__ */
|
|
883
|
+
return /* @__PURE__ */ k(Y, {
|
|
884
|
+
body: ({ condition: e, setOperand: t, t: n }) => /* @__PURE__ */ A(ce, {
|
|
883
885
|
"aria-label": n("filterValue"),
|
|
884
886
|
onValueChange: (e) => t(0, e === "true"),
|
|
885
887
|
orientation: "horizontal",
|
|
886
888
|
size: "sm",
|
|
887
889
|
value: e.value === void 0 || e.value === null ? "" : String(e.value),
|
|
888
|
-
children: [/* @__PURE__ */
|
|
890
|
+
children: [/* @__PURE__ */ k(b, {
|
|
889
891
|
value: "true",
|
|
890
892
|
children: n("true")
|
|
891
|
-
}), /* @__PURE__ */
|
|
893
|
+
}), /* @__PURE__ */ k(b, {
|
|
892
894
|
value: "false",
|
|
893
895
|
children: n("false")
|
|
894
896
|
})]
|
|
@@ -901,14 +903,14 @@ function st(e) {
|
|
|
901
903
|
}
|
|
902
904
|
function ct(e) {
|
|
903
905
|
let { operand: t = "list", options: n = [], searchThreshold: r = 8, searchable: i } = e;
|
|
904
|
-
return /* @__PURE__ */
|
|
905
|
-
body: ({ announce: e, apply: a, condition: o, setOperand: s, t: c }) => t === "tags" ? /* @__PURE__ */
|
|
906
|
+
return /* @__PURE__ */ k(Y, {
|
|
907
|
+
body: ({ announce: e, apply: a, condition: o, setOperand: s, t: c }) => t === "tags" ? /* @__PURE__ */ k(lt, {
|
|
906
908
|
apply: a,
|
|
907
909
|
chosen: o.value ?? [],
|
|
908
910
|
onChange: (e) => s(0, e),
|
|
909
911
|
options: n,
|
|
910
912
|
t: c
|
|
911
|
-
}) : /* @__PURE__ */
|
|
913
|
+
}) : /* @__PURE__ */ k(ut, {
|
|
912
914
|
announce: e,
|
|
913
915
|
chosen: o.value ?? [],
|
|
914
916
|
onChange: (e) => s(0, e),
|
|
@@ -926,7 +928,7 @@ function ct(e) {
|
|
|
926
928
|
}
|
|
927
929
|
function lt({ apply: e, chosen: t, onChange: n, options: r, t: i }) {
|
|
928
930
|
let a = de(), o = E(() => new Map(r.map((e) => [e.value, e])), [r]), s = r.length > 0;
|
|
929
|
-
return /* @__PURE__ */
|
|
931
|
+
return /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ k(x, {
|
|
930
932
|
"aria-label": i("filterValue"),
|
|
931
933
|
formatLabel: (e) => o.get(e)?.label ?? e,
|
|
932
934
|
fullWidth: !0,
|
|
@@ -941,19 +943,19 @@ function lt({ apply: e, chosen: t, onChange: n, options: r, t: i }) {
|
|
|
941
943
|
list: `${a}-options`,
|
|
942
944
|
validate: (e) => o.has(e)
|
|
943
945
|
} : {}
|
|
944
|
-
}), s ? /* @__PURE__ */
|
|
946
|
+
}), s ? /* @__PURE__ */ k("datalist", {
|
|
945
947
|
id: `${a}-options`,
|
|
946
|
-
children: r.map((e) => /* @__PURE__ */
|
|
948
|
+
children: r.map((e) => /* @__PURE__ */ k("option", {
|
|
947
949
|
value: e.value,
|
|
948
950
|
children: e.label ?? e.value
|
|
949
951
|
}, e.value))
|
|
950
952
|
}) : null] });
|
|
951
953
|
}
|
|
952
954
|
function ut({ announce: e, chosen: t, onChange: n, options: r, searchThreshold: i, searchable: a, t: o }) {
|
|
953
|
-
let s = de(), [l, d] =
|
|
954
|
-
return /* @__PURE__ */
|
|
955
|
+
let s = de(), [l, d] = D(""), f = E(() => ve({ 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;
|
|
956
|
+
return /* @__PURE__ */ A(O, { children: [g ? /* @__PURE__ */ k("div", {
|
|
955
957
|
"data-part": "filter-search",
|
|
956
|
-
children: /* @__PURE__ */
|
|
958
|
+
children: /* @__PURE__ */ k(u, {
|
|
957
959
|
"aria-controls": `${s}-list`,
|
|
958
960
|
"aria-label": o("filterSearch"),
|
|
959
961
|
clearable: !0,
|
|
@@ -965,16 +967,16 @@ function ut({ announce: e, chosen: t, onChange: n, options: r, searchThreshold:
|
|
|
965
967
|
size: "sm",
|
|
966
968
|
value: l
|
|
967
969
|
})
|
|
968
|
-
}) : null, m.length === 0 ? /* @__PURE__ */
|
|
970
|
+
}) : null, m.length === 0 ? /* @__PURE__ */ k("p", {
|
|
969
971
|
"data-part": "filter-empty",
|
|
970
972
|
children: o("filterEmpty")
|
|
971
|
-
}) : /* @__PURE__ */
|
|
973
|
+
}) : /* @__PURE__ */ A("div", {
|
|
972
974
|
"data-part": "filter-list",
|
|
973
975
|
id: `${s}-list`,
|
|
974
|
-
children: [/* @__PURE__ */
|
|
976
|
+
children: [/* @__PURE__ */ A("div", {
|
|
975
977
|
"data-covering": "",
|
|
976
978
|
"data-part": "filter-option",
|
|
977
|
-
children: [/* @__PURE__ */
|
|
979
|
+
children: [/* @__PURE__ */ k(c, {
|
|
978
980
|
checked: h.length > 0 && h.length === m.length,
|
|
979
981
|
indeterminate: h.length > 0 && h.length < m.length,
|
|
980
982
|
onCheckedChange: (e) => {
|
|
@@ -982,17 +984,17 @@ function ut({ announce: e, chosen: t, onChange: n, options: r, searchThreshold:
|
|
|
982
984
|
n(e ? [.../* @__PURE__ */ new Set([...t, ...r])] : t.filter((e) => !r.includes(e)));
|
|
983
985
|
},
|
|
984
986
|
children: o("filterSelectAll")
|
|
985
|
-
}), /* @__PURE__ */
|
|
987
|
+
}), /* @__PURE__ */ k("span", {
|
|
986
988
|
"data-count": "",
|
|
987
989
|
children: m.length
|
|
988
990
|
})]
|
|
989
|
-
}), m.map((e) => /* @__PURE__ */
|
|
991
|
+
}), m.map((e) => /* @__PURE__ */ A("div", {
|
|
990
992
|
"data-part": "filter-option",
|
|
991
|
-
children: [/* @__PURE__ */
|
|
993
|
+
children: [/* @__PURE__ */ k(c, {
|
|
992
994
|
checked: t.includes(e.value),
|
|
993
995
|
onCheckedChange: (r) => n(r ? [...t, e.value] : t.filter((t) => t !== e.value)),
|
|
994
996
|
children: e.label ?? e.value
|
|
995
|
-
}), e.count === void 0 ? null : /* @__PURE__ */
|
|
997
|
+
}), e.count === void 0 ? null : /* @__PURE__ */ k("span", {
|
|
996
998
|
"data-count": "",
|
|
997
999
|
children: e.count
|
|
998
1000
|
})]
|