vxe-table 3.9.0-rc.8 → 3.9.0

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 (252) hide show
  1. package/README.md +1 -1
  2. package/es/grid/src/grid.js +120 -66
  3. package/es/grid/style.css +0 -1
  4. package/es/grid/style.min.css +1 -1
  5. package/es/index.esm.js +22 -3
  6. package/es/locale/lang/en-US.js +2 -8
  7. package/es/locale/lang/es-ES.js +2 -1
  8. package/es/locale/lang/hu-HU.d.ts +2 -0
  9. package/es/locale/lang/hu-HU.js +497 -501
  10. package/es/locale/lang/ja-JP.js +2 -8
  11. package/es/locale/lang/ko-KR.d.ts +2 -0
  12. package/es/locale/lang/ko-KR.js +2 -8
  13. package/es/locale/lang/pt-BR.js +2 -8
  14. package/es/locale/lang/ru-RU.d.ts +2 -0
  15. package/es/locale/lang/ru-RU.js +497 -503
  16. package/es/locale/lang/uk-UA.d.ts +2 -0
  17. package/es/locale/lang/uk-UA.js +667 -0
  18. package/es/locale/lang/vi-VN.js +2 -8
  19. package/es/locale/lang/zh-CHT.d.ts +2 -0
  20. package/es/locale/lang/zh-CHT.js +667 -0
  21. package/es/locale/lang/zh-CN.js +2 -8
  22. package/es/locale/lang/zh-HK.js +2 -2
  23. package/es/locale/lang/zh-MO.js +2 -2
  24. package/es/locale/lang/zh-TC.js +2 -673
  25. package/es/locale/lang/zh-TW.js +2 -2
  26. package/es/style.css +1 -1
  27. package/es/style.min.css +1 -1
  28. package/es/table/module/custom/panel.js +183 -173
  29. package/es/table/module/edit/mixin.js +33 -24
  30. package/es/table/module/export/export-panel.js +32 -4
  31. package/es/table/module/export/import-panel.js +25 -6
  32. package/es/table/module/export/mixin.js +11 -11
  33. package/es/table/module/menu/mixin.js +2 -2
  34. package/es/table/module/validator/mixin.js +4 -4
  35. package/es/table/render/index.js +17 -11
  36. package/es/table/src/body.js +1 -0
  37. package/es/table/src/columnInfo.js +3 -3
  38. package/es/table/src/methods.js +54 -42
  39. package/es/table/src/props.js +65 -15
  40. package/es/table/src/table.js +175 -60
  41. package/es/table/src/util.js +3 -2
  42. package/es/table/style.css +37 -48
  43. package/es/table/style.min.css +1 -1
  44. package/es/toolbar/src/toolbar.js +21 -7
  45. package/es/toolbar/style.css +0 -1
  46. package/es/toolbar/style.min.css +1 -1
  47. package/es/ui/index.js +5 -3
  48. package/es/ui/src/log.js +1 -1
  49. package/es/vxe-grid/style.css +0 -1
  50. package/es/vxe-grid/style.min.css +1 -1
  51. package/es/vxe-table/style.css +37 -48
  52. package/es/vxe-table/style.min.css +1 -1
  53. package/es/vxe-toolbar/style.css +0 -1
  54. package/es/vxe-toolbar/style.min.css +1 -1
  55. package/lib/colgroup/index.js +3 -3
  56. package/lib/colgroup/index.min.js +1 -1
  57. package/lib/column/index.js +3 -3
  58. package/lib/column/index.min.js +1 -1
  59. package/lib/components.js +9 -11
  60. package/lib/components.min.js +1 -1
  61. package/lib/grid/index.js +3 -3
  62. package/lib/grid/index.min.js +1 -1
  63. package/lib/grid/src/grid.js +581 -491
  64. package/lib/grid/src/grid.min.js +1 -1
  65. package/lib/grid/style/style.css +0 -1
  66. package/lib/grid/style/style.min.css +1 -1
  67. package/lib/index.common.js +3 -4
  68. package/lib/index.umd.js +9212 -17224
  69. package/lib/index.umd.min.js +1 -1
  70. package/lib/locale/lang/en-US.js +2 -8
  71. package/lib/locale/lang/en-US.min.js +1 -1
  72. package/lib/locale/lang/en-US.umd.js +2 -8
  73. package/lib/locale/lang/es-ES.js +2 -1
  74. package/lib/locale/lang/es-ES.min.js +1 -1
  75. package/lib/locale/lang/es-ES.umd.js +2 -1
  76. package/lib/locale/lang/hu-HU.d.ts +2 -0
  77. package/lib/locale/lang/hu-HU.js +497 -501
  78. package/lib/locale/lang/hu-HU.min.js +1 -1
  79. package/lib/locale/lang/hu-HU.umd.js +687 -0
  80. package/lib/locale/lang/ja-JP.js +2 -8
  81. package/lib/locale/lang/ja-JP.min.js +1 -1
  82. package/lib/locale/lang/ja-JP.umd.js +2 -8
  83. package/lib/locale/lang/ko-KR.d.ts +2 -0
  84. package/lib/locale/lang/ko-KR.js +2 -8
  85. package/lib/locale/lang/ko-KR.min.js +1 -1
  86. package/lib/locale/lang/ko-KR.umd.js +687 -0
  87. package/lib/locale/lang/pt-BR.js +2 -8
  88. package/lib/locale/lang/pt-BR.min.js +1 -1
  89. package/lib/locale/lang/pt-BR.umd.js +2 -8
  90. package/lib/locale/lang/ru-RU.d.ts +2 -0
  91. package/lib/locale/lang/ru-RU.js +497 -503
  92. package/lib/locale/lang/ru-RU.min.js +1 -1
  93. package/lib/locale/lang/ru-RU.umd.js +687 -0
  94. package/lib/locale/lang/uk-UA.d.ts +2 -0
  95. package/lib/locale/lang/uk-UA.js +673 -0
  96. package/lib/locale/lang/uk-UA.min.js +1 -0
  97. package/lib/locale/lang/uk-UA.umd.js +687 -0
  98. package/lib/locale/lang/vi-VN.js +2 -8
  99. package/lib/locale/lang/vi-VN.min.js +1 -1
  100. package/lib/locale/lang/zh-CHT.d.ts +2 -0
  101. package/lib/locale/lang/zh-CHT.js +673 -0
  102. package/lib/locale/lang/zh-CHT.min.js +1 -0
  103. package/lib/locale/lang/zh-CHT.umd.js +687 -0
  104. package/lib/locale/lang/zh-CN.js +2 -8
  105. package/lib/locale/lang/zh-CN.min.js +1 -1
  106. package/lib/locale/lang/zh-CN.umd.js +2 -8
  107. package/lib/locale/lang/zh-HK.js +2 -2
  108. package/lib/locale/lang/zh-HK.min.js +1 -1
  109. package/lib/locale/lang/zh-HK.umd.js +7 -677
  110. package/lib/locale/lang/zh-MO.js +2 -2
  111. package/lib/locale/lang/zh-MO.min.js +1 -1
  112. package/lib/locale/lang/zh-MO.umd.js +7 -677
  113. package/lib/locale/lang/zh-TC.js +3 -673
  114. package/lib/locale/lang/zh-TC.min.js +1 -1
  115. package/lib/locale/lang/zh-TC.umd.js +7 -677
  116. package/lib/locale/lang/zh-TW.js +2 -2
  117. package/lib/locale/lang/zh-TW.min.js +1 -1
  118. package/lib/locale/lang/zh-TW.umd.js +7 -677
  119. package/lib/style.css +1 -1
  120. package/lib/style.min.css +1 -1
  121. package/lib/table/index.js +4 -4
  122. package/lib/table/index.min.js +1 -1
  123. package/lib/table/module/custom/mixin.js +53 -44
  124. package/lib/table/module/custom/mixin.min.js +1 -1
  125. package/lib/table/module/custom/panel.js +310 -239
  126. package/lib/table/module/custom/panel.min.js +1 -1
  127. package/lib/table/module/edit/mixin.js +436 -371
  128. package/lib/table/module/edit/mixin.min.js +1 -1
  129. package/lib/table/module/export/export-panel.js +136 -106
  130. package/lib/table/module/export/export-panel.min.js +1 -1
  131. package/lib/table/module/export/import-panel.js +75 -54
  132. package/lib/table/module/export/import-panel.min.js +1 -1
  133. package/lib/table/module/export/mixin.js +592 -597
  134. package/lib/table/module/export/mixin.min.js +1 -1
  135. package/lib/table/module/export/util.js +6 -4
  136. package/lib/table/module/export/util.min.js +1 -1
  137. package/lib/table/module/filter/mixin.js +147 -118
  138. package/lib/table/module/filter/mixin.min.js +1 -1
  139. package/lib/table/module/filter/panel.js +86 -65
  140. package/lib/table/module/filter/panel.min.js +1 -1
  141. package/lib/table/module/keyboard/mixin.js +163 -151
  142. package/lib/table/module/keyboard/mixin.min.js +1 -1
  143. package/lib/table/module/menu/mixin.js +125 -114
  144. package/lib/table/module/menu/mixin.min.js +1 -1
  145. package/lib/table/module/menu/panel.js +36 -34
  146. package/lib/table/module/menu/panel.min.js +1 -1
  147. package/lib/table/module/validator/mixin.js +225 -214
  148. package/lib/table/module/validator/mixin.min.js +1 -1
  149. package/lib/table/render/index.js +401 -297
  150. package/lib/table/render/index.min.js +1 -1
  151. package/lib/table/src/body.js +411 -349
  152. package/lib/table/src/body.min.js +1 -1
  153. package/lib/table/src/cell.js +470 -344
  154. package/lib/table/src/cell.min.js +1 -1
  155. package/lib/table/src/column.js +10 -10
  156. package/lib/table/src/column.min.js +1 -1
  157. package/lib/table/src/columnInfo.js +46 -55
  158. package/lib/table/src/columnInfo.min.js +1 -1
  159. package/lib/table/src/footer.js +157 -132
  160. package/lib/table/src/footer.min.js +1 -1
  161. package/lib/table/src/group.js +1 -1
  162. package/lib/table/src/group.min.js +1 -1
  163. package/lib/table/src/header.js +170 -153
  164. package/lib/table/src/header.min.js +1 -1
  165. package/lib/table/src/methods.js +2758 -2478
  166. package/lib/table/src/methods.min.js +1 -1
  167. package/lib/table/src/props.js +33 -74
  168. package/lib/table/src/props.min.js +1 -1
  169. package/lib/table/src/table.js +519 -397
  170. package/lib/table/src/table.min.js +1 -1
  171. package/lib/table/src/util.js +143 -131
  172. package/lib/table/src/util.min.js +1 -1
  173. package/lib/table/style/style.css +37 -48
  174. package/lib/table/style/style.min.css +1 -1
  175. package/lib/toolbar/index.js +3 -3
  176. package/lib/toolbar/index.min.js +1 -1
  177. package/lib/toolbar/src/toolbar.js +332 -284
  178. package/lib/toolbar/src/toolbar.min.js +1 -1
  179. package/lib/toolbar/style/style.css +0 -1
  180. package/lib/toolbar/style/style.min.css +1 -1
  181. package/lib/ui/index.js +50 -41
  182. package/lib/ui/index.min.js +1 -1
  183. package/lib/ui/src/comp.js +2 -3
  184. package/lib/ui/src/comp.min.js +1 -1
  185. package/lib/ui/src/dom.js +29 -28
  186. package/lib/ui/src/dom.min.js +1 -1
  187. package/lib/ui/src/log.js +6 -4
  188. package/lib/ui/src/log.min.js +1 -1
  189. package/lib/ui/src/utils.js +7 -7
  190. package/lib/v-x-e-table/index.js +3 -4
  191. package/lib/v-x-e-table/index.min.js +1 -1
  192. package/lib/vxe-colgroup/index.js +3 -4
  193. package/lib/vxe-colgroup/index.min.js +1 -1
  194. package/lib/vxe-column/index.js +3 -4
  195. package/lib/vxe-column/index.min.js +1 -1
  196. package/lib/vxe-grid/index.js +3 -4
  197. package/lib/vxe-grid/index.min.js +1 -1
  198. package/lib/vxe-grid/style/style.css +0 -1
  199. package/lib/vxe-grid/style/style.min.css +1 -1
  200. package/lib/vxe-table/index.js +3 -4
  201. package/lib/vxe-table/index.min.js +1 -1
  202. package/lib/vxe-table/style/style.css +37 -48
  203. package/lib/vxe-table/style/style.min.css +1 -1
  204. package/lib/vxe-toolbar/index.js +3 -4
  205. package/lib/vxe-toolbar/index.min.js +1 -1
  206. package/lib/vxe-toolbar/style/style.css +0 -1
  207. package/lib/vxe-toolbar/style/style.min.css +1 -1
  208. package/lib/vxe-ui/index.js +3 -4
  209. package/lib/vxe-ui/index.min.js +1 -1
  210. package/lib/vxe-v-x-e-table/index.js +3 -4
  211. package/lib/vxe-v-x-e-table/index.min.js +1 -1
  212. package/package.json +5 -4
  213. package/packages/grid/src/grid.ts +127 -65
  214. package/packages/locale/lang/en-US.ts +2 -10
  215. package/packages/locale/lang/es-ES.ts +2 -1
  216. package/packages/locale/lang/hu-HU.ts +497 -503
  217. package/packages/locale/lang/ja-JP.ts +2 -10
  218. package/packages/locale/lang/ko-KR.ts +2 -10
  219. package/packages/locale/lang/pt-BR.ts +2 -10
  220. package/packages/locale/lang/ru-RU.ts +497 -505
  221. package/packages/locale/lang/uk-UA.ts +667 -0
  222. package/packages/locale/lang/vi-VN.ts +2 -10
  223. package/packages/locale/lang/zh-CHT.ts +667 -0
  224. package/packages/locale/lang/zh-CN.ts +2 -10
  225. package/packages/locale/lang/zh-HK.ts +2 -2
  226. package/packages/locale/lang/zh-MO.ts +2 -2
  227. package/packages/locale/lang/zh-TC.ts +2 -674
  228. package/packages/locale/lang/zh-TW.ts +2 -2
  229. package/packages/table/module/custom/panel.ts +186 -175
  230. package/packages/table/module/edit/mixin.ts +32 -23
  231. package/packages/table/module/export/export-panel.ts +36 -4
  232. package/packages/table/module/export/import-panel.ts +29 -6
  233. package/packages/table/module/export/mixin.ts +11 -11
  234. package/packages/table/module/menu/mixin.ts +2 -2
  235. package/packages/table/module/validator/mixin.ts +4 -4
  236. package/packages/table/render/index.ts +20 -11
  237. package/packages/table/src/body.ts +1 -0
  238. package/packages/table/src/columnInfo.ts +3 -3
  239. package/packages/table/src/methods.ts +53 -42
  240. package/packages/table/src/props.ts +68 -15
  241. package/packages/table/src/table.ts +183 -57
  242. package/packages/table/src/util.ts +3 -2
  243. package/packages/toolbar/src/toolbar.ts +21 -7
  244. package/packages/ui/index.ts +3 -1
  245. package/styles/components/table.scss +82 -17
  246. package/types/all.d.ts +1 -0
  247. /package/es/{iconfont.1726318179195.ttf → iconfont.1728348263835.ttf} +0 -0
  248. /package/es/{iconfont.1726318179195.woff → iconfont.1728348263835.woff} +0 -0
  249. /package/es/{iconfont.1726318179195.woff2 → iconfont.1728348263835.woff2} +0 -0
  250. /package/lib/{iconfont.1726318179195.ttf → iconfont.1728348263835.ttf} +0 -0
  251. /package/lib/{iconfont.1726318179195.woff → iconfont.1728348263835.woff} +0 -0
  252. /package/lib/{iconfont.1726318179195.woff2 → iconfont.1728348263835.woff2} +0 -0
