@@ -22,21 +22,33 @@ import { BaseSchema, SchemaNodeSchema } from './base.zod.js';
2222/**
2323 * View Type Schema
2424 */
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' ) ;
2626
2727/**
2828 * Detail View Field Schema
2929 */
3030export const DetailViewFieldSchema = z . object ( {
3131 name : z . string ( ) . describe ( 'Field name/path' ) ,
3232 label : z . string ( ) . optional ( ) . describe ( 'Display label' ) ,
33- type : z . enum ( [ 'text' , 'image' , 'link' , 'badge' , 'date' , 'datetime' , 'json' , 'html' , 'markdown' , 'custom' ] ) . optional ( ) . describe ( 'Field type for rendering' ) ,
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' ) ,
3438 format : z . string ( ) . optional ( ) . describe ( 'Format string (e.g., date format)' ) ,
3539 render : SchemaNodeSchema . optional ( ) . describe ( 'Custom renderer' ) ,
3640 value : z . any ( ) . optional ( ) . describe ( 'Field value' ) ,
3741 readonly : z . boolean ( ) . optional ( ) . describe ( 'Whether field is read-only' ) ,
3842 visible : z . union ( [ z . boolean ( ) , z . string ( ) ] ) . optional ( ) . describe ( 'Field visibility condition' ) ,
3943 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)' ) ,
4052} ) ;
4153
4254/**
@@ -51,6 +63,8 @@ export const DetailViewSectionSchema = z.object({
5163 defaultCollapsed : z . boolean ( ) . optional ( ) . describe ( 'Default collapsed state' ) ,
5264 columns : z . number ( ) . optional ( ) . describe ( 'Grid columns for field layout' ) ,
5365 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)' ) ,
5468} ) ;
5569
5670/**
0 commit comments