@toolbox-web/grid 1.2.0 → 1.3.1
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/README.md +80 -22
- package/all.js +619 -571
- package/all.js.map +1 -1
- package/index.js +362 -302
- package/index.js.map +1 -1
- package/lib/core/grid.d.ts +64 -1
- package/lib/core/grid.d.ts.map +1 -1
- package/lib/core/internal/row-animation.d.ts +37 -0
- package/lib/core/internal/row-animation.d.ts.map +1 -0
- package/lib/core/types.d.ts +17 -0
- package/lib/core/types.d.ts.map +1 -1
- package/lib/plugins/clipboard/index.js +82 -76
- package/lib/plugins/clipboard/index.js.map +1 -1
- package/lib/plugins/clipboard/types.d.ts +1 -0
- package/lib/plugins/clipboard/types.d.ts.map +1 -1
- package/lib/plugins/column-virtualization/index.js +43 -41
- package/lib/plugins/column-virtualization/index.js.map +1 -1
- package/lib/plugins/context-menu/index.js +24 -22
- package/lib/plugins/context-menu/index.js.map +1 -1
- package/lib/plugins/editing/EditingPlugin.d.ts.map +1 -1
- package/lib/plugins/editing/index.js +83 -52
- package/lib/plugins/editing/index.js.map +1 -1
- package/lib/plugins/export/index.js +22 -20
- package/lib/plugins/export/index.js.map +1 -1
- package/lib/plugins/filtering/FilteringPlugin.d.ts +11 -1
- package/lib/plugins/filtering/FilteringPlugin.d.ts.map +1 -1
- package/lib/plugins/filtering/index.js +160 -125
- package/lib/plugins/filtering/index.js.map +1 -1
- package/lib/plugins/grouping-columns/index.js +20 -18
- package/lib/plugins/grouping-columns/index.js.map +1 -1
- package/lib/plugins/grouping-rows/index.js +66 -64
- package/lib/plugins/grouping-rows/index.js.map +1 -1
- package/lib/plugins/master-detail/index.js +51 -49
- package/lib/plugins/master-detail/index.js.map +1 -1
- package/lib/plugins/multi-sort/index.js +17 -15
- package/lib/plugins/multi-sort/index.js.map +1 -1
- package/lib/plugins/pinned-columns/index.js +24 -22
- package/lib/plugins/pinned-columns/index.js.map +1 -1
- package/lib/plugins/pinned-rows/index.js +25 -23
- package/lib/plugins/pinned-rows/index.js.map +1 -1
- package/lib/plugins/pivot/index.js +49 -47
- package/lib/plugins/pivot/index.js.map +1 -1
- package/lib/plugins/reorder/index.js +24 -22
- package/lib/plugins/reorder/index.js.map +1 -1
- package/lib/plugins/responsive/index.js +19 -17
- package/lib/plugins/responsive/index.js.map +1 -1
- package/lib/plugins/row-reorder/index.js +38 -36
- package/lib/plugins/row-reorder/index.js.map +1 -1
- package/lib/plugins/selection/SelectionPlugin.d.ts +13 -0
- package/lib/plugins/selection/SelectionPlugin.d.ts.map +1 -1
- package/lib/plugins/selection/index.d.ts +1 -1
- package/lib/plugins/selection/index.d.ts.map +1 -1
- package/lib/plugins/selection/index.js +118 -85
- package/lib/plugins/selection/index.js.map +1 -1
- package/lib/plugins/selection/types.d.ts +50 -6
- package/lib/plugins/selection/types.d.ts.map +1 -1
- package/lib/plugins/server-side/index.js +34 -32
- package/lib/plugins/server-side/index.js.map +1 -1
- package/lib/plugins/tree/index.js +25 -23
- package/lib/plugins/tree/index.js.map +1 -1
- package/lib/plugins/undo-redo/index.js +22 -20
- package/lib/plugins/undo-redo/index.js.map +1 -1
- package/lib/plugins/visibility/index.js +21 -19
- package/lib/plugins/visibility/index.js.map +1 -1
- package/package.json +21 -4
- package/public.d.ts +1 -1
- package/public.d.ts.map +1 -1
- package/umd/grid.all.umd.js +19 -19
- package/umd/grid.all.umd.js.map +1 -1
- package/umd/grid.umd.js +9 -9
- package/umd/grid.umd.js.map +1 -1
- package/umd/plugins/clipboard.umd.js +5 -5
- package/umd/plugins/clipboard.umd.js.map +1 -1
- package/umd/plugins/editing.umd.js +1 -1
- package/umd/plugins/editing.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/selection.umd.js +2 -2
- package/umd/plugins/selection.umd.js.map +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const c = '<svg viewBox="0 0 16 16" width="12" height="12"><path fill="currentColor" d="M6 10.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1-.5-.5zm-2-3a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5zm-2-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5z"/></svg>', p = {
|
|
2
2
|
expand: "▶",
|
|
3
3
|
collapse: "▼",
|
|
4
4
|
sortAsc: "▲",
|
|
@@ -6,9 +6,11 @@ const g = {
|
|
|
6
6
|
sortNone: "⇅",
|
|
7
7
|
submenuArrow: "▶",
|
|
8
8
|
dragHandle: "⋮⋮",
|
|
9
|
-
toolPanel: "☰"
|
|
9
|
+
toolPanel: "☰",
|
|
10
|
+
filter: c,
|
|
11
|
+
filterActive: c
|
|
10
12
|
};
|
|
11
|
-
class
|
|
13
|
+
class h {
|
|
12
14
|
/**
|
|
13
15
|
* Plugin dependencies - declare other plugins this one requires.
|
|
14
16
|
*
|
|
@@ -232,7 +234,7 @@ class p {
|
|
|
232
234
|
*/
|
|
233
235
|
get gridIcons() {
|
|
234
236
|
const e = this.grid?.gridConfig?.icons ?? {};
|
|
235
|
-
return { ...
|
|
237
|
+
return { ...p, ...e };
|
|
236
238
|
}
|
|
237
239
|
// #region Animation Helpers
|
|
238
240
|
/**
|
|
@@ -308,7 +310,7 @@ class p {
|
|
|
308
310
|
}
|
|
309
311
|
// #endregion
|
|
310
312
|
}
|
|
311
|
-
function
|
|
313
|
+
function g(u) {
|
|
312
314
|
if (!u.length) return [];
|
|
313
315
|
const e = /* @__PURE__ */ new Map(), r = [], t = (o, l) => {
|
|
314
316
|
if (!l.length) return;
|
|
@@ -334,13 +336,13 @@ function a(u) {
|
|
|
334
336
|
}
|
|
335
337
|
i.length && (t(n, i.slice()), i = []);
|
|
336
338
|
const d = typeof s == "string" ? s : s.id;
|
|
337
|
-
let
|
|
338
|
-
|
|
339
|
+
let a = e.get(d);
|
|
340
|
+
a || (a = {
|
|
339
341
|
id: d,
|
|
340
342
|
label: typeof s == "string" ? void 0 : s.label,
|
|
341
343
|
columns: [],
|
|
342
344
|
firstIndex: l
|
|
343
|
-
}, e.set(d,
|
|
345
|
+
}, e.set(d, a), r.push(a)), a.columns.push(o);
|
|
344
346
|
}), i.length && t(n, i), r.length === 1 && r[0].implicit && r[0].columns.length === u.length ? [] : r;
|
|
345
347
|
}
|
|
346
348
|
function f(u, e, r) {
|
|
@@ -359,7 +361,7 @@ function f(u, e, r) {
|
|
|
359
361
|
l && l.classList.add("group-end");
|
|
360
362
|
}
|
|
361
363
|
}
|
|
362
|
-
function
|
|
364
|
+
function m(u, e) {
|
|
363
365
|
if (u.length === 0) return null;
|
|
364
366
|
const r = document.createElement("div");
|
|
365
367
|
r.className = "header-group-row", r.setAttribute("role", "row");
|
|
@@ -371,11 +373,11 @@ function h(u, e) {
|
|
|
371
373
|
}
|
|
372
374
|
return r;
|
|
373
375
|
}
|
|
374
|
-
function
|
|
376
|
+
function b(u) {
|
|
375
377
|
return u.some((e) => e.group != null);
|
|
376
378
|
}
|
|
377
|
-
const
|
|
378
|
-
class
|
|
379
|
+
const w = "@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)}}";
|
|
380
|
+
class v extends h {
|
|
379
381
|
/**
|
|
380
382
|
* Plugin manifest - declares owned properties for configuration validation.
|
|
381
383
|
* @internal
|
|
@@ -398,7 +400,7 @@ class w extends p {
|
|
|
398
400
|
/** @internal */
|
|
399
401
|
name = "groupingColumns";
|
|
400
402
|
/** @internal */
|
|
401
|
-
styles =
|
|
403
|
+
styles = w;
|
|
402
404
|
/** @internal */
|
|
403
405
|
get defaultConfig() {
|
|
404
406
|
return {
|
|
@@ -424,7 +426,7 @@ class w extends p {
|
|
|
424
426
|
if (r?.columnGroups && Array.isArray(r.columnGroups) && r.columnGroups.length > 0)
|
|
425
427
|
return !0;
|
|
426
428
|
const t = r?.columns;
|
|
427
|
-
return Array.isArray(t) ?
|
|
429
|
+
return Array.isArray(t) ? b(t) : !1;
|
|
428
430
|
}
|
|
429
431
|
// #endregion
|
|
430
432
|
// #region Hooks
|
|
@@ -443,7 +445,7 @@ class w extends p {
|
|
|
443
445
|
});
|
|
444
446
|
} else
|
|
445
447
|
t = [...e];
|
|
446
|
-
const i =
|
|
448
|
+
const i = g(t);
|
|
447
449
|
return i.length === 0 ? (this.isActive = !1, this.groups = [], t) : (this.isActive = !0, this.groups = i, t);
|
|
448
450
|
}
|
|
449
451
|
/** @internal */
|
|
@@ -457,9 +459,9 @@ class w extends p {
|
|
|
457
459
|
if (!e) return;
|
|
458
460
|
const r = e.querySelector(".header-group-row");
|
|
459
461
|
r && r.remove();
|
|
460
|
-
const t = this.columns, i =
|
|
462
|
+
const t = this.columns, i = g(t);
|
|
461
463
|
if (i.length === 0) return;
|
|
462
|
-
const n =
|
|
464
|
+
const n = m(i, t);
|
|
463
465
|
if (n) {
|
|
464
466
|
n.classList.toggle("no-borders", !this.config.showGroupBorders);
|
|
465
467
|
const l = e.querySelector(".header-row");
|
|
@@ -521,6 +523,6 @@ class w extends p {
|
|
|
521
523
|
// #endregion
|
|
522
524
|
}
|
|
523
525
|
export {
|
|
524
|
-
|
|
526
|
+
v as GroupingColumnsPlugin
|
|
525
527
|
};
|
|
526
528
|
//# sourceMappingURL=index.js.map
|