@superdispatch/ui 0.26.1 → 0.27.0

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.
@@ -1710,7 +1710,8 @@ var Inline = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
1710
1710
  if (process.env.NODE_ENV !== "production") Inline.displayName = "Inline";
1711
1711
 
1712
1712
  var _excluded$i = ["value", "inputRef", "onChange", "valueIsNumericString", "thousandSeparator", "disableValueParsing"],
1713
- _excluded2$3 = ["id", "InputProps"];
1713
+ _excluded2$3 = ["value", "inputRef", "onChange", "valueIsNumericString", "thousandSeparator", "disableValueParsing"],
1714
+ _excluded3 = ["id", "InputProps", "isText"];
1714
1715
  function NumberInputComponent(_ref) {
1715
1716
  var {
1716
1717
  value,
@@ -1741,18 +1742,49 @@ function NumberInputComponent(_ref) {
1741
1742
  }
1742
1743
  }));
1743
1744
  }
1744
- var NumberField = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
1745
+ function TextInputComponent(_ref2) {
1745
1746
  var {
1746
- id,
1747
- InputProps
1747
+ value,
1748
+ inputRef,
1749
+ onChange,
1750
+ valueIsNumericString = true,
1751
+ thousandSeparator = true,
1752
+ disableValueParsing
1748
1753
  } = _ref2,
1749
1754
  props = _objectWithoutProperties(_ref2, _excluded2$3);
1755
+ return /*#__PURE__*/jsxRuntime.jsx(reactNumberFormat.NumericFormat, _objectSpread(_objectSpread({}, props), {}, {
1756
+ value: value !== null && value !== void 0 ? value : '',
1757
+ inputMode: "decimal",
1758
+ getInputRef: inputRef,
1759
+ valueIsNumericString: valueIsNumericString,
1760
+ thousandSeparator: thousandSeparator,
1761
+ allowedDecimalSeparators: ['.', ','],
1762
+ onValueChange: (values, sourceInfo) => {
1763
+ var {
1764
+ event
1765
+ } = sourceInfo;
1766
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-call
1767
+ onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread(_objectSpread({}, event), {}, {
1768
+ target: _objectSpread(_objectSpread({}, event === null || event === void 0 ? void 0 : event.target), {}, {
1769
+ value: values.value
1770
+ })
1771
+ }));
1772
+ }
1773
+ }));
1774
+ }
1775
+ var NumberField = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
1776
+ var {
1777
+ id,
1778
+ InputProps,
1779
+ isText = false
1780
+ } = _ref3,
1781
+ props = _objectWithoutProperties(_ref3, _excluded3);
1750
1782
  var uid = useUID(id);
1751
1783
  return /*#__PURE__*/jsxRuntime.jsx(core.TextField, _objectSpread(_objectSpread({}, props), {}, {
1752
1784
  ref: ref,
1753
1785
  id: uid,
1754
1786
  InputProps: _objectSpread(_objectSpread({}, InputProps), {}, {
1755
- inputComponent: NumberInputComponent
1787
+ inputComponent: isText ? TextInputComponent : NumberInputComponent
1756
1788
  })
1757
1789
  }));
1758
1790
  });