vxe-table 3.11.12 → 3.11.14

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 (123) hide show
  1. package/es/locale/lang/ar-EG.js +678 -0
  2. package/es/locale/lang/de-DE.js +678 -0
  3. package/es/locale/lang/en-US.js +2 -1
  4. package/es/locale/lang/es-ES.js +2 -1
  5. package/es/locale/lang/fr-FR.js +678 -0
  6. package/es/locale/lang/hu-HU.js +2 -1
  7. package/es/locale/lang/hy-AM.js +678 -0
  8. package/es/locale/lang/ja-JP.js +2 -1
  9. package/es/locale/lang/ko-KR.js +2 -1
  10. package/es/locale/lang/nb-NO.js +678 -0
  11. package/es/locale/lang/pt-BR.js +2 -1
  12. package/es/locale/lang/ru-RU.js +2 -1
  13. package/es/locale/lang/ug-CN.js +678 -0
  14. package/es/locale/lang/uk-UA.js +2 -1
  15. package/es/locale/lang/vi-VN.js +2 -1
  16. package/es/locale/lang/zh-CHT.js +2 -1
  17. package/es/locale/lang/zh-CN.js +2 -1
  18. package/es/style.css +1 -1
  19. package/es/table/module/custom/panel.js +27 -2
  20. package/es/table/module/edit/mixin.js +2 -2
  21. package/es/table/module/export/mixin.js +4 -1
  22. package/es/table/module/keyboard/mixin.js +2 -2
  23. package/es/table/src/body.js +15 -4
  24. package/es/table/src/methods.js +93 -13
  25. package/es/table/src/table.js +14 -6
  26. package/es/ui/index.js +1 -1
  27. package/es/ui/src/log.js +1 -1
  28. package/lib/index.umd.js +191 -39
  29. package/lib/index.umd.min.js +1 -1
  30. package/lib/locale/lang/ar-EG.js +684 -0
  31. package/lib/locale/lang/ar-EG.min.js +1 -0
  32. package/lib/locale/lang/de-DE.js +684 -0
  33. package/lib/locale/lang/de-DE.min.js +1 -0
  34. package/lib/locale/lang/en-US.js +2 -1
  35. package/lib/locale/lang/en-US.min.js +1 -1
  36. package/lib/locale/lang/en-US.umd.js +2 -1
  37. package/lib/locale/lang/es-ES.js +2 -1
  38. package/lib/locale/lang/es-ES.min.js +1 -1
  39. package/lib/locale/lang/es-ES.umd.js +2 -1
  40. package/lib/locale/lang/fr-FR.js +684 -0
  41. package/lib/locale/lang/fr-FR.min.js +1 -0
  42. package/lib/locale/lang/hu-HU.js +2 -1
  43. package/lib/locale/lang/hu-HU.min.js +1 -1
  44. package/lib/locale/lang/hu-HU.umd.js +2 -1
  45. package/lib/locale/lang/hy-AM.js +684 -0
  46. package/lib/locale/lang/hy-AM.min.js +1 -0
  47. package/lib/locale/lang/ja-JP.js +2 -1
  48. package/lib/locale/lang/ja-JP.min.js +1 -1
  49. package/lib/locale/lang/ja-JP.umd.js +2 -1
  50. package/lib/locale/lang/ko-KR.js +2 -1
  51. package/lib/locale/lang/ko-KR.min.js +1 -1
  52. package/lib/locale/lang/ko-KR.umd.js +2 -1
  53. package/lib/locale/lang/nb-NO.js +684 -0
  54. package/lib/locale/lang/nb-NO.min.js +1 -0
  55. package/lib/locale/lang/pt-BR.js +2 -1
  56. package/lib/locale/lang/pt-BR.min.js +1 -1
  57. package/lib/locale/lang/pt-BR.umd.js +2 -1
  58. package/lib/locale/lang/ru-RU.js +2 -1
  59. package/lib/locale/lang/ru-RU.min.js +1 -1
  60. package/lib/locale/lang/ru-RU.umd.js +2 -1
  61. package/lib/locale/lang/ug-CN.js +684 -0
  62. package/lib/locale/lang/ug-CN.min.js +1 -0
  63. package/lib/locale/lang/uk-UA.js +2 -1
  64. package/lib/locale/lang/uk-UA.min.js +1 -1
  65. package/lib/locale/lang/uk-UA.umd.js +2 -1
  66. package/lib/locale/lang/vi-VN.js +2 -1
  67. package/lib/locale/lang/vi-VN.min.js +1 -1
  68. package/lib/locale/lang/zh-CHT.js +2 -1
  69. package/lib/locale/lang/zh-CHT.min.js +1 -1
  70. package/lib/locale/lang/zh-CHT.umd.js +2 -1
  71. package/lib/locale/lang/zh-CN.js +2 -1
  72. package/lib/locale/lang/zh-CN.min.js +1 -1
  73. package/lib/locale/lang/zh-CN.umd.js +2 -1
  74. package/lib/style.css +1 -1
  75. package/lib/table/module/custom/panel.js +26 -1
  76. package/lib/table/module/custom/panel.min.js +1 -1
  77. package/lib/table/module/edit/mixin.js +2 -2
  78. package/lib/table/module/edit/mixin.min.js +1 -1
  79. package/lib/table/module/export/mixin.js +4 -1
  80. package/lib/table/module/export/mixin.min.js +1 -1
  81. package/lib/table/module/keyboard/mixin.js +2 -2
  82. package/lib/table/module/keyboard/mixin.min.js +1 -1
  83. package/lib/table/src/body.js +17 -4
  84. package/lib/table/src/body.min.js +1 -1
  85. package/lib/table/src/methods.js +120 -16
  86. package/lib/table/src/methods.min.js +1 -1
  87. package/lib/table/src/table.js +16 -10
  88. package/lib/table/src/table.min.js +1 -1
  89. package/lib/ui/index.js +1 -1
  90. package/lib/ui/index.min.js +1 -1
  91. package/lib/ui/src/log.js +1 -1
  92. package/lib/ui/src/log.min.js +1 -1
  93. package/package.json +2 -2
  94. package/packages/locale/lang/ar-EG.ts +678 -0
  95. package/packages/locale/lang/de-DE.ts +678 -0
  96. package/packages/locale/lang/en-US.ts +2 -1
  97. package/packages/locale/lang/es-ES.ts +2 -1
  98. package/packages/locale/lang/fr-FR.ts +678 -0
  99. package/packages/locale/lang/hu-HU.ts +2 -1
  100. package/packages/locale/lang/hy-AM.ts +678 -0
  101. package/packages/locale/lang/ja-JP.ts +2 -1
  102. package/packages/locale/lang/ko-KR.ts +2 -1
  103. package/packages/locale/lang/nb-NO.ts +678 -0
  104. package/packages/locale/lang/pt-BR.ts +2 -1
  105. package/packages/locale/lang/ru-RU.ts +2 -1
  106. package/packages/locale/lang/ug-CN.ts +678 -0
  107. package/packages/locale/lang/uk-UA.ts +2 -1
  108. package/packages/locale/lang/vi-VN.ts +2 -1
  109. package/packages/locale/lang/zh-CHT.ts +2 -1
  110. package/packages/locale/lang/zh-CN.ts +2 -1
  111. package/packages/table/module/custom/panel.ts +27 -2
  112. package/packages/table/module/edit/mixin.ts +2 -2
  113. package/packages/table/module/export/mixin.ts +4 -1
  114. package/packages/table/module/keyboard/mixin.ts +2 -2
  115. package/packages/table/src/body.ts +14 -4
  116. package/packages/table/src/methods.ts +97 -14
  117. package/packages/table/src/table.ts +14 -6
  118. /package/es/{iconfont.1732797517080.ttf → iconfont.1733097092605.ttf} +0 -0
  119. /package/es/{iconfont.1732797517080.woff → iconfont.1733097092605.woff} +0 -0
  120. /package/es/{iconfont.1732797517080.woff2 → iconfont.1733097092605.woff2} +0 -0
  121. /package/lib/{iconfont.1732797517080.ttf → iconfont.1733097092605.ttf} +0 -0
  122. /package/lib/{iconfont.1732797517080.woff → iconfont.1733097092605.woff} +0 -0
  123. /package/lib/{iconfont.1732797517080.woff2 → iconfont.1733097092605.woff2} +0 -0
