@toolbox-web/grid 1.23.3 → 1.23.4

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 (72) hide show
  1. package/all.js.map +1 -1
  2. package/index.js +1 -1
  3. package/index.js.map +1 -1
  4. package/lib/core/grid.d.ts +7 -0
  5. package/lib/core/grid.d.ts.map +1 -1
  6. package/lib/core/plugin/base-plugin.d.ts +6 -0
  7. package/lib/core/plugin/base-plugin.d.ts.map +1 -1
  8. package/lib/core/plugin/types.d.ts +1 -0
  9. package/lib/core/plugin/types.d.ts.map +1 -1
  10. package/lib/core/types.d.ts +9 -2
  11. package/lib/core/types.d.ts.map +1 -1
  12. package/lib/plugins/clipboard/ClipboardPlugin.d.ts +3 -3
  13. package/lib/plugins/clipboard/index.js.map +1 -1
  14. package/lib/plugins/clipboard/types.d.ts +1 -1
  15. package/lib/plugins/column-virtualization/index.js.map +1 -1
  16. package/lib/plugins/column-virtualization/types.d.ts +24 -2
  17. package/lib/plugins/column-virtualization/types.d.ts.map +1 -1
  18. package/lib/plugins/context-menu/index.js.map +1 -1
  19. package/lib/plugins/editing/index.js.map +1 -1
  20. package/lib/plugins/editing/types.d.ts +1 -1
  21. package/lib/plugins/export/ExportPlugin.d.ts +1 -1
  22. package/lib/plugins/export/index.js.map +1 -1
  23. package/lib/plugins/export/types.d.ts +9 -1
  24. package/lib/plugins/export/types.d.ts.map +1 -1
  25. package/lib/plugins/filtering/index.js.map +1 -1
  26. package/lib/plugins/filtering/types.d.ts +158 -2
  27. package/lib/plugins/filtering/types.d.ts.map +1 -1
  28. package/lib/plugins/grouping-columns/index.js.map +1 -1
  29. package/lib/plugins/grouping-rows/index.js.map +1 -1
  30. package/lib/plugins/grouping-rows/types.d.ts +48 -3
  31. package/lib/plugins/grouping-rows/types.d.ts.map +1 -1
  32. package/lib/plugins/master-detail/index.js.map +1 -1
  33. package/lib/plugins/multi-sort/index.js.map +1 -1
  34. package/lib/plugins/multi-sort/types.d.ts +40 -6
  35. package/lib/plugins/multi-sort/types.d.ts.map +1 -1
  36. package/lib/plugins/pinned-columns/index.js.map +1 -1
  37. package/lib/plugins/pinned-rows/index.js.map +1 -1
  38. package/lib/plugins/pinned-rows/types.d.ts +42 -4
  39. package/lib/plugins/pinned-rows/types.d.ts.map +1 -1
  40. package/lib/plugins/pivot/index.js.map +1 -1
  41. package/lib/plugins/pivot/types.d.ts +66 -1
  42. package/lib/plugins/pivot/types.d.ts.map +1 -1
  43. package/lib/plugins/print/PrintPlugin.d.ts +1 -1
  44. package/lib/plugins/print/index.js.map +1 -1
  45. package/lib/plugins/print/types.d.ts +9 -1
  46. package/lib/plugins/print/types.d.ts.map +1 -1
  47. package/lib/plugins/reorder/index.js.map +1 -1
  48. package/lib/plugins/reorder/types.d.ts +12 -1
  49. package/lib/plugins/reorder/types.d.ts.map +1 -1
  50. package/lib/plugins/responsive/index.js.map +1 -1
  51. package/lib/plugins/row-reorder/index.js.map +1 -1
  52. package/lib/plugins/selection/SelectionPlugin.d.ts +5 -5
  53. package/lib/plugins/selection/index.js.map +1 -1
  54. package/lib/plugins/server-side/index.js.map +1 -1
  55. package/lib/plugins/server-side/types.d.ts +82 -0
  56. package/lib/plugins/server-side/types.d.ts.map +1 -1
  57. package/lib/plugins/tree/index.js.map +1 -1
  58. package/lib/plugins/undo-redo/index.js.map +1 -1
  59. package/lib/plugins/visibility/VisibilityPlugin.d.ts +1 -1
  60. package/lib/plugins/visibility/index.js.map +1 -1
  61. package/lib/plugins/visibility/types.d.ts +16 -2
  62. package/lib/plugins/visibility/types.d.ts.map +1 -1
  63. package/package.json +1 -1
  64. package/public.d.ts +1 -1
  65. package/public.d.ts.map +1 -1
  66. package/umd/grid.all.umd.js.map +1 -1
  67. package/umd/grid.umd.js.map +1 -1
  68. package/umd/plugins/clipboard.umd.js.map +1 -1
  69. package/umd/plugins/export.umd.js.map +1 -1
  70. package/umd/plugins/print.umd.js.map +1 -1
  71. package/umd/plugins/selection.umd.js.map +1 -1
  72. package/umd/plugins/visibility.umd.js.map +1 -1
