vxe-pc-ui 4.5.31 → 4.5.33

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 (74) hide show
  1. package/es/form/style.css +12 -12
  2. package/es/form/style.min.css +1 -1
  3. package/es/icon/style.css +1 -1
  4. package/es/input/src/input.js +2 -2
  5. package/es/number-input/src/number-input.js +248 -165
  6. package/es/number-input/style.css +74 -770
  7. package/es/number-input/style.min.css +1 -1
  8. package/es/style.css +1 -1
  9. package/es/style.min.css +1 -1
  10. package/es/tooltip/style.css +1 -1
  11. package/es/tooltip/style.min.css +1 -1
  12. package/es/ui/index.js +11 -4
  13. package/es/ui/src/dom.js +1 -1
  14. package/es/ui/src/log.js +1 -1
  15. package/es/vxe-form/style.css +12 -12
  16. package/es/vxe-form/style.min.css +1 -1
  17. package/es/vxe-number-input/style.css +74 -770
  18. package/es/vxe-number-input/style.min.css +1 -1
  19. package/es/vxe-tooltip/style.css +1 -1
  20. package/es/vxe-tooltip/style.min.css +1 -1
  21. package/lib/form/style/style.css +12 -12
  22. package/lib/form/style/style.min.css +1 -1
  23. package/lib/icon/style/style.css +1 -1
  24. package/lib/icon/style/style.min.css +1 -1
  25. package/lib/index.umd.js +255 -160
  26. package/lib/index.umd.min.js +1 -1
  27. package/lib/input/src/input.js +2 -2
  28. package/lib/input/src/input.min.js +1 -1
  29. package/lib/number-input/src/number-input.js +240 -152
  30. package/lib/number-input/src/number-input.min.js +1 -1
  31. package/lib/number-input/style/style.css +74 -770
  32. package/lib/number-input/style/style.min.css +1 -1
  33. package/lib/style.css +1 -1
  34. package/lib/style.min.css +1 -1
  35. package/lib/tooltip/style/style.css +1 -1
  36. package/lib/tooltip/style/style.min.css +1 -1
  37. package/lib/ui/index.js +11 -4
  38. package/lib/ui/index.min.js +1 -1
  39. package/lib/ui/src/dom.js +1 -1
  40. package/lib/ui/src/dom.min.js +1 -1
  41. package/lib/ui/src/log.js +1 -1
  42. package/lib/ui/src/log.min.js +1 -1
  43. package/lib/vxe-form/style/style.css +12 -12
  44. package/lib/vxe-form/style/style.min.css +1 -1
  45. package/lib/vxe-number-input/style/style.css +74 -770
  46. package/lib/vxe-number-input/style/style.min.css +1 -1
  47. package/lib/vxe-tooltip/style/style.css +1 -1
  48. package/lib/vxe-tooltip/style/style.min.css +1 -1
  49. package/package.json +1 -1
  50. package/packages/input/src/input.ts +2 -2
  51. package/packages/number-input/src/number-input.ts +264 -177
  52. package/packages/ui/index.ts +10 -3
  53. package/packages/ui/src/dom.ts +1 -1
  54. package/styles/components/form.scss +12 -12
  55. package/styles/components/number-input.scss +73 -598
  56. package/styles/components/tooltip.scss +1 -1
  57. package/styles/theme/base.scss +4 -4
  58. package/styles/theme/dark.scss +3 -0
  59. package/styles/theme/light.scss +3 -0
  60. package/types/components/number-input.d.ts +80 -6
  61. package/types/components/table.d.ts +4 -1
  62. package/types/ui/global-icon.d.ts +4 -2
  63. /package/es/icon/{iconfont.1745654997780.ttf → iconfont.1745889662360.ttf} +0 -0
  64. /package/es/icon/{iconfont.1745654997780.woff → iconfont.1745889662360.woff} +0 -0
  65. /package/es/icon/{iconfont.1745654997780.woff2 → iconfont.1745889662360.woff2} +0 -0
  66. /package/es/{iconfont.1745654997780.ttf → iconfont.1745889662360.ttf} +0 -0
  67. /package/es/{iconfont.1745654997780.woff → iconfont.1745889662360.woff} +0 -0
  68. /package/es/{iconfont.1745654997780.woff2 → iconfont.1745889662360.woff2} +0 -0
  69. /package/lib/icon/style/{iconfont.1745654997780.ttf → iconfont.1745889662360.ttf} +0 -0
  70. /package/lib/icon/style/{iconfont.1745654997780.woff → iconfont.1745889662360.woff} +0 -0
  71. /package/lib/icon/style/{iconfont.1745654997780.woff2 → iconfont.1745889662360.woff2} +0 -0
  72. /package/lib/{iconfont.1745654997780.ttf → iconfont.1745889662360.ttf} +0 -0
  73. /package/lib/{iconfont.1745654997780.woff → iconfont.1745889662360.woff} +0 -0
  74. /package/lib/{iconfont.1745654997780.woff2 → iconfont.1745889662360.woff2} +0 -0
