@rjsf/mantine 6.0.1 → 6.0.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.
package/dist/index.cjs CHANGED
@@ -1231,7 +1231,6 @@ function CheckboxWidget(props) {
1231
1231
  registry,
1232
1232
  uiSchema
1233
1233
  } = props;
1234
- const themeProps = cleanupOptions(options);
1235
1234
  const DescriptionFieldTemplate = (0, import_utils20.getTemplate)(
1236
1235
  "DescriptionFieldTemplate",
1237
1236
  registry,
@@ -1287,8 +1286,7 @@ function CheckboxWidget(props) {
1287
1286
  onBlur: handleBlur,
1288
1287
  onFocus: handleFocus,
1289
1288
  error: rawErrors && rawErrors.length > 0 ? rawErrors.join("\n") : void 0,
1290
- "aria-describedby": (0, import_utils20.ariaDescribedByIds)(id),
1291
- ...themeProps
1289
+ "aria-describedby": (0, import_utils20.ariaDescribedByIds)(id)
1292
1290
  }
1293
1291
  )
1294
1292
  ] });
@@ -1296,7 +1294,7 @@ function CheckboxWidget(props) {
1296
1294
 
1297
1295
  // src/widgets/ColorWidget.tsx
1298
1296
  var import_react6 = require("react");
1299
- var import_utils22 = require("@rjsf/utils");
1297
+ var import_utils21 = require("@rjsf/utils");
1300
1298
  var import_core21 = require("@mantine/core");
1301
1299
  var import_jsx_runtime28 = require("react/jsx-runtime");
1302
1300
  function ColorWidget(props) {
@@ -1350,13 +1348,13 @@ function ColorWidget(props) {
1350
1348
  required,
1351
1349
  disabled: disabled || readonly,
1352
1350
  autoFocus: autofocus,
1353
- label: (0, import_utils22.labelValue)(label || void 0, hideLabel, false),
1351
+ label: (0, import_utils21.labelValue)(label || void 0, hideLabel, false),
1354
1352
  onChange: handleChange,
1355
1353
  onBlur: handleBlur,
1356
1354
  onFocus: handleFocus,
1357
1355
  error: rawErrors && rawErrors.length > 0 ? rawErrors.join("\n") : void 0,
1358
1356
  ...themeProps,
1359
- "aria-describedby": (0, import_utils22.ariaDescribedByIds)(id),
1357
+ "aria-describedby": (0, import_utils21.ariaDescribedByIds)(id),
1360
1358
  popoverProps: { withinPortal: false }
1361
1359
  }
1362
1360
  );
@@ -1364,7 +1362,7 @@ function ColorWidget(props) {
1364
1362
 
1365
1363
  // src/widgets/FileWidget.tsx
1366
1364
  var import_react7 = require("react");
1367
- var import_utils24 = require("@rjsf/utils");
1365
+ var import_utils23 = require("@rjsf/utils");
1368
1366
  var import_core22 = require("@mantine/core");
1369
1367
  var import_jsx_runtime29 = require("react/jsx-runtime");
1370
1368
  function FileWidget(props) {
@@ -1384,7 +1382,7 @@ function FileWidget(props) {
1384
1382
  multiple,
1385
1383
  onChange
1386
1384
  } = props;
1387
- const { filesInfo, handleChange, handleRemove } = (0, import_utils24.useFileWidgetProps)(value, onChange, multiple);
1385
+ const { filesInfo, handleChange, handleRemove } = (0, import_utils23.useFileWidgetProps)(value, onChange, multiple);
1388
1386
  const themeProps = cleanupOptions(options);
1389
1387
  const handleOnChange = (0, import_react7.useCallback)(
1390
1388
  (files) => {
@@ -1410,20 +1408,20 @@ function FileWidget(props) {
1410
1408
  required,
1411
1409
  disabled: disabled || readonly,
1412
1410
  autoFocus: autofocus,
1413
- label: (0, import_utils24.labelValue)(label || void 0, hideLabel, false),
1411
+ label: (0, import_utils23.labelValue)(label || void 0, hideLabel, false),
1414
1412
  multiple: !!multiple,
1415
1413
  valueComponent: ValueComponent,
1416
1414
  onChange: handleOnChange,
1417
1415
  error: rawErrors && rawErrors.length > 0 ? rawErrors.join("\n") : void 0,
1418
1416
  ...themeProps,
1419
- "aria-describedby": (0, import_utils24.ariaDescribedByIds)(id)
1417
+ "aria-describedby": (0, import_utils23.ariaDescribedByIds)(id)
1420
1418
  }
1421
1419
  );
1422
1420
  }
1423
1421
 
1424
1422
  // src/widgets/PasswordWidget.tsx
1425
1423
  var import_react8 = require("react");
1426
- var import_utils26 = require("@rjsf/utils");
1424
+ var import_utils25 = require("@rjsf/utils");
1427
1425
  var import_core23 = require("@mantine/core");
1428
1426
  var import_jsx_runtime30 = require("react/jsx-runtime");
1429
1427
  function PasswordWidget(props) {
@@ -1478,20 +1476,20 @@ function PasswordWidget(props) {
1478
1476
  required,
1479
1477
  disabled: disabled || readonly,
1480
1478
  autoFocus: autofocus,
1481
- label: (0, import_utils26.labelValue)(label || void 0, hideLabel, false),
1479
+ label: (0, import_utils25.labelValue)(label || void 0, hideLabel, false),
1482
1480
  onChange: handleChange,
1483
1481
  onBlur: handleBlur,
1484
1482
  onFocus: handleFocus,
1485
1483
  error: rawErrors && rawErrors.length > 0 ? rawErrors.join("\n") : void 0,
1486
1484
  ...themeProps,
1487
- "aria-describedby": (0, import_utils26.ariaDescribedByIds)(id)
1485
+ "aria-describedby": (0, import_utils25.ariaDescribedByIds)(id)
1488
1486
  }
1489
1487
  );
1490
1488
  }
1491
1489
 
1492
1490
  // src/widgets/RadioWidget.tsx
1493
1491
  var import_react9 = require("react");
1494
- var import_utils28 = require("@rjsf/utils");
1492
+ var import_utils27 = require("@rjsf/utils");
1495
1493
  var import_core24 = require("@mantine/core");
1496
1494
  var import_jsx_runtime31 = require("react/jsx-runtime");
1497
1495
  function RadioWidget(props) {
@@ -1516,7 +1514,7 @@ function RadioWidget(props) {
1516
1514
  const handleChange = (0, import_react9.useCallback)(
1517
1515
  (nextValue) => {
1518
1516
  if (!disabled && !readonly && onChange) {
1519
- onChange((0, import_utils28.enumOptionsValueForIndex)(nextValue, enumOptions, emptyValue));
1517
+ onChange((0, import_utils27.enumOptionsValueForIndex)(nextValue, enumOptions, emptyValue));
1520
1518
  }
1521
1519
  },
1522
1520
  [onChange, disabled, readonly, enumOptions, emptyValue]
@@ -1524,7 +1522,7 @@ function RadioWidget(props) {
1524
1522
  const handleBlur = (0, import_react9.useCallback)(
1525
1523
  ({ target }) => {
1526
1524
  if (onBlur) {
1527
- onBlur(id, (0, import_utils28.enumOptionsValueForIndex)(target && target.value, enumOptions, emptyValue));
1525
+ onBlur(id, (0, import_utils27.enumOptionsValueForIndex)(target && target.value, enumOptions, emptyValue));
1528
1526
  }
1529
1527
  },
1530
1528
  [onBlur, id, enumOptions, emptyValue]
@@ -1532,12 +1530,12 @@ function RadioWidget(props) {
1532
1530
  const handleFocus = (0, import_react9.useCallback)(
1533
1531
  ({ target }) => {
1534
1532
  if (onFocus) {
1535
- onFocus(id, (0, import_utils28.enumOptionsValueForIndex)(target && target.value, enumOptions, emptyValue));
1533
+ onFocus(id, (0, import_utils27.enumOptionsValueForIndex)(target && target.value, enumOptions, emptyValue));
1536
1534
  }
1537
1535
  },
1538
1536
  [onFocus, id, enumOptions, emptyValue]
1539
1537
  );
1540
- const selected = (0, import_utils28.enumOptionsIndexForValue)(value, enumOptions);
1538
+ const selected = (0, import_utils27.enumOptionsIndexForValue)(value, enumOptions);
1541
1539
  return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
1542
1540
  import_core24.Radio.Group,
1543
1541
  {
@@ -1549,12 +1547,12 @@ function RadioWidget(props) {
1549
1547
  required,
1550
1548
  readOnly: disabled || readonly,
1551
1549
  error: rawErrors && rawErrors.length > 0 ? rawErrors.join("\n") : void 0,
1552
- "aria-describedby": (0, import_utils28.ariaDescribedByIds)(id),
1550
+ "aria-describedby": (0, import_utils27.ariaDescribedByIds)(id),
1553
1551
  ...themeProps,
1554
1552
  children: Array.isArray(enumOptions) ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_core24.Flex, { mt: "xs", direction: inline ? "row" : "column", gap: "xs", wrap: "wrap", children: enumOptions.map((option, i) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
1555
1553
  import_core24.Radio,
1556
1554
  {
1557
- id: (0, import_utils28.optionId)(id, i),
1555
+ id: (0, import_utils27.optionId)(id, i),
1558
1556
  value: String(i),
1559
1557
  label: option.label,
1560
1558
  disabled: Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1,
@@ -1570,7 +1568,7 @@ function RadioWidget(props) {
1570
1568
 
1571
1569
  // src/widgets/RangeWidget.tsx
1572
1570
  var import_react10 = require("react");
1573
- var import_utils30 = require("@rjsf/utils");
1571
+ var import_utils29 = require("@rjsf/utils");
1574
1572
  var import_core25 = require("@mantine/core");
1575
1573
  var import_jsx_runtime32 = require("react/jsx-runtime");
1576
1574
  function RangeWidget(props) {
@@ -1592,7 +1590,7 @@ function RangeWidget(props) {
1592
1590
  schema
1593
1591
  } = props;
1594
1592
  const themeProps = cleanupOptions(options);
1595
- const { min, max, step } = (0, import_utils30.rangeSpec)(schema);
1593
+ const { min, max, step } = (0, import_utils29.rangeSpec)(schema);
1596
1594
  const handleChange = (0, import_react10.useCallback)(
1597
1595
  (nextValue) => {
1598
1596
  if (!disabled && !readonly && onChange) {
@@ -1612,7 +1610,7 @@ function RangeWidget(props) {
1612
1610
  }
1613
1611
  }, [onFocus, id, value]);
1614
1612
  return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
1615
- !hideLabel && !!label && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_core25.Input.Label, { id: (0, import_utils30.titleId)(id), required, children: label }),
1613
+ !hideLabel && !!label && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_core25.Input.Label, { id: (0, import_utils29.titleId)(id), required, children: label }),
1616
1614
  options?.description && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_core25.Input.Description, { children: options.description }),
1617
1615
  /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
1618
1616
  import_core25.Slider,
@@ -1629,7 +1627,7 @@ function RangeWidget(props) {
1629
1627
  onBlur: handleBlur,
1630
1628
  onFocus: handleFocus,
1631
1629
  ...themeProps,
1632
- "aria-describedby": (0, import_utils30.ariaDescribedByIds)(id)
1630
+ "aria-describedby": (0, import_utils29.ariaDescribedByIds)(id)
1633
1631
  }
1634
1632
  ),
1635
1633
  rawErrors && rawErrors?.length > 0 && rawErrors.map((error, index) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_core25.Input.Error, { children: error }, `range-widget-input-errors-${index}`))
@@ -1638,7 +1636,7 @@ function RangeWidget(props) {
1638
1636
 
1639
1637
  // src/widgets/SelectWidget.tsx
1640
1638
  var import_react11 = require("react");
1641
- var import_utils32 = require("@rjsf/utils");
1639
+ var import_utils31 = require("@rjsf/utils");
1642
1640
  var import_core26 = require("@mantine/core");
1643
1641
  var import_jsx_runtime33 = require("react/jsx-runtime");
1644
1642
  function SelectWidget(props) {
@@ -1665,7 +1663,7 @@ function SelectWidget(props) {
1665
1663
  const handleChange = (0, import_react11.useCallback)(
1666
1664
  (nextValue) => {
1667
1665
  if (!disabled && !readonly && onChange) {
1668
- onChange((0, import_utils32.enumOptionsValueForIndex)(nextValue, enumOptions, emptyValue));
1666
+ onChange((0, import_utils31.enumOptionsValueForIndex)(nextValue, enumOptions, emptyValue));
1669
1667
  }
1670
1668
  },
1671
1669
  [onChange, disabled, readonly, enumOptions, emptyValue]
@@ -1673,7 +1671,7 @@ function SelectWidget(props) {
1673
1671
  const handleBlur = (0, import_react11.useCallback)(
1674
1672
  ({ target }) => {
1675
1673
  if (onBlur) {
1676
- onBlur(id, (0, import_utils32.enumOptionsValueForIndex)(target && target.value, enumOptions, emptyValue));
1674
+ onBlur(id, (0, import_utils31.enumOptionsValueForIndex)(target && target.value, enumOptions, emptyValue));
1677
1675
  }
1678
1676
  },
1679
1677
  [onBlur, id, enumOptions, emptyValue]
@@ -1681,12 +1679,12 @@ function SelectWidget(props) {
1681
1679
  const handleFocus = (0, import_react11.useCallback)(
1682
1680
  ({ target }) => {
1683
1681
  if (onFocus) {
1684
- onFocus(id, (0, import_utils32.enumOptionsValueForIndex)(target && target.value, enumOptions, emptyValue));
1682
+ onFocus(id, (0, import_utils31.enumOptionsValueForIndex)(target && target.value, enumOptions, emptyValue));
1685
1683
  }
1686
1684
  },
1687
1685
  [onFocus, id, enumOptions, emptyValue]
1688
1686
  );
1689
- const selectedIndexes = (0, import_utils32.enumOptionsIndexForValue)(value, enumOptions, multiple);
1687
+ const selectedIndexes = (0, import_utils31.enumOptionsIndexForValue)(value, enumOptions, multiple);
1690
1688
  const selectOptions = (0, import_react11.useMemo)(() => {
1691
1689
  if (Array.isArray(enumOptions)) {
1692
1690
  return enumOptions.map((option, index) => ({
@@ -1704,7 +1702,7 @@ function SelectWidget(props) {
1704
1702
  {
1705
1703
  id,
1706
1704
  name: htmlName || id,
1707
- label: (0, import_utils32.labelValue)(label || void 0, hideLabel, false),
1705
+ label: (0, import_utils31.labelValue)(label || void 0, hideLabel, false),
1708
1706
  data: selectOptions,
1709
1707
  value: multiple ? selectedIndexes : selectedIndexes,
1710
1708
  onChange: !readonly ? handleChange : void 0,
@@ -1717,7 +1715,7 @@ function SelectWidget(props) {
1717
1715
  error: rawErrors && rawErrors.length > 0 ? rawErrors.join("\n") : void 0,
1718
1716
  searchable: true,
1719
1717
  ...themeProps,
1720
- "aria-describedby": (0, import_utils32.ariaDescribedByIds)(id),
1718
+ "aria-describedby": (0, import_utils31.ariaDescribedByIds)(id),
1721
1719
  comboboxProps: { withinPortal: false }
1722
1720
  }
1723
1721
  );
@@ -1725,7 +1723,7 @@ function SelectWidget(props) {
1725
1723
 
1726
1724
  // src/widgets/TextareaWidget.tsx
1727
1725
  var import_react12 = require("react");
1728
- var import_utils34 = require("@rjsf/utils");
1726
+ var import_utils33 = require("@rjsf/utils");
1729
1727
  var import_core27 = require("@mantine/core");
1730
1728
  var import_jsx_runtime34 = require("react/jsx-runtime");
1731
1729
  function TextareaWidget(props) {
@@ -1781,12 +1779,12 @@ function TextareaWidget(props) {
1781
1779
  required,
1782
1780
  disabled: disabled || readonly,
1783
1781
  autoFocus: autofocus,
1784
- label: (0, import_utils34.labelValue)(label || void 0, hideLabel, false),
1782
+ label: (0, import_utils33.labelValue)(label || void 0, hideLabel, false),
1785
1783
  onChange: handleChange,
1786
1784
  onBlur: handleBlur,
1787
1785
  onFocus: handleFocus,
1788
1786
  error: rawErrors && rawErrors.length > 0 ? rawErrors.join("\n") : void 0,
1789
- "aria-describedby": (0, import_utils34.ariaDescribedByIds)(id),
1787
+ "aria-describedby": (0, import_utils33.ariaDescribedByIds)(id),
1790
1788
  ...themeProps
1791
1789
  }
1792
1790
  );