@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 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,14 @@ const h = {
|
|
|
6
6
|
sortNone: "⇅",
|
|
7
7
|
submenuArrow: "▶",
|
|
8
8
|
dragHandle: "⋮⋮",
|
|
9
|
-
toolPanel: "☰"
|
|
10
|
-
|
|
9
|
+
toolPanel: "☰",
|
|
10
|
+
filter: d,
|
|
11
|
+
filterActive: d
|
|
12
|
+
}, y = {
|
|
11
13
|
/** Ask if a column can be moved. Context: ColumnConfig. Response: boolean | undefined */
|
|
12
14
|
CAN_MOVE_COLUMN: "canMoveColumn"
|
|
13
15
|
};
|
|
14
|
-
class
|
|
16
|
+
class m {
|
|
15
17
|
/**
|
|
16
18
|
* Plugin dependencies - declare other plugins this one requires.
|
|
17
19
|
*
|
|
@@ -235,7 +237,7 @@ class y {
|
|
|
235
237
|
*/
|
|
236
238
|
get gridIcons() {
|
|
237
239
|
const t = this.grid?.gridConfig?.icons ?? {};
|
|
238
|
-
return { ...
|
|
240
|
+
return { ...g, ...t };
|
|
239
241
|
}
|
|
240
242
|
// #region Animation Helpers
|
|
241
243
|
/**
|
|
@@ -311,16 +313,16 @@ class y {
|
|
|
311
313
|
}
|
|
312
314
|
// #endregion
|
|
313
315
|
}
|
|
314
|
-
function
|
|
316
|
+
function p(r) {
|
|
315
317
|
return r.filter((t) => t.sticky === "left");
|
|
316
318
|
}
|
|
317
|
-
function
|
|
319
|
+
function k(r) {
|
|
318
320
|
return r.filter((t) => t.sticky === "right");
|
|
319
321
|
}
|
|
320
|
-
function
|
|
322
|
+
function a(r) {
|
|
321
323
|
return r.some((t) => t.sticky === "left" || t.sticky === "right");
|
|
322
324
|
}
|
|
323
|
-
function
|
|
325
|
+
function u(r, t) {
|
|
324
326
|
const e = Array.from(r.querySelectorAll(".header-row .cell"));
|
|
325
327
|
if (!e.length) return;
|
|
326
328
|
const s = /* @__PURE__ */ new Map();
|
|
@@ -344,12 +346,12 @@ function a(r, t) {
|
|
|
344
346
|
}), f += i.offsetWidth);
|
|
345
347
|
}
|
|
346
348
|
}
|
|
347
|
-
function
|
|
349
|
+
function h(r) {
|
|
348
350
|
r.querySelectorAll(".sticky-left, .sticky-right").forEach((e) => {
|
|
349
351
|
e.classList.remove("sticky-left", "sticky-right"), e.style.position = "", e.style.left = "", e.style.right = "";
|
|
350
352
|
});
|
|
351
353
|
}
|
|
352
|
-
class
|
|
354
|
+
class C extends m {
|
|
353
355
|
/**
|
|
354
356
|
* Plugin manifest - declares owned properties for configuration validation.
|
|
355
357
|
* @internal
|
|
@@ -387,25 +389,25 @@ class k extends y {
|
|
|
387
389
|
*/
|
|
388
390
|
static detect(t, e) {
|
|
389
391
|
const s = e?.columns;
|
|
390
|
-
return Array.isArray(s) ?
|
|
392
|
+
return Array.isArray(s) ? a(s) : !1;
|
|
391
393
|
}
|
|
392
394
|
// #endregion
|
|
393
395
|
// #region Hooks
|
|
394
396
|
/** @internal */
|
|
395
397
|
processColumns(t) {
|
|
396
|
-
return this.isApplied =
|
|
398
|
+
return this.isApplied = a([...t]), [...t];
|
|
397
399
|
}
|
|
398
400
|
/** @internal */
|
|
399
401
|
afterRender() {
|
|
400
402
|
if (!this.isApplied)
|
|
401
403
|
return;
|
|
402
404
|
const t = this.grid, e = [...this.columns];
|
|
403
|
-
if (!
|
|
404
|
-
|
|
405
|
+
if (!a(e)) {
|
|
406
|
+
h(t), this.isApplied = !1;
|
|
405
407
|
return;
|
|
406
408
|
}
|
|
407
409
|
queueMicrotask(() => {
|
|
408
|
-
|
|
410
|
+
u(t, e);
|
|
409
411
|
});
|
|
410
412
|
}
|
|
411
413
|
/**
|
|
@@ -414,7 +416,7 @@ class k extends y {
|
|
|
414
416
|
*/
|
|
415
417
|
onPluginQuery(t) {
|
|
416
418
|
switch (t.type) {
|
|
417
|
-
case
|
|
419
|
+
case y.CAN_MOVE_COLUMN: {
|
|
418
420
|
const e = t.context, s = e.sticky;
|
|
419
421
|
if (s === "left" || s === "right")
|
|
420
422
|
return !1;
|
|
@@ -432,27 +434,27 @@ class k extends y {
|
|
|
432
434
|
*/
|
|
433
435
|
refreshStickyOffsets() {
|
|
434
436
|
const t = [...this.columns];
|
|
435
|
-
|
|
437
|
+
u(this.grid, t);
|
|
436
438
|
}
|
|
437
439
|
/**
|
|
438
440
|
* Get columns pinned to the left.
|
|
439
441
|
*/
|
|
440
442
|
getLeftPinnedColumns() {
|
|
441
443
|
const t = [...this.columns];
|
|
442
|
-
return
|
|
444
|
+
return p(t);
|
|
443
445
|
}
|
|
444
446
|
/**
|
|
445
447
|
* Get columns pinned to the right.
|
|
446
448
|
*/
|
|
447
449
|
getRightPinnedColumns() {
|
|
448
450
|
const t = [...this.columns];
|
|
449
|
-
return
|
|
451
|
+
return k(t);
|
|
450
452
|
}
|
|
451
453
|
/**
|
|
452
454
|
* Clear all sticky positioning.
|
|
453
455
|
*/
|
|
454
456
|
clearStickyPositions() {
|
|
455
|
-
|
|
457
|
+
h(this.grid);
|
|
456
458
|
}
|
|
457
459
|
/**
|
|
458
460
|
* Report horizontal scroll boundary offsets for pinned columns.
|
|
@@ -480,6 +482,6 @@ class k extends y {
|
|
|
480
482
|
// #endregion
|
|
481
483
|
}
|
|
482
484
|
export {
|
|
483
|
-
|
|
485
|
+
C as PinnedColumnsPlugin
|
|
484
486
|
};
|
|
485
487
|
//# sourceMappingURL=index.js.map
|