package/lib/index.umd.js CHANGED
@@ -4187,14 +4187,14 @@ function checkDynamic() {
4187
4187
  }
4188
4188
  ;// CONCATENATED MODULE: ./packages/ui/src/log.ts
4189
4189
 
4190
- const log_version = `ui v${"4.5.31"}`;
4190
+ const log_version = `ui v${"4.5.33"}`;
4191
4191
  const warnLog = log.create('warn', log_version);
4192
4192
  const errLog = log.create('error', log_version);
4193
4193
  ;// CONCATENATED MODULE: ./packages/ui/index.ts
4194
4194
 
4195
4195
 
4196
4196
 
4197
- const ui_version = "4.5.31";
4197
+ const ui_version = "4.5.33";
4198
4198
  index_esm_VxeUI.uiVersion = ui_version;
4199
4199
  index_esm_VxeUI.dynamicApp = dynamicApp;
4200
4200
  function config(options) {
@@ -4415,7 +4415,12 @@ setConfig({
4415
4415
  // transfer: false
4416
4416
  digits: 2,
4417
4417
  autoFill: true,
4418
- controls: true
4418
+ controlConfig: {
4419
+ enabled: true,
4420
+ // layout: 'default',
4421
+ showButton: true,
4422
+ isWheel: true
4423
+ }
4419
4424
  },
4420
4425
  optgroup: {},
4421
4426
  option: {},
@@ -4587,9 +4592,11 @@ setIcon({
4587
4592
  // input
4588
4593
  INPUT_CLEAR: iconPrefix + 'error-circle-fill',
4589
4594
  INPUT_SEARCH: iconPrefix + 'search',
4595
+ INPUT_PLUS_NUM: iconPrefix + 'caret-up',
4596
+ INPUT_MINUS_NUM: iconPrefix + 'caret-down',
4590
4597
  // number-picker
4591
- NUMBER_INPUT_PREV_NUM: iconPrefix + 'caret-up',
4592
- NUMBER_INPUT_NEXT_NUM: iconPrefix + 'caret-down',
4598
+ NUMBER_INPUT_MINUS_NUM: iconPrefix + 'minus',
4599
+ NUMBER_INPUT_PLUS_NUM: iconPrefix + 'add',
4593
4600
  // date-picker
4594
4601
  DATE_PICKER_DATE: iconPrefix + 'calendar',
4595
4602
  // password-input
@@ -4912,7 +4919,7 @@ function isScale(val) {
4912
4919
  return val && /^\d+%$/.test(val);
4913
4920
  }
4914
4921
  function hasClass(elem, cls) {
4915
- return elem && elem.className && elem.className.match && elem.className.match(getClsRE(cls));
4922
+ return !!(elem && elem.className && elem.className.match && elem.className.match(getClsRE(cls)));
4916
4923
  }
4917
4924
  function removeClass(elem, cls) {
4918
4925
  if (elem && hasClass(elem, cls)) {
@@ -12748,7 +12755,7 @@ function toFloatValueFixed(inputValue, digitsValue) {
12748
12755
  onMouseup: numberStopDown,
12749
12756
  onMouseleave: numberStopDown
12750
12757
  }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
12751
- class: getIcon().NUMBER_INPUT_PREV_NUM
12758
+ class: getIcon().INPUT_PLUS_NUM
12752
12759
  })]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
12753
12760
  class: ['vxe-input--number-btn is--next', {
12754
12761
  'is--disabled': isDisabledSubtractNumber
@@ -12757,7 +12764,7 @@ function toFloatValueFixed(inputValue, digitsValue) {
12757
12764
  onMouseup: numberStopDown,
12758
12765
  onMouseleave: numberStopDown
12759
12766
  }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
12760
- class: getIcon().NUMBER_INPUT_NEXT_NUM
12767
+ class: getIcon().INPUT_MINUS_NUM
12761
12768
  })])])]);
12762
12769
  };
