diginet-core-ui 1.4.52-beta.6 → 1.4.52-beta.7
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.
|
@@ -65,14 +65,15 @@ const NumberInput = /*#__PURE__*/forwardRef((inProps, reference) => {
|
|
|
65
65
|
style,
|
|
66
66
|
thousandSeparator,
|
|
67
67
|
validates,
|
|
68
|
-
value: valueProp,
|
|
68
|
+
// value: valueProp,
|
|
69
69
|
viewType
|
|
70
70
|
} = props;
|
|
71
71
|
let max = maxProp;
|
|
72
72
|
let min = minProp;
|
|
73
73
|
let thousandSymbol = thousandSeparator;
|
|
74
74
|
let decimalSymbol = decimalSymbolProp;
|
|
75
|
-
let valueProps = valueProp;
|
|
75
|
+
// let valueProps = valueProp;
|
|
76
|
+
|
|
76
77
|
if (!min && min !== 0) min = -Infinity;
|
|
77
78
|
if (!max && max !== 0) max = Infinity;
|
|
78
79
|
const pos = useRef(null);
|
|
@@ -99,13 +100,13 @@ const NumberInput = /*#__PURE__*/forwardRef((inProps, reference) => {
|
|
|
99
100
|
|
|
100
101
|
// if (valueProps || valueProps === 0) valueProps = clamp(valueProps, min, max);
|
|
101
102
|
|
|
102
|
-
/**
|
|
103
|
-
* Convert number to format money
|
|
104
|
-
* @param vl {number} - value
|
|
105
|
-
* @type {function}
|
|
106
|
-
* @return {string}
|
|
107
|
-
* @example 1200300.123 => 1,200,300.123
|
|
108
|
-
* @example 1200300,123 => 1.200.300,123
|
|
103
|
+
/**
|
|
104
|
+
* Convert number to format money
|
|
105
|
+
* @param vl {number} - value
|
|
106
|
+
* @type {function}
|
|
107
|
+
* @return {string}
|
|
108
|
+
* @example 1200300.123 => 1,200,300.123
|
|
109
|
+
* @example 1200300,123 => 1.200.300,123
|
|
109
110
|
*/
|
|
110
111
|
const parseNumberToMoney = useCallback((vl, isNumber) => {
|
|
111
112
|
var _number, _number2, _number$, _number3;
|
|
@@ -153,13 +154,13 @@ const NumberInput = /*#__PURE__*/forwardRef((inProps, reference) => {
|
|
|
153
154
|
return number;
|
|
154
155
|
}, [decimalSymbol, max, value, decimalDigit, fixedDecimalDigit]);
|
|
155
156
|
|
|
156
|
-
/**
|
|
157
|
-
* Convert money to format number
|
|
158
|
-
* @param vl {string} - value
|
|
159
|
-
* @type {function}
|
|
160
|
-
* @return {number}
|
|
161
|
-
* @example 1,200,300.123 => 1200300.123
|
|
162
|
-
* @example 1.200.300,123 => 1200300.123
|
|
157
|
+
/**
|
|
158
|
+
* Convert money to format number
|
|
159
|
+
* @param vl {string} - value
|
|
160
|
+
* @type {function}
|
|
161
|
+
* @return {number}
|
|
162
|
+
* @example 1,200,300.123 => 1200300.123
|
|
163
|
+
* @example 1.200.300,123 => 1200300.123
|
|
163
164
|
*/
|
|
164
165
|
const convertMoneyToNumber = useCallback((vl, isNumber) => {
|
|
165
166
|
var _number4, _number4$toString, _number4$toString$rep, _number4$toString$rep2, _number4$toString$rep3;
|
|
@@ -487,10 +488,10 @@ NumberInput.propTypes = {
|
|
|
487
488
|
style: PropTypes.object,
|
|
488
489
|
/** Thousand separator character. */
|
|
489
490
|
thousandSeparator: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['.', ','])]),
|
|
490
|
-
/** Validation value, argument can:<br/>
|
|
491
|
-
* * string: the validation rule. Example required.<br/>
|
|
492
|
-
* * object: the validation rule insist name, property, message. Example {name: 'min', compareValue: 9, message: 'Error'} or {max: 99}<br/>
|
|
493
|
-
* * array: the validation rule list, insist object/string
|
|
491
|
+
/** Validation value, argument can:<br/>
|
|
492
|
+
* * string: the validation rule. Example required.<br/>
|
|
493
|
+
* * object: the validation rule insist name, property, message. Example {name: 'min', compareValue: 9, message: 'Error'} or {max: 99}<br/>
|
|
494
|
+
* * array: the validation rule list, insist object/string
|
|
494
495
|
*/
|
|
495
496
|
validates: PropTypes.oneOfType([PropTypes.string, PropTypes.object, PropTypes.array, PropTypes.func]),
|
|
496
497
|
/** The value of the input element, required for a controlled component. */
|