vxe-table 3.4.15 → 3.5.0-beta.2
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/README.md +1 -1
- package/helper/vetur/attributes.json +30 -10
- package/helper/vetur/tags.json +7 -2
- package/lib/button/src/button.js +19 -9
- package/lib/button/src/button.min.js +1 -1
- package/lib/checkbox/src/checkbox.js +2 -2
- package/lib/checkbox/src/checkbox.min.js +1 -1
- package/lib/edit/src/mixin.js +26 -18
- package/lib/edit/src/mixin.min.js +1 -1
- package/lib/export/src/export-panel.js +2 -2
- package/lib/export/src/export-panel.min.js +1 -1
- package/lib/export/src/import-panel.js +2 -2
- package/lib/export/src/import-panel.min.js +1 -1
- package/lib/export/src/mixin.js +26 -24
- package/lib/export/src/mixin.min.js +1 -1
- package/lib/filter/src/mixin.js +4 -4
- package/lib/filter/src/mixin.min.js +1 -1
- package/lib/filter/src/panel.js +2 -2
- package/lib/filter/src/panel.min.js +1 -1
- package/lib/footer/src/footer.js +7 -4
- package/lib/footer/src/footer.min.js +1 -1
- package/lib/form/src/form-gather.js +2 -2
- package/lib/form/src/form-gather.min.js +1 -1
- package/lib/form/src/form-item.js +5 -5
- package/lib/form/src/form-item.min.js +1 -1
- package/lib/form/src/form.js +49 -64
- package/lib/form/src/form.min.js +1 -1
- package/lib/form/src/render.js +17 -14
- package/lib/form/src/render.min.js +1 -1
- package/lib/form/src/util.js +2 -2
- package/lib/form/src/util.min.js +1 -1
- package/lib/grid/src/grid.js +44 -34
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/header/src/header.js +10 -8
- package/lib/header/src/header.min.js +1 -1
- package/lib/index.css +1 -1
- package/lib/index.umd.js +2390 -1553
- package/lib/index.umd.min.js +1 -2
- package/lib/input/src/input.js +30 -18
- package/lib/input/src/input.min.js +1 -1
- package/lib/keyboard/src/mixin.js +12 -8
- package/lib/keyboard/src/mixin.min.js +1 -1
- package/lib/list/src/list.js +7 -5
- package/lib/list/src/list.min.js +1 -1
- package/lib/menu/src/mixin.js +24 -14
- package/lib/menu/src/mixin.min.js +1 -1
- package/lib/menu/src/panel.js +3 -3
- package/lib/menu/src/panel.min.js +1 -1
- package/lib/modal/src/modal.js +24 -12
- package/lib/modal/src/modal.min.js +1 -1
- package/lib/pulldown/src/pulldown.js +16 -12
- package/lib/pulldown/src/pulldown.min.js +1 -1
- package/lib/radio/src/button.js +2 -2
- package/lib/radio/src/button.min.js +1 -1
- package/lib/radio/src/radio.js +2 -2
- package/lib/radio/src/radio.min.js +1 -1
- package/lib/select/src/select.js +42 -21
- package/lib/select/src/select.min.js +1 -1
- package/lib/select/style/style.css +1 -1
- package/lib/select/style/style.min.css +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/switch/src/switch.js +4 -4
- package/lib/switch/src/switch.min.js +1 -1
- package/lib/table/src/body.js +34 -36
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +22 -14
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/column.js +6 -4
- package/lib/table/src/column.min.js +1 -1
- package/lib/table/src/columnInfo.js +202 -0
- package/lib/table/src/columnInfo.min.js +1 -0
- package/lib/table/src/methods.js +247 -263
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +104 -129
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +52 -3
- package/lib/table/src/util.min.js +1 -1
- package/lib/textarea/src/textarea.js +2 -2
- package/lib/textarea/src/textarea.min.js +1 -1
- package/lib/toolbar/src/toolbar.js +16 -10
- package/lib/toolbar/src/toolbar.min.js +1 -1
- package/lib/tools/{src/dom.js → dom.js} +0 -0
- package/lib/tools/{src/dom.min.js → dom.min.js} +0 -0
- package/lib/tools/{src/event.js → event.js} +3 -6
- package/lib/tools/event.min.js +1 -0
- package/lib/tools/log.js +29 -0
- package/lib/tools/log.min.js +1 -0
- package/lib/tools/{src/resize.js → resize.js} +1 -1
- package/lib/tools/resize.min.js +1 -0
- package/lib/tools/utils.js +142 -0
- package/lib/tools/utils.min.js +1 -0
- package/lib/tooltip/src/tooltip.js +59 -34
- package/lib/tooltip/src/tooltip.min.js +1 -1
- package/lib/tooltip/style/style.css +1 -1
- package/lib/tooltip/style/style.min.css +1 -1
- package/lib/v-x-e-table/index.js +7 -4
- package/lib/v-x-e-table/index.min.js +1 -1
- package/lib/v-x-e-table/src/conf.js +14 -7
- package/lib/v-x-e-table/src/conf.min.js +1 -1
- package/lib/v-x-e-table/src/interceptor.js +4 -4
- package/lib/v-x-e-table/src/interceptor.min.js +1 -1
- package/lib/v-x-e-table/src/renderer.js +18 -10
- package/lib/v-x-e-table/src/renderer.min.js +1 -1
- package/lib/v-x-e-table/src/store.js +3 -3
- package/lib/v-x-e-table/src/store.min.js +1 -1
- package/lib/validator/src/mixin.js +4 -4
- package/lib/validator/src/mixin.min.js +1 -1
- package/package.json +1 -1
- package/packages/button/src/button.js +4 -2
- package/packages/checkbox/src/checkbox.js +2 -2
- package/packages/edit/src/mixin.js +7 -6
- package/packages/export/src/export-panel.js +1 -1
- package/packages/export/src/import-panel.js +1 -1
- package/packages/export/src/mixin.js +20 -19
- package/packages/filter/src/mixin.js +3 -3
- package/packages/filter/src/panel.js +1 -1
- package/packages/footer/src/footer.js +4 -2
- package/packages/form/src/form-gather.js +2 -2
- package/packages/form/src/form-item.js +4 -4
- package/packages/form/src/form.js +19 -32
- package/packages/form/src/render.js +9 -9
- package/packages/form/src/util.js +2 -2
- package/packages/grid/src/grid.js +22 -20
- package/packages/header/src/header.js +3 -2
- package/packages/input/src/input.js +6 -3
- package/packages/keyboard/src/mixin.js +1 -2
- package/packages/list/src/list.js +3 -2
- package/packages/menu/src/mixin.js +5 -3
- package/packages/menu/src/panel.js +3 -3
- package/packages/modal/src/modal.js +7 -4
- package/packages/pulldown/src/pulldown.js +3 -1
- package/packages/radio/src/button.js +2 -2
- package/packages/radio/src/radio.js +2 -2
- package/packages/select/src/select.js +19 -8
- package/packages/switch/src/switch.js +4 -4
- package/packages/table/src/body.js +26 -25
- package/packages/table/src/cell.js +8 -7
- package/packages/table/src/column.js +4 -2
- package/packages/table/src/columnInfo.js +149 -0
- package/packages/table/src/methods.js +73 -95
- package/packages/table/src/table.js +73 -103
- package/packages/table/src/util.js +30 -1
- package/packages/textarea/src/textarea.js +2 -2
- package/packages/toolbar/src/toolbar.js +7 -4
- package/packages/tools/{src/dom.js → dom.js} +0 -0
- package/packages/tools/{src/event.js → event.js} +1 -3
- package/packages/tools/log.js +16 -0
- package/packages/tools/{src/resize.js → resize.js} +1 -1
- package/packages/tools/utils.js +97 -0
- package/packages/tooltip/src/tooltip.js +46 -26
- package/packages/v-x-e-table/index.js +4 -2
- package/packages/v-x-e-table/src/conf.js +14 -7
- package/packages/v-x-e-table/src/interceptor.js +3 -3
- package/packages/v-x-e-table/src/renderer.js +4 -3
- package/packages/v-x-e-table/src/store.js +2 -2
- package/packages/validator/src/mixin.js +3 -3
- package/styles/select.scss +1 -1
- package/styles/tooltip.scss +1 -1
- package/types/v-x-e-table/index.d.ts +8 -0
- package/lib/tools/index.js +0 -76
- package/lib/tools/index.min.js +0 -1
- package/lib/tools/src/event.min.js +0 -1
- package/lib/tools/src/resize.min.js +0 -1
- package/lib/tools/src/utils.js +0 -365
- package/lib/tools/src/utils.min.js +0 -1
- package/packages/tools/index.js +0 -14
- package/packages/tools/src/utils.js +0 -272
package/lib/menu/src/mixin.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
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
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
@@ -7,10 +9,18 @@ exports.default = void 0;
|
|
|
7
9
|
|
|
8
10
|
var _xeUtils = _interopRequireDefault(require("xe-utils"));
|
|
9
11
|
|
|
10
|
-
var
|
|
12
|
+
var _utils = _interopRequireWildcard(require("../../tools/utils"));
|
|
13
|
+
|
|
14
|
+
var _dom = _interopRequireDefault(require("../../tools/dom"));
|
|
11
15
|
|
|
12
16
|
var _vXETable = _interopRequireDefault(require("../../v-x-e-table"));
|
|
13
17
|
|
|
18
|
+
var _log = require("../../tools/log");
|
|
19
|
+
|
|
20
|
+
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); }
|
|
21
|
+
|
|
22
|
+
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; }
|
|
23
|
+
|
|
14
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
25
|
|
|
16
26
|
var _default = {
|
|
@@ -36,7 +46,7 @@ var _default = {
|
|
|
36
46
|
});
|
|
37
47
|
|
|
38
48
|
if (keyCode === operKey) {
|
|
39
|
-
if (operRest &&
|
|
49
|
+
if (operRest && _utils.default.hasChildrenList(ctxMenuStore.selected)) {
|
|
40
50
|
ctxMenuStore.showChild = true;
|
|
41
51
|
} else {
|
|
42
52
|
ctxMenuStore.showChild = false;
|
|
@@ -81,8 +91,8 @@ var _default = {
|
|
|
81
91
|
var selected = editStore.selected;
|
|
82
92
|
var layoutList = ['header', 'body', 'footer'];
|
|
83
93
|
|
|
84
|
-
if ((0,
|
|
85
|
-
if (ctxMenuStore.visible && $refs.ctxWrapper &&
|
|
94
|
+
if ((0, _utils.isEnableConf)(menuConfig) || contextMenu) {
|
|
95
|
+
if (ctxMenuStore.visible && $refs.ctxWrapper && _dom.default.getEventTargetNode(evnt, $refs.ctxWrapper.$el).flag) {
|
|
86
96
|
evnt.preventDefault();
|
|
87
97
|
return;
|
|
88
98
|
}
|
|
@@ -122,7 +132,7 @@ var _default = {
|
|
|
122
132
|
for (var index = 0; index < layoutList.length; index++) {
|
|
123
133
|
var layout = layoutList[index];
|
|
124
134
|
|
|
125
|
-
var columnTargetNode =
|
|
135
|
+
var columnTargetNode = _dom.default.getEventTargetNode(evnt, this.$el, "vxe-".concat(layout, "--column"), function (target) {
|
|
126
136
|
// target=td|th,直接向上找 table 去匹配即可
|
|
127
137
|
return target.parentNode.parentNode.parentNode.getAttribute('xid') === tId;
|
|
128
138
|
});
|
|
@@ -156,7 +166,7 @@ var _default = {
|
|
|
156
166
|
|
|
157
167
|
if (this.$listeners["".concat(typePrefix, "cell-context-menu")]) {
|
|
158
168
|
if (process.env.NODE_ENV === 'development') {
|
|
159
|
-
|
|
169
|
+
(0, _log.warnLog)('vxe.error.delEvent', ["".concat(typePrefix, "cell-context-menu"), "".concat(typePrefix, "cell-menu")]);
|
|
160
170
|
}
|
|
161
171
|
|
|
162
172
|
this.emitEvent("".concat(typePrefix, "cell-context-menu"), _params, evnt);
|
|
@@ -165,7 +175,7 @@ var _default = {
|
|
|
165
175
|
}
|
|
166
176
|
|
|
167
177
|
return;
|
|
168
|
-
} else if (
|
|
178
|
+
} else if (_dom.default.getEventTargetNode(evnt, this.$el, "vxe-table--".concat(layout, "-wrapper"), function (target) {
|
|
169
179
|
return target.getAttribute('xid') === tId;
|
|
170
180
|
}).flag) {
|
|
171
181
|
if (ctxMenuOpts.trigger === 'cell') {
|
|
@@ -179,7 +189,7 @@ var _default = {
|
|
|
179
189
|
}
|
|
180
190
|
}
|
|
181
191
|
|
|
182
|
-
if ($refs.filterWrapper && !
|
|
192
|
+
if ($refs.filterWrapper && !_dom.default.getEventTargetNode(evnt, $refs.filterWrapper.$el).flag) {
|
|
183
193
|
this.closeFilter();
|
|
184
194
|
}
|
|
185
195
|
|
|
@@ -212,7 +222,7 @@ var _default = {
|
|
|
212
222
|
|
|
213
223
|
_this.updateZindex();
|
|
214
224
|
|
|
215
|
-
var _DomTools$getDomNode =
|
|
225
|
+
var _DomTools$getDomNode = _dom.default.getDomNode(),
|
|
216
226
|
scrollTop = _DomTools$getDomNode.scrollTop,
|
|
217
227
|
scrollLeft = _DomTools$getDomNode.scrollLeft,
|
|
218
228
|
visibleHeight = _DomTools$getDomNode.visibleHeight,
|
|
@@ -241,7 +251,7 @@ var _default = {
|
|
|
241
251
|
var clientHeight = ctxElem.clientHeight;
|
|
242
252
|
var clientWidth = ctxElem.clientWidth;
|
|
243
253
|
|
|
244
|
-
var _DomTools$getAbsolute =
|
|
254
|
+
var _DomTools$getAbsolute = _dom.default.getAbsolutePos(ctxElem),
|
|
245
255
|
boundingTop = _DomTools$getAbsolute.boundingTop,
|
|
246
256
|
boundingLeft = _DomTools$getAbsolute.boundingLeft;
|
|
247
257
|
|
|
@@ -266,7 +276,7 @@ var _default = {
|
|
|
266
276
|
_this.scrollToRow(row, column).then(function () {
|
|
267
277
|
var cell = _this.getCell(row, column);
|
|
268
278
|
|
|
269
|
-
var _DomTools$getAbsolute2 =
|
|
279
|
+
var _DomTools$getAbsolute2 = _dom.default.getAbsolutePos(cell),
|
|
270
280
|
boundingTop = _DomTools$getAbsolute2.boundingTop,
|
|
271
281
|
boundingLeft = _DomTools$getAbsolute2.boundingLeft;
|
|
272
282
|
|
|
@@ -295,14 +305,14 @@ var _default = {
|
|
|
295
305
|
ctxMenuStore.selectChild = child;
|
|
296
306
|
|
|
297
307
|
if (!child) {
|
|
298
|
-
ctxMenuStore.showChild =
|
|
308
|
+
ctxMenuStore.showChild = _utils.default.hasChildrenList(item);
|
|
299
309
|
|
|
300
310
|
if (ctxMenuStore.showChild) {
|
|
301
311
|
this.$nextTick(function () {
|
|
302
312
|
var childWrapperElem = menuElem.nextElementSibling;
|
|
303
313
|
|
|
304
314
|
if (childWrapperElem) {
|
|
305
|
-
var _DomTools$getAbsolute3 =
|
|
315
|
+
var _DomTools$getAbsolute3 = _dom.default.getAbsolutePos(menuElem),
|
|
306
316
|
boundingTop = _DomTools$getAbsolute3.boundingTop,
|
|
307
317
|
boundingLeft = _DomTools$getAbsolute3.boundingLeft,
|
|
308
318
|
visibleHeight = _DomTools$getAbsolute3.visibleHeight,
|
|
@@ -368,7 +378,7 @@ var _default = {
|
|
|
368
378
|
|
|
369
379
|
if (this.$listeners['context-menu-click']) {
|
|
370
380
|
if (process.env.NODE_ENV === 'development') {
|
|
371
|
-
|
|
381
|
+
(0, _log.warnLog)('vxe.error.delEvent', ['context-menu-click', 'menu-click']);
|
|
372
382
|
}
|
|
373
383
|
|
|
374
384
|
this.emitEvent('context-menu-click', params, evnt);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _xeUtils=_interopRequireDefault(require("xe-utils")),
|
|
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")),_utils=_interopRequireWildcard(require("../../tools/utils")),_dom=_interopRequireDefault(require("../../tools/dom")),_vXETable=_interopRequireDefault(require("../../v-x-e-table")),_log=require("../../tools/log");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,o,i={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&((o=l?Object.getOwnPropertyDescriptor(e,n):null)&&(o.get||o.set)?Object.defineProperty(i,n,o):i[n]=e[n]);return i.default=e,t&&t.set(e,i),i}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var _default={methods:{_closeMenu:function(){return Object.assign(this.ctxMenuStore,{visible:!1,selected:null,selectChild:null,showChild:!1}),this.$nextTick()},moveCtxMenu:function(e,t,n,o,i,l,r){var s,u=_xeUtils.default.findIndexOf(r,function(e){return n[o]===e});if(t===i)l&&_utils.default.hasChildrenList(n.selected)?n.showChild=!0:(n.showChild=!1,n.selectChild=null);else if(38===t){for(var c=u-1;0<=c;c--)if(!1!==r[c].visible){s=r[c];break}n[o]=s||r[r.length-1]}else if(40===t){for(var a=u+1;a<r.length;a++)if(!1!==r[a].visible){s=r[a];break}n[o]=s||r[0]}else!n[o]||13!==t&&32!==t||this.ctxMenuLinkEvent(e,n[o])},handleGlobalContextmenuEvent:function(e){var t=this.$refs,n=this.tId,o=this.editStore,i=this.menuConfig,l=this.contextMenu,r=this.ctxMenuStore,s=this.ctxMenuOpts,u=this.mouseConfig,c=this.mouseOpts,o=o.selected,a=["header","body","footer"];if((0,_utils.isEnableConf)(i)||l){if(r.visible&&t.ctxWrapper&&_dom.default.getEventTargetNode(e,t.ctxWrapper.$el).flag)return void e.preventDefault();if(this._keyCtx){i="body",l={type:i,$grid:this.$xegrid,$table:this,keyboard:!0,columns:this.visibleColumn.slice(0),$event:e};if(u&&c.area){r=this.getActiveCellArea();if(r&&r.row&&r.column)return l.row=r.row,l.column=r.column,void this.openContextMenu(e,i,l)}else if(u&&c.selected&&o.row&&o.column)return l.row=o.row,l.column=o.column,void this.openContextMenu(e,i,l)}for(var d=0;d<a.length;d++){var f=a[d],h=_dom.default.getEventTargetNode(e,this.$el,"vxe-".concat(f,"--column"),function(e){return e.parentNode.parentNode.parentNode.getAttribute("xid")===n}),p={type:f,$grid:this.$xegrid,$table:this,columns:this.visibleColumn.slice(0),$event:e};if(h.flag){var v=h.targetElem,g=this.getColumnNode(v).item,h="".concat(f,"-");return Object.assign(p,{column:g,columnIndex:this.getColumnIndex(g),cell:v}),"body"===f&&(v=this.getRowNode(v.parentNode).item,h="",p.row=v,p.rowIndex=this.getRowIndex(v)),this.openContextMenu(e,f,p),void(this.$listeners["".concat(h,"cell-context-menu")]?("development"===process.env.NODE_ENV&&(0,_log.warnLog)("vxe.error.delEvent",["".concat(h,"cell-context-menu"),"".concat(h,"cell-menu")]),this.emitEvent("".concat(h,"cell-context-menu"),p,e)):this.emitEvent("".concat(h,"cell-menu"),p,e))}if(_dom.default.getEventTargetNode(e,this.$el,"vxe-table--".concat(f,"-wrapper"),function(e){return e.getAttribute("xid")===n}).flag)return void("cell"===s.trigger?e.preventDefault():this.openContextMenu(e,f,p))}}t.filterWrapper&&!_dom.default.getEventTargetNode(e,t.filterWrapper.$el).flag&&this.closeFilter(),this.closeMenu()},openContextMenu:function(t,e,n){var f,h=this,o=this.isCtxMenu,p=this.ctxMenuStore,i=this.ctxMenuOpts,e=i[e],v=i.visibleMethod;e&&(f=e.options,e.disabled?t.preventDefault():o&&f&&f.length&&(n.options=f,this.preventEvent(t,"event.showMenu",n,function(){var i,l,r,s,u,c,o,e,a,d;!v||v(n)?(t.preventDefault(),h.updateZindex(),e=_dom.default.getDomNode(),i=e.scrollTop,l=e.scrollLeft,r=e.visibleHeight,s=e.visibleWidth,u=t.clientY+i,c=t.clientX+l,o=function(){Object.assign(p,{args:n,visible:!0,list:f,selected:null,selectChild:null,showChild:!1,style:{zIndex:h.tZindex,top:"".concat(u,"px"),left:"".concat(c,"px")}}),h.$nextTick(function(){var e=h.$refs.ctxWrapper.$el,t=e.clientHeight,n=e.clientWidth,o=_dom.default.getAbsolutePos(e),e=o.boundingTop,o=o.boundingLeft+n-s;-10<e+t-r&&(p.style.top="".concat(Math.max(i+2,u-t-2),"px")),-10<o&&(p.style.left="".concat(Math.max(l+2,c-n-2),"px"))})},e=n.keyboard,a=n.row,d=n.column,e&&a&&d?h.scrollToRow(a,d).then(function(){var e=h.getCell(a,d),t=_dom.default.getAbsolutePos(e),n=t.boundingTop,t=t.boundingLeft;u=n+i+Math.floor(e.offsetHeight/2),c=t+l+Math.floor(e.offsetWidth/2),o()}):o()):h.closeMenu()}))),this.closeFilter()},ctxMenuMouseoverEvent:function(e,t,n){var s=e.currentTarget,o=this.ctxMenuStore;e.preventDefault(),e.stopPropagation(),o.selected=t,(o.selectChild=n)||(o.showChild=_utils.default.hasChildrenList(t),o.showChild&&this.$nextTick(function(){var e,t,n,o,i,l,r=s.nextElementSibling;r&&(o=(n=_dom.default.getAbsolutePos(s)).boundingTop,i=n.boundingLeft,e=n.visibleHeight,l=n.visibleWidth,t=o+s.offsetHeight,o=n="",i+s.offsetWidth+r.offsetWidth>l-10&&(n="auto",o="".concat(s.offsetWidth,"px")),l=i="",t+r.offsetHeight>e-10&&(i="auto",l="0"),r.style.left=n,r.style.right=o,r.style.top=i,r.style.bottom=l)}))},ctxMenuMouseoutEvent:function(e,t){var n=this.ctxMenuStore;t.children||(n.selected=null),n.selectChild=null},ctxMenuLinkEvent:function(e,t){var n;t.disabled||!t.code&&t.children&&t.children.length||(n=_vXETable.default.menus.get(t.code),t=Object.assign({menu:t,$grid:this.$xegrid,$table:this,$event:e},this.ctxMenuStore.args),n&&n.call(this,t,e),this.$listeners["context-menu-click"]?("development"===process.env.NODE_ENV&&(0,_log.warnLog)("vxe.error.delEvent",["context-menu-click","menu-click"]),this.emitEvent("context-menu-click",t,e)):this.emitEvent("menu-click",t,e),this.closeMenu())}}};exports.default=_default;
|
package/lib/menu/src/panel.js
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _utils = require("../../tools/utils");
|
|
9
9
|
|
|
10
10
|
var _default = {
|
|
11
11
|
name: 'VxeTableContextMenu',
|
|
@@ -64,7 +64,7 @@ var _default = {
|
|
|
64
64
|
class: ['vxe-context-menu--link-prefix', item.prefixIcon]
|
|
65
65
|
}), h('span', {
|
|
66
66
|
class: 'vxe-context-menu--link-content'
|
|
67
|
-
},
|
|
67
|
+
}, (0, _utils.getFuncText)(item.name)), h('i', {
|
|
68
68
|
class: ['vxe-context-menu--link-suffix', hasChildMenus ? item.suffixIcon || 'suffix--haschild' : item.suffixIcon]
|
|
69
69
|
})]), hasChildMenus ? h('ul', {
|
|
70
70
|
class: ['vxe-table--context-menu-clild-wrapper', {
|
|
@@ -94,7 +94,7 @@ var _default = {
|
|
|
94
94
|
class: ['vxe-context-menu--link-prefix', child.prefixIcon]
|
|
95
95
|
}), h('span', {
|
|
96
96
|
class: 'vxe-context-menu--link-content'
|
|
97
|
-
},
|
|
97
|
+
}, (0, _utils.getFuncText)(child.name))])]);
|
|
98
98
|
})) : null]);
|
|
99
99
|
}));
|
|
100
100
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _utils=require("../../tools/utils"),_default={name:"VxeTableContextMenu",props:{ctxMenuStore:Object,ctxMenuOpts:Object},mounted:function(){document.body.appendChild(this.$el)},beforeDestroy:function(){var e=this.$el;e.parentNode&&e.parentNode.removeChild(e)},render:function(i){var l=this.$parent,n=this._e,e=this.ctxMenuOpts,o=this.ctxMenuStore;return i("div",{class:["vxe-table--context-menu-wrapper",e.className],style:o.style},o.list.map(function(e,s){return e.every(function(e){return!1===e.visible})?n():i("ul",{class:"vxe-context-menu--option-wrapper",key:s},e.map(function(t,c){var e=t.children&&t.children.some(function(e){return!1!==e.visible});return!1===t.visible?null:i("li",{class:[t.className,{"link--disabled":t.disabled,"link--active":t===o.selected}],key:"".concat(s,"_").concat(c)},[i("a",{class:"vxe-context-menu--link",on:{click:function(e){l.ctxMenuLinkEvent(e,t)},mouseover:function(e){l.ctxMenuMouseoverEvent(e,t)},mouseout:function(e){l.ctxMenuMouseoutEvent(e,t)}}},[i("i",{class:["vxe-context-menu--link-prefix",t.prefixIcon]}),i("span",{class:"vxe-context-menu--link-content"},(0,_utils.getFuncText)(t.name)),i("i",{class:["vxe-context-menu--link-suffix",e?t.suffixIcon||"suffix--haschild":t.suffixIcon]})]),e?i("ul",{class:["vxe-table--context-menu-clild-wrapper",{"is--show":t===o.selected&&o.showChild}]},t.children.map(function(n,e){return!1===n.visible?null:i("li",{class:[n.className,{"link--disabled":n.disabled,"link--active":n===o.selectChild}],key:"".concat(s,"_").concat(c,"_").concat(e)},[i("a",{class:"vxe-context-menu--link",on:{click:function(e){l.ctxMenuLinkEvent(e,n)},mouseover:function(e){l.ctxMenuMouseoverEvent(e,t,n)},mouseout:function(e){l.ctxMenuMouseoutEvent(e,t,n)}}},[i("i",{class:["vxe-context-menu--link-prefix",n.prefixIcon]}),i("span",{class:"vxe-context-menu--link-content"},(0,_utils.getFuncText)(n.name))])])})):null])}))}))}};exports.default=_default;
|
package/lib/modal/src/modal.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
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
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
@@ -11,7 +13,17 @@ var _size = _interopRequireDefault(require("../../mixins/size"));
|
|
|
11
13
|
|
|
12
14
|
var _xeUtils = _interopRequireDefault(require("xe-utils"));
|
|
13
15
|
|
|
14
|
-
var
|
|
16
|
+
var _utils = _interopRequireWildcard(require("../../tools/utils"));
|
|
17
|
+
|
|
18
|
+
var _dom = _interopRequireDefault(require("../../tools/dom"));
|
|
19
|
+
|
|
20
|
+
var _event = require("../../tools/event");
|
|
21
|
+
|
|
22
|
+
var _log = require("../../tools/log");
|
|
23
|
+
|
|
24
|
+
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); }
|
|
25
|
+
|
|
26
|
+
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; }
|
|
15
27
|
|
|
16
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
29
|
|
|
@@ -252,7 +264,7 @@ var _default2 = {
|
|
|
252
264
|
},
|
|
253
265
|
created: function created() {
|
|
254
266
|
if (this.storage && !this.id) {
|
|
255
|
-
|
|
267
|
+
(0, _log.errLog)('vxe.error.reqProp', ['modal.id']);
|
|
256
268
|
}
|
|
257
269
|
},
|
|
258
270
|
mounted: function mounted() {
|
|
@@ -267,7 +279,7 @@ var _default2 = {
|
|
|
267
279
|
this.recalculate();
|
|
268
280
|
|
|
269
281
|
if (this.escClosable) {
|
|
270
|
-
|
|
282
|
+
_event.GlobalEvent.on(this, 'keydown', this.handleGlobalKeydownEvent);
|
|
271
283
|
} // 触发 inserted 事件
|
|
272
284
|
|
|
273
285
|
|
|
@@ -289,7 +301,7 @@ var _default2 = {
|
|
|
289
301
|
beforeDestroy: function beforeDestroy() {
|
|
290
302
|
var $el = this.$el;
|
|
291
303
|
|
|
292
|
-
|
|
304
|
+
_event.GlobalEvent.off(this, 'keydown');
|
|
293
305
|
|
|
294
306
|
this.removeMsgQueue();
|
|
295
307
|
|
|
@@ -372,7 +384,7 @@ var _default2 = {
|
|
|
372
384
|
$modal: this
|
|
373
385
|
}, h) : h('span', {
|
|
374
386
|
class: 'vxe-modal--title'
|
|
375
|
-
}, title ?
|
|
387
|
+
}, title ? (0, _utils.getFuncText)(title) : _conf.default.i18n('vxe.alert.title')), showZoom ? h('i', {
|
|
376
388
|
class: ['vxe-modal--zoom-btn', 'trigger--btn', zoomLocat ? _conf.default.icon.MODAL_ZOOM_OUT : _conf.default.icon.MODAL_ZOOM_IN],
|
|
377
389
|
attrs: {
|
|
378
390
|
title: _conf.default.i18n("vxe.modal.zoom".concat(zoomLocat ? 'Out' : 'In'))
|
|
@@ -398,7 +410,7 @@ var _default2 = {
|
|
|
398
410
|
class: 'vxe-modal--content'
|
|
399
411
|
}, defaultSlot ? !inited || destroyOnClose && !visible ? [] : defaultSlot.call(this, {
|
|
400
412
|
$modal: this
|
|
401
|
-
}, h) :
|
|
413
|
+
}, h) : (0, _utils.getFuncText)(content)), !isMsg ? h('div', {
|
|
402
414
|
class: ['vxe-loading', {
|
|
403
415
|
'is--visible': loading
|
|
404
416
|
}]
|
|
@@ -456,8 +468,8 @@ var _default2 = {
|
|
|
456
468
|
|
|
457
469
|
if (zIndex) {
|
|
458
470
|
this.modalZindex = zIndex;
|
|
459
|
-
} else if (modalZindex <
|
|
460
|
-
this.modalZindex =
|
|
471
|
+
} else if (modalZindex < _utils.default.getLastZIndex()) {
|
|
472
|
+
this.modalZindex = _utils.default.nextZIndex();
|
|
461
473
|
}
|
|
462
474
|
},
|
|
463
475
|
closeEvent: function closeEvent(evnt) {
|
|
@@ -762,7 +774,7 @@ var _default2 = {
|
|
|
762
774
|
|
|
763
775
|
var modalBoxElem = _this7.getBox();
|
|
764
776
|
|
|
765
|
-
var _DomTools$getDomNode =
|
|
777
|
+
var _DomTools$getDomNode = _dom.default.getDomNode(),
|
|
766
778
|
visibleHeight = _DomTools$getDomNode.visibleHeight,
|
|
767
779
|
visibleWidth = _DomTools$getDomNode.visibleWidth;
|
|
768
780
|
|
|
@@ -878,14 +890,14 @@ var _default2 = {
|
|
|
878
890
|
zoomLocat = this.zoomLocat;
|
|
879
891
|
var modalBoxElem = this.getBox();
|
|
880
892
|
|
|
881
|
-
if (!zoomLocat && evnt.button === 0 && !
|
|
893
|
+
if (!zoomLocat && evnt.button === 0 && !_dom.default.getEventTargetNode(evnt, modalBoxElem, 'trigger--btn').flag) {
|
|
882
894
|
evnt.preventDefault();
|
|
883
895
|
var domMousemove = document.onmousemove;
|
|
884
896
|
var domMouseup = document.onmouseup;
|
|
885
897
|
var disX = evnt.clientX - modalBoxElem.offsetLeft;
|
|
886
898
|
var disY = evnt.clientY - modalBoxElem.offsetTop;
|
|
887
899
|
|
|
888
|
-
var _DomTools$getDomNode2 =
|
|
900
|
+
var _DomTools$getDomNode2 = _dom.default.getDomNode(),
|
|
889
901
|
visibleHeight = _DomTools$getDomNode2.visibleHeight,
|
|
890
902
|
visibleWidth = _DomTools$getDomNode2.visibleWidth;
|
|
891
903
|
|
|
@@ -943,7 +955,7 @@ var _default2 = {
|
|
|
943
955
|
remember = this.remember,
|
|
944
956
|
storage = this.storage;
|
|
945
957
|
|
|
946
|
-
var _DomTools$getDomNode3 =
|
|
958
|
+
var _DomTools$getDomNode3 = _dom.default.getDomNode(),
|
|
947
959
|
visibleHeight = _DomTools$getDomNode3.visibleHeight,
|
|
948
960
|
visibleWidth = _DomTools$getDomNode3.visibleWidth;
|
|
949
961
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.msgQueue=exports.default=exports.allActivedModals=void 0;var _conf=_interopRequireDefault(require("../../v-x-e-table/src/conf")),_size=_interopRequireDefault(require("../../mixins/size")),_xeUtils=_interopRequireDefault(require("xe-utils")),_tools=require("../../tools");function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}function _slicedToArray(t,e){return _arrayWithHoles(t)||_iterableToArrayLimit(t,e)||_unsupportedIterableToArray(t,e)||_nonIterableRest()}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.")}function _unsupportedIterableToArray(t,e){if(t){if("string"==typeof t)return _arrayLikeToArray(t,e);var o=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(o="Object"===o&&t.constructor?t.constructor.name:o)||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(t,e):void 0}}function _arrayLikeToArray(t,e){(null==e||e>t.length)&&(e=t.length);for(var o=0,i=new Array(e);o<e;o++)i[o]=t[o];return i}function _iterableToArrayLimit(t,e){var o=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=o){var i,n,s=[],l=!0,a=!1;try{for(o=o.call(t);!(l=(i=o.next()).done)&&(s.push(i.value),!e||s.length!==e);l=!0);}catch(t){a=!0,n=t}finally{try{l||null==o.return||o.return()}finally{if(a)throw n}}return s}}function _arrayWithHoles(t){if(Array.isArray(t))return t}function _defineProperty(t,e,o){return e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}var allActivedModals=[];exports.allActivedModals=allActivedModals;var msgQueue=[];exports.msgQueue=msgQueue;var _default2={name:"VxeModal",mixins:[_size.default],props:{value:Boolean,id:String,type:{type:String,default:"modal"},loading:{type:Boolean,default:null},status:String,iconStatus:String,className:String,top:{type:[Number,String],default:function(){return _conf.default.modal.top}},position:[String,Object],title:String,duration:{type:[Number,String],default:function(){return _conf.default.modal.duration}},message:[String,Function],content:[String,Function],cancelButtonText:{type:String,default:function(){return _conf.default.modal.cancelButtonText}},confirmButtonText:{type:String,default:function(){return _conf.default.modal.confirmButtonText}},lockView:{type:Boolean,default:function(){return _conf.default.modal.lockView}},lockScroll:Boolean,mask:{type:Boolean,default:function(){return _conf.default.modal.mask}},maskClosable:{type:Boolean,default:function(){return _conf.default.modal.maskClosable}},escClosable:{type:Boolean,default:function(){return _conf.default.modal.escClosable}},resize:{type:Boolean,default:function(){return _conf.default.modal.resize}},showHeader:{type:Boolean,default:function(){return _conf.default.modal.showHeader}},showFooter:{type:Boolean,default:function(){return _conf.default.modal.showFooter}},showZoom:{type:Boolean,default:null},showClose:{type:Boolean,default:function(){return _conf.default.modal.showClose}},dblclickZoom:{type:Boolean,default:function(){return _conf.default.modal.dblclickZoom}},width:[Number,String],height:[Number,String],minWidth:{type:[Number,String],default:function(){return _conf.default.modal.minWidth}},minHeight:{type:[Number,String],default:function(){return _conf.default.modal.minHeight}},zIndex:Number,marginSize:{type:[Number,String],default:function(){return _conf.default.modal.marginSize}},fullscreen:Boolean,draggable:{type:Boolean,default:function(){return _conf.default.modal.draggable}},remember:{type:Boolean,default:function(){return _conf.default.modal.remember}},destroyOnClose:{type:Boolean,default:function(){return _conf.default.modal.destroyOnClose}},showTitleOverflow:{type:Boolean,default:function(){return _conf.default.modal.showTitleOverflow}},transfer:{type:Boolean,default:function(){return _conf.default.modal.transfer}},storage:{type:Boolean,default:function(){return _conf.default.modal.storage}},storageKey:{type:String,default:function(){return _conf.default.modal.storageKey}},animat:{type:Boolean,default:function(){return _conf.default.modal.animat}},size:{type:String,default:function(){return _conf.default.modal.size||_conf.default.size}},beforeHideMethod:{type:Function,default:function(){return _conf.default.modal.beforeHideMethod}},slots:Object,events:Object},data:function(){return{inited:!1,visible:!1,contentVisible:!1,modalTop:0,modalZindex:0,zoomLocat:null,firstOpen:!1}},computed:{isMsg:function(){return"message"===this.type}},watch:{width:function(){this.recalculate()},height:function(){this.recalculate()},value:function(t){this[t?"open":"close"]("model")}},created:function(){this.storage&&!this.id&&_tools.UtilTools.error("vxe.error.reqProp",["modal.id"])},mounted:function(){var t=this.$listeners,e=this.events,o=void 0===e?{}:e;this.value&&this.open(),this.recalculate(),this.escClosable&&_tools.GlobalEvent.on(this,"keydown",this.handleGlobalKeydownEvent);e="inserted",e={type:e,$modal:this,$event:{type:e}};t.inserted?this.$emit("inserted",e):o.inserted&&o.inserted.call(this,e)},beforeDestroy:function(){var t=this.$el;_tools.GlobalEvent.off(this,"keydown"),this.removeMsgQueue(),t.parentNode===document.body&&t.parentNode.removeChild(t)},render:function(e){var o=this,t=this._e,i=this.$scopedSlots,n=this.slots,s=void 0===n?{}:n,l=this.inited,a=this.vSize,r=this.className,c=this.type,u=this.resize,d=this.showClose,f=this.showZoom,h=this.animat,m=this.draggable,p=this.loading,v=this.status,g=this.iconStatus,x=this.showFooter,y=this.zoomLocat,b=this.modalTop,_=this.dblclickZoom,w=this.contentVisible,S=this.visible,z=this.title,T=this.lockScroll,k=this.lockView,$=this.mask,B=this.isMsg,M=this.showTitleOverflow,N=this.destroyOnClose,O=this.content||this.message,L=i.default||s.default,P=i.footer||s.footer,n=i.header||s.header,i=i.title||s.title,s={};return m&&(s.mousedown=this.mousedownEvent),f&&_&&"modal"===c&&(s.dblclick=this.toggleZoomEvent),e("div",{class:["vxe-modal--wrapper","type--".concat(c),r||"",(_defineProperty(r={},"size--".concat(a),a),_defineProperty(r,"status--".concat(v),v),_defineProperty(r,"is--animat",h),_defineProperty(r,"lock--scroll",T),_defineProperty(r,"lock--view",k),_defineProperty(r,"is--resize",u),_defineProperty(r,"is--mask",$),_defineProperty(r,"is--maximize",y),_defineProperty(r,"is--visible",w),_defineProperty(r,"is--active",S),_defineProperty(r,"is--loading",p),r)],style:{zIndex:this.modalZindex,top:b?"".concat(b,"px"):null},on:{click:this.selfClickEvent}},[e("div",{class:"vxe-modal--box",on:{mousedown:this.boxMousedownEvent},ref:"modalBox"},[this.showHeader?e("div",{class:["vxe-modal--header",{"is--drag":m,"is--ellipsis":!B&&M}],on:s},n?!l||N&&!S?[]:n.call(this,{$modal:this},e):[i?i.call(this,{$modal:this},e):e("span",{class:"vxe-modal--title"},z?_tools.UtilTools.getFuncText(z):_conf.default.i18n("vxe.alert.title")),f?e("i",{class:["vxe-modal--zoom-btn","trigger--btn",y?_conf.default.icon.MODAL_ZOOM_OUT:_conf.default.icon.MODAL_ZOOM_IN],attrs:{title:_conf.default.i18n("vxe.modal.zoom".concat(y?"Out":"In"))},on:{click:this.toggleZoomEvent}}):t(),d?e("i",{class:["vxe-modal--close-btn","trigger--btn",_conf.default.icon.MODAL_CLOSE],attrs:{title:_conf.default.i18n("vxe.modal.close")},on:{click:this.closeEvent}}):t()]):null,e("div",{class:"vxe-modal--body"},[v?e("div",{class:"vxe-modal--status-wrapper"},[e("i",{class:["vxe-modal--status-icon",g||_conf.default.icon["MODAL_".concat(v).toLocaleUpperCase()]]})]):null,e("div",{class:"vxe-modal--content"},L?!l||N&&!S?[]:L.call(this,{$modal:this},e):_tools.UtilTools.getFuncText(O)),B?null:e("div",{class:["vxe-loading",{"is--visible":p}]},[e("div",{class:"vxe-loading--spinner"})])]),x?e("div",{class:"vxe-modal--footer"},P?!l||N&&!S?[]:P.call(this,{$modal:this},e):["confirm"===c?e("vxe-button",{ref:"cancelBtn",on:{click:this.cancelEvent}},this.cancelButtonText||_conf.default.i18n("vxe.button.cancel")):null,e("vxe-button",{ref:"confirmBtn",props:{status:"primary"},on:{click:this.confirmEvent}},this.confirmButtonText||_conf.default.i18n("vxe.button.confirm"))]):null,!B&&u?e("span",{class:"vxe-modal--resize"},["wl","wr","swst","sest","st","swlb","selb","sb"].map(function(t){return e("span",{class:"".concat(t,"-resize"),attrs:{type:t},on:{mousedown:o.dragEvent}})})):null])])},methods:{recalculate:function(){var t=this.width,e=this.height,o=this.getBox();return o.style.width=t?isNaN(t)?t:"".concat(t,"px"):null,o.style.height=e?isNaN(e)?e:"".concat(e,"px"):null,this.$nextTick()},selfClickEvent:function(t){this.maskClosable&&t.target===this.$el&&this.close("mask")},updateZindex:function(){var t=this.zIndex,e=this.modalZindex;t?this.modalZindex=t:e<_tools.UtilTools.getLastZIndex()&&(this.modalZindex=_tools.UtilTools.nextZIndex())},closeEvent:function(t){var e=this.events,o=void 0===e?{}:e,e="close",t={type:e,$modal:this,$event:t};o[e]?o[e].call(this,t):this.$emit(e,t),this.close(e)},confirmEvent:function(t){var e=this.events,o=void 0===e?{}:e,e="confirm",t={type:e,$modal:this,$event:t};o[e]?o[e].call(this,t):this.$emit(e,t),this.close(e)},cancelEvent:function(t){var e=this.events,o=void 0===e?{}:e,e="cancel",t={type:e,$modal:this,$event:t};o[e]?o[e].call(this,t):this.$emit(e,t),this.close(e)},open:function(){var o=this,e=this.$refs,t=this.events,i=void 0===t?{}:t,n=this.inited,s=this.duration,l=this.visible,t=this.isMsg,a=this.remember,r=this.showFooter;n||(this.inited=!0,this.transfer&&document.body.appendChild(this.$el)),l||(a||this.recalculate(),this.visible=!0,this.contentVisible=!1,this.updateZindex(),allActivedModals.push(this),setTimeout(function(){o.contentVisible=!0,o.$nextTick(function(){!r||(t=e.confirmBtn||e.cancelBtn)&&t.focus();var t={type:"",$modal:o};i.show?i.show.call(o,t):(o.$emit("input",!0),o.$emit("show",t))})},10),t?(this.addMsgQueue(),-1!==s&&setTimeout(function(){return o.close("close")},_xeUtils.default.toNumber(s))):this.$nextTick(function(){var t=o.firstOpen,e=o.fullscreen;a&&t||o.updatePosition().then(function(){setTimeout(function(){return o.updatePosition()},20)}),t||(o.firstOpen=!0,o.hasPosStorage()?o.restorePosStorage():e&&o.$nextTick(function(){return o.maximize()}))}))},addMsgQueue:function(){-1===msgQueue.indexOf(this)&&msgQueue.push(this),this.updateStyle()},removeMsgQueue:function(){var e=this;-1<msgQueue.indexOf(this)&&_xeUtils.default.remove(msgQueue,function(t){return t===e}),this.updateStyle()},updateStyle:function(){this.$nextTick(function(){var e=0;msgQueue.forEach(function(t){e+=_xeUtils.default.toNumber(t.top),t.modalTop=e,e+=t.$refs.modalBox.clientHeight})})},updatePosition:function(){var u=this;return this.$nextTick().then(function(){var t=u.marginSize,e=u.position,o=u.getBox(),i=document.documentElement.clientWidth||document.body.clientWidth,n=document.documentElement.clientHeight||document.body.clientHeight,s="center"===e,l=s?{top:e,left:e}:Object.assign({},e),a=l.top,r=l.left,c=s||"center"===a,e="",l="",l=r&&!(s||"center"===r)?isNaN(r)?r:"".concat(r,"px"):"".concat(Math.max(t,i/2-o.offsetWidth/2),"px"),e=a&&!c?isNaN(a)?a:"".concat(a,"px"):"".concat(Math.max(t,n/2-o.offsetHeight/2),"px");o.style.top=e,o.style.left=l})},close:function(t){var e=this,o=this.events,i=void 0===o?{}:o,n=this.remember,s=this.visible,l=this.isMsg,o=this.beforeHideMethod,a={type:t,$modal:this};s&&Promise.resolve(o?o(a):null).then(function(t){_xeUtils.default.isError(t)||(l&&e.removeMsgQueue(),e.contentVisible=!1,n||(e.zoomLocat=null),_xeUtils.default.remove(allActivedModals,function(t){return t===e}),e.$emit("before-hide",a),setTimeout(function(){e.visible=!1,i.hide?i.hide.call(e,a):(e.$emit("input",!1),e.$emit("hide",a))},200))}).catch(function(t){return t})},handleGlobalKeydownEvent:function(t){var e,o=this;27===t.keyCode&&((e=_xeUtils.default.max(allActivedModals,function(t){return t.modalZindex}))&&setTimeout(function(){e===o&&e.escClosable&&o.close("exit")},10))},getBox:function(){return this.$refs.modalBox},isMaximized:function(){return!!this.zoomLocat},maximize:function(){var n=this;return this.$nextTick().then(function(){var t,e,o,i;n.zoomLocat||(t=Math.max(0,n.marginSize),e=n.getBox(),o=(i=_tools.DomTools.getDomNode()).visibleHeight,i=i.visibleWidth,n.zoomLocat={top:e.offsetTop,left:e.offsetLeft,width:e.offsetWidth+(e.style.width?0:1),height:e.offsetHeight+(e.style.height?0:1)},Object.assign(e.style,{top:"".concat(t,"px"),left:"".concat(t,"px"),width:"".concat(i-2*t,"px"),height:"".concat(o-2*t,"px")}),n.savePosStorage())})},revert:function(){var o=this;return this.$nextTick().then(function(){var t,e=o.zoomLocat;e&&(t=o.getBox(),o.zoomLocat=null,Object.assign(t.style,{top:"".concat(e.top,"px"),left:"".concat(e.left,"px"),width:"".concat(e.width,"px"),height:"".concat(e.height,"px")}),o.savePosStorage())})},zoom:function(){var t=this;return this[this.zoomLocat?"revert":"maximize"]().then(function(){return t.isMaximized()})},toggleZoomEvent:function(t){var e=this,o=this.$listeners,i=this.zoomLocat,n=this.events,s=void 0===n?{}:n,l={type:i?"revert":"max",$modal:this,$event:t};return this.zoom().then(function(){o.zoom?e.$emit("zoom",l):s.zoom&&s.zoom.call(e,l)})},getPosition:function(){if(!this.isMsg){var t=this.getBox();if(t)return{top:t.offsetTop,left:t.offsetLeft}}return null},setPosition:function(t,e){var o;return this.isMsg||(o=this.getBox(),_xeUtils.default.isNumber(t)&&(o.style.top="".concat(t,"px")),_xeUtils.default.isNumber(e)&&(o.style.left="".concat(e,"px"))),this.$nextTick()},boxMousedownEvent:function(){var e=this.modalZindex;allActivedModals.some(function(t){return t.visible&&t.modalZindex>e})&&this.updateZindex()},mousedownEvent:function(t){var e,o,n,s,l,a,i=this,r=this.remember,c=this.storage,u=this.marginSize,d=this.zoomLocat,f=this.getBox();d||0!==t.button||_tools.DomTools.getEventTargetNode(t,f,"trigger--btn").flag||(t.preventDefault(),e=document.onmousemove,o=document.onmouseup,n=t.clientX-f.offsetLeft,s=t.clientY-f.offsetTop,t=_tools.DomTools.getDomNode(),l=t.visibleHeight,a=t.visibleWidth,document.onmousemove=function(t){t.preventDefault();var e=f.offsetWidth,o=f.offsetHeight,i=a-e-u-1,e=l-o-u-1,o=t.clientX-n,t=t.clientY-s;(t=e<t?e:t)<u&&(t=u),f.style.left="".concat(o=(o=i<o?i:o)<u?u:o,"px"),f.style.top="".concat(t,"px")},document.onmouseup=function(){document.onmousemove=e,document.onmouseup=o,r&&c&&i.$nextTick(function(){i.savePosStorage()})})},dragEvent:function(t){var s=this;t.preventDefault();var l=this.$listeners,a=this.marginSize,e=this.events,r=void 0===e?{}:e,c=this.remember,u=this.storage,e=_tools.DomTools.getDomNode(),d=e.visibleHeight,f=e.visibleWidth,h=t.target.getAttribute("type"),m=_xeUtils.default.toNumber(this.minWidth),p=_xeUtils.default.toNumber(this.minHeight),v=f,g=d,x=this.getBox(),o=document.onmousemove,i=document.onmouseup,y=x.clientWidth,b=x.clientHeight,_=t.clientX,w=t.clientY,S=x.offsetTop,z=x.offsetLeft,T={type:"resize",$modal:this};document.onmousemove=function(t){var e,o,i,n;switch(t.preventDefault(),h){case"wl":i=(e=_-t.clientX)+y,a<z-e&&m<i&&(x.style.width="".concat(i<v?i:v,"px"),x.style.left="".concat(z-e,"px"));break;case"swst":e=_-t.clientX,o=w-t.clientY,i=e+y,n=o+b,a<z-e&&m<i&&(x.style.width="".concat(i<v?i:v,"px"),x.style.left="".concat(z-e,"px")),a<S-o&&p<n&&(x.style.height="".concat(n<g?n:g,"px"),x.style.top="".concat(S-o,"px"));break;case"swlb":e=_-t.clientX,o=t.clientY-w,i=e+y,n=o+b,a<z-e&&m<i&&(x.style.width="".concat(i<v?i:v,"px"),x.style.left="".concat(z-e,"px")),S+n+a<d&&p<n&&(x.style.height="".concat(n<g?n:g,"px"));break;case"st":o=w-t.clientY,n=b+o,a<S-o&&p<n&&(x.style.height="".concat(n<g?n:g,"px"),x.style.top="".concat(S-o,"px"));break;case"wr":e=t.clientX-_,z+(i=e+y)+a<f&&m<i&&(x.style.width="".concat(i<v?i:v,"px"));break;case"sest":e=t.clientX-_,n=(o=w-t.clientY)+b,z+(i=e+y)+a<f&&m<i&&(x.style.width="".concat(i<v?i:v,"px")),a<S-o&&p<n&&(x.style.height="".concat(n<g?n:g,"px"),x.style.top="".concat(S-o,"px"));break;case"selb":e=t.clientX-_,n=(o=t.clientY-w)+b,z+(i=e+y)+a<f&&m<i&&(x.style.width="".concat(i<v?i:v,"px")),S+n+a<d&&p<n&&(x.style.height="".concat(n<g?n:g,"px"));break;case"sb":o=t.clientY-w,S+(n=o+b)+a<d&&p<n&&(x.style.height="".concat(n<g?n:g,"px"))}x.className=x.className.replace(/\s?is--drag/,"")+" is--drag",c&&u&&s.savePosStorage(),l.zoom?s.$emit("zoom",T):r.zoom&&r.zoom.call(s,T)},document.onmouseup=function(){s.zoomLocat=null,document.onmousemove=o,document.onmouseup=i,setTimeout(function(){x.className=x.className.replace(/\s?is--drag/,"")},50)}},getStorageMap:function(t){var e=_conf.default.version,t=_xeUtils.default.toStringJSON(localStorage.getItem(t));return t&&t._v===e?t:{_v:e}},hasPosStorage:function(){var t=this.id,e=this.remember,o=this.storage,i=this.storageKey;return!!(e&&o&&this.getStorageMap(i)[t])},restorePosStorage:function(){var t,e,o,i,n,s=this.id,l=this.remember,a=this.storage,r=this.storageKey;l&&a&&((i=this.getStorageMap(r)[s])&&(t=this.getBox(),e=(n=_slicedToArray(i.split(","),8))[0],o=n[1],l=n[2],a=n[3],r=n[4],s=n[5],i=n[6],n=n[7],e&&(t.style.left="".concat(e,"px")),o&&(t.style.top="".concat(o,"px")),l&&(t.style.width="".concat(l,"px")),a&&(t.style.height="".concat(a,"px")),r&&s&&(this.zoomLocat={left:r,top:s,width:i,height:n})))},savePosStorage:function(){var t=this.id,e=this.remember,o=this.storage,i=this.storageKey,n=this.zoomLocat;e&&o&&(e=this.getBox(),(o=this.getStorageMap(i))[t]=[e.style.left,e.style.top,e.style.width,e.style.height].concat(n?[n.left,n.top,n.width,n.height]:[]).map(function(t){return t?_xeUtils.default.toNumber(t):""}).join(","),localStorage.setItem(i,_xeUtils.default.toJSONString(o)))}}};exports.default=_default2;
|
|
1
|
+
"use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.msgQueue=exports.default=exports.allActivedModals=void 0;var _conf=_interopRequireDefault(require("../../v-x-e-table/src/conf")),_size=_interopRequireDefault(require("../../mixins/size")),_xeUtils=_interopRequireDefault(require("xe-utils")),_utils=_interopRequireWildcard(require("../../tools/utils")),_dom=_interopRequireDefault(require("../../tools/dom")),_event=require("../../tools/event"),_log=require("../../tools/log");function _getRequireWildcardCache(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,o=new WeakMap;return(_getRequireWildcardCache=function(t){return t?o:e})(t)}function _interopRequireWildcard(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!==_typeof(t)&&"function"!=typeof t)return{default:t};e=_getRequireWildcardCache(e);if(e&&e.has(t))return e.get(t);var o,i,n={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(o in t)"default"!==o&&Object.prototype.hasOwnProperty.call(t,o)&&((i=s?Object.getOwnPropertyDescriptor(t,o):null)&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=t[o]);return n.default=t,e&&e.set(t,n),n}function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}function _slicedToArray(t,e){return _arrayWithHoles(t)||_iterableToArrayLimit(t,e)||_unsupportedIterableToArray(t,e)||_nonIterableRest()}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.")}function _unsupportedIterableToArray(t,e){if(t){if("string"==typeof t)return _arrayLikeToArray(t,e);var o=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(o="Object"===o&&t.constructor?t.constructor.name:o)||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(t,e):void 0}}function _arrayLikeToArray(t,e){(null==e||e>t.length)&&(e=t.length);for(var o=0,i=new Array(e);o<e;o++)i[o]=t[o];return i}function _iterableToArrayLimit(t,e){var o=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=o){var i,n,s=[],l=!0,a=!1;try{for(o=o.call(t);!(l=(i=o.next()).done)&&(s.push(i.value),!e||s.length!==e);l=!0);}catch(t){a=!0,n=t}finally{try{l||null==o.return||o.return()}finally{if(a)throw n}}return s}}function _arrayWithHoles(t){if(Array.isArray(t))return t}function _defineProperty(t,e,o){return e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}var allActivedModals=[];exports.allActivedModals=allActivedModals;var msgQueue=[];exports.msgQueue=msgQueue;var _default2={name:"VxeModal",mixins:[_size.default],props:{value:Boolean,id:String,type:{type:String,default:"modal"},loading:{type:Boolean,default:null},status:String,iconStatus:String,className:String,top:{type:[Number,String],default:function(){return _conf.default.modal.top}},position:[String,Object],title:String,duration:{type:[Number,String],default:function(){return _conf.default.modal.duration}},message:[String,Function],content:[String,Function],cancelButtonText:{type:String,default:function(){return _conf.default.modal.cancelButtonText}},confirmButtonText:{type:String,default:function(){return _conf.default.modal.confirmButtonText}},lockView:{type:Boolean,default:function(){return _conf.default.modal.lockView}},lockScroll:Boolean,mask:{type:Boolean,default:function(){return _conf.default.modal.mask}},maskClosable:{type:Boolean,default:function(){return _conf.default.modal.maskClosable}},escClosable:{type:Boolean,default:function(){return _conf.default.modal.escClosable}},resize:{type:Boolean,default:function(){return _conf.default.modal.resize}},showHeader:{type:Boolean,default:function(){return _conf.default.modal.showHeader}},showFooter:{type:Boolean,default:function(){return _conf.default.modal.showFooter}},showZoom:{type:Boolean,default:null},showClose:{type:Boolean,default:function(){return _conf.default.modal.showClose}},dblclickZoom:{type:Boolean,default:function(){return _conf.default.modal.dblclickZoom}},width:[Number,String],height:[Number,String],minWidth:{type:[Number,String],default:function(){return _conf.default.modal.minWidth}},minHeight:{type:[Number,String],default:function(){return _conf.default.modal.minHeight}},zIndex:Number,marginSize:{type:[Number,String],default:function(){return _conf.default.modal.marginSize}},fullscreen:Boolean,draggable:{type:Boolean,default:function(){return _conf.default.modal.draggable}},remember:{type:Boolean,default:function(){return _conf.default.modal.remember}},destroyOnClose:{type:Boolean,default:function(){return _conf.default.modal.destroyOnClose}},showTitleOverflow:{type:Boolean,default:function(){return _conf.default.modal.showTitleOverflow}},transfer:{type:Boolean,default:function(){return _conf.default.modal.transfer}},storage:{type:Boolean,default:function(){return _conf.default.modal.storage}},storageKey:{type:String,default:function(){return _conf.default.modal.storageKey}},animat:{type:Boolean,default:function(){return _conf.default.modal.animat}},size:{type:String,default:function(){return _conf.default.modal.size||_conf.default.size}},beforeHideMethod:{type:Function,default:function(){return _conf.default.modal.beforeHideMethod}},slots:Object,events:Object},data:function(){return{inited:!1,visible:!1,contentVisible:!1,modalTop:0,modalZindex:0,zoomLocat:null,firstOpen:!1}},computed:{isMsg:function(){return"message"===this.type}},watch:{width:function(){this.recalculate()},height:function(){this.recalculate()},value:function(t){this[t?"open":"close"]("model")}},created:function(){this.storage&&!this.id&&(0,_log.errLog)("vxe.error.reqProp",["modal.id"])},mounted:function(){var t=this.$listeners,e=this.events,o=void 0===e?{}:e;this.value&&this.open(),this.recalculate(),this.escClosable&&_event.GlobalEvent.on(this,"keydown",this.handleGlobalKeydownEvent);e="inserted",e={type:e,$modal:this,$event:{type:e}};t.inserted?this.$emit("inserted",e):o.inserted&&o.inserted.call(this,e)},beforeDestroy:function(){var t=this.$el;_event.GlobalEvent.off(this,"keydown"),this.removeMsgQueue(),t.parentNode===document.body&&t.parentNode.removeChild(t)},render:function(e){var o=this,t=this._e,i=this.$scopedSlots,n=this.slots,s=void 0===n?{}:n,l=this.inited,a=this.vSize,r=this.className,c=this.type,u=this.resize,d=this.showClose,f=this.showZoom,h=this.animat,m=this.draggable,p=this.loading,v=this.status,g=this.iconStatus,y=this.showFooter,x=this.zoomLocat,b=this.modalTop,_=this.dblclickZoom,w=this.contentVisible,S=this.visible,z=this.title,k=this.lockScroll,$=this.lockView,M=this.mask,T=this.isMsg,B=this.showTitleOverflow,O=this.destroyOnClose,N=this.content||this.message,P=i.default||s.default,L=i.footer||s.footer,n=i.header||s.header,i=i.title||s.title,s={};return m&&(s.mousedown=this.mousedownEvent),f&&_&&"modal"===c&&(s.dblclick=this.toggleZoomEvent),e("div",{class:["vxe-modal--wrapper","type--".concat(c),r||"",(_defineProperty(r={},"size--".concat(a),a),_defineProperty(r,"status--".concat(v),v),_defineProperty(r,"is--animat",h),_defineProperty(r,"lock--scroll",k),_defineProperty(r,"lock--view",$),_defineProperty(r,"is--resize",u),_defineProperty(r,"is--mask",M),_defineProperty(r,"is--maximize",x),_defineProperty(r,"is--visible",w),_defineProperty(r,"is--active",S),_defineProperty(r,"is--loading",p),r)],style:{zIndex:this.modalZindex,top:b?"".concat(b,"px"):null},on:{click:this.selfClickEvent}},[e("div",{class:"vxe-modal--box",on:{mousedown:this.boxMousedownEvent},ref:"modalBox"},[this.showHeader?e("div",{class:["vxe-modal--header",{"is--drag":m,"is--ellipsis":!T&&B}],on:s},n?!l||O&&!S?[]:n.call(this,{$modal:this},e):[i?i.call(this,{$modal:this},e):e("span",{class:"vxe-modal--title"},z?(0,_utils.getFuncText)(z):_conf.default.i18n("vxe.alert.title")),f?e("i",{class:["vxe-modal--zoom-btn","trigger--btn",x?_conf.default.icon.MODAL_ZOOM_OUT:_conf.default.icon.MODAL_ZOOM_IN],attrs:{title:_conf.default.i18n("vxe.modal.zoom".concat(x?"Out":"In"))},on:{click:this.toggleZoomEvent}}):t(),d?e("i",{class:["vxe-modal--close-btn","trigger--btn",_conf.default.icon.MODAL_CLOSE],attrs:{title:_conf.default.i18n("vxe.modal.close")},on:{click:this.closeEvent}}):t()]):null,e("div",{class:"vxe-modal--body"},[v?e("div",{class:"vxe-modal--status-wrapper"},[e("i",{class:["vxe-modal--status-icon",g||_conf.default.icon["MODAL_".concat(v).toLocaleUpperCase()]]})]):null,e("div",{class:"vxe-modal--content"},P?!l||O&&!S?[]:P.call(this,{$modal:this},e):(0,_utils.getFuncText)(N)),T?null:e("div",{class:["vxe-loading",{"is--visible":p}]},[e("div",{class:"vxe-loading--spinner"})])]),y?e("div",{class:"vxe-modal--footer"},L?!l||O&&!S?[]:L.call(this,{$modal:this},e):["confirm"===c?e("vxe-button",{ref:"cancelBtn",on:{click:this.cancelEvent}},this.cancelButtonText||_conf.default.i18n("vxe.button.cancel")):null,e("vxe-button",{ref:"confirmBtn",props:{status:"primary"},on:{click:this.confirmEvent}},this.confirmButtonText||_conf.default.i18n("vxe.button.confirm"))]):null,!T&&u?e("span",{class:"vxe-modal--resize"},["wl","wr","swst","sest","st","swlb","selb","sb"].map(function(t){return e("span",{class:"".concat(t,"-resize"),attrs:{type:t},on:{mousedown:o.dragEvent}})})):null])])},methods:{recalculate:function(){var t=this.width,e=this.height,o=this.getBox();return o.style.width=t?isNaN(t)?t:"".concat(t,"px"):null,o.style.height=e?isNaN(e)?e:"".concat(e,"px"):null,this.$nextTick()},selfClickEvent:function(t){this.maskClosable&&t.target===this.$el&&this.close("mask")},updateZindex:function(){var t=this.zIndex,e=this.modalZindex;t?this.modalZindex=t:e<_utils.default.getLastZIndex()&&(this.modalZindex=_utils.default.nextZIndex())},closeEvent:function(t){var e=this.events,o=void 0===e?{}:e,e="close",t={type:e,$modal:this,$event:t};o[e]?o[e].call(this,t):this.$emit(e,t),this.close(e)},confirmEvent:function(t){var e=this.events,o=void 0===e?{}:e,e="confirm",t={type:e,$modal:this,$event:t};o[e]?o[e].call(this,t):this.$emit(e,t),this.close(e)},cancelEvent:function(t){var e=this.events,o=void 0===e?{}:e,e="cancel",t={type:e,$modal:this,$event:t};o[e]?o[e].call(this,t):this.$emit(e,t),this.close(e)},open:function(){var o=this,e=this.$refs,t=this.events,i=void 0===t?{}:t,n=this.inited,s=this.duration,l=this.visible,t=this.isMsg,a=this.remember,r=this.showFooter;n||(this.inited=!0,this.transfer&&document.body.appendChild(this.$el)),l||(a||this.recalculate(),this.visible=!0,this.contentVisible=!1,this.updateZindex(),allActivedModals.push(this),setTimeout(function(){o.contentVisible=!0,o.$nextTick(function(){!r||(t=e.confirmBtn||e.cancelBtn)&&t.focus();var t={type:"",$modal:o};i.show?i.show.call(o,t):(o.$emit("input",!0),o.$emit("show",t))})},10),t?(this.addMsgQueue(),-1!==s&&setTimeout(function(){return o.close("close")},_xeUtils.default.toNumber(s))):this.$nextTick(function(){var t=o.firstOpen,e=o.fullscreen;a&&t||o.updatePosition().then(function(){setTimeout(function(){return o.updatePosition()},20)}),t||(o.firstOpen=!0,o.hasPosStorage()?o.restorePosStorage():e&&o.$nextTick(function(){return o.maximize()}))}))},addMsgQueue:function(){-1===msgQueue.indexOf(this)&&msgQueue.push(this),this.updateStyle()},removeMsgQueue:function(){var e=this;-1<msgQueue.indexOf(this)&&_xeUtils.default.remove(msgQueue,function(t){return t===e}),this.updateStyle()},updateStyle:function(){this.$nextTick(function(){var e=0;msgQueue.forEach(function(t){e+=_xeUtils.default.toNumber(t.top),t.modalTop=e,e+=t.$refs.modalBox.clientHeight})})},updatePosition:function(){var u=this;return this.$nextTick().then(function(){var t=u.marginSize,e=u.position,o=u.getBox(),i=document.documentElement.clientWidth||document.body.clientWidth,n=document.documentElement.clientHeight||document.body.clientHeight,s="center"===e,l=s?{top:e,left:e}:Object.assign({},e),a=l.top,r=l.left,c=s||"center"===a,e="",l="",l=r&&!(s||"center"===r)?isNaN(r)?r:"".concat(r,"px"):"".concat(Math.max(t,i/2-o.offsetWidth/2),"px"),e=a&&!c?isNaN(a)?a:"".concat(a,"px"):"".concat(Math.max(t,n/2-o.offsetHeight/2),"px");o.style.top=e,o.style.left=l})},close:function(t){var e=this,o=this.events,i=void 0===o?{}:o,n=this.remember,s=this.visible,l=this.isMsg,o=this.beforeHideMethod,a={type:t,$modal:this};s&&Promise.resolve(o?o(a):null).then(function(t){_xeUtils.default.isError(t)||(l&&e.removeMsgQueue(),e.contentVisible=!1,n||(e.zoomLocat=null),_xeUtils.default.remove(allActivedModals,function(t){return t===e}),e.$emit("before-hide",a),setTimeout(function(){e.visible=!1,i.hide?i.hide.call(e,a):(e.$emit("input",!1),e.$emit("hide",a))},200))}).catch(function(t){return t})},handleGlobalKeydownEvent:function(t){var e,o=this;27===t.keyCode&&((e=_xeUtils.default.max(allActivedModals,function(t){return t.modalZindex}))&&setTimeout(function(){e===o&&e.escClosable&&o.close("exit")},10))},getBox:function(){return this.$refs.modalBox},isMaximized:function(){return!!this.zoomLocat},maximize:function(){var n=this;return this.$nextTick().then(function(){var t,e,o,i;n.zoomLocat||(t=Math.max(0,n.marginSize),e=n.getBox(),o=(i=_dom.default.getDomNode()).visibleHeight,i=i.visibleWidth,n.zoomLocat={top:e.offsetTop,left:e.offsetLeft,width:e.offsetWidth+(e.style.width?0:1),height:e.offsetHeight+(e.style.height?0:1)},Object.assign(e.style,{top:"".concat(t,"px"),left:"".concat(t,"px"),width:"".concat(i-2*t,"px"),height:"".concat(o-2*t,"px")}),n.savePosStorage())})},revert:function(){var o=this;return this.$nextTick().then(function(){var t,e=o.zoomLocat;e&&(t=o.getBox(),o.zoomLocat=null,Object.assign(t.style,{top:"".concat(e.top,"px"),left:"".concat(e.left,"px"),width:"".concat(e.width,"px"),height:"".concat(e.height,"px")}),o.savePosStorage())})},zoom:function(){var t=this;return this[this.zoomLocat?"revert":"maximize"]().then(function(){return t.isMaximized()})},toggleZoomEvent:function(t){var e=this,o=this.$listeners,i=this.zoomLocat,n=this.events,s=void 0===n?{}:n,l={type:i?"revert":"max",$modal:this,$event:t};return this.zoom().then(function(){o.zoom?e.$emit("zoom",l):s.zoom&&s.zoom.call(e,l)})},getPosition:function(){if(!this.isMsg){var t=this.getBox();if(t)return{top:t.offsetTop,left:t.offsetLeft}}return null},setPosition:function(t,e){var o;return this.isMsg||(o=this.getBox(),_xeUtils.default.isNumber(t)&&(o.style.top="".concat(t,"px")),_xeUtils.default.isNumber(e)&&(o.style.left="".concat(e,"px"))),this.$nextTick()},boxMousedownEvent:function(){var e=this.modalZindex;allActivedModals.some(function(t){return t.visible&&t.modalZindex>e})&&this.updateZindex()},mousedownEvent:function(t){var e,o,n,s,l,a,i=this,r=this.remember,c=this.storage,u=this.marginSize,d=this.zoomLocat,f=this.getBox();d||0!==t.button||_dom.default.getEventTargetNode(t,f,"trigger--btn").flag||(t.preventDefault(),e=document.onmousemove,o=document.onmouseup,n=t.clientX-f.offsetLeft,s=t.clientY-f.offsetTop,t=_dom.default.getDomNode(),l=t.visibleHeight,a=t.visibleWidth,document.onmousemove=function(t){t.preventDefault();var e=f.offsetWidth,o=f.offsetHeight,i=a-e-u-1,e=l-o-u-1,o=t.clientX-n,t=t.clientY-s;(t=e<t?e:t)<u&&(t=u),f.style.left="".concat(o=(o=i<o?i:o)<u?u:o,"px"),f.style.top="".concat(t,"px")},document.onmouseup=function(){document.onmousemove=e,document.onmouseup=o,r&&c&&i.$nextTick(function(){i.savePosStorage()})})},dragEvent:function(t){var s=this;t.preventDefault();var l=this.$listeners,a=this.marginSize,e=this.events,r=void 0===e?{}:e,c=this.remember,u=this.storage,e=_dom.default.getDomNode(),d=e.visibleHeight,f=e.visibleWidth,h=t.target.getAttribute("type"),m=_xeUtils.default.toNumber(this.minWidth),p=_xeUtils.default.toNumber(this.minHeight),v=f,g=d,y=this.getBox(),o=document.onmousemove,i=document.onmouseup,x=y.clientWidth,b=y.clientHeight,_=t.clientX,w=t.clientY,S=y.offsetTop,z=y.offsetLeft,k={type:"resize",$modal:this};document.onmousemove=function(t){var e,o,i,n;switch(t.preventDefault(),h){case"wl":i=(e=_-t.clientX)+x,a<z-e&&m<i&&(y.style.width="".concat(i<v?i:v,"px"),y.style.left="".concat(z-e,"px"));break;case"swst":e=_-t.clientX,o=w-t.clientY,i=e+x,n=o+b,a<z-e&&m<i&&(y.style.width="".concat(i<v?i:v,"px"),y.style.left="".concat(z-e,"px")),a<S-o&&p<n&&(y.style.height="".concat(n<g?n:g,"px"),y.style.top="".concat(S-o,"px"));break;case"swlb":e=_-t.clientX,o=t.clientY-w,i=e+x,n=o+b,a<z-e&&m<i&&(y.style.width="".concat(i<v?i:v,"px"),y.style.left="".concat(z-e,"px")),S+n+a<d&&p<n&&(y.style.height="".concat(n<g?n:g,"px"));break;case"st":o=w-t.clientY,n=b+o,a<S-o&&p<n&&(y.style.height="".concat(n<g?n:g,"px"),y.style.top="".concat(S-o,"px"));break;case"wr":e=t.clientX-_,z+(i=e+x)+a<f&&m<i&&(y.style.width="".concat(i<v?i:v,"px"));break;case"sest":e=t.clientX-_,n=(o=w-t.clientY)+b,z+(i=e+x)+a<f&&m<i&&(y.style.width="".concat(i<v?i:v,"px")),a<S-o&&p<n&&(y.style.height="".concat(n<g?n:g,"px"),y.style.top="".concat(S-o,"px"));break;case"selb":e=t.clientX-_,n=(o=t.clientY-w)+b,z+(i=e+x)+a<f&&m<i&&(y.style.width="".concat(i<v?i:v,"px")),S+n+a<d&&p<n&&(y.style.height="".concat(n<g?n:g,"px"));break;case"sb":o=t.clientY-w,S+(n=o+b)+a<d&&p<n&&(y.style.height="".concat(n<g?n:g,"px"))}y.className=y.className.replace(/\s?is--drag/,"")+" is--drag",c&&u&&s.savePosStorage(),l.zoom?s.$emit("zoom",k):r.zoom&&r.zoom.call(s,k)},document.onmouseup=function(){s.zoomLocat=null,document.onmousemove=o,document.onmouseup=i,setTimeout(function(){y.className=y.className.replace(/\s?is--drag/,"")},50)}},getStorageMap:function(t){var e=_conf.default.version,t=_xeUtils.default.toStringJSON(localStorage.getItem(t));return t&&t._v===e?t:{_v:e}},hasPosStorage:function(){var t=this.id,e=this.remember,o=this.storage,i=this.storageKey;return!!(e&&o&&this.getStorageMap(i)[t])},restorePosStorage:function(){var t,e,o,i,n,s=this.id,l=this.remember,a=this.storage,r=this.storageKey;l&&a&&((i=this.getStorageMap(r)[s])&&(t=this.getBox(),e=(n=_slicedToArray(i.split(","),8))[0],o=n[1],l=n[2],a=n[3],r=n[4],s=n[5],i=n[6],n=n[7],e&&(t.style.left="".concat(e,"px")),o&&(t.style.top="".concat(o,"px")),l&&(t.style.width="".concat(l,"px")),a&&(t.style.height="".concat(a,"px")),r&&s&&(this.zoomLocat={left:r,top:s,width:i,height:n})))},savePosStorage:function(){var t=this.id,e=this.remember,o=this.storage,i=this.storageKey,n=this.zoomLocat;e&&o&&(e=this.getBox(),(o=this.getStorageMap(i))[t]=[e.style.left,e.style.top,e.style.width,e.style.height].concat(n?[n.left,n.top,n.width,n.height]:[]).map(function(t){return t?_xeUtils.default.toNumber(t):""}).join(","),localStorage.setItem(i,_xeUtils.default.toJSONString(o)))}}};exports.default=_default2;
|
|
@@ -9,7 +9,11 @@ var _conf = _interopRequireDefault(require("../../v-x-e-table/src/conf"));
|
|
|
9
9
|
|
|
10
10
|
var _size = _interopRequireDefault(require("../../mixins/size"));
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _utils = _interopRequireDefault(require("../../tools/utils"));
|
|
13
|
+
|
|
14
|
+
var _dom = _interopRequireDefault(require("../../tools/dom"));
|
|
15
|
+
|
|
16
|
+
var _event = require("../../tools/event");
|
|
13
17
|
|
|
14
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
19
|
|
|
@@ -53,11 +57,11 @@ var _default2 = {
|
|
|
53
57
|
}
|
|
54
58
|
},
|
|
55
59
|
created: function created() {
|
|
56
|
-
|
|
60
|
+
_event.GlobalEvent.on(this, 'mousewheel', this.handleGlobalMousewheelEvent);
|
|
57
61
|
|
|
58
|
-
|
|
62
|
+
_event.GlobalEvent.on(this, 'mousedown', this.handleGlobalMousedownEvent);
|
|
59
63
|
|
|
60
|
-
|
|
64
|
+
_event.GlobalEvent.on(this, 'blur', this.handleGlobalBlurEvent);
|
|
61
65
|
},
|
|
62
66
|
beforeDestroy: function beforeDestroy() {
|
|
63
67
|
var panelElem = this.$refs.panel;
|
|
@@ -67,11 +71,11 @@ var _default2 = {
|
|
|
67
71
|
}
|
|
68
72
|
},
|
|
69
73
|
destroyed: function destroyed() {
|
|
70
|
-
|
|
74
|
+
_event.GlobalEvent.off(this, 'mousewheel');
|
|
71
75
|
|
|
72
|
-
|
|
76
|
+
_event.GlobalEvent.off(this, 'mousedown');
|
|
73
77
|
|
|
74
|
-
|
|
78
|
+
_event.GlobalEvent.off(this, 'blur');
|
|
75
79
|
},
|
|
76
80
|
render: function render(h) {
|
|
77
81
|
var _ref, _ref2;
|
|
@@ -117,7 +121,7 @@ var _default2 = {
|
|
|
117
121
|
|
|
118
122
|
if (!disabled) {
|
|
119
123
|
if (visiblePanel) {
|
|
120
|
-
if (
|
|
124
|
+
if (_dom.default.getEventTargetNode(evnt, $refs.panel).flag) {
|
|
121
125
|
this.updatePlacement();
|
|
122
126
|
} else {
|
|
123
127
|
this.hidePanel();
|
|
@@ -135,7 +139,7 @@ var _default2 = {
|
|
|
135
139
|
visiblePanel = this.visiblePanel;
|
|
136
140
|
|
|
137
141
|
if (!disabled) {
|
|
138
|
-
this.isActivated =
|
|
142
|
+
this.isActivated = _dom.default.getEventTargetNode(evnt, $el).flag || _dom.default.getEventTargetNode(evnt, $refs.panel).flag;
|
|
139
143
|
|
|
140
144
|
if (visiblePanel && !this.isActivated) {
|
|
141
145
|
this.hidePanel();
|
|
@@ -155,8 +159,8 @@ var _default2 = {
|
|
|
155
159
|
}
|
|
156
160
|
},
|
|
157
161
|
updateZindex: function updateZindex() {
|
|
158
|
-
if (this.panelIndex <
|
|
159
|
-
this.panelIndex =
|
|
162
|
+
if (this.panelIndex < _utils.default.getLastZIndex()) {
|
|
163
|
+
this.panelIndex = _utils.default.nextZIndex();
|
|
160
164
|
}
|
|
161
165
|
},
|
|
162
166
|
isPanelVisible: function isPanelVisible() {
|
|
@@ -259,7 +263,7 @@ var _default2 = {
|
|
|
259
263
|
zIndex: panelIndex
|
|
260
264
|
};
|
|
261
265
|
|
|
262
|
-
var _DomTools$getAbsolute =
|
|
266
|
+
var _DomTools$getAbsolute = _dom.default.getAbsolutePos(targetElem),
|
|
263
267
|
boundingTop = _DomTools$getAbsolute.boundingTop,
|
|
264
268
|
boundingLeft = _DomTools$getAbsolute.boundingLeft,
|
|
265
269
|
visibleHeight = _DomTools$getAbsolute.visibleHeight,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _conf=_interopRequireDefault(require("../../v-x-e-table/src/conf")),_size=_interopRequireDefault(require("../../mixins/size")),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _conf=_interopRequireDefault(require("../../v-x-e-table/src/conf")),_size=_interopRequireDefault(require("../../mixins/size")),_utils=_interopRequireDefault(require("../../tools/utils")),_dom=_interopRequireDefault(require("../../tools/dom")),_event=require("../../tools/event");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperty(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var _default2={name:"VxePulldown",mixins:[_size.default],props:{value:Boolean,disabled:Boolean,placement:String,size:{type:String,default:function(){return _conf.default.size}},destroyOnClose:Boolean,transfer:Boolean},data:function(){return{inited:!1,panelIndex:0,panelStyle:null,panelPlacement:null,currentValue:null,visiblePanel:!1,animatVisible:!1,isActivated:!1}},watch:{value:function(e){e?this.showPanel():this.hidePanel()}},created:function(){_event.GlobalEvent.on(this,"mousewheel",this.handleGlobalMousewheelEvent),_event.GlobalEvent.on(this,"mousedown",this.handleGlobalMousedownEvent),_event.GlobalEvent.on(this,"blur",this.handleGlobalBlurEvent)},beforeDestroy:function(){var e=this.$refs.panel;e&&e.parentNode&&e.parentNode.removeChild(e)},destroyed:function(){_event.GlobalEvent.off(this,"mousewheel"),_event.GlobalEvent.off(this,"mousedown"),_event.GlobalEvent.off(this,"blur")},render:function(e){var t=this.$scopedSlots,i=this.inited,n=this.vSize,l=this.destroyOnClose,a=this.transfer,s=this.isActivated,o=this.disabled,d=this.animatVisible,r=this.visiblePanel,u=this.panelStyle,h=this.panelPlacement,f=t.default,c=t.dropdown;return e("div",{class:["vxe-pulldown",(_defineProperty(t={},"size--".concat(n),n),_defineProperty(t,"is--visivle",r),_defineProperty(t,"is--disabled",o),_defineProperty(t,"is--active",s),t)]},[e("div",{ref:"content",class:"vxe-pulldown--content"},f?f.call(this,{$pulldown:this},e):[]),e("div",{ref:"panel",class:["vxe-table--ignore-clear vxe-pulldown--panel",(_defineProperty(f={},"size--".concat(n),n),_defineProperty(f,"is--transfer",a),_defineProperty(f,"animat--leave",d),_defineProperty(f,"animat--enter",r),f)],attrs:{placement:h},style:u},c?[e("div",{class:"vxe-pulldown--wrapper"},!i||l&&!r&&!d?[]:c.call(this,{$pulldown:this},e))]:[])])},methods:{handleGlobalMousewheelEvent:function(e){var t=this.$refs,i=this.disabled,n=this.visiblePanel;i||n&&(_dom.default.getEventTargetNode(e,t.panel).flag?this.updatePlacement():(this.hidePanel(),this.$emit("hide-panel",{$event:e})))},handleGlobalMousedownEvent:function(e){var t=this.$refs,i=this.$el,n=this.disabled,l=this.visiblePanel;n||(this.isActivated=_dom.default.getEventTargetNode(e,i).flag||_dom.default.getEventTargetNode(e,t.panel).flag,l&&!this.isActivated&&(this.hidePanel(),this.$emit("hide-panel",{$event:e})))},handleGlobalBlurEvent:function(e){this.visiblePanel&&(this.isActivated=!1,this.hidePanel(),this.$emit("hide-panel",{$event:e}))},updateZindex:function(){this.panelIndex<_utils.default.getLastZIndex()&&(this.panelIndex=_utils.default.nextZIndex())},isPanelVisible:function(){return this.visiblePanel},togglePanel:function(){return this.visiblePanel?this.hidePanel():this.showPanel()},showPanel:function(){var t=this;return this.inited||(this.inited=!0,this.transfer&&document.body.appendChild(this.$refs.panel)),new Promise(function(e){t.disabled?e(t.$nextTick()):(clearTimeout(t.hidePanelTimeout),t.isActivated=!0,t.animatVisible=!0,setTimeout(function(){t.visiblePanel=!0,t.$emit("update:input",!0),t.updatePlacement(),setTimeout(function(){e(t.updatePlacement())},40)},10),t.updateZindex())})},hidePanel:function(){var t=this;return this.visiblePanel=!1,this.$emit("update:input",!1),new Promise(function(e){t.animatVisible?t.hidePanelTimeout=setTimeout(function(){t.animatVisible=!1,e(t.$nextTick())},350):e(t.$nextTick())})},updatePlacement:function(){var f=this;return this.$nextTick().then(function(){var e,t,i,n,l,a,s,o,d=f.$refs,r=f.transfer,u=f.placement,h=f.panelIndex;return f.visiblePanel&&(o=d.panel,a=d.content,o&&a&&(e=a.offsetHeight,t=a.offsetWidth,i=o.offsetHeight,n=o.offsetWidth,l={zIndex:h},d=(s=_dom.default.getAbsolutePos(a)).boundingTop,o=s.boundingLeft,h=s.visibleHeight,a=s.visibleWidth,s="bottom",r?(r=d+e,"top"===u?(s="top",r=d-i):u||(h<r+i+5&&(s="top",r=d-i),r<5&&(s="bottom",r=d+e)),a<(o=o)+n+5&&(o-=o+n+5-a),o<5&&(o=5),Object.assign(l,{left:"".concat(o,"px"),top:"".concat(r,"px"),minWidth:"".concat(t,"px")})):"top"===u?(s="top",l.bottom="".concat(e,"px")):u||h<d+e+i&&5<d-e-i&&(s="top",l.bottom="".concat(e,"px")),f.panelStyle=l,f.panelPlacement=s)),f.$nextTick()})}}};exports.default=_default2;
|
package/lib/radio/src/button.js
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _utils = require("../../tools/utils");
|
|
9
9
|
|
|
10
10
|
var _conf = _interopRequireDefault(require("../../v-x-e-table/src/conf"));
|
|
11
11
|
|
|
@@ -88,7 +88,7 @@ var _default2 = {
|
|
|
88
88
|
}
|
|
89
89
|
}), h('span', {
|
|
90
90
|
class: 'vxe-radio--label'
|
|
91
|
-
}, $scopedSlots.default ? $scopedSlots.default.call(this, {}) : [
|
|
91
|
+
}, $scopedSlots.default ? $scopedSlots.default.call(this, {}) : [(0, _utils.getFuncText)(content)])]);
|
|
92
92
|
},
|
|
93
93
|
methods: {
|
|
94
94
|
handleValue: function handleValue(label, evnt) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _utils=require("../../tools/utils"),_conf=_interopRequireDefault(require("../../v-x-e-table/src/conf"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperty(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var _default2={name:"VxeRadioButton",props:{value:[String,Number,Boolean],label:[String,Number,Boolean],title:[String,Number],content:[String,Number],disabled:Boolean,strict:{type:Boolean,default:function(){return _conf.default.radioButton.strict}},size:{type:String,default:function(){return _conf.default.radioButton.size||_conf.default.size}}},inject:{$xeradiogroup:{default:null}},computed:{vSize:function(){return this.size||this.$parent.size||this.$parent.vSize},isDisabled:function(){var e=this.$xeradiogroup;return this.disabled||e&&e.disabled},isStrict:function(){var e=this.$xeradiogroup;return(e||this).strict}},render:function(e){var t=this.$scopedSlots,i=this.$xeradiogroup,n=this.isDisabled,a=this.title,r=this.vSize,l=this.value,s=this.label,u=this.content,o={};return a&&(o.title=a),e("label",{class:["vxe-radio","vxe-radio-button",(_defineProperty(a={},"size--".concat(r),r),_defineProperty(a,"is--disabled",n),a)],attrs:o},[e("input",{class:"vxe-radio--input",attrs:{type:"radio",name:i?i.name:null,disabled:n},domProps:{checked:i?i.value===s:l===s},on:{change:this.changeEvent,click:this.clickEvent}}),e("span",{class:"vxe-radio--label"},t.default?t.default.call(this,{}):[(0,_utils.getFuncText)(u)])])},methods:{handleValue:function(e,t){var i=this.$xeradiogroup,t={label:e,$event:t};i?i.handleChecked(t):(this.$emit("input",e),this.$emit("change",t))},changeEvent:function(e){this.isDisabled||this.handleValue(this.label,e)},clickEvent:function(e){var t=this.$xeradiogroup,i=this.isDisabled,n=this.isStrict;i||n||this.label===(t||this).value&&this.handleValue(null,e)}}};exports.default=_default2;
|
package/lib/radio/src/radio.js
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _utils = require("../../tools/utils");
|
|
9
9
|
|
|
10
10
|
var _conf = _interopRequireDefault(require("../../v-x-e-table/src/conf"));
|
|
11
11
|
|
|
@@ -92,7 +92,7 @@ var _default2 = {
|
|
|
92
92
|
class: 'vxe-radio--icon'
|
|
93
93
|
}), h('span', {
|
|
94
94
|
class: 'vxe-radio--label'
|
|
95
|
-
}, $scopedSlots.default ? $scopedSlots.default.call(this, {}) : [
|
|
95
|
+
}, $scopedSlots.default ? $scopedSlots.default.call(this, {}) : [(0, _utils.getFuncText)(content)])]);
|
|
96
96
|
},
|
|
97
97
|
methods: {
|
|
98
98
|
handleValue: function handleValue(label, evnt) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _utils=require("../../tools/utils"),_conf=_interopRequireDefault(require("../../v-x-e-table/src/conf")),_size=_interopRequireDefault(require("../../mixins/size"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperty(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var _default2={name:"VxeRadio",mixins:[_size.default],props:{value:[String,Number,Boolean],label:[String,Number,Boolean],title:[String,Number],content:[String,Number],disabled:Boolean,name:String,strict:{type:Boolean,default:function(){return _conf.default.radio.strict}},size:{type:String,default:function(){return _conf.default.radio.size||_conf.default.size}}},inject:{$xeradiogroup:{default:null}},computed:{isDisabled:function(){var e=this.$xeradiogroup;return this.disabled||e&&e.disabled},isStrict:function(){var e=this.$xeradiogroup;return(e||this).strict}},render:function(e){var t=this.$scopedSlots,i=this.$xeradiogroup,a=this.isDisabled,r=this.title,n=this.vSize,s=this.value,l=this.label,u=this.name,o=this.content,d={};return r&&(d.title=r),e("label",{class:["vxe-radio",(_defineProperty(r={},"size--".concat(n),n),_defineProperty(r,"is--disabled",a),r)],attrs:d},[e("input",{class:"vxe-radio--input",attrs:{type:"radio",name:i?i.name:u,disabled:a},domProps:{checked:i?i.value===l:s===l},on:{change:this.changeEvent,click:this.clickEvent}}),e("span",{class:"vxe-radio--icon"}),e("span",{class:"vxe-radio--label"},t.default?t.default.call(this,{}):[(0,_utils.getFuncText)(o)])])},methods:{handleValue:function(e,t){var i=this.$xeradiogroup,t={label:e,$event:t};i?i.handleChecked(t):(this.$emit("input",e),this.$emit("change",t))},changeEvent:function(e){this.isDisabled||this.handleValue(this.label,e)},clickEvent:function(e){var t=this.$xeradiogroup,i=this.isDisabled,a=this.isStrict;i||a||this.label===(t||this).value&&this.handleValue(null,e)}}};exports.default=_default2;
|