vxe-table 3.4.14 → 3.4.15
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 -5
- package/lib/form/src/form-item.js +5 -0
- package/lib/form/src/form-item.min.js +1 -1
- package/lib/form/src/form.js +31 -27
- package/lib/form/src/form.min.js +1 -1
- package/lib/form/src/util.js +11 -0
- package/lib/form/src/util.min.js +1 -1
- package/lib/index.umd.js +159 -951
- package/lib/index.umd.min.js +1 -1
- package/lib/table/src/body.js +5 -8
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/methods.js +24 -11
- package/lib/table/src/methods.min.js +1 -1
- package/lib/tools/src/dom.js +6 -8
- package/lib/tools/src/dom.min.js +1 -1
- package/lib/tooltip/src/tooltip.js +81 -44
- package/lib/tooltip/src/tooltip.min.js +1 -1
- package/lib/v-x-e-table/src/conf.js +1 -0
- package/lib/v-x-e-table/src/conf.min.js +1 -1
- package/package.json +3 -3
- package/packages/form/src/form-item.js +5 -0
- package/packages/form/src/form.js +22 -16
- package/packages/form/src/util.js +7 -0
- package/packages/table/src/body.js +6 -9
- package/packages/table/src/methods.js +22 -11
- package/packages/tools/src/dom.js +6 -6
- package/packages/tooltip/src/tooltip.js +47 -23
- package/packages/v-x-e-table/src/conf.js +1 -0
- package/README.en.md +0 -170
- package/README.zh-TW.md +0 -174
|
@@ -53,6 +53,33 @@ function updateTipStyle(_vm) {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
+
function showTip(_vm) {
|
|
57
|
+
var $el = _vm.$el,
|
|
58
|
+
tipStore = _vm.tipStore,
|
|
59
|
+
zIndex = _vm.zIndex;
|
|
60
|
+
var parentNode = $el.parentNode;
|
|
61
|
+
|
|
62
|
+
if (!parentNode) {
|
|
63
|
+
document.body.appendChild($el);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
_vm.updateValue(true);
|
|
67
|
+
|
|
68
|
+
_vm.updateZindex();
|
|
69
|
+
|
|
70
|
+
tipStore.placement = 'top';
|
|
71
|
+
tipStore.style = {
|
|
72
|
+
width: 'auto',
|
|
73
|
+
left: 0,
|
|
74
|
+
top: 0,
|
|
75
|
+
zIndex: zIndex || _vm.tipZindex
|
|
76
|
+
};
|
|
77
|
+
tipStore.arrowStyle = {
|
|
78
|
+
left: '50%'
|
|
79
|
+
};
|
|
80
|
+
return _vm.updatePlacement();
|
|
81
|
+
}
|
|
82
|
+
|
|
56
83
|
var _default2 = {
|
|
57
84
|
name: 'VxeTooltip',
|
|
58
85
|
mixins: [_size.default],
|
|
@@ -83,6 +110,12 @@ var _default2 = {
|
|
|
83
110
|
default: true
|
|
84
111
|
},
|
|
85
112
|
enterable: Boolean,
|
|
113
|
+
enterDelay: {
|
|
114
|
+
type: Number,
|
|
115
|
+
default: function _default() {
|
|
116
|
+
return _conf.default.tooltip.enterDelay;
|
|
117
|
+
}
|
|
118
|
+
},
|
|
86
119
|
leaveDelay: {
|
|
87
120
|
type: Number,
|
|
88
121
|
default: function _default() {
|
|
@@ -94,9 +127,9 @@ var _default2 = {
|
|
|
94
127
|
data: function data() {
|
|
95
128
|
return {
|
|
96
129
|
isUpdate: false,
|
|
97
|
-
isHover: false,
|
|
98
130
|
visible: false,
|
|
99
131
|
message: '',
|
|
132
|
+
tipActive: false,
|
|
100
133
|
tipTarget: null,
|
|
101
134
|
tipZindex: 0,
|
|
102
135
|
tipStore: {
|
|
@@ -118,6 +151,18 @@ var _default2 = {
|
|
|
118
151
|
this.isUpdate = false;
|
|
119
152
|
}
|
|
120
153
|
},
|
|
154
|
+
created: function created() {
|
|
155
|
+
var _this = this;
|
|
156
|
+
|
|
157
|
+
this.showDelayTip = _xeUtils.default.debounce(function () {
|
|
158
|
+
if (_this.tipActive) {
|
|
159
|
+
showTip(_this);
|
|
160
|
+
}
|
|
161
|
+
}, this.enterDelay, {
|
|
162
|
+
leading: false,
|
|
163
|
+
trailing: true
|
|
164
|
+
});
|
|
165
|
+
},
|
|
121
166
|
mounted: function mounted() {
|
|
122
167
|
var $el = this.$el,
|
|
123
168
|
trigger = this.trigger,
|
|
@@ -180,7 +225,7 @@ var _default2 = {
|
|
|
180
225
|
vSize = this.vSize,
|
|
181
226
|
theme = this.theme,
|
|
182
227
|
message = this.message,
|
|
183
|
-
|
|
228
|
+
tipActive = this.tipActive,
|
|
184
229
|
isArrow = this.isArrow,
|
|
185
230
|
visible = this.visible,
|
|
186
231
|
tipStore = this.tipStore,
|
|
@@ -195,7 +240,7 @@ var _default2 = {
|
|
|
195
240
|
}
|
|
196
241
|
|
|
197
242
|
return h('div', {
|
|
198
|
-
class: ['vxe-table--tooltip-wrapper', "theme--".concat(theme), (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, "placement--".concat(tipStore.placement), tipStore.placement), _defineProperty(_ref, 'is--enterable', enterable), _defineProperty(_ref, 'is--visible', visible), _defineProperty(_ref, 'is--arrow', isArrow), _defineProperty(_ref, 'is--
|
|
243
|
+
class: ['vxe-table--tooltip-wrapper', "theme--".concat(theme), (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, "placement--".concat(tipStore.placement), tipStore.placement), _defineProperty(_ref, 'is--enterable', enterable), _defineProperty(_ref, 'is--visible', visible), _defineProperty(_ref, 'is--arrow', isArrow), _defineProperty(_ref, 'is--actived', tipActive), _ref)],
|
|
199
244
|
style: tipStore.style,
|
|
200
245
|
ref: 'tipWrapper',
|
|
201
246
|
on: on
|
|
@@ -212,15 +257,16 @@ var _default2 = {
|
|
|
212
257
|
},
|
|
213
258
|
close: function close() {
|
|
214
259
|
this.tipTarget = null;
|
|
260
|
+
this.tipActive = false;
|
|
215
261
|
Object.assign(this.tipStore, {
|
|
216
262
|
style: {},
|
|
217
263
|
placement: '',
|
|
218
264
|
arrowStyle: null
|
|
219
265
|
});
|
|
220
|
-
this.
|
|
266
|
+
this.updateValue(false);
|
|
221
267
|
return this.$nextTick();
|
|
222
268
|
},
|
|
223
|
-
|
|
269
|
+
updateValue: function updateValue(value) {
|
|
224
270
|
if (value !== this.visible) {
|
|
225
271
|
this.visible = value;
|
|
226
272
|
this.isUpdate = true;
|
|
@@ -236,55 +282,46 @@ var _default2 = {
|
|
|
236
282
|
}
|
|
237
283
|
},
|
|
238
284
|
toVisible: function toVisible(target, message) {
|
|
239
|
-
this.targetActive = true;
|
|
240
|
-
|
|
241
285
|
if (target) {
|
|
242
|
-
var
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
if (!parentNode) {
|
|
248
|
-
document.body.appendChild($el);
|
|
249
|
-
}
|
|
286
|
+
var trigger = this.trigger,
|
|
287
|
+
enterDelay = this.enterDelay;
|
|
288
|
+
this.tipActive = true;
|
|
289
|
+
this.tipTarget = target;
|
|
250
290
|
|
|
251
291
|
if (message) {
|
|
252
292
|
this.message = message;
|
|
253
293
|
}
|
|
254
294
|
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
width: 'auto',
|
|
261
|
-
left: 0,
|
|
262
|
-
top: 0,
|
|
263
|
-
zIndex: zIndex || this.tipZindex
|
|
264
|
-
};
|
|
265
|
-
tipStore.arrowStyle = {
|
|
266
|
-
left: '50%'
|
|
267
|
-
};
|
|
268
|
-
return this.updatePlacement();
|
|
295
|
+
if (enterDelay && trigger === 'hover') {
|
|
296
|
+
this.showDelayTip();
|
|
297
|
+
} else {
|
|
298
|
+
return showTip(this);
|
|
299
|
+
}
|
|
269
300
|
}
|
|
270
301
|
|
|
271
302
|
return this.$nextTick();
|
|
272
303
|
},
|
|
273
304
|
updatePlacement: function updatePlacement() {
|
|
274
|
-
var
|
|
305
|
+
var _this2 = this;
|
|
275
306
|
|
|
276
307
|
return this.$nextTick().then(function () {
|
|
277
|
-
var wrapperElem =
|
|
278
|
-
tipTarget =
|
|
308
|
+
var wrapperElem = _this2.$el,
|
|
309
|
+
tipTarget = _this2.tipTarget;
|
|
279
310
|
|
|
280
311
|
if (tipTarget && wrapperElem) {
|
|
281
|
-
updateTipStyle(
|
|
282
|
-
return
|
|
283
|
-
return updateTipStyle(
|
|
312
|
+
updateTipStyle(_this2);
|
|
313
|
+
return _this2.$nextTick().then(function () {
|
|
314
|
+
return updateTipStyle(_this2);
|
|
284
315
|
});
|
|
285
316
|
}
|
|
286
317
|
});
|
|
287
318
|
},
|
|
319
|
+
isActived: function isActived() {
|
|
320
|
+
return this.tipActive;
|
|
321
|
+
},
|
|
322
|
+
setActived: function setActived(actived) {
|
|
323
|
+
this.tipActive = !!actived;
|
|
324
|
+
},
|
|
288
325
|
clickEvent: function clickEvent() {
|
|
289
326
|
this[this.visible ? 'close' : 'open']();
|
|
290
327
|
},
|
|
@@ -292,17 +329,17 @@ var _default2 = {
|
|
|
292
329
|
this.open();
|
|
293
330
|
},
|
|
294
331
|
targetMouseleaveEvent: function targetMouseleaveEvent() {
|
|
295
|
-
var
|
|
332
|
+
var _this3 = this;
|
|
296
333
|
|
|
297
334
|
var trigger = this.trigger,
|
|
298
335
|
enterable = this.enterable,
|
|
299
336
|
leaveDelay = this.leaveDelay;
|
|
300
|
-
this.
|
|
337
|
+
this.tipActive = false;
|
|
301
338
|
|
|
302
339
|
if (enterable && trigger === 'hover') {
|
|
303
340
|
setTimeout(function () {
|
|
304
|
-
if (!
|
|
305
|
-
|
|
341
|
+
if (!_this3.tipActive) {
|
|
342
|
+
_this3.close();
|
|
306
343
|
}
|
|
307
344
|
}, leaveDelay);
|
|
308
345
|
} else {
|
|
@@ -310,24 +347,24 @@ var _default2 = {
|
|
|
310
347
|
}
|
|
311
348
|
},
|
|
312
349
|
wrapperMouseenterEvent: function wrapperMouseenterEvent() {
|
|
313
|
-
this.
|
|
350
|
+
this.tipActive = true;
|
|
314
351
|
},
|
|
315
352
|
wrapperMouseleaveEvent: function wrapperMouseleaveEvent(evnt) {
|
|
316
|
-
var
|
|
353
|
+
var _this4 = this;
|
|
317
354
|
|
|
318
355
|
var leaveMethod = this.leaveMethod,
|
|
319
356
|
trigger = this.trigger,
|
|
320
357
|
enterable = this.enterable,
|
|
321
358
|
leaveDelay = this.leaveDelay;
|
|
322
|
-
this.
|
|
359
|
+
this.tipActive = false;
|
|
323
360
|
|
|
324
361
|
if (!leaveMethod || leaveMethod({
|
|
325
362
|
$event: evnt
|
|
326
363
|
}) !== false) {
|
|
327
364
|
if (enterable && trigger === 'hover') {
|
|
328
365
|
setTimeout(function () {
|
|
329
|
-
if (!
|
|
330
|
-
|
|
366
|
+
if (!_this4.tipActive) {
|
|
367
|
+
_this4.close();
|
|
331
368
|
}
|
|
332
369
|
}, leaveDelay);
|
|
333
370
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _xeUtils=_interopRequireDefault(require("xe-utils")),_conf=_interopRequireDefault(require("../../v-x-e-table/src/conf")),_size=_interopRequireDefault(require("../../mixins/size")),_tools=require("../../tools");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}function updateTipStyle(e){var t,i,o,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _xeUtils=_interopRequireDefault(require("xe-utils")),_conf=_interopRequireDefault(require("../../v-x-e-table/src/conf")),_size=_interopRequireDefault(require("../../mixins/size")),_tools=require("../../tools");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}function updateTipStyle(e){var t,i,n,o,r,s,l,a=e.$el,u=e.tipTarget,c=e.tipStore;u&&(t=(s=_tools.DomTools.getDomNode()).scrollTop,i=s.scrollLeft,n=s.visibleWidth,o=(l=_tools.DomTools.getAbsolutePos(u)).top,r=l.left,e=a.offsetHeight,s=a.offsetWidth,l=o-e-6,i+n<(a=Math.max(6,r+Math.floor((u.offsetWidth-s)/2)))+s+6&&(a=i+n-s-6),o-e<t+6&&(c.placement="bottom",l=o+u.offsetHeight+6),c.style.top="".concat(l,"px"),c.style.left="".concat(a,"px"),c.arrowStyle.left="".concat(r-a+u.offsetWidth/2,"px"))}function showTip(e){var t=e.$el,i=e.tipStore,n=e.zIndex;return t.parentNode||document.body.appendChild(t),e.updateValue(!0),e.updateZindex(),i.placement="top",i.style={width:"auto",left:0,top:0,zIndex:n||e.tipZindex},i.arrowStyle={left:"50%"},e.updatePlacement()}var _default2={name:"VxeTooltip",mixins:[_size.default],props:{value:Boolean,size:{type:String,default:function(){return _conf.default.tooltip.size||_conf.default.size}},trigger:{type:String,default:function(){return _conf.default.tooltip.trigger}},theme:{type:String,default:function(){return _conf.default.tooltip.theme}},content:[String,Number],zIndex:[String,Number],isArrow:{type:Boolean,default:!0},enterable:Boolean,enterDelay:{type:Number,default:function(){return _conf.default.tooltip.enterDelay}},leaveDelay:{type:Number,default:function(){return _conf.default.tooltip.leaveDelay}},leaveMethod:Function},data:function(){return{isUpdate:!1,visible:!1,message:"",tipActive:!1,tipTarget:null,tipZindex:0,tipStore:{style:{},placement:"",arrowStyle:null}}},watch:{content:function(e){this.message=e},value:function(e){this.isUpdate||this[e?"open":"close"](),this.isUpdate=!1}},created:function(){var e=this;this.showDelayTip=_xeUtils.default.debounce(function(){e.tipActive&&showTip(e)},this.enterDelay,{leading:!1,trailing:!0})},mounted:function(){var i,n=this.$el,e=this.trigger,t=this.content,o=this.value,r=n.parentNode;this.message=t,this.tipZindex=_tools.UtilTools.nextZIndex(),_xeUtils.default.arrayEach(n.children,function(e,t){1<t&&(r.insertBefore(e,n),i=i||e)}),r.removeChild(n),(this.target=i)&&("hover"===e?(i.onmouseleave=this.targetMouseleaveEvent,i.onmouseenter=this.targetMouseenterEvent):"click"===e&&(i.onclick=this.clickEvent)),o&&this.open()},beforeDestroy:function(){var e=this.$el,t=this.target,i=this.trigger,n=e.parentNode;n&&n.removeChild(e),t&&("hover"===i?(t.onmouseenter=null,t.onmouseleave=null):"click"===i&&(t.onclick=null))},render:function(e){var t,i=this.$scopedSlots,n=this.vSize,o=this.theme,r=this.message,s=this.tipActive,l=this.isArrow,a=this.visible,u=this.tipStore,c=this.enterable;return c&&(t={mouseenter:this.wrapperMouseenterEvent,mouseleave:this.wrapperMouseleaveEvent}),e("div",{class:["vxe-table--tooltip-wrapper","theme--".concat(o),(_defineProperty(o={},"size--".concat(n),n),_defineProperty(o,"placement--".concat(u.placement),u.placement),_defineProperty(o,"is--enterable",c),_defineProperty(o,"is--visible",a),_defineProperty(o,"is--arrow",l),_defineProperty(o,"is--actived",s),o)],style:u.style,ref:"tipWrapper",on:t},[e("div",{class:"vxe-table--tooltip-content"},i.content?i.content.call(this,{}):r),e("div",{class:"vxe-table--tooltip-arrow",style:u.arrowStyle})].concat(i.default?i.default.call(this,{}):[]))},methods:{open:function(e,t){return this.toVisible(e||this.target,t)},close:function(){return this.tipTarget=null,this.tipActive=!1,Object.assign(this.tipStore,{style:{},placement:"",arrowStyle:null}),this.updateValue(!1),this.$nextTick()},updateValue:function(e){e!==this.visible&&(this.visible=e,this.isUpdate=!0,this.$listeners.input&&this.$emit("input",this.visible))},updateZindex:function(){this.tipZindex<_tools.UtilTools.getLastZIndex()&&(this.tipZindex=_tools.UtilTools.nextZIndex())},toVisible:function(e,t){if(e){var i=this.trigger,n=this.enterDelay;if(this.tipActive=!0,this.tipTarget=e,t&&(this.message=t),!n||"hover"!==i)return showTip(this);this.showDelayTip()}return this.$nextTick()},updatePlacement:function(){var t=this;return this.$nextTick().then(function(){var e=t.$el;if(t.tipTarget&&e)return updateTipStyle(t),t.$nextTick().then(function(){return updateTipStyle(t)})})},isActived:function(){return this.tipActive},setActived:function(e){this.tipActive=!!e},clickEvent:function(){this[this.visible?"close":"open"]()},targetMouseenterEvent:function(){this.open()},targetMouseleaveEvent:function(){var e=this,t=this.trigger,i=this.enterable,n=this.leaveDelay;this.tipActive=!1,i&&"hover"===t?setTimeout(function(){e.tipActive||e.close()},n):this.close()},wrapperMouseenterEvent:function(){this.tipActive=!0},wrapperMouseleaveEvent:function(e){var t=this,i=this.leaveMethod,n=this.trigger,o=this.enterable,r=this.leaveDelay;this.tipActive=!1,i&&!1===i({$event:e})||o&&"hover"===n&&setTimeout(function(){t.tipActive||t.close()},r)}}};exports.default=_default2;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var iconPrefix="vxe-icon--",_default={size:null,zIndex:999,version:0,emptyCell:" ",table:{fit:!0,showHeader:!0,animat:!0,delayHover:250,autoResize:!0,radioConfig:{strict:!0},checkboxConfig:{strict:!0},validConfig:{showMessage:!0,message:"default"},sortConfig:{showIcon:!0},filterConfig:{showIcon:!0},treeConfig:{rowField:"id",parentField:"parentId",children:"children",hasChild:"hasChild",mapChildren:"_X_CHILD",indent:20,showIcon:!0},expandConfig:{showIcon:!0},editConfig:{showIcon:!0,showAsterisk:!0},importConfig:{modes:["insert","covering"]},exportConfig:{modes:["current","selected"]},printConfig:{modes:["current","selected"]},mouseConfig:{extension:!0},keyboardConfig:{isEsc:!0},areaConfig:{selectCellByHeader:!0},clipConfig:{isCopy:!0,isCut:!0,isPaste:!0},fnrConfig:{isFind:!0,isReplace:!0},scrollX:{enabled:!0,gt:60},scrollY:{enabled:!0,gt:100}},export:{types:{}},icon:{TABLE_SORT_ASC:iconPrefix+"caret-top",TABLE_SORT_DESC:iconPrefix+"caret-bottom",TABLE_FILTER_NONE:iconPrefix+"funnel",TABLE_FILTER_MATCH:iconPrefix+"funnel",TABLE_EDIT:iconPrefix+"edit-outline",TABLE_HELP:iconPrefix+"question",TABLE_TREE_LOADED:iconPrefix+"refresh roll",TABLE_TREE_OPEN:iconPrefix+"caret-right rotate90",TABLE_TREE_CLOSE:iconPrefix+"caret-right",TABLE_EXPAND_LOADED:iconPrefix+"refresh roll",TABLE_EXPAND_OPEN:iconPrefix+"arrow-right rotate90",TABLE_EXPAND_CLOSE:iconPrefix+"arrow-right",BUTTON_DROPDOWN:iconPrefix+"arrow-bottom",BUTTON_LOADING:iconPrefix+"refresh roll",SELECT_LOADED:iconPrefix+"refresh roll",SELECT_OPEN:iconPrefix+"caret-bottom rotate180",SELECT_CLOSE:iconPrefix+"caret-bottom",PAGER_JUMP_PREV:iconPrefix+"d-arrow-left",PAGER_JUMP_NEXT:iconPrefix+"d-arrow-right",PAGER_PREV_PAGE:iconPrefix+"arrow-left",PAGER_NEXT_PAGE:iconPrefix+"arrow-right",PAGER_JUMP_MORE:iconPrefix+"more",INPUT_CLEAR:iconPrefix+"close",INPUT_PWD:iconPrefix+"eye-slash",INPUT_SHOW_PWD:iconPrefix+"eye",INPUT_PREV_NUM:iconPrefix+"caret-top",INPUT_NEXT_NUM:iconPrefix+"caret-bottom",INPUT_DATE:iconPrefix+"calendar",INPUT_SEARCH:iconPrefix+"search",MODAL_ZOOM_IN:iconPrefix+"square",MODAL_ZOOM_OUT:iconPrefix+"zoomout",MODAL_CLOSE:iconPrefix+"close",MODAL_INFO:iconPrefix+"info",MODAL_SUCCESS:iconPrefix+"success",MODAL_WARNING:iconPrefix+"warning",MODAL_ERROR:iconPrefix+"error",MODAL_QUESTION:iconPrefix+"question",MODAL_LOADING:iconPrefix+"refresh roll",TOOLBAR_TOOLS_REFRESH:iconPrefix+"refresh",TOOLBAR_TOOLS_REFRESH_LOADING:iconPrefix+"refresh roll",TOOLBAR_TOOLS_IMPORT:iconPrefix+"upload",TOOLBAR_TOOLS_EXPORT:iconPrefix+"download",TOOLBAR_TOOLS_PRINT:iconPrefix+"print",TOOLBAR_TOOLS_ZOOM_IN:iconPrefix+"zoomin",TOOLBAR_TOOLS_ZOOM_OUT:iconPrefix+"zoomout",TOOLBAR_TOOLS_CUSTOM:iconPrefix+"menu",FORM_PREFIX:iconPrefix+"question",FORM_SUFFIX:iconPrefix+"question",FORM_FOLDING:iconPrefix+"arrow-top rotate180",FORM_UNFOLDING:iconPrefix+"arrow-top"},grid:{formConfig:{enabled:!0},pagerConfig:{enabled:!0},toolbarConfig:{enabled:!0},proxyConfig:{enabled:!0,autoLoad:!0,message:!0,props:{list:null,result:"result",total:"page.total",message:"message"}}},tooltip:{trigger:"hover",theme:"dark",leaveDelay:300},pager:{},form:{validConfig:{showMessage:!0,autoPos:!0},titleAsterisk:!0},input:{minDate:new Date(1900,0,1),maxDate:new Date(2100,0,1),startDay:1,selectDay:1,digits:2,controls:!0},textarea:{},select:{multiCharOverflow:8},toolbar:{},button:{},radio:{strict:!0},radioButton:{strict:!0},radioGroup:{strict:!0},checkbox:{},switch:{},modal:{top:15,showHeader:!0,minWidth:340,minHeight:140,lockView:!0,mask:!0,duration:3e3,marginSize:0,dblclickZoom:!0,showTitleOverflow:!0,animat:!0,showClose:!0,draggable:!0,storageKey:"VXE_MODAL_POSITION"},list:{scrollY:{enabled:!0,gt:100}},i18n:function(e){return e}};exports.default=_default;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var iconPrefix="vxe-icon--",_default={size:null,zIndex:999,version:0,emptyCell:" ",table:{fit:!0,showHeader:!0,animat:!0,delayHover:250,autoResize:!0,radioConfig:{strict:!0},checkboxConfig:{strict:!0},validConfig:{showMessage:!0,message:"default"},sortConfig:{showIcon:!0},filterConfig:{showIcon:!0},treeConfig:{rowField:"id",parentField:"parentId",children:"children",hasChild:"hasChild",mapChildren:"_X_CHILD",indent:20,showIcon:!0},expandConfig:{showIcon:!0},editConfig:{showIcon:!0,showAsterisk:!0},importConfig:{modes:["insert","covering"]},exportConfig:{modes:["current","selected"]},printConfig:{modes:["current","selected"]},mouseConfig:{extension:!0},keyboardConfig:{isEsc:!0},areaConfig:{selectCellByHeader:!0},clipConfig:{isCopy:!0,isCut:!0,isPaste:!0},fnrConfig:{isFind:!0,isReplace:!0},scrollX:{enabled:!0,gt:60},scrollY:{enabled:!0,gt:100}},export:{types:{}},icon:{TABLE_SORT_ASC:iconPrefix+"caret-top",TABLE_SORT_DESC:iconPrefix+"caret-bottom",TABLE_FILTER_NONE:iconPrefix+"funnel",TABLE_FILTER_MATCH:iconPrefix+"funnel",TABLE_EDIT:iconPrefix+"edit-outline",TABLE_HELP:iconPrefix+"question",TABLE_TREE_LOADED:iconPrefix+"refresh roll",TABLE_TREE_OPEN:iconPrefix+"caret-right rotate90",TABLE_TREE_CLOSE:iconPrefix+"caret-right",TABLE_EXPAND_LOADED:iconPrefix+"refresh roll",TABLE_EXPAND_OPEN:iconPrefix+"arrow-right rotate90",TABLE_EXPAND_CLOSE:iconPrefix+"arrow-right",BUTTON_DROPDOWN:iconPrefix+"arrow-bottom",BUTTON_LOADING:iconPrefix+"refresh roll",SELECT_LOADED:iconPrefix+"refresh roll",SELECT_OPEN:iconPrefix+"caret-bottom rotate180",SELECT_CLOSE:iconPrefix+"caret-bottom",PAGER_JUMP_PREV:iconPrefix+"d-arrow-left",PAGER_JUMP_NEXT:iconPrefix+"d-arrow-right",PAGER_PREV_PAGE:iconPrefix+"arrow-left",PAGER_NEXT_PAGE:iconPrefix+"arrow-right",PAGER_JUMP_MORE:iconPrefix+"more",INPUT_CLEAR:iconPrefix+"close",INPUT_PWD:iconPrefix+"eye-slash",INPUT_SHOW_PWD:iconPrefix+"eye",INPUT_PREV_NUM:iconPrefix+"caret-top",INPUT_NEXT_NUM:iconPrefix+"caret-bottom",INPUT_DATE:iconPrefix+"calendar",INPUT_SEARCH:iconPrefix+"search",MODAL_ZOOM_IN:iconPrefix+"square",MODAL_ZOOM_OUT:iconPrefix+"zoomout",MODAL_CLOSE:iconPrefix+"close",MODAL_INFO:iconPrefix+"info",MODAL_SUCCESS:iconPrefix+"success",MODAL_WARNING:iconPrefix+"warning",MODAL_ERROR:iconPrefix+"error",MODAL_QUESTION:iconPrefix+"question",MODAL_LOADING:iconPrefix+"refresh roll",TOOLBAR_TOOLS_REFRESH:iconPrefix+"refresh",TOOLBAR_TOOLS_REFRESH_LOADING:iconPrefix+"refresh roll",TOOLBAR_TOOLS_IMPORT:iconPrefix+"upload",TOOLBAR_TOOLS_EXPORT:iconPrefix+"download",TOOLBAR_TOOLS_PRINT:iconPrefix+"print",TOOLBAR_TOOLS_ZOOM_IN:iconPrefix+"zoomin",TOOLBAR_TOOLS_ZOOM_OUT:iconPrefix+"zoomout",TOOLBAR_TOOLS_CUSTOM:iconPrefix+"menu",FORM_PREFIX:iconPrefix+"question",FORM_SUFFIX:iconPrefix+"question",FORM_FOLDING:iconPrefix+"arrow-top rotate180",FORM_UNFOLDING:iconPrefix+"arrow-top"},grid:{formConfig:{enabled:!0},pagerConfig:{enabled:!0},toolbarConfig:{enabled:!0},proxyConfig:{enabled:!0,autoLoad:!0,message:!0,props:{list:null,result:"result",total:"page.total",message:"message"}}},tooltip:{trigger:"hover",theme:"dark",enterDelay:500,leaveDelay:300},pager:{},form:{validConfig:{showMessage:!0,autoPos:!0},titleAsterisk:!0},input:{minDate:new Date(1900,0,1),maxDate:new Date(2100,0,1),startDay:1,selectDay:1,digits:2,controls:!0},textarea:{},select:{multiCharOverflow:8},toolbar:{},button:{},radio:{strict:!0},radioButton:{strict:!0},radioGroup:{strict:!0},checkbox:{},switch:{},modal:{top:15,showHeader:!0,minWidth:340,minHeight:140,lockView:!0,mask:!0,duration:3e3,marginSize:0,dblclickZoom:!0,showTitleOverflow:!0,animat:!0,showClose:!0,draggable:!0,storageKey:"VXE_MODAL_POSITION"},list:{scrollY:{enabled:!0,gt:100}},i18n:function(e){return e}};exports.default=_default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vxe-table",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.15",
|
|
4
4
|
"description": "一个基于 vue 的 PC 端表格组件,支持增删改查、虚拟列表、虚拟树、懒加载、快捷菜单、数据校验、树形结构、打印导出、表单渲染、数据分页、弹窗、自定义模板、渲染器、贼灵活的配置项、扩展接口等...",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"serve": "vue-cli-service serve",
|
|
@@ -66,11 +66,11 @@
|
|
|
66
66
|
"vuex": "^3.4.0",
|
|
67
67
|
"xe-ajax": "^4.0.5",
|
|
68
68
|
"xe-clipboard": "^1.10.1",
|
|
69
|
-
"xe-utils": "^3.5.
|
|
69
|
+
"xe-utils": "^3.5.4"
|
|
70
70
|
},
|
|
71
71
|
"peerDependencies": {
|
|
72
72
|
"vue": "^2.6.0",
|
|
73
|
-
"xe-utils": "^3.5.
|
|
73
|
+
"xe-utils": "^3.5.0"
|
|
74
74
|
},
|
|
75
75
|
"vetur": {
|
|
76
76
|
"tags": "helper/vetur/tags.json",
|
|
@@ -3,7 +3,7 @@ import GlobalConfig from '../../v-x-e-table/src/conf'
|
|
|
3
3
|
import vSize from '../../mixins/size'
|
|
4
4
|
import VXETable from '../../v-x-e-table'
|
|
5
5
|
import { UtilTools, DomTools, isEnableConf } from '../../tools'
|
|
6
|
-
import { createItem } from './util'
|
|
6
|
+
import { createItem, handleFieldOrItem } from './util'
|
|
7
7
|
import { renderTitle } from './render'
|
|
8
8
|
import { eqEmptyValue } from '../../tools/src/utils'
|
|
9
9
|
import { browse } from '../../tools/src/dom'
|
|
@@ -325,6 +325,10 @@ export default {
|
|
|
325
325
|
}, { children: 'children' })
|
|
326
326
|
return itemList
|
|
327
327
|
},
|
|
328
|
+
getItemByField (field) {
|
|
329
|
+
const rest = XEUtils.findTree(this.formItems, item => item.field === field, { children: 'children' })
|
|
330
|
+
return rest ? rest.item : null
|
|
331
|
+
},
|
|
328
332
|
toggleCollapse () {
|
|
329
333
|
const status = !this.collapseAll
|
|
330
334
|
this.collapseAll = status
|
|
@@ -416,11 +420,15 @@ export default {
|
|
|
416
420
|
},
|
|
417
421
|
handleTargetLeaveEvent () {
|
|
418
422
|
const { tooltipOpts } = this
|
|
423
|
+
let $tooltip = this.$refs.tooltip
|
|
419
424
|
this.tooltipActive = false
|
|
425
|
+
if ($tooltip) {
|
|
426
|
+
$tooltip.setActived(false)
|
|
427
|
+
}
|
|
420
428
|
if (tooltipOpts.enterable) {
|
|
421
429
|
this.tooltipTimeout = setTimeout(() => {
|
|
422
|
-
|
|
423
|
-
if ($tooltip && !$tooltip.
|
|
430
|
+
$tooltip = this.$refs.tooltip
|
|
431
|
+
if ($tooltip && !$tooltip.isActived()) {
|
|
424
432
|
this.closeTooltip()
|
|
425
433
|
}
|
|
426
434
|
}, tooltipOpts.leaveDelay)
|
|
@@ -428,15 +436,14 @@ export default {
|
|
|
428
436
|
this.closeTooltip()
|
|
429
437
|
}
|
|
430
438
|
},
|
|
431
|
-
clearValidate (
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
const item = itemList.find(item => item.field === field)
|
|
439
|
+
clearValidate (fieldOrItem) {
|
|
440
|
+
if (fieldOrItem) {
|
|
441
|
+
const item = handleFieldOrItem(this, fieldOrItem)
|
|
435
442
|
if (item) {
|
|
436
443
|
item.showError = false
|
|
437
444
|
}
|
|
438
445
|
} else {
|
|
439
|
-
|
|
446
|
+
this.getItems().forEach(item => {
|
|
440
447
|
item.showError = false
|
|
441
448
|
})
|
|
442
449
|
}
|
|
@@ -446,8 +453,9 @@ export default {
|
|
|
446
453
|
this.clearValidate()
|
|
447
454
|
return this.beginValidate(this.getItems(), '', callback)
|
|
448
455
|
},
|
|
449
|
-
validateField (
|
|
450
|
-
|
|
456
|
+
validateField (fieldOrItem, callback) {
|
|
457
|
+
const item = handleFieldOrItem(this, fieldOrItem)
|
|
458
|
+
return this.beginValidate(item ? [item] : [], '', callback)
|
|
451
459
|
},
|
|
452
460
|
beginValidate (itemList, type, callback) {
|
|
453
461
|
const { data, rules: formRules, validOpts } = this
|
|
@@ -480,7 +488,7 @@ export default {
|
|
|
480
488
|
callback()
|
|
481
489
|
}
|
|
482
490
|
}).catch(() => {
|
|
483
|
-
return new Promise((resolve
|
|
491
|
+
return new Promise((resolve) => {
|
|
484
492
|
this.showErrTime = setTimeout(() => {
|
|
485
493
|
itemList.forEach(item => {
|
|
486
494
|
if (item.errRule) {
|
|
@@ -497,7 +505,7 @@ export default {
|
|
|
497
505
|
callback(validRest)
|
|
498
506
|
resolve()
|
|
499
507
|
} else {
|
|
500
|
-
|
|
508
|
+
resolve(validRest)
|
|
501
509
|
}
|
|
502
510
|
})
|
|
503
511
|
})
|
|
@@ -574,9 +582,8 @@ export default {
|
|
|
574
582
|
},
|
|
575
583
|
handleFocus (fields) {
|
|
576
584
|
const { $el } = this
|
|
577
|
-
const itemList = this.getItems()
|
|
578
585
|
fields.some((property, index) => {
|
|
579
|
-
const item =
|
|
586
|
+
const item = this.getItemByField(property)
|
|
580
587
|
if (item && isEnableConf(item.itemRender)) {
|
|
581
588
|
const { itemRender } = item
|
|
582
589
|
const compConf = VXETable.renderer.get(itemRender.name)
|
|
@@ -619,8 +626,7 @@ export default {
|
|
|
619
626
|
this.clearValidate(property)
|
|
620
627
|
})
|
|
621
628
|
.catch(({ rule }) => {
|
|
622
|
-
const
|
|
623
|
-
const item = itemList.find(item => item.field === property)
|
|
629
|
+
const item = this.getItemByField(property)
|
|
624
630
|
if (item) {
|
|
625
631
|
item.showError = true
|
|
626
632
|
item.errRule = rule
|
|
@@ -49,6 +49,13 @@ export function getItemConfig ($xeform, _vm, options) {
|
|
|
49
49
|
return isItem(_vm) ? _vm : new ItemConfig($xeform, _vm, options)
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
export const handleFieldOrItem = ($xeform, fieldOrItem) => {
|
|
53
|
+
if (fieldOrItem) {
|
|
54
|
+
return XEUtils.isString(fieldOrItem) ? $xeform.getItemByField(fieldOrItem) : fieldOrItem
|
|
55
|
+
}
|
|
56
|
+
return null
|
|
57
|
+
}
|
|
58
|
+
|
|
52
59
|
export function createItem ($xeform, _vm) {
|
|
53
60
|
return getItemConfig($xeform, _vm)
|
|
54
61
|
}
|
|
@@ -3,7 +3,7 @@ import GlobalConfig from '../../v-x-e-table/src/conf'
|
|
|
3
3
|
import VXETable from '../../v-x-e-table'
|
|
4
4
|
import { UtilTools, DomTools, isEnableConf } from '../../tools'
|
|
5
5
|
import { getOffsetSize, calcTreeLine, mergeBodyMethod, removeScrollListener, restoreScrollListener } from './util'
|
|
6
|
-
import {
|
|
6
|
+
import { setScrollTop } from '../../tools/src/dom'
|
|
7
7
|
|
|
8
8
|
const renderType = 'body'
|
|
9
9
|
|
|
@@ -421,21 +421,18 @@ function syncBodyScroll (_vm, fixedType, scrollTop, elem1, elem2) {
|
|
|
421
421
|
restoreScrollListener(elem2)
|
|
422
422
|
// 检查滚动条是的同步
|
|
423
423
|
let targetTop = bodyElem.scrollTop
|
|
424
|
-
let targetLeft = bodyElem.scrollLeft
|
|
425
424
|
if (fixedType === 'left') {
|
|
426
425
|
if (leftElem) {
|
|
427
426
|
targetTop = leftElem.scrollTop
|
|
428
|
-
targetLeft = leftElem.scrollLeft
|
|
429
427
|
}
|
|
430
428
|
} else if (fixedType === 'right') {
|
|
431
429
|
if (rightElem) {
|
|
432
430
|
targetTop = rightElem.scrollTop
|
|
433
|
-
targetLeft = rightElem.scrollLeft
|
|
434
431
|
}
|
|
435
432
|
}
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
433
|
+
setScrollTop(bodyElem, targetTop)
|
|
434
|
+
setScrollTop(leftElem, targetTop)
|
|
435
|
+
setScrollTop(rightElem, targetTop)
|
|
439
436
|
}, 300)
|
|
440
437
|
}
|
|
441
438
|
}
|
|
@@ -749,8 +746,8 @@ export default {
|
|
|
749
746
|
const { tableBody } = $refs
|
|
750
747
|
const bodyElem = tableBody.$el
|
|
751
748
|
|
|
752
|
-
const deltaTop =
|
|
753
|
-
const deltaLeft =
|
|
749
|
+
const deltaTop = deltaY
|
|
750
|
+
const deltaLeft = deltaX
|
|
754
751
|
const isTopWheel = deltaTop < 0
|
|
755
752
|
// 如果滚动位置已经是顶部或底部,则不需要触发
|
|
756
753
|
if (isTopWheel ? scrollBodyElem.scrollTop <= 0 : scrollBodyElem.scrollTop >= scrollBodyElem.scrollHeight - scrollBodyElem.clientHeight) {
|
|
@@ -2558,18 +2558,29 @@ const Methods = {
|
|
|
2558
2558
|
}, tooltipOpts.leaveDelay)
|
|
2559
2559
|
return false
|
|
2560
2560
|
},
|
|
2561
|
-
handleTargetEnterEvent () {
|
|
2561
|
+
handleTargetEnterEvent (isClear) {
|
|
2562
|
+
const $tooltip = this.$refs.tooltip
|
|
2562
2563
|
clearTimeout(this.tooltipTimeout)
|
|
2563
2564
|
this.tooltipActive = true
|
|
2564
|
-
|
|
2565
|
+
if (isClear) {
|
|
2566
|
+
this.closeTooltip()
|
|
2567
|
+
} else {
|
|
2568
|
+
if ($tooltip) {
|
|
2569
|
+
$tooltip.setActived(true)
|
|
2570
|
+
}
|
|
2571
|
+
}
|
|
2565
2572
|
},
|
|
2566
2573
|
handleTargetLeaveEvent () {
|
|
2567
2574
|
const tooltipOpts = this.tooltipOpts
|
|
2575
|
+
let $tooltip = this.$refs.tooltip
|
|
2568
2576
|
this.tooltipActive = false
|
|
2577
|
+
if ($tooltip) {
|
|
2578
|
+
$tooltip.setActived(false)
|
|
2579
|
+
}
|
|
2569
2580
|
if (tooltipOpts.enterable) {
|
|
2570
2581
|
this.tooltipTimeout = setTimeout(() => {
|
|
2571
|
-
|
|
2572
|
-
if (tooltip &&
|
|
2582
|
+
$tooltip = this.$refs.tooltip
|
|
2583
|
+
if ($tooltip && !$tooltip.isActived()) {
|
|
2573
2584
|
this.closeTooltip()
|
|
2574
2585
|
}
|
|
2575
2586
|
}, tooltipOpts.leaveDelay)
|
|
@@ -2582,12 +2593,12 @@ const Methods = {
|
|
|
2582
2593
|
const { titleHelp } = column
|
|
2583
2594
|
if (titleHelp.content || titleHelp.message) {
|
|
2584
2595
|
const { $refs, tooltipStore } = this
|
|
2585
|
-
const tooltip = $refs.tooltip
|
|
2596
|
+
const $tooltip = $refs.tooltip
|
|
2586
2597
|
const content = UtilTools.getFuncText(titleHelp.content || titleHelp.message)
|
|
2587
|
-
this.handleTargetEnterEvent()
|
|
2598
|
+
this.handleTargetEnterEvent(true)
|
|
2588
2599
|
tooltipStore.visible = true
|
|
2589
|
-
if (tooltip) {
|
|
2590
|
-
tooltip.open(evnt.currentTarget, content)
|
|
2600
|
+
if ($tooltip) {
|
|
2601
|
+
$tooltip.open(evnt.currentTarget, content)
|
|
2591
2602
|
}
|
|
2592
2603
|
}
|
|
2593
2604
|
},
|
|
@@ -2598,7 +2609,7 @@ const Methods = {
|
|
|
2598
2609
|
const { tooltipStore } = this
|
|
2599
2610
|
const { column } = params
|
|
2600
2611
|
const titleElem = evnt.currentTarget
|
|
2601
|
-
this.handleTargetEnterEvent()
|
|
2612
|
+
this.handleTargetEnterEvent(tooltipStore.column !== column || tooltipStore.row)
|
|
2602
2613
|
if (tooltipStore.column !== column || !tooltipStore.visible) {
|
|
2603
2614
|
this.handleTooltip(evnt, titleElem, titleElem, null, params)
|
|
2604
2615
|
}
|
|
@@ -2611,7 +2622,7 @@ const Methods = {
|
|
|
2611
2622
|
const { actived } = editStore
|
|
2612
2623
|
const { row, column } = params
|
|
2613
2624
|
const cell = evnt.currentTarget
|
|
2614
|
-
this.handleTargetEnterEvent()
|
|
2625
|
+
this.handleTargetEnterEvent(tooltipStore.column !== column || tooltipStore.row !== row)
|
|
2615
2626
|
if (isEnableConf(editConfig)) {
|
|
2616
2627
|
if ((editOpts.mode === 'row' && actived.row === row) || (actived.row === row && actived.column === column)) {
|
|
2617
2628
|
return
|
|
@@ -2638,7 +2649,7 @@ const Methods = {
|
|
|
2638
2649
|
const { column } = params
|
|
2639
2650
|
const { tooltipStore } = this
|
|
2640
2651
|
const cell = evnt.currentTarget
|
|
2641
|
-
this.handleTargetEnterEvent()
|
|
2652
|
+
this.handleTargetEnterEvent(true)
|
|
2642
2653
|
if (tooltipStore.column !== column || !tooltipStore.visible) {
|
|
2643
2654
|
this.handleTooltip(evnt, cell, cell.querySelector('.vxe-cell--item') || cell.children[0], null, params)
|
|
2644
2655
|
}
|
|
@@ -80,12 +80,12 @@ export function setScrollLeft (elem, scrollLeft) {
|
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
export function setScrollLeftAndTop (elem, scrollLeft, scrollTop) {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}
|
|
83
|
+
// export function setScrollLeftAndTop (elem, scrollLeft, scrollTop) {
|
|
84
|
+
// if (elem) {
|
|
85
|
+
// elem.scrollLeft = scrollLeft
|
|
86
|
+
// elem.scrollTop = scrollTop
|
|
87
|
+
// }
|
|
88
|
+
// }
|
|
89
89
|
|
|
90
90
|
function isNodeElement (elem) {
|
|
91
91
|
return elem && elem.nodeType === 1
|