@object-ui/core 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.
Files changed (90) hide show
  1. package/.turbo/turbo-build.log +4 -0
  2. package/CHANGELOG.md +8 -0
  3. package/dist/actions/ActionRunner.d.ts +40 -0
  4. package/dist/actions/ActionRunner.js +160 -0
  5. package/dist/actions/index.d.ts +8 -0
  6. package/dist/actions/index.js +8 -0
  7. package/dist/adapters/index.d.ts +7 -0
  8. package/dist/adapters/index.js +10 -0
  9. package/dist/builder/schema-builder.d.ts +7 -0
  10. package/dist/builder/schema-builder.js +4 -6
  11. package/dist/evaluator/ExpressionCache.d.ts +101 -0
  12. package/dist/evaluator/ExpressionCache.js +135 -0
  13. package/dist/evaluator/ExpressionContext.d.ts +51 -0
  14. package/dist/evaluator/ExpressionContext.js +110 -0
  15. package/dist/evaluator/ExpressionEvaluator.d.ts +117 -0
  16. package/dist/evaluator/ExpressionEvaluator.js +220 -0
  17. package/dist/evaluator/index.d.ts +10 -0
  18. package/dist/evaluator/index.js +10 -0
  19. package/dist/index.d.ts +17 -4
  20. package/dist/index.js +16 -5
  21. package/dist/query/index.d.ts +6 -0
  22. package/dist/query/index.js +6 -0
  23. package/dist/query/query-ast.d.ts +32 -0
  24. package/dist/query/query-ast.js +268 -0
  25. package/dist/registry/PluginScopeImpl.d.ts +80 -0
  26. package/dist/registry/PluginScopeImpl.js +243 -0
  27. package/dist/registry/PluginSystem.d.ts +66 -0
  28. package/dist/registry/PluginSystem.js +142 -0
  29. package/dist/registry/Registry.d.ts +80 -4
  30. package/dist/registry/Registry.js +119 -7
  31. package/dist/types/index.d.ts +7 -0
  32. package/dist/types/index.js +7 -0
  33. package/dist/utils/filter-converter.d.ts +57 -0
  34. package/dist/utils/filter-converter.js +100 -0
  35. package/dist/validation/index.d.ts +9 -0
  36. package/dist/validation/index.js +9 -0
  37. package/dist/validation/schema-validator.d.ts +7 -0
  38. package/dist/validation/schema-validator.js +4 -6
  39. package/dist/validation/validation-engine.d.ts +70 -0
  40. package/dist/validation/validation-engine.js +363 -0
  41. package/dist/validation/validators/index.d.ts +16 -0
  42. package/dist/validation/validators/index.js +16 -0
  43. package/dist/validation/validators/object-validation-engine.d.ts +118 -0
  44. package/dist/validation/validators/object-validation-engine.js +538 -0
  45. package/package.json +26 -7
  46. package/src/actions/ActionRunner.ts +195 -0
  47. package/src/actions/index.ts +9 -0
  48. package/src/adapters/README.md +180 -0
  49. package/src/adapters/index.ts +10 -0
  50. package/src/builder/schema-builder.ts +8 -0
  51. package/src/evaluator/ExpressionCache.ts +192 -0
  52. package/src/evaluator/ExpressionContext.ts +118 -0
  53. package/src/evaluator/ExpressionEvaluator.ts +267 -0
  54. package/src/evaluator/__tests__/ExpressionCache.test.ts +135 -0
  55. package/src/evaluator/__tests__/ExpressionEvaluator.test.ts +101 -0
  56. package/src/evaluator/index.ts +11 -0
  57. package/src/index.test.ts +8 -0
  58. package/src/index.ts +18 -5
  59. package/src/query/__tests__/query-ast.test.ts +211 -0
  60. package/src/query/__tests__/window-functions.test.ts +275 -0
  61. package/src/query/index.ts +7 -0
  62. package/src/query/query-ast.ts +341 -0
  63. package/src/registry/PluginScopeImpl.ts +259 -0
  64. package/src/registry/PluginSystem.ts +161 -0
  65. package/src/registry/Registry.ts +133 -8
  66. package/src/registry/__tests__/PluginSystem.test.ts +226 -0
  67. package/src/registry/__tests__/Registry.test.ts +293 -0
  68. package/src/registry/__tests__/plugin-scope-integration.test.ts +283 -0
  69. package/src/types/index.ts +8 -0
  70. package/src/utils/__tests__/filter-converter.test.ts +118 -0
  71. package/src/utils/filter-converter.ts +133 -0
  72. package/src/validation/__tests__/object-validation-engine.test.ts +567 -0
  73. package/src/validation/__tests__/validation-engine.test.ts +102 -0
  74. package/src/validation/index.ts +10 -0
  75. package/src/validation/schema-validator.ts +8 -0
  76. package/src/validation/validation-engine.ts +461 -0
  77. package/src/validation/validators/index.ts +25 -0
  78. package/src/validation/validators/object-validation-engine.ts +722 -0
  79. package/tsconfig.tsbuildinfo +1 -1
  80. package/vitest.config.ts +2 -0
  81. package/src/builder/schema-builder.d.ts +0 -287
  82. package/src/builder/schema-builder.js +0 -505
  83. package/src/index.d.ts +0 -4
  84. package/src/index.js +0 -7
  85. package/src/registry/Registry.d.ts +0 -49
  86. package/src/registry/Registry.js +0 -36
  87. package/src/types/index.d.ts +0 -12
  88. package/src/types/index.js +0 -1
  89. package/src/validation/schema-validator.d.ts +0 -87
  90. package/src/validation/schema-validator.js +0 -280
