vxe-pc-ui 4.17.14 → 4.17.16

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 (69) hide show
  1. package/dist/all.esm.js +76 -20
  2. package/dist/style.css +1 -1
  3. package/dist/style.min.css +1 -1
  4. package/es/backtop/src/backtop.js +1 -4
  5. package/es/form/src/form.js +19 -4
  6. package/es/icon/style.css +1 -1
  7. package/es/input/src/input.js +4 -0
  8. package/es/input/style.css +2 -2
  9. package/es/input/style.min.css +1 -1
  10. package/es/style.css +1 -1
  11. package/es/style.min.css +1 -1
  12. package/es/textarea/src/textarea.js +49 -11
  13. package/es/textarea/style.css +23 -1
  14. package/es/textarea/style.min.css +1 -1
  15. package/es/ui/index.js +3 -1
  16. package/es/ui/src/log.js +1 -1
  17. package/es/vxe-input/style.css +2 -2
  18. package/es/vxe-input/style.min.css +1 -1
  19. package/es/vxe-textarea/style.css +23 -1
  20. package/es/vxe-textarea/style.min.css +1 -1
  21. package/lib/backtop/src/backtop.js +1 -4
  22. package/lib/backtop/src/backtop.min.js +1 -1
  23. package/lib/form/src/form.js +11 -3
  24. package/lib/form/src/form.min.js +1 -1
  25. package/lib/icon/style/style.css +1 -1
  26. package/lib/icon/style/style.min.css +1 -1
  27. package/lib/index.umd.js +57 -15
  28. package/lib/index.umd.min.js +1 -1
  29. package/lib/input/src/input.js +3 -0
  30. package/lib/input/src/input.min.js +1 -1
  31. package/lib/input/style/style.css +2 -2
  32. package/lib/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/textarea/src/textarea.js +38 -6
  36. package/lib/textarea/src/textarea.min.js +1 -1
  37. package/lib/textarea/style/style.css +23 -1
  38. package/lib/textarea/style/style.min.css +1 -1
  39. package/lib/ui/index.js +3 -1
  40. package/lib/ui/index.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-input/style/style.css +2 -2
  44. package/lib/vxe-input/style/style.min.css +1 -1
  45. package/lib/vxe-textarea/style/style.css +23 -1
  46. package/lib/vxe-textarea/style/style.min.css +1 -1
  47. package/package.json +1 -1
  48. package/packages/backtop/src/backtop.ts +1 -4
  49. package/packages/form/src/form.ts +19 -4
  50. package/packages/input/src/input.ts +3 -0
  51. package/packages/textarea/src/textarea.ts +49 -11
  52. package/packages/ui/index.ts +3 -0
  53. package/styles/components/input.scss +2 -2
  54. package/styles/components/textarea.scss +31 -1
  55. package/types/components/form-item.d.ts +2 -0
  56. package/types/components/textarea.d.ts +5 -0
  57. package/types/ui/global-icon.d.ts +3 -0
  58. /package/es/icon/{iconfont.1787473183599.ttf → iconfont.1787560614772.ttf} +0 -0
  59. /package/es/icon/{iconfont.1787473183599.woff → iconfont.1787560614772.woff} +0 -0
  60. /package/es/icon/{iconfont.1787473183599.woff2 → iconfont.1787560614772.woff2} +0 -0
  61. /package/es/{iconfont.1787473183599.ttf → iconfont.1787560614772.ttf} +0 -0
  62. /package/es/{iconfont.1787473183599.woff → iconfont.1787560614772.woff} +0 -0
  63. /package/es/{iconfont.1787473183599.woff2 → iconfont.1787560614772.woff2} +0 -0
  64. /package/lib/icon/style/{iconfont.1787473183599.ttf → iconfont.1787560614772.ttf} +0 -0
  65. /package/lib/icon/style/{iconfont.1787473183599.woff → iconfont.1787560614772.woff} +0 -0
  66. /package/lib/icon/style/{iconfont.1787473183599.woff2 → iconfont.1787560614772.woff2} +0 -0
  67. /package/lib/{iconfont.1787473183599.ttf → iconfont.1787560614772.ttf} +0 -0
  68. /package/lib/{iconfont.1787473183599.woff → iconfont.1787560614772.woff} +0 -0
  69. /package/lib/{iconfont.1787473183599.woff2 → iconfont.1787560614772.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.14"}`;
84
+ const uiVersion = `ui v${"4.17.16"}`;
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.14";
98
+ const version = "4.17.16";
99
99
  VxeUI.uiVersion = version;
100
100
  VxeUI.dynamicApp = dynamicApp;
101
101
  function config(options) {
@@ -622,6 +622,8 @@ setIcon({
622
622
  CHECKBOX_CHECKED: iconPrefix + 'checkbox-checked-fill',
623
623
  CHECKBOX_UNCHECKED: iconPrefix + 'checkbox-unchecked',
624
624
  CHECKBOX_DISABLED_UNCHECKED: iconPrefix + 'checkbox-unchecked-fill',
625
+ // textarea
626
+ TEXTAREA_CLEAR: iconPrefix + 'error-circle-fill',
625
627
  // input
626
628
  INPUT_CLEAR: iconPrefix + 'error-circle-fill',
627
629
  INPUT_SEARCH: iconPrefix + 'search',
@@ -4079,11 +4081,8 @@ var VxeBacktopComponent = defineVxeComponent({
4079
4081
  return;
4080
4082
  }
4081
4083
  if (XEUtils.isString(target)) {
4082
- const tEl = document.querySelector(target);
4083
- if (!tEl) {
4084
- errLog$j('vxe.error.errProp', [`target=${target}`, 'body']);
4085
- }
4086
4084
  const { targetEl } = internalData;
4085
+ const tEl = document.querySelector(target) || document.body;
4087
4086
  if (targetEl !== tEl) {
4088
4087
  removeScrollEvent();
4089
4088
  internalData.targetEl = tEl;
@@ -9863,6 +9862,9 @@ var VxeInputComponent = defineVxeComponent({
9863
9862
  if (!inpImmediate) {
9864
9863
  handleChange(value, evnt);
9865
9864
  }
9865
+ else {
9866
+ updateDomValue();
9867
+ }
9866
9868
  afterCheckValue();
9867
9869
  if (!reactData.visiblePanel) {
9868
9870
  reactData.isActivated = false;
@@ -11630,6 +11632,7 @@ var VxeInputComponent = defineVxeComponent({
11630
11632
  'is--prefix': !!prefix,
11631
11633
  'is--suffix': !!suffix,
11632
11634
  'is--visible': visiblePanel,
11635
+ 'is--clear': isClearable,
11633
11636
  'is--count': isWordCount,
11634
11637
  'is--disabled': isDisabled,
11635
11638
  'is--active': isActivated,
@@ -25770,10 +25773,18 @@ var VxeFormComponent = defineVxeComponent({
25770
25773
  }
25771
25774
  return nextTick();
25772
25775
  };
25773
- const getResetValue = (item, data, itemValue) => {
25776
+ const getResetValue = (item, data, itemValue, currentField) => {
25774
25777
  const { field, resetValue } = item;
25775
25778
  if (XEUtils.isFunction(resetValue)) {
25776
- return resetValue({ field, item, data, $form: $xeForm, $grid: $xeGrid });
25779
+ return resetValue({
25780
+ field,
25781
+ item,
25782
+ data,
25783
+ currentField: currentField || field || '',
25784
+ currentValue: itemValue,
25785
+ $form: $xeForm,
25786
+ $grid: $xeGrid
25787
+ });
25777
25788
  }
25778
25789
  else if (XEUtils.eqNull(resetValue)) {
25779
25790
  // 默认
@@ -25818,9 +25829,16 @@ var VxeFormComponent = defineVxeComponent({
25818
25829
  XEUtils.set(data, field, getResetValue(item, data, itemValue));
25819
25830
  }
25820
25831
  if (startField && endField) {
25821
- XEUtils.set(data, startField, getResetValue(item, data, XEUtils.get(data, startField)));
25822
- XEUtils.set(data, endField, getResetValue(item, data, XEUtils.get(data, endField)));
25832
+ XEUtils.set(data, startField, getResetValue(item, data, XEUtils.get(data, startField), startField));
25833
+ XEUtils.set(data, endField, getResetValue(item, data, XEUtils.get(data, endField), endField));
25823
25834
  }
25835
+ if (field === 'startxxxx') {
25836
+ return '';
25837
+ }
25838
+ else if (field === 'endxxx') {
25839
+ return '';
25840
+ }
25841
+ return '';
25824
25842
  }
25825
25843
  });
25826
25844
  }
@@ -40453,6 +40471,10 @@ var VxeTextareaComponent = defineVxeComponent({
40453
40471
  type: Boolean,
40454
40472
  default: null
40455
40473
  },
40474
+ clearable: {
40475
+ type: Boolean,
40476
+ default: () => getConfig$3().textarea.clearable
40477
+ },
40456
40478
  placeholder: String,
40457
40479
  maxLength: [String, Number],
40458
40480
  trim: {
@@ -40469,6 +40491,10 @@ var VxeTextareaComponent = defineVxeComponent({
40469
40491
  },
40470
40492
  showWordCount: Boolean,
40471
40493
  countMethod: Function,
40494
+ autoFocus: {
40495
+ type: Boolean,
40496
+ default: null
40497
+ },
40472
40498
  /**
40473
40499
  * 已废弃,被 auto-size 替换
40474
40500
  * @deprecated
@@ -40502,6 +40528,7 @@ var VxeTextareaComponent = defineVxeComponent({
40502
40528
  'change',
40503
40529
  'focus',
40504
40530
  'blur',
40531
+ 'clear',
40505
40532
  'lazy-change'
40506
40533
  ],
40507
40534
  setup(props, context) {
@@ -40664,13 +40691,21 @@ var VxeTextareaComponent = defineVxeComponent({
40664
40691
  reactData.inputValue = value;
40665
40692
  emit('update:modelValue', value);
40666
40693
  if (XEUtils.toValueString(props.modelValue) !== value) {
40667
- textareaMethods.dispatchEvent('change', { value }, evnt);
40694
+ dispatchEvent('change', { value }, evnt);
40668
40695
  // 自动更新校验状态
40669
40696
  if ($xeForm && formItemInfo) {
40670
40697
  $xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, value);
40671
40698
  }
40672
40699
  }
40673
40700
  };
40701
+ const clearValueEvent = (evnt, value) => {
40702
+ const { autoFocus } = props;
40703
+ if (autoFocus || autoFocus === null) {
40704
+ focus();
40705
+ }
40706
+ handleChange('', evnt);
40707
+ dispatchEvent('clear', { value }, evnt);
40708
+ };
40674
40709
  const inputEvent = (evnt) => {
40675
40710
  const { immediate } = props;
40676
40711
  const textElem = evnt.target;
@@ -40704,6 +40739,9 @@ var VxeTextareaComponent = defineVxeComponent({
40704
40739
  if (!immediate) {
40705
40740
  handleChange(inputValue, evnt);
40706
40741
  }
40742
+ else {
40743
+ updateDomValue();
40744
+ }
40707
40745
  dispatchEvent('blur', { value: inputValue }, evnt);
40708
40746
  };
40709
40747
  const textareaMethods = {
@@ -40721,7 +40759,7 @@ var VxeTextareaComponent = defineVxeComponent({
40721
40759
  };
40722
40760
  Object.assign($xeTextarea, textareaMethods);
40723
40761
  const renderVN = () => {
40724
- const { className, inputClassName, resize, autosize, autoSize, showWordCount, countMethod, rows, cols } = props;
40762
+ const { className, inputClassName, resize, autosize, autoSize, showWordCount, countMethod, rows, cols, clearable } = props;
40725
40763
  const { inputValue } = reactData;
40726
40764
  const vSize = computeSize.value;
40727
40765
  const isDisabled = computeIsDisabled.value;
@@ -40749,8 +40787,10 @@ var VxeTextareaComponent = defineVxeComponent({
40749
40787
  'is--autosize': autosize || autoSize,
40750
40788
  'is--count': showWordCount,
40751
40789
  'is--disabled': isDisabled,
40790
+ 'is-clear': clearable,
40752
40791
  'is--rows': !XEUtils.eqNull(rows),
40753
- 'is--cols': !XEUtils.eqNull(cols)
40792
+ 'is--cols': !XEUtils.eqNull(cols),
40793
+ 'show--clear': clearable && !isDisabled && !(inputValue === '' || XEUtils.eqNull(inputValue))
40754
40794
  }],
40755
40795
  spellcheck: false
40756
40796
  }, [
@@ -40777,13 +40817,29 @@ var VxeTextareaComponent = defineVxeComponent({
40777
40817
  onFocus: triggerEvent,
40778
40818
  onBlur: blurEvent
40779
40819
  }),
40780
- showWordCount
40781
- ? h('span', {
40782
- class: ['vxe-textarea--count', {
40783
- 'is--error': isCountError
40784
- }]
40785
- }, countMethod ? `${countMethod({ value: inputValue })}` : `${inputCount}${inpMaxLength ? `/${inpMaxLength}` : ''}`)
40786
- : null
40820
+ clearable || showWordCount
40821
+ ? h('div', {
40822
+ class: 'vxe-textarea--suffix'
40823
+ }, [
40824
+ clearable
40825
+ ? h('div', {
40826
+ class: 'vxe-textarea--clear-icon',
40827
+ onClick: clearValueEvent
40828
+ }, [
40829
+ h('i', {
40830
+ class: getIcon$2().TEXTAREA_CLEAR
40831
+ })
40832
+ ])
40833
+ : renderEmptyElement($xeTextarea),
40834
+ showWordCount
40835
+ ? h('span', {
40836
+ class: ['vxe-textarea--count', {
40837
+ 'is--error': isCountError
40838
+ }]
40839
+ }, countMethod ? `${countMethod({ value: inputValue })}` : `${inputCount}${inpMaxLength ? `/${inpMaxLength}` : ''}`)
40840
+ : renderEmptyElement($xeTextarea)
40841
+ ])
40842
+ : renderEmptyElement($xeTextarea)
40787
40843
  ]);
40788
40844
  };
40789
40845
  watch(() => props.modelValue, (val) => {