@nolwenture/formik-jsonschema-form 0.26.1 → 0.26.2

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.
Files changed (73) hide show
  1. package/dist/Form.js +3 -3
  2. package/dist/Form.stories.js +9 -32
  3. package/dist/FormEditor.js +3 -12
  4. package/dist/FormPdf.js +3 -3
  5. package/dist/FormPdf.stories.js +7 -30
  6. package/dist/fields/AnyField.js +3 -3
  7. package/dist/fields/ArrayField.js +9 -9
  8. package/dist/fields/BooleanField.js +6 -3
  9. package/dist/fields/DateField.js +1 -1
  10. package/dist/fields/FileUploadField.js +9 -18
  11. package/dist/fields/MultipleChoiceField.js +2 -2
  12. package/dist/fields/NullField.js +1 -1
  13. package/dist/fields/NumberField.js +4 -2
  14. package/dist/fields/ObjectField.js +11 -23
  15. package/dist/fields/RadioField.js +1 -1
  16. package/dist/fields/SchemaField.js +6 -2
  17. package/dist/fields/SearchMultiTagSelectField.js +1 -1
  18. package/dist/fields/SearchableSelectField.js +19 -25
  19. package/dist/fields/StringField.js +11 -9
  20. package/dist/fields/TextAreaField.js +1 -1
  21. package/dist/fields/ToggleField.js +1 -1
  22. package/dist/fields/stories/AnyField.stories.js +22 -31
  23. package/dist/fields/stories/ArrayField.stories.js +64 -73
  24. package/dist/fields/stories/BooleanField.stories.js +6 -15
  25. package/dist/fields/stories/DateField.stories.js +4 -13
  26. package/dist/fields/stories/FileUploadField.stories.js +9 -18
  27. package/dist/fields/stories/MultipleChoiceField.stories.js +24 -33
  28. package/dist/fields/stories/NullField.stories.js +3 -12
  29. package/dist/fields/stories/NumberField.stories.js +4 -13
  30. package/dist/fields/stories/ObjectField.stories.js +11 -20
  31. package/dist/fields/stories/RadioField.stories.js +8 -17
  32. package/dist/fields/stories/SchemaField.stories.js +24 -17
  33. package/dist/fields/stories/SearchMultiTagSelectField.stories.js +8 -17
  34. package/dist/fields/stories/StringField.stories.js +17 -26
  35. package/dist/fields/stories/TextAreaField.stories.js +4 -13
  36. package/dist/fields/stories/ToggleField.stories.js +6 -15
  37. package/dist/hooks/useExtractUiSchema.js +13 -16
  38. package/dist/pdfFields/AnyField.js +3 -3
  39. package/dist/pdfFields/ArrayField.js +3 -4
  40. package/dist/pdfFields/BooleanField.js +1 -1
  41. package/dist/pdfFields/DateField.js +4 -2
  42. package/dist/pdfFields/EJSField.js +1 -2
  43. package/dist/pdfFields/MultipleChoiceField.js +2 -3
  44. package/dist/pdfFields/NullField.js +1 -1
  45. package/dist/pdfFields/NumberField.js +4 -2
  46. package/dist/pdfFields/ObjectField.js +7 -19
  47. package/dist/pdfFields/RadioField.js +7 -2
  48. package/dist/pdfFields/SchemaField.js +6 -2
  49. package/dist/pdfFields/SearchMultiTagSelectField.js +1 -1
  50. package/dist/pdfFields/SearchableSelectField.js +1 -1
  51. package/dist/pdfFields/StringField.js +2 -3
  52. package/dist/pdfFields/TextAreaField.js +1 -1
  53. package/dist/pdfFields/ToggleField.js +7 -2
  54. package/dist/pdfTemplates/ArrayFieldTemplate.js +1 -1
  55. package/dist/pdfTemplates/CollapsibleObjectFieldTemplate.js +1 -1
  56. package/dist/pdfTemplates/FieldTemplate.js +1 -1
  57. package/dist/pdfTemplates/ObjectFieldTemplate.js +1 -1
  58. package/dist/styledComponents.js +39 -59
  59. package/dist/templates/ArrayFieldTemplate.js +6 -14
  60. package/dist/templates/CollapsibleObjectFieldTemplate.js +6 -14
  61. package/dist/templates/FieldTemplate.js +6 -14
  62. package/dist/templates/ObjectFieldTemplate.js +6 -14
  63. package/dist/utils/__tests/createInitialValues.test.js +2 -11
  64. package/dist/utils/__tests/createValidationSchema.test.js +30 -35
  65. package/dist/utils/__tests/solveReferences.test.js +4 -8
  66. package/dist/utils/createInitialValues.js +9 -7
  67. package/dist/utils/createValidationSchema.js +19 -32
  68. package/dist/utils/getEnums.js +2 -2
  69. package/dist/utils/getTitleAndDescription.js +7 -9
  70. package/dist/utils/hasReferences.js +2 -2
  71. package/dist/utils/resolveSchema.js +16 -30
  72. package/dist/utils/solveReferences.js +3 -4
  73. package/package.json +9 -9
@@ -1,6 +1,11 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { BooleanField } from "./BooleanField";
3
3
  export const ToggleField = (props) => {
4
- var _a;
5
- return (_jsx(BooleanField, Object.assign({}, props, { uiSchema: Object.assign(Object.assign({}, props.uiSchema), { "ui:props": Object.assign(Object.assign({}, (((_a = props.uiSchema) === null || _a === void 0 ? void 0 : _a["ui:props"]) || {})), { type: "boolean" }) }) })));
4
+ return (_jsx(BooleanField, { ...props, uiSchema: {
5
+ ...props.uiSchema,
6
+ "ui:props": {
7
+ ...(props.uiSchema?.["ui:props"] || {}),
8
+ type: "boolean",
9
+ },
10
+ } }));
6
11
  };
