@toolbox-web/grid 1.4.0 → 1.5.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.
Files changed (31) hide show
  1. package/all.js +539 -473
  2. package/all.js.map +1 -1
  3. package/index.js +2 -2
  4. package/lib/plugins/export/index.d.ts +1 -1
  5. package/lib/plugins/export/index.d.ts.map +1 -1
  6. package/lib/plugins/filtering/index.d.ts +1 -1
  7. package/lib/plugins/filtering/index.d.ts.map +1 -1
  8. package/lib/plugins/grouping-rows/GroupingRowsPlugin.d.ts +12 -3
  9. package/lib/plugins/grouping-rows/GroupingRowsPlugin.d.ts.map +1 -1
  10. package/lib/plugins/grouping-rows/grouping-rows.d.ts +13 -2
  11. package/lib/plugins/grouping-rows/grouping-rows.d.ts.map +1 -1
  12. package/lib/plugins/grouping-rows/index.d.ts +1 -1
  13. package/lib/plugins/grouping-rows/index.d.ts.map +1 -1
  14. package/lib/plugins/grouping-rows/index.js +199 -125
  15. package/lib/plugins/grouping-rows/index.js.map +1 -1
  16. package/lib/plugins/grouping-rows/types.d.ts +24 -2
  17. package/lib/plugins/grouping-rows/types.d.ts.map +1 -1
  18. package/lib/plugins/master-detail/index.d.ts +1 -1
  19. package/lib/plugins/master-detail/index.d.ts.map +1 -1
  20. package/lib/plugins/pinned-rows/index.js +1 -1
  21. package/lib/plugins/undo-redo/index.d.ts +1 -1
  22. package/lib/plugins/undo-redo/index.d.ts.map +1 -1
  23. package/lib/plugins/visibility/index.d.ts +1 -1
  24. package/lib/plugins/visibility/index.d.ts.map +1 -1
  25. package/package.json +1 -1
  26. package/umd/grid.all.umd.js +23 -20
  27. package/umd/grid.all.umd.js.map +1 -1
  28. package/umd/plugins/grouping-rows.umd.js +4 -1
  29. package/umd/plugins/grouping-rows.umd.js.map +1 -1
  30. package/umd/plugins/pinned-rows.umd.js +1 -1
  31. package/umd/plugins/pinned-rows.umd.js.map +1 -1
@@ -8,6 +8,14 @@ export type { AggregatorFn, AggregatorRef } from '../../core/internal/aggregator
8
8
  export type { ExpandCollapseAnimation } from '../../core/types';
9
9
  /** Map of field names to aggregator references */
10
10
  export type AggregatorMap = Record<string, import('../../core/internal/aggregators').AggregatorRef>;
11
+ /**
12
+ * Default expanded state for group rows.
13
+ * - `boolean`: true = expand all, false = collapse all
14
+ * - `number`: expand group at this index (0-based)
15
+ * - `string`: expand group with this key
16
+ * - `string[]`: expand groups with these keys
17
+ */
18
+ export type DefaultExpandedValue = boolean | number | string | string[];
11
19
  /** Configuration options for the row grouping plugin */