12763
12770
  const renderDatePickerIcon = () => {
@@ -29981,11 +29988,7 @@ const WidgetVxeNumberInputFormComponent = (0,external_commonjs_vue_commonjs2_vue
29981
29988
  type: String,
29982
29989
  default: () => getConfig().numberInput.currencySymbol
29983
29990
  },
29984
- // number、integer、float
29985
- controls: {
29986
- type: Boolean,
29987
- default: () => getConfig().numberInput.controls
29988
- },
29991
+ controlConfig: Object,
29989
29992
  // float
29990
29993
  digits: {
29991
29994
  type: [String, Number],
@@ -29999,14 +30002,23 @@ const WidgetVxeNumberInputFormComponent = (0,external_commonjs_vue_commonjs2_vue
29999
30002
  type: Boolean,
30000
30003
  default: true
30001
30004
  },
30005
+ plusIcon: String,
30006
+ minusIcon: String,
30002
30007
  prefixIcon: String,
30003
30008
  suffixIcon: String,
30004
30009
  // 已废弃
30010
+ controls: {
30011
+ type: Boolean,
30012
+ default: null
30013
+ },
30014
+ // 已废弃
30005
30015
  maxlength: [String, Number],
30006
30016
  // 已废弃
30007
30017
  autocomplete: String
30008
30018
  },
30009
- emits: ['update:modelValue', 'input', 'change', 'keydown', 'keyup', 'wheel', 'click', 'focus', 'blur', 'clear', 'prev-number', 'next-number', 'prefix-click', 'suffix-click'],
30019
+ emits: ['update:modelValue', 'input', 'change', 'keydown', 'keyup', 'wheel', 'click', 'focus', 'blur', 'clear', 'plus-number', 'minus-number', 'prefix-click', 'suffix-click',
30020
+ // 已废弃
30021
+ 'prev-number', 'next-number'],
30010
30022
  setup(props, context) {
30011
30023
  const {
30012
30024
  slots,
@@ -30025,24 +30037,13 @@ const WidgetVxeNumberInputFormComponent = (0,external_commonjs_vue_commonjs2_vue
30025
30037
  });
30026
30038
  const internalData = {
30027
30039
  // dnTimeout: undefined,
30040
+ // ainTimeout: undefined,
30041
+ // isMouseDown: undefined,
30028
30042
  // isUM: undefined
30029
30043
  };
30030
30044
  const refElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
30031
30045
  const refInputTarget = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
30032
30046
  const refInputPanel = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
30033
- const refMaps = {
30034
- refElem,
30035
- refInput: refInputTarget
30036
- };
30037
- const $xeNumberInput = {
30038
- xID,
30039
- props,
30040
- context,
30041
- reactData,
30042
- internalData,
30043
- getRefMaps: () => refMaps
30044
- };
30045
- let numberInputMethods = {};
30046
30047
  const computeFormReadonly = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
30047
30048
  const {
30048
30049
  readonly
@@ -30083,6 +30084,9 @@ const WidgetVxeNumberInputFormComponent = (0,external_commonjs_vue_commonjs2_vue
30083
30084
  }
30084
30085
  return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toInteger(defDigits) || 1;
30085
30086
  });
30087
+ const computeControlOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
30088
+ return Object.assign({}, getConfig().numberInput.controlConfig, props.controlConfig);
30089
+ });
30086
30090
  const computeDecimalsType = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
30087
30091
  const {
30088
30092
  type
@@ -30207,6 +30211,23 @@ const WidgetVxeNumberInputFormComponent = (0,external_commonjs_vue_commonjs2_vue
30207
30211
  }
30208
30212
  return false;
30209
30213
  });
30214
+ const refMaps = {
30215
+ refElem,
30216
+ refInput: refInputTarget
30217
+ };
30218
+ const computeMaps = {
30219
+ computeControlOpts
30220
+ };
30221
+ const $xeNumberInput = {
30222
+ xID,
30223
+ props,
30224
+ context,
30225
+ reactData,
30226
+ internalData,
30227
+ getRefMaps: () => refMaps,
30228
+ getComputeMaps: () => computeMaps
30229
+ };
30230
+ let numberInputMethods = {};
30210
30231
  const handleNumberString = val => {
30211
30232
  if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(val)) {
30212
30233
  return '';
@@ -30482,34 +30503,34 @@ const WidgetVxeNumberInputFormComponent = (0,external_commonjs_vue_commonjs2_vue
30482
30503
  }
30483
30504
  emitInputEvent(getNumberValue(restNum), evnt);
30484
30505
  };
