@wix/form-public 0.42.0 → 0.44.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 +32 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +32 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -17401,6 +17401,8 @@ var FormatDescriptionTypeKey = "formatDescriptionType";
|
|
|
17401
17401
|
var LocationTypeKey = "locationType";
|
|
17402
17402
|
var FormatDescriptionKey = "formatDescription";
|
|
17403
17403
|
var LocationIdsKey = "locationIds";
|
|
17404
|
+
var RepeaterFieldsKey = "fields";
|
|
17405
|
+
var RepeaterLayoutKey = "layout";
|
|
17404
17406
|
function makeViewOfInputField(inputOptions) {
|
|
17405
17407
|
switch (inputOptions.inputType) {
|
|
17406
17408
|
case InputType3.STRING:
|
|
@@ -17421,6 +17423,8 @@ function makeViewOfInputField(inputOptions) {
|
|
|
17421
17423
|
return resolveMultilineAddressComponent(inputOptions.multilineAddressOptions);
|
|
17422
17424
|
case InputType3.SCHEDULING:
|
|
17423
17425
|
return resolveSchedulingComponent(inputOptions.schedulingOptions);
|
|
17426
|
+
case InputType3.OBJECT_ARRAY:
|
|
17427
|
+
return resolveObjectArrayComponent(inputOptions.objectArrayOptions);
|
|
17424
17428
|
default:
|
|
17425
17429
|
throw new Error(`Unknown input type ${inputOptions.inputType}`);
|
|
17426
17430
|
}
|
|
@@ -17953,6 +17957,26 @@ function numericNumberOfColumns(numberOfColumnsEnum) {
|
|
|
17953
17957
|
return 1;
|
|
17954
17958
|
}
|
|
17955
17959
|
}
|
|
17960
|
+
function resolveObjectArrayComponent(objectArrayComponent) {
|
|
17961
|
+
switch (objectArrayComponent.componentType) {
|
|
17962
|
+
case ObjectArrayComponentType3.REPEATER:
|
|
17963
|
+
return takeRepeaterViewProperties(objectArrayComponent.repeaterOptions);
|
|
17964
|
+
default:
|
|
17965
|
+
throw new Error(`Unknown object array component type: ${objectArrayComponent.componentType}`);
|
|
17966
|
+
}
|
|
17967
|
+
}
|
|
17968
|
+
function takeRepeaterViewProperties(repeater) {
|
|
17969
|
+
var _repeater$fields;
|
|
17970
|
+
return {
|
|
17971
|
+
[LabelKey]: repeater.label,
|
|
17972
|
+
[HideLabelKey]: !repeater.showLabel,
|
|
17973
|
+
[RepeaterFieldsKey]: (_repeater$fields = repeater.fields) == null ? void 0 : _repeater$fields.map(transformFieldToV1),
|
|
17974
|
+
[RepeaterLayoutKey]: repeater.layout,
|
|
17975
|
+
...repeater.description && {
|
|
17976
|
+
[DescriptionKey]: repeater.description
|
|
17977
|
+
}
|
|
17978
|
+
};
|
|
17979
|
+
}
|
|
17956
17980
|
|
|
17957
17981
|
// ../form-transformer/dist/esm/lib/to-v1/make-view-of-display-properties.js
|
|
17958
17982
|
var ContentKey = "content";
|
|
@@ -18046,6 +18070,13 @@ function makeValidationByType(inputOptions) {
|
|
|
18046
18070
|
format: ValidationFormat3.SCHEDULING
|
|
18047
18071
|
}
|
|
18048
18072
|
};
|
|
18073
|
+
case InputType3.OBJECT_ARRAY:
|
|
18074
|
+
return {
|
|
18075
|
+
predefined: {
|
|
18076
|
+
format: ValidationFormat3.OBJECT_ARRAY,
|
|
18077
|
+
objectArrayOptions: inputOptions.objectArrayOptions.validation
|
|
18078
|
+
}
|
|
18079
|
+
};
|
|
18049
18080
|
default:
|
|
18050
18081
|
throw new Error(`Unknown input type ${inputOptions.inputType}`);
|
|
18051
18082
|
}
|
|
@@ -21395,7 +21426,7 @@ var useForm3 = ({
|
|
|
21395
21426
|
if (!fieldsByRow.has(row)) {
|
|
21396
21427
|
fieldsByRow.set(row, []);
|
|
21397
21428
|
}
|
|
21398
|
-
fieldsByRow.get(row).push(component);
|
|
21429
|
+
fieldsByRow.get(row).push(React14__default.default.cloneElement(component, { key: field.id }));
|
|
21399
21430
|
});
|
|
21400
21431
|
return Array.from(fieldsByRow.entries()).sort(([rowA], [rowB]) => rowA - rowB).map(([_, elements]) => elements);
|
|
21401
21432
|
}, [formFields, currentView.fields]);
|