12
20
  export interface GroupingRowsConfig {
13
21
  /**
@@ -15,8 +23,16 @@ export interface GroupingRowsConfig {
15
23
  * Return an array of group keys, a single key, null/false to skip grouping.
16
24
  */
17
25
  groupOn?: (row: any) => any[] | any | null | false;
18
- /** Whether groups are expanded by default (default: false) */
19
- defaultExpanded?: boolean;
26
+ /**
27
+ * Default expanded state for group rows.
28
+ * - `true`: Expand all groups initially
29
+ * - `false`: Collapse all groups initially (default)
30
+ * - `number`: Expand group at this index (0-based)
31
+ * - `string`: Expand group with this key (composite key format: "parent||child")
32
+ * - `string[]`: Expand groups with these keys
33
+ * @default false
34
+ */
35
+ defaultExpanded?: DefaultExpandedValue;
20
36
  /** Custom group row renderer - takes full control of group row rendering */
21
37
  groupRowRenderer?: (params: GroupRowRenderParams) => HTMLElement | string | void;
22
38
  /** Show row count in group headers (default: true) */
@@ -37,6 +53,12 @@ export interface GroupingRowsConfig {
37
53
  * @default 'slide'
38
54
  */
39
55
  animation?: ExpandCollapseAnimation;
56
+ /**
57
+ * Accordion mode - only one group can be expanded at a time.
58
+ * Expanding a group will automatically collapse all other groups at the same depth.
59
+ * @default false
60
+ */
61
+ accordion?: boolean;
40
62
  }
41
63
  /** Parameters passed to custom group row renderer */
42
64
  export interface GroupRowRenderParams {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/grouping-rows/types.ts"],"names":[],"mappings":"A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  * @module Plugins/Master-Detail
6
6
  */
7
7
  export { MasterDetailPlugin } from './MasterDetailPlugin';
8
- export type { ExpandCollapseAnimation, MasterDetailConfig } from './types';
8
+ export type { DetailExpandDetail, ExpandCollapseAnimation, MasterDetailConfig } from './types';
9
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/master-detail/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/master-detail/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC"}
@@ -457,7 +457,7 @@ function E(n, t, e, o, r) {
457
457
  grid: e
458
458
  };
459
459
  }
460
- const B = "@layer tbw-plugins{.tbw-footer{flex-shrink:0;z-index:var(--tbw-z-layer-pinned-rows, 20);background:var(--tbw-color-panel-bg)}.tbw-pinned-rows{display:flex;align-items:center;justify-content:space-between;padding:var(--tbw-button-padding, var(--tbw-spacing-md, .5rem) var(--tbw-spacing-lg, .75rem));background:var(--tbw-pinned-rows-bg, var(--tbw-color-panel-bg));border-top:1px solid var(--tbw-pinned-rows-border, var(--tbw-color-border));font-size:var(--tbw-font-size-xs, .75rem);color:var(--tbw-pinned-rows-color, var(--tbw-color-fg-muted));min-height:32px;box-sizing:border-box;min-width:fit-content}.tbw-pinned-rows-left,.tbw-pinned-rows-center,.tbw-pinned-rows-right{display:flex;align-items:center;gap:var(--tbw-spacing-xl, 1rem)}.tbw-pinned-rows-left{justify-content:flex-start}.tbw-pinned-rows-center{justify-content:center;flex:1}.tbw-pinned-rows-right{justify-content:flex-end}.tbw-status-panel{white-space:nowrap}.tbw-aggregation-rows{min-width:fit-content;background:var(--tbw-aggregation-bg, var(--tbw-color-header-bg))}.tbw-aggregation-rows-top{border-bottom:1px solid var(--tbw-aggregation-border, var(--tbw-color-border))}.tbw-aggregation-rows-bottom{border-top:1px solid var(--tbw-aggregation-border, var(--tbw-color-border))}.tbw-aggregation-row{display:grid;grid-template-columns:var(--tbw-column-template);font-size:var(--tbw-aggregation-font-size, .8em);font-weight:var(--tbw-aggregation-font-weight, 600)}.tbw-aggregation-cell{padding:var(--tbw-cell-padding, .125rem .5rem);min-height:var(--tbw-row-height, 1.75rem);display:flex;align-items:center;border-right:1px solid var(--tbw-color-border-cell)}.tbw-aggregation-cell:last-child{border-right:0}.tbw-aggregation-cell-full{grid-column:1 / -1;border-right:0}}";
460
+ const B = "@layer tbw-plugins{.tbw-footer{flex-shrink:0;z-index:var(--tbw-z-layer-pinned-rows, 20);background:var(--tbw-color-panel-bg)}.tbw-pinned-rows{display:flex;align-items:center;justify-content:space-between;padding:var(--tbw-button-padding, var(--tbw-spacing-md, .5rem) var(--tbw-spacing-lg, .75rem));background:var(--tbw-pinned-rows-bg, var(--tbw-color-panel-bg));border-top:1px solid var(--tbw-pinned-rows-border, var(--tbw-color-border));font-size:var(--tbw-font-size-xs, .75rem);color:var(--tbw-pinned-rows-color, var(--tbw-color-fg-muted));min-height:32px;box-sizing:border-box;min-width:fit-content}.tbw-pinned-rows-left,.tbw-pinned-rows-center,.tbw-pinned-rows-right{display:flex;align-items:center;gap:var(--tbw-spacing-xl, 1rem)}.tbw-pinned-rows-left{justify-content:flex-start}.tbw-pinned-rows-center{justify-content:center;flex:1}.tbw-pinned-rows-right{justify-content:flex-end}.tbw-status-panel{white-space:nowrap}.tbw-aggregation-rows{min-width:fit-content;background:var(--tbw-aggregation-bg, var(--tbw-color-header-bg))}.tbw-aggregation-rows-top{border-bottom:1px solid var(--tbw-aggregation-border, var(--tbw-color-border))}.tbw-aggregation-rows-bottom{border-top:1px solid var(--tbw-aggregation-border, var(--tbw-color-border))}.tbw-aggregation-row{display:grid;grid-template-columns:var(--tbw-column-template);font-size:var(--tbw-aggregation-font-size, .8em);font-weight:var(--tbw-aggregation-font-weight, 600)}.tbw-aggregation-cell{padding:var(--tbw-cell-padding, .125rem .5rem);min-height:var(--tbw-row-height, 1.75rem);display:block;align-items:center;border-right:1px solid var(--tbw-color-border-cell);overflow:hidden;text-overflow:ellipsis;white-space:var(--tbw-cell-white-space, nowrap)}.tbw-aggregation-cell:last-child{border-right:0}.tbw-aggregation-cell-full{grid-column:1 / -1;border-right:0}}";
461
461
  class x extends R {
462
462
  /** @internal */
463
463
  name = "pinnedRows";
@@ -4,6 +4,6 @@
4
4
  *
5
5
  * @module Plugins/Undo-Redo
6
6
  */
7
- export type { EditAction, UndoRedoConfig } from './types';
7
+ export type { EditAction, UndoRedoConfig, UndoRedoDetail } from './types';
8
8
  export { UndoRedoPlugin } from './UndoRedoPlugin';
9
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/undo-redo/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/undo-redo/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
@@ -4,7 +4,7 @@
4
4
  *
5
5
  * @module Plugins/Visibility
6
6
  */
7
- export type { VisibilityConfig } from './types';
7
+ export type { ColumnVisibilityDetail, VisibilityConfig } from './types';
8
8
  export { VisibilityPlugin } from './VisibilityPlugin';
9
9
  export type { ColumnReorderRequestDetail } from './VisibilityPlugin';
10
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/visibility/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,YAAY,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/visibility/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,YAAY,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toolbox-web/grid",
3
- "version": "1.4.0",
3
+ "version": "1.5.0",
4
4
  "description": "Zero-dependency, framework-agnostic data grid web component with virtualization, sorting, filtering, editing, and 20+ plugins. Works in vanilla JS, React, Vue, Angular, and any framework.",
5
5
  "type": "module",
6
6
  "main": "./index.js",