@object-ui/types 0.5.0 → 3.0.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.
Files changed (127) hide show
  1. package/README.md +1 -1
  2. package/dist/ai.d.ts +376 -0
  3. package/dist/ai.d.ts.map +1 -0
  4. package/dist/ai.js +8 -0
  5. package/dist/app.d.ts +2 -2
  6. package/dist/complex.d.ts +2 -0
  7. package/dist/complex.d.ts.map +1 -1
  8. package/dist/crud.d.ts +3 -0
  9. package/dist/crud.d.ts.map +1 -1
  10. package/dist/data-display.d.ts +40 -0
  11. package/dist/data-display.d.ts.map +1 -1
  12. package/dist/data-protocol.d.ts +19 -19
  13. package/dist/data.d.ts +77 -0
  14. package/dist/data.d.ts.map +1 -1
  15. package/dist/designer.d.ts +473 -0
  16. package/dist/designer.d.ts.map +1 -0
  17. package/dist/designer.js +8 -0
  18. package/dist/form.d.ts +35 -1
  19. package/dist/form.d.ts.map +1 -1
  20. package/dist/index.d.ts +46 -8
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +18 -0
  23. package/dist/layout.d.ts +63 -8
  24. package/dist/layout.d.ts.map +1 -1
  25. package/dist/mobile.d.ts +186 -0
  26. package/dist/mobile.d.ts.map +1 -0
  27. package/dist/mobile.js +8 -0
  28. package/dist/objectql.d.ts +341 -88
  29. package/dist/objectql.d.ts.map +1 -1
  30. package/dist/permissions.d.ts +150 -0
  31. package/dist/permissions.d.ts.map +1 -0
  32. package/dist/permissions.js +8 -0
  33. package/dist/tenant.d.ts +138 -0
  34. package/dist/tenant.d.ts.map +1 -0
  35. package/dist/tenant.js +8 -0
  36. package/dist/theme.d.ts +115 -224
  37. package/dist/theme.d.ts.map +1 -1
  38. package/dist/ui-action.d.ts +126 -11
  39. package/dist/ui-action.d.ts.map +1 -1
  40. package/dist/views.d.ts +20 -0
  41. package/dist/views.d.ts.map +1 -1
  42. package/dist/widget.d.ts +181 -0
  43. package/dist/widget.d.ts.map +1 -0
  44. package/dist/widget.js +8 -0
  45. package/dist/workflow.d.ts +340 -0
  46. package/dist/workflow.d.ts.map +1 -0
  47. package/dist/workflow.js +8 -0
  48. package/dist/zod/blocks.zod.d.ts +2 -2
  49. package/dist/zod/blocks.zod.d.ts.map +1 -1
  50. package/dist/zod/blocks.zod.js +1 -1
  51. package/dist/zod/complex.zod.d.ts +6 -6
  52. package/dist/zod/complex.zod.d.ts.map +1 -1
  53. package/dist/zod/complex.zod.js +1 -1
  54. package/dist/zod/crud.zod.d.ts +5 -5
  55. package/dist/zod/data-display.zod.d.ts +2 -2
  56. package/dist/zod/data-display.zod.d.ts.map +1 -1
  57. package/dist/zod/data-display.zod.js +1 -1
  58. package/dist/zod/disclosure.zod.d.ts +2 -2
  59. package/dist/zod/disclosure.zod.d.ts.map +1 -1
  60. package/dist/zod/disclosure.zod.js +1 -1
  61. package/dist/zod/feedback.zod.d.ts +12 -12
  62. package/dist/zod/feedback.zod.d.ts.map +1 -1
  63. package/dist/zod/feedback.zod.js +1 -1
  64. package/dist/zod/form.zod.d.ts +6 -6
  65. package/dist/zod/form.zod.d.ts.map +1 -1
  66. package/dist/zod/form.zod.js +1 -1
  67. package/dist/zod/index.zod.d.ts +337 -146
  68. package/dist/zod/index.zod.d.ts.map +1 -1
  69. package/dist/zod/index.zod.js +4 -4
  70. package/dist/zod/layout.zod.d.ts +134 -2
  71. package/dist/zod/layout.zod.d.ts.map +1 -1
  72. package/dist/zod/layout.zod.js +35 -1
  73. package/dist/zod/navigation.zod.d.ts +2 -2
  74. package/dist/zod/navigation.zod.d.ts.map +1 -1
  75. package/dist/zod/navigation.zod.js +1 -1
  76. package/dist/zod/objectql.zod.d.ts +32 -16
  77. package/dist/zod/objectql.zod.d.ts.map +1 -1
  78. package/dist/zod/objectql.zod.js +8 -0
  79. package/dist/zod/overlay.zod.d.ts +2 -2
  80. package/dist/zod/overlay.zod.d.ts.map +1 -1
  81. package/dist/zod/overlay.zod.js +1 -1
  82. package/dist/zod/reports.zod.d.ts +19 -19
  83. package/dist/zod/reports.zod.d.ts.map +1 -1
  84. package/dist/zod/reports.zod.js +1 -1
  85. package/dist/zod/theme.zod.d.ts +948 -267
  86. package/dist/zod/theme.zod.d.ts.map +1 -1
  87. package/dist/zod/theme.zod.js +175 -45
  88. package/dist/zod/views.zod.d.ts +22 -22
  89. package/dist/zod/views.zod.d.ts.map +1 -1
  90. package/dist/zod/views.zod.js +1 -1
  91. package/package.json +3 -2
  92. package/src/__tests__/namespace-exports.test.ts +23 -68
  93. package/src/__tests__/phase2-schemas.test.ts +8 -13
  94. package/src/ai.ts +454 -0
  95. package/src/app.ts +2 -2
  96. package/src/complex.ts +2 -0
  97. package/src/crud.ts +3 -0
  98. package/src/data-display.ts +36 -0
  99. package/src/data-protocol.ts +19 -19
  100. package/src/data.ts +91 -0
  101. package/src/designer.ts +509 -0
  102. package/src/form.ts +35 -1
  103. package/src/index.ts +397 -8
  104. package/src/layout.ts +66 -8
  105. package/src/mobile.ts +205 -0
  106. package/src/objectql.ts +419 -93
  107. package/src/permissions.ts +166 -0
  108. package/src/tenant.ts +153 -0
  109. package/src/theme.ts +147 -260
  110. package/src/ui-action.ts +166 -27
  111. package/src/views.ts +17 -0
  112. package/src/widget.ts +197 -0
  113. package/src/workflow.ts +409 -0
  114. package/src/zod/blocks.zod.ts +1 -1
  115. package/src/zod/complex.zod.ts +1 -1
  116. package/src/zod/data-display.zod.ts +1 -1
  117. package/src/zod/disclosure.zod.ts +1 -1
  118. package/src/zod/feedback.zod.ts +1 -1
  119. package/src/zod/form.zod.ts +1 -1
  120. package/src/zod/index.zod.ts +14 -3
  121. package/src/zod/layout.zod.ts +39 -1
  122. package/src/zod/navigation.zod.ts +1 -1
  123. package/src/zod/objectql.zod.ts +8 -0
  124. package/src/zod/overlay.zod.ts +1 -1
  125. package/src/zod/reports.zod.ts +1 -1
  126. package/src/zod/theme.zod.ts +189 -48
  127. package/src/zod/views.zod.ts +1 -1
