@fieldia/core 0.26.1 → 0.28.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 +326 -3
- package/package.json +1 -1
- package/schema/page.schema.json +230 -24
- package/src/index.d.mts +10 -2
- package/src/index.d.ts +10 -2
- package/src/index.js +26 -1
- package/src/index.js.map +1 -1
- package/src/index.mjs +11 -2
- package/src/index.mjs.map +1 -1
- package/src/lib/expression/app-functions.d.mts +47 -0
- package/src/lib/expression/app-functions.d.ts +47 -0
- package/src/lib/expression/app-functions.js +64 -0
- package/src/lib/expression/app-functions.js.map +1 -0
- package/src/lib/expression/app-functions.mjs +58 -0
- package/src/lib/expression/app-functions.mjs.map +1 -0
- package/src/lib/expression/dates.d.mts +21 -0
- package/src/lib/expression/dates.d.ts +21 -0
- package/src/lib/expression/dates.js +73 -0
- package/src/lib/expression/dates.js.map +1 -0
- package/src/lib/expression/dates.mjs +67 -0
- package/src/lib/expression/dates.mjs.map +1 -0
- package/src/lib/expression/evaluator.js +12 -6
- package/src/lib/expression/evaluator.js.map +1 -1
- package/src/lib/expression/evaluator.mjs +12 -6
- package/src/lib/expression/evaluator.mjs.map +1 -1
- package/src/lib/expression/expression.d.mts +7 -3
- package/src/lib/expression/expression.d.ts +7 -3
- package/src/lib/expression/expression.js +8 -2
- package/src/lib/expression/expression.js.map +1 -1
- package/src/lib/expression/expression.mjs +7 -2
- package/src/lib/expression/expression.mjs.map +1 -1
- package/src/lib/expression/functions-part.d.mts +7 -0
- package/src/lib/expression/functions-part.d.ts +7 -0
- package/src/lib/expression/functions-part.js +13 -0
- package/src/lib/expression/functions-part.js.map +1 -0
- package/src/lib/expression/functions-part.mjs +8 -0
- package/src/lib/expression/functions-part.mjs.map +1 -0
- package/src/lib/expression/functions.d.mts +60 -3
- package/src/lib/expression/functions.d.ts +60 -3
- package/src/lib/expression/functions.js +109 -15
- package/src/lib/expression/functions.js.map +1 -1
- package/src/lib/expression/functions.mjs +103 -16
- package/src/lib/expression/functions.mjs.map +1 -1
- package/src/lib/expression/kinds.d.mts +31 -0
- package/src/lib/expression/kinds.d.ts +31 -0
- package/src/lib/expression/kinds.js +159 -0
- package/src/lib/expression/kinds.js.map +1 -0
- package/src/lib/expression/kinds.mjs +151 -0
- package/src/lib/expression/kinds.mjs.map +1 -0
- package/src/lib/expression/modifier.d.mts +4 -3
- package/src/lib/expression/modifier.d.ts +4 -3
- package/src/lib/expression/modifier.js +4 -3
- package/src/lib/expression/modifier.js.map +1 -1
- package/src/lib/expression/modifier.mjs +4 -3
- package/src/lib/expression/modifier.mjs.map +1 -1
- package/src/lib/expression/more-functions.d.mts +8 -0
- package/src/lib/expression/more-functions.d.ts +8 -0
- package/src/lib/expression/more-functions.js +235 -0
- package/src/lib/expression/more-functions.js.map +1 -0
- package/src/lib/expression/more-functions.mjs +230 -0
- package/src/lib/expression/more-functions.mjs.map +1 -0
- package/src/lib/expression/parser.d.mts +4 -1
- package/src/lib/expression/parser.d.ts +4 -1
- package/src/lib/expression/parser.js +6 -3
- package/src/lib/expression/parser.js.map +1 -1
- package/src/lib/expression/parser.mjs +6 -3
- package/src/lib/expression/parser.mjs.map +1 -1
- package/src/lib/expression/reads.d.mts +2 -2
- package/src/lib/expression/reads.d.ts +2 -2
- package/src/lib/expression/reads.js +6 -4
- package/src/lib/expression/reads.js.map +1 -1
- package/src/lib/expression/reads.mjs +6 -4
- package/src/lib/expression/reads.mjs.map +1 -1
- package/src/lib/format/actions.d.mts +16 -16
- package/src/lib/format/actions.d.ts +16 -16
- 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 +10 -4
- package/src/lib/format/check-page.js.map +1 -1
- package/src/lib/format/check-page.mjs +10 -4
- package/src/lib/format/check-page.mjs.map +1 -1
- package/src/lib/format/choice-options.d.mts +34 -0
- package/src/lib/format/choice-options.d.ts +34 -0
- package/src/lib/format/choice-options.js +60 -0
- package/src/lib/format/choice-options.js.map +1 -0
- package/src/lib/format/choice-options.mjs +51 -0
- package/src/lib/format/choice-options.mjs.map +1 -0
- package/src/lib/format/endings-checks.d.mts +8 -0
- package/src/lib/format/endings-checks.d.ts +8 -0
- package/src/lib/format/endings-checks.js +23 -0
- package/src/lib/format/endings-checks.js.map +1 -0
- package/src/lib/format/endings-checks.mjs +20 -0
- package/src/lib/format/endings-checks.mjs.map +1 -0
- package/src/lib/format/endings.d.mts +40 -0
- package/src/lib/format/endings.d.ts +40 -0
- package/src/lib/format/endings.js +15 -0
- package/src/lib/format/endings.js.map +1 -0
- package/src/lib/format/endings.mjs +12 -0
- package/src/lib/format/endings.mjs.map +1 -0
- package/src/lib/format/field.d.mts +151 -16
- package/src/lib/format/field.d.ts +151 -16
- package/src/lib/format/field.js +64 -11
- package/src/lib/format/field.js.map +1 -1
- package/src/lib/format/field.mjs +63 -10
- package/src/lib/format/field.mjs.map +1 -1
- package/src/lib/format/head-checks.d.mts +2 -0
- package/src/lib/format/head-checks.d.ts +2 -0
- package/src/lib/format/head-checks.js +2 -59
- package/src/lib/format/head-checks.js.map +1 -1
- package/src/lib/format/head-checks.mjs +1 -58
- package/src/lib/format/head-checks.mjs.map +1 -1
- package/src/lib/format/later-checks.d.mts +17 -0
- package/src/lib/format/later-checks.d.ts +17 -0
- package/src/lib/format/later-checks.js +20 -0
- package/src/lib/format/later-checks.js.map +1 -0
- package/src/lib/format/later-checks.mjs +17 -0
- package/src/lib/format/later-checks.mjs.map +1 -0
- package/src/lib/format/layout.d.mts +264 -190
- package/src/lib/format/layout.d.ts +264 -190
- package/src/lib/format/layout.js +34 -29
- package/src/lib/format/layout.js.map +1 -1
- package/src/lib/format/layout.mjs +14 -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/limits-checks.d.mts +14 -0
- package/src/lib/format/limits-checks.d.ts +14 -0
- package/src/lib/format/limits-checks.js +36 -0
- package/src/lib/format/limits-checks.js.map +1 -0
- package/src/lib/format/limits-checks.mjs +33 -0
- package/src/lib/format/limits-checks.mjs.map +1 -0
- package/src/lib/format/limits.d.mts +24 -0
- package/src/lib/format/limits.d.ts +24 -0
- package/src/lib/format/limits.js +35 -0
- package/src/lib/format/limits.js.map +1 -0
- package/src/lib/format/limits.mjs +32 -0
- package/src/lib/format/limits.mjs.map +1 -0
- package/src/lib/format/list-checks.d.mts +44 -0
- package/src/lib/format/list-checks.d.ts +44 -0
- package/src/lib/format/list-checks.js +340 -0
- package/src/lib/format/list-checks.js.map +1 -0
- package/src/lib/format/list-checks.mjs +336 -0
- package/src/lib/format/list-checks.mjs.map +1 -0
- package/src/lib/format/map-checks.d.mts +33 -0
- package/src/lib/format/map-checks.d.ts +33 -0
- package/src/lib/format/map-checks.js +180 -0
- package/src/lib/format/map-checks.js.map +1 -0
- package/src/lib/format/map-checks.mjs +175 -0
- package/src/lib/format/map-checks.mjs.map +1 -0
- package/src/lib/format/mapchecks-part.d.mts +5 -0
- package/src/lib/format/mapchecks-part.d.ts +5 -0
- package/src/lib/format/mapchecks-part.js +11 -0
- package/src/lib/format/mapchecks-part.js.map +1 -0
- package/src/lib/format/mapchecks-part.mjs +6 -0
- package/src/lib/format/mapchecks-part.mjs.map +1 -0
- package/src/lib/format/option-checks.d.mts +16 -0
- package/src/lib/format/option-checks.d.ts +16 -0
- package/src/lib/format/option-checks.js +39 -0
- package/src/lib/format/option-checks.js.map +1 -0
- package/src/lib/format/option-checks.mjs +36 -0
- package/src/lib/format/option-checks.mjs.map +1 -0
- package/src/lib/format/options-part.d.mts +6 -0
- package/src/lib/format/options-part.d.ts +6 -0
- package/src/lib/format/options-part.js +11 -0
- package/src/lib/format/options-part.js.map +1 -0
- package/src/lib/format/options-part.mjs +7 -0
- package/src/lib/format/options-part.mjs.map +1 -0
- package/src/lib/format/page.d.mts +154 -71
- package/src/lib/format/page.d.ts +154 -71
- package/src/lib/format/page.js +5 -0
- package/src/lib/format/page.js.map +1 -1
- package/src/lib/format/page.mjs +5 -0
- package/src/lib/format/page.mjs.map +1 -1
- package/src/lib/format/part-checks.d.mts +20 -0
- package/src/lib/format/part-checks.d.ts +20 -0
- package/src/lib/format/part-checks.js +3 -0
- package/src/lib/format/part-checks.js.map +1 -0
- package/src/lib/format/part-checks.mjs +2 -0
- package/src/lib/format/part-checks.mjs.map +1 -0
- package/src/lib/format/references.d.mts +71 -65
- package/src/lib/format/references.d.ts +71 -65
- package/src/lib/format/references.js +194 -631
- package/src/lib/format/references.js.map +1 -1
- package/src/lib/format/references.mjs +194 -631
- package/src/lib/format/references.mjs.map +1 -1
- package/src/lib/format/seats-checks.d.mts +3 -0
- package/src/lib/format/seats-checks.d.ts +3 -0
- package/src/lib/format/seats-checks.js +13 -0
- package/src/lib/format/seats-checks.js.map +1 -0
- package/src/lib/format/seats-checks.mjs +10 -0
- package/src/lib/format/seats-checks.mjs.map +1 -0
- package/src/lib/format/sheet-head-checks.d.mts +4 -0
- package/src/lib/format/sheet-head-checks.d.ts +4 -0
- package/src/lib/format/sheet-head-checks.js +68 -0
- package/src/lib/format/sheet-head-checks.js.map +1 -0
- package/src/lib/format/sheet-head-checks.mjs +65 -0
- package/src/lib/format/sheet-head-checks.mjs.map +1 -0
- package/src/lib/format/signature-checks.d.mts +7 -0
- package/src/lib/format/signature-checks.d.ts +7 -0
- package/src/lib/format/signature-checks.js +32 -0
- package/src/lib/format/signature-checks.js.map +1 -0
- package/src/lib/format/signature-checks.mjs +29 -0
- package/src/lib/format/signature-checks.mjs.map +1 -0
- package/src/lib/format/signature-options.d.mts +24 -0
- package/src/lib/format/signature-options.d.ts +24 -0
- package/src/lib/format/signature-options.js +30 -0
- package/src/lib/format/signature-options.js.map +1 -0
- package/src/lib/format/signature-options.mjs +26 -0
- package/src/lib/format/signature-options.mjs.map +1 -0
- package/src/lib/format/slots-checks.d.mts +4 -0
- package/src/lib/format/slots-checks.d.ts +4 -0
- package/src/lib/format/slots-checks.js +21 -0
- package/src/lib/format/slots-checks.js.map +1 -0
- package/src/lib/format/slots-checks.mjs +18 -0
- package/src/lib/format/slots-checks.mjs.map +1 -0
- package/src/lib/format/statusbar-checks.d.mts +8 -0
- package/src/lib/format/statusbar-checks.d.ts +8 -0
- package/src/lib/format/statusbar-checks.js +35 -0
- package/src/lib/format/statusbar-checks.js.map +1 -0
- package/src/lib/format/statusbar-checks.mjs +32 -0
- package/src/lib/format/statusbar-checks.mjs.map +1 -0
- package/src/lib/format/table-checks.d.mts +21 -0
- package/src/lib/format/table-checks.d.ts +21 -0
- package/src/lib/format/table-checks.js +86 -0
- package/src/lib/format/table-checks.js.map +1 -0
- package/src/lib/format/table-checks.mjs +82 -0
- package/src/lib/format/table-checks.mjs.map +1 -0
- package/src/lib/format/translate.js +2 -2
- package/src/lib/format/translate.js.map +1 -1
- package/src/lib/format/translate.mjs +2 -2
- package/src/lib/format/translate.mjs.map +1 -1
- package/src/lib/format/upgrade.d.mts +7 -3
- package/src/lib/format/upgrade.d.ts +7 -3
- package/src/lib/format/upgrade.js +7 -3
- package/src/lib/format/upgrade.js.map +1 -1
- package/src/lib/format/upgrade.mjs +7 -3
- package/src/lib/format/upgrade.mjs.map +1 -1
- package/src/lib/format/validate.d.mts +18 -2
- package/src/lib/format/validate.d.ts +18 -2
- package/src/lib/format/validate.js +36 -3
- package/src/lib/format/validate.js.map +1 -1
- package/src/lib/format/validate.mjs +35 -3
- package/src/lib/format/validate.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/format/words.d.mts +6 -2
- package/src/lib/format/words.d.ts +6 -2
- package/src/lib/format/words.js +13 -7
- package/src/lib/format/words.js.map +1 -1
- package/src/lib/format/words.mjs +13 -7
- package/src/lib/format/words.mjs.map +1 -1
- package/src/lib/parts.d.mts +45 -0
- package/src/lib/parts.d.ts +45 -0
- package/src/lib/parts.js +60 -0
- package/src/lib/parts.js.map +1 -0
- package/src/lib/parts.mjs +53 -0
- package/src/lib/parts.mjs.map +1 -0
- package/src/lib/record/cells.d.mts +3 -3
- package/src/lib/record/cells.d.ts +3 -3
- package/src/lib/record/cells.js +16 -15
- package/src/lib/record/cells.js.map +1 -1
- package/src/lib/record/cells.mjs +16 -15
- package/src/lib/record/cells.mjs.map +1 -1
- package/src/lib/record/check.js +3 -1
- package/src/lib/record/check.js.map +1 -1
- package/src/lib/record/check.mjs +3 -1
- package/src/lib/record/check.mjs.map +1 -1
- package/src/lib/record/compute.d.mts +16 -5
- package/src/lib/record/compute.d.ts +16 -5
- package/src/lib/record/compute.js +57 -16
- package/src/lib/record/compute.js.map +1 -1
- package/src/lib/record/compute.mjs +57 -16
- package/src/lib/record/compute.mjs.map +1 -1
- package/src/lib/record/data-source.d.mts +140 -3
- package/src/lib/record/data-source.d.ts +140 -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/day-words.d.mts +10 -0
- package/src/lib/record/day-words.d.ts +10 -0
- package/src/lib/record/day-words.js +23 -0
- package/src/lib/record/day-words.js.map +1 -0
- package/src/lib/record/day-words.mjs +20 -0
- package/src/lib/record/day-words.mjs.map +1 -0
- package/src/lib/record/drafts.d.mts +19 -0
- package/src/lib/record/drafts.d.ts +19 -0
- package/src/lib/record/drafts.js +35 -0
- package/src/lib/record/drafts.js.map +1 -0
- package/src/lib/record/drafts.mjs +31 -0
- package/src/lib/record/drafts.mjs.map +1 -0
- package/src/lib/record/env.d.mts +5 -1
- package/src/lib/record/env.d.ts +5 -1
- package/src/lib/record/env.js +9 -1
- package/src/lib/record/env.js.map +1 -1
- package/src/lib/record/env.mjs +8 -1
- package/src/lib/record/env.mjs.map +1 -1
- package/src/lib/record/form-limits.d.mts +78 -0
- package/src/lib/record/form-limits.d.ts +78 -0
- package/src/lib/record/form-limits.js +230 -0
- package/src/lib/record/form-limits.js.map +1 -0
- package/src/lib/record/form-limits.mjs +223 -0
- package/src/lib/record/form-limits.mjs.map +1 -0
- package/src/lib/record/form.d.mts +180 -9
- package/src/lib/record/form.d.ts +180 -9
- package/src/lib/record/form.js +858 -90
- package/src/lib/record/form.js.map +1 -1
- package/src/lib/record/form.mjs +858 -90
- package/src/lib/record/form.mjs.map +1 -1
- package/src/lib/record/limits-part.d.mts +6 -0
- package/src/lib/record/limits-part.d.ts +6 -0
- package/src/lib/record/limits-part.js +12 -0
- package/src/lib/record/limits-part.js.map +1 -0
- package/src/lib/record/limits-part.mjs +7 -0
- package/src/lib/record/limits-part.mjs.map +1 -0
- package/src/lib/record/limits.js +4 -2
- package/src/lib/record/limits.js.map +1 -1
- package/src/lib/record/limits.mjs +4 -2
- package/src/lib/record/limits.mjs.map +1 -1
- package/src/lib/record/line-choices.d.mts +30 -0
- package/src/lib/record/line-choices.d.ts +30 -0
- package/src/lib/record/line-choices.js +42 -0
- package/src/lib/record/line-choices.js.map +1 -0
- package/src/lib/record/line-choices.mjs +36 -0
- package/src/lib/record/line-choices.mjs.map +1 -0
- package/src/lib/record/locales/ar.js +11 -0
- package/src/lib/record/locales/ar.js.map +1 -1
- package/src/lib/record/locales/ar.mjs +11 -0
- package/src/lib/record/locales/ar.mjs.map +1 -1
- package/src/lib/record/locales/de.js +11 -0
- package/src/lib/record/locales/de.js.map +1 -1
- package/src/lib/record/locales/de.mjs +11 -0
- package/src/lib/record/locales/de.mjs.map +1 -1
- package/src/lib/record/locales/fr.js +11 -0
- package/src/lib/record/locales/fr.js.map +1 -1
- package/src/lib/record/locales/fr.mjs +11 -0
- package/src/lib/record/locales/fr.mjs.map +1 -1
- package/src/lib/record/memory-data-source.d.mts +44 -3
- package/src/lib/record/memory-data-source.d.ts +44 -3
- package/src/lib/record/memory-data-source.js +102 -40
- package/src/lib/record/memory-data-source.js.map +1 -1
- package/src/lib/record/memory-data-source.mjs +101 -40
- package/src/lib/record/memory-data-source.mjs.map +1 -1
- package/src/lib/record/memory-kept.d.mts +20 -0
- package/src/lib/record/memory-kept.d.ts +20 -0
- package/src/lib/record/memory-kept.js +46 -0
- package/src/lib/record/memory-kept.js.map +1 -0
- package/src/lib/record/memory-kept.mjs +43 -0
- package/src/lib/record/memory-kept.mjs.map +1 -0
- package/src/lib/record/memory-later.d.mts +19 -0
- package/src/lib/record/memory-later.d.ts +19 -0
- package/src/lib/record/memory-later.js +39 -0
- package/src/lib/record/memory-later.js.map +1 -0
- package/src/lib/record/memory-later.mjs +35 -0
- package/src/lib/record/memory-later.mjs.map +1 -0
- package/src/lib/record/memory-part.d.mts +7 -0
- package/src/lib/record/memory-part.d.ts +7 -0
- package/src/lib/record/memory-part.js +13 -0
- package/src/lib/record/memory-part.js.map +1 -0
- package/src/lib/record/memory-part.mjs +8 -0
- package/src/lib/record/memory-part.mjs.map +1 -0
- package/src/lib/record/messages.d.mts +27 -2
- package/src/lib/record/messages.d.ts +27 -2
- package/src/lib/record/messages.js +13 -4
- package/src/lib/record/messages.js.map +1 -1
- package/src/lib/record/messages.mjs +13 -4
- package/src/lib/record/messages.mjs.map +1 -1
- package/src/lib/record/option-rules.d.mts +56 -0
- package/src/lib/record/option-rules.d.ts +56 -0
- package/src/lib/record/option-rules.js +143 -0
- package/src/lib/record/option-rules.js.map +1 -0
- package/src/lib/record/option-rules.mjs +140 -0
- package/src/lib/record/option-rules.mjs.map +1 -0
- package/src/lib/record/record-words.d.mts +13 -1
- package/src/lib/record/record-words.d.ts +13 -1
- package/src/lib/record/record-words.js +29 -1
- package/src/lib/record/record-words.js.map +1 -1
- package/src/lib/record/record-words.mjs +27 -1
- package/src/lib/record/record-words.mjs.map +1 -1
- package/src/lib/record/rules.d.mts +2 -2
- package/src/lib/record/rules.d.ts +2 -2
- package/src/lib/record/rules.js +3 -3
- package/src/lib/record/rules.js.map +1 -1
- package/src/lib/record/rules.mjs +3 -3
- package/src/lib/record/rules.mjs.map +1 -1
- package/src/lib/record/run.js +9 -7
- package/src/lib/record/run.js.map +1 -1
- package/src/lib/record/run.mjs +9 -7
- package/src/lib/record/run.mjs.map +1 -1
- package/src/lib/record/search.d.mts +12 -2
- package/src/lib/record/search.d.ts +12 -2
- package/src/lib/record/search.js +29 -4
- package/src/lib/record/search.js.map +1 -1
- package/src/lib/record/search.mjs +29 -4
- package/src/lib/record/search.mjs.map +1 -1
- package/src/lib/record/set-when.d.mts +3 -3
- package/src/lib/record/set-when.d.ts +3 -3
- package/src/lib/record/set-when.js +9 -9
- package/src/lib/record/set-when.js.map +1 -1
- package/src/lib/record/set-when.mjs +9 -9
- package/src/lib/record/set-when.mjs.map +1 -1
- package/src/lib/record/signed.d.mts +21 -0
- package/src/lib/record/signed.d.ts +21 -0
- package/src/lib/record/signed.js +62 -0
- package/src/lib/record/signed.js.map +1 -0
- package/src/lib/record/signed.mjs +57 -0
- package/src/lib/record/signed.mjs.map +1 -0
- package/src/lib/record/taking.d.mts +60 -0
- package/src/lib/record/taking.d.ts +60 -0
- package/src/lib/record/taking.js +58 -0
- package/src/lib/record/taking.js.map +1 -0
- package/src/lib/record/taking.mjs +50 -0
- package/src/lib/record/taking.mjs.map +1 -0
- package/src/lib/record/value-map.js +11 -4
- package/src/lib/record/value-map.js.map +1 -1
- package/src/lib/record/value-map.mjs +11 -4
- package/src/lib/record/value-map.mjs.map +1 -1
- package/src/lib/record/values.d.mts +20 -0
- package/src/lib/record/values.d.ts +20 -0
- package/src/lib/record/values.js.map +1 -1
- package/src/lib/record/values.mjs.map +1 -1
- package/src/lib/record/waits.d.mts +13 -6
- package/src/lib/record/waits.d.ts +13 -6
- package/src/lib/record/waits.js +9 -12
- package/src/lib/record/waits.js.map +1 -1
- package/src/lib/record/waits.mjs +9 -12
- package/src/lib/record/waits.mjs.map +1 -1
- package/src/runtime.d.mts +17 -6
- package/src/runtime.d.ts +17 -6
- package/src/runtime.js +45 -3
- package/src/runtime.js.map +1 -1
- package/src/runtime.mjs +17 -1
- package/src/runtime.mjs.map +1 -1
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import type { ActionStep } from '../format/actions.mjs';
|
|
2
2
|
import type { Field, LineField, Option, PropertyDefinition } from '../format/field.mjs';
|
|
3
3
|
import type { Page } from '../format/page.mjs';
|
|
4
|
+
import type { PageEnding } from '../format/endings.mjs';
|
|
4
5
|
import type { JsonValue } from '../format/json.mjs';
|
|
6
|
+
import { type FunctionTable } from '../expression/functions.mjs';
|
|
7
|
+
import { type AppFunctions } from '../expression/app-functions.mjs';
|
|
8
|
+
import { type AskedFor } from './compute.mjs';
|
|
5
9
|
import { type FieldTone, type LineState } from './cells.mjs';
|
|
6
10
|
import { type Messages } from './messages.mjs';
|
|
7
|
-
import { type DataSource, type RecordChanges, type RecordPermissions, type RecordVersion, type ResolvedFilter, type SaveProblem, type BotReport, type SlotsResult, type UploadFile, type DuplicateMatch, type MergeResult } from './data-source.mjs';
|
|
11
|
+
import { type DataSource, type RecordChanges, type RecordPermissions, type RecordVersion, type ResolvedFilter, type SaveProblem, type BotReport, type SlotsResult, type UploadFile, type DuplicateMatch, type MergeResult, type SavedDraft } from './data-source.mjs';
|
|
12
|
+
import { type FormLimits } from './taking.mjs';
|
|
8
13
|
import { type WaitsFor } from './waits.mjs';
|
|
9
14
|
import { type FileUpload, type UploadHow } from './uploads.mjs';
|
|
10
15
|
import { type Scheduler } from './scheduler.mjs';
|
|
@@ -40,7 +45,10 @@ export interface FormState {
|
|
|
40
45
|
readonly skipped: readonly string[];
|
|
41
46
|
/** Why the last save was refused, until the next one starts or the form is reset. */
|
|
42
47
|
readonly saveProblem: SaveProblem | null;
|
|
43
|
-
/**
|
|
48
|
+
/**
|
|
49
|
+
* The choices loaded from the app's lists: those of a selection with `optionsFrom`, once asked for — by field, and a
|
|
50
|
+
* table line's by its cell's path (`field.lineKey.subfield`).
|
|
51
|
+
*/
|
|
44
52
|
readonly choices: Readonly<Record<string, Choices>>;
|
|
45
53
|
/** The definitions loaded for a properties field with `definitionsFrom`, by field, once asked for. */
|
|
46
54
|
readonly definitions: Readonly<Record<string, Definitions>>;
|
|
@@ -81,6 +89,47 @@ export interface FormState {
|
|
|
81
89
|
* value it held as the box was entered; validate and save refuse with the words until the text is fixed.
|
|
82
90
|
*/
|
|
83
91
|
readonly unread: Readonly<Record<string, UnreadText>>;
|
|
92
|
+
/**
|
|
93
|
+
* A page of responses sent: the answers as they went, with what the app's source answered — the id it gave the
|
|
94
|
+
* response and the values it added (`SubmitResult`). What its ending reads (`form.ending()`, `{id}`). Null until a
|
|
95
|
+
* send, and again once the form starts a new response (`reset`).
|
|
96
|
+
*/
|
|
97
|
+
readonly sent?: SentResponse | null;
|
|
98
|
+
/**
|
|
99
|
+
* Values worked out from an app's function that asks its server (`functions`) with no answer yet, by path (a
|
|
100
|
+
* line's `field.lineKey.subfield`): waiting for it (`{}`) — the value empty meanwhile, a save waiting for it — or
|
|
101
|
+
* why it did not come (`failed`), which a save asks again and, failing, is stopped by under its field.
|
|
102
|
+
*/
|
|
103
|
+
readonly asked: Readonly<Record<string, AskedFor>>;
|
|
104
|
+
/**
|
|
105
|
+
* Words said under a choice whose chosen options a change of other answers no longer offers — hidden by their
|
|
106
|
+
* condition, no longer picked where they are carried from, or no longer in the app's list as a field it changes with
|
|
107
|
+
* changed — by path (a field, or a table line's `field.lineKey.subfield`): they were taken out of its answer. Until
|
|
108
|
+
* that value is written again, its line goes, or another record is shown.
|
|
109
|
+
*/
|
|
110
|
+
readonly takenOut: Readonly<Record<string, string>>;
|
|
111
|
+
/**
|
|
112
|
+
* When the page takes answers and each choice's places, as its `limits`, its options' `seats`, the form's clock and
|
|
113
|
+
* the data source's `limits` tell: whether it takes them now (`state`), when it opens and closes, the responses it
|
|
114
|
+
* takes still, and each choice's places left. Null on a page with neither.
|
|
115
|
+
*/
|
|
116
|
+
readonly limits?: FormLimits | null;
|
|
117
|
+
/**
|
|
118
|
+
* The draft kept on the app's server (`saveDraft`) that these answers continue: its `key`, once the source gave one
|
|
119
|
+
* (the viewer's `resume`, or the first draft kept); `missing` when the key the form was given named no draft — it
|
|
120
|
+
* starts empty. Null while none is.
|
|
121
|
+
*/
|
|
122
|
+
readonly resume?: {
|
|
123
|
+
readonly key: string;
|
|
124
|
+
readonly missing?: boolean;
|
|
125
|
+
} | null;
|
|
126
|
+
}
|
|
127
|
+
/** A response sent, as `FormState.sent` keeps it. */
|
|
128
|
+
export interface SentResponse {
|
|
129
|
+
/** The id the app's source gave the response ("B-1043"), or null where it gave none. */
|
|
130
|
+
readonly id: RecordId | null;
|
|
131
|
+
/** The answers as they were sent, with the values the source added (`SubmitResult.values`) laid over them. */
|
|
132
|
+
readonly values: Readonly<Values>;
|
|
84
133
|
}
|
|
85
134
|
/** How a search for a link's records is asked (`form.search`, `form.searchLine`). */
|
|
86
135
|
export interface SearchOptions {
|
|
@@ -235,6 +284,16 @@ export interface FormEvents {
|
|
|
235
284
|
recordId: RecordId | null;
|
|
236
285
|
message: PostedMessage;
|
|
237
286
|
};
|
|
287
|
+
/**
|
|
288
|
+
* A draft was kept on the app's server (`saveDraft`): its key — what a link to continue from carries — and whether the
|
|
289
|
+
* person pressed "Continue later" (`later`), with the source's answer.
|
|
290
|
+
*/
|
|
291
|
+
draft: {
|
|
292
|
+
key: string;
|
|
293
|
+
savedAt: string;
|
|
294
|
+
later: boolean;
|
|
295
|
+
saved: SavedDraft;
|
|
296
|
+
};
|
|
238
297
|
}
|
|
239
298
|
export interface FormOptions {
|
|
240
299
|
page: Page;
|
|
@@ -254,11 +313,24 @@ export interface FormOptions {
|
|
|
254
313
|
host?: ActionHost;
|
|
255
314
|
/** How a question is asked when there is no host. Without either, a question goes on as though answered Yes. */
|
|
256
315
|
confirm?: (message: string) => boolean | Promise<boolean>;
|
|
316
|
+
/**
|
|
317
|
+
* Keep what is typed as a draft, offered again the next time the page opens: in `store` (the browser's localStorage
|
|
318
|
+
* fits) — or, on a page with `continueLater` whose data source has `saveDraft` and `loadDraft`, on the app's server,
|
|
319
|
+
* the store keeping only its key (such a page keeps its drafts there without this too). A draft keeps the wizard's
|
|
320
|
+
* step and text typed that does not read yet. `restore`: `ask` (the default) offers it, `auto` lays it at once.
|
|
321
|
+
*/
|
|
257
322
|
drafts?: {
|
|
258
323
|
store: DraftStore;
|
|
259
324
|
restore?: 'auto' | 'ask';
|
|
260
325
|
delayMs?: number;
|
|
261
326
|
};
|
|
327
|
+
/**
|
|
328
|
+
* The key of a draft kept on the app's server (`saveDraft`) to continue from — what the link the app made after
|
|
329
|
+
* "Continue later" carries: loaded through the source's `loadDraft` as the form opens, its answers, its wizard step
|
|
330
|
+
* and its text typed that does not read laid as they were. A key that names none starts the form empty
|
|
331
|
+
* (`resume.missing`). Without the source's `loadDraft`, it is let be.
|
|
332
|
+
*/
|
|
333
|
+
resume?: string;
|
|
262
334
|
autosave?: {
|
|
263
335
|
delayMs: number;
|
|
264
336
|
};
|
|
@@ -294,6 +366,21 @@ export interface FormOptions {
|
|
|
294
366
|
fields: Readonly<Record<string, Field | LineField>>;
|
|
295
367
|
id?: RecordId | null;
|
|
296
368
|
};
|
|
369
|
+
/**
|
|
370
|
+
* How a field's value reads inside the page's own words — a `{field}` in a label, a help, a choice, a step's title, a
|
|
371
|
+
* button, an ending — and so inside the form's messages that name a label ("Please answer “How was your visit to
|
|
372
|
+
* Zamalek?”"). The viewer gives its own, as each field shows its value at rest: a choice by its label, money with its
|
|
373
|
+
* currency, a day in the page's order. Left out, a choice by its label, a link by its name, a yes or no as Yes or No,
|
|
374
|
+
* anything else as it is held.
|
|
375
|
+
*/
|
|
376
|
+
valueWords?: (field: Field, value: Value | undefined, values: Readonly<Values>) => string;
|
|
377
|
+
/**
|
|
378
|
+
* The app's own functions, which the page's expressions call by name besides Fieldia's: `vatRate(country)`. Each a
|
|
379
|
+
* plain function, or `{ call, takes, values, gives, tip }`. One that asks the app's server gives a promise: a value
|
|
380
|
+
* worked out from it waits while it is asked — once for the same values, for the record shown — and a save waits
|
|
381
|
+
* for it; a condition reading it does not hold meanwhile. A name a page cannot call is refused as the form is made.
|
|
382
|
+
*/
|
|
383
|
+
functions?: AppFunctions;
|
|
297
384
|
}
|
|
298
385
|
/** The person using a form, as the app knows them. */
|
|
299
386
|
export interface FormUser {
|
|
@@ -304,6 +391,16 @@ export interface FormUser {
|
|
|
304
391
|
}
|
|
305
392
|
export interface Form {
|
|
306
393
|
readonly page: Page;
|
|
394
|
+
/** The app's own functions as the page's expressions call them (`FormOptions.functions`): for what reads its conditions apart. */
|
|
395
|
+
readonly functions?: FunctionTable;
|
|
396
|
+
/**
|
|
397
|
+
* A table line's cell's form (@fieldia/widgets' `lineForm`): the table and the line it is the form of, whose values,
|
|
398
|
+
* choices and words taken out of them are the line's own. Left out of a record's own form.
|
|
399
|
+
*/
|
|
400
|
+
readonly line?: {
|
|
401
|
+
readonly field: string;
|
|
402
|
+
readonly key: string;
|
|
403
|
+
};
|
|
307
404
|
getState(): FormState;
|
|
308
405
|
subscribe(listener: (state: FormState) => void): () => void;
|
|
309
406
|
load(): Promise<void>;
|
|
@@ -324,16 +421,21 @@ export interface Form {
|
|
|
324
421
|
node(id: string): NodeState;
|
|
325
422
|
/** Whether the record is being edited, as conditions read `editing`: a view that locks it to be read says false, and parts follow. */
|
|
326
423
|
setEditing(editing: boolean): void;
|
|
327
|
-
/**
|
|
424
|
+
/**
|
|
425
|
+
* Whether a field is read-only whatever the conditions say: by its definition, for this person by what the record's
|
|
426
|
+
* source said (`can`), or signed by a signature kept (`FileValue.signed`).
|
|
427
|
+
*/
|
|
328
428
|
fieldReadonly(name: string): boolean;
|
|
329
429
|
/** What a field would be told if the form were checked now, or null when it passes. Nothing is shown. */
|
|
330
430
|
problem(field: string): string | null;
|
|
331
431
|
/**
|
|
332
|
-
* What a value worked out from others waits for while one of them holds text that does not read (`unread`)
|
|
333
|
-
*
|
|
334
|
-
*
|
|
335
|
-
*
|
|
336
|
-
*
|
|
432
|
+
* What a value worked out from others waits for while one of them holds text that does not read (`unread`), or an
|
|
433
|
+
* answer the form refuses (shown, not empty, and refused by its checks: an area under its least, a day past today):
|
|
434
|
+
* a total of the page's own (`compute`) over a table whose line says "abc" in its Quantity, a price per m² over an
|
|
435
|
+
* area of −50, or an amount the app works out as the lines change (read-only, from a source with an onchange) — the
|
|
436
|
+
* line, as people count them, and its cell. Shown, it is a dash said in words, as the table's own total waits: never
|
|
437
|
+
* an amount worked out from the value that text replaced, or from one refused. Then what is asked of the app's
|
|
438
|
+
* server for it (`asking`). Null when it shows its value.
|
|
337
439
|
*/
|
|
338
440
|
waitsFor(field: string): WaitsFor | null;
|
|
339
441
|
/**
|
|
@@ -381,6 +483,20 @@ export interface Form {
|
|
|
381
483
|
validate(): boolean;
|
|
382
484
|
save(): Promise<boolean>;
|
|
383
485
|
reset(): void;
|
|
486
|
+
/**
|
|
487
|
+
* Words of the page's with each `{field}` showing the value the form holds now, as `valueWords` writes it — a label's,
|
|
488
|
+
* a help's, a step's title, a button's: "How was your visit to {branch}?" reads "How was your visit to Zamalek?". A
|
|
489
|
+
* name that is no field of the page shows nothing.
|
|
490
|
+
*/
|
|
491
|
+
words(text: string): string;
|
|
492
|
+
/**
|
|
493
|
+
* The ending a page of responses shows now its answers are sent (`FormState.sent`): the first of the page's
|
|
494
|
+
* `endings` whose `when` holds on the answers as sent, with what the source added and the response's `id`, else the
|
|
495
|
+
* first with no `when`; null before a send, on a page with none, or where none holds.
|
|
496
|
+
*/
|
|
497
|
+
ending(): PageEnding | null;
|
|
498
|
+
/** An ending's words, its `{field}`s and `{id}` filled in from the response sent (`FormState.sent`), as `words` writes them. */
|
|
499
|
+
endingWords(text: string): string;
|
|
384
500
|
changes(): RecordChanges;
|
|
385
501
|
addLine(field: string, values?: Values): string;
|
|
386
502
|
updateLine(field: string, key: string, name: string, value: Value): void;
|
|
@@ -448,9 +564,32 @@ export interface Form {
|
|
|
448
564
|
/**
|
|
449
565
|
* Load, or load again, the choices of a selection whose options come from
|
|
450
566
|
* the app's list (`optionsFrom`). Once loaded, they load again by themselves
|
|
451
|
-
* when a field they change with changes; the latest answer wins
|
|
567
|
+
* when a field they change with changes; the latest answer wins, and a
|
|
568
|
+
* choice it no longer offers after the person, a step or the app changed
|
|
569
|
+
* that field is taken out and said (`FormState.takenOut`). A value a record
|
|
570
|
+
* comes in with is kept, and its save says why. A table line's, by its
|
|
571
|
+
* cell's path (`field.lineKey.subfield`), are asked by the line's values and
|
|
572
|
+
* shared with every line where the columns they change with hold the same,
|
|
573
|
+
* for the record shown; once loaded, they follow those columns on that line.
|
|
452
574
|
*/
|
|
453
575
|
loadChoices(field: string): void;
|
|
576
|
+
/**
|
|
577
|
+
* A table line's choices from the app's list, as they are asked for that line, with `values` laid over it — a row
|
|
578
|
+
* pasted on it, its connection read first. `key` null: a line not added yet, by the values one added now starts with.
|
|
579
|
+
*/
|
|
580
|
+
lineChoices(field: string, key: string | null, subfield: string, values?: Values): Promise<Option[]>;
|
|
581
|
+
/**
|
|
582
|
+
* The options a choice offers now: its own — or those its list gave (`optionsFrom.list`), or those picked in the
|
|
583
|
+
* question they are carried from (`optionsFrom.field`), its own after them — less those whose condition hides them
|
|
584
|
+
* (`options[].invisible`). A table line's by its cell's path (`field.lineKey.subfield`), its conditions read on that
|
|
585
|
+
* line. Null for a field that is no choice.
|
|
586
|
+
*/
|
|
587
|
+
offered(field: string): readonly Option[] | null;
|
|
588
|
+
/**
|
|
589
|
+
* Whether a choice's options change with the record's answers: a condition on one, or carried from another question.
|
|
590
|
+
* A table line's by its cell's path: a condition on one of its column's options.
|
|
591
|
+
*/
|
|
592
|
+
offersChange(field: string): boolean;
|
|
454
593
|
/**
|
|
455
594
|
* Load, or load again, the definitions of a properties field whose
|
|
456
595
|
* definitions come from a linked record (`definitionsFrom`). Once loaded,
|
|
@@ -543,6 +682,19 @@ export interface Form {
|
|
|
543
682
|
on<E extends keyof FormEvents>(event: E, listener: (event: FormEvents[E]) => void): () => void;
|
|
544
683
|
restoreDraft(): void;
|
|
545
684
|
discardDraft(): void;
|
|
685
|
+
/** Whether the page offers "Continue later": it says `continueLater`, and its data source has `saveDraft`. */
|
|
686
|
+
canContinueLater(): boolean;
|
|
687
|
+
/**
|
|
688
|
+
* "Continue later": what is typed read first (`settle`), then the answers so far — their wizard step, text that does
|
|
689
|
+
* not read kept as typed — kept on the app's server through `saveDraft` (`later: true`): its answer, the key, and the
|
|
690
|
+
* link the app made to continue from and its words. Rejects where the source refused, or has no `saveDraft`.
|
|
691
|
+
*/
|
|
692
|
+
continueLater(): Promise<SavedDraft>;
|
|
693
|
+
/**
|
|
694
|
+
* Ask the data source's `limits` again — how many responses the page took, this person's, each choice's takers — and
|
|
695
|
+
* show what it tells (`limits`). The form asks it itself as it opens, before its answers go, and after they went.
|
|
696
|
+
*/
|
|
697
|
+
refreshLimits(): Promise<void>;
|
|
546
698
|
/**
|
|
547
699
|
* Whether a file picked for a file or picture field is stored at once,
|
|
548
700
|
* through the data source's `upload`. False without one: a file then
|
|
@@ -551,6 +703,16 @@ export interface Form {
|
|
|
551
703
|
canUpload(): boolean;
|
|
552
704
|
/** Today, as 2026-10-15, on the clock of the page's time zone — the browser's own where it names none — by the form's clock (`now`). */
|
|
553
705
|
today(): string;
|
|
706
|
+
/** Now, by the form's clock (`now`): the computer's own where the app gave none. A signature's when. */
|
|
707
|
+
now(): Date;
|
|
708
|
+
/** The person using the form, as the app named them (`user`); null where it named none. */
|
|
709
|
+
user(): FormUser | null;
|
|
710
|
+
/**
|
|
711
|
+
* The answers shown now, by field, in the page's order: a field placed on the page — or a saved form's answers, by its
|
|
712
|
+
* name — not hidden by its condition, its roles or the record's source, nor in a step passed over with Skip. What a
|
|
713
|
+
* signature that signs every answer signs.
|
|
714
|
+
*/
|
|
715
|
+
shownFields(): string[];
|
|
554
716
|
/**
|
|
555
717
|
* A record of the page's model as conditions read it, the form's own way: its values (a link as its id), its `id`,
|
|
556
718
|
* the person using the form (`user`), the app's `context`, and `editing` false — for what reads conditions on records
|
|
@@ -581,6 +743,15 @@ export interface Form {
|
|
|
581
743
|
* record shown as it was asked (`recordShown`).
|
|
582
744
|
*/
|
|
583
745
|
findDuplicates(): Promise<DuplicateMatch[]>;
|
|
746
|
+
/** Whether the source keeps "It's someone new" itself, on the app's server: it has `notDuplicates` and `markNotDuplicate`, both. */
|
|
747
|
+
keepsNotDuplicates(): boolean;
|
|
748
|
+
/**
|
|
749
|
+
* The records said to be someone else for the record shown, asked of the source's `notDuplicates`: none while it is
|
|
750
|
+
* new. Rejects where the source has no `notDuplicates`. Its answer is for the record shown as it was asked.
|
|
751
|
+
*/
|
|
752
|
+
notDuplicates(): Promise<RecordId[]>;
|
|
753
|
+
/** Keep that `matchId` is someone else for the record shown, through the source's `markNotDuplicate`: refused while it is new. */
|
|
754
|
+
markNotDuplicate(matchId: RecordId): Promise<void>;
|
|
584
755
|
/** Whether records of the page's model can be merged: its source has `merge`, and `load` to read the others. */
|
|
585
756
|
canMerge(): boolean;
|
|
586
757
|
/** Another record of the page's model, as its source loads it, its values alone: the form is left as it is. For a merge's screen. */
|
package/src/lib/record/form.d.ts
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import type { ActionStep } from '../format/actions';
|
|
2
2
|
import type { Field, LineField, Option, PropertyDefinition } from '../format/field';
|
|
3
3
|
import type { Page } from '../format/page';
|
|
4
|
+
import type { PageEnding } from '../format/endings';
|
|
4
5
|
import type { JsonValue } from '../format/json';
|
|
6
|
+
import { type FunctionTable } from '../expression/functions';
|
|
7
|
+
import { type AppFunctions } from '../expression/app-functions';
|
|
8
|
+
import { type AskedFor } from './compute';
|
|
5
9
|
import { type FieldTone, type LineState } from './cells';
|
|
6
10
|
import { type Messages } from './messages';
|
|
7
|
-
import { type DataSource, type RecordChanges, type RecordPermissions, type RecordVersion, type ResolvedFilter, type SaveProblem, type BotReport, type SlotsResult, type UploadFile, type DuplicateMatch, type MergeResult } from './data-source';
|
|
11
|
+
import { type DataSource, type RecordChanges, type RecordPermissions, type RecordVersion, type ResolvedFilter, type SaveProblem, type BotReport, type SlotsResult, type UploadFile, type DuplicateMatch, type MergeResult, type SavedDraft } from './data-source';
|
|
12
|
+
import { type FormLimits } from './taking';
|
|
8
13
|
import { type WaitsFor } from './waits';
|
|
9
14
|
import { type FileUpload, type UploadHow } from './uploads';
|
|
10
15
|
import { type Scheduler } from './scheduler';
|
|
@@ -40,7 +45,10 @@ export interface FormState {
|
|
|
40
45
|
readonly skipped: readonly string[];
|
|
41
46
|
/** Why the last save was refused, until the next one starts or the form is reset. */
|
|
42
47
|
readonly saveProblem: SaveProblem | null;
|
|
43
|
-
/**
|
|
48
|
+
/**
|
|
49
|
+
* The choices loaded from the app's lists: those of a selection with `optionsFrom`, once asked for — by field, and a
|
|
50
|
+
* table line's by its cell's path (`field.lineKey.subfield`).
|
|
51
|
+
*/
|
|
44
52
|
readonly choices: Readonly<Record<string, Choices>>;
|
|
45
53
|
/** The definitions loaded for a properties field with `definitionsFrom`, by field, once asked for. */
|
|
46
54
|
readonly definitions: Readonly<Record<string, Definitions>>;
|
|
@@ -81,6 +89,47 @@ export interface FormState {
|
|
|
81
89
|
* value it held as the box was entered; validate and save refuse with the words until the text is fixed.
|
|
82
90
|
*/
|
|
83
91
|
readonly unread: Readonly<Record<string, UnreadText>>;
|
|
92
|
+
/**
|
|
93
|
+
* A page of responses sent: the answers as they went, with what the app's source answered — the id it gave the
|
|
94
|
+
* response and the values it added (`SubmitResult`). What its ending reads (`form.ending()`, `{id}`). Null until a
|
|
95
|
+
* send, and again once the form starts a new response (`reset`).
|
|
96
|
+
*/
|
|
97
|
+
readonly sent?: SentResponse | null;
|
|
98
|
+
/**
|
|
99
|
+
* Values worked out from an app's function that asks its server (`functions`) with no answer yet, by path (a
|
|
100
|
+
* line's `field.lineKey.subfield`): waiting for it (`{}`) — the value empty meanwhile, a save waiting for it — or
|
|
101
|
+
* why it did not come (`failed`), which a save asks again and, failing, is stopped by under its field.
|
|
102
|
+
*/
|
|
103
|
+
readonly asked: Readonly<Record<string, AskedFor>>;
|
|
104
|
+
/**
|
|
105
|
+
* Words said under a choice whose chosen options a change of other answers no longer offers — hidden by their
|
|
106
|
+
* condition, no longer picked where they are carried from, or no longer in the app's list as a field it changes with
|
|
107
|
+
* changed — by path (a field, or a table line's `field.lineKey.subfield`): they were taken out of its answer. Until
|
|
108
|
+
* that value is written again, its line goes, or another record is shown.
|
|
109
|
+
*/
|
|
110
|
+
readonly takenOut: Readonly<Record<string, string>>;
|
|
111
|
+
/**
|
|
112
|
+
* When the page takes answers and each choice's places, as its `limits`, its options' `seats`, the form's clock and
|
|
113
|
+
* the data source's `limits` tell: whether it takes them now (`state`), when it opens and closes, the responses it
|
|
114
|
+
* takes still, and each choice's places left. Null on a page with neither.
|
|
115
|
+
*/
|
|
116
|
+
readonly limits?: FormLimits | null;
|
|
117
|
+
/**
|
|
118
|
+
* The draft kept on the app's server (`saveDraft`) that these answers continue: its `key`, once the source gave one
|
|
119
|
+
* (the viewer's `resume`, or the first draft kept); `missing` when the key the form was given named no draft — it
|
|
120
|
+
* starts empty. Null while none is.
|
|
121
|
+
*/
|
|
122
|
+
readonly resume?: {
|
|
123
|
+
readonly key: string;
|
|
124
|
+
readonly missing?: boolean;
|
|
125
|
+
} | null;
|
|
126
|
+
}
|
|
127
|
+
/** A response sent, as `FormState.sent` keeps it. */
|
|
128
|
+
export interface SentResponse {
|
|
129
|
+
/** The id the app's source gave the response ("B-1043"), or null where it gave none. */
|
|
130
|
+
readonly id: RecordId | null;
|
|
131
|
+
/** The answers as they were sent, with the values the source added (`SubmitResult.values`) laid over them. */
|
|
132
|
+
readonly values: Readonly<Values>;
|
|
84
133
|
}
|
|
85
134
|
/** How a search for a link's records is asked (`form.search`, `form.searchLine`). */
|
|
86
135
|
export interface SearchOptions {
|
|
@@ -235,6 +284,16 @@ export interface FormEvents {
|
|
|
235
284
|
recordId: RecordId | null;
|
|
236
285
|
message: PostedMessage;
|
|
237
286
|
};
|
|
287
|
+
/**
|
|
288
|
+
* A draft was kept on the app's server (`saveDraft`): its key — what a link to continue from carries — and whether the
|
|
289
|
+
* person pressed "Continue later" (`later`), with the source's answer.
|
|
290
|
+
*/
|
|
291
|
+
draft: {
|
|
292
|
+
key: string;
|
|
293
|
+
savedAt: string;
|
|
294
|
+
later: boolean;
|
|
295
|
+
saved: SavedDraft;
|
|
296
|
+
};
|
|
238
297
|
}
|
|
239
298
|
export interface FormOptions {
|
|
240
299
|
page: Page;
|
|
@@ -254,11 +313,24 @@ export interface FormOptions {
|
|
|
254
313
|
host?: ActionHost;
|
|
255
314
|
/** How a question is asked when there is no host. Without either, a question goes on as though answered Yes. */
|
|
256
315
|
confirm?: (message: string) => boolean | Promise<boolean>;
|
|
316
|
+
/**
|
|
317
|
+
* Keep what is typed as a draft, offered again the next time the page opens: in `store` (the browser's localStorage
|
|
318
|
+
* fits) — or, on a page with `continueLater` whose data source has `saveDraft` and `loadDraft`, on the app's server,
|
|
319
|
+
* the store keeping only its key (such a page keeps its drafts there without this too). A draft keeps the wizard's
|
|
320
|
+
* step and text typed that does not read yet. `restore`: `ask` (the default) offers it, `auto` lays it at once.
|
|
321
|
+
*/
|
|
257
322
|
drafts?: {
|
|
258
323
|
store: DraftStore;
|
|
259
324
|
restore?: 'auto' | 'ask';
|
|
260
325
|
delayMs?: number;
|
|
261
326
|
};
|
|
327
|
+
/**
|
|
328
|
+
* The key of a draft kept on the app's server (`saveDraft`) to continue from — what the link the app made after
|
|
329
|
+
* "Continue later" carries: loaded through the source's `loadDraft` as the form opens, its answers, its wizard step
|
|
330
|
+
* and its text typed that does not read laid as they were. A key that names none starts the form empty
|
|
331
|
+
* (`resume.missing`). Without the source's `loadDraft`, it is let be.
|
|
332
|
+
*/
|
|
333
|
+
resume?: string;
|
|
262
334
|
autosave?: {
|
|
263
335
|
delayMs: number;
|
|
264
336
|
};
|
|
@@ -294,6 +366,21 @@ export interface FormOptions {
|
|
|
294
366
|
fields: Readonly<Record<string, Field | LineField>>;
|
|
295
367
|
id?: RecordId | null;
|
|
296
368
|
};
|
|
369
|
+
/**
|
|
370
|
+
* How a field's value reads inside the page's own words — a `{field}` in a label, a help, a choice, a step's title, a
|
|
371
|
+
* button, an ending — and so inside the form's messages that name a label ("Please answer “How was your visit to
|
|
372
|
+
* Zamalek?”"). The viewer gives its own, as each field shows its value at rest: a choice by its label, money with its
|
|
373
|
+
* currency, a day in the page's order. Left out, a choice by its label, a link by its name, a yes or no as Yes or No,
|
|
374
|
+
* anything else as it is held.
|
|
375
|
+
*/
|
|
376
|
+
valueWords?: (field: Field, value: Value | undefined, values: Readonly<Values>) => string;
|
|
377
|
+
/**
|
|
378
|
+
* The app's own functions, which the page's expressions call by name besides Fieldia's: `vatRate(country)`. Each a
|
|
379
|
+
* plain function, or `{ call, takes, values, gives, tip }`. One that asks the app's server gives a promise: a value
|
|
380
|
+
* worked out from it waits while it is asked — once for the same values, for the record shown — and a save waits
|
|
381
|
+
* for it; a condition reading it does not hold meanwhile. A name a page cannot call is refused as the form is made.
|
|
382
|
+
*/
|
|
383
|
+
functions?: AppFunctions;
|
|
297
384
|
}
|
|
298
385
|
/** The person using a form, as the app knows them. */
|
|
299
386
|
export interface FormUser {
|
|
@@ -304,6 +391,16 @@ export interface FormUser {
|
|
|
304
391
|
}
|
|
305
392
|
export interface Form {
|
|
306
393
|
readonly page: Page;
|
|
394
|
+
/** The app's own functions as the page's expressions call them (`FormOptions.functions`): for what reads its conditions apart. */
|
|
395
|
+
readonly functions?: FunctionTable;
|
|
396
|
+
/**
|
|
397
|
+
* A table line's cell's form (@fieldia/widgets' `lineForm`): the table and the line it is the form of, whose values,
|
|
398
|
+
* choices and words taken out of them are the line's own. Left out of a record's own form.
|
|
399
|
+
*/
|
|
400
|
+
readonly line?: {
|
|
401
|
+
readonly field: string;
|
|
402
|
+
readonly key: string;
|
|
403
|
+
};
|
|
307
404
|
getState(): FormState;
|
|
308
405
|
subscribe(listener: (state: FormState) => void): () => void;
|
|
309
406
|
load(): Promise<void>;
|
|
@@ -324,16 +421,21 @@ export interface Form {
|
|
|
324
421
|
node(id: string): NodeState;
|
|
325
422
|
/** Whether the record is being edited, as conditions read `editing`: a view that locks it to be read says false, and parts follow. */
|
|
326
423
|
setEditing(editing: boolean): void;
|
|
327
|
-
/**
|
|
424
|
+
/**
|
|
425
|
+
* Whether a field is read-only whatever the conditions say: by its definition, for this person by what the record's
|
|
426
|
+
* source said (`can`), or signed by a signature kept (`FileValue.signed`).
|
|
427
|
+
*/
|
|
328
428
|
fieldReadonly(name: string): boolean;
|
|
329
429
|
/** What a field would be told if the form were checked now, or null when it passes. Nothing is shown. */
|
|
330
430
|
problem(field: string): string | null;
|
|
331
431
|
/**
|
|
332
|
-
* What a value worked out from others waits for while one of them holds text that does not read (`unread`)
|
|
333
|
-
*
|
|
334
|
-
*
|
|
335
|
-
*
|
|
336
|
-
*
|
|
432
|
+
* What a value worked out from others waits for while one of them holds text that does not read (`unread`), or an
|
|
433
|
+
* answer the form refuses (shown, not empty, and refused by its checks: an area under its least, a day past today):
|
|
434
|
+
* a total of the page's own (`compute`) over a table whose line says "abc" in its Quantity, a price per m² over an
|
|
435
|
+
* area of −50, or an amount the app works out as the lines change (read-only, from a source with an onchange) — the
|
|
436
|
+
* line, as people count them, and its cell. Shown, it is a dash said in words, as the table's own total waits: never
|
|
437
|
+
* an amount worked out from the value that text replaced, or from one refused. Then what is asked of the app's
|
|
438
|
+
* server for it (`asking`). Null when it shows its value.
|
|
337
439
|
*/
|
|
338
440
|
waitsFor(field: string): WaitsFor | null;
|
|
339
441
|
/**
|
|
@@ -381,6 +483,20 @@ export interface Form {
|
|
|
381
483
|
validate(): boolean;
|
|
382
484
|
save(): Promise<boolean>;
|
|
383
485
|
reset(): void;
|
|
486
|
+
/**
|
|
487
|
+
* Words of the page's with each `{field}` showing the value the form holds now, as `valueWords` writes it — a label's,
|
|
488
|
+
* a help's, a step's title, a button's: "How was your visit to {branch}?" reads "How was your visit to Zamalek?". A
|
|
489
|
+
* name that is no field of the page shows nothing.
|
|
490
|
+
*/
|
|
491
|
+
words(text: string): string;
|
|
492
|
+
/**
|
|
493
|
+
* The ending a page of responses shows now its answers are sent (`FormState.sent`): the first of the page's
|
|
494
|
+
* `endings` whose `when` holds on the answers as sent, with what the source added and the response's `id`, else the
|
|
495
|
+
* first with no `when`; null before a send, on a page with none, or where none holds.
|
|
496
|
+
*/
|
|
497
|
+
ending(): PageEnding | null;
|
|
498
|
+
/** An ending's words, its `{field}`s and `{id}` filled in from the response sent (`FormState.sent`), as `words` writes them. */
|
|
499
|
+
endingWords(text: string): string;
|
|
384
500
|
changes(): RecordChanges;
|
|
385
501
|
addLine(field: string, values?: Values): string;
|
|
386
502
|
updateLine(field: string, key: string, name: string, value: Value): void;
|
|
@@ -448,9 +564,32 @@ export interface Form {
|
|
|
448
564
|
/**
|
|
449
565
|
* Load, or load again, the choices of a selection whose options come from
|
|
450
566
|
* the app's list (`optionsFrom`). Once loaded, they load again by themselves
|
|
451
|
-
* when a field they change with changes; the latest answer wins
|
|
567
|
+
* when a field they change with changes; the latest answer wins, and a
|
|
568
|
+
* choice it no longer offers after the person, a step or the app changed
|
|
569
|
+
* that field is taken out and said (`FormState.takenOut`). A value a record
|
|
570
|
+
* comes in with is kept, and its save says why. A table line's, by its
|
|
571
|
+
* cell's path (`field.lineKey.subfield`), are asked by the line's values and
|
|
572
|
+
* shared with every line where the columns they change with hold the same,
|
|
573
|
+
* for the record shown; once loaded, they follow those columns on that line.
|
|
452
574
|
*/
|
|
453
575
|
loadChoices(field: string): void;
|
|
576
|
+
/**
|
|
577
|
+
* A table line's choices from the app's list, as they are asked for that line, with `values` laid over it — a row
|
|
578
|
+
* pasted on it, its connection read first. `key` null: a line not added yet, by the values one added now starts with.
|
|
579
|
+
*/
|
|
580
|
+
lineChoices(field: string, key: string | null, subfield: string, values?: Values): Promise<Option[]>;
|
|
581
|
+
/**
|
|
582
|
+
* The options a choice offers now: its own — or those its list gave (`optionsFrom.list`), or those picked in the
|
|
583
|
+
* question they are carried from (`optionsFrom.field`), its own after them — less those whose condition hides them
|
|
584
|
+
* (`options[].invisible`). A table line's by its cell's path (`field.lineKey.subfield`), its conditions read on that
|
|
585
|
+
* line. Null for a field that is no choice.
|
|
586
|
+
*/
|
|
587
|
+
offered(field: string): readonly Option[] | null;
|
|
588
|
+
/**
|
|
589
|
+
* Whether a choice's options change with the record's answers: a condition on one, or carried from another question.
|
|
590
|
+
* A table line's by its cell's path: a condition on one of its column's options.
|
|
591
|
+
*/
|
|
592
|
+
offersChange(field: string): boolean;
|
|
454
593
|
/**
|
|
455
594
|
* Load, or load again, the definitions of a properties field whose
|
|
456
595
|
* definitions come from a linked record (`definitionsFrom`). Once loaded,
|
|
@@ -543,6 +682,19 @@ export interface Form {
|
|
|
543
682
|
on<E extends keyof FormEvents>(event: E, listener: (event: FormEvents[E]) => void): () => void;
|
|
544
683
|
restoreDraft(): void;
|
|
545
684
|
discardDraft(): void;
|
|
685
|
+
/** Whether the page offers "Continue later": it says `continueLater`, and its data source has `saveDraft`. */
|
|
686
|
+
canContinueLater(): boolean;
|
|
687
|
+
/**
|
|
688
|
+
* "Continue later": what is typed read first (`settle`), then the answers so far — their wizard step, text that does
|
|
689
|
+
* not read kept as typed — kept on the app's server through `saveDraft` (`later: true`): its answer, the key, and the
|
|
690
|
+
* link the app made to continue from and its words. Rejects where the source refused, or has no `saveDraft`.
|
|
691
|
+
*/
|
|
692
|
+
continueLater(): Promise<SavedDraft>;
|
|
693
|
+
/**
|
|
694
|
+
* Ask the data source's `limits` again — how many responses the page took, this person's, each choice's takers — and
|
|
695
|
+
* show what it tells (`limits`). The form asks it itself as it opens, before its answers go, and after they went.
|
|
696
|
+
*/
|
|
697
|
+
refreshLimits(): Promise<void>;
|
|
546
698
|
/**
|
|
547
699
|
* Whether a file picked for a file or picture field is stored at once,
|
|
548
700
|
* through the data source's `upload`. False without one: a file then
|
|
@@ -551,6 +703,16 @@ export interface Form {
|
|
|
551
703
|
canUpload(): boolean;
|
|
552
704
|
/** Today, as 2026-10-15, on the clock of the page's time zone — the browser's own where it names none — by the form's clock (`now`). */
|
|
553
705
|
today(): string;
|
|
706
|
+
/** Now, by the form's clock (`now`): the computer's own where the app gave none. A signature's when. */
|
|
707
|
+
now(): Date;
|
|
708
|
+
/** The person using the form, as the app named them (`user`); null where it named none. */
|
|
709
|
+
user(): FormUser | null;
|
|
710
|
+
/**
|
|
711
|
+
* The answers shown now, by field, in the page's order: a field placed on the page — or a saved form's answers, by its
|
|
712
|
+
* name — not hidden by its condition, its roles or the record's source, nor in a step passed over with Skip. What a
|
|
713
|
+
* signature that signs every answer signs.
|
|
714
|
+
*/
|
|
715
|
+
shownFields(): string[];
|
|
554
716
|
/**
|
|
555
717
|
* A record of the page's model as conditions read it, the form's own way: its values (a link as its id), its `id`,
|
|
556
718
|
* the person using the form (`user`), the app's `context`, and `editing` false — for what reads conditions on records
|
|
@@ -581,6 +743,15 @@ export interface Form {
|
|
|
581
743
|
* record shown as it was asked (`recordShown`).
|
|
582
744
|
*/
|
|
583
745
|
findDuplicates(): Promise<DuplicateMatch[]>;
|
|
746
|
+
/** Whether the source keeps "It's someone new" itself, on the app's server: it has `notDuplicates` and `markNotDuplicate`, both. */
|
|
747
|
+
keepsNotDuplicates(): boolean;
|
|
748
|
+
/**
|
|
749
|
+
* The records said to be someone else for the record shown, asked of the source's `notDuplicates`: none while it is
|
|
750
|
+
* new. Rejects where the source has no `notDuplicates`. Its answer is for the record shown as it was asked.
|
|
751
|
+
*/
|
|
752
|
+
notDuplicates(): Promise<RecordId[]>;
|
|
753
|
+
/** Keep that `matchId` is someone else for the record shown, through the source's `markNotDuplicate`: refused while it is new. */
|
|
754
|
+
markNotDuplicate(matchId: RecordId): Promise<void>;
|
|
584
755
|
/** Whether records of the page's model can be merged: its source has `merge`, and `load` to read the others. */
|
|
585
756
|
canMerge(): boolean;
|
|
586
757
|
/** Another record of the page's model, as its source loads it, its values alone: the form is left as it is. For a merge's screen. */
|