@toolbox-web/grid 1.3.0 → 1.4.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.d.ts +1 -0
- package/all.d.ts.map +1 -1
- package/all.js +997 -710
- package/all.js.map +1 -1
- package/index.js +642 -599
- package/index.js.map +1 -1
- package/lib/core/grid.d.ts.map +1 -1
- package/lib/core/internal/header.d.ts +7 -0
- package/lib/core/internal/header.d.ts.map +1 -1
- package/lib/core/types.d.ts +151 -0
- package/lib/core/types.d.ts.map +1 -1
- package/lib/plugins/clipboard/index.js +19 -16
- package/lib/plugins/clipboard/index.js.map +1 -1
- package/lib/plugins/column-virtualization/index.js +42 -39
- package/lib/plugins/column-virtualization/index.js.map +1 -1
- package/lib/plugins/context-menu/index.js +25 -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 +53 -48
- package/lib/plugins/editing/index.js.map +1 -1
- package/lib/plugins/export/index.js +23 -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 +186 -150
- package/lib/plugins/filtering/index.js.map +1 -1
- package/lib/plugins/grouping-columns/index.js +21 -18
- package/lib/plugins/grouping-columns/index.js.map +1 -1
- package/lib/plugins/grouping-rows/index.js +67 -64
- package/lib/plugins/grouping-rows/index.js.map +1 -1
- package/lib/plugins/master-detail/index.js +52 -49
- package/lib/plugins/master-detail/index.js.map +1 -1
- package/lib/plugins/multi-sort/index.js +18 -15
- package/lib/plugins/multi-sort/index.js.map +1 -1
- package/lib/plugins/pinned-columns/index.js +25 -22
- package/lib/plugins/pinned-columns/index.js.map +1 -1
- package/lib/plugins/pinned-rows/index.js +26 -23
- package/lib/plugins/pinned-rows/index.js.map +1 -1
- package/lib/plugins/pivot/index.js +50 -47
- package/lib/plugins/pivot/index.js.map +1 -1
- package/lib/plugins/print/PrintPlugin.d.ts +98 -0
- package/lib/plugins/print/PrintPlugin.d.ts.map +1 -0
- package/lib/plugins/print/index.d.ts +10 -0
- package/lib/plugins/print/index.d.ts.map +1 -0
- package/lib/plugins/print/index.js +626 -0
- package/lib/plugins/print/index.js.map +1 -0
- package/lib/plugins/print/print-isolated.d.ts +26 -0
- package/lib/plugins/print/print-isolated.d.ts.map +1 -0
- package/lib/plugins/print/types.d.ts +147 -0
- package/lib/plugins/print/types.d.ts.map +1 -0
- package/lib/plugins/reorder/index.js +25 -22
- package/lib/plugins/reorder/index.js.map +1 -1
- package/lib/plugins/responsive/index.js +20 -17
- package/lib/plugins/responsive/index.js.map +1 -1
- package/lib/plugins/row-reorder/index.js +39 -36
- package/lib/plugins/row-reorder/index.js.map +1 -1
- package/lib/plugins/selection/SelectionPlugin.d.ts.map +1 -1
- package/lib/plugins/selection/index.js +115 -101
- package/lib/plugins/selection/index.js.map +1 -1
- package/lib/plugins/server-side/index.js +35 -32
- package/lib/plugins/server-side/index.js.map +1 -1
- package/lib/plugins/tree/index.js +26 -23
- package/lib/plugins/tree/index.js.map +1 -1
- package/lib/plugins/undo-redo/index.js +23 -20
- package/lib/plugins/undo-redo/index.js.map +1 -1
- package/lib/plugins/visibility/index.js +22 -19
- package/lib/plugins/visibility/index.js.map +1 -1
- package/package.json +1 -1
- package/public.d.ts +1 -1
- package/public.d.ts.map +1 -1
- package/umd/grid.all.umd.js +98 -24
- package/umd/grid.all.umd.js.map +1 -1
- package/umd/grid.umd.js +11 -11
- package/umd/grid.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/print.umd.js +76 -0
- package/umd/plugins/print.umd.js.map +1 -0
- 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 d = '<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>', g = {
|
|
2
2
|
expand: "▶",
|
|
3
3
|
collapse: "▼",
|
|
4
4
|
sortAsc: "▲",
|
|
@@ -6,12 +6,15 @@ const h = {
|
|
|
6
6
|
sortNone: "⇅",
|
|
7
7
|
submenuArrow: "▶",
|
|
8
8
|
dragHandle: "⋮⋮",
|
|
9
|
-
toolPanel: "☰"
|
|
10
|
-
|
|
9
|
+
toolPanel: "☰",
|
|
10
|
+
filter: d,
|
|
11
|
+
filterActive: d,
|
|
12
|
+
print: "🖨️"
|
|
13
|
+
}, y = {
|
|
11
14
|
/** Ask if a column can be moved. Context: ColumnConfig. Response: boolean | undefined */
|
|
12
15
|
CAN_MOVE_COLUMN: "canMoveColumn"
|
|
13
16
|
};
|
|
14
|
-
class
|
|
17
|
+
class m {
|
|
15
18
|
/**
|
|
16
19
|
* Plugin dependencies - declare other plugins this one requires.
|
|
17
20
|
*
|
|
@@ -235,7 +238,7 @@ class y {
|
|
|
235
238
|
*/
|
|
236
239
|
get gridIcons() {
|
|
237
240
|
const t = this.grid?.gridConfig?.icons ?? {};
|
|
238
|
-
return { ...
|
|
241
|
+
return { ...g, ...t };
|
|
239
242
|
}
|
|
240
243
|
// #region Animation Helpers
|
|
241
244
|
/**
|
|
@@ -311,16 +314,16 @@ class y {
|
|
|
311
314
|
}
|
|
312
315
|
// #endregion
|
|
313
316
|
}
|
|
314
|
-
function
|
|
317
|
+
function p(r) {
|
|
315
318
|
return r.filter((t) => t.sticky === "left");
|
|
316
319
|
}
|
|
317
|
-
function
|
|
320
|
+
function k(r) {
|
|
318
321
|
return r.filter((t) => t.sticky === "right");
|
|
319
322
|
}
|
|
320
|
-
function
|
|
323
|
+
function a(r) {
|
|
321
324
|
return r.some((t) => t.sticky === "left" || t.sticky === "right");
|
|
322
325
|
}
|
|
323
|
-
function
|
|
326
|
+
function u(r, t) {
|
|
324
327
|
const e = Array.from(r.querySelectorAll(".header-row .cell"));
|
|
325
328
|
if (!e.length) return;
|
|
326
329
|
const s = /* @__PURE__ */ new Map();
|
|
@@ -344,12 +347,12 @@ function a(r, t) {
|
|
|
344
347
|
}), f += i.offsetWidth);
|
|
345
348
|
}
|
|
346
349
|
}
|
|
347
|
-
function
|
|
350
|
+
function h(r) {
|
|
348
351
|
r.querySelectorAll(".sticky-left, .sticky-right").forEach((e) => {
|
|
349
352
|
e.classList.remove("sticky-left", "sticky-right"), e.style.position = "", e.style.left = "", e.style.right = "";
|
|
350
353
|
});
|
|
351
354
|
}
|
|
352
|
-
class
|
|
355
|
+
class C extends m {
|
|
353
356
|
/**
|
|
354
357
|
* Plugin manifest - declares owned properties for configuration validation.
|
|
355
358
|
* @internal
|
|
@@ -387,25 +390,25 @@ class k extends y {
|
|
|
387
390
|
*/
|
|
388
391
|
static detect(t, e) {
|
|
389
392
|
const s = e?.columns;
|
|
390
|
-
return Array.isArray(s) ?
|
|
393
|
+
return Array.isArray(s) ? a(s) : !1;
|
|
391
394
|
}
|
|
392
395
|
// #endregion
|
|
393
396
|
// #region Hooks
|
|
394
397
|
/** @internal */
|
|
395
398
|
processColumns(t) {
|
|
396
|
-
return this.isApplied =
|
|
399
|
+
return this.isApplied = a([...t]), [...t];
|
|
397
400
|
}
|
|
398
401
|
/** @internal */
|
|
399
402
|
afterRender() {
|
|
400
403
|
if (!this.isApplied)
|
|
401
404
|
return;
|
|
402
405
|
const t = this.grid, e = [...this.columns];
|
|
403
|
-
if (!
|
|
404
|
-
|
|
406
|
+
if (!a(e)) {
|
|
407
|
+
h(t), this.isApplied = !1;
|
|
405
408
|
return;
|
|
406
409
|
}
|
|
407
410
|
queueMicrotask(() => {
|
|
408
|
-
|
|
411
|
+
u(t, e);
|
|
409
412
|
});
|
|
410
413
|
}
|
|
411
414
|
/**
|
|
@@ -414,7 +417,7 @@ class k extends y {
|
|
|
414
417
|
*/
|
|
415
418
|
onPluginQuery(t) {
|
|
416
419
|
switch (t.type) {
|
|
417
|
-
case
|
|
420
|
+
case y.CAN_MOVE_COLUMN: {
|
|
418
421
|
const e = t.context, s = e.sticky;
|
|
419
422
|
if (s === "left" || s === "right")
|
|
420
423
|
return !1;
|
|
@@ -432,27 +435,27 @@ class k extends y {
|
|
|
432
435
|
*/
|
|
433
436
|
refreshStickyOffsets() {
|
|
434
437
|
const t = [...this.columns];
|
|
435
|
-
|
|
438
|
+
u(this.grid, t);
|
|
436
439
|
}
|
|
437
440
|
/**
|
|
438
441
|
* Get columns pinned to the left.
|
|
439
442
|
*/
|
|
440
443
|
getLeftPinnedColumns() {
|
|
441
444
|
const t = [...this.columns];
|
|
442
|
-
return
|
|
445
|
+
return p(t);
|
|
443
446
|
}
|
|
444
447
|
/**
|
|
445
448
|
* Get columns pinned to the right.
|
|
446
449
|
*/
|
|
447
450
|
getRightPinnedColumns() {
|
|
448
451
|
const t = [...this.columns];
|
|
449
|
-
return
|
|
452
|
+
return k(t);
|
|
450
453
|
}
|
|
451
454
|
/**
|
|
452
455
|
* Clear all sticky positioning.
|
|
453
456
|
*/
|
|
454
457
|
clearStickyPositions() {
|
|
455
|
-
|
|
458
|
+
h(this.grid);
|
|
456
459
|
}
|
|
457
460
|
/**
|
|
458
461
|
* Report horizontal scroll boundary offsets for pinned columns.
|
|
@@ -480,6 +483,6 @@ class k extends y {
|
|
|
480
483
|
// #endregion
|
|
481
484
|
}
|
|
482
485
|
export {
|
|
483
|
-
|
|
486
|
+
C as PinnedColumnsPlugin
|
|
484
487
|
};
|
|
485
488
|
//# sourceMappingURL=index.js.map
|