30485
- const numberNextEvent = evnt => {
30506
+ const numberPlusEvent = evnt => {
30486
30507
  const isDisabled = computeIsDisabled.value;
30487
30508
  const formReadonly = computeFormReadonly.value;
30488
- const isDisabledSubtractNumber = computeIsDisabledSubtractNumber.value;
30489
- numberStopDown();
30490
- if (!isDisabled && !formReadonly && !isDisabledSubtractNumber) {
30491
- numberChange(false, evnt);
30509
+ const isDisabledAddNumber = computeIsDisabledAddNumber.value;
30510
+ if (!isDisabled && !formReadonly && !isDisabledAddNumber) {
30511
+ numberChange(true, evnt);
30492
30512
  }
30493
30513
  reactData.isActivated = true;
30514
+ numberInputMethods.dispatchEvent('plus-number', {
30515
+ value: reactData.inputValue
30516
+ }, evnt);
30517
+ // 已废弃
30494
30518
  numberInputMethods.dispatchEvent('next-number', {
30495
30519
  value: reactData.inputValue
30496
30520
  }, evnt);
30497
30521
  };
30498
- const numberDownNextEvent = evnt => {
30499
- internalData.dnTimeout = setTimeout(() => {
30500
- numberNextEvent(evnt);
30501
- numberDownNextEvent(evnt);
30502
- }, 60);
30503
- };
30504
- const numberPrevEvent = evnt => {
30522
+ const numberMinusEvent = evnt => {
30505
30523
  const isDisabled = computeIsDisabled.value;
30506
30524
  const formReadonly = computeFormReadonly.value;
30507
- const isDisabledAddNumber = computeIsDisabledAddNumber.value;
30508
- numberStopDown();
30509
- if (!isDisabled && !formReadonly && !isDisabledAddNumber) {
30510
- numberChange(true, evnt);
30525
+ const isDisabledSubtractNumber = computeIsDisabledSubtractNumber.value;
30526
+ if (!isDisabled && !formReadonly && !isDisabledSubtractNumber) {
30527
+ numberChange(false, evnt);
30511
30528
  }
30512
30529
  reactData.isActivated = true;
30530
+ numberInputMethods.dispatchEvent('minus-number', {
30531
+ value: reactData.inputValue
30532
+ }, evnt);
30533
+ // 已废弃
30513
30534
  numberInputMethods.dispatchEvent('prev-number', {
30514
30535
  value: reactData.inputValue
30515
30536
  }, evnt);
@@ -30520,9 +30541,9 @@ const WidgetVxeNumberInputFormComponent = (0,external_commonjs_vue_commonjs2_vue
30520
30541
  if (isUpArrow || isDwArrow) {
30521
30542
  evnt.preventDefault();
30522
30543
  if (isUpArrow) {
30523
- numberPrevEvent(evnt);
30544
+ numberMinusEvent(evnt);
30524
30545
  } else {
30525
- numberNextEvent(evnt);
30546
+ numberPlusEvent(evnt);
30526
30547
  }
30527
30548
  }
30528
30549
  };
@@ -30532,6 +30553,10 @@ const WidgetVxeNumberInputFormComponent = (0,external_commonjs_vue_commonjs2_vue
30532
30553
  exponential,
30533
30554
  controls
30534
30555
  } = props;
30556
+ const controlOpts = computeControlOpts.value;
30557
+ const {
30558
+ showButton
30559
+ } = controlOpts;
30535
30560
  const inputReadonly = computeInputReadonly.value;
30536
30561
  const isControlKey = hasControlKey(evnt);
30537
30562
  const isShiftKey = evnt.shiftKey;
@@ -30548,7 +30573,7 @@ const WidgetVxeNumberInputFormComponent = (0,external_commonjs_vue_commonjs2_vue
30548
30573
  if (isEsc) {
30549
30574
  afterCheckValue();
30550
30575
  } else if (isUpArrow || isDwArrow) {
30551
- if (controls && !inputReadonly) {
30576
+ if (isEnableConf(controlOpts) && (controls === false ? controls : showButton) && !inputReadonly) {
30552
30577
  numberKeydownEvent(evnt);
30553
30578
  }
30554
30579
  }
@@ -30558,7 +30583,7 @@ const WidgetVxeNumberInputFormComponent = (0,external_commonjs_vue_commonjs2_vue
30558
30583
  triggerEvent(evnt);
30559
30584
  };
30560
30585
  // 数值
30561
- const numberStopDown = () => {
30586
+ const stopDown = () => {
30562
30587
  const {
30563
30588
  dnTimeout
30564
30589
  } = internalData;
@@ -30567,41 +30592,83 @@ const WidgetVxeNumberInputFormComponent = (0,external_commonjs_vue_commonjs2_vue
30567
30592
  internalData.dnTimeout = undefined;
30568
30593
  }
30569
30594
  };
30570
- const numberDownPrevEvent = evnt => {
30571
- internalData.dnTimeout = setTimeout(() => {
30572
- numberPrevEvent(evnt);
30573
- numberDownPrevEvent(evnt);
30595
+ const stopAutoIncrement = () => {
30596
+ const {
30597
+ ainTimeout
30598
+ } = internalData;
30599
+ if (ainTimeout) {
30600
+ clearTimeout(ainTimeout);
30601
+ internalData.ainTimeout = undefined;
30602
+ }
30603
+ };
30604
+ const numberDownMinusEvent = evnt => {
30605
+ numberStopAll();
30606
+ internalData.ainTimeout = setTimeout(() => {
30607
+ numberMinusEvent(evnt);
30608
+ numberDownMinusEvent(evnt);
30574
30609
  }, 60);
30575
30610
  };
30611
+ const numberDownPlusEvent = evnt => {
30612
+ numberStopAll();
30613
+ internalData.ainTimeout = setTimeout(() => {
30614
+ numberPlusEvent(evnt);
30615
+ numberDownPlusEvent(evnt);
30616
+ }, 60);
30617
+ };
30618
+ const numberStopAll = () => {
30619
+ stopDown();
30620
+ stopAutoIncrement();
30621
+ };
30622
+ const numberClickEvent = evnt => {
30623
+ if (internalData.isMouseDown) {
30624
+ internalData.isMouseDown = false;
30625
+ } else {
30626
+ numberStopAll();
30627
+ const isAddNumber = hasClass(evnt.currentTarget, 'is--plus');
30628
+ if (isAddNumber) {
30629
+ numberPlusEvent(evnt);
30630
+ } else {
30631
+ numberMinusEvent(evnt);
30632
+ }
30633
+ }
30634
+ };
30576
30635
  const numberMousedownEvent = evnt => {
30577
- numberStopDown();
30636
+ numberStopAll();
30637
+ internalData.isMouseDown = true;
30578
30638
  if (evnt.button === 0) {
30579
- const isPrevNumber = hasClass(evnt.currentTarget, 'is--prev');
30580
- if (isPrevNumber) {
30581
- numberPrevEvent(evnt);
30639
+ const isAddNumber = hasClass(evnt.currentTarget, 'is--plus');
30640
+ if (isAddNumber) {
30641
+ numberPlusEvent(evnt);
30582
30642
  } else {
30583
- numberNextEvent(evnt);
30643
+ numberMinusEvent(evnt);
30584
30644
  }
30585
30645
  internalData.dnTimeout = setTimeout(() => {
30586
- if (isPrevNumber) {
30587
- numberDownPrevEvent(evnt);
30646
+ if (isAddNumber) {
30647
+ numberDownPlusEvent(evnt);
30588
30648
  } else {
30589
- numberDownNextEvent(evnt);
30649
+ numberDownMinusEvent(evnt);
30590
30650
  }
30591
30651
  }, 500);
30592
30652
  }
30593
30653
  };
30594
30654
  const wheelEvent = evnt => {
30655
+ const {
30656
+ controls
30657
+ } = props;
30658
+ const controlOpts = computeControlOpts.value;
30659
+ const {
30660
+ isWheel
30661
+ } = controlOpts;
30595
30662
  const inputReadonly = computeInputReadonly.value;
30596
- if (props.controls && !inputReadonly) {
30663
+ if (isEnableConf(controlOpts) && (controls === false ? controls : isWheel) && !inputReadonly) {
30597
30664
  if (reactData.isActivated) {
30598
30665
  evnt.stopPropagation();
30599
30666
  evnt.preventDefault();
30600
30667
  const delta = evnt.deltaY;
30601
30668
  if (delta > 0) {
30602
- numberNextEvent(evnt);
30669
+ numberPlusEvent(evnt);
30603
30670
  } else if (delta < 0) {
30604
- numberPrevEvent(evnt);
30671
+ numberMinusEvent(evnt);
30605
30672
  }
30606
30673
  }
30607
30674
  }
@@ -30666,33 +30733,36 @@ const WidgetVxeNumberInputFormComponent = (0,external_commonjs_vue_commonjs2_vue
30666
30733
  afterCheckValue();
30667
30734
  }
30668
30735
  };
30669
- const renderNumberIcon = () => {
30670
- const isDisabledAddNumber = computeIsDisabledAddNumber.value;
30671
- const isDisabledSubtractNumber = computeIsDisabledSubtractNumber.value;
30672
- return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
30673
- class: 'vxe-input--control-icon'
30674
- }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
30675
- class: 'vxe-input--number-icon'
30676
- }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
30677
- class: ['vxe-input--number-btn is--prev', {
30678
- 'is--disabled': isDisabledAddNumber
30679
- }],
30680
- onMousedown: numberMousedownEvent,
30681
- onMouseup: numberStopDown,
30682
- onMouseleave: numberStopDown
30683
- }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
30684
- class: getIcon().NUMBER_INPUT_PREV_NUM
30685
- })]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
30686
- class: ['vxe-input--number-btn is--next', {
30687
- 'is--disabled': isDisabledSubtractNumber
30688
- }],
30689
- onMousedown: numberMousedownEvent,
30690
- onMouseup: numberStopDown,
30691
- onMouseleave: numberStopDown
30692
- }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
30693
- class: getIcon().NUMBER_INPUT_NEXT_NUM
30694
- })])])]);
30736
+ const dispatchEvent = (type, params, evnt) => {
30737
+ emit(type, createEvent(evnt, {
30738
+ $numberInput: $xeNumberInput
30739
+ }, params));
30740
+ };
30741
+ numberInputMethods = {
30742
+ dispatchEvent,
30743
+ focus() {
30744
+ const inputReadonly = computeInputReadonly.value;
30745
+ if (!inputReadonly) {
30746
+ const inputElem = refInputTarget.value;
30747
+ reactData.isActivated = true;
30748
+ inputElem.focus();
30749
+ }
30750
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
30751
+ },
30752
+ blur() {
30753
+ const inputElem = refInputTarget.value;
30754
+ inputElem.blur();
30755
+ reactData.isActivated = false;
30756
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
30757
+ },
30758
+ select() {
30759
+ const inputElem = refInputTarget.value;
30760
+ inputElem.select();
30761
+ reactData.isActivated = false;
30762
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
30763
+ }
30695
30764
  };
