@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/index.js CHANGED
@@ -1347,7 +1347,7 @@ var ObjectField = class extends import_react4.Component {
1347
1347
  orderedProperties = (0, import_utils5.orderProperties)(properties, uiOptions.order);
1348
1348
  } catch (err) {
1349
1349
  return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { children: [
1350
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "config-error", style: { color: "red" }, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_markdown_to_jsx.default, { children: translateString(import_utils5.TranslatableString.InvalidObjectField, [name || "root", err.message]) }) }),
1350
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "config-error", style: { color: "red" }, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_markdown_to_jsx.default, { options: { disableParsingRawHTML: true }, children: translateString(import_utils5.TranslatableString.InvalidObjectField, [name || "root", err.message]) }) }),
1351
1351
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("pre", { children: JSON.stringify(schema) })
1352
1352
  ] });
1353
1353
  }
@@ -1543,7 +1543,7 @@ function SchemaFieldRender(props) {
1543
1543
  label = import_utils6.ADDITIONAL_PROPERTY_FLAG in schema ? name : uiOptions.title || props.schema.title || schema.title || props.title || name;
1544
1544
  }
1545
1545
  const description = uiOptions.description || props.schema.description || schema.description || "";
1546
- const richDescription = uiOptions.enableMarkdownInDescription ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_markdown_to_jsx2.default, { children: description }) : description;
1546
+ const richDescription = uiOptions.enableMarkdownInDescription ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_markdown_to_jsx2.default, { options: { disableParsingRawHTML: true }, children: description }) : description;
1547
1547
  const help = uiOptions.help;
1548
1548
  const hidden = uiOptions.widget === "hidden";
1549
1549
  const classNames = ["form-group", "field", `field-${(0, import_utils6.getSchemaType)(schema)}`];
@@ -2375,7 +2375,7 @@ function UnsupportedField(props) {
2375
2375
  translateParams.push(reason);
2376
2376
  }
2377
2377
  return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "unsupported-field", children: [
2378
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_markdown_to_jsx3.default, { children: translateString(translateEnum, translateParams) }) }),
2378
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_markdown_to_jsx3.default, { options: { disableParsingRawHTML: true }, children: translateString(translateEnum, translateParams) }) }),
2379
2379
  schema && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("pre", { children: JSON.stringify(schema, null, 2) })
2380
2380
  ] });
2381
2381
  }
@@ -3049,23 +3049,24 @@ function SelectWidget({
3049
3049
  const newValue = getValue(event, multiple);
3050
3050
  return onFocus(id, (0, import_utils32.enumOptionsValueForIndex)(newValue, enumOptions, optEmptyVal));
3051
3051
  },
3052
- [onFocus, id, schema, multiple, options]
3052
+ [onFocus, id, schema, multiple, enumOptions, optEmptyVal]
3053
3053
  );
3054
3054
  const handleBlur = (0, import_react14.useCallback)(
3055
3055
  (event) => {
3056
3056
  const newValue = getValue(event, multiple);
3057
3057
  return onBlur(id, (0, import_utils32.enumOptionsValueForIndex)(newValue, enumOptions, optEmptyVal));
3058
3058
  },
3059
- [onBlur, id, schema, multiple, options]
3059
+ [onBlur, id, schema, multiple, enumOptions, optEmptyVal]
3060
3060
  );
3061
3061
  const handleChange = (0, import_react14.useCallback)(
3062
3062
  (event) => {
3063
3063
  const newValue = getValue(event, multiple);
3064
3064
  return onChange((0, import_utils32.enumOptionsValueForIndex)(newValue, enumOptions, optEmptyVal));
3065
3065
  },
3066
- [onChange, schema, multiple, options]
3066
+ [onChange, schema, multiple, enumOptions, optEmptyVal]
3067
3067
  );
3068
3068
  const selectedIndexes = (0, import_utils32.enumOptionsIndexForValue)(value, enumOptions, multiple);
3069
+ const showPlaceholderOption = !multiple && schema.default === void 0;
3069
3070
  return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
3070
3071
  "select",
3071
3072
  {
@@ -3082,7 +3083,7 @@ function SelectWidget({
3082
3083
  onChange: handleChange,
3083
3084
  "aria-describedby": (0, import_utils32.ariaDescribedByIds)(id),
3084
3085
  children: [
3085
- !multiple && schema.default === void 0 && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("option", { value: "", children: placeholder }),
3086
+ showPlaceholderOption && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("option", { value: "", children: placeholder }),
3086
3087
  Array.isArray(enumOptions) && enumOptions.map(({ value: value2, label }, i) => {
3087
3088
  const disabled2 = enumDisabled && enumDisabled.indexOf(value2) !== -1;
3088
3089
  return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("option", { value: String(i), disabled: disabled2, children: label }, i);