@rjsf/core 5.19.2 → 5.19.4

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 CHANGED
@@ -1267,7 +1267,7 @@
1267
1267
  orderedProperties = utils.orderProperties(properties, uiOptions.order);
1268
1268
  } catch (err) {
1269
1269
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
1270
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "config-error", style: { color: "red" }, children: /* @__PURE__ */ jsxRuntime.jsx(Markdown, { children: translateString(utils.TranslatableString.InvalidObjectField, [name || "root", err.message]) }) }),
1270
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "config-error", style: { color: "red" }, children: /* @__PURE__ */ jsxRuntime.jsx(Markdown, { options: { disableParsingRawHTML: true }, children: translateString(utils.TranslatableString.InvalidObjectField, [name || "root", err.message]) }) }),
1271
1271
  /* @__PURE__ */ jsxRuntime.jsx("pre", { children: JSON.stringify(schema) })
1272
1272
  ] });
1273
1273
  }
@@ -1455,7 +1455,7 @@
1455
1455
  label = utils.ADDITIONAL_PROPERTY_FLAG in schema ? name : uiOptions.title || props.schema.title || schema.title || props.title || name;
1456
1456
  }
1457
1457
  const description = uiOptions.description || props.schema.description || schema.description || "";
1458
- const richDescription = uiOptions.enableMarkdownInDescription ? /* @__PURE__ */ jsxRuntime.jsx(Markdown, { children: description }) : description;
1458
+ const richDescription = uiOptions.enableMarkdownInDescription ? /* @__PURE__ */ jsxRuntime.jsx(Markdown, { options: { disableParsingRawHTML: true }, children: description }) : description;
1459
1459
  const help = uiOptions.help;
1460
1460
  const hidden = uiOptions.widget === "hidden";
1461
1461
  const classNames = ["form-group", "field", `field-${utils.getSchemaType(schema)}`];
@@ -2210,7 +2210,7 @@
2210
2210
  translateParams.push(reason);
2211
2211
  }
2212
2212
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "unsupported-field", children: [
2213
- /* @__PURE__ */ jsxRuntime.jsx("p", { children: /* @__PURE__ */ jsxRuntime.jsx(Markdown, { children: translateString(translateEnum, translateParams) }) }),
2213
+ /* @__PURE__ */ jsxRuntime.jsx("p", { children: /* @__PURE__ */ jsxRuntime.jsx(Markdown, { options: { disableParsingRawHTML: true }, children: translateString(translateEnum, translateParams) }) }),
2214
2214
  schema && /* @__PURE__ */ jsxRuntime.jsx("pre", { children: JSON.stringify(schema, null, 2) })
2215
2215
  ] });
2216
2216
  }
@@ -2819,23 +2819,24 @@
2819
2819
  const newValue = getValue(event, multiple);
2820
2820
  return onFocus(id, utils.enumOptionsValueForIndex(newValue, enumOptions, optEmptyVal));
2821
2821
  },
2822
- [onFocus, id, schema, multiple, options]
2822
+ [onFocus, id, schema, multiple, enumOptions, optEmptyVal]
2823
2823
  );
2824
2824
  const handleBlur = react.useCallback(
2825
2825
  (event) => {
2826
2826
  const newValue = getValue(event, multiple);
2827
2827
  return onBlur(id, utils.enumOptionsValueForIndex(newValue, enumOptions, optEmptyVal));
2828
2828
  },
2829
- [onBlur, id, schema, multiple, options]
2829
+ [onBlur, id, schema, multiple, enumOptions, optEmptyVal]
2830
2830
  );
2831
2831
  const handleChange = react.useCallback(
2832
2832
  (event) => {
2833
2833
  const newValue = getValue(event, multiple);
2834
2834
  return onChange(utils.enumOptionsValueForIndex(newValue, enumOptions, optEmptyVal));
2835
2835
  },
2836
- [onChange, schema, multiple, options]
2836
+ [onChange, schema, multiple, enumOptions, optEmptyVal]
2837
2837
  );
2838
2838
  const selectedIndexes = utils.enumOptionsIndexForValue(value, enumOptions, multiple);
