bkui-vue 0.0.1-beta.30 → 0.0.1-beta.33
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 -139
- package/dist/bkui-vue.esm.js +141 -139
- package/dist/bkui-vue.umd.js +141 -139
- package/dist/style.css +154 -3
- package/lib/code-diff/code-diff.css +72 -1
- package/lib/code-diff/code-diff.d.ts +9 -0
- package/lib/code-diff/code-diff.less +94 -1
- package/lib/code-diff/code-diff.variable.css +72 -1
- package/lib/code-diff/index.d.ts +151 -3
- package/lib/code-diff/index.js +1 -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/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 +29 -9
- package/lib/table/index.js +2 -2
- package/lib/table/props.d.ts +0 -1
- package/lib/table/render.d.ts +10 -3
- package/lib/table/table.d.ts +8 -4
- package/lib/tree/index.d.ts +15 -7
- package/lib/tree/tree.d.ts +6 -16
- 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
|
});
|
@@ -11711,7 +11713,7 @@ var Component$7 = vue.defineComponent({
|
|
11711
11713
|
}
|
11712
11714
|
});
|
11713
11715
|
const BkSwitcher = withInstall(Component$7);
|
11714
|
-
const EventProps
|
11716
|
+
const EventProps = {
|
11715
11717
|
onContentScroll: Function
|
11716
11718
|
};
|
11717
11719
|
const virtualRenderProps = __spreadValues({
|
@@ -11734,7 +11736,7 @@ const virtualRenderProps = __spreadValues({
|
|
11734
11736
|
scrollPosition: PropTypes.string.def("content"),
|
11735
11737
|
abosuteHeight: PropTypes.oneOfType([PropTypes.string.def("auto"), PropTypes.number]).def("auto"),
|
11736
11738
|
throttleDelay: PropTypes.number.def(60)
|
11737
|
-
}, EventProps
|
11739
|
+
}, EventProps);
|
11738
11740
|
function getMatchedIndex(maxCount, maxHeight, groupItemCount, callback) {
|
11739
11741
|
let startIndex = 0;
|
11740
11742
|
let height = 0;
|
@@ -11963,10 +11965,7 @@ var Component$6 = vue.defineComponent({
|
|
11963
11965
|
});
|
11964
11966
|
const BkVirtualRender = withInstall(Component$6);
|
11965
11967
|
const BORDER_OPRIONS = ["none", "row", "col", "outer"];
|
11966
|
-
const
|
11967
|
-
onRowClick: Function
|
11968
|
-
};
|
11969
|
-
const tableProps = __spreadValues({
|
11968
|
+
const tableProps = {
|
11970
11969
|
data: PropTypes.arrayOf(PropTypes.any).def([]),
|
11971
11970
|
columns: PropTypes.arrayOf(PropTypes.shape({
|
11972
11971
|
label: PropTypes.oneOfType([PropTypes.func.def(() => ""), PropTypes.string.def("")]),
|
@@ -11985,7 +11984,7 @@ const tableProps = __spreadValues({
|
|
11985
11984
|
border: PropTypes.arrayOf(PropTypes.commonType(BORDER_OPRIONS, "border")).def(["row"]),
|
11986
11985
|
pagination: PropTypes.oneOfType([PropTypes.bool.def(false), PropTypes.object.def({})]).def(false),
|
11987
11986
|
remotePagination: PropTypes.bool.def(false)
|
11988
|
-
}
|
11987
|
+
};
|
11989
11988
|
function _isSlot(s2) {
|
11990
11989
|
return typeof s2 === "function" || Object.prototype.toString.call(s2) === "[object Object]" && !vue.isVNode(s2);
|
11991
11990
|
}
|
@@ -12366,7 +12365,7 @@ const paginationProps = {
|
|
12366
12365
|
var Component$5 = vue.defineComponent({
|
12367
12366
|
name: "Pagination",
|
12368
12367
|
props: paginationProps,
|
12369
|
-
emits: ["update:modelValue", "change", "update:limit", "
|
12368
|
+
emits: ["update:modelValue", "change", "update:limit", "limitChange"],
|
12370
12369
|
setup(props, context) {
|
12371
12370
|
const totalPageNum = vue.ref(0);
|
12372
12371
|
const {
|
@@ -12401,7 +12400,7 @@ var Component$5 = vue.defineComponent({
|
|
12401
12400
|
context.emit("change", smallListCurrent2);
|
12402
12401
|
});
|
12403
12402
|
vue.watch(localLimit, (localLimit2) => {
|
12404
|
-
context.emit("
|
12403
|
+
context.emit("limitChange", localLimit2);
|
12405
12404
|
});
|
12406
12405
|
return {
|
12407
12406
|
totalPageNum,
|
@@ -12606,14 +12605,14 @@ class TableRender {
|
|
12606
12605
|
Object.assign(this.props.pagination, {
|
12607
12606
|
limit
|
12608
12607
|
});
|
12609
|
-
this.context.emit("
|
12608
|
+
this.context.emit("pageLimitChange", limit);
|
12610
12609
|
}
|
12611
12610
|
hanlePageChange(current) {
|
12612
12611
|
Object.assign(this.props.pagination, {
|
12613
12612
|
current,
|
12614
12613
|
value: current
|
12615
12614
|
});
|
12616
|
-
this.context.emit("
|
12615
|
+
this.context.emit("pageValueChange", current);
|
12617
12616
|
}
|
12618
12617
|
setColumnActive(index, single = false) {
|
12619
12618
|
const col = this.propActiveCols.find((item) => item.index === index);
|
@@ -12658,7 +12657,8 @@ class TableRender {
|
|
12658
12657
|
};
|
12659
12658
|
return vue.createVNode("tr", {
|
12660
12659
|
"style": rowStyle,
|
12661
|
-
"onClick": (e) => this.handleRowClick(e, row, index, rows)
|
12660
|
+
"onClick": (e) => this.handleRowClick(e, row, index, rows),
|
12661
|
+
"onDblclick": (e) => this.handleRowDblClick(e, row, index, rows)
|
12662
12662
|
}, [this.props.columns.map((column) => vue.createVNode("td", {
|
12663
12663
|
"colspan": 1,
|
12664
12664
|
"rowspan": 1
|
@@ -12668,7 +12668,10 @@ class TableRender {
|
|
12668
12668
|
})]);
|
12669
12669
|
}
|
12670
12670
|
handleRowClick(e, row, index, rows) {
|
12671
|
-
this.context.emit("
|
12671
|
+
this.context.emit("rowClick", e, row, index, rows, this);
|
12672
|
+
}
|
12673
|
+
handleRowDblClick(e, row, index, rows) {
|
12674
|
+
this.context.emit("rowDblClick", e, row, index, rows, this);
|
12672
12675
|
}
|
12673
12676
|
renderCell(row, column, index, rows) {
|
12674
12677
|
const cell = row[resolvePropVal(column, "field", [column, row])];
|
@@ -12698,7 +12701,7 @@ class TableRender {
|
|
12698
12701
|
var Component$4 = vue.defineComponent({
|
12699
12702
|
name: "Table",
|
12700
12703
|
props: tableProps,
|
12701
|
-
emits: ["
|
12704
|
+
emits: ["columnPick", "rowClick", "rowDblClick", "pageLimitChange", "pageValueChange"],
|
12702
12705
|
setup(props, ctx) {
|
12703
12706
|
const activeCols = vue.reactive(resolveActiveColumns(props));
|
12704
12707
|
const colgroups = vue.reactive(props.columns.map((col) => __spreadProps(__spreadValues({}, col), {
|
@@ -13764,15 +13767,16 @@ var TagInput = vue.defineComponent({
|
|
13764
13767
|
TagInput.install = (Vue) => {
|
13765
13768
|
Vue.component(TagInput.name, TagInput);
|
13766
13769
|
};
|
13770
|
+
const dividerProps = {
|
13771
|
+
direction: PropTypes.commonType(["horizontal", "vertical"], "direction").def("horizontal"),
|
13772
|
+
align: PropTypes.commonType(["left", "center", "right"], "align").def("center"),
|
13773
|
+
color: PropTypes.string.def("#dde4eb"),
|
13774
|
+
width: PropTypes.number.def(1),
|
13775
|
+
type: PropTypes.commonType(["dashed", "solid"], "lineType").def("dashed")
|
13776
|
+
};
|
13767
13777
|
var bkDivider = vue.defineComponent({
|
13768
13778
|
name: "Divider",
|
13769
|
-
props:
|
13770
|
-
direction: PropTypes.commonType(["horizontal", "vertical"], "direction").def("horizontal"),
|
13771
|
-
align: PropTypes.commonType(["left", "center", "right"], "align").def("center"),
|
13772
|
-
color: PropTypes.string.def("#dde4eb"),
|
13773
|
-
width: PropTypes.number.def(1),
|
13774
|
-
type: PropTypes.commonType(["dashed", "solid"], "lineType").def("dashed")
|
13775
|
-
},
|
13779
|
+
props: dividerProps,
|
13776
13780
|
render() {
|
13777
13781
|
const styles = () => {
|
13778
13782
|
if (this.direction === "vertical") {
|
@@ -13797,46 +13801,73 @@ var bkDivider = vue.defineComponent({
|
|
13797
13801
|
}
|
13798
13802
|
});
|
13799
13803
|
const BkDivider = withInstall(bkDivider);
|
13804
|
+
const tabNavEventProps = {
|
13805
|
+
tabAdd: {
|
13806
|
+
type: Function,
|
13807
|
+
default: () => ({})
|
13808
|
+
},
|
13809
|
+
tabChange: {
|
13810
|
+
type: Function,
|
13811
|
+
default: (name) => name
|
13812
|
+
},
|
13813
|
+
tabRemove: {
|
13814
|
+
type: Function,
|
13815
|
+
default: (name) => name
|
13816
|
+
},
|
13817
|
+
tabSort: {
|
13818
|
+
type: Function,
|
13819
|
+
default: () => ({})
|
13820
|
+
},
|
13821
|
+
tabDrag: {
|
13822
|
+
type: Function,
|
13823
|
+
default: () => ({})
|
13824
|
+
}
|
13825
|
+
};
|
13826
|
+
const tabProps = {
|
13827
|
+
active: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).def(""),
|
13828
|
+
type: PropTypes.commonType(["card", "border-card", "unborder-card"], "type").def("border-card"),
|
13829
|
+
tabPosition: PropTypes.commonType(["left", "right", "top"], "position").def("top"),
|
13830
|
+
closable: Boolean,
|
13831
|
+
addable: Boolean,
|
13832
|
+
sortable: Boolean,
|
13833
|
+
sortType: PropTypes.commonType(["replace", "insert", "top"], "sortType").def("replace"),
|
13834
|
+
labelHeight: PropTypes.number.def(50),
|
13835
|
+
scrollStep: PropTypes.number.def(200),
|
13836
|
+
extCls: PropTypes.string.def(""),
|
13837
|
+
validateActive: PropTypes.bool.def(true),
|
13838
|
+
showHeader: PropTypes.bool.def(true),
|
13839
|
+
changeOnHover: PropTypes.bool.def(false),
|
13840
|
+
changeOnHoverDelay: PropTypes.number.def(1e3)
|
13841
|
+
};
|
13842
|
+
const tabNavProps = __spreadValues({
|
13843
|
+
active: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).def(""),
|
13844
|
+
panels: {
|
13845
|
+
type: Array,
|
13846
|
+
default: () => []
|
13847
|
+
},
|
13848
|
+
closable: Boolean,
|
13849
|
+
addable: Boolean,
|
13850
|
+
sortable: Boolean,
|
13851
|
+
sortType: PropTypes.commonType(["replace", "insert", "top"], "sortType").def("replace"),
|
13852
|
+
labelHeight: PropTypes.number.def(50),
|
13853
|
+
scrollStep: PropTypes.number.def(200),
|
13854
|
+
validateActive: PropTypes.bool.def(true),
|
13855
|
+
changeOnHover: PropTypes.bool.def(false),
|
13856
|
+
changeOnHoverDelay: PropTypes.number.def(1e3)
|
13857
|
+
}, tabNavEventProps);
|
13858
|
+
const tabPanelProps = {
|
13859
|
+
name: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).def(""),
|
13860
|
+
label: PropTypes.string || PropTypes.func,
|
13861
|
+
closable: PropTypes.bool,
|
13862
|
+
visible: PropTypes.bool.def(true),
|
13863
|
+
disabled: PropTypes.bool,
|
13864
|
+
sortable: PropTypes.bool,
|
13865
|
+
renderDirective: PropTypes.commonType(["if", "show"], "render").def("show"),
|
13866
|
+
panel: PropTypes.string || PropTypes.func
|
13867
|
+
};
|
13800
13868
|
var TabNav = vue.defineComponent({
|
13801
13869
|
name: "TabNav",
|
13802
|
-
props:
|
13803
|
-
active: {
|
13804
|
-
type: String || Number
|
13805
|
-
},
|
13806
|
-
panels: {
|
13807
|
-
type: Array,
|
13808
|
-
default: () => []
|
13809
|
-
},
|
13810
|
-
closable: PropTypes.bool.def(false),
|
13811
|
-
addable: PropTypes.bool.def(false),
|
13812
|
-
sortable: PropTypes.bool.def(false),
|
13813
|
-
sortType: PropTypes.commonType(["replace", "insert", "top"], "sortType").def("replace"),
|
13814
|
-
labelHeight: PropTypes.number.def(50),
|
13815
|
-
scrollStep: PropTypes.number.def(200),
|
13816
|
-
validateActive: PropTypes.bool.def(true),
|
13817
|
-
changeOnHover: PropTypes.bool.def(false),
|
13818
|
-
changeOnHoverDelay: PropTypes.number.def(1e3),
|
13819
|
-
tabAdd: {
|
13820
|
-
type: Function,
|
13821
|
-
default: () => ({})
|
13822
|
-
},
|
13823
|
-
tabChange: {
|
13824
|
-
type: Function,
|
13825
|
-
default: () => ({})
|
13826
|
-
},
|
13827
|
-
tabRemove: {
|
13828
|
-
type: Function,
|
13829
|
-
default: () => ({})
|
13830
|
-
},
|
13831
|
-
tabSort: {
|
13832
|
-
type: Function,
|
13833
|
-
default: () => ({})
|
13834
|
-
},
|
13835
|
-
tabDrag: {
|
13836
|
-
type: Function,
|
13837
|
-
default: () => ({})
|
13838
|
-
}
|
13839
|
-
},
|
13870
|
+
props: tabNavProps,
|
13840
13871
|
setup(props) {
|
13841
13872
|
const navs = vue.computed(() => {
|
13842
13873
|
if (!Array.isArray(props.panels) || !props.panels.length) {
|
@@ -13907,18 +13938,15 @@ var TabNav = vue.defineComponent({
|
|
13907
13938
|
distinctRoots(el1, el2) {
|
13908
13939
|
return el1 === el2;
|
13909
13940
|
},
|
13910
|
-
swapArr(arr, a2, b2) {
|
13911
|
-
const swap = arr[a2];
|
13912
|
-
arr[a2] = arr[b2];
|
13913
|
-
arr[b2] = swap;
|
13914
|
-
},
|
13915
13941
|
handleTabAdd(e) {
|
13916
13942
|
this.tabAdd(e);
|
13917
13943
|
},
|
13918
13944
|
dragstart(index, $event) {
|
13919
13945
|
this.dragStartIndex = index;
|
13920
13946
|
this.draggingEle = this.guid;
|
13921
|
-
$event.dataTransfer
|
13947
|
+
Object.assign($event.dataTransfer, {
|
13948
|
+
effectAllowed: "move"
|
13949
|
+
});
|
13922
13950
|
this.tabDrag(index, $event);
|
13923
13951
|
},
|
13924
13952
|
dragenter(index) {
|
@@ -13935,20 +13963,7 @@ var TabNav = vue.defineComponent({
|
|
13935
13963
|
if (!this.distinctRoots(this.draggingEle, this.guid)) {
|
13936
13964
|
return false;
|
13937
13965
|
}
|
13938
|
-
|
13939
|
-
if (this.dragStartIndex < index) {
|
13940
|
-
this.panels.splice(index + 1, 0, this.panels[this.dragStartIndex]);
|
13941
|
-
this.panels.splice(this.dragStartIndex, 1);
|
13942
|
-
} else if (this.dragStartIndex > index) {
|
13943
|
-
this.panels.splice(index, 0, this.panels[this.dragStartIndex]);
|
13944
|
-
this.panels.splice(this.dragStartIndex + 1, 1);
|
13945
|
-
} else {
|
13946
|
-
return false;
|
13947
|
-
}
|
13948
|
-
} else {
|
13949
|
-
this.swapArr(this.panels, this.dragStartIndex, index);
|
13950
|
-
}
|
13951
|
-
this.tabSort(this.dragStartIndex, index);
|
13966
|
+
this.tabSort(this.dragStartIndex, index, sortType);
|
13952
13967
|
},
|
13953
13968
|
handleTabChange(name) {
|
13954
13969
|
this.tabChange(name);
|
@@ -13989,7 +14004,7 @@ var TabNav = vue.defineComponent({
|
|
13989
14004
|
}
|
13990
14005
|
return classNames.join(" ");
|
13991
14006
|
};
|
13992
|
-
const getValue = (
|
14007
|
+
const getValue = (curentValue, parentValue) => curentValue || parentValue;
|
13993
14008
|
return vue.createVNode("div", {
|
13994
14009
|
"key": name,
|
13995
14010
|
"onClick": () => this.handleTabChange(name),
|
@@ -14021,26 +14036,29 @@ var TabNav = vue.defineComponent({
|
|
14021
14036
|
});
|
14022
14037
|
const renderSlot = () => {
|
14023
14038
|
var _a, _b, _c, _d;
|
14024
|
-
let addSlot;
|
14025
14039
|
const list = [];
|
14026
14040
|
if (typeof this.$slots.add === "function") {
|
14027
|
-
|
14041
|
+
list.push((_b = (_a = this.$slots).add) == null ? void 0 : _b.call(_a, vue.h));
|
14028
14042
|
} else if (addable) {
|
14029
|
-
|
14043
|
+
list.push(vue.createVNode("div", {
|
14030
14044
|
"onClick": this.handleTabAdd
|
14031
14045
|
}, [vue.createVNode(plus, {
|
14032
14046
|
"width": 26,
|
14033
14047
|
"height": 26
|
14034
|
-
}, null)]);
|
14048
|
+
}, null)]));
|
14035
14049
|
}
|
14036
|
-
list.push(addSlot);
|
14037
14050
|
if (typeof this.$slots.setting === "function") {
|
14038
14051
|
list.push((_d = (_c = this.$slots).setting) == null ? void 0 : _d.call(_c, vue.h));
|
14039
14052
|
}
|
14040
|
-
|
14041
|
-
|
14042
|
-
|
14043
|
-
|
14053
|
+
if (list.length) {
|
14054
|
+
return vue.createVNode("div", {
|
14055
|
+
"class": "bk-tab-header-operation"
|
14056
|
+
}, [list.map((item, index) => vue.createVNode("div", {
|
14057
|
+
"class": "bk-tab-header-item",
|
14058
|
+
"key": index
|
14059
|
+
}, [item]))]);
|
14060
|
+
}
|
14061
|
+
return null;
|
14044
14062
|
};
|
14045
14063
|
return vue.createVNode("div", {
|
14046
14064
|
"style": {
|
@@ -14049,9 +14067,7 @@ var TabNav = vue.defineComponent({
|
|
14049
14067
|
"class": "bk-tab-header"
|
14050
14068
|
}, [vue.createVNode("div", {
|
14051
14069
|
"class": "bk-tab-header-nav"
|
14052
|
-
}, [renderNavs()]),
|
14053
|
-
"class": "bk-tab-header-operation"
|
14054
|
-
}, [renderSlot()])]);
|
14070
|
+
}, [renderNavs()]), renderSlot()]);
|
14055
14071
|
}
|
14056
14072
|
});
|
14057
14073
|
var Tab = vue.defineComponent({
|
@@ -14059,28 +14075,11 @@ var Tab = vue.defineComponent({
|
|
14059
14075
|
components: {
|
14060
14076
|
TabNav
|
14061
14077
|
},
|
14062
|
-
props:
|
14063
|
-
active: {
|
14064
|
-
type: String || Number
|
14065
|
-
},
|
14066
|
-
type: PropTypes.commonType(["card", "border-card", "unborder-card"], "type").def("border-card"),
|
14067
|
-
tabPosition: PropTypes.commonType(["left", "right", "top"], "position").def("top"),
|
14068
|
-
closable: PropTypes.bool.def(false),
|
14069
|
-
addable: PropTypes.bool.def(false),
|
14070
|
-
sortable: PropTypes.bool.def(false),
|
14071
|
-
sortType: PropTypes.commonType(["replace", "insert", "top"], "sortType").def("replace"),
|
14072
|
-
labelHeight: PropTypes.number.def(50),
|
14073
|
-
scrollStep: PropTypes.number.def(200),
|
14074
|
-
extCls: PropTypes.string.def(""),
|
14075
|
-
validateActive: PropTypes.bool.def(true),
|
14076
|
-
showHeader: PropTypes.bool.def(true),
|
14077
|
-
changeOnHover: PropTypes.bool.def(false),
|
14078
|
-
changeOnHoverDelay: PropTypes.number.def(1e3)
|
14079
|
-
},
|
14078
|
+
props: tabProps,
|
14080
14079
|
emits: [
|
14081
14080
|
"add-panel",
|
14082
14081
|
"tab-change",
|
14083
|
-
"
|
14082
|
+
"remove-panel",
|
14084
14083
|
"sort-change",
|
14085
14084
|
"on-drag-tab",
|
14086
14085
|
"add",
|
@@ -14097,7 +14096,7 @@ var Tab = vue.defineComponent({
|
|
14097
14096
|
const panels = vue.ref([]);
|
14098
14097
|
const instance = vue.getCurrentInstance();
|
14099
14098
|
if (typeof slots.panel === "function") {
|
14100
|
-
panels.value = slots.
|
14099
|
+
panels.value = slots.panel();
|
14101
14100
|
}
|
14102
14101
|
if (typeof slots.default === "function") {
|
14103
14102
|
panels.value = slots.default();
|
@@ -14162,11 +14161,26 @@ var Tab = vue.defineComponent({
|
|
14162
14161
|
},
|
14163
14162
|
tabRemove(index, panel) {
|
14164
14163
|
this.$emit("remove", index, panel);
|
14165
|
-
this.$emit("
|
14164
|
+
this.$emit("remove-panel", index, panel);
|
14166
14165
|
},
|
14167
|
-
tabSort(dragTabIndex, dropTabIndex) {
|
14168
|
-
|
14169
|
-
|
14166
|
+
tabSort(dragTabIndex, dropTabIndex, sortType) {
|
14167
|
+
if (sortType === "insert") {
|
14168
|
+
if (dragTabIndex < dropTabIndex) {
|
14169
|
+
this.panels.splice(dropTabIndex + 1, 0, this.panels[dragTabIndex]);
|
14170
|
+
this.panels.splice(dragTabIndex, 1);
|
14171
|
+
} else if (dragTabIndex > dropTabIndex) {
|
14172
|
+
this.panels.splice(dropTabIndex, 0, this.panels[dragTabIndex]);
|
14173
|
+
this.panels.splice(dragTabIndex + 1, 1);
|
14174
|
+
} else {
|
14175
|
+
return false;
|
14176
|
+
}
|
14177
|
+
} else {
|
14178
|
+
const swap = this.panels[dropTabIndex];
|
14179
|
+
this.panels[dropTabIndex] = this.panels[dragTabIndex];
|
14180
|
+
this.panels[dragTabIndex] = swap;
|
14181
|
+
}
|
14182
|
+
this.$emit("sort", dragTabIndex, dropTabIndex, sortType);
|
14183
|
+
this.$emit("sort-change", dragTabIndex, dropTabIndex, sortType);
|
14170
14184
|
},
|
14171
14185
|
tabDrag(dragTabIndex, dragEvent) {
|
14172
14186
|
this.$emit("drag", dragTabIndex, dragEvent);
|
@@ -14234,18 +14248,7 @@ var Tab = vue.defineComponent({
|
|
14234
14248
|
});
|
14235
14249
|
var TabPanel = vue.defineComponent({
|
14236
14250
|
name: "TabPanel",
|
14237
|
-
props:
|
14238
|
-
name: {
|
14239
|
-
type: String || Number
|
14240
|
-
},
|
14241
|
-
label: String || Function,
|
14242
|
-
closable: Function || Boolean,
|
14243
|
-
visible: PropTypes.bool.def(true),
|
14244
|
-
disabled: PropTypes.bool.def(null) || void 0,
|
14245
|
-
sortable: Function || Boolean,
|
14246
|
-
renderDirective: PropTypes.commonType(["if", "show"], "render").def("show"),
|
14247
|
-
panel: String || Function
|
14248
|
-
},
|
14251
|
+
props: tabPanelProps,
|
14249
14252
|
render() {
|
14250
14253
|
const active = this.name === this.$parent.active;
|
14251
14254
|
const getContent = () => {
|
@@ -14269,8 +14272,7 @@ var TabPanel = vue.defineComponent({
|
|
14269
14272
|
}, [getContent()]), [[vue.vShow, active]]);
|
14270
14273
|
}
|
14271
14274
|
});
|
14272
|
-
const
|
14273
|
-
const BKTabPanel = withInstall(TabPanel);
|
14275
|
+
const BkTab = withInstallProps(Tab, { TabPanel });
|
14274
14276
|
const instances = {
|
14275
14277
|
"top-left": [],
|
14276
14278
|
"top-right": [],
|
@@ -20127,8 +20129,8 @@ var components = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProp
|
|
20127
20129
|
Tag: BkTag,
|
20128
20130
|
TagInput,
|
20129
20131
|
Divider: BkDivider,
|
20130
|
-
Tab:
|
20131
|
-
TabPanel
|
20132
|
+
Tab: BkTab,
|
20133
|
+
TabPanel,
|
20132
20134
|
Message,
|
20133
20135
|
Notify,
|
20134
20136
|
Menu: BkMenu,
|
@@ -20196,8 +20198,8 @@ exports.Sideslider = BkSideslider;
|
|
20196
20198
|
exports.Steps = BkSteps;
|
20197
20199
|
exports.Swiper = BkSwiper;
|
20198
20200
|
exports.Switcher = BkSwitcher;
|
20199
|
-
exports.Tab =
|
20200
|
-
exports.TabPanel =
|
20201
|
+
exports.Tab = BkTab;
|
20202
|
+
exports.TabPanel = TabPanel;
|
20201
20203
|
exports.Table = BkTable;
|
20202
20204
|
exports.Tag = BkTag;
|
20203
20205
|
exports.TagInput = TagInput;
|