@rjsf/core 6.0.0-beta.10 → 6.0.0-beta.11
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.umd.js +49 -28
- package/dist/index.esm.js +205 -180
- package/dist/index.esm.js.map +4 -4
- package/dist/index.js +151 -127
- package/dist/index.js.map +4 -4
- package/lib/components/fields/MultiSchemaField.d.ts.map +1 -1
- package/lib/components/fields/MultiSchemaField.js +7 -3
- package/lib/components/templates/MultiSchemaFieldTemplate.d.ts +8 -0
- package/lib/components/templates/MultiSchemaFieldTemplate.d.ts.map +1 -0
- package/lib/components/templates/MultiSchemaFieldTemplate.js +10 -0
- package/lib/components/templates/index.d.ts.map +1 -1
- package/lib/components/templates/index.js +2 -0
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/src/components/fields/MultiSchemaField.tsx +45 -29
- package/src/components/templates/MultiSchemaFieldTemplate.tsx +20 -0
- package/src/components/templates/index.ts +2 -0
package/dist/core.umd.js
CHANGED
|
@@ -1660,6 +1660,11 @@
|
|
|
1660
1660
|
} = this.props;
|
|
1661
1661
|
const { widgets: widgets2, fields: fields2, translateString, globalUiOptions, schemaUtils } = registry;
|
|
1662
1662
|
const { SchemaField: _SchemaField } = fields2;
|
|
1663
|
+
const MultiSchemaFieldTemplate2 = utils.getTemplate(
|
|
1664
|
+
"MultiSchemaFieldTemplate",
|
|
1665
|
+
registry,
|
|
1666
|
+
globalUiOptions
|
|
1667
|
+
);
|
|
1663
1668
|
const { selectedOption, retrievedOptions } = this.state;
|
|
1664
1669
|
const {
|
|
1665
1670
|
widget = "select",
|
|
@@ -1706,34 +1711,42 @@
|
|
|
1706
1711
|
value: index
|
|
1707
1712
|
};
|
|
1708
1713
|
});
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1714
|
+
const selector = /* @__PURE__ */ jsxRuntime.jsx(
|
|
1715
|
+
Widget,
|
|
1716
|
+
{
|
|
1717
|
+
id: this.getFieldId(),
|
|
1718
|
+
name: `${name}${schema.oneOf ? "__oneof_select" : "__anyof_select"}`,
|
|
1719
|
+
schema: { type: "number", default: 0 },
|
|
1720
|
+
onChange: this.onOptionChange,
|
|
1721
|
+
onBlur,
|
|
1722
|
+
onFocus,
|
|
1723
|
+
disabled: disabled || isEmpty(enumOptions),
|
|
1724
|
+
multiple: false,
|
|
1725
|
+
rawErrors,
|
|
1726
|
+
errorSchema: fieldErrorSchema,
|
|
1727
|
+
value: selectedOption >= 0 ? selectedOption : void 0,
|
|
1728
|
+
options: { enumOptions, ...uiOptions },
|
|
1729
|
+
registry,
|
|
1730
|
+
formContext,
|
|
1731
|
+
placeholder,
|
|
1732
|
+
autocomplete,
|
|
1733
|
+
autofocus,
|
|
1734
|
+
label: title ?? name,
|
|
1735
|
+
hideLabel: !displayLabel,
|
|
1736
|
+
readonly
|
|
1737
|
+
}
|
|
1738
|
+
);
|
|
1739
|
+
const optionsSchemaField = optionSchema && optionSchema.type !== "null" && /* @__PURE__ */ jsxRuntime.jsx(_SchemaField, { ...this.props, schema: optionSchema, uiSchema: optionUiSchema }) || null;
|
|
1740
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1741
|
+
MultiSchemaFieldTemplate2,
|
|
1742
|
+
{
|
|
1743
|
+
schema,
|
|
1744
|
+
registry,
|
|
1745
|
+
uiSchema,
|
|
1746
|
+
selector,
|
|
1747
|
+
optionSchemaField: optionsSchemaField
|
|
1748
|
+
}
|
|
1749
|
+
);
|
|
1737
1750
|
}
|
|
1738
1751
|
};
|
|
1739
1752
|
var MultiSchemaField_default = AnyOfField;
|
|
@@ -2816,6 +2829,13 @@
|
|
|
2816
2829
|
const { children, column, className, ...rest } = props;
|
|
2817
2830
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className, ...rest, children });
|
|
2818
2831
|
}
|
|
2832
|
+
function MultiSchemaFieldTemplate(props) {
|
|
2833
|
+
const { selector, optionSchemaField } = props;
|
|
2834
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "panel panel-default panel-body", children: [
|
|
2835
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "form-group", children: selector }),
|
|
2836
|
+
optionSchemaField
|
|
2837
|
+
] });
|
|
2838
|
+
}
|
|
2819
2839
|
function ObjectFieldTemplate(props) {
|
|
2820
2840
|
const {
|
|
2821
2841
|
description,
|
|
@@ -2980,6 +3000,7 @@
|
|
|
2980
3000
|
FieldErrorTemplate,
|
|
2981
3001
|
FieldHelpTemplate,
|
|
2982
3002
|
GridTemplate,
|
|
3003
|
+
MultiSchemaFieldTemplate,
|
|
2983
3004
|
ObjectFieldTemplate,
|
|
2984
3005
|
TitleFieldTemplate: TitleField,
|
|
2985
3006
|
UnsupportedFieldTemplate: UnsupportedField_default,
|