@toolbox-web/grid 1.8.0 → 1.9.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.
Files changed (50) hide show
  1. package/all.js +554 -519
  2. package/all.js.map +1 -1
  3. package/index.js +333 -311
  4. package/index.js.map +1 -1
  5. package/lib/core/internal/keyboard.d.ts.map +1 -1
  6. package/lib/core/internal/rows.d.ts.map +1 -1
  7. package/lib/core/internal/utils.d.ts +46 -0
  8. package/lib/core/internal/utils.d.ts.map +1 -1
  9. package/lib/plugins/grouping-rows/index.js +2 -5
  10. package/lib/plugins/grouping-rows/index.js.map +1 -1
  11. package/lib/plugins/pinned-columns/PinnedColumnsPlugin.d.ts +13 -6
  12. package/lib/plugins/pinned-columns/PinnedColumnsPlugin.d.ts.map +1 -1
  13. package/lib/plugins/pinned-columns/index.js +92 -65
  14. package/lib/plugins/pinned-columns/index.js.map +1 -1
  15. package/lib/plugins/pinned-columns/pinned-columns.d.ts +24 -7
  16. package/lib/plugins/pinned-columns/pinned-columns.d.ts.map +1 -1
  17. package/lib/plugins/pinned-columns/types.d.ts +51 -2
  18. package/lib/plugins/pinned-columns/types.d.ts.map +1 -1
  19. package/lib/plugins/print/index.js +1 -1
  20. package/lib/plugins/print/index.js.map +1 -1
  21. package/lib/plugins/reorder/index.js.map +1 -1
  22. package/lib/plugins/responsive/ResponsivePlugin.d.ts.map +1 -1
  23. package/lib/plugins/responsive/index.js +245 -102
  24. package/lib/plugins/responsive/index.js.map +1 -1
  25. package/lib/plugins/row-reorder/index.js +1 -1
  26. package/lib/plugins/row-reorder/index.js.map +1 -1
  27. package/lib/plugins/selection/index.js +1 -1
  28. package/lib/plugins/selection/index.js.map +1 -1
  29. package/lib/plugins/tree/TreePlugin.d.ts.map +1 -1
  30. package/lib/plugins/tree/index.js +6 -6
  31. package/lib/plugins/tree/index.js.map +1 -1
  32. package/package.json +1 -1
  33. package/umd/grid.all.umd.js +23 -23
  34. package/umd/grid.all.umd.js.map +1 -1
  35. package/umd/grid.umd.js +9 -9
  36. package/umd/grid.umd.js.map +1 -1
  37. package/umd/plugins/grouping-rows.umd.js +1 -1
  38. package/umd/plugins/grouping-rows.umd.js.map +1 -1
  39. package/umd/plugins/pinned-columns.umd.js +1 -1
  40. package/umd/plugins/pinned-columns.umd.js.map +1 -1
  41. package/umd/plugins/print.umd.js +1 -1
  42. package/umd/plugins/print.umd.js.map +1 -1
  43. package/umd/plugins/responsive.umd.js +1 -1
  44. package/umd/plugins/responsive.umd.js.map +1 -1
  45. package/umd/plugins/row-reorder.umd.js +1 -1
  46. package/umd/plugins/row-reorder.umd.js.map +1 -1
  47. package/umd/plugins/selection.umd.js +1 -1
  48. package/umd/plugins/selection.umd.js.map +1 -1
  49. package/umd/plugins/tree.umd.js +1 -1
  50. package/umd/plugins/tree.umd.js.map +1 -1
@@ -1,18 +1,33 @@
1
- import { StickyPosition } from './types';
1
+ import { TextDirection } from '../../core/internal/utils';
2
+ import { ResolvedStickyPosition, StickyPosition } from './types';
3
+ /**
4
+ * Resolve a sticky position to a physical position based on text direction.
5
+ *
6
+ * - `'left'` / `'right'` → unchanged (physical values)
7
+ * - `'start'` → `'left'` in LTR, `'right'` in RTL
8
+ * - `'end'` → `'right'` in LTR, `'left'` in RTL
9
+ *
10
+ * @param position - The sticky position (logical or physical)
11
+ * @param direction - Text direction ('ltr' or 'rtl')
12
+ * @returns Physical sticky position ('left' or 'right')
13
+ */
14
+ export declare function resolveStickyPosition(position: StickyPosition, direction: TextDirection): ResolvedStickyPosition;
2
15
  /**
3
16
  * Get columns that should be sticky on the left.
4
17
  *
5
18
  * @param columns - Array of column configurations
6
- * @returns Array of columns with sticky='left'
19
+ * @param direction - Text direction (default: 'ltr')
20
+ * @returns Array of columns with sticky='left' or sticky='start' (in LTR)
7
21
  */
