vxe-pc-ui 4.19.7 → 4.20.0
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/dist/all.esm.js +2206 -1851
- package/dist/style.css +1 -1
- package/dist/style.min.css +1 -1
- package/es/card/src/card.js +35 -12
- package/es/card/style.css +42 -44
- package/es/card/style.min.css +1 -1
- package/es/icon/style.css +1 -1
- package/es/list/src/list.js +323 -19
- package/es/list/style.css +26 -0
- package/es/list/style.min.css +1 -1
- package/es/scrollbar/src/scrollbar.js +9 -1
- package/es/scrollbar/style.css +6 -5
- package/es/scrollbar/style.min.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/tabs/src/tabs.js +27 -8
- package/es/tabs/style.css +4 -2
- package/es/tabs/style.min.css +1 -1
- package/es/tree/src/tree.js +6 -2
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/ui/src/utils.js +9 -0
- package/es/vxe-card/style.css +42 -44
- package/es/vxe-card/style.min.css +1 -1
- package/es/vxe-list/style.css +26 -0
- package/es/vxe-list/style.min.css +1 -1
- package/es/vxe-scrollbar/style.css +6 -5
- package/es/vxe-scrollbar/style.min.css +1 -1
- package/es/vxe-tabs/style.css +4 -2
- package/es/vxe-tabs/style.min.css +1 -1
- package/lib/card/src/card.js +42 -6
- package/lib/card/src/card.min.js +1 -1
- package/lib/card/style/style.css +42 -44
- package/lib/card/style/style.min.css +1 -1
- package/lib/icon/style/style.css +1 -1
- package/lib/icon/style/style.min.css +1 -1
- package/lib/index.umd.js +2785 -2383
- package/lib/index.umd.min.js +1 -1
- package/lib/list/src/list.js +333 -20
- package/lib/list/src/list.min.js +1 -1
- package/lib/list/style/style.css +26 -0
- package/lib/list/style/style.min.css +1 -1
- package/lib/scrollbar/src/scrollbar.js +9 -1
- package/lib/scrollbar/src/scrollbar.min.js +1 -1
- package/lib/scrollbar/style/style.css +6 -5
- package/lib/scrollbar/style/style.min.css +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/tabs/src/tabs.js +40 -8
- package/lib/tabs/src/tabs.min.js +1 -1
- package/lib/tabs/style/style.css +4 -2
- package/lib/tabs/style/style.min.css +1 -1
- package/lib/tree/src/tree.js +5 -1
- package/lib/tree/src/tree.min.js +1 -1
- package/lib/ui/index.js +1 -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/ui/src/utils.js +10 -0
- package/lib/ui/src/utils.min.js +1 -1
- package/lib/vxe-card/style/style.css +42 -44
- package/lib/vxe-card/style/style.min.css +1 -1
- package/lib/vxe-list/style/style.css +26 -0
- package/lib/vxe-list/style/style.min.css +1 -1
- package/lib/vxe-scrollbar/style/style.css +6 -5
- package/lib/vxe-scrollbar/style/style.min.css +1 -1
- package/lib/vxe-tabs/style/style.css +4 -2
- package/lib/vxe-tabs/style/style.min.css +1 -1
- package/package.json +1 -1
- package/packages/card/src/card.ts +55 -12
- package/packages/list/src/list.ts +351 -19
- package/packages/scrollbar/src/scrollbar.ts +10 -1
- package/packages/tabs/src/tabs.ts +34 -8
- package/packages/tree/src/tree.ts +6 -2
- package/packages/ui/src/utils.ts +10 -0
- package/styles/components/card.scss +44 -58
- package/styles/components/list.scss +51 -0
- package/styles/components/scrollbar.scss +18 -11
- package/styles/components/tabs.scss +2 -1
- package/types/components/card.d.ts +11 -0
- package/types/components/grid.d.ts +37 -0
- package/types/components/layout-aside.d.ts +7 -1
- package/types/components/layout-body.d.ts +7 -1
- package/types/components/list.d.ts +24 -2
- package/types/components/menu.d.ts +6 -0
- package/types/components/table-plugins/extend-cell-area.d.ts +1 -1
- package/types/components/table.d.ts +25 -2
- package/types/components/tabs.d.ts +11 -0
- /package/es/icon/{iconfont.1791794447472.ttf → iconfont.1791880413927.ttf} +0 -0
- /package/es/icon/{iconfont.1791794447472.woff → iconfont.1791880413927.woff} +0 -0
- /package/es/icon/{iconfont.1791794447472.woff2 → iconfont.1791880413927.woff2} +0 -0
- /package/es/{iconfont.1791794447472.ttf → iconfont.1791880413927.ttf} +0 -0
- /package/es/{iconfont.1791794447472.woff → iconfont.1791880413927.woff} +0 -0
- /package/es/{iconfont.1791794447472.woff2 → iconfont.1791880413927.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1791794447472.ttf → iconfont.1791880413927.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1791794447472.woff → iconfont.1791880413927.woff} +0 -0
- /package/lib/icon/style/{iconfont.1791794447472.woff2 → iconfont.1791880413927.woff2} +0 -0
- /package/lib/{iconfont.1791794447472.ttf → iconfont.1791880413927.ttf} +0 -0
- /package/lib/{iconfont.1791794447472.woff → iconfont.1791880413927.woff} +0 -0
- /package/lib/{iconfont.1791794447472.woff2 → iconfont.1791880413927.woff2} +0 -0
package/dist/all.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as core from '@vxe-ui/core';
|
|
2
|
-
import { VxeUI, setConfig as setConfig$1, setIcon, getConfig as getConfig$4, createEvent as createEvent$1, getIcon as getIcon$2, renderEmptyElement as renderEmptyElement$1, useSize, globalEvents as globalEvents$1, usePermission, permission, renderer, getI18n as getI18n$2, globalResize as globalResize$1, menus as menus$3, GLOBAL_EVENT_KEYS, getSlotVNs as getSlotVNs$1, commands, formats, getComponent, validators } from '@vxe-ui/core';
|
|
2
|
+
import { VxeUI, setConfig as setConfig$1, setIcon, getConfig as getConfig$4, createEvent as createEvent$1, getIcon as getIcon$2, renderEmptyElement as renderEmptyElement$1, useSize, globalEvents as globalEvents$1, usePermission, permission, renderer, getI18n as getI18n$2, domUtils as domUtils$1, globalResize as globalResize$1, menus as menus$3, GLOBAL_EVENT_KEYS, getSlotVNs as getSlotVNs$1, commands, formats, getComponent, validators } from '@vxe-ui/core';
|
|
3
3
|
export * from '@vxe-ui/core';
|
|
4
4
|
import { defineComponent, ref, reactive, h, createCommentVNode, createApp, inject, computed, watch, onMounted, onUnmounted, provide, nextTick, onBeforeUnmount, resolveComponent, Teleport, onActivated, onDeactivated, TransitionGroup } from 'vue';
|
|
5
5
|
import XEUtils from 'xe-utils';
|
|
@@ -101,7 +101,7 @@ function checkDynamic() {
|
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
const { log } = VxeUI;
|
|
104
|
-
const uiVersion = `ui v${"4.
|
|
104
|
+
const uiVersion = `ui v${"4.20.0"}`;
|
|
105
105
|
function createComponentLog(name) {
|
|
106
106
|
const tableVersion = VxeUI.tableVersion ? `table v${VxeUI.tableVersion}` : '';
|
|
107
107
|
const ganttVersion = VxeUI.ganttVersion ? `gantt v${VxeUI.ganttVersion}` : '';
|
|
@@ -115,7 +115,7 @@ function createComponentLog(name) {
|
|
|
115
115
|
const warnLog$j = log.create('warn', uiVersion);
|
|
116
116
|
log.create('error', uiVersion);
|
|
117
117
|
|
|
118
|
-
const version = "4.
|
|
118
|
+
const version = "4.20.0";
|
|
119
119
|
VxeUI.uiVersion = version;
|
|
120
120
|
VxeUI.dynamicApp = dynamicApp;
|
|
121
121
|
function config(options) {
|
|
@@ -6402,235 +6402,225 @@ VxeUI.component(VxeLoadingComponent);
|
|
|
6402
6402
|
VxeUI.loading = LoadingController;
|
|
6403
6403
|
const Loading = VxeLoading;
|
|
6404
6404
|
|
|
6405
|
-
|
|
6406
|
-
|
|
6405
|
+
/**
|
|
6406
|
+
* 计算滚动条滑块的长度
|
|
6407
|
+
*/
|
|
6408
|
+
function getThumbSize(viewportSize, contentSize, trackSize) {
|
|
6409
|
+
if (contentSize <= viewportSize) {
|
|
6410
|
+
return 0;
|
|
6411
|
+
}
|
|
6412
|
+
const ratio = viewportSize / contentSize;
|
|
6413
|
+
const ideal = trackSize * ratio;
|
|
6414
|
+
return Math.max(20, Math.min(ideal, trackSize));
|
|
6415
|
+
}
|
|
6416
|
+
/**
|
|
6417
|
+
* 计算滚动条滑块的偏移位置
|
|
6418
|
+
*/
|
|
6419
|
+
function getThumbOffsetSize(offsetSize, viewportSize, contentSize, trackSize, thumbSize) {
|
|
6420
|
+
const maxScroll = contentSize - viewportSize;
|
|
6421
|
+
if (maxScroll <= 0) {
|
|
6422
|
+
return 0;
|
|
6423
|
+
}
|
|
6424
|
+
const maxThumbOffset = trackSize - thumbSize;
|
|
6425
|
+
if (maxThumbOffset <= 0) {
|
|
6426
|
+
return 0;
|
|
6427
|
+
}
|
|
6428
|
+
const clamped = Math.min(Math.max(offsetSize, 0), maxScroll);
|
|
6429
|
+
const ratio = clamped / maxScroll;
|
|
6430
|
+
return ratio * maxThumbOffset;
|
|
6431
|
+
}
|
|
6432
|
+
/**
|
|
6433
|
+
* 根据点击轨道的位置,计算滑块的偏移位置
|
|
6434
|
+
*/
|
|
6435
|
+
function getScrollFromClick(clickPosition, viewportSize, contentSize, trackSize, thumbSize) {
|
|
6436
|
+
const maxThumbOffset = trackSize - thumbSize;
|
|
6437
|
+
const maxScroll = contentSize - viewportSize;
|
|
6438
|
+
if (maxScroll <= 0 || maxThumbOffset <= 0) {
|
|
6439
|
+
return 0;
|
|
6440
|
+
}
|
|
6441
|
+
let thumbOffset = clickPosition - thumbSize / 2;
|
|
6442
|
+
thumbOffset = Math.min(Math.max(thumbOffset, 0), maxThumbOffset);
|
|
6443
|
+
const scrollOffset = (thumbOffset / maxThumbOffset) * maxScroll;
|
|
6444
|
+
return scrollOffset;
|
|
6445
|
+
}
|
|
6446
|
+
/**
|
|
6447
|
+
* 拖拽 thumb 时,根据鼠标位置计算滑块的偏移位置
|
|
6448
|
+
*/
|
|
6449
|
+
function getScrollFromDrag(pointerPosition, dragOffset, viewportSize, contentSize, trackSize, thumbSize) {
|
|
6450
|
+
const maxScroll = contentSize - viewportSize;
|
|
6451
|
+
const maxThumbOffset = trackSize - thumbSize;
|
|
6452
|
+
if (maxScroll <= 0 || maxThumbOffset <= 0) {
|
|
6453
|
+
return 0;
|
|
6454
|
+
}
|
|
6455
|
+
let thumbOffset = pointerPosition - dragOffset;
|
|
6456
|
+
thumbOffset = Math.min(Math.max(thumbOffset, 0), maxThumbOffset);
|
|
6457
|
+
return (thumbOffset / maxThumbOffset) * maxScroll;
|
|
6458
|
+
}
|
|
6459
|
+
|
|
6460
|
+
const { getConfig: getConfig$2, createEvent, domUtils, globalResize, globalEvents, renderEmptyElement } = VxeUI;
|
|
6461
|
+
function createReactData$n() {
|
|
6462
|
+
return {
|
|
6463
|
+
yThumbHeight: 0,
|
|
6464
|
+
xThumbWidth: 0
|
|
6465
|
+
};
|
|
6466
|
+
}
|
|
6467
|
+
function createInternalData$m() {
|
|
6468
|
+
return {
|
|
6469
|
+
// resizeObserver: undefined,
|
|
6470
|
+
// isThumbDrag: false,
|
|
6471
|
+
thumbDragOffset: 0,
|
|
6472
|
+
yThumbTop: 0,
|
|
6473
|
+
xThumbLeft: 0,
|
|
6474
|
+
lastScrollTop: 0,
|
|
6475
|
+
lastScrollLeft: 0
|
|
6476
|
+
};
|
|
6477
|
+
}
|
|
6478
|
+
var VxeScrollbarComponent = defineVxeComponent({
|
|
6479
|
+
name: 'VxeScrollbar',
|
|
6407
6480
|
props: {
|
|
6408
|
-
|
|
6409
|
-
showTitleOverflow: {
|
|
6410
|
-
type: Boolean,
|
|
6411
|
-
default: () => getConfig$4().card.showTitleOverflow
|
|
6412
|
-
},
|
|
6481
|
+
id: [String, Number],
|
|
6413
6482
|
width: [String, Number],
|
|
6414
6483
|
height: [String, Number],
|
|
6415
|
-
|
|
6416
|
-
|
|
6417
|
-
|
|
6418
|
-
|
|
6484
|
+
minWidth: [String, Number],
|
|
6485
|
+
minHeight: [String, Number],
|
|
6486
|
+
maxWidth: [String, Number],
|
|
6487
|
+
maxHeight: [String, Number],
|
|
6419
6488
|
loading: Boolean,
|
|
6420
|
-
|
|
6489
|
+
native: {
|
|
6421
6490
|
type: Boolean,
|
|
6422
|
-
default: () => getConfig$
|
|
6491
|
+
default: () => getConfig$2().scrollbar.native
|
|
6423
6492
|
},
|
|
6424
6493
|
padding: {
|
|
6425
6494
|
type: Boolean,
|
|
6426
|
-
default: () => getConfig$
|
|
6495
|
+
default: () => getConfig$2().scrollbar.padding
|
|
6427
6496
|
},
|
|
6428
|
-
|
|
6497
|
+
xConfig: Object,
|
|
6498
|
+
yConfig: Object,
|
|
6499
|
+
className: {
|
|
6429
6500
|
type: String,
|
|
6430
|
-
default: () => getConfig$
|
|
6431
|
-
}
|
|
6432
|
-
},
|
|
6433
|
-
emits: [],
|
|
6434
|
-
setup(props, context) {
|
|
6435
|
-
const { slots, emit } = context;
|
|
6436
|
-
const xID = XEUtils.uniqueId();
|
|
6437
|
-
const refElem = ref();
|
|
6438
|
-
const { computeSize } = useSize(props);
|
|
6439
|
-
const reactData = reactive({});
|
|
6440
|
-
const refMaps = {
|
|
6441
|
-
refElem
|
|
6442
|
-
};
|
|
6443
|
-
const computeCardStyle = computed(() => {
|
|
6444
|
-
const { height, width } = props;
|
|
6445
|
-
const stys = {};
|
|
6446
|
-
if (width) {
|
|
6447
|
-
stys.width = toCssUnit(width);
|
|
6448
|
-
}
|
|
6449
|
-
if (height) {
|
|
6450
|
-
stys.height = toCssUnit(height);
|
|
6451
|
-
}
|
|
6452
|
-
return stys;
|
|
6453
|
-
});
|
|
6454
|
-
const computeMaps = {
|
|
6455
|
-
computeSize
|
|
6456
|
-
};
|
|
6457
|
-
const $xeCard = {
|
|
6458
|
-
xID,
|
|
6459
|
-
props,
|
|
6460
|
-
context,
|
|
6461
|
-
reactData,
|
|
6462
|
-
getRefMaps: () => refMaps,
|
|
6463
|
-
getComputeMaps: () => computeMaps
|
|
6464
|
-
};
|
|
6465
|
-
const dispatchEvent = (type, params, evnt) => {
|
|
6466
|
-
emit(type, createEvent$1(evnt, { $card: $xeCard }, params));
|
|
6467
|
-
};
|
|
6468
|
-
const cardMethods = {
|
|
6469
|
-
dispatchEvent
|
|
6470
|
-
};
|
|
6471
|
-
const cardPrivateMethods = {};
|
|
6472
|
-
Object.assign($xeCard, cardMethods, cardPrivateMethods);
|
|
6473
|
-
const renderVN = () => {
|
|
6474
|
-
const { title, border, shadow, padding, loading, showTitleOverflow } = props;
|
|
6475
|
-
const defaultSlot = slots.default;
|
|
6476
|
-
const headerSlot = slots.header;
|
|
6477
|
-
const titleSlot = slots.title;
|
|
6478
|
-
const extraSlot = slots.extra;
|
|
6479
|
-
const footerSlot = slots.footer;
|
|
6480
|
-
const leftSlot = slots.left;
|
|
6481
|
-
const rightSlot = slots.right;
|
|
6482
|
-
const vSize = computeSize.value;
|
|
6483
|
-
const cardStyle = computeCardStyle.value;
|
|
6484
|
-
return h('div', {
|
|
6485
|
-
ref: refElem,
|
|
6486
|
-
class: ['vxe-card', {
|
|
6487
|
-
[`size--${vSize}`]: vSize,
|
|
6488
|
-
'is--border': border,
|
|
6489
|
-
'is--shadow': shadow,
|
|
6490
|
-
'is--padding': padding
|
|
6491
|
-
}],
|
|
6492
|
-
style: cardStyle
|
|
6493
|
-
}, [
|
|
6494
|
-
title || titleSlot || headerSlot
|
|
6495
|
-
? h('div', {
|
|
6496
|
-
class: 'vxe-card--header'
|
|
6497
|
-
}, headerSlot
|
|
6498
|
-
? getSlotVNs(headerSlot({}))
|
|
6499
|
-
: [
|
|
6500
|
-
h('div', {
|
|
6501
|
-
class: ['vxe-card--header-title', {
|
|
6502
|
-
'is--ellipsis': showTitleOverflow
|
|
6503
|
-
}]
|
|
6504
|
-
}, titleSlot ? getSlotVNs(titleSlot({})) : `${title || ''}`),
|
|
6505
|
-
extraSlot
|
|
6506
|
-
? h('div', {
|
|
6507
|
-
class: 'vxe-card--header-extra'
|
|
6508
|
-
}, getSlotVNs(extraSlot({})))
|
|
6509
|
-
: renderEmptyElement$1($xeCard)
|
|
6510
|
-
])
|
|
6511
|
-
: renderEmptyElement$1($xeCard),
|
|
6512
|
-
h('div', {
|
|
6513
|
-
class: 'vxe-card--body'
|
|
6514
|
-
}, [
|
|
6515
|
-
leftSlot
|
|
6516
|
-
? h('div', {
|
|
6517
|
-
class: 'vxe-card--body-left'
|
|
6518
|
-
}, getSlotVNs(leftSlot({})))
|
|
6519
|
-
: renderEmptyElement$1($xeCard),
|
|
6520
|
-
h('div', {
|
|
6521
|
-
class: 'vxe-card--body-content'
|
|
6522
|
-
}, defaultSlot ? getSlotVNs(defaultSlot({})) : []),
|
|
6523
|
-
rightSlot
|
|
6524
|
-
? h('div', {
|
|
6525
|
-
class: 'vxe-card--body-right'
|
|
6526
|
-
}, getSlotVNs(rightSlot({})))
|
|
6527
|
-
: renderEmptyElement$1($xeCard)
|
|
6528
|
-
]),
|
|
6529
|
-
footerSlot
|
|
6530
|
-
? h('div', {
|
|
6531
|
-
class: 'vxe-card--footer'
|
|
6532
|
-
}, getSlotVNs(footerSlot({})))
|
|
6533
|
-
: renderEmptyElement$1($xeCard),
|
|
6534
|
-
/**
|
|
6535
|
-
* 加载中
|
|
6536
|
-
*/
|
|
6537
|
-
h(VxeLoading, {
|
|
6538
|
-
class: 'vxe-card--loading',
|
|
6539
|
-
modelValue: loading
|
|
6540
|
-
})
|
|
6541
|
-
]);
|
|
6542
|
-
};
|
|
6543
|
-
$xeCard.renderVN = renderVN;
|
|
6544
|
-
return $xeCard;
|
|
6545
|
-
},
|
|
6546
|
-
render() {
|
|
6547
|
-
return this.renderVN();
|
|
6548
|
-
}
|
|
6549
|
-
});
|
|
6550
|
-
|
|
6551
|
-
const VxeCard = Object.assign({}, VxeCardComponent, {
|
|
6552
|
-
install(app) {
|
|
6553
|
-
app.component(VxeCardComponent.name, VxeCardComponent);
|
|
6554
|
-
}
|
|
6555
|
-
});
|
|
6556
|
-
dynamicApp.use(VxeCard);
|
|
6557
|
-
VxeUI.component(VxeCardComponent);
|
|
6558
|
-
const Card = VxeCard;
|
|
6559
|
-
|
|
6560
|
-
var VxeCarouselComponent = defineVxeComponent({
|
|
6561
|
-
name: 'VxeCarousel',
|
|
6562
|
-
props: {
|
|
6563
|
-
modelValue: [String, Number],
|
|
6564
|
-
options: Array,
|
|
6565
|
-
loading: Boolean,
|
|
6566
|
-
height: {
|
|
6567
|
-
type: [Number, String],
|
|
6568
|
-
default: () => getConfig$4().carousel.height
|
|
6569
|
-
},
|
|
6570
|
-
width: {
|
|
6571
|
-
type: [Number, String],
|
|
6572
|
-
default: () => getConfig$4().carousel.width
|
|
6501
|
+
default: () => getConfig$2().scrollbar.className
|
|
6573
6502
|
},
|
|
6574
|
-
|
|
6575
|
-
type:
|
|
6576
|
-
default: () => getConfig$
|
|
6503
|
+
viewAttrs: {
|
|
6504
|
+
type: Object,
|
|
6505
|
+
default: () => getConfig$2().scrollbar.viewAttrs
|
|
6577
6506
|
},
|
|
6578
|
-
|
|
6579
|
-
type:
|
|
6580
|
-
default: () => getConfig$
|
|
6507
|
+
viewClassName: {
|
|
6508
|
+
type: String,
|
|
6509
|
+
default: () => getConfig$2().scrollbar.viewClassName
|
|
6581
6510
|
},
|
|
6582
|
-
|
|
6583
|
-
type:
|
|
6584
|
-
default: () => getConfig$
|
|
6511
|
+
viewInnerClassName: {
|
|
6512
|
+
type: String,
|
|
6513
|
+
default: () => getConfig$2().scrollbar.viewInnerClassName
|
|
6585
6514
|
},
|
|
6586
|
-
|
|
6515
|
+
autoResize: {
|
|
6587
6516
|
type: Boolean,
|
|
6588
|
-
default: () => getConfig$
|
|
6517
|
+
default: () => getConfig$2().scrollbar.autoResize
|
|
6589
6518
|
},
|
|
6590
|
-
|
|
6591
|
-
type: Boolean,
|
|
6592
|
-
default: () => getConfig$4().carousel.showIndicators
|
|
6593
|
-
}
|
|
6519
|
+
syncResize: [Boolean, String, Number]
|
|
6594
6520
|
},
|
|
6595
6521
|
emits: [
|
|
6596
|
-
'
|
|
6597
|
-
'
|
|
6522
|
+
'scroll',
|
|
6523
|
+
'scroll-boundary'
|
|
6598
6524
|
],
|
|
6599
6525
|
setup(props, context) {
|
|
6600
6526
|
const { emit, slots } = context;
|
|
6601
6527
|
const xID = XEUtils.uniqueId();
|
|
6602
6528
|
const refElem = ref();
|
|
6603
|
-
const
|
|
6604
|
-
const
|
|
6605
|
-
|
|
6606
|
-
|
|
6607
|
-
|
|
6608
|
-
|
|
6609
|
-
|
|
6610
|
-
const internalData =
|
|
6611
|
-
|
|
6612
|
-
|
|
6613
|
-
|
|
6614
|
-
|
|
6615
|
-
refElem
|
|
6616
|
-
};
|
|
6617
|
-
const computeListStyle = computed(() => {
|
|
6618
|
-
const { vertical, options } = props;
|
|
6619
|
-
const { activeName, itemWidth, itemHeight, staticItems } = reactData;
|
|
6620
|
-
const list = (staticItems && staticItems.length ? staticItems : options) || [];
|
|
6621
|
-
const activeIndex = Math.max(0, XEUtils.findIndexOf(list, item => item.name === activeName));
|
|
6529
|
+
const refViewElem = ref();
|
|
6530
|
+
const refViewInnerElem = ref();
|
|
6531
|
+
const refTrackXElem = ref();
|
|
6532
|
+
const refTrackYElem = ref();
|
|
6533
|
+
const refThumbXElem = ref();
|
|
6534
|
+
const refThumbYElem = ref();
|
|
6535
|
+
const reactData = reactive(createReactData$n());
|
|
6536
|
+
const internalData = createInternalData$m();
|
|
6537
|
+
const computeWrapperStyle = computed(() => {
|
|
6538
|
+
const { width, height, minWidth, minHeight, maxWidth, maxHeight } = props;
|
|
6539
|
+
const xOpts = computeXOpts.value;
|
|
6540
|
+
const yOpts = computeYOpts.value;
|
|
6622
6541
|
const stys = {};
|
|
6623
|
-
if (
|
|
6624
|
-
stys.
|
|
6542
|
+
if (width) {
|
|
6543
|
+
stys.width = toCssUnit(width);
|
|
6625
6544
|
}
|
|
6626
|
-
|
|
6627
|
-
stys.
|
|
6628
|
-
|
|
6545
|
+
if (height) {
|
|
6546
|
+
stys.height = toCssUnit(height);
|
|
6547
|
+
}
|
|
6548
|
+
if (minWidth) {
|
|
6549
|
+
stys.minWidth = toCssUnit(minWidth);
|
|
6550
|
+
}
|
|
6551
|
+
if (minHeight) {
|
|
6552
|
+
stys.minHeight = toCssUnit(minHeight);
|
|
6553
|
+
}
|
|
6554
|
+
if (maxWidth) {
|
|
6555
|
+
stys.maxWidth = toCssUnit(maxWidth);
|
|
6556
|
+
}
|
|
6557
|
+
if (maxHeight) {
|
|
6558
|
+
stys.maxHeight = toCssUnit(maxHeight);
|
|
6559
|
+
}
|
|
6560
|
+
if (yOpts.width) {
|
|
6561
|
+
stys['--vxe-ui-scrollbar-y-width'] = toCssUnit(yOpts.width);
|
|
6562
|
+
}
|
|
6563
|
+
if (xOpts.height) {
|
|
6564
|
+
stys['--vxe-ui-scrollbar-x-height'] = toCssUnit(xOpts.height);
|
|
6629
6565
|
}
|
|
6630
6566
|
return stys;
|
|
6631
6567
|
});
|
|
6568
|
+
const computeWrapperClss = computed(() => {
|
|
6569
|
+
const { native, className, padding } = props;
|
|
6570
|
+
const { yThumbHeight, xThumbWidth } = reactData;
|
|
6571
|
+
const xOpts = computeXOpts.value;
|
|
6572
|
+
const yOpts = computeYOpts.value;
|
|
6573
|
+
const xToTop = computeXToTop.value;
|
|
6574
|
+
const yToLeft = computeYToLeft.value;
|
|
6575
|
+
return domUtils.buildClass([
|
|
6576
|
+
'vxe-scrollbar',
|
|
6577
|
+
`ov-x--${xOpts.visible || 'visible'}`,
|
|
6578
|
+
`ov-y--${yOpts.visible || 'visible'}`,
|
|
6579
|
+
`sx-pos--${xToTop ? 'top' : 'bottom'}`,
|
|
6580
|
+
`sy-pos--${yToLeft ? 'left' : 'right'}`,
|
|
6581
|
+
native ? 'is--native' : 'is--virtual',
|
|
6582
|
+
className
|
|
6583
|
+
], {
|
|
6584
|
+
'is--padding': padding,
|
|
6585
|
+
'ov-x--auto-hide': xOpts.autoHide,
|
|
6586
|
+
'ov-y--auto-hide': yOpts.autoHide,
|
|
6587
|
+
'overflow-y': yThumbHeight,
|
|
6588
|
+
'overflow-x': xThumbWidth
|
|
6589
|
+
});
|
|
6590
|
+
});
|
|
6591
|
+
const computeViewClss = computed(() => {
|
|
6592
|
+
const { viewClassName } = props;
|
|
6593
|
+
return domUtils.buildClass([
|
|
6594
|
+
'vxe-scrollbar--view',
|
|
6595
|
+
viewClassName
|
|
6596
|
+
]);
|
|
6597
|
+
});
|
|
6598
|
+
const computeViewInnerClss = computed(() => {
|
|
6599
|
+
const { viewInnerClassName } = props;
|
|
6600
|
+
return domUtils.buildClass([
|
|
6601
|
+
'vxe-scrollbar--view-inner',
|
|
6602
|
+
viewInnerClassName
|
|
6603
|
+
]);
|
|
6604
|
+
});
|
|
6605
|
+
const computeXOpts = computed(() => {
|
|
6606
|
+
return Object.assign({}, getConfig$2().scrollbar.xConfig, props.xConfig);
|
|
6607
|
+
});
|
|
6608
|
+
const computeYOpts = computed(() => {
|
|
6609
|
+
return Object.assign({}, getConfig$2().scrollbar.yConfig, props.yConfig);
|
|
6610
|
+
});
|
|
6611
|
+
const computeXToTop = computed(() => {
|
|
6612
|
+
const xOpts = computeXOpts.value;
|
|
6613
|
+
return xOpts.position === 'top';
|
|
6614
|
+
});
|
|
6615
|
+
const computeYToLeft = computed(() => {
|
|
6616
|
+
const yOpts = computeYOpts.value;
|
|
6617
|
+
return yOpts.position === 'left';
|
|
6618
|
+
});
|
|
6619
|
+
const refMaps = {
|
|
6620
|
+
refElem
|
|
6621
|
+
};
|
|
6632
6622
|
const computeMaps = {};
|
|
6633
|
-
const $
|
|
6623
|
+
const $xeScrollbar = {
|
|
6634
6624
|
xID,
|
|
6635
6625
|
props,
|
|
6636
6626
|
context,
|
|
@@ -6639,675 +6629,1433 @@ var VxeCarouselComponent = defineVxeComponent({
|
|
|
6639
6629
|
getRefMaps: () => refMaps,
|
|
6640
6630
|
getComputeMaps: () => computeMaps
|
|
6641
6631
|
};
|
|
6642
|
-
const updateStyle = () => {
|
|
6643
|
-
nextTick(() => {
|
|
6644
|
-
const wrapperElem = refWrapperElem.value;
|
|
6645
|
-
if (wrapperElem) {
|
|
6646
|
-
reactData.itemWidth = wrapperElem.clientWidth;
|
|
6647
|
-
reactData.itemHeight = wrapperElem.clientHeight;
|
|
6648
|
-
}
|
|
6649
|
-
});
|
|
6650
|
-
};
|
|
6651
|
-
const clickItemEvent = (evnt, item) => {
|
|
6652
|
-
const value = item.name;
|
|
6653
|
-
reactData.activeName = item.name;
|
|
6654
|
-
emit('update:modelValue', value);
|
|
6655
|
-
emit('change', { value }, evnt);
|
|
6656
|
-
updateStyle();
|
|
6657
|
-
};
|
|
6658
|
-
const initDefaultActive = (list) => {
|
|
6659
|
-
let activeName = null;
|
|
6660
|
-
if (list && list.length) {
|
|
6661
|
-
let validVal = false;
|
|
6662
|
-
activeName = props.modelValue;
|
|
6663
|
-
list.forEach((item) => {
|
|
6664
|
-
if (activeName === item.name) {
|
|
6665
|
-
validVal = true;
|
|
6666
|
-
}
|
|
6667
|
-
});
|
|
6668
|
-
if (!validVal) {
|
|
6669
|
-
activeName = list[0].name;
|
|
6670
|
-
emit('update:modelValue', activeName);
|
|
6671
|
-
}
|
|
6672
|
-
}
|
|
6673
|
-
reactData.activeName = activeName;
|
|
6674
|
-
};
|
|
6675
6632
|
const dispatchEvent = (type, params, evnt) => {
|
|
6676
|
-
emit(type, createEvent
|
|
6633
|
+
emit(type, createEvent(evnt, { $scrollbar: $xeScrollbar }, params));
|
|
6677
6634
|
};
|
|
6678
|
-
const
|
|
6679
|
-
|
|
6680
|
-
|
|
6681
|
-
|
|
6682
|
-
|
|
6683
|
-
|
|
6684
|
-
|
|
6685
|
-
if (isNext) {
|
|
6686
|
-
if (index < list.length - 1) {
|
|
6687
|
-
item = list[index + 1];
|
|
6635
|
+
const scrollbarMethods = {
|
|
6636
|
+
dispatchEvent,
|
|
6637
|
+
scrollTo(left, top) {
|
|
6638
|
+
const viewEl = refViewElem.value;
|
|
6639
|
+
if (viewEl) {
|
|
6640
|
+
if (XEUtils.isNumber(left)) {
|
|
6641
|
+
viewEl.scrollTo(left, top || 0);
|
|
6688
6642
|
}
|
|
6689
6643
|
else {
|
|
6690
|
-
|
|
6691
|
-
item = list[0];
|
|
6692
|
-
}
|
|
6644
|
+
viewEl.scrollTo(left);
|
|
6693
6645
|
}
|
|
6694
6646
|
}
|
|
6695
|
-
|
|
6696
|
-
|
|
6697
|
-
|
|
6698
|
-
|
|
6699
|
-
|
|
6700
|
-
if (loop) {
|
|
6701
|
-
item = list[list.length - 1];
|
|
6702
|
-
}
|
|
6703
|
-
}
|
|
6647
|
+
},
|
|
6648
|
+
scrollIntoView() {
|
|
6649
|
+
const viewEl = refViewElem.value;
|
|
6650
|
+
if (viewEl) {
|
|
6651
|
+
viewEl.scrollIntoView();
|
|
6704
6652
|
}
|
|
6705
|
-
|
|
6706
|
-
|
|
6707
|
-
|
|
6708
|
-
|
|
6709
|
-
|
|
6710
|
-
return true;
|
|
6653
|
+
},
|
|
6654
|
+
setScrollTop(top) {
|
|
6655
|
+
const viewEl = refViewElem.value;
|
|
6656
|
+
if (viewEl) {
|
|
6657
|
+
viewEl.scrollTop = top;
|
|
6711
6658
|
}
|
|
6712
|
-
}
|
|
6713
|
-
|
|
6714
|
-
|
|
6715
|
-
|
|
6716
|
-
|
|
6717
|
-
prev() {
|
|
6718
|
-
if (handlePrevNext(false)) {
|
|
6719
|
-
handleAutoPlay();
|
|
6659
|
+
},
|
|
6660
|
+
setScrollLeft(left) {
|
|
6661
|
+
const viewEl = refViewElem.value;
|
|
6662
|
+
if (viewEl) {
|
|
6663
|
+
viewEl.scrollLeft = left;
|
|
6720
6664
|
}
|
|
6721
|
-
return nextTick();
|
|
6722
6665
|
},
|
|
6723
|
-
|
|
6724
|
-
|
|
6725
|
-
|
|
6666
|
+
getScrollTop() {
|
|
6667
|
+
const viewEl = refViewElem.value;
|
|
6668
|
+
if (viewEl) {
|
|
6669
|
+
return viewEl.scrollTop;
|
|
6670
|
+
}
|
|
6671
|
+
return 0;
|
|
6672
|
+
},
|
|
6673
|
+
getScrollLeft() {
|
|
6674
|
+
const viewEl = refViewElem.value;
|
|
6675
|
+
if (viewEl) {
|
|
6676
|
+
return viewEl.scrollLeft;
|
|
6677
|
+
}
|
|
6678
|
+
return 0;
|
|
6679
|
+
},
|
|
6680
|
+
clearScroll() {
|
|
6681
|
+
const viewEl = refViewElem.value;
|
|
6682
|
+
if (viewEl) {
|
|
6683
|
+
viewEl.scrollTop = 0;
|
|
6684
|
+
viewEl.scrollLeft = 0;
|
|
6726
6685
|
}
|
|
6686
|
+
},
|
|
6687
|
+
recalculate() {
|
|
6688
|
+
updateThumbSize();
|
|
6689
|
+
updateThumbOffset();
|
|
6727
6690
|
return nextTick();
|
|
6728
6691
|
}
|
|
6729
6692
|
};
|
|
6730
|
-
const
|
|
6731
|
-
|
|
6732
|
-
|
|
6733
|
-
|
|
6693
|
+
const updateThumbSize = () => {
|
|
6694
|
+
const viewEl = refViewElem.value;
|
|
6695
|
+
if (!viewEl) {
|
|
6696
|
+
return;
|
|
6734
6697
|
}
|
|
6735
|
-
|
|
6736
|
-
|
|
6737
|
-
|
|
6738
|
-
|
|
6739
|
-
|
|
6698
|
+
if (!viewEl.clientHeight || !viewEl.clientHeight) {
|
|
6699
|
+
return;
|
|
6700
|
+
}
|
|
6701
|
+
const trackXEl = refTrackXElem.value;
|
|
6702
|
+
const xThumbWidth = trackXEl ? getThumbSize(viewEl.clientWidth, viewEl.scrollWidth, trackXEl.clientWidth) : 0;
|
|
6703
|
+
const thumbXElem = refThumbXElem.value;
|
|
6704
|
+
if (thumbXElem) {
|
|
6705
|
+
thumbXElem.style.width = xThumbWidth + 'px';
|
|
6706
|
+
}
|
|
6707
|
+
reactData.xThumbWidth = xThumbWidth;
|
|
6708
|
+
const trackYEl = refTrackYElem.value;
|
|
6709
|
+
const yThumbHeight = trackYEl ? getThumbSize(viewEl.clientHeight, viewEl.scrollHeight, trackYEl.clientHeight) : 0;
|
|
6710
|
+
const thumbYElem = refThumbYElem.value;
|
|
6711
|
+
if (thumbYElem) {
|
|
6712
|
+
thumbYElem.style.height = yThumbHeight + 'px';
|
|
6740
6713
|
}
|
|
6714
|
+
reactData.yThumbHeight = yThumbHeight;
|
|
6741
6715
|
};
|
|
6742
|
-
const
|
|
6743
|
-
const
|
|
6744
|
-
|
|
6745
|
-
|
|
6746
|
-
|
|
6747
|
-
|
|
6716
|
+
const updateThumbOffset = () => {
|
|
6717
|
+
const viewEl = refViewElem.value;
|
|
6718
|
+
if (!viewEl) {
|
|
6719
|
+
return;
|
|
6720
|
+
}
|
|
6721
|
+
if (!viewEl.clientHeight || !viewEl.clientHeight) {
|
|
6722
|
+
return;
|
|
6723
|
+
}
|
|
6724
|
+
const { xThumbWidth, yThumbHeight } = reactData;
|
|
6725
|
+
const trackXEl = refTrackXElem.value;
|
|
6726
|
+
const thumbXElem = refThumbXElem.value;
|
|
6727
|
+
const xThumbLeft = trackXEl && xThumbWidth ? getThumbOffsetSize(viewEl.scrollLeft, viewEl.clientWidth, viewEl.scrollWidth, trackXEl.clientWidth, xThumbWidth) : 0;
|
|
6728
|
+
internalData.xThumbLeft = xThumbLeft;
|
|
6729
|
+
if (thumbXElem && xThumbWidth) {
|
|
6730
|
+
thumbXElem.style.width = xThumbWidth + 'px';
|
|
6731
|
+
thumbXElem.style.transform = `translateX(${xThumbLeft}px)`;
|
|
6732
|
+
}
|
|
6733
|
+
const trackYEl = refTrackYElem.value;
|
|
6734
|
+
const thumbYElem = refThumbYElem.value;
|
|
6735
|
+
const yThumbTop = trackYEl && yThumbHeight ? getThumbOffsetSize(viewEl.scrollTop, viewEl.clientHeight, viewEl.scrollHeight, trackYEl.clientHeight, yThumbHeight) : 0;
|
|
6736
|
+
internalData.yThumbTop = yThumbTop;
|
|
6737
|
+
if (thumbYElem && yThumbHeight) {
|
|
6738
|
+
thumbYElem.style.height = yThumbHeight + 'px';
|
|
6739
|
+
thumbYElem.style.transform = `translateY(${yThumbTop}px)`;
|
|
6748
6740
|
}
|
|
6749
6741
|
};
|
|
6750
|
-
const
|
|
6751
|
-
const {
|
|
6752
|
-
const {
|
|
6753
|
-
|
|
6754
|
-
|
|
6755
|
-
|
|
6756
|
-
|
|
6757
|
-
|
|
6758
|
-
|
|
6742
|
+
const scrollEvent = (evnt) => {
|
|
6743
|
+
const { xThumbWidth, yThumbHeight } = reactData;
|
|
6744
|
+
const { lastScrollTop, lastScrollLeft } = internalData;
|
|
6745
|
+
const xOpts = computeXOpts.value;
|
|
6746
|
+
const yOpts = computeYOpts.value;
|
|
6747
|
+
const viewEl = evnt.currentTarget;
|
|
6748
|
+
const { scrollTop, scrollLeft, clientWidth, clientHeight, scrollHeight, scrollWidth } = viewEl;
|
|
6749
|
+
let direction = '';
|
|
6750
|
+
let isTopBoundary = false;
|
|
6751
|
+
let isBottomBoundary = false;
|
|
6752
|
+
let isLeftBoundary = false;
|
|
6753
|
+
let isRightBoundary = false;
|
|
6754
|
+
if (lastScrollTop !== scrollTop) {
|
|
6755
|
+
const yThreshold = XEUtils.toNumber(yOpts.threshold) || 1;
|
|
6756
|
+
if (lastScrollTop < scrollTop) {
|
|
6757
|
+
direction = 'bottom';
|
|
6758
|
+
if (yThumbHeight > 0 && scrollTop + clientHeight >= scrollHeight - yThreshold) {
|
|
6759
|
+
isBottomBoundary = true;
|
|
6759
6760
|
}
|
|
6760
|
-
}
|
|
6761
|
+
}
|
|
6762
|
+
else {
|
|
6763
|
+
direction = 'top';
|
|
6764
|
+
if (yThumbHeight > 0 && scrollTop <= yThreshold) {
|
|
6765
|
+
isTopBoundary = true;
|
|
6766
|
+
}
|
|
6767
|
+
}
|
|
6768
|
+
}
|
|
6769
|
+
if (lastScrollLeft !== scrollLeft) {
|
|
6770
|
+
const xThreshold = XEUtils.toNumber(xOpts.threshold) || 1;
|
|
6771
|
+
if (lastScrollLeft < scrollLeft) {
|
|
6772
|
+
direction = 'right';
|
|
6773
|
+
if (xThumbWidth > 0 && scrollLeft + clientWidth >= scrollWidth - xThreshold) {
|
|
6774
|
+
isRightBoundary = true;
|
|
6775
|
+
}
|
|
6776
|
+
}
|
|
6777
|
+
else {
|
|
6778
|
+
direction = 'left';
|
|
6779
|
+
if (xThumbWidth > 0 && scrollLeft <= xThreshold) {
|
|
6780
|
+
isLeftBoundary = true;
|
|
6781
|
+
}
|
|
6782
|
+
}
|
|
6783
|
+
}
|
|
6784
|
+
updateThumbOffset();
|
|
6785
|
+
internalData.lastScrollTop = scrollTop;
|
|
6786
|
+
internalData.lastScrollLeft = scrollLeft;
|
|
6787
|
+
if (isBottomBoundary || isTopBoundary || isRightBoundary || isLeftBoundary) {
|
|
6788
|
+
dispatchEvent('scroll-boundary', {
|
|
6789
|
+
direction: direction,
|
|
6790
|
+
isTop: isTopBoundary,
|
|
6791
|
+
isBottom: isBottomBoundary,
|
|
6792
|
+
isLeft: isLeftBoundary,
|
|
6793
|
+
isRight: isRightBoundary,
|
|
6794
|
+
scrollTop: scrollTop,
|
|
6795
|
+
scrollLeft: scrollLeft,
|
|
6796
|
+
clientWidth: clientWidth,
|
|
6797
|
+
clientHeight: clientHeight,
|
|
6798
|
+
scrollHeight: scrollHeight,
|
|
6799
|
+
scrollWidth: scrollWidth
|
|
6800
|
+
}, evnt);
|
|
6801
|
+
}
|
|
6802
|
+
dispatchEvent('scroll', {
|
|
6803
|
+
direction: direction,
|
|
6804
|
+
isTop: yThumbHeight > 0 && scrollTop <= 0,
|
|
6805
|
+
isBottom: yThumbHeight > 0 && scrollTop + clientHeight >= scrollHeight,
|
|
6806
|
+
isLeft: xThumbWidth > 0 && scrollLeft <= 0,
|
|
6807
|
+
isRight: xThumbWidth > 0 && scrollLeft + clientWidth >= scrollWidth,
|
|
6808
|
+
scrollTop: scrollTop,
|
|
6809
|
+
scrollLeft: scrollLeft,
|
|
6810
|
+
clientWidth: clientWidth,
|
|
6811
|
+
clientHeight: clientHeight,
|
|
6812
|
+
scrollHeight: scrollHeight,
|
|
6813
|
+
scrollWidth: scrollWidth
|
|
6814
|
+
}, evnt);
|
|
6815
|
+
};
|
|
6816
|
+
const clickTrackXEvent = (evnt) => {
|
|
6817
|
+
const trackEl = evnt.currentTarget;
|
|
6818
|
+
if (trackEl !== evnt.target) {
|
|
6819
|
+
return;
|
|
6761
6820
|
}
|
|
6821
|
+
const viewEl = refViewElem.value;
|
|
6822
|
+
if (!viewEl) {
|
|
6823
|
+
return;
|
|
6824
|
+
}
|
|
6825
|
+
const { xThumbWidth } = reactData;
|
|
6826
|
+
const trackRect = trackEl.getBoundingClientRect();
|
|
6827
|
+
viewEl.scrollTo({
|
|
6828
|
+
left: getScrollFromClick(evnt.clientX - trackRect.left, viewEl.clientWidth, viewEl.scrollWidth, trackEl.clientWidth, xThumbWidth),
|
|
6829
|
+
behavior: 'auto'
|
|
6830
|
+
});
|
|
6762
6831
|
};
|
|
6763
|
-
const
|
|
6764
|
-
|
|
6832
|
+
const clickTrackYEvent = (evnt) => {
|
|
6833
|
+
const trackEl = evnt.currentTarget;
|
|
6834
|
+
if (trackEl !== evnt.target) {
|
|
6835
|
+
return;
|
|
6836
|
+
}
|
|
6837
|
+
const viewEl = refViewElem.value;
|
|
6838
|
+
if (!viewEl) {
|
|
6839
|
+
return;
|
|
6840
|
+
}
|
|
6841
|
+
const { yThumbHeight } = reactData;
|
|
6842
|
+
const trackRect = trackEl.getBoundingClientRect();
|
|
6843
|
+
viewEl.scrollTo({
|
|
6844
|
+
top: getScrollFromClick(evnt.clientY - trackRect.top, viewEl.clientHeight, viewEl.scrollHeight, trackEl.clientHeight, yThumbHeight),
|
|
6845
|
+
behavior: 'auto'
|
|
6846
|
+
});
|
|
6765
6847
|
};
|
|
6766
|
-
const
|
|
6767
|
-
|
|
6848
|
+
const pointerdownThumbXEvent = (evnt) => {
|
|
6849
|
+
const thumbEl = evnt.currentTarget;
|
|
6850
|
+
internalData.isThumbDrag = true;
|
|
6851
|
+
thumbEl.setPointerCapture(evnt.pointerId);
|
|
6852
|
+
const viewEl = refViewElem.value;
|
|
6853
|
+
if (!viewEl) {
|
|
6854
|
+
return;
|
|
6855
|
+
}
|
|
6856
|
+
const { xThumbWidth } = reactData;
|
|
6857
|
+
const trackEl = thumbEl.parentElement;
|
|
6858
|
+
const trackRect = trackEl.getBoundingClientRect();
|
|
6859
|
+
const pointerPosition = evnt.clientX - trackRect.left;
|
|
6860
|
+
// 记录 thumb 的偏移
|
|
6861
|
+
const thumbOffset = getThumbOffsetSize(viewEl.scrollLeft, viewEl.clientWidth, viewEl.scrollWidth, trackEl.clientWidth, xThumbWidth);
|
|
6862
|
+
internalData.thumbDragOffset = pointerPosition - thumbOffset;
|
|
6768
6863
|
};
|
|
6769
|
-
const
|
|
6770
|
-
|
|
6771
|
-
if (
|
|
6772
|
-
|
|
6773
|
-
|
|
6774
|
-
|
|
6775
|
-
|
|
6776
|
-
|
|
6864
|
+
const pointermoveThumbXEvent = (evnt) => {
|
|
6865
|
+
const thumbEl = evnt.currentTarget;
|
|
6866
|
+
if (!thumbEl.hasPointerCapture(evnt.pointerId)) {
|
|
6867
|
+
return;
|
|
6868
|
+
}
|
|
6869
|
+
const { isThumbDrag, thumbDragOffset } = internalData;
|
|
6870
|
+
if (isThumbDrag) {
|
|
6871
|
+
const viewEl = refViewElem.value;
|
|
6872
|
+
if (!viewEl) {
|
|
6873
|
+
return;
|
|
6777
6874
|
}
|
|
6875
|
+
const { xThumbWidth } = reactData;
|
|
6876
|
+
const thumbEl = evnt.currentTarget;
|
|
6877
|
+
const trackEl = thumbEl.parentElement;
|
|
6878
|
+
const trackRect = trackEl.getBoundingClientRect();
|
|
6879
|
+
// 更新偏移
|
|
6880
|
+
viewEl.scrollLeft = getScrollFromDrag(evnt.clientX - trackRect.left, thumbDragOffset, viewEl.clientWidth, viewEl.scrollWidth, trackEl.clientWidth, xThumbWidth);
|
|
6778
6881
|
}
|
|
6779
|
-
return [];
|
|
6780
6882
|
};
|
|
6781
|
-
|
|
6782
|
-
|
|
6783
|
-
|
|
6784
|
-
|
|
6785
|
-
const listStyle = computeListStyle.value;
|
|
6786
|
-
return h('div', {
|
|
6787
|
-
class: 'vxe-carousel--list',
|
|
6788
|
-
style: listStyle
|
|
6789
|
-
}, list.map(item => {
|
|
6790
|
-
const { name, url, slots } = item;
|
|
6791
|
-
const defaultSlot = slots ? slots.default : null;
|
|
6792
|
-
return h('div', {
|
|
6793
|
-
key: `${name}`,
|
|
6794
|
-
class: ['vxe-carousel--item-inner', {
|
|
6795
|
-
'is--active': activeName === name
|
|
6796
|
-
}],
|
|
6797
|
-
style: height
|
|
6798
|
-
? {
|
|
6799
|
-
height: toCssUnit(height)
|
|
6800
|
-
}
|
|
6801
|
-
: null
|
|
6802
|
-
}, defaultSlot
|
|
6803
|
-
? callSlot(defaultSlot, {})
|
|
6804
|
-
: [
|
|
6805
|
-
h('img', {
|
|
6806
|
-
class: 'vxe-carousel--item-img',
|
|
6807
|
-
src: url
|
|
6808
|
-
})
|
|
6809
|
-
]);
|
|
6810
|
-
}));
|
|
6883
|
+
const cleatPointerThumbEvent = (evnt) => {
|
|
6884
|
+
const thumbEl = evnt.currentTarget;
|
|
6885
|
+
thumbEl.releasePointerCapture(evnt.pointerId);
|
|
6886
|
+
internalData.isThumbDrag = false;
|
|
6811
6887
|
};
|
|
6812
|
-
const
|
|
6813
|
-
const
|
|
6814
|
-
|
|
6815
|
-
|
|
6816
|
-
|
|
6817
|
-
|
|
6818
|
-
return
|
|
6819
|
-
|
|
6820
|
-
|
|
6821
|
-
|
|
6822
|
-
|
|
6823
|
-
|
|
6824
|
-
|
|
6825
|
-
|
|
6826
|
-
|
|
6827
|
-
|
|
6888
|
+
const pointerdownThumbYEvent = (evnt) => {
|
|
6889
|
+
const thumbEl = evnt.currentTarget;
|
|
6890
|
+
internalData.isThumbDrag = true;
|
|
6891
|
+
thumbEl.setPointerCapture(evnt.pointerId);
|
|
6892
|
+
const viewEl = refViewElem.value;
|
|
6893
|
+
if (!viewEl) {
|
|
6894
|
+
return;
|
|
6895
|
+
}
|
|
6896
|
+
const { yThumbHeight } = reactData;
|
|
6897
|
+
const trackEl = thumbEl.parentElement;
|
|
6898
|
+
const trackRect = trackEl.getBoundingClientRect();
|
|
6899
|
+
const pointerPosition = evnt.clientY - trackRect.top;
|
|
6900
|
+
// 记录 thumb 的偏移
|
|
6901
|
+
const thumbOffset = getThumbOffsetSize(viewEl.scrollTop, viewEl.clientHeight, viewEl.scrollHeight, trackEl.clientHeight, yThumbHeight);
|
|
6902
|
+
internalData.thumbDragOffset = pointerPosition - thumbOffset;
|
|
6903
|
+
};
|
|
6904
|
+
const pointermoveThumbYEvent = (evnt) => {
|
|
6905
|
+
const thumbEl = evnt.currentTarget;
|
|
6906
|
+
if (!thumbEl.hasPointerCapture(evnt.pointerId)) {
|
|
6907
|
+
return;
|
|
6908
|
+
}
|
|
6909
|
+
const { isThumbDrag, thumbDragOffset } = internalData;
|
|
6910
|
+
if (isThumbDrag) {
|
|
6911
|
+
const viewEl = refViewElem.value;
|
|
6912
|
+
if (!viewEl) {
|
|
6913
|
+
return;
|
|
6914
|
+
}
|
|
6915
|
+
const { yThumbHeight } = reactData;
|
|
6916
|
+
const thumbEl = evnt.currentTarget;
|
|
6917
|
+
const trackEl = thumbEl.parentElement;
|
|
6918
|
+
const trackRect = trackEl.getBoundingClientRect();
|
|
6919
|
+
// 更新偏移
|
|
6920
|
+
viewEl.scrollTop = getScrollFromDrag(evnt.clientY - trackRect.top, thumbDragOffset, viewEl.clientHeight, viewEl.scrollHeight, trackEl.clientHeight, yThumbHeight);
|
|
6921
|
+
}
|
|
6828
6922
|
};
|
|
6923
|
+
const scrollbarPrivateMethods = {};
|
|
6924
|
+
Object.assign($xeScrollbar, scrollbarMethods, scrollbarPrivateMethods);
|
|
6829
6925
|
const renderVN = () => {
|
|
6830
|
-
const {
|
|
6831
|
-
const
|
|
6926
|
+
const { id, native, loading, viewAttrs } = props;
|
|
6927
|
+
const wrapperStyle = computeWrapperStyle.value;
|
|
6928
|
+
const wrapperClss = computeWrapperClss.value;
|
|
6929
|
+
const viewClss = computeViewClss.value;
|
|
6930
|
+
const viewInnerClss = computeViewInnerClss.value;
|
|
6931
|
+
const xOpts = computeXOpts.value;
|
|
6932
|
+
const yOpts = computeYOpts.value;
|
|
6832
6933
|
const defaultSlot = slots.default;
|
|
6833
|
-
const list = (staticItems && staticItems.length ? staticItems : options) || [];
|
|
6834
6934
|
return h('div', {
|
|
6835
6935
|
ref: refElem,
|
|
6836
|
-
|
|
6837
|
-
|
|
6838
|
-
|
|
6839
|
-
width: toCssUnit(width)
|
|
6840
|
-
}
|
|
6841
|
-
: null,
|
|
6842
|
-
onMouseenter: mouseenterEvent,
|
|
6843
|
-
onMouseleave: mouseleaveEvent
|
|
6936
|
+
id: id || null,
|
|
6937
|
+
class: wrapperClss,
|
|
6938
|
+
style: wrapperStyle
|
|
6844
6939
|
}, [
|
|
6845
|
-
h('div', {
|
|
6846
|
-
class: 'vxe-carousel--slots'
|
|
6847
|
-
}, defaultSlot ? defaultSlot({}) : []),
|
|
6848
|
-
h('div', {
|
|
6849
|
-
ref: refWrapperElem,
|
|
6850
|
-
class: 'vxe-carousel--item-wrapper',
|
|
6851
|
-
style: height
|
|
6852
|
-
? {
|
|
6853
|
-
height: toCssUnit(height)
|
|
6854
|
-
}
|
|
6855
|
-
: null
|
|
6856
|
-
}, [
|
|
6857
|
-
renderItemWrapper(list)
|
|
6858
|
-
]),
|
|
6859
|
-
showIndicators ? renderIndicators(list) : renderEmptyElement$1($xeCarousel),
|
|
6860
|
-
h('div', {
|
|
6861
|
-
class: 'vxe-carousel--btn-wrapper'
|
|
6862
|
-
}, [
|
|
6940
|
+
h('div', Object.assign({ ref: refViewElem, class: viewClss, onScroll: scrollEvent }, viewAttrs), [
|
|
6863
6941
|
h('div', {
|
|
6864
|
-
|
|
6865
|
-
|
|
6942
|
+
key: 'vi',
|
|
6943
|
+
ref: refViewInnerElem,
|
|
6944
|
+
class: viewInnerClss
|
|
6945
|
+
}, defaultSlot ? defaultSlot({}) : [])
|
|
6946
|
+
]),
|
|
6947
|
+
native || xOpts.visible === 'hidden'
|
|
6948
|
+
? renderEmptyElement($xeScrollbar)
|
|
6949
|
+
: h('div', {
|
|
6950
|
+
ref: refTrackXElem,
|
|
6951
|
+
class: 'vxe-scrollbar--track-x',
|
|
6952
|
+
onClick: clickTrackXEvent
|
|
6866
6953
|
}, [
|
|
6867
|
-
h('
|
|
6868
|
-
|
|
6954
|
+
h('div', {
|
|
6955
|
+
ref: refThumbXElem,
|
|
6956
|
+
class: 'vxe-scrollbar--thumb-x',
|
|
6957
|
+
onPointerdown: pointerdownThumbXEvent,
|
|
6958
|
+
onPointermove: pointermoveThumbXEvent,
|
|
6959
|
+
onPointerup: cleatPointerThumbEvent,
|
|
6960
|
+
onPointercancel: cleatPointerThumbEvent,
|
|
6961
|
+
onLostpointercapture: cleatPointerThumbEvent
|
|
6869
6962
|
})
|
|
6870
6963
|
]),
|
|
6871
|
-
|
|
6872
|
-
|
|
6873
|
-
|
|
6964
|
+
native || yOpts.visible === 'hidden'
|
|
6965
|
+
? renderEmptyElement($xeScrollbar)
|
|
6966
|
+
: h('div', {
|
|
6967
|
+
ref: refTrackYElem,
|
|
6968
|
+
class: 'vxe-scrollbar--track-y',
|
|
6969
|
+
onClick: clickTrackYEvent
|
|
6874
6970
|
}, [
|
|
6875
|
-
h('
|
|
6876
|
-
|
|
6971
|
+
h('div', {
|
|
6972
|
+
ref: refThumbYElem,
|
|
6973
|
+
class: 'vxe-scrollbar--thumb-y',
|
|
6974
|
+
onPointerdown: pointerdownThumbYEvent,
|
|
6975
|
+
onPointermove: pointermoveThumbYEvent,
|
|
6976
|
+
onPointerup: cleatPointerThumbEvent,
|
|
6977
|
+
onPointercancel: cleatPointerThumbEvent,
|
|
6978
|
+
onLostpointercapture: cleatPointerThumbEvent
|
|
6877
6979
|
})
|
|
6878
|
-
])
|
|
6879
|
-
]),
|
|
6880
|
-
/**
|
|
6881
|
-
* 加载中
|
|
6882
|
-
*/
|
|
6980
|
+
]),
|
|
6883
6981
|
h(VxeLoading, {
|
|
6884
|
-
class: 'vxe-
|
|
6982
|
+
class: 'vxe-scrollbar--loading',
|
|
6885
6983
|
modelValue: loading
|
|
6886
6984
|
})
|
|
6887
6985
|
]);
|
|
6888
6986
|
};
|
|
6889
|
-
const
|
|
6890
|
-
watch(() => props.
|
|
6891
|
-
|
|
6987
|
+
const reFlag = ref(0);
|
|
6988
|
+
watch(() => props.height, () => {
|
|
6989
|
+
reFlag.value++;
|
|
6892
6990
|
});
|
|
6893
|
-
watch(() => props.
|
|
6894
|
-
|
|
6991
|
+
watch(() => props.width, () => {
|
|
6992
|
+
reFlag.value++;
|
|
6895
6993
|
});
|
|
6896
|
-
watch(
|
|
6897
|
-
|
|
6994
|
+
watch(() => props.minHeight, () => {
|
|
6995
|
+
reFlag.value++;
|
|
6898
6996
|
});
|
|
6899
|
-
|
|
6900
|
-
|
|
6901
|
-
stFlag.value++;
|
|
6997
|
+
watch(() => props.minWidth, () => {
|
|
6998
|
+
reFlag.value++;
|
|
6902
6999
|
});
|
|
6903
|
-
watch(() =>
|
|
6904
|
-
|
|
7000
|
+
watch(() => props.maxHeight, () => {
|
|
7001
|
+
reFlag.value++;
|
|
6905
7002
|
});
|
|
6906
|
-
watch(
|
|
6907
|
-
|
|
7003
|
+
watch(() => props.maxWidth, () => {
|
|
7004
|
+
reFlag.value++;
|
|
6908
7005
|
});
|
|
6909
|
-
watch(() => props.
|
|
6910
|
-
|
|
7006
|
+
watch(() => props.native, () => {
|
|
7007
|
+
reFlag.value++;
|
|
7008
|
+
});
|
|
7009
|
+
watch(() => props.syncResize, () => {
|
|
7010
|
+
reFlag.value++;
|
|
7011
|
+
});
|
|
7012
|
+
watch(reFlag, () => {
|
|
7013
|
+
$xeScrollbar.recalculate().then(() => {
|
|
7014
|
+
$xeScrollbar.recalculate();
|
|
7015
|
+
});
|
|
6911
7016
|
});
|
|
6912
|
-
initDefaultActive(reactData.staticItems.length ? reactData.staticItems : props.options);
|
|
6913
7017
|
onMounted(() => {
|
|
6914
|
-
|
|
6915
|
-
|
|
7018
|
+
const { autoResize } = props;
|
|
7019
|
+
const viewEl = refViewElem.value;
|
|
7020
|
+
const viewInnerEl = refViewInnerElem.value;
|
|
7021
|
+
if (autoResize) {
|
|
7022
|
+
const resizeObserver = globalResize.create(() => {
|
|
7023
|
+
if (props.autoResize) {
|
|
7024
|
+
reFlag.value++;
|
|
7025
|
+
}
|
|
7026
|
+
});
|
|
7027
|
+
if (viewEl) {
|
|
7028
|
+
resizeObserver.observe(viewEl);
|
|
7029
|
+
}
|
|
7030
|
+
if (viewInnerEl) {
|
|
7031
|
+
resizeObserver.observe(viewInnerEl);
|
|
7032
|
+
}
|
|
7033
|
+
internalData.resizeObserver = resizeObserver;
|
|
7034
|
+
}
|
|
7035
|
+
reFlag.value++;
|
|
7036
|
+
globalEvents.on($xeScrollbar, 'resize', () => {
|
|
7037
|
+
reFlag.value++;
|
|
7038
|
+
});
|
|
6916
7039
|
});
|
|
6917
|
-
|
|
6918
|
-
|
|
7040
|
+
onBeforeUnmount(() => {
|
|
7041
|
+
const { resizeObserver } = internalData;
|
|
7042
|
+
if (resizeObserver) {
|
|
7043
|
+
resizeObserver.disconnect();
|
|
7044
|
+
}
|
|
7045
|
+
globalEvents.off($xeScrollbar, 'resize');
|
|
6919
7046
|
});
|
|
6920
|
-
|
|
6921
|
-
$
|
|
6922
|
-
return $xeCarousel;
|
|
7047
|
+
$xeScrollbar.renderVN = renderVN;
|
|
7048
|
+
return $xeScrollbar;
|
|
6923
7049
|
},
|
|
6924
7050
|
render() {
|
|
6925
7051
|
return this.renderVN();
|
|
6926
7052
|
}
|
|
6927
7053
|
});
|
|
6928
7054
|
|
|
6929
|
-
const
|
|
7055
|
+
const VxeScrollbar = Object.assign({}, VxeScrollbarComponent, {
|
|
6930
7056
|
install(app) {
|
|
6931
|
-
app.component(
|
|
7057
|
+
app.component(VxeScrollbarComponent.name, VxeScrollbarComponent);
|
|
6932
7058
|
}
|
|
6933
7059
|
});
|
|
6934
|
-
dynamicApp.use(
|
|
6935
|
-
VxeUI.component(
|
|
6936
|
-
const
|
|
6937
|
-
|
|
6938
|
-
function assembleCarouselItem($xeCarousel, elem, itemConfig) {
|
|
6939
|
-
const staticItems = $xeCarousel.reactData.staticItems;
|
|
6940
|
-
const parentElem = elem.parentNode;
|
|
6941
|
-
if (parentElem) {
|
|
6942
|
-
staticItems.splice(XEUtils.arrayIndexOf(parentElem.children, elem), 0, itemConfig);
|
|
6943
|
-
}
|
|
6944
|
-
$xeCarousel.reactData.staticItems = staticItems.slice(0);
|
|
6945
|
-
}
|
|
6946
|
-
function destroyCarouselItem($xeCarousel, itemConfig) {
|
|
6947
|
-
const staticItems = $xeCarousel.reactData.staticItems;
|
|
6948
|
-
const index = XEUtils.findIndexOf(staticItems, item => item.id === itemConfig.id);
|
|
6949
|
-
if (index > -1) {
|
|
6950
|
-
staticItems.splice(index, 1);
|
|
6951
|
-
}
|
|
6952
|
-
$xeCarousel.reactData.staticItems = staticItems.slice(0);
|
|
6953
|
-
}
|
|
7060
|
+
dynamicApp.use(VxeScrollbar);
|
|
7061
|
+
VxeUI.component(VxeScrollbarComponent);
|
|
7062
|
+
const Scrollbar = VxeScrollbar;
|
|
6954
7063
|
|
|
6955
|
-
var
|
|
6956
|
-
name: '
|
|
7064
|
+
var VxeCardComponent = defineVxeComponent({
|
|
7065
|
+
name: 'VxeCard',
|
|
6957
7066
|
props: {
|
|
6958
|
-
|
|
6959
|
-
|
|
6960
|
-
|
|
6961
|
-
|
|
6962
|
-
|
|
6963
|
-
|
|
6964
|
-
|
|
6965
|
-
|
|
6966
|
-
|
|
6967
|
-
|
|
6968
|
-
|
|
6969
|
-
|
|
6970
|
-
|
|
6971
|
-
|
|
6972
|
-
|
|
6973
|
-
|
|
6974
|
-
|
|
6975
|
-
|
|
6976
|
-
|
|
6977
|
-
|
|
6978
|
-
|
|
6979
|
-
|
|
6980
|
-
|
|
6981
|
-
|
|
6982
|
-
|
|
6983
|
-
|
|
7067
|
+
title: String,
|
|
7068
|
+
showTitleOverflow: {
|
|
7069
|
+
type: Boolean,
|
|
7070
|
+
default: () => getConfig$4().card.showTitleOverflow
|
|
7071
|
+
},
|
|
7072
|
+
width: [String, Number],
|
|
7073
|
+
height: [String, Number],
|
|
7074
|
+
border: {
|
|
7075
|
+
type: Boolean,
|
|
7076
|
+
default: () => getConfig$4().card.border
|
|
7077
|
+
},
|
|
7078
|
+
loading: Boolean,
|
|
7079
|
+
shadow: {
|
|
7080
|
+
type: Boolean,
|
|
7081
|
+
default: () => getConfig$4().card.shadow
|
|
7082
|
+
},
|
|
7083
|
+
padding: {
|
|
7084
|
+
type: Boolean,
|
|
7085
|
+
default: () => getConfig$4().card.padding
|
|
7086
|
+
},
|
|
7087
|
+
size: {
|
|
7088
|
+
type: String,
|
|
7089
|
+
default: () => getConfig$4().card.size || getConfig$4().size
|
|
7090
|
+
},
|
|
7091
|
+
useScrollbar: {
|
|
7092
|
+
type: Boolean,
|
|
7093
|
+
default: () => getConfig$4().card.useScrollbar
|
|
7094
|
+
},
|
|
7095
|
+
scrollbarConfig: Object
|
|
7096
|
+
},
|
|
7097
|
+
emits: [],
|
|
7098
|
+
setup(props, context) {
|
|
7099
|
+
const { slots, emit } = context;
|
|
7100
|
+
const xID = XEUtils.uniqueId();
|
|
7101
|
+
const refElem = ref();
|
|
7102
|
+
const { computeSize } = useSize(props);
|
|
7103
|
+
const reactData = reactive({});
|
|
7104
|
+
const refMaps = {
|
|
7105
|
+
refElem
|
|
7106
|
+
};
|
|
7107
|
+
const computeCardStyle = computed(() => {
|
|
7108
|
+
const { height, width } = props;
|
|
7109
|
+
const stys = {};
|
|
7110
|
+
if (width) {
|
|
7111
|
+
stys.width = toCssUnit(width);
|
|
7112
|
+
}
|
|
7113
|
+
if (height) {
|
|
7114
|
+
stys.height = toCssUnit(height);
|
|
7115
|
+
}
|
|
7116
|
+
return stys;
|
|
7117
|
+
});
|
|
7118
|
+
const computeScrollbarOpts = computed(() => {
|
|
7119
|
+
return Object.assign({}, getConfig$4().card.scrollbarConfig, props.scrollbarConfig);
|
|
7120
|
+
});
|
|
7121
|
+
const computeMaps = {
|
|
7122
|
+
computeSize
|
|
7123
|
+
};
|
|
7124
|
+
const $xeCard = {
|
|
7125
|
+
xID,
|
|
7126
|
+
props,
|
|
7127
|
+
context,
|
|
6984
7128
|
reactData,
|
|
6985
7129
|
getRefMaps: () => refMaps,
|
|
6986
7130
|
getComputeMaps: () => computeMaps
|
|
6987
7131
|
};
|
|
6988
7132
|
const dispatchEvent = (type, params, evnt) => {
|
|
6989
|
-
emit(type, createEvent$1(evnt, { $
|
|
7133
|
+
emit(type, createEvent$1(evnt, { $card: $xeCard }, params));
|
|
6990
7134
|
};
|
|
6991
|
-
const
|
|
7135
|
+
const cardMethods = {
|
|
6992
7136
|
dispatchEvent
|
|
6993
7137
|
};
|
|
6994
|
-
const
|
|
6995
|
-
Object.assign($
|
|
7138
|
+
const cardPrivateMethods = {};
|
|
7139
|
+
Object.assign($xeCard, cardMethods, cardPrivateMethods);
|
|
6996
7140
|
const renderVN = () => {
|
|
7141
|
+
const { title, border, shadow, padding, loading, showTitleOverflow, useScrollbar } = props;
|
|
7142
|
+
const defaultSlot = slots.default;
|
|
7143
|
+
const headerSlot = slots.header;
|
|
7144
|
+
const titleSlot = slots.title;
|
|
7145
|
+
const extraSlot = slots.extra;
|
|
7146
|
+
const footerSlot = slots.footer;
|
|
7147
|
+
const leftSlot = slots.left;
|
|
7148
|
+
const rightSlot = slots.right;
|
|
7149
|
+
const vSize = computeSize.value;
|
|
7150
|
+
const cardStyle = computeCardStyle.value;
|
|
7151
|
+
const scrollbarOpts = computeScrollbarOpts.value;
|
|
7152
|
+
const { viewClassName, viewInnerClassName } = scrollbarOpts;
|
|
6997
7153
|
return h('div', {
|
|
6998
|
-
ref: refElem
|
|
6999
|
-
|
|
7154
|
+
ref: refElem,
|
|
7155
|
+
class: ['vxe-card', {
|
|
7156
|
+
[`size--${vSize}`]: vSize,
|
|
7157
|
+
'is--border': border,
|
|
7158
|
+
'is--shadow': shadow,
|
|
7159
|
+
'is--padding': padding
|
|
7160
|
+
}],
|
|
7161
|
+
style: cardStyle
|
|
7162
|
+
}, [
|
|
7163
|
+
title || titleSlot || headerSlot
|
|
7164
|
+
? h('div', {
|
|
7165
|
+
class: 'vxe-card--header'
|
|
7166
|
+
}, headerSlot
|
|
7167
|
+
? getSlotVNs(headerSlot({}))
|
|
7168
|
+
: [
|
|
7169
|
+
h('div', {
|
|
7170
|
+
class: ['vxe-card--header-title', {
|
|
7171
|
+
'is--ellipsis': showTitleOverflow
|
|
7172
|
+
}]
|
|
7173
|
+
}, titleSlot ? getSlotVNs(titleSlot({})) : `${title || ''}`),
|
|
7174
|
+
extraSlot
|
|
7175
|
+
? h('div', {
|
|
7176
|
+
class: 'vxe-card--header-extra'
|
|
7177
|
+
}, getSlotVNs(extraSlot({})))
|
|
7178
|
+
: renderEmptyElement$1($xeCard)
|
|
7179
|
+
])
|
|
7180
|
+
: renderEmptyElement$1($xeCard),
|
|
7181
|
+
h('div', {
|
|
7182
|
+
class: 'vxe-card--body'
|
|
7183
|
+
}, [
|
|
7184
|
+
leftSlot
|
|
7185
|
+
? (useScrollbar
|
|
7186
|
+
? h(VxeScrollbar, Object.assign(Object.assign({ class: 'vxe-card--body-scrollbar-left' }, scrollbarOpts), { viewClassName: 'vxe-card--body-scrollbar-left-view', viewInnerClassName: 'vxe-card--body-scrollbar-left-inner' }), {
|
|
7187
|
+
default: () => getSlotVNs(leftSlot({}))
|
|
7188
|
+
})
|
|
7189
|
+
: h('div', {
|
|
7190
|
+
class: 'vxe-card--body-left'
|
|
7191
|
+
}, getSlotVNs(leftSlot({}))))
|
|
7192
|
+
: renderEmptyElement$1($xeCard),
|
|
7193
|
+
useScrollbar
|
|
7194
|
+
? h(VxeScrollbar, Object.assign(Object.assign({ class: 'vxe-card--body-scrollbar-content' }, scrollbarOpts), { viewClassName: 'vxe-card--body-scrollbar-content-view' + (viewClassName ? (' ' + viewClassName) : ''), viewInnerClassName: 'vxe-card--body-scrollbar-content-inner' + (viewClassName ? (' ' + viewInnerClassName) : '') }), {
|
|
7195
|
+
default: () => defaultSlot ? getSlotVNs(defaultSlot({})) : []
|
|
7196
|
+
})
|
|
7197
|
+
: h('div', {
|
|
7198
|
+
class: 'vxe-card--body-content'
|
|
7199
|
+
}, defaultSlot ? getSlotVNs(defaultSlot({})) : []),
|
|
7200
|
+
rightSlot
|
|
7201
|
+
? (useScrollbar
|
|
7202
|
+
? h(VxeScrollbar, Object.assign(Object.assign({ class: 'vxe-card--body-scrollbar-right' }, scrollbarOpts), { viewClassName: 'vxe-card--body-scrollbar-right-view', viewInnerClassName: 'vxe-card--body-scrollbar-right-inner' }), {
|
|
7203
|
+
default: () => getSlotVNs(rightSlot({}))
|
|
7204
|
+
})
|
|
7205
|
+
: h('div', {
|
|
7206
|
+
class: 'vxe-card--body-right'
|
|
7207
|
+
}, getSlotVNs(rightSlot({}))))
|
|
7208
|
+
: renderEmptyElement$1($xeCard)
|
|
7209
|
+
]),
|
|
7210
|
+
footerSlot
|
|
7211
|
+
? h('div', {
|
|
7212
|
+
class: 'vxe-card--footer'
|
|
7213
|
+
}, getSlotVNs(footerSlot({})))
|
|
7214
|
+
: renderEmptyElement$1($xeCard),
|
|
7215
|
+
/**
|
|
7216
|
+
* 加载中
|
|
7217
|
+
*/
|
|
7218
|
+
h(VxeLoading, {
|
|
7219
|
+
class: 'vxe-card--loading',
|
|
7220
|
+
modelValue: loading
|
|
7221
|
+
})
|
|
7222
|
+
]);
|
|
7000
7223
|
};
|
|
7001
|
-
|
|
7002
|
-
|
|
7003
|
-
});
|
|
7004
|
-
watch(() => props.url, (val) => {
|
|
7005
|
-
itemConfig.url = val;
|
|
7006
|
-
});
|
|
7007
|
-
onMounted(() => {
|
|
7008
|
-
const elem = refElem.value;
|
|
7009
|
-
if ($xeCarousel && elem) {
|
|
7010
|
-
assembleCarouselItem($xeCarousel, elem, itemConfig);
|
|
7011
|
-
}
|
|
7012
|
-
});
|
|
7013
|
-
onUnmounted(() => {
|
|
7014
|
-
if ($xeCarousel) {
|
|
7015
|
-
destroyCarouselItem($xeCarousel, itemConfig);
|
|
7016
|
-
}
|
|
7017
|
-
});
|
|
7018
|
-
$xeCarouselItem.renderVN = renderVN;
|
|
7019
|
-
return $xeCarouselItem;
|
|
7224
|
+
$xeCard.renderVN = renderVN;
|
|
7225
|
+
return $xeCard;
|
|
7020
7226
|
},
|
|
7021
7227
|
render() {
|
|
7022
7228
|
return this.renderVN();
|
|
7023
7229
|
}
|
|
7024
7230
|
});
|
|
7025
7231
|
|
|
7026
|
-
const
|
|
7232
|
+
const VxeCard = Object.assign({}, VxeCardComponent, {
|
|
7027
7233
|
install(app) {
|
|
7028
|
-
app.component(
|
|
7234
|
+
app.component(VxeCardComponent.name, VxeCardComponent);
|
|
7029
7235
|
}
|
|
7030
7236
|
});
|
|
7031
|
-
dynamicApp.use(
|
|
7032
|
-
VxeUI.component(
|
|
7033
|
-
const
|
|
7034
|
-
|
|
7035
|
-
function enNodeValue(nodeid) {
|
|
7036
|
-
return XEUtils.eqNull(nodeid) ? '' : encodeURIComponent(`${nodeid}`);
|
|
7037
|
-
}
|
|
7038
|
-
function deNodeValue(nodeid) {
|
|
7039
|
-
return nodeid ? decodeURIComponent(`${nodeid}`) : nodeid;
|
|
7040
|
-
}
|
|
7041
|
-
|
|
7042
|
-
// 跨列表拖拽
|
|
7043
|
-
const crossListDragRowInfo = reactive({
|
|
7044
|
-
row: null
|
|
7045
|
-
});
|
|
7046
|
-
function getCrossListDragRowInfo() {
|
|
7047
|
-
return crossListDragRowInfo;
|
|
7048
|
-
}
|
|
7049
|
-
|
|
7050
|
-
const rowMoveCls = 'row--drag-move';
|
|
7051
|
-
/**
|
|
7052
|
-
* 上下拖拽
|
|
7053
|
-
*/
|
|
7054
|
-
function moveRowAnimateToTb(elemList, offsetTop) {
|
|
7055
|
-
XEUtils.arrayEach(elemList, trEl => {
|
|
7056
|
-
trEl.style.transform = `translateY(${offsetTop}px)`;
|
|
7057
|
-
});
|
|
7058
|
-
requestAnimationFrame(() => {
|
|
7059
|
-
XEUtils.arrayEach(elemList, trEl => {
|
|
7060
|
-
addClass(trEl, rowMoveCls);
|
|
7061
|
-
trEl.style.transform = '';
|
|
7062
|
-
});
|
|
7063
|
-
});
|
|
7064
|
-
}
|
|
7065
|
-
function clearRowAnimate(elem, clss) {
|
|
7066
|
-
setTimeout(() => {
|
|
7067
|
-
if (elem) {
|
|
7068
|
-
XEUtils.arrayEach(elem.querySelectorAll(clss.map(cls => `${cls}.${rowMoveCls}`).join(',')), elem => removeClass(elem, rowMoveCls));
|
|
7069
|
-
}
|
|
7070
|
-
}, 500);
|
|
7071
|
-
}
|
|
7072
|
-
|
|
7073
|
-
function getItemCacheObj$1(item) {
|
|
7074
|
-
return {
|
|
7075
|
-
item,
|
|
7076
|
-
index: -1,
|
|
7077
|
-
$index: -1,
|
|
7078
|
-
_index: -1
|
|
7079
|
-
};
|
|
7080
|
-
}
|
|
7237
|
+
dynamicApp.use(VxeCard);
|
|
7238
|
+
VxeUI.component(VxeCardComponent);
|
|
7239
|
+
const Card = VxeCard;
|
|
7081
7240
|
|
|
7082
|
-
|
|
7083
|
-
|
|
7084
|
-
return row ? ('' + (row[keyField] || '')) : '';
|
|
7085
|
-
}
|
|
7086
|
-
function getRowIdByField(row, keyField) {
|
|
7087
|
-
if (!row) {
|
|
7088
|
-
return '';
|
|
7089
|
-
}
|
|
7090
|
-
const rowKey = getRowKeyByField(row, keyField);
|
|
7091
|
-
return enModelValue(rowKey);
|
|
7092
|
-
}
|
|
7093
|
-
function createReactData$n() {
|
|
7094
|
-
return {
|
|
7095
|
-
scrollYLoad: false,
|
|
7096
|
-
bodyHeight: 0,
|
|
7097
|
-
headHeight: 0,
|
|
7098
|
-
footHeight: 0,
|
|
7099
|
-
customHeight: 0,
|
|
7100
|
-
customMaxHeight: 0,
|
|
7101
|
-
parentHeight: 0,
|
|
7102
|
-
topSpaceHeight: 0,
|
|
7103
|
-
rowList: [],
|
|
7104
|
-
selectRadioRow: null,
|
|
7105
|
-
currRowFlag: 1,
|
|
7106
|
-
updateCheckboxFlag: 1,
|
|
7107
|
-
isAllChecked: false,
|
|
7108
|
-
isAllIndeterminate: false,
|
|
7109
|
-
insertRowFlag: 1,
|
|
7110
|
-
removeRowFlag: 1,
|
|
7111
|
-
dragRow: null,
|
|
7112
|
-
dragTipText: '',
|
|
7113
|
-
isCrossDragRow: false
|
|
7114
|
-
};
|
|
7115
|
-
}
|
|
7116
|
-
function createInternalData$m() {
|
|
7117
|
-
return {
|
|
7118
|
-
resizeObserver: undefined,
|
|
7119
|
-
fullData: [],
|
|
7120
|
-
afterList: [],
|
|
7121
|
-
fullKeyMaps: {},
|
|
7122
|
-
rowMaps: {},
|
|
7123
|
-
lastScrollLeft: 0,
|
|
7124
|
-
lastScrollTop: 0,
|
|
7125
|
-
scrollYStore: {
|
|
7126
|
-
startIndex: 0,
|
|
7127
|
-
endIndex: 0,
|
|
7128
|
-
visibleSize: 0,
|
|
7129
|
-
offsetSize: 0,
|
|
7130
|
-
rowHeight: 0
|
|
7131
|
-
},
|
|
7132
|
-
currentRow: null,
|
|
7133
|
-
selectCheckboxMaps: {},
|
|
7134
|
-
insertRowMaps: {},
|
|
7135
|
-
removeRowMaps: {}
|
|
7136
|
-
// prevDragRow: null,
|
|
7137
|
-
// prevDragPos: ''
|
|
7138
|
-
};
|
|
7139
|
-
}
|
|
7140
|
-
let crossListDragRowObj = null;
|
|
7141
|
-
var VxeListComponent = defineVxeComponent({
|
|
7142
|
-
name: 'VxeList',
|
|
7241
|
+
var VxeCarouselComponent = defineVxeComponent({
|
|
7242
|
+
name: 'VxeCarousel',
|
|
7143
7243
|
props: {
|
|
7144
|
-
|
|
7145
|
-
|
|
7146
|
-
maxHeight: [Number, String],
|
|
7244
|
+
modelValue: [String, Number],
|
|
7245
|
+
options: Array,
|
|
7147
7246
|
loading: Boolean,
|
|
7148
|
-
|
|
7149
|
-
|
|
7150
|
-
|
|
7151
|
-
default: () => getConfig$4().list.size || getConfig$4().size
|
|
7247
|
+
height: {
|
|
7248
|
+
type: [Number, String],
|
|
7249
|
+
default: () => getConfig$4().carousel.height
|
|
7152
7250
|
},
|
|
7153
|
-
|
|
7154
|
-
type:
|
|
7155
|
-
default: () => getConfig$4().
|
|
7251
|
+
width: {
|
|
7252
|
+
type: [Number, String],
|
|
7253
|
+
default: () => getConfig$4().carousel.width
|
|
7156
7254
|
},
|
|
7157
|
-
|
|
7158
|
-
showSeq: {
|
|
7255
|
+
autoPlay: {
|
|
7159
7256
|
type: Boolean,
|
|
7160
|
-
default: () => getConfig$4().
|
|
7257
|
+
default: () => getConfig$4().carousel.autoPlay
|
|
7161
7258
|
},
|
|
7162
|
-
|
|
7259
|
+
interval: {
|
|
7260
|
+
type: [Number, String],
|
|
7261
|
+
default: () => getConfig$4().carousel.interval
|
|
7262
|
+
},
|
|
7263
|
+
loop: {
|
|
7163
7264
|
type: Boolean,
|
|
7164
|
-
default: () => getConfig$4().
|
|
7265
|
+
default: () => getConfig$4().carousel.loop
|
|
7165
7266
|
},
|
|
7166
|
-
|
|
7167
|
-
radioConfig: Object,
|
|
7168
|
-
showCheckbox: {
|
|
7267
|
+
vertical: {
|
|
7169
7268
|
type: Boolean,
|
|
7170
|
-
default: () => getConfig$4().
|
|
7269
|
+
default: () => getConfig$4().carousel.vertical
|
|
7171
7270
|
},
|
|
7172
|
-
|
|
7173
|
-
|
|
7174
|
-
|
|
7175
|
-
|
|
7176
|
-
menuConfig: Object,
|
|
7177
|
-
virtualYConfig: Object,
|
|
7178
|
-
scrollY: Object
|
|
7271
|
+
showIndicators: {
|
|
7272
|
+
type: Boolean,
|
|
7273
|
+
default: () => getConfig$4().carousel.showIndicators
|
|
7274
|
+
}
|
|
7179
7275
|
},
|
|
7180
7276
|
emits: [
|
|
7181
|
-
'update:
|
|
7182
|
-
'
|
|
7183
|
-
'row-click',
|
|
7184
|
-
'row-dblclick',
|
|
7185
|
-
'current-change',
|
|
7186
|
-
'radio-change',
|
|
7187
|
-
'checkbox-change',
|
|
7188
|
-
'checkbox-all',
|
|
7189
|
-
'scroll',
|
|
7190
|
-
'row-dragstart',
|
|
7191
|
-
'row-dragover',
|
|
7192
|
-
'row-dragend',
|
|
7193
|
-
'row-remove-dragend',
|
|
7194
|
-
'row-insert-dragend',
|
|
7195
|
-
'row-menu',
|
|
7196
|
-
'menu-click'
|
|
7277
|
+
'update:modelValue',
|
|
7278
|
+
'change'
|
|
7197
7279
|
],
|
|
7198
7280
|
setup(props, context) {
|
|
7199
|
-
const {
|
|
7281
|
+
const { emit, slots } = context;
|
|
7200
7282
|
const xID = XEUtils.uniqueId();
|
|
7201
|
-
const browseObj = XEUtils.browse();
|
|
7202
|
-
const { computeSize } = useSize(props);
|
|
7203
|
-
const reactData = reactive(createReactData$n());
|
|
7204
|
-
const internalData = createInternalData$m();
|
|
7205
|
-
const crossListDragRowInfo = getCrossListDragRowInfo();
|
|
7206
7283
|
const refElem = ref();
|
|
7207
|
-
const
|
|
7208
|
-
const
|
|
7209
|
-
|
|
7210
|
-
|
|
7211
|
-
|
|
7212
|
-
|
|
7284
|
+
const refWrapperElem = ref();
|
|
7285
|
+
const reactData = reactive({
|
|
7286
|
+
activeName: '',
|
|
7287
|
+
staticItems: [],
|
|
7288
|
+
itemWidth: 0,
|
|
7289
|
+
itemHeight: 0
|
|
7290
|
+
});
|
|
7291
|
+
const internalData = {
|
|
7292
|
+
apTimeout: undefined,
|
|
7293
|
+
stopFlag: false
|
|
7294
|
+
};
|
|
7213
7295
|
const refMaps = {
|
|
7214
7296
|
refElem
|
|
7215
7297
|
};
|
|
7216
|
-
const
|
|
7298
|
+
const computeListStyle = computed(() => {
|
|
7299
|
+
const { vertical, options } = props;
|
|
7300
|
+
const { activeName, itemWidth, itemHeight, staticItems } = reactData;
|
|
7301
|
+
const list = (staticItems && staticItems.length ? staticItems : options) || [];
|
|
7302
|
+
const activeIndex = Math.max(0, XEUtils.findIndexOf(list, item => item.name === activeName));
|
|
7303
|
+
const stys = {};
|
|
7304
|
+
if (vertical) {
|
|
7305
|
+
stys.transform = `translateY(-${activeIndex * itemHeight}px)`;
|
|
7306
|
+
}
|
|
7307
|
+
else {
|
|
7308
|
+
stys.width = `${itemWidth * list.length}px`;
|
|
7309
|
+
stys.transform = `translateX(-${activeIndex * itemWidth}px)`;
|
|
7310
|
+
}
|
|
7311
|
+
return stys;
|
|
7312
|
+
});
|
|
7313
|
+
const computeMaps = {};
|
|
7314
|
+
const $xeCarousel = {
|
|
7217
7315
|
xID,
|
|
7218
7316
|
props,
|
|
7219
7317
|
context,
|
|
7220
7318
|
reactData,
|
|
7221
7319
|
internalData,
|
|
7222
|
-
getRefMaps: () => refMaps
|
|
7320
|
+
getRefMaps: () => refMaps,
|
|
7321
|
+
getComputeMaps: () => computeMaps
|
|
7223
7322
|
};
|
|
7224
|
-
const
|
|
7225
|
-
|
|
7226
|
-
|
|
7227
|
-
|
|
7228
|
-
|
|
7229
|
-
|
|
7230
|
-
|
|
7231
|
-
|
|
7232
|
-
});
|
|
7233
|
-
const computeKeyField = computed(() => {
|
|
7234
|
-
const rowOpts = computeRowOpts.value;
|
|
7235
|
-
const { keyField } = rowOpts;
|
|
7236
|
-
return keyField || '';
|
|
7237
|
-
});
|
|
7238
|
-
const computeIsDrag = computed(() => {
|
|
7239
|
-
const { dragConfig } = props;
|
|
7240
|
-
const dragOpts = computeDragOpts.value;
|
|
7241
|
-
return dragConfig && isEnableConf(dragOpts);
|
|
7242
|
-
});
|
|
7243
|
-
const computeRowHeight = computed(() => {
|
|
7244
|
-
const rowOpts = computeRowOpts.value;
|
|
7245
|
-
const { height } = rowOpts;
|
|
7246
|
-
return height;
|
|
7247
|
-
});
|
|
7248
|
-
const computeRadioOpts = computed(() => {
|
|
7249
|
-
return Object.assign({ showIcon: true }, getConfig$4().list.radioConfig, props.radioConfig);
|
|
7250
|
-
});
|
|
7251
|
-
const computeCheckboxOpts = computed(() => {
|
|
7252
|
-
return Object.assign({ showIcon: true }, getConfig$4().list.checkboxConfig, props.checkboxConfig);
|
|
7253
|
-
});
|
|
7254
|
-
const computeMenuOpts = computed(() => {
|
|
7255
|
-
return Object.assign({}, getConfig$4().list.menuConfig, props.menuConfig);
|
|
7256
|
-
});
|
|
7257
|
-
const computeWrapperStyles = computed(() => {
|
|
7258
|
-
const rowHeight = computeRowHeight.value;
|
|
7259
|
-
const style = {};
|
|
7260
|
-
if (rowHeight) {
|
|
7261
|
-
style['--vxe-ui-list-row-height'] = toCssUnit(rowHeight);
|
|
7262
|
-
}
|
|
7263
|
-
return style;
|
|
7264
|
-
});
|
|
7265
|
-
const computeVirtualStyles = computed(() => {
|
|
7266
|
-
const { height, maxHeight } = props;
|
|
7267
|
-
const { customHeight, customMaxHeight, headHeight, footHeight } = reactData;
|
|
7268
|
-
const style = {};
|
|
7269
|
-
if (height) {
|
|
7270
|
-
style.height = toCssUnit(Math.max(20, customHeight - headHeight - footHeight));
|
|
7271
|
-
}
|
|
7272
|
-
else if (maxHeight) {
|
|
7273
|
-
style.height = 'auto';
|
|
7274
|
-
style.maxHeight = toCssUnit(Math.max(20, customMaxHeight - headHeight - footHeight));
|
|
7275
|
-
}
|
|
7276
|
-
return style;
|
|
7277
|
-
});
|
|
7278
|
-
const dispatchEvent = (type, params, evnt) => {
|
|
7279
|
-
emit(type, createEvent$1(evnt, { $list: $xeList }, params));
|
|
7323
|
+
const updateStyle = () => {
|
|
7324
|
+
nextTick(() => {
|
|
7325
|
+
const wrapperElem = refWrapperElem.value;
|
|
7326
|
+
if (wrapperElem) {
|
|
7327
|
+
reactData.itemWidth = wrapperElem.clientWidth;
|
|
7328
|
+
reactData.itemHeight = wrapperElem.clientHeight;
|
|
7329
|
+
}
|
|
7330
|
+
});
|
|
7280
7331
|
};
|
|
7281
|
-
const
|
|
7282
|
-
|
|
7332
|
+
const clickItemEvent = (evnt, item) => {
|
|
7333
|
+
const value = item.name;
|
|
7334
|
+
reactData.activeName = item.name;
|
|
7335
|
+
emit('update:modelValue', value);
|
|
7336
|
+
emit('change', { value }, evnt);
|
|
7337
|
+
updateStyle();
|
|
7283
7338
|
};
|
|
7284
|
-
const
|
|
7285
|
-
|
|
7339
|
+
const initDefaultActive = (list) => {
|
|
7340
|
+
let activeName = null;
|
|
7341
|
+
if (list && list.length) {
|
|
7342
|
+
let validVal = false;
|
|
7343
|
+
activeName = props.modelValue;
|
|
7344
|
+
list.forEach((item) => {
|
|
7345
|
+
if (activeName === item.name) {
|
|
7346
|
+
validVal = true;
|
|
7347
|
+
}
|
|
7348
|
+
});
|
|
7349
|
+
if (!validVal) {
|
|
7350
|
+
activeName = list[0].name;
|
|
7351
|
+
emit('update:modelValue', activeName);
|
|
7352
|
+
}
|
|
7353
|
+
}
|
|
7354
|
+
reactData.activeName = activeName;
|
|
7286
7355
|
};
|
|
7287
|
-
const
|
|
7288
|
-
|
|
7289
|
-
return getRowIdByField(row, keyField);
|
|
7356
|
+
const dispatchEvent = (type, params, evnt) => {
|
|
7357
|
+
emit(type, createEvent$1(evnt, { $carousel: $xeCarousel }, params));
|
|
7290
7358
|
};
|
|
7291
|
-
const
|
|
7292
|
-
const {
|
|
7293
|
-
const
|
|
7294
|
-
|
|
7295
|
-
|
|
7296
|
-
|
|
7297
|
-
|
|
7359
|
+
const handlePrevNext = (isNext) => {
|
|
7360
|
+
const { options, loop } = props;
|
|
7361
|
+
const { activeName, staticItems } = reactData;
|
|
7362
|
+
const list = (staticItems && staticItems.length ? staticItems : options) || [];
|
|
7363
|
+
const index = Math.max(0, XEUtils.findIndexOf(list, item => item.name === activeName));
|
|
7364
|
+
if (index > -1) {
|
|
7365
|
+
let item = null;
|
|
7366
|
+
if (isNext) {
|
|
7367
|
+
if (index < list.length - 1) {
|
|
7368
|
+
item = list[index + 1];
|
|
7369
|
+
}
|
|
7370
|
+
else {
|
|
7371
|
+
if (loop) {
|
|
7372
|
+
item = list[0];
|
|
7373
|
+
}
|
|
7374
|
+
}
|
|
7298
7375
|
}
|
|
7299
7376
|
else {
|
|
7300
|
-
if (
|
|
7301
|
-
|
|
7377
|
+
if (index > 0) {
|
|
7378
|
+
item = list[index - 1];
|
|
7302
7379
|
}
|
|
7303
7380
|
else {
|
|
7304
|
-
|
|
7381
|
+
if (loop) {
|
|
7382
|
+
item = list[list.length - 1];
|
|
7383
|
+
}
|
|
7305
7384
|
}
|
|
7306
|
-
num = Math.max(40, num);
|
|
7307
7385
|
}
|
|
7308
|
-
|
|
7309
|
-
|
|
7310
|
-
|
|
7386
|
+
if (item) {
|
|
7387
|
+
const name = item.name;
|
|
7388
|
+
const value = name;
|
|
7389
|
+
reactData.activeName = name;
|
|
7390
|
+
emit('update:modelValue', value);
|
|
7391
|
+
return true;
|
|
7392
|
+
}
|
|
7393
|
+
}
|
|
7394
|
+
return false;
|
|
7395
|
+
};
|
|
7396
|
+
const carouselMethods = {
|
|
7397
|
+
dispatchEvent,
|
|
7398
|
+
prev() {
|
|
7399
|
+
if (handlePrevNext(false)) {
|
|
7400
|
+
handleAutoPlay();
|
|
7401
|
+
}
|
|
7402
|
+
return nextTick();
|
|
7403
|
+
},
|
|
7404
|
+
next() {
|
|
7405
|
+
if (handlePrevNext(true)) {
|
|
7406
|
+
handleAutoPlay();
|
|
7407
|
+
}
|
|
7408
|
+
return nextTick();
|
|
7409
|
+
}
|
|
7410
|
+
};
|
|
7411
|
+
const prevEvent = (evnt) => {
|
|
7412
|
+
if (handlePrevNext(false)) {
|
|
7413
|
+
const value = reactData.activeName;
|
|
7414
|
+
emit('change', { value }, evnt);
|
|
7415
|
+
}
|
|
7416
|
+
};
|
|
7417
|
+
const nextEvent = (evnt) => {
|
|
7418
|
+
if (handlePrevNext(true)) {
|
|
7419
|
+
const value = reactData.activeName;
|
|
7420
|
+
emit('change', { value }, evnt);
|
|
7421
|
+
}
|
|
7422
|
+
};
|
|
7423
|
+
const stopAutoPlay = () => {
|
|
7424
|
+
const { apTimeout } = internalData;
|
|
7425
|
+
internalData.stopFlag = true;
|
|
7426
|
+
if (apTimeout) {
|
|
7427
|
+
clearTimeout(apTimeout);
|
|
7428
|
+
internalData.apTimeout = undefined;
|
|
7429
|
+
}
|
|
7430
|
+
};
|
|
7431
|
+
const handleAutoPlay = () => {
|
|
7432
|
+
const { autoPlay, interval } = props;
|
|
7433
|
+
const { stopFlag } = internalData;
|
|
7434
|
+
stopAutoPlay();
|
|
7435
|
+
if (autoPlay) {
|
|
7436
|
+
internalData.stopFlag = false;
|
|
7437
|
+
internalData.apTimeout = setTimeout(() => {
|
|
7438
|
+
if (!stopFlag) {
|
|
7439
|
+
handlePrevNext(true);
|
|
7440
|
+
}
|
|
7441
|
+
}, XEUtils.toNumber(interval) || 300);
|
|
7442
|
+
}
|
|
7443
|
+
};
|
|
7444
|
+
const mouseenterEvent = () => {
|
|
7445
|
+
stopAutoPlay();
|
|
7446
|
+
};
|
|
7447
|
+
const mouseleaveEvent = () => {
|
|
7448
|
+
handleAutoPlay();
|
|
7449
|
+
};
|
|
7450
|
+
const carouselPrivateMethods = {};
|
|
7451
|
+
const callSlot = (slotFunc, params) => {
|
|
7452
|
+
if (slotFunc) {
|
|
7453
|
+
if (XEUtils.isString(slotFunc)) {
|
|
7454
|
+
slotFunc = slots[slotFunc] || null;
|
|
7455
|
+
}
|
|
7456
|
+
if (XEUtils.isFunction(slotFunc)) {
|
|
7457
|
+
return getSlotVNs(slotFunc(params));
|
|
7458
|
+
}
|
|
7459
|
+
}
|
|
7460
|
+
return [];
|
|
7461
|
+
};
|
|
7462
|
+
Object.assign($xeCarousel, carouselMethods, carouselPrivateMethods);
|
|
7463
|
+
const renderItemWrapper = (list) => {
|
|
7464
|
+
const { height } = props;
|
|
7465
|
+
const { activeName } = reactData;
|
|
7466
|
+
const listStyle = computeListStyle.value;
|
|
7467
|
+
return h('div', {
|
|
7468
|
+
class: 'vxe-carousel--list',
|
|
7469
|
+
style: listStyle
|
|
7470
|
+
}, list.map(item => {
|
|
7471
|
+
const { name, url, slots } = item;
|
|
7472
|
+
const defaultSlot = slots ? slots.default : null;
|
|
7473
|
+
return h('div', {
|
|
7474
|
+
key: `${name}`,
|
|
7475
|
+
class: ['vxe-carousel--item-inner', {
|
|
7476
|
+
'is--active': activeName === name
|
|
7477
|
+
}],
|
|
7478
|
+
style: height
|
|
7479
|
+
? {
|
|
7480
|
+
height: toCssUnit(height)
|
|
7481
|
+
}
|
|
7482
|
+
: null
|
|
7483
|
+
}, defaultSlot
|
|
7484
|
+
? callSlot(defaultSlot, {})
|
|
7485
|
+
: [
|
|
7486
|
+
h('img', {
|
|
7487
|
+
class: 'vxe-carousel--item-img',
|
|
7488
|
+
src: url
|
|
7489
|
+
})
|
|
7490
|
+
]);
|
|
7491
|
+
}));
|
|
7492
|
+
};
|
|
7493
|
+
const renderIndicators = (list) => {
|
|
7494
|
+
const { activeName } = reactData;
|
|
7495
|
+
return h('div', {
|
|
7496
|
+
class: 'vxe-carousel--indicators'
|
|
7497
|
+
}, list.map((item) => {
|
|
7498
|
+
const { name } = item;
|
|
7499
|
+
return h('div', {
|
|
7500
|
+
key: `${name}`,
|
|
7501
|
+
class: ['vxe-carousel--indicators-item', {
|
|
7502
|
+
'is--active': activeName === name
|
|
7503
|
+
}],
|
|
7504
|
+
onClick(evnt) {
|
|
7505
|
+
clickItemEvent(evnt, item);
|
|
7506
|
+
}
|
|
7507
|
+
});
|
|
7508
|
+
}));
|
|
7509
|
+
};
|
|
7510
|
+
const renderVN = () => {
|
|
7511
|
+
const { loading, height, width, showIndicators, vertical, options } = props;
|
|
7512
|
+
const { staticItems } = reactData;
|
|
7513
|
+
const defaultSlot = slots.default;
|
|
7514
|
+
const list = (staticItems && staticItems.length ? staticItems : options) || [];
|
|
7515
|
+
return h('div', {
|
|
7516
|
+
ref: refElem,
|
|
7517
|
+
class: ['vxe-carousel', `is--${vertical ? 'vertical' : 'horizontal'}`],
|
|
7518
|
+
style: width
|
|
7519
|
+
? {
|
|
7520
|
+
width: toCssUnit(width)
|
|
7521
|
+
}
|
|
7522
|
+
: null,
|
|
7523
|
+
onMouseenter: mouseenterEvent,
|
|
7524
|
+
onMouseleave: mouseleaveEvent
|
|
7525
|
+
}, [
|
|
7526
|
+
h('div', {
|
|
7527
|
+
class: 'vxe-carousel--slots'
|
|
7528
|
+
}, defaultSlot ? defaultSlot({}) : []),
|
|
7529
|
+
h('div', {
|
|
7530
|
+
ref: refWrapperElem,
|
|
7531
|
+
class: 'vxe-carousel--item-wrapper',
|
|
7532
|
+
style: height
|
|
7533
|
+
? {
|
|
7534
|
+
height: toCssUnit(height)
|
|
7535
|
+
}
|
|
7536
|
+
: null
|
|
7537
|
+
}, [
|
|
7538
|
+
renderItemWrapper(list)
|
|
7539
|
+
]),
|
|
7540
|
+
showIndicators ? renderIndicators(list) : renderEmptyElement$1($xeCarousel),
|
|
7541
|
+
h('div', {
|
|
7542
|
+
class: 'vxe-carousel--btn-wrapper'
|
|
7543
|
+
}, [
|
|
7544
|
+
h('div', {
|
|
7545
|
+
class: 'vxe-carousel--previous-btn',
|
|
7546
|
+
onClick: prevEvent
|
|
7547
|
+
}, [
|
|
7548
|
+
h('i', {
|
|
7549
|
+
class: vertical ? getIcon$2().CAROUSEL_VERTICAL_PREVIOUS : getIcon$2().CAROUSEL_HORIZONTAL_PREVIOUS
|
|
7550
|
+
})
|
|
7551
|
+
]),
|
|
7552
|
+
h('div', {
|
|
7553
|
+
class: 'vxe-carousel--next-btn',
|
|
7554
|
+
onClick: nextEvent
|
|
7555
|
+
}, [
|
|
7556
|
+
h('i', {
|
|
7557
|
+
class: vertical ? getIcon$2().CAROUSEL_VERTICAL_NEXT : getIcon$2().CAROUSEL_HORIZONTAL_NEXT
|
|
7558
|
+
})
|
|
7559
|
+
])
|
|
7560
|
+
]),
|
|
7561
|
+
/**
|
|
7562
|
+
* 加载中
|
|
7563
|
+
*/
|
|
7564
|
+
h(VxeLoading, {
|
|
7565
|
+
class: 'vxe-carousel--loading',
|
|
7566
|
+
modelValue: loading
|
|
7567
|
+
})
|
|
7568
|
+
]);
|
|
7569
|
+
};
|
|
7570
|
+
const optsFlag = ref(0);
|
|
7571
|
+
watch(() => props.options ? props.options.length : -1, () => {
|
|
7572
|
+
optsFlag.value++;
|
|
7573
|
+
});
|
|
7574
|
+
watch(() => props.options, () => {
|
|
7575
|
+
optsFlag.value++;
|
|
7576
|
+
});
|
|
7577
|
+
watch(optsFlag, () => {
|
|
7578
|
+
initDefaultActive(props.options);
|
|
7579
|
+
});
|
|
7580
|
+
const stFlag = ref(0);
|
|
7581
|
+
watch(() => reactData.staticItems ? reactData.staticItems.length : -1, () => {
|
|
7582
|
+
stFlag.value++;
|
|
7583
|
+
});
|
|
7584
|
+
watch(() => reactData.staticItems, () => {
|
|
7585
|
+
stFlag.value++;
|
|
7586
|
+
});
|
|
7587
|
+
watch(stFlag, () => {
|
|
7588
|
+
initDefaultActive(reactData.staticItems);
|
|
7589
|
+
});
|
|
7590
|
+
watch(() => props.autoPlay, () => {
|
|
7591
|
+
handleAutoPlay();
|
|
7592
|
+
});
|
|
7593
|
+
initDefaultActive(reactData.staticItems.length ? reactData.staticItems : props.options);
|
|
7594
|
+
onMounted(() => {
|
|
7595
|
+
handleAutoPlay();
|
|
7596
|
+
updateStyle();
|
|
7597
|
+
});
|
|
7598
|
+
onUnmounted(() => {
|
|
7599
|
+
stopAutoPlay();
|
|
7600
|
+
});
|
|
7601
|
+
provide('$xeCarousel', $xeCarousel);
|
|
7602
|
+
$xeCarousel.renderVN = renderVN;
|
|
7603
|
+
return $xeCarousel;
|
|
7604
|
+
},
|
|
7605
|
+
render() {
|
|
7606
|
+
return this.renderVN();
|
|
7607
|
+
}
|
|
7608
|
+
});
|
|
7609
|
+
|
|
7610
|
+
const VxeCarousel = Object.assign({}, VxeCarouselComponent, {
|
|
7611
|
+
install(app) {
|
|
7612
|
+
app.component(VxeCarouselComponent.name, VxeCarouselComponent);
|
|
7613
|
+
}
|
|
7614
|
+
});
|
|
7615
|
+
dynamicApp.use(VxeCarousel);
|
|
7616
|
+
VxeUI.component(VxeCarouselComponent);
|
|
7617
|
+
const Carousel = VxeCarousel;
|
|
7618
|
+
|
|
7619
|
+
function assembleCarouselItem($xeCarousel, elem, itemConfig) {
|
|
7620
|
+
const staticItems = $xeCarousel.reactData.staticItems;
|
|
7621
|
+
const parentElem = elem.parentNode;
|
|
7622
|
+
if (parentElem) {
|
|
7623
|
+
staticItems.splice(XEUtils.arrayIndexOf(parentElem.children, elem), 0, itemConfig);
|
|
7624
|
+
}
|
|
7625
|
+
$xeCarousel.reactData.staticItems = staticItems.slice(0);
|
|
7626
|
+
}
|
|
7627
|
+
function destroyCarouselItem($xeCarousel, itemConfig) {
|
|
7628
|
+
const staticItems = $xeCarousel.reactData.staticItems;
|
|
7629
|
+
const index = XEUtils.findIndexOf(staticItems, item => item.id === itemConfig.id);
|
|
7630
|
+
if (index > -1) {
|
|
7631
|
+
staticItems.splice(index, 1);
|
|
7632
|
+
}
|
|
7633
|
+
$xeCarousel.reactData.staticItems = staticItems.slice(0);
|
|
7634
|
+
}
|
|
7635
|
+
|
|
7636
|
+
var VxeCarouselItemComponent = defineVxeComponent({
|
|
7637
|
+
name: 'VxeCarouselItem',
|
|
7638
|
+
props: {
|
|
7639
|
+
name: [String, Number],
|
|
7640
|
+
className: String,
|
|
7641
|
+
url: String
|
|
7642
|
+
},
|
|
7643
|
+
emits: [],
|
|
7644
|
+
setup(props, context) {
|
|
7645
|
+
const { slots, emit } = context;
|
|
7646
|
+
const $xeCarousel = inject('$xeCarousel', null);
|
|
7647
|
+
const xID = XEUtils.uniqueId();
|
|
7648
|
+
const refElem = ref();
|
|
7649
|
+
const reactData = reactive({});
|
|
7650
|
+
const itemConfig = reactive({
|
|
7651
|
+
id: xID,
|
|
7652
|
+
name: props.name,
|
|
7653
|
+
url: props.url,
|
|
7654
|
+
className: props.className,
|
|
7655
|
+
slots
|
|
7656
|
+
});
|
|
7657
|
+
const refMaps = {
|
|
7658
|
+
refElem
|
|
7659
|
+
};
|
|
7660
|
+
const computeMaps = {};
|
|
7661
|
+
const $xeCarouselItem = {
|
|
7662
|
+
xID,
|
|
7663
|
+
props,
|
|
7664
|
+
context,
|
|
7665
|
+
reactData,
|
|
7666
|
+
getRefMaps: () => refMaps,
|
|
7667
|
+
getComputeMaps: () => computeMaps
|
|
7668
|
+
};
|
|
7669
|
+
const dispatchEvent = (type, params, evnt) => {
|
|
7670
|
+
emit(type, createEvent$1(evnt, { $carouselItem: $xeCarouselItem }, params));
|
|
7671
|
+
};
|
|
7672
|
+
const carouselItemMethods = {
|
|
7673
|
+
dispatchEvent
|
|
7674
|
+
};
|
|
7675
|
+
const carouselItemPrivateMethods = {};
|
|
7676
|
+
Object.assign($xeCarouselItem, carouselItemMethods, carouselItemPrivateMethods);
|
|
7677
|
+
const renderVN = () => {
|
|
7678
|
+
return h('div', {
|
|
7679
|
+
ref: refElem
|
|
7680
|
+
});
|
|
7681
|
+
};
|
|
7682
|
+
watch(() => props.name, (val) => {
|
|
7683
|
+
itemConfig.name = val;
|
|
7684
|
+
});
|
|
7685
|
+
watch(() => props.url, (val) => {
|
|
7686
|
+
itemConfig.url = val;
|
|
7687
|
+
});
|
|
7688
|
+
onMounted(() => {
|
|
7689
|
+
const elem = refElem.value;
|
|
7690
|
+
if ($xeCarousel && elem) {
|
|
7691
|
+
assembleCarouselItem($xeCarousel, elem, itemConfig);
|
|
7692
|
+
}
|
|
7693
|
+
});
|
|
7694
|
+
onUnmounted(() => {
|
|
7695
|
+
if ($xeCarousel) {
|
|
7696
|
+
destroyCarouselItem($xeCarousel, itemConfig);
|
|
7697
|
+
}
|
|
7698
|
+
});
|
|
7699
|
+
$xeCarouselItem.renderVN = renderVN;
|
|
7700
|
+
return $xeCarouselItem;
|
|
7701
|
+
},
|
|
7702
|
+
render() {
|
|
7703
|
+
return this.renderVN();
|
|
7704
|
+
}
|
|
7705
|
+
});
|
|
7706
|
+
|
|
7707
|
+
const VxeCarouselItem = Object.assign({}, VxeCarouselItemComponent, {
|
|
7708
|
+
install(app) {
|
|
7709
|
+
app.component(VxeCarouselItemComponent.name, VxeCarouselItemComponent);
|
|
7710
|
+
}
|
|
7711
|
+
});
|
|
7712
|
+
dynamicApp.use(VxeCarouselItem);
|
|
7713
|
+
VxeUI.component(VxeCarouselItemComponent);
|
|
7714
|
+
const CarouselItem = VxeCarouselItem;
|
|
7715
|
+
|
|
7716
|
+
function enNodeValue(nodeid) {
|
|
7717
|
+
return XEUtils.eqNull(nodeid) ? '' : encodeURIComponent(`${nodeid}`);
|
|
7718
|
+
}
|
|
7719
|
+
function deNodeValue(nodeid) {
|
|
7720
|
+
return nodeid ? decodeURIComponent(`${nodeid}`) : nodeid;
|
|
7721
|
+
}
|
|
7722
|
+
|
|
7723
|
+
// 跨列表拖拽
|
|
7724
|
+
const crossListDragRowInfo = reactive({
|
|
7725
|
+
row: null
|
|
7726
|
+
});
|
|
7727
|
+
function getCrossListDragRowInfo() {
|
|
7728
|
+
return crossListDragRowInfo;
|
|
7729
|
+
}
|
|
7730
|
+
|
|
7731
|
+
const rowMoveCls = 'row--drag-move';
|
|
7732
|
+
/**
|
|
7733
|
+
* 上下拖拽
|
|
7734
|
+
*/
|
|
7735
|
+
function moveRowAnimateToTb(elemList, offsetTop) {
|
|
7736
|
+
XEUtils.arrayEach(elemList, trEl => {
|
|
7737
|
+
trEl.style.transform = `translateY(${offsetTop}px)`;
|
|
7738
|
+
});
|
|
7739
|
+
requestAnimationFrame(() => {
|
|
7740
|
+
XEUtils.arrayEach(elemList, trEl => {
|
|
7741
|
+
addClass(trEl, rowMoveCls);
|
|
7742
|
+
trEl.style.transform = '';
|
|
7743
|
+
});
|
|
7744
|
+
});
|
|
7745
|
+
}
|
|
7746
|
+
function clearRowAnimate(elem, clss) {
|
|
7747
|
+
setTimeout(() => {
|
|
7748
|
+
if (elem) {
|
|
7749
|
+
XEUtils.arrayEach(elem.querySelectorAll(clss.map(cls => `${cls}.${rowMoveCls}`).join(',')), elem => removeClass(elem, rowMoveCls));
|
|
7750
|
+
}
|
|
7751
|
+
}, 500);
|
|
7752
|
+
}
|
|
7753
|
+
|
|
7754
|
+
function getItemCacheObj$1(item) {
|
|
7755
|
+
return {
|
|
7756
|
+
item,
|
|
7757
|
+
index: -1,
|
|
7758
|
+
$index: -1,
|
|
7759
|
+
_index: -1
|
|
7760
|
+
};
|
|
7761
|
+
}
|
|
7762
|
+
|
|
7763
|
+
const { warnLog: warnLog$h, errLog: errLog$j } = createComponentLog('tree');
|
|
7764
|
+
function getRowKeyByField(row, keyField) {
|
|
7765
|
+
return row ? ('' + (row[keyField] || '')) : '';
|
|
7766
|
+
}
|
|
7767
|
+
function getRowIdByField(row, keyField) {
|
|
7768
|
+
if (!row) {
|
|
7769
|
+
return '';
|
|
7770
|
+
}
|
|
7771
|
+
const rowKey = getRowKeyByField(row, keyField);
|
|
7772
|
+
return enModelValue(rowKey);
|
|
7773
|
+
}
|
|
7774
|
+
function createReactData$m() {
|
|
7775
|
+
return {
|
|
7776
|
+
scrollYLoad: false,
|
|
7777
|
+
bodyHeight: 0,
|
|
7778
|
+
headHeight: 0,
|
|
7779
|
+
footHeight: 0,
|
|
7780
|
+
customHeight: 0,
|
|
7781
|
+
customMaxHeight: 0,
|
|
7782
|
+
parentHeight: 0,
|
|
7783
|
+
topSpaceHeight: 0,
|
|
7784
|
+
rowList: [],
|
|
7785
|
+
selectRadioRow: null,
|
|
7786
|
+
currRowFlag: 1,
|
|
7787
|
+
updateCheckboxFlag: 1,
|
|
7788
|
+
isAllChecked: false,
|
|
7789
|
+
isAllIndeterminate: false,
|
|
7790
|
+
// 滚动条
|
|
7791
|
+
yThumbHeight: 0,
|
|
7792
|
+
xThumbWidth: 0,
|
|
7793
|
+
insertRowFlag: 1,
|
|
7794
|
+
removeRowFlag: 1,
|
|
7795
|
+
dragRow: null,
|
|
7796
|
+
dragTipText: '',
|
|
7797
|
+
isCrossDragRow: false
|
|
7798
|
+
};
|
|
7799
|
+
}
|
|
7800
|
+
function createInternalData$l() {
|
|
7801
|
+
return {
|
|
7802
|
+
fullData: [],
|
|
7803
|
+
afterList: [],
|
|
7804
|
+
fullKeyMaps: {},
|
|
7805
|
+
rowMaps: {},
|
|
7806
|
+
// 滚动条
|
|
7807
|
+
// resizeObserver: undefined,
|
|
7808
|
+
// isThumbDrag: false,
|
|
7809
|
+
thumbDragOffset: 0,
|
|
7810
|
+
yThumbTop: 0,
|
|
7811
|
+
xThumbLeft: 0,
|
|
7812
|
+
lastScrollTop: 0,
|
|
7813
|
+
lastScrollLeft: 0,
|
|
7814
|
+
scrollYStore: {
|
|
7815
|
+
startIndex: 0,
|
|
7816
|
+
endIndex: 0,
|
|
7817
|
+
visibleSize: 0,
|
|
7818
|
+
offsetSize: 0,
|
|
7819
|
+
rowHeight: 0
|
|
7820
|
+
},
|
|
7821
|
+
currentRow: null,
|
|
7822
|
+
selectCheckboxMaps: {},
|
|
7823
|
+
insertRowMaps: {},
|
|
7824
|
+
removeRowMaps: {}
|
|
7825
|
+
// prevDragRow: null,
|
|
7826
|
+
// prevDragPos: ''
|
|
7827
|
+
};
|
|
7828
|
+
}
|
|
7829
|
+
let crossListDragRowObj = null;
|
|
7830
|
+
var VxeListComponent = defineVxeComponent({
|
|
7831
|
+
name: 'VxeList',
|
|
7832
|
+
props: {
|
|
7833
|
+
data: Array,
|
|
7834
|
+
height: [Number, String],
|
|
7835
|
+
maxHeight: [Number, String],
|
|
7836
|
+
loading: Boolean,
|
|
7837
|
+
className: [String, Function],
|
|
7838
|
+
size: {
|
|
7839
|
+
type: String,
|
|
7840
|
+
default: () => getConfig$4().list.size || getConfig$4().size
|
|
7841
|
+
},
|
|
7842
|
+
autoResize: {
|
|
7843
|
+
type: Boolean,
|
|
7844
|
+
default: () => getConfig$4().list.autoResize
|
|
7845
|
+
},
|
|
7846
|
+
syncResize: [Boolean, String, Number],
|
|
7847
|
+
showSeq: {
|
|
7848
|
+
type: Boolean,
|
|
7849
|
+
default: () => getConfig$4().list.showSeq
|
|
7850
|
+
},
|
|
7851
|
+
showRadio: {
|
|
7852
|
+
type: Boolean,
|
|
7853
|
+
default: () => getConfig$4().list.showRadio
|
|
7854
|
+
},
|
|
7855
|
+
checkRowKey: [String, Number],
|
|
7856
|
+
radioConfig: Object,
|
|
7857
|
+
showCheckbox: {
|
|
7858
|
+
type: Boolean,
|
|
7859
|
+
default: () => getConfig$4().list.showCheckbox
|
|
7860
|
+
},
|
|
7861
|
+
checkRowKeys: Array,
|
|
7862
|
+
checkboxConfig: Object,
|
|
7863
|
+
rowConfig: Object,
|
|
7864
|
+
dragConfig: Object,
|
|
7865
|
+
menuConfig: Object,
|
|
7866
|
+
virtualYConfig: Object,
|
|
7867
|
+
scrollY: Object,
|
|
7868
|
+
useScrollbar: {
|
|
7869
|
+
type: Boolean,
|
|
7870
|
+
default: () => getConfig$4().list.useScrollbar
|
|
7871
|
+
},
|
|
7872
|
+
scrollbarConfig: Object
|
|
7873
|
+
},
|
|
7874
|
+
emits: [
|
|
7875
|
+
'update:checkRowKey',
|
|
7876
|
+
'update:checkRowKeys',
|
|
7877
|
+
'row-click',
|
|
7878
|
+
'row-dblclick',
|
|
7879
|
+
'current-change',
|
|
7880
|
+
'radio-change',
|
|
7881
|
+
'checkbox-change',
|
|
7882
|
+
'checkbox-all',
|
|
7883
|
+
'scroll',
|
|
7884
|
+
'row-dragstart',
|
|
7885
|
+
'row-dragover',
|
|
7886
|
+
'row-dragend',
|
|
7887
|
+
'row-remove-dragend',
|
|
7888
|
+
'row-insert-dragend',
|
|
7889
|
+
'row-menu',
|
|
7890
|
+
'menu-click'
|
|
7891
|
+
],
|
|
7892
|
+
setup(props, context) {
|
|
7893
|
+
const { slots, emit } = context;
|
|
7894
|
+
const xID = XEUtils.uniqueId();
|
|
7895
|
+
const browseObj = XEUtils.browse();
|
|
7896
|
+
const { computeSize } = useSize(props);
|
|
7897
|
+
const reactData = reactive(createReactData$m());
|
|
7898
|
+
const internalData = createInternalData$l();
|
|
7899
|
+
const crossListDragRowInfo = getCrossListDragRowInfo();
|
|
7900
|
+
const refElem = ref();
|
|
7901
|
+
const refHeaderElem = ref();
|
|
7902
|
+
const refFooterElem = ref();
|
|
7903
|
+
const refVirtualWrapper = ref();
|
|
7904
|
+
const refVirtualBody = ref();
|
|
7905
|
+
const refViewInnerElem = ref();
|
|
7906
|
+
const refTrackXElem = ref();
|
|
7907
|
+
const refTrackYElem = ref();
|
|
7908
|
+
const refThumbXElem = ref();
|
|
7909
|
+
const refThumbYElem = ref();
|
|
7910
|
+
const refDragRowLineElem = ref();
|
|
7911
|
+
const refDragTipElem = ref();
|
|
7912
|
+
const refMaps = {
|
|
7913
|
+
refElem
|
|
7914
|
+
};
|
|
7915
|
+
const $xeList = {
|
|
7916
|
+
xID,
|
|
7917
|
+
props,
|
|
7918
|
+
context,
|
|
7919
|
+
reactData,
|
|
7920
|
+
internalData,
|
|
7921
|
+
getRefMaps: () => refMaps
|
|
7922
|
+
};
|
|
7923
|
+
const computeRowOpts = computed(() => {
|
|
7924
|
+
return Object.assign({}, getConfig$4().list.rowConfig, props.rowConfig);
|
|
7925
|
+
});
|
|
7926
|
+
const computeDragOpts = computed(() => {
|
|
7927
|
+
return Object.assign({}, getConfig$4().list.dragConfig, props.dragConfig);
|
|
7928
|
+
});
|
|
7929
|
+
const computeSYOpts = computed(() => {
|
|
7930
|
+
return Object.assign({}, getConfig$4().list.virtualYConfig || getConfig$4().list.scrollY, props.virtualYConfig || props.scrollY);
|
|
7931
|
+
});
|
|
7932
|
+
const computeKeyField = computed(() => {
|
|
7933
|
+
const rowOpts = computeRowOpts.value;
|
|
7934
|
+
const { keyField } = rowOpts;
|
|
7935
|
+
return keyField || '';
|
|
7936
|
+
});
|
|
7937
|
+
const computeIsDrag = computed(() => {
|
|
7938
|
+
const { dragConfig } = props;
|
|
7939
|
+
const dragOpts = computeDragOpts.value;
|
|
7940
|
+
return dragConfig && isEnableConf(dragOpts);
|
|
7941
|
+
});
|
|
7942
|
+
const computeRowHeight = computed(() => {
|
|
7943
|
+
const rowOpts = computeRowOpts.value;
|
|
7944
|
+
const { height } = rowOpts;
|
|
7945
|
+
return height;
|
|
7946
|
+
});
|
|
7947
|
+
const computeRadioOpts = computed(() => {
|
|
7948
|
+
return Object.assign({ showIcon: true }, getConfig$4().list.radioConfig, props.radioConfig);
|
|
7949
|
+
});
|
|
7950
|
+
const computeCheckboxOpts = computed(() => {
|
|
7951
|
+
return Object.assign({ showIcon: true }, getConfig$4().list.checkboxConfig, props.checkboxConfig);
|
|
7952
|
+
});
|
|
7953
|
+
const computeMenuOpts = computed(() => {
|
|
7954
|
+
return Object.assign({}, getConfig$4().list.menuConfig, props.menuConfig);
|
|
7955
|
+
});
|
|
7956
|
+
const computeWrapperStyles = computed(() => {
|
|
7957
|
+
const rowHeight = computeRowHeight.value;
|
|
7958
|
+
const scrollbarXOpts = computeScrollbarXOpts.value;
|
|
7959
|
+
const scrollbarYOpts = computeScrollbarYOpts.value;
|
|
7960
|
+
const stys = {};
|
|
7961
|
+
if (rowHeight) {
|
|
7962
|
+
stys['--vxe-ui-list-row-height'] = toCssUnit(rowHeight);
|
|
7963
|
+
}
|
|
7964
|
+
if (scrollbarYOpts.width) {
|
|
7965
|
+
stys['--vxe-ui-scrollbar-y-width'] = toCssUnit(scrollbarYOpts.width);
|
|
7966
|
+
}
|
|
7967
|
+
if (scrollbarXOpts.height) {
|
|
7968
|
+
stys['--vxe-ui-scrollbar-x-height'] = toCssUnit(scrollbarXOpts.height);
|
|
7969
|
+
}
|
|
7970
|
+
return stys;
|
|
7971
|
+
});
|
|
7972
|
+
const computeVirtualStyles = computed(() => {
|
|
7973
|
+
const { height, maxHeight } = props;
|
|
7974
|
+
const { customHeight, customMaxHeight, headHeight, footHeight } = reactData;
|
|
7975
|
+
const style = {};
|
|
7976
|
+
if (height) {
|
|
7977
|
+
style.height = toCssUnit(Math.max(20, customHeight - headHeight - footHeight));
|
|
7978
|
+
}
|
|
7979
|
+
else if (maxHeight) {
|
|
7980
|
+
style.height = 'auto';
|
|
7981
|
+
style.maxHeight = toCssUnit(Math.max(20, customMaxHeight - headHeight - footHeight));
|
|
7982
|
+
}
|
|
7983
|
+
return style;
|
|
7984
|
+
});
|
|
7985
|
+
const computeScrollbarOpts = computed(() => {
|
|
7986
|
+
return Object.assign({}, getConfig$4().list.scrollbarConfig, props.scrollbarConfig);
|
|
7987
|
+
});
|
|
7988
|
+
const computeScrollbarXOpts = computed(() => {
|
|
7989
|
+
const scrollbarOpts = computeScrollbarOpts.value;
|
|
7990
|
+
return Object.assign({}, getConfig$4().scrollbar.xConfig, scrollbarOpts.xConfig);
|
|
7991
|
+
});
|
|
7992
|
+
const computeScrollbarYOpts = computed(() => {
|
|
7993
|
+
const scrollbarOpts = computeScrollbarOpts.value;
|
|
7994
|
+
return Object.assign({}, getConfig$4().scrollbar.yConfig, scrollbarOpts.yConfig);
|
|
7995
|
+
});
|
|
7996
|
+
const computeScrollbarWrapperClss = computed(() => {
|
|
7997
|
+
const scrollbarOpts = computeScrollbarOpts.value;
|
|
7998
|
+
const { padding } = scrollbarOpts;
|
|
7999
|
+
const { yThumbHeight, xThumbWidth } = reactData;
|
|
8000
|
+
const scrollbarXOpts = computeScrollbarXOpts.value;
|
|
8001
|
+
const scrollbarYOpts = computeScrollbarYOpts.value;
|
|
8002
|
+
const scrollbarXToTop = computeScrollbarXToTop.value;
|
|
8003
|
+
const scrollbarYToLeft = computeScrollbarYToLeft.value;
|
|
8004
|
+
return domUtils$1.buildClass([
|
|
8005
|
+
'vxe-scrollbar is--virtual',
|
|
8006
|
+
`ov-x--${scrollbarXOpts.visible || 'visible'}`,
|
|
8007
|
+
`ov-y--${scrollbarYOpts.visible || 'visible'}`,
|
|
8008
|
+
`sx-pos--${scrollbarXToTop ? 'top' : 'bottom'}`,
|
|
8009
|
+
`sy-pos--${scrollbarYToLeft ? 'left' : 'right'}`
|
|
8010
|
+
], {
|
|
8011
|
+
'is--padding': padding,
|
|
8012
|
+
'ov-x--auto-hide': scrollbarXOpts.autoHide,
|
|
8013
|
+
'ov-y--auto-hide': scrollbarYOpts.autoHide,
|
|
8014
|
+
'overflow-y': yThumbHeight,
|
|
8015
|
+
'overflow-x': xThumbWidth
|
|
8016
|
+
});
|
|
8017
|
+
});
|
|
8018
|
+
const computeScrollbarXToTop = computed(() => {
|
|
8019
|
+
const scrollbarXOpts = computeScrollbarXOpts.value;
|
|
8020
|
+
return scrollbarXOpts.position === 'top';
|
|
8021
|
+
});
|
|
8022
|
+
const computeScrollbarYToLeft = computed(() => {
|
|
8023
|
+
const scrollbarYOpts = computeScrollbarYOpts.value;
|
|
8024
|
+
return scrollbarYOpts.position === 'left';
|
|
8025
|
+
});
|
|
8026
|
+
const dispatchEvent = (type, params, evnt) => {
|
|
8027
|
+
emit(type, createEvent$1(evnt, { $list: $xeList }, params));
|
|
8028
|
+
};
|
|
8029
|
+
const emitCheckboxMode = (value) => {
|
|
8030
|
+
emit('update:checkRowKeys', value);
|
|
8031
|
+
};
|
|
8032
|
+
const emitRadioMode = (value) => {
|
|
8033
|
+
emit('update:checkRowKey', value);
|
|
8034
|
+
};
|
|
8035
|
+
const getRowId = (row) => {
|
|
8036
|
+
const keyField = computeKeyField.value;
|
|
8037
|
+
return getRowIdByField(row, keyField);
|
|
8038
|
+
};
|
|
8039
|
+
const calcTableHeight = (key) => {
|
|
8040
|
+
const { parentHeight } = reactData;
|
|
8041
|
+
const val = props[key];
|
|
8042
|
+
let num = 0;
|
|
8043
|
+
if (val) {
|
|
8044
|
+
if (val === '100%' || val === 'auto') {
|
|
8045
|
+
num = parentHeight;
|
|
8046
|
+
}
|
|
8047
|
+
else {
|
|
8048
|
+
if (isScale(val)) {
|
|
8049
|
+
num = Math.floor((XEUtils.toInteger(val) || 1) / 100 * parentHeight);
|
|
8050
|
+
}
|
|
8051
|
+
else {
|
|
8052
|
+
num = XEUtils.toNumber(val);
|
|
8053
|
+
}
|
|
8054
|
+
num = Math.max(40, num);
|
|
8055
|
+
}
|
|
8056
|
+
}
|
|
8057
|
+
return num;
|
|
8058
|
+
};
|
|
7311
8059
|
const updateHeight = () => {
|
|
7312
8060
|
const headEl = refHeaderElem.value;
|
|
7313
8061
|
const footEl = refFooterElem.value;
|
|
@@ -7431,6 +8179,7 @@ var VxeListComponent = defineVxeComponent({
|
|
|
7431
8179
|
*/
|
|
7432
8180
|
const refreshScroll = () => {
|
|
7433
8181
|
const { lastScrollLeft, lastScrollTop } = internalData;
|
|
8182
|
+
updateScrollbar();
|
|
7434
8183
|
return clearScroll().then(() => {
|
|
7435
8184
|
if (lastScrollLeft || lastScrollTop) {
|
|
7436
8185
|
internalData.lastScrollLeft = 0;
|
|
@@ -7439,19 +8188,28 @@ var VxeListComponent = defineVxeComponent({
|
|
|
7439
8188
|
}
|
|
7440
8189
|
});
|
|
7441
8190
|
};
|
|
8191
|
+
const updateScrollbar = () => {
|
|
8192
|
+
updateThumbSize();
|
|
8193
|
+
updateThumbOffset();
|
|
8194
|
+
};
|
|
7442
8195
|
/**
|
|
7443
8196
|
* 重新计算列表
|
|
7444
8197
|
*/
|
|
7445
8198
|
const recalculate = () => {
|
|
7446
8199
|
const el = refElem.value;
|
|
7447
8200
|
if (el) {
|
|
7448
|
-
|
|
8201
|
+
let parentEl = el.parentElement;
|
|
7449
8202
|
let parentHeight = 0;
|
|
8203
|
+
// 如果是虚拟滚动条
|
|
8204
|
+
if (parentEl && hasClass(parentEl, 'vxe-scrollbar--view-inner')) {
|
|
8205
|
+
parentEl = parentEl.parentElement;
|
|
8206
|
+
}
|
|
7450
8207
|
if (parentEl) {
|
|
7451
8208
|
const parentStyle = getComputedStyle(parentEl);
|
|
7452
8209
|
parentHeight = parentEl.clientHeight - Math.ceil(XEUtils.toNumber(parentStyle.paddingLeft) + XEUtils.toNumber(parentStyle.paddingRight));
|
|
7453
8210
|
}
|
|
7454
8211
|
reactData.parentHeight = parentHeight;
|
|
8212
|
+
updateScrollbar();
|
|
7455
8213
|
updateHeight();
|
|
7456
8214
|
if (el.clientWidth && el.clientHeight) {
|
|
7457
8215
|
return computeScrollLoad();
|
|
@@ -7481,6 +8239,7 @@ var VxeListComponent = defineVxeComponent({
|
|
|
7481
8239
|
const scrollLeft = scrollBodyElem.scrollLeft;
|
|
7482
8240
|
const isX = scrollLeft !== internalData.lastScrollLeft;
|
|
7483
8241
|
const isY = scrollTop !== internalData.lastScrollTop;
|
|
8242
|
+
updateThumbOffset();
|
|
7484
8243
|
internalData.lastScrollTop = scrollTop;
|
|
7485
8244
|
internalData.lastScrollLeft = scrollLeft;
|
|
7486
8245
|
if (reactData.scrollYLoad) {
|
|
@@ -8777,6 +9536,162 @@ var VxeListComponent = defineVxeComponent({
|
|
|
8777
9536
|
hideDropTip();
|
|
8778
9537
|
}
|
|
8779
9538
|
};
|
|
9539
|
+
const updateThumbSize = () => {
|
|
9540
|
+
const viewEl = refVirtualWrapper.value;
|
|
9541
|
+
if (!viewEl) {
|
|
9542
|
+
return;
|
|
9543
|
+
}
|
|
9544
|
+
if (!viewEl.clientHeight || !viewEl.clientHeight) {
|
|
9545
|
+
return;
|
|
9546
|
+
}
|
|
9547
|
+
const trackXEl = refTrackXElem.value;
|
|
9548
|
+
const xThumbWidth = trackXEl ? getThumbSize(viewEl.clientWidth, viewEl.scrollWidth, trackXEl.clientWidth) : 0;
|
|
9549
|
+
const thumbXElem = refThumbXElem.value;
|
|
9550
|
+
if (thumbXElem) {
|
|
9551
|
+
thumbXElem.style.width = xThumbWidth + 'px';
|
|
9552
|
+
}
|
|
9553
|
+
reactData.xThumbWidth = xThumbWidth;
|
|
9554
|
+
const trackYEl = refTrackYElem.value;
|
|
9555
|
+
const yThumbHeight = trackYEl ? getThumbSize(viewEl.clientHeight, viewEl.scrollHeight, trackYEl.clientHeight) : 0;
|
|
9556
|
+
const thumbYElem = refThumbYElem.value;
|
|
9557
|
+
if (thumbYElem) {
|
|
9558
|
+
thumbYElem.style.height = yThumbHeight + 'px';
|
|
9559
|
+
}
|
|
9560
|
+
reactData.yThumbHeight = yThumbHeight;
|
|
9561
|
+
};
|
|
9562
|
+
const updateThumbOffset = () => {
|
|
9563
|
+
const viewEl = refVirtualWrapper.value;
|
|
9564
|
+
if (!viewEl) {
|
|
9565
|
+
return;
|
|
9566
|
+
}
|
|
9567
|
+
if (!viewEl.clientHeight || !viewEl.clientHeight) {
|
|
9568
|
+
return;
|
|
9569
|
+
}
|
|
9570
|
+
const { xThumbWidth, yThumbHeight } = reactData;
|
|
9571
|
+
const trackXEl = refTrackXElem.value;
|
|
9572
|
+
const thumbXElem = refThumbXElem.value;
|
|
9573
|
+
const xThumbLeft = trackXEl && xThumbWidth ? getThumbOffsetSize(viewEl.scrollLeft, viewEl.clientWidth, viewEl.scrollWidth, trackXEl.clientWidth, xThumbWidth) : 0;
|
|
9574
|
+
internalData.xThumbLeft = xThumbLeft;
|
|
9575
|
+
if (thumbXElem && xThumbWidth) {
|
|
9576
|
+
thumbXElem.style.width = xThumbWidth + 'px';
|
|
9577
|
+
thumbXElem.style.transform = `translateX(${xThumbLeft}px)`;
|
|
9578
|
+
}
|
|
9579
|
+
const trackYEl = refTrackYElem.value;
|
|
9580
|
+
const thumbYElem = refThumbYElem.value;
|
|
9581
|
+
const yThumbTop = trackYEl && yThumbHeight ? getThumbOffsetSize(viewEl.scrollTop, viewEl.clientHeight, viewEl.scrollHeight, trackYEl.clientHeight, yThumbHeight) : 0;
|
|
9582
|
+
internalData.yThumbTop = yThumbTop;
|
|
9583
|
+
if (thumbYElem && yThumbHeight) {
|
|
9584
|
+
thumbYElem.style.height = yThumbHeight + 'px';
|
|
9585
|
+
thumbYElem.style.transform = `translateY(${yThumbTop}px)`;
|
|
9586
|
+
}
|
|
9587
|
+
};
|
|
9588
|
+
const clickTrackXEvent = (evnt) => {
|
|
9589
|
+
const trackEl = evnt.currentTarget;
|
|
9590
|
+
if (trackEl !== evnt.target) {
|
|
9591
|
+
return;
|
|
9592
|
+
}
|
|
9593
|
+
const viewEl = refVirtualWrapper.value;
|
|
9594
|
+
if (!viewEl) {
|
|
9595
|
+
return;
|
|
9596
|
+
}
|
|
9597
|
+
const { xThumbWidth } = reactData;
|
|
9598
|
+
const trackRect = trackEl.getBoundingClientRect();
|
|
9599
|
+
viewEl.scrollTo({
|
|
9600
|
+
left: getScrollFromClick(evnt.clientX - trackRect.left, viewEl.clientWidth, viewEl.scrollWidth, trackEl.clientWidth, xThumbWidth),
|
|
9601
|
+
behavior: 'auto'
|
|
9602
|
+
});
|
|
9603
|
+
};
|
|
9604
|
+
const clickTrackYEvent = (evnt) => {
|
|
9605
|
+
const trackEl = evnt.currentTarget;
|
|
9606
|
+
if (trackEl !== evnt.target) {
|
|
9607
|
+
return;
|
|
9608
|
+
}
|
|
9609
|
+
const viewEl = refVirtualWrapper.value;
|
|
9610
|
+
if (!viewEl) {
|
|
9611
|
+
return;
|
|
9612
|
+
}
|
|
9613
|
+
const { yThumbHeight } = reactData;
|
|
9614
|
+
const trackRect = trackEl.getBoundingClientRect();
|
|
9615
|
+
viewEl.scrollTo({
|
|
9616
|
+
top: getScrollFromClick(evnt.clientY - trackRect.top, viewEl.clientHeight, viewEl.scrollHeight, trackEl.clientHeight, yThumbHeight),
|
|
9617
|
+
behavior: 'auto'
|
|
9618
|
+
});
|
|
9619
|
+
};
|
|
9620
|
+
const pointerdownThumbXEvent = (evnt) => {
|
|
9621
|
+
const thumbEl = evnt.currentTarget;
|
|
9622
|
+
internalData.isThumbDrag = true;
|
|
9623
|
+
thumbEl.setPointerCapture(evnt.pointerId);
|
|
9624
|
+
const viewEl = refVirtualWrapper.value;
|
|
9625
|
+
if (!viewEl) {
|
|
9626
|
+
return;
|
|
9627
|
+
}
|
|
9628
|
+
const { xThumbWidth } = reactData;
|
|
9629
|
+
const trackEl = thumbEl.parentElement;
|
|
9630
|
+
const trackRect = trackEl.getBoundingClientRect();
|
|
9631
|
+
const pointerPosition = evnt.clientX - trackRect.left;
|
|
9632
|
+
// 记录 thumb 的偏移
|
|
9633
|
+
const thumbOffset = getThumbOffsetSize(viewEl.scrollLeft, viewEl.clientWidth, viewEl.scrollWidth, trackEl.clientWidth, xThumbWidth);
|
|
9634
|
+
internalData.thumbDragOffset = pointerPosition - thumbOffset;
|
|
9635
|
+
};
|
|
9636
|
+
const pointermoveThumbXEvent = (evnt) => {
|
|
9637
|
+
const thumbEl = evnt.currentTarget;
|
|
9638
|
+
if (!thumbEl.hasPointerCapture(evnt.pointerId)) {
|
|
9639
|
+
return;
|
|
9640
|
+
}
|
|
9641
|
+
const { isThumbDrag, thumbDragOffset } = internalData;
|
|
9642
|
+
if (isThumbDrag) {
|
|
9643
|
+
const viewEl = refVirtualWrapper.value;
|
|
9644
|
+
if (!viewEl) {
|
|
9645
|
+
return;
|
|
9646
|
+
}
|
|
9647
|
+
const { xThumbWidth } = reactData;
|
|
9648
|
+
const thumbEl = evnt.currentTarget;
|
|
9649
|
+
const trackEl = thumbEl.parentElement;
|
|
9650
|
+
const trackRect = trackEl.getBoundingClientRect();
|
|
9651
|
+
// 更新偏移
|
|
9652
|
+
viewEl.scrollLeft = getScrollFromDrag(evnt.clientX - trackRect.left, thumbDragOffset, viewEl.clientWidth, viewEl.scrollWidth, trackEl.clientWidth, xThumbWidth);
|
|
9653
|
+
}
|
|
9654
|
+
};
|
|
9655
|
+
const cleatPointerThumbEvent = (evnt) => {
|
|
9656
|
+
const thumbEl = evnt.currentTarget;
|
|
9657
|
+
thumbEl.releasePointerCapture(evnt.pointerId);
|
|
9658
|
+
internalData.isThumbDrag = false;
|
|
9659
|
+
};
|
|
9660
|
+
const pointerdownThumbYEvent = (evnt) => {
|
|
9661
|
+
const thumbEl = evnt.currentTarget;
|
|
9662
|
+
internalData.isThumbDrag = true;
|
|
9663
|
+
thumbEl.setPointerCapture(evnt.pointerId);
|
|
9664
|
+
const viewEl = refVirtualWrapper.value;
|
|
9665
|
+
if (!viewEl) {
|
|
9666
|
+
return;
|
|
9667
|
+
}
|
|
9668
|
+
const { yThumbHeight } = reactData;
|
|
9669
|
+
const trackEl = thumbEl.parentElement;
|
|
9670
|
+
const trackRect = trackEl.getBoundingClientRect();
|
|
9671
|
+
const pointerPosition = evnt.clientY - trackRect.top;
|
|
9672
|
+
// 记录 thumb 的偏移
|
|
9673
|
+
const thumbOffset = getThumbOffsetSize(viewEl.scrollTop, viewEl.clientHeight, viewEl.scrollHeight, trackEl.clientHeight, yThumbHeight);
|
|
9674
|
+
internalData.thumbDragOffset = pointerPosition - thumbOffset;
|
|
9675
|
+
};
|
|
9676
|
+
const pointermoveThumbYEvent = (evnt) => {
|
|
9677
|
+
const thumbEl = evnt.currentTarget;
|
|
9678
|
+
if (!thumbEl.hasPointerCapture(evnt.pointerId)) {
|
|
9679
|
+
return;
|
|
9680
|
+
}
|
|
9681
|
+
const { isThumbDrag, thumbDragOffset } = internalData;
|
|
9682
|
+
if (isThumbDrag) {
|
|
9683
|
+
const viewEl = refVirtualWrapper.value;
|
|
9684
|
+
if (!viewEl) {
|
|
9685
|
+
return;
|
|
9686
|
+
}
|
|
9687
|
+
const { yThumbHeight } = reactData;
|
|
9688
|
+
const thumbEl = evnt.currentTarget;
|
|
9689
|
+
const trackEl = thumbEl.parentElement;
|
|
9690
|
+
const trackRect = trackEl.getBoundingClientRect();
|
|
9691
|
+
// 更新偏移
|
|
9692
|
+
viewEl.scrollTop = getScrollFromDrag(evnt.clientY - trackRect.top, thumbDragOffset, viewEl.clientHeight, viewEl.scrollHeight, trackEl.clientHeight, yThumbHeight);
|
|
9693
|
+
}
|
|
9694
|
+
};
|
|
8780
9695
|
Object.assign($xeList, listMethods, listPrivateMethods);
|
|
8781
9696
|
const renderDragTip = () => {
|
|
8782
9697
|
const { dragRow, dragTipText } = reactData;
|
|
@@ -8973,7 +9888,7 @@ var VxeListComponent = defineVxeComponent({
|
|
|
8973
9888
|
}], rowid: hasKey && keyField ? rowid : undefined }, rowOns), ctVNs);
|
|
8974
9889
|
};
|
|
8975
9890
|
const renderVN = () => {
|
|
8976
|
-
const { showCheckbox, className, loading } = props;
|
|
9891
|
+
const { showCheckbox, className, loading, useScrollbar } = props;
|
|
8977
9892
|
const { bodyHeight, topSpaceHeight, rowList, isAllChecked, isAllIndeterminate } = reactData;
|
|
8978
9893
|
const defaultSlot = slots.default;
|
|
8979
9894
|
const headerSlot = slots.header;
|
|
@@ -8989,6 +9904,9 @@ var VxeListComponent = defineVxeComponent({
|
|
|
8989
9904
|
const rowOpts = computeRowOpts.value;
|
|
8990
9905
|
const { isHover, padding } = rowOpts;
|
|
8991
9906
|
const isDrag = computeIsDrag.value;
|
|
9907
|
+
const scrollbarXOpts = computeScrollbarXOpts.value;
|
|
9908
|
+
const scrollbarYOpts = computeScrollbarYOpts.value;
|
|
9909
|
+
const scrollbarWrapperClss = computeScrollbarWrapperClss.value;
|
|
8992
9910
|
const showDefChekboxHead = showCheckbox && showHeader !== false;
|
|
8993
9911
|
const leOns = {};
|
|
8994
9912
|
if (isCrossListDrag && !rowList.length) {
|
|
@@ -8996,6 +9914,9 @@ var VxeListComponent = defineVxeComponent({
|
|
|
8996
9914
|
}
|
|
8997
9915
|
return h('div', Object.assign({ ref: refElem, class: ['vxe-list', className ? (XEUtils.isFunction(className) ? className({ $list: $xeList }) : className) : '', {
|
|
8998
9916
|
[`size--${vSize}`]: vSize,
|
|
9917
|
+
'is--virtual-scrollbar': useScrollbar,
|
|
9918
|
+
'ov-x--auto-hide': useScrollbar && scrollbarXOpts.autoHide,
|
|
9919
|
+
'ov-y--auto-hide': useScrollbar && scrollbarYOpts.autoHide,
|
|
8999
9920
|
'is--drag': isDrag,
|
|
9000
9921
|
'is--loading': loading
|
|
9001
9922
|
}], style: wrapperStyles }, leOns), [
|
|
@@ -9055,7 +9976,15 @@ var VxeListComponent = defineVxeComponent({
|
|
|
9055
9976
|
style: {
|
|
9056
9977
|
marginTop: topSpaceHeight ? `${topSpaceHeight}px` : ''
|
|
9057
9978
|
}
|
|
9058
|
-
},
|
|
9979
|
+
}, useScrollbar
|
|
9980
|
+
? (defaultSlot ? defaultSlot({ items: rowList, $list: $xeList }) : rowList.map((row, i) => renderRow(row, i)))
|
|
9981
|
+
: [
|
|
9982
|
+
h('div', {
|
|
9983
|
+
key: 'vi',
|
|
9984
|
+
ref: refViewInnerElem,
|
|
9985
|
+
class: 'vxe-scrollbar--view-inner'
|
|
9986
|
+
}, defaultSlot ? defaultSlot({ items: rowList, $list: $xeList }) : rowList.map((row, i) => renderRow(row, i)))
|
|
9987
|
+
])
|
|
9059
9988
|
]),
|
|
9060
9989
|
footerSlot
|
|
9061
9990
|
? h('div', {
|
|
@@ -9063,6 +9992,49 @@ var VxeListComponent = defineVxeComponent({
|
|
|
9063
9992
|
class: 'vxe-list--footer-wrapper'
|
|
9064
9993
|
}, footerSlot({ items: rowList, $list: $xeList }))
|
|
9065
9994
|
: renderEmptyElement$1($xeList),
|
|
9995
|
+
/**
|
|
9996
|
+
* 滚动条
|
|
9997
|
+
*/
|
|
9998
|
+
useScrollbar
|
|
9999
|
+
? h('div', {
|
|
10000
|
+
class: scrollbarWrapperClss
|
|
10001
|
+
}, [
|
|
10002
|
+
scrollbarXOpts.visible === 'hidden'
|
|
10003
|
+
? renderEmptyElement$1($xeList)
|
|
10004
|
+
: h('div', {
|
|
10005
|
+
ref: refTrackXElem,
|
|
10006
|
+
class: 'vxe-scrollbar--track-x',
|
|
10007
|
+
onClick: clickTrackXEvent
|
|
10008
|
+
}, [
|
|
10009
|
+
h('div', {
|
|
10010
|
+
ref: refThumbXElem,
|
|
10011
|
+
class: 'vxe-scrollbar--thumb-x',
|
|
10012
|
+
onPointerdown: pointerdownThumbXEvent,
|
|
10013
|
+
onPointermove: pointermoveThumbXEvent,
|
|
10014
|
+
onPointerup: cleatPointerThumbEvent,
|
|
10015
|
+
onPointercancel: cleatPointerThumbEvent,
|
|
10016
|
+
onLostpointercapture: cleatPointerThumbEvent
|
|
10017
|
+
})
|
|
10018
|
+
]),
|
|
10019
|
+
scrollbarYOpts.visible === 'hidden'
|
|
10020
|
+
? renderEmptyElement$1($xeList)
|
|
10021
|
+
: h('div', {
|
|
10022
|
+
ref: refTrackYElem,
|
|
10023
|
+
class: 'vxe-scrollbar--track-y',
|
|
10024
|
+
onClick: clickTrackYEvent
|
|
10025
|
+
}, [
|
|
10026
|
+
h('div', {
|
|
10027
|
+
ref: refThumbYElem,
|
|
10028
|
+
class: 'vxe-scrollbar--thumb-y',
|
|
10029
|
+
onPointerdown: pointerdownThumbYEvent,
|
|
10030
|
+
onPointermove: pointermoveThumbYEvent,
|
|
10031
|
+
onPointerup: cleatPointerThumbEvent,
|
|
10032
|
+
onPointercancel: cleatPointerThumbEvent,
|
|
10033
|
+
onLostpointercapture: cleatPointerThumbEvent
|
|
10034
|
+
})
|
|
10035
|
+
])
|
|
10036
|
+
])
|
|
10037
|
+
: renderEmptyElement$1($xeList),
|
|
9066
10038
|
/**
|
|
9067
10039
|
* 拖拽提示
|
|
9068
10040
|
*/
|
|
@@ -9118,13 +10090,15 @@ var VxeListComponent = defineVxeComponent({
|
|
|
9118
10090
|
updateCheckboxModeValue();
|
|
9119
10091
|
});
|
|
9120
10092
|
onActivated(() => {
|
|
9121
|
-
recalculate().then(() =>
|
|
10093
|
+
recalculate().then(() => {
|
|
10094
|
+
refreshScroll();
|
|
10095
|
+
});
|
|
9122
10096
|
});
|
|
9123
10097
|
nextTick(() => {
|
|
9124
10098
|
loadData(props.data || []);
|
|
9125
10099
|
});
|
|
9126
10100
|
onMounted(() => {
|
|
9127
|
-
const { showSeq, showRadio, showCheckbox } = props;
|
|
10101
|
+
const { showSeq, showRadio, showCheckbox, autoResize, useScrollbar } = props;
|
|
9128
10102
|
const rowOpts = computeRowOpts.value;
|
|
9129
10103
|
const { useKey } = rowOpts;
|
|
9130
10104
|
const isDrag = computeIsDrag.value;
|
|
@@ -9146,17 +10120,27 @@ var VxeListComponent = defineVxeComponent({
|
|
|
9146
10120
|
if (useKey && !keyField) {
|
|
9147
10121
|
errLog$j('vxe.error.reqSupportProp', ['row-config.useKey', 'row-config.keyField']);
|
|
9148
10122
|
}
|
|
9149
|
-
if (
|
|
10123
|
+
if (useScrollbar || autoResize) {
|
|
9150
10124
|
const el = refElem.value;
|
|
9151
|
-
const
|
|
10125
|
+
const viewInnerEl = refViewInnerElem.value;
|
|
10126
|
+
const resizeObserver = globalResize$1.create(() => {
|
|
10127
|
+
reFlag.value++;
|
|
10128
|
+
});
|
|
9152
10129
|
resizeObserver.observe(el);
|
|
9153
|
-
if (
|
|
9154
|
-
|
|
10130
|
+
if (autoResize) {
|
|
10131
|
+
if (el) {
|
|
10132
|
+
resizeObserver.observe(el.parentElement);
|
|
10133
|
+
}
|
|
10134
|
+
}
|
|
10135
|
+
if (viewInnerEl) {
|
|
10136
|
+
resizeObserver.observe(viewInnerEl);
|
|
9155
10137
|
}
|
|
9156
10138
|
internalData.resizeObserver = resizeObserver;
|
|
9157
10139
|
}
|
|
9158
|
-
|
|
9159
|
-
globalEvents$1.on($xeList, 'resize',
|
|
10140
|
+
reFlag.value++;
|
|
10141
|
+
globalEvents$1.on($xeList, 'resize', () => {
|
|
10142
|
+
reFlag.value++;
|
|
10143
|
+
});
|
|
9160
10144
|
});
|
|
9161
10145
|
onBeforeUnmount(() => {
|
|
9162
10146
|
const { resizeObserver } = internalData;
|
|
@@ -9164,8 +10148,8 @@ var VxeListComponent = defineVxeComponent({
|
|
|
9164
10148
|
resizeObserver.disconnect();
|
|
9165
10149
|
}
|
|
9166
10150
|
globalEvents$1.off($xeList, 'resize');
|
|
9167
|
-
XEUtils.assign(reactData, createReactData$
|
|
9168
|
-
XEUtils.assign(internalData, createInternalData$
|
|
10151
|
+
XEUtils.assign(reactData, createReactData$m());
|
|
10152
|
+
XEUtils.assign(internalData, createInternalData$l());
|
|
9169
10153
|
});
|
|
9170
10154
|
$xeList.renderVN = renderVN;
|
|
9171
10155
|
return $xeList;
|
|
@@ -11965,7 +12949,7 @@ const Input = VxeInput;
|
|
|
11965
12949
|
function getNodeUniqueId$1() {
|
|
11966
12950
|
return XEUtils.uniqueId('node_');
|
|
11967
12951
|
}
|
|
11968
|
-
function createReactData$
|
|
12952
|
+
function createReactData$l() {
|
|
11969
12953
|
return {
|
|
11970
12954
|
initialized: false,
|
|
11971
12955
|
searchValue: '',
|
|
@@ -11988,7 +12972,7 @@ function createReactData$m() {
|
|
|
11988
12972
|
lazyOptFlag: 1
|
|
11989
12973
|
};
|
|
11990
12974
|
}
|
|
11991
|
-
function createInternalData$
|
|
12975
|
+
function createInternalData$k() {
|
|
11992
12976
|
return {
|
|
11993
12977
|
// hpTimeout: undefined,
|
|
11994
12978
|
listVirtualYOpts: {
|
|
@@ -12116,8 +13100,8 @@ var VxeCascaderComponent = defineVxeComponent({
|
|
|
12116
13100
|
const refInpSearch = ref();
|
|
12117
13101
|
const refChunkWrapper = ref();
|
|
12118
13102
|
const refOptionPanel = ref();
|
|
12119
|
-
const reactData = reactive(createReactData$
|
|
12120
|
-
const internalData = createInternalData$
|
|
13103
|
+
const reactData = reactive(createReactData$l());
|
|
13104
|
+
const internalData = createInternalData$k();
|
|
12121
13105
|
const refMaps = {
|
|
12122
13106
|
refElem
|
|
12123
13107
|
};
|
|
@@ -13718,8 +14702,8 @@ var VxeCascaderComponent = defineVxeComponent({
|
|
|
13718
14702
|
globalEvents$1.off($xeCascader, 'blur');
|
|
13719
14703
|
globalEvents$1.off($xeCascader, 'resize');
|
|
13720
14704
|
globalEvents$1.off($xeCascader, 'scroll');
|
|
13721
|
-
XEUtils.assign(reactData, createReactData$
|
|
13722
|
-
XEUtils.assign(internalData, createInternalData$
|
|
14705
|
+
XEUtils.assign(reactData, createReactData$l());
|
|
14706
|
+
XEUtils.assign(internalData, createInternalData$k());
|
|
13723
14707
|
});
|
|
13724
14708
|
provide('$xeCascader', $xeCascader);
|
|
13725
14709
|
$xeCascader.renderVN = renderVN;
|
|
@@ -14123,10 +15107,10 @@ dynamicApp.use(VxeCheckboxButton);
|
|
|
14123
15107
|
VxeUI.component(VxeCheckboxButtonComponent);
|
|
14124
15108
|
const CheckboxButton = VxeCheckboxButton;
|
|
14125
15109
|
|
|
14126
|
-
function createReactData$
|
|
15110
|
+
function createReactData$k() {
|
|
14127
15111
|
return {};
|
|
14128
15112
|
}
|
|
14129
|
-
function createInternalData$
|
|
15113
|
+
function createInternalData$j() {
|
|
14130
15114
|
return {
|
|
14131
15115
|
// isLoaded: false
|
|
14132
15116
|
};
|
|
@@ -14170,8 +15154,8 @@ var VxeCheckboxGroupComponent = defineVxeComponent({
|
|
|
14170
15154
|
const $xeForm = inject('$xeForm', null);
|
|
14171
15155
|
const formItemInfo = inject('xeFormItemInfo', null);
|
|
14172
15156
|
const xID = XEUtils.uniqueId();
|
|
14173
|
-
const reactData = reactive(createReactData$
|
|
14174
|
-
const internalData = createInternalData$
|
|
15157
|
+
const reactData = reactive(createReactData$k());
|
|
15158
|
+
const internalData = createInternalData$j();
|
|
14175
15159
|
const computeIsReadonly = computed(() => {
|
|
14176
15160
|
const { readonly } = props;
|
|
14177
15161
|
if (readonly === null) {
|
|
@@ -14344,8 +15328,8 @@ var VxeCheckboxGroupComponent = defineVxeComponent({
|
|
|
14344
15328
|
});
|
|
14345
15329
|
});
|
|
14346
15330
|
onUnmounted(() => {
|
|
14347
|
-
XEUtils.assign(reactData, createReactData$
|
|
14348
|
-
XEUtils.assign(internalData, createInternalData$
|
|
15331
|
+
XEUtils.assign(reactData, createReactData$k());
|
|
15332
|
+
XEUtils.assign(internalData, createInternalData$j());
|
|
14349
15333
|
});
|
|
14350
15334
|
provide('$xeCheckboxGroup', $xeCheckboxGroup);
|
|
14351
15335
|
$xeCheckboxGroup.renderVN = renderVN;
|
|
@@ -14498,7 +15482,7 @@ dynamicApp.use(VxeCol);
|
|
|
14498
15482
|
VxeUI.component(VxeColComponent);
|
|
14499
15483
|
const Col = VxeCol;
|
|
14500
15484
|
|
|
14501
|
-
function createReactData$
|
|
15485
|
+
function createReactData$j() {
|
|
14502
15486
|
return {
|
|
14503
15487
|
staticPanes: [],
|
|
14504
15488
|
cachePaneMaps: {},
|
|
@@ -14506,7 +15490,7 @@ function createReactData$k() {
|
|
|
14506
15490
|
openKeyFlag: 0
|
|
14507
15491
|
};
|
|
14508
15492
|
}
|
|
14509
|
-
function createInternalData$
|
|
15493
|
+
function createInternalData$i() {
|
|
14510
15494
|
return {
|
|
14511
15495
|
// esTime: null,
|
|
14512
15496
|
activeKeyMaps: {},
|
|
@@ -14543,8 +15527,8 @@ var VxeCollapseComponent = defineVxeComponent({
|
|
|
14543
15527
|
const xID = XEUtils.uniqueId();
|
|
14544
15528
|
const { computeSize } = useSize(props);
|
|
14545
15529
|
const refElem = ref();
|
|
14546
|
-
const reactData = reactive(createReactData$
|
|
14547
|
-
const internalData = createInternalData$
|
|
15530
|
+
const reactData = reactive(createReactData$j());
|
|
15531
|
+
const internalData = createInternalData$i();
|
|
14548
15532
|
const refMaps = {
|
|
14549
15533
|
refElem
|
|
14550
15534
|
};
|
|
@@ -14823,8 +15807,8 @@ var VxeCollapseComponent = defineVxeComponent({
|
|
|
14823
15807
|
if (esTime) {
|
|
14824
15808
|
clearTimeout(esTime);
|
|
14825
15809
|
}
|
|
14826
|
-
XEUtils.assign(reactData, createReactData$
|
|
14827
|
-
XEUtils.assign(internalData, createInternalData$
|
|
15810
|
+
XEUtils.assign(reactData, createReactData$j());
|
|
15811
|
+
XEUtils.assign(internalData, createInternalData$i());
|
|
14828
15812
|
});
|
|
14829
15813
|
provide('$xeCollapse', $xeCollapse);
|
|
14830
15814
|
$xeCollapse.renderVN = renderVN;
|
|
@@ -17606,12 +18590,12 @@ VxeUI.color = {
|
|
|
17606
18590
|
};
|
|
17607
18591
|
const ColorPicker = VxeColorPicker;
|
|
17608
18592
|
|
|
17609
|
-
function createInternalData$
|
|
18593
|
+
function createInternalData$h() {
|
|
17610
18594
|
return {
|
|
17611
18595
|
// leaveTime: null
|
|
17612
18596
|
};
|
|
17613
18597
|
}
|
|
17614
|
-
function createReactData$
|
|
18598
|
+
function createReactData$i() {
|
|
17615
18599
|
return {
|
|
17616
18600
|
visible: false,
|
|
17617
18601
|
activeOption: null,
|
|
@@ -17666,8 +18650,8 @@ var VxeContextMenuComponent = defineVxeComponent({
|
|
|
17666
18650
|
const xID = XEUtils.uniqueId();
|
|
17667
18651
|
const refElem = ref();
|
|
17668
18652
|
const { computeSize } = useSize(props);
|
|
17669
|
-
const internalData = createInternalData$
|
|
17670
|
-
const reactData = reactive(createReactData$
|
|
18653
|
+
const internalData = createInternalData$h();
|
|
18654
|
+
const reactData = reactive(createReactData$i());
|
|
17671
18655
|
const refMaps = {
|
|
17672
18656
|
refElem
|
|
17673
18657
|
};
|
|
@@ -18222,8 +19206,8 @@ var VxeContextMenuComponent = defineVxeComponent({
|
|
|
18222
19206
|
globalEvents$1.off($xeContextMenu, 'keydown');
|
|
18223
19207
|
globalEvents$1.off($xeContextMenu, 'mousedown');
|
|
18224
19208
|
globalEvents$1.off($xeContextMenu, 'blur');
|
|
18225
|
-
XEUtils.assign(reactData, createReactData$
|
|
18226
|
-
XEUtils.assign(internalData, createInternalData$
|
|
19209
|
+
XEUtils.assign(reactData, createReactData$i());
|
|
19210
|
+
XEUtils.assign(internalData, createInternalData$h());
|
|
18227
19211
|
});
|
|
18228
19212
|
$xeContextMenu.renderVN = renderVN;
|
|
18229
19213
|
return $xeContextMenu;
|
|
@@ -20553,7 +21537,7 @@ const parseInputKayMaps = {};
|
|
|
20553
21537
|
inputMaskedKeys.forEach(key => {
|
|
20554
21538
|
parseInputKayMaps[key] = true;
|
|
20555
21539
|
});
|
|
20556
|
-
function createReactData$
|
|
21540
|
+
function createReactData$h() {
|
|
20557
21541
|
return {
|
|
20558
21542
|
initialized: false,
|
|
20559
21543
|
panelIndex: 0,
|
|
@@ -20566,7 +21550,7 @@ function createReactData$i() {
|
|
|
20566
21550
|
labelFlag: 0
|
|
20567
21551
|
};
|
|
20568
21552
|
}
|
|
20569
|
-
function createInternalData$
|
|
21553
|
+
function createInternalData$g() {
|
|
20570
21554
|
return {
|
|
20571
21555
|
// hpTimeout: undefined,
|
|
20572
21556
|
// fsTimeout: undefined,
|
|
@@ -20718,8 +21702,8 @@ var VxeDatePickerComponent = defineVxeComponent({
|
|
|
20718
21702
|
const formItemInfo = inject('xeFormItemInfo', null);
|
|
20719
21703
|
const xID = XEUtils.uniqueId();
|
|
20720
21704
|
const { computeSize } = useSize(props);
|
|
20721
|
-
const reactData = reactive(createReactData$
|
|
20722
|
-
const internalData = createInternalData$
|
|
21705
|
+
const reactData = reactive(createReactData$h());
|
|
21706
|
+
const internalData = createInternalData$g();
|
|
20723
21707
|
const defaultFuncProps = {
|
|
20724
21708
|
parseInputMethod: getConfig$4().datePicker.parseInputMethod,
|
|
20725
21709
|
festivalMethod: getConfig$4().datePicker.festivalMethod,
|
|
@@ -22173,8 +23157,8 @@ var VxeDatePickerComponent = defineVxeComponent({
|
|
|
22173
23157
|
globalEvents$1.off($xeDatePicker, 'blur');
|
|
22174
23158
|
globalEvents$1.off($xeDatePicker, 'resize');
|
|
22175
23159
|
globalEvents$1.off($xeDatePicker, 'scroll');
|
|
22176
|
-
XEUtils.assign(reactData, createReactData$
|
|
22177
|
-
XEUtils.assign(internalData, createInternalData$
|
|
23160
|
+
XEUtils.assign(reactData, createReactData$h());
|
|
23161
|
+
XEUtils.assign(internalData, createInternalData$g());
|
|
22178
23162
|
});
|
|
22179
23163
|
provide('$xeDatePicker', $xeDatePicker);
|
|
22180
23164
|
$xeDatePicker.renderVN = renderVN;
|
|
@@ -22195,7 +23179,7 @@ VxeUI.component(VxeDatePickerComponent);
|
|
|
22195
23179
|
const DatePicker = VxeDatePicker;
|
|
22196
23180
|
|
|
22197
23181
|
const { errLog: errLog$e } = createComponentLog('date-range-picker');
|
|
22198
|
-
function createReactData$
|
|
23182
|
+
function createReactData$g() {
|
|
22199
23183
|
return {
|
|
22200
23184
|
initialized: false,
|
|
22201
23185
|
panelIndex: 0,
|
|
@@ -22210,7 +23194,7 @@ function createReactData$h() {
|
|
|
22210
23194
|
paneEndVal: []
|
|
22211
23195
|
};
|
|
22212
23196
|
}
|
|
22213
|
-
function createInternalData$
|
|
23197
|
+
function createInternalData$f() {
|
|
22214
23198
|
return {
|
|
22215
23199
|
// selectStatus: false
|
|
22216
23200
|
// hpTimeout: undefined
|
|
@@ -22360,8 +23344,8 @@ var VxeDateRangePickerComponent = defineVxeComponent({
|
|
|
22360
23344
|
const formItemInfo = inject('xeFormItemInfo', null);
|
|
22361
23345
|
const xID = XEUtils.uniqueId();
|
|
22362
23346
|
const { computeSize } = useSize(props);
|
|
22363
|
-
const reactData = reactive(createReactData$
|
|
22364
|
-
const internalData = createInternalData$
|
|
23347
|
+
const reactData = reactive(createReactData$g());
|
|
23348
|
+
const internalData = createInternalData$f();
|
|
22365
23349
|
const defaultFuncProps = {
|
|
22366
23350
|
festivalMethod: getConfig$4().dateRangePicker.festivalMethod,
|
|
22367
23351
|
disabledMethod: getConfig$4().dateRangePicker.disabledMethod
|
|
@@ -23692,8 +24676,8 @@ var VxeDateRangePickerComponent = defineVxeComponent({
|
|
|
23692
24676
|
globalEvents$1.off($xeDateRangePicker, 'blur');
|
|
23693
24677
|
globalEvents$1.off($xeDateRangePicker, 'resize');
|
|
23694
24678
|
globalEvents$1.off($xeDateRangePicker, 'scroll');
|
|
23695
|
-
XEUtils.assign(reactData, createReactData$
|
|
23696
|
-
XEUtils.assign(internalData, createInternalData$
|
|
24679
|
+
XEUtils.assign(reactData, createReactData$g());
|
|
24680
|
+
XEUtils.assign(internalData, createInternalData$f());
|
|
23697
24681
|
});
|
|
23698
24682
|
provide('$xeDateRangePicker', $xeDateRangePicker);
|
|
23699
24683
|
$xeDateRangePicker.renderVN = renderVN;
|
|
@@ -26017,7 +27001,7 @@ function checkRuleStatus(rule, data, val) {
|
|
|
26017
27001
|
}
|
|
26018
27002
|
return true;
|
|
26019
27003
|
}
|
|
26020
|
-
function createReactData$
|
|
27004
|
+
function createReactData$f() {
|
|
26021
27005
|
return {
|
|
26022
27006
|
collapseAll: false,
|
|
26023
27007
|
staticItems: [],
|
|
@@ -26025,7 +27009,7 @@ function createReactData$g() {
|
|
|
26025
27009
|
itemWidth: 0
|
|
26026
27010
|
};
|
|
26027
27011
|
}
|
|
26028
|
-
function createInternalData$
|
|
27012
|
+
function createInternalData$e() {
|
|
26029
27013
|
return {
|
|
26030
27014
|
meTimeout: undefined,
|
|
26031
27015
|
stTimeout: undefined,
|
|
@@ -26135,8 +27119,8 @@ var VxeFormComponent = defineVxeComponent({
|
|
|
26135
27119
|
const $xeGrid = inject('$xeGrid', null);
|
|
26136
27120
|
const xID = XEUtils.uniqueId();
|
|
26137
27121
|
const { computeSize } = useSize(props);
|
|
26138
|
-
const reactData = reactive(createReactData$
|
|
26139
|
-
const internalData = createInternalData$
|
|
27122
|
+
const reactData = reactive(createReactData$f());
|
|
27123
|
+
const internalData = createInternalData$e();
|
|
26140
27124
|
const refElem = ref();
|
|
26141
27125
|
const refTooltip = ref();
|
|
26142
27126
|
const computeValidOpts = computed(() => {
|
|
@@ -26860,8 +27844,8 @@ var VxeFormComponent = defineVxeComponent({
|
|
|
26860
27844
|
});
|
|
26861
27845
|
onUnmounted(() => {
|
|
26862
27846
|
globalEvents$1.off($xeForm, 'resize');
|
|
26863
|
-
XEUtils.assign(reactData, createReactData$
|
|
26864
|
-
XEUtils.assign(internalData, createInternalData$
|
|
27847
|
+
XEUtils.assign(reactData, createReactData$f());
|
|
27848
|
+
XEUtils.assign(internalData, createInternalData$e());
|
|
26865
27849
|
});
|
|
26866
27850
|
reactData.collapseAll = !!props.collapseStatus;
|
|
26867
27851
|
if (props.items) {
|
|
@@ -26988,7 +27972,7 @@ dynamicApp.use(VxeFormItem);
|
|
|
26988
27972
|
VxeUI.component(VxeFormItemComponent);
|
|
26989
27973
|
const FormItem = VxeFormItem;
|
|
26990
27974
|
|
|
26991
|
-
function createReactData$
|
|
27975
|
+
function createReactData$e() {
|
|
26992
27976
|
return {
|
|
26993
27977
|
initialized: false,
|
|
26994
27978
|
selectIcon: '',
|
|
@@ -27002,7 +27986,7 @@ function createReactData$f() {
|
|
|
27002
27986
|
iconList: []
|
|
27003
27987
|
};
|
|
27004
27988
|
}
|
|
27005
|
-
function createInternalData$
|
|
27989
|
+
function createInternalData$d() {
|
|
27006
27990
|
return {
|
|
27007
27991
|
fullList: []
|
|
27008
27992
|
// hpTimeout: undefined
|
|
@@ -27065,8 +28049,8 @@ var VxeIconPickerComponent = defineVxeComponent({
|
|
|
27065
28049
|
const formItemInfo = inject('xeFormItemInfo', null);
|
|
27066
28050
|
const xID = XEUtils.uniqueId();
|
|
27067
28051
|
const { computeSize } = useSize(props);
|
|
27068
|
-
const reactData = reactive(createReactData$
|
|
27069
|
-
const internalData = createInternalData$
|
|
28052
|
+
const reactData = reactive(createReactData$e());
|
|
28053
|
+
const internalData = createInternalData$d();
|
|
27070
28054
|
const refElem = ref();
|
|
27071
28055
|
const refInput = ref();
|
|
27072
28056
|
const refOptionPanel = ref();
|
|
@@ -27676,8 +28660,8 @@ var VxeIconPickerComponent = defineVxeComponent({
|
|
|
27676
28660
|
globalEvents$1.off($xeIconPicker, 'blur');
|
|
27677
28661
|
globalEvents$1.off($xeIconPicker, 'resize');
|
|
27678
28662
|
globalEvents$1.off($xeIconPicker, 'scroll');
|
|
27679
|
-
XEUtils.assign(reactData, createReactData$
|
|
27680
|
-
XEUtils.assign(internalData, createInternalData$
|
|
28663
|
+
XEUtils.assign(reactData, createReactData$e());
|
|
28664
|
+
XEUtils.assign(internalData, createInternalData$d());
|
|
27681
28665
|
});
|
|
27682
28666
|
provide('$xeIconPicker', $xeIconPicker);
|
|
27683
28667
|
$xeIconPicker.renderVN = renderVN;
|
|
@@ -28342,1115 +29326,464 @@ const openPreviewImage = (options) => {
|
|
|
28342
29326
|
height: '100%',
|
|
28343
29327
|
showHeader: false,
|
|
28344
29328
|
showFooter: false,
|
|
28345
|
-
padding: false,
|
|
28346
|
-
escClosable: opts.escClosable,
|
|
28347
|
-
zIndex,
|
|
28348
|
-
className: 'vxe-image-preview-popup-wrapper',
|
|
28349
|
-
slots: {
|
|
28350
|
-
default() {
|
|
28351
|
-
return h(VxeImagePreviewComponent, {
|
|
28352
|
-
modelValue: activeIndex,
|
|
28353
|
-
urlList,
|
|
28354
|
-
urlField: opts.urlField,
|
|
28355
|
-
marginSize: opts.marginSize,
|
|
28356
|
-
maskClosable: opts.maskClosable,
|
|
28357
|
-
toolbarConfig: opts.toolbarConfig,
|
|
28358
|
-
showPrintButton: opts.showPrintButton,
|
|
28359
|
-
showDownloadButton: opts.showDownloadButton,
|
|
28360
|
-
beforeDownloadMethod: opts.beforeDownloadMethod,
|
|
28361
|
-
downloadMethod: opts.downloadMethod,
|
|
28362
|
-
onClose() {
|
|
28363
|
-
VxeUI.modal.close(modalId);
|
|
28364
|
-
},
|
|
28365
|
-
onChange(eventParams) {
|
|
28366
|
-
if (change) {
|
|
28367
|
-
change.call(this, eventParams);
|
|
28368
|
-
}
|
|
28369
|
-
},
|
|
28370
|
-
onRotate(eventParams) {
|
|
28371
|
-
if (rotate) {
|
|
28372
|
-
rotate.call(this, eventParams);
|
|
28373
|
-
}
|
|
28374
|
-
}
|
|
28375
|
-
});
|
|
28376
|
-
}
|
|
28377
|
-
}
|
|
28378
|
-
});
|
|
28379
|
-
}
|
|
28380
|
-
return Promise.resolve();
|
|
28381
|
-
};
|
|
28382
|
-
|
|
28383
|
-
function createInternalData$d() {
|
|
28384
|
-
return {
|
|
28385
|
-
// dgTime: 0,
|
|
28386
|
-
// mdTime: 0
|
|
28387
|
-
};
|
|
28388
|
-
}
|
|
28389
|
-
function createReactData$e() {
|
|
28390
|
-
return {};
|
|
28391
|
-
}
|
|
28392
|
-
var VxeImageComponent = defineVxeComponent({
|
|
28393
|
-
name: 'VxeImage',
|
|
28394
|
-
props: {
|
|
28395
|
-
src: [String, Array],
|
|
28396
|
-
alt: [String, Number],
|
|
28397
|
-
loading: String,
|
|
28398
|
-
title: [String, Number],
|
|
28399
|
-
width: [String, Number],
|
|
28400
|
-
height: [String, Number],
|
|
28401
|
-
minWidth: [String, Number],
|
|
28402
|
-
minHeight: [String, Number],
|
|
28403
|
-
maxWidth: [String, Number],
|
|
28404
|
-
maxHeight: [String, Number],
|
|
28405
|
-
circle: Boolean,
|
|
28406
|
-
draggable: {
|
|
28407
|
-
type: Boolean,
|
|
28408
|
-
default: () => getConfig$4().image.draggable
|
|
28409
|
-
},
|
|
28410
|
-
zIndex: Number,
|
|
28411
|
-
maskClosable: {
|
|
28412
|
-
type: Boolean,
|
|
28413
|
-
default: () => getConfig$4().image.maskClosable
|
|
28414
|
-
},
|
|
28415
|
-
toolbarConfig: Object,
|
|
28416
|
-
showPreview: {
|
|
28417
|
-
type: Boolean,
|
|
28418
|
-
default: () => getConfig$4().image.showPreview
|
|
28419
|
-
},
|
|
28420
|
-
showPrintButton: {
|
|
28421
|
-
type: Boolean,
|
|
28422
|
-
default: () => getConfig$4().image.showPrintButton
|
|
28423
|
-
},
|
|
28424
|
-
showDownloadButton: {
|
|
28425
|
-
type: Boolean,
|
|
28426
|
-
default: () => getConfig$4().image.showDownloadButton
|
|
28427
|
-
},
|
|
28428
|
-
size: {
|
|
28429
|
-
type: String,
|
|
28430
|
-
default: () => getConfig$4().image.size || getConfig$4().size
|
|
28431
|
-
},
|
|
28432
|
-
getThumbnailUrlMethod: Function
|
|
28433
|
-
},
|
|
28434
|
-
emits: [
|
|
28435
|
-
'click',
|
|
28436
|
-
'change',
|
|
28437
|
-
'rotate',
|
|
28438
|
-
'dragstart',
|
|
28439
|
-
'drag',
|
|
28440
|
-
'dragend'
|
|
28441
|
-
],
|
|
28442
|
-
setup(props, context) {
|
|
28443
|
-
const { emit } = context;
|
|
28444
|
-
const xID = XEUtils.uniqueId();
|
|
28445
|
-
const $xeImageGroup = inject('$xeImageGroup', null);
|
|
28446
|
-
const refElem = ref();
|
|
28447
|
-
const { computeSize } = useSize(props);
|
|
28448
|
-
const internalData = createInternalData$d();
|
|
28449
|
-
const reactData = reactive(createReactData$e());
|
|
28450
|
-
const refMaps = {
|
|
28451
|
-
refElem
|
|
28452
|
-
};
|
|
28453
|
-
const computeWrapperStyle = computed(() => {
|
|
28454
|
-
const { width, height, circle } = props;
|
|
28455
|
-
const stys = {};
|
|
28456
|
-
if (circle) {
|
|
28457
|
-
// 圆形只能生效一个
|
|
28458
|
-
if (width) {
|
|
28459
|
-
stys.width = toCssUnit(width);
|
|
28460
|
-
stys.height = toCssUnit(width);
|
|
28461
|
-
}
|
|
28462
|
-
else if (height) {
|
|
28463
|
-
stys.width = toCssUnit(height);
|
|
28464
|
-
stys.height = toCssUnit(height);
|
|
28465
|
-
}
|
|
28466
|
-
}
|
|
28467
|
-
else {
|
|
28468
|
-
if (width) {
|
|
28469
|
-
stys.width = toCssUnit(width);
|
|
28470
|
-
}
|
|
28471
|
-
if (height) {
|
|
28472
|
-
stys.height = toCssUnit(height);
|
|
28473
|
-
}
|
|
28474
|
-
}
|
|
28475
|
-
return stys;
|
|
28476
|
-
});
|
|
28477
|
-
const computeImgStyle = computed(() => {
|
|
28478
|
-
const { width, height, minWidth, minHeight, maxHeight, maxWidth } = props;
|
|
28479
|
-
const stys = {};
|
|
28480
|
-
if (width && height) {
|
|
28481
|
-
stys.maxWidth = toCssUnit(width);
|
|
28482
|
-
stys.maxHeight = toCssUnit(height);
|
|
28483
|
-
}
|
|
28484
|
-
else {
|
|
28485
|
-
if (width) {
|
|
28486
|
-
stys.width = toCssUnit(width);
|
|
28487
|
-
}
|
|
28488
|
-
if (height) {
|
|
28489
|
-
stys.height = toCssUnit(height);
|
|
28490
|
-
}
|
|
28491
|
-
if (minWidth) {
|
|
28492
|
-
stys.minWidth = toCssUnit(minWidth);
|
|
28493
|
-
}
|
|
28494
|
-
if (minHeight) {
|
|
28495
|
-
stys.minHeight = toCssUnit(minHeight);
|
|
28496
|
-
}
|
|
28497
|
-
if (maxWidth) {
|
|
28498
|
-
stys.maxWidth = toCssUnit(maxWidth);
|
|
28499
|
-
}
|
|
28500
|
-
if (maxHeight) {
|
|
28501
|
-
stys.maxHeight = toCssUnit(maxHeight);
|
|
28502
|
-
}
|
|
28503
|
-
}
|
|
28504
|
-
return stys;
|
|
28505
|
-
});
|
|
28506
|
-
const computeImgList = computed(() => {
|
|
28507
|
-
const { src } = props;
|
|
28508
|
-
if (src) {
|
|
28509
|
-
return (XEUtils.isArray(src) ? src : [src]).map(item => {
|
|
28510
|
-
if (XEUtils.isString(item)) {
|
|
28511
|
-
return {
|
|
28512
|
-
url: item,
|
|
28513
|
-
alt: ''
|
|
28514
|
-
};
|
|
28515
|
-
}
|
|
28516
|
-
return {
|
|
28517
|
-
url: item.url,
|
|
28518
|
-
alt: item.alt
|
|
28519
|
-
};
|
|
28520
|
-
});
|
|
28521
|
-
}
|
|
28522
|
-
return [];
|
|
28523
|
-
});
|
|
28524
|
-
const computeImgItem = computed(() => {
|
|
28525
|
-
const imgList = computeImgList.value;
|
|
28526
|
-
return imgList[0];
|
|
28527
|
-
});
|
|
28528
|
-
const computeImgUrl = computed(() => {
|
|
28529
|
-
const imgItem = computeImgItem.value;
|
|
28530
|
-
return imgItem ? `${imgItem.url || ''}` : '';
|
|
28531
|
-
});
|
|
28532
|
-
const computeImgThumbnailUrl = computed(() => {
|
|
28533
|
-
const getThumbnailUrlFn = props.getThumbnailUrlMethod || getConfig$4().image.getThumbnailUrlMethod;
|
|
28534
|
-
const imgUrl = computeImgUrl.value;
|
|
28535
|
-
return getThumbnailUrlFn ? getThumbnailUrlFn({ url: imgUrl, $image: $xeImage }) : '';
|
|
28536
|
-
});
|
|
28537
|
-
const computeMaps = {
|
|
28538
|
-
computeSize
|
|
28539
|
-
};
|
|
28540
|
-
const $xeImage = {
|
|
28541
|
-
xID,
|
|
28542
|
-
props,
|
|
28543
|
-
context,
|
|
28544
|
-
reactData,
|
|
28545
|
-
internalData,
|
|
28546
|
-
getRefMaps: () => refMaps,
|
|
28547
|
-
getComputeMaps: () => computeMaps
|
|
28548
|
-
};
|
|
28549
|
-
const dispatchEvent = (type, params, evnt) => {
|
|
28550
|
-
emit(type, createEvent$1(evnt, { $image: $xeImage }, params));
|
|
28551
|
-
};
|
|
28552
|
-
const imageMethods = {
|
|
28553
|
-
dispatchEvent
|
|
28554
|
-
};
|
|
28555
|
-
const clickEvent = (evnt) => {
|
|
28556
|
-
const { showPreview, toolbarConfig, showPrintButton, showDownloadButton, maskClosable, zIndex } = props;
|
|
28557
|
-
const { mdTime, dgTime } = internalData;
|
|
28558
|
-
if (mdTime && dgTime && dgTime > mdTime) {
|
|
28559
|
-
return;
|
|
28560
|
-
}
|
|
28561
|
-
const imgList = computeImgList.value;
|
|
28562
|
-
const imgUrl = computeImgUrl.value;
|
|
28563
|
-
if ($xeImageGroup) {
|
|
28564
|
-
$xeImageGroup.handleClickImgEvent(evnt, { url: imgUrl });
|
|
28565
|
-
}
|
|
28566
|
-
else {
|
|
28567
|
-
if (showPreview && imgUrl) {
|
|
28568
|
-
openPreviewImage({
|
|
28569
|
-
urlList: imgList,
|
|
28570
|
-
toolbarConfig,
|
|
28571
|
-
showPrintButton,
|
|
28572
|
-
showDownloadButton,
|
|
28573
|
-
maskClosable,
|
|
28574
|
-
zIndex,
|
|
28575
|
-
events: {
|
|
28576
|
-
change(eventParams) {
|
|
28577
|
-
dispatchEvent('change', eventParams, eventParams.$event);
|
|
28578
|
-
},
|
|
28579
|
-
rotate(eventParams) {
|
|
28580
|
-
dispatchEvent('rotate', eventParams, eventParams.$event);
|
|
28581
|
-
}
|
|
28582
|
-
}
|
|
28583
|
-
});
|
|
28584
|
-
}
|
|
28585
|
-
dispatchEvent('click', { url: imgUrl }, evnt);
|
|
28586
|
-
}
|
|
28587
|
-
};
|
|
28588
|
-
const mousedownEvent = () => {
|
|
28589
|
-
internalData.mdTime = Date.now();
|
|
28590
|
-
};
|
|
28591
|
-
const handleDragstartEvent = (evnt) => {
|
|
28592
|
-
internalData.dgTime = Date.now();
|
|
28593
|
-
dispatchEvent('dragstart', {}, evnt);
|
|
28594
|
-
};
|
|
28595
|
-
const handleDragEvent = (evnt) => {
|
|
28596
|
-
dispatchEvent(evnt.type, {}, evnt);
|
|
28597
|
-
};
|
|
28598
|
-
const imagePrivateMethods = {};
|
|
28599
|
-
Object.assign($xeImage, imageMethods, imagePrivateMethods);
|
|
28600
|
-
const renderVN = () => {
|
|
28601
|
-
const { alt, loading, circle, draggable } = props;
|
|
28602
|
-
const wrapperStyle = computeWrapperStyle.value;
|
|
28603
|
-
const imgStyle = computeImgStyle.value;
|
|
28604
|
-
const imgUrl = computeImgUrl.value;
|
|
28605
|
-
const imgThumbnailUrl = computeImgThumbnailUrl.value;
|
|
28606
|
-
const vSize = computeSize.value;
|
|
28607
|
-
let imgDrag;
|
|
28608
|
-
if (!XEUtils.eqNull(draggable)) {
|
|
28609
|
-
imgDrag = !!(draggable === true || draggable === 'true');
|
|
28610
|
-
}
|
|
28611
|
-
return h('div', {
|
|
28612
|
-
class: ['vxe-image', {
|
|
28613
|
-
[`size--${vSize}`]: vSize,
|
|
28614
|
-
'is--circle': circle
|
|
28615
|
-
}],
|
|
28616
|
-
style: wrapperStyle
|
|
28617
|
-
}, [
|
|
28618
|
-
h('img', {
|
|
28619
|
-
ref: refElem,
|
|
28620
|
-
class: 'vxe-image-img',
|
|
28621
|
-
src: imgThumbnailUrl || imgUrl,
|
|
28622
|
-
alt,
|
|
28623
|
-
loading,
|
|
28624
|
-
draggable: imgDrag,
|
|
28625
|
-
style: imgStyle,
|
|
28626
|
-
onMousedown: mousedownEvent,
|
|
28627
|
-
onClick: clickEvent,
|
|
28628
|
-
onDragstart: handleDragstartEvent,
|
|
28629
|
-
onDrag: handleDragEvent,
|
|
28630
|
-
onDragend: handleDragEvent
|
|
28631
|
-
})
|
|
28632
|
-
]);
|
|
28633
|
-
};
|
|
28634
|
-
onBeforeUnmount(() => {
|
|
28635
|
-
XEUtils.assign(reactData, createReactData$e());
|
|
28636
|
-
XEUtils.assign(internalData, createInternalData$d());
|
|
28637
|
-
});
|
|
28638
|
-
$xeImage.renderVN = renderVN;
|
|
28639
|
-
return $xeImage;
|
|
28640
|
-
},
|
|
28641
|
-
render() {
|
|
28642
|
-
return this.renderVN();
|
|
28643
|
-
}
|
|
28644
|
-
});
|
|
28645
|
-
|
|
28646
|
-
const VxeImage = Object.assign({}, VxeImageComponent, {
|
|
28647
|
-
install(app) {
|
|
28648
|
-
app.component(VxeImageComponent.name, VxeImageComponent);
|
|
28649
|
-
}
|
|
28650
|
-
});
|
|
28651
|
-
dynamicApp.use(VxeImage);
|
|
28652
|
-
VxeUI.component(VxeImageComponent);
|
|
28653
|
-
const Image$1 = VxeImage;
|
|
28654
|
-
|
|
28655
|
-
var VxeImageGroupComponent = defineVxeComponent({
|
|
28656
|
-
name: 'VxeImageGroup',
|
|
28657
|
-
props: {
|
|
28658
|
-
urlList: [Array, String],
|
|
28659
|
-
showPreview: {
|
|
28660
|
-
type: Boolean,
|
|
28661
|
-
default: () => getConfig$4().imageGroup.showPreview
|
|
28662
|
-
},
|
|
28663
|
-
imageStyle: Object,
|
|
28664
|
-
zIndex: Number,
|
|
28665
|
-
size: {
|
|
28666
|
-
type: String,
|
|
28667
|
-
default: () => getConfig$4().imageGroup.size || getConfig$4().size
|
|
28668
|
-
},
|
|
28669
|
-
toolbarConfig: Object,
|
|
28670
|
-
showPrintButton: {
|
|
28671
|
-
type: Boolean,
|
|
28672
|
-
default: () => getConfig$4().imageGroup.showPrintButton
|
|
28673
|
-
},
|
|
28674
|
-
showDownloadButton: {
|
|
28675
|
-
type: Boolean,
|
|
28676
|
-
default: () => getConfig$4().imageGroup.showDownloadButton
|
|
28677
|
-
},
|
|
28678
|
-
getThumbnailUrlMethod: Function
|
|
28679
|
-
},
|
|
28680
|
-
emits: [
|
|
28681
|
-
'click',
|
|
28682
|
-
'change',
|
|
28683
|
-
'rotate'
|
|
28684
|
-
],
|
|
28685
|
-
setup(props, context) {
|
|
28686
|
-
const { emit } = context;
|
|
28687
|
-
const xID = XEUtils.uniqueId();
|
|
28688
|
-
const { computeSize } = useSize(props);
|
|
28689
|
-
const computeImgList = computed(() => {
|
|
28690
|
-
const { urlList } = props;
|
|
28691
|
-
if (urlList) {
|
|
28692
|
-
return (XEUtils.isArray(urlList) ? urlList : [urlList]).map(item => {
|
|
28693
|
-
if (XEUtils.isString(item)) {
|
|
28694
|
-
return {
|
|
28695
|
-
url: item,
|
|
28696
|
-
alt: ''
|
|
28697
|
-
};
|
|
28698
|
-
}
|
|
28699
|
-
return {
|
|
28700
|
-
url: item.url,
|
|
28701
|
-
alt: item.alt
|
|
28702
|
-
};
|
|
28703
|
-
});
|
|
28704
|
-
}
|
|
28705
|
-
return [];
|
|
28706
|
-
});
|
|
28707
|
-
const computeImgStyleOpts = computed(() => {
|
|
28708
|
-
return Object.assign({}, getConfig$4().imageGroup.imageStyle, props.imageStyle);
|
|
28709
|
-
});
|
|
28710
|
-
const computeGetThumbnailUrlMethod = computed(() => {
|
|
28711
|
-
return props.getThumbnailUrlMethod || getConfig$4().imageGroup.getThumbnailUrlMethod;
|
|
28712
|
-
});
|
|
28713
|
-
const computeMaps = {
|
|
28714
|
-
computeSize
|
|
28715
|
-
};
|
|
28716
|
-
const $xeImageGroup = {
|
|
28717
|
-
xID,
|
|
28718
|
-
props,
|
|
28719
|
-
context,
|
|
28720
|
-
getComputeMaps: () => computeMaps
|
|
28721
|
-
};
|
|
28722
|
-
const imageGroupMethods = {
|
|
28723
|
-
dispatchEvent(type, params, evnt) {
|
|
28724
|
-
emit(type, createEvent$1(evnt, { $imageGroup: $xeImageGroup }, params));
|
|
28725
|
-
}
|
|
28726
|
-
};
|
|
28727
|
-
const imageGroupPrivateMethods = {
|
|
28728
|
-
handleClickImgEvent(evnt, params) {
|
|
28729
|
-
const { showPreview, toolbarConfig, showPrintButton, showDownloadButton, zIndex } = props;
|
|
28730
|
-
const { url } = params;
|
|
28731
|
-
const imgList = computeImgList.value;
|
|
28732
|
-
if (showPreview && url) {
|
|
28733
|
-
openPreviewImage({
|
|
28734
|
-
activeIndex: Math.max(0, XEUtils.findIndexOf(imgList, item => item.url === url)),
|
|
28735
|
-
urlList: imgList,
|
|
28736
|
-
toolbarConfig,
|
|
28737
|
-
showPrintButton,
|
|
28738
|
-
showDownloadButton,
|
|
28739
|
-
zIndex,
|
|
28740
|
-
events: {
|
|
28741
|
-
change(eventParams) {
|
|
28742
|
-
$xeImageGroup.dispatchEvent('change', eventParams, eventParams.$event);
|
|
28743
|
-
},
|
|
28744
|
-
rotate(eventParams) {
|
|
28745
|
-
$xeImageGroup.dispatchEvent('rotate', eventParams, eventParams.$event);
|
|
29329
|
+
padding: false,
|
|
29330
|
+
escClosable: opts.escClosable,
|
|
29331
|
+
zIndex,
|
|
29332
|
+
className: 'vxe-image-preview-popup-wrapper',
|
|
29333
|
+
slots: {
|
|
29334
|
+
default() {
|
|
29335
|
+
return h(VxeImagePreviewComponent, {
|
|
29336
|
+
modelValue: activeIndex,
|
|
29337
|
+
urlList,
|
|
29338
|
+
urlField: opts.urlField,
|
|
29339
|
+
marginSize: opts.marginSize,
|
|
29340
|
+
maskClosable: opts.maskClosable,
|
|
29341
|
+
toolbarConfig: opts.toolbarConfig,
|
|
29342
|
+
showPrintButton: opts.showPrintButton,
|
|
29343
|
+
showDownloadButton: opts.showDownloadButton,
|
|
29344
|
+
beforeDownloadMethod: opts.beforeDownloadMethod,
|
|
29345
|
+
downloadMethod: opts.downloadMethod,
|
|
29346
|
+
onClose() {
|
|
29347
|
+
VxeUI.modal.close(modalId);
|
|
29348
|
+
},
|
|
29349
|
+
onChange(eventParams) {
|
|
29350
|
+
if (change) {
|
|
29351
|
+
change.call(this, eventParams);
|
|
29352
|
+
}
|
|
29353
|
+
},
|
|
29354
|
+
onRotate(eventParams) {
|
|
29355
|
+
if (rotate) {
|
|
29356
|
+
rotate.call(this, eventParams);
|
|
28746
29357
|
}
|
|
28747
29358
|
}
|
|
28748
29359
|
});
|
|
28749
29360
|
}
|
|
28750
|
-
$xeImageGroup.dispatchEvent('click', { url, urlList: imgList }, evnt);
|
|
28751
29361
|
}
|
|
28752
|
-
};
|
|
28753
|
-
Object.assign($xeImageGroup, imageGroupMethods, imageGroupPrivateMethods);
|
|
28754
|
-
const renderVN = () => {
|
|
28755
|
-
const imgList = computeImgList.value;
|
|
28756
|
-
const vSize = computeSize.value;
|
|
28757
|
-
const imgStyleOpts = computeImgStyleOpts.value;
|
|
28758
|
-
const getThumbnailUrlMethod = computeGetThumbnailUrlMethod.value;
|
|
28759
|
-
return h('div', {
|
|
28760
|
-
class: ['vxe-image-group', {
|
|
28761
|
-
[`size--${vSize}`]: vSize
|
|
28762
|
-
}]
|
|
28763
|
-
}, imgList
|
|
28764
|
-
? imgList.map((item, index) => {
|
|
28765
|
-
return h(VxeImageComponent, {
|
|
28766
|
-
key: index,
|
|
28767
|
-
src: item.url,
|
|
28768
|
-
alt: item.alt,
|
|
28769
|
-
width: imgStyleOpts.width,
|
|
28770
|
-
height: imgStyleOpts.height,
|
|
28771
|
-
getThumbnailUrlMethod
|
|
28772
|
-
});
|
|
28773
|
-
})
|
|
28774
|
-
: []);
|
|
28775
|
-
};
|
|
28776
|
-
$xeImageGroup.renderVN = renderVN;
|
|
28777
|
-
provide('$xeImageGroup', $xeImageGroup);
|
|
28778
|
-
return $xeImageGroup;
|
|
28779
|
-
},
|
|
28780
|
-
render() {
|
|
28781
|
-
return this.renderVN();
|
|
28782
|
-
}
|
|
28783
|
-
});
|
|
28784
|
-
|
|
28785
|
-
const VxeImageGroup = Object.assign({}, VxeImageGroupComponent, {
|
|
28786
|
-
install(app) {
|
|
28787
|
-
app.component(VxeImageGroupComponent.name, VxeImageGroupComponent);
|
|
28788
|
-
}
|
|
28789
|
-
});
|
|
28790
|
-
dynamicApp.use(VxeImageGroup);
|
|
28791
|
-
VxeUI.component(VxeImageGroupComponent);
|
|
28792
|
-
const ImageGroup = VxeImageGroup;
|
|
28793
|
-
|
|
28794
|
-
const VxeImagePreview = Object.assign(VxeImagePreviewComponent, {
|
|
28795
|
-
install(app) {
|
|
28796
|
-
app.component(VxeImagePreviewComponent.name, VxeImagePreviewComponent);
|
|
28797
|
-
}
|
|
28798
|
-
});
|
|
28799
|
-
VxeUI.previewImage = openPreviewImage;
|
|
28800
|
-
dynamicApp.use(VxeImagePreview);
|
|
28801
|
-
VxeUI.component(VxeImagePreviewComponent);
|
|
28802
|
-
const ImagePreview = VxeImagePreview;
|
|
28803
|
-
|
|
28804
|
-
/**
|
|
28805
|
-
* 计算滚动条滑块的长度
|
|
28806
|
-
*/
|
|
28807
|
-
function getThumbSize(viewportSize, contentSize, trackSize) {
|
|
28808
|
-
if (contentSize <= viewportSize) {
|
|
28809
|
-
return 0;
|
|
28810
|
-
}
|
|
28811
|
-
const ratio = viewportSize / contentSize;
|
|
28812
|
-
const ideal = trackSize * ratio;
|
|
28813
|
-
return Math.max(20, Math.min(ideal, trackSize));
|
|
28814
|
-
}
|
|
28815
|
-
/**
|
|
28816
|
-
* 计算滚动条滑块的偏移位置
|
|
28817
|
-
*/
|
|
28818
|
-
function getThumbOffsetSize(offsetSize, viewportSize, contentSize, trackSize, thumbSize) {
|
|
28819
|
-
const maxScroll = contentSize - viewportSize;
|
|
28820
|
-
if (maxScroll <= 0) {
|
|
28821
|
-
return 0;
|
|
28822
|
-
}
|
|
28823
|
-
const maxThumbOffset = trackSize - thumbSize;
|
|
28824
|
-
if (maxThumbOffset <= 0) {
|
|
28825
|
-
return 0;
|
|
28826
|
-
}
|
|
28827
|
-
const clamped = Math.min(Math.max(offsetSize, 0), maxScroll);
|
|
28828
|
-
const ratio = clamped / maxScroll;
|
|
28829
|
-
return ratio * maxThumbOffset;
|
|
28830
|
-
}
|
|
28831
|
-
/**
|
|
28832
|
-
* 根据点击轨道的位置,计算滑块的偏移位置
|
|
28833
|
-
*/
|
|
28834
|
-
function getScrollFromClick(clickPosition, viewportSize, contentSize, trackSize, thumbSize) {
|
|
28835
|
-
const maxThumbOffset = trackSize - thumbSize;
|
|
28836
|
-
const maxScroll = contentSize - viewportSize;
|
|
28837
|
-
if (maxScroll <= 0 || maxThumbOffset <= 0) {
|
|
28838
|
-
return 0;
|
|
28839
|
-
}
|
|
28840
|
-
let thumbOffset = clickPosition - thumbSize / 2;
|
|
28841
|
-
thumbOffset = Math.min(Math.max(thumbOffset, 0), maxThumbOffset);
|
|
28842
|
-
const scrollOffset = (thumbOffset / maxThumbOffset) * maxScroll;
|
|
28843
|
-
return scrollOffset;
|
|
28844
|
-
}
|
|
28845
|
-
/**
|
|
28846
|
-
* 拖拽 thumb 时,根据鼠标位置计算滑块的偏移位置
|
|
28847
|
-
*/
|
|
28848
|
-
function getScrollFromDrag(pointerPosition, dragOffset, viewportSize, contentSize, trackSize, thumbSize) {
|
|
28849
|
-
const maxScroll = contentSize - viewportSize;
|
|
28850
|
-
const maxThumbOffset = trackSize - thumbSize;
|
|
28851
|
-
if (maxScroll <= 0 || maxThumbOffset <= 0) {
|
|
28852
|
-
return 0;
|
|
29362
|
+
});
|
|
28853
29363
|
}
|
|
28854
|
-
|
|
28855
|
-
|
|
28856
|
-
return (thumbOffset / maxThumbOffset) * maxScroll;
|
|
28857
|
-
}
|
|
29364
|
+
return Promise.resolve();
|
|
29365
|
+
};
|
|
28858
29366
|
|
|
28859
|
-
const { getConfig: getConfig$2, createEvent, domUtils, globalResize, globalEvents, renderEmptyElement } = VxeUI;
|
|
28860
|
-
function createReactData$d() {
|
|
28861
|
-
return {
|
|
28862
|
-
yThumbHeight: 0,
|
|
28863
|
-
xThumbWidth: 0
|
|
28864
|
-
};
|
|
28865
|
-
}
|
|
28866
29367
|
function createInternalData$c() {
|
|
28867
29368
|
return {
|
|
28868
|
-
|
|
28869
|
-
|
|
28870
|
-
thumbDragOffset: 0,
|
|
28871
|
-
yThumbTop: 0,
|
|
28872
|
-
xThumbLeft: 0,
|
|
28873
|
-
lastScrollTop: 0,
|
|
28874
|
-
lastScrollLeft: 0
|
|
29369
|
+
// dgTime: 0,
|
|
29370
|
+
// mdTime: 0
|
|
28875
29371
|
};
|
|
28876
29372
|
}
|
|
28877
|
-
|
|
28878
|
-
|
|
29373
|
+
function createReactData$d() {
|
|
29374
|
+
return {};
|
|
29375
|
+
}
|
|
29376
|
+
var VxeImageComponent = defineVxeComponent({
|
|
29377
|
+
name: 'VxeImage',
|
|
28879
29378
|
props: {
|
|
28880
|
-
|
|
29379
|
+
src: [String, Array],
|
|
29380
|
+
alt: [String, Number],
|
|
29381
|
+
loading: String,
|
|
29382
|
+
title: [String, Number],
|
|
28881
29383
|
width: [String, Number],
|
|
28882
29384
|
height: [String, Number],
|
|
28883
29385
|
minWidth: [String, Number],
|
|
28884
29386
|
minHeight: [String, Number],
|
|
28885
29387
|
maxWidth: [String, Number],
|
|
28886
29388
|
maxHeight: [String, Number],
|
|
28887
|
-
|
|
28888
|
-
|
|
29389
|
+
circle: Boolean,
|
|
29390
|
+
draggable: {
|
|
28889
29391
|
type: Boolean,
|
|
28890
|
-
default: () => getConfig$
|
|
29392
|
+
default: () => getConfig$4().image.draggable
|
|
28891
29393
|
},
|
|
28892
|
-
|
|
29394
|
+
zIndex: Number,
|
|
29395
|
+
maskClosable: {
|
|
28893
29396
|
type: Boolean,
|
|
28894
|
-
default: () => getConfig$
|
|
29397
|
+
default: () => getConfig$4().image.maskClosable
|
|
28895
29398
|
},
|
|
28896
|
-
|
|
28897
|
-
|
|
28898
|
-
|
|
28899
|
-
|
|
28900
|
-
default: () => getConfig$2().scrollbar.className
|
|
29399
|
+
toolbarConfig: Object,
|
|
29400
|
+
showPreview: {
|
|
29401
|
+
type: Boolean,
|
|
29402
|
+
default: () => getConfig$4().image.showPreview
|
|
28901
29403
|
},
|
|
28902
|
-
|
|
28903
|
-
type:
|
|
28904
|
-
default: () => getConfig$
|
|
29404
|
+
showPrintButton: {
|
|
29405
|
+
type: Boolean,
|
|
29406
|
+
default: () => getConfig$4().image.showPrintButton
|
|
28905
29407
|
},
|
|
28906
|
-
|
|
28907
|
-
type:
|
|
28908
|
-
default: () => getConfig$
|
|
29408
|
+
showDownloadButton: {
|
|
29409
|
+
type: Boolean,
|
|
29410
|
+
default: () => getConfig$4().image.showDownloadButton
|
|
28909
29411
|
},
|
|
28910
|
-
|
|
29412
|
+
size: {
|
|
28911
29413
|
type: String,
|
|
28912
|
-
default: () => getConfig$
|
|
28913
|
-
},
|
|
28914
|
-
autoResize: {
|
|
28915
|
-
type: Boolean,
|
|
28916
|
-
default: () => getConfig$2().scrollbar.autoResize
|
|
29414
|
+
default: () => getConfig$4().image.size || getConfig$4().size
|
|
28917
29415
|
},
|
|
28918
|
-
|
|
29416
|
+
getThumbnailUrlMethod: Function
|
|
28919
29417
|
},
|
|
28920
29418
|
emits: [
|
|
28921
|
-
'
|
|
28922
|
-
'
|
|
29419
|
+
'click',
|
|
29420
|
+
'change',
|
|
29421
|
+
'rotate',
|
|
29422
|
+
'dragstart',
|
|
29423
|
+
'drag',
|
|
29424
|
+
'dragend'
|
|
28923
29425
|
],
|
|
28924
29426
|
setup(props, context) {
|
|
28925
|
-
const { emit
|
|
29427
|
+
const { emit } = context;
|
|
28926
29428
|
const xID = XEUtils.uniqueId();
|
|
29429
|
+
const $xeImageGroup = inject('$xeImageGroup', null);
|
|
28927
29430
|
const refElem = ref();
|
|
28928
|
-
const
|
|
28929
|
-
const refViewInnerElem = ref();
|
|
28930
|
-
const refTrackXElem = ref();
|
|
28931
|
-
const refTrackYElem = ref();
|
|
28932
|
-
const refThumbXElem = ref();
|
|
28933
|
-
const refThumbYElem = ref();
|
|
28934
|
-
const reactData = reactive(createReactData$d());
|
|
29431
|
+
const { computeSize } = useSize(props);
|
|
28935
29432
|
const internalData = createInternalData$c();
|
|
28936
|
-
const
|
|
28937
|
-
const { width, height, minWidth, minHeight, maxWidth, maxHeight } = props;
|
|
28938
|
-
const xOpts = computeXOpts.value;
|
|
28939
|
-
const yOpts = computeYOpts.value;
|
|
28940
|
-
const stys = {};
|
|
28941
|
-
if (width) {
|
|
28942
|
-
stys.width = toCssUnit(width);
|
|
28943
|
-
}
|
|
28944
|
-
if (height) {
|
|
28945
|
-
stys.height = toCssUnit(height);
|
|
28946
|
-
}
|
|
28947
|
-
if (minWidth) {
|
|
28948
|
-
stys.minWidth = toCssUnit(minWidth);
|
|
28949
|
-
}
|
|
28950
|
-
if (minHeight) {
|
|
28951
|
-
stys.minHeight = toCssUnit(minHeight);
|
|
28952
|
-
}
|
|
28953
|
-
if (maxWidth) {
|
|
28954
|
-
stys.maxWidth = toCssUnit(maxWidth);
|
|
28955
|
-
}
|
|
28956
|
-
if (maxHeight) {
|
|
28957
|
-
stys.maxHeight = toCssUnit(maxHeight);
|
|
28958
|
-
}
|
|
28959
|
-
if (yOpts.width) {
|
|
28960
|
-
stys['--vxe-ui-scrollbar-y-width'] = toCssUnit(yOpts.width);
|
|
28961
|
-
}
|
|
28962
|
-
if (xOpts.height) {
|
|
28963
|
-
stys['--vxe-ui-scrollbar-x-height'] = toCssUnit(xOpts.height);
|
|
28964
|
-
}
|
|
28965
|
-
return stys;
|
|
28966
|
-
});
|
|
28967
|
-
const computeWrapperClss = computed(() => {
|
|
28968
|
-
const { native, className, padding } = props;
|
|
28969
|
-
const { yThumbHeight, xThumbWidth } = reactData;
|
|
28970
|
-
const xOpts = computeXOpts.value;
|
|
28971
|
-
const yOpts = computeYOpts.value;
|
|
28972
|
-
const xToTop = computeXToTop.value;
|
|
28973
|
-
const yToLeft = computeYToLeft.value;
|
|
28974
|
-
return domUtils.buildClass([
|
|
28975
|
-
'vxe-scrollbar',
|
|
28976
|
-
`ov-x--${xOpts.visible || 'visible'}`,
|
|
28977
|
-
`ov-y--${yOpts.visible || 'visible'}`,
|
|
28978
|
-
`sx-pos--${xToTop ? 'top' : 'bottom'}`,
|
|
28979
|
-
`sy-pos--${yToLeft ? 'left' : 'right'}`,
|
|
28980
|
-
native ? 'is--native' : 'is--virtual',
|
|
28981
|
-
className
|
|
28982
|
-
], {
|
|
28983
|
-
'is--padding': padding,
|
|
28984
|
-
'ov-x--auto-hide': xOpts.autoHide,
|
|
28985
|
-
'ov-y--auto-hide': yOpts.autoHide,
|
|
28986
|
-
'overflow-y': yThumbHeight,
|
|
28987
|
-
'overflow-x': xThumbWidth
|
|
28988
|
-
});
|
|
28989
|
-
});
|
|
28990
|
-
const computeViewClss = computed(() => {
|
|
28991
|
-
const { viewClassName } = props;
|
|
28992
|
-
return domUtils.buildClass([
|
|
28993
|
-
'vxe-scrollbar--view',
|
|
28994
|
-
viewClassName
|
|
28995
|
-
]);
|
|
28996
|
-
});
|
|
28997
|
-
const computeViewInnerClss = computed(() => {
|
|
28998
|
-
const { viewInnerClassName } = props;
|
|
28999
|
-
return domUtils.buildClass([
|
|
29000
|
-
'vxe-scrollbar--view-inner',
|
|
29001
|
-
viewInnerClassName
|
|
29002
|
-
]);
|
|
29003
|
-
});
|
|
29004
|
-
const computeXOpts = computed(() => {
|
|
29005
|
-
return Object.assign({}, getConfig$2().scrollbar.xConfig, props.xConfig);
|
|
29006
|
-
});
|
|
29007
|
-
const computeYOpts = computed(() => {
|
|
29008
|
-
return Object.assign({}, getConfig$2().scrollbar.yConfig, props.yConfig);
|
|
29009
|
-
});
|
|
29010
|
-
const computeXToTop = computed(() => {
|
|
29011
|
-
const xOpts = computeXOpts.value;
|
|
29012
|
-
return xOpts.position === 'top';
|
|
29013
|
-
});
|
|
29014
|
-
const computeYToLeft = computed(() => {
|
|
29015
|
-
const yOpts = computeYOpts.value;
|
|
29016
|
-
return yOpts.position === 'left';
|
|
29017
|
-
});
|
|
29433
|
+
const reactData = reactive(createReactData$d());
|
|
29018
29434
|
const refMaps = {
|
|
29019
29435
|
refElem
|
|
29020
29436
|
};
|
|
29021
|
-
const
|
|
29022
|
-
|
|
29023
|
-
|
|
29024
|
-
|
|
29025
|
-
|
|
29026
|
-
|
|
29027
|
-
|
|
29028
|
-
|
|
29029
|
-
getComputeMaps: () => computeMaps
|
|
29030
|
-
};
|
|
29031
|
-
const dispatchEvent = (type, params, evnt) => {
|
|
29032
|
-
emit(type, createEvent(evnt, { $scrollbar: $xeScrollbar }, params));
|
|
29033
|
-
};
|
|
29034
|
-
const scrollbarMethods = {
|
|
29035
|
-
dispatchEvent,
|
|
29036
|
-
scrollTo(left, top) {
|
|
29037
|
-
const viewEl = refViewElem.value;
|
|
29038
|
-
if (viewEl) {
|
|
29039
|
-
if (XEUtils.isNumber(left)) {
|
|
29040
|
-
viewEl.scrollTo(left, top || 0);
|
|
29041
|
-
}
|
|
29042
|
-
else {
|
|
29043
|
-
viewEl.scrollTo(left);
|
|
29044
|
-
}
|
|
29045
|
-
}
|
|
29046
|
-
},
|
|
29047
|
-
scrollIntoView() {
|
|
29048
|
-
const viewEl = refViewElem.value;
|
|
29049
|
-
if (viewEl) {
|
|
29050
|
-
viewEl.scrollIntoView();
|
|
29051
|
-
}
|
|
29052
|
-
},
|
|
29053
|
-
setScrollTop(top) {
|
|
29054
|
-
const viewEl = refViewElem.value;
|
|
29055
|
-
if (viewEl) {
|
|
29056
|
-
viewEl.scrollTop = top;
|
|
29057
|
-
}
|
|
29058
|
-
},
|
|
29059
|
-
setScrollLeft(left) {
|
|
29060
|
-
const viewEl = refViewElem.value;
|
|
29061
|
-
if (viewEl) {
|
|
29062
|
-
viewEl.scrollLeft = left;
|
|
29063
|
-
}
|
|
29064
|
-
},
|
|
29065
|
-
getScrollTop() {
|
|
29066
|
-
const viewEl = refViewElem.value;
|
|
29067
|
-
if (viewEl) {
|
|
29068
|
-
return viewEl.scrollTop;
|
|
29069
|
-
}
|
|
29070
|
-
return 0;
|
|
29071
|
-
},
|
|
29072
|
-
getScrollLeft() {
|
|
29073
|
-
const viewEl = refViewElem.value;
|
|
29074
|
-
if (viewEl) {
|
|
29075
|
-
return viewEl.scrollLeft;
|
|
29076
|
-
}
|
|
29077
|
-
return 0;
|
|
29078
|
-
},
|
|
29079
|
-
clearScroll() {
|
|
29080
|
-
const viewEl = refViewElem.value;
|
|
29081
|
-
if (viewEl) {
|
|
29082
|
-
viewEl.scrollTop = 0;
|
|
29083
|
-
viewEl.scrollLeft = 0;
|
|
29084
|
-
}
|
|
29085
|
-
},
|
|
29086
|
-
recalculate() {
|
|
29087
|
-
updateThumbSize();
|
|
29088
|
-
updateThumbOffset();
|
|
29089
|
-
return nextTick();
|
|
29090
|
-
}
|
|
29091
|
-
};
|
|
29092
|
-
const updateThumbSize = () => {
|
|
29093
|
-
const viewEl = refViewElem.value;
|
|
29094
|
-
if (!viewEl) {
|
|
29095
|
-
return;
|
|
29096
|
-
}
|
|
29097
|
-
const trackXEl = refTrackXElem.value;
|
|
29098
|
-
const xThumbWidth = trackXEl ? getThumbSize(viewEl.clientWidth, viewEl.scrollWidth, trackXEl.clientWidth) : 0;
|
|
29099
|
-
const thumbXElem = refThumbXElem.value;
|
|
29100
|
-
if (thumbXElem) {
|
|
29101
|
-
thumbXElem.style.width = xThumbWidth + 'px';
|
|
29102
|
-
}
|
|
29103
|
-
reactData.xThumbWidth = xThumbWidth;
|
|
29104
|
-
const trackYEl = refTrackYElem.value;
|
|
29105
|
-
const yThumbHeight = trackYEl ? getThumbSize(viewEl.clientHeight, viewEl.scrollHeight, trackYEl.clientHeight) : 0;
|
|
29106
|
-
const thumbYElem = refThumbYElem.value;
|
|
29107
|
-
if (thumbYElem) {
|
|
29108
|
-
thumbYElem.style.height = yThumbHeight + 'px';
|
|
29109
|
-
}
|
|
29110
|
-
reactData.yThumbHeight = yThumbHeight;
|
|
29111
|
-
};
|
|
29112
|
-
const updateThumbOffset = () => {
|
|
29113
|
-
const viewEl = refViewElem.value;
|
|
29114
|
-
if (!viewEl) {
|
|
29115
|
-
return;
|
|
29116
|
-
}
|
|
29117
|
-
const { xThumbWidth, yThumbHeight } = reactData;
|
|
29118
|
-
const trackXEl = refTrackXElem.value;
|
|
29119
|
-
const thumbXElem = refThumbXElem.value;
|
|
29120
|
-
const xThumbLeft = trackXEl && xThumbWidth ? getThumbOffsetSize(viewEl.scrollLeft, viewEl.clientWidth, viewEl.scrollWidth, trackXEl.clientWidth, xThumbWidth) : 0;
|
|
29121
|
-
internalData.xThumbLeft = xThumbLeft;
|
|
29122
|
-
if (thumbXElem && xThumbWidth) {
|
|
29123
|
-
thumbXElem.style.width = xThumbWidth + 'px';
|
|
29124
|
-
thumbXElem.style.transform = `translateX(${xThumbLeft}px)`;
|
|
29125
|
-
}
|
|
29126
|
-
const trackYEl = refTrackYElem.value;
|
|
29127
|
-
const thumbYElem = refThumbYElem.value;
|
|
29128
|
-
const yThumbTop = trackYEl && yThumbHeight ? getThumbOffsetSize(viewEl.scrollTop, viewEl.clientHeight, viewEl.scrollHeight, trackYEl.clientHeight, yThumbHeight) : 0;
|
|
29129
|
-
internalData.yThumbTop = yThumbTop;
|
|
29130
|
-
if (thumbYElem && yThumbHeight) {
|
|
29131
|
-
thumbYElem.style.height = yThumbHeight + 'px';
|
|
29132
|
-
thumbYElem.style.transform = `translateY(${yThumbTop}px)`;
|
|
29133
|
-
}
|
|
29134
|
-
};
|
|
29135
|
-
const scrollEvent = (evnt) => {
|
|
29136
|
-
const { xThumbWidth, yThumbHeight } = reactData;
|
|
29137
|
-
const { lastScrollTop, lastScrollLeft } = internalData;
|
|
29138
|
-
const xOpts = computeXOpts.value;
|
|
29139
|
-
const yOpts = computeYOpts.value;
|
|
29140
|
-
const viewEl = evnt.currentTarget;
|
|
29141
|
-
const { scrollTop, scrollLeft, clientWidth, clientHeight, scrollHeight, scrollWidth } = viewEl;
|
|
29142
|
-
let direction = '';
|
|
29143
|
-
let isTopBoundary = false;
|
|
29144
|
-
let isBottomBoundary = false;
|
|
29145
|
-
let isLeftBoundary = false;
|
|
29146
|
-
let isRightBoundary = false;
|
|
29147
|
-
if (lastScrollTop !== scrollTop) {
|
|
29148
|
-
const yThreshold = XEUtils.toNumber(yOpts.threshold) || 1;
|
|
29149
|
-
if (lastScrollTop < scrollTop) {
|
|
29150
|
-
direction = 'bottom';
|
|
29151
|
-
if (yThumbHeight > 0 && scrollTop + clientHeight >= scrollHeight - yThreshold) {
|
|
29152
|
-
isBottomBoundary = true;
|
|
29153
|
-
}
|
|
29437
|
+
const computeWrapperStyle = computed(() => {
|
|
29438
|
+
const { width, height, circle } = props;
|
|
29439
|
+
const stys = {};
|
|
29440
|
+
if (circle) {
|
|
29441
|
+
// 圆形只能生效一个
|
|
29442
|
+
if (width) {
|
|
29443
|
+
stys.width = toCssUnit(width);
|
|
29444
|
+
stys.height = toCssUnit(width);
|
|
29154
29445
|
}
|
|
29155
|
-
else {
|
|
29156
|
-
|
|
29157
|
-
|
|
29158
|
-
isTopBoundary = true;
|
|
29159
|
-
}
|
|
29446
|
+
else if (height) {
|
|
29447
|
+
stys.width = toCssUnit(height);
|
|
29448
|
+
stys.height = toCssUnit(height);
|
|
29160
29449
|
}
|
|
29161
29450
|
}
|
|
29162
|
-
|
|
29163
|
-
|
|
29164
|
-
|
|
29165
|
-
|
|
29166
|
-
|
|
29167
|
-
|
|
29168
|
-
}
|
|
29169
|
-
}
|
|
29170
|
-
else {
|
|
29171
|
-
direction = 'left';
|
|
29172
|
-
if (xThumbWidth > 0 && scrollLeft <= xThreshold) {
|
|
29173
|
-
isLeftBoundary = true;
|
|
29174
|
-
}
|
|
29451
|
+
else {
|
|
29452
|
+
if (width) {
|
|
29453
|
+
stys.width = toCssUnit(width);
|
|
29454
|
+
}
|
|
29455
|
+
if (height) {
|
|
29456
|
+
stys.height = toCssUnit(height);
|
|
29175
29457
|
}
|
|
29176
29458
|
}
|
|
29177
|
-
|
|
29178
|
-
|
|
29179
|
-
|
|
29180
|
-
|
|
29181
|
-
|
|
29182
|
-
|
|
29183
|
-
|
|
29184
|
-
|
|
29185
|
-
isLeft: isLeftBoundary,
|
|
29186
|
-
isRight: isRightBoundary,
|
|
29187
|
-
scrollTop: scrollTop,
|
|
29188
|
-
scrollLeft: scrollLeft,
|
|
29189
|
-
clientWidth: clientWidth,
|
|
29190
|
-
clientHeight: clientHeight,
|
|
29191
|
-
scrollHeight: scrollHeight,
|
|
29192
|
-
scrollWidth: scrollWidth
|
|
29193
|
-
}, evnt);
|
|
29194
|
-
}
|
|
29195
|
-
dispatchEvent('scroll', {
|
|
29196
|
-
direction: direction,
|
|
29197
|
-
isTop: yThumbHeight > 0 && scrollTop <= 0,
|
|
29198
|
-
isBottom: yThumbHeight > 0 && scrollTop + clientHeight >= scrollHeight,
|
|
29199
|
-
isLeft: xThumbWidth > 0 && scrollLeft <= 0,
|
|
29200
|
-
isRight: xThumbWidth > 0 && scrollLeft + clientWidth >= scrollWidth,
|
|
29201
|
-
scrollTop: scrollTop,
|
|
29202
|
-
scrollLeft: scrollLeft,
|
|
29203
|
-
clientWidth: clientWidth,
|
|
29204
|
-
clientHeight: clientHeight,
|
|
29205
|
-
scrollHeight: scrollHeight,
|
|
29206
|
-
scrollWidth: scrollWidth
|
|
29207
|
-
}, evnt);
|
|
29208
|
-
};
|
|
29209
|
-
const clickTrackXEvent = (evnt) => {
|
|
29210
|
-
const trackEl = evnt.currentTarget;
|
|
29211
|
-
if (trackEl !== evnt.target) {
|
|
29212
|
-
return;
|
|
29213
|
-
}
|
|
29214
|
-
const viewEl = refViewElem.value;
|
|
29215
|
-
if (!viewEl) {
|
|
29216
|
-
return;
|
|
29459
|
+
return stys;
|
|
29460
|
+
});
|
|
29461
|
+
const computeImgStyle = computed(() => {
|
|
29462
|
+
const { width, height, minWidth, minHeight, maxHeight, maxWidth } = props;
|
|
29463
|
+
const stys = {};
|
|
29464
|
+
if (width && height) {
|
|
29465
|
+
stys.maxWidth = toCssUnit(width);
|
|
29466
|
+
stys.maxHeight = toCssUnit(height);
|
|
29217
29467
|
}
|
|
29218
|
-
|
|
29219
|
-
|
|
29220
|
-
|
|
29221
|
-
|
|
29222
|
-
|
|
29223
|
-
|
|
29224
|
-
|
|
29225
|
-
|
|
29226
|
-
|
|
29227
|
-
|
|
29228
|
-
|
|
29468
|
+
else {
|
|
29469
|
+
if (width) {
|
|
29470
|
+
stys.width = toCssUnit(width);
|
|
29471
|
+
}
|
|
29472
|
+
if (height) {
|
|
29473
|
+
stys.height = toCssUnit(height);
|
|
29474
|
+
}
|
|
29475
|
+
if (minWidth) {
|
|
29476
|
+
stys.minWidth = toCssUnit(minWidth);
|
|
29477
|
+
}
|
|
29478
|
+
if (minHeight) {
|
|
29479
|
+
stys.minHeight = toCssUnit(minHeight);
|
|
29480
|
+
}
|
|
29481
|
+
if (maxWidth) {
|
|
29482
|
+
stys.maxWidth = toCssUnit(maxWidth);
|
|
29483
|
+
}
|
|
29484
|
+
if (maxHeight) {
|
|
29485
|
+
stys.maxHeight = toCssUnit(maxHeight);
|
|
29486
|
+
}
|
|
29229
29487
|
}
|
|
29230
|
-
|
|
29231
|
-
|
|
29232
|
-
|
|
29488
|
+
return stys;
|
|
29489
|
+
});
|
|
29490
|
+
const computeImgList = computed(() => {
|
|
29491
|
+
const { src } = props;
|
|
29492
|
+
if (src) {
|
|
29493
|
+
return (XEUtils.isArray(src) ? src : [src]).map(item => {
|
|
29494
|
+
if (XEUtils.isString(item)) {
|
|
29495
|
+
return {
|
|
29496
|
+
url: item,
|
|
29497
|
+
alt: ''
|
|
29498
|
+
};
|
|
29499
|
+
}
|
|
29500
|
+
return {
|
|
29501
|
+
url: item.url,
|
|
29502
|
+
alt: item.alt
|
|
29503
|
+
};
|
|
29504
|
+
});
|
|
29233
29505
|
}
|
|
29234
|
-
|
|
29235
|
-
|
|
29236
|
-
|
|
29237
|
-
|
|
29238
|
-
|
|
29239
|
-
|
|
29506
|
+
return [];
|
|
29507
|
+
});
|
|
29508
|
+
const computeImgItem = computed(() => {
|
|
29509
|
+
const imgList = computeImgList.value;
|
|
29510
|
+
return imgList[0];
|
|
29511
|
+
});
|
|
29512
|
+
const computeImgUrl = computed(() => {
|
|
29513
|
+
const imgItem = computeImgItem.value;
|
|
29514
|
+
return imgItem ? `${imgItem.url || ''}` : '';
|
|
29515
|
+
});
|
|
29516
|
+
const computeImgThumbnailUrl = computed(() => {
|
|
29517
|
+
const getThumbnailUrlFn = props.getThumbnailUrlMethod || getConfig$4().image.getThumbnailUrlMethod;
|
|
29518
|
+
const imgUrl = computeImgUrl.value;
|
|
29519
|
+
return getThumbnailUrlFn ? getThumbnailUrlFn({ url: imgUrl, $image: $xeImage }) : '';
|
|
29520
|
+
});
|
|
29521
|
+
const computeMaps = {
|
|
29522
|
+
computeSize
|
|
29240
29523
|
};
|
|
29241
|
-
const
|
|
29242
|
-
|
|
29243
|
-
|
|
29244
|
-
|
|
29245
|
-
|
|
29246
|
-
|
|
29247
|
-
|
|
29248
|
-
|
|
29249
|
-
const { xThumbWidth } = reactData;
|
|
29250
|
-
const trackEl = thumbEl.parentElement;
|
|
29251
|
-
const trackRect = trackEl.getBoundingClientRect();
|
|
29252
|
-
const pointerPosition = evnt.clientX - trackRect.left;
|
|
29253
|
-
// 记录 thumb 的偏移
|
|
29254
|
-
const thumbOffset = getThumbOffsetSize(viewEl.scrollLeft, viewEl.clientWidth, viewEl.scrollWidth, trackEl.clientWidth, xThumbWidth);
|
|
29255
|
-
internalData.thumbDragOffset = pointerPosition - thumbOffset;
|
|
29524
|
+
const $xeImage = {
|
|
29525
|
+
xID,
|
|
29526
|
+
props,
|
|
29527
|
+
context,
|
|
29528
|
+
reactData,
|
|
29529
|
+
internalData,
|
|
29530
|
+
getRefMaps: () => refMaps,
|
|
29531
|
+
getComputeMaps: () => computeMaps
|
|
29256
29532
|
};
|
|
29257
|
-
const
|
|
29258
|
-
|
|
29259
|
-
if (!thumbEl.hasPointerCapture(evnt.pointerId)) {
|
|
29260
|
-
return;
|
|
29261
|
-
}
|
|
29262
|
-
const { isThumbDrag, thumbDragOffset } = internalData;
|
|
29263
|
-
if (isThumbDrag) {
|
|
29264
|
-
const viewEl = refViewElem.value;
|
|
29265
|
-
if (!viewEl) {
|
|
29266
|
-
return;
|
|
29267
|
-
}
|
|
29268
|
-
const { xThumbWidth } = reactData;
|
|
29269
|
-
const thumbEl = evnt.currentTarget;
|
|
29270
|
-
const trackEl = thumbEl.parentElement;
|
|
29271
|
-
const trackRect = trackEl.getBoundingClientRect();
|
|
29272
|
-
// 更新偏移
|
|
29273
|
-
viewEl.scrollLeft = getScrollFromDrag(evnt.clientX - trackRect.left, thumbDragOffset, viewEl.clientWidth, viewEl.scrollWidth, trackEl.clientWidth, xThumbWidth);
|
|
29274
|
-
}
|
|
29533
|
+
const dispatchEvent = (type, params, evnt) => {
|
|
29534
|
+
emit(type, createEvent$1(evnt, { $image: $xeImage }, params));
|
|
29275
29535
|
};
|
|
29276
|
-
const
|
|
29277
|
-
|
|
29278
|
-
thumbEl.releasePointerCapture(evnt.pointerId);
|
|
29279
|
-
internalData.isThumbDrag = false;
|
|
29536
|
+
const imageMethods = {
|
|
29537
|
+
dispatchEvent
|
|
29280
29538
|
};
|
|
29281
|
-
const
|
|
29282
|
-
const
|
|
29283
|
-
|
|
29284
|
-
|
|
29285
|
-
const viewEl = refViewElem.value;
|
|
29286
|
-
if (!viewEl) {
|
|
29539
|
+
const clickEvent = (evnt) => {
|
|
29540
|
+
const { showPreview, toolbarConfig, showPrintButton, showDownloadButton, maskClosable, zIndex } = props;
|
|
29541
|
+
const { mdTime, dgTime } = internalData;
|
|
29542
|
+
if (mdTime && dgTime && dgTime > mdTime) {
|
|
29287
29543
|
return;
|
|
29288
29544
|
}
|
|
29289
|
-
const
|
|
29290
|
-
const
|
|
29291
|
-
|
|
29292
|
-
|
|
29293
|
-
// 记录 thumb 的偏移
|
|
29294
|
-
const thumbOffset = getThumbOffsetSize(viewEl.scrollTop, viewEl.clientHeight, viewEl.scrollHeight, trackEl.clientHeight, yThumbHeight);
|
|
29295
|
-
internalData.thumbDragOffset = pointerPosition - thumbOffset;
|
|
29296
|
-
};
|
|
29297
|
-
const pointermoveThumbYEvent = (evnt) => {
|
|
29298
|
-
const thumbEl = evnt.currentTarget;
|
|
29299
|
-
if (!thumbEl.hasPointerCapture(evnt.pointerId)) {
|
|
29300
|
-
return;
|
|
29545
|
+
const imgList = computeImgList.value;
|
|
29546
|
+
const imgUrl = computeImgUrl.value;
|
|
29547
|
+
if ($xeImageGroup) {
|
|
29548
|
+
$xeImageGroup.handleClickImgEvent(evnt, { url: imgUrl });
|
|
29301
29549
|
}
|
|
29302
|
-
|
|
29303
|
-
|
|
29304
|
-
|
|
29305
|
-
|
|
29306
|
-
|
|
29550
|
+
else {
|
|
29551
|
+
if (showPreview && imgUrl) {
|
|
29552
|
+
openPreviewImage({
|
|
29553
|
+
urlList: imgList,
|
|
29554
|
+
toolbarConfig,
|
|
29555
|
+
showPrintButton,
|
|
29556
|
+
showDownloadButton,
|
|
29557
|
+
maskClosable,
|
|
29558
|
+
zIndex,
|
|
29559
|
+
events: {
|
|
29560
|
+
change(eventParams) {
|
|
29561
|
+
dispatchEvent('change', eventParams, eventParams.$event);
|
|
29562
|
+
},
|
|
29563
|
+
rotate(eventParams) {
|
|
29564
|
+
dispatchEvent('rotate', eventParams, eventParams.$event);
|
|
29565
|
+
}
|
|
29566
|
+
}
|
|
29567
|
+
});
|
|
29307
29568
|
}
|
|
29308
|
-
|
|
29309
|
-
const thumbEl = evnt.currentTarget;
|
|
29310
|
-
const trackEl = thumbEl.parentElement;
|
|
29311
|
-
const trackRect = trackEl.getBoundingClientRect();
|
|
29312
|
-
// 更新偏移
|
|
29313
|
-
viewEl.scrollTop = getScrollFromDrag(evnt.clientY - trackRect.top, thumbDragOffset, viewEl.clientHeight, viewEl.scrollHeight, trackEl.clientHeight, yThumbHeight);
|
|
29569
|
+
dispatchEvent('click', { url: imgUrl }, evnt);
|
|
29314
29570
|
}
|
|
29315
29571
|
};
|
|
29316
|
-
const
|
|
29317
|
-
|
|
29572
|
+
const mousedownEvent = () => {
|
|
29573
|
+
internalData.mdTime = Date.now();
|
|
29574
|
+
};
|
|
29575
|
+
const handleDragstartEvent = (evnt) => {
|
|
29576
|
+
internalData.dgTime = Date.now();
|
|
29577
|
+
dispatchEvent('dragstart', {}, evnt);
|
|
29578
|
+
};
|
|
29579
|
+
const handleDragEvent = (evnt) => {
|
|
29580
|
+
dispatchEvent(evnt.type, {}, evnt);
|
|
29581
|
+
};
|
|
29582
|
+
const imagePrivateMethods = {};
|
|
29583
|
+
Object.assign($xeImage, imageMethods, imagePrivateMethods);
|
|
29318
29584
|
const renderVN = () => {
|
|
29319
|
-
const {
|
|
29585
|
+
const { alt, loading, circle, draggable } = props;
|
|
29320
29586
|
const wrapperStyle = computeWrapperStyle.value;
|
|
29321
|
-
const
|
|
29322
|
-
const
|
|
29323
|
-
const
|
|
29324
|
-
const
|
|
29325
|
-
|
|
29326
|
-
|
|
29587
|
+
const imgStyle = computeImgStyle.value;
|
|
29588
|
+
const imgUrl = computeImgUrl.value;
|
|
29589
|
+
const imgThumbnailUrl = computeImgThumbnailUrl.value;
|
|
29590
|
+
const vSize = computeSize.value;
|
|
29591
|
+
let imgDrag;
|
|
29592
|
+
if (!XEUtils.eqNull(draggable)) {
|
|
29593
|
+
imgDrag = !!(draggable === true || draggable === 'true');
|
|
29594
|
+
}
|
|
29327
29595
|
return h('div', {
|
|
29328
|
-
|
|
29329
|
-
|
|
29330
|
-
|
|
29596
|
+
class: ['vxe-image', {
|
|
29597
|
+
[`size--${vSize}`]: vSize,
|
|
29598
|
+
'is--circle': circle
|
|
29599
|
+
}],
|
|
29331
29600
|
style: wrapperStyle
|
|
29332
29601
|
}, [
|
|
29333
|
-
h('
|
|
29334
|
-
|
|
29335
|
-
|
|
29336
|
-
|
|
29337
|
-
|
|
29338
|
-
|
|
29339
|
-
|
|
29340
|
-
|
|
29341
|
-
|
|
29342
|
-
:
|
|
29343
|
-
|
|
29344
|
-
|
|
29345
|
-
|
|
29346
|
-
}, [
|
|
29347
|
-
h('div', {
|
|
29348
|
-
ref: refThumbXElem,
|
|
29349
|
-
class: 'vxe-scrollbar--thumb-x',
|
|
29350
|
-
onPointerdown: pointerdownThumbXEvent,
|
|
29351
|
-
onPointermove: pointermoveThumbXEvent,
|
|
29352
|
-
onPointerup: cleatPointerThumbEvent,
|
|
29353
|
-
onPointercancel: cleatPointerThumbEvent,
|
|
29354
|
-
onLostpointercapture: cleatPointerThumbEvent
|
|
29355
|
-
})
|
|
29356
|
-
]),
|
|
29357
|
-
native || yOpts.visible === 'hidden'
|
|
29358
|
-
? renderEmptyElement($xeScrollbar)
|
|
29359
|
-
: h('div', {
|
|
29360
|
-
ref: refTrackYElem,
|
|
29361
|
-
class: 'vxe-scrollbar--track-y',
|
|
29362
|
-
onClick: clickTrackYEvent
|
|
29363
|
-
}, [
|
|
29364
|
-
h('div', {
|
|
29365
|
-
ref: refThumbYElem,
|
|
29366
|
-
class: 'vxe-scrollbar--thumb-y',
|
|
29367
|
-
onPointerdown: pointerdownThumbYEvent,
|
|
29368
|
-
onPointermove: pointermoveThumbYEvent,
|
|
29369
|
-
onPointerup: cleatPointerThumbEvent,
|
|
29370
|
-
onPointercancel: cleatPointerThumbEvent,
|
|
29371
|
-
onLostpointercapture: cleatPointerThumbEvent
|
|
29372
|
-
})
|
|
29373
|
-
]),
|
|
29374
|
-
h(VxeLoading, {
|
|
29375
|
-
class: 'vxe-scrollbar--loading',
|
|
29376
|
-
modelValue: loading
|
|
29602
|
+
h('img', {
|
|
29603
|
+
ref: refElem,
|
|
29604
|
+
class: 'vxe-image-img',
|
|
29605
|
+
src: imgThumbnailUrl || imgUrl,
|
|
29606
|
+
alt,
|
|
29607
|
+
loading,
|
|
29608
|
+
draggable: imgDrag,
|
|
29609
|
+
style: imgStyle,
|
|
29610
|
+
onMousedown: mousedownEvent,
|
|
29611
|
+
onClick: clickEvent,
|
|
29612
|
+
onDragstart: handleDragstartEvent,
|
|
29613
|
+
onDrag: handleDragEvent,
|
|
29614
|
+
onDragend: handleDragEvent
|
|
29377
29615
|
})
|
|
29378
29616
|
]);
|
|
29379
29617
|
};
|
|
29380
|
-
|
|
29381
|
-
|
|
29382
|
-
|
|
29383
|
-
});
|
|
29384
|
-
watch(() => props.width, () => {
|
|
29385
|
-
reFlag.value++;
|
|
29386
|
-
});
|
|
29387
|
-
watch(() => props.minHeight, () => {
|
|
29388
|
-
reFlag.value++;
|
|
29389
|
-
});
|
|
29390
|
-
watch(() => props.minWidth, () => {
|
|
29391
|
-
reFlag.value++;
|
|
29392
|
-
});
|
|
29393
|
-
watch(() => props.maxHeight, () => {
|
|
29394
|
-
reFlag.value++;
|
|
29395
|
-
});
|
|
29396
|
-
watch(() => props.maxWidth, () => {
|
|
29397
|
-
reFlag.value++;
|
|
29398
|
-
});
|
|
29399
|
-
watch(() => props.native, () => {
|
|
29400
|
-
reFlag.value++;
|
|
29401
|
-
});
|
|
29402
|
-
watch(() => props.syncResize, () => {
|
|
29403
|
-
reFlag.value++;
|
|
29404
|
-
});
|
|
29405
|
-
watch(reFlag, () => {
|
|
29406
|
-
$xeScrollbar.recalculate();
|
|
29618
|
+
onBeforeUnmount(() => {
|
|
29619
|
+
XEUtils.assign(reactData, createReactData$d());
|
|
29620
|
+
XEUtils.assign(internalData, createInternalData$c());
|
|
29407
29621
|
});
|
|
29408
|
-
|
|
29409
|
-
|
|
29410
|
-
|
|
29411
|
-
|
|
29412
|
-
|
|
29413
|
-
|
|
29414
|
-
|
|
29415
|
-
|
|
29622
|
+
$xeImage.renderVN = renderVN;
|
|
29623
|
+
return $xeImage;
|
|
29624
|
+
},
|
|
29625
|
+
render() {
|
|
29626
|
+
return this.renderVN();
|
|
29627
|
+
}
|
|
29628
|
+
});
|
|
29629
|
+
|
|
29630
|
+
const VxeImage = Object.assign({}, VxeImageComponent, {
|
|
29631
|
+
install(app) {
|
|
29632
|
+
app.component(VxeImageComponent.name, VxeImageComponent);
|
|
29633
|
+
}
|
|
29634
|
+
});
|
|
29635
|
+
dynamicApp.use(VxeImage);
|
|
29636
|
+
VxeUI.component(VxeImageComponent);
|
|
29637
|
+
const Image$1 = VxeImage;
|
|
29638
|
+
|
|
29639
|
+
var VxeImageGroupComponent = defineVxeComponent({
|
|
29640
|
+
name: 'VxeImageGroup',
|
|
29641
|
+
props: {
|
|
29642
|
+
urlList: [Array, String],
|
|
29643
|
+
showPreview: {
|
|
29644
|
+
type: Boolean,
|
|
29645
|
+
default: () => getConfig$4().imageGroup.showPreview
|
|
29646
|
+
},
|
|
29647
|
+
imageStyle: Object,
|
|
29648
|
+
zIndex: Number,
|
|
29649
|
+
size: {
|
|
29650
|
+
type: String,
|
|
29651
|
+
default: () => getConfig$4().imageGroup.size || getConfig$4().size
|
|
29652
|
+
},
|
|
29653
|
+
toolbarConfig: Object,
|
|
29654
|
+
showPrintButton: {
|
|
29655
|
+
type: Boolean,
|
|
29656
|
+
default: () => getConfig$4().imageGroup.showPrintButton
|
|
29657
|
+
},
|
|
29658
|
+
showDownloadButton: {
|
|
29659
|
+
type: Boolean,
|
|
29660
|
+
default: () => getConfig$4().imageGroup.showDownloadButton
|
|
29661
|
+
},
|
|
29662
|
+
getThumbnailUrlMethod: Function
|
|
29663
|
+
},
|
|
29664
|
+
emits: [
|
|
29665
|
+
'click',
|
|
29666
|
+
'change',
|
|
29667
|
+
'rotate'
|
|
29668
|
+
],
|
|
29669
|
+
setup(props, context) {
|
|
29670
|
+
const { emit } = context;
|
|
29671
|
+
const xID = XEUtils.uniqueId();
|
|
29672
|
+
const { computeSize } = useSize(props);
|
|
29673
|
+
const computeImgList = computed(() => {
|
|
29674
|
+
const { urlList } = props;
|
|
29675
|
+
if (urlList) {
|
|
29676
|
+
return (XEUtils.isArray(urlList) ? urlList : [urlList]).map(item => {
|
|
29677
|
+
if (XEUtils.isString(item)) {
|
|
29678
|
+
return {
|
|
29679
|
+
url: item,
|
|
29680
|
+
alt: ''
|
|
29681
|
+
};
|
|
29416
29682
|
}
|
|
29683
|
+
return {
|
|
29684
|
+
url: item.url,
|
|
29685
|
+
alt: item.alt
|
|
29686
|
+
};
|
|
29417
29687
|
});
|
|
29418
|
-
if (viewEl) {
|
|
29419
|
-
resizeObserver.observe(viewEl);
|
|
29420
|
-
}
|
|
29421
|
-
if (viewInnerEl) {
|
|
29422
|
-
resizeObserver.observe(viewInnerEl);
|
|
29423
|
-
}
|
|
29424
|
-
internalData.resizeObserver = resizeObserver;
|
|
29425
29688
|
}
|
|
29426
|
-
|
|
29427
|
-
globalEvents.on($xeScrollbar, 'resize', () => {
|
|
29428
|
-
reFlag.value++;
|
|
29429
|
-
});
|
|
29689
|
+
return [];
|
|
29430
29690
|
});
|
|
29431
|
-
|
|
29432
|
-
|
|
29433
|
-
if (resizeObserver) {
|
|
29434
|
-
resizeObserver.disconnect();
|
|
29435
|
-
}
|
|
29436
|
-
globalEvents.off($xeScrollbar, 'resize');
|
|
29691
|
+
const computeImgStyleOpts = computed(() => {
|
|
29692
|
+
return Object.assign({}, getConfig$4().imageGroup.imageStyle, props.imageStyle);
|
|
29437
29693
|
});
|
|
29438
|
-
|
|
29439
|
-
|
|
29694
|
+
const computeGetThumbnailUrlMethod = computed(() => {
|
|
29695
|
+
return props.getThumbnailUrlMethod || getConfig$4().imageGroup.getThumbnailUrlMethod;
|
|
29696
|
+
});
|
|
29697
|
+
const computeMaps = {
|
|
29698
|
+
computeSize
|
|
29699
|
+
};
|
|
29700
|
+
const $xeImageGroup = {
|
|
29701
|
+
xID,
|
|
29702
|
+
props,
|
|
29703
|
+
context,
|
|
29704
|
+
getComputeMaps: () => computeMaps
|
|
29705
|
+
};
|
|
29706
|
+
const imageGroupMethods = {
|
|
29707
|
+
dispatchEvent(type, params, evnt) {
|
|
29708
|
+
emit(type, createEvent$1(evnt, { $imageGroup: $xeImageGroup }, params));
|
|
29709
|
+
}
|
|
29710
|
+
};
|
|
29711
|
+
const imageGroupPrivateMethods = {
|
|
29712
|
+
handleClickImgEvent(evnt, params) {
|
|
29713
|
+
const { showPreview, toolbarConfig, showPrintButton, showDownloadButton, zIndex } = props;
|
|
29714
|
+
const { url } = params;
|
|
29715
|
+
const imgList = computeImgList.value;
|
|
29716
|
+
if (showPreview && url) {
|
|
29717
|
+
openPreviewImage({
|
|
29718
|
+
activeIndex: Math.max(0, XEUtils.findIndexOf(imgList, item => item.url === url)),
|
|
29719
|
+
urlList: imgList,
|
|
29720
|
+
toolbarConfig,
|
|
29721
|
+
showPrintButton,
|
|
29722
|
+
showDownloadButton,
|
|
29723
|
+
zIndex,
|
|
29724
|
+
events: {
|
|
29725
|
+
change(eventParams) {
|
|
29726
|
+
$xeImageGroup.dispatchEvent('change', eventParams, eventParams.$event);
|
|
29727
|
+
},
|
|
29728
|
+
rotate(eventParams) {
|
|
29729
|
+
$xeImageGroup.dispatchEvent('rotate', eventParams, eventParams.$event);
|
|
29730
|
+
}
|
|
29731
|
+
}
|
|
29732
|
+
});
|
|
29733
|
+
}
|
|
29734
|
+
$xeImageGroup.dispatchEvent('click', { url, urlList: imgList }, evnt);
|
|
29735
|
+
}
|
|
29736
|
+
};
|
|
29737
|
+
Object.assign($xeImageGroup, imageGroupMethods, imageGroupPrivateMethods);
|
|
29738
|
+
const renderVN = () => {
|
|
29739
|
+
const imgList = computeImgList.value;
|
|
29740
|
+
const vSize = computeSize.value;
|
|
29741
|
+
const imgStyleOpts = computeImgStyleOpts.value;
|
|
29742
|
+
const getThumbnailUrlMethod = computeGetThumbnailUrlMethod.value;
|
|
29743
|
+
return h('div', {
|
|
29744
|
+
class: ['vxe-image-group', {
|
|
29745
|
+
[`size--${vSize}`]: vSize
|
|
29746
|
+
}]
|
|
29747
|
+
}, imgList
|
|
29748
|
+
? imgList.map((item, index) => {
|
|
29749
|
+
return h(VxeImageComponent, {
|
|
29750
|
+
key: index,
|
|
29751
|
+
src: item.url,
|
|
29752
|
+
alt: item.alt,
|
|
29753
|
+
width: imgStyleOpts.width,
|
|
29754
|
+
height: imgStyleOpts.height,
|
|
29755
|
+
getThumbnailUrlMethod
|
|
29756
|
+
});
|
|
29757
|
+
})
|
|
29758
|
+
: []);
|
|
29759
|
+
};
|
|
29760
|
+
$xeImageGroup.renderVN = renderVN;
|
|
29761
|
+
provide('$xeImageGroup', $xeImageGroup);
|
|
29762
|
+
return $xeImageGroup;
|
|
29440
29763
|
},
|
|
29441
29764
|
render() {
|
|
29442
29765
|
return this.renderVN();
|
|
29443
29766
|
}
|
|
29444
29767
|
});
|
|
29445
29768
|
|
|
29446
|
-
const
|
|
29769
|
+
const VxeImageGroup = Object.assign({}, VxeImageGroupComponent, {
|
|
29447
29770
|
install(app) {
|
|
29448
|
-
app.component(
|
|
29771
|
+
app.component(VxeImageGroupComponent.name, VxeImageGroupComponent);
|
|
29449
29772
|
}
|
|
29450
29773
|
});
|
|
29451
|
-
dynamicApp.use(
|
|
29452
|
-
VxeUI.component(
|
|
29453
|
-
const
|
|
29774
|
+
dynamicApp.use(VxeImageGroup);
|
|
29775
|
+
VxeUI.component(VxeImageGroupComponent);
|
|
29776
|
+
const ImageGroup = VxeImageGroup;
|
|
29777
|
+
|
|
29778
|
+
const VxeImagePreview = Object.assign(VxeImagePreviewComponent, {
|
|
29779
|
+
install(app) {
|
|
29780
|
+
app.component(VxeImagePreviewComponent.name, VxeImagePreviewComponent);
|
|
29781
|
+
}
|
|
29782
|
+
});
|
|
29783
|
+
VxeUI.previewImage = openPreviewImage;
|
|
29784
|
+
dynamicApp.use(VxeImagePreview);
|
|
29785
|
+
VxeUI.component(VxeImagePreviewComponent);
|
|
29786
|
+
const ImagePreview = VxeImagePreview;
|
|
29454
29787
|
|
|
29455
29788
|
var VxeLayoutAsideComponent = defineVxeComponent({
|
|
29456
29789
|
name: 'VxeLayoutAside',
|
|
@@ -40943,6 +41276,11 @@ var VxeTabsComponent = defineVxeComponent({
|
|
|
40943
41276
|
type: String,
|
|
40944
41277
|
default: () => getConfig$4().tabs.size || getConfig$4().size
|
|
40945
41278
|
},
|
|
41279
|
+
useScrollbar: {
|
|
41280
|
+
type: Boolean,
|
|
41281
|
+
default: () => getConfig$4().tabs.useScrollbar
|
|
41282
|
+
},
|
|
41283
|
+
scrollbarConfig: Object,
|
|
40946
41284
|
// 已废弃
|
|
40947
41285
|
beforeCloseMethod: Function
|
|
40948
41286
|
},
|
|
@@ -41038,6 +41376,9 @@ var VxeTabsComponent = defineVxeComponent({
|
|
|
41038
41376
|
const computeParentTabsResizeFlag = computed(() => {
|
|
41039
41377
|
return $xeParentTabs ? $xeParentTabs.reactData.resizeFlag : null;
|
|
41040
41378
|
});
|
|
41379
|
+
const computeScrollbarOpts = computed(() => {
|
|
41380
|
+
return Object.assign({}, getConfig$4().tabs.scrollbarConfig, props.scrollbarConfig);
|
|
41381
|
+
});
|
|
41041
41382
|
const computeMaps = {};
|
|
41042
41383
|
const $xeTabs = {
|
|
41043
41384
|
xID,
|
|
@@ -41613,17 +41954,27 @@ var VxeTabsComponent = defineVxeComponent({
|
|
|
41613
41954
|
]);
|
|
41614
41955
|
};
|
|
41615
41956
|
const renderTabPane = (item) => {
|
|
41957
|
+
const { useScrollbar } = props;
|
|
41616
41958
|
const { initNames, activeName } = reactData;
|
|
41617
41959
|
const { name, slots } = item;
|
|
41618
41960
|
const defaultSlot = slots ? slots.default : null;
|
|
41619
|
-
|
|
41620
|
-
|
|
41621
|
-
|
|
41622
|
-
|
|
41623
|
-
|
|
41624
|
-
|
|
41625
|
-
|
|
41626
|
-
|
|
41961
|
+
const scrollbarOpts = computeScrollbarOpts.value;
|
|
41962
|
+
const { viewClassName, viewInnerClassName } = scrollbarOpts;
|
|
41963
|
+
if (name && initNames.includes(name)) {
|
|
41964
|
+
return useScrollbar
|
|
41965
|
+
? h(VxeScrollbar, Object.assign(Object.assign({ key: `${name}`, class: ['vxe-tabs-pane--scrollbar-item', {
|
|
41966
|
+
'is--visible': activeName === name
|
|
41967
|
+
}] }, scrollbarOpts), { viewClassName: 'vxe-tabs-pane--scrollbar-item-view' + (viewClassName ? (' ' + viewClassName) : ''), viewInnerClassName: 'vxe-tabs-pane--scrollbar-item-inner' + (viewClassName ? (' ' + viewInnerClassName) : '') }), {
|
|
41968
|
+
default: () => defaultSlot ? callSlot(defaultSlot, { name }) : []
|
|
41969
|
+
})
|
|
41970
|
+
: h('div', {
|
|
41971
|
+
key: `${name}`,
|
|
41972
|
+
class: ['vxe-tabs-pane--item', {
|
|
41973
|
+
'is--visible': activeName === name
|
|
41974
|
+
}]
|
|
41975
|
+
}, defaultSlot ? callSlot(defaultSlot, { name }) : []);
|
|
41976
|
+
}
|
|
41977
|
+
return renderEmptyElement$1($xeTabs);
|
|
41627
41978
|
};
|
|
41628
41979
|
const renderTabContent = (tabList) => {
|
|
41629
41980
|
const { destroyOnClose } = props;
|
|
@@ -43950,11 +44301,15 @@ var VxeTreeComponent = defineVxeComponent({
|
|
|
43950
44301
|
const { rowHeight } = scrollYStore;
|
|
43951
44302
|
const el = refElem.value;
|
|
43952
44303
|
if (el && el.clientWidth && el.clientHeight) {
|
|
43953
|
-
|
|
44304
|
+
let parentEl = getParentElem();
|
|
43954
44305
|
const headerWrapperEl = refHeaderWrapperElem.value;
|
|
43955
44306
|
const footerWrapperEl = refFooterWrapperElem.value;
|
|
43956
44307
|
const headHeight = headerWrapperEl ? headerWrapperEl.clientHeight : 0;
|
|
43957
44308
|
const footHeight = footerWrapperEl ? footerWrapperEl.clientHeight : 0;
|
|
44309
|
+
// 如果是虚拟滚动条
|
|
44310
|
+
if (parentEl && hasClass(parentEl, 'vxe-scrollbar--view-inner')) {
|
|
44311
|
+
parentEl = parentEl.parentElement;
|
|
44312
|
+
}
|
|
43958
44313
|
if (parentEl) {
|
|
43959
44314
|
const parentPaddingSize = getPaddingTopBottomSize(parentEl);
|
|
43960
44315
|
reactData.parentHeight = Math.max(headHeight + footHeight + rowHeight, parentEl.clientHeight - parentPaddingSize - headHeight - footHeight);
|