vxe-table 4.5.7 → 4.5.9

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 (64) hide show
  1. package/es/edit/src/hook.js +3 -3
  2. package/es/icon/style.css +1 -1
  3. package/es/input/src/input.js +24 -1
  4. package/es/input/style.css +21 -0
  5. package/es/style.css +1 -1
  6. package/es/style.min.css +1 -1
  7. package/es/table/src/table.js +5 -1
  8. package/es/textarea/src/textarea.js +1 -0
  9. package/es/textarea/style.css +3 -3
  10. package/es/tools/log.js +1 -1
  11. package/es/v-x-e-table/index.js +1 -1
  12. package/es/vxe-input/style.css +21 -0
  13. package/es/vxe-textarea/style.css +3 -3
  14. package/helper/vetur/attributes.json +18 -2
  15. package/helper/vetur/tags.json +4 -0
  16. package/lib/edit/src/hook.js +2 -2
  17. package/lib/edit/src/hook.min.js +1 -1
  18. package/lib/icon/style/style.css +1 -1
  19. package/lib/icon/style/style.min.css +1 -1
  20. package/lib/index.umd.js +38 -5
  21. package/lib/index.umd.min.js +1 -1
  22. package/lib/input/src/input.js +27 -1
  23. package/lib/input/src/input.min.js +1 -1
  24. package/lib/input/style/style.css +21 -0
  25. package/lib/input/style/style.min.css +1 -1
  26. package/lib/style.css +1 -1
  27. package/lib/style.min.css +1 -1
  28. package/lib/table/src/table.js +6 -1
  29. package/lib/table/src/table.min.js +1 -1
  30. package/lib/textarea/src/textarea.js +1 -1
  31. package/lib/textarea/src/textarea.min.js +1 -1
  32. package/lib/textarea/style/style.css +3 -3
  33. package/lib/textarea/style/style.min.css +1 -1
  34. package/lib/tools/log.js +1 -1
  35. package/lib/tools/log.min.js +1 -1
  36. package/lib/v-x-e-table/index.js +1 -1
  37. package/lib/v-x-e-table/index.min.js +1 -1
  38. package/lib/vxe-input/style/style.css +21 -0
  39. package/lib/vxe-input/style/style.min.css +1 -1
  40. package/lib/vxe-textarea/style/style.css +3 -3
  41. package/lib/vxe-textarea/style/style.min.css +1 -1
  42. package/package.json +4 -9
  43. package/packages/edit/src/hook.ts +2 -2
  44. package/packages/input/src/input.ts +29 -1
  45. package/packages/table/src/table.ts +5 -1
  46. package/packages/textarea/src/textarea.ts +1 -0
  47. package/styles/css-variable.scss +3 -3
  48. package/styles/input.scss +25 -0
  49. package/styles/textarea.scss +3 -3
  50. package/styles/variable.scss +3 -3
  51. package/types/input.d.ts +12 -0
  52. package/types/plugins/pro.d.ts +21 -2
  53. /package/es/icon/style/{iconfont.1693010447356.ttf → iconfont.1693442246739.ttf} +0 -0
  54. /package/es/icon/style/{iconfont.1693010447356.woff → iconfont.1693442246739.woff} +0 -0
  55. /package/es/icon/style/{iconfont.1693010447356.woff2 → iconfont.1693442246739.woff2} +0 -0
  56. /package/es/{iconfont.1693010447356.ttf → iconfont.1693442246739.ttf} +0 -0
  57. /package/es/{iconfont.1693010447356.woff → iconfont.1693442246739.woff} +0 -0
  58. /package/es/{iconfont.1693010447356.woff2 → iconfont.1693442246739.woff2} +0 -0
  59. /package/lib/icon/style/{iconfont.1693010447356.ttf → iconfont.1693442246739.ttf} +0 -0
  60. /package/lib/icon/style/{iconfont.1693010447356.woff → iconfont.1693442246739.woff} +0 -0
  61. /package/lib/icon/style/{iconfont.1693010447356.woff2 → iconfont.1693442246739.woff2} +0 -0
  62. /package/lib/{iconfont.1693010447356.ttf → iconfont.1693442246739.ttf} +0 -0
  63. /package/lib/{iconfont.1693010447356.woff → iconfont.1693442246739.woff} +0 -0
  64. /package/lib/{iconfont.1693010447356.woff2 → iconfont.1693442246739.woff2} +0 -0
