vxe-table 3.6.6 → 3.6.8

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 (230) hide show
  1. package/lib/all.js +11 -82
  2. package/lib/all.min.js +1 -1
  3. package/lib/button/index.js +0 -3
  4. package/lib/button/src/button.js +39 -82
  5. package/lib/button/src/button.min.js +1 -1
  6. package/lib/button/style/style.css +475 -349
  7. package/lib/button/style/style.min.css +1 -1
  8. package/lib/checkbox/index.js +0 -3
  9. package/lib/checkbox/src/checkbox.js +15 -29
  10. package/lib/checkbox/src/checkbox.min.js +1 -1
  11. package/lib/checkbox/src/group.js +4 -12
  12. package/lib/checkbox/style/style.css +158 -128
  13. package/lib/checkbox/style/style.min.css +1 -1
  14. package/lib/checkbox-group/index.js +0 -3
  15. package/lib/checkbox-group/style/style.css +1 -1
  16. package/lib/colgroup/index.js +2 -5
  17. package/lib/colgroup/style/style.css +1 -1
  18. package/lib/column/index.js +2 -5
  19. package/lib/column/style/style.css +1 -1
  20. package/lib/edit/index.js +0 -6
  21. package/lib/edit/src/mixin.js +91 -252
  22. package/lib/edit/src/mixin.min.js +1 -1
  23. package/lib/edit/style/style.css +1 -1
  24. package/lib/export/index.js +1 -16
  25. package/lib/export/index.min.js +1 -1
  26. package/lib/export/src/export-panel.js +16 -41
  27. package/lib/export/src/export-panel.min.js +1 -1
  28. package/lib/export/src/import-panel.js +5 -19
  29. package/lib/export/src/import-panel.min.js +1 -1
  30. package/lib/export/src/mixin.js +105 -387
  31. package/lib/export/src/mixin.min.js +1 -1
  32. package/lib/export/style/style.css +138 -105
  33. package/lib/filter/index.js +0 -8
  34. package/lib/filter/src/mixin.js +18 -66
  35. package/lib/filter/src/mixin.min.js +1 -1
  36. package/lib/filter/src/panel.js +10 -22
  37. package/lib/filter/src/panel.min.js +1 -1
  38. package/lib/filter/style/style.css +105 -81
  39. package/lib/footer/index.js +0 -3
  40. package/lib/footer/src/footer.js +52 -84
  41. package/lib/footer/src/footer.min.js +1 -1
  42. package/lib/footer/style/style.css +1 -1
  43. package/lib/form/index.js +0 -3
  44. package/lib/form/src/form-config-item.js +23 -40
  45. package/lib/form/src/form-config-item.min.js +1 -1
  46. package/lib/form/src/form-gather.js +0 -5
  47. package/lib/form/src/form-item.js +18 -35
  48. package/lib/form/src/form-item.min.js +1 -1
  49. package/lib/form/src/form.js +45 -137
  50. package/lib/form/src/form.min.js +1 -1
  51. package/lib/form/src/render.js +7 -22
  52. package/lib/form/src/render.min.js +1 -1
  53. package/lib/form/src/util.js +9 -42
  54. package/lib/form/src/util.min.js +1 -1
  55. package/lib/form/style/style.css +227 -185
  56. package/lib/form-gather/index.js +0 -3
  57. package/lib/form-gather/style/style.css +1 -1
  58. package/lib/form-item/index.js +0 -3
  59. package/lib/form-item/style/style.css +1 -1
  60. package/lib/grid/index.js +0 -4
  61. package/lib/grid/src/grid.js +87 -261
  62. package/lib/grid/src/grid.min.js +1 -1
  63. package/lib/grid/style/style.css +62 -50
  64. package/lib/header/index.js +0 -3
  65. package/lib/header/src/header.js +54 -87
  66. package/lib/header/src/header.min.js +1 -1
  67. package/lib/header/src/util.js +0 -17
  68. package/lib/header/src/util.min.js +1 -1
  69. package/lib/header/style/style.css +1 -1
  70. package/lib/icon/index.js +0 -3
  71. package/lib/icon/style/iconfont.1669391208345.ttf +0 -0
  72. package/lib/icon/style/iconfont.1669391208345.woff +0 -0
  73. package/lib/icon/style/iconfont.1669391208345.woff2 +0 -0
  74. package/lib/icon/style/style.css +384 -197
  75. package/lib/icon/style/style.min.css +738 -1
  76. package/lib/iconfont.1669391208345.ttf +0 -0
  77. package/lib/iconfont.1669391208345.woff +0 -0
  78. package/lib/iconfont.1669391208345.woff2 +0 -0
  79. package/lib/index.common.js +1 -7
  80. package/lib/index.common.min.js +1 -1
  81. package/lib/index.css +1 -1
  82. package/lib/index.umd.js +11884 -13141
  83. package/lib/index.umd.min.js +1 -1
  84. package/lib/input/index.js +0 -3
  85. package/lib/input/src/date.js +0 -10
  86. package/lib/input/src/date.min.js +1 -1
  87. package/lib/input/src/input.js +208 -473
  88. package/lib/input/src/input.min.js +1 -1
  89. package/lib/input/src/number.js +0 -5
  90. package/lib/input/style/style.css +820 -611
  91. package/lib/keyboard/index.js +0 -6
  92. package/lib/keyboard/src/mixin.js +35 -111
  93. package/lib/keyboard/src/mixin.min.js +1 -1
  94. package/lib/keyboard/style/style.css +1 -1
  95. package/lib/list/index.js +0 -3
  96. package/lib/list/src/list.js +23 -64
  97. package/lib/list/src/list.min.js +1 -1
  98. package/lib/list/style/style.css +19 -14
  99. package/lib/loading/index.js +0 -3
  100. package/lib/loading/index.min.js +1 -1
  101. package/lib/loading/src/loading.js +1 -4
  102. package/lib/loading/style/style.css +60 -45
  103. package/lib/locale/lang/zh-HK.js +0 -3
  104. package/lib/locale/lang/zh-MO.js +0 -3
  105. package/lib/locale/lang/zh-TW.js +0 -3
  106. package/lib/menu/index.js +0 -8
  107. package/lib/menu/src/mixin.js +38 -100
  108. package/lib/menu/src/mixin.min.js +1 -1
  109. package/lib/menu/src/panel.js +2 -5
  110. package/lib/menu/style/style.css +74 -55
  111. package/lib/mixins/size.js +1 -1
  112. package/lib/modal/index.js +3 -21
  113. package/lib/modal/index.min.js +1 -1
  114. package/lib/modal/src/modal.js +97 -254
  115. package/lib/modal/src/modal.min.js +1 -1
  116. package/lib/modal/style/style.css +346 -280
  117. package/lib/modal/style/style.min.css +1 -1
  118. package/lib/optgroup/index.js +0 -3
  119. package/lib/optgroup/style/style.css +1 -1
  120. package/lib/option/index.js +0 -3
  121. package/lib/option/style/style.css +1 -1
  122. package/lib/pager/index.js +0 -3
  123. package/lib/pager/src/pager.js +13 -41
  124. package/lib/pager/src/pager.min.js +1 -1
  125. package/lib/pager/style/style.css +314 -262
  126. package/lib/pulldown/index.js +0 -3
  127. package/lib/pulldown/src/pulldown.js +29 -72
  128. package/lib/pulldown/src/pulldown.min.js +1 -1
  129. package/lib/pulldown/style/style.css +51 -39
  130. package/lib/radio/index.js +0 -3
  131. package/lib/radio/src/button.js +11 -22
  132. package/lib/radio/src/group.js +2 -6
  133. package/lib/radio/src/radio.js +11 -23
  134. package/lib/radio/style/style.css +186 -152
  135. package/lib/radio/style/style.min.css +1 -1
  136. package/lib/radio-button/index.js +0 -3
  137. package/lib/radio-button/style/style.css +1 -1
  138. package/lib/radio-group/index.js +0 -3
  139. package/lib/radio-group/style/style.css +1 -1
  140. package/lib/select/index.js +0 -5
  141. package/lib/select/src/optgroup.js +0 -2
  142. package/lib/select/src/optgroup.min.js +1 -1
  143. package/lib/select/src/option.js +0 -2
  144. package/lib/select/src/option.min.js +1 -1
  145. package/lib/select/src/select.js +79 -211
  146. package/lib/select/src/select.min.js +1 -1
  147. package/lib/select/src/util.js +5 -24
  148. package/lib/select/src/util.min.js +1 -1
  149. package/lib/select/style/style.css +120 -89
  150. package/lib/style.css +1 -1
  151. package/lib/style.min.css +1 -1
  152. package/lib/switch/index.js +0 -3
  153. package/lib/switch/src/switch.js +7 -20
  154. package/lib/switch/src/switch.min.js +1 -1
  155. package/lib/switch/style/style.css +92 -71
  156. package/lib/table/index.js +0 -9
  157. package/lib/table/src/body.js +167 -261
  158. package/lib/table/src/body.min.js +1 -1
  159. package/lib/table/src/cell.js +107 -222
  160. package/lib/table/src/cell.min.js +1 -1
  161. package/lib/table/src/column.js +2 -4
  162. package/lib/table/src/column.min.js +1 -1
  163. package/lib/table/src/columnInfo.js +6 -35
  164. package/lib/table/src/columnInfo.min.js +1 -1
  165. package/lib/table/src/group.js +0 -3
  166. package/lib/table/src/methods.js +570 -1461
  167. package/lib/table/src/methods.min.js +1 -1
  168. package/lib/table/src/table.js +123 -231
  169. package/lib/table/src/table.min.js +1 -1
  170. package/lib/table/src/util.js +28 -105
  171. package/lib/table/src/util.min.js +1 -1
  172. package/lib/table/style/style.css +1080 -863
  173. package/lib/table/style/style.min.css +1 -1
  174. package/lib/textarea/index.js +0 -3
  175. package/lib/textarea/src/textarea.js +23 -55
  176. package/lib/textarea/src/textarea.min.js +1 -1
  177. package/lib/textarea/style/style.css +66 -45
  178. package/lib/toolbar/index.js +0 -3
  179. package/lib/toolbar/src/toolbar.js +43 -117
  180. package/lib/toolbar/src/toolbar.min.js +1 -1
  181. package/lib/toolbar/style/style.css +232 -187
  182. package/lib/tools/dom.js +7 -42
  183. package/lib/tools/dom.min.js +1 -1
  184. package/lib/tools/event.js +4 -14
  185. package/lib/tools/event.min.js +1 -1
  186. package/lib/tools/log.js +1 -6
  187. package/lib/tools/log.min.js +1 -1
  188. package/lib/tools/resize.js +3 -24
  189. package/lib/tools/resize.min.js +1 -1
  190. package/lib/tools/utils.js +7 -29
  191. package/lib/tools/utils.min.js +1 -1
  192. package/lib/tools/vn.js +0 -4
  193. package/lib/tooltip/index.js +0 -4
  194. package/lib/tooltip/src/tooltip.js +29 -76
  195. package/lib/tooltip/src/tooltip.min.js +1 -1
  196. package/lib/tooltip/style/style.css +88 -64
  197. package/lib/v-x-e-table/index.js +6 -41
  198. package/lib/v-x-e-table/index.min.js +1 -1
  199. package/lib/v-x-e-table/src/commands.js +0 -4
  200. package/lib/v-x-e-table/src/conf.js +30 -18
  201. package/lib/v-x-e-table/src/formats.js +0 -4
  202. package/lib/v-x-e-table/src/interceptor.js +4 -15
  203. package/lib/v-x-e-table/src/menus.js +0 -4
  204. package/lib/v-x-e-table/src/renderer.js +62 -169
  205. package/lib/v-x-e-table/src/renderer.min.js +1 -1
  206. package/lib/v-x-e-table/src/setup.js +0 -4
  207. package/lib/v-x-e-table/src/store.js +3 -16
  208. package/lib/v-x-e-table/src/store.min.js +1 -1
  209. package/lib/v-x-e-table/style/style.css +444 -242
  210. package/lib/v-x-e-table/style/style.min.css +1 -1
  211. package/lib/validator/index.js +0 -6
  212. package/lib/validator/src/mixin.js +31 -100
  213. package/lib/validator/src/mixin.min.js +1 -1
  214. package/lib/validator/style/style.css +1 -1
  215. package/lib/vxe-table/style/style.css +1 -1
  216. package/package.json +28 -29
  217. package/packages/export/src/mixin.js +2 -1
  218. package/packages/filter/src/mixin.js +1 -1
  219. package/packages/form/src/form.js +5 -4
  220. package/packages/grid/src/grid.js +14 -14
  221. package/packages/table/src/column.js +2 -0
  222. package/packages/table/src/columnInfo.js +1 -0
  223. package/packages/table/src/methods.js +18 -18
  224. package/styles/icon/iconfont.ttf +0 -0
  225. package/styles/icon/iconfont.woff +0 -0
  226. package/styles/icon/iconfont.woff2 +0 -0
  227. package/styles/icon.scss +9 -1
  228. package/styles/table.scss +1 -1
  229. package/styles/variable.scss +2 -2
  230. package/types/column.d.ts +3 -0
