vxe-pc-ui 3.14.37 → 3.14.39

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.
Files changed (35) hide show
  1. package/es/input/src/input.js +2 -2
  2. package/es/number-input/src/number-input.js +25 -10
  3. package/es/number-input/src/util.js +17 -5
  4. package/es/ui/index.js +1 -1
  5. package/es/ui/src/log.js +1 -1
  6. package/lib/index.umd.js +48 -20
  7. package/lib/index.umd.min.js +1 -1
  8. package/lib/input/src/input.js +2 -2
  9. package/lib/input/src/input.min.js +1 -1
  10. package/lib/number-input/src/number-input.js +26 -9
  11. package/lib/number-input/src/number-input.min.js +1 -1
  12. package/lib/number-input/src/util.js +16 -5
  13. package/lib/number-input/src/util.min.js +1 -1
  14. package/lib/ui/index.js +1 -1
  15. package/lib/ui/index.min.js +1 -1
  16. package/lib/ui/src/log.js +1 -1
  17. package/lib/ui/src/log.min.js +1 -1
  18. package/package.json +2 -2
  19. package/packages/input/src/input.ts +2 -2
  20. package/packages/number-input/src/number-input.ts +24 -11
  21. package/packages/number-input/src/util.ts +18 -5
  22. package/types/components/number-input.d.ts +12 -1
  23. package/types/components/table.d.ts +33 -124
  24. /package/es/icon/{iconfont.1781322540629.ttf → iconfont.1781503187022.ttf} +0 -0
  25. /package/es/icon/{iconfont.1781322540629.woff → iconfont.1781503187022.woff} +0 -0
  26. /package/es/icon/{iconfont.1781322540629.woff2 → iconfont.1781503187022.woff2} +0 -0
  27. /package/es/{iconfont.1781322540629.ttf → iconfont.1781503187022.ttf} +0 -0
  28. /package/es/{iconfont.1781322540629.woff → iconfont.1781503187022.woff} +0 -0
  29. /package/es/{iconfont.1781322540629.woff2 → iconfont.1781503187022.woff2} +0 -0
  30. /package/lib/icon/style/{iconfont.1781322540629.ttf → iconfont.1781503187022.ttf} +0 -0
  31. /package/lib/icon/style/{iconfont.1781322540629.woff → iconfont.1781503187022.woff} +0 -0
  32. /package/lib/icon/style/{iconfont.1781322540629.woff2 → iconfont.1781503187022.woff2} +0 -0
  33. /package/lib/{iconfont.1781322540629.ttf → iconfont.1781503187022.ttf} +0 -0
  34. /package/lib/{iconfont.1781322540629.woff → iconfont.1781503187022.woff} +0 -0
  35. /package/lib/{iconfont.1781322540629.woff2 → iconfont.1781503187022.woff2} +0 -0