@@ -1,23 +1,105 @@
1
+ /**
2
+ * Configuration for the server-side data plugin.
3
+ *
4
+ * Controls how the grid fetches, caches, and paginates data from a remote source.
5
+ * The grid requests data in **blocks** (contiguous row ranges) as the user scrolls,
6
+ * caching them locally to avoid redundant network requests.
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * new ServerSidePlugin({
11
+ * pageSize: 100,
12
+ * cacheBlockSize: 200,
13
+ * maxConcurrentRequests: 2,
14
+ * })
15
+ * ```
16
+ */
1
17
  export interface ServerSideConfig {
18
+ /**
19
+ * Number of rows to request per fetch.
20
+ * This determines the `endRow - startRow` range passed to `getRows()`.
21
+ * Smaller values mean faster initial loads but more frequent requests while scrolling.
22
+ * @default 100
23
+ */
2
24
  pageSize?: number;
25
+ /**
26
+ * Number of rows kept in each cache block.
27
+ * When a block is evicted (e.g. scrolled far away), re-scrolling back triggers a new fetch.
28
+ * Should be ≥ `pageSize`; larger values reduce re-fetches at the cost of memory.
29
+ * @default 200
30
+ */
3
31
  cacheBlockSize?: number;
32
+ /**
33
+ * Maximum number of concurrent `getRows()` requests.
34
+ * Limits how many blocks can be fetched simultaneously during fast scrolling.
35
+ * Set to 1 for strict sequential loading; higher values improve perceived performance.
36
+ * @default 2
37
+ */
4
38
  maxConcurrentRequests?: number;
5
39
  }
40
+ /**
41
+ * Data source contract for server-side row loading.
42
+ *
43
+ * Implement this interface to supply rows from a remote API, database, or any
44
+ * asynchronous provider. The grid calls `getRows()` whenever it needs a new
45
+ * block of rows (on initial load, scroll, sort change, or filter change).
46
+ *
47
+ * @example
48
+ * ```typescript
49
+ * const dataSource: ServerSideDataSource = {
50
+ * async getRows(params) {
51
+ * const res = await fetch(`/api/employees?start=${params.startRow}&end=${params.endRow}`);
52
+ * const data = await res.json();
53
+ * return { rows: data.items, totalRowCount: data.total };
54
+ * }
55
+ * };
56
+ * ```
57
+ */
6
58
  export interface ServerSideDataSource {
7
59
  getRows(params: GetRowsParams): Promise<GetRowsResult>;
8
60
  }
61
+ /**
62
+ * Parameters passed to {@link ServerSideDataSource.getRows} for each data request.
63
+ *
64
+ * The grid provides the row range to fetch plus any active sort/filter state,
65
+ * allowing the server to apply pagination, sorting, and filtering on the backend.
66
+ */
9
67
  export interface GetRowsParams {
68
+ /** Zero-based index of the first row to fetch (inclusive). */
10
69
  startRow: number;
70
+ /** Zero-based index of the last row to fetch (exclusive). `endRow - startRow` equals the block size. */
11
71
  endRow: number;
72
+ /** Active sort columns, in priority order. Empty array when unsorted. */
12
73
  sortModel?: Array<{
13
74
  field: string;
14
75
  direction: 'asc' | 'desc';
15
76
  }>;
77
+ /** Active filter model keyed by field name. Empty object when no filters are applied. */
16
78
  filterModel?: Record<string, any>;
17
79
  }
80
+ /**
81
+ * Result returned from {@link ServerSideDataSource.getRows}.
82
+ *
83
+ * @example
84
+ * ```typescript
85
+ * // Known total (pagination-style)
86
+ * return { rows: pageData, totalRowCount: 5000 };
87
+ *
88
+ * // Infinite scroll — set lastRow when the final page is reached
89
+ * return { rows: pageData, totalRowCount: -1, lastRow: absoluteLastIndex };
90
+ * ```
91
+ */
18
92
  export interface GetRowsResult {
93
+ /** The fetched row objects for the requested range. */
19
94
  rows: any[];
95
+ /** Total number of rows available on the server. Use `-1` if unknown (infinite scroll mode). */
20
96
  totalRowCount: number;
97
+ /**
98
+ * The absolute index of the last row in the dataset.
99
+ * Only needed for **infinite scroll** when `totalRowCount` is `-1`.
100
+ * Once the server returns the final page, set this so the grid knows
101
+ * scrolling has reached the end and stops requesting further blocks.
102
+ */
21
103
  lastRow?: number;
22
104
  }
23
105
  export interface ServerSideState {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/server-side/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;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EAAE,gBAAgB,CAAC;KAC3D;CACF"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/server-side/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;;OAKG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,WAAW,oBAAoB;IACnC,OAAO,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;CACxD;AAED;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B,8DAA8D;IAC9D,QAAQ,EAAE,MAAM,CAAC;IACjB,wGAAwG;IACxG,MAAM,EAAE,MAAM,CAAC;IACf,yEAAyE;IACzE,SAAS,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,KAAK,GAAG,MAAM,CAAA;KAAE,CAAC,CAAC;IAChE,yFAAyF;IACzF,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACnC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,aAAa;IAC5B,uDAAuD;IACvD,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,gGAAgG;IAChG,aAAa,EAAE,MAAM,CAAC;IACtB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,oBAAoB,GAAG,IAAI,CAAC;IACxC,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;IACjC,aAAa,EAAE,GAAG,CAAC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