@uides/stepwise 1.1.0-d0adc9fb → 2.0.0-07ee8440
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,47 +1,77 @@
|
|
|
1
1
|
import * as v from 'valibot';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import Captcha from '@uides/stepwise/schemas/field/captcha';
|
|
11
|
-
import Choice from '@uides/stepwise/schemas/field/choice';
|
|
2
|
+
import { DisplayLang, DisplayModeSchema } from '@uides/stepwise/schemas/common';
|
|
3
|
+
import Afm, { AfmType } from '@uides/stepwise/schemas/field/afm';
|
|
4
|
+
import Amka, { AmkaType } from '@uides/stepwise/schemas/field/amka';
|
|
5
|
+
import Attachment, {
|
|
6
|
+
AttachmentType,
|
|
7
|
+
} from '@uides/stepwise/schemas/field/attachment';
|
|
8
|
+
import Captcha, { CaptchaType } from '@uides/stepwise/schemas/field/captcha';
|
|
9
|
+
import Choice, { ChoiceType } from '@uides/stepwise/schemas/field/choice';
|
|
12
10
|
import { DisplayModeAndLangSchema } from '@uides/stepwise/schemas/field/common';
|
|
13
|
-
import DateField from '@uides/stepwise/schemas/field/date';
|
|
14
|
-
import DocSubtitle
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
import
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
import
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
import
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
import
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
import
|
|
34
|
-
import
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
import
|
|
38
|
-
import
|
|
39
|
-
import
|
|
40
|
-
import
|
|
41
|
-
|
|
11
|
+
import DateField, { DateType } from '@uides/stepwise/schemas/field/date';
|
|
12
|
+
import DocSubtitle, {
|
|
13
|
+
DocSubtitleType,
|
|
14
|
+
} from '@uides/stepwise/schemas/field/doc_subtitle';
|
|
15
|
+
import DocTitle, {
|
|
16
|
+
DocTitleType,
|
|
17
|
+
} from '@uides/stepwise/schemas/field/doc_title';
|
|
18
|
+
import DynamicallyFilledText, {
|
|
19
|
+
DynamicallyFilledTextType,
|
|
20
|
+
} from '@uides/stepwise/schemas/field/dynamically-filled-text';
|
|
21
|
+
import Email, { EmailType } from '@uides/stepwise/schemas/field/email';
|
|
22
|
+
import FillableString, {
|
|
23
|
+
FillableStringType,
|
|
24
|
+
} from '@uides/stepwise/schemas/field/fillable-string';
|
|
25
|
+
import FiveBlockDate, {
|
|
26
|
+
FiveBlockDateType,
|
|
27
|
+
} from '@uides/stepwise/schemas/field/five-block-date';
|
|
28
|
+
import GreenPassQrcode, {
|
|
29
|
+
GreenPassQrcodeType,
|
|
30
|
+
} from '@uides/stepwise/schemas/field/green-pass-qrcode';
|
|
31
|
+
import Hidden, { HiddenType } from '@uides/stepwise/schemas/field/hidden';
|
|
32
|
+
import HierarchicalSelector, {
|
|
33
|
+
HierarchicalSelectorType,
|
|
34
|
+
} from '@uides/stepwise/schemas/field/hierarchical-selector';
|
|
35
|
+
import Iban, { IbanType } from '@uides/stepwise/schemas/field/iban';
|
|
36
|
+
import Image, { ImageType } from '@uides/stepwise/schemas/field/image';
|
|
37
|
+
import Int, { IntType } from '@uides/stepwise/schemas/field/int';
|
|
38
|
+
import LabResults, {
|
|
39
|
+
LabResultsType,
|
|
40
|
+
} from '@uides/stepwise/schemas/field/lab-results';
|
|
41
|
+
import LandlinePhone, {
|
|
42
|
+
LandlinePhoneType,
|
|
43
|
+
} from '@uides/stepwise/schemas/field/landline_phone';
|
|
44
|
+
import MobilePhone, {
|
|
45
|
+
MobilePhoneType,
|
|
46
|
+
} from '@uides/stepwise/schemas/field/mobile_phone';
|
|
47
|
+
import MultipleChoice, {
|
|
48
|
+
MultipleChoiceType,
|
|
49
|
+
} from '@uides/stepwise/schemas/field/multiple-choice';
|
|
50
|
+
import PdfImage, {
|
|
51
|
+
PdfImageType,
|
|
52
|
+
} from '@uides/stepwise/schemas/field/pdf-image';
|
|
53
|
+
import PostalCode, {
|
|
54
|
+
PostalCodeType,
|
|
55
|
+
} from '@uides/stepwise/schemas/field/postal_code';
|
|
56
|
+
import Qrcode, { QrcodeType } from '@uides/stepwise/schemas/field/qrcode';
|
|
57
|
+
import Quote, { QuoteType } from '@uides/stepwise/schemas/field/quote';
|
|
58
|
+
import RadioChoice, {
|
|
59
|
+
RadioChoiceType,
|
|
60
|
+
} from '@uides/stepwise/schemas/field/radio-choice';
|
|
61
|
+
import Rate, { RateType } from '@uides/stepwise/schemas/field/rate';
|
|
62
|
+
import Recipient, {
|
|
63
|
+
RecipientType,
|
|
64
|
+
} from '@uides/stepwise/schemas/field/recipient';
|
|
65
|
+
import Redirect, { RedirectType } from '@uides/stepwise/schemas/field/redirect';
|
|
66
|
+
import Refcode, { RefcodeType } from '@uides/stepwise/schemas/field/refcode';
|
|
67
|
+
import StringField, { StringType } from '@uides/stepwise/schemas/field/string';
|
|
68
|
+
import Text, { TextType } from '@uides/stepwise/schemas/field/text';
|
|
69
|
+
import ThreeBlockDate, {
|
|
70
|
+
ThreeBlockDateType,
|
|
71
|
+
} from '@uides/stepwise/schemas/field/three-block-date';
|
|
42
72
|
import { resolveDisplay } from '@uides/stepwise/schemas/resolve';
|
|
43
73
|
|
|
44
|
-
const
|
|
74
|
+
const allFieldSchemas = {
|
|
45
75
|
afm: Afm,
|
|
46
76
|
amka: Amka,
|
|
47
77
|
attachment: Attachment,
|
|
@@ -77,25 +107,45 @@ const fieldOptions = {
|
|
|
77
107
|
text: Text,
|
|
78
108
|
'three-block-date': ThreeBlockDate,
|
|
79
109
|
};
|
|
80
|
-
type FieldOptions = (typeof fieldOptions)[keyof typeof fieldOptions];
|
|
81
110
|
|
|
82
|
-
const
|
|
83
|
-
(
|
|
84
|
-
|
|
111
|
+
const FieldSchema = v.pipe(
|
|
112
|
+
v.record(v.string(), v.any()), // TODO: Unnecessary?
|
|
113
|
+
v.rawCheck<Field>(({ dataset, addIssue }) => {
|
|
114
|
+
const { display, ...fieldAttrs } = dataset.value as Record<string, any>;
|
|
85
115
|
if (!display) {
|
|
86
|
-
const result =
|
|
87
|
-
|
|
116
|
+
const result = v.safeParse(allFieldSchemas['string'], fieldAttrs);
|
|
117
|
+
// TODO: DRY
|
|
118
|
+
if (result.issues) {
|
|
119
|
+
// TODO: Add subissues
|
|
120
|
+
result.issues.forEach((issue) => {
|
|
121
|
+
addIssue({
|
|
122
|
+
message: issue.message,
|
|
123
|
+
path: issue.path,
|
|
124
|
+
input: issue.input,
|
|
125
|
+
expected: issue.expected ?? undefined,
|
|
126
|
+
received: issue.received,
|
|
127
|
+
label: 'Display schema',
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
return;
|
|
88
132
|
}
|
|
89
|
-
let issues: v.SchemaIssues | undefined;
|
|
90
133
|
const result = v.safeParse(DisplayModeAndLangSchema, display);
|
|
91
134
|
if (result.issues) {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
135
|
+
// TODO: Add subissues
|
|
136
|
+
result.issues.forEach((issue) => {
|
|
137
|
+
addIssue({
|
|
138
|
+
message: issue.message,
|
|
139
|
+
path: issue.path,
|
|
140
|
+
input: issue.input,
|
|
141
|
+
expected: issue.expected ?? undefined,
|
|
142
|
+
received: issue.received,
|
|
143
|
+
label: 'Display schema',
|
|
144
|
+
});
|
|
145
|
+
});
|
|
96
146
|
}
|
|
97
|
-
|
|
98
|
-
if (!display[displayMode]) return;
|
|
147
|
+
DisplayModeSchema.options.forEach((displayMode) => {
|
|
148
|
+
if (!(display && display[displayMode])) return;
|
|
99
149
|
Object.keys(display[displayMode] as NonNullable<unknown>).forEach(
|
|
100
150
|
(displayLang) => {
|
|
101
151
|
const resolvedDisplay = resolveDisplay(
|
|
@@ -118,41 +168,82 @@ const Field = specialWithNestedSchema<v.Output<FieldOptions>>(
|
|
|
118
168
|
};
|
|
119
169
|
|
|
120
170
|
const component = resolvedDisplay?.['component'] ?? 'string';
|
|
121
|
-
const result =
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
171
|
+
const result = v.safeParse(
|
|
172
|
+
allFieldSchemas[component as keyof typeof allFieldSchemas],
|
|
173
|
+
fieldToValidate
|
|
174
|
+
);
|
|
125
175
|
if (result.issues) {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
176
|
+
// TODO: Add subissues
|
|
177
|
+
result.issues.forEach((issue) => {
|
|
178
|
+
addIssue({
|
|
179
|
+
message: issue.message,
|
|
180
|
+
path: issue.path,
|
|
181
|
+
input: issue.input,
|
|
182
|
+
expected: issue.expected ?? undefined,
|
|
183
|
+
received: issue.received,
|
|
184
|
+
label: 'Display schema',
|
|
185
|
+
});
|
|
186
|
+
});
|
|
130
187
|
}
|
|
131
188
|
}
|
|
132
189
|
);
|
|
133
190
|
});
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
191
|
+
}),
|
|
192
|
+
v.check((values) => {
|
|
193
|
+
if (!('value' in values)) return true;
|
|
194
|
+
const value = values['value'];
|
|
195
|
+
const userInputMode = values['user-input-mode'];
|
|
196
|
+
if (
|
|
197
|
+
value &&
|
|
198
|
+
!(userInputMode === 'noinput' || userInputMode === 'display')
|
|
199
|
+
) {
|
|
200
|
+
return false;
|
|
201
|
+
}
|
|
202
|
+
return true;
|
|
203
|
+
}, 'Field with value cannot be editable')
|
|
204
|
+
);
|
|
205
|
+
|
|
206
|
+
export default FieldSchema;
|
|
207
|
+
|
|
208
|
+
export type Field =
|
|
209
|
+
| AfmType
|
|
210
|
+
| AmkaType
|
|
211
|
+
| AttachmentType
|
|
212
|
+
| CaptchaType
|
|
213
|
+
| ChoiceType
|
|
214
|
+
| DateType
|
|
215
|
+
| DocSubtitleType
|
|
216
|
+
| DocTitleType
|
|
217
|
+
| DynamicallyFilledTextType
|
|
218
|
+
| EmailType
|
|
219
|
+
| FillableStringType
|
|
220
|
+
| FiveBlockDateType
|
|
221
|
+
| GreenPassQrcodeType
|
|
222
|
+
| HiddenType
|
|
223
|
+
| HierarchicalSelectorType
|
|
224
|
+
| IbanType
|
|
225
|
+
| ImageType
|
|
226
|
+
| IntType
|
|
227
|
+
| LabResultsType
|
|
228
|
+
| LandlinePhoneType
|
|
229
|
+
| MobilePhoneType
|
|
230
|
+
| MultipleChoiceType
|
|
231
|
+
| PdfImageType
|
|
232
|
+
| PostalCodeType
|
|
233
|
+
| QrcodeType
|
|
234
|
+
| QuoteType
|
|
235
|
+
| RadioChoiceType
|
|
236
|
+
| RateType
|
|
237
|
+
| RecipientType
|
|
238
|
+
| RedirectType
|
|
239
|
+
| RefcodeType
|
|
240
|
+
| StringType
|
|
241
|
+
| TextType
|
|
242
|
+
| ThreeBlockDateType;
|
|
243
|
+
|
|
244
|
+
export type Fields = Record<string, Field>;
|
|
153
245
|
|
|
154
|
-
export
|
|
155
|
-
string,
|
|
156
|
-
|
|
157
|
-
>;
|
|
158
|
-
export const FieldsSchema = v.record(Field) as v.BaseSchema<Fields, Fields>;
|
|
246
|
+
export const FieldsSchema = v.record(
|
|
247
|
+
v.string(),
|
|
248
|
+
FieldSchema
|
|
249
|
+
) as v.GenericSchema<Fields>;
|
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
import * as v from 'valibot';
|
|
2
|
-
import { nullish, object } from '@uides/stepwise/schemas/common';
|
|
3
2
|
import { createFieldDisplay } from '@uides/stepwise/schemas/field/common';
|
|
4
3
|
|
|
5
|
-
const
|
|
6
|
-
|
|
4
|
+
const IntDisplaySchema = createFieldDisplay(
|
|
5
|
+
v.strictObject({
|
|
7
6
|
component: v.literal('int'),
|
|
8
|
-
'component-params': nullish(
|
|
9
|
-
|
|
7
|
+
'component-params': v.nullish(
|
|
8
|
+
v.strictObject({
|
|
10
9
|
enforceUppercase: v.boolean(),
|
|
11
10
|
})
|
|
12
11
|
),
|
|
13
12
|
})
|
|
14
13
|
);
|
|
15
14
|
|
|
16
|
-
const
|
|
15
|
+
const IntSchema = v.strictObject({
|
|
17
16
|
'user-input-mode': v.picklist(['noinput', 'optional', 'required']),
|
|
18
|
-
display:
|
|
19
|
-
'default-value': nullish(v.string()),
|
|
17
|
+
display: IntDisplaySchema,
|
|
18
|
+
'default-value': v.nullish(v.string()),
|
|
20
19
|
});
|
|
21
|
-
export type IntType = v.BaseSchema<v.Output<typeof Int>>;
|
|
22
20
|
|
|
23
|
-
export
|
|
21
|
+
export type IntType = v.InferOutput<typeof IntSchema>;
|
|
22
|
+
export type IntSchemaType = v.GenericSchema<IntType>;
|
|
23
|
+
|
|
24
|
+
export default IntSchema as IntSchemaType;
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import * as v from 'valibot';
|
|
2
|
-
import { nullish, object } from '@uides/stepwise/schemas/common';
|
|
3
2
|
import { createFieldDisplay } from '@uides/stepwise/schemas/field/common';
|
|
4
3
|
|
|
5
|
-
const
|
|
6
|
-
|
|
4
|
+
const LabResultsDisplaySchema = createFieldDisplay(
|
|
5
|
+
v.strictObject({
|
|
7
6
|
component: v.literal('lab-results'),
|
|
8
7
|
})
|
|
9
8
|
);
|
|
10
9
|
|
|
11
|
-
const
|
|
10
|
+
const LabResultsSchema = v.strictObject({
|
|
12
11
|
'user-input-mode': v.literal('noinput'),
|
|
13
|
-
display:
|
|
14
|
-
'default-value': nullish(v.string()),
|
|
12
|
+
display: LabResultsDisplaySchema,
|
|
13
|
+
'default-value': v.nullish(v.string()),
|
|
15
14
|
attribute: v.string(),
|
|
16
15
|
});
|
|
17
|
-
export type LabResultsType = v.BaseSchema<v.Output<typeof LabResults>>;
|
|
18
16
|
|
|
19
|
-
export
|
|
17
|
+
export type LabResultsType = v.InferOutput<typeof LabResultsSchema>;
|
|
18
|
+
export type LabResultsSchemaType = v.GenericSchema<LabResultsType>;
|
|
19
|
+
|
|
20
|
+
export default LabResultsSchema as LabResultsSchemaType;
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import * as v from 'valibot';
|
|
2
|
-
import { object } from '@uides/stepwise/schemas/common';
|
|
3
2
|
import { createFieldDisplay } from '@uides/stepwise/schemas/field/common';
|
|
4
3
|
|
|
5
|
-
const
|
|
6
|
-
|
|
4
|
+
const LandlinePhoneDisplaySchema = createFieldDisplay(
|
|
5
|
+
v.strictObject({
|
|
7
6
|
component: v.literal('landline_phone'),
|
|
8
7
|
})
|
|
9
8
|
);
|
|
10
9
|
|
|
11
|
-
const
|
|
10
|
+
const LandlinePhoneSchema = v.strictObject({
|
|
12
11
|
'user-input-mode': v.picklist(['noinput', 'optional']),
|
|
13
|
-
display:
|
|
12
|
+
display: LandlinePhoneDisplaySchema,
|
|
14
13
|
});
|
|
15
|
-
export type LandlinePhoneType = v.BaseSchema<v.Output<typeof LandlinePhone>>;
|
|
16
14
|
|
|
17
|
-
export
|
|
15
|
+
export type LandlinePhoneType = v.InferOutput<typeof LandlinePhoneSchema>;
|
|
16
|
+
export type LandlinePhoneSchemaType = v.GenericSchema<LandlinePhoneType>;
|
|
17
|
+
|
|
18
|
+
export default LandlinePhoneSchema as LandlinePhoneSchemaType;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import * as v from 'valibot';
|
|
2
|
-
import { nullish, object } from '@uides/stepwise/schemas/common';
|
|
3
2
|
import { createFieldDisplay } from '@uides/stepwise/schemas/field/common';
|
|
4
3
|
|
|
5
|
-
const
|
|
6
|
-
|
|
4
|
+
const MobilePhoneDisplaySchema = createFieldDisplay(
|
|
5
|
+
v.strictObject({
|
|
7
6
|
component: v.literal('mobile_phone'),
|
|
8
7
|
})
|
|
9
8
|
);
|
|
10
9
|
|
|
11
|
-
const
|
|
10
|
+
const MobilePhoneAttributeSchema = v.nullish(
|
|
12
11
|
v.picklist([
|
|
13
12
|
'civil_registry:mobile',
|
|
14
13
|
'find_onomatodosia:mobile_phone',
|
|
@@ -19,13 +18,15 @@ const MobilePhoneAttribute = nullish(
|
|
|
19
18
|
])
|
|
20
19
|
);
|
|
21
20
|
|
|
22
|
-
const
|
|
21
|
+
const MobilePhoneSchema = v.strictObject({
|
|
23
22
|
'user-input-mode': v.picklist(['noinput', 'optional', 'required']),
|
|
24
|
-
attribute:
|
|
25
|
-
display:
|
|
26
|
-
'default-value': nullish(v.string()),
|
|
27
|
-
datatype: nullish(v.literal('mobile_phone')),
|
|
23
|
+
attribute: MobilePhoneAttributeSchema,
|
|
24
|
+
display: MobilePhoneDisplaySchema,
|
|
25
|
+
'default-value': v.nullish(v.string()),
|
|
26
|
+
datatype: v.nullish(v.literal('mobile_phone')),
|
|
28
27
|
});
|
|
29
|
-
export type MobilePhoneType = v.BaseSchema<v.Output<typeof MobilePhone>>;
|
|
30
28
|
|
|
31
|
-
export
|
|
29
|
+
export type MobilePhoneType = v.InferOutput<typeof MobilePhoneSchema>;
|
|
30
|
+
export type MobilePhoneSchemaType = v.GenericSchema<MobilePhoneType>;
|
|
31
|
+
|
|
32
|
+
export default MobilePhoneSchema as MobilePhoneSchemaType;
|
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
import * as v from 'valibot';
|
|
2
|
-
import { nullish, object } from '@uides/stepwise/schemas/common';
|
|
3
2
|
import { createFieldDisplay } from '@uides/stepwise/schemas/field/common';
|
|
4
3
|
|
|
5
|
-
const
|
|
6
|
-
|
|
4
|
+
const MultipleChoiceDisplaySchema = createFieldDisplay(
|
|
5
|
+
v.strictObject({
|
|
7
6
|
component: v.literal('multiple-choice'),
|
|
8
|
-
choices: v.record(v.string()),
|
|
7
|
+
choices: v.record(v.string(), v.string()),
|
|
9
8
|
'choices-order': v.string(),
|
|
10
|
-
'component-params': nullish(
|
|
11
|
-
|
|
12
|
-
'legacy-mode': nullish(v.boolean()),
|
|
13
|
-
showcase: nullish(v.picklist(['comma_separated', 'one_per_line'])),
|
|
9
|
+
'component-params': v.nullish(
|
|
10
|
+
v.strictObject({
|
|
11
|
+
'legacy-mode': v.nullish(v.boolean()),
|
|
12
|
+
showcase: v.nullish(v.picklist(['comma_separated', 'one_per_line'])),
|
|
14
13
|
})
|
|
15
14
|
),
|
|
16
15
|
})
|
|
17
16
|
);
|
|
18
17
|
|
|
19
|
-
const
|
|
18
|
+
const MultipleChoiceSchema = v.strictObject({
|
|
20
19
|
'user-input-mode': v.picklist(['noinput', 'optional', 'required']),
|
|
21
|
-
display:
|
|
22
|
-
'default-value': nullish(v.string()),
|
|
20
|
+
display: MultipleChoiceDisplaySchema,
|
|
21
|
+
'default-value': v.nullish(v.string()),
|
|
23
22
|
attribute: v.optional(v.null_()),
|
|
24
|
-
datatype: nullish(v.picklist(['multiple-choice', 'string'])),
|
|
23
|
+
datatype: v.nullish(v.picklist(['multiple-choice', 'string'])),
|
|
25
24
|
});
|
|
26
|
-
export type MultipleChoiceType = v.BaseSchema<v.Output<typeof MultipleChoice>>;
|
|
27
25
|
|
|
28
|
-
export
|
|
26
|
+
export type MultipleChoiceType = v.InferOutput<typeof MultipleChoiceSchema>;
|
|
27
|
+
export type MultipleChoiceSchemaType = v.GenericSchema<MultipleChoiceType>;
|
|
28
|
+
|
|
29
|
+
export default MultipleChoiceSchema as MultipleChoiceSchemaType;
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
import * as v from 'valibot';
|
|
2
|
-
import { nullish, object } from '@uides/stepwise/schemas/common';
|
|
3
2
|
import { createFieldDisplay } from '@uides/stepwise/schemas/field/common';
|
|
4
3
|
|
|
5
|
-
const
|
|
6
|
-
|
|
4
|
+
const PdfImageDisplaySchema = createFieldDisplay(
|
|
5
|
+
v.strictObject({
|
|
7
6
|
component: v.literal('pdf-image'),
|
|
8
|
-
'component-params': nullish(
|
|
9
|
-
|
|
7
|
+
'component-params': v.nullish(
|
|
8
|
+
v.strictObject({
|
|
10
9
|
coordinates: v.array(v.nullable(v.number())),
|
|
11
|
-
position: nullish(v.picklist(['left', 'right', 'center', 'justify'])),
|
|
10
|
+
position: v.nullish(v.picklist(['left', 'right', 'center', 'justify'])),
|
|
12
11
|
})
|
|
13
12
|
),
|
|
14
13
|
})
|
|
15
14
|
);
|
|
16
15
|
|
|
17
|
-
const
|
|
16
|
+
const PdfImageValueSchema = v.picklist([
|
|
18
17
|
'amea_footer_1_pdf',
|
|
19
18
|
'amea_opeka_logo_pdf',
|
|
20
19
|
'daktylios_backgroud_pdf',
|
|
@@ -28,12 +27,14 @@ const PdfImageValue = v.picklist([
|
|
|
28
27
|
'AADE_logo_small_pdf',
|
|
29
28
|
]);
|
|
30
29
|
|
|
31
|
-
const
|
|
32
|
-
display:
|
|
33
|
-
value:
|
|
30
|
+
const PdfImageSchema = v.strictObject({
|
|
31
|
+
display: PdfImageDisplaySchema,
|
|
32
|
+
value: PdfImageValueSchema,
|
|
34
33
|
'user-input-mode': v.picklist(['noinput', 'display']),
|
|
35
|
-
datatype: nullish(v.literal('string')),
|
|
34
|
+
datatype: v.nullish(v.literal('string')),
|
|
36
35
|
});
|
|
37
|
-
export type PdfImageType = v.BaseSchema<v.Output<typeof PdfImage>>;
|
|
38
36
|
|
|
39
|
-
export
|
|
37
|
+
export type PdfImageType = v.InferOutput<typeof PdfImageSchema>;
|
|
38
|
+
export type PdfImageSchemaType = v.GenericSchema<PdfImageType>;
|
|
39
|
+
|
|
40
|
+
export default PdfImageSchema as PdfImageSchemaType;
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import * as v from 'valibot';
|
|
2
|
-
import { nullish, object } from '@uides/stepwise/schemas/common';
|
|
3
2
|
import { createFieldDisplay } from '@uides/stepwise/schemas/field/common';
|
|
4
3
|
|
|
5
|
-
const
|
|
6
|
-
|
|
4
|
+
const PostalCodeDisplaySchema = createFieldDisplay(
|
|
5
|
+
v.strictObject({
|
|
7
6
|
component: v.literal('postal_code'),
|
|
8
7
|
})
|
|
9
8
|
);
|
|
10
9
|
|
|
11
|
-
const
|
|
10
|
+
const PostalCodeSchema = v.strictObject({
|
|
12
11
|
'user-input-mode': v.picklist(['noinput', 'optional', 'required']),
|
|
13
|
-
display:
|
|
14
|
-
datatype: nullish(v.literal('postal_code')),
|
|
12
|
+
display: PostalCodeDisplaySchema,
|
|
13
|
+
datatype: v.nullish(v.literal('postal_code')),
|
|
15
14
|
attribute: v.optional(v.null_()),
|
|
16
15
|
});
|
|
17
|
-
export type PostalCodeType = v.BaseSchema<v.Output<typeof PostalCode>>;
|
|
18
16
|
|
|
19
|
-
export
|
|
17
|
+
export type PostalCodeType = v.InferOutput<typeof PostalCodeSchema>;
|
|
18
|
+
export type PostalCodeSchemaType = v.GenericSchema<PostalCodeType>;
|
|
19
|
+
|
|
20
|
+
export default PostalCodeSchema as PostalCodeSchemaType;
|
|
@@ -1,29 +1,30 @@
|
|
|
1
1
|
import * as v from 'valibot';
|
|
2
|
-
import { nullish, object } from '@uides/stepwise/schemas/common';
|
|
3
2
|
import { createFieldDisplay } from '@uides/stepwise/schemas/field/common';
|
|
4
3
|
|
|
5
|
-
const
|
|
6
|
-
|
|
4
|
+
const QrcodeDisplaySchema = createFieldDisplay(
|
|
5
|
+
v.strictObject({
|
|
7
6
|
component: v.literal('qrcode'),
|
|
8
|
-
'component-params': nullish(
|
|
9
|
-
|
|
10
|
-
coordinates: nullish(v.array(v.nullable(v.number()))),
|
|
11
|
-
position: nullish(v.picklist(['left', 'right', 'center', 'justify'])),
|
|
12
|
-
size: nullish(v.number()),
|
|
7
|
+
'component-params': v.nullish(
|
|
8
|
+
v.strictObject({
|
|
9
|
+
coordinates: v.nullish(v.array(v.nullable(v.number()))),
|
|
10
|
+
position: v.nullish(v.picklist(['left', 'right', 'center', 'justify'])),
|
|
11
|
+
size: v.nullish(v.number()),
|
|
13
12
|
})
|
|
14
13
|
),
|
|
15
14
|
})
|
|
16
15
|
);
|
|
17
16
|
|
|
18
|
-
const
|
|
17
|
+
const QrcodeSchema = v.strictObject({
|
|
19
18
|
'user-input-mode': v.picklist(['noinput', 'display']),
|
|
20
|
-
display:
|
|
21
|
-
attribute: nullish(v.string()),
|
|
22
|
-
sources: nullish(v.string()),
|
|
23
|
-
value: nullish(v.string()),
|
|
24
|
-
'value-constructor': nullish(v.string()),
|
|
25
|
-
'is-display-field': nullish(v.boolean()),
|
|
19
|
+
display: QrcodeDisplaySchema,
|
|
20
|
+
attribute: v.nullish(v.string()),
|
|
21
|
+
sources: v.nullish(v.string()),
|
|
22
|
+
value: v.nullish(v.string()),
|
|
23
|
+
'value-constructor': v.nullish(v.string()),
|
|
24
|
+
'is-display-field': v.nullish(v.boolean()),
|
|
26
25
|
});
|
|
27
|
-
export type QrcodeType = v.BaseSchema<v.Output<typeof Qrcode>>;
|
|
28
26
|
|
|
29
|
-
export
|
|
27
|
+
export type QrcodeType = v.InferOutput<typeof QrcodeSchema>;
|
|
28
|
+
export type QrcodeSchemaType = v.GenericSchema<QrcodeType>;
|
|
29
|
+
|
|
30
|
+
export default QrcodeSchema as QrcodeSchemaType;
|