30765
+ Object.assign($xeNumberInput, numberInputMethods);
30696
30766
  const renderPrefixIcon = () => {
30697
30767
  const {
30698
30768
  prefixIcon
@@ -30705,7 +30775,7 @@ const WidgetVxeNumberInputFormComponent = (0,external_commonjs_vue_commonjs2_vue
30705
30775
  class: 'vxe-number-input--prefix-icon'
30706
30776
  }, prefixSlot ? getSlotVNs(prefixSlot({})) : [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
30707
30777
  class: prefixIcon
30708
- })])]) : null;
30778
+ })])]) : renderEmptyElement($xeNumberInput);
30709
30779
  };
30710
30780
  const renderSuffixIcon = () => {
30711
30781
  const {
@@ -30726,72 +30796,121 @@ const WidgetVxeNumberInputFormComponent = (0,external_commonjs_vue_commonjs2_vue
30726
30796
  onClick: clearValueEvent
30727
30797
  }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
30728
30798
  class: getIcon().INPUT_CLEAR
30729
- })]) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(), renderExtraSuffixIcon(), suffixSlot || suffixIcon ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
30799
+ })]) : renderEmptyElement($xeNumberInput), suffixSlot || suffixIcon ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
30730
30800
  class: 'vxe-number-input--suffix-icon',