@@ -12,5 +12,5 @@ export const ArrayFieldTemplate = (props) => {
12
12
  const { help, info,
13
13
  //TODO: This is not right
14
14
  props: { wrapper: wrapperProps, title: titleProps, description: descriptionProps, help: helpProps, error: errorProps, } = {}, } = useExtractUiSchema(uiSchema);
15
- return (_jsxs(ArrayFieldWrapper, Object.assign({}, wrapperProps, { children: [title && (_jsxs(ArrayFieldTitle, Object.assign({}, titleProps, { htmlFor: name, children: [title, (props === null || props === void 0 ? void 0 : props.required) && _jsx(RequiredIndicator, { children: "*" })] }))), info && _jsx(InfoFieldButton, Object.assign({}, info)), description && (_jsx(FieldDescription, Object.assign({}, descriptionProps, { children: description }))), children, help && _jsx(FieldHelp, Object.assign({}, helpProps, { children: help })), _jsx(ErrorMessage, Object.assign({}, errorProps, { name: name }))] })));
15
+ return (_jsxs(ArrayFieldWrapper, { ...wrapperProps, children: [title && (_jsxs(ArrayFieldTitle, { ...titleProps, htmlFor: name, children: [title, props?.required && _jsx(RequiredIndicator, { children: "*" })] })), info && _jsx(InfoFieldButton, { ...info }), description && (_jsx(FieldDescription, { ...descriptionProps, children: description })), children, help && _jsx(FieldHelp, { ...helpProps, children: help }), _jsx(ErrorMessage, { ...errorProps, name: name })] }));
16
16
  };
@@ -16,5 +16,5 @@ export const CollapsibleObjectFieldTemplate = (props) => {
16
16
  } = {}, } = useExtractUiSchema(uiSchema);
17
17
  const [collapsed, setCollapsed] = useState(isCollapsedOnLoad);
18
18
  const hide = collapsed;
19
- return (_jsxs(CollapsibleObjectFieldWrapper, Object.assign({}, wrapperProps, { children: [title && (_jsx(CollapsibleToggle, { onClick: () => setCollapsed(!collapsed), ariaExpanded: !hide, ariaLabel: ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : name, children: _jsxs(CollapsibleObjectFieldTitle, Object.assign({ style: { display: "flex", alignItems: "center" } }, titleProps, { children: [title, (props === null || props === void 0 ? void 0 : props.required) && _jsx(RequiredIndicator, { children: "*" }), _jsx(Icon, { children: hide ? collapsedIcon !== null && collapsedIcon !== void 0 ? collapsedIcon : "▸" : openIcon !== null && openIcon !== void 0 ? openIcon : "▾" })] })) })), info && _jsx(InfoFieldButton, Object.assign({}, info)), description && (_jsx(FieldDescription, Object.assign({}, descriptionProps, { children: description }))), !hide && _jsx(CollapsibleChildWrapper, { children: children }), help && _jsx(FieldHelp, Object.assign({}, helpProps, { children: help }))] })));
19
+ return (_jsxs(CollapsibleObjectFieldWrapper, { ...wrapperProps, children: [title && (_jsx(CollapsibleToggle, { onClick: () => setCollapsed(!collapsed), ariaExpanded: !hide, ariaLabel: ariaLabel ?? name, children: _jsxs(CollapsibleObjectFieldTitle, { style: { display: "flex", alignItems: "center" }, ...titleProps, children: [title, props?.required && _jsx(RequiredIndicator, { children: "*" }), _jsx(Icon, { children: hide ? collapsedIcon ?? "▸" : openIcon ?? "▾" })] }) })), info && _jsx(InfoFieldButton, { ...info }), description && (_jsx(FieldDescription, { ...descriptionProps, children: description })), !hide && _jsx(CollapsibleChildWrapper, { children: children }), help && _jsx(FieldHelp, { ...helpProps, children: help })] }));
20
20
  };
@@ -11,5 +11,5 @@ export const FieldTemplate = (props) => {
11
11
  const { help,
12
12
  //TODO: This is not right
13
13
  props: { wrapper: wrapperProps, title: titleProps, description: descriptionProps, help: helpProps, } = {}, } = useExtractUiSchema(uiSchema);
14
- return (_jsxs(FieldWrapper, Object.assign({}, wrapperProps, { children: [title && (_jsxs(FieldTitle, Object.assign({}, titleProps, { htmlFor: name, children: [title, props.required && _jsx(RequiredIndicator, { children: "*" })] }))), description && (_jsx(FieldDescription, Object.assign({}, descriptionProps, { children: description }))), children, help && _jsx(FieldHelp, Object.assign({}, helpProps, { children: help }))] })));
14
+ return (_jsxs(FieldWrapper, { ...wrapperProps, children: [title && (_jsxs(FieldTitle, { ...titleProps, htmlFor: name, children: [title, props.required && _jsx(RequiredIndicator, { children: "*" })] })), description && (_jsx(FieldDescription, { ...descriptionProps, children: description })), children, help && _jsx(FieldHelp, { ...helpProps, children: help })] }));
15
15
  };
@@ -14,5 +14,5 @@ export const ObjectFieldTemplate = (props) => {
14
14
  props: { wrapper: wrapperProps, title: titleProps, description: descriptionProps, help: helpProps,
15
15
  // error: errorProps,
16
16
  } = {}, } = useExtractUiSchema(uiSchema);
17
- return (_jsxs(ObjectFieldWrapper, Object.assign({}, wrapperProps, { children: [title && (_jsxs(ObjectFieldTitle, Object.assign({}, titleProps, { children: [title, (props === null || props === void 0 ? void 0 : props.required) && _jsx(RequiredIndicator, { children: "*" })] }))), info && _jsx(InfoFieldButton, Object.assign({}, info)), description && (_jsx(FieldDescription, Object.assign({}, descriptionProps, { children: description }))), children, help && _jsx(FieldHelp, Object.assign({}, helpProps, { children: help }))] })));
17
+ return (_jsxs(ObjectFieldWrapper, { ...wrapperProps, children: [title && (_jsxs(ObjectFieldTitle, { ...titleProps, children: [title, props?.required && _jsx(RequiredIndicator, { children: "*" })] })), info && _jsx(InfoFieldButton, { ...info }), description && (_jsx(FieldDescription, { ...descriptionProps, children: description })), children, help && _jsx(FieldHelp, { ...helpProps, children: help })] }));
18
18
  };
