@superdispatch/ui 0.26.0 → 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.
- package/dist-node/index.js +38 -7
- package/dist-node/index.js.map +1 -1
- package/dist-src/number-field/NumberField.js +38 -7
- package/dist-types/index.d.ts +1 -0
- package/dist-web/index.js +38 -7
- package/dist-web/index.js.map +1 -1
- package/package.json +2 -2
package/dist-node/index.js
CHANGED
|
@@ -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 = ["
|
|
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,
|
|
@@ -1729,31 +1730,61 @@ function NumberInputComponent(_ref) {
|
|
|
1729
1730
|
thousandSeparator: thousandSeparator,
|
|
1730
1731
|
allowedDecimalSeparators: ['.', ','],
|
|
1731
1732
|
onValueChange: (values, sourceInfo) => {
|
|
1732
|
-
var inputValue = values.value;
|
|
1733
1733
|
var {
|
|
1734
1734
|
event
|
|
1735
1735
|
} = sourceInfo;
|
|
1736
1736
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
1737
1737
|
onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread(_objectSpread({}, event), {}, {
|
|
1738
1738
|
target: _objectSpread(_objectSpread({}, event === null || event === void 0 ? void 0 : event.target), {}, {
|
|
1739
|
-
value:
|
|
1739
|
+
value: disableValueParsing ? values.value : values.floatValue
|
|
1740
1740
|
})
|
|
1741
1741
|
}));
|
|
1742
1742
|
}
|
|
1743
1743
|
}));
|
|
1744
1744
|
}
|
|
1745
|
-
|
|
1745
|
+
function TextInputComponent(_ref2) {
|
|
1746
1746
|
var {
|
|
1747
|
-
|
|
1748
|
-
|
|
1747
|
+
value,
|
|
1748
|
+
inputRef,
|
|
1749
|
+
onChange,
|
|
1750
|
+
valueIsNumericString = true,
|
|
1751
|
+
thousandSeparator = true,
|
|
1752
|
+
disableValueParsing
|
|
1749
1753
|
} = _ref2,
|
|
1750
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);
|
|
1751
1782
|
var uid = useUID(id);
|
|
1752
1783
|
return /*#__PURE__*/jsxRuntime.jsx(core.TextField, _objectSpread(_objectSpread({}, props), {}, {
|
|
1753
1784
|
ref: ref,
|
|
1754
1785
|
id: uid,
|
|
1755
1786
|
InputProps: _objectSpread(_objectSpread({}, InputProps), {}, {
|
|
1756
|
-
inputComponent: NumberInputComponent
|
|
1787
|
+
inputComponent: isText ? TextInputComponent : NumberInputComponent
|
|
1757
1788
|
})
|
|
1758
1789
|
}));
|
|
1759
1790
|
});
|