vxe-pc-ui 4.17.16 → 4.17.18

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 (38) hide show
  1. package/dist/all.esm.js +23 -5
  2. package/dist/style.css +1 -1
  3. package/dist/style.min.css +1 -1
  4. package/es/icon/style.css +1 -1
  5. package/es/number-input/src/number-input.js +20 -3
  6. package/es/style.css +1 -1
  7. package/es/style.min.css +1 -1
  8. package/es/ui/index.js +2 -1
  9. package/es/ui/src/log.js +1 -1
  10. package/lib/icon/style/style.css +1 -1
  11. package/lib/icon/style/style.min.css +1 -1
  12. package/lib/index.umd.js +22 -4
  13. package/lib/index.umd.min.js +1 -1
  14. package/lib/number-input/src/number-input.js +19 -2
  15. package/lib/number-input/src/number-input.min.js +1 -1
  16. package/lib/style.css +1 -1
  17. package/lib/style.min.css +1 -1
  18. package/lib/ui/index.js +2 -1
  19. package/lib/ui/index.min.js +1 -1
  20. package/lib/ui/src/log.js +1 -1
  21. package/lib/ui/src/log.min.js +1 -1
  22. package/package.json +1 -1
  23. package/packages/number-input/src/number-input.ts +21 -3
  24. package/packages/ui/index.ts +1 -0
  25. package/types/components/number-input.d.ts +5 -0
  26. package/types/components/table.d.ts +10 -3
  27. /package/es/icon/{iconfont.1787560614772.ttf → iconfont.1787676822035.ttf} +0 -0
  28. /package/es/icon/{iconfont.1787560614772.woff → iconfont.1787676822035.woff} +0 -0
  29. /package/es/icon/{iconfont.1787560614772.woff2 → iconfont.1787676822035.woff2} +0 -0
  30. /package/es/{iconfont.1787560614772.ttf → iconfont.1787676822035.ttf} +0 -0
  31. /package/es/{iconfont.1787560614772.woff → iconfont.1787676822035.woff} +0 -0
  32. /package/es/{iconfont.1787560614772.woff2 → iconfont.1787676822035.woff2} +0 -0
  33. /package/lib/icon/style/{iconfont.1787560614772.ttf → iconfont.1787676822035.ttf} +0 -0
  34. /package/lib/icon/style/{iconfont.1787560614772.woff → iconfont.1787676822035.woff} +0 -0
  35. /package/lib/icon/style/{iconfont.1787560614772.woff2 → iconfont.1787676822035.woff2} +0 -0
  36. /package/lib/{iconfont.1787560614772.ttf → iconfont.1787676822035.ttf} +0 -0
  37. /package/lib/{iconfont.1787560614772.woff → iconfont.1787676822035.woff} +0 -0
  38. /package/lib/{iconfont.1787560614772.woff2 → iconfont.1787676822035.woff2} +0 -0
package/dist/all.esm.js CHANGED
@@ -81,7 +81,7 @@ function checkDynamic() {
81
81
  }
82
82
 
83
83
  const { log } = VxeUI;
