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.
- package/lib/all.js +11 -82
- package/lib/all.min.js +1 -1
- package/lib/button/index.js +0 -3
- package/lib/button/src/button.js +39 -82
- package/lib/button/src/button.min.js +1 -1
- package/lib/button/style/style.css +475 -349
- package/lib/button/style/style.min.css +1 -1
- package/lib/checkbox/index.js +0 -3
- package/lib/checkbox/src/checkbox.js +15 -29
- package/lib/checkbox/src/checkbox.min.js +1 -1
- package/lib/checkbox/src/group.js +4 -12
- package/lib/checkbox/style/style.css +158 -128
- package/lib/checkbox/style/style.min.css +1 -1
- package/lib/checkbox-group/index.js +0 -3
- package/lib/checkbox-group/style/style.css +1 -1
- package/lib/colgroup/index.js +2 -5
- package/lib/colgroup/style/style.css +1 -1
- package/lib/column/index.js +2 -5
- package/lib/column/style/style.css +1 -1
- package/lib/edit/index.js +0 -6
- package/lib/edit/src/mixin.js +91 -252
- package/lib/edit/src/mixin.min.js +1 -1
- package/lib/edit/style/style.css +1 -1
- package/lib/export/index.js +1 -16
- package/lib/export/index.min.js +1 -1
- package/lib/export/src/export-panel.js +16 -41
- package/lib/export/src/export-panel.min.js +1 -1
- package/lib/export/src/import-panel.js +5 -19
- package/lib/export/src/import-panel.min.js +1 -1
- package/lib/export/src/mixin.js +105 -387
- package/lib/export/src/mixin.min.js +1 -1
- package/lib/export/style/style.css +138 -105
- package/lib/filter/index.js +0 -8
- package/lib/filter/src/mixin.js +18 -66
- package/lib/filter/src/mixin.min.js +1 -1
- package/lib/filter/src/panel.js +10 -22
- package/lib/filter/src/panel.min.js +1 -1
- package/lib/filter/style/style.css +105 -81
- package/lib/footer/index.js +0 -3
- package/lib/footer/src/footer.js +52 -84
- package/lib/footer/src/footer.min.js +1 -1
- package/lib/footer/style/style.css +1 -1
- package/lib/form/index.js +0 -3
- package/lib/form/src/form-config-item.js +23 -40
- package/lib/form/src/form-config-item.min.js +1 -1
- package/lib/form/src/form-gather.js +0 -5
- package/lib/form/src/form-item.js +18 -35
- package/lib/form/src/form-item.min.js +1 -1
- package/lib/form/src/form.js +45 -137
- package/lib/form/src/form.min.js +1 -1
- package/lib/form/src/render.js +7 -22
- package/lib/form/src/render.min.js +1 -1
- package/lib/form/src/util.js +9 -42
- package/lib/form/src/util.min.js +1 -1
- package/lib/form/style/style.css +227 -185
- package/lib/form-gather/index.js +0 -3
- package/lib/form-gather/style/style.css +1 -1
- package/lib/form-item/index.js +0 -3
- package/lib/form-item/style/style.css +1 -1
- package/lib/grid/index.js +0 -4
- package/lib/grid/src/grid.js +87 -261
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/grid/style/style.css +62 -50
- package/lib/header/index.js +0 -3
- package/lib/header/src/header.js +54 -87
- package/lib/header/src/header.min.js +1 -1
- package/lib/header/src/util.js +0 -17
- package/lib/header/src/util.min.js +1 -1
- package/lib/header/style/style.css +1 -1
- package/lib/icon/index.js +0 -3
- package/lib/icon/style/iconfont.1669391208345.ttf +0 -0
- package/lib/icon/style/iconfont.1669391208345.woff +0 -0
- package/lib/icon/style/iconfont.1669391208345.woff2 +0 -0
- package/lib/icon/style/style.css +384 -197
- package/lib/icon/style/style.min.css +738 -1
- package/lib/iconfont.1669391208345.ttf +0 -0
- package/lib/iconfont.1669391208345.woff +0 -0
- package/lib/iconfont.1669391208345.woff2 +0 -0
- package/lib/index.common.js +1 -7
- package/lib/index.common.min.js +1 -1
- package/lib/index.css +1 -1
- package/lib/index.umd.js +11884 -13141
- package/lib/index.umd.min.js +1 -1
- package/lib/input/index.js +0 -3
- package/lib/input/src/date.js +0 -10
- package/lib/input/src/date.min.js +1 -1
- package/lib/input/src/input.js +208 -473
- package/lib/input/src/input.min.js +1 -1
- package/lib/input/src/number.js +0 -5
- package/lib/input/style/style.css +820 -611
- package/lib/keyboard/index.js +0 -6
- package/lib/keyboard/src/mixin.js +35 -111
- package/lib/keyboard/src/mixin.min.js +1 -1
- package/lib/keyboard/style/style.css +1 -1
- package/lib/list/index.js +0 -3
- package/lib/list/src/list.js +23 -64
- package/lib/list/src/list.min.js +1 -1
- package/lib/list/style/style.css +19 -14
- package/lib/loading/index.js +0 -3
- package/lib/loading/index.min.js +1 -1
- package/lib/loading/src/loading.js +1 -4
- package/lib/loading/style/style.css +60 -45
- package/lib/locale/lang/zh-HK.js +0 -3
- package/lib/locale/lang/zh-MO.js +0 -3
- package/lib/locale/lang/zh-TW.js +0 -3
- package/lib/menu/index.js +0 -8
- package/lib/menu/src/mixin.js +38 -100
- package/lib/menu/src/mixin.min.js +1 -1
- package/lib/menu/src/panel.js +2 -5
- package/lib/menu/style/style.css +74 -55
- package/lib/mixins/size.js +1 -1
- package/lib/modal/index.js +3 -21
- package/lib/modal/index.min.js +1 -1
- package/lib/modal/src/modal.js +97 -254
- package/lib/modal/src/modal.min.js +1 -1
- package/lib/modal/style/style.css +346 -280
- package/lib/modal/style/style.min.css +1 -1
- package/lib/optgroup/index.js +0 -3
- package/lib/optgroup/style/style.css +1 -1
- package/lib/option/index.js +0 -3
- package/lib/option/style/style.css +1 -1
- package/lib/pager/index.js +0 -3
- package/lib/pager/src/pager.js +13 -41
- package/lib/pager/src/pager.min.js +1 -1
- package/lib/pager/style/style.css +314 -262
- package/lib/pulldown/index.js +0 -3
- package/lib/pulldown/src/pulldown.js +29 -72
- package/lib/pulldown/src/pulldown.min.js +1 -1
- package/lib/pulldown/style/style.css +51 -39
- package/lib/radio/index.js +0 -3
- package/lib/radio/src/button.js +11 -22
- package/lib/radio/src/group.js +2 -6
- package/lib/radio/src/radio.js +11 -23
- package/lib/radio/style/style.css +186 -152
- package/lib/radio/style/style.min.css +1 -1
- package/lib/radio-button/index.js +0 -3
- package/lib/radio-button/style/style.css +1 -1
- package/lib/radio-group/index.js +0 -3
- package/lib/radio-group/style/style.css +1 -1
- package/lib/select/index.js +0 -5
- package/lib/select/src/optgroup.js +0 -2
- package/lib/select/src/optgroup.min.js +1 -1
- package/lib/select/src/option.js +0 -2
- package/lib/select/src/option.min.js +1 -1
- package/lib/select/src/select.js +79 -211
- package/lib/select/src/select.min.js +1 -1
- package/lib/select/src/util.js +5 -24
- package/lib/select/src/util.min.js +1 -1
- package/lib/select/style/style.css +120 -89
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/switch/index.js +0 -3
- package/lib/switch/src/switch.js +7 -20
- package/lib/switch/src/switch.min.js +1 -1
- package/lib/switch/style/style.css +92 -71
- package/lib/table/index.js +0 -9
- package/lib/table/src/body.js +167 -261
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +107 -222
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/column.js +2 -4
- package/lib/table/src/column.min.js +1 -1
- package/lib/table/src/columnInfo.js +6 -35
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/group.js +0 -3
- package/lib/table/src/methods.js +570 -1461
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +123 -231
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +28 -105
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +1080 -863
- package/lib/table/style/style.min.css +1 -1
- package/lib/textarea/index.js +0 -3
- package/lib/textarea/src/textarea.js +23 -55
- package/lib/textarea/src/textarea.min.js +1 -1
- package/lib/textarea/style/style.css +66 -45
- package/lib/toolbar/index.js +0 -3
- package/lib/toolbar/src/toolbar.js +43 -117
- package/lib/toolbar/src/toolbar.min.js +1 -1
- package/lib/toolbar/style/style.css +232 -187
- package/lib/tools/dom.js +7 -42
- package/lib/tools/dom.min.js +1 -1
- package/lib/tools/event.js +4 -14
- package/lib/tools/event.min.js +1 -1
- package/lib/tools/log.js +1 -6
- package/lib/tools/log.min.js +1 -1
- package/lib/tools/resize.js +3 -24
- package/lib/tools/resize.min.js +1 -1
- package/lib/tools/utils.js +7 -29
- package/lib/tools/utils.min.js +1 -1
- package/lib/tools/vn.js +0 -4
- package/lib/tooltip/index.js +0 -4
- package/lib/tooltip/src/tooltip.js +29 -76
- package/lib/tooltip/src/tooltip.min.js +1 -1
- package/lib/tooltip/style/style.css +88 -64
- package/lib/v-x-e-table/index.js +6 -41
- package/lib/v-x-e-table/index.min.js +1 -1
- package/lib/v-x-e-table/src/commands.js +0 -4
- package/lib/v-x-e-table/src/conf.js +30 -18
- package/lib/v-x-e-table/src/formats.js +0 -4
- package/lib/v-x-e-table/src/interceptor.js +4 -15
- package/lib/v-x-e-table/src/menus.js +0 -4
- package/lib/v-x-e-table/src/renderer.js +62 -169
- package/lib/v-x-e-table/src/renderer.min.js +1 -1
- package/lib/v-x-e-table/src/setup.js +0 -4
- package/lib/v-x-e-table/src/store.js +3 -16
- package/lib/v-x-e-table/src/store.min.js +1 -1
- package/lib/v-x-e-table/style/style.css +444 -242
- package/lib/v-x-e-table/style/style.min.css +1 -1
- package/lib/validator/index.js +0 -6
- package/lib/validator/src/mixin.js +31 -100
- package/lib/validator/src/mixin.min.js +1 -1
- package/lib/validator/style/style.css +1 -1
- package/lib/vxe-table/style/style.css +1 -1
- package/package.json +28 -29
- package/packages/export/src/mixin.js +2 -1
- package/packages/filter/src/mixin.js +1 -1
- package/packages/form/src/form.js +5 -4
- package/packages/grid/src/grid.js +14 -14
- package/packages/table/src/column.js +2 -0
- package/packages/table/src/columnInfo.js +1 -0
- package/packages/table/src/methods.js +18 -18
- package/styles/icon/iconfont.ttf +0 -0
- package/styles/icon/iconfont.woff +0 -0
- package/styles/icon/iconfont.woff2 +0 -0
- package/styles/icon.scss +9 -1
- package/styles/table.scss +1 -1
- package/styles/variable.scss +2 -2
- package/types/column.d.ts +3 -0
package/lib/button/src/button.js
CHANGED
|
@@ -1,32 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
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
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
82
|
+
_ref2,
|
|
83
|
+
_this = this,
|
|
84
|
+
_ref3,
|
|
85
|
+
_ref4;
|
|
100
86
|
var $scopedSlots = this.$scopedSlots,
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
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
|
-
|
|
175
|
-
|
|
176
|
-
|
|
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
|
-
|
|
230
|
-
|
|
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
|
-
|
|
325
|
-
|
|
326
|
-
|
|
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
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
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){
|
|
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;
|