@famalabs/web-form 1.0.0-beta.2 → 1.0.0-beta.21
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/dist/core/Form.js +1 -1
- package/dist/core/compiler/FormCompiler.js +1 -1
- package/dist/core/compiler/common/CompilerProgress.js +1 -1
- package/dist/core/compiler/common/NavigationButtonsCompiler.js +1 -1
- package/dist/core/compiler/common/QuestionCompiler.js +1 -1
- package/dist/core/compiler/common/SidebarCompiler.js +1 -1
- package/dist/core/compiler/containers/PageCompiler.js +1 -1
- package/dist/core/compiler/containers/SectionCompiler.js +1 -1
- package/dist/core/compiler/question_forms/ItemConditionalCompiler.js +1 -1
- package/dist/core/compiler/question_forms/ItemFunctionCompiler.js +1 -1
- package/dist/core/compiler/question_forms/QuestionCheckCompiler.js +1 -1
- package/dist/core/compiler/question_forms/QuestionDateCompiler.js +1 -1
- package/dist/core/compiler/question_forms/QuestionListCompiler.js +1 -1
- package/dist/core/compiler/question_forms/QuestionMultipleSelectCompiler.js +1 -1
- package/dist/core/compiler/question_forms/QuestionNumberCompiler.js +1 -1
- package/dist/core/compiler/question_forms/QuestionSelectCompiler.js +1 -1
- package/dist/core/compiler/question_forms/QuestionTableCompiler.js +1 -1
- package/dist/core/compiler/question_forms/QuestionTextCompiler.js +1 -1
- package/dist/core/compiler/question_forms/UploadFormCompiler.js +1 -1
- package/dist/core/components/animations/MotionTabUtils.js +1 -0
- package/dist/core/components/animations/MotionWrappers.js +1 -0
- package/dist/core/components/common/DrawerCommon.js +1 -1
- package/dist/core/components/common/ImageInput.js +1 -1
- package/dist/core/components/common/ModalCommon.js +1 -1
- package/dist/core/components/common/ResponsiveDrawer.js +1 -1
- package/dist/core/components/common/Skeletons.js +1 -1
- package/dist/core/components/forms/QuestionAlertCommon.js +1 -1
- package/dist/core/components/forms/QuestionCheckCommon.js +1 -1
- package/dist/core/components/forms/QuestionCommon.js +1 -1
- package/dist/core/components/forms/QuestionDateCommon.js +1 -1
- package/dist/core/components/forms/QuestionListCommon.js +1 -1
- package/dist/core/components/forms/QuestionMultipleSelectCommon.js +1 -1
- package/dist/core/components/forms/QuestionNumberCommon.js +1 -1
- package/dist/core/components/forms/QuestionSelectCommon.js +1 -1
- package/dist/core/components/forms/QuestionSignatureCommon.js +1 -0
- package/dist/core/components/forms/QuestionTableCommon.js +1 -1
- package/dist/core/components/forms/QuestionTextCommon.js +1 -1
- package/dist/core/components/forms/QuestionUploadCommon.js +1 -1
- package/dist/core/components/parsers/MathParserRenderer.js +1 -1
- package/dist/core/editor/FormEditor.js +1 -1
- package/dist/core/editor/common/CommonEditor.js +1 -1
- package/dist/core/editor/common/EditorHistoryDrawer.js +1 -1
- package/dist/core/editor/common/HierarchyEditor.js +1 -1
- package/dist/core/editor/common/OptionsEditor.js +1 -1
- package/dist/core/editor/common/ScoreSelectModal.js +1 -1
- package/dist/core/editor/common/SnapshotDrawer.js +1 -1
- package/dist/core/editor/common/SurveyCreateNew.js +1 -1
- package/dist/core/editor/common/sidebar/SidebarEditor.js +1 -1
- package/dist/core/editor/common/sidebar/SidebarPageStructure.js +1 -1
- package/dist/core/editor/common/sidebar/SidebarQuestionStructure.js +1 -1
- package/dist/core/editor/common/sidebar/SidebarSettingsView.js +1 -1
- package/dist/core/editor/containers/FolderEditor.js +1 -1
- package/dist/core/editor/containers/LandingPageEditor.js +1 -1
- package/dist/core/editor/containers/PageEditor.js +1 -1
- package/dist/core/editor/containers/RenderPageEditModal.js +1 -1
- package/dist/core/editor/containers/RenderPageHeader.js +1 -1
- package/dist/core/editor/containers/RenderSectionEditModal.js +1 -1
- package/dist/core/editor/containers/SectionEditor.js +1 -1
- package/dist/core/editor/containers/SectionPreview.js +1 -1
- package/dist/core/editor/question_editor/QuestionCommonEditor.js +1 -1
- package/dist/core/editor/question_editor/QuestionMainComponent.js +1 -1
- package/dist/core/editor/question_editor/QuestionPreviewRender.js +1 -1
- package/dist/core/editor/question_editor/QuestionTypeEdit.js +1 -1
- package/dist/core/editor/question_editor/QuestionTypePreview.js +1 -1
- package/dist/core/editor/question_forms/ItemConditionalEditor.js +1 -1
- package/dist/core/editor/question_forms/ItemFunctionEditor.js +1 -1
- package/dist/core/editor/question_forms/QuestionCheckEditor.js +1 -1
- package/dist/core/editor/question_forms/QuestionDateEditor.js +1 -1
- package/dist/core/editor/question_forms/QuestionListEditor.js +1 -1
- package/dist/core/editor/question_forms/QuestionMultipleSelectEditor.js +1 -1
- package/dist/core/editor/question_forms/QuestionNumberEditor.js +1 -1
- package/dist/core/editor/question_forms/QuestionSelectEditor.js +1 -1
- package/dist/core/editor/question_forms/QuestionSignatureEditor.js +1 -0
- package/dist/core/editor/question_forms/QuestionTableEditor.js +1 -1
- package/dist/core/editor/question_forms/QuestionTextEditor.js +1 -1
- package/dist/core/editor/question_forms/QuestionTimeEditor.js +1 -0
- package/dist/core/editor/question_forms/UploadFormEditor.js +1 -1
- package/dist/core/hooks/common/FormLoaderHookV2.js +1 -1
- package/dist/core/hooks/common/NavigationHook.js +1 -1
- package/dist/core/hooks/compiler/InitCompiler.js +1 -1
- package/dist/core/hooks/editor/EditorHistory.js +1 -1
- package/dist/core/hooks/editor/EditorLocalMutations.js +1 -1
- package/dist/core/hooks/editor/EditorOperations.js +1 -1
- package/dist/core/hooks/editor/QuestionOperations.js +1 -1
- package/dist/core/presenter/FormPresenter.js +1 -1
- package/dist/core/presenter/common/QuestionPresenter.js +1 -1
- package/dist/core/presenter/containers/FolderPresenter.js +1 -1
- package/dist/core/presenter/containers/PagePresenter.js +1 -1
- package/dist/core/presenter/containers/SectionPresenter.js +1 -1
- package/dist/core/types/FormEditorTypes.d.ts +3 -2
- package/dist/core/types/FormEditorTypes.js +1 -1
- package/dist/core/types/FormGlobalTypes.d.ts +6 -4
- package/dist/core/types/FormGlobalTypes.js +1 -1
- package/dist/core/types/ResultTypes.js +1 -1
- package/dist/core/utils/config-map.d.ts +14 -14
- package/dist/core/utils/config-map.js +1 -1
- package/dist/core/utils/format-utils.js +1 -1
- package/dist/core/utils/locale.d.ts +530 -7
- package/dist/core/utils/locale.js +1 -1
- package/dist/core/utils/parsers/ConditionParser.js +1 -1
- package/dist/core/utils/parsers/LegacyConditionParser.js +1 -1
- package/dist/core/utils/time-utils.js +1 -0
- package/dist/core/validators/compiler/CompilerValidators.js +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/package.json +24 -18
|
@@ -1,10 +1,533 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
declare const LocaleMap: {
|
|
2
|
+
items: {
|
|
3
|
+
text: {
|
|
4
|
+
text: {
|
|
5
|
+
id: {
|
|
6
|
+
it: string;
|
|
7
|
+
en: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
textArea: {
|
|
11
|
+
id: {
|
|
12
|
+
it: string;
|
|
13
|
+
en: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
time: {
|
|
17
|
+
id: {
|
|
18
|
+
it: string;
|
|
19
|
+
en: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
signature: {
|
|
23
|
+
id: {
|
|
24
|
+
it: string;
|
|
25
|
+
en: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
min: {
|
|
29
|
+
it: string;
|
|
30
|
+
en: string;
|
|
31
|
+
};
|
|
32
|
+
max: {
|
|
33
|
+
it: string;
|
|
34
|
+
en: string;
|
|
35
|
+
};
|
|
36
|
+
maxTime: {
|
|
37
|
+
it: string;
|
|
38
|
+
en: string;
|
|
39
|
+
};
|
|
40
|
+
minTime: {
|
|
41
|
+
it: string;
|
|
42
|
+
en: string;
|
|
43
|
+
};
|
|
44
|
+
formatTime: {
|
|
45
|
+
it: string;
|
|
46
|
+
en: string;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
number: {
|
|
50
|
+
number: {
|
|
51
|
+
id: {
|
|
52
|
+
it: string;
|
|
53
|
+
en: string;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
range: {
|
|
57
|
+
id: {
|
|
58
|
+
it: string;
|
|
59
|
+
en: string;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
rating: {
|
|
63
|
+
id: {
|
|
64
|
+
it: string;
|
|
65
|
+
en: string;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
maxValue: {
|
|
69
|
+
it: string;
|
|
70
|
+
en: string;
|
|
71
|
+
};
|
|
72
|
+
minValue: {
|
|
73
|
+
it: string;
|
|
74
|
+
en: string;
|
|
75
|
+
};
|
|
76
|
+
step: {
|
|
77
|
+
it: string;
|
|
78
|
+
en: string;
|
|
79
|
+
};
|
|
80
|
+
unit: {
|
|
81
|
+
it: string;
|
|
82
|
+
en: string;
|
|
83
|
+
};
|
|
84
|
+
icon: {
|
|
85
|
+
it: string;
|
|
86
|
+
en: string;
|
|
87
|
+
};
|
|
88
|
+
star: {
|
|
89
|
+
it: string;
|
|
90
|
+
en: string;
|
|
91
|
+
};
|
|
92
|
+
heart: {
|
|
93
|
+
it: string;
|
|
94
|
+
en: string;
|
|
95
|
+
};
|
|
96
|
+
thumb: {
|
|
97
|
+
it: string;
|
|
98
|
+
en: string;
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
select: {
|
|
102
|
+
select: {
|
|
103
|
+
id: {
|
|
104
|
+
it: string;
|
|
105
|
+
en: string;
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
dropdown: {
|
|
109
|
+
id: {
|
|
110
|
+
it: string;
|
|
111
|
+
en: string;
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
check: {
|
|
116
|
+
check: {
|
|
117
|
+
id: {
|
|
118
|
+
it: string;
|
|
119
|
+
en: string;
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
switch: {
|
|
123
|
+
id: {
|
|
124
|
+
it: string;
|
|
125
|
+
en: string;
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
labels: {
|
|
129
|
+
true: {
|
|
130
|
+
it: string;
|
|
131
|
+
en: string;
|
|
132
|
+
};
|
|
133
|
+
false: {
|
|
134
|
+
it: string;
|
|
135
|
+
en: string;
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
};
|
|
139
|
+
date: {
|
|
140
|
+
date: {
|
|
141
|
+
id: {
|
|
142
|
+
it: string;
|
|
143
|
+
en: string;
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
min: {
|
|
147
|
+
it: string;
|
|
148
|
+
en: string;
|
|
149
|
+
};
|
|
150
|
+
max: {
|
|
151
|
+
it: string;
|
|
152
|
+
en: string;
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
sourceList: {
|
|
156
|
+
id: {
|
|
157
|
+
it: string;
|
|
158
|
+
en: string;
|
|
159
|
+
};
|
|
160
|
+
source: {
|
|
161
|
+
it: string;
|
|
162
|
+
en: string;
|
|
163
|
+
};
|
|
164
|
+
min: {
|
|
165
|
+
it: string;
|
|
166
|
+
en: string;
|
|
167
|
+
};
|
|
168
|
+
max: {
|
|
169
|
+
it: string;
|
|
170
|
+
en: string;
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
fn: {
|
|
174
|
+
id: {
|
|
175
|
+
it: string;
|
|
176
|
+
en: string;
|
|
177
|
+
};
|
|
178
|
+
fn: {
|
|
179
|
+
CountIf: {
|
|
180
|
+
it: string;
|
|
181
|
+
en: string;
|
|
182
|
+
};
|
|
183
|
+
abs: {
|
|
184
|
+
it: string;
|
|
185
|
+
en: string;
|
|
186
|
+
};
|
|
187
|
+
sum: {
|
|
188
|
+
it: string;
|
|
189
|
+
en: string;
|
|
190
|
+
};
|
|
191
|
+
mul: {
|
|
192
|
+
it: string;
|
|
193
|
+
en: string;
|
|
194
|
+
};
|
|
195
|
+
max: {
|
|
196
|
+
it: string;
|
|
197
|
+
en: string;
|
|
198
|
+
};
|
|
199
|
+
min: {
|
|
200
|
+
it: string;
|
|
201
|
+
en: string;
|
|
202
|
+
};
|
|
203
|
+
diff: {
|
|
204
|
+
it: string;
|
|
205
|
+
en: string;
|
|
206
|
+
};
|
|
207
|
+
div: {
|
|
208
|
+
it: string;
|
|
209
|
+
en: string;
|
|
210
|
+
};
|
|
211
|
+
avg: {
|
|
212
|
+
it: string;
|
|
213
|
+
en: string;
|
|
214
|
+
};
|
|
215
|
+
age: {
|
|
216
|
+
it: string;
|
|
217
|
+
en: string;
|
|
218
|
+
};
|
|
219
|
+
BMI: {
|
|
220
|
+
it: string;
|
|
221
|
+
en: string;
|
|
222
|
+
};
|
|
223
|
+
diffDays: {
|
|
224
|
+
it: string;
|
|
225
|
+
en: string;
|
|
226
|
+
};
|
|
227
|
+
SOFA: {
|
|
228
|
+
it: string;
|
|
229
|
+
en: string;
|
|
230
|
+
};
|
|
231
|
+
ISTH: {
|
|
232
|
+
it: string;
|
|
233
|
+
en: string;
|
|
234
|
+
};
|
|
235
|
+
CID: {
|
|
236
|
+
it: string;
|
|
237
|
+
en: string;
|
|
238
|
+
};
|
|
239
|
+
HScore: {
|
|
240
|
+
it: string;
|
|
241
|
+
en: string;
|
|
242
|
+
};
|
|
243
|
+
MeanArterialPressure: {
|
|
244
|
+
it: string;
|
|
245
|
+
en: string;
|
|
246
|
+
};
|
|
247
|
+
CrocoftGault: {
|
|
248
|
+
it: string;
|
|
249
|
+
en: string;
|
|
250
|
+
};
|
|
251
|
+
CDKEPI: {
|
|
252
|
+
it: string;
|
|
253
|
+
en: string;
|
|
254
|
+
};
|
|
255
|
+
PFpercent: {
|
|
256
|
+
it: string;
|
|
257
|
+
en: string;
|
|
258
|
+
};
|
|
259
|
+
MELD: {
|
|
260
|
+
it: string;
|
|
261
|
+
en: string;
|
|
262
|
+
};
|
|
263
|
+
MELDNa: {
|
|
264
|
+
it: string;
|
|
265
|
+
en: string;
|
|
266
|
+
};
|
|
267
|
+
TIMIrisk: {
|
|
268
|
+
it: string;
|
|
269
|
+
en: string;
|
|
270
|
+
};
|
|
271
|
+
pow: {
|
|
272
|
+
it: string;
|
|
273
|
+
en: string;
|
|
274
|
+
};
|
|
275
|
+
sign: {
|
|
276
|
+
it: string;
|
|
277
|
+
en: string;
|
|
278
|
+
};
|
|
279
|
+
log: {
|
|
280
|
+
it: string;
|
|
281
|
+
en: string;
|
|
282
|
+
};
|
|
283
|
+
};
|
|
284
|
+
addParam: {
|
|
285
|
+
it: string;
|
|
286
|
+
en: string;
|
|
287
|
+
};
|
|
288
|
+
};
|
|
289
|
+
score: {
|
|
290
|
+
id: {
|
|
291
|
+
it: string;
|
|
292
|
+
en: string;
|
|
293
|
+
};
|
|
294
|
+
};
|
|
295
|
+
cond: {
|
|
296
|
+
id: {
|
|
297
|
+
it: string;
|
|
298
|
+
en: string;
|
|
299
|
+
};
|
|
300
|
+
alert: {
|
|
301
|
+
it: string;
|
|
302
|
+
en: string;
|
|
303
|
+
};
|
|
304
|
+
condition: {
|
|
305
|
+
it: string;
|
|
306
|
+
en: string;
|
|
307
|
+
};
|
|
308
|
+
selectQuestion: {
|
|
309
|
+
it: string;
|
|
310
|
+
en: string;
|
|
311
|
+
};
|
|
312
|
+
selectOperator: {
|
|
313
|
+
it: string;
|
|
314
|
+
en: string;
|
|
315
|
+
};
|
|
316
|
+
selectValue: {
|
|
317
|
+
it: string;
|
|
318
|
+
en: string;
|
|
319
|
+
};
|
|
320
|
+
activate: {
|
|
321
|
+
it: string;
|
|
322
|
+
en: string;
|
|
323
|
+
};
|
|
324
|
+
};
|
|
325
|
+
item: {
|
|
326
|
+
fileUpload: {
|
|
327
|
+
id: {
|
|
328
|
+
it: string;
|
|
329
|
+
en: string;
|
|
330
|
+
};
|
|
331
|
+
};
|
|
332
|
+
multipleSelect: {
|
|
333
|
+
id: {
|
|
334
|
+
it: string;
|
|
335
|
+
en: string;
|
|
336
|
+
};
|
|
337
|
+
};
|
|
338
|
+
autocomplete: {
|
|
339
|
+
id: {
|
|
340
|
+
it: string;
|
|
341
|
+
en: string;
|
|
342
|
+
};
|
|
343
|
+
};
|
|
344
|
+
selectTable: {
|
|
345
|
+
id: {
|
|
346
|
+
it: string;
|
|
347
|
+
en: string;
|
|
348
|
+
};
|
|
349
|
+
};
|
|
350
|
+
section: {
|
|
351
|
+
id: {
|
|
352
|
+
it: string;
|
|
353
|
+
en: string;
|
|
354
|
+
};
|
|
355
|
+
pageName: {
|
|
356
|
+
it: string;
|
|
357
|
+
en: string;
|
|
358
|
+
};
|
|
359
|
+
};
|
|
360
|
+
folder: {
|
|
361
|
+
id: {
|
|
362
|
+
it: string;
|
|
363
|
+
en: string;
|
|
364
|
+
};
|
|
365
|
+
};
|
|
366
|
+
page: {
|
|
367
|
+
id: {
|
|
368
|
+
it: string;
|
|
369
|
+
en: string;
|
|
370
|
+
};
|
|
371
|
+
pageName: {
|
|
372
|
+
it: string;
|
|
373
|
+
en: string;
|
|
374
|
+
};
|
|
375
|
+
};
|
|
376
|
+
landing: {
|
|
377
|
+
id: {
|
|
378
|
+
it: string;
|
|
379
|
+
en: string;
|
|
380
|
+
};
|
|
381
|
+
pageName: {
|
|
382
|
+
it: string;
|
|
383
|
+
en: string;
|
|
384
|
+
};
|
|
385
|
+
};
|
|
386
|
+
root: {
|
|
387
|
+
id: {
|
|
388
|
+
it: string;
|
|
389
|
+
en: string;
|
|
390
|
+
};
|
|
391
|
+
};
|
|
392
|
+
};
|
|
393
|
+
};
|
|
394
|
+
validators: {
|
|
395
|
+
emptyField: {
|
|
396
|
+
it: string;
|
|
397
|
+
en: string;
|
|
398
|
+
};
|
|
399
|
+
invalidInput: {
|
|
400
|
+
it: string;
|
|
401
|
+
en: string;
|
|
402
|
+
};
|
|
403
|
+
numberMin: {
|
|
404
|
+
it: string;
|
|
405
|
+
en: string;
|
|
406
|
+
};
|
|
407
|
+
numberMax: {
|
|
408
|
+
it: string;
|
|
409
|
+
en: string;
|
|
410
|
+
};
|
|
411
|
+
textMin: {
|
|
412
|
+
it: string;
|
|
413
|
+
en: string;
|
|
414
|
+
};
|
|
415
|
+
textMax: {
|
|
416
|
+
it: string;
|
|
417
|
+
en: string;
|
|
418
|
+
};
|
|
419
|
+
dateMin: {
|
|
420
|
+
it: string;
|
|
421
|
+
en: string;
|
|
422
|
+
};
|
|
423
|
+
dateMax: {
|
|
424
|
+
it: string;
|
|
425
|
+
en: string;
|
|
426
|
+
};
|
|
427
|
+
sourceListMin: {
|
|
428
|
+
it: string;
|
|
429
|
+
en: string;
|
|
430
|
+
};
|
|
431
|
+
sourceListMax: {
|
|
432
|
+
it: string;
|
|
433
|
+
en: string;
|
|
434
|
+
};
|
|
435
|
+
};
|
|
436
|
+
hover: {
|
|
437
|
+
edit: {
|
|
438
|
+
it: string;
|
|
439
|
+
en: string;
|
|
440
|
+
};
|
|
441
|
+
view: {
|
|
442
|
+
it: string;
|
|
443
|
+
en: string;
|
|
444
|
+
};
|
|
445
|
+
move: {
|
|
446
|
+
it: string;
|
|
447
|
+
en: string;
|
|
448
|
+
};
|
|
449
|
+
addPage: {
|
|
450
|
+
it: string;
|
|
451
|
+
en: string;
|
|
452
|
+
};
|
|
453
|
+
duplicate: {
|
|
454
|
+
it: string;
|
|
455
|
+
en: string;
|
|
456
|
+
};
|
|
457
|
+
remove: {
|
|
458
|
+
it: string;
|
|
459
|
+
en: string;
|
|
460
|
+
};
|
|
461
|
+
rename: {
|
|
462
|
+
it: string;
|
|
463
|
+
en: string;
|
|
464
|
+
};
|
|
465
|
+
pageSection: {
|
|
466
|
+
it: string;
|
|
467
|
+
en: string;
|
|
468
|
+
};
|
|
469
|
+
};
|
|
470
|
+
general: {
|
|
471
|
+
yes: {
|
|
472
|
+
it: string;
|
|
473
|
+
en: string;
|
|
474
|
+
};
|
|
475
|
+
no: {
|
|
476
|
+
it: string;
|
|
477
|
+
en: string;
|
|
478
|
+
};
|
|
479
|
+
layout: {
|
|
480
|
+
it: string;
|
|
481
|
+
en: string;
|
|
482
|
+
};
|
|
483
|
+
title: {
|
|
484
|
+
it: string;
|
|
485
|
+
en: string;
|
|
486
|
+
};
|
|
487
|
+
description: {
|
|
488
|
+
it: string;
|
|
489
|
+
en: string;
|
|
490
|
+
};
|
|
491
|
+
minimum: {
|
|
492
|
+
it: string;
|
|
493
|
+
en: string;
|
|
494
|
+
};
|
|
495
|
+
maximum: {
|
|
496
|
+
it: string;
|
|
497
|
+
en: string;
|
|
498
|
+
};
|
|
499
|
+
};
|
|
500
|
+
operators: {
|
|
501
|
+
'==': {
|
|
502
|
+
it: string;
|
|
503
|
+
en: string;
|
|
504
|
+
};
|
|
505
|
+
'!=': {
|
|
506
|
+
it: string;
|
|
507
|
+
en: string;
|
|
508
|
+
};
|
|
509
|
+
'>': {
|
|
510
|
+
it: string;
|
|
511
|
+
en: string;
|
|
512
|
+
};
|
|
513
|
+
'>=': {
|
|
514
|
+
it: string;
|
|
515
|
+
en: string;
|
|
516
|
+
};
|
|
517
|
+
'<': {
|
|
518
|
+
it: string;
|
|
519
|
+
en: string;
|
|
520
|
+
};
|
|
521
|
+
'<=': {
|
|
522
|
+
it: string;
|
|
523
|
+
en: string;
|
|
524
|
+
};
|
|
525
|
+
};
|
|
526
|
+
};
|
|
527
|
+
declare function getLocale(localeMap: {
|
|
528
|
+
it: string;
|
|
529
|
+
en: string;
|
|
530
|
+
}, locale?: 'it' | 'en'): string;
|
|
8
531
|
declare function getLocaleItemTypeId(key: string): string;
|
|
9
532
|
|
|
10
533
|
export { LocaleMap, getLocale, getLocaleItemTypeId };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const e={items:{text:{text:{id:{it:"Testo",en:"Text"}},textArea:{id:{it:"Testo Multiriga",en:"Text Multiline"}},time:{id:{it:"Orario",en:"Time"}},signature:{id:{it:"Firma",en:"Signature"}},min:{it:"Lunghezza minima di caratteri",en:"Minimum length of characters"},max:{it:"Lunghezza massima di caratteri",en:"Maximum length of characters"},maxTime:{it:"Orario massimo",en:"Maximum time"},minTime:{it:"Orario minimo",en:"Minimum time"},formatTime:{it:"Formato orario",en:"Time format"}},number:{number:{id:{it:"Numero",en:"Number"}},range:{id:{it:"Intervallo",en:"Range"}},rating:{id:{it:"Valutazione",en:"Rating"}},maxValue:{it:"Valore massimo",en:"Maximum value"},minValue:{it:"Valore minimo",en:"Minimum value"},step:{it:"Step",en:"Step"},unit:{it:"Unità di misura",en:"Unit of measure"},icon:{it:"Icona",en:"Icon"},star:{it:"Stella",en:"Star"},heart:{it:"Cuore",en:"Heart"},thumb:{it:"Pollice",en:"Thumb"}},select:{select:{id:{it:"Selezione",en:"Select"}},dropdown:{id:{it:"Selezione a Tendina",en:"Dropdown"}}},check:{check:{id:{it:"Casella di Spunta",en:"Checkbox"}},switch:{id:{it:"Interruttore",en:"Switch"}},labels:{true:{it:"Etichetta vero",en:"True label"},false:{it:"Etichetta falso",en:"False label"}}},date:{date:{id:{it:"Data",en:"Date"}},min:{it:"Data minima",en:"Minimum date"},max:{it:"Data massima",en:"Maximum date"}},sourceList:{id:{it:"Lista da Sorgente",en:"Source List"},source:{it:"Sorgente",en:"Source"},min:{it:"Selezioni minime",en:"Minimum selections"},max:{it:"Selezioni massime",en:"Maximum selections"}},fn:{id:{it:"Calcolo",en:"Calculation"},fn:{CountIf:{it:"Conta se",en:"CountIf"},abs:{it:"Valore Assoluto",en:"Absolute Value"},sum:{it:"Somma",en:"Sum"},mul:{it:"Moltiplicazione",en:"Multiplication"},max:{it:"Massimo",en:"Maximum"},min:{it:"Minimo",en:"Minimum"},diff:{it:"Differenza",en:"Difference"},div:{it:"Divisione",en:"Division"},avg:{it:"Media",en:"Average"},age:{it:"Età",en:"Age"},BMI:{it:"BMI",en:"BMI"},diffDays:{it:"Differenza (giorni)",en:"Difference (days)"},SOFA:{it:"SOFA",en:"SOFA"},ISTH:{it:"ISTH",en:"ISTH"},CID:{it:"CID",en:"CID"},HScore:{it:"HScore",en:"HScore"},MeanArterialPressure:{it:"MeanArterialPressure",en:"MeanArterialPressure"},CrocoftGault:{it:"CrocoftGault",en:"CrocoftGault"},CDKEPI:{it:"CDKEPI",en:"CDKEPI"},PFpercent:{it:"PFpercent",en:"PFpercent"},MELD:{it:"MELD",en:"MELD"},MELDNa:{it:"MELD Na",en:"MELD Na"},TIMIrisk:{it:"TIMIrisk",en:"TIMIrisk"},pow:{it:"Potenza",en:"Pow"},sign:{it:"Segno",en:"Sign"},log:{it:"Logaritmo",en:"Log"}},addParam:{it:"Aggiungi un parametro",en:"Aggiungi un parametro"}},score:{id:{it:"Score",en:"Score"}},cond:{id:{it:"Condizione",en:"Condition"},alert:{it:"Alert",en:"Alert"},condition:{it:"Condizione",en:"Condition"},selectQuestion:{it:"Seleziona una domanda",en:"Select a question"},selectOperator:{it:"Operatore",en:"Select an operator"},selectValue:{it:"Seleziona un valore",en:"Select a value"},activate:{it:"Domande attive quando si verifica la condizione",en:"Active questions on true condition"}},item:{fileUpload:{id:{it:"Caricamento file",en:"Upload file"}},multipleSelect:{id:{it:"Selezione multipla",en:"Multiple select"}},autocomplete:{id:{it:"Tendina a selezione multipla",en:"Autocomplete"}},selectTable:{id:{it:"Tabella",en:"Select Table"}},section:{id:{it:"Sezione",en:"Section"},pageName:{it:"Nome sezione",en:"Section Name"}},folder:{id:{it:"Cartella",en:"Folder"}},page:{id:{it:"Pagina",en:"Page"},pageName:{it:"Nome pagina",en:"Page Name"}},landing:{id:{it:"Pagina Introduttiva",en:"Landing Page"},pageName:{it:"Nome pagina",en:"Page Name"}},root:{id:{it:"Radice",en:"Root"}}}},validators:{emptyField:{it:"Non puoi lasciare questo campo vuoto",en:"You cannot leave this field empty"},invalidInput:{it:"Dati inseriti non validi",en:"Invalid input"},numberMin:{it:"Il numero deve essere maggiore di ",en:"The number mus be greater than "},numberMax:{it:"Il numero deve essere minore di ",en:"The number must be lower of"},textMin:{it:"Il testo deve evere più caratteri",en:"The text must have more characters"},textMax:{it:"Il testo deve avere meno caratteri",en:"The text must have less characters"},dateMin:{it:"La data deve essere superiore",en:"The date must be greater"},dateMax:{it:"La data deve essere minore",en:"The date must be minor"},sourceListMin:{it:"Devi selezionarne di piu",en:"You must select more"},sourceListMax:{it:"Devi selezionarne di meno",en:"You must select less"}},hover:{edit:{it:"Modifica",en:"Edit"},view:{it:"Visualizza",en:"View"},move:{it:"Sposta",en:"Move"},addPage:{it:"Aggiungi pagina",en:"Add page"},duplicate:{it:"Duplica",en:"Duplicate"},remove:{it:"Elimina",en:"Delete"},rename:{it:"Rinomina",en:"Rename"},pageSection:{it:"Converti Pagina/Sezione",en:"Convert Page/Section"}},general:{yes:{it:"Si",en:"Yes"},no:{it:"No",en:"No"},layout:{it:"Layout",en:"Layout"},title:{it:"Titolo",en:"Title"},description:{it:"Descrizione",en:"Description"},minimum:{it:"Minimo",en:"Minimum"},maximum:{it:"Massimo",en:"Minimum"}},operators:{"==":{it:"È Uguale",en:"Equal"},"!=":{it:"È Diverso",en:"Not equal"},">":{it:"È Maggiore",en:"Greate"},">=":{it:"È Maggiore o uguale",en:"Greater or equal"},"<":{it:"È Minore",en:"Lower"},"<=":{it:"È Minore o uguale",en:"Lower or equal"}}},i={root:e.items.item.root.id,landing:e.items.item.landing.id,folder:e.items.item.folder.id,page:e.items.item.page.id,section:e.items.item.section.id,text:e.items.text.text.id,textArea:e.items.text.textArea.id,time:e.items.text.time.id,signature:e.items.text.signature.id,number:e.items.number.number.id,range:e.items.number.range.id,rating:e.items.number.rating.id,select:e.items.select.select.id,dropdown:e.items.select.dropdown.id,check:e.items.check.check.id,switch:e.items.check.switch.id,date:e.items.date.date.id,sourceList:e.items.sourceList.id,fn:e.items.fn.id,score:e.items.score.id,cond:e.items.cond.id,alert:e.items.cond.alert,fileUpload:e.items.item.fileUpload.id,multipleSelect:e.items.item.multipleSelect.id,autocomplete:e.items.item.autocomplete.id,selectTable:e.items.item.selectTable.id};function t(e,i="it"){return e?e[i]:""}function n(e){return Object.keys(i).includes(e)?t(i[e]):""}export{e as LocaleMap,t as getLocale,n as getLocaleItemTypeId};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Mapper as e}from"../config-map.js";function t(e){if(!e)return"";switch(e.type){case"v":
|
|
1
|
+
import{Mapper as e}from"../config-map.js";function t(e){if(!e)return"";switch(e.type){case"v":{const t="string"==typeof e.value?`'${e.value}'`:e.value;return null!=t?String(t):""}case"id":return`$${e.name}`;case"exp":return`(${t(e.left)}${e.operator}${t(e.right)})`;case"call":return`${t(e.call)}(${e.arguments.map(e=>t(e)).join(",")})`;default:return""}}function r(n){let i={...n};if(i.type===e.cond.type){const e=i;if("expression"in e){const{expression:r,...n}=e;i={...n,condition:t(r)}}}return Array.isArray(i.items)&&(i.items=i.items.map(r)),i}export{r as ConditionParser};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Result as e}from"../../types/ResultTypes.js";import{Item as r}from"@famalabs/survey";import*as t from"acorn";function n(e){switch(e.type){case"Literal":return null!=e.value?{type:"v",value:e.value}:void 0;case"Identifier":{const r=e.name.startsWith("$")?e.name.slice(1):e.name;return{type:e.name.startsWith("$")?"id":"v",name:r}}case"LogicalExpression":case"BinaryExpression":{const r=e,t=n(r.left),o=n(r.right);return{type:"exp",operator:r.operator,left:t,right:o}}case"ExpressionStatement":return n(e.expression);case"Program":for(const r of e.body)return n(r);return;default:return{type:"unsupported",value:`Nodo non supportato: ${e.type}`}}}function o(o){if(!o)return o;const i=o instanceof r?o?.toJSON():o,{condition:s,...a}=i;return s?e.try(()=>{const e=t.parse(s,{ecmaVersion:2024,sourceType:"script"});return{...a,expression:n(e)}}).match(e=>e,e=>{console.error("Failed to parse condition:",e)}):(console.error("No condition found in question:",o),i)}function i(e){if(!e)return{min:null,max:null};const r=t.parse(e,{ecmaVersion:2024}),n=(()=>{const e=r?.body;if(!Array.isArray(e)||0===e.length)return;const t=e[0];return t?"ExpressionStatement"===t.type?t.expression:t:void 0})();let o=null,i=null;const s=e=>{"number"==typeof e&&(o=null===o?e:Math.max(o,e))},a=e=>{"number"==typeof e&&(i=null===i?e:Math.min(i,e))},p=e=>{if(!e)return;const r=e.left,t=e.right;if("LogicalExpression"===e.type&&"&&"===e.operator)return p(r),void p(t);if("BinaryExpression"===e.type){const n="Literal"===t?.type?t.value:void 0,o="Literal"===r?.type?r.value:void 0;switch(e.operator){case">":case">=":void 0!==n?a(n):void 0!==o&&s(o);break;case"<":case"<=":void 0!==n?s(n):void 0!==o&&a(o)}}};return p(n),{min:o,max:i}}function s(e,r){if(!e)return e;const n=t.parse(e,{ecmaVersion:2024}),o=(()=>{const e=n?.body;if(!Array.isArray(e)||0===e.length)return;const r=e[0];return r?"ExpressionStatement"===r.type?r.expression:r:void 0})();if(!o)return e;const{min:i,max:s}=r,a=(e,r)=>{e.value=r,e.raw=(Number.isInteger(r),String(r))},p=e=>{if(e){if("LogicalExpression"===e.type&&"&&"===e.operator)return p(e.left),void p(e.right);if("BinaryExpression"===e.type){const r="Literal"===e.right?.type,t="Literal"===e.left?.type;switch(e.operator){case">":case">=":r&&null!=s?a(e.right,s):t&&null!=i&&a(e.left,i);break;case"<":case"<=":r&&null!=i?a(e.right,i):t&&null!=s&&a(e.left,s)}}}};return p(o),n.body.map(e=>{const r=e=>{switch(e.type){case"Literal":return"string"==typeof e.value?JSON.stringify(e.value):String(e.value);case"Identifier":return e.name;case"BinaryExpression":case"LogicalExpression":{const t=e=>{const t=r(e);return"Literal"===e.type||"Identifier"===e.type?t:`(${t})`};return`(${t(e.left)}${e.operator}${t(e.right)})`}case"ExpressionStatement":return r(e.expression);default:return""}};return"ExpressionStatement"===e.type?r(e.expression):r(e)}).join("\n").trim()}export{o as LegacyConditionParser,i as acornExtractMinMax,s as acornUpdateMinMax,n as transformNode};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"dayjs";const H=["HH","HH:mm","HH:mm:ss"],m=m=>H.includes(m);export{H as TIME_FORMAT_OPTIONS,m as isTimeFormat};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{getMapType as e,Mapper as t}from"../../utils/config-map.js";import"../../utils/locale.js";import"@famalabs/survey";import"acorn";import{isTimeFormat as r}from"../../utils/time-utils.js";const n=r=>r&&0!==r.length?r.reduce((r,o)=>e(o)===t.cond.type||e(o)===t.section.type?(o.items&&o.items.length>0&&(r={...r,...n(o.items)}),r):e(o)===t.multipleSelect.type&&o.items&&o.items.length>0?(o.items.forEach(n=>{if(e(n)===t.fn?.type)return;const o=n;o&&(r[o.id]={answer:o?.answer??!1,score:!0===o?.answer?1:!1===o?.answer?0:null})}),r):e(o)===t.selectTable.type&&o.items&&o.items.length>0?(o.items.forEach(e=>{const t=e;t&&(r[t.id]={answer:t?.answer??null,score:null})}),r):(r[o.id]={answer:o.answer??null,score:null},r),{}):{},o="Questo campo è obbligatorio",i=(e,t)=>{if("HH"===t){const t=e.match(/^([01]\d|2[0-3])$/);return t?3600*Number(t[1]):null}if("HH:mm"===t){const t=e.match(/^([01]\d|2[0-3]):([0-5]\d)$/);return t?3600*Number(t[1])+60*Number(t[2]):null}const r=e.match(/^([01]\d|2[0-3]):([0-5]\d):([0-5]\d)$/);return r?3600*Number(r[1])+60*Number(r[2])+Number(r[3]):null},s=e=>i(e,"HH:mm:ss")??i(e,"HH:mm")??i(e,"HH"),a=(e,t)=>{const r=Math.max(0,Math.min(86399,Math.floor(e))),n=Math.floor(r/3600).toString().padStart(2,"0"),o=Math.floor(r%3600/60).toString().padStart(2,"0"),i=(r%60).toString().padStart(2,"0");return"HH"===t?n:"HH:mm"===t?`${n}:${o}`:`${n}:${o}:${i}`},l=(n,i)=>{switch(e(n)){case t.text.type:case t.textArea.type:{const e=n.options??{};return null==i||""===i?e.required?o:void 0:"string"!=typeof i?"Valore non valido":e.min&&i.length<e.min?`Deve contenere almeno ${e.min} caratteri`:e.max&&i.length>e.max?`Può contenere al massimo ${e.max} caratteri`:e.format&&!new RegExp(e.format).test(i)?"Il formato non è corretto":void 0}case t.number.type:case t.range.type:case t.rating.type:{const e=n.options??{};if(null==i||""===i)return e.required?o:void 0;const t="number"==typeof i?i:"string"==typeof i&&""!==i.trim()?Number(i):NaN;return Number.isFinite(t)?void 0!==e.min&&t<e.min?`Deve essere almeno ${e.min}`:void 0!==e.max&&t>e.max?`Può essere al massimo ${e.max}`:void 0:"Valore numerico non valido"}case t.date.type:{const e=n.options??{};if(null==i||""===i)return e.required?o:void 0;const t="string"==typeof i?new Date(i):i instanceof Date?i:null;if(!t||Number.isNaN(t.getTime()))return"Data non valida";const r=t.getFullYear();if(r<1900||r>2099)return"La data deve essere compresa tra il 1900 e il 2099";if(e.min){const r=new Date(e.min);if(t<=r)return`La data deve essere successiva al ${r.toLocaleDateString()}`}if(e.max){const r=new Date(e.max);if(t>=r)return`La data deve essere precedente al ${r.toLocaleDateString()}`}return}case t.time.type:{const e=n.options??{},t=n.layout??{};if(null==i||""===i)return e.required?o:void 0;if("string"!=typeof i)return"Orario non valido";const l="string"==typeof t.format?t.format:"",u=r(l)?l:"HH:mm",m=s(i);if(null===m)return"Orario non valido";const c="string"==typeof t.min&&t.min?s(t.min):null;if(null!==c&&m<c)return`L'orario deve essere uguale o successivo a ${a(c,u)}`;const d="string"==typeof t.max&&t.max?s(t.max):null;return null!==d&&m>d?`L'orario deve essere uguale o precedente a ${a(d,u)}`:void 0}case t.signature.type:{const e=n.options??{};return null==i||""===i?e.required?o:void 0:"string"==typeof i&&i.startsWith("data:image")?void 0:(console.error("Invalid signature value:",i),"Firma non valida")}case t.select.type:case t.dropdown.type:case t.selectTable.type:return(null==i||""===i||Array.isArray(i)&&0===i.length)&&n.options?.required?o:void 0;case t.check.type:case t.switch.type:return null!=i&&!1!==i||!n.options?.required?void 0:o;case t.sourceList.type:return null==i||""===i||Array.isArray(i)&&0===i.length?n.options?.required?o:void 0:Array.isArray(i)?i.some(e=>"string"!=typeof e)?"Valore non valido":void 0:"Valore non valido";default:return(null==i||""===i||Array.isArray(i)&&0===i.length)&&n.options?.required?o:void 0}};function u(e){return n(e)}function m(r){const n=(r=>{if(!r||0===r.length)return[];const n=[],o=r=>{for(const i of r){const r=e(i);if(r!==t.alert.type)if(r!==t.section.type&&r!==t.cond.type)if(r===t.multipleSelect.type&&i.items&&i.items.length>0)for(const r of i.items){if(e(r)===t.fn?.type)continue;const o=r;o&&n.push(o)}else if(r===t.selectTable.type&&i.items&&i.items.length>0)for(const e of i.items){const t=e;t&&n.push(t)}else n.push(i);else i.items&&i.items.length>0&&o(i.items)}};return o(r),n})(r);return async e=>{const t={};for(const[r,o]of n.entries()){const r=e[o.id];if(!r)continue;const n=l(o,r.answer);n&&(t[`${o.id}.answer`]={type:"validate",message:n})}return 0===Object.keys(t).length?{values:e,errors:{}}:{values:{},errors:t}}}export{m as useCompilerResolver,u as useParseQuestionsForm};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export { FormConfiguration, FormCreator, FormCreatorProps } from './core/Form.js';
|
|
2
2
|
export { FormCompilerConfiguration } from './core/types/FormCompilerTypes.js';
|
|
3
3
|
export { AvailableQuestions, FormEditorConfiguration, OperationData, OperationDto } from './core/types/FormEditorTypes.js';
|
|
4
|
-
export {
|
|
5
|
-
export { ExecutionMode } from './core/hooks/editor/EditorOperations.js';
|
|
6
|
-
export { ItemConditionalMap, ItemFunctionMap, ItemMap, Mapper, ProtoItemSchema, QuestionCheckMap, QuestionDateAdapter, QuestionDateMap, QuestionFileMap, QuestionListMap, QuestionNumberMap, QuestionSelectMap, QuestionTextMap, fromMapToDefault, getDefaultData, getMapType } from './core/utils/config-map.js';
|
|
4
|
+
export { ItemConditionalMap, ItemFunctionMap, ItemMap, Mapper, ProtoItemSchema, QuestionCheckMap, QuestionDateMap, QuestionFileMap, QuestionListMap, QuestionNumberMap, QuestionSelectMap, QuestionTextMap, getDefaultData, getMapType } from './core/utils/config-map.js';
|
|
7
5
|
export { LocaleMap, getLocale, getLocaleItemTypeId } from './core/utils/locale.js';
|
|
8
6
|
export { formatId, formatName, isNameValid, resolvePath } from './core/utils/format-utils.js';
|
|
7
|
+
export { isFormValid } from './core/hooks/common/NavigationHook.js';
|
|
8
|
+
export { ExecutionMode } from './core/hooks/editor/EditorOperations.js';
|
|
9
9
|
export { AssetManagerProps, DynamicVariableSelectorProps, FormGlobalConfiguration, FormUploadMethods, SourceConfiguration } from './core/types/FormGlobalTypes.js';
|