@toolbox-web/grid 2.6.0 → 2.7.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 (57) hide show
  1. package/all.d.ts +1 -0
  2. package/all.js +2 -2
  3. package/all.js.map +1 -1
  4. package/index.js +1 -1
  5. package/index.js.map +1 -1
  6. package/lib/core/internal/aria.d.ts +4 -0
  7. package/lib/core/types.d.ts +43 -0
  8. package/lib/features/sticky-rows.d.ts +9 -0
  9. package/lib/features/sticky-rows.js +2 -0
  10. package/lib/features/sticky-rows.js.map +1 -0
  11. package/lib/plugins/clipboard/index.js.map +1 -1
  12. package/lib/plugins/column-virtualization/index.js.map +1 -1
  13. package/lib/plugins/context-menu/index.js +1 -1
  14. package/lib/plugins/context-menu/index.js.map +1 -1
  15. package/lib/plugins/editing/index.js.map +1 -1
  16. package/lib/plugins/export/index.js.map +1 -1
  17. package/lib/plugins/filtering/index.js.map +1 -1
  18. package/lib/plugins/grouping-columns/index.js.map +1 -1
  19. package/lib/plugins/grouping-rows/GroupingRowsPlugin.d.ts +15 -0
  20. package/lib/plugins/grouping-rows/index.js +2 -2
  21. package/lib/plugins/grouping-rows/index.js.map +1 -1
  22. package/lib/plugins/master-detail/index.js.map +1 -1
  23. package/lib/plugins/multi-sort/index.js.map +1 -1
  24. package/lib/plugins/pinned-columns/index.js.map +1 -1
  25. package/lib/plugins/pinned-rows/index.js.map +1 -1
  26. package/lib/plugins/pivot/index.js.map +1 -1
  27. package/lib/plugins/print/index.js.map +1 -1
  28. package/lib/plugins/reorder-columns/index.js.map +1 -1
  29. package/lib/plugins/reorder-rows/index.js.map +1 -1
  30. package/lib/plugins/responsive/index.js.map +1 -1
  31. package/lib/plugins/row-drag-drop/index.js.map +1 -1
  32. package/lib/plugins/selection/index.js.map +1 -1
  33. package/lib/plugins/server-side/index.js.map +1 -1
  34. package/lib/plugins/sticky-rows/StickyRowsPlugin.d.ts +114 -0
  35. package/lib/plugins/sticky-rows/index.d.ts +7 -0
  36. package/lib/plugins/sticky-rows/index.js +2 -0
  37. package/lib/plugins/sticky-rows/index.js.map +1 -0
  38. package/lib/plugins/sticky-rows/types.d.ts +67 -0
  39. package/lib/plugins/tooltip/index.js.map +1 -1
  40. package/lib/plugins/tree/index.js +1 -1
  41. package/lib/plugins/tree/index.js.map +1 -1
  42. package/lib/plugins/tree/types.d.ts +4 -0
  43. package/lib/plugins/undo-redo/index.js.map +1 -1
  44. package/lib/plugins/visibility/index.js.map +1 -1
  45. package/package.json +1 -1
  46. package/umd/grid.all.umd.js +1 -1
  47. package/umd/grid.all.umd.js.map +1 -1
  48. package/umd/grid.umd.js +1 -1
  49. package/umd/grid.umd.js.map +1 -1
  50. package/umd/plugins/context-menu.umd.js +1 -1
  51. package/umd/plugins/context-menu.umd.js.map +1 -1
  52. package/umd/plugins/grouping-rows.umd.js +1 -1
  53. package/umd/plugins/grouping-rows.umd.js.map +1 -1
  54. package/umd/plugins/sticky-rows.umd.js +2 -0
  55. package/umd/plugins/sticky-rows.umd.js.map +1 -0
  56. package/umd/plugins/tree.umd.js +1 -1
  57. package/umd/plugins/tree.umd.js.map +1 -1
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Sticky Rows Plugin — types.
3
+ *
4
+ * @module Plugins/Sticky Rows
5
+ */
6
+ /**
7
+ * Predicate that decides whether a given row should be sticky.
8
+ * Receives the row data and its current index in the post-processed row list.
9
+ * Return any truthy value to mark the row as sticky.
10
+ */
11
+ export type StickyPredicate = (row: unknown, index: number) => unknown;
12
+ /**
13
+ * Behavior when a new sticky row reaches the currently stuck region.
14
+ *
15
+ * - `'push'` — only one sticky row is visible at a time. As the next sticky
16
+ * row scrolls up against the stuck row, the stuck row is translated upward
17
+ * so the new one slides in (iOS section-header behavior).
18
+ * - `'stack'` — sticky rows accumulate below the header as they scroll past,
19
+ * building a column of pinned rows. Capped by {@link StickyRowsConfig.maxStacked}.
20
+ */
21
+ export type StickyRowsMode = 'push' | 'stack';
22
+ /**
23
+ * Configuration for {@link StickyRowsPlugin}.
24
+ *
25
+ * @example Field-name shorthand
26
+ * ```ts
27
+ * import '@toolbox-web/grid/features/sticky-rows';
28
+ * grid.gridConfig = { features: { stickyRows: { isSticky: 'isSection' } } };
29
+ * ```
30
+ *
31
+ * @example Predicate
32
+ * ```ts
33
+ * grid.gridConfig = {
34
+ * features: {
35
+ * stickyRows: {
36
+ * isSticky: (row, index) => row.kind === 'section',
37
+ * mode: 'stack',
38
+ * maxStacked: 3,
39
+ * },
40
+ * },
41
+ * };
42
+ * ```
43
+ */
44
+ export interface StickyRowsConfig {
45
+ /**
46
+ * Either a field name on the row (truthy value marks the row as sticky)
47
+ * or a predicate that returns a truthy/falsy value per row.
48
+ *
49
+ * Required — without it the plugin renders nothing.
50
+ */
51
+ isSticky: string | StickyPredicate;
52
+ /**
53
+ * Behavior when multiple sticky rows would be stuck simultaneously.
54
+ * @default 'push'
55
+ */
56
+ mode?: StickyRowsMode;
57
+ /**
58
+ * Maximum number of rows stacked below the header in `'stack'` mode.
59
+ * Ignored in `'push'` mode (which is always 1).
60
+ * @default Infinity
61
+ */
62
+ maxStacked?: number;
63
+ /**
64
+ * Optional class added to the stuck-row clones for custom styling.
65
+ */
66
+ className?: string;
67
+ }