package/src/objectql.ts CHANGED
@@ -22,119 +22,82 @@ import type { BaseSchema } from './base';
22
22
  import type { TableColumn } from './data-display';
23
23
  import type { FormField } from './form';
24
24
 
25
+ // ============================================================================
26
+ // Spec-Canonical Types — imported from @objectstack/spec/ui
27
+ // Rule: "Never Redefine Types. ALWAYS import them."
28
+ // ============================================================================
29
+
25
30
  /**
26
31
  * HTTP Method for API requests
32
+ * Canonical definition from @objectstack/spec/ui.
27
33
  */
28
- export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
34
+ export type { HttpMethod } from '@objectstack/spec/ui';
29
35
 
30
36
  /**
31
37
  * HTTP Request Configuration for API Provider
32
- * Aligned with @objectstack/spec HttpRequestSchema
38
+ * Canonical definition from @objectstack/spec/ui.
33
39
  */
34
- export interface HttpRequest {
35
- /** API endpoint URL */
36
- url: string;
37
- /** HTTP method (default: GET) */
38
- method?: HttpMethod;
39
- /** Custom HTTP headers */
40
- headers?: Record<string, string>;
41
- /** Query parameters */
42
- params?: Record<string, unknown>;
43
- /** Request body for POST/PUT/PATCH - supports JSON objects, strings, FormData, or Blob */
44
- body?: Record<string, unknown> | string | FormData | Blob;
45
- }
40
+ export type { HttpRequest } from '@objectstack/spec/ui';
46
41
 
