vxe-table 3.9.0-rc.9 → 3.9.1

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 (222) hide show
  1. package/README.md +80 -9
  2. package/es/grid/src/grid.js +116 -62
  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 +6 -2
  7. package/es/locale/lang/es-ES.js +5 -1
  8. package/es/locale/lang/hu-HU.js +5 -1
  9. package/es/locale/lang/ja-JP.js +5 -1
  10. package/es/locale/lang/ko-KR.js +5 -1
  11. package/es/locale/lang/pt-BR.js +5 -1
  12. package/es/locale/lang/ru-RU.js +5 -1
  13. package/es/locale/lang/uk-UA.js +5 -1
  14. package/es/locale/lang/vi-VN.js +5 -1
  15. package/es/locale/lang/zh-CHT.js +5 -1
  16. package/es/locale/lang/zh-CN.js +5 -1
  17. package/es/style.css +1 -1
  18. package/es/style.min.css +1 -1
  19. package/es/table/module/custom/panel.js +183 -173
  20. package/es/table/module/edit/mixin.js +35 -40
  21. package/es/table/module/export/export-panel.js +32 -4
  22. package/es/table/module/export/import-panel.js +25 -6
  23. package/es/table/module/export/mixin.js +11 -11
  24. package/es/table/module/menu/mixin.js +2 -2
  25. package/es/table/module/validator/mixin.js +4 -4
  26. package/es/table/render/index.js +17 -11
  27. package/es/table/src/body.js +1 -0
  28. package/es/table/src/columnInfo.js +3 -3
  29. package/es/table/src/methods.js +69 -55
  30. package/es/table/src/props.js +65 -15
  31. package/es/table/src/table.js +63 -29
  32. package/es/table/src/util.js +3 -2
  33. package/es/table/style.css +37 -48
  34. package/es/table/style.min.css +1 -1
  35. package/es/toolbar/src/toolbar.js +21 -7
  36. package/es/toolbar/style.css +0 -1
  37. package/es/toolbar/style.min.css +1 -1
  38. package/es/ui/index.js +5 -3
  39. package/es/ui/src/log.js +1 -1
  40. package/es/vxe-grid/style.css +0 -1
  41. package/es/vxe-grid/style.min.css +1 -1
  42. package/es/vxe-table/style.css +37 -48
  43. package/es/vxe-table/style.min.css +1 -1
  44. package/es/vxe-toolbar/style.css +0 -1
  45. package/es/vxe-toolbar/style.min.css +1 -1
  46. package/lib/colgroup/index.js +3 -3
  47. package/lib/colgroup/index.min.js +1 -1
  48. package/lib/column/index.js +3 -3
  49. package/lib/column/index.min.js +1 -1
  50. package/lib/components.js +9 -11
  51. package/lib/components.min.js +1 -1
  52. package/lib/grid/index.js +3 -3
  53. package/lib/grid/index.min.js +1 -1
  54. package/lib/grid/src/grid.js +577 -487
  55. package/lib/grid/src/grid.min.js +1 -1
  56. package/lib/grid/style/style.css +0 -1
  57. package/lib/grid/style/style.min.css +1 -1
  58. package/lib/index.common.js +3 -4
  59. package/lib/index.umd.js +9148 -17246
  60. package/lib/index.umd.min.js +1 -1
  61. package/lib/locale/lang/en-US.js +6 -2
  62. package/lib/locale/lang/en-US.min.js +1 -1
  63. package/lib/locale/lang/en-US.umd.js +6 -2
  64. package/lib/locale/lang/es-ES.js +5 -1
  65. package/lib/locale/lang/es-ES.min.js +1 -1
  66. package/lib/locale/lang/es-ES.umd.js +5 -1
  67. package/lib/locale/lang/hu-HU.js +5 -1
  68. package/lib/locale/lang/hu-HU.min.js +1 -1
  69. package/lib/locale/lang/hu-HU.umd.js +5 -1
  70. package/lib/locale/lang/ja-JP.js +5 -1
  71. package/lib/locale/lang/ja-JP.min.js +1 -1
  72. package/lib/locale/lang/ja-JP.umd.js +5 -1
  73. package/lib/locale/lang/ko-KR.js +5 -1
  74. package/lib/locale/lang/ko-KR.min.js +1 -1
  75. package/lib/locale/lang/ko-KR.umd.js +5 -1
  76. package/lib/locale/lang/pt-BR.js +5 -1
  77. package/lib/locale/lang/pt-BR.min.js +1 -1
  78. package/lib/locale/lang/pt-BR.umd.js +5 -1
  79. package/lib/locale/lang/ru-RU.js +5 -1
  80. package/lib/locale/lang/ru-RU.min.js +1 -1
  81. package/lib/locale/lang/ru-RU.umd.js +5 -1
  82. package/lib/locale/lang/uk-UA.js +5 -1
  83. package/lib/locale/lang/uk-UA.min.js +1 -1
  84. package/lib/locale/lang/uk-UA.umd.js +5 -1
  85. package/lib/locale/lang/vi-VN.js +5 -1
  86. package/lib/locale/lang/vi-VN.min.js +1 -1
  87. package/lib/locale/lang/zh-CHT.js +5 -1
  88. package/lib/locale/lang/zh-CHT.min.js +1 -1
  89. package/lib/locale/lang/zh-CHT.umd.js +5 -1
  90. package/lib/locale/lang/zh-CN.js +5 -1
  91. package/lib/locale/lang/zh-CN.min.js +1 -1
  92. package/lib/locale/lang/zh-CN.umd.js +5 -1
  93. package/lib/style.css +1 -1
  94. package/lib/style.min.css +1 -1
  95. package/lib/table/index.js +4 -4
  96. package/lib/table/index.min.js +1 -1
  97. package/lib/table/module/custom/mixin.js +53 -44
  98. package/lib/table/module/custom/mixin.min.js +1 -1
  99. package/lib/table/module/custom/panel.js +310 -239
  100. package/lib/table/module/custom/panel.min.js +1 -1
  101. package/lib/table/module/edit/mixin.js +434 -383
  102. package/lib/table/module/edit/mixin.min.js +1 -1
  103. package/lib/table/module/export/export-panel.js +136 -106
  104. package/lib/table/module/export/export-panel.min.js +1 -1
  105. package/lib/table/module/export/import-panel.js +75 -54
  106. package/lib/table/module/export/import-panel.min.js +1 -1
  107. package/lib/table/module/export/mixin.js +592 -597
  108. package/lib/table/module/export/mixin.min.js +1 -1
  109. package/lib/table/module/export/util.js +6 -4
  110. package/lib/table/module/export/util.min.js +1 -1
  111. package/lib/table/module/filter/mixin.js +147 -118
  112. package/lib/table/module/filter/mixin.min.js +1 -1
  113. package/lib/table/module/filter/panel.js +86 -65
  114. package/lib/table/module/filter/panel.min.js +1 -1
  115. package/lib/table/module/keyboard/mixin.js +163 -151
  116. package/lib/table/module/keyboard/mixin.min.js +1 -1
  117. package/lib/table/module/menu/mixin.js +125 -114
  118. package/lib/table/module/menu/mixin.min.js +1 -1
  119. package/lib/table/module/menu/panel.js +36 -34
  120. package/lib/table/module/menu/panel.min.js +1 -1
  121. package/lib/table/module/validator/mixin.js +225 -214
  122. package/lib/table/module/validator/mixin.min.js +1 -1
  123. package/lib/table/render/index.js +401 -297
  124. package/lib/table/render/index.min.js +1 -1
  125. package/lib/table/src/body.js +411 -349
  126. package/lib/table/src/body.min.js +1 -1
  127. package/lib/table/src/cell.js +470 -344
  128. package/lib/table/src/cell.min.js +1 -1
  129. package/lib/table/src/column.js +10 -10
  130. package/lib/table/src/column.min.js +1 -1
  131. package/lib/table/src/columnInfo.js +46 -55
  132. package/lib/table/src/columnInfo.min.js +1 -1
  133. package/lib/table/src/footer.js +157 -132
  134. package/lib/table/src/footer.min.js +1 -1
  135. package/lib/table/src/group.js +1 -1
  136. package/lib/table/src/group.min.js +1 -1
  137. package/lib/table/src/header.js +170 -153
  138. package/lib/table/src/header.min.js +1 -1
  139. package/lib/table/src/methods.js +2770 -2491
  140. package/lib/table/src/methods.min.js +1 -1
  141. package/lib/table/src/props.js +33 -74
  142. package/lib/table/src/props.min.js +1 -1
  143. package/lib/table/src/table.js +436 -395
  144. package/lib/table/src/table.min.js +1 -1
  145. package/lib/table/src/util.js +143 -131
  146. package/lib/table/src/util.min.js +1 -1
  147. package/lib/table/style/style.css +37 -48
  148. package/lib/table/style/style.min.css +1 -1
  149. package/lib/toolbar/index.js +3 -3
  150. package/lib/toolbar/index.min.js +1 -1
  151. package/lib/toolbar/src/toolbar.js +332 -284
  152. package/lib/toolbar/src/toolbar.min.js +1 -1
  153. package/lib/toolbar/style/style.css +0 -1
  154. package/lib/toolbar/style/style.min.css +1 -1
  155. package/lib/ui/index.js +50 -41
  156. package/lib/ui/index.min.js +1 -1
  157. package/lib/ui/src/comp.js +2 -3
  158. package/lib/ui/src/comp.min.js +1 -1
  159. package/lib/ui/src/dom.js +29 -28
  160. package/lib/ui/src/dom.min.js +1 -1
  161. package/lib/ui/src/log.js +6 -4
  162. package/lib/ui/src/log.min.js +1 -1
  163. package/lib/ui/src/utils.js +7 -7
  164. package/lib/v-x-e-table/index.js +3 -4
  165. package/lib/v-x-e-table/index.min.js +1 -1
  166. package/lib/vxe-colgroup/index.js +3 -4
  167. package/lib/vxe-colgroup/index.min.js +1 -1
  168. package/lib/vxe-column/index.js +3 -4
  169. package/lib/vxe-column/index.min.js +1 -1
  170. package/lib/vxe-grid/index.js +3 -4
  171. package/lib/vxe-grid/index.min.js +1 -1
  172. package/lib/vxe-grid/style/style.css +0 -1
  173. package/lib/vxe-grid/style/style.min.css +1 -1
  174. package/lib/vxe-table/index.js +3 -4
  175. package/lib/vxe-table/index.min.js +1 -1
  176. package/lib/vxe-table/style/style.css +37 -48
  177. package/lib/vxe-table/style/style.min.css +1 -1
  178. package/lib/vxe-toolbar/index.js +3 -4
  179. package/lib/vxe-toolbar/index.min.js +1 -1
  180. package/lib/vxe-toolbar/style/style.css +0 -1
  181. package/lib/vxe-toolbar/style/style.min.css +1 -1
  182. package/lib/vxe-ui/index.js +3 -4
  183. package/lib/vxe-ui/index.min.js +1 -1
  184. package/lib/vxe-v-x-e-table/index.js +3 -4
  185. package/lib/vxe-v-x-e-table/index.min.js +1 -1
  186. package/package.json +5 -4
  187. package/packages/grid/src/grid.ts +123 -61
  188. package/packages/locale/lang/en-US.ts +6 -2
  189. package/packages/locale/lang/es-ES.ts +5 -1
  190. package/packages/locale/lang/hu-HU.ts +5 -1
  191. package/packages/locale/lang/ja-JP.ts +5 -1
  192. package/packages/locale/lang/ko-KR.ts +5 -1
  193. package/packages/locale/lang/pt-BR.ts +5 -1
  194. package/packages/locale/lang/ru-RU.ts +5 -1
  195. package/packages/locale/lang/uk-UA.ts +5 -1
  196. package/packages/locale/lang/vi-VN.ts +5 -1
  197. package/packages/locale/lang/zh-CHT.ts +5 -1
  198. package/packages/locale/lang/zh-CN.ts +5 -1
  199. package/packages/table/module/custom/panel.ts +186 -175
  200. package/packages/table/module/edit/mixin.ts +34 -39
  201. package/packages/table/module/export/export-panel.ts +36 -4
  202. package/packages/table/module/export/import-panel.ts +29 -6
  203. package/packages/table/module/export/mixin.ts +11 -11
  204. package/packages/table/module/menu/mixin.ts +2 -2
  205. package/packages/table/module/validator/mixin.ts +4 -4
  206. package/packages/table/render/index.ts +20 -11
  207. package/packages/table/src/body.ts +1 -0
  208. package/packages/table/src/columnInfo.ts +3 -3
  209. package/packages/table/src/methods.ts +70 -55
  210. package/packages/table/src/props.ts +68 -15
  211. package/packages/table/src/table.ts +71 -26
  212. package/packages/table/src/util.ts +3 -2
  213. package/packages/toolbar/src/toolbar.ts +21 -7
  214. package/packages/ui/index.ts +3 -1
  215. package/styles/components/table.scss +82 -17
  216. package/types/all.d.ts +1 -0
  217. /package/es/{iconfont.1726453742001.ttf → iconfont.1728483486168.ttf} +0 -0
  218. /package/es/{iconfont.1726453742001.woff → iconfont.1728483486168.woff} +0 -0
  219. /package/es/{iconfont.1726453742001.woff2 → iconfont.1728483486168.woff2} +0 -0
  220. /package/lib/{iconfont.1726453742001.ttf → iconfont.1728483486168.ttf} +0 -0
  221. /package/lib/{iconfont.1726453742001.woff → iconfont.1728483486168.woff} +0 -0
  222. /package/lib/{iconfont.1726453742001.woff2 → iconfont.1728483486168.woff2} +0 -0
