@toolbox-web/grid 2.1.1 → 2.3.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 (90) hide show
  1. package/all.js +2 -2
  2. package/all.js.map +1 -1
  3. package/custom-elements.json +21 -2
  4. package/index.js +1 -1
  5. package/index.js.map +1 -1
  6. package/lib/core/adapter-conformance.d.ts +23 -0
  7. package/lib/core/constants.d.ts +18 -0
  8. package/lib/core/grid.d.ts +13 -15
  9. package/lib/core/internal/value-accessor.d.ts +33 -0
  10. package/lib/core/types.d.ts +186 -12
  11. package/lib/plugins/clipboard/index.js +1 -1
  12. package/lib/plugins/clipboard/index.js.map +1 -1
  13. package/lib/plugins/column-virtualization/index.js.map +1 -1
  14. package/lib/plugins/context-menu/index.js.map +1 -1
  15. package/lib/plugins/editing/index.js +1 -1
  16. package/lib/plugins/editing/index.js.map +1 -1
  17. package/lib/plugins/export/index.js +1 -1
  18. package/lib/plugins/export/index.js.map +1 -1
  19. package/lib/plugins/filtering/FilteringPlugin.d.ts +19 -1
  20. package/lib/plugins/filtering/index.js +1 -1
  21. package/lib/plugins/filtering/index.js.map +1 -1
  22. package/lib/plugins/grouping-columns/index.js.map +1 -1
  23. package/lib/plugins/grouping-rows/index.js +2 -2
  24. package/lib/plugins/grouping-rows/index.js.map +1 -1
  25. package/lib/plugins/master-detail/index.js +1 -1
  26. package/lib/plugins/master-detail/index.js.map +1 -1
  27. package/lib/plugins/multi-sort/index.js +1 -1
  28. package/lib/plugins/multi-sort/index.js.map +1 -1
  29. package/lib/plugins/pinned-columns/PinnedColumnsPlugin.d.ts +1 -1
  30. package/lib/plugins/pinned-columns/index.js +1 -1
  31. package/lib/plugins/pinned-columns/index.js.map +1 -1
  32. package/lib/plugins/pinned-columns/types.d.ts +7 -0
  33. package/lib/plugins/pinned-rows/index.js +1 -1
  34. package/lib/plugins/pinned-rows/index.js.map +1 -1
  35. package/lib/plugins/pivot/index.js.map +1 -1
  36. package/lib/plugins/print/index.js +1 -1
  37. package/lib/plugins/print/index.js.map +1 -1
  38. package/lib/plugins/reorder-columns/ReorderPlugin.d.ts +13 -1
  39. package/lib/plugins/reorder-columns/column-drag.d.ts +7 -1
  40. package/lib/plugins/reorder-columns/index.js +1 -1
  41. package/lib/plugins/reorder-columns/index.js.map +1 -1
  42. package/lib/plugins/reorder-columns/types.d.ts +12 -0
  43. package/lib/plugins/reorder-rows/index.js +1 -1
  44. package/lib/plugins/reorder-rows/index.js.map +1 -1
  45. package/lib/plugins/responsive/index.js.map +1 -1
  46. package/lib/plugins/selection/index.js +1 -1
  47. package/lib/plugins/selection/index.js.map +1 -1
  48. package/lib/plugins/selection/types.d.ts +8 -0
  49. package/lib/plugins/server-side/ServerSidePlugin.d.ts +4 -0
  50. package/lib/plugins/server-side/index.js +1 -1
  51. package/lib/plugins/server-side/index.js.map +1 -1
  52. package/lib/plugins/server-side/types.d.ts +48 -0
  53. package/lib/plugins/tooltip/index.js.map +1 -1
  54. package/lib/plugins/tree/index.js.map +1 -1
  55. package/lib/plugins/undo-redo/index.js.map +1 -1
  56. package/lib/plugins/visibility/VisibilityPlugin.d.ts +11 -1
  57. package/lib/plugins/visibility/index.js +1 -1
  58. package/lib/plugins/visibility/index.js.map +1 -1
  59. package/package.json +1 -1
  60. package/public.d.ts +5 -1
  61. package/umd/grid.all.umd.js +1 -1
  62. package/umd/grid.all.umd.js.map +1 -1
  63. package/umd/grid.umd.js +1 -1
  64. package/umd/grid.umd.js.map +1 -1
  65. package/umd/plugins/clipboard.umd.js +1 -1
  66. package/umd/plugins/clipboard.umd.js.map +1 -1
  67. package/umd/plugins/editing.umd.js +1 -1
  68. package/umd/plugins/editing.umd.js.map +1 -1
  69. package/umd/plugins/export.umd.js +1 -1
  70. package/umd/plugins/export.umd.js.map +1 -1
  71. package/umd/plugins/filtering.umd.js +1 -1
  72. package/umd/plugins/filtering.umd.js.map +1 -1
  73. package/umd/plugins/multi-sort.umd.js +1 -1
  74. package/umd/plugins/multi-sort.umd.js.map +1 -1
  75. package/umd/plugins/pinned-columns.umd.js +1 -1
  76. package/umd/plugins/pinned-columns.umd.js.map +1 -1
  77. package/umd/plugins/pinned-rows.umd.js +1 -1
  78. package/umd/plugins/pinned-rows.umd.js.map +1 -1
  79. package/umd/plugins/print.umd.js +1 -1
  80. package/umd/plugins/print.umd.js.map +1 -1
  81. package/umd/plugins/reorder-columns.umd.js +1 -1
  82. package/umd/plugins/reorder-columns.umd.js.map +1 -1
  83. package/umd/plugins/reorder-rows.umd.js +1 -1
  84. package/umd/plugins/reorder-rows.umd.js.map +1 -1
  85. package/umd/plugins/selection.umd.js +1 -1
  86. package/umd/plugins/selection.umd.js.map +1 -1
  87. package/umd/plugins/server-side.umd.js +1 -1
  88. package/umd/plugins/server-side.umd.js.map +1 -1
  89. package/umd/plugins/visibility.umd.js +1 -1
  90. package/umd/plugins/visibility.umd.js.map +1 -1