47
42
  /**
48
43
  * View Data Source Configuration
49
- * Aligned with @objectstack/spec ViewDataSchema
50
- *
44
+ * Canonical definition from @objectstack/spec/ui.
45
+ *
51
46
  * Supports three modes:
52
47
  * 1. 'object': Standard Protocol - Auto-connects to ObjectStack Metadata and Data APIs
53
48
  * 2. 'api': Custom API - Explicitly provided API URLs
54
49
  * 3. 'value': Static Data - Hardcoded data array
55
50
  */
56
- export type ViewData =
57
- | {
58
- provider: 'object';
59
- /** Target object name */
60
- object: string;
61
- }
62
- | {
63
- provider: 'api';
64
- /** Configuration for fetching data */
65
- read?: HttpRequest;
66
- /** Configuration for submitting data (for forms/editable tables) */
67
- write?: HttpRequest;
68
- }
69
- | {
70
- provider: 'value';
71
- /** Static data array */
72
- items: unknown[];
73
- };
51
+ export type { ViewData } from '@objectstack/spec/ui';
74
52
 
75
53
  /**
76
54
  * List Column Configuration
77
- * Enhanced version aligned with @objectstack/spec ListColumnSchema
55
+ * Canonical definition from @objectstack/spec/ui.
78
56
  */
79
- export interface ListColumn {
80
- /** Field name (snake_case) */
81
- field: string;
82
- /** Display label override */
83
- label?: string;
84
- /** Column width in pixels */
85
- width?: number;
86
- /** Text alignment */
87
- align?: 'left' | 'center' | 'right';
88
- /** Hide column by default */
89
- hidden?: boolean;
90
- /** Allow sorting by this column */
91
- sortable?: boolean;
92
- /** Allow resizing this column */
93
- resizable?: boolean;
94
- /** Allow text wrapping */
95
- wrap?: boolean;
96
- /** Renderer type override (e.g., "currency", "date") */
97
- type?: string;
98
- }
57
+ export type { ListColumn } from '@objectstack/spec/ui';
99
58
 
100
59
  /**
101
60
  * Selection Configuration
102
- * Aligned with @objectstack/spec SelectionConfigSchema
61
+ * Canonical definition from @objectstack/spec/ui.
103
62
  */
104
- export interface SelectionConfig {
105
- /** Selection mode */
106
- type?: 'none' | 'single' | 'multiple';
107
- }
63
+ export type { SelectionConfig } from '@objectstack/spec/ui';
108
64
 
109
65
  /**
110
66
  * Pagination Configuration
111
- * Aligned with @objectstack/spec PaginationConfigSchema
67
+ * Canonical definition from @objectstack/spec/ui.
112
68
  */
113
- export interface PaginationConfig {
114
- /** Number of records per page (default: 25) */
115
- pageSize?: number;
116
- /** Available page size options */
117
- pageSizeOptions?: number[];
118
- }
69
+ export type { PaginationConfig } from '@objectstack/spec/ui';
70
+
71
+ // Import spec types for local use in interfaces below
72
+ import type {
73
+ HttpMethod,
74
+ HttpRequest,
75
+ ViewData,
76
+ ListColumn,
77
+ SelectionConfig,
78
+ PaginationConfig,
79
+ GroupingConfig,
80
+ RowColorConfig,
81
+ } from '@objectstack/spec/ui';
119
82
 