@@ -1,14 +1,3 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
13
2
  import * as formik from "formik";
14
3
  import { useState } from "react";
@@ -44,18 +33,17 @@ export const ObjectFieldDownButton = styled(ObjectFieldLineButton) ``;
44
33
  export const ObjectFieldRemoveButton = styled(ObjectFieldLineButton) ``;
45
34
  export const ObjectFieldAddButton = styled(ObjectFieldButton) ``;
46
35
  export const getObjectFieldButton = ({ purpose, onClick, uiSchema, }) => {
47
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
48
36
  switch (purpose) {
49
37
  case ObjectFieldButtonPurpose.ADD:
50
- return (_jsx(ObjectFieldAddButton, Object.assign({}, ((_b = (_a = uiSchema === null || uiSchema === void 0 ? void 0 : uiSchema["ui:addButtonOptions"]) === null || _a === void 0 ? void 0 : _a.props) !== null && _b !== void 0 ? _b : {}), { onClick: onClick, children: (_d = (_c = uiSchema === null || uiSchema === void 0 ? void 0 : uiSchema["ui:addButtonOptions"]) === null || _c === void 0 ? void 0 : _c.content) !== null && _d !== void 0 ? _d : "+" })));
38
+ return (_jsx(ObjectFieldAddButton, { ...(uiSchema?.["ui:addButtonOptions"]?.props ?? {}), onClick: onClick, children: uiSchema?.["ui:addButtonOptions"]?.content ?? "+" }));
51
39
  case ObjectFieldButtonPurpose.REMOVE:
52
- return (_jsx(ObjectFieldRemoveButton, Object.assign({}, ((_f = (_e = uiSchema === null || uiSchema === void 0 ? void 0 : uiSchema["ui:removeButtonOptions"]) === null || _e === void 0 ? void 0 : _e.props) !== null && _f !== void 0 ? _f : {}), { onClick: onClick, children: (_h = (_g = uiSchema === null || uiSchema === void 0 ? void 0 : uiSchema["ui:removeButtonOptions"]) === null || _g === void 0 ? void 0 : _g.content) !== null && _h !== void 0 ? _h : "-" })));
40
+ return (_jsx(ObjectFieldRemoveButton, { ...(uiSchema?.["ui:removeButtonOptions"]?.props ?? {}), onClick: onClick, children: uiSchema?.["ui:removeButtonOptions"]?.content ?? "-" }));
53
41
  case ObjectFieldButtonPurpose.MOVE_UP:
54
- return (_jsx(ObjectFieldUpButton, Object.assign({}, ((_k = (_j = uiSchema === null || uiSchema === void 0 ? void 0 : uiSchema["ui:upButtonOptions"]) === null || _j === void 0 ? void 0 : _j.props) !== null && _k !== void 0 ? _k : {}), { onClick: onClick, children: (_m = (_l = uiSchema === null || uiSchema === void 0 ? void 0 : uiSchema["ui:upButtonOptions"]) === null || _l === void 0 ? void 0 : _l.content) !== null && _m !== void 0 ? _m : "↑" })));
42
+ return (_jsx(ObjectFieldUpButton, { ...(uiSchema?.["ui:upButtonOptions"]?.props ?? {}), onClick: onClick, children: uiSchema?.["ui:upButtonOptions"]?.content ?? "↑" }));
55
43
  case ObjectFieldButtonPurpose.MOVE_DOWN:
56
- return (_jsx(ObjectFieldDownButton, Object.assign({}, ((_p = (_o = uiSchema === null || uiSchema === void 0 ? void 0 : uiSchema["ui:downButtonOptions"]) === null || _o === void 0 ? void 0 : _o.props) !== null && _p !== void 0 ? _p : {}), { onClick: onClick, children: (_r = (_q = uiSchema === null || uiSchema === void 0 ? void 0 : uiSchema["ui:downButtonOptions"]) === null || _q === void 0 ? void 0 : _q.content) !== null && _r !== void 0 ? _r : "↓" })));
44
+ return (_jsx(ObjectFieldDownButton, { ...(uiSchema?.["ui:downButtonOptions"]?.props ?? {}), onClick: onClick, children: uiSchema?.["ui:downButtonOptions"]?.content ?? "↓" }));
57
45
  default:
58
- return (_jsx(ObjectFieldButton, Object.assign({}, ((_t = (_s = uiSchema === null || uiSchema === void 0 ? void 0 : uiSchema["ui:customButtonOptions"]) === null || _s === void 0 ? void 0 : _s.props) !== null && _t !== void 0 ? _t : {}), { onClick: onClick, children: (_v = (_u = uiSchema === null || uiSchema === void 0 ? void 0 : uiSchema["ui:customButtonOptions"]) === null || _u === void 0 ? void 0 : _u.content) !== null && _v !== void 0 ? _v : "" })));
46
+ return (_jsx(ObjectFieldButton, { ...(uiSchema?.["ui:customButtonOptions"]?.props ?? {}), onClick: onClick, children: uiSchema?.["ui:customButtonOptions"]?.content ?? "" }));
59
47
  }
60
48
  };
61
49
  export const ArrayFieldWrapper = ObjectFieldWrapper;
@@ -174,7 +162,7 @@ export const InfoFieldContainerElement = styled.a `
174
162
  `;
175
163
  export const InfoFieldLabel = styled.span ``;
176
164
  export const InfoFieldButton = ({ label, content, position, props, className, }) => {
177
- return (_jsxs(InfoFieldContainerElement, { href: "#", onClick: (e) => e.preventDefault(), className: className, children: [_jsx(InfoFieldLabel, { children: label !== null && label !== void 0 ? label : "i" }), _jsxs(InfoFieldBoxElement, { position: position !== null && position !== void 0 ? position : "top", role: "tooltip", children: [_jsx(InfoFieldBoxArrowElement, { position: position !== null && position !== void 0 ? position : "top" }), _jsx(InfoFieldBoxInnerElement, { children: content })] })] }));
165
+ return (_jsxs(InfoFieldContainerElement, { href: "#", onClick: (e) => e.preventDefault(), className: className, children: [_jsx(InfoFieldLabel, { children: label ?? "i" }), _jsxs(InfoFieldBoxElement, { position: position ?? "top", role: "tooltip", children: [_jsx(InfoFieldBoxArrowElement, { position: position ?? "top" }), _jsx(InfoFieldBoxInnerElement, { children: content })] })] }));
178
166
  };
