@uides/stepwise 1.1.0-d0adc9fb → 2.0.0-2a26e869
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/.rush/temp/chunked-rush-logs/stepwise.build.chunks.jsonl +1 -1
- package/.rush/temp/package-deps_build.json +67 -67
- package/.rush/temp/shrinkwrap-deps.json +2 -2
- package/package.json +6 -6
- package/rush-logs/stepwise.build.log +1 -1
- package/src/schemas/__tests__/step.spec.ts +2 -4
- package/src/schemas/action.ts +132 -131
- package/src/schemas/application.ts +7 -8
- package/src/schemas/attributes.ts +1 -1
- package/src/schemas/common.ts +15 -82
- package/src/schemas/document.ts +53 -49
- package/src/schemas/edupass-healthstate.ts +47 -44
- package/src/schemas/field/afm/index.ts +11 -12
- package/src/schemas/field/amka/index.ts +10 -9
- package/src/schemas/field/attachment/index.ts +21 -20
- package/src/schemas/field/captcha/index.ts +8 -7
- package/src/schemas/field/choice/index.ts +20 -19
- package/src/schemas/field/common.spec.ts +7 -13
- package/src/schemas/field/common.ts +103 -85
- package/src/schemas/field/date/index.ts +24 -23
- package/src/schemas/field/doc_subtitle/index.ts +10 -9
- package/src/schemas/field/doc_title/index.ts +18 -17
- package/src/schemas/field/dynamically-filled-text/index.ts +26 -24
- package/src/schemas/field/email/index.ts +12 -11
- package/src/schemas/field/fillable-string/index.ts +18 -17
- package/src/schemas/field/five-block-date/index.ts +8 -7
- package/src/schemas/field/green-pass-qrcode/index.ts +14 -15
- package/src/schemas/field/hidden/index.ts +58 -64
- package/src/schemas/field/hierarchical-selector/index.ts +27 -25
- package/src/schemas/field/iban/index.ts +11 -10
- package/src/schemas/field/image/index.ts +19 -18
- package/src/schemas/field/index.spec.ts +17 -19
- package/src/schemas/field/index.ts +176 -85
- package/src/schemas/field/int/index.ts +11 -10
- package/src/schemas/field/lab-results/index.ts +9 -8
- package/src/schemas/field/landline_phone/index.ts +8 -7
- package/src/schemas/field/mobile_phone/index.ts +12 -11
- package/src/schemas/field/multiple-choice/index.ts +15 -14
- package/src/schemas/field/pdf-image/index.ts +14 -13
- package/src/schemas/field/postal_code/index.ts +9 -8
- package/src/schemas/field/qrcode/index.ts +18 -17
- package/src/schemas/field/quote/index.ts +18 -17
- package/src/schemas/field/radio-choice/index.ts +21 -15
- package/src/schemas/field/rate/index.ts +10 -9
- package/src/schemas/field/recipient/index.ts +11 -10
- package/src/schemas/field/redirect/index.ts +12 -11
- package/src/schemas/field/refcode/index.ts +25 -24
- package/src/schemas/field/string/index.ts +42 -41
- package/src/schemas/field/text/index.ts +23 -22
- package/src/schemas/field/three-block-date/index.ts +15 -14
- package/src/schemas/fieldset/component-params.ts +40 -37
- package/src/schemas/fieldset/display-components.ts +42 -49
- package/src/schemas/fieldset/enums.ts +12 -6
- package/src/schemas/fieldset/index.ts +9 -10
- package/src/schemas/layout.ts +43 -32
- package/src/schemas/outputs.ts +7 -6
- package/src/schemas/resource/enums.ts +6 -6
- package/src/schemas/resource/field.ts +10 -8
- package/src/schemas/resource/object-action.ts +21 -16
- package/src/schemas/resource/resource-action.ts +19 -17
- package/src/schemas/resource/resource.ts +19 -20
- package/src/schemas/step.ts +116 -115
- package/src/schemas/template/enums.ts +2 -2
- package/src/schemas/template/template-base.ts +15 -13
- package/src/schemas/template/template-source.ts +12 -13
- package/src/schemas/template/template.ts +12 -13
- package/src/schemas/validation-context/enums.ts +5 -5
- package/src/schemas/validation-context/validation-context.ts +45 -44
- package/src/utils/index.spec.ts +2 -0
- package/src/utils/index.ts +5 -3
|
@@ -1,71 +1,72 @@
|
|
|
1
1
|
import * as v from 'valibot';
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
nullish,
|
|
7
|
-
object,
|
|
3
|
+
ComponentLayoutSchema,
|
|
4
|
+
DisplayLangSchema,
|
|
5
|
+
DisplayModeSchema,
|
|
8
6
|
} from '@uides/stepwise/schemas/common';
|
|
9
7
|
import {
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
UserInputModeSchema,
|
|
9
|
+
ValidationFieldComponentSchema,
|
|
12
10
|
} from '@uides/stepwise/schemas/validation-context/enums';
|
|
13
11
|
|
|
14
|
-
export const
|
|
15
|
-
title: nullish(v.string()),
|
|
16
|
-
label: nullish(v.string()),
|
|
17
|
-
text: nullish(v.string()),
|
|
18
|
-
helptext: nullish(v.string()),
|
|
19
|
-
'action-label': nullish(v.string()),
|
|
20
|
-
'action-cancel-label': nullish(v.string()),
|
|
21
|
-
'error-messages': nullish(v.record(v.string())),
|
|
22
|
-
note: v.record(v.any()),
|
|
12
|
+
export const ValidationComponentParamsSchema = v.strictObject({
|
|
13
|
+
title: v.nullish(v.string()),
|
|
14
|
+
label: v.nullish(v.string()),
|
|
15
|
+
text: v.nullish(v.string()),
|
|
16
|
+
helptext: v.nullish(v.string()),
|
|
17
|
+
'action-label': v.nullish(v.string()),
|
|
18
|
+
'action-cancel-label': v.nullish(v.string()),
|
|
19
|
+
'error-messages': v.nullish(v.record(v.string(), v.string())),
|
|
20
|
+
note: v.record(v.string(), v.any()),
|
|
23
21
|
});
|
|
24
22
|
|
|
25
|
-
const
|
|
26
|
-
component: nullish(
|
|
27
|
-
'component-params': nullish(
|
|
28
|
-
v.union([
|
|
23
|
+
const ValidationFieldDisplaySchema = v.strictObject({
|
|
24
|
+
component: v.nullish(ValidationFieldComponentSchema),
|
|
25
|
+
'component-params': v.nullish(
|
|
26
|
+
v.union([ValidationComponentParamsSchema, v.record(v.string(), v.any())])
|
|
29
27
|
),
|
|
30
|
-
layout: nullish(
|
|
28
|
+
layout: v.nullish(ComponentLayoutSchema),
|
|
31
29
|
});
|
|
32
|
-
export const
|
|
33
|
-
display: v.record(
|
|
34
|
-
|
|
30
|
+
export const ValidationFieldSchema = v.strictObject({
|
|
31
|
+
display: v.record(
|
|
32
|
+
DisplayModeSchema,
|
|
33
|
+
v.record(DisplayLangSchema, ValidationFieldDisplaySchema)
|
|
34
|
+
),
|
|
35
|
+
'user-input-mode': UserInputModeSchema,
|
|
35
36
|
});
|
|
36
37
|
|
|
37
|
-
const
|
|
38
|
-
component: nullish(v.literal('form')),
|
|
39
|
-
layout: nullish(
|
|
38
|
+
const ValidationFieldsetDisplaySchema = v.strictObject({
|
|
39
|
+
component: v.nullish(v.literal('form')),
|
|
40
|
+
layout: v.nullish(ComponentLayoutSchema),
|
|
40
41
|
});
|
|
41
|
-
export const
|
|
42
|
+
export const ValidationFieldsetSchema = v.strictObject({
|
|
42
43
|
display: v.record(
|
|
43
|
-
|
|
44
|
-
v.record(
|
|
44
|
+
DisplayModeSchema,
|
|
45
|
+
v.record(DisplayLangSchema, ValidationFieldsetDisplaySchema)
|
|
45
46
|
),
|
|
46
47
|
'field-order': v.string(),
|
|
47
48
|
});
|
|
48
49
|
|
|
49
|
-
const
|
|
50
|
-
languages: v.record(
|
|
50
|
+
const I18nSchema = v.strictObject({
|
|
51
|
+
languages: v.record(DisplayLangSchema, v.strictObject({ label: v.string() })),
|
|
51
52
|
'language-order': v.string(),
|
|
52
|
-
'default-language':
|
|
53
|
+
'default-language': DisplayLangSchema,
|
|
53
54
|
});
|
|
54
|
-
export const
|
|
55
|
-
serviceName: nullish(v.string()),
|
|
56
|
-
serviceURL: nullish(v.string()),
|
|
57
|
-
backlink: nullish(v.boolean()),
|
|
58
|
-
layout: nullish(
|
|
59
|
-
i18n: nullish(
|
|
55
|
+
export const ValidationContextDisplaySchema = v.strictObject({
|
|
56
|
+
serviceName: v.nullish(v.string()),
|
|
57
|
+
serviceURL: v.nullish(v.string()),
|
|
58
|
+
backlink: v.nullish(v.boolean()),
|
|
59
|
+
layout: v.nullish(ComponentLayoutSchema),
|
|
60
|
+
i18n: v.nullish(I18nSchema),
|
|
60
61
|
});
|
|
61
62
|
|
|
62
|
-
export const
|
|
63
|
+
export const ValidationContextSchema = v.strictObject({
|
|
63
64
|
display: v.record(
|
|
64
|
-
|
|
65
|
-
v.record(
|
|
65
|
+
DisplayModeSchema,
|
|
66
|
+
v.record(DisplayLangSchema, ValidationContextDisplaySchema)
|
|
66
67
|
),
|
|
67
|
-
fields: v.record(
|
|
68
|
-
fieldsets: v.record(
|
|
68
|
+
fields: v.record(v.string(), ValidationFieldSchema),
|
|
69
|
+
fieldsets: v.record(v.string(), ValidationFieldsetSchema),
|
|
69
70
|
'action-order': v.string(),
|
|
70
71
|
'fieldset-order': v.string(),
|
|
71
72
|
});
|
package/src/utils/index.spec.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { collectIssues } from '@uides/stepwise/utils';
|
|
|
3
3
|
|
|
4
4
|
const fieldSchema = v.object({
|
|
5
5
|
fields: v.record(
|
|
6
|
+
v.string(),
|
|
6
7
|
v.object({
|
|
7
8
|
value: v.string(),
|
|
8
9
|
label: v.string(),
|
|
@@ -12,6 +13,7 @@ const fieldSchema = v.object({
|
|
|
12
13
|
|
|
13
14
|
const actionSchema = v.object({
|
|
14
15
|
actions: v.record(
|
|
16
|
+
v.string(),
|
|
15
17
|
v.object({
|
|
16
18
|
value: v.string(),
|
|
17
19
|
label: v.string(),
|
package/src/utils/index.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BaseIssue } from 'valibot';
|
|
2
2
|
|
|
3
3
|
const RECORD_LEVELS = ['fields', 'fieldsets', 'actions'];
|
|
4
4
|
|
|
5
5
|
export function collectIssues(
|
|
6
|
-
issues:
|
|
6
|
+
issues: BaseIssue<unknown>[]
|
|
7
7
|
): Record<string, Record<string, string>> {
|
|
8
8
|
const formattedIssues: Record<string, Record<string, string>> = {};
|
|
9
9
|
issues.forEach((issue) => {
|
|
@@ -46,7 +46,9 @@ export function collectIssues(
|
|
|
46
46
|
return formattedIssues;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
function getNestedIssueMessage(
|
|
49
|
+
function getNestedIssueMessage(
|
|
50
|
+
issue: BaseIssue<unknown>
|
|
51
|
+
): Record<string, string> {
|
|
50
52
|
const path = (issue.path?.map((p) => String(p.key)) ?? []).join('/');
|
|
51
53
|
if (issue.issues && issue.issues.length > 0) {
|
|
52
54
|
const nestedIssues: Record<string, string> = {};
|