diginet-core-ui 1.4.57-beta.4 → 1.4.57-beta.6

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.
@@ -171,23 +171,8 @@ const NumberInput = /*#__PURE__*/forwardRef((inProps, reference) => {
171
171
  const _onInput = useCallback((e, flag) => {
172
172
  var _e$target$value;
173
173
  let valueT = (_e$target$value = e.target.value) !== null && _e$target$value !== void 0 ? _e$target$value : e.value;
174
- let limitValueT = valueT;
175
- // không chạy xử lý khi giá trị chỉ có dấu "-"
176
- if (Number(!isNaN(limitValueT))) {
177
- var _valueT$toString$repl, _valueT$toString$repl2;
178
- // 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
179
- 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('');
180
- if (disabledNegative && eval(limitValueT) <= 0) {
181
- limitValueT = 0;
182
- }
183
- if ((min || min === 0) && eval(limitValueT) <= min) {
184
- limitValueT = min;
185
- }
186
- if (max && eval(limitValueT) >= max) {
187
- limitValueT = max;
188
- }
189
- }
190
- valueT = parseNumberToMoney(limitValueT);
174
+ if (disabledNegative && Number(valueT || 0) < 0) return;
175
+ valueT = parseNumberToMoney(valueT);
191
176
  const returnValue = convertMoneyToNumber(valueT);
192
177
  e.value = globalRef.current.value = !isNaN(parseFloat(returnValue)) ? parseFloat(returnValue) : null;
193
178
  // e.target.value = globalRef.current.valueString = valueT || '';
@@ -199,18 +184,42 @@ const NumberInput = /*#__PURE__*/forwardRef((inProps, reference) => {
199
184
  if (flag) _onChange(e);
200
185
  }, [min, max, decimalDigit]);
201
186
  const _onBlur = useCallback(e => {
202
- var _e$value, _e$value2;
187
+ var _e$value, _value$toString$repla, _value$toString$repla2, _e$value2;
203
188
  let value = (_e$value = e.value) !== null && _e$value !== void 0 ? _e$value : e.target.value;
204
189
  if (fixedDecimalDigit) value = Number(value).toFixed(decimalDigit);
205
190
  value = convertMoneyToNumber(value);
206
- if ((min || min === 0) && Number(value) < min || (max || max === 0) && Number(value) > max) {
191
+ let limitValueT = value;
192
+ // 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
193
+ limitValueT = (_value$toString$repla = (_value$toString$repla2 = value.toString().replaceAll(thousandSymbol, '')).replaceAll) === null || _value$toString$repla === void 0 ? void 0 : _value$toString$repla.call(_value$toString$repla2, decimalSymbol, '.').split(/([+\-*/])/).map(a => parseFloat(a) || a).join('');
194
+ // không chạy xử lý khi giá trị chỉ có dấu "-"
195
+ if (limitValueT !== '-' && limitValueT !== '.' && limitValueT !== ',') {
207
196
  const target = e.target;
208
- target.value = clamp(value, min, max);
197
+ if (disabledNegative && eval(limitValueT) <= 0) {
198
+ limitValueT = 0;
199
+ }
200
+ if ((min || min === 0) && eval(limitValueT) <= min) {
201
+ limitValueT = min;
202
+ }
203
+ if (max && eval(limitValueT) >= max) {
204
+ limitValueT = max;
205
+ }
206
+ target.value = clamp(limitValueT, min, max);
209
207
  _onInput({
210
208
  ...e,
211
209
  target
212
210
  }, true);
213
211
  }
212
+ // if (((min || min === 0) && Number(value) < min) || ((max || max === 0) && Number(value) > max)) {
213
+ // const target = e.target;
214
+ // target.value = clamp(value, min, max);
215
+ // _onInput(
216
+ // {
217
+ // ...e,
218
+ // target,
219
+ // },
220
+ // true
221
+ // );
222
+ // }
214
223
  if (((_e$value2 = e.value) !== null && _e$value2 !== void 0 ? _e$value2 : e.target.value).slice(-1) === decimalSymbol) {
215
224
  var _e$value3;
216
225
  const target = e.target;
@@ -223,7 +232,7 @@ const NumberInput = /*#__PURE__*/forwardRef((inProps, reference) => {
223
232
  onBlur && onBlur(e);
224
233
  }, [min, max]);
225
234
  const _onKeyDown = e => {
226
- var _value$split, _value$split$, _value$toString;
235
+ var _value$split, _value$split$;
227
236
  const {
228
237
  key,
229
238
  keyCode,
@@ -288,13 +297,14 @@ const NumberInput = /*#__PURE__*/forwardRef((inProps, reference) => {
288
297
 
289
298
  // disabled negative
290
299
  // const disabled180 = (keyCode === 189 || keyCode === 109) && (disabledNegative || value.includes('-'));
291
- const disabled180 = (keyCode === 189 || keyCode === 109) && (min === 0 || disabledNegative) || ((_value$toString = value.toString()) === null || _value$toString === void 0 ? void 0 : _value$toString[0]) === '-' && (keyCode === 189 || keyCode === 109);
300
+ const disabled180 = (keyCode === 189 || keyCode === 109) && (min === 0 || disabledNegative);
301
+ const disable48 = keyCode === 48 && value.toString() === '0';
292
302
 
293
303
  // disabled max digit
294
304
  const isMaxDigit = maxDigit && (value === null || value === void 0 ? void 0 : value.replace(regexNumber, '').length) === maxDigit && (isNumber || key === thousandSymbol || key === decimalSymbol) && selectionStart === selectionEnd;
295
305
 
296
306
  // Block event if include conditions
297
- if (decimalExists || removeDot || isNumber && disabledTypingDecimal || disabledDecimalSymbol || !allowKeyTypeNumber || disabled180 || isMaxDigit) {
307
+ if (decimalExists || removeDot || isNumber && disabledTypingDecimal || disabledDecimalSymbol || !allowKeyTypeNumber || disabled180 || disable48 || isMaxDigit) {
298
308
  e.preventDefault();
299
309
  }
300
310
  onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e);
package/icons/basic.js CHANGED
@@ -4161,6 +4161,30 @@ export const Minus = /*#__PURE__*/memo(({
4161
4161
  fill: fillColor(color)
4162
4162
  }));
4163
4163
  });
4164
+ export const MilkBottle = /*#__PURE__*/memo(({
4165
+ width,
4166
+ height,
4167
+ color = 'system/rest',
4168
+ viewBox = false
4169
+ }) => {
4170
+ return viewBox ? /*#__PURE__*/React.createElement("svg", {
4171
+ width: width || 24,
4172
+ height: height || 24,
4173
+ viewBox: "0 0 24 24",
4174
+ fill: "none"
4175
+ }, /*#__PURE__*/React.createElement("path", {
4176
+ d: "M10.9782 5.6788C10.7316 5.53938 10.572 5.33908 10.4994 5.07791C10.4269 4.81674 10.4603 4.56283 10.5998 4.31617C10.7392 4.06952 10.9395 3.90992 11.2007 3.83738C11.4618 3.76484 11.7157 3.79829 11.9624 3.93771L14.574 5.41397L15.5582 3.67288C15.6976 3.42622 15.8979 3.26662 16.1591 3.19409C16.4203 3.12155 16.6742 3.15499 16.9208 3.29441C17.1675 3.43384 17.3271 3.63414 17.3996 3.89531C17.4722 4.15648 17.4387 4.41039 17.2993 4.65705L16.3151 6.39814L18.9268 7.8744C19.1734 8.01382 19.333 8.21412 19.4056 8.47529C19.4781 8.73646 19.4447 8.99038 19.3052 9.23703C19.1658 9.48369 18.9655 9.64328 18.7043 9.71582C18.4432 9.78836 18.1893 9.75492 17.9426 9.61549L10.9782 5.6788ZM4.46749 19.2291C3.98869 18.9584 3.67517 18.5563 3.52694 18.0226C3.37871 17.4889 3.43992 16.9826 3.71057 16.5038L4.69474 14.7627L8.17693 16.7311C8.42358 16.8705 8.67749 16.9039 8.93866 16.8314C9.19984 16.7589 9.40013 16.5993 9.53956 16.3526C9.67898 16.106 9.71243 15.852 9.63989 15.5909C9.56735 15.3297 9.40775 15.1294 9.1611 14.99L5.67891 13.0216L6.66308 11.2805L10.1453 13.2489C10.3919 13.3883 10.6458 13.4218 10.907 13.3492C11.1682 13.2767 11.3685 13.1171 11.5079 12.8704C11.6473 12.6238 11.6808 12.3699 11.6082 12.1087C11.5357 11.8475 11.3761 11.6472 11.1294 11.5078L7.64726 9.53945L8.13934 8.6689C8.54941 7.94345 9.15188 7.47034 9.94675 7.24957C10.7416 7.0288 11.5018 7.12345 12.2272 7.53352L15.7094 9.50187C16.4349 9.91194 16.908 10.5144 17.1288 11.3093C17.3495 12.1041 17.2549 12.8643 16.8448 13.5898L12.416 21.4247C12.1454 21.9035 11.7432 22.217 11.2095 22.3652C10.6758 22.5135 10.1696 22.4523 9.69077 22.1816L4.46749 19.2291Z",
4177
+ fill: fillColor(color)
4178
+ })) : /*#__PURE__*/React.createElement("svg", {
4179
+ width: width || 19,
4180
+ height: height || 23,
4181
+ viewBox: "0 0 19 23",
4182
+ fill: "none"
4183
+ }, /*#__PURE__*/React.createElement("path", {
4184
+ d: "M8.25191 4.84482C8.00526 4.70539 7.84566 4.5051 7.77312 4.24393C7.70059 3.98275 7.73403 3.72884 7.87345 3.48219C8.01288 3.23553 8.21317 3.07593 8.47435 3.0034C8.73552 2.93086 8.98943 2.9643 9.23609 3.10373L11.8477 4.57998L12.8319 2.83889C12.9713 2.59224 13.1716 2.43264 13.4328 2.3601C13.694 2.28756 13.9479 2.32101 14.1945 2.46043C14.4412 2.59985 14.6008 2.80015 14.6733 3.06132C14.7459 3.32249 14.7124 3.57641 14.573 3.82306L13.5888 5.56416L16.2005 7.04041C16.4471 7.17984 16.6067 7.38014 16.6792 7.64131C16.7518 7.90248 16.7183 8.15639 16.5789 8.40305C16.4395 8.6497 16.2392 8.8093 15.978 8.88184C15.7169 8.95437 15.4629 8.92093 15.2163 8.78151L8.25191 4.84482ZM1.74117 18.3951C1.26237 18.1245 0.948853 17.7223 0.800623 17.1886C0.652392 16.6549 0.713601 16.1486 0.984248 15.6698L1.96842 13.9287L5.45061 15.8971C5.69726 16.0365 5.95117 16.07 6.21235 15.9974C6.47352 15.9249 6.67381 15.7653 6.81324 15.5186C6.95266 15.272 6.98611 15.0181 6.91357 14.7569C6.84103 14.4957 6.68143 14.2954 6.43478 14.156L2.95259 12.1877L3.93676 10.4466L7.41895 12.4149C7.66561 12.5543 7.91952 12.5878 8.18069 12.5152C8.44186 12.4427 8.64216 12.2831 8.78158 12.0364C8.92101 11.7898 8.95445 11.5359 8.88191 11.2747C8.80937 11.0135 8.64978 10.8132 8.40312 10.6738L4.92094 8.70547L5.41302 7.83492C5.82309 7.10946 6.42556 6.63635 7.22043 6.41558C8.0153 6.19481 8.77547 6.28947 9.50092 6.69954L12.9831 8.66788C13.7086 9.07795 14.1817 9.68042 14.4024 10.4753C14.6232 11.2702 14.5286 12.0303 14.1185 12.7558L9.68971 20.5907C9.41907 21.0695 9.01689 21.383 8.4832 21.5312C7.9495 21.6795 7.44325 21.6183 6.96445 21.3476L1.74117 18.3951Z",
4185
+ fill: fillColor(color)
4186
+ }));
4187
+ });
4164
4188
  export const ModuleView = /*#__PURE__*/memo(({
4165
4189
  width,
4166
4190
  height,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "diginet-core-ui",
3
- "version": "1.4.57-beta.4",
3
+ "version": "1.4.57-beta.6",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "license": "UNLICENSED",