8
- export declare function getLeftStickyColumns(columns: any[]): any[];
22
+ export declare function getLeftStickyColumns(columns: any[], direction?: TextDirection): any[];
9
23
  /**
10
24
  * Get columns that should be sticky on the right.
11
25
  *
12
26
  * @param columns - Array of column configurations
13
- * @returns Array of columns with sticky='right'
27
+ * @param direction - Text direction (default: 'ltr')
28
+ * @returns Array of columns with sticky='right' or sticky='end' (in LTR)
14
29
  */
15
- export declare function getRightStickyColumns(columns: any[]): any[];
30
+ export declare function getRightStickyColumns(columns: any[], direction?: TextDirection): any[];
16
31
  /**
17
32
  * Check if any columns have sticky positioning.
18
33
  *
@@ -33,18 +48,20 @@ export declare function getColumnStickyPosition(column: any): StickyPosition | n
33
48
  *
34
49
  * @param columns - Array of column configurations (in order)
35
50
  * @param getColumnWidth - Function to get column width by field
51
+ * @param direction - Text direction (default: 'ltr')
36
52
  * @returns Map of field to left offset
37
53
  */
38
- export declare function calculateLeftStickyOffsets(columns: any[], getColumnWidth: (field: string) => number): Map<string, number>;
54
+ export declare function calculateLeftStickyOffsets(columns: any[], getColumnWidth: (field: string) => number, direction?: TextDirection): Map<string, number>;
39
55
  /**
40
56
  * Calculate right offsets for sticky-right columns.
41
57
  * Processes columns in reverse order.
42
58
  *
43
59
  * @param columns - Array of column configurations (in order)
44
60
  * @param getColumnWidth - Function to get column width by field
61
+ * @param direction - Text direction (default: 'ltr')
45
62
  * @returns Map of field to right offset
46
63
  */
47
- export declare function calculateRightStickyOffsets(columns: any[], getColumnWidth: (field: string) => number): Map<string, number>;
64
+ export declare function calculateRightStickyOffsets(columns: any[], getColumnWidth: (field: string) => number, direction?: TextDirection): Map<string, number>;
48
65
  /**
49
66
  * Apply sticky offsets to header and body cells.
50
67
  * This modifies the DOM elements in place.
@@ -1 +1 @@
1
- {"version":3,"file":"pinned-columns.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/pinned-columns/pinned-columns.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,GAAG,EAAE,CAE1D;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,GAAG,EAAE,CAE3D;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,OAAO,CAExD;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,GAAG,GAAG,cAAc,GAAG,IAAI,CAI1E;AAED;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,GAAG,EAAE,EACd,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,GACxC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAYrB;AAED;;;;;;;GAOG;AACH,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,GAAG,EAAE,EACd,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,GACxC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAcrB;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,IAAI,CAwD1E;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,CAS1D"}
1
+ {"version":3,"file":"pinned-columns.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/pinned-columns/pinned-columns.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAuC,KAAK,aAAa,EAAE,MAAM,2BAA2B,CAAC;AACpG,OAAO,KAAK,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEtE;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,cAAc,EAAE,SAAS,EAAE,aAAa,GAAG,sBAAsB,CAEhH;AAoBD;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,GAAG,EAAE,EAAE,SAAS,GAAE,aAAqB,GAAG,GAAG,EAAE,CAE5F;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,GAAG,EAAE,EAAE,SAAS,GAAE,aAAqB,GAAG,GAAG,EAAE,CAE7F;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,OAAO,CAIxD;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,GAAG,GAAG,cAAc,GAAG,IAAI,CAM1E;AAED;;;;;;;;GAQG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,GAAG,EAAE,EACd,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,EACzC,SAAS,GAAE,aAAqB,GAC/B,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAYrB;AAED;;;;;;;;GAQG;AACH,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,GAAG,EAAE,EACd,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,EACzC,SAAS,GAAE,aAAqB,GAC/B,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAcrB;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,IAAI,CA2D1E;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,CAS1D"}
@@ -3,6 +3,57 @@
3
3
  *
4
4
  * Type definitions for column pinning (sticky left/right columns).
5
5
  */
