Skip to content

Commit ae19749

Browse files
Copilothotlong
andcommitted
feat: add industry-standard fields to ListViewSchema, DashboardSchema, and ActionSchema
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent a186767 commit ae19749

3 files changed

Lines changed: 36 additions & 0 deletions

File tree

packages/spec/src/ui/action.zod.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,16 @@ export const ActionSchema = z.object({
8484

8585
/** Access */
8686
visible: z.string().optional().describe('Formula returning boolean'),
87+
disabled: z.union([z.boolean(), z.string()]).optional().describe('Whether the action is disabled, or a condition expression string'),
88+
89+
/** Keyboard Shortcut */
90+
shortcut: z.string().optional().describe('Keyboard shortcut to trigger this action (e.g., "Ctrl+S")'),
91+
92+
/** Bulk Operations */
93+
bulkEnabled: z.boolean().optional().describe('Whether this action can be applied to multiple selected records'),
94+
95+
/** Execution */
96+
timeout: z.number().optional().describe('Maximum execution time in milliseconds for the action'),
8797
});
8898

8999
export type Action = z.infer<typeof ActionSchema>;

packages/spec/src/ui/dashboard.zod.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,13 @@ export const DashboardSchema = z.object({
9494

9595
/** Auto-refresh */
9696
refreshInterval: z.number().optional().describe('Auto-refresh interval in seconds'),
97+
98+
/** Global Filters */
99+
globalFilters: z.array(z.object({
100+
field: z.string().describe('Field name to filter on'),
101+
label: z.string().optional().describe('Display label for the filter'),
102+
type: z.enum(['text', 'select', 'date', 'number']).optional().describe('Filter input type'),
103+
})).optional().describe('Global filters that apply to all widgets in the dashboard'),
97104
});
98105

99106
export type Dashboard = z.infer<typeof DashboardSchema>;

packages/spec/src/ui/view.zod.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,25 @@ export const ListViewSchema = z.object({
216216
calendar: CalendarConfigSchema.optional(),
217217
gantt: GanttConfigSchema.optional(),
218218

219+
/** Row & Bulk Actions */
220+
rowActions: z.array(z.string()).optional().describe('Actions available for individual row items'),
221+
bulkActions: z.array(z.string()).optional().describe('Actions available when multiple rows are selected'),
222+
223+
/** Performance */
224+
virtualScroll: z.boolean().optional().describe('Enable virtual scrolling for large datasets'),
225+
226+
/** Conditional Formatting */
227+
conditionalFormatting: z.array(z.object({
228+
condition: z.string().describe('Condition expression to evaluate'),
229+
style: z.record(z.string(), z.string()).describe('CSS styles to apply when condition is true'),
230+
})).optional().describe('Conditional formatting rules for list rows'),
231+
232+
/** Inline Edit */
233+
inlineEdit: z.boolean().optional().describe('Allow inline editing of records directly in the list view'),
234+
235+
/** Export */
236+
exportOptions: z.array(z.enum(['csv', 'xlsx', 'pdf', 'json'])).optional().describe('Available export format options'),
237+
219238
/** Empty State */
220239
emptyState: z.object({
221240
title: z.string().optional(),

0 commit comments

Comments
 (0)