@@ -7,54 +7,59 @@ var _utils = require("../../ui/src/utils");
7
7
  var _vn = require("../../ui/src/vn");
8
8
  var _log = require("../../ui/src/log");
9
9
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
11
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
12
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
13
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
14
- var getConfig = _ui.VxeUI.getConfig,
15
- renderer = _ui.VxeUI.renderer,
16
- getI18n = _ui.VxeUI.getI18n;
17
- var componentDefaultModelProp = 'value';
18
- var defaultCompProps = {
10
+ const {
11
+ getConfig,
12
+ renderer,
13
+ getI18n
14
+ } = _ui.VxeUI;
15
+ const componentDefaultModelProp = 'value';
16
+ const defaultCompProps = {
19
17
  transfer: true
20
18
  };
21
19
  function parseDate(value, props) {
22
20
  return value && props.valueFormat ? _xeUtils.default.toStringDate(value, props.valueFormat) : value;
23
21
  }
24
22
  function getFormatDate(value, props, defaultFormat) {
25
- var _props$dateConfig = props.dateConfig,
26
- dateConfig = _props$dateConfig === void 0 ? {} : _props$dateConfig;
23
+ const {
24
+ dateConfig = {}
25
+ } = props;
27
26
  return _xeUtils.default.toDateString(parseDate(value, props), dateConfig.labelFormat || defaultFormat);
28
27
  }
29
28
  function getLabelFormatDate(value, props) {
30
- return getFormatDate(value, props, getI18n("vxe.input.date.labelFormat.".concat(props.type)));
29
+ return getFormatDate(value, props, getI18n(`vxe.input.date.labelFormat.${props.type || 'date'}`));
31
30
  }
32
31
  /**
33
32
  * 已废弃
34
33
  * @deprecated
35
34
  */
36
35
  function getOldComponentName(name) {
37
- return "vxe-".concat(name.replace('$', ''));
36
+ return `vxe-${name.replace('$', '')}`;
38
37
  }
39
38
  /**
40
39
  * 已废弃
41
40
  * @deprecated
42
41
  */
43
- function getOldComponent(_ref) {
44
- var name = _ref.name;
42
+ function getOldComponent({
43
+ name
44
+ }) {
45
45
  return getOldComponentName(name);
46
46
  }
47
- function getDefaultComponent(_ref2) {
48
- var name = _ref2.name;
47
+ function getDefaultComponent({
48
+ name
49
+ }) {
49
50
  return name;
50
51
  }
51
52
  function handleConfirmFilter(params, checked, option) {
52
- var $panel = params.$panel;
53
+ const {
54
+ $panel
55
+ } = params;
53
56
  $panel.changeOption({}, checked, option);
54
57
  }
55
58
  function getNativeAttrs(renderOpts) {
56
- var name = renderOpts.name,
57
- attrs = renderOpts.attrs;
59
+ let {
60
+ name,
61
+ attrs
62
+ } = renderOpts;
58
63
  if (name === 'input') {
59
64
  attrs = Object.assign({
60
65
  type: 'text'
@@ -63,13 +68,16 @@ function getNativeAttrs(renderOpts) {
63
68
  return attrs;
64
69
  }
65
70
  function getInputImmediateModel(renderOpts) {
66
- var name = renderOpts.name,
67
- immediate = renderOpts.immediate,
68
- props = renderOpts.props;
71
+ const {
72
+ name,
73
+ immediate,
74
+ props
75
+ } = renderOpts;
69
76
  if (!immediate) {
70
77
  if (name === 'VxeInput' || name === '$input') {
71
- var _ref3 = props || {},
72
- type = _ref3.type;
78
+ const {
79
+ type
80
+ } = props || {};
73
81
  return !(!type || type === 'text' || type === 'number' || type === 'integer' || type === 'float');
74
82
  }
75
83
  if (name === 'input' || name === 'textarea' || name === '$textarea') {
@@ -82,16 +90,22 @@ function getInputImmediateModel(renderOpts) {
82
90
  function getCellEditProps(renderOpts, params, value, defaultProps) {
83
91
  return _xeUtils.default.assign({
84
92
  immediate: getInputImmediateModel(renderOpts)
85
- }, defaultCompProps, defaultProps, renderOpts.props, _defineProperty({}, componentDefaultModelProp, value));
93
+ }, defaultCompProps, defaultProps, renderOpts.props, {
94
+ [componentDefaultModelProp]: value
95
+ });
86
96
  }
87
97
  function getCellEditFilterProps(renderOpts, params, value, defaultProps) {
88
- return _xeUtils.default.assign({}, defaultCompProps, defaultProps, renderOpts.props, _defineProperty({}, componentDefaultModelProp, value));
98
+ return _xeUtils.default.assign({}, defaultCompProps, defaultProps, renderOpts.props, {
99
+ [componentDefaultModelProp]: value
100
+ });
89
101
  }
90
102
  function isImmediateCell(renderOpts, params) {
91
103
  return params.$type === 'cell' || getInputImmediateModel(renderOpts);
92
104
  }
93
105
  function getCellLabelVNs(h, renderOpts, params, cellLabel) {
94
- var placeholder = renderOpts.placeholder;
106
+ const {
107
+ placeholder
108
+ } = renderOpts;
95
109
  return [h('span', {
96
110
  class: 'vxe-cell--label'
97
111
  }, placeholder && (0, _utils.isEmptyValue)(cellLabel) ? [h('span', {
@@ -106,18 +120,17 @@ function getCellLabelVNs(h, renderOpts, params, cellLabel) {
106
120
  * @param changeFunc
107
121
  */
108
122
  function getNativeElementOns(renderOpts, params, modelFunc, changeFunc) {
109
- var events = renderOpts.events;
110
- var modelEvent = (0, _vn.getModelEvent)(renderOpts);
111
- var changeEvent = (0, _vn.getChangeEvent)(renderOpts);
112
- var isSameEvent = changeEvent === modelEvent;
113
- var ons = {};
123
+ const {
124
+ events
125
+ } = renderOpts;
126
+ const modelEvent = (0, _vn.getModelEvent)(renderOpts);
127
+ const changeEvent = (0, _vn.getChangeEvent)(renderOpts);
128
+ const isSameEvent = changeEvent === modelEvent;
129
+ const ons = {};
114
130
  if (events) {
115
- _xeUtils.default.objectEach(events, function (func, key) {
116
- ons[(0, _vn.getOnName)(key)] = function () {
117
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
118
- args[_key] = arguments[_key];
119
- }
120
- func.apply(void 0, [params].concat(args));
131
+ _xeUtils.default.objectEach(events, (func, key) => {
132
+ ons[(0, _vn.getOnName)(key)] = function (...args) {
133
+ func(params, ...args);
121
134
  };
122
135
  });
123
136
  }
@@ -133,13 +146,10 @@ function getNativeElementOns(renderOpts, params, modelFunc, changeFunc) {
133
146
  };
134
147
  }
135
148
  if (!isSameEvent && changeFunc) {
136
- ons[(0, _vn.getOnName)(changeEvent)] = function () {
137
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
138
- args[_key2] = arguments[_key2];
139
- }
140
- changeFunc.apply(void 0, args);
149
+ ons[(0, _vn.getOnName)(changeEvent)] = function (...args) {
150
+ changeFunc(...args);
141
151
  if (events && events[changeEvent]) {
142
- events[changeEvent].apply(events, [params].concat(args));
152
+ events[changeEvent](params, ...args);
143
153
  }
144
154
  };
145
155
  }
@@ -153,21 +163,20 @@ function getNativeElementOns(renderOpts, params, modelFunc, changeFunc) {
153
163
  * @param changeFunc
154
164
  */
155
165
  function getComponentOns(renderOpts, params, modelFunc, changeFunc) {
156
- var events = renderOpts.events;
157
- var modelEvent = (0, _vn.getModelEvent)(renderOpts);
158
- var changeEvent = (0, _vn.getChangeEvent)(renderOpts);
159
- var ons = {};
160
- _xeUtils.default.objectEach(events, function (func, key) {
161
- ons[(0, _vn.getOnName)(key)] = function () {
166
+ const {
167
+ events
168
+ } = renderOpts;
169
+ const modelEvent = (0, _vn.getModelEvent)(renderOpts);
170
+ const changeEvent = (0, _vn.getChangeEvent)(renderOpts);
171
+ const ons = {};
172
+ _xeUtils.default.objectEach(events, (func, key) => {
173
+ ons[(0, _vn.getOnName)(key)] = function (...args) {
162
174
  if (process.env.NODE_ENV === 'development') {
163
175
  if (!_xeUtils.default.isFunction(func)) {
164
176
  (0, _log.errLog)('vxe.error.errFunc', [func]);
165
177
  }
166
178
  }
167
- for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
168
- args[_key3] = arguments[_key3];
169
- }
170
- func.apply(void 0, [params].concat(args));
179
+ func(params, ...args);
171
180
  };
172
181
  });
173
182
  if (modelFunc) {
@@ -179,36 +188,39 @@ function getComponentOns(renderOpts, params, modelFunc, changeFunc) {
179
188
  };
180
189
  }
181
190
  if (changeFunc) {
182
- ons[(0, _vn.getOnName)(changeEvent)] = function () {
183
- for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
184
- args[_key4] = arguments[_key4];
185
- }
186
- changeFunc.apply(void 0, args);
191
+ ons[(0, _vn.getOnName)(changeEvent)] = function (...args) {
192
+ changeFunc(...args);
187
193
  if (events && events[changeEvent]) {
188
- events[changeEvent].apply(events, [params].concat(args));
194
+ events[changeEvent](params, ...args);
189
195
  }
190
196
  };
191
197
  }
192
198
  return ons;
193
199
  }
194
200
  function getEditOns(renderOpts, params) {
195
- var $table = params.$table,
196
- row = params.row,
197
- column = params.column;
198
- var name = renderOpts.name;
199
- var model = column.model;
200
- var isImmediate = isImmediateCell(renderOpts, params);
201
- return getComponentOns(renderOpts, params, function (cellValue) {
201
+ const {
202
+ $table,
203
+ row,
204
+ column
205
+ } = params;
206
+ const {
207
+ name
208
+ } = renderOpts;
209
+ const {
210
+ model
211
+ } = column;
212
+ const isImmediate = isImmediateCell(renderOpts, params);
213
+ return getComponentOns(renderOpts, params, cellValue => {
202
214
  // 处理 model 值双向绑定
203
215
  model.update = true;
204
216
  model.value = cellValue;
205
217
  if (isImmediate) {
206
218
  (0, _util.setCellValue)(row, column, cellValue);
207
219
  }
208
- }, function (eventParams) {
220
+ }, eventParams => {
209
221
  // 处理 change 事件相关逻辑
210
222
  if (!isImmediate && ['VxeInput', 'VxeNumberInput', 'VxeTextarea', '$input', '$textarea'].includes(name)) {
211
- var cellValue = eventParams.value;
223
+ const cellValue = eventParams.value;
212
224
  model.update = true;
213
225
  model.value = cellValue;
214
226
  $table.updateStatus(params, cellValue);
@@ -218,38 +230,42 @@ function getEditOns(renderOpts, params) {
218
230
  });
219
231
  }
220
232
  function getFilterOns(renderOpts, params, option) {
221
- return getComponentOns(renderOpts, params, function (value) {
233
+ return getComponentOns(renderOpts, params, value => {
222
234
  // 处理 model 值双向绑定
223
235
  option.data = value;
224
- }, function () {
236
+ }, () => {
225
237
  handleConfirmFilter(params, !_xeUtils.default.eqNull(option.data), option);
226
238
  });
227
239
  }
228
240
  function getNativeEditOns(renderOpts, params) {
229
- var $table = params.$table,
230
- row = params.row,
231
- column = params.column;
232
- var model = column.model;
233
- return getNativeElementOns(renderOpts, params, function (evnt) {
241
+ const {
242
+ $table,
243
+ row,
244
+ column
245
+ } = params;
246
+ const {
247
+ model
248
+ } = column;
249
+ return getNativeElementOns(renderOpts, params, evnt => {
234
250
  // 处理 model 值双向绑定
235
- var cellValue = evnt.target.value;
251
+ const cellValue = evnt.target.value;
236
252
  if (isImmediateCell(renderOpts, params)) {
237
253
  (0, _util.setCellValue)(row, column, cellValue);
238
254
  } else {
239
255
  model.update = true;
240
256
  model.value = cellValue;
241
257
  }
242
- }, function (evnt) {
258
+ }, evnt => {
243
259
  // 处理 change 事件相关逻辑
244
- var cellValue = evnt.target.value;
260
+ const cellValue = evnt.target.value;
245
261
  $table.updateStatus(params, cellValue);
246
262
  });
247
263
  }
248
264
  function getNativeFilterOns(renderOpts, params, option) {
249
- return getNativeElementOns(renderOpts, params, function (evnt) {
265
+ return getNativeElementOns(renderOpts, params, evnt => {
250
266
  // 处理 model 值双向绑定
251
267
  option.data = evnt.target.value;
252
- }, function () {
268
+ }, () => {
253
269
  handleConfirmFilter(params, !_xeUtils.default.eqNull(option.data), option);
254
270
  });
255
271
  }
@@ -258,12 +274,16 @@ function getNativeFilterOns(renderOpts, params, option) {
258
274
  * input、textarea、select
259
275
  */
260
276
  function nativeEditRender(h, renderOpts, params) {
261
- var row = params.row,
262
- column = params.column;
263
- var name = renderOpts.name;
264
- var cellValue = isImmediateCell(renderOpts, params) ? (0, _util.getCellValue)(row, column) : column.model.value;
277
+ const {
278
+ row,
279
+ column
280
+ } = params;
281
+ const {
282
+ name
283
+ } = renderOpts;
284
+ const cellValue = isImmediateCell(renderOpts, params) ? (0, _util.getCellValue)(row, column) : column.model.value;
265
285
  return [h(name, {
266
- class: "vxe-default-".concat(name),
286
+ class: `vxe-default-${name}`,
267
287
  attrs: getNativeAttrs(renderOpts),
268
288
  domProps: {
269
289
  value: cellValue
@@ -278,22 +298,28 @@ function buttonCellRender(h, renderOpts, params) {
278
298
  })];
279
299
  }
280
300
  function defaultEditRender(h, renderOpts, params) {
281
- var row = params.row,
282
- column = params.column;
283
- var cellValue = (0, _util.getCellValue)(row, column);
301
+ const {
302
+ row,
303
+ column
304
+ } = params;
305
+ const cellValue = (0, _util.getCellValue)(row, column);
284
306
  return [h(getDefaultComponent(renderOpts), {
285
307
  props: getCellEditProps(renderOpts, params, cellValue),
286
308
  on: getEditOns(renderOpts, params)
287
309
  })];
288
310
  }
289
311
  function radioAndCheckboxEditRender(h, renderOpts, params) {
290
- var options = renderOpts.options;
291
- var row = params.row,
292
- column = params.column;
293
- var cellValue = (0, _util.getCellValue)(row, column);
312
+ const {
313
+ options
314
+ } = renderOpts;
315
+ const {
316
+ row,
317
+ column
318
+ } = params;
319
+ const cellValue = (0, _util.getCellValue)(row, column);
294
320
  return [h(getDefaultComponent(renderOpts), {
295
321
  props: Object.assign({
296
- options: options
322
+ options
297
323
  }, getCellEditProps(renderOpts, params, cellValue)),
298
324
  on: getEditOns(renderOpts, params)
299
325
  })];
@@ -303,9 +329,11 @@ function radioAndCheckboxEditRender(h, renderOpts, params) {
303
329
  * @deprecated
304
330
  */
305
331
  function oldEditRender(h, renderOpts, params) {
306
- var row = params.row,
307
- column = params.column;
308
- var cellValue = (0, _util.getCellValue)(row, column);
332
+ const {
333
+ row,
334
+ column
335
+ } = params;
336
+ const cellValue = (0, _util.getCellValue)(row, column);
309
337
  return [h(getOldComponent(renderOpts), {
310
338
  props: getCellEditProps(renderOpts, params, cellValue),
311
339
  on: getEditOns(renderOpts, params)
@@ -326,17 +354,16 @@ function oldButtonEditRender(h, renderOpts, params) {
326
354
  * @deprecated
327
355
  */
328
356
  function oldButtonsEditRender(h, renderOpts, params) {
329
- return renderOpts.children.map(function (childRenderOpts) {
330
- return oldButtonEditRender(h, childRenderOpts, params)[0];
331
- });
357
+ return renderOpts.children.map(childRenderOpts => oldButtonEditRender(h, childRenderOpts, params)[0]);
332
358
  }
333
359
  function renderNativeOptgroups(h, renderOpts, params, renderOptionsMethods) {
334
- var optionGroups = renderOpts.optionGroups,
335
- _renderOpts$optionGro = renderOpts.optionGroupProps,
336
- optionGroupProps = _renderOpts$optionGro === void 0 ? {} : _renderOpts$optionGro;
337
- var groupOptions = optionGroupProps.options || 'options';
338
- var groupLabel = optionGroupProps.label || 'label';
339
- return optionGroups.map(function (group, gIndex) {
360
+ const {
361
+ optionGroups,
362
+ optionGroupProps = {}
363
+ } = renderOpts;
364
+ const groupOptions = optionGroupProps.options || 'options';
365
+ const groupLabel = optionGroupProps.label || 'label';
366
+ return optionGroups.map((group, gIndex) => {
340
367
  return h('optgroup', {
341
368
  key: gIndex,
342
369
  attrs: {
@@ -349,15 +376,18 @@ function renderNativeOptgroups(h, renderOpts, params, renderOptionsMethods) {
349
376
  * 渲染原生的 option 标签
350
377
  */
351
378
  function renderNativeOptions(h, options, renderOpts, params) {
352
- var _renderOpts$optionPro = renderOpts.optionProps,
353
- optionProps = _renderOpts$optionPro === void 0 ? {} : _renderOpts$optionPro;
354
- var row = params.row,
355
- column = params.column;
356
- var labelProp = optionProps.label || 'label';
357
- var valueProp = optionProps.value || 'value';
358
- var disabledProp = optionProps.disabled || 'disabled';
359
- var cellValue = isImmediateCell(renderOpts, params) ? (0, _util.getCellValue)(row, column) : column.model.value;
360
- return options.map(function (option, oIndex) {
379
+ const {
380
+ optionProps = {}
381
+ } = renderOpts;
382
+ const {
383
+ row,
384
+ column
385
+ } = params;
386
+ const labelProp = optionProps.label || 'label';
387
+ const valueProp = optionProps.value || 'value';
388
+ const disabledProp = optionProps.disabled || 'disabled';
389
+ const cellValue = isImmediateCell(renderOpts, params) ? (0, _util.getCellValue)(row, column) : column.model.value;
390
+ return options.map((option, oIndex) => {
361
391
  return h('option', {
362
392
  key: oIndex,
363
393
  attrs: {
@@ -372,14 +402,18 @@ function renderNativeOptions(h, options, renderOpts, params) {
372
402
  });
373
403
  }
374
404
  function nativeFilterRender(h, renderOpts, params) {
375
- var column = params.column;
376
- var name = renderOpts.name;
377
- var attrs = getNativeAttrs(renderOpts);
378
- return column.filters.map(function (option, oIndex) {
405
+ const {
406
+ column
407
+ } = params;
408
+ const {
409
+ name
410
+ } = renderOpts;
411
+ const attrs = getNativeAttrs(renderOpts);
412
+ return column.filters.map((option, oIndex) => {
379
413
  return h(name, {
380
414
  key: oIndex,
381
- class: "vxe-default-".concat(name),
382
- attrs: attrs,
415
+ class: `vxe-default-${name}`,
416
+ attrs,
383
417
  domProps: {
384
418
  value: option.data
385
419
  },
@@ -388,9 +422,11 @@ function nativeFilterRender(h, renderOpts, params) {
388
422
  });
389
423
  }
390
424
  function defaultFilterRender(h, renderOpts, params) {
391
- var column = params.column;
392
- return column.filters.map(function (option, oIndex) {
393
- var optionValue = option.data;
425
+ const {
426
+ column
427
+ } = params;
428
+ return column.filters.map((option, oIndex) => {
429
+ const optionValue = option.data;
394
430
  return h(getDefaultComponent(renderOpts), {
395
431
  key: oIndex,
396
432
  props: getCellEditFilterProps(renderOpts, renderOpts, optionValue),
@@ -403,9 +439,11 @@ function defaultFilterRender(h, renderOpts, params) {
403
439
  * @deprecated
404
440
  */
405
441
  function oldFilterRender(h, renderOpts, params) {
406
- var column = params.column;
407
- return column.filters.map(function (option, oIndex) {
408
- var optionValue = option.data;
442
+ const {
443
+ column
444
+ } = params;
445
+ return column.filters.map((option, oIndex) => {
446
+ const optionValue = option.data;
409
447
  return h(getOldComponent(renderOpts), {
410
448
  key: oIndex,
411
449
  props: getCellEditFilterProps(renderOpts, renderOpts, optionValue),
@@ -413,21 +451,27 @@ function oldFilterRender(h, renderOpts, params) {
413
451
  });
414
452
  });
415
453
  }
416
- function handleFilterMethod(_ref4) {
417
- var option = _ref4.option,
418
- row = _ref4.row,
419
- column = _ref4.column;
420
- var data = option.data;
421
- var cellValue = _xeUtils.default.get(row, column.field);
454
+ function handleFilterMethod({
455
+ option,
456
+ row,
457
+ column
458
+ }) {
459
+ const {
460
+ data
461
+ } = option;
462
+ const cellValue = _xeUtils.default.get(row, column.field);
422
463
  /* eslint-disable eqeqeq */
423
464
  return cellValue == data;
424
465
  }
425
- function handleInputFilterMethod(_ref5) {
426
- var option = _ref5.option,
427
- row = _ref5.row,
428
- column = _ref5.column;
429
- var data = option.data;
430
- var cellValue = _xeUtils.default.get(row, column.field);
466
+ function handleInputFilterMethod({
467
+ option,
468
+ row,
469
+ column
470
+ }) {
471
+ const {
472
+ data
473
+ } = option;
474
+ const cellValue = _xeUtils.default.get(row, column.field);
431
475
  /* eslint-disable eqeqeq */
432
476
  return _xeUtils.default.toValueString(cellValue).indexOf(data) > -1;
433
477
  }
@@ -439,33 +483,41 @@ function nativeSelectEditRender(h, renderOpts, params) {
439
483
  }, renderOpts.optionGroups ? renderNativeOptgroups(h, renderOpts, params, renderNativeOptions) : renderNativeOptions(h, renderOpts.options, renderOpts, params))];
440
484
  }
441
485
  function defaultSelectEditRender(h, renderOpts, params) {
442
- var row = params.row,
443
- column = params.column;
444
- var options = renderOpts.options,
445
- optionProps = renderOpts.optionProps,
446
- optionGroups = renderOpts.optionGroups,
447
- optionGroupProps = renderOpts.optionGroupProps;
448
- var cellValue = (0, _util.getCellValue)(row, column);
486
+ const {
487
+ row,
488
+ column
489
+ } = params;
490
+ const {
491
+ options,
492
+ optionProps,
493
+ optionGroups,
494
+ optionGroupProps
495
+ } = renderOpts;
496
+ const cellValue = (0, _util.getCellValue)(row, column);
449
497
  return [h(getDefaultComponent(renderOpts), {
450
498
  props: getCellEditProps(renderOpts, params, cellValue, {
451
- options: options,
452
- optionProps: optionProps,
453
- optionGroups: optionGroups,
454
- optionGroupProps: optionGroupProps
499
+ options,
500
+ optionProps,
501
+ optionGroups,
502
+ optionGroupProps
455
503
  }),
456
504
  on: getEditOns(renderOpts, params)
457
505
  })];
458
506
  }
459
507
  function defaultTreeSelectEditRender(h, renderOpts, params) {
460
- var row = params.row,
461
- column = params.column;
462
- var options = renderOpts.options,
463
- optionProps = renderOpts.optionProps;
464
- var cellValue = (0, _util.getCellValue)(row, column);
508
+ const {
509
+ row,
510
+ column
511
+ } = params;
512
+ const {
513
+ options,
514
+ optionProps
515
+ } = renderOpts;
516
+ const cellValue = (0, _util.getCellValue)(row, column);
465
517
  return [h(getDefaultComponent(renderOpts), {
466
518
  props: getCellEditProps(renderOpts, params, cellValue, {
467
- options: options,
468
- optionProps: optionProps
519
+ options,
520
+ optionProps
469
521
  }),
470
522
  on: getEditOns(renderOpts, params)
471
523
  })];
@@ -475,93 +527,100 @@ function defaultTreeSelectEditRender(h, renderOpts, params) {
475
527
  * @deprecated
476
528
  */
477
529
  function oldSelectEditRender(h, renderOpts, params) {
478
- var row = params.row,
479
- column = params.column;
480
- var options = renderOpts.options,
481
- optionProps = renderOpts.optionProps,
482
- optionGroups = renderOpts.optionGroups,
483
- optionGroupProps = renderOpts.optionGroupProps;
484
- var cellValue = (0, _util.getCellValue)(row, column);
530
+ const {
531
+ row,
532
+ column
533
+ } = params;
534
+ const {
535
+ options,
536
+ optionProps,
537
+ optionGroups,
538
+ optionGroupProps
539
+ } = renderOpts;
540
+ const cellValue = (0, _util.getCellValue)(row, column);
485
541
  return [h(getOldComponent(renderOpts), {
486
542
  props: getCellEditProps(renderOpts, params, cellValue, {
487
- options: options,
488
- optionProps: optionProps,
489
- optionGroups: optionGroups,
490
- optionGroupProps: optionGroupProps
543
+ options,
544
+ optionProps,
545
+ optionGroups,
546
+ optionGroupProps
491
547
  }),
492
548
  on: getEditOns(renderOpts, params)
493
549
  })];
494
550
  }
495
- function getSelectCellValue(renderOpts, _ref6) {
496
- var row = _ref6.row,
497
- column = _ref6.column;
498
- var options = renderOpts.options,
499
- optionGroups = renderOpts.optionGroups,
500
- _renderOpts$optionPro2 = renderOpts.optionProps,
501
- optionProps = _renderOpts$optionPro2 === void 0 ? {} : _renderOpts$optionPro2,
502
- _renderOpts$optionGro2 = renderOpts.optionGroupProps,
503
- optionGroupProps = _renderOpts$optionGro2 === void 0 ? {} : _renderOpts$optionGro2;
504
- var cellValue = _xeUtils.default.get(row, column.field);
505
- var selectItem;
506
- var labelProp = optionProps.label || 'label';
507
- var valueProp = optionProps.value || 'value';
551
+ function getSelectCellValue(renderOpts, {
552
+ row,
553
+ column
554
+ }) {
555
+ const {
556
+ options,
557
+ optionGroups,
558
+ optionProps = {},
559
+ optionGroupProps = {}
560
+ } = renderOpts;
561
+ const cellValue = _xeUtils.default.get(row, column.field);
562
+ let selectItem;
563
+ const labelProp = optionProps.label || 'label';
564
+ const valueProp = optionProps.value || 'value';
508
565
  if (!(cellValue === null || cellValue === undefined)) {
509
- return _xeUtils.default.map(_xeUtils.default.isArray(cellValue) ? cellValue : [cellValue], optionGroups ? function (value) {
510
- var groupOptions = optionGroupProps.options || 'options';
511
- for (var index = 0; index < optionGroups.length; index++) {
566
+ return _xeUtils.default.map(_xeUtils.default.isArray(cellValue) ? cellValue : [cellValue], optionGroups ? value => {
567
+ const groupOptions = optionGroupProps.options || 'options';
568
+ for (let index = 0; index < optionGroups.length; index++) {
512
569
  /* eslint-disable eqeqeq */
513
- selectItem = _xeUtils.default.find(optionGroups[index][groupOptions], function (item) {
514
- return item[valueProp] == value;
515
- });
570
+ selectItem = _xeUtils.default.find(optionGroups[index][groupOptions], item => item[valueProp] == value);
516
571
  if (selectItem) {
517
572
  break;
518
573
  }
519
574
  }
520
575
  return selectItem ? selectItem[labelProp] : value;
521
- } : function (value) {
576
+ } : value => {
522
577
  /* eslint-disable eqeqeq */
523
- selectItem = _xeUtils.default.find(options, function (item) {
524
- return item[valueProp] == value;
525
- });
578
+ selectItem = _xeUtils.default.find(options, item => item[valueProp] == value);
526
579
  return selectItem ? selectItem[labelProp] : value;
527
580
  }).join(', ');
528
581
  }
529
582
  return '';
530
583
  }
531
584
  function handleExportSelectMethod(params) {
532
- var row = params.row,
533
- column = params.column,
534
- options = params.options;
585
+ const {
586
+ row,
587
+ column,
588
+ options
589
+ } = params;
535
590
  return options.original ? (0, _util.getCellValue)(row, column) : getSelectCellValue(column.editRender || column.cellRender, params);
536
591
  }
537
- function getTreeSelectCellValue(renderOpts, _ref7) {
538
- var row = _ref7.row,
539
- column = _ref7.column;
540
- var options = renderOpts.options,
541
- _renderOpts$optionPro3 = renderOpts.optionProps,
542
- optionProps = _renderOpts$optionPro3 === void 0 ? {} : _renderOpts$optionPro3;
543
- var cellValue = _xeUtils.default.get(row, column.field);
544
- var labelProp = optionProps.label || 'label';
545
- var valueProp = optionProps.value || 'value';
546
- var childrenProp = optionProps.children || 'children';
592
+ function getTreeSelectCellValue(renderOpts, {
593
+ row,
594
+ column
595
+ }) {
596
+ const {
597
+ options,
598
+ optionProps = {}
599
+ } = renderOpts;
600
+ const cellValue = _xeUtils.default.get(row, column.field);
601
+ const labelProp = optionProps.label || 'label';
602
+ const valueProp = optionProps.value || 'value';
603
+ const childrenProp = optionProps.children || 'children';
547
604
  if (!(cellValue === null || cellValue === undefined)) {
548
- var keyMaps = {};
549
- _xeUtils.default.eachTree(options, function (item) {
605
+ const keyMaps = {};
606
+ _xeUtils.default.eachTree(options, item => {
550
607
  keyMaps[_xeUtils.default.get(item, valueProp)] = item;
551
608
  }, {
552
609
  children: childrenProp
553
610
  });
554
- return _xeUtils.default.map(_xeUtils.default.isArray(cellValue) ? cellValue : [cellValue], function (value) {
555
- var item = keyMaps[value];
611
+ return _xeUtils.default.map(_xeUtils.default.isArray(cellValue) ? cellValue : [cellValue], value => {
612
+ const item = keyMaps[value];
556
613
  return item ? _xeUtils.default.get(item, labelProp) : item;
557
614
  }).join(', ');
558
615
  }
559
616
  return '';
560
617
  }
561
618
  function handleExportTreeSelectMethod(params) {
562
- var row = params.row,
563
- column = params.column,
564
- options = params.options;
619
+ const {
620
+ row,
621
+ column,
622
+ options
623
+ } = params;
565
624
  return options.original ? (0, _util.getCellValue)(row, column) : getTreeSelectCellValue(column.editRender || column.cellRender, params);
566
625
  }
567
626
  /**
@@ -582,12 +641,14 @@ renderer.mixin({
582
641
  select: {
583
642
  renderTableEdit: nativeSelectEditRender,
584
643
  renderTableDefault: nativeSelectEditRender,
585
- renderTableCell: function renderTableCell(h, renderOpts, params) {
644
+ renderTableCell(h, renderOpts, params) {
586
645
  return getCellLabelVNs(h, renderOpts, params, getSelectCellValue(renderOpts, params));
587
646
  },
588
- renderTableFilter: function renderTableFilter(h, renderOpts, params) {
589
- var column = params.column;
590
- return column.filters.map(function (option, oIndex) {
647
+ renderTableFilter(h, renderOpts, params) {
648
+ const {
649
+ column
650
+ } = params;
651
+ return column.filters.map((option, oIndex) => {
591
652
  return h('select', {
592
653
  key: oIndex,
593
654
  class: 'vxe-default-select',
@@ -602,14 +663,17 @@ renderer.mixin({
602
663
  VxeInput: {
603
664
  tableAutoFocus: 'input',
604
665
  renderTableEdit: defaultEditRender,
605
- renderTableCell: function renderTableCell(h, renderOpts, params) {
666
+ renderTableCell(h, renderOpts, params) {
606
667
  var _a;
607
- var _renderOpts$props = renderOpts.props,
608
- props = _renderOpts$props === void 0 ? {} : _renderOpts$props;
609
- var row = params.row,
610
- column = params.column;
611
- var digits = props.digits || ((_a = getConfig().input) === null || _a === void 0 ? void 0 : _a.digits) || 2;
612
- var cellValue = _xeUtils.default.get(row, column.field);
668
+ const {
669
+ props = {}
670
+ } = renderOpts;
671
+ const {
672
+ row,
673
+ column
674
+ } = params;
675
+ const digits = props.digits || ((_a = getConfig().input) === null || _a === void 0 ? void 0 : _a.digits) || 2;
676
+ let cellValue = _xeUtils.default.get(row, column.field);
613
677
  if (cellValue) {
614
678
  switch (props.type) {
615
679
  case 'date':
@@ -633,14 +697,17 @@ renderer.mixin({
633
697
  VxeNumberInput: {
634
698
  tableAutoFocus: 'input',
635
699
  renderTableEdit: defaultEditRender,
636
- renderTableCell: function renderTableCell(h, renderOpts, params) {
700
+ renderTableCell(h, renderOpts, params) {
637
701
  var _a;
638
- var _renderOpts$props2 = renderOpts.props,
639
- props = _renderOpts$props2 === void 0 ? {} : _renderOpts$props2;
640
- var row = params.row,
641
- column = params.column;
642
- var digits = props.digits || ((_a = getConfig().numberInput) === null || _a === void 0 ? void 0 : _a.digits) || 2;
643
- var cellValue = _xeUtils.default.get(row, column.field);
702
+ const {
703
+ props = {}
704
+ } = renderOpts;
705
+ const {
706
+ row,
707
+ column
708
+ } = params;
709
+ const digits = props.digits || ((_a = getConfig().numberInput) === null || _a === void 0 ? void 0 : _a.digits) || 2;
710
+ let cellValue = _xeUtils.default.get(row, column.field);
644
711
  if (cellValue) {
645
712
  switch (props.type) {
646
713
  case 'float':
@@ -657,22 +724,17 @@ renderer.mixin({
657
724
  VxeDatePicker: {
658
725
  tableAutoFocus: 'input',
659
726
  renderTableEdit: defaultEditRender,
660
- renderTableCell: function renderTableCell(h, renderOpts, params) {
661
- var _renderOpts$props3 = renderOpts.props,
662
- props = _renderOpts$props3 === void 0 ? {} : _renderOpts$props3;
663
- var row = params.row,
664
- column = params.column;
665
- var cellValue = _xeUtils.default.get(row, column.field);
727
+ renderTableCell(h, renderOpts, params) {
728
+ const {
729
+ props = {}
730
+ } = renderOpts;
731
+ const {
732
+ row,
733
+ column
734
+ } = params;
735
+ let cellValue = _xeUtils.default.get(row, column.field);
666
736
  if (cellValue) {
667
- switch (props.type) {
668
- case 'date':
669
- case 'week':
670
- case 'month':
671
- case 'quarter':
672
- case 'year':
673
- cellValue = getLabelFormatDate(cellValue, props);
674
- break;
675
- }
737
+ cellValue = getLabelFormatDate(cellValue, props);
676
738
  }
677
739
  return getCellLabelVNs(h, renderOpts, params, cellValue);
678
740
  },
@@ -681,17 +743,20 @@ renderer.mixin({
681
743
  tableFilterDefaultMethod: handleFilterMethod
682
744
  },
683
745
  VxeTextarea: {
684
- tableAutoFocus: 'VxeTextarea'
746
+ tableAutoFocus: 'textarea',
747
+ renderTableEdit: defaultEditRender
685
748
  },
686
749
  VxeButton: {
687
750
  renderTableDefault: buttonCellRender
688
751
  },
689
752
  VxeButtonGroup: {
690
- renderTableDefault: function renderTableDefault(h, renderOpts, params) {
691
- var options = renderOpts.options;
753
+ renderTableDefault(h, renderOpts, params) {
754
+ const {
755
+ options
756
+ } = renderOpts;
692
757
  return [h(getDefaultComponent(renderOpts), {
693
758
  props: Object.assign({
694
- options: options
759
+ options
695
760
  }, getCellEditProps(renderOpts, params, null)),
696
761
  on: getComponentOns(renderOpts, params)
697
762
  })];
@@ -701,24 +766,28 @@ renderer.mixin({
701
766
  tableAutoFocus: 'input',
702
767
  renderTableEdit: defaultSelectEditRender,
703
768
  renderTableDefault: defaultSelectEditRender,
704
- renderTableCell: function renderTableCell(h, renderOpts, params) {
769
+ renderTableCell(h, renderOpts, params) {
705
770
  return getCellLabelVNs(h, renderOpts, params, getSelectCellValue(renderOpts, params));
706
771
  },
707
- renderTableFilter: function renderTableFilter(h, renderOpts, params) {
708
- var column = params.column;
709
- var options = renderOpts.options,
710
- optionProps = renderOpts.optionProps,
711
- optionGroups = renderOpts.optionGroups,
712
- optionGroupProps = renderOpts.optionGroupProps;
713
- return column.filters.map(function (option, oIndex) {
714
- var optionValue = option.data;
772
+ renderTableFilter(h, renderOpts, params) {
773
+ const {
774
+ column
775
+ } = params;
776
+ const {
777
+ options,
778
+ optionProps,
779
+ optionGroups,
780
+ optionGroupProps
781
+ } = renderOpts;
782
+ return column.filters.map((option, oIndex) => {
783
+ const optionValue = option.data;
715
784
  return h(getDefaultComponent(renderOpts), Object.assign(Object.assign({
716
785
  key: oIndex
717
786
  }, getCellEditFilterProps(renderOpts, params, optionValue, {
718
- options: options,
719
- optionProps: optionProps,
720
- optionGroups: optionGroups,
721
- optionGroupProps: optionGroupProps
787
+ options,
788
+ optionProps,
789
+ optionGroups,
790
+ optionGroupProps
722
791
  })), getFilterOns(renderOpts, params, option)));
723
792
  });
724
793
  },
@@ -728,7 +797,7 @@ renderer.mixin({
728
797
  VxeTreeSelect: {
729
798
  tableAutoFocus: 'input',
730
799
  renderTableEdit: defaultTreeSelectEditRender,
731
- renderTableCell: function renderTableCell(h, renderOpts, params) {
800
+ renderTableCell(h, renderOpts, params) {
732
801
  return getCellLabelVNs(h, renderOpts, params, getTreeSelectCellValue(renderOpts, params));
733
802
  },
734
803
  tableExportMethod: handleExportTreeSelectMethod
@@ -736,10 +805,12 @@ renderer.mixin({
736
805
  VxeIconPicker: {
737
806
  tableAutoFocus: 'input',
738
807
  renderTableEdit: defaultEditRender,
739
- renderTableCell: function renderTableCell(h, renderOpts, params) {
740
- var row = params.row,
741
- column = params.column;
742
- var cellValue = _xeUtils.default.get(row, column.field);
808
+ renderTableCell(h, renderOpts, params) {
809
+ const {
810
+ row,
811
+ column
812
+ } = params;
813
+ const cellValue = _xeUtils.default.get(row, column.field);
743
814
  return h('i', {
744
815
  class: cellValue
745
816
  });
@@ -762,11 +833,15 @@ renderer.mixin({
762
833
  renderTableDefault: defaultEditRender
763
834
  },
764
835
  VxeImage: {
765
- renderTableDefault: function renderTableDefault(h, renderOpts, params) {
766
- var row = params.row,
767
- column = params.column;
768
- var props = renderOpts.props;
769
- var cellValue = (0, _util.getCellValue)(row, column);
836
+ renderTableDefault(h, renderOpts, params) {
837
+ const {
838
+ row,
839
+ column
840
+ } = params;
841
+ const {
842
+ props
843
+ } = renderOpts;
844
+ const cellValue = (0, _util.getCellValue)(row, column);
770
845
  return [h(getDefaultComponent(renderOpts), {
771
846
  props: Object.assign(Object.assign({}, props), {
772
847
  src: cellValue
@@ -776,11 +851,15 @@ renderer.mixin({
776
851
  }
777
852
  },
778
853
  VxeImageGroup: {
779
- renderTableDefault: function renderTableDefault(h, renderOpts, params) {
780
- var row = params.row,
781
- column = params.column;
782
- var props = renderOpts.props;
783
- var cellValue = (0, _util.getCellValue)(row, column);
854
+ renderTableDefault(h, renderOpts, params) {
855
+ const {
856
+ row,
857
+ column
858
+ } = params;
859
+ const {
860
+ props
861
+ } = renderOpts;
862
+ const cellValue = (0, _util.getCellValue)(row, column);
784
863
  return [h(getDefaultComponent(renderOpts), {
785
864
  props: Object.assign(Object.assign({}, props), {
786
865
  urlList: cellValue
@@ -789,18 +868,39 @@ renderer.mixin({
789
868
  })];
790
869
  }
791
870
  },
871
+ VxeTextEllipsis: {
872
+ renderTableDefault(h, renderOpts, params) {
873
+ const {
874
+ row,
875
+ column
876
+ } = params;
877
+ const {
878
+ props
879
+ } = renderOpts;
880
+ const cellValue = (0, _util.getCellValue)(row, column);
881
+ return [h(getDefaultComponent(renderOpts), {
882
+ props: Object.assign(Object.assign({}, props), {
883
+ content: cellValue
884
+ }),
885
+ on: getEditOns(renderOpts, params)
886
+ })];
887
+ }
888
+ },
792
889
  // 以下已废弃
793
890
  $input: {
794
891
  tableAutoFocus: '.vxe-input--inner',
795
892
  renderTableEdit: oldEditRender,
796
- renderTableCell: function renderTableCell(h, renderOpts, params) {
893
+ renderTableCell(h, renderOpts, params) {
797
894
  var _a;
798
- var _renderOpts$props4 = renderOpts.props,
799
- props = _renderOpts$props4 === void 0 ? {} : _renderOpts$props4;
800
- var row = params.row,
801
- column = params.column;
802
- var digits = props.digits || ((_a = getConfig().input) === null || _a === void 0 ? void 0 : _a.digits) || 2;
803
- var cellValue = _xeUtils.default.get(row, column.field);
895
+ const {
896
+ props = {}
897
+ } = renderOpts;
898
+ const {
899
+ row,
900
+ column
901
+ } = params;
902
+ const digits = props.digits || ((_a = getConfig().input) === null || _a === void 0 ? void 0 : _a.digits) || 2;
903
+ let cellValue = _xeUtils.default.get(row, column.field);
804
904
  if (cellValue) {
805
905
  switch (props.type) {
806
906
  case 'date':
@@ -833,24 +933,28 @@ renderer.mixin({
833
933
  tableAutoFocus: '.vxe-input--inner',
834
934
  renderTableEdit: oldSelectEditRender,
835
935
  renderTableDefault: oldSelectEditRender,
836
- renderTableCell: function renderTableCell(h, renderOpts, params) {
936
+ renderTableCell(h, renderOpts, params) {
837
937
  return getCellLabelVNs(h, renderOpts, params, getSelectCellValue(renderOpts, params));
838
938
  },
839
- renderTableFilter: function renderTableFilter(h, renderOpts, params) {
840
- var column = params.column;
841
- var options = renderOpts.options,
842
- optionProps = renderOpts.optionProps,
843
- optionGroups = renderOpts.optionGroups,
844
- optionGroupProps = renderOpts.optionGroupProps;
845
- return column.filters.map(function (option, oIndex) {
846
- var optionValue = option.data;
939
+ renderTableFilter(h, renderOpts, params) {
940
+ const {
941
+ column
942
+ } = params;
943
+ const {
944
+ options,
945
+ optionProps,
946
+ optionGroups,
947
+ optionGroupProps
948
+ } = renderOpts;
949
+ return column.filters.map((option, oIndex) => {
950
+ const optionValue = option.data;
847
951
  return h(getOldComponent(renderOpts), {
848
952
  key: oIndex,
849
953
  props: getCellEditFilterProps(renderOpts, params, optionValue, {
850
- options: options,
851
- optionProps: optionProps,
852
- optionGroups: optionGroups,
853
- optionGroupProps: optionGroupProps
954
+ options,
955
+ optionProps,
956
+ optionGroups,
957
+ optionGroupProps
854
958
  }),
855
959
  on: getFilterOns(renderOpts, params, option)
856
960
  });