@object-ui/types 3.0.3 → 3.1.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/app.d.ts +217 -0
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +85 -1
- package/dist/complex.d.ts +118 -0
- package/dist/complex.d.ts.map +1 -1
- package/dist/data-display.d.ts +105 -1
- package/dist/data-display.d.ts.map +1 -1
- package/dist/data.d.ts +45 -0
- package/dist/data.d.ts.map +1 -1
- package/dist/designer.d.ts +197 -35
- package/dist/designer.d.ts.map +1 -1
- package/dist/designer.js +11 -1
- package/dist/index.d.ts +21 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/layout.d.ts +39 -2
- package/dist/layout.d.ts.map +1 -1
- package/dist/navigation.d.ts +27 -0
- package/dist/navigation.d.ts.map +1 -1
- package/dist/objectql.d.ts +641 -7
- package/dist/objectql.d.ts.map +1 -1
- package/dist/record-components.d.ts +160 -0
- package/dist/record-components.d.ts.map +1 -0
- package/dist/record-components.js +8 -0
- package/dist/reports.d.ts +37 -0
- package/dist/reports.d.ts.map +1 -1
- package/dist/theme.d.ts +5 -0
- package/dist/theme.d.ts.map +1 -1
- package/dist/views.d.ts +257 -3
- package/dist/views.d.ts.map +1 -1
- package/dist/workflow.d.ts +198 -0
- package/dist/workflow.d.ts.map +1 -1
- package/dist/zod/app.zod.d.ts +42 -2
- package/dist/zod/app.zod.d.ts.map +1 -1
- package/dist/zod/app.zod.js +61 -1
- package/dist/zod/complex.zod.d.ts +122 -0
- package/dist/zod/complex.zod.d.ts.map +1 -1
- package/dist/zod/complex.zod.js +57 -0
- package/dist/zod/data-display.zod.d.ts +4 -0
- package/dist/zod/data-display.zod.d.ts.map +1 -1
- package/dist/zod/data-display.zod.js +2 -0
- package/dist/zod/form.zod.d.ts +6 -6
- package/dist/zod/index.zod.d.ts +364 -41
- package/dist/zod/index.zod.d.ts.map +1 -1
- package/dist/zod/index.zod.js +2 -2
- package/dist/zod/layout.zod.d.ts +6 -6
- package/dist/zod/navigation.zod.d.ts +58 -12
- package/dist/zod/navigation.zod.d.ts.map +1 -1
- package/dist/zod/navigation.zod.js +21 -9
- package/dist/zod/objectql.zod.d.ts +515 -27
- package/dist/zod/objectql.zod.d.ts.map +1 -1
- package/dist/zod/objectql.zod.js +162 -0
- package/dist/zod/reports.zod.d.ts +38 -38
- package/dist/zod/views.zod.d.ts +161 -7
- package/dist/zod/views.zod.d.ts.map +1 -1
- package/dist/zod/views.zod.js +21 -2
- package/package.json +2 -2
- package/src/__tests__/app-creation-types.test.ts +177 -0
- package/src/__tests__/dashboard-config.test.ts +208 -0
- package/src/__tests__/examples-metadata-compliance.test.ts +264 -0
- package/src/__tests__/navigation-model.test.ts +406 -0
- package/src/__tests__/p1-spec-alignment.test.ts +660 -0
- package/src/__tests__/p2-spec-exports.test.ts +312 -0
- package/src/__tests__/phase2-schemas.test.ts +108 -0
- package/src/app.ts +377 -0
- package/src/complex.ts +120 -0
- package/src/data-display.ts +107 -0
- package/src/data.ts +49 -0
- package/src/designer.ts +219 -30
- package/src/index.ts +192 -3
- package/src/layout.ts +55 -2
- package/src/navigation.ts +20 -0
- package/src/objectql.ts +757 -8
- package/src/record-components.ts +188 -0
- package/src/reports.ts +43 -0
- package/src/theme.ts +6 -0
- package/src/views.ts +275 -3
- package/src/workflow.ts +226 -0
- package/src/zod/app.zod.ts +74 -1
- package/src/zod/complex.zod.ts +59 -0
- package/src/zod/data-display.zod.ts +2 -0
- package/src/zod/index.zod.ts +5 -0
- package/src/zod/navigation.zod.ts +22 -10
- package/src/zod/objectql.zod.ts +167 -0
- package/src/zod/views.zod.ts +21 -2
package/src/zod/objectql.zod.ts
CHANGED
|
@@ -73,6 +73,18 @@ export const ListColumnSchema = z.object({
|
|
|
73
73
|
type: z.string().optional().describe('Renderer type override'),
|
|
74
74
|
link: z.boolean().optional().describe('Functions as the primary navigation link (triggers View navigation)'),
|
|
75
75
|
action: z.string().optional().describe('Registered Action ID to execute when clicked'),
|
|
76
|
+
pinned: z.enum(['left', 'right']).optional().describe('Pin column to left or right edge'),
|
|
77
|
+
summary: z.union([
|
|
78
|
+
z.string(),
|
|
79
|
+
z.object({
|
|
80
|
+
type: z.enum(['count', 'sum', 'avg', 'min', 'max']).describe('Aggregation type'),
|
|
81
|
+
field: z.string().optional().describe('Field to aggregate (defaults to column field)'),
|
|
82
|
+
}),
|
|
83
|
+
]).optional().describe('Column footer summary/aggregation'),
|
|
84
|
+
prefix: z.object({
|
|
85
|
+
field: z.string().describe('Field name to render as prefix'),
|
|
86
|
+
type: z.enum(['badge', 'text']).optional().describe('Renderer type for the prefix'),
|
|
87
|
+
}).optional().describe('Prefix configuration for compound cell rendering (Airtable-style)'),
|
|
76
88
|
});
|
|
77
89
|
|
|
78
90
|
/**
|
|
@@ -179,6 +191,7 @@ export const ObjectViewSchema = BaseSchema.extend({
|
|
|
179
191
|
form: z.lazy(() => ObjectFormSchema.omit({ type: true, objectName: true, mode: true }).partial()).optional().describe('Form config'),
|
|
180
192
|
showSearch: z.boolean().optional().describe('Show search'),
|
|
181
193
|
showFilters: z.boolean().optional().describe('Show filters'),
|
|
194
|
+
showSort: z.boolean().optional().describe('Show sort controls'),
|
|
182
195
|
showCreate: z.boolean().optional().describe('Show create button'),
|
|
183
196
|
showRefresh: z.boolean().optional().describe('Show refresh button'),
|
|
184
197
|
operations: z.object({
|
|
@@ -189,6 +202,49 @@ export const ObjectViewSchema = BaseSchema.extend({
|
|
|
189
202
|
}).optional().describe('Enabled operations'),
|
|
190
203
|
});
|
|
191
204
|
|
|
205
|
+
/**
|
|
206
|
+
* User Filters — field-level filter option
|
|
207
|
+
*/
|
|
208
|
+
const UserFilterOptionSchema = z.object({
|
|
209
|
+
label: z.string().describe('Option display label'),
|
|
210
|
+
value: z.union([z.string(), z.number(), z.boolean()]).describe('Option value'),
|
|
211
|
+
color: z.string().optional().describe('Option badge color'),
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* User Filters — field-level filter definition (dropdown & toggle modes)
|
|
216
|
+
*/
|
|
217
|
+
const UserFilterFieldSchema = z.object({
|
|
218
|
+
field: z.string().describe('Field name to filter on'),
|
|
219
|
+
label: z.string().optional().describe('Display label'),
|
|
220
|
+
type: z.enum(['select', 'multi-select', 'boolean', 'date-range', 'text']).optional().describe('Filter input type'),
|
|
221
|
+
options: z.array(UserFilterOptionSchema).optional().describe('Static options'),
|
|
222
|
+
showCount: z.boolean().optional().describe('Show record count per option'),
|
|
223
|
+
defaultValues: z.array(z.union([z.string(), z.number(), z.boolean()])).optional().describe('Default selected values'),
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* User Filters — tab preset definition (tabs mode)
|
|
228
|
+
*/
|
|
229
|
+
const UserFilterTabSchema = z.object({
|
|
230
|
+
id: z.string().describe('Unique tab identifier'),
|
|
231
|
+
label: z.string().describe('Tab display label'),
|
|
232
|
+
filters: z.array(z.union([z.array(z.any()), z.string()])).describe('Filter conditions'),
|
|
233
|
+
icon: z.string().optional().describe('Icon name'),
|
|
234
|
+
default: z.boolean().optional().describe('Default active tab'),
|
|
235
|
+
});
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* User Filters Configuration Schema (Airtable Interfaces-style)
|
|
239
|
+
*/
|
|
240
|
+
const UserFiltersSchema = z.object({
|
|
241
|
+
element: z.enum(['dropdown', 'tabs', 'toggle']).describe('UI element type'),
|
|
242
|
+
fields: z.array(UserFilterFieldSchema).optional().describe('Field-level filters'),
|
|
243
|
+
tabs: z.array(UserFilterTabSchema).optional().describe('Named filter presets'),
|
|
244
|
+
allowAddTab: z.boolean().optional().describe('Allow adding new tabs'),
|
|
245
|
+
showAllRecords: z.boolean().optional().describe('Show All records tab'),
|
|
246
|
+
});
|
|
247
|
+
|
|
192
248
|
/**
|
|
193
249
|
* ListView Schema
|
|
194
250
|
*/
|
|
@@ -200,6 +256,105 @@ export const ListViewSchema = BaseSchema.extend({
|
|
|
200
256
|
filters: z.array(z.union([z.array(z.any()), z.string()])).optional().describe('Filter conditions'),
|
|
201
257
|
sort: z.array(SortConfigSchema).optional().describe('Sort order'),
|
|
202
258
|
options: z.record(z.string(), z.any()).optional().describe('Component overrides'),
|
|
259
|
+
userFilters: UserFiltersSchema.optional().describe('User filters configuration'),
|
|
260
|
+
showSearch: z.boolean().optional().describe('Show search in toolbar'),
|
|
261
|
+
showSort: z.boolean().optional().describe('Show sort controls in toolbar'),
|
|
262
|
+
showFilters: z.boolean().optional().describe('Show filter controls in toolbar'),
|
|
263
|
+
showHideFields: z.boolean().optional().describe('Show hide-fields button in toolbar'),
|
|
264
|
+
showGroup: z.boolean().optional().describe('Show group button in toolbar'),
|
|
265
|
+
showColor: z.boolean().optional().describe('Show color button in toolbar'),
|
|
266
|
+
showDensity: z.boolean().optional().describe('Show density/row-height button in toolbar'),
|
|
267
|
+
allowExport: z.boolean().optional().describe('Allow data export'),
|
|
268
|
+
striped: z.boolean().optional().describe('Alternating row colors'),
|
|
269
|
+
bordered: z.boolean().optional().describe('Show cell borders'),
|
|
270
|
+
color: z.string().optional().describe('Color field for row/card coloring'),
|
|
271
|
+
inlineEdit: z.boolean().optional().describe('Enable inline editing'),
|
|
272
|
+
wrapHeaders: z.boolean().optional().describe('Wrap column headers'),
|
|
273
|
+
clickIntoRecordDetails: z.boolean().optional().describe('Navigate to detail on row click'),
|
|
274
|
+
addRecordViaForm: z.boolean().optional().describe('Add records via form dialog'),
|
|
275
|
+
addDeleteRecordsInline: z.boolean().optional().describe('Enable inline add/delete'),
|
|
276
|
+
collapseAllByDefault: z.boolean().optional().describe('Collapse all groups by default'),
|
|
277
|
+
fieldTextColor: z.string().optional().describe('Field for custom text color'),
|
|
278
|
+
prefixField: z.string().optional().describe('Prefix field before title'),
|
|
279
|
+
showDescription: z.boolean().optional().describe('Show field descriptions'),
|
|
280
|
+
navigation: z.object({
|
|
281
|
+
mode: z.enum(['page', 'drawer', 'modal', 'split', 'popover', 'new_window', 'none']),
|
|
282
|
+
view: z.string().optional(),
|
|
283
|
+
preventNavigation: z.boolean().optional(),
|
|
284
|
+
openNewTab: z.boolean().optional(),
|
|
285
|
+
width: z.union([z.string(), z.number()]).optional(),
|
|
286
|
+
}).optional().describe('Navigation configuration'),
|
|
287
|
+
selection: z.object({
|
|
288
|
+
type: z.enum(['none', 'single', 'multiple']),
|
|
289
|
+
}).optional().describe('Row selection mode'),
|
|
290
|
+
pagination: z.object({
|
|
291
|
+
pageSize: z.number(),
|
|
292
|
+
pageSizeOptions: z.array(z.number()).optional(),
|
|
293
|
+
}).optional().describe('Pagination configuration'),
|
|
294
|
+
searchableFields: z.array(z.string()).optional().describe('Searchable fields'),
|
|
295
|
+
filterableFields: z.array(z.string()).optional().describe('Filterable fields'),
|
|
296
|
+
resizable: z.boolean().optional().describe('Allow column resizing'),
|
|
297
|
+
densityMode: z.enum(['compact', 'comfortable', 'spacious']).optional().describe('Density mode'),
|
|
298
|
+
rowHeight: z.enum(['compact', 'short', 'medium', 'tall', 'extra_tall']).optional().describe('Row height'),
|
|
299
|
+
hiddenFields: z.array(z.string()).optional().describe('Hidden fields'),
|
|
300
|
+
exportOptions: z.union([
|
|
301
|
+
z.array(z.enum(['csv', 'xlsx', 'json', 'pdf'])),
|
|
302
|
+
z.object({
|
|
303
|
+
formats: z.array(z.enum(['csv', 'xlsx', 'json', 'pdf'])).optional(),
|
|
304
|
+
maxRecords: z.number().optional(),
|
|
305
|
+
includeHeaders: z.boolean().optional(),
|
|
306
|
+
fileNamePrefix: z.string().optional(),
|
|
307
|
+
}),
|
|
308
|
+
]).optional().describe('Export options'),
|
|
309
|
+
rowActions: z.array(z.string()).optional().describe('Row action identifiers'),
|
|
310
|
+
bulkActions: z.array(z.string()).optional().describe('Bulk action identifiers'),
|
|
311
|
+
sharing: z.object({
|
|
312
|
+
visibility: z.enum(['private', 'team', 'organization', 'public']).optional(),
|
|
313
|
+
enabled: z.boolean().optional(),
|
|
314
|
+
type: z.enum(['personal', 'collaborative']).optional(),
|
|
315
|
+
lockedBy: z.string().optional(),
|
|
316
|
+
}).optional().describe('Sharing configuration'),
|
|
317
|
+
addRecord: z.object({
|
|
318
|
+
enabled: z.boolean().optional(),
|
|
319
|
+
position: z.string().optional(),
|
|
320
|
+
mode: z.string().optional(),
|
|
321
|
+
formView: z.string().optional(),
|
|
322
|
+
}).optional().describe('Add record configuration'),
|
|
323
|
+
conditionalFormatting: z.array(z.union([
|
|
324
|
+
z.object({
|
|
325
|
+
field: z.string(),
|
|
326
|
+
operator: z.enum(['equals', 'not_equals', 'contains', 'greater_than', 'less_than', 'in']),
|
|
327
|
+
value: z.any(),
|
|
328
|
+
backgroundColor: z.string().optional(),
|
|
329
|
+
textColor: z.string().optional(),
|
|
330
|
+
borderColor: z.string().optional(),
|
|
331
|
+
expression: z.string().optional(),
|
|
332
|
+
}),
|
|
333
|
+
z.object({
|
|
334
|
+
condition: z.string(),
|
|
335
|
+
style: z.record(z.string(), z.string()),
|
|
336
|
+
}),
|
|
337
|
+
])).optional().describe('Conditional formatting rules'),
|
|
338
|
+
quickFilters: z.array(z.object({
|
|
339
|
+
id: z.string(),
|
|
340
|
+
label: z.string(),
|
|
341
|
+
filters: z.array(z.union([z.array(z.any()), z.string()])),
|
|
342
|
+
icon: z.string().optional(),
|
|
343
|
+
defaultActive: z.boolean().optional(),
|
|
344
|
+
})).optional().describe('Quick filter presets'),
|
|
345
|
+
showRecordCount: z.boolean().optional().describe('Show total record count'),
|
|
346
|
+
allowPrinting: z.boolean().optional().describe('Allow printing'),
|
|
347
|
+
virtualScroll: z.boolean().optional().describe('Enable virtual scrolling'),
|
|
348
|
+
emptyState: z.object({
|
|
349
|
+
title: z.string().optional(),
|
|
350
|
+
message: z.string().optional(),
|
|
351
|
+
icon: z.string().optional(),
|
|
352
|
+
}).optional().describe('Empty state configuration'),
|
|
353
|
+
aria: z.object({
|
|
354
|
+
label: z.string().optional(),
|
|
355
|
+
describedBy: z.string().optional(),
|
|
356
|
+
live: z.enum(['polite', 'assertive', 'off']).optional(),
|
|
357
|
+
}).optional().describe('ARIA attributes'),
|
|
203
358
|
});
|
|
204
359
|
|
|
205
360
|
/**
|
|
@@ -240,12 +395,24 @@ export const ObjectCalendarSchema = BaseSchema.extend({
|
|
|
240
395
|
/**
|
|
241
396
|
* ObjectKanban Schema
|
|
242
397
|
*/
|
|
398
|
+
const KanbanConditionalFormattingRuleSchema = z.object({
|
|
399
|
+
field: z.string().describe('Field name to check'),
|
|
400
|
+
operator: z.enum(['equals', 'not_equals', 'contains', 'in']).describe('Comparison operator'),
|
|
401
|
+
value: z.union([z.string(), z.array(z.string())]).describe('Value to compare against'),
|
|
402
|
+
backgroundColor: z.string().optional().describe('Background color'),
|
|
403
|
+
borderColor: z.string().optional().describe('Border color'),
|
|
404
|
+
});
|
|
405
|
+
|
|
243
406
|
export const ObjectKanbanSchema = BaseSchema.extend({
|
|
244
407
|
type: z.literal('object-kanban'),
|
|
245
408
|
objectName: z.string().describe('ObjectQL object name'),
|
|
246
409
|
groupField: z.string().describe('Group field'),
|
|
247
410
|
titleField: z.string().optional().describe('Title field'),
|
|
248
411
|
cardFields: z.array(z.string()).optional().describe('Card fields'),
|
|
412
|
+
quickAdd: z.boolean().optional().describe('Enable Quick Add button at column bottom'),
|
|
413
|
+
coverImageField: z.string().optional().describe('Field name for cover image on cards'),
|
|
414
|
+
allowCollapse: z.boolean().optional().describe('Allow columns to collapse/expand'),
|
|
415
|
+
conditionalFormatting: z.array(KanbanConditionalFormattingRuleSchema).optional().describe('Card conditional formatting rules'),
|
|
249
416
|
});
|
|
250
417
|
|
|
251
418
|
/**
|
package/src/zod/views.zod.ts
CHANGED
|
@@ -22,7 +22,7 @@ import { BaseSchema, SchemaNodeSchema } from './base.zod.js';
|
|
|
22
22
|
/**
|
|
23
23
|
* View Type Schema
|
|
24
24
|
*/
|
|
25
|
-
export const ViewTypeSchema = z.enum(['list', 'detail', 'grid', 'kanban', 'calendar', 'timeline', 'map']).describe('View type');
|
|
25
|
+
export const ViewTypeSchema = z.enum(['list', 'detail', 'grid', 'kanban', 'calendar', 'timeline', 'map', 'gallery', 'gantt']).describe('View type');
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
28
|
* Detail View Field Schema
|
|
@@ -30,13 +30,25 @@ export const ViewTypeSchema = z.enum(['list', 'detail', 'grid', 'kanban', 'calen
|
|
|
30
30
|
export const DetailViewFieldSchema = z.object({
|
|
31
31
|
name: z.string().describe('Field name/path'),
|
|
32
32
|
label: z.string().optional().describe('Display label'),
|
|
33
|
-
type: z.enum([
|
|
33
|
+
type: z.enum([
|
|
34
|
+
'text', 'number', 'currency', 'percent', 'boolean', 'select', 'lookup', 'master_detail',
|
|
35
|
+
'email', 'url', 'phone', 'user',
|
|
36
|
+
'image', 'link', 'badge', 'date', 'datetime', 'json', 'html', 'markdown', 'custom',
|
|
37
|
+
]).optional().describe('Field type for rendering'),
|
|
34
38
|
format: z.string().optional().describe('Format string (e.g., date format)'),
|
|
35
39
|
render: SchemaNodeSchema.optional().describe('Custom renderer'),
|
|
36
40
|
value: z.any().optional().describe('Field value'),
|
|
37
41
|
readonly: z.boolean().optional().describe('Whether field is read-only'),
|
|
38
42
|
visible: z.union([z.boolean(), z.string()]).optional().describe('Field visibility condition'),
|
|
39
43
|
span: z.number().optional().describe('Span across columns (for grid layout)'),
|
|
44
|
+
options: z.array(z.object({
|
|
45
|
+
label: z.string(),
|
|
46
|
+
value: z.union([z.string(), z.number(), z.boolean()]),
|
|
47
|
+
color: z.string().optional(),
|
|
48
|
+
})).optional().describe('Options for select/lookup fields'),
|
|
49
|
+
reference_to: z.string().optional().describe('Referenced object name for lookup/master_detail fields'),
|
|
50
|
+
reference_field: z.string().optional().describe('Display field on the referenced object'),
|
|
51
|
+
currency: z.string().optional().describe('Currency code for currency fields (e.g. USD, EUR)'),
|
|
40
52
|
});
|
|
41
53
|
|
|
42
54
|
/**
|
|
@@ -51,6 +63,8 @@ export const DetailViewSectionSchema = z.object({
|
|
|
51
63
|
defaultCollapsed: z.boolean().optional().describe('Default collapsed state'),
|
|
52
64
|
columns: z.number().optional().describe('Grid columns for field layout'),
|
|
53
65
|
visible: z.union([z.boolean(), z.string()]).optional().describe('Section visibility condition'),
|
|
66
|
+
showBorder: z.boolean().optional().describe('Show border around section'),
|
|
67
|
+
headerColor: z.string().optional().describe('Header background color (Tailwind class)'),
|
|
54
68
|
});
|
|
55
69
|
|
|
56
70
|
/**
|
|
@@ -119,6 +133,11 @@ export const ViewSwitcherSchema = BaseSchema.extend({
|
|
|
119
133
|
onViewChange: z.string().optional().describe('View change callback'),
|
|
120
134
|
persistPreference: z.boolean().optional().describe('Persist view preference'),
|
|
121
135
|
storageKey: z.string().optional().describe('Storage key for persisting view'),
|
|
136
|
+
allowCreateView: z.boolean().optional().describe('Show "+" button to add/create a new view'),
|
|
137
|
+
viewActions: z.array(z.object({
|
|
138
|
+
type: z.enum(['share', 'settings', 'duplicate', 'delete']).describe('Action type'),
|
|
139
|
+
icon: z.string().optional().describe('Action icon'),
|
|
140
|
+
})).optional().describe('Per-view action icons'),
|
|
122
141
|
});
|
|
123
142
|
|
|
124
143
|
/**
|