vxe-pc-ui 4.6.34 → 4.6.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/icon/style.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/tabs/src/tabs.js +290 -89
- package/es/tabs/style.css +431 -156
- package/es/tabs/style.min.css +1 -1
- package/es/ui/index.js +3 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-tabs/style.css +431 -156
- package/es/vxe-tabs/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 +310 -84
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/tabs/src/tabs.js +306 -82
- package/lib/tabs/src/tabs.min.js +1 -1
- package/lib/tabs/style/style.css +431 -156
- package/lib/tabs/style/style.min.css +1 -1
- package/lib/ui/index.js +3 -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/vxe-tabs/style/style.css +431 -156
- package/lib/vxe-tabs/style/style.min.css +1 -1
- package/package.json +1 -1
- package/packages/tabs/src/tabs.ts +299 -90
- package/packages/ui/index.ts +2 -0
- package/styles/components/tabs.scss +534 -183
- package/types/components/table-plugins/extend-cell-area.d.ts +1 -1
- package/types/components/tabs.d.ts +22 -6
- package/types/ui/global-icon.d.ts +2 -0
- /package/es/icon/{iconfont.1750769664150.ttf → iconfont.1751108492990.ttf} +0 -0
- /package/es/icon/{iconfont.1750769664150.woff → iconfont.1751108492990.woff} +0 -0
- /package/es/icon/{iconfont.1750769664150.woff2 → iconfont.1751108492990.woff2} +0 -0
- /package/es/{iconfont.1750769664150.ttf → iconfont.1751108492990.ttf} +0 -0
- /package/es/{iconfont.1750769664150.woff → iconfont.1751108492990.woff} +0 -0
- /package/es/{iconfont.1750769664150.woff2 → iconfont.1751108492990.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1750769664150.ttf → iconfont.1751108492990.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1750769664150.woff → iconfont.1751108492990.woff} +0 -0
- /package/lib/icon/style/{iconfont.1750769664150.woff2 → iconfont.1751108492990.woff2} +0 -0
- /package/lib/{iconfont.1750769664150.ttf → iconfont.1751108492990.ttf} +0 -0
- /package/lib/{iconfont.1750769664150.woff → iconfont.1751108492990.woff} +0 -0
- /package/lib/{iconfont.1750769664150.woff2 → iconfont.1751108492990.woff2} +0 -0
package/lib/index.umd.js
CHANGED
|
@@ -4241,14 +4241,14 @@ function checkDynamic() {
|
|
|
4241
4241
|
}
|
|
4242
4242
|
;// CONCATENATED MODULE: ./packages/ui/src/log.ts
|
|
4243
4243
|
|
|
4244
|
-
const log_version = `ui v${"4.6.
|
|
4244
|
+
const log_version = `ui v${"4.6.36"}`;
|
|
4245
4245
|
const warnLog = log.create('warn', log_version);
|
|
4246
4246
|
const errLog = log.create('error', log_version);
|
|
4247
4247
|
;// CONCATENATED MODULE: ./packages/ui/index.ts
|
|
4248
4248
|
|
|
4249
4249
|
|
|
4250
4250
|
|
|
4251
|
-
const ui_version = "4.6.
|
|
4251
|
+
const ui_version = "4.6.36";
|
|
4252
4252
|
index_esm_VxeUI.uiVersion = ui_version;
|
|
4253
4253
|
index_esm_VxeUI.dynamicApp = dynamicApp;
|
|
4254
4254
|
function config(options) {
|
|
@@ -4771,6 +4771,8 @@ setIcon({
|
|
|
4771
4771
|
TABLE_SELECT_OPEN: iconPrefix + 'caret-down rotate180',
|
|
4772
4772
|
TABLE_SELECT_CLOSE: iconPrefix + 'caret-down',
|
|
4773
4773
|
// tabs
|
|
4774
|
+
TABS_TAB_BUTTON_TOP: iconPrefix + 'arrow-up',
|
|
4775
|
+
TABS_TAB_BUTTON_BOTTOM: iconPrefix + 'arrow-down',
|
|
4774
4776
|
TABS_TAB_BUTTON_LEFT: iconPrefix + 'arrow-left',
|
|
4775
4777
|
TABS_TAB_BUTTON_RIGHT: iconPrefix + 'arrow-right',
|
|
4776
4778
|
TABS_TAB_CLOSE: iconPrefix + 'close',
|
|
@@ -22549,11 +22551,19 @@ const ViewItemComponent = defineVxeComponent({
|
|
|
22549
22551
|
props: {
|
|
22550
22552
|
modelValue: [String, Number, Boolean],
|
|
22551
22553
|
options: Array,
|
|
22554
|
+
width: [String, Number],
|
|
22552
22555
|
height: [String, Number],
|
|
22553
22556
|
destroyOnClose: Boolean,
|
|
22554
22557
|
titleWidth: [String, Number],
|
|
22555
22558
|
titleAlign: [String, Number],
|
|
22556
|
-
type:
|
|
22559
|
+
type: {
|
|
22560
|
+
type: String,
|
|
22561
|
+
default: () => getConfig().tabs.type
|
|
22562
|
+
},
|
|
22563
|
+
position: {
|
|
22564
|
+
type: String,
|
|
22565
|
+
default: () => getConfig().tabs.position
|
|
22566
|
+
},
|
|
22557
22567
|
showClose: Boolean,
|
|
22558
22568
|
padding: {
|
|
22559
22569
|
type: Boolean,
|
|
@@ -22576,12 +22586,17 @@ const ViewItemComponent = defineVxeComponent({
|
|
|
22576
22586
|
const $xeParentTabs = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeTabs', null);
|
|
22577
22587
|
const refElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
22578
22588
|
const refHeadWrapperElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
22589
|
+
const refHeadPrevElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
22590
|
+
const refHeadNextElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
22579
22591
|
const reactData = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)({
|
|
22580
22592
|
staticTabs: [],
|
|
22581
22593
|
activeName: null,
|
|
22582
22594
|
initNames: [],
|
|
22583
22595
|
lintLeft: 0,
|
|
22596
|
+
lintTop: 0,
|
|
22584
22597
|
lintWidth: 0,
|
|
22598
|
+
lintHeight: 0,
|
|
22599
|
+
scrollbarWidth: 0,
|
|
22585
22600
|
isTabOver: false,
|
|
22586
22601
|
resizeFlag: 1,
|
|
22587
22602
|
cacheTabMaps: {}
|
|
@@ -22592,6 +22607,52 @@ const ViewItemComponent = defineVxeComponent({
|
|
|
22592
22607
|
const refMaps = {
|
|
22593
22608
|
refElem
|
|
22594
22609
|
};
|
|
22610
|
+
const computeTabType = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
22611
|
+
const {
|
|
22612
|
+
type
|
|
22613
|
+
} = props;
|
|
22614
|
+
return type || 'default';
|
|
22615
|
+
});
|
|
22616
|
+
const computeTabPosition = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
22617
|
+
const {
|
|
22618
|
+
position
|
|
22619
|
+
} = props;
|
|
22620
|
+
return position || 'top';
|
|
22621
|
+
});
|
|
22622
|
+
const computeLrPosition = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
22623
|
+
const tabPosition = computeTabPosition.value;
|
|
22624
|
+
return tabPosition === 'left' || tabPosition === 'right';
|
|
22625
|
+
});
|
|
22626
|
+
const computeLineStyle = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
22627
|
+
const {
|
|
22628
|
+
lintLeft,
|
|
22629
|
+
lintTop,
|
|
22630
|
+
lintWidth,
|
|
22631
|
+
lintHeight
|
|
22632
|
+
} = reactData;
|
|
22633
|
+
const lrPosition = computeLrPosition.value;
|
|
22634
|
+
return lrPosition ? {
|
|
22635
|
+
top: `${lintTop}px`,
|
|
22636
|
+
height: `${lintHeight}px`
|
|
22637
|
+
} : {
|
|
22638
|
+
left: `${lintLeft}px`,
|
|
22639
|
+
width: `${lintWidth}px`
|
|
22640
|
+
};
|
|
22641
|
+
});
|
|
22642
|
+
const computeWrapperStyle = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
22643
|
+
const {
|
|
22644
|
+
width,
|
|
22645
|
+
height
|
|
22646
|
+
} = props;
|
|
22647
|
+
const stys = {};
|
|
22648
|
+
if (width) {
|
|
22649
|
+
stys.width = toCssUnit(width);
|
|
22650
|
+
}
|
|
22651
|
+
if (width) {
|
|
22652
|
+
stys.height = toCssUnit(height);
|
|
22653
|
+
}
|
|
22654
|
+
return stys;
|
|
22655
|
+
});
|
|
22595
22656
|
const computeCloseOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
22596
22657
|
return Object.assign({}, getConfig().tabs.closeConfig, props.closeConfig);
|
|
22597
22658
|
});
|
|
@@ -22641,49 +22702,114 @@ const ViewItemComponent = defineVxeComponent({
|
|
|
22641
22702
|
}
|
|
22642
22703
|
return [];
|
|
22643
22704
|
};
|
|
22644
|
-
const
|
|
22645
|
-
|
|
22705
|
+
const checkScrolling = () => {
|
|
22706
|
+
const lrPosition = computeLrPosition.value;
|
|
22707
|
+
const headerWrapperEl = refHeadWrapperElem.value;
|
|
22708
|
+
const headPrevEl = refHeadPrevElem.value;
|
|
22709
|
+
const headNextEl = refHeadNextElem.value;
|
|
22710
|
+
if (headerWrapperEl) {
|
|
22646
22711
|
const {
|
|
22647
|
-
|
|
22648
|
-
|
|
22712
|
+
scrollLeft,
|
|
22713
|
+
scrollTop,
|
|
22714
|
+
clientWidth,
|
|
22715
|
+
clientHeight,
|
|
22716
|
+
scrollWidth,
|
|
22717
|
+
scrollHeight
|
|
22718
|
+
} = headerWrapperEl;
|
|
22719
|
+
if (headPrevEl) {
|
|
22720
|
+
if ((lrPosition ? scrollTop : scrollLeft) > 0) {
|
|
22721
|
+
addClass(headPrevEl, 'scrolling--middle');
|
|
22722
|
+
} else {
|
|
22723
|
+
removeClass(headPrevEl, 'scrolling--middle');
|
|
22724
|
+
}
|
|
22725
|
+
}
|
|
22726
|
+
if (headNextEl) {
|
|
22727
|
+
if (lrPosition ? clientHeight < scrollHeight - Math.ceil(scrollTop) : clientWidth < scrollWidth - Math.ceil(scrollLeft)) {
|
|
22728
|
+
addClass(headNextEl, 'scrolling--middle');
|
|
22729
|
+
} else {
|
|
22730
|
+
removeClass(headNextEl, 'scrolling--middle');
|
|
22731
|
+
}
|
|
22732
|
+
}
|
|
22733
|
+
}
|
|
22734
|
+
};
|
|
22735
|
+
const updateTabStyle = () => {
|
|
22736
|
+
const handleStyle = () => {
|
|
22649
22737
|
const {
|
|
22650
22738
|
activeName
|
|
22651
22739
|
} = reactData;
|
|
22740
|
+
const tabType = computeTabType.value;
|
|
22652
22741
|
const tabOptions = computeTabOptions.value;
|
|
22653
22742
|
const tabStaticOptions = computeTabStaticOptions.value;
|
|
22654
22743
|
const headerWrapperEl = refHeadWrapperElem.value;
|
|
22744
|
+
const lrPosition = computeLrPosition.value;
|
|
22655
22745
|
let lintWidth = 0;
|
|
22746
|
+
let lintHeight = 0;
|
|
22656
22747
|
let lintLeft = 0;
|
|
22748
|
+
let lintTop = 0;
|
|
22749
|
+
let scrollbarWidth = 0;
|
|
22657
22750
|
let isOver = false;
|
|
22658
22751
|
if (headerWrapperEl) {
|
|
22659
22752
|
const index = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findIndexOf(tabStaticOptions.length ? tabStaticOptions : tabOptions, item => item.name === activeName);
|
|
22660
22753
|
const {
|
|
22661
22754
|
children,
|
|
22755
|
+
offsetWidth,
|
|
22662
22756
|
scrollWidth,
|
|
22663
|
-
|
|
22757
|
+
scrollHeight,
|
|
22758
|
+
clientWidth,
|
|
22759
|
+
clientHeight
|
|
22664
22760
|
} = headerWrapperEl;
|
|
22665
|
-
|
|
22666
|
-
if (
|
|
22667
|
-
|
|
22668
|
-
|
|
22669
|
-
|
|
22670
|
-
if (
|
|
22671
|
-
|
|
22672
|
-
|
|
22673
|
-
|
|
22674
|
-
|
|
22675
|
-
|
|
22761
|
+
scrollbarWidth = offsetWidth - clientWidth;
|
|
22762
|
+
if (lrPosition) {
|
|
22763
|
+
isOver = scrollHeight !== clientHeight;
|
|
22764
|
+
if (index > -1) {
|
|
22765
|
+
const tabEl = children[index];
|
|
22766
|
+
if (tabEl) {
|
|
22767
|
+
const tabHeight = tabEl.clientHeight;
|
|
22768
|
+
const tabWidth = tabEl.clientWidth;
|
|
22769
|
+
if (tabType === 'card') {
|
|
22770
|
+
lintWidth = tabWidth;
|
|
22771
|
+
lintHeight = tabHeight;
|
|
22772
|
+
lintTop = tabEl.offsetTop;
|
|
22773
|
+
} else if (tabType === 'border-card') {
|
|
22774
|
+
lintWidth = tabWidth;
|
|
22775
|
+
lintHeight = tabHeight;
|
|
22776
|
+
lintTop = tabEl.offsetTop - 1;
|
|
22777
|
+
} else {
|
|
22778
|
+
lintHeight = Math.max(4, Math.floor(tabHeight * 0.6));
|
|
22779
|
+
lintTop = tabEl.offsetTop + Math.floor((tabHeight - lintHeight) / 2);
|
|
22780
|
+
}
|
|
22781
|
+
}
|
|
22782
|
+
}
|
|
22783
|
+
} else {
|
|
22784
|
+
isOver = scrollWidth !== clientWidth;
|
|
22785
|
+
if (index > -1) {
|
|
22786
|
+
const tabEl = children[index];
|
|
22787
|
+
if (tabEl) {
|
|
22788
|
+
const tabWidth = tabEl.clientWidth;
|
|
22789
|
+
if (tabType === 'card') {
|
|
22790
|
+
lintWidth = tabWidth;
|
|
22791
|
+
lintLeft = tabEl.offsetLeft;
|
|
22792
|
+
} else if (tabType === 'border-card') {
|
|
22793
|
+
lintWidth = tabWidth;
|
|
22794
|
+
lintLeft = tabEl.offsetLeft - 1;
|
|
22795
|
+
} else {
|
|
22796
|
+
lintWidth = Math.max(4, Math.floor(tabWidth * 0.6));
|
|
22797
|
+
lintLeft = tabEl.offsetLeft + Math.floor((tabWidth - lintWidth) / 2);
|
|
22798
|
+
}
|
|
22676
22799
|
}
|
|
22677
|
-
} else {
|
|
22678
|
-
lintWidth = Math.max(4, Math.floor(tabWidth * 0.6));
|
|
22679
|
-
lintLeft = tabEl.offsetLeft + Math.floor((tabWidth - lintWidth) / 2);
|
|
22680
22800
|
}
|
|
22681
22801
|
}
|
|
22682
22802
|
}
|
|
22803
|
+
reactData.scrollbarWidth = scrollbarWidth;
|
|
22683
22804
|
reactData.lintLeft = lintLeft;
|
|
22805
|
+
reactData.lintTop = lintTop;
|
|
22684
22806
|
reactData.lintWidth = lintWidth;
|
|
22807
|
+
reactData.lintHeight = lintHeight;
|
|
22685
22808
|
reactData.isTabOver = isOver;
|
|
22686
|
-
|
|
22809
|
+
checkScrolling();
|
|
22810
|
+
};
|
|
22811
|
+
handleStyle();
|
|
22812
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(handleStyle);
|
|
22687
22813
|
};
|
|
22688
22814
|
const dispatchEvent = (type, params, evnt) => {
|
|
22689
22815
|
emit(type, createEvent(evnt, {
|
|
@@ -22877,7 +23003,9 @@ const ViewItemComponent = defineVxeComponent({
|
|
|
22877
23003
|
const {
|
|
22878
23004
|
slTimeout
|
|
22879
23005
|
} = internalData;
|
|
22880
|
-
|
|
23006
|
+
const lrPosition = computeLrPosition.value;
|
|
23007
|
+
let offsetLeft = lrPosition ? 0 : offsetSize;
|
|
23008
|
+
let offsetTop = lrPosition ? offsetSize : 0;
|
|
22881
23009
|
let scrollCount = 6;
|
|
22882
23010
|
let delayNum = 35;
|
|
22883
23011
|
if (slTimeout) {
|
|
@@ -22891,21 +23019,41 @@ const ViewItemComponent = defineVxeComponent({
|
|
|
22891
23019
|
if (headerWrapperEl) {
|
|
22892
23020
|
const {
|
|
22893
23021
|
clientWidth,
|
|
23022
|
+
clientHeight,
|
|
22894
23023
|
scrollWidth,
|
|
22895
|
-
|
|
23024
|
+
scrollHeight,
|
|
23025
|
+
scrollLeft,
|
|
23026
|
+
scrollTop
|
|
22896
23027
|
} = headerWrapperEl;
|
|
22897
|
-
|
|
22898
|
-
|
|
22899
|
-
if (
|
|
22900
|
-
|
|
22901
|
-
|
|
22902
|
-
|
|
23028
|
+
if (lrPosition) {
|
|
23029
|
+
offsetTop = Math.floor(offsetTop / 2);
|
|
23030
|
+
if (offsetPos > 0) {
|
|
23031
|
+
if (clientHeight + scrollTop < scrollHeight) {
|
|
23032
|
+
headerWrapperEl.scrollTop += offsetTop;
|
|
23033
|
+
delayNum -= 4;
|
|
23034
|
+
internalData.slTimeout = setTimeout(scrollAnimate, delayNum);
|
|
23035
|
+
}
|
|
23036
|
+
} else {
|
|
23037
|
+
if (scrollTop > 0) {
|
|
23038
|
+
headerWrapperEl.scrollTop -= offsetTop;
|
|
23039
|
+
delayNum -= 4;
|
|
23040
|
+
internalData.slTimeout = setTimeout(scrollAnimate, delayNum);
|
|
23041
|
+
}
|
|
22903
23042
|
}
|
|
22904
23043
|
} else {
|
|
22905
|
-
|
|
22906
|
-
|
|
22907
|
-
|
|
22908
|
-
|
|
23044
|
+
offsetLeft = Math.floor(offsetLeft / 2);
|
|
23045
|
+
if (offsetPos > 0) {
|
|
23046
|
+
if (clientWidth + scrollLeft < scrollWidth) {
|
|
23047
|
+
headerWrapperEl.scrollLeft += offsetLeft;
|
|
23048
|
+
delayNum -= 4;
|
|
23049
|
+
internalData.slTimeout = setTimeout(scrollAnimate, delayNum);
|
|
23050
|
+
}
|
|
23051
|
+
} else {
|
|
23052
|
+
if (scrollLeft > 0) {
|
|
23053
|
+
headerWrapperEl.scrollLeft -= offsetLeft;
|
|
23054
|
+
delayNum -= 4;
|
|
23055
|
+
internalData.slTimeout = setTimeout(scrollAnimate, delayNum);
|
|
23056
|
+
}
|
|
22909
23057
|
}
|
|
22910
23058
|
}
|
|
22911
23059
|
updateTabStyle();
|
|
@@ -22915,9 +23063,14 @@ const ViewItemComponent = defineVxeComponent({
|
|
|
22915
23063
|
scrollAnimate();
|
|
22916
23064
|
};
|
|
22917
23065
|
const handleScrollToLeft = offsetPos => {
|
|
23066
|
+
const lrPosition = computeLrPosition.value;
|
|
22918
23067
|
const headerWrapperEl = refHeadWrapperElem.value;
|
|
22919
23068
|
if (headerWrapperEl) {
|
|
22920
|
-
const
|
|
23069
|
+
const {
|
|
23070
|
+
clientWidth,
|
|
23071
|
+
clientHeight
|
|
23072
|
+
} = headerWrapperEl;
|
|
23073
|
+
const offsetSize = Math.floor((lrPosition ? clientHeight : clientWidth) * 0.75);
|
|
22921
23074
|
startScrollAnimation(offsetPos, offsetSize);
|
|
22922
23075
|
}
|
|
22923
23076
|
};
|
|
@@ -22930,6 +23083,7 @@ const ViewItemComponent = defineVxeComponent({
|
|
|
22930
23083
|
const scrollToTab = name => {
|
|
22931
23084
|
const tabOptions = computeTabOptions.value;
|
|
22932
23085
|
const tabStaticOptions = computeTabStaticOptions.value;
|
|
23086
|
+
const lrPosition = computeLrPosition.value;
|
|
22933
23087
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(() => {
|
|
22934
23088
|
const headerWrapperEl = refHeadWrapperElem.value;
|
|
22935
23089
|
if (headerWrapperEl) {
|
|
@@ -22937,21 +23091,37 @@ const ViewItemComponent = defineVxeComponent({
|
|
|
22937
23091
|
if (index > -1) {
|
|
22938
23092
|
const {
|
|
22939
23093
|
scrollLeft,
|
|
23094
|
+
scrollTop,
|
|
22940
23095
|
clientWidth,
|
|
23096
|
+
clientHeight,
|
|
22941
23097
|
children
|
|
22942
23098
|
} = headerWrapperEl;
|
|
22943
23099
|
const tabEl = children[index];
|
|
22944
23100
|
if (tabEl) {
|
|
22945
|
-
|
|
22946
|
-
|
|
22947
|
-
|
|
22948
|
-
|
|
22949
|
-
|
|
22950
|
-
|
|
22951
|
-
|
|
22952
|
-
|
|
22953
|
-
|
|
22954
|
-
|
|
23101
|
+
if (lrPosition) {
|
|
23102
|
+
const tabOffsetTop = tabEl.offsetTop;
|
|
23103
|
+
const tabClientHeight = tabEl.clientHeight;
|
|
23104
|
+
// 如果顶部被挡
|
|
23105
|
+
const overSize = tabOffsetTop + tabClientHeight - (scrollTop + clientHeight);
|
|
23106
|
+
if (overSize > 0) {
|
|
23107
|
+
headerWrapperEl.scrollTop += overSize;
|
|
23108
|
+
}
|
|
23109
|
+
// 如果底部被挡,优先
|
|
23110
|
+
if (tabOffsetTop < scrollTop) {
|
|
23111
|
+
headerWrapperEl.scrollTop = tabOffsetTop;
|
|
23112
|
+
}
|
|
23113
|
+
} else {
|
|
23114
|
+
const tabOffsetLeft = tabEl.offsetLeft;
|
|
23115
|
+
const tabClientWidth = tabEl.clientWidth;
|
|
23116
|
+
// 如果右侧被挡
|
|
23117
|
+
const overSize = tabOffsetLeft + tabClientWidth - (scrollLeft + clientWidth);
|
|
23118
|
+
if (overSize > 0) {
|
|
23119
|
+
headerWrapperEl.scrollLeft += overSize;
|
|
23120
|
+
}
|
|
23121
|
+
// 如果左侧被挡,优先
|
|
23122
|
+
if (tabOffsetLeft < scrollLeft) {
|
|
23123
|
+
headerWrapperEl.scrollLeft = tabOffsetLeft;
|
|
23124
|
+
}
|
|
22955
23125
|
}
|
|
22956
23126
|
}
|
|
22957
23127
|
}
|
|
@@ -23010,7 +23180,6 @@ const ViewItemComponent = defineVxeComponent({
|
|
|
23010
23180
|
Object.assign($xeTabs, tabsMethods, tabsPrivateMethods);
|
|
23011
23181
|
const renderTabHeader = tabList => {
|
|
23012
23182
|
const {
|
|
23013
|
-
type,
|
|
23014
23183
|
titleWidth: allTitleWidth,
|
|
23015
23184
|
titleAlign: allTitleAlign,
|
|
23016
23185
|
showClose,
|
|
@@ -23019,28 +23188,42 @@ const ViewItemComponent = defineVxeComponent({
|
|
|
23019
23188
|
} = props;
|
|
23020
23189
|
const {
|
|
23021
23190
|
activeName,
|
|
23022
|
-
|
|
23023
|
-
lintWidth,
|
|
23191
|
+
scrollbarWidth,
|
|
23024
23192
|
isTabOver,
|
|
23025
23193
|
cacheTabMaps
|
|
23026
23194
|
} = reactData;
|
|
23027
|
-
const
|
|
23195
|
+
const tabType = computeTabType.value;
|
|
23196
|
+
const tabPosition = computeTabPosition.value;
|
|
23197
|
+
const lrPosition = computeLrPosition.value;
|
|
23198
|
+
const lineStyle = computeLineStyle.value;
|
|
23199
|
+
const prefixSlot = slots.prefix;
|
|
23200
|
+
const suffixSlot = slots.suffix || slots.extra;
|
|
23028
23201
|
const closeOpts = computeCloseOpts.value;
|
|
23029
23202
|
const closeVisibleMethod = closeOpts.visibleMethod;
|
|
23030
23203
|
const refreshOpts = computeRefreshOpts.value;
|
|
23031
23204
|
const refreshVisibleMethod = refreshOpts.visibleMethod;
|
|
23032
23205
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
23033
|
-
|
|
23034
|
-
|
|
23035
|
-
|
|
23206
|
+
key: 'th',
|
|
23207
|
+
class: ['vxe-tabs-header', `type--${tabType}`, `pos--${tabPosition}`]
|
|
23208
|
+
}, [prefixSlot ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
23209
|
+
class: ['vxe-tabs-header--prefix', `type--${tabType}`, `pos--${tabPosition}`]
|
|
23210
|
+
}, getSlotVNs(prefixSlot({
|
|
23211
|
+
name: activeName
|
|
23212
|
+
}))) : renderEmptyElement($xeTabs), isTabOver ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
23213
|
+
ref: refHeadPrevElem,
|
|
23214
|
+
class: ['vxe-tabs-header--bar vxe-tabs-header--prev-bar', `type--${tabType}`, `pos--${tabPosition}`],
|
|
23036
23215
|
onClick: scrollLeftEvent
|
|
23037
23216
|
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
23038
|
-
class: getIcon().TABS_TAB_BUTTON_LEFT
|
|
23217
|
+
class: lrPosition ? getIcon().TABS_TAB_BUTTON_TOP : getIcon().TABS_TAB_BUTTON_LEFT
|
|
23039
23218
|
})]) : renderEmptyElement($xeTabs), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
23040
|
-
class: 'vxe-tabs-header--wrapper'
|
|
23219
|
+
class: ['vxe-tabs-header--wrapper', `type--${tabType}`, `pos--${tabPosition}`]
|
|
23041
23220
|
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
23042
23221
|
ref: refHeadWrapperElem,
|
|
23043
|
-
class: 'vxe-tabs-header--item-wrapper'
|
|
23222
|
+
class: 'vxe-tabs-header--item-wrapper',
|
|
23223
|
+
style: lrPosition && scrollbarWidth ? {
|
|
23224
|
+
marginRight: `-${scrollbarWidth}px`
|
|
23225
|
+
} : undefined,
|
|
23226
|
+
onScroll: checkScrolling
|
|
23044
23227
|
}, tabList.map((item, index) => {
|
|
23045
23228
|
const {
|
|
23046
23229
|
title,
|
|
@@ -23064,12 +23247,12 @@ const ViewItemComponent = defineVxeComponent({
|
|
|
23064
23247
|
const isLoading = cacheItem ? cacheItem.loading : false;
|
|
23065
23248
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
23066
23249
|
key: `${name}`,
|
|
23067
|
-
class: ['vxe-tabs-header--item', itemAlign ? `align--${itemAlign}` : '', {
|
|
23250
|
+
class: ['vxe-tabs-header--item', `type--${tabType}`, `pos--${tabPosition}`, itemAlign ? `align--${itemAlign}` : '', {
|
|
23068
23251
|
'is--active': isActive
|
|
23069
23252
|
}],
|
|
23070
23253
|
style: itemWidth ? {
|
|
23071
23254
|
width: toCssUnit(itemWidth)
|
|
23072
|
-
} :
|
|
23255
|
+
} : undefined,
|
|
23073
23256
|
onClick(evnt) {
|
|
23074
23257
|
clickEvent(evnt, item);
|
|
23075
23258
|
}
|
|
@@ -23086,15 +23269,19 @@ const ViewItemComponent = defineVxeComponent({
|
|
|
23086
23269
|
}, titleSlot ? callSlot(titleSlot, {
|
|
23087
23270
|
name,
|
|
23088
23271
|
title
|
|
23089
|
-
}) : `${title}`)]), (isEnableConf(refreshConfig) || refreshOpts.enabled) && (refreshVisibleMethod ? refreshVisibleMethod(params) :
|
|
23090
|
-
class: 'vxe-tabs-header--refresh-btn',
|
|
23272
|
+
}) : `${title}`)]), (isEnableConf(refreshConfig) || refreshOpts.enabled) && (refreshVisibleMethod ? refreshVisibleMethod(params) : true) ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
23273
|
+
class: ['vxe-tabs-header--refresh-btn', {
|
|
23274
|
+
'is--active': isActive
|
|
23275
|
+
}],
|
|
23091
23276
|
onClick(evnt) {
|
|
23092
23277
|
handleRefreshTabEvent(evnt, item);
|
|
23093
23278
|
}
|
|
23094
23279
|
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
|
|
23095
23280
|
class: isLoading ? getIcon().TABS_TAB_REFRESH_LOADING : getIcon().TABS_TAB_REFRESH
|
|
23096
23281
|
})]) : renderEmptyElement($xeTabs), (showClose || isEnableConf(closeConfig) || closeOpts.enabled) && (!closeVisibleMethod || closeVisibleMethod(params)) ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
23097
|
-
class: 'vxe-tabs-header--close-btn',
|
|
23282
|
+
class: ['vxe-tabs-header--close-btn', {
|
|
23283
|
+
'is--active': isActive
|
|
23284
|
+
}],
|
|
23098
23285
|
onClick(evnt) {
|
|
23099
23286
|
handleCloseTabEvent(evnt, item, index, tabList);
|
|
23100
23287
|
}
|
|
@@ -23103,19 +23290,19 @@ const ViewItemComponent = defineVxeComponent({
|
|
|
23103
23290
|
})]) : renderEmptyElement($xeTabs)])]);
|
|
23104
23291
|
}).concat([(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
23105
23292
|
key: 'line',
|
|
23106
|
-
class:
|
|
23107
|
-
style:
|
|
23108
|
-
left: `${lintLeft}px`,
|
|
23109
|
-
width: `${lintWidth}px`
|
|
23110
|
-
}
|
|
23293
|
+
class: ['vxe-tabs-header--active-line', `type--${tabType}`, `pos--${tabPosition}`],
|
|
23294
|
+
style: lineStyle
|
|
23111
23295
|
})]))]), isTabOver ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
23112
|
-
|
|
23296
|
+
ref: refHeadNextElem,
|
|
23297
|
+
class: ['vxe-tabs-header--bar vxe-tabs-header--next-bar', `type--${tabType}`, `pos--${tabPosition}`],
|
|
23113
23298
|
onClick: scrollRightEvent
|
|
23114
23299
|
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
23115
|
-
class: getIcon().TABS_TAB_BUTTON_RIGHT
|
|
23116
|
-
})]) : renderEmptyElement($xeTabs),
|
|
23117
|
-
class: 'vxe-tabs-header--
|
|
23118
|
-
}, getSlotVNs(
|
|
23300
|
+
class: lrPosition ? getIcon().TABS_TAB_BUTTON_BOTTOM : getIcon().TABS_TAB_BUTTON_RIGHT
|
|
23301
|
+
})]) : renderEmptyElement($xeTabs), suffixSlot ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
23302
|
+
class: ['vxe-tabs-header--suffix', `type--${tabType}`, `pos--${tabPosition}`]
|
|
23303
|
+
}, getSlotVNs(suffixSlot({
|
|
23304
|
+
name: activeName
|
|
23305
|
+
}))) : renderEmptyElement($xeTabs)]);
|
|
23119
23306
|
};
|
|
23120
23307
|
const renderTabPane = item => {
|
|
23121
23308
|
const {
|
|
@@ -23150,35 +23337,74 @@ const ViewItemComponent = defineVxeComponent({
|
|
|
23150
23337
|
}
|
|
23151
23338
|
return tabList.map(item => renderTabPane(item));
|
|
23152
23339
|
};
|
|
23340
|
+
const rendetTabBody = tabList => {
|
|
23341
|
+
const {
|
|
23342
|
+
height,
|
|
23343
|
+
padding
|
|
23344
|
+
} = props;
|
|
23345
|
+
const {
|
|
23346
|
+
activeName
|
|
23347
|
+
} = reactData;
|
|
23348
|
+
const tabType = computeTabType.value;
|
|
23349
|
+
const tabPosition = computeTabPosition.value;
|
|
23350
|
+
const topSlot = slots.top;
|
|
23351
|
+
const footerSlot = slots.footer;
|
|
23352
|
+
const defParams = {
|
|
23353
|
+
name: activeName
|
|
23354
|
+
};
|
|
23355
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
23356
|
+
key: 'tb',
|
|
23357
|
+
class: ['vxe-tabs-pane--wrapper', `type--${tabType}`, `pos--${tabPosition}`]
|
|
23358
|
+
}, [topSlot ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
23359
|
+
class: 'vxe-tabs-pane--top'
|
|
23360
|
+
}, callSlot(topSlot, defParams)) : renderEmptyElement($xeTabs), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
23361
|
+
class: ['vxe-tabs-pane--body', `type--${tabType}`, `pos--${tabPosition}`, {
|
|
23362
|
+
'is--padding': padding,
|
|
23363
|
+
'is--height': height
|
|
23364
|
+
}]
|
|
23365
|
+
}, renderTabContent(tabList)), footerSlot ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
23366
|
+
class: 'vxe-tabs-pane--footer'
|
|
23367
|
+
}, callSlot(footerSlot, defParams)) : renderEmptyElement($xeTabs)]);
|
|
23368
|
+
};
|
|
23153
23369
|
const renderVN = () => {
|
|
23154
23370
|
const {
|
|
23155
|
-
type,
|
|
23156
23371
|
height,
|
|
23157
23372
|
padding,
|
|
23158
23373
|
trigger
|
|
23159
23374
|
} = props;
|
|
23375
|
+
const {
|
|
23376
|
+
activeName
|
|
23377
|
+
} = reactData;
|
|
23160
23378
|
const tabOptions = computeTabOptions.value;
|
|
23161
23379
|
const tabStaticOptions = computeTabStaticOptions.value;
|
|
23380
|
+
const tabType = computeTabType.value;
|
|
23381
|
+
const tabPosition = computeTabPosition.value;
|
|
23382
|
+
const wrapperStyle = computeWrapperStyle.value;
|
|
23162
23383
|
const defaultSlot = slots.default;
|
|
23163
|
-
const footerSlot = slots.footer;
|
|
23164
23384
|
const tabList = defaultSlot ? tabStaticOptions : tabOptions;
|
|
23385
|
+
const vns = [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
23386
|
+
key: 'ts',
|
|
23387
|
+
class: 'vxe-tabs-slots'
|
|
23388
|
+
}, defaultSlot ? defaultSlot({
|
|
23389
|
+
name: activeName
|
|
23390
|
+
}) : [])];
|
|
23391
|
+
if (tabPosition === 'right' || tabPosition === 'bottom') {
|
|
23392
|
+
vns.push(rendetTabBody(tabList), renderTabHeader(tabList));
|
|
23393
|
+
} else {
|
|
23394
|
+
vns.push(renderTabHeader(tabList), rendetTabBody(tabList));
|
|
23395
|
+
}
|
|
23165
23396
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
23166
23397
|
ref: refElem,
|
|
23167
|
-
class: ['vxe-tabs', `vxe-tabs--${
|
|
23398
|
+
class: ['vxe-tabs', `pos--${tabPosition}`, `vxe-tabs--${tabType}`, `trigger--${trigger === 'manual' ? 'trigger' : 'default'}`, {
|
|
23168
23399
|
'is--padding': padding,
|
|
23169
23400
|
'is--height': height
|
|
23170
23401
|
}],
|
|
23171
|
-
style:
|
|
23172
|
-
|
|
23173
|
-
} : null
|
|
23174
|
-
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
23175
|
-
class: 'vxe-tabs-slots'
|
|
23176
|
-
}, defaultSlot ? defaultSlot({}) : []), renderTabHeader(tabList), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
23177
|
-
class: 'vxe-tabs-pane'
|
|
23178
|
-
}, renderTabContent(tabList)), footerSlot ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
23179
|
-
class: 'vxe-tabs-footer'
|
|
23180
|
-
}, callSlot(footerSlot, {})) : renderEmptyElement($xeTabs)]);
|
|
23402
|
+
style: wrapperStyle
|
|
23403
|
+
}, vns);
|
|
23181
23404
|
};
|
|
23405
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.position, () => {
|
|
23406
|
+
updateTabStyle();
|
|
23407
|
+
});
|
|
23182
23408
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.modelValue, val => {
|
|
23183
23409
|
addInitName(val, null);
|
|
23184
23410
|
reactData.activeName = val;
|