@object-ui/types 0.3.0 → 0.5.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/README.md +19 -11
- package/dist/api-types.d.ts +7 -0
- package/dist/api-types.d.ts.map +1 -1
- package/dist/api-types.js +4 -6
- package/dist/app.d.ts +17 -0
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +4 -3
- package/dist/base.d.ts +7 -0
- package/dist/base.d.ts.map +1 -1
- package/dist/base.js +4 -6
- package/dist/blocks.d.ts +332 -0
- package/dist/blocks.d.ts.map +1 -0
- package/dist/blocks.js +8 -0
- package/dist/complex.d.ts +68 -1
- package/dist/complex.d.ts.map +1 -1
- package/dist/complex.js +4 -5
- package/dist/crud.d.ts +181 -3
- package/dist/crud.d.ts.map +1 -1
- package/dist/crud.js +4 -6
- package/dist/data-display.d.ts +54 -2
- package/dist/data-display.d.ts.map +1 -1
- package/dist/data-display.js +4 -5
- package/dist/data-protocol.d.ts +1268 -0
- package/dist/data-protocol.d.ts.map +1 -0
- package/dist/data-protocol.js +8 -0
- package/dist/data.d.ts +22 -1
- package/dist/data.d.ts.map +1 -1
- package/dist/data.js +4 -6
- package/dist/disclosure.d.ts +70 -1
- package/dist/disclosure.d.ts.map +1 -1
- package/dist/disclosure.js +4 -5
- package/dist/feedback.d.ts +68 -1
- package/dist/feedback.d.ts.map +1 -1
- package/dist/feedback.js +4 -5
- package/dist/field-types.d.ts +728 -0
- package/dist/field-types.d.ts.map +1 -0
- package/dist/field-types.js +8 -0
- package/dist/form.d.ts +123 -1
- package/dist/form.d.ts.map +1 -1
- package/dist/form.js +4 -5
- package/dist/index.d.ts +48 -13
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -37
- package/dist/layout.d.ts +66 -16
- package/dist/layout.d.ts.map +1 -1
- package/dist/layout.js +4 -6
- package/dist/navigation.d.ts +102 -2
- package/dist/navigation.d.ts.map +1 -1
- package/dist/navigation.js +4 -5
- package/dist/objectql.d.ts +491 -54
- package/dist/objectql.d.ts.map +1 -1
- package/dist/objectql.js +4 -6
- package/dist/overlay.d.ts +31 -1
- package/dist/overlay.d.ts.map +1 -1
- package/dist/overlay.js +4 -5
- package/dist/plugin-scope.d.ts +194 -0
- package/dist/plugin-scope.d.ts.map +1 -0
- package/dist/plugin-scope.js +8 -0
- package/dist/registry.d.ts +7 -0
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +7 -0
- package/dist/reports.d.ts +336 -0
- package/dist/reports.d.ts.map +1 -0
- package/dist/reports.js +8 -0
- package/dist/theme.d.ts +289 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/theme.js +8 -0
- package/dist/ui-action.d.ts +175 -0
- package/dist/ui-action.d.ts.map +1 -0
- package/dist/ui-action.js +8 -0
- package/dist/views.d.ts +417 -0
- package/dist/views.d.ts.map +1 -0
- package/dist/views.js +8 -0
- package/dist/zod/app.zod.d.ts +120 -0
- package/dist/zod/app.zod.d.ts.map +1 -0
- package/dist/zod/app.zod.js +60 -0
- package/dist/zod/base.zod.d.ts +202 -0
- package/dist/zod/base.zod.d.ts.map +1 -0
- package/dist/zod/base.zod.js +198 -0
- package/dist/zod/blocks.zod.d.ts +834 -0
- package/dist/zod/blocks.zod.d.ts.map +1 -0
- package/dist/zod/blocks.zod.js +145 -0
- package/dist/zod/complex.zod.d.ts +742 -0
- package/dist/zod/complex.zod.d.ts.map +1 -0
- package/dist/zod/complex.zod.js +233 -0
- package/dist/zod/crud.zod.d.ts +598 -0
- package/dist/zod/crud.zod.d.ts.map +1 -0
- package/dist/zod/crud.zod.js +230 -0
- package/dist/zod/data-display.zod.d.ts +996 -0
- package/dist/zod/data-display.zod.d.ts.map +1 -0
- package/dist/zod/data-display.zod.js +266 -0
- package/dist/zod/disclosure.zod.d.ts +267 -0
- package/dist/zod/disclosure.zod.d.ts.map +1 -0
- package/dist/zod/disclosure.zod.js +84 -0
- package/dist/zod/feedback.zod.d.ts +538 -0
- package/dist/zod/feedback.zod.d.ts.map +1 -0
- package/dist/zod/feedback.zod.js +127 -0
- package/dist/zod/form.zod.d.ts +1308 -0
- package/dist/zod/form.zod.d.ts.map +1 -0
- package/dist/zod/form.zod.js +406 -0
- package/dist/zod/index.zod.d.ts +4985 -0
- package/dist/zod/index.zod.d.ts.map +1 -0
- package/dist/zod/index.zod.js +183 -0
- package/dist/zod/layout.zod.d.ts +1048 -0
- package/dist/zod/layout.zod.d.ts.map +1 -0
- package/dist/zod/layout.zod.js +241 -0
- package/dist/zod/navigation.zod.d.ts +486 -0
- package/dist/zod/navigation.zod.d.ts.map +1 -0
- package/dist/zod/navigation.zod.js +142 -0
- package/dist/zod/objectql.zod.d.ts +1261 -0
- package/dist/zod/objectql.zod.d.ts.map +1 -0
- package/dist/zod/objectql.zod.js +248 -0
- package/dist/zod/overlay.zod.d.ts +691 -0
- package/dist/zod/overlay.zod.d.ts.map +1 -0
- package/dist/zod/overlay.zod.js +179 -0
- package/dist/zod/reports.zod.d.ts +1628 -0
- package/dist/zod/reports.zod.d.ts.map +1 -0
- package/dist/zod/reports.zod.js +152 -0
- package/dist/zod/theme.zod.d.ts +611 -0
- package/dist/zod/theme.zod.d.ts.map +1 -0
- package/dist/zod/theme.zod.js +130 -0
- package/dist/zod/views.zod.d.ts +675 -0
- package/dist/zod/views.zod.d.ts.map +1 -0
- package/dist/zod/views.zod.js +159 -0
- package/package.json +9 -1
- package/src/__tests__/namespace-exports.test.ts +80 -0
- package/src/__tests__/phase2-schemas.test.ts +639 -0
- package/src/api-types.ts +8 -0
- package/src/app.ts +20 -0
- package/src/base.ts +8 -0
- package/src/blocks.ts +405 -0
- package/src/complex.ts +69 -1
- package/src/crud.ts +185 -3
- package/src/data-display.ts +60 -2
- package/src/data-protocol.ts +1679 -0
- package/src/data.ts +21 -1
- package/src/disclosure.ts +74 -1
- package/src/feedback.ts +76 -2
- package/src/field-types.ts +846 -0
- package/src/form.ts +131 -1
- package/src/index.ts +305 -8
- package/src/layout.ts +70 -15
- package/src/navigation.ts +109 -2
- package/src/objectql.ts +563 -59
- package/src/overlay.ts +35 -1
- package/src/plugin-scope.ts +210 -0
- package/src/registry.ts +8 -0
- package/src/reports.ts +408 -0
- package/src/theme.ts +351 -0
- package/src/ui-action.ts +276 -0
- package/src/views.ts +429 -0
- package/src/zod/README.md +329 -0
- package/src/zod/app.zod.ts +72 -0
- package/src/zod/base.zod.ts +229 -0
- package/src/zod/blocks.zod.ts +170 -0
- package/src/zod/complex.zod.ts +258 -0
- package/src/zod/crud.zod.ts +259 -0
- package/src/zod/data-display.zod.ts +290 -0
- package/src/zod/disclosure.zod.ts +92 -0
- package/src/zod/feedback.zod.ts +138 -0
- package/src/zod/form.zod.ts +434 -0
- package/src/zod/index.zod.ts +425 -0
- package/src/zod/layout.zod.ts +262 -0
- package/src/zod/navigation.zod.ts +159 -0
- package/src/zod/objectql.zod.ts +268 -0
- package/src/zod/overlay.zod.ts +196 -0
- package/src/zod/reports.zod.ts +183 -0
- package/src/zod/theme.zod.ts +155 -0
- package/src/zod/views.zod.ts +182 -0
package/dist/views.d.ts
ADDED
|
@@ -0,0 +1,417 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ObjectUI
|
|
3
|
+
* Copyright (c) 2024-present ObjectStack Inc.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the MIT license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* @object-ui/types - View Component Schemas
|
|
10
|
+
*
|
|
11
|
+
* Type definitions for various view components (List, Detail, Grid, Kanban, Calendar).
|
|
12
|
+
* These schemas enable building different data visualization interfaces.
|
|
13
|
+
*
|
|
14
|
+
* @module views
|
|
15
|
+
* @packageDocumentation
|
|
16
|
+
*/
|
|
17
|
+
import type { BaseSchema, SchemaNode } from './base';
|
|
18
|
+
import type { ActionSchema } from './crud';
|
|
19
|
+
import type { TableColumn } from './data-display';
|
|
20
|
+
/**
|
|
21
|
+
* View Type
|
|
22
|
+
*/
|
|
23
|
+
export type ViewType = 'list' | 'detail' | 'grid' | 'kanban' | 'calendar' | 'timeline' | 'map';
|
|
24
|
+
/**
|
|
25
|
+
* Detail View Field Configuration
|
|
26
|
+
*/
|
|
27
|
+
export interface DetailViewField {
|
|
28
|
+
/**
|
|
29
|
+
* Field name/path
|
|
30
|
+
*/
|
|
31
|
+
name: string;
|
|
32
|
+
/**
|
|
33
|
+
* Display label
|
|
34
|
+
*/
|
|
35
|
+
label?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Field type for rendering
|
|
38
|
+
*/
|
|
39
|
+
type?: 'text' | 'image' | 'link' | 'badge' | 'date' | 'datetime' | 'json' | 'html' | 'markdown' | 'custom';
|
|
40
|
+
/**
|
|
41
|
+
* Format string (e.g., date format)
|
|
42
|
+
*/
|
|
43
|
+
format?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Custom renderer
|
|
46
|
+
*/
|
|
47
|
+
render?: SchemaNode;
|
|
48
|
+
/**
|
|
49
|
+
* Field value
|
|
50
|
+
*/
|
|
51
|
+
value?: any;
|
|
52
|
+
/**
|
|
53
|
+
* Whether field is read-only
|
|
54
|
+
*/
|
|
55
|
+
readonly?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Field visibility condition
|
|
58
|
+
*/
|
|
59
|
+
visible?: boolean | string;
|
|
60
|
+
/**
|
|
61
|
+
* Span across columns (for grid layout)
|
|
62
|
+
*/
|
|
63
|
+
span?: number;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Detail View Section/Group
|
|
67
|
+
*/
|
|
68
|
+
export interface DetailViewSection {
|
|
69
|
+
/**
|
|
70
|
+
* Section title
|
|
71
|
+
*/
|
|
72
|
+
title?: string;
|
|
73
|
+
/**
|
|
74
|
+
* Section description
|
|
75
|
+
*/
|
|
76
|
+
description?: string;
|
|
77
|
+
/**
|
|
78
|
+
* Section icon
|
|
79
|
+
*/
|
|
80
|
+
icon?: string;
|
|
81
|
+
/**
|
|
82
|
+
* Fields in this section
|
|
83
|
+
*/
|
|
84
|
+
fields: DetailViewField[];
|
|
85
|
+
/**
|
|
86
|
+
* Collapsible section
|
|
87
|
+
*/
|
|
88
|
+
collapsible?: boolean;
|
|
89
|
+
/**
|
|
90
|
+
* Default collapsed state
|
|
91
|
+
*/
|
|
92
|
+
defaultCollapsed?: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* Grid columns for field layout
|
|
95
|
+
*/
|
|
96
|
+
columns?: number;
|
|
97
|
+
/**
|
|
98
|
+
* Section visibility condition
|
|
99
|
+
*/
|
|
100
|
+
visible?: boolean | string;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Detail View Tab
|
|
104
|
+
*/
|
|
105
|
+
export interface DetailViewTab {
|
|
106
|
+
/**
|
|
107
|
+
* Tab key/identifier
|
|
108
|
+
*/
|
|
109
|
+
key: string;
|
|
110
|
+
/**
|
|
111
|
+
* Tab label
|
|
112
|
+
*/
|
|
113
|
+
label: string;
|
|
114
|
+
/**
|
|
115
|
+
* Tab icon
|
|
116
|
+
*/
|
|
117
|
+
icon?: string;
|
|
118
|
+
/**
|
|
119
|
+
* Tab content
|
|
120
|
+
*/
|
|
121
|
+
content: SchemaNode | SchemaNode[];
|
|
122
|
+
/**
|
|
123
|
+
* Tab visibility condition
|
|
124
|
+
*/
|
|
125
|
+
visible?: boolean | string;
|
|
126
|
+
/**
|
|
127
|
+
* Badge count
|
|
128
|
+
*/
|
|
129
|
+
badge?: string | number;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Detail View Schema - Display detailed information about a single record
|
|
133
|
+
* Enhanced in Phase 2 with better organization and features
|
|
134
|
+
*/
|
|
135
|
+
export interface DetailViewSchema extends BaseSchema {
|
|
136
|
+
type: 'detail-view';
|
|
137
|
+
/**
|
|
138
|
+
* Detail title
|
|
139
|
+
*/
|
|
140
|
+
title?: string;
|
|
141
|
+
/**
|
|
142
|
+
* API endpoint to fetch detail data
|
|
143
|
+
*/
|
|
144
|
+
api?: string;
|
|
145
|
+
/**
|
|
146
|
+
* Resource ID to display
|
|
147
|
+
*/
|
|
148
|
+
resourceId?: string | number;
|
|
149
|
+
/**
|
|
150
|
+
* Object name (for ObjectQL integration)
|
|
151
|
+
*/
|
|
152
|
+
objectName?: string;
|
|
153
|
+
/**
|
|
154
|
+
* Data to display (if not fetching from API)
|
|
155
|
+
*/
|
|
156
|
+
data?: any;
|
|
157
|
+
/**
|
|
158
|
+
* Layout mode
|
|
159
|
+
*/
|
|
160
|
+
layout?: 'vertical' | 'horizontal' | 'grid';
|
|
161
|
+
/**
|
|
162
|
+
* Grid columns (for grid layout)
|
|
163
|
+
*/
|
|
164
|
+
columns?: number;
|
|
165
|
+
/**
|
|
166
|
+
* Field sections for organized display
|
|
167
|
+
*/
|
|
168
|
+
sections?: DetailViewSection[];
|
|
169
|
+
/**
|
|
170
|
+
* Direct fields (without sections)
|
|
171
|
+
*/
|
|
172
|
+
fields?: DetailViewField[];
|
|
173
|
+
/**
|
|
174
|
+
* Actions available in detail view
|
|
175
|
+
*/
|
|
176
|
+
actions?: ActionSchema[];
|
|
177
|
+
/**
|
|
178
|
+
* Tabs for additional content
|
|
179
|
+
*/
|
|
180
|
+
tabs?: DetailViewTab[];
|
|
181
|
+
/**
|
|
182
|
+
* Show back button
|
|
183
|
+
* @default true
|
|
184
|
+
*/
|
|
185
|
+
showBack?: boolean;
|
|
186
|
+
/**
|
|
187
|
+
* Back button URL
|
|
188
|
+
*/
|
|
189
|
+
backUrl?: string;
|
|
190
|
+
/**
|
|
191
|
+
* Custom back action
|
|
192
|
+
*/
|
|
193
|
+
onBack?: string;
|
|
194
|
+
/**
|
|
195
|
+
* Show edit button
|
|
196
|
+
*/
|
|
197
|
+
showEdit?: boolean;
|
|
198
|
+
/**
|
|
199
|
+
* Edit button URL
|
|
200
|
+
*/
|
|
201
|
+
editUrl?: string;
|
|
202
|
+
/**
|
|
203
|
+
* Show delete button
|
|
204
|
+
*/
|
|
205
|
+
showDelete?: boolean;
|
|
206
|
+
/**
|
|
207
|
+
* Delete confirmation message
|
|
208
|
+
*/
|
|
209
|
+
deleteConfirmation?: string;
|
|
210
|
+
/**
|
|
211
|
+
* Whether to show loading state
|
|
212
|
+
* @default true
|
|
213
|
+
*/
|
|
214
|
+
loading?: boolean;
|
|
215
|
+
/**
|
|
216
|
+
* Custom header content
|
|
217
|
+
*/
|
|
218
|
+
header?: SchemaNode;
|
|
219
|
+
/**
|
|
220
|
+
* Custom footer content
|
|
221
|
+
*/
|
|
222
|
+
footer?: SchemaNode;
|
|
223
|
+
/**
|
|
224
|
+
* Related records section
|
|
225
|
+
*/
|
|
226
|
+
related?: Array<{
|
|
227
|
+
/**
|
|
228
|
+
* Relation title
|
|
229
|
+
*/
|
|
230
|
+
title: string;
|
|
231
|
+
/**
|
|
232
|
+
* Relation type
|
|
233
|
+
*/
|
|
234
|
+
type: 'list' | 'grid' | 'table';
|
|
235
|
+
/**
|
|
236
|
+
* API endpoint for related data
|
|
237
|
+
*/
|
|
238
|
+
api?: string;
|
|
239
|
+
/**
|
|
240
|
+
* Static data
|
|
241
|
+
*/
|
|
242
|
+
data?: any[];
|
|
243
|
+
/**
|
|
244
|
+
* Columns for table view
|
|
245
|
+
*/
|
|
246
|
+
columns?: TableColumn[];
|
|
247
|
+
/**
|
|
248
|
+
* Fields for list view
|
|
249
|
+
*/
|
|
250
|
+
fields?: string[];
|
|
251
|
+
}>;
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* View Switcher Schema - Toggle between different view modes
|
|
255
|
+
* New in Phase 2
|
|
256
|
+
*/
|
|
257
|
+
export interface ViewSwitcherSchema extends BaseSchema {
|
|
258
|
+
type: 'view-switcher';
|
|
259
|
+
/**
|
|
260
|
+
* Available view types
|
|
261
|
+
*/
|
|
262
|
+
views: Array<{
|
|
263
|
+
/**
|
|
264
|
+
* View type
|
|
265
|
+
*/
|
|
266
|
+
type: ViewType;
|
|
267
|
+
/**
|
|
268
|
+
* View label
|
|
269
|
+
*/
|
|
270
|
+
label?: string;
|
|
271
|
+
/**
|
|
272
|
+
* View icon
|
|
273
|
+
*/
|
|
274
|
+
icon?: string;
|
|
275
|
+
/**
|
|
276
|
+
* View schema
|
|
277
|
+
*/
|
|
278
|
+
schema?: SchemaNode;
|
|
279
|
+
}>;
|
|
280
|
+
/**
|
|
281
|
+
* Default/active view
|
|
282
|
+
*/
|
|
283
|
+
defaultView?: ViewType;
|
|
284
|
+
/**
|
|
285
|
+
* Current active view
|
|
286
|
+
*/
|
|
287
|
+
activeView?: ViewType;
|
|
288
|
+
/**
|
|
289
|
+
* Switcher variant
|
|
290
|
+
*/
|
|
291
|
+
variant?: 'tabs' | 'buttons' | 'dropdown';
|
|
292
|
+
/**
|
|
293
|
+
* Switcher position
|
|
294
|
+
*/
|
|
295
|
+
position?: 'top' | 'bottom' | 'left' | 'right';
|
|
296
|
+
/**
|
|
297
|
+
* View change callback
|
|
298
|
+
*/
|
|
299
|
+
onViewChange?: string;
|
|
300
|
+
/**
|
|
301
|
+
* Persist view preference
|
|
302
|
+
*/
|
|
303
|
+
persistPreference?: boolean;
|
|
304
|
+
/**
|
|
305
|
+
* Storage key for persisting view
|
|
306
|
+
*/
|
|
307
|
+
storageKey?: string;
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* Filter UI Schema - Enhanced filter interface
|
|
311
|
+
* New in Phase 2
|
|
312
|
+
*/
|
|
313
|
+
export interface FilterUISchema extends BaseSchema {
|
|
314
|
+
type: 'filter-ui';
|
|
315
|
+
/**
|
|
316
|
+
* Available filters
|
|
317
|
+
*/
|
|
318
|
+
filters: Array<{
|
|
319
|
+
/**
|
|
320
|
+
* Filter field
|
|
321
|
+
*/
|
|
322
|
+
field: string;
|
|
323
|
+
/**
|
|
324
|
+
* Filter label
|
|
325
|
+
*/
|
|
326
|
+
label?: string;
|
|
327
|
+
/**
|
|
328
|
+
* Filter type
|
|
329
|
+
*/
|
|
330
|
+
type: 'text' | 'number' | 'select' | 'date' | 'date-range' | 'boolean';
|
|
331
|
+
/**
|
|
332
|
+
* Filter operator
|
|
333
|
+
*/
|
|
334
|
+
operator?: 'equals' | 'contains' | 'startsWith' | 'gt' | 'lt' | 'between' | 'in';
|
|
335
|
+
/**
|
|
336
|
+
* Options for select filter
|
|
337
|
+
*/
|
|
338
|
+
options?: Array<{
|
|
339
|
+
label: string;
|
|
340
|
+
value: any;
|
|
341
|
+
}>;
|
|
342
|
+
/**
|
|
343
|
+
* Placeholder
|
|
344
|
+
*/
|
|
345
|
+
placeholder?: string;
|
|
346
|
+
}>;
|
|
347
|
+
/**
|
|
348
|
+
* Current filter values
|
|
349
|
+
*/
|
|
350
|
+
values?: Record<string, any>;
|
|
351
|
+
/**
|
|
352
|
+
* Filter change callback
|
|
353
|
+
*/
|
|
354
|
+
onChange?: string;
|
|
355
|
+
/**
|
|
356
|
+
* Show clear button
|
|
357
|
+
*/
|
|
358
|
+
showClear?: boolean;
|
|
359
|
+
/**
|
|
360
|
+
* Show apply button
|
|
361
|
+
*/
|
|
362
|
+
showApply?: boolean;
|
|
363
|
+
/**
|
|
364
|
+
* Filter layout
|
|
365
|
+
*/
|
|
366
|
+
layout?: 'inline' | 'popover' | 'drawer';
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* Sort UI Schema - Enhanced sort interface
|
|
370
|
+
* New in Phase 2
|
|
371
|
+
*/
|
|
372
|
+
export interface SortUISchema extends BaseSchema {
|
|
373
|
+
type: 'sort-ui';
|
|
374
|
+
/**
|
|
375
|
+
* Sortable fields
|
|
376
|
+
*/
|
|
377
|
+
fields: Array<{
|
|
378
|
+
/**
|
|
379
|
+
* Field name
|
|
380
|
+
*/
|
|
381
|
+
field: string;
|
|
382
|
+
/**
|
|
383
|
+
* Field label
|
|
384
|
+
*/
|
|
385
|
+
label?: string;
|
|
386
|
+
}>;
|
|
387
|
+
/**
|
|
388
|
+
* Current sort configuration
|
|
389
|
+
*/
|
|
390
|
+
sort?: Array<{
|
|
391
|
+
/**
|
|
392
|
+
* Field to sort by
|
|
393
|
+
*/
|
|
394
|
+
field: string;
|
|
395
|
+
/**
|
|
396
|
+
* Sort direction
|
|
397
|
+
*/
|
|
398
|
+
direction: 'asc' | 'desc';
|
|
399
|
+
}>;
|
|
400
|
+
/**
|
|
401
|
+
* Sort change callback
|
|
402
|
+
*/
|
|
403
|
+
onChange?: string;
|
|
404
|
+
/**
|
|
405
|
+
* Allow multiple sort fields
|
|
406
|
+
*/
|
|
407
|
+
multiple?: boolean;
|
|
408
|
+
/**
|
|
409
|
+
* UI variant
|
|
410
|
+
*/
|
|
411
|
+
variant?: 'dropdown' | 'buttons';
|
|
412
|
+
}
|
|
413
|
+
/**
|
|
414
|
+
* Union type of all view schemas
|
|
415
|
+
*/
|
|
416
|
+
export type ViewComponentSchema = DetailViewSchema | ViewSwitcherSchema | FilterUISchema | SortUISchema;
|
|
417
|
+
//# sourceMappingURL=views.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"views.d.ts","sourceRoot":"","sources":["../src/views.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAC3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAGlD;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,UAAU,GAAG,UAAU,GAAG,KAAK,CAAC;AAE/F;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAA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H,OAAO,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;CAClC;AAED;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAC3B,gBAAgB,GAChB,kBAAkB,GAClB,cAAc,GACd,YAAY,CAAC"}
|
package/dist/views.js
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ObjectUI
|
|
3
|
+
* Copyright (c) 2024-present ObjectStack Inc.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the MIT license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* @object-ui/types/zod - Application Schema Zod Validators
|
|
10
|
+
*
|
|
11
|
+
* Zod validation schemas for top-level application configuration.
|
|
12
|
+
* Following @objectstack/spec UI specification format.
|
|
13
|
+
*
|
|
14
|
+
* @module zod/app
|
|
15
|
+
* @packageDocumentation
|
|
16
|
+
*/
|
|
17
|
+
import { z } from 'zod';
|
|
18
|
+
/**
|
|
19
|
+
* Menu Item Schema - Navigation menu item
|
|
20
|
+
*/
|
|
21
|
+
export declare const MenuItemSchema: z.ZodType<any>;
|
|
22
|
+
/**
|
|
23
|
+
* App Action Schema - Application header/toolbar action
|
|
24
|
+
*/
|
|
25
|
+
export declare const AppActionSchema: z.ZodObject<{
|
|
26
|
+
type: z.ZodEnum<{
|
|
27
|
+
button: "button";
|
|
28
|
+
dropdown: "dropdown";
|
|
29
|
+
user: "user";
|
|
30
|
+
}>;
|
|
31
|
+
label: z.ZodOptional<z.ZodString>;
|
|
32
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
33
|
+
onClick: z.ZodOptional<z.ZodString>;
|
|
34
|
+
avatar: z.ZodOptional<z.ZodString>;
|
|
35
|
+
description: z.ZodOptional<z.ZodString>;
|
|
36
|
+
items: z.ZodOptional<z.ZodArray<z.ZodType<any, unknown, z.core.$ZodTypeInternals<any, unknown>>>>;
|
|
37
|
+
shortcut: z.ZodOptional<z.ZodString>;
|
|
38
|
+
variant: z.ZodOptional<z.ZodEnum<{
|
|
39
|
+
default: "default";
|
|
40
|
+
destructive: "destructive";
|
|
41
|
+
outline: "outline";
|
|
42
|
+
secondary: "secondary";
|
|
43
|
+
ghost: "ghost";
|
|
44
|
+
link: "link";
|
|
45
|
+
}>>;
|
|
46
|
+
size: z.ZodOptional<z.ZodEnum<{
|
|
47
|
+
default: "default";
|
|
48
|
+
sm: "sm";
|
|
49
|
+
lg: "lg";
|
|
50
|
+
icon: "icon";
|
|
51
|
+
}>>;
|
|
52
|
+
}, z.core.$strip>;
|
|
53
|
+
/**
|
|
54
|
+
* App Schema - Top-level application configuration
|
|
55
|
+
*/
|
|
56
|
+
export declare const AppSchema: z.ZodObject<{
|
|
57
|
+
id: z.ZodOptional<z.ZodString>;
|
|
58
|
+
label: z.ZodOptional<z.ZodString>;
|
|
59
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
60
|
+
className: z.ZodOptional<z.ZodString>;
|
|
61
|
+
style: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
62
|
+
data: z.ZodOptional<z.ZodAny>;
|
|
63
|
+
body: z.ZodOptional<z.ZodUnion<readonly [z.ZodType<any, unknown, z.core.$ZodTypeInternals<any, unknown>>, z.ZodArray<z.ZodType<any, unknown, z.core.$ZodTypeInternals<any, unknown>>>]>>;
|
|
64
|
+
children: z.ZodOptional<z.ZodUnion<readonly [z.ZodType<any, unknown, z.core.$ZodTypeInternals<any, unknown>>, z.ZodArray<z.ZodType<any, unknown, z.core.$ZodTypeInternals<any, unknown>>>]>>;
|
|
65
|
+
visible: z.ZodOptional<z.ZodBoolean>;
|
|
66
|
+
visibleOn: z.ZodOptional<z.ZodString>;
|
|
67
|
+
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
68
|
+
hiddenOn: z.ZodOptional<z.ZodString>;
|
|
69
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
70
|
+
disabledOn: z.ZodOptional<z.ZodString>;
|
|
71
|
+
testId: z.ZodOptional<z.ZodString>;
|
|
72
|
+
ariaLabel: z.ZodOptional<z.ZodString>;
|
|
73
|
+
type: z.ZodLiteral<"app">;
|
|
74
|
+
name: z.ZodOptional<z.ZodString>;
|
|
75
|
+
title: z.ZodOptional<z.ZodString>;
|
|
76
|
+
description: z.ZodOptional<z.ZodString>;
|
|
77
|
+
logo: z.ZodOptional<z.ZodString>;
|
|
78
|
+
favicon: z.ZodOptional<z.ZodString>;
|
|
79
|
+
layout: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
80
|
+
sidebar: "sidebar";
|
|
81
|
+
header: "header";
|
|
82
|
+
empty: "empty";
|
|
83
|
+
}>>>;
|
|
84
|
+
menu: z.ZodOptional<z.ZodArray<z.ZodType<any, unknown, z.core.$ZodTypeInternals<any, unknown>>>>;
|
|
85
|
+
actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
86
|
+
type: z.ZodEnum<{
|
|
87
|
+
button: "button";
|
|
88
|
+
dropdown: "dropdown";
|
|
89
|
+
user: "user";
|
|
90
|
+
}>;
|
|
91
|
+
label: z.ZodOptional<z.ZodString>;
|
|
92
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
93
|
+
onClick: z.ZodOptional<z.ZodString>;
|
|
94
|
+
avatar: z.ZodOptional<z.ZodString>;
|
|
95
|
+
description: z.ZodOptional<z.ZodString>;
|
|
96
|
+
items: z.ZodOptional<z.ZodArray<z.ZodType<any, unknown, z.core.$ZodTypeInternals<any, unknown>>>>;
|
|
97
|
+
shortcut: z.ZodOptional<z.ZodString>;
|
|
98
|
+
variant: z.ZodOptional<z.ZodEnum<{
|
|
99
|
+
default: "default";
|
|
100
|
+
destructive: "destructive";
|
|
101
|
+
outline: "outline";
|
|
102
|
+
secondary: "secondary";
|
|
103
|
+
ghost: "ghost";
|
|
104
|
+
link: "link";
|
|
105
|
+
}>>;
|
|
106
|
+
size: z.ZodOptional<z.ZodEnum<{
|
|
107
|
+
default: "default";
|
|
108
|
+
sm: "sm";
|
|
109
|
+
lg: "lg";
|
|
110
|
+
icon: "icon";
|
|
111
|
+
}>>;
|
|
112
|
+
}, z.core.$strip>>>;
|
|
113
|
+
}, z.core.$loose>;
|
|
114
|
+
/**
|
|
115
|
+
* Export type inference helpers
|
|
116
|
+
*/
|
|
117
|
+
export type MenuItemSchemaType = z.infer<typeof MenuItemSchema>;
|
|
118
|
+
export type AppActionSchemaType = z.infer<typeof AppActionSchema>;
|
|
119
|
+
export type AppSchemaType = z.infer<typeof AppSchema>;
|
|
120
|
+
//# sourceMappingURL=app.zod.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.zod.d.ts","sourceRoot":"","sources":["../../src/zod/app.zod.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CASvC,CAAC;AAEJ;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAW1B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAUpB,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAChE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAClE,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ObjectUI
|
|
3
|
+
* Copyright (c) 2024-present ObjectStack Inc.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the MIT license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* @object-ui/types/zod - Application Schema Zod Validators
|
|
10
|
+
*
|
|
11
|
+
* Zod validation schemas for top-level application configuration.
|
|
12
|
+
* Following @objectstack/spec UI specification format.
|
|
13
|
+
*
|
|
14
|
+
* @module zod/app
|
|
15
|
+
* @packageDocumentation
|
|
16
|
+
*/
|
|
17
|
+
import { z } from 'zod';
|
|
18
|
+
import { BaseSchema } from './base.zod.js';
|
|
19
|
+
/**
|
|
20
|
+
* Menu Item Schema - Navigation menu item
|
|
21
|
+
*/
|
|
22
|
+
export const MenuItemSchema = z.lazy(() => z.object({
|
|
23
|
+
type: z.enum(['item', 'group', 'separator']).optional().describe('Item type'),
|
|
24
|
+
label: z.string().optional().describe('Display label'),
|
|
25
|
+
icon: z.string().optional().describe('Icon name (Lucide)'),
|
|
26
|
+
path: z.string().optional().describe('Target path (route)'),
|
|
27
|
+
href: z.string().optional().describe('External link'),
|
|
28
|
+
children: z.array(MenuItemSchema).optional().describe('Child items (submenu)'),
|
|
29
|
+
badge: z.union([z.string(), z.number()]).optional().describe('Badge or count'),
|
|
30
|
+
hidden: z.union([z.boolean(), z.string()]).optional().describe('Visibility condition'),
|
|
31
|
+
}));
|
|
32
|
+
/**
|
|
33
|
+
* App Action Schema - Application header/toolbar action
|
|
34
|
+
*/
|
|
35
|
+
export const AppActionSchema = z.object({
|
|
36
|
+
type: z.enum(['button', 'dropdown', 'user']).describe('Action type'),
|
|
37
|
+
label: z.string().optional().describe('Action label'),
|
|
38
|
+
icon: z.string().optional().describe('Icon name'),
|
|
39
|
+
onClick: z.string().optional().describe('Click handler expression'),
|
|
40
|
+
avatar: z.string().optional().describe('User avatar URL (for type="user")'),
|
|
41
|
+
description: z.string().optional().describe('Additional description (e.g., email for user)'),
|
|
42
|
+
items: z.array(MenuItemSchema).optional().describe('Dropdown menu items (for type="dropdown" or "user")'),
|
|
43
|
+
shortcut: z.string().optional().describe('Keyboard shortcut'),
|
|
44
|
+
variant: z.enum(['default', 'destructive', 'outline', 'secondary', 'ghost', 'link']).optional().describe('Button variant'),
|
|
45
|
+
size: z.enum(['default', 'sm', 'lg', 'icon']).optional().describe('Button size'),
|
|
46
|
+
});
|
|
47
|
+
/**
|
|
48
|
+
* App Schema - Top-level application configuration
|
|
49
|
+
*/
|
|
50
|
+
export const AppSchema = BaseSchema.extend({
|
|
51
|
+
type: z.literal('app'),
|
|
52
|
+
name: z.string().optional().describe('Application name (system ID)'),
|
|
53
|
+
title: z.string().optional().describe('Display title'),
|
|
54
|
+
description: z.string().optional().describe('Application description'),
|
|
55
|
+
logo: z.string().optional().describe('Logo URL or icon name'),
|
|
56
|
+
favicon: z.string().optional().describe('Favicon URL'),
|
|
57
|
+
layout: z.enum(['sidebar', 'header', 'empty']).optional().default('sidebar').describe('Global layout strategy'),
|
|
58
|
+
menu: z.array(MenuItemSchema).optional().describe('Global navigation menu'),
|
|
59
|
+
actions: z.array(AppActionSchema).optional().describe('Global actions (user profile, settings, etc.)'),
|
|
60
|
+
});
|