vxe-table 3.15.54 → 3.15.57

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 (140) hide show
  1. package/es/grid/src/grid.js +31 -0
  2. package/es/locale/lang/ar-EG.js +2 -1
  3. package/es/locale/lang/de-DE.js +2 -1
  4. package/es/locale/lang/en-US.js +2 -1
  5. package/es/locale/lang/es-ES.js +2 -1
  6. package/es/locale/lang/fr-FR.js +2 -1
  7. package/es/locale/lang/hu-HU.js +2 -1
  8. package/es/locale/lang/hy-AM.js +2 -1
  9. package/es/locale/lang/id-ID.js +2 -1
  10. package/es/locale/lang/it-IT.js +2 -1
  11. package/es/locale/lang/ja-JP.js +2 -1
  12. package/es/locale/lang/ko-KR.js +2 -1
  13. package/es/locale/lang/ms-MY.js +2 -1
  14. package/es/locale/lang/nb-NO.js +2 -1
  15. package/es/locale/lang/pt-BR.js +2 -1
  16. package/es/locale/lang/ru-RU.js +2 -1
  17. package/es/locale/lang/th-TH.js +2 -1
  18. package/es/locale/lang/ug-CN.js +2 -1
  19. package/es/locale/lang/uk-UA.js +2 -1
  20. package/es/locale/lang/uz-UZ.js +2 -1
  21. package/es/locale/lang/vi-VN.js +2 -1
  22. package/es/locale/lang/zh-CHT.js +2 -1
  23. package/es/locale/lang/zh-CN.js +2 -1
  24. package/es/style.css +1 -1
  25. package/es/table/src/methods.js +60 -17
  26. package/es/table/src/table.js +30 -2
  27. package/es/ui/index.js +2 -1
  28. package/es/ui/src/log.js +1 -1
  29. package/lib/grid/src/grid.js +48 -0
  30. package/lib/grid/src/grid.min.js +1 -1
  31. package/lib/index.umd.js +157 -22
  32. package/lib/index.umd.min.js +1 -1
  33. package/lib/locale/lang/ar-EG.js +2 -1
  34. package/lib/locale/lang/ar-EG.min.js +1 -1
  35. package/lib/locale/lang/ar-EG.umd.js +2 -1
  36. package/lib/locale/lang/de-DE.js +2 -1
  37. package/lib/locale/lang/de-DE.min.js +1 -1
  38. package/lib/locale/lang/de-DE.umd.js +2 -1
  39. package/lib/locale/lang/en-US.js +2 -1
  40. package/lib/locale/lang/en-US.min.js +1 -1
  41. package/lib/locale/lang/en-US.umd.js +2 -1
  42. package/lib/locale/lang/es-ES.js +2 -1
  43. package/lib/locale/lang/es-ES.min.js +1 -1
  44. package/lib/locale/lang/es-ES.umd.js +2 -1
  45. package/lib/locale/lang/fr-FR.js +2 -1
  46. package/lib/locale/lang/fr-FR.min.js +1 -1
  47. package/lib/locale/lang/fr-FR.umd.js +2 -1
  48. package/lib/locale/lang/hu-HU.js +2 -1
  49. package/lib/locale/lang/hu-HU.min.js +1 -1
  50. package/lib/locale/lang/hu-HU.umd.js +2 -1
  51. package/lib/locale/lang/hy-AM.js +2 -1
  52. package/lib/locale/lang/hy-AM.min.js +1 -1
  53. package/lib/locale/lang/hy-AM.umd.js +2 -1
  54. package/lib/locale/lang/id-ID.js +2 -1
  55. package/lib/locale/lang/id-ID.min.js +1 -1
  56. package/lib/locale/lang/id-ID.umd.js +2 -1
  57. package/lib/locale/lang/it-IT.js +2 -1
  58. package/lib/locale/lang/it-IT.min.js +1 -1
  59. package/lib/locale/lang/it-IT.umd.js +2 -1
  60. package/lib/locale/lang/ja-JP.js +2 -1
  61. package/lib/locale/lang/ja-JP.min.js +1 -1
  62. package/lib/locale/lang/ja-JP.umd.js +2 -1
  63. package/lib/locale/lang/ko-KR.js +2 -1
  64. package/lib/locale/lang/ko-KR.min.js +1 -1
  65. package/lib/locale/lang/ko-KR.umd.js +2 -1
  66. package/lib/locale/lang/ms-MY.js +2 -1
  67. package/lib/locale/lang/ms-MY.min.js +1 -1
  68. package/lib/locale/lang/ms-MY.umd.js +2 -1
  69. package/lib/locale/lang/nb-NO.js +2 -1
  70. package/lib/locale/lang/nb-NO.min.js +1 -1
  71. package/lib/locale/lang/nb-NO.umd.js +2 -1
  72. package/lib/locale/lang/pt-BR.js +2 -1
  73. package/lib/locale/lang/pt-BR.min.js +1 -1
  74. package/lib/locale/lang/pt-BR.umd.js +2 -1
  75. package/lib/locale/lang/ru-RU.js +2 -1
  76. package/lib/locale/lang/ru-RU.min.js +1 -1
  77. package/lib/locale/lang/ru-RU.umd.js +2 -1
  78. package/lib/locale/lang/th-TH.js +2 -1
  79. package/lib/locale/lang/th-TH.min.js +1 -1
  80. package/lib/locale/lang/th-TH.umd.js +2 -1
  81. package/lib/locale/lang/ug-CN.js +2 -1
  82. package/lib/locale/lang/ug-CN.min.js +1 -1
  83. package/lib/locale/lang/ug-CN.umd.js +2 -1
  84. package/lib/locale/lang/uk-UA.js +2 -1
  85. package/lib/locale/lang/uk-UA.min.js +1 -1
  86. package/lib/locale/lang/uk-UA.umd.js +2 -1
  87. package/lib/locale/lang/uz-UZ.js +2 -1
  88. package/lib/locale/lang/uz-UZ.min.js +1 -1
  89. package/lib/locale/lang/uz-UZ.umd.js +2 -1
  90. package/lib/locale/lang/vi-VN.js +2 -1
  91. package/lib/locale/lang/vi-VN.min.js +1 -1
  92. package/lib/locale/lang/vi-VN.umd.js +2 -1
  93. package/lib/locale/lang/zh-CHT.js +2 -1
  94. package/lib/locale/lang/zh-CHT.min.js +1 -1
  95. package/lib/locale/lang/zh-CHT.umd.js +2 -1
  96. package/lib/locale/lang/zh-CN.js +2 -1
  97. package/lib/locale/lang/zh-CN.min.js +1 -1
  98. package/lib/locale/lang/zh-CN.umd.js +2 -1
  99. package/lib/style.css +1 -1
  100. package/lib/table/src/methods.js +66 -17
  101. package/lib/table/src/methods.min.js +1 -1
  102. package/lib/table/src/table.js +36 -2
  103. package/lib/table/src/table.min.js +1 -1
  104. package/lib/ui/index.js +2 -1
  105. package/lib/ui/index.min.js +1 -1
  106. package/lib/ui/src/log.js +1 -1
  107. package/lib/ui/src/log.min.js +1 -1
  108. package/package.json +1 -1
  109. package/packages/grid/src/grid.ts +31 -0
  110. package/packages/locale/lang/ar-EG.ts +2 -1
  111. package/packages/locale/lang/de-DE.ts +2 -1
  112. package/packages/locale/lang/en-US.ts +2 -1
  113. package/packages/locale/lang/es-ES.ts +2 -1
  114. package/packages/locale/lang/fr-FR.ts +2 -1
  115. package/packages/locale/lang/hu-HU.ts +2 -1
  116. package/packages/locale/lang/hy-AM.ts +2 -1
  117. package/packages/locale/lang/id-ID.ts +2 -1
  118. package/packages/locale/lang/it-IT.ts +2 -1
  119. package/packages/locale/lang/ja-JP.ts +2 -1
  120. package/packages/locale/lang/ko-KR.ts +2 -1
  121. package/packages/locale/lang/ms-MY.ts +2 -1
  122. package/packages/locale/lang/nb-NO.ts +2 -1
  123. package/packages/locale/lang/pt-BR.ts +2 -1
  124. package/packages/locale/lang/ru-RU.ts +2 -1
  125. package/packages/locale/lang/th-TH.ts +2 -1
  126. package/packages/locale/lang/ug-CN.ts +2 -1
  127. package/packages/locale/lang/uk-UA.ts +2 -1
  128. package/packages/locale/lang/uz-UZ.ts +2 -1
  129. package/packages/locale/lang/vi-VN.ts +2 -1
  130. package/packages/locale/lang/zh-CHT.ts +2 -1
  131. package/packages/locale/lang/zh-CN.ts +2 -1
  132. package/packages/table/src/methods.ts +70 -16
  133. package/packages/table/src/table.ts +31 -3
  134. package/packages/ui/index.ts +1 -0
  135. /package/es/{iconfont.1753260891694.ttf → iconfont.1754364592710.ttf} +0 -0
  136. /package/es/{iconfont.1753260891694.woff → iconfont.1754364592710.woff} +0 -0
  137. /package/es/{iconfont.1753260891694.woff2 → iconfont.1754364592710.woff2} +0 -0
  138. /package/lib/{iconfont.1753260891694.ttf → iconfont.1754364592710.ttf} +0 -0
  139. /package/lib/{iconfont.1753260891694.woff → iconfont.1754364592710.woff} +0 -0
  140. /package/lib/{iconfont.1753260891694.woff2 → iconfont.1754364592710.woff2} +0 -0
