@wix/form-public 0.41.0 → 0.43.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +31 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +31 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -17393,6 +17393,8 @@ var FormatDescriptionTypeKey = "formatDescriptionType";
|
|
|
17393
17393
|
var LocationTypeKey = "locationType";
|
|
17394
17394
|
var FormatDescriptionKey = "formatDescription";
|
|
17395
17395
|
var LocationIdsKey = "locationIds";
|
|
17396
|
+
var RepeaterFieldsKey = "fields";
|
|
17397
|
+
var RepeaterLayoutKey = "layout";
|
|
17396
17398
|
function makeViewOfInputField(inputOptions) {
|
|
17397
17399
|
switch (inputOptions.inputType) {
|
|
17398
17400
|
case InputType3.STRING:
|
|
@@ -17413,6 +17415,8 @@ function makeViewOfInputField(inputOptions) {
|
|
|
17413
17415
|
return resolveMultilineAddressComponent(inputOptions.multilineAddressOptions);
|
|
17414
17416
|
case InputType3.SCHEDULING:
|
|
17415
17417
|
return resolveSchedulingComponent(inputOptions.schedulingOptions);
|
|
17418
|
+
case InputType3.OBJECT_ARRAY:
|
|
17419
|
+
return resolveObjectArrayComponent(inputOptions.objectArrayOptions);
|
|
17416
17420
|
default:
|
|
17417
17421
|
throw new Error(`Unknown input type ${inputOptions.inputType}`);
|
|
17418
17422
|
}
|
|
@@ -17945,6 +17949,26 @@ function numericNumberOfColumns(numberOfColumnsEnum) {
|
|
|
17945
17949
|
return 1;
|
|
17946
17950
|
}
|
|
17947
17951
|
}
|
|
17952
|
+
function resolveObjectArrayComponent(objectArrayComponent) {
|
|
17953
|
+
switch (objectArrayComponent.componentType) {
|
|
17954
|
+
case ObjectArrayComponentType3.REPEATER:
|
|
17955
|
+
return takeRepeaterViewProperties(objectArrayComponent.repeaterOptions);
|
|
17956
|
+
default:
|
|
17957
|
+
throw new Error(`Unknown object array component type: ${objectArrayComponent.componentType}`);
|
|
17958
|
+
}
|
|
17959
|
+
}
|
|
17960
|
+
function takeRepeaterViewProperties(repeater) {
|
|
17961
|
+
var _repeater$fields;
|
|
17962
|
+
return {
|
|
17963
|
+
[LabelKey]: repeater.label,
|
|
17964
|
+
[HideLabelKey]: !repeater.showLabel,
|
|
17965
|
+
[RepeaterFieldsKey]: (_repeater$fields = repeater.fields) == null ? void 0 : _repeater$fields.map(transformFieldToV1),
|
|
17966
|
+
[RepeaterLayoutKey]: repeater.layout,
|
|
17967
|
+
...repeater.description && {
|
|
17968
|
+
[DescriptionKey]: repeater.description
|
|
17969
|
+
}
|
|
17970
|
+
};
|
|
17971
|
+
}
|
|
17948
17972
|
|
|
17949
17973
|
// ../form-transformer/dist/esm/lib/to-v1/make-view-of-display-properties.js
|
|
17950
17974
|
var ContentKey = "content";
|
|
@@ -18038,6 +18062,13 @@ function makeValidationByType(inputOptions) {
|
|
|
18038
18062
|
format: ValidationFormat3.SCHEDULING
|
|
18039
18063
|
}
|
|
18040
18064
|
};
|
|
18065
|
+
case InputType3.OBJECT_ARRAY:
|
|
18066
|
+
return {
|
|
18067
|
+
predefined: {
|
|
18068
|
+
format: ValidationFormat3.OBJECT_ARRAY,
|
|
18069
|
+
objectArrayOptions: inputOptions.objectArrayOptions.validation
|
|
18070
|
+
}
|
|
18071
|
+
};
|
|
18041
18072
|
default:
|
|
18042
18073
|
throw new Error(`Unknown input type ${inputOptions.inputType}`);
|
|
18043
18074
|
}
|