@slotted/react 0.1.0-beta.37 → 0.1.0-beta.38
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/calendar-CE3aMhdR.js +568 -0
- package/dist/calendar.js +1 -1
- package/dist/{data-grid-C5YmAqdN.js → data-grid-BKuD1dvr.js} +4 -4
- package/dist/data-grid.js +1 -1
- package/dist/{date-picker-DQbj3FON.js → date-picker-CF3WQxYe.js} +1 -1
- package/dist/date-picker.js +1 -1
- package/dist/{date-range-picker-B16hMhJf.js → date-range-picker-CvFs-nHN.js} +1 -1
- package/dist/date-range-picker.js +1 -1
- package/dist/{datetime-picker-C9pxH7Xf.js → datetime-picker-lWc4HT6a.js} +1 -1
- package/dist/datetime-picker.js +1 -1
- package/dist/{datetime-range-picker-Cmn7o_Qv.js → datetime-range-picker-ynZUZreq.js} +1 -1
- package/dist/datetime-range-picker.js +1 -1
- package/dist/docs/calendar.json +42 -2
- package/dist/docs/calendar.md +7 -1
- package/dist/docs/message.json +15 -0
- package/dist/docs/message.md +2 -1
- package/dist/docs/table.json +12 -0
- package/dist/docs/table.md +2 -0
- package/dist/{filter-bar-Cfwk-3Eu.js → filter-bar-DUXtlPRn.js} +2 -2
- package/dist/filter-bar.js +1 -1
- package/dist/{import-export-center-BH1bNw_E.js → import-export-center-D0ckqmhq.js} +1 -1
- package/dist/import-export-center.js +1 -1
- package/dist/index.js +39 -39
- package/dist/{message-CdcUyh3g.js → message-D1Dd6Y2k.js} +6 -5
- package/dist/message.js +1 -1
- package/dist/roving-focus-BXshJYlW.js +149 -0
- package/dist/roving-focus.js +2 -2
- package/dist/styles/calendar.css +1 -1
- package/dist/styles/data-grid.css +1 -1
- package/dist/styles/date-picker.css +1 -1
- package/dist/styles/date-range-picker.css +1 -1
- package/dist/styles/datetime-picker.css +1 -1
- package/dist/styles/datetime-range-picker.css +1 -1
- package/dist/styles/filter-bar.css +1 -1
- package/dist/styles/import-export-center.css +2 -2
- package/dist/styles/index.css +3 -3
- package/dist/styles/message.css +1 -1
- package/dist/styles/table.css +2 -2
- package/dist/styles.css +1 -1
- package/dist/{table-CnXBp9j9.js → table-B04FiwYZ.js} +353 -351
- package/dist/table.js +1 -1
- package/dist/types/calendar/calendar-day-cell.d.ts +30 -0
- package/dist/types/calendar/calendar-day-cell.d.ts.map +1 -0
- package/dist/types/calendar/calendar-month-table.d.ts +18 -0
- package/dist/types/calendar/calendar-month-table.d.ts.map +1 -0
- package/dist/types/calendar/calendar-periods.d.ts +24 -0
- package/dist/types/calendar/calendar-periods.d.ts.map +1 -0
- 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 +23 -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/message/message-parts.d.ts +1 -1
- package/dist/types/message/message-parts.d.ts.map +1 -1
- package/dist/types/message/message.types.d.ts +2 -0
- package/dist/types/message/message.types.d.ts.map +1 -1
- package/dist/types/roving-focus/index.d.ts +2 -0
- package/dist/types/roving-focus/index.d.ts.map +1 -1
- package/dist/types/roving-focus/roving-grid.d.ts +27 -0
- package/dist/types/roving-focus/roving-grid.d.ts.map +1 -0
- 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 +10 -0
- package/dist/types/table/table.types.d.ts.map +1 -1
- package/package.json +6 -6
- package/dist/calendar-D8FhdXWc.js +0 -537
- package/dist/roving-focus-C5-rVFzI.js +0 -89
|
@@ -7,42 +7,43 @@ import { i as l } from "./skeleton-DeEOmm1y.js";
|
|
|
7
7
|
import { t as u } from "./text-field-Cnjc7LB5.js";
|
|
8
8
|
import { a as d, d as f, f as p, l as m } from "./popover-BfEn2wdZ.js";
|
|
9
9
|
import { t as h } from "./visually-hidden-BUSrFZ1_.js";
|
|
10
|
-
import { t as g } from "./date-picker-
|
|
11
|
-
import { t as _ } from "./date-range-picker-
|
|
12
|
-
import { t as
|
|
13
|
-
import { t as
|
|
10
|
+
import { t as g } from "./date-picker-CF3WQxYe.js";
|
|
11
|
+
import { t as _ } from "./date-range-picker-CvFs-nHN.js";
|
|
12
|
+
import { t as ee } from "./datetime-picker-lWc4HT6a.js";
|
|
13
|
+
import { t as v } from "./datetime-range-picker-ynZUZreq.js";
|
|
14
14
|
import { t as y } from "./number-field-BJKoidAE.js";
|
|
15
15
|
import { c as te, i as ne, n as re, o as ie, s as ae } from "./select-BkUuIVBK.js";
|
|
16
16
|
import { t as oe } from "./time-picker-B4-GsO24.js";
|
|
17
|
-
import { t as
|
|
18
|
-
import { n 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
|
|
29
|
-
import { placeholderWidth as
|
|
30
|
-
import { getLiveAnnouncer as
|
|
31
|
-
import { isPlainDate as
|
|
32
|
-
import { defaultOperator as
|
|
33
|
-
import { observeTreeBranches as
|
|
17
|
+
import { t as se } from "./time-range-picker-DVOWN8PF.js";
|
|
18
|
+
import { n as b, t as x } from "./radio-group-_ZRUgcI5.js";
|
|
19
|
+
import { t as S } from "./tags-input-O87zTh7h.js";
|
|
20
|
+
import { keyedProps as C, withSelectorKey as w } from "@slotted/core/selector-key";
|
|
21
|
+
import { createFocusOrigin as T } from "@slotted/core/focus";
|
|
22
|
+
import { createControllable as ce } from "@slotted/core/state";
|
|
23
|
+
import { createContext as E, useCallback as le, useContext as D, useEffect as ue, useId as de, useImperativeHandle as fe, useLayoutEffect as pe, useMemo as O, useRef as k, useState as A } from "react";
|
|
24
|
+
import { Fragment as j, jsx as M, jsxs as N } from "react/jsx-runtime";
|
|
25
|
+
import { createScrollAffordance as P } from "@slotted/core/overflow";
|
|
26
|
+
import { tableMessages as F } from "@slotted/core/i18n";
|
|
27
|
+
import { createFilter as I, nextSelection as me } from "@slotted/core/collection";
|
|
28
|
+
import { isRowAction as L } from "@slotted/core/pointer-intent";
|
|
29
|
+
import { placeholderWidth as R } from "@slotted/core/loading";
|
|
30
|
+
import { getLiveAnnouncer as he } from "@slotted/core/live-announcer";
|
|
31
|
+
import { isPlainDate as ge, isPlainDateTime as _e, isPlainTime as z, parseISODate as ve, parseISODateTime as B, parseISOTime as V, toISODate as ye, toISOTime as H } from "@slotted/core/date";
|
|
32
|
+
import { defaultOperator as be, describeFilter as xe, emptyFilter as Se, isConditionActive as U, isFilterActive as Ce, normalizeFilter as we, operandCount as W, operatorsFor as G, serializeFilter as K, withCondition as Te, withJoin as Ee } from "@slotted/core/filter";
|
|
33
|
+
import { observeTreeBranches as De } from "@slotted/core/tree-branches";
|
|
34
34
|
//#region src/table/table-defaults.tsx
|
|
35
|
-
var
|
|
36
|
-
function
|
|
37
|
-
return
|
|
35
|
+
var Oe = E({});
|
|
36
|
+
function q() {
|
|
37
|
+
return D(Oe);
|
|
38
38
|
}
|
|
39
|
-
function
|
|
40
|
-
let n =
|
|
41
|
-
return /* @__PURE__ */
|
|
39
|
+
function ke({ children: e, ...t }) {
|
|
40
|
+
let n = q();
|
|
41
|
+
return /* @__PURE__ */ M(Oe.Provider, {
|
|
42
42
|
value: {
|
|
43
43
|
cellAlign: t.cellAlign ?? n.cellAlign,
|
|
44
44
|
columns: t.columns ?? n.columns,
|
|
45
45
|
edges: t.edges ?? n.edges,
|
|
46
|
+
expanderRoom: t.expanderRoom ?? n.expanderRoom,
|
|
46
47
|
guides: t.guides ?? n.guides,
|
|
47
48
|
layout: t.layout ?? n.layout,
|
|
48
49
|
selectionMode: t.selectionMode ?? n.selectionMode,
|
|
@@ -57,137 +58,138 @@ function Oe({ children: e, ...t }) {
|
|
|
57
58
|
}
|
|
58
59
|
//#endregion
|
|
59
60
|
//#region src/table/table.tsx
|
|
60
|
-
var
|
|
61
|
-
function
|
|
62
|
-
let e =
|
|
61
|
+
var Ae = "[data-part=\"body\"] > [data-part=\"row\"][data-value]", je = E(void 0);
|
|
62
|
+
function J() {
|
|
63
|
+
let e = D(je);
|
|
63
64
|
if (e === void 0) throw Error("Every Table part must be rendered inside Table.");
|
|
64
65
|
return e;
|
|
65
66
|
}
|
|
66
|
-
function
|
|
67
|
-
return
|
|
67
|
+
function Me() {
|
|
68
|
+
return D(je);
|
|
68
69
|
}
|
|
69
|
-
function
|
|
70
|
-
let b =
|
|
70
|
+
function Ne({ children: t, columns: n, defaultExpanded: r, defaultSort: i, defaultValue: a, edges: o, expanded: s, expanderRoom: c, guides: l, layout: u, loading: d, messages: f, onExpandedChange: p, onSortChange: m, onValueChange: h, ref: g, render: _, selectionMode: ee, sort: v, cellAlign: y, stickyFooter: te, stickyHeader: ne, stickyTo: re, striped: ie, value: ae, variant: oe, ...se }) {
|
|
71
|
+
let b = q(), x = e(F, f), S = de(), [w, T] = A(i ?? null), [E, D] = A(a ?? []), [ue, fe] = A(r ?? []), O = k(null), j = k(void 0), N = k(/* @__PURE__ */ new Map()), P = v === void 0 ? w : v, I = ae ?? E, L = s ?? ue, R = n ?? b.columns ?? 1, ge = o ?? b.edges ?? "inset", _e = c ?? b.expanderRoom ?? "auto", z = l ?? b.guides ?? !0, ve = u ?? b.layout ?? "auto", B = ee ?? b.selectionMode ?? "none", V = (ne ?? b.stickyHeader ?? !1) === !0, ye = (te ?? b.stickyFooter ?? !1) === !0, H = y ?? b.cellAlign ?? "center", be = re ?? b.stickyTo ?? "scroll", xe = (ie ?? b.striped ?? !1) === !0, Se = oe ?? b.variant ?? "ruled";
|
|
71
72
|
pe(() => {
|
|
72
|
-
if (
|
|
73
|
-
}, [
|
|
74
|
-
let
|
|
75
|
-
|
|
76
|
-
}, [
|
|
77
|
-
function
|
|
78
|
-
|
|
79
|
-
controlled:
|
|
80
|
-
initial:
|
|
73
|
+
if (z === "branch" && O.current !== null) return De(O.current);
|
|
74
|
+
}, [z]);
|
|
75
|
+
let U = le((e) => {
|
|
76
|
+
O.current = e, typeof g == "function" ? g(e) : g != null && (g.current = e);
|
|
77
|
+
}, [g]), Ce = le(() => [...O.current?.querySelectorAll("[data-part=\"body\"] > [data-part=\"row\"][data-value]") ?? []].filter((e) => !e.hasAttribute("data-disabled")).map((e) => e.getAttribute("data-value") ?? ""), []);
|
|
78
|
+
function we(e, t, n) {
|
|
79
|
+
ce({
|
|
80
|
+
controlled: ae,
|
|
81
|
+
initial: I,
|
|
81
82
|
equals: (e, t) => e.length === t.length && e.every((e, n) => e === t[n]),
|
|
82
|
-
onRequest: (e) =>
|
|
83
|
-
}).request(e, t, n) &&
|
|
83
|
+
onRequest: (e) => h?.(e.value, e)
|
|
84
|
+
}).request(e, t, n) && D(e);
|
|
84
85
|
}
|
|
85
|
-
let
|
|
86
|
-
columns:
|
|
87
|
-
expanded:
|
|
88
|
-
id:
|
|
89
|
-
isExpanded: (e) =>
|
|
86
|
+
let W = {
|
|
87
|
+
columns: R,
|
|
88
|
+
expanded: L,
|
|
89
|
+
id: S,
|
|
90
|
+
isExpanded: (e) => L.includes(e),
|
|
90
91
|
isOpenBranch(e) {
|
|
91
92
|
let t = /* @__PURE__ */ new Set();
|
|
92
|
-
for (let n = e; n !== void 0; n =
|
|
93
|
-
if (t.has(n) || !
|
|
93
|
+
for (let n = e; n !== void 0; n = N.current.get(n)) {
|
|
94
|
+
if (t.has(n) || !L.includes(n)) return !1;
|
|
94
95
|
t.add(n);
|
|
95
96
|
}
|
|
96
97
|
return !0;
|
|
97
98
|
},
|
|
98
|
-
registerParent: (e, t) => void
|
|
99
|
-
isSelected: (e) =>
|
|
100
|
-
loading:
|
|
101
|
-
rows:
|
|
99
|
+
registerParent: (e, t) => void N.current.set(e, t),
|
|
100
|
+
isSelected: (e) => I.includes(e),
|
|
101
|
+
loading: d === !0,
|
|
102
|
+
rows: Ce,
|
|
102
103
|
requestSort(e, t) {
|
|
103
|
-
let n =
|
|
104
|
+
let n = P?.column === e ? P.direction === "ascending" ? {
|
|
104
105
|
column: e,
|
|
105
106
|
direction: "descending"
|
|
106
107
|
} : null : {
|
|
107
108
|
column: e,
|
|
108
109
|
direction: "ascending"
|
|
109
|
-
}, r =
|
|
110
|
+
}, r = ce({
|
|
110
111
|
controlled: v,
|
|
111
|
-
initial:
|
|
112
|
+
initial: P,
|
|
112
113
|
equals: (e, t) => e?.column === t?.column && e?.direction === t?.direction,
|
|
113
|
-
onRequest: (e) =>
|
|
114
|
+
onRequest: (e) => m?.(e.value, e)
|
|
114
115
|
}), i = n === null ? "clear" : "pointer", a = r.request(n, i, t), o = t?.currentTarget?.textContent?.trim() ?? e, s = n === null ? x("sortCleared", { column: o }) : n.direction === "ascending" ? x("sortedAscending", { column: o }) : x("sortedDescending", { column: o });
|
|
115
|
-
|
|
116
|
+
he(O.current?.ownerDocument).announce(s), a && T(n);
|
|
116
117
|
},
|
|
117
|
-
selectionMode:
|
|
118
|
-
sort:
|
|
119
|
-
stickyTo:
|
|
118
|
+
selectionMode: B,
|
|
119
|
+
sort: P,
|
|
120
|
+
stickyTo: be,
|
|
120
121
|
toggleExpanded(e, t) {
|
|
121
|
-
let n =
|
|
122
|
-
|
|
122
|
+
let n = L.includes(e) ? L.filter((t) => t !== e) : [...L, e];
|
|
123
|
+
ce({
|
|
123
124
|
controlled: s,
|
|
124
|
-
initial:
|
|
125
|
+
initial: L,
|
|
125
126
|
equals: (e, t) => e.length === t.length && e.every((e, n) => e === t[n]),
|
|
126
|
-
onRequest: (e) =>
|
|
127
|
-
}).request(n, "pointer", t) &&
|
|
127
|
+
onRequest: (e) => p?.(e.value, e)
|
|
128
|
+
}).request(n, "pointer", t) && fe(n);
|
|
128
129
|
},
|
|
129
130
|
toggleSelected(e, { range: t, source: n }) {
|
|
130
|
-
let r =
|
|
131
|
-
action: t &&
|
|
132
|
-
anchor:
|
|
131
|
+
let r = me({
|
|
132
|
+
action: t && B === "multiple" ? "range" : "toggle",
|
|
133
|
+
anchor: j.current,
|
|
133
134
|
behavior: "toggle",
|
|
134
135
|
key: e,
|
|
135
|
-
keys:
|
|
136
|
-
mode:
|
|
137
|
-
selected:
|
|
136
|
+
keys: Ce(),
|
|
137
|
+
mode: B,
|
|
138
|
+
selected: I
|
|
138
139
|
});
|
|
139
|
-
t || (
|
|
140
|
+
t || (j.current = e), we(r.selected, t ? "select" : "pointer", n);
|
|
140
141
|
},
|
|
141
142
|
toggleSelectAll(e) {
|
|
142
|
-
let t =
|
|
143
|
+
let t = me({
|
|
143
144
|
action: "all",
|
|
144
|
-
keys:
|
|
145
|
-
mode:
|
|
146
|
-
selected:
|
|
145
|
+
keys: Ce(),
|
|
146
|
+
mode: B,
|
|
147
|
+
selected: I
|
|
147
148
|
});
|
|
148
|
-
|
|
149
|
+
we(t.selected, t.selected.length === 0 ? "clear" : "select", e);
|
|
149
150
|
},
|
|
150
151
|
t: x,
|
|
151
|
-
value:
|
|
152
|
-
},
|
|
153
|
-
...
|
|
152
|
+
value: I
|
|
153
|
+
}, G = C({
|
|
154
|
+
...se,
|
|
154
155
|
children: t,
|
|
155
|
-
"data-cell-align":
|
|
156
|
-
"data-edges":
|
|
157
|
-
...
|
|
158
|
-
"data-
|
|
159
|
-
|
|
156
|
+
"data-cell-align": H,
|
|
157
|
+
"data-edges": ge,
|
|
158
|
+
..._e === "always" ? { "data-expander-room": "always" } : {},
|
|
159
|
+
...z === !0 ? {} : { "data-guides": String(z) },
|
|
160
|
+
"data-layout": ve,
|
|
161
|
+
...d === !0 ? { "data-loading": "" } : {},
|
|
160
162
|
"data-part": "root",
|
|
161
|
-
...
|
|
162
|
-
...
|
|
163
|
-
"data-sticky-to":
|
|
164
|
-
...
|
|
163
|
+
...V ? { "data-sticky-header": "" } : {},
|
|
164
|
+
...ye ? { "data-sticky-footer": "" } : {},
|
|
165
|
+
"data-sticky-to": be,
|
|
166
|
+
...xe ? { "data-striped": "" } : {},
|
|
165
167
|
"data-ui": "table",
|
|
166
|
-
"data-variant":
|
|
167
|
-
ref:
|
|
168
|
+
"data-variant": Se,
|
|
169
|
+
ref: U
|
|
168
170
|
});
|
|
169
|
-
return /* @__PURE__ */
|
|
170
|
-
value:
|
|
171
|
-
children:
|
|
171
|
+
return /* @__PURE__ */ M(je.Provider, {
|
|
172
|
+
value: W,
|
|
173
|
+
children: _ === void 0 ? /* @__PURE__ */ M("div", { ...G }) : _(G)
|
|
172
174
|
});
|
|
173
175
|
}
|
|
174
176
|
//#endregion
|
|
175
177
|
//#region src/table/table-content.tsx
|
|
176
|
-
function
|
|
177
|
-
let s =
|
|
178
|
+
function Pe({ children: e, handleRef: t, ref: n, scrollLabelledBy: r, scrollProps: i, totalRowCount: a, ...o }) {
|
|
179
|
+
let s = J(), [c, l] = A(null), [u, d] = A({
|
|
178
180
|
overflowing: !1,
|
|
179
181
|
atStart: !0,
|
|
180
182
|
atEnd: !0
|
|
181
|
-
}), f =
|
|
183
|
+
}), f = k(null), { ref: p, ...m } = i ?? {}, h = le((e) => {
|
|
182
184
|
l(e), typeof p == "function" ? p(e) : p != null && (p.current = e);
|
|
183
185
|
}, [p]);
|
|
184
|
-
|
|
186
|
+
ue(() => {
|
|
185
187
|
if (c === null || s.stickyTo === "page") return;
|
|
186
|
-
let e =
|
|
188
|
+
let e = P(c, { onChange: d });
|
|
187
189
|
return f.current = e, d(e.state()), () => {
|
|
188
190
|
e.destroy(), f.current = null;
|
|
189
191
|
};
|
|
190
|
-
}, [c, s.stickyTo]),
|
|
192
|
+
}, [c, s.stickyTo]), ue(() => c === null ? void 0 : T(c).destroy, [c]), fe(t, () => ({
|
|
191
193
|
overflowing: () => f.current?.state().overflowing ?? !1,
|
|
192
194
|
refresh: () => f.current?.refresh(),
|
|
193
195
|
scrollToRow: (e) => {
|
|
@@ -195,17 +197,17 @@ function Ne({ children: e, handleRef: t, ref: n, scrollLabelledBy: r, scrollProp
|
|
|
195
197
|
t != null && f.current?.reveal(t);
|
|
196
198
|
}
|
|
197
199
|
}), [c]);
|
|
198
|
-
let g =
|
|
200
|
+
let g = C({
|
|
199
201
|
...m,
|
|
200
202
|
"data-part": "scroll",
|
|
201
203
|
ref: h
|
|
202
204
|
});
|
|
203
|
-
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__ */
|
|
205
|
+
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", {
|
|
204
206
|
...g,
|
|
205
|
-
children: /* @__PURE__ */
|
|
207
|
+
children: /* @__PURE__ */ M("table", {
|
|
206
208
|
...o,
|
|
207
209
|
...a === void 0 ? {} : { "aria-rowcount": a },
|
|
208
|
-
...
|
|
210
|
+
...w(s.loading ? { "aria-busy": !0 } : {}, "part", "table"),
|
|
209
211
|
ref: n,
|
|
210
212
|
children: e
|
|
211
213
|
})
|
|
@@ -213,16 +215,16 @@ function Ne({ children: e, handleRef: t, ref: n, scrollLabelledBy: r, scrollProp
|
|
|
213
215
|
}
|
|
214
216
|
//#endregion
|
|
215
217
|
//#region src/table/table-parts.tsx
|
|
216
|
-
var
|
|
217
|
-
function Ie() {
|
|
218
|
-
return E(Fe);
|
|
219
|
-
}
|
|
218
|
+
var Fe = E(void 0), Ie = E(void 0);
|
|
220
219
|
function Le() {
|
|
221
|
-
|
|
220
|
+
return D(Ie);
|
|
221
|
+
}
|
|
222
|
+
function Re() {
|
|
223
|
+
let e = D(Fe);
|
|
222
224
|
if (e === void 0) throw Error("TableSelect, TableExpander and TableRowHeader belong inside TableRow.");
|
|
223
225
|
return e;
|
|
224
226
|
}
|
|
225
|
-
function
|
|
227
|
+
function ze({ align: e, blockAlign: t, numeric: n, sticky: r, stickyOffset: i, text: a }, o) {
|
|
226
228
|
return {
|
|
227
229
|
...e === void 0 ? {} : { "data-align": e },
|
|
228
230
|
...t === void 0 ? {} : { "data-block-align": t },
|
|
@@ -235,43 +237,43 @@ function Re({ align: e, blockAlign: t, numeric: n, sticky: r, stickyOffset: i, t
|
|
|
235
237
|
} }
|
|
236
238
|
};
|
|
237
239
|
}
|
|
238
|
-
function
|
|
239
|
-
return /* @__PURE__ */
|
|
240
|
-
...
|
|
240
|
+
function Be({ ref: e, visuallyHidden: t = !1, ...n }) {
|
|
241
|
+
return /* @__PURE__ */ M("caption", {
|
|
242
|
+
...w(n, "part", "caption"),
|
|
241
243
|
...t ? { "data-visually-hidden": "" } : {},
|
|
242
244
|
ref: e
|
|
243
245
|
});
|
|
244
246
|
}
|
|
245
|
-
function Be({ ref: e, ...t }) {
|
|
246
|
-
return /* @__PURE__ */ j("thead", {
|
|
247
|
-
...C(t, "part", "head"),
|
|
248
|
-
ref: e
|
|
249
|
-
});
|
|
250
|
-
}
|
|
251
247
|
function Ve({ ref: e, ...t }) {
|
|
252
|
-
return /* @__PURE__ */
|
|
253
|
-
...
|
|
248
|
+
return /* @__PURE__ */ M("thead", {
|
|
249
|
+
...w(t, "part", "head"),
|
|
254
250
|
ref: e
|
|
255
251
|
});
|
|
256
252
|
}
|
|
257
253
|
function He({ ref: e, ...t }) {
|
|
258
|
-
return /* @__PURE__ */
|
|
259
|
-
...
|
|
254
|
+
return /* @__PURE__ */ M("tbody", {
|
|
255
|
+
...w(t, "part", "body"),
|
|
260
256
|
ref: e
|
|
261
257
|
});
|
|
262
258
|
}
|
|
263
259
|
function Ue({ ref: e, ...t }) {
|
|
264
|
-
return /* @__PURE__ */
|
|
265
|
-
...
|
|
260
|
+
return /* @__PURE__ */ M("tfoot", {
|
|
261
|
+
...w(t, "part", "summary"),
|
|
266
262
|
ref: e
|
|
267
263
|
});
|
|
268
264
|
}
|
|
269
|
-
function We({
|
|
270
|
-
|
|
265
|
+
function We({ ref: e, ...t }) {
|
|
266
|
+
return /* @__PURE__ */ M("div", {
|
|
267
|
+
...w(t, "part", "footer"),
|
|
268
|
+
ref: e
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
function Ge({ children: e, current: t, disabled: n, interactive: r, level: i, muted: a, onAction: o, onClick: s, parent: c, ref: l, render: u, rowIndex: d, style: f, value: p, ...m }) {
|
|
272
|
+
let h = J();
|
|
271
273
|
c !== void 0 && p !== void 0 && h.registerParent(p, c);
|
|
272
|
-
let g = p !== void 0 && h.isSelected(p), _ = p !== void 0 && h.isExpanded(p),
|
|
273
|
-
s?.(e), !(e.defaultPrevented || n === !0) &&
|
|
274
|
-
}, y =
|
|
274
|
+
let g = p !== void 0 && h.isSelected(p), _ = p !== void 0 && h.isExpanded(p), ee = r ?? o !== void 0, v = o === void 0 ? s : (e) => {
|
|
275
|
+
s?.(e), !(e.defaultPrevented || n === !0) && L(e.currentTarget, e.target) && o(e);
|
|
276
|
+
}, y = C({
|
|
275
277
|
...m,
|
|
276
278
|
...c === void 0 ? {} : {
|
|
277
279
|
"data-parent": c,
|
|
@@ -291,9 +293,9 @@ function We({ children: e, current: t, disabled: n, interactive: r, level: i, mu
|
|
|
291
293
|
} : {},
|
|
292
294
|
...n === !0 ? { "data-disabled": "" } : {},
|
|
293
295
|
..._ ? { "data-expanded": "" } : {},
|
|
294
|
-
...
|
|
296
|
+
...ee ? { "data-interactive": "" } : {},
|
|
295
297
|
...a === !0 ? { "data-muted": "" } : {},
|
|
296
|
-
...
|
|
298
|
+
...v === void 0 ? {} : { onClick: v },
|
|
297
299
|
"data-part": "row",
|
|
298
300
|
...g ? { "data-selected": "" } : {},
|
|
299
301
|
...p === void 0 ? {} : { "data-value": p },
|
|
@@ -305,24 +307,24 @@ function We({ children: e, current: t, disabled: n, interactive: r, level: i, mu
|
|
|
305
307
|
selected: g,
|
|
306
308
|
value: p
|
|
307
309
|
};
|
|
308
|
-
return c !== void 0 && !h.isOpenBranch(c) ? null : /* @__PURE__ */
|
|
310
|
+
return c !== void 0 && !h.isOpenBranch(c) ? null : /* @__PURE__ */ M(Fe.Provider, {
|
|
309
311
|
value: te,
|
|
310
|
-
children: u === void 0 ? /* @__PURE__ */
|
|
312
|
+
children: u === void 0 ? /* @__PURE__ */ M("tr", {
|
|
311
313
|
...y,
|
|
312
314
|
ref: l
|
|
313
315
|
}) : u(y)
|
|
314
316
|
});
|
|
315
317
|
}
|
|
316
|
-
function
|
|
318
|
+
function Ke(e, ...t) {
|
|
317
319
|
for (let n of t) typeof n == "function" ? n(e) : n != null && (n.current = e);
|
|
318
320
|
}
|
|
319
|
-
function
|
|
320
|
-
return /* @__PURE__ */ j
|
|
321
|
+
function qe({ header: e }) {
|
|
322
|
+
return /* @__PURE__ */ M(j, { children: (e.current?.textContent ?? "").trim() });
|
|
321
323
|
}
|
|
322
|
-
function
|
|
323
|
-
let g =
|
|
324
|
+
function Je({ align: e, blockAlign: t, children: n, column: r, numeric: c, ref: l, scope: u, sticky: d, stickyOffset: f, style: p, text: m, ...h }) {
|
|
325
|
+
let g = J(), _ = k(null), ee = r !== void 0 && g.sort?.column === r, v = C({
|
|
324
326
|
...h,
|
|
325
|
-
...
|
|
327
|
+
...ze({
|
|
326
328
|
align: e,
|
|
327
329
|
blockAlign: t,
|
|
328
330
|
numeric: c,
|
|
@@ -330,34 +332,34 @@ function qe({ align: e, blockAlign: t, children: n, column: r, numeric: c, ref:
|
|
|
330
332
|
stickyOffset: f,
|
|
331
333
|
text: m
|
|
332
334
|
}, p),
|
|
333
|
-
...
|
|
335
|
+
...ee ? { "aria-sort": g.sort?.direction } : {},
|
|
334
336
|
children: n,
|
|
335
337
|
"data-part": "column-header",
|
|
336
338
|
scope: u ?? "col"
|
|
337
339
|
});
|
|
338
|
-
return /* @__PURE__ */
|
|
340
|
+
return /* @__PURE__ */ M(Ie.Provider, {
|
|
339
341
|
value: r,
|
|
340
|
-
children: /* @__PURE__ */
|
|
342
|
+
children: /* @__PURE__ */ N(i, {
|
|
341
343
|
describes: "none",
|
|
342
344
|
openOn: "hover",
|
|
343
345
|
side: "bottom",
|
|
344
346
|
whenClipped: !0,
|
|
345
|
-
children: [/* @__PURE__ */
|
|
346
|
-
...
|
|
347
|
-
render: (e) => /* @__PURE__ */
|
|
347
|
+
children: [/* @__PURE__ */ M(a, {
|
|
348
|
+
...v,
|
|
349
|
+
render: (e) => /* @__PURE__ */ M("th", {
|
|
348
350
|
...e,
|
|
349
351
|
ref: (t) => {
|
|
350
|
-
e.ref?.(t), _.current = t,
|
|
352
|
+
e.ref?.(t), _.current = t, Ke(t, l);
|
|
351
353
|
}
|
|
352
354
|
})
|
|
353
|
-
}), /* @__PURE__ */
|
|
355
|
+
}), /* @__PURE__ */ M(s, { children: /* @__PURE__ */ M(o, { children: /* @__PURE__ */ M(qe, { header: _ }) }) })]
|
|
354
356
|
})
|
|
355
357
|
});
|
|
356
358
|
}
|
|
357
|
-
function
|
|
358
|
-
return /* @__PURE__ */
|
|
359
|
+
function Ye({ align: e, blockAlign: t, numeric: n, ref: r, scope: i, sticky: a, stickyOffset: o, style: s, text: c, ...l }) {
|
|
360
|
+
return /* @__PURE__ */ M("th", {
|
|
359
361
|
...l,
|
|
360
|
-
...
|
|
362
|
+
...ze({
|
|
361
363
|
align: e,
|
|
362
364
|
blockAlign: t,
|
|
363
365
|
numeric: n,
|
|
@@ -371,10 +373,10 @@ function Je({ align: e, blockAlign: t, numeric: n, ref: r, scope: i, sticky: a,
|
|
|
371
373
|
scope: i ?? "row"
|
|
372
374
|
});
|
|
373
375
|
}
|
|
374
|
-
function
|
|
375
|
-
return /* @__PURE__ */
|
|
376
|
+
function Xe({ align: e, blockAlign: t, numeric: n, ref: r, sticky: i, stickyOffset: a, style: o, text: s, ...c }) {
|
|
377
|
+
return /* @__PURE__ */ M("td", {
|
|
376
378
|
...c,
|
|
377
|
-
...
|
|
379
|
+
...ze({
|
|
378
380
|
align: e,
|
|
379
381
|
blockAlign: t,
|
|
380
382
|
numeric: n,
|
|
@@ -387,34 +389,34 @@ function Ye({ align: e, blockAlign: t, numeric: n, ref: r, sticky: i, stickyOffs
|
|
|
387
389
|
ref: r
|
|
388
390
|
});
|
|
389
391
|
}
|
|
390
|
-
function
|
|
391
|
-
let c =
|
|
392
|
+
function Ze({ children: e, column: r, onClick: i, ref: a, render: o, ...s }) {
|
|
393
|
+
let c = J(), l = D(Ie), u = r ?? l;
|
|
392
394
|
function d(e) {
|
|
393
395
|
i?.(e), !(e.defaultPrevented || u === void 0) && c.requestSort(u, e);
|
|
394
396
|
}
|
|
395
|
-
let f =
|
|
397
|
+
let f = C({
|
|
396
398
|
...s,
|
|
397
|
-
children: /* @__PURE__ */
|
|
399
|
+
children: /* @__PURE__ */ N(j, { children: [e, /* @__PURE__ */ M(n, { children: /* @__PURE__ */ M(t, { name: "chevron-down" }) })] }),
|
|
398
400
|
"data-part": "sort",
|
|
399
401
|
onClick: d,
|
|
400
402
|
type: "button"
|
|
401
403
|
});
|
|
402
|
-
return o === void 0 ? /* @__PURE__ */
|
|
404
|
+
return o === void 0 ? /* @__PURE__ */ M("button", {
|
|
403
405
|
...f,
|
|
404
406
|
ref: a
|
|
405
407
|
}) : o(f);
|
|
406
408
|
}
|
|
407
|
-
function
|
|
408
|
-
return /* @__PURE__ */
|
|
409
|
-
...
|
|
409
|
+
function Qe({ ref: e, ...t }) {
|
|
410
|
+
return /* @__PURE__ */ M("span", {
|
|
411
|
+
...w(t, "part", "column-actions"),
|
|
410
412
|
ref: e
|
|
411
413
|
});
|
|
412
414
|
}
|
|
413
|
-
function
|
|
414
|
-
let d =
|
|
415
|
-
return /* @__PURE__ */
|
|
415
|
+
function $e({ align: e, blockAlign: t, numeric: n, ref: r, sticky: i, stickyOffset: a, style: o, text: s, value: l, ...u }) {
|
|
416
|
+
let d = J(), f = Re(), p = l ?? f.value;
|
|
417
|
+
return /* @__PURE__ */ M("td", {
|
|
416
418
|
...u,
|
|
417
|
-
...
|
|
419
|
+
...ze({
|
|
418
420
|
align: e,
|
|
419
421
|
blockAlign: t,
|
|
420
422
|
numeric: n,
|
|
@@ -425,7 +427,7 @@ function Qe({ align: e, blockAlign: t, numeric: n, ref: r, sticky: i, stickyOffs
|
|
|
425
427
|
"data-part": "selection",
|
|
426
428
|
"data-part-selection": "",
|
|
427
429
|
ref: r,
|
|
428
|
-
children: /* @__PURE__ */
|
|
430
|
+
children: /* @__PURE__ */ M(c, {
|
|
429
431
|
checked: p !== void 0 && d.isSelected(p),
|
|
430
432
|
disabled: f.disabled,
|
|
431
433
|
onCheckedChange: (e, t) => {
|
|
@@ -436,15 +438,15 @@ function Qe({ align: e, blockAlign: t, numeric: n, ref: r, sticky: i, stickyOffs
|
|
|
436
438
|
source: t.source
|
|
437
439
|
});
|
|
438
440
|
},
|
|
439
|
-
children: /* @__PURE__ */
|
|
441
|
+
children: /* @__PURE__ */ M(h, { children: d.t("selectRow", { row: p ?? "" }).trim() })
|
|
440
442
|
})
|
|
441
443
|
});
|
|
442
444
|
}
|
|
443
|
-
function
|
|
444
|
-
let u =
|
|
445
|
-
return /* @__PURE__ */
|
|
445
|
+
function et({ align: e, blockAlign: t, numeric: n, ref: r, sticky: i, stickyOffset: a, style: o, text: s, ...l }) {
|
|
446
|
+
let u = J(), d = u.value.length;
|
|
447
|
+
return /* @__PURE__ */ M("th", {
|
|
446
448
|
...l,
|
|
447
|
-
...
|
|
449
|
+
...ze({
|
|
448
450
|
align: e,
|
|
449
451
|
blockAlign: t,
|
|
450
452
|
numeric: n,
|
|
@@ -456,56 +458,56 @@ function $e({ align: e, blockAlign: t, numeric: n, ref: r, sticky: i, stickyOffs
|
|
|
456
458
|
"data-part-selection": "",
|
|
457
459
|
ref: r,
|
|
458
460
|
scope: "col",
|
|
459
|
-
children: /* @__PURE__ */
|
|
461
|
+
children: /* @__PURE__ */ M(c, {
|
|
460
462
|
checked: d > 0 && d === u.rows().length,
|
|
461
463
|
indeterminate: d > 0 && d < u.rows().length,
|
|
462
464
|
onCheckedChange: (e, t) => u.toggleSelectAll(t.source),
|
|
463
|
-
children: /* @__PURE__ */
|
|
465
|
+
children: /* @__PURE__ */ M(h, { children: u.t("selectAll", { count: d }) })
|
|
464
466
|
})
|
|
465
467
|
});
|
|
466
468
|
}
|
|
467
|
-
function
|
|
468
|
-
let o =
|
|
469
|
+
function tt({ onClick: e, ref: r, value: i, ...a }) {
|
|
470
|
+
let o = J(), s = Re(), c = k(null), l = i ?? s.value, u = l !== void 0 && o.isExpanded(l);
|
|
469
471
|
pe(() => {
|
|
470
472
|
let e = c.current;
|
|
471
473
|
if (e === null) return;
|
|
472
|
-
let t = u && l !== void 0 ?
|
|
474
|
+
let t = u && l !== void 0 ? rt(e, l, s.detailId) : [];
|
|
473
475
|
t.length > 0 ? e.setAttribute("aria-controls", t.join(" ")) : e.removeAttribute("aria-controls");
|
|
474
476
|
});
|
|
475
477
|
function d(t) {
|
|
476
478
|
e?.(t), !(t.defaultPrevented || l === void 0) && o.toggleExpanded(l, t);
|
|
477
479
|
}
|
|
478
|
-
return /* @__PURE__ */
|
|
480
|
+
return /* @__PURE__ */ M("button", {
|
|
479
481
|
...a,
|
|
480
482
|
"aria-expanded": u,
|
|
481
483
|
"aria-label": a["aria-label"] ?? (u ? o.t("collapse") : o.t("expand")),
|
|
482
|
-
children: a.children ?? /* @__PURE__ */
|
|
484
|
+
children: a.children ?? /* @__PURE__ */ M(n, { children: /* @__PURE__ */ M(t, { name: "chevron-right" }) }),
|
|
483
485
|
"data-part": "expander",
|
|
484
486
|
"data-part-expander": "",
|
|
485
487
|
onClick: d,
|
|
486
|
-
ref: (e) =>
|
|
488
|
+
ref: (e) => Ke(e, c, r),
|
|
487
489
|
type: "button"
|
|
488
490
|
});
|
|
489
491
|
}
|
|
490
|
-
function
|
|
491
|
-
return /* @__PURE__ */
|
|
492
|
+
function nt({ ref: e, ...t }) {
|
|
493
|
+
return /* @__PURE__ */ M("span", {
|
|
492
494
|
...t,
|
|
493
495
|
"data-part": "mark",
|
|
494
496
|
"data-part-mark": "",
|
|
495
497
|
ref: e
|
|
496
498
|
});
|
|
497
499
|
}
|
|
498
|
-
function
|
|
500
|
+
function rt(e, t, n) {
|
|
499
501
|
let r = [...e.closest("table")?.querySelectorAll("tr[data-parent]") ?? []].filter((e) => e.getAttribute("data-parent") === t), i = e.ownerDocument.getElementById(n);
|
|
500
502
|
return [...i === null ? [] : [i], ...r].map((e) => e.id);
|
|
501
503
|
}
|
|
502
|
-
function
|
|
503
|
-
let a =
|
|
504
|
-
return a.isExpanded(r) ? /* @__PURE__ */
|
|
505
|
-
...
|
|
504
|
+
function it({ children: e, colSpan: t, ref: n, value: r, ...i }) {
|
|
505
|
+
let a = J();
|
|
506
|
+
return a.isExpanded(r) ? /* @__PURE__ */ M("tr", {
|
|
507
|
+
...w(i, "part", "detail"),
|
|
506
508
|
id: `${a.id}detail${r}`,
|
|
507
509
|
ref: n,
|
|
508
|
-
children: /* @__PURE__ */
|
|
510
|
+
children: /* @__PURE__ */ M("td", {
|
|
509
511
|
colSpan: t ?? a.columns,
|
|
510
512
|
"data-part": "cell",
|
|
511
513
|
"data-part-cell": "",
|
|
@@ -513,25 +515,25 @@ function rt({ children: e, colSpan: t, ref: n, value: r, ...i }) {
|
|
|
513
515
|
})
|
|
514
516
|
}) : null;
|
|
515
517
|
}
|
|
516
|
-
function
|
|
517
|
-
let o =
|
|
518
|
-
return /* @__PURE__ */
|
|
519
|
-
...
|
|
518
|
+
function at({ children: e, colSpan: t, end: n, ref: r, sticky: i, ...a }) {
|
|
519
|
+
let o = J();
|
|
520
|
+
return /* @__PURE__ */ M("tr", {
|
|
521
|
+
...w(a, "part", "group-row"),
|
|
520
522
|
...i === !0 ? { "data-sticky": "" } : {},
|
|
521
523
|
ref: r,
|
|
522
|
-
children: /* @__PURE__ */
|
|
524
|
+
children: /* @__PURE__ */ M("th", {
|
|
523
525
|
colSpan: t ?? o.columns,
|
|
524
526
|
"data-part": "group-header",
|
|
525
527
|
"data-part-group-header": "",
|
|
526
528
|
scope: "rowgroup",
|
|
527
|
-
children: /* @__PURE__ */
|
|
529
|
+
children: /* @__PURE__ */ N("div", {
|
|
528
530
|
"data-part": "group-content",
|
|
529
531
|
"data-part-group-content": "",
|
|
530
|
-
children: [/* @__PURE__ */
|
|
532
|
+
children: [/* @__PURE__ */ M("span", {
|
|
531
533
|
"data-part": "group-start",
|
|
532
534
|
"data-part-group-start": "",
|
|
533
535
|
children: e
|
|
534
|
-
}), n == null ? null : /* @__PURE__ */
|
|
536
|
+
}), n == null ? null : /* @__PURE__ */ M("span", {
|
|
535
537
|
"data-part": "group-end",
|
|
536
538
|
"data-part-group-end": "",
|
|
537
539
|
children: n
|
|
@@ -540,28 +542,28 @@ function it({ children: e, colSpan: t, end: n, ref: r, sticky: i, ...a }) {
|
|
|
540
542
|
})
|
|
541
543
|
});
|
|
542
544
|
}
|
|
543
|
-
function
|
|
544
|
-
let r =
|
|
545
|
-
return /* @__PURE__ */
|
|
546
|
-
...
|
|
545
|
+
function ot({ colSpan: e, ref: t, ...n }) {
|
|
546
|
+
let r = J();
|
|
547
|
+
return /* @__PURE__ */ M("tr", { children: /* @__PURE__ */ M("td", {
|
|
548
|
+
...w(n, "part", "empty"),
|
|
547
549
|
colSpan: e ?? r.columns,
|
|
548
550
|
ref: t
|
|
549
551
|
}) });
|
|
550
552
|
}
|
|
551
|
-
function
|
|
552
|
-
let i =
|
|
553
|
-
return /* @__PURE__ */
|
|
554
|
-
...
|
|
553
|
+
function st({ children: e, ref: t, skeletonRows: n, ...r }) {
|
|
554
|
+
let i = J();
|
|
555
|
+
return /* @__PURE__ */ M("tbody", {
|
|
556
|
+
...w(r, "part", "loader"),
|
|
555
557
|
"aria-hidden": !0,
|
|
556
558
|
ref: t,
|
|
557
|
-
children: e ?? Array.from({ length: n ?? 5 }, (e, t) => /* @__PURE__ */
|
|
559
|
+
children: e ?? Array.from({ length: n ?? 5 }, (e, t) => /* @__PURE__ */ M("tr", {
|
|
558
560
|
"data-part": "row",
|
|
559
561
|
"data-part-row": "",
|
|
560
|
-
children: Array.from({ length: i.columns }, (e, n) => /* @__PURE__ */
|
|
562
|
+
children: Array.from({ length: i.columns }, (e, n) => /* @__PURE__ */ M("td", {
|
|
561
563
|
"data-part": "cell",
|
|
562
564
|
"data-part-cell": "",
|
|
563
|
-
children: /* @__PURE__ */
|
|
564
|
-
inlineSize:
|
|
565
|
+
children: /* @__PURE__ */ M(l, {
|
|
566
|
+
inlineSize: R(t, n),
|
|
565
567
|
loading: !0
|
|
566
568
|
})
|
|
567
569
|
}, n))
|
|
@@ -570,8 +572,8 @@ function ot({ children: e, ref: t, skeletonRows: n, ...r }) {
|
|
|
570
572
|
}
|
|
571
573
|
//#endregion
|
|
572
574
|
//#region src/table/table-filter.tsx
|
|
573
|
-
function
|
|
574
|
-
return /* @__PURE__ */
|
|
575
|
+
function ct() {
|
|
576
|
+
return /* @__PURE__ */ M("svg", {
|
|
575
577
|
"aria-hidden": "true",
|
|
576
578
|
fill: "none",
|
|
577
579
|
stroke: "currentColor",
|
|
@@ -579,145 +581,145 @@ function st() {
|
|
|
579
581
|
strokeLinejoin: "round",
|
|
580
582
|
strokeWidth: "2",
|
|
581
583
|
viewBox: "0 0 24 24",
|
|
582
|
-
children: /* @__PURE__ */
|
|
584
|
+
children: /* @__PURE__ */ M("path", { d: "M22 3H2l8 9.46V19l4 2v-8.54L22 3z" })
|
|
583
585
|
});
|
|
584
586
|
}
|
|
585
|
-
function
|
|
586
|
-
return
|
|
587
|
+
function lt(e, t) {
|
|
588
|
+
return K(e) === K(t);
|
|
587
589
|
}
|
|
588
|
-
function
|
|
589
|
-
let { align: c, collisionPadding: l, columnLabel: u, conditions: h = 2, defaultOpen: g, defaultOperator: _, defaultValue:
|
|
590
|
-
function
|
|
591
|
-
|
|
590
|
+
function Y({ body: e, kind: t, operandName: n, operators: i, props: a, rangeOperand: o, singleCondition: s }) {
|
|
591
|
+
let { align: c, collisionPadding: l, columnLabel: u, conditions: h = 2, defaultOpen: g, defaultOperator: _, defaultValue: ee, label: v, mount: y, onOpenChange: oe, onValueChange: se, open: S, portal: C, renderOperand: T, side: E, sideOffset: le, value: D } = a, ue = J(), fe = Le(), pe = de(), [O, P] = A(ee ?? null), F = D === void 0 ? O : D, I = _ ?? be(t), me = () => Se(t, I), [L, R] = A(F ?? me()), [ge, _e] = A(!1), z = S ?? ge, ve = k(null), B = ue.t, V = u ?? fe ?? "", ye = Ce(F), H = s ? 1 : h;
|
|
592
|
+
function G(e) {
|
|
593
|
+
he(ve.current?.ownerDocument).announce(e);
|
|
592
594
|
}
|
|
593
|
-
let
|
|
595
|
+
let K = {
|
|
594
596
|
join: (e) => B(`filterJoins.${e}`),
|
|
595
597
|
operator: (e) => B(`filterOperators.${e}`)
|
|
596
598
|
};
|
|
597
|
-
function
|
|
598
|
-
|
|
599
|
-
controlled:
|
|
600
|
-
initial:
|
|
601
|
-
equals:
|
|
602
|
-
onRequest: (e) =>
|
|
603
|
-
}).request(e, t, n) &&
|
|
599
|
+
function De(e, t, n) {
|
|
600
|
+
ce({
|
|
601
|
+
controlled: D,
|
|
602
|
+
initial: F,
|
|
603
|
+
equals: lt,
|
|
604
|
+
onRequest: (e) => se?.(e.value, e)
|
|
605
|
+
}).request(e, t, n) && P(e);
|
|
604
606
|
}
|
|
605
|
-
function
|
|
606
|
-
|
|
607
|
+
function Oe(e, t) {
|
|
608
|
+
S === void 0 && _e(e), oe?.(e, t), R(F ?? me());
|
|
607
609
|
}
|
|
608
|
-
let
|
|
609
|
-
function
|
|
610
|
-
let n =
|
|
610
|
+
let q = (e) => L.conditions[e] ?? { operator: I }, ke = q(0), Ae = H === 2 && U(t, ke);
|
|
611
|
+
function je(e, t) {
|
|
612
|
+
let n = q(e), r = W(n.operator), i = W(t), a = {
|
|
611
613
|
operator: t,
|
|
612
614
|
...i >= 1 && r >= 1 ? { value: n.value } : {},
|
|
613
615
|
...i === 2 && r === 2 ? { end: n.end } : {}
|
|
614
616
|
};
|
|
615
|
-
|
|
616
|
-
operator:
|
|
617
|
+
R(Te(L, e, a)), i !== r && G(B("filterOperands", {
|
|
618
|
+
operator: K.operator(t),
|
|
617
619
|
count: i
|
|
618
620
|
}));
|
|
619
621
|
}
|
|
620
|
-
function
|
|
621
|
-
let i =
|
|
622
|
+
function Me(e, n, r) {
|
|
623
|
+
let i = q(e), a = U(t, i), o = n === 0 ? {
|
|
622
624
|
...i,
|
|
623
625
|
value: r
|
|
624
626
|
} : {
|
|
625
627
|
...i,
|
|
626
628
|
end: r
|
|
627
629
|
};
|
|
628
|
-
|
|
630
|
+
R(Te(L, e, o)), e === 0 && H === 2 && !a && U(t, o) && G(B("filterConditionAdded"));
|
|
629
631
|
}
|
|
630
|
-
function
|
|
631
|
-
let i =
|
|
632
|
+
function Ne(e, n, r) {
|
|
633
|
+
let i = q(e), a = U(t, i), o = {
|
|
632
634
|
...i,
|
|
633
635
|
value: n,
|
|
634
636
|
end: r
|
|
635
637
|
};
|
|
636
|
-
|
|
638
|
+
R(Te(L, e, o)), e === 0 && H === 2 && !a && U(t, o) && G(B("filterConditionAdded"));
|
|
637
639
|
}
|
|
638
|
-
function
|
|
639
|
-
let n =
|
|
640
|
-
|
|
640
|
+
function Pe(e, t) {
|
|
641
|
+
let n = we(L);
|
|
642
|
+
De(n, t, e), G(n ? B("filterApplied", {
|
|
641
643
|
column: V,
|
|
642
|
-
filter:
|
|
643
|
-
}) : B("filterCleared", { column: V })),
|
|
644
|
+
filter: xe(n, K)
|
|
645
|
+
}) : B("filterCleared", { column: V })), S === void 0 && _e(!1), oe?.(!1, e);
|
|
644
646
|
}
|
|
645
|
-
function
|
|
646
|
-
|
|
647
|
+
function Fe(e) {
|
|
648
|
+
R(me()), G(B("filterCleared", { column: V })), De(null, "clear", e), S === void 0 && _e(!1), oe?.(!1, e);
|
|
647
649
|
}
|
|
648
|
-
let
|
|
650
|
+
let Ie = v ?? (ye ? B("filterApplied", {
|
|
649
651
|
column: V,
|
|
650
|
-
filter:
|
|
652
|
+
filter: xe(F, K)
|
|
651
653
|
}) : B("filterColumn", { column: V }).trim());
|
|
652
|
-
function
|
|
653
|
-
let a =
|
|
654
|
-
apply: () =>
|
|
654
|
+
function Re(r) {
|
|
655
|
+
let a = q(r), s = W(a.operator), c = (e) => ({
|
|
656
|
+
apply: () => Pe(null, "keyboard"),
|
|
655
657
|
index: e,
|
|
656
658
|
label: B(s === 2 ? e === 0 ? "filterFrom" : "filterTo" : "filterValue"),
|
|
657
|
-
onValueChange: (t) =>
|
|
659
|
+
onValueChange: (t) => Me(r, e, t),
|
|
658
660
|
operator: a.operator,
|
|
659
661
|
value: (e === 0 ? a.value : a.end) ?? null
|
|
660
662
|
});
|
|
661
|
-
return /* @__PURE__ */
|
|
663
|
+
return /* @__PURE__ */ N("div", {
|
|
662
664
|
"data-operands": s,
|
|
663
665
|
"data-part": "filter-condition",
|
|
664
666
|
"data-part-filter-condition": "",
|
|
665
|
-
children: [/* @__PURE__ */
|
|
667
|
+
children: [/* @__PURE__ */ M("div", {
|
|
666
668
|
"data-part": "filter-operator",
|
|
667
669
|
"data-part-filter-operator": "",
|
|
668
|
-
children: /* @__PURE__ */
|
|
670
|
+
children: /* @__PURE__ */ N(te, {
|
|
669
671
|
fullWidth: !0,
|
|
670
672
|
items: i.map((e) => ({
|
|
671
|
-
label:
|
|
673
|
+
label: K.operator(e),
|
|
672
674
|
value: e
|
|
673
675
|
})),
|
|
674
|
-
onValueChange: (e) =>
|
|
676
|
+
onValueChange: (e) => je(r, e),
|
|
675
677
|
size: "sm",
|
|
676
678
|
value: a.operator,
|
|
677
|
-
children: [/* @__PURE__ */
|
|
679
|
+
children: [/* @__PURE__ */ M(ie, {
|
|
678
680
|
"aria-label": B("filterOperator"),
|
|
679
|
-
children: /* @__PURE__ */
|
|
680
|
-
}), /* @__PURE__ */
|
|
681
|
+
children: /* @__PURE__ */ M(ae, {})
|
|
682
|
+
}), /* @__PURE__ */ M(ne, { children: i.map((e) => /* @__PURE__ */ M(re, {
|
|
681
683
|
value: e,
|
|
682
|
-
children:
|
|
684
|
+
children: K.operator(e)
|
|
683
685
|
}, e)) })]
|
|
684
686
|
})
|
|
685
|
-
}), s === 0 ? null : /* @__PURE__ */
|
|
687
|
+
}), s === 0 ? null : /* @__PURE__ */ M("div", {
|
|
686
688
|
"data-kind": t,
|
|
687
689
|
"data-part": "filter-operand",
|
|
688
690
|
"data-part-filter-operand": "",
|
|
689
|
-
...n === void 0 ||
|
|
690
|
-
...o && s === 2 && !
|
|
691
|
-
children:
|
|
692
|
-
announce:
|
|
693
|
-
apply: () =>
|
|
691
|
+
...n === void 0 || T ? {} : { "data-operand": n },
|
|
692
|
+
...o && s === 2 && !T ? { "data-range": "" } : {},
|
|
693
|
+
children: T ? Array.from({ length: s }, (e, t) => T(c(t))) : e({
|
|
694
|
+
announce: G,
|
|
695
|
+
apply: () => Pe(null, "keyboard"),
|
|
694
696
|
condition: a,
|
|
695
|
-
setOperand: (e, t) =>
|
|
696
|
-
setOperands: (e, t) =>
|
|
697
|
+
setOperand: (e, t) => Me(r, e, t),
|
|
698
|
+
setOperands: (e, t) => Ne(r, e, t),
|
|
697
699
|
t: B
|
|
698
700
|
})
|
|
699
701
|
})]
|
|
700
702
|
}, r);
|
|
701
703
|
}
|
|
702
|
-
return /* @__PURE__ */
|
|
703
|
-
onOpenChange: (e, t) =>
|
|
704
|
+
return /* @__PURE__ */ N(p, {
|
|
705
|
+
onOpenChange: (e, t) => Oe(e, t),
|
|
704
706
|
open: z,
|
|
705
707
|
...c === void 0 ? {} : { align: c },
|
|
706
708
|
...l === void 0 ? {} : { collisionPadding: l },
|
|
707
709
|
...g === void 0 ? {} : { defaultOpen: g },
|
|
708
710
|
...y === void 0 ? {} : { mount: y },
|
|
709
|
-
...
|
|
710
|
-
...
|
|
711
|
-
...
|
|
712
|
-
children: [/* @__PURE__ */
|
|
713
|
-
...
|
|
714
|
-
"aria-label":
|
|
715
|
-
...
|
|
711
|
+
...C === void 0 ? {} : { portal: C },
|
|
712
|
+
...E === void 0 ? {} : { side: E },
|
|
713
|
+
...le === void 0 ? {} : { sideOffset: le },
|
|
714
|
+
children: [/* @__PURE__ */ M(f, { render: (e) => /* @__PURE__ */ M("button", {
|
|
715
|
+
...w(e, "part", "filter"),
|
|
716
|
+
"aria-label": Ie,
|
|
717
|
+
...ye ? { "data-filtered": "" } : {},
|
|
716
718
|
type: "button",
|
|
717
|
-
children: /* @__PURE__ */
|
|
718
|
-
}) }), /* @__PURE__ */
|
|
719
|
-
"aria-label":
|
|
720
|
-
children: /* @__PURE__ */
|
|
719
|
+
children: /* @__PURE__ */ M(ct, {})
|
|
720
|
+
}) }), /* @__PURE__ */ M(m, { children: /* @__PURE__ */ M(d, {
|
|
721
|
+
"aria-label": Ie,
|
|
722
|
+
children: /* @__PURE__ */ N("div", {
|
|
721
723
|
"data-kind": t,
|
|
722
724
|
"data-part": "filter-panel",
|
|
723
725
|
"data-part-filter-panel": "",
|
|
@@ -726,40 +728,40 @@ function X({ body: e, kind: t, operandName: n, operators: i, props: a, rangeOper
|
|
|
726
728
|
id: pe,
|
|
727
729
|
ref: ve,
|
|
728
730
|
children: [
|
|
729
|
-
|
|
730
|
-
|
|
731
|
+
Re(0),
|
|
732
|
+
Ae ? /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ N("div", {
|
|
731
733
|
"data-part": "filter-join",
|
|
732
734
|
"data-part-filter-join": "",
|
|
733
|
-
children: [/* @__PURE__ */
|
|
735
|
+
children: [/* @__PURE__ */ M("span", {
|
|
734
736
|
"data-label": "",
|
|
735
737
|
children: B("filterJoin")
|
|
736
|
-
}), /* @__PURE__ */
|
|
738
|
+
}), /* @__PURE__ */ N(b, {
|
|
737
739
|
"aria-label": B("filterJoin"),
|
|
738
|
-
onValueChange: (e) =>
|
|
740
|
+
onValueChange: (e) => R(Ee(L, e)),
|
|
739
741
|
orientation: "horizontal",
|
|
740
742
|
size: "sm",
|
|
741
|
-
value:
|
|
742
|
-
children: [/* @__PURE__ */
|
|
743
|
+
value: L.join,
|
|
744
|
+
children: [/* @__PURE__ */ M(x, {
|
|
743
745
|
value: "and",
|
|
744
|
-
children:
|
|
745
|
-
}), /* @__PURE__ */
|
|
746
|
+
children: K.join("and")
|
|
747
|
+
}), /* @__PURE__ */ M(x, {
|
|
746
748
|
value: "or",
|
|
747
|
-
children:
|
|
749
|
+
children: K.join("or")
|
|
748
750
|
})]
|
|
749
751
|
})]
|
|
750
|
-
}),
|
|
751
|
-
/* @__PURE__ */
|
|
752
|
+
}), Re(1)] }) : null,
|
|
753
|
+
/* @__PURE__ */ N("div", {
|
|
752
754
|
"data-part": "filter-actions",
|
|
753
755
|
"data-part-filter-actions": "",
|
|
754
|
-
children: [/* @__PURE__ */
|
|
755
|
-
disabled: !
|
|
756
|
-
onClick: (e) =>
|
|
756
|
+
children: [/* @__PURE__ */ M(r, {
|
|
757
|
+
disabled: !Ce(L),
|
|
758
|
+
onClick: (e) => Fe(e),
|
|
757
759
|
size: "sm",
|
|
758
760
|
tone: "secondary",
|
|
759
761
|
variant: "ghost",
|
|
760
762
|
children: B("filterClear")
|
|
761
|
-
}), /* @__PURE__ */
|
|
762
|
-
onClick: (e) =>
|
|
763
|
+
}), /* @__PURE__ */ M(r, {
|
|
764
|
+
onClick: (e) => Pe(e, "pointer"),
|
|
763
765
|
size: "sm",
|
|
764
766
|
children: B("filterApply")
|
|
765
767
|
})]
|
|
@@ -769,20 +771,20 @@ function X({ body: e, kind: t, operandName: n, operators: i, props: a, rangeOper
|
|
|
769
771
|
}) })]
|
|
770
772
|
});
|
|
771
773
|
}
|
|
772
|
-
function
|
|
774
|
+
function X(e) {
|
|
773
775
|
return (t) => {
|
|
774
776
|
t.key === "Enter" && !t.defaultPrevented && e();
|
|
775
777
|
};
|
|
776
778
|
}
|
|
777
779
|
function Z(e, t) {
|
|
778
|
-
return t ??
|
|
780
|
+
return t ?? G(e);
|
|
779
781
|
}
|
|
780
782
|
function ut(e) {
|
|
781
|
-
return /* @__PURE__ */
|
|
782
|
-
body: ({ apply: e, condition: t, setOperand: n, t: r }) => /* @__PURE__ */
|
|
783
|
+
return /* @__PURE__ */ M(Y, {
|
|
784
|
+
body: ({ apply: e, condition: t, setOperand: n, t: r }) => /* @__PURE__ */ M(u, {
|
|
783
785
|
"aria-label": r("filterValue"),
|
|
784
786
|
onChange: (e) => n(0, e.target.value),
|
|
785
|
-
onKeyDown:
|
|
787
|
+
onKeyDown: X(e),
|
|
786
788
|
placeholder: r("filterValue"),
|
|
787
789
|
size: "sm",
|
|
788
790
|
value: t.value ?? ""
|
|
@@ -795,12 +797,12 @@ function ut(e) {
|
|
|
795
797
|
}
|
|
796
798
|
function dt(e) {
|
|
797
799
|
let { format: t, locale: n, step: r } = e;
|
|
798
|
-
return /* @__PURE__ */
|
|
799
|
-
body: ({ apply: e, condition: i, setOperand: a, t: o }) => /* @__PURE__ */ j
|
|
800
|
-
"aria-label":
|
|
801
|
-
onKeyDown:
|
|
800
|
+
return /* @__PURE__ */ M(Y, {
|
|
801
|
+
body: ({ apply: e, condition: i, setOperand: a, t: o }) => /* @__PURE__ */ M(j, { children: [0, 1].slice(0, W(i.operator)).map((s) => /* @__PURE__ */ M(y, {
|
|
802
|
+
"aria-label": W(i.operator) === 2 ? o(s === 0 ? "filterFrom" : "filterTo") : o("filterValue"),
|
|
803
|
+
onKeyDown: X(e),
|
|
802
804
|
onValueChange: (e) => a(s, e),
|
|
803
|
-
placeholder:
|
|
805
|
+
placeholder: W(i.operator) === 2 ? o(s === 0 ? "filterFrom" : "filterTo") : o("filterValue"),
|
|
804
806
|
size: "sm",
|
|
805
807
|
value: (s === 0 ? i.value : i.end) ?? null,
|
|
806
808
|
...t === void 0 ? {} : { format: t },
|
|
@@ -814,14 +816,14 @@ function dt(e) {
|
|
|
814
816
|
});
|
|
815
817
|
}
|
|
816
818
|
function ft(e) {
|
|
817
|
-
let { locale: t, max: n, min: r, presets: i } = e, a = (e) => e ? ve(String(e)) : null, o = (e) =>
|
|
818
|
-
return /* @__PURE__ */
|
|
819
|
-
body: ({ apply: e, condition: s, setOperand: c, setOperands: l, t: u }) =>
|
|
819
|
+
let { locale: t, max: n, min: r, presets: i } = e, a = (e) => e ? ve(String(e)) : null, o = (e) => ge(e) ? ye(e) : null;
|
|
820
|
+
return /* @__PURE__ */ M(Y, {
|
|
821
|
+
body: ({ apply: e, condition: s, setOperand: c, setOperands: l, t: u }) => W(s.operator) === 2 ? /* @__PURE__ */ M(_, {
|
|
820
822
|
messages: {
|
|
821
823
|
end: u("filterTo"),
|
|
822
824
|
start: u("filterFrom")
|
|
823
825
|
},
|
|
824
|
-
onKeyDown:
|
|
826
|
+
onKeyDown: X(e),
|
|
825
827
|
onValueChange: (e) => l(o(e?.start), o(e?.end)),
|
|
826
828
|
size: "sm",
|
|
827
829
|
value: {
|
|
@@ -832,9 +834,9 @@ function ft(e) {
|
|
|
832
834
|
...a(r) ? { min: a(r) } : {},
|
|
833
835
|
...a(n) ? { max: a(n) } : {},
|
|
834
836
|
...i === void 0 ? {} : { presets: i }
|
|
835
|
-
}) : /* @__PURE__ */
|
|
837
|
+
}) : /* @__PURE__ */ M(g, {
|
|
836
838
|
"aria-label": u("filterValue"),
|
|
837
|
-
onKeyDown:
|
|
839
|
+
onKeyDown: X(e),
|
|
838
840
|
onValueChange: (e) => c(0, o(e)),
|
|
839
841
|
size: "sm",
|
|
840
842
|
value: a(s.value),
|
|
@@ -860,7 +862,7 @@ function $(e) {
|
|
|
860
862
|
return /^\d{4}-\d{2}-\d{2}$/.test(t) ? B(`${t}T00:00`) : /^\d{4}-\d{2}-\d{2}T\d{2}$/.test(t) ? B(`${t}:00`) : B(t);
|
|
861
863
|
}
|
|
862
864
|
function pt(e) {
|
|
863
|
-
let { granularity: t, hourCycle: n, locale: r, max: i, min: a, options: o, presets: s, step: c } = e, l = (e) => z(e) ?
|
|
865
|
+
let { granularity: t, hourCycle: n, locale: r, max: i, min: a, options: o, presets: s, step: c } = e, l = (e) => z(e) ? H(e, t ?? "minute") : null, u = {
|
|
864
866
|
...t === void 0 ? {} : { granularity: t },
|
|
865
867
|
...n === void 0 ? {} : { hourCycle: n },
|
|
866
868
|
...r === void 0 ? {} : { locale: r },
|
|
@@ -869,8 +871,8 @@ function pt(e) {
|
|
|
869
871
|
...Q(a) ? { min: Q(a) } : {},
|
|
870
872
|
...Q(i) ? { max: Q(i) } : {}
|
|
871
873
|
};
|
|
872
|
-
return /* @__PURE__ */
|
|
873
|
-
body: ({ apply: e, condition: t, setOperand: n, setOperands: r, t: i }) =>
|
|
874
|
+
return /* @__PURE__ */ M(Y, {
|
|
875
|
+
body: ({ apply: e, condition: t, setOperand: n, setOperands: r, t: i }) => W(t.operator) === 2 ? /* @__PURE__ */ M(se, {
|
|
874
876
|
messages: {
|
|
875
877
|
start: i("filterFrom"),
|
|
876
878
|
end: i("filterTo")
|
|
@@ -883,9 +885,9 @@ function pt(e) {
|
|
|
883
885
|
},
|
|
884
886
|
...u,
|
|
885
887
|
...s === void 0 ? {} : { presets: s }
|
|
886
|
-
}) : /* @__PURE__ */
|
|
888
|
+
}) : /* @__PURE__ */ M(oe, {
|
|
887
889
|
"aria-label": i("filterValue"),
|
|
888
|
-
onKeyDown:
|
|
890
|
+
onKeyDown: X(e),
|
|
889
891
|
onValueChange: (e) => n(0, l(e)),
|
|
890
892
|
size: "sm",
|
|
891
893
|
value: Q(t.value),
|
|
@@ -899,7 +901,7 @@ function pt(e) {
|
|
|
899
901
|
});
|
|
900
902
|
}
|
|
901
903
|
function mt(e) {
|
|
902
|
-
let { granularity: t, hourCycle: n, locale: r, max: i, min: a, presets: o, step: s, timeZone: c } = e, l = (e) => _e(e) ? `${
|
|
904
|
+
let { granularity: t, hourCycle: n, locale: r, max: i, min: a, presets: o, step: s, timeZone: c } = e, l = (e) => _e(e) ? `${ye(e.date)}T${H(e.time, t ?? "minute")}` : null, u = {
|
|
903
905
|
...t === void 0 ? {} : { granularity: t },
|
|
904
906
|
...n === void 0 ? {} : { hourCycle: n },
|
|
905
907
|
...r === void 0 ? {} : { locale: r },
|
|
@@ -908,8 +910,8 @@ function mt(e) {
|
|
|
908
910
|
...$(a) ? { min: $(a) } : {},
|
|
909
911
|
...$(i) ? { max: $(i) } : {}
|
|
910
912
|
};
|
|
911
|
-
return /* @__PURE__ */
|
|
912
|
-
body: ({ apply: e, condition: t, setOperand: n, setOperands: r, t: i }) =>
|
|
913
|
+
return /* @__PURE__ */ M(Y, {
|
|
914
|
+
body: ({ apply: e, condition: t, setOperand: n, setOperands: r, t: i }) => W(t.operator) === 2 ? /* @__PURE__ */ M(v, {
|
|
913
915
|
messages: {
|
|
914
916
|
start: i("filterFrom"),
|
|
915
917
|
end: i("filterTo")
|
|
@@ -922,9 +924,9 @@ function mt(e) {
|
|
|
922
924
|
},
|
|
923
925
|
...u,
|
|
924
926
|
...o === void 0 ? {} : { presets: o }
|
|
925
|
-
}) : /* @__PURE__ */
|
|
927
|
+
}) : /* @__PURE__ */ M(ee, {
|
|
926
928
|
"aria-label": i("filterValue"),
|
|
927
|
-
onKeyDown:
|
|
929
|
+
onKeyDown: X(e),
|
|
928
930
|
onValueChange: (e) => n(0, l(e)),
|
|
929
931
|
size: "sm",
|
|
930
932
|
value: $(t.value),
|
|
@@ -938,17 +940,17 @@ function mt(e) {
|
|
|
938
940
|
});
|
|
939
941
|
}
|
|
940
942
|
function ht(e) {
|
|
941
|
-
return /* @__PURE__ */
|
|
942
|
-
body: ({ condition: e, setOperand: t, t: n }) => /* @__PURE__ */
|
|
943
|
+
return /* @__PURE__ */ M(Y, {
|
|
944
|
+
body: ({ condition: e, setOperand: t, t: n }) => /* @__PURE__ */ N(b, {
|
|
943
945
|
"aria-label": n("filterValue"),
|
|
944
946
|
onValueChange: (e) => t(0, e === "true"),
|
|
945
947
|
orientation: "horizontal",
|
|
946
948
|
size: "sm",
|
|
947
949
|
value: e.value === void 0 || e.value === null ? "" : String(e.value),
|
|
948
|
-
children: [/* @__PURE__ */
|
|
950
|
+
children: [/* @__PURE__ */ M(x, {
|
|
949
951
|
value: "true",
|
|
950
952
|
children: n("true")
|
|
951
|
-
}), /* @__PURE__ */
|
|
953
|
+
}), /* @__PURE__ */ M(x, {
|
|
952
954
|
value: "false",
|
|
953
955
|
children: n("false")
|
|
954
956
|
})]
|
|
@@ -961,14 +963,14 @@ function ht(e) {
|
|
|
961
963
|
}
|
|
962
964
|
function gt(e) {
|
|
963
965
|
let { operand: t = "list", options: n = [], searchThreshold: r = 8, searchable: i } = e;
|
|
964
|
-
return /* @__PURE__ */
|
|
965
|
-
body: ({ announce: e, apply: a, condition: o, setOperand: s, t: c }) => t === "tags" ? /* @__PURE__ */
|
|
966
|
+
return /* @__PURE__ */ M(Y, {
|
|
967
|
+
body: ({ announce: e, apply: a, condition: o, setOperand: s, t: c }) => t === "tags" ? /* @__PURE__ */ M(_t, {
|
|
966
968
|
apply: a,
|
|
967
969
|
chosen: o.value ?? [],
|
|
968
970
|
onChange: (e) => s(0, e),
|
|
969
971
|
options: n,
|
|
970
972
|
t: c
|
|
971
|
-
}) : /* @__PURE__ */
|
|
973
|
+
}) : /* @__PURE__ */ M(vt, {
|
|
972
974
|
announce: e,
|
|
973
975
|
chosen: o.value ?? [],
|
|
974
976
|
onChange: (e) => s(0, e),
|
|
@@ -985,8 +987,8 @@ function gt(e) {
|
|
|
985
987
|
});
|
|
986
988
|
}
|
|
987
989
|
function _t({ apply: e, chosen: t, onChange: n, options: r, t: i }) {
|
|
988
|
-
let a =
|
|
989
|
-
return /* @__PURE__ */
|
|
990
|
+
let a = de(), o = O(() => new Map(r.map((e) => [e.value, e])), [r]), s = r.length > 0;
|
|
991
|
+
return /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ M(S, {
|
|
990
992
|
"aria-label": i("filterValue"),
|
|
991
993
|
formatLabel: (e) => o.get(e)?.label ?? e,
|
|
992
994
|
fullWidth: !0,
|
|
@@ -1001,20 +1003,20 @@ function _t({ apply: e, chosen: t, onChange: n, options: r, t: i }) {
|
|
|
1001
1003
|
list: `${a}-options`,
|
|
1002
1004
|
validate: (e) => o.has(e)
|
|
1003
1005
|
} : {}
|
|
1004
|
-
}), s ? /* @__PURE__ */
|
|
1006
|
+
}), s ? /* @__PURE__ */ M("datalist", {
|
|
1005
1007
|
id: `${a}-options`,
|
|
1006
|
-
children: r.map((e) => /* @__PURE__ */
|
|
1008
|
+
children: r.map((e) => /* @__PURE__ */ M("option", {
|
|
1007
1009
|
value: e.value,
|
|
1008
1010
|
children: e.label ?? e.value
|
|
1009
1011
|
}, e.value))
|
|
1010
1012
|
}) : null] });
|
|
1011
1013
|
}
|
|
1012
1014
|
function vt({ announce: e, chosen: t, onChange: n, options: r, searchThreshold: i, searchable: a, t: o }) {
|
|
1013
|
-
let s =
|
|
1014
|
-
return /* @__PURE__ */
|
|
1015
|
+
let s = de(), [l, d] = A(""), f = O(() => I({ 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;
|
|
1016
|
+
return /* @__PURE__ */ N(j, { children: [g ? /* @__PURE__ */ M("div", {
|
|
1015
1017
|
"data-part": "filter-search",
|
|
1016
1018
|
"data-part-filter-search": "",
|
|
1017
|
-
children: /* @__PURE__ */
|
|
1019
|
+
children: /* @__PURE__ */ M(u, {
|
|
1018
1020
|
"aria-controls": `${s}-list`,
|
|
1019
1021
|
"aria-label": o("filterSearch"),
|
|
1020
1022
|
clearable: !0,
|
|
@@ -1026,19 +1028,19 @@ function vt({ announce: e, chosen: t, onChange: n, options: r, searchThreshold:
|
|
|
1026
1028
|
size: "sm",
|
|
1027
1029
|
value: l
|
|
1028
1030
|
})
|
|
1029
|
-
}) : null, m.length === 0 ? /* @__PURE__ */
|
|
1031
|
+
}) : null, m.length === 0 ? /* @__PURE__ */ M("p", {
|
|
1030
1032
|
"data-part": "filter-empty",
|
|
1031
1033
|
"data-part-filter-empty": "",
|
|
1032
1034
|
children: o("filterEmpty")
|
|
1033
|
-
}) : /* @__PURE__ */
|
|
1035
|
+
}) : /* @__PURE__ */ N("div", {
|
|
1034
1036
|
"data-part": "filter-list",
|
|
1035
1037
|
"data-part-filter-list": "",
|
|
1036
1038
|
id: `${s}-list`,
|
|
1037
|
-
children: [/* @__PURE__ */
|
|
1039
|
+
children: [/* @__PURE__ */ N("div", {
|
|
1038
1040
|
"data-covering": "",
|
|
1039
1041
|
"data-part": "filter-option",
|
|
1040
1042
|
"data-part-filter-option": "",
|
|
1041
|
-
children: [/* @__PURE__ */
|
|
1043
|
+
children: [/* @__PURE__ */ M(c, {
|
|
1042
1044
|
checked: h.length > 0 && h.length === m.length,
|
|
1043
1045
|
indeterminate: h.length > 0 && h.length < m.length,
|
|
1044
1046
|
onCheckedChange: (e) => {
|
|
@@ -1046,18 +1048,18 @@ function vt({ announce: e, chosen: t, onChange: n, options: r, searchThreshold:
|
|
|
1046
1048
|
n(e ? [.../* @__PURE__ */ new Set([...t, ...r])] : t.filter((e) => !r.includes(e)));
|
|
1047
1049
|
},
|
|
1048
1050
|
children: o("filterSelectAll")
|
|
1049
|
-
}), /* @__PURE__ */
|
|
1051
|
+
}), /* @__PURE__ */ M("span", {
|
|
1050
1052
|
"data-count": "",
|
|
1051
1053
|
children: m.length
|
|
1052
1054
|
})]
|
|
1053
|
-
}), m.map((e) => /* @__PURE__ */
|
|
1055
|
+
}), m.map((e) => /* @__PURE__ */ N("div", {
|
|
1054
1056
|
"data-part": "filter-option",
|
|
1055
1057
|
"data-part-filter-option": "",
|
|
1056
|
-
children: [/* @__PURE__ */
|
|
1058
|
+
children: [/* @__PURE__ */ M(c, {
|
|
1057
1059
|
checked: t.includes(e.value),
|
|
1058
1060
|
onCheckedChange: (r) => n(r ? [...t, e.value] : t.filter((t) => t !== e.value)),
|
|
1059
1061
|
children: e.label ?? e.value
|
|
1060
|
-
}), e.count === void 0 ? null : /* @__PURE__ */
|
|
1062
|
+
}), e.count === void 0 ? null : /* @__PURE__ */ M("span", {
|
|
1061
1063
|
"data-count": "",
|
|
1062
1064
|
children: e.count
|
|
1063
1065
|
})]
|
|
@@ -1065,4 +1067,4 @@ function vt({ announce: e, chosen: t, onChange: n, options: r, searchThreshold:
|
|
|
1065
1067
|
})] });
|
|
1066
1068
|
}
|
|
1067
1069
|
//#endregion
|
|
1068
|
-
export {
|
|
1070
|
+
export { Ae as A, $e as C, Le as D, Ue as E, q as F, Me as M, J as N, Re as O, ke as P, Ye as S, Ze as T, at as _, gt as a, nt as b, He as c, Qe as d, Je as f, We as g, tt as h, dt as i, Ne as j, Pe as k, Be as l, ot as m, ft as n, ut as o, it as p, mt as r, pt as s, ht as t, Xe as u, Ve as v, et as w, Ge as x, st as y };
|