diginet-core-ui 1.4.56 → 1.4.57
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.
|
@@ -449,7 +449,12 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef((inProps, reference)
|
|
|
449
449
|
value: value,
|
|
450
450
|
disabled: itemDisabled,
|
|
451
451
|
onChange: e => onChangeValue(e, displayText, value, icon, data, index)
|
|
452
|
-
},
|
|
452
|
+
}, jsx("div", {
|
|
453
|
+
style: {
|
|
454
|
+
display: 'flex',
|
|
455
|
+
alignItems: 'center'
|
|
456
|
+
}
|
|
457
|
+
}, icon, text))));
|
|
453
458
|
} else {
|
|
454
459
|
items.push(jsx("div", {
|
|
455
460
|
key: index,
|
|
@@ -166,12 +166,14 @@ const NumberInput = /*#__PURE__*/forwardRef((inProps, reference) => {
|
|
|
166
166
|
return number;
|
|
167
167
|
}, [decimalSymbol]);
|
|
168
168
|
const _onInput = useCallback((e, flag) => {
|
|
169
|
-
var _e$target$value;
|
|
169
|
+
var _e$target$value, _valueT$toString$repl, _valueT$toString$repl2;
|
|
170
170
|
let valueT = (_e$target$value = e.target.value) !== null && _e$target$value !== void 0 ? _e$target$value : e.value;
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
if (
|
|
174
|
-
|
|
171
|
+
// xóa các số "0" đứng trước giá trị ví dụ: 0100, 0200 để tránh lỗi Octal literals are not allowed in strict mode
|
|
172
|
+
let limitValueT = (_valueT$toString$repl = (_valueT$toString$repl2 = valueT.toString().replaceAll(thousandSymbol, '')).replaceAll) === null || _valueT$toString$repl === void 0 ? void 0 : _valueT$toString$repl.call(_valueT$toString$repl2, decimalSymbol, '.').split(/([+\-*/])/).map(a => parseFloat(a) || a).join('');
|
|
173
|
+
if (disabledNegative && eval(limitValueT) <= 0 || limitValueT.includes('-')) limitValueT = 0;
|
|
174
|
+
if ((min || min === 0) && eval(limitValueT) <= min || min === 0 && limitValueT.includes('-')) limitValueT = min;
|
|
175
|
+
if ((max || max === 0) && eval(limitValueT) >= max) limitValueT = max;
|
|
176
|
+
valueT = parseNumberToMoney(limitValueT);
|
|
175
177
|
const returnValue = convertMoneyToNumber(valueT);
|
|
176
178
|
e.value = globalRef.current.value = !isNaN(parseFloat(returnValue)) ? parseFloat(returnValue) : null;
|
|
177
179
|
// e.target.value = globalRef.current.valueString = valueT || '';
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -42,6 +42,10 @@ npm test
|
|
|
42
42
|
|
|
43
43
|
## Changelog
|
|
44
44
|
|
|
45
|
+
## 1.4.57
|
|
46
|
+
- \[Fixed\]: NumberInput – Fix NumberInput, even with the disabledNegative prop enabled, users can still paste negative values.
|
|
47
|
+
- \[Fixed\]: Dropdown – In the multiple dropdown, the avatar and name are wrapping to the next line
|
|
48
|
+
|
|
45
49
|
## 1.4.56
|
|
46
50
|
- \[Added\]: Icon – Add IconMenu MHRP29N0033, MHRP29N0034
|
|
47
51
|
- \[Added\]: Icon – Add Icon CelebrationColor
|