@@ -1,32 +1,20 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4
-
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = void 0;
9
-
10
8
  var _xeUtils = _interopRequireDefault(require("xe-utils"));
11
-
12
9
  var _conf = _interopRequireDefault(require("../../v-x-e-table/src/conf"));
13
-
14
10
  var _size = _interopRequireDefault(require("../../mixins/size"));
15
-
16
11
  var _utils = _interopRequireWildcard(require("../../tools/utils"));
17
-
18
12
  var _dom = _interopRequireDefault(require("../../tools/dom"));
19
-
20
13
  var _event = require("../../tools/event");
21
-
22
14
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
23
-
24
15
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
25
-
26
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
27
-
28
17
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
29
-
30
18
  var _default2 = {
31
19
  name: 'VxeButton',
32
20
  mixins: [_size.default],
@@ -82,7 +70,6 @@ var _default2 = {
82
70
  },
83
71
  beforeDestroy: function beforeDestroy() {
84
72
  var panelElem = this.$refs.panel;
85
-
86
73
  if (panelElem && panelElem.parentNode) {
87
74
  panelElem.parentNode.removeChild(panelElem);
88
75
  }
@@ -92,27 +79,26 @@ var _default2 = {
92
79
  },
93
80
  render: function render(h) {
94
81
  var _ref,
95
- _ref2,
96
- _this = this,
97
- _ref3,
98
- _ref4;
99
-
82
+ _ref2,
83
+ _this = this,
84
+ _ref3,
85
+ _ref4;
100
86
  var $scopedSlots = this.$scopedSlots,
101
- $listeners = this.$listeners,
102
- className = this.className,
103
- inited = this.inited,
104
- type = this.type,
105
- destroyOnClose = this.destroyOnClose,
106
- isFormBtn = this.isFormBtn,
107
- status = this.status,
108
- btnType = this.btnType,
109
- vSize = this.vSize,
110
- name = this.name,
111
- disabled = this.disabled,
112
- loading = this.loading,
113
- showPanel = this.showPanel,
114
- animatVisible = this.animatVisible,
115
- panelPlacement = this.panelPlacement;
87
+ $listeners = this.$listeners,
88
+ className = this.className,
89
+ inited = this.inited,
90
+ type = this.type,
91
+ destroyOnClose = this.destroyOnClose,
92
+ isFormBtn = this.isFormBtn,
93
+ status = this.status,
94
+ btnType = this.btnType,
95
+ vSize = this.vSize,
96
+ name = this.name,
97
+ disabled = this.disabled,
98
+ loading = this.loading,
99
+ showPanel = this.showPanel,
100
+ animatVisible = this.animatVisible,
101
+ panelPlacement = this.panelPlacement;
116
102
  var downsSlot = $scopedSlots.dropdowns;
117
103
  return downsSlot ? h('div', {
118
104
  class: ['vxe-button--dropdown', className, (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, 'is--active', showPanel), _ref)]
@@ -171,11 +157,10 @@ var _default2 = {
171
157
  methods: {
172
158
  renderContent: function renderContent(h) {
173
159
  var $scopedSlots = this.$scopedSlots,
174
- content = this.content,
175
- icon = this.icon,
176
- loading = this.loading;
160
+ content = this.content,
161
+ icon = this.icon,
162
+ loading = this.loading;
177
163
  var contents = [];
178
-
179
164
  if (loading) {
180
165
  contents.push(h('i', {
181
166
  class: ['vxe-button--loading-icon', _conf.default.icon.BUTTON_LOADING]
@@ -189,7 +174,6 @@ var _default2 = {
189
174
  class: ['vxe-button--icon', icon]
190
175
  }));
191
176
  }
192
-
193
177
  if ($scopedSlots.default) {
194
178
  contents.push(h('span', {
195
179
  class: 'vxe-button--content'
@@ -199,7 +183,6 @@ var _default2 = {
199
183
  class: 'vxe-button--content'
200
184
  }, [(0, _utils.getFuncText)(content)]));
201
185
  }
202
-
203
186
  return contents;
204
187
  },
205
188
  handleGlobalMousewheelEvent: function handleGlobalMousewheelEvent(evnt) {
@@ -214,26 +197,21 @@ var _default2 = {
214
197
  },
215
198
  mousedownDropdownEvent: function mousedownDropdownEvent(evnt) {
216
199
  var isLeftBtn = evnt.button === 0;
217
-
218
200
  if (isLeftBtn) {
219
201
  evnt.stopPropagation();
220
202
  }
221
203
  },
222
204
  clickDropdownEvent: function clickDropdownEvent(evnt) {
223
205
  var _this2 = this;
224
-
225
206
  var dropdownElem = evnt.currentTarget;
226
207
  var panelElem = this.$refs.panel;
227
-
228
208
  var _DomTools$getEventTar = _dom.default.getEventTargetNode(evnt, dropdownElem, 'vxe-button'),
229
- flag = _DomTools$getEventTar.flag,
230
- targetElem = _DomTools$getEventTar.targetElem;
231
-
209
+ flag = _DomTools$getEventTar.flag,
210
+ targetElem = _DomTools$getEventTar.targetElem;
232
211
  if (flag) {
233
212
  if (panelElem) {
234
213
  panelElem.dataset.active = 'N';
235
214
  }
236
-
237
215
  this.showPanel = false;
238
216
  setTimeout(function () {
239
217
  if (!panelElem || panelElem.dataset.active !== 'Y') {
@@ -248,18 +226,14 @@ var _default2 = {
248
226
  },
249
227
  mouseenterTargetEvent: function mouseenterTargetEvent() {
250
228
  var _this3 = this;
251
-
252
229
  var panelElem = this.$refs.panel;
253
230
  panelElem.dataset.active = 'Y';
254
-
255
231
  if (!this.inited) {
256
232
  this.inited = true;
257
-
258
233
  if (this.transfer) {
259
234
  document.body.appendChild(panelElem);
260
235
  }
261
236
  }
262
-
263
237
  this.showTime = setTimeout(function () {
264
238
  if (panelElem.dataset.active === 'Y') {
265
239
  _this3.mouseenterEvent();
@@ -270,18 +244,14 @@ var _default2 = {
270
244
  },
271
245
  mouseenterEvent: function mouseenterEvent() {
272
246
  var _this4 = this;
273
-
274
247
  var panelElem = this.$refs.panel;
275
248
  panelElem.dataset.active = 'Y';
276
249
  this.animatVisible = true;
277
250
  setTimeout(function () {
278
251
  if (panelElem.dataset.active === 'Y') {
279
252
  _this4.showPanel = true;
280
-
281
253
  _this4.updateZindex();
282
-
283
254
  _this4.updatePlacement();
284
-
285
255
  setTimeout(function () {
286
256
  if (_this4.showPanel) {
287
257
  _this4.updatePlacement();
@@ -295,10 +265,8 @@ var _default2 = {
295
265
  },
296
266
  closePanel: function closePanel() {
297
267
  var _this5 = this;
298
-
299
268
  var panelElem = this.$refs.panel;
300
269
  clearTimeout(this.showTime);
301
-
302
270
  if (panelElem) {
303
271
  panelElem.dataset.active = 'N';
304
272
  setTimeout(function () {
@@ -318,15 +286,13 @@ var _default2 = {
318
286
  },
319
287
  updatePlacement: function updatePlacement() {
320
288
  var _this6 = this;
321
-
322
289
  return this.$nextTick().then(function () {
323
290
  var $refs = _this6.$refs,
324
- transfer = _this6.transfer,
325
- placement = _this6.placement,
326
- panelIndex = _this6.panelIndex;
291
+ transfer = _this6.transfer,
292
+ placement = _this6.placement,
293
+ panelIndex = _this6.panelIndex;
327
294
  var targetElem = $refs.xBtn;
328
295
  var panelElem = $refs.panel;
329
-
330
296
  if (panelElem && targetElem) {
331
297
  var targetHeight = targetElem.offsetHeight;
332
298
  var targetWidth = targetElem.offsetWidth;
@@ -336,20 +302,16 @@ var _default2 = {
336
302
  var panelStyle = {
337
303
  zIndex: panelIndex
338
304
  };
339
-
340
305
  var _DomTools$getAbsolute = _dom.default.getAbsolutePos(targetElem),
341
- top = _DomTools$getAbsolute.top,
342
- left = _DomTools$getAbsolute.left,
343
- boundingTop = _DomTools$getAbsolute.boundingTop,
344
- visibleHeight = _DomTools$getAbsolute.visibleHeight,
345
- visibleWidth = _DomTools$getAbsolute.visibleWidth;
346
-
306
+ top = _DomTools$getAbsolute.top,
307
+ left = _DomTools$getAbsolute.left,
308
+ boundingTop = _DomTools$getAbsolute.boundingTop,
309
+ visibleHeight = _DomTools$getAbsolute.visibleHeight,
310
+ visibleWidth = _DomTools$getAbsolute.visibleWidth;
347
311
  var panelPlacement = 'bottom';
348
-
349
312
  if (transfer) {
350
313
  var btnLeft = left + targetWidth - panelWidth;
351
314
  var btnTop = top + targetHeight;
352
-
353
315
  if (placement === 'top') {
354
316
  panelPlacement = 'top';
355
317
  btnTop = top - panelHeight;
@@ -358,25 +320,21 @@ var _default2 = {
358
320
  if (boundingTop + targetHeight + panelHeight + marginSize > visibleHeight) {
359
321
  panelPlacement = 'top';
360
322
  btnTop = top - panelHeight;
361
- } // 如果上面不够放,则向下(优先)
362
-
363
-
323
+ }
324
+ // 如果上面不够放,则向下(优先)
364
325
  if (btnTop < marginSize) {
365
326
  panelPlacement = 'bottom';
366
327
  btnTop = top + targetHeight;
367
328
  }
368
- } // 如果溢出右边
369
-
370
-
329
+ }
330
+ // 如果溢出右边
371
331
  if (btnLeft + panelWidth + marginSize > visibleWidth) {
372
332
  btnLeft -= btnLeft + panelWidth + marginSize - visibleWidth;
373
- } // 如果溢出左边
374
-
375
-
333
+ }
334
+ // 如果溢出左边
376
335
  if (btnLeft < marginSize) {
377
336
  btnLeft = marginSize;
378
337
  }
379
-
380
338
  Object.assign(panelStyle, {
381
339
  left: "".concat(btnLeft, "px"),
382
340
  right: 'auto',
@@ -398,7 +356,6 @@ var _default2 = {
398
356
  }
399
357
  }
400
358
  }
401
-
402
359
  _this6.panelStyle = panelStyle;
403
360
  _this6.panelPlacement = panelPlacement;
404
361
  return _this6.$nextTick();
@@ -1 +1 @@
1
- "use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _xeUtils=_interopRequireDefault(require("xe-utils")),_conf=_interopRequireDefault(require("../../v-x-e-table/src/conf")),_size=_interopRequireDefault(require("../../mixins/size")),_utils=_interopRequireWildcard(require("../../tools/utils")),_dom=_interopRequireDefault(require("../../tools/dom")),_event=require("../../tools/event");function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(_getRequireWildcardCache=function(e){return e?n:t})(e)}function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==_typeof(e)&&"function"!=typeof e)return{default:e};t=_getRequireWildcardCache(t);if(t&&t.has(e))return t.get(e);var n,i,o={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&((i=s?Object.getOwnPropertyDescriptor(e,n):null)&&(i.get||i.set)?Object.defineProperty(o,n,i):o[n]=e[n]);return o.default=e,t&&t.set(e,o),o}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperty(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var _default2={name:"VxeButton",mixins:[_size.default],props:{type:String,size:{type:String,default:function(){return _conf.default.button.size||_conf.default.size}},name:[String,Number],content:String,placement:String,status:String,icon:String,round:Boolean,circle:Boolean,disabled:Boolean,loading:Boolean,destroyOnClose:Boolean,className:String,transfer:{type:Boolean,default:function(){return _conf.default.button.transfer}}},data:function(){return{inited:!1,showPanel:!1,animatVisible:!1,panelIndex:0,panelStyle:null,panelPlacement:null}},computed:{isText:function(){return"text"===this.type},isFormBtn:function(){return-1<["submit","reset","button"].indexOf(this.type)},btnType:function(){return this.isText?this.type:"button"}},created:function(){_event.GlobalEvent.on(this,"mousewheel",this.handleGlobalMousewheelEvent)},beforeDestroy:function(){var e=this.$refs.panel;e&&e.parentNode&&e.parentNode.removeChild(e)},destroyed:function(){_event.GlobalEvent.off(this,"mousewheel")},render:function(e){var n=this,t=this.$scopedSlots,i=this.$listeners,o=this.className,s=this.inited,r=this.type,a=this.destroyOnClose,u=this.isFormBtn,l=this.status,c=this.btnType,d=this.vSize,f=this.name,p=this.disabled,h=this.loading,m=this.showPanel,b=this.animatVisible,v=this.panelPlacement,y=t.dropdowns;return y?e("div",{class:["vxe-button--dropdown",o,(_defineProperty(t={},"size--".concat(d),d),_defineProperty(t,"is--active",m),t)]},[e("button",{ref:"xBtn",class:["vxe-button","type--".concat(c),(_defineProperty(t={},"size--".concat(d),d),_defineProperty(t,"theme--".concat(l),l),_defineProperty(t,"is--round",this.round),_defineProperty(t,"is--circle",this.circle),_defineProperty(t,"is--disabled",p||h),_defineProperty(t,"is--loading",h),t)],attrs:{name:f,type:u?r:"button",disabled:p||h},on:Object.assign({mouseenter:this.mouseenterTargetEvent,mouseleave:this.mouseleaveEvent},_xeUtils.default.objectMap(i,function(e,t){return function(e){return n.$emit(t,{$event:e})}}))},this.renderContent(e).concat([e("i",{class:"vxe-button--dropdown-arrow ".concat(_conf.default.icon.BUTTON_DROPDOWN)})])),e("div",{ref:"panel",class:["vxe-button--dropdown-panel",(_defineProperty(t={},"size--".concat(d),d),_defineProperty(t,"animat--leave",b),_defineProperty(t,"animat--enter",m),t)],attrs:{placement:v},style:this.panelStyle},s?[e("div",{class:"vxe-button--dropdown-wrapper",on:{mousedown:this.mousedownDropdownEvent,click:this.clickDropdownEvent,mouseenter:this.mouseenterEvent,mouseleave:this.mouseleaveEvent}},a&&!m?[]:y.call(this,{},e))]:null)]):e("button",{ref:"xBtn",class:["vxe-button","type--".concat(c),o,(_defineProperty(o={},"size--".concat(d),d),_defineProperty(o,"theme--".concat(l),l),_defineProperty(o,"is--round",this.round),_defineProperty(o,"is--circle",this.circle),_defineProperty(o,"is--disabled",p||h),_defineProperty(o,"is--loading",h),o)],attrs:{name:f,type:u?r:"button",disabled:p||h},on:_xeUtils.default.objectMap(i,function(e,t){return function(e){return n.$emit(t,{$event:e})}})},this.renderContent(e))},methods:{renderContent:function(e){var t=this.$scopedSlots,n=this.content,i=this.icon,o=[];return this.loading?o.push(e("i",{class:["vxe-button--loading-icon",_conf.default.icon.BUTTON_LOADING]})):t.icon?o.push(e("span",{class:"vxe-button--custom-icon"},t.icon.call(this,{}))):i&&o.push(e("i",{class:["vxe-button--icon",i]})),t.default?o.push(e("span",{class:"vxe-button--content"},t.default.call(this,{}))):n&&o.push(e("span",{class:"vxe-button--content"},[(0,_utils.getFuncText)(n)])),o},handleGlobalMousewheelEvent:function(e){this.showPanel&&!_dom.default.getEventTargetNode(e,this.$refs.panel).flag&&this.closePanel()},updateZindex:function(){this.panelIndex<_utils.default.getLastZIndex()&&(this.panelIndex=_utils.default.nextZIndex())},mousedownDropdownEvent:function(e){0===e.button&&e.stopPropagation()},clickDropdownEvent:function(e){var t=this,n=e.currentTarget,i=this.$refs.panel,o=_dom.default.getEventTargetNode(e,n,"vxe-button"),n=o.flag,o=o.targetElem;n&&(i&&(i.dataset.active="N"),this.showPanel=!1,setTimeout(function(){i&&"Y"===i.dataset.active||(t.animatVisible=!1)},350),this.$emit("dropdown-click",{name:o.getAttribute("name"),$event:e}))},mouseenterTargetEvent:function(){var e=this,t=this.$refs.panel;t.dataset.active="Y",this.inited||(this.inited=!0,this.transfer&&document.body.appendChild(t)),this.showTime=setTimeout(function(){"Y"===t.dataset.active?e.mouseenterEvent():e.animatVisible=!1},250)},mouseenterEvent:function(){var e=this,t=this.$refs.panel;t.dataset.active="Y",this.animatVisible=!0,setTimeout(function(){"Y"===t.dataset.active&&(e.showPanel=!0,e.updateZindex(),e.updatePlacement(),setTimeout(function(){e.showPanel&&e.updatePlacement()},50))},20)},mouseleaveEvent:function(){this.closePanel()},closePanel:function(){var e=this,t=this.$refs.panel;clearTimeout(this.showTime),t?(t.dataset.active="N",setTimeout(function(){"Y"!==t.dataset.active&&(e.showPanel=!1,setTimeout(function(){"Y"!==t.dataset.active&&(e.animatVisible=!1)},350))},100)):(this.animatVisible=!1,this.showPanel=!1)},updatePlacement:function(){var p=this;return this.$nextTick().then(function(){var e=p.$refs,t=p.transfer,n=p.placement,i=p.panelIndex,o=e.xBtn,s=e.panel;if(s&&o){var r=o.offsetHeight,a=o.offsetWidth,u=s.offsetHeight,l=s.offsetWidth,c={zIndex:i},d=_dom.default.getAbsolutePos(o),f=d.top,e=d.left,s=d.boundingTop,i=d.visibleHeight,o=d.visibleWidth,d="bottom";return t?(t=f+r,"top"===n?(d="top",t=f-u):n||(i<s+r+u+5&&(d="top",t=f-u),t<5&&(d="bottom",t=f+r)),o<(e=e+a-l)+l+5&&(e-=e+l+5-o),e<5&&(e=5),Object.assign(c,{left:"".concat(e,"px"),right:"auto",top:"".concat(t,"px"),minWidth:"".concat(a,"px")})):"top"===n?(d="top",c.bottom="".concat(r,"px")):n||i<s+r+u&&5<s-r-u&&(d="top",c.bottom="".concat(r,"px")),p.panelStyle=c,p.panelPlacement=d,p.$nextTick()}})},focus:function(){return this.$el.focus(),this.$nextTick()},blur:function(){return this.$el.blur(),this.$nextTick()}}};exports.default=_default2;
1
+ "use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _xeUtils=_interopRequireDefault(require("xe-utils")),_conf=_interopRequireDefault(require("../../v-x-e-table/src/conf")),_size=_interopRequireDefault(require("../../mixins/size")),_utils=_interopRequireWildcard(require("../../tools/utils")),_dom=_interopRequireDefault(require("../../tools/dom")),_event=require("../../tools/event");function _getRequireWildcardCache(e){var t,n;return"function"!=typeof WeakMap?null:(t=new WeakMap,n=new WeakMap,(_getRequireWildcardCache=function(e){return e?n:t})(e))}function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==_typeof(e)&&"function"!=typeof e)return{default:e};t=_getRequireWildcardCache(t);if(t&&t.has(e))return t.get(e);var n,i,o={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&((i=s?Object.getOwnPropertyDescriptor(e,n):null)&&(i.get||i.set)?Object.defineProperty(o,n,i):o[n]=e[n]);return o.default=e,t&&t.set(e,o),o}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperty(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var _default2={name:"VxeButton",mixins:[_size.default],props:{type:String,size:{type:String,default:function(){return _conf.default.button.size||_conf.default.size}},name:[String,Number],content:String,placement:String,status:String,icon:String,round:Boolean,circle:Boolean,disabled:Boolean,loading:Boolean,destroyOnClose:Boolean,className:String,transfer:{type:Boolean,default:function(){return _conf.default.button.transfer}}},data:function(){return{inited:!1,showPanel:!1,animatVisible:!1,panelIndex:0,panelStyle:null,panelPlacement:null}},computed:{isText:function(){return"text"===this.type},isFormBtn:function(){return-1<["submit","reset","button"].indexOf(this.type)},btnType:function(){return this.isText?this.type:"button"}},created:function(){_event.GlobalEvent.on(this,"mousewheel",this.handleGlobalMousewheelEvent)},beforeDestroy:function(){var e=this.$refs.panel;e&&e.parentNode&&e.parentNode.removeChild(e)},destroyed:function(){_event.GlobalEvent.off(this,"mousewheel")},render:function(e){var t,n=this,i=this.$scopedSlots,o=this.$listeners,s=this.className,r=this.inited,a=this.type,u=this.destroyOnClose,l=this.isFormBtn,c=this.status,d=this.btnType,f=this.vSize,p=this.name,h=this.disabled,m=this.loading,b=this.showPanel,v=this.animatVisible,y=this.panelPlacement,i=i.dropdowns;return i?e("div",{class:["vxe-button--dropdown",s,(_defineProperty(t={},"size--".concat(f),f),_defineProperty(t,"is--active",b),t)]},[e("button",{ref:"xBtn",class:["vxe-button","type--".concat(d),(_defineProperty(t={},"size--".concat(f),f),_defineProperty(t,"theme--".concat(c),c),_defineProperty(t,"is--round",this.round),_defineProperty(t,"is--circle",this.circle),_defineProperty(t,"is--disabled",h||m),_defineProperty(t,"is--loading",m),t)],attrs:{name:p,type:l?a:"button",disabled:h||m},on:Object.assign({mouseenter:this.mouseenterTargetEvent,mouseleave:this.mouseleaveEvent},_xeUtils.default.objectMap(o,function(e,t){return function(e){return n.$emit(t,{$event:e})}}))},this.renderContent(e).concat([e("i",{class:"vxe-button--dropdown-arrow ".concat(_conf.default.icon.BUTTON_DROPDOWN)})])),e("div",{ref:"panel",class:["vxe-button--dropdown-panel",(_defineProperty(t={},"size--".concat(f),f),_defineProperty(t,"animat--leave",v),_defineProperty(t,"animat--enter",b),t)],attrs:{placement:y},style:this.panelStyle},r?[e("div",{class:"vxe-button--dropdown-wrapper",on:{mousedown:this.mousedownDropdownEvent,click:this.clickDropdownEvent,mouseenter:this.mouseenterEvent,mouseleave:this.mouseleaveEvent}},u&&!b?[]:i.call(this,{},e))]:null)]):e("button",{ref:"xBtn",class:["vxe-button","type--".concat(d),s,(_defineProperty(v={},"size--".concat(f),f),_defineProperty(v,"theme--".concat(c),c),_defineProperty(v,"is--round",this.round),_defineProperty(v,"is--circle",this.circle),_defineProperty(v,"is--disabled",h||m),_defineProperty(v,"is--loading",m),v)],attrs:{name:p,type:l?a:"button",disabled:h||m},on:_xeUtils.default.objectMap(o,function(e,t){return function(e){return n.$emit(t,{$event:e})}})},this.renderContent(e))},methods:{renderContent:function(e){var t=this.$scopedSlots,n=this.content,i=this.icon,o=[];return this.loading?o.push(e("i",{class:["vxe-button--loading-icon",_conf.default.icon.BUTTON_LOADING]})):t.icon?o.push(e("span",{class:"vxe-button--custom-icon"},t.icon.call(this,{}))):i&&o.push(e("i",{class:["vxe-button--icon",i]})),t.default?o.push(e("span",{class:"vxe-button--content"},t.default.call(this,{}))):n&&o.push(e("span",{class:"vxe-button--content"},[(0,_utils.getFuncText)(n)])),o},handleGlobalMousewheelEvent:function(e){this.showPanel&&!_dom.default.getEventTargetNode(e,this.$refs.panel).flag&&this.closePanel()},updateZindex:function(){this.panelIndex<_utils.default.getLastZIndex()&&(this.panelIndex=_utils.default.nextZIndex())},mousedownDropdownEvent:function(e){0===e.button&&e.stopPropagation()},clickDropdownEvent:function(e){var t=this,n=e.currentTarget,i=this.$refs.panel,n=_dom.default.getEventTargetNode(e,n,"vxe-button"),o=n.flag,n=n.targetElem;o&&(i&&(i.dataset.active="N"),this.showPanel=!1,setTimeout(function(){i&&"Y"===i.dataset.active||(t.animatVisible=!1)},350),this.$emit("dropdown-click",{name:n.getAttribute("name"),$event:e}))},mouseenterTargetEvent:function(){var e=this,t=this.$refs.panel;t.dataset.active="Y",this.inited||(this.inited=!0,this.transfer&&document.body.appendChild(t)),this.showTime=setTimeout(function(){"Y"===t.dataset.active?e.mouseenterEvent():e.animatVisible=!1},250)},mouseenterEvent:function(){var e=this,t=this.$refs.panel;t.dataset.active="Y",this.animatVisible=!0,setTimeout(function(){"Y"===t.dataset.active&&(e.showPanel=!0,e.updateZindex(),e.updatePlacement(),setTimeout(function(){e.showPanel&&e.updatePlacement()},50))},20)},mouseleaveEvent:function(){this.closePanel()},closePanel:function(){var e=this,t=this.$refs.panel;clearTimeout(this.showTime),t?(t.dataset.active="N",setTimeout(function(){"Y"!==t.dataset.active&&(e.showPanel=!1,setTimeout(function(){"Y"!==t.dataset.active&&(e.animatVisible=!1)},350))},100)):(this.animatVisible=!1,this.showPanel=!1)},updatePlacement:function(){var p=this;return this.$nextTick().then(function(){var e,t,n,i,o,s,r,a,u=p.$refs,l=p.transfer,c=p.placement,d=p.panelIndex,f=u.xBtn,u=u.panel;if(u&&f)return e=f.offsetHeight,t=f.offsetWidth,n=u.offsetHeight,u=u.offsetWidth,d={zIndex:d},a=(f=_dom.default.getAbsolutePos(f)).top,i=f.left,o=f.boundingTop,s=f.visibleHeight,f=f.visibleWidth,r="bottom",l?(l=a+e,"top"===c?(r="top",l=a-n):c||(s<o+e+n+5&&(r="top",l=a-n),l<5&&(r="bottom",l=a+e)),f<(a=i+t-u)+u+5&&(a-=a+u+5-f),a<5&&(a=5),Object.assign(d,{left:"".concat(a,"px"),right:"auto",top:"".concat(l,"px"),minWidth:"".concat(t,"px")})):"top"===c?(r="top",d.bottom="".concat(e,"px")):c||s<o+e+n&&5<o-e-n&&(r="top",d.bottom="".concat(e,"px")),p.panelStyle=d,p.panelPlacement=r,p.$nextTick()})},focus:function(){return this.$el.focus(),this.$nextTick()},blur:function(){return this.$el.blur(),this.$nextTick()}}};exports.default=_default2;