84
- const uiVersion = `ui v${"4.17.16"}`;
84
+ const uiVersion = `ui v${"4.17.18"}`;
85
85
  function createComponentLog(name) {
86
86
  const tableVersion = VxeUI.tableVersion ? `table v${VxeUI.tableVersion}` : '';
87
87
  const ganttVersion = VxeUI.ganttVersion ? `gantt v${VxeUI.ganttVersion}` : '';
@@ -95,7 +95,7 @@ function createComponentLog(name) {
95
95
  const warnLog$i = log.create('warn', uiVersion);
96
96
  log.create('error', uiVersion);
97
97
 
98
- const version = "4.17.16";
98
+ const version = "4.17.18";
99
99
  VxeUI.uiVersion = version;
100
100
  VxeUI.dynamicApp = dynamicApp;
101
101
  function config(options) {
@@ -382,6 +382,7 @@ setConfig$1({
382
382
  // transfer: false
383
383
  digits: 2,
384
384
  autoFill: true,
385
+ negative: true,
385
386
  controlConfig: {
386
387
  enabled: true,
387
388
  layout: 'right',
@@ -15210,6 +15211,10 @@ var VxeNumberInputComponent = defineVxeComponent({
15210
15211
  type: Boolean,
15211
15212
  default: () => getConfig$3().numberInput.exponential
15212
15213
  },
15214
+ negative: {
15215
+ type: Boolean,
15216
+ default: () => getConfig$3().numberInput.negative
15217
+ },
15213
15218
  showCurrency: {
15214
15219
  type: Boolean,
15215
15220
  default: () => getConfig$3().numberInput.showCurrency
@@ -15631,11 +15636,15 @@ var VxeNumberInputComponent = defineVxeComponent({
15631
15636
  return props.min === null || props.min === '' || XEUtils.toNumber(num) >= XEUtils.toNumber(props.min);
15632
15637
  };
15633
15638
  const afterCheckValue = () => {
15634
- const { type, min, max, exponential } = props;
15639
+ const { type, min, max, negative, exponential, clearable } = props;
15635
15640
  const { inputValue } = reactData;
15636
15641
  const inputReadonly = computeInputReadonly.value;
15637
15642
  if (!inputReadonly) {
15638
15643
  if (eqEmptyValue(inputValue)) {
15644
+ if (clearable) {
15645
+ handleChange(null, '', { type: 'check' });
15646
+ return;
15647
+ }
15639
15648
  let inpNumVal = null;
15640
15649
  let inpValue = inputValue;
15641
15650
  if (min || min === 0) {
@@ -15653,6 +15662,9 @@ var VxeNumberInputComponent = defineVxeComponent({
15653
15662
  else if (!validMaxNum(inpNumVal)) {
15654
15663
  inpNumVal = max;
15655
15664
  }
15665
+ if (!negative) {
15666
+ inpNumVal = Math.abs(inpNumVal);
15667
+ }
15656
15668
  if (exponential) {
15657
15669
  const inpStringVal = handleNumberString(inputValue).toLowerCase();
15658
15670
  if (inpStringVal === XEUtils.toNumber(inpNumVal).toExponential()) {
@@ -15739,19 +15751,25 @@ var VxeNumberInputComponent = defineVxeComponent({
15739
15751
  }
15740
15752
  };
15741
15753
  const keydownEvent = (evnt) => {
15742
- const { type, exponential, controls } = props;
15754
+ const { type, negative, exponential, controls } = props;
15743
15755
  const controlOpts = computeControlOpts.value;
15744
15756
  const { isArrow } = controlOpts;
15745
15757
  const inputReadonly = computeInputReadonly.value;
15746
15758
  const isControlKey = hasControlKey(evnt);
15747
15759
  const isShiftKey = evnt.shiftKey;
15748
15760
  const isAltKey = evnt.altKey;
15761
+ const key = evnt.key;
15749
15762
  const keyCode = evnt.keyCode;
15750
15763
  const isEsc = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ESCAPE);
15751
15764
  const isUpArrow = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ARROW_UP);
15752
15765
  const isDwArrow = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ARROW_DOWN);
15753
15766
  if (!isControlKey && !isShiftKey && !isAltKey) {
15754
- if (globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.SPACEBAR) || (type === 'integer' && keyCode === 110) || ((!exponential || keyCode !== 69) && (keyCode >= 65 && keyCode <= 90)) || (keyCode >= 186 && keyCode <= 188) || keyCode >= 191) {
15767
+ if (globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.SPACEBAR) ||
15768
+ (!negative && key === '-') ||
15769
+ (type === 'integer' && key === '.') ||
15770
+ ((!exponential || keyCode !== 69) && (keyCode >= 65 && keyCode <= 90)) ||
15771
+ (keyCode >= 186 && keyCode <= 188) ||
15772
+ keyCode >= 191) {
15755
15773
  evnt.preventDefault();
15756
15774
  }
15757
15775
  }