vxe-pc-ui 4.14.25 → 4.14.26

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 (45) hide show
  1. package/dist/all.esm.js +71 -27
  2. package/dist/style.css +1 -1
  3. package/dist/style.min.css +1 -1
  4. package/es/style.css +1 -1
  5. package/es/style.min.css +1 -1
  6. package/es/textarea/src/textarea.js +70 -25
  7. package/es/textarea/style.css +11 -4
  8. package/es/textarea/style.min.css +1 -1
  9. package/es/ui/index.js +1 -1
  10. package/es/ui/src/log.js +1 -1
  11. package/es/vxe-textarea/style.css +11 -4
  12. package/es/vxe-textarea/style.min.css +1 -1
  13. package/lib/index.umd.js +83 -28
  14. package/lib/index.umd.min.js +1 -1
  15. package/lib/style.css +1 -1
  16. package/lib/style.min.css +1 -1
  17. package/lib/textarea/src/textarea.js +81 -26
  18. package/lib/textarea/src/textarea.min.js +1 -1
  19. package/lib/textarea/style/style.css +11 -4
  20. package/lib/textarea/style/style.min.css +1 -1
  21. package/lib/ui/index.js +1 -1
  22. package/lib/ui/index.min.js +1 -1
  23. package/lib/ui/src/log.js +1 -1
  24. package/lib/ui/src/log.min.js +1 -1
  25. package/lib/vxe-textarea/style/style.css +11 -4
  26. package/lib/vxe-textarea/style/style.min.css +1 -1
  27. package/package.json +1 -1
  28. package/packages/textarea/src/textarea.ts +73 -28
  29. package/styles/components/textarea.scss +11 -4
  30. package/types/components/column.d.ts +1 -0
  31. package/types/components/table-plugins/extend-cell-area.d.ts +11 -0
  32. package/types/components/table.d.ts +4 -0
  33. package/types/components/textarea.d.ts +22 -1
  34. /package/es/icon/{iconfont.1780114491819.ttf → iconfont.1780292459831.ttf} +0 -0
  35. /package/es/icon/{iconfont.1780114491819.woff → iconfont.1780292459831.woff} +0 -0
  36. /package/es/icon/{iconfont.1780114491819.woff2 → iconfont.1780292459831.woff2} +0 -0
  37. /package/es/{iconfont.1780114491819.ttf → iconfont.1780292459831.ttf} +0 -0
  38. /package/es/{iconfont.1780114491819.woff → iconfont.1780292459831.woff} +0 -0
  39. /package/es/{iconfont.1780114491819.woff2 → iconfont.1780292459831.woff2} +0 -0
  40. /package/lib/icon/style/{iconfont.1780114491819.ttf → iconfont.1780292459831.ttf} +0 -0
  41. /package/lib/icon/style/{iconfont.1780114491819.woff → iconfont.1780292459831.woff} +0 -0
  42. /package/lib/icon/style/{iconfont.1780114491819.woff2 → iconfont.1780292459831.woff2} +0 -0
  43. /package/lib/{iconfont.1780114491819.ttf → iconfont.1780292459831.ttf} +0 -0
  44. /package/lib/{iconfont.1780114491819.woff → iconfont.1780292459831.woff} +0 -0
  45. /package/lib/{iconfont.1780114491819.woff2 → iconfont.1780292459831.woff2} +0 -0
package/dist/all.esm.js CHANGED
@@ -80,11 +80,11 @@ function checkDynamic() {
80
80
  }
81
81
  }
82
82
 
83
- const version$1 = `ui v${"4.14.25"}`;
83
+ const version$1 = `ui v${"4.14.26"}`;
84
84
  const warnLog = log.create('warn', version$1);
85
85
  const errLog = log.create('error', version$1);
86
86
 
87
- const version = "4.14.25";
87
+ const version = "4.14.26";
88
88
  VxeUI.uiVersion = version;
89
89
  VxeUI.dynamicApp = dynamicApp;
