@object-ui/core 17.6.0 → 17.7.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/CHANGELOG.md +6610 -0
- package/README.md +101 -14
- package/dist/actions/ActionEngine.d.ts +4 -2
- package/dist/actions/ActionEngine.js +13 -8
- package/dist/actions/ActionRunner.d.ts +288 -27
- package/dist/actions/ActionRunner.js +443 -63
- package/dist/actions/TransactionManager.d.ts +7 -2
- package/dist/actions/actionKeys.d.ts +9 -7
- package/dist/actions/actionKeys.js +57 -14
- package/dist/actions/actionResponse.js +2 -2
- package/dist/actions/index.d.ts +1 -0
- package/dist/actions/index.js +1 -0
- package/dist/actions/recordDelete.d.ts +118 -0
- package/dist/actions/recordDelete.js +112 -0
- package/dist/adapters/ValueDataSource.d.ts +6 -1
- package/dist/adapters/ValueDataSource.js +1090 -98
- package/dist/adapters/batchTransaction.d.ts +1 -1
- package/dist/adapters/batchTransaction.js +1 -1
- package/dist/builder/schema-builder.d.ts +38 -81
- package/dist/builder/schema-builder.js +33 -152
- package/dist/data-scope/ViewDataProvider.d.ts +1 -1
- package/dist/data-scope/ViewDataProvider.js +21 -1
- package/dist/data-scope/element-data-source.d.ts +261 -7
- package/dist/data-scope/element-data-source.js +342 -52
- package/dist/data-scope/index.d.ts +9 -4
- package/dist/data-scope/index.js +9 -4
- package/dist/evaluator/ExpressionEvaluator.d.ts +86 -0
- package/dist/evaluator/ExpressionEvaluator.js +184 -12
- package/dist/evaluator/FormulaFunctions.d.ts +0 -10
- package/dist/evaluator/FormulaFunctions.js +166 -27
- package/dist/evaluator/declaredPredicate.d.ts +93 -9
- package/dist/evaluator/declaredPredicate.js +117 -16
- package/dist/evaluator/fieldRules.d.ts +88 -4
- package/dist/evaluator/fieldRules.js +203 -31
- package/dist/evaluator/index.d.ts +1 -0
- package/dist/evaluator/index.js +1 -0
- package/dist/evaluator/listConditional.d.ts +103 -34
- package/dist/evaluator/listConditional.js +127 -50
- package/dist/evaluator/optionRules.d.ts +77 -6
- package/dist/evaluator/optionRules.js +87 -10
- package/dist/evaluator/predicateInput.d.ts +15 -4
- package/dist/evaluator/predicateInput.js +35 -2
- package/dist/evaluator/rowPredicateCanon.d.ts +7 -18
- package/dist/evaluator/rowPredicateCanon.js +65 -115
- package/dist/evaluator/subjectPermissions.d.ts +76 -0
- package/dist/evaluator/subjectPermissions.js +44 -0
- package/dist/evaluator/unevaluablePredicate.d.ts +57 -0
- package/dist/evaluator/unevaluablePredicate.js +70 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +80 -2
- package/dist/protocols/index.d.ts +0 -1
- package/dist/protocols/index.js +9 -1
- package/dist/registry/Registry.d.ts +358 -31
- package/dist/registry/Registry.js +263 -11
- package/dist/registry/WidgetRegistry.js +7 -3
- package/dist/registry/html-tier-intrinsics.d.ts +90 -0
- package/dist/registry/html-tier-intrinsics.js +110 -0
- package/dist/registry/public-blocks.d.ts +8 -0
- package/dist/registry/public-blocks.js +57 -0
- package/dist/theme/ThemeEngine.js +1 -1
- package/dist/utils/chart-category-key.d.ts +82 -0
- package/dist/utils/chart-category-key.js +84 -0
- package/dist/utils/chart-measure-key.d.ts +64 -0
- package/dist/utils/chart-measure-key.js +65 -0
- package/dist/utils/chart-presentation.d.ts +95 -112
- package/dist/utils/chart-presentation.js +169 -104
- package/dist/utils/chart-series.d.ts +131 -5
- package/dist/utils/chart-series.js +98 -16
- package/dist/utils/column-sortability.d.ts +157 -0
- package/dist/utils/column-sortability.js +217 -0
- package/dist/utils/dashboard-filters.d.ts +38 -6
- package/dist/utils/dashboard-filters.js +107 -61
- package/dist/utils/dataset-format.d.ts +211 -30
- package/dist/utils/dataset-format.js +389 -46
- package/dist/utils/date-display.d.ts +354 -0
- package/dist/utils/date-display.js +463 -0
- package/dist/utils/date-macros.js +7 -0
- package/dist/utils/drill-down.d.ts +78 -0
- package/dist/utils/drill-down.js +93 -0
- package/dist/utils/emptiness.d.ts +96 -0
- package/dist/utils/emptiness.js +101 -0
- package/dist/utils/expand-fields.d.ts +76 -6
- package/dist/utils/expand-fields.js +76 -6
- package/dist/utils/extract-records.d.ts +65 -5
- package/dist/utils/extract-records.js +65 -8
- package/dist/utils/filter-converter.d.ts +152 -4
- package/dist/utils/filter-converter.js +1092 -22
- package/dist/utils/filter-tokens.d.ts +49 -5
- package/dist/utils/filter-tokens.js +105 -33
- package/dist/utils/grouping-fields.d.ts +61 -0
- package/dist/utils/grouping-fields.js +84 -0
- package/dist/utils/managedBy.d.ts +3 -3
- package/dist/utils/managedBy.js +5 -5
- package/dist/utils/native-date-value.d.ts +48 -0
- package/dist/utils/native-date-value.js +167 -0
- package/dist/utils/non-grid-row-ceiling.d.ts +143 -0
- package/dist/utils/non-grid-row-ceiling.js +141 -0
- package/dist/utils/normalize-list-view.d.ts +121 -1
- package/dist/utils/normalize-list-view.js +186 -6
- package/dist/utils/number-display.d.ts +63 -14
- package/dist/utils/number-display.js +34 -12
- package/dist/utils/object-aggregate-query.d.ts +113 -0
- package/dist/utils/object-aggregate-query.js +50 -0
- package/dist/utils/parent-scope.d.ts +123 -0
- package/dist/utils/parent-scope.js +140 -0
- package/dist/utils/predicate-fields.d.ts +45 -12
- package/dist/utils/predicate-fields.js +137 -12
- package/dist/utils/record-color.d.ts +75 -0
- package/dist/utils/record-color.js +65 -0
- package/dist/utils/record-source.d.ts +298 -0
- package/dist/utils/record-source.js +331 -0
- package/dist/utils/record-title.d.ts +148 -8
- package/dist/utils/record-title.js +220 -26
- package/dist/utils/reference-keys.d.ts +21 -22
- package/dist/utils/reference-keys.js +532 -29
- package/dist/utils/sort-query.d.ts +115 -15
- package/dist/utils/sort-query.js +240 -13
- package/dist/utils/text-comparand.d.ts +92 -0
- package/dist/utils/text-comparand.js +99 -0
- package/dist/utils/without-denied-fields.d.ts +49 -0
- package/dist/utils/without-denied-fields.js +52 -0
- package/dist/validation/index.d.ts +8 -4
- package/dist/validation/index.js +8 -4
- package/dist/validation/schema-validator.d.ts +1 -1
- package/dist/validation/schema-validator.js +200 -82
- package/dist/validation/validators/object-validation-engine.d.ts +1 -1
- package/dist/validation/validators/object-validation-engine.js +14 -3
- package/package.json +8 -9
- package/dist/data-scope/DataScopeManager.d.ts +0 -127
- package/dist/data-scope/DataScopeManager.js +0 -229
- package/dist/protocols/ResponsiveProtocol.d.ts +0 -73
- package/dist/protocols/ResponsiveProtocol.js +0 -158
- package/dist/validation/validation-engine.d.ts +0 -88
- package/dist/validation/validation-engine.js +0 -434
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* Client-side emulation of {@link DataSource.batchTransaction} for adapters
|
|
9
9
|
* that lack a server-side transactional batch endpoint. This is the single,
|
|
10
10
|
* tested home for the non-atomic fallback (ObjectStack objectui #2679 /
|
|
11
|
-
*
|
|
11
|
+
* objectstack-ai/objectstack#1604 / ADR-0034 item 4): components call `runBatchTransaction`
|
|
12
12
|
* unconditionally and never orchestrate cross-object writes themselves.
|
|
13
13
|
*
|
|
14
14
|
* The emulation runs operations sequentially — NOT the old `bulk('create')`
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* Client-side emulation of {@link DataSource.batchTransaction} for adapters
|
|
9
9
|
* that lack a server-side transactional batch endpoint. This is the single,
|
|
10
10
|
* tested home for the non-atomic fallback (ObjectStack objectui #2679 /
|
|
11
|
-
*
|
|
11
|
+
* objectstack-ai/objectstack#1604 / ADR-0034 item 4): components call `runBatchTransaction`
|
|
12
12
|
* unconditionally and never orchestrate cross-object writes themselves.
|
|
13
13
|
*
|
|
14
14
|
* The emulation runs operations sequentially — NOT the old `bulk('create')`
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* @module builder
|
|
15
15
|
* @packageDocumentation
|
|
16
16
|
*/
|
|
17
|
-
import type { BaseSchema, FormSchema, FormField,
|
|
17
|
+
import type { BaseSchema, DeclaredNode, FormSchema, FormField, ButtonSchema, InputSchema, CardSchema, GridSchema, FlexLayoutProps } from '@object-ui/types';
|
|
18
18
|
/**
|
|
19
19
|
* Base builder class
|
|
20
20
|
*/
|
|
@@ -84,68 +84,6 @@ export declare class FormBuilder extends SchemaBuilder<FormSchema> {
|
|
|
84
84
|
*/
|
|
85
85
|
onSubmit(handler: (data: Record<string, any>) => void | Promise<void>): this;
|
|
86
86
|
}
|
|
87
|
-
/**
|
|
88
|
-
* CRUD builder
|
|
89
|
-
*/
|
|
90
|
-
export declare class CRUDBuilder extends SchemaBuilder<CRUDSchema> {
|
|
91
|
-
constructor();
|
|
92
|
-
/**
|
|
93
|
-
* Set resource name
|
|
94
|
-
*/
|
|
95
|
-
resource(resource: string): this;
|
|
96
|
-
/**
|
|
97
|
-
* Set API endpoint
|
|
98
|
-
*/
|
|
99
|
-
api(api: string): this;
|
|
100
|
-
/**
|
|
101
|
-
* Set title
|
|
102
|
-
*/
|
|
103
|
-
title(title: string): this;
|
|
104
|
-
/**
|
|
105
|
-
* Set description
|
|
106
|
-
*/
|
|
107
|
-
description(description: string): this;
|
|
108
|
-
/**
|
|
109
|
-
* Add a column
|
|
110
|
-
*/
|
|
111
|
-
column(column: TableColumn): this;
|
|
112
|
-
/**
|
|
113
|
-
* Set all columns
|
|
114
|
-
*/
|
|
115
|
-
columns(columns: TableColumn[]): this;
|
|
116
|
-
/**
|
|
117
|
-
* Set form fields
|
|
118
|
-
*/
|
|
119
|
-
fields(fields: FormField[]): this;
|
|
120
|
-
/**
|
|
121
|
-
* Enable create operation
|
|
122
|
-
*/
|
|
123
|
-
enableCreate(label?: string): this;
|
|
124
|
-
/**
|
|
125
|
-
* Enable update operation
|
|
126
|
-
*/
|
|
127
|
-
enableUpdate(label?: string): this;
|
|
128
|
-
/**
|
|
129
|
-
* Enable delete operation
|
|
130
|
-
*/
|
|
131
|
-
enableDelete(label?: string, confirmText?: string): this;
|
|
132
|
-
/**
|
|
133
|
-
* Set pagination
|
|
134
|
-
*/
|
|
135
|
-
pagination(pageSize?: number): this;
|
|
136
|
-
/**
|
|
137
|
-
* Enable row selection
|
|
138
|
-
*/
|
|
139
|
-
selectable(mode?: 'single' | 'multiple'): this;
|
|
140
|
-
/**
|
|
141
|
-
* Add a batch action
|
|
142
|
-
*/
|
|
143
|
-
batchAction(action: ActionSchema): this;
|
|
144
|
-
/**
|
|
145
|
-
* Add a row action
|
|
146
|
-
*/
|
|
147
|
-
rowAction(action: ActionSchema): this;
|
|
148
|
-
}
|
|
149
87
|
/**
|
|
150
88
|
* Button builder
|
|
151
89
|
*/
|
|
@@ -220,9 +158,10 @@ export declare class CardBuilder extends SchemaBuilder<CardSchema> {
|
|
|
220
158
|
*/
|
|
221
159
|
description(description: string): this;
|
|
222
160
|
/**
|
|
223
|
-
* Set card content
|
|
161
|
+
* Set card content: a node of a declared type, or a list of them
|
|
162
|
+
* (objectui#11466). Each node is checked against its own type's keys.
|
|
224
163
|
*/
|
|
225
|
-
content(content:
|
|
164
|
+
content(content: DeclaredNode | DeclaredNode[]): this;
|
|
226
165
|
/**
|
|
227
166
|
* Set card variant
|
|
228
167
|
*/
|
|
@@ -238,26 +177,43 @@ export declare class CardBuilder extends SchemaBuilder<CardSchema> {
|
|
|
238
177
|
export declare class GridBuilder extends SchemaBuilder<GridSchema> {
|
|
239
178
|
constructor();
|
|
240
179
|
/**
|
|
241
|
-
* Set number of columns
|
|
180
|
+
* Set number of columns — one of the counts the `grid` renderer maps
|
|
181
|
+
* (objectui#11491); the parameter is the declaration's own bare-count arm,
|
|
182
|
+
* so `tsc` refuses any other number.
|
|
242
183
|
*/
|
|
243
|
-
columns(columns: number): this;
|
|
184
|
+
columns(columns: Extract<NonNullable<GridSchema['columns']>, number>): this;
|
|
244
185
|
/**
|
|
245
|
-
* Set gap
|
|
186
|
+
* Set gap — one of the steps the `grid` renderer maps (objectui#11474); the
|
|
187
|
+
* parameter is the declaration's own set, so `tsc` refuses any other number.
|
|
246
188
|
*/
|
|
247
|
-
gap(gap:
|
|
189
|
+
gap(gap: NonNullable<GridSchema['gap']>): this;
|
|
248
190
|
/**
|
|
249
|
-
* Add a child
|
|
191
|
+
* Add a child: a node of a declared type (`DeclaredNode`, objectui#11466),
|
|
192
|
+
* checked against its own type's keys like a child written inline.
|
|
250
193
|
*/
|
|
251
|
-
child(child:
|
|
194
|
+
child(child: DeclaredNode): this;
|
|
252
195
|
/**
|
|
253
|
-
* Set all children
|
|
196
|
+
* Set all children: nodes of declared types (objectui#11466).
|
|
254
197
|
*/
|
|
255
|
-
children(children:
|
|
198
|
+
children(children: DeclaredNode[]): this;
|
|
256
199
|
}
|
|
257
200
|
/**
|
|
258
201
|
* Flex builder
|
|
202
|
+
*
|
|
203
|
+
* Builds an AUTHORED `flex` node: its props in the `properties` bag
|
|
204
|
+
* (objectui#11276, the maintainer's ruling A on objectui#11300) —
|
|
205
|
+
* `{ type: 'flex', properties: { direction, justify, align, gap, children } }`,
|
|
206
|
+
* the spelling `@objectstack/spec`'s page component declares and
|
|
207
|
+
* `@object-ui/types`' authoring faces accept. A `flex` prop written flat on the
|
|
208
|
+
* node is refused there by name, so the builder never writes one. The base
|
|
209
|
+
* setters (`id`, `className`, `visible`, …) stay on the node. The bag's members
|
|
210
|
+
* are `FlexLayoutProps`; `SchemaRenderer` hoists them onto the node before the
|
|
211
|
+
* `flex` renderer reads them.
|
|
259
212
|
*/
|
|
260
|
-
export declare class FlexBuilder extends SchemaBuilder<
|
|
213
|
+
export declare class FlexBuilder extends SchemaBuilder<BaseSchema & {
|
|
214
|
+
type: 'flex';
|
|
215
|
+
properties: FlexLayoutProps;
|
|
216
|
+
}> {
|
|
261
217
|
constructor();
|
|
262
218
|
/**
|
|
263
219
|
* Set flex direction
|
|
@@ -272,20 +228,21 @@ export declare class FlexBuilder extends SchemaBuilder<FlexSchema> {
|
|
|
272
228
|
*/
|
|
273
229
|
align(align: 'start' | 'end' | 'center' | 'baseline' | 'stretch'): this;
|
|
274
230
|
/**
|
|
275
|
-
* Set gap
|
|
231
|
+
* Set gap — one of the steps the `flex` renderer maps (objectui#11474); the
|
|
232
|
+
* parameter is the declaration's own set, so `tsc` refuses any other number.
|
|
276
233
|
*/
|
|
277
|
-
gap(gap:
|
|
234
|
+
gap(gap: NonNullable<FlexLayoutProps['gap']>): this;
|
|
278
235
|
/**
|
|
279
|
-
* Add a child
|
|
236
|
+
* Add a child: a node of a declared type (`DeclaredNode`, objectui#11466),
|
|
237
|
+
* checked against its own type's keys like a child written inline.
|
|
280
238
|
*/
|
|
281
|
-
child(child:
|
|
239
|
+
child(child: DeclaredNode): this;
|
|
282
240
|
/**
|
|
283
|
-
* Set all children
|
|
241
|
+
* Set all children: nodes of declared types (objectui#11466).
|
|
284
242
|
*/
|
|
285
|
-
children(children:
|
|
243
|
+
children(children: DeclaredNode[]): this;
|
|
286
244
|
}
|
|
287
245
|
export declare const form: () => FormBuilder;
|
|
288
|
-
export declare const crud: () => CRUDBuilder;
|
|
289
246
|
export declare const button: () => ButtonBuilder;
|
|
290
247
|
export declare const input: () => InputBuilder;
|
|
291
248
|
export declare const card: () => CardBuilder;
|
|
@@ -125,141 +125,6 @@ export class FormBuilder extends SchemaBuilder {
|
|
|
125
125
|
return this;
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
|
-
/**
|
|
129
|
-
* CRUD builder
|
|
130
|
-
*/
|
|
131
|
-
export class CRUDBuilder extends SchemaBuilder {
|
|
132
|
-
constructor() {
|
|
133
|
-
super('crud');
|
|
134
|
-
this.schema.columns = [];
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* Set resource name
|
|
138
|
-
*/
|
|
139
|
-
resource(resource) {
|
|
140
|
-
this.schema.resource = resource;
|
|
141
|
-
return this;
|
|
142
|
-
}
|
|
143
|
-
/**
|
|
144
|
-
* Set API endpoint
|
|
145
|
-
*/
|
|
146
|
-
api(api) {
|
|
147
|
-
this.schema.api = api;
|
|
148
|
-
return this;
|
|
149
|
-
}
|
|
150
|
-
/**
|
|
151
|
-
* Set title
|
|
152
|
-
*/
|
|
153
|
-
title(title) {
|
|
154
|
-
this.schema.title = title;
|
|
155
|
-
return this;
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* Set description
|
|
159
|
-
*/
|
|
160
|
-
description(description) {
|
|
161
|
-
this.schema.description = description;
|
|
162
|
-
return this;
|
|
163
|
-
}
|
|
164
|
-
/**
|
|
165
|
-
* Add a column
|
|
166
|
-
*/
|
|
167
|
-
column(column) {
|
|
168
|
-
this.schema.columns = [...(this.schema.columns || []), column];
|
|
169
|
-
return this;
|
|
170
|
-
}
|
|
171
|
-
/**
|
|
172
|
-
* Set all columns
|
|
173
|
-
*/
|
|
174
|
-
columns(columns) {
|
|
175
|
-
this.schema.columns = columns;
|
|
176
|
-
return this;
|
|
177
|
-
}
|
|
178
|
-
/**
|
|
179
|
-
* Set form fields
|
|
180
|
-
*/
|
|
181
|
-
fields(fields) {
|
|
182
|
-
this.schema.fields = fields;
|
|
183
|
-
return this;
|
|
184
|
-
}
|
|
185
|
-
/**
|
|
186
|
-
* Enable create operation
|
|
187
|
-
*/
|
|
188
|
-
enableCreate(label) {
|
|
189
|
-
if (!this.schema.operations)
|
|
190
|
-
this.schema.operations = {};
|
|
191
|
-
this.schema.operations.create = {
|
|
192
|
-
enabled: true,
|
|
193
|
-
label: label || 'Create',
|
|
194
|
-
api: this.schema.api,
|
|
195
|
-
method: 'POST'
|
|
196
|
-
};
|
|
197
|
-
return this;
|
|
198
|
-
}
|
|
199
|
-
/**
|
|
200
|
-
* Enable update operation
|
|
201
|
-
*/
|
|
202
|
-
enableUpdate(label) {
|
|
203
|
-
if (!this.schema.operations)
|
|
204
|
-
this.schema.operations = {};
|
|
205
|
-
this.schema.operations.update = {
|
|
206
|
-
enabled: true,
|
|
207
|
-
label: label || 'Update',
|
|
208
|
-
api: `${this.schema.api}/\${id}`,
|
|
209
|
-
method: 'PUT'
|
|
210
|
-
};
|
|
211
|
-
return this;
|
|
212
|
-
}
|
|
213
|
-
/**
|
|
214
|
-
* Enable delete operation
|
|
215
|
-
*/
|
|
216
|
-
enableDelete(label, confirmText) {
|
|
217
|
-
if (!this.schema.operations)
|
|
218
|
-
this.schema.operations = {};
|
|
219
|
-
this.schema.operations.delete = {
|
|
220
|
-
enabled: true,
|
|
221
|
-
label: label || 'Delete',
|
|
222
|
-
api: `${this.schema.api}/\${id}`,
|
|
223
|
-
method: 'DELETE',
|
|
224
|
-
confirmText: confirmText || 'Are you sure?'
|
|
225
|
-
};
|
|
226
|
-
return this;
|
|
227
|
-
}
|
|
228
|
-
/**
|
|
229
|
-
* Set pagination
|
|
230
|
-
*/
|
|
231
|
-
pagination(pageSize = 20) {
|
|
232
|
-
this.schema.pagination = {
|
|
233
|
-
enabled: true,
|
|
234
|
-
pageSize,
|
|
235
|
-
pageSizeOptions: [10, 20, 50, 100],
|
|
236
|
-
showTotal: true,
|
|
237
|
-
showSizeChanger: true
|
|
238
|
-
};
|
|
239
|
-
return this;
|
|
240
|
-
}
|
|
241
|
-
/**
|
|
242
|
-
* Enable row selection
|
|
243
|
-
*/
|
|
244
|
-
selectable(mode = 'multiple') {
|
|
245
|
-
this.schema.selectable = mode;
|
|
246
|
-
return this;
|
|
247
|
-
}
|
|
248
|
-
/**
|
|
249
|
-
* Add a batch action
|
|
250
|
-
*/
|
|
251
|
-
batchAction(action) {
|
|
252
|
-
this.schema.batchActions = [...(this.schema.batchActions || []), action];
|
|
253
|
-
return this;
|
|
254
|
-
}
|
|
255
|
-
/**
|
|
256
|
-
* Add a row action
|
|
257
|
-
*/
|
|
258
|
-
rowAction(action) {
|
|
259
|
-
this.schema.rowActions = [...(this.schema.rowActions || []), action];
|
|
260
|
-
return this;
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
128
|
/**
|
|
264
129
|
* Button builder
|
|
265
130
|
*/
|
|
@@ -382,7 +247,8 @@ export class CardBuilder extends SchemaBuilder {
|
|
|
382
247
|
return this;
|
|
383
248
|
}
|
|
384
249
|
/**
|
|
385
|
-
* Set card content
|
|
250
|
+
* Set card content: a node of a declared type, or a list of them
|
|
251
|
+
* (objectui#11466). Each node is checked against its own type's keys.
|
|
386
252
|
*/
|
|
387
253
|
content(content) {
|
|
388
254
|
this.schema.content = content;
|
|
@@ -412,21 +278,25 @@ export class GridBuilder extends SchemaBuilder {
|
|
|
412
278
|
this.schema.children = [];
|
|
413
279
|
}
|
|
414
280
|
/**
|
|
415
|
-
* Set number of columns
|
|
281
|
+
* Set number of columns — one of the counts the `grid` renderer maps
|
|
282
|
+
* (objectui#11491); the parameter is the declaration's own bare-count arm,
|
|
283
|
+
* so `tsc` refuses any other number.
|
|
416
284
|
*/
|
|
417
285
|
columns(columns) {
|
|
418
286
|
this.schema.columns = columns;
|
|
419
287
|
return this;
|
|
420
288
|
}
|
|
421
289
|
/**
|
|
422
|
-
* Set gap
|
|
290
|
+
* Set gap — one of the steps the `grid` renderer maps (objectui#11474); the
|
|
291
|
+
* parameter is the declaration's own set, so `tsc` refuses any other number.
|
|
423
292
|
*/
|
|
424
293
|
gap(gap) {
|
|
425
294
|
this.schema.gap = gap;
|
|
426
295
|
return this;
|
|
427
296
|
}
|
|
428
297
|
/**
|
|
429
|
-
* Add a child
|
|
298
|
+
* Add a child: a node of a declared type (`DeclaredNode`, objectui#11466),
|
|
299
|
+
* checked against its own type's keys like a child written inline.
|
|
430
300
|
*/
|
|
431
301
|
child(child) {
|
|
432
302
|
const children = Array.isArray(this.schema.children) ? this.schema.children : [];
|
|
@@ -434,7 +304,7 @@ export class GridBuilder extends SchemaBuilder {
|
|
|
434
304
|
return this;
|
|
435
305
|
}
|
|
436
306
|
/**
|
|
437
|
-
* Set all children
|
|
307
|
+
* Set all children: nodes of declared types (objectui#11466).
|
|
438
308
|
*/
|
|
439
309
|
children(children) {
|
|
440
310
|
this.schema.children = children;
|
|
@@ -443,59 +313,70 @@ export class GridBuilder extends SchemaBuilder {
|
|
|
443
313
|
}
|
|
444
314
|
/**
|
|
445
315
|
* Flex builder
|
|
316
|
+
*
|
|
317
|
+
* Builds an AUTHORED `flex` node: its props in the `properties` bag
|
|
318
|
+
* (objectui#11276, the maintainer's ruling A on objectui#11300) —
|
|
319
|
+
* `{ type: 'flex', properties: { direction, justify, align, gap, children } }`,
|
|
320
|
+
* the spelling `@objectstack/spec`'s page component declares and
|
|
321
|
+
* `@object-ui/types`' authoring faces accept. A `flex` prop written flat on the
|
|
322
|
+
* node is refused there by name, so the builder never writes one. The base
|
|
323
|
+
* setters (`id`, `className`, `visible`, …) stay on the node. The bag's members
|
|
324
|
+
* are `FlexLayoutProps`; `SchemaRenderer` hoists them onto the node before the
|
|
325
|
+
* `flex` renderer reads them.
|
|
446
326
|
*/
|
|
447
327
|
export class FlexBuilder extends SchemaBuilder {
|
|
448
328
|
constructor() {
|
|
449
329
|
super('flex');
|
|
450
|
-
this.schema.
|
|
330
|
+
this.schema.properties = { children: [] };
|
|
451
331
|
}
|
|
452
332
|
/**
|
|
453
333
|
* Set flex direction
|
|
454
334
|
*/
|
|
455
335
|
direction(direction) {
|
|
456
|
-
this.schema.direction = direction;
|
|
336
|
+
this.schema.properties.direction = direction;
|
|
457
337
|
return this;
|
|
458
338
|
}
|
|
459
339
|
/**
|
|
460
340
|
* Set justify content
|
|
461
341
|
*/
|
|
462
342
|
justify(justify) {
|
|
463
|
-
this.schema.justify = justify;
|
|
343
|
+
this.schema.properties.justify = justify;
|
|
464
344
|
return this;
|
|
465
345
|
}
|
|
466
346
|
/**
|
|
467
347
|
* Set align items
|
|
468
348
|
*/
|
|
469
349
|
align(align) {
|
|
470
|
-
this.schema.align = align;
|
|
350
|
+
this.schema.properties.align = align;
|
|
471
351
|
return this;
|
|
472
352
|
}
|
|
473
353
|
/**
|
|
474
|
-
* Set gap
|
|
354
|
+
* Set gap — one of the steps the `flex` renderer maps (objectui#11474); the
|
|
355
|
+
* parameter is the declaration's own set, so `tsc` refuses any other number.
|
|
475
356
|
*/
|
|
476
357
|
gap(gap) {
|
|
477
|
-
this.schema.gap = gap;
|
|
358
|
+
this.schema.properties.gap = gap;
|
|
478
359
|
return this;
|
|
479
360
|
}
|
|
480
361
|
/**
|
|
481
|
-
* Add a child
|
|
362
|
+
* Add a child: a node of a declared type (`DeclaredNode`, objectui#11466),
|
|
363
|
+
* checked against its own type's keys like a child written inline.
|
|
482
364
|
*/
|
|
483
365
|
child(child) {
|
|
484
|
-
const children = Array.isArray(this.schema.children) ? this.schema.children : [];
|
|
485
|
-
this.schema.children = [...children, child];
|
|
366
|
+
const children = Array.isArray(this.schema.properties.children) ? this.schema.properties.children : [];
|
|
367
|
+
this.schema.properties.children = [...children, child];
|
|
486
368
|
return this;
|
|
487
369
|
}
|
|
488
370
|
/**
|
|
489
|
-
* Set all children
|
|
371
|
+
* Set all children: nodes of declared types (objectui#11466).
|
|
490
372
|
*/
|
|
491
373
|
children(children) {
|
|
492
|
-
this.schema.children = children;
|
|
374
|
+
this.schema.properties.children = children;
|
|
493
375
|
return this;
|
|
494
376
|
}
|
|
495
377
|
}
|
|
496
378
|
// Export factory functions
|
|
497
379
|
export const form = () => new FormBuilder();
|
|
498
|
-
export const crud = () => new CRUDBuilder();
|
|
499
380
|
export const button = () => new ButtonBuilder();
|
|
500
381
|
export const input = () => new InputBuilder();
|
|
501
382
|
export const card = () => new CardBuilder();
|
|
@@ -84,7 +84,7 @@ export interface DataFetcher {
|
|
|
84
84
|
*
|
|
85
85
|
* Optional because most fetchers only read records. A fetcher WITHOUT it
|
|
86
86
|
* cannot honour a named view, and {@link ViewDataProvider.resolveElementDataSource}
|
|
87
|
-
* says so in `error` rather than dropping the key — the whole point of #5576
|
|
87
|
+
* says so in `error` rather than dropping the key — the whole point of objectstack-ai/objectstack#5576
|
|
88
88
|
* is that a `view` the runtime cannot apply must never look applied.
|
|
89
89
|
*
|
|
90
90
|
* Either shape stored views come in is accepted: a map keyed by view id, or
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* @module data-scope
|
|
19
19
|
* @packageDocumentation
|
|
20
20
|
*/
|
|
21
|
-
import { collectSavedViews, composeElementDataSource, elementDataSourceViewNotFoundMessage, resolveSavedView, } from './element-data-source.js';
|
|
21
|
+
import { collectSavedViews, composeElementDataSource, elementDataSourceRefusedLimitMessage, elementDataSourceViewNotFoundMessage, resolveSavedView, } from './element-data-source.js';
|
|
22
22
|
/** Extract records array from various common API response shapes */
|
|
23
23
|
function extractRecords(data) {
|
|
24
24
|
if (Array.isArray(data))
|
|
@@ -211,6 +211,26 @@ export class ViewDataProvider {
|
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
213
|
const composed = composeElementDataSource(config, view);
|
|
214
|
+
// The loud half of the row-cap refusal. This method is the consumer that
|
|
215
|
+
// has NO guard of its own — it forwards `limit` straight to
|
|
216
|
+
// `DataFetcher.fetchRecords` — so before the guard a view's `0` / `-10` /
|
|
217
|
+
// `25.5` reached the fetcher verbatim, and nothing anywhere said so. A
|
|
218
|
+
// renderer that receives the same key reports it through its own channel;
|
|
219
|
+
// this path has no renderer, so it reports here, on the same `console.warn`
|
|
220
|
+
// channel those sites use. ⛔ Not an `error`: the refusal is FAIL-SOFT and
|
|
221
|
+
// the records still load, so blanking the result would be a worse outcome
|
|
222
|
+
// than the defect.
|
|
223
|
+
//
|
|
224
|
+
// Both operands of the chain are asked (objectui#10016): a refused binding
|
|
225
|
+
// `limit` is not authored and yields to the view's cap, so it is reported
|
|
226
|
+
// in its own words. The builder is also handed the binding for the VIEW's
|
|
227
|
+
// sentence, because that sentence says the fetch falls back to a default,
|
|
228
|
+
// which is false when the binding's own usable cap is what gets used.
|
|
229
|
+
for (const operand of ['binding', 'view']) {
|
|
230
|
+
const refusedLimit = elementDataSourceRefusedLimitMessage(view, config.view, config.object, config, operand);
|
|
231
|
+
if (refusedLimit)
|
|
232
|
+
console.warn(refusedLimit);
|
|
233
|
+
}
|
|
214
234
|
const fields = Array.isArray(composed.columns)
|
|
215
235
|
? composed.columns.filter((c) => typeof c === 'string' && !!c)
|
|
216
236
|
: undefined;
|