@fieldia/core 0.19.1 → 0.21.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 +946 -210
- package/src/index.d.mts +2 -1
- package/src/index.d.ts +2 -1
- package/src/index.js +5 -1
- package/src/index.js.map +1 -1
- package/src/index.mjs +2 -1
- 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/field.d.mts +16 -0
- package/src/lib/format/field.d.ts +16 -0
- package/src/lib/format/field.js +11 -1
- package/src/lib/format/field.js.map +1 -1
- package/src/lib/format/field.mjs +11 -1
- package/src/lib/format/field.mjs.map +1 -1
- package/src/lib/format/head-checks.d.mts +40 -0
- package/src/lib/format/head-checks.d.ts +40 -0
- package/src/lib/format/head-checks.js +172 -0
- package/src/lib/format/head-checks.js.map +1 -0
- package/src/lib/format/head-checks.mjs +167 -0
- package/src/lib/format/head-checks.mjs.map +1 -0
- package/src/lib/format/layout.d.mts +6485 -1447
- package/src/lib/format/layout.d.ts +6485 -1447
- package/src/lib/format/layout.js +106 -2
- package/src/lib/format/layout.js.map +1 -1
- package/src/lib/format/layout.mjs +105 -1
- package/src/lib/format/layout.mjs.map +1 -1
- package/src/lib/format/layout.types.d.mts +7 -1
- package/src/lib/format/layout.types.d.ts +7 -1
- package/src/lib/format/page.d.mts +1502 -162
- package/src/lib/format/page.d.ts +1502 -162
- package/src/lib/format/page.js +3 -0
- package/src/lib/format/page.js.map +1 -1
- package/src/lib/format/page.mjs +3 -0
- 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/picker-options.d.mts +22 -0
- package/src/lib/format/picker-options.d.ts +22 -0
- package/src/lib/format/picker-options.js +50 -0
- package/src/lib/format/picker-options.js.map +1 -0
- package/src/lib/format/picker-options.mjs +46 -0
- package/src/lib/format/picker-options.mjs.map +1 -0
- package/src/lib/format/references.d.mts +9 -0
- package/src/lib/format/references.d.ts +9 -0
- package/src/lib/format/references.js +96 -1
- package/src/lib/format/references.js.map +1 -1
- package/src/lib/format/references.mjs +96 -1
- package/src/lib/format/references.mjs.map +1 -1
- package/src/lib/format/section-checks.d.mts +10 -0
- package/src/lib/format/section-checks.d.ts +10 -0
- package/src/lib/format/section-checks.js +35 -0
- package/src/lib/format/section-checks.js.map +1 -0
- package/src/lib/format/section-checks.mjs +31 -0
- package/src/lib/format/section-checks.mjs.map +1 -0
- package/src/lib/format/translate.js +14 -4
- package/src/lib/format/translate.js.map +1 -1
- package/src/lib/format/translate.mjs +14 -4
- package/src/lib/format/translate.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/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 +56 -2
- package/src/lib/record/form.d.ts +56 -2
- package/src/lib/record/form.js +293 -26
- package/src/lib/record/form.js.map +1 -1
- package/src/lib/record/form.mjs +295 -28
- 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 +13 -2
- package/src/lib/record/locales/ar.js.map +1 -1
- package/src/lib/record/locales/ar.mjs +13 -2
- package/src/lib/record/locales/ar.mjs.map +1 -1
- package/src/lib/record/locales/de.js +13 -2
- package/src/lib/record/locales/de.js.map +1 -1
- package/src/lib/record/locales/de.mjs +13 -2
- package/src/lib/record/locales/de.mjs.map +1 -1
- package/src/lib/record/locales/fr.js +13 -2
- package/src/lib/record/locales/fr.js.map +1 -1
- package/src/lib/record/locales/fr.mjs +13 -2
- package/src/lib/record/locales/fr.mjs.map +1 -1
- package/src/lib/record/memory-data-source.d.mts +7 -0
- package/src/lib/record/memory-data-source.d.ts +7 -0
- package/src/lib/record/memory-data-source.js +24 -2
- package/src/lib/record/memory-data-source.js.map +1 -1
- package/src/lib/record/memory-data-source.mjs +24 -2
- package/src/lib/record/memory-data-source.mjs.map +1 -1
- package/src/lib/record/messages.d.mts +22 -0
- package/src/lib/record/messages.d.ts +22 -0
- package/src/lib/record/messages.js +13 -2
- package/src/lib/record/messages.js.map +1 -1
- package/src/lib/record/messages.mjs +13 -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 +10 -2
- package/src/lib/record/run.d.ts +10 -2
- package/src/lib/record/run.js +8 -1
- package/src/lib/record/run.js.map +1 -1
- package/src/lib/record/run.mjs +8 -1
- 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/values.d.mts +4 -0
- package/src/lib/record/values.d.ts +4 -0
- package/src/lib/record/values.js.map +1 -1
- package/src/lib/record/values.mjs.map +1 -1
- package/src/runtime.d.mts +7 -3
- package/src/runtime.d.ts +7 -3
- package/src/runtime.js +31 -1
- package/src/runtime.js.map +1 -1
- package/src/runtime.mjs +5 -2
- package/src/runtime.mjs.map +1 -1
package/src/lib/format/page.js
CHANGED
|
@@ -49,10 +49,13 @@ exports.PageSchema = z
|
|
|
49
49
|
labels: z.enum(['above', 'beside', 'hidden']).optional(),
|
|
50
50
|
labelWidth: z.int().min(60).max(320).optional(),
|
|
51
51
|
helpShown: layout_1.HelpShownSchema.optional(),
|
|
52
|
+
lockAt: z.enum(['label', 'value']).optional(),
|
|
52
53
|
readonlyShown: z.enum(['text', 'box']).optional(),
|
|
54
|
+
quietHints: z.boolean().optional(),
|
|
53
55
|
scheme: z.enum(['light', 'dark', 'auto']).optional(),
|
|
54
56
|
parts: PartsLookSchema.optional(),
|
|
55
57
|
skin: z.enum(themes_3.SKINS).optional(),
|
|
58
|
+
dateOrder: z.enum(['dmy', 'mdy', 'ymd']).optional(),
|
|
56
59
|
})
|
|
57
60
|
.optional(),
|
|
58
61
|
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,uCAA2C;
|
|
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,uCAA2C;AAE3C,qCAA2C;AAAlC,yGAAA,cAAc,OAAA;AAiGV,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;AAEH,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;AACrD,MAAM,OAAO,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AACpD,MAAM,YAAY,GAAmD;IACnE,UAAU,EAAE,MAAM;IAClB,MAAM,EAAE,MAAM;IACd,OAAO,EAAE,OAAO;IAChB,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,E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C,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,kCAAkC,CAAC,CAAC,QAAQ,EAAE;IACzE,YAAY,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,kCAAkC,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,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
|
@@ -44,10 +44,13 @@ export const PageSchema = z
|
|
|
44
44
|
labels: z.enum(['above', 'beside', 'hidden']).optional(),
|
|
45
45
|
labelWidth: z.int().min(60).max(320).optional(),
|
|
46
46
|
helpShown: HelpShownSchema.optional(),
|
|
47
|
+
lockAt: z.enum(['label', 'value']).optional(),
|
|
47
48
|
readonlyShown: z.enum(['text', 'box']).optional(),
|
|
49
|
+
quietHints: z.boolean().optional(),
|
|
48
50
|
scheme: z.enum(['light', 'dark', 'auto']).optional(),
|
|
49
51
|
parts: PartsLookSchema.optional(),
|
|
50
52
|
skin: z.enum(SKINS).optional(),
|
|
53
|
+
dateOrder: z.enum(['dmy', 'mdy', 'ymd']).optional(),
|
|
51
54
|
})
|
|
52
55
|
.optional(),
|
|
53
56
|
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,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AQ,EAAE;QAClC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,QAAQ,EAAE;QACpD,KAAK,EAAE,eAAe,CAAC,QAAQ,EAAE;QACjC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE;QAC9B,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,QAAQ,EAAE;KACpD,CAAC;SACD,QAAQ,EAAE;IACb,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,kCAAkC,CAAC,CAAC,QAAQ,EAAE;IACzE,YAAY,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,kCAAkC,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,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"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
/** A path picker: `"widget": "path"` on a many2one. */
|
|
3
|
+
export declare const PathPickerOptionsSchema: z.ZodObject<{
|
|
4
|
+
separator: z.ZodOptional<z.ZodString>;
|
|
5
|
+
suggestions: z.ZodOptional<z.ZodNumber>;
|
|
6
|
+
tree: z.ZodOptional<z.ZodBoolean>;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
/** A state's dot: `"widget": "dot"` on a selection. */
|
|
9
|
+
export declare const StateDotOptionsSchema: z.ZodObject<{
|
|
10
|
+
colours: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
11
|
+
listDots: z.ZodOptional<z.ZodBoolean>;
|
|
12
|
+
}, z.core.$strip>;
|
|
13
|
+
export type PathPickerOptions = z.infer<typeof PathPickerOptionsSchema>;
|
|
14
|
+
export type StateDotOptions = z.infer<typeof StateDotOptionsSchema>;
|
|
15
|
+
/** The issues of a field node's picker settings, each at its path under `options`. */
|
|
16
|
+
export declare function pickerOptionIssues(node: {
|
|
17
|
+
widget?: string;
|
|
18
|
+
options?: Record<string, unknown>;
|
|
19
|
+
}): {
|
|
20
|
+
message: string;
|
|
21
|
+
path: (string | number)[];
|
|
22
|
+
}[];
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
/** A path picker: `"widget": "path"` on a many2one. */
|
|
3
|
+
export declare const PathPickerOptionsSchema: z.ZodObject<{
|
|
4
|
+
separator: z.ZodOptional<z.ZodString>;
|
|
5
|
+
suggestions: z.ZodOptional<z.ZodNumber>;
|
|
6
|
+
tree: z.ZodOptional<z.ZodBoolean>;
|
|
7
|
+
}, z.z.core.$strip>;
|
|
8
|
+
/** A state's dot: `"widget": "dot"` on a selection. */
|
|
9
|
+
export declare const StateDotOptionsSchema: z.ZodObject<{
|
|
10
|
+
colours: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
11
|
+
listDots: z.ZodOptional<z.ZodBoolean>;
|
|
12
|
+
}, z.z.core.$strip>;
|
|
13
|
+
export type PathPickerOptions = z.infer<typeof PathPickerOptionsSchema>;
|
|
14
|
+
export type StateDotOptions = z.infer<typeof StateDotOptionsSchema>;
|
|
15
|
+
/** The issues of a field node's picker settings, each at its path under `options`. */
|
|
16
|
+
export declare function pickerOptionIssues(node: {
|
|
17
|
+
widget?: string;
|
|
18
|
+
options?: Record<string, unknown>;
|
|
19
|
+
}): {
|
|
20
|
+
message: string;
|
|
21
|
+
path: (string | number)[];
|
|
22
|
+
}[];
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StateDotOptionsSchema = exports.PathPickerOptionsSchema = void 0;
|
|
4
|
+
exports.pickerOptionIssues = pickerOptionIssues;
|
|
5
|
+
const z = require("zod");
|
|
6
|
+
/**
|
|
7
|
+
* The pickers' own settings in a field's `options`, as a work tracker draws
|
|
8
|
+
* them: a path picker for a record of a tree (`"widget": "path"` on a
|
|
9
|
+
* many2one: an area, an iteration), Fieldia's own list for a choice
|
|
10
|
+
* (`"list": "own"`), a state's dots in exact colours and its list with a tick
|
|
11
|
+
* alone (`"widget": "dot"`), and tags added from a button (`"adder":
|
|
12
|
+
* "button"`). Known to the format, so a word written wrong is refused before
|
|
13
|
+
* anything draws; the other settings these widgets take (a link's picture,
|
|
14
|
+
* a dot's tones) stay as they are.
|
|
15
|
+
*/
|
|
16
|
+
const COLOUR = /^#[0-9a-fA-F]{6}$/;
|
|
17
|
+
/** A path picker: `"widget": "path"` on a many2one. */
|
|
18
|
+
exports.PathPickerOptionsSchema = z
|
|
19
|
+
.object({
|
|
20
|
+
/** What joins the names of a path: "\" unless said. */
|
|
21
|
+
separator: z.string().min(1).max(3).optional(),
|
|
22
|
+
/** How many the list suggests first — the value and the person's latest picks: 5 unless said, 0 for none. */
|
|
23
|
+
suggestions: z.number().int().min(0).max(20).optional(),
|
|
24
|
+
/** The tree of every record under the suggestions: shown unless false. */
|
|
25
|
+
tree: z.boolean().optional(),
|
|
26
|
+
})
|
|
27
|
+
.meta({ id: 'PathPickerOptions' });
|
|
28
|
+
/** A state's dot: `"widget": "dot"` on a selection. */
|
|
29
|
+
exports.StateDotOptionsSchema = z
|
|
30
|
+
.object({
|
|
31
|
+
/** Each value's own colour, as #rrggbb: it wins over the value's tone. */
|
|
32
|
+
colours: z.record(z.string(), z.string().regex(COLOUR, 'a colour is #rrggbb, such as "#007acc"')).optional(),
|
|
33
|
+
/** False: the list of states shows a tick by the one picked, and no dots. */
|
|
34
|
+
listDots: z.boolean().optional(),
|
|
35
|
+
})
|
|
36
|
+
.meta({ id: 'StateDotOptions' });
|
|
37
|
+
/** The settings any picker of these may have on a node of the widget it names. */
|
|
38
|
+
const SHARED = z.object({
|
|
39
|
+
/** "own": Fieldia's own list in place of the browser's, a tick by the option picked (a choice with no widget). */
|
|
40
|
+
list: z.literal('own', { error: 'list is "own": Fieldia’s own list in place of the browser’s' }).optional(),
|
|
41
|
+
/** "button": tags are added from a button that turns into the tag box ("Add Tag"). */
|
|
42
|
+
adder: z.literal('button', { error: 'adder is "button": tags added from a button that turns into the tag box' }).optional(),
|
|
43
|
+
});
|
|
44
|
+
/** The issues of a field node's picker settings, each at its path under `options`. */
|
|
45
|
+
function pickerOptionIssues(node) {
|
|
46
|
+
const options = node.options ?? {};
|
|
47
|
+
const schemas = [SHARED, ...(node.widget === 'path' ? [exports.PathPickerOptionsSchema] : []), ...(node.widget === 'dot' ? [exports.StateDotOptionsSchema] : [])];
|
|
48
|
+
return schemas.flatMap((schema) => (schema.safeParse(options).error?.issues ?? []).map((issue) => ({ message: issue.message, path: ['options', ...issue.path] })));
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=picker-options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"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DAA6D,EAAE,CAAC,CAAC,QAAQ,EAAE;IAC3G,sFAAsF;IACtF,KAAK,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,yEAAyE,EAAE,CAAC,CAAC,QAAQ,EAAE;CAC5H,CAAC,CAAC;AAKH,sFAAsF;AACtF,SAAgB,kBAAkB,CAAC,IAA4D;IAC7F,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,EAAE,CAAC;IACnC,MAAM,OAAO,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,+BAAuB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,IAAI,CAAC,MAAM,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,6BAAqB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAClJ,OAAO,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,MAAM,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,SAAS,EAAE,GAAG,KAAK,CAAC,IAAI,CAAwB,EAAE,CAAC,CAAC,CAAC,CAAC;AAC5L,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* The pickers' own settings in a field's `options`, as a work tracker draws
|
|
4
|
+
* them: a path picker for a record of a tree (`"widget": "path"` on a
|
|
5
|
+
* many2one: an area, an iteration), Fieldia's own list for a choice
|
|
6
|
+
* (`"list": "own"`), a state's dots in exact colours and its list with a tick
|
|
7
|
+
* alone (`"widget": "dot"`), and tags added from a button (`"adder":
|
|
8
|
+
* "button"`). Known to the format, so a word written wrong is refused before
|
|
9
|
+
* anything draws; the other settings these widgets take (a link's picture,
|
|
10
|
+
* a dot's tones) stay as they are.
|
|
11
|
+
*/
|
|
12
|
+
const COLOUR = /^#[0-9a-fA-F]{6}$/;
|
|
13
|
+
/** A path picker: `"widget": "path"` on a many2one. */
|
|
14
|
+
export const PathPickerOptionsSchema = z
|
|
15
|
+
.object({
|
|
16
|
+
/** What joins the names of a path: "\" unless said. */
|
|
17
|
+
separator: z.string().min(1).max(3).optional(),
|
|
18
|
+
/** How many the list suggests first — the value and the person's latest picks: 5 unless said, 0 for none. */
|
|
19
|
+
suggestions: z.number().int().min(0).max(20).optional(),
|
|
20
|
+
/** The tree of every record under the suggestions: shown unless false. */
|
|
21
|
+
tree: z.boolean().optional(),
|
|
22
|
+
})
|
|
23
|
+
.meta({ id: 'PathPickerOptions' });
|
|
24
|
+
/** A state's dot: `"widget": "dot"` on a selection. */
|
|
25
|
+
export const StateDotOptionsSchema = z
|
|
26
|
+
.object({
|
|
27
|
+
/** Each value's own colour, as #rrggbb: it wins over the value's tone. */
|
|
28
|
+
colours: z.record(z.string(), z.string().regex(COLOUR, 'a colour is #rrggbb, such as "#007acc"')).optional(),
|
|
29
|
+
/** False: the list of states shows a tick by the one picked, and no dots. */
|
|
30
|
+
listDots: z.boolean().optional(),
|
|
31
|
+
})
|
|
32
|
+
.meta({ id: 'StateDotOptions' });
|
|
33
|
+
/** The settings any picker of these may have on a node of the widget it names. */
|
|
34
|
+
const SHARED = z.object({
|
|
35
|
+
/** "own": Fieldia's own list in place of the browser's, a tick by the option picked (a choice with no widget). */
|
|
36
|
+
list: z.literal('own', { error: 'list is "own": Fieldia’s own list in place of the browser’s' }).optional(),
|
|
37
|
+
/** "button": tags are added from a button that turns into the tag box ("Add Tag"). */
|
|
38
|
+
adder: z.literal('button', { error: 'adder is "button": tags added from a button that turns into the tag box' }).optional(),
|
|
39
|
+
});
|
|
40
|
+
/** The issues of a field node's picker settings, each at its path under `options`. */
|
|
41
|
+
export function pickerOptionIssues(node) {
|
|
42
|
+
const options = node.options ?? {};
|
|
43
|
+
const schemas = [SHARED, ...(node.widget === 'path' ? [PathPickerOptionsSchema] : []), ...(node.widget === 'dot' ? [StateDotOptionsSchema] : [])];
|
|
44
|
+
return schemas.flatMap((schema) => (schema.safeParse(options).error?.issues ?? []).map((issue) => ({ message: issue.message, path: ['options', ...issue.path] })));
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=picker-options.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"picker-options.mjs","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/format/picker-options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB;;;;;;;;;GASG;AAEH,MAAM,MAAM,GAAG,mBAAmB,CAAC;AAEnC,uDAAuD;AACvD,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC;KACrC,MAAM,CAAC;IACN,uDAAuD;IACvD,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC9C,6GAA6G;IAC7G,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;IACvD,0EAA0E;IAC1E,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CAC7B,CAAC;KACD,IAAI,CAAC,EAAE,EAAE,EAAE,mBAAmB,EAAE,CAAC,CAAC;AAErC,uDAAuD;AACvD,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC;KACnC,MAAM,CAAC;IACN,0EAA0E;IAC1E,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,C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E,CAAC,SAAS,EAAE,GAAG,KAAK,CAAC,IAAI,CAAwB,EAAE,CAAC,CAAC,CAAC,CAAC;AAC5L,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 drawn as a backlog: each column's cells are a column's, a lead's
|
|
96
|
+
* icon is by a field's values; the filter bar's fields can list their
|
|
97
|
+
* values; rows nest under a link to the list's own records; and buttons for
|
|
98
|
+
* the rows chosen need a box to choose one.
|
|
99
|
+
*/
|
|
100
|
+
private checkListCells;
|
|
94
101
|
/** A list's map: where each record is, and the fields its pin and its card show, each of a type that can. */
|
|
95
102
|
private walkListMap;
|
|
96
103
|
/**
|
|
@@ -112,5 +119,7 @@ export declare class ReferenceCheck {
|
|
|
112
119
|
private walkSheet;
|
|
113
120
|
/** An address with suggestions: a char field, its place kept as a place field keeps one, its parts in a json field. */
|
|
114
121
|
private checkAddressSearch;
|
|
122
|
+
/** A picker's own settings, on the kind of field each is for: a path on a link, Fieldia's own list on a choice, a button adding tags, a colour for each state. */
|
|
123
|
+
private checkPicker;
|
|
115
124
|
private checkFieldNode;
|
|
116
125
|
}
|
|
@@ -91,6 +91,13 @@ export declare class ReferenceCheck {
|
|
|
91
91
|
private walkFooter;
|
|
92
92
|
private walkRoot;
|
|
93
93
|
private walkList;
|
|
94
|
+
/**
|
|
95
|
+
* A list drawn as a backlog: each column's cells are a column's, a lead's
|
|
96
|
+
* icon is by a field's values; the filter bar's fields can list their
|
|
97
|
+
* values; rows nest under a link to the list's own records; and buttons for
|
|
98
|
+
* the rows chosen need a box to choose one.
|
|
99
|
+
*/
|
|
100
|
+
private checkListCells;
|
|
94
101
|
/** A list's map: where each record is, and the fields its pin and its card show, each of a type that can. */
|
|
95
102
|
private walkListMap;
|
|
96
103
|
/**
|
|
@@ -112,5 +119,7 @@ export declare class ReferenceCheck {
|
|
|
112
119
|
private walkSheet;
|
|
113
120
|
/** An address with suggestions: a char field, its place kept as a place field keeps one, its parts in a json field. */
|
|
114
121
|
private checkAddressSearch;
|
|
122
|
+
/** A picker's own settings, on the kind of field each is for: a path on a link, Fieldia's own list on a choice, a button adding tags, a colour for each state. */
|
|
123
|
+
private checkPicker;
|
|
115
124
|
private checkFieldNode;
|
|
116
125
|
}
|
|
@@ -7,10 +7,16 @@ const expression_1 = require("../expression/expression");
|
|
|
7
7
|
const order_1 = require("../expression/order");
|
|
8
8
|
const words_1 = require("./words");
|
|
9
9
|
const hotkeys_1 = require("./hotkeys");
|
|
10
|
+
const head_checks_1 = require("./head-checks");
|
|
11
|
+
const section_checks_1 = require("./section-checks");
|
|
12
|
+
const pattern_1 = require("./pattern");
|
|
13
|
+
const messages_1 = require("../record/messages");
|
|
10
14
|
const has = (record, key) => Object.prototype.hasOwnProperty.call(record, key);
|
|
11
15
|
/** The kinds of field an expression can give a value to: the rest hold records, lines or files. */
|
|
12
16
|
const EXPRESSIBLE = new Set(['char', 'text', 'html', 'integer', 'float', 'monetary', 'boolean', 'date', 'datetime', 'selection', 'json']);
|
|
13
17
|
const EXPRESSIBLE_WORDS = 'text, numbers, yes or no, dates, choices and json can';
|
|
18
|
+
/** The kinds of field a list's filter bar can list the values of. */
|
|
19
|
+
const LISTS_ITS_VALUES = new Set(['selection', 'many2one', 'many2many', 'boolean', 'char', 'integer']);
|
|
14
20
|
/** Names quoted and joined as a person lists them: "a", "b" and "c". */
|
|
15
21
|
const listed = (names) => {
|
|
16
22
|
const quoted = names.map((name) => `"${name}"`);
|
|
@@ -34,6 +40,17 @@ class ReferenceCheck {
|
|
|
34
40
|
run() {
|
|
35
41
|
this.checkFields(this.page.fields, 'fields', this.line?.name, this.line?.parent);
|
|
36
42
|
this.walkRoot(this.page.layout, 'layout');
|
|
43
|
+
(0, head_checks_1.checkHead)(this.page.layout, 'layout', {
|
|
44
|
+
claim: (id, path) => this.claim(id, path),
|
|
45
|
+
need: (name, path) => this.need(name, path),
|
|
46
|
+
report: (path, message) => this.report(path, message),
|
|
47
|
+
walkNode: (node, path) => this.walkNode(node, path),
|
|
48
|
+
checkModifiers: (owner, path, keys) => this.checkModifiers(owner, path, keys),
|
|
49
|
+
checkSteps: (steps, path) => this.checkSteps(steps, path),
|
|
50
|
+
checkPress: (button, path) => this.checkPress(button, path),
|
|
51
|
+
isPart: (id) => this.ids.has(id),
|
|
52
|
+
isPlace: (id) => this.places.has(id),
|
|
53
|
+
});
|
|
37
54
|
if (this.page.on)
|
|
38
55
|
this.checkEvents(this.page.on, 'on');
|
|
39
56
|
this.checkGoingTo();
|
|
@@ -80,8 +97,12 @@ class ReferenceCheck {
|
|
|
80
97
|
}
|
|
81
98
|
/** A press: steps, an app action, or both — and its steps checked. */
|
|
82
99
|
checkPress(button, path) {
|
|
83
|
-
|
|
100
|
+
// A button with a menu of its own and nothing else is a menu button.
|
|
101
|
+
const menu = 'menu' in button && !!button.menu?.length;
|
|
102
|
+
if (!button.steps && button.action === undefined && !menu)
|
|
84
103
|
this.report(path, 'a button needs steps, an action, or both');
|
|
104
|
+
if ('type' in button && button.type === 'button')
|
|
105
|
+
(0, head_checks_1.checkButtonParts)(button, path, { claim: (id, at) => this.claim(id, at), report: (at, message) => this.report(at, message), checkModifiers: (owner, at, keys) => this.checkModifiers(owner, at, keys), checkSteps: (steps, at) => this.checkSteps(steps, at) });
|
|
85
106
|
const key = 'hotkey' in button ? button.hotkey : undefined;
|
|
86
107
|
if (typeof key === 'string' && hotkeys_1.BROWSER_HOTKEYS.includes(key.replace('shift+', '')))
|
|
87
108
|
this.report(`${path}.hotkey`, `${(0, hotkeys_1.hotkeyWords)(key)} is the browser’s own: pick another key`);
|
|
@@ -360,6 +381,12 @@ class ReferenceCheck {
|
|
|
360
381
|
if ((def.type === 'many2one' || def.type === 'many2many') && def.filter) {
|
|
361
382
|
def.filter.forEach((item, i) => this.checkFilterItem(item, `${path}.filter[${i}]`, scope));
|
|
362
383
|
}
|
|
384
|
+
// A pattern reads, or the page says why: a person's Save never ends on a pattern the page got wrong.
|
|
385
|
+
if (def.type === 'char' && def.pattern !== undefined) {
|
|
386
|
+
const pattern = (0, pattern_1.fieldPattern)(def.pattern);
|
|
387
|
+
if (pattern instanceof Error)
|
|
388
|
+
this.report(`${path}.pattern`, (0, messages_1.fill)(messages_1.MESSAGES.en.patternBroken, { label: def.label, problem: pattern.message }));
|
|
389
|
+
}
|
|
363
390
|
if (def.type === 'selection')
|
|
364
391
|
def.optionsFrom?.dependsOn?.forEach((other, i) => this.need(other, `${path}.optionsFrom.dependsOn[${i}]`, fields));
|
|
365
392
|
if (def.type === 'properties')
|
|
@@ -488,6 +515,52 @@ class ReferenceCheck {
|
|
|
488
515
|
});
|
|
489
516
|
if (list.map)
|
|
490
517
|
this.walkListMap(list.map, `${path}.map`);
|
|
518
|
+
this.checkListCells(list, path);
|
|
519
|
+
}
|
|
520
|
+
/**
|
|
521
|
+
* A list drawn as a backlog: each column's cells are a column's, a lead's
|
|
522
|
+
* icon is by a field's values; the filter bar's fields can list their
|
|
523
|
+
* values; rows nest under a link to the list's own records; and buttons for
|
|
524
|
+
* the rows chosen need a box to choose one.
|
|
525
|
+
*/
|
|
526
|
+
checkListCells(list, path) {
|
|
527
|
+
for (const [column, cell] of Object.entries(list.cells ?? {})) {
|
|
528
|
+
const at = `${path}.cells.${column}`;
|
|
529
|
+
if (!list.columns.includes(column)) {
|
|
530
|
+
this.report(at, `"${column}" is no column of this list: its cells are for its columns`);
|
|
531
|
+
continue;
|
|
532
|
+
}
|
|
533
|
+
if (!cell.lead)
|
|
534
|
+
continue;
|
|
535
|
+
const def = this.need(cell.lead.field, `${at}.lead.field`);
|
|
536
|
+
if (def?.type !== 'selection')
|
|
537
|
+
continue;
|
|
538
|
+
const values = new Set(def.options.map((option) => String(option.value)));
|
|
539
|
+
for (const value of Object.keys(cell.lead.looks))
|
|
540
|
+
if (!values.has(value))
|
|
541
|
+
this.report(`${at}.lead.looks.${value}`, `"${value}" is no value of "${cell.lead.field}"`);
|
|
542
|
+
}
|
|
543
|
+
if (list.filterFields && list.search !== 'fields')
|
|
544
|
+
this.report(`${path}.filterFields`, 'the filter fields are for the "fields" search: add "search": "fields"');
|
|
545
|
+
list.filterFields?.forEach((name, i) => {
|
|
546
|
+
const def = this.need(name, `${path}.filterFields[${i}]`);
|
|
547
|
+
if (def && !LISTS_ITS_VALUES.has(def.type))
|
|
548
|
+
this.report(`${path}.filterFields[${i}]`, `"${name}" is a ${def.type}; a filter lists the values of a choice, a link, links, a yes or no, text or a whole number`);
|
|
549
|
+
});
|
|
550
|
+
// A filter's own name is for a filter the bar offers.
|
|
551
|
+
for (const name of Object.keys(list.filterLabels ?? {})) {
|
|
552
|
+
if (!list.filterFields?.includes(name))
|
|
553
|
+
this.report(`${path}.filterLabels.${name}`, `"${name}" is no field of filterFields: its name is for a filter the bar offers`);
|
|
554
|
+
}
|
|
555
|
+
if (list.parentField !== undefined) {
|
|
556
|
+
const def = this.need(list.parentField, `${path}.parentField`);
|
|
557
|
+
const model = this.page.data.kind === 'record' ? this.page.data.model : '';
|
|
558
|
+
if (def && (def.type !== 'many2one' || def.relation !== model)) {
|
|
559
|
+
this.report(`${path}.parentField`, `"${list.parentField}" ${def.type === 'many2one' ? `links to ${def.relation}` : `is a ${def.type}`}; a parent is a many2one to the list’s own model, ${model}`);
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
if (list.choose === false && list.actions?.length)
|
|
563
|
+
this.report(`${path}.actions`, 'a list’s buttons act on the rows chosen: with "choose": false there is no way to choose one');
|
|
491
564
|
}
|
|
492
565
|
/** A list's map: where each record is, and the fields its pin and its card show, each of a type that can. */
|
|
493
566
|
walkListMap(map, path) {
|
|
@@ -671,6 +744,7 @@ class ReferenceCheck {
|
|
|
671
744
|
this.report(`${path}.children[${i}]`, `a line of parts holds fields, words and buttons; a ${child.type} needs a row of its own`);
|
|
672
745
|
});
|
|
673
746
|
}
|
|
747
|
+
(0, section_checks_1.checkSectionTracks)(node, path, (at, message) => this.report(at, message));
|
|
674
748
|
return this.walkChildren(node.children, path);
|
|
675
749
|
case 'tabs':
|
|
676
750
|
return this.walkTabs(node, path);
|
|
@@ -839,6 +913,25 @@ class ReferenceCheck {
|
|
|
839
913
|
if (parts && parts !== 'json')
|
|
840
914
|
this.report(`${path}.options.partsField`, `"${options['partsField']}" is a ${parts}; an address's parts are kept in a json field`);
|
|
841
915
|
}
|
|
916
|
+
/** A picker's own settings, on the kind of field each is for: a path on a link, Fieldia's own list on a choice, a button adding tags, a colour for each state. */
|
|
917
|
+
checkPicker(node, def, path) {
|
|
918
|
+
const options = node.options ?? {};
|
|
919
|
+
if (node.widget === 'path' && def.type !== 'many2one')
|
|
920
|
+
this.report(`${path}.widget`, `path is for a many2one field; "${node.field}" is a ${def.type}`);
|
|
921
|
+
const single = def.type === 'selection' && !def.multiple && !node.widget;
|
|
922
|
+
if (options['list'] !== undefined && !single)
|
|
923
|
+
this.report(`${path}.options.list`, `list "own" is for a choice of one drawn as a list, with no widget; "${node.field}" is ${def.type === 'selection' ? `a selection${def.multiple ? ' of several' : ` drawn as ${node.widget}`}` : `a ${def.type}`}`);
|
|
924
|
+
const tags = (def.type === 'many2many' && (!node.widget || node.widget === 'tags') && !node.columns?.length) || (def.type === 'char' && node.widget === 'tags');
|
|
925
|
+
if (options['adder'] !== undefined && !tags)
|
|
926
|
+
this.report(`${path}.options.adder`, `adder is for tags: a many2many, or a char field drawn as tags; "${node.field}" is ${node.widget ? `a ${def.type} drawn as ${node.widget}` : `a ${def.type}`}`);
|
|
927
|
+
const colours = options['colours'];
|
|
928
|
+
if (node.widget === 'dot' && def.type === 'selection' && colours && typeof colours === 'object' && !Array.isArray(colours)) {
|
|
929
|
+
const values = new Set(def.options.map((option) => String(option.value)));
|
|
930
|
+
for (const value of Object.keys(colours))
|
|
931
|
+
if (!values.has(value))
|
|
932
|
+
this.report(`${path}.options.colours.${value}`, `"${value}" is not a value of "${node.field}"`);
|
|
933
|
+
}
|
|
934
|
+
}
|
|
842
935
|
checkFieldNode(node, path) {
|
|
843
936
|
const def = this.need(node.field, `${path}.field`);
|
|
844
937
|
// Answer rules: each condition and rule across fields reads, each pattern is a regular expression.
|
|
@@ -887,6 +980,8 @@ class ReferenceCheck {
|
|
|
887
980
|
}
|
|
888
981
|
if (node.widget === 'address-search')
|
|
889
982
|
this.checkAddressSearch(node, def, path);
|
|
983
|
+
if (def)
|
|
984
|
+
this.checkPicker(node, def, path);
|
|
890
985
|
// The order lines load in: fields of its lines.
|
|
891
986
|
if (def && node.order) {
|
|
892
987
|
if (def.type !== 'one2many')
|