@progress/kendo-react-data-tools 13.3.0-develop.9 → 13.4.0-develop.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 (105) hide show
  1. package/clipboard/clipboard.service.d.ts +20 -0
  2. package/clipboard/common.d.ts +188 -0
  3. package/columnmenu/ColumnMenu.d.ts +90 -0
  4. package/columnmenu/ColumnMenuFilterForm.d.ts +25 -0
  5. package/columnmenu/ColumnMenuFilterLogic.d.ts +10 -0
  6. package/columnmenu/ColumnMenuFilterLogic.mjs +4 -4
  7. package/columnmenu/ColumnMenuFilters.d.ts +31 -0
  8. package/columnmenu/ColumnMenuItem.d.ts +39 -0
  9. package/columnmenu/ColumnMenuOperators.d.ts +72 -0
  10. package/columnmenu/index.d.ts +13 -0
  11. package/data-source/use-data-source.d.ts +224 -0
  12. package/data-source/use-odata-data-source.d.ts +41 -0
  13. package/data-source/use-remote-data-source.d.ts +411 -0
  14. package/detail-expansion/TableExpandableSettings.d.ts +12 -0
  15. package/detail-expansion/expandReducer.d.ts +31 -0
  16. package/detail-expansion/utils.d.ts +10 -0
  17. package/dist/cdn/js/kendo-react-datatools.js +1 -1
  18. package/drag/ColumnDraggable.d.ts +37 -0
  19. package/drag/ColumnResize.d.ts +39 -0
  20. package/drag/ColumnResizer.d.ts +35 -0
  21. package/drag/CommonDragLogic.d.ts +45 -0
  22. package/drag/DragClue.d.ts +29 -0
  23. package/drag/DropClue.d.ts +26 -0
  24. package/editing/TableEditableSettings.d.ts +24 -0
  25. package/editing/editReducer.d.ts +62 -0
  26. package/editing/utils.d.ts +12 -0
  27. package/filter/Expression.d.ts +53 -0
  28. package/filter/Expression.js +1 -1
  29. package/filter/Expression.mjs +10 -11
  30. package/filter/FieldSettings.d.ts +37 -0
  31. package/filter/Filter.d.ts +139 -0
  32. package/filter/Group.d.ts +64 -0
  33. package/filter/Group.js +1 -1
  34. package/filter/Group.mjs +7 -7
  35. package/filter/filters/BooleanFilter.d.ts +50 -0
  36. package/filter/filters/DateFilter.d.ts +33 -0
  37. package/filter/filters/EnumFilter.d.ts +50 -0
  38. package/filter/filters/NumericFilter.d.ts +40 -0
  39. package/filter/filters/TextFilter.d.ts +47 -0
  40. package/filter/filters/index.d.ts +12 -0
  41. package/filter/index.d.ts +13 -0
  42. package/filter/operators.d.ts +80 -0
  43. package/filteringCells/BooleanFilter.d.ts +15 -0
  44. package/filteringCells/DateFilter.d.ts +15 -0
  45. package/filteringCells/FilterCellProps.d.ts +42 -0
  46. package/filteringCells/FilterComponent.d.ts +24 -0
  47. package/filteringCells/FilterComponentProps.d.ts +30 -0
  48. package/filteringCells/FilterOperator.d.ts +20 -0
  49. package/filteringCells/NumericFilter.d.ts +15 -0
  50. package/filteringCells/TextFilter.d.ts +15 -0
  51. package/filteringCells/index.d.ts +15 -0
  52. package/group-expansion/TableGroupExpandableSettings.d.ts +12 -0
  53. package/group-expansion/groupExpandReducer.d.ts +46 -0
  54. package/header/CellProps.d.ts +83 -0
  55. package/header/ColumnProps.d.ts +167 -0
  56. package/header/FilterRow.d.ts +32 -0
  57. package/header/Header.d.ts +26 -0
  58. package/header/HeaderCell.d.ts +54 -0
  59. package/header/HeaderRow.d.ts +44 -0
  60. package/header/HeaderSelectionCell.d.ts +19 -0
  61. package/header/HeaderTdElement.d.ts +42 -0
  62. package/header/HeaderThElement.d.ts +42 -0
  63. package/header/SortSettings.d.ts +33 -0
  64. package/header/index.d.ts +18 -0
  65. package/header/utils/index.d.ts +90 -0
  66. package/index.d.mts +43 -3741
  67. package/index.d.ts +43 -3741
  68. package/messages/index.d.ts +397 -0
  69. package/navigation/NavigatableSettings.d.ts +25 -0
  70. package/navigation/TableKeyboardNavigation.d.ts +95 -0
  71. package/navigation/TableKeyboardNavigation.mjs +13 -13
  72. package/navigation/TableKeyboardNavigationContext.d.ts +13 -0
  73. package/navigation/TableKeyboardNavigationContextType.d.ts +14 -0
  74. package/navigation/TableKeyboardNavigationStateType.d.ts +17 -0
  75. package/navigation/constants.d.ts +61 -0
  76. package/navigation/hooks.d.ts +19 -0
  77. package/navigation/hooks.mjs +3 -3
  78. package/navigation/stackedKeyboardNavigation.d.ts +217 -0
  79. package/navigation/utils.d.ts +329 -0
  80. package/navigation/utils.mjs +5 -5
  81. package/package-metadata.d.ts +12 -0
  82. package/package-metadata.js +1 -1
  83. package/package-metadata.mjs +10 -16
  84. package/package.json +10 -10
  85. package/pager/Pager.d.ts +10 -0
  86. package/pager/Pager.js +1 -1
  87. package/pager/Pager.mjs +64 -66
  88. package/pager/PagerInput.d.ts +29 -0
  89. package/pager/PagerNumericButtons.d.ts +28 -0
  90. package/pager/PagerNumericButtons.js +1 -1
  91. package/pager/PagerNumericButtons.mjs +15 -17
  92. package/pager/PagerPageSizes.d.ts +36 -0
  93. package/pager/models/index.d.ts +178 -0
  94. package/pager/utils.d.ts +66 -0
  95. package/selection/TableSelectableSettings.d.ts +38 -0
  96. package/selection/TableSelection.d.ts +25 -0
  97. package/selection/constants.d.ts +13 -0
  98. package/selection/events.d.ts +101 -0
  99. package/selection/utils.d.ts +70 -0
  100. package/utils/DataItemWrapper.d.ts +17 -0
  101. package/utils/SearchField.d.ts +24 -0
  102. package/utils/data-operations.d.ts +107 -0
  103. package/utils/group-operations.d.ts +36 -0
  104. package/virtualization/columns.d.ts +24 -0
  105. package/virtualization/index.d.ts +8 -0