30731
30801
  onClick: clickSuffixEvent
30732
30802
  }, suffixSlot ? getSlotVNs(suffixSlot({})) : [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
30733
30803
  class: suffixIcon
30734
- })]) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)()]);
30804
+ })]) : renderEmptyElement($xeNumberInput)]);
30735
30805
  };
30736
- const renderExtraSuffixIcon = () => {
30806
+ const renderInput = () => {
30737
30807
  const {
30738
- controls
30808
+ type,
30809
+ name,
30810
+ autocomplete,
30811
+ autoComplete
30739
30812
  } = props;
30813
+ const {
30814
+ inputValue,
30815
+ isFocus
30816
+ } = reactData;
30817
+ const isDisabled = computeIsDisabled.value;
30818
+ const numLabel = computeNumLabel.value;
30740
30819
  const inputReadonly = computeInputReadonly.value;
30741
- if (controls && !inputReadonly) {
30742
- return renderNumberIcon();
30743
- }
30744
- return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)();
30820
+ const inpMaxLength = computeInpMaxLength.value;
30821
+ const inpPlaceholder = computeInpPlaceholder.value;
30822
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
30823
+ key: 'ni',
30824
+ class: 'vxe-number-input--input-wrapper'
30825
+ }, [renderPrefixIcon(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
30826
+ class: 'vxe-number-input--input-inner'
30827
+ }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('input', {
30828
+ ref: refInputTarget,
30829
+ class: 'vxe-number-input--input',
30830
+ value: !isFocus && type === 'amount' ? numLabel : inputValue,
30831
+ name,
30832
+ type: 'text',
30833
+ placeholder: inpPlaceholder,
30834
+ maxlength: inpMaxLength,
30835
+ readonly: inputReadonly,
30836
+ disabled: isDisabled,
30837
+ autocomplete: autoComplete || autocomplete,
30838
+ onKeydown: keydownEvent,
30839
+ onKeyup: keyupEvent,
30840
+ onWheel: wheelEvent,
30841
+ onClick: clickEvent,
30842
+ onInput: inputEvent,
30843
+ onChange: changeEvent,
30844
+ onFocus: focusEvent,
30845
+ onBlur: blurEvent
30846
+ })]), renderSuffixIcon()]);
30745
30847
  };
