@fieldia/core 0.9.2 → 0.11.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 +199 -0
- package/package.json +1 -1
- package/schema/page.schema.json +1837 -94
- package/src/index.d.mts +1 -0
- package/src/index.d.ts +1 -0
- package/src/index.js +4 -1
- package/src/index.js.map +1 -1
- package/src/index.mjs +1 -0
- package/src/index.mjs.map +1 -1
- package/src/lib/expression/evaluator.d.mts +6 -5
- package/src/lib/expression/evaluator.d.ts +6 -5
- package/src/lib/expression/evaluator.js +37 -22
- package/src/lib/expression/evaluator.js.map +1 -1
- package/src/lib/expression/evaluator.mjs +32 -18
- package/src/lib/expression/evaluator.mjs.map +1 -1
- package/src/lib/expression/expression.d.mts +21 -0
- package/src/lib/expression/expression.d.ts +21 -0
- package/src/lib/expression/expression.js +29 -0
- package/src/lib/expression/expression.js.map +1 -0
- package/src/lib/expression/expression.mjs +26 -0
- package/src/lib/expression/expression.mjs.map +1 -0
- package/src/lib/expression/extractFieldNames.js +6 -1
- package/src/lib/expression/extractFieldNames.js.map +1 -1
- package/src/lib/expression/extractFieldNames.mjs +6 -1
- package/src/lib/expression/extractFieldNames.mjs.map +1 -1
- package/src/lib/expression/functions.d.mts +35 -0
- package/src/lib/expression/functions.d.ts +35 -0
- package/src/lib/expression/functions.js +129 -0
- package/src/lib/expression/functions.js.map +1 -0
- package/src/lib/expression/functions.mjs +124 -0
- package/src/lib/expression/functions.mjs.map +1 -0
- package/src/lib/expression/modifier.d.mts +3 -1
- package/src/lib/expression/modifier.d.ts +3 -1
- package/src/lib/expression/modifier.js +4 -27
- package/src/lib/expression/modifier.js.map +1 -1
- package/src/lib/expression/modifier.mjs +3 -26
- package/src/lib/expression/modifier.mjs.map +1 -1
- package/src/lib/expression/operations.d.mts +25 -0
- package/src/lib/expression/operations.d.ts +25 -0
- package/src/lib/expression/operations.js +81 -0
- package/src/lib/expression/operations.js.map +1 -0
- package/src/lib/expression/operations.mjs +72 -0
- package/src/lib/expression/operations.mjs.map +1 -0
- package/src/lib/expression/order.d.mts +11 -0
- package/src/lib/expression/order.d.ts +11 -0
- package/src/lib/expression/order.js +36 -0
- package/src/lib/expression/order.js.map +1 -0
- package/src/lib/expression/order.mjs +33 -0
- package/src/lib/expression/order.mjs.map +1 -0
- package/src/lib/expression/parser.d.mts +34 -4
- package/src/lib/expression/parser.d.ts +34 -4
- package/src/lib/expression/parser.js +72 -6
- package/src/lib/expression/parser.js.map +1 -1
- package/src/lib/expression/parser.mjs +72 -6
- package/src/lib/expression/parser.mjs.map +1 -1
- package/src/lib/expression/reads.d.mts +8 -0
- package/src/lib/expression/reads.d.ts +8 -0
- package/src/lib/expression/reads.js +48 -0
- package/src/lib/expression/reads.js.map +1 -0
- package/src/lib/expression/reads.mjs +44 -0
- package/src/lib/expression/reads.mjs.map +1 -0
- package/src/lib/expression/tokenizer.d.mts +7 -6
- package/src/lib/expression/tokenizer.d.ts +7 -6
- package/src/lib/expression/tokenizer.js +28 -18
- package/src/lib/expression/tokenizer.js.map +1 -1
- package/src/lib/expression/tokenizer.mjs +28 -18
- package/src/lib/expression/tokenizer.mjs.map +1 -1
- package/src/lib/format/actions.d.mts +692 -0
- package/src/lib/format/actions.d.ts +692 -0
- package/src/lib/format/actions.js +53 -0
- package/src/lib/format/actions.js.map +1 -0
- package/src/lib/format/actions.mjs +50 -0
- package/src/lib/format/actions.mjs.map +1 -0
- package/src/lib/format/field.d.mts +686 -5
- package/src/lib/format/field.d.ts +686 -5
- package/src/lib/format/field.js +117 -13
- package/src/lib/format/field.js.map +1 -1
- package/src/lib/format/field.mjs +116 -12
- package/src/lib/format/field.mjs.map +1 -1
- package/src/lib/format/layout.d.mts +1130 -22
- package/src/lib/format/layout.d.ts +1130 -22
- package/src/lib/format/layout.js +67 -5
- package/src/lib/format/layout.js.map +1 -1
- package/src/lib/format/layout.mjs +66 -4
- package/src/lib/format/layout.mjs.map +1 -1
- package/src/lib/format/layout.types.d.mts +2 -1
- package/src/lib/format/layout.types.d.ts +2 -1
- package/src/lib/format/names.d.mts +1 -1
- package/src/lib/format/names.d.ts +1 -1
- package/src/lib/format/names.js +1 -0
- package/src/lib/format/names.js.map +1 -1
- package/src/lib/format/names.mjs +1 -0
- package/src/lib/format/names.mjs.map +1 -1
- package/src/lib/format/page.d.mts +1007 -7
- package/src/lib/format/page.d.ts +1007 -7
- package/src/lib/format/page.js +28 -0
- package/src/lib/format/page.js.map +1 -1
- package/src/lib/format/page.mjs +28 -0
- package/src/lib/format/page.mjs.map +1 -1
- package/src/lib/format/part-look.d.mts +36 -0
- package/src/lib/format/part-look.d.ts +36 -0
- package/src/lib/format/part-look.js +23 -0
- package/src/lib/format/part-look.js.map +1 -0
- package/src/lib/format/part-look.mjs +20 -0
- package/src/lib/format/part-look.mjs.map +1 -0
- package/src/lib/format/references.d.mts +33 -1
- package/src/lib/format/references.d.ts +33 -1
- package/src/lib/format/references.js +227 -10
- package/src/lib/format/references.js.map +1 -1
- package/src/lib/format/references.mjs +227 -10
- package/src/lib/format/references.mjs.map +1 -1
- package/src/lib/format/translate.d.mts +20 -0
- package/src/lib/format/translate.d.ts +20 -0
- package/src/lib/format/translate.js +79 -21
- package/src/lib/format/translate.js.map +1 -1
- package/src/lib/format/translate.mjs +76 -21
- package/src/lib/format/translate.mjs.map +1 -1
- package/src/lib/record/check.d.mts +19 -1
- package/src/lib/record/check.d.ts +19 -1
- package/src/lib/record/check.js +84 -21
- package/src/lib/record/check.js.map +1 -1
- package/src/lib/record/check.mjs +82 -21
- package/src/lib/record/check.mjs.map +1 -1
- package/src/lib/record/compute.d.mts +24 -0
- package/src/lib/record/compute.d.ts +24 -0
- package/src/lib/record/compute.js +107 -0
- package/src/lib/record/compute.js.map +1 -0
- package/src/lib/record/compute.mjs +103 -0
- package/src/lib/record/compute.mjs.map +1 -0
- package/src/lib/record/data-source.d.mts +14 -2
- package/src/lib/record/data-source.d.ts +14 -2
- package/src/lib/record/data-source.js.map +1 -1
- package/src/lib/record/data-source.mjs.map +1 -1
- package/src/lib/record/env.d.mts +9 -0
- package/src/lib/record/env.d.ts +9 -0
- package/src/lib/record/env.js +28 -0
- package/src/lib/record/env.js.map +1 -0
- package/src/lib/record/env.mjs +25 -0
- package/src/lib/record/env.mjs.map +1 -0
- package/src/lib/record/form.d.mts +110 -18
- package/src/lib/record/form.d.ts +110 -18
- package/src/lib/record/form.js +497 -72
- package/src/lib/record/form.js.map +1 -1
- package/src/lib/record/form.mjs +497 -72
- package/src/lib/record/form.mjs.map +1 -1
- package/src/lib/record/inputs.d.mts +5 -0
- package/src/lib/record/inputs.d.ts +5 -0
- package/src/lib/record/inputs.js +47 -0
- package/src/lib/record/inputs.js.map +1 -0
- package/src/lib/record/inputs.mjs +44 -0
- package/src/lib/record/inputs.mjs.map +1 -0
- package/src/lib/record/limits.d.mts +13 -0
- package/src/lib/record/limits.d.ts +13 -0
- package/src/lib/record/limits.js +45 -0
- package/src/lib/record/limits.js.map +1 -0
- package/src/lib/record/limits.mjs +41 -0
- package/src/lib/record/limits.mjs.map +1 -0
- package/src/lib/record/locales/all.d.mts +7 -0
- package/src/lib/record/locales/all.d.ts +7 -0
- package/src/lib/record/locales/all.js +13 -0
- package/src/lib/record/locales/all.js.map +1 -0
- package/src/lib/record/locales/all.mjs +10 -0
- package/src/lib/record/locales/all.mjs.map +1 -0
- package/src/lib/record/locales/ar.d.mts +3 -0
- package/src/lib/record/locales/ar.d.ts +3 -0
- package/src/lib/record/locales/ar.js +55 -0
- package/src/lib/record/locales/ar.js.map +1 -0
- package/src/lib/record/locales/ar.mjs +52 -0
- package/src/lib/record/locales/ar.mjs.map +1 -0
- package/src/lib/record/locales/de.d.mts +3 -0
- package/src/lib/record/locales/de.d.ts +3 -0
- package/src/lib/record/locales/de.js +55 -0
- package/src/lib/record/locales/de.js.map +1 -0
- package/src/lib/record/locales/de.mjs +52 -0
- package/src/lib/record/locales/de.mjs.map +1 -0
- package/src/lib/record/locales/fr.d.mts +3 -0
- package/src/lib/record/locales/fr.d.ts +3 -0
- package/src/lib/record/locales/fr.js +55 -0
- package/src/lib/record/locales/fr.js.map +1 -0
- package/src/lib/record/locales/fr.mjs +52 -0
- package/src/lib/record/locales/fr.mjs.map +1 -0
- package/src/lib/record/memory-data-source.d.mts +3 -0
- package/src/lib/record/memory-data-source.d.ts +3 -0
- package/src/lib/record/memory-data-source.js +8 -0
- package/src/lib/record/memory-data-source.js.map +1 -1
- package/src/lib/record/memory-data-source.mjs +8 -0
- package/src/lib/record/memory-data-source.mjs.map +1 -1
- package/src/lib/record/messages.d.mts +46 -0
- package/src/lib/record/messages.d.ts +46 -0
- package/src/lib/record/messages.js +58 -101
- package/src/lib/record/messages.js.map +1 -1
- package/src/lib/record/messages.mjs +58 -101
- package/src/lib/record/messages.mjs.map +1 -1
- package/src/lib/record/rules.d.mts +33 -0
- package/src/lib/record/rules.d.ts +33 -0
- package/src/lib/record/rules.js +83 -0
- package/src/lib/record/rules.js.map +1 -0
- package/src/lib/record/rules.mjs +79 -0
- package/src/lib/record/rules.mjs.map +1 -0
- package/src/lib/record/run.d.mts +169 -0
- package/src/lib/record/run.d.ts +169 -0
- package/src/lib/record/run.js +350 -0
- package/src/lib/record/run.js.map +1 -0
- package/src/lib/record/run.mjs +345 -0
- package/src/lib/record/run.mjs.map +1 -0
- package/src/lib/record/score.d.mts +16 -0
- package/src/lib/record/score.d.ts +16 -0
- package/src/lib/record/score.js +35 -0
- package/src/lib/record/score.js.map +1 -0
- package/src/lib/record/score.mjs +32 -0
- package/src/lib/record/score.mjs.map +1 -0
- package/src/lib/record/set-when.d.mts +24 -0
- package/src/lib/record/set-when.d.ts +24 -0
- package/src/lib/record/set-when.js +68 -0
- package/src/lib/record/set-when.js.map +1 -0
- package/src/lib/record/set-when.mjs +65 -0
- package/src/lib/record/set-when.mjs.map +1 -0
- package/src/lib/record/structures.d.mts +14 -0
- package/src/lib/record/structures.d.ts +14 -0
- package/src/lib/record/structures.js +32 -0
- package/src/lib/record/structures.js.map +1 -0
- package/src/lib/record/structures.mjs +28 -0
- package/src/lib/record/structures.mjs.map +1 -0
- package/src/lib/record/values.d.mts +10 -5
- package/src/lib/record/values.d.ts +10 -5
- package/src/lib/record/values.js +20 -6
- package/src/lib/record/values.js.map +1 -1
- package/src/lib/record/values.mjs +19 -6
- package/src/lib/record/values.mjs.map +1 -1
- package/src/runtime.d.mts +13 -7
- package/src/runtime.d.ts +13 -7
- package/src/runtime.js +14 -1
- package/src/runtime.js.map +1 -1
- package/src/runtime.mjs +6 -2
- package/src/runtime.mjs.map +1 -1
package/src/lib/format/page.js
CHANGED
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PageSchema = exports.PageDataSchema = exports.FORMAT_VERSION = void 0;
|
|
4
4
|
const z = require("zod");
|
|
5
|
+
const actions_1 = require("./actions");
|
|
5
6
|
const field_1 = require("./field");
|
|
6
7
|
const layout_1 = require("./layout");
|
|
8
|
+
const part_look_1 = require("./part-look");
|
|
7
9
|
const version_1 = require("./version");
|
|
8
10
|
var version_2 = require("./version");
|
|
9
11
|
Object.defineProperty(exports, "FORMAT_VERSION", { enumerable: true, get: function () { return version_2.FORMAT_VERSION; } });
|
|
@@ -11,6 +13,17 @@ exports.PageDataSchema = z.discriminatedUnion('kind', [
|
|
|
11
13
|
z.strictObject({ kind: z.literal('record'), model: z.string().min(1) }),
|
|
12
14
|
z.strictObject({ kind: z.literal('responses') }),
|
|
13
15
|
]);
|
|
16
|
+
const COLOUR = z.string().regex(/^#[0-9a-fA-F]{6}$/);
|
|
17
|
+
const CORNERS = z.enum(['square', 'soft', 'round']);
|
|
18
|
+
const PART_SETTING = {
|
|
19
|
+
background: COLOUR,
|
|
20
|
+
border: COLOUR,
|
|
21
|
+
corners: CORNERS,
|
|
22
|
+
textSize: z.enum(['small', 'large']),
|
|
23
|
+
accent: COLOUR,
|
|
24
|
+
};
|
|
25
|
+
/** Each kind of part with only the settings it can draw. */
|
|
26
|
+
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()])));
|
|
14
27
|
exports.PageSchema = z
|
|
15
28
|
.strictObject({
|
|
16
29
|
fieldia: z.literal(version_1.FORMAT_VERSION),
|
|
@@ -22,6 +35,21 @@ exports.PageSchema = z
|
|
|
22
35
|
layout: layout_1.RootLayoutSchema,
|
|
23
36
|
maxWidth: z.enum(['narrow', 'medium', 'wide', 'full']).optional(),
|
|
24
37
|
actionsPosition: z.enum(['top', 'bottom']).optional(),
|
|
38
|
+
look: z
|
|
39
|
+
.strictObject({
|
|
40
|
+
accent: COLOUR.optional(),
|
|
41
|
+
font: z.enum(['system', 'serif', 'rounded']).optional(),
|
|
42
|
+
density: z.enum(['compact', 'comfortable', 'roomy']).optional(),
|
|
43
|
+
corners: CORNERS.optional(),
|
|
44
|
+
labels: z.enum(['above', 'beside', 'hidden']).optional(),
|
|
45
|
+
labelWidth: z.int().min(60).max(320).optional(),
|
|
46
|
+
scheme: z.enum(['light', 'dark', 'auto']).optional(),
|
|
47
|
+
parts: PartsLookSchema.optional(),
|
|
48
|
+
})
|
|
49
|
+
.optional(),
|
|
50
|
+
language: z.string().regex(/^[a-z]{2,3}(-[A-Za-z0-9]{2,8})*$/).optional(),
|
|
51
|
+
translations: z.record(z.string().regex(/^[a-z]{2,3}(-[A-Za-z0-9]{2,8})*$/), z.record(z.string(), z.string())).optional(),
|
|
52
|
+
on: actions_1.PageEventsSchema.optional(),
|
|
25
53
|
})
|
|
26
54
|
.meta({
|
|
27
55
|
title: 'Fieldia page',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/format/page.ts"],"names":[],"mappings":";;;AAAA,yBAAyB;AACzB,mCAAoD;AACpD,qCAA6D;
|
|
1
|
+
{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AQ,EAAE;QACxD,UAAU,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;QAC/C,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,QAAQ,EAAE;QACpD,KAAK,EAAE,eAAe,CAAC,QAAQ,EAAE;KAClC,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,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
|
@@ -1,12 +1,25 @@
|
|
|
1
1
|
import * as z from 'zod';
|
|
2
|
+
import { PageEventsSchema } from './actions.mjs';
|
|
2
3
|
import { FieldsSchema } from './field.mjs';
|
|
3
4
|
import { RootLayoutSchema } from './layout.mjs';
|
|
5
|
+
import { PART_LOOKS } from './part-look.mjs';
|
|
4
6
|
import { FORMAT_VERSION } from './version.mjs';
|
|
5
7
|
export { FORMAT_VERSION } from './version.mjs';
|
|
6
8
|
export const PageDataSchema = z.discriminatedUnion('kind', [
|
|
7
9
|
z.strictObject({ kind: z.literal('record'), model: z.string().min(1) }),
|
|
8
10
|
z.strictObject({ kind: z.literal('responses') }),
|
|
9
11
|
]);
|
|
12
|
+
const COLOUR = z.string().regex(/^#[0-9a-fA-F]{6}$/);
|
|
13
|
+
const CORNERS = z.enum(['square', 'soft', 'round']);
|
|
14
|
+
const PART_SETTING = {
|
|
15
|
+
background: COLOUR,
|
|
16
|
+
border: COLOUR,
|
|
17
|
+
corners: CORNERS,
|
|
18
|
+
textSize: z.enum(['small', 'large']),
|
|
19
|
+
accent: COLOUR,
|
|
20
|
+
};
|
|
21
|
+
/** Each kind of part with only the settings it can draw. */
|
|
22
|
+
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()])));
|
|
10
23
|
export const PageSchema = z
|
|
11
24
|
.strictObject({
|
|
12
25
|
fieldia: z.literal(FORMAT_VERSION),
|
|
@@ -18,6 +31,21 @@ export const PageSchema = z
|
|
|
18
31
|
layout: RootLayoutSchema,
|
|
19
32
|
maxWidth: z.enum(['narrow', 'medium', 'wide', 'full']).optional(),
|
|
20
33
|
actionsPosition: z.enum(['top', 'bottom']).optional(),
|
|
34
|
+
look: z
|
|
35
|
+
.strictObject({
|
|
36
|
+
accent: COLOUR.optional(),
|
|
37
|
+
font: z.enum(['system', 'serif', 'rounded']).optional(),
|
|
38
|
+
density: z.enum(['compact', 'comfortable', 'roomy']).optional(),
|
|
39
|
+
corners: CORNERS.optional(),
|
|
40
|
+
labels: z.enum(['above', 'beside', 'hidden']).optional(),
|
|
41
|
+
labelWidth: z.int().min(60).max(320).optional(),
|
|
42
|
+
scheme: z.enum(['light', 'dark', 'auto']).optional(),
|
|
43
|
+
parts: PartsLookSchema.optional(),
|
|
44
|
+
})
|
|
45
|
+
.optional(),
|
|
46
|
+
language: z.string().regex(/^[a-z]{2,3}(-[A-Za-z0-9]{2,8})*$/).optional(),
|
|
47
|
+
translations: z.record(z.string().regex(/^[a-z]{2,3}(-[A-Za-z0-9]{2,8})*$/), z.record(z.string(), z.string())).optional(),
|
|
48
|
+
on: PageEventsSchema.optional(),
|
|
21
49
|
})
|
|
22
50
|
.meta({
|
|
23
51
|
title: 'Fieldia page',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page.mjs","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/format/page.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAAE,YAAY,EAAe,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAmB,MAAM,UAAU,CAAC;
|
|
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,gBAAgB,EAAmB,MAAM,UAAU,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAiC,MAAM,aAAa,CAAC;AAExE,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAwD3C,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IACzD,CAAC,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;IACvE,CAAC,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC;CACjD,CAAC,CAAC;AAEH,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;AACrD,MAAM,OAA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,CAAC,QAAQ,EAAE;CAChC,CAAC;KACD,IAAI,CAAC;IACJ,KAAK,EAAE,cAAc;IACrB,WAAW,EACT,8HAA8H;CACjI,CAAC,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A look for each kind of part, over the page's own, as SurveyJS and Vueform
|
|
3
|
+
* theme each component: text boxes, choices, groups, buttons and tables, each
|
|
4
|
+
* with the few settings the skins can draw on it. A setting left out is the
|
|
5
|
+
* page's; a kind left out is drawn as the page draws it.
|
|
6
|
+
*/
|
|
7
|
+
/** Every setting a kind of part may have. Which a kind has is `PART_LOOKS`. */
|
|
8
|
+
export interface PartLook {
|
|
9
|
+
/** Its ground, inside its edge: kept light on a light page and dark on a dark one, so the page's words read on it. `#rrggbb`. */
|
|
10
|
+
background?: string;
|
|
11
|
+
/** Its edge: a box's, a card's, a table's lines. `#rrggbb`. */
|
|
12
|
+
border?: string;
|
|
13
|
+
corners?: 'square' | 'soft' | 'round';
|
|
14
|
+
/** Its words, smaller or larger than the page's. */
|
|
15
|
+
textSize?: 'small' | 'large';
|
|
16
|
+
/** Its own accent: a box's edge as it is typed in, what is picked, a button's colour. `#rrggbb`. */
|
|
17
|
+
accent?: string;
|
|
18
|
+
}
|
|
19
|
+
/** The kinds of part, each with the settings its look can have, in the order a person sets them. */
|
|
20
|
+
export declare const PART_LOOKS: {
|
|
21
|
+
/** Boxes typed in or picked from: text, numbers, dates, dropdowns. */
|
|
22
|
+
readonly inputs: readonly ["background", "border", "corners", "textSize", "accent"];
|
|
23
|
+
/** Options picked: rings, ticks, a scale's points, Yes and No, pictures. */
|
|
24
|
+
readonly choices: readonly ["accent", "background", "border", "corners", "textSize"];
|
|
25
|
+
/** Groups drawn as cards or frames: sections, a record's sheet, a repeating group's cards. */
|
|
26
|
+
readonly groups: readonly ["background", "border", "corners"];
|
|
27
|
+
/** Buttons: Send, Next, Save, Add another. */
|
|
28
|
+
readonly buttons: readonly ["accent", "corners", "textSize"];
|
|
29
|
+
/** Tables of lines and a matrix's grid: their heading row, their lines and their words. */
|
|
30
|
+
readonly tables: readonly ["background", "border", "textSize"];
|
|
31
|
+
};
|
|
32
|
+
export type PartLookKind = keyof typeof PART_LOOKS;
|
|
33
|
+
/** The look of each kind of part the page gives one. */
|
|
34
|
+
export type PartsLook = {
|
|
35
|
+
[K in PartLookKind]?: Pick<PartLook, (typeof PART_LOOKS)[K][number]>;
|
|
36
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A look for each kind of part, over the page's own, as SurveyJS and Vueform
|
|
3
|
+
* theme each component: text boxes, choices, groups, buttons and tables, each
|
|
4
|
+
* with the few settings the skins can draw on it. A setting left out is the
|
|
5
|
+
* page's; a kind left out is drawn as the page draws it.
|
|
6
|
+
*/
|
|
7
|
+
/** Every setting a kind of part may have. Which a kind has is `PART_LOOKS`. */
|
|
8
|
+
export interface PartLook {
|
|
9
|
+
/** Its ground, inside its edge: kept light on a light page and dark on a dark one, so the page's words read on it. `#rrggbb`. */
|
|
10
|
+
background?: string;
|
|
11
|
+
/** Its edge: a box's, a card's, a table's lines. `#rrggbb`. */
|
|
12
|
+
border?: string;
|
|
13
|
+
corners?: 'square' | 'soft' | 'round';
|
|
14
|
+
/** Its words, smaller or larger than the page's. */
|
|
15
|
+
textSize?: 'small' | 'large';
|
|
16
|
+
/** Its own accent: a box's edge as it is typed in, what is picked, a button's colour. `#rrggbb`. */
|
|
17
|
+
accent?: string;
|
|
18
|
+
}
|
|
19
|
+
/** The kinds of part, each with the settings its look can have, in the order a person sets them. */
|
|
20
|
+
export declare const PART_LOOKS: {
|
|
21
|
+
/** Boxes typed in or picked from: text, numbers, dates, dropdowns. */
|
|
22
|
+
readonly inputs: readonly ["background", "border", "corners", "textSize", "accent"];
|
|
23
|
+
/** Options picked: rings, ticks, a scale's points, Yes and No, pictures. */
|
|
24
|
+
readonly choices: readonly ["accent", "background", "border", "corners", "textSize"];
|
|
25
|
+
/** Groups drawn as cards or frames: sections, a record's sheet, a repeating group's cards. */
|
|
26
|
+
readonly groups: readonly ["background", "border", "corners"];
|
|
27
|
+
/** Buttons: Send, Next, Save, Add another. */
|
|
28
|
+
readonly buttons: readonly ["accent", "corners", "textSize"];
|
|
29
|
+
/** Tables of lines and a matrix's grid: their heading row, their lines and their words. */
|
|
30
|
+
readonly tables: readonly ["background", "border", "textSize"];
|
|
31
|
+
};
|
|
32
|
+
export type PartLookKind = keyof typeof PART_LOOKS;
|
|
33
|
+
/** The look of each kind of part the page gives one. */
|
|
34
|
+
export type PartsLook = {
|
|
35
|
+
[K in PartLookKind]?: Pick<PartLook, (typeof PART_LOOKS)[K][number]>;
|
|
36
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* A look for each kind of part, over the page's own, as SurveyJS and Vueform
|
|
4
|
+
* theme each component: text boxes, choices, groups, buttons and tables, each
|
|
5
|
+
* with the few settings the skins can draw on it. A setting left out is the
|
|
6
|
+
* page's; a kind left out is drawn as the page draws it.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.PART_LOOKS = void 0;
|
|
10
|
+
/** The kinds of part, each with the settings its look can have, in the order a person sets them. */
|
|
11
|
+
exports.PART_LOOKS = {
|
|
12
|
+
/** Boxes typed in or picked from: text, numbers, dates, dropdowns. */
|
|
13
|
+
inputs: ['background', 'border', 'corners', 'textSize', 'accent'],
|
|
14
|
+
/** Options picked: rings, ticks, a scale's points, Yes and No, pictures. */
|
|
15
|
+
choices: ['accent', 'background', 'border', 'corners', 'textSize'],
|
|
16
|
+
/** Groups drawn as cards or frames: sections, a record's sheet, a repeating group's cards. */
|
|
17
|
+
groups: ['background', 'border', 'corners'],
|
|
18
|
+
/** Buttons: Send, Next, Save, Add another. */
|
|
19
|
+
buttons: ['accent', 'corners', 'textSize'],
|
|
20
|
+
/** Tables of lines and a matrix's grid: their heading row, their lines and their words. */
|
|
21
|
+
tables: ['background', 'border', 'textSize'],
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=part-look.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"part-look.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/format/part-look.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAeH,oGAAoG;AACvF,QAAA,UAAU,GAAG;IACxB,sEAAsE;IACtE,MAAM,EAAE,CAAC,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,CAAC;IACjE,4EAA4E;IAC5E,OAAO,EAAE,CAAC,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,CAAC;IAClE,8FAA8F;IAC9F,MAAM,EAAE,CAAC,YAAY,EAAE,QAAQ,EAAE,SAAS,CAAC;IAC3C,8CAA8C;IAC9C,OAAO,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,UAAU,CAAC;IAC1C,2FAA2F;IAC3F,MAAM,EAAE,CAAC,YAAY,EAAE,QAAQ,EAAE,UAAU,CAAC;CACkB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A look for each kind of part, over the page's own, as SurveyJS and Vueform
|
|
3
|
+
* theme each component: text boxes, choices, groups, buttons and tables, each
|
|
4
|
+
* with the few settings the skins can draw on it. A setting left out is the
|
|
5
|
+
* page's; a kind left out is drawn as the page draws it.
|
|
6
|
+
*/
|
|
7
|
+
/** The kinds of part, each with the settings its look can have, in the order a person sets them. */
|
|
8
|
+
export const PART_LOOKS = {
|
|
9
|
+
/** Boxes typed in or picked from: text, numbers, dates, dropdowns. */
|
|
10
|
+
inputs: ['background', 'border', 'corners', 'textSize', 'accent'],
|
|
11
|
+
/** Options picked: rings, ticks, a scale's points, Yes and No, pictures. */
|
|
12
|
+
choices: ['accent', 'background', 'border', 'corners', 'textSize'],
|
|
13
|
+
/** Groups drawn as cards or frames: sections, a record's sheet, a repeating group's cards. */
|
|
14
|
+
groups: ['background', 'border', 'corners'],
|
|
15
|
+
/** Buttons: Send, Next, Save, Add another. */
|
|
16
|
+
buttons: ['accent', 'corners', 'textSize'],
|
|
17
|
+
/** Tables of lines and a matrix's grid: their heading row, their lines and their words. */
|
|
18
|
+
tables: ['background', 'border', 'textSize'],
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=part-look.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"part-look.mjs","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/format/part-look.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAeH,oGAAoG;AACpG,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,sEAAsE;IACtE,MAAM,EAAE,CAAC,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,CAAC;IACjE,4EAA4E;IAC5E,OAAO,EAAE,CAAC,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,CAAC;IAClE,8FAA8F;IAC9F,MAAM,EAAE,CAAC,YAAY,EAAE,QAAQ,EAAE,SAAS,CAAC;IAC3C,8CAA8C;IAC9C,OAAO,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,UAAU,CAAC;IAC1C,2FAA2F;IAC3F,MAAM,EAAE,CAAC,YAAY,EAAE,QAAQ,EAAE,UAAU,CAAC;CACkB,CAAC"}
|
|
@@ -16,20 +16,52 @@ export declare class ReferenceCheck {
|
|
|
16
16
|
private readonly page;
|
|
17
17
|
private readonly issues;
|
|
18
18
|
private readonly ids;
|
|
19
|
+
/** Where the answers of each saved form placed here go, by name: the path of the part that took it first. */
|
|
20
|
+
private readonly formNames;
|
|
21
|
+
/** The ids of the tabs and wizard steps a step can go to, and where each goTo and show names one. */
|
|
22
|
+
private readonly places;
|
|
23
|
+
private readonly goingTo;
|
|
19
24
|
constructor(page: Page);
|
|
20
25
|
run(): PageIssue[];
|
|
26
|
+
/** The form's moments: their steps checked, a change named by a field (or a saved form placed here, by its answers' name), a step or tab shown by its id. */
|
|
27
|
+
private checkEvents;
|
|
28
|
+
/** A press: steps, an app action, or both — and its steps checked. */
|
|
29
|
+
private checkPress;
|
|
30
|
+
/**
|
|
31
|
+
* Steps, each against this page: the fields it sets, empties, checks or adds
|
|
32
|
+
* a line to are this page's; its expressions read; a step it goes to is a
|
|
33
|
+
* tab or a wizard step here. The opened page's own fields are not known
|
|
34
|
+
* here: what it starts with is named freely, and what comes back is read
|
|
35
|
+
* as an expression.
|
|
36
|
+
*/
|
|
37
|
+
private checkSteps;
|
|
21
38
|
private report;
|
|
22
39
|
private claim;
|
|
23
40
|
/** The field a reference names, or a reported issue and undefined. */
|
|
24
41
|
private need;
|
|
25
|
-
/** Every modifier on `owner` must read, and read only fields of this page. */
|
|
42
|
+
/** Every modifier on `owner` must read, and read only fields of this page (or of its line). */
|
|
26
43
|
private checkModifiers;
|
|
44
|
+
/** Each name an expression reads must be a field where it is worked out. */
|
|
45
|
+
private checkReads;
|
|
46
|
+
/**
|
|
47
|
+
* An expression for a value must read, read only fields where it is worked
|
|
48
|
+
* out, and add up only line fields that exist. Returns the fields it reads,
|
|
49
|
+
* or null when it cannot be read.
|
|
50
|
+
*/
|
|
51
|
+
private checkExpression;
|
|
52
|
+
/**
|
|
53
|
+
* Worked-out values and values set by a condition, among one set of fields:
|
|
54
|
+
* each expression checked, and no two values worked out from each other.
|
|
55
|
+
*/
|
|
56
|
+
private checkWorkedOut;
|
|
27
57
|
private checkFields;
|
|
28
58
|
private checkLineKinds;
|
|
29
59
|
private walkRoot;
|
|
30
60
|
private walkList;
|
|
31
61
|
private walkChildren;
|
|
32
62
|
private walkNode;
|
|
63
|
+
/** A saved form placed here: never this page itself, and its answers under a name no field and no other copy has. */
|
|
64
|
+
private checkFormNode;
|
|
33
65
|
private walkTabs;
|
|
34
66
|
private walkSheet;
|
|
35
67
|
private checkFieldNode;
|
|
@@ -16,20 +16,52 @@ export declare class ReferenceCheck {
|
|
|
16
16
|
private readonly page;
|
|
17
17
|
private readonly issues;
|
|
18
18
|
private readonly ids;
|
|
19
|
+
/** Where the answers of each saved form placed here go, by name: the path of the part that took it first. */
|
|
20
|
+
private readonly formNames;
|
|
21
|
+
/** The ids of the tabs and wizard steps a step can go to, and where each goTo and show names one. */
|
|
22
|
+
private readonly places;
|
|
23
|
+
private readonly goingTo;
|
|
19
24
|
constructor(page: Page);
|
|
20
25
|
run(): PageIssue[];
|
|
26
|
+
/** The form's moments: their steps checked, a change named by a field (or a saved form placed here, by its answers' name), a step or tab shown by its id. */
|
|
27
|
+
private checkEvents;
|
|
28
|
+
/** A press: steps, an app action, or both — and its steps checked. */
|
|
29
|
+
private checkPress;
|
|
30
|
+
/**
|
|
31
|
+
* Steps, each against this page: the fields it sets, empties, checks or adds
|
|
32
|
+
* a line to are this page's; its expressions read; a step it goes to is a
|
|
33
|
+
* tab or a wizard step here. The opened page's own fields are not known
|
|
34
|
+
* here: what it starts with is named freely, and what comes back is read
|
|
35
|
+
* as an expression.
|
|
36
|
+
*/
|
|
37
|
+
private checkSteps;
|
|
21
38
|
private report;
|
|
22
39
|
private claim;
|
|
23
40
|
/** The field a reference names, or a reported issue and undefined. */
|
|
24
41
|
private need;
|
|
25
|
-
/** Every modifier on `owner` must read, and read only fields of this page. */
|
|
42
|
+
/** Every modifier on `owner` must read, and read only fields of this page (or of its line). */
|
|
26
43
|
private checkModifiers;
|
|
44
|
+
/** Each name an expression reads must be a field where it is worked out. */
|
|
45
|
+
private checkReads;
|
|
46
|
+
/**
|
|
47
|
+
* An expression for a value must read, read only fields where it is worked
|
|
48
|
+
* out, and add up only line fields that exist. Returns the fields it reads,
|
|
49
|
+
* or null when it cannot be read.
|
|
50
|
+
*/
|
|
51
|
+
private checkExpression;
|
|
52
|
+
/**
|
|
53
|
+
* Worked-out values and values set by a condition, among one set of fields:
|
|
54
|
+
* each expression checked, and no two values worked out from each other.
|
|
55
|
+
*/
|
|
56
|
+
private checkWorkedOut;
|
|
27
57
|
private checkFields;
|
|
28
58
|
private checkLineKinds;
|
|
29
59
|
private walkRoot;
|
|
30
60
|
private walkList;
|
|
31
61
|
private walkChildren;
|
|
32
62
|
private walkNode;
|
|
63
|
+
/** A saved form placed here: never this page itself, and its answers under a name no field and no other copy has. */
|
|
64
|
+
private checkFormNode;
|
|
33
65
|
private walkTabs;
|
|
34
66
|
private walkSheet;
|
|
35
67
|
private checkFieldNode;
|