@medyat/react-data-table 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +206 -2
- package/dist/bottom-sheet-NHUT908D.js +1123 -0
- package/dist/bottom-sheet-NHUT908D.js.map +1 -0
- package/dist/columns-dialog-COcldc3X.js +419 -0
- package/dist/columns-dialog-COcldc3X.js.map +1 -0
- package/dist/date-editor-CJFd5YEo.js +378 -0
- package/dist/date-editor-CJFd5YEo.js.map +1 -0
- package/dist/filters-sheet-CWzMaMFo.js +298 -0
- package/dist/filters-sheet-CWzMaMFo.js.map +1 -0
- package/dist/index.d.ts +736 -0
- package/dist/index.js +4769 -0
- package/dist/index.js.map +1 -0
- package/dist/model-RkRyfM7C.js +288 -0
- package/dist/model-RkRyfM7C.js.map +1 -0
- package/dist/provider-CTTHEpE3.js +884 -0
- package/dist/provider-CTTHEpE3.js.map +1 -0
- package/dist/shadcn-bridge-hsl.css +24 -0
- package/dist/shadcn-bridge.css +25 -0
- package/dist/style.css +2 -0
- package/dist/switch-B8TN4kJ-.js +23 -0
- package/dist/switch-B8TN4kJ-.js.map +1 -0
- package/docs/backend-integration.md +596 -0
- package/package.json +95 -4
package/dist/index.js
ADDED
|
@@ -0,0 +1,4769 @@
|
|
|
1
|
+
import { n as e, t } from "./provider-CTTHEpE3.js";
|
|
2
|
+
import { _ as n, a as r, c as i, d as a, f as o, g as s, h as c, i as l, l as u, m as d, n as f, o as p, p as m, r as h, s as g, t as _, u as v, v as y, y as b } from "./bottom-sheet-NHUT908D.js";
|
|
3
|
+
import { c as x, d as S, f as C, i as w, n as T, o as E, r as D, s as O, t as k, u as A } from "./model-RkRyfM7C.js";
|
|
4
|
+
import { t as j } from "./switch-B8TN4kJ-.js";
|
|
5
|
+
import { c as M } from "react/compiler-runtime";
|
|
6
|
+
import { Fragment as N, Suspense as P, lazy as F, useEffect as I, useEffectEvent as L, useId as R, useImperativeHandle as z, useLayoutEffect as B, useRef as ee, useState as V, useSyncExternalStore as H } from "react";
|
|
7
|
+
import { Fragment as U, jsx as W, jsxs as G } from "react/jsx-runtime";
|
|
8
|
+
import { columnFilteringFeature as K, columnOrderingFeature as q, columnPinningFeature as te, columnResizingFeature as J, columnSizingFeature as ne, columnVisibilityFeature as Y, createFilteredRowModel as re, createPaginatedRowModel as ie, createSortedRowModel as X, globalFilteringFeature as ae, rowPaginationFeature as oe, rowSortingFeature as Z, tableFeatures as se, useTable as Q } from "@tanstack/react-table";
|
|
9
|
+
import { ArrowClockwiseIcon as ce, ArrowDownIcon as le, ArrowUpIcon as ue, CaretDownIcon as de, CaretLeftIcon as fe, CaretRightIcon as pe, CheckIcon as me, CircleNotchIcon as he, DotsThreeIcon as ge, FileIcon as _e, FunnelIcon as ve, MagnifyingGlassIcon as ye, PackageIcon as be, PlusIcon as xe, PushPinIcon as Se, SlidersHorizontalIcon as Ce, StackIcon as we, WarningCircleIcon as Te, WarningIcon as Ee, XCircleIcon as De, XIcon as Oe } from "@phosphor-icons/react";
|
|
10
|
+
import { Combobox as ke } from "@base-ui/react/combobox";
|
|
11
|
+
import { Popover as $ } from "@base-ui/react/popover";
|
|
12
|
+
import { Menu as Ae } from "@base-ui/react/menu";
|
|
13
|
+
import { Toggle as je } from "@base-ui/react/toggle";
|
|
14
|
+
import { ToggleGroup as Me } from "@base-ui/react/toggle-group";
|
|
15
|
+
import { useVirtualizer as Ne } from "@tanstack/react-virtual";
|
|
16
|
+
import { Dialog as Pe } from "@base-ui/react/dialog";
|
|
17
|
+
import { AlertDialog as Fe } from "@base-ui/react/alert-dialog";
|
|
18
|
+
// src/core/adapters/local-storage.ts
|
|
19
|
+
function Ie() {
|
|
20
|
+
try {
|
|
21
|
+
let e = globalThis.localStorage, t = "__dt_probe__";
|
|
22
|
+
return e.setItem(t, "1"), e.removeItem(t), {
|
|
23
|
+
get: (t) => e.getItem(t),
|
|
24
|
+
set: (t, n) => e.setItem(t, n)
|
|
25
|
+
};
|
|
26
|
+
} catch {
|
|
27
|
+
let e = /* @__PURE__ */ new Map();
|
|
28
|
+
return {
|
|
29
|
+
get: (t) => e.get(t) ?? null,
|
|
30
|
+
set: (t, n) => {
|
|
31
|
+
e.set(t, n);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
function Le(e, t, n) {
|
|
37
|
+
let r = e.get(t);
|
|
38
|
+
if (r === null) return n;
|
|
39
|
+
try {
|
|
40
|
+
return JSON.parse(r);
|
|
41
|
+
} catch {
|
|
42
|
+
return n;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
var Re = (e, t) => {
|
|
46
|
+
if (typeof e != "string" || e === "") throw TypeError(`${t}: 'scope' zorunlu (uygulama/kiracı anahtarı)`);
|
|
47
|
+
return e;
|
|
48
|
+
}, ze = () => globalThis.crypto?.randomUUID?.() ?? Math.random().toString(36).slice(2), Be = () => (/* @__PURE__ */ new Date()).toISOString();
|
|
49
|
+
function Ve(e) {
|
|
50
|
+
let t = Re(e?.scope, "createLocalStorageViews"), n = Ie(), r = (e) => `dt:${t}:views:${e}`, i = (e) => Le(n, r(e), []), a = (e, t) => n.set(r(e), JSON.stringify(t));
|
|
51
|
+
return {
|
|
52
|
+
async list(e) {
|
|
53
|
+
return i(e);
|
|
54
|
+
},
|
|
55
|
+
async create(e, t) {
|
|
56
|
+
let n = {
|
|
57
|
+
id: ze(),
|
|
58
|
+
name: t.name,
|
|
59
|
+
kind: "personal",
|
|
60
|
+
state: t.state,
|
|
61
|
+
updatedAt: Be()
|
|
62
|
+
};
|
|
63
|
+
return a(e, [...i(e), n]), n;
|
|
64
|
+
},
|
|
65
|
+
async update(e, t, n) {
|
|
66
|
+
let r = i(e), o = r.findIndex((e) => e.id === t);
|
|
67
|
+
if (o < 0) throw Error(`createLocalStorageViews: görünüm yok: ${t}`);
|
|
68
|
+
let s = {
|
|
69
|
+
...r[o],
|
|
70
|
+
...n.name !== void 0 && { name: n.name },
|
|
71
|
+
...n.state !== void 0 && { state: n.state },
|
|
72
|
+
updatedAt: Be()
|
|
73
|
+
};
|
|
74
|
+
return r[o] = s, a(e, r), s;
|
|
75
|
+
},
|
|
76
|
+
async remove(e, t) {
|
|
77
|
+
a(e, i(e).filter((e) => e.id !== t));
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
function He(e) {
|
|
82
|
+
let t = Re(e?.scope, "createLocalStoragePreferences"), n = Ie(), r = (e) => `dt:${t}:prefs:${e}`;
|
|
83
|
+
return {
|
|
84
|
+
get(e) {
|
|
85
|
+
return Le(n, r(e), {});
|
|
86
|
+
},
|
|
87
|
+
set(e, t) {
|
|
88
|
+
n.set(r(e), JSON.stringify({
|
|
89
|
+
...Le(n, r(e), {}),
|
|
90
|
+
...t
|
|
91
|
+
}));
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
var Ue = se({
|
|
96
|
+
columnSizingFeature: ne,
|
|
97
|
+
columnResizingFeature: J,
|
|
98
|
+
columnOrderingFeature: q,
|
|
99
|
+
columnPinningFeature: te,
|
|
100
|
+
columnVisibilityFeature: Y
|
|
101
|
+
}), We = [], Ge = (e) => typeof e == "number" ? `${e}px` : `minmax(${e.min}px, ${e.fr}fr)`, Ke = (e) => typeof e == "number" ? e : e.min, qe = (e) => `--dt-off-${e.replace(/[^a-zA-Z0-9_-]/g, "_")}`, Je = (e) => !!(e.alwaysVisible || e.primary);
|
|
102
|
+
function Ye(e) {
|
|
103
|
+
let t = e.columns, r = new Map(t.map((e) => [e.id, e])), [i, a] = V(1), [o, s] = V(!1), c = t.filter((e) => e.primary).map((e) => e.id), l = (e) => {
|
|
104
|
+
let t = n(e);
|
|
105
|
+
return typeof t == "number" ? Math.round(t * i) : {
|
|
106
|
+
...t,
|
|
107
|
+
min: Math.round(t.min * i)
|
|
108
|
+
};
|
|
109
|
+
}, u = (e) => Math.min(e.minWidth ?? 80, Ke(l(e))), f = (e, t) => {
|
|
110
|
+
let n = r.get(e);
|
|
111
|
+
return Math.min(n?.maxWidth ?? Infinity, Math.max(n ? u(n) : 80, Math.round(t)));
|
|
112
|
+
}, p = t.map((e) => {
|
|
113
|
+
let t = e.id;
|
|
114
|
+
return {
|
|
115
|
+
id: t,
|
|
116
|
+
accessorFn: e.accessor ?? ((e) => d(e, t)),
|
|
117
|
+
size: Ke(l(e)),
|
|
118
|
+
minSize: u(e),
|
|
119
|
+
maxSize: e.maxWidth,
|
|
120
|
+
enableHiding: !Je(e)
|
|
121
|
+
};
|
|
122
|
+
}), m = (e) => e?.filter((e) => r.has(e)), h = (e) => {
|
|
123
|
+
let n = c.filter((e) => r.has(e)), i = [...n, ...(m(e?.pinned?.left) ?? []).filter((e) => !n.includes(e))], a = (m(e?.pinned?.right) ?? []).filter((e) => !n.includes(e)), o = {};
|
|
124
|
+
for (let n of t) {
|
|
125
|
+
let t = n.id;
|
|
126
|
+
o[t] = Je(n) || (e?.visible ? e.visible.includes(t) : !n.hidden);
|
|
127
|
+
}
|
|
128
|
+
let s = {};
|
|
129
|
+
for (let [t, n] of Object.entries(e?.widths ?? {})) r.has(t) && (s[t] = f(t, n));
|
|
130
|
+
return {
|
|
131
|
+
columnPinning: {
|
|
132
|
+
start: i,
|
|
133
|
+
end: a
|
|
134
|
+
},
|
|
135
|
+
columnVisibility: o,
|
|
136
|
+
columnOrder: m(e?.order) ?? [],
|
|
137
|
+
columnSizing: s
|
|
138
|
+
};
|
|
139
|
+
}, g = Q({
|
|
140
|
+
features: Ue,
|
|
141
|
+
columns: p,
|
|
142
|
+
data: We,
|
|
143
|
+
initialState: h(e.layout),
|
|
144
|
+
columnResizeMode: "onChange"
|
|
145
|
+
}, (e) => ({
|
|
146
|
+
columnOrder: e.columnOrder,
|
|
147
|
+
columnVisibility: e.columnVisibility,
|
|
148
|
+
columnPinning: e.columnPinning
|
|
149
|
+
})), _ = new Map(g.getFlatHeaders().map((e) => [e.column.id, e])), v = (e, t, n) => ({
|
|
150
|
+
id: e.id,
|
|
151
|
+
def: r.get(e.id),
|
|
152
|
+
pinned: t,
|
|
153
|
+
pinEdge: n,
|
|
154
|
+
offsetVar: qe(e.id),
|
|
155
|
+
canHide: e.getCanHide(),
|
|
156
|
+
resizeHandler: (t) => _.get(e.id)?.getResizeHandler()(t)
|
|
157
|
+
}), y = (e) => !!r.get(e.id)?.primary, b = o ? g.getVisibleLeafColumns().filter(y) : g.getStartVisibleLeafColumns(), x = o ? g.getVisibleLeafColumns().filter((e) => !y(e)) : g.getCenterVisibleLeafColumns(), S = o ? [] : g.getEndVisibleLeafColumns(), C = (e) => o ? y(e) : e.getIsPinned() !== !1, w = b.map((e, t, n) => v(e, "start", t === n.length - 1)), T = x.map((e) => v(e, null, !1)), E = S.map((e, t) => v(e, "end", t === 0)), D = (e, t) => {
|
|
158
|
+
let n = g.atoms.columnSizing.get()[e.id] !== void 0;
|
|
159
|
+
return t || n ? e.getSize() : l(r.get(e.id));
|
|
160
|
+
}, O = () => [
|
|
161
|
+
...b.map((e) => Ge(D(e, !0))),
|
|
162
|
+
...x.map((e) => Ge(D(e, !1))),
|
|
163
|
+
"auto",
|
|
164
|
+
...S.map((e) => Ge(D(e, !0)))
|
|
165
|
+
].join(" "), k = () => {
|
|
166
|
+
let e = {}, t = 0;
|
|
167
|
+
for (let n of b) e[qe(n.id)] = `${t}px`, t += n.getSize();
|
|
168
|
+
for (let t of S) e[qe(t.id)] = `${t.getAfter("end")}px`;
|
|
169
|
+
return e;
|
|
170
|
+
}, A = () => g.getVisibleLeafColumns().reduce((e, t) => e + Ke(D(t, C(t))), 0), j = (e, t) => {
|
|
171
|
+
let n = g.getOrderColumnsFn()(g.getAllLeafColumns()), r = n.findIndex((t) => t.id === e), i = n[r];
|
|
172
|
+
if (!i) return;
|
|
173
|
+
let a = i.getIsPinned();
|
|
174
|
+
if (a) {
|
|
175
|
+
let n = g.atoms.columnPinning.get(), r = [...n[a] ?? []], i = (e) => !c.includes(e) && g.getColumn(e)?.getIsVisible() === !0, o = r.indexOf(e), s = o + t;
|
|
176
|
+
for (; s >= 0 && s < r.length && !i(r[s]);) s += t;
|
|
177
|
+
if (!i(e) || s < 0 || s >= r.length) return;
|
|
178
|
+
r[o] = r[s], r[s] = e, g.setColumnPinning({
|
|
179
|
+
...n,
|
|
180
|
+
[a]: r
|
|
181
|
+
});
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
let o = r + t;
|
|
185
|
+
for (; o >= 0 && o < n.length && !(n[o].getIsVisible() && n[o].getIsPinned() === a);) o += t;
|
|
186
|
+
let s = n[o];
|
|
187
|
+
if (!s) return;
|
|
188
|
+
let l = n.map((e) => e.id);
|
|
189
|
+
l[r] = s.id, l[o] = i.id, g.setColumnOrder(l);
|
|
190
|
+
}, M = (e) => {
|
|
191
|
+
let t = h(e);
|
|
192
|
+
g.setColumnOrder(t.columnOrder), g.setColumnVisibility(t.columnVisibility), g.setColumnPinning(t.columnPinning), g.setColumnSizing(t.columnSizing);
|
|
193
|
+
}, N = () => {
|
|
194
|
+
let e = g.atoms.columnPinning.get();
|
|
195
|
+
return {
|
|
196
|
+
order: g.getOrderColumnsFn()(g.getAllLeafColumns()).map((e) => e.id),
|
|
197
|
+
visible: g.getVisibleLeafColumns().map((e) => e.id),
|
|
198
|
+
widths: Object.fromEntries(Object.entries(g.atoms.columnSizing.get()).map(([e, t]) => [e, f(e, t)])),
|
|
199
|
+
pinned: {
|
|
200
|
+
left: [...e.start ?? []],
|
|
201
|
+
right: [...e.end ?? []]
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
}, P = (e) => {
|
|
205
|
+
let t = e.getIsPinned();
|
|
206
|
+
return t === "start" ? 0 : t === "end" ? 2 : 1;
|
|
207
|
+
}, F = [...g.getOrderColumnsFn()(g.getAllLeafColumns())].sort((e, t) => P(e) - P(t)).map((e) => {
|
|
208
|
+
let t = e.getIsPinned();
|
|
209
|
+
return {
|
|
210
|
+
id: e.id,
|
|
211
|
+
def: r.get(e.id),
|
|
212
|
+
visible: e.getIsVisible(),
|
|
213
|
+
pinned: t === !1 ? null : t,
|
|
214
|
+
canHide: e.getCanHide(),
|
|
215
|
+
fixed: c.includes(e.id)
|
|
216
|
+
};
|
|
217
|
+
}), I = () => {
|
|
218
|
+
let e = g.atoms.columnResizing.get().isResizingColumn;
|
|
219
|
+
return e ? {
|
|
220
|
+
id: e,
|
|
221
|
+
size: g.getColumn(e)?.getSize() ?? 0
|
|
222
|
+
} : null;
|
|
223
|
+
}, L = (e) => {
|
|
224
|
+
let t = g.atoms.columnSizing.subscribe(e), n = g.atoms.columnResizing.subscribe(e);
|
|
225
|
+
return () => {
|
|
226
|
+
t.unsubscribe(), n.unsubscribe();
|
|
227
|
+
};
|
|
228
|
+
};
|
|
229
|
+
return {
|
|
230
|
+
columns: [
|
|
231
|
+
...w,
|
|
232
|
+
...T,
|
|
233
|
+
...E
|
|
234
|
+
],
|
|
235
|
+
start: w,
|
|
236
|
+
center: T,
|
|
237
|
+
end: E,
|
|
238
|
+
scale: i,
|
|
239
|
+
setScale: a,
|
|
240
|
+
phone: o,
|
|
241
|
+
setPhone: s,
|
|
242
|
+
cols: O,
|
|
243
|
+
offsets: k,
|
|
244
|
+
minWidth: A,
|
|
245
|
+
resizing: I,
|
|
246
|
+
subscribeSizing: L,
|
|
247
|
+
move: j,
|
|
248
|
+
panel: F,
|
|
249
|
+
counts: {
|
|
250
|
+
shown: g.getVisibleLeafColumns().length,
|
|
251
|
+
total: g.getAllLeafColumns().length
|
|
252
|
+
},
|
|
253
|
+
state: N,
|
|
254
|
+
resolve: (e) => {
|
|
255
|
+
let n = h(e), r = [...n.columnOrder, ...t.map((e) => e.id).filter((e) => !n.columnOrder.includes(e))];
|
|
256
|
+
return {
|
|
257
|
+
order: r,
|
|
258
|
+
visible: r.filter((e) => n.columnVisibility[e]),
|
|
259
|
+
widths: n.columnSizing,
|
|
260
|
+
pinned: {
|
|
261
|
+
left: n.columnPinning.start,
|
|
262
|
+
right: n.columnPinning.end
|
|
263
|
+
}
|
|
264
|
+
};
|
|
265
|
+
},
|
|
266
|
+
arrange: (e) => {
|
|
267
|
+
let t = e.order.filter((t) => e.visible.includes(t) && !c.includes(t)), n = t.slice(0, e.start);
|
|
268
|
+
M({
|
|
269
|
+
order: e.order,
|
|
270
|
+
visible: e.visible,
|
|
271
|
+
widths: N().widths,
|
|
272
|
+
pinned: {
|
|
273
|
+
left: n,
|
|
274
|
+
right: e.end ? t.slice(n.length).slice(-e.end) : []
|
|
275
|
+
}
|
|
276
|
+
});
|
|
277
|
+
},
|
|
278
|
+
reset: (t = e.layout) => M(t),
|
|
279
|
+
widthOf: (e) => g.getColumn(e)?.getSize() ?? 0,
|
|
280
|
+
setWidth: (e, t) => g.setColumnSizing((n) => ({
|
|
281
|
+
...n,
|
|
282
|
+
[e]: f(e, t)
|
|
283
|
+
})),
|
|
284
|
+
setVisible: (e, t) => g.getColumn(e)?.toggleVisibility(t)
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
// src/core/preferences/use-preferences.ts
|
|
288
|
+
function Xe(e, t) {
|
|
289
|
+
if (!t) return e;
|
|
290
|
+
let n = { ...e };
|
|
291
|
+
return (t.density === "comfortable" || t.density === "standard" || t.density === "compact") && (n.density = t.density), typeof t.verticalLines == "boolean" && (n.verticalLines = t.verticalLines), typeof t.pageSize == "number" && t.pageSize > 0 && (n.pageSize = t.pageSize), "defaultViewId" in t && (n.defaultViewId = t.defaultViewId ?? null), n;
|
|
292
|
+
}
|
|
293
|
+
function Ze(e, t, n) {
|
|
294
|
+
let r = M(22), i;
|
|
295
|
+
r[0] !== t || r[1] !== e ? (i = () => t?.get(e), r[0] = t, r[1] = e, r[2] = i) : i = r[2];
|
|
296
|
+
let [a] = V(i), o;
|
|
297
|
+
r[3] !== n || r[4] !== a ? (o = () => a instanceof Promise ? n : Xe(n, a), r[3] = n, r[4] = a, r[5] = o) : o = r[5];
|
|
298
|
+
let [s, c] = V(o), [l, u] = V(!(a instanceof Promise)), d, f;
|
|
299
|
+
r[6] !== t || r[7] !== e ? (d = () => {
|
|
300
|
+
let n = t?.get(e);
|
|
301
|
+
if (!(n instanceof Promise)) return;
|
|
302
|
+
let r = !0;
|
|
303
|
+
return n.then((e) => r && c((t) => Xe(t, e))).catch($e).finally(() => r && u(!0)), () => {
|
|
304
|
+
r = !1;
|
|
305
|
+
};
|
|
306
|
+
}, f = [t, e], r[6] = t, r[7] = e, r[8] = d, r[9] = f) : (d = r[8], f = r[9]), I(d, f);
|
|
307
|
+
let p;
|
|
308
|
+
r[10] !== t || r[11] !== e ? (p = (n) => {
|
|
309
|
+
c((e) => Xe(e, n)), t && Promise.resolve(t.set(e, n)).catch(Qe);
|
|
310
|
+
}, r[10] = t, r[11] = e, r[12] = p) : p = r[12];
|
|
311
|
+
let m = p, h;
|
|
312
|
+
r[13] !== n || r[14] !== m ? (h = () => m({
|
|
313
|
+
density: n.density,
|
|
314
|
+
verticalLines: n.verticalLines,
|
|
315
|
+
pageSize: n.pageSize
|
|
316
|
+
}), r[13] = n, r[14] = m, r[15] = h) : h = r[15];
|
|
317
|
+
let g = t !== null, _;
|
|
318
|
+
return r[16] !== s || r[17] !== l || r[18] !== m || r[19] !== h || r[20] !== g ? (_ = {
|
|
319
|
+
prefs: s,
|
|
320
|
+
set: m,
|
|
321
|
+
reset: h,
|
|
322
|
+
persistent: g,
|
|
323
|
+
ready: l
|
|
324
|
+
}, r[16] = s, r[17] = l, r[18] = m, r[19] = h, r[20] = g, r[21] = _) : _ = r[21], _;
|
|
325
|
+
}
|
|
326
|
+
function Qe() {}
|
|
327
|
+
function $e() {}
|
|
328
|
+
// src/core/views/model.ts
|
|
329
|
+
function et(e, t) {
|
|
330
|
+
return (t ? e.find((e) => e.id === t) : void 0) ?? e.find((e) => e.kind === "system" && e.default) ?? e.find((e) => e.kind === "system") ?? null;
|
|
331
|
+
}
|
|
332
|
+
var tt = (e) => Array.isArray(e) ? `[${e.map(tt).join(",")}]` : typeof e == "object" && e ? `{${Object.keys(e).sort().map((t) => `${JSON.stringify(t)}:${tt(e[t])}`).join(",")}}` : JSON.stringify(e), nt = (e) => {
|
|
333
|
+
let t = "value" in e ? e.value : void 0;
|
|
334
|
+
return {
|
|
335
|
+
...e,
|
|
336
|
+
value: Array.isArray(t) ? [...t].sort() : t
|
|
337
|
+
};
|
|
338
|
+
}, rt = (e) => tt(e.map(nt).sort((e, t) => e.column.localeCompare(t.column))), it = (e) => [...e].sort().join("\0");
|
|
339
|
+
function at(e, t) {
|
|
340
|
+
if (rt(e.filters) !== rt(t.filters) || tt(e.sort) !== tt(t.sort)) return !1;
|
|
341
|
+
let n = e.columns, r = t.columns;
|
|
342
|
+
if (n.order.join("\0") !== r.order.join("\0") || it(n.visible) !== it(r.visible) || n.pinned.left.join("\0") !== r.pinned.left.join("\0") || n.pinned.right.join("\0") !== r.pinned.right.join("\0")) return !1;
|
|
343
|
+
for (let e of /* @__PURE__ */ new Set([...Object.keys(n.widths), ...Object.keys(r.widths)])) {
|
|
344
|
+
let t = n.widths[e], i = r.widths[e];
|
|
345
|
+
if (t === void 0 || i === void 0 ? t !== i : Math.abs(t - i) > 2) return !1;
|
|
346
|
+
}
|
|
347
|
+
return !0;
|
|
348
|
+
}
|
|
349
|
+
function ot(e, t, n, r) {
|
|
350
|
+
let i = e.trim();
|
|
351
|
+
if (!i) return "required";
|
|
352
|
+
if (i.length > 60) return "tooLong";
|
|
353
|
+
let a = i.toLocaleLowerCase(n);
|
|
354
|
+
return t.some((e) => e.kind === "personal" && e.id !== r && e.name.toLocaleLowerCase(n) === a) ? "taken" : null;
|
|
355
|
+
}
|
|
356
|
+
var st = (e, t) => [...e].sort((e, n) => t.compare(e.name, n.name));
|
|
357
|
+
// src/list/sort.ts
|
|
358
|
+
function ct(e, t, n) {
|
|
359
|
+
let r = e.findIndex((e) => e.column === t), i = r >= 0 ? e[r] : null, a = i ? i.dir === "asc" ? {
|
|
360
|
+
column: t,
|
|
361
|
+
dir: "desc"
|
|
362
|
+
} : null : {
|
|
363
|
+
column: t,
|
|
364
|
+
dir: "asc"
|
|
365
|
+
};
|
|
366
|
+
return n ? a ? r >= 0 ? e.map((e) => e.column === t ? a : e) : [...e, a].slice(-3) : e.filter((e) => e.column !== t) : a ? [a] : [];
|
|
367
|
+
}
|
|
368
|
+
var lt = (e, t, n) => n ? [{
|
|
369
|
+
column: t,
|
|
370
|
+
dir: n
|
|
371
|
+
}] : e.filter((e) => e.column !== t), ut = (e) => e == null || e === "";
|
|
372
|
+
function dt(e, t) {
|
|
373
|
+
let n = (e, t) => {
|
|
374
|
+
let n = ut(e), r = ut(t);
|
|
375
|
+
return n && r ? 0 : n ? 1 : r ? -1 : null;
|
|
376
|
+
};
|
|
377
|
+
if (c[e.type].numeric || e.type === "boolean" || e.type === "star") return (e, t) => n(e, t) ?? Number(e) - Number(t);
|
|
378
|
+
if (e.type === "date" || e.type === "datetime") return (e, t) => n(e, t) ?? new Date(e).getTime() - new Date(t).getTime();
|
|
379
|
+
let r = o(t).collator();
|
|
380
|
+
return (e, t) => n(e, t) ?? r.compare(String(e), String(t));
|
|
381
|
+
}
|
|
382
|
+
// src/list/use-list-table.ts
|
|
383
|
+
var ft = se({
|
|
384
|
+
columnFilteringFeature: K,
|
|
385
|
+
globalFilteringFeature: ae,
|
|
386
|
+
filteredRowModel: re(),
|
|
387
|
+
rowSortingFeature: Z,
|
|
388
|
+
sortedRowModel: X(),
|
|
389
|
+
rowPaginationFeature: oe,
|
|
390
|
+
paginatedRowModel: ie()
|
|
391
|
+
}), pt = [], mt = () => {}, ht = (e) => e.sortable ?? c[e.type].sortable, gt = (e) => e.filterable ?? c[e.type].filterable, _t = (e) => e.searchable ?? c[e.type].searchable, vt = (e) => e == null || e === "" || Array.isArray(e) && e.length === 0;
|
|
392
|
+
function yt(e) {
|
|
393
|
+
let t = e.columns.map((t) => {
|
|
394
|
+
let n = t.id, r = dt(t, e.locale);
|
|
395
|
+
return {
|
|
396
|
+
id: n,
|
|
397
|
+
accessorFn: t.accessor ?? ((e) => d(e, n)),
|
|
398
|
+
enableSorting: ht(t),
|
|
399
|
+
enableGlobalFilter: _t(t),
|
|
400
|
+
enableColumnFilter: gt(t),
|
|
401
|
+
filterFn: (t, n, r) => E(r, t.getValue(n), { locale: e.locale }),
|
|
402
|
+
sortFn: (e, t, n) => r(e.getValue(n), t.getValue(n)),
|
|
403
|
+
sortUndefined: 1
|
|
404
|
+
};
|
|
405
|
+
}), n = new Set(e.columns.filter((e) => _t(e)).map((e) => e.id)), r = Q({
|
|
406
|
+
features: ft,
|
|
407
|
+
columns: t,
|
|
408
|
+
data: e.rows ?? pt,
|
|
409
|
+
getRowId: e.rowId,
|
|
410
|
+
state: {
|
|
411
|
+
globalFilter: e.search.trim().toLocaleLowerCase(e.locale),
|
|
412
|
+
columnFilters: e.filters.map((e) => ({
|
|
413
|
+
id: e.column,
|
|
414
|
+
value: e
|
|
415
|
+
})),
|
|
416
|
+
sorting: e.sort.map((e) => ({
|
|
417
|
+
id: e.column,
|
|
418
|
+
desc: e.dir === "desc"
|
|
419
|
+
})),
|
|
420
|
+
pagination: {
|
|
421
|
+
pageIndex: e.page - 1,
|
|
422
|
+
pageSize: e.pageSize
|
|
423
|
+
}
|
|
424
|
+
},
|
|
425
|
+
getColumnCanGlobalFilter: (e) => n.has(e.id),
|
|
426
|
+
globalFilterFn: (t, n, r) => {
|
|
427
|
+
let i = t.getValue(n);
|
|
428
|
+
return !vt(i) && String(i).toLocaleLowerCase(e.locale).includes(r);
|
|
429
|
+
},
|
|
430
|
+
onGlobalFilterChange: mt,
|
|
431
|
+
onColumnFiltersChange: mt,
|
|
432
|
+
onSortingChange: mt,
|
|
433
|
+
onPaginationChange: mt,
|
|
434
|
+
autoResetPageIndex: !1,
|
|
435
|
+
maxMultiSortColCount: 3
|
|
436
|
+
}, (e) => ({
|
|
437
|
+
globalFilter: e.globalFilter,
|
|
438
|
+
columnFilters: e.columnFilters,
|
|
439
|
+
sorting: e.sorting,
|
|
440
|
+
pagination: e.pagination
|
|
441
|
+
}));
|
|
442
|
+
return e.rows ? {
|
|
443
|
+
rows: r.getRowModel().rows.map((e) => e.original),
|
|
444
|
+
total: r.getPrePaginatedRowModel().rows.length
|
|
445
|
+
} : {
|
|
446
|
+
rows: void 0,
|
|
447
|
+
total: void 0
|
|
448
|
+
};
|
|
449
|
+
}
|
|
450
|
+
// src/list/use-views.ts
|
|
451
|
+
function bt(e) {
|
|
452
|
+
let [t, n] = V([]), [r, i] = V(!e.adapter), [a, o] = V({}), s = ee(!1), c = ee(!1), l = [...e.system, ...t], u = l.find((t) => t.id === e.activeId) ?? null, d = !!u && !at(e.current, e.resolve(u.state)), f = (t, n = !0) => {
|
|
453
|
+
let r = { ...a };
|
|
454
|
+
u && (n && d ? r[u.id] = e.current : delete r[u.id]), o(r), e.apply(t?.id ?? null, t ? r[t.id] ?? e.resolve(t.state) : e.resolve({}));
|
|
455
|
+
};
|
|
456
|
+
I(() => {
|
|
457
|
+
if (!e.adapter) return;
|
|
458
|
+
let t = !0;
|
|
459
|
+
return e.adapter.list(e.tableId).then((e) => t && n(e)).catch(() => {}).finally(() => t && i(!0)), () => {
|
|
460
|
+
t = !1;
|
|
461
|
+
};
|
|
462
|
+
}, [e.adapter, e.tableId]);
|
|
463
|
+
let p = r && e.prefsReady;
|
|
464
|
+
I(() => {
|
|
465
|
+
if (!p || c.current) return;
|
|
466
|
+
if (c.current = !0, !e.auto) {
|
|
467
|
+
let n = t.find((t) => t.id === e.activeId);
|
|
468
|
+
n && !s.current && e.restoreColumns(n.state.columns);
|
|
469
|
+
return;
|
|
470
|
+
}
|
|
471
|
+
let n = et(l, e.defaultViewId);
|
|
472
|
+
n && e.auto && !s.current && !d && n.id !== e.activeId && f(n);
|
|
473
|
+
}, [p]);
|
|
474
|
+
let m = (e) => n((t) => t.map((t) => t.id === e.id ? e : t)), h = (e) => o((t) => Object.fromEntries(Object.entries(t).filter(([t]) => t !== e))), g = (t) => !!t && !!e.adapter && t.kind !== "system", _ = new Intl.Collator(e.locale);
|
|
475
|
+
return {
|
|
476
|
+
all: l,
|
|
477
|
+
sections: {
|
|
478
|
+
system: e.system,
|
|
479
|
+
personal: st(t, _)
|
|
480
|
+
},
|
|
481
|
+
active: u,
|
|
482
|
+
edited: d,
|
|
483
|
+
hasViews: l.length > 0 || !!e.adapter,
|
|
484
|
+
canSave: !!e.adapter,
|
|
485
|
+
hasDraft: (e) => e in a,
|
|
486
|
+
writable: g,
|
|
487
|
+
select: (e) => {
|
|
488
|
+
s.current = !0, f(l.find((t) => t.id === e) ?? null);
|
|
489
|
+
},
|
|
490
|
+
saveChanges: async () => {
|
|
491
|
+
g(u) && e.adapter && (m(await e.adapter.update(e.tableId, u.id, { state: e.current })), h(u.id));
|
|
492
|
+
},
|
|
493
|
+
discard: () => {
|
|
494
|
+
u && (h(u.id), e.apply(u.id, e.resolve(u.state)));
|
|
495
|
+
},
|
|
496
|
+
create: async (t) => {
|
|
497
|
+
if (!e.adapter) return;
|
|
498
|
+
let r = await e.adapter.create(e.tableId, {
|
|
499
|
+
name: t.name,
|
|
500
|
+
state: t.state
|
|
501
|
+
});
|
|
502
|
+
n((e) => [...e, r]), t.makeDefault && e.setDefaultViewId(r.id), s.current = !0, f(r, !t.fromCurrent);
|
|
503
|
+
},
|
|
504
|
+
rename: async (t, n) => {
|
|
505
|
+
e.adapter && m(await e.adapter.update(e.tableId, t, { name: n }));
|
|
506
|
+
},
|
|
507
|
+
remove: async (t) => {
|
|
508
|
+
if (!e.adapter) return;
|
|
509
|
+
await e.adapter.remove(e.tableId, t), n((e) => e.filter((e) => e.id !== t)), h(t);
|
|
510
|
+
let r = e.defaultViewId === t ? null : e.defaultViewId;
|
|
511
|
+
e.defaultViewId === t && e.setDefaultViewId(null), e.activeId === t && f(et(l.filter((e) => e.id !== t), r), !1);
|
|
512
|
+
}
|
|
513
|
+
};
|
|
514
|
+
}
|
|
515
|
+
// src/list/use-data-table.ts
|
|
516
|
+
var xt = [
|
|
517
|
+
50,
|
|
518
|
+
100,
|
|
519
|
+
250,
|
|
520
|
+
500
|
|
521
|
+
], St = {};
|
|
522
|
+
function Ct(e, t, n, r = []) {
|
|
523
|
+
let i = /* @__PURE__ */ new Set([n]);
|
|
524
|
+
for (let n of e) if (t.has(n.id)) {
|
|
525
|
+
n.accessor || i.add(n.id);
|
|
526
|
+
for (let e of n.fields ?? []) i.add(e);
|
|
527
|
+
}
|
|
528
|
+
for (let e of r) i.add(e);
|
|
529
|
+
return [...i];
|
|
530
|
+
}
|
|
531
|
+
function wt(t) {
|
|
532
|
+
let n = e(), r = t.rowKey ?? "id", i = (e) => String(d(e, r)), a = Ze(t.id, n.preferences, {
|
|
533
|
+
density: "standard",
|
|
534
|
+
verticalLines: !1,
|
|
535
|
+
pageSize: t.pageSize ?? 100,
|
|
536
|
+
defaultViewId: null
|
|
537
|
+
}), o = t.views ?? [], [s] = V(() => {
|
|
538
|
+
let e = t.state?.view === void 0 ? t.initialState?.view : t.state.view, n = e !== void 0;
|
|
539
|
+
return {
|
|
540
|
+
auto: !n,
|
|
541
|
+
view: n ? null : et(o, a.prefs.defaultViewId),
|
|
542
|
+
columns: (n ? o.find((t) => t.id === e) : null)?.state.columns
|
|
543
|
+
};
|
|
544
|
+
}), c = Ye({
|
|
545
|
+
columns: t.columns,
|
|
546
|
+
layout: s.view?.state.columns ?? s.columns
|
|
547
|
+
}), [l, u] = V(() => {
|
|
548
|
+
let e = s.view;
|
|
549
|
+
return e ? {
|
|
550
|
+
...t.initialState,
|
|
551
|
+
view: e.id,
|
|
552
|
+
filters: e.state.filters ?? [],
|
|
553
|
+
sort: e.state.sort ?? []
|
|
554
|
+
} : { ...t.initialState };
|
|
555
|
+
}), f = {
|
|
556
|
+
view: t.state?.view === void 0 ? l.view ?? null : t.state.view,
|
|
557
|
+
search: t.state?.search ?? l.search ?? "",
|
|
558
|
+
filters: t.state?.filters ?? l.filters ?? [],
|
|
559
|
+
sort: t.state?.sort ?? l.sort ?? [],
|
|
560
|
+
page: t.state?.page ?? l.page ?? 1,
|
|
561
|
+
pageSize: t.state?.pageSize ?? l.pageSize ?? a.prefs.pageSize
|
|
562
|
+
}, p = (e) => {
|
|
563
|
+
let n = {
|
|
564
|
+
...f,
|
|
565
|
+
...e
|
|
566
|
+
};
|
|
567
|
+
u(n), t.onStateChange?.(n);
|
|
568
|
+
};
|
|
569
|
+
I(() => {
|
|
570
|
+
let e = s.view;
|
|
571
|
+
e && t.onStateChange?.({
|
|
572
|
+
...f,
|
|
573
|
+
view: e.id,
|
|
574
|
+
filters: e.state.filters ?? [],
|
|
575
|
+
sort: e.state.sort ?? []
|
|
576
|
+
});
|
|
577
|
+
}, []), H(c.subscribeSizing, () => c.resizing() ? "" : JSON.stringify(c.state().widths));
|
|
578
|
+
let m = (e) => ({
|
|
579
|
+
filters: e.filters ?? [],
|
|
580
|
+
sort: e.sort ?? [],
|
|
581
|
+
columns: c.resolve(e.columns)
|
|
582
|
+
}), h = bt({
|
|
583
|
+
tableId: t.id,
|
|
584
|
+
system: o,
|
|
585
|
+
adapter: n.viewsAdapter,
|
|
586
|
+
locale: n.locale,
|
|
587
|
+
defaultViewId: a.prefs.defaultViewId,
|
|
588
|
+
setDefaultViewId: (e) => a.set({ defaultViewId: e }),
|
|
589
|
+
activeId: f.view,
|
|
590
|
+
auto: s.auto,
|
|
591
|
+
prefsReady: a.ready,
|
|
592
|
+
current: {
|
|
593
|
+
filters: f.filters,
|
|
594
|
+
sort: f.sort,
|
|
595
|
+
columns: c.state()
|
|
596
|
+
},
|
|
597
|
+
resolve: m,
|
|
598
|
+
apply: (e, t) => {
|
|
599
|
+
c.reset(t.columns), p({
|
|
600
|
+
view: e,
|
|
601
|
+
filters: t.filters,
|
|
602
|
+
sort: t.sort,
|
|
603
|
+
page: 1
|
|
604
|
+
});
|
|
605
|
+
},
|
|
606
|
+
restoreColumns: (e) => c.reset(e)
|
|
607
|
+
}), g = Ct(t.columns, new Set(c.columns.map((e) => e.id)), r, t.fields), _ = JSON.stringify([
|
|
608
|
+
f.search,
|
|
609
|
+
f.filters,
|
|
610
|
+
f.sort,
|
|
611
|
+
f.page,
|
|
612
|
+
f.pageSize
|
|
613
|
+
]), [v, y] = V({
|
|
614
|
+
identity: _,
|
|
615
|
+
fields: g
|
|
616
|
+
}), b = v.fields;
|
|
617
|
+
(v.identity !== _ || g.some((e) => !v.fields.includes(e))) && (b = g, y({
|
|
618
|
+
identity: _,
|
|
619
|
+
fields: b
|
|
620
|
+
}));
|
|
621
|
+
let x = {
|
|
622
|
+
search: f.search,
|
|
623
|
+
filters: f.filters,
|
|
624
|
+
sort: f.sort,
|
|
625
|
+
page: {
|
|
626
|
+
number: f.page,
|
|
627
|
+
size: f.pageSize
|
|
628
|
+
},
|
|
629
|
+
fields: b
|
|
630
|
+
}, [S, C] = V({
|
|
631
|
+
identity: _,
|
|
632
|
+
ids: St
|
|
633
|
+
});
|
|
634
|
+
S.identity !== _ && C({
|
|
635
|
+
identity: _,
|
|
636
|
+
ids: St
|
|
637
|
+
});
|
|
638
|
+
let w = S.identity === _ ? S.ids : St, T = yt({
|
|
639
|
+
columns: t.columns,
|
|
640
|
+
rows: t.rows,
|
|
641
|
+
rowId: i,
|
|
642
|
+
locale: n.locale,
|
|
643
|
+
search: f.search,
|
|
644
|
+
filters: f.filters,
|
|
645
|
+
sort: f.sort,
|
|
646
|
+
page: f.page,
|
|
647
|
+
pageSize: f.pageSize
|
|
648
|
+
});
|
|
649
|
+
return {
|
|
650
|
+
id: t.id,
|
|
651
|
+
columns: t.columns,
|
|
652
|
+
entityName: t.entityName ?? {
|
|
653
|
+
one: t.id,
|
|
654
|
+
other: t.id
|
|
655
|
+
},
|
|
656
|
+
request: x,
|
|
657
|
+
state: f,
|
|
658
|
+
allRows: t.rows,
|
|
659
|
+
rows: T.rows,
|
|
660
|
+
total: T.total,
|
|
661
|
+
density: t.density ?? a.prefs.density,
|
|
662
|
+
densityFixed: t.density !== void 0,
|
|
663
|
+
prefs: a,
|
|
664
|
+
views: h,
|
|
665
|
+
resolveView: (e) => m(e.state),
|
|
666
|
+
resetDisplay: () => {
|
|
667
|
+
a.reset(), c.reset(h.active?.state.columns);
|
|
668
|
+
},
|
|
669
|
+
selection: w,
|
|
670
|
+
setSelection: (e) => C({
|
|
671
|
+
identity: _,
|
|
672
|
+
ids: e
|
|
673
|
+
}),
|
|
674
|
+
clearSelection: () => C({
|
|
675
|
+
identity: _,
|
|
676
|
+
ids: St
|
|
677
|
+
}),
|
|
678
|
+
pageSizes: t.pageSizes ?? xt,
|
|
679
|
+
count: t.count,
|
|
680
|
+
rowId: i,
|
|
681
|
+
layout: c,
|
|
682
|
+
toggleSort: (e, t) => p({
|
|
683
|
+
sort: ct(f.sort, e, t),
|
|
684
|
+
page: 1
|
|
685
|
+
}),
|
|
686
|
+
setSort: (e, t) => p({
|
|
687
|
+
sort: lt(f.sort, e, t),
|
|
688
|
+
page: 1
|
|
689
|
+
}),
|
|
690
|
+
setSearch: (e) => p({
|
|
691
|
+
search: e,
|
|
692
|
+
page: 1
|
|
693
|
+
}),
|
|
694
|
+
setFilters: (e) => p({
|
|
695
|
+
filters: e,
|
|
696
|
+
page: 1
|
|
697
|
+
}),
|
|
698
|
+
setQuery: (e) => p({
|
|
699
|
+
...e,
|
|
700
|
+
page: 1
|
|
701
|
+
}),
|
|
702
|
+
setPage: (e) => p({ page: e }),
|
|
703
|
+
setPageSize: (e) => {
|
|
704
|
+
a.set({ pageSize: e }), p({
|
|
705
|
+
pageSize: e,
|
|
706
|
+
page: 1
|
|
707
|
+
});
|
|
708
|
+
}
|
|
709
|
+
};
|
|
710
|
+
}
|
|
711
|
+
// src/core/export/cells.ts
|
|
712
|
+
function Tt(e, t, n, r) {
|
|
713
|
+
if (v(n)) return "";
|
|
714
|
+
switch (e.type) {
|
|
715
|
+
case "currency": return r.fmt.decimal(Number(n), i(e));
|
|
716
|
+
case "date":
|
|
717
|
+
case "datetime": return n instanceof Date ? n.toISOString() : String(n);
|
|
718
|
+
case "multiselect": return n.map((t) => a(e.options, t)).join("; ");
|
|
719
|
+
case "string":
|
|
720
|
+
case "text":
|
|
721
|
+
case "uppercase":
|
|
722
|
+
case "lowercase":
|
|
723
|
+
case "email":
|
|
724
|
+
case "url":
|
|
725
|
+
case "phone":
|
|
726
|
+
case "id": return String(n);
|
|
727
|
+
default: return u(e, t, n, r);
|
|
728
|
+
}
|
|
729
|
+
}
|
|
730
|
+
var Et = /* @__PURE__ */ new Map();
|
|
731
|
+
function Dt(e) {
|
|
732
|
+
let t = Et.get(e);
|
|
733
|
+
if (t === void 0) {
|
|
734
|
+
let n = new Intl.DateTimeFormat(e, {
|
|
735
|
+
year: "numeric",
|
|
736
|
+
month: "2-digit",
|
|
737
|
+
day: "2-digit"
|
|
738
|
+
}).formatToParts(new Date(2026, 9, 24)), r = {
|
|
739
|
+
year: "yyyy",
|
|
740
|
+
month: "mm",
|
|
741
|
+
day: "dd"
|
|
742
|
+
};
|
|
743
|
+
t = n.map((e) => r[e.type] ?? e.value).join(""), Et.set(e, t);
|
|
744
|
+
}
|
|
745
|
+
return t;
|
|
746
|
+
}
|
|
747
|
+
var Ot = (e) => e > 0 ? `#,##0.${"0".repeat(e)}` : "#,##0", kt = (e) => new Date(Date.UTC(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds()));
|
|
748
|
+
function At(e, t, n, r) {
|
|
749
|
+
if (v(n)) return { value: null };
|
|
750
|
+
switch (e.type) {
|
|
751
|
+
case "int":
|
|
752
|
+
case "star": return {
|
|
753
|
+
value: Number(n),
|
|
754
|
+
type: Number,
|
|
755
|
+
format: "#,##0"
|
|
756
|
+
};
|
|
757
|
+
case "float": return {
|
|
758
|
+
value: Number(n),
|
|
759
|
+
type: Number,
|
|
760
|
+
format: Ot(i(e))
|
|
761
|
+
};
|
|
762
|
+
case "percentage": return {
|
|
763
|
+
value: Number(n),
|
|
764
|
+
type: Number,
|
|
765
|
+
format: `${Ot(i(e))}"%"`
|
|
766
|
+
};
|
|
767
|
+
case "currency": {
|
|
768
|
+
let t = typeof e.currency == "string" ? ` "${e.currency}"` : "";
|
|
769
|
+
return {
|
|
770
|
+
value: Number(n),
|
|
771
|
+
type: Number,
|
|
772
|
+
format: Ot(i(e)) + t
|
|
773
|
+
};
|
|
774
|
+
}
|
|
775
|
+
case "date":
|
|
776
|
+
case "datetime": {
|
|
777
|
+
let t = m(n);
|
|
778
|
+
if (Number.isNaN(t.getTime())) return {
|
|
779
|
+
value: String(n),
|
|
780
|
+
type: String
|
|
781
|
+
};
|
|
782
|
+
let i = Dt(r.i18n.locale);
|
|
783
|
+
return {
|
|
784
|
+
value: kt(t),
|
|
785
|
+
type: Date,
|
|
786
|
+
format: e.type === "date" ? i : `${i} hh:mm`
|
|
787
|
+
};
|
|
788
|
+
}
|
|
789
|
+
default: {
|
|
790
|
+
let i = Tt(e, t, n, r);
|
|
791
|
+
return {
|
|
792
|
+
value: i === "" ? null : i,
|
|
793
|
+
type: String
|
|
794
|
+
};
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
function jt(e, t) {
|
|
799
|
+
return e.type === "select" ? e.options.map((e) => e.label) : e.type === "boolean" ? [t.i18n.t("common.yes"), t.i18n.t("common.no")] : null;
|
|
800
|
+
}
|
|
801
|
+
// src/core/export/write.ts
|
|
802
|
+
var Mt = {
|
|
803
|
+
fontWeight: "bold",
|
|
804
|
+
textColor: "#15171C",
|
|
805
|
+
backgroundColor: "#E8EAEE",
|
|
806
|
+
borderColor: "#B4B9C2",
|
|
807
|
+
borderStyle: "thin",
|
|
808
|
+
alignVertical: "center"
|
|
809
|
+
}, Nt = 16, Pt = (e) => e.replace(/[[\]:*?/\\]/g, " ").slice(0, 31) || "Sheet1";
|
|
810
|
+
function Ft(e) {
|
|
811
|
+
let t = 0;
|
|
812
|
+
for (let n of e) t = Math.max(t, ...n.split("\n").map((e) => e.length));
|
|
813
|
+
return Math.round(Math.min(60, Math.max(8, t + 2)) * (Nt / 11));
|
|
814
|
+
}
|
|
815
|
+
function It(e) {
|
|
816
|
+
let t = e.env.fmt.decimal(1.5, 1).includes(",") ? ";" : ",", n = (e) => e.includes(t) || /["\r\n]/.test(e) ? `"${e.replace(/"/g, "\"\"")}"` : e;
|
|
817
|
+
return [e.columns.map((e) => n(e.header)), ...e.rows.map((t) => e.columns.map((r) => n(Tt(r, t, e.read(t, r), e.env))))].map((e) => e.join(t)).join("\r\n");
|
|
818
|
+
}
|
|
819
|
+
async function Lt(e) {
|
|
820
|
+
let [{ default: t }, n] = await Promise.all([import("write-excel-file/browser"), import("write-excel-file/utility")]), { columns: r, rows: i, env: a } = e, o = [r.map((e) => ({
|
|
821
|
+
value: e.header,
|
|
822
|
+
...Mt
|
|
823
|
+
})), ...i.map((t) => r.map((n) => At(n, t, e.read(t, n), a)))], s = i.slice(0, 200), c = r.map((t) => ({ width: Ft([t.header, ...s.map((n) => Tt(t, n, e.read(n, t), a))]) })), l = r.flatMap((e, t) => {
|
|
824
|
+
let n = jt(e, a);
|
|
825
|
+
return n ? [{
|
|
826
|
+
column: t + 1,
|
|
827
|
+
header: e.header,
|
|
828
|
+
values: n
|
|
829
|
+
}] : [];
|
|
830
|
+
}), u = Pt(a.i18n.t("export.optionsSheet")), d = `'${u.replace(/'/g, "''")}'`, f = i.length ? l.map((e, t) => {
|
|
831
|
+
let r = n.getCellAddress(0, t).replace(/\d+$/, "");
|
|
832
|
+
return `<dataValidation type="list" allowBlank="1" showErrorMessage="1" sqref="${n.getCellAddress(1, e.column - 1) + ":" + n.getCellAddress(i.length, e.column - 1)}"><formula1>${n.sanitizeTextContent(`${d}!$${r}$2:$${r}$${e.values.length + 1}`)}</formula1></dataValidation>`;
|
|
833
|
+
}) : [], p = Math.max(0, ...l.map((e) => e.values.length)), m = [l.map((e) => ({
|
|
834
|
+
value: e.header,
|
|
835
|
+
...Mt
|
|
836
|
+
})), ...Array.from({ length: p }, (e, t) => l.map((e) => ({ value: e.values[t] ?? null })))], h = { files: { transform: { "xl/worksheets/sheet{id}.xml": { transform: (e, t, r) => {
|
|
837
|
+
if (r.sheetIndex !== 0 || !f.length) return e;
|
|
838
|
+
let i = n.getOrderOfSiblings("xl/worksheets/sheet{id}.xml", "worksheet"), a = `<dataValidations count="${f.length}">${f.join("")}</dataValidations>`;
|
|
839
|
+
return n.insertElementMarkupAccordingToOrderOfSiblings(e, a, i, "worksheet");
|
|
840
|
+
} } } } }, g = {
|
|
841
|
+
sheet: Pt(e.name),
|
|
842
|
+
data: o,
|
|
843
|
+
columns: c,
|
|
844
|
+
stickyRowsCount: 1
|
|
845
|
+
};
|
|
846
|
+
return t(l.length ? [g, {
|
|
847
|
+
sheet: u,
|
|
848
|
+
data: m,
|
|
849
|
+
columns: l.map((e) => ({ width: Ft([e.header, ...e.values]) }))
|
|
850
|
+
}] : [g], {
|
|
851
|
+
features: [h],
|
|
852
|
+
fontSize: Nt
|
|
853
|
+
}).toBlob();
|
|
854
|
+
}
|
|
855
|
+
function Rt(e, t) {
|
|
856
|
+
let n = document.createElement("a");
|
|
857
|
+
n.href = URL.createObjectURL(e), n.download = t, n.click(), setTimeout(() => URL.revokeObjectURL(n.href), 1e3);
|
|
858
|
+
}
|
|
859
|
+
async function zt(e) {
|
|
860
|
+
Rt(e.format === "csv" ? new Blob(["" + It(e)], { type: "text/csv;charset=utf-8" }) : await Lt(e), `${e.name}.${e.format}`);
|
|
861
|
+
}
|
|
862
|
+
// src/core/cells/remote-labels.ts
|
|
863
|
+
var Bt = class {
|
|
864
|
+
cache = /* @__PURE__ */ new Map();
|
|
865
|
+
pending = /* @__PURE__ */ new Map();
|
|
866
|
+
inFlight = /* @__PURE__ */ new Map();
|
|
867
|
+
scheduled = !1;
|
|
868
|
+
listeners = /* @__PURE__ */ new Set();
|
|
869
|
+
version = 0;
|
|
870
|
+
subscribe = (e) => (this.listeners.add(e), () => this.listeners.delete(e));
|
|
871
|
+
getVersion = () => this.version;
|
|
872
|
+
option(e, t, n) {
|
|
873
|
+
let r = this.cache.get(e)?.get(n);
|
|
874
|
+
if (r || !t) return r;
|
|
875
|
+
if (!this.inFlight.get(e)?.has(n)) {
|
|
876
|
+
let r = this.pending.get(e);
|
|
877
|
+
r || this.pending.set(e, r = {
|
|
878
|
+
remote: t,
|
|
879
|
+
ids: /* @__PURE__ */ new Set()
|
|
880
|
+
}), r.ids.add(n), this.schedule();
|
|
881
|
+
}
|
|
882
|
+
}
|
|
883
|
+
label(e, t, n) {
|
|
884
|
+
return this.option(e, t, n)?.label ?? String(n);
|
|
885
|
+
}
|
|
886
|
+
seed(e, t) {
|
|
887
|
+
let n = this.cache.get(e);
|
|
888
|
+
n || this.cache.set(e, n = /* @__PURE__ */ new Map());
|
|
889
|
+
for (let e of t) n.set(e.value, e);
|
|
890
|
+
this.version++;
|
|
891
|
+
for (let e of this.listeners) e();
|
|
892
|
+
}
|
|
893
|
+
schedule() {
|
|
894
|
+
this.scheduled || (this.scheduled = !0, queueMicrotask(() => {
|
|
895
|
+
this.scheduled = !1;
|
|
896
|
+
for (let [e, { remote: t, ids: n }] of this.pending) {
|
|
897
|
+
this.pending.delete(e);
|
|
898
|
+
let r = [...n], i = this.inFlight.get(e);
|
|
899
|
+
i || this.inFlight.set(e, i = /* @__PURE__ */ new Set()), r.forEach((e) => i.add(e)), t.resolve(r, { signal: new AbortController().signal }).then((t) => this.seed(e, t)).catch(() => {}).finally(() => r.forEach((e) => i.delete(e)));
|
|
900
|
+
}
|
|
901
|
+
}));
|
|
902
|
+
}
|
|
903
|
+
};
|
|
904
|
+
// src/core/filters/column-picker.tsx
|
|
905
|
+
function Vt(t) {
|
|
906
|
+
let n = M(89), { columns: r, chips: i, trigger: a, open: o, onOpenChange: s, onPick: c } = t, { i18n: l } = e(), [u, d] = V(!1), f = o ?? u, p;
|
|
907
|
+
n[0] === s ? p = n[1] : (p = (e) => {
|
|
908
|
+
d(e), s?.(e);
|
|
909
|
+
}, n[0] = s, n[1] = p);
|
|
910
|
+
let m = p, [h, g] = V(""), _ = ee(!1), v, y, x, S, C, w, T, E, D, O, k, A, j, N, P, F, I, L, R, z, B, H, U, K;
|
|
911
|
+
if (n[2] !== i || n[3] !== r || n[4] !== l || n[5] !== f || n[6] !== c || n[7] !== h || n[8] !== m || n[9] !== a) {
|
|
912
|
+
let e = h.toLocaleLowerCase(), t = (t) => !h || t.header.toLocaleLowerCase().includes(e), o = new Set(i.map(Gt)), s = i.map((e) => r.find((t) => t.id === e.column)).filter((e) => !!e && t(e)), u = r.filter((e) => e.suggested && !o.has(e.id) && t(e)).slice(0, 4), d = /* @__PURE__ */ new Set([...o, ...u.map(Wt)]), p = r.filter((e) => !d.has(e.id) && t(e)), M = (e) => l.t(b(e.type));
|
|
913
|
+
w = [
|
|
914
|
+
{
|
|
915
|
+
key: "filtered",
|
|
916
|
+
label: l.t("picker.filtered"),
|
|
917
|
+
items: s,
|
|
918
|
+
hint: () => l.t("picker.filteredHint")
|
|
919
|
+
},
|
|
920
|
+
{
|
|
921
|
+
key: "suggested",
|
|
922
|
+
label: l.t("picker.suggested"),
|
|
923
|
+
items: u,
|
|
924
|
+
hint: M
|
|
925
|
+
},
|
|
926
|
+
{
|
|
927
|
+
key: "all",
|
|
928
|
+
label: l.t("picker.allColumns"),
|
|
929
|
+
items: p,
|
|
930
|
+
hint: M
|
|
931
|
+
}
|
|
932
|
+
].filter(Ut), C = ke.Root, E = f, n[34] === m ? D = n[35] : (D = (e) => {
|
|
933
|
+
m(e), e || g("");
|
|
934
|
+
}, n[34] = m, n[35] = D), O = null, n[36] !== c || n[37] !== m ? (k = (e) => {
|
|
935
|
+
typeof e == "string" && (_.current = !0, m(!1), g(""), c(e));
|
|
936
|
+
}, n[36] = c, n[37] = m, n[38] = k) : k = n[38], A = h, n[39] === Symbol.for("react.memo_cache_sentinel") ? (j = (e) => g(e), n[39] = j) : j = n[39], N = null, P = !0, n[40] === a ? F = n[41] : (F = /* @__PURE__ */ W(ke.Trigger, { render: a }), n[40] = a, n[41] = F), S = ke.Portal, x = ke.Positioner, U = "dt-positioner", K = "start", T = 4, y = ke.Popup, z = "dt-pop dt-picker", n[42] === Symbol.for("react.memo_cache_sentinel") ? (B = () => {
|
|
937
|
+
let e = !_.current;
|
|
938
|
+
return _.current = !1, e;
|
|
939
|
+
}, n[42] = B) : B = n[42];
|
|
940
|
+
let ee;
|
|
941
|
+
n[43] === Symbol.for("react.memo_cache_sentinel") ? (ee = /* @__PURE__ */ W("span", {
|
|
942
|
+
className: "dt-input-icon",
|
|
943
|
+
children: /* @__PURE__ */ W(ye, {
|
|
944
|
+
size: 14,
|
|
945
|
+
"aria-hidden": "true"
|
|
946
|
+
})
|
|
947
|
+
}), n[43] = ee) : ee = n[43];
|
|
948
|
+
let V;
|
|
949
|
+
n[44] === l ? V = n[45] : (V = l.t("picker.search"), n[44] = l, n[45] = V);
|
|
950
|
+
let q;
|
|
951
|
+
n[46] === l ? q = n[47] : (q = l.t("picker.search"), n[46] = l, n[47] = q), n[48] !== V || n[49] !== q ? (H = /* @__PURE__ */ G("label", {
|
|
952
|
+
className: "dt-input has-icon dt-picker-search",
|
|
953
|
+
children: [ee, /* @__PURE__ */ W(ke.Input, {
|
|
954
|
+
placeholder: V,
|
|
955
|
+
"aria-label": q
|
|
956
|
+
})]
|
|
957
|
+
}), n[48] = V, n[49] = q, n[50] = H) : H = n[50], v = ke.List, I = "dt-picker-list", n[51] === l ? L = n[52] : (L = l.t("display.columns"), n[51] = l, n[52] = L), R = w.map(Ht), n[2] = i, n[3] = r, n[4] = l, n[5] = f, n[6] = c, n[7] = h, n[8] = m, n[9] = a, n[10] = v, n[11] = y, n[12] = x, n[13] = S, n[14] = C, n[15] = w, n[16] = T, n[17] = E, n[18] = D, n[19] = O, n[20] = k, n[21] = A, n[22] = j, n[23] = N, n[24] = P, n[25] = F, n[26] = I, n[27] = L, n[28] = R, n[29] = z, n[30] = B, n[31] = H, n[32] = U, n[33] = K;
|
|
958
|
+
} else v = n[10], y = n[11], x = n[12], S = n[13], C = n[14], w = n[15], T = n[16], E = n[17], D = n[18], O = n[19], k = n[20], A = n[21], j = n[22], N = n[23], P = n[24], F = n[25], I = n[26], L = n[27], R = n[28], z = n[29], B = n[30], H = n[31], U = n[32], K = n[33];
|
|
959
|
+
let q;
|
|
960
|
+
n[53] !== v || n[54] !== I || n[55] !== L || n[56] !== R ? (q = /* @__PURE__ */ W(v, {
|
|
961
|
+
className: I,
|
|
962
|
+
"aria-label": L,
|
|
963
|
+
children: R
|
|
964
|
+
}), n[53] = v, n[54] = I, n[55] = L, n[56] = R, n[57] = q) : q = n[57];
|
|
965
|
+
let te;
|
|
966
|
+
n[58] !== w.length || n[59] !== l ? (te = w.length === 0 && /* @__PURE__ */ W("div", {
|
|
967
|
+
className: "dt-options-empty",
|
|
968
|
+
children: l.t("picker.noMatch")
|
|
969
|
+
}), n[58] = w.length, n[59] = l, n[60] = te) : te = n[60];
|
|
970
|
+
let J;
|
|
971
|
+
n[61] !== y || n[62] !== q || n[63] !== te || n[64] !== z || n[65] !== B || n[66] !== H ? (J = /* @__PURE__ */ G(y, {
|
|
972
|
+
className: z,
|
|
973
|
+
finalFocus: B,
|
|
974
|
+
children: [
|
|
975
|
+
H,
|
|
976
|
+
q,
|
|
977
|
+
te
|
|
978
|
+
]
|
|
979
|
+
}), n[61] = y, n[62] = q, n[63] = te, n[64] = z, n[65] = B, n[66] = H, n[67] = J) : J = n[67];
|
|
980
|
+
let ne;
|
|
981
|
+
n[68] !== x || n[69] !== T || n[70] !== J || n[71] !== U || n[72] !== K ? (ne = /* @__PURE__ */ W(x, {
|
|
982
|
+
className: U,
|
|
983
|
+
align: K,
|
|
984
|
+
sideOffset: T,
|
|
985
|
+
children: J
|
|
986
|
+
}), n[68] = x, n[69] = T, n[70] = J, n[71] = U, n[72] = K, n[73] = ne) : ne = n[73];
|
|
987
|
+
let Y;
|
|
988
|
+
n[74] !== S || n[75] !== ne ? (Y = /* @__PURE__ */ W(S, { children: ne }), n[74] = S, n[75] = ne, n[76] = Y) : Y = n[76];
|
|
989
|
+
let re;
|
|
990
|
+
return n[77] !== C || n[78] !== E || n[79] !== D || n[80] !== O || n[81] !== k || n[82] !== A || n[83] !== j || n[84] !== N || n[85] !== P || n[86] !== F || n[87] !== Y ? (re = /* @__PURE__ */ G(C, {
|
|
991
|
+
open: E,
|
|
992
|
+
onOpenChange: D,
|
|
993
|
+
value: O,
|
|
994
|
+
onValueChange: k,
|
|
995
|
+
inputValue: A,
|
|
996
|
+
onInputValueChange: j,
|
|
997
|
+
filter: N,
|
|
998
|
+
autoHighlight: P,
|
|
999
|
+
children: [F, Y]
|
|
1000
|
+
}), n[77] = C, n[78] = E, n[79] = D, n[80] = O, n[81] = k, n[82] = A, n[83] = j, n[84] = N, n[85] = P, n[86] = F, n[87] = Y, n[88] = re) : re = n[88], re;
|
|
1001
|
+
}
|
|
1002
|
+
function Ht(e) {
|
|
1003
|
+
return /* @__PURE__ */ G(ke.Group, { children: [/* @__PURE__ */ W(ke.GroupLabel, {
|
|
1004
|
+
className: "dt-pop-label",
|
|
1005
|
+
children: e.label
|
|
1006
|
+
}), e.items.map((t) => {
|
|
1007
|
+
let n = g[t.type];
|
|
1008
|
+
return /* @__PURE__ */ G(ke.Item, {
|
|
1009
|
+
value: t.id,
|
|
1010
|
+
className: "dt-picker-item",
|
|
1011
|
+
children: [
|
|
1012
|
+
/* @__PURE__ */ W(n, {
|
|
1013
|
+
size: 14,
|
|
1014
|
+
"aria-hidden": "true"
|
|
1015
|
+
}),
|
|
1016
|
+
/* @__PURE__ */ W("span", {
|
|
1017
|
+
className: "dt-picker-name",
|
|
1018
|
+
children: t.header
|
|
1019
|
+
}),
|
|
1020
|
+
/* @__PURE__ */ W("span", {
|
|
1021
|
+
className: "dt-picker-hint",
|
|
1022
|
+
children: e.hint(t)
|
|
1023
|
+
})
|
|
1024
|
+
]
|
|
1025
|
+
}, t.id);
|
|
1026
|
+
})] }, e.key);
|
|
1027
|
+
}
|
|
1028
|
+
function Ut(e) {
|
|
1029
|
+
return e.items.length;
|
|
1030
|
+
}
|
|
1031
|
+
function Wt(e) {
|
|
1032
|
+
return e.id;
|
|
1033
|
+
}
|
|
1034
|
+
function Gt(e) {
|
|
1035
|
+
return e.column;
|
|
1036
|
+
}
|
|
1037
|
+
// src/core/ui/menu.tsx
|
|
1038
|
+
function Kt(e) {
|
|
1039
|
+
let t = M(18), { trigger: n, children: r, open: i, onOpenChange: a, className: o, finalFocus: s, align: c, side: l, offset: u } = e, d = c === void 0 ? "end" : c, f;
|
|
1040
|
+
t[0] === a ? f = t[1] : (f = a ? (e) => a(e) : void 0, t[0] = a, t[1] = f);
|
|
1041
|
+
let p;
|
|
1042
|
+
t[2] === n ? p = t[3] : (p = /* @__PURE__ */ W(Ae.Trigger, { render: n }), t[2] = n, t[3] = p);
|
|
1043
|
+
let m = u ?? (l === "right" ? 8 : d === "start" ? 6 : 4), h = o ? `dt-menu ${o}` : "dt-menu", g;
|
|
1044
|
+
t[4] !== r || t[5] !== s || t[6] !== h ? (g = /* @__PURE__ */ W(Ae.Popup, {
|
|
1045
|
+
className: h,
|
|
1046
|
+
finalFocus: s,
|
|
1047
|
+
children: r
|
|
1048
|
+
}), t[4] = r, t[5] = s, t[6] = h, t[7] = g) : g = t[7];
|
|
1049
|
+
let _;
|
|
1050
|
+
t[8] !== d || t[9] !== l || t[10] !== m || t[11] !== g ? (_ = /* @__PURE__ */ W(Ae.Portal, { children: /* @__PURE__ */ W(Ae.Positioner, {
|
|
1051
|
+
className: "dt-positioner",
|
|
1052
|
+
side: l,
|
|
1053
|
+
align: d,
|
|
1054
|
+
sideOffset: m,
|
|
1055
|
+
children: g
|
|
1056
|
+
}) }), t[8] = d, t[9] = l, t[10] = m, t[11] = g, t[12] = _) : _ = t[12];
|
|
1057
|
+
let v;
|
|
1058
|
+
return t[13] !== i || t[14] !== f || t[15] !== p || t[16] !== _ ? (v = /* @__PURE__ */ G(Ae.Root, {
|
|
1059
|
+
open: i,
|
|
1060
|
+
onOpenChange: f,
|
|
1061
|
+
children: [p, _]
|
|
1062
|
+
}), t[13] = i, t[14] = f, t[15] = p, t[16] = _, t[17] = v) : v = t[17], v;
|
|
1063
|
+
}
|
|
1064
|
+
function qt(e) {
|
|
1065
|
+
let t = M(11), { children: n, onSelect: r, disabled: i, destructive: a, selected: o, twoLine: s } = e, c = a && "is-destructive", l = o && "is-selected", u = s && "is-two-line", d;
|
|
1066
|
+
t[0] !== c || t[1] !== l || t[2] !== u ? (d = [
|
|
1067
|
+
"dt-menu-item",
|
|
1068
|
+
c,
|
|
1069
|
+
l,
|
|
1070
|
+
u
|
|
1071
|
+
], t[0] = c, t[1] = l, t[2] = u, t[3] = d) : d = t[3];
|
|
1072
|
+
let f = d, p;
|
|
1073
|
+
t[4] === f ? p = t[5] : (p = f.filter(Boolean), t[4] = f, t[5] = p);
|
|
1074
|
+
let m = p.join(" "), h;
|
|
1075
|
+
return t[6] !== n || t[7] !== i || t[8] !== r || t[9] !== m ? (h = /* @__PURE__ */ W(Ae.Item, {
|
|
1076
|
+
className: m,
|
|
1077
|
+
disabled: i,
|
|
1078
|
+
onClick: r,
|
|
1079
|
+
children: n
|
|
1080
|
+
}), t[6] = n, t[7] = i, t[8] = r, t[9] = m, t[10] = h) : h = t[10], h;
|
|
1081
|
+
}
|
|
1082
|
+
var Jt = () => {
|
|
1083
|
+
let e = M(1), t;
|
|
1084
|
+
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ W(Ae.Separator, { className: "dt-menu-sep" }), e[0] = t) : t = e[0], t;
|
|
1085
|
+
}, Yt = (e) => {
|
|
1086
|
+
let t = M(2), { children: n } = e, r;
|
|
1087
|
+
return t[0] === n ? r = t[1] : (r = /* @__PURE__ */ W(Ae.Group, { children: /* @__PURE__ */ W(Ae.GroupLabel, {
|
|
1088
|
+
className: "dt-menu-label",
|
|
1089
|
+
children: n
|
|
1090
|
+
}) }), t[0] = n, t[1] = r), r;
|
|
1091
|
+
};
|
|
1092
|
+
// src/core/filters/filter-chip.tsx
|
|
1093
|
+
function Xt(t) {
|
|
1094
|
+
let n = M(96), { chip: r, column: i, editing: a, summary: o, rows: s, labels: c, currencies: l, onChange: u, onEditing: d, onRemove: p, onOpen: m } = t, { i18n: h } = e(), _ = i.type, v = g[_], y;
|
|
1095
|
+
n[0] !== r.op || n[1] !== _ ? (y = A(r.op, _), n[0] = r.op, n[1] = _, n[2] = y) : y = n[2];
|
|
1096
|
+
let b = y, S;
|
|
1097
|
+
n[3] !== r || n[4] !== _ ? (S = w(r, _), n[3] = r, n[4] = _, n[5] = S) : S = n[5];
|
|
1098
|
+
let C = S, T = Array.isArray(r.value) ? r.value.length : 1, E, j, P;
|
|
1099
|
+
n[6] !== r.op || n[7] !== i.header || n[8] !== C || n[9] !== T || n[10] !== h || n[11] !== o.full || n[12] !== o.text || n[13] !== _ ? (E = O(h, r.op, _, T), P = o.full && o.full !== o.text ? o.full : void 0, j = C ? h.t("filter.valueAria", {
|
|
1100
|
+
column: i.header,
|
|
1101
|
+
op: E,
|
|
1102
|
+
value: o.text
|
|
1103
|
+
}) : h.t("filter.chooseValueAria", {
|
|
1104
|
+
column: i.header,
|
|
1105
|
+
op: E,
|
|
1106
|
+
value: h.t("filter.selectValue")
|
|
1107
|
+
}), n[6] = r.op, n[7] = i.header, n[8] = C, n[9] = T, n[10] = h, n[11] = o.full, n[12] = o.text, n[13] = _, n[14] = E, n[15] = j, n[16] = P) : (E = n[14], j = n[15], P = n[16]);
|
|
1108
|
+
let F = j, I;
|
|
1109
|
+
n[17] !== r.op || n[18] !== _ ? (I = D(r.op, _), n[17] = r.op, n[18] = _, n[19] = I) : I = n[19];
|
|
1110
|
+
let L = I, R;
|
|
1111
|
+
n[20] !== r.value || n[21] !== L || n[22] !== h || n[23] !== b ? (R = L === "options" && Array.isArray(r.value) && r.value.length ? h.t("option.selected", { count: r.value.length }) : b === "range" ? h.t("number.boundsIncluded") : "", n[20] = r.value, n[21] = L, n[22] = h, n[23] = b, n[24] = R) : R = n[24];
|
|
1112
|
+
let z = R, B;
|
|
1113
|
+
n[25] !== r || n[26] !== u ? (B = (e) => u({
|
|
1114
|
+
...r,
|
|
1115
|
+
...e
|
|
1116
|
+
}), n[25] = r, n[26] = u, n[27] = B) : B = n[27];
|
|
1117
|
+
let V = B, H;
|
|
1118
|
+
n[28] !== r || n[29] !== u || n[30] !== _ ? (H = (e) => u(k(r, e, _)), n[28] = r, n[29] = u, n[30] = _, n[31] = H) : H = n[31];
|
|
1119
|
+
let K = H, q;
|
|
1120
|
+
n[32] === d ? q = n[33] : (q = () => d(!1), n[32] = d, n[33] = q);
|
|
1121
|
+
let te = q, J = ee(null), ne = ee(null), Y;
|
|
1122
|
+
n[34] === v ? Y = n[35] : (Y = /* @__PURE__ */ W(v, {
|
|
1123
|
+
size: 14,
|
|
1124
|
+
className: "dt-chip-icon",
|
|
1125
|
+
"aria-hidden": "true"
|
|
1126
|
+
}), n[34] = v, n[35] = Y);
|
|
1127
|
+
let re;
|
|
1128
|
+
n[36] === i.header ? re = n[37] : (re = /* @__PURE__ */ W("span", {
|
|
1129
|
+
className: "dt-chip-field",
|
|
1130
|
+
children: i.header
|
|
1131
|
+
}), n[36] = i.header, n[37] = re);
|
|
1132
|
+
let ie;
|
|
1133
|
+
n[38] === E ? ie = n[39] : (ie = /* @__PURE__ */ W("span", {
|
|
1134
|
+
className: "dt-chip-op",
|
|
1135
|
+
children: E
|
|
1136
|
+
}), n[38] = E, n[39] = ie);
|
|
1137
|
+
let X;
|
|
1138
|
+
n[40] !== re || n[41] !== ie || n[42] !== Y ? (X = /* @__PURE__ */ G(U, { children: [
|
|
1139
|
+
Y,
|
|
1140
|
+
re,
|
|
1141
|
+
" ",
|
|
1142
|
+
ie,
|
|
1143
|
+
" "
|
|
1144
|
+
] }), n[40] = re, n[41] = ie, n[42] = Y, n[43] = X) : X = n[43];
|
|
1145
|
+
let ae = X, oe, Z, se;
|
|
1146
|
+
if (n[44] !== v || n[45] !== F || n[46] !== r || n[47] !== te || n[48] !== i || n[49] !== C || n[50] !== T || n[51] !== l || n[52] !== a || n[53] !== L || n[54] !== ae || n[55] !== h || n[56] !== c || n[57] !== u || n[58] !== d || n[59] !== m || n[60] !== E || n[61] !== s || n[62] !== K || n[63] !== b || n[64] !== z || n[65] !== o.people || n[66] !== o.text || n[67] !== P || n[68] !== _ || n[69] !== V) {
|
|
1147
|
+
let e = C ? o.people?.slice(0, 3) ?? [] : [], t;
|
|
1148
|
+
n[73] !== r || n[74] !== te || n[75] !== i || n[76] !== l || n[77] !== L || n[78] !== c || n[79] !== u || n[80] !== s ? (t = L && /* @__PURE__ */ W(f, {
|
|
1149
|
+
chip: r,
|
|
1150
|
+
column: i,
|
|
1151
|
+
rows: s,
|
|
1152
|
+
labels: c,
|
|
1153
|
+
currencies: l,
|
|
1154
|
+
onChange: u,
|
|
1155
|
+
onDone: te
|
|
1156
|
+
}), n[73] = r, n[74] = te, n[75] = i, n[76] = l, n[77] = L, n[78] = c, n[79] = u, n[80] = s, n[81] = t) : t = n[81];
|
|
1157
|
+
let p = t, g = a && "is-editing", y = !C && "is-incomplete", S = m && "is-phone", w;
|
|
1158
|
+
n[82] !== g || n[83] !== y || n[84] !== S ? (w = [
|
|
1159
|
+
"dt-chip",
|
|
1160
|
+
g,
|
|
1161
|
+
y,
|
|
1162
|
+
S
|
|
1163
|
+
].filter(Boolean), n[82] = g, n[83] = y, n[84] = S, n[85] = w) : w = n[85], oe = w.join(" "), Z = r.column, se = m ? /* @__PURE__ */ G("button", {
|
|
1164
|
+
type: "button",
|
|
1165
|
+
className: "dt-chip-body",
|
|
1166
|
+
"aria-label": h.t("mobile.chipAria", { summary: `${i.header} ${E} ${o.text}`.trim() }),
|
|
1167
|
+
onClick: m,
|
|
1168
|
+
children: [
|
|
1169
|
+
/* @__PURE__ */ W(v, {
|
|
1170
|
+
size: 14,
|
|
1171
|
+
className: "dt-chip-icon",
|
|
1172
|
+
"aria-hidden": "true"
|
|
1173
|
+
}),
|
|
1174
|
+
/* @__PURE__ */ W("span", {
|
|
1175
|
+
className: "dt-chip-field",
|
|
1176
|
+
children: i.header
|
|
1177
|
+
}),
|
|
1178
|
+
" ",
|
|
1179
|
+
/* @__PURE__ */ W("span", {
|
|
1180
|
+
className: "dt-chip-op",
|
|
1181
|
+
children: E
|
|
1182
|
+
}),
|
|
1183
|
+
" ",
|
|
1184
|
+
/* @__PURE__ */ W("span", {
|
|
1185
|
+
className: "dt-chip-value",
|
|
1186
|
+
children: o.text
|
|
1187
|
+
})
|
|
1188
|
+
]
|
|
1189
|
+
}) : _ === "boolean" ? /* @__PURE__ */ G("button", {
|
|
1190
|
+
type: "button",
|
|
1191
|
+
className: "dt-chip-body",
|
|
1192
|
+
"aria-label": F,
|
|
1193
|
+
onClick: () => V({ value: r.value !== !0 }),
|
|
1194
|
+
children: [ae, /* @__PURE__ */ W("span", {
|
|
1195
|
+
className: "dt-chip-value",
|
|
1196
|
+
children: o.text
|
|
1197
|
+
})]
|
|
1198
|
+
}) : /* @__PURE__ */ G($.Root, {
|
|
1199
|
+
open: a,
|
|
1200
|
+
onOpenChange: (e) => d(e),
|
|
1201
|
+
children: [/* @__PURE__ */ G($.Trigger, {
|
|
1202
|
+
ref: ne,
|
|
1203
|
+
className: "dt-chip-body",
|
|
1204
|
+
"aria-label": F,
|
|
1205
|
+
children: [ae, b !== "none" && /* @__PURE__ */ G("span", {
|
|
1206
|
+
className: C ? "dt-chip-value" : "dt-chip-value is-placeholder",
|
|
1207
|
+
"data-dt-tip": P,
|
|
1208
|
+
children: [e.length > 0 && /* @__PURE__ */ W("span", {
|
|
1209
|
+
className: "dt-chip-avatars",
|
|
1210
|
+
children: e.map(Zt)
|
|
1211
|
+
}), C ? o.text : h.t("filter.selectValue")]
|
|
1212
|
+
})]
|
|
1213
|
+
}), /* @__PURE__ */ W($.Portal, { children: /* @__PURE__ */ W($.Positioner, {
|
|
1214
|
+
className: "dt-positioner",
|
|
1215
|
+
align: "start",
|
|
1216
|
+
sideOffset: 4,
|
|
1217
|
+
children: /* @__PURE__ */ G($.Popup, {
|
|
1218
|
+
className: `dt-pop dt-chip-pop is-${L ?? "none"}`,
|
|
1219
|
+
initialFocus: () => J.current?.querySelector("input, textarea") ?? !0,
|
|
1220
|
+
finalFocus: (e) => e === "mouse" || e === "touch" || e === "pen" ? !1 : ne.current,
|
|
1221
|
+
children: [
|
|
1222
|
+
/* @__PURE__ */ G("div", {
|
|
1223
|
+
className: "dt-chip-pop-head",
|
|
1224
|
+
children: [/* @__PURE__ */ W("span", {
|
|
1225
|
+
className: "dt-chip-pop-field",
|
|
1226
|
+
children: i.header
|
|
1227
|
+
}), /* @__PURE__ */ G(Kt, {
|
|
1228
|
+
align: "start",
|
|
1229
|
+
className: "dt-op-menu",
|
|
1230
|
+
trigger: /* @__PURE__ */ G("button", {
|
|
1231
|
+
type: "button",
|
|
1232
|
+
className: "dt-op-btn",
|
|
1233
|
+
children: [E, /* @__PURE__ */ W(de, {
|
|
1234
|
+
size: 12,
|
|
1235
|
+
"aria-hidden": "true"
|
|
1236
|
+
})]
|
|
1237
|
+
}),
|
|
1238
|
+
children: [_ === "user" && /* @__PURE__ */ W(qt, {
|
|
1239
|
+
onSelect: () => u({
|
|
1240
|
+
...r,
|
|
1241
|
+
op: "in",
|
|
1242
|
+
value: ["@me"]
|
|
1243
|
+
}),
|
|
1244
|
+
children: h.t("op.isMe")
|
|
1245
|
+
}), x(i).map((e) => /* @__PURE__ */ G(N, { children: [e === "is_empty" && /* @__PURE__ */ W(Jt, {}), /* @__PURE__ */ G(qt, {
|
|
1246
|
+
selected: e === r.op,
|
|
1247
|
+
onSelect: () => K(e),
|
|
1248
|
+
children: [O(h, e, _, T), e === r.op && /* @__PURE__ */ W(me, {
|
|
1249
|
+
size: 14,
|
|
1250
|
+
className: "dt-pop-end",
|
|
1251
|
+
"aria-hidden": "true"
|
|
1252
|
+
})]
|
|
1253
|
+
})] }, e))]
|
|
1254
|
+
})]
|
|
1255
|
+
}),
|
|
1256
|
+
p && /* @__PURE__ */ W("div", {
|
|
1257
|
+
ref: J,
|
|
1258
|
+
className: "dt-chip-pop-body",
|
|
1259
|
+
children: p
|
|
1260
|
+
}),
|
|
1261
|
+
/* @__PURE__ */ G("div", {
|
|
1262
|
+
className: "dt-pop-foot",
|
|
1263
|
+
children: [/* @__PURE__ */ W("span", { children: z }), /* @__PURE__ */ W("button", {
|
|
1264
|
+
type: "button",
|
|
1265
|
+
className: "dt-pop-action",
|
|
1266
|
+
disabled: r.value === void 0,
|
|
1267
|
+
onClick: () => {
|
|
1268
|
+
J.current?.querySelector("input, textarea, button")?.focus(), V({ value: void 0 });
|
|
1269
|
+
},
|
|
1270
|
+
children: h.t("common.clear")
|
|
1271
|
+
})]
|
|
1272
|
+
})
|
|
1273
|
+
]
|
|
1274
|
+
})
|
|
1275
|
+
}) })]
|
|
1276
|
+
}), n[44] = v, n[45] = F, n[46] = r, n[47] = te, n[48] = i, n[49] = C, n[50] = T, n[51] = l, n[52] = a, n[53] = L, n[54] = ae, n[55] = h, n[56] = c, n[57] = u, n[58] = d, n[59] = m, n[60] = E, n[61] = s, n[62] = K, n[63] = b, n[64] = z, n[65] = o.people, n[66] = o.text, n[67] = P, n[68] = _, n[69] = V, n[70] = oe, n[71] = Z, n[72] = se;
|
|
1277
|
+
} else oe = n[70], Z = n[71], se = n[72];
|
|
1278
|
+
let Q;
|
|
1279
|
+
n[86] !== i.header || n[87] !== h || n[88] !== m || n[89] !== p ? (Q = !m && /* @__PURE__ */ W("button", {
|
|
1280
|
+
type: "button",
|
|
1281
|
+
className: "dt-chip-remove",
|
|
1282
|
+
"aria-label": h.t("filter.removeAria", { column: i.header }),
|
|
1283
|
+
onClick: p,
|
|
1284
|
+
children: /* @__PURE__ */ W(Oe, {
|
|
1285
|
+
size: 12,
|
|
1286
|
+
"aria-hidden": "true"
|
|
1287
|
+
})
|
|
1288
|
+
}), n[86] = i.header, n[87] = h, n[88] = m, n[89] = p, n[90] = Q) : Q = n[90];
|
|
1289
|
+
let ce;
|
|
1290
|
+
return n[91] !== oe || n[92] !== Z || n[93] !== se || n[94] !== Q ? (ce = /* @__PURE__ */ G("span", {
|
|
1291
|
+
className: oe,
|
|
1292
|
+
"data-col": Z,
|
|
1293
|
+
children: [se, Q]
|
|
1294
|
+
}), n[91] = oe, n[92] = Z, n[93] = se, n[94] = Q, n[95] = ce) : ce = n[95], ce;
|
|
1295
|
+
}
|
|
1296
|
+
function Zt(e) {
|
|
1297
|
+
return /* @__PURE__ */ W(l, { user: e }, String(e.value));
|
|
1298
|
+
}
|
|
1299
|
+
// src/core/filters/filter-bar.tsx
|
|
1300
|
+
function Qt(t) {
|
|
1301
|
+
let n = M(41), { chips: r, defOf: i, editing: a, rows: o, labels: s, summaryOf: c, currenciesOf: l, add: u, onChange: d, onRemove: f, onEditing: p, onClearAll: m, onOpen: h } = t, { i18n: g } = e(), _ = ee(null), v;
|
|
1302
|
+
n[0] === Symbol.for("react.memo_cache_sentinel") ? (v = (e) => e ? [..._.current?.querySelectorAll(".dt-chip") ?? []].find((t) => t.dataset.col === e) : void 0, n[0] = v) : v = n[0];
|
|
1303
|
+
let y = v, [b, x] = V(!1), S;
|
|
1304
|
+
n[1] === Symbol.for("react.memo_cache_sentinel") ? (S = () => {
|
|
1305
|
+
let e = _.current;
|
|
1306
|
+
e && x(e.scrollLeft + e.clientWidth < e.scrollWidth - 1);
|
|
1307
|
+
}, n[1] = S) : S = n[1];
|
|
1308
|
+
let C = S, w, T;
|
|
1309
|
+
n[2] === Symbol.for("react.memo_cache_sentinel") ? (w = () => {
|
|
1310
|
+
let e = _.current;
|
|
1311
|
+
if (!e || typeof ResizeObserver > "u") return;
|
|
1312
|
+
let t = new ResizeObserver(C);
|
|
1313
|
+
return t.observe(e), () => t.disconnect();
|
|
1314
|
+
}, T = [], n[2] = w, n[3] = T) : (w = n[2], T = n[3]), I(w, T);
|
|
1315
|
+
let E = a ?? r.at(-1)?.column, D;
|
|
1316
|
+
n[4] === E ? D = n[5] : (D = () => {
|
|
1317
|
+
C(), y(E)?.scrollIntoView?.({
|
|
1318
|
+
inline: "nearest",
|
|
1319
|
+
block: "nearest"
|
|
1320
|
+
});
|
|
1321
|
+
}, n[4] = E, n[5] = D);
|
|
1322
|
+
let O;
|
|
1323
|
+
n[6] !== r.length || n[7] !== E ? (O = [r.length, E], n[6] = r.length, n[7] = E, n[8] = O) : O = n[8], B(D, O);
|
|
1324
|
+
let k = ee(void 0), A;
|
|
1325
|
+
n[9] === Symbol.for("react.memo_cache_sentinel") ? (A = () => {
|
|
1326
|
+
if (k.current === void 0) return;
|
|
1327
|
+
let e = k.current;
|
|
1328
|
+
k.current = void 0, (y(e ?? void 0)?.querySelector(".dt-chip-body") ?? _.current?.parentElement?.querySelector(".dt-filter-add"))?.focus();
|
|
1329
|
+
}, n[9] = A) : A = n[9], I(A);
|
|
1330
|
+
let j, N, P, F, L;
|
|
1331
|
+
if (n[10] !== r || n[11] !== l || n[12] !== i || n[13] !== a || n[14] !== s || n[15] !== d || n[16] !== p || n[17] !== h || n[18] !== f || n[19] !== o || n[20] !== b || n[21] !== c) {
|
|
1332
|
+
let e = (e) => {
|
|
1333
|
+
let t = r.findIndex((t) => t.column === e);
|
|
1334
|
+
k.current = r[t + 1]?.column ?? null, f(e);
|
|
1335
|
+
};
|
|
1336
|
+
P = b ? "dt-filter-row is-scrolled-end" : "dt-filter-row", F = _, L = "dt-chips", j = C, N = r.map((t) => /* @__PURE__ */ W(Xt, {
|
|
1337
|
+
chip: t,
|
|
1338
|
+
column: i(t.column),
|
|
1339
|
+
editing: a === t.column,
|
|
1340
|
+
summary: c(t),
|
|
1341
|
+
rows: o,
|
|
1342
|
+
labels: s,
|
|
1343
|
+
currencies: l(i(t.column)),
|
|
1344
|
+
onChange: d,
|
|
1345
|
+
onEditing: (e) => p(e ? t.column : null),
|
|
1346
|
+
onRemove: () => e(t.column),
|
|
1347
|
+
onOpen: h && (() => h(t.column))
|
|
1348
|
+
}, t.column)), n[10] = r, n[11] = l, n[12] = i, n[13] = a, n[14] = s, n[15] = d, n[16] = p, n[17] = h, n[18] = f, n[19] = o, n[20] = b, n[21] = c, n[22] = j, n[23] = N, n[24] = P, n[25] = F, n[26] = L;
|
|
1349
|
+
} else j = n[22], N = n[23], P = n[24], F = n[25], L = n[26];
|
|
1350
|
+
let R;
|
|
1351
|
+
n[27] !== j || n[28] !== N || n[29] !== F || n[30] !== L ? (R = /* @__PURE__ */ W("div", {
|
|
1352
|
+
ref: F,
|
|
1353
|
+
className: L,
|
|
1354
|
+
onScroll: j,
|
|
1355
|
+
children: N
|
|
1356
|
+
}), n[27] = j, n[28] = N, n[29] = F, n[30] = L, n[31] = R) : R = n[31];
|
|
1357
|
+
let z;
|
|
1358
|
+
n[32] !== u || n[33] !== g || n[34] !== m || n[35] !== h ? (z = !h && /* @__PURE__ */ G(U, { children: [u, /* @__PURE__ */ W("button", {
|
|
1359
|
+
type: "button",
|
|
1360
|
+
className: "dt-btn dt-btn-ghost dt-filter-clear",
|
|
1361
|
+
onClick: m,
|
|
1362
|
+
children: g.t("filter.clearAll")
|
|
1363
|
+
})] }), n[32] = u, n[33] = g, n[34] = m, n[35] = h, n[36] = z) : z = n[36];
|
|
1364
|
+
let H;
|
|
1365
|
+
return n[37] !== P || n[38] !== R || n[39] !== z ? (H = /* @__PURE__ */ G("div", {
|
|
1366
|
+
className: P,
|
|
1367
|
+
children: [R, z]
|
|
1368
|
+
}), n[37] = P, n[38] = R, n[39] = z, n[40] = H) : H = n[40], H;
|
|
1369
|
+
}
|
|
1370
|
+
// src/core/interaction/is-interactive.ts
|
|
1371
|
+
var $t = "a[href], button, input, select, textarea, summary, label, [role=\"button\"], [role=\"menuitem\"], [role=\"checkbox\"], [role=\"combobox\"], [role=\"switch\"], [contenteditable=\"true\"]";
|
|
1372
|
+
function en(e, t) {
|
|
1373
|
+
if (!(e instanceof Element)) return !1;
|
|
1374
|
+
let n = e.closest($t);
|
|
1375
|
+
return n !== null && n !== t && t.contains(n);
|
|
1376
|
+
}
|
|
1377
|
+
var tn = (e) => e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement || e?.getAttribute("role") === "combobox" || e?.isContentEditable === !0, nn = () => (globalThis.getSelection?.()?.toString().length ?? 0) > 0;
|
|
1378
|
+
function rn(e, t, n) {
|
|
1379
|
+
return !(e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey || en(e.target, t) || nn() || n && Math.hypot(e.clientX - n.x, e.clientY - n.y) > 4);
|
|
1380
|
+
}
|
|
1381
|
+
// src/core/interaction/kbd.ts
|
|
1382
|
+
var an = typeof navigator < "u" && /Mac|iPhone|iPad/.test(navigator.platform), on = {
|
|
1383
|
+
left: an ? "⌥⇧←" : "Alt+Shift+←",
|
|
1384
|
+
right: an ? "⌥⇧→" : "Alt+Shift+→"
|
|
1385
|
+
}, sn = an ? "⌘S" : "Ctrl+S", cn = (e) => e.pinned === "start" ? { left: `var(${e.offsetVar})` } : e.pinned === "end" ? { right: `var(${e.offsetVar})` } : void 0, ln = (e) => [
|
|
1386
|
+
e.pinned === "start" && "is-pinned-start",
|
|
1387
|
+
e.pinned === "end" && "is-pinned-end",
|
|
1388
|
+
e.pinEdge && "is-pin-edge"
|
|
1389
|
+
].filter((e) => !!e), un = (e) => {
|
|
1390
|
+
let t = e.findIndex((e) => e.pinned === "end");
|
|
1391
|
+
return t < 0 ? e.length : t;
|
|
1392
|
+
};
|
|
1393
|
+
// src/core/grid/header-cell.tsx
|
|
1394
|
+
function dn(t) {
|
|
1395
|
+
let n = M(140), { column: r, layout: i, onMoved: a, sort: o, onSort: c, onSortSet: l, filtered: u, onFilter: d, onColumns: f } = t, { i18n: p } = e(), m = r.def, h;
|
|
1396
|
+
n[0] === m.type ? h = n[1] : (h = y(m.type), n[0] = m.type, n[1] = h);
|
|
1397
|
+
let g = h, _ = typeof m.unit == "string" ? m.unit : void 0, v = R(), x = m.description ? `${m.header}\n${m.description}` : m.header, [S, C] = V(!1), w = ee(!1), T = ee(null), E;
|
|
1398
|
+
n[2] !== r.id || n[3] !== i ? (E = () => {
|
|
1399
|
+
let e = i.resizing();
|
|
1400
|
+
return e?.id === r.id ? e.size : -1;
|
|
1401
|
+
}, n[2] = r.id, n[3] = i, n[4] = E) : E = n[4];
|
|
1402
|
+
let D = H(i.subscribeSizing, E), O;
|
|
1403
|
+
n[5] !== r.id || n[6] !== i || n[7] !== a ? (O = (e) => {
|
|
1404
|
+
i.move(r.id, e), a(r.id);
|
|
1405
|
+
}, n[5] = r.id, n[6] = i, n[7] = a, n[8] = O) : O = n[8];
|
|
1406
|
+
let k = O, A;
|
|
1407
|
+
n[9] !== r || n[10] !== i ? (A = (e) => {
|
|
1408
|
+
let t = e.currentTarget.parentElement;
|
|
1409
|
+
i.setWidth(r.id, t.getBoundingClientRect().width), r.resizeHandler(e);
|
|
1410
|
+
}, n[9] = r, n[10] = i, n[11] = A) : A = n[11];
|
|
1411
|
+
let j = A, N;
|
|
1412
|
+
n[12] !== r.id || n[13] !== i || n[14] !== k || n[15] !== c ? (N = (e) => {
|
|
1413
|
+
let t = e.key;
|
|
1414
|
+
if (t === "Enter" || t === " ") c && (e.preventDefault(), c(e.shiftKey));
|
|
1415
|
+
else if (t === "F10" && e.shiftKey || t === "ContextMenu") e.preventDefault(), C(!0);
|
|
1416
|
+
else if ((t === "ArrowLeft" || t === "ArrowRight") && e.shiftKey) {
|
|
1417
|
+
e.preventDefault();
|
|
1418
|
+
let n = t === "ArrowLeft";
|
|
1419
|
+
e.altKey ? k(n ? -1 : 1) : i.setWidth(r.id, i.widthOf(r.id) + (n ? -16 : 16));
|
|
1420
|
+
}
|
|
1421
|
+
}, n[12] = r.id, n[13] = i, n[14] = k, n[15] = c, n[16] = N) : N = n[16];
|
|
1422
|
+
let P = N, F = o && (o.index ?? 1) === 1 ? o.dir : void 0, I = F === "asc" ? "ascending" : F === "desc" ? "descending" : void 0, L = o?.dir === "desc" ? "is-desc" : void 0, z;
|
|
1423
|
+
n[17] === L ? z = n[18] : (z = /* @__PURE__ */ W(ue, {
|
|
1424
|
+
size: 12,
|
|
1425
|
+
className: L
|
|
1426
|
+
}), n[17] = L, n[18] = z);
|
|
1427
|
+
let B = z, K;
|
|
1428
|
+
n[19] === o ? K = n[20] : (K = o?.index && /* @__PURE__ */ W("span", {
|
|
1429
|
+
className: "dt-head-sort-index",
|
|
1430
|
+
children: o.index
|
|
1431
|
+
}), n[19] = o, n[20] = K);
|
|
1432
|
+
let q = K, te;
|
|
1433
|
+
n[21] !== B || n[22] !== q || n[23] !== g ? (te = /* @__PURE__ */ W("span", {
|
|
1434
|
+
className: "dt-head-sort",
|
|
1435
|
+
"aria-hidden": "true",
|
|
1436
|
+
children: g ? /* @__PURE__ */ G(U, { children: [q, B] }) : /* @__PURE__ */ G(U, { children: [B, q] })
|
|
1437
|
+
}), n[21] = B, n[22] = q, n[23] = g, n[24] = te) : te = n[24];
|
|
1438
|
+
let J = te, ne;
|
|
1439
|
+
n[25] === m ? ne = n[26] : (ne = s(m), n[25] = m, n[26] = ne);
|
|
1440
|
+
let Y = `is-${ne}`, re = g && "is-numeric", ie = o && "is-sorted", X = r.pinned === "start" && "is-pinned-start", ae = r.pinned === "end" && "is-pinned-end", oe = r.pinEdge && "is-pin-edge", Z = D >= 0 && "is-resizing", se = S && "is-menu-open", Q;
|
|
1441
|
+
n[27] !== Y || n[28] !== re || n[29] !== ie || n[30] !== X || n[31] !== ae || n[32] !== oe || n[33] !== Z || n[34] !== se ? (Q = [
|
|
1442
|
+
"dt-head-cell",
|
|
1443
|
+
Y,
|
|
1444
|
+
re,
|
|
1445
|
+
ie,
|
|
1446
|
+
X,
|
|
1447
|
+
ae,
|
|
1448
|
+
oe,
|
|
1449
|
+
Z,
|
|
1450
|
+
se
|
|
1451
|
+
].filter(Boolean), n[27] = Y, n[28] = re, n[29] = ie, n[30] = X, n[31] = ae, n[32] = oe, n[33] = Z, n[34] = se, n[35] = Q) : Q = n[35];
|
|
1452
|
+
let ce = Q.join(" "), le;
|
|
1453
|
+
n[36] === r ? le = n[37] : (le = cn(r), n[36] = r, n[37] = le);
|
|
1454
|
+
let de = r.id, fe;
|
|
1455
|
+
n[38] === Symbol.for("react.memo_cache_sentinel") ? (fe = (e) => {
|
|
1456
|
+
e.preventDefault(), C(!0);
|
|
1457
|
+
}, n[38] = fe) : fe = n[38];
|
|
1458
|
+
let pe;
|
|
1459
|
+
n[39] !== u || n[40] !== p || n[41] !== d ? (pe = u && d && /* @__PURE__ */ W("button", {
|
|
1460
|
+
type: "button",
|
|
1461
|
+
className: "dt-head-icon dt-head-filtered",
|
|
1462
|
+
"aria-label": p.t("header.filterBy"),
|
|
1463
|
+
onClick: d,
|
|
1464
|
+
children: /* @__PURE__ */ W(ve, {
|
|
1465
|
+
size: 14,
|
|
1466
|
+
weight: "fill",
|
|
1467
|
+
"aria-hidden": "true"
|
|
1468
|
+
})
|
|
1469
|
+
}), n[39] = u, n[40] = p, n[41] = d, n[42] = pe) : pe = n[42];
|
|
1470
|
+
let me = c ? "dt-head-label" : "dt-head-label is-static", he = c ? void 0 : "true", _e = m.description ? v : void 0, ye;
|
|
1471
|
+
n[43] === c ? ye = n[44] : (ye = (e) => c?.(e.shiftKey), n[43] = c, n[44] = ye);
|
|
1472
|
+
let be = o && g && J, xe = i.phone && m.headerShort || m.header, Ce;
|
|
1473
|
+
n[45] === xe ? Ce = n[46] : (Ce = /* @__PURE__ */ W("span", {
|
|
1474
|
+
className: "dt-head-text",
|
|
1475
|
+
children: xe
|
|
1476
|
+
}), n[45] = xe, n[46] = Ce);
|
|
1477
|
+
let we;
|
|
1478
|
+
n[47] === _ ? we = n[48] : (we = _ && /* @__PURE__ */ W("span", {
|
|
1479
|
+
className: "dt-head-unit",
|
|
1480
|
+
children: _
|
|
1481
|
+
}), n[47] = _, n[48] = we);
|
|
1482
|
+
let Te = o && !g && J, Ee;
|
|
1483
|
+
n[49] === r.pinned ? Ee = n[50] : (Ee = r.pinned && /* @__PURE__ */ W(Se, {
|
|
1484
|
+
size: 12,
|
|
1485
|
+
className: "dt-head-pin",
|
|
1486
|
+
"aria-hidden": "true"
|
|
1487
|
+
}), n[49] = r.pinned, n[50] = Ee);
|
|
1488
|
+
let De;
|
|
1489
|
+
n[51] !== P || n[52] !== me || n[53] !== he || n[54] !== _e || n[55] !== ye || n[56] !== be || n[57] !== Ce || n[58] !== we || n[59] !== Te || n[60] !== Ee || n[61] !== x ? (De = /* @__PURE__ */ G("button", {
|
|
1490
|
+
type: "button",
|
|
1491
|
+
className: me,
|
|
1492
|
+
"aria-disabled": he,
|
|
1493
|
+
"data-dt-tip": x,
|
|
1494
|
+
"aria-describedby": _e,
|
|
1495
|
+
onClick: ye,
|
|
1496
|
+
onKeyDown: P,
|
|
1497
|
+
children: [
|
|
1498
|
+
be,
|
|
1499
|
+
Ce,
|
|
1500
|
+
we,
|
|
1501
|
+
Te,
|
|
1502
|
+
Ee
|
|
1503
|
+
]
|
|
1504
|
+
}), n[51] = P, n[52] = me, n[53] = he, n[54] = _e, n[55] = ye, n[56] = be, n[57] = Ce, n[58] = we, n[59] = Te, n[60] = Ee, n[61] = x, n[62] = De) : De = n[62];
|
|
1505
|
+
let Oe;
|
|
1506
|
+
n[63] !== m.description || n[64] !== v ? (Oe = m.description && /* @__PURE__ */ W("span", {
|
|
1507
|
+
id: v,
|
|
1508
|
+
className: "dt-sr-only",
|
|
1509
|
+
children: m.description
|
|
1510
|
+
}), n[63] = m.description, n[64] = v, n[65] = Oe) : Oe = n[65];
|
|
1511
|
+
let ke;
|
|
1512
|
+
n[66] === Symbol.for("react.memo_cache_sentinel") ? (ke = () => {
|
|
1513
|
+
let e = !w.current;
|
|
1514
|
+
return w.current = !1, e;
|
|
1515
|
+
}, n[66] = ke) : ke = n[66];
|
|
1516
|
+
let $;
|
|
1517
|
+
n[67] !== m.header || n[68] !== p ? ($ = p.t("header.optionsAria", { column: m.header }), n[67] = m.header, n[68] = p, n[69] = $) : $ = n[69];
|
|
1518
|
+
let Ae;
|
|
1519
|
+
n[70] === Symbol.for("react.memo_cache_sentinel") ? (Ae = /* @__PURE__ */ W(ge, {
|
|
1520
|
+
size: 16,
|
|
1521
|
+
weight: "bold",
|
|
1522
|
+
"aria-hidden": "true"
|
|
1523
|
+
}), n[70] = Ae) : Ae = n[70];
|
|
1524
|
+
let je;
|
|
1525
|
+
n[71] === $ ? je = n[72] : (je = /* @__PURE__ */ W("button", {
|
|
1526
|
+
ref: T,
|
|
1527
|
+
type: "button",
|
|
1528
|
+
className: "dt-head-icon dt-head-menu",
|
|
1529
|
+
"aria-label": $,
|
|
1530
|
+
children: Ae
|
|
1531
|
+
}), n[71] = $, n[72] = je);
|
|
1532
|
+
let Me;
|
|
1533
|
+
n[73] !== m.type || n[74] !== p ? (Me = p.t(b(m.type)), n[73] = m.type, n[74] = p, n[75] = Me) : Me = n[75];
|
|
1534
|
+
let Ne;
|
|
1535
|
+
n[76] === Me ? Ne = n[77] : (Ne = /* @__PURE__ */ W(Yt, { children: Me }), n[76] = Me, n[77] = Ne);
|
|
1536
|
+
let Pe;
|
|
1537
|
+
n[78] !== p || n[79] !== l || n[80] !== o ? (Pe = l && /* @__PURE__ */ G(U, { children: [
|
|
1538
|
+
/* @__PURE__ */ W(qt, {
|
|
1539
|
+
onSelect: () => l("asc"),
|
|
1540
|
+
children: p.t("header.sortAsc")
|
|
1541
|
+
}),
|
|
1542
|
+
/* @__PURE__ */ W(qt, {
|
|
1543
|
+
onSelect: () => l("desc"),
|
|
1544
|
+
children: p.t("header.sortDesc")
|
|
1545
|
+
}),
|
|
1546
|
+
/* @__PURE__ */ W(qt, {
|
|
1547
|
+
disabled: !o,
|
|
1548
|
+
onSelect: () => l(null),
|
|
1549
|
+
children: p.t("header.clearSort")
|
|
1550
|
+
}),
|
|
1551
|
+
/* @__PURE__ */ W(Jt, {})
|
|
1552
|
+
] }), n[78] = p, n[79] = l, n[80] = o, n[81] = Pe) : Pe = n[81];
|
|
1553
|
+
let Fe;
|
|
1554
|
+
n[82] !== p || n[83] !== d ? (Fe = d && /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(qt, {
|
|
1555
|
+
onSelect: () => {
|
|
1556
|
+
w.current = !0, d();
|
|
1557
|
+
},
|
|
1558
|
+
children: p.t("header.filterBy")
|
|
1559
|
+
}), /* @__PURE__ */ W(Jt, {})] }), n[82] = p, n[83] = d, n[84] = Fe) : Fe = n[84];
|
|
1560
|
+
let Ie;
|
|
1561
|
+
n[85] === k ? Ie = n[86] : (Ie = () => k(-1), n[85] = k, n[86] = Ie);
|
|
1562
|
+
let Le;
|
|
1563
|
+
n[87] === p ? Le = n[88] : (Le = p.t("header.moveLeft"), n[87] = p, n[88] = Le);
|
|
1564
|
+
let Re;
|
|
1565
|
+
n[89] === Symbol.for("react.memo_cache_sentinel") ? (Re = /* @__PURE__ */ W("kbd", {
|
|
1566
|
+
className: "dt-kbd",
|
|
1567
|
+
children: on.left
|
|
1568
|
+
}), n[89] = Re) : Re = n[89];
|
|
1569
|
+
let ze;
|
|
1570
|
+
n[90] !== Ie || n[91] !== Le ? (ze = /* @__PURE__ */ G(qt, {
|
|
1571
|
+
onSelect: Ie,
|
|
1572
|
+
children: [Le, Re]
|
|
1573
|
+
}), n[90] = Ie, n[91] = Le, n[92] = ze) : ze = n[92];
|
|
1574
|
+
let Be;
|
|
1575
|
+
n[93] === k ? Be = n[94] : (Be = () => k(1), n[93] = k, n[94] = Be);
|
|
1576
|
+
let Ve;
|
|
1577
|
+
n[95] === p ? Ve = n[96] : (Ve = p.t("header.moveRight"), n[95] = p, n[96] = Ve);
|
|
1578
|
+
let He;
|
|
1579
|
+
n[97] === Symbol.for("react.memo_cache_sentinel") ? (He = /* @__PURE__ */ W("kbd", {
|
|
1580
|
+
className: "dt-kbd",
|
|
1581
|
+
children: on.right
|
|
1582
|
+
}), n[97] = He) : He = n[97];
|
|
1583
|
+
let Ue;
|
|
1584
|
+
n[98] !== Be || n[99] !== Ve ? (Ue = /* @__PURE__ */ G(qt, {
|
|
1585
|
+
onSelect: Be,
|
|
1586
|
+
children: [Ve, He]
|
|
1587
|
+
}), n[98] = Be, n[99] = Ve, n[100] = Ue) : Ue = n[100];
|
|
1588
|
+
let We;
|
|
1589
|
+
n[101] === Symbol.for("react.memo_cache_sentinel") ? (We = /* @__PURE__ */ W(Jt, {}), n[101] = We) : We = n[101];
|
|
1590
|
+
let Ge = !!r.pinned || !r.canHide, Ke;
|
|
1591
|
+
n[102] !== r.id || n[103] !== i ? (Ke = () => i.setVisible(r.id, !1), n[102] = r.id, n[103] = i, n[104] = Ke) : Ke = n[104];
|
|
1592
|
+
let qe;
|
|
1593
|
+
n[105] === p ? qe = n[106] : (qe = p.t("header.hide"), n[105] = p, n[106] = qe);
|
|
1594
|
+
let Je;
|
|
1595
|
+
n[107] !== Ge || n[108] !== Ke || n[109] !== qe ? (Je = /* @__PURE__ */ W(qt, {
|
|
1596
|
+
disabled: Ge,
|
|
1597
|
+
onSelect: Ke,
|
|
1598
|
+
children: qe
|
|
1599
|
+
}), n[107] = Ge, n[108] = Ke, n[109] = qe, n[110] = Je) : Je = n[110];
|
|
1600
|
+
let Ye;
|
|
1601
|
+
n[111] !== p || n[112] !== f ? (Ye = f && /* @__PURE__ */ W(qt, {
|
|
1602
|
+
onSelect: () => f(T.current),
|
|
1603
|
+
children: p.t("header.columnSettings")
|
|
1604
|
+
}), n[111] = p, n[112] = f, n[113] = Ye) : Ye = n[113];
|
|
1605
|
+
let Xe;
|
|
1606
|
+
n[114] !== S || n[115] !== je || n[116] !== Ne || n[117] !== Pe || n[118] !== Fe || n[119] !== ze || n[120] !== Ue || n[121] !== Je || n[122] !== Ye ? (Xe = /* @__PURE__ */ G(Kt, {
|
|
1607
|
+
open: S,
|
|
1608
|
+
onOpenChange: C,
|
|
1609
|
+
className: "dt-col-menu",
|
|
1610
|
+
finalFocus: ke,
|
|
1611
|
+
trigger: je,
|
|
1612
|
+
children: [
|
|
1613
|
+
Ne,
|
|
1614
|
+
Pe,
|
|
1615
|
+
Fe,
|
|
1616
|
+
ze,
|
|
1617
|
+
Ue,
|
|
1618
|
+
We,
|
|
1619
|
+
Je,
|
|
1620
|
+
Ye
|
|
1621
|
+
]
|
|
1622
|
+
}), n[114] = S, n[115] = je, n[116] = Ne, n[117] = Pe, n[118] = Fe, n[119] = ze, n[120] = Ue, n[121] = Je, n[122] = Ye, n[123] = Xe) : Xe = n[123];
|
|
1623
|
+
let Ze;
|
|
1624
|
+
n[124] === Symbol.for("react.memo_cache_sentinel") ? (Ze = /* @__PURE__ */ W("span", {
|
|
1625
|
+
className: "dt-head-sep",
|
|
1626
|
+
"aria-hidden": "true"
|
|
1627
|
+
}), n[124] = Ze) : Ze = n[124];
|
|
1628
|
+
let Qe;
|
|
1629
|
+
n[125] === D ? Qe = n[126] : (Qe = D >= 0 && /* @__PURE__ */ G("span", {
|
|
1630
|
+
className: "dt-resize-badge",
|
|
1631
|
+
children: [Math.round(D), " px"]
|
|
1632
|
+
}), n[125] = D, n[126] = Qe);
|
|
1633
|
+
let $e;
|
|
1634
|
+
n[127] !== j || n[128] !== Qe ? ($e = /* @__PURE__ */ W("span", {
|
|
1635
|
+
className: "dt-resize",
|
|
1636
|
+
"aria-hidden": "true",
|
|
1637
|
+
onMouseDown: j,
|
|
1638
|
+
onTouchStart: j,
|
|
1639
|
+
children: Qe
|
|
1640
|
+
}), n[127] = j, n[128] = Qe, n[129] = $e) : $e = n[129];
|
|
1641
|
+
let et;
|
|
1642
|
+
return n[130] !== I || n[131] !== r.id || n[132] !== ce || n[133] !== le || n[134] !== pe || n[135] !== De || n[136] !== Oe || n[137] !== Xe || n[138] !== $e ? (et = /* @__PURE__ */ G("div", {
|
|
1643
|
+
className: ce,
|
|
1644
|
+
style: le,
|
|
1645
|
+
role: "columnheader",
|
|
1646
|
+
"aria-sort": I,
|
|
1647
|
+
"data-col": de,
|
|
1648
|
+
onContextMenu: fe,
|
|
1649
|
+
children: [
|
|
1650
|
+
pe,
|
|
1651
|
+
De,
|
|
1652
|
+
Oe,
|
|
1653
|
+
Xe,
|
|
1654
|
+
Ze,
|
|
1655
|
+
$e
|
|
1656
|
+
]
|
|
1657
|
+
}), n[130] = I, n[131] = r.id, n[132] = ce, n[133] = le, n[134] = pe, n[135] = De, n[136] = Oe, n[137] = Xe, n[138] = $e, n[139] = et) : et = n[139], et;
|
|
1658
|
+
}
|
|
1659
|
+
// src/core/grid/inline-actions.ts
|
|
1660
|
+
var fn = (e, t) => e.filter((e) => e.inline && e.icon && (!e.when || e.when(t))).slice(0, 2);
|
|
1661
|
+
// src/core/cells/cell-actions.tsx
|
|
1662
|
+
function pn(t) {
|
|
1663
|
+
let n = M(28), { actions: r, row: i } = t, { i18n: a } = e(), o, s, c, l;
|
|
1664
|
+
if (n[0] !== r || n[1] !== a || n[2] !== i) {
|
|
1665
|
+
l = Symbol.for("react.early_return_sentinel");
|
|
1666
|
+
bb0: {
|
|
1667
|
+
let e;
|
|
1668
|
+
n[7] === i ? e = n[8] : (e = (e) => e.when?.(i) ?? !0, n[7] = i, n[8] = e);
|
|
1669
|
+
let t = r.filter(e);
|
|
1670
|
+
if (!t.length) {
|
|
1671
|
+
l = null;
|
|
1672
|
+
break bb0;
|
|
1673
|
+
}
|
|
1674
|
+
let u = t.some(mn), d = t.length > 2 ? t.slice(0, 1) : t, f = t.length > 2 ? t.slice(1) : [], p;
|
|
1675
|
+
n[9] === i ? p = n[10] : (p = (e) => e.disabled?.(i) ?? !1, n[9] = i, n[10] = p);
|
|
1676
|
+
let m = p, h;
|
|
1677
|
+
n[11] === m ? h = n[12] : (h = (e) => {
|
|
1678
|
+
let t = m(e);
|
|
1679
|
+
return typeof t == "string" ? `${e.label} — ${t}` : e.label;
|
|
1680
|
+
}, n[11] = m, n[12] = h);
|
|
1681
|
+
let g = h, _;
|
|
1682
|
+
n[13] !== m || n[14] !== i ? (_ = (e) => {
|
|
1683
|
+
m(e) || e.run?.(i);
|
|
1684
|
+
}, n[13] = m, n[14] = i, n[15] = _) : _ = n[15];
|
|
1685
|
+
let v = _, y;
|
|
1686
|
+
n[16] !== m || n[17] !== v ? (y = (e) => e.map((e) => {
|
|
1687
|
+
let t = e.icon;
|
|
1688
|
+
return /* @__PURE__ */ G(qt, {
|
|
1689
|
+
destructive: e.destructive,
|
|
1690
|
+
disabled: !!m(e),
|
|
1691
|
+
onSelect: () => v(e),
|
|
1692
|
+
children: [/* @__PURE__ */ W(t, {
|
|
1693
|
+
size: 16,
|
|
1694
|
+
"aria-hidden": "true"
|
|
1695
|
+
}), e.label]
|
|
1696
|
+
}, e.id);
|
|
1697
|
+
}), n[16] = m, n[17] = v, n[18] = y) : y = n[18];
|
|
1698
|
+
let b = y;
|
|
1699
|
+
o = u ? "dt-cell-actions is-always" : "dt-cell-actions";
|
|
1700
|
+
let x;
|
|
1701
|
+
n[19] !== m || n[20] !== b || n[21] !== v || n[22] !== g ? (x = (e) => {
|
|
1702
|
+
let t = e.icon, n = e.destructive ? "dt-cell-action is-destructive" : "dt-cell-action";
|
|
1703
|
+
return e.menu?.length ? /* @__PURE__ */ W(Kt, {
|
|
1704
|
+
className: "dt-menu-cell",
|
|
1705
|
+
trigger: /* @__PURE__ */ W("button", {
|
|
1706
|
+
type: "button",
|
|
1707
|
+
className: n,
|
|
1708
|
+
"aria-label": e.label,
|
|
1709
|
+
"data-dt-tip": e.label,
|
|
1710
|
+
children: /* @__PURE__ */ W(t, {
|
|
1711
|
+
size: 14,
|
|
1712
|
+
"aria-hidden": "true"
|
|
1713
|
+
})
|
|
1714
|
+
}),
|
|
1715
|
+
children: b(e.menu)
|
|
1716
|
+
}, e.id) : /* @__PURE__ */ W("button", {
|
|
1717
|
+
type: "button",
|
|
1718
|
+
className: n,
|
|
1719
|
+
"aria-label": e.label,
|
|
1720
|
+
"aria-disabled": m(e) ? "true" : void 0,
|
|
1721
|
+
"data-dt-tip": g(e),
|
|
1722
|
+
onClick: () => v(e),
|
|
1723
|
+
children: /* @__PURE__ */ W(t, {
|
|
1724
|
+
size: 14,
|
|
1725
|
+
"aria-hidden": "true"
|
|
1726
|
+
})
|
|
1727
|
+
}, e.id);
|
|
1728
|
+
}, n[19] = m, n[20] = b, n[21] = v, n[22] = g, n[23] = x) : x = n[23], s = d.map(x), c = f.length > 0 && /* @__PURE__ */ W(Kt, {
|
|
1729
|
+
className: "dt-menu-cell",
|
|
1730
|
+
trigger: /* @__PURE__ */ W("button", {
|
|
1731
|
+
type: "button",
|
|
1732
|
+
className: "dt-cell-action",
|
|
1733
|
+
"aria-label": a.t("common.more"),
|
|
1734
|
+
"data-dt-tip": a.t("common.more"),
|
|
1735
|
+
children: /* @__PURE__ */ W(ge, {
|
|
1736
|
+
size: 14,
|
|
1737
|
+
weight: "bold",
|
|
1738
|
+
"aria-hidden": "true"
|
|
1739
|
+
})
|
|
1740
|
+
}),
|
|
1741
|
+
children: b(f)
|
|
1742
|
+
});
|
|
1743
|
+
}
|
|
1744
|
+
n[0] = r, n[1] = a, n[2] = i, n[3] = o, n[4] = s, n[5] = c, n[6] = l;
|
|
1745
|
+
} else o = n[3], s = n[4], c = n[5], l = n[6];
|
|
1746
|
+
if (l !== Symbol.for("react.early_return_sentinel")) return l;
|
|
1747
|
+
let u;
|
|
1748
|
+
return n[24] !== o || n[25] !== s || n[26] !== c ? (u = /* @__PURE__ */ G("span", {
|
|
1749
|
+
className: o,
|
|
1750
|
+
children: [s, c]
|
|
1751
|
+
}), n[24] = o, n[25] = s, n[26] = c, n[27] = u) : u = n[27], u;
|
|
1752
|
+
}
|
|
1753
|
+
function mn(e) {
|
|
1754
|
+
return e.reveal === "always";
|
|
1755
|
+
}
|
|
1756
|
+
// src/core/grid/row-menu.tsx
|
|
1757
|
+
function hn(t) {
|
|
1758
|
+
let n = M(26), { row: r, label: i, href: a, actions: o, onOpen: s } = t, { i18n: c } = e(), l;
|
|
1759
|
+
n[0] !== o || n[1] !== r ? (l = new Set(fn(o, r)), n[0] = o, n[1] = r, n[2] = l) : l = n[2];
|
|
1760
|
+
let u = l, d, f;
|
|
1761
|
+
if (n[3] !== o || n[4] !== a || n[5] !== c || n[6] !== u || n[7] !== i || n[8] !== s || n[9] !== r) {
|
|
1762
|
+
f = Symbol.for("react.early_return_sentinel");
|
|
1763
|
+
bb0: {
|
|
1764
|
+
let e;
|
|
1765
|
+
n[12] !== u || n[13] !== r ? (e = (e) => !u.has(e) && (!e.when || e.when(r)), n[12] = u, n[13] = r, n[14] = e) : e = n[14];
|
|
1766
|
+
let t = o.filter(e), l = [...t.filter(vn), ...t.filter(_n)];
|
|
1767
|
+
if (!a && !l.length) {
|
|
1768
|
+
let e;
|
|
1769
|
+
n[15] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ W("span", {
|
|
1770
|
+
className: "dt-row-more-space",
|
|
1771
|
+
"aria-hidden": "true"
|
|
1772
|
+
}), n[15] = e) : e = n[15], f = e;
|
|
1773
|
+
break bb0;
|
|
1774
|
+
}
|
|
1775
|
+
let p = l.findIndex(gn), m = (e) => {
|
|
1776
|
+
let t = e.disabled?.(r);
|
|
1777
|
+
return typeof t == "string" ? t : e.description ?? null;
|
|
1778
|
+
}, h = (e) => !!e.disabled?.(r), g;
|
|
1779
|
+
n[16] !== c || n[17] !== i ? (g = c.t("row.actionsAria", { id: i }), n[16] = c, n[17] = i, n[18] = g) : g = n[18];
|
|
1780
|
+
let _;
|
|
1781
|
+
n[19] === Symbol.for("react.memo_cache_sentinel") ? (_ = /* @__PURE__ */ W(ge, {
|
|
1782
|
+
size: 16,
|
|
1783
|
+
weight: "bold",
|
|
1784
|
+
"aria-hidden": "true"
|
|
1785
|
+
}), n[19] = _) : _ = n[19];
|
|
1786
|
+
let v;
|
|
1787
|
+
n[20] === g ? v = n[21] : (v = /* @__PURE__ */ W("button", {
|
|
1788
|
+
type: "button",
|
|
1789
|
+
className: "dt-row-more",
|
|
1790
|
+
"aria-label": g,
|
|
1791
|
+
children: _
|
|
1792
|
+
}), n[20] = g, n[21] = v);
|
|
1793
|
+
let y;
|
|
1794
|
+
n[22] !== a || n[23] !== c || n[24] !== s ? (y = a && /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ G(Ae.LinkItem, {
|
|
1795
|
+
className: "dt-menu-item",
|
|
1796
|
+
href: a,
|
|
1797
|
+
closeOnClick: !0,
|
|
1798
|
+
onClick: (e) => {
|
|
1799
|
+
e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey || s(e);
|
|
1800
|
+
},
|
|
1801
|
+
children: [c.t("row.open"), /* @__PURE__ */ W("kbd", {
|
|
1802
|
+
className: "dt-kbd",
|
|
1803
|
+
children: "↵"
|
|
1804
|
+
})]
|
|
1805
|
+
}), /* @__PURE__ */ W(Ae.LinkItem, {
|
|
1806
|
+
className: "dt-menu-item",
|
|
1807
|
+
href: a,
|
|
1808
|
+
target: "_blank",
|
|
1809
|
+
rel: "noopener",
|
|
1810
|
+
closeOnClick: !0,
|
|
1811
|
+
children: c.t("row.openNewTab")
|
|
1812
|
+
})] }), n[22] = a, n[23] = c, n[24] = s, n[25] = y) : y = n[25], d = /* @__PURE__ */ G(Kt, {
|
|
1813
|
+
className: "dt-row-menu",
|
|
1814
|
+
trigger: v,
|
|
1815
|
+
children: [
|
|
1816
|
+
y,
|
|
1817
|
+
a && l.length > 0 && /* @__PURE__ */ W(Jt, {}),
|
|
1818
|
+
l.map((e, t) => {
|
|
1819
|
+
let n = e.icon, i = m(e);
|
|
1820
|
+
return /* @__PURE__ */ G(N, { children: [t > 0 && (e.separatorBefore || t === p) && /* @__PURE__ */ W(Jt, {}), /* @__PURE__ */ G(qt, {
|
|
1821
|
+
destructive: e.destructive,
|
|
1822
|
+
twoLine: !!i,
|
|
1823
|
+
disabled: h(e),
|
|
1824
|
+
onSelect: () => {
|
|
1825
|
+
h(e) || e.run(r);
|
|
1826
|
+
},
|
|
1827
|
+
children: [
|
|
1828
|
+
n && /* @__PURE__ */ W(n, {
|
|
1829
|
+
size: 16,
|
|
1830
|
+
"aria-hidden": "true"
|
|
1831
|
+
}),
|
|
1832
|
+
/* @__PURE__ */ G("span", {
|
|
1833
|
+
className: "dt-menu-text",
|
|
1834
|
+
children: [/* @__PURE__ */ W("span", { children: e.label }), i && /* @__PURE__ */ W("span", {
|
|
1835
|
+
className: "dt-menu-sub",
|
|
1836
|
+
children: i
|
|
1837
|
+
})]
|
|
1838
|
+
}),
|
|
1839
|
+
e.shortcut && /* @__PURE__ */ W("kbd", {
|
|
1840
|
+
className: "dt-kbd",
|
|
1841
|
+
children: e.shortcut
|
|
1842
|
+
})
|
|
1843
|
+
]
|
|
1844
|
+
})] }, e.id);
|
|
1845
|
+
})
|
|
1846
|
+
]
|
|
1847
|
+
});
|
|
1848
|
+
}
|
|
1849
|
+
n[3] = o, n[4] = a, n[5] = c, n[6] = u, n[7] = i, n[8] = s, n[9] = r, n[10] = d, n[11] = f;
|
|
1850
|
+
} else d = n[10], f = n[11];
|
|
1851
|
+
return f === Symbol.for("react.early_return_sentinel") ? d : f;
|
|
1852
|
+
}
|
|
1853
|
+
function gn(e) {
|
|
1854
|
+
return e.destructive;
|
|
1855
|
+
}
|
|
1856
|
+
function _n(e) {
|
|
1857
|
+
return e.destructive;
|
|
1858
|
+
}
|
|
1859
|
+
function vn(e) {
|
|
1860
|
+
return !e.destructive;
|
|
1861
|
+
}
|
|
1862
|
+
// src/core/grid/row.tsx
|
|
1863
|
+
var yn = () => {
|
|
1864
|
+
let e = M(1), t;
|
|
1865
|
+
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ W("div", {
|
|
1866
|
+
className: "dt-cell dt-cell-fill",
|
|
1867
|
+
role: "presentation",
|
|
1868
|
+
"aria-hidden": "true"
|
|
1869
|
+
}), e[0] = t) : t = e[0], t;
|
|
1870
|
+
};
|
|
1871
|
+
function bn(e, t) {
|
|
1872
|
+
let n = un(e);
|
|
1873
|
+
return [
|
|
1874
|
+
...e.slice(0, n).map((e, n) => t(e, n)),
|
|
1875
|
+
/* @__PURE__ */ W(yn, {}, "__fill"),
|
|
1876
|
+
...e.slice(n).map((e, r) => t(e, n + r))
|
|
1877
|
+
];
|
|
1878
|
+
}
|
|
1879
|
+
function xn(e) {
|
|
1880
|
+
let t = M(53), { col: n, row: i, env: a, secondaryVisible: o, expand: c, lead: l } = e, u = n.def, f, m, h, g;
|
|
1881
|
+
if (t[0] !== n || t[1] !== u || t[2] !== a || t[3] !== c || t[4] !== l || t[5] !== i) {
|
|
1882
|
+
let e = u.accessor ? u.accessor(i) : d(i, n.id);
|
|
1883
|
+
m = p(u, i, e, a);
|
|
1884
|
+
let o;
|
|
1885
|
+
t[10] !== u || t[11] !== i ? (o = u.primary && u.type !== "id" && u.type !== "ajax" ? u.href?.(i) : void 0, t[10] = u, t[11] = i, t[12] = o) : o = t[12];
|
|
1886
|
+
let _ = o;
|
|
1887
|
+
_ && (m = /* @__PURE__ */ W("a", {
|
|
1888
|
+
className: "dt-link dt-primary-link",
|
|
1889
|
+
href: _,
|
|
1890
|
+
children: m
|
|
1891
|
+
}));
|
|
1892
|
+
let v;
|
|
1893
|
+
t[13] === u ? v = t[14] : (v = s(u), t[13] = u, t[14] = v);
|
|
1894
|
+
let b = `is-${v}`, x;
|
|
1895
|
+
t[15] === u.type ? x = t[16] : (x = y(u.type) && "is-numeric", t[15] = u.type, t[16] = x);
|
|
1896
|
+
let S = u.primary && "is-primary", C = (c || l) && "has-expand", w;
|
|
1897
|
+
t[17] !== n || t[18] !== b || t[19] !== x || t[20] !== S || t[21] !== C ? (w = [
|
|
1898
|
+
"dt-cell",
|
|
1899
|
+
b,
|
|
1900
|
+
x,
|
|
1901
|
+
S,
|
|
1902
|
+
C,
|
|
1903
|
+
...ln(n)
|
|
1904
|
+
], t[17] = n, t[18] = b, t[19] = x, t[20] = S, t[21] = C, t[22] = w) : w = t[22], f = w, t[23] === n ? h = t[24] : (h = cn(n), t[23] = n, t[24] = h), g = r(u, e), t[0] = n, t[1] = u, t[2] = a, t[3] = c, t[4] = l, t[5] = i, t[6] = f, t[7] = m, t[8] = h, t[9] = g;
|
|
1905
|
+
} else f = t[6], m = t[7], h = t[8], g = t[9];
|
|
1906
|
+
let _;
|
|
1907
|
+
t[25] !== h || t[26] !== g ? (_ = {
|
|
1908
|
+
...h,
|
|
1909
|
+
...g
|
|
1910
|
+
}, t[25] = h, t[26] = g, t[27] = _) : _ = t[27];
|
|
1911
|
+
let v = _, b;
|
|
1912
|
+
t[28] === m ? b = t[29] : (b = /* @__PURE__ */ W("span", {
|
|
1913
|
+
className: "dt-cell-content",
|
|
1914
|
+
children: m
|
|
1915
|
+
}), t[28] = m, t[29] = b);
|
|
1916
|
+
let x;
|
|
1917
|
+
t[30] !== u || t[31] !== i || t[32] !== o ? (x = o && u.secondary && /* @__PURE__ */ W("span", {
|
|
1918
|
+
className: "dt-secondary",
|
|
1919
|
+
children: u.secondary(i) ?? ""
|
|
1920
|
+
}), t[30] = u, t[31] = i, t[32] = o, t[33] = x) : x = t[33];
|
|
1921
|
+
let S;
|
|
1922
|
+
t[34] !== b || t[35] !== x ? (S = /* @__PURE__ */ G(U, { children: [b, x] }), t[34] = b, t[35] = x, t[36] = S) : S = t[36];
|
|
1923
|
+
let C = S, w;
|
|
1924
|
+
t[37] === f ? w = t[38] : (w = f.filter(Boolean), t[37] = f, t[38] = w);
|
|
1925
|
+
let T = w.join(" "), E;
|
|
1926
|
+
t[39] !== a || t[40] !== c || t[41] !== l || t[42] !== C ? (E = c || l ? /* @__PURE__ */ G(U, { children: [
|
|
1927
|
+
c ? c.can ? /* @__PURE__ */ W("button", {
|
|
1928
|
+
type: "button",
|
|
1929
|
+
className: c.open ? "dt-expand is-open" : "dt-expand",
|
|
1930
|
+
"aria-expanded": c.open,
|
|
1931
|
+
"aria-controls": c.controls,
|
|
1932
|
+
"aria-label": a.i18n.t("expand.showAria", { id: c.label }),
|
|
1933
|
+
onClick: c.onToggle,
|
|
1934
|
+
children: /* @__PURE__ */ W(pe, {
|
|
1935
|
+
size: 14,
|
|
1936
|
+
"aria-hidden": "true"
|
|
1937
|
+
})
|
|
1938
|
+
}) : /* @__PURE__ */ W("span", {
|
|
1939
|
+
className: "dt-expand-space",
|
|
1940
|
+
"aria-hidden": "true"
|
|
1941
|
+
}) : null,
|
|
1942
|
+
l,
|
|
1943
|
+
/* @__PURE__ */ W("span", {
|
|
1944
|
+
className: "dt-cell-main",
|
|
1945
|
+
children: C
|
|
1946
|
+
})
|
|
1947
|
+
] }) : C, t[39] = a, t[40] = c, t[41] = l, t[42] = C, t[43] = E) : E = t[43];
|
|
1948
|
+
let D;
|
|
1949
|
+
t[44] !== u.actions || t[45] !== i ? (D = u.actions?.length ? /* @__PURE__ */ W(pn, {
|
|
1950
|
+
actions: u.actions,
|
|
1951
|
+
row: i
|
|
1952
|
+
}) : null, t[44] = u.actions, t[45] = i, t[46] = D) : D = t[46];
|
|
1953
|
+
let O;
|
|
1954
|
+
return t[47] !== n.id || t[48] !== v || t[49] !== D || t[50] !== T || t[51] !== E ? (O = /* @__PURE__ */ G("div", {
|
|
1955
|
+
className: T,
|
|
1956
|
+
style: v,
|
|
1957
|
+
role: "cell",
|
|
1958
|
+
"data-col": n.id,
|
|
1959
|
+
children: [E, D]
|
|
1960
|
+
}), t[47] = n.id, t[48] = v, t[49] = D, t[50] = T, t[51] = E, t[52] = O) : O = t[52], O;
|
|
1961
|
+
}
|
|
1962
|
+
function Sn(e) {
|
|
1963
|
+
let t = M(21), { action: n, row: r, uid: i } = e, a = n.icon, o;
|
|
1964
|
+
t[0] !== n || t[1] !== r ? (o = n.disabled?.(r), t[0] = n, t[1] = r, t[2] = o) : o = t[2];
|
|
1965
|
+
let s = o, c = typeof s == "string" ? s : null, l = n.description ? `${i}-${n.id}` : void 0, u = !!s, d = c ?? (n.description ? `${n.label} — ${n.description}` : n.label), f;
|
|
1966
|
+
t[3] !== n || t[4] !== r ? (f = () => void n.run(r), t[3] = n, t[4] = r, t[5] = f) : f = t[5];
|
|
1967
|
+
let p;
|
|
1968
|
+
t[6] === a ? p = t[7] : (p = /* @__PURE__ */ W(a, {
|
|
1969
|
+
size: 16,
|
|
1970
|
+
"aria-hidden": "true"
|
|
1971
|
+
}), t[6] = a, t[7] = p);
|
|
1972
|
+
let m;
|
|
1973
|
+
t[8] !== n.label || t[9] !== l || t[10] !== u || t[11] !== d || t[12] !== f || t[13] !== p ? (m = /* @__PURE__ */ W("button", {
|
|
1974
|
+
type: "button",
|
|
1975
|
+
className: "dt-row-inline",
|
|
1976
|
+
disabled: u,
|
|
1977
|
+
"aria-label": n.label,
|
|
1978
|
+
"aria-describedby": l,
|
|
1979
|
+
"data-dt-tip": d,
|
|
1980
|
+
onClick: f,
|
|
1981
|
+
children: p
|
|
1982
|
+
}), t[8] = n.label, t[9] = l, t[10] = u, t[11] = d, t[12] = f, t[13] = p, t[14] = m) : m = t[14];
|
|
1983
|
+
let h;
|
|
1984
|
+
t[15] !== n.description || t[16] !== l ? (h = l && /* @__PURE__ */ W("span", {
|
|
1985
|
+
id: l,
|
|
1986
|
+
className: "dt-sr-only",
|
|
1987
|
+
children: n.description
|
|
1988
|
+
}), t[15] = n.description, t[16] = l, t[17] = h) : h = t[17];
|
|
1989
|
+
let g;
|
|
1990
|
+
return t[18] !== m || t[19] !== h ? (g = /* @__PURE__ */ G("span", {
|
|
1991
|
+
className: "dt-row-inline-wrap",
|
|
1992
|
+
children: [m, h]
|
|
1993
|
+
}), t[18] = m, t[19] = h, t[20] = g) : g = t[20], g;
|
|
1994
|
+
}
|
|
1995
|
+
function Cn(e) {
|
|
1996
|
+
let t = M(43), { row: n, index: r, rowIndex: i, columns: a, env: o, extras: s } = e, c = o.density === "comfortable", l = s?.select, u = s?.menu, d;
|
|
1997
|
+
t[0] === s ? d = t[1] : (d = s?.expand && {
|
|
1998
|
+
...s.expand,
|
|
1999
|
+
label: s.label
|
|
2000
|
+
}, t[0] = s, t[1] = d);
|
|
2001
|
+
let f = d, p;
|
|
2002
|
+
t[2] === s?.error ? p = t[3] : (p = s?.error ?? [], t[2] = s?.error, t[3] = p);
|
|
2003
|
+
let m = p, h;
|
|
2004
|
+
t[4] === m ? h = t[5] : (h = m.join("\n"), t[4] = m, t[5] = h);
|
|
2005
|
+
let g = h, _ = `${s?.uid}-err`, v;
|
|
2006
|
+
t[6] !== m.length || t[7] !== _ || t[8] !== g ? (v = m.length > 0 && /* @__PURE__ */ W("span", {
|
|
2007
|
+
id: _,
|
|
2008
|
+
className: "dt-row-error",
|
|
2009
|
+
role: "img",
|
|
2010
|
+
"aria-label": g,
|
|
2011
|
+
"data-dt-tip": g,
|
|
2012
|
+
children: /* @__PURE__ */ W(Te, {
|
|
2013
|
+
size: 14,
|
|
2014
|
+
weight: "fill",
|
|
2015
|
+
"aria-hidden": "true"
|
|
2016
|
+
})
|
|
2017
|
+
}), t[6] = m.length, t[7] = _, t[8] = g, t[9] = v) : v = t[9];
|
|
2018
|
+
let y = v, b = l?.selected && "is-selected", x = f?.open && "is-expanded", S = m.length && "is-error", C;
|
|
2019
|
+
t[10] !== b || t[11] !== x || t[12] !== S ? (C = [
|
|
2020
|
+
"dt-row",
|
|
2021
|
+
b,
|
|
2022
|
+
x,
|
|
2023
|
+
S
|
|
2024
|
+
].filter(Boolean), t[10] = b, t[11] = x, t[12] = S, t[13] = C) : C = t[13];
|
|
2025
|
+
let w = C.join(" "), T = y ? _ : void 0, E = g || void 0, D;
|
|
2026
|
+
t[14] !== o.i18n || t[15] !== s || t[16] !== l ? (D = l && /* @__PURE__ */ W("label", {
|
|
2027
|
+
className: l.edge ? "dt-cell dt-cell-select is-pinned-start is-pin-edge" : "dt-cell dt-cell-select is-pinned-start",
|
|
2028
|
+
style: { left: 0 },
|
|
2029
|
+
role: "cell",
|
|
2030
|
+
children: /* @__PURE__ */ W("input", {
|
|
2031
|
+
type: "checkbox",
|
|
2032
|
+
className: "dt-checkbox dt-select-box",
|
|
2033
|
+
checked: l.selected,
|
|
2034
|
+
"aria-label": o.i18n.t("row.selectAria", { id: s.label }),
|
|
2035
|
+
onChange: (e) => l.onChange(e.target.checked, e.nativeEvent.shiftKey === !0)
|
|
2036
|
+
})
|
|
2037
|
+
}), t[14] = o.i18n, t[15] = s, t[16] = l, t[17] = D) : D = t[17];
|
|
2038
|
+
let O;
|
|
2039
|
+
t[18] !== a || t[19] !== o || t[20] !== y || t[21] !== f || t[22] !== u || t[23] !== n || t[24] !== c ? (O = (e) => /* @__PURE__ */ W(xn, {
|
|
2040
|
+
col: e,
|
|
2041
|
+
row: n,
|
|
2042
|
+
env: o,
|
|
2043
|
+
secondaryVisible: c,
|
|
2044
|
+
expand: e.def.primary ? f : void 0,
|
|
2045
|
+
lead: !u && e.id === a[0]?.id ? y : void 0
|
|
2046
|
+
}, e.id), t[18] = a, t[19] = o, t[20] = y, t[21] = f, t[22] = u, t[23] = n, t[24] = c, t[25] = O) : O = t[25];
|
|
2047
|
+
let k;
|
|
2048
|
+
t[26] !== a || t[27] !== O ? (k = bn(a, O), t[26] = a, t[27] = O, t[28] = k) : k = t[28];
|
|
2049
|
+
let A;
|
|
2050
|
+
t[29] !== y || t[30] !== s || t[31] !== u || t[32] !== n ? (A = u && /* @__PURE__ */ G("div", {
|
|
2051
|
+
className: u.edge ? "dt-cell dt-cell-menu is-pinned-end is-pin-edge" : "dt-cell dt-cell-menu is-pinned-end",
|
|
2052
|
+
style: { right: 0 },
|
|
2053
|
+
role: "cell",
|
|
2054
|
+
children: [
|
|
2055
|
+
y,
|
|
2056
|
+
fn(u.actions, n).map((e) => /* @__PURE__ */ W(Sn, {
|
|
2057
|
+
action: e,
|
|
2058
|
+
row: n,
|
|
2059
|
+
uid: s.uid
|
|
2060
|
+
}, e.id)),
|
|
2061
|
+
/* @__PURE__ */ W(hn, {
|
|
2062
|
+
row: n,
|
|
2063
|
+
label: s.label,
|
|
2064
|
+
href: u.href,
|
|
2065
|
+
actions: u.actions,
|
|
2066
|
+
onOpen: u.onOpen
|
|
2067
|
+
})
|
|
2068
|
+
]
|
|
2069
|
+
}), t[29] = y, t[30] = s, t[31] = u, t[32] = n, t[33] = A) : A = t[33];
|
|
2070
|
+
let j;
|
|
2071
|
+
return t[34] !== r || t[35] !== i || t[36] !== T || t[37] !== E || t[38] !== D || t[39] !== k || t[40] !== A || t[41] !== w ? (j = /* @__PURE__ */ G("div", {
|
|
2072
|
+
className: w,
|
|
2073
|
+
role: "row",
|
|
2074
|
+
"aria-rowindex": i,
|
|
2075
|
+
"aria-describedby": T,
|
|
2076
|
+
"data-dt-tip": E,
|
|
2077
|
+
"data-index": r,
|
|
2078
|
+
children: [
|
|
2079
|
+
D,
|
|
2080
|
+
k,
|
|
2081
|
+
A
|
|
2082
|
+
]
|
|
2083
|
+
}), t[34] = r, t[35] = i, t[36] = T, t[37] = E, t[38] = D, t[39] = k, t[40] = A, t[41] = w, t[42] = j) : j = t[42], j;
|
|
2084
|
+
}
|
|
2085
|
+
// src/core/grid/skeleton-row.tsx
|
|
2086
|
+
var wn = [
|
|
2087
|
+
72,
|
|
2088
|
+
58,
|
|
2089
|
+
80,
|
|
2090
|
+
64,
|
|
2091
|
+
55,
|
|
2092
|
+
76,
|
|
2093
|
+
61,
|
|
2094
|
+
69
|
|
2095
|
+
];
|
|
2096
|
+
function Tn(e) {
|
|
2097
|
+
let t = M(7), { index: n, columns: r } = e, i;
|
|
2098
|
+
t[0] === n ? i = t[1] : (i = (e, t) => {
|
|
2099
|
+
let r = c[e.def.type].skeleton, i = `${wn[(n + t) % wn.length]}%`, a = [
|
|
2100
|
+
"dt-cell",
|
|
2101
|
+
`is-${s(e.def)}`,
|
|
2102
|
+
...ln(e)
|
|
2103
|
+
].join(" ");
|
|
2104
|
+
return /* @__PURE__ */ W("div", {
|
|
2105
|
+
className: a,
|
|
2106
|
+
style: cn(e),
|
|
2107
|
+
role: "cell",
|
|
2108
|
+
children: r === "person" ? /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("span", { className: "dt-sk dt-sk-circle" }), /* @__PURE__ */ W("span", {
|
|
2109
|
+
className: "dt-sk dt-sk-bar",
|
|
2110
|
+
style: { width: i }
|
|
2111
|
+
})] }) : r === "badge" ? /* @__PURE__ */ W("span", { className: "dt-sk dt-sk-pill" }) : r === "number" ? /* @__PURE__ */ W("span", { className: "dt-sk dt-sk-bar dt-sk-num" }) : /* @__PURE__ */ W("span", {
|
|
2112
|
+
className: "dt-sk dt-sk-bar",
|
|
2113
|
+
style: { width: i }
|
|
2114
|
+
})
|
|
2115
|
+
}, e.id);
|
|
2116
|
+
}, t[0] = n, t[1] = i);
|
|
2117
|
+
let a;
|
|
2118
|
+
t[2] !== r || t[3] !== i ? (a = bn(r, i), t[2] = r, t[3] = i, t[4] = a) : a = t[4];
|
|
2119
|
+
let o;
|
|
2120
|
+
return t[5] === a ? o = t[6] : (o = /* @__PURE__ */ W("div", {
|
|
2121
|
+
className: "dt-row dt-row-skeleton",
|
|
2122
|
+
role: "row",
|
|
2123
|
+
"aria-hidden": "true",
|
|
2124
|
+
children: a
|
|
2125
|
+
}), t[5] = a, t[6] = o), o;
|
|
2126
|
+
}
|
|
2127
|
+
// src/core/grid/use-virtual-rows.ts
|
|
2128
|
+
function En(e) {
|
|
2129
|
+
let t = Ne({
|
|
2130
|
+
count: e.count,
|
|
2131
|
+
getScrollElement: () => e.scrollRef.current,
|
|
2132
|
+
estimateSize: () => e.itemHeight,
|
|
2133
|
+
scrollMargin: e.headHeight,
|
|
2134
|
+
scrollPaddingStart: e.headHeight,
|
|
2135
|
+
scrollPaddingEnd: e.barHeight,
|
|
2136
|
+
overscan: 10,
|
|
2137
|
+
getItemKey: e.keyOf,
|
|
2138
|
+
rangeExtractor: (t) => {
|
|
2139
|
+
let n = Math.max(0, t.startIndex - t.overscan), r = Math.min(t.count - 1, t.endIndex + t.overscan), i = [], a = e.keepIndex;
|
|
2140
|
+
a >= 0 && a < n && a < t.count && i.push(a);
|
|
2141
|
+
for (let e = n; e <= r; e++) i.push(e);
|
|
2142
|
+
return a > r && a < t.count && i.push(a), i;
|
|
2143
|
+
}
|
|
2144
|
+
});
|
|
2145
|
+
return B(() => t.measure(), [
|
|
2146
|
+
t,
|
|
2147
|
+
e.itemHeight,
|
|
2148
|
+
e.resetKey
|
|
2149
|
+
]), {
|
|
2150
|
+
items: t.getVirtualItems().map((e) => ({
|
|
2151
|
+
key: String(e.key),
|
|
2152
|
+
index: e.index,
|
|
2153
|
+
start: e.start
|
|
2154
|
+
})),
|
|
2155
|
+
total: t.getTotalSize(),
|
|
2156
|
+
measureElement: t.measureElement,
|
|
2157
|
+
resizeItem: (e, n) => t.resizeItem(e, n)
|
|
2158
|
+
};
|
|
2159
|
+
}
|
|
2160
|
+
// src/core/grid/grid.tsx
|
|
2161
|
+
var Dn = 12, On = 44, kn = 36, An = typeof matchMedia == "function" && matchMedia("(pointer: coarse)").matches, jn = 40, Mn = 48;
|
|
2162
|
+
function Nn({ layout: t, rows: n, rowId: r, label: i, density: a, skeleton: s = !1, rowCount: c = -1, rowIndexOffset: l = 0, dim: u = !1, refreshing: d = !1, notice: f, state: p, verticalLines: m = !1, scrollKey: h, sort: g, canSort: _, onSort: v, onSortSet: y, filtered: b, canFilter: x, onFilter: S, onColumns: C, onRowClick: w, selection: T, onSelectRows: E, expanded: D, canExpand: O, onToggleExpand: k, renderExpanded: A, resetKey: j, rowMenu: M = !1, rowActions: N = [], primaryHref: P, primaryLabel: F, onRowOpen: I, rowError: L }) {
|
|
2163
|
+
let z = e(), K = ee(null), q = ee(null), te = An && a === "compact" ? "standard" : a, [J] = V(() => new Bt()), ne = H(J.subscribe, J.getVersion), [Y, re] = V({
|
|
2164
|
+
row: On,
|
|
2165
|
+
head: kn,
|
|
2166
|
+
bar: 0
|
|
2167
|
+
}), [ie, X] = V({
|
|
2168
|
+
start: !1,
|
|
2169
|
+
end: !1
|
|
2170
|
+
}), [ae, oe] = V(-1), Z = !!E, se = !!A, Q = t.phone, ce = Z ? Q ? Mn : jn : 0, le = N.some((e) => e.inline) ? n.reduce((e, t) => Math.max(e, fn(N, t).length), 0) : 0, ue = (e) => {
|
|
2171
|
+
let t = L?.(e);
|
|
2172
|
+
return (Array.isArray(t) ? t : [t]).filter((e) => !!e);
|
|
2173
|
+
}, de = !!L && n.some((e) => ue(e).length > 0), fe = M ? `calc(16px${de ? " + var(--dt-icon) - 2px + var(--dt-space)" : ""} + ${le + 1} * var(--dt-control-h-sm) + ${le} * var(--dt-space))` : "", pe = (e) => !!D?.[r(e)], me = En({
|
|
2174
|
+
count: s ? Dn : n.length,
|
|
2175
|
+
scrollRef: q,
|
|
2176
|
+
itemHeight: Y.row + 1,
|
|
2177
|
+
headHeight: Y.head,
|
|
2178
|
+
barHeight: Y.bar,
|
|
2179
|
+
keyOf: (e) => s ? `sk-${e}` : r(n[e]),
|
|
2180
|
+
keepIndex: s ? -1 : ae,
|
|
2181
|
+
resetKey: j
|
|
2182
|
+
}), he = Object.keys(D ?? {}).join("\0"), ge = ee([]);
|
|
2183
|
+
B(() => {
|
|
2184
|
+
let e = new Set(Object.keys(D ?? {}));
|
|
2185
|
+
for (let t of ge.current) {
|
|
2186
|
+
if (e.has(t)) continue;
|
|
2187
|
+
let i = n.findIndex((e) => r(e) === t);
|
|
2188
|
+
i >= 0 && me.resizeItem(i, Y.row + 1);
|
|
2189
|
+
}
|
|
2190
|
+
ge.current = [...e];
|
|
2191
|
+
}, [he]), B(() => {
|
|
2192
|
+
let e = K.current;
|
|
2193
|
+
if (!e) return;
|
|
2194
|
+
let n = () => {
|
|
2195
|
+
e.style.setProperty("--cols", [
|
|
2196
|
+
ce ? `${ce}px` : "",
|
|
2197
|
+
t.cols(),
|
|
2198
|
+
fe
|
|
2199
|
+
].filter(Boolean).join(" "));
|
|
2200
|
+
let n = `${t.minWidth() + ce}px`;
|
|
2201
|
+
e.style.setProperty("--dt-min-w", fe ? `calc(${n} + ${fe})` : n), e.style.setProperty("--dt-sel-w", `${ce}px`), e.style.setProperty("--dt-menu-w", fe || "0px");
|
|
2202
|
+
let r = new Set(t.start.map((e) => e.offsetVar)), i = new Set(t.end.map((e) => e.offsetVar));
|
|
2203
|
+
for (let [n, a] of Object.entries(t.offsets())) r.has(n) ? e.style.setProperty(n, `${parseFloat(a) + ce}px`) : i.has(n) && fe ? e.style.setProperty(n, `calc(${a} + ${fe})`) : e.style.setProperty(n, a);
|
|
2204
|
+
};
|
|
2205
|
+
return n(), t.subscribeSizing(n);
|
|
2206
|
+
}, [
|
|
2207
|
+
t,
|
|
2208
|
+
ce,
|
|
2209
|
+
fe
|
|
2210
|
+
]);
|
|
2211
|
+
let { setScale: _e, scale: ve } = t;
|
|
2212
|
+
B(() => {
|
|
2213
|
+
let e = K.current;
|
|
2214
|
+
if (!e) return;
|
|
2215
|
+
let t = getComputedStyle(e), n = parseFloat(t.getPropertyValue("--dt-row-h")), r = parseFloat(t.getPropertyValue("--dt-fs")), i = e.querySelector(".dt-head")?.offsetHeight, a = q.current, o = {
|
|
2216
|
+
row: Number.isFinite(n) ? n : On,
|
|
2217
|
+
head: i || kn,
|
|
2218
|
+
bar: a ? Math.max(0, a.offsetHeight - a.clientHeight) : 0
|
|
2219
|
+
};
|
|
2220
|
+
re((e) => e.row === o.row && e.head === o.head && e.bar === o.bar ? e : o);
|
|
2221
|
+
let s = Number.isFinite(r) ? r / 13 : 1;
|
|
2222
|
+
s !== ve && _e(s);
|
|
2223
|
+
}, [
|
|
2224
|
+
te,
|
|
2225
|
+
Q,
|
|
2226
|
+
_e,
|
|
2227
|
+
ve
|
|
2228
|
+
]);
|
|
2229
|
+
let ye = ee(h);
|
|
2230
|
+
B(() => {
|
|
2231
|
+
ye.current !== h && (ye.current = h, q.current && (q.current.scrollTop = 0));
|
|
2232
|
+
}, [h]), B(() => {
|
|
2233
|
+
let e = q.current;
|
|
2234
|
+
if (!e) return;
|
|
2235
|
+
let t = () => {
|
|
2236
|
+
let t = e.scrollLeft > 0, n = e.scrollLeft + e.clientWidth < e.scrollWidth - 1;
|
|
2237
|
+
X((e) => e.start === t && e.end === n ? e : {
|
|
2238
|
+
start: t,
|
|
2239
|
+
end: n
|
|
2240
|
+
});
|
|
2241
|
+
};
|
|
2242
|
+
t(), e.addEventListener("scroll", t, { passive: !0 });
|
|
2243
|
+
let n = typeof ResizeObserver > "u" ? null : new ResizeObserver(t);
|
|
2244
|
+
return n?.observe(e), () => {
|
|
2245
|
+
e.removeEventListener("scroll", t), n?.disconnect();
|
|
2246
|
+
};
|
|
2247
|
+
}, []);
|
|
2248
|
+
let be = (e) => {
|
|
2249
|
+
let t = e.target.closest(".dt-row[data-index]");
|
|
2250
|
+
oe(t ? Number(t.dataset.index) : -1);
|
|
2251
|
+
}, xe = ee(null), Se = (e) => {
|
|
2252
|
+
let t = e.target, r = t.closest(".dt-row[data-index]"), i = r && n[Number(r.dataset.index)];
|
|
2253
|
+
if (!i) return;
|
|
2254
|
+
let a = t.closest("a.dt-link");
|
|
2255
|
+
a && a.closest(".dt-cell.is-primary") && r.contains(a) ? e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey || I?.(i, e) : w && rn(e.nativeEvent, r, xe.current) && w(i, e);
|
|
2256
|
+
}, Ce = n.map(r).join("\0"), we = ee({
|
|
2257
|
+
keys: Ce,
|
|
2258
|
+
index: -1
|
|
2259
|
+
}), Te = (e, t, i) => {
|
|
2260
|
+
we.current.keys !== Ce && (we.current = {
|
|
2261
|
+
keys: Ce,
|
|
2262
|
+
index: -1
|
|
2263
|
+
});
|
|
2264
|
+
let a = we.current.index, [o, s] = a < e ? [a, e] : [e, a];
|
|
2265
|
+
E?.(i && a >= 0 ? n.slice(o, s + 1).map(r) : [r(n[e])], t), we.current = {
|
|
2266
|
+
keys: Ce,
|
|
2267
|
+
index: e
|
|
2268
|
+
};
|
|
2269
|
+
}, Ee = Z ? n.reduce((e, t) => e + +!!T?.[r(t)], 0) : 0, De = n.length > 0 && Ee === n.length, Oe = R(), ke = (e, n) => {
|
|
2270
|
+
let i = r(e), a = `${Oe}-sub-${i}`;
|
|
2271
|
+
return {
|
|
2272
|
+
label: F?.(e) ?? i,
|
|
2273
|
+
uid: `${Oe}-r-${i}`,
|
|
2274
|
+
error: ue(e),
|
|
2275
|
+
select: Z ? {
|
|
2276
|
+
selected: !!T?.[i],
|
|
2277
|
+
edge: !t.start.length,
|
|
2278
|
+
onChange: (e, t) => Te(n, e, t)
|
|
2279
|
+
} : void 0,
|
|
2280
|
+
expand: se ? {
|
|
2281
|
+
can: O?.(e) ?? !0,
|
|
2282
|
+
open: pe(e),
|
|
2283
|
+
controls: a,
|
|
2284
|
+
onToggle: () => k?.(i, !pe(e))
|
|
2285
|
+
} : void 0,
|
|
2286
|
+
menu: M ? {
|
|
2287
|
+
edge: !t.end.length,
|
|
2288
|
+
actions: N,
|
|
2289
|
+
href: P?.(e),
|
|
2290
|
+
onOpen: (t) => I?.(e, t)
|
|
2291
|
+
} : void 0
|
|
2292
|
+
};
|
|
2293
|
+
}, $ = (e) => requestAnimationFrame(() => {
|
|
2294
|
+
[...K.current?.querySelectorAll(".dt-head-cell[data-col]") ?? []].find((t) => t.dataset.col === e)?.querySelector(".dt-head-label")?.focus();
|
|
2295
|
+
}), Ae = {
|
|
2296
|
+
fmt: o(z.locale),
|
|
2297
|
+
i18n: z.i18n,
|
|
2298
|
+
today: /* @__PURE__ */ new Date(),
|
|
2299
|
+
labels: J,
|
|
2300
|
+
density: te,
|
|
2301
|
+
coarse: An,
|
|
2302
|
+
labelsVersion: ne
|
|
2303
|
+
}, je = [
|
|
2304
|
+
"dt-grid",
|
|
2305
|
+
ie.start && "is-scrolled-start",
|
|
2306
|
+
ie.end && "is-scrolled-end",
|
|
2307
|
+
s && "is-skeleton",
|
|
2308
|
+
u && "is-dim",
|
|
2309
|
+
m && "has-vlines",
|
|
2310
|
+
Q && "is-phone"
|
|
2311
|
+
], Me = (e) => {
|
|
2312
|
+
let n = !!v && (_?.(e.id) ?? !1);
|
|
2313
|
+
return /* @__PURE__ */ W(dn, {
|
|
2314
|
+
column: e,
|
|
2315
|
+
layout: t,
|
|
2316
|
+
onMoved: $,
|
|
2317
|
+
sort: g?.get(e.id),
|
|
2318
|
+
onSort: n ? (t) => v(e.id, t) : void 0,
|
|
2319
|
+
onSortSet: n && y ? (t) => y(e.id, t) : void 0,
|
|
2320
|
+
filtered: b?.has(e.id),
|
|
2321
|
+
onFilter: S && x?.(e.id) ? () => S(e.id) : void 0,
|
|
2322
|
+
onColumns: C
|
|
2323
|
+
}, e.id);
|
|
2324
|
+
};
|
|
2325
|
+
return /* @__PURE__ */ G("div", {
|
|
2326
|
+
ref: K,
|
|
2327
|
+
className: je.filter(Boolean).join(" "),
|
|
2328
|
+
role: "table",
|
|
2329
|
+
"aria-label": i,
|
|
2330
|
+
"aria-rowcount": c,
|
|
2331
|
+
"aria-colcount": t.columns.length + +!!Z + +!!M,
|
|
2332
|
+
"aria-busy": s || u || void 0,
|
|
2333
|
+
"data-density": te,
|
|
2334
|
+
onFocus: be,
|
|
2335
|
+
onMouseDown: (e) => xe.current = {
|
|
2336
|
+
x: e.clientX,
|
|
2337
|
+
y: e.clientY
|
|
2338
|
+
},
|
|
2339
|
+
onClick: Se,
|
|
2340
|
+
children: [
|
|
2341
|
+
/* @__PURE__ */ G("div", {
|
|
2342
|
+
ref: q,
|
|
2343
|
+
className: "dt-scroll",
|
|
2344
|
+
style: {
|
|
2345
|
+
scrollPaddingTop: Y.head,
|
|
2346
|
+
scrollPaddingBottom: Y.bar
|
|
2347
|
+
},
|
|
2348
|
+
children: [/* @__PURE__ */ G("div", {
|
|
2349
|
+
className: "dt-head",
|
|
2350
|
+
role: "row",
|
|
2351
|
+
"aria-rowindex": 1,
|
|
2352
|
+
children: [
|
|
2353
|
+
Z && /* @__PURE__ */ W("div", {
|
|
2354
|
+
className: t.start.length ? "dt-head-cell dt-head-select is-pinned-start" : "dt-head-cell dt-head-select is-pinned-start is-pin-edge",
|
|
2355
|
+
style: { left: 0 },
|
|
2356
|
+
role: "columnheader",
|
|
2357
|
+
children: /* @__PURE__ */ W("input", {
|
|
2358
|
+
type: "checkbox",
|
|
2359
|
+
className: "dt-checkbox",
|
|
2360
|
+
checked: De,
|
|
2361
|
+
ref: (e) => {
|
|
2362
|
+
e && (e.indeterminate = Ee > 0 && !De);
|
|
2363
|
+
},
|
|
2364
|
+
"aria-label": z.i18n.t("row.selectPageAria"),
|
|
2365
|
+
onChange: () => E?.(n.map(r), !De)
|
|
2366
|
+
})
|
|
2367
|
+
}),
|
|
2368
|
+
[...t.start, ...t.center].map(Me),
|
|
2369
|
+
/* @__PURE__ */ W("div", {
|
|
2370
|
+
className: "dt-head-cell dt-cell-fill",
|
|
2371
|
+
role: "presentation",
|
|
2372
|
+
"aria-hidden": "true"
|
|
2373
|
+
}),
|
|
2374
|
+
t.end.map(Me),
|
|
2375
|
+
M && /* @__PURE__ */ W("div", {
|
|
2376
|
+
className: t.end.length ? "dt-head-cell dt-head-menu-col is-pinned-end" : "dt-head-cell dt-head-menu-col is-pinned-end is-pin-edge",
|
|
2377
|
+
style: { right: 0 },
|
|
2378
|
+
role: "columnheader"
|
|
2379
|
+
})
|
|
2380
|
+
]
|
|
2381
|
+
}), /* @__PURE__ */ W("div", {
|
|
2382
|
+
className: "dt-body",
|
|
2383
|
+
role: "presentation",
|
|
2384
|
+
inert: u || void 0,
|
|
2385
|
+
style: { height: me.total },
|
|
2386
|
+
children: me.items.map((e) => {
|
|
2387
|
+
let i = s ? void 0 : n[e.index], a = !!i && se && pe(i);
|
|
2388
|
+
return /* @__PURE__ */ W("div", {
|
|
2389
|
+
ref: a ? me.measureElement : void 0,
|
|
2390
|
+
className: "dt-item",
|
|
2391
|
+
"data-index": e.index,
|
|
2392
|
+
style: { transform: `translateY(${e.start - Y.head}px)` },
|
|
2393
|
+
children: i ? /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(Cn, {
|
|
2394
|
+
row: i,
|
|
2395
|
+
index: e.index,
|
|
2396
|
+
rowIndex: 2 + l + e.index,
|
|
2397
|
+
columns: t.columns,
|
|
2398
|
+
env: Ae,
|
|
2399
|
+
extras: ke(i, e.index)
|
|
2400
|
+
}), a && /* @__PURE__ */ W("div", {
|
|
2401
|
+
id: `${Oe}-sub-${r(i)}`,
|
|
2402
|
+
className: "dt-subrow",
|
|
2403
|
+
role: "row",
|
|
2404
|
+
"aria-rowindex": 2 + l + e.index,
|
|
2405
|
+
children: /* @__PURE__ */ W("div", {
|
|
2406
|
+
role: "cell",
|
|
2407
|
+
"aria-colspan": t.columns.length,
|
|
2408
|
+
children: A(i, () => k?.(r(i), !1))
|
|
2409
|
+
})
|
|
2410
|
+
})] }) : /* @__PURE__ */ W(Tn, {
|
|
2411
|
+
index: e.index,
|
|
2412
|
+
columns: t.columns
|
|
2413
|
+
})
|
|
2414
|
+
}, e.key);
|
|
2415
|
+
})
|
|
2416
|
+
})]
|
|
2417
|
+
}),
|
|
2418
|
+
d && /* @__PURE__ */ W("div", {
|
|
2419
|
+
className: "dt-refresh-bar",
|
|
2420
|
+
"aria-hidden": "true"
|
|
2421
|
+
}),
|
|
2422
|
+
f && /* @__PURE__ */ W("div", {
|
|
2423
|
+
className: "dt-notice",
|
|
2424
|
+
role: "status",
|
|
2425
|
+
children: f
|
|
2426
|
+
}),
|
|
2427
|
+
p && !s && n.length === 0 && /* @__PURE__ */ W("div", {
|
|
2428
|
+
className: "dt-body-state",
|
|
2429
|
+
children: p
|
|
2430
|
+
})
|
|
2431
|
+
]
|
|
2432
|
+
});
|
|
2433
|
+
}
|
|
2434
|
+
// src/core/grid/tooltip.tsx
|
|
2435
|
+
var Pn = 400, Fn = (e) => e.scrollWidth > e.clientWidth + 1, In = (e) => Fn(e) && getComputedStyle(e).overflowX !== "visible", Ln = (e) => {
|
|
2436
|
+
let t = e?.closest("[data-dt-tip]");
|
|
2437
|
+
if (t?.dataset.dtTip) return {
|
|
2438
|
+
el: t,
|
|
2439
|
+
text: t.dataset.dtTip
|
|
2440
|
+
};
|
|
2441
|
+
let n = e?.closest(".dt-cell-content, .dt-head-label");
|
|
2442
|
+
return n && (Fn(n) || [...n.querySelectorAll("*")].some(In)) ? {
|
|
2443
|
+
el: n,
|
|
2444
|
+
text: n.textContent?.trim() ?? ""
|
|
2445
|
+
} : null;
|
|
2446
|
+
};
|
|
2447
|
+
function Rn(e) {
|
|
2448
|
+
let t = M(11), { root: n } = e, [r, i] = V(null), a;
|
|
2449
|
+
t[0] === n.current ? a = t[1] : (a = () => {
|
|
2450
|
+
let e = n.current;
|
|
2451
|
+
if (!e) return;
|
|
2452
|
+
let t, r = null, a = () => {
|
|
2453
|
+
clearTimeout(t), r = null, i(null);
|
|
2454
|
+
}, o = (e, t, n) => {
|
|
2455
|
+
let r = e.getBoundingClientRect(), a = n !== void 0 && r.width > 320 ? n : r.left + r.width / 2;
|
|
2456
|
+
i({
|
|
2457
|
+
text: t,
|
|
2458
|
+
left: Math.round(a),
|
|
2459
|
+
top: Math.round(r.bottom + 6)
|
|
2460
|
+
});
|
|
2461
|
+
}, s = (e) => {
|
|
2462
|
+
let n = Ln(e.target);
|
|
2463
|
+
n && n.el !== r && (a(), r = n.el, t = setTimeout(() => o(n.el, n.text, e.clientX), Pn));
|
|
2464
|
+
}, c = (e) => {
|
|
2465
|
+
r && !r.contains(e.relatedTarget) && a();
|
|
2466
|
+
}, l = (e) => {
|
|
2467
|
+
let t = Ln(e.target);
|
|
2468
|
+
t && (a(), r = t.el, o(t.el, t.text));
|
|
2469
|
+
};
|
|
2470
|
+
return e.addEventListener("mouseover", s), e.addEventListener("mouseout", c), e.addEventListener("focusin", l), e.addEventListener("focusout", a), e.addEventListener("scroll", a, !0), e.addEventListener("mousedown", a), () => {
|
|
2471
|
+
clearTimeout(t), e.removeEventListener("mouseover", s), e.removeEventListener("mouseout", c), e.removeEventListener("focusin", l), e.removeEventListener("focusout", a), e.removeEventListener("scroll", a, !0), e.removeEventListener("mousedown", a);
|
|
2472
|
+
};
|
|
2473
|
+
}, t[0] = n.current, t[1] = a);
|
|
2474
|
+
let o;
|
|
2475
|
+
if (t[2] === n ? o = t[3] : (o = [n], t[2] = n, t[3] = o), I(a, o), !r) return null;
|
|
2476
|
+
let s = r.text.includes("\n") ? "dt-tip is-multi" : "dt-tip", c;
|
|
2477
|
+
t[4] !== r.left || t[5] !== r.top ? (c = {
|
|
2478
|
+
left: r.left,
|
|
2479
|
+
top: r.top
|
|
2480
|
+
}, t[4] = r.left, t[5] = r.top, t[6] = c) : c = t[6];
|
|
2481
|
+
let l;
|
|
2482
|
+
return t[7] !== s || t[8] !== c || t[9] !== r.text ? (l = /* @__PURE__ */ W("div", {
|
|
2483
|
+
className: s,
|
|
2484
|
+
role: "tooltip",
|
|
2485
|
+
style: c,
|
|
2486
|
+
children: r.text
|
|
2487
|
+
}), t[7] = s, t[8] = c, t[9] = r.text, t[10] = l) : l = t[10], l;
|
|
2488
|
+
}
|
|
2489
|
+
// src/core/states/state-message.tsx
|
|
2490
|
+
var zn = {
|
|
2491
|
+
empty: be,
|
|
2492
|
+
noResults: ve,
|
|
2493
|
+
noResultsSearch: ye,
|
|
2494
|
+
error: Te,
|
|
2495
|
+
noRowsOnPage: _e
|
|
2496
|
+
};
|
|
2497
|
+
function Bn(e) {
|
|
2498
|
+
let t = M(18), { kind: n, title: r, lines: i, actions: a, after: o } = e, s;
|
|
2499
|
+
t[0] === i ? s = t[1] : (s = i === void 0 ? [] : i, t[0] = i, t[1] = s);
|
|
2500
|
+
let c = s, l = zn[n], u = `dt-state is-${n}`, d = n === "error" ? "alert" : "status", f;
|
|
2501
|
+
t[2] === l ? f = t[3] : (f = /* @__PURE__ */ W("span", {
|
|
2502
|
+
className: "dt-state-icon",
|
|
2503
|
+
"aria-hidden": "true",
|
|
2504
|
+
children: /* @__PURE__ */ W(l, { size: 20 })
|
|
2505
|
+
}), t[2] = l, t[3] = f);
|
|
2506
|
+
let p;
|
|
2507
|
+
t[4] === r ? p = t[5] : (p = /* @__PURE__ */ W("strong", {
|
|
2508
|
+
className: "dt-state-title",
|
|
2509
|
+
children: r
|
|
2510
|
+
}), t[4] = r, t[5] = p);
|
|
2511
|
+
let m;
|
|
2512
|
+
t[6] === c ? m = t[7] : (m = c.map(Vn), t[6] = c, t[7] = m);
|
|
2513
|
+
let h;
|
|
2514
|
+
t[8] === a ? h = t[9] : (h = a && /* @__PURE__ */ W("div", {
|
|
2515
|
+
className: "dt-state-actions",
|
|
2516
|
+
children: a
|
|
2517
|
+
}), t[8] = a, t[9] = h);
|
|
2518
|
+
let g;
|
|
2519
|
+
return t[10] !== o || t[11] !== u || t[12] !== d || t[13] !== f || t[14] !== p || t[15] !== m || t[16] !== h ? (g = /* @__PURE__ */ G("div", {
|
|
2520
|
+
className: u,
|
|
2521
|
+
role: d,
|
|
2522
|
+
children: [
|
|
2523
|
+
f,
|
|
2524
|
+
p,
|
|
2525
|
+
m,
|
|
2526
|
+
h,
|
|
2527
|
+
o
|
|
2528
|
+
]
|
|
2529
|
+
}), t[10] = o, t[11] = u, t[12] = d, t[13] = f, t[14] = p, t[15] = m, t[16] = h, t[17] = g) : g = t[17], g;
|
|
2530
|
+
}
|
|
2531
|
+
function Vn(e) {
|
|
2532
|
+
return /* @__PURE__ */ W("p", {
|
|
2533
|
+
className: "dt-state-line",
|
|
2534
|
+
children: e
|
|
2535
|
+
}, e);
|
|
2536
|
+
}
|
|
2537
|
+
// src/core/toolbar/display-popover.tsx
|
|
2538
|
+
var Hn = [
|
|
2539
|
+
"comfortable",
|
|
2540
|
+
"standard",
|
|
2541
|
+
"compact"
|
|
2542
|
+
];
|
|
2543
|
+
function Un(t) {
|
|
2544
|
+
let n = M(64), { density: r, onDensity: i, verticalLines: a, onVerticalLines: o, counts: s, onColumns: c, persistent: l, onReset: u, iconOnly: d } = t, { i18n: f } = e(), [p, m] = V(!1), h = ee(null), g;
|
|
2545
|
+
n[0] === c ? g = n[1] : (g = () => {
|
|
2546
|
+
m(!1), c(h.current);
|
|
2547
|
+
}, n[0] = c, n[1] = g);
|
|
2548
|
+
let _ = g, v;
|
|
2549
|
+
n[2] === Symbol.for("react.memo_cache_sentinel") ? (v = (e) => m(e), n[2] = v) : v = n[2];
|
|
2550
|
+
let y = d ? "dt-btn has-icon dt-btn-icon" : "dt-btn has-icon", b;
|
|
2551
|
+
n[3] === f ? b = n[4] : (b = f.t("toolbar.display"), n[3] = f, n[4] = b);
|
|
2552
|
+
let x;
|
|
2553
|
+
n[5] !== f || n[6] !== d ? (x = d ? f.t("toolbar.display") : void 0, n[5] = f, n[6] = d, n[7] = x) : x = n[7];
|
|
2554
|
+
let S;
|
|
2555
|
+
n[8] === Symbol.for("react.memo_cache_sentinel") ? (S = /* @__PURE__ */ W(Ce, {
|
|
2556
|
+
size: 16,
|
|
2557
|
+
"aria-hidden": "true"
|
|
2558
|
+
}), n[8] = S) : S = n[8];
|
|
2559
|
+
let C;
|
|
2560
|
+
n[9] !== f || n[10] !== d ? (C = !d && /* @__PURE__ */ W("span", { children: f.t("toolbar.display") }), n[9] = f, n[10] = d, n[11] = C) : C = n[11];
|
|
2561
|
+
let w;
|
|
2562
|
+
n[12] !== y || n[13] !== b || n[14] !== x || n[15] !== C ? (w = /* @__PURE__ */ G($.Trigger, {
|
|
2563
|
+
ref: h,
|
|
2564
|
+
className: y,
|
|
2565
|
+
"aria-label": b,
|
|
2566
|
+
"data-dt-tip": x,
|
|
2567
|
+
children: [S, C]
|
|
2568
|
+
}), n[12] = y, n[13] = b, n[14] = x, n[15] = C, n[16] = w) : w = n[16];
|
|
2569
|
+
let T;
|
|
2570
|
+
n[17] !== r || n[18] !== f || n[19] !== i ? (T = i && /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("div", {
|
|
2571
|
+
className: "dt-pop-label",
|
|
2572
|
+
children: f.t("display.density")
|
|
2573
|
+
}), /* @__PURE__ */ W(Me, {
|
|
2574
|
+
className: "dt-seg dt-seg-sm dt-display-density",
|
|
2575
|
+
value: [r],
|
|
2576
|
+
onValueChange: (e) => e[0] && i(e[0]),
|
|
2577
|
+
children: Hn.map((e) => /* @__PURE__ */ W(je, {
|
|
2578
|
+
className: "dt-seg-item",
|
|
2579
|
+
value: e,
|
|
2580
|
+
"data-state": e === r ? "on" : "off",
|
|
2581
|
+
children: f.t(`display.${e}`)
|
|
2582
|
+
}, e))
|
|
2583
|
+
})] }), n[17] = r, n[18] = f, n[19] = i, n[20] = T) : T = n[20];
|
|
2584
|
+
let E;
|
|
2585
|
+
n[21] === f ? E = n[22] : (E = f.t("display.verticalLines"), n[21] = f, n[22] = E);
|
|
2586
|
+
let D;
|
|
2587
|
+
n[23] !== o || n[24] !== a ? (D = /* @__PURE__ */ W(j, {
|
|
2588
|
+
className: "dt-pop-end",
|
|
2589
|
+
checked: a,
|
|
2590
|
+
onChange: o
|
|
2591
|
+
}), n[23] = o, n[24] = a, n[25] = D) : D = n[25];
|
|
2592
|
+
let O;
|
|
2593
|
+
n[26] !== E || n[27] !== D ? (O = /* @__PURE__ */ G("label", {
|
|
2594
|
+
className: "dt-pop-item",
|
|
2595
|
+
children: [E, D]
|
|
2596
|
+
}), n[26] = E, n[27] = D, n[28] = O) : O = n[28];
|
|
2597
|
+
let k;
|
|
2598
|
+
n[29] === Symbol.for("react.memo_cache_sentinel") ? (k = /* @__PURE__ */ W("div", { className: "dt-pop-sep" }), n[29] = k) : k = n[29];
|
|
2599
|
+
let A;
|
|
2600
|
+
n[30] === f ? A = n[31] : (A = f.t("display.columns"), n[30] = f, n[31] = A);
|
|
2601
|
+
let N;
|
|
2602
|
+
n[32] !== s || n[33] !== f ? (N = f.t("columns.shownOf", s), n[32] = s, n[33] = f, n[34] = N) : N = n[34];
|
|
2603
|
+
let P;
|
|
2604
|
+
n[35] === N ? P = n[36] : (P = /* @__PURE__ */ W("span", {
|
|
2605
|
+
className: "dt-pop-value",
|
|
2606
|
+
children: N
|
|
2607
|
+
}), n[35] = N, n[36] = P);
|
|
2608
|
+
let F;
|
|
2609
|
+
n[37] === Symbol.for("react.memo_cache_sentinel") ? (F = /* @__PURE__ */ W(pe, {
|
|
2610
|
+
size: 14,
|
|
2611
|
+
"aria-hidden": "true"
|
|
2612
|
+
}), n[37] = F) : F = n[37];
|
|
2613
|
+
let I;
|
|
2614
|
+
n[38] !== _ || n[39] !== A || n[40] !== P ? (I = /* @__PURE__ */ G("button", {
|
|
2615
|
+
type: "button",
|
|
2616
|
+
className: "dt-pop-item",
|
|
2617
|
+
onClick: _,
|
|
2618
|
+
children: [
|
|
2619
|
+
A,
|
|
2620
|
+
P,
|
|
2621
|
+
F
|
|
2622
|
+
]
|
|
2623
|
+
}), n[38] = _, n[39] = A, n[40] = P, n[41] = I) : I = n[41];
|
|
2624
|
+
let L;
|
|
2625
|
+
n[42] !== f || n[43] !== l ? (L = l ? f.t("display.savedForYou") : "", n[42] = f, n[43] = l, n[44] = L) : L = n[44];
|
|
2626
|
+
let R;
|
|
2627
|
+
n[45] === L ? R = n[46] : (R = /* @__PURE__ */ W("span", { children: L }), n[45] = L, n[46] = R);
|
|
2628
|
+
let z;
|
|
2629
|
+
n[47] === f ? z = n[48] : (z = f.t("common.reset"), n[47] = f, n[48] = z);
|
|
2630
|
+
let B;
|
|
2631
|
+
n[49] !== u || n[50] !== z ? (B = /* @__PURE__ */ W("button", {
|
|
2632
|
+
type: "button",
|
|
2633
|
+
className: "dt-pop-action",
|
|
2634
|
+
onClick: u,
|
|
2635
|
+
children: z
|
|
2636
|
+
}), n[49] = u, n[50] = z, n[51] = B) : B = n[51];
|
|
2637
|
+
let H;
|
|
2638
|
+
n[52] !== R || n[53] !== B ? (H = /* @__PURE__ */ G("div", {
|
|
2639
|
+
className: "dt-pop-foot",
|
|
2640
|
+
children: [R, B]
|
|
2641
|
+
}), n[52] = R, n[53] = B, n[54] = H) : H = n[54];
|
|
2642
|
+
let K;
|
|
2643
|
+
n[55] !== O || n[56] !== I || n[57] !== H || n[58] !== T ? (K = /* @__PURE__ */ W($.Portal, { children: /* @__PURE__ */ W($.Positioner, {
|
|
2644
|
+
className: "dt-positioner",
|
|
2645
|
+
align: "end",
|
|
2646
|
+
sideOffset: 4,
|
|
2647
|
+
children: /* @__PURE__ */ G($.Popup, {
|
|
2648
|
+
className: "dt-pop dt-display",
|
|
2649
|
+
children: [
|
|
2650
|
+
T,
|
|
2651
|
+
O,
|
|
2652
|
+
k,
|
|
2653
|
+
I,
|
|
2654
|
+
H
|
|
2655
|
+
]
|
|
2656
|
+
})
|
|
2657
|
+
}) }), n[55] = O, n[56] = I, n[57] = H, n[58] = T, n[59] = K) : K = n[59];
|
|
2658
|
+
let q;
|
|
2659
|
+
return n[60] !== p || n[61] !== K || n[62] !== w ? (q = /* @__PURE__ */ G($.Root, {
|
|
2660
|
+
open: p,
|
|
2661
|
+
onOpenChange: v,
|
|
2662
|
+
children: [w, K]
|
|
2663
|
+
}), n[60] = p, n[61] = K, n[62] = w, n[63] = q) : q = n[63], q;
|
|
2664
|
+
}
|
|
2665
|
+
// src/core/toolbar/more-menu.tsx
|
|
2666
|
+
function Wn(t) {
|
|
2667
|
+
let n = M(36), { exportHint: r, onExport: i, onRefresh: a, onPrint: o, autoRefresh: s, autoRefreshOn: c, onAutoRefresh: l } = t, { i18n: u } = e(), d = R(), f;
|
|
2668
|
+
n[0] === u ? f = n[1] : (f = u.t("toolbar.more"), n[0] = u, n[1] = f);
|
|
2669
|
+
let p;
|
|
2670
|
+
n[2] === u ? p = n[3] : (p = u.t("toolbar.more"), n[2] = u, n[3] = p);
|
|
2671
|
+
let m;
|
|
2672
|
+
n[4] === Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ W(ge, {
|
|
2673
|
+
size: 16,
|
|
2674
|
+
weight: "bold",
|
|
2675
|
+
"aria-hidden": "true"
|
|
2676
|
+
}), n[4] = m) : m = n[4];
|
|
2677
|
+
let h;
|
|
2678
|
+
n[5] !== f || n[6] !== p ? (h = /* @__PURE__ */ W("button", {
|
|
2679
|
+
type: "button",
|
|
2680
|
+
className: "dt-btn dt-btn-icon",
|
|
2681
|
+
"aria-label": f,
|
|
2682
|
+
"data-dt-tip": p,
|
|
2683
|
+
children: m
|
|
2684
|
+
}), n[5] = f, n[6] = p, n[7] = h) : h = n[7];
|
|
2685
|
+
let g;
|
|
2686
|
+
n[8] !== r || n[9] !== d || n[10] !== u || n[11] !== i ? (g = r && /* @__PURE__ */ G(Ae.SubmenuRoot, { children: [/* @__PURE__ */ W(Ae.SubmenuTrigger, {
|
|
2687
|
+
className: "dt-menu-item",
|
|
2688
|
+
"aria-label": u.t("sheet.export"),
|
|
2689
|
+
"aria-describedby": d,
|
|
2690
|
+
children: /* @__PURE__ */ G("span", {
|
|
2691
|
+
className: "dt-item-lines",
|
|
2692
|
+
children: [u.t("sheet.export"), /* @__PURE__ */ W("span", {
|
|
2693
|
+
id: d,
|
|
2694
|
+
className: "dt-item-hint",
|
|
2695
|
+
children: r
|
|
2696
|
+
})]
|
|
2697
|
+
})
|
|
2698
|
+
}), /* @__PURE__ */ W(Ae.Portal, { children: /* @__PURE__ */ W(Ae.Positioner, {
|
|
2699
|
+
className: "dt-positioner",
|
|
2700
|
+
sideOffset: 4,
|
|
2701
|
+
children: /* @__PURE__ */ G(Ae.Popup, {
|
|
2702
|
+
className: "dt-menu",
|
|
2703
|
+
children: [/* @__PURE__ */ W(qt, {
|
|
2704
|
+
onSelect: () => i("csv"),
|
|
2705
|
+
children: u.t("toolbar.csv")
|
|
2706
|
+
}), /* @__PURE__ */ W(qt, {
|
|
2707
|
+
onSelect: () => i("xlsx"),
|
|
2708
|
+
children: u.t("toolbar.xlsx")
|
|
2709
|
+
})]
|
|
2710
|
+
})
|
|
2711
|
+
}) })] }), n[8] = r, n[9] = d, n[10] = u, n[11] = i, n[12] = g) : g = n[12];
|
|
2712
|
+
let _;
|
|
2713
|
+
n[13] !== u || n[14] !== o ? (_ = o && /* @__PURE__ */ W(qt, {
|
|
2714
|
+
onSelect: o,
|
|
2715
|
+
children: u.t("toolbar.print")
|
|
2716
|
+
}), n[13] = u, n[14] = o, n[15] = _) : _ = n[15];
|
|
2717
|
+
let v;
|
|
2718
|
+
n[16] !== s || n[17] !== r || n[18] !== o || n[19] !== a ? (v = (r || o) && (a || s) && /* @__PURE__ */ W(Jt, {}), n[16] = s, n[17] = r, n[18] = o, n[19] = a, n[20] = v) : v = n[20];
|
|
2719
|
+
let y;
|
|
2720
|
+
n[21] !== u || n[22] !== a ? (y = a && /* @__PURE__ */ G(qt, {
|
|
2721
|
+
onSelect: a,
|
|
2722
|
+
children: [u.t("toolbar.refresh"), /* @__PURE__ */ W("kbd", {
|
|
2723
|
+
className: "dt-kbd",
|
|
2724
|
+
children: "R"
|
|
2725
|
+
})]
|
|
2726
|
+
}), n[21] = u, n[22] = a, n[23] = y) : y = n[23];
|
|
2727
|
+
let b;
|
|
2728
|
+
n[24] !== s || n[25] !== c || n[26] !== u || n[27] !== l ? (b = s && /* @__PURE__ */ G(Ae.CheckboxItem, {
|
|
2729
|
+
className: "dt-menu-item",
|
|
2730
|
+
checked: c,
|
|
2731
|
+
onCheckedChange: (e) => l(e),
|
|
2732
|
+
closeOnClick: !0,
|
|
2733
|
+
children: [u.t("toolbar.autoRefresh"), /* @__PURE__ */ W("span", {
|
|
2734
|
+
className: "dt-switch dt-pop-end",
|
|
2735
|
+
"data-state": c ? "checked" : "unchecked",
|
|
2736
|
+
"aria-hidden": "true",
|
|
2737
|
+
children: /* @__PURE__ */ W("span", { className: "dt-switch-thumb" })
|
|
2738
|
+
})]
|
|
2739
|
+
}), n[24] = s, n[25] = c, n[26] = u, n[27] = l, n[28] = b) : b = n[28];
|
|
2740
|
+
let x;
|
|
2741
|
+
return n[29] !== h || n[30] !== g || n[31] !== _ || n[32] !== v || n[33] !== y || n[34] !== b ? (x = /* @__PURE__ */ G(Kt, {
|
|
2742
|
+
className: "dt-more-menu",
|
|
2743
|
+
trigger: h,
|
|
2744
|
+
children: [
|
|
2745
|
+
g,
|
|
2746
|
+
_,
|
|
2747
|
+
v,
|
|
2748
|
+
y,
|
|
2749
|
+
b
|
|
2750
|
+
]
|
|
2751
|
+
}), n[29] = h, n[30] = g, n[31] = _, n[32] = v, n[33] = y, n[34] = b, n[35] = x) : x = n[35], x;
|
|
2752
|
+
}
|
|
2753
|
+
// src/core/toolbar/phone-more-sheet.tsx
|
|
2754
|
+
var Gn = F(() => import("./columns-dialog-COcldc3X.js")), Kn = [
|
|
2755
|
+
"comfortable",
|
|
2756
|
+
"standard",
|
|
2757
|
+
"compact"
|
|
2758
|
+
], qn = {
|
|
2759
|
+
main: "toolbar.more",
|
|
2760
|
+
density: "display.density",
|
|
2761
|
+
sort: "display.sort",
|
|
2762
|
+
export: "sheet.export"
|
|
2763
|
+
};
|
|
2764
|
+
function Jn(t) {
|
|
2765
|
+
let n = M(70), { density: r, onDensity: i, columns: a, counts: o, onColumnsSave: s, sort: c, onSort: l, persistent: u, onReset: d, exportHint: f, onExport: p, onRefresh: m, onPrint: h, autoRefresh: g, autoRefreshOn: v, onAutoRefresh: y } = t, { i18n: b } = e(), x = R(), [S, C] = V(!1), [w, T] = V("main"), [E, D] = V(!1), [O, k] = V(!1), A = ee(null), N;
|
|
2766
|
+
n[0] === a ? N = n[1] : (N = (e) => a.find((t) => t.id === e)?.def.header ?? e, n[0] = a, n[1] = N);
|
|
2767
|
+
let F = N, I = c[0], L;
|
|
2768
|
+
n[2] !== F || n[3] !== b || n[4] !== I || n[5] !== c.length ? (L = I ? `${F(I.column)} ${I.dir === "asc" ? "↑" : "↓"}${c.length > 1 ? ` +${c.length - 1}` : ""}` : b.t("common.empty"), n[2] = F, n[3] = b, n[4] = I, n[5] = c.length, n[6] = L) : L = n[6];
|
|
2769
|
+
let z = L, B = !!(f || h || m || g), H;
|
|
2770
|
+
n[7] === Symbol.for("react.memo_cache_sentinel") ? (H = (e) => {
|
|
2771
|
+
C(e), e || T("main");
|
|
2772
|
+
}, n[7] = H) : H = n[7];
|
|
2773
|
+
let K = H, q;
|
|
2774
|
+
n[8] === Symbol.for("react.memo_cache_sentinel") ? (q = (e) => {
|
|
2775
|
+
K(!1), e();
|
|
2776
|
+
}, n[8] = q) : q = n[8];
|
|
2777
|
+
let te = q, J;
|
|
2778
|
+
n[9] !== b || n[10] !== w ? (J = b.t(qn[w]), n[9] = b, n[10] = w, n[11] = J) : J = n[11];
|
|
2779
|
+
let ne = w === "main", Y;
|
|
2780
|
+
n[12] === b ? Y = n[13] : (Y = b.t("toolbar.more"), n[12] = b, n[13] = Y);
|
|
2781
|
+
let re;
|
|
2782
|
+
n[14] === Symbol.for("react.memo_cache_sentinel") ? (re = /* @__PURE__ */ W(ge, {
|
|
2783
|
+
size: 20,
|
|
2784
|
+
weight: "bold",
|
|
2785
|
+
"aria-hidden": "true"
|
|
2786
|
+
}), n[14] = re) : re = n[14];
|
|
2787
|
+
let ie;
|
|
2788
|
+
n[15] === Y ? ie = n[16] : (ie = /* @__PURE__ */ W("button", {
|
|
2789
|
+
ref: A,
|
|
2790
|
+
type: "button",
|
|
2791
|
+
className: "dt-btn dt-btn-icon dt-more-trigger",
|
|
2792
|
+
"aria-label": Y,
|
|
2793
|
+
children: re
|
|
2794
|
+
}), n[15] = Y, n[16] = ie);
|
|
2795
|
+
let X;
|
|
2796
|
+
n[17] !== b || n[18] !== w ? (X = w !== "main" && /* @__PURE__ */ W("button", {
|
|
2797
|
+
type: "button",
|
|
2798
|
+
className: "dt-bsheet-back",
|
|
2799
|
+
"aria-label": b.t("common.back"),
|
|
2800
|
+
onClick: () => T("main"),
|
|
2801
|
+
children: /* @__PURE__ */ W(fe, {
|
|
2802
|
+
size: 20,
|
|
2803
|
+
"aria-hidden": "true"
|
|
2804
|
+
})
|
|
2805
|
+
}), n[17] = b, n[18] = w, n[19] = X) : X = n[19];
|
|
2806
|
+
let ae;
|
|
2807
|
+
n[20] !== g || n[21] !== v || n[22] !== o || n[23] !== r || n[24] !== f || n[25] !== B || n[26] !== x || n[27] !== b || n[28] !== w || n[29] !== y || n[30] !== i || n[31] !== h || n[32] !== m || n[33] !== d || n[34] !== u || n[35] !== z ? (ae = w === "main" && /* @__PURE__ */ G(U, { children: [
|
|
2808
|
+
/* @__PURE__ */ W("div", {
|
|
2809
|
+
className: "dt-bsheet-label",
|
|
2810
|
+
children: b.t("toolbar.display")
|
|
2811
|
+
}),
|
|
2812
|
+
i && /* @__PURE__ */ G("button", {
|
|
2813
|
+
type: "button",
|
|
2814
|
+
className: "dt-bsheet-row",
|
|
2815
|
+
onClick: () => T("density"),
|
|
2816
|
+
children: [
|
|
2817
|
+
b.t("display.density"),
|
|
2818
|
+
/* @__PURE__ */ W("span", {
|
|
2819
|
+
className: "dt-bsheet-value",
|
|
2820
|
+
children: b.t(`display.${r}`)
|
|
2821
|
+
}),
|
|
2822
|
+
/* @__PURE__ */ W(pe, {
|
|
2823
|
+
size: 16,
|
|
2824
|
+
"aria-hidden": "true"
|
|
2825
|
+
})
|
|
2826
|
+
]
|
|
2827
|
+
}),
|
|
2828
|
+
/* @__PURE__ */ G("button", {
|
|
2829
|
+
type: "button",
|
|
2830
|
+
className: "dt-bsheet-row",
|
|
2831
|
+
onClick: () => te(() => {
|
|
2832
|
+
k(!0), D(!0);
|
|
2833
|
+
}),
|
|
2834
|
+
children: [
|
|
2835
|
+
b.t("display.columns"),
|
|
2836
|
+
/* @__PURE__ */ W("span", {
|
|
2837
|
+
className: "dt-bsheet-value",
|
|
2838
|
+
children: b.t("columns.shownOf", o)
|
|
2839
|
+
}),
|
|
2840
|
+
/* @__PURE__ */ W(pe, {
|
|
2841
|
+
size: 16,
|
|
2842
|
+
"aria-hidden": "true"
|
|
2843
|
+
})
|
|
2844
|
+
]
|
|
2845
|
+
}),
|
|
2846
|
+
/* @__PURE__ */ G("button", {
|
|
2847
|
+
type: "button",
|
|
2848
|
+
className: "dt-bsheet-row",
|
|
2849
|
+
onClick: () => T("sort"),
|
|
2850
|
+
children: [
|
|
2851
|
+
b.t("display.sort"),
|
|
2852
|
+
/* @__PURE__ */ W("span", {
|
|
2853
|
+
className: "dt-bsheet-value",
|
|
2854
|
+
children: z
|
|
2855
|
+
}),
|
|
2856
|
+
/* @__PURE__ */ W(pe, {
|
|
2857
|
+
size: 16,
|
|
2858
|
+
"aria-hidden": "true"
|
|
2859
|
+
})
|
|
2860
|
+
]
|
|
2861
|
+
}),
|
|
2862
|
+
B && /* @__PURE__ */ W("div", { className: "dt-bsheet-sep" }),
|
|
2863
|
+
f && /* @__PURE__ */ G("button", {
|
|
2864
|
+
type: "button",
|
|
2865
|
+
className: "dt-bsheet-row",
|
|
2866
|
+
"aria-label": b.t("sheet.export"),
|
|
2867
|
+
"aria-describedby": x,
|
|
2868
|
+
onClick: () => T("export"),
|
|
2869
|
+
children: [/* @__PURE__ */ G("span", {
|
|
2870
|
+
className: "dt-item-lines",
|
|
2871
|
+
children: [b.t("sheet.export"), /* @__PURE__ */ W("span", {
|
|
2872
|
+
id: x,
|
|
2873
|
+
className: "dt-item-hint",
|
|
2874
|
+
children: f
|
|
2875
|
+
})]
|
|
2876
|
+
}), /* @__PURE__ */ W(pe, {
|
|
2877
|
+
size: 16,
|
|
2878
|
+
className: "dt-bsheet-end",
|
|
2879
|
+
"aria-hidden": "true"
|
|
2880
|
+
})]
|
|
2881
|
+
}),
|
|
2882
|
+
h && /* @__PURE__ */ W("button", {
|
|
2883
|
+
type: "button",
|
|
2884
|
+
className: "dt-bsheet-row",
|
|
2885
|
+
onClick: () => te(h),
|
|
2886
|
+
children: b.t("toolbar.print")
|
|
2887
|
+
}),
|
|
2888
|
+
m && /* @__PURE__ */ W("button", {
|
|
2889
|
+
type: "button",
|
|
2890
|
+
className: "dt-bsheet-row",
|
|
2891
|
+
onClick: () => te(m),
|
|
2892
|
+
children: b.t("toolbar.refresh")
|
|
2893
|
+
}),
|
|
2894
|
+
g && /* @__PURE__ */ G("label", {
|
|
2895
|
+
className: "dt-bsheet-row",
|
|
2896
|
+
children: [b.t("toolbar.autoRefresh"), /* @__PURE__ */ W(j, {
|
|
2897
|
+
className: "dt-bsheet-end",
|
|
2898
|
+
checked: v,
|
|
2899
|
+
onChange: y
|
|
2900
|
+
})]
|
|
2901
|
+
}),
|
|
2902
|
+
/* @__PURE__ */ G("div", {
|
|
2903
|
+
className: "dt-bsheet-note",
|
|
2904
|
+
children: [/* @__PURE__ */ W("span", { children: u ? b.t("display.savedForYou") : "" }), /* @__PURE__ */ W("button", {
|
|
2905
|
+
type: "button",
|
|
2906
|
+
className: "dt-bsheet-action",
|
|
2907
|
+
onClick: d,
|
|
2908
|
+
children: b.t("common.reset")
|
|
2909
|
+
})]
|
|
2910
|
+
})
|
|
2911
|
+
] }), n[20] = g, n[21] = v, n[22] = o, n[23] = r, n[24] = f, n[25] = B, n[26] = x, n[27] = b, n[28] = w, n[29] = y, n[30] = i, n[31] = h, n[32] = m, n[33] = d, n[34] = u, n[35] = z, n[36] = ae) : ae = n[36];
|
|
2912
|
+
let oe;
|
|
2913
|
+
n[37] !== r || n[38] !== b || n[39] !== w || n[40] !== i ? (oe = w === "density" && Kn.map((e) => /* @__PURE__ */ G("button", {
|
|
2914
|
+
type: "button",
|
|
2915
|
+
className: "dt-bsheet-row",
|
|
2916
|
+
onClick: () => {
|
|
2917
|
+
i?.(e), T("main");
|
|
2918
|
+
},
|
|
2919
|
+
children: [b.t(`display.${e}`), e === r && /* @__PURE__ */ W(me, {
|
|
2920
|
+
size: 18,
|
|
2921
|
+
className: "dt-bsheet-end dt-bsheet-check",
|
|
2922
|
+
"aria-hidden": "true"
|
|
2923
|
+
})]
|
|
2924
|
+
}, e)), n[37] = r, n[38] = b, n[39] = w, n[40] = i, n[41] = oe) : oe = n[41];
|
|
2925
|
+
let Z;
|
|
2926
|
+
n[42] !== b || n[43] !== w || n[44] !== p ? (Z = w === "export" && /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("button", {
|
|
2927
|
+
type: "button",
|
|
2928
|
+
className: "dt-bsheet-row",
|
|
2929
|
+
onClick: () => te(() => p("csv")),
|
|
2930
|
+
children: b.t("toolbar.csv")
|
|
2931
|
+
}), /* @__PURE__ */ W("button", {
|
|
2932
|
+
type: "button",
|
|
2933
|
+
className: "dt-bsheet-row",
|
|
2934
|
+
onClick: () => te(() => p("xlsx")),
|
|
2935
|
+
children: b.t("toolbar.xlsx")
|
|
2936
|
+
})] }), n[42] = b, n[43] = w, n[44] = p, n[45] = Z) : Z = n[45];
|
|
2937
|
+
let se;
|
|
2938
|
+
n[46] !== F || n[47] !== b || n[48] !== w || n[49] !== l || n[50] !== c ? (se = w === "sort" && /* @__PURE__ */ G(U, { children: [c.map((e, t) => {
|
|
2939
|
+
let n = e.dir === "asc" ? ue : le;
|
|
2940
|
+
return /* @__PURE__ */ G("div", {
|
|
2941
|
+
className: "dt-col-row dt-sort-row",
|
|
2942
|
+
children: [
|
|
2943
|
+
/* @__PURE__ */ W("span", {
|
|
2944
|
+
className: "dt-head-sort-index",
|
|
2945
|
+
children: t + 1
|
|
2946
|
+
}),
|
|
2947
|
+
/* @__PURE__ */ W("span", {
|
|
2948
|
+
className: "dt-col-name",
|
|
2949
|
+
children: F(e.column)
|
|
2950
|
+
}),
|
|
2951
|
+
/* @__PURE__ */ G("button", {
|
|
2952
|
+
type: "button",
|
|
2953
|
+
className: "dt-btn dt-btn-xs has-icon",
|
|
2954
|
+
onClick: () => l(c.map((t) => t.column === e.column ? {
|
|
2955
|
+
...t,
|
|
2956
|
+
dir: t.dir === "asc" ? "desc" : "asc"
|
|
2957
|
+
} : t)),
|
|
2958
|
+
children: [/* @__PURE__ */ W(n, {
|
|
2959
|
+
size: 12,
|
|
2960
|
+
"aria-hidden": "true"
|
|
2961
|
+
}), b.t(e.dir === "asc" ? "sr.asc" : "sr.desc")]
|
|
2962
|
+
}),
|
|
2963
|
+
/* @__PURE__ */ W("button", {
|
|
2964
|
+
type: "button",
|
|
2965
|
+
className: "dt-icon-btn-sm",
|
|
2966
|
+
"aria-label": b.t("header.clearSort"),
|
|
2967
|
+
onClick: () => l(c.filter((t) => t.column !== e.column)),
|
|
2968
|
+
children: /* @__PURE__ */ W(Oe, {
|
|
2969
|
+
size: 14,
|
|
2970
|
+
"aria-hidden": "true"
|
|
2971
|
+
})
|
|
2972
|
+
})
|
|
2973
|
+
]
|
|
2974
|
+
}, e.column);
|
|
2975
|
+
}), /* @__PURE__ */ G("div", {
|
|
2976
|
+
className: "dt-pop-foot",
|
|
2977
|
+
children: [/* @__PURE__ */ W("span", { children: b.t("sort.addHint") }), /* @__PURE__ */ W("button", {
|
|
2978
|
+
type: "button",
|
|
2979
|
+
className: "dt-pop-action",
|
|
2980
|
+
disabled: !c.length,
|
|
2981
|
+
onClick: () => l([]),
|
|
2982
|
+
children: b.t("header.clearSort")
|
|
2983
|
+
})]
|
|
2984
|
+
})] }), n[46] = F, n[47] = b, n[48] = w, n[49] = l, n[50] = c, n[51] = se) : se = n[51];
|
|
2985
|
+
let Q;
|
|
2986
|
+
n[52] !== S || n[53] !== X || n[54] !== ae || n[55] !== oe || n[56] !== Z || n[57] !== se || n[58] !== J || n[59] !== ne || n[60] !== ie ? (Q = /* @__PURE__ */ G(_, {
|
|
2987
|
+
open: S,
|
|
2988
|
+
onOpenChange: K,
|
|
2989
|
+
title: J,
|
|
2990
|
+
hideTitle: ne,
|
|
2991
|
+
className: "dt-more-sheet",
|
|
2992
|
+
trigger: ie,
|
|
2993
|
+
headStart: X,
|
|
2994
|
+
children: [
|
|
2995
|
+
ae,
|
|
2996
|
+
oe,
|
|
2997
|
+
Z,
|
|
2998
|
+
se
|
|
2999
|
+
]
|
|
3000
|
+
}), n[52] = S, n[53] = X, n[54] = ae, n[55] = oe, n[56] = Z, n[57] = se, n[58] = J, n[59] = ne, n[60] = ie, n[61] = Q) : Q = n[61];
|
|
3001
|
+
let ce;
|
|
3002
|
+
n[62] !== a || n[63] !== E || n[64] !== O || n[65] !== s ? (ce = O && /* @__PURE__ */ W(P, {
|
|
3003
|
+
fallback: null,
|
|
3004
|
+
children: /* @__PURE__ */ W(Gn, {
|
|
3005
|
+
open: E,
|
|
3006
|
+
onOpenChange: D,
|
|
3007
|
+
columns: a,
|
|
3008
|
+
onSave: s,
|
|
3009
|
+
finalFocus: A,
|
|
3010
|
+
phone: !0
|
|
3011
|
+
})
|
|
3012
|
+
}), n[62] = a, n[63] = E, n[64] = O, n[65] = s, n[66] = ce) : ce = n[66];
|
|
3013
|
+
let de;
|
|
3014
|
+
return n[67] !== Q || n[68] !== ce ? (de = /* @__PURE__ */ G(U, { children: [Q, ce] }), n[67] = Q, n[68] = ce, n[69] = de) : de = n[69], de;
|
|
3015
|
+
}
|
|
3016
|
+
// src/core/toolbar/search-box.tsx
|
|
3017
|
+
function Yn(t) {
|
|
3018
|
+
let n = M(30), { value: r, placeholder: i, onChange: a, inputRef: o, onBlur: s, phone: c } = t, { i18n: l } = e(), [u, d] = V(r), [f, p] = V(r), [m, g] = V(r);
|
|
3019
|
+
f !== r && (p(r), r !== m && d(r));
|
|
3020
|
+
let _ = h(250), v;
|
|
3021
|
+
n[0] === a ? v = n[1] : (v = (e) => {
|
|
3022
|
+
g(e), a(e);
|
|
3023
|
+
}, n[0] = a, n[1] = v);
|
|
3024
|
+
let y = v, b;
|
|
3025
|
+
n[2] !== _ || n[3] !== y ? (b = (e, t) => {
|
|
3026
|
+
let n = t !== void 0 && t;
|
|
3027
|
+
d(e), n ? (_.cancel(), y(e)) : _.run(() => y(e));
|
|
3028
|
+
}, n[2] = _, n[3] = y, n[4] = b) : b = n[4];
|
|
3029
|
+
let x = b, S = c ? 18 : 16, C;
|
|
3030
|
+
n[5] === S ? C = n[6] : (C = /* @__PURE__ */ W("span", {
|
|
3031
|
+
className: "dt-input-icon",
|
|
3032
|
+
children: /* @__PURE__ */ W(ye, {
|
|
3033
|
+
size: S,
|
|
3034
|
+
"aria-hidden": "true"
|
|
3035
|
+
})
|
|
3036
|
+
}), n[5] = S, n[6] = C);
|
|
3037
|
+
let w;
|
|
3038
|
+
n[7] === x ? w = n[8] : (w = (e) => x(e.target.value), n[7] = x, n[8] = w);
|
|
3039
|
+
let T;
|
|
3040
|
+
n[9] !== x || n[10] !== u ? (T = (e) => {
|
|
3041
|
+
e.key === "Escape" && (e.preventDefault(), u ? x("", !0) : e.currentTarget.blur());
|
|
3042
|
+
}, n[9] = x, n[10] = u, n[11] = T) : T = n[11];
|
|
3043
|
+
let E;
|
|
3044
|
+
n[12] !== u || n[13] !== o || n[14] !== i || n[15] !== w || n[16] !== T ? (E = /* @__PURE__ */ W("input", {
|
|
3045
|
+
ref: o,
|
|
3046
|
+
type: "search",
|
|
3047
|
+
value: u,
|
|
3048
|
+
placeholder: i,
|
|
3049
|
+
"aria-label": i,
|
|
3050
|
+
autoComplete: "off",
|
|
3051
|
+
onChange: w,
|
|
3052
|
+
onKeyDown: T
|
|
3053
|
+
}), n[12] = u, n[13] = o, n[14] = i, n[15] = w, n[16] = T, n[17] = E) : E = n[17];
|
|
3054
|
+
let D;
|
|
3055
|
+
n[18] !== x || n[19] !== u || n[20] !== l || n[21] !== c ? (D = u ? /* @__PURE__ */ W("button", {
|
|
3056
|
+
type: "button",
|
|
3057
|
+
className: "dt-input-clear",
|
|
3058
|
+
"aria-label": l.t("common.clear"),
|
|
3059
|
+
onClick: () => x("", !0),
|
|
3060
|
+
children: c ? /* @__PURE__ */ W(De, {
|
|
3061
|
+
size: 20,
|
|
3062
|
+
weight: "fill",
|
|
3063
|
+
"aria-hidden": "true"
|
|
3064
|
+
}) : /* @__PURE__ */ W(Oe, {
|
|
3065
|
+
size: 14,
|
|
3066
|
+
"aria-hidden": "true"
|
|
3067
|
+
})
|
|
3068
|
+
}) : !c && /* @__PURE__ */ W("kbd", {
|
|
3069
|
+
className: "dt-kbd",
|
|
3070
|
+
"aria-hidden": "true",
|
|
3071
|
+
children: "/"
|
|
3072
|
+
}), n[18] = x, n[19] = u, n[20] = l, n[21] = c, n[22] = D) : D = n[22];
|
|
3073
|
+
let O;
|
|
3074
|
+
n[23] === D ? O = n[24] : (O = /* @__PURE__ */ W("span", {
|
|
3075
|
+
className: "dt-input-end",
|
|
3076
|
+
children: D
|
|
3077
|
+
}), n[23] = D, n[24] = O);
|
|
3078
|
+
let k;
|
|
3079
|
+
return n[25] !== s || n[26] !== C || n[27] !== E || n[28] !== O ? (k = /* @__PURE__ */ G("label", {
|
|
3080
|
+
className: "dt-input dt-search has-icon",
|
|
3081
|
+
onBlur: s,
|
|
3082
|
+
children: [
|
|
3083
|
+
C,
|
|
3084
|
+
E,
|
|
3085
|
+
O
|
|
3086
|
+
]
|
|
3087
|
+
}), n[25] = s, n[26] = C, n[27] = E, n[28] = O, n[29] = k) : k = n[29], k;
|
|
3088
|
+
}
|
|
3089
|
+
// src/core/toolbar/toolbar.tsx
|
|
3090
|
+
function Xn(t) {
|
|
3091
|
+
let n = M(42), { size: r, view: i, search: a, searchPlaceholder: o, onSearch: s, filter: c, display: l, more: u, end: d, ref: f } = t, { i18n: p } = e(), [m, h] = V(!1), g = ee(null), _ = r === "phone", v = r !== "full" && !m && !a, y = _ && !v, b;
|
|
3092
|
+
n[0] === Symbol.for("react.memo_cache_sentinel") ? (b = () => {
|
|
3093
|
+
h(!0), requestAnimationFrame(() => g.current?.focus());
|
|
3094
|
+
}, n[0] = b) : b = n[0];
|
|
3095
|
+
let x = b, S;
|
|
3096
|
+
if (n[1] === v ? S = n[2] : (S = () => ({ focusSearch: () => v ? x() : g.current?.focus() }), n[1] = v, n[2] = S), z(f, S), y) {
|
|
3097
|
+
let e = a ?? "", t;
|
|
3098
|
+
n[3] !== s || n[4] !== o || n[5] !== e ? (t = /* @__PURE__ */ W(Yn, {
|
|
3099
|
+
value: e,
|
|
3100
|
+
placeholder: o,
|
|
3101
|
+
onChange: s,
|
|
3102
|
+
inputRef: g,
|
|
3103
|
+
phone: !0
|
|
3104
|
+
}), n[3] = s, n[4] = o, n[5] = e, n[6] = t) : t = n[6];
|
|
3105
|
+
let r;
|
|
3106
|
+
n[7] === s ? r = n[8] : (r = () => {
|
|
3107
|
+
h(!1), s("");
|
|
3108
|
+
}, n[7] = s, n[8] = r);
|
|
3109
|
+
let i;
|
|
3110
|
+
n[9] === p ? i = n[10] : (i = p.t("common.cancel"), n[9] = p, n[10] = i);
|
|
3111
|
+
let c;
|
|
3112
|
+
n[11] !== r || n[12] !== i ? (c = /* @__PURE__ */ W("button", {
|
|
3113
|
+
type: "button",
|
|
3114
|
+
className: "dt-btn dt-btn-ghost dt-search-cancel",
|
|
3115
|
+
onClick: r,
|
|
3116
|
+
children: i
|
|
3117
|
+
}), n[11] = r, n[12] = i, n[13] = c) : c = n[13];
|
|
3118
|
+
let l;
|
|
3119
|
+
return n[14] !== t || n[15] !== c ? (l = /* @__PURE__ */ G("div", {
|
|
3120
|
+
className: "dt-toolbar is-phone",
|
|
3121
|
+
role: "toolbar",
|
|
3122
|
+
children: [t, c]
|
|
3123
|
+
}), n[14] = t, n[15] = c, n[16] = l) : l = n[16], l;
|
|
3124
|
+
}
|
|
3125
|
+
let C = `dt-toolbar is-${r} is-zoned`, w;
|
|
3126
|
+
n[17] === i ? w = n[18] : (w = /* @__PURE__ */ W("div", {
|
|
3127
|
+
className: "dt-toolbar-side is-start",
|
|
3128
|
+
children: i
|
|
3129
|
+
}), n[17] = i, n[18] = w);
|
|
3130
|
+
let T;
|
|
3131
|
+
n[19] !== v || n[20] !== s || n[21] !== _ || n[22] !== a || n[23] !== o ? (T = a !== null && (v ? /* @__PURE__ */ W("button", {
|
|
3132
|
+
type: "button",
|
|
3133
|
+
className: "dt-btn dt-btn-icon dt-search-open",
|
|
3134
|
+
"aria-label": o,
|
|
3135
|
+
"data-dt-tip": o,
|
|
3136
|
+
onClick: x,
|
|
3137
|
+
children: /* @__PURE__ */ W(ye, {
|
|
3138
|
+
size: _ ? 20 : 16,
|
|
3139
|
+
"aria-hidden": "true"
|
|
3140
|
+
})
|
|
3141
|
+
}) : /* @__PURE__ */ W(Yn, {
|
|
3142
|
+
value: a,
|
|
3143
|
+
placeholder: o,
|
|
3144
|
+
onChange: s,
|
|
3145
|
+
inputRef: g,
|
|
3146
|
+
onBlur: () => h(!1)
|
|
3147
|
+
})), n[19] = v, n[20] = s, n[21] = _, n[22] = a, n[23] = o, n[24] = T) : T = n[24];
|
|
3148
|
+
let E;
|
|
3149
|
+
n[25] !== c || n[26] !== T ? (E = /* @__PURE__ */ G("div", {
|
|
3150
|
+
className: "dt-btn-group",
|
|
3151
|
+
children: [T, c]
|
|
3152
|
+
}), n[25] = c, n[26] = T, n[27] = E) : E = n[27];
|
|
3153
|
+
let D;
|
|
3154
|
+
n[28] === Symbol.for("react.memo_cache_sentinel") ? (D = /* @__PURE__ */ W("span", { className: "dt-toolbar-spacer" }), n[28] = D) : D = n[28];
|
|
3155
|
+
let O;
|
|
3156
|
+
n[29] !== l || n[30] !== u ? (O = /* @__PURE__ */ G("div", {
|
|
3157
|
+
className: "dt-btn-group",
|
|
3158
|
+
children: [l, u]
|
|
3159
|
+
}), n[29] = l, n[30] = u, n[31] = O) : O = n[31];
|
|
3160
|
+
let k;
|
|
3161
|
+
n[32] === d ? k = n[33] : (k = d && /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("span", {
|
|
3162
|
+
className: "dt-toolbar-sep",
|
|
3163
|
+
"aria-hidden": "true"
|
|
3164
|
+
}), /* @__PURE__ */ W("span", {
|
|
3165
|
+
className: "dt-toolbar-end",
|
|
3166
|
+
children: d
|
|
3167
|
+
})] }), n[32] = d, n[33] = k);
|
|
3168
|
+
let A;
|
|
3169
|
+
n[34] !== O || n[35] !== k ? (A = /* @__PURE__ */ G("div", {
|
|
3170
|
+
className: "dt-toolbar-side is-end",
|
|
3171
|
+
children: [O, k]
|
|
3172
|
+
}), n[34] = O, n[35] = k, n[36] = A) : A = n[36];
|
|
3173
|
+
let j;
|
|
3174
|
+
return n[37] !== A || n[38] !== C || n[39] !== w || n[40] !== E ? (j = /* @__PURE__ */ G("div", {
|
|
3175
|
+
className: C,
|
|
3176
|
+
role: "toolbar",
|
|
3177
|
+
children: [
|
|
3178
|
+
w,
|
|
3179
|
+
E,
|
|
3180
|
+
D,
|
|
3181
|
+
A
|
|
3182
|
+
]
|
|
3183
|
+
}), n[37] = A, n[38] = C, n[39] = w, n[40] = E, n[41] = j) : j = n[41], j;
|
|
3184
|
+
}
|
|
3185
|
+
// src/core/ui/confirm-dialog.tsx
|
|
3186
|
+
function Zn(t) {
|
|
3187
|
+
let n = M(29), { open: r, onOpenChange: i, title: a, body: o, confirmLabel: s, danger: c, onConfirm: l } = t, { i18n: u } = e(), d = ee(null), f;
|
|
3188
|
+
n[0] === i ? f = n[1] : (f = (e) => i(e), n[0] = i, n[1] = f);
|
|
3189
|
+
let p;
|
|
3190
|
+
n[2] === Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ W(Fe.Backdrop, { className: "dt-scrim" }), n[2] = p) : p = n[2];
|
|
3191
|
+
let m;
|
|
3192
|
+
n[3] === a ? m = n[4] : (m = /* @__PURE__ */ W(Fe.Title, {
|
|
3193
|
+
className: "dt-dialog-title",
|
|
3194
|
+
children: a
|
|
3195
|
+
}), n[3] = a, n[4] = m);
|
|
3196
|
+
let h;
|
|
3197
|
+
n[5] === o ? h = n[6] : (h = o && /* @__PURE__ */ W(Fe.Description, {
|
|
3198
|
+
className: "dt-dialog-body",
|
|
3199
|
+
children: o
|
|
3200
|
+
}), n[5] = o, n[6] = h);
|
|
3201
|
+
let g;
|
|
3202
|
+
n[7] === u ? g = n[8] : (g = u.t("common.cancel"), n[7] = u, n[8] = g);
|
|
3203
|
+
let _;
|
|
3204
|
+
n[9] === g ? _ = n[10] : (_ = /* @__PURE__ */ W(Fe.Close, {
|
|
3205
|
+
ref: d,
|
|
3206
|
+
className: "dt-btn",
|
|
3207
|
+
children: g
|
|
3208
|
+
}), n[9] = g, n[10] = _);
|
|
3209
|
+
let v = c ? "dt-btn dt-btn-danger" : "dt-btn dt-btn-primary", y;
|
|
3210
|
+
n[11] !== l || n[12] !== i ? (y = () => {
|
|
3211
|
+
l(), i(!1);
|
|
3212
|
+
}, n[11] = l, n[12] = i, n[13] = y) : y = n[13];
|
|
3213
|
+
let b;
|
|
3214
|
+
n[14] !== s || n[15] !== v || n[16] !== y ? (b = /* @__PURE__ */ W("button", {
|
|
3215
|
+
type: "button",
|
|
3216
|
+
className: v,
|
|
3217
|
+
onClick: y,
|
|
3218
|
+
children: s
|
|
3219
|
+
}), n[14] = s, n[15] = v, n[16] = y, n[17] = b) : b = n[17];
|
|
3220
|
+
let x;
|
|
3221
|
+
n[18] !== _ || n[19] !== b ? (x = /* @__PURE__ */ G("div", {
|
|
3222
|
+
className: "dt-dialog-actions",
|
|
3223
|
+
children: [_, b]
|
|
3224
|
+
}), n[18] = _, n[19] = b, n[20] = x) : x = n[20];
|
|
3225
|
+
let S;
|
|
3226
|
+
n[21] !== x || n[22] !== m || n[23] !== h ? (S = /* @__PURE__ */ G(Fe.Portal, { children: [p, /* @__PURE__ */ G(Fe.Popup, {
|
|
3227
|
+
className: "dt-dialog dt-dialog-confirm",
|
|
3228
|
+
initialFocus: d,
|
|
3229
|
+
children: [
|
|
3230
|
+
m,
|
|
3231
|
+
h,
|
|
3232
|
+
x
|
|
3233
|
+
]
|
|
3234
|
+
})] }), n[21] = x, n[22] = m, n[23] = h, n[24] = S) : S = n[24];
|
|
3235
|
+
let C;
|
|
3236
|
+
return n[25] !== r || n[26] !== f || n[27] !== S ? (C = /* @__PURE__ */ W(Fe.Root, {
|
|
3237
|
+
open: r,
|
|
3238
|
+
onOpenChange: f,
|
|
3239
|
+
children: S
|
|
3240
|
+
}), n[25] = r, n[26] = f, n[27] = S, n[28] = C) : C = n[28], C;
|
|
3241
|
+
}
|
|
3242
|
+
// src/core/views/view-dialog.tsx
|
|
3243
|
+
function Qn(t) {
|
|
3244
|
+
let n = M(64), { open: r, onOpenChange: i, mode: a, name: o, summary: s, validate: c, onSave: l } = t, { i18n: u } = e(), [d, f] = V(o), [p, m] = V(!1), [h, g] = V(null), _ = ee(null), v;
|
|
3245
|
+
n[0] === i ? v = n[1] : (v = (e) => i(e), n[0] = i, n[1] = v);
|
|
3246
|
+
let y;
|
|
3247
|
+
n[2] === Symbol.for("react.memo_cache_sentinel") ? (y = /* @__PURE__ */ W(Pe.Backdrop, { className: "dt-scrim" }), n[2] = y) : y = n[2];
|
|
3248
|
+
let b;
|
|
3249
|
+
n[3] === Symbol.for("react.memo_cache_sentinel") ? (b = () => (_.current?.select(), _.current), n[3] = b) : b = n[3];
|
|
3250
|
+
let x;
|
|
3251
|
+
n[4] !== p || n[5] !== d || n[6] !== i || n[7] !== l || n[8] !== c ? (x = (e) => {
|
|
3252
|
+
e.preventDefault();
|
|
3253
|
+
let t = c(d);
|
|
3254
|
+
g(t), t || (l({
|
|
3255
|
+
name: d.trim(),
|
|
3256
|
+
makeDefault: p
|
|
3257
|
+
}), i(!1));
|
|
3258
|
+
}, n[4] = p, n[5] = d, n[6] = i, n[7] = l, n[8] = c, n[9] = x) : x = n[9];
|
|
3259
|
+
let S;
|
|
3260
|
+
n[10] !== u || n[11] !== a ? (S = u.t(a === "rename" ? "views.rename" : "views.dialogTitle"), n[10] = u, n[11] = a, n[12] = S) : S = n[12];
|
|
3261
|
+
let C;
|
|
3262
|
+
n[13] === S ? C = n[14] : (C = /* @__PURE__ */ W(Pe.Title, {
|
|
3263
|
+
className: "dt-dialog-title",
|
|
3264
|
+
children: S
|
|
3265
|
+
}), n[13] = S, n[14] = C);
|
|
3266
|
+
let w;
|
|
3267
|
+
n[15] !== u || n[16] !== a ? (w = a === "create" && /* @__PURE__ */ W(Pe.Description, {
|
|
3268
|
+
className: "dt-dialog-body",
|
|
3269
|
+
children: u.t("views.dialogBody")
|
|
3270
|
+
}), n[15] = u, n[16] = a, n[17] = w) : w = n[17];
|
|
3271
|
+
let T;
|
|
3272
|
+
n[18] === u ? T = n[19] : (T = u.t("views.name"), n[18] = u, n[19] = T);
|
|
3273
|
+
let E;
|
|
3274
|
+
n[20] === T ? E = n[21] : (E = /* @__PURE__ */ W("span", {
|
|
3275
|
+
className: "dt-field-label",
|
|
3276
|
+
children: T
|
|
3277
|
+
}), n[20] = T, n[21] = E);
|
|
3278
|
+
let D = h ? !0 : void 0, O;
|
|
3279
|
+
n[22] === Symbol.for("react.memo_cache_sentinel") ? (O = (e) => f(e.target.value), n[22] = O) : O = n[22];
|
|
3280
|
+
let k;
|
|
3281
|
+
n[23] !== d || n[24] !== D ? (k = /* @__PURE__ */ W("span", {
|
|
3282
|
+
className: "dt-input",
|
|
3283
|
+
children: /* @__PURE__ */ W("input", {
|
|
3284
|
+
ref: _,
|
|
3285
|
+
value: d,
|
|
3286
|
+
type: "text",
|
|
3287
|
+
"aria-invalid": D,
|
|
3288
|
+
onChange: O
|
|
3289
|
+
})
|
|
3290
|
+
}), n[23] = d, n[24] = D, n[25] = k) : k = n[25];
|
|
3291
|
+
let A;
|
|
3292
|
+
n[26] !== h || n[27] !== u ? (A = h && /* @__PURE__ */ W("span", {
|
|
3293
|
+
className: "dt-field-error",
|
|
3294
|
+
role: "alert",
|
|
3295
|
+
children: u.t(`views.err.${h}`)
|
|
3296
|
+
}), n[26] = h, n[27] = u, n[28] = A) : A = n[28];
|
|
3297
|
+
let j;
|
|
3298
|
+
n[29] !== k || n[30] !== A || n[31] !== E ? (j = /* @__PURE__ */ G("label", {
|
|
3299
|
+
className: "dt-field",
|
|
3300
|
+
children: [
|
|
3301
|
+
E,
|
|
3302
|
+
k,
|
|
3303
|
+
A
|
|
3304
|
+
]
|
|
3305
|
+
}), n[29] = k, n[30] = A, n[31] = E, n[32] = j) : j = n[32];
|
|
3306
|
+
let N;
|
|
3307
|
+
n[33] !== u || n[34] !== s ? (N = s && /* @__PURE__ */ G("div", {
|
|
3308
|
+
className: "dt-view-summary",
|
|
3309
|
+
children: [
|
|
3310
|
+
/* @__PURE__ */ W("span", { children: u.t("views.filters") }),
|
|
3311
|
+
/* @__PURE__ */ W("span", { children: s.filters }),
|
|
3312
|
+
/* @__PURE__ */ W("span", { children: u.t("views.sort") }),
|
|
3313
|
+
/* @__PURE__ */ W("span", { children: s.sort }),
|
|
3314
|
+
/* @__PURE__ */ W("span", { children: u.t("views.columns") }),
|
|
3315
|
+
/* @__PURE__ */ W("span", { children: s.columns })
|
|
3316
|
+
]
|
|
3317
|
+
}), n[33] = u, n[34] = s, n[35] = N) : N = n[35];
|
|
3318
|
+
let P;
|
|
3319
|
+
n[36] !== u || n[37] !== p || n[38] !== a ? (P = a === "create" && /* @__PURE__ */ G("label", {
|
|
3320
|
+
className: "dt-check-row",
|
|
3321
|
+
children: [/* @__PURE__ */ W("input", {
|
|
3322
|
+
type: "checkbox",
|
|
3323
|
+
className: "dt-checkbox",
|
|
3324
|
+
checked: p,
|
|
3325
|
+
onChange: (e) => m(e.target.checked)
|
|
3326
|
+
}), u.t("views.makeDefault")]
|
|
3327
|
+
}), n[36] = u, n[37] = p, n[38] = a, n[39] = P) : P = n[39];
|
|
3328
|
+
let F;
|
|
3329
|
+
n[40] === u ? F = n[41] : (F = u.t("common.cancel"), n[40] = u, n[41] = F);
|
|
3330
|
+
let I;
|
|
3331
|
+
n[42] === F ? I = n[43] : (I = /* @__PURE__ */ W(Pe.Close, {
|
|
3332
|
+
className: "dt-btn",
|
|
3333
|
+
children: F
|
|
3334
|
+
}), n[42] = F, n[43] = I);
|
|
3335
|
+
let L;
|
|
3336
|
+
n[44] !== u || n[45] !== a ? (L = u.t(a === "rename" ? "common.save" : "views.save"), n[44] = u, n[45] = a, n[46] = L) : L = n[46];
|
|
3337
|
+
let R;
|
|
3338
|
+
n[47] === L ? R = n[48] : (R = /* @__PURE__ */ W("button", {
|
|
3339
|
+
type: "submit",
|
|
3340
|
+
className: "dt-btn dt-btn-primary",
|
|
3341
|
+
children: L
|
|
3342
|
+
}), n[47] = L, n[48] = R);
|
|
3343
|
+
let z;
|
|
3344
|
+
n[49] !== I || n[50] !== R ? (z = /* @__PURE__ */ G("div", {
|
|
3345
|
+
className: "dt-dialog-actions",
|
|
3346
|
+
children: [I, R]
|
|
3347
|
+
}), n[49] = I, n[50] = R, n[51] = z) : z = n[51];
|
|
3348
|
+
let B;
|
|
3349
|
+
n[52] !== j || n[53] !== N || n[54] !== P || n[55] !== z || n[56] !== x || n[57] !== C || n[58] !== w ? (B = /* @__PURE__ */ G(Pe.Portal, { children: [y, /* @__PURE__ */ W(Pe.Popup, {
|
|
3350
|
+
className: "dt-dialog dt-view-dialog",
|
|
3351
|
+
initialFocus: b,
|
|
3352
|
+
children: /* @__PURE__ */ G("form", {
|
|
3353
|
+
onSubmit: x,
|
|
3354
|
+
children: [
|
|
3355
|
+
C,
|
|
3356
|
+
w,
|
|
3357
|
+
j,
|
|
3358
|
+
N,
|
|
3359
|
+
P,
|
|
3360
|
+
z
|
|
3361
|
+
]
|
|
3362
|
+
})
|
|
3363
|
+
})] }), n[52] = j, n[53] = N, n[54] = P, n[55] = z, n[56] = x, n[57] = C, n[58] = w, n[59] = B) : B = n[59];
|
|
3364
|
+
let H;
|
|
3365
|
+
return n[60] !== r || n[61] !== v || n[62] !== B ? (H = /* @__PURE__ */ W(Pe.Root, {
|
|
3366
|
+
open: r,
|
|
3367
|
+
onOpenChange: v,
|
|
3368
|
+
children: B
|
|
3369
|
+
}), n[60] = r, n[61] = v, n[62] = B, n[63] = H) : H = n[63], H;
|
|
3370
|
+
}
|
|
3371
|
+
// src/core/views/view-menu.tsx
|
|
3372
|
+
var $n = 8;
|
|
3373
|
+
function er(t) {
|
|
3374
|
+
let n = M(113), { sections: r, active: i, edited: a, hasDraft: o, defaultId: s, canSave: c, canWrite: l, open: u, onOpenChange: d, onSelect: f, onSaveChanges: p, onSaveAs: m, onDiscard: h, onRename: g, onDuplicate: v, onSetDefault: y, onDelete: b, sheet: x } = t, { i18n: S } = e(), [C, w] = V(""), [T, E] = V(null), D = T ?? i?.id ?? null, O;
|
|
3375
|
+
n[0] === Symbol.for("react.memo_cache_sentinel") ? (O = (e) => E(e ?? ""), n[0] = O) : O = n[0];
|
|
3376
|
+
let k = O, A = R(), j, N, P, F, I, L, z, B, ee, H, K, q, te, J, ne, Y;
|
|
3377
|
+
if (n[1] !== i?.id || n[2] !== i?.name || n[3] !== c || n[4] !== s || n[5] !== a || n[6] !== o || n[7] !== D || n[8] !== S || n[9] !== A || n[10] !== T || n[11] !== b || n[12] !== v || n[13] !== d || n[14] !== g || n[15] !== f || n[16] !== y || n[17] !== C || n[18] !== r || n[19] !== x) {
|
|
3378
|
+
let e = i?.name ?? S.t("views.title"), t = C.toLocaleLowerCase();
|
|
3379
|
+
P = [["system", "views.system"], ["personal", "views.mine"]].map((e) => {
|
|
3380
|
+
let [n, i] = e;
|
|
3381
|
+
return {
|
|
3382
|
+
key: n,
|
|
3383
|
+
title: i,
|
|
3384
|
+
views: r[n].filter((e) => !C || e.name.toLocaleLowerCase().includes(t))
|
|
3385
|
+
};
|
|
3386
|
+
}).filter(nr);
|
|
3387
|
+
let l = (e) => e.id !== i?.id && o(e.id), u = r.system.length + r.personal.length >= $n, p = (e) => c && e.kind !== "system", m = P.flatMap(tr), h;
|
|
3388
|
+
n[36] === d ? h = n[37] : (h = (e) => {
|
|
3389
|
+
d(e), w(""), E(null);
|
|
3390
|
+
}, n[36] = d, n[37] = h), F = h;
|
|
3391
|
+
let _;
|
|
3392
|
+
n[38] !== f || n[39] !== F ? (_ = (e) => {
|
|
3393
|
+
F(!1), f(e);
|
|
3394
|
+
}, n[38] = f, n[39] = F, n[40] = _) : _ = n[40];
|
|
3395
|
+
let O = _, M;
|
|
3396
|
+
n[41] === A ? M = n[42] : (M = (e) => `${A}-${e}`, n[41] = A, n[42] = M);
|
|
3397
|
+
let R = M, V;
|
|
3398
|
+
n[43] === A ? V = n[44] : (V = (e) => {
|
|
3399
|
+
let t = e.relatedTarget;
|
|
3400
|
+
(!t || t.id !== `${A}-q` && !document.getElementById(A)?.contains(t)) && k(null);
|
|
3401
|
+
}, n[43] = A, n[44] = V);
|
|
3402
|
+
let re = V, ie;
|
|
3403
|
+
n[45] === F ? ie = n[46] : (ie = (e) => {
|
|
3404
|
+
F(!1), setTimeout(e, 0);
|
|
3405
|
+
}, n[45] = F, n[46] = ie), j = ie, Y = S.t(a ? "sr.viewEdited" : "sr.view", { name: e });
|
|
3406
|
+
let X;
|
|
3407
|
+
n[47] === Symbol.for("react.memo_cache_sentinel") ? (X = /* @__PURE__ */ W("span", {
|
|
3408
|
+
className: "dt-view-icon",
|
|
3409
|
+
"aria-hidden": "true",
|
|
3410
|
+
children: /* @__PURE__ */ W(we, { size: 16 })
|
|
3411
|
+
}), n[47] = X) : X = n[47];
|
|
3412
|
+
let ae;
|
|
3413
|
+
n[48] === e ? ae = n[49] : (ae = /* @__PURE__ */ W("span", {
|
|
3414
|
+
className: "dt-view-name",
|
|
3415
|
+
children: e
|
|
3416
|
+
}), n[48] = e, n[49] = ae);
|
|
3417
|
+
let oe;
|
|
3418
|
+
n[50] !== a || n[51] !== S ? (oe = a && /* @__PURE__ */ G(U, { children: [
|
|
3419
|
+
" ",
|
|
3420
|
+
/* @__PURE__ */ W("span", {
|
|
3421
|
+
className: "dt-view-dot",
|
|
3422
|
+
"aria-hidden": "true"
|
|
3423
|
+
}),
|
|
3424
|
+
/* @__PURE__ */ W("span", {
|
|
3425
|
+
className: "dt-view-edited",
|
|
3426
|
+
children: S.t("views.edited")
|
|
3427
|
+
})
|
|
3428
|
+
] }), n[50] = a, n[51] = S, n[52] = oe) : oe = n[52];
|
|
3429
|
+
let Z;
|
|
3430
|
+
n[53] === Symbol.for("react.memo_cache_sentinel") ? (Z = /* @__PURE__ */ W(de, {
|
|
3431
|
+
size: 14,
|
|
3432
|
+
"aria-hidden": "true"
|
|
3433
|
+
}), n[53] = Z) : Z = n[53];
|
|
3434
|
+
let se;
|
|
3435
|
+
n[54] !== ae || n[55] !== oe ? (se = /* @__PURE__ */ G(U, { children: [
|
|
3436
|
+
X,
|
|
3437
|
+
ae,
|
|
3438
|
+
oe,
|
|
3439
|
+
Z
|
|
3440
|
+
] }), n[54] = ae, n[55] = oe, n[56] = se) : se = n[56], ne = se;
|
|
3441
|
+
let Q;
|
|
3442
|
+
n[57] !== A || n[58] !== u ? (Q = () => document.getElementById(u ? `${A}-q` : A), n[57] = A, n[58] = u, n[59] = Q) : Q = n[59], N = Q;
|
|
3443
|
+
let ce = (e) => {
|
|
3444
|
+
let t = m.findIndex((e) => e.id === D), n = {
|
|
3445
|
+
ArrowDown: 1,
|
|
3446
|
+
ArrowUp: -1
|
|
3447
|
+
}[e.key];
|
|
3448
|
+
if (n) {
|
|
3449
|
+
e.preventDefault();
|
|
3450
|
+
let r = m[Math.min(m.length - 1, Math.max(0, t < 0 ? 0 : t + n))];
|
|
3451
|
+
r && k(r.id);
|
|
3452
|
+
} else e.key === "Home" || e.key === "End" ? (e.preventDefault(), k((e.key === "Home" ? m[0] : m.at(-1))?.id ?? null)) : e.key === "Enter" && t >= 0 && e.target === e.currentTarget && (e.preventDefault(), O(m[t].id));
|
|
3453
|
+
}, le = D && m.some((e) => e.id === D) ? R(D) : void 0;
|
|
3454
|
+
L = u && /* @__PURE__ */ G("label", {
|
|
3455
|
+
className: "dt-input has-icon dt-picker-search",
|
|
3456
|
+
children: [/* @__PURE__ */ W("span", {
|
|
3457
|
+
className: "dt-input-icon",
|
|
3458
|
+
children: /* @__PURE__ */ W(ye, {
|
|
3459
|
+
size: 14,
|
|
3460
|
+
"aria-hidden": "true"
|
|
3461
|
+
})
|
|
3462
|
+
}), /* @__PURE__ */ W("input", {
|
|
3463
|
+
id: `${A}-q`,
|
|
3464
|
+
type: "text",
|
|
3465
|
+
role: "combobox",
|
|
3466
|
+
"aria-expanded": "true",
|
|
3467
|
+
"aria-haspopup": "grid",
|
|
3468
|
+
"aria-controls": A,
|
|
3469
|
+
"aria-activedescendant": le,
|
|
3470
|
+
autoComplete: "off",
|
|
3471
|
+
value: C,
|
|
3472
|
+
placeholder: S.t("views.find"),
|
|
3473
|
+
"aria-label": S.t("views.find"),
|
|
3474
|
+
onBlur: re,
|
|
3475
|
+
onChange: (e) => {
|
|
3476
|
+
let t = e.target.value;
|
|
3477
|
+
w(t);
|
|
3478
|
+
let n = r.system.concat(r.personal).find((e) => e.name.toLocaleLowerCase().includes(t.toLocaleLowerCase()));
|
|
3479
|
+
k(n?.id ?? null);
|
|
3480
|
+
},
|
|
3481
|
+
onKeyDown: ce
|
|
3482
|
+
})]
|
|
3483
|
+
}), z = A, B = P.length ? "grid" : void 0, ee = "dt-views-list", H = P.length ? S.t("views.title") : void 0, K = u ? void 0 : 0, q = u ? void 0 : le, te = u ? void 0 : ce, J = re, I = P.map((e) => /* @__PURE__ */ G("div", {
|
|
3484
|
+
role: "rowgroup",
|
|
3485
|
+
"aria-labelledby": `${A}-${e.key}`,
|
|
3486
|
+
children: [/* @__PURE__ */ W("div", {
|
|
3487
|
+
id: `${A}-${e.key}`,
|
|
3488
|
+
className: "dt-pop-label",
|
|
3489
|
+
"aria-hidden": "true",
|
|
3490
|
+
children: S.t(e.title)
|
|
3491
|
+
}), e.views.map((e) => /* @__PURE__ */ G("div", {
|
|
3492
|
+
role: "row",
|
|
3493
|
+
className: e.id === i?.id ? "dt-view-row is-active" : "dt-view-row",
|
|
3494
|
+
children: [/* @__PURE__ */ G("div", {
|
|
3495
|
+
id: R(e.id),
|
|
3496
|
+
role: "gridcell",
|
|
3497
|
+
"aria-selected": e.id === i?.id,
|
|
3498
|
+
className: "dt-view-item",
|
|
3499
|
+
"data-highlighted": T && e.id === D ? "" : void 0,
|
|
3500
|
+
onPointerEnter: () => k(e.id),
|
|
3501
|
+
onClick: () => O(e.id),
|
|
3502
|
+
children: [
|
|
3503
|
+
/* @__PURE__ */ W("span", {
|
|
3504
|
+
className: "dt-view-check",
|
|
3505
|
+
"aria-hidden": "true",
|
|
3506
|
+
children: e.id === i?.id && /* @__PURE__ */ W(me, { size: x ? 18 : 14 })
|
|
3507
|
+
}),
|
|
3508
|
+
/* @__PURE__ */ W("span", {
|
|
3509
|
+
className: "dt-view-row-name",
|
|
3510
|
+
children: e.name
|
|
3511
|
+
}),
|
|
3512
|
+
l(e) && /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("span", {
|
|
3513
|
+
className: "dt-view-dot",
|
|
3514
|
+
"aria-hidden": "true"
|
|
3515
|
+
}), /* @__PURE__ */ W("span", {
|
|
3516
|
+
className: "dt-view-edited",
|
|
3517
|
+
children: S.t("views.edited")
|
|
3518
|
+
})] }),
|
|
3519
|
+
e.id === s && /* @__PURE__ */ W("span", {
|
|
3520
|
+
className: "dt-view-default",
|
|
3521
|
+
children: S.t("views.default")
|
|
3522
|
+
})
|
|
3523
|
+
]
|
|
3524
|
+
}), /* @__PURE__ */ W("div", {
|
|
3525
|
+
role: "gridcell",
|
|
3526
|
+
className: "dt-view-more-cell",
|
|
3527
|
+
children: /* @__PURE__ */ G(Kt, {
|
|
3528
|
+
side: "right",
|
|
3529
|
+
align: "start",
|
|
3530
|
+
className: "dt-view-row-menu",
|
|
3531
|
+
trigger: /* @__PURE__ */ W("button", {
|
|
3532
|
+
type: "button",
|
|
3533
|
+
className: "dt-icon-btn-sm dt-view-more",
|
|
3534
|
+
"aria-label": S.t("common.more"),
|
|
3535
|
+
children: /* @__PURE__ */ W(ge, {
|
|
3536
|
+
size: 16,
|
|
3537
|
+
weight: "bold",
|
|
3538
|
+
"aria-hidden": "true"
|
|
3539
|
+
})
|
|
3540
|
+
}),
|
|
3541
|
+
children: [
|
|
3542
|
+
p(e) && /* @__PURE__ */ W(qt, {
|
|
3543
|
+
onSelect: () => j(() => g(e)),
|
|
3544
|
+
children: S.t("views.rename")
|
|
3545
|
+
}),
|
|
3546
|
+
c && /* @__PURE__ */ W(qt, {
|
|
3547
|
+
onSelect: () => j(() => v(e)),
|
|
3548
|
+
children: S.t("views.duplicate")
|
|
3549
|
+
}),
|
|
3550
|
+
e.id === s ? /* @__PURE__ */ W(qt, {
|
|
3551
|
+
destructive: !0,
|
|
3552
|
+
onSelect: () => y(null),
|
|
3553
|
+
children: S.t("views.removeDefault")
|
|
3554
|
+
}) : /* @__PURE__ */ W(qt, {
|
|
3555
|
+
onSelect: () => y(e.id),
|
|
3556
|
+
children: S.t("views.setDefault")
|
|
3557
|
+
}),
|
|
3558
|
+
p(e) && /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(Jt, {}), /* @__PURE__ */ W(qt, {
|
|
3559
|
+
destructive: !0,
|
|
3560
|
+
onSelect: () => j(() => b(e)),
|
|
3561
|
+
children: S.t("views.delete")
|
|
3562
|
+
})] }),
|
|
3563
|
+
e.kind === "system" && /* @__PURE__ */ W("div", {
|
|
3564
|
+
className: "dt-view-note",
|
|
3565
|
+
children: S.t("views.systemNote")
|
|
3566
|
+
})
|
|
3567
|
+
]
|
|
3568
|
+
})
|
|
3569
|
+
})]
|
|
3570
|
+
}, e.id))]
|
|
3571
|
+
}, e.key)), n[1] = i?.id, n[2] = i?.name, n[3] = c, n[4] = s, n[5] = a, n[6] = o, n[7] = D, n[8] = S, n[9] = A, n[10] = T, n[11] = b, n[12] = v, n[13] = d, n[14] = g, n[15] = f, n[16] = y, n[17] = C, n[18] = r, n[19] = x, n[20] = j, n[21] = N, n[22] = P, n[23] = F, n[24] = I, n[25] = L, n[26] = z, n[27] = B, n[28] = ee, n[29] = H, n[30] = K, n[31] = q, n[32] = te, n[33] = J, n[34] = ne, n[35] = Y;
|
|
3572
|
+
} else j = n[20], N = n[21], P = n[22], F = n[23], I = n[24], L = n[25], z = n[26], B = n[27], ee = n[28], H = n[29], K = n[30], q = n[31], te = n[32], J = n[33], ne = n[34], Y = n[35];
|
|
3573
|
+
let re;
|
|
3574
|
+
n[60] !== P.length || n[61] !== S ? (re = P.length === 0 && /* @__PURE__ */ W("div", {
|
|
3575
|
+
className: "dt-options-empty",
|
|
3576
|
+
children: S.t("views.noMatch")
|
|
3577
|
+
}), n[60] = P.length, n[61] = S, n[62] = re) : re = n[62];
|
|
3578
|
+
let ie;
|
|
3579
|
+
n[63] !== I || n[64] !== re || n[65] !== z || n[66] !== B || n[67] !== ee || n[68] !== H || n[69] !== K || n[70] !== q || n[71] !== te || n[72] !== J ? (ie = /* @__PURE__ */ G("div", {
|
|
3580
|
+
id: z,
|
|
3581
|
+
role: B,
|
|
3582
|
+
className: ee,
|
|
3583
|
+
"aria-label": H,
|
|
3584
|
+
tabIndex: K,
|
|
3585
|
+
"aria-activedescendant": q,
|
|
3586
|
+
onKeyDown: te,
|
|
3587
|
+
onBlur: J,
|
|
3588
|
+
children: [I, re]
|
|
3589
|
+
}), n[63] = I, n[64] = re, n[65] = z, n[66] = B, n[67] = ee, n[68] = H, n[69] = K, n[70] = q, n[71] = te, n[72] = J, n[73] = ie) : ie = n[73];
|
|
3590
|
+
let X;
|
|
3591
|
+
n[74] !== i || n[75] !== j || n[76] !== c || n[77] !== l || n[78] !== a || n[79] !== S || n[80] !== h || n[81] !== m || n[82] !== p ? (X = a && i ? /* @__PURE__ */ G("div", {
|
|
3592
|
+
className: "dt-views-foot",
|
|
3593
|
+
children: [/* @__PURE__ */ G("p", {
|
|
3594
|
+
className: "dt-views-unsaved",
|
|
3595
|
+
children: [/* @__PURE__ */ W("span", {
|
|
3596
|
+
className: "dt-view-dot",
|
|
3597
|
+
"aria-hidden": "true"
|
|
3598
|
+
}), S.t("views.unsaved")]
|
|
3599
|
+
}), /* @__PURE__ */ G("div", {
|
|
3600
|
+
className: "dt-views-foot-actions",
|
|
3601
|
+
children: [/* @__PURE__ */ W("button", {
|
|
3602
|
+
type: "button",
|
|
3603
|
+
className: "dt-btn dt-btn-ghost dt-views-revert",
|
|
3604
|
+
onClick: () => j(h),
|
|
3605
|
+
children: S.t("views.discard")
|
|
3606
|
+
}), l ? /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("button", {
|
|
3607
|
+
type: "button",
|
|
3608
|
+
className: "dt-btn dt-btn-sm",
|
|
3609
|
+
onClick: () => j(m),
|
|
3610
|
+
children: S.t("views.saveAsNew")
|
|
3611
|
+
}), /* @__PURE__ */ G("button", {
|
|
3612
|
+
type: "button",
|
|
3613
|
+
className: "dt-btn dt-btn-sm dt-btn-primary",
|
|
3614
|
+
onClick: () => j(p),
|
|
3615
|
+
children: [S.t("views.saveChanges"), /* @__PURE__ */ W("kbd", {
|
|
3616
|
+
className: "dt-kbd",
|
|
3617
|
+
"aria-hidden": "true",
|
|
3618
|
+
children: sn
|
|
3619
|
+
})]
|
|
3620
|
+
})] }) : c && /* @__PURE__ */ W("button", {
|
|
3621
|
+
type: "button",
|
|
3622
|
+
className: "dt-btn dt-btn-sm dt-btn-primary",
|
|
3623
|
+
onClick: () => j(m),
|
|
3624
|
+
children: S.t("views.saveAsMine")
|
|
3625
|
+
})]
|
|
3626
|
+
})]
|
|
3627
|
+
}) : c && /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("div", { className: "dt-pop-sep" }), /* @__PURE__ */ G("button", {
|
|
3628
|
+
type: "button",
|
|
3629
|
+
className: "dt-pop-item dt-view-new",
|
|
3630
|
+
onClick: () => j(m),
|
|
3631
|
+
children: [/* @__PURE__ */ W(xe, {
|
|
3632
|
+
size: 14,
|
|
3633
|
+
"aria-hidden": "true"
|
|
3634
|
+
}), S.t("views.new")]
|
|
3635
|
+
})] }), n[74] = i, n[75] = j, n[76] = c, n[77] = l, n[78] = a, n[79] = S, n[80] = h, n[81] = m, n[82] = p, n[83] = X) : X = n[83];
|
|
3636
|
+
let ae;
|
|
3637
|
+
n[84] !== L || n[85] !== ie || n[86] !== X ? (ae = /* @__PURE__ */ G(U, { children: [
|
|
3638
|
+
L,
|
|
3639
|
+
ie,
|
|
3640
|
+
X
|
|
3641
|
+
] }), n[84] = L, n[85] = ie, n[86] = X, n[87] = ae) : ae = n[87];
|
|
3642
|
+
let oe = ae;
|
|
3643
|
+
if (x) {
|
|
3644
|
+
let e;
|
|
3645
|
+
n[88] === S ? e = n[89] : (e = S.t("views.title"), n[88] = S, n[89] = e);
|
|
3646
|
+
let t;
|
|
3647
|
+
n[90] !== ne || n[91] !== Y ? (t = /* @__PURE__ */ W("button", {
|
|
3648
|
+
type: "button",
|
|
3649
|
+
className: "dt-btn dt-btn-ghost has-icon dt-view-trigger",
|
|
3650
|
+
"aria-label": Y,
|
|
3651
|
+
children: ne
|
|
3652
|
+
}), n[90] = ne, n[91] = Y, n[92] = t) : t = n[92];
|
|
3653
|
+
let r;
|
|
3654
|
+
return n[93] !== oe || n[94] !== N || n[95] !== u || n[96] !== F || n[97] !== e || n[98] !== t ? (r = /* @__PURE__ */ W(_, {
|
|
3655
|
+
open: u,
|
|
3656
|
+
onOpenChange: F,
|
|
3657
|
+
title: e,
|
|
3658
|
+
hideTitle: !0,
|
|
3659
|
+
className: "dt-views",
|
|
3660
|
+
initialFocus: N,
|
|
3661
|
+
trigger: t,
|
|
3662
|
+
children: oe
|
|
3663
|
+
}), n[93] = oe, n[94] = N, n[95] = u, n[96] = F, n[97] = e, n[98] = t, n[99] = r) : r = n[99], r;
|
|
3664
|
+
}
|
|
3665
|
+
let Z;
|
|
3666
|
+
n[100] === F ? Z = n[101] : (Z = (e) => F(e), n[100] = F, n[101] = Z);
|
|
3667
|
+
let se;
|
|
3668
|
+
n[102] !== ne || n[103] !== Y ? (se = /* @__PURE__ */ W($.Trigger, {
|
|
3669
|
+
className: "dt-btn dt-btn-ghost has-icon dt-view-trigger",
|
|
3670
|
+
"aria-label": Y,
|
|
3671
|
+
children: ne
|
|
3672
|
+
}), n[102] = ne, n[103] = Y, n[104] = se) : se = n[104];
|
|
3673
|
+
let Q;
|
|
3674
|
+
n[105] !== oe || n[106] !== N ? (Q = /* @__PURE__ */ W($.Portal, { children: /* @__PURE__ */ W($.Positioner, {
|
|
3675
|
+
className: "dt-positioner",
|
|
3676
|
+
align: "start",
|
|
3677
|
+
sideOffset: 4,
|
|
3678
|
+
children: /* @__PURE__ */ W($.Popup, {
|
|
3679
|
+
className: "dt-pop dt-views",
|
|
3680
|
+
initialFocus: N,
|
|
3681
|
+
children: oe
|
|
3682
|
+
})
|
|
3683
|
+
}) }), n[105] = oe, n[106] = N, n[107] = Q) : Q = n[107];
|
|
3684
|
+
let ce;
|
|
3685
|
+
return n[108] !== u || n[109] !== Z || n[110] !== se || n[111] !== Q ? (ce = /* @__PURE__ */ G($.Root, {
|
|
3686
|
+
open: u,
|
|
3687
|
+
onOpenChange: Z,
|
|
3688
|
+
children: [se, Q]
|
|
3689
|
+
}), n[108] = u, n[109] = Z, n[110] = se, n[111] = Q, n[112] = ce) : ce = n[112], ce;
|
|
3690
|
+
}
|
|
3691
|
+
function tr(e) {
|
|
3692
|
+
return e.views;
|
|
3693
|
+
}
|
|
3694
|
+
function nr(e) {
|
|
3695
|
+
return e.views.length;
|
|
3696
|
+
}
|
|
3697
|
+
// src/list/bulk-bar.tsx
|
|
3698
|
+
function rr(t) {
|
|
3699
|
+
let n = M(51), { rows: r, actions: i, variant: a, onClear: o, phone: s, children: c } = t, { i18n: l } = e(), [u, d] = V(!1), f, p, m, h, g, v, y, b;
|
|
3700
|
+
if (n[0] !== i || n[1] !== c || n[2] !== l || n[3] !== u || n[4] !== o || n[5] !== s || n[6] !== r || n[7] !== a) {
|
|
3701
|
+
let e;
|
|
3702
|
+
n[16] === r ? e = n[17] : (e = (e) => !e.when || e.when(r), n[16] = r, n[17] = e);
|
|
3703
|
+
let t = i.filter(e), x = t.filter(sr).slice(0, s ? 2 : 3), S = t.filter((e) => !x.includes(e)), C = [...S.filter(or), ...S.filter(ar)], w = C.findIndex(ir), T;
|
|
3704
|
+
n[18] === r ? T = n[19] : (T = (e) => e.disabled?.(r) ?? !1, n[18] = r, n[19] = T);
|
|
3705
|
+
let E = T, D;
|
|
3706
|
+
n[20] === E ? D = n[21] : (D = (e) => {
|
|
3707
|
+
let t = E(e);
|
|
3708
|
+
return typeof t == "string" ? t : e.description;
|
|
3709
|
+
}, n[20] = E, n[21] = D);
|
|
3710
|
+
let O = D, k;
|
|
3711
|
+
n[22] !== E || n[23] !== r ? (k = (e) => {
|
|
3712
|
+
d(!1), E(e) || e.run(r);
|
|
3713
|
+
}, n[22] = E, n[23] = r, n[24] = k) : k = n[24];
|
|
3714
|
+
let A = k, j = a === "toolbar" ? "dt-btn has-icon" : "dt-bulk-btn", M;
|
|
3715
|
+
n[25] !== l || n[26] !== o ? (M = (e) => /* @__PURE__ */ W("button", {
|
|
3716
|
+
type: "button",
|
|
3717
|
+
className: e,
|
|
3718
|
+
"aria-label": l.t("selection.clear"),
|
|
3719
|
+
"data-dt-tip": l.t("selection.clear"),
|
|
3720
|
+
onClick: o,
|
|
3721
|
+
children: /* @__PURE__ */ W(Oe, {
|
|
3722
|
+
size: 16,
|
|
3723
|
+
"aria-hidden": "true"
|
|
3724
|
+
})
|
|
3725
|
+
}), n[25] = l, n[26] = o, n[27] = M) : M = n[27], f = M, p = s ? `dt-bulk is-${a} is-phone` : `dt-bulk is-${a}`, m = "toolbar", n[28] === l ? h = n[29] : (h = l.t("bulk.aria"), n[28] = l, n[29] = h), n[30] !== f || n[31] !== a ? (g = a === "toolbar" && f("dt-btn dt-btn-icon"), n[30] = f, n[31] = a, n[32] = g) : g = n[32];
|
|
3726
|
+
let P;
|
|
3727
|
+
n[33] !== l || n[34] !== r.length ? (P = l.t("selection.selected", { count: r.length }), n[33] = l, n[34] = r.length, n[35] = P) : P = n[35], n[36] === P ? v = n[37] : (v = /* @__PURE__ */ W("span", {
|
|
3728
|
+
className: "dt-bulk-count",
|
|
3729
|
+
role: "status",
|
|
3730
|
+
children: P
|
|
3731
|
+
}), n[36] = P, n[37] = v), n[38] === Symbol.for("react.memo_cache_sentinel") ? (y = /* @__PURE__ */ W("span", {
|
|
3732
|
+
className: "dt-bulk-sep",
|
|
3733
|
+
"aria-hidden": "true"
|
|
3734
|
+
}), n[38] = y) : y = n[38], b = c ?? /* @__PURE__ */ G(U, { children: [
|
|
3735
|
+
x.map((e) => {
|
|
3736
|
+
let t = e.icon;
|
|
3737
|
+
return /* @__PURE__ */ G("button", {
|
|
3738
|
+
type: "button",
|
|
3739
|
+
className: e.destructive ? `${j} is-destructive` : j,
|
|
3740
|
+
disabled: !!E(e),
|
|
3741
|
+
"data-dt-tip": O(e),
|
|
3742
|
+
onClick: () => A(e),
|
|
3743
|
+
children: [t && /* @__PURE__ */ W(t, {
|
|
3744
|
+
size: s ? 18 : 16,
|
|
3745
|
+
"aria-hidden": "true"
|
|
3746
|
+
}), /* @__PURE__ */ W("span", { children: e.label })]
|
|
3747
|
+
}, e.id);
|
|
3748
|
+
}),
|
|
3749
|
+
C.length > 0 && s && /* @__PURE__ */ G(_, {
|
|
3750
|
+
open: u,
|
|
3751
|
+
onOpenChange: d,
|
|
3752
|
+
title: l.t("bulk.moreAria"),
|
|
3753
|
+
hideTitle: !0,
|
|
3754
|
+
trigger: /* @__PURE__ */ G("button", {
|
|
3755
|
+
type: "button",
|
|
3756
|
+
className: "dt-bulk-btn dt-bulk-more",
|
|
3757
|
+
"aria-label": l.t("bulk.moreAria"),
|
|
3758
|
+
children: [/* @__PURE__ */ W(ge, {
|
|
3759
|
+
size: 18,
|
|
3760
|
+
weight: "bold",
|
|
3761
|
+
"aria-hidden": "true"
|
|
3762
|
+
}), /* @__PURE__ */ W("span", { children: l.t("common.more") })]
|
|
3763
|
+
}),
|
|
3764
|
+
children: [/* @__PURE__ */ W("div", {
|
|
3765
|
+
className: "dt-bsheet-label",
|
|
3766
|
+
children: l.t("selection.selected", { count: r.length })
|
|
3767
|
+
}), C.map((e, t) => {
|
|
3768
|
+
let n = O(e);
|
|
3769
|
+
return /* @__PURE__ */ G(N, { children: [t > 0 && t === w && /* @__PURE__ */ W("div", { className: "dt-bsheet-sep" }), /* @__PURE__ */ G("button", {
|
|
3770
|
+
type: "button",
|
|
3771
|
+
className: e.destructive ? "dt-bsheet-row is-destructive" : "dt-bsheet-row",
|
|
3772
|
+
disabled: !!E(e),
|
|
3773
|
+
onClick: () => A(e),
|
|
3774
|
+
children: [e.icon && /* @__PURE__ */ W(e.icon, {
|
|
3775
|
+
size: 18,
|
|
3776
|
+
"aria-hidden": "true"
|
|
3777
|
+
}), /* @__PURE__ */ G("span", {
|
|
3778
|
+
className: "dt-menu-text",
|
|
3779
|
+
children: [/* @__PURE__ */ W("span", { children: e.label }), n && /* @__PURE__ */ W("span", {
|
|
3780
|
+
className: "dt-menu-sub",
|
|
3781
|
+
children: n
|
|
3782
|
+
})]
|
|
3783
|
+
})]
|
|
3784
|
+
})] }, e.id);
|
|
3785
|
+
})]
|
|
3786
|
+
}),
|
|
3787
|
+
C.length > 0 && !s && /* @__PURE__ */ W(Kt, {
|
|
3788
|
+
className: "dt-bulk-menu",
|
|
3789
|
+
align: "start",
|
|
3790
|
+
side: a === "floating" ? "top" : void 0,
|
|
3791
|
+
offset: a === "floating" ? 12 : 4,
|
|
3792
|
+
trigger: /* @__PURE__ */ W("button", {
|
|
3793
|
+
type: "button",
|
|
3794
|
+
className: a === "toolbar" ? `${j} dt-bulk-more dt-btn-icon` : `${j} dt-bulk-more`,
|
|
3795
|
+
"aria-label": l.t("bulk.moreAria"),
|
|
3796
|
+
children: /* @__PURE__ */ W(ge, {
|
|
3797
|
+
size: 16,
|
|
3798
|
+
weight: "bold",
|
|
3799
|
+
"aria-hidden": "true"
|
|
3800
|
+
})
|
|
3801
|
+
}),
|
|
3802
|
+
children: C.map((e, t) => {
|
|
3803
|
+
let n = O(e);
|
|
3804
|
+
return /* @__PURE__ */ G(N, { children: [t > 0 && t === w && /* @__PURE__ */ W(Jt, {}), /* @__PURE__ */ G(qt, {
|
|
3805
|
+
destructive: e.destructive,
|
|
3806
|
+
twoLine: !!n,
|
|
3807
|
+
disabled: !!E(e),
|
|
3808
|
+
onSelect: () => A(e),
|
|
3809
|
+
children: [e.icon && /* @__PURE__ */ W(e.icon, {
|
|
3810
|
+
size: 16,
|
|
3811
|
+
"aria-hidden": "true"
|
|
3812
|
+
}), /* @__PURE__ */ G("span", {
|
|
3813
|
+
className: "dt-menu-text",
|
|
3814
|
+
children: [/* @__PURE__ */ W("span", { children: e.label }), n && /* @__PURE__ */ W("span", {
|
|
3815
|
+
className: "dt-menu-sub",
|
|
3816
|
+
children: n
|
|
3817
|
+
})]
|
|
3818
|
+
})]
|
|
3819
|
+
})] }, e.id);
|
|
3820
|
+
})
|
|
3821
|
+
})
|
|
3822
|
+
] }), n[0] = i, n[1] = c, n[2] = l, n[3] = u, n[4] = o, n[5] = s, n[6] = r, n[7] = a, n[8] = f, n[9] = p, n[10] = m, n[11] = h, n[12] = g, n[13] = v, n[14] = y, n[15] = b;
|
|
3823
|
+
} else f = n[8], p = n[9], m = n[10], h = n[11], g = n[12], v = n[13], y = n[14], b = n[15];
|
|
3824
|
+
let x;
|
|
3825
|
+
n[39] !== f || n[40] !== a ? (x = a === "floating" && /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("span", {
|
|
3826
|
+
className: "dt-bulk-sep",
|
|
3827
|
+
"aria-hidden": "true"
|
|
3828
|
+
}), f("dt-bulk-btn dt-bulk-icon")] }), n[39] = f, n[40] = a, n[41] = x) : x = n[41];
|
|
3829
|
+
let S;
|
|
3830
|
+
return n[42] !== p || n[43] !== m || n[44] !== h || n[45] !== g || n[46] !== v || n[47] !== y || n[48] !== b || n[49] !== x ? (S = /* @__PURE__ */ G("div", {
|
|
3831
|
+
className: p,
|
|
3832
|
+
role: m,
|
|
3833
|
+
"aria-label": h,
|
|
3834
|
+
children: [
|
|
3835
|
+
g,
|
|
3836
|
+
v,
|
|
3837
|
+
y,
|
|
3838
|
+
b,
|
|
3839
|
+
x
|
|
3840
|
+
]
|
|
3841
|
+
}), n[42] = p, n[43] = m, n[44] = h, n[45] = g, n[46] = v, n[47] = y, n[48] = b, n[49] = x, n[50] = S) : S = n[50], S;
|
|
3842
|
+
}
|
|
3843
|
+
function ir(e) {
|
|
3844
|
+
return e.destructive;
|
|
3845
|
+
}
|
|
3846
|
+
function ar(e) {
|
|
3847
|
+
return e.destructive;
|
|
3848
|
+
}
|
|
3849
|
+
function or(e) {
|
|
3850
|
+
return !e.destructive;
|
|
3851
|
+
}
|
|
3852
|
+
function sr(e) {
|
|
3853
|
+
return e.inBar;
|
|
3854
|
+
}
|
|
3855
|
+
// src/list/footer.tsx
|
|
3856
|
+
function cr(e) {
|
|
3857
|
+
let t = M(3), [n, r] = V(lr), i, a;
|
|
3858
|
+
return t[0] === e ? (i = t[1], a = t[2]) : (i = () => {
|
|
3859
|
+
let t = setInterval(() => r(Date.now()), e);
|
|
3860
|
+
return () => clearInterval(t);
|
|
3861
|
+
}, a = [e], t[0] = e, t[1] = i, t[2] = a), I(i, a), n;
|
|
3862
|
+
}
|
|
3863
|
+
function lr() {
|
|
3864
|
+
return Date.now();
|
|
3865
|
+
}
|
|
3866
|
+
function ur(t) {
|
|
3867
|
+
let n = M(86), r = cr(3e4), { i18n: i, locale: a } = e(), s, c, l, u, d, f;
|
|
3868
|
+
if (n[0] !== i || n[1] !== a || n[2] !== r || n[3] !== t.countable || n[4] !== t.countedAt || n[5] !== t.counting || n[6] !== t.empty || n[7] !== t.firstLoad || n[8] !== t.hasMore || n[9] !== t.onCount || n[10] !== t.page.number || n[11] !== t.page.size || n[12] !== t.rowCount || n[13] !== t.total || n[14] !== t.updatedAt) {
|
|
3869
|
+
let e = o(a), p = (t.page.number - 1) * t.page.size + 1, m = p + t.rowCount - 1, h = !t.hasMore, g = t.page.number === 1 && h, _;
|
|
3870
|
+
n[21] === a ? _ = n[22] : (_ = (e) => e.toLocaleTimeString(a, {
|
|
3871
|
+
hour: "2-digit",
|
|
3872
|
+
minute: "2-digit"
|
|
3873
|
+
}), n[21] = a, n[22] = _);
|
|
3874
|
+
let v = _;
|
|
3875
|
+
f = t.updatedAt ? r - t.updatedAt.getTime() < 6e4 ? i.t("toolbar.updatedJustNow") : i.t("toolbar.updatedAgo", { time: e.relative(t.updatedAt, new Date(r), "short") }) : "", l = "dt-footer", u = "navigation", n[23] === i ? d = n[24] : (d = i.t("page.nav"), n[23] = i, n[24] = d), s = "dt-footer-left", c = t.firstLoad ? /* @__PURE__ */ W("span", {
|
|
3876
|
+
className: "dt-footer-muted",
|
|
3877
|
+
children: i.t("common.loading")
|
|
3878
|
+
}) : t.rowCount === 0 ? /* @__PURE__ */ W("span", {
|
|
3879
|
+
className: "dt-footer-rows",
|
|
3880
|
+
children: i.t(t.empty ? "page.none" : "page.zero")
|
|
3881
|
+
}) : /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("span", {
|
|
3882
|
+
className: "dt-footer-rows",
|
|
3883
|
+
children: i.t("page.rows", {
|
|
3884
|
+
from: e.int(p),
|
|
3885
|
+
to: e.int(m)
|
|
3886
|
+
})
|
|
3887
|
+
}), t.total !== void 0 && !g ? /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("span", {
|
|
3888
|
+
className: "dt-footer-of",
|
|
3889
|
+
children: i.t("page.of", { total: e.int(t.total) })
|
|
3890
|
+
}), t.countedAt && /* @__PURE__ */ G("span", {
|
|
3891
|
+
className: "dt-footer-muted",
|
|
3892
|
+
children: ["· ", i.t("page.counted", { time: v(t.countedAt) })]
|
|
3893
|
+
})] }) : t.counting ? /* @__PURE__ */ G("span", {
|
|
3894
|
+
className: "dt-footer-muted",
|
|
3895
|
+
children: [
|
|
3896
|
+
i.t("page.of", { total: "" }),
|
|
3897
|
+
/* @__PURE__ */ W(he, {
|
|
3898
|
+
size: 12,
|
|
3899
|
+
className: "dt-spin",
|
|
3900
|
+
"aria-hidden": "true"
|
|
3901
|
+
}),
|
|
3902
|
+
i.t("page.counting")
|
|
3903
|
+
]
|
|
3904
|
+
}) : h && !g ? /* @__PURE__ */ G("span", {
|
|
3905
|
+
className: "dt-footer-muted",
|
|
3906
|
+
children: ["· ", i.t("page.end")]
|
|
3907
|
+
}) : t.countable && !g ? /* @__PURE__ */ G("button", {
|
|
3908
|
+
type: "button",
|
|
3909
|
+
className: "dt-btn dt-btn-ghost dt-btn-xs dt-footer-count",
|
|
3910
|
+
onClick: t.onCount,
|
|
3911
|
+
children: ["· ", i.t("page.countTotal")]
|
|
3912
|
+
}) : null] }), n[0] = i, n[1] = a, n[2] = r, n[3] = t.countable, n[4] = t.countedAt, n[5] = t.counting, n[6] = t.empty, n[7] = t.firstLoad, n[8] = t.hasMore, n[9] = t.onCount, n[10] = t.page.number, n[11] = t.page.size, n[12] = t.rowCount, n[13] = t.total, n[14] = t.updatedAt, n[15] = s, n[16] = c, n[17] = l, n[18] = u, n[19] = d, n[20] = f;
|
|
3913
|
+
} else s = n[15], c = n[16], l = n[17], u = n[18], d = n[19], f = n[20];
|
|
3914
|
+
let p;
|
|
3915
|
+
n[25] !== i || n[26] !== t.freshness || n[27] !== t.onRefresh || n[28] !== t.phone || n[29] !== t.updatedAt || n[30] !== f ? (p = !t.phone && (t.updatedAt || t.freshness !== "normal") && /* @__PURE__ */ G(U, { children: [
|
|
3916
|
+
/* @__PURE__ */ W("span", {
|
|
3917
|
+
className: "dt-footer-vsep",
|
|
3918
|
+
"aria-hidden": "true"
|
|
3919
|
+
}),
|
|
3920
|
+
t.freshness === "live" ? /* @__PURE__ */ G("span", {
|
|
3921
|
+
className: "dt-footer-live",
|
|
3922
|
+
children: [/* @__PURE__ */ W("span", {
|
|
3923
|
+
className: "dt-live-dot",
|
|
3924
|
+
"aria-hidden": "true"
|
|
3925
|
+
}), i.t("toolbar.live")]
|
|
3926
|
+
}) : t.freshness === "refreshing" ? /* @__PURE__ */ W("span", {
|
|
3927
|
+
className: "dt-footer-muted",
|
|
3928
|
+
role: "status",
|
|
3929
|
+
children: i.t("state.updating")
|
|
3930
|
+
}) : t.updatedAt && /* @__PURE__ */ W("span", {
|
|
3931
|
+
className: t.freshness === "stale" ? "dt-footer-updated is-stale" : "dt-footer-updated",
|
|
3932
|
+
children: f
|
|
3933
|
+
}),
|
|
3934
|
+
t.onRefresh && /* @__PURE__ */ W("button", {
|
|
3935
|
+
type: "button",
|
|
3936
|
+
className: "dt-icon-btn-sm",
|
|
3937
|
+
"aria-label": i.t("toolbar.refresh"),
|
|
3938
|
+
"data-dt-tip": `${i.t("toolbar.refresh")} · R`,
|
|
3939
|
+
onClick: t.onRefresh,
|
|
3940
|
+
children: /* @__PURE__ */ W(ce, {
|
|
3941
|
+
size: 14,
|
|
3942
|
+
className: t.freshness === "refreshing" ? "dt-spin" : void 0,
|
|
3943
|
+
"aria-hidden": "true"
|
|
3944
|
+
})
|
|
3945
|
+
})
|
|
3946
|
+
] }), n[25] = i, n[26] = t.freshness, n[27] = t.onRefresh, n[28] = t.phone, n[29] = t.updatedAt, n[30] = f, n[31] = p) : p = n[31];
|
|
3947
|
+
let m;
|
|
3948
|
+
n[32] !== s || n[33] !== c || n[34] !== p ? (m = /* @__PURE__ */ G("div", {
|
|
3949
|
+
className: s,
|
|
3950
|
+
children: [c, p]
|
|
3951
|
+
}), n[32] = s, n[33] = c, n[34] = p, n[35] = m) : m = n[35];
|
|
3952
|
+
let h;
|
|
3953
|
+
n[36] !== i || n[37] !== t ? (h = !t.phone && /* @__PURE__ */ G("label", {
|
|
3954
|
+
className: "dt-footer-size",
|
|
3955
|
+
children: [/* @__PURE__ */ W("span", {
|
|
3956
|
+
className: "dt-footer-size-label",
|
|
3957
|
+
children: i.t("page.perPage")
|
|
3958
|
+
}), /* @__PURE__ */ G("span", {
|
|
3959
|
+
className: "dt-select",
|
|
3960
|
+
children: [/* @__PURE__ */ W("select", {
|
|
3961
|
+
value: t.page.size,
|
|
3962
|
+
disabled: t.busy,
|
|
3963
|
+
onChange: (e) => t.onPageSize(Number(e.target.value)),
|
|
3964
|
+
children: t.pageSizes.map(dr)
|
|
3965
|
+
}), /* @__PURE__ */ W(de, {
|
|
3966
|
+
size: 12,
|
|
3967
|
+
"aria-hidden": "true"
|
|
3968
|
+
})]
|
|
3969
|
+
})]
|
|
3970
|
+
}), n[36] = i, n[37] = t, n[38] = h) : h = n[38];
|
|
3971
|
+
let g;
|
|
3972
|
+
n[39] === t.phone ? g = n[40] : (g = !t.phone && /* @__PURE__ */ W("span", {
|
|
3973
|
+
className: "dt-footer-vsep",
|
|
3974
|
+
"aria-hidden": "true"
|
|
3975
|
+
}), n[39] = t.phone, n[40] = g);
|
|
3976
|
+
let _;
|
|
3977
|
+
n[41] !== i || n[42] !== t.phone ? (_ = t.phone ? i.t("page.previous") : void 0, n[41] = i, n[42] = t.phone, n[43] = _) : _ = n[43];
|
|
3978
|
+
let v = t.page.number <= 1 || t.busy, y;
|
|
3979
|
+
n[44] === t ? y = n[45] : (y = () => t.onPage(t.page.number - 1), n[44] = t, n[45] = y);
|
|
3980
|
+
let b = t.phone ? 18 : 14, x;
|
|
3981
|
+
n[46] === b ? x = n[47] : (x = /* @__PURE__ */ W(fe, {
|
|
3982
|
+
size: b,
|
|
3983
|
+
"aria-hidden": "true"
|
|
3984
|
+
}), n[46] = b, n[47] = x);
|
|
3985
|
+
let S;
|
|
3986
|
+
n[48] === i ? S = n[49] : (S = i.t("page.previous"), n[48] = i, n[49] = S);
|
|
3987
|
+
let C;
|
|
3988
|
+
n[50] === S ? C = n[51] : (C = /* @__PURE__ */ W("span", { children: S }), n[50] = S, n[51] = C);
|
|
3989
|
+
let w;
|
|
3990
|
+
n[52] !== v || n[53] !== y || n[54] !== x || n[55] !== C || n[56] !== _ ? (w = /* @__PURE__ */ G("button", {
|
|
3991
|
+
type: "button",
|
|
3992
|
+
className: "dt-btn dt-btn-sm has-icon dt-footer-prev",
|
|
3993
|
+
"aria-label": _,
|
|
3994
|
+
disabled: v,
|
|
3995
|
+
onClick: y,
|
|
3996
|
+
children: [x, C]
|
|
3997
|
+
}), n[52] = v, n[53] = y, n[54] = x, n[55] = C, n[56] = _, n[57] = w) : w = n[57];
|
|
3998
|
+
let T;
|
|
3999
|
+
n[58] !== i || n[59] !== t.phone ? (T = t.phone ? i.t("page.next") : void 0, n[58] = i, n[59] = t.phone, n[60] = T) : T = n[60];
|
|
4000
|
+
let E = !t.hasMore || t.busy, D;
|
|
4001
|
+
n[61] === t ? D = n[62] : (D = () => t.onPage(t.page.number + 1), n[61] = t, n[62] = D);
|
|
4002
|
+
let O;
|
|
4003
|
+
n[63] === i ? O = n[64] : (O = i.t("page.next"), n[63] = i, n[64] = O);
|
|
4004
|
+
let k;
|
|
4005
|
+
n[65] === O ? k = n[66] : (k = /* @__PURE__ */ W("span", { children: O }), n[65] = O, n[66] = k);
|
|
4006
|
+
let A = t.phone ? 18 : 14, j;
|
|
4007
|
+
n[67] === A ? j = n[68] : (j = /* @__PURE__ */ W(pe, {
|
|
4008
|
+
size: A,
|
|
4009
|
+
"aria-hidden": "true"
|
|
4010
|
+
}), n[67] = A, n[68] = j);
|
|
4011
|
+
let N;
|
|
4012
|
+
n[69] !== T || n[70] !== E || n[71] !== D || n[72] !== k || n[73] !== j ? (N = /* @__PURE__ */ G("button", {
|
|
4013
|
+
type: "button",
|
|
4014
|
+
className: "dt-btn dt-btn-sm dt-footer-next",
|
|
4015
|
+
"aria-label": T,
|
|
4016
|
+
disabled: E,
|
|
4017
|
+
onClick: D,
|
|
4018
|
+
children: [k, j]
|
|
4019
|
+
}), n[69] = T, n[70] = E, n[71] = D, n[72] = k, n[73] = j, n[74] = N) : N = n[74];
|
|
4020
|
+
let P;
|
|
4021
|
+
n[75] !== w || n[76] !== N || n[77] !== h || n[78] !== g ? (P = /* @__PURE__ */ G("div", {
|
|
4022
|
+
className: "dt-footer-right",
|
|
4023
|
+
children: [
|
|
4024
|
+
h,
|
|
4025
|
+
g,
|
|
4026
|
+
w,
|
|
4027
|
+
N
|
|
4028
|
+
]
|
|
4029
|
+
}), n[75] = w, n[76] = N, n[77] = h, n[78] = g, n[79] = P) : P = n[79];
|
|
4030
|
+
let F;
|
|
4031
|
+
return n[80] !== l || n[81] !== P || n[82] !== u || n[83] !== d || n[84] !== m ? (F = /* @__PURE__ */ G("div", {
|
|
4032
|
+
className: l,
|
|
4033
|
+
role: u,
|
|
4034
|
+
"aria-label": d,
|
|
4035
|
+
children: [m, P]
|
|
4036
|
+
}), n[80] = l, n[81] = P, n[82] = u, n[83] = d, n[84] = m, n[85] = F) : F = n[85], F;
|
|
4037
|
+
}
|
|
4038
|
+
function dr(e) {
|
|
4039
|
+
return /* @__PURE__ */ W("option", {
|
|
4040
|
+
value: e,
|
|
4041
|
+
children: e
|
|
4042
|
+
}, e);
|
|
4043
|
+
}
|
|
4044
|
+
// src/list/use-chips.ts
|
|
4045
|
+
function fr(e) {
|
|
4046
|
+
let t = M(38), { defs: n, filters: r, setFilters: i } = e, [a, o] = V(null), [s, c] = V(null), l;
|
|
4047
|
+
if (t[0] !== n || t[1] !== a || t[2] !== r) {
|
|
4048
|
+
let e;
|
|
4049
|
+
t[4] === n ? e = t[5] : (e = (e) => n.has(e.column), t[4] = n, t[5] = e), l = r.filter(e), a && !l.some((e) => e.column === a.chip.column) && l.splice(Math.min(a.at, l.length), 0, a.chip), t[0] = n, t[1] = a, t[2] = r, t[3] = l;
|
|
4050
|
+
} else l = t[3];
|
|
4051
|
+
let u;
|
|
4052
|
+
t[6] === r ? u = t[7] : (u = (e) => r.some((t) => t.column === e), t[6] = r, t[7] = u);
|
|
4053
|
+
let d = u, f;
|
|
4054
|
+
t[8] === a ? f = t[9] : (f = (e) => {
|
|
4055
|
+
c(e), a && a.chip.column !== e && o(null);
|
|
4056
|
+
}, t[8] = a, t[9] = f);
|
|
4057
|
+
let p = f, m;
|
|
4058
|
+
t[10] !== l || t[11] !== n || t[12] !== r || t[13] !== d || t[14] !== i ? (m = (e) => {
|
|
4059
|
+
let t = l.findIndex((t) => t.column === e.column), a = r.filter((t) => t.column !== e.column);
|
|
4060
|
+
if (w(e, n.get(e.column).type)) {
|
|
4061
|
+
let n = l.slice(0, t).filter((e) => d(e.column)).length;
|
|
4062
|
+
a.splice(n, 0, C(e)), i(a), o(null);
|
|
4063
|
+
} else o({
|
|
4064
|
+
chip: e,
|
|
4065
|
+
at: t
|
|
4066
|
+
}), d(e.column) && i(a);
|
|
4067
|
+
}, t[10] = l, t[11] = n, t[12] = r, t[13] = d, t[14] = i, t[15] = m) : m = t[15];
|
|
4068
|
+
let h = m, g;
|
|
4069
|
+
t[16] !== a?.chip || t[17] !== s || t[18] !== r || t[19] !== d || t[20] !== i ? (g = (e) => {
|
|
4070
|
+
a?.chip.column === e && o(null), s === e && c(null), d(e) && i(r.filter((t) => t.column !== e));
|
|
4071
|
+
}, t[16] = a?.chip, t[17] = s, t[18] = r, t[19] = d, t[20] = i, t[21] = g) : g = t[21];
|
|
4072
|
+
let _ = g, v;
|
|
4073
|
+
t[22] !== l || t[23] !== n || t[24] !== r || t[25] !== p || t[26] !== i ? (v = (e) => {
|
|
4074
|
+
let t = n.get(e);
|
|
4075
|
+
if (t) {
|
|
4076
|
+
if (l.some((t) => t.column === e)) return p(e);
|
|
4077
|
+
t.type === "boolean" ? (p(null), i([...r, {
|
|
4078
|
+
column: e,
|
|
4079
|
+
op: "eq",
|
|
4080
|
+
value: !0
|
|
4081
|
+
}])) : (c(e), o({
|
|
4082
|
+
chip: {
|
|
4083
|
+
column: e,
|
|
4084
|
+
op: T(t)
|
|
4085
|
+
},
|
|
4086
|
+
at: l.length
|
|
4087
|
+
}));
|
|
4088
|
+
}
|
|
4089
|
+
}, t[22] = l, t[23] = n, t[24] = r, t[25] = p, t[26] = i, t[27] = v) : v = t[27];
|
|
4090
|
+
let y = v, b;
|
|
4091
|
+
t[28] === i ? b = t[29] : (b = () => {
|
|
4092
|
+
o(null), c(null), i([]);
|
|
4093
|
+
}, t[28] = i, t[29] = b);
|
|
4094
|
+
let x = b, S;
|
|
4095
|
+
return t[30] !== l || t[31] !== x || t[32] !== s || t[33] !== y || t[34] !== _ || t[35] !== p || t[36] !== h ? (S = {
|
|
4096
|
+
chips: l,
|
|
4097
|
+
editing: s,
|
|
4098
|
+
setEditing: p,
|
|
4099
|
+
update: h,
|
|
4100
|
+
remove: _,
|
|
4101
|
+
pick: y,
|
|
4102
|
+
clear: x
|
|
4103
|
+
}, t[30] = l, t[31] = x, t[32] = s, t[33] = y, t[34] = _, t[35] = p, t[36] = h, t[37] = S) : S = t[37], S;
|
|
4104
|
+
}
|
|
4105
|
+
// src/list/use-load-state.ts
|
|
4106
|
+
var pr = 400, mr = 150, hr = 1e4;
|
|
4107
|
+
function gr(e, t) {
|
|
4108
|
+
let n = M(4), [r, i] = V(null), a, o;
|
|
4109
|
+
return n[0] !== t || n[1] !== e ? (a = () => {
|
|
4110
|
+
if (e === null) return;
|
|
4111
|
+
let n = setTimeout(() => i(e), t);
|
|
4112
|
+
return () => clearTimeout(n);
|
|
4113
|
+
}, o = [e, t], n[0] = t, n[1] = e, n[2] = a, n[3] = o) : (a = n[2], o = n[3]), I(a, o), e !== null && r === e;
|
|
4114
|
+
}
|
|
4115
|
+
function _r(e, t, n) {
|
|
4116
|
+
let r = M(18), i = !!e && (e.status === "pending" || !!e.isFetching), a = !!e && e.status === "success" && !e.isFetching && !e.isPlaceholderData, [o, s] = V(null);
|
|
4117
|
+
a && (!o || o.data !== e.data || o.at !== e.dataUpdatedAt) && s({
|
|
4118
|
+
identity: t,
|
|
4119
|
+
page: n,
|
|
4120
|
+
data: e.data,
|
|
4121
|
+
at: e.dataUpdatedAt
|
|
4122
|
+
});
|
|
4123
|
+
let c = e?.status === "error" ? e.data?.rows.length ? "stale" : "error" : null, l;
|
|
4124
|
+
r[0] !== c || r[1] !== e?.data?.rows ? (l = c === "error" ? [] : e?.data?.rows ?? [], r[0] = c, r[1] = e?.data?.rows, r[2] = l) : l = r[2];
|
|
4125
|
+
let u = l, d = u.length > 0, f = i && o?.identity !== t, p = f && d, m = `${t}|${e?.dataUpdatedAt ?? 0}`, h = gr(p ? m : null, pr), g = i && !f, _ = gr(g ? m : null, mr), v = gr(i ? m : null, hr), y = i && !d || h, b = f || y && !d, x = o?.page ?? n, S;
|
|
4126
|
+
r[3] === o ? S = r[4] : (S = o?.at ? new Date(o.at) : null, r[3] = o, r[4] = S);
|
|
4127
|
+
let C;
|
|
4128
|
+
return r[5] !== _ || r[6] !== p || r[7] !== c || r[8] !== d || r[9] !== i || r[10] !== g || r[11] !== u || r[12] !== y || r[13] !== v || r[14] !== b || r[15] !== x || r[16] !== S ? (C = {
|
|
4129
|
+
pending: i,
|
|
4130
|
+
rows: u,
|
|
4131
|
+
hasRows: d,
|
|
4132
|
+
errorKind: c,
|
|
4133
|
+
dim: p,
|
|
4134
|
+
skeleton: y,
|
|
4135
|
+
bar: _,
|
|
4136
|
+
stillLoading: v,
|
|
4137
|
+
refreshing: g,
|
|
4138
|
+
busy: b,
|
|
4139
|
+
page: x,
|
|
4140
|
+
updatedAt: S
|
|
4141
|
+
}, r[5] = _, r[6] = p, r[7] = c, r[8] = d, r[9] = i, r[10] = g, r[11] = u, r[12] = y, r[13] = v, r[14] = b, r[15] = x, r[16] = S, r[17] = C) : C = r[17], C;
|
|
4142
|
+
}
|
|
4143
|
+
// src/list/data-table.tsx
|
|
4144
|
+
var vr = F(() => import("./columns-dialog-COcldc3X.js")), yr = F(() => import("./filters-sheet-CWzMaMFo.js").then((e) => ({ default: e.FiltersSheet }))), br = {};
|
|
4145
|
+
function xr(e) {
|
|
4146
|
+
if (typeof e == "string") return { message: e };
|
|
4147
|
+
if (typeof e != "object" || !e) return {};
|
|
4148
|
+
let t = e;
|
|
4149
|
+
return {
|
|
4150
|
+
message: typeof t.message == "string" ? t.message : void 0,
|
|
4151
|
+
id: typeof t.id == "string" || typeof t.id == "number" ? String(t.id) : void 0
|
|
4152
|
+
};
|
|
4153
|
+
}
|
|
4154
|
+
function Sr({ table: t, result: n, label: r, empty: i, toolbar: s = "auto", toolbarEnd: c, notice: l, searchPlaceholder: u, autoRefresh: f, onPrint: p, exportable: m = !0, onExport: h, shortcuts: g = !0, onRowClick: _, rowClick: v = "none", onRowOpen: y, rowActions: b, selectable: x = !1, selectionBar: w = "floating", bulkActions: T, selectionActions: E, onSelectionChange: D, renderExpanded: O, canExpand: k, rowError: A }) {
|
|
4155
|
+
let { i18n: j, locale: M } = e(), N = o(M), F = t.entityName, z = t.request, H = t.rows === void 0, K = _r(H ? n : void 0, JSON.stringify([
|
|
4156
|
+
z.search,
|
|
4157
|
+
z.filters,
|
|
4158
|
+
z.sort,
|
|
4159
|
+
z.page
|
|
4160
|
+
]), z.page), q = H ? K.rows : t.rows ?? [], te = q.length > 0, J = H ? n?.refetch : void 0, ne = K.busy, Y = new Map(t.columns.map((e) => [e.id, e])), re = t.columns.filter((e) => gt(e)), ie = new Set(re.map((e) => e.id)), X = fr({
|
|
4161
|
+
defs: Y,
|
|
4162
|
+
filters: z.filters,
|
|
4163
|
+
setFilters: t.setFilters
|
|
4164
|
+
}), [ae, oe] = V(!1), [Z, se] = V(null), Q = (e) => se((t) => ({
|
|
4165
|
+
key: (t?.key ?? 0) + 1,
|
|
4166
|
+
open: !0,
|
|
4167
|
+
column: e
|
|
4168
|
+
})), [ce] = V(() => new Bt()), le = H ? q : t.allRows ?? [], ue = (e) => (t) => e.type === "select" || e.type === "multiselect" || e.type === "user" && e.options ? a(e.options, t) : (e.type === "user" || e.type === "ajax") && e.remote ? ce.label(e.id, e.remote, t) : String(t), de = (e) => S(e, Y.get(e.column), {
|
|
4169
|
+
i18n: j,
|
|
4170
|
+
fmt: N,
|
|
4171
|
+
labelOf: ue(Y.get(e.column))
|
|
4172
|
+
}), fe = (e) => {
|
|
4173
|
+
if (e.type !== "currency") return [];
|
|
4174
|
+
if (typeof e.currency == "string") return [e.currency];
|
|
4175
|
+
let t = e.currency;
|
|
4176
|
+
return [...new Set(le.map((e) => t(e)))];
|
|
4177
|
+
}, pe = s === "auto" && re.length > 0, me = s !== !1 && t.columns.some((e) => _t(e)), ge = ee(null), [_e, ye] = V(!1), [be, Se] = V(!1), Ce = ee(null), we = (e) => {
|
|
4178
|
+
Ce.current = e, Se(!0), ye(!0);
|
|
4179
|
+
}, Te = t.views, De = s === "auto" && Te.hasViews, [Oe, ke] = V(!1), [$, Ae] = V(null), [je, Me] = V(null), Ne = () => ({
|
|
4180
|
+
filters: z.filters,
|
|
4181
|
+
sort: z.sort,
|
|
4182
|
+
columns: t.layout.state()
|
|
4183
|
+
}), Pe = (e) => {
|
|
4184
|
+
let n = e.sort[0], r = e.sort.length > 1 ? ` +${e.sort.length - 1}` : "", i = [...e.columns.pinned.left, ...e.columns.pinned.right].map(Ct).join(", ");
|
|
4185
|
+
return {
|
|
4186
|
+
filters: e.filters.map((e) => Ct(e.column)).join(" · ") || j.t("common.empty"),
|
|
4187
|
+
sort: n ? `${Ct(n.column)} ${n.dir === "asc" ? "↑" : "↓"}${r}` : j.t("common.empty"),
|
|
4188
|
+
columns: [j.t("views.columnsSummary", {
|
|
4189
|
+
shown: e.columns.visible.length,
|
|
4190
|
+
total: t.columns.length
|
|
4191
|
+
}), ...i ? [j.t("views.pinnedSummary", { name: i })] : []].join(" · ")
|
|
4192
|
+
};
|
|
4193
|
+
}, Fe = (e) => {
|
|
4194
|
+
let n = e ? t.resolveView(e) : Ne();
|
|
4195
|
+
Ae({
|
|
4196
|
+
key: ($?.key ?? 0) + 1,
|
|
4197
|
+
mode: "create",
|
|
4198
|
+
name: e ? j.t("views.copyName", { name: e.name }) : "",
|
|
4199
|
+
state: n,
|
|
4200
|
+
summary: Pe(n),
|
|
4201
|
+
view: e,
|
|
4202
|
+
fromCurrent: !e
|
|
4203
|
+
});
|
|
4204
|
+
}, Ie = (e) => {
|
|
4205
|
+
X.setEditing(null), Te.select(e);
|
|
4206
|
+
}, Le = q.map(t.rowId).join("\0"), Re = x ? q.filter((e) => t.selection[t.rowId(e)]) : [], ze = Re.map(t.rowId).join("\0"), Be = (e, n) => {
|
|
4207
|
+
let r = { ...t.selection };
|
|
4208
|
+
for (let t of e) n ? r[t] = !0 : delete r[t];
|
|
4209
|
+
t.setSelection(r);
|
|
4210
|
+
}, Ve = JSON.stringify([
|
|
4211
|
+
z.search,
|
|
4212
|
+
z.filters,
|
|
4213
|
+
z.sort,
|
|
4214
|
+
z.page
|
|
4215
|
+
]), [He, Ue] = V({
|
|
4216
|
+
key: Ve,
|
|
4217
|
+
ids: br
|
|
4218
|
+
});
|
|
4219
|
+
He.key !== Ve && Ue({
|
|
4220
|
+
key: Ve,
|
|
4221
|
+
ids: br
|
|
4222
|
+
});
|
|
4223
|
+
let We = He.key === Ve ? He.ids : br, Ge = (e, n) => {
|
|
4224
|
+
let r = { ...We };
|
|
4225
|
+
n ? r[e] = !0 : delete r[e], Ue({
|
|
4226
|
+
key: Ve,
|
|
4227
|
+
ids: r
|
|
4228
|
+
});
|
|
4229
|
+
let i = q.find((n) => t.rowId(n) === e);
|
|
4230
|
+
n && i && requestAnimationFrame(() => {
|
|
4231
|
+
let t = [...At.current?.querySelectorAll(".dt-subrow") ?? []].find((t) => t.id.endsWith(`-sub-${e}`)), n = t ? t.querySelectorAll("[role=\"row\"], tr").length : 0;
|
|
4232
|
+
Dt((e) => ({
|
|
4233
|
+
...e,
|
|
4234
|
+
text: j.t("sr.expanded", {
|
|
4235
|
+
label: Ze(i),
|
|
4236
|
+
count: n
|
|
4237
|
+
})
|
|
4238
|
+
}));
|
|
4239
|
+
});
|
|
4240
|
+
}, Ke = new Set(q.map(t.rowId)), qe = (e) => Object.fromEntries(Object.entries(e).filter(([e]) => Ke.has(e)));
|
|
4241
|
+
Object.keys(We).some((e) => !Ke.has(e)) && Ue({
|
|
4242
|
+
key: Ve,
|
|
4243
|
+
ids: qe(We)
|
|
4244
|
+
}), I(() => {
|
|
4245
|
+
Object.keys(t.selection).some((e) => !Ke.has(e)) && t.setSelection(qe(t.selection));
|
|
4246
|
+
}, [Le]);
|
|
4247
|
+
let Je = ee("");
|
|
4248
|
+
I(() => {
|
|
4249
|
+
Je.current !== ze && (Je.current = ze, D?.(Re));
|
|
4250
|
+
}, [ze]);
|
|
4251
|
+
let Ye = t.columns.find((e) => e.primary), Xe = (e) => Ye?.href?.(e), Ze = (e) => {
|
|
4252
|
+
let n = Ye ? Ye.accessor ? Ye.accessor(e) : d(e, Ye.id) : t.rowId(e);
|
|
4253
|
+
return n == null ? "" : String(n);
|
|
4254
|
+
}, Qe = !!b?.length || !!Ye, $e = (e, n) => {
|
|
4255
|
+
if (_?.(e, n), v === "open") n.target.closest(".dt-row")?.querySelector(".dt-cell.is-primary a.dt-link")?.click();
|
|
4256
|
+
else if (v === "expand" && O && (k?.(e) ?? !0)) {
|
|
4257
|
+
let n = t.rowId(e);
|
|
4258
|
+
Ge(n, !We[n]);
|
|
4259
|
+
}
|
|
4260
|
+
}, et = JSON.stringify([
|
|
4261
|
+
z.search,
|
|
4262
|
+
z.filters,
|
|
4263
|
+
z.sort
|
|
4264
|
+
]), [tt, nt] = V(null), [rt, it] = V(null), at = ee(null);
|
|
4265
|
+
I(() => () => at.current?.abort(), [et]);
|
|
4266
|
+
let st = () => {
|
|
4267
|
+
if (!t.count) return;
|
|
4268
|
+
at.current?.abort();
|
|
4269
|
+
let e = new AbortController();
|
|
4270
|
+
at.current = e, it(et);
|
|
4271
|
+
let { search: n, filters: r, sort: i, fields: a } = z;
|
|
4272
|
+
t.count({
|
|
4273
|
+
search: n,
|
|
4274
|
+
filters: r,
|
|
4275
|
+
sort: i,
|
|
4276
|
+
fields: a
|
|
4277
|
+
}, e.signal).then((t) => !e.signal.aborted && nt({
|
|
4278
|
+
key: et,
|
|
4279
|
+
total: t,
|
|
4280
|
+
at: /* @__PURE__ */ new Date()
|
|
4281
|
+
})).catch(() => {}).finally(() => !e.signal.aborted && it(null));
|
|
4282
|
+
}, ct = tt?.key === et ? tt : null, lt = H ? n?.data?.total ?? ct?.total : t.total, ut = H ? K.page : z.page, dt = H ? !!n?.data?.hasMore : ut.number * ut.size < (t.total ?? 0), ft = K.skeleton || te || K.pending ? null : K.errorKind === "error" ? "error" : z.search || z.filters.length ? "noResults" : z.page.number > 1 ? "noRowsOnPage" : "empty", pt = xr(n?.error), [mt, vt] = V(!1);
|
|
4283
|
+
I(() => {
|
|
4284
|
+
if (!mt || !f || !J) return;
|
|
4285
|
+
let e = setInterval(() => J(), f * 1e3);
|
|
4286
|
+
return () => clearInterval(e);
|
|
4287
|
+
}, [
|
|
4288
|
+
mt,
|
|
4289
|
+
f,
|
|
4290
|
+
J
|
|
4291
|
+
]);
|
|
4292
|
+
let yt = mt && f ? "live" : K.bar ? "refreshing" : K.errorKind === "stale" ? "stale" : "normal", bt = (e) => e.toLocaleTimeString(M, {
|
|
4293
|
+
hour: "2-digit",
|
|
4294
|
+
minute: "2-digit"
|
|
4295
|
+
}), xt = new Map(z.sort.map((e, t) => [e.column, {
|
|
4296
|
+
dir: e.dir,
|
|
4297
|
+
index: z.sort.length > 1 ? t + 1 : null
|
|
4298
|
+
}])), St = new Set(t.columns.filter(ht).map((e) => e.id)), Ct = (e) => t.columns.find((t) => t.id === e)?.header ?? e, wt = z.sort[0], Tt = {
|
|
4299
|
+
view: t.state.view ?? "",
|
|
4300
|
+
filters: JSON.stringify(z.filters),
|
|
4301
|
+
sort: JSON.stringify(z.sort),
|
|
4302
|
+
loaded: `${K.updatedAt?.getTime() ?? 0}|${q.length}`,
|
|
4303
|
+
total: ct ? ct.at.getTime() : 0,
|
|
4304
|
+
selected: Re.length
|
|
4305
|
+
}, [Et, Dt] = V({
|
|
4306
|
+
...Tt,
|
|
4307
|
+
text: ""
|
|
4308
|
+
}), Ot = Et.text;
|
|
4309
|
+
(Et.view !== Tt.view || Et.filters !== Tt.filters || Et.sort !== Tt.sort || Et.loaded !== Tt.loaded || Et.total !== Tt.total || Et.selected !== Tt.selected) && (Et.view !== Tt.view && Te.active ? Ot = j.t("sr.view", { name: Te.active.name }) : Et.selected !== Tt.selected && Tt.selected > 0 ? Ot = j.t("selection.selected", { count: Tt.selected }) : Et.filters === Tt.filters ? Et.total !== Tt.total && ct ? Ot = j.t("sr.total", {
|
|
4310
|
+
count: N.int(ct.total),
|
|
4311
|
+
entity: F
|
|
4312
|
+
}) : Et.sort !== Tt.sort && wt ? Ot = j.t("sr.sorted", {
|
|
4313
|
+
column: Ct(wt.column),
|
|
4314
|
+
dir: j.t(`sr.${wt.dir}`)
|
|
4315
|
+
}) : Et.loaded !== Tt.loaded && !K.pending && (Ot = j.t("sr.loaded", { count: q.length })) : Ot = kt(JSON.parse(Et.filters)) ?? Ot, Dt({
|
|
4316
|
+
...Tt,
|
|
4317
|
+
text: Ot
|
|
4318
|
+
}));
|
|
4319
|
+
function kt(e) {
|
|
4320
|
+
let t = new Map(e.map((e) => [e.column, JSON.stringify(e)])), n = z.filters.find((e) => Y.has(e.column) && t.get(e.column) !== JSON.stringify(e));
|
|
4321
|
+
if (n) return j.t("sr.filterAdded", { summary: `${Ct(n.column)} ${de(n).text}`.trim() });
|
|
4322
|
+
let r = e.find((e) => !z.filters.some((t) => t.column === e.column));
|
|
4323
|
+
return r && j.t("sr.filterRemoved", { column: Ct(r.column) });
|
|
4324
|
+
}
|
|
4325
|
+
let At = ee(null), [jt, Mt] = V(1440);
|
|
4326
|
+
B(() => {
|
|
4327
|
+
let e = At.current;
|
|
4328
|
+
if (!e) return;
|
|
4329
|
+
let t = () => Mt(e.clientWidth || 1440);
|
|
4330
|
+
t();
|
|
4331
|
+
let n = typeof ResizeObserver > "u" ? null : new ResizeObserver(t);
|
|
4332
|
+
return n?.observe(e), () => n?.disconnect();
|
|
4333
|
+
}, []);
|
|
4334
|
+
let Nt = jt >= 1024 ? "full" : jt >= 640 ? "narrow" : "phone", Pt = Nt === "phone", { setPhone: Ft } = t.layout;
|
|
4335
|
+
B(() => Ft(Pt), [Ft, Pt]);
|
|
4336
|
+
let It = (e) => Pt ? Q(e) : X.pick(e), Lt = L((e) => {
|
|
4337
|
+
if (e.defaultPrevented) return;
|
|
4338
|
+
let n = e.target instanceof Element ? e.target : null, r = !!n && tn(n) && !(n instanceof HTMLInputElement && n.type === "checkbox");
|
|
4339
|
+
if (e.key === "Escape") !n?.closest("[role=\"menu\"], [role=\"dialog\"], [role=\"alertdialog\"], [role=\"listbox\"], .dt-pop") && Re.length && !r && t.clearSelection();
|
|
4340
|
+
else if (e.altKey && !e.ctrlKey && !e.metaKey && (e.key === "ArrowLeft" || e.key === "ArrowRight")) {
|
|
4341
|
+
if (ne) return;
|
|
4342
|
+
let n = e.key === "ArrowLeft";
|
|
4343
|
+
(n ? ut.number > 1 : dt) && (e.preventDefault(), t.setPage(ut.number + (n ? -1 : 1)));
|
|
4344
|
+
} else if ((e.metaKey || e.ctrlKey) && !e.altKey && !e.shiftKey && (e.key === "s" || e.key === "S")) {
|
|
4345
|
+
if (!g || !Te.edited || !Te.canSave || $) return;
|
|
4346
|
+
e.preventDefault(), Te.writable(Te.active) ? Te.saveChanges() : Fe();
|
|
4347
|
+
} else !g || e.ctrlKey || e.metaKey || e.altKey || r || (e.key === "/" && me ? (e.preventDefault(), ge.current?.focusSearch()) : (e.key === "f" || e.key === "F") && pe ? (e.preventDefault(), Pt ? Q() : oe(!0)) : (e.key === "r" || e.key === "R") && J ? (e.preventDefault(), J()) : (e.key === "v" || e.key === "V") && De && (e.preventDefault(), ke(!0)));
|
|
4348
|
+
});
|
|
4349
|
+
I(() => (window.addEventListener("keydown", Lt), () => window.removeEventListener("keydown", Lt)), []);
|
|
4350
|
+
let Rt = R(), Ht = z.filters.length ? `${Rt}-l ${Rt}-n` : `${Rt}-l`, Ut = (e) => /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("span", {
|
|
4351
|
+
id: `${Rt}-l`,
|
|
4352
|
+
className: e ? void 0 : "dt-sr-only",
|
|
4353
|
+
children: j.t("toolbar.filter")
|
|
4354
|
+
}), z.filters.length > 0 && /* @__PURE__ */ G(U, { children: [" ", /* @__PURE__ */ W("span", {
|
|
4355
|
+
id: `${Rt}-n`,
|
|
4356
|
+
className: "dt-counter",
|
|
4357
|
+
children: z.filters.length
|
|
4358
|
+
})] })] }), Wt = {
|
|
4359
|
+
search: z.search,
|
|
4360
|
+
filters: z.filters,
|
|
4361
|
+
sort: z.sort,
|
|
4362
|
+
fields: z.fields
|
|
4363
|
+
}, Gt = t.layout.columns.map((e) => e.id), Kt = p && (() => p({
|
|
4364
|
+
query: Wt,
|
|
4365
|
+
visibleColumns: Gt
|
|
4366
|
+
})), qt = Re.length ? Re : q, Jt = Re.length > 0 && (!!T?.length || !!E), Yt = m ? Re.length ? j.t("toolbar.exportSelected", { count: Re.length }) : j.t("toolbar.export", { count: q.length }) : void 0, Xt = (e) => {
|
|
4367
|
+
if (h) return h({
|
|
4368
|
+
format: e,
|
|
4369
|
+
query: Wt,
|
|
4370
|
+
selection: Re,
|
|
4371
|
+
rows: qt,
|
|
4372
|
+
visibleColumns: Gt
|
|
4373
|
+
});
|
|
4374
|
+
zt({
|
|
4375
|
+
format: e,
|
|
4376
|
+
columns: t.layout.columns.map((e) => e.def),
|
|
4377
|
+
rows: qt,
|
|
4378
|
+
read: (e, t) => t.accessor ? t.accessor(e) : d(e, t.id),
|
|
4379
|
+
env: {
|
|
4380
|
+
fmt: N,
|
|
4381
|
+
i18n: j,
|
|
4382
|
+
today: /* @__PURE__ */ new Date(),
|
|
4383
|
+
labels: ce
|
|
4384
|
+
},
|
|
4385
|
+
name: F.other
|
|
4386
|
+
});
|
|
4387
|
+
}, Zt = s === "auto" && !!(J || Kt || Yt), $t = t.prefs, en = ft === "error" ? /* @__PURE__ */ W(Bn, {
|
|
4388
|
+
kind: "error",
|
|
4389
|
+
title: j.t("state.errorTitle", { entity: F }),
|
|
4390
|
+
lines: [pt.message, j.t("state.errorKept")].filter((e) => !!e),
|
|
4391
|
+
actions: J && /* @__PURE__ */ W("button", {
|
|
4392
|
+
type: "button",
|
|
4393
|
+
className: "dt-btn",
|
|
4394
|
+
disabled: K.pending,
|
|
4395
|
+
onClick: () => J(),
|
|
4396
|
+
children: j.t("state.tryAgain")
|
|
4397
|
+
}),
|
|
4398
|
+
after: pt.id && /* @__PURE__ */ G("div", {
|
|
4399
|
+
className: "dt-state-id",
|
|
4400
|
+
children: [/* @__PURE__ */ W("button", {
|
|
4401
|
+
type: "button",
|
|
4402
|
+
className: "dt-btn dt-btn-ghost dt-btn-xs",
|
|
4403
|
+
onClick: () => void navigator.clipboard?.writeText(pt.id),
|
|
4404
|
+
children: j.t("state.copyErrorId")
|
|
4405
|
+
}), /* @__PURE__ */ W("code", {
|
|
4406
|
+
className: "dt-state-code",
|
|
4407
|
+
children: pt.id
|
|
4408
|
+
})]
|
|
4409
|
+
})
|
|
4410
|
+
}) : ft === "noResults" ? /* @__PURE__ */ W(Bn, {
|
|
4411
|
+
kind: z.search ? "noResultsSearch" : "noResults",
|
|
4412
|
+
title: j.t(z.search && z.filters.length ? "state.noResultsBoth" : z.search ? "state.noResultsSearch" : "state.noResults", {
|
|
4413
|
+
entity: F,
|
|
4414
|
+
q: z.search,
|
|
4415
|
+
count: z.filters.length
|
|
4416
|
+
}),
|
|
4417
|
+
actions: /* @__PURE__ */ G(U, { children: [z.filters.length === 1 ? /* @__PURE__ */ W("button", {
|
|
4418
|
+
type: "button",
|
|
4419
|
+
className: "dt-btn",
|
|
4420
|
+
onClick: () => X.remove(z.filters[0].column),
|
|
4421
|
+
children: j.t("state.removeFilter", { column: Ct(z.filters[0].column) })
|
|
4422
|
+
}) : z.filters.length > 1 && /* @__PURE__ */ W("button", {
|
|
4423
|
+
type: "button",
|
|
4424
|
+
className: "dt-btn",
|
|
4425
|
+
onClick: X.clear,
|
|
4426
|
+
children: j.t("state.clearAllFilters")
|
|
4427
|
+
}), z.search && /* @__PURE__ */ W("button", {
|
|
4428
|
+
type: "button",
|
|
4429
|
+
className: "dt-btn",
|
|
4430
|
+
onClick: () => t.setSearch(""),
|
|
4431
|
+
children: j.t("state.clearSearch")
|
|
4432
|
+
})] })
|
|
4433
|
+
}) : ft === "noRowsOnPage" ? /* @__PURE__ */ W(Bn, {
|
|
4434
|
+
kind: "noRowsOnPage",
|
|
4435
|
+
title: j.t("page.noneOnPage"),
|
|
4436
|
+
actions: /* @__PURE__ */ W("button", {
|
|
4437
|
+
type: "button",
|
|
4438
|
+
className: "dt-btn",
|
|
4439
|
+
onClick: () => t.setPage(z.page.number - 1),
|
|
4440
|
+
children: j.t("page.previousPage")
|
|
4441
|
+
})
|
|
4442
|
+
}) : ft === "empty" ? i ?? /* @__PURE__ */ W(Bn, {
|
|
4443
|
+
kind: "empty",
|
|
4444
|
+
title: j.t("state.emptyTitle", { entity: F })
|
|
4445
|
+
}) : null;
|
|
4446
|
+
return /* @__PURE__ */ G("div", {
|
|
4447
|
+
ref: At,
|
|
4448
|
+
className: Pt ? "dt dt-list is-phone" : "dt dt-list",
|
|
4449
|
+
"data-density": t.density,
|
|
4450
|
+
children: [
|
|
4451
|
+
w === "toolbar" && Jt && s !== !1 ? /* @__PURE__ */ W(rr, {
|
|
4452
|
+
variant: "toolbar",
|
|
4453
|
+
rows: Re,
|
|
4454
|
+
actions: T ?? [],
|
|
4455
|
+
onClear: t.clearSelection,
|
|
4456
|
+
children: E?.({
|
|
4457
|
+
rows: Re,
|
|
4458
|
+
clear: t.clearSelection
|
|
4459
|
+
})
|
|
4460
|
+
}) : s !== !1 && /* @__PURE__ */ W(Xn, {
|
|
4461
|
+
ref: ge,
|
|
4462
|
+
size: Nt,
|
|
4463
|
+
view: De && /* @__PURE__ */ W(er, {
|
|
4464
|
+
sections: Te.sections,
|
|
4465
|
+
active: Te.active,
|
|
4466
|
+
edited: Te.edited,
|
|
4467
|
+
hasDraft: Te.hasDraft,
|
|
4468
|
+
defaultId: $t.prefs.defaultViewId,
|
|
4469
|
+
canSave: Te.canSave,
|
|
4470
|
+
canWrite: Te.writable(Te.active),
|
|
4471
|
+
open: Oe,
|
|
4472
|
+
onOpenChange: ke,
|
|
4473
|
+
onSelect: Ie,
|
|
4474
|
+
onSaveChanges: () => void Te.saveChanges(),
|
|
4475
|
+
onSaveAs: () => Fe(),
|
|
4476
|
+
onDiscard: () => {
|
|
4477
|
+
X.setEditing(null), Te.discard();
|
|
4478
|
+
},
|
|
4479
|
+
onRename: (e) => Ae({
|
|
4480
|
+
key: ($?.key ?? 0) + 1,
|
|
4481
|
+
mode: "rename",
|
|
4482
|
+
name: e.name,
|
|
4483
|
+
state: Ne(),
|
|
4484
|
+
summary: null,
|
|
4485
|
+
view: e,
|
|
4486
|
+
fromCurrent: !1
|
|
4487
|
+
}),
|
|
4488
|
+
onDuplicate: Fe,
|
|
4489
|
+
onSetDefault: (e) => $t.set({ defaultViewId: e }),
|
|
4490
|
+
onDelete: Me,
|
|
4491
|
+
sheet: Pt
|
|
4492
|
+
}),
|
|
4493
|
+
search: me ? z.search : null,
|
|
4494
|
+
searchPlaceholder: u ?? j.t("toolbar.search", { entity: F }),
|
|
4495
|
+
onSearch: t.setSearch,
|
|
4496
|
+
filter: pe && (Pt ? /* @__PURE__ */ G("button", {
|
|
4497
|
+
type: "button",
|
|
4498
|
+
className: z.filters.length ? "dt-btn dt-btn-icon dt-filter-trigger is-active" : "dt-btn dt-btn-icon dt-filter-trigger",
|
|
4499
|
+
"aria-labelledby": Ht,
|
|
4500
|
+
onClick: () => Q(),
|
|
4501
|
+
children: [/* @__PURE__ */ W(ve, {
|
|
4502
|
+
size: 20,
|
|
4503
|
+
"aria-hidden": "true"
|
|
4504
|
+
}), Ut(!1)]
|
|
4505
|
+
}) : /* @__PURE__ */ W(Vt, {
|
|
4506
|
+
columns: re,
|
|
4507
|
+
chips: X.chips,
|
|
4508
|
+
open: ae,
|
|
4509
|
+
onOpenChange: oe,
|
|
4510
|
+
onPick: X.pick,
|
|
4511
|
+
trigger: /* @__PURE__ */ G("button", {
|
|
4512
|
+
type: "button",
|
|
4513
|
+
className: z.filters.length ? "dt-btn has-icon dt-filter-trigger is-active" : "dt-btn has-icon dt-filter-trigger",
|
|
4514
|
+
"aria-labelledby": Ht,
|
|
4515
|
+
children: [/* @__PURE__ */ W(ve, {
|
|
4516
|
+
size: 16,
|
|
4517
|
+
"aria-hidden": "true"
|
|
4518
|
+
}), Ut(!0)]
|
|
4519
|
+
})
|
|
4520
|
+
})),
|
|
4521
|
+
display: s === "auto" && !Pt && /* @__PURE__ */ W(Un, {
|
|
4522
|
+
density: t.density,
|
|
4523
|
+
onDensity: t.densityFixed ? void 0 : (e) => $t.set({ density: e }),
|
|
4524
|
+
verticalLines: $t.prefs.verticalLines,
|
|
4525
|
+
onVerticalLines: (e) => $t.set({ verticalLines: e }),
|
|
4526
|
+
counts: t.layout.counts,
|
|
4527
|
+
onColumns: we,
|
|
4528
|
+
persistent: $t.persistent,
|
|
4529
|
+
onReset: t.resetDisplay,
|
|
4530
|
+
iconOnly: Nt !== "full"
|
|
4531
|
+
}),
|
|
4532
|
+
more: Pt ? s === "auto" && /* @__PURE__ */ W(Jn, {
|
|
4533
|
+
density: t.density,
|
|
4534
|
+
onDensity: t.densityFixed ? void 0 : (e) => $t.set({ density: e }),
|
|
4535
|
+
columns: t.layout.panel,
|
|
4536
|
+
counts: t.layout.counts,
|
|
4537
|
+
onColumnsSave: t.layout.arrange,
|
|
4538
|
+
sort: z.sort,
|
|
4539
|
+
onSort: (e) => t.setQuery({ sort: e }),
|
|
4540
|
+
persistent: $t.persistent,
|
|
4541
|
+
onReset: t.resetDisplay,
|
|
4542
|
+
exportHint: Yt,
|
|
4543
|
+
onExport: Xt,
|
|
4544
|
+
onRefresh: J && (() => J()),
|
|
4545
|
+
onPrint: Kt,
|
|
4546
|
+
autoRefresh: !!f && !!J,
|
|
4547
|
+
autoRefreshOn: mt,
|
|
4548
|
+
onAutoRefresh: vt
|
|
4549
|
+
}) : Zt && /* @__PURE__ */ W(Wn, {
|
|
4550
|
+
exportHint: Yt,
|
|
4551
|
+
onExport: Xt,
|
|
4552
|
+
onRefresh: J && (() => J()),
|
|
4553
|
+
onPrint: Kt,
|
|
4554
|
+
autoRefresh: !!f && !!J,
|
|
4555
|
+
autoRefreshOn: mt,
|
|
4556
|
+
onAutoRefresh: vt
|
|
4557
|
+
}),
|
|
4558
|
+
end: c
|
|
4559
|
+
}),
|
|
4560
|
+
l && /* @__PURE__ */ W("div", {
|
|
4561
|
+
className: "dt-list-notice",
|
|
4562
|
+
children: l
|
|
4563
|
+
}),
|
|
4564
|
+
K.errorKind === "stale" && K.updatedAt && /* @__PURE__ */ G("div", {
|
|
4565
|
+
className: "dt-strip",
|
|
4566
|
+
role: "status",
|
|
4567
|
+
children: [
|
|
4568
|
+
/* @__PURE__ */ W(Ee, {
|
|
4569
|
+
size: 16,
|
|
4570
|
+
"aria-hidden": "true"
|
|
4571
|
+
}),
|
|
4572
|
+
/* @__PURE__ */ W("span", { children: j.t("state.stale", { time: bt(K.updatedAt) }) }),
|
|
4573
|
+
J && /* @__PURE__ */ W("button", {
|
|
4574
|
+
type: "button",
|
|
4575
|
+
className: "dt-strip-action",
|
|
4576
|
+
disabled: K.pending,
|
|
4577
|
+
onClick: () => J(),
|
|
4578
|
+
children: j.t("common.retry")
|
|
4579
|
+
})
|
|
4580
|
+
]
|
|
4581
|
+
}),
|
|
4582
|
+
X.chips.length > 0 && /* @__PURE__ */ W(Qt, {
|
|
4583
|
+
chips: X.chips,
|
|
4584
|
+
defOf: (e) => Y.get(e),
|
|
4585
|
+
editing: X.editing,
|
|
4586
|
+
rows: le,
|
|
4587
|
+
labels: ce,
|
|
4588
|
+
summaryOf: de,
|
|
4589
|
+
currenciesOf: fe,
|
|
4590
|
+
onChange: X.update,
|
|
4591
|
+
onRemove: X.remove,
|
|
4592
|
+
onEditing: X.setEditing,
|
|
4593
|
+
onClearAll: X.clear,
|
|
4594
|
+
onOpen: Pt ? Q : void 0,
|
|
4595
|
+
add: /* @__PURE__ */ W(Vt, {
|
|
4596
|
+
columns: re,
|
|
4597
|
+
chips: X.chips,
|
|
4598
|
+
onPick: X.pick,
|
|
4599
|
+
trigger: /* @__PURE__ */ G("button", {
|
|
4600
|
+
type: "button",
|
|
4601
|
+
className: "dt-btn dt-btn-ghost dt-btn-sm has-icon dt-filter-add dt-filter-trigger",
|
|
4602
|
+
"aria-label": j.t("filter.addFilter"),
|
|
4603
|
+
children: [/* @__PURE__ */ W(xe, {
|
|
4604
|
+
size: 14,
|
|
4605
|
+
"aria-hidden": "true"
|
|
4606
|
+
}), j.t("filter.addFilter")]
|
|
4607
|
+
})
|
|
4608
|
+
})
|
|
4609
|
+
}),
|
|
4610
|
+
/* @__PURE__ */ W(Nn, {
|
|
4611
|
+
layout: t.layout,
|
|
4612
|
+
rows: q,
|
|
4613
|
+
rowId: t.rowId,
|
|
4614
|
+
label: r ?? F.other,
|
|
4615
|
+
density: t.density,
|
|
4616
|
+
skeleton: K.skeleton,
|
|
4617
|
+
dim: K.dim,
|
|
4618
|
+
refreshing: K.bar,
|
|
4619
|
+
verticalLines: t.prefs.prefs.verticalLines,
|
|
4620
|
+
rowCount: lt === void 0 ? -1 : lt + 1,
|
|
4621
|
+
rowIndexOffset: (ut.number - 1) * ut.size,
|
|
4622
|
+
scrollKey: JSON.stringify([
|
|
4623
|
+
z.page.number,
|
|
4624
|
+
z.search,
|
|
4625
|
+
z.filters
|
|
4626
|
+
]),
|
|
4627
|
+
sort: xt,
|
|
4628
|
+
canSort: (e) => St.has(e),
|
|
4629
|
+
onSort: t.toggleSort,
|
|
4630
|
+
onSortSet: t.setSort,
|
|
4631
|
+
filtered: new Set(z.filters.map((e) => e.column)),
|
|
4632
|
+
canFilter: (e) => ie.has(e),
|
|
4633
|
+
onFilter: It,
|
|
4634
|
+
onColumns: s === "auto" && !Pt ? we : void 0,
|
|
4635
|
+
notice: K.stillLoading && /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(he, {
|
|
4636
|
+
size: 14,
|
|
4637
|
+
className: "dt-spin",
|
|
4638
|
+
"aria-hidden": "true"
|
|
4639
|
+
}), j.t("state.stillLoading")] }),
|
|
4640
|
+
state: en,
|
|
4641
|
+
onRowClick: $e,
|
|
4642
|
+
selection: x ? t.selection : void 0,
|
|
4643
|
+
onSelectRows: x ? Be : void 0,
|
|
4644
|
+
expanded: We,
|
|
4645
|
+
canExpand: k,
|
|
4646
|
+
onToggleExpand: Ge,
|
|
4647
|
+
renderExpanded: O && ((e, t) => O({
|
|
4648
|
+
row: e,
|
|
4649
|
+
close: t
|
|
4650
|
+
})),
|
|
4651
|
+
resetKey: Ve,
|
|
4652
|
+
rowMenu: Qe,
|
|
4653
|
+
rowActions: b,
|
|
4654
|
+
primaryHref: Xe,
|
|
4655
|
+
primaryLabel: Ze,
|
|
4656
|
+
onRowOpen: (e, t) => y?.({
|
|
4657
|
+
row: e,
|
|
4658
|
+
href: Xe(e) ?? "",
|
|
4659
|
+
event: t
|
|
4660
|
+
}),
|
|
4661
|
+
rowError: A
|
|
4662
|
+
}),
|
|
4663
|
+
w === "floating" && Jt && /* @__PURE__ */ W(rr, {
|
|
4664
|
+
variant: "floating",
|
|
4665
|
+
phone: Pt,
|
|
4666
|
+
rows: Re,
|
|
4667
|
+
actions: T ?? [],
|
|
4668
|
+
onClear: t.clearSelection,
|
|
4669
|
+
children: E?.({
|
|
4670
|
+
rows: Re,
|
|
4671
|
+
clear: t.clearSelection
|
|
4672
|
+
})
|
|
4673
|
+
}),
|
|
4674
|
+
/* @__PURE__ */ W(ur, {
|
|
4675
|
+
rowCount: q.length,
|
|
4676
|
+
page: ut,
|
|
4677
|
+
hasMore: dt,
|
|
4678
|
+
total: lt,
|
|
4679
|
+
countable: H && !!t.count,
|
|
4680
|
+
counting: rt === et,
|
|
4681
|
+
countedAt: ct?.at ?? null,
|
|
4682
|
+
busy: ne,
|
|
4683
|
+
firstLoad: K.skeleton && !te,
|
|
4684
|
+
empty: ft === "empty",
|
|
4685
|
+
pageSizes: t.pageSizes,
|
|
4686
|
+
updatedAt: K.updatedAt,
|
|
4687
|
+
freshness: yt,
|
|
4688
|
+
onRefresh: J && (() => J()),
|
|
4689
|
+
onCount: st,
|
|
4690
|
+
onPage: t.setPage,
|
|
4691
|
+
onPageSize: t.setPageSize,
|
|
4692
|
+
phone: Pt
|
|
4693
|
+
}),
|
|
4694
|
+
Z && Pt && pe && /* @__PURE__ */ W(P, {
|
|
4695
|
+
fallback: null,
|
|
4696
|
+
children: /* @__PURE__ */ W(yr, {
|
|
4697
|
+
open: Z.open,
|
|
4698
|
+
onOpenChange: (e) => se({
|
|
4699
|
+
...Z,
|
|
4700
|
+
open: e
|
|
4701
|
+
}),
|
|
4702
|
+
column: Z.column,
|
|
4703
|
+
columns: t.columns,
|
|
4704
|
+
chips: X.chips,
|
|
4705
|
+
sort: z.sort,
|
|
4706
|
+
rows: le,
|
|
4707
|
+
labels: ce,
|
|
4708
|
+
summaryOf: de,
|
|
4709
|
+
currenciesOf: fe,
|
|
4710
|
+
onApply: (e, n) => {
|
|
4711
|
+
X.setEditing(null), t.setQuery({
|
|
4712
|
+
filters: e.map(C),
|
|
4713
|
+
sort: n
|
|
4714
|
+
});
|
|
4715
|
+
}
|
|
4716
|
+
}, Z.key)
|
|
4717
|
+
}),
|
|
4718
|
+
/* @__PURE__ */ W("span", {
|
|
4719
|
+
className: "dt-sr-only",
|
|
4720
|
+
"aria-live": "polite",
|
|
4721
|
+
children: Ot
|
|
4722
|
+
}),
|
|
4723
|
+
/* @__PURE__ */ W("span", {
|
|
4724
|
+
className: "dt-sr-only",
|
|
4725
|
+
"aria-live": "assertive",
|
|
4726
|
+
children: K.errorKind === "error" ? `${j.t("state.errorTitle", { entity: F })} ${j.t("state.tryAgain")}` : ""
|
|
4727
|
+
}),
|
|
4728
|
+
/* @__PURE__ */ W(Rn, { root: At }),
|
|
4729
|
+
$ && /* @__PURE__ */ W(Qn, {
|
|
4730
|
+
open: !0,
|
|
4731
|
+
onOpenChange: (e) => !e && Ae(null),
|
|
4732
|
+
mode: $.mode,
|
|
4733
|
+
name: $.name,
|
|
4734
|
+
summary: $.summary,
|
|
4735
|
+
validate: (e) => ot(e, Te.all, M, $.mode === "rename" ? $.view?.id : void 0),
|
|
4736
|
+
onSave: ({ name: e, makeDefault: t }) => {
|
|
4737
|
+
$.mode === "rename" && $.view ? Te.rename($.view.id, e) : (X.setEditing(null), Te.create({
|
|
4738
|
+
name: e,
|
|
4739
|
+
state: $.state,
|
|
4740
|
+
makeDefault: t,
|
|
4741
|
+
fromCurrent: $.fromCurrent
|
|
4742
|
+
}));
|
|
4743
|
+
}
|
|
4744
|
+
}, $.key),
|
|
4745
|
+
be && /* @__PURE__ */ W(P, {
|
|
4746
|
+
fallback: null,
|
|
4747
|
+
children: /* @__PURE__ */ W(vr, {
|
|
4748
|
+
open: _e,
|
|
4749
|
+
onOpenChange: ye,
|
|
4750
|
+
columns: t.layout.panel,
|
|
4751
|
+
onSave: t.layout.arrange,
|
|
4752
|
+
finalFocus: Ce
|
|
4753
|
+
})
|
|
4754
|
+
}),
|
|
4755
|
+
/* @__PURE__ */ W(Zn, {
|
|
4756
|
+
open: !!je,
|
|
4757
|
+
onOpenChange: (e) => !e && Me(null),
|
|
4758
|
+
title: j.t("views.delete.title", { name: je?.name ?? "" }),
|
|
4759
|
+
body: j.t("views.delete.body"),
|
|
4760
|
+
confirmLabel: j.t("views.delete"),
|
|
4761
|
+
danger: !0,
|
|
4762
|
+
onConfirm: () => je && void Te.remove(je.id)
|
|
4763
|
+
})
|
|
4764
|
+
]
|
|
4765
|
+
});
|
|
4766
|
+
}
|
|
4767
|
+
export { Sr as DataTable, t as DataTableProvider, He as createLocalStoragePreferences, Ve as createLocalStorageViews, wt as useDataTable, e as useDataTableContext };
|
|
4768
|
+
|
|
4769
|
+
//# sourceMappingURL=index.js.map
|