30746
- const dispatchEvent = (type, params, evnt) => {
30747
- emit(type, createEvent(evnt, {
30748
- $numberInput: $xeNumberInput
30749
- }, params));
30848
+ const renderMinusBtn = () => {
30849
+ const {
30850
+ minusIcon
30851
+ } = props;
30852
+ const isDisabledSubtractNumber = computeIsDisabledSubtractNumber.value;
30853
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('button', {
30854
+ key: 'prev',
30855
+ class: ['vxe-number-input--minus-btn is--minus', {
30856
+ 'is--disabled': isDisabledSubtractNumber
30857
+ }],
30858
+ onClick: numberClickEvent,
30859
+ onMousedown: numberMousedownEvent,
30860
+ onMouseup: numberStopAll,
30861
+ onMouseleave: numberStopAll
30862
+ }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
30863
+ class: minusIcon || getIcon().NUMBER_INPUT_MINUS_NUM
30864
+ })]);
30750
30865
  };
30751
- numberInputMethods = {
30752
- dispatchEvent,
30753
- focus() {
30754
- const inputReadonly = computeInputReadonly.value;
30755
- if (!inputReadonly) {
30756
- const inputElem = refInputTarget.value;
30757
- reactData.isActivated = true;
30758
- inputElem.focus();
30759
- }
30760
- return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
30761
- },
30762
- blur() {
30763
- const inputElem = refInputTarget.value;
30764
- inputElem.blur();
30765
- reactData.isActivated = false;
30766
- return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
30767
- },
30768
- select() {
30769
- const inputElem = refInputTarget.value;
30770
- inputElem.select();
30771
- reactData.isActivated = false;
30772
- return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
30773
- }
30866
+ const renderPlusBtn = () => {
30867
+ const {
30868
+ plusIcon
30869
+ } = props;
30870
+ const isDisabledAddNumber = computeIsDisabledAddNumber.value;
30871
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('button', {
30872
+ key: 'next',
30873
+ class: ['vxe-number-input--plus-btn is--plus', {
30874
+ 'is--disabled': isDisabledAddNumber
30875
+ }],
30876
+ onClick: numberClickEvent,
30877
+ onMousedown: numberMousedownEvent,
30878
+ onMouseup: numberStopAll,
30879
+ onMouseleave: numberStopAll
30880
+ }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
30881
+ class: plusIcon || getIcon().NUMBER_INPUT_PLUS_NUM
30882
+ })]);
30883
+ };
30884
+ const renderSideControl = () => {
30885
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
30886
+ key: 'cplr',
30887
+ class: 'vxe-number-input--side-control'
30888
+ }, [renderPlusBtn(), renderMinusBtn()]);
30774
30889
  };
