vxe-pc-ui 4.17.13 → 4.17.15

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 (66) hide show
  1. package/README.md +1 -1
  2. package/dist/all.esm.js +57 -16
  3. package/dist/style.css +1 -1
  4. package/dist/style.min.css +1 -1
  5. package/es/backtop/src/backtop.js +1 -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/icon/style/style.css +1 -1
  24. package/lib/icon/style/style.min.css +1 -1
  25. package/lib/index.umd.js +46 -12
  26. package/lib/index.umd.min.js +1 -1
  27. package/lib/input/src/input.js +3 -0
  28. package/lib/input/src/input.min.js +1 -1
  29. package/lib/input/style/style.css +2 -2
  30. package/lib/input/style/style.min.css +1 -1
  31. package/lib/style.css +1 -1
  32. package/lib/style.min.css +1 -1
  33. package/lib/textarea/src/textarea.js +38 -6
  34. package/lib/textarea/src/textarea.min.js +1 -1
  35. package/lib/textarea/style/style.css +23 -1
  36. package/lib/textarea/style/style.min.css +1 -1
  37. package/lib/ui/index.js +3 -1
  38. package/lib/ui/index.min.js +1 -1
  39. package/lib/ui/src/log.js +1 -1
  40. package/lib/ui/src/log.min.js +1 -1
  41. package/lib/vxe-input/style/style.css +2 -2
  42. package/lib/vxe-input/style/style.min.css +1 -1
  43. package/lib/vxe-textarea/style/style.css +23 -1
  44. package/lib/vxe-textarea/style/style.min.css +1 -1
  45. package/package.json +3 -3
  46. package/packages/backtop/src/backtop.ts +1 -4
  47. package/packages/input/src/input.ts +3 -0
  48. package/packages/textarea/src/textarea.ts +49 -11
  49. package/packages/ui/index.ts +3 -0
  50. package/styles/components/input.scss +2 -2
  51. package/styles/components/textarea.scss +31 -1
  52. package/types/components/grid.d.ts +5 -5
  53. package/types/components/textarea.d.ts +5 -0
  54. package/types/ui/global-icon.d.ts +3 -0
  55. /package/es/icon/{iconfont.1787300576676.ttf → iconfont.1787558434119.ttf} +0 -0
  56. /package/es/icon/{iconfont.1787300576676.woff → iconfont.1787558434119.woff} +0 -0
  57. /package/es/icon/{iconfont.1787300576676.woff2 → iconfont.1787558434119.woff2} +0 -0
  58. /package/es/{iconfont.1787300576676.ttf → iconfont.1787558434119.ttf} +0 -0
  59. /package/es/{iconfont.1787300576676.woff → iconfont.1787558434119.woff} +0 -0
  60. /package/es/{iconfont.1787300576676.woff2 → iconfont.1787558434119.woff2} +0 -0
  61. /package/lib/icon/style/{iconfont.1787300576676.ttf → iconfont.1787558434119.ttf} +0 -0
  62. /package/lib/icon/style/{iconfont.1787300576676.woff → iconfont.1787558434119.woff} +0 -0
  63. /package/lib/icon/style/{iconfont.1787300576676.woff2 → iconfont.1787558434119.woff2} +0 -0
  64. /package/lib/{iconfont.1787300576676.ttf → iconfont.1787558434119.ttf} +0 -0
  65. /package/lib/{iconfont.1787300576676.woff → iconfont.1787558434119.woff} +0 -0
  66. /package/lib/{iconfont.1787300576676.woff2 → iconfont.1787558434119.woff2} +0 -0
package/README.md CHANGED
@@ -198,7 +198,7 @@ createApp(App)
198
198
  ### CDN
199
199
 
200
200
  使用第三方 CDN 方式记得锁定版本号,避免受到非兼容性更新的影响
201
- ***不建议将第三方的 CDN 地址用于正式环境,因为该连接随时都可能会失效***
201
+ **不建议将第三方的 CDN 地址用于正式环境,因为该连接随时都可能会失效**
202
202
 
