@toolbox-web/grid 1.4.0 → 1.6.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/all.js +859 -671
- package/all.js.map +1 -1
- package/index.js +513 -495
- package/index.js.map +1 -1
- package/lib/core/internal/header.d.ts.map +1 -1
- package/lib/core/internal/rows.d.ts +8 -0
- package/lib/core/internal/rows.d.ts.map +1 -1
- package/lib/core/types.d.ts +82 -17
- package/lib/core/types.d.ts.map +1 -1
- package/lib/plugins/clipboard/index.js.map +1 -1
- package/lib/plugins/column-virtualization/index.js.map +1 -1
- package/lib/plugins/context-menu/index.js.map +1 -1
- package/lib/plugins/editing/index.js.map +1 -1
- package/lib/plugins/editing/types.d.ts +68 -0
- package/lib/plugins/editing/types.d.ts.map +1 -1
- package/lib/plugins/export/index.d.ts +1 -1
- package/lib/plugins/export/index.d.ts.map +1 -1
- package/lib/plugins/export/index.js.map +1 -1
- package/lib/plugins/filtering/FilteringPlugin.d.ts +18 -1
- package/lib/plugins/filtering/FilteringPlugin.d.ts.map +1 -1
- package/lib/plugins/filtering/index.d.ts +1 -1
- package/lib/plugins/filtering/index.d.ts.map +1 -1
- package/lib/plugins/filtering/index.js +313 -183
- package/lib/plugins/filtering/index.js.map +1 -1
- package/lib/plugins/filtering/types.d.ts +81 -2
- package/lib/plugins/filtering/types.d.ts.map +1 -1
- package/lib/plugins/grouping-columns/index.js.map +1 -1
- package/lib/plugins/grouping-rows/GroupingRowsPlugin.d.ts +12 -3
- package/lib/plugins/grouping-rows/GroupingRowsPlugin.d.ts.map +1 -1
- package/lib/plugins/grouping-rows/grouping-rows.d.ts +13 -2
- package/lib/plugins/grouping-rows/grouping-rows.d.ts.map +1 -1
- package/lib/plugins/grouping-rows/index.d.ts +1 -1
- package/lib/plugins/grouping-rows/index.d.ts.map +1 -1
- package/lib/plugins/grouping-rows/index.js +199 -125
- package/lib/plugins/grouping-rows/index.js.map +1 -1
- package/lib/plugins/grouping-rows/types.d.ts +24 -2
- package/lib/plugins/grouping-rows/types.d.ts.map +1 -1
- package/lib/plugins/master-detail/index.d.ts +1 -1
- package/lib/plugins/master-detail/index.d.ts.map +1 -1
- package/lib/plugins/master-detail/index.js.map +1 -1
- package/lib/plugins/multi-sort/index.js.map +1 -1
- package/lib/plugins/pinned-columns/index.js.map +1 -1
- package/lib/plugins/pinned-rows/index.js +1 -1
- package/lib/plugins/pinned-rows/index.js.map +1 -1
- package/lib/plugins/pivot/index.js.map +1 -1
- package/lib/plugins/print/index.js.map +1 -1
- package/lib/plugins/reorder/index.js.map +1 -1
- package/lib/plugins/responsive/index.js.map +1 -1
- package/lib/plugins/row-reorder/index.js.map +1 -1
- package/lib/plugins/selection/SelectionPlugin.d.ts +5 -0
- package/lib/plugins/selection/SelectionPlugin.d.ts.map +1 -1
- package/lib/plugins/selection/index.js +90 -77
- package/lib/plugins/selection/index.js.map +1 -1
- package/lib/plugins/selection/types.d.ts +45 -0
- package/lib/plugins/selection/types.d.ts.map +1 -1
- package/lib/plugins/server-side/index.js.map +1 -1
- package/lib/plugins/tree/index.js.map +1 -1
- package/lib/plugins/undo-redo/index.d.ts +1 -1
- package/lib/plugins/undo-redo/index.d.ts.map +1 -1
- package/lib/plugins/undo-redo/index.js.map +1 -1
- package/lib/plugins/visibility/index.d.ts +1 -1
- package/lib/plugins/visibility/index.d.ts.map +1 -1
- package/lib/plugins/visibility/index.js.map +1 -1
- package/package.json +1 -1
- package/umd/grid.all.umd.js +27 -24
- package/umd/grid.all.umd.js.map +1 -1
- package/umd/grid.umd.js +10 -10
- package/umd/grid.umd.js.map +1 -1
- package/umd/plugins/filtering.umd.js +1 -1
- package/umd/plugins/filtering.umd.js.map +1 -1
- package/umd/plugins/grouping-rows.umd.js +4 -1
- package/umd/plugins/grouping-rows.umd.js.map +1 -1
- package/umd/plugins/pinned-rows.umd.js +1 -1
- package/umd/plugins/pinned-rows.umd.js.map +1 -1
- package/umd/plugins/selection.umd.js +2 -2
- package/umd/plugins/selection.umd.js.map +1 -1
package/all.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { BaseGridPlugin as
|
|
2
|
-
import { DEFAULT_ANIMATION_CONFIG as
|
|
3
|
-
const
|
|
4
|
-
function
|
|
5
|
-
return s.field ===
|
|
1
|
+
import { BaseGridPlugin as _, DEFAULT_GRID_ICONS as st, a as at, runAggregator as te, e as lt, s as dt, PLUGIN_QUERIES as Je, getAggregator as ye, getValueAggregator as ct, b as D, c as xe, g as ut } from "./index.js";
|
|
2
|
+
import { DEFAULT_ANIMATION_CONFIG as Fn, DGEvents as In, DataGridElement as Pn, FitModeEnum as Dn, GridCSSVars as Mn, GridClasses as Nn, GridDataAttrs as qn, DataGridElement as Kn, GridSelectors as Hn, PluginEvents as zn, PluginManager as Gn, RenderPhase as On, builtInSort as Bn, createGrid as Vn, defaultComparator as Wn, queryGrid as $n } from "./index.js";
|
|
3
|
+
const Qe = "__tbw_expander", ht = 32;
|
|
4
|
+
function pe(s) {
|
|
5
|
+
return s.field === Qe;
|
|
6
6
|
}
|
|
7
|
-
function
|
|
7
|
+
function K(s) {
|
|
8
8
|
return s.meta?.utility === !0;
|
|
9
9
|
}
|
|
10
|
-
function
|
|
11
|
-
return s.find(
|
|
10
|
+
function gt(s) {
|
|
11
|
+
return s.find(pe);
|
|
12
12
|
}
|
|
13
|
-
function
|
|
13
|
+
function ft(s) {
|
|
14
14
|
return {
|
|
15
|
-
field:
|
|
15
|
+
field: Qe,
|
|
16
16
|
header: "",
|
|
17
|
-
width:
|
|
17
|
+
width: ht,
|
|
18
18
|
resizable: !1,
|
|
19
19
|
sortable: !1,
|
|
20
20
|
filterable: !1,
|
|
@@ -27,7 +27,7 @@ function ot(s) {
|
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
|
-
async function
|
|
30
|
+
async function ie(s) {
|
|
31
31
|
try {
|
|
32
32
|
return await navigator.clipboard.writeText(s), !0;
|
|
33
33
|
} catch {
|
|
@@ -37,7 +37,7 @@ async function j(s) {
|
|
|
37
37
|
return document.body.removeChild(e), t;
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function Ce(s, e) {
|
|
41
41
|
const t = e.delimiter ?? " ", i = e.newline ?? `
|
|
42
42
|
`, n = s.replace(/\r\n/g, `
|
|
43
43
|
`).replace(/\r/g, `
|
|
@@ -49,14 +49,14 @@ function pe(s, e) {
|
|
|
49
49
|
}
|
|
50
50
|
return o.push(a), (o.length > 1 || o.some((d) => d.trim() !== "")) && r.push(o), r;
|
|
51
51
|
}
|
|
52
|
-
async function
|
|
52
|
+
async function pt() {
|
|
53
53
|
try {
|
|
54
54
|
return await navigator.clipboard.readText();
|
|
55
55
|
} catch {
|
|
56
56
|
return "";
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function mt(s, e) {
|
|
60
60
|
const { rows: t, target: i, fields: n } = s;
|
|
61
61
|
if (!i) return;
|
|
62
62
|
const r = e.rows, o = e.effectiveConfig.columns ?? [], a = o.map((u) => u.field), l = /* @__PURE__ */ new Map();
|
|
@@ -75,13 +75,13 @@ function at(s, e) {
|
|
|
75
75
|
a.forEach((p) => f[p] = ""), d.push(f);
|
|
76
76
|
}
|
|
77
77
|
d[g] = { ...d[g] }, u.forEach((f, p) => {
|
|
78
|
-
const
|
|
79
|
-
|
|
78
|
+
const w = n[p];
|
|
79
|
+
w && l.get(w) && (d[g][w] = f);
|
|
80
80
|
});
|
|
81
81
|
}
|
|
82
82
|
}), e.rows = d;
|
|
83
83
|
}
|
|
84
|
-
class
|
|
84
|
+
class un extends _ {
|
|
85
85
|
static dependencies = [
|
|
86
86
|
{ name: "selection", required: !1, reason: "Enables copy/paste of selected cells instead of entire grid" }
|
|
87
87
|
];
|
|
@@ -133,7 +133,7 @@ class en extends R {
|
|
|
133
133
|
o = { startRow: l.row, startCol: l.col, endRow: l.row, endCol: l.col };
|
|
134
134
|
}
|
|
135
135
|
const a = this.#i(o);
|
|
136
|
-
|
|
136
|
+
ie(a.text).then(() => {
|
|
137
137
|
this.lastCopied = { text: a.text, timestamp: Date.now() }, this.emit("copy", {
|
|
138
138
|
text: a.text,
|
|
139
139
|
rowCount: a.rowCount,
|
|
@@ -145,19 +145,19 @@ class en extends R {
|
|
|
145
145
|
const t = e.clipboardData?.getData("text/plain");
|
|
146
146
|
if (!t) return;
|
|
147
147
|
e.preventDefault();
|
|
148
|
-
const i =
|
|
149
|
-
for (let
|
|
150
|
-
const
|
|
151
|
-
|
|
148
|
+
const i = Ce(t, this.config), r = this.#n()?.getSelection(), o = r?.ranges?.[0], a = o?.from.row ?? 0, l = o?.from.col ?? 0, c = o && (r?.mode === "range" || r?.mode === "row") && (o.from.row !== o.to.row || o.from.col !== o.to.col) ? { endRow: o.to.row, endCol: o.to.col } : null, u = c?.endCol ?? this.columns.length - 1, h = this.columns[l], g = h ? { row: a, col: l, field: h.field, bounds: c } : null, f = [], p = i[0]?.length ?? 0;
|
|
149
|
+
for (let v = 0; v < p && l + v <= u; v++) {
|
|
150
|
+
const y = this.columns[l + v];
|
|
151
|
+
y && !y.hidden && f.push(y.field);
|
|
152
152
|
}
|
|
153
|
-
const
|
|
154
|
-
this.emit("paste",
|
|
153
|
+
const w = { rows: i, text: t, target: g, fields: f };
|
|
154
|
+
this.emit("paste", w), this.#o(w);
|
|
155
155
|
}
|
|
156
156
|
#o(e) {
|
|
157
157
|
if (!this.grid) return;
|
|
158
158
|
const { pasteHandler: t } = this.config;
|
|
159
159
|
if (t === null) return;
|
|
160
|
-
(t ??
|
|
160
|
+
(t ?? mt)(e, this.grid);
|
|
161
161
|
}
|
|
162
162
|
#n() {
|
|
163
163
|
try {
|
|
@@ -169,7 +169,7 @@ class en extends R {
|
|
|
169
169
|
}
|
|
170
170
|
#i(e) {
|
|
171
171
|
const { startRow: t, startCol: i, endRow: n, endCol: r } = e, o = Math.min(t, n), a = Math.max(t, n), l = Math.min(i, r), d = Math.max(i, r), c = this.config.delimiter ?? " ", u = this.config.newline ?? `
|
|
172
|
-
`, h = [], g = this.columns.slice(l, d + 1).filter((f) => !
|
|
172
|
+
`, h = [], g = this.columns.slice(l, d + 1).filter((f) => !K(f));
|
|
173
173
|
if (this.config.includeHeaders) {
|
|
174
174
|
const f = g.map((p) => p.header || p.field);
|
|
175
175
|
h.push(f.join(c));
|
|
@@ -177,11 +177,11 @@ class en extends R {
|
|
|
177
177
|
for (let f = o; f <= a; f++) {
|
|
178
178
|
const p = this.rows[f];
|
|
179
179
|
if (!p) continue;
|
|
180
|
-
const
|
|
181
|
-
const
|
|
182
|
-
return
|
|
180
|
+
const w = g.map((v) => {
|
|
181
|
+
const y = p[v.field];
|
|
182
|
+
return y == null ? "" : y instanceof Date ? y.toISOString() : String(y);
|
|
183
183
|
});
|
|
184
|
-
h.push(
|
|
184
|
+
h.push(w.join(c));
|
|
185
185
|
}
|
|
186
186
|
return {
|
|
187
187
|
text: h.join(u),
|
|
@@ -212,7 +212,7 @@ class en extends R {
|
|
|
212
212
|
};
|
|
213
213
|
}
|
|
214
214
|
const r = this.#i(n);
|
|
215
|
-
return await
|
|
215
|
+
return await ie(r.text), this.lastCopied = { text: r.text, timestamp: Date.now() }, r.text;
|
|
216
216
|
}
|
|
217
217
|
async copyRows(e) {
|
|
218
218
|
if (e.length === 0) return "";
|
|
@@ -222,43 +222,43 @@ class en extends R {
|
|
|
222
222
|
endRow: t[t.length - 1],
|
|
223
223
|
endCol: i
|
|
224
224
|
}, r = this.#i(n);
|
|
225
|
-
return await
|
|
225
|
+
return await ie(r.text), this.lastCopied = { text: r.text, timestamp: Date.now() }, r.text;
|
|
226
226
|
}
|
|
227
227
|
async paste() {
|
|
228
|
-
const e = await
|
|
229
|
-
return e ?
|
|
228
|
+
const e = await pt();
|
|
229
|
+
return e ? Ce(e, this.config) : null;
|
|
230
230
|
}
|
|
231
231
|
getLastCopied() {
|
|
232
232
|
return this.lastCopied;
|
|
233
233
|
}
|
|
234
234
|
}
|
|
235
|
-
const
|
|
236
|
-
function
|
|
235
|
+
const Re = 100;
|
|
236
|
+
function me(s) {
|
|
237
237
|
if (s == null)
|
|
238
|
-
return
|
|
238
|
+
return Re;
|
|
239
239
|
if (typeof s == "number")
|
|
240
240
|
return s;
|
|
241
241
|
const e = parseFloat(s);
|
|
242
|
-
return isNaN(e) ?
|
|
242
|
+
return isNaN(e) ? Re : e;
|
|
243
243
|
}
|
|
244
|
-
function
|
|
245
|
-
return s.map((e) =>
|
|
244
|
+
function Ee(s) {
|
|
245
|
+
return s.map((e) => me(e.width));
|
|
246
246
|
}
|
|
247
|
-
function
|
|
247
|
+
function Se(s) {
|
|
248
248
|
const e = [];
|
|
249
249
|
let t = 0;
|
|
250
250
|
for (const i of s)
|
|
251
|
-
e.push(t), t +=
|
|
251
|
+
e.push(t), t += me(i.width);
|
|
252
252
|
return e;
|
|
253
253
|
}
|
|
254
|
-
function
|
|
255
|
-
return s.reduce((e, t) => e +
|
|
254
|
+
function ke(s) {
|
|
255
|
+
return s.reduce((e, t) => e + me(t.width), 0);
|
|
256
256
|
}
|
|
257
|
-
function
|
|
257
|
+
function wt(s, e, t, i, n) {
|
|
258
258
|
const r = t.length;
|
|
259
259
|
if (r === 0)
|
|
260
260
|
return { startCol: 0, endCol: 0, visibleColumns: [] };
|
|
261
|
-
let o =
|
|
261
|
+
let o = bt(s, t, i);
|
|
262
262
|
o = Math.max(0, o - n);
|
|
263
263
|
const a = s + e;
|
|
264
264
|
let l = o;
|
|
@@ -275,7 +275,7 @@ function lt(s, e, t, i, n) {
|
|
|
275
275
|
d.push(c);
|
|
276
276
|
return { startCol: o, endCol: l, visibleColumns: d };
|
|
277
277
|
}
|
|
278
|
-
function
|
|
278
|
+
function bt(s, e, t) {
|
|
279
279
|
let i = 0, n = e.length - 1;
|
|
280
280
|
for (; i < n; ) {
|
|
281
281
|
const r = Math.floor((i + n) / 2);
|
|
@@ -283,10 +283,10 @@ function dt(s, e, t) {
|
|
|
283
283
|
}
|
|
284
284
|
return i;
|
|
285
285
|
}
|
|
286
|
-
function
|
|
286
|
+
function vt(s, e, t) {
|
|
287
287
|
return t ? s > e : !1;
|
|
288
288
|
}
|
|
289
|
-
class
|
|
289
|
+
class hn extends _ {
|
|
290
290
|
name = "columnVirtualization";
|
|
291
291
|
get defaultConfig() {
|
|
292
292
|
return {
|
|
@@ -305,16 +305,16 @@ class tn extends R {
|
|
|
305
305
|
attach(e) {
|
|
306
306
|
super.attach(e);
|
|
307
307
|
const t = this.columns;
|
|
308
|
-
this.columnWidths =
|
|
308
|
+
this.columnWidths = Ee(t), this.columnOffsets = Se(t), this.totalWidth = ke(t), this.endCol = t.length - 1;
|
|
309
309
|
}
|
|
310
310
|
detach() {
|
|
311
311
|
this.columnWidths = [], this.columnOffsets = [], this.isVirtualized = !1, this.startCol = 0, this.endCol = 0, this.scrollLeft = 0, this.totalWidth = 0;
|
|
312
312
|
}
|
|
313
313
|
processColumns(e) {
|
|
314
|
-
const t =
|
|
315
|
-
if (this.isVirtualized = t ?? !1, this.columnWidths =
|
|
314
|
+
const t = vt(e.length, this.config.threshold ?? 30, this.config.autoEnable ?? !0);
|
|
315
|
+
if (this.isVirtualized = t ?? !1, this.columnWidths = Ee(e), this.columnOffsets = Se(e), this.totalWidth = ke(e), !t)
|
|
316
316
|
return this.startCol = 0, this.endCol = e.length - 1, [...e];
|
|
317
|
-
const i = this.grid.clientWidth || 800, n =
|
|
317
|
+
const i = this.grid.clientWidth || 800, n = wt(
|
|
318
318
|
this.scrollLeft,
|
|
319
319
|
i,
|
|
320
320
|
this.columnOffsets,
|
|
@@ -354,14 +354,14 @@ class tn extends R {
|
|
|
354
354
|
return this.totalWidth;
|
|
355
355
|
}
|
|
356
356
|
}
|
|
357
|
-
const
|
|
358
|
-
function
|
|
357
|
+
const ne = "@layer tbw-plugins{.tbw-context-menu{position:fixed;background:var(--tbw-context-menu-bg, var(--tbw-color-panel-bg, light-dark(#f5f5f5, #2a2a2a)));color:var(--tbw-context-menu-fg, var(--tbw-color-fg, light-dark(#222, #eee)));border:1px solid var(--tbw-context-menu-border, var(--tbw-color-border, light-dark(#d0d0d4, #454545)));border-radius:var(--tbw-border-radius, .25rem);box-shadow:0 2px 10px var(--tbw-color-shadow, rgba(0, 0, 0, .15));min-width:var(--tbw-menu-min-width, 10rem);padding:var(--tbw-spacing-xs, .25rem) 0;z-index:10000;font-size:var(--tbw-font-size-sm, .8125rem);font-family:var(--tbw-font-family, system-ui, sans-serif)}.tbw-context-menu-item{display:flex;align-items:center;padding:var(--tbw-menu-item-padding, .375rem .75rem);cursor:pointer;gap:var(--tbw-menu-item-gap, .5rem)}.tbw-context-menu-item:hover:not(.disabled){background:var(--tbw-context-menu-hover, var(--tbw-color-row-hover, light-dark(#e8e8e8, #3a3a3a)))}.tbw-context-menu-item.disabled{opacity:.5;cursor:default}.tbw-context-menu-item.danger{color:light-dark(#c00,#f66)}.tbw-context-menu-icon{width:var(--tbw-icon-size, 1rem);text-align:center}.tbw-context-menu-label{flex:1}.tbw-context-menu-shortcut{color:var(--tbw-color-fg-muted, light-dark(#888, #888));font-size:var(--tbw-font-size-xs, .6875rem)}.tbw-context-menu-arrow{font-size:var(--tbw-font-size-2xs, .625rem);color:var(--tbw-color-fg-muted, light-dark(#888, #888))}.tbw-context-menu-separator{height:1px;background:var(--tbw-context-menu-border, var(--tbw-color-border, light-dark(#d0d0d4, #454545)));margin:var(--tbw-spacing-xs, .25rem) 0}}";
|
|
358
|
+
function he(s, e) {
|
|
359
359
|
return (typeof s == "function" ? s(e) : s).filter((i) => !(i.hidden === !0 || typeof i.hidden == "function" && i.hidden(e)));
|
|
360
360
|
}
|
|
361
|
-
function
|
|
361
|
+
function yt(s, e) {
|
|
362
362
|
return s.disabled === !0 ? !0 : typeof s.disabled == "function" ? s.disabled(e) : !1;
|
|
363
363
|
}
|
|
364
|
-
function
|
|
364
|
+
function ge(s, e, t, i = st.submenuArrow) {
|
|
365
365
|
const n = document.createElement("div");
|
|
366
366
|
n.className = "tbw-context-menu", n.setAttribute("role", "menu");
|
|
367
367
|
for (const r of s) {
|
|
@@ -372,7 +372,7 @@ function re(s, e, t, i = Ze.submenuArrow) {
|
|
|
372
372
|
}
|
|
373
373
|
const o = document.createElement("div");
|
|
374
374
|
o.className = "tbw-context-menu-item", r.cssClass && o.classList.add(r.cssClass), o.setAttribute("role", "menuitem"), o.setAttribute("data-id", r.id);
|
|
375
|
-
const a =
|
|
375
|
+
const a = yt(r, e);
|
|
376
376
|
if (a && (o.classList.add("disabled"), o.setAttribute("aria-disabled", "true")), r.icon) {
|
|
377
377
|
const d = document.createElement("span");
|
|
378
378
|
d.className = "tbw-context-menu-icon", d.innerHTML = r.icon, o.appendChild(d);
|
|
@@ -386,7 +386,7 @@ function re(s, e, t, i = Ze.submenuArrow) {
|
|
|
386
386
|
const d = document.createElement("span");
|
|
387
387
|
d.className = "tbw-context-menu-arrow", typeof i == "string" ? d.innerHTML = i : i instanceof HTMLElement && d.appendChild(i.cloneNode(!0)), o.appendChild(d), o.addEventListener("mouseenter", () => {
|
|
388
388
|
if (o.querySelector(".tbw-context-menu") || !r.subMenu) return;
|
|
389
|
-
const u =
|
|
389
|
+
const u = he(r.subMenu, e), h = ge(u, e, t, i);
|
|
390
390
|
h.classList.add("tbw-context-submenu"), h.style.position = "absolute", h.style.left = "100%", h.style.top = "0", o.style.position = "relative", o.appendChild(h);
|
|
391
391
|
}), o.addEventListener("mouseleave", () => {
|
|
392
392
|
const c = o.querySelector(".tbw-context-menu");
|
|
@@ -399,14 +399,14 @@ function re(s, e, t, i = Ze.submenuArrow) {
|
|
|
399
399
|
}
|
|
400
400
|
return n;
|
|
401
401
|
}
|
|
402
|
-
function
|
|
402
|
+
function Ae(s, e, t) {
|
|
403
403
|
s.style.position = "fixed", s.style.left = `${e}px`, s.style.top = `${t}px`, s.style.visibility = "hidden", s.style.zIndex = "10000";
|
|
404
404
|
const i = s.getBoundingClientRect(), n = window.innerWidth, r = window.innerHeight;
|
|
405
405
|
let o = e, a = t;
|
|
406
406
|
e + i.width > n && (o = e - i.width), t + i.height > r && (a = t - i.height), o = Math.max(0, o), a = Math.max(0, a), s.style.left = `${o}px`, s.style.top = `${a}px`, s.style.visibility = "visible";
|
|
407
407
|
}
|
|
408
|
-
let
|
|
409
|
-
const
|
|
408
|
+
let z = null, G = null, N = null, re = 0;
|
|
409
|
+
const oe = [
|
|
410
410
|
{
|
|
411
411
|
id: "copy",
|
|
412
412
|
name: "Copy",
|
|
@@ -424,11 +424,11 @@ const X = [
|
|
|
424
424
|
}
|
|
425
425
|
}
|
|
426
426
|
];
|
|
427
|
-
class
|
|
427
|
+
class gn extends _ {
|
|
428
428
|
name = "contextMenu";
|
|
429
429
|
get defaultConfig() {
|
|
430
430
|
return {
|
|
431
|
-
items:
|
|
431
|
+
items: oe
|
|
432
432
|
};
|
|
433
433
|
}
|
|
434
434
|
isOpen = !1;
|
|
@@ -436,20 +436,20 @@ class nn extends R {
|
|
|
436
436
|
params = null;
|
|
437
437
|
menuElement = null;
|
|
438
438
|
attach(e) {
|
|
439
|
-
super.attach(e), this.installGlobalHandlers(),
|
|
439
|
+
super.attach(e), this.installGlobalHandlers(), re++;
|
|
440
440
|
}
|
|
441
441
|
detach() {
|
|
442
442
|
this.menuElement && (this.menuElement.remove(), this.menuElement = null), this.isOpen = !1, this.params = null, this.uninstallGlobalHandlers();
|
|
443
443
|
}
|
|
444
444
|
installGlobalHandlers() {
|
|
445
|
-
!
|
|
445
|
+
!N && typeof document < "u" && typeof ne == "string" && ne && (N = document.createElement("style"), N.id = "tbw-context-menu-styles", N.textContent = ne, document.head.appendChild(N)), z || (z = () => {
|
|
446
446
|
document.querySelectorAll(".tbw-context-menu").forEach((t) => t.remove());
|
|
447
|
-
}, document.addEventListener("click",
|
|
447
|
+
}, document.addEventListener("click", z)), G || (G = (e) => {
|
|
448
448
|
e.key === "Escape" && document.querySelectorAll(".tbw-context-menu").forEach((i) => i.remove());
|
|
449
|
-
}, document.addEventListener("keydown",
|
|
449
|
+
}, document.addEventListener("keydown", G));
|
|
450
450
|
}
|
|
451
451
|
uninstallGlobalHandlers() {
|
|
452
|
-
|
|
452
|
+
re--, !(re > 0) && (z && (document.removeEventListener("click", z), z = null), G && (document.removeEventListener("keydown", G), G = null), N && (N.remove(), N = null));
|
|
453
453
|
}
|
|
454
454
|
afterRender() {
|
|
455
455
|
const e = this.gridElement;
|
|
@@ -487,15 +487,15 @@ class nn extends R {
|
|
|
487
487
|
} else
|
|
488
488
|
return;
|
|
489
489
|
this.params = l, this.position = { x: n.clientX, y: n.clientY };
|
|
490
|
-
const d =
|
|
491
|
-
d.length && (this.menuElement && this.menuElement.remove(), this.menuElement =
|
|
490
|
+
const d = he(this.config.items ?? oe, l);
|
|
491
|
+
d.length && (this.menuElement && this.menuElement.remove(), this.menuElement = ge(
|
|
492
492
|
d,
|
|
493
493
|
l,
|
|
494
494
|
(c) => {
|
|
495
495
|
c.action && c.action(l), this.menuElement?.remove(), this.menuElement = null, this.isOpen = !1;
|
|
496
496
|
},
|
|
497
497
|
this.gridIcons.submenuArrow
|
|
498
|
-
), document.body.appendChild(this.menuElement),
|
|
498
|
+
), document.body.appendChild(this.menuElement), Ae(this.menuElement, n.clientX, n.clientY), this.isOpen = !0, this.emit("context-menu-open", { params: l, items: d }));
|
|
499
499
|
}));
|
|
500
500
|
}
|
|
501
501
|
showMenu(e, t, i) {
|
|
@@ -508,15 +508,15 @@ class nn extends R {
|
|
|
508
508
|
value: i.value ?? null,
|
|
509
509
|
isHeader: i.isHeader ?? !1,
|
|
510
510
|
event: i.event ?? new MouseEvent("contextmenu")
|
|
511
|
-
}, r =
|
|
512
|
-
this.menuElement && this.menuElement.remove(), this.menuElement =
|
|
511
|
+
}, r = he(this.config.items ?? oe, n);
|
|
512
|
+
this.menuElement && this.menuElement.remove(), this.menuElement = ge(
|
|
513
513
|
r,
|
|
514
514
|
n,
|
|
515
515
|
(o) => {
|
|
516
516
|
o.action && o.action(n), this.menuElement?.remove(), this.menuElement = null, this.isOpen = !1;
|
|
517
517
|
},
|
|
518
518
|
this.gridIcons.submenuArrow
|
|
519
|
-
), document.body.appendChild(this.menuElement),
|
|
519
|
+
), document.body.appendChild(this.menuElement), Ae(this.menuElement, e, t), this.isOpen = !0;
|
|
520
520
|
}
|
|
521
521
|
hideMenu() {
|
|
522
522
|
this.menuElement && (this.menuElement.remove(), this.menuElement = null, this.isOpen = !1);
|
|
@@ -525,12 +525,12 @@ class nn extends R {
|
|
|
525
525
|
return this.isOpen;
|
|
526
526
|
}
|
|
527
527
|
}
|
|
528
|
-
const
|
|
529
|
-
function
|
|
528
|
+
const xt = "@layer tbw-plugins{tbw-grid{--tbw-editing-bg: var(--tbw-color-selection);--tbw-editing-row-bg: var(--tbw-editing-bg);--tbw-editing-border: var(--tbw-border-input, 1px solid var(--tbw-color-border-strong));--tbw-padding-editing-input: var(--tbw-cell-padding-input, 2px 6px);--tbw-font-size-editor: inherit;--tbw-editing-row-outline-color: var(--tbw-color-accent);--tbw-editing-row-outline-width: 1px;.data-grid-row:has(.editing){background:var(--tbw-editing-row-bg);outline:var(--tbw-editing-row-outline-width) solid var(--tbw-editing-row-outline-color);outline-offset:calc(-1 * var(--tbw-editing-row-outline-width))}.data-grid-row>.cell.editing{overflow:hidden;padding:0;display:flex;min-height:calc(var(--tbw-row-height) + 2px);align-items:center;justify-content:center}.data-grid-row>.cell.editing input:not([type=checkbox]),.data-grid-row>.cell.editing select,.data-grid-row>.cell.editing textarea{width:100%;height:100%;flex:1 1 auto;min-width:0;border:var(--tbw-editing-border);padding:var(--tbw-padding-editing-input);font-size:var(--tbw-font-size-editor)}.tbw-editor-host{display:contents}}}";
|
|
529
|
+
function Ct(s) {
|
|
530
530
|
const e = s.options;
|
|
531
531
|
return e ? typeof e == "function" ? e() : e : [];
|
|
532
532
|
}
|
|
533
|
-
function
|
|
533
|
+
function Rt(s) {
|
|
534
534
|
return (e) => {
|
|
535
535
|
const t = s.editorParams, i = document.createElement("input");
|
|
536
536
|
i.type = "number", i.value = e.value != null ? String(e.value) : "", t?.min !== void 0 && (i.min = String(t.min)), t?.max !== void 0 && (i.max = String(t.max)), t?.step !== void 0 && (i.step = String(t.step)), t?.placeholder && (i.placeholder = t.placeholder);
|
|
@@ -540,13 +540,13 @@ function ft(s) {
|
|
|
540
540
|
}), i;
|
|
541
541
|
};
|
|
542
542
|
}
|
|
543
|
-
function
|
|
543
|
+
function Et() {
|
|
544
544
|
return (s) => {
|
|
545
545
|
const e = document.createElement("input");
|
|
546
546
|
return e.type = "checkbox", e.checked = !!s.value, e.addEventListener("change", () => s.commit(e.checked)), e;
|
|
547
547
|
};
|
|
548
548
|
}
|
|
549
|
-
function
|
|
549
|
+
function St(s) {
|
|
550
550
|
return (e) => {
|
|
551
551
|
const t = s.editorParams, i = document.createElement("input");
|
|
552
552
|
return i.type = "date", e.value instanceof Date && (i.valueAsDate = e.value), t?.min && (i.min = t.min), t?.max && (i.max = t.max), t?.placeholder && (i.placeholder = t.placeholder), i.addEventListener("change", () => e.commit(i.valueAsDate)), i.addEventListener("keydown", (n) => {
|
|
@@ -554,14 +554,14 @@ function mt(s) {
|
|
|
554
554
|
}), i;
|
|
555
555
|
};
|
|
556
556
|
}
|
|
557
|
-
function
|
|
557
|
+
function kt(s) {
|
|
558
558
|
return (e) => {
|
|
559
559
|
const t = s.editorParams, i = document.createElement("select");
|
|
560
560
|
if (s.multi && (i.multiple = !0), t?.includeEmpty) {
|
|
561
561
|
const o = document.createElement("option");
|
|
562
562
|
o.value = "", o.textContent = t.emptyLabel ?? "", i.appendChild(o);
|
|
563
563
|
}
|
|
564
|
-
|
|
564
|
+
Ct(s).forEach((o) => {
|
|
565
565
|
const a = document.createElement("option");
|
|
566
566
|
a.value = String(o.value), a.textContent = o.label, (s.multi && Array.isArray(e.value) && e.value.includes(o.value) || !s.multi && e.value === o.value) && (a.selected = !0), i.appendChild(a);
|
|
567
567
|
});
|
|
@@ -577,7 +577,7 @@ function wt(s) {
|
|
|
577
577
|
}), i;
|
|
578
578
|
};
|
|
579
579
|
}
|
|
580
|
-
function
|
|
580
|
+
function At(s) {
|
|
581
581
|
return (e) => {
|
|
582
582
|
const t = s.editorParams, i = document.createElement("input");
|
|
583
583
|
return i.type = "text", i.value = e.value != null ? String(e.value) : "", t?.maxLength !== void 0 && (i.maxLength = t.maxLength), t?.pattern && (i.pattern = t.pattern), t?.placeholder && (i.placeholder = t.placeholder), i.addEventListener("blur", () => e.commit(i.value)), i.addEventListener("keydown", (n) => {
|
|
@@ -585,22 +585,22 @@ function bt(s) {
|
|
|
585
585
|
}), i;
|
|
586
586
|
};
|
|
587
587
|
}
|
|
588
|
-
function
|
|
588
|
+
function _t(s) {
|
|
589
589
|
switch (s.type) {
|
|
590
590
|
case "number":
|
|
591
|
-
return
|
|
591
|
+
return Rt(s);
|
|
592
592
|
case "boolean":
|
|
593
|
-
return
|
|
593
|
+
return Et();
|
|
594
594
|
case "date":
|
|
595
|
-
return
|
|
595
|
+
return St(s);
|
|
596
596
|
case "select":
|
|
597
|
-
return
|
|
597
|
+
return kt(s);
|
|
598
598
|
default:
|
|
599
|
-
return
|
|
599
|
+
return At(s);
|
|
600
600
|
}
|
|
601
601
|
}
|
|
602
|
-
const
|
|
603
|
-
function
|
|
602
|
+
const se = 'input,select,textarea,[contenteditable="true"],[contenteditable=""],[tabindex]:not([tabindex="-1"])';
|
|
603
|
+
function Lt(s, e) {
|
|
604
604
|
if (e.editor) return e.editor;
|
|
605
605
|
if (e.__editorTemplate) return "template";
|
|
606
606
|
if (!e.type) return;
|
|
@@ -614,28 +614,28 @@ function yt(s, e) {
|
|
|
614
614
|
return r.editor;
|
|
615
615
|
}
|
|
616
616
|
}
|
|
617
|
-
function
|
|
617
|
+
function $(s) {
|
|
618
618
|
return !(typeof s != "string" || s === "__proto__" || s === "constructor" || s === "prototype");
|
|
619
619
|
}
|
|
620
|
-
function
|
|
620
|
+
function Tt(s) {
|
|
621
621
|
const e = (s.__editingCellCount ?? 0) + 1;
|
|
622
622
|
s.__editingCellCount = e, s.setAttribute("data-has-editing", "");
|
|
623
623
|
}
|
|
624
|
-
function
|
|
624
|
+
function Ft(s) {
|
|
625
625
|
s.__editingCellCount = 0, s.removeAttribute("data-has-editing");
|
|
626
626
|
}
|
|
627
|
-
function
|
|
627
|
+
function U(s, e) {
|
|
628
628
|
return s instanceof HTMLInputElement ? s.type === "checkbox" ? s.checked : s.type === "number" ? s.value === "" ? null : Number(s.value) : s.type === "date" ? s.valueAsDate : s.value : e?.type === "number" && s.value !== "" ? Number(s.value) : s.value;
|
|
629
629
|
}
|
|
630
|
-
function
|
|
630
|
+
function _e(s) {
|
|
631
631
|
}
|
|
632
|
-
function
|
|
632
|
+
function It(s, e, t) {
|
|
633
633
|
const i = s.querySelector("input,textarea,select");
|
|
634
634
|
i && (i.addEventListener("blur", () => {
|
|
635
|
-
t(
|
|
636
|
-
}), i instanceof HTMLInputElement && i.type === "checkbox" ? i.addEventListener("change", () => t(i.checked)) : i instanceof HTMLSelectElement && i.addEventListener("change", () => t(
|
|
635
|
+
t(U(i, e));
|
|
636
|
+
}), i instanceof HTMLInputElement && i.type === "checkbox" ? i.addEventListener("change", () => t(i.checked)) : i instanceof HTMLSelectElement && i.addEventListener("change", () => t(U(i, e))));
|
|
637
637
|
}
|
|
638
|
-
class
|
|
638
|
+
class fn extends _ {
|
|
639
639
|
static manifest = {
|
|
640
640
|
ownedProperties: [
|
|
641
641
|
{
|
|
@@ -657,7 +657,7 @@ class rn extends R {
|
|
|
657
657
|
]
|
|
658
658
|
};
|
|
659
659
|
name = "editing";
|
|
660
|
-
styles =
|
|
660
|
+
styles = xt;
|
|
661
661
|
get defaultConfig() {
|
|
662
662
|
return {
|
|
663
663
|
editOn: "click"
|
|
@@ -719,7 +719,7 @@ class rn extends R {
|
|
|
719
719
|
const r = t._visibleColumns[n], o = t._rows[i];
|
|
720
720
|
if (r?.editable && r.type === "boolean" && o) {
|
|
721
721
|
const a = r.field;
|
|
722
|
-
if (
|
|
722
|
+
if ($(a)) {
|
|
723
723
|
const d = !o[a];
|
|
724
724
|
return this.#h(i, r, d, o), e.preventDefault(), this.requestRender(), !0;
|
|
725
725
|
}
|
|
@@ -851,7 +851,7 @@ class rn extends R {
|
|
|
851
851
|
}), setTimeout(() => {
|
|
852
852
|
let a = r.querySelector(`.cell[data-col="${t._focusCol}"]`);
|
|
853
853
|
if (a?.classList.contains("editing") || (a = r.querySelector(".cell.editing")), a?.classList.contains("editing")) {
|
|
854
|
-
const l = a.querySelector(
|
|
854
|
+
const l = a.querySelector(se);
|
|
855
855
|
try {
|
|
856
856
|
l?.focus({ preventScroll: !0 });
|
|
857
857
|
} catch {
|
|
@@ -892,7 +892,7 @@ class rn extends R {
|
|
|
892
892
|
if (!u) return;
|
|
893
893
|
const h = d.querySelector("input,textarea,select");
|
|
894
894
|
if (h) {
|
|
895
|
-
const g =
|
|
895
|
+
const g = U(h, u);
|
|
896
896
|
r[u.field] !== g && this.#h(e, u, g, r);
|
|
897
897
|
}
|
|
898
898
|
}), t && n && r)
|
|
@@ -914,12 +914,12 @@ class rn extends R {
|
|
|
914
914
|
for (const l of this.#i)
|
|
915
915
|
l.startsWith(`${e}:`) && this.#i.delete(l);
|
|
916
916
|
o && (o.querySelectorAll(".cell.editing").forEach((l) => {
|
|
917
|
-
l.classList.remove("editing"),
|
|
917
|
+
l.classList.remove("editing"), Ft(l.parentElement);
|
|
918
918
|
}), this.requestRender()), this.#r = !0, o || (this.#g(i), this.#r = !1);
|
|
919
919
|
}
|
|
920
920
|
#h(e, t, i, n) {
|
|
921
921
|
const r = t.field;
|
|
922
|
-
if (
|
|
922
|
+
if (!$(r)) return;
|
|
923
923
|
const o = n[r];
|
|
924
924
|
if (o === i) return;
|
|
925
925
|
const a = this.grid;
|
|
@@ -928,7 +928,7 @@ class rn extends R {
|
|
|
928
928
|
l = this.grid.getRowId(n);
|
|
929
929
|
} catch {
|
|
930
930
|
}
|
|
931
|
-
const d = l ? !this.#n.has(l) : !0, c = l ? (g) => this.grid.updateRow(l, g, "cascade") :
|
|
931
|
+
const d = l ? !this.#n.has(l) : !0, c = l ? (g) => this.grid.updateRow(l, g, "cascade") : _e;
|
|
932
932
|
if (this.emitCancelable("cell-commit", {
|
|
933
933
|
row: n,
|
|
934
934
|
rowId: l ?? "",
|
|
@@ -943,7 +943,7 @@ class rn extends R {
|
|
|
943
943
|
})) return;
|
|
944
944
|
n[r] = i, l && this.#n.add(l), this.#a();
|
|
945
945
|
const h = a.findRenderedRowElement?.(e);
|
|
946
|
-
h && (h.classList.add("changed"),
|
|
946
|
+
h && (h.classList.add("changed"), at(h, "change"));
|
|
947
947
|
}
|
|
948
948
|
#p(e, t, i, n, r, o) {
|
|
949
949
|
if (!i.editable || r.classList.contains("editing")) return;
|
|
@@ -952,63 +952,63 @@ class rn extends R {
|
|
|
952
952
|
a = this.grid.getRowId(e);
|
|
953
953
|
} catch {
|
|
954
954
|
}
|
|
955
|
-
const l = a ? (
|
|
955
|
+
const l = a ? (x) => this.grid.updateRow(a, x, "cascade") : _e, d = $(i.field) ? e[i.field] : void 0;
|
|
956
956
|
r.classList.add("editing"), this.#i.add(`${t}:${n}`);
|
|
957
957
|
const c = r.parentElement;
|
|
958
|
-
c &&
|
|
958
|
+
c && Tt(c);
|
|
959
959
|
let u = !1;
|
|
960
|
-
const h = (
|
|
961
|
-
u || this.#e === -1 || this.#h(t, i,
|
|
960
|
+
const h = (x) => {
|
|
961
|
+
u || this.#e === -1 || this.#h(t, i, x, e);
|
|
962
962
|
}, g = () => {
|
|
963
|
-
u = !0,
|
|
963
|
+
u = !0, $(i.field) && (e[i.field] = d);
|
|
964
964
|
}, f = document.createElement("div");
|
|
965
|
-
f.className = "tbw-editor-host", r.innerHTML = "", r.appendChild(f), f.addEventListener("keydown", (
|
|
966
|
-
|
|
965
|
+
f.className = "tbw-editor-host", r.innerHTML = "", r.appendChild(f), f.addEventListener("keydown", (x) => {
|
|
966
|
+
x.key === "Enter" && (x.stopPropagation(), x.preventDefault(), u = !0, this.#s(t, !1)), x.key === "Escape" && (x.stopPropagation(), x.preventDefault(), g(), this.#s(t, !0));
|
|
967
967
|
});
|
|
968
|
-
const p = i,
|
|
969
|
-
if (
|
|
968
|
+
const p = i, w = p.__editorTemplate, v = Lt(this.grid, p) ?? _t(i), y = d;
|
|
969
|
+
if (v === "template" && w)
|
|
970
970
|
this.#l(f, p, e, d, h, g, o, t);
|
|
971
|
-
else if (typeof
|
|
972
|
-
const
|
|
973
|
-
|
|
974
|
-
f.querySelector(
|
|
971
|
+
else if (typeof v == "string") {
|
|
972
|
+
const x = document.createElement(v);
|
|
973
|
+
x.value = y, x.addEventListener("change", () => h(x.value)), f.appendChild(x), o || queueMicrotask(() => {
|
|
974
|
+
f.querySelector(se)?.focus({ preventScroll: !0 });
|
|
975
975
|
});
|
|
976
|
-
} else if (typeof
|
|
977
|
-
const
|
|
976
|
+
} else if (typeof v == "function") {
|
|
977
|
+
const x = {
|
|
978
978
|
row: e,
|
|
979
979
|
rowId: a ?? "",
|
|
980
|
-
value:
|
|
980
|
+
value: y,
|
|
981
981
|
field: i.field,
|
|
982
982
|
column: i,
|
|
983
983
|
commit: h,
|
|
984
984
|
cancel: g,
|
|
985
985
|
updateRow: l
|
|
986
|
-
},
|
|
987
|
-
typeof
|
|
988
|
-
f.querySelector(
|
|
986
|
+
}, A = v(x);
|
|
987
|
+
typeof A == "string" ? (f.innerHTML = A, It(f, i, h)) : A instanceof Node && f.appendChild(A), o || queueMicrotask(() => {
|
|
988
|
+
f.querySelector(se)?.focus({ preventScroll: !0 });
|
|
989
989
|
});
|
|
990
|
-
} else if (
|
|
991
|
-
const
|
|
992
|
-
|
|
993
|
-
const
|
|
990
|
+
} else if (v && typeof v == "object") {
|
|
991
|
+
const x = document.createElement("div");
|
|
992
|
+
x.setAttribute("data-external-editor", ""), x.setAttribute("data-field", i.field), f.appendChild(x);
|
|
993
|
+
const A = {
|
|
994
994
|
row: e,
|
|
995
995
|
rowId: a ?? "",
|
|
996
|
-
value:
|
|
996
|
+
value: y,
|
|
997
997
|
field: i.field,
|
|
998
998
|
column: i,
|
|
999
999
|
commit: h,
|
|
1000
1000
|
cancel: g,
|
|
1001
1001
|
updateRow: l
|
|
1002
1002
|
};
|
|
1003
|
-
if (
|
|
1003
|
+
if (v.mount)
|
|
1004
1004
|
try {
|
|
1005
|
-
|
|
1006
|
-
} catch (
|
|
1007
|
-
console.warn(`[tbw-grid] External editor mount error for column '${i.field}':`,
|
|
1005
|
+
v.mount({ placeholder: x, context: A, spec: v });
|
|
1006
|
+
} catch (F) {
|
|
1007
|
+
console.warn(`[tbw-grid] External editor mount error for column '${i.field}':`, F);
|
|
1008
1008
|
}
|
|
1009
1009
|
else
|
|
1010
1010
|
this.grid.dispatchEvent(
|
|
1011
|
-
new CustomEvent("mount-external-editor", { detail: { placeholder:
|
|
1011
|
+
new CustomEvent("mount-external-editor", { detail: { placeholder: x, spec: v, context: A } })
|
|
1012
1012
|
);
|
|
1013
1013
|
}
|
|
1014
1014
|
}
|
|
@@ -1025,9 +1025,9 @@ class rn extends R {
|
|
|
1025
1025
|
cancel: o
|
|
1026
1026
|
}) : c.querySelectorAll("*").forEach((g) => {
|
|
1027
1027
|
g.childNodes.length === 1 && g.firstChild?.nodeType === Node.TEXT_NODE && (g.textContent = g.textContent?.replace(/{{\s*value\s*}}/g, n == null ? "" : String(n)).replace(/{{\s*row\.([a-zA-Z0-9_]+)\s*}}/g, (f, p) => {
|
|
1028
|
-
if (
|
|
1029
|
-
const
|
|
1030
|
-
return
|
|
1028
|
+
if (!$(p)) return "";
|
|
1029
|
+
const w = i[p];
|
|
1030
|
+
return w == null ? "" : String(w);
|
|
1031
1031
|
}) || "");
|
|
1032
1032
|
});
|
|
1033
1033
|
const h = c.querySelector(
|
|
@@ -1037,10 +1037,10 @@ class rn extends R {
|
|
|
1037
1037
|
h instanceof HTMLInputElement && h.type === "checkbox" ? h.checked = !!n : h.value = String(n ?? "");
|
|
1038
1038
|
let g = !1;
|
|
1039
1039
|
h.addEventListener("blur", () => {
|
|
1040
|
-
g || r(
|
|
1040
|
+
g || r(U(h, t));
|
|
1041
1041
|
}), h.addEventListener("keydown", (f) => {
|
|
1042
1042
|
const p = f;
|
|
1043
|
-
p.key === "Enter" && (p.stopPropagation(), p.preventDefault(), g = !0, r(
|
|
1043
|
+
p.key === "Enter" && (p.stopPropagation(), p.preventDefault(), g = !0, r(U(h, t)), this.#s(l, !1)), p.key === "Escape" && (p.stopPropagation(), p.preventDefault(), o(), this.#s(l, !0));
|
|
1044
1044
|
}), h instanceof HTMLInputElement && h.type === "checkbox" && h.addEventListener("change", () => r(h.checked)), a || setTimeout(() => h.focus({ preventScroll: !0 }), 0);
|
|
1045
1045
|
}
|
|
1046
1046
|
e.appendChild(c);
|
|
@@ -1061,7 +1061,7 @@ class rn extends R {
|
|
|
1061
1061
|
});
|
|
1062
1062
|
}
|
|
1063
1063
|
}
|
|
1064
|
-
function
|
|
1064
|
+
function Le(s, e = !0) {
|
|
1065
1065
|
if (s == null) return "";
|
|
1066
1066
|
if (s instanceof Date) return s.toISOString();
|
|
1067
1067
|
if (typeof s == "object") return JSON.stringify(s);
|
|
@@ -1069,37 +1069,37 @@ function xe(s, e = !0) {
|
|
|
1069
1069
|
return e && (t.includes(",") || t.includes('"') || t.includes(`
|
|
1070
1070
|
`) || t.includes("\r")) ? `"${t.replace(/"/g, '""')}"` : t;
|
|
1071
1071
|
}
|
|
1072
|
-
function
|
|
1072
|
+
function Pt(s, e, t, i = {}) {
|
|
1073
1073
|
const n = i.delimiter ?? ",", r = i.newline ?? `
|
|
1074
1074
|
`, o = [], a = i.bom ? "\uFEFF" : "";
|
|
1075
1075
|
if (t.includeHeaders !== !1) {
|
|
1076
1076
|
const l = e.map((d) => {
|
|
1077
1077
|
const c = d.header || d.field, u = t.processHeader ? t.processHeader(c, d.field) : c;
|
|
1078
|
-
return
|
|
1078
|
+
return Le(u);
|
|
1079
1079
|
});
|
|
1080
1080
|
o.push(l.join(n));
|
|
1081
1081
|
}
|
|
1082
1082
|
for (const l of s) {
|
|
1083
1083
|
const d = e.map((c) => {
|
|
1084
1084
|
let u = l[c.field];
|
|
1085
|
-
return t.processCell && (u = t.processCell(u, c.field, l)),
|
|
1085
|
+
return t.processCell && (u = t.processCell(u, c.field, l)), Le(u);
|
|
1086
1086
|
});
|
|
1087
1087
|
o.push(d.join(n));
|
|
1088
1088
|
}
|
|
1089
1089
|
return a + o.join(r);
|
|
1090
1090
|
}
|
|
1091
|
-
function
|
|
1091
|
+
function we(s, e) {
|
|
1092
1092
|
const t = URL.createObjectURL(s), i = document.createElement("a");
|
|
1093
1093
|
i.href = t, i.download = e, i.style.display = "none", document.body.appendChild(i), i.click(), document.body.removeChild(i), URL.revokeObjectURL(t);
|
|
1094
1094
|
}
|
|
1095
|
-
function
|
|
1095
|
+
function Dt(s, e) {
|
|
1096
1096
|
const t = new Blob([s], { type: "text/csv;charset=utf-8;" });
|
|
1097
|
-
|
|
1097
|
+
we(t, e);
|
|
1098
1098
|
}
|
|
1099
|
-
function
|
|
1099
|
+
function Te(s) {
|
|
1100
1100
|
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
1101
1101
|
}
|
|
1102
|
-
function
|
|
1102
|
+
function Mt(s, e, t) {
|
|
1103
1103
|
let i = `<?xml version="1.0" encoding="UTF-8"?>
|
|
1104
1104
|
<?mso-application progid="Excel.Sheet"?>
|
|
1105
1105
|
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
|
|
@@ -1111,7 +1111,7 @@ function kt(s, e, t) {
|
|
|
1111
1111
|
<Row>`;
|
|
1112
1112
|
for (const n of e) {
|
|
1113
1113
|
const r = n.header || n.field, o = t.processHeader ? t.processHeader(r, n.field) : r;
|
|
1114
|
-
i += `<Cell><Data ss:Type="String">${
|
|
1114
|
+
i += `<Cell><Data ss:Type="String">${Te(o)}</Data></Cell>`;
|
|
1115
1115
|
}
|
|
1116
1116
|
i += "</Row>";
|
|
1117
1117
|
}
|
|
@@ -1122,7 +1122,7 @@ function kt(s, e, t) {
|
|
|
1122
1122
|
let o = n[r.field];
|
|
1123
1123
|
t.processCell && (o = t.processCell(o, r.field, n));
|
|
1124
1124
|
let a = "String", l = "";
|
|
1125
|
-
o == null ? l = "" : typeof o == "number" && !isNaN(o) ? (a = "Number", l = String(o)) : o instanceof Date ? (a = "DateTime", l = o.toISOString()) : l =
|
|
1125
|
+
o == null ? l = "" : typeof o == "number" && !isNaN(o) ? (a = "Number", l = String(o)) : o instanceof Date ? (a = "DateTime", l = o.toISOString()) : l = Te(String(o)), i += `<Cell><Data ss:Type="${a}">${l}</Data></Cell>`;
|
|
1126
1126
|
}
|
|
1127
1127
|
i += "</Row>";
|
|
1128
1128
|
}
|
|
@@ -1131,13 +1131,13 @@ function kt(s, e, t) {
|
|
|
1131
1131
|
</Worksheet>
|
|
1132
1132
|
</Workbook>`, i;
|
|
1133
1133
|
}
|
|
1134
|
-
function
|
|
1134
|
+
function Nt(s, e) {
|
|
1135
1135
|
const t = e.endsWith(".xls") ? e : `${e}.xls`, i = new Blob([s], {
|
|
1136
1136
|
type: "application/vnd.ms-excel;charset=utf-8;"
|
|
1137
1137
|
});
|
|
1138
|
-
|
|
1138
|
+
we(i, t);
|
|
1139
1139
|
}
|
|
1140
|
-
class
|
|
1140
|
+
class pn extends _ {
|
|
1141
1141
|
name = "export";
|
|
1142
1142
|
get defaultConfig() {
|
|
1143
1143
|
return {
|
|
@@ -1174,13 +1174,13 @@ class on extends R {
|
|
|
1174
1174
|
try {
|
|
1175
1175
|
switch (e) {
|
|
1176
1176
|
case "csv": {
|
|
1177
|
-
const l =
|
|
1178
|
-
a = a.endsWith(".csv") ? a : `${a}.csv`,
|
|
1177
|
+
const l = Pt(o, r, n, { bom: !0 });
|
|
1178
|
+
a = a.endsWith(".csv") ? a : `${a}.csv`, Dt(l, a);
|
|
1179
1179
|
break;
|
|
1180
1180
|
}
|
|
1181
1181
|
case "excel": {
|
|
1182
|
-
const l =
|
|
1183
|
-
a = a.endsWith(".xls") ? a : `${a}.xls`,
|
|
1182
|
+
const l = Mt(o, r, n);
|
|
1183
|
+
a = a.endsWith(".xls") ? a : `${a}.xls`, Nt(l, a);
|
|
1184
1184
|
break;
|
|
1185
1185
|
}
|
|
1186
1186
|
case "json": {
|
|
@@ -1194,7 +1194,7 @@ class on extends R {
|
|
|
1194
1194
|
}), d = JSON.stringify(l, null, 2);
|
|
1195
1195
|
a = a.endsWith(".json") ? a : `${a}.json`;
|
|
1196
1196
|
const c = new Blob([d], { type: "application/json" });
|
|
1197
|
-
|
|
1197
|
+
we(c, a);
|
|
1198
1198
|
break;
|
|
1199
1199
|
}
|
|
1200
1200
|
}
|
|
@@ -1231,7 +1231,7 @@ class on extends R {
|
|
|
1231
1231
|
return this.lastExportInfo;
|
|
1232
1232
|
}
|
|
1233
1233
|
}
|
|
1234
|
-
function
|
|
1234
|
+
function qt(s) {
|
|
1235
1235
|
const { totalRows: e, viewportHeight: t, scrollTop: i, rowHeight: n, overscan: r } = s, o = Math.ceil(t / n);
|
|
1236
1236
|
let a = Math.floor(i / n) - r;
|
|
1237
1237
|
a < 0 && (a = 0);
|
|
@@ -1243,10 +1243,10 @@ function _t(s) {
|
|
|
1243
1243
|
totalHeight: e * n
|
|
1244
1244
|
};
|
|
1245
1245
|
}
|
|
1246
|
-
function
|
|
1246
|
+
function Kt(s, e) {
|
|
1247
1247
|
return s <= e;
|
|
1248
1248
|
}
|
|
1249
|
-
function
|
|
1249
|
+
function Ht(s, e, t = !1) {
|
|
1250
1250
|
const i = s[e.field];
|
|
1251
1251
|
if (e.operator === "blank")
|
|
1252
1252
|
return i == null || i === "";
|
|
@@ -1285,10 +1285,10 @@ function Tt(s, e, t = !1) {
|
|
|
1285
1285
|
return !0;
|
|
1286
1286
|
}
|
|
1287
1287
|
}
|
|
1288
|
-
function
|
|
1289
|
-
return e.length ? s.filter((i) => e.every((n) =>
|
|
1288
|
+
function zt(s, e, t = !1) {
|
|
1289
|
+
return e.length ? s.filter((i) => e.every((n) => Ht(i, n, t))) : s;
|
|
1290
1290
|
}
|
|
1291
|
-
function
|
|
1291
|
+
function Gt(s) {
|
|
1292
1292
|
return JSON.stringify(
|
|
1293
1293
|
s.map((e) => ({
|
|
1294
1294
|
field: e.field,
|
|
@@ -1298,7 +1298,7 @@ function Pt(s) {
|
|
|
1298
1298
|
}))
|
|
1299
1299
|
);
|
|
1300
1300
|
}
|
|
1301
|
-
function
|
|
1301
|
+
function Fe(s, e) {
|
|
1302
1302
|
const t = /* @__PURE__ */ new Set();
|
|
1303
1303
|
for (const i of s) {
|
|
1304
1304
|
const n = i[e];
|
|
@@ -1306,10 +1306,10 @@ function Ee(s, e) {
|
|
|
1306
1306
|
}
|
|
1307
1307
|
return [...t].sort((i, n) => typeof i == "number" && typeof n == "number" ? i - n : String(i).localeCompare(String(n)));
|
|
1308
1308
|
}
|
|
1309
|
-
const
|
|
1310
|
-
class
|
|
1309
|
+
const Ot = '@layer tbw-plugins{tbw-grid{.tbw-quick-filter-input{flex:1;max-width:300px;height:var(--tbw-input-height, 1.75rem);padding:var(--tbw-input-padding, 0 .5rem);border:1px solid var(--tbw-color-border);border-radius:var(--tbw-border-radius);background:var(--tbw-color-bg);color:var(--tbw-color-fg);font-size:var(--tbw-font-size-sm, .8125rem);&:focus{outline:none;border-color:var(--tbw-color-accent)}}.header-cell.filtered:before{content:"";position:absolute;top:var(--tbw-spacing-xs, .25rem);right:var(--tbw-spacing-xs, .25rem);width:var(--tbw-indicator-size, .375rem);height:var(--tbw-indicator-size, .375rem);background:var(--tbw-filter-accent, var(--tbw-color-accent, #3b82f6));border-radius:50%}.tbw-filter-btn{display:var(--tbw-filter-btn-display, inline-flex);visibility:var(--tbw-filter-btn-visibility, visible);align-items:center;justify-content:center;background:transparent;border:none;cursor:pointer;padding:2px;margin-left:var(--tbw-spacing-xs, .25rem);opacity:.4;transition:opacity .15s,visibility 0s,display 0s allow-discrete;color:inherit;vertical-align:middle;transition-behavior:allow-discrete;&:hover,&.active{opacity:1;visibility:visible;display:inline-flex}&.active{color:var(--tbw-filter-accent, var(--tbw-color-accent, #3b82f6))}}.header-row .cell:hover .tbw-filter-btn,.header-row .cell.filtered .tbw-filter-btn{display:inline-flex;visibility:visible}}}', Bt = "@layer tbw-plugins{.tbw-filter-panel{position:fixed;background:var(--tbw-filter-panel-bg, var(--tbw-color-panel-bg, light-dark(#eeeeee, #222222)));color:var(--tbw-filter-panel-fg, var(--tbw-color-fg, light-dark(#222222, #eeeeee)));border:1px solid var(--tbw-filter-panel-border, var(--tbw-color-border, light-dark(#d0d0d4, #454545)));border-radius:var(--tbw-filter-panel-radius, var(--tbw-border-radius, .25rem));box-shadow:0 4px 16px var(--tbw-filter-panel-shadow, var(--tbw-color-shadow, light-dark(rgba(0, 0, 0, .1), rgba(0, 0, 0, .3))));padding:var(--tbw-panel-padding, var(--tbw-spacing-lg, .75rem));z-index:10000;min-width:200px;max-width:280px;max-height:350px;display:flex;flex-direction:column;font-family:var(--tbw-font-family, system-ui, sans-serif);font-size:var(--tbw-font-size, .8125rem);transform-origin:top center}.tbw-filter-panel.tbw-filter-panel-above{transform-origin:bottom center}.tbw-filter-panel.tbw-filter-panel-animated{animation:tbw-filter-panel-enter var(--tbw-animation-duration, .15s) var(--tbw-animation-easing, ease-out)}.tbw-filter-panel.tbw-filter-panel-above.tbw-filter-panel-animated{animation:tbw-filter-panel-enter-above var(--tbw-animation-duration, .15s) var(--tbw-animation-easing, ease-out)}@keyframes tbw-filter-panel-enter{0%{opacity:0;transform:scaleY(.3) translateY(-10px)}to{opacity:1;transform:scaleY(1) translateY(0)}}@keyframes tbw-filter-panel-enter-above{0%{opacity:0;transform:scaleY(.3) translateY(10px)}to{opacity:1;transform:scaleY(1) translateY(0)}}@supports (anchor-name: --test){.tbw-filter-panel{position-anchor:--tbw-filter-anchor;top:anchor(bottom);left:anchor(left);margin-top:4px;position-try-fallbacks:flip-inline,flip-block,flip-block flip-inline}}.tbw-filter-search{margin-bottom:var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem));min-height:var(--tbw-filter-item-height, 28px)}.tbw-filter-search-input{height:var(--tbw-filter-item-height, 28px);width:100%;padding:var(--tbw-filter-search-padding, var(--tbw-spacing-sm, .375rem) var(--tbw-spacing-md, .5rem));background:var(--tbw-filter-input-bg, var(--tbw-color-bg, transparent));color:inherit;border:1px solid var(--tbw-filter-input-border, var(--tbw-color-border, light-dark(#d0d0d4, #454545)));border-radius:var(--tbw-filter-input-radius, var(--tbw-border-radius, .25rem));font-size:inherit;box-sizing:border-box}.tbw-filter-search-input:focus{outline:none;border-color:var(--tbw-filter-accent, var(--tbw-color-accent, #3b82f6));box-shadow:0 0 0 2px rgba(from var(--tbw-filter-accent, var(--tbw-color-accent, #3b82f6)) r g b / 15%)}.tbw-filter-actions{display:flex;padding:var(--tbw-button-padding-sm, .25rem .125rem);margin-bottom:var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem));border-bottom:1px solid var(--tbw-filter-divider, var(--tbw-color-border, light-dark(#d0d0d4, #454545)));min-height:var(--tbw-filter-item-height, 28px)}.tbw-filter-action-btn{background:transparent;border:none;color:var(--tbw-filter-accent, var(--tbw-color-accent, #3b82f6));cursor:pointer;font-size:var(--tbw-font-size-xs, .75rem);padding:2px 0}.tbw-filter-action-btn:hover{text-decoration:underline}.tbw-filter-values{flex:1;overflow-y:auto;margin-bottom:var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem));max-height:180px;position:relative}.tbw-filter-values-spacer{width:1px}.tbw-filter-values-content{position:absolute;top:0;left:0;right:0}.tbw-filter-value-item{display:flex;align-items:center;gap:var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem));padding:var(--tbw-button-padding-sm, .25rem .125rem);cursor:pointer;border-radius:3px;height:var(--tbw-filter-item-height, 28px)}.tbw-filter-value-item:hover{background:var(--tbw-filter-hover, var(--tbw-color-row-hover, light-dark(#f0f6ff, #1c1c1c)))}.tbw-filter-checkbox{margin:0;cursor:pointer;accent-color:var(--tbw-filter-accent, var(--tbw-color-accent, #3b82f6))}.tbw-filter-no-match{color:var(--tbw-filter-muted, var(--tbw-color-fg-muted, light-dark(#555555, #aaaaaa)));padding:var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem)) 0;text-align:center;font-style:italic}.tbw-filter-buttons{display:flex;gap:var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem));padding-top:var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem));border-top:1px solid var(--tbw-filter-divider, var(--tbw-color-border, light-dark(#d0d0d4, #454545)))}.tbw-filter-apply-btn{flex:1;padding:var(--tbw-filter-btn-padding, var(--tbw-button-padding, .375rem .75rem));background:var(--tbw-filter-accent, var(--tbw-color-accent, #3b82f6));color:var(--tbw-filter-accent-fg, var(--tbw-color-accent-fg, light-dark(#ffffff, #000000)));border:none;border-radius:var(--tbw-border-radius, .25rem);cursor:pointer;font-size:var(--tbw-font-size-sm, .8125rem);font-weight:var(--tbw-filter-btn-font-weight, 500);min-height:var(--tbw-filter-btn-min-height, auto)}.tbw-filter-apply-btn:hover{filter:brightness(.9)}.tbw-filter-clear-btn{flex:1;padding:var(--tbw-filter-btn-padding, var(--tbw-button-padding, .375rem .75rem));background:transparent;color:var(--tbw-filter-muted, var(--tbw-color-fg-muted, light-dark(#555555, #aaaaaa)));border:1px solid var(--tbw-filter-input-border, var(--tbw-color-border, light-dark(#d0d0d4, #454545)));border-radius:var(--tbw-border-radius, .25rem);cursor:pointer;font-size:var(--tbw-font-size-sm, .8125rem);font-weight:var(--tbw-filter-btn-font-weight, 500);min-height:var(--tbw-filter-btn-min-height, auto)}.tbw-filter-clear-btn:hover{background:var(--tbw-filter-hover, var(--tbw-color-row-hover, light-dark(#f0f6ff, #1c1c1c)))}.tbw-filter-range-title{font-weight:500;margin-bottom:var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem));padding-bottom:var(--tbw-spacing-sm, .375rem);border-bottom:1px solid var(--tbw-filter-divider, var(--tbw-color-border, light-dark(#d0d0d4, #454545)))}.tbw-filter-range-inputs,.tbw-filter-date-range{display:flex;align-items:flex-end;gap:var(--tbw-spacing-sm, .375rem);margin-bottom:var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem))}.tbw-filter-range-group,.tbw-filter-date-group{display:flex;flex-direction:column;gap:var(--tbw-spacing-xs, .25rem);flex:1}.tbw-filter-range-label{font-size:var(--tbw-font-size-xs, .75rem);color:var(--tbw-filter-muted, var(--tbw-color-fg-muted, light-dark(#555555, #aaaaaa)))}.tbw-filter-range-input,.tbw-filter-date-input{width:100%;height:var(--tbw-filter-item-height, 28px);padding:var(--tbw-spacing-xs, .25rem) var(--tbw-spacing-sm, .375rem);background:var(--tbw-filter-input-bg, var(--tbw-color-bg, transparent));color:inherit;border:1px solid var(--tbw-filter-input-border, var(--tbw-color-border, light-dark(#d0d0d4, #454545)));border-radius:var(--tbw-filter-input-radius, var(--tbw-border-radius, .25rem));font-size:inherit;box-sizing:border-box}.tbw-filter-range-input:focus,.tbw-filter-date-input:focus{outline:none;border-color:var(--tbw-filter-accent, var(--tbw-color-accent, #3b82f6));box-shadow:0 0 0 2px rgba(from var(--tbw-filter-accent, var(--tbw-color-accent, #3b82f6)) r g b / 15%)}.tbw-filter-range-separator{color:var(--tbw-filter-muted, var(--tbw-color-fg-muted, light-dark(#555555, #aaaaaa)));padding-bottom:var(--tbw-spacing-xs, .25rem)}.tbw-filter-range-slider{position:relative;height:24px;margin:var(--tbw-spacing-md, .5rem) 0 var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem))}.tbw-filter-range-track{position:absolute;top:50%;left:0;right:0;height:4px;background:var(--tbw-filter-input-border, var(--tbw-color-border, light-dark(#d0d0d4, #454545)));border-radius:2px;transform:translateY(-50%)}.tbw-filter-range-fill{position:absolute;top:50%;height:4px;background:var(--tbw-filter-accent, var(--tbw-color-accent, #3b82f6));border-radius:2px;transform:translateY(-50%)}.tbw-filter-range-thumb{position:absolute;top:0;width:100%;height:100%;background:none;pointer-events:none;-webkit-appearance:none;appearance:none}.tbw-filter-range-thumb::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:16px;height:16px;background:var(--tbw-filter-accent, var(--tbw-color-accent, #3b82f6));border:2px solid var(--tbw-filter-panel-bg, var(--tbw-color-panel-bg, light-dark(#eeeeee, #222222)));border-radius:50%;cursor:pointer;pointer-events:all;box-shadow:0 1px 3px #0003}.tbw-filter-range-thumb::-moz-range-thumb{width:16px;height:16px;background:var(--tbw-filter-accent, var(--tbw-color-accent, #3b82f6));border:2px solid var(--tbw-filter-panel-bg, var(--tbw-color-panel-bg, light-dark(#eeeeee, #222222)));border-radius:50%;cursor:pointer;pointer-events:all;box-shadow:0 1px 3px #0003}.tbw-filter-range-thumb::-webkit-slider-thumb:hover{transform:scale(1.1)}.tbw-filter-range-thumb::-moz-range-thumb:hover{transform:scale(1.1)}}";
|
|
1310
|
+
class q extends _ {
|
|
1311
1311
|
name = "filtering";
|
|
1312
|
-
styles =
|
|
1312
|
+
styles = Ot;
|
|
1313
1313
|
get defaultConfig() {
|
|
1314
1314
|
return {
|
|
1315
1315
|
debounceMs: 300,
|
|
@@ -1318,6 +1318,12 @@ class T extends R {
|
|
|
1318
1318
|
useWorker: !0
|
|
1319
1319
|
};
|
|
1320
1320
|
}
|
|
1321
|
+
isFilteringEnabled() {
|
|
1322
|
+
return this.grid.effectiveConfig?.filterable !== !1;
|
|
1323
|
+
}
|
|
1324
|
+
isColumnFilterable(e) {
|
|
1325
|
+
return this.isFilteringEnabled() ? e.filterable !== !1 : !1;
|
|
1326
|
+
}
|
|
1321
1327
|
filters = /* @__PURE__ */ new Map();
|
|
1322
1328
|
cachedResult = null;
|
|
1323
1329
|
cacheKey = null;
|
|
@@ -1340,7 +1346,7 @@ class T extends R {
|
|
|
1340
1346
|
return t;
|
|
1341
1347
|
}
|
|
1342
1348
|
}
|
|
1343
|
-
return
|
|
1349
|
+
return q.DEFAULT_LIST_ITEM_HEIGHT;
|
|
1344
1350
|
}
|
|
1345
1351
|
syncExcludedValues(e, t) {
|
|
1346
1352
|
t ? t.type === "set" && t.operator === "notIn" && Array.isArray(t.value) ? this.excludedValues.set(e, new Set(t.value)) : t.type === "set" && this.excludedValues.delete(e) : this.excludedValues.delete(e);
|
|
@@ -1356,10 +1362,10 @@ class T extends R {
|
|
|
1356
1362
|
if (!t.length) return [...e];
|
|
1357
1363
|
if (this.config.filterHandler)
|
|
1358
1364
|
return this.cachedResult ? this.cachedResult : [...e];
|
|
1359
|
-
const i =
|
|
1365
|
+
const i = Gt(t);
|
|
1360
1366
|
if (this.cacheKey === i && this.cachedResult)
|
|
1361
1367
|
return this.cachedResult;
|
|
1362
|
-
const n =
|
|
1368
|
+
const n = zt([...e], t, this.config.caseSensitive);
|
|
1363
1369
|
return this.cachedResult = n, this.cacheKey = i, n;
|
|
1364
1370
|
}
|
|
1365
1371
|
afterRender() {
|
|
@@ -1369,7 +1375,7 @@ class T extends R {
|
|
|
1369
1375
|
const n = i.getAttribute("data-col");
|
|
1370
1376
|
if (n === null) return;
|
|
1371
1377
|
const r = this.visibleColumns[parseInt(n, 10)];
|
|
1372
|
-
if (!r || r
|
|
1378
|
+
if (!r || !this.isColumnFilterable(r) || K(r)) return;
|
|
1373
1379
|
const o = r.field;
|
|
1374
1380
|
if (!o) return;
|
|
1375
1381
|
const a = this.filters.has(o);
|
|
@@ -1437,7 +1443,7 @@ class T extends R {
|
|
|
1437
1443
|
return this.getFilters();
|
|
1438
1444
|
}
|
|
1439
1445
|
getUniqueValues(e) {
|
|
1440
|
-
return
|
|
1446
|
+
return Fe(this.sourceRows, e);
|
|
1441
1447
|
}
|
|
1442
1448
|
copyGridThemeContext(e) {
|
|
1443
1449
|
const t = this.gridElement;
|
|
@@ -1454,7 +1460,7 @@ class T extends R {
|
|
|
1454
1460
|
return;
|
|
1455
1461
|
}
|
|
1456
1462
|
const e = document.createElement("style");
|
|
1457
|
-
e.id = "tbw-filter-panel-styles", e.textContent =
|
|
1463
|
+
e.id = "tbw-filter-panel-styles", e.textContent = Bt, document.head.appendChild(e), this.globalStylesInjected = !0;
|
|
1458
1464
|
}
|
|
1459
1465
|
toggleFilterPanel(e, t, i) {
|
|
1460
1466
|
if (this.openPanelField === e) {
|
|
@@ -1469,8 +1475,8 @@ class T extends R {
|
|
|
1469
1475
|
});
|
|
1470
1476
|
return;
|
|
1471
1477
|
}
|
|
1472
|
-
const r =
|
|
1473
|
-
|
|
1478
|
+
const r = Fe(this.sourceRows, e);
|
|
1479
|
+
document.body.appendChild(n), this.positionPanel(n, i), this.renderPanelContent(e, t, n, r), this.setupPanelCloseHandler(n, i);
|
|
1474
1480
|
}
|
|
1475
1481
|
renderPanelContent(e, t, i, n) {
|
|
1476
1482
|
let r = this.excludedValues.get(e);
|
|
@@ -1493,7 +1499,14 @@ class T extends R {
|
|
|
1493
1499
|
closePanel: () => this.closeFilterPanel()
|
|
1494
1500
|
};
|
|
1495
1501
|
let l = !1;
|
|
1496
|
-
this.config.filterPanelRenderer && (this.config.filterPanelRenderer(i, a), l = i.children.length > 0), l
|
|
1502
|
+
if (this.config.filterPanelRenderer && (this.config.filterPanelRenderer(i, a), l = i.children.length > 0), !l && t.type) {
|
|
1503
|
+
const d = this.grid.effectiveConfig.typeDefaults?.[t.type];
|
|
1504
|
+
d?.filterPanelRenderer && (d.filterPanelRenderer(i, a), l = i.children.length > 0);
|
|
1505
|
+
}
|
|
1506
|
+
if (!l) {
|
|
1507
|
+
const d = t.type;
|
|
1508
|
+
d === "number" ? this.renderNumberFilterPanel(i, a, n) : d === "date" ? this.renderDateFilterPanel(i, a, n) : this.renderDefaultFilterPanel(i, a, n, r);
|
|
1509
|
+
}
|
|
1497
1510
|
}
|
|
1498
1511
|
setupPanelCloseHandler(e, t) {
|
|
1499
1512
|
this.panelAbortController = new AbortController(), setTimeout(() => {
|
|
@@ -1512,11 +1525,11 @@ class T extends R {
|
|
|
1512
1525
|
}
|
|
1513
1526
|
static supportsAnchorPositioning = null;
|
|
1514
1527
|
static checkAnchorPositioningSupport() {
|
|
1515
|
-
return
|
|
1528
|
+
return q.supportsAnchorPositioning === null && (q.supportsAnchorPositioning = CSS.supports("anchor-name", "--test")), q.supportsAnchorPositioning;
|
|
1516
1529
|
}
|
|
1517
1530
|
positionPanel(e, t) {
|
|
1518
1531
|
const n = t.closest(".cell") ?? t;
|
|
1519
|
-
if (n.style.anchorName = "--tbw-filter-anchor", this.panelAnchorElement = n,
|
|
1532
|
+
if (n.style.anchorName = "--tbw-filter-anchor", this.panelAnchorElement = n, q.checkAnchorPositioningSupport()) {
|
|
1520
1533
|
requestAnimationFrame(() => {
|
|
1521
1534
|
const o = e.getBoundingClientRect(), a = n.getBoundingClientRect();
|
|
1522
1535
|
o.top < a.top && e.classList.add("tbw-filter-panel-above");
|
|
@@ -1543,99 +1556,201 @@ class T extends R {
|
|
|
1543
1556
|
const h = document.createElement("span");
|
|
1544
1557
|
h.textContent = "Select All", c.appendChild(u), c.appendChild(h), d.appendChild(c);
|
|
1545
1558
|
const g = () => {
|
|
1546
|
-
const
|
|
1547
|
-
u.checked = E, u.indeterminate = !E && !
|
|
1559
|
+
const b = [...v.values()], E = b.every((C) => C), L = b.every((C) => !C);
|
|
1560
|
+
u.checked = E, u.indeterminate = !E && !L;
|
|
1548
1561
|
};
|
|
1549
1562
|
u.addEventListener("change", () => {
|
|
1550
|
-
const
|
|
1551
|
-
for (const E of
|
|
1552
|
-
|
|
1553
|
-
g(),
|
|
1563
|
+
const b = u.checked;
|
|
1564
|
+
for (const E of v.keys())
|
|
1565
|
+
v.set(E, b);
|
|
1566
|
+
g(), A();
|
|
1554
1567
|
}), e.appendChild(d);
|
|
1555
1568
|
const f = document.createElement("div");
|
|
1556
1569
|
f.className = "tbw-filter-values";
|
|
1557
1570
|
const p = document.createElement("div");
|
|
1558
1571
|
p.className = "tbw-filter-values-spacer", f.appendChild(p);
|
|
1559
|
-
const
|
|
1560
|
-
|
|
1561
|
-
const
|
|
1562
|
-
i.forEach((
|
|
1563
|
-
const E =
|
|
1564
|
-
|
|
1572
|
+
const w = document.createElement("div");
|
|
1573
|
+
w.className = "tbw-filter-values-content", f.appendChild(w);
|
|
1574
|
+
const v = /* @__PURE__ */ new Map();
|
|
1575
|
+
i.forEach((b) => {
|
|
1576
|
+
const E = b == null ? "__null__" : String(b);
|
|
1577
|
+
v.set(E, !n.has(b));
|
|
1565
1578
|
}), g();
|
|
1566
|
-
let
|
|
1567
|
-
const
|
|
1568
|
-
const
|
|
1569
|
-
|
|
1570
|
-
const
|
|
1571
|
-
|
|
1572
|
-
|
|
1579
|
+
let y = [];
|
|
1580
|
+
const x = (b, E) => {
|
|
1581
|
+
const L = b == null ? "(Blank)" : String(b), C = b == null ? "__null__" : String(b), m = document.createElement("label");
|
|
1582
|
+
m.className = "tbw-filter-value-item", m.style.position = "absolute", m.style.top = `calc(var(--tbw-filter-item-height, 28px) * ${E})`, m.style.left = "0", m.style.right = "0", m.style.boxSizing = "border-box";
|
|
1583
|
+
const R = document.createElement("input");
|
|
1584
|
+
R.type = "checkbox", R.className = "tbw-filter-checkbox", R.checked = v.get(C) ?? !0, R.dataset.value = C, R.addEventListener("change", () => {
|
|
1585
|
+
v.set(C, R.checked), g();
|
|
1573
1586
|
});
|
|
1574
|
-
const
|
|
1575
|
-
return
|
|
1576
|
-
},
|
|
1577
|
-
const
|
|
1578
|
-
if (p.style.height = `${
|
|
1579
|
-
|
|
1580
|
-
|
|
1587
|
+
const M = document.createElement("span");
|
|
1588
|
+
return M.textContent = L, m.appendChild(R), m.appendChild(M), m;
|
|
1589
|
+
}, A = () => {
|
|
1590
|
+
const b = y.length, E = f.clientHeight, L = f.scrollTop;
|
|
1591
|
+
if (p.style.height = `${b * o}px`, Kt(b, q.LIST_BYPASS_THRESHOLD / 3)) {
|
|
1592
|
+
w.innerHTML = "", w.style.transform = "translateY(0px)", y.forEach((m, R) => {
|
|
1593
|
+
w.appendChild(x(m, R));
|
|
1581
1594
|
});
|
|
1582
1595
|
return;
|
|
1583
1596
|
}
|
|
1584
|
-
const C =
|
|
1585
|
-
totalRows:
|
|
1597
|
+
const C = qt({
|
|
1598
|
+
totalRows: b,
|
|
1586
1599
|
viewportHeight: E,
|
|
1587
|
-
scrollTop:
|
|
1600
|
+
scrollTop: L,
|
|
1588
1601
|
rowHeight: o,
|
|
1589
|
-
overscan:
|
|
1602
|
+
overscan: q.LIST_OVERSCAN
|
|
1590
1603
|
});
|
|
1591
|
-
|
|
1592
|
-
for (let
|
|
1593
|
-
|
|
1594
|
-
},
|
|
1595
|
-
const E = this.config.caseSensitive ?? !1,
|
|
1596
|
-
if (
|
|
1597
|
-
const
|
|
1598
|
-
return !
|
|
1599
|
-
}),
|
|
1600
|
-
p.style.height = "0px",
|
|
1604
|
+
w.style.transform = `translateY(${C.offsetY}px)`, w.innerHTML = "";
|
|
1605
|
+
for (let m = C.start; m < C.end; m++)
|
|
1606
|
+
w.appendChild(x(y[m], m - C.start));
|
|
1607
|
+
}, F = (b) => {
|
|
1608
|
+
const E = this.config.caseSensitive ?? !1, L = E ? b : b.toLowerCase();
|
|
1609
|
+
if (y = i.filter((C) => {
|
|
1610
|
+
const m = C == null ? "(Blank)" : String(C), R = E ? m : m.toLowerCase();
|
|
1611
|
+
return !b || R.includes(L);
|
|
1612
|
+
}), y.length === 0) {
|
|
1613
|
+
p.style.height = "0px", w.innerHTML = "";
|
|
1601
1614
|
const C = document.createElement("div");
|
|
1602
|
-
C.className = "tbw-filter-no-match", C.textContent = "No matching values",
|
|
1615
|
+
C.className = "tbw-filter-no-match", C.textContent = "No matching values", w.appendChild(C);
|
|
1603
1616
|
return;
|
|
1604
1617
|
}
|
|
1605
|
-
|
|
1618
|
+
A();
|
|
1606
1619
|
};
|
|
1607
1620
|
f.addEventListener(
|
|
1608
1621
|
"scroll",
|
|
1609
1622
|
() => {
|
|
1610
|
-
|
|
1623
|
+
y.length > 0 && A();
|
|
1611
1624
|
},
|
|
1612
1625
|
{ passive: !0 }
|
|
1613
|
-
),
|
|
1614
|
-
let
|
|
1626
|
+
), F(l.value), e.appendChild(f);
|
|
1627
|
+
let k;
|
|
1615
1628
|
l.addEventListener("input", () => {
|
|
1616
|
-
clearTimeout(
|
|
1617
|
-
this.searchText.set(r, l.value),
|
|
1629
|
+
clearTimeout(k), k = setTimeout(() => {
|
|
1630
|
+
this.searchText.set(r, l.value), F(l.value);
|
|
1618
1631
|
}, this.config.debounceMs ?? 150);
|
|
1619
1632
|
});
|
|
1620
|
-
const
|
|
1621
|
-
|
|
1622
|
-
const
|
|
1623
|
-
|
|
1624
|
-
const
|
|
1625
|
-
for (const [E,
|
|
1626
|
-
if (!
|
|
1633
|
+
const I = document.createElement("div");
|
|
1634
|
+
I.className = "tbw-filter-buttons";
|
|
1635
|
+
const T = document.createElement("button");
|
|
1636
|
+
T.className = "tbw-filter-apply-btn", T.textContent = "Apply", T.addEventListener("click", () => {
|
|
1637
|
+
const b = [];
|
|
1638
|
+
for (const [E, L] of v)
|
|
1639
|
+
if (!L)
|
|
1627
1640
|
if (E === "__null__")
|
|
1628
|
-
|
|
1641
|
+
b.push(null);
|
|
1629
1642
|
else {
|
|
1630
|
-
const C = i.find((
|
|
1631
|
-
|
|
1643
|
+
const C = i.find((m) => String(m) === E);
|
|
1644
|
+
b.push(C !== void 0 ? C : E);
|
|
1632
1645
|
}
|
|
1633
|
-
t.applySetFilter(
|
|
1634
|
-
}),
|
|
1635
|
-
const
|
|
1636
|
-
|
|
1646
|
+
t.applySetFilter(b);
|
|
1647
|
+
}), I.appendChild(T);
|
|
1648
|
+
const P = document.createElement("button");
|
|
1649
|
+
P.className = "tbw-filter-clear-btn", P.textContent = "Clear Filter", P.addEventListener("click", () => {
|
|
1637
1650
|
t.clearFilter();
|
|
1638
|
-
}),
|
|
1651
|
+
}), I.appendChild(P), e.appendChild(I);
|
|
1652
|
+
}
|
|
1653
|
+
renderNumberFilterPanel(e, t, i) {
|
|
1654
|
+
const { field: n, column: r } = t, o = r.filterParams, a = r.editorParams, l = (S, H) => {
|
|
1655
|
+
if (typeof S == "number") return S;
|
|
1656
|
+
if (typeof S == "string") {
|
|
1657
|
+
const W = parseFloat(S);
|
|
1658
|
+
return isNaN(W) ? H : W;
|
|
1659
|
+
}
|
|
1660
|
+
return H;
|
|
1661
|
+
}, d = i.filter((S) => typeof S == "number" && !isNaN(S)), c = d.length > 0 ? Math.min(...d) : 0, u = d.length > 0 ? Math.max(...d) : 100, h = l(o?.min ?? a?.min, c), g = l(o?.max ?? a?.max, u), f = o?.step ?? a?.step ?? 1, p = this.filters.get(n);
|
|
1662
|
+
let w = h, v = g;
|
|
1663
|
+
p?.operator === "between" ? (w = l(p.value, h), v = l(p.valueTo, g)) : p?.operator === "greaterThanOrEqual" ? w = l(p.value, h) : p?.operator === "lessThanOrEqual" && (v = l(p.value, g));
|
|
1664
|
+
const y = document.createElement("div");
|
|
1665
|
+
y.className = "tbw-filter-range-title", y.textContent = r.header || n, e.appendChild(y);
|
|
1666
|
+
const x = document.createElement("div");
|
|
1667
|
+
x.className = "tbw-filter-range-inputs";
|
|
1668
|
+
const A = document.createElement("div");
|
|
1669
|
+
A.className = "tbw-filter-range-group";
|
|
1670
|
+
const F = document.createElement("label");
|
|
1671
|
+
F.textContent = "Min", F.className = "tbw-filter-range-label";
|
|
1672
|
+
const k = document.createElement("input");
|
|
1673
|
+
k.type = "number", k.className = "tbw-filter-range-input", k.min = String(h), k.max = String(g), k.step = String(f), k.value = String(w), A.appendChild(F), A.appendChild(k), x.appendChild(A);
|
|
1674
|
+
const I = document.createElement("span");
|
|
1675
|
+
I.className = "tbw-filter-range-separator", I.textContent = "–", x.appendChild(I);
|
|
1676
|
+
const T = document.createElement("div");
|
|
1677
|
+
T.className = "tbw-filter-range-group";
|
|
1678
|
+
const P = document.createElement("label");
|
|
1679
|
+
P.textContent = "Max", P.className = "tbw-filter-range-label";
|
|
1680
|
+
const b = document.createElement("input");
|
|
1681
|
+
b.type = "number", b.className = "tbw-filter-range-input", b.min = String(h), b.max = String(g), b.step = String(f), b.value = String(v), T.appendChild(P), T.appendChild(b), x.appendChild(T), e.appendChild(x);
|
|
1682
|
+
const E = document.createElement("div");
|
|
1683
|
+
E.className = "tbw-filter-range-slider";
|
|
1684
|
+
const L = document.createElement("div");
|
|
1685
|
+
L.className = "tbw-filter-range-track";
|
|
1686
|
+
const C = document.createElement("div");
|
|
1687
|
+
C.className = "tbw-filter-range-fill";
|
|
1688
|
+
const m = document.createElement("input");
|
|
1689
|
+
m.type = "range", m.className = "tbw-filter-range-thumb tbw-filter-range-thumb-min", m.min = String(h), m.max = String(g), m.step = String(f), m.value = String(w);
|
|
1690
|
+
const R = document.createElement("input");
|
|
1691
|
+
R.type = "range", R.className = "tbw-filter-range-thumb tbw-filter-range-thumb-max", R.min = String(h), R.max = String(g), R.step = String(f), R.value = String(v), E.appendChild(L), E.appendChild(C), E.appendChild(m), E.appendChild(R), e.appendChild(E);
|
|
1692
|
+
const M = () => {
|
|
1693
|
+
const S = parseFloat(m.value), H = parseFloat(R.value), W = g - h, ve = (S - h) / W * 100, ot = (H - h) / W * 100;
|
|
1694
|
+
C.style.left = `${ve}%`, C.style.width = `${ot - ve}%`;
|
|
1695
|
+
};
|
|
1696
|
+
m.addEventListener("input", () => {
|
|
1697
|
+
const S = Math.min(parseFloat(m.value), parseFloat(R.value));
|
|
1698
|
+
m.value = String(S), k.value = String(S), M();
|
|
1699
|
+
}), R.addEventListener("input", () => {
|
|
1700
|
+
const S = Math.max(parseFloat(R.value), parseFloat(m.value));
|
|
1701
|
+
R.value = String(S), b.value = String(S), M();
|
|
1702
|
+
}), k.addEventListener("input", () => {
|
|
1703
|
+
let S = parseFloat(k.value) || h;
|
|
1704
|
+
S = Math.max(h, Math.min(S, parseFloat(b.value))), m.value = String(S), M();
|
|
1705
|
+
}), b.addEventListener("input", () => {
|
|
1706
|
+
let S = parseFloat(b.value) || g;
|
|
1707
|
+
S = Math.min(g, Math.max(S, parseFloat(k.value))), R.value = String(S), M();
|
|
1708
|
+
}), M();
|
|
1709
|
+
const Y = document.createElement("div");
|
|
1710
|
+
Y.className = "tbw-filter-buttons";
|
|
1711
|
+
const X = document.createElement("button");
|
|
1712
|
+
X.className = "tbw-filter-apply-btn", X.textContent = "Apply", X.addEventListener("click", () => {
|
|
1713
|
+
const S = parseFloat(k.value), H = parseFloat(b.value);
|
|
1714
|
+
t.applyTextFilter("between", S, H);
|
|
1715
|
+
}), Y.appendChild(X);
|
|
1716
|
+
const Z = document.createElement("button");
|
|
1717
|
+
Z.className = "tbw-filter-clear-btn", Z.textContent = "Clear Filter", Z.addEventListener("click", () => {
|
|
1718
|
+
t.clearFilter();
|
|
1719
|
+
}), Y.appendChild(Z), e.appendChild(Y);
|
|
1720
|
+
}
|
|
1721
|
+
renderDateFilterPanel(e, t, i) {
|
|
1722
|
+
const { field: n, column: r } = t, o = r.filterParams, a = r.editorParams, l = i.filter((m) => m instanceof Date || typeof m == "string" && !isNaN(Date.parse(m))).map((m) => m instanceof Date ? m : new Date(m)).filter((m) => !isNaN(m.getTime())), d = l.length > 0 ? new Date(Math.min(...l.map((m) => m.getTime()))) : null, c = l.length > 0 ? new Date(Math.max(...l.map((m) => m.getTime()))) : null, u = (m) => m ? m.toISOString().split("T")[0] : "", h = (m) => m ? typeof m == "string" ? m : typeof m == "number" ? u(new Date(m)) : "" : "", g = h(o?.min) || h(a?.min) || u(d), f = h(o?.max) || h(a?.max) || u(c), p = this.filters.get(n);
|
|
1723
|
+
let w = "", v = "";
|
|
1724
|
+
p?.operator === "between" ? (w = h(p.value) || "", v = h(p.valueTo) || "") : p?.operator === "greaterThanOrEqual" ? w = h(p.value) || "" : p?.operator === "lessThanOrEqual" && (v = h(p.value) || "");
|
|
1725
|
+
const y = document.createElement("div");
|
|
1726
|
+
y.className = "tbw-filter-range-title", y.textContent = r.header || n, e.appendChild(y);
|
|
1727
|
+
const x = document.createElement("div");
|
|
1728
|
+
x.className = "tbw-filter-date-range";
|
|
1729
|
+
const A = document.createElement("div");
|
|
1730
|
+
A.className = "tbw-filter-date-group";
|
|
1731
|
+
const F = document.createElement("label");
|
|
1732
|
+
F.textContent = "From", F.className = "tbw-filter-range-label";
|
|
1733
|
+
const k = document.createElement("input");
|
|
1734
|
+
k.type = "date", k.className = "tbw-filter-date-input", g && (k.min = g), f && (k.max = f), k.value = w, A.appendChild(F), A.appendChild(k), x.appendChild(A);
|
|
1735
|
+
const I = document.createElement("span");
|
|
1736
|
+
I.className = "tbw-filter-range-separator", I.textContent = "–", x.appendChild(I);
|
|
1737
|
+
const T = document.createElement("div");
|
|
1738
|
+
T.className = "tbw-filter-date-group";
|
|
1739
|
+
const P = document.createElement("label");
|
|
1740
|
+
P.textContent = "To", P.className = "tbw-filter-range-label";
|
|
1741
|
+
const b = document.createElement("input");
|
|
1742
|
+
b.type = "date", b.className = "tbw-filter-date-input", g && (b.min = g), f && (b.max = f), b.value = v, T.appendChild(P), T.appendChild(b), x.appendChild(T), e.appendChild(x);
|
|
1743
|
+
const E = document.createElement("div");
|
|
1744
|
+
E.className = "tbw-filter-buttons";
|
|
1745
|
+
const L = document.createElement("button");
|
|
1746
|
+
L.className = "tbw-filter-apply-btn", L.textContent = "Apply", L.addEventListener("click", () => {
|
|
1747
|
+
const m = k.value, R = b.value;
|
|
1748
|
+
m && R ? t.applyTextFilter("between", m, R) : m ? t.applyTextFilter("greaterThanOrEqual", m) : R ? t.applyTextFilter("lessThanOrEqual", R) : t.clearFilter();
|
|
1749
|
+
}), E.appendChild(L);
|
|
1750
|
+
const C = document.createElement("button");
|
|
1751
|
+
C.className = "tbw-filter-clear-btn", C.textContent = "Clear Filter", C.addEventListener("click", () => {
|
|
1752
|
+
t.clearFilter();
|
|
1753
|
+
}), E.appendChild(C), e.appendChild(E);
|
|
1639
1754
|
}
|
|
1640
1755
|
applySetFilter(e, t) {
|
|
1641
1756
|
this.excludedValues.set(e, new Set(t)), t.length === 0 ? this.filters.delete(e) : this.filters.set(e, {
|
|
@@ -1701,7 +1816,7 @@ class T extends R {
|
|
|
1701
1816
|
this.filters.set(e, i), this.cachedResult = null, this.cacheKey = null;
|
|
1702
1817
|
}
|
|
1703
1818
|
}
|
|
1704
|
-
function
|
|
1819
|
+
function Ie(s) {
|
|
1705
1820
|
if (!s.length) return [];
|
|
1706
1821
|
const e = /* @__PURE__ */ new Map(), t = [], i = (o, a) => {
|
|
1707
1822
|
if (!a.length) return;
|
|
@@ -1736,7 +1851,7 @@ function Se(s) {
|
|
|
1736
1851
|
}, e.set(d, c), t.push(c)), c.columns.push(o);
|
|
1737
1852
|
}), n.length && i(r, n), t.length === 1 && t[0].implicit && t[0].columns.length === s.length ? [] : t;
|
|
1738
1853
|
}
|
|
1739
|
-
function
|
|
1854
|
+
function Vt(s, e, t) {
|
|
1740
1855
|
if (!e.length || !s) return;
|
|
1741
1856
|
const i = /* @__PURE__ */ new Map();
|
|
1742
1857
|
for (const r of e)
|
|
@@ -1752,7 +1867,7 @@ function Mt(s, e, t) {
|
|
|
1752
1867
|
a && a.classList.add("group-end");
|
|
1753
1868
|
}
|
|
1754
1869
|
}
|
|
1755
|
-
function
|
|
1870
|
+
function Wt(s, e) {
|
|
1756
1871
|
if (s.length === 0) return null;
|
|
1757
1872
|
const t = document.createElement("div");
|
|
1758
1873
|
t.className = "header-group-row", t.setAttribute("role", "row");
|
|
@@ -1764,11 +1879,11 @@ function qt(s, e) {
|
|
|
1764
1879
|
}
|
|
1765
1880
|
return t;
|
|
1766
1881
|
}
|
|
1767
|
-
function
|
|
1882
|
+
function $t(s) {
|
|
1768
1883
|
return s.some((e) => e.group != null);
|
|
1769
1884
|
}
|
|
1770
|
-
const
|
|
1771
|
-
class
|
|
1885
|
+
const jt = "@layer tbw-plugins{.header-group-row{display:grid;grid-auto-flow:column;background:var(--tbw-grouping-columns-header-bg, var(--tbw-color-header-bg));border-bottom:1px solid var(--tbw-grouping-columns-border, var(--tbw-color-border))}.header-group-cell{display:flex;align-items:center;justify-content:center;padding:var(--tbw-button-padding-sm, .25rem .5rem);font-weight:600;font-size:var(--tbw-font-size-sm, .9em);text-transform:uppercase;letter-spacing:.5px;border-right:2px solid var(--tbw-grouping-columns-separator, var(--tbw-color-border-strong, var(--tbw-color-border)))}.header-group-cell:last-child{border-right:none}.header-row .cell.grouped{border-top:none}.header-row .cell.group-end{border-right:2px solid var(--tbw-grouping-columns-separator, var(--tbw-color-border-strong, var(--tbw-color-border)))}.header-row .cell.group-end:last-child{border-right:none}.rows .cell.group-end{border-right:2px solid var(--tbw-grouping-columns-separator, var(--tbw-color-border-strong, var(--tbw-color-border)))}.rows .cell.group-end:last-child{border-right:none}.header-group-row.no-borders{border-bottom:none}.header-group-row.no-borders .header-group-cell{border-right:none}.header-row.no-group-borders .cell.group-end{border-right:1px solid var(--tbw-color-border)}}";
|
|
1886
|
+
class mn extends _ {
|
|
1772
1887
|
static manifest = {
|
|
1773
1888
|
ownedProperties: [
|
|
1774
1889
|
{
|
|
@@ -1785,7 +1900,7 @@ class sn extends R {
|
|
|
1785
1900
|
]
|
|
1786
1901
|
};
|
|
1787
1902
|
name = "groupingColumns";
|
|
1788
|
-
styles =
|
|
1903
|
+
styles = jt;
|
|
1789
1904
|
get defaultConfig() {
|
|
1790
1905
|
return {
|
|
1791
1906
|
showGroupBorders: !0
|
|
@@ -1800,7 +1915,7 @@ class sn extends R {
|
|
|
1800
1915
|
if (t?.columnGroups && Array.isArray(t.columnGroups) && t.columnGroups.length > 0)
|
|
1801
1916
|
return !0;
|
|
1802
1917
|
const i = t?.columns;
|
|
1803
|
-
return Array.isArray(i) ?
|
|
1918
|
+
return Array.isArray(i) ? $t(i) : !1;
|
|
1804
1919
|
}
|
|
1805
1920
|
processColumns(e) {
|
|
1806
1921
|
const t = this.grid?.gridConfig?.columnGroups;
|
|
@@ -1816,7 +1931,7 @@ class sn extends R {
|
|
|
1816
1931
|
});
|
|
1817
1932
|
} else
|
|
1818
1933
|
i = [...e];
|
|
1819
|
-
const n =
|
|
1934
|
+
const n = Ie(i);
|
|
1820
1935
|
return n.length === 0 ? (this.isActive = !1, this.groups = [], i) : (this.isActive = !0, this.groups = n, i);
|
|
1821
1936
|
}
|
|
1822
1937
|
afterRender() {
|
|
@@ -1829,16 +1944,16 @@ class sn extends R {
|
|
|
1829
1944
|
if (!e) return;
|
|
1830
1945
|
const t = e.querySelector(".header-group-row");
|
|
1831
1946
|
t && t.remove();
|
|
1832
|
-
const i = this.columns, n =
|
|
1947
|
+
const i = this.columns, n = Ie(i);
|
|
1833
1948
|
if (n.length === 0) return;
|
|
1834
|
-
const r =
|
|
1949
|
+
const r = Wt(n, i);
|
|
1835
1950
|
if (r) {
|
|
1836
1951
|
r.classList.toggle("no-borders", !this.config.showGroupBorders);
|
|
1837
1952
|
const a = e.querySelector(".header-row");
|
|
1838
1953
|
a ? e.insertBefore(r, a) : e.appendChild(r);
|
|
1839
1954
|
}
|
|
1840
1955
|
const o = e.querySelector(".header-row");
|
|
1841
|
-
o && (o.classList.toggle("no-group-borders", !this.config.showGroupBorders),
|
|
1956
|
+
o && (o.classList.toggle("no-group-borders", !this.config.showGroupBorders), Vt(o, n)), this.#e(n);
|
|
1842
1957
|
}
|
|
1843
1958
|
#e(e) {
|
|
1844
1959
|
if (!this.config.showGroupBorders) return;
|
|
@@ -1869,66 +1984,94 @@ class sn extends R {
|
|
|
1869
1984
|
this.requestRender();
|
|
1870
1985
|
}
|
|
1871
1986
|
}
|
|
1872
|
-
function
|
|
1873
|
-
const
|
|
1874
|
-
if (typeof
|
|
1987
|
+
function Pe({ rows: s, config: e, expanded: t, initialExpanded: i }) {
|
|
1988
|
+
const n = e.groupOn;
|
|
1989
|
+
if (typeof n != "function")
|
|
1875
1990
|
return [];
|
|
1876
|
-
const
|
|
1877
|
-
if (s.forEach((
|
|
1878
|
-
let
|
|
1879
|
-
|
|
1880
|
-
let
|
|
1881
|
-
|
|
1882
|
-
const
|
|
1883
|
-
let
|
|
1884
|
-
|
|
1885
|
-
}),
|
|
1886
|
-
}),
|
|
1991
|
+
const r = { key: "__root__", value: null, depth: -1, rows: [], children: /* @__PURE__ */ new Map() };
|
|
1992
|
+
if (s.forEach((d) => {
|
|
1993
|
+
let c = n(d);
|
|
1994
|
+
c == null || c === !1 ? c = ["__ungrouped__"] : Array.isArray(c) || (c = [c]);
|
|
1995
|
+
let u = r;
|
|
1996
|
+
c.forEach((h, g) => {
|
|
1997
|
+
const f = h == null ? "∅" : String(h), p = u.key === "__root__" ? f : u.key + "||" + f;
|
|
1998
|
+
let w = u.children.get(f);
|
|
1999
|
+
w || (w = { key: p, value: h, depth: g, rows: [], children: /* @__PURE__ */ new Map(), parent: u }, u.children.set(f, w)), u = w;
|
|
2000
|
+
}), u.rows.push(d);
|
|
2001
|
+
}), r.children.size === 1 && r.children.has("__ungrouped__") && r.children.get("__ungrouped__").rows.length === s.length)
|
|
1887
2002
|
return [];
|
|
1888
|
-
const
|
|
1889
|
-
if (
|
|
1890
|
-
|
|
2003
|
+
const o = /* @__PURE__ */ new Set([...t, ...i ?? []]), a = [], l = (d) => {
|
|
2004
|
+
if (d === r) {
|
|
2005
|
+
d.children.forEach((u) => l(u));
|
|
1891
2006
|
return;
|
|
1892
2007
|
}
|
|
1893
|
-
const
|
|
1894
|
-
|
|
2008
|
+
const c = o.has(d.key);
|
|
2009
|
+
a.push({
|
|
1895
2010
|
kind: "group",
|
|
1896
|
-
key:
|
|
1897
|
-
value:
|
|
1898
|
-
depth:
|
|
1899
|
-
rows:
|
|
1900
|
-
expanded:
|
|
1901
|
-
}),
|
|
2011
|
+
key: d.key,
|
|
2012
|
+
value: d.value,
|
|
2013
|
+
depth: d.depth,
|
|
2014
|
+
rows: d.rows,
|
|
2015
|
+
expanded: c
|
|
2016
|
+
}), c && (d.children.size ? d.children.forEach((u) => l(u)) : d.rows.forEach((u) => a.push({ kind: "data", row: u, rowIndex: s.indexOf(u) })));
|
|
1902
2017
|
};
|
|
1903
|
-
return
|
|
2018
|
+
return l(r), a;
|
|
1904
2019
|
}
|
|
1905
|
-
function
|
|
2020
|
+
function Ut(s, e) {
|
|
1906
2021
|
const t = new Set(s);
|
|
1907
2022
|
return t.has(e) ? t.delete(e) : t.add(e), t;
|
|
1908
2023
|
}
|
|
1909
|
-
function
|
|
2024
|
+
function Yt(s) {
|
|
1910
2025
|
const e = /* @__PURE__ */ new Set();
|
|
1911
2026
|
for (const t of s)
|
|
1912
2027
|
t.kind === "group" && e.add(t.key);
|
|
1913
2028
|
return e;
|
|
1914
2029
|
}
|
|
1915
|
-
function
|
|
2030
|
+
function Xt() {
|
|
1916
2031
|
return /* @__PURE__ */ new Set();
|
|
1917
2032
|
}
|
|
1918
|
-
function
|
|
2033
|
+
function Zt(s, e) {
|
|
2034
|
+
if (s === !0)
|
|
2035
|
+
return new Set(e);
|
|
2036
|
+
if (s === !1 || s == null)
|
|
2037
|
+
return /* @__PURE__ */ new Set();
|
|
2038
|
+
if (typeof s == "number") {
|
|
2039
|
+
const t = e[s];
|
|
2040
|
+
return t ? /* @__PURE__ */ new Set([t]) : /* @__PURE__ */ new Set();
|
|
2041
|
+
}
|
|
2042
|
+
return typeof s == "string" ? /* @__PURE__ */ new Set([s]) : Array.isArray(s) ? new Set(s) : /* @__PURE__ */ new Set();
|
|
2043
|
+
}
|
|
2044
|
+
function Jt(s) {
|
|
2045
|
+
return s.filter((e) => e.kind === "group").map((e) => e.key);
|
|
2046
|
+
}
|
|
2047
|
+
function Qt(s) {
|
|
1919
2048
|
return s.kind !== "group" ? 0 : s.rows.length;
|
|
1920
2049
|
}
|
|
1921
|
-
const
|
|
1922
|
-
class
|
|
2050
|
+
const ei = "@layer tbw-plugins{.group-row{display:grid;grid-template-columns:var(--tbw-column-template);background:var(--tbw-grouping-rows-bg, var(--tbw-color-panel-bg));font-weight:500;border-bottom:var(--tbw-row-divider);min-height:var(--tbw-row-height)}.group-row .cell{display:flex;align-items:center;padding:var(--tbw-cell-padding, .125rem .5rem)}.group-row:hover{background:var(--tbw-grouping-rows-bg-hover, var(--tbw-color-row-hover))}.group-toggle{cursor:pointer;user-select:none;display:inline-flex;align-items:center;justify-content:center;width:var(--tbw-toggle-size, 1.25rem);height:var(--tbw-toggle-size, 1.25rem);margin-right:.25rem;background:none;border:0;font:inherit}.group-toggle:hover{background:var(--tbw-grouping-rows-toggle-hover, var(--tbw-color-row-hover));border-radius:var(--tbw-border-radius, .125rem)}.group-label{display:inline-flex;align-items:center;gap:var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem))}.group-count{color:var(--tbw-grouping-rows-count-color, var(--tbw-color-fg-muted));font-size:var(--tbw-font-size-xs, .85em);font-weight:400}.group-aggregates{display:inline-flex;align-items:center;gap:var(--tbw-spacing-lg, 1rem);margin-left:var(--tbw-spacing-lg, 1rem);font-weight:400;font-size:var(--tbw-font-size-sm, .875em);color:var(--tbw-grouping-rows-aggregate-color, var(--tbw-color-fg-muted))}.group-aggregate{white-space:nowrap}.group-row{padding-left:calc(var(--tbw-group-depth, 0) * var(--tbw-group-indent-width, 1.25em))}.data-grid-row.tbw-group-slide-in{animation:tbw-group-slide-in var(--tbw-animation-duration, .2s) var(--tbw-animation-easing, ease-out) forwards}@keyframes tbw-group-slide-in{0%{opacity:0;transform:translate(-8px)}to{opacity:1;transform:translate(0)}}.data-grid-row.tbw-group-fade-in{animation:tbw-group-fade-in var(--tbw-animation-duration, .2s) var(--tbw-animation-easing, ease-out) forwards}@keyframes tbw-group-fade-in{0%{opacity:0}to{opacity:1}}}";
|
|
2051
|
+
class wn extends _ {
|
|
2052
|
+
static manifest = {
|
|
2053
|
+
configRules: [
|
|
2054
|
+
{
|
|
2055
|
+
id: "groupingRows/accordion-defaultExpanded",
|
|
2056
|
+
severity: "warn",
|
|
2057
|
+
message: `"accordion: true" and "defaultExpanded" (non-false) are used together.
|
|
2058
|
+
→ In accordion mode, only one group can be open at a time.
|
|
2059
|
+
→ Using defaultExpanded with multiple groups will collapse to one on first toggle.
|
|
2060
|
+
→ Consider using "defaultExpanded: false" or a single group key/index with accordion mode.`,
|
|
2061
|
+
check: (e) => e.accordion === !0 && e.defaultExpanded !== !1 && e.defaultExpanded !== void 0 && typeof e.defaultExpanded != "number" && typeof e.defaultExpanded != "string" && (e.defaultExpanded === !0 || Array.isArray(e.defaultExpanded) && e.defaultExpanded.length > 1)
|
|
2062
|
+
}
|
|
2063
|
+
]
|
|
2064
|
+
};
|
|
1923
2065
|
name = "groupingRows";
|
|
1924
|
-
styles =
|
|
2066
|
+
styles = ei;
|
|
1925
2067
|
get defaultConfig() {
|
|
1926
2068
|
return {
|
|
1927
2069
|
defaultExpanded: !1,
|
|
1928
2070
|
showRowCount: !0,
|
|
1929
2071
|
indentWidth: 20,
|
|
1930
2072
|
aggregators: {},
|
|
1931
|
-
animation: "slide"
|
|
2073
|
+
animation: "slide",
|
|
2074
|
+
accordion: !1
|
|
1932
2075
|
};
|
|
1933
2076
|
}
|
|
1934
2077
|
expandedKeys = /* @__PURE__ */ new Set();
|
|
@@ -1936,11 +2079,12 @@ class an extends R {
|
|
|
1936
2079
|
isActive = !1;
|
|
1937
2080
|
previousVisibleKeys = /* @__PURE__ */ new Set();
|
|
1938
2081
|
keysToAnimate = /* @__PURE__ */ new Set();
|
|
2082
|
+
hasAppliedDefaultExpanded = !1;
|
|
1939
2083
|
get animationStyle() {
|
|
1940
2084
|
return this.isAnimationEnabled ? this.config.animation ?? "slide" : !1;
|
|
1941
2085
|
}
|
|
1942
2086
|
detach() {
|
|
1943
|
-
this.expandedKeys.clear(), this.flattenedRows = [], this.isActive = !1, this.previousVisibleKeys.clear(), this.keysToAnimate.clear();
|
|
2087
|
+
this.expandedKeys.clear(), this.flattenedRows = [], this.isActive = !1, this.previousVisibleKeys.clear(), this.keysToAnimate.clear(), this.hasAppliedDefaultExpanded = !1;
|
|
1944
2088
|
}
|
|
1945
2089
|
static detect(e, t) {
|
|
1946
2090
|
return typeof t?.groupOn == "function" || typeof t?.enableRowGrouping == "boolean";
|
|
@@ -1949,29 +2093,40 @@ class an extends R {
|
|
|
1949
2093
|
const t = this.config;
|
|
1950
2094
|
if (typeof t.groupOn != "function")
|
|
1951
2095
|
return this.isActive = !1, this.flattenedRows = [], [...e];
|
|
1952
|
-
const i =
|
|
2096
|
+
const i = Pe({
|
|
1953
2097
|
rows: [...e],
|
|
1954
2098
|
config: t,
|
|
1955
|
-
expanded:
|
|
2099
|
+
expanded: /* @__PURE__ */ new Set()
|
|
1956
2100
|
});
|
|
1957
2101
|
if (i.length === 0)
|
|
1958
2102
|
return this.isActive = !1, this.flattenedRows = [], [...e];
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
2103
|
+
let n;
|
|
2104
|
+
if (!this.hasAppliedDefaultExpanded && this.expandedKeys.size === 0 && t.defaultExpanded !== !1) {
|
|
2105
|
+
const a = Jt(i);
|
|
2106
|
+
n = Zt(t.defaultExpanded ?? !1, a), n.size > 0 && (this.expandedKeys = new Set(n), this.hasAppliedDefaultExpanded = !0);
|
|
2107
|
+
}
|
|
2108
|
+
const r = Pe({
|
|
2109
|
+
rows: [...e],
|
|
2110
|
+
config: t,
|
|
2111
|
+
expanded: this.expandedKeys,
|
|
2112
|
+
initialExpanded: n
|
|
2113
|
+
});
|
|
2114
|
+
this.isActive = !0, this.flattenedRows = r, this.keysToAnimate.clear();
|
|
2115
|
+
const o = /* @__PURE__ */ new Set();
|
|
2116
|
+
return r.forEach((a, l) => {
|
|
2117
|
+
if (a.kind === "data") {
|
|
2118
|
+
const d = `data-${l}`;
|
|
2119
|
+
o.add(d), this.previousVisibleKeys.has(d) || this.keysToAnimate.add(d);
|
|
1965
2120
|
}
|
|
1966
|
-
}), this.previousVisibleKeys =
|
|
2121
|
+
}), this.previousVisibleKeys = o, r.map((a) => a.kind === "group" ? {
|
|
1967
2122
|
__isGroupRow: !0,
|
|
1968
|
-
__groupKey:
|
|
1969
|
-
__groupValue:
|
|
1970
|
-
__groupDepth:
|
|
1971
|
-
__groupRows:
|
|
1972
|
-
__groupExpanded:
|
|
1973
|
-
__groupRowCount:
|
|
1974
|
-
} :
|
|
2123
|
+
__groupKey: a.key,
|
|
2124
|
+
__groupValue: a.value,
|
|
2125
|
+
__groupDepth: a.depth,
|
|
2126
|
+
__groupRows: a.rows,
|
|
2127
|
+
__groupExpanded: a.expanded,
|
|
2128
|
+
__groupRowCount: Qt(a)
|
|
2129
|
+
} : a.row);
|
|
1975
2130
|
}
|
|
1976
2131
|
onCellClick(e) {
|
|
1977
2132
|
const t = e.row;
|
|
@@ -2030,14 +2185,29 @@ class an extends R {
|
|
|
2030
2185
|
return n.formatLabel ? n.formatLabel(e, t, i) : String(e);
|
|
2031
2186
|
}
|
|
2032
2187
|
renderFullWidthGroupRow(e, t, i) {
|
|
2033
|
-
const n = this.config, r = document.createElement("div");
|
|
2034
|
-
|
|
2035
|
-
const
|
|
2036
|
-
if (
|
|
2037
|
-
const
|
|
2038
|
-
|
|
2188
|
+
const n = this.config, r = n.aggregators ?? {}, o = e.__groupRows ?? [], a = document.createElement("div");
|
|
2189
|
+
a.className = "cell group-full", a.style.gridColumn = "1 / -1", a.setAttribute("role", "gridcell"), a.setAttribute("data-col", "0"), a.appendChild(this.createToggleButton(e.__groupExpanded, i));
|
|
2190
|
+
const l = document.createElement("span");
|
|
2191
|
+
if (l.className = "group-label", l.textContent = this.getGroupLabelText(e.__groupValue, e.__groupDepth || 0, e.__groupKey), a.appendChild(l), n.showRowCount !== !1) {
|
|
2192
|
+
const c = document.createElement("span");
|
|
2193
|
+
c.className = "group-count", c.textContent = `(${e.__groupRowCount ?? e.__groupRows?.length ?? 0})`, a.appendChild(c);
|
|
2194
|
+
}
|
|
2195
|
+
const d = Object.entries(r);
|
|
2196
|
+
if (d.length > 0) {
|
|
2197
|
+
const c = document.createElement("span");
|
|
2198
|
+
c.className = "group-aggregates";
|
|
2199
|
+
for (const [u, h] of d) {
|
|
2200
|
+
const g = this.columns.find((p) => p.field === u), f = te(h, o, u, g);
|
|
2201
|
+
if (f != null) {
|
|
2202
|
+
const p = document.createElement("span");
|
|
2203
|
+
p.className = "group-aggregate", p.setAttribute("data-field", u);
|
|
2204
|
+
const w = g?.header ?? u;
|
|
2205
|
+
p.textContent = `${w}: ${f}`, c.appendChild(p);
|
|
2206
|
+
}
|
|
2207
|
+
}
|
|
2208
|
+
c.children.length > 0 && a.appendChild(c);
|
|
2039
2209
|
}
|
|
2040
|
-
t.appendChild(
|
|
2210
|
+
t.appendChild(a);
|
|
2041
2211
|
}
|
|
2042
2212
|
renderPerColumnGroupRow(e, t, i) {
|
|
2043
2213
|
const n = this.config, r = n.aggregators ?? {}, o = this.columns, a = e.__groupRows ?? [], d = this.gridElement?.querySelector(".body")?.style.gridTemplateColumns || "";
|
|
@@ -2045,14 +2215,14 @@ class an extends R {
|
|
|
2045
2215
|
let c = !1;
|
|
2046
2216
|
o.forEach((u, h) => {
|
|
2047
2217
|
const g = document.createElement("div");
|
|
2048
|
-
if (g.className = "cell group-cell", g.setAttribute("data-col", String(h)), g.setAttribute("role", "gridcell"),
|
|
2218
|
+
if (g.className = "cell group-cell", g.setAttribute("data-col", String(h)), g.setAttribute("role", "gridcell"), pe(u)) {
|
|
2049
2219
|
g.setAttribute("data-field", u.field), t.appendChild(g);
|
|
2050
2220
|
return;
|
|
2051
2221
|
}
|
|
2052
2222
|
if (c) {
|
|
2053
2223
|
const f = r[u.field];
|
|
2054
2224
|
if (f) {
|
|
2055
|
-
const p =
|
|
2225
|
+
const p = te(f, a, u.field, u);
|
|
2056
2226
|
g.textContent = p != null ? String(p) : "";
|
|
2057
2227
|
} else
|
|
2058
2228
|
g.textContent = "";
|
|
@@ -2060,32 +2230,43 @@ class an extends R {
|
|
|
2060
2230
|
c = !0, g.appendChild(this.createToggleButton(e.__groupExpanded, i));
|
|
2061
2231
|
const f = document.createElement("span"), p = r[u.field];
|
|
2062
2232
|
if (p) {
|
|
2063
|
-
const
|
|
2064
|
-
f.textContent =
|
|
2233
|
+
const w = te(p, a, u.field, u);
|
|
2234
|
+
f.textContent = w != null ? String(w) : String(e.__groupValue);
|
|
2065
2235
|
} else
|
|
2066
2236
|
f.textContent = this.getGroupLabelText(e.__groupValue, e.__groupDepth || 0, e.__groupKey);
|
|
2067
2237
|
if (g.appendChild(f), n.showRowCount !== !1) {
|
|
2068
|
-
const
|
|
2069
|
-
|
|
2238
|
+
const w = document.createElement("span");
|
|
2239
|
+
w.className = "group-count", w.textContent = ` (${a.length})`, g.appendChild(w);
|
|
2070
2240
|
}
|
|
2071
2241
|
}
|
|
2072
2242
|
t.appendChild(g);
|
|
2073
2243
|
});
|
|
2074
2244
|
}
|
|
2075
2245
|
expandAll() {
|
|
2076
|
-
this.expandedKeys =
|
|
2246
|
+
this.expandedKeys = Yt(this.flattenedRows), this.requestRender();
|
|
2077
2247
|
}
|
|
2078
2248
|
collapseAll() {
|
|
2079
|
-
this.expandedKeys =
|
|
2249
|
+
this.expandedKeys = Xt(), this.requestRender();
|
|
2080
2250
|
}
|
|
2081
2251
|
toggle(e) {
|
|
2082
|
-
this.expandedKeys =
|
|
2083
|
-
|
|
2252
|
+
const t = !this.expandedKeys.has(e), i = this.config, n = this.flattenedRows.find((r) => r.kind === "group" && r.key === e);
|
|
2253
|
+
if (i.accordion && t && n) {
|
|
2254
|
+
const r = /* @__PURE__ */ new Set();
|
|
2255
|
+
for (const o of this.expandedKeys)
|
|
2256
|
+
if (e.startsWith(o + "||") || o.startsWith(e + "||"))
|
|
2257
|
+
e.startsWith(o + "||") && r.add(o);
|
|
2258
|
+
else {
|
|
2259
|
+
const a = this.flattenedRows.find((l) => l.kind === "group" && l.key === o);
|
|
2260
|
+
a && a.depth !== n.depth && r.add(o);
|
|
2261
|
+
}
|
|
2262
|
+
r.add(e), this.expandedKeys = r;
|
|
2263
|
+
} else
|
|
2264
|
+
this.expandedKeys = Ut(this.expandedKeys, e);
|
|
2084
2265
|
this.emit("group-toggle", {
|
|
2085
2266
|
key: e,
|
|
2086
2267
|
expanded: this.expandedKeys.has(e),
|
|
2087
|
-
value:
|
|
2088
|
-
depth:
|
|
2268
|
+
value: n?.value,
|
|
2269
|
+
depth: n?.depth ?? 0
|
|
2089
2270
|
}), this.requestRender();
|
|
2090
2271
|
}
|
|
2091
2272
|
isExpanded(e) {
|
|
@@ -2128,22 +2309,22 @@ class an extends R {
|
|
|
2128
2309
|
this.config.groupOn = e, this.requestRender();
|
|
2129
2310
|
}
|
|
2130
2311
|
}
|
|
2131
|
-
function
|
|
2312
|
+
function De(s, e) {
|
|
2132
2313
|
const t = new Set(s);
|
|
2133
2314
|
return t.has(e) ? t.delete(e) : t.add(e), t;
|
|
2134
2315
|
}
|
|
2135
|
-
function
|
|
2316
|
+
function ti(s, e) {
|
|
2136
2317
|
const t = new Set(s);
|
|
2137
2318
|
return t.add(e), t;
|
|
2138
2319
|
}
|
|
2139
|
-
function
|
|
2320
|
+
function ii(s, e) {
|
|
2140
2321
|
const t = new Set(s);
|
|
2141
2322
|
return t.delete(e), t;
|
|
2142
2323
|
}
|
|
2143
|
-
function
|
|
2324
|
+
function ni(s, e) {
|
|
2144
2325
|
return s.has(e);
|
|
2145
2326
|
}
|
|
2146
|
-
function
|
|
2327
|
+
function ri(s, e, t, i) {
|
|
2147
2328
|
const n = document.createElement("div");
|
|
2148
2329
|
n.className = "master-detail-row", n.setAttribute("data-detail-for", String(e)), n.setAttribute("role", "row");
|
|
2149
2330
|
const r = document.createElement("div");
|
|
@@ -2151,10 +2332,10 @@ function Ut(s, e, t, i) {
|
|
|
2151
2332
|
const o = t(s, e);
|
|
2152
2333
|
return typeof o == "string" ? r.innerHTML = o : o instanceof HTMLElement && r.appendChild(o), n.appendChild(r), n;
|
|
2153
2334
|
}
|
|
2154
|
-
const
|
|
2155
|
-
class
|
|
2335
|
+
const oi = "@layer tbw-plugins{tbw-grid{.cell[data-field=__tbw_expander]{border-right:none!important;padding:0;display:flex;align-items:center;justify-content:center}.header-row .cell[data-field=__tbw_expander]{display:none}.header-row .cell[data-field=__tbw_expander]+.cell{grid-column:1 / 3}.master-detail-expander{display:flex;align-items:center;justify-content:center;width:100%;height:100%}.master-detail-toggle{cursor:pointer;opacity:.7;user-select:none;display:inline-flex;align-items:center;justify-content:center}.master-detail-toggle:hover{opacity:1}.master-detail-row{grid-column:1 / -1;display:grid;background:var(--tbw-master-detail-bg, var(--tbw-color-row-alt));border-bottom:1px solid var(--tbw-master-detail-border, var(--tbw-color-border));overflow:hidden}.master-detail-cell{padding:var(--tbw-detail-padding, var(--tbw-spacing-xl, 1rem));overflow:auto}.master-detail-row.tbw-expanding{animation:tbw-detail-expand var(--tbw-animation-duration, .2s) var(--tbw-animation-easing, ease-out) forwards}.master-detail-row.tbw-collapsing{animation:tbw-detail-collapse var(--tbw-animation-duration, .2s) var(--tbw-animation-easing, ease-out) forwards}}@keyframes tbw-detail-expand{0%{opacity:0;max-height:0;padding-top:0;padding-bottom:0}to{opacity:1;max-height:var(--tbw-detail-max-height, 31.25rem);padding-top:var(--tbw-detail-padding, var(--tbw-spacing-xl, 1rem));padding-bottom:var(--tbw-detail-padding, var(--tbw-spacing-xl, 1rem))}}@keyframes tbw-detail-collapse{0%{opacity:1;max-height:var(--tbw-detail-max-height, 31.25rem)}to{opacity:0;max-height:0}}}";
|
|
2336
|
+
class et extends _ {
|
|
2156
2337
|
name = "masterDetail";
|
|
2157
|
-
styles =
|
|
2338
|
+
styles = oi;
|
|
2158
2339
|
get defaultConfig() {
|
|
2159
2340
|
return {
|
|
2160
2341
|
detailHeight: "auto",
|
|
@@ -2183,8 +2364,8 @@ class $e extends R {
|
|
|
2183
2364
|
n !== null && (d.animation = n === "false" ? !1 : n), r !== null && (d.showExpandColumn = r !== "false"), o !== null && (d.expandOnRowClick = o === "true"), a !== null && (d.collapseOnClickOutside = a === "true"), l !== null && (d.detailHeight = l === "auto" ? "auto" : parseInt(l, 10));
|
|
2184
2365
|
const c = t.innerHTML.trim();
|
|
2185
2366
|
c && !this.config.detailRenderer && (d.detailRenderer = (u, h) => {
|
|
2186
|
-
const g =
|
|
2187
|
-
return
|
|
2367
|
+
const g = lt(c, { value: u, row: u });
|
|
2368
|
+
return dt(g);
|
|
2188
2369
|
}), Object.keys(d).length > 0 && (this.config = { ...this.config, ...d });
|
|
2189
2370
|
}
|
|
2190
2371
|
get animationStyle() {
|
|
@@ -2215,10 +2396,10 @@ class $e extends R {
|
|
|
2215
2396
|
static DEFAULT_DETAIL_HEIGHT = 150;
|
|
2216
2397
|
getDetailHeight(e) {
|
|
2217
2398
|
const t = this.detailElements.get(e);
|
|
2218
|
-
return t ? t.offsetHeight : typeof this.config?.detailHeight == "number" ? this.config.detailHeight :
|
|
2399
|
+
return t ? t.offsetHeight : typeof this.config?.detailHeight == "number" ? this.config.detailHeight : et.DEFAULT_DETAIL_HEIGHT;
|
|
2219
2400
|
}
|
|
2220
2401
|
toggleAndEmit(e, t) {
|
|
2221
|
-
this.expandedRows =
|
|
2402
|
+
this.expandedRows = De(this.expandedRows, e), this.emit("detail-expand", {
|
|
2222
2403
|
rowIndex: t,
|
|
2223
2404
|
row: e,
|
|
2224
2405
|
expanded: this.expandedRows.has(e)
|
|
@@ -2231,9 +2412,9 @@ class $e extends R {
|
|
|
2231
2412
|
if (!(this.config.showExpandColumn === !0 || this.config.showExpandColumn !== !1 && !!this.config.detailRenderer))
|
|
2232
2413
|
return [...e];
|
|
2233
2414
|
const i = [...e];
|
|
2234
|
-
if (
|
|
2415
|
+
if (gt(i))
|
|
2235
2416
|
return i;
|
|
2236
|
-
const r =
|
|
2417
|
+
const r = ft(this.name);
|
|
2237
2418
|
return r.viewRenderer = (o) => {
|
|
2238
2419
|
const { row: a } = o, l = this.expandedRows.has(a), d = document.createElement("span");
|
|
2239
2420
|
d.className = "master-detail-expander expander-cell";
|
|
@@ -2253,7 +2434,7 @@ class $e extends R {
|
|
|
2253
2434
|
onKeyDown(e) {
|
|
2254
2435
|
if (e.key !== " ") return;
|
|
2255
2436
|
const t = this.grid._focusCol, i = this.grid._focusRow, n = this.columns[t];
|
|
2256
|
-
if (!n || !
|
|
2437
|
+
if (!n || !pe(n)) return;
|
|
2257
2438
|
const r = this.rows[i];
|
|
2258
2439
|
if (r)
|
|
2259
2440
|
return e.preventDefault(), this.toggleAndEmit(r, i), this.requestRenderWithFocus(), !0;
|
|
@@ -2286,7 +2467,7 @@ class $e extends R {
|
|
|
2286
2467
|
d.previousElementSibling !== a && a.after(d);
|
|
2287
2468
|
continue;
|
|
2288
2469
|
}
|
|
2289
|
-
const c =
|
|
2470
|
+
const c = ri(l, o, this.config.detailRenderer, n);
|
|
2290
2471
|
typeof this.config.detailHeight == "number" && (c.style.height = `${this.config.detailHeight}px`), a.after(c), this.detailElements.set(l, c), this.animateExpand(c);
|
|
2291
2472
|
}
|
|
2292
2473
|
}
|
|
@@ -2321,19 +2502,19 @@ class $e extends R {
|
|
|
2321
2502
|
}
|
|
2322
2503
|
expand(e) {
|
|
2323
2504
|
const t = this.rows[e];
|
|
2324
|
-
t && (this.expandedRows =
|
|
2505
|
+
t && (this.expandedRows = ti(this.expandedRows, t), this.requestRender());
|
|
2325
2506
|
}
|
|
2326
2507
|
collapse(e) {
|
|
2327
2508
|
const t = this.rows[e];
|
|
2328
|
-
t && (this.expandedRows =
|
|
2509
|
+
t && (this.expandedRows = ii(this.expandedRows, t), this.requestRender());
|
|
2329
2510
|
}
|
|
2330
2511
|
toggle(e) {
|
|
2331
2512
|
const t = this.rows[e];
|
|
2332
|
-
t && (this.expandedRows =
|
|
2513
|
+
t && (this.expandedRows = De(this.expandedRows, t), this.requestRender());
|
|
2333
2514
|
}
|
|
2334
2515
|
isExpanded(e) {
|
|
2335
2516
|
const t = this.rows[e];
|
|
2336
|
-
return t ?
|
|
2517
|
+
return t ? ni(this.expandedRows, t) : !1;
|
|
2337
2518
|
}
|
|
2338
2519
|
expandAll() {
|
|
2339
2520
|
for (const e of this.rows)
|
|
@@ -2363,34 +2544,34 @@ class $e extends R {
|
|
|
2363
2544
|
}
|
|
2364
2545
|
}
|
|
2365
2546
|
}
|
|
2366
|
-
function
|
|
2547
|
+
function si(s, e, t) {
|
|
2367
2548
|
return e.length ? [...s].sort((i, n) => {
|
|
2368
2549
|
for (const r of e) {
|
|
2369
|
-
const a = t.find((u) => u.field === r.field)?.sortComparator ??
|
|
2550
|
+
const a = t.find((u) => u.field === r.field)?.sortComparator ?? ai, l = i[r.field], d = n[r.field], c = a(l, d, i, n);
|
|
2370
2551
|
if (c !== 0)
|
|
2371
2552
|
return r.direction === "asc" ? c : -c;
|
|
2372
2553
|
}
|
|
2373
2554
|
return 0;
|
|
2374
2555
|
}) : [...s];
|
|
2375
2556
|
}
|
|
2376
|
-
function
|
|
2557
|
+
function ai(s, e) {
|
|
2377
2558
|
return s == null && e == null ? 0 : s == null ? 1 : e == null ? -1 : typeof s == "number" && typeof e == "number" ? s - e : s instanceof Date && e instanceof Date ? s.getTime() - e.getTime() : typeof s == "boolean" && typeof e == "boolean" ? s === e ? 0 : s ? -1 : 1 : String(s).localeCompare(String(e));
|
|
2378
2559
|
}
|
|
2379
|
-
function
|
|
2560
|
+
function li(s, e, t, i) {
|
|
2380
2561
|
const n = s.find((r) => r.field === e);
|
|
2381
2562
|
return t ? n ? n.direction === "asc" ? s.map((r) => r.field === e ? { ...r, direction: "desc" } : r) : s.filter((r) => r.field !== e) : s.length < i ? [...s, { field: e, direction: "asc" }] : s : n?.direction === "asc" ? [{ field: e, direction: "desc" }] : n?.direction === "desc" ? [] : [{ field: e, direction: "asc" }];
|
|
2382
2563
|
}
|
|
2383
|
-
function
|
|
2564
|
+
function Me(s, e) {
|
|
2384
2565
|
const t = s.findIndex((i) => i.field === e);
|
|
2385
2566
|
return t >= 0 ? t + 1 : void 0;
|
|
2386
2567
|
}
|
|
2387
|
-
function
|
|
2568
|
+
function Ne(s, e) {
|
|
2388
2569
|
return s.find((t) => t.field === e)?.direction;
|
|
2389
2570
|
}
|
|
2390
|
-
const
|
|
2391
|
-
class
|
|
2571
|
+
const di = '@layer tbw-plugins{.header-cell[data-sort=asc]:after{content:"↑";margin-left:4px;opacity:.8}.header-cell[data-sort=desc]:after{content:"↓";margin-left:4px;opacity:.8}.sort-indicator{margin-left:4px;opacity:.8}.sort-index{font-size:10px;background:var(--tbw-multi-sort-badge-bg, var(--tbw-color-panel-bg));color:var(--tbw-multi-sort-badge-color, var(--tbw-color-fg));border-radius:50%;width:14px;height:14px;display:inline-flex;align-items:center;justify-content:center;margin-left:2px;font-weight:600}}';
|
|
2572
|
+
class bn extends _ {
|
|
2392
2573
|
name = "multiSort";
|
|
2393
|
-
styles =
|
|
2574
|
+
styles = di;
|
|
2394
2575
|
get defaultConfig() {
|
|
2395
2576
|
return {
|
|
2396
2577
|
maxSortColumns: 3,
|
|
@@ -2402,12 +2583,12 @@ class ln extends R {
|
|
|
2402
2583
|
this.sortModel = [];
|
|
2403
2584
|
}
|
|
2404
2585
|
processRows(e) {
|
|
2405
|
-
return this.sortModel.length === 0 ? [...e] :
|
|
2586
|
+
return this.sortModel.length === 0 ? [...e] : si([...e], this.sortModel, [...this.columns]);
|
|
2406
2587
|
}
|
|
2407
2588
|
onHeaderClick(e) {
|
|
2408
2589
|
if (!this.columns.find((r) => r.field === e.field)?.sortable) return !1;
|
|
2409
2590
|
const i = e.originalEvent.shiftKey, n = this.config.maxSortColumns ?? 3;
|
|
2410
|
-
return this.sortModel =
|
|
2591
|
+
return this.sortModel = li(this.sortModel, e.field, i, n), this.emit("sort-change", { sortModel: [...this.sortModel] }), this.requestRender(), !0;
|
|
2411
2592
|
}
|
|
2412
2593
|
afterRender() {
|
|
2413
2594
|
const e = this.gridElement;
|
|
@@ -2416,7 +2597,7 @@ class ln extends R {
|
|
|
2416
2597
|
e.querySelectorAll(".header-row .cell[data-field]").forEach((n) => {
|
|
2417
2598
|
const r = n.getAttribute("data-field");
|
|
2418
2599
|
if (!r) return;
|
|
2419
|
-
const o =
|
|
2600
|
+
const o = Me(this.sortModel, r), a = Ne(this.sortModel, r);
|
|
2420
2601
|
if (n.querySelector(".sort-index")?.remove(), a) {
|
|
2421
2602
|
n.querySelector('[part~="sort-indicator"], .sort-indicator')?.remove(), n.setAttribute("data-sort", a);
|
|
2422
2603
|
const c = document.createElement("span");
|
|
@@ -2440,10 +2621,10 @@ class ln extends R {
|
|
|
2440
2621
|
this.sortModel = [], this.emit("sort-change", { sortModel: [] }), this.requestRender();
|
|
2441
2622
|
}
|
|
2442
2623
|
getSortIndex(e) {
|
|
2443
|
-
return
|
|
2624
|
+
return Me(this.sortModel, e);
|
|
2444
2625
|
}
|
|
2445
2626
|
getSortDirection(e) {
|
|
2446
|
-
return
|
|
2627
|
+
return Ne(this.sortModel, e);
|
|
2447
2628
|
}
|
|
2448
2629
|
getColumnState(e) {
|
|
2449
2630
|
const t = this.sortModel.findIndex((n) => n.field === e);
|
|
@@ -2466,16 +2647,16 @@ class ln extends R {
|
|
|
2466
2647
|
i !== -1 ? this.sortModel[i] = n : this.sortModel.splice(t.sort.priority, 0, n);
|
|
2467
2648
|
}
|
|
2468
2649
|
}
|
|
2469
|
-
function
|
|
2650
|
+
function ci(s) {
|
|
2470
2651
|
return s.filter((e) => e.sticky === "left");
|
|
2471
2652
|
}
|
|
2472
|
-
function
|
|
2653
|
+
function ui(s) {
|
|
2473
2654
|
return s.filter((e) => e.sticky === "right");
|
|
2474
2655
|
}
|
|
2475
|
-
function
|
|
2656
|
+
function ae(s) {
|
|
2476
2657
|
return s.some((e) => e.sticky === "left" || e.sticky === "right");
|
|
2477
2658
|
}
|
|
2478
|
-
function
|
|
2659
|
+
function qe(s, e) {
|
|
2479
2660
|
const t = Array.from(s.querySelectorAll(".header-row .cell"));
|
|
2480
2661
|
if (!t.length) return;
|
|
2481
2662
|
const i = /* @__PURE__ */ new Map();
|
|
@@ -2499,12 +2680,12 @@ function Le(s, e) {
|
|
|
2499
2680
|
}), r += l.offsetWidth);
|
|
2500
2681
|
}
|
|
2501
2682
|
}
|
|
2502
|
-
function
|
|
2683
|
+
function Ke(s) {
|
|
2503
2684
|
s.querySelectorAll(".sticky-left, .sticky-right").forEach((t) => {
|
|
2504
2685
|
t.classList.remove("sticky-left", "sticky-right"), t.style.position = "", t.style.left = "", t.style.right = "";
|
|
2505
2686
|
});
|
|
2506
2687
|
}
|
|
2507
|
-
class
|
|
2688
|
+
class vn extends _ {
|
|
2508
2689
|
static manifest = {
|
|
2509
2690
|
ownedProperties: [
|
|
2510
2691
|
{
|
|
@@ -2527,26 +2708,26 @@ class dn extends R {
|
|
|
2527
2708
|
}
|
|
2528
2709
|
static detect(e, t) {
|
|
2529
2710
|
const i = t?.columns;
|
|
2530
|
-
return Array.isArray(i) ?
|
|
2711
|
+
return Array.isArray(i) ? ae(i) : !1;
|
|
2531
2712
|
}
|
|
2532
2713
|
processColumns(e) {
|
|
2533
|
-
return this.isApplied =
|
|
2714
|
+
return this.isApplied = ae([...e]), [...e];
|
|
2534
2715
|
}
|
|
2535
2716
|
afterRender() {
|
|
2536
2717
|
if (!this.isApplied)
|
|
2537
2718
|
return;
|
|
2538
2719
|
const e = this.grid, t = [...this.columns];
|
|
2539
|
-
if (!
|
|
2540
|
-
|
|
2720
|
+
if (!ae(t)) {
|
|
2721
|
+
Ke(e), this.isApplied = !1;
|
|
2541
2722
|
return;
|
|
2542
2723
|
}
|
|
2543
2724
|
queueMicrotask(() => {
|
|
2544
|
-
|
|
2725
|
+
qe(e, t);
|
|
2545
2726
|
});
|
|
2546
2727
|
}
|
|
2547
2728
|
onPluginQuery(e) {
|
|
2548
2729
|
switch (e.type) {
|
|
2549
|
-
case
|
|
2730
|
+
case Je.CAN_MOVE_COLUMN: {
|
|
2550
2731
|
const t = e.context, i = t.sticky;
|
|
2551
2732
|
if (i === "left" || i === "right")
|
|
2552
2733
|
return !1;
|
|
@@ -2559,18 +2740,18 @@ class dn extends R {
|
|
|
2559
2740
|
}
|
|
2560
2741
|
refreshStickyOffsets() {
|
|
2561
2742
|
const e = [...this.columns];
|
|
2562
|
-
|
|
2743
|
+
qe(this.grid, e);
|
|
2563
2744
|
}
|
|
2564
2745
|
getLeftPinnedColumns() {
|
|
2565
2746
|
const e = [...this.columns];
|
|
2566
|
-
return
|
|
2747
|
+
return ci(e);
|
|
2567
2748
|
}
|
|
2568
2749
|
getRightPinnedColumns() {
|
|
2569
2750
|
const e = [...this.columns];
|
|
2570
|
-
return
|
|
2751
|
+
return ui(e);
|
|
2571
2752
|
}
|
|
2572
2753
|
clearStickyPositions() {
|
|
2573
|
-
|
|
2754
|
+
Ke(this.grid);
|
|
2574
2755
|
}
|
|
2575
2756
|
getHorizontalScrollOffsets(e, t) {
|
|
2576
2757
|
if (!this.isApplied)
|
|
@@ -2591,10 +2772,10 @@ class dn extends R {
|
|
|
2591
2772
|
return { left: i, right: n, skipScroll: r };
|
|
2592
2773
|
}
|
|
2593
2774
|
}
|
|
2594
|
-
function
|
|
2775
|
+
function hi(s) {
|
|
2595
2776
|
return typeof s == "object" && s !== null && "aggFunc" in s;
|
|
2596
2777
|
}
|
|
2597
|
-
function
|
|
2778
|
+
function le(s, e) {
|
|
2598
2779
|
const t = document.createElement("div");
|
|
2599
2780
|
t.className = "tbw-pinned-rows", t.setAttribute("role", "presentation"), t.setAttribute("aria-live", "polite");
|
|
2600
2781
|
const i = document.createElement("div");
|
|
@@ -2616,7 +2797,7 @@ function Q(s, e) {
|
|
|
2616
2797
|
}
|
|
2617
2798
|
if (s.customPanels)
|
|
2618
2799
|
for (const o of s.customPanels) {
|
|
2619
|
-
const a =
|
|
2800
|
+
const a = gi(o, e);
|
|
2620
2801
|
switch (o.position) {
|
|
2621
2802
|
case "left":
|
|
2622
2803
|
i.appendChild(a);
|
|
@@ -2631,11 +2812,11 @@ function Q(s, e) {
|
|
|
2631
2812
|
}
|
|
2632
2813
|
return t.appendChild(i), t.appendChild(n), t.appendChild(r), t;
|
|
2633
2814
|
}
|
|
2634
|
-
function
|
|
2815
|
+
function He(s) {
|
|
2635
2816
|
const e = document.createElement("div");
|
|
2636
2817
|
return e.className = `tbw-aggregation-rows tbw-aggregation-rows-${s}`, e.setAttribute("role", "presentation"), e;
|
|
2637
2818
|
}
|
|
2638
|
-
function
|
|
2819
|
+
function ze(s, e, t, i) {
|
|
2639
2820
|
s.innerHTML = "";
|
|
2640
2821
|
for (const n of e) {
|
|
2641
2822
|
const r = document.createElement("div");
|
|
@@ -2649,11 +2830,11 @@ function Pe(s, e, t, i) {
|
|
|
2649
2830
|
let l, d;
|
|
2650
2831
|
const c = n.aggregators?.[o.field];
|
|
2651
2832
|
if (c)
|
|
2652
|
-
if (
|
|
2653
|
-
const u =
|
|
2833
|
+
if (hi(c)) {
|
|
2834
|
+
const u = ye(c.aggFunc);
|
|
2654
2835
|
u && (l = u(i, o.field, o)), d = c.formatter;
|
|
2655
2836
|
} else {
|
|
2656
|
-
const u =
|
|
2837
|
+
const u = ye(c);
|
|
2657
2838
|
u && (l = u(i, o.field, o));
|
|
2658
2839
|
}
|
|
2659
2840
|
else if (n.cells && Object.prototype.hasOwnProperty.call(n.cells, o.field)) {
|
|
@@ -2665,13 +2846,13 @@ function Pe(s, e, t, i) {
|
|
|
2665
2846
|
s.appendChild(r);
|
|
2666
2847
|
}
|
|
2667
2848
|
}
|
|
2668
|
-
function
|
|
2849
|
+
function gi(s, e) {
|
|
2669
2850
|
const t = document.createElement("div");
|
|
2670
2851
|
t.className = "tbw-status-panel tbw-status-panel-custom", t.id = `status-panel-${s.id}`;
|
|
2671
2852
|
const i = s.render(e);
|
|
2672
2853
|
return typeof i == "string" ? t.innerHTML = i : t.appendChild(i), t;
|
|
2673
2854
|
}
|
|
2674
|
-
function
|
|
2855
|
+
function Ge(s, e, t, i, n) {
|
|
2675
2856
|
return {
|
|
2676
2857
|
totalRows: s.length,
|
|
2677
2858
|
filteredRows: n?.cachedResult?.length ?? s.length,
|
|
@@ -2681,10 +2862,10 @@ function Fe(s, e, t, i, n) {
|
|
|
2681
2862
|
grid: t
|
|
2682
2863
|
};
|
|
2683
2864
|
}
|
|
2684
|
-
const
|
|
2685
|
-
class
|
|
2865
|
+
const fi = "@layer tbw-plugins{.tbw-footer{flex-shrink:0;z-index:var(--tbw-z-layer-pinned-rows, 20);background:var(--tbw-color-panel-bg)}.tbw-pinned-rows{display:flex;align-items:center;justify-content:space-between;padding:var(--tbw-button-padding, var(--tbw-spacing-md, .5rem) var(--tbw-spacing-lg, .75rem));background:var(--tbw-pinned-rows-bg, var(--tbw-color-panel-bg));border-top:1px solid var(--tbw-pinned-rows-border, var(--tbw-color-border));font-size:var(--tbw-font-size-xs, .75rem);color:var(--tbw-pinned-rows-color, var(--tbw-color-fg-muted));min-height:32px;box-sizing:border-box;min-width:fit-content}.tbw-pinned-rows-left,.tbw-pinned-rows-center,.tbw-pinned-rows-right{display:flex;align-items:center;gap:var(--tbw-spacing-xl, 1rem)}.tbw-pinned-rows-left{justify-content:flex-start}.tbw-pinned-rows-center{justify-content:center;flex:1}.tbw-pinned-rows-right{justify-content:flex-end}.tbw-status-panel{white-space:nowrap}.tbw-aggregation-rows{min-width:fit-content;background:var(--tbw-aggregation-bg, var(--tbw-color-header-bg))}.tbw-aggregation-rows-top{border-bottom:1px solid var(--tbw-aggregation-border, var(--tbw-color-border))}.tbw-aggregation-rows-bottom{border-top:1px solid var(--tbw-aggregation-border, var(--tbw-color-border))}.tbw-aggregation-row{display:grid;grid-template-columns:var(--tbw-column-template);font-size:var(--tbw-aggregation-font-size, .8em);font-weight:var(--tbw-aggregation-font-weight, 600)}.tbw-aggregation-cell{padding:var(--tbw-cell-padding, .125rem .5rem);min-height:var(--tbw-row-height, 1.75rem);display:block;align-items:center;border-right:1px solid var(--tbw-color-border-cell);overflow:hidden;text-overflow:ellipsis;white-space:var(--tbw-cell-white-space, nowrap)}.tbw-aggregation-cell:last-child{border-right:0}.tbw-aggregation-cell-full{grid-column:1 / -1;border-right:0}}";
|
|
2866
|
+
class yn extends _ {
|
|
2686
2867
|
name = "pinnedRows";
|
|
2687
|
-
styles =
|
|
2868
|
+
styles = fi;
|
|
2688
2869
|
get defaultConfig() {
|
|
2689
2870
|
return {
|
|
2690
2871
|
position: "bottom",
|
|
@@ -2706,7 +2887,7 @@ class cn extends R {
|
|
|
2706
2887
|
const t = e.querySelector(".tbw-scroll-area") ?? e.querySelector(".tbw-grid-content") ?? e.children[0];
|
|
2707
2888
|
if (!t) return;
|
|
2708
2889
|
this.footerWrapper && !t.contains(this.footerWrapper) && (this.footerWrapper = null, this.bottomAggregationContainer = null, this.infoBarElement = null), this.topAggregationContainer && !t.contains(this.topAggregationContainer) && (this.topAggregationContainer = null), this.infoBarElement && !t.contains(this.infoBarElement) && (this.infoBarElement = null);
|
|
2709
|
-
const i = this.getSelectionState(), n = this.getFilterState(), r =
|
|
2890
|
+
const i = this.getSelectionState(), n = this.getFilterState(), r = Ge(
|
|
2710
2891
|
this.rows,
|
|
2711
2892
|
this.columns,
|
|
2712
2893
|
this.grid,
|
|
@@ -2715,11 +2896,11 @@ class cn extends R {
|
|
|
2715
2896
|
), o = this.config.aggregationRows || [], a = o.filter((h) => h.position === "top"), l = o.filter((h) => h.position !== "top");
|
|
2716
2897
|
if (a.length > 0) {
|
|
2717
2898
|
if (!this.topAggregationContainer) {
|
|
2718
|
-
this.topAggregationContainer =
|
|
2899
|
+
this.topAggregationContainer = He("top");
|
|
2719
2900
|
const h = e.querySelector(".header");
|
|
2720
2901
|
h && h.nextSibling ? t.insertBefore(this.topAggregationContainer, h.nextSibling) : t.appendChild(this.topAggregationContainer);
|
|
2721
2902
|
}
|
|
2722
|
-
|
|
2903
|
+
ze(
|
|
2723
2904
|
this.topAggregationContainer,
|
|
2724
2905
|
a,
|
|
2725
2906
|
this.visibleColumns,
|
|
@@ -2729,18 +2910,18 @@ class cn extends R {
|
|
|
2729
2910
|
const d = this.config.showRowCount !== !1 || this.config.showSelectedCount && r.selectedRows > 0 || this.config.showFilteredCount && r.filteredRows !== r.totalRows || this.config.customPanels && this.config.customPanels.length > 0, c = d && this.config.position !== "top", u = l.length > 0 || c;
|
|
2730
2911
|
if (d && this.config.position === "top")
|
|
2731
2912
|
if (!this.infoBarElement)
|
|
2732
|
-
this.infoBarElement =
|
|
2913
|
+
this.infoBarElement = le(this.config, r), t.insertBefore(this.infoBarElement, t.firstChild);
|
|
2733
2914
|
else {
|
|
2734
|
-
const h =
|
|
2915
|
+
const h = le(this.config, r);
|
|
2735
2916
|
this.infoBarElement.replaceWith(h), this.infoBarElement = h;
|
|
2736
2917
|
}
|
|
2737
2918
|
else this.config.position === "top" && this.infoBarElement && (this.infoBarElement.remove(), this.infoBarElement = null);
|
|
2738
|
-
u ? (this.footerWrapper || (this.footerWrapper = document.createElement("div"), this.footerWrapper.className = "tbw-footer", t.appendChild(this.footerWrapper)), this.footerWrapper.innerHTML = "", l.length > 0 && (this.bottomAggregationContainer || (this.bottomAggregationContainer =
|
|
2919
|
+
u ? (this.footerWrapper || (this.footerWrapper = document.createElement("div"), this.footerWrapper.className = "tbw-footer", t.appendChild(this.footerWrapper)), this.footerWrapper.innerHTML = "", l.length > 0 && (this.bottomAggregationContainer || (this.bottomAggregationContainer = He("bottom")), this.footerWrapper.appendChild(this.bottomAggregationContainer), ze(
|
|
2739
2920
|
this.bottomAggregationContainer,
|
|
2740
2921
|
l,
|
|
2741
2922
|
this.visibleColumns,
|
|
2742
2923
|
this.rows
|
|
2743
|
-
)), c && (this.infoBarElement =
|
|
2924
|
+
)), c && (this.infoBarElement = le(this.config, r), this.footerWrapper.appendChild(this.infoBarElement))) : this.cleanupFooter();
|
|
2744
2925
|
}
|
|
2745
2926
|
cleanup() {
|
|
2746
2927
|
this.infoBarElement && (this.infoBarElement.remove(), this.infoBarElement = null), this.topAggregationContainer && (this.topAggregationContainer.remove(), this.topAggregationContainer = null), this.bottomAggregationContainer && (this.bottomAggregationContainer.remove(), this.bottomAggregationContainer = null), this.footerWrapper && (this.footerWrapper.remove(), this.footerWrapper = null);
|
|
@@ -2767,7 +2948,7 @@ class cn extends R {
|
|
|
2767
2948
|
}
|
|
2768
2949
|
getContext() {
|
|
2769
2950
|
const e = this.getSelectionState(), t = this.getFilterState();
|
|
2770
|
-
return
|
|
2951
|
+
return Ge(
|
|
2771
2952
|
this.rows,
|
|
2772
2953
|
this.columns,
|
|
2773
2954
|
this.grid,
|
|
@@ -2788,16 +2969,16 @@ class cn extends R {
|
|
|
2788
2969
|
this.config.aggregationRows && (this.config.aggregationRows = this.config.aggregationRows.filter((t) => t.id !== e), this.requestRender());
|
|
2789
2970
|
}
|
|
2790
2971
|
}
|
|
2791
|
-
const
|
|
2792
|
-
function
|
|
2972
|
+
const pi = ct;
|
|
2973
|
+
function mi(s) {
|
|
2793
2974
|
const e = [];
|
|
2794
2975
|
return !s.rowGroupFields?.length && !s.columnGroupFields?.length && e.push("At least one row or column group field is required"), s.valueFields?.length || e.push("At least one value field is required"), e;
|
|
2795
2976
|
}
|
|
2796
|
-
function
|
|
2977
|
+
function be(s, e) {
|
|
2797
2978
|
return [...s, e].join("|");
|
|
2798
2979
|
}
|
|
2799
|
-
function
|
|
2800
|
-
const t = e.rowGroupFields ?? [], i = e.columnGroupFields ?? [], n = e.valueFields ?? [], r =
|
|
2980
|
+
function wi(s, e) {
|
|
2981
|
+
const t = e.rowGroupFields ?? [], i = e.columnGroupFields ?? [], n = e.valueFields ?? [], r = bi(s, i), o = tt(
|
|
2801
2982
|
s,
|
|
2802
2983
|
t,
|
|
2803
2984
|
i,
|
|
@@ -2805,7 +2986,7 @@ function ai(s, e) {
|
|
|
2805
2986
|
n,
|
|
2806
2987
|
0,
|
|
2807
2988
|
""
|
|
2808
|
-
), a =
|
|
2989
|
+
), a = yi(o, r, n), l = Object.values(a).reduce((d, c) => d + c, 0);
|
|
2809
2990
|
return {
|
|
2810
2991
|
rows: o,
|
|
2811
2992
|
columnKeys: r,
|
|
@@ -2813,7 +2994,7 @@ function ai(s, e) {
|
|
|
2813
2994
|
grandTotal: l
|
|
2814
2995
|
};
|
|
2815
2996
|
}
|
|
2816
|
-
function
|
|
2997
|
+
function bi(s, e) {
|
|
2817
2998
|
if (e.length === 0) return ["value"];
|
|
2818
2999
|
const t = /* @__PURE__ */ new Set();
|
|
2819
3000
|
for (const i of s) {
|
|
@@ -2822,7 +3003,7 @@ function li(s, e) {
|
|
|
2822
3003
|
}
|
|
2823
3004
|
return [...t].sort();
|
|
2824
3005
|
}
|
|
2825
|
-
function
|
|
3006
|
+
function vi(s, e) {
|
|
2826
3007
|
const t = /* @__PURE__ */ new Map();
|
|
2827
3008
|
for (const i of s) {
|
|
2828
3009
|
const n = String(i[e] ?? ""), r = t.get(n);
|
|
@@ -2830,10 +3011,10 @@ function di(s, e) {
|
|
|
2830
3011
|
}
|
|
2831
3012
|
return t;
|
|
2832
3013
|
}
|
|
2833
|
-
function
|
|
3014
|
+
function tt(s, e, t, i, n, r, o) {
|
|
2834
3015
|
const a = [];
|
|
2835
3016
|
if (e.length === 0) {
|
|
2836
|
-
const h =
|
|
3017
|
+
const h = Oe(s, t, i, n), g = Be(h);
|
|
2837
3018
|
return a.push({
|
|
2838
3019
|
rowKey: o || "all",
|
|
2839
3020
|
rowLabel: o || "All",
|
|
@@ -2844,11 +3025,11 @@ function je(s, e, t, i, n, r, o) {
|
|
|
2844
3025
|
rowCount: s.length
|
|
2845
3026
|
}), a;
|
|
2846
3027
|
}
|
|
2847
|
-
const l = e[0], d = e.slice(1), c = d.length > 0, u =
|
|
3028
|
+
const l = e[0], d = e.slice(1), c = d.length > 0, u = vi(s, l);
|
|
2848
3029
|
for (const [h, g] of u) {
|
|
2849
|
-
const f = o ? `${o}|${h}` : h, p =
|
|
2850
|
-
let
|
|
2851
|
-
c && (
|
|
3030
|
+
const f = o ? `${o}|${h}` : h, p = Oe(g, t, i, n), w = Be(p);
|
|
3031
|
+
let v;
|
|
3032
|
+
c && (v = tt(
|
|
2852
3033
|
g,
|
|
2853
3034
|
d,
|
|
2854
3035
|
t,
|
|
@@ -2861,44 +3042,44 @@ function je(s, e, t, i, n, r, o) {
|
|
|
2861
3042
|
rowLabel: h || "(blank)",
|
|
2862
3043
|
depth: r,
|
|
2863
3044
|
values: p,
|
|
2864
|
-
total:
|
|
3045
|
+
total: w,
|
|
2865
3046
|
isGroup: c,
|
|
2866
|
-
children:
|
|
3047
|
+
children: v,
|
|
2867
3048
|
rowCount: g.length
|
|
2868
3049
|
});
|
|
2869
3050
|
}
|
|
2870
3051
|
return a;
|
|
2871
3052
|
}
|
|
2872
|
-
function
|
|
3053
|
+
function Oe(s, e, t, i) {
|
|
2873
3054
|
const n = {};
|
|
2874
3055
|
for (const r of t)
|
|
2875
3056
|
for (const o of i) {
|
|
2876
|
-
const l = (e.length > 0 ? s.filter((h) => e.map((g) => String(h[g] ?? "")).join("|") === r) : s).map((h) => Number(h[o.field]) || 0), d =
|
|
3057
|
+
const l = (e.length > 0 ? s.filter((h) => e.map((g) => String(h[g] ?? "")).join("|") === r) : s).map((h) => Number(h[o.field]) || 0), d = pi(o.aggFunc), c = l.length > 0 ? d(l) : null, u = be([r], o.field);
|
|
2877
3058
|
n[u] = c;
|
|
2878
3059
|
}
|
|
2879
3060
|
return n;
|
|
2880
3061
|
}
|
|
2881
|
-
function
|
|
3062
|
+
function Be(s) {
|
|
2882
3063
|
let e = 0;
|
|
2883
3064
|
for (const t of Object.values(s))
|
|
2884
3065
|
e += t ?? 0;
|
|
2885
3066
|
return e;
|
|
2886
3067
|
}
|
|
2887
|
-
function
|
|
3068
|
+
function yi(s, e, t) {
|
|
2888
3069
|
const i = {};
|
|
2889
3070
|
function n(r) {
|
|
2890
3071
|
for (const o of r)
|
|
2891
3072
|
if (!o.isGroup || !o.children?.length)
|
|
2892
3073
|
for (const a of e)
|
|
2893
3074
|
for (const l of t) {
|
|
2894
|
-
const d =
|
|
3075
|
+
const d = be([a], l.field);
|
|
2895
3076
|
i[d] = (i[d] ?? 0) + (o.values[d] ?? 0);
|
|
2896
3077
|
}
|
|
2897
3078
|
else o.children && n(o.children);
|
|
2898
3079
|
}
|
|
2899
3080
|
return n(s), i;
|
|
2900
3081
|
}
|
|
2901
|
-
function
|
|
3082
|
+
function xi(s, e, t = !0) {
|
|
2902
3083
|
const i = [];
|
|
2903
3084
|
function n(r) {
|
|
2904
3085
|
i.push(r);
|
|
@@ -2911,7 +3092,7 @@ function ui(s, e, t = !0) {
|
|
|
2911
3092
|
n(r);
|
|
2912
3093
|
return i;
|
|
2913
3094
|
}
|
|
2914
|
-
function
|
|
3095
|
+
function Ci(s) {
|
|
2915
3096
|
const e = [];
|
|
2916
3097
|
function t(i) {
|
|
2917
3098
|
if (i.isGroup && e.push(i.rowKey), i.children)
|
|
@@ -2922,14 +3103,14 @@ function hi(s) {
|
|
|
2922
3103
|
t(i);
|
|
2923
3104
|
return e;
|
|
2924
3105
|
}
|
|
2925
|
-
const
|
|
2926
|
-
function
|
|
3106
|
+
const Ri = ["sum", "avg", "count", "min", "max", "first", "last"];
|
|
3107
|
+
function Ei(s, e, t, i) {
|
|
2927
3108
|
const n = new AbortController(), r = { config: e, callbacks: i, signal: n.signal }, o = document.createElement("div");
|
|
2928
|
-
return o.className = "tbw-pivot-panel", o.appendChild(
|
|
3109
|
+
return o.className = "tbw-pivot-panel", o.appendChild(j("Options", () => Li(t, r))), o.appendChild(j("Row Groups", () => Ve("rowGroups", r))), o.appendChild(j("Column Groups", () => Ve("columnGroups", r))), o.appendChild(j("Values", () => ki(r))), o.appendChild(j("Available Fields", () => _i(r))), s.appendChild(o), () => {
|
|
2929
3110
|
n.abort(), o.remove();
|
|
2930
3111
|
};
|
|
2931
3112
|
}
|
|
2932
|
-
function
|
|
3113
|
+
function j(s, e) {
|
|
2933
3114
|
const t = document.createElement("div");
|
|
2934
3115
|
t.className = "tbw-pivot-section";
|
|
2935
3116
|
const i = document.createElement("div");
|
|
@@ -2937,7 +3118,7 @@ function K(s, e) {
|
|
|
2937
3118
|
const n = document.createElement("div");
|
|
2938
3119
|
return n.className = "tbw-pivot-section-content", n.appendChild(e()), t.appendChild(i), t.appendChild(n), t;
|
|
2939
3120
|
}
|
|
2940
|
-
function
|
|
3121
|
+
function Ve(s, e) {
|
|
2941
3122
|
const { config: t, callbacks: i, signal: n } = e, r = document.createElement("div");
|
|
2942
3123
|
r.className = "tbw-pivot-drop-zone", r.setAttribute("data-zone", s);
|
|
2943
3124
|
const o = s === "rowGroups" ? t.rowGroupFields ?? [] : t.columnGroupFields ?? [];
|
|
@@ -2946,7 +3127,7 @@ function qe(s, e) {
|
|
|
2946
3127
|
a.className = "tbw-pivot-placeholder", a.textContent = "Drag fields here or click to add", r.appendChild(a);
|
|
2947
3128
|
} else
|
|
2948
3129
|
for (const a of o)
|
|
2949
|
-
r.appendChild(
|
|
3130
|
+
r.appendChild(Si(a, s, e));
|
|
2950
3131
|
return r.addEventListener(
|
|
2951
3132
|
"dragover",
|
|
2952
3133
|
(a) => {
|
|
@@ -2969,7 +3150,7 @@ function qe(s, e) {
|
|
|
2969
3150
|
{ signal: n }
|
|
2970
3151
|
), r;
|
|
2971
3152
|
}
|
|
2972
|
-
function
|
|
3153
|
+
function Si(s, e, t) {
|
|
2973
3154
|
const { callbacks: i, signal: n } = t, r = document.createElement("div");
|
|
2974
3155
|
r.className = "tbw-pivot-field-chip", r.draggable = !0;
|
|
2975
3156
|
const o = i.getAvailableFields().find((d) => d.field === s), a = document.createElement("span");
|
|
@@ -2995,7 +3176,7 @@ function pi(s, e, t) {
|
|
|
2995
3176
|
{ signal: n }
|
|
2996
3177
|
), r;
|
|
2997
3178
|
}
|
|
2998
|
-
function
|
|
3179
|
+
function ki(s) {
|
|
2999
3180
|
const { config: e, callbacks: t, signal: i } = s, n = document.createElement("div");
|
|
3000
3181
|
n.className = "tbw-pivot-drop-zone tbw-pivot-values-zone", n.setAttribute("data-zone", "values");
|
|
3001
3182
|
const r = e.valueFields ?? [];
|
|
@@ -3004,7 +3185,7 @@ function mi(s) {
|
|
|
3004
3185
|
o.className = "tbw-pivot-placeholder", o.textContent = "Drag numeric fields here for aggregation", n.appendChild(o);
|
|
3005
3186
|
} else
|
|
3006
3187
|
for (const o of r)
|
|
3007
|
-
n.appendChild(
|
|
3188
|
+
n.appendChild(Ai(o, s));
|
|
3008
3189
|
return n.addEventListener(
|
|
3009
3190
|
"dragover",
|
|
3010
3191
|
(o) => {
|
|
@@ -3027,7 +3208,7 @@ function mi(s) {
|
|
|
3027
3208
|
{ signal: i }
|
|
3028
3209
|
), n;
|
|
3029
3210
|
}
|
|
3030
|
-
function
|
|
3211
|
+
function Ai(s, e) {
|
|
3031
3212
|
const { callbacks: t, signal: i } = e, n = document.createElement("div");
|
|
3032
3213
|
n.className = "tbw-pivot-field-chip tbw-pivot-value-chip";
|
|
3033
3214
|
const r = t.getAvailableFields().find((c) => c.field === s.field), o = document.createElement("div");
|
|
@@ -3036,7 +3217,7 @@ function wi(s, e) {
|
|
|
3036
3217
|
a.className = "tbw-pivot-chip-label", a.textContent = r?.header ?? s.field;
|
|
3037
3218
|
const l = document.createElement("select");
|
|
3038
3219
|
l.className = "tbw-pivot-agg-select", l.title = "Aggregation function";
|
|
3039
|
-
for (const c of
|
|
3220
|
+
for (const c of Ri) {
|
|
3040
3221
|
const u = document.createElement("option");
|
|
3041
3222
|
u.value = c, u.textContent = c.toUpperCase(), u.selected = c === s.aggFunc, l.appendChild(u);
|
|
3042
3223
|
}
|
|
@@ -3056,7 +3237,7 @@ function wi(s, e) {
|
|
|
3056
3237
|
{ signal: i }
|
|
3057
3238
|
), o.appendChild(a), o.appendChild(l), n.appendChild(o), n.appendChild(d), n;
|
|
3058
3239
|
}
|
|
3059
|
-
function
|
|
3240
|
+
function _i(s) {
|
|
3060
3241
|
const { config: e, callbacks: t, signal: i } = s, n = document.createElement("div");
|
|
3061
3242
|
n.className = "tbw-pivot-available-fields";
|
|
3062
3243
|
const r = t.getAvailableFields(), o = /* @__PURE__ */ new Set([
|
|
@@ -3086,10 +3267,10 @@ function bi(s) {
|
|
|
3086
3267
|
}
|
|
3087
3268
|
return n;
|
|
3088
3269
|
}
|
|
3089
|
-
function
|
|
3270
|
+
function Li(s, e) {
|
|
3090
3271
|
const { config: t, callbacks: i, signal: n } = e, r = document.createElement("div");
|
|
3091
3272
|
return r.className = "tbw-pivot-options", r.appendChild(
|
|
3092
|
-
|
|
3273
|
+
de(
|
|
3093
3274
|
"Enable Pivot View",
|
|
3094
3275
|
s,
|
|
3095
3276
|
(o) => {
|
|
@@ -3098,7 +3279,7 @@ function vi(s, e) {
|
|
|
3098
3279
|
n
|
|
3099
3280
|
)
|
|
3100
3281
|
), r.appendChild(
|
|
3101
|
-
|
|
3282
|
+
de(
|
|
3102
3283
|
"Show Row Totals",
|
|
3103
3284
|
t.showTotals ?? !0,
|
|
3104
3285
|
(o) => {
|
|
@@ -3107,7 +3288,7 @@ function vi(s, e) {
|
|
|
3107
3288
|
n
|
|
3108
3289
|
)
|
|
3109
3290
|
), r.appendChild(
|
|
3110
|
-
|
|
3291
|
+
de(
|
|
3111
3292
|
"Show Grand Total",
|
|
3112
3293
|
t.showGrandTotal ?? !0,
|
|
3113
3294
|
(o) => {
|
|
@@ -3117,7 +3298,7 @@ function vi(s, e) {
|
|
|
3117
3298
|
)
|
|
3118
3299
|
), r;
|
|
3119
3300
|
}
|
|
3120
|
-
function
|
|
3301
|
+
function de(s, e, t, i) {
|
|
3121
3302
|
const n = document.createElement("label");
|
|
3122
3303
|
n.className = "tbw-pivot-checkbox";
|
|
3123
3304
|
const r = document.createElement("input");
|
|
@@ -3125,7 +3306,7 @@ function ee(s, e, t, i) {
|
|
|
3125
3306
|
const o = document.createElement("span");
|
|
3126
3307
|
return o.textContent = s, n.appendChild(r), n.appendChild(o), n;
|
|
3127
3308
|
}
|
|
3128
|
-
function
|
|
3309
|
+
function Ti(s, e, t) {
|
|
3129
3310
|
return e.className = "data-grid-row pivot-group-row", e.setAttribute("data-pivot-depth", String(s.__pivotDepth ?? 0)), e.setAttribute("data-pivot-key", String(s.__pivotRowKey ?? "")), e.setAttribute("role", "row"), e.innerHTML = "", t.columns.forEach((i, n) => {
|
|
3130
3311
|
const r = document.createElement("div");
|
|
3131
3312
|
if (r.className = "cell", r.setAttribute("data-col", String(n)), r.setAttribute("data-row", String(t.rowIndex)), r.setAttribute("role", "gridcell"), n === 0) {
|
|
@@ -3146,7 +3327,7 @@ function yi(s, e, t) {
|
|
|
3146
3327
|
e.appendChild(r);
|
|
3147
3328
|
}), !0;
|
|
3148
3329
|
}
|
|
3149
|
-
function
|
|
3330
|
+
function Fi(s, e, t, i) {
|
|
3150
3331
|
return e.className = "data-grid-row pivot-leaf-row", e.setAttribute("data-pivot-depth", String(s.__pivotDepth ?? 0)), e.setAttribute("data-pivot-key", String(s.__pivotRowKey ?? "")), e.innerHTML = "", t.forEach((n, r) => {
|
|
3151
3332
|
const o = document.createElement("div");
|
|
3152
3333
|
if (o.className = "cell", o.setAttribute("data-col", String(r)), o.setAttribute("data-row", String(i)), o.setAttribute("role", "gridcell"), r === 0) {
|
|
@@ -3161,7 +3342,7 @@ function Ci(s, e, t, i) {
|
|
|
3161
3342
|
e.appendChild(o);
|
|
3162
3343
|
}), !0;
|
|
3163
3344
|
}
|
|
3164
|
-
function
|
|
3345
|
+
function Ii(s, e, t) {
|
|
3165
3346
|
return e.className = "pivot-grand-total-row", e.setAttribute("role", "presentation"), e.innerHTML = "", t.forEach((i, n) => {
|
|
3166
3347
|
const r = document.createElement("div");
|
|
3167
3348
|
if (r.className = "cell", r.setAttribute("data-col", String(n)), n === 0) {
|
|
@@ -3174,10 +3355,10 @@ function xi(s, e, t) {
|
|
|
3174
3355
|
e.appendChild(r);
|
|
3175
3356
|
}), !0;
|
|
3176
3357
|
}
|
|
3177
|
-
const
|
|
3178
|
-
class
|
|
3358
|
+
const Pi = '@layer tbw-plugins{.pivot-group-row{display:grid;grid-template-columns:var(--tbw-column-template);font-weight:600;background:var(--tbw-pivot-group-bg, var(--tbw-color-row-alt));min-height:var(--tbw-row-height);border-bottom:var(--tbw-row-divider)}.pivot-group-row:hover{background:var(--tbw-pivot-group-hover, var(--tbw-color-row-hover))}.pivot-leaf-row{display:grid;grid-template-columns:var(--tbw-column-template);background:var(--tbw-pivot-leaf-bg, var(--tbw-color-bg));min-height:var(--tbw-row-height);border-bottom:var(--tbw-row-divider)}.pivot-grand-total-row{display:grid;grid-template-columns:var(--tbw-column-template);font-weight:700;background:var(--tbw-pivot-grand-total-bg, var(--tbw-color-header-bg));min-height:var(--tbw-row-height);border-top:2px solid var(--tbw-color-border-strong)}.pivot-grand-total-row>.cell{display:flex;align-items:center;padding:var(--tbw-cell-padding);border-right:1px solid var(--tbw-color-border-cell);overflow:hidden;min-width:0}.pivot-grand-total-row>.cell:last-child{border-right:0}.pivot-grand-total-footer{position:sticky;bottom:0;z-index:var(--tbw-z-layer-pinned-rows, 20);background:var(--tbw-pivot-grand-total-bg, var(--tbw-color-header-bg));min-width:fit-content}.pivot-group-row>.cell,.pivot-leaf-row>.cell{display:flex;align-items:center;padding:var(--tbw-cell-padding);border-right:1px solid var(--tbw-color-border-cell);overflow:hidden;min-width:0}.pivot-group-row>.cell:last-child,.pivot-leaf-row>.cell:last-child{border-right:0}.pivot-toggle{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;margin-right:6px;border:none;background:transparent;cursor:pointer;color:var(--tbw-pivot-toggle-color, var(--tbw-color-fg-muted));border-radius:var(--tbw-border-radius);transition:background .15s,color .15s}.pivot-toggle:hover{background:var(--tbw-pivot-toggle-hover-bg, var(--tbw-color-row-hover));color:var(--tbw-pivot-toggle-hover-color, var(--tbw-color-fg))}.pivot-toggle:focus{outline:var(--tbw-focus-outline);outline-offset:var(--tbw-focus-outline-offset)}.pivot-label{font-weight:inherit}.pivot-count{color:var(--tbw-pivot-count-color, var(--tbw-color-fg-muted));font-size:.9em;font-weight:400}.pivot-total-row{font-weight:700;border-top:2px solid var(--tbw-pivot-border, var(--tbw-color-border-strong))}[data-pivot-depth="1"]{--tbw-pivot-depth: 1}[data-pivot-depth="2"]{--tbw-pivot-depth: 2}[data-pivot-depth="3"]{--tbw-pivot-depth: 3}[data-pivot-depth="4"]{--tbw-pivot-depth: 4}.tbw-pivot-panel{display:flex;flex-direction:column;gap:var(--tbw-panel-padding, var(--tbw-spacing-lg, .75rem));padding:var(--tbw-panel-padding, var(--tbw-spacing-lg, .75rem));height:100%;overflow-y:auto;font-size:var(--tbw-font-size-sm, .8125rem)}.tbw-pivot-section{border:1px solid var(--tbw-pivot-border, var(--tbw-color-border));border-radius:var(--tbw-border-radius);background:var(--tbw-pivot-section-bg, var(--tbw-color-bg))}.tbw-pivot-section-header{padding:var(--tbw-button-padding, var(--tbw-spacing-md, .5rem) var(--tbw-spacing-lg, .75rem));font-weight:600;background:var(--tbw-pivot-header-bg, var(--tbw-color-header-bg));border-bottom:1px solid var(--tbw-pivot-border, var(--tbw-color-border));border-radius:var(--tbw-border-radius) var(--tbw-border-radius) 0 0}.tbw-pivot-section-content{padding:var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem))}.tbw-pivot-toggle-wrapper{display:flex;align-items:center}.tbw-pivot-toggle-label{display:flex;align-items:center;gap:var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem));cursor:pointer}.tbw-pivot-toggle-label input{width:var(--tbw-icon-size, 1rem);height:var(--tbw-icon-size, 1rem);cursor:pointer}.tbw-pivot-drop-zone{min-height:60px;padding:var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem));border:2px dashed var(--tbw-pivot-drop-border, var(--tbw-color-border));border-radius:var(--tbw-border-radius);background:var(--tbw-pivot-drop-bg, var(--tbw-color-row-alt));display:flex;flex-wrap:wrap;gap:var(--tbw-spacing-sm, .375rem);align-content:flex-start;transition:all .15s ease}.tbw-pivot-drop-zone.drag-over{border-color:var(--tbw-color-accent);background:var(--tbw-pivot-drop-active, var(--tbw-focus-background))}.tbw-pivot-placeholder{color:var(--tbw-color-fg-muted);font-style:italic;padding:var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem));text-align:center;width:100%}.tbw-pivot-field-chip{display:inline-flex;align-items:center;gap:var(--tbw-spacing-sm, .375rem);padding:var(--tbw-button-padding-sm, var(--tbw-spacing-xs, .25rem) var(--tbw-spacing-md, .5rem));background:var(--tbw-pivot-chip-bg, var(--tbw-color-header-bg));border:1px solid var(--tbw-pivot-chip-border, var(--tbw-color-border));border-radius:var(--tbw-border-radius);cursor:grab;font-size:var(--tbw-font-size-xs, .75rem);transition:all .15s ease}.tbw-pivot-field-chip:hover{background:var(--tbw-pivot-chip-hover, var(--tbw-color-row-hover));border-color:var(--tbw-color-accent)}.tbw-pivot-field-chip.available{background:var(--tbw-color-bg)}.tbw-pivot-field-chip.dragging{opacity:.5;cursor:grabbing}.tbw-pivot-chip-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:120px}.tbw-pivot-chip-remove{display:flex;align-items:center;justify-content:center;width:var(--tbw-icon-size, 1rem);height:var(--tbw-icon-size, 1rem);padding:0;border:none;background:transparent;color:var(--tbw-color-fg-muted);font-size:var(--tbw-font-size-sm, .875rem);font-weight:700;cursor:pointer;border-radius:50%;transition:all .15s ease}.tbw-pivot-chip-remove:hover{background:var(--tbw-pivot-chip-remove-hover-bg, var(--tbw-color-accent));color:var(--tbw-pivot-chip-remove-hover-fg, var(--tbw-color-accent-fg))}.tbw-pivot-value-chip{padding:var(--tbw-button-padding-sm, var(--tbw-spacing-xs, .25rem) var(--tbw-spacing-md, .5rem))}.tbw-pivot-value-label-wrapper{display:flex;align-items:center;gap:var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem));flex:1;min-width:0}.tbw-pivot-agg-select{padding:var(--tbw-spacing-xs, .125rem) var(--tbw-spacing-xs, .25rem);font-size:var(--tbw-font-size-xs, .6875rem);border:1px solid var(--tbw-color-border);border-radius:var(--tbw-border-radius);background:var(--tbw-color-bg);cursor:pointer}.tbw-pivot-available-fields{display:flex;flex-wrap:wrap;gap:var(--tbw-spacing-sm, .375rem);min-height:40px}.tbw-pivot-options{display:flex;flex-direction:column;gap:var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem))}.tbw-pivot-checkbox{display:flex;align-items:center;gap:var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem));cursor:pointer}.tbw-pivot-checkbox input{width:var(--tbw-icon-size-sm, .875rem);height:var(--tbw-icon-size-sm, .875rem);cursor:pointer}.pivot-group-row.tbw-pivot-slide-in,.pivot-leaf-row.tbw-pivot-slide-in{animation:tbw-pivot-slide-in var(--tbw-animation-duration, .2s) var(--tbw-animation-easing, ease-out) forwards}@keyframes tbw-pivot-slide-in{0%{opacity:0;transform:translate(-8px)}to{opacity:1;transform:translate(0)}}.pivot-group-row.tbw-pivot-fade-in,.pivot-leaf-row.tbw-pivot-fade-in{animation:tbw-pivot-fade-in var(--tbw-animation-duration, .2s) var(--tbw-animation-easing, ease-out) forwards}@keyframes tbw-pivot-fade-in{0%{opacity:0}to{opacity:1}}}';
|
|
3359
|
+
class O extends _ {
|
|
3179
3360
|
name = "pivot";
|
|
3180
|
-
styles =
|
|
3361
|
+
styles = Pi;
|
|
3181
3362
|
static PANEL_ID = "pivot";
|
|
3182
3363
|
get defaultConfig() {
|
|
3183
3364
|
return {
|
|
@@ -3211,7 +3392,7 @@ class D extends R {
|
|
|
3211
3392
|
getToolPanel() {
|
|
3212
3393
|
if ((this.config?.showToolPanel ?? this.userConfig?.showToolPanel ?? !0) !== !1)
|
|
3213
3394
|
return {
|
|
3214
|
-
id:
|
|
3395
|
+
id: O.PANEL_ID,
|
|
3215
3396
|
title: "Pivot",
|
|
3216
3397
|
icon: "⊞",
|
|
3217
3398
|
tooltip: "Configure pivot table",
|
|
@@ -3222,11 +3403,11 @@ class D extends R {
|
|
|
3222
3403
|
processRows(e) {
|
|
3223
3404
|
if (!this.hasInitialized && this.config.active !== !1 && this.hasValidPivotConfig() && (this.hasInitialized = !0, this.isActive = !0), !this.isActive)
|
|
3224
3405
|
return [...e];
|
|
3225
|
-
const t =
|
|
3406
|
+
const t = mi(this.config);
|
|
3226
3407
|
if (t.length > 0)
|
|
3227
3408
|
return this.warn(`Config errors: ${t.join(", ")}`), [...e];
|
|
3228
|
-
this.buildFieldHeaderMap(), this.defaultExpanded = this.config.defaultExpanded ?? !0, this.expandedKeys.size === 0 && this.defaultExpanded && this.pivotResult && this.expandAllKeys(), this.pivotResult =
|
|
3229
|
-
const i = this.config.indentWidth ?? 20, n =
|
|
3409
|
+
this.buildFieldHeaderMap(), this.defaultExpanded = this.config.defaultExpanded ?? !0, this.expandedKeys.size === 0 && this.defaultExpanded && this.pivotResult && this.expandAllKeys(), this.pivotResult = wi(e, this.config), this.expandedKeys.size === 0 && this.defaultExpanded && this.expandAllKeys();
|
|
3410
|
+
const i = this.config.indentWidth ?? 20, n = xi(
|
|
3230
3411
|
this.pivotResult.rows,
|
|
3231
3412
|
this.expandedKeys,
|
|
3232
3413
|
this.defaultExpanded
|
|
@@ -3261,7 +3442,7 @@ class D extends R {
|
|
|
3261
3442
|
});
|
|
3262
3443
|
for (const n of this.pivotResult.columnKeys)
|
|
3263
3444
|
for (const r of this.config.valueFields ?? []) {
|
|
3264
|
-
const o =
|
|
3445
|
+
const o = be([n], r.field), a = r.header || this.fieldHeaderMap.get(r.field) || r.field;
|
|
3265
3446
|
t.push({
|
|
3266
3447
|
field: o,
|
|
3267
3448
|
header: `${n} - ${a} (${r.aggFunc})`,
|
|
@@ -3278,13 +3459,13 @@ class D extends R {
|
|
|
3278
3459
|
}
|
|
3279
3460
|
renderRow(e, t, i) {
|
|
3280
3461
|
const n = e;
|
|
3281
|
-
return n.__pivotRowKey && n.__pivotHasChildren ?
|
|
3462
|
+
return n.__pivotRowKey && n.__pivotHasChildren ? Ti(n, t, {
|
|
3282
3463
|
columns: this.gridColumns,
|
|
3283
3464
|
rowIndex: i,
|
|
3284
3465
|
onToggle: (r) => this.toggle(r),
|
|
3285
3466
|
resolveIcon: (r) => this.resolveIcon(r),
|
|
3286
3467
|
setIcon: (r, o) => this.setIcon(r, o)
|
|
3287
|
-
}) : n.__pivotRowKey !== void 0 && this.isActive ?
|
|
3468
|
+
}) : n.__pivotRowKey !== void 0 && this.isActive ? Fi(n, t, this.gridColumns, i) : (this.cleanupPivotStyling(t), !1);
|
|
3288
3469
|
}
|
|
3289
3470
|
cleanupPivotStyling(e) {
|
|
3290
3471
|
(e.classList.contains("pivot-group-row") || e.classList.contains("pivot-leaf-row") || e.classList.contains("pivot-grand-total-row")) && (e.classList.remove("pivot-group-row", "pivot-leaf-row", "pivot-grand-total-row"), e.classList.add("data-grid-row"), e.removeAttribute("data-pivot-depth"), e.innerHTML = "");
|
|
@@ -3322,7 +3503,7 @@ class D extends R {
|
|
|
3322
3503
|
__pivotTotal: this.pivotResult.grandTotal,
|
|
3323
3504
|
...this.pivotResult.totals
|
|
3324
3505
|
};
|
|
3325
|
-
|
|
3506
|
+
Ii(i, this.grandTotalFooter, this.gridColumns);
|
|
3326
3507
|
}
|
|
3327
3508
|
cleanupGrandTotalFooter() {
|
|
3328
3509
|
this.grandTotalFooter && (this.grandTotalFooter.remove(), this.grandTotalFooter = null);
|
|
@@ -3344,7 +3525,7 @@ class D extends R {
|
|
|
3344
3525
|
}
|
|
3345
3526
|
expandAllKeys() {
|
|
3346
3527
|
if (!this.pivotResult) return;
|
|
3347
|
-
const e =
|
|
3528
|
+
const e = Ci(this.pivotResult.rows);
|
|
3348
3529
|
for (const t of e)
|
|
3349
3530
|
this.expandedKeys.add(t);
|
|
3350
3531
|
}
|
|
@@ -3376,16 +3557,16 @@ class D extends R {
|
|
|
3376
3557
|
this.pivotResult = null, this.requestRender();
|
|
3377
3558
|
}
|
|
3378
3559
|
showPanel() {
|
|
3379
|
-
this.grid.openToolPanel(), this.grid.expandedToolPanelSections.includes(
|
|
3560
|
+
this.grid.openToolPanel(), this.grid.expandedToolPanelSections.includes(O.PANEL_ID) || this.grid.toggleToolPanelSection(O.PANEL_ID);
|
|
3380
3561
|
}
|
|
3381
3562
|
hidePanel() {
|
|
3382
3563
|
this.grid.closeToolPanel();
|
|
3383
3564
|
}
|
|
3384
3565
|
togglePanel() {
|
|
3385
|
-
this.grid.isToolPanelOpen || this.grid.openToolPanel(), this.grid.toggleToolPanelSection(
|
|
3566
|
+
this.grid.isToolPanelOpen || this.grid.openToolPanel(), this.grid.toggleToolPanelSection(O.PANEL_ID);
|
|
3386
3567
|
}
|
|
3387
3568
|
isPanelVisible() {
|
|
3388
|
-
return this.grid.isToolPanelOpen && this.grid.expandedToolPanelSections.includes(
|
|
3569
|
+
return this.grid.isToolPanelOpen && this.grid.expandedToolPanelSections.includes(O.PANEL_ID);
|
|
3389
3570
|
}
|
|
3390
3571
|
get gridColumns() {
|
|
3391
3572
|
return this.grid.columns ?? [];
|
|
@@ -3429,7 +3610,7 @@ class D extends R {
|
|
|
3429
3610
|
},
|
|
3430
3611
|
getAvailableFields: () => this.getAvailableFields()
|
|
3431
3612
|
};
|
|
3432
|
-
return
|
|
3613
|
+
return Ei(e, this.config, this.isActive, t);
|
|
3433
3614
|
}
|
|
3434
3615
|
refreshPanel() {
|
|
3435
3616
|
this.panelContainer && (this.panelContainer.innerHTML = "", this.renderPanel(this.panelContainer));
|
|
@@ -3462,10 +3643,10 @@ class D extends R {
|
|
|
3462
3643
|
n >= 0 && (i[n] = { ...i[n], aggFunc: t }, this.config.valueFields = [...i]), this.isActive && this.refresh();
|
|
3463
3644
|
}
|
|
3464
3645
|
}
|
|
3465
|
-
const
|
|
3466
|
-
function
|
|
3646
|
+
const Q = "tbw-print-isolation-style";
|
|
3647
|
+
function Di(s, e) {
|
|
3467
3648
|
const t = document.createElement("style");
|
|
3468
|
-
return t.id =
|
|
3649
|
+
return t.id = Q, t.textContent = `
|
|
3469
3650
|
/* Print isolation: hide everything except the target grid */
|
|
3470
3651
|
@media print {
|
|
3471
3652
|
/* Hide all body children by default */
|
|
@@ -3537,22 +3718,22 @@ function Ei(s, e) {
|
|
|
3537
3718
|
}
|
|
3538
3719
|
`, t;
|
|
3539
3720
|
}
|
|
3540
|
-
async function
|
|
3721
|
+
async function Mi(s, e = {}) {
|
|
3541
3722
|
const { orientation: t = "landscape" } = e, i = s.id;
|
|
3542
3723
|
document.querySelectorAll(`#${CSS.escape(i)}`).length > 1 && console.warn(
|
|
3543
3724
|
`[tbw-grid:print] Multiple elements found with id="${i}". Print isolation may not work correctly. Ensure each grid has a unique ID.`
|
|
3544
|
-
), document.getElementById(
|
|
3545
|
-
const r =
|
|
3725
|
+
), document.getElementById(Q)?.remove();
|
|
3726
|
+
const r = Di(i, t);
|
|
3546
3727
|
return document.head.appendChild(r), new Promise((o) => {
|
|
3547
3728
|
const a = () => {
|
|
3548
|
-
window.removeEventListener("afterprint", a), document.getElementById(
|
|
3729
|
+
window.removeEventListener("afterprint", a), document.getElementById(Q)?.remove(), o();
|
|
3549
3730
|
};
|
|
3550
3731
|
window.addEventListener("afterprint", a), window.print(), setTimeout(() => {
|
|
3551
|
-
window.removeEventListener("afterprint", a), document.getElementById(
|
|
3732
|
+
window.removeEventListener("afterprint", a), document.getElementById(Q)?.remove(), o();
|
|
3552
3733
|
}, 5e3);
|
|
3553
3734
|
});
|
|
3554
3735
|
}
|
|
3555
|
-
const
|
|
3736
|
+
const Ni = ".tbw-print-header,.tbw-print-footer{display:none}@media print{tbw-grid{overflow:visible!important;height:auto!important;border:none!important;border-radius:0!important;color-scheme:light only;-webkit-print-color-adjust:exact;print-color-adjust:exact}tbw-grid .tbw-grid-content{overflow:visible!important;height:auto!important;max-height:none!important}tbw-grid .tbw-scroll-area{overflow:visible!important;height:auto!important;max-height:none!important}tbw-grid .rows-body{overflow:visible!important;height:auto!important;max-height:none!important}tbw-grid .rows-container,tbw-grid .rows-viewport,tbw-grid .rows{overflow:visible!important;height:auto!important;max-height:none!important;transform:none!important}tbw-grid .rows-viewport .rows{position:static!important}tbw-grid .resize-handle,tbw-grid [part=sort-indicator],tbw-grid .tbw-filter-btn,tbw-grid .tool-panel,tbw-grid .tool-panel-content,tbw-grid .tbw-shell-header,tbw-grid .shell-toolbar,tbw-grid .tool-panel-toggle,tbw-grid [data-print-hide],tbw-grid .expander-cell,tbw-grid .tree-toggle,tbw-grid .context-menu,tbw-grid .faux-vscroll{display:none!important}tbw-grid .tbw-print-header{display:flex;justify-content:space-between;align-items:baseline;padding:.5em 0;margin-bottom:.5em;border-bottom:2px solid var(--tbw-color-border, #333);font-family:inherit}.tbw-print-header-title{font-size:1.25em;font-weight:700}.tbw-print-header-timestamp{font-size:.875em;color:var(--tbw-color-fg-muted, #666)}tbw-grid .tbw-print-footer{display:block;margin-top:.5em;padding-top:.5em;border-top:1px solid var(--tbw-color-border, #ccc);font-size:.75em;color:var(--tbw-color-fg-muted, #666);text-align:right}tbw-grid .data-grid-row{break-inside:avoid;page-break-inside:avoid}tbw-grid .cell{border:1px solid var(--tbw-color-border, #ddd)!important}tbw-grid .header-row,tbw-grid .data-grid-row{padding-right:1px}tbw-grid .data-grid-row:hover,tbw-grid .cell:hover{background:inherit!important}@page{margin:1cm}tbw-grid.print-landscape{@page{size:landscape}}tbw-grid.print-portrait{@page{size:portrait}}}", qi = {
|
|
3556
3737
|
button: !1,
|
|
3557
3738
|
orientation: "landscape",
|
|
3558
3739
|
warnThreshold: 500,
|
|
@@ -3562,10 +3743,10 @@ const ki = ".tbw-print-header,.tbw-print-footer{display:none}@media print{tbw-gr
|
|
|
3562
3743
|
title: "",
|
|
3563
3744
|
isolate: !1
|
|
3564
3745
|
};
|
|
3565
|
-
class
|
|
3746
|
+
class xn extends _ {
|
|
3566
3747
|
name = "print";
|
|
3567
3748
|
version = "1.0.0";
|
|
3568
|
-
styles =
|
|
3749
|
+
styles = Ni;
|
|
3569
3750
|
#e = !1;
|
|
3570
3751
|
#t = null;
|
|
3571
3752
|
#o = null;
|
|
@@ -3589,7 +3770,7 @@ class un extends R {
|
|
|
3589
3770
|
console.warn("[PrintPlugin] Grid not available");
|
|
3590
3771
|
return;
|
|
3591
3772
|
}
|
|
3592
|
-
const i = { ...
|
|
3773
|
+
const i = { ...qi, ...this.config, ...e }, r = this.rows.length;
|
|
3593
3774
|
let o = r, a = !1;
|
|
3594
3775
|
if (i.warnThreshold > 0 && r > i.warnThreshold) {
|
|
3595
3776
|
const d = i.maxRows > 0 ? `
|
|
@@ -3660,7 +3841,7 @@ Click OK to continue, or Cancel to abort.`
|
|
|
3660
3841
|
}
|
|
3661
3842
|
async #p(e) {
|
|
3662
3843
|
const t = this.gridElement;
|
|
3663
|
-
t && await
|
|
3844
|
+
t && await Mi(t, {
|
|
3664
3845
|
orientation: e.orientation
|
|
3665
3846
|
});
|
|
3666
3847
|
}
|
|
@@ -3709,19 +3890,19 @@ Click OK to continue, or Cancel to abort.`
|
|
|
3709
3890
|
});
|
|
3710
3891
|
}
|
|
3711
3892
|
}
|
|
3712
|
-
function
|
|
3893
|
+
function Ki(s) {
|
|
3713
3894
|
const e = s.meta ?? {};
|
|
3714
3895
|
return e.lockPosition !== !0 && e.suppressMovable !== !0;
|
|
3715
3896
|
}
|
|
3716
|
-
function
|
|
3897
|
+
function We(s, e, t) {
|
|
3717
3898
|
if (e === t || e < 0 || e >= s.length || t < 0 || t > s.length) return s;
|
|
3718
3899
|
const i = [...s], [n] = i.splice(e, 1);
|
|
3719
3900
|
return i.splice(t, 0, n), i;
|
|
3720
3901
|
}
|
|
3721
|
-
const
|
|
3722
|
-
class
|
|
3902
|
+
const Hi = '@layer tbw-plugins{.header-row>.cell[draggable=true]{cursor:grab;position:relative}.header-row>.cell.dragging{opacity:.5;cursor:grabbing}.header-row>.cell.drop-before:before{content:"";position:absolute;left:0;top:0;bottom:0;width:2px;background:var(--tbw-reorder-indicator, var(--tbw-color-accent));z-index:1}.header-row>.cell.drop-after:after{content:"";position:absolute;right:0;top:0;bottom:0;width:2px;background:var(--tbw-reorder-indicator, var(--tbw-color-accent));z-index:1}.cell.flip-animating{transition:transform var(--tbw-animation-duration, .2s) ease-out;will-change:transform;z-index:1}@keyframes reorder-fade-in{0%{opacity:0}to{opacity:1}}.cell.fade-animating{animation:reorder-fade-in var(--tbw-animation-duration, .2s) ease-out backwards}}';
|
|
3903
|
+
class Cn extends _ {
|
|
3723
3904
|
name = "reorder";
|
|
3724
|
-
styles =
|
|
3905
|
+
styles = Hi;
|
|
3725
3906
|
get defaultConfig() {
|
|
3726
3907
|
return {
|
|
3727
3908
|
animation: "flip"
|
|
@@ -3738,8 +3919,8 @@ class hn extends R {
|
|
|
3738
3919
|
draggedIndex = null;
|
|
3739
3920
|
dropIndex = null;
|
|
3740
3921
|
canMoveColumnWithPlugins(e) {
|
|
3741
|
-
return !e || !
|
|
3742
|
-
type:
|
|
3922
|
+
return !e || !Ki(e) ? !1 : !this.grid.queryPlugins({
|
|
3923
|
+
type: Je.CAN_MOVE_COLUMN,
|
|
3743
3924
|
context: e
|
|
3744
3925
|
}).includes(!1);
|
|
3745
3926
|
}
|
|
@@ -3788,7 +3969,7 @@ class hn extends R {
|
|
|
3788
3969
|
const l = this.draggedField, d = this.draggedIndex, c = this.dropIndex;
|
|
3789
3970
|
if (!this.isDragging || l === null || d === null || c === null)
|
|
3790
3971
|
return;
|
|
3791
|
-
const u = c > d ? c - 1 : c, h = this.getColumnOrder(), g =
|
|
3972
|
+
const u = c > d ? c - 1 : c, h = this.getColumnOrder(), g = We(h, d, u), f = {
|
|
3792
3973
|
field: l,
|
|
3793
3974
|
fromIndex: d,
|
|
3794
3975
|
toIndex: u,
|
|
@@ -3811,7 +3992,7 @@ class hn extends R {
|
|
|
3811
3992
|
if (l < 0 || l >= o.length) return;
|
|
3812
3993
|
const d = n.find((c) => c.field === o[l]);
|
|
3813
3994
|
if (this.canMoveColumnWithPlugins(d))
|
|
3814
|
-
return this.moveColumn(r.field, l), t._focusCol = l,
|
|
3995
|
+
return this.moveColumn(r.field, l), t._focusCol = l, D(this.grid), e.preventDefault(), e.stopPropagation(), !0;
|
|
3815
3996
|
}
|
|
3816
3997
|
getColumnOrder() {
|
|
3817
3998
|
return this.grid.getColumnOrder();
|
|
@@ -3819,7 +4000,7 @@ class hn extends R {
|
|
|
3819
4000
|
moveColumn(e, t) {
|
|
3820
4001
|
const i = this.getColumnOrder(), n = i.indexOf(e);
|
|
3821
4002
|
if (n === -1) return;
|
|
3822
|
-
const r =
|
|
4003
|
+
const r = We(i, n, t);
|
|
3823
4004
|
this.emitCancelable("column-move", {
|
|
3824
4005
|
field: e,
|
|
3825
4006
|
fromIndex: n,
|
|
@@ -3914,11 +4095,11 @@ class hn extends R {
|
|
|
3914
4095
|
this.grid.requestStateChange?.();
|
|
3915
4096
|
}
|
|
3916
4097
|
}
|
|
3917
|
-
const
|
|
3918
|
-
class
|
|
4098
|
+
const zi = 'tbw-grid[data-responsive-animate]{.data-grid-row,.data-grid-row>.cell{transition:opacity var(--tbw-responsive-duration, .2s) ease-out,transform var(--tbw-responsive-duration, .2s) ease-out}}tbw-grid[data-responsive][data-responsive-animate]{.data-grid-row{animation:responsive-card-enter var(--tbw-responsive-duration, .2s) ease-out}}@keyframes responsive-card-enter{0%{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}tbw-grid[data-responsive]{.header{display:none!important}.footer-row{display:none}.tbw-scroll-area{overflow-x:hidden;min-width:0!important}.rows-body-wrapper{min-width:0!important}.data-grid-row:not(.group-row){display:block!important;grid-template-columns:none!important;padding:var(--tbw-cell-padding);padding-left:var(--tbw-spacing-xl);border-bottom:1px solid var(--tbw-color-border);min-height:auto!important;height:auto!important;contain:none!important;content-visibility:visible!important;background:var(--tbw-color-bg);position:relative;&:nth-child(2n){background:var(--tbw-color-row-alt)}&:hover{background:var(--tbw-color-row-hover)}&[aria-selected=true]{background:var(--tbw-color-selection);&:before{content:"";position:absolute;left:0;top:0;bottom:0;width:4px;background:var(--tbw-color-accent)}}}.data-grid-row:not(.group-row)>.cell{display:flex!important;justify-content:space-between;align-items:center;padding:var(--tbw-spacing-xs) var(--tbw-spacing-md);width:100%!important;min-width:0!important;min-height:auto!important;height:auto!important;line-height:1.5!important;position:static!important;left:auto!important;right:auto!important;border:none!important;border-bottom:none!important;border-right:none!important;background:transparent!important;white-space:normal!important;overflow:visible!important;&:before{content:attr(data-header) ": ";font-weight:600;color:var(--tbw-color-header-fg);flex-shrink:0;margin-right:var(--tbw-spacing-md);min-width:100px}&:after{content:none}}.cell[data-utility]{display:none!important}}tbw-grid[data-responsive] .cell[data-responsive-hidden]{display:none!important}tbw-grid[data-responsive] .cell[data-responsive-value-only]{&:before{display:none!important}justify-content:flex-start!important;font-weight:500}tbw-grid:not([data-responsive]) .cell[data-responsive-hidden]{display:none!important}tbw-grid[data-responsive]{.tbw-footer,.tbw-pinned-rows,.tbw-aggregation-rows{display:none!important}.tbw-pinned-rows,.tbw-aggregation-rows,.tbw-aggregation-row{min-width:0!important}}tbw-grid[data-responsive] .data-grid-row.responsive-card{display:block!important;padding:var(--tbw-cell-padding);border-bottom:1px solid var(--tbw-color-border);>*{width:100%}.cell:before{display:none}}';
|
|
4099
|
+
class Rn extends _ {
|
|
3919
4100
|
name = "responsive";
|
|
3920
4101
|
version = "1.0.0";
|
|
3921
|
-
styles =
|
|
4102
|
+
styles = zi;
|
|
3922
4103
|
static manifest = {
|
|
3923
4104
|
incompatibleWith: [
|
|
3924
4105
|
{
|
|
@@ -4049,23 +4230,23 @@ class gn extends R {
|
|
|
4049
4230
|
switch (e.key) {
|
|
4050
4231
|
case "ArrowDown":
|
|
4051
4232
|
if (this.grid._focusCol < i)
|
|
4052
|
-
return this.grid._focusCol += 1, e.preventDefault(),
|
|
4233
|
+
return this.grid._focusCol += 1, e.preventDefault(), D(this.grid), !0;
|
|
4053
4234
|
if (this.grid._focusRow < t)
|
|
4054
|
-
return this.grid._focusRow += 1, this.grid._focusCol = 0, e.preventDefault(),
|
|
4235
|
+
return this.grid._focusRow += 1, this.grid._focusCol = 0, e.preventDefault(), D(this.grid), !0;
|
|
4055
4236
|
break;
|
|
4056
4237
|
case "ArrowUp":
|
|
4057
4238
|
if (this.grid._focusCol > 0)
|
|
4058
|
-
return this.grid._focusCol -= 1, e.preventDefault(),
|
|
4239
|
+
return this.grid._focusCol -= 1, e.preventDefault(), D(this.grid), !0;
|
|
4059
4240
|
if (this.grid._focusRow > 0)
|
|
4060
|
-
return this.grid._focusRow -= 1, this.grid._focusCol = i, e.preventDefault(),
|
|
4241
|
+
return this.grid._focusRow -= 1, this.grid._focusCol = i, e.preventDefault(), D(this.grid), !0;
|
|
4061
4242
|
break;
|
|
4062
4243
|
case "ArrowRight":
|
|
4063
4244
|
if (this.grid._focusRow < t)
|
|
4064
|
-
return this.grid._focusRow += 1, e.preventDefault(),
|
|
4245
|
+
return this.grid._focusRow += 1, e.preventDefault(), D(this.grid), !0;
|
|
4065
4246
|
break;
|
|
4066
4247
|
case "ArrowLeft":
|
|
4067
4248
|
if (this.grid._focusRow > 0)
|
|
4068
|
-
return this.grid._focusRow -= 1, e.preventDefault(),
|
|
4249
|
+
return this.grid._focusRow -= 1, e.preventDefault(), D(this.grid), !0;
|
|
4069
4250
|
break;
|
|
4070
4251
|
}
|
|
4071
4252
|
return !1;
|
|
@@ -4088,7 +4269,7 @@ class gn extends R {
|
|
|
4088
4269
|
return !0;
|
|
4089
4270
|
return !1;
|
|
4090
4271
|
}
|
|
4091
|
-
#
|
|
4272
|
+
#x() {
|
|
4092
4273
|
let e = 0, t = 0;
|
|
4093
4274
|
for (const i of this.rows)
|
|
4094
4275
|
i.__isGroupRow ? e++ : t++;
|
|
@@ -4097,7 +4278,7 @@ class gn extends R {
|
|
|
4097
4278
|
getExtraHeight() {
|
|
4098
4279
|
if (!this.#t || !this.config.cardRenderer || !this.#w())
|
|
4099
4280
|
return 0;
|
|
4100
|
-
const e = this.#l ?? 28, t = this.#y(), i = this.#v(), { groupCount: n, cardCount: r } = this.#
|
|
4281
|
+
const e = this.#l ?? 28, t = this.#y(), i = this.#v(), { groupCount: n, cardCount: r } = this.#x(), o = n * Math.max(0, t - e), a = r * Math.max(0, i - e);
|
|
4101
4282
|
return o + a;
|
|
4102
4283
|
}
|
|
4103
4284
|
getExtraHeightBefore(e) {
|
|
@@ -4110,7 +4291,7 @@ class gn extends R {
|
|
|
4110
4291
|
d[u].__isGroupRow ? a++ : l++;
|
|
4111
4292
|
return a * r + l * o;
|
|
4112
4293
|
}
|
|
4113
|
-
#
|
|
4294
|
+
#C() {
|
|
4114
4295
|
let e = 0;
|
|
4115
4296
|
for (const t of this.rows)
|
|
4116
4297
|
t.__isGroupRow || e++;
|
|
@@ -4121,7 +4302,7 @@ class gn extends R {
|
|
|
4121
4302
|
if (!this.#t || !this.config.cardRenderer)
|
|
4122
4303
|
return;
|
|
4123
4304
|
let e = !1;
|
|
4124
|
-
const t = this.grid, i = this.#w(), n = this.#
|
|
4305
|
+
const t = this.grid, i = this.#w(), n = this.#C();
|
|
4125
4306
|
if (n !== this.#m && (this.#m = n, e = !0), i) {
|
|
4126
4307
|
const o = this.gridElement.querySelector(".data-grid-row.group-row");
|
|
4127
4308
|
if (o) {
|
|
@@ -4139,10 +4320,10 @@ class gn extends R {
|
|
|
4139
4320
|
}));
|
|
4140
4321
|
}
|
|
4141
4322
|
}
|
|
4142
|
-
const
|
|
4143
|
-
class
|
|
4323
|
+
const Gi = '.dg-row-drag-handle{display:flex;align-items:center;justify-content:center;cursor:grab;user-select:none;color:var(--tbw-color-fg-muted, #999);transition:color .15s ease;font-size:14px;letter-spacing:-2px;&:hover{color:var(--tbw-color-fg, #333)}&:active{cursor:grabbing}}.data-grid-row.dragging{opacity:.6}.data-grid-row.drop-target{position:relative;&.drop-before:before{content:"";position:absolute;top:0;left:0;right:0;height:2px;background-color:var(--tbw-color-accent, #1976d2);z-index:10}&.drop-after:after{content:"";position:absolute;bottom:0;left:0;right:0;height:2px;background-color:var(--tbw-color-accent, #1976d2);z-index:10}}.data-grid-row.keyboard-moving{background-color:var(--tbw-color-bg-selected, #e3f2fd);box-shadow:0 0 0 1px var(--tbw-color-accent, #1976d2) inset}.data-grid-row.animate-flip{transition:transform var(--tbw-animation-duration, .2s) ease-out}', Oi = "__tbw_row_drag";
|
|
4324
|
+
class En extends _ {
|
|
4144
4325
|
name = "rowReorder";
|
|
4145
|
-
styles =
|
|
4326
|
+
styles = Gi;
|
|
4146
4327
|
get defaultConfig() {
|
|
4147
4328
|
return {
|
|
4148
4329
|
enableKeyboard: !0,
|
|
@@ -4166,7 +4347,7 @@ class fn extends R {
|
|
|
4166
4347
|
if (!this.config.showDragHandle)
|
|
4167
4348
|
return [...e];
|
|
4168
4349
|
const t = {
|
|
4169
|
-
field:
|
|
4350
|
+
field: Oi,
|
|
4170
4351
|
header: "",
|
|
4171
4352
|
width: this.config.dragHandleWidth ?? 40,
|
|
4172
4353
|
resizable: !1,
|
|
@@ -4260,7 +4441,7 @@ class fn extends R {
|
|
|
4260
4441
|
row: e
|
|
4261
4442
|
}, this.lastFocusCol = r;
|
|
4262
4443
|
const o = this.grid, a = [...o._rows ?? this.sourceRows], [l] = a.splice(t, 1);
|
|
4263
|
-
a.splice(i, 0, l), o._rows = a, o._focusRow = i, o._focusCol = r, o.refreshVirtualWindow(!0),
|
|
4444
|
+
a.splice(i, 0, l), o._rows = a, o._focusRow = i, o._focusCol = r, o.refreshVirtualWindow(!0), D(o), this.clearDebounceTimer(), this.debounceTimer = setTimeout(() => {
|
|
4264
4445
|
this.flushPendingMove();
|
|
4265
4446
|
}, this.config.debounceMs ?? 300);
|
|
4266
4447
|
}
|
|
@@ -4279,7 +4460,7 @@ class fn extends R {
|
|
|
4279
4460
|
const o = [...this.sourceRows], [a] = o.splice(t, 1);
|
|
4280
4461
|
o.splice(e, 0, a);
|
|
4281
4462
|
const l = this.grid;
|
|
4282
|
-
l._rows = o, l._focusRow = e, l._focusCol = this.lastFocusCol, l.refreshVirtualWindow(!0),
|
|
4463
|
+
l._rows = o, l._focusRow = e, l._focusCol = this.lastFocusCol, l.refreshVirtualWindow(!0), D(l);
|
|
4283
4464
|
}
|
|
4284
4465
|
}
|
|
4285
4466
|
executeMove(e, t, i, n) {
|
|
@@ -4307,7 +4488,7 @@ class fn extends R {
|
|
|
4307
4488
|
this.debounceTimer && (clearTimeout(this.debounceTimer), this.debounceTimer = null);
|
|
4308
4489
|
}
|
|
4309
4490
|
}
|
|
4310
|
-
function
|
|
4491
|
+
function V(s) {
|
|
4311
4492
|
return {
|
|
4312
4493
|
startRow: Math.min(s.startRow, s.endRow),
|
|
4313
4494
|
startCol: Math.min(s.startCol, s.endCol),
|
|
@@ -4315,38 +4496,38 @@ function q(s) {
|
|
|
4315
4496
|
endCol: Math.max(s.startCol, s.endCol)
|
|
4316
4497
|
};
|
|
4317
4498
|
}
|
|
4318
|
-
function
|
|
4319
|
-
const e =
|
|
4499
|
+
function Bi(s) {
|
|
4500
|
+
const e = V(s);
|
|
4320
4501
|
return {
|
|
4321
4502
|
from: { row: e.startRow, col: e.startCol },
|
|
4322
4503
|
to: { row: e.endRow, col: e.endCol }
|
|
4323
4504
|
};
|
|
4324
4505
|
}
|
|
4325
|
-
function
|
|
4326
|
-
return s.map(
|
|
4506
|
+
function it(s) {
|
|
4507
|
+
return s.map(Bi);
|
|
4327
4508
|
}
|
|
4328
|
-
function
|
|
4329
|
-
const i =
|
|
4509
|
+
function Vi(s, e, t) {
|
|
4510
|
+
const i = V(t);
|
|
4330
4511
|
return s >= i.startRow && s <= i.endRow && e >= i.startCol && e <= i.endCol;
|
|
4331
4512
|
}
|
|
4332
|
-
function
|
|
4333
|
-
return t.some((i) =>
|
|
4513
|
+
function $e(s, e, t) {
|
|
4514
|
+
return t.some((i) => Vi(s, e, i));
|
|
4334
4515
|
}
|
|
4335
|
-
function
|
|
4336
|
-
const e = [], t =
|
|
4516
|
+
function Wi(s) {
|
|
4517
|
+
const e = [], t = V(s);
|
|
4337
4518
|
for (let i = t.startRow; i <= t.endRow; i++)
|
|
4338
4519
|
for (let n = t.startCol; n <= t.endCol; n++)
|
|
4339
4520
|
e.push({ row: i, col: n });
|
|
4340
4521
|
return e;
|
|
4341
4522
|
}
|
|
4342
|
-
function
|
|
4523
|
+
function $i(s) {
|
|
4343
4524
|
const e = /* @__PURE__ */ new Map();
|
|
4344
4525
|
for (const t of s)
|
|
4345
|
-
for (const i of
|
|
4526
|
+
for (const i of Wi(t))
|
|
4346
4527
|
e.set(`${i.row},${i.col}`, i);
|
|
4347
4528
|
return [...e.values()];
|
|
4348
4529
|
}
|
|
4349
|
-
function
|
|
4530
|
+
function ce(s, e) {
|
|
4350
4531
|
return {
|
|
4351
4532
|
startRow: s.row,
|
|
4352
4533
|
startCol: s.col,
|
|
@@ -4354,12 +4535,12 @@ function te(s, e) {
|
|
|
4354
4535
|
endCol: e.col
|
|
4355
4536
|
};
|
|
4356
4537
|
}
|
|
4357
|
-
function
|
|
4358
|
-
const t =
|
|
4538
|
+
function J(s, e) {
|
|
4539
|
+
const t = V(s), i = V(e);
|
|
4359
4540
|
return t.startRow === i.startRow && t.startCol === i.startCol && t.endRow === i.endRow && t.endCol === i.endCol;
|
|
4360
4541
|
}
|
|
4361
|
-
const
|
|
4362
|
-
function
|
|
4542
|
+
const ji = "@layer tbw-plugins{tbw-grid{&.selecting .data-grid-row>.cell{user-select:none}&[data-has-focus] .data-grid-row.row-focus{background-color:var(--tbw-focus-background, rgba(from var(--tbw-color-accent) r g b / 12%))}&[data-selection-mode=row] .cell-focus{outline:none}.data-grid-row>.cell.selected{background-color:var(--tbw-range-selection-bg);&.top{border-top:2px solid var(--tbw-range-border-color)}&.bottom{border-bottom:2px solid var(--tbw-range-border-color)}&.first{border-left:2px solid var(--tbw-range-border-color)}&.last{border-right:2px solid var(--tbw-range-border-color)}}.data-grid-row[data-selectable=false]{cursor:not-allowed;opacity:.6;&.row-focus{background-color:var(--tbw-color-row-alt)}}.data-grid-row>.cell[data-selectable=false]{cursor:not-allowed;opacity:.6;&.selected{background-color:var(--tbw-color-warning-bg, rgba(255, 243, 205, .5))}}.tbw-selection-summary{font-size:var(--tbw-font-size-sm, .8125rem);color:var(--tbw-color-fg-muted);white-space:nowrap}}}";
|
|
4543
|
+
function Ui(s, e, t) {
|
|
4363
4544
|
if (s === "cell" && e.selectedCell)
|
|
4364
4545
|
return {
|
|
4365
4546
|
mode: s,
|
|
@@ -4377,9 +4558,9 @@ function Hi(s, e, t) {
|
|
|
4377
4558
|
}));
|
|
4378
4559
|
return { mode: s, ranges: i };
|
|
4379
4560
|
}
|
|
4380
|
-
return s === "range" && e.ranges.length > 0 ? { mode: s, ranges:
|
|
4561
|
+
return s === "range" && e.ranges.length > 0 ? { mode: s, ranges: it(e.ranges) } : { mode: s, ranges: [] };
|
|
4381
4562
|
}
|
|
4382
|
-
class
|
|
4563
|
+
class Sn extends _ {
|
|
4383
4564
|
static manifest = {
|
|
4384
4565
|
configRules: [
|
|
4385
4566
|
{
|
|
@@ -4393,11 +4574,12 @@ class pn extends R {
|
|
|
4393
4574
|
]
|
|
4394
4575
|
};
|
|
4395
4576
|
name = "selection";
|
|
4396
|
-
styles =
|
|
4577
|
+
styles = ji;
|
|
4397
4578
|
get defaultConfig() {
|
|
4398
4579
|
return {
|
|
4399
4580
|
mode: "cell",
|
|
4400
|
-
triggerOn: "click"
|
|
4581
|
+
triggerOn: "click",
|
|
4582
|
+
enabled: !0
|
|
4401
4583
|
};
|
|
4402
4584
|
}
|
|
4403
4585
|
selected = /* @__PURE__ */ new Set();
|
|
@@ -4409,6 +4591,9 @@ class pn extends R {
|
|
|
4409
4591
|
isDragging = !1;
|
|
4410
4592
|
pendingKeyboardUpdate = null;
|
|
4411
4593
|
selectedCell = null;
|
|
4594
|
+
isSelectionEnabled() {
|
|
4595
|
+
return this.config.enabled === !1 ? !1 : this.grid.effectiveConfig?.selectable !== !1;
|
|
4596
|
+
}
|
|
4412
4597
|
checkSelectable(e, t) {
|
|
4413
4598
|
const { isSelectable: i } = this.config;
|
|
4414
4599
|
if (!i) return !0;
|
|
@@ -4427,10 +4612,11 @@ class pn extends R {
|
|
|
4427
4612
|
this.selected.clear(), this.ranges = [], this.activeRange = null, this.cellAnchor = null, this.isDragging = !1, this.selectedCell = null, this.pendingKeyboardUpdate = null;
|
|
4428
4613
|
}
|
|
4429
4614
|
onCellClick(e) {
|
|
4615
|
+
if (!this.isSelectionEnabled()) return !1;
|
|
4430
4616
|
const { rowIndex: t, colIndex: i, originalEvent: n } = e, { mode: r, triggerOn: o = "click" } = this.config;
|
|
4431
4617
|
if (n.type !== o)
|
|
4432
4618
|
return !1;
|
|
4433
|
-
const a = this.columns[i], l = a &&
|
|
4619
|
+
const a = this.columns[i], l = a && K(a);
|
|
4434
4620
|
if (r === "cell") {
|
|
4435
4621
|
if (l || !this.isCellSelectable(t, i))
|
|
4436
4622
|
return !1;
|
|
@@ -4444,8 +4630,8 @@ class pn extends R {
|
|
|
4444
4630
|
return !1;
|
|
4445
4631
|
const d = n.shiftKey, c = n.ctrlKey || n.metaKey;
|
|
4446
4632
|
if (d && this.cellAnchor) {
|
|
4447
|
-
const u =
|
|
4448
|
-
if (h &&
|
|
4633
|
+
const u = ce(this.cellAnchor, { row: t, col: i }), h = this.ranges.length > 0 ? this.ranges[this.ranges.length - 1] : null;
|
|
4634
|
+
if (h && J(h, u))
|
|
4449
4635
|
return !1;
|
|
4450
4636
|
c ? this.ranges.length > 0 ? this.ranges[this.ranges.length - 1] = u : this.ranges.push(u) : this.ranges = [u], this.activeRange = u;
|
|
4451
4637
|
} else if (c) {
|
|
@@ -4463,7 +4649,7 @@ class pn extends R {
|
|
|
4463
4649
|
endRow: t,
|
|
4464
4650
|
endCol: i
|
|
4465
4651
|
};
|
|
4466
|
-
if (this.ranges.length === 1 &&
|
|
4652
|
+
if (this.ranges.length === 1 && J(this.ranges[0], u))
|
|
4467
4653
|
return !1;
|
|
4468
4654
|
this.ranges = [u], this.activeRange = u, this.cellAnchor = { row: t, col: i };
|
|
4469
4655
|
}
|
|
@@ -4472,6 +4658,7 @@ class pn extends R {
|
|
|
4472
4658
|
return !1;
|
|
4473
4659
|
}
|
|
4474
4660
|
onKeyDown(e) {
|
|
4661
|
+
if (!this.isSelectionEnabled()) return !1;
|
|
4475
4662
|
const { mode: t } = this.config, n = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", "Tab", "Home", "End", "PageUp", "PageDown"].includes(e.key);
|
|
4476
4663
|
if (e.key === "Escape")
|
|
4477
4664
|
return t === "cell" ? this.selectedCell = null : t === "row" ? (this.selected.clear(), this.anchor = null) : t === "range" && (this.ranges = [], this.activeRange = null, this.cellAnchor = null), this.emit("selection-change", this.#t()), this.requestAfterRender(), !0;
|
|
@@ -4505,9 +4692,9 @@ class pn extends R {
|
|
|
4505
4692
|
return !1;
|
|
4506
4693
|
}
|
|
4507
4694
|
onCellMouseDown(e) {
|
|
4508
|
-
if (this.config.mode !== "range" || e.rowIndex === void 0 || e.colIndex === void 0 || e.rowIndex < 0) return;
|
|
4695
|
+
if (!this.isSelectionEnabled() || this.config.mode !== "range" || e.rowIndex === void 0 || e.colIndex === void 0 || e.rowIndex < 0) return;
|
|
4509
4696
|
const t = this.columns[e.colIndex];
|
|
4510
|
-
if (t &&
|
|
4697
|
+
if (t && K(t) || !this.isCellSelectable(e.rowIndex, e.colIndex) || e.originalEvent.shiftKey && this.cellAnchor)
|
|
4511
4698
|
return;
|
|
4512
4699
|
this.isDragging = !0;
|
|
4513
4700
|
const i = e.rowIndex, n = e.colIndex, r = e.originalEvent.ctrlKey || e.originalEvent.metaKey, o = {
|
|
@@ -4516,21 +4703,21 @@ class pn extends R {
|
|
|
4516
4703
|
endRow: i,
|
|
4517
4704
|
endCol: n
|
|
4518
4705
|
};
|
|
4519
|
-
return !r && this.ranges.length === 1 &&
|
|
4706
|
+
return !r && this.ranges.length === 1 && J(this.ranges[0], o) ? (this.cellAnchor = { row: i, col: n }, !0) : (this.cellAnchor = { row: i, col: n }, r || (this.ranges = []), this.ranges.push(o), this.activeRange = o, this.emit("selection-change", this.#t()), this.requestAfterRender(), !0);
|
|
4520
4707
|
}
|
|
4521
4708
|
onCellMouseMove(e) {
|
|
4522
|
-
if (this.config.mode !== "range" || !this.isDragging || !this.cellAnchor || e.rowIndex === void 0 || e.colIndex === void 0 || e.rowIndex < 0) return;
|
|
4709
|
+
if (!this.isSelectionEnabled() || this.config.mode !== "range" || !this.isDragging || !this.cellAnchor || e.rowIndex === void 0 || e.colIndex === void 0 || e.rowIndex < 0) return;
|
|
4523
4710
|
let t = e.colIndex;
|
|
4524
4711
|
const i = this.columns[t];
|
|
4525
|
-
if (i &&
|
|
4526
|
-
const o = this.columns.findIndex((a) => !
|
|
4712
|
+
if (i && K(i)) {
|
|
4713
|
+
const o = this.columns.findIndex((a) => !K(a));
|
|
4527
4714
|
o >= 0 && (t = o);
|
|
4528
4715
|
}
|
|
4529
|
-
const n =
|
|
4530
|
-
return r &&
|
|
4716
|
+
const n = ce(this.cellAnchor, { row: e.rowIndex, col: t }), r = this.ranges.length > 0 ? this.ranges[this.ranges.length - 1] : null;
|
|
4717
|
+
return r && J(r, n) || (this.ranges.length > 0 ? this.ranges[this.ranges.length - 1] = n : this.ranges.push(n), this.activeRange = n, this.emit("selection-change", this.#t()), this.requestAfterRender()), !0;
|
|
4531
4718
|
}
|
|
4532
4719
|
onCellMouseUp(e) {
|
|
4533
|
-
if (this.config.mode === "range" && this.isDragging)
|
|
4720
|
+
if (this.isSelectionEnabled() && this.config.mode === "range" && this.isDragging)
|
|
4534
4721
|
return this.isDragging = !1, !0;
|
|
4535
4722
|
}
|
|
4536
4723
|
#e() {
|
|
@@ -4543,22 +4730,22 @@ class pn extends R {
|
|
|
4543
4730
|
const r = e.querySelectorAll(".data-grid-row");
|
|
4544
4731
|
if (r.forEach((o) => {
|
|
4545
4732
|
o.classList.remove("selected", "row-focus"), i && o.removeAttribute("data-selectable");
|
|
4546
|
-
}), t === "row" && (
|
|
4547
|
-
const a = o.querySelector(".cell[data-row]"), l =
|
|
4733
|
+
}), t === "row" && (xe(e), r.forEach((o) => {
|
|
4734
|
+
const a = o.querySelector(".cell[data-row]"), l = ut(a);
|
|
4548
4735
|
l >= 0 && (i && !this.isRowSelectable(l) && o.setAttribute("data-selectable", "false"), this.selected.has(l) && o.classList.add("selected", "row-focus"));
|
|
4549
4736
|
})), (t === "cell" || t === "range") && i && e.querySelectorAll(".cell[data-row][data-col]").forEach((a) => {
|
|
4550
4737
|
const l = parseInt(a.getAttribute("data-row") ?? "-1", 10), d = parseInt(a.getAttribute("data-col") ?? "-1", 10);
|
|
4551
4738
|
l >= 0 && d >= 0 && (this.isCellSelectable(l, d) || a.setAttribute("data-selectable", "false"));
|
|
4552
4739
|
}), t === "range" && this.ranges.length > 0) {
|
|
4553
|
-
|
|
4554
|
-
const o = this.activeRange ?
|
|
4740
|
+
xe(e);
|
|
4741
|
+
const o = this.activeRange ? V(this.activeRange) : null, a = this.columns.findIndex((d) => !K(d));
|
|
4555
4742
|
this.columns.length - 1, e.querySelectorAll(".cell[data-row][data-col]").forEach((d) => {
|
|
4556
4743
|
const c = parseInt(d.getAttribute("data-row") ?? "-1", 10), u = parseInt(d.getAttribute("data-col") ?? "-1", 10);
|
|
4557
4744
|
if (c >= 0 && u >= 0) {
|
|
4558
4745
|
const h = this.columns[u];
|
|
4559
|
-
if (h &&
|
|
4746
|
+
if (h && K(h))
|
|
4560
4747
|
return;
|
|
4561
|
-
if (
|
|
4748
|
+
if ($e(c, u, this.ranges) && (d.classList.add("selected"), o)) {
|
|
4562
4749
|
c === o.startRow && d.classList.add("top"), c === o.endRow && d.classList.add("bottom");
|
|
4563
4750
|
const f = Math.max(o.startCol, a);
|
|
4564
4751
|
u === f && d.classList.add("first"), u === o.endCol && d.classList.add("last");
|
|
@@ -4568,6 +4755,7 @@ class pn extends R {
|
|
|
4568
4755
|
}
|
|
4569
4756
|
}
|
|
4570
4757
|
afterRender() {
|
|
4758
|
+
if (!this.isSelectionEnabled()) return;
|
|
4571
4759
|
const e = this.gridElement;
|
|
4572
4760
|
if (!e) return;
|
|
4573
4761
|
const t = e.children[0], { mode: i } = this.config;
|
|
@@ -4576,7 +4764,7 @@ class pn extends R {
|
|
|
4576
4764
|
this.pendingKeyboardUpdate = null;
|
|
4577
4765
|
const r = this.grid._focusRow, o = this.grid._focusCol;
|
|
4578
4766
|
if (n && this.cellAnchor) {
|
|
4579
|
-
const a =
|
|
4767
|
+
const a = ce(this.cellAnchor, { row: r, col: o });
|
|
4580
4768
|
this.ranges = [a], this.activeRange = a;
|
|
4581
4769
|
} else n || (this.ranges = [], this.activeRange = null, this.cellAnchor = { row: r, col: o });
|
|
4582
4770
|
this.emit("selection-change", this.#t());
|
|
@@ -4584,7 +4772,7 @@ class pn extends R {
|
|
|
4584
4772
|
this.grid.setAttribute("data-selection-mode", i), t && t.classList.toggle("selecting", this.isDragging), this.#e();
|
|
4585
4773
|
}
|
|
4586
4774
|
onScrollRender() {
|
|
4587
|
-
this.#e();
|
|
4775
|
+
this.isSelectionEnabled() && this.#e();
|
|
4588
4776
|
}
|
|
4589
4777
|
getSelection() {
|
|
4590
4778
|
return {
|
|
@@ -4594,10 +4782,10 @@ class pn extends R {
|
|
|
4594
4782
|
};
|
|
4595
4783
|
}
|
|
4596
4784
|
getSelectedCells() {
|
|
4597
|
-
return
|
|
4785
|
+
return $i(this.ranges);
|
|
4598
4786
|
}
|
|
4599
4787
|
isCellSelected(e, t) {
|
|
4600
|
-
return
|
|
4788
|
+
return $e(e, t, this.ranges);
|
|
4601
4789
|
}
|
|
4602
4790
|
clearSelection() {
|
|
4603
4791
|
this.selectedCell = null, this.selected.clear(), this.anchor = null, this.ranges = [], this.activeRange = null, this.cellAnchor = null, this.emit("selection-change", { mode: this.config.mode, ranges: [] }), this.requestAfterRender();
|
|
@@ -4610,11 +4798,11 @@ class pn extends R {
|
|
|
4610
4798
|
endCol: t.to.col
|
|
4611
4799
|
})), this.activeRange = this.ranges.length > 0 ? this.ranges[this.ranges.length - 1] : null, this.emit("selection-change", {
|
|
4612
4800
|
mode: this.config.mode,
|
|
4613
|
-
ranges:
|
|
4801
|
+
ranges: it(this.ranges)
|
|
4614
4802
|
}), this.requestAfterRender();
|
|
4615
4803
|
}
|
|
4616
4804
|
#t() {
|
|
4617
|
-
return
|
|
4805
|
+
return Ui(
|
|
4618
4806
|
this.config.mode,
|
|
4619
4807
|
{
|
|
4620
4808
|
selectedCell: this.selectedCell,
|
|
@@ -4625,23 +4813,23 @@ class pn extends R {
|
|
|
4625
4813
|
);
|
|
4626
4814
|
}
|
|
4627
4815
|
}
|
|
4628
|
-
function
|
|
4816
|
+
function ee(s, e) {
|
|
4629
4817
|
return Math.floor(s / e);
|
|
4630
4818
|
}
|
|
4631
|
-
function
|
|
4819
|
+
function Yi(s, e) {
|
|
4632
4820
|
return {
|
|
4633
4821
|
start: s * e,
|
|
4634
4822
|
end: (s + 1) * e
|
|
4635
4823
|
};
|
|
4636
4824
|
}
|
|
4637
|
-
function
|
|
4638
|
-
const i =
|
|
4825
|
+
function Xi(s, e, t) {
|
|
4826
|
+
const i = ee(s, t), n = ee(e - 1, t), r = [];
|
|
4639
4827
|
for (let o = i; o <= n; o++)
|
|
4640
4828
|
r.push(o);
|
|
4641
4829
|
return r;
|
|
4642
4830
|
}
|
|
4643
|
-
async function
|
|
4644
|
-
const n =
|
|
4831
|
+
async function je(s, e, t, i) {
|
|
4832
|
+
const n = Yi(e, t);
|
|
4645
4833
|
return s.getRows({
|
|
4646
4834
|
startRow: n.start,
|
|
4647
4835
|
endRow: n.end,
|
|
@@ -4649,14 +4837,14 @@ async function Ke(s, e, t, i) {
|
|
|
4649
4837
|
filterModel: i.filterModel
|
|
4650
4838
|
});
|
|
4651
4839
|
}
|
|
4652
|
-
function
|
|
4653
|
-
const i =
|
|
4840
|
+
function Zi(s, e, t) {
|
|
4841
|
+
const i = ee(s, e), n = t.get(i);
|
|
4654
4842
|
if (!n) return;
|
|
4655
4843
|
const r = s % e;
|
|
4656
4844
|
return n[r];
|
|
4657
4845
|
}
|
|
4658
|
-
const
|
|
4659
|
-
class
|
|
4846
|
+
const Ji = 100;
|
|
4847
|
+
class kn extends _ {
|
|
4660
4848
|
name = "serverSide";
|
|
4661
4849
|
get defaultConfig() {
|
|
4662
4850
|
return {
|
|
@@ -4676,12 +4864,12 @@ class mn extends R {
|
|
|
4676
4864
|
}
|
|
4677
4865
|
loadRequiredBlocks() {
|
|
4678
4866
|
if (!this.dataSource) return;
|
|
4679
|
-
const e = this.grid, t = this.config.cacheBlockSize ?? 100, i = { startRow: e._virtualization.start, endRow: e._virtualization.end }, n =
|
|
4867
|
+
const e = this.grid, t = this.config.cacheBlockSize ?? 100, i = { startRow: e._virtualization.start, endRow: e._virtualization.end }, n = Xi(i.startRow, i.endRow, t);
|
|
4680
4868
|
for (const r of n)
|
|
4681
4869
|
if (!(this.loadedBlocks.has(r) || this.loadingBlocks.has(r))) {
|
|
4682
4870
|
if (this.loadingBlocks.size >= (this.config.maxConcurrentRequests ?? 2))
|
|
4683
4871
|
break;
|
|
4684
|
-
this.loadingBlocks.add(r),
|
|
4872
|
+
this.loadingBlocks.add(r), je(this.dataSource, r, t, {}).then((o) => {
|
|
4685
4873
|
this.loadedBlocks.set(r, o.rows), this.totalRowCount = o.totalRowCount, this.loadingBlocks.delete(r), this.requestRender(), this.loadRequiredBlocks();
|
|
4686
4874
|
}).catch(() => {
|
|
4687
4875
|
this.loadingBlocks.delete(r);
|
|
@@ -4692,7 +4880,7 @@ class mn extends R {
|
|
|
4692
4880
|
if (!this.dataSource) return [...e];
|
|
4693
4881
|
const t = [];
|
|
4694
4882
|
for (let i = 0; i < this.totalRowCount; i++) {
|
|
4695
|
-
const n =
|
|
4883
|
+
const n = Zi(i, this.config.cacheBlockSize ?? 100, this.loadedBlocks);
|
|
4696
4884
|
t.push(n ?? { __loading: !0, __index: i });
|
|
4697
4885
|
}
|
|
4698
4886
|
return t;
|
|
@@ -4700,12 +4888,12 @@ class mn extends R {
|
|
|
4700
4888
|
onScroll(e) {
|
|
4701
4889
|
this.dataSource && (this.loadRequiredBlocks(), this.scrollDebounceTimer && clearTimeout(this.scrollDebounceTimer), this.scrollDebounceTimer = setTimeout(() => {
|
|
4702
4890
|
this.loadRequiredBlocks();
|
|
4703
|
-
},
|
|
4891
|
+
}, Ji));
|
|
4704
4892
|
}
|
|
4705
4893
|
setDataSource(e) {
|
|
4706
4894
|
this.dataSource = e, this.loadedBlocks.clear(), this.loadingBlocks.clear();
|
|
4707
4895
|
const t = this.config.cacheBlockSize ?? 100;
|
|
4708
|
-
|
|
4896
|
+
je(e, 0, t, {}).then((i) => {
|
|
4709
4897
|
this.loadedBlocks.set(0, i.rows), this.totalRowCount = i.totalRowCount, this.requestRender();
|
|
4710
4898
|
});
|
|
4711
4899
|
}
|
|
@@ -4719,59 +4907,59 @@ class mn extends R {
|
|
|
4719
4907
|
return this.totalRowCount;
|
|
4720
4908
|
}
|
|
4721
4909
|
isRowLoaded(e) {
|
|
4722
|
-
const t = this.config.cacheBlockSize ?? 100, i =
|
|
4910
|
+
const t = this.config.cacheBlockSize ?? 100, i = ee(e, t);
|
|
4723
4911
|
return this.loadedBlocks.has(i);
|
|
4724
4912
|
}
|
|
4725
4913
|
getLoadedBlockCount() {
|
|
4726
4914
|
return this.loadedBlocks.size;
|
|
4727
4915
|
}
|
|
4728
4916
|
}
|
|
4729
|
-
function
|
|
4917
|
+
function nt(s, e, t) {
|
|
4730
4918
|
return s.id !== void 0 ? String(s.id) : t ? `${t}-${e}` : String(e);
|
|
4731
4919
|
}
|
|
4732
|
-
function
|
|
4920
|
+
function ue(s, e) {
|
|
4733
4921
|
const t = new Set(s);
|
|
4734
4922
|
return t.has(e) ? t.delete(e) : t.add(e), t;
|
|
4735
4923
|
}
|
|
4736
|
-
function
|
|
4924
|
+
function fe(s, e, t = null, i = 0) {
|
|
4737
4925
|
const n = e.childrenField ?? "children", r = /* @__PURE__ */ new Set();
|
|
4738
4926
|
for (let o = 0; o < s.length; o++) {
|
|
4739
|
-
const a = s[o], l =
|
|
4927
|
+
const a = s[o], l = nt(a, o, t), d = a[n];
|
|
4740
4928
|
if (Array.isArray(d) && d.length > 0) {
|
|
4741
4929
|
r.add(l);
|
|
4742
|
-
const c =
|
|
4930
|
+
const c = fe(d, e, l, i + 1);
|
|
4743
4931
|
for (const u of c) r.add(u);
|
|
4744
4932
|
}
|
|
4745
4933
|
}
|
|
4746
4934
|
return r;
|
|
4747
4935
|
}
|
|
4748
|
-
function
|
|
4936
|
+
function Qi() {
|
|
4749
4937
|
return /* @__PURE__ */ new Set();
|
|
4750
4938
|
}
|
|
4751
|
-
function
|
|
4939
|
+
function rt(s, e, t, i = null, n = 0) {
|
|
4752
4940
|
const r = t.childrenField ?? "children";
|
|
4753
4941
|
for (let o = 0; o < s.length; o++) {
|
|
4754
|
-
const a = s[o], l =
|
|
4942
|
+
const a = s[o], l = nt(a, o, i);
|
|
4755
4943
|
if (l === e)
|
|
4756
4944
|
return [l];
|
|
4757
4945
|
const d = a[r];
|
|
4758
4946
|
if (Array.isArray(d) && d.length > 0) {
|
|
4759
|
-
const c =
|
|
4947
|
+
const c = rt(d, e, t, l, n + 1);
|
|
4760
4948
|
if (c)
|
|
4761
4949
|
return [l, ...c];
|
|
4762
4950
|
}
|
|
4763
4951
|
}
|
|
4764
4952
|
return null;
|
|
4765
4953
|
}
|
|
4766
|
-
function
|
|
4767
|
-
const n =
|
|
4954
|
+
function en(s, e, t, i) {
|
|
4955
|
+
const n = rt(s, e, t);
|
|
4768
4956
|
if (!n) return i;
|
|
4769
4957
|
const r = new Set(i);
|
|
4770
4958
|
for (let o = 0; o < n.length - 1; o++)
|
|
4771
4959
|
r.add(n[o]);
|
|
4772
4960
|
return r;
|
|
4773
4961
|
}
|
|
4774
|
-
function
|
|
4962
|
+
function Ue(s, e = "children") {
|
|
4775
4963
|
if (!Array.isArray(s) || s.length === 0) return !1;
|
|
4776
4964
|
for (const t of s) {
|
|
4777
4965
|
if (!t) continue;
|
|
@@ -4781,7 +4969,7 @@ function ze(s, e = "children") {
|
|
|
4781
4969
|
}
|
|
4782
4970
|
return !1;
|
|
4783
4971
|
}
|
|
4784
|
-
function
|
|
4972
|
+
function tn(s) {
|
|
4785
4973
|
if (!Array.isArray(s) || s.length === 0) return null;
|
|
4786
4974
|
const e = ["children", "items", "nodes", "subRows", "nested"];
|
|
4787
4975
|
for (const t of s)
|
|
@@ -4793,10 +4981,10 @@ function Wi(s) {
|
|
|
4793
4981
|
}
|
|
4794
4982
|
return null;
|
|
4795
4983
|
}
|
|
4796
|
-
const
|
|
4797
|
-
class
|
|
4984
|
+
const nn = "@layer tbw-plugins{tbw-grid{.cell[data-field=__tbw_expander]{border-right:none!important;padding:0;display:flex;align-items:center;justify-content:flex-start}.header-row .cell[data-field=__tbw_expander]{display:none}.header-row .cell[data-field=__tbw_expander]+.cell{grid-column:1 / 3}.tree-cell-wrapper{display:inline-flex;align-items:center;padding-left:calc(var(--tbw-tree-depth, 0) * var(--tbw-tree-indent-width, var(--tbw-tree-toggle-size, 1.25em)))}.tree-expander{display:flex;align-items:center;justify-content:flex-start;width:100%;height:100%;box-sizing:border-box}.tree-toggle{cursor:pointer;user-select:none;display:inline-flex;align-items:center;justify-content:center;width:var(--tbw-tree-toggle-size, 1.25em);height:var(--tbw-tree-toggle-size, 1.25em);flex-shrink:0}.tree-toggle:hover{color:var(--tbw-tree-accent, var(--tbw-color-accent))}.tree-spacer{width:var(--tbw-tree-toggle-size, 1.25em);display:inline-block;flex-shrink:0}.data-grid-row.tbw-tree-slide-in{animation:tbw-tree-slide-in var(--tbw-animation-duration, .2s) var(--tbw-animation-easing, ease-out) forwards}.data-grid-row.tbw-tree-fade-in{animation:tbw-tree-fade-in var(--tbw-animation-duration, .2s) var(--tbw-animation-easing, ease-out) forwards}}@keyframes tbw-tree-slide-in{0%{opacity:0;transform:translate(-8px)}to{opacity:1;transform:translate(0)}}@keyframes tbw-tree-fade-in{0%{opacity:0}to{opacity:1}}}";
|
|
4985
|
+
class An extends _ {
|
|
4798
4986
|
name = "tree";
|
|
4799
|
-
styles =
|
|
4987
|
+
styles = nn;
|
|
4800
4988
|
get defaultConfig() {
|
|
4801
4989
|
return {
|
|
4802
4990
|
childrenField: "children",
|
|
@@ -4822,15 +5010,15 @@ class wn extends R {
|
|
|
4822
5010
|
}
|
|
4823
5011
|
detect(e) {
|
|
4824
5012
|
if (!this.config.autoDetect) return !1;
|
|
4825
|
-
const t = e, i = this.config.childrenField ??
|
|
4826
|
-
return
|
|
5013
|
+
const t = e, i = this.config.childrenField ?? tn(t) ?? "children";
|
|
5014
|
+
return Ue(t, i);
|
|
4827
5015
|
}
|
|
4828
5016
|
processRows(e) {
|
|
4829
5017
|
const t = this.config.childrenField ?? "children", i = e;
|
|
4830
|
-
if (!
|
|
5018
|
+
if (!Ue(i, t))
|
|
4831
5019
|
return this.flattenedRows = [], this.rowKeyMap.clear(), this.previousVisibleKeys.clear(), [...e];
|
|
4832
5020
|
let n = this.withStableKeys(i);
|
|
4833
|
-
this.sortState && (n = this.sortTree(n, this.sortState.field, this.sortState.direction)), this.config.defaultExpanded && !this.initialExpansionDone && (this.expandedKeys =
|
|
5021
|
+
this.sortState && (n = this.sortTree(n, this.sortState.field, this.sortState.direction)), this.config.defaultExpanded && !this.initialExpansionDone && (this.expandedKeys = fe(n, this.config), this.initialExpansionDone = !0), this.flattenedRows = this.flattenTree(n, this.expandedKeys), this.rowKeyMap.clear(), this.keysToAnimate.clear();
|
|
4834
5022
|
const r = /* @__PURE__ */ new Set();
|
|
4835
5023
|
for (const o of this.flattenedRows)
|
|
4836
5024
|
this.rowKeyMap.set(o.key, o), r.add(o.key), !this.previousVisibleKeys.has(o.key) && o.depth > 0 && this.keysToAnimate.add(o.key);
|
|
@@ -4883,22 +5071,22 @@ class wn extends R {
|
|
|
4883
5071
|
const t = [...e];
|
|
4884
5072
|
if (t.length === 0) return t;
|
|
4885
5073
|
const i = t[0], n = i.viewRenderer, r = () => this.config, o = this.setIcon.bind(this), a = this.resolveIcon.bind(this), l = (d) => {
|
|
4886
|
-
const { row: c, value: u } = d, { showExpandIcons: h = !0, indentWidth: g } = r(), f = c, p = f.__treeDepth ?? 0,
|
|
4887
|
-
if (
|
|
5074
|
+
const { row: c, value: u } = d, { showExpandIcons: h = !0, indentWidth: g } = r(), f = c, p = f.__treeDepth ?? 0, w = document.createElement("span");
|
|
5075
|
+
if (w.className = "tree-cell-wrapper", w.style.setProperty("--tbw-tree-depth", String(p)), g !== void 0 && w.style.setProperty("--tbw-tree-indent-width", `${g}px`), h)
|
|
4888
5076
|
if (f.__treeHasChildren) {
|
|
4889
|
-
const
|
|
4890
|
-
|
|
5077
|
+
const y = document.createElement("span");
|
|
5078
|
+
y.className = `tree-toggle${f.__treeExpanded ? " expanded" : ""}`, o(y, a(f.__treeExpanded ? "collapse" : "expand")), y.setAttribute("data-tree-key", String(f.__treeKey ?? "")), w.appendChild(y);
|
|
4891
5079
|
} else {
|
|
4892
|
-
const
|
|
4893
|
-
|
|
5080
|
+
const y = document.createElement("span");
|
|
5081
|
+
y.className = "tree-spacer", w.appendChild(y);
|
|
4894
5082
|
}
|
|
4895
|
-
const
|
|
4896
|
-
if (
|
|
4897
|
-
const
|
|
4898
|
-
|
|
5083
|
+
const v = document.createElement("span");
|
|
5084
|
+
if (v.className = "tree-content", n) {
|
|
5085
|
+
const y = n(d);
|
|
5086
|
+
y instanceof Node ? v.appendChild(y) : typeof y == "string" && (v.innerHTML = y);
|
|
4899
5087
|
} else
|
|
4900
|
-
|
|
4901
|
-
return
|
|
5088
|
+
v.textContent = u != null ? String(u) : "";
|
|
5089
|
+
return w.appendChild(v), w;
|
|
4902
5090
|
};
|
|
4903
5091
|
return t[0] = { ...i, viewRenderer: l }, t;
|
|
4904
5092
|
}
|
|
@@ -4908,7 +5096,7 @@ class wn extends R {
|
|
|
4908
5096
|
const i = t.getAttribute("data-tree-key");
|
|
4909
5097
|
if (!i) return !1;
|
|
4910
5098
|
const n = this.rowKeyMap.get(i);
|
|
4911
|
-
return n ? (this.expandedKeys =
|
|
5099
|
+
return n ? (this.expandedKeys = ue(this.expandedKeys, i), this.emit("tree-expand", {
|
|
4912
5100
|
key: i,
|
|
4913
5101
|
row: n.data,
|
|
4914
5102
|
expanded: this.expandedKeys.has(i),
|
|
@@ -4919,7 +5107,7 @@ class wn extends R {
|
|
|
4919
5107
|
if (e.key !== " ") return;
|
|
4920
5108
|
const t = this.grid._focusRow, i = this.flattenedRows[t];
|
|
4921
5109
|
if (i?.hasChildren)
|
|
4922
|
-
return e.preventDefault(), this.expandedKeys =
|
|
5110
|
+
return e.preventDefault(), this.expandedKeys = ue(this.expandedKeys, i.key), this.emit("tree-expand", {
|
|
4923
5111
|
key: i.key,
|
|
4924
5112
|
row: i.data,
|
|
4925
5113
|
expanded: this.expandedKeys.has(i.key),
|
|
@@ -4952,13 +5140,13 @@ class wn extends R {
|
|
|
4952
5140
|
this.expandedKeys.delete(e), this.requestRender();
|
|
4953
5141
|
}
|
|
4954
5142
|
toggle(e) {
|
|
4955
|
-
this.expandedKeys =
|
|
5143
|
+
this.expandedKeys = ue(this.expandedKeys, e), this.requestRender();
|
|
4956
5144
|
}
|
|
4957
5145
|
expandAll() {
|
|
4958
|
-
this.expandedKeys =
|
|
5146
|
+
this.expandedKeys = fe(this.rows, this.config), this.requestRender();
|
|
4959
5147
|
}
|
|
4960
5148
|
collapseAll() {
|
|
4961
|
-
this.expandedKeys =
|
|
5149
|
+
this.expandedKeys = Qi(), this.requestRender();
|
|
4962
5150
|
}
|
|
4963
5151
|
isExpanded(e) {
|
|
4964
5152
|
return this.expandedKeys.has(e);
|
|
@@ -4973,10 +5161,10 @@ class wn extends R {
|
|
|
4973
5161
|
return this.rowKeyMap.get(e)?.data;
|
|
4974
5162
|
}
|
|
4975
5163
|
expandToKey(e) {
|
|
4976
|
-
this.expandedKeys =
|
|
5164
|
+
this.expandedKeys = en(this.rows, e, this.config, this.expandedKeys), this.requestRender();
|
|
4977
5165
|
}
|
|
4978
5166
|
}
|
|
4979
|
-
function
|
|
5167
|
+
function rn(s, e, t) {
|
|
4980
5168
|
const i = [...s.undoStack, e];
|
|
4981
5169
|
for (; i.length > t; )
|
|
4982
5170
|
i.shift();
|
|
@@ -4985,7 +5173,7 @@ function ji(s, e, t) {
|
|
|
4985
5173
|
redoStack: []
|
|
4986
5174
|
};
|
|
4987
5175
|
}
|
|
4988
|
-
function
|
|
5176
|
+
function Ye(s) {
|
|
4989
5177
|
if (s.undoStack.length === 0)
|
|
4990
5178
|
return { newState: s, action: null };
|
|
4991
5179
|
const e = [...s.undoStack], t = e.pop();
|
|
@@ -4997,7 +5185,7 @@ function Ge(s) {
|
|
|
4997
5185
|
action: t
|
|
4998
5186
|
} : { newState: s, action: null };
|
|
4999
5187
|
}
|
|
5000
|
-
function
|
|
5188
|
+
function Xe(s) {
|
|
5001
5189
|
if (s.redoStack.length === 0)
|
|
5002
5190
|
return { newState: s, action: null };
|
|
5003
5191
|
const e = [...s.redoStack], t = e.pop();
|
|
@@ -5009,16 +5197,16 @@ function Oe(s) {
|
|
|
5009
5197
|
action: t
|
|
5010
5198
|
} : { newState: s, action: null };
|
|
5011
5199
|
}
|
|
5012
|
-
function
|
|
5200
|
+
function on(s) {
|
|
5013
5201
|
return s.undoStack.length > 0;
|
|
5014
5202
|
}
|
|
5015
|
-
function
|
|
5203
|
+
function sn(s) {
|
|
5016
5204
|
return s.redoStack.length > 0;
|
|
5017
5205
|
}
|
|
5018
|
-
function
|
|
5206
|
+
function an() {
|
|
5019
5207
|
return { undoStack: [], redoStack: [] };
|
|
5020
5208
|
}
|
|
5021
|
-
function
|
|
5209
|
+
function ln(s, e, t, i) {
|
|
5022
5210
|
return {
|
|
5023
5211
|
type: "cell-edit",
|
|
5024
5212
|
rowIndex: s,
|
|
@@ -5028,7 +5216,7 @@ function Zi(s, e, t, i) {
|
|
|
5028
5216
|
timestamp: Date.now()
|
|
5029
5217
|
};
|
|
5030
5218
|
}
|
|
5031
|
-
class
|
|
5219
|
+
class _n extends _ {
|
|
5032
5220
|
static dependencies = [
|
|
5033
5221
|
{ name: "editing", required: !0, reason: "UndoRedoPlugin tracks cell edit history" }
|
|
5034
5222
|
];
|
|
@@ -5046,7 +5234,7 @@ class bn extends R {
|
|
|
5046
5234
|
onKeyDown(e) {
|
|
5047
5235
|
const t = (e.ctrlKey || e.metaKey) && e.key === "z" && !e.shiftKey, i = (e.ctrlKey || e.metaKey) && (e.key === "y" || e.key === "z" && e.shiftKey);
|
|
5048
5236
|
if (t) {
|
|
5049
|
-
const n =
|
|
5237
|
+
const n = Ye({ undoStack: this.undoStack, redoStack: this.redoStack });
|
|
5050
5238
|
if (n.action) {
|
|
5051
5239
|
const r = this.rows;
|
|
5052
5240
|
r[n.action.rowIndex] && (r[n.action.rowIndex][n.action.field] = n.action.oldValue), this.undoStack = n.newState.undoStack, this.redoStack = n.newState.redoStack, this.emit("undo", {
|
|
@@ -5057,7 +5245,7 @@ class bn extends R {
|
|
|
5057
5245
|
return !0;
|
|
5058
5246
|
}
|
|
5059
5247
|
if (i) {
|
|
5060
|
-
const n =
|
|
5248
|
+
const n = Xe({ undoStack: this.undoStack, redoStack: this.redoStack });
|
|
5061
5249
|
if (n.action) {
|
|
5062
5250
|
const r = this.rows;
|
|
5063
5251
|
r[n.action.rowIndex] && (r[n.action.rowIndex][n.action.field] = n.action.newValue), this.undoStack = n.newState.undoStack, this.redoStack = n.newState.redoStack, this.emit("redo", {
|
|
@@ -5070,7 +5258,7 @@ class bn extends R {
|
|
|
5070
5258
|
return !1;
|
|
5071
5259
|
}
|
|
5072
5260
|
recordEdit(e, t, i, n) {
|
|
5073
|
-
const r =
|
|
5261
|
+
const r = ln(e, t, i, n), o = rn(
|
|
5074
5262
|
{ undoStack: this.undoStack, redoStack: this.redoStack },
|
|
5075
5263
|
r,
|
|
5076
5264
|
this.config.maxHistorySize ?? 100
|
|
@@ -5078,7 +5266,7 @@ class bn extends R {
|
|
|
5078
5266
|
this.undoStack = o.undoStack, this.redoStack = o.redoStack;
|
|
5079
5267
|
}
|
|
5080
5268
|
undo() {
|
|
5081
|
-
const e =
|
|
5269
|
+
const e = Ye({ undoStack: this.undoStack, redoStack: this.redoStack });
|
|
5082
5270
|
if (e.action) {
|
|
5083
5271
|
const t = this.rows;
|
|
5084
5272
|
t[e.action.rowIndex] && (t[e.action.rowIndex][e.action.field] = e.action.oldValue), this.undoStack = e.newState.undoStack, this.redoStack = e.newState.redoStack, this.requestRender();
|
|
@@ -5086,7 +5274,7 @@ class bn extends R {
|
|
|
5086
5274
|
return e.action;
|
|
5087
5275
|
}
|
|
5088
5276
|
redo() {
|
|
5089
|
-
const e =
|
|
5277
|
+
const e = Xe({ undoStack: this.undoStack, redoStack: this.redoStack });
|
|
5090
5278
|
if (e.action) {
|
|
5091
5279
|
const t = this.rows;
|
|
5092
5280
|
t[e.action.rowIndex] && (t[e.action.rowIndex][e.action.field] = e.action.newValue), this.undoStack = e.newState.undoStack, this.redoStack = e.newState.redoStack, this.requestRender();
|
|
@@ -5094,13 +5282,13 @@ class bn extends R {
|
|
|
5094
5282
|
return e.action;
|
|
5095
5283
|
}
|
|
5096
5284
|
canUndo() {
|
|
5097
|
-
return
|
|
5285
|
+
return on({ undoStack: this.undoStack, redoStack: this.redoStack });
|
|
5098
5286
|
}
|
|
5099
5287
|
canRedo() {
|
|
5100
|
-
return
|
|
5288
|
+
return sn({ undoStack: this.undoStack, redoStack: this.redoStack });
|
|
5101
5289
|
}
|
|
5102
5290
|
clearHistory() {
|
|
5103
|
-
const e =
|
|
5291
|
+
const e = an();
|
|
5104
5292
|
this.undoStack = e.undoStack, this.redoStack = e.redoStack;
|
|
5105
5293
|
}
|
|
5106
5294
|
getUndoStack() {
|
|
@@ -5110,18 +5298,18 @@ class bn extends R {
|
|
|
5110
5298
|
return [...this.redoStack];
|
|
5111
5299
|
}
|
|
5112
5300
|
}
|
|
5113
|
-
const
|
|
5114
|
-
function
|
|
5301
|
+
const dn = '@layer tbw-plugins{.tbw-visibility-content{display:flex;flex-direction:column;height:100%}.tbw-visibility-list{flex:1;overflow-y:auto;padding:var(--tbw-panel-padding, var(--tbw-spacing-md, .5rem))}.tbw-visibility-row{display:flex;align-items:center;gap:var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem));padding:var(--tbw-menu-item-padding, .375rem .25rem);cursor:pointer;font-size:var(--tbw-font-size-sm, .8125rem);border-radius:var(--tbw-border-radius, .25rem);position:relative}.tbw-visibility-row:hover{background:var(--tbw-visibility-hover, var(--tbw-color-row-hover, #f3f4f6))}.tbw-visibility-row input[type=checkbox]{cursor:pointer}.tbw-visibility-row.locked span{color:var(--tbw-color-fg-muted, #888)}.tbw-visibility-handle{cursor:grab;color:var(--tbw-color-fg-muted, #888);font-size:var(--tbw-font-size-2xs, .625rem);letter-spacing:-2px;user-select:none;flex-shrink:0}.tbw-visibility-row.reorderable:hover .tbw-visibility-handle{color:var(--tbw-color-fg, #1f2937)}.tbw-visibility-label{display:flex;align-items:center;gap:var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem));flex:1;cursor:pointer}.tbw-visibility-row.dragging{opacity:.5;cursor:grabbing}.tbw-visibility-row.drop-before:before{content:"";position:absolute;left:0;right:0;top:0;height:2px;background:var(--tbw-reorder-indicator, var(--tbw-color-accent, #3b82f6))}.tbw-visibility-row.drop-after:after{content:"";position:absolute;left:0;right:0;bottom:0;height:2px;background:var(--tbw-reorder-indicator, var(--tbw-color-accent, #3b82f6))}.tbw-visibility-show-all{margin:var(--tbw-panel-padding, var(--tbw-spacing-md, .5rem));padding:var(--tbw-button-padding, .5rem .75rem);border:1px solid var(--tbw-visibility-border, var(--tbw-color-border, #e5e7eb));border-radius:var(--tbw-border-radius, .25rem);background:var(--tbw-visibility-btn-bg, var(--tbw-color-header-bg, #f9fafb));color:var(--tbw-color-fg, #1f2937);cursor:pointer;font-size:var(--tbw-font-size-sm, .8125rem)}.tbw-visibility-show-all:hover{background:var(--tbw-visibility-hover, var(--tbw-color-row-hover, #f3f4f6))}}';
|
|
5302
|
+
function Ze(s) {
|
|
5115
5303
|
const e = s.meta ?? {};
|
|
5116
5304
|
return e.lockPosition !== !0 && e.suppressMovable !== !0;
|
|
5117
5305
|
}
|
|
5118
|
-
class
|
|
5306
|
+
class B extends _ {
|
|
5119
5307
|
static dependencies = [
|
|
5120
5308
|
{ name: "reorder", required: !1, reason: "Enables drag-to-reorder columns in visibility panel" }
|
|
5121
5309
|
];
|
|
5122
5310
|
name = "visibility";
|
|
5123
5311
|
static PANEL_ID = "columns";
|
|
5124
|
-
styles =
|
|
5312
|
+
styles = dn;
|
|
5125
5313
|
get defaultConfig() {
|
|
5126
5314
|
return {
|
|
5127
5315
|
allowHideAll: !1
|
|
@@ -5142,7 +5330,7 @@ class M extends R {
|
|
|
5142
5330
|
}
|
|
5143
5331
|
getToolPanel() {
|
|
5144
5332
|
return {
|
|
5145
|
-
id:
|
|
5333
|
+
id: B.PANEL_ID,
|
|
5146
5334
|
title: "Columns",
|
|
5147
5335
|
icon: "☰",
|
|
5148
5336
|
tooltip: "Column visibility",
|
|
@@ -5151,13 +5339,13 @@ class M extends R {
|
|
|
5151
5339
|
};
|
|
5152
5340
|
}
|
|
5153
5341
|
show() {
|
|
5154
|
-
this.grid.openToolPanel(), this.grid.expandedToolPanelSections.includes(
|
|
5342
|
+
this.grid.openToolPanel(), this.grid.expandedToolPanelSections.includes(B.PANEL_ID) || this.grid.toggleToolPanelSection(B.PANEL_ID);
|
|
5155
5343
|
}
|
|
5156
5344
|
hide() {
|
|
5157
5345
|
this.grid.closeToolPanel();
|
|
5158
5346
|
}
|
|
5159
5347
|
toggle() {
|
|
5160
|
-
this.grid.isToolPanelOpen || this.grid.openToolPanel(), this.grid.toggleToolPanelSection(
|
|
5348
|
+
this.grid.isToolPanelOpen || this.grid.openToolPanel(), this.grid.toggleToolPanelSection(B.PANEL_ID);
|
|
5161
5349
|
}
|
|
5162
5350
|
isColumnVisible(e) {
|
|
5163
5351
|
return this.grid.isColumnVisible(e);
|
|
@@ -5187,7 +5375,7 @@ class M extends R {
|
|
|
5187
5375
|
return this.grid.getAllColumns();
|
|
5188
5376
|
}
|
|
5189
5377
|
isPanelVisible() {
|
|
5190
|
-
return this.grid.isToolPanelOpen && this.grid.expandedToolPanelSections.includes(
|
|
5378
|
+
return this.grid.isToolPanelOpen && this.grid.expandedToolPanelSections.includes(B.PANEL_ID);
|
|
5191
5379
|
}
|
|
5192
5380
|
renderPanelContent(e) {
|
|
5193
5381
|
const t = document.createElement("div");
|
|
@@ -5211,7 +5399,7 @@ class M extends R {
|
|
|
5211
5399
|
const i = this.grid.getAllColumns().filter((n) => !n.utility);
|
|
5212
5400
|
for (let n = 0; n < i.length; n++) {
|
|
5213
5401
|
const r = i[n], o = r.header || r.field, a = document.createElement("div");
|
|
5214
|
-
a.className = r.lockVisible ? "tbw-visibility-row locked" : "tbw-visibility-row", a.setAttribute("data-field", r.field), a.setAttribute("data-index", String(n)), t &&
|
|
5402
|
+
a.className = r.lockVisible ? "tbw-visibility-row locked" : "tbw-visibility-row", a.setAttribute("data-field", r.field), a.setAttribute("data-index", String(n)), t && Ze(r) && (a.draggable = !0, a.classList.add("reorderable"), this.setupDragListeners(a, r.field, n, e));
|
|
5215
5403
|
const l = document.createElement("label");
|
|
5216
5404
|
l.className = "tbw-visibility-label";
|
|
5217
5405
|
const d = document.createElement("input");
|
|
@@ -5219,7 +5407,7 @@ class M extends R {
|
|
|
5219
5407
|
this.grid.toggleColumnVisibility(r.field), setTimeout(() => this.rebuildToggles(e), 0);
|
|
5220
5408
|
});
|
|
5221
5409
|
const c = document.createElement("span");
|
|
5222
|
-
if (c.textContent = o, l.appendChild(d), l.appendChild(c), t &&
|
|
5410
|
+
if (c.textContent = o, l.appendChild(d), l.appendChild(c), t && Ze(r)) {
|
|
5223
5411
|
const u = document.createElement("span");
|
|
5224
5412
|
u.className = "tbw-visibility-handle", this.setIcon(u, this.resolveIcon("dragHandle")), u.title = "Drag to reorder", a.appendChild(u);
|
|
5225
5413
|
}
|
|
@@ -5259,50 +5447,50 @@ class M extends R {
|
|
|
5259
5447
|
}
|
|
5260
5448
|
}
|
|
5261
5449
|
export {
|
|
5262
|
-
|
|
5263
|
-
|
|
5264
|
-
|
|
5265
|
-
|
|
5266
|
-
|
|
5267
|
-
|
|
5268
|
-
|
|
5269
|
-
|
|
5270
|
-
|
|
5271
|
-
|
|
5272
|
-
|
|
5273
|
-
|
|
5274
|
-
|
|
5275
|
-
|
|
5276
|
-
|
|
5277
|
-
|
|
5278
|
-
|
|
5279
|
-
|
|
5280
|
-
|
|
5281
|
-
|
|
5282
|
-
|
|
5283
|
-
|
|
5284
|
-
|
|
5285
|
-
|
|
5286
|
-
|
|
5287
|
-
|
|
5288
|
-
|
|
5289
|
-
|
|
5290
|
-
|
|
5291
|
-
|
|
5292
|
-
|
|
5293
|
-
|
|
5294
|
-
|
|
5295
|
-
|
|
5296
|
-
|
|
5297
|
-
|
|
5298
|
-
|
|
5299
|
-
|
|
5300
|
-
|
|
5301
|
-
|
|
5302
|
-
|
|
5303
|
-
|
|
5304
|
-
|
|
5305
|
-
|
|
5306
|
-
|
|
5450
|
+
_ as BaseGridPlugin,
|
|
5451
|
+
un as ClipboardPlugin,
|
|
5452
|
+
hn as ColumnVirtualizationPlugin,
|
|
5453
|
+
gn as ContextMenuPlugin,
|
|
5454
|
+
Fn as DEFAULT_ANIMATION_CONFIG,
|
|
5455
|
+
st as DEFAULT_GRID_ICONS,
|
|
5456
|
+
In as DGEvents,
|
|
5457
|
+
Pn as DataGridElement,
|
|
5458
|
+
fn as EditingPlugin,
|
|
5459
|
+
pn as ExportPlugin,
|
|
5460
|
+
q as FilteringPlugin,
|
|
5461
|
+
Dn as FitModeEnum,
|
|
5462
|
+
Mn as GridCSSVars,
|
|
5463
|
+
Nn as GridClasses,
|
|
5464
|
+
qn as GridDataAttrs,
|
|
5465
|
+
Kn as GridElement,
|
|
5466
|
+
Hn as GridSelectors,
|
|
5467
|
+
mn as GroupingColumnsPlugin,
|
|
5468
|
+
wn as GroupingRowsPlugin,
|
|
5469
|
+
et as MasterDetailPlugin,
|
|
5470
|
+
bn as MultiSortPlugin,
|
|
5471
|
+
Je as PLUGIN_QUERIES,
|
|
5472
|
+
vn as PinnedColumnsPlugin,
|
|
5473
|
+
yn as PinnedRowsPlugin,
|
|
5474
|
+
O as PivotPlugin,
|
|
5475
|
+
zn as PluginEvents,
|
|
5476
|
+
Gn as PluginManager,
|
|
5477
|
+
xn as PrintPlugin,
|
|
5478
|
+
Oi as ROW_DRAG_HANDLE_FIELD,
|
|
5479
|
+
On as RenderPhase,
|
|
5480
|
+
Cn as ReorderPlugin,
|
|
5481
|
+
Rn as ResponsivePlugin,
|
|
5482
|
+
En as RowReorderPlugin,
|
|
5483
|
+
Sn as SelectionPlugin,
|
|
5484
|
+
kn as ServerSidePlugin,
|
|
5485
|
+
An as TreePlugin,
|
|
5486
|
+
_n as UndoRedoPlugin,
|
|
5487
|
+
B as VisibilityPlugin,
|
|
5488
|
+
Bn as builtInSort,
|
|
5489
|
+
Vn as createGrid,
|
|
5490
|
+
Wn as defaultComparator,
|
|
5491
|
+
_t as defaultEditorFor,
|
|
5492
|
+
mt as defaultPasteHandler,
|
|
5493
|
+
Mi as printGridIsolated,
|
|
5494
|
+
$n as queryGrid
|
|
5307
5495
|
};
|
|
5308
5496
|
//# sourceMappingURL=all.js.map
|