@fieldia/core 0.19.1 → 0.20.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 +777 -65
- 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/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 +1486 -164
- package/src/lib/format/page.d.ts +1486 -164
- package/src/lib/format/page.js +2 -0
- package/src/lib/format/page.js.map +1 -1
- package/src/lib/format/page.mjs +2 -0
- package/src/lib/format/page.mjs.map +1 -1
- 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 +88 -1
- package/src/lib/format/references.js.map +1 -1
- package/src/lib/format/references.mjs +88 -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 +11 -2
- package/src/lib/format/translate.js.map +1 -1
- package/src/lib/format/translate.mjs +11 -2
- package/src/lib/format/translate.mjs.map +1 -1
- package/src/lib/record/form.d.mts +12 -2
- package/src/lib/record/form.d.ts +12 -2
- package/src/lib/record/form.js +44 -6
- package/src/lib/record/form.js.map +1 -1
- package/src/lib/record/form.mjs +44 -6
- package/src/lib/record/form.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 +19 -1
- package/src/lib/record/memory-data-source.js.map +1 -1
- package/src/lib/record/memory-data-source.mjs +19 -1
- package/src/lib/record/memory-data-source.mjs.map +1 -1
- package/src/lib/record/run.d.mts +7 -0
- package/src/lib/record/run.d.ts +7 -0
- package/src/lib/record/run.js +7 -0
- package/src/lib/record/run.js.map +1 -1
- package/src/lib/record/run.mjs +7 -0
- package/src/lib/record/run.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 +2 -1
- package/src/runtime.d.ts +2 -1
- package/src/runtime.js.map +1 -1
- package/src/runtime.mjs.map +1 -1
package/src/lib/format/page.js
CHANGED
|
@@ -49,7 +49,9 @@ 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(),
|
|
@@ -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;AAC3C,qCAA2C;AAAlC,yGAAA,cAAc,OAAA;
|
|
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;AAC3C,qCAA2C;AAAlC,yGAAA,cAAc,OAAA;AA2FV,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,MAA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AAQ,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,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,7 +44,9 @@ 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(),
|
|
@@ -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,aA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AM,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;KAC/B,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,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
|
+
{"version":3,"file":"picker-options.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/format/picker-options.ts"],"names":[],"mappings":";;;AAiDA,gDAIC;AArDD,yBAAyB;AAEzB;;;;;;;;;GASG;AAEH,MAAM,MAAM,GAAG,mBAAmB,CAAC;AAEnC,uDAAuD;AAC1C,QAAA,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,IA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,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,uDA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A4D;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,uBAAuB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,IAAI,CAAC,MAAM,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,qBAAqB,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"}
|
|
@@ -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,14 @@ 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");
|
|
10
12
|
const has = (record, key) => Object.prototype.hasOwnProperty.call(record, key);
|
|
11
13
|
/** The kinds of field an expression can give a value to: the rest hold records, lines or files. */
|
|
12
14
|
const EXPRESSIBLE = new Set(['char', 'text', 'html', 'integer', 'float', 'monetary', 'boolean', 'date', 'datetime', 'selection', 'json']);
|
|
13
15
|
const EXPRESSIBLE_WORDS = 'text, numbers, yes or no, dates, choices and json can';
|
|
16
|
+
/** The kinds of field a list's filter bar can list the values of. */
|
|
17
|
+
const LISTS_ITS_VALUES = new Set(['selection', 'many2one', 'many2many', 'boolean', 'char', 'integer']);
|
|
14
18
|
/** Names quoted and joined as a person lists them: "a", "b" and "c". */
|
|
15
19
|
const listed = (names) => {
|
|
16
20
|
const quoted = names.map((name) => `"${name}"`);
|
|
@@ -34,6 +38,17 @@ class ReferenceCheck {
|
|
|
34
38
|
run() {
|
|
35
39
|
this.checkFields(this.page.fields, 'fields', this.line?.name, this.line?.parent);
|
|
36
40
|
this.walkRoot(this.page.layout, 'layout');
|
|
41
|
+
(0, head_checks_1.checkHead)(this.page.layout, 'layout', {
|
|
42
|
+
claim: (id, path) => this.claim(id, path),
|
|
43
|
+
need: (name, path) => this.need(name, path),
|
|
44
|
+
report: (path, message) => this.report(path, message),
|
|
45
|
+
walkNode: (node, path) => this.walkNode(node, path),
|
|
46
|
+
checkModifiers: (owner, path, keys) => this.checkModifiers(owner, path, keys),
|
|
47
|
+
checkSteps: (steps, path) => this.checkSteps(steps, path),
|
|
48
|
+
checkPress: (button, path) => this.checkPress(button, path),
|
|
49
|
+
isPart: (id) => this.ids.has(id),
|
|
50
|
+
isPlace: (id) => this.places.has(id),
|
|
51
|
+
});
|
|
37
52
|
if (this.page.on)
|
|
38
53
|
this.checkEvents(this.page.on, 'on');
|
|
39
54
|
this.checkGoingTo();
|
|
@@ -80,8 +95,12 @@ class ReferenceCheck {
|
|
|
80
95
|
}
|
|
81
96
|
/** A press: steps, an app action, or both — and its steps checked. */
|
|
82
97
|
checkPress(button, path) {
|
|
83
|
-
|
|
98
|
+
// A button with a menu of its own and nothing else is a menu button.
|
|
99
|
+
const menu = 'menu' in button && !!button.menu?.length;
|
|
100
|
+
if (!button.steps && button.action === undefined && !menu)
|
|
84
101
|
this.report(path, 'a button needs steps, an action, or both');
|
|
102
|
+
if ('type' in button && button.type === 'button')
|
|
103
|
+
(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
104
|
const key = 'hotkey' in button ? button.hotkey : undefined;
|
|
86
105
|
if (typeof key === 'string' && hotkeys_1.BROWSER_HOTKEYS.includes(key.replace('shift+', '')))
|
|
87
106
|
this.report(`${path}.hotkey`, `${(0, hotkeys_1.hotkeyWords)(key)} is the browser’s own: pick another key`);
|
|
@@ -488,6 +507,52 @@ class ReferenceCheck {
|
|
|
488
507
|
});
|
|
489
508
|
if (list.map)
|
|
490
509
|
this.walkListMap(list.map, `${path}.map`);
|
|
510
|
+
this.checkListCells(list, path);
|
|
511
|
+
}
|
|
512
|
+
/**
|
|
513
|
+
* A list drawn as a backlog: each column's cells are a column's, a lead's
|
|
514
|
+
* icon is by a field's values; the filter bar's fields can list their
|
|
515
|
+
* values; rows nest under a link to the list's own records; and buttons for
|
|
516
|
+
* the rows chosen need a box to choose one.
|
|
517
|
+
*/
|
|
518
|
+
checkListCells(list, path) {
|
|
519
|
+
for (const [column, cell] of Object.entries(list.cells ?? {})) {
|
|
520
|
+
const at = `${path}.cells.${column}`;
|
|
521
|
+
if (!list.columns.includes(column)) {
|
|
522
|
+
this.report(at, `"${column}" is no column of this list: its cells are for its columns`);
|
|
523
|
+
continue;
|
|
524
|
+
}
|
|
525
|
+
if (!cell.lead)
|
|
526
|
+
continue;
|
|
527
|
+
const def = this.need(cell.lead.field, `${at}.lead.field`);
|
|
528
|
+
if (def?.type !== 'selection')
|
|
529
|
+
continue;
|
|
530
|
+
const values = new Set(def.options.map((option) => String(option.value)));
|
|
531
|
+
for (const value of Object.keys(cell.lead.looks))
|
|
532
|
+
if (!values.has(value))
|
|
533
|
+
this.report(`${at}.lead.looks.${value}`, `"${value}" is no value of "${cell.lead.field}"`);
|
|
534
|
+
}
|
|
535
|
+
if (list.filterFields && list.search !== 'fields')
|
|
536
|
+
this.report(`${path}.filterFields`, 'the filter fields are for the "fields" search: add "search": "fields"');
|
|
537
|
+
list.filterFields?.forEach((name, i) => {
|
|
538
|
+
const def = this.need(name, `${path}.filterFields[${i}]`);
|
|
539
|
+
if (def && !LISTS_ITS_VALUES.has(def.type))
|
|
540
|
+
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`);
|
|
541
|
+
});
|
|
542
|
+
// A filter's own name is for a filter the bar offers.
|
|
543
|
+
for (const name of Object.keys(list.filterLabels ?? {})) {
|
|
544
|
+
if (!list.filterFields?.includes(name))
|
|
545
|
+
this.report(`${path}.filterLabels.${name}`, `"${name}" is no field of filterFields: its name is for a filter the bar offers`);
|
|
546
|
+
}
|
|
547
|
+
if (list.parentField !== undefined) {
|
|
548
|
+
const def = this.need(list.parentField, `${path}.parentField`);
|
|
549
|
+
const model = this.page.data.kind === 'record' ? this.page.data.model : '';
|
|
550
|
+
if (def && (def.type !== 'many2one' || def.relation !== model)) {
|
|
551
|
+
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}`);
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
if (list.choose === false && list.actions?.length)
|
|
555
|
+
this.report(`${path}.actions`, 'a list’s buttons act on the rows chosen: with "choose": false there is no way to choose one');
|
|
491
556
|
}
|
|
492
557
|
/** A list's map: where each record is, and the fields its pin and its card show, each of a type that can. */
|
|
493
558
|
walkListMap(map, path) {
|
|
@@ -671,6 +736,7 @@ class ReferenceCheck {
|
|
|
671
736
|
this.report(`${path}.children[${i}]`, `a line of parts holds fields, words and buttons; a ${child.type} needs a row of its own`);
|
|
672
737
|
});
|
|
673
738
|
}
|
|
739
|
+
(0, section_checks_1.checkSectionTracks)(node, path, (at, message) => this.report(at, message));
|
|
674
740
|
return this.walkChildren(node.children, path);
|
|
675
741
|
case 'tabs':
|
|
676
742
|
return this.walkTabs(node, path);
|
|
@@ -839,6 +905,25 @@ class ReferenceCheck {
|
|
|
839
905
|
if (parts && parts !== 'json')
|
|
840
906
|
this.report(`${path}.options.partsField`, `"${options['partsField']}" is a ${parts}; an address's parts are kept in a json field`);
|
|
841
907
|
}
|
|
908
|
+
/** 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. */
|
|
909
|
+
checkPicker(node, def, path) {
|
|
910
|
+
const options = node.options ?? {};
|
|
911
|
+
if (node.widget === 'path' && def.type !== 'many2one')
|
|
912
|
+
this.report(`${path}.widget`, `path is for a many2one field; "${node.field}" is a ${def.type}`);
|
|
913
|
+
const single = def.type === 'selection' && !def.multiple && !node.widget;
|
|
914
|
+
if (options['list'] !== undefined && !single)
|
|
915
|
+
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}`}`);
|
|
916
|
+
const tags = (def.type === 'many2many' && (!node.widget || node.widget === 'tags') && !node.columns?.length) || (def.type === 'char' && node.widget === 'tags');
|
|
917
|
+
if (options['adder'] !== undefined && !tags)
|
|
918
|
+
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}`}`);
|
|
919
|
+
const colours = options['colours'];
|
|
920
|
+
if (node.widget === 'dot' && def.type === 'selection' && colours && typeof colours === 'object' && !Array.isArray(colours)) {
|
|
921
|
+
const values = new Set(def.options.map((option) => String(option.value)));
|
|
922
|
+
for (const value of Object.keys(colours))
|
|
923
|
+
if (!values.has(value))
|
|
924
|
+
this.report(`${path}.options.colours.${value}`, `"${value}" is not a value of "${node.field}"`);
|
|
925
|
+
}
|
|
926
|
+
}
|
|
842
927
|
checkFieldNode(node, path) {
|
|
843
928
|
const def = this.need(node.field, `${path}.field`);
|
|
844
929
|
// Answer rules: each condition and rule across fields reads, each pattern is a regular expression.
|
|
@@ -887,6 +972,8 @@ class ReferenceCheck {
|
|
|
887
972
|
}
|
|
888
973
|
if (node.widget === 'address-search')
|
|
889
974
|
this.checkAddressSearch(node, def, path);
|
|
975
|
+
if (def)
|
|
976
|
+
this.checkPicker(node, def, path);
|
|
890
977
|
// The order lines load in: fields of its lines.
|
|
891
978
|
if (def && node.order) {
|
|
892
979
|
if (def.type !== 'one2many')
|