@@ -38,6 +38,26 @@ export interface ServerSideConfig {
38
38
  * @default 2
39
39
  */
40
40
  maxConcurrentRequests?: number;
41
+ /**
42
+ * Prefetch slack in **node count** (rows). When `> 0`, blocks are loaded as
43
+ * soon as the user is within `loadThreshold` rows of an unloaded block,
44
+ * rather than only when the visible window enters it. This reduces the
45
+ * number of placeholder rows the user sees during gentle scrolling at the
46
+ * cost of slightly more eager fetching.
47
+ *
48
+ * The threshold is applied symmetrically: the viewport is expanded by
49
+ * `loadThreshold` rows in both directions before block coverage is
50
+ * computed. The `maxConcurrentRequests` cap and per-block dedup still
51
+ * apply, so a large threshold during fast scrolling will not flood the
52
+ * server with requests.
53
+ *
54
+ * A reasonable starting point is `pageSize / 2`. Values larger than
55
+ * `cacheBlockSize` will eagerly request 2+ blocks ahead, which can hurt
56
+ * perceived performance with slow backends.
57
+ *
58
+ * @default 0 (fetch only when the visible window enters an unloaded block)
59
+ */
60
+ loadThreshold?: number;
41
61
  /**
42
62
  * Data source for server-side loading.
43
63
  * When provided, the plugin auto-initializes on attach — no need to call `setDataSource()`.
@@ -58,6 +78,34 @@ export interface ServerSideConfig {
58
78
  * ```
59
79
  */
60
80
  dataSource?: ServerSideDataSource;
81
+ /**
82
+ * How sort changes affect the cache.
83
+ * - `'server'` (default): purge cache and refetch via `getRows({ sortModel })`.
84
+ * Use when the backend supports the requested sort shape natively.
85
+ * - `'local'`: keep the loaded blocks; sort the loaded rows in-place via
86
+ * the active sort plugin (MultiSort or core sort). `sortModel` is **not**
87
+ * sent on subsequent block fetches. Placeholder rows (`__loading: true`)
88
+ * are pinned to the end regardless of direction.
89
+ *
90
+ * Use `'local'` when the server cannot sort by every column the user can sort
91
+ * (e.g. APIs that only support a single sort field, or no sort at all).
92
+ *
93
+ * @default 'server'
94
+ */
95
+ sortMode?: 'server' | 'local';
96
+ /**
97
+ * How filter changes affect the cache.
98
+ * - `'server'` (default): purge cache and refetch via `getRows({ filterModel })`.
99
+ * - `'local'`: keep the loaded blocks; filter only the rows currently in cache
100
+ * via FilteringPlugin's normal pipeline. `filterModel` is **not** sent on
101
+ * subsequent block fetches.
102
+ *
103
+ * In `'local'` mode the user only filters the currently loaded subset —
104
+ * scrolling further loads more blocks which then re-enter the local filter.
105
+ *
106
+ * @default 'server'
107
+ */
108
+ filterMode?: 'server' | 'local';
61
109
  }
62
110
  export interface ServerSideState {
63
111
  dataSource: ServerSideDataSource | null;