@@ -572,16 +572,15 @@ function handleRecalculateLayout($xeTable, reFull) {
572
572
  }
573
573
  $xeTable.calcCellWidth();
574
574
  $xeTable.autoCellWidth();
575
- if (reFull === true) {
576
- // 初始化时需要在列计算之后再执行优化运算,达到最优显示效果
577
- return $xeTable.computeScrollLoad().then(() => {
575
+ return $xeTable.computeScrollLoad().then(() => {
576
+ if (reFull === true) {
577
+ // 初始化时需要在列计算之后再执行优化运算,达到最优显示效果
578
578
  calcCellHeight($xeTable);
579
579
  $xeTable.calcCellWidth();
580
580
  $xeTable.autoCellWidth();
581
581
  return $xeTable.computeScrollLoad();
582
- });
583
- }
584
- return $xeTable.computeScrollLoad();
582
+ }
583
+ });
585
584
  }
586
585
  function checkLastSyncScroll($xeTable, isRollX, isRollY) {
587
586
  const reactData = $xeTable;
@@ -1950,6 +1949,11 @@ const Methods = {
1950
1949
  * @returns
1951
1950
  */
1952
1951
  handleVirtualTreeToList() {
1952
+ const $xeTable = this;
1953
+ const internalData = $xeTable;
1954
+ const {
1955
+ fullAllDataRowIdData
1956
+ } = internalData;
1953
1957
  const {
1954
1958
  treeOpts,
1955
1959
  treeConfig,
@@ -1965,6 +1969,10 @@ const Methods = {
1965
1969
  const rowid = (0, _util.getRowid)(this, row);
1966
1970
  const parentRowid = (0, _util.getRowid)(this, parent);
1967
1971
  if (!parent || expandMaps[parentRowid] && treeExpandedMaps[parentRowid]) {
1972
+ const rowRest = fullAllDataRowIdData[rowid];
1973
+ if (rowRest) {
1974
+ rowRest._index = fullData.length;
1975
+ }
1968
1976
  expandMaps[rowid] = 1;
1969
1977
  fullData.push(row);
1970
1978
  }
@@ -2188,24 +2196,69 @@ const Methods = {
2188
2196
  this.afterTreeFullData = tableTree;
2189
2197
  this.updateAfterDataIndex();
2190
2198
  },
2199
+ updateTreeDataIndex() {
2200
+ const $xeTable = this;
2201
+ const props = $xeTable;
2202
+ const internalData = $xeTable;
2203
+ const {
2204
+ treeConfig
2205
+ } = props;
2206
+ const {
2207
+ afterFullData,
2208
+ fullDataRowIdData,
2209
+ fullAllDataRowIdData
2210
+ } = internalData;
2211
+ const treeOpts = $xeTable.computeTreeOpts;
2212
+ if (treeConfig) {
2213
+ if (treeOpts.transform) {
2214
+ afterFullData.forEach((row, index) => {
2215
+ const rowid = (0, _util.getRowid)($xeTable, row);
2216
+ const rowRest = fullAllDataRowIdData[rowid];
2217
+ if (rowRest) {
2218
+ rowRest._index = index;
2219
+ } else {
2220
+ const rest = {
2221
+ row,
2222
+ rowid,
2223
+ seq: '-1',
2224
+ index: -1,
2225
+ $index: -1,
2226
+ _index: index,
2227
+ items: [],
2228
+ parent: null,
2229
+ level: 0,
2230
+ height: 0
2231
+ };
2232
+ fullAllDataRowIdData[rowid] = rest;
2233
+ fullDataRowIdData[rowid] = rest;
2234
+ }
2235
+ });
2236
+ }
2237
+ }
2238
+ },
2191
2239
  /**
2192
2240
  * 预编译
2193
2241
  * 对渲染中的数据提前解析序号及索引。牺牲提前编译耗时换取渲染中额外损耗,使运行时更加流畅
2194
2242
  */
2195
2243
  updateAfterDataIndex() {
2244
+ const $xeTable = this;
2245
+ const props = $xeTable;
2246
+ const internalData = $xeTable;
2247
+ const {
2248
+ treeConfig
2249
+ } = props;
2196
2250
  const {
2197
- treeConfig,
2198
2251
  afterFullData,
2199
2252
  fullDataRowIdData,
2200
2253
  fullAllDataRowIdData,
2201
- afterTreeFullData,
2202
- treeOpts
2203
- } = this;
2254
+ afterTreeFullData
2255
+ } = internalData;
2256
+ const treeOpts = $xeTable.computeTreeOpts;
2204
2257
  const childrenField = treeOpts.children || treeOpts.childrenField;
2205
2258
  const fullMaps = {};
2206
2259
  if (treeConfig) {
2207
2260
  _xeUtils.default.eachTree(afterTreeFullData, (row, index, items, path) => {
2208
- const rowid = (0, _util.getRowid)(this, row);
2261
+ const rowid = (0, _util.getRowid)($xeTable, row);
2209
2262
  const rowRest = fullAllDataRowIdData[rowid];
2210
2263
  const seq = path.map((num, i) => i % 2 === 0 ? Number(num) + 1 : '.').join('');
2211
2264
  if (rowRest) {
@@ -2231,9 +2284,10 @@ const Methods = {
2231
2284
  }, {
2232
2285
  children: treeOpts.transform ? treeOpts.mapChildrenField : childrenField
2233
2286
  });
2287
+ $xeTable.updateTreeDataIndex();
2234
2288
  } else {
2235
2289
  afterFullData.forEach((row, index) => {
2236
- const rowid = (0, _util.getRowid)(this, row);
2290
+ const rowid = (0, _util.getRowid)($xeTable, row);
2237
2291
  const rowRest = fullAllDataRowIdData[rowid];
2238
2292
  const seq = index + 1;
2239
2293
  if (rowRest) {
@@ -2260,10 +2314,46 @@ const Methods = {
2260
2314
  }
2261
2315
  this.afterFullRowMaps = fullMaps;
2262
2316
  },
2317
+ /**
2318
+ * 只对 tree-config 有效,获取行的子级
2319
+ */
2320
+ getTreeRowChildren(rowOrRowid) {
2321
+ const $xeTable = this;
2322
+ const props = $xeTable;
2323
+ const internalData = $xeTable;
2324
+ const {
2325
+ treeConfig
2326
+ } = props;
2327
+ const {
2328
+ fullDataRowIdData
2329
+ } = internalData;
2330
+ const treeOpts = $xeTable.computeTreeOpts;
2331
+ const {
2332
+ transform,
2333
+ mapChildrenField
2334
+ } = treeOpts;
2335
+ const childrenField = treeOpts.children || treeOpts.childrenField;
2336
+ if (rowOrRowid && treeConfig) {
2337
+ let rowid;
2338
+ if (_xeUtils.default.isString(rowOrRowid)) {
2339
+ rowid = rowOrRowid;
2340
+ } else {
2341
+ rowid = (0, _util.getRowid)($xeTable, rowOrRowid);
2342
+ }
2343
+ if (rowid) {
2344
+ const rest = fullDataRowIdData[rowid];
2345
+ const row = rest ? rest.row : null;
2346
+ if (row) {
2347
+ return row[transform ? mapChildrenField : childrenField] || [];
2348
+ }
2349
+ }
2350
+ }
2351
+ return [];
2352
+ },
2263
2353
  /**
2264
2354
  * 只对 tree-config 有效,获取行的父级
2265
2355
  */
2266
- getParentRow(rowOrRowid) {
2356
+ getTreeParentRow(rowOrRowid) {
2267
2357
  const {
2268
2358
  treeConfig,
2269
2359
  fullDataRowIdData
@@ -2282,6 +2372,11 @@ const Methods = {
2282
2372
  }
2283
2373
  return null;
2284
2374
  },
2375
+ getParentRow(rowOrRowid) {
2376
+ const $xeTable = this;
2377
+ (0, _log.warnLog)('vxe.error.delFunc', ['getParentRow', 'getTreeParentRow']);
2378
+ return $xeTable.getTreeParentRow(rowOrRowid);
2379
+ },
2285
2380
  /**
2286
2381
  * 根据行的唯一主键获取行
2287
2382
  * @param {String/Number} rowid 行主键
@@ -6889,7 +6984,9 @@ const Methods = {
6889
6984
  }
6890
6985
  return this.$nextTick().then(() => {
6891
6986
  if (transform) {
6892
- return this.handleTableData();
6987
+ this.handleTableData();
6988
+ this.updateTreeDataIndex();
6989
+ return this.$nextTick();
6893
6990
  }
6894
6991
  });
6895
6992
  });
@@ -7015,7 +7112,9 @@ const Methods = {
7015
7112
  validRows.forEach(row => this.handleTreeExpandReserve(row, expanded));
7016
7113
  }
7017
7114
  this.treeExpandedMaps = treeTempExpandedMaps;
7018
- return Promise.all(result).then(this.recalculate);
7115
+ return Promise.all(result).then(() => {
7116
+ return this.recalculate();
7117
+ });
7019
7118
  },
7020
7119
  /**
7021
7120
  * 虚拟树的展开与收起
@@ -7026,9 +7125,14 @@ const Methods = {
7026
7125
  handleVirtualTreeExpand(rows, expanded) {
7027
7126
  return this.handleBaseTreeExpand(rows, expanded).then(() => {
7028
7127
  this.handleVirtualTreeToList();
7029
- return this.handleTableData();
7128
+ this.handleTableData();
7129
+ this.updateTreeDataIndex();
7030
7130
  }).then(() => {
7031
7131
  return this.recalculate();
7132
+ }).then(() => {
7133
+ setTimeout(() => {
7134
+ this.updateCellAreas();
7135
+ }, 30);
7032
7136
  });
7033
7137
  },
7034
7138
  /**