ish-ui 1.0.0-alpha.21 → 1.0.0-alpha.23
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.
|
@@ -17,7 +17,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
17
17
|
return t;
|
|
18
18
|
};
|
|
19
19
|
import React, { useCallback } from 'react';
|
|
20
|
-
import
|
|
20
|
+
import NumberFormat from 'react-number-format';
|
|
21
21
|
import InputAdornment from '@mui/material/InputAdornment';
|
|
22
22
|
import clsx from 'clsx';
|
|
23
23
|
import EditInPlaceField from './EditInPlaceField';
|
|
@@ -27,7 +27,7 @@ const NumberFormatCustom = React.forwardRef((props, ref) => {
|
|
|
27
27
|
const onValueChange = useCallback(values => {
|
|
28
28
|
onChange(normalizeNumber(values.value));
|
|
29
29
|
}, []);
|
|
30
|
-
return (React.createElement(
|
|
30
|
+
return (React.createElement(NumberFormat, Object.assign({}, other, { getInputRef: ref, onValueChange: onValueChange, allowNegative: allowNegative, decimalScale: 2, thousandSeparator: true })));
|
|
31
31
|
});
|
|
32
32
|
const preformatDisplayValue = value => value || value === 0 ? formatCurrency(value, '') : value;
|
|
33
33
|
function EditInPlaceMoneyField(_a) {
|
|
@@ -17,7 +17,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
17
17
|
return t;
|
|
18
18
|
};
|
|
19
19
|
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
20
|
-
import
|
|
20
|
+
import NumberFormat from 'react-number-format';
|
|
21
21
|
import InputAdornment from '@mui/material/InputAdornment';
|
|
22
22
|
import PhoneIcon from '@mui/icons-material/Phone';
|
|
23
23
|
import debounce from 'lodash.debounce';
|
|
@@ -26,7 +26,7 @@ import { getPhoneMask } from '../utils';
|
|
|
26
26
|
const NumberFormatCustom = React.forwardRef((props, ref) => {
|
|
27
27
|
const { onChange } = props, other = __rest(props, ["onChange"]);
|
|
28
28
|
const inputRef = useRef();
|
|
29
|
-
const [format, setFormat] = useState(
|
|
29
|
+
const [format, setFormat] = useState('');
|
|
30
30
|
const [prefix, setPrefix] = useState(undefined);
|
|
31
31
|
const processFormat = useCallback(debounce(data => {
|
|
32
32
|
setFormat(getPhoneMask(data.value));
|
|
@@ -59,7 +59,7 @@ const NumberFormatCustom = React.forwardRef((props, ref) => {
|
|
|
59
59
|
ref = input;
|
|
60
60
|
inputRef.current = input;
|
|
61
61
|
};
|
|
62
|
-
return (React.createElement(
|
|
62
|
+
return (React.createElement(NumberFormat, Object.assign({}, other, { getInputRef: getInputRef, onKeyPress: onKeyPress, prefix: prefix, onValueChange: onValueChange, format: format, type: "text" })));
|
|
63
63
|
});
|
|
64
64
|
function EditInPlacePhoneField(_a) {
|
|
65
65
|
var { InputProps, className } = _a, restProps = __rest(_a, ["InputProps", "className"]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ish-ui",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.23",
|
|
4
4
|
"description": "UI elements for onCourse and other ish apps",
|
|
5
5
|
"main": "main.ts",
|
|
6
6
|
"devDependencies": {
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"react-color": "^2.19.3",
|
|
82
82
|
"react-dom": "^18.2.0",
|
|
83
83
|
"react-dropzone": "^14.2.3",
|
|
84
|
-
"react-number-format": "
|
|
84
|
+
"react-number-format": "4.9.3",
|
|
85
85
|
"react-window": "^1.8.9",
|
|
86
86
|
"react-window-infinite-loader": "^1.0.9",
|
|
87
87
|
"redux": "^4.2.1"
|