vxe-pc-ui 3.3.40 → 3.3.42
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/es/color-picker/src/color-picker.js +10 -1
- package/es/form/src/render.js +3 -2
- package/es/icon/style.css +1 -1
- package/es/list/src/list.js +60 -12
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/ui/index.js +2 -1
- package/es/ui/src/log.js +1 -1
- package/es/upload/src/upload.js +9 -2
- package/es/upload/style.css +9 -7
- package/es/upload/style.min.css +1 -1
- package/es/vxe-upload/style.css +9 -7
- package/es/vxe-upload/style.min.css +1 -1
- package/lib/color-picker/src/color-picker.js +10 -1
- package/lib/color-picker/src/color-picker.min.js +1 -1
- package/lib/form/src/render.js +2 -1
- package/lib/form/src/render.min.js +1 -1
- package/lib/icon/style/style.css +1 -1
- package/lib/icon/style/style.min.css +1 -1
- package/lib/index.umd.js +82 -16
- package/lib/index.umd.min.js +1 -1
- package/lib/list/src/list.js +58 -11
- package/lib/list/src/list.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/ui/index.js +2 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/upload/src/upload.js +9 -1
- package/lib/upload/src/upload.min.js +1 -1
- package/lib/upload/style/style.css +9 -7
- package/lib/upload/style/style.min.css +1 -1
- package/lib/vxe-upload/style/style.css +9 -7
- package/lib/vxe-upload/style/style.min.css +1 -1
- package/package.json +1 -1
- package/packages/color-picker/src/color-picker.ts +8 -0
- package/packages/form/src/render.ts +3 -2
- package/packages/list/src/list.ts +63 -13
- package/packages/ui/index.ts +1 -0
- package/packages/upload/src/upload.ts +10 -3
- package/styles/components/upload.scss +12 -11
- package/types/components/color-picker.d.ts +42 -2
- package/types/components/list.d.ts +3 -1
- package/types/components/table-module/edit.d.ts +26 -7
- /package/es/icon/{iconfont.1734517198871.ttf → iconfont.1734675929343.ttf} +0 -0
- /package/es/icon/{iconfont.1734517198871.woff → iconfont.1734675929343.woff} +0 -0
- /package/es/icon/{iconfont.1734517198871.woff2 → iconfont.1734675929343.woff2} +0 -0
- /package/es/{iconfont.1734517198871.ttf → iconfont.1734675929343.ttf} +0 -0
- /package/es/{iconfont.1734517198871.woff → iconfont.1734675929343.woff} +0 -0
- /package/es/{iconfont.1734517198871.woff2 → iconfont.1734675929343.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1734517198871.ttf → iconfont.1734675929343.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1734517198871.woff → iconfont.1734675929343.woff} +0 -0
- /package/lib/icon/style/{iconfont.1734517198871.woff2 → iconfont.1734675929343.woff2} +0 -0
- /package/lib/{iconfont.1734517198871.ttf → iconfont.1734675929343.ttf} +0 -0
- /package/lib/{iconfont.1734517198871.woff → iconfont.1734675929343.woff} +0 -0
- /package/lib/{iconfont.1734517198871.woff2 → iconfont.1734675929343.woff2} +0 -0
package/lib/list/src/list.js
CHANGED
|
@@ -44,7 +44,9 @@ var _default2 = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
44
44
|
var reactData = {
|
|
45
45
|
scrollYLoad: false,
|
|
46
46
|
bodyHeight: 0,
|
|
47
|
-
|
|
47
|
+
customHeight: 0,
|
|
48
|
+
customMaxHeight: 0,
|
|
49
|
+
parentHeight: 0,
|
|
48
50
|
topSpaceHeight: 0,
|
|
49
51
|
items: []
|
|
50
52
|
};
|
|
@@ -76,14 +78,17 @@ var _default2 = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
76
78
|
computeStyles: function computeStyles() {
|
|
77
79
|
var $xeList = this;
|
|
78
80
|
var props = $xeList;
|
|
81
|
+
var reactData = $xeList.reactData;
|
|
79
82
|
var height = props.height,
|
|
80
83
|
maxHeight = props.maxHeight;
|
|
84
|
+
var customHeight = reactData.customHeight,
|
|
85
|
+
customMaxHeight = reactData.customMaxHeight;
|
|
81
86
|
var style = {};
|
|
82
87
|
if (height) {
|
|
83
|
-
style.height = "".concat(
|
|
88
|
+
style.height = "".concat(customHeight, "px");
|
|
84
89
|
} else if (maxHeight) {
|
|
85
90
|
style.height = 'auto';
|
|
86
|
-
style.maxHeight = "".concat(
|
|
91
|
+
style.maxHeight = "".concat(customMaxHeight, "px");
|
|
87
92
|
}
|
|
88
93
|
return style;
|
|
89
94
|
}
|
|
@@ -144,6 +149,33 @@ var _default2 = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
144
149
|
$xeList.clearScroll();
|
|
145
150
|
return $xeList.loadData(datas);
|
|
146
151
|
},
|
|
152
|
+
calcTableHeight: function calcTableHeight(key) {
|
|
153
|
+
var $xeList = this;
|
|
154
|
+
var props = $xeList;
|
|
155
|
+
var reactData = $xeList.reactData;
|
|
156
|
+
var parentHeight = reactData.parentHeight;
|
|
157
|
+
var val = props[key];
|
|
158
|
+
var num = 0;
|
|
159
|
+
if (val) {
|
|
160
|
+
if (val === '100%' || val === 'auto') {
|
|
161
|
+
num = parentHeight;
|
|
162
|
+
} else {
|
|
163
|
+
if ((0, _dom.isScale)(val)) {
|
|
164
|
+
num = Math.floor((_xeUtils.default.toInteger(val) || 1) / 100 * parentHeight);
|
|
165
|
+
} else {
|
|
166
|
+
num = _xeUtils.default.toNumber(val);
|
|
167
|
+
}
|
|
168
|
+
num = Math.max(40, num);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
return num;
|
|
172
|
+
},
|
|
173
|
+
updateHeight: function updateHeight() {
|
|
174
|
+
var $xeList = this;
|
|
175
|
+
var reactData = $xeList.reactData;
|
|
176
|
+
reactData.customHeight = $xeList.calcTableHeight('height');
|
|
177
|
+
reactData.customMaxHeight = $xeList.calcTableHeight('maxHeight');
|
|
178
|
+
},
|
|
147
179
|
updateYSpace: function updateYSpace() {
|
|
148
180
|
var $xeList = this;
|
|
149
181
|
var reactData = $xeList.reactData;
|
|
@@ -200,12 +232,11 @@ var _default2 = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
200
232
|
var offsetYSize = sYOpts.oSize ? _xeUtils.default.toNumber(sYOpts.oSize) : _dom.browse.edge ? 10 : 0;
|
|
201
233
|
scrollYStore.offsetSize = offsetYSize;
|
|
202
234
|
scrollYStore.visibleSize = visibleYSize;
|
|
203
|
-
scrollYStore.endIndex = Math.max(scrollYStore.startIndex
|
|
235
|
+
scrollYStore.endIndex = Math.max(scrollYStore.startIndex + visibleYSize + offsetYSize, scrollYStore.endIndex);
|
|
204
236
|
$xeList.updateYData();
|
|
205
237
|
} else {
|
|
206
238
|
$xeList.updateYSpace();
|
|
207
239
|
}
|
|
208
|
-
reactData.rowHeight = rowHeight;
|
|
209
240
|
});
|
|
210
241
|
},
|
|
211
242
|
/**
|
|
@@ -266,11 +297,17 @@ var _default2 = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
266
297
|
*/
|
|
267
298
|
recalculate: function recalculate() {
|
|
268
299
|
var $xeList = this;
|
|
300
|
+
var reactData = $xeList.reactData;
|
|
269
301
|
var el = $xeList.$refs.refElem;
|
|
270
|
-
if (el
|
|
271
|
-
|
|
302
|
+
if (el) {
|
|
303
|
+
var parentEl = el.parentElement;
|
|
304
|
+
reactData.parentHeight = parentEl ? parentEl.clientHeight : 0;
|
|
305
|
+
$xeList.updateHeight();
|
|
306
|
+
if (el.clientWidth && el.clientHeight) {
|
|
307
|
+
return $xeList.computeScrollLoad();
|
|
308
|
+
}
|
|
272
309
|
}
|
|
273
|
-
return
|
|
310
|
+
return $xeList.$nextTick();
|
|
274
311
|
},
|
|
275
312
|
loadYData: function loadYData(evnt) {
|
|
276
313
|
var $xeList = this;
|
|
@@ -374,6 +411,14 @@ var _default2 = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
374
411
|
var props = $xeList;
|
|
375
412
|
$xeList.loadData(props.data || []);
|
|
376
413
|
},
|
|
414
|
+
height: function height() {
|
|
415
|
+
var $xeList = this;
|
|
416
|
+
$xeList.recalculate();
|
|
417
|
+
},
|
|
418
|
+
maxHeight: function maxHeight() {
|
|
419
|
+
var $xeList = this;
|
|
420
|
+
$xeList.recalculate();
|
|
421
|
+
},
|
|
377
422
|
syncResize: function syncResize(val) {
|
|
378
423
|
var $xeList = this;
|
|
379
424
|
if (val) {
|
|
@@ -389,23 +434,25 @@ var _default2 = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
389
434
|
created: function created() {
|
|
390
435
|
var $xeList = this;
|
|
391
436
|
var props = $xeList;
|
|
392
|
-
_ui.globalEvents.on($xeList, 'resize', function () {
|
|
393
|
-
$xeList.recalculate();
|
|
394
|
-
});
|
|
395
437
|
$xeList.loadData(props.data || []);
|
|
396
438
|
},
|
|
397
439
|
mounted: function mounted() {
|
|
398
440
|
var $xeList = this;
|
|
399
441
|
var props = $xeList;
|
|
400
442
|
var internalData = $xeList.internalData;
|
|
443
|
+
$xeList.recalculate();
|
|
401
444
|
if (props.autoResize) {
|
|
402
445
|
var el = $xeList.$refs.refElem;
|
|
403
446
|
var resizeObserver = _ui.globalResize.create(function () {
|
|
404
447
|
return $xeList.recalculate();
|
|
405
448
|
});
|
|
406
449
|
resizeObserver.observe(el);
|
|
450
|
+
if (el) {
|
|
451
|
+
resizeObserver.observe(el.parentElement);
|
|
452
|
+
}
|
|
407
453
|
internalData.resizeObserver = resizeObserver;
|
|
408
454
|
}
|
|
455
|
+
_ui.globalEvents.on($xeList, 'resize', $xeList.recalculate);
|
|
409
456
|
},
|
|
410
457
|
activated: function activated() {
|
|
411
458
|
var $xeList = this;
|
package/lib/list/src/list.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _comp=require("../../ui/src/comp"),_xeUtils=_interopRequireDefault(require("xe-utils")),_ui=require("../../ui"),_dom=require("../../ui/src/dom"),_vn=require("../../ui/src/vn"),_loading=_interopRequireDefault(require("../../loading/src/loading"));function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}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)}function _defineProperty(t,e,
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _comp=require("../../ui/src/comp"),_xeUtils=_interopRequireDefault(require("xe-utils")),_ui=require("../../ui"),_dom=require("../../ui/src/dom"),_vn=require("../../ui/src/vn"),_loading=_interopRequireDefault(require("../../loading/src/loading"));function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}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)}function _defineProperty(t,e,i){return(e=_toPropertyKey(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function _toPropertyKey(t){t=_toPrimitive(t,"string");return"symbol"==_typeof(t)?t:t+""}function _toPrimitive(t,e){if("object"!=_typeof(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0===i)return("string"===e?String:Number)(t);i=i.call(t,e||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}var _default2=exports.default=(0,_comp.defineVxeComponent)({name:"VxeList",mixins:[_ui.globalMixins.sizeMixin],props:{data:Array,height:[Number,String],maxHeight:[Number,String],loading:Boolean,className:[String,Function],size:{type:String,default:function(){return(0,_ui.getConfig)().list.size||(0,_ui.getConfig)().size}},autoResize:{type:Boolean,default:function(){return(0,_ui.getConfig)().list.autoResize}},syncResize:[Boolean,String,Number],scrollY:Object},data:function(){return{xID:_xeUtils.default.uniqueId(),reactData:{scrollYLoad:!1,bodyHeight:0,customHeight:0,customMaxHeight:0,parentHeight:0,topSpaceHeight:0,items:[]},internalData:{resizeObserver:void 0,fullData:[],lastScrollLeft:0,lastScrollTop:0,scrollYStore:{startIndex:0,endIndex:0,visibleSize:0,offsetSize:0,rowHeight:0}}}},computed:Object.assign(Object.assign({},{}),{computeSYOpts:function(){return Object.assign({},(0,_ui.getConfig)().list.scrollY,this.scrollY)},computeStyles:function(){var t=this.reactData,e=this.height,i=this.maxHeight,r=t.customHeight,t=t.customMaxHeight,a={};return e?a.height="".concat(r,"px"):i&&(a.height="auto",a.maxHeight="".concat(t,"px")),a}}),methods:{dispatchEvent:function(t,e,i){this.$emit(t,(0,_ui.createEvent)(i,{$list:this},e))},callSlot:function(t,e,i){var r=this.$scopedSlots;return t&&(_xeUtils.default.isString(t)&&(t=r[t]||null),_xeUtils.default.isFunction(t))?(0,_vn.getSlotVNs)(t.call(this,e,i)):[]},loadData:function(t){var e=this,i=e.reactData,r=e.internalData,a=r.scrollYStore,l=e.computeSYOpts,t=t||[];return Object.assign(a,{startIndex:0,endIndex:1,visibleSize:0}),r.fullData=t,i.scrollYLoad=!!l.enabled&&-1<l.gt&&(0===l.gt||l.gt<=t.length),e.handleData(),e.computeScrollLoad().then(function(){e.refreshScroll()})},reloadData:function(t){return this.clearScroll(),this.loadData(t)},calcTableHeight:function(t){var e=this.reactData.parentHeight,t=this[t],i=0;return i=t?"100%"===t||"auto"===t?e:(i=(0,_dom.isScale)(t)?Math.floor((_xeUtils.default.toInteger(t)||1)/100*e):_xeUtils.default.toNumber(t),Math.max(40,i)):i},updateHeight:function(){var t=this.reactData;t.customHeight=this.calcTableHeight("height"),t.customMaxHeight=this.calcTableHeight("maxHeight")},updateYSpace:function(){var t=this.reactData,e=this.internalData,i=t.scrollYLoad,r=e.scrollYStore;t.bodyHeight=i?e.fullData.length*r.rowHeight:0,t.topSpaceHeight=i?Math.max(r.startIndex*r.rowHeight,0):0},handleData:function(){var t=this.reactData,e=this.internalData,i=t.scrollYLoad,r=e.fullData,e=e.scrollYStore;return t.items=i?r.slice(e.startIndex,e.endIndex):r.slice(0),this.$nextTick()},updateYData:function(){this.handleData(),this.updateYSpace()},computeScrollLoad:function(){var o=this,n=o.reactData,s=o.internalData;return o.$nextTick().then(function(){var t,e=n.scrollYLoad,i=s.scrollYStore,r=o.$refs.refVirtualBody,a=o.computeSYOpts,l=0;(t=r?(t=a.sItem?r.querySelector(a.sItem):t)||r.children[0]:t)&&(l=t.offsetHeight),l=Math.max(20,l),i.rowHeight=l,e?(r=o.$refs.refVirtualWrapper,t=Math.max(8,Math.ceil(r.clientHeight/l)),e=a.oSize?_xeUtils.default.toNumber(a.oSize):_dom.browse.edge?10:0,i.offsetSize=e,i.visibleSize=t,i.endIndex=Math.max(i.startIndex+t+e,i.endIndex),o.updateYData()):o.updateYSpace()})},clearScroll:function(){var t=this.$refs.refVirtualWrapper;return t&&(t.scrollTop=0),this.$nextTick()},scrollTo:function(t,e){var i=this,r=i.reactData,a=i.$refs.refVirtualWrapper;return _xeUtils.default.isNumber(t)&&(a.scrollLeft=t),_xeUtils.default.isNumber(e)&&(a.scrollTop=e),r.scrollYLoad?new Promise(function(t){setTimeout(function(){i.$nextTick(function(){t()})},50)}):i.$nextTick()},refreshScroll:function(){var t=this.internalData,e=t.lastScrollLeft,i=t.lastScrollTop;return this.clearScroll().then(function(){if(e||i)return t.lastScrollLeft=0,t.lastScrollTop=0,scrollTo(e,i)})},recalculate:function(){var t=this,e=t.reactData,i=t.$refs.refElem;if(i){var r=i.parentElement;if(e.parentHeight=r?r.clientHeight:0,t.updateHeight(),i.clientWidth&&i.clientHeight)return t.computeScrollLoad()}return t.$nextTick()},loadYData:function(t){var e=this.internalData.scrollYStore,i=e.startIndex,r=e.endIndex,a=e.visibleSize,l=e.offsetSize,t=t.target.scrollTop,t=Math.floor(t/e.rowHeight),o=Math.max(0,t-1-l),l=t+a+l;!(t<=i||r-a-1<=t)||i===o&&r===l||(e.startIndex=o,e.endIndex=l,this.updateYData())},scrollEvent:function(t){var e=this.reactData,i=this.internalData,r=t.target,a=r.scrollTop,r=r.scrollLeft,l=r!==i.lastScrollLeft,o=a!==i.lastScrollTop;i.lastScrollTop=a,i.lastScrollLeft=r,e.scrollYLoad&&this.loadYData(t),this.dispatchEvent("scroll",{scrollLeft:r,scrollTop:a,isX:l,isY:o},t)},renderVN:function(t){var e=this,i=e.reactData,r=e.className,a=e.loading,l=i.bodyHeight,o=i.topSpaceHeight,i=i.items,n=e.$scopedSlots.default,s=e.computeSize,c=e.computeStyles;return t("div",{ref:"refElem",class:["vxe-list",r?_xeUtils.default.isFunction(r)?r({$list:e}):r:"",_defineProperty(_defineProperty({},"size--".concat(s),s),"is--loading",a)]},[t("div",{ref:"refVirtualWrapper",class:"vxe-list--virtual-wrapper",style:c,on:{scroll:e.scrollEvent}},[t("div",{class:"vxe-list--y-space",style:{height:l?"".concat(l,"px"):""}}),t("div",{ref:"refVirtualBody",class:"vxe-list--body",style:{marginTop:o?"".concat(o,"px"):""}},n?e.callSlot(n,{items:i},t):[])]),t(_loading.default,{class:"vxe-list--loading",props:{value:a}})])}},watch:{data:function(){this.loadData(this.data||[])},height:function(){this.recalculate()},maxHeight:function(){this.recalculate()},syncResize:function(t){var e=this;t&&(e.recalculate(),e.$nextTick(function(){return setTimeout(function(){return e.recalculate()})}))}},created:function(){this.loadData(this.data||[])},mounted:function(){var t,e=this,i=e,r=e.internalData;e.recalculate(),i.autoResize&&(i=e.$refs.refElem,(t=_ui.globalResize.create(function(){return e.recalculate()})).observe(i),i&&t.observe(i.parentElement),r.resizeObserver=t),_ui.globalEvents.on(e,"resize",e.recalculate)},activated:function(){var t=this;t.recalculate().then(function(){return t.refreshScroll()})},beforeDestroy:function(){var t=this.internalData.resizeObserver;t&&t.disconnect(),_ui.globalEvents.off(this,"resize")},render:function(t){return this.renderVN(t)}});
|