@fieldia/core 0.5.0 → 0.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/package.json +1 -1
- package/schema/page.schema.json +430 -17
- package/src/index.d.mts +5 -14
- package/src/index.d.ts +5 -14
- package/src/index.js +4 -28
- package/src/index.js.map +1 -1
- package/src/index.mjs +4 -11
- package/src/index.mjs.map +1 -1
- package/src/lib/format/check-page.d.mts +9 -0
- package/src/lib/format/check-page.d.ts +9 -0
- package/src/lib/format/check-page.js +54 -0
- package/src/lib/format/check-page.js.map +1 -0
- package/src/lib/format/check-page.mjs +51 -0
- package/src/lib/format/check-page.mjs.map +1 -0
- package/src/lib/format/columns.d.mts +3 -0
- package/src/lib/format/columns.d.ts +3 -0
- package/src/lib/format/columns.js +8 -0
- package/src/lib/format/columns.js.map +1 -0
- package/src/lib/format/columns.mjs +5 -0
- package/src/lib/format/columns.mjs.map +1 -0
- package/src/lib/format/field.d.mts +163 -35
- package/src/lib/format/field.d.ts +163 -35
- package/src/lib/format/field.js +36 -38
- package/src/lib/format/field.js.map +1 -1
- package/src/lib/format/field.mjs +25 -29
- package/src/lib/format/field.mjs.map +1 -1
- package/src/lib/format/layout.d.mts +216 -3
- package/src/lib/format/layout.d.ts +216 -3
- package/src/lib/format/layout.js +19 -3
- package/src/lib/format/layout.js.map +1 -1
- package/src/lib/format/layout.mjs +17 -2
- package/src/lib/format/layout.mjs.map +1 -1
- package/src/lib/format/names.d.mts +5 -0
- package/src/lib/format/names.d.ts +5 -0
- package/src/lib/format/names.js +27 -0
- package/src/lib/format/names.js.map +1 -0
- package/src/lib/format/names.mjs +24 -0
- package/src/lib/format/names.mjs.map +1 -0
- package/src/lib/format/page.d.mts +132 -10
- package/src/lib/format/page.d.ts +132 -10
- package/src/lib/format/page.js +6 -3
- package/src/lib/format/page.js.map +1 -1
- package/src/lib/format/page.mjs +4 -2
- package/src/lib/format/page.mjs.map +1 -1
- package/src/lib/format/references.d.mts +35 -0
- package/src/lib/format/references.d.ts +35 -0
- package/src/lib/format/references.js +278 -0
- package/src/lib/format/references.js.map +1 -0
- package/src/lib/format/references.mjs +274 -0
- package/src/lib/format/references.mjs.map +1 -0
- package/src/lib/format/translate.d.mts +8 -0
- package/src/lib/format/translate.d.ts +8 -0
- package/src/lib/format/translate.js +36 -0
- package/src/lib/format/translate.js.map +1 -0
- package/src/lib/format/translate.mjs +33 -0
- package/src/lib/format/translate.mjs.map +1 -0
- package/src/lib/format/validate.d.mts +2 -13
- package/src/lib/format/validate.d.ts +2 -13
- package/src/lib/format/validate.js +2 -258
- package/src/lib/format/validate.js.map +1 -1
- package/src/lib/format/validate.mjs +1 -257
- package/src/lib/format/validate.mjs.map +1 -1
- package/src/lib/format/version.d.mts +2 -0
- package/src/lib/format/version.d.ts +2 -0
- package/src/lib/format/version.js +6 -0
- package/src/lib/format/version.js.map +1 -0
- package/src/lib/format/version.mjs +3 -0
- package/src/lib/format/version.mjs.map +1 -0
- package/src/lib/record/data-source.d.mts +27 -1
- package/src/lib/record/data-source.d.ts +27 -1
- package/src/lib/record/data-source.js +16 -0
- package/src/lib/record/data-source.js.map +1 -1
- package/src/lib/record/data-source.mjs +14 -1
- package/src/lib/record/data-source.mjs.map +1 -1
- package/src/lib/record/filter.d.mts +8 -0
- package/src/lib/record/filter.d.ts +8 -0
- package/src/lib/record/filter.js +66 -0
- package/src/lib/record/filter.js.map +1 -0
- package/src/lib/record/filter.mjs +63 -0
- package/src/lib/record/filter.mjs.map +1 -0
- package/src/lib/record/form.d.mts +15 -1
- package/src/lib/record/form.d.ts +15 -1
- package/src/lib/record/form.js +103 -14
- package/src/lib/record/form.js.map +1 -1
- package/src/lib/record/form.mjs +103 -14
- package/src/lib/record/form.mjs.map +1 -1
- package/src/lib/record/memory-data-source.js +2 -28
- package/src/lib/record/memory-data-source.js.map +1 -1
- package/src/lib/record/memory-data-source.mjs +2 -28
- package/src/lib/record/memory-data-source.mjs.map +1 -1
- package/src/runtime.d.mts +26 -0
- package/src/runtime.d.ts +26 -0
- package/src/runtime.js +44 -0
- package/src/runtime.js.map +1 -0
- package/src/runtime.mjs +16 -0
- package/src/runtime.mjs.map +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"names.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/format/names.ts"],"names":[],"mappings":";AAAA,mHAAmH;;;AAEnH,+EAA+E;AAClE,QAAA,UAAU,GAAG,0BAA0B,CAAC;AAExC,QAAA,WAAW,GAAG;IACzB,MAAM;IACN,MAAM;IACN,MAAM;IACN,SAAS;IACT,OAAO;IACP,UAAU;IACV,SAAS;IACT,MAAM;IACN,UAAU;IACV,WAAW;IACX,QAAQ;IACR,OAAO;IACP,UAAU;IACV,WAAW;IACX,UAAU;IACV,WAAW;IACX,YAAY;IACZ,MAAM;CACE,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** Field names and kinds, apart from the schemas so code that runs a form never carries the validation library. */
|
|
2
|
+
/** A field name: what expressions and layout nodes use to refer to a field. */
|
|
3
|
+
export const FIELD_NAME = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
4
|
+
export const FIELD_TYPES = [
|
|
5
|
+
'char',
|
|
6
|
+
'text',
|
|
7
|
+
'html',
|
|
8
|
+
'integer',
|
|
9
|
+
'float',
|
|
10
|
+
'monetary',
|
|
11
|
+
'boolean',
|
|
12
|
+
'date',
|
|
13
|
+
'datetime',
|
|
14
|
+
'selection',
|
|
15
|
+
'binary',
|
|
16
|
+
'image',
|
|
17
|
+
'many2one',
|
|
18
|
+
'many2many',
|
|
19
|
+
'one2many',
|
|
20
|
+
'reference',
|
|
21
|
+
'properties',
|
|
22
|
+
'json',
|
|
23
|
+
];
|
|
24
|
+
//# sourceMappingURL=names.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"names.mjs","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/format/names.ts"],"names":[],"mappings":"AAAA,mHAAmH;AAEnH,+EAA+E;AAC/E,MAAM,CAAC,MAAM,UAAU,GAAG,0BAA0B,CAAC;AAErD,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,MAAM;IACN,MAAM;IACN,MAAM;IACN,SAAS;IACT,OAAO;IACP,UAAU;IACV,SAAS;IACT,MAAM;IACN,UAAU;IACV,WAAW;IACX,QAAQ;IACR,OAAO;IACP,UAAU;IACV,WAAW;IACX,UAAU;IACV,WAAW;IACX,YAAY;IACZ,MAAM;CACE,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as z from 'zod';
|
|
2
2
|
import { type Fields } from './field.mjs';
|
|
3
3
|
import { type RootLayout } from './layout.mjs';
|
|
4
|
-
|
|
5
|
-
export
|
|
4
|
+
import { FORMAT_VERSION } from './version.mjs';
|
|
5
|
+
export { FORMAT_VERSION } from './version.mjs';
|
|
6
6
|
/**
|
|
7
7
|
* Where a page's values go. A `record` page edits records of a model through
|
|
8
8
|
* the app's data source; a `responses` page collects one new response per
|
|
@@ -23,6 +23,10 @@ export interface Page {
|
|
|
23
23
|
data: PageData;
|
|
24
24
|
fields: Fields;
|
|
25
25
|
layout: RootLayout;
|
|
26
|
+
/** How wide the page goes: narrow 640px, medium 900px, wide 1180px, full the whole width. */
|
|
27
|
+
maxWidth?: 'narrow' | 'medium' | 'wide' | 'full';
|
|
28
|
+
/** Where Save and Discard sit: at the top of the page, or at its foot. A wizard keeps its own. */
|
|
29
|
+
actionsPosition?: 'top' | 'bottom';
|
|
26
30
|
}
|
|
27
31
|
export declare const PageDataSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
28
32
|
kind: z.ZodLiteral<"record">;
|
|
@@ -148,9 +152,10 @@ export declare const PageSchema: z.ZodObject<{
|
|
|
148
152
|
type: z.ZodLiteral<"image">;
|
|
149
153
|
}, z.core.$strict>, z.ZodObject<{
|
|
150
154
|
relation: z.ZodString;
|
|
151
|
-
filter: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
155
|
+
filter: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
152
156
|
field: z.ZodString;
|
|
153
157
|
op: z.ZodEnum<{
|
|
158
|
+
set: "set";
|
|
154
159
|
"=": "=";
|
|
155
160
|
"!=": "!=";
|
|
156
161
|
"<": "<";
|
|
@@ -161,10 +166,18 @@ export declare const PageSchema: z.ZodObject<{
|
|
|
161
166
|
"not in": "not in";
|
|
162
167
|
like: "like";
|
|
163
168
|
ilike: "ilike";
|
|
169
|
+
startswith: "startswith";
|
|
170
|
+
endswith: "endswith";
|
|
171
|
+
notset: "notset";
|
|
172
|
+
between: "between";
|
|
164
173
|
}>;
|
|
165
174
|
value: z.ZodOptional<z.ZodJSONSchema>;
|
|
166
175
|
valueFrom: z.ZodOptional<z.ZodString>;
|
|
167
|
-
}, z.core.$strict
|
|
176
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
177
|
+
any: z.ZodArray<typeof import("./field.mjs").FilterItemSchema>;
|
|
178
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
179
|
+
all: z.ZodArray<typeof import("./field.mjs").FilterItemSchema>;
|
|
180
|
+
}, z.core.$strict>]>>>;
|
|
168
181
|
label: z.ZodString;
|
|
169
182
|
help: z.ZodOptional<z.ZodString>;
|
|
170
183
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -173,9 +186,10 @@ export declare const PageSchema: z.ZodObject<{
|
|
|
173
186
|
type: z.ZodLiteral<"many2one">;
|
|
174
187
|
}, z.core.$strict>, z.ZodObject<{
|
|
175
188
|
relation: z.ZodString;
|
|
176
|
-
filter: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
189
|
+
filter: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
177
190
|
field: z.ZodString;
|
|
178
191
|
op: z.ZodEnum<{
|
|
192
|
+
set: "set";
|
|
179
193
|
"=": "=";
|
|
180
194
|
"!=": "!=";
|
|
181
195
|
"<": "<";
|
|
@@ -186,10 +200,18 @@ export declare const PageSchema: z.ZodObject<{
|
|
|
186
200
|
"not in": "not in";
|
|
187
201
|
like: "like";
|
|
188
202
|
ilike: "ilike";
|
|
203
|
+
startswith: "startswith";
|
|
204
|
+
endswith: "endswith";
|
|
205
|
+
notset: "notset";
|
|
206
|
+
between: "between";
|
|
189
207
|
}>;
|
|
190
208
|
value: z.ZodOptional<z.ZodJSONSchema>;
|
|
191
209
|
valueFrom: z.ZodOptional<z.ZodString>;
|
|
192
|
-
}, z.core.$strict
|
|
210
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
211
|
+
any: z.ZodArray<typeof import("./field.mjs").FilterItemSchema>;
|
|
212
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
213
|
+
all: z.ZodArray<typeof import("./field.mjs").FilterItemSchema>;
|
|
214
|
+
}, z.core.$strict>]>>>;
|
|
193
215
|
label: z.ZodString;
|
|
194
216
|
help: z.ZodOptional<z.ZodString>;
|
|
195
217
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -305,9 +327,10 @@ export declare const PageSchema: z.ZodObject<{
|
|
|
305
327
|
type: z.ZodLiteral<"image">;
|
|
306
328
|
}, z.core.$strict>, z.ZodObject<{
|
|
307
329
|
relation: z.ZodString;
|
|
308
|
-
filter: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
330
|
+
filter: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
309
331
|
field: z.ZodString;
|
|
310
332
|
op: z.ZodEnum<{
|
|
333
|
+
set: "set";
|
|
311
334
|
"=": "=";
|
|
312
335
|
"!=": "!=";
|
|
313
336
|
"<": "<";
|
|
@@ -318,10 +341,18 @@ export declare const PageSchema: z.ZodObject<{
|
|
|
318
341
|
"not in": "not in";
|
|
319
342
|
like: "like";
|
|
320
343
|
ilike: "ilike";
|
|
344
|
+
startswith: "startswith";
|
|
345
|
+
endswith: "endswith";
|
|
346
|
+
notset: "notset";
|
|
347
|
+
between: "between";
|
|
321
348
|
}>;
|
|
322
349
|
value: z.ZodOptional<z.ZodJSONSchema>;
|
|
323
350
|
valueFrom: z.ZodOptional<z.ZodString>;
|
|
324
|
-
}, z.core.$strict
|
|
351
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
352
|
+
any: z.ZodArray<typeof import("./field.mjs").FilterItemSchema>;
|
|
353
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
354
|
+
all: z.ZodArray<typeof import("./field.mjs").FilterItemSchema>;
|
|
355
|
+
}, z.core.$strict>]>>>;
|
|
325
356
|
label: z.ZodString;
|
|
326
357
|
help: z.ZodOptional<z.ZodString>;
|
|
327
358
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -330,9 +361,10 @@ export declare const PageSchema: z.ZodObject<{
|
|
|
330
361
|
type: z.ZodLiteral<"many2one">;
|
|
331
362
|
}, z.core.$strict>, z.ZodObject<{
|
|
332
363
|
relation: z.ZodString;
|
|
333
|
-
filter: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
364
|
+
filter: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
334
365
|
field: z.ZodString;
|
|
335
366
|
op: z.ZodEnum<{
|
|
367
|
+
set: "set";
|
|
336
368
|
"=": "=";
|
|
337
369
|
"!=": "!=";
|
|
338
370
|
"<": "<";
|
|
@@ -343,10 +375,18 @@ export declare const PageSchema: z.ZodObject<{
|
|
|
343
375
|
"not in": "not in";
|
|
344
376
|
like: "like";
|
|
345
377
|
ilike: "ilike";
|
|
378
|
+
startswith: "startswith";
|
|
379
|
+
endswith: "endswith";
|
|
380
|
+
notset: "notset";
|
|
381
|
+
between: "between";
|
|
346
382
|
}>;
|
|
347
383
|
value: z.ZodOptional<z.ZodJSONSchema>;
|
|
348
384
|
valueFrom: z.ZodOptional<z.ZodString>;
|
|
349
|
-
}, z.core.$strict
|
|
385
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
386
|
+
any: z.ZodArray<typeof import("./field.mjs").FilterItemSchema>;
|
|
387
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
388
|
+
all: z.ZodArray<typeof import("./field.mjs").FilterItemSchema>;
|
|
389
|
+
}, z.core.$strict>]>>>;
|
|
350
390
|
label: z.ZodString;
|
|
351
391
|
help: z.ZodOptional<z.ZodString>;
|
|
352
392
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -460,11 +500,63 @@ export declare const PageSchema: z.ZodObject<{
|
|
|
460
500
|
subtitleField: z.ZodOptional<z.ZodString>;
|
|
461
501
|
avatarField: z.ZodOptional<z.ZodString>;
|
|
462
502
|
placeholder: z.ZodOptional<z.ZodString>;
|
|
503
|
+
above: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
504
|
+
type: z.ZodLiteral<"field">;
|
|
505
|
+
id: z.ZodString;
|
|
506
|
+
field: z.ZodString;
|
|
507
|
+
label: z.ZodOptional<z.ZodString>;
|
|
508
|
+
widget: z.ZodOptional<z.ZodString>;
|
|
509
|
+
options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
|
|
510
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
511
|
+
help: z.ZodOptional<z.ZodString>;
|
|
512
|
+
colspan: z.ZodOptional<z.ZodInt>;
|
|
513
|
+
columns: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
514
|
+
totals: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
515
|
+
optionalColumns: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<{
|
|
516
|
+
show: "show";
|
|
517
|
+
hide: "hide";
|
|
518
|
+
}>>>;
|
|
519
|
+
editMode: z.ZodOptional<z.ZodEnum<{
|
|
520
|
+
cell: "cell";
|
|
521
|
+
row: "row";
|
|
522
|
+
}>>;
|
|
523
|
+
invisible: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>;
|
|
524
|
+
readonly: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>;
|
|
525
|
+
required: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>;
|
|
526
|
+
}, z.core.$strict>>>;
|
|
527
|
+
below: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
528
|
+
type: z.ZodLiteral<"field">;
|
|
529
|
+
id: z.ZodString;
|
|
530
|
+
field: z.ZodString;
|
|
531
|
+
label: z.ZodOptional<z.ZodString>;
|
|
532
|
+
widget: z.ZodOptional<z.ZodString>;
|
|
533
|
+
options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
|
|
534
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
535
|
+
help: z.ZodOptional<z.ZodString>;
|
|
536
|
+
colspan: z.ZodOptional<z.ZodInt>;
|
|
537
|
+
columns: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
538
|
+
totals: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
539
|
+
optionalColumns: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<{
|
|
540
|
+
show: "show";
|
|
541
|
+
hide: "hide";
|
|
542
|
+
}>>>;
|
|
543
|
+
editMode: z.ZodOptional<z.ZodEnum<{
|
|
544
|
+
cell: "cell";
|
|
545
|
+
row: "row";
|
|
546
|
+
}>>;
|
|
547
|
+
invisible: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>;
|
|
548
|
+
readonly: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>;
|
|
549
|
+
required: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>;
|
|
550
|
+
}, z.core.$strict>>>;
|
|
463
551
|
}, z.core.$strict>>;
|
|
464
552
|
statusbar: z.ZodOptional<z.ZodObject<{
|
|
465
553
|
field: z.ZodString;
|
|
466
554
|
visibleStates: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
467
555
|
clickable: z.ZodOptional<z.ZodBoolean>;
|
|
556
|
+
position: z.ZodOptional<z.ZodEnum<{
|
|
557
|
+
title: "title";
|
|
558
|
+
header: "header";
|
|
559
|
+
}>>;
|
|
468
560
|
}, z.core.$strict>>;
|
|
469
561
|
buttons: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
470
562
|
type: z.ZodLiteral<"button">;
|
|
@@ -512,6 +604,20 @@ export declare const PageSchema: z.ZodObject<{
|
|
|
512
604
|
danger: "danger";
|
|
513
605
|
muted: "muted";
|
|
514
606
|
}>>;
|
|
607
|
+
dismissible: z.ZodOptional<z.ZodBoolean>;
|
|
608
|
+
invisible: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>;
|
|
609
|
+
}, z.core.$strict>>>;
|
|
610
|
+
badges: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
611
|
+
id: z.ZodString;
|
|
612
|
+
label: z.ZodString;
|
|
613
|
+
tone: z.ZodOptional<z.ZodEnum<{
|
|
614
|
+
success: "success";
|
|
615
|
+
info: "info";
|
|
616
|
+
warning: "warning";
|
|
617
|
+
danger: "danger";
|
|
618
|
+
muted: "muted";
|
|
619
|
+
}>>;
|
|
620
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
515
621
|
invisible: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>;
|
|
516
622
|
}, z.core.$strict>>>;
|
|
517
623
|
children: z.ZodArray<typeof import("./layout.mjs").LayoutNodeSchema>;
|
|
@@ -540,13 +646,29 @@ export declare const PageSchema: z.ZodObject<{
|
|
|
540
646
|
}, z.core.$strict>, z.ZodObject<{
|
|
541
647
|
type: z.ZodLiteral<"wizard">;
|
|
542
648
|
id: z.ZodString;
|
|
649
|
+
clickable: z.ZodOptional<z.ZodBoolean>;
|
|
650
|
+
nextLabel: z.ZodOptional<z.ZodString>;
|
|
651
|
+
backLabel: z.ZodOptional<z.ZodString>;
|
|
652
|
+
finishLabel: z.ZodOptional<z.ZodString>;
|
|
543
653
|
children: z.ZodArray<z.ZodObject<{
|
|
544
654
|
type: z.ZodLiteral<"step">;
|
|
545
655
|
id: z.ZodString;
|
|
546
656
|
label: z.ZodString;
|
|
547
657
|
description: z.ZodOptional<z.ZodString>;
|
|
658
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
659
|
+
optional: z.ZodOptional<z.ZodBoolean>;
|
|
548
660
|
invisible: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>;
|
|
549
661
|
children: z.ZodArray<typeof import("./layout.mjs").LayoutNodeSchema>;
|
|
550
662
|
}, z.core.$strict>>;
|
|
551
663
|
}, z.core.$strict>], "type">;
|
|
664
|
+
maxWidth: z.ZodOptional<z.ZodEnum<{
|
|
665
|
+
wide: "wide";
|
|
666
|
+
medium: "medium";
|
|
667
|
+
narrow: "narrow";
|
|
668
|
+
full: "full";
|
|
669
|
+
}>>;
|
|
670
|
+
actionsPosition: z.ZodOptional<z.ZodEnum<{
|
|
671
|
+
top: "top";
|
|
672
|
+
bottom: "bottom";
|
|
673
|
+
}>>;
|
|
552
674
|
}, z.core.$strict>;
|
package/src/lib/format/page.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as z from 'zod';
|
|
2
2
|
import { type Fields } from './field';
|
|
3
3
|
import { type RootLayout } from './layout';
|
|
4
|
-
|
|
5
|
-
export
|
|
4
|
+
import { FORMAT_VERSION } from './version';
|
|
5
|
+
export { FORMAT_VERSION } from './version';
|
|
6
6
|
/**
|
|
7
7
|
* Where a page's values go. A `record` page edits records of a model through
|
|
8
8
|
* the app's data source; a `responses` page collects one new response per
|
|
@@ -23,6 +23,10 @@ export interface Page {
|
|
|
23
23
|
data: PageData;
|
|
24
24
|
fields: Fields;
|
|
25
25
|
layout: RootLayout;
|
|
26
|
+
/** How wide the page goes: narrow 640px, medium 900px, wide 1180px, full the whole width. */
|
|
27
|
+
maxWidth?: 'narrow' | 'medium' | 'wide' | 'full';
|
|
28
|
+
/** Where Save and Discard sit: at the top of the page, or at its foot. A wizard keeps its own. */
|
|
29
|
+
actionsPosition?: 'top' | 'bottom';
|
|
26
30
|
}
|
|
27
31
|
export declare const PageDataSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
28
32
|
kind: z.ZodLiteral<"record">;
|
|
@@ -148,9 +152,10 @@ export declare const PageSchema: z.ZodObject<{
|
|
|
148
152
|
type: z.ZodLiteral<"image">;
|
|
149
153
|
}, z.z.core.$strict>, z.ZodObject<{
|
|
150
154
|
relation: z.ZodString;
|
|
151
|
-
filter: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
155
|
+
filter: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
152
156
|
field: z.ZodString;
|
|
153
157
|
op: z.ZodEnum<{
|
|
158
|
+
set: "set";
|
|
154
159
|
"=": "=";
|
|
155
160
|
"!=": "!=";
|
|
156
161
|
"<": "<";
|
|
@@ -161,10 +166,18 @@ export declare const PageSchema: z.ZodObject<{
|
|
|
161
166
|
"not in": "not in";
|
|
162
167
|
like: "like";
|
|
163
168
|
ilike: "ilike";
|
|
169
|
+
startswith: "startswith";
|
|
170
|
+
endswith: "endswith";
|
|
171
|
+
notset: "notset";
|
|
172
|
+
between: "between";
|
|
164
173
|
}>;
|
|
165
174
|
value: z.ZodOptional<z.ZodJSONSchema>;
|
|
166
175
|
valueFrom: z.ZodOptional<z.ZodString>;
|
|
167
|
-
}, z.z.core.$strict
|
|
176
|
+
}, z.z.core.$strict>, z.ZodObject<{
|
|
177
|
+
any: z.ZodArray<typeof import("./field").FilterItemSchema>;
|
|
178
|
+
}, z.z.core.$strict>, z.ZodObject<{
|
|
179
|
+
all: z.ZodArray<typeof import("./field").FilterItemSchema>;
|
|
180
|
+
}, z.z.core.$strict>]>>>;
|
|
168
181
|
label: z.ZodString;
|
|
169
182
|
help: z.ZodOptional<z.ZodString>;
|
|
170
183
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -173,9 +186,10 @@ export declare const PageSchema: z.ZodObject<{
|
|
|
173
186
|
type: z.ZodLiteral<"many2one">;
|
|
174
187
|
}, z.z.core.$strict>, z.ZodObject<{
|
|
175
188
|
relation: z.ZodString;
|
|
176
|
-
filter: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
189
|
+
filter: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
177
190
|
field: z.ZodString;
|
|
178
191
|
op: z.ZodEnum<{
|
|
192
|
+
set: "set";
|
|
179
193
|
"=": "=";
|
|
180
194
|
"!=": "!=";
|
|
181
195
|
"<": "<";
|
|
@@ -186,10 +200,18 @@ export declare const PageSchema: z.ZodObject<{
|
|
|
186
200
|
"not in": "not in";
|
|
187
201
|
like: "like";
|
|
188
202
|
ilike: "ilike";
|
|
203
|
+
startswith: "startswith";
|
|
204
|
+
endswith: "endswith";
|
|
205
|
+
notset: "notset";
|
|
206
|
+
between: "between";
|
|
189
207
|
}>;
|
|
190
208
|
value: z.ZodOptional<z.ZodJSONSchema>;
|
|
191
209
|
valueFrom: z.ZodOptional<z.ZodString>;
|
|
192
|
-
}, z.z.core.$strict
|
|
210
|
+
}, z.z.core.$strict>, z.ZodObject<{
|
|
211
|
+
any: z.ZodArray<typeof import("./field").FilterItemSchema>;
|
|
212
|
+
}, z.z.core.$strict>, z.ZodObject<{
|
|
213
|
+
all: z.ZodArray<typeof import("./field").FilterItemSchema>;
|
|
214
|
+
}, z.z.core.$strict>]>>>;
|
|
193
215
|
label: z.ZodString;
|
|
194
216
|
help: z.ZodOptional<z.ZodString>;
|
|
195
217
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -305,9 +327,10 @@ export declare const PageSchema: z.ZodObject<{
|
|
|
305
327
|
type: z.ZodLiteral<"image">;
|
|
306
328
|
}, z.z.core.$strict>, z.ZodObject<{
|
|
307
329
|
relation: z.ZodString;
|
|
308
|
-
filter: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
330
|
+
filter: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
309
331
|
field: z.ZodString;
|
|
310
332
|
op: z.ZodEnum<{
|
|
333
|
+
set: "set";
|
|
311
334
|
"=": "=";
|
|
312
335
|
"!=": "!=";
|
|
313
336
|
"<": "<";
|
|
@@ -318,10 +341,18 @@ export declare const PageSchema: z.ZodObject<{
|
|
|
318
341
|
"not in": "not in";
|
|
319
342
|
like: "like";
|
|
320
343
|
ilike: "ilike";
|
|
344
|
+
startswith: "startswith";
|
|
345
|
+
endswith: "endswith";
|
|
346
|
+
notset: "notset";
|
|
347
|
+
between: "between";
|
|
321
348
|
}>;
|
|
322
349
|
value: z.ZodOptional<z.ZodJSONSchema>;
|
|
323
350
|
valueFrom: z.ZodOptional<z.ZodString>;
|
|
324
|
-
}, z.z.core.$strict
|
|
351
|
+
}, z.z.core.$strict>, z.ZodObject<{
|
|
352
|
+
any: z.ZodArray<typeof import("./field").FilterItemSchema>;
|
|
353
|
+
}, z.z.core.$strict>, z.ZodObject<{
|
|
354
|
+
all: z.ZodArray<typeof import("./field").FilterItemSchema>;
|
|
355
|
+
}, z.z.core.$strict>]>>>;
|
|
325
356
|
label: z.ZodString;
|
|
326
357
|
help: z.ZodOptional<z.ZodString>;
|
|
327
358
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -330,9 +361,10 @@ export declare const PageSchema: z.ZodObject<{
|
|
|
330
361
|
type: z.ZodLiteral<"many2one">;
|
|
331
362
|
}, z.z.core.$strict>, z.ZodObject<{
|
|
332
363
|
relation: z.ZodString;
|
|
333
|
-
filter: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
364
|
+
filter: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
334
365
|
field: z.ZodString;
|
|
335
366
|
op: z.ZodEnum<{
|
|
367
|
+
set: "set";
|
|
336
368
|
"=": "=";
|
|
337
369
|
"!=": "!=";
|
|
338
370
|
"<": "<";
|
|
@@ -343,10 +375,18 @@ export declare const PageSchema: z.ZodObject<{
|
|
|
343
375
|
"not in": "not in";
|
|
344
376
|
like: "like";
|
|
345
377
|
ilike: "ilike";
|
|
378
|
+
startswith: "startswith";
|
|
379
|
+
endswith: "endswith";
|
|
380
|
+
notset: "notset";
|
|
381
|
+
between: "between";
|
|
346
382
|
}>;
|
|
347
383
|
value: z.ZodOptional<z.ZodJSONSchema>;
|
|
348
384
|
valueFrom: z.ZodOptional<z.ZodString>;
|
|
349
|
-
}, z.z.core.$strict
|
|
385
|
+
}, z.z.core.$strict>, z.ZodObject<{
|
|
386
|
+
any: z.ZodArray<typeof import("./field").FilterItemSchema>;
|
|
387
|
+
}, z.z.core.$strict>, z.ZodObject<{
|
|
388
|
+
all: z.ZodArray<typeof import("./field").FilterItemSchema>;
|
|
389
|
+
}, z.z.core.$strict>]>>>;
|
|
350
390
|
label: z.ZodString;
|
|
351
391
|
help: z.ZodOptional<z.ZodString>;
|
|
352
392
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -460,11 +500,63 @@ export declare const PageSchema: z.ZodObject<{
|
|
|
460
500
|
subtitleField: z.ZodOptional<z.ZodString>;
|
|
461
501
|
avatarField: z.ZodOptional<z.ZodString>;
|
|
462
502
|
placeholder: z.ZodOptional<z.ZodString>;
|
|
503
|
+
above: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
504
|
+
type: z.ZodLiteral<"field">;
|
|
505
|
+
id: z.ZodString;
|
|
506
|
+
field: z.ZodString;
|
|
507
|
+
label: z.ZodOptional<z.ZodString>;
|
|
508
|
+
widget: z.ZodOptional<z.ZodString>;
|
|
509
|
+
options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
|
|
510
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
511
|
+
help: z.ZodOptional<z.ZodString>;
|
|
512
|
+
colspan: z.ZodOptional<z.ZodInt>;
|
|
513
|
+
columns: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
514
|
+
totals: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
515
|
+
optionalColumns: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<{
|
|
516
|
+
show: "show";
|
|
517
|
+
hide: "hide";
|
|
518
|
+
}>>>;
|
|
519
|
+
editMode: z.ZodOptional<z.ZodEnum<{
|
|
520
|
+
cell: "cell";
|
|
521
|
+
row: "row";
|
|
522
|
+
}>>;
|
|
523
|
+
invisible: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>;
|
|
524
|
+
readonly: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>;
|
|
525
|
+
required: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>;
|
|
526
|
+
}, z.z.core.$strict>>>;
|
|
527
|
+
below: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
528
|
+
type: z.ZodLiteral<"field">;
|
|
529
|
+
id: z.ZodString;
|
|
530
|
+
field: z.ZodString;
|
|
531
|
+
label: z.ZodOptional<z.ZodString>;
|
|
532
|
+
widget: z.ZodOptional<z.ZodString>;
|
|
533
|
+
options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
|
|
534
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
535
|
+
help: z.ZodOptional<z.ZodString>;
|
|
536
|
+
colspan: z.ZodOptional<z.ZodInt>;
|
|
537
|
+
columns: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
538
|
+
totals: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
539
|
+
optionalColumns: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<{
|
|
540
|
+
show: "show";
|
|
541
|
+
hide: "hide";
|
|
542
|
+
}>>>;
|
|
543
|
+
editMode: z.ZodOptional<z.ZodEnum<{
|
|
544
|
+
cell: "cell";
|
|
545
|
+
row: "row";
|
|
546
|
+
}>>;
|
|
547
|
+
invisible: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>;
|
|
548
|
+
readonly: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>;
|
|
549
|
+
required: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>;
|
|
550
|
+
}, z.z.core.$strict>>>;
|
|
463
551
|
}, z.z.core.$strict>>;
|
|
464
552
|
statusbar: z.ZodOptional<z.ZodObject<{
|
|
465
553
|
field: z.ZodString;
|
|
466
554
|
visibleStates: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
467
555
|
clickable: z.ZodOptional<z.ZodBoolean>;
|
|
556
|
+
position: z.ZodOptional<z.ZodEnum<{
|
|
557
|
+
title: "title";
|
|
558
|
+
header: "header";
|
|
559
|
+
}>>;
|
|
468
560
|
}, z.z.core.$strict>>;
|
|
469
561
|
buttons: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
470
562
|
type: z.ZodLiteral<"button">;
|
|
@@ -512,6 +604,20 @@ export declare const PageSchema: z.ZodObject<{
|
|
|
512
604
|
danger: "danger";
|
|
513
605
|
muted: "muted";
|
|
514
606
|
}>>;
|
|
607
|
+
dismissible: z.ZodOptional<z.ZodBoolean>;
|
|
608
|
+
invisible: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>;
|
|
609
|
+
}, z.z.core.$strict>>>;
|
|
610
|
+
badges: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
611
|
+
id: z.ZodString;
|
|
612
|
+
label: z.ZodString;
|
|
613
|
+
tone: z.ZodOptional<z.ZodEnum<{
|
|
614
|
+
success: "success";
|
|
615
|
+
info: "info";
|
|
616
|
+
warning: "warning";
|
|
617
|
+
danger: "danger";
|
|
618
|
+
muted: "muted";
|
|
619
|
+
}>>;
|
|
620
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
515
621
|
invisible: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>;
|
|
516
622
|
}, z.z.core.$strict>>>;
|
|
517
623
|
children: z.ZodArray<typeof import("./layout").LayoutNodeSchema>;
|
|
@@ -540,13 +646,29 @@ export declare const PageSchema: z.ZodObject<{
|
|
|
540
646
|
}, z.z.core.$strict>, z.ZodObject<{
|
|
541
647
|
type: z.ZodLiteral<"wizard">;
|
|
542
648
|
id: z.ZodString;
|
|
649
|
+
clickable: z.ZodOptional<z.ZodBoolean>;
|
|
650
|
+
nextLabel: z.ZodOptional<z.ZodString>;
|
|
651
|
+
backLabel: z.ZodOptional<z.ZodString>;
|
|
652
|
+
finishLabel: z.ZodOptional<z.ZodString>;
|
|
543
653
|
children: z.ZodArray<z.ZodObject<{
|
|
544
654
|
type: z.ZodLiteral<"step">;
|
|
545
655
|
id: z.ZodString;
|
|
546
656
|
label: z.ZodString;
|
|
547
657
|
description: z.ZodOptional<z.ZodString>;
|
|
658
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
659
|
+
optional: z.ZodOptional<z.ZodBoolean>;
|
|
548
660
|
invisible: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>;
|
|
549
661
|
children: z.ZodArray<typeof import("./layout").LayoutNodeSchema>;
|
|
550
662
|
}, z.z.core.$strict>>;
|
|
551
663
|
}, z.z.core.$strict>], "type">;
|
|
664
|
+
maxWidth: z.ZodOptional<z.ZodEnum<{
|
|
665
|
+
wide: "wide";
|
|
666
|
+
medium: "medium";
|
|
667
|
+
narrow: "narrow";
|
|
668
|
+
full: "full";
|
|
669
|
+
}>>;
|
|
670
|
+
actionsPosition: z.ZodOptional<z.ZodEnum<{
|
|
671
|
+
top: "top";
|
|
672
|
+
bottom: "bottom";
|
|
673
|
+
}>>;
|
|
552
674
|
}, z.z.core.$strict>;
|
package/src/lib/format/page.js
CHANGED
|
@@ -4,21 +4,24 @@ exports.PageSchema = exports.PageDataSchema = exports.FORMAT_VERSION = void 0;
|
|
|
4
4
|
const z = require("zod");
|
|
5
5
|
const field_1 = require("./field");
|
|
6
6
|
const layout_1 = require("./layout");
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
const version_1 = require("./version");
|
|
8
|
+
var version_2 = require("./version");
|
|
9
|
+
Object.defineProperty(exports, "FORMAT_VERSION", { enumerable: true, get: function () { return version_2.FORMAT_VERSION; } });
|
|
9
10
|
exports.PageDataSchema = z.discriminatedUnion('kind', [
|
|
10
11
|
z.strictObject({ kind: z.literal('record'), model: z.string().min(1) }),
|
|
11
12
|
z.strictObject({ kind: z.literal('responses') }),
|
|
12
13
|
]);
|
|
13
14
|
exports.PageSchema = z
|
|
14
15
|
.strictObject({
|
|
15
|
-
fieldia: z.literal(
|
|
16
|
+
fieldia: z.literal(version_1.FORMAT_VERSION),
|
|
16
17
|
id: z.string().regex(/^[A-Za-z0-9][A-Za-z0-9._-]*$/),
|
|
17
18
|
title: z.string().optional(),
|
|
18
19
|
description: z.string().optional(),
|
|
19
20
|
data: exports.PageDataSchema,
|
|
20
21
|
fields: field_1.FieldsSchema,
|
|
21
22
|
layout: layout_1.RootLayoutSchema,
|
|
23
|
+
maxWidth: z.enum(['narrow', 'medium', 'wide', 'full']).optional(),
|
|
24
|
+
actionsPosition: z.enum(['top', 'bottom']).optional(),
|
|
22
25
|
})
|
|
23
26
|
.meta({
|
|
24
27
|
title: 'Fieldia page',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/format/page.ts"],"names":[],"mappings":";;;AAAA,yBAAyB;AACzB,mCAAoD;AACpD,qCAA6D;AAE7D,
|
|
1
|
+
{"version":3,"file":"page.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/format/page.ts"],"names":[],"mappings":";;;AAAA,yBAAyB;AACzB,mCAAoD;AACpD,qCAA6D;AAE7D,uCAA2C;AAC3C,qCAA2C;AAAlC,yGAAA,cAAc,OAAA;AAwBV,QAAA,cAAc,GAAG,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IACzD,CAAC,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;IACvE,CAAC,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC;CACjD,CAAC,CAAC;AAEU,QAAA,UAAU,GAAG,CAAC;KACxB,YAAY,CAAC;IACZ,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,wBAAc,CAAC;IAClC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,8BAA8B,CAAC;IACpD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,IAAI,EAAE,sBAAc;IACpB,MAAM,EAAE,oBAAY;IACpB,MAAM,EAAE,yBAAgB;IACxB,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,QAAQ,EAAE;IACjE,eAAe,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,QAAQ,EAAE;CACtD,CAAC;KACD,IAAI,CAAC;IACJ,KAAK,EAAE,cAAc;IACrB,WAAW,EACT,8HAA8H;CACjI,CAAC,CAAC"}
|
package/src/lib/format/page.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as z from 'zod';
|
|
2
2
|
import { FieldsSchema } from './field.mjs';
|
|
3
3
|
import { RootLayoutSchema } from './layout.mjs';
|
|
4
|
-
|
|
5
|
-
export
|
|
4
|
+
import { FORMAT_VERSION } from './version.mjs';
|
|
5
|
+
export { FORMAT_VERSION } from './version.mjs';
|
|
6
6
|
export const PageDataSchema = z.discriminatedUnion('kind', [
|
|
7
7
|
z.strictObject({ kind: z.literal('record'), model: z.string().min(1) }),
|
|
8
8
|
z.strictObject({ kind: z.literal('responses') }),
|
|
@@ -16,6 +16,8 @@ export const PageSchema = z
|
|
|
16
16
|
data: PageDataSchema,
|
|
17
17
|
fields: FieldsSchema,
|
|
18
18
|
layout: RootLayoutSchema,
|
|
19
|
+
maxWidth: z.enum(['narrow', 'medium', 'wide', 'full']).optional(),
|
|
20
|
+
actionsPosition: z.enum(['top', 'bottom']).optional(),
|
|
19
21
|
})
|
|
20
22
|
.meta({
|
|
21
23
|
title: 'Fieldia page',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page.mjs","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/format/page.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAAE,YAAY,EAAe,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAmB,MAAM,UAAU,CAAC;AAE7D,
|
|
1
|
+
{"version":3,"file":"page.mjs","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/format/page.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAAE,YAAY,EAAe,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAmB,MAAM,UAAU,CAAC;AAE7D,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAwB3C,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IACzD,CAAC,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;IACvE,CAAC,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC;CACjD,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC;KACxB,YAAY,CAAC;IACZ,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC;IAClC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,8BAA8B,CAAC;IACpD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,IAAI,EAAE,cAAc;IACpB,MAAM,EAAE,YAAY;IACpB,MAAM,EAAE,gBAAgB;IACxB,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,QAAQ,EAAE;IACjE,eAAe,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,QAAQ,EAAE;CACtD,CAAC;KACD,IAAI,CAAC;IACJ,KAAK,EAAE,cAAc;IACrB,WAAW,EACT,8HAA8H;CACjI,CAAC,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Page } from './page.mjs';
|
|
2
|
+
export interface PageIssue {
|
|
3
|
+
/** Where the problem is, as a path into the page: `layout.children[0].field`. */
|
|
4
|
+
path: string;
|
|
5
|
+
message: string;
|
|
6
|
+
}
|
|
7
|
+
export type PageValidation = {
|
|
8
|
+
ok: true;
|
|
9
|
+
page: Page;
|
|
10
|
+
} | {
|
|
11
|
+
ok: false;
|
|
12
|
+
issues: PageIssue[];
|
|
13
|
+
};
|
|
14
|
+
/** The second pass of every check: ids unique, every name defined, every condition readable. */
|
|
15
|
+
export declare class ReferenceCheck {
|
|
16
|
+
private readonly page;
|
|
17
|
+
private readonly issues;
|
|
18
|
+
private readonly ids;
|
|
19
|
+
constructor(page: Page);
|
|
20
|
+
run(): PageIssue[];
|
|
21
|
+
private report;
|
|
22
|
+
private claim;
|
|
23
|
+
/** The field a reference names, or a reported issue and undefined. */
|
|
24
|
+
private need;
|
|
25
|
+
/** Every modifier on `owner` must read, and read only fields of this page. */
|
|
26
|
+
private checkModifiers;
|
|
27
|
+
private checkFields;
|
|
28
|
+
private checkLineKinds;
|
|
29
|
+
private walkRoot;
|
|
30
|
+
private walkChildren;
|
|
31
|
+
private walkNode;
|
|
32
|
+
private walkTabs;
|
|
33
|
+
private walkSheet;
|
|
34
|
+
private checkFieldNode;
|
|
35
|
+
}
|