@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
|
@@ -102,6 +102,7 @@ export interface PasteDetail {
|
|
|
102
102
|
* Behavior:
|
|
103
103
|
* - Single cell selection: paste expands freely, adds new rows if needed
|
|
104
104
|
* - Range/row selection: paste is clipped to fit within selection bounds
|
|
105
|
+
* - Non-editable columns: values are skipped (column alignment preserved)
|
|
105
106
|
*
|
|
106
107
|
* @param detail - The parsed paste data from clipboard
|
|
107
108
|
* @param grid - The grid element to update
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/clipboard/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAEjE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,WAAW,KAAK,OAAO,GAAG,IAAI,CAAC;AAEtF,qDAAqD;AACrD,MAAM,WAAW,eAAe;IAC9B,6DAA6D;IAC7D,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,yDAAyD;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sDAAsD;IACtD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sDAAsD;IACtD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,sDAAsD;IACtD,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,KAAK,MAAM,CAAC;IACtE;;;;;;;;;OASG;IACH,YAAY,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;CACpC;AAED,qDAAqD;AACrD,MAAM,WAAW,cAAc;IAC7B,qDAAqD;IACrD,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,6DAA6D;AAC7D,MAAM,WAAW,UAAU;IACzB,4CAA4C;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,4BAA4B;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,+BAA+B;IAC/B,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,8DAA8D;AAC9D,MAAM,WAAW,WAAW;IAC1B,gDAAgD;IAChD,GAAG,EAAE,MAAM,CAAC;IACZ,mDAAmD;IACnD,GAAG,EAAE,MAAM,CAAC;IACZ,uDAAuD;IACvD,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,MAAM,EAAE;QACN,gCAAgC;QAChC,MAAM,EAAE,MAAM,CAAC;QACf,mCAAmC;QACnC,MAAM,EAAE,MAAM,CAAC;KAChB,GAAG,IAAI,CAAC;CACV;AAED,mDAAmD;AACnD,MAAM,WAAW,WAAW;IAC1B,2DAA2D;IAC3D,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC;IACjB,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,gGAAgG;IAChG,MAAM,EAAE,WAAW,GAAG,IAAI,CAAC;IAC3B;;;;OAIG;IACH,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/clipboard/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAEjE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,WAAW,KAAK,OAAO,GAAG,IAAI,CAAC;AAEtF,qDAAqD;AACrD,MAAM,WAAW,eAAe;IAC9B,6DAA6D;IAC7D,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,yDAAyD;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sDAAsD;IACtD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sDAAsD;IACtD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,sDAAsD;IACtD,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,O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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>', b = {
|
|
2
2
|
expand: "▶",
|
|
3
3
|
collapse: "▼",
|
|
4
4
|
sortAsc: "▲",
|
|
@@ -6,9 +6,11 @@ const C = {
|
|
|
6
6
|
sortNone: "⇅",
|
|
7
7
|
submenuArrow: "▶",
|
|
8
8
|
dragHandle: "⋮⋮",
|
|
9
|
-
toolPanel: "☰"
|
|
9
|
+
toolPanel: "☰",
|
|
10
|
+
filter: d,
|
|
11
|
+
filterActive: d
|
|
10
12
|
};
|
|
11
|
-
class
|
|
13
|
+
class p {
|
|
12
14
|
/**
|
|
13
15
|
* Plugin dependencies - declare other plugins this one requires.
|
|
14
16
|
*
|
|
@@ -232,7 +234,7 @@ class b {
|
|
|
232
234
|
*/
|
|
233
235
|
get gridIcons() {
|
|
234
236
|
const t = this.grid?.gridConfig?.icons ?? {};
|
|
235
|
-
return { ...
|
|
237
|
+
return { ...b, ...t };
|
|
236
238
|
}
|
|
237
239
|
// #region Animation Helpers
|
|
238
240
|
/**
|
|
@@ -308,61 +310,61 @@ class b {
|
|
|
308
310
|
}
|
|
309
311
|
// #endregion
|
|
310
312
|
}
|
|
311
|
-
const
|
|
312
|
-
function a(
|
|
313
|
-
if (
|
|
314
|
-
return
|
|
315
|
-
if (typeof
|
|
316
|
-
return
|
|
317
|
-
const t = parseFloat(
|
|
318
|
-
return isNaN(t) ?
|
|
313
|
+
const c = 100;
|
|
314
|
+
function a(r) {
|
|
315
|
+
if (r == null)
|
|
316
|
+
return c;
|
|
317
|
+
if (typeof r == "number")
|
|
318
|
+
return r;
|
|
319
|
+
const t = parseFloat(r);
|
|
320
|
+
return isNaN(t) ? c : t;
|
|
319
321
|
}
|
|
320
|
-
function
|
|
321
|
-
return
|
|
322
|
+
function f(r) {
|
|
323
|
+
return r.map((t) => a(t.width));
|
|
322
324
|
}
|
|
323
|
-
function
|
|
325
|
+
function g(r) {
|
|
324
326
|
const t = [];
|
|
325
327
|
let e = 0;
|
|
326
|
-
for (const i of
|
|
328
|
+
for (const i of r)
|
|
327
329
|
t.push(e), e += a(i.width);
|
|
328
330
|
return t;
|
|
329
331
|
}
|
|
330
|
-
function
|
|
331
|
-
return
|
|
332
|
+
function m(r) {
|
|
333
|
+
return r.reduce((t, e) => t + a(e.width), 0);
|
|
332
334
|
}
|
|
333
|
-
function
|
|
334
|
-
const
|
|
335
|
-
if (
|
|
335
|
+
function w(r, t, e, i, n) {
|
|
336
|
+
const s = e.length;
|
|
337
|
+
if (s === 0)
|
|
336
338
|
return { startCol: 0, endCol: 0, visibleColumns: [] };
|
|
337
|
-
let o =
|
|
339
|
+
let o = v(r, e, i);
|
|
338
340
|
o = Math.max(0, o - n);
|
|
339
|
-
const
|
|
341
|
+
const C = r + t;
|
|
340
342
|
let u = o;
|
|
341
|
-
for (let l = o; l <
|
|
342
|
-
if (e[l] >=
|
|
343
|
+
for (let l = o; l < s; l++) {
|
|
344
|
+
if (e[l] >= C) {
|
|
343
345
|
u = l - 1;
|
|
344
346
|
break;
|
|
345
347
|
}
|
|
346
348
|
u = l;
|
|
347
349
|
}
|
|
348
|
-
u = Math.min(
|
|
349
|
-
const
|
|
350
|
+
u = Math.min(s - 1, u + n);
|
|
351
|
+
const h = [];
|
|
350
352
|
for (let l = o; l <= u; l++)
|
|
351
|
-
|
|
352
|
-
return { startCol: o, endCol: u, visibleColumns:
|
|
353
|
+
h.push(l);
|
|
354
|
+
return { startCol: o, endCol: u, visibleColumns: h };
|
|
353
355
|
}
|
|
354
|
-
function
|
|
356
|
+
function v(r, t, e) {
|
|
355
357
|
let i = 0, n = t.length - 1;
|
|
356
358
|
for (; i < n; ) {
|
|
357
|
-
const
|
|
358
|
-
t[
|
|
359
|
+
const s = Math.floor((i + n) / 2);
|
|
360
|
+
t[s] + e[s] <= r ? i = s + 1 : n = s;
|
|
359
361
|
}
|
|
360
362
|
return i;
|
|
361
363
|
}
|
|
362
|
-
function R(
|
|
363
|
-
return e ?
|
|
364
|
+
function R(r, t, e) {
|
|
365
|
+
return e ? r > t : !1;
|
|
364
366
|
}
|
|
365
|
-
class E extends
|
|
367
|
+
class E extends p {
|
|
366
368
|
/** @internal */
|
|
367
369
|
name = "columnVirtualization";
|
|
368
370
|
/** @internal */
|
|
@@ -387,7 +389,7 @@ class E extends b {
|
|
|
387
389
|
attach(t) {
|
|
388
390
|
super.attach(t);
|
|
389
391
|
const e = this.columns;
|
|
390
|
-
this.columnWidths =
|
|
392
|
+
this.columnWidths = f(e), this.columnOffsets = g(e), this.totalWidth = m(e), this.endCol = e.length - 1;
|
|
391
393
|
}
|
|
392
394
|
/** @internal */
|
|
393
395
|
detach() {
|
|
@@ -398,16 +400,16 @@ class E extends b {
|
|
|
398
400
|
/** @internal */
|
|
399
401
|
processColumns(t) {
|
|
400
402
|
const e = R(t.length, this.config.threshold ?? 30, this.config.autoEnable ?? !0);
|
|
401
|
-
if (this.isVirtualized = e ?? !1, this.columnWidths =
|
|
403
|
+
if (this.isVirtualized = e ?? !1, this.columnWidths = f(t), this.columnOffsets = g(t), this.totalWidth = m(t), !e)
|
|
402
404
|
return this.startCol = 0, this.endCol = t.length - 1, [...t];
|
|
403
|
-
const i = this.grid.clientWidth || 800, n =
|
|
405
|
+
const i = this.grid.clientWidth || 800, n = w(
|
|
404
406
|
this.scrollLeft,
|
|
405
407
|
i,
|
|
406
408
|
this.columnOffsets,
|
|
407
409
|
this.columnWidths,
|
|
408
410
|
this.config.overscan ?? 3
|
|
409
411
|
);
|
|
410
|
-
return this.startCol = n.startCol, this.endCol = n.endCol, n.visibleColumns.map((
|
|
412
|
+
return this.startCol = n.startCol, this.endCol = n.endCol, n.visibleColumns.map((s) => t[s]);
|
|
411
413
|
}
|
|
412
414
|
/** @internal */
|
|
413
415
|
afterRender() {
|
|
@@ -418,8 +420,8 @@ class E extends b {
|
|
|
418
420
|
i && (i.style.paddingLeft = `${e}px`), n.forEach((o) => {
|
|
419
421
|
o.style.paddingLeft = `${e}px`;
|
|
420
422
|
});
|
|
421
|
-
const
|
|
422
|
-
|
|
423
|
+
const s = t.querySelector(".rows-viewport .rows");
|
|
424
|
+
s && (s.style.width = `${this.totalWidth}px`);
|
|
423
425
|
}
|
|
424
426
|
/** @internal */
|
|
425
427
|
onScroll(t) {
|