@@ -1,287 +0,0 @@
1
- /**
2
- * @object-ui/core - Schema Builder
3
- *
4
- * Fluent API for building schemas programmatically.
5
- * Provides type-safe builder functions for common schema patterns.
6
- *
7
- * @module builder
8
- * @packageDocumentation
9
- */
10
- import type { BaseSchema, FormSchema, FormField, CRUDSchema, TableColumn, ActionSchema, ButtonSchema, InputSchema, CardSchema, GridSchema, FlexSchema } from '@object-ui/types';
11
- /**
12
- * Base builder class
13
- */
14
- declare class SchemaBuilder<T extends BaseSchema> {
15
- protected schema: any;
16
- constructor(type: string);
17
- /**
18
- * Set the ID
19
- */
20
- id(id: string): this;
21
- /**
22
- * Set the className
23
- */
24
- className(className: string): this;
25
- /**
26
- * Set visibility
27
- */
28
- visible(visible: boolean): this;
29
- /**
30
- * Set conditional visibility
31
- */
32
- visibleOn(expression: string): this;
33
- /**
34
- * Set disabled state
35
- */
36
- disabled(disabled: boolean): this;
37
- /**
38
- * Set test ID
39
- */
40
- testId(testId: string): this;
41
- /**
42
- * Build the final schema
43
- */
44
- build(): T;
45
- }
46
- /**
47
- * Form builder
48
- */
49
- export declare class FormBuilder extends SchemaBuilder<FormSchema> {
50
- constructor();
51
- /**
52
- * Add a field to the form
53
- */
54
- field(field: FormField): this;
55
- /**
56
- * Add multiple fields
57
- */
58
- fields(fields: FormField[]): this;
59
- /**
60
- * Set default values
61
- */
62
- defaultValues(values: Record<string, any>): this;
63
- /**
64
- * Set submit label
65
- */
66
- submitLabel(label: string): this;
67
- /**
68
- * Set form layout
69
- */
70
- layout(layout: 'vertical' | 'horizontal'): this;
71
- /**
72
- * Set number of columns
73
- */
74
- columns(columns: number): this;
75
- /**
76
- * Set submit handler
77
- */
78
- onSubmit(handler: (data: Record<string, any>) => void | Promise<void>): this;
79
- }
80
- /**
81
- * CRUD builder
82
- */
83
- export declare class CRUDBuilder extends SchemaBuilder<CRUDSchema> {
84
- constructor();
85
- /**
86
- * Set resource name
87
- */
88
- resource(resource: string): this;
89
- /**
90
- * Set API endpoint
91
- */
92
- api(api: string): this;
93
- /**
94
- * Set title
95
- */
96
- title(title: string): this;
97
- /**
98
- * Set description
99
- */
100
- description(description: string): this;
101
- /**
102
- * Add a column
103
- */
104
- column(column: TableColumn): this;
105
- /**
106
- * Set all columns
107
- */
108
- columns(columns: TableColumn[]): this;
109
- /**
110
- * Set form fields
111
- */
112
- fields(fields: FormField[]): this;
113
- /**
114
- * Enable create operation
115
- */
116
- enableCreate(label?: string): this;
117
- /**
118
- * Enable update operation
119
- */
120
- enableUpdate(label?: string): this;
121
- /**
122
- * Enable delete operation
123
- */
124
- enableDelete(label?: string, confirmText?: string): this;
125
- /**
126
- * Set pagination
127
- */
128
- pagination(pageSize?: number): this;
129
- /**
130
- * Enable row selection
131
- */
132
- selectable(mode?: 'single' | 'multiple'): this;
133
- /**
134
- * Add a batch action
135
- */
136
- batchAction(action: ActionSchema): this;
137
- /**
138
- * Add a row action
139
- */
140
- rowAction(action: ActionSchema): this;
141
- }
142
- /**
143
- * Button builder
144
- */
145
- export declare class ButtonBuilder extends SchemaBuilder<ButtonSchema> {
146
- constructor();
147
- /**
148
- * Set button label
149
- */
150
- label(label: string): this;
151
- /**
152
- * Set button variant
153
- */
154
- variant(variant: 'default' | 'secondary' | 'destructive' | 'outline' | 'ghost' | 'link'): this;
155
- /**
156
- * Set button size
157
- */
158
- size(size: 'default' | 'sm' | 'lg' | 'icon'): this;
159
- /**
160
- * Set button icon
161
- */
162
- icon(icon: string): this;
163
- /**
164
- * Set click handler
165
- */
166
- onClick(handler: () => void | Promise<void>): this;
167
- /**
168
- * Set loading state
169
- */
170
- loading(loading: boolean): this;
171
- }
172
- /**
173
- * Input builder
174
- */
175
- export declare class InputBuilder extends SchemaBuilder<InputSchema> {
176
- constructor();
177
- /**
178
- * Set field name
179
- */
180
- name(name: string): this;
181
- /**
182
- * Set label
183
- */
184
- label(label: string): this;
185
- /**
186
- * Set placeholder
187
- */
188
- placeholder(placeholder: string): this;
189
- /**
190
- * Set input type
191
- */
192
- inputType(type: 'text' | 'email' | 'password' | 'number' | 'tel' | 'url'): this;
193
- /**
194
- * Mark as required
195
- */
196
- required(required?: boolean): this;
197
- /**
198
- * Set default value
199
- */
200
- defaultValue(value: string | number): this;
201
- }
202
- /**
203
- * Card builder
204
- */
205
- export declare class CardBuilder extends SchemaBuilder<CardSchema> {
206
- constructor();
207
- /**
208
- * Set card title
209
- */
210
- title(title: string): this;
211
- /**
212
- * Set card description
213
- */
214
- description(description: string): this;
215
- /**
216
- * Set card content
217
- */
218
- content(content: BaseSchema | BaseSchema[]): this;
219
- /**
220
- * Set card variant
221
- */
222
- variant(variant: 'default' | 'outline' | 'ghost'): this;
223
- /**
224
- * Make card hoverable
225
- */
226
- hoverable(hoverable?: boolean): this;
227
- }
228
- /**
229
- * Grid builder
230
- */
231
- export declare class GridBuilder extends SchemaBuilder<GridSchema> {
232
- constructor();
233
- /**
234
- * Set number of columns
235
- */
236
- columns(columns: number): this;
237
- /**
238
- * Set gap
239
- */
240
- gap(gap: number): this;
241
- /**
242
- * Add a child
243
- */
244
- child(child: BaseSchema): this;
245
- /**
246
- * Set all children
247
- */
248
- children(children: BaseSchema[]): this;
249
- }
250
- /**
251
- * Flex builder
252
- */
253
- export declare class FlexBuilder extends SchemaBuilder<FlexSchema> {
254
- constructor();
255
- /**
256
- * Set flex direction
257
- */
258
- direction(direction: 'row' | 'col' | 'row-reverse' | 'col-reverse'): this;
259
- /**
260
- * Set justify content
261
- */
262
- justify(justify: 'start' | 'end' | 'center' | 'between' | 'around' | 'evenly'): this;
263
- /**
264
- * Set align items
265
- */
266
- align(align: 'start' | 'end' | 'center' | 'baseline' | 'stretch'): this;
267
- /**
268
- * Set gap
269
- */
270
- gap(gap: number): this;
271
- /**
272
- * Add a child
273
- */
274
- child(child: BaseSchema): this;
275
- /**
276
- * Set all children
277
- */
278
- children(children: BaseSchema[]): this;
279
- }
280
- export declare const form: () => FormBuilder;
281
- export declare const crud: () => CRUDBuilder;
282
- export declare const button: () => ButtonBuilder;
283
- export declare const input: () => InputBuilder;
284
- export declare const card: () => CardBuilder;
285
- export declare const grid: () => GridBuilder;
286
- export declare const flex: () => FlexBuilder;
287
- export {};