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.esm.js
CHANGED
@@ -33,7 +33,7 @@ var __publicField = (obj, key, value) => {
|
|
33
33
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
34
34
|
return value;
|
35
35
|
};
|
36
|
-
import { createVNode, h as h$1, mergeProps, defineComponent, reactive, ref, computed, watch, onMounted, onBeforeUnmount, Transition, getCurrentInstance, provide, inject, nextTick, isVNode,
|
36
|
+
import { createVNode, h as h$1, mergeProps, defineComponent, reactive, ref, computed, watch, onMounted, onBeforeUnmount, Transition, getCurrentInstance, provide, inject, Fragment, nextTick, isVNode, createTextVNode, toRefs, customRef, onBeforeMount, withDirectives, vShow, toRef, unref, resolveDirective, vModelText, watchEffect, onUpdated, render, onUnmounted, Teleport } from "vue";
|
37
37
|
var reset = "";
|
38
38
|
var alert = "";
|
39
39
|
var backtop = "";
|
@@ -78,6 +78,7 @@ var virtualRender$1 = "";
|
|
78
78
|
var transfer = "";
|
79
79
|
var pagination = "";
|
80
80
|
var timeline = "";
|
81
|
+
var codeDiff = "";
|
81
82
|
var resizeLayout = "";
|
82
83
|
var tagInput = "";
|
83
84
|
const BKLAYERD_INDEX_EFAULT_VALUE = {
|
@@ -8459,6 +8460,7 @@ const loadingTypes = {
|
|
8459
8460
|
type: Function
|
8460
8461
|
},
|
8461
8462
|
loading: PropTypes.bool,
|
8463
|
+
inline: PropTypes.bool.def(true),
|
8462
8464
|
theme: PropTypes.theme(["white", "primary", "warning", "success", "danger"]),
|
8463
8465
|
title: PropTypes.string.def(""),
|
8464
8466
|
size: PropTypes.commonType(Object.values(BkLoadingSize)).def(BkLoadingSize.Normal),
|
@@ -8477,9 +8479,9 @@ var Component$r = defineComponent({
|
|
8477
8479
|
"class": `oval oval-${i}`
|
8478
8480
|
}, null))]);
|
8479
8481
|
const loadingWrapperCls = computed(() => classes({
|
8482
|
+
"bk-loading-wrapper": props.loading,
|
8480
8483
|
"bk-nested-loading": !!ctx.slots.default
|
8481
|
-
}
|
8482
|
-
console.log(props.theme);
|
8484
|
+
}));
|
8483
8485
|
const containerCls = computed(() => classes({
|
8484
8486
|
[`bk-loading-size-${props.size}`]: !!props.size,
|
8485
8487
|
[`bk-loading-${props.theme}`]: !!props.theme
|
@@ -8497,15 +8499,15 @@ var Component$r = defineComponent({
|
|
8497
8499
|
});
|
8498
8500
|
return () => {
|
8499
8501
|
var _a, _b;
|
8500
|
-
return
|
8502
|
+
return createVNode("div", {
|
8501
8503
|
"class": loadingWrapperCls.value
|
8502
|
-
}, [createVNode("div", {
|
8504
|
+
}, [props.loading && createVNode(Fragment, null, [createVNode("div", {
|
8503
8505
|
"class": containerCls.value
|
8504
8506
|
}, [indicator.value, hasTitle.value && createVNode("div", {
|
8505
8507
|
"class": "bk-loading-title"
|
8506
8508
|
}, [props.title])]), ctx.slots.default && createVNode("div", {
|
8507
8509
|
"class": "bk-loading-mask"
|
8508
|
-
},
|
8510
|
+
}, null)]), (_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)]);
|
8509
8511
|
};
|
8510
8512
|
}
|
8511
8513
|
});
|
@@ -11709,7 +11711,7 @@ var Component$7 = defineComponent({
|
|
11709
11711
|
}
|
11710
11712
|
});
|
11711
11713
|
const BkSwitcher = withInstall(Component$7);
|
11712
|
-
const EventProps
|
11714
|
+
const EventProps = {
|
11713
11715
|
onContentScroll: Function
|
11714
11716
|
};
|
11715
11717
|
const virtualRenderProps = __spreadValues({
|
@@ -11732,7 +11734,7 @@ const virtualRenderProps = __spreadValues({
|
|
11732
11734
|
scrollPosition: PropTypes.string.def("content"),
|
11733
11735
|
abosuteHeight: PropTypes.oneOfType([PropTypes.string.def("auto"), PropTypes.number]).def("auto"),
|
11734
11736
|
throttleDelay: PropTypes.number.def(60)
|
11735
|
-
}, EventProps
|
11737
|
+
}, EventProps);
|
11736
11738
|
function getMatchedIndex(maxCount, maxHeight, groupItemCount, callback) {
|
11737
11739
|
let startIndex = 0;
|
11738
11740
|
let height = 0;
|
@@ -11961,10 +11963,7 @@ var Component$6 = defineComponent({
|
|
11961
11963
|
});
|
11962
11964
|
const BkVirtualRender = withInstall(Component$6);
|
11963
11965
|
const BORDER_OPRIONS = ["none", "row", "col", "outer"];
|
11964
|
-
const
|
11965
|
-
onRowClick: Function
|
11966
|
-
};
|
11967
|
-
const tableProps = __spreadValues({
|
11966
|
+
const tableProps = {
|
11968
11967
|
data: PropTypes.arrayOf(PropTypes.any).def([]),
|
11969
11968
|
columns: PropTypes.arrayOf(PropTypes.shape({
|
11970
11969
|
label: PropTypes.oneOfType([PropTypes.func.def(() => ""), PropTypes.string.def("")]),
|
@@ -11983,7 +11982,7 @@ const tableProps = __spreadValues({
|
|
11983
11982
|
border: PropTypes.arrayOf(PropTypes.commonType(BORDER_OPRIONS, "border")).def(["row"]),
|
11984
11983
|
pagination: PropTypes.oneOfType([PropTypes.bool.def(false), PropTypes.object.def({})]).def(false),
|
11985
11984
|
remotePagination: PropTypes.bool.def(false)
|
11986
|
-
}
|
11985
|
+
};
|
11987
11986
|
function _isSlot(s2) {
|
11988
11987
|
return typeof s2 === "function" || Object.prototype.toString.call(s2) === "[object Object]" && !isVNode(s2);
|
11989
11988
|
}
|
@@ -12364,7 +12363,7 @@ const paginationProps = {
|
|
12364
12363
|
var Component$5 = defineComponent({
|
12365
12364
|
name: "Pagination",
|
12366
12365
|
props: paginationProps,
|
12367
|
-
emits: ["update:modelValue", "change", "update:limit", "
|
12366
|
+
emits: ["update:modelValue", "change", "update:limit", "limitChange"],
|
12368
12367
|
setup(props, context) {
|
12369
12368
|
const totalPageNum = ref(0);
|
12370
12369
|
const {
|
@@ -12399,7 +12398,7 @@ var Component$5 = defineComponent({
|
|
12399
12398
|
context.emit("change", smallListCurrent2);
|
12400
12399
|
});
|
12401
12400
|
watch(localLimit, (localLimit2) => {
|
12402
|
-
context.emit("
|
12401
|
+
context.emit("limitChange", localLimit2);
|
12403
12402
|
});
|
12404
12403
|
return {
|
12405
12404
|
totalPageNum,
|
@@ -12604,14 +12603,14 @@ class TableRender {
|
|
12604
12603
|
Object.assign(this.props.pagination, {
|
12605
12604
|
limit
|
12606
12605
|
});
|
12607
|
-
this.context.emit("
|
12606
|
+
this.context.emit("pageLimitChange", limit);
|
12608
12607
|
}
|
12609
12608
|
hanlePageChange(current) {
|
12610
12609
|
Object.assign(this.props.pagination, {
|
12611
12610
|
current,
|
12612
12611
|
value: current
|
12613
12612
|
});
|
12614
|
-
this.context.emit("
|
12613
|
+
this.context.emit("pageValueChange", current);
|
12615
12614
|
}
|
12616
12615
|
setColumnActive(index, single = false) {
|
12617
12616
|
const col = this.propActiveCols.find((item) => item.index === index);
|
@@ -12656,7 +12655,8 @@ class TableRender {
|
|
12656
12655
|
};
|
12657
12656
|
return createVNode("tr", {
|
12658
12657
|
"style": rowStyle,
|
12659
|
-
"onClick": (e) => this.handleRowClick(e, row, index, rows)
|
12658
|
+
"onClick": (e) => this.handleRowClick(e, row, index, rows),
|
12659
|
+
"onDblclick": (e) => this.handleRowDblClick(e, row, index, rows)
|
12660
12660
|
}, [this.props.columns.map((column) => createVNode("td", {
|
12661
12661
|
"colspan": 1,
|
12662
12662
|
"rowspan": 1
|
@@ -12666,7 +12666,10 @@ class TableRender {
|
|
12666
12666
|
})]);
|
12667
12667
|
}
|
12668
12668
|
handleRowClick(e, row, index, rows) {
|
12669
|
-
this.context.emit("
|
12669
|
+
this.context.emit("rowClick", e, row, index, rows, this);
|
12670
|
+
}
|
12671
|
+
handleRowDblClick(e, row, index, rows) {
|
12672
|
+
this.context.emit("rowDblClick", e, row, index, rows, this);
|
12670
12673
|
}
|
12671
12674
|
renderCell(row, column, index, rows) {
|
12672
12675
|
const cell = row[resolvePropVal(column, "field", [column, row])];
|
@@ -12696,7 +12699,7 @@ class TableRender {
|
|
12696
12699
|
var Component$4 = defineComponent({
|
12697
12700
|
name: "Table",
|
12698
12701
|
props: tableProps,
|
12699
|
-
emits: ["
|
12702
|
+
emits: ["columnPick", "rowClick", "rowDblClick", "pageLimitChange", "pageValueChange"],
|
12700
12703
|
setup(props, ctx) {
|
12701
12704
|
const activeCols = reactive(resolveActiveColumns(props));
|
12702
12705
|
const colgroups = reactive(props.columns.map((col) => __spreadProps(__spreadValues({}, col), {
|
@@ -13762,15 +13765,16 @@ var TagInput = defineComponent({
|
|
13762
13765
|
TagInput.install = (Vue) => {
|
13763
13766
|
Vue.component(TagInput.name, TagInput);
|
13764
13767
|
};
|
13768
|
+
const dividerProps = {
|
13769
|
+
direction: PropTypes.commonType(["horizontal", "vertical"], "direction").def("horizontal"),
|
13770
|
+
align: PropTypes.commonType(["left", "center", "right"], "align").def("center"),
|
13771
|
+
color: PropTypes.string.def("#dde4eb"),
|
13772
|
+
width: PropTypes.number.def(1),
|
13773
|
+
type: PropTypes.commonType(["dashed", "solid"], "lineType").def("dashed")
|
13774
|
+
};
|
13765
13775
|
var bkDivider = defineComponent({
|
13766
13776
|
name: "Divider",
|
13767
|
-
props:
|
13768
|
-
direction: PropTypes.commonType(["horizontal", "vertical"], "direction").def("horizontal"),
|
13769
|
-
align: PropTypes.commonType(["left", "center", "right"], "align").def("center"),
|
13770
|
-
color: PropTypes.string.def("#dde4eb"),
|
13771
|
-
width: PropTypes.number.def(1),
|
13772
|
-
type: PropTypes.commonType(["dashed", "solid"], "lineType").def("dashed")
|
13773
|
-
},
|
13777
|
+
props: dividerProps,
|
13774
13778
|
render() {
|
13775
13779
|
const styles = () => {
|
13776
13780
|
if (this.direction === "vertical") {
|
@@ -13795,46 +13799,73 @@ var bkDivider = defineComponent({
|
|
13795
13799
|
}
|
13796
13800
|
});
|
13797
13801
|
const BkDivider = withInstall(bkDivider);
|
13802
|
+
const tabNavEventProps = {
|
13803
|
+
tabAdd: {
|
13804
|
+
type: Function,
|
13805
|
+
default: () => ({})
|
13806
|
+
},
|
13807
|
+
tabChange: {
|
13808
|
+
type: Function,
|
13809
|
+
default: (name) => name
|
13810
|
+
},
|
13811
|
+
tabRemove: {
|
13812
|
+
type: Function,
|
13813
|
+
default: (name) => name
|
13814
|
+
},
|
13815
|
+
tabSort: {
|
13816
|
+
type: Function,
|
13817
|
+
default: () => ({})
|
13818
|
+
},
|
13819
|
+
tabDrag: {
|
13820
|
+
type: Function,
|
13821
|
+
default: () => ({})
|
13822
|
+
}
|
13823
|
+
};
|
13824
|
+
const tabProps = {
|
13825
|
+
active: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).def(""),
|
13826
|
+
type: PropTypes.commonType(["card", "border-card", "unborder-card"], "type").def("border-card"),
|
13827
|
+
tabPosition: PropTypes.commonType(["left", "right", "top"], "position").def("top"),
|
13828
|
+
closable: Boolean,
|
13829
|
+
addable: Boolean,
|
13830
|
+
sortable: Boolean,
|
13831
|
+
sortType: PropTypes.commonType(["replace", "insert", "top"], "sortType").def("replace"),
|
13832
|
+
labelHeight: PropTypes.number.def(50),
|
13833
|
+
scrollStep: PropTypes.number.def(200),
|
13834
|
+
extCls: PropTypes.string.def(""),
|
13835
|
+
validateActive: PropTypes.bool.def(true),
|
13836
|
+
showHeader: PropTypes.bool.def(true),
|
13837
|
+
changeOnHover: PropTypes.bool.def(false),
|
13838
|
+
changeOnHoverDelay: PropTypes.number.def(1e3)
|
13839
|
+
};
|
13840
|
+
const tabNavProps = __spreadValues({
|
13841
|
+
active: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).def(""),
|
13842
|
+
panels: {
|
13843
|
+
type: Array,
|
13844
|
+
default: () => []
|
13845
|
+
},
|
13846
|
+
closable: Boolean,
|
13847
|
+
addable: Boolean,
|
13848
|
+
sortable: Boolean,
|
13849
|
+
sortType: PropTypes.commonType(["replace", "insert", "top"], "sortType").def("replace"),
|
13850
|
+
labelHeight: PropTypes.number.def(50),
|
13851
|
+
scrollStep: PropTypes.number.def(200),
|
13852
|
+
validateActive: PropTypes.bool.def(true),
|
13853
|
+
changeOnHover: PropTypes.bool.def(false),
|
13854
|
+
changeOnHoverDelay: PropTypes.number.def(1e3)
|
13855
|
+
}, tabNavEventProps);
|
13856
|
+
const tabPanelProps = {
|
13857
|
+
name: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).def(""),
|
13858
|
+
label: PropTypes.string || PropTypes.func,
|
13859
|
+
closable: PropTypes.bool,
|
13860
|
+
visible: PropTypes.bool.def(true),
|
13861
|
+
disabled: PropTypes.bool,
|
13862
|
+
sortable: PropTypes.bool,
|
13863
|
+
renderDirective: PropTypes.commonType(["if", "show"], "render").def("show"),
|
13864
|
+
panel: PropTypes.string || PropTypes.func
|
13865
|
+
};
|
13798
13866
|
var TabNav = defineComponent({
|
13799
13867
|
name: "TabNav",
|
13800
|
-
props:
|
13801
|
-
active: {
|
13802
|
-
type: String || Number
|
13803
|
-
},
|
13804
|
-
panels: {
|
13805
|
-
type: Array,
|
13806
|
-
default: () => []
|
13807
|
-
},
|
13808
|
-
closable: PropTypes.bool.def(false),
|
13809
|
-
addable: PropTypes.bool.def(false),
|
13810
|
-
sortable: PropTypes.bool.def(false),
|
13811
|
-
sortType: PropTypes.commonType(["replace", "insert", "top"], "sortType").def("replace"),
|
13812
|
-
labelHeight: PropTypes.number.def(50),
|
13813
|
-
scrollStep: PropTypes.number.def(200),
|
13814
|
-
validateActive: PropTypes.bool.def(true),
|
13815
|
-
changeOnHover: PropTypes.bool.def(false),
|
13816
|
-
changeOnHoverDelay: PropTypes.number.def(1e3),
|
13817
|
-
tabAdd: {
|
13818
|
-
type: Function,
|
13819
|
-
default: () => ({})
|
13820
|
-
},
|
13821
|
-
tabChange: {
|
13822
|
-
type: Function,
|
13823
|
-
default: () => ({})
|
13824
|
-
},
|
13825
|
-
tabRemove: {
|
13826
|
-
type: Function,
|
13827
|
-
default: () => ({})
|
13828
|
-
},
|
13829
|
-
tabSort: {
|
13830
|
-
type: Function,
|
13831
|
-
default: () => ({})
|
13832
|
-
},
|
13833
|
-
tabDrag: {
|
13834
|
-
type: Function,
|
13835
|
-
default: () => ({})
|
13836
|
-
}
|
13837
|
-
},
|
13868
|
+
props: tabNavProps,
|
13838
13869
|
setup(props) {
|
13839
13870
|
const navs = computed(() => {
|
13840
13871
|
if (!Array.isArray(props.panels) || !props.panels.length) {
|
@@ -13905,18 +13936,15 @@ var TabNav = defineComponent({
|
|
13905
13936
|
distinctRoots(el1, el2) {
|
13906
13937
|
return el1 === el2;
|
13907
13938
|
},
|
13908
|
-
swapArr(arr, a2, b2) {
|
13909
|
-
const swap = arr[a2];
|
13910
|
-
arr[a2] = arr[b2];
|
13911
|
-
arr[b2] = swap;
|
13912
|
-
},
|
13913
13939
|
handleTabAdd(e) {
|
13914
13940
|
this.tabAdd(e);
|
13915
13941
|
},
|
13916
13942
|
dragstart(index, $event) {
|
13917
13943
|
this.dragStartIndex = index;
|
13918
13944
|
this.draggingEle = this.guid;
|
13919
|
-
$event.dataTransfer
|
13945
|
+
Object.assign($event.dataTransfer, {
|
13946
|
+
effectAllowed: "move"
|
13947
|
+
});
|
13920
13948
|
this.tabDrag(index, $event);
|
13921
13949
|
},
|
13922
13950
|
dragenter(index) {
|
@@ -13933,20 +13961,7 @@ var TabNav = defineComponent({
|
|
13933
13961
|
if (!this.distinctRoots(this.draggingEle, this.guid)) {
|
13934
13962
|
return false;
|
13935
13963
|
}
|
13936
|
-
|
13937
|
-
if (this.dragStartIndex < index) {
|
13938
|
-
this.panels.splice(index + 1, 0, this.panels[this.dragStartIndex]);
|
13939
|
-
this.panels.splice(this.dragStartIndex, 1);
|
13940
|
-
} else if (this.dragStartIndex > index) {
|
13941
|
-
this.panels.splice(index, 0, this.panels[this.dragStartIndex]);
|
13942
|
-
this.panels.splice(this.dragStartIndex + 1, 1);
|
13943
|
-
} else {
|
13944
|
-
return false;
|
13945
|
-
}
|
13946
|
-
} else {
|
13947
|
-
this.swapArr(this.panels, this.dragStartIndex, index);
|
13948
|
-
}
|
13949
|
-
this.tabSort(this.dragStartIndex, index);
|
13964
|
+
this.tabSort(this.dragStartIndex, index, sortType);
|
13950
13965
|
},
|
13951
13966
|
handleTabChange(name) {
|
13952
13967
|
this.tabChange(name);
|
@@ -13987,7 +14002,7 @@ var TabNav = defineComponent({
|
|
13987
14002
|
}
|
13988
14003
|
return classNames.join(" ");
|
13989
14004
|
};
|
13990
|
-
const getValue = (
|
14005
|
+
const getValue = (curentValue, parentValue) => curentValue || parentValue;
|
13991
14006
|
return createVNode("div", {
|
13992
14007
|
"key": name,
|
13993
14008
|
"onClick": () => this.handleTabChange(name),
|
@@ -14019,26 +14034,29 @@ var TabNav = defineComponent({
|
|
14019
14034
|
});
|
14020
14035
|
const renderSlot = () => {
|
14021
14036
|
var _a, _b, _c, _d;
|
14022
|
-
let addSlot;
|
14023
14037
|
const list = [];
|
14024
14038
|
if (typeof this.$slots.add === "function") {
|
14025
|
-
|
14039
|
+
list.push((_b = (_a = this.$slots).add) == null ? void 0 : _b.call(_a, h$1));
|
14026
14040
|
} else if (addable) {
|
14027
|
-
|
14041
|
+
list.push(createVNode("div", {
|
14028
14042
|
"onClick": this.handleTabAdd
|
14029
14043
|
}, [createVNode(plus, {
|
14030
14044
|
"width": 26,
|
14031
14045
|
"height": 26
|
14032
|
-
}, null)]);
|
14046
|
+
}, null)]));
|
14033
14047
|
}
|
14034
|
-
list.push(addSlot);
|
14035
14048
|
if (typeof this.$slots.setting === "function") {
|
14036
14049
|
list.push((_d = (_c = this.$slots).setting) == null ? void 0 : _d.call(_c, h$1));
|
14037
14050
|
}
|
14038
|
-
|
14039
|
-
|
14040
|
-
|
14041
|
-
|
14051
|
+
if (list.length) {
|
14052
|
+
return createVNode("div", {
|
14053
|
+
"class": "bk-tab-header-operation"
|
14054
|
+
}, [list.map((item, index) => createVNode("div", {
|
14055
|
+
"class": "bk-tab-header-item",
|
14056
|
+
"key": index
|
14057
|
+
}, [item]))]);
|
14058
|
+
}
|
14059
|
+
return null;
|
14042
14060
|
};
|
14043
14061
|
return createVNode("div", {
|
14044
14062
|
"style": {
|
@@ -14047,9 +14065,7 @@ var TabNav = defineComponent({
|
|
14047
14065
|
"class": "bk-tab-header"
|
14048
14066
|
}, [createVNode("div", {
|
14049
14067
|
"class": "bk-tab-header-nav"
|
14050
|
-
}, [renderNavs()]),
|
14051
|
-
"class": "bk-tab-header-operation"
|
14052
|
-
}, [renderSlot()])]);
|
14068
|
+
}, [renderNavs()]), renderSlot()]);
|
14053
14069
|
}
|
14054
14070
|
});
|
14055
14071
|
var Tab = defineComponent({
|
@@ -14057,28 +14073,11 @@ var Tab = defineComponent({
|
|
14057
14073
|
components: {
|
14058
14074
|
TabNav
|
14059
14075
|
},
|
14060
|
-
props:
|
14061
|
-
active: {
|
14062
|
-
type: String || Number
|
14063
|
-
},
|
14064
|
-
type: PropTypes.commonType(["card", "border-card", "unborder-card"], "type").def("border-card"),
|
14065
|
-
tabPosition: PropTypes.commonType(["left", "right", "top"], "position").def("top"),
|
14066
|
-
closable: PropTypes.bool.def(false),
|
14067
|
-
addable: PropTypes.bool.def(false),
|
14068
|
-
sortable: PropTypes.bool.def(false),
|
14069
|
-
sortType: PropTypes.commonType(["replace", "insert", "top"], "sortType").def("replace"),
|
14070
|
-
labelHeight: PropTypes.number.def(50),
|
14071
|
-
scrollStep: PropTypes.number.def(200),
|
14072
|
-
extCls: PropTypes.string.def(""),
|
14073
|
-
validateActive: PropTypes.bool.def(true),
|
14074
|
-
showHeader: PropTypes.bool.def(true),
|
14075
|
-
changeOnHover: PropTypes.bool.def(false),
|
14076
|
-
changeOnHoverDelay: PropTypes.number.def(1e3)
|
14077
|
-
},
|
14076
|
+
props: tabProps,
|
14078
14077
|
emits: [
|
14079
14078
|
"add-panel",
|
14080
14079
|
"tab-change",
|
14081
|
-
"
|
14080
|
+
"remove-panel",
|
14082
14081
|
"sort-change",
|
14083
14082
|
"on-drag-tab",
|
14084
14083
|
"add",
|
@@ -14095,7 +14094,7 @@ var Tab = defineComponent({
|
|
14095
14094
|
const panels = ref([]);
|
14096
14095
|
const instance = getCurrentInstance();
|
14097
14096
|
if (typeof slots.panel === "function") {
|
14098
|
-
panels.value = slots.
|
14097
|
+
panels.value = slots.panel();
|
14099
14098
|
}
|
14100
14099
|
if (typeof slots.default === "function") {
|
14101
14100
|
panels.value = slots.default();
|
@@ -14160,11 +14159,26 @@ var Tab = defineComponent({
|
|
14160
14159
|
},
|
14161
14160
|
tabRemove(index, panel) {
|
14162
14161
|
this.$emit("remove", index, panel);
|
14163
|
-
this.$emit("
|
14162
|
+
this.$emit("remove-panel", index, panel);
|
14164
14163
|
},
|
14165
|
-
tabSort(dragTabIndex, dropTabIndex) {
|
14166
|
-
|
14167
|
-
|
14164
|
+
tabSort(dragTabIndex, dropTabIndex, sortType) {
|
14165
|
+
if (sortType === "insert") {
|
14166
|
+
if (dragTabIndex < dropTabIndex) {
|
14167
|
+
this.panels.splice(dropTabIndex + 1, 0, this.panels[dragTabIndex]);
|
14168
|
+
this.panels.splice(dragTabIndex, 1);
|
14169
|
+
} else if (dragTabIndex > dropTabIndex) {
|
14170
|
+
this.panels.splice(dropTabIndex, 0, this.panels[dragTabIndex]);
|
14171
|
+
this.panels.splice(dragTabIndex + 1, 1);
|
14172
|
+
} else {
|
14173
|
+
return false;
|
14174
|
+
}
|
14175
|
+
} else {
|
14176
|
+
const swap = this.panels[dropTabIndex];
|
14177
|
+
this.panels[dropTabIndex] = this.panels[dragTabIndex];
|
14178
|
+
this.panels[dragTabIndex] = swap;
|
14179
|
+
}
|
14180
|
+
this.$emit("sort", dragTabIndex, dropTabIndex, sortType);
|
14181
|
+
this.$emit("sort-change", dragTabIndex, dropTabIndex, sortType);
|
14168
14182
|
},
|
14169
14183
|
tabDrag(dragTabIndex, dragEvent) {
|
14170
14184
|
this.$emit("drag", dragTabIndex, dragEvent);
|
@@ -14232,18 +14246,7 @@ var Tab = defineComponent({
|
|
14232
14246
|
});
|
14233
14247
|
var TabPanel = defineComponent({
|
14234
14248
|
name: "TabPanel",
|
14235
|
-
props:
|
14236
|
-
name: {
|
14237
|
-
type: String || Number
|
14238
|
-
},
|
14239
|
-
label: String || Function,
|
14240
|
-
closable: Function || Boolean,
|
14241
|
-
visible: PropTypes.bool.def(true),
|
14242
|
-
disabled: PropTypes.bool.def(null) || void 0,
|
14243
|
-
sortable: Function || Boolean,
|
14244
|
-
renderDirective: PropTypes.commonType(["if", "show"], "render").def("show"),
|
14245
|
-
panel: String || Function
|
14246
|
-
},
|
14249
|
+
props: tabPanelProps,
|
14247
14250
|
render() {
|
14248
14251
|
const active = this.name === this.$parent.active;
|
14249
14252
|
const getContent = () => {
|
@@ -14267,8 +14270,7 @@ var TabPanel = defineComponent({
|
|
14267
14270
|
}, [getContent()]), [[vShow, active]]);
|
14268
14271
|
}
|
14269
14272
|
});
|
14270
|
-
const
|
14271
|
-
const BKTabPanel = withInstall(TabPanel);
|
14273
|
+
const BkTab = withInstallProps(Tab, { TabPanel });
|
14272
14274
|
const instances = {
|
14273
14275
|
"top-left": [],
|
14274
14276
|
"top-right": [],
|
@@ -20125,8 +20127,8 @@ var components = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProp
|
|
20125
20127
|
Tag: BkTag,
|
20126
20128
|
TagInput,
|
20127
20129
|
Divider: BkDivider,
|
20128
|
-
Tab:
|
20129
|
-
TabPanel
|
20130
|
+
Tab: BkTab,
|
20131
|
+
TabPanel,
|
20130
20132
|
Message,
|
20131
20133
|
Notify,
|
20132
20134
|
Menu: BkMenu,
|
@@ -20154,4 +20156,4 @@ var preset = {
|
|
20154
20156
|
install: createInstall(),
|
20155
20157
|
version: "0.0.1"
|
20156
20158
|
};
|
20157
|
-
export { BkAlert as Alert, BkAnimateNumber as AnimateNumber, BkBacktop as Backtop, BkBadge as Badge, BkOption, OptionGroup as BkOptionGroup, BkBreadcrumb as Breadcrumb, BreadcrumbItem, BkButton as Button, ButtonGroup, BkCard as Card, BkCheckbox as Checkbox, CheckboxGroup, BkCollaspe as Collapse, BkDatePicker as DatePicker, BkDialog as Dialog, BkDivider as Divider, BkException as Exception, BkFixedNavbar as FixedNavbar, BkForm as Form, FormItem, BkInput as Input, BkLink as Link, BkLoading as Loading, BkMenu as Menu, Message, BkModal as Modal, Navigation, Notify, BkPopover as Popover, BkProgress as Progress, BkRadio as Radio, RadioButton, RadioGroup, BkRate as Rate, BkSelect as Select, BkSideslider as Sideslider, BkSteps as Steps, BkSwiper as Swiper, BkSwitcher as Switcher,
|
20159
|
+
export { BkAlert as Alert, BkAnimateNumber as AnimateNumber, BkBacktop as Backtop, BkBadge as Badge, BkOption, OptionGroup as BkOptionGroup, BkBreadcrumb as Breadcrumb, BreadcrumbItem, BkButton as Button, ButtonGroup, BkCard as Card, BkCheckbox as Checkbox, CheckboxGroup, BkCollaspe as Collapse, BkDatePicker as DatePicker, BkDialog as Dialog, BkDivider as Divider, BkException as Exception, BkFixedNavbar as FixedNavbar, BkForm as Form, FormItem, BkInput as Input, BkLink as Link, BkLoading as Loading, BkMenu as Menu, Message, BkModal as Modal, Navigation, Notify, BkPopover as Popover, BkProgress as Progress, BkRadio as Radio, RadioButton, RadioGroup, BkRate as Rate, BkSelect as Select, BkSideslider as Sideslider, BkSteps as Steps, BkSwiper as Swiper, BkSwitcher as Switcher, BkTab as Tab, TabPanel, BkTable as Table, BkTag as Tag, TagInput, Transfer, BkTree as Tree, BkVirtualRender as VirtualRender, tooltips as bkTooltips, ClickOutside as clickoutside, preset as default, mousewheel };
|