@@ -0,0 +1,224 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ import { CompositeFilterDescriptor, GroupDescriptor, SortDescriptor } from '@progress/kendo-data-query';
9
+ /**
10
+ * Describes the options for configuring the useDataSource hook.
11
+ *
12
+ * @template T - The type of data items in the data source. Defaults to any.
13
+ */
14
+ export type DataSourceProps<T extends object = any> = {
15
+ /**
16
+ * The total number of records in the data source.
17
+ */
18
+ total?: number;
19
+ /**
20
+ * The initial total number of records in the data source.
21
+ */
22
+ defaultTotal?: number;
23
+ /**
24
+ * The current data array to be managed by the hook.
25
+ * This represents the data items that are currently available in the data source.
26
+ * If not provided, the `defaultData` will be used as the initial value.
27
+ */
28
+ data?: T[];
29
+ /**
30
+ * The initial data array to be managed by the hook.
31
+ */
32
+ defaultData?: T[];
33
+ /**
34
+ * The current sorting configuration.
35
+ */
36
+ sort?: SortDescriptor[];
37
+ /**
38
+ * The initial sorting configuration.
39
+ */
40
+ defaultSort?: SortDescriptor[];
41
+ /**
42
+ * The current filter configuration.
43
+ */
44
+ filter?: CompositeFilterDescriptor;
45
+ /**
46
+ * The initial filter configuration.
47
+ */
48
+ defaultFilter?: CompositeFilterDescriptor;
49
+ /**
50
+ * The current number of records to skip (for paging).
51
+ */
52
+ skip?: number;
53
+ /**
54
+ * The initial number of records to skip (for paging).
55
+ */
56
+ defaultSkip?: number;
57
+ /**
58
+ * The current number of records to take per page.
59
+ */
60
+ take?: number;
61
+ /**
62
+ * The initial number of records to take per page.
63
+ */
64
+ defaultTake?: number;
65
+ /**
66
+ * The current grouping configuration.
67
+ */
68
+ group?: GroupDescriptor[];
69
+ /**
70
+ * The initial grouping configuration.
71
+ */
72
+ defaultGroup?: GroupDescriptor[];
73
+ /**
74
+ * Specifies whether filtering is enabled.
75
+ *
76
+ * @default true
77
+ */
78
+ filterable?: boolean;
79
+ /**
80
+ * Specifies whether sorting is enabled.
81
+ *
82
+ * @default true
83
+ */
84
+ sortable?: boolean;
85
+ /**
86
+ * Specifies whether paging is enabled.
87
+ *
88
+ * @default true
89
+ */
90
+ pageable?: boolean;
91
+ /**
92
+ * Specifies whether grouping is enabled.
93
+ *
94
+ * @default true
95
+ */
96
+ groupable?: boolean;
97
+ /**
98
+ * Configuration for the data schema, including model definition.
99
+ */
100
+ schema: {
101
+ model: {
102
+ /**
103
+ * The field that serves as the unique identifier for records.
104
+ */
105
+ id: string;
106
+ };
107
+ };
108
+ };
109
+ /**
110
+ * Represents a data source with data presentation operations (filtering, sorting, paging, grouping).
111
+ *
112
+ * @template T - The type of data items in the data source. Defaults to any.
113
+ */
114
+ export type DataSource<T extends object = any> = {
115
+ /** The array of data items. */
116
+ data: T[];
117
+ /**
118
+ * Sets the data items in the data source.
119
+ *
120
+ * @param value - The array of new data items.
121
+ */
122
+ setData: (value: T[]) => void;
123
+ /** The total number of data items. */
124
+ total: number;
125
+ /** The schema used for data validation and transformation. */
126
+ schema: DataSourceProps<T>['schema'];
127
+ /** The current sort descriptors applied to the data. */
128
+ sort: SortDescriptor[] | undefined;
129
+ /**
130
+ * Sets the sort descriptors for the data.
131
+ *
132
+ * @param value - The new sort descriptors.
133
+ */
134
+ setSort: (value: SortDescriptor[] | undefined) => void;
135
+ /** The current filter descriptor applied to the data. */
136
+ filter: CompositeFilterDescriptor | undefined;
137
+ /**
138
+ * Sets the filter descriptor for the data.
139
+ *
140
+ * @param value - The new filter descriptor.
141
+ */
142
+ setFilter: (value: CompositeFilterDescriptor | undefined) => void;
143
+ /** The current skip value for pagination. */
144
+ skip: number | undefined;
145
+ /**
146
+ * Sets the skip value for pagination.
147
+ *
148
+ * @param value - The new skip value.
149
+ */
150
+ setSkip: (value: number | undefined) => void;
151
+ /** The current take value for pagination. */
152
+ take: number | undefined;
153
+ /**
154
+ * Sets the take value for pagination.
155
+ *
156
+ * @param value - The new take value.
157
+ */
158
+ setTake: (value: number | undefined) => void;
159
+ /** The current group descriptors applied to the data. */
160
+ group: GroupDescriptor[] | undefined;
161
+ /**
162
+ * Sets the group descriptors for the data.
163
+ *
164
+ * @param value - The new group descriptors.
165
+ */
166
+ setGroup: (value: GroupDescriptor[] | undefined) => void;
167
+ /** The current data state, including sorting, filtering, and pagination. */
168
+ dataState: Partial<DataSourceProps<T>>;
169
+ /**
170
+ * Sets the data state, including sorting, filtering, and pagination.
171
+ *
172
+ * @param dataState - The new data state.
173
+ */
174
+ setDataState: (dataState: Partial<DataSourceProps<T>>) => void;
175
+ /**
176
+ * Sets the total number of data items.
177
+ *
178
+ * @param value - The new total value.
179
+ */
180
+ setTotal: (value: number | undefined) => void;
181
+ };
182
+ /**
183
+ * A hook that provides functionality for managing local data with built-in support for filtering, sorting, paging, and grouping.
184
+ *
185
+ * @template T - The type of data items in the data source. Defaults to any.
186
+ * @param {DataSourceProps<T>} props - The configuration options for the data source.
187
+ * @returns {DataSource<T>} An object containing data management methods and properties.
188
+ *
189
+ * @example
190
+ * ```tsx
191
+ * interface Product {
192
+ * ProductID: number;
193
+ * ProductName: string;
194
+ * UnitPrice: number;
195
+ * }
196
+ *
197
+ * const dataSource = useDataSource<Product>({
198
+ * defaultData: products,
199
+ * defaultSort: [{ field: 'UnitPrice', dir: 'desc' }],
200
+ * defaultSkip: 0,
201
+ * take: 10,
202
+ * schema: {
203
+ * model: {
204
+ * id: 'ProductID'
205
+ * }
206
+ * }
207
+ * });
208
+ *
209
+ * return (
210
+ * <Grid
211
+ * data={dataSource.data}
212
+ * total={dataSource.total}
213
+ * {...dataSource.dataState}
214
+ * onDataStateChange={(event) => {
215
+ * dataSource.setDataState(event.dataState);
216
+ * }}
217
+ * >
218
+ * <GridColumn field="ProductID" title="ID" />
219
+ * <GridColumn field="ProductName" title="Product Name" />
220
+ * </Grid>
221
+ * );
222
+ * ```
223
+ */
224
+ export declare const useDataSource: <T extends object = any>(props: DataSourceProps<T>) => DataSource<T>;
@@ -0,0 +1,41 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ import { RemoteDataSource, RemoteDataSourceProps } from './use-remote-data-source.js';
9
+ /**
10
+ * A specialized version of useRemoteDataSource tailored for working with OData services.
11
+ * It automatically handles the construction of OData queries and the processing of OData responses.
12
+ *
13
+ * @template T - The type of data items in the data source. Defaults to any.
14
+ * @param {RemoteDataSourceProps<T>} props - The configuration options for the OData data source.
15
+ * @returns {RemoteDataSource<T>} An object containing all the properties and methods from useRemoteDataSource with OData-specific defaults for transport and schema configurations.
16
+ *
17
+ * @example
18
+ * ```tsx
19
+ * interface Product {
20
+ * ProductID: number;
21
+ * ProductName: string;
22
+ * UnitPrice: number;
23
+ * }
24
+ *
25
+ * const dataSource = useODataDataSource<Product>({
26
+ * take: 10,
27
+ * skip: 0,
28
+ * transport: {
29
+ * read: {
30
+ * url: 'https://demos.telerik.com/service/v2/odata/Products'
31
+ * }
32
+ * },
33
+ * schema: {
34
+ * model: {
35
+ * id: 'ProductID'
36
+ * }
37
+ * }
38
+ * });
39
+ * ```
40
+ */
41
+ export declare const useODataDataSource: <T extends object = any>(props: RemoteDataSourceProps<T>) => RemoteDataSource<T>;
@@ -0,0 +1,411 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ import { CompositeFilterDescriptor, GroupDescriptor, SortDescriptor, State } from '@progress/kendo-data-query';
9
+ import { DataSource, DataSourceProps } from './use-data-source.js';
10
+ /**
11
+ * Configuration properties for the remote data source.
12
+ * Extends the basic DataSourceProps with remote data operations capabilities.
13
+ *
14
+ * @template T - The type of data items in the data source. Defaults to any object.
15
+ */
16
+ export interface RemoteDataSourceProps<T extends object = any> extends DataSourceProps<T> {
17
+ /**
18
+ * Map of original data items read from the remote source, indexed by ID.
19
+ */
20
+ reads?: Map<string | number | symbol | null, T>;
21
+ /**
22
+ * Map of created items that need to be synced with the remote source.
23
+ */
24
+ creates?: Map<string | number | symbol | null, T>;
25
+ /**
26
+ * Map of updated items that need to be synced with the remote source.
27
+ */
28
+ updates?: Map<string | number | symbol | null, T>;
29
+ /**
30
+ * Map of items marked for deletion that need to be synced with the remote source.
31
+ */
32
+ deletes?: Map<string | number | symbol | null, T>;
33
+ /**
34
+ * Determines if filtering operations should be performed on the server.
35
+ * When true, filter parameters are sent to the server during read operations.
36
+ *
37
+ * @default true
38
+ */
39
+ serverFiltering?: boolean;
40
+ /**
41
+ * Determines if sorting operations should be performed on the server.
42
+ * When true, sort parameters are sent to the server during read operations.
43
+ *
44
+ * @default true
45
+ */
46
+ serverSorting?: boolean;
47
+ /**
48
+ * Determines if paging operations should be performed on the server.
49
+ * When true, skip and take parameters are sent to the server during read operations.
50
+ *
51
+ * @default true
52
+ */
53
+ serverPaging?: boolean;
54
+ /**
55
+ * Determines if grouping operations should be performed on the server.
56
+ * When true, group parameters are sent to the server during read operations.
57
+ *
58
+ * @default true
59
+ */
60
+ serverGrouping?: boolean;
61
+ /**
62
+ * Configuration for CRUD operations transport.
63
+ * Defines how data is sent to and received from the server.
64
+ */
65
+ transport?: {
66
+ /**
67
+ * Configuration for create operations.
68
+ * Can be either an object specifying the endpoint configuration or a function for custom implementation.
69
+ */
70
+ create?: {
71
+ /**
72
+ * URL for the create operation. Can be a string or a function that returns a string based on the data item.
73
+ */
74
+ url: string | ((dataItem: T) => string);
75
+ /**
76
+ * HTTP method to use for the create operation.
77
+ *
78
+ * @default "POST"
79
+ */
80
+ method?: string;
81
+ /**
82
+ * Content-Type header to use for the request.
83
+ *
84
+ * @default "application/json"
85
+ */
86
+ contentType?: string;
87
+ /**
88
+ * Additional data to include in the request.
89
+ */
90
+ data?: {
91
+ [key: string]: any;
92
+ };
93
+ /**
94
+ * Function that transforms the request data before sending it to the server.
95
+ *
96
+ * @param data - The data item to transform
97
+ * @returns Transformed data
98
+ */
99
+ parameterMap?: (data: T) => any;
100
+ /**
101
+ * Callback executed when the create operation is successful.
102
+ *
103
+ * @param data - The created data item
104
+ */
105
+ onSuccess?: (data: T) => void;
106
+ /**
107
+ * Function to process the server response.
108
+ *
109
+ * @param response - The server response
110
+ * @returns Processed data item or null
111
+ */
112
+ onResponse?: (response: any) => T | null;
113
+ /**
114
+ * Callback executed when the create operation fails.
115
+ *
116
+ * @param error - The error from the server
117
+ */
118
+ onError?: (error: any) => void;
119
+ } | ((options: {
120
+ data: T;
121
+ }) => Promise<T>);
122
+ /**
123
+ * Configuration for read operations.
124
+ * Can be either an object specifying the endpoint configuration or a function for custom implementation.
125
+ */
126
+ read?: {
127
+ /**
128
+ * URL for the read operation. Can be a string or a function that returns a string.
129
+ */
130
+ url: string | (() => string);
131
+ /**
132
+ * HTTP method to use for the read operation.
133
+ *
134
+ * @default "GET"
135
+ */
136
+ method?: string;
137
+ /**
138
+ * Content-Type header to use for the request.
139
+ */
140
+ contentType?: string;
141
+ /**
142
+ * Additional data to include in the request.
143
+ */
144
+ data?: {
145
+ [key: string]: any;
146
+ };
147
+ /**
148
+ * Function that transforms the request data before sending it to the server.
149
+ *
150
+ * @param data - The request parameters including filter, paging, sorting, and grouping info
151
+ * @returns Transformed request parameters
152
+ */
153
+ parameterMap?: (data: {
154
+ filter?: CompositeFilterDescriptor;
155
+ skip?: number;
156
+ take?: number;
157
+ sort?: SortDescriptor[];
158
+ group?: GroupDescriptor[];
159
+ }) => any;
160
+ /**
161
+ * Callback executed when the read operation is successful.
162
+ *
163
+ * @param data - The retrieved data items
164
+ */
165
+ onSuccess?: (data: T[]) => void;
166
+ /**
167
+ * Function to process the server response.
168
+ *
169
+ * @param response - The server response
170
+ * @returns Processed data item or null
171
+ */
172
+ onResponse?: (response: any) => T | null;
173
+ /**
174
+ * Callback executed when the read operation fails.
175
+ *
176
+ * @param error - The error from the server
177
+ */
178
+ onError?: (error: any) => void;
179
+ } | ((options: {
180
+ filter?: CompositeFilterDescriptor;
181
+ skip?: number;
182
+ take?: number;
183
+ sort?: SortDescriptor[];
184
+ group?: GroupDescriptor[];
185
+ onSuccess?: (data: T[]) => void;
186
+ onResponse?: (response: any) => T | null;
187
+ onError?: (error: any) => void;
188
+ }) => Promise<T[]>);
189
+ /**
190
+ * Configuration for update operations.
191
+ * Can be either an object specifying the endpoint configuration or a function for custom implementation.
192
+ */
193
+ update?: {
194
+ /**
195
+ * URL for the update operation. Can be a string or a function that returns a string based on the data item.
196
+ */
197
+ url: string | ((dataItem: T) => string);
198
+ /**
199
+ * HTTP method to use for the update operation.
200
+ *
201
+ * @default "PUT"
202
+ */
203
+ method?: string;
204
+ /**
205
+ * Content-Type header to use for the request.
206
+ *
207
+ * @default "application/json"
208
+ */
209
+ contentType?: string;
210
+ /**
211
+ * Additional data to include in the request.
212
+ */
213
+ data?: {
214
+ [key: string]: any;
215
+ };
216
+ /**
217
+ * Function that transforms the request data before sending it to the server.
218
+ *
219
+ * @param data - The data item to transform
220
+ * @returns Transformed data
221
+ */
222
+ parameterMap?: (data: T) => any;
223
+ /**
224
+ * Callback executed when the update operation is successful.
225
+ *
226
+ * @param data - The updated data item
227
+ */
228
+ onSuccess?: (data: T) => void;
229
+ /**
230
+ * Function to process the server response.
231
+ *
232
+ * @param response - The server response
233
+ * @returns Processed data item or null
234
+ */
235
+ onResponse?: (response: any) => T | null;
236
+ /**
237
+ * Callback executed when the update operation fails.
238
+ *
239
+ * @param error - The error from the server
240
+ */
241
+ onError?: (error: any) => void;
242
+ } | ((options: {
243
+ data: T;
244
+ }) => Promise<T>);
245
+ /**
246
+ * Configuration for delete operations.
247
+ * Can be either an object specifying the endpoint configuration or a function for custom implementation.
248
+ */
249
+ delete?: {
250
+ /**
251
+ * URL for the delete operation. Can be a string or a function that returns a string based on the data item.
252
+ */
253
+ url: string | ((dataItem: T) => string);
254
+ /**
255
+ * HTTP method to use for the delete operation.
256
+ *
257
+ * @default "DELETE"
258
+ */
259
+ method?: string;
260
+ /**
261
+ * Content-Type header to use for the request.
262
+ */
263
+ contentType?: string;
264
+ /**
265
+ * Additional data to include in the request.
266
+ */
267
+ data?: {
268
+ [key: string]: any;
269
+ };
270
+ /**
271
+ * Function that transforms the request data before sending it to the server.
272
+ *
273
+ * @param data - The data item to transform
274
+ * @returns Transformed data
275
+ */
276
+ parameterMap?: (data: T) => any;
277
+ /**
278
+ * Callback executed when the delete operation is successful.
279
+ *
280
+ * @param data - The deleted data item
281
+ */
282
+ onSuccess?: (data: T) => void;
283
+ /**
284
+ * Function to process the server response.
285
+ *
286
+ * @param response - The server response
287
+ * @returns Processed data item or null
288
+ */
289
+ onResponse?: (response: any) => T | null;
290
+ /**
291
+ * Callback executed when the delete operation fails.
292
+ *
293
+ * @param error - The error from the server
294
+ */
295
+ onError?: (error: any) => void;
296
+ } | ((options: {
297
+ data: T;
298
+ }) => Promise<T>);
299
+ };
300
+ /**
301
+ * Schema configuration for parsing and mapping server responses.
302
+ * Extends the base DataSourceProps schema with additional properties for remote data.
303
+ */
304
+ schema: DataSourceProps['schema'] & {
305
+ /**
306
+ * Specifies the field in the response that contains the data items,
307
+ * or a function that extracts the data items from the response.
308
+ */
309
+ data?: string | ((data: any) => T[]);
310
+ /**
311
+ * Specifies the field in the response that contains the total count,
312
+ * or a function that extracts the total count from the response.
313
+ */
314
+ total?: string | ((data: any) => number);
315
+ /**
316
+ * Specifies the field in the response that contains error information,
317
+ * or a function that extracts error information from the response.
318
+ */
319
+ errors?: string | ((data: any) => any);
320
+ };
321
+ }
322
+ /**
323
+ * Represents a remote data source with CRUD operations (Create, Read, Update, Delete).
324
+ *
325
+ * @template T - The type of data items in the data source. Defaults to any.
326
+ */
327
+ export type RemoteDataSource<T extends object = any> = DataSource<T> & {
328
+ /** Set of original data items read from the remote source, indexed by ID */
329
+ reads: Map<string | number | symbol | null, T>;
330
+ /** Map of created items that need to be synced */
331
+ creates: Map<string | number | symbol | null, T>;
332
+ /** Map of updated items that need to be synced */
333
+ updates: Map<string | number | symbol | null, T>;
334
+ /** Map of items marked for deletion that need to be synced */
335
+ deletes: Map<string | number | symbol | null, T>;
336
+ /** Map of dirty fields for each item */
337
+ dirty: Map<string | number | symbol | null, Set<string>>;
338
+ /** Map of errors for each item */
339
+ errors: Map<string | number | symbol | null, any[]>;
340
+ /** Adds an error to an item */
341
+ addError: (params: {
342
+ error: any;
343
+ data?: T;
344
+ }) => void;
345
+ /** Removes an error from an item */
346
+ removeError: (params: {
347
+ error: any;
348
+ }) => void;
349
+ /** Removes all errors for an item */
350
+ removeErrors: (params: {
351
+ data: T;
352
+ }) => void;
353
+ /** Removes all errors */
354
+ removeAllErrors: () => void;
355
+ /** Reads data from the remote source */
356
+ read: (state?: State) => Promise<T[]>;
357
+ /** Creates a new item */
358
+ create: (params: {
359
+ data: T;
360
+ }) => void;
361
+ /** Updates an existing item */
362
+ update: (params: {
363
+ data: T;
364
+ field?: string;
365
+ }) => void;
366
+ /** Deletes an item */
367
+ delete: (params: {
368
+ data: T;
369
+ }) => void;
370
+ /** Syncs all pending changes with the remote source */
371
+ sync: () => Promise<void>;
372
+ /** Syncs a single item with the remote source */
373
+ syncItem: (params: {
374
+ data: T;
375
+ }) => Promise<void>;
376
+ /** Removes an item from creates */
377
+ removeCreate: (params: {
378
+ data: T;
379
+ }) => void;
380
+ /** Removes an item from updates */
381
+ removeUpdate: (params: {
382
+ data: T;
383
+ }) => void;
384
+ /** Removes an item from deletes */
385
+ removeDelete: (params: {
386
+ data: T;
387
+ }) => void;
388
+ /** Adds an item to reads */
389
+ pushCreate: (params: {
390
+ data: T;
391
+ }) => void;
392
+ /** Updates an item in reads */
393
+ pushUpdate: (params: {
394
+ data: T;
395
+ }) => void;
396
+ /** Removes an item from reads */
397
+ pushDelete: (params: {
398
+ data: T;
399
+ }) => void;
400
+ /** Discards all pending changes */
401
+ discard: () => void;
402
+ };
403
+ /**
404
+ * A hook that extends the functionality of useDataSource by adding support for remote data operations.
405
+ * It enables you to connect to remote endpoints and perform CRUD operations while managing the data state locally.
406
+ *
407
+ * @template T - The type of data items in the data source
408
+ * @param {RemoteDataSourceProps<T>} props - The configuration options for the remote data source.
409
+ * @returns {RemoteDataSource<T>} An object containing all the properties and methods from useDataSource plus additional methods for interacting with remote data.
410
+ */
411
+ export declare const useRemoteDataSource: <T extends object = any>(props: RemoteDataSourceProps<T>) => RemoteDataSource<T>;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ /** @hidden */
9
+ export type TableExpandableSettings = {
10
+ enabled?: boolean;
11
+ column?: string;
12
+ };