@wix/auto-patterns 1.29.0 → 1.31.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.
- package/dist/cjs/hooks/index.js +0 -7
- package/dist/cjs/hooks/index.js.map +1 -1
- package/dist/cjs/hooks/useActionsSDK.js +7 -2
- package/dist/cjs/hooks/useActionsSDK.js.map +1 -1
- package/dist/cjs/hooks/useAppContextSync.js +24 -0
- package/dist/cjs/hooks/useAppContextSync.js.map +1 -0
- package/dist/cjs/hooks/useGridFeatures.js +10 -2
- package/dist/cjs/hooks/useGridFeatures.js.map +1 -1
- package/dist/cjs/hooks/useTableFeatures.js +10 -2
- package/dist/cjs/hooks/useTableFeatures.js.map +1 -1
- package/dist/cjs/hooks/useTableGridSwitchFeatures.js +10 -2
- package/dist/cjs/hooks/useTableGridSwitchFeatures.js.map +1 -1
- package/dist/cjs/providers/AppContext.js +10 -8
- package/dist/cjs/providers/AppContext.js.map +1 -1
- package/dist/cjs/providers/AppContextData.js +40 -0
- package/dist/cjs/providers/AppContextData.js.map +1 -0
- package/dist/cjs/providers/ItemsContext.js +14 -11
- package/dist/cjs/providers/ItemsContext.js.map +1 -1
- package/dist/cjs/providers/index.js +7 -0
- package/dist/cjs/providers/index.js.map +1 -1
- package/dist/cjs/types/CollectionPageConfig.js.map +1 -1
- package/dist/cjs/types/EntityPageConfig.js.map +1 -1
- package/dist/cjs/types/actions/actionCell.js.map +1 -1
- package/dist/cjs/types/actions/base.js.map +1 -1
- package/dist/cjs/types/actions/bulkActions.js.map +1 -1
- package/dist/cjs/types/actions/collectionPageActions.js.map +1 -1
- package/dist/cjs/types/actions/entityPageActions.js.map +1 -1
- package/dist/cjs/types/fetchData.js.map +1 -1
- package/dist/cjs/types/types.js.map +1 -1
- package/dist/cjs/utils/actions/types.js.map +1 -1
- package/dist/docs/app_context.md +64 -0
- package/dist/docs/auto-patterns-guide.md +69 -0
- package/dist/docs/sdk_utilities.md +5 -0
- package/dist/esm/hooks/index.js +0 -1
- package/dist/esm/hooks/index.js.map +1 -1
- package/dist/esm/hooks/useActionsSDK.js +7 -2
- package/dist/esm/hooks/useActionsSDK.js.map +1 -1
- package/dist/esm/hooks/useAppContextSync.js +19 -0
- package/dist/esm/hooks/useAppContextSync.js.map +1 -0
- package/dist/esm/hooks/useGridFeatures.js +10 -2
- package/dist/esm/hooks/useGridFeatures.js.map +1 -1
- package/dist/esm/hooks/useTableFeatures.js +10 -2
- package/dist/esm/hooks/useTableFeatures.js.map +1 -1
- package/dist/esm/hooks/useTableGridSwitchFeatures.js +10 -2
- package/dist/esm/hooks/useTableGridSwitchFeatures.js.map +1 -1
- package/dist/esm/providers/AppContext.js +7 -5
- package/dist/esm/providers/AppContext.js.map +1 -1
- package/dist/esm/providers/AppContextData.js +26 -0
- package/dist/esm/providers/AppContextData.js.map +1 -0
- package/dist/esm/providers/ItemsContext.js +10 -7
- package/dist/esm/providers/ItemsContext.js.map +1 -1
- package/dist/esm/providers/index.js +1 -0
- package/dist/esm/providers/index.js.map +1 -1
- package/dist/esm/types/CollectionPageConfig.js.map +1 -1
- package/dist/esm/types/EntityPageConfig.js.map +1 -1
- package/dist/esm/types/actions/actionCell.js.map +1 -1
- package/dist/esm/types/actions/base.js.map +1 -1
- package/dist/esm/types/actions/bulkActions.js.map +1 -1
- package/dist/esm/types/actions/collectionPageActions.js.map +1 -1
- package/dist/esm/types/actions/entityPageActions.js.map +1 -1
- package/dist/esm/types/fetchData.js.map +1 -1
- package/dist/esm/types/types.js.map +1 -1
- package/dist/esm/utils/actions/types.js.map +1 -1
- package/dist/types/hooks/index.d.ts +0 -1
- package/dist/types/hooks/index.d.ts.map +1 -1
- package/dist/types/hooks/useActionsSDK.d.ts.map +1 -1
- package/dist/types/hooks/useAppContextSync.d.ts +2 -0
- package/dist/types/hooks/useAppContextSync.d.ts.map +1 -0
- package/dist/types/hooks/useEntityPageHeaderTexts.d.ts.map +1 -1
- package/dist/types/hooks/useGridFeatures.d.ts.map +1 -1
- package/dist/types/hooks/useTableFeatures.d.ts.map +1 -1
- package/dist/types/hooks/useTableGridSwitchFeatures.d.ts.map +1 -1
- package/dist/types/providers/AppContext.d.ts +2 -2
- package/dist/types/providers/AppContext.d.ts.map +1 -1
- package/dist/types/providers/AppContextData.d.ts +13 -0
- package/dist/types/providers/AppContextData.d.ts.map +1 -0
- package/dist/types/providers/ItemsContext.d.ts +6 -4
- package/dist/types/providers/ItemsContext.d.ts.map +1 -1
- package/dist/types/providers/index.d.ts +1 -0
- package/dist/types/providers/index.d.ts.map +1 -1
- package/dist/types/types/CollectionPageConfig.d.ts +315 -0
- package/dist/types/types/CollectionPageConfig.d.ts.map +1 -1
- package/dist/types/types/EntityPageConfig.d.ts +111 -0
- package/dist/types/types/EntityPageConfig.d.ts.map +1 -1
- package/dist/types/types/actions/actionCell.d.ts +41 -0
- package/dist/types/types/actions/actionCell.d.ts.map +1 -1
- package/dist/types/types/actions/base.d.ts +84 -0
- package/dist/types/types/actions/base.d.ts.map +1 -1
- package/dist/types/types/actions/bulkActions.d.ts +40 -0
- package/dist/types/types/actions/bulkActions.d.ts.map +1 -1
- package/dist/types/types/actions/collectionPageActions.d.ts +30 -0
- package/dist/types/types/actions/collectionPageActions.d.ts.map +1 -1
- package/dist/types/types/actions/entityPageActions.d.ts +25 -0
- package/dist/types/types/actions/entityPageActions.d.ts.map +1 -1
- package/dist/types/types/fetchData.d.ts +35 -0
- package/dist/types/types/fetchData.d.ts.map +1 -1
- package/dist/types/types/types.d.ts +107 -0
- package/dist/types/types/types.d.ts.map +1 -1
- package/dist/types/utils/actions/types.d.ts +1 -0
- package/dist/types/utils/actions/types.d.ts.map +1 -1
- package/package.json +12 -12
- package/dist/cjs/hooks/useUpdateAppContextItems.js +0 -18
- package/dist/cjs/hooks/useUpdateAppContextItems.js.map +0 -1
- package/dist/esm/hooks/useUpdateAppContextItems.js +0 -13
- package/dist/esm/hooks/useUpdateAppContextItems.js.map +0 -1
- package/dist/types/hooks/useUpdateAppContextItems.d.ts +0 -2
- package/dist/types/hooks/useUpdateAppContextItems.d.ts.map +0 -1
|
@@ -3,56 +3,144 @@ import { DateRangeFilterMode, DateRangeOptions } from '@wix/patterns/core';
|
|
|
3
3
|
import { BaseCollectionConfig } from './types';
|
|
4
4
|
import { ActionCellConfig, BulkActionsConfig, CollectionPageOnRowClickActionConfig, CollectionPagePrimaryActions, CollectionPageSecondaryActions } from './actions';
|
|
5
5
|
export interface CollectionPageTitle {
|
|
6
|
+
/**
|
|
7
|
+
* The title text.
|
|
8
|
+
*/
|
|
6
9
|
text: string;
|
|
10
|
+
/**
|
|
11
|
+
* Determines whether to hide the number of total entities on the title of the page.
|
|
12
|
+
*/
|
|
7
13
|
hideTotal?: boolean;
|
|
8
14
|
}
|
|
9
15
|
export interface CollectionPageSubtitle {
|
|
16
|
+
/**
|
|
17
|
+
* The subtitle text.
|
|
18
|
+
*/
|
|
10
19
|
text: string;
|
|
20
|
+
/**
|
|
21
|
+
* "Learn more" link.
|
|
22
|
+
*/
|
|
11
23
|
learnMore?: {
|
|
24
|
+
/**
|
|
25
|
+
* Where the link should navigate to.
|
|
26
|
+
*/
|
|
12
27
|
url: string;
|
|
28
|
+
/**
|
|
29
|
+
* The label of the link button. defaults to "Learn More".
|
|
30
|
+
*/
|
|
13
31
|
label?: string;
|
|
14
32
|
};
|
|
15
33
|
}
|
|
16
34
|
export interface CollectionPageConfig {
|
|
35
|
+
/**
|
|
36
|
+
* Route configuration.
|
|
37
|
+
*/
|
|
17
38
|
route: {
|
|
39
|
+
/**
|
|
40
|
+
* Route path (relative path).
|
|
41
|
+
*/
|
|
18
42
|
path: string;
|
|
19
43
|
};
|
|
44
|
+
/**
|
|
45
|
+
* Page title configuration.
|
|
46
|
+
*/
|
|
20
47
|
title: CollectionPageTitle;
|
|
48
|
+
/**
|
|
49
|
+
* Page subtitle configuration.
|
|
50
|
+
*/
|
|
21
51
|
subtitle?: CollectionPageSubtitle;
|
|
52
|
+
/**
|
|
53
|
+
* Page-level actions to render in the page header.
|
|
54
|
+
*/
|
|
22
55
|
actions?: {
|
|
56
|
+
/**
|
|
57
|
+
* Primary actions.
|
|
58
|
+
*/
|
|
23
59
|
primaryActions?: CollectionPagePrimaryActions;
|
|
60
|
+
/**
|
|
61
|
+
* Secondary actions.
|
|
62
|
+
*/
|
|
24
63
|
secondaryActions?: CollectionPageSecondaryActions;
|
|
25
64
|
};
|
|
65
|
+
/**
|
|
66
|
+
* Components rendered within the page layout.
|
|
67
|
+
*/
|
|
26
68
|
components: ComponentConfig[];
|
|
27
69
|
}
|
|
28
70
|
export interface CollectionComponentConfig extends BaseCollectionComponentConfig {
|
|
71
|
+
/**
|
|
72
|
+
* Type discriminator.
|
|
73
|
+
*/
|
|
29
74
|
type: 'collection';
|
|
75
|
+
/**
|
|
76
|
+
* Layout items to render.
|
|
77
|
+
*/
|
|
30
78
|
layout: LayoutItemConfig[];
|
|
31
79
|
}
|
|
32
80
|
export interface CustomComponentConfig {
|
|
81
|
+
/**
|
|
82
|
+
* Type discriminator.
|
|
83
|
+
*/
|
|
33
84
|
type: 'custom';
|
|
85
|
+
/**
|
|
86
|
+
* Identifier that maps to a custom React component provided via overrides.
|
|
87
|
+
*/
|
|
34
88
|
id: string;
|
|
35
89
|
}
|
|
36
90
|
export type ComponentConfig = CollectionComponentConfig | CustomComponentConfig;
|
|
37
91
|
export interface LayoutItemConfig {
|
|
92
|
+
/**
|
|
93
|
+
* Rendering mode for the collection component.
|
|
94
|
+
*/
|
|
38
95
|
type: 'Table' | 'Grid';
|
|
96
|
+
/**
|
|
97
|
+
* Table-specific configuration.
|
|
98
|
+
*/
|
|
39
99
|
table?: TableSpecificConfig;
|
|
100
|
+
/**
|
|
101
|
+
* Grid-specific configuration.
|
|
102
|
+
*/
|
|
40
103
|
grid?: GridSpecificConfig;
|
|
41
104
|
}
|
|
42
105
|
export type ColumnsConfig = Column[];
|
|
43
106
|
export interface TableSpecificConfig {
|
|
107
|
+
/**
|
|
108
|
+
* Table columns configuration.
|
|
109
|
+
*/
|
|
44
110
|
columns: ColumnsConfig;
|
|
111
|
+
/**
|
|
112
|
+
* Enables custom columns (hide/reorder columns) functionality.
|
|
113
|
+
*/
|
|
45
114
|
customColumns?: {
|
|
46
115
|
enabled: boolean;
|
|
47
116
|
};
|
|
117
|
+
/**
|
|
118
|
+
* Number of leading columns that remain sticky on horizontal scroll.
|
|
119
|
+
*/
|
|
48
120
|
stickyColumns?: number;
|
|
121
|
+
/**
|
|
122
|
+
* Row click action.
|
|
123
|
+
*/
|
|
49
124
|
onRowClick?: CollectionPageOnRowClickActionConfig;
|
|
125
|
+
/**
|
|
126
|
+
* Show column headers (title bar).
|
|
127
|
+
* @default true
|
|
128
|
+
*/
|
|
50
129
|
showTitleBar?: boolean;
|
|
130
|
+
/**
|
|
131
|
+
* Sectioning support for table.
|
|
132
|
+
*
|
|
133
|
+
* The `id` must match the identifier of a custom sectioning override component.
|
|
134
|
+
* This allows you to provide a custom React component for table section rendering.
|
|
135
|
+
*/
|
|
51
136
|
sections?: {
|
|
52
137
|
id: string;
|
|
53
138
|
};
|
|
54
139
|
}
|
|
55
140
|
export interface GridSpecificConfig {
|
|
141
|
+
/**
|
|
142
|
+
* Grid item.
|
|
143
|
+
*/
|
|
56
144
|
item: GridItem;
|
|
57
145
|
}
|
|
58
146
|
export interface TableConfig extends BaseCollectionComponentConfig, TableSpecificConfig {
|
|
@@ -62,31 +150,100 @@ export interface GridConfig extends BaseCollectionComponentConfig, GridSpecificC
|
|
|
62
150
|
export interface TableGridSwitchConfig extends BaseCollectionComponentConfig, TableSpecificConfig, GridSpecificConfig {
|
|
63
151
|
}
|
|
64
152
|
export type CollectionConfig = BaseCollectionConfig & {
|
|
153
|
+
/**
|
|
154
|
+
* Default fetch limit (items per page).
|
|
155
|
+
*/
|
|
65
156
|
limit?: number;
|
|
157
|
+
/**
|
|
158
|
+
* Reflect search/filters/sort in the URL.
|
|
159
|
+
* @default false
|
|
160
|
+
*/
|
|
66
161
|
reflectQueryInUrl?: boolean;
|
|
162
|
+
/**
|
|
163
|
+
* Scope of "Select All":
|
|
164
|
+
* - 'all': select the entire collection (server-side).
|
|
165
|
+
* - 'page': select only currently visible items.
|
|
166
|
+
* @default "all"
|
|
167
|
+
*/
|
|
67
168
|
selectAllScope?: 'page' | 'all';
|
|
169
|
+
/**
|
|
170
|
+
* Selection behavior when data changes:
|
|
171
|
+
* - 'preserve': keep current selections if still valid.
|
|
172
|
+
* - 'clear': clear selection on data refresh.
|
|
173
|
+
* @default "clear"
|
|
174
|
+
*/
|
|
68
175
|
selectionUpdateMode?: 'preserve' | 'clear';
|
|
176
|
+
/**
|
|
177
|
+
* Enables optimistic UI actions;
|
|
178
|
+
* Identifier that maps to a custom optimistic actions provided via overrides.
|
|
179
|
+
*/
|
|
69
180
|
optimisticActions?: {
|
|
70
181
|
id: string;
|
|
71
182
|
};
|
|
183
|
+
/**
|
|
184
|
+
* Pagination strategy:
|
|
185
|
+
* - 'cursor': `find()` must return { items, cursor, total? }
|
|
186
|
+
* - 'offset': `find()` must return { items, hasNext, total? }
|
|
187
|
+
* @default "offset"
|
|
188
|
+
*/
|
|
72
189
|
paginationMode?: 'cursor' | 'offset';
|
|
73
190
|
};
|
|
74
191
|
export interface BaseCollectionComponentConfig {
|
|
192
|
+
/**
|
|
193
|
+
* Collection data configuration and behavior.
|
|
194
|
+
*/
|
|
75
195
|
collection: CollectionConfig;
|
|
196
|
+
/**
|
|
197
|
+
* Entity page to navigate to (by page id) when interacting with rows (e.g. onRowClick/update).
|
|
198
|
+
*/
|
|
76
199
|
entityPageId?: string;
|
|
200
|
+
/**
|
|
201
|
+
* Search configuration.
|
|
202
|
+
*/
|
|
77
203
|
search?: {
|
|
204
|
+
/**
|
|
205
|
+
* Whether to show the search input.
|
|
206
|
+
* @default true
|
|
207
|
+
*/
|
|
78
208
|
shown?: boolean;
|
|
79
209
|
};
|
|
210
|
+
/**
|
|
211
|
+
* Toolbar title configuration.
|
|
212
|
+
*/
|
|
80
213
|
toolbarTitle?: ToolbarTitle;
|
|
214
|
+
/**
|
|
215
|
+
* Action cell configuration per row.
|
|
216
|
+
*/
|
|
81
217
|
actionCell?: ActionCellConfig;
|
|
218
|
+
/**
|
|
219
|
+
* Empty state configuration.
|
|
220
|
+
*/
|
|
82
221
|
emptyState?: EmptyState;
|
|
222
|
+
/**
|
|
223
|
+
* Filters configuration.
|
|
224
|
+
*/
|
|
83
225
|
filters?: FiltersConfig;
|
|
226
|
+
/**
|
|
227
|
+
* Bulk action toolbar configuration.
|
|
228
|
+
*/
|
|
84
229
|
bulkActionToolbar?: BulkActionsConfig;
|
|
85
230
|
}
|
|
86
231
|
export interface ToolbarTitle {
|
|
232
|
+
/**
|
|
233
|
+
* Title text.
|
|
234
|
+
*/
|
|
87
235
|
title: string;
|
|
236
|
+
/**
|
|
237
|
+
* Subtitle configuration.
|
|
238
|
+
*/
|
|
88
239
|
subtitle?: {
|
|
240
|
+
/**
|
|
241
|
+
* Subtitle text.
|
|
242
|
+
*/
|
|
89
243
|
text: string;
|
|
244
|
+
/**
|
|
245
|
+
* Info tooltip content with an optional link.
|
|
246
|
+
*/
|
|
90
247
|
info?: {
|
|
91
248
|
content: {
|
|
92
249
|
text: string;
|
|
@@ -96,43 +253,124 @@ export interface ToolbarTitle {
|
|
|
96
253
|
};
|
|
97
254
|
};
|
|
98
255
|
};
|
|
256
|
+
/**
|
|
257
|
+
* "Learn more" link.
|
|
258
|
+
*/
|
|
99
259
|
learnMore?: {
|
|
260
|
+
/**
|
|
261
|
+
* Where the link should navigate to.
|
|
262
|
+
*/
|
|
100
263
|
url: string;
|
|
264
|
+
/**
|
|
265
|
+
* The label of the link button.
|
|
266
|
+
*/
|
|
101
267
|
label?: string;
|
|
102
268
|
};
|
|
103
269
|
};
|
|
270
|
+
/**
|
|
271
|
+
* Show total items on the toolbar.
|
|
272
|
+
* @default false
|
|
273
|
+
*/
|
|
104
274
|
showTotal?: boolean;
|
|
275
|
+
/**
|
|
276
|
+
* Limit displayed item count in the toolbar.
|
|
277
|
+
*/
|
|
105
278
|
itemsLimit?: number;
|
|
106
279
|
}
|
|
107
280
|
export interface Column {
|
|
281
|
+
/**
|
|
282
|
+
* FieldId to bind the column to.
|
|
283
|
+
*/
|
|
108
284
|
id: string;
|
|
285
|
+
/**
|
|
286
|
+
* Column header text.
|
|
287
|
+
*/
|
|
109
288
|
name: string;
|
|
289
|
+
/**
|
|
290
|
+
* CSS width value (e.g. '120px', '20%').
|
|
291
|
+
*/
|
|
110
292
|
width: string;
|
|
293
|
+
/**
|
|
294
|
+
* Whether the column supports sorting.
|
|
295
|
+
*/
|
|
111
296
|
sortable?: boolean;
|
|
297
|
+
/**
|
|
298
|
+
* Initial sort order when the page loads.
|
|
299
|
+
*/
|
|
112
300
|
defaultSortOrder?: 'asc' | 'desc';
|
|
301
|
+
/**
|
|
302
|
+
* Current sort mode selected in UI.
|
|
303
|
+
*/
|
|
113
304
|
sortMode?: 'asc' | 'desc';
|
|
305
|
+
/**
|
|
306
|
+
* Hide column by default in the custom columns panel.
|
|
307
|
+
* When true, the column will not be shown initially and must be enabled by the user via the customize columns UI.
|
|
308
|
+
*/
|
|
114
309
|
defaultHidden?: boolean;
|
|
310
|
+
/**
|
|
311
|
+
* Exclude from the "customize columns" selection UI.
|
|
312
|
+
*/
|
|
115
313
|
hiddenFromCustomColumnsSelection?: boolean;
|
|
314
|
+
/**
|
|
315
|
+
* Controls whether the "hide/show" checkbox for this column is enabled in the custom columns panel.
|
|
316
|
+
* If set to false, the checkbox will be disabled and the user cannot toggle visibility for this column.
|
|
317
|
+
*/
|
|
116
318
|
hideable?: boolean;
|
|
319
|
+
/**
|
|
320
|
+
* Prevent column reordering in the customization UI.
|
|
321
|
+
*/
|
|
117
322
|
reorderDisabled?: boolean;
|
|
118
323
|
}
|
|
119
324
|
export interface GridItem {
|
|
325
|
+
/**
|
|
326
|
+
* FieldId to use as the card title.
|
|
327
|
+
*/
|
|
120
328
|
titleFieldId: string;
|
|
329
|
+
/**
|
|
330
|
+
* FieldId to use as the card subtitle.
|
|
331
|
+
*/
|
|
121
332
|
subtitleFieldId?: string;
|
|
333
|
+
/**
|
|
334
|
+
* FieldId to use as the card image.
|
|
335
|
+
*/
|
|
122
336
|
imageFieldId?: string;
|
|
337
|
+
/**
|
|
338
|
+
* Controls which content is shown in the card (preset):
|
|
339
|
+
* - 'full': shows title and subtitle.
|
|
340
|
+
* - 'title': shows only the title.
|
|
341
|
+
* - 'empty': hides both title and subtitle.
|
|
342
|
+
*/
|
|
123
343
|
cardContentMode?: 'full' | 'title' | 'empty';
|
|
344
|
+
/**
|
|
345
|
+
* Position of the image inside the card layout.
|
|
346
|
+
*/
|
|
124
347
|
imagePlacement?: 'top' | 'side';
|
|
125
348
|
}
|
|
126
349
|
export interface EmptyState {
|
|
350
|
+
/**
|
|
351
|
+
* Empty state title.
|
|
352
|
+
*/
|
|
127
353
|
title?: string;
|
|
354
|
+
/**
|
|
355
|
+
* Empty state subtitle.
|
|
356
|
+
*/
|
|
128
357
|
subtitle?: string;
|
|
358
|
+
/**
|
|
359
|
+
* Image to display in the empty state.
|
|
360
|
+
*/
|
|
129
361
|
image?: {
|
|
130
362
|
id: string;
|
|
131
363
|
};
|
|
364
|
+
/**
|
|
365
|
+
* "Add new" call-to-action button.
|
|
366
|
+
*/
|
|
132
367
|
addNewCta?: {
|
|
133
368
|
id?: string;
|
|
134
369
|
text?: string;
|
|
135
370
|
};
|
|
371
|
+
/**
|
|
372
|
+
* Custom CTA slot (advanced).
|
|
373
|
+
*/
|
|
136
374
|
customCta?: {
|
|
137
375
|
id?: string;
|
|
138
376
|
};
|
|
@@ -152,44 +390,121 @@ export declare enum ComponentTypeEnum {
|
|
|
152
390
|
}
|
|
153
391
|
export type FilterItems = Filter[];
|
|
154
392
|
export interface FiltersConfig {
|
|
393
|
+
/**
|
|
394
|
+
* Filter items to display.
|
|
395
|
+
*/
|
|
155
396
|
items: FilterItems;
|
|
397
|
+
/**
|
|
398
|
+
* Maximum number of filters shown inline before moving to the panel.
|
|
399
|
+
* @default 0 (all in panel).
|
|
400
|
+
*/
|
|
156
401
|
maxInlineFilters?: CollectionToolbarFiltersProps['inline'];
|
|
402
|
+
/**
|
|
403
|
+
* Title for the filter panel drawer.
|
|
404
|
+
*/
|
|
157
405
|
panelTitle?: string;
|
|
158
406
|
}
|
|
159
407
|
export interface BaseOptionsFilterConfig {
|
|
408
|
+
/**
|
|
409
|
+
* Selection behavior: single choice or multiple choices.
|
|
410
|
+
*/
|
|
160
411
|
selectionMode: FilterSelectionMode;
|
|
161
412
|
}
|
|
162
413
|
export interface DateFilterConfig {
|
|
414
|
+
/**
|
|
415
|
+
* Controls behavior: presets only, custom only, or both.
|
|
416
|
+
*/
|
|
163
417
|
mode?: DateRangeFilterMode;
|
|
418
|
+
/**
|
|
419
|
+
* Which preset ranges to display (only if mode supports presets).
|
|
420
|
+
*/
|
|
164
421
|
presets?: DateRangeOptions;
|
|
422
|
+
/**
|
|
423
|
+
* Whether to include time selection.
|
|
424
|
+
* @default true
|
|
425
|
+
*/
|
|
165
426
|
includeTime?: boolean;
|
|
166
427
|
}
|
|
167
428
|
export interface NumberFilterConfig {
|
|
429
|
+
/**
|
|
430
|
+
* Minimum allowed value.
|
|
431
|
+
*/
|
|
168
432
|
min?: number;
|
|
433
|
+
/**
|
|
434
|
+
* Maximum allowed value.
|
|
435
|
+
*/
|
|
169
436
|
max?: number;
|
|
437
|
+
/**
|
|
438
|
+
* Whether decimal values are allowed.
|
|
439
|
+
*/
|
|
170
440
|
allowedDecimals?: boolean;
|
|
171
441
|
}
|
|
172
442
|
export interface BooleanFilterConfig {
|
|
443
|
+
/**
|
|
444
|
+
* Label for the "true" option.
|
|
445
|
+
*/
|
|
173
446
|
trueLabel?: string;
|
|
447
|
+
/**
|
|
448
|
+
* Label for the "false" option.
|
|
449
|
+
*/
|
|
174
450
|
falseLabel?: string;
|
|
175
451
|
}
|
|
176
452
|
export interface EnumFilterConfig extends BaseOptionsFilterConfig {
|
|
453
|
+
/**
|
|
454
|
+
* List of available options.
|
|
455
|
+
*/
|
|
177
456
|
options: FilterOption[];
|
|
457
|
+
/**
|
|
458
|
+
* Rendering control for option appearance.
|
|
459
|
+
*/
|
|
178
460
|
optionType?: FilterOptionType;
|
|
179
461
|
}
|
|
180
462
|
export interface DynamicOptionsFilterConfig extends BaseOptionsFilterConfig {
|
|
181
463
|
}
|
|
182
464
|
export interface Filter {
|
|
465
|
+
/**
|
|
466
|
+
* Filter unique identifier.
|
|
467
|
+
*/
|
|
183
468
|
id: string;
|
|
469
|
+
/**
|
|
470
|
+
* Target field id this filter controls.
|
|
471
|
+
*/
|
|
184
472
|
fieldId: string;
|
|
473
|
+
/**
|
|
474
|
+
* Optional filter display name (defaults to field name).
|
|
475
|
+
*/
|
|
185
476
|
displayName?: string;
|
|
477
|
+
/**
|
|
478
|
+
* Optional grouping label. Filters with the same `sectionTitle` are grouped together.
|
|
479
|
+
*/
|
|
186
480
|
sectionTitle?: string;
|
|
481
|
+
/**
|
|
482
|
+
* Whether the filter item is expanded by default in the panel.
|
|
483
|
+
*/
|
|
187
484
|
openByDefault?: boolean;
|
|
485
|
+
/**
|
|
486
|
+
* Label shown in the table/grid tag when the filter is active.
|
|
487
|
+
*/
|
|
188
488
|
tagLabel?: string;
|
|
489
|
+
/**
|
|
490
|
+
* Configuration for number inputs (NUMBER fields).
|
|
491
|
+
*/
|
|
189
492
|
numberConfig?: NumberFilterConfig;
|
|
493
|
+
/**
|
|
494
|
+
* Configuration for date inputs (DATETIME fields).
|
|
495
|
+
*/
|
|
190
496
|
dateConfig?: DateFilterConfig;
|
|
497
|
+
/**
|
|
498
|
+
* Configuration for boolean input labels (BOOLEAN fields).
|
|
499
|
+
*/
|
|
191
500
|
booleanConfig?: BooleanFilterConfig;
|
|
501
|
+
/**
|
|
502
|
+
* Configuration for enum inputs (ARRAY/ARRAY_STRING fields).
|
|
503
|
+
*/
|
|
192
504
|
enumConfig?: EnumFilterConfig;
|
|
505
|
+
/**
|
|
506
|
+
* Dynamic options configuration (advanced).
|
|
507
|
+
*/
|
|
193
508
|
dynamicOptionsConfig?: DynamicOptionsFilterConfig;
|
|
194
509
|
}
|
|
195
510
|
//# sourceMappingURL=CollectionPageConfig.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CollectionPageConfig.d.ts","sourceRoot":"","sources":["../../../src/types/CollectionPageConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,oCAAoC,EACpC,4BAA4B,EAC5B,8BAA8B,EAC/B,MAAM,WAAW,CAAC;AAEnB,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE;QACV,GAAG,EAAE,MAAM,CAAC;QACZ,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;CACH;AAED,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE;QACL,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IACF,KAAK,EAAE,mBAAmB,CAAC;IAC3B,QAAQ,CAAC,EAAE,sBAAsB,CAAC;IAClC,OAAO,CAAC,EAAE;QACR,cAAc,CAAC,EAAE,4BAA4B,CAAC;QAC9C,gBAAgB,CAAC,EAAE,8BAA8B,CAAC;KACnD,CAAC;IACF,UAAU,EAAE,eAAe,EAAE,CAAC;CAC/B;AAED,MAAM,WAAW,yBACf,SAAQ,6BAA6B;IACrC,IAAI,EAAE,YAAY,CAAC;IACnB,MAAM,EAAE,gBAAgB,EAAE,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