@@ -882,7 +882,7 @@ export default {
882
882
  const { type, exponential } = props;
883
883
  const inpMaxLength = $xeInput.computeInpMaxLength;
884
884
  const digitsValue = $xeInput.computeDigitsValue;
885
- const restVal = (type === 'float' ? toFloatValueFixed(val, digitsValue) : XEUtils.toValueString(val));
885
+ const restVal = (type === 'float' ? toFloatValueFixed(val, digitsValue, '') : XEUtils.toValueString(val));
886
886
  if (exponential && (val === restVal || XEUtils.toValueString(val).toLowerCase() === XEUtils.toNumber(restVal).toExponential())) {
887
887
  return val;
888
888
  }
@@ -1105,7 +1105,7 @@ export default {
1105
1105
  }
1106
1106
  else if (type === 'float') {
1107
1107
  if (inputValue) {
1108
- const validValue = toFloatValueFixed(inputValue, digitsValue);
1108
+ const validValue = toFloatValueFixed(inputValue, digitsValue, '');
1109
1109
  if (inputValue !== validValue) {
1110
1110
  $xeInput.handleChange(validValue, { type: 'init' });
1111
1111
  }
@@ -83,6 +83,11 @@ export default {
83
83
  },
84
84
  controlConfig: Object,
85
85
  // float
86
+ roundingMode: {
87
+ type: String,
88
+ default: null
89
+ },
90
+ // float
86
91
  digits: {
87
92
  type: [String, Number],
88
93
  default: null
@@ -274,12 +279,22 @@ export default {
274
279
  const $xeNumberInput = this;
275
280
  const props = $xeNumberInput;
276
281
  const reactData = $xeNumberInput.reactData;
277
- const { type, showCurrency, currencySymbol, autoFill } = props;
282
+ const { type, roundingMode, showCurrency, currencySymbol, autoFill } = props;
278
283
  const { inputValue } = reactData;
279
284
  const digitsValue = $xeNumberInput.computeDigitsValue;
280
285
  if (type === 'amount') {
281
286
  const num = XEUtils.toNumber(inputValue);
282
- let amountLabel = XEUtils.commafy(num, { digits: digitsValue });
287
+ const cfyOpts = { digits: digitsValue };
288
+ if (roundingMode === 'floor') {
289
+ cfyOpts.floor = true;
290
+ }
291
+ else if (roundingMode === 'ceil') {
292
+ cfyOpts.ceil = true;
293
+ }
294
+ else {
295
+ cfyOpts.round = true;
296
+ }
297
+ let amountLabel = XEUtils.commafy(num, cfyOpts);
283
298
  if (!autoFill) {
284
299
  const [iStr, dStr] = amountLabel.split('.');
285
300
  if (dStr) {
@@ -368,13 +383,13 @@ export default {
368
383
  getNumberValue(val) {
369
384
  const $xeNumberInput = this;
370
385
  const props = $xeNumberInput;
371
- const { exponential, autoFill } = props;
386
+ const { exponential, roundingMode, autoFill } = props;
372
387
  const inpMaxLength = $xeNumberInput.computeInpMaxLength;
373
388
  const digitsValue = $xeNumberInput.computeDigitsValue;
374
389
  const decimalsType = $xeNumberInput.computeDecimalsType;
375
390
  let restVal = '';
376
391
  if (decimalsType) {
377
- restVal = toFloatValueFixed(val, digitsValue);
392
+ restVal = toFloatValueFixed(val, digitsValue, roundingMode);
378
393
  if (!autoFill) {
379
394
  restVal = handleNumberString(XEUtils.toNumber(restVal));
380
395
  }
@@ -489,7 +504,7 @@ export default {
489
504
  const $xeNumberInput = this;
490
505
  const props = $xeNumberInput;
491
506
  const reactData = $xeNumberInput.reactData;
492
- const { autoFill } = props;
507
+ const { roundingMode, autoFill } = props;
493
508
  const { inputValue } = reactData;
494
509
  const digitsValue = $xeNumberInput.computeDigitsValue;
495
510
  const decimalsType = $xeNumberInput.computeDecimalsType;
@@ -497,11 +512,11 @@ export default {
497
512
  reactData.inputValue = '';
498
513
  }
499
514
  else {
500
- let textValue = `${val}`;
515
+ let textValue = '' + val;
501
516
  if (decimalsType) {
502
- textValue = toFloatValueFixed(val, digitsValue);
517
+ textValue = toFloatValueFixed(val, digitsValue, roundingMode);
503
518
  if (!autoFill) {
504
- textValue = `${XEUtils.toNumber(textValue)}`;
519
+ textValue = '' + XEUtils.toNumber(textValue);
505
520
  }
506
521
  }
507
522
  if (textValue !== inputValue) {
@@ -516,7 +531,7 @@ export default {
516
531
  const $xeNumberInput = this;
517
532
  const props = $xeNumberInput;
518
533
  const reactData = $xeNumberInput.reactData;
519
- const { autoFill } = props;
534
+ const { roundingMode, autoFill } = props;
520
535
  const { inputValue } = reactData;
521
536
  const digitsValue = $xeNumberInput.computeDigitsValue;
522
537
  const decimalsType = $xeNumberInput.computeDecimalsType;
@@ -525,7 +540,7 @@ export default {
525
540
  let textValue = '';
526
541
  let validValue = null;
527
542
  if (inputValue) {
528
- textValue = toFloatValueFixed(inputValue, digitsValue);
543
+ textValue = toFloatValueFixed(inputValue, digitsValue, roundingMode);
529
544
  validValue = XEUtils.toNumber(textValue);
530
545
  if (!autoFill) {
531
546
  textValue = `${validValue}`;
@@ -1,10 +1,22 @@
1
1
  import XEUtils from 'xe-utils';
2
2
  export function handleNumber(val) {
3
- return XEUtils.isString(val) ? val.replace(/,/g, '') : val;
3
+ return XEUtils.isString(val) ? val.replace(/[^0-9e.-]/g, '') : val;
4
4
  }
5
- export function toFloatValueFixed(inputValue, digitsValue) {
6
- if (/^-/.test('' + inputValue)) {
7
- return XEUtils.toFixed(XEUtils.ceil(inputValue, digitsValue), digitsValue);
5
+ export function toFloatValueFixed(inputValue, digitsValue, roundingMode) {
6
+ if (!roundingMode || roundingMode === 'default') {
7
+ // 默认截取忽略
8
+ if (/^-/.test('' + inputValue)) {
9
+ return XEUtils.toFixed(XEUtils.ceil(inputValue, digitsValue), digitsValue);
10
+ }
11
+ return XEUtils.toFixed(XEUtils.floor(inputValue, digitsValue), digitsValue);
12
+ }
13
+ else {
14
+ if (roundingMode === 'ceil') {
15
+ return XEUtils.toFixed(XEUtils.ceil(inputValue, digitsValue), digitsValue);
16
+ }
17
+ if (roundingMode === 'floor') {
18
+ return XEUtils.toFixed(XEUtils.floor(inputValue, digitsValue), digitsValue);
19
+ }
20
+ return XEUtils.toFixed(XEUtils.round(inputValue, digitsValue), digitsValue);
8
21
  }
9
- return XEUtils.toFixed(XEUtils.floor(inputValue, digitsValue), digitsValue);
10
22
  }
package/es/ui/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { VxeUI, setConfig, setIcon } from '@vxe-ui/core';
2
2
  import { dynamicApp } from '../dynamics';
3
3
  import { warnLog } from './src/log';
4
- export const version = "3.14.37";
4
+ export const version = "3.14.39";
5
5
  VxeUI.uiVersion = version;
6
6
  VxeUI.dynamicApp = dynamicApp;
7
7
  export function config(options) {
package/es/ui/src/log.js CHANGED
@@ -1,4 +1,4 @@
1
1
  import { log } from '@vxe-ui/core';
2
- const version = `ui v${"3.14.37"}`;
2
+ const version = `ui v${"3.14.39"}`;
3
3
  export const warnLog = log.create('warn', version);
4
4
  export const errLog = log.create('error', version);
package/lib/index.umd.js CHANGED
@@ -11642,7 +11642,7 @@ var es_regexp_exec = __webpack_require__(7495);
11642
11642
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.match.js
11643
11643
  var es_string_match = __webpack_require__(1761);
11644
11644
  ;// ./node_modules/@vxe-ui/core/es/src/core.js
11645
- var coreVersion = "3.4.12";
11645
+ var coreVersion = "3.4.14";
11646
11646
  var VxeCore = {
11647
11647
  coreVersion: coreVersion,
11648
11648
  uiVersion: '',
@@ -12402,7 +12402,7 @@ function createLog(type, name) {
12402
12402
  return msg;
12403
12403
  };
12404
12404
  }
12405
- var version = "3.4.12";
12405
+ var version = "3.4.14";
12406
12406
  var log = {
12407
12407
  create: createLog,
12408
12408
  warn: createLog('warn', "v".concat(version)),
@@ -13214,7 +13214,7 @@ function checkDynamic() {
13214
13214
  }
13215
13215
  ;// ./packages/ui/src/log.ts
13216
13216
 
13217
- var log_version = "ui v".concat("3.14.37");
13217
+ var log_version = "ui v".concat("3.14.39");
13218
13218
  var warnLog = log.create('warn', log_version);
13219
13219
  var errLog = log.create('error', log_version);
13220
13220
  ;// ./packages/ui/index.ts
@@ -13222,7 +13222,7 @@ var errLog = log.create('error', log_version);
13222
13222
 
13223
13223
 
13224
13224
 
13225
- var ui_version = "3.14.37";
13225
+ var ui_version = "3.14.39";
13226
13226
  VxeUI.uiVersion = ui_version;
13227
13227
  VxeUI.dynamicApp = dynamicApp;
13228
13228
  function config(options) {
@@ -21121,13 +21121,24 @@ var es_number_to_fixed = __webpack_require__(9868);
21121
21121
 
21122
21122
 
21123
21123
  function handleNumber(val) {
21124
- return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(val) ? val.replace(/,/g, '') : val;
21124
+ return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(val) ? val.replace(/[^0-9e.-]/g, '') : val;
21125
21125
  }
21126
- function toFloatValueFixed(inputValue, digitsValue) {
21127
- if (/^-/.test('' + inputValue)) {
21128
- return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toFixed(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().ceil(inputValue, digitsValue), digitsValue);
21126
+ function toFloatValueFixed(inputValue, digitsValue, roundingMode) {
21127
+ if (!roundingMode || roundingMode === 'default') {
21128
+ // 默认截取忽略
21129
+ if (/^-/.test('' + inputValue)) {
21130
+ return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toFixed(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().ceil(inputValue, digitsValue), digitsValue);
21131
+ }
21132
+ return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toFixed(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().floor(inputValue, digitsValue), digitsValue);
21133
+ } else {
21134
+ if (roundingMode === 'ceil') {
21135
+ return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toFixed(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().ceil(inputValue, digitsValue), digitsValue);
21136
+ }
21137
+ if (roundingMode === 'floor') {
21138
+ return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toFixed(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().floor(inputValue, digitsValue), digitsValue);
21139
+ }
21140
+ return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toFixed(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().round(inputValue, digitsValue), digitsValue);
21129
21141
  }
21130
- return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toFixed(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().floor(inputValue, digitsValue), digitsValue);
21131
21142
  }
21132
21143
  ;// ./packages/input/src/input.ts
21133
21144
 
@@ -22085,7 +22096,7 @@ function toFloatValueFixed(inputValue, digitsValue) {
22085
22096
  exponential = props.exponential;
22086
22097
  var inpMaxLength = $xeInput.computeInpMaxLength;
22087
22098
  var digitsValue = $xeInput.computeDigitsValue;
22088
- var restVal = type === 'float' ? toFloatValueFixed(val, digitsValue) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toValueString(val);
22099
+ var restVal = type === 'float' ? toFloatValueFixed(val, digitsValue, '') : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toValueString(val);
22089
22100
  if (exponential && (val === restVal || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toValueString(val).toLowerCase() === external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(restVal).toExponential())) {
22090
22101
  return val;
22091
22102
  }
@@ -22327,7 +22338,7 @@ function toFloatValueFixed(inputValue, digitsValue) {
22327
22338
  $xeInput.changeValue();
22328
22339
  } else if (type === 'float') {
22329
22340
  if (inputValue) {
22330
- var validValue = toFloatValueFixed(inputValue, digitsValue);
22341
+ var validValue = toFloatValueFixed(inputValue, digitsValue, '');
22331
22342
  if (inputValue !== validValue) {
22332
22343
  $xeInput.handleChange(validValue, {
22333
22344
  type: 'init'
@@ -26798,6 +26809,11 @@ var handleNumberString = function handleNumberString(val) {
26798
26809
  },
26799
26810
  controlConfig: Object,
26800
26811
  // float
26812
+ roundingMode: {
26813
+ type: String,
26814
+ default: null
26815
+ },
26816
+ // float
26801
26817
  digits: {
26802
26818
  type: [String, Number],
26803
26819
  default: null
@@ -26997,6 +27013,7 @@ var handleNumberString = function handleNumberString(val) {
26997
27013
  var props = $xeNumberInput;
26998
27014
  var reactData = $xeNumberInput.reactData;
26999
27015
  var type = props.type,
27016
+ roundingMode = props.roundingMode,
27000
27017
  showCurrency = props.showCurrency,
27001
27018
  currencySymbol = props.currencySymbol,
27002
27019
  autoFill = props.autoFill;
@@ -27004,9 +27021,17 @@ var handleNumberString = function handleNumberString(val) {
27004
27021
  var digitsValue = $xeNumberInput.computeDigitsValue;
27005
27022
  if (type === 'amount') {
27006
27023
  var num = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(inputValue);
27007
- var amountLabel = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().commafy(num, {
27024
+ var cfyOpts = {
27008
27025
  digits: digitsValue
27009
- });
27026
+ };
27027
+ if (roundingMode === 'floor') {
27028
+ cfyOpts.floor = true;
27029
+ } else if (roundingMode === 'ceil') {
27030
+ cfyOpts.ceil = true;
27031
+ } else {
27032
+ cfyOpts.round = true;
27033
+ }
27034
+ var amountLabel = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().commafy(num, cfyOpts);
27010
27035
  if (!autoFill) {
27011
27036
  var _amountLabel$split = amountLabel.split('.'),
27012
27037
  _amountLabel$split2 = _slicedToArray(_amountLabel$split, 2),
@@ -27101,13 +27126,14 @@ var handleNumberString = function handleNumberString(val) {
27101
27126
  var $xeNumberInput = this;
27102
27127
  var props = $xeNumberInput;
27103
27128
  var exponential = props.exponential,
27129
+ roundingMode = props.roundingMode,
27104
27130
  autoFill = props.autoFill;
27105
27131
  var inpMaxLength = $xeNumberInput.computeInpMaxLength;
27106
27132
  var digitsValue = $xeNumberInput.computeDigitsValue;
27107
27133
  var decimalsType = $xeNumberInput.computeDecimalsType;
27108
27134
  var restVal = '';
27109
27135
  if (decimalsType) {
27110
- restVal = toFloatValueFixed(val, digitsValue);
27136
+ restVal = toFloatValueFixed(val, digitsValue, roundingMode);
27111
27137
  if (!autoFill) {
27112
27138
  restVal = handleNumberString(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(restVal));
27113
27139
  }
@@ -27238,18 +27264,19 @@ var handleNumberString = function handleNumberString(val) {
27238
27264
  var $xeNumberInput = this;
27239
27265
  var props = $xeNumberInput;
27240
27266
  var reactData = $xeNumberInput.reactData;
27241
- var autoFill = props.autoFill;
27267
+ var roundingMode = props.roundingMode,
27268
+ autoFill = props.autoFill;
27242
27269
  var inputValue = reactData.inputValue;
27243
27270
  var digitsValue = $xeNumberInput.computeDigitsValue;
27244
27271
  var decimalsType = $xeNumberInput.computeDecimalsType;
27245
27272
  if (eqEmptyValue(val)) {
27246
27273
  reactData.inputValue = '';
27247
27274
  } else {
27248
- var textValue = "".concat(val);
27275
+ var textValue = '' + val;
27249
27276
  if (decimalsType) {
27250
- textValue = toFloatValueFixed(val, digitsValue);
27277
+ textValue = toFloatValueFixed(val, digitsValue, roundingMode);
27251
27278
  if (!autoFill) {
27252
- textValue = "".concat(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(textValue));
27279
+ textValue = '' + external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(textValue);
27253
27280
  }
27254
27281
  }
27255
27282
  if (textValue !== inputValue) {
@@ -27264,7 +27291,8 @@ var handleNumberString = function handleNumberString(val) {
27264
27291
  var $xeNumberInput = this;
27265
27292
  var props = $xeNumberInput;
27266
27293
  var reactData = $xeNumberInput.reactData;
27267
- var autoFill = props.autoFill;
27294
+ var roundingMode = props.roundingMode,
27295
+ autoFill = props.autoFill;
27268
27296
  var inputValue = reactData.inputValue;
27269
27297
  var digitsValue = $xeNumberInput.computeDigitsValue;
27270
27298
  var decimalsType = $xeNumberInput.computeDecimalsType;
@@ -27273,7 +27301,7 @@ var handleNumberString = function handleNumberString(val) {
27273
27301
  var textValue = '';
27274
27302
  var validValue = null;
27275
27303
  if (inputValue) {
27276
- textValue = toFloatValueFixed(inputValue, digitsValue);
27304
+ textValue = toFloatValueFixed(inputValue, digitsValue, roundingMode);
27277
27305
  validValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(textValue);
27278
27306
  if (!autoFill) {
27279
27307
  textValue = "".concat(validValue);