bkui-vue 0.0.1-beta.141 → 0.0.1-beta.144
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/index.cjs.js +30 -30
- package/dist/index.esm.js +199 -73
- package/dist/index.umd.js +27 -27
- package/dist/style.css +1 -1
- package/dist/style.variable.css +1 -1
- package/lib/collapse/collapse-panel.d.ts +64 -0
- package/lib/collapse/collapse.css +10 -10
- package/lib/collapse/collapse.d.ts +0 -40
- package/lib/collapse/collapse.less +44 -46
- package/lib/collapse/collapse.variable.css +10 -10
- package/lib/collapse/index.d.ts +68 -1
- package/lib/collapse/index.js +1 -1
- package/lib/collapse/props.d.ts +114 -0
- package/lib/color-picker/color-picker.css +275 -0
- package/lib/color-picker/color-picker.d.ts +128 -0
- package/lib/color-picker/color-picker.less +325 -0
- package/lib/color-picker/color-picker.variable.css +388 -0
- package/lib/color-picker/index.d.ts +231 -0
- package/lib/color-picker/index.js +1 -0
- package/lib/color-picker/utils.d.ts +37 -0
- package/lib/dialog/dialog.d.ts +1 -1
- package/lib/dialog/index.d.ts +4 -4
- package/lib/modal/index.d.ts +4 -4
- package/lib/modal/modal.d.ts +1 -1
- package/lib/popover2/index.js +1 -1
- package/lib/sideslider/index.d.ts +4 -4
- package/lib/sideslider/sideslider.d.ts +1 -1
- package/lib/styles/index.d.ts +1 -0
- package/lib/tab/index.d.ts +1 -1
- package/lib/tab/tab-panel.d.ts +1 -1
- package/package.json +2 -1
package/dist/index.esm.js
CHANGED
@@ -33,7 +33,7 @@ var __publicField = (obj, key2, value) => {
|
|
33
33
|
__defNormalProp(obj, typeof key2 !== "symbol" ? key2 + "" : key2, value);
|
34
34
|
return value;
|
35
35
|
};
|
36
|
-
import { inject, createVNode, h as h$1, mergeProps, defineComponent, reactive, ref, computed, watch, onMounted, onBeforeUnmount, getCurrentInstance, nextTick, Transition, provide, createTextVNode, withDirectives, vShow,
|
36
|
+
import { inject, createVNode, h as h$1, mergeProps, defineComponent, reactive, ref, computed, watch, onMounted, onBeforeUnmount, getCurrentInstance, nextTick, Transition, provide, createTextVNode, isVNode, withDirectives, vShow, Fragment, toRefs, onUnmounted, Teleport, resolveDirective, customRef, onBeforeMount, toRef, vModelText, watchEffect, onUpdated, render as render$1, toRaw, withModifiers, TransitionGroup, shallowRef } from "vue";
|
37
37
|
var reset = "";
|
38
38
|
var alert = "";
|
39
39
|
var affix = "";
|
@@ -86,6 +86,7 @@ var upload$1 = "";
|
|
86
86
|
var tagInput = "";
|
87
87
|
var container = "";
|
88
88
|
var cascader = "";
|
89
|
+
var colorPicker = "";
|
89
90
|
const BKLAYERD_INDEX_EFAULT_VALUE = {
|
90
91
|
["bottom"]: 0,
|
91
92
|
["content"]: 1,
|
@@ -8480,7 +8481,7 @@ const warn = (props, context) => {
|
|
8480
8481
|
warn.displayName = "warn";
|
8481
8482
|
warn.inheritAttrs = false;
|
8482
8483
|
JSON.parse('{"type":"element","name":"svg","attributes":{"xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 1024 1024","style":"width: 1em; height: 1em; vertical-align: middle;fill: currentColor;overflow: hidden;"},"elements":[{"type":"element","name":"path","attributes":{"d":"M603.52 348.8c0 26.496-22.357333333333333 48-49.919999999999995 48s-49.919999999999995-21.503999999999998-49.919999999999995-48c0-26.496 22.357333333333333-48 49.919999999999995-48s49.919999999999995 21.503999999999998 49.919999999999995 48z"}},{"type":"element","name":"path","attributes":{"d":"M357.11999999999995 348.8c0 26.496-22.357333333333333 48-49.919999999999995 48s-49.919999999999995-21.503999999999998-49.919999999999995-48c0-26.496 22.357333333333333-48 49.919999999999995-48s49.919999999999995 21.503999999999998 49.919999999999995 48z"}},{"type":"element","name":"path","attributes":{"d":"M693.12 604.16c0 15.914666666666665-13.184 28.8-29.439999999999998 28.8s-29.439999999999998-12.885333333333332-29.439999999999998-28.8c0-15.914666666666665 13.184-28.8 29.439999999999998-28.8s29.439999999999998 12.885333333333332 29.439999999999998 28.8z"}},{"type":"element","name":"path","attributes":{"d":"M951.68 832c43.775999999999996-42.410666666666664 71.29599999999999-101.41866666666665 72.32-166.86933333333332-4.608-109.696-77.35466666666666-201.0453333333333-176.72533333333334-233.30133333333333 5.674666666666667-12.117333333333331 10.154666666666666-26.282666666666664 10.154666666666666-41.471999999999994 0-4.522666666666666-0.38399999999999995-8.959999999999999-1.152-13.226666666666667-33.834666666666664-181.29066666666665-212.39466666666664-313.1306666666667-425.5146666666667-313.1306666666667-238.71999999999997 0-430.72 167.04-430.72 372.48 1.2799999999999998 107.56266666666666 50.56 203.30666666666664 127.40266666666668 267.05066666666664l-16.682666666666666 55.50933333333333c-2.1759999999999997 6.784-3.456 14.634666666666668-3.456 22.741333333333333 0 42.410666666666664 34.38933333333333 76.8 76.8 76.8 12.458666666666666 0 24.191999999999997-2.944 34.602666666666664-8.234666666666666l101.33333333333333-52.906666666666666c32.81066666666666 7.722666666666666 70.52799999999999 12.159999999999998 109.22666666666666 12.159999999999998 0.08533333333333333 0 0.17066666666666666 0 0.21333333333333332 0h28.16c13.098666666666666-0.7679999999999999 25.130666666666663-4.693333333333333 35.54133333333333-11.050666666666666 54.22933333333333 73.55733333333333 140.672 120.53333333333333 238.07999999999998 120.53333333333333 1.664 0 3.3706666666666667 0 5.034666666666666-0.042666666666666665 21.077333333333332-0.08533333333333333 41.855999999999995-2.1759999999999997 61.99466666666667-6.101333333333333l49.10933333333333 26.581333333333333c9.941333333333333 5.034666666666666 21.717333333333332 8.021333333333333 34.176 8.021333333333333 42.410666666666664 0 76.8-34.38933333333333 76.8-76.8 0-8.106666666666666-1.2799999999999998-15.957333333333333-3.584-23.296zM430.72 752.64c-0.17066666666666666 0-0.38399999999999995 0-0.5973333333333333 0-40.831999999999994 0-80.29866666666666-5.8453333333333335-117.58933333333331-16.72533333333333l-3.456 0.7253333333333334-131.2 67.19999999999999 35.199999999999996-113.27999999999999h-3.1999999999999997c-86.10133333333332-52.05333333333333-143.40266666666668-144.17066666666665-145.92-249.89866666666666 0-172.50133333333332 165.76-312.66133333333335 366.72-312.66133333333335 5.717333333333333-0.3413333333333333 12.415999999999999-0.512 19.157333333333334-0.512 163.32799999999997 0 300.58666666666664 111.40266666666668 340.0106666666667 262.4l-14.805333333333332 2.432c-183.04 0-327.03999999999996 112-327.03999999999996 285.44 0.512 26.709333333333333 5.1626666666666665 52.181333333333335 13.312 75.98933333333332zM872.96 812.8v0l21.759999999999998 67.84-81.28-40.959999999999994h-3.84c-21.119999999999997 6.101333333333333-45.397333333333336 9.6-70.48533333333333 9.6-0.17066666666666666 0-0.38399999999999995 0-0.5546666666666666 0-5.888 0.5973333333333333-12.757333333333332 0.9386666666666665-19.712 0.9386666666666665-107.09333333333332 0-195.2853333333333-80.93866666666666-206.71999999999997-184.95999999999998 10.367999999999999-106.96533333333333 99.072-189.1413333333333 206.976-189.1413333333333 5.973333333333334 0 11.861333333333334 0.256 17.706666666666663 0.7253333333333334 4.309333333333333-0.512 10.197333333333333-0.7253333333333334 16.170666666666666-0.7253333333333334 107.904 0 196.60799999999998 82.17599999999999 206.976 187.34933333333333-1.7066666666666666 63.82933333333333-35.79733333333333 118.44266666666665-86.18666666666667 148.90666666666667z"}},{"type":"element","name":"path","attributes":{"d":"M839.68 604.16c0 15.914666666666665-13.184 28.8-29.439999999999998 28.8s-29.439999999999998-12.885333333333332-29.439999999999998-28.8c0-15.914666666666665 13.184-28.8 29.439999999999998-28.8s29.439999999999998 12.885333333333332 29.439999999999998 28.8z"}}]}');
|
8483
|
-
var Component$
|
8484
|
+
var Component$F = defineComponent({
|
8484
8485
|
name: "Alert",
|
8485
8486
|
props: {
|
8486
8487
|
theme: PropTypes.theme(["info", "success", "warning", "error"]).def("info"),
|
@@ -8537,8 +8538,8 @@ var Component$G = defineComponent({
|
|
8537
8538
|
}, [this.closeText ? this.closeText : createVNode(closeLine, null, null)])])]);
|
8538
8539
|
}
|
8539
8540
|
});
|
8540
|
-
const BkAlert = withInstall(Component$
|
8541
|
-
var Component$
|
8541
|
+
const BkAlert = withInstall(Component$F);
|
8542
|
+
var Component$E = defineComponent({
|
8542
8543
|
name: "AnimateNumber",
|
8543
8544
|
props: {
|
8544
8545
|
value: PropTypes.number.def(0),
|
@@ -8586,7 +8587,7 @@ var Component$F = defineComponent({
|
|
8586
8587
|
return () => createVNode("span", null, [formatValue.value]);
|
8587
8588
|
}
|
8588
8589
|
});
|
8589
|
-
const BkAnimateNumber = withInstall(Component$
|
8590
|
+
const BkAnimateNumber = withInstall(Component$E);
|
8590
8591
|
const on$1 = (() => {
|
8591
8592
|
if (document.addEventListener) {
|
8592
8593
|
return (element, event, handler) => {
|
@@ -8615,7 +8616,7 @@ const off$1 = (() => {
|
|
8615
8616
|
}
|
8616
8617
|
};
|
8617
8618
|
})();
|
8618
|
-
var Component$
|
8619
|
+
var Component$D = defineComponent({
|
8619
8620
|
name: "Affix",
|
8620
8621
|
props: {
|
8621
8622
|
offsetTop: PropTypes.number.def(0),
|
@@ -8740,8 +8741,8 @@ var Component$E = defineComponent({
|
|
8740
8741
|
};
|
8741
8742
|
}
|
8742
8743
|
});
|
8743
|
-
const BkAffix = withInstall(Component$
|
8744
|
-
var Component$
|
8744
|
+
const BkAffix = withInstall(Component$D);
|
8745
|
+
var Component$C = defineComponent({
|
8745
8746
|
name: "Backtop",
|
8746
8747
|
props: {
|
8747
8748
|
visibilityHeight: PropTypes.number.def(200),
|
@@ -8808,8 +8809,8 @@ var Component$D = defineComponent({
|
|
8808
8809
|
});
|
8809
8810
|
}
|
8810
8811
|
});
|
8811
|
-
const BkBacktop = withInstall(Component$
|
8812
|
-
var Component$
|
8812
|
+
const BkBacktop = withInstall(Component$C);
|
8813
|
+
var Component$B = defineComponent({
|
8813
8814
|
name: "Badge",
|
8814
8815
|
props: {
|
8815
8816
|
theme: PropTypes.string.def("primary"),
|
@@ -8885,8 +8886,8 @@ var Component$C = defineComponent({
|
|
8885
8886
|
}, [(_f = (_e = (_d = this.$slots).icon) == null ? void 0 : _e.call(_d)) != null ? _f : number]) : ""]);
|
8886
8887
|
}
|
8887
8888
|
});
|
8888
|
-
const BkBadge = withInstall(Component$
|
8889
|
-
var Component$
|
8889
|
+
const BkBadge = withInstall(Component$B);
|
8890
|
+
var Component$A = defineComponent({
|
8890
8891
|
name: "Breadcrumb",
|
8891
8892
|
props: {
|
8892
8893
|
extCls: PropTypes.string,
|
@@ -8985,7 +8986,7 @@ var BreadcrumbItem = defineComponent({
|
|
8985
8986
|
};
|
8986
8987
|
}
|
8987
8988
|
});
|
8988
|
-
const BkBreadcrumb = withInstallProps(Component$
|
8989
|
+
const BkBreadcrumb = withInstallProps(Component$A, { Item: BreadcrumbItem });
|
8989
8990
|
let BkLoadingMode;
|
8990
8991
|
(function(BkLoadingMode2) {
|
8991
8992
|
BkLoadingMode2["Default"] = "default";
|
@@ -9016,7 +9017,7 @@ const loadingTypes = {
|
|
9016
9017
|
color: PropTypes.string.def("white"),
|
9017
9018
|
zIndex: PropTypes.number.def(1)
|
9018
9019
|
};
|
9019
|
-
var Component$
|
9020
|
+
var Component$z = defineComponent({
|
9020
9021
|
name: "Loading",
|
9021
9022
|
props: loadingTypes,
|
9022
9023
|
setup(props, ctx) {
|
@@ -9072,7 +9073,7 @@ var Component$A = defineComponent({
|
|
9072
9073
|
};
|
9073
9074
|
}
|
9074
9075
|
});
|
9075
|
-
const BkLoading = withInstallProps(Component$
|
9076
|
+
const BkLoading = withInstallProps(Component$z, { setDefaultIndicator, BkLoadingMode, BkLoadingSize }, true);
|
9076
9077
|
const btnSizes = ["", "small", "large"];
|
9077
9078
|
const buttonProps = {
|
9078
9079
|
theme: PropTypes.theme().def(""),
|
@@ -9092,7 +9093,7 @@ const buttonProps = {
|
|
9092
9093
|
default: "button"
|
9093
9094
|
}
|
9094
9095
|
};
|
9095
|
-
var Component$
|
9096
|
+
var Component$y = defineComponent({
|
9096
9097
|
name: "Button",
|
9097
9098
|
props: buttonProps,
|
9098
9099
|
emits: ["click", "mouseover"],
|
@@ -9183,7 +9184,7 @@ var ButtonGroup = defineComponent({
|
|
9183
9184
|
};
|
9184
9185
|
}
|
9185
9186
|
});
|
9186
|
-
const BkButton = withInstallProps(Component$
|
9187
|
+
const BkButton = withInstallProps(Component$y, { ButtonGroup });
|
9187
9188
|
const inputType = {
|
9188
9189
|
type: PropTypes.string.def("text"),
|
9189
9190
|
clearable: PropTypes.bool,
|
@@ -9246,7 +9247,7 @@ const inputEmitEventsType = {
|
|
9246
9247
|
[EVENTS$2.COMPOSITIONUPDATE]: CompositionEventFunction,
|
9247
9248
|
[EVENTS$2.COMPOSITIONEND]: CompositionEventFunction
|
9248
9249
|
};
|
9249
|
-
var Component$
|
9250
|
+
var Component$x = defineComponent({
|
9250
9251
|
name: "Input",
|
9251
9252
|
inheritAttrs: false,
|
9252
9253
|
props: inputType,
|
@@ -9462,8 +9463,8 @@ var Component$y = defineComponent({
|
|
9462
9463
|
};
|
9463
9464
|
}
|
9464
9465
|
});
|
9465
|
-
const BkInput = withInstall(Component$
|
9466
|
-
var Component$
|
9466
|
+
const BkInput = withInstall(Component$x);
|
9467
|
+
var Component$w = defineComponent({
|
9467
9468
|
name: "Card",
|
9468
9469
|
props: {
|
9469
9470
|
title: PropTypes.string,
|
@@ -9556,7 +9557,7 @@ var Component$x = defineComponent({
|
|
9556
9557
|
}, [(_l = (_k = (_j = this.$slots).footer) == null ? void 0 : _k.call(_j)) != null ? _l : "Footer"]) : ""]) : ""]);
|
9557
9558
|
}
|
9558
9559
|
});
|
9559
|
-
const BkCard = withInstall(Component$
|
9560
|
+
const BkCard = withInstall(Component$w);
|
9560
9561
|
const checkboxGroupKey = Symbol("CheckboxGroup");
|
9561
9562
|
function useFocus$1() {
|
9562
9563
|
const isFocus = ref(false);
|
@@ -9657,7 +9658,7 @@ const checkboxProps = {
|
|
9657
9658
|
beforeChange: PropTypes.func,
|
9658
9659
|
size: PropTypes.size().def("large")
|
9659
9660
|
};
|
9660
|
-
var Component$
|
9661
|
+
var Component$v = defineComponent({
|
9661
9662
|
name: "Checkbox",
|
9662
9663
|
props: checkboxProps,
|
9663
9664
|
emits: ["update:modelValue", "change"],
|
@@ -9761,7 +9762,33 @@ var BkCheckboxGroup = defineComponent({
|
|
9761
9762
|
}, [(_a = this.$slots) == null ? void 0 : _a.default()]);
|
9762
9763
|
}
|
9763
9764
|
});
|
9764
|
-
const BkCheckbox = withInstallProps(Component$
|
9765
|
+
const BkCheckbox = withInstallProps(Component$v, { Group: BkCheckboxGroup });
|
9766
|
+
const propsCollapse = {
|
9767
|
+
list: PropTypes.arrayOf(PropTypes.any).def([]),
|
9768
|
+
idFiled: PropTypes.string.def("$index"),
|
9769
|
+
titleField: PropTypes.string.def("name"),
|
9770
|
+
contentField: PropTypes.string.def("content"),
|
9771
|
+
modelValue: PropTypes.oneOfType([
|
9772
|
+
PropTypes.arrayOf(PropTypes.number).def([]),
|
9773
|
+
PropTypes.arrayOf(PropTypes.string).def([]),
|
9774
|
+
PropTypes.number.def(-1)
|
9775
|
+
]),
|
9776
|
+
accordion: PropTypes.bool.def(false)
|
9777
|
+
};
|
9778
|
+
const CollapsePanelEventProps = {
|
9779
|
+
itemClick: {
|
9780
|
+
type: Function,
|
9781
|
+
default: () => ({})
|
9782
|
+
}
|
9783
|
+
};
|
9784
|
+
const propsCollapsePanel = __spreadValues({
|
9785
|
+
name: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).def(""),
|
9786
|
+
title: PropTypes.any,
|
9787
|
+
content: PropTypes.string,
|
9788
|
+
disabled: PropTypes.bool.def(false),
|
9789
|
+
renderDirective: PropTypes.commonType(["if", "show"], "render").def("show"),
|
9790
|
+
modelValue: PropTypes.bool.def(false)
|
9791
|
+
}, CollapsePanelEventProps);
|
9765
9792
|
const trimArr$1 = function(s2) {
|
9766
9793
|
return (s2 || "").split(" ").filter((item) => !!item.trim());
|
9767
9794
|
};
|
@@ -9841,23 +9868,111 @@ const collapseMotion$1 = (emit) => ({
|
|
9841
9868
|
emit("after-leave");
|
9842
9869
|
}
|
9843
9870
|
});
|
9844
|
-
|
9871
|
+
function _isSlot$8(s2) {
|
9872
|
+
return typeof s2 === "function" || Object.prototype.toString.call(s2) === "[object Object]" && !isVNode(s2);
|
9873
|
+
}
|
9874
|
+
var CollapsePanel = defineComponent({
|
9875
|
+
name: "CollapsePanel",
|
9876
|
+
props: propsCollapsePanel,
|
9877
|
+
emits: ["change", "update:modelValue", "after-leave", "before-enter"],
|
9878
|
+
setup(props, {
|
9879
|
+
emit,
|
9880
|
+
slots
|
9881
|
+
}) {
|
9882
|
+
const localActiveItems = inject("localActiveItems");
|
9883
|
+
const isActive = ref(props.modelValue);
|
9884
|
+
watch(() => props.modelValue, (newVal) => {
|
9885
|
+
isActive.value = newVal;
|
9886
|
+
});
|
9887
|
+
watch(() => localActiveItems, (newVal) => {
|
9888
|
+
if (newVal == null ? void 0 : newVal.length) {
|
9889
|
+
isActive.value = newVal.includes(props.name);
|
9890
|
+
}
|
9891
|
+
}, {
|
9892
|
+
immediate: true
|
9893
|
+
});
|
9894
|
+
function handleItemClick(props2) {
|
9895
|
+
const {
|
9896
|
+
disabled,
|
9897
|
+
name,
|
9898
|
+
itemClick
|
9899
|
+
} = props2;
|
9900
|
+
if (disabled)
|
9901
|
+
return;
|
9902
|
+
const data2 = {
|
9903
|
+
name
|
9904
|
+
};
|
9905
|
+
itemClick(data2);
|
9906
|
+
isActive.value = !isActive.value;
|
9907
|
+
emit("change", data2);
|
9908
|
+
emit("update:modelValue", isActive.value);
|
9909
|
+
}
|
9910
|
+
const transition = ref(collapseMotion$1(emit));
|
9911
|
+
const {
|
9912
|
+
content
|
9913
|
+
} = props;
|
9914
|
+
function getContent() {
|
9915
|
+
if (content) {
|
9916
|
+
return content;
|
9917
|
+
}
|
9918
|
+
if (typeof slots.content === "function") {
|
9919
|
+
return slots.content(h$1);
|
9920
|
+
}
|
9921
|
+
return slots.content;
|
9922
|
+
}
|
9923
|
+
function renderPanel() {
|
9924
|
+
if (props.renderDirective === "if" && !isActive.value) {
|
9925
|
+
return "";
|
9926
|
+
}
|
9927
|
+
return withDirectives(createVNode("div", {
|
9928
|
+
"class": `bk-collapse-content ${isActive.value && "active" || ""}`
|
9929
|
+
}, [getContent()]), [[vShow, isActive.value]]);
|
9930
|
+
}
|
9931
|
+
function renderHeader() {
|
9932
|
+
if (slots.header) {
|
9933
|
+
if (typeof slots.header === "function") {
|
9934
|
+
return slots.header(h$1);
|
9935
|
+
}
|
9936
|
+
return slots.header;
|
9937
|
+
}
|
9938
|
+
let title;
|
9939
|
+
if (slots.default) {
|
9940
|
+
if (typeof slots.default === "function") {
|
9941
|
+
title = slots.default(h$1);
|
9942
|
+
} else {
|
9943
|
+
title = slots.default;
|
9944
|
+
}
|
9945
|
+
} else {
|
9946
|
+
title = props.title;
|
9947
|
+
}
|
9948
|
+
return createVNode(Fragment, null, [createVNode("span", {
|
9949
|
+
"class": "bk-collapse-title"
|
9950
|
+
}, [title]), createVNode(angleRight, {
|
9951
|
+
"class": `bk-collapse-icon ${isActive.value && "rotate-icon" || ""}`
|
9952
|
+
}, null)]);
|
9953
|
+
}
|
9954
|
+
return () => {
|
9955
|
+
let _slot;
|
9956
|
+
return createVNode("div", {
|
9957
|
+
"class": `bk-collapse-item ${props.disabled ? "is-disabled" : ""} ${isActive.value ? "bk-collapse-item-active" : ""}`
|
9958
|
+
}, [createVNode("div", {
|
9959
|
+
"class": "bk-collapse-header",
|
9960
|
+
"onClick": () => handleItemClick(props)
|
9961
|
+
}, [renderHeader()]), createVNode(Transition, transition.value, _isSlot$8(_slot = renderPanel()) ? _slot : {
|
9962
|
+
default: () => [_slot]
|
9963
|
+
})]);
|
9964
|
+
};
|
9965
|
+
}
|
9966
|
+
});
|
9967
|
+
var Collapse = defineComponent({
|
9845
9968
|
name: "Collapse",
|
9846
|
-
props:
|
9847
|
-
list: PropTypes.arrayOf(PropTypes.any).def([]),
|
9848
|
-
idFiled: PropTypes.string.def("$index"),
|
9849
|
-
titleField: PropTypes.string.def("name"),
|
9850
|
-
contentField: PropTypes.string.def("content"),
|
9851
|
-
modelValue: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.number).def([]), PropTypes.arrayOf(PropTypes.string).def([]), PropTypes.number.def(-1)]),
|
9852
|
-
accordion: PropTypes.bool.def(false)
|
9853
|
-
},
|
9969
|
+
props: propsCollapse,
|
9854
9970
|
emits: ["item-click", "update:modelValue", "after-leave", "before-enter"],
|
9855
9971
|
setup(props, {
|
9856
9972
|
emit,
|
9857
9973
|
slots
|
9858
9974
|
}) {
|
9859
9975
|
const localActiveItems = ref([]);
|
9860
|
-
const transition = ref(collapseMotion$1(emit));
|
9861
9976
|
watch(() => [props.modelValue], () => {
|
9862
9977
|
const value = props.modelValue;
|
9863
9978
|
if (Array.isArray(value)) {
|
@@ -9870,66 +9985,74 @@ var Component$v = defineComponent({
|
|
9870
9985
|
}, {
|
9871
9986
|
immediate: true
|
9872
9987
|
});
|
9873
|
-
|
9874
|
-
if (typeof item === "string" || typeof item === "number" || typeof item === "boolean") {
|
9875
|
-
return {
|
9876
|
-
$index: index,
|
9877
|
-
name: item
|
9878
|
-
};
|
9879
|
-
}
|
9880
|
-
return __spreadValues({
|
9881
|
-
$index: index
|
9882
|
-
}, item);
|
9883
|
-
}));
|
9988
|
+
provide("localActiveItems", localActiveItems.value);
|
9884
9989
|
const handleItemClick = (item) => {
|
9885
|
-
|
9886
|
-
|
9990
|
+
const {
|
9991
|
+
name
|
9992
|
+
} = item;
|
9887
9993
|
if (props.accordion) {
|
9888
|
-
const activeItemIndex = localActiveItems.value.findIndex((local) => local ===
|
9994
|
+
const activeItemIndex = localActiveItems.value.findIndex((local) => local === name);
|
9889
9995
|
if (activeItemIndex >= 0) {
|
9890
9996
|
localActiveItems.value.splice(activeItemIndex, 1);
|
9891
9997
|
} else {
|
9892
|
-
localActiveItems.value = [
|
9998
|
+
localActiveItems.value = [name];
|
9893
9999
|
}
|
9894
10000
|
} else {
|
9895
|
-
const activeItemIndex = localActiveItems.value.findIndex((local) => local ===
|
10001
|
+
const activeItemIndex = localActiveItems.value.findIndex((local) => local === name);
|
9896
10002
|
if (activeItemIndex >= 0) {
|
9897
10003
|
localActiveItems.value.splice(activeItemIndex, 1);
|
9898
10004
|
} else {
|
9899
|
-
localActiveItems.value.push(
|
10005
|
+
localActiveItems.value.push(name);
|
9900
10006
|
}
|
9901
10007
|
}
|
9902
10008
|
emit("item-click", item);
|
9903
10009
|
emit("update:modelValue", localActiveItems.value);
|
9904
10010
|
};
|
9905
|
-
const
|
9906
|
-
|
9907
|
-
|
9908
|
-
|
9909
|
-
|
9910
|
-
|
9911
|
-
|
9912
|
-
|
9913
|
-
|
9914
|
-
|
9915
|
-
|
9916
|
-
|
9917
|
-
|
9918
|
-
|
9919
|
-
|
9920
|
-
|
9921
|
-
|
9922
|
-
|
10011
|
+
const className = "bk-collapse-wrapper";
|
10012
|
+
if (!Array.isArray(props.list) || !props.list.length) {
|
10013
|
+
return () => {
|
10014
|
+
var _a;
|
10015
|
+
return createVNode("div", {
|
10016
|
+
"class": className
|
10017
|
+
}, [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
|
10018
|
+
};
|
10019
|
+
}
|
10020
|
+
const collapseData = computed(() => (props.list || []).map((item, index) => {
|
10021
|
+
if (typeof item === "string" || typeof item === "number" || typeof item === "boolean") {
|
10022
|
+
return {
|
10023
|
+
$index: index,
|
10024
|
+
name: item
|
10025
|
+
};
|
10026
|
+
}
|
10027
|
+
return __spreadValues({
|
10028
|
+
$index: index
|
10029
|
+
}, item);
|
10030
|
+
}));
|
10031
|
+
const renderItems = () => collapseData.value.map((item, index) => {
|
10032
|
+
const name = item[props.idFiled] || index;
|
10033
|
+
let title = item[props.titleField];
|
10034
|
+
if (slots.title) {
|
10035
|
+
if (typeof slots.title === "function") {
|
10036
|
+
title = slots.title(item);
|
10037
|
+
} else {
|
10038
|
+
title = slots.title;
|
9923
10039
|
}
|
9924
|
-
}
|
10040
|
+
}
|
10041
|
+
return createVNode(CollapsePanel, {
|
10042
|
+
"key": index,
|
10043
|
+
"item-click": handleItemClick,
|
10044
|
+
"disabled": item.disabled,
|
10045
|
+
"name": name,
|
10046
|
+
"title": title,
|
10047
|
+
"content": item[props.contentField]
|
10048
|
+
}, null);
|
9925
10049
|
});
|
9926
|
-
const className = "bk-collapse-wrapper";
|
9927
10050
|
return () => createVNode("div", {
|
9928
10051
|
"class": className
|
9929
10052
|
}, [renderItems()]);
|
9930
10053
|
}
|
9931
10054
|
});
|
9932
|
-
const BkCollapse =
|
10055
|
+
const BkCollapse = withInstallProps(Collapse, { CollapsePanel });
|
9933
10056
|
const propsMixin$1 = {
|
9934
10057
|
isShow: PropTypes.bool.def(false),
|
9935
10058
|
width: PropTypes.oneOfType([String, Number]).def("50%"),
|
@@ -12404,9 +12527,12 @@ var usePlatform = () => {
|
|
12404
12527
|
var useFloating = (props, ctx, refReference, refContent, refArrow, refRoot) => {
|
12405
12528
|
const localIsShow = ref(false);
|
12406
12529
|
const isElementFullScreen = () => {
|
12407
|
-
var _a, _b;
|
12530
|
+
var _a, _b, _c;
|
12408
12531
|
const elReference = resolveTargetElement((_a = refReference.value) == null ? void 0 : _a.$el);
|
12409
|
-
|
12532
|
+
if ((_b = document.fullscreenElement) == null ? void 0 : _b.shadowRoot) {
|
12533
|
+
return document.fullscreenElement.shadowRoot.contains(elReference);
|
12534
|
+
}
|
12535
|
+
return (_c = document.fullscreenElement) == null ? void 0 : _c.contains(elReference);
|
12410
12536
|
};
|
12411
12537
|
const themeList = ["dark", "light"];
|
12412
12538
|
const compTheme = computed(() => {
|