package/lib/index.umd.js CHANGED
@@ -2277,7 +2277,7 @@ const GlobalConfig = {
2277
2277
  ;// CONCATENATED MODULE: ./packages/tools/log.ts
2278
2278
 
2279
2279
  function getLog(message, params) {
2280
- return `[vxe-table v${"4.5.6"}] ${conf.i18n(message, params)}`;
2280
+ return `[vxe-table v${"4.5.8"}] ${conf.i18n(message, params)}`;
2281
2281
  }
2282
2282
  function outLog(type) {
2283
2283
  return function (message, params) {
@@ -4350,7 +4350,7 @@ const config = new VXETableConfig();
4350
4350
  const v = 'v4';
4351
4351
  const VXETable = {
4352
4352
  v,
4353
- version: "4.5.6",
4353
+ version: "4.5.8",
4354
4354
  setup: setup,
4355
4355
  interceptor: interceptor,
4356
4356
  renderer: renderer,
@@ -5777,10 +5777,10 @@ const editHook = {
5777
5777
  if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(records)) {
5778
5778
  records = [records];
5779
5779
  }
5780
- const newRecords = $xetable.defineField(records.map(record => Object.assign(treeConfig && transform ? {
5780
+ const newRecords = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)($xetable.defineField(records.map(record => Object.assign(treeConfig && transform ? {
5781
5781
  [mapChildrenField]: [],
5782
5782
  [childrenField]: []
5783
- } : {}, record)));
5783
+ } : {}, record))));
5784
5784
  if (!row) {
5785
5785
  // 如果为虚拟树
5786
5786
  if (treeConfig && transform) {
@@ -8315,6 +8315,9 @@ const quarterSize = 8;
8315
8315
  default: () => conf.input.size || conf.size
8316
8316
  },
8317
8317
  multiple: Boolean,
8318
+ // text
8319
+ showWordCount: Boolean,
8320
+ countMethod: Function,
8318
8321
  // number、integer、float
8319
8322
  min: {
8320
8323
  type: [String, Number],
@@ -8450,6 +8453,13 @@ const quarterSize = 8;
8450
8453
  const computeIsNumType = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
8451
8454
  return ['number', 'integer', 'float'].indexOf(props.type) > -1;
8452
8455
  });
8456
+ const computeInputCount = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
8457
+ return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getSize(reactData.inputValue);
8458
+ });
8459
+ const computeIsCountError = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
8460
+ const inputCount = computeInputCount.value;
8461
+ return props.maxlength && inputCount > external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(props.maxlength);
8462
+ });
8453
8463
  const computeIsDatePickerType = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
8454
8464
  const isDateTimeType = computeIsDateTimeType.value;
8455
8465
  return isDateTimeType || ['date', 'week', 'month', 'quarter', 'year'].indexOf(props.type) > -1;
@@ -10696,6 +10706,8 @@ const quarterSize = 8;
10696
10706
  controls,
10697
10707
  type,
10698
10708
  align,
10709
+ showWordCount,
10710
+ countMethod,
10699
10711
  name,
10700
10712
  disabled,
10701
10713
  readonly,
@@ -10707,6 +10719,8 @@ const quarterSize = 8;
10707
10719
  isActivated
10708
10720
  } = reactData;
10709
10721
  const vSize = computeSize.value;
10722
+ const isCountError = computeIsCountError.value;
10723
+ const inputCount = computeInputCount.value;
10710
10724
  const isDatePickerType = computeIsDatePickerType.value;
10711
10725
  const inpReadonly = computeInpReadonly.value;
10712
10726
  const inpMaxlength = computeInpMaxlength.value;
@@ -10750,6 +10764,18 @@ const quarterSize = 8;
10750
10764
  if (isDatePickerType) {
10751
10765
  childs.push(renderPanel());
10752
10766
  }
10767
+ let isWordCount = false;
10768
+ // 统计字数
10769
+ if (showWordCount && ['text', 'search'].includes(type)) {
10770
+ isWordCount = true;
10771
+ childs.push((0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
10772
+ class: ['vxe-input--count', {
10773
+ 'is--error': isCountError
10774
+ }]
10775
+ }, countMethod ? `${countMethod({
10776
+ value: inputValue
10777
+ })}` : `${inputCount}${inpMaxlength ? `/${inpMaxlength}` : ''}`));
10778
+ }
10753
10779
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
10754
10780
  ref: refElem,
10755
10781
  class: ['vxe-input', `type--${type}`, className, {
@@ -10760,6 +10786,7 @@ const quarterSize = 8;
10760
10786
  'is--suffix': !!suffix,
10761
10787
  'is--readonly': readonly,
10762
10788
  'is--visivle': visiblePanel,
10789
+ 'is--count': isWordCount,
10763
10790
  'is--disabled': disabled,
10764
10791
  'is--active': isActivated
10765
10792
  }]
@@ -20288,6 +20315,7 @@ let autoTxtElem;
20288
20315
  class: ['vxe-textarea', className, {
20289
20316
  [`size--${vSize}`]: vSize,
20290
20317
  'is--autosize': autosize,
20318
+ 'is--count': showWordCount,
20291
20319
  'is--disabled': disabled,
20292
20320
  'def--rows': !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(rows),
20293
20321
  'def--cols': !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(cols)
@@ -28559,7 +28587,8 @@ const orderStorageKey = 'VXE_TABLE_CUSTOM_COLUMN_ORDER';
28559
28587
  const {
28560
28588
  tableSourceData,
28561
28589
  fullDataRowIdData,
28562
- fullAllDataRowIdData
28590
+ fullAllDataRowIdData,
28591
+ sourceDataRowIdData
28563
28592
  } = internalData;
28564
28593
  const treeOpts = computeTreeOpts.value;
28565
28594
  const {
@@ -28578,6 +28607,10 @@ const orderStorageKey = 'VXE_TABLE_CUSTOM_COLUMN_ORDER';
28578
28607
  if (matchObj) {
28579
28608
  matchObj.item[childrenField] = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(rows, true);
28580
28609
  }
28610
+ rows.forEach(childRow => {
28611
+ const rowid = getRowid($xetable, childRow);
28612
+ sourceDataRowIdData[rowid] = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(childRow, true);
28613
+ });
28581
28614
  }
28582
28615
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(rows, (childRow, index, items, path, parent, nodes) => {
28583
28616
  const rowid = getRowid($xetable, childRow);