@fieldia/core 0.20.0 → 0.22.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 +116 -1
- package/package.json +1 -1
- package/schema/page.schema.json +173 -1
- package/src/index.d.mts +2 -2
- package/src/index.d.ts +2 -2
- package/src/index.js +3 -1
- package/src/index.js.map +1 -1
- package/src/index.mjs +2 -2
- package/src/index.mjs.map +1 -1
- package/src/lib/expression/parser.js +4 -4
- package/src/lib/expression/parser.js.map +1 -1
- package/src/lib/expression/parser.mjs +5 -5
- package/src/lib/expression/parser.mjs.map +1 -1
- package/src/lib/expression/tokenizer.d.mts +12 -0
- package/src/lib/expression/tokenizer.d.ts +12 -0
- package/src/lib/expression/tokenizer.js +21 -12
- package/src/lib/expression/tokenizer.js.map +1 -1
- package/src/lib/expression/tokenizer.mjs +20 -12
- package/src/lib/expression/tokenizer.mjs.map +1 -1
- package/src/lib/format/check-page.d.mts +3 -2
- package/src/lib/format/check-page.d.ts +3 -2
- package/src/lib/format/check-page.js +9 -4
- package/src/lib/format/check-page.js.map +1 -1
- package/src/lib/format/check-page.mjs +10 -5
- package/src/lib/format/check-page.mjs.map +1 -1
- package/src/lib/format/field.d.mts +101 -0
- package/src/lib/format/field.d.ts +101 -0
- package/src/lib/format/field.js +25 -2
- package/src/lib/format/field.js.map +1 -1
- package/src/lib/format/field.mjs +24 -1
- package/src/lib/format/field.mjs.map +1 -1
- package/src/lib/format/layout.d.mts +142 -17
- package/src/lib/format/layout.d.ts +142 -17
- package/src/lib/format/layout.js +18 -1
- package/src/lib/format/layout.js.map +1 -1
- package/src/lib/format/layout.mjs +17 -0
- package/src/lib/format/layout.mjs.map +1 -1
- package/src/lib/format/layout.types.d.mts +6 -2
- package/src/lib/format/layout.types.d.ts +6 -2
- package/src/lib/format/page.d.mts +87 -10
- package/src/lib/format/page.d.ts +87 -10
- package/src/lib/format/page.js +5 -1
- package/src/lib/format/page.js.map +1 -1
- package/src/lib/format/page.mjs +6 -2
- package/src/lib/format/page.mjs.map +1 -1
- package/src/lib/format/pattern.d.mts +10 -0
- package/src/lib/format/pattern.d.ts +10 -0
- package/src/lib/format/pattern.js +33 -0
- package/src/lib/format/pattern.js.map +1 -0
- package/src/lib/format/pattern.mjs +30 -0
- package/src/lib/format/pattern.mjs.map +1 -0
- package/src/lib/format/references.d.mts +7 -0
- package/src/lib/format/references.d.ts +7 -0
- package/src/lib/format/references.js +54 -0
- package/src/lib/format/references.js.map +1 -1
- package/src/lib/format/references.mjs +54 -0
- package/src/lib/format/references.mjs.map +1 -1
- package/src/lib/format/translate.js +6 -4
- package/src/lib/format/translate.js.map +1 -1
- package/src/lib/format/translate.mjs +6 -4
- package/src/lib/format/translate.mjs.map +1 -1
- package/src/lib/format/upgrade.d.mts +41 -0
- package/src/lib/format/upgrade.d.ts +41 -0
- package/src/lib/format/upgrade.js +41 -0
- package/src/lib/format/upgrade.js.map +1 -0
- package/src/lib/format/upgrade.mjs +37 -0
- package/src/lib/format/upgrade.mjs.map +1 -0
- package/src/lib/format/validate.d.mts +2 -1
- package/src/lib/format/validate.d.ts +2 -1
- package/src/lib/format/validate.js +4 -2
- package/src/lib/format/validate.js.map +1 -1
- package/src/lib/format/validate.mjs +4 -2
- package/src/lib/format/validate.mjs.map +1 -1
- package/src/lib/format/version.d.mts +16 -1
- package/src/lib/format/version.d.ts +16 -1
- package/src/lib/format/version.js +39 -2
- package/src/lib/format/version.js.map +1 -1
- package/src/lib/format/version.mjs +36 -1
- package/src/lib/format/version.mjs.map +1 -1
- package/src/lib/record/check.d.mts +13 -3
- package/src/lib/record/check.d.ts +13 -3
- package/src/lib/record/check.js +87 -17
- package/src/lib/record/check.js.map +1 -1
- package/src/lib/record/check.mjs +85 -17
- package/src/lib/record/check.mjs.map +1 -1
- package/src/lib/record/data-source.d.mts +224 -10
- package/src/lib/record/data-source.d.ts +224 -10
- package/src/lib/record/data-source.js +29 -0
- package/src/lib/record/data-source.js.map +1 -1
- package/src/lib/record/data-source.mjs +25 -0
- package/src/lib/record/data-source.mjs.map +1 -1
- package/src/lib/record/filter.js +14 -2
- package/src/lib/record/filter.js.map +1 -1
- package/src/lib/record/filter.mjs +14 -2
- package/src/lib/record/filter.mjs.map +1 -1
- package/src/lib/record/form.d.mts +186 -3
- package/src/lib/record/form.d.ts +186 -3
- package/src/lib/record/form.js +1036 -57
- package/src/lib/record/form.js.map +1 -1
- package/src/lib/record/form.mjs +1037 -60
- package/src/lib/record/form.mjs.map +1 -1
- package/src/lib/record/input-rules.d.mts +277 -0
- package/src/lib/record/input-rules.d.ts +277 -0
- package/src/lib/record/input-rules.js +724 -0
- package/src/lib/record/input-rules.js.map +1 -0
- package/src/lib/record/input-rules.mjs +705 -0
- package/src/lib/record/input-rules.mjs.map +1 -0
- package/src/lib/record/inputs.d.mts +25 -0
- package/src/lib/record/inputs.d.ts +25 -0
- package/src/lib/record/inputs.js +135 -9
- package/src/lib/record/inputs.js.map +1 -1
- package/src/lib/record/inputs.mjs +131 -9
- package/src/lib/record/inputs.mjs.map +1 -1
- package/src/lib/record/locales/ar.js +23 -2
- package/src/lib/record/locales/ar.js.map +1 -1
- package/src/lib/record/locales/ar.mjs +23 -2
- package/src/lib/record/locales/ar.mjs.map +1 -1
- package/src/lib/record/locales/de.js +23 -2
- package/src/lib/record/locales/de.js.map +1 -1
- package/src/lib/record/locales/de.mjs +23 -2
- package/src/lib/record/locales/de.mjs.map +1 -1
- package/src/lib/record/locales/fr.js +23 -2
- package/src/lib/record/locales/fr.js.map +1 -1
- package/src/lib/record/locales/fr.mjs +23 -2
- package/src/lib/record/locales/fr.mjs.map +1 -1
- package/src/lib/record/memory-data-source.d.mts +40 -3
- package/src/lib/record/memory-data-source.d.ts +40 -3
- package/src/lib/record/memory-data-source.js +171 -23
- package/src/lib/record/memory-data-source.js.map +1 -1
- package/src/lib/record/memory-data-source.mjs +171 -23
- package/src/lib/record/memory-data-source.mjs.map +1 -1
- package/src/lib/record/messages.d.mts +43 -0
- package/src/lib/record/messages.d.ts +43 -0
- package/src/lib/record/messages.js +23 -2
- package/src/lib/record/messages.js.map +1 -1
- package/src/lib/record/messages.mjs +23 -2
- package/src/lib/record/messages.mjs.map +1 -1
- package/src/lib/record/rules.js +3 -1
- package/src/lib/record/rules.js.map +1 -1
- package/src/lib/record/rules.mjs +3 -1
- package/src/lib/record/rules.mjs.map +1 -1
- package/src/lib/record/run.d.mts +53 -9
- package/src/lib/record/run.d.ts +53 -9
- package/src/lib/record/run.js +68 -21
- package/src/lib/record/run.js.map +1 -1
- package/src/lib/record/run.mjs +68 -21
- package/src/lib/record/run.mjs.map +1 -1
- package/src/lib/record/search.d.mts +8 -1
- package/src/lib/record/search.d.ts +8 -1
- package/src/lib/record/search.js +28 -8
- package/src/lib/record/search.js.map +1 -1
- package/src/lib/record/search.mjs +28 -8
- package/src/lib/record/search.mjs.map +1 -1
- package/src/lib/record/structures.d.mts +8 -3
- package/src/lib/record/structures.d.ts +8 -3
- package/src/lib/record/structures.js +51 -7
- package/src/lib/record/structures.js.map +1 -1
- package/src/lib/record/structures.mjs +48 -6
- package/src/lib/record/structures.mjs.map +1 -1
- package/src/lib/record/upload-to.d.mts +50 -0
- package/src/lib/record/upload-to.d.ts +50 -0
- package/src/lib/record/upload-to.js +117 -0
- package/src/lib/record/upload-to.js.map +1 -0
- package/src/lib/record/upload-to.mjs +114 -0
- package/src/lib/record/upload-to.mjs.map +1 -0
- package/src/lib/record/uploads.d.mts +152 -0
- package/src/lib/record/uploads.d.ts +152 -0
- package/src/lib/record/uploads.js +345 -0
- package/src/lib/record/uploads.js.map +1 -0
- package/src/lib/record/uploads.mjs +337 -0
- package/src/lib/record/uploads.mjs.map +1 -0
- package/src/lib/record/values.d.mts +6 -0
- package/src/lib/record/values.d.ts +6 -0
- package/src/lib/record/values.js.map +1 -1
- package/src/lib/record/values.mjs.map +1 -1
- package/src/runtime.d.mts +15 -8
- package/src/runtime.d.ts +15 -8
- package/src/runtime.js +48 -1
- package/src/runtime.js.map +1 -1
- package/src/runtime.mjs +12 -5
- package/src/runtime.mjs.map +1 -1
package/src/lib/format/page.d.ts
CHANGED
|
@@ -6,7 +6,8 @@ import { type PartsLook } from './part-look';
|
|
|
6
6
|
import { type Theme } from './themes';
|
|
7
7
|
export { THEMES, type Theme } from './themes';
|
|
8
8
|
import { type Skin } from './themes';
|
|
9
|
-
import {
|
|
9
|
+
import { type FormatVersion } from './version';
|
|
10
|
+
import type { DateOrder } from '../record/input-rules';
|
|
10
11
|
export { FORMAT_VERSION } from './version';
|
|
11
12
|
/**
|
|
12
13
|
* Where a page's values go. A `record` page edits records of a model through
|
|
@@ -72,10 +73,19 @@ export interface PageLook {
|
|
|
72
73
|
* own skin when left out (see `SKINS`).
|
|
73
74
|
*/
|
|
74
75
|
skin?: Skin;
|
|
76
|
+
/**
|
|
77
|
+
* The order a date is typed in, and shown in while it is typed: day, month, year (`dmy`, the default, as
|
|
78
|
+
* English, Arabic, French and German pages write dates), month first (`mdy`), or year first (`ymd`). A date
|
|
79
|
+
* written year first, 2026-10-13, is read whatever the order.
|
|
80
|
+
*/
|
|
81
|
+
dateOrder?: DateOrder;
|
|
75
82
|
}
|
|
76
83
|
export interface Page {
|
|
77
|
-
/**
|
|
78
|
-
|
|
84
|
+
/**
|
|
85
|
+
* The format the page is written in, so a reader can tell one it cannot read yet (a newer Fieldia's) from one it can
|
|
86
|
+
* bring up to date (an older one's: `upgradePage`). A page made now says FORMAT_VERSION.
|
|
87
|
+
*/
|
|
88
|
+
fieldia: FormatVersion;
|
|
79
89
|
id: string;
|
|
80
90
|
title?: string;
|
|
81
91
|
description?: string;
|
|
@@ -109,7 +119,10 @@ export declare const PageDataSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
109
119
|
kind: z.ZodLiteral<"responses">;
|
|
110
120
|
}, z.z.core.$strict>], "kind">;
|
|
111
121
|
export declare const PageSchema: z.ZodObject<{
|
|
112
|
-
fieldia: z.
|
|
122
|
+
fieldia: z.ZodEnum<{
|
|
123
|
+
0.2: "0.2";
|
|
124
|
+
0.1: "0.1";
|
|
125
|
+
}>;
|
|
113
126
|
id: z.ZodString;
|
|
114
127
|
title: z.ZodOptional<z.ZodString>;
|
|
115
128
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -122,6 +135,7 @@ export declare const PageSchema: z.ZodObject<{
|
|
|
122
135
|
fields: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
123
136
|
size: z.ZodOptional<z.ZodInt>;
|
|
124
137
|
pattern: z.ZodOptional<z.ZodString>;
|
|
138
|
+
patternHint: z.ZodOptional<z.ZodString>;
|
|
125
139
|
label: z.ZodString;
|
|
126
140
|
help: z.ZodOptional<z.ZodString>;
|
|
127
141
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -318,6 +332,10 @@ export declare const PageSchema: z.ZodObject<{
|
|
|
318
332
|
type: z.ZodLiteral<"selection">;
|
|
319
333
|
}, z.z.core.$strict>, z.ZodObject<{
|
|
320
334
|
maxSize: z.ZodOptional<z.ZodInt>;
|
|
335
|
+
shrink: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodObject<{
|
|
336
|
+
maxSide: z.ZodOptional<z.ZodInt>;
|
|
337
|
+
quality: z.ZodOptional<z.ZodNumber>;
|
|
338
|
+
}, z.z.core.$strict>]>>;
|
|
321
339
|
multiple: z.ZodOptional<z.ZodBoolean>;
|
|
322
340
|
minFiles: z.ZodOptional<z.ZodInt>;
|
|
323
341
|
maxFiles: z.ZodOptional<z.ZodInt>;
|
|
@@ -337,6 +355,10 @@ export declare const PageSchema: z.ZodObject<{
|
|
|
337
355
|
type: z.ZodLiteral<"binary">;
|
|
338
356
|
}, z.z.core.$strict>, z.ZodObject<{
|
|
339
357
|
maxSize: z.ZodOptional<z.ZodInt>;
|
|
358
|
+
shrink: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodObject<{
|
|
359
|
+
maxSide: z.ZodOptional<z.ZodInt>;
|
|
360
|
+
quality: z.ZodOptional<z.ZodNumber>;
|
|
361
|
+
}, z.z.core.$strict>]>>;
|
|
340
362
|
multiple: z.ZodOptional<z.ZodBoolean>;
|
|
341
363
|
minFiles: z.ZodOptional<z.ZodInt>;
|
|
342
364
|
maxFiles: z.ZodOptional<z.ZodInt>;
|
|
@@ -435,6 +457,7 @@ export declare const PageSchema: z.ZodObject<{
|
|
|
435
457
|
fields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
436
458
|
size: z.ZodOptional<z.ZodInt>;
|
|
437
459
|
pattern: z.ZodOptional<z.ZodString>;
|
|
460
|
+
patternHint: z.ZodOptional<z.ZodString>;
|
|
438
461
|
label: z.ZodString;
|
|
439
462
|
help: z.ZodOptional<z.ZodString>;
|
|
440
463
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -677,6 +700,7 @@ export declare const PageSchema: z.ZodObject<{
|
|
|
677
700
|
fields: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
678
701
|
size: z.ZodOptional<z.ZodInt>;
|
|
679
702
|
pattern: z.ZodOptional<z.ZodString>;
|
|
703
|
+
patternHint: z.ZodOptional<z.ZodString>;
|
|
680
704
|
label: z.ZodString;
|
|
681
705
|
help: z.ZodOptional<z.ZodString>;
|
|
682
706
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -870,6 +894,10 @@ export declare const PageSchema: z.ZodObject<{
|
|
|
870
894
|
type: z.ZodLiteral<"selection">;
|
|
871
895
|
}, z.z.core.$strict>, z.ZodObject<{
|
|
872
896
|
maxSize: z.ZodOptional<z.ZodInt>;
|
|
897
|
+
shrink: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodObject<{
|
|
898
|
+
maxSide: z.ZodOptional<z.ZodInt>;
|
|
899
|
+
quality: z.ZodOptional<z.ZodNumber>;
|
|
900
|
+
}, z.z.core.$strict>]>>;
|
|
873
901
|
multiple: z.ZodOptional<z.ZodBoolean>;
|
|
874
902
|
minFiles: z.ZodOptional<z.ZodInt>;
|
|
875
903
|
maxFiles: z.ZodOptional<z.ZodInt>;
|
|
@@ -889,6 +917,10 @@ export declare const PageSchema: z.ZodObject<{
|
|
|
889
917
|
type: z.ZodLiteral<"binary">;
|
|
890
918
|
}, z.z.core.$strict>, z.ZodObject<{
|
|
891
919
|
maxSize: z.ZodOptional<z.ZodInt>;
|
|
920
|
+
shrink: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodObject<{
|
|
921
|
+
maxSide: z.ZodOptional<z.ZodInt>;
|
|
922
|
+
quality: z.ZodOptional<z.ZodNumber>;
|
|
923
|
+
}, z.z.core.$strict>]>>;
|
|
892
924
|
multiple: z.ZodOptional<z.ZodBoolean>;
|
|
893
925
|
minFiles: z.ZodOptional<z.ZodInt>;
|
|
894
926
|
maxFiles: z.ZodOptional<z.ZodInt>;
|
|
@@ -987,6 +1019,7 @@ export declare const PageSchema: z.ZodObject<{
|
|
|
987
1019
|
fields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
988
1020
|
size: z.ZodOptional<z.ZodInt>;
|
|
989
1021
|
pattern: z.ZodOptional<z.ZodString>;
|
|
1022
|
+
patternHint: z.ZodOptional<z.ZodString>;
|
|
990
1023
|
label: z.ZodString;
|
|
991
1024
|
help: z.ZodOptional<z.ZodString>;
|
|
992
1025
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -1306,6 +1339,7 @@ export declare const PageSchema: z.ZodObject<{
|
|
|
1306
1339
|
fields: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1307
1340
|
size: z.ZodOptional<z.ZodInt>;
|
|
1308
1341
|
pattern: z.ZodOptional<z.ZodString>;
|
|
1342
|
+
patternHint: z.ZodOptional<z.ZodString>;
|
|
1309
1343
|
label: z.ZodString;
|
|
1310
1344
|
help: z.ZodOptional<z.ZodString>;
|
|
1311
1345
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -1499,6 +1533,10 @@ export declare const PageSchema: z.ZodObject<{
|
|
|
1499
1533
|
type: z.ZodLiteral<"selection">;
|
|
1500
1534
|
}, z.z.core.$strict>, z.ZodObject<{
|
|
1501
1535
|
maxSize: z.ZodOptional<z.ZodInt>;
|
|
1536
|
+
shrink: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodObject<{
|
|
1537
|
+
maxSide: z.ZodOptional<z.ZodInt>;
|
|
1538
|
+
quality: z.ZodOptional<z.ZodNumber>;
|
|
1539
|
+
}, z.z.core.$strict>]>>;
|
|
1502
1540
|
multiple: z.ZodOptional<z.ZodBoolean>;
|
|
1503
1541
|
minFiles: z.ZodOptional<z.ZodInt>;
|
|
1504
1542
|
maxFiles: z.ZodOptional<z.ZodInt>;
|
|
@@ -1518,6 +1556,10 @@ export declare const PageSchema: z.ZodObject<{
|
|
|
1518
1556
|
type: z.ZodLiteral<"binary">;
|
|
1519
1557
|
}, z.z.core.$strict>, z.ZodObject<{
|
|
1520
1558
|
maxSize: z.ZodOptional<z.ZodInt>;
|
|
1559
|
+
shrink: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodObject<{
|
|
1560
|
+
maxSide: z.ZodOptional<z.ZodInt>;
|
|
1561
|
+
quality: z.ZodOptional<z.ZodNumber>;
|
|
1562
|
+
}, z.z.core.$strict>]>>;
|
|
1521
1563
|
multiple: z.ZodOptional<z.ZodBoolean>;
|
|
1522
1564
|
minFiles: z.ZodOptional<z.ZodInt>;
|
|
1523
1565
|
maxFiles: z.ZodOptional<z.ZodInt>;
|
|
@@ -1616,6 +1658,7 @@ export declare const PageSchema: z.ZodObject<{
|
|
|
1616
1658
|
fields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1617
1659
|
size: z.ZodOptional<z.ZodInt>;
|
|
1618
1660
|
pattern: z.ZodOptional<z.ZodString>;
|
|
1661
|
+
patternHint: z.ZodOptional<z.ZodString>;
|
|
1619
1662
|
label: z.ZodString;
|
|
1620
1663
|
help: z.ZodOptional<z.ZodString>;
|
|
1621
1664
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -2170,8 +2213,8 @@ export declare const PageSchema: z.ZodObject<{
|
|
|
2170
2213
|
always: "always";
|
|
2171
2214
|
}>>;
|
|
2172
2215
|
fit: z.ZodOptional<z.ZodEnum<{
|
|
2173
|
-
content: "content";
|
|
2174
2216
|
shrink: "shrink";
|
|
2217
|
+
content: "content";
|
|
2175
2218
|
}>>;
|
|
2176
2219
|
editMode: z.ZodOptional<z.ZodEnum<{
|
|
2177
2220
|
cell: "cell";
|
|
@@ -2625,8 +2668,8 @@ export declare const PageSchema: z.ZodObject<{
|
|
|
2625
2668
|
always: "always";
|
|
2626
2669
|
}>>;
|
|
2627
2670
|
fit: z.ZodOptional<z.ZodEnum<{
|
|
2628
|
-
content: "content";
|
|
2629
2671
|
shrink: "shrink";
|
|
2672
|
+
content: "content";
|
|
2630
2673
|
}>>;
|
|
2631
2674
|
editMode: z.ZodOptional<z.ZodEnum<{
|
|
2632
2675
|
cell: "cell";
|
|
@@ -3404,8 +3447,8 @@ export declare const PageSchema: z.ZodObject<{
|
|
|
3404
3447
|
always: "always";
|
|
3405
3448
|
}>>;
|
|
3406
3449
|
fit: z.ZodOptional<z.ZodEnum<{
|
|
3407
|
-
content: "content";
|
|
3408
3450
|
shrink: "shrink";
|
|
3451
|
+
content: "content";
|
|
3409
3452
|
}>>;
|
|
3410
3453
|
editMode: z.ZodOptional<z.ZodEnum<{
|
|
3411
3454
|
cell: "cell";
|
|
@@ -3543,8 +3586,8 @@ export declare const PageSchema: z.ZodObject<{
|
|
|
3543
3586
|
always: "always";
|
|
3544
3587
|
}>>;
|
|
3545
3588
|
fit: z.ZodOptional<z.ZodEnum<{
|
|
3546
|
-
content: "content";
|
|
3547
3589
|
shrink: "shrink";
|
|
3590
|
+
content: "content";
|
|
3548
3591
|
}>>;
|
|
3549
3592
|
editMode: z.ZodOptional<z.ZodEnum<{
|
|
3550
3593
|
cell: "cell";
|
|
@@ -3682,8 +3725,8 @@ export declare const PageSchema: z.ZodObject<{
|
|
|
3682
3725
|
always: "always";
|
|
3683
3726
|
}>>;
|
|
3684
3727
|
fit: z.ZodOptional<z.ZodEnum<{
|
|
3685
|
-
content: "content";
|
|
3686
3728
|
shrink: "shrink";
|
|
3729
|
+
content: "content";
|
|
3687
3730
|
}>>;
|
|
3688
3731
|
editMode: z.ZodOptional<z.ZodEnum<{
|
|
3689
3732
|
cell: "cell";
|
|
@@ -3821,8 +3864,8 @@ export declare const PageSchema: z.ZodObject<{
|
|
|
3821
3864
|
always: "always";
|
|
3822
3865
|
}>>;
|
|
3823
3866
|
fit: z.ZodOptional<z.ZodEnum<{
|
|
3824
|
-
content: "content";
|
|
3825
3867
|
shrink: "shrink";
|
|
3868
|
+
content: "content";
|
|
3826
3869
|
}>>;
|
|
3827
3870
|
editMode: z.ZodOptional<z.ZodEnum<{
|
|
3828
3871
|
cell: "cell";
|
|
@@ -5310,6 +5353,35 @@ export declare const PageSchema: z.ZodObject<{
|
|
|
5310
5353
|
}>>;
|
|
5311
5354
|
fitZoom: z.ZodOptional<z.ZodInt>;
|
|
5312
5355
|
}, z.z.core.$strict>>;
|
|
5356
|
+
calendar: z.ZodOptional<z.ZodObject<{
|
|
5357
|
+
start: z.ZodString;
|
|
5358
|
+
end: z.ZodOptional<z.ZodString>;
|
|
5359
|
+
title: z.ZodString;
|
|
5360
|
+
colour: z.ZodOptional<z.ZodString>;
|
|
5361
|
+
resource: z.ZodOptional<z.ZodString>;
|
|
5362
|
+
views: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
5363
|
+
day: "day";
|
|
5364
|
+
week: "week";
|
|
5365
|
+
month: "month";
|
|
5366
|
+
agenda: "agenda";
|
|
5367
|
+
}>>>;
|
|
5368
|
+
view: z.ZodOptional<z.ZodEnum<{
|
|
5369
|
+
day: "day";
|
|
5370
|
+
week: "week";
|
|
5371
|
+
month: "month";
|
|
5372
|
+
agenda: "agenda";
|
|
5373
|
+
}>>;
|
|
5374
|
+
opens: z.ZodOptional<z.ZodEnum<{
|
|
5375
|
+
list: "list";
|
|
5376
|
+
calendar: "calendar";
|
|
5377
|
+
}>>;
|
|
5378
|
+
firstDay: z.ZodOptional<z.ZodInt>;
|
|
5379
|
+
hours: z.ZodOptional<z.ZodObject<{
|
|
5380
|
+
start: z.ZodInt;
|
|
5381
|
+
end: z.ZodInt;
|
|
5382
|
+
}, z.z.core.$strict>>;
|
|
5383
|
+
slot: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<15>, z.ZodLiteral<30>, z.ZodLiteral<60>]>>;
|
|
5384
|
+
}, z.z.core.$strict>>;
|
|
5313
5385
|
cells: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
5314
5386
|
widget: z.ZodOptional<z.ZodString>;
|
|
5315
5387
|
options: z.ZodOptional<z.ZodObject<{
|
|
@@ -5411,6 +5483,11 @@ export declare const PageSchema: z.ZodObject<{
|
|
|
5411
5483
|
underline: "underline";
|
|
5412
5484
|
outlined: "outlined";
|
|
5413
5485
|
}>>;
|
|
5486
|
+
dateOrder: z.ZodOptional<z.ZodEnum<{
|
|
5487
|
+
dmy: "dmy";
|
|
5488
|
+
mdy: "mdy";
|
|
5489
|
+
ymd: "ymd";
|
|
5490
|
+
}>>;
|
|
5414
5491
|
}, z.z.core.$strict>>;
|
|
5415
5492
|
language: z.ZodOptional<z.ZodString>;
|
|
5416
5493
|
translations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>>>;
|
package/src/lib/format/page.js
CHANGED
|
@@ -30,7 +30,10 @@ const PART_SETTING = {
|
|
|
30
30
|
const PartsLookSchema = z.strictObject(Object.fromEntries(Object.entries(part_look_1.PART_LOOKS).map(([kind, settings]) => [kind, z.strictObject(Object.fromEntries(settings.map((name) => [name, PART_SETTING[name].optional()]))).optional()])));
|
|
31
31
|
exports.PageSchema = z
|
|
32
32
|
.strictObject({
|
|
33
|
-
|
|
33
|
+
// Newer than this Fieldia, or no format at all: said in words (formatProblem), not as a literal expected.
|
|
34
|
+
// Any format Fieldia has had: a page is brought up to date before it is checked, and an app's own older pages
|
|
35
|
+
// ("0.1", from 0.20 and 0.21) still type as pages.
|
|
36
|
+
fieldia: z.enum(version_1.FORMAT_VERSIONS, { error: (issue) => (0, version_1.formatProblem)(issue.input) ?? undefined }),
|
|
34
37
|
id: z.string().regex(/^[A-Za-z0-9][A-Za-z0-9._-]*$/),
|
|
35
38
|
title: z.string().optional(),
|
|
36
39
|
description: z.string().optional(),
|
|
@@ -55,6 +58,7 @@ exports.PageSchema = z
|
|
|
55
58
|
scheme: z.enum(['light', 'dark', 'auto']).optional(),
|
|
56
59
|
parts: PartsLookSchema.optional(),
|
|
57
60
|
skin: z.enum(themes_3.SKINS).optional(),
|
|
61
|
+
dateOrder: z.enum(['dmy', 'mdy', 'ymd']).optional(),
|
|
58
62
|
})
|
|
59
63
|
.optional(),
|
|
60
64
|
language: z.string().regex(/^[a-z]{2,3}(-[A-Za-z0-9]{2,8})*$/).optional(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/format/page.ts"],"names":[],"mappings":";;;AAAA,yBAAyB;AACzB,uCAA8D;AAC9D,mCAAoD;AACpD,qCAA8F;AAC9F,2CAAwE;AACxE,qCAA8C;AAC9C,mCAA8C;AAArC,gGAAA,MAAM,OAAA;AACf,qCAA4C;AAE5C,
|
|
1
|
+
{"version":3,"file":"page.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/format/page.ts"],"names":[],"mappings":";;;AAAA,yBAAyB;AACzB,uCAA8D;AAC9D,mCAAoD;AACpD,qCAA8F;AAC9F,2CAAwE;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E,CAAC,CAAC,CAAC,QAAQ,EAAE;IACzH,EAAE,EAAE,0BAAgB,CAAC,QAAQ,EAAE;CAChC,CAAC;KACD,IAAI,CAAC;IACJ,KAAK,EAAE,cAAc;IACrB,WAAW,EACT,8HAA8H;CACjI,CAAC,CAAC"}
|
package/src/lib/format/page.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { PART_LOOKS } from './part-look.mjs';
|
|
|
6
6
|
import { THEMES } from './themes.mjs';
|
|
7
7
|
export { THEMES } from './themes.mjs';
|
|
8
8
|
import { SKINS } from './themes.mjs';
|
|
9
|
-
import {
|
|
9
|
+
import { FORMAT_VERSIONS, formatProblem } from './version.mjs';
|
|
10
10
|
export { FORMAT_VERSION } from './version.mjs';
|
|
11
11
|
export const PageDataSchema = z.discriminatedUnion('kind', [
|
|
12
12
|
z.strictObject({ kind: z.literal('record'), model: z.string().min(1) }),
|
|
@@ -25,7 +25,10 @@ const PART_SETTING = {
|
|
|
25
25
|
const PartsLookSchema = z.strictObject(Object.fromEntries(Object.entries(PART_LOOKS).map(([kind, settings]) => [kind, z.strictObject(Object.fromEntries(settings.map((name) => [name, PART_SETTING[name].optional()]))).optional()])));
|
|
26
26
|
export const PageSchema = z
|
|
27
27
|
.strictObject({
|
|
28
|
-
|
|
28
|
+
// Newer than this Fieldia, or no format at all: said in words (formatProblem), not as a literal expected.
|
|
29
|
+
// Any format Fieldia has had: a page is brought up to date before it is checked, and an app's own older pages
|
|
30
|
+
// ("0.1", from 0.20 and 0.21) still type as pages.
|
|
31
|
+
fieldia: z.enum(FORMAT_VERSIONS, { error: (issue) => formatProblem(issue.input) ?? undefined }),
|
|
29
32
|
id: z.string().regex(/^[A-Za-z0-9][A-Za-z0-9._-]*$/),
|
|
30
33
|
title: z.string().optional(),
|
|
31
34
|
description: z.string().optional(),
|
|
@@ -50,6 +53,7 @@ export const PageSchema = z
|
|
|
50
53
|
scheme: z.enum(['light', 'dark', 'auto']).optional(),
|
|
51
54
|
parts: PartsLookSchema.optional(),
|
|
52
55
|
skin: z.enum(SKINS).optional(),
|
|
56
|
+
dateOrder: z.enum(['dmy', 'mdy', 'ymd']).optional(),
|
|
53
57
|
})
|
|
54
58
|
.optional(),
|
|
55
59
|
language: z.string().regex(/^[a-z]{2,3}(-[A-Za-z0-9]{2,8})*$/).optional(),
|
|
@@ -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,gBAAgB,EAAmB,MAAM,WAAW,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAe,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAmC,MAAM,UAAU,CAAC;AAC9F,OAAO,EAAE,UAAU,EAAiC,MAAM,aAAa,CAAC;AACxE,OAAO,EAAE,MAAM,EAAc,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAc,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAa,MAAM,UAAU,CAAC;AAE5C,OAAO,EAAE,
|
|
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,gBAAgB,EAAmB,MAAM,WAAW,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAe,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAmC,MAAM,UAAU,CAAC;AAC9F,OAAO,EAAE,UAAU,EAAiC,MAAM,aAAa,CAAC;AACxE,OAAO,EAAE,MAAM,EAAc,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAc,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAa,MAAM,UAAU,CAAC;AAE5C,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AAC,CAAC,QAAQ,EAAE;IACzH,EAAE,EAAE,gBAAgB,CAAC,QAAQ,EAAE;CAChC,CAAC;KACD,IAAI,CAAC;IACJ,KAAK,EAAE,cAAc;IACrB,WAAW,EACT,8HAA8H;CACjI,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A field's `pattern`, as it is checked: about the whole answer, not a part
|
|
3
|
+
* of it — "[0-9]{5}" takes "11511" and never "ab11511cd", as an answer
|
|
4
|
+
* rule's pattern and the browser's own `pattern` attribute do — and read with
|
|
5
|
+
* Unicode (`u`), so `\p{L}` is any letter. A pattern written before patterns
|
|
6
|
+
* were read with Unicode, which only reads without it (an escaped "\-" outside
|
|
7
|
+
* a class), is read as it was written. A pattern that does not read at all
|
|
8
|
+
* is the reason why, for checkPage to name: a check never throws on one.
|
|
9
|
+
*/
|
|
10
|
+
export declare function fieldPattern(pattern: string): RegExp | Error;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A field's `pattern`, as it is checked: about the whole answer, not a part
|
|
3
|
+
* of it — "[0-9]{5}" takes "11511" and never "ab11511cd", as an answer
|
|
4
|
+
* rule's pattern and the browser's own `pattern` attribute do — and read with
|
|
5
|
+
* Unicode (`u`), so `\p{L}` is any letter. A pattern written before patterns
|
|
6
|
+
* were read with Unicode, which only reads without it (an escaped "\-" outside
|
|
7
|
+
* a class), is read as it was written. A pattern that does not read at all
|
|
8
|
+
* is the reason why, for checkPage to name: a check never throws on one.
|
|
9
|
+
*/
|
|
10
|
+
export declare function fieldPattern(pattern: string): RegExp | Error;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fieldPattern = fieldPattern;
|
|
4
|
+
/**
|
|
5
|
+
* A field's `pattern`, as it is checked: about the whole answer, not a part
|
|
6
|
+
* of it — "[0-9]{5}" takes "11511" and never "ab11511cd", as an answer
|
|
7
|
+
* rule's pattern and the browser's own `pattern` attribute do — and read with
|
|
8
|
+
* Unicode (`u`), so `\p{L}` is any letter. A pattern written before patterns
|
|
9
|
+
* were read with Unicode, which only reads without it (an escaped "\-" outside
|
|
10
|
+
* a class), is read as it was written. A pattern that does not read at all
|
|
11
|
+
* is the reason why, for checkPage to name: a check never throws on one.
|
|
12
|
+
*/
|
|
13
|
+
function fieldPattern(pattern) {
|
|
14
|
+
const found = compiled.get(pattern);
|
|
15
|
+
if (found)
|
|
16
|
+
return found;
|
|
17
|
+
let made;
|
|
18
|
+
try {
|
|
19
|
+
made = new RegExp(`^(?:${pattern})$`, 'u');
|
|
20
|
+
}
|
|
21
|
+
catch (unicode) {
|
|
22
|
+
try {
|
|
23
|
+
made = new RegExp(`^(?:${pattern})$`);
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
made = unicode;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
compiled.set(pattern, made);
|
|
30
|
+
return made;
|
|
31
|
+
}
|
|
32
|
+
const compiled = new Map();
|
|
33
|
+
//# sourceMappingURL=pattern.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pattern.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/format/pattern.ts"],"names":[],"mappings":";;AASA,oCAeC;AAxBD;;;;;;;;GAQG;AACH,SAAgB,YAAY,CAAC,OAAe;IAC1C,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACpC,IAAI,KAAK;QAAE,OAAO,KAAK,CAAC;IACxB,IAAI,IAAoB,CAAC;IACzB,IAAI,CAAC;QACH,IAAI,GAAG,IAAI,MAAM,CAAC,OAAO,OAAO,IAAI,EAAE,GAAG,CAAC,CAAC;IAC7C,CAAC;IAAC,OAAO,OAAO,EAAE,CAAC;QACjB,IAAI,CAAC;YACH,IAAI,GAAG,IAAI,MAAM,CAAC,OAAO,OAAO,IAAI,CAAC,CAAC;QACxC,CAAC;QAAC,MAAM,CAAC;YACP,IAAI,GAAG,OAAgB,CAAC;QAC1B,CAAC;IACH,CAAC;IACD,QAAQ,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAC5B,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,QAAQ,GAAG,IAAI,GAAG,EAA0B,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A field's `pattern`, as it is checked: about the whole answer, not a part
|
|
3
|
+
* of it — "[0-9]{5}" takes "11511" and never "ab11511cd", as an answer
|
|
4
|
+
* rule's pattern and the browser's own `pattern` attribute do — and read with
|
|
5
|
+
* Unicode (`u`), so `\p{L}` is any letter. A pattern written before patterns
|
|
6
|
+
* were read with Unicode, which only reads without it (an escaped "\-" outside
|
|
7
|
+
* a class), is read as it was written. A pattern that does not read at all
|
|
8
|
+
* is the reason why, for checkPage to name: a check never throws on one.
|
|
9
|
+
*/
|
|
10
|
+
export function fieldPattern(pattern) {
|
|
11
|
+
const found = compiled.get(pattern);
|
|
12
|
+
if (found)
|
|
13
|
+
return found;
|
|
14
|
+
let made;
|
|
15
|
+
try {
|
|
16
|
+
made = new RegExp(`^(?:${pattern})$`, 'u');
|
|
17
|
+
}
|
|
18
|
+
catch (unicode) {
|
|
19
|
+
try {
|
|
20
|
+
made = new RegExp(`^(?:${pattern})$`);
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
made = unicode;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
compiled.set(pattern, made);
|
|
27
|
+
return made;
|
|
28
|
+
}
|
|
29
|
+
const compiled = new Map();
|
|
30
|
+
//# sourceMappingURL=pattern.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pattern.mjs","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/format/pattern.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,UAAU,YAAY,CAAC,OAAe;IAC1C,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACpC,IAAI,KAAK;QAAE,OAAO,KAAK,CAAC;IACxB,IAAI,IAAoB,CAAC;IACzB,IAAI,CAAC;QACH,IAAI,GAAG,IAAI,MAAM,CAAC,OAAO,OAAO,IAAI,EAAE,GAAG,CAAC,CAAC;IAC7C,CAAC;IAAC,OAAO,OAAO,EAAE,CAAC;QACjB,IAAI,CAAC;YACH,IAAI,GAAG,IAAI,MAAM,CAAC,OAAO,OAAO,IAAI,CAAC,CAAC;QACxC,CAAC;QAAC,MAAM,CAAC;YACP,IAAI,GAAG,OAAgB,CAAC;QAC1B,CAAC;IACH,CAAC;IACD,QAAQ,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAC5B,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,QAAQ,GAAG,IAAI,GAAG,EAA0B,CAAC"}
|
|
@@ -91,6 +91,13 @@ export declare class ReferenceCheck {
|
|
|
91
91
|
private walkFooter;
|
|
92
92
|
private walkRoot;
|
|
93
93
|
private walkList;
|
|
94
|
+
/**
|
|
95
|
+
* A list's calendar: when each record starts (a date, or a date and time)
|
|
96
|
+
* and ends (the same kind), its words, its colour and its columns, each
|
|
97
|
+
* from a field that can; the view it opens on is one it offers, its hours
|
|
98
|
+
* run forward, and the list opens on one thing.
|
|
99
|
+
*/
|
|
100
|
+
private walkListCalendar;
|
|
94
101
|
/**
|
|
95
102
|
* A list drawn as a backlog: each column's cells are a column's, a lead's
|
|
96
103
|
* icon is by a field's values; the filter bar's fields can list their
|
|
@@ -91,6 +91,13 @@ export declare class ReferenceCheck {
|
|
|
91
91
|
private walkFooter;
|
|
92
92
|
private walkRoot;
|
|
93
93
|
private walkList;
|
|
94
|
+
/**
|
|
95
|
+
* A list's calendar: when each record starts (a date, or a date and time)
|
|
96
|
+
* and ends (the same kind), its words, its colour and its columns, each
|
|
97
|
+
* from a field that can; the view it opens on is one it offers, its hours
|
|
98
|
+
* run forward, and the list opens on one thing.
|
|
99
|
+
*/
|
|
100
|
+
private walkListCalendar;
|
|
94
101
|
/**
|
|
95
102
|
* A list drawn as a backlog: each column's cells are a column's, a lead's
|
|
96
103
|
* icon is by a field's values; the filter bar's fields can list their
|
|
@@ -9,12 +9,22 @@ const words_1 = require("./words");
|
|
|
9
9
|
const hotkeys_1 = require("./hotkeys");
|
|
10
10
|
const head_checks_1 = require("./head-checks");
|
|
11
11
|
const section_checks_1 = require("./section-checks");
|
|
12
|
+
const pattern_1 = require("./pattern");
|
|
13
|
+
const messages_1 = require("../record/messages");
|
|
12
14
|
const has = (record, key) => Object.prototype.hasOwnProperty.call(record, key);
|
|
13
15
|
/** The kinds of field an expression can give a value to: the rest hold records, lines or files. */
|
|
14
16
|
const EXPRESSIBLE = new Set(['char', 'text', 'html', 'integer', 'float', 'monetary', 'boolean', 'date', 'datetime', 'selection', 'json']);
|
|
15
17
|
const EXPRESSIBLE_WORDS = 'text, numbers, yes or no, dates, choices and json can';
|
|
16
18
|
/** The kinds of field a list's filter bar can list the values of. */
|
|
17
19
|
const LISTS_ITS_VALUES = new Set(['selection', 'many2one', 'many2many', 'boolean', 'char', 'integer']);
|
|
20
|
+
/** What a calendar's start and end can be: a day, or a day and a time. */
|
|
21
|
+
const CALENDAR_TIMES = new Set(['date', 'datetime']);
|
|
22
|
+
/** What a record's words on a calendar can be. */
|
|
23
|
+
const CALENDAR_WORDS = new Set(['char', 'text', 'selection', 'many2one', 'integer', 'float', 'monetary', 'date', 'datetime']);
|
|
24
|
+
/** What a calendar's columns come from: a value that repeats. */
|
|
25
|
+
const CALENDAR_COLUMNS = new Set(['many2one', 'selection', 'char', 'integer']);
|
|
26
|
+
/** What a record's colour comes from. */
|
|
27
|
+
const CALENDAR_COLOURS = new Set(['many2one', 'selection', 'char', 'integer', 'boolean']);
|
|
18
28
|
/** Names quoted and joined as a person lists them: "a", "b" and "c". */
|
|
19
29
|
const listed = (names) => {
|
|
20
30
|
const quoted = names.map((name) => `"${name}"`);
|
|
@@ -379,6 +389,12 @@ class ReferenceCheck {
|
|
|
379
389
|
if ((def.type === 'many2one' || def.type === 'many2many') && def.filter) {
|
|
380
390
|
def.filter.forEach((item, i) => this.checkFilterItem(item, `${path}.filter[${i}]`, scope));
|
|
381
391
|
}
|
|
392
|
+
// A pattern reads, or the page says why: a person's Save never ends on a pattern the page got wrong.
|
|
393
|
+
if (def.type === 'char' && def.pattern !== undefined) {
|
|
394
|
+
const pattern = (0, pattern_1.fieldPattern)(def.pattern);
|
|
395
|
+
if (pattern instanceof Error)
|
|
396
|
+
this.report(`${path}.pattern`, (0, messages_1.fill)(messages_1.MESSAGES.en.patternBroken, { label: def.label, problem: pattern.message }));
|
|
397
|
+
}
|
|
382
398
|
if (def.type === 'selection')
|
|
383
399
|
def.optionsFrom?.dependsOn?.forEach((other, i) => this.need(other, `${path}.optionsFrom.dependsOn[${i}]`, fields));
|
|
384
400
|
if (def.type === 'properties')
|
|
@@ -507,8 +523,46 @@ class ReferenceCheck {
|
|
|
507
523
|
});
|
|
508
524
|
if (list.map)
|
|
509
525
|
this.walkListMap(list.map, `${path}.map`);
|
|
526
|
+
if (list.calendar)
|
|
527
|
+
this.walkListCalendar(list, `${path}.calendar`);
|
|
510
528
|
this.checkListCells(list, path);
|
|
511
529
|
}
|
|
530
|
+
/**
|
|
531
|
+
* A list's calendar: when each record starts (a date, or a date and time)
|
|
532
|
+
* and ends (the same kind), its words, its colour and its columns, each
|
|
533
|
+
* from a field that can; the view it opens on is one it offers, its hours
|
|
534
|
+
* run forward, and the list opens on one thing.
|
|
535
|
+
*/
|
|
536
|
+
walkListCalendar(list, path) {
|
|
537
|
+
const calendar = list.calendar;
|
|
538
|
+
const typed = (name, key, ok, says) => {
|
|
539
|
+
if (name === undefined)
|
|
540
|
+
return undefined;
|
|
541
|
+
const def = this.need(name, `${path}.${key}`);
|
|
542
|
+
if (def && !ok.has(def.type))
|
|
543
|
+
this.report(`${path}.${key}`, `"${name}" is a ${def.type}; ${says}`);
|
|
544
|
+
return def;
|
|
545
|
+
};
|
|
546
|
+
const start = typed(calendar.start, 'start', CALENDAR_TIMES, "a calendar's start is a date, or a date and time");
|
|
547
|
+
const end = typed(calendar.end, 'end', CALENDAR_TIMES, "a calendar's end is a date, or a date and time");
|
|
548
|
+
if (start && end && CALENDAR_TIMES.has(start.type) && CALENDAR_TIMES.has(end.type) && start.type !== end.type) {
|
|
549
|
+
this.report(`${path}.end`, `"${calendar.end}" is a ${end.type}; an end is the same kind of field as its start, a ${start.type}`);
|
|
550
|
+
}
|
|
551
|
+
typed(calendar.title, 'title', CALENDAR_WORDS, "a record's words on a calendar are a field that can be said");
|
|
552
|
+
typed(calendar.colour, 'colour', CALENDAR_COLOURS, 'a colour comes from a link, a choice, text, a whole number or a yes or no');
|
|
553
|
+
typed(calendar.resource, 'resource', CALENDAR_COLUMNS, 'a column for each comes from a link, a choice, text or a whole number');
|
|
554
|
+
const views = calendar.views ?? ['day', 'week', 'month', 'agenda'];
|
|
555
|
+
views.forEach((view, i) => {
|
|
556
|
+
if (views.indexOf(view) !== i)
|
|
557
|
+
this.report(`${path}.views[${i}]`, `"${view}" is offered twice`);
|
|
558
|
+
});
|
|
559
|
+
if (calendar.view && !views.includes(calendar.view))
|
|
560
|
+
this.report(`${path}.view`, `"${calendar.view}" is not one of its views (${views.join(', ')})`);
|
|
561
|
+
if (calendar.hours && calendar.hours.end <= calendar.hours.start)
|
|
562
|
+
this.report(`${path}.hours`, `the hours end at ${calendar.hours.end}, before they start at ${calendar.hours.start}`);
|
|
563
|
+
if (calendar.opens === 'calendar' && list.map?.view && list.map.view !== 'list')
|
|
564
|
+
this.report(`${path}.opens`, 'the list opens on its map (map.view) and on its calendar: say one');
|
|
565
|
+
}
|
|
512
566
|
/**
|
|
513
567
|
* A list drawn as a backlog: each column's cells are a column's, a lead's
|
|
514
568
|
* icon is by a field's values; the filter bar's fields can list their
|