203
203
  ```HTML
204
204
  <!DOCTYPE html>
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.13"}`;
84
+ const uiVersion = `ui v${"4.17.15"}`;
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.13";
98
+ const version = "4.17.15";
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,
@@ -40453,6 +40456,10 @@ var VxeTextareaComponent = defineVxeComponent({
40453
40456
  type: Boolean,
40454
40457
  default: null
40455
40458
  },
40459
+ clearable: {
40460
+ type: Boolean,
40461
+ default: () => getConfig$3().textarea.clearable
40462
+ },
40456
40463
  placeholder: String,
40457
40464
  maxLength: [String, Number],
40458
40465
  trim: {
@@ -40469,6 +40476,10 @@ var VxeTextareaComponent = defineVxeComponent({
40469
40476
  },
40470
40477
  showWordCount: Boolean,
40471
40478
  countMethod: Function,
40479
+ autoFocus: {
40480
+ type: Boolean,
40481
+ default: null
40482
+ },
40472
40483
  /**
40473
40484
  * 已废弃,被 auto-size 替换
40474
40485
  * @deprecated
@@ -40502,6 +40513,7 @@ var VxeTextareaComponent = defineVxeComponent({
40502
40513
  'change',
40503
40514
  'focus',
40504
40515
  'blur',
40516
+ 'clear',
40505
40517
  'lazy-change'
40506
40518
  ],
40507
40519
  setup(props, context) {
@@ -40664,13 +40676,21 @@ var VxeTextareaComponent = defineVxeComponent({
40664
40676
  reactData.inputValue = value;
40665
40677
  emit('update:modelValue', value);
40666
40678
  if (XEUtils.toValueString(props.modelValue) !== value) {
40667
- textareaMethods.dispatchEvent('change', { value }, evnt);
40679
+ dispatchEvent('change', { value }, evnt);
40668
40680
  // 自动更新校验状态
40669
40681
  if ($xeForm && formItemInfo) {
40670
40682
  $xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, value);
40671
40683
  }
40672
40684
  }
40673
40685
  };
40686
+ const clearValueEvent = (evnt, value) => {
40687
+ const { autoFocus } = props;
40688
+ if (autoFocus || autoFocus === null) {
40689
+ focus();
40690
+ }
40691
+ handleChange('', evnt);
40692
+ dispatchEvent('clear', { value }, evnt);
40693
+ };
40674
40694
  const inputEvent = (evnt) => {
40675
40695
  const { immediate } = props;
40676
40696
  const textElem = evnt.target;
@@ -40704,6 +40724,9 @@ var VxeTextareaComponent = defineVxeComponent({
40704
40724
  if (!immediate) {
40705
40725
  handleChange(inputValue, evnt);
40706
40726
  }
40727
+ else {
40728
+ updateDomValue();
40729
+ }
40707
40730
  dispatchEvent('blur', { value: inputValue }, evnt);
40708
40731
  };
40709
40732
  const textareaMethods = {
@@ -40721,7 +40744,7 @@ var VxeTextareaComponent = defineVxeComponent({
40721
40744
  };
40722
40745
  Object.assign($xeTextarea, textareaMethods);
40723
40746
  const renderVN = () => {
40724
- const { className, inputClassName, resize, autosize, autoSize, showWordCount, countMethod, rows, cols } = props;
40747
+ const { className, inputClassName, resize, autosize, autoSize, showWordCount, countMethod, rows, cols, clearable } = props;
40725
40748
  const { inputValue } = reactData;
40726
40749
  const vSize = computeSize.value;
40727
40750
  const isDisabled = computeIsDisabled.value;
@@ -40749,8 +40772,10 @@ var VxeTextareaComponent = defineVxeComponent({
40749
40772
  'is--autosize': autosize || autoSize,
40750
40773
  'is--count': showWordCount,
40751
40774
  'is--disabled': isDisabled,
40775
+ 'is-clear': clearable,
40752
40776
  'is--rows': !XEUtils.eqNull(rows),
40753
- 'is--cols': !XEUtils.eqNull(cols)
40777
+ 'is--cols': !XEUtils.eqNull(cols),
40778
+ 'show--clear': clearable && !isDisabled && !(inputValue === '' || XEUtils.eqNull(inputValue))
40754
40779
  }],
40755
40780
  spellcheck: false
40756
40781
  }, [
@@ -40777,13 +40802,29 @@ var VxeTextareaComponent = defineVxeComponent({
40777
40802
  onFocus: triggerEvent,
40778
40803
  onBlur: blurEvent
40779
40804
  }),
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
40805
+ clearable || showWordCount
40806
+ ? h('div', {
40807
+ class: 'vxe-textarea--suffix'
40808
+ }, [
40809
+ clearable
40810
+ ? h('div', {
40811
+ class: 'vxe-textarea--clear-icon',
40812
+ onClick: clearValueEvent
40813
+ }, [
40814
+ h('i', {
40815
+ class: getIcon$2().TEXTAREA_CLEAR
40816
+ })
40817
+ ])
40818
+ : renderEmptyElement($xeTextarea),
40819
+ showWordCount
40820
+ ? h('span', {
40821
+ class: ['vxe-textarea--count', {
40822
+ 'is--error': isCountError
40823
+ }]
40824
+ }, countMethod ? `${countMethod({ value: inputValue })}` : `${inputCount}${inpMaxLength ? `/${inpMaxLength}` : ''}`)
40825
+ : renderEmptyElement($xeTextarea)
40826
+ ])
40827
+ : renderEmptyElement($xeTextarea)
40787
40828
  ]);
40788
40829
  };
40789
40830
  watch(() => props.modelValue, (val) => {