@uides/stepwise 2.0.0-30d44ed9 → 2.0.0-385c7994
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/LICENSE +0 -0
- package/generators/componentExtractor.d.mts +1 -0
- package/generators/componentReducer.d.mts +1 -0
- package/generators/templateGenerator.d.mts +1 -0
- package/index.d.ts +2 -0
- package/index.js +7 -0
- package/package.json +6 -21
- package/schemas/action.d.ts +2366 -0
- package/schemas/action.js +196 -0
- package/schemas/application.d.ts +19 -0
- package/schemas/application.js +14 -0
- package/schemas/attributes.d.ts +16 -0
- package/schemas/attributes.js +14 -0
- package/schemas/common.d.ts +25 -0
- package/schemas/common.js +41 -0
- package/schemas/document.d.ts +395 -0
- package/schemas/document.js +79 -0
- package/schemas/edupass-healthstate.d.ts +77 -0
- package/schemas/edupass-healthstate.js +76 -0
- package/schemas/field/afm/index.d.ts +52 -0
- package/schemas/field/afm/index.js +20 -0
- package/schemas/field/amka/index.d.ts +60 -0
- package/schemas/field/amka/index.js +21 -0
- package/schemas/field/attachment/index.d.ts +68 -0
- package/schemas/field/attachment/index.js +38 -0
- package/schemas/field/captcha/index.d.ts +48 -0
- package/schemas/field/captcha/index.js +15 -0
- package/schemas/field/choice/index.d.ts +73 -0
- package/schemas/field/choice/index.js +32 -0
- package/schemas/field/common.d.ts +82 -0
- package/schemas/field/common.js +63 -0
- package/schemas/field/consent-content/index.d.ts +68 -0
- package/schemas/field/consent-content/index.js +19 -0
- package/schemas/field/date/index.d.ts +90 -0
- package/schemas/field/date/index.js +42 -0
- package/schemas/field/doc_subtitle/index.d.ts +51 -0
- package/schemas/field/doc_subtitle/index.js +14 -0
- package/schemas/field/doc_title/index.d.ts +60 -0
- package/schemas/field/doc_title/index.js +21 -0
- package/schemas/field/dynamically-filled-text/index.d.ts +85 -0
- package/schemas/field/dynamically-filled-text/index.js +36 -0
- package/schemas/field/email/index.d.ts +60 -0
- package/schemas/field/email/index.js +21 -0
- package/schemas/field/fillable-string/index.d.ts +64 -0
- package/schemas/field/fillable-string/index.js +25 -0
- package/schemas/field/five-block-date/index.d.ts +48 -0
- package/schemas/field/five-block-date/index.js +15 -0
- package/schemas/field/hidden/index.d.ts +59 -0
- package/schemas/field/hidden/index.js +25 -0
- package/schemas/field/hierarchical-selector/index.d.ts +89 -0
- package/schemas/field/hierarchical-selector/index.js +35 -0
- package/schemas/field/iban/index.d.ts +58 -0
- package/schemas/field/iban/index.js +19 -0
- package/schemas/field/image/index.d.ts +68 -0
- package/schemas/field/image/index.js +36 -0
- package/schemas/field/image-crop/index.d.ts +59 -0
- package/schemas/field/image-crop/index.js +19 -0
- package/schemas/field/index.d.ts +48 -0
- package/schemas/field/index.js +167 -0
- package/schemas/field/int/index.d.ts +60 -0
- package/schemas/field/int/index.js +21 -0
- package/schemas/field/intl_mobile_phone/index.d.ts +49 -0
- package/schemas/field/intl_mobile_phone/index.js +15 -0
- package/schemas/field/lab-results/index.d.ts +49 -0
- package/schemas/field/lab-results/index.js +12 -0
- package/schemas/field/landline_phone/index.d.ts +48 -0
- package/schemas/field/landline_phone/index.js +14 -0
- package/schemas/field/link/index.d.ts +50 -0
- package/schemas/field/link/index.js +16 -0
- package/schemas/field/mobile_phone/index.d.ts +51 -0
- package/schemas/field/mobile_phone/index.js +18 -0
- package/schemas/field/multiple-choice/index.d.ts +70 -0
- package/schemas/field/multiple-choice/index.js +31 -0
- package/schemas/field/password/index.d.ts +48 -0
- package/schemas/field/password/index.js +15 -0
- package/schemas/field/pdf-image/index.d.ts +66 -0
- package/schemas/field/pdf-image/index.js +27 -0
- package/schemas/field/phone/index.d.ts +48 -0
- package/schemas/field/phone/index.js +14 -0
- package/schemas/field/postal_code/index.d.ts +50 -0
- package/schemas/field/postal_code/index.js +17 -0
- package/schemas/field/preference-multiple-choice/index.d.ts +90 -0
- package/schemas/field/preference-multiple-choice/index.js +31 -0
- package/schemas/field/qrcode/index.d.ts +71 -0
- package/schemas/field/qrcode/index.js +30 -0
- package/schemas/field/quote/index.d.ts +63 -0
- package/schemas/field/quote/index.js +30 -0
- package/schemas/field/radio-choice/index.d.ts +67 -0
- package/schemas/field/radio-choice/index.js +31 -0
- package/schemas/field/rate/index.d.ts +60 -0
- package/schemas/field/rate/index.js +18 -0
- package/schemas/field/recipient/index.d.ts +51 -0
- package/schemas/field/recipient/index.js +20 -0
- package/schemas/field/redirect/index.d.ts +52 -0
- package/schemas/field/redirect/index.js +15 -0
- package/schemas/field/refcode/index.d.ts +68 -0
- package/schemas/field/refcode/index.js +29 -0
- package/schemas/field/string/index.d.ts +135 -0
- package/schemas/field/string/index.js +80 -0
- package/schemas/field/text/index.d.ts +85 -0
- package/schemas/field/text/index.js +45 -0
- package/schemas/field/three-block-date/index.d.ts +64 -0
- package/schemas/field/three-block-date/index.js +26 -0
- package/schemas/field/url-param/index.d.ts +57 -0
- package/schemas/field/url-param/index.js +14 -0
- package/schemas/fieldset/component-params.d.ts +102 -0
- package/schemas/fieldset/component-params.js +63 -0
- package/schemas/fieldset/display-components.d.ts +353 -0
- package/schemas/fieldset/display-components.js +36 -0
- package/schemas/fieldset/enums.d.ts +32 -0
- package/schemas/fieldset/enums.js +21 -0
- package/schemas/fieldset/index.d.ts +180 -0
- package/schemas/fieldset/index.js +11 -0
- package/schemas/index.d.ts +15 -0
- package/schemas/index.js +15 -0
- package/schemas/layout.d.ts +91 -0
- package/schemas/layout.js +43 -0
- package/schemas/outputs.d.ts +44 -0
- package/schemas/outputs.js +15 -0
- package/schemas/resolve.d.ts +5 -0
- package/schemas/resolve.js +13 -0
- package/schemas/resource/enums.d.ts +58 -0
- package/schemas/resource/enums.js +41 -0
- package/schemas/resource/field.d.ts +15 -0
- package/schemas/resource/field.js +12 -0
- package/schemas/resource/index.d.ts +5 -0
- package/schemas/resource/index.js +5 -0
- package/schemas/resource/object-action.d.ts +30 -0
- package/schemas/resource/object-action.js +24 -0
- package/schemas/resource/resource-action.d.ts +35 -0
- package/schemas/resource/resource-action.js +29 -0
- package/schemas/resource/resource.d.ts +133 -0
- package/schemas/resource/resource.js +31 -0
- package/schemas/step.d.ts +592 -0
- package/schemas/step.js +115 -0
- package/schemas/template/index.d.ts +2 -0
- package/schemas/template/index.js +2 -0
- package/schemas/template/template-base.d.ts +53 -0
- package/schemas/template/template-base.js +15 -0
- package/schemas/template/template-source.d.ts +50 -0
- package/schemas/template/template-source.js +14 -0
- package/schemas/template/template.d.ts +54 -0
- package/schemas/template/template.js +22 -0
- package/schemas/validation-context/enums.d.ts +10 -0
- package/schemas/validation-context/enums.js +7 -0
- package/schemas/validation-context/index.d.ts +2 -0
- package/schemas/validation-context/index.js +2 -0
- package/schemas/validation-context/validation-context.d.ts +131 -0
- package/schemas/validation-context/validation-context.js +55 -0
- package/src/schemas/action.ts +15 -0
- package/src/schemas/common.ts +16 -0
- package/src/schemas/field/afm/index.ts +2 -18
- package/src/schemas/field/amka/index.ts +7 -2
- package/src/schemas/field/attachment/index.ts +12 -24
- package/src/schemas/field/choice/index.ts +2 -13
- package/src/schemas/field/common.ts +75 -51
- package/src/schemas/field/consent-content/index.ts +28 -0
- package/src/schemas/field/date/index.ts +5 -32
- package/src/schemas/field/doc_subtitle/index.ts +1 -0
- package/src/schemas/field/doc_title/index.ts +9 -16
- package/src/schemas/field/dynamically-filled-text/index.ts +4 -5
- package/src/schemas/field/email/index.ts +6 -9
- package/src/schemas/field/fillable-string/index.ts +1 -1
- package/src/schemas/field/hidden/index.ts +4 -43
- package/src/schemas/field/hierarchical-selector/index.ts +3 -9
- package/src/schemas/field/image/index.ts +5 -24
- package/src/schemas/field/image-crop/index.ts +25 -0
- package/src/schemas/field/index.spec.ts +0 -42
- package/src/schemas/field/index.ts +64 -12
- package/src/schemas/field/int/index.ts +2 -0
- package/src/schemas/field/intl_mobile_phone/index.ts +19 -0
- package/src/schemas/field/lab-results/index.ts +1 -2
- package/src/schemas/field/link/index.ts +20 -0
- package/src/schemas/field/mobile_phone/index.ts +1 -12
- package/src/schemas/field/multiple-choice/index.ts +4 -3
- package/src/schemas/field/password/index.ts +18 -0
- package/src/schemas/field/pdf-image/index.ts +3 -15
- package/src/schemas/field/phone/index.ts +18 -0
- package/src/schemas/field/postal_code/index.ts +1 -1
- package/src/schemas/field/preference-multiple-choice/index.ts +41 -0
- package/src/schemas/field/qrcode/index.ts +1 -0
- package/src/schemas/field/quote/index.ts +2 -19
- package/src/schemas/field/radio-choice/index.ts +1 -7
- package/src/schemas/field/rate/index.ts +1 -9
- package/src/schemas/field/recipient/index.ts +2 -2
- package/src/schemas/field/redirect/index.ts +4 -13
- package/src/schemas/field/refcode/index.ts +10 -15
- package/src/schemas/field/string/index.ts +13 -0
- package/src/schemas/field/text/index.ts +4 -18
- package/src/schemas/field/url-param/index.ts +23 -0
- package/src/schemas/resolve.ts +3 -0
- package/src/schemas/step.ts +2 -0
- package/src/schemas/template/index.ts +0 -1
- package/src/schemas/template/template-base.ts +0 -10
- package/src/schemas/template/template.ts +1 -2
- package/src/schemas/validation-context/enums.ts +0 -16
- package/src/schemas/validation-context/validation-context.ts +2 -4
- package/src/utils/index.ts +10 -1
- package/utils/index.d.ts +6 -0
- package/utils/index.js +55 -0
- package/.prettierrc.js +0 -1
- package/.rush/temp/chunked-rush-logs/stepwise.build.chunks.jsonl +0 -6
- package/.rush/temp/package-deps_build.json +0 -185
- package/.rush/temp/shrinkwrap-deps.json +0 -303
- package/eslint.config.mjs +0 -3
- package/rush-logs/stepwise.build.log +0 -6
- package/src/schemas/field/green-pass-qrcode/index.ts +0 -27
- package/src/schemas/template/enums.ts +0 -22
- package/tsconfig.json +0 -25
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as v from 'valibot';
|
|
2
|
+
declare const AfmSchema: v.StrictObjectSchema<{
|
|
3
|
+
readonly 'user-input-mode': v.PicklistSchema<["noinput", "optional", "required", "display"], undefined>;
|
|
4
|
+
readonly attribute: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
5
|
+
readonly datatype: v.NullishSchema<v.LiteralSchema<"afm", undefined>, undefined>;
|
|
6
|
+
readonly display: v.SchemaWithPipe<readonly [v.RecordSchema<v.StringSchema<undefined>, v.AnySchema, undefined>, v.RawCheckAction<import("../common.js").DisplayType<v.ObjectSchema<{
|
|
7
|
+
readonly title: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
8
|
+
readonly title_md: v.NullishSchema<v.NumberSchema<undefined>, undefined>;
|
|
9
|
+
readonly value_md: v.NullishSchema<v.NumberSchema<undefined>, undefined>;
|
|
10
|
+
readonly hint: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
11
|
+
readonly hint_md: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
12
|
+
readonly template_hint: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
13
|
+
readonly example: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
14
|
+
readonly layout: v.NullishSchema<v.StrictObjectSchema<{
|
|
15
|
+
readonly md: v.StringSchema<undefined>;
|
|
16
|
+
}, undefined>, undefined>;
|
|
17
|
+
} & {
|
|
18
|
+
readonly component: v.LiteralSchema<"afm", undefined>;
|
|
19
|
+
}, undefined>, v.ObjectSchema<{
|
|
20
|
+
readonly title: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
21
|
+
readonly title_md: v.NullishSchema<v.NumberSchema<undefined>, undefined>;
|
|
22
|
+
readonly value_md: v.NullishSchema<v.NumberSchema<undefined>, undefined>;
|
|
23
|
+
readonly hint: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
24
|
+
readonly hint_md: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
25
|
+
readonly template_hint: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
26
|
+
readonly example: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
27
|
+
readonly layout: v.NullishSchema<v.StrictObjectSchema<{
|
|
28
|
+
readonly md: v.StringSchema<undefined>;
|
|
29
|
+
}, undefined>, undefined>;
|
|
30
|
+
} & {
|
|
31
|
+
readonly component: v.LiteralSchema<"afm", undefined>;
|
|
32
|
+
}, undefined>, v.ObjectSchema<{
|
|
33
|
+
readonly title: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
34
|
+
readonly title_md: v.NullishSchema<v.NumberSchema<undefined>, undefined>;
|
|
35
|
+
readonly value_md: v.NullishSchema<v.NumberSchema<undefined>, undefined>;
|
|
36
|
+
readonly hint: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
37
|
+
readonly hint_md: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
38
|
+
readonly template_hint: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
39
|
+
readonly example: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
40
|
+
readonly layout: v.NullishSchema<v.StrictObjectSchema<{
|
|
41
|
+
readonly md: v.StringSchema<undefined>;
|
|
42
|
+
}, undefined>, undefined>;
|
|
43
|
+
} & {
|
|
44
|
+
readonly component: v.LiteralSchema<"afm", undefined>;
|
|
45
|
+
}, undefined>>>]>;
|
|
46
|
+
readonly 'default-value': v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
47
|
+
readonly sources: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
48
|
+
}, undefined>;
|
|
49
|
+
export type AfmType = v.InferOutput<typeof AfmSchema>;
|
|
50
|
+
export type AfmSchemaType = v.GenericSchema<AfmType>;
|
|
51
|
+
declare const _default: AfmSchemaType;
|
|
52
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { literal, nullish, picklist, strictObject, string } from "valibot";
|
|
2
|
+
import { createFieldDisplay } from "../common.js";
|
|
3
|
+
const AfmDisplaySchema = createFieldDisplay(strictObject({
|
|
4
|
+
component: literal('afm')
|
|
5
|
+
}));
|
|
6
|
+
const AfmSchema = strictObject({
|
|
7
|
+
'user-input-mode': picklist([
|
|
8
|
+
'noinput',
|
|
9
|
+
'optional',
|
|
10
|
+
'required',
|
|
11
|
+
'display'
|
|
12
|
+
]),
|
|
13
|
+
attribute: nullish(string()),
|
|
14
|
+
datatype: nullish(literal('afm')),
|
|
15
|
+
display: AfmDisplaySchema,
|
|
16
|
+
'default-value': nullish(string()),
|
|
17
|
+
sources: nullish(string())
|
|
18
|
+
});
|
|
19
|
+
const afm = AfmSchema;
|
|
20
|
+
export { afm as default };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import * as v from 'valibot';
|
|
2
|
+
declare const AmkaSchema: v.StrictObjectSchema<{
|
|
3
|
+
readonly 'user-input-mode': v.PicklistSchema<["noinput", "optional", "required"], undefined>;
|
|
4
|
+
readonly attribute: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
5
|
+
readonly display: v.SchemaWithPipe<readonly [v.RecordSchema<v.StringSchema<undefined>, v.AnySchema, undefined>, v.RawCheckAction<import("../common.js").DisplayType<v.ObjectSchema<{
|
|
6
|
+
readonly title: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
7
|
+
readonly title_md: v.NullishSchema<v.NumberSchema<undefined>, undefined>;
|
|
8
|
+
readonly value_md: v.NullishSchema<v.NumberSchema<undefined>, undefined>;
|
|
9
|
+
readonly hint: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
10
|
+
readonly hint_md: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
11
|
+
readonly template_hint: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
12
|
+
readonly example: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
13
|
+
readonly layout: v.NullishSchema<v.StrictObjectSchema<{
|
|
14
|
+
readonly md: v.StringSchema<undefined>;
|
|
15
|
+
}, undefined>, undefined>;
|
|
16
|
+
} & {
|
|
17
|
+
readonly component: v.LiteralSchema<"amka", undefined>;
|
|
18
|
+
readonly 'component-params': v.NullishSchema<v.StrictObjectSchema<{
|
|
19
|
+
readonly textColor: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
20
|
+
}, undefined>, undefined>;
|
|
21
|
+
}, undefined>, v.ObjectSchema<{
|
|
22
|
+
readonly title: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
23
|
+
readonly title_md: v.NullishSchema<v.NumberSchema<undefined>, undefined>;
|
|
24
|
+
readonly value_md: v.NullishSchema<v.NumberSchema<undefined>, undefined>;
|
|
25
|
+
readonly hint: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
26
|
+
readonly hint_md: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
27
|
+
readonly template_hint: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
28
|
+
readonly example: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
29
|
+
readonly layout: v.NullishSchema<v.StrictObjectSchema<{
|
|
30
|
+
readonly md: v.StringSchema<undefined>;
|
|
31
|
+
}, undefined>, undefined>;
|
|
32
|
+
} & {
|
|
33
|
+
readonly component: v.LiteralSchema<"amka", undefined>;
|
|
34
|
+
readonly 'component-params': v.NullishSchema<v.StrictObjectSchema<{
|
|
35
|
+
readonly textColor: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
36
|
+
}, undefined>, undefined>;
|
|
37
|
+
}, undefined>, v.ObjectSchema<{
|
|
38
|
+
readonly title: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
39
|
+
readonly title_md: v.NullishSchema<v.NumberSchema<undefined>, undefined>;
|
|
40
|
+
readonly value_md: v.NullishSchema<v.NumberSchema<undefined>, undefined>;
|
|
41
|
+
readonly hint: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
42
|
+
readonly hint_md: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
43
|
+
readonly template_hint: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
44
|
+
readonly example: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
45
|
+
readonly layout: v.NullishSchema<v.StrictObjectSchema<{
|
|
46
|
+
readonly md: v.StringSchema<undefined>;
|
|
47
|
+
}, undefined>, undefined>;
|
|
48
|
+
} & {
|
|
49
|
+
readonly component: v.LiteralSchema<"amka", undefined>;
|
|
50
|
+
readonly 'component-params': v.NullishSchema<v.StrictObjectSchema<{
|
|
51
|
+
readonly textColor: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
52
|
+
}, undefined>, undefined>;
|
|
53
|
+
}, undefined>>>]>;
|
|
54
|
+
readonly datatype: v.NullishSchema<v.LiteralSchema<"amka", undefined>, undefined>;
|
|
55
|
+
readonly 'default-value': v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
56
|
+
}, undefined>;
|
|
57
|
+
export type AmkaType = v.InferOutput<typeof AmkaSchema>;
|
|
58
|
+
export type AmkaSchemaType = v.GenericSchema<AmkaType>;
|
|
59
|
+
declare const _default: AmkaSchemaType;
|
|
60
|
+
export default _default;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { literal, nullish, picklist, strictObject, string } from "valibot";
|
|
2
|
+
import { createFieldDisplay } from "../common.js";
|
|
3
|
+
const AmkaDisplaySchema = createFieldDisplay(strictObject({
|
|
4
|
+
component: literal('amka'),
|
|
5
|
+
'component-params': nullish(strictObject({
|
|
6
|
+
textColor: nullish(string())
|
|
7
|
+
}))
|
|
8
|
+
}));
|
|
9
|
+
const AmkaSchema = strictObject({
|
|
10
|
+
'user-input-mode': picklist([
|
|
11
|
+
'noinput',
|
|
12
|
+
'optional',
|
|
13
|
+
'required'
|
|
14
|
+
]),
|
|
15
|
+
attribute: nullish(string()),
|
|
16
|
+
display: AmkaDisplaySchema,
|
|
17
|
+
datatype: nullish(literal('amka')),
|
|
18
|
+
'default-value': nullish(string())
|
|
19
|
+
});
|
|
20
|
+
const amka = AmkaSchema;
|
|
21
|
+
export { amka as default };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import * as v from 'valibot';
|
|
2
|
+
declare const AttachmentSchema: v.StrictObjectSchema<{
|
|
3
|
+
readonly 'user-input-mode': v.PicklistSchema<["noinput", "optional", "required", "display"], undefined>;
|
|
4
|
+
readonly datatype: v.NullishSchema<v.LiteralSchema<"attachment", undefined>, undefined>;
|
|
5
|
+
readonly attribute: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
6
|
+
readonly display: v.SchemaWithPipe<readonly [v.RecordSchema<v.StringSchema<undefined>, v.AnySchema, undefined>, v.RawCheckAction<import("../common.js").DisplayType<v.ObjectSchema<{
|
|
7
|
+
readonly title: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
8
|
+
readonly title_md: v.NullishSchema<v.NumberSchema<undefined>, undefined>;
|
|
9
|
+
readonly value_md: v.NullishSchema<v.NumberSchema<undefined>, undefined>;
|
|
10
|
+
readonly hint: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
11
|
+
readonly hint_md: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
12
|
+
readonly template_hint: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
13
|
+
readonly example: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
14
|
+
readonly layout: v.NullishSchema<v.StrictObjectSchema<{
|
|
15
|
+
readonly md: v.StringSchema<undefined>;
|
|
16
|
+
}, undefined>, undefined>;
|
|
17
|
+
} & {
|
|
18
|
+
readonly component: v.LiteralSchema<"attachment", undefined>;
|
|
19
|
+
readonly 'component-params': v.NullishSchema<v.StrictObjectSchema<{
|
|
20
|
+
readonly multiplicity: v.NullishSchema<v.NumberSchema<undefined>, undefined>;
|
|
21
|
+
readonly filetype: v.NullishSchema<v.PicklistSchema<["pdf", "pdf-for-mark"], undefined>, undefined>;
|
|
22
|
+
readonly 'file-max-size': v.NullishSchema<v.NumberSchema<undefined>, undefined>;
|
|
23
|
+
}, undefined>, undefined>;
|
|
24
|
+
}, undefined>, v.ObjectSchema<{
|
|
25
|
+
readonly title: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
26
|
+
readonly title_md: v.NullishSchema<v.NumberSchema<undefined>, undefined>;
|
|
27
|
+
readonly value_md: v.NullishSchema<v.NumberSchema<undefined>, undefined>;
|
|
28
|
+
readonly hint: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
29
|
+
readonly hint_md: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
30
|
+
readonly template_hint: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
31
|
+
readonly example: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
32
|
+
readonly layout: v.NullishSchema<v.StrictObjectSchema<{
|
|
33
|
+
readonly md: v.StringSchema<undefined>;
|
|
34
|
+
}, undefined>, undefined>;
|
|
35
|
+
} & {
|
|
36
|
+
readonly component: v.LiteralSchema<"attachment", undefined>;
|
|
37
|
+
readonly 'component-params': v.NullishSchema<v.StrictObjectSchema<{
|
|
38
|
+
readonly multiplicity: v.NullishSchema<v.NumberSchema<undefined>, undefined>;
|
|
39
|
+
readonly filetype: v.NullishSchema<v.PicklistSchema<["pdf", "pdf-for-mark"], undefined>, undefined>;
|
|
40
|
+
readonly 'file-max-size': v.NullishSchema<v.NumberSchema<undefined>, undefined>;
|
|
41
|
+
}, undefined>, undefined>;
|
|
42
|
+
}, undefined>, v.ObjectSchema<{
|
|
43
|
+
readonly title: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
44
|
+
readonly title_md: v.NullishSchema<v.NumberSchema<undefined>, undefined>;
|
|
45
|
+
readonly value_md: v.NullishSchema<v.NumberSchema<undefined>, undefined>;
|
|
46
|
+
readonly hint: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
47
|
+
readonly hint_md: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
48
|
+
readonly template_hint: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
49
|
+
readonly example: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
50
|
+
readonly layout: v.NullishSchema<v.StrictObjectSchema<{
|
|
51
|
+
readonly md: v.StringSchema<undefined>;
|
|
52
|
+
}, undefined>, undefined>;
|
|
53
|
+
} & {
|
|
54
|
+
readonly component: v.LiteralSchema<"attachment", undefined>;
|
|
55
|
+
readonly 'component-params': v.NullishSchema<v.StrictObjectSchema<{
|
|
56
|
+
readonly multiplicity: v.NullishSchema<v.NumberSchema<undefined>, undefined>;
|
|
57
|
+
readonly filetype: v.NullishSchema<v.PicklistSchema<["pdf", "pdf-for-mark"], undefined>, undefined>;
|
|
58
|
+
readonly 'file-max-size': v.NullishSchema<v.NumberSchema<undefined>, undefined>;
|
|
59
|
+
}, undefined>, undefined>;
|
|
60
|
+
}, undefined>>>]>;
|
|
61
|
+
readonly sources: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
62
|
+
readonly 'value-constructor': v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
63
|
+
readonly 'validation-download-attachment-fn': v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
64
|
+
}, undefined>;
|
|
65
|
+
export type AttachmentType = v.InferOutput<typeof AttachmentSchema>;
|
|
66
|
+
export type AttachmentSchemaType = v.GenericSchema<AttachmentType>;
|
|
67
|
+
declare const _default: AttachmentSchemaType;
|
|
68
|
+
export default _default;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { array, literal, nullable, nullish, number, picklist, strictObject, string } from "valibot";
|
|
2
|
+
import { createFieldDisplay } from "../common.js";
|
|
3
|
+
const CommonAttachmentComponentParamsSchema = strictObject({
|
|
4
|
+
filetype: nullish(picklist([
|
|
5
|
+
'pdf',
|
|
6
|
+
'pdf-for-mark'
|
|
7
|
+
])),
|
|
8
|
+
'file-max-size': nullish(number())
|
|
9
|
+
});
|
|
10
|
+
const AttachmentDisplaySchema = createFieldDisplay(strictObject({
|
|
11
|
+
component: literal('attachment'),
|
|
12
|
+
'component-params': nullish(strictObject({
|
|
13
|
+
...CommonAttachmentComponentParamsSchema.entries,
|
|
14
|
+
multiplicity: nullish(number())
|
|
15
|
+
}))
|
|
16
|
+
}), strictObject({
|
|
17
|
+
component: literal('attachment'),
|
|
18
|
+
'component-params': nullish(strictObject({
|
|
19
|
+
...CommonAttachmentComponentParamsSchema.entries,
|
|
20
|
+
coordinates: nullish(array(nullable(number())))
|
|
21
|
+
}))
|
|
22
|
+
}));
|
|
23
|
+
const AttachmentSchema = strictObject({
|
|
24
|
+
'user-input-mode': picklist([
|
|
25
|
+
'noinput',
|
|
26
|
+
'optional',
|
|
27
|
+
'required',
|
|
28
|
+
'display'
|
|
29
|
+
]),
|
|
30
|
+
datatype: nullish(literal('attachment')),
|
|
31
|
+
attribute: nullish(string()),
|
|
32
|
+
display: AttachmentDisplaySchema,
|
|
33
|
+
sources: nullish(string()),
|
|
34
|
+
'value-constructor': nullish(string()),
|
|
35
|
+
'validation-download-attachment-fn': nullish(string())
|
|
36
|
+
});
|
|
37
|
+
const attachment = AttachmentSchema;
|
|
38
|
+
export { attachment as default };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import * as v from 'valibot';
|
|
2
|
+
declare const CaptchaSchema: v.StrictObjectSchema<{
|
|
3
|
+
readonly 'user-input-mode': v.PicklistSchema<["noinput", "optional", "required"], undefined>;
|
|
4
|
+
readonly display: v.SchemaWithPipe<readonly [v.RecordSchema<v.StringSchema<undefined>, v.AnySchema, undefined>, v.RawCheckAction<import("../common.js").DisplayType<v.ObjectSchema<{
|
|
5
|
+
readonly title: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
6
|
+
readonly title_md: v.NullishSchema<v.NumberSchema<undefined>, undefined>;
|
|
7
|
+
readonly value_md: v.NullishSchema<v.NumberSchema<undefined>, undefined>;
|
|
8
|
+
readonly hint: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
9
|
+
readonly hint_md: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
10
|
+
readonly template_hint: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
11
|
+
readonly example: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
12
|
+
readonly layout: v.NullishSchema<v.StrictObjectSchema<{
|
|
13
|
+
readonly md: v.StringSchema<undefined>;
|
|
14
|
+
}, undefined>, undefined>;
|
|
15
|
+
} & {
|
|
16
|
+
readonly component: v.LiteralSchema<"captcha", undefined>;
|
|
17
|
+
}, undefined>, v.ObjectSchema<{
|
|
18
|
+
readonly title: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
19
|
+
readonly title_md: v.NullishSchema<v.NumberSchema<undefined>, undefined>;
|
|
20
|
+
readonly value_md: v.NullishSchema<v.NumberSchema<undefined>, undefined>;
|
|
21
|
+
readonly hint: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
22
|
+
readonly hint_md: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
23
|
+
readonly template_hint: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
24
|
+
readonly example: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
25
|
+
readonly layout: v.NullishSchema<v.StrictObjectSchema<{
|
|
26
|
+
readonly md: v.StringSchema<undefined>;
|
|
27
|
+
}, undefined>, undefined>;
|
|
28
|
+
} & {
|
|
29
|
+
readonly component: v.LiteralSchema<"captcha", undefined>;
|
|
30
|
+
}, undefined>, v.ObjectSchema<{
|
|
31
|
+
readonly title: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
32
|
+
readonly title_md: v.NullishSchema<v.NumberSchema<undefined>, undefined>;
|
|
33
|
+
readonly value_md: v.NullishSchema<v.NumberSchema<undefined>, undefined>;
|
|
34
|
+
readonly hint: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
35
|
+
readonly hint_md: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
36
|
+
readonly template_hint: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
37
|
+
readonly example: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
38
|
+
readonly layout: v.NullishSchema<v.StrictObjectSchema<{
|
|
39
|
+
readonly md: v.StringSchema<undefined>;
|
|
40
|
+
}, undefined>, undefined>;
|
|
41
|
+
} & {
|
|
42
|
+
readonly component: v.LiteralSchema<"captcha", undefined>;
|
|
43
|
+
}, undefined>>>]>;
|
|
44
|
+
}, undefined>;
|
|
45
|
+
export type CaptchaType = v.InferOutput<typeof CaptchaSchema>;
|
|
46
|
+
export type CaptchaSchemaType = v.GenericSchema<CaptchaType>;
|
|
47
|
+
declare const _default: CaptchaSchemaType;
|
|
48
|
+
export default _default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { literal, picklist, strictObject } from "valibot";
|
|
2
|
+
import { createFieldDisplay } from "../common.js";
|
|
3
|
+
const CaptchaDisplaySchema = createFieldDisplay(strictObject({
|
|
4
|
+
component: literal('captcha')
|
|
5
|
+
}));
|
|
6
|
+
const CaptchaSchema = strictObject({
|
|
7
|
+
'user-input-mode': picklist([
|
|
8
|
+
'noinput',
|
|
9
|
+
'optional',
|
|
10
|
+
'required'
|
|
11
|
+
]),
|
|
12
|
+
display: CaptchaDisplaySchema
|
|
13
|
+
});
|
|
14
|
+
const captcha = CaptchaSchema;
|
|
15
|
+
export { captcha as default };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import * as v from 'valibot';
|
|
2
|
+
declare const ChoiceSchema: v.StrictObjectSchema<{
|
|
3
|
+
readonly 'user-input-mode': v.PicklistSchema<["noinput", "optional", "required"], undefined>;
|
|
4
|
+
readonly display: v.SchemaWithPipe<readonly [v.RecordSchema<v.StringSchema<undefined>, v.AnySchema, undefined>, v.RawCheckAction<import("../common.js").DisplayType<v.ObjectSchema<{
|
|
5
|
+
readonly title: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
6
|
+
readonly title_md: v.NullishSchema<v.NumberSchema<undefined>, undefined>;
|
|
7
|
+
readonly value_md: v.NullishSchema<v.NumberSchema<undefined>, undefined>;
|
|
8
|
+
readonly hint: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
9
|
+
readonly hint_md: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
10
|
+
readonly template_hint: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
11
|
+
readonly example: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
12
|
+
readonly layout: v.NullishSchema<v.StrictObjectSchema<{
|
|
13
|
+
readonly md: v.StringSchema<undefined>;
|
|
14
|
+
}, undefined>, undefined>;
|
|
15
|
+
} & {
|
|
16
|
+
readonly component: v.LiteralSchema<"choice", undefined>;
|
|
17
|
+
readonly choices: v.NullishSchema<v.UnionSchema<[v.StringSchema<undefined>, v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>], undefined>, undefined>;
|
|
18
|
+
readonly 'choices-order': v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
19
|
+
readonly 'component-params': v.NullishSchema<v.StrictObjectSchema<{
|
|
20
|
+
readonly autocomplete: v.NullishSchema<v.BooleanSchema<undefined>, undefined>;
|
|
21
|
+
readonly 'legacy-mode': v.NullishSchema<v.BooleanSchema<undefined>, undefined>;
|
|
22
|
+
readonly 'format-title': v.NullishSchema<v.BooleanSchema<undefined>, undefined>;
|
|
23
|
+
}, undefined>, undefined>;
|
|
24
|
+
}, undefined>, v.ObjectSchema<{
|
|
25
|
+
readonly title: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
26
|
+
readonly title_md: v.NullishSchema<v.NumberSchema<undefined>, undefined>;
|
|
27
|
+
readonly value_md: v.NullishSchema<v.NumberSchema<undefined>, undefined>;
|
|
28
|
+
readonly hint: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
29
|
+
readonly hint_md: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
30
|
+
readonly template_hint: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
31
|
+
readonly example: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
32
|
+
readonly layout: v.NullishSchema<v.StrictObjectSchema<{
|
|
33
|
+
readonly md: v.StringSchema<undefined>;
|
|
34
|
+
}, undefined>, undefined>;
|
|
35
|
+
} & {
|
|
36
|
+
readonly component: v.LiteralSchema<"choice", undefined>;
|
|
37
|
+
readonly choices: v.NullishSchema<v.UnionSchema<[v.StringSchema<undefined>, v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>], undefined>, undefined>;
|
|
38
|
+
readonly 'choices-order': v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
39
|
+
readonly 'component-params': v.NullishSchema<v.StrictObjectSchema<{
|
|
40
|
+
readonly autocomplete: v.NullishSchema<v.BooleanSchema<undefined>, undefined>;
|
|
41
|
+
readonly 'legacy-mode': v.NullishSchema<v.BooleanSchema<undefined>, undefined>;
|
|
42
|
+
readonly 'format-title': v.NullishSchema<v.BooleanSchema<undefined>, undefined>;
|
|
43
|
+
}, undefined>, undefined>;
|
|
44
|
+
}, undefined>, v.ObjectSchema<{
|
|
45
|
+
readonly title: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
46
|
+
readonly title_md: v.NullishSchema<v.NumberSchema<undefined>, undefined>;
|
|
47
|
+
readonly value_md: v.NullishSchema<v.NumberSchema<undefined>, undefined>;
|
|
48
|
+
readonly hint: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
49
|
+
readonly hint_md: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
50
|
+
readonly template_hint: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
51
|
+
readonly example: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
52
|
+
readonly layout: v.NullishSchema<v.StrictObjectSchema<{
|
|
53
|
+
readonly md: v.StringSchema<undefined>;
|
|
54
|
+
}, undefined>, undefined>;
|
|
55
|
+
} & {
|
|
56
|
+
readonly component: v.LiteralSchema<"choice", undefined>;
|
|
57
|
+
readonly choices: v.NullishSchema<v.UnionSchema<[v.StringSchema<undefined>, v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>], undefined>, undefined>;
|
|
58
|
+
readonly 'choices-order': v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
59
|
+
readonly 'component-params': v.NullishSchema<v.StrictObjectSchema<{
|
|
60
|
+
readonly autocomplete: v.NullishSchema<v.BooleanSchema<undefined>, undefined>;
|
|
61
|
+
readonly 'legacy-mode': v.NullishSchema<v.BooleanSchema<undefined>, undefined>;
|
|
62
|
+
readonly 'format-title': v.NullishSchema<v.BooleanSchema<undefined>, undefined>;
|
|
63
|
+
}, undefined>, undefined>;
|
|
64
|
+
}, undefined>>>]>;
|
|
65
|
+
readonly 'default-value': v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
66
|
+
readonly 'choices-source-fn': v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
67
|
+
readonly attribute: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
68
|
+
readonly datatype: v.NullishSchema<v.PicklistSchema<["choice", "string"], undefined>, undefined>;
|
|
69
|
+
}, undefined>;
|
|
70
|
+
export type ChoiceType = v.InferOutput<typeof ChoiceSchema>;
|
|
71
|
+
export type ChoiceSchemaType = v.GenericSchema<ChoiceType>;
|
|
72
|
+
declare const _default: ChoiceSchemaType;
|
|
73
|
+
export default _default;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { boolean as external_valibot_boolean, literal, nullish, picklist, record, strictObject, string, union } from "valibot";
|
|
2
|
+
import { createFieldDisplay } from "../common.js";
|
|
3
|
+
const ChoiceDisplaySchema = createFieldDisplay(strictObject({
|
|
4
|
+
component: literal('choice'),
|
|
5
|
+
choices: nullish(union([
|
|
6
|
+
string(),
|
|
7
|
+
record(string(), string())
|
|
8
|
+
])),
|
|
9
|
+
'choices-order': nullish(string()),
|
|
10
|
+
'component-params': nullish(strictObject({
|
|
11
|
+
autocomplete: nullish(external_valibot_boolean()),
|
|
12
|
+
'legacy-mode': nullish(external_valibot_boolean()),
|
|
13
|
+
'format-title': nullish(external_valibot_boolean())
|
|
14
|
+
}))
|
|
15
|
+
}));
|
|
16
|
+
const ChoiceSchema = strictObject({
|
|
17
|
+
'user-input-mode': picklist([
|
|
18
|
+
'noinput',
|
|
19
|
+
'optional',
|
|
20
|
+
'required'
|
|
21
|
+
]),
|
|
22
|
+
display: ChoiceDisplaySchema,
|
|
23
|
+
'default-value': nullish(string()),
|
|
24
|
+
'choices-source-fn': nullish(string()),
|
|
25
|
+
attribute: nullish(string()),
|
|
26
|
+
datatype: nullish(picklist([
|
|
27
|
+
'choice',
|
|
28
|
+
'string'
|
|
29
|
+
]))
|
|
30
|
+
});
|
|
31
|
+
const choice = ChoiceSchema;
|
|
32
|
+
export { choice as default };
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import * as v from 'valibot';
|
|
2
|
+
import { DisplayLang } from '../common.js';
|
|
3
|
+
export declare const DisplayModeAndLangSchema: v.SchemaWithPipe<readonly [v.RecordSchema<v.PicklistSchema<["default", "web", "pdf"], undefined>, v.SchemaWithPipe<readonly [v.RecordSchema<v.PicklistSchema<["default", "el", "en", "fr"], undefined>, v.AnySchema, undefined>, v.CheckAction<{
|
|
4
|
+
default?: any;
|
|
5
|
+
el?: any;
|
|
6
|
+
en?: any;
|
|
7
|
+
fr?: any;
|
|
8
|
+
}, "At least one display lang must be defined.">]>, undefined>, v.CheckAction<{
|
|
9
|
+
default?: {
|
|
10
|
+
default?: any;
|
|
11
|
+
el?: any;
|
|
12
|
+
en?: any;
|
|
13
|
+
fr?: any;
|
|
14
|
+
} | undefined;
|
|
15
|
+
web?: {
|
|
16
|
+
default?: any;
|
|
17
|
+
el?: any;
|
|
18
|
+
en?: any;
|
|
19
|
+
fr?: any;
|
|
20
|
+
} | undefined;
|
|
21
|
+
pdf?: {
|
|
22
|
+
default?: any;
|
|
23
|
+
el?: any;
|
|
24
|
+
en?: any;
|
|
25
|
+
fr?: any;
|
|
26
|
+
} | undefined;
|
|
27
|
+
}, "At least one display mode must be defined.">]>;
|
|
28
|
+
type AnyGenericSchema = v.GenericSchema<unknown, unknown>;
|
|
29
|
+
export interface DisplayType<DefaultDisplaySchema extends AnyGenericSchema, WebDisplaySchema extends AnyGenericSchema = AnyGenericSchema, PdfDisplaySchema extends AnyGenericSchema = AnyGenericSchema> {
|
|
30
|
+
default?: Partial<Record<DisplayLang, v.InferOutput<DefaultDisplaySchema> | (unknown & Record<never, never>)>>;
|
|
31
|
+
web?: Partial<Record<DisplayLang, v.InferOutput<WebDisplaySchema> | (unknown & Record<never, never>)>>;
|
|
32
|
+
pdf?: Partial<Record<DisplayLang, v.InferOutput<PdfDisplaySchema> | (unknown & Record<never, never>)>>;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Creates a field display schema with specified default and PDF display properties.
|
|
36
|
+
*
|
|
37
|
+
* Defaults are:
|
|
38
|
+
* - title
|
|
39
|
+
* - title_md
|
|
40
|
+
* - value_md
|
|
41
|
+
* - hint
|
|
42
|
+
* - hint_md
|
|
43
|
+
* - template_hint
|
|
44
|
+
* - layout
|
|
45
|
+
* - md
|
|
46
|
+
* - example
|
|
47
|
+
*/
|
|
48
|
+
export declare function createFieldDisplay<D extends v.ObjectEntries, P extends v.ObjectEntries = never>(DefaultDisplay: v.StrictObjectSchema<D, undefined> | v.LooseObjectSchema<D, undefined>, PdfDisplay?: v.StrictObjectSchema<P, undefined> | v.LooseObjectSchema<P, undefined>): v.SchemaWithPipe<readonly [v.RecordSchema<v.StringSchema<undefined>, v.AnySchema, undefined>, v.RawCheckAction<DisplayType<v.ObjectSchema<{
|
|
49
|
+
readonly title: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
50
|
+
readonly title_md: v.NullishSchema<v.NumberSchema<undefined>, undefined>;
|
|
51
|
+
readonly value_md: v.NullishSchema<v.NumberSchema<undefined>, undefined>;
|
|
52
|
+
readonly hint: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
53
|
+
readonly hint_md: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
54
|
+
readonly template_hint: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
55
|
+
readonly example: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
56
|
+
readonly layout: v.NullishSchema<v.StrictObjectSchema<{
|
|
57
|
+
readonly md: v.StringSchema<undefined>;
|
|
58
|
+
}, undefined>, undefined>;
|
|
59
|
+
} & D, undefined>, v.ObjectSchema<{
|
|
60
|
+
readonly title: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
61
|
+
readonly title_md: v.NullishSchema<v.NumberSchema<undefined>, undefined>;
|
|
62
|
+
readonly value_md: v.NullishSchema<v.NumberSchema<undefined>, undefined>;
|
|
63
|
+
readonly hint: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
64
|
+
readonly hint_md: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
65
|
+
readonly template_hint: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
66
|
+
readonly example: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
67
|
+
readonly layout: v.NullishSchema<v.StrictObjectSchema<{
|
|
68
|
+
readonly md: v.StringSchema<undefined>;
|
|
69
|
+
}, undefined>, undefined>;
|
|
70
|
+
} & D, undefined>, v.ObjectSchema<{
|
|
71
|
+
readonly title: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
72
|
+
readonly title_md: v.NullishSchema<v.NumberSchema<undefined>, undefined>;
|
|
73
|
+
readonly value_md: v.NullishSchema<v.NumberSchema<undefined>, undefined>;
|
|
74
|
+
readonly hint: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
75
|
+
readonly hint_md: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
76
|
+
readonly template_hint: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
77
|
+
readonly example: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
78
|
+
readonly layout: v.NullishSchema<v.StrictObjectSchema<{
|
|
79
|
+
readonly md: v.StringSchema<undefined>;
|
|
80
|
+
}, undefined>, undefined>;
|
|
81
|
+
} & D, undefined>>>]>;
|
|
82
|
+
export {};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { any, check, looseObject, nullish, number, pipe, rawCheck, record, safeParse, strictObject, string } from "valibot";
|
|
2
|
+
import { DisplayLangSchema, DisplayModeSchema } from "../common.js";
|
|
3
|
+
import { resolveDisplay } from "../resolve.js";
|
|
4
|
+
import { isFailureDataset } from "../../utils/index.js";
|
|
5
|
+
const FieldDisplayLangSchema = pipe(record(DisplayLangSchema, any()), check((val)=>{
|
|
6
|
+
if (!val) return false;
|
|
7
|
+
if (0 === Object.keys(val).length) return false;
|
|
8
|
+
return true;
|
|
9
|
+
}, 'At least one display lang must be defined.'));
|
|
10
|
+
const DisplayModeAndLangSchema = pipe(record(DisplayModeSchema, FieldDisplayLangSchema), check((val)=>{
|
|
11
|
+
if (!val) return false;
|
|
12
|
+
if (0 === Object.keys(val).length) return false;
|
|
13
|
+
return true;
|
|
14
|
+
}, 'At least one display mode must be defined.'));
|
|
15
|
+
function createFieldDisplay(DefaultDisplay, PdfDisplay) {
|
|
16
|
+
const baseObjectSchema = isLooseObject(DefaultDisplay) ? looseObject : strictObject;
|
|
17
|
+
const defaultDisplayContent = baseObjectSchema({
|
|
18
|
+
...FieldDisplayModeBaseSchema.entries,
|
|
19
|
+
...DefaultDisplay.entries
|
|
20
|
+
});
|
|
21
|
+
const defaultDisplaySchema = record(string(), record(string(), defaultDisplayContent));
|
|
22
|
+
const DisplaySchema = pipe(record(string(), any()), rawCheck(({ addIssue, dataset })=>{
|
|
23
|
+
if (isFailureDataset(dataset)) return;
|
|
24
|
+
const display = dataset.value;
|
|
25
|
+
DisplayModeSchema.options.forEach((displayMode)=>{
|
|
26
|
+
if (!(displayMode in display && display[displayMode]) || 'pdf' === displayMode) return;
|
|
27
|
+
Object.keys(display[displayMode]).forEach((displayLang)=>{
|
|
28
|
+
const resolvedDisplay = resolveDisplay(displayMode, displayLang, display);
|
|
29
|
+
const displaySchema = defaultDisplaySchema;
|
|
30
|
+
const result = safeParse(displaySchema, {
|
|
31
|
+
[displayMode]: {
|
|
32
|
+
[displayLang]: resolvedDisplay
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
if (result.issues) result.issues.forEach((issue)=>{
|
|
36
|
+
addIssue({
|
|
37
|
+
message: issue.message,
|
|
38
|
+
path: issue.path,
|
|
39
|
+
input: issue.input,
|
|
40
|
+
expected: issue.expected ?? void 0,
|
|
41
|
+
received: issue.received,
|
|
42
|
+
label: 'Display schema'
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
}));
|
|
48
|
+
return DisplaySchema;
|
|
49
|
+
}
|
|
50
|
+
const isLooseObject = (schema)=>'loose_object' === schema.type;
|
|
51
|
+
const FieldDisplayModeBaseSchema = strictObject({
|
|
52
|
+
title: nullish(string()),
|
|
53
|
+
title_md: nullish(number()),
|
|
54
|
+
value_md: nullish(number()),
|
|
55
|
+
hint: nullish(string()),
|
|
56
|
+
hint_md: nullish(string()),
|
|
57
|
+
template_hint: nullish(string()),
|
|
58
|
+
example: nullish(string()),
|
|
59
|
+
layout: nullish(strictObject({
|
|
60
|
+
md: string()
|
|
61
|
+
}))
|
|
62
|
+
});
|
|
63
|
+
export { DisplayModeAndLangSchema, createFieldDisplay };
|