179
167
  InfoFieldButton.styles = {
180
168
  InfoFieldContainerElementStyle: InfoFieldContainerElement,
@@ -189,9 +177,8 @@ export const ErrorMessage = styled(formik.ErrorMessage) ``;
189
177
  * Works like Formik field, but "as" props needs to be given with "formikAs", since styled components uses as.
190
178
  *
191
179
  */
192
- export const FieldInput = styled((_a) => {
193
- var { formikAs } = _a, props = __rest(_a, ["formikAs"]);
194
- return _jsx(formik.Field, Object.assign({}, props, { as: formikAs }));
180
+ export const FieldInput = styled(({ formikAs, ...props }) => {
181
+ return _jsx(formik.Field, { ...props, as: formikAs });
195
182
  }) ``;
196
183
  export const RequiredIndicator = styled.span ``;
197
184
  // ToggleSwitchField --->
@@ -243,7 +230,7 @@ export const ToggleFieldInput = styled(FieldInput) `
243
230
  }
244
231
  `;
245
232
  export const ToggleSwitchField = ({ inputProps, name, className, }) => {
246
- return (_jsxs(ToggleLabel, { className: className, children: [_jsx(ToggleFieldInput, Object.assign({}, inputProps, { name: name, type: "checkbox" })), _jsx(Toggle, {})] }));
233
+ return (_jsxs(ToggleLabel, { className: className, children: [_jsx(ToggleFieldInput, { ...inputProps, name: name, type: "checkbox" }), _jsx(Toggle, {})] }));
247
234
  };
248
235
  ToggleSwitchField.styles = {
249
236
  ToggleLabelStyle: ToggleLabel,
@@ -270,8 +257,7 @@ export const ButtonLabel = styled.span `
270
257
  export const ButtonLabelTrue = styled(ButtonLabel) ``;
271
258
  export const ButtonLabelFalse = styled(ButtonLabel) ``;
272
259
  export const RadioButtonField = ({ label, inputProps, name, className, }) => {
273
- var _a, _b;
274
- return (_jsxs(RadioButtonFieldContainer, { className: className, children: [_jsxs(RadioButtonFieldElement, { children: [_jsx(RadioButtonFieldInput, Object.assign({}, inputProps, { name: name, type: "radio", value: "true" })), _jsx(ButtonLabelTrue, { children: (_a = label === null || label === void 0 ? void 0 : label.true) !== null && _a !== void 0 ? _a : "true" })] }), _jsxs(RadioButtonFieldElement, { children: [_jsx(RadioButtonFieldInput, Object.assign({}, inputProps, { name: name, type: "radio", value: "false" })), _jsx(ButtonLabelFalse, { children: (_b = label === null || label === void 0 ? void 0 : label.false) !== null && _b !== void 0 ? _b : "false" })] })] }));
260
+ return (_jsxs(RadioButtonFieldContainer, { className: className, children: [_jsxs(RadioButtonFieldElement, { children: [_jsx(RadioButtonFieldInput, { ...inputProps, name: name, type: "radio", value: "true" }), _jsx(ButtonLabelTrue, { children: label?.true ?? "true" })] }), _jsxs(RadioButtonFieldElement, { children: [_jsx(RadioButtonFieldInput, { ...inputProps, name: name, type: "radio", value: "false" }), _jsx(ButtonLabelFalse, { children: label?.false ?? "false" })] })] }));
275
261
  };
276
262
  RadioButtonField.styles = {
277
263
  RadioButtonFieldContainerStyle: RadioButtonFieldContainer,
@@ -303,15 +289,15 @@ export const MultipleChoiceField = ({ inputProps, name, className, enums, style,
303
289
  const newValue = isChecked(optionValue)
304
290
  ? currentValue.filter((v) => v !== optionValue)
305
291
  : [...currentValue, optionValue];
306
- form === null || form === void 0 ? void 0 : form.setFieldValue(name, newValue);
292
+ form?.setFieldValue(name, newValue);
307
293
  }
308
294
  else {
309
- form === null || form === void 0 ? void 0 : form.setFieldValue(name, optionValue);
295
+ form?.setFieldValue(name, optionValue);
310
296
  }
311
297
  };
312
- return (_jsx(MultipleChoiceFieldContainer, { className: className, style: getStyle(style !== null && style !== void 0 ? style : ""), children: enums.values.map((v) => {
298
+ return (_jsx(MultipleChoiceFieldContainer, { className: className, style: getStyle(style ?? ""), children: enums.values.map((v) => {
313
299
  const optionValue = v.const;
314
- return (_jsxs(MultipleChoiceFieldElement, { "data-fjsf-enum-value": optionValue, children: [_jsx(MultipleChoiceFieldInput, Object.assign({}, inputProps, { name: name, type: isMultiSelect ? "checkbox" : "radio", value: optionValue !== undefined ? optionValue.toString() : "", checked: isChecked(optionValue), onChange: () => handleChange(optionValue) })), _jsx(MultipleChoiceFieldLabel, { children: v.title })] }, optionValue !== undefined ? optionValue.toString() : "undefined"));
300
+ return (_jsxs(MultipleChoiceFieldElement, { "data-fjsf-enum-value": optionValue, children: [_jsx(MultipleChoiceFieldInput, { ...inputProps, name: name, type: isMultiSelect ? "checkbox" : "radio", value: optionValue !== undefined ? optionValue.toString() : "", checked: isChecked(optionValue), onChange: () => handleChange(optionValue) }), _jsx(MultipleChoiceFieldLabel, { children: v.title })] }, optionValue !== undefined ? optionValue.toString() : "undefined"));
315
301
  }) }));
316
302
  };
317
303
  MultipleChoiceField.styles = {
@@ -380,24 +366,21 @@ export const MultiSelectOptionListWithoutItem = styled.li `
380
366
  export const SearchableMultiTagSelectField = ({ name, placeholder, enums, emptySearchMessage, closeElement, className, }) => {
381
367
  const [search, setSearch] = useState("");
382
368
  const searchIncludedInEnum = () => {
383
- const hasValue = enums === null || enums === void 0 ? void 0 : enums.values.map((value) => value.title.toLowerCase().includes(search.toLowerCase()));
384
- return hasValue === null || hasValue === void 0 ? void 0 : hasValue.includes(true);
369
+ const hasValue = enums?.values.map((value) => value.title.toLowerCase().includes(search.toLowerCase()));
370
+ return hasValue?.includes(true);
385
371
  };
386
- return (_jsx(formik.Field, { className: className, name: name, multiple: true, children: ({ field, form: { setFieldValue }, meta, }) => {
387
- var _a;
388
- return (_jsxs(MultiSelectContainer, { className: className, children: [_jsx(FieldInput, Object.assign({ id: className, type: "hidden" }, field)), _jsxs(MultiSelectSearchContainer, { children: [_jsx(MultiSelectInput, { id: className + "_id", className: className, type: "text", onChange: (e) => {
389
- setSearch(e.currentTarget.value);
390
- }, placeholder: placeholder, value: search }), search.length > 0 && (_jsx(MultiSelectOptionList, { children: searchIncludedInEnum() ? (enums === null || enums === void 0 ? void 0 : enums.values.filter((item) => { var _a; return !((_a = field.value) !== null && _a !== void 0 ? _a : []).includes(item.const); }).filter((value) => value.title.toLowerCase().includes(search.toLowerCase())).map((option, index) => (_jsx(MultiSelectOptionListItem, { value: option.const, onClick: () => {
391
- var _a;
392
- setFieldValue(name, [
393
- ...new Set([...((_a = field.value) !== null && _a !== void 0 ? _a : []), option.const]),
394
- ]);
395
- setSearch("");
396
- }, children: option.title }, index)))) : (_jsx(MultiSelectOptionListWithoutItem, { children: emptySearchMessage !== null && emptySearchMessage !== void 0 ? emptySearchMessage : "No match found" })) }))] }), _jsx(MultiSelectBadgeContainer, { children: ((_a = field.value) !== null && _a !== void 0 ? _a : []).map((value) => {
397
- var _a;
398
- return (_jsxs(MultiSelectBadge, { children: [(_a = enums === null || enums === void 0 ? void 0 : enums.values.find((option) => option.const === value)) === null || _a === void 0 ? void 0 : _a.title, _jsx(MultiSelectBadgeCloseElement, { onClick: () => setFieldValue(name, field.value.filter((v) => v !== value)), children: closeElement !== null && closeElement !== void 0 ? closeElement : "x" })] }, value));
399
- }) }), meta.touched && meta.error && (_jsx("div", { className: "error", children: meta.error }))] }));
400
- } }));
372
+ return (_jsx(formik.Field, { className: className, name: name, multiple: true, children: ({ field, form: { setFieldValue }, meta, }) => (_jsxs(MultiSelectContainer, { className: className, children: [_jsx(FieldInput, { id: className, type: "hidden", ...field }), _jsxs(MultiSelectSearchContainer, { children: [_jsx(MultiSelectInput, { id: className + "_id", className: className, type: "text", onChange: (e) => {
373
+ setSearch(e.currentTarget.value);
374
+ }, placeholder: placeholder, value: search }), search.length > 0 && (_jsx(MultiSelectOptionList, { children: searchIncludedInEnum() ? (enums?.values
375
+ .filter((item) => !(field.value ?? []).includes(item.const))
376
+ .filter((value) => value.title.toLowerCase().includes(search.toLowerCase()))
377
+ .map((option, index) => (_jsx(MultiSelectOptionListItem, { value: option.const, onClick: () => {
378
+ setFieldValue(name, [
379
+ ...new Set([...(field.value ?? []), option.const]),
380
+ ]);
381
+ setSearch("");
382
+ }, children: option.title }, index)))) : (_jsx(MultiSelectOptionListWithoutItem, { children: emptySearchMessage ?? "No match found" })) }))] }), _jsx(MultiSelectBadgeContainer, { children: (field.value ?? []).map((value) => (_jsxs(MultiSelectBadge, { children: [enums?.values.find((option) => option.const === value)
383
+ ?.title, _jsx(MultiSelectBadgeCloseElement, { onClick: () => setFieldValue(name, field.value.filter((v) => v !== value)), children: closeElement ?? "x" })] }, value))) }), meta.touched && meta.error && (_jsx("div", { className: "error", children: meta.error }))] })) }));
401
384
  };
402
385
  SearchableMultiTagSelectField.styles = {
403
386
  MultiSelectContainerStyle: MultiSelectContainer,
@@ -415,7 +398,7 @@ export const TextAreaFieldInput = styled(FieldInput) `
415
398
  min-height: 5rem;
416
399
  `;
417
400
  export const TextAreaInputField = ({ inputProps, name, className, }) => {
418
- return _jsx(TextAreaFieldInput, Object.assign({}, inputProps, { name: name, formikAs: "textarea" }));
401
+ return _jsx(TextAreaFieldInput, { ...inputProps, name: name, formikAs: "textarea" });
419
402
  };
420
403
  export const BooleanFieldWrapper = styled.div `
421
404
  display: flex;
@@ -531,17 +514,11 @@ const NotSelectedCircle = styled.span `
531
514
  width: 1rem;
532
515
  `;
533
516
  export const MultipleChoiceFieldPdf = ({ inputProps, name, className, style, selected, notSelected, }) => {
534
- return (_jsxs(MultipleChoiceFieldContainer, { className: className, style: getStyle(style !== null && style !== void 0 ? style : ""), children: [!selected && !notSelected && _jsx(_Fragment, { children: "Nothing was selected" }), selected &&
517
+ return (_jsxs(MultipleChoiceFieldContainer, { className: className, style: getStyle(style ?? ""), children: [!selected && !notSelected && _jsx(_Fragment, { children: "Nothing was selected" }), selected &&
535
518
  selected.length > 0 &&
536
- selected.map((s) => {
537
- var _a, _b;
538
- return (_jsx(MultipleChoiceFieldElement, { children: _jsxs(Selected, { children: [_jsx(SelectedBox, { children: "\u2713" }), _jsx(MultipleChoiceFieldLabel, { children: (_a = s.title) !== null && _a !== void 0 ? _a : "Hello" })] }) }, (_b = s.title) !== null && _b !== void 0 ? _b : s));
539
- }), notSelected &&
540
- (notSelected === null || notSelected === void 0 ? void 0 : notSelected.length) > 0 &&
541
- notSelected.map((n) => {
542
- var _a;
543
- return (_jsx(MultipleChoiceFieldElement, { children: _jsxs(NotSelected, { children: [_jsx(NotSelectedCircle, { children: "\u2715" }), _jsx(MultipleChoiceFieldLabel, { children: n.title })] }) }, (_a = n.title) !== null && _a !== void 0 ? _a : n));
544
- })] }));
519
+ selected.map((s) => (_jsx(MultipleChoiceFieldElement, { children: _jsxs(Selected, { children: [_jsx(SelectedBox, { children: "\u2713" }), _jsx(MultipleChoiceFieldLabel, { children: s.title ?? "Hello" })] }) }, s.title ?? s))), notSelected &&
520
+ notSelected?.length > 0 &&
521
+ notSelected.map((n) => (_jsx(MultipleChoiceFieldElement, { children: _jsxs(NotSelected, { children: [_jsx(NotSelectedCircle, { children: "\u2715" }), _jsx(MultipleChoiceFieldLabel, { children: n.title })] }) }, n.title ?? n)))] }));
545
522
  };
546
523
  // --> FileUploadField
547
524
  export const FileUploadButton = styled.button `
@@ -597,14 +574,17 @@ export const FileInfoText = styled.span `
597
574
  `;
598
575
  export const FileUploadFieldContainer = styled.div ``;
599
576
  export const FileUploadField = ({ name, uploadedFile, handleFileUpload, value, setFieldValue, className, uploadProgress, handleRemoveFile, removeButton, uploadButtonText, infoText, hideRemoveButton, }) => {
600
- var _a, _b, _c;
601
- return (_jsxs(FileUploadFieldContainer, { className: className, children: [_jsxs("div", { children: [_jsx(FileUploadButton, { type: "button", onClick: () => { var _a; return (_a = document.getElementById(name)) === null || _a === void 0 ? void 0 : _a.click(); }, children: uploadButtonText !== null && uploadButtonText !== void 0 ? uploadButtonText : "Choose File" }), _jsx(HiddenFileInput, { id: name, name: name, type: "file", onChange: (event) => {
577
+ return (_jsxs(FileUploadFieldContainer, { className: className, children: [_jsxs("div", { children: [_jsx(FileUploadButton, { type: "button", onClick: () => document.getElementById(name)?.click(), children: uploadButtonText ?? "Choose File" }), _jsx(HiddenFileInput, { id: name, name: name, type: "file", onChange: (event) => {
602
578
  const file = event.currentTarget.files[0];
603
579
  if (file) {
604
580
  handleFileUpload(file, setFieldValue);
605
581
  event.target.value = null;
606
582
  }
607
- } }), !value ? (_jsx(FileInfoText, { children: infoText !== null && infoText !== void 0 ? infoText : "No file chosen" })) : null] }), uploadedFile && value && (_jsx(FileItemContainer, { children: uploadProgress === 100 ? (_jsxs(_Fragment, { children: [_jsx("span", { children: uploadedFile.name }), !hideRemoveButton && (_jsx(RemoveButton, Object.assign({ type: "button", onClick: () => handleRemoveFile(setFieldValue) }, removeButton === null || removeButton === void 0 ? void 0 : removeButton.props, { style: Object.assign({ color: "red", fontWeight: "bold" }, ((_b = (_a = removeButton === null || removeButton === void 0 ? void 0 : removeButton.props) === null || _a === void 0 ? void 0 : _a.style) !== null && _b !== void 0 ? _b : {})), children: (_c = removeButton === null || removeButton === void 0 ? void 0 : removeButton.content) !== null && _c !== void 0 ? _c : "X" })))] })) : (_jsxs(_Fragment, { children: [_jsx("span", { children: uploadedFile.name }), _jsxs(ProgressBarContainer, { children: [_jsx(ProgressBar, { "$progress": uploadProgress }), _jsxs(ProgressText, { children: [uploadProgress, "%"] })] })] })) }))] }));
583
+ } }), !value ? (_jsx(FileInfoText, { children: infoText ?? "No file chosen" })) : null] }), uploadedFile && value && (_jsx(FileItemContainer, { children: uploadProgress === 100 ? (_jsxs(_Fragment, { children: [_jsx("span", { children: uploadedFile.name }), !hideRemoveButton && (_jsx(RemoveButton, { type: "button", onClick: () => handleRemoveFile(setFieldValue), ...removeButton?.props, style: {
584
+ color: "red",
585
+ fontWeight: "bold",
586
+ ...(removeButton?.props?.style ?? {}),
587
+ }, children: removeButton?.content ?? "X" }))] })) : (_jsxs(_Fragment, { children: [_jsx("span", { children: uploadedFile.name }), _jsxs(ProgressBarContainer, { children: [_jsx(ProgressBar, { "$progress": uploadProgress }), _jsxs(ProgressText, { children: [uploadProgress, "%"] })] })] })) }))] }));
608
588
  };
609
589
  FileUploadField.styles = {
610
590
  FileUploadFieldFileUploadFieldContainerStyle: FileUploadFieldContainer,
@@ -1,14 +1,3 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
2
  import { useContext } from "react";
14
3
  import { FormRegistry } from "../Form";
@@ -18,7 +7,7 @@ import { RequiredIndicator } from "../styledComponents";
18
7
  import { getIn, useFormikContext } from "formik";
19
8
  export const ArrayFieldTemplate = (props) => {
20
9
  const { components: { ArrayFieldWrapper, ArrayFieldTitle, FieldDescription, ErrorMessage, FieldHelp, InfoFieldButton, }, } = useContext(FormRegistry);
21
- const { name, uiSchema, children } = props, otherProps = __rest(props, ["name", "uiSchema", "children"]);
10
+ const { name, uiSchema, children, ...otherProps } = props;
22
11
  const title = getTitle(props);
23
12
  const description = getDescription(props);
24
13
  const { help, info,
@@ -30,7 +19,10 @@ export const ArrayFieldTemplate = (props) => {
30
19
  acc[key] = otherProps[key];
31
20
  return acc;
32
21
  }, {});
33
- const mergedWrapperProps = Object.assign(Object.assign({}, wrapperProps), dataAttributes);
22
+ const mergedWrapperProps = {
23
+ ...wrapperProps,
24
+ ...dataAttributes,
25
+ };
34
26
  // These lines make sure the error message is a string, which means the error
35
27
  // is actually for the whole Array component, not for one of the children.
36
28
  const { errors } = useFormikContext();
@@ -38,5 +30,5 @@ export const ArrayFieldTemplate = (props) => {
38
30
  // In case of array of objects, it will give error message as an object value,
39
31
  // which is incorrect value for React, causing UI to crash.
40
32
  const errorIsString = typeof error === "string";
41
- return (_jsxs(ArrayFieldWrapper, Object.assign({}, mergedWrapperProps, { children: [title && (_jsxs(ArrayFieldTitle, Object.assign({}, titleProps, { htmlFor: name, children: [title, (props === null || props === void 0 ? void 0 : props.required) && _jsx(RequiredIndicator, { children: "*" })] }))), info && _jsx(InfoFieldButton, Object.assign({}, info)), description && (_jsx(FieldDescription, Object.assign({}, descriptionProps, { children: description }))), children, help && _jsx(FieldHelp, Object.assign({}, helpProps, { children: help })), errorIsString && _jsx(ErrorMessage, Object.assign({}, errorProps, { name: name }))] })));
33
+ return (_jsxs(ArrayFieldWrapper, { ...mergedWrapperProps, children: [title && (_jsxs(ArrayFieldTitle, { ...titleProps, htmlFor: name, children: [title, props?.required && _jsx(RequiredIndicator, { children: "*" })] })), info && _jsx(InfoFieldButton, { ...info }), description && (_jsx(FieldDescription, { ...descriptionProps, children: description })), children, help && _jsx(FieldHelp, { ...helpProps, children: help }), errorIsString && _jsx(ErrorMessage, { ...errorProps, name: name })] }));
42
34
  };
@@ -1,14 +1,3 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
2
  import { useContext, useState } from "react";
14
3
  import { FormRegistry } from "../Form";
@@ -17,7 +6,7 @@ import { useExtractUiSchema } from "../hooks";
17
6
  import { CollapsibleChildWrapper, CollapsibleToggle, Icon, RequiredIndicator, } from "../styledComponents";
18
7
  export const CollapsibleObjectFieldTemplate = (props) => {
19
8
  const { components: { FieldDescription, CollapsibleObjectFieldTitle, CollapsibleObjectFieldWrapper, FieldHelp, InfoFieldButton, }, } = useContext(FormRegistry);
20
- const { children, name, uiSchema } = props, otherProps = __rest(props, ["children", "name", "uiSchema"]);
9
+ const { children, name, uiSchema, ...otherProps } = props;
21
10
  const title = getTitle(props);
22
11
  const description = getDescription(props);
23
12
  const { help, info,
@@ -31,8 +20,11 @@ export const CollapsibleObjectFieldTemplate = (props) => {
31
20
  acc[key] = otherProps[key];
32
21
  return acc;
33
22
  }, {});
34
- const mergedWrapperProps = Object.assign(Object.assign({}, wrapperProps), dataAttributes);
23
+ const mergedWrapperProps = {
24
+ ...wrapperProps,
25
+ ...dataAttributes,
26
+ };
35
27
  const [collapsed, setCollapsed] = useState(isCollapsedOnLoad);
36
28
  const hide = collapsed;
37
- return (_jsxs(CollapsibleObjectFieldWrapper, Object.assign({}, mergedWrapperProps, { children: [title && (_jsx(CollapsibleToggle, { onClick: () => setCollapsed(!collapsed), ariaExpanded: !hide, ariaLabel: ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : name, children: _jsxs(CollapsibleObjectFieldTitle, Object.assign({ style: { display: "flex", alignItems: "center" } }, titleProps, { children: [title, (props === null || props === void 0 ? void 0 : props.required) && _jsx(RequiredIndicator, { children: "*" }), _jsx(Icon, { children: hide ? collapsedIcon !== null && collapsedIcon !== void 0 ? collapsedIcon : "▸" : openIcon !== null && openIcon !== void 0 ? openIcon : "▾" })] })) })), info && _jsx(InfoFieldButton, Object.assign({}, info)), description && (_jsx(FieldDescription, Object.assign({}, descriptionProps, { children: description }))), !hide && _jsx(CollapsibleChildWrapper, { children: children }), help && _jsx(FieldHelp, Object.assign({}, helpProps, { children: help }))] })));
29
+ return (_jsxs(CollapsibleObjectFieldWrapper, { ...mergedWrapperProps, children: [title && (_jsx(CollapsibleToggle, { onClick: () => setCollapsed(!collapsed), ariaExpanded: !hide, ariaLabel: ariaLabel ?? name, children: _jsxs(CollapsibleObjectFieldTitle, { style: { display: "flex", alignItems: "center" }, ...titleProps, children: [title, props?.required && _jsx(RequiredIndicator, { children: "*" }), _jsx(Icon, { children: hide ? collapsedIcon ?? "▸" : openIcon ?? "▾" })] }) })), info && _jsx(InfoFieldButton, { ...info }), description && (_jsx(FieldDescription, { ...descriptionProps, children: description })), !hide && _jsx(CollapsibleChildWrapper, { children: children }), help && _jsx(FieldHelp, { ...helpProps, children: help })] }));
38
30
  };
@@ -1,14 +1,3 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
2
  import { useContext } from "react";
14
3
  import { FormRegistry } from "../Form";
@@ -16,7 +5,7 @@ import { getDescription, getTitle } from "../utils";
16
5
  import { useExtractUiSchema } from "../hooks";
17
6
  export const FieldTemplate = (props) => {
18
7
  const { components: { FieldWrapper, FieldTitle, FieldDescription, ErrorMessage, FieldHelp, RequiredIndicator, InfoFieldButton, }, } = useContext(FormRegistry);
19
- const { name, uiSchema, children } = props, otherProps = __rest(props, ["name", "uiSchema", "children"]);
8
+ const { name, uiSchema, children, ...otherProps } = props;
20
9
  const title = getTitle(props);
21
10
  const description = getDescription(props);
22
11
  const { help, info, props: { wrapper: wrapperProps = {}, title: titleProps, description: descriptionProps, help: helpProps, error: errorProps, } = {}, } = useExtractUiSchema(uiSchema);
@@ -27,6 +16,9 @@ export const FieldTemplate = (props) => {
27
16
  return acc;
28
17
  }, {});
29
18
  // Merge the wrapperProps with the filtered dataAttributes
30
- const mergedWrapperProps = Object.assign(Object.assign({}, wrapperProps), dataAttributes);
31
- return (_jsxs(FieldWrapper, Object.assign({}, mergedWrapperProps, { children: [title && (_jsxs(FieldTitle, Object.assign({}, titleProps, { htmlFor: name, children: [title, props.required && _jsx(RequiredIndicator, { children: "*" })] }))), info && _jsx(InfoFieldButton, Object.assign({}, info)), description && (_jsx(FieldDescription, Object.assign({}, descriptionProps, { children: description }))), children, help && _jsx(FieldHelp, Object.assign({}, helpProps, { children: help })), _jsx(ErrorMessage, Object.assign({}, errorProps, { name: name }))] })));
19
+ const mergedWrapperProps = {
20
+ ...wrapperProps,
21
+ ...dataAttributes, // This will only include data-* attributes
22
+ };
23
+ return (_jsxs(FieldWrapper, { ...mergedWrapperProps, children: [title && (_jsxs(FieldTitle, { ...titleProps, htmlFor: name, children: [title, props.required && _jsx(RequiredIndicator, { children: "*" })] })), info && _jsx(InfoFieldButton, { ...info }), description && (_jsx(FieldDescription, { ...descriptionProps, children: description })), children, help && _jsx(FieldHelp, { ...helpProps, children: help }), _jsx(ErrorMessage, { ...errorProps, name: name })] }));
32
24
  };
@@ -1,14 +1,3 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
2
  import { useContext } from "react";
14
3
  import { FormRegistry } from "../Form";
@@ -17,7 +6,7 @@ import { useExtractUiSchema } from "../hooks";
17
6
  import { RequiredIndicator } from "../styledComponents";
18
7
  export const ObjectFieldTemplate = (props) => {
19
8
  const { components: { FieldDescription, ObjectFieldTitle, ObjectFieldWrapper, FieldHelp, InfoFieldButton, }, } = useContext(FormRegistry);
20
- const { children, uiSchema } = props, otherProps = __rest(props, ["children", "uiSchema"]);
9
+ const { children, uiSchema, ...otherProps } = props;
21
10
  const title = getTitle(props);
22
11
  const description = getDescription(props);
23
12
  const { help, info,
@@ -31,6 +20,9 @@ export const ObjectFieldTemplate = (props) => {
31
20
  acc[key] = otherProps[key];
32
21
  return acc;
33
22
  }, {});
34
- const mergedWrapperProps = Object.assign(Object.assign({}, wrapperProps), dataAttributes);
35
- return (_jsxs(ObjectFieldWrapper, Object.assign({}, mergedWrapperProps, { children: [title && (_jsxs(ObjectFieldTitle, Object.assign({}, titleProps, { children: [title, (props === null || props === void 0 ? void 0 : props.required) && _jsx(RequiredIndicator, { children: "*" })] }))), info && _jsx(InfoFieldButton, Object.assign({}, info)), description && (_jsx(FieldDescription, Object.assign({}, descriptionProps, { children: description }))), children, help && _jsx(FieldHelp, Object.assign({}, helpProps, { children: help }))] })));
23
+ const mergedWrapperProps = {
24
+ ...wrapperProps,
25
+ ...dataAttributes,
26
+ };
27
+ return (_jsxs(ObjectFieldWrapper, { ...mergedWrapperProps, children: [title && (_jsxs(ObjectFieldTitle, { ...titleProps, children: [title, props?.required && _jsx(RequiredIndicator, { children: "*" })] })), info && _jsx(InfoFieldButton, { ...info }), description && (_jsx(FieldDescription, { ...descriptionProps, children: description })), children, help && _jsx(FieldHelp, { ...helpProps, children: help })] }));
36
28
  };
@@ -1,12 +1,3 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
1
  import { ageFieldDefinition } from "../../sampleData/ageFieldDefinition";
11
2
  import { createInitialValues } from "../createInitialValues";
12
3
  const exampleSchema = {
@@ -60,7 +51,7 @@ const exampleSchema = {
60
51
  },
61
52
  };
62
53
  describe("Create Initial Values", () => {
63
- it("creates for an object type", () => __awaiter(void 0, void 0, void 0, function* () {
54
+ it("creates for an object type", async () => {
64
55
  const result = createInitialValues(exampleSchema);
65
56
  const expected = {
66
57
  name: "",
@@ -109,5 +100,5 @@ describe("Create Initial Values", () => {
109
100
  },
110
101
  },
111
102
  };
112
- }));
103
+ });
113
104
  });