30775
- Object.assign($xeNumberInput, numberInputMethods);
30776
30890
  const renderVN = () => {
30777
30891
  const {
30778
30892
  className,
30779
30893
  controls,
30780
30894
  type,
30781
30895
  align,
30782
- name,
30783
- autocomplete,
30784
- autoComplete
30896
+ prefixIcon,
30897
+ suffixIcon
30785
30898
  } = props;
30786
30899
  const {
30787
30900
  inputValue,
30788
- isFocus,
30789
30901
  isActivated
30790
30902
  } = reactData;
30791
30903
  const vSize = computeSize.value;
30904
+ const controlOpts = computeControlOpts.value;
30905
+ const {
30906
+ layout,
30907
+ showButton
30908
+ } = controlOpts;
30792
30909
  const isDisabled = computeIsDisabled.value;
30793
30910
  const formReadonly = computeFormReadonly.value;
30794
30911
  const numLabel = computeNumLabel.value;
30912
+ const prefixSlot = slots.prefix;
30913
+ const suffixSlot = slots.suffix;
30795
30914
  if (formReadonly) {
30796
30915
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
30797
30916
  ref: refElem,
@@ -30799,46 +30918,22 @@ const WidgetVxeNumberInputFormComponent = (0,external_commonjs_vue_commonjs2_vue
30799
30918
  }, numLabel);
30800
30919
  }
30801
30920
  const inputReadonly = computeInputReadonly.value;
30802
- const inpMaxLength = computeInpMaxLength.value;
30803
- const inpPlaceholder = computeInpPlaceholder.value;
30804
30921
  const isClearable = computeIsClearable.value;
30805
- const prefix = renderPrefixIcon();
30806
- const suffix = renderSuffixIcon();
30922
+ const isControls = isEnableConf(controlOpts) && (controls === false ? controls : showButton);
30807
30923
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
30808
30924
  ref: refElem,
30809
- class: ['vxe-number-input', `type--${type}`, className, {
30925
+ class: ['vxe-number-input', `type--${type}`, `control-${layout === 'right' || layout === 'left' ? layout : 'default'}`, className, {
30810
30926
  [`size--${vSize}`]: vSize,
30811
30927
  [`is--${align}`]: align,
30812
- 'is--controls': controls && !inputReadonly,
30813
- 'is--prefix': !!prefix,
30814
- 'is--suffix': !!suffix,
30928
+ 'is--controls': isControls && !inputReadonly,
30929
+ 'is--prefix': !!prefixSlot || prefixIcon,
30930
+ 'is--suffix': !!suffixSlot || suffixIcon,
30815
30931
  'is--disabled': isDisabled,
30816
30932
  'is--active': isActivated,
30817
30933
  'show--clear': isClearable && !isDisabled && !(inputValue === '' || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(inputValue))
30818
30934
  }],
30819
30935
  spellcheck: false
30820
- }, [prefix || (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
30821
- class: 'vxe-number-input--wrapper'
30822
- }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('input', {
30823
- ref: refInputTarget,
30824
- class: 'vxe-number-input--inner',
30825
- value: !isFocus && type === 'amount' ? numLabel : inputValue,
30826
- name,
30827
- type: 'text',
30828
- placeholder: inpPlaceholder,
30829
- maxlength: inpMaxLength,
30830
- readonly: inputReadonly,
30831
- disabled: isDisabled,
30832
- autocomplete: autoComplete || autocomplete,
30833
- onKeydown: keydownEvent,
30834
- onKeyup: keyupEvent,
30835
- onWheel: wheelEvent,
30836
- onClick: clickEvent,
30837
- onInput: inputEvent,
30838
- onChange: changeEvent,
30839
- onFocus: focusEvent,
30840
- onBlur: blurEvent
30841
- })]), suffix || (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)()]);
30936
+ }, isControls ? layout === 'right' ? [renderInput(), renderSideControl()] : layout === 'left' ? [renderSideControl(), renderInput()] : [renderMinusBtn(), renderInput(), renderPlusBtn()] : [renderInput()]);
30842
30937
  };
30843
30938
  $xeNumberInput.renderVN = renderVN;
30844
30939
  (0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.modelValue, val => {
@@ -30861,7 +30956,7 @@ const WidgetVxeNumberInputFormComponent = (0,external_commonjs_vue_commonjs2_vue
30861
30956
  });
30862
30957
  (0,external_commonjs_vue_commonjs2_vue_root_Vue_.onBeforeUnmount)(() => {
30863
30958
  reactData.isFocus = false;
30864
- numberStopDown();
30959
+ numberStopAll();
30865
30960
  afterCheckValue();
30866
30961
  globalEvents.off($xeNumberInput, 'mousedown');
30867
30962
  globalEvents.off($xeNumberInput, 'keydown');