120
83
  /**
121
84
  * Kanban Configuration
122
- * Aligned with @objectstack/spec KanbanConfigSchema
85
+ * Canonical definition from @objectstack/spec/ui (KanbanConfigSchema).
123
86
  */
124
- export interface KanbanConfig {
87
+ export type KanbanConfig = {
125
88
  /** Field to group columns by (usually status/select) */
126
89
  groupByField: string;
127
90
  /** Field to sum at top of column (e.g. amount) */
128
91
  summarizeField?: string;
129
92
  /** Fields to show on cards */
130
93
  columns: string[];
131
- }
94
+ };
132
95
 
133
96
  /**
134
97
  * Calendar Configuration
135
- * Aligned with @objectstack/spec CalendarConfigSchema
98
+ * Canonical definition from @objectstack/spec/ui (CalendarConfigSchema).
136
99
  */
137
- export interface CalendarConfig {
100
+ export type CalendarConfig = {
138
101
  /** Start date field */
139
102
  startDateField: string;
140
103
  /** End date field */
@@ -143,13 +106,13 @@ export interface CalendarConfig {
143
106
  titleField: string;
144
107
  /** Color field */
145
108
  colorField?: string;
146
- }
109
+ };
147
110
 
148
111
  /**
149
112
  * Gantt Configuration
150
- * Aligned with @objectstack/spec GanttConfigSchema
113
+ * Canonical definition from @objectstack/spec/ui (GanttConfigSchema).
151
114
  */
152
- export interface GanttConfig {
115
+ export type GanttConfig = {
153
116
  /** Start date field */
154
117
  startDateField: string;
155
118
  /** End date field */
@@ -162,7 +125,7 @@ export interface GanttConfig {
162
125
  dependenciesField?: string;
163
126
  /** Color field */
164
127
  colorField?: string;
165
- }
128
+ };
166
129
 
167
130
  /**
168
131
  * Sort Configuration
@@ -422,6 +385,20 @@ export interface ObjectGridSchema extends BaseSchema {
422
385
  */
423
386
  editable?: boolean;
424
387
 
388
+ /**
389
+ * Grouping Configuration (Airtable-style)
390
+ * Groups rows by specified fields with collapsible sections.
391
+ * Aligned with @objectstack/spec GroupingConfigSchema.
392
+ */
393
+ grouping?: GroupingConfig;
394
+
395
+ /**
396
+ * Row Color Configuration (Airtable-style)
397
+ * Colors rows based on field values.
398
+ * Aligned with @objectstack/spec RowColorConfigSchema.
399
+ */
400
+ rowColor?: RowColorConfig;
401
+
425
402
  /**
426
403
  * Enable keyboard navigation (Grid mode)
427
404
  * Arrow keys, Tab, Enter for cell navigation
@@ -437,16 +414,96 @@ export interface ObjectGridSchema extends BaseSchema {
437
414
  * @default 0
438
415
  */
439
416
  frozenColumns?: number;
417
+
418
+ /**
419
+ * Navigation configuration for row click behavior.
420
+ * Controls how record detail is displayed when a row is clicked.
421
+ * Aligned with @objectstack/spec ListView.navigation.
422
+ */
423
+ navigation?: ViewNavigationConfig;
424
+
425
+ /**
426
+ * Callback for page-level navigation (used by 'page' mode).
427
+ * Called with recordId and action ('view' | 'edit').
428
+ */
429
+ onNavigate?: (recordId: string | number, action?: string) => void;
430
+ }
431
+
432
+ /**
433
+ * Form Section Configuration
434
+ * Aligns with @objectstack/spec FormSection
435
+ */
436
+ export interface ObjectFormSection {
437
+ /**
438
+ * Section identifier
439
+ */
440
+ name?: string;
441
+
442
+ /**
443
+ * Section label
444
+ */
445
+ label?: string;
446
+
447
+ /**
448
+ * Section description
449
+ */
450
+ description?: string;
451
+
452
+ /**
453
+ * Whether the section can be collapsed
454
+ * @default false
455
+ */
456
+ collapsible?: boolean;
457
+
458
+ /**
459
+ * Whether the section is initially collapsed
460
+ * @default false
461
+ */
462
+ collapsed?: boolean;
463
+
464
+ /**
465
+ * Number of columns for field layout
466
+ * @default 1
467
+ */
468
+ columns?: 1 | 2 | 3 | 4;
469
+
470
+ /**
471
+ * Field names or inline field configurations for this section
472
+ */
473
+ fields: (string | FormField)[];
440
474
  }
441
475
 
442
476
  /**
443
477
  * ObjectForm Schema
444
478
  * A smart form component that generates forms from ObjectQL object schemas.
445
479
  * It automatically creates form fields based on object metadata.
480
+ *
481
+ * Supports multiple form variants aligned with @objectstack/spec FormView:
482
+ * - `simple` – Flat field list (default)
483
+ * - `tabbed` – Fields organized in tabs
484
+ * - `wizard` – Multi-step form with navigation
485
+ * - `split` – Side-by-side panels (reserved)
486
+ * - `drawer` – Slide-out form panel (reserved)
487
+ * - `modal` – Dialog-based form (reserved)
446
488
  */
447
489
  export interface ObjectFormSchema extends BaseSchema {
448
490
  type: 'object-form';
449
491
 
492
+ /**
493
+ * Form variant type.
494
+ * Aligns with @objectstack/spec FormView.type
495
+ *
496
+ * - `simple` – Standard flat form (default)
497
+ * - `tabbed` – Sections as tabs
498
+ * - `wizard` – Multi-step wizard with progress indicator
499
+ * - `split` – Side-by-side panel layout (reserved)
500
+ * - `drawer` – Slide-out form (reserved)
501
+ * - `modal` – Dialog form (reserved)
502
+ *
503
+ * @default 'simple'
504
+ */
505
+ formType?: 'simple' | 'tabbed' | 'wizard' | 'split' | 'drawer' | 'modal';
506
+
450
507
  /**
451
508
  * ObjectQL object name (e.g., 'users', 'accounts', 'contacts')
452
509
  */
@@ -493,7 +550,14 @@ export interface ObjectFormSchema extends BaseSchema {
493
550
  initialData?: Record<string, any>;
494
551
 
495
552
  /**
496
- * Field groups for organized layout
553
+ * Form sections for organized layout.
554
+ * Used by tabbed/wizard/simple forms to group fields.
555
+ * Aligns with @objectstack/spec FormView.sections
556
+ */
557
+ sections?: ObjectFormSection[];
558
+
559
+ /**
560
+ * Field groups for organized layout (legacy, prefer sections)
497
561
  */
498
562
  groups?: Array<{
499
563
  title?: string;
@@ -512,27 +576,56 @@ export interface ObjectFormSchema extends BaseSchema {
512
576
  * - `inline` – compact inline layout, typically used in toolbars
513
577
  * - `grid` – **experimental** grid layout
514
578
  *
515
- * Note: As of the current implementation, the underlying form renderer does not yet
516
- * support a native `grid` layout and will internally treat `layout: "grid"` as
517
- * `layout: "vertical"`. This value is exposed in the schema for forward compatibility,
518
- * and behavior may change once grid support is implemented.
519
- *
520
579
  * @default 'vertical'
521
580
  */
522
581
  layout?: 'vertical' | 'horizontal' | 'inline' | 'grid';
523
582
 
524
583
  /**
525
584
  * Grid columns (for grid layout).
526
- *
527
- * Intended number of columns when using a `grid` layout. Current renderers that do
528
- * not implement true grid support may ignore this value and fall back to a vertical
529
- * layout. When grid layout is supported, this value should control how many form
530
- * fields are placed per row.
531
- *
532
585
  * @default 2
533
586
  */
534
587
  columns?: number;
535
588
 
589
+ /**
590
+ * Default active tab (section name). Only used when formType is 'tabbed'.
591
+ */
592
+ defaultTab?: string;
593
+
594
+ /**
595
+ * Tab position. Only used when formType is 'tabbed'.
596
+ * @default 'top'
597
+ */
598
+ tabPosition?: 'top' | 'bottom' | 'left' | 'right';
599
+
600
+ /**
601
+ * Allow skipping steps. Only used when formType is 'wizard'.
602
+ * @default false
603
+ */
604
+ allowSkip?: boolean;
605
+
606
+ /**
607
+ * Show step indicator. Only used when formType is 'wizard'.
608
+ * @default true
609
+ */
610
+ showStepIndicator?: boolean;
611
+
612
+ /**
613
+ * Text for Next button. Only used when formType is 'wizard'.
614
+ * @default 'Next'
615
+ */
616
+ nextText?: string;
617
+
618
+ /**
619
+ * Text for Previous button. Only used when formType is 'wizard'.
620
+ * @default 'Back'
621
+ */
622
+ prevText?: string;
623
+
624
+ /**
625
+ * Called when wizard step changes. Only used when formType is 'wizard'.
626
+ */
627
+ onStepChange?: (step: number) => void;
628
+
536
629
  /**
537
630
  * Show submit button
538
631
  * @default true
@@ -591,6 +684,66 @@ export interface ObjectFormSchema extends BaseSchema {
591
684
  * Custom CSS class
592
685
  */
593
686
  className?: string;
687
+
688
+ // ─── Split Form Props ──────────────────────────────────
689
+
690
+ /**
691
+ * Split panel direction. Only used when formType is 'split'.
692
+ * @default 'horizontal'
693
+ */
694
+ splitDirection?: 'horizontal' | 'vertical';
695
+
696
+ /**
697
+ * Size of the left/top panel in the split layout (percentage 1-99).
698
+ * Only used when formType is 'split'.
699
+ * @default 50
700
+ */
701
+ splitSize?: number;
702
+
703
+ /**
704
+ * Whether the split panels can be resized. Only used when formType is 'split'.
705
+ * @default true
706
+ */
707
+ splitResizable?: boolean;
708
+
709
+ // ─── Drawer Form Props ─────────────────────────────────
710
+
711
+ /**
712
+ * Whether the drawer is open. Only used when formType is 'drawer'.
713
+ * @default true
714
+ */
715
+ open?: boolean;
716
+
717
+ /**
718
+ * Callback when open state changes. Only used when formType is 'drawer'.
719
+ */
720
+ onOpenChange?: (open: boolean) => void;
721
+
722
+ /**
723
+ * Drawer slide-in side. Only used when formType is 'drawer'.
724
+ * @default 'right'
725
+ */
726
+ drawerSide?: 'top' | 'bottom' | 'left' | 'right';
727
+
728
+ /**
729
+ * Drawer width (CSS value). Only used when formType is 'drawer'.
730
+ * @default '50%'
731
+ */
732
+ drawerWidth?: string;
733
+
734
+ // ─── Modal Form Props ──────────────────────────────────
735
+
736
+ /**
737
+ * Modal dialog size. Only used when formType is 'modal'.
738
+ * @default 'default'
739
+ */
740
+ modalSize?: 'sm' | 'default' | 'lg' | 'xl' | 'full';
741
+
742
+ /**
743
+ * Whether to show a close button in the modal header. Only used when formType is 'modal'.
744
+ * @default true
745
+ */
746
+ modalCloseButton?: boolean;
594
747
  }
595
748
 
596
749
  /**
@@ -625,6 +778,29 @@ export interface ObjectViewSchema extends BaseSchema {
625
778
  */
626
779
  layout?: 'drawer' | 'modal' | 'page';
627
780
 
781
+ /**
782
+ * Default list view type
783
+ * @default 'grid'
784
+ */
785
+ defaultViewType?: 'grid' | 'kanban' | 'gallery' | 'calendar' | 'timeline' | 'gantt' | 'map';
786
+
787
+ /**
788
+ * Named list views (e.g., "All Records", "My Records", "Active").
789
+ * Aligned with @objectstack/spec View.listViews.
790
+ */
791
+ listViews?: Record<string, NamedListView>;
792
+
793
+ /**
794
+ * Default named list view to display
795
+ */
796
+ defaultListView?: string;
797
+
798
+ /**
799
+ * Navigation config for row/item click behavior.
800
+ * Aligned with @objectstack/spec ListView.navigation.
801
+ */
802
+ navigation?: ViewNavigationConfig;
803
+
628
804
  /**
629
805
  * Table/Grid configuration
630
806
  * Inherits from ObjectGridSchema
@@ -637,6 +813,16 @@ export interface ObjectViewSchema extends BaseSchema {
637
813
  */
638
814
  form?: Partial<Omit<ObjectFormSchema, 'type' | 'objectName' | 'mode'>>;
639
815
 
816
+ /**
817
+ * Fields that support text search
818
+ */
819
+ searchableFields?: string[];
820
+
821
+ /**
822
+ * Fields available for the filter UI
823
+ */
824
+ filterableFields?: string[];
825
+
640
826
  /**
641
827
  * Show search box
642
828
  * @default true
@@ -661,6 +847,13 @@ export interface ObjectViewSchema extends BaseSchema {
661
847
  */
662
848
  showRefresh?: boolean;
663
849
 
850
+ /**
851
+ * Show view switcher (for multi-view)
852
+ * When false (default), view type is fixed at creation in ViewDesigner
853
+ * @default false
854
+ */
855
+ showViewSwitcher?: boolean;
856
+
664
857
  /**
665
858
  * Enable/disable built-in operations
666
859
  */
@@ -682,30 +875,163 @@ export interface ObjectViewSchema extends BaseSchema {
682
875
  className?: string;
683
876
  }
684
877
 
878
+ /**
879
+ * Named List View Definition
880
+ * Used in ObjectViewSchema.listViews for named views (e.g., "All", "My Records").
881
+ */
882
+ export interface NamedListView {
883
+ /** View display label */
884
+ label: string;
885
+
886
+ /** View type (grid, kanban, etc.) */
887
+ type?: 'grid' | 'kanban' | 'gallery' | 'calendar' | 'timeline' | 'gantt' | 'map';
888
+
889
+ /** Columns/fields to display */
890
+ columns?: string[];
891
+
892
+ /** Filter conditions */
893
+ filter?: any[];
894
+
895
+ /** Sort configuration */
896
+ sort?: Array<{ field: string; order: 'asc' | 'desc' }>;
897
+
898
+ /** Type-specific options (kanban groupField, calendar startDateField, etc.) */
899
+ options?: Record<string, any>;
900
+ }
901
+
902
+ /**
903
+ * Navigation configuration for row/item click behavior.
904
+ * Aligned with @objectstack/spec ListView.navigation.
905
+ */
906
+ export interface ViewNavigationConfig {
907
+ /**
908
+ * How to open the target view on interaction
909
+ * - page: Full page navigation
910
+ * - drawer: Slide-out panel
911
+ * - modal: Dialog overlay
912
+ * - split: Side-by-side panel
913
+ * - popover: Hover/click preview card
914
+ * - new_window: Open in new browser tab
915
+ * - none: No navigation on click
916
+ * @default 'page'
917
+ */
918
+ mode: 'page' | 'drawer' | 'modal' | 'split' | 'popover' | 'new_window' | 'none';
919
+
920
+ /** Target view/form config name */
921
+ view?: string;
922
+
923
+ /** Prevent default navigation behavior */
924
+ preventNavigation?: boolean;
925
+
926
+ /** Open in new tab (for page/new_window modes) */
927
+ openNewTab?: boolean;
928
+
929
+ /** Width for drawer/modal/split modes (e.g., '600px', '50%') */
930
+ width?: string | number;
931
+ }
932
+
685
933
  /**
686
934
  * Generic View Definition
687
- * Aligned with @objectstack/spec View/ListView
935
+ * Aligned with @objectstack/spec View/ListView.
688
936
  * Defines the data requirement, not just the visual component.
689
937
  */
690
938
  export interface ListViewSchema extends BaseSchema {
691
939
  type: 'list-view';
692
940
 
941
+ /** View name identifier */
942
+ name?: string;
943
+
944
+ /** View display label */
945
+ label?: string;
946
+
693
947
  /** Object Name */
694
948
  objectName: string;
695
949
 
696
- /** View Type (grid, kanban, etc) */
950
+ /** View Type (grid, kanban, etc.) @default 'grid' */
697
951
  viewType?: 'grid' | 'kanban' | 'gallery' | 'calendar' | 'timeline' | 'gantt' | 'map';
698
952
 
699
- /** Fields to fetch/display */
953
+ /** Columns definition (string field names or full column config) */
954
+ columns?: string[] | Array<{
955
+ field: string;
956
+ label?: string;
957
+ width?: number | string;
958
+ align?: 'left' | 'center' | 'right';
959
+ hidden?: boolean;
960
+ sortable?: boolean;
961
+ resizable?: boolean;
962
+ wrap?: boolean;
963
+ type?: string;
964
+ link?: boolean;
965
+ action?: string;
966
+ }>;
967
+
968
+ /** Fields to fetch/display (alias for simple string[] columns) */
700
969
  fields?: string[];
701
970
 
702
971
  /** Filter conditions */
703
- filters?: Array<any[] | string>; // placeholder for FilterCondition
972
+ filters?: Array<any[] | string>;
704
973
 
705
974
  /** Sort order */
706
975
  sort?: Array<{ field: string; order: 'asc' | 'desc' }>;
707
976
 
708
- /** Visual Component overrides */
977
+ /** Fields that support text search */
978
+ searchableFields?: string[];
979
+
980
+ /** Fields available for filter UI */
981
+ filterableFields?: string[];
982
+
983
+ /** Row selection mode */
984
+ selection?: { type: 'none' | 'single' | 'multiple' };
985
+
986
+ /** Pagination configuration */
987
+ pagination?: { pageSize: number; pageSizeOptions?: number[] };
988
+
989
+ /** Allow column resizing @default false */
990
+ resizable?: boolean;
991
+
992
+ /** Show alternating row colors @default false */
993
+ striped?: boolean;
994
+
995
+ /** Show cell borders @default false */
996
+ bordered?: boolean;
997
+
998
+ /** Navigation config for row click behavior */
999
+ navigation?: ViewNavigationConfig;
1000
+
1001
+ /**
1002
+ * Callback for page-level navigation (used by 'page' mode).
1003
+ * Called with recordId and action ('view' | 'edit').
1004
+ */
1005
+ onNavigate?: (recordId: string | number, action?: string) => void;
1006
+
1007
+ /** Kanban-specific configuration */
1008
+ kanban?: {
1009
+ groupField: string;
1010
+ titleField?: string;
1011
+ cardFields?: string[];
1012
+ [key: string]: any;
1013
+ };
1014
+
1015
+ /** Calendar-specific configuration */
1016
+ calendar?: {
1017
+ startDateField: string;
1018
+ endDateField?: string;
1019
+ titleField?: string;
1020
+ defaultView?: 'month' | 'week' | 'day' | 'agenda';
1021
+ [key: string]: any;
1022
+ };
1023
+
1024
+ /** Gantt-specific configuration */
1025
+ gantt?: {
1026
+ startDateField: string;
1027
+ endDateField: string;
1028
+ titleField?: string;
1029
+ progressField?: string;
1030
+ dependenciesField?: string;
1031
+ [key: string]: any;
1032
+ };
1033
+
1034
+ /** Visual Component overrides (legacy, prefer typed configs above) */
709
1035
  options?: Record<string, any>;
710
1036
  }
711
1037