@@ -11,62 +11,68 @@ var _dom = require("../../ui/src/dom");
11
11
  var _util = require("./util");
12
12
  var _vn = require("../../ui/src/vn");
13
13
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
- function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
15
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
16
- function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
17
- function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
18
- function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
19
- function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
20
- var getI18n = _ui.VxeUI.getI18n,
21
- getIcon = _ui.VxeUI.getIcon,
22
- renderer = _ui.VxeUI.renderer,
23
- formats = _ui.VxeUI.formats;
14
+ const {
15
+ getI18n,
16
+ getIcon,
17
+ renderer,
18
+ formats
19
+ } = _ui.VxeUI;
24
20
  function renderTitlePrefixIcon(h, params) {
25
- var $table = params.$table,
26
- column = params.column;
27
- var titlePrefix = column.titlePrefix || column.titleHelp;
21
+ const {
22
+ $table,
23
+ column
24
+ } = params;
25
+ const titlePrefix = column.titlePrefix || column.titleHelp;
28
26
  return titlePrefix ? [h('i', {
29
27
  class: ['vxe-cell-title-prefix-icon', titlePrefix.icon || getIcon().TABLE_TITLE_PREFIX],
30
28
  on: {
31
- mouseenter: function mouseenter(evnt) {
29
+ mouseenter(evnt) {
32
30
  $table.triggerHeaderTitleEvent(evnt, titlePrefix, params);
33
31
  },
34
- mouseleave: function mouseleave(evnt) {
32
+ mouseleave(evnt) {
35
33
  $table.handleTargetLeaveEvent(evnt);
36
34
  }
37
35
  }
38
36
  })] : [];
39
37
  }
40
38
  function renderTitleSuffixIcon(h, params) {
41
- var $table = params.$table,
42
- column = params.column;
43
- var titleSuffix = column.titleSuffix;
39
+ const {
40
+ $table,
41
+ column
42
+ } = params;
43
+ const titleSuffix = column.titleSuffix;
44
44
  return titleSuffix ? [h('i', {
45
45
  class: ['vxe-cell-title-suffix-icon', titleSuffix.icon || getIcon().TABLE_TITLE_SUFFIX],
46
46
  on: {
47
- mouseenter: function mouseenter(evnt) {
47
+ mouseenter(evnt) {
48
48
  $table.triggerHeaderTitleEvent(evnt, titleSuffix, params);
49
49
  },
50
- mouseleave: function mouseleave(evnt) {
50
+ mouseleave(evnt) {
51
51
  $table.handleTargetLeaveEvent(evnt);
52
52
  }
53
53
  }
54
54
  })] : [];
55
55
  }
56
56
  function renderTitleContent(h, params, content) {
57
- var $table = params.$table,
58
- column = params.column;
59
- var type = column.type,
60
- showHeaderOverflow = column.showHeaderOverflow;
61
- var allColumnHeaderOverflow = $table.showHeaderOverflow,
62
- tooltipOpts = $table.tooltipOpts;
63
- var showAllTip = tooltipOpts.showAll || tooltipOpts.enabled;
64
- var headOverflow = _xeUtils.default.isUndefined(showHeaderOverflow) || _xeUtils.default.isNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow;
65
- var showTitle = headOverflow === 'title';
66
- var showTooltip = headOverflow === true || headOverflow === 'tooltip';
67
- var ons = {};
57
+ const {
58
+ $table,
59
+ column
60
+ } = params;
61
+ const {
62
+ type,
63
+ showHeaderOverflow
64
+ } = column;
65
+ const {
66
+ showHeaderOverflow: allColumnHeaderOverflow,
67
+ tooltipOpts
68
+ } = $table;
69
+ const showAllTip = tooltipOpts.showAll || tooltipOpts.enabled;
70
+ const headOverflow = _xeUtils.default.isUndefined(showHeaderOverflow) || _xeUtils.default.isNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow;
71
+ const showTitle = headOverflow === 'title';
72
+ const showTooltip = headOverflow === true || headOverflow === 'tooltip';
73
+ const ons = {};
68
74
  if (showTitle || showTooltip || showAllTip) {
69
- ons.mouseenter = function (evnt) {
75
+ ons.mouseenter = evnt => {
70
76
  if ($table._isResize) {
71
77
  return;
72
78
  }
@@ -78,7 +84,7 @@ function renderTitleContent(h, params, content) {
78
84
  };
79
85
  }
80
86
  if (showTooltip || showAllTip) {
81
- ons.mouseleave = function (evnt) {
87
+ ons.mouseleave = evnt => {
82
88
  if ($table._isResize) {
83
89
  return;
84
90
  }
@@ -102,74 +108,84 @@ function formatFooterLabel(footerFormatter, params) {
102
108
  if (_xeUtils.default.isFunction(footerFormatter)) {
103
109
  return footerFormatter(params);
104
110
  }
105
- var isArr = _xeUtils.default.isArray(footerFormatter);
106
- var gFormatOpts = isArr ? formats.get(footerFormatter[0]) : formats.get(footerFormatter);
107
- var footerFormatMethod = gFormatOpts ? gFormatOpts.tableFooterCellFormatMethod : null;
111
+ const isArr = _xeUtils.default.isArray(footerFormatter);
112
+ const gFormatOpts = isArr ? formats.get(footerFormatter[0]) : formats.get(footerFormatter);
113
+ const footerFormatMethod = gFormatOpts ? gFormatOpts.tableFooterCellFormatMethod : null;
108
114
  if (footerFormatMethod) {
109
- return isArr ? footerFormatMethod.apply(void 0, [params].concat(_toConsumableArray(footerFormatter.slice(1)))) : footerFormatMethod(params);
115
+ return isArr ? footerFormatMethod(params, ...footerFormatter.slice(1)) : footerFormatMethod(params);
110
116
  }
111
117
  return '';
112
118
  }
113
119
  function getFooterContent(h, params) {
114
- var $table = params.$table,
115
- column = params.column,
116
- _columnIndex = params._columnIndex,
117
- row = params.row,
118
- items = params.items;
119
- var slots = column.slots,
120
- editRender = column.editRender,
121
- cellRender = column.cellRender,
122
- footerFormatter = column.footerFormatter;
123
- var renderOpts = editRender || cellRender;
120
+ const {
121
+ $table,
122
+ column,
123
+ _columnIndex,
124
+ row,
125
+ items
126
+ } = params;
127
+ const {
128
+ slots,
129
+ editRender,
130
+ cellRender,
131
+ footerFormatter
132
+ } = column;
133
+ const renderOpts = editRender || cellRender;
124
134
  if (slots && slots.footer) {
125
135
  return $table.callSlot(slots.footer, params, h);
126
136
  }
127
137
  if (renderOpts) {
128
- var compConf = renderer.get(renderOpts.name);
129
- var rtFooter = compConf ? compConf.renderTableFooter || compConf.renderFooter : null;
138
+ const compConf = renderer.get(renderOpts.name);
139
+ const rtFooter = compConf ? compConf.renderTableFooter || compConf.renderFooter : null;
130
140
  if (rtFooter) {
131
141
  return (0, _vn.getSlotVNs)(rtFooter.call($table, h, renderOpts, params));
132
142
  }
133
143
  }
134
- var itemValue = '';
144
+ let itemValue = '';
135
145
  // 兼容老模式
136
146
  if (_xeUtils.default.isArray(items)) {
137
147
  itemValue = items[_columnIndex];
138
148
  return [footerFormatter ? formatFooterLabel(footerFormatter, {
139
- itemValue: itemValue,
140
- column: column,
141
- row: row,
142
- items: items,
143
- _columnIndex: _columnIndex
149
+ itemValue,
150
+ column,
151
+ row,
152
+ items,
153
+ _columnIndex
144
154
  }) : (0, _utils.formatText)(itemValue, 1)];
145
155
  }
146
156
  itemValue = _xeUtils.default.get(row, column.field);
147
157
  return [footerFormatter ? formatFooterLabel(footerFormatter, {
148
- itemValue: itemValue,
149
- column: column,
150
- row: row,
151
- items: items,
152
- _columnIndex: _columnIndex
158
+ itemValue,
159
+ column,
160
+ row,
161
+ items,
162
+ _columnIndex
153
163
  }) : (0, _utils.formatText)(itemValue, 1)];
154
164
  }
155
165
  function getDefaultCellLabel(params) {
156
- var $table = params.$table,
157
- row = params.row,
158
- column = params.column;
166
+ const {
167
+ $table,
168
+ row,
169
+ column
170
+ } = params;
159
171
  return (0, _utils.formatText)($table.getCellLabel(row, column), 1);
160
172
  }
161
- var Cell = exports.Cell = {
162
- createColumn: function createColumn($xetable, _vm) {
163
- var type = _vm.type,
164
- sortable = _vm.sortable,
165
- remoteSort = _vm.remoteSort,
166
- filters = _vm.filters,
167
- editRender = _vm.editRender,
168
- treeNode = _vm.treeNode;
169
- var editConfig = $xetable.editConfig,
170
- editOpts = $xetable.editOpts,
171
- checkboxOpts = $xetable.checkboxOpts;
172
- var renMaps = {
173
+ const Cell = exports.Cell = {
174
+ createColumn($xetable, _vm) {
175
+ const {
176
+ type,
177
+ sortable,
178
+ remoteSort,
179
+ filters,
180
+ editRender,
181
+ treeNode
182
+ } = _vm;
183
+ const {
184
+ editConfig,
185
+ editOpts,
186
+ checkboxOpts
187
+ } = $xetable;
188
+ const renMaps = {
173
189
  renderHeader: this.renderDefaultHeader,
174
190
  renderCell: treeNode ? this.renderTreeCell : this.renderDefaultCell,
175
191
  renderFooter: this.renderDefaultFooter
@@ -218,52 +234,60 @@ var Cell = exports.Cell = {
218
234
  /**
219
235
  * 单元格
220
236
  */
221
- renderHeaderTitle: function renderHeaderTitle(h, params) {
222
- var $table = params.$table,
223
- column = params.column;
224
- var slots = column.slots,
225
- editRender = column.editRender,
226
- cellRender = column.cellRender;
227
- var renderOpts = editRender || cellRender;
237
+ renderHeaderTitle(h, params) {
238
+ const {
239
+ $table,
240
+ column
241
+ } = params;
242
+ const {
243
+ slots,
244
+ editRender,
245
+ cellRender
246
+ } = column;
247
+ const renderOpts = editRender || cellRender;
228
248
  if (slots && slots.header) {
229
249
  return renderTitleContent(h, params, $table.callSlot(slots.header, params, h));
230
250
  }
231
251
  if (renderOpts) {
232
- var compConf = renderer.get(renderOpts.name);
233
- var rtHeader = compConf ? compConf.renderTableHeader || compConf.renderHeader : null;
252
+ const compConf = renderer.get(renderOpts.name);
253
+ const rtHeader = compConf ? compConf.renderTableHeader || compConf.renderHeader : null;
234
254
  if (rtHeader) {
235
255
  return (0, _vn.getSlotVNs)(renderTitleContent(h, params, rtHeader.call($table, h, renderOpts, params)));
236
256
  }
237
257
  }
238
258
  return renderTitleContent(h, params, (0, _utils.formatText)(column.getTitle(), 1));
239
259
  },
240
- renderDefaultHeader: function renderDefaultHeader(h, params) {
260
+ renderDefaultHeader(h, params) {
241
261
  return renderTitlePrefixIcon(h, params).concat(Cell.renderHeaderTitle(h, params)).concat(renderTitleSuffixIcon(h, params));
242
262
  },
243
- renderDefaultCell: function renderDefaultCell(h, params) {
244
- var $table = params.$table,
245
- row = params.row,
246
- column = params.column;
247
- var slots = column.slots,
248
- editRender = column.editRender,
249
- cellRender = column.cellRender;
250
- var renderOpts = editRender || cellRender;
263
+ renderDefaultCell(h, params) {
264
+ const {
265
+ $table,
266
+ row,
267
+ column
268
+ } = params;
269
+ const {
270
+ slots,
271
+ editRender,
272
+ cellRender
273
+ } = column;
274
+ const renderOpts = editRender || cellRender;
251
275
  if (slots && slots.default) {
252
276
  return $table.callSlot(slots.default, params, h);
253
277
  }
254
278
  if (renderOpts) {
255
- var compConf = renderer.get(renderOpts.name);
256
- var rtDefault = compConf ? compConf.renderTableDefault || compConf.renderDefault : null;
257
- var rtCell = compConf ? compConf.renderTableCell || compConf.renderCell : null;
258
- var renderFn = editRender ? rtCell : rtDefault;
279
+ const compConf = renderer.get(renderOpts.name);
280
+ const rtDefault = compConf ? compConf.renderTableDefault || compConf.renderDefault : null;
281
+ const rtCell = compConf ? compConf.renderTableCell || compConf.renderCell : null;
282
+ const renderFn = editRender ? rtCell : rtDefault;
259
283
  if (renderFn) {
260
284
  return (0, _vn.getSlotVNs)(renderFn.call($table, h, renderOpts, Object.assign({
261
285
  $type: editRender ? 'edit' : 'cell'
262
286
  }, params)));
263
287
  }
264
288
  }
265
- var cellValue = $table.getCellLabel(row, column);
266
- var cellPlaceholder = editRender ? editRender.placeholder : '';
289
+ const cellValue = $table.getCellLabel(row, column);
290
+ const cellPlaceholder = editRender ? editRender.placeholder : '';
267
291
  return [h('span', {
268
292
  class: 'vxe-cell--label'
269
293
  }, [
@@ -272,10 +296,10 @@ var Cell = exports.Cell = {
272
296
  class: 'vxe-cell--placeholder'
273
297
  }, (0, _utils.formatText)((0, _utils.getFuncText)(cellPlaceholder), 1)) : h('span', (0, _utils.formatText)(cellValue, 1))])];
274
298
  },
275
- renderTreeCell: function renderTreeCell(h, params) {
299
+ renderTreeCell(h, params) {
276
300
  return Cell.renderTreeIcon(h, params, Cell.renderDefaultCell.call(this, h, params));
277
301
  },
278
- renderDefaultFooter: function renderDefaultFooter(h, params) {
302
+ renderDefaultFooter(h, params) {
279
303
  return [h('span', {
280
304
  class: 'vxe-cell--item'
281
305
  }, getFooterContent(h, params))];
@@ -283,48 +307,58 @@ var Cell = exports.Cell = {
283
307
  /**
284
308
  * 树节点
285
309
  */
286
- renderTreeIcon: function renderTreeIcon(h, params, cellVNodes) {
287
- var $table = params.$table,
288
- isHidden = params.isHidden;
289
- var treeOpts = $table.treeOpts,
290
- treeExpandedMaps = $table.treeExpandedMaps,
291
- treeExpandLazyLoadedMaps = $table.treeExpandLazyLoadedMaps,
292
- fullAllDataRowIdData = $table.fullAllDataRowIdData;
293
- var row = params.row,
294
- column = params.column,
295
- level = params.level;
296
- var slots = column.slots;
297
- var indent = treeOpts.indent,
298
- lazy = treeOpts.lazy,
299
- trigger = treeOpts.trigger,
300
- iconLoaded = treeOpts.iconLoaded,
301
- showIcon = treeOpts.showIcon,
302
- iconOpen = treeOpts.iconOpen,
303
- iconClose = treeOpts.iconClose;
304
- var childrenField = treeOpts.children || treeOpts.childrenField;
305
- var hasChildField = treeOpts.hasChild || treeOpts.hasChildField;
306
- var rowChilds = row[childrenField];
307
- var hasChild = rowChilds && rowChilds.length;
308
- var hasLazyChilds = false;
309
- var isAceived = false;
310
- var isLazyLoading = false;
311
- var isLazyLoaded = false;
312
- var on = {};
310
+ renderTreeIcon(h, params, cellVNodes) {
311
+ const {
312
+ $table,
313
+ isHidden
314
+ } = params;
315
+ const {
316
+ treeOpts,
317
+ treeExpandedMaps,
318
+ treeExpandLazyLoadedMaps,
319
+ fullAllDataRowIdData
320
+ } = $table;
321
+ const {
322
+ row,
323
+ column,
324
+ level
325
+ } = params;
326
+ const {
327
+ slots
328
+ } = column;
329
+ const {
330
+ indent,
331
+ lazy,
332
+ trigger,
333
+ iconLoaded,
334
+ showIcon,
335
+ iconOpen,
336
+ iconClose
337
+ } = treeOpts;
338
+ const childrenField = treeOpts.children || treeOpts.childrenField;
339
+ const hasChildField = treeOpts.hasChild || treeOpts.hasChildField;
340
+ const rowChilds = row[childrenField];
341
+ const hasChild = rowChilds && rowChilds.length;
342
+ let hasLazyChilds = false;
343
+ let isAceived = false;
344
+ let isLazyLoading = false;
345
+ let isLazyLoaded = false;
346
+ const on = {};
313
347
  if (slots && slots.icon) {
314
348
  return $table.callSlot(slots.icon, params, h, cellVNodes);
315
349
  }
316
350
  if (!isHidden) {
317
- var rowid = (0, _util.getRowid)($table, row);
351
+ const rowid = (0, _util.getRowid)($table, row);
318
352
  isAceived = !!treeExpandedMaps[rowid];
319
353
  if (lazy) {
320
- var rest = fullAllDataRowIdData[rowid];
354
+ const rest = fullAllDataRowIdData[rowid];
321
355
  isLazyLoading = !!treeExpandLazyLoadedMaps[rowid];
322
356
  hasLazyChilds = row[hasChildField];
323
357
  isLazyLoaded = !!rest.treeLoaded;
324
358
  }
325
359
  }
326
360
  if (!trigger || trigger === 'default') {
327
- on.click = function (evnt) {
361
+ on.click = evnt => {
328
362
  $table.triggerTreeExpandEvent(evnt, params);
329
363
  };
330
364
  }
@@ -333,11 +367,11 @@ var Cell = exports.Cell = {
333
367
  'is--active': isAceived
334
368
  }],
335
369
  style: {
336
- paddingLeft: "".concat(level * indent, "px")
370
+ paddingLeft: `${level * indent}px`
337
371
  }
338
372
  }, [showIcon && (lazy ? isLazyLoaded ? hasChild : hasLazyChilds : hasChild) ? [h('div', {
339
373
  class: 'vxe-tree--btn-wrapper',
340
- on: on
374
+ on
341
375
  }, [h('i', {
342
376
  class: ['vxe-tree--node-btn', isLazyLoading ? iconLoaded || getIcon().TABLE_TREE_LOADED : isAceived ? iconOpen || getIcon().TABLE_TREE_OPEN : iconClose || getIcon().TABLE_TREE_CLOSE]
343
377
  })])] : null, h('div', {
@@ -347,63 +381,89 @@ var Cell = exports.Cell = {
347
381
  /**
348
382
  * 索引
349
383
  */
350
- renderSeqHeader: function renderSeqHeader(h, params) {
351
- var $table = params.$table,
352
- column = params.column;
353
- var slots = column.slots;
384
+ renderSeqHeader(h, params) {
385
+ const {
386
+ $table,
387
+ column
388
+ } = params;
389
+ const {
390
+ slots
391
+ } = column;
354
392
  return renderTitleContent(h, params, slots && slots.header ? $table.callSlot(slots.header, params, h) : (0, _utils.formatText)(column.getTitle(), 1));
355
393
  },
356
- renderSeqCell: function renderSeqCell(h, params) {
357
- var $table = params.$table,
358
- column = params.column;
359
- var treeConfig = $table.treeConfig,
360
- seqOpts = $table.seqOpts;
361
- var slots = column.slots;
394
+ renderSeqCell(h, params) {
395
+ const {
396
+ $table,
397
+ column
398
+ } = params;
399
+ const {
400
+ treeConfig,
401
+ seqOpts
402
+ } = $table;
403
+ const {
404
+ slots
405
+ } = column;
362
406
  if (slots && slots.default) {
363
407
  return $table.callSlot(slots.default, params, h);
364
408
  }
365
- var seq = params.seq;
366
- var seqMethod = seqOpts.seqMethod;
409
+ const {
410
+ seq
411
+ } = params;
412
+ const seqMethod = seqOpts.seqMethod;
367
413
  return [(0, _utils.formatText)(seqMethod ? seqMethod(params) : treeConfig ? seq : (seqOpts.startIndex || 0) + seq, 1)];
368
414
  },
369
- renderTreeIndexCell: function renderTreeIndexCell(h, params) {
415
+ renderTreeIndexCell(h, params) {
370
416
  return Cell.renderTreeIcon(h, params, Cell.renderSeqCell(h, params));
371
417
  },
372
418
  /**
373
419
  * 单选
374
420
  */
375
- renderRadioHeader: function renderRadioHeader(h, params) {
376
- var $table = params.$table,
377
- column = params.column;
378
- var slots = column.slots;
379
- var headerSlot = slots ? slots.header : null;
380
- var titleSlot = slots ? slots.title : null;
421
+ renderRadioHeader(h, params) {
422
+ const {
423
+ $table,
424
+ column
425
+ } = params;
426
+ const {
427
+ slots
428
+ } = column;
429
+ const headerSlot = slots ? slots.header : null;
430
+ const titleSlot = slots ? slots.title : null;
381
431
  return renderTitleContent(h, params, headerSlot ? $table.callSlot(headerSlot, params, h) : [h('span', {
382
432
  class: 'vxe-radio--label'
383
433
  }, titleSlot ? $table.callSlot(titleSlot, params, h) : (0, _utils.formatText)(column.getTitle(), 1))]);
384
434
  },
385
- renderRadioCell: function renderRadioCell(h, params) {
386
- var $table = params.$table,
387
- column = params.column,
388
- isHidden = params.isHidden;
389
- var radioOpts = $table.radioOpts,
390
- selectRadioRow = $table.selectRadioRow;
391
- var slots = column.slots;
392
- var labelField = radioOpts.labelField,
393
- checkMethod = radioOpts.checkMethod,
394
- visibleMethod = radioOpts.visibleMethod;
395
- var row = params.row;
396
- var defaultSlot = slots ? slots.default : null;
397
- var radioSlot = slots ? slots.radio : null;
398
- var isChecked = row === selectRadioRow;
399
- var isVisible = !visibleMethod || visibleMethod({
400
- row: row
435
+ renderRadioCell(h, params) {
436
+ const {
437
+ $table,
438
+ column,
439
+ isHidden
440
+ } = params;
441
+ const {
442
+ radioOpts,
443
+ selectRadioRow
444
+ } = $table;
445
+ const {
446
+ slots
447
+ } = column;
448
+ const {
449
+ labelField,
450
+ checkMethod,
451
+ visibleMethod
452
+ } = radioOpts;
453
+ const {
454
+ row
455
+ } = params;
456
+ const defaultSlot = slots ? slots.default : null;
457
+ const radioSlot = slots ? slots.radio : null;
458
+ const isChecked = row === selectRadioRow;
459
+ const isVisible = !visibleMethod || visibleMethod({
460
+ row
401
461
  });
402
- var isDisabled = !!checkMethod;
403
- var on;
462
+ let isDisabled = !!checkMethod;
463
+ let on;
404
464
  if (!isHidden) {
405
465
  on = {
406
- click: function click(evnt) {
466
+ click(evnt) {
407
467
  if (!isDisabled && isVisible) {
408
468
  $table.triggerRadioRowEvent(evnt, params);
409
469
  }
@@ -411,11 +471,11 @@ var Cell = exports.Cell = {
411
471
  };
412
472
  if (checkMethod) {
413
473
  isDisabled = !checkMethod({
414
- row: row
474
+ row
415
475
  });
416
476
  }
417
477
  }
418
- var radioParams = Object.assign(Object.assign({}, params), {
478
+ const radioParams = Object.assign(Object.assign({}, params), {
419
479
  checked: isChecked,
420
480
  disabled: isDisabled,
421
481
  visible: isVisible
@@ -423,7 +483,7 @@ var Cell = exports.Cell = {
423
483
  if (radioSlot) {
424
484
  return $table.callSlot(radioSlot, radioParams, h);
425
485
  }
426
- var radioVNs = [];
486
+ const radioVNs = [];
427
487
  if (isVisible) {
428
488
  radioVNs.push(h('span', {
429
489
  class: ['vxe-radio--icon', isChecked ? getIcon().TABLE_RADIO_CHECKED : getIcon().TABLE_RADIO_UNCHECKED]
@@ -439,38 +499,44 @@ var Cell = exports.Cell = {
439
499
  'is--checked': isChecked,
440
500
  'is--disabled': isDisabled
441
501
  }],
442
- on: on
502
+ on
443
503
  }, radioVNs)];
444
504
  },
445
- renderTreeRadioCell: function renderTreeRadioCell(h, params) {
505
+ renderTreeRadioCell(h, params) {
446
506
  return Cell.renderTreeIcon(h, params, Cell.renderRadioCell(h, params));
447
507
  },
448
508
  /**
449
509
  * 多选
450
510
  */
451
- renderCheckboxHeader: function renderCheckboxHeader(h, params) {
452
- var $table = params.$table,
453
- column = params.column,
454
- isHidden = params.isHidden;
455
- var isAllCheckboxSelected = $table.isAllSelected,
456
- isAllCheckboxIndeterminate = $table.isIndeterminate,
457
- isAllCheckboxDisabled = $table.isAllCheckboxDisabled;
458
- var slots = column.slots;
459
- var headerSlot = slots ? slots.header : null;
460
- var titleSlot = slots ? slots.title : null;
461
- var checkboxOpts = $table.checkboxOpts;
462
- var headerTitle = column.getTitle();
463
- var on;
511
+ renderCheckboxHeader(h, params) {
512
+ const {
513
+ $table,
514
+ column,
515
+ isHidden
516
+ } = params;
517
+ const {
518
+ isAllSelected: isAllCheckboxSelected,
519
+ isIndeterminate: isAllCheckboxIndeterminate,
520
+ isAllCheckboxDisabled
521
+ } = $table;
522
+ const {
523
+ slots
524
+ } = column;
525
+ const headerSlot = slots ? slots.header : null;
526
+ const titleSlot = slots ? slots.title : null;
527
+ const checkboxOpts = $table.checkboxOpts;
528
+ const headerTitle = column.getTitle();
529
+ let on;
464
530
  if (!isHidden) {
465
531
  on = {
466
- click: function click(evnt) {
532
+ click(evnt) {
467
533
  if (!isAllCheckboxDisabled) {
468
534
  $table.triggerCheckAllEvent(evnt, !isAllCheckboxSelected);
469
535
  }
470
536
  }
471
537
  };
472
538
  }
473
- var checkboxParams = Object.assign(Object.assign({}, params), {
539
+ const checkboxParams = Object.assign(Object.assign({}, params), {
474
540
  checked: isAllCheckboxSelected,
475
541
  disabled: isAllCheckboxDisabled,
476
542
  indeterminate: isAllCheckboxIndeterminate
@@ -492,40 +558,47 @@ var Cell = exports.Cell = {
492
558
  attrs: {
493
559
  title: getI18n('vxe.table.allTitle')
494
560
  },
495
- on: on
561
+ on
496
562
  }, [h('span', {
497
563
  class: ['vxe-checkbox--icon', isAllCheckboxIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : isAllCheckboxSelected ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED]
498
564
  })].concat(titleSlot || headerTitle ? [h('span', {
499
565
  class: 'vxe-checkbox--label'
500
566
  }, titleSlot ? $table.callSlot(titleSlot, checkboxParams, h) : headerTitle)] : []))]);
501
567
  },
502
- renderCheckboxCell: function renderCheckboxCell(h, params) {
503
- var $table = params.$table,
504
- row = params.row,
505
- column = params.column,
506
- isHidden = params.isHidden;
507
- var treeConfig = $table.treeConfig,
508
- treeIndeterminateMaps = $table.treeIndeterminateMaps,
509
- selectCheckboxMaps = $table.selectCheckboxMaps;
510
- var _$table$checkboxOpts = $table.checkboxOpts,
511
- labelField = _$table$checkboxOpts.labelField,
512
- checkMethod = _$table$checkboxOpts.checkMethod,
513
- visibleMethod = _$table$checkboxOpts.visibleMethod;
514
- var slots = column.slots;
515
- var defaultSlot = slots ? slots.default : null;
516
- var checkboxSlot = slots ? slots.checkbox : null;
517
- var indeterminate = false;
518
- var isChecked = false;
519
- var isVisible = !visibleMethod || visibleMethod({
520
- row: row
568
+ renderCheckboxCell(h, params) {
569
+ const {
570
+ $table,
571
+ row,
572
+ column,
573
+ isHidden
574
+ } = params;
575
+ const {
576
+ treeConfig,
577
+ treeIndeterminateMaps,
578
+ selectCheckboxMaps
579
+ } = $table;
580
+ const {
581
+ labelField,
582
+ checkMethod,
583
+ visibleMethod
584
+ } = $table.checkboxOpts;
585
+ const {
586
+ slots
587
+ } = column;
588
+ const defaultSlot = slots ? slots.default : null;
589
+ const checkboxSlot = slots ? slots.checkbox : null;
590
+ let indeterminate = false;
591
+ let isChecked = false;
592
+ const isVisible = !visibleMethod || visibleMethod({
593
+ row
521
594
  });
522
- var isDisabled = !!checkMethod;
523
- var on;
595
+ let isDisabled = !!checkMethod;
596
+ let on;
524
597
  if (!isHidden) {
525
- var rowid = (0, _util.getRowid)($table, row);
598
+ const rowid = (0, _util.getRowid)($table, row);
526
599
  isChecked = !!selectCheckboxMaps[rowid];
527
600
  on = {
528
- click: function click(evnt) {
601
+ click(evnt) {
529
602
  if (!isDisabled && isVisible) {
530
603
  $table.triggerCheckRowEvent(evnt, params, !isChecked);
531
604
  }
@@ -533,23 +606,23 @@ var Cell = exports.Cell = {
533
606
  };
534
607
  if (checkMethod) {
535
608
  isDisabled = !checkMethod({
536
- row: row
609
+ row
537
610
  });
538
611
  }
539
612
  if (treeConfig) {
540
613
  indeterminate = !!treeIndeterminateMaps[rowid];
541
614
  }
542
615
  }
543
- var checkboxParams = Object.assign(Object.assign({}, params), {
616
+ const checkboxParams = Object.assign(Object.assign({}, params), {
544
617
  checked: isChecked,
545
618
  disabled: isDisabled,
546
619
  visible: isVisible,
547
- indeterminate: indeterminate
620
+ indeterminate
548
621
  });
549
622
  if (checkboxSlot) {
550
623
  return $table.callSlot(checkboxSlot, checkboxParams, h);
551
624
  }
552
- var checkVNs = [];
625
+ const checkVNs = [];
553
626
  if (isVisible) {
554
627
  checkVNs.push(h('span', {
555
628
  class: ['vxe-checkbox--icon', indeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : isChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED]
@@ -567,40 +640,48 @@ var Cell = exports.Cell = {
567
640
  'is--indeterminate': indeterminate,
568
641
  'is--hidden': !isVisible
569
642
  }],
570
- on: on
643
+ on
571
644
  }, checkVNs)];
572
645
  },
573
- renderTreeSelectionCell: function renderTreeSelectionCell(h, params) {
646
+ renderTreeSelectionCell(h, params) {
574
647
  return Cell.renderTreeIcon(h, params, Cell.renderCheckboxCell(h, params));
575
648
  },
576
- renderCheckboxCellByProp: function renderCheckboxCellByProp(h, params) {
577
- var $table = params.$table,
578
- row = params.row,
579
- column = params.column,
580
- isHidden = params.isHidden;
581
- var treeConfig = $table.treeConfig,
582
- treeIndeterminateMaps = $table.treeIndeterminateMaps,
583
- checkboxOpts = $table.checkboxOpts;
584
- var labelField = checkboxOpts.labelField,
585
- checkField = checkboxOpts.checkField,
586
- checkMethod = checkboxOpts.checkMethod,
587
- visibleMethod = checkboxOpts.visibleMethod;
588
- var indeterminateField = checkboxOpts.indeterminateField || checkboxOpts.halfField;
589
- var slots = column.slots;
590
- var defaultSlot = slots ? slots.default : null;
591
- var checkboxSlot = slots ? slots.checkbox : null;
592
- var isIndeterminate = false;
593
- var isChecked = false;
594
- var isVisible = !visibleMethod || visibleMethod({
595
- row: row
649
+ renderCheckboxCellByProp(h, params) {
650
+ const {
651
+ $table,
652
+ row,
653
+ column,
654
+ isHidden
655
+ } = params;
656
+ const {
657
+ treeConfig,
658
+ treeIndeterminateMaps,
659
+ checkboxOpts
660
+ } = $table;
661
+ const {
662
+ labelField,
663
+ checkField,
664
+ checkMethod,
665
+ visibleMethod
666
+ } = checkboxOpts;
667
+ const indeterminateField = checkboxOpts.indeterminateField || checkboxOpts.halfField;
668
+ const {
669
+ slots
670
+ } = column;
671
+ const defaultSlot = slots ? slots.default : null;
672
+ const checkboxSlot = slots ? slots.checkbox : null;
673
+ let isIndeterminate = false;
674
+ let isChecked = false;
675
+ const isVisible = !visibleMethod || visibleMethod({
676
+ row
596
677
  });
597
- var isDisabled = !!checkMethod;
598
- var on;
678
+ let isDisabled = !!checkMethod;
679
+ let on;
599
680
  if (!isHidden) {
600
- var rowid = (0, _util.getRowid)($table, row);
681
+ const rowid = (0, _util.getRowid)($table, row);
601
682
  isChecked = _xeUtils.default.get(row, checkField);
602
683
  on = {
603
- click: function click(evnt) {
684
+ click(evnt) {
604
685
  if (!isDisabled && isVisible) {
605
686
  $table.triggerCheckRowEvent(evnt, params, !isChecked);
606
687
  }
@@ -608,14 +689,14 @@ var Cell = exports.Cell = {
608
689
  };
609
690
  if (checkMethod) {
610
691
  isDisabled = !checkMethod({
611
- row: row
692
+ row
612
693
  });
613
694
  }
614
695
  if (treeConfig) {
615
696
  isIndeterminate = !!treeIndeterminateMaps[rowid];
616
697
  }
617
698
  }
618
- var checkboxParams = Object.assign(Object.assign({}, params), {
699
+ const checkboxParams = Object.assign(Object.assign({}, params), {
619
700
  checked: isChecked,
620
701
  disabled: isDisabled,
621
702
  visible: isVisible,
@@ -624,7 +705,7 @@ var Cell = exports.Cell = {
624
705
  if (checkboxSlot) {
625
706
  return $table.callSlot(checkboxSlot, checkboxParams, h);
626
707
  }
627
- var checkVNs = [];
708
+ const checkVNs = [];
628
709
  if (isVisible) {
629
710
  checkVNs.push(h('span', {
630
711
  class: ['vxe-checkbox--icon', isIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : isChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED]
@@ -642,39 +723,47 @@ var Cell = exports.Cell = {
642
723
  'is--indeterminate': indeterminateField && !isChecked ? row[indeterminateField] : isIndeterminate,
643
724
  'is--hidden': !isVisible
644
725
  }],
645
- on: on
726
+ on
646
727
  }, checkVNs)];
647
728
  },
648
- renderTreeSelectionCellByProp: function renderTreeSelectionCellByProp(h, params) {
729
+ renderTreeSelectionCellByProp(h, params) {
649
730
  return Cell.renderTreeIcon(h, params, Cell.renderCheckboxCellByProp(h, params));
650
731
  },
651
732
  /**
652
733
  * 展开行
653
734
  */
654
- renderExpandCell: function renderExpandCell(h, params) {
655
- var $table = params.$table,
656
- isHidden = params.isHidden,
657
- row = params.row,
658
- column = params.column;
659
- var expandOpts = $table.expandOpts,
660
- rowExpandedMaps = $table.rowExpandedMaps,
661
- rowExpandLazyLoadedMaps = $table.rowExpandLazyLoadedMaps;
662
- var lazy = expandOpts.lazy,
663
- labelField = expandOpts.labelField,
664
- iconLoaded = expandOpts.iconLoaded,
665
- showIcon = expandOpts.showIcon,
666
- iconOpen = expandOpts.iconOpen,
667
- iconClose = expandOpts.iconClose,
668
- visibleMethod = expandOpts.visibleMethod;
669
- var slots = column.slots;
670
- var defaultSlot = slots ? slots.default : null;
671
- var isAceived = false;
672
- var isLazyLoading = false;
735
+ renderExpandCell(h, params) {
736
+ const {
737
+ $table,
738
+ isHidden,
739
+ row,
740
+ column
741
+ } = params;
742
+ const {
743
+ expandOpts,
744
+ rowExpandedMaps,
745
+ rowExpandLazyLoadedMaps
746
+ } = $table;
747
+ const {
748
+ lazy,
749
+ labelField,
750
+ iconLoaded,
751
+ showIcon,
752
+ iconOpen,
753
+ iconClose,
754
+ visibleMethod
755
+ } = expandOpts;
756
+ const {
757
+ slots
758
+ } = column;
759
+ const defaultSlot = slots ? slots.default : null;
760
+ let isAceived = false;
761
+ let isLazyLoading = false;
673
762
  if (slots && slots.icon) {
674
763
  return $table.callSlot(slots.icon, params, h);
675
764
  }
676
765
  if (!isHidden) {
677
- var rowid = (0, _util.getRowid)($table, row);
766
+ const rowid = (0, _util.getRowid)($table, row);
678
767
  isAceived = !!rowExpandedMaps[rowid];
679
768
  if (lazy) {
680
769
  isLazyLoading = !!rowExpandLazyLoadedMaps[rowid];
@@ -685,7 +774,7 @@ var Cell = exports.Cell = {
685
774
  'is--active': isAceived
686
775
  }],
687
776
  on: {
688
- click: function click(evnt) {
777
+ click(evnt) {
689
778
  $table.triggerRowExpandEvent(evnt, params);
690
779
  }
691
780
  }
@@ -695,17 +784,21 @@ var Cell = exports.Cell = {
695
784
  class: 'vxe-table--expand-label'
696
785
  }, defaultSlot ? $table.callSlot(defaultSlot, params, h) : _xeUtils.default.get(row, labelField)) : null];
697
786
  },
698
- renderExpandData: function renderExpandData(h, params) {
699
- var $table = params.$table,
700
- column = params.column;
701
- var slots = column.slots,
702
- contentRender = column.contentRender;
787
+ renderExpandData(h, params) {
788
+ const {
789
+ $table,
790
+ column
791
+ } = params;
792
+ const {
793
+ slots,
794
+ contentRender
795
+ } = column;
703
796
  if (slots && slots.content) {
704
797
  return $table.callSlot(slots.content, params, h);
705
798
  }
706
799
  if (contentRender) {
707
- var compConf = renderer.get(contentRender.name);
708
- var rtExpand = compConf ? compConf.renderTableExpand || compConf.renderExpand : null;
800
+ const compConf = renderer.get(contentRender.name);
801
+ const rtExpand = compConf ? compConf.renderTableExpand || compConf.renderExpand : null;
709
802
  if (rtExpand) {
710
803
  return (0, _vn.getSlotVNs)(rtExpand.call($table, h, contentRender, params));
711
804
  }
@@ -715,10 +808,14 @@ var Cell = exports.Cell = {
715
808
  /**
716
809
  * HTML 标签
717
810
  */
718
- renderHTMLCell: function renderHTMLCell(h, params) {
719
- var $table = params.$table,
720
- column = params.column;
721
- var slots = column.slots;
811
+ renderHTMLCell(h, params) {
812
+ const {
813
+ $table,
814
+ column
815
+ } = params;
816
+ const {
817
+ slots
818
+ } = column;
722
819
  if (slots && slots.default) {
723
820
  return $table.callSlot(slots.default, params, h);
724
821
  }
@@ -729,31 +826,34 @@ var Cell = exports.Cell = {
729
826
  }
730
827
  })];
731
828
  },
732
- renderTreeHTMLCell: function renderTreeHTMLCell(h, params) {
829
+ renderTreeHTMLCell(h, params) {
733
830
  return Cell.renderTreeIcon(h, params, Cell.renderHTMLCell(h, params));
734
831
  },
735
832
  /**
736
833
  * 排序和筛选
737
834
  */
738
- renderSortAndFilterHeader: function renderSortAndFilterHeader(h, params) {
835
+ renderSortAndFilterHeader(h, params) {
739
836
  return Cell.renderDefaultHeader(h, params).concat(Cell.renderSortIcon(h, params)).concat(Cell.renderFilterIcon(h, params));
740
837
  },
741
838
  /**
742
839
  * 排序
743
840
  */
744
- renderSortHeader: function renderSortHeader(h, params) {
841
+ renderSortHeader(h, params) {
745
842
  return Cell.renderDefaultHeader(h, params).concat(Cell.renderSortIcon(h, params));
746
843
  },
747
- renderSortIcon: function renderSortIcon(h, params) {
748
- var $table = params.$table,
749
- column = params.column;
750
- var _$table$sortOpts = $table.sortOpts,
751
- showIcon = _$table$sortOpts.showIcon,
752
- iconLayout = _$table$sortOpts.iconLayout,
753
- iconAsc = _$table$sortOpts.iconAsc,
754
- iconDesc = _$table$sortOpts.iconDesc;
844
+ renderSortIcon(h, params) {
845
+ const {
846
+ $table,
847
+ column
848
+ } = params;
849
+ const {
850
+ showIcon,
851
+ iconLayout,
852
+ iconAsc,
853
+ iconDesc
854
+ } = $table.sortOpts;
755
855
  return showIcon ? [h('span', {
756
- class: ['vxe-cell--sort', "vxe-cell--sort-".concat(iconLayout, "-layout")]
856
+ class: ['vxe-cell--sort', `vxe-cell--sort-${iconLayout}-layout`]
757
857
  }, [h('i', {
758
858
  class: ['vxe-sort--asc-btn', iconAsc || getIcon().TABLE_SORT_ASC, {
759
859
  'sort--active': column.order === 'asc'
@@ -762,7 +862,7 @@ var Cell = exports.Cell = {
762
862
  title: getI18n('vxe.table.sortAsc')
763
863
  },
764
864
  on: {
765
- click: function click(evnt) {
865
+ click(evnt) {
766
866
  evnt.stopPropagation();
767
867
  $table.triggerSortEvent(evnt, column, 'asc');
768
868
  }
@@ -775,7 +875,7 @@ var Cell = exports.Cell = {
775
875
  title: getI18n('vxe.table.sortDesc')
776
876
  },
777
877
  on: {
778
- click: function click(evnt) {
878
+ click(evnt) {
779
879
  evnt.stopPropagation();
780
880
  $table.triggerSortEvent(evnt, column, 'desc');
781
881
  }
@@ -785,18 +885,24 @@ var Cell = exports.Cell = {
785
885
  /**
786
886
  * 筛选
787
887
  */
788
- renderFilterHeader: function renderFilterHeader(h, params) {
888
+ renderFilterHeader(h, params) {
789
889
  return Cell.renderDefaultHeader(h, params).concat(Cell.renderFilterIcon(h, params));
790
890
  },
791
- renderFilterIcon: function renderFilterIcon(h, params) {
792
- var $table = params.$table,
793
- column = params.column,
794
- hasFilter = params.hasFilter;
795
- var filterStore = $table.filterStore,
796
- filterOpts = $table.filterOpts;
797
- var showIcon = filterOpts.showIcon,
798
- iconNone = filterOpts.iconNone,
799
- iconMatch = filterOpts.iconMatch;
891
+ renderFilterIcon(h, params) {
892
+ const {
893
+ $table,
894
+ column,
895
+ hasFilter
896
+ } = params;
897
+ const {
898
+ filterStore,
899
+ filterOpts
900
+ } = $table;
901
+ const {
902
+ showIcon,
903
+ iconNone,
904
+ iconMatch
905
+ } = filterOpts;
800
906
  return showIcon ? [h('span', {
801
907
  class: ['vxe-cell--filter', {
802
908
  'is--active': filterStore.visible && filterStore.column === column
@@ -807,7 +913,7 @@ var Cell = exports.Cell = {
807
913
  title: getI18n('vxe.table.filter')
808
914
  },
809
915
  on: {
810
- click: function click(evnt) {
916
+ click(evnt) {
811
917
  if ($table.triggerFilterEvent) {
812
918
  $table.triggerFilterEvent(evnt, params.column, params);
813
919
  }
@@ -818,23 +924,27 @@ var Cell = exports.Cell = {
818
924
  /**
819
925
  * 可编辑
820
926
  */
821
- renderEditHeader: function renderEditHeader(h, params) {
822
- var $table = params.$table,
823
- column = params.column;
824
- var editConfig = $table.editConfig,
825
- editRules = $table.editRules,
826
- editOpts = $table.editOpts;
827
- var sortable = column.sortable,
828
- remoteSort = column.remoteSort,
829
- filters = column.filters,
830
- editRender = column.editRender;
831
- var isRequired = false;
927
+ renderEditHeader(h, params) {
928
+ const {
929
+ $table,
930
+ column
931
+ } = params;
932
+ const {
933
+ editConfig,
934
+ editRules,
935
+ editOpts
936
+ } = $table;
937
+ const {
938
+ sortable,
939
+ remoteSort,
940
+ filters,
941
+ editRender
942
+ } = column;
943
+ let isRequired = false;
832
944
  if (editRules) {
833
- var columnRules = _xeUtils.default.get(editRules, column.field);
945
+ const columnRules = _xeUtils.default.get(editRules, column.field);
834
946
  if (columnRules) {
835
- isRequired = columnRules.some(function (rule) {
836
- return rule.required;
837
- });
947
+ isRequired = columnRules.some(rule => rule.required);
838
948
  }
839
949
  }
840
950
  return ((0, _utils.isEnableConf)(editConfig) ? [isRequired && editOpts.showAsterisk ? h('i', {
@@ -844,38 +954,54 @@ var Cell = exports.Cell = {
844
954
  }) : null] : []).concat(Cell.renderDefaultHeader(h, params)).concat(sortable || remoteSort ? Cell.renderSortIcon(h, params) : []).concat(filters ? Cell.renderFilterIcon(h, params) : []);
845
955
  },
846
956
  // 行格编辑模式
847
- renderRowEdit: function renderRowEdit(h, params) {
848
- var $table = params.$table,
849
- column = params.column;
850
- var editRender = column.editRender;
851
- var actived = $table.editStore.actived;
957
+ renderRowEdit(h, params) {
958
+ const {
959
+ $table,
960
+ column
961
+ } = params;
962
+ const {
963
+ editRender
964
+ } = column;
965
+ const {
966
+ actived
967
+ } = $table.editStore;
852
968
  return Cell.runRenderer(h, params, this, (0, _utils.isEnableConf)(editRender) && actived && actived.row === params.row);
853
969
  },
854
- renderTreeRowEdit: function renderTreeRowEdit(h, params) {
970
+ renderTreeRowEdit(h, params) {
855
971
  return Cell.renderTreeIcon(h, params, Cell.renderRowEdit(h, params));
856
972
  },
857
973
  // 单元格编辑模式
858
- renderCellEdit: function renderCellEdit(h, params) {
859
- var $table = params.$table,
860
- column = params.column;
861
- var editRender = column.editRender;
862
- var actived = $table.editStore.actived;
974
+ renderCellEdit(h, params) {
975
+ const {
976
+ $table,
977
+ column
978
+ } = params;
979
+ const {
980
+ editRender
981
+ } = column;
982
+ const {
983
+ actived
984
+ } = $table.editStore;
863
985
  return Cell.runRenderer(h, params, this, (0, _utils.isEnableConf)(editRender) && actived && actived.row === params.row && actived.column === params.column);
864
986
  },
865
- renderTreeCellEdit: function renderTreeCellEdit(h, params) {
987
+ renderTreeCellEdit(h, params) {
866
988
  return Cell.renderTreeIcon(h, params, Cell.renderCellEdit(h, params));
867
989
  },
868
- runRenderer: function runRenderer(h, params, _vm, isEdit) {
869
- var $table = params.$table,
870
- column = params.column;
871
- var slots = column.slots,
872
- editRender = column.editRender,
873
- formatter = column.formatter;
874
- var compConf = renderer.get(editRender.name);
875
- var rtEdit = compConf ? compConf.renderTableEdit || compConf.renderEdit : null;
876
- var cellParams = Object.assign({
990
+ runRenderer(h, params, _vm, isEdit) {
991
+ const {
992
+ $table,
993
+ column
994
+ } = params;
995
+ const {
996
+ slots,
997
+ editRender,
998
+ formatter
999
+ } = column;
1000
+ const compConf = renderer.get(editRender.name);
1001
+ const rtEdit = compConf ? compConf.renderTableEdit || compConf.renderEdit : null;
1002
+ const cellParams = Object.assign({
877
1003
  $type: '',
878
- isEdit: isEdit
1004
+ isEdit
879
1005
  }, params);
880
1006
  if (isEdit) {
881
1007
  if (slots && slots.edit) {