@toolbox-web/grid 1.0.0 → 1.1.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 +1655 -1444
- package/all.js.map +1 -1
- package/index.js +438 -401
- package/index.js.map +1 -1
- package/lib/core/grid.d.ts.map +1 -1
- package/lib/core/internal/rows.d.ts.map +1 -1
- package/lib/core/internal/validate-config.d.ts +10 -0
- package/lib/core/internal/validate-config.d.ts.map +1 -1
- package/lib/core/plugin/base-plugin.d.ts +101 -0
- package/lib/core/plugin/base-plugin.d.ts.map +1 -1
- package/lib/core/plugin/index.d.ts +1 -1
- package/lib/core/plugin/index.d.ts.map +1 -1
- package/lib/plugins/clipboard/index.js +22 -0
- package/lib/plugins/clipboard/index.js.map +1 -1
- package/lib/plugins/column-virtualization/index.js +48 -26
- package/lib/plugins/column-virtualization/index.js.map +1 -1
- package/lib/plugins/context-menu/index.js +64 -42
- package/lib/plugins/context-menu/index.js.map +1 -1
- package/lib/plugins/editing/EditingPlugin.d.ts +6 -1
- package/lib/plugins/editing/EditingPlugin.d.ts.map +1 -1
- package/lib/plugins/editing/index.js +50 -4
- package/lib/plugins/editing/index.js.map +1 -1
- package/lib/plugins/export/index.js +36 -14
- package/lib/plugins/export/index.js.map +1 -1
- package/lib/plugins/filtering/index.js +63 -41
- package/lib/plugins/filtering/index.js.map +1 -1
- package/lib/plugins/grouping-columns/GroupingColumnsPlugin.d.ts +6 -1
- package/lib/plugins/grouping-columns/GroupingColumnsPlugin.d.ts.map +1 -1
- package/lib/plugins/grouping-columns/index.js +47 -6
- package/lib/plugins/grouping-columns/index.js.map +1 -1
- package/lib/plugins/grouping-rows/index.js +22 -0
- package/lib/plugins/grouping-rows/index.js.map +1 -1
- package/lib/plugins/master-detail/index.js +22 -0
- package/lib/plugins/master-detail/index.js.map +1 -1
- package/lib/plugins/multi-sort/index.js +22 -0
- package/lib/plugins/multi-sort/index.js.map +1 -1
- package/lib/plugins/pinned-columns/PinnedColumnsPlugin.d.ts +6 -1
- package/lib/plugins/pinned-columns/PinnedColumnsPlugin.d.ts.map +1 -1
- package/lib/plugins/pinned-columns/index.js +36 -0
- package/lib/plugins/pinned-columns/index.js.map +1 -1
- package/lib/plugins/pinned-rows/index.js +22 -0
- package/lib/plugins/pinned-rows/index.js.map +1 -1
- package/lib/plugins/pivot/index.js +22 -0
- package/lib/plugins/pivot/index.js.map +1 -1
- package/lib/plugins/reorder/index.js +22 -0
- package/lib/plugins/reorder/index.js.map +1 -1
- package/lib/plugins/responsive/ResponsivePlugin.d.ts +123 -0
- package/lib/plugins/responsive/ResponsivePlugin.d.ts.map +1 -0
- package/lib/plugins/responsive/index.d.ts +11 -0
- package/lib/plugins/responsive/index.d.ts.map +1 -0
- package/lib/plugins/responsive/index.js +589 -0
- package/lib/plugins/responsive/index.js.map +1 -0
- package/lib/plugins/responsive/types.d.ts +133 -0
- package/lib/plugins/responsive/types.d.ts.map +1 -0
- package/lib/plugins/selection/SelectionPlugin.d.ts +6 -1
- 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 +105 -63
- package/lib/plugins/selection/index.js.map +1 -1
- package/lib/plugins/selection/types.d.ts +26 -0
- package/lib/plugins/selection/types.d.ts.map +1 -1
- package/lib/plugins/server-side/index.js +22 -0
- package/lib/plugins/server-side/index.js.map +1 -1
- package/lib/plugins/tree/index.js +22 -0
- package/lib/plugins/tree/index.js.map +1 -1
- package/lib/plugins/undo-redo/index.js +27 -5
- package/lib/plugins/undo-redo/index.js.map +1 -1
- package/lib/plugins/visibility/index.js +22 -0
- package/lib/plugins/visibility/index.js.map +1 -1
- package/package.json +1 -1
- package/umd/grid.all.umd.js +28 -22
- package/umd/grid.all.umd.js.map +1 -1
- package/umd/grid.umd.js +18 -14
- 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/grouping-columns.umd.js +1 -1
- package/umd/plugins/grouping-columns.umd.js.map +1 -1
- package/umd/plugins/pinned-columns.umd.js +1 -1
- package/umd/plugins/pinned-columns.umd.js.map +1 -1
- package/umd/plugins/responsive.umd.js +2 -0
- package/umd/plugins/responsive.umd.js.map +1 -0
- package/umd/plugins/selection.umd.js +3 -1
- package/umd/plugins/selection.umd.js.map +1 -1
|
@@ -25,6 +25,28 @@ class b {
|
|
|
25
25
|
* ```
|
|
26
26
|
*/
|
|
27
27
|
static dependencies;
|
|
28
|
+
/**
|
|
29
|
+
* Plugin manifest - declares owned properties, config rules, and hook priorities.
|
|
30
|
+
*
|
|
31
|
+
* This is read by the configuration validator to:
|
|
32
|
+
* - Validate that required plugins are loaded when their properties are used
|
|
33
|
+
* - Execute configRules to detect invalid/conflicting settings
|
|
34
|
+
* - Order hook execution based on priority
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```typescript
|
|
38
|
+
* static override readonly manifest: PluginManifest<MyConfig> = {
|
|
39
|
+
* ownedProperties: [
|
|
40
|
+
* { property: 'myProp', level: 'column', description: 'the "myProp" column property' },
|
|
41
|
+
* ],
|
|
42
|
+
* configRules: [
|
|
43
|
+
* { id: 'myPlugin/conflict', severity: 'warn', message: '...', check: (c) => c.a && c.b },
|
|
44
|
+
* ],
|
|
45
|
+
* };
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
49
|
+
static manifest;
|
|
28
50
|
/**
|
|
29
51
|
* Plugin version - defaults to grid version for built-in plugins.
|
|
30
52
|
* Third-party plugins can override with their own semver.
|
|
@@ -287,58 +309,58 @@ class b {
|
|
|
287
309
|
// #endregion
|
|
288
310
|
}
|
|
289
311
|
const h = 100;
|
|
290
|
-
function a(
|
|
291
|
-
if (
|
|
312
|
+
function a(s) {
|
|
313
|
+
if (s == null)
|
|
292
314
|
return h;
|
|
293
|
-
if (typeof
|
|
294
|
-
return
|
|
295
|
-
const t = parseFloat(
|
|
315
|
+
if (typeof s == "number")
|
|
316
|
+
return s;
|
|
317
|
+
const t = parseFloat(s);
|
|
296
318
|
return isNaN(t) ? h : t;
|
|
297
319
|
}
|
|
298
|
-
function c(
|
|
299
|
-
return
|
|
320
|
+
function c(s) {
|
|
321
|
+
return s.map((t) => a(t.width));
|
|
300
322
|
}
|
|
301
|
-
function f(
|
|
323
|
+
function f(s) {
|
|
302
324
|
const t = [];
|
|
303
325
|
let e = 0;
|
|
304
|
-
for (const i of
|
|
326
|
+
for (const i of s)
|
|
305
327
|
t.push(e), e += a(i.width);
|
|
306
328
|
return t;
|
|
307
329
|
}
|
|
308
|
-
function g(
|
|
309
|
-
return
|
|
330
|
+
function g(s) {
|
|
331
|
+
return s.reduce((t, e) => t + a(e.width), 0);
|
|
310
332
|
}
|
|
311
|
-
function p(
|
|
312
|
-
const
|
|
313
|
-
if (
|
|
333
|
+
function p(s, t, e, i, n) {
|
|
334
|
+
const r = e.length;
|
|
335
|
+
if (r === 0)
|
|
314
336
|
return { startCol: 0, endCol: 0, visibleColumns: [] };
|
|
315
|
-
let o = w(
|
|
337
|
+
let o = w(s, e, i);
|
|
316
338
|
o = Math.max(0, o - n);
|
|
317
|
-
const m =
|
|
339
|
+
const m = s + t;
|
|
318
340
|
let u = o;
|
|
319
|
-
for (let l = o; l <
|
|
341
|
+
for (let l = o; l < r; l++) {
|
|
320
342
|
if (e[l] >= m) {
|
|
321
343
|
u = l - 1;
|
|
322
344
|
break;
|
|
323
345
|
}
|
|
324
346
|
u = l;
|
|
325
347
|
}
|
|
326
|
-
u = Math.min(
|
|
348
|
+
u = Math.min(r - 1, u + n);
|
|
327
349
|
const d = [];
|
|
328
350
|
for (let l = o; l <= u; l++)
|
|
329
351
|
d.push(l);
|
|
330
352
|
return { startCol: o, endCol: u, visibleColumns: d };
|
|
331
353
|
}
|
|
332
|
-
function w(
|
|
354
|
+
function w(s, t, e) {
|
|
333
355
|
let i = 0, n = t.length - 1;
|
|
334
356
|
for (; i < n; ) {
|
|
335
|
-
const
|
|
336
|
-
t[
|
|
357
|
+
const r = Math.floor((i + n) / 2);
|
|
358
|
+
t[r] + e[r] <= s ? i = r + 1 : n = r;
|
|
337
359
|
}
|
|
338
360
|
return i;
|
|
339
361
|
}
|
|
340
|
-
function R(
|
|
341
|
-
return e ?
|
|
362
|
+
function R(s, t, e) {
|
|
363
|
+
return e ? s > t : !1;
|
|
342
364
|
}
|
|
343
365
|
class E extends b {
|
|
344
366
|
/** @internal */
|
|
@@ -385,7 +407,7 @@ class E extends b {
|
|
|
385
407
|
this.columnWidths,
|
|
386
408
|
this.config.overscan ?? 3
|
|
387
409
|
);
|
|
388
|
-
return this.startCol = n.startCol, this.endCol = n.endCol, n.visibleColumns.map((
|
|
410
|
+
return this.startCol = n.startCol, this.endCol = n.endCol, n.visibleColumns.map((r) => t[r]);
|
|
389
411
|
}
|
|
390
412
|
/** @internal */
|
|
391
413
|
afterRender() {
|
|
@@ -396,8 +418,8 @@ class E extends b {
|
|
|
396
418
|
i && (i.style.paddingLeft = `${e}px`), n.forEach((o) => {
|
|
397
419
|
o.style.paddingLeft = `${e}px`;
|
|
398
420
|
});
|
|
399
|
-
const
|
|
400
|
-
|
|
421
|
+
const r = t.querySelector(".rows-viewport .rows");
|
|
422
|
+
r && (r.style.width = `${this.totalWidth}px`);
|
|
401
423
|
}
|
|
402
424
|
/** @internal */
|
|
403
425
|
onScroll(t) {
|