6
+ /**
7
+ * Sticky column position.
8
+ *
9
+ * **Physical values** (always pin to specified side):
10
+ * - `'left'` - Pin to left edge
11
+ * - `'right'` - Pin to right edge
12
+ *
13
+ * **Logical values** (flip based on text direction for RTL support):
14
+ * - `'start'` - Pin to inline-start (left in LTR, right in RTL)
15
+ * - `'end'` - Pin to inline-end (right in LTR, left in RTL)
16
+ *
17
+ * Use logical values (`start`/`end`) for grids that need to work in both
18
+ * LTR and RTL layouts with the same configuration.
19
+ *
20
+ * @example
21
+ * ```typescript
22
+ * // Physical - always pins to left side regardless of direction
23
+ * { field: 'id', sticky: 'left' }
24
+ *
25
+ * // Logical - pins to visual start (left in LTR, right in RTL)
26
+ * { field: 'id', sticky: 'start' }
27
+ * ```
28
+ */
29
+ export type StickyPosition = 'left' | 'right' | 'start' | 'end';
30
+ /**
31
+ * Physical sticky position after resolving logical values.
32
+ * Used internally after applying RTL resolution.
33
+ */
34
+ export type ResolvedStickyPosition = 'left' | 'right';
35
+ /**
36
+ * When PinnedColumnsPlugin is imported, the `sticky` property becomes available on column config.
37
+ * This augments the core BaseColumnConfig interface.
38
+ */
39
+ declare module '../../core/types' {
40
+ interface BaseColumnConfig<TRow, TValue> {
41
+ /**
42
+ * Pin column to an edge of the grid.
43
+ *
44
+ * **Physical values** (always pin to specified side):
45
+ * - `'left'` - Pin to left edge
46
+ * - `'right'` - Pin to right edge
47
+ *
48
+ * **Logical values** (flip based on text direction for RTL support):
49
+ * - `'start'` - Pin to inline-start (left in LTR, right in RTL)
50
+ * - `'end'` - Pin to inline-end (right in LTR, left in RTL)
51
+ *
52
+ * Requires PinnedColumnsPlugin.
53
+ */
54
+ sticky?: StickyPosition;
55
+ }
56
+ }
6
57
  /** Configuration options for the pinned columns plugin */
7
58
  export interface PinnedColumnsConfig {
8
59
  }
@@ -15,6 +66,4 @@ export interface PinnedColumnsState {
15
66
  /** Cached right offsets by field */
16
67
  rightOffsets: Map<string, number>;
17
68
  }
18
- /** Sticky column position */
19
- export type StickyPosition = 'left' | 'right';
20
69
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/pinned-columns/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,0DAA0D;AAE1D,MAAM,WAAW,mBAAmB;CAEnC;AAED,0DAA0D;AAC1D,MAAM,WAAW,kBAAkB;IACjC,mDAAmD;IACnD,SAAS,EAAE,OAAO,CAAC;IACnB,mCAAmC;IACnC,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,oCAAoC;IACpC,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACnC;AAED,6BAA6B;AAC7B,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,OAAO,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/pinned-columns/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,KAAK,CAAC;AAEhE;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAAG,MAAM,GAAG,OAAO,CAAC;AAMtD;;;GAGG;AACH,OAAO,QAAQ,kBAAkB,CAAC;IAChC,UAAU,gBAAgB,CAAC,IAAI,EAAE,MAAM;QACrC;;;;;;;;;;;;WAYG;QACH,MAAM,CAAC,EAAE,cAAc,CAAC;KACzB;CACF;AAED,0DAA0D;AAE1D,MAAM,WAAW,mBAAmB;CAEnC;AAED,0DAA0D;AAC1D,MAAM,WAAW,kBAAkB;IACjC,mDAAmD;IACnD,SAAS,EAAE,OAAO,CAAC;IACnB,mCAAmC;IACnC,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,oCAAoC;IACpC,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACnC"}
@@ -458,7 +458,7 @@ class w {
458
458
  }
459
459
  // #endregion
460
460
  }