@@ -369,10 +369,10 @@ function cacheColumnMap($xeTable) {
369
369
  }
370
370
  if (htmlColumn) {
371
371
  if (!columnOpts.useKey) {
372
- (0, _log.errLog)('vxe.error.reqProp', ['column-config.useKey & column.type=html']);
372
+ (0, _log.errLog)('vxe.error.notSupportProp', ['column.type=html', 'column-config.useKey=false', 'column-config.useKey=true']);
373
373
  }
374
374
  if (!rowOpts.useKey) {
375
- (0, _log.errLog)('vxe.error.reqProp', ['row-config.useKey & column.type=html']);
375
+ (0, _log.errLog)('vxe.error.notSupportProp', ['column.type=html', 'row-config.useKey=false', 'row-config.useKey=true']);
376
376
  }
377
377
  }
378
378
  reactData.isGroup = isGroup;
@@ -2414,6 +2414,10 @@ function removeFooterMerges($xeTable, merges) {
2414
2414
  return rest;
2415
2415
  }
2416
2416
  function handleSortEvent($xeTable, evnt, sortConfs, isUpdate) {
2417
+ const internalData = $xeTable;
2418
+ const {
2419
+ tableFullColumn
2420
+ } = internalData;
2417
2421
  const sortOpts = $xeTable.computeSortOpts;
2418
2422
  const {
2419
2423
  multiple,
@@ -2424,10 +2428,16 @@ function handleSortEvent($xeTable, evnt, sortConfs, isUpdate) {
2424
2428
  sortConfs = [sortConfs];
2425
2429
  }
2426
2430
  if (sortConfs && sortConfs.length) {
2431
+ const orderActiveMaps = {};
2427
2432
  if (!multiple) {
2428
2433
  sortConfs = [sortConfs[0]];
2429
- clearAllSort($xeTable);
2434
+ tableFullColumn.forEach(column => {
2435
+ if (column.order) {
2436
+ orderActiveMaps[column.id] = column;
2437
+ }
2438
+ });
2430
2439
  }
2440
+ const sortColMpps = {};
2431
2441
  let firstColumn = null;
2432
2442
  sortConfs.forEach((confs, index) => {
2433
2443
  let {
@@ -2449,8 +2459,16 @@ function handleSortEvent($xeTable, evnt, sortConfs, isUpdate) {
2449
2459
  column.order = order;
2450
2460
  }
2451
2461
  column.sortTime = Date.now() + index;
2462
+ sortColMpps[column.id] = column;
2452
2463
  }
2453
2464
  });
2465
+ if (!multiple) {
2466
+ _xeUtils.default.each(orderActiveMaps, (oaCol, oaId) => {
2467
+ if (!sortColMpps[oaId]) {
2468
+ oaCol.order = null;
2469
+ }
2470
+ });
2471
+ }
2454
2472
  if (isUpdate) {
2455
2473
  if (!remote) {
2456
2474
  $xeTable.handleTableData(true);
@@ -9913,9 +9931,9 @@ const Methods = {
9913
9931
  const $xeTable = this;
9914
9932
  return handleSortEvent($xeTable, null, sortConfs, isUpdate);
9915
9933
  },
9916
- setSortByEvent(evnt, sortConfs, isUpdate) {
9934
+ setSortByEvent(evnt, sortConfs) {
9917
9935
  const $xeTable = this;
9918
- return handleSortEvent($xeTable, evnt, sortConfs, isUpdate);
9936
+ return handleSortEvent($xeTable, evnt, sortConfs, true);
9919
9937
  },
9920
9938
  /**
9921
9939
  * 清空指定列的排序条件
@@ -9948,6 +9966,9 @@ const Methods = {
9948
9966
  tableFullColumn
9949
9967
  } = internalData;
9950
9968
  const sortOpts = $xeTable.computeSortOpts;
9969
+ const {
9970
+ multiple
9971
+ } = sortOpts;
9951
9972
  const sortCols = [];
9952
9973
  let column = null;
9953
9974
  if (evnt) {
@@ -9967,7 +9988,13 @@ const Methods = {
9967
9988
  if (!sortOpts.remote) {
9968
9989
  $xeTable.handleTableData(true);
9969
9990
  }
9970
- if (sortCols.length) {
9991
+ if (!multiple) {
9992
+ column = sortCols[0];
9993
+ }
9994
+ if (column) {
9995
+ $xeTable.handleColumnSortEvent(evnt, column);
9996
+ }
9997
+ if (multiple && sortCols.length) {
9971
9998
  const params = {
9972
9999
  $table: $xeTable,
9973
10000
  $event: evnt,
@@ -9975,8 +10002,6 @@ const Methods = {
9975
10002
  sortList: []
9976
10003
  };
9977
10004
  $xeTable.dispatchEvent('clear-all-sort', params, evnt);
9978
- } else if (column) {
9979
- $xeTable.handleColumnSortEvent(evnt, column);
9980
10005
  }
9981
10006
  }
9982
10007
  return $xeTable.$nextTick().then(() => {
@@ -10022,14 +10047,12 @@ const Methods = {
10022
10047
  }
10023
10048
  return sortList;
10024
10049
  },
10025
- setFilterByEvent(evnt, fieldOrColumn, options, isUpdate) {
10050
+ setFilterByEvent(evnt, fieldOrColumn, options) {
10026
10051
  const $xeTable = this;
10027
10052
  const column = (0, _util.handleFieldOrColumn)($xeTable, fieldOrColumn);
10028
10053
  if (column && column.filters) {
10029
10054
  column.filters = (0, _util.toFilters)(options || []);
10030
- if (isUpdate) {
10031
- return $xeTable.handleColumnConfirmFilter(column, evnt);
10032
- }
10055
+ return $xeTable.handleColumnConfirmFilter(column, evnt);
10033
10056
  }
10034
10057
  return $xeTable.$nextTick();
10035
10058
  },
@@ -10088,6 +10111,9 @@ const Methods = {
10088
10111
  tableFullColumn
10089
10112
  } = internalData;
10090
10113
  const filterOpts = $xeTable.computeFilterOpts;
10114
+ const {
10115
+ multiple
10116
+ } = filterOpts;
10091
10117
  const filterCols = [];
10092
10118
  let column = null;
10093
10119
  if (fieldOrColumn) {
@@ -10117,7 +10143,34 @@ const Methods = {
10117
10143
  if (!filterOpts.remote) {
10118
10144
  $xeTable.updateData();
10119
10145
  }
10120
- if (filterCols.length) {
10146
+ if (!multiple) {
10147
+ column = filterCols[0];
10148
+ }
10149
+ if (column) {
10150
+ const filterList = () => $xeTable.getCheckedFilters();
10151
+ const values = [];
10152
+ const datas = [];
10153
+ column.filters.forEach(item => {
10154
+ if (item.checked) {
10155
+ values.push(item.value);
10156
+ datas.push(item.data);
10157
+ }
10158
+ });
10159
+ const params = {
10160
+ $table: $xeTable,
10161
+ $event: evnt,
10162
+ column,
10163
+ field: column.field,
10164
+ property: column.field,
10165
+ values,
10166
+ datas,
10167
+ filters: filterList,
10168
+ filterList
10169
+ };
10170
+ $xeTable.dispatchEvent('filter-change', params, evnt);
10171
+ $xeTable.dispatchEvent('clear-filter', params, evnt);
10172
+ }
10173
+ if (multiple && filterCols.length) {
10121
10174
  const params = {
10122
10175
  $table: $xeTable,
10123
10176
  $event: evnt,
@@ -10125,10 +10178,6 @@ const Methods = {
10125
10178
  filterList: []
10126
10179
  };
10127
10180
  $xeTable.dispatchEvent('clear-all-filter', params, evnt);
10128
- } else if (column) {
10129
- $xeTable.dispatchEvent('clear-filter', {
10130
- filterList: () => $xeTable.getCheckedFilters()
10131
- }, evnt);
10132
10181
  }
10133
10182
  return $xeTable.$nextTick();
10134
10183
  },