@fieldia/core 0.10.0 → 0.12.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 +204 -0
- package/package.json +1 -1
- package/schema/page.schema.json +4700 -904
- package/src/index.d.mts +2 -1
- package/src/index.d.ts +2 -1
- package/src/index.js +7 -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/built-ins.d.mts +4 -0
- package/src/lib/expression/built-ins.d.ts +4 -0
- package/src/lib/expression/built-ins.js +8 -0
- package/src/lib/expression/built-ins.js.map +1 -0
- package/src/lib/expression/built-ins.mjs +5 -0
- package/src/lib/expression/built-ins.mjs.map +1 -0
- package/src/lib/expression/evaluator.js +17 -7
- package/src/lib/expression/evaluator.js.map +1 -1
- package/src/lib/expression/evaluator.mjs +17 -7
- package/src/lib/expression/evaluator.mjs.map +1 -1
- package/src/lib/expression/expression.d.mts +7 -0
- package/src/lib/expression/expression.d.ts +7 -0
- package/src/lib/expression/expression.js +2 -0
- package/src/lib/expression/expression.js.map +1 -1
- package/src/lib/expression/expression.mjs +3 -1
- package/src/lib/expression/expression.mjs.map +1 -1
- package/src/lib/expression/functions.d.mts +2 -0
- package/src/lib/expression/functions.d.ts +2 -0
- package/src/lib/expression/functions.js +38 -5
- package/src/lib/expression/functions.js.map +1 -1
- package/src/lib/expression/functions.mjs +38 -5
- package/src/lib/expression/functions.mjs.map +1 -1
- package/src/lib/expression/modifier.d.mts +7 -0
- package/src/lib/expression/modifier.d.ts +7 -0
- package/src/lib/expression/modifier.js +3 -1
- package/src/lib/expression/modifier.js.map +1 -1
- package/src/lib/expression/modifier.mjs +4 -2
- package/src/lib/expression/modifier.mjs.map +1 -1
- package/src/lib/expression/parser.d.mts +8 -1
- package/src/lib/expression/parser.d.ts +8 -1
- package/src/lib/expression/parser.js +30 -2
- package/src/lib/expression/parser.js.map +1 -1
- package/src/lib/expression/parser.mjs +30 -2
- package/src/lib/expression/parser.mjs.map +1 -1
- package/src/lib/expression/reads.d.mts +7 -0
- package/src/lib/expression/reads.d.ts +7 -0
- package/src/lib/expression/reads.js +23 -0
- package/src/lib/expression/reads.js.map +1 -1
- package/src/lib/expression/reads.mjs +21 -0
- package/src/lib/expression/reads.mjs.map +1 -1
- package/src/lib/format/actions.d.mts +1176 -0
- package/src/lib/format/actions.d.ts +1176 -0
- package/src/lib/format/actions.js +62 -0
- package/src/lib/format/actions.js.map +1 -0
- package/src/lib/format/actions.mjs +59 -0
- package/src/lib/format/actions.mjs.map +1 -0
- package/src/lib/format/check-page.d.mts +7 -2
- package/src/lib/format/check-page.d.ts +7 -2
- package/src/lib/format/check-page.js +6 -3
- package/src/lib/format/check-page.js.map +1 -1
- package/src/lib/format/check-page.mjs +6 -3
- package/src/lib/format/check-page.mjs.map +1 -1
- package/src/lib/format/field.d.mts +3285 -214
- package/src/lib/format/field.d.ts +3285 -214
- package/src/lib/format/field.js +105 -16
- package/src/lib/format/field.js.map +1 -1
- package/src/lib/format/field.mjs +104 -15
- package/src/lib/format/field.mjs.map +1 -1
- package/src/lib/format/hotkeys.d.mts +6 -0
- package/src/lib/format/hotkeys.d.ts +6 -0
- package/src/lib/format/hotkeys.js +11 -0
- package/src/lib/format/hotkeys.js.map +1 -0
- package/src/lib/format/hotkeys.mjs +7 -0
- package/src/lib/format/hotkeys.mjs.map +1 -0
- package/src/lib/format/layout.d.mts +4773 -211
- package/src/lib/format/layout.d.ts +4773 -211
- package/src/lib/format/layout.js +147 -21
- package/src/lib/format/layout.js.map +1 -1
- package/src/lib/format/layout.mjs +146 -20
- 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/page.d.mts +3563 -222
- package/src/lib/format/page.d.ts +3563 -222
- package/src/lib/format/page.js +19 -2
- package/src/lib/format/page.js.map +1 -1
- package/src/lib/format/page.mjs +20 -3
- 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 +54 -2
- package/src/lib/format/references.d.ts +54 -2
- package/src/lib/format/references.js +450 -43
- package/src/lib/format/references.js.map +1 -1
- package/src/lib/format/references.mjs +450 -43
- package/src/lib/format/references.mjs.map +1 -1
- package/src/lib/format/translate.js +5 -3
- package/src/lib/format/translate.js.map +1 -1
- package/src/lib/format/translate.mjs +5 -3
- package/src/lib/format/translate.mjs.map +1 -1
- package/src/lib/format/words.d.mts +9 -0
- package/src/lib/format/words.d.ts +9 -0
- package/src/lib/format/words.js +35 -0
- package/src/lib/format/words.js.map +1 -0
- package/src/lib/format/words.mjs +30 -0
- package/src/lib/format/words.mjs.map +1 -0
- package/src/lib/record/cells.d.mts +37 -0
- package/src/lib/record/cells.d.ts +37 -0
- package/src/lib/record/cells.js +59 -0
- package/src/lib/record/cells.js.map +1 -0
- package/src/lib/record/cells.mjs +54 -0
- package/src/lib/record/cells.mjs.map +1 -0
- package/src/lib/record/compute.d.mts +5 -4
- package/src/lib/record/compute.d.ts +5 -4
- package/src/lib/record/compute.js +11 -10
- package/src/lib/record/compute.js.map +1 -1
- package/src/lib/record/compute.mjs +12 -11
- package/src/lib/record/compute.mjs.map +1 -1
- package/src/lib/record/data-source.d.mts +37 -3
- package/src/lib/record/data-source.d.ts +37 -3
- 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 +38 -1
- package/src/lib/record/env.d.ts +38 -1
- package/src/lib/record/env.js +41 -3
- package/src/lib/record/env.js.map +1 -1
- package/src/lib/record/env.mjs +38 -3
- package/src/lib/record/env.mjs.map +1 -1
- package/src/lib/record/filter.d.mts +10 -0
- package/src/lib/record/filter.d.ts +10 -0
- package/src/lib/record/filter.js +49 -0
- package/src/lib/record/filter.js.map +1 -1
- package/src/lib/record/filter.mjs +48 -0
- package/src/lib/record/filter.mjs.map +1 -1
- package/src/lib/record/form.d.mts +226 -25
- package/src/lib/record/form.d.ts +226 -25
- package/src/lib/record/form.js +785 -83
- package/src/lib/record/form.js.map +1 -1
- package/src/lib/record/form.mjs +787 -85
- package/src/lib/record/form.mjs.map +1 -1
- package/src/lib/record/locales/ar.js +3 -0
- package/src/lib/record/locales/ar.js.map +1 -1
- package/src/lib/record/locales/ar.mjs +3 -0
- package/src/lib/record/locales/ar.mjs.map +1 -1
- package/src/lib/record/locales/de.js +3 -0
- package/src/lib/record/locales/de.js.map +1 -1
- package/src/lib/record/locales/de.mjs +3 -0
- package/src/lib/record/locales/de.mjs.map +1 -1
- package/src/lib/record/locales/fr.js +3 -0
- package/src/lib/record/locales/fr.js.map +1 -1
- package/src/lib/record/locales/fr.mjs +3 -0
- package/src/lib/record/locales/fr.mjs.map +1 -1
- package/src/lib/record/memory-data-source.d.mts +26 -2
- package/src/lib/record/memory-data-source.d.ts +26 -2
- package/src/lib/record/memory-data-source.js +98 -7
- package/src/lib/record/memory-data-source.js.map +1 -1
- package/src/lib/record/memory-data-source.mjs +98 -7
- package/src/lib/record/memory-data-source.mjs.map +1 -1
- package/src/lib/record/messages.d.mts +5 -0
- package/src/lib/record/messages.d.ts +5 -0
- package/src/lib/record/messages.js +3 -0
- package/src/lib/record/messages.js.map +1 -1
- package/src/lib/record/messages.mjs +3 -0
- package/src/lib/record/messages.mjs.map +1 -1
- package/src/lib/record/roles.d.mts +10 -0
- package/src/lib/record/roles.d.ts +10 -0
- package/src/lib/record/roles.js +21 -0
- package/src/lib/record/roles.js.map +1 -0
- package/src/lib/record/roles.mjs +18 -0
- package/src/lib/record/roles.mjs.map +1 -0
- package/src/lib/record/rules.js +30 -0
- package/src/lib/record/rules.js.map +1 -1
- package/src/lib/record/rules.mjs +31 -1
- package/src/lib/record/rules.mjs.map +1 -1
- package/src/lib/record/run.d.mts +248 -0
- package/src/lib/record/run.d.ts +248 -0
- package/src/lib/record/run.js +455 -0
- package/src/lib/record/run.js.map +1 -0
- package/src/lib/record/run.mjs +450 -0
- package/src/lib/record/run.mjs.map +1 -0
- package/src/lib/record/set-when.d.mts +5 -2
- package/src/lib/record/set-when.d.ts +5 -2
- package/src/lib/record/set-when.js +28 -12
- package/src/lib/record/set-when.js.map +1 -1
- package/src/lib/record/set-when.mjs +30 -14
- package/src/lib/record/set-when.mjs.map +1 -1
- package/src/lib/record/value-map.d.mts +41 -0
- package/src/lib/record/value-map.d.ts +41 -0
- package/src/lib/record/value-map.js +80 -0
- package/src/lib/record/value-map.js.map +1 -0
- package/src/lib/record/value-map.mjs +73 -0
- package/src/lib/record/value-map.mjs.map +1 -0
- package/src/lib/record/values.d.mts +10 -0
- package/src/lib/record/values.d.ts +10 -0
- package/src/lib/record/values.js.map +1 -1
- package/src/lib/record/values.mjs.map +1 -1
- package/src/runtime.d.mts +11 -4
- package/src/runtime.d.ts +11 -4
- package/src/runtime.js +13 -1
- package/src/runtime.js.map +1 -1
- package/src/runtime.mjs +4 -0
- 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),
|
|
@@ -24,17 +37,21 @@ exports.PageSchema = z
|
|
|
24
37
|
actionsPosition: z.enum(['top', 'bottom']).optional(),
|
|
25
38
|
look: z
|
|
26
39
|
.strictObject({
|
|
27
|
-
accent:
|
|
40
|
+
accent: COLOUR.optional(),
|
|
28
41
|
font: z.enum(['system', 'serif', 'rounded']).optional(),
|
|
29
42
|
density: z.enum(['compact', 'comfortable', 'roomy']).optional(),
|
|
30
|
-
corners:
|
|
43
|
+
corners: CORNERS.optional(),
|
|
31
44
|
labels: z.enum(['above', 'beside', 'hidden']).optional(),
|
|
32
45
|
labelWidth: z.int().min(60).max(320).optional(),
|
|
46
|
+
helpShown: layout_1.HelpShownSchema.optional(),
|
|
47
|
+
readonlyShown: z.enum(['text', 'box']).optional(),
|
|
33
48
|
scheme: z.enum(['light', 'dark', 'auto']).optional(),
|
|
49
|
+
parts: PartsLookSchema.optional(),
|
|
34
50
|
})
|
|
35
51
|
.optional(),
|
|
36
52
|
language: z.string().regex(/^[a-z]{2,3}(-[A-Za-z0-9]{2,8})*$/).optional(),
|
|
37
53
|
translations: z.record(z.string().regex(/^[a-z]{2,3}(-[A-Za-z0-9]{2,8})*$/), z.record(z.string(), z.string())).optional(),
|
|
54
|
+
on: actions_1.PageEventsSchema.optional(),
|
|
38
55
|
})
|
|
39
56
|
.meta({
|
|
40
57
|
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,
|
|
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;AAExE,uCAA2C;AAC3C,qCAA2C;AAAlC,yGAAA,cAAc,OAAA;AAqEV,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,OAA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D,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
|
-
import { RootLayoutSchema } from './layout.mjs';
|
|
4
|
+
import { HelpShownSchema, 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),
|
|
@@ -20,17 +33,21 @@ export const PageSchema = z
|
|
|
20
33
|
actionsPosition: z.enum(['top', 'bottom']).optional(),
|
|
21
34
|
look: z
|
|
22
35
|
.strictObject({
|
|
23
|
-
accent:
|
|
36
|
+
accent: COLOUR.optional(),
|
|
24
37
|
font: z.enum(['system', 'serif', 'rounded']).optional(),
|
|
25
38
|
density: z.enum(['compact', 'comfortable', 'roomy']).optional(),
|
|
26
|
-
corners:
|
|
39
|
+
corners: CORNERS.optional(),
|
|
27
40
|
labels: z.enum(['above', 'beside', 'hidden']).optional(),
|
|
28
41
|
labelWidth: z.int().min(60).max(320).optional(),
|
|
42
|
+
helpShown: HelpShownSchema.optional(),
|
|
43
|
+
readonlyShown: z.enum(['text', 'box']).optional(),
|
|
29
44
|
scheme: z.enum(['light', 'dark', 'auto']).optional(),
|
|
45
|
+
parts: PartsLookSchema.optional(),
|
|
30
46
|
})
|
|
31
47
|
.optional(),
|
|
32
48
|
language: z.string().regex(/^[a-z]{2,3}(-[A-Za-z0-9]{2,8})*$/).optional(),
|
|
33
49
|
translations: z.record(z.string().regex(/^[a-z]{2,3}(-[A-Za-z0-9]{2,8})*$/), z.record(z.string(), z.string())).optional(),
|
|
50
|
+
on: PageEventsSchema.optional(),
|
|
34
51
|
})
|
|
35
52
|
.meta({
|
|
36
53
|
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,
|
|
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;A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,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;QAC/C,SAAS,EAAE,eAAe,CAAC,QAAQ,EAAE;QACrC,aAAa,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,QAAQ,EAAE;QACjD,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,gBAAgB,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"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Field, LineField } from './field.mjs';
|
|
1
2
|
import type { Page } from './page.mjs';
|
|
2
3
|
export interface PageIssue {
|
|
3
4
|
/** Where the problem is, as a path into the page: `layout.children[0].field`. */
|
|
@@ -11,20 +12,65 @@ export type PageValidation = {
|
|
|
11
12
|
ok: false;
|
|
12
13
|
issues: PageIssue[];
|
|
13
14
|
};
|
|
15
|
+
/**
|
|
16
|
+
* A page that is one line's form — a table's line opened in a form of its
|
|
17
|
+
* own (`lineForm`), its fields the line's: its conditions read the line, the
|
|
18
|
+
* record it is on as `parent`.
|
|
19
|
+
*/
|
|
20
|
+
export interface LineOf {
|
|
21
|
+
/** The table whose line it is, for what is said. */
|
|
22
|
+
name: string;
|
|
23
|
+
/** The fields of the record the line is on. */
|
|
24
|
+
parent: Record<string, Field | LineField>;
|
|
25
|
+
}
|
|
14
26
|
/** The second pass of every check: ids unique, every name defined, every condition readable. */
|
|
15
27
|
export declare class ReferenceCheck {
|
|
16
28
|
private readonly page;
|
|
29
|
+
private readonly line?;
|
|
17
30
|
private readonly issues;
|
|
18
31
|
private readonly ids;
|
|
19
|
-
|
|
32
|
+
/** Where the answers of each saved form placed here go, by name: the path of the part that took it first. */
|
|
33
|
+
private readonly formNames;
|
|
34
|
+
/** The ids of the tabs and wizard steps a step can go to, and where each goTo and show names one. */
|
|
35
|
+
private readonly places;
|
|
36
|
+
private readonly goingTo;
|
|
37
|
+
constructor(page: Page, line?: LineOf | undefined);
|
|
20
38
|
run(): PageIssue[];
|
|
39
|
+
/** Each step's goTo and show names a tab or a wizard step of this page. */
|
|
40
|
+
private checkGoingTo;
|
|
41
|
+
/** Where the page's own expressions read: its fields — on a line's form, the line's, with its record as parent. */
|
|
42
|
+
private here;
|
|
43
|
+
/** A line's own form (`lineForm`), its parts checked against the line's fields, its record as parent. */
|
|
44
|
+
private checkLineForm;
|
|
45
|
+
/** 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. */
|
|
46
|
+
private checkEvents;
|
|
47
|
+
/** A press: steps, an app action, or both — and its steps checked. */
|
|
48
|
+
private checkPress;
|
|
49
|
+
/**
|
|
50
|
+
* Steps, each against this page: the fields it sets, empties, checks or adds
|
|
51
|
+
* a line to are this page's; its expressions read; a step it goes to is a
|
|
52
|
+
* tab or a wizard step here. The opened page's own fields are not known
|
|
53
|
+
* here: what it starts with is named freely, and what comes back is read
|
|
54
|
+
* as an expression.
|
|
55
|
+
*/
|
|
56
|
+
private checkSteps;
|
|
57
|
+
/** Words that show fields' values: each `{name}` a field of this page. */
|
|
58
|
+
private checkValuesIn;
|
|
21
59
|
private report;
|
|
22
60
|
private claim;
|
|
23
61
|
/** The field a reference names, or a reported issue and undefined. */
|
|
24
62
|
private need;
|
|
63
|
+
/** A filter's conditions: groups nest, and each valueFrom inside them must name a field too. */
|
|
64
|
+
private checkFilterItem;
|
|
65
|
+
/** A filter's `valueFrom`: a field where it is used, the record's `id`, a part of `user`, or on a line a field of its record. */
|
|
66
|
+
private checkValueFrom;
|
|
25
67
|
/** Every modifier on `owner` must read, and read only fields of this page (or of its line). */
|
|
26
68
|
private checkModifiers;
|
|
27
|
-
/**
|
|
69
|
+
/**
|
|
70
|
+
* Each name an expression reads must be a field where it is worked out, or
|
|
71
|
+
* on a record what every expression there reads: its `id`, and `user` with
|
|
72
|
+
* the person's `id`, `name` or `roles`.
|
|
73
|
+
*/
|
|
28
74
|
private checkReads;
|
|
29
75
|
/**
|
|
30
76
|
* An expression for a value must read, read only fields where it is worked
|
|
@@ -38,11 +84,17 @@ export declare class ReferenceCheck {
|
|
|
38
84
|
*/
|
|
39
85
|
private checkWorkedOut;
|
|
40
86
|
private checkFields;
|
|
87
|
+
/** A money field's currency: a field beside it, or on a line `parent.` and a field of the record — one that holds a currency. */
|
|
88
|
+
private checkCurrency;
|
|
41
89
|
private checkLineKinds;
|
|
90
|
+
/** A page's own buttons at its foot: buttons as any. */
|
|
91
|
+
private walkFooter;
|
|
42
92
|
private walkRoot;
|
|
43
93
|
private walkList;
|
|
44
94
|
private walkChildren;
|
|
45
95
|
private walkNode;
|
|
96
|
+
/** A saved form placed here: never this page itself, and its answers under a name no field and no other copy has. */
|
|
97
|
+
private checkFormNode;
|
|
46
98
|
private walkTabs;
|
|
47
99
|
private walkSheet;
|
|
48
100
|
private checkFieldNode;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Field, LineField } from './field';
|
|
1
2
|
import type { Page } from './page';
|
|
2
3
|
export interface PageIssue {
|
|
3
4
|
/** Where the problem is, as a path into the page: `layout.children[0].field`. */
|
|
@@ -11,20 +12,65 @@ export type PageValidation = {
|
|
|
11
12
|
ok: false;
|
|
12
13
|
issues: PageIssue[];
|
|
13
14
|
};
|
|
15
|
+
/**
|
|
16
|
+
* A page that is one line's form — a table's line opened in a form of its
|
|
17
|
+
* own (`lineForm`), its fields the line's: its conditions read the line, the
|
|
18
|
+
* record it is on as `parent`.
|
|
19
|
+
*/
|
|
20
|
+
export interface LineOf {
|
|
21
|
+
/** The table whose line it is, for what is said. */
|
|
22
|
+
name: string;
|
|
23
|
+
/** The fields of the record the line is on. */
|
|
24
|
+
parent: Record<string, Field | LineField>;
|
|
25
|
+
}
|
|
14
26
|
/** The second pass of every check: ids unique, every name defined, every condition readable. */
|
|
15
27
|
export declare class ReferenceCheck {
|
|
16
28
|
private readonly page;
|
|
29
|
+
private readonly line?;
|
|
17
30
|
private readonly issues;
|
|
18
31
|
private readonly ids;
|
|
19
|
-
|
|
32
|
+
/** Where the answers of each saved form placed here go, by name: the path of the part that took it first. */
|
|
33
|
+
private readonly formNames;
|
|
34
|
+
/** The ids of the tabs and wizard steps a step can go to, and where each goTo and show names one. */
|
|
35
|
+
private readonly places;
|
|
36
|
+
private readonly goingTo;
|
|
37
|
+
constructor(page: Page, line?: LineOf | undefined);
|
|
20
38
|
run(): PageIssue[];
|
|
39
|
+
/** Each step's goTo and show names a tab or a wizard step of this page. */
|
|
40
|
+
private checkGoingTo;
|
|
41
|
+
/** Where the page's own expressions read: its fields — on a line's form, the line's, with its record as parent. */
|
|
42
|
+
private here;
|
|
43
|
+
/** A line's own form (`lineForm`), its parts checked against the line's fields, its record as parent. */
|
|
44
|
+
private checkLineForm;
|
|
45
|
+
/** 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. */
|
|
46
|
+
private checkEvents;
|
|
47
|
+
/** A press: steps, an app action, or both — and its steps checked. */
|
|
48
|
+
private checkPress;
|
|
49
|
+
/**
|
|
50
|
+
* Steps, each against this page: the fields it sets, empties, checks or adds
|
|
51
|
+
* a line to are this page's; its expressions read; a step it goes to is a
|
|
52
|
+
* tab or a wizard step here. The opened page's own fields are not known
|
|
53
|
+
* here: what it starts with is named freely, and what comes back is read
|
|
54
|
+
* as an expression.
|
|
55
|
+
*/
|
|
56
|
+
private checkSteps;
|
|
57
|
+
/** Words that show fields' values: each `{name}` a field of this page. */
|
|
58
|
+
private checkValuesIn;
|
|
21
59
|
private report;
|
|
22
60
|
private claim;
|
|
23
61
|
/** The field a reference names, or a reported issue and undefined. */
|
|
24
62
|
private need;
|
|
63
|
+
/** A filter's conditions: groups nest, and each valueFrom inside them must name a field too. */
|
|
64
|
+
private checkFilterItem;
|
|
65
|
+
/** A filter's `valueFrom`: a field where it is used, the record's `id`, a part of `user`, or on a line a field of its record. */
|
|
66
|
+
private checkValueFrom;
|
|
25
67
|
/** Every modifier on `owner` must read, and read only fields of this page (or of its line). */
|
|
26
68
|
private checkModifiers;
|
|
27
|
-
/**
|
|
69
|
+
/**
|
|
70
|
+
* Each name an expression reads must be a field where it is worked out, or
|
|
71
|
+
* on a record what every expression there reads: its `id`, and `user` with
|
|
72
|
+
* the person's `id`, `name` or `roles`.
|
|
73
|
+
*/
|
|
28
74
|
private checkReads;
|
|
29
75
|
/**
|
|
30
76
|
* An expression for a value must read, read only fields where it is worked
|
|
@@ -38,11 +84,17 @@ export declare class ReferenceCheck {
|
|
|
38
84
|
*/
|
|
39
85
|
private checkWorkedOut;
|
|
40
86
|
private checkFields;
|
|
87
|
+
/** A money field's currency: a field beside it, or on a line `parent.` and a field of the record — one that holds a currency. */
|
|
88
|
+
private checkCurrency;
|
|
41
89
|
private checkLineKinds;
|
|
90
|
+
/** A page's own buttons at its foot: buttons as any. */
|
|
91
|
+
private walkFooter;
|
|
42
92
|
private walkRoot;
|
|
43
93
|
private walkList;
|
|
44
94
|
private walkChildren;
|
|
45
95
|
private walkNode;
|
|
96
|
+
/** A saved form placed here: never this page itself, and its answers under a name no field and no other copy has. */
|
|
97
|
+
private checkFormNode;
|
|
46
98
|
private walkTabs;
|
|
47
99
|
private walkSheet;
|
|
48
100
|
private checkFieldNode;
|