90
90
  function config(options) {
@@ -35231,7 +35231,18 @@ var VxeTextareaComponent = defineVxeComponent({
35231
35231
  },
35232
35232
  showWordCount: Boolean,
35233
35233
  countMethod: Function,
35234
- autosize: [Boolean, Object],
35234
+ /**
35235
+ * 已废弃,被 auto-size 替换
35236
+ * @deprecated
35237
+ */
35238
+ autosize: {
35239
+ type: [Boolean, Object],
35240
+ default: null
35241
+ },
35242
+ autoSize: {
35243
+ type: [Boolean, Object],
35244
+ default: null
35245
+ },
35235
35246
  form: String,
35236
35247
  resize: {
35237
35248
  type: String,
@@ -35266,6 +35277,7 @@ var VxeTextareaComponent = defineVxeComponent({
35266
35277
  });
35267
35278
  const refElem = ref();
35268
35279
  const refTextarea = ref();
35280
+ const refContent = ref();
35269
35281
  const refMaps = {
35270
35282
  refElem,
35271
35283
  refTextarea
@@ -35326,19 +35338,26 @@ var VxeTextareaComponent = defineVxeComponent({
35326
35338
  return inpMaxLength && inputCount > XEUtils.toNumber(inpMaxLength);
35327
35339
  });
35328
35340
  const computeSizeOpts = computed(() => {
35329
- return Object.assign({ minRows: 1, maxRows: 10 }, getConfig$3().textarea.autosize, props.autosize);
35341
+ const { autosize, autoSize } = props;
35342
+ if (autosize || getConfig$3().textarea.autosize) {
35343
+ return Object.assign({ minRows: 1, maxRows: 10 }, getConfig$3().textarea.autosize, autosize);
35344
+ }
35345
+ return Object.assign({ minRows: 1, maxRows: 10 }, getConfig$3().textarea.autoSize, autoSize);
35330
35346
  });
35331
35347
  const updateAutoTxt = () => {
35332
- const { size, autosize } = props;
35348
+ const { size, autosize, autoSize } = props;
35333
35349
  const { inputValue } = reactData;
35334
- if (autosize) {
35350
+ if (autosize || autoSize) {
35351
+ const formReadonly = computeFormReadonly.value;
35335
35352
  if (!autoTxtElem) {
35336
35353
  autoTxtElem = document.createElement('div');
35337
35354
  }
35338
35355
  if (!autoTxtElem.parentNode) {
35339
35356
  document.body.appendChild(autoTxtElem);
35340
35357
  }
35341
- const textElem = refTextarea.value;
35358
+ const taElem = refTextarea.value;
35359
+ const ctElem = refContent.value;
35360
+ const textElem = formReadonly ? ctElem : taElem;
35342
35361
  if (!textElem) {
35343
35362
  return;
35344
35363
  }
@@ -35350,11 +35369,15 @@ var VxeTextareaComponent = defineVxeComponent({
35350
35369
  }
35351
35370
  };
35352
35371
  const handleResize = () => {
35353
- if (props.autosize) {
35372
+ const { autosize, autoSize } = props;
35373
+ if (autosize || autoSize) {
35354
35374
  nextTick(() => {
35355
35375
  const sizeOpts = computeSizeOpts.value;
35376
+ const formReadonly = computeFormReadonly.value;
35356
35377
  const { minRows, maxRows } = sizeOpts;
35357
- const textElem = refTextarea.value;
35378
+ const taElem = refTextarea.value;
35379
+ const ctElem = refContent.value;
35380
+ const textElem = formReadonly ? ctElem : taElem;
35358
35381
  if (!textElem) {
35359
35382
  return;
35360
35383
  }
@@ -35442,23 +35465,8 @@ var VxeTextareaComponent = defineVxeComponent({
35442
35465
  }
35443
35466
  };
35444
35467
  Object.assign($xeTextarea, textareaMethods);
35445
- watch(() => props.modelValue, (val) => {
35446
- reactData.inputValue = val;
35447
- updateAutoTxt();
35448
- });
35449
- watch(computeSizeOpts, () => {
35450
- updateAutoTxt();
35451
- handleResize();
35452
- });
35453
- nextTick(() => {
35454
- const { autosize } = props;
35455
- if (autosize) {
35456
- updateAutoTxt();
35457
- handleResize();
35458
- }
35459
- });
35460
35468
  const renderVN = () => {
35461
- const { className, resize, autosize, showWordCount, countMethod, rows, cols } = props;
35469
+ const { className, resize, autosize, autoSize, showWordCount, countMethod, rows, cols } = props;
35462
35470
  const { inputValue } = reactData;
35463
35471
  const vSize = computeSize.value;
35464
35472
  const isDisabled = computeIsDisabled.value;
@@ -35472,13 +35480,18 @@ var VxeTextareaComponent = defineVxeComponent({
35472
35480
  return h('div', {
35473
35481
  ref: refElem,
35474
35482
  class: ['vxe-textarea--readonly', className]
35475
- }, inputValue);
35483
+ }, [
35484
+ h('div', {
35485
+ ref: refContent,
35486
+ class: 'vxe-textarea--content'
35487
+ }, inputValue)
35488
+ ]);
35476
35489
  }
35477
35490
  return h('div', {
35478
35491
  ref: refElem,
35479
35492
  class: ['vxe-textarea', className, {
35480
35493
  [`size--${vSize}`]: vSize,
35481
- 'is--autosize': autosize,
35494
+ 'is--autosize': autosize || autoSize,
35482
35495
  'is--count': showWordCount,
35483
35496
  'is--disabled': isDisabled,
35484
35497
  'is--rows': !XEUtils.eqNull(rows),
@@ -35519,6 +35532,37 @@ var VxeTextareaComponent = defineVxeComponent({
35519
35532
  : null
35520
35533
  ]);
35521
35534
  };
35535
+ watch(() => props.modelValue, (val) => {
35536
+ reactData.inputValue = val;
35537
+ updateAutoTxt();
35538
+ });
35539
+ const reFlag = ref(0);
35540
+ watch(computeFormReadonly, () => {
35541
+ reFlag.value++;
35542
+ });
35543
+ watch(computeSizeOpts, () => {
35544
+ reFlag.value++;
35545
+ });
35546
+ watch(() => props.autoSize, () => {
35547
+ reFlag.value++;
35548
+ });
35549
+ watch(() => props.autosize, () => {
35550
+ reFlag.value++;
35551
+ });
35552
+ watch(reFlag, () => {
35553
+ updateAutoTxt();
35554
+ handleResize();
35555
+ });
35556
+ nextTick(() => {
35557
+ const { autosize, autoSize } = props;
35558
+ if (autosize) {
35559
+ warnLog('vxe.error.delProp', ['autosize', 'auto-size']);
35560
+ }
35561
+ if (autosize || autoSize) {
35562
+ updateAutoTxt();
35563
+ handleResize();
35564
+ }
35565
+ });
35522
35566
  $xeTextarea.renderVN = renderVN;
35523
35567
  return $xeTextarea;
35524
35568
  },