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/modal/src/modal.js
CHANGED
|
@@ -1,50 +1,29 @@
|
|
|
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.msgQueue = exports.default = exports.allActivedModals = void 0;
|
|
9
|
-
|
|
10
8
|
var _conf = _interopRequireDefault(require("../../v-x-e-table/src/conf"));
|
|
11
|
-
|
|
12
9
|
var _size = _interopRequireDefault(require("../../mixins/size"));
|
|
13
|
-
|
|
14
10
|
var _xeUtils = _interopRequireDefault(require("xe-utils"));
|
|
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
|
var _log = require("../../tools/log");
|
|
23
|
-
|
|
24
15
|
var _vn = require("../../tools/vn");
|
|
25
|
-
|
|
26
16
|
var _index = _interopRequireDefault(require("../../loading/index"));
|
|
27
|
-
|
|
28
17
|
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); }
|
|
29
|
-
|
|
30
18
|
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; }
|
|
31
|
-
|
|
32
19
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
33
|
-
|
|
34
20
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
35
|
-
|
|
36
21
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
37
|
-
|
|
38
22
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
39
|
-
|
|
40
23
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
41
|
-
|
|
42
24
|
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
43
|
-
|
|
44
25
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
45
|
-
|
|
46
26
|
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; }
|
|
47
|
-
|
|
48
27
|
var allActivedModals = [];
|
|
49
28
|
exports.allActivedModals = allActivedModals;
|
|
50
29
|
var msgQueue = [];
|
|
@@ -273,20 +252,16 @@ var _default2 = {
|
|
|
273
252
|
},
|
|
274
253
|
mounted: function mounted() {
|
|
275
254
|
var $listeners = this.$listeners,
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
255
|
+
_this$events = this.events,
|
|
256
|
+
events = _this$events === void 0 ? {} : _this$events;
|
|
279
257
|
if (this.value) {
|
|
280
258
|
this.open();
|
|
281
259
|
}
|
|
282
|
-
|
|
283
260
|
this.recalculate();
|
|
284
|
-
|
|
285
261
|
if (this.escClosable) {
|
|
286
262
|
_event.GlobalEvent.on(this, 'keydown', this.handleGlobalKeydownEvent);
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
|
|
263
|
+
}
|
|
264
|
+
// 触发 inserted 事件
|
|
290
265
|
var type = 'inserted';
|
|
291
266
|
var params = {
|
|
292
267
|
type: type,
|
|
@@ -295,7 +270,6 @@ var _default2 = {
|
|
|
295
270
|
type: type
|
|
296
271
|
}
|
|
297
272
|
};
|
|
298
|
-
|
|
299
273
|
if ($listeners.inserted) {
|
|
300
274
|
this.$emit('inserted', params);
|
|
301
275
|
} else if (events.inserted) {
|
|
@@ -304,48 +278,44 @@ var _default2 = {
|
|
|
304
278
|
},
|
|
305
279
|
beforeDestroy: function beforeDestroy() {
|
|
306
280
|
var $el = this.$el;
|
|
307
|
-
|
|
308
281
|
_event.GlobalEvent.off(this, 'keydown');
|
|
309
|
-
|
|
310
282
|
this.removeMsgQueue();
|
|
311
|
-
|
|
312
283
|
if ($el.parentNode === document.body) {
|
|
313
284
|
$el.parentNode.removeChild($el);
|
|
314
285
|
}
|
|
315
286
|
},
|
|
316
287
|
render: function render(h) {
|
|
317
288
|
var _ref,
|
|
318
|
-
|
|
319
|
-
|
|
289
|
+
_this = this;
|
|
320
290
|
var _e = this._e,
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
291
|
+
$scopedSlots = this.$scopedSlots,
|
|
292
|
+
_this$slots = this.slots,
|
|
293
|
+
slots = _this$slots === void 0 ? {} : _this$slots,
|
|
294
|
+
inited = this.inited,
|
|
295
|
+
vSize = this.vSize,
|
|
296
|
+
className = this.className,
|
|
297
|
+
type = this.type,
|
|
298
|
+
resize = this.resize,
|
|
299
|
+
showClose = this.showClose,
|
|
300
|
+
showZoom = this.showZoom,
|
|
301
|
+
animat = this.animat,
|
|
302
|
+
draggable = this.draggable,
|
|
303
|
+
loading = this.loading,
|
|
304
|
+
status = this.status,
|
|
305
|
+
iconStatus = this.iconStatus,
|
|
306
|
+
showFooter = this.showFooter,
|
|
307
|
+
zoomLocat = this.zoomLocat,
|
|
308
|
+
modalTop = this.modalTop,
|
|
309
|
+
dblclickZoom = this.dblclickZoom,
|
|
310
|
+
contentVisible = this.contentVisible,
|
|
311
|
+
visible = this.visible,
|
|
312
|
+
title = this.title,
|
|
313
|
+
lockScroll = this.lockScroll,
|
|
314
|
+
lockView = this.lockView,
|
|
315
|
+
mask = this.mask,
|
|
316
|
+
isMsg = this.isMsg,
|
|
317
|
+
showTitleOverflow = this.showTitleOverflow,
|
|
318
|
+
destroyOnClose = this.destroyOnClose;
|
|
349
319
|
var content = this.content || this.message;
|
|
350
320
|
var defaultSlot = $scopedSlots.default || slots.default;
|
|
351
321
|
var footerSlot = $scopedSlots.footer || slots.footer;
|
|
@@ -353,15 +323,12 @@ var _default2 = {
|
|
|
353
323
|
var titleSlot = $scopedSlots.title || slots.title;
|
|
354
324
|
var cornerSlot = $scopedSlots.corner || slots.corner;
|
|
355
325
|
var headerOns = {};
|
|
356
|
-
|
|
357
326
|
if (draggable) {
|
|
358
327
|
headerOns.mousedown = this.mousedownEvent;
|
|
359
328
|
}
|
|
360
|
-
|
|
361
329
|
if (showZoom && dblclickZoom && type === 'modal') {
|
|
362
330
|
headerOns.dblclick = this.toggleZoomEvent;
|
|
363
331
|
}
|
|
364
|
-
|
|
365
332
|
return h('div', {
|
|
366
333
|
class: ['vxe-modal--wrapper', "type--".concat(type), className || '', (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, "status--".concat(status), status), _defineProperty(_ref, 'is--animat', animat), _defineProperty(_ref, 'lock--scroll', lockScroll), _defineProperty(_ref, 'lock--view', lockView), _defineProperty(_ref, 'is--resize', resize), _defineProperty(_ref, 'is--mask', mask), _defineProperty(_ref, 'is--maximize', zoomLocat), _defineProperty(_ref, 'is--visible', contentVisible), _defineProperty(_ref, 'is--active', visible), _defineProperty(_ref, 'is--loading', loading), _ref)],
|
|
367
334
|
style: {
|
|
@@ -464,7 +431,7 @@ var _default2 = {
|
|
|
464
431
|
methods: {
|
|
465
432
|
recalculate: function recalculate() {
|
|
466
433
|
var width = this.width,
|
|
467
|
-
|
|
434
|
+
height = this.height;
|
|
468
435
|
var modalBoxElem = this.getBox();
|
|
469
436
|
modalBoxElem.style.width = width ? isNaN(width) ? width : "".concat(width, "px") : null;
|
|
470
437
|
modalBoxElem.style.height = height ? isNaN(height) ? height : "".concat(height, "px") : null;
|
|
@@ -478,8 +445,7 @@ var _default2 = {
|
|
|
478
445
|
},
|
|
479
446
|
updateZindex: function updateZindex() {
|
|
480
447
|
var zIndex = this.zIndex,
|
|
481
|
-
|
|
482
|
-
|
|
448
|
+
modalZindex = this.modalZindex;
|
|
483
449
|
if (zIndex) {
|
|
484
450
|
this.modalZindex = zIndex;
|
|
485
451
|
} else if (modalZindex < _utils.default.getLastZIndex()) {
|
|
@@ -488,119 +454,101 @@ var _default2 = {
|
|
|
488
454
|
},
|
|
489
455
|
closeEvent: function closeEvent(evnt) {
|
|
490
456
|
var _this$events2 = this.events,
|
|
491
|
-
|
|
457
|
+
events = _this$events2 === void 0 ? {} : _this$events2;
|
|
492
458
|
var type = 'close';
|
|
493
459
|
var params = {
|
|
494
460
|
type: type,
|
|
495
461
|
$modal: this,
|
|
496
462
|
$event: evnt
|
|
497
463
|
};
|
|
498
|
-
|
|
499
464
|
if (events[type]) {
|
|
500
465
|
events[type].call(this, params);
|
|
501
466
|
} else {
|
|
502
467
|
this.$emit(type, params);
|
|
503
468
|
}
|
|
504
|
-
|
|
505
469
|
this.close(type);
|
|
506
470
|
},
|
|
507
471
|
confirmEvent: function confirmEvent(evnt) {
|
|
508
472
|
var _this$events3 = this.events,
|
|
509
|
-
|
|
473
|
+
events = _this$events3 === void 0 ? {} : _this$events3;
|
|
510
474
|
var type = 'confirm';
|
|
511
475
|
var params = {
|
|
512
476
|
type: type,
|
|
513
477
|
$modal: this,
|
|
514
478
|
$event: evnt
|
|
515
479
|
};
|
|
516
|
-
|
|
517
480
|
if (events[type]) {
|
|
518
481
|
events[type].call(this, params);
|
|
519
482
|
} else {
|
|
520
483
|
this.$emit(type, params);
|
|
521
484
|
}
|
|
522
|
-
|
|
523
485
|
this.close(type);
|
|
524
486
|
},
|
|
525
487
|
cancelEvent: function cancelEvent(evnt) {
|
|
526
488
|
var _this$events4 = this.events,
|
|
527
|
-
|
|
489
|
+
events = _this$events4 === void 0 ? {} : _this$events4;
|
|
528
490
|
var type = 'cancel';
|
|
529
491
|
var params = {
|
|
530
492
|
type: type,
|
|
531
493
|
$modal: this,
|
|
532
494
|
$event: evnt
|
|
533
495
|
};
|
|
534
|
-
|
|
535
496
|
if (events[type]) {
|
|
536
497
|
events[type].call(this, params);
|
|
537
498
|
} else {
|
|
538
499
|
this.$emit(type, params);
|
|
539
500
|
}
|
|
540
|
-
|
|
541
501
|
this.close(type);
|
|
542
502
|
},
|
|
543
503
|
open: function open() {
|
|
544
504
|
var _this2 = this;
|
|
545
|
-
|
|
546
505
|
var $refs = this.$refs,
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
506
|
+
_this$events5 = this.events,
|
|
507
|
+
events = _this$events5 === void 0 ? {} : _this$events5,
|
|
508
|
+
inited = this.inited,
|
|
509
|
+
duration = this.duration,
|
|
510
|
+
visible = this.visible,
|
|
511
|
+
isMsg = this.isMsg,
|
|
512
|
+
remember = this.remember,
|
|
513
|
+
showFooter = this.showFooter;
|
|
556
514
|
if (!inited) {
|
|
557
515
|
this.inited = true;
|
|
558
|
-
|
|
559
516
|
if (this.transfer) {
|
|
560
517
|
document.body.appendChild(this.$el);
|
|
561
518
|
}
|
|
562
519
|
}
|
|
563
|
-
|
|
564
520
|
if (!visible) {
|
|
565
521
|
if (!remember) {
|
|
566
522
|
this.recalculate();
|
|
567
523
|
}
|
|
568
|
-
|
|
569
524
|
this.visible = true;
|
|
570
525
|
this.contentVisible = false;
|
|
571
526
|
this.updateZindex();
|
|
572
527
|
allActivedModals.push(this);
|
|
573
528
|
setTimeout(function () {
|
|
574
529
|
_this2.contentVisible = true;
|
|
575
|
-
|
|
576
530
|
_this2.$nextTick(function () {
|
|
577
531
|
if (showFooter) {
|
|
578
532
|
var operBtn = $refs.confirmBtn || $refs.cancelBtn;
|
|
579
|
-
|
|
580
533
|
if (operBtn) {
|
|
581
534
|
operBtn.focus();
|
|
582
535
|
}
|
|
583
536
|
}
|
|
584
|
-
|
|
585
537
|
var type = '';
|
|
586
538
|
var params = {
|
|
587
539
|
type: type,
|
|
588
540
|
$modal: _this2
|
|
589
541
|
};
|
|
590
|
-
|
|
591
542
|
if (events.show) {
|
|
592
543
|
events.show.call(_this2, params);
|
|
593
544
|
} else {
|
|
594
545
|
_this2.$emit('input', true);
|
|
595
|
-
|
|
596
546
|
_this2.$emit('show', params);
|
|
597
547
|
}
|
|
598
548
|
});
|
|
599
549
|
}, 10);
|
|
600
|
-
|
|
601
550
|
if (isMsg) {
|
|
602
551
|
this.addMsgQueue();
|
|
603
|
-
|
|
604
552
|
if (duration !== -1) {
|
|
605
553
|
setTimeout(function () {
|
|
606
554
|
return _this2.close('close');
|
|
@@ -609,8 +557,7 @@ var _default2 = {
|
|
|
609
557
|
} else {
|
|
610
558
|
this.$nextTick(function () {
|
|
611
559
|
var firstOpen = _this2.firstOpen,
|
|
612
|
-
|
|
613
|
-
|
|
560
|
+
fullscreen = _this2.fullscreen;
|
|
614
561
|
if (!remember || firstOpen) {
|
|
615
562
|
_this2.updatePosition().then(function () {
|
|
616
563
|
setTimeout(function () {
|
|
@@ -618,10 +565,8 @@ var _default2 = {
|
|
|
618
565
|
}, 20);
|
|
619
566
|
});
|
|
620
567
|
}
|
|
621
|
-
|
|
622
568
|
if (firstOpen) {
|
|
623
569
|
_this2.firstOpen = false;
|
|
624
|
-
|
|
625
570
|
if (_this2.hasPosStorage()) {
|
|
626
571
|
_this2.restorePosStorage();
|
|
627
572
|
} else if (fullscreen) {
|
|
@@ -644,18 +589,15 @@ var _default2 = {
|
|
|
644
589
|
if (msgQueue.indexOf(this) === -1) {
|
|
645
590
|
msgQueue.push(this);
|
|
646
591
|
}
|
|
647
|
-
|
|
648
592
|
this.updateStyle();
|
|
649
593
|
},
|
|
650
594
|
removeMsgQueue: function removeMsgQueue() {
|
|
651
595
|
var _this3 = this;
|
|
652
|
-
|
|
653
596
|
if (msgQueue.indexOf(this) > -1) {
|
|
654
597
|
_xeUtils.default.remove(msgQueue, function (comp) {
|
|
655
598
|
return comp === _this3;
|
|
656
599
|
});
|
|
657
600
|
}
|
|
658
|
-
|
|
659
601
|
this.updateStyle();
|
|
660
602
|
},
|
|
661
603
|
updateStyle: function updateStyle() {
|
|
@@ -670,86 +612,69 @@ var _default2 = {
|
|
|
670
612
|
},
|
|
671
613
|
updatePosition: function updatePosition() {
|
|
672
614
|
var _this4 = this;
|
|
673
|
-
|
|
674
615
|
return this.$nextTick().then(function () {
|
|
675
616
|
var marginSize = _this4.marginSize,
|
|
676
|
-
|
|
677
|
-
|
|
617
|
+
position = _this4.position;
|
|
678
618
|
var modalBoxElem = _this4.getBox();
|
|
679
|
-
|
|
680
619
|
var clientVisibleWidth = document.documentElement.clientWidth || document.body.clientWidth;
|
|
681
620
|
var clientVisibleHeight = document.documentElement.clientHeight || document.body.clientHeight;
|
|
682
621
|
var isPosCenter = position === 'center';
|
|
683
|
-
|
|
684
622
|
var _ref2 = isPosCenter ? {
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
623
|
+
top: position,
|
|
624
|
+
left: position
|
|
625
|
+
} : Object.assign({}, position),
|
|
626
|
+
top = _ref2.top,
|
|
627
|
+
left = _ref2.left;
|
|
691
628
|
var topCenter = isPosCenter || top === 'center';
|
|
692
629
|
var leftCenter = isPosCenter || left === 'center';
|
|
693
630
|
var posTop = '';
|
|
694
631
|
var posLeft = '';
|
|
695
|
-
|
|
696
632
|
if (left && !leftCenter) {
|
|
697
633
|
posLeft = isNaN(left) ? left : "".concat(left, "px");
|
|
698
634
|
} else {
|
|
699
635
|
posLeft = "".concat(Math.max(marginSize, clientVisibleWidth / 2 - modalBoxElem.offsetWidth / 2), "px");
|
|
700
636
|
}
|
|
701
|
-
|
|
702
637
|
if (top && !topCenter) {
|
|
703
638
|
posTop = isNaN(top) ? top : "".concat(top, "px");
|
|
704
639
|
} else {
|
|
705
640
|
posTop = "".concat(Math.max(marginSize, clientVisibleHeight / 2 - modalBoxElem.offsetHeight / 2), "px");
|
|
706
641
|
}
|
|
707
|
-
|
|
708
642
|
modalBoxElem.style.top = posTop;
|
|
709
643
|
modalBoxElem.style.left = posLeft;
|
|
710
644
|
});
|
|
711
645
|
},
|
|
712
646
|
close: function close(type) {
|
|
713
647
|
var _this5 = this;
|
|
714
|
-
|
|
715
648
|
var _this$events6 = this.events,
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
649
|
+
events = _this$events6 === void 0 ? {} : _this$events6,
|
|
650
|
+
remember = this.remember,
|
|
651
|
+
visible = this.visible,
|
|
652
|
+
isMsg = this.isMsg,
|
|
653
|
+
beforeHideMethod = this.beforeHideMethod;
|
|
721
654
|
var params = {
|
|
722
655
|
type: type,
|
|
723
656
|
$modal: this
|
|
724
657
|
};
|
|
725
|
-
|
|
726
658
|
if (visible) {
|
|
727
659
|
Promise.resolve(beforeHideMethod ? beforeHideMethod(params) : null).then(function (rest) {
|
|
728
660
|
if (!_xeUtils.default.isError(rest)) {
|
|
729
661
|
if (isMsg) {
|
|
730
662
|
_this5.removeMsgQueue();
|
|
731
663
|
}
|
|
732
|
-
|
|
733
664
|
_this5.contentVisible = false;
|
|
734
|
-
|
|
735
665
|
if (!remember) {
|
|
736
666
|
_this5.zoomLocat = null;
|
|
737
667
|
}
|
|
738
|
-
|
|
739
668
|
_xeUtils.default.remove(allActivedModals, function (item) {
|
|
740
669
|
return item === _this5;
|
|
741
670
|
});
|
|
742
|
-
|
|
743
671
|
_this5.$emit('before-hide', params);
|
|
744
|
-
|
|
745
672
|
setTimeout(function () {
|
|
746
673
|
_this5.visible = false;
|
|
747
|
-
|
|
748
674
|
if (events.hide) {
|
|
749
675
|
events.hide.call(_this5, params);
|
|
750
676
|
} else {
|
|
751
677
|
_this5.$emit('input', false);
|
|
752
|
-
|
|
753
678
|
_this5.$emit('hide', params);
|
|
754
679
|
}
|
|
755
680
|
}, 200);
|
|
@@ -761,15 +686,12 @@ var _default2 = {
|
|
|
761
686
|
},
|
|
762
687
|
handleGlobalKeydownEvent: function handleGlobalKeydownEvent(evnt) {
|
|
763
688
|
var _this6 = this;
|
|
764
|
-
|
|
765
689
|
var isEsc = evnt.keyCode === 27;
|
|
766
|
-
|
|
767
690
|
if (isEsc) {
|
|
768
691
|
var lastModal = _xeUtils.default.max(allActivedModals, function (item) {
|
|
769
692
|
return item.modalZindex;
|
|
770
|
-
});
|
|
771
|
-
|
|
772
|
-
|
|
693
|
+
});
|
|
694
|
+
// 多个时,只关掉最上层的窗口
|
|
773
695
|
if (lastModal) {
|
|
774
696
|
setTimeout(function () {
|
|
775
697
|
if (lastModal === _this6 && lastModal.escClosable) {
|
|
@@ -787,17 +709,13 @@ var _default2 = {
|
|
|
787
709
|
},
|
|
788
710
|
maximize: function maximize() {
|
|
789
711
|
var _this7 = this;
|
|
790
|
-
|
|
791
712
|
return this.$nextTick().then(function () {
|
|
792
713
|
if (!_this7.zoomLocat) {
|
|
793
714
|
var marginSize = Math.max(0, _this7.marginSize);
|
|
794
|
-
|
|
795
715
|
var modalBoxElem = _this7.getBox();
|
|
796
|
-
|
|
797
716
|
var _DomTools$getDomNode = _dom.default.getDomNode(),
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
717
|
+
visibleHeight = _DomTools$getDomNode.visibleHeight,
|
|
718
|
+
visibleWidth = _DomTools$getDomNode.visibleWidth;
|
|
801
719
|
_this7.zoomLocat = {
|
|
802
720
|
top: modalBoxElem.offsetTop,
|
|
803
721
|
left: modalBoxElem.offsetLeft,
|
|
@@ -810,20 +728,16 @@ var _default2 = {
|
|
|
810
728
|
width: "".concat(visibleWidth - marginSize * 2, "px"),
|
|
811
729
|
height: "".concat(visibleHeight - marginSize * 2, "px")
|
|
812
730
|
});
|
|
813
|
-
|
|
814
731
|
_this7.savePosStorage();
|
|
815
732
|
}
|
|
816
733
|
});
|
|
817
734
|
},
|
|
818
735
|
revert: function revert() {
|
|
819
736
|
var _this8 = this;
|
|
820
|
-
|
|
821
737
|
return this.$nextTick().then(function () {
|
|
822
738
|
var zoomLocat = _this8.zoomLocat;
|
|
823
|
-
|
|
824
739
|
if (zoomLocat) {
|
|
825
740
|
var modalBoxElem = _this8.getBox();
|
|
826
|
-
|
|
827
741
|
_this8.zoomLocat = null;
|
|
828
742
|
Object.assign(modalBoxElem.style, {
|
|
829
743
|
top: "".concat(zoomLocat.top, "px"),
|
|
@@ -831,25 +745,22 @@ var _default2 = {
|
|
|
831
745
|
width: "".concat(zoomLocat.width, "px"),
|
|
832
746
|
height: "".concat(zoomLocat.height, "px")
|
|
833
747
|
});
|
|
834
|
-
|
|
835
748
|
_this8.savePosStorage();
|
|
836
749
|
}
|
|
837
750
|
});
|
|
838
751
|
},
|
|
839
752
|
zoom: function zoom() {
|
|
840
753
|
var _this9 = this;
|
|
841
|
-
|
|
842
754
|
return this[this.zoomLocat ? 'revert' : 'maximize']().then(function () {
|
|
843
755
|
return _this9.isMaximized();
|
|
844
756
|
});
|
|
845
757
|
},
|
|
846
758
|
toggleZoomEvent: function toggleZoomEvent(evnt) {
|
|
847
759
|
var _this10 = this;
|
|
848
|
-
|
|
849
760
|
var $listeners = this.$listeners,
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
761
|
+
zoomLocat = this.zoomLocat,
|
|
762
|
+
_this$events7 = this.events,
|
|
763
|
+
events = _this$events7 === void 0 ? {} : _this$events7;
|
|
853
764
|
var params = {
|
|
854
765
|
type: zoomLocat ? 'revert' : 'max',
|
|
855
766
|
$modal: this,
|
|
@@ -866,7 +777,6 @@ var _default2 = {
|
|
|
866
777
|
getPosition: function getPosition() {
|
|
867
778
|
if (!this.isMsg) {
|
|
868
779
|
var modalBoxElem = this.getBox();
|
|
869
|
-
|
|
870
780
|
if (modalBoxElem) {
|
|
871
781
|
return {
|
|
872
782
|
top: modalBoxElem.offsetTop,
|
|
@@ -874,27 +784,22 @@ var _default2 = {
|
|
|
874
784
|
};
|
|
875
785
|
}
|
|
876
786
|
}
|
|
877
|
-
|
|
878
787
|
return null;
|
|
879
788
|
},
|
|
880
789
|
setPosition: function setPosition(top, left) {
|
|
881
790
|
if (!this.isMsg) {
|
|
882
791
|
var modalBoxElem = this.getBox();
|
|
883
|
-
|
|
884
792
|
if (_xeUtils.default.isNumber(top)) {
|
|
885
793
|
modalBoxElem.style.top = "".concat(top, "px");
|
|
886
794
|
}
|
|
887
|
-
|
|
888
795
|
if (_xeUtils.default.isNumber(left)) {
|
|
889
796
|
modalBoxElem.style.left = "".concat(left, "px");
|
|
890
797
|
}
|
|
891
798
|
}
|
|
892
|
-
|
|
893
799
|
return this.$nextTick();
|
|
894
800
|
},
|
|
895
801
|
boxMousedownEvent: function boxMousedownEvent() {
|
|
896
802
|
var modalZindex = this.modalZindex;
|
|
897
|
-
|
|
898
803
|
if (allActivedModals.some(function (_vm) {
|
|
899
804
|
return _vm.visible && _vm.modalZindex > modalZindex;
|
|
900
805
|
})) {
|
|
@@ -903,24 +808,20 @@ var _default2 = {
|
|
|
903
808
|
},
|
|
904
809
|
mousedownEvent: function mousedownEvent(evnt) {
|
|
905
810
|
var _this11 = this;
|
|
906
|
-
|
|
907
811
|
var remember = this.remember,
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
812
|
+
storage = this.storage,
|
|
813
|
+
marginSize = this.marginSize,
|
|
814
|
+
zoomLocat = this.zoomLocat;
|
|
911
815
|
var modalBoxElem = this.getBox();
|
|
912
|
-
|
|
913
816
|
if (!zoomLocat && evnt.button === 0 && !_dom.default.getEventTargetNode(evnt, modalBoxElem, 'trigger--btn').flag) {
|
|
914
817
|
evnt.preventDefault();
|
|
915
818
|
var domMousemove = document.onmousemove;
|
|
916
819
|
var domMouseup = document.onmouseup;
|
|
917
820
|
var disX = evnt.clientX - modalBoxElem.offsetLeft;
|
|
918
821
|
var disY = evnt.clientY - modalBoxElem.offsetTop;
|
|
919
|
-
|
|
920
822
|
var _DomTools$getDomNode2 = _dom.default.getDomNode(),
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
823
|
+
visibleHeight = _DomTools$getDomNode2.visibleHeight,
|
|
824
|
+
visibleWidth = _DomTools$getDomNode2.visibleWidth;
|
|
924
825
|
document.onmousemove = function (evnt) {
|
|
925
826
|
evnt.preventDefault();
|
|
926
827
|
var offsetWidth = modalBoxElem.offsetWidth;
|
|
@@ -931,38 +832,30 @@ var _default2 = {
|
|
|
931
832
|
var maxY = visibleHeight - offsetHeight - marginSize - 1;
|
|
932
833
|
var left = evnt.clientX - disX;
|
|
933
834
|
var top = evnt.clientY - disY;
|
|
934
|
-
|
|
935
835
|
if (left > maxX) {
|
|
936
836
|
left = maxX;
|
|
937
837
|
}
|
|
938
|
-
|
|
939
838
|
if (left < minX) {
|
|
940
839
|
left = minX;
|
|
941
840
|
}
|
|
942
|
-
|
|
943
841
|
if (top > maxY) {
|
|
944
842
|
top = maxY;
|
|
945
843
|
}
|
|
946
|
-
|
|
947
844
|
if (top < minY) {
|
|
948
845
|
top = minY;
|
|
949
846
|
}
|
|
950
|
-
|
|
951
847
|
modalBoxElem.style.left = "".concat(left, "px");
|
|
952
848
|
modalBoxElem.style.top = "".concat(top, "px");
|
|
953
849
|
modalBoxElem.className = modalBoxElem.className.replace(/\s?is--drag/, '') + ' is--drag';
|
|
954
850
|
};
|
|
955
|
-
|
|
956
851
|
document.onmouseup = function () {
|
|
957
852
|
document.onmousemove = domMousemove;
|
|
958
853
|
document.onmouseup = domMouseup;
|
|
959
|
-
|
|
960
854
|
if (remember && storage) {
|
|
961
855
|
_this11.$nextTick(function () {
|
|
962
856
|
_this11.savePosStorage();
|
|
963
857
|
});
|
|
964
858
|
}
|
|
965
|
-
|
|
966
859
|
setTimeout(function () {
|
|
967
860
|
modalBoxElem.className = modalBoxElem.className.replace(/\s?is--drag/, '');
|
|
968
861
|
}, 50);
|
|
@@ -971,25 +864,19 @@ var _default2 = {
|
|
|
971
864
|
},
|
|
972
865
|
dragEvent: function dragEvent(evnt) {
|
|
973
866
|
var _this12 = this;
|
|
974
|
-
|
|
975
867
|
evnt.preventDefault();
|
|
976
868
|
var $listeners = this.$listeners,
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
869
|
+
marginSize = this.marginSize,
|
|
870
|
+
_this$events8 = this.events,
|
|
871
|
+
events = _this$events8 === void 0 ? {} : _this$events8,
|
|
872
|
+
remember = this.remember,
|
|
873
|
+
storage = this.storage;
|
|
983
874
|
var _DomTools$getDomNode3 = _dom.default.getDomNode(),
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
875
|
+
visibleHeight = _DomTools$getDomNode3.visibleHeight,
|
|
876
|
+
visibleWidth = _DomTools$getDomNode3.visibleWidth;
|
|
987
877
|
var type = evnt.target.getAttribute('type');
|
|
988
|
-
|
|
989
878
|
var minWidth = _xeUtils.default.toNumber(this.minWidth);
|
|
990
|
-
|
|
991
879
|
var minHeight = _xeUtils.default.toNumber(this.minHeight);
|
|
992
|
-
|
|
993
880
|
var maxWidth = visibleWidth;
|
|
994
881
|
var maxHeight = visibleHeight;
|
|
995
882
|
var modalBoxElem = this.getBox();
|
|
@@ -1005,163 +892,130 @@ var _default2 = {
|
|
|
1005
892
|
type: 'resize',
|
|
1006
893
|
$modal: this
|
|
1007
894
|
};
|
|
1008
|
-
|
|
1009
895
|
document.onmousemove = function (evnt) {
|
|
1010
896
|
evnt.preventDefault();
|
|
1011
897
|
var dragLeft;
|
|
1012
898
|
var dragTop;
|
|
1013
899
|
var width;
|
|
1014
900
|
var height;
|
|
1015
|
-
|
|
1016
901
|
switch (type) {
|
|
1017
902
|
case 'wl':
|
|
1018
903
|
dragLeft = disX - evnt.clientX;
|
|
1019
904
|
width = dragLeft + clientWidth;
|
|
1020
|
-
|
|
1021
905
|
if (offsetLeft - dragLeft > marginSize) {
|
|
1022
906
|
if (width > minWidth) {
|
|
1023
907
|
modalBoxElem.style.width = "".concat(width < maxWidth ? width : maxWidth, "px");
|
|
1024
908
|
modalBoxElem.style.left = "".concat(offsetLeft - dragLeft, "px");
|
|
1025
909
|
}
|
|
1026
910
|
}
|
|
1027
|
-
|
|
1028
911
|
break;
|
|
1029
|
-
|
|
1030
912
|
case 'swst':
|
|
1031
913
|
dragLeft = disX - evnt.clientX;
|
|
1032
914
|
dragTop = disY - evnt.clientY;
|
|
1033
915
|
width = dragLeft + clientWidth;
|
|
1034
916
|
height = dragTop + clientHeight;
|
|
1035
|
-
|
|
1036
917
|
if (offsetLeft - dragLeft > marginSize) {
|
|
1037
918
|
if (width > minWidth) {
|
|
1038
919
|
modalBoxElem.style.width = "".concat(width < maxWidth ? width : maxWidth, "px");
|
|
1039
920
|
modalBoxElem.style.left = "".concat(offsetLeft - dragLeft, "px");
|
|
1040
921
|
}
|
|
1041
922
|
}
|
|
1042
|
-
|
|
1043
923
|
if (offsetTop - dragTop > marginSize) {
|
|
1044
924
|
if (height > minHeight) {
|
|
1045
925
|
modalBoxElem.style.height = "".concat(height < maxHeight ? height : maxHeight, "px");
|
|
1046
926
|
modalBoxElem.style.top = "".concat(offsetTop - dragTop, "px");
|
|
1047
927
|
}
|
|
1048
928
|
}
|
|
1049
|
-
|
|
1050
929
|
break;
|
|
1051
|
-
|
|
1052
930
|
case 'swlb':
|
|
1053
931
|
dragLeft = disX - evnt.clientX;
|
|
1054
932
|
dragTop = evnt.clientY - disY;
|
|
1055
933
|
width = dragLeft + clientWidth;
|
|
1056
934
|
height = dragTop + clientHeight;
|
|
1057
|
-
|
|
1058
935
|
if (offsetLeft - dragLeft > marginSize) {
|
|
1059
936
|
if (width > minWidth) {
|
|
1060
937
|
modalBoxElem.style.width = "".concat(width < maxWidth ? width : maxWidth, "px");
|
|
1061
938
|
modalBoxElem.style.left = "".concat(offsetLeft - dragLeft, "px");
|
|
1062
939
|
}
|
|
1063
940
|
}
|
|
1064
|
-
|
|
1065
941
|
if (offsetTop + height + marginSize < visibleHeight) {
|
|
1066
942
|
if (height > minHeight) {
|
|
1067
943
|
modalBoxElem.style.height = "".concat(height < maxHeight ? height : maxHeight, "px");
|
|
1068
944
|
}
|
|
1069
945
|
}
|
|
1070
|
-
|
|
1071
946
|
break;
|
|
1072
|
-
|
|
1073
947
|
case 'st':
|
|
1074
948
|
dragTop = disY - evnt.clientY;
|
|
1075
949
|
height = clientHeight + dragTop;
|
|
1076
|
-
|
|
1077
950
|
if (offsetTop - dragTop > marginSize) {
|
|
1078
951
|
if (height > minHeight) {
|
|
1079
952
|
modalBoxElem.style.height = "".concat(height < maxHeight ? height : maxHeight, "px");
|
|
1080
953
|
modalBoxElem.style.top = "".concat(offsetTop - dragTop, "px");
|
|
1081
954
|
}
|
|
1082
955
|
}
|
|
1083
|
-
|
|
1084
956
|
break;
|
|
1085
|
-
|
|
1086
957
|
case 'wr':
|
|
1087
958
|
dragLeft = evnt.clientX - disX;
|
|
1088
959
|
width = dragLeft + clientWidth;
|
|
1089
|
-
|
|
1090
960
|
if (offsetLeft + width + marginSize < visibleWidth) {
|
|
1091
961
|
if (width > minWidth) {
|
|
1092
962
|
modalBoxElem.style.width = "".concat(width < maxWidth ? width : maxWidth, "px");
|
|
1093
963
|
}
|
|
1094
964
|
}
|
|
1095
|
-
|
|
1096
965
|
break;
|
|
1097
|
-
|
|
1098
966
|
case 'sest':
|
|
1099
967
|
dragLeft = evnt.clientX - disX;
|
|
1100
968
|
dragTop = disY - evnt.clientY;
|
|
1101
969
|
width = dragLeft + clientWidth;
|
|
1102
970
|
height = dragTop + clientHeight;
|
|
1103
|
-
|
|
1104
971
|
if (offsetLeft + width + marginSize < visibleWidth) {
|
|
1105
972
|
if (width > minWidth) {
|
|
1106
973
|
modalBoxElem.style.width = "".concat(width < maxWidth ? width : maxWidth, "px");
|
|
1107
974
|
}
|
|
1108
975
|
}
|
|
1109
|
-
|
|
1110
976
|
if (offsetTop - dragTop > marginSize) {
|
|
1111
977
|
if (height > minHeight) {
|
|
1112
978
|
modalBoxElem.style.height = "".concat(height < maxHeight ? height : maxHeight, "px");
|
|
1113
979
|
modalBoxElem.style.top = "".concat(offsetTop - dragTop, "px");
|
|
1114
980
|
}
|
|
1115
981
|
}
|
|
1116
|
-
|
|
1117
982
|
break;
|
|
1118
|
-
|
|
1119
983
|
case 'selb':
|
|
1120
984
|
dragLeft = evnt.clientX - disX;
|
|
1121
985
|
dragTop = evnt.clientY - disY;
|
|
1122
986
|
width = dragLeft + clientWidth;
|
|
1123
987
|
height = dragTop + clientHeight;
|
|
1124
|
-
|
|
1125
988
|
if (offsetLeft + width + marginSize < visibleWidth) {
|
|
1126
989
|
if (width > minWidth) {
|
|
1127
990
|
modalBoxElem.style.width = "".concat(width < maxWidth ? width : maxWidth, "px");
|
|
1128
991
|
}
|
|
1129
992
|
}
|
|
1130
|
-
|
|
1131
993
|
if (offsetTop + height + marginSize < visibleHeight) {
|
|
1132
994
|
if (height > minHeight) {
|
|
1133
995
|
modalBoxElem.style.height = "".concat(height < maxHeight ? height : maxHeight, "px");
|
|
1134
996
|
}
|
|
1135
997
|
}
|
|
1136
|
-
|
|
1137
998
|
break;
|
|
1138
|
-
|
|
1139
999
|
case 'sb':
|
|
1140
1000
|
dragTop = evnt.clientY - disY;
|
|
1141
1001
|
height = dragTop + clientHeight;
|
|
1142
|
-
|
|
1143
1002
|
if (offsetTop + height + marginSize < visibleHeight) {
|
|
1144
1003
|
if (height > minHeight) {
|
|
1145
1004
|
modalBoxElem.style.height = "".concat(height < maxHeight ? height : maxHeight, "px");
|
|
1146
1005
|
}
|
|
1147
1006
|
}
|
|
1148
|
-
|
|
1149
1007
|
break;
|
|
1150
1008
|
}
|
|
1151
|
-
|
|
1152
1009
|
modalBoxElem.className = modalBoxElem.className.replace(/\s?is--drag/, '') + ' is--drag';
|
|
1153
|
-
|
|
1154
1010
|
if (remember && storage) {
|
|
1155
1011
|
_this12.savePosStorage();
|
|
1156
1012
|
}
|
|
1157
|
-
|
|
1158
1013
|
if ($listeners.zoom) {
|
|
1159
1014
|
_this12.$emit('zoom', params);
|
|
1160
1015
|
} else if (events.zoom) {
|
|
1161
1016
|
events.zoom.call(_this12, params);
|
|
1162
1017
|
}
|
|
1163
1018
|
};
|
|
1164
|
-
|
|
1165
1019
|
document.onmouseup = function () {
|
|
1166
1020
|
_this12.zoomLocat = null;
|
|
1167
1021
|
document.onmousemove = domMousemove;
|
|
@@ -1173,59 +1027,49 @@ var _default2 = {
|
|
|
1173
1027
|
},
|
|
1174
1028
|
getStorageMap: function getStorageMap(key) {
|
|
1175
1029
|
var version = _conf.default.version;
|
|
1176
|
-
|
|
1177
1030
|
var rest = _xeUtils.default.toStringJSON(localStorage.getItem(key));
|
|
1178
|
-
|
|
1179
1031
|
return rest && rest._v === version ? rest : {
|
|
1180
1032
|
_v: version
|
|
1181
1033
|
};
|
|
1182
1034
|
},
|
|
1183
1035
|
hasPosStorage: function hasPosStorage() {
|
|
1184
1036
|
var id = this.id,
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1037
|
+
remember = this.remember,
|
|
1038
|
+
storage = this.storage,
|
|
1039
|
+
storageKey = this.storageKey;
|
|
1188
1040
|
return !!(remember && storage && this.getStorageMap(storageKey)[id]);
|
|
1189
1041
|
},
|
|
1190
1042
|
restorePosStorage: function restorePosStorage() {
|
|
1191
1043
|
var id = this.id,
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1044
|
+
remember = this.remember,
|
|
1045
|
+
storage = this.storage,
|
|
1046
|
+
storageKey = this.storageKey;
|
|
1196
1047
|
if (remember && storage) {
|
|
1197
1048
|
var posStorage = this.getStorageMap(storageKey)[id];
|
|
1198
|
-
|
|
1199
1049
|
if (posStorage) {
|
|
1200
1050
|
var modalBoxElem = this.getBox();
|
|
1201
|
-
|
|
1202
1051
|
var _posStorage$split = posStorage.split(','),
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1052
|
+
_posStorage$split2 = _slicedToArray(_posStorage$split, 8),
|
|
1053
|
+
left = _posStorage$split2[0],
|
|
1054
|
+
top = _posStorage$split2[1],
|
|
1055
|
+
width = _posStorage$split2[2],
|
|
1056
|
+
height = _posStorage$split2[3],
|
|
1057
|
+
zoomLeft = _posStorage$split2[4],
|
|
1058
|
+
zoomTop = _posStorage$split2[5],
|
|
1059
|
+
zoomWidth = _posStorage$split2[6],
|
|
1060
|
+
zoomHeight = _posStorage$split2[7];
|
|
1213
1061
|
if (left) {
|
|
1214
1062
|
modalBoxElem.style.left = "".concat(left, "px");
|
|
1215
1063
|
}
|
|
1216
|
-
|
|
1217
1064
|
if (top) {
|
|
1218
1065
|
modalBoxElem.style.top = "".concat(top, "px");
|
|
1219
1066
|
}
|
|
1220
|
-
|
|
1221
1067
|
if (width) {
|
|
1222
1068
|
modalBoxElem.style.width = "".concat(width, "px");
|
|
1223
1069
|
}
|
|
1224
|
-
|
|
1225
1070
|
if (height) {
|
|
1226
1071
|
modalBoxElem.style.height = "".concat(height, "px");
|
|
1227
1072
|
}
|
|
1228
|
-
|
|
1229
1073
|
if (zoomLeft && zoomTop) {
|
|
1230
1074
|
this.zoomLocat = {
|
|
1231
1075
|
left: zoomLeft,
|
|
@@ -1239,11 +1083,10 @@ var _default2 = {
|
|
|
1239
1083
|
},
|
|
1240
1084
|
savePosStorage: function savePosStorage() {
|
|
1241
1085
|
var id = this.id,
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1086
|
+
remember = this.remember,
|
|
1087
|
+
storage = this.storage,
|
|
1088
|
+
storageKey = this.storageKey,
|
|
1089
|
+
zoomLocat = this.zoomLocat;
|
|
1247
1090
|
if (remember && storage) {
|
|
1248
1091
|
var modalBoxElem = this.getBox();
|
|
1249
1092
|
var posStorageMap = this.getStorageMap(storageKey);
|