461
- const b = ".tbw-print-header,.tbw-print-footer{display:none}@media print{tbw-grid{overflow:visible!important;height:auto!important;border:none!important;border-radius:0!important;color-scheme:light only;-webkit-print-color-adjust:exact;print-color-adjust:exact}tbw-grid .tbw-grid-content{overflow:visible!important;height:auto!important;max-height:none!important}tbw-grid .tbw-scroll-area{overflow:visible!important;height:auto!important;max-height:none!important}tbw-grid .rows-body{overflow:visible!important;height:auto!important;max-height:none!important}tbw-grid .rows-container,tbw-grid .rows-viewport,tbw-grid .rows{overflow:visible!important;height:auto!important;max-height:none!important;transform:none!important}tbw-grid .rows-viewport .rows{position:static!important}tbw-grid .resize-handle,tbw-grid [part=sort-indicator],tbw-grid .tbw-filter-btn,tbw-grid .tool-panel,tbw-grid .tool-panel-content,tbw-grid .tbw-shell-header,tbw-grid .shell-toolbar,tbw-grid .tool-panel-toggle,tbw-grid [data-print-hide],tbw-grid .expander-cell,tbw-grid .tree-toggle,tbw-grid .context-menu,tbw-grid .faux-vscroll{display:none!important}tbw-grid .tbw-print-header{display:flex;justify-content:space-between;align-items:baseline;padding:var(--tbw-spacing-md, .5em) 0;margin-bottom:var(--tbw-spacing-md, .5em);border-bottom:2px solid var(--tbw-print-border, var(--tbw-color-border-strong));font-family:inherit}.tbw-print-header-title{font-size:1.25em;font-weight:700}.tbw-print-header-timestamp{font-size:var(--tbw-font-size-sm, .875em);color:var(--tbw-print-muted, var(--tbw-color-fg-muted))}tbw-grid .tbw-print-footer{display:block;margin-top:var(--tbw-spacing-md, .5em);padding-top:var(--tbw-spacing-md, .5em);border-top:1px solid var(--tbw-print-border, var(--tbw-color-border));font-size:var(--tbw-font-size-xs, .75em);color:var(--tbw-print-muted, var(--tbw-color-fg-muted));text-align:right}tbw-grid .data-grid-row{break-inside:avoid;page-break-inside:avoid}tbw-grid .cell{border:1px solid var(--tbw-print-cell-border, var(--tbw-color-border))!important}tbw-grid .header-row,tbw-grid .data-grid-row{padding-right:1px}tbw-grid .data-grid-row:hover,tbw-grid .cell:hover{background:inherit!important}@page{margin:1cm}@page{tbw-grid.print-landscape{size:landscape}}@page{tbw-grid.print-portrait{size:portrait}}}", f = {
461
+ const b = ".tbw-print-header,.tbw-print-footer{display:none}@media print{tbw-grid{overflow:visible!important;height:auto!important;border:none!important;border-radius:0!important;color-scheme:light only;-webkit-print-color-adjust:exact;print-color-adjust:exact}tbw-grid .tbw-grid-content{overflow:visible!important;height:auto!important;max-height:none!important}tbw-grid .tbw-scroll-area{overflow:visible!important;height:auto!important;max-height:none!important}tbw-grid .rows-body{overflow:visible!important;height:auto!important;max-height:none!important}tbw-grid .rows-container,tbw-grid .rows-viewport,tbw-grid .rows{overflow:visible!important;height:auto!important;max-height:none!important;transform:none!important}tbw-grid .rows-viewport .rows{position:static!important}tbw-grid .resize-handle,tbw-grid [part=sort-indicator],tbw-grid .tbw-filter-btn,tbw-grid .tool-panel,tbw-grid .tool-panel-content,tbw-grid .tbw-shell-header,tbw-grid .shell-toolbar,tbw-grid .tool-panel-toggle,tbw-grid [data-print-hide],tbw-grid .expander-cell,tbw-grid .tree-toggle,tbw-grid .context-menu,tbw-grid .faux-vscroll{display:none!important}tbw-grid .tbw-print-header{display:flex;justify-content:space-between;align-items:baseline;padding:var(--tbw-spacing-md, .5em) 0;margin-bottom:var(--tbw-spacing-md, .5em);border-bottom:2px solid var(--tbw-print-border, var(--tbw-color-border-strong));font-family:inherit}.tbw-print-header-title{font-size:1.25em;font-weight:700}.tbw-print-header-timestamp{font-size:var(--tbw-font-size-sm, .875em);color:var(--tbw-print-muted, var(--tbw-color-fg-muted))}tbw-grid .tbw-print-footer{display:block;margin-top:var(--tbw-spacing-md, .5em);padding-top:var(--tbw-spacing-md, .5em);border-top:1px solid var(--tbw-print-border, var(--tbw-color-border));font-size:var(--tbw-font-size-xs, .75em);color:var(--tbw-print-muted, var(--tbw-color-fg-muted));text-align:end}tbw-grid .data-grid-row{break-inside:avoid;page-break-inside:avoid}tbw-grid .cell{border:1px solid var(--tbw-print-cell-border, var(--tbw-color-border))!important}tbw-grid .header-row,tbw-grid .data-grid-row{padding-inline-end:1px}tbw-grid .data-grid-row:hover,tbw-grid .cell:hover{background:inherit!important}@page{margin:1cm}@page{tbw-grid.print-landscape{size:landscape}}@page{tbw-grid.print-portrait{size:portrait}}}", f = {
462
462
  button: !1,
463
463
  orientation: "landscape",
464
464
  warnThreshold: 500,