bkui-vue 0.0.1-beta.29 → 0.0.1-beta.31
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/bkui-vue.cjs.js +141 -140
- package/dist/bkui-vue.esm.js +141 -140
- package/dist/bkui-vue.umd.js +141 -140
- package/dist/style.css +100 -5
- package/lib/code-diff/index.d.ts +139 -3
- package/lib/code-diff/index.js +15 -0
- package/lib/components.d.ts +1 -1
- package/lib/divider/index.js +1 -1
- package/lib/divider/props.d.ts +21 -0
- package/lib/loading/index.d.ts +27 -10
- package/lib/loading/index.js +1 -1
- package/lib/loading/loading.css +8 -2
- package/lib/loading/loading.d.ts +18 -4
- package/lib/loading/loading.less +10 -10
- package/lib/loading/loading.variable.css +8 -2
- package/lib/pagination/index.d.ts +7 -7
- package/lib/pagination/index.js +1 -1
- package/lib/pagination/pagination.d.ts +2 -2
- package/lib/radio/index.js +1 -1
- package/lib/radio/radio.css +2 -2
- package/lib/radio/radio.less +2 -2
- package/lib/radio/radio.variable.css +2 -2
- package/lib/slider/index.js +2 -2
- package/lib/slider/slider-button.d.ts +5 -0
- package/lib/slider/slider.d.ts +12 -0
- package/lib/styles/index.d.ts +1 -0
- package/lib/styles/index.js +1 -1
- package/lib/tab/index.d.ts +96 -205
- package/lib/tab/index.js +1 -1
- package/lib/tab/props.d.ts +191 -0
- package/lib/tab/tab-nav.d.ts +59 -84
- package/lib/tab/tab-panel.d.ts +39 -14
- package/lib/tab/tab.css +2 -1
- package/lib/tab/tab.d.ts +14 -37
- package/lib/tab/tab.less +2 -1
- package/lib/tab/tab.variable.css +2 -1
- package/lib/table/index.d.ts +1 -5
- package/lib/table/index.js +2 -2
- package/lib/table/props.d.ts +0 -1
- package/lib/table/table.d.ts +1 -3
- package/package.json +1 -1
package/dist/bkui-vue.cjs.js
CHANGED
@@ -80,6 +80,7 @@ var virtualRender$1 = "";
|
|
80
80
|
var transfer = "";
|
81
81
|
var pagination = "";
|
82
82
|
var timeline = "";
|
83
|
+
var codeDiff = "";
|
83
84
|
var resizeLayout = "";
|
84
85
|
var tagInput = "";
|
85
86
|
const BKLAYERD_INDEX_EFAULT_VALUE = {
|
@@ -8461,6 +8462,7 @@ const loadingTypes = {
|
|
8461
8462
|
type: Function
|
8462
8463
|
},
|
8463
8464
|
loading: PropTypes.bool,
|
8465
|
+
inline: PropTypes.bool.def(true),
|
8464
8466
|
theme: PropTypes.theme(["white", "primary", "warning", "success", "danger"]),
|
8465
8467
|
title: PropTypes.string.def(""),
|
8466
8468
|
size: PropTypes.commonType(Object.values(BkLoadingSize)).def(BkLoadingSize.Normal),
|
@@ -8479,9 +8481,9 @@ var Component$r = vue.defineComponent({
|
|
8479
8481
|
"class": `oval oval-${i2}`
|
8480
8482
|
}, null))]);
|
8481
8483
|
const loadingWrapperCls = vue.computed(() => classes({
|
8484
|
+
"bk-loading-wrapper": props.loading,
|
8482
8485
|
"bk-nested-loading": !!ctx.slots.default
|
8483
|
-
}
|
8484
|
-
console.log(props.theme);
|
8486
|
+
}));
|
8485
8487
|
const containerCls = vue.computed(() => classes({
|
8486
8488
|
[`bk-loading-size-${props.size}`]: !!props.size,
|
8487
8489
|
[`bk-loading-${props.theme}`]: !!props.theme
|
@@ -8499,15 +8501,15 @@ var Component$r = vue.defineComponent({
|
|
8499
8501
|
});
|
8500
8502
|
return () => {
|
8501
8503
|
var _a, _b;
|
8502
|
-
return
|
8504
|
+
return vue.createVNode("div", {
|
8503
8505
|
"class": loadingWrapperCls.value
|
8504
|
-
}, [vue.createVNode("div", {
|
8506
|
+
}, [props.loading && vue.createVNode(vue.Fragment, null, [vue.createVNode("div", {
|
8505
8507
|
"class": containerCls.value
|
8506
8508
|
}, [indicator.value, hasTitle.value && vue.createVNode("div", {
|
8507
8509
|
"class": "bk-loading-title"
|
8508
8510
|
}, [props.title])]), ctx.slots.default && vue.createVNode("div", {
|
8509
8511
|
"class": "bk-loading-mask"
|
8510
|
-
},
|
8512
|
+
}, null)]), (_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)]);
|
8511
8513
|
};
|
8512
8514
|
}
|
8513
8515
|
});
|
@@ -9921,7 +9923,7 @@ var Component$e = vue.defineComponent({
|
|
9921
9923
|
render() {
|
9922
9924
|
const radioClass = classes({
|
9923
9925
|
"bk-radio": true,
|
9924
|
-
"is-
|
9926
|
+
"is-focusd": this.isFocus,
|
9925
9927
|
"is-disabled": this.isDisabled,
|
9926
9928
|
"is-checked": this.isCheck
|
9927
9929
|
});
|
@@ -9980,7 +9982,7 @@ var RadioButton = vue.defineComponent({
|
|
9980
9982
|
render() {
|
9981
9983
|
const radioClass = classes({
|
9982
9984
|
"bk-radio-button": true,
|
9983
|
-
"is-
|
9985
|
+
"is-focusd": this.isFocus,
|
9984
9986
|
"is-disabled": this.isDisabled,
|
9985
9987
|
"is-checked": this.isCheck
|
9986
9988
|
});
|
@@ -10031,9 +10033,10 @@ var RadioGroup = vue.defineComponent({
|
|
10031
10033
|
return {};
|
10032
10034
|
},
|
10033
10035
|
render() {
|
10036
|
+
var _a;
|
10034
10037
|
return vue.createVNode("div", {
|
10035
10038
|
"class": "bk-radio-group"
|
10036
|
-
}, [this.$slots.default()]);
|
10039
|
+
}, [(_a = this.$slots) == null ? void 0 : _a.default()]);
|
10037
10040
|
}
|
10038
10041
|
});
|
10039
10042
|
const BkRadio = withInstallProps(Component$e, { Group: RadioGroup, Button: RadioButton });
|
@@ -11710,7 +11713,7 @@ var Component$7 = vue.defineComponent({
|
|
11710
11713
|
}
|
11711
11714
|
});
|
11712
11715
|
const BkSwitcher = withInstall(Component$7);
|
11713
|
-
const EventProps
|
11716
|
+
const EventProps = {
|
11714
11717
|
onContentScroll: Function
|
11715
11718
|
};
|
11716
11719
|
const virtualRenderProps = __spreadValues({
|
@@ -11733,7 +11736,7 @@ const virtualRenderProps = __spreadValues({
|
|
11733
11736
|
scrollPosition: PropTypes.string.def("content"),
|
11734
11737
|
abosuteHeight: PropTypes.oneOfType([PropTypes.string.def("auto"), PropTypes.number]).def("auto"),
|
11735
11738
|
throttleDelay: PropTypes.number.def(60)
|
11736
|
-
}, EventProps
|
11739
|
+
}, EventProps);
|
11737
11740
|
function getMatchedIndex(maxCount, maxHeight, groupItemCount, callback) {
|
11738
11741
|
let startIndex = 0;
|
11739
11742
|
let height = 0;
|
@@ -11962,10 +11965,7 @@ var Component$6 = vue.defineComponent({
|
|
11962
11965
|
});
|
11963
11966
|
const BkVirtualRender = withInstall(Component$6);
|
11964
11967
|
const BORDER_OPRIONS = ["none", "row", "col", "outer"];
|
11965
|
-
const
|
11966
|
-
onRowClick: Function
|
11967
|
-
};
|
11968
|
-
const tableProps = __spreadValues({
|
11968
|
+
const tableProps = {
|
11969
11969
|
data: PropTypes.arrayOf(PropTypes.any).def([]),
|
11970
11970
|
columns: PropTypes.arrayOf(PropTypes.shape({
|
11971
11971
|
label: PropTypes.oneOfType([PropTypes.func.def(() => ""), PropTypes.string.def("")]),
|
@@ -11984,7 +11984,7 @@ const tableProps = __spreadValues({
|
|
11984
11984
|
border: PropTypes.arrayOf(PropTypes.commonType(BORDER_OPRIONS, "border")).def(["row"]),
|
11985
11985
|
pagination: PropTypes.oneOfType([PropTypes.bool.def(false), PropTypes.object.def({})]).def(false),
|
11986
11986
|
remotePagination: PropTypes.bool.def(false)
|
11987
|
-
}
|
11987
|
+
};
|
11988
11988
|
function _isSlot(s2) {
|
11989
11989
|
return typeof s2 === "function" || Object.prototype.toString.call(s2) === "[object Object]" && !vue.isVNode(s2);
|
11990
11990
|
}
|
@@ -12084,6 +12084,8 @@ var useList = () => {
|
|
12084
12084
|
localCurrent.value = proxy.totalPageNum;
|
12085
12085
|
}
|
12086
12086
|
});
|
12087
|
+
}, {
|
12088
|
+
immediate: true
|
12087
12089
|
});
|
12088
12090
|
vue.nextTick(() => {
|
12089
12091
|
vue.watch(() => proxy.totalPageNum, (totalPageNum) => {
|
@@ -12363,7 +12365,7 @@ const paginationProps = {
|
|
12363
12365
|
var Component$5 = vue.defineComponent({
|
12364
12366
|
name: "Pagination",
|
12365
12367
|
props: paginationProps,
|
12366
|
-
emits: ["update:modelValue", "change", "update:limit", "
|
12368
|
+
emits: ["update:modelValue", "change", "update:limit", "limitChange"],
|
12367
12369
|
setup(props, context) {
|
12368
12370
|
const totalPageNum = vue.ref(0);
|
12369
12371
|
const {
|
@@ -12398,7 +12400,7 @@ var Component$5 = vue.defineComponent({
|
|
12398
12400
|
context.emit("change", smallListCurrent2);
|
12399
12401
|
});
|
12400
12402
|
vue.watch(localLimit, (localLimit2) => {
|
12401
|
-
context.emit("
|
12403
|
+
context.emit("limitChange", localLimit2);
|
12402
12404
|
});
|
12403
12405
|
return {
|
12404
12406
|
totalPageNum,
|
@@ -12603,14 +12605,14 @@ class TableRender {
|
|
12603
12605
|
Object.assign(this.props.pagination, {
|
12604
12606
|
limit
|
12605
12607
|
});
|
12606
|
-
this.context.emit("
|
12608
|
+
this.context.emit("pageLimitChange", limit);
|
12607
12609
|
}
|
12608
12610
|
hanlePageChange(current) {
|
12609
12611
|
Object.assign(this.props.pagination, {
|
12610
12612
|
current,
|
12611
12613
|
value: current
|
12612
12614
|
});
|
12613
|
-
this.context.emit("
|
12615
|
+
this.context.emit("pageValueChange", current);
|
12614
12616
|
}
|
12615
12617
|
setColumnActive(index, single = false) {
|
12616
12618
|
const col = this.propActiveCols.find((item) => item.index === index);
|
@@ -12695,7 +12697,7 @@ class TableRender {
|
|
12695
12697
|
var Component$4 = vue.defineComponent({
|
12696
12698
|
name: "Table",
|
12697
12699
|
props: tableProps,
|
12698
|
-
emits: ["
|
12700
|
+
emits: ["columnPick", "rowClick", "pageLimitChange", "pageValueChange"],
|
12699
12701
|
setup(props, ctx) {
|
12700
12702
|
const activeCols = vue.reactive(resolveActiveColumns(props));
|
12701
12703
|
const colgroups = vue.reactive(props.columns.map((col) => __spreadProps(__spreadValues({}, col), {
|
@@ -13761,15 +13763,16 @@ var TagInput = vue.defineComponent({
|
|
13761
13763
|
TagInput.install = (Vue) => {
|
13762
13764
|
Vue.component(TagInput.name, TagInput);
|
13763
13765
|
};
|
13766
|
+
const dividerProps = {
|
13767
|
+
direction: PropTypes.commonType(["horizontal", "vertical"], "direction").def("horizontal"),
|
13768
|
+
align: PropTypes.commonType(["left", "center", "right"], "align").def("center"),
|
13769
|
+
color: PropTypes.string.def("#dde4eb"),
|
13770
|
+
width: PropTypes.number.def(1),
|
13771
|
+
type: PropTypes.commonType(["dashed", "solid"], "lineType").def("dashed")
|
13772
|
+
};
|
13764
13773
|
var bkDivider = vue.defineComponent({
|
13765
13774
|
name: "Divider",
|
13766
|
-
props:
|
13767
|
-
direction: PropTypes.commonType(["horizontal", "vertical"], "direction").def("horizontal"),
|
13768
|
-
align: PropTypes.commonType(["left", "center", "right"], "align").def("center"),
|
13769
|
-
color: PropTypes.string.def("#dde4eb"),
|
13770
|
-
width: PropTypes.number.def(1),
|
13771
|
-
type: PropTypes.commonType(["dashed", "solid"], "lineType").def("dashed")
|
13772
|
-
},
|
13775
|
+
props: dividerProps,
|
13773
13776
|
render() {
|
13774
13777
|
const styles = () => {
|
13775
13778
|
if (this.direction === "vertical") {
|
@@ -13794,46 +13797,73 @@ var bkDivider = vue.defineComponent({
|
|
13794
13797
|
}
|
13795
13798
|
});
|
13796
13799
|
const BkDivider = withInstall(bkDivider);
|
13800
|
+
const tabNavEventProps = {
|
13801
|
+
tabAdd: {
|
13802
|
+
type: Function,
|
13803
|
+
default: () => ({})
|
13804
|
+
},
|
13805
|
+
tabChange: {
|
13806
|
+
type: Function,
|
13807
|
+
default: (name) => name
|
13808
|
+
},
|
13809
|
+
tabRemove: {
|
13810
|
+
type: Function,
|
13811
|
+
default: (name) => name
|
13812
|
+
},
|
13813
|
+
tabSort: {
|
13814
|
+
type: Function,
|
13815
|
+
default: () => ({})
|
13816
|
+
},
|
13817
|
+
tabDrag: {
|
13818
|
+
type: Function,
|
13819
|
+
default: () => ({})
|
13820
|
+
}
|
13821
|
+
};
|
13822
|
+
const tabProps = {
|
13823
|
+
active: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).def(""),
|
13824
|
+
type: PropTypes.commonType(["card", "border-card", "unborder-card"], "type").def("border-card"),
|
13825
|
+
tabPosition: PropTypes.commonType(["left", "right", "top"], "position").def("top"),
|
13826
|
+
closable: Boolean,
|
13827
|
+
addable: Boolean,
|
13828
|
+
sortable: Boolean,
|
13829
|
+
sortType: PropTypes.commonType(["replace", "insert", "top"], "sortType").def("replace"),
|
13830
|
+
labelHeight: PropTypes.number.def(50),
|
13831
|
+
scrollStep: PropTypes.number.def(200),
|
13832
|
+
extCls: PropTypes.string.def(""),
|
13833
|
+
validateActive: PropTypes.bool.def(true),
|
13834
|
+
showHeader: PropTypes.bool.def(true),
|
13835
|
+
changeOnHover: PropTypes.bool.def(false),
|
13836
|
+
changeOnHoverDelay: PropTypes.number.def(1e3)
|
13837
|
+
};
|
13838
|
+
const tabNavProps = __spreadValues({
|
13839
|
+
active: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).def(""),
|
13840
|
+
panels: {
|
13841
|
+
type: Array,
|
13842
|
+
default: () => []
|
13843
|
+
},
|
13844
|
+
closable: Boolean,
|
13845
|
+
addable: Boolean,
|
13846
|
+
sortable: Boolean,
|
13847
|
+
sortType: PropTypes.commonType(["replace", "insert", "top"], "sortType").def("replace"),
|
13848
|
+
labelHeight: PropTypes.number.def(50),
|
13849
|
+
scrollStep: PropTypes.number.def(200),
|
13850
|
+
validateActive: PropTypes.bool.def(true),
|
13851
|
+
changeOnHover: PropTypes.bool.def(false),
|
13852
|
+
changeOnHoverDelay: PropTypes.number.def(1e3)
|
13853
|
+
}, tabNavEventProps);
|
13854
|
+
const tabPanelProps = {
|
13855
|
+
name: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).def(""),
|
13856
|
+
label: PropTypes.string || PropTypes.func,
|
13857
|
+
closable: PropTypes.bool,
|
13858
|
+
visible: PropTypes.bool.def(true),
|
13859
|
+
disabled: PropTypes.bool,
|
13860
|
+
sortable: PropTypes.bool,
|
13861
|
+
renderDirective: PropTypes.commonType(["if", "show"], "render").def("show"),
|
13862
|
+
panel: PropTypes.string || PropTypes.func
|
13863
|
+
};
|
13797
13864
|
var TabNav = vue.defineComponent({
|
13798
13865
|
name: "TabNav",
|
13799
|
-
props:
|
13800
|
-
active: {
|
13801
|
-
type: String || Number
|
13802
|
-
},
|
13803
|
-
panels: {
|
13804
|
-
type: Array,
|
13805
|
-
default: () => []
|
13806
|
-
},
|
13807
|
-
closable: PropTypes.bool.def(false),
|
13808
|
-
addable: PropTypes.bool.def(false),
|
13809
|
-
sortable: PropTypes.bool.def(false),
|
13810
|
-
sortType: PropTypes.commonType(["replace", "insert", "top"], "sortType").def("replace"),
|
13811
|
-
labelHeight: PropTypes.number.def(50),
|
13812
|
-
scrollStep: PropTypes.number.def(200),
|
13813
|
-
validateActive: PropTypes.bool.def(true),
|
13814
|
-
changeOnHover: PropTypes.bool.def(false),
|
13815
|
-
changeOnHoverDelay: PropTypes.number.def(1e3),
|
13816
|
-
tabAdd: {
|
13817
|
-
type: Function,
|
13818
|
-
default: () => ({})
|
13819
|
-
},
|
13820
|
-
tabChange: {
|
13821
|
-
type: Function,
|
13822
|
-
default: () => ({})
|
13823
|
-
},
|
13824
|
-
tabRemove: {
|
13825
|
-
type: Function,
|
13826
|
-
default: () => ({})
|
13827
|
-
},
|
13828
|
-
tabSort: {
|
13829
|
-
type: Function,
|
13830
|
-
default: () => ({})
|
13831
|
-
},
|
13832
|
-
tabDrag: {
|
13833
|
-
type: Function,
|
13834
|
-
default: () => ({})
|
13835
|
-
}
|
13836
|
-
},
|
13866
|
+
props: tabNavProps,
|
13837
13867
|
setup(props) {
|
13838
13868
|
const navs = vue.computed(() => {
|
13839
13869
|
if (!Array.isArray(props.panels) || !props.panels.length) {
|
@@ -13904,18 +13934,15 @@ var TabNav = vue.defineComponent({
|
|
13904
13934
|
distinctRoots(el1, el2) {
|
13905
13935
|
return el1 === el2;
|
13906
13936
|
},
|
13907
|
-
swapArr(arr, a2, b2) {
|
13908
|
-
const swap = arr[a2];
|
13909
|
-
arr[a2] = arr[b2];
|
13910
|
-
arr[b2] = swap;
|
13911
|
-
},
|
13912
13937
|
handleTabAdd(e) {
|
13913
13938
|
this.tabAdd(e);
|
13914
13939
|
},
|
13915
13940
|
dragstart(index, $event) {
|
13916
13941
|
this.dragStartIndex = index;
|
13917
13942
|
this.draggingEle = this.guid;
|
13918
|
-
$event.dataTransfer
|
13943
|
+
Object.assign($event.dataTransfer, {
|
13944
|
+
effectAllowed: "move"
|
13945
|
+
});
|
13919
13946
|
this.tabDrag(index, $event);
|
13920
13947
|
},
|
13921
13948
|
dragenter(index) {
|
@@ -13932,20 +13959,7 @@ var TabNav = vue.defineComponent({
|
|
13932
13959
|
if (!this.distinctRoots(this.draggingEle, this.guid)) {
|
13933
13960
|
return false;
|
13934
13961
|
}
|
13935
|
-
|
13936
|
-
if (this.dragStartIndex < index) {
|
13937
|
-
this.panels.splice(index + 1, 0, this.panels[this.dragStartIndex]);
|
13938
|
-
this.panels.splice(this.dragStartIndex, 1);
|
13939
|
-
} else if (this.dragStartIndex > index) {
|
13940
|
-
this.panels.splice(index, 0, this.panels[this.dragStartIndex]);
|
13941
|
-
this.panels.splice(this.dragStartIndex + 1, 1);
|
13942
|
-
} else {
|
13943
|
-
return false;
|
13944
|
-
}
|
13945
|
-
} else {
|
13946
|
-
this.swapArr(this.panels, this.dragStartIndex, index);
|
13947
|
-
}
|
13948
|
-
this.tabSort(this.dragStartIndex, index);
|
13962
|
+
this.tabSort(this.dragStartIndex, index, sortType);
|
13949
13963
|
},
|
13950
13964
|
handleTabChange(name) {
|
13951
13965
|
this.tabChange(name);
|
@@ -13986,7 +14000,7 @@ var TabNav = vue.defineComponent({
|
|
13986
14000
|
}
|
13987
14001
|
return classNames.join(" ");
|
13988
14002
|
};
|
13989
|
-
const getValue = (
|
14003
|
+
const getValue = (curentValue, parentValue) => curentValue || parentValue;
|
13990
14004
|
return vue.createVNode("div", {
|
13991
14005
|
"key": name,
|
13992
14006
|
"onClick": () => this.handleTabChange(name),
|
@@ -14018,26 +14032,29 @@ var TabNav = vue.defineComponent({
|
|
14018
14032
|
});
|
14019
14033
|
const renderSlot = () => {
|
14020
14034
|
var _a, _b, _c, _d;
|
14021
|
-
let addSlot;
|
14022
14035
|
const list = [];
|
14023
14036
|
if (typeof this.$slots.add === "function") {
|
14024
|
-
|
14037
|
+
list.push((_b = (_a = this.$slots).add) == null ? void 0 : _b.call(_a, vue.h));
|
14025
14038
|
} else if (addable) {
|
14026
|
-
|
14039
|
+
list.push(vue.createVNode("div", {
|
14027
14040
|
"onClick": this.handleTabAdd
|
14028
14041
|
}, [vue.createVNode(plus, {
|
14029
14042
|
"width": 26,
|
14030
14043
|
"height": 26
|
14031
|
-
}, null)]);
|
14044
|
+
}, null)]));
|
14032
14045
|
}
|
14033
|
-
list.push(addSlot);
|
14034
14046
|
if (typeof this.$slots.setting === "function") {
|
14035
14047
|
list.push((_d = (_c = this.$slots).setting) == null ? void 0 : _d.call(_c, vue.h));
|
14036
14048
|
}
|
14037
|
-
|
14038
|
-
|
14039
|
-
|
14040
|
-
|
14049
|
+
if (list.length) {
|
14050
|
+
return vue.createVNode("div", {
|
14051
|
+
"class": "bk-tab-header-operation"
|
14052
|
+
}, [list.map((item, index) => vue.createVNode("div", {
|
14053
|
+
"class": "bk-tab-header-item",
|
14054
|
+
"key": index
|
14055
|
+
}, [item]))]);
|
14056
|
+
}
|
14057
|
+
return null;
|
14041
14058
|
};
|
14042
14059
|
return vue.createVNode("div", {
|
14043
14060
|
"style": {
|
@@ -14046,9 +14063,7 @@ var TabNav = vue.defineComponent({
|
|
14046
14063
|
"class": "bk-tab-header"
|
14047
14064
|
}, [vue.createVNode("div", {
|
14048
14065
|
"class": "bk-tab-header-nav"
|
14049
|
-
}, [renderNavs()]),
|
14050
|
-
"class": "bk-tab-header-operation"
|
14051
|
-
}, [renderSlot()])]);
|
14066
|
+
}, [renderNavs()]), renderSlot()]);
|
14052
14067
|
}
|
14053
14068
|
});
|
14054
14069
|
var Tab = vue.defineComponent({
|
@@ -14056,28 +14071,11 @@ var Tab = vue.defineComponent({
|
|
14056
14071
|
components: {
|
14057
14072
|
TabNav
|
14058
14073
|
},
|
14059
|
-
props:
|
14060
|
-
active: {
|
14061
|
-
type: String || Number
|
14062
|
-
},
|
14063
|
-
type: PropTypes.commonType(["card", "border-card", "unborder-card"], "type").def("border-card"),
|
14064
|
-
tabPosition: PropTypes.commonType(["left", "right", "top"], "position").def("top"),
|
14065
|
-
closable: PropTypes.bool.def(false),
|
14066
|
-
addable: PropTypes.bool.def(false),
|
14067
|
-
sortable: PropTypes.bool.def(false),
|
14068
|
-
sortType: PropTypes.commonType(["replace", "insert", "top"], "sortType").def("replace"),
|
14069
|
-
labelHeight: PropTypes.number.def(50),
|
14070
|
-
scrollStep: PropTypes.number.def(200),
|
14071
|
-
extCls: PropTypes.string.def(""),
|
14072
|
-
validateActive: PropTypes.bool.def(true),
|
14073
|
-
showHeader: PropTypes.bool.def(true),
|
14074
|
-
changeOnHover: PropTypes.bool.def(false),
|
14075
|
-
changeOnHoverDelay: PropTypes.number.def(1e3)
|
14076
|
-
},
|
14074
|
+
props: tabProps,
|
14077
14075
|
emits: [
|
14078
14076
|
"add-panel",
|
14079
14077
|
"tab-change",
|
14080
|
-
"
|
14078
|
+
"remove-panel",
|
14081
14079
|
"sort-change",
|
14082
14080
|
"on-drag-tab",
|
14083
14081
|
"add",
|
@@ -14094,7 +14092,7 @@ var Tab = vue.defineComponent({
|
|
14094
14092
|
const panels = vue.ref([]);
|
14095
14093
|
const instance = vue.getCurrentInstance();
|
14096
14094
|
if (typeof slots.panel === "function") {
|
14097
|
-
panels.value = slots.
|
14095
|
+
panels.value = slots.panel();
|
14098
14096
|
}
|
14099
14097
|
if (typeof slots.default === "function") {
|
14100
14098
|
panels.value = slots.default();
|
@@ -14159,11 +14157,26 @@ var Tab = vue.defineComponent({
|
|
14159
14157
|
},
|
14160
14158
|
tabRemove(index, panel) {
|
14161
14159
|
this.$emit("remove", index, panel);
|
14162
|
-
this.$emit("
|
14160
|
+
this.$emit("remove-panel", index, panel);
|
14163
14161
|
},
|
14164
|
-
tabSort(dragTabIndex, dropTabIndex) {
|
14165
|
-
|
14166
|
-
|
14162
|
+
tabSort(dragTabIndex, dropTabIndex, sortType) {
|
14163
|
+
if (sortType === "insert") {
|
14164
|
+
if (dragTabIndex < dropTabIndex) {
|
14165
|
+
this.panels.splice(dropTabIndex + 1, 0, this.panels[dragTabIndex]);
|
14166
|
+
this.panels.splice(dragTabIndex, 1);
|
14167
|
+
} else if (dragTabIndex > dropTabIndex) {
|
14168
|
+
this.panels.splice(dropTabIndex, 0, this.panels[dragTabIndex]);
|
14169
|
+
this.panels.splice(dragTabIndex + 1, 1);
|
14170
|
+
} else {
|
14171
|
+
return false;
|
14172
|
+
}
|
14173
|
+
} else {
|
14174
|
+
const swap = this.panels[dropTabIndex];
|
14175
|
+
this.panels[dropTabIndex] = this.panels[dragTabIndex];
|
14176
|
+
this.panels[dragTabIndex] = swap;
|
14177
|
+
}
|
14178
|
+
this.$emit("sort", dragTabIndex, dropTabIndex, sortType);
|
14179
|
+
this.$emit("sort-change", dragTabIndex, dropTabIndex, sortType);
|
14167
14180
|
},
|
14168
14181
|
tabDrag(dragTabIndex, dragEvent) {
|
14169
14182
|
this.$emit("drag", dragTabIndex, dragEvent);
|
@@ -14231,18 +14244,7 @@ var Tab = vue.defineComponent({
|
|
14231
14244
|
});
|
14232
14245
|
var TabPanel = vue.defineComponent({
|
14233
14246
|
name: "TabPanel",
|
14234
|
-
props:
|
14235
|
-
name: {
|
14236
|
-
type: String || Number
|
14237
|
-
},
|
14238
|
-
label: String || Function,
|
14239
|
-
closable: Function || Boolean,
|
14240
|
-
visible: PropTypes.bool.def(true),
|
14241
|
-
disabled: PropTypes.bool.def(null) || void 0,
|
14242
|
-
sortable: Function || Boolean,
|
14243
|
-
renderDirective: PropTypes.commonType(["if", "show"], "render").def("show"),
|
14244
|
-
panel: String || Function
|
14245
|
-
},
|
14247
|
+
props: tabPanelProps,
|
14246
14248
|
render() {
|
14247
14249
|
const active = this.name === this.$parent.active;
|
14248
14250
|
const getContent = () => {
|
@@ -14266,8 +14268,7 @@ var TabPanel = vue.defineComponent({
|
|
14266
14268
|
}, [getContent()]), [[vue.vShow, active]]);
|
14267
14269
|
}
|
14268
14270
|
});
|
14269
|
-
const
|
14270
|
-
const BKTabPanel = withInstall(TabPanel);
|
14271
|
+
const BkTab = withInstallProps(Tab, { TabPanel });
|
14271
14272
|
const instances = {
|
14272
14273
|
"top-left": [],
|
14273
14274
|
"top-right": [],
|
@@ -20124,8 +20125,8 @@ var components = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProp
|
|
20124
20125
|
Tag: BkTag,
|
20125
20126
|
TagInput,
|
20126
20127
|
Divider: BkDivider,
|
20127
|
-
Tab:
|
20128
|
-
TabPanel
|
20128
|
+
Tab: BkTab,
|
20129
|
+
TabPanel,
|
20129
20130
|
Message,
|
20130
20131
|
Notify,
|
20131
20132
|
Menu: BkMenu,
|
@@ -20193,8 +20194,8 @@ exports.Sideslider = BkSideslider;
|
|
20193
20194
|
exports.Steps = BkSteps;
|
20194
20195
|
exports.Swiper = BkSwiper;
|
20195
20196
|
exports.Switcher = BkSwitcher;
|
20196
|
-
exports.Tab =
|
20197
|
-
exports.TabPanel =
|
20197
|
+
exports.Tab = BkTab;
|
20198
|
+
exports.TabPanel = TabPanel;
|
20198
20199
|
exports.Table = BkTable;
|
20199
20200
|
exports.Tag = BkTag;
|
20200
20201
|
exports.TagInput = TagInput;
|