@rjsf/core 5.18.6 → 5.19.1

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
@@ -1417,7 +1417,7 @@
1417
1417
  );
1418
1418
  const FieldComponent = getFieldComponent(schema, uiOptions, idSchema, registry);
1419
1419
  const disabled = Boolean(uiOptions.disabled ?? props.disabled);
1420
- const readonly = Boolean(uiOptions.readonly ?? props.readonly ?? props.schema.readOnly ?? schema.readOnly);
1420
+ const readonly = Boolean(uiOptions.readonly ?? (props.readonly || props.schema.readOnly || schema.readOnly));
1421
1421
  const uiSchemaHideError = uiOptions.hideError;
1422
1422
  const hideError = uiSchemaHideError === void 0 ? props.hideError : Boolean(uiSchemaHideError);
1423
1423
  const autofocus = Boolean(uiOptions.autofocus ?? props.autofocus);
@@ -2288,13 +2288,6 @@
2288
2288
  };
2289
2289
  }
2290
2290
  var templates_default = templates;
2291
- function rangeOptions(start, stop) {
2292
- const options = [];
2293
- for (let i = start; i <= stop; i++) {
2294
- options.push({ value: i, label: utils.pad(i, 2) });
2295
- }
2296
- return options;
2297
- }
2298
2291
  function readyForChange(state) {
2299
2292
  return Object.values(state).every((value) => value !== -1);
2300
2293
  }
@@ -2321,7 +2314,7 @@
2321
2314
  id,
2322
2315
  name,
2323
2316
  className: "form-control",
2324
- options: { enumOptions: rangeOptions(range[0], range[1]) },
2317
+ options: { enumOptions: utils.dateRangeOptions(range[0], range[1]) },
2325
2318
  placeholder: type,
2326
2319
  value,
2327
2320
  disabled,
package/dist/index.esm.js CHANGED
@@ -1528,7 +1528,7 @@ function SchemaFieldRender(props) {
1528
1528
  );
1529
1529
  const FieldComponent = getFieldComponent(schema, uiOptions, idSchema, registry);
1530
1530
  const disabled = Boolean(uiOptions.disabled ?? props.disabled);
1531
- const readonly = Boolean(uiOptions.readonly ?? props.readonly ?? props.schema.readOnly ?? schema.readOnly);
1531
+ const readonly = Boolean(uiOptions.readonly ?? (props.readonly || props.schema.readOnly || schema.readOnly));
1532
1532
  const uiSchemaHideError = uiOptions.hideError;
1533
1533
  const hideError = uiSchemaHideError === void 0 ? props.hideError : Boolean(uiSchemaHideError);
1534
1534
  const autofocus = Boolean(uiOptions.autofocus ?? props.autofocus);
@@ -2519,20 +2519,13 @@ var templates_default = templates;
2519
2519
  import { useCallback as useCallback4, useEffect as useEffect2, useReducer, useState as useState2 } from "react";
2520
2520
  import {
2521
2521
  ariaDescribedByIds as ariaDescribedByIds2,
2522
+ dateRangeOptions,
2522
2523
  parseDateString,
2523
2524
  toDateString,
2524
- pad,
2525
2525
  TranslatableString as TranslatableString11,
2526
2526
  getDateElementProps
2527
2527
  } from "@rjsf/utils";
2528
2528
  import { jsx as jsx26, jsxs as jsxs14 } from "react/jsx-runtime";
2529
- function rangeOptions(start, stop) {
2530
- const options = [];
2531
- for (let i = start; i <= stop; i++) {
2532
- options.push({ value: i, label: pad(i, 2) });
2533
- }
2534
- return options;
2535
- }
2536
2529
  function readyForChange(state) {
2537
2530
  return Object.values(state).every((value) => value !== -1);
2538
2531
  }
@@ -2559,7 +2552,7 @@ function DateElement({
2559
2552
  id,
2560
2553
  name,
2561
2554
  className: "form-control",
2562
- options: { enumOptions: rangeOptions(range[0], range[1]) },
2555
+ options: { enumOptions: dateRangeOptions(range[0], range[1]) },
2563
2556
  placeholder: type,
2564
2557
  value,
2565
2558
  disabled,