2839
+ const showPlaceholderOption = !multiple && schema.default === void 0;
2839
2840
  return /* @__PURE__ */ jsxRuntime.jsxs(
2840
2841
  "select",
2841
2842
  {
@@ -2852,7 +2853,7 @@
2852
2853
  onChange: handleChange,
2853
2854
  "aria-describedby": utils.ariaDescribedByIds(id),
2854
2855
  children: [
2855
- !multiple && schema.default === void 0 && /* @__PURE__ */ jsxRuntime.jsx("option", { value: "", children: placeholder }),
2856
+ showPlaceholderOption && /* @__PURE__ */ jsxRuntime.jsx("option", { value: "", children: placeholder }),
2856
2857
  Array.isArray(enumOptions) && enumOptions.map(({ value: value2, label }, i) => {
2857
2858
  const disabled2 = enumDisabled && enumDisabled.indexOf(value2) !== -1;
2858
2859
  return /* @__PURE__ */ jsxRuntime.jsx("option", { value: String(i), disabled: disabled2, children: label }, i);
package/dist/index.esm.js CHANGED
@@ -1359,7 +1359,7 @@ var ObjectField = class extends Component3 {
1359
1359
  orderedProperties = orderProperties(properties, uiOptions.order);
1360
1360
  } catch (err) {
1361
1361
  return /* @__PURE__ */ jsxs2("div", { children: [
1362
- /* @__PURE__ */ jsx5("p", { className: "config-error", style: { color: "red" }, children: /* @__PURE__ */ jsx5(Markdown, { children: translateString(TranslatableString4.InvalidObjectField, [name || "root", err.message]) }) }),
1362
+ /* @__PURE__ */ jsx5("p", { className: "config-error", style: { color: "red" }, children: /* @__PURE__ */ jsx5(Markdown, { options: { disableParsingRawHTML: true }, children: translateString(TranslatableString4.InvalidObjectField, [name || "root", err.message]) }) }),
1363
1363
  /* @__PURE__ */ jsx5("pre", { children: JSON.stringify(schema) })
1364
1364
  ] });
1365
1365
  }
@@ -1566,7 +1566,7 @@ function SchemaFieldRender(props) {
1566
1566
  label = ADDITIONAL_PROPERTY_FLAG2 in schema ? name : uiOptions.title || props.schema.title || schema.title || props.title || name;
1567
1567
  }
1568
1568
  const description = uiOptions.description || props.schema.description || schema.description || "";
1569
- const richDescription = uiOptions.enableMarkdownInDescription ? /* @__PURE__ */ jsx6(Markdown2, { children: description }) : description;
1569
+ const richDescription = uiOptions.enableMarkdownInDescription ? /* @__PURE__ */ jsx6(Markdown2, { options: { disableParsingRawHTML: true }, children: description }) : description;
1570
1570
  const help = uiOptions.help;
1571
1571
  const hidden = uiOptions.widget === "hidden";
1572
1572
  const classNames = ["form-group", "field", `field-${getSchemaType(schema)}`];
@@ -2429,7 +2429,7 @@ function UnsupportedField(props) {
2429
2429
  translateParams.push(reason);
2430
2430
  }
2431
2431
  return /* @__PURE__ */ jsxs12("div", { className: "unsupported-field", children: [
2432
- /* @__PURE__ */ jsx24("p", { children: /* @__PURE__ */ jsx24(Markdown3, { children: translateString(translateEnum, translateParams) }) }),
2432
+ /* @__PURE__ */ jsx24("p", { children: /* @__PURE__ */ jsx24(Markdown3, { options: { disableParsingRawHTML: true }, children: translateString(translateEnum, translateParams) }) }),
2433
2433
  schema && /* @__PURE__ */ jsx24("pre", { children: JSON.stringify(schema, null, 2) })
2434
2434
  ] });
2435
2435
  }
@@ -3143,23 +3143,24 @@ function SelectWidget({
3143
3143
  const newValue = getValue(event, multiple);
3144
3144
  return onFocus(id, enumOptionsValueForIndex3(newValue, enumOptions, optEmptyVal));
3145
3145
  },
3146
- [onFocus, id, schema, multiple, options]
3146
+ [onFocus, id, schema, multiple, enumOptions, optEmptyVal]
3147
3147
  );
3148
3148
  const handleBlur = useCallback10(
3149
3149
  (event) => {
3150
3150
  const newValue = getValue(event, multiple);
3151
3151
  return onBlur(id, enumOptionsValueForIndex3(newValue, enumOptions, optEmptyVal));
3152
3152
  },
3153
- [onBlur, id, schema, multiple, options]
3153
+ [onBlur, id, schema, multiple, enumOptions, optEmptyVal]
3154
3154
  );
3155
3155
  const handleChange = useCallback10(
3156
3156
  (event) => {
3157
3157
  const newValue = getValue(event, multiple);
3158
3158
  return onChange(enumOptionsValueForIndex3(newValue, enumOptions, optEmptyVal));
3159
3159
  },
3160
- [onChange, schema, multiple, options]
3160
+ [onChange, schema, multiple, enumOptions, optEmptyVal]
3161
3161
  );
3162
3162
  const selectedIndexes = enumOptionsIndexForValue(value, enumOptions, multiple);
3163
+ const showPlaceholderOption = !multiple && schema.default === void 0;
3163
3164
  return /* @__PURE__ */ jsxs20(
3164
3165
  "select",
3165
3166
  {
@@ -3176,7 +3177,7 @@ function SelectWidget({
3176
3177
  onChange: handleChange,
3177
3178
  "aria-describedby": ariaDescribedByIds6(id),
3178
3179
  children: [
3179
- !multiple && schema.default === void 0 && /* @__PURE__ */ jsx39("option", { value: "", children: placeholder }),
3180
+ showPlaceholderOption && /* @__PURE__ */ jsx39("option", { value: "", children: placeholder }),
3180
3181
  Array.isArray(enumOptions) && enumOptions.map(({ value: value2, label }, i) => {
3181
3182
  const disabled2 = enumDisabled && enumDisabled.indexOf(value2) !== -1;
3182
3183
  return /* @__PURE__ */ jsx39("option", { value: String(i), disabled: disabled2, children: label }, i);