@fieldia/core 0.31.0 → 0.32.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 +16 -5
- package/package.json +1 -1
- package/schema/page.schema.json +9 -1
- package/src/lib/format/page.d.mts +6 -1
- package/src/lib/format/page.d.ts +6 -1
- package/src/lib/format/phone.d.mts +8 -0
- package/src/lib/format/phone.d.ts +8 -0
- package/src/lib/format/phone.js +7 -2
- package/src/lib/format/phone.js.map +1 -1
- package/src/lib/format/phone.mjs +7 -2
- package/src/lib/format/phone.mjs.map +1 -1
- package/src/lib/format/upgrade.d.mts +3 -1
- package/src/lib/format/upgrade.d.ts +3 -1
- package/src/lib/format/upgrade.js +3 -1
- package/src/lib/format/upgrade.js.map +1 -1
- package/src/lib/format/upgrade.mjs +3 -1
- package/src/lib/format/upgrade.mjs.map +1 -1
- package/src/lib/format/version.d.mts +2 -2
- package/src/lib/format/version.d.ts +2 -2
- package/src/lib/format/version.js +2 -2
- package/src/lib/format/version.js.map +1 -1
- package/src/lib/format/version.mjs +2 -2
- package/src/lib/format/version.mjs.map +1 -1
- package/src/lib/record/data-source.d.mts +17 -5
- package/src/lib/record/data-source.d.ts +17 -5
- package/src/lib/record/data-source.js.map +1 -1
- package/src/lib/record/data-source.mjs.map +1 -1
- package/src/lib/record/drafts.d.mts +9 -0
- package/src/lib/record/drafts.d.ts +9 -0
- package/src/lib/record/drafts.js +20 -0
- package/src/lib/record/drafts.js.map +1 -1
- package/src/lib/record/drafts.mjs +19 -0
- package/src/lib/record/drafts.mjs.map +1 -1
- package/src/lib/record/form-approvals.js +5 -1
- package/src/lib/record/form-approvals.js.map +1 -1
- package/src/lib/record/form-approvals.mjs +5 -1
- package/src/lib/record/form-approvals.mjs.map +1 -1
- package/src/lib/record/form.d.mts +4 -1
- package/src/lib/record/form.d.ts +4 -1
- package/src/lib/record/form.js +22 -11
- package/src/lib/record/form.js.map +1 -1
- package/src/lib/record/form.mjs +23 -12
- package/src/lib/record/form.mjs.map +1 -1
- package/src/lib/record/memory-approvals.d.mts +4 -1
- package/src/lib/record/memory-approvals.d.ts +4 -1
- package/src/lib/record/memory-approvals.js +29 -0
- package/src/lib/record/memory-approvals.js.map +1 -1
- package/src/lib/record/memory-approvals.mjs +29 -0
- package/src/lib/record/memory-approvals.mjs.map +1 -1
- package/src/lib/record/memory-data-source.js +14 -2
- package/src/lib/record/memory-data-source.js.map +1 -1
- package/src/lib/record/memory-data-source.mjs +14 -2
- package/src/lib/record/memory-data-source.mjs.map +1 -1
- package/src/lib/record/memory-views.js +9 -1
- package/src/lib/record/memory-views.js.map +1 -1
- package/src/lib/record/memory-views.mjs +9 -1
- package/src/lib/record/memory-views.mjs.map +1 -1
- package/src/lib/record/survey-kit.js +11 -0
- package/src/lib/record/survey-kit.js.map +1 -1
- package/src/lib/record/survey-kit.mjs +11 -0
- package/src/lib/record/survey-kit.mjs.map +1 -1
- package/src/runtime.d.mts +1 -1
- package/src/runtime.d.ts +1 -1
- package/src/runtime.js.map +1 -1
- package/src/runtime.mjs.map +1 -1
package/README.md
CHANGED
|
@@ -28,7 +28,7 @@ list of records — that your app implements;
|
|
|
28
28
|
The page format is also a JSON Schema, for editors and other languages:
|
|
29
29
|
`@fieldia/core/page.schema.json`.
|
|
30
30
|
|
|
31
|
-
A page says which format it is written in (`"fieldia": "0.
|
|
31
|
+
A page says which format it is written in (`"fieldia": "0.11"`, `FORMAT_VERSION`; a page in 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9 or 0.10 is read as it is).
|
|
32
32
|
One in an older format is brought up to date as it is read — by `checkPage`,
|
|
33
33
|
`validatePage` and `createForm`, so by the viewer and the designer too — and
|
|
34
34
|
`upgradePage` does it for the pages your app keeps. One newer than this Fieldia
|
|
@@ -481,9 +481,18 @@ to the viewer, at once; a headless app calls `form.save()` as `timeUp` changes.
|
|
|
481
481
|
`lock` (a step's default) keeps them for the person to send; a step's that
|
|
482
482
|
locks gives way to the next step. `form.countdown()` is the countdown showing
|
|
483
483
|
now (`{ scope, left, ends, stage: 'running' | 'warning' | 'up', … }`). Their
|
|
484
|
-
starts are kept in drafts (`StoredDraft.timers`), so a page
|
|
485
|
-
counting
|
|
486
|
-
|
|
484
|
+
starts are kept in drafts (`StoredDraft.timers`) with the answers, so a page
|
|
485
|
+
opened again goes on counting: a reload is never a way round a limit. A clock's
|
|
486
|
+
start is kept the moment it starts, and a draft whose clock started is laid at
|
|
487
|
+
once — never offered to be let go, even with `drafts.restore: "ask"`. Where the
|
|
488
|
+
app keeps no drafts (no `drafts`, no `saveDraft`), a timed page keeps them in
|
|
489
|
+
the tab's own store (`sessionStorage`): a reload goes on with the time left, or
|
|
490
|
+
— past its end — says the time is up and sends or locks as the page says. Sent,
|
|
491
|
+
or started again (`form.reset()`), the draft is let go: the next response is a
|
|
492
|
+
new one, with its own clock. The send tells `started` and `timeUp`. The clock is
|
|
493
|
+
the browser's, and another tab or device starts afresh: a server that must be
|
|
494
|
+
sure keeps its own (it has `started`), and takes one response per person
|
|
495
|
+
(`limits.onePerPerson`).
|
|
487
496
|
|
|
488
497
|
## Files stored as they are picked
|
|
489
498
|
|
|
@@ -1020,7 +1029,9 @@ A form keeps the person's changes to the record shown, for `form.undo()` and
|
|
|
1020
1029
|
moved — typing on in one box is one change until the box is left
|
|
1021
1030
|
(`boxLeft`). Each returns what it took (`{ field, line? }`), or null when
|
|
1022
1031
|
nothing is left; `form.history()` names the next of each without taking it.
|
|
1023
|
-
|
|
1032
|
+
A save starts them afresh, as a change saved is none to take back — but on a
|
|
1033
|
+
page with `autosave`, whose changes are taken back across its saves, and where
|
|
1034
|
+
a change made while it saved goes on past it. The changes are noted from the first; walking them is the undo part's
|
|
1024
1035
|
(`pressUndoPart`), asked for with the first change — in by the time a person
|
|
1025
1036
|
presses Ctrl+Z, and in at once where an app loads it first (`await
|
|
1026
1037
|
pressUndoPart.load()`): until it has come, `undo` and `redo` take nothing.
|
package/package.json
CHANGED
package/schema/page.schema.json
CHANGED
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
"0.7",
|
|
15
15
|
"0.8",
|
|
16
16
|
"0.9",
|
|
17
|
-
"0.10"
|
|
17
|
+
"0.10",
|
|
18
|
+
"0.11"
|
|
18
19
|
]
|
|
19
20
|
},
|
|
20
21
|
"id": {
|
|
@@ -10955,6 +10956,13 @@
|
|
|
10955
10956
|
"international",
|
|
10956
10957
|
"national"
|
|
10957
10958
|
]
|
|
10959
|
+
},
|
|
10960
|
+
"countries": {
|
|
10961
|
+
"type": "string",
|
|
10962
|
+
"enum": [
|
|
10963
|
+
"list",
|
|
10964
|
+
"native"
|
|
10965
|
+
]
|
|
10958
10966
|
}
|
|
10959
10967
|
},
|
|
10960
10968
|
"additionalProperties": false
|
|
@@ -301,7 +301,7 @@ export declare const PageDataSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
301
301
|
}, z.core.$strict>], "kind">;
|
|
302
302
|
export declare const PageSchema: z.ZodObject<{
|
|
303
303
|
fieldia: z.ZodEnum<{
|
|
304
|
-
|
|
304
|
+
0.11: "0.11";
|
|
305
305
|
0.1: "0.1";
|
|
306
306
|
0.2: "0.2";
|
|
307
307
|
0.3: "0.3";
|
|
@@ -311,6 +311,7 @@ export declare const PageSchema: z.ZodObject<{
|
|
|
311
311
|
0.7: "0.7";
|
|
312
312
|
0.8: "0.8";
|
|
313
313
|
0.9: "0.9";
|
|
314
|
+
"0.10": "0.10";
|
|
314
315
|
}>;
|
|
315
316
|
id: z.ZodString;
|
|
316
317
|
title: z.ZodOptional<z.ZodString>;
|
|
@@ -9363,6 +9364,10 @@ export declare const PageSchema: z.ZodObject<{
|
|
|
9363
9364
|
international: "international";
|
|
9364
9365
|
national: "national";
|
|
9365
9366
|
}>>;
|
|
9367
|
+
countries: z.ZodOptional<z.ZodEnum<{
|
|
9368
|
+
list: "list";
|
|
9369
|
+
native: "native";
|
|
9370
|
+
}>>;
|
|
9366
9371
|
}, z.core.$strict>>;
|
|
9367
9372
|
timeZone: z.ZodOptional<z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>>;
|
|
9368
9373
|
print: z.ZodOptional<z.ZodObject<{
|
package/src/lib/format/page.d.ts
CHANGED
|
@@ -301,7 +301,7 @@ export declare const PageDataSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
301
301
|
}, z.z.core.$strict>], "kind">;
|
|
302
302
|
export declare const PageSchema: z.ZodObject<{
|
|
303
303
|
fieldia: z.ZodEnum<{
|
|
304
|
-
|
|
304
|
+
0.11: "0.11";
|
|
305
305
|
0.1: "0.1";
|
|
306
306
|
0.2: "0.2";
|
|
307
307
|
0.3: "0.3";
|
|
@@ -311,6 +311,7 @@ export declare const PageSchema: z.ZodObject<{
|
|
|
311
311
|
0.7: "0.7";
|
|
312
312
|
0.8: "0.8";
|
|
313
313
|
0.9: "0.9";
|
|
314
|
+
"0.10": "0.10";
|
|
314
315
|
}>;
|
|
315
316
|
id: z.ZodString;
|
|
316
317
|
title: z.ZodOptional<z.ZodString>;
|
|
@@ -9363,6 +9364,10 @@ export declare const PageSchema: z.ZodObject<{
|
|
|
9363
9364
|
international: "international";
|
|
9364
9365
|
national: "national";
|
|
9365
9366
|
}>>;
|
|
9367
|
+
countries: z.ZodOptional<z.ZodEnum<{
|
|
9368
|
+
list: "list";
|
|
9369
|
+
native: "native";
|
|
9370
|
+
}>>;
|
|
9366
9371
|
}, z.z.core.$strict>>;
|
|
9367
9372
|
timeZone: z.ZodOptional<z.ZodString & z.ZodType<string, string, z.z.core.$ZodTypeInternals<string, string>>>;
|
|
9368
9373
|
print: z.ZodOptional<z.ZodObject<{
|
|
@@ -6,6 +6,10 @@ export declare const PagePhoneSchema: z.ZodObject<{
|
|
|
6
6
|
international: "international";
|
|
7
7
|
national: "national";
|
|
8
8
|
}>>;
|
|
9
|
+
countries: z.ZodOptional<z.ZodEnum<{
|
|
10
|
+
list: "list";
|
|
11
|
+
native: "native";
|
|
12
|
+
}>>;
|
|
9
13
|
}, z.core.$strict>;
|
|
10
14
|
export type PagePhone = z.infer<typeof PagePhoneSchema>;
|
|
11
15
|
/** A phone field's own: the page's settings, for this field. Its other options stay as they are. */
|
|
@@ -15,6 +19,10 @@ export declare const PhoneOptionsSchema: z.ZodObject<{
|
|
|
15
19
|
international: "international";
|
|
16
20
|
national: "national";
|
|
17
21
|
}>>;
|
|
22
|
+
countries: z.ZodOptional<z.ZodEnum<{
|
|
23
|
+
list: "list";
|
|
24
|
+
native: "native";
|
|
25
|
+
}>>;
|
|
18
26
|
}, z.core.$strip>;
|
|
19
27
|
export type PhoneOptions = z.infer<typeof PhoneOptionsSchema>;
|
|
20
28
|
/** The issues of a phone field's settings, each at its path under `options`. */
|
|
@@ -6,6 +6,10 @@ export declare const PagePhoneSchema: z.ZodObject<{
|
|
|
6
6
|
international: "international";
|
|
7
7
|
national: "national";
|
|
8
8
|
}>>;
|
|
9
|
+
countries: z.ZodOptional<z.ZodEnum<{
|
|
10
|
+
list: "list";
|
|
11
|
+
native: "native";
|
|
12
|
+
}>>;
|
|
9
13
|
}, z.z.core.$strict>;
|
|
10
14
|
export type PagePhone = z.infer<typeof PagePhoneSchema>;
|
|
11
15
|
/** A phone field's own: the page's settings, for this field. Its other options stay as they are. */
|
|
@@ -15,6 +19,10 @@ export declare const PhoneOptionsSchema: z.ZodObject<{
|
|
|
15
19
|
international: "international";
|
|
16
20
|
national: "national";
|
|
17
21
|
}>>;
|
|
22
|
+
countries: z.ZodOptional<z.ZodEnum<{
|
|
23
|
+
list: "list";
|
|
24
|
+
native: "native";
|
|
25
|
+
}>>;
|
|
18
26
|
}, z.z.core.$strip>;
|
|
19
27
|
export type PhoneOptions = z.infer<typeof PhoneOptionsSchema>;
|
|
20
28
|
/** The issues of a phone field's settings, each at its path under `options`. */
|
package/src/lib/format/phone.js
CHANGED
|
@@ -15,19 +15,23 @@ const jitless_1 = require("./jitless");
|
|
|
15
15
|
* neither keeps its phone fields as text boxes, as before. `country` is the one a number typed without its + is read
|
|
16
16
|
* in, by its ISO code — never assumed: left out, a number is written with its + and country code, or its country
|
|
17
17
|
* picked beside it. `shown` writes a number at rest abroad's way ("+20 10 1234 5678", the default) or at home's
|
|
18
|
-
* ("010 1234 5678") — a number of another country always abroad's.
|
|
18
|
+
* ("010 1234 5678") — a number of another country always abroad's. `countries` says how the country is picked: from
|
|
19
|
+
* Fieldia's own list, found by typing a country's name, its code or its dialling code ("list", the default), or from
|
|
20
|
+
* the browser's own list of every country ("native"), for an app that would rather have the system's picker.
|
|
19
21
|
*
|
|
20
22
|
* "phone": { "country": "EG", "shown": "national" }
|
|
21
|
-
* { "field": "mobile", "widget": "phone", "options": { "country": "AE" } }
|
|
23
|
+
* { "field": "mobile", "widget": "phone", "options": { "country": "AE", "countries": "native" } }
|
|
22
24
|
*/
|
|
23
25
|
const COUNTRY = /^[A-Z]{2}$/;
|
|
24
26
|
const country = z.string().regex(COUNTRY, 'a country is its ISO code in capitals, such as "EG"');
|
|
25
27
|
const shown = z.enum(['international', 'national'], { error: 'shown is "international" (+20 10 1234 5678) or "national" (010 1234 5678)' });
|
|
28
|
+
const countries = z.enum(['list', 'native'], { error: 'countries is "list" (Fieldia’s own, found by typing) or "native" (the browser’s own list)' });
|
|
26
29
|
/** A page's phone numbers: the country a number typed without its + is read in, and how a number is shown at rest. */
|
|
27
30
|
exports.PagePhoneSchema = z
|
|
28
31
|
.strictObject({
|
|
29
32
|
country: country.optional(),
|
|
30
33
|
shown: shown.optional(),
|
|
34
|
+
countries: countries.optional(),
|
|
31
35
|
})
|
|
32
36
|
.meta({ id: 'PagePhone' });
|
|
33
37
|
/** A phone field's own: the page's settings, for this field. Its other options stay as they are. */
|
|
@@ -35,6 +39,7 @@ exports.PhoneOptionsSchema = z
|
|
|
35
39
|
.object({
|
|
36
40
|
country: country.optional(),
|
|
37
41
|
shown: shown.optional(),
|
|
42
|
+
countries: countries.optional(),
|
|
38
43
|
})
|
|
39
44
|
.meta({ id: 'PhoneOptions' });
|
|
40
45
|
/** The issues of a phone field's settings, each at its path under `options`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"phone.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/format/phone.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"phone.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/format/phone.ts"],"names":[],"mappings":";;;AAmDA,8CAGC;AAtDD,yBAAyB;AACzB,uCAA+C;AAE/C,oGAAoG;AACpG,IAAA,4BAAkB,GAAE,CAAC;AAErB;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,OAAO,GAAG,YAAY,CAAC;AAC7B,MAAM,OAAO,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,qDAAqD,CAAC,CAAC;AACjG,MAAM,KAAK,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,UAAU,CAAC,EAAE,EAAE,KAAK,EAAE,2EAA2E,EAAE,CAAC,CAAC;AAC5I,MAAM,SAAS,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,EAAE,2FAA2F,EAAE,CAAC,CAAC;AAErJ,sHAAsH;AACzG,QAAA,eAAe,GAAG,CAAC;KAC7B,YAAY,CAAC;IACZ,OAAO,EAAE,OAAO,CAAC,QAAQ,EAAE;IAC3B,KAAK,EAAE,KAAK,CAAC,QAAQ,EAAE;IACvB,SAAS,EAAE,SAAS,CAAC,QAAQ,EAAE;CAChC,CAAC;KACD,IAAI,CAAC,EAAE,EAAE,EAAE,WAAW,EAAE,CAAC,CAAC;AAI7B,oGAAoG;AACvF,QAAA,kBAAkB,GAAG,CAAC;KAChC,MAAM,CAAC;IACN,OAAO,EAAE,OAAO,CAAC,QAAQ,EAAE;IAC3B,KAAK,EAAE,KAAK,CAAC,QAAQ,EAAE;IACvB,SAAS,EAAE,SAAS,CAAC,QAAQ,EAAE;CAChC,CAAC;KACD,IAAI,CAAC,EAAE,EAAE,EAAE,cAAc,EAAE,CAAC,CAAC;AAIhC,gFAAgF;AAChF,SAAgB,iBAAiB,CAAC,IAA4D;IAC5F,IAAI,IAAI,CAAC,MAAM,KAAK,OAAO;QAAE,OAAO,EAAE,CAAC;IACvC,OAAO,CAAC,0BAAkB,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,IAAI,EAAE,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;AACtL,CAAC"}
|
package/src/lib/format/phone.mjs
CHANGED
|
@@ -11,19 +11,23 @@ makeSchemasJitless();
|
|
|
11
11
|
* neither keeps its phone fields as text boxes, as before. `country` is the one a number typed without its + is read
|
|
12
12
|
* in, by its ISO code — never assumed: left out, a number is written with its + and country code, or its country
|
|
13
13
|
* picked beside it. `shown` writes a number at rest abroad's way ("+20 10 1234 5678", the default) or at home's
|
|
14
|
-
* ("010 1234 5678") — a number of another country always abroad's.
|
|
14
|
+
* ("010 1234 5678") — a number of another country always abroad's. `countries` says how the country is picked: from
|
|
15
|
+
* Fieldia's own list, found by typing a country's name, its code or its dialling code ("list", the default), or from
|
|
16
|
+
* the browser's own list of every country ("native"), for an app that would rather have the system's picker.
|
|
15
17
|
*
|
|
16
18
|
* "phone": { "country": "EG", "shown": "national" }
|
|
17
|
-
* { "field": "mobile", "widget": "phone", "options": { "country": "AE" } }
|
|
19
|
+
* { "field": "mobile", "widget": "phone", "options": { "country": "AE", "countries": "native" } }
|
|
18
20
|
*/
|
|
19
21
|
const COUNTRY = /^[A-Z]{2}$/;
|
|
20
22
|
const country = z.string().regex(COUNTRY, 'a country is its ISO code in capitals, such as "EG"');
|
|
21
23
|
const shown = z.enum(['international', 'national'], { error: 'shown is "international" (+20 10 1234 5678) or "national" (010 1234 5678)' });
|
|
24
|
+
const countries = z.enum(['list', 'native'], { error: 'countries is "list" (Fieldia’s own, found by typing) or "native" (the browser’s own list)' });
|
|
22
25
|
/** A page's phone numbers: the country a number typed without its + is read in, and how a number is shown at rest. */
|
|
23
26
|
export const PagePhoneSchema = z
|
|
24
27
|
.strictObject({
|
|
25
28
|
country: country.optional(),
|
|
26
29
|
shown: shown.optional(),
|
|
30
|
+
countries: countries.optional(),
|
|
27
31
|
})
|
|
28
32
|
.meta({ id: 'PagePhone' });
|
|
29
33
|
/** A phone field's own: the page's settings, for this field. Its other options stay as they are. */
|
|
@@ -31,6 +35,7 @@ export const PhoneOptionsSchema = z
|
|
|
31
35
|
.object({
|
|
32
36
|
country: country.optional(),
|
|
33
37
|
shown: shown.optional(),
|
|
38
|
+
countries: countries.optional(),
|
|
34
39
|
})
|
|
35
40
|
.meta({ id: 'PhoneOptions' });
|
|
36
41
|
/** The issues of a phone field's settings, each at its path under `options`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"phone.mjs","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/format/phone.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAE/C,oGAAoG;AACpG,kBAAkB,EAAE,CAAC;AAErB
|
|
1
|
+
{"version":3,"file":"phone.mjs","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/format/phone.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAE/C,oGAAoG;AACpG,kBAAkB,EAAE,CAAC;AAErB;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,OAAO,GAAG,YAAY,CAAC;AAC7B,MAAM,OAAO,GAA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AAE,IAAI,EAAE,CAAC,SAAS,EAAE,GAAG,KAAK,CAAC,IAAI,CAAwB,EAAE,CAAC,CAAC,CAAC;AACtL,CAAC"}
|
|
@@ -39,7 +39,9 @@ export interface PageUpgrade {
|
|
|
39
39
|
* `loadChildren` and `gantt`, a date's `precision` and `hijri`, an option's `caption`, `icon` and `color`, a page's
|
|
40
40
|
* `quiz`, `review`, `flow`, `timeLimit`, `prefill`, `payment`, `outbox` and `templates`, a question's own `quiz`, a
|
|
41
41
|
* step's and a group's `order`, `draw` and `fixed`, a button's `undo` — so a 0.9 page is a 0.10 page as it
|
|
42
|
-
* is (and 0.10 is after 0.9: versions compare as numbers, `compareFormats`)
|
|
42
|
+
* is (and 0.10 is after 0.9: versions compare as numbers, `compareFormats`); and 0.11 (Fieldia 0.32) only added — how a
|
|
43
|
+
* phone's country is picked, a page's `phone.countries` and a phone field's `options.countries` ("list" or "native") —
|
|
44
|
+
* so a 0.10 page is a 0.11 page as it is. A release that renames or reshapes a setting adds a step here, with its example; one that only adds needs
|
|
43
45
|
* none: the page is the same, and upgradePage writes the new version in it.
|
|
44
46
|
*/
|
|
45
47
|
export declare const PAGE_UPGRADES: readonly PageUpgrade[];
|
|
@@ -39,7 +39,9 @@ export interface PageUpgrade {
|
|
|
39
39
|
* `loadChildren` and `gantt`, a date's `precision` and `hijri`, an option's `caption`, `icon` and `color`, a page's
|
|
40
40
|
* `quiz`, `review`, `flow`, `timeLimit`, `prefill`, `payment`, `outbox` and `templates`, a question's own `quiz`, a
|
|
41
41
|
* step's and a group's `order`, `draw` and `fixed`, a button's `undo` — so a 0.9 page is a 0.10 page as it
|
|
42
|
-
* is (and 0.10 is after 0.9: versions compare as numbers, `compareFormats`)
|
|
42
|
+
* is (and 0.10 is after 0.9: versions compare as numbers, `compareFormats`); and 0.11 (Fieldia 0.32) only added — how a
|
|
43
|
+
* phone's country is picked, a page's `phone.countries` and a phone field's `options.countries` ("list" or "native") —
|
|
44
|
+
* so a 0.10 page is a 0.11 page as it is. A release that renames or reshapes a setting adds a step here, with its example; one that only adds needs
|
|
43
45
|
* none: the page is the same, and upgradePage writes the new version in it.
|
|
44
46
|
*/
|
|
45
47
|
export declare const PAGE_UPGRADES: readonly PageUpgrade[];
|
|
@@ -26,7 +26,9 @@ const version_1 = require("./version");
|
|
|
26
26
|
* `loadChildren` and `gantt`, a date's `precision` and `hijri`, an option's `caption`, `icon` and `color`, a page's
|
|
27
27
|
* `quiz`, `review`, `flow`, `timeLimit`, `prefill`, `payment`, `outbox` and `templates`, a question's own `quiz`, a
|
|
28
28
|
* step's and a group's `order`, `draw` and `fixed`, a button's `undo` — so a 0.9 page is a 0.10 page as it
|
|
29
|
-
* is (and 0.10 is after 0.9: versions compare as numbers, `compareFormats`)
|
|
29
|
+
* is (and 0.10 is after 0.9: versions compare as numbers, `compareFormats`); and 0.11 (Fieldia 0.32) only added — how a
|
|
30
|
+
* phone's country is picked, a page's `phone.countries` and a phone field's `options.countries` ("list" or "native") —
|
|
31
|
+
* so a 0.10 page is a 0.11 page as it is. A release that renames or reshapes a setting adds a step here, with its example; one that only adds needs
|
|
30
32
|
* none: the page is the same, and upgradePage writes the new version in it.
|
|
31
33
|
*/
|
|
32
34
|
exports.PAGE_UPGRADES = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upgrade.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/format/upgrade.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"upgrade.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/format/upgrade.ts"],"names":[],"mappings":";;;AAiEA,kCAYC;AA7ED,uCAA4D;AAiB5D;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACU,QAAA,aAAa,GAA2B,EAAE,CAAC;AAQxD,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAqB,EAAE,CAAC,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,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AAE,OAAO,EAAE,OAAO,EAAO,CAAC;AAC5C,CAAC"}
|
|
@@ -22,7 +22,9 @@ import { compareFormats, FORMAT_VERSIONS } from './version.mjs';
|
|
|
22
22
|
* `loadChildren` and `gantt`, a date's `precision` and `hijri`, an option's `caption`, `icon` and `color`, a page's
|
|
23
23
|
* `quiz`, `review`, `flow`, `timeLimit`, `prefill`, `payment`, `outbox` and `templates`, a question's own `quiz`, a
|
|
24
24
|
* step's and a group's `order`, `draw` and `fixed`, a button's `undo` — so a 0.9 page is a 0.10 page as it
|
|
25
|
-
* is (and 0.10 is after 0.9: versions compare as numbers, `compareFormats`)
|
|
25
|
+
* is (and 0.10 is after 0.9: versions compare as numbers, `compareFormats`); and 0.11 (Fieldia 0.32) only added — how a
|
|
26
|
+
* phone's country is picked, a page's `phone.countries` and a phone field's `options.countries` ("list" or "native") —
|
|
27
|
+
* so a 0.10 page is a 0.11 page as it is. A release that renames or reshapes a setting adds a step here, with its example; one that only adds needs
|
|
26
28
|
* none: the page is the same, and upgradePage writes the new version in it.
|
|
27
29
|
*/
|
|
28
30
|
export const PAGE_UPGRADES = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upgrade.mjs","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/format/upgrade.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAiB5D
|
|
1
|
+
{"version":3,"file":"upgrade.mjs","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/format/upgrade.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAiB5D;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,CAAC,MAAM,aAAa,GAA2B,EAAE,CAAC;AAQxD,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAqB,EAAE,CAAC,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK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,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,OAAO,EAAO,CAAC;AAC5C,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/** The page format version this build reads and writes. */
|
|
2
|
-
export declare const FORMAT_VERSION: "0.
|
|
2
|
+
export declare const FORMAT_VERSION: "0.11";
|
|
3
3
|
/**
|
|
4
4
|
* Every format Fieldia has had, oldest first; the last is FORMAT_VERSION. A page in an older one is brought up to date
|
|
5
5
|
* by `upgradePage`, step by step (`PAGE_UPGRADES`), wherever it is read: `checkPage`, `validatePage`, the viewer, the
|
|
6
6
|
* designer. A release that changes what a page may say adds its version here (see the format's docs, "Versions").
|
|
7
7
|
*/
|
|
8
|
-
export declare const FORMAT_VERSIONS: readonly ["0.1", "0.2", "0.3", "0.4", "0.5", "0.6", "0.7", "0.8", "0.9", "0.10"];
|
|
8
|
+
export declare const FORMAT_VERSIONS: readonly ["0.1", "0.2", "0.3", "0.4", "0.5", "0.6", "0.7", "0.8", "0.9", "0.10", "0.11"];
|
|
9
9
|
/** A format Fieldia has had: a page may say any of them, and is read in the current one. */
|
|
10
10
|
export type FormatVersion = (typeof FORMAT_VERSIONS)[number];
|
|
11
11
|
/** Which of two format versions is newer: below 0 when `a` is older, 0 when they are the same, null when either is not a version. */
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/** The page format version this build reads and writes. */
|
|
2
|
-
export declare const FORMAT_VERSION: "0.
|
|
2
|
+
export declare const FORMAT_VERSION: "0.11";
|
|
3
3
|
/**
|
|
4
4
|
* Every format Fieldia has had, oldest first; the last is FORMAT_VERSION. A page in an older one is brought up to date
|
|
5
5
|
* by `upgradePage`, step by step (`PAGE_UPGRADES`), wherever it is read: `checkPage`, `validatePage`, the viewer, the
|
|
6
6
|
* designer. A release that changes what a page may say adds its version here (see the format's docs, "Versions").
|
|
7
7
|
*/
|
|
8
|
-
export declare const FORMAT_VERSIONS: readonly ["0.1", "0.2", "0.3", "0.4", "0.5", "0.6", "0.7", "0.8", "0.9", "0.10"];
|
|
8
|
+
export declare const FORMAT_VERSIONS: readonly ["0.1", "0.2", "0.3", "0.4", "0.5", "0.6", "0.7", "0.8", "0.9", "0.10", "0.11"];
|
|
9
9
|
/** A format Fieldia has had: a page may say any of them, and is read in the current one. */
|
|
10
10
|
export type FormatVersion = (typeof FORMAT_VERSIONS)[number];
|
|
11
11
|
/** Which of two format versions is newer: below 0 when `a` is older, 0 when they are the same, null when either is not a version. */
|
|
@@ -4,13 +4,13 @@ exports.FORMAT_VERSIONS = exports.FORMAT_VERSION = void 0;
|
|
|
4
4
|
exports.compareFormats = compareFormats;
|
|
5
5
|
exports.formatProblem = formatProblem;
|
|
6
6
|
/** The page format version this build reads and writes. */
|
|
7
|
-
exports.FORMAT_VERSION = '0.
|
|
7
|
+
exports.FORMAT_VERSION = '0.11';
|
|
8
8
|
/**
|
|
9
9
|
* Every format Fieldia has had, oldest first; the last is FORMAT_VERSION. A page in an older one is brought up to date
|
|
10
10
|
* by `upgradePage`, step by step (`PAGE_UPGRADES`), wherever it is read: `checkPage`, `validatePage`, the viewer, the
|
|
11
11
|
* designer. A release that changes what a page may say adds its version here (see the format's docs, "Versions").
|
|
12
12
|
*/
|
|
13
|
-
exports.FORMAT_VERSIONS = ['0.1', '0.2', '0.3', '0.4', '0.5', '0.6', '0.7', '0.8', '0.9', '0.10'];
|
|
13
|
+
exports.FORMAT_VERSIONS = ['0.1', '0.2', '0.3', '0.4', '0.5', '0.6', '0.7', '0.8', '0.9', '0.10', '0.11'];
|
|
14
14
|
/** `major.minor` as two numbers, or null when it is not a version at all. */
|
|
15
15
|
function parts(version) {
|
|
16
16
|
const match = typeof version === 'string' ? /^(\d+)\.(\d+)$/.exec(version) : null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/format/version.ts"],"names":[],"mappings":";;;AAoBA,wCAIC;AAMD,sCAQC;AAtCD,2DAA2D;AAC9C,QAA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C,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AACpC,CAAC;AAED;;;GAGG;AACH,SAAgB,aAAa,CAAC,OAAgB,EAAE,WAA8B,uBAAe;IAC3F,MAAM,OAAO,GAAG,QAAQ,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC9C,IAAI,OAAO,KAAK,OAAO;QAAE,OAAO,IAAI,CAAC;IACrC,MAAM,QAAQ,GAAG,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAClD,IAAI,QAAQ,KAAK,IAAI;QAAE,OAAO,wDAAwD,OAAO,oBAAoB,CAAC;IAClH,IAAI,QAAQ,GAAG,CAAC;QAAE,OAAO,0BAA0B,OAAiB,oCAAoC,OAAO,8BAA8B,CAAC;IAC9I,IAAI,QAAQ,CAAC,QAAQ,CAAC,OAAiB,CAAC;QAAE,OAAO,0BAA0B,OAAiB,oCAAoC,OAAO,EAAE,CAAC;IAC1I,OAAO,UAAU,OAAiB,mDAAmD,OAAO,EAAE,CAAC;AACjG,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/** The page format version this build reads and writes. */
|
|
2
|
-
export const FORMAT_VERSION = '0.
|
|
2
|
+
export const FORMAT_VERSION = '0.11';
|
|
3
3
|
/**
|
|
4
4
|
* Every format Fieldia has had, oldest first; the last is FORMAT_VERSION. A page in an older one is brought up to date
|
|
5
5
|
* by `upgradePage`, step by step (`PAGE_UPGRADES`), wherever it is read: `checkPage`, `validatePage`, the viewer, the
|
|
6
6
|
* designer. A release that changes what a page may say adds its version here (see the format's docs, "Versions").
|
|
7
7
|
*/
|
|
8
|
-
export const FORMAT_VERSIONS = ['0.1', '0.2', '0.3', '0.4', '0.5', '0.6', '0.7', '0.8', '0.9', '0.10'];
|
|
8
|
+
export const FORMAT_VERSIONS = ['0.1', '0.2', '0.3', '0.4', '0.5', '0.6', '0.7', '0.8', '0.9', '0.10', '0.11'];
|
|
9
9
|
/** `major.minor` as two numbers, or null when it is not a version at all. */
|
|
10
10
|
function parts(version) {
|
|
11
11
|
const match = typeof version === 'string' ? /^(\d+)\.(\d+)$/.exec(version) : null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.mjs","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/format/version.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D,MAAM,CAAC,MAAM,cAAc,GAAG,MAAe,CAAC;AAE9C;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,CAAsC,CAAC;
|
|
1
|
+
{"version":3,"file":"version.mjs","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/format/version.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D,MAAM,CAAC,MAAM,cAAc,GAAG,MAAe,CAAC;AAE9C;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAsC,CAAC;AAKpJ,6EAA6E;AAC7E,SAAS,KAAK,CAAC,OAAgB;IAC7B,MAAM,KAAK,GAAG,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAClF,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAC7D,CAAC;AAED,qIAAqI;AACrI,MAAM,UAAU,cAAc,CAAC,CAAU,EAAE,CAAU;IACnD,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACpC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IAC1B,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AACpC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,OAAgB,EAAE,WAA8B,eAAe;IAC3F,MAAM,OAAO,GAAG,QAAQ,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC9C,IAAI,OAAO,KAAK,OAAO;QAAE,OAAO,IAAI,CAAC;IACrC,MAAM,QAAQ,GAAG,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAClD,IAAI,QAAQ,KAAK,IAAI;QAAE,OAAO,wDAAwD,OAAO,oBAAoB,CAAC;IAClH,IAAI,QAAQ,GAAG,CAAC;QAAE,OAAO,0BAA0B,OAAiB,oCAAoC,OAAO,8BAA8B,CAAC;IAC9I,IAAI,QAAQ,CAAC,QAAQ,CAAC,OAAiB,CAAC;QAAE,OAAO,0BAA0B,OAAiB,oCAAoC,OAAO,EAAE,CAAC;IAC1I,OAAO,UAAU,OAAiB,mDAAmD,OAAO,EAAE,CAAC;AACjG,CAAC"}
|
|
@@ -2,7 +2,7 @@ import type { FilterCondition, Fields, Option, PropertyDefinition } from '../for
|
|
|
2
2
|
import type { QuizResults } from './quiz.mjs';
|
|
3
3
|
import type { JsonValue } from '../format/json.mjs';
|
|
4
4
|
import type { Page } from '../format/page.mjs';
|
|
5
|
-
import type { FileValue, RecordId, RelatedRecord, Values } from './values.mjs';
|
|
5
|
+
import type { FileValue, RecordId, RelatedRecord, Value, Values } from './values.mjs';
|
|
6
6
|
import type { RunStop } from './run.mjs';
|
|
7
7
|
import type { DateInterval } from './periods.mjs';
|
|
8
8
|
import type { Facet } from './search.mjs';
|
|
@@ -324,13 +324,25 @@ export interface ApprovalLevel {
|
|
|
324
324
|
needs?: 'any' | 'all';
|
|
325
325
|
state: ApprovalLevelState;
|
|
326
326
|
}
|
|
327
|
-
/**
|
|
327
|
+
/** A field someone changed on a record on its way to approval: what it held, and what it holds now. */
|
|
328
|
+
export interface ApprovalChange {
|
|
329
|
+
field: string;
|
|
330
|
+
/** The field's label, as the page said it when it was changed: said where the field is no longer the page's. */
|
|
331
|
+
label?: string;
|
|
332
|
+
from: Value;
|
|
333
|
+
to: Value;
|
|
334
|
+
}
|
|
335
|
+
/** What happened on a record's way to approval: sent for it, a decision at a level, or a change — who, when, and why. */
|
|
328
336
|
export interface ApprovalEntry {
|
|
329
337
|
/**
|
|
330
|
-
* A decision at a level, the record sent for approval (`requested`: each round of asking starts with one),
|
|
331
|
-
*
|
|
338
|
+
* A decision at a level, the record sent for approval (`requested`: each round of asking starts with one), sent and
|
|
339
|
+
* moved on at once as its rules asked no level of it (`notNeeded`: "No approval needed") — or the record `changed`
|
|
340
|
+
* while it waited for a decision, or after a rejection, by someone (`changes`: each field, what it held and holds),
|
|
341
|
+
* as the app's engine keeps such changes: the trail of who changed what while others were deciding on it.
|
|
332
342
|
*/
|
|
333
|
-
decision: ApprovalDecision | 'requested' | 'notNeeded';
|
|
343
|
+
decision: ApprovalDecision | 'requested' | 'notNeeded' | 'changed';
|
|
344
|
+
/** A change's fields, each with what it held and what it holds now: a `changed` entry's. */
|
|
345
|
+
changes?: ApprovalChange[];
|
|
334
346
|
/** The level decided at, by its id; none for `requested` and `notNeeded`. */
|
|
335
347
|
level?: string;
|
|
336
348
|
/** The level's name, where it is no longer among the record's levels: its id is said otherwise. */
|
|
@@ -2,7 +2,7 @@ import type { FilterCondition, Fields, Option, PropertyDefinition } from '../for
|
|
|
2
2
|
import type { QuizResults } from './quiz';
|
|
3
3
|
import type { JsonValue } from '../format/json';
|
|
4
4
|
import type { Page } from '../format/page';
|
|
5
|
-
import type { FileValue, RecordId, RelatedRecord, Values } from './values';
|
|
5
|
+
import type { FileValue, RecordId, RelatedRecord, Value, Values } from './values';
|
|
6
6
|
import type { RunStop } from './run';
|
|
7
7
|
import type { DateInterval } from './periods';
|
|
8
8
|
import type { Facet } from './search';
|
|
@@ -324,13 +324,25 @@ export interface ApprovalLevel {
|
|
|
324
324
|
needs?: 'any' | 'all';
|
|
325
325
|
state: ApprovalLevelState;
|
|
326
326
|
}
|
|
327
|
-
/**
|
|
327
|
+
/** A field someone changed on a record on its way to approval: what it held, and what it holds now. */
|
|
328
|
+
export interface ApprovalChange {
|
|
329
|
+
field: string;
|
|
330
|
+
/** The field's label, as the page said it when it was changed: said where the field is no longer the page's. */
|
|
331
|
+
label?: string;
|
|
332
|
+
from: Value;
|
|
333
|
+
to: Value;
|
|
334
|
+
}
|
|
335
|
+
/** What happened on a record's way to approval: sent for it, a decision at a level, or a change — who, when, and why. */
|
|
328
336
|
export interface ApprovalEntry {
|
|
329
337
|
/**
|
|
330
|
-
* A decision at a level, the record sent for approval (`requested`: each round of asking starts with one),
|
|
331
|
-
*
|
|
338
|
+
* A decision at a level, the record sent for approval (`requested`: each round of asking starts with one), sent and
|
|
339
|
+
* moved on at once as its rules asked no level of it (`notNeeded`: "No approval needed") — or the record `changed`
|
|
340
|
+
* while it waited for a decision, or after a rejection, by someone (`changes`: each field, what it held and holds),
|
|
341
|
+
* as the app's engine keeps such changes: the trail of who changed what while others were deciding on it.
|
|
332
342
|
*/
|
|
333
|
-
decision: ApprovalDecision | 'requested' | 'notNeeded';
|
|
343
|
+
decision: ApprovalDecision | 'requested' | 'notNeeded' | 'changed';
|
|
344
|
+
/** A change's fields, each with what it held and what it holds now: a `changed` entry's. */
|
|
345
|
+
changes?: ApprovalChange[];
|
|
334
346
|
/** The level decided at, by its id; none for `requested` and `notNeeded`. */
|
|
335
347
|
level?: string;
|
|
336
348
|
/** The level's name, where it is no longer among the record's levels: its id is said otherwise. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-source.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/record/data-source.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"data-source.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/record/data-source.ts"],"names":[],"mappings":";;;AAs8BA,oCAEC;AAGD,wCAGC;AAqfD,kCAEC;AAGD,sCAMC;AAgDD,sCAOC;AAhkBD,6GAA6G;AAC7G,SAAgB,YAAY,CAAC,MAAc,EAAE,OAA6D,EAAE;IAC1G,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;AAC/H,CAAC;AAED,6HAA6H;AAC7H,SAAgB,cAAc,CAAC,MAA6B;IAC1D,MAAM,MAAM,GAAG,MAA+B,CAAC;IAC/C,OAAO,MAAM,CAAC,OAAO,KAAK,IAAI,IAAI,MAAM,CAAC,MAAM,KAAK,IAAI,IAAI,OAAO,MAAM,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAE,MAAuB,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAgB,EAAE,CAAC;AACzK,CAAC;AAmeD;;;;;GAKG;AACH,MAAa,aAAc,SAAQ,KAAK;IAC7B,QAAQ,CAAe;IACvB,OAAO,CAAc;IAC9B,YAAY,QAAsB,EAAE,OAAO,GAAG,sDAAsD;QAClG,KAAK,CAAC,OAAO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IAAI,KAAK,WAAW;YAAE,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAE,KAAyB,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;;YACjK,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;IACpC,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;AACtD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-source.mjs","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/record/data-source.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"data-source.mjs","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/record/data-source.ts"],"names":[],"mappings":"AAq8BA,6GAA6G;AAC7G,MAAM,UAAU,YAAY,CAAC,MAAc,EAAE,OAA6D,EAAE;IAC1G,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;AAC/H,CAAC;AAED,6HAA6H;AAC7H,MAAM,UAAU,cAAc,CAAC,MAA6B;IAC1D,MAAM,MAAM,GAAG,MAA+B,CAAC;IAC/C,OAAO,MAAM,CAAC,OAAO,KAAK,IAAI,IAAI,MAAM,CA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CAAC;AACpC,CAAC;AA2CD;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,KAAa,EAAE,MAAc,EAAE,MAAc;IACzE,MAAM,OAAO,GAAkB,EAAE,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;IACpE,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QACnD,IAAI,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,KAAK,WAAW;YAAE,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAE,KAAyB,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;;YACjK,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;IACpC,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;AACtD,CAAC"}
|
|
@@ -1,9 +1,18 @@
|
|
|
1
|
+
import type { Page } from '../format/page.mjs';
|
|
1
2
|
import type { StoredDraft } from './data-source.mjs';
|
|
3
|
+
import type { DraftStore } from './form.mjs';
|
|
2
4
|
/**
|
|
3
5
|
* Drafts: what is typed kept to be offered again, in the browser's store (`drafts.store`) or on the app's server (the
|
|
4
6
|
* data source's `saveDraft` and `loadDraft`), the store keeping only its key then. A draft keeps the answers, the
|
|
5
7
|
* wizard's step and the optional steps passed over, and text typed that does not read yet, as it was typed.
|
|
6
8
|
*/
|
|
9
|
+
/**
|
|
10
|
+
* Where a timed page (`timeLimit` on the page or a step: a page of responses, its checks say) keeps its drafts when the
|
|
11
|
+
* app keeps none: the tab's own store (sessionStorage), so a reload goes on with the time left and the answers given — a
|
|
12
|
+
* reload is never a way round a limit. None where the browser has none, or refuses it. Known as the form is made, before
|
|
13
|
+
* the survey flow's part has come: the draft is looked for then.
|
|
14
|
+
*/
|
|
15
|
+
export declare function timedStore(page: Page): DraftStore | undefined;
|
|
7
16
|
/** A draft as the browser's store keeps it: the draft itself, or — kept on the app's server — its key. */
|
|
8
17
|
export type KeptDraft = StoredDraft | {
|
|
9
18
|
savedAt: string;
|
|
@@ -1,9 +1,18 @@
|
|
|
1
|
+
import type { Page } from '../format/page';
|
|
1
2
|
import type { StoredDraft } from './data-source';
|
|
3
|
+
import type { DraftStore } from './form';
|
|
2
4
|
/**
|
|
3
5
|
* Drafts: what is typed kept to be offered again, in the browser's store (`drafts.store`) or on the app's server (the
|
|
4
6
|
* data source's `saveDraft` and `loadDraft`), the store keeping only its key then. A draft keeps the answers, the
|
|
5
7
|
* wizard's step and the optional steps passed over, and text typed that does not read yet, as it was typed.
|
|
6
8
|
*/
|
|
9
|
+
/**
|
|
10
|
+
* Where a timed page (`timeLimit` on the page or a step: a page of responses, its checks say) keeps its drafts when the
|
|
11
|
+
* app keeps none: the tab's own store (sessionStorage), so a reload goes on with the time left and the answers given — a
|
|
12
|
+
* reload is never a way round a limit. None where the browser has none, or refuses it. Known as the form is made, before
|
|
13
|
+
* the survey flow's part has come: the draft is looked for then.
|
|
14
|
+
*/
|
|
15
|
+
export declare function timedStore(page: Page): DraftStore | undefined;
|
|
7
16
|
/** A draft as the browser's store keeps it: the draft itself, or — kept on the app's server — its key. */
|
|
8
17
|
export type KeptDraft = StoredDraft | {
|
|
9
18
|
savedAt: string;
|
package/src/lib/record/drafts.js
CHANGED
|
@@ -1,7 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.timedStore = timedStore;
|
|
3
4
|
exports.draftRead = draftRead;
|
|
4
5
|
exports.resumeStep = resumeStep;
|
|
6
|
+
/**
|
|
7
|
+
* Drafts: what is typed kept to be offered again, in the browser's store (`drafts.store`) or on the app's server (the
|
|
8
|
+
* data source's `saveDraft` and `loadDraft`), the store keeping only its key then. A draft keeps the answers, the
|
|
9
|
+
* wizard's step and the optional steps passed over, and text typed that does not read yet, as it was typed.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Where a timed page (`timeLimit` on the page or a step: a page of responses, its checks say) keeps its drafts when the
|
|
13
|
+
* app keeps none: the tab's own store (sessionStorage), so a reload goes on with the time left and the answers given — a
|
|
14
|
+
* reload is never a way round a limit. None where the browser has none, or refuses it. Known as the form is made, before
|
|
15
|
+
* the survey flow's part has come: the draft is looked for then.
|
|
16
|
+
*/
|
|
17
|
+
function timedStore(page) {
|
|
18
|
+
try {
|
|
19
|
+
return /"timeLimit":/.test(JSON.stringify(page)) ? globalThis.sessionStorage : undefined;
|
|
20
|
+
}
|
|
21
|
+
catch {
|
|
22
|
+
return undefined;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
5
25
|
/** A draft read back from the browser's store, of this Fieldia or an older one (answers alone); null for none, or words that are none. */
|
|
6
26
|
function draftRead(raw) {
|
|
7
27
|
if (!raw)
|