@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 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>', d = {
|
|
2
2
|
expand: "▶",
|
|
3
3
|
collapse: "▼",
|
|
4
4
|
sortAsc: "▲",
|
|
@@ -6,9 +6,12 @@ const a = {
|
|
|
6
6
|
sortNone: "⇅",
|
|
7
7
|
submenuArrow: "▶",
|
|
8
8
|
dragHandle: "⋮⋮",
|
|
9
|
-
toolPanel: "☰"
|
|
9
|
+
toolPanel: "☰",
|
|
10
|
+
filter: c,
|
|
11
|
+
filterActive: c,
|
|
12
|
+
print: "🖨️"
|
|
10
13
|
};
|
|
11
|
-
class
|
|
14
|
+
class u {
|
|
12
15
|
/**
|
|
13
16
|
* Plugin dependencies - declare other plugins this one requires.
|
|
14
17
|
*
|
|
@@ -232,7 +235,7 @@ class d {
|
|
|
232
235
|
*/
|
|
233
236
|
get gridIcons() {
|
|
234
237
|
const e = this.grid?.gridConfig?.icons ?? {};
|
|
235
|
-
return { ...
|
|
238
|
+
return { ...d, ...e };
|
|
236
239
|
}
|
|
237
240
|
// #region Animation Helpers
|
|
238
241
|
/**
|
|
@@ -311,35 +314,35 @@ class d {
|
|
|
311
314
|
function l(s, e) {
|
|
312
315
|
return Math.floor(s / e);
|
|
313
316
|
}
|
|
314
|
-
function
|
|
317
|
+
function h(s, e) {
|
|
315
318
|
return {
|
|
316
319
|
start: s * e,
|
|
317
320
|
end: (s + 1) * e
|
|
318
321
|
};
|
|
319
322
|
}
|
|
320
|
-
function
|
|
321
|
-
const o = l(s, t),
|
|
322
|
-
for (let n = o; n <=
|
|
323
|
-
|
|
324
|
-
return
|
|
323
|
+
function g(s, e, t) {
|
|
324
|
+
const o = l(s, t), r = l(e - 1, t), i = [];
|
|
325
|
+
for (let n = o; n <= r; n++)
|
|
326
|
+
i.push(n);
|
|
327
|
+
return i;
|
|
325
328
|
}
|
|
326
|
-
async function
|
|
327
|
-
const
|
|
329
|
+
async function a(s, e, t, o) {
|
|
330
|
+
const r = h(e, t);
|
|
328
331
|
return s.getRows({
|
|
329
|
-
startRow:
|
|
330
|
-
endRow:
|
|
332
|
+
startRow: r.start,
|
|
333
|
+
endRow: r.end,
|
|
331
334
|
sortModel: o.sortModel,
|
|
332
335
|
filterModel: o.filterModel
|
|
333
336
|
});
|
|
334
337
|
}
|
|
335
|
-
function
|
|
336
|
-
const o = l(s, e),
|
|
337
|
-
if (!
|
|
338
|
-
const
|
|
339
|
-
return i
|
|
338
|
+
function f(s, e, t) {
|
|
339
|
+
const o = l(s, e), r = t.get(o);
|
|
340
|
+
if (!r) return;
|
|
341
|
+
const i = s % e;
|
|
342
|
+
return r[i];
|
|
340
343
|
}
|
|
341
|
-
const
|
|
342
|
-
class
|
|
344
|
+
const R = 100;
|
|
345
|
+
class k extends u {
|
|
343
346
|
/** @internal */
|
|
344
347
|
name = "serverSide";
|
|
345
348
|
/** @internal */
|
|
@@ -370,15 +373,15 @@ class R extends d {
|
|
|
370
373
|
*/
|
|
371
374
|
loadRequiredBlocks() {
|
|
372
375
|
if (!this.dataSource) return;
|
|
373
|
-
const e = this.grid, t = this.config.cacheBlockSize ?? 100, o = { startRow: e._virtualization.start, endRow: e._virtualization.end },
|
|
374
|
-
for (const
|
|
375
|
-
if (!(this.loadedBlocks.has(
|
|
376
|
+
const e = this.grid, t = this.config.cacheBlockSize ?? 100, o = { startRow: e._virtualization.start, endRow: e._virtualization.end }, r = g(o.startRow, o.endRow, t);
|
|
377
|
+
for (const i of r)
|
|
378
|
+
if (!(this.loadedBlocks.has(i) || this.loadingBlocks.has(i))) {
|
|
376
379
|
if (this.loadingBlocks.size >= (this.config.maxConcurrentRequests ?? 2))
|
|
377
380
|
break;
|
|
378
|
-
this.loadingBlocks.add(
|
|
379
|
-
this.loadedBlocks.set(
|
|
381
|
+
this.loadingBlocks.add(i), a(this.dataSource, i, t, {}).then((n) => {
|
|
382
|
+
this.loadedBlocks.set(i, n.rows), this.totalRowCount = n.totalRowCount, this.loadingBlocks.delete(i), this.requestRender(), this.loadRequiredBlocks();
|
|
380
383
|
}).catch(() => {
|
|
381
|
-
this.loadingBlocks.delete(
|
|
384
|
+
this.loadingBlocks.delete(i);
|
|
382
385
|
});
|
|
383
386
|
}
|
|
384
387
|
}
|
|
@@ -389,8 +392,8 @@ class R extends d {
|
|
|
389
392
|
if (!this.dataSource) return [...e];
|
|
390
393
|
const t = [];
|
|
391
394
|
for (let o = 0; o < this.totalRowCount; o++) {
|
|
392
|
-
const
|
|
393
|
-
t.push(
|
|
395
|
+
const r = f(o, this.config.cacheBlockSize ?? 100, this.loadedBlocks);
|
|
396
|
+
t.push(r ?? { __loading: !0, __index: o });
|
|
394
397
|
}
|
|
395
398
|
return t;
|
|
396
399
|
}
|
|
@@ -398,7 +401,7 @@ class R extends d {
|
|
|
398
401
|
onScroll(e) {
|
|
399
402
|
this.dataSource && (this.loadRequiredBlocks(), this.scrollDebounceTimer && clearTimeout(this.scrollDebounceTimer), this.scrollDebounceTimer = setTimeout(() => {
|
|
400
403
|
this.loadRequiredBlocks();
|
|
401
|
-
},
|
|
404
|
+
}, R));
|
|
402
405
|
}
|
|
403
406
|
// #endregion
|
|
404
407
|
// #region Public API
|
|
@@ -409,7 +412,7 @@ class R extends d {
|
|
|
409
412
|
setDataSource(e) {
|
|
410
413
|
this.dataSource = e, this.loadedBlocks.clear(), this.loadingBlocks.clear();
|
|
411
414
|
const t = this.config.cacheBlockSize ?? 100;
|
|
412
|
-
|
|
415
|
+
a(e, 0, t, {}).then((o) => {
|
|
413
416
|
this.loadedBlocks.set(0, o.rows), this.totalRowCount = o.totalRowCount, this.requestRender();
|
|
414
417
|
});
|
|
415
418
|
}
|
|
@@ -448,6 +451,6 @@ class R extends d {
|
|
|
448
451
|
// #endregion
|
|
449
452
|
}
|
|
450
453
|
export {
|
|
451
|
-
|
|
454
|
+
k as ServerSidePlugin
|
|
452
455
|
};
|
|
453
456
|
//# sourceMappingURL=index.js.map
|