bkui-vue 0.0.1-beta.140 → 0.0.1-beta.143
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 +31 -31
- package/dist/index.esm.js +235 -89
- package/dist/index.umd.js +27 -27
- package/dist/style.css +1 -1
- package/dist/style.variable.css +1 -1
- package/lib/cascader/cascader-panel.d.ts +1 -0
- package/lib/cascader/cascader.css +8 -1
- package/lib/cascader/cascader.d.ts +8 -1
- package/lib/cascader/cascader.less +9 -1
- package/lib/cascader/cascader.variable.css +8 -1
- package/lib/cascader/index.d.ts +25 -3
- package/lib/cascader/index.js +1 -1
- package/lib/cascader/interface.d.ts +4 -1
- package/lib/cascader/node.d.ts +2 -1
- package/lib/cascader/store.d.ts +3 -0
- 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/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/tab/index.d.ts +1 -1
- package/lib/tab/tab-panel.d.ts +1 -1
- package/package.json +1 -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 = "";
|
@@ -7960,14 +7960,6 @@ function debounce(delay = 300, fn2, immediate = false) {
|
|
7960
7960
|
};
|
7961
7961
|
return debounced;
|
7962
7962
|
}
|
7963
|
-
function filterProperty(data2, filter) {
|
7964
|
-
return JSON.parse(JSON.stringify(data2, (key2, value) => {
|
7965
|
-
if (filter.includes(key2)) {
|
7966
|
-
return void 0;
|
7967
|
-
}
|
7968
|
-
return value;
|
7969
|
-
}));
|
7970
|
-
}
|
7971
7963
|
function arrayEqual(arr1 = [], arr2 = []) {
|
7972
7964
|
if (arr1.length !== arr2.length) {
|
7973
7965
|
return false;
|
@@ -8488,7 +8480,7 @@ const warn = (props, context) => {
|
|
8488
8480
|
warn.displayName = "warn";
|
8489
8481
|
warn.inheritAttrs = false;
|
8490
8482
|
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"}}]}');
|
8491
|
-
var Component$
|
8483
|
+
var Component$F = defineComponent({
|
8492
8484
|
name: "Alert",
|
8493
8485
|
props: {
|
8494
8486
|
theme: PropTypes.theme(["info", "success", "warning", "error"]).def("info"),
|
@@ -8545,8 +8537,8 @@ var Component$G = defineComponent({
|
|
8545
8537
|
}, [this.closeText ? this.closeText : createVNode(closeLine, null, null)])])]);
|
8546
8538
|
}
|
8547
8539
|
});
|
8548
|
-
const BkAlert = withInstall(Component$
|
8549
|
-
var Component$
|
8540
|
+
const BkAlert = withInstall(Component$F);
|
8541
|
+
var Component$E = defineComponent({
|
8550
8542
|
name: "AnimateNumber",
|
8551
8543
|
props: {
|
8552
8544
|
value: PropTypes.number.def(0),
|
@@ -8594,7 +8586,7 @@ var Component$F = defineComponent({
|
|
8594
8586
|
return () => createVNode("span", null, [formatValue.value]);
|
8595
8587
|
}
|
8596
8588
|
});
|
8597
|
-
const BkAnimateNumber = withInstall(Component$
|
8589
|
+
const BkAnimateNumber = withInstall(Component$E);
|
8598
8590
|
const on$1 = (() => {
|
8599
8591
|
if (document.addEventListener) {
|
8600
8592
|
return (element, event, handler) => {
|
@@ -8623,7 +8615,7 @@ const off$1 = (() => {
|
|
8623
8615
|
}
|
8624
8616
|
};
|
8625
8617
|
})();
|
8626
|
-
var Component$
|
8618
|
+
var Component$D = defineComponent({
|
8627
8619
|
name: "Affix",
|
8628
8620
|
props: {
|
8629
8621
|
offsetTop: PropTypes.number.def(0),
|
@@ -8748,8 +8740,8 @@ var Component$E = defineComponent({
|
|
8748
8740
|
};
|
8749
8741
|
}
|
8750
8742
|
});
|
8751
|
-
const BkAffix = withInstall(Component$
|
8752
|
-
var Component$
|
8743
|
+
const BkAffix = withInstall(Component$D);
|
8744
|
+
var Component$C = defineComponent({
|
8753
8745
|
name: "Backtop",
|
8754
8746
|
props: {
|
8755
8747
|
visibilityHeight: PropTypes.number.def(200),
|
@@ -8816,8 +8808,8 @@ var Component$D = defineComponent({
|
|
8816
8808
|
});
|
8817
8809
|
}
|
8818
8810
|
});
|
8819
|
-
const BkBacktop = withInstall(Component$
|
8820
|
-
var Component$
|
8811
|
+
const BkBacktop = withInstall(Component$C);
|
8812
|
+
var Component$B = defineComponent({
|
8821
8813
|
name: "Badge",
|
8822
8814
|
props: {
|
8823
8815
|
theme: PropTypes.string.def("primary"),
|
@@ -8893,8 +8885,8 @@ var Component$C = defineComponent({
|
|
8893
8885
|
}, [(_f = (_e = (_d = this.$slots).icon) == null ? void 0 : _e.call(_d)) != null ? _f : number]) : ""]);
|
8894
8886
|
}
|
8895
8887
|
});
|
8896
|
-
const BkBadge = withInstall(Component$
|
8897
|
-
var Component$
|
8888
|
+
const BkBadge = withInstall(Component$B);
|
8889
|
+
var Component$A = defineComponent({
|
8898
8890
|
name: "Breadcrumb",
|
8899
8891
|
props: {
|
8900
8892
|
extCls: PropTypes.string,
|
@@ -8993,7 +8985,7 @@ var BreadcrumbItem = defineComponent({
|
|
8993
8985
|
};
|
8994
8986
|
}
|
8995
8987
|
});
|
8996
|
-
const BkBreadcrumb = withInstallProps(Component$
|
8988
|
+
const BkBreadcrumb = withInstallProps(Component$A, { Item: BreadcrumbItem });
|
8997
8989
|
let BkLoadingMode;
|
8998
8990
|
(function(BkLoadingMode2) {
|
8999
8991
|
BkLoadingMode2["Default"] = "default";
|
@@ -9024,7 +9016,7 @@ const loadingTypes = {
|
|
9024
9016
|
color: PropTypes.string.def("white"),
|
9025
9017
|
zIndex: PropTypes.number.def(1)
|
9026
9018
|
};
|
9027
|
-
var Component$
|
9019
|
+
var Component$z = defineComponent({
|
9028
9020
|
name: "Loading",
|
9029
9021
|
props: loadingTypes,
|
9030
9022
|
setup(props, ctx) {
|
@@ -9080,7 +9072,7 @@ var Component$A = defineComponent({
|
|
9080
9072
|
};
|
9081
9073
|
}
|
9082
9074
|
});
|
9083
|
-
const BkLoading = withInstallProps(Component$
|
9075
|
+
const BkLoading = withInstallProps(Component$z, { setDefaultIndicator, BkLoadingMode, BkLoadingSize }, true);
|
9084
9076
|
const btnSizes = ["", "small", "large"];
|
9085
9077
|
const buttonProps = {
|
9086
9078
|
theme: PropTypes.theme().def(""),
|
@@ -9100,7 +9092,7 @@ const buttonProps = {
|
|
9100
9092
|
default: "button"
|
9101
9093
|
}
|
9102
9094
|
};
|
9103
|
-
var Component$
|
9095
|
+
var Component$y = defineComponent({
|
9104
9096
|
name: "Button",
|
9105
9097
|
props: buttonProps,
|
9106
9098
|
emits: ["click", "mouseover"],
|
@@ -9191,7 +9183,7 @@ var ButtonGroup = defineComponent({
|
|
9191
9183
|
};
|
9192
9184
|
}
|
9193
9185
|
});
|
9194
|
-
const BkButton = withInstallProps(Component$
|
9186
|
+
const BkButton = withInstallProps(Component$y, { ButtonGroup });
|
9195
9187
|
const inputType = {
|
9196
9188
|
type: PropTypes.string.def("text"),
|
9197
9189
|
clearable: PropTypes.bool,
|
@@ -9254,7 +9246,7 @@ const inputEmitEventsType = {
|
|
9254
9246
|
[EVENTS$2.COMPOSITIONUPDATE]: CompositionEventFunction,
|
9255
9247
|
[EVENTS$2.COMPOSITIONEND]: CompositionEventFunction
|
9256
9248
|
};
|
9257
|
-
var Component$
|
9249
|
+
var Component$x = defineComponent({
|
9258
9250
|
name: "Input",
|
9259
9251
|
inheritAttrs: false,
|
9260
9252
|
props: inputType,
|
@@ -9470,8 +9462,8 @@ var Component$y = defineComponent({
|
|
9470
9462
|
};
|
9471
9463
|
}
|
9472
9464
|
});
|
9473
|
-
const BkInput = withInstall(Component$
|
9474
|
-
var Component$
|
9465
|
+
const BkInput = withInstall(Component$x);
|
9466
|
+
var Component$w = defineComponent({
|
9475
9467
|
name: "Card",
|
9476
9468
|
props: {
|
9477
9469
|
title: PropTypes.string,
|
@@ -9564,7 +9556,7 @@ var Component$x = defineComponent({
|
|
9564
9556
|
}, [(_l = (_k = (_j = this.$slots).footer) == null ? void 0 : _k.call(_j)) != null ? _l : "Footer"]) : ""]) : ""]);
|
9565
9557
|
}
|
9566
9558
|
});
|
9567
|
-
const BkCard = withInstall(Component$
|
9559
|
+
const BkCard = withInstall(Component$w);
|
9568
9560
|
const checkboxGroupKey = Symbol("CheckboxGroup");
|
9569
9561
|
function useFocus$1() {
|
9570
9562
|
const isFocus = ref(false);
|
@@ -9665,7 +9657,7 @@ const checkboxProps = {
|
|
9665
9657
|
beforeChange: PropTypes.func,
|
9666
9658
|
size: PropTypes.size().def("large")
|
9667
9659
|
};
|
9668
|
-
var Component$
|
9660
|
+
var Component$v = defineComponent({
|
9669
9661
|
name: "Checkbox",
|
9670
9662
|
props: checkboxProps,
|
9671
9663
|
emits: ["update:modelValue", "change"],
|
@@ -9769,7 +9761,33 @@ var BkCheckboxGroup = defineComponent({
|
|
9769
9761
|
}, [(_a = this.$slots) == null ? void 0 : _a.default()]);
|
9770
9762
|
}
|
9771
9763
|
});
|
9772
|
-
const BkCheckbox = withInstallProps(Component$
|
9764
|
+
const BkCheckbox = withInstallProps(Component$v, { Group: BkCheckboxGroup });
|
9765
|
+
const propsCollapse = {
|
9766
|
+
list: PropTypes.arrayOf(PropTypes.any).def([]),
|
9767
|
+
idFiled: PropTypes.string.def("$index"),
|
9768
|
+
titleField: PropTypes.string.def("name"),
|
9769
|
+
contentField: PropTypes.string.def("content"),
|
9770
|
+
modelValue: PropTypes.oneOfType([
|
9771
|
+
PropTypes.arrayOf(PropTypes.number).def([]),
|
9772
|
+
PropTypes.arrayOf(PropTypes.string).def([]),
|
9773
|
+
PropTypes.number.def(-1)
|
9774
|
+
]),
|
9775
|
+
accordion: PropTypes.bool.def(false)
|
9776
|
+
};
|
9777
|
+
const CollapsePanelEventProps = {
|
9778
|
+
itemClick: {
|
9779
|
+
type: Function,
|
9780
|
+
default: () => ({})
|
9781
|
+
}
|
9782
|
+
};
|
9783
|
+
const propsCollapsePanel = __spreadValues({
|
9784
|
+
name: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).def(""),
|
9785
|
+
title: PropTypes.any,
|
9786
|
+
content: PropTypes.string,
|
9787
|
+
disabled: PropTypes.bool.def(false),
|
9788
|
+
renderDirective: PropTypes.commonType(["if", "show"], "render").def("show"),
|
9789
|
+
modelValue: PropTypes.bool.def(false)
|
9790
|
+
}, CollapsePanelEventProps);
|
9773
9791
|
const trimArr$1 = function(s2) {
|
9774
9792
|
return (s2 || "").split(" ").filter((item) => !!item.trim());
|
9775
9793
|
};
|
@@ -9849,23 +9867,111 @@ const collapseMotion$1 = (emit) => ({
|
|
9849
9867
|
emit("after-leave");
|
9850
9868
|
}
|
9851
9869
|
});
|
9852
|
-
|
9870
|
+
function _isSlot$8(s2) {
|
9871
|
+
return typeof s2 === "function" || Object.prototype.toString.call(s2) === "[object Object]" && !isVNode(s2);
|
9872
|
+
}
|
9873
|
+
var CollapsePanel = defineComponent({
|
9874
|
+
name: "CollapsePanel",
|
9875
|
+
props: propsCollapsePanel,
|
9876
|
+
emits: ["change", "update:modelValue", "after-leave", "before-enter"],
|
9877
|
+
setup(props, {
|
9878
|
+
emit,
|
9879
|
+
slots
|
9880
|
+
}) {
|
9881
|
+
const localActiveItems = inject("localActiveItems");
|
9882
|
+
const isActive = ref(props.modelValue);
|
9883
|
+
watch(() => props.modelValue, (newVal) => {
|
9884
|
+
isActive.value = newVal;
|
9885
|
+
});
|
9886
|
+
watch(() => localActiveItems, (newVal) => {
|
9887
|
+
if (newVal == null ? void 0 : newVal.length) {
|
9888
|
+
isActive.value = newVal.includes(props.name);
|
9889
|
+
}
|
9890
|
+
}, {
|
9891
|
+
immediate: true
|
9892
|
+
});
|
9893
|
+
function handleItemClick(props2) {
|
9894
|
+
const {
|
9895
|
+
disabled,
|
9896
|
+
name,
|
9897
|
+
itemClick
|
9898
|
+
} = props2;
|
9899
|
+
if (disabled)
|
9900
|
+
return;
|
9901
|
+
const data2 = {
|
9902
|
+
name
|
9903
|
+
};
|
9904
|
+
itemClick(data2);
|
9905
|
+
isActive.value = !isActive.value;
|
9906
|
+
emit("change", data2);
|
9907
|
+
emit("update:modelValue", isActive.value);
|
9908
|
+
}
|
9909
|
+
const transition = ref(collapseMotion$1(emit));
|
9910
|
+
const {
|
9911
|
+
content
|
9912
|
+
} = props;
|
9913
|
+
function getContent() {
|
9914
|
+
if (content) {
|
9915
|
+
return content;
|
9916
|
+
}
|
9917
|
+
if (typeof slots.content === "function") {
|
9918
|
+
return slots.content(h$1);
|
9919
|
+
}
|
9920
|
+
return slots.content;
|
9921
|
+
}
|
9922
|
+
function renderPanel() {
|
9923
|
+
if (props.renderDirective === "if" && !isActive.value) {
|
9924
|
+
return "";
|
9925
|
+
}
|
9926
|
+
return withDirectives(createVNode("div", {
|
9927
|
+
"class": `bk-collapse-content ${isActive.value && "active" || ""}`
|
9928
|
+
}, [getContent()]), [[vShow, isActive.value]]);
|
9929
|
+
}
|
9930
|
+
function renderHeader() {
|
9931
|
+
if (slots.header) {
|
9932
|
+
if (typeof slots.header === "function") {
|
9933
|
+
return slots.header(h$1);
|
9934
|
+
}
|
9935
|
+
return slots.header;
|
9936
|
+
}
|
9937
|
+
let title;
|
9938
|
+
if (slots.default) {
|
9939
|
+
if (typeof slots.default === "function") {
|
9940
|
+
title = slots.default(h$1);
|
9941
|
+
} else {
|
9942
|
+
title = slots.default;
|
9943
|
+
}
|
9944
|
+
} else {
|
9945
|
+
title = props.title;
|
9946
|
+
}
|
9947
|
+
return createVNode(Fragment, null, [createVNode("span", {
|
9948
|
+
"class": "bk-collapse-title"
|
9949
|
+
}, [title]), createVNode(angleRight, {
|
9950
|
+
"class": `bk-collapse-icon ${isActive.value && "rotate-icon" || ""}`
|
9951
|
+
}, null)]);
|
9952
|
+
}
|
9953
|
+
return () => {
|
9954
|
+
let _slot;
|
9955
|
+
return createVNode("div", {
|
9956
|
+
"class": `bk-collapse-item ${props.disabled ? "is-disabled" : ""} ${isActive.value ? "bk-collapse-item-active" : ""}`
|
9957
|
+
}, [createVNode("div", {
|
9958
|
+
"class": "bk-collapse-header",
|
9959
|
+
"onClick": () => handleItemClick(props)
|
9960
|
+
}, [renderHeader()]), createVNode(Transition, transition.value, _isSlot$8(_slot = renderPanel()) ? _slot : {
|
9961
|
+
default: () => [_slot]
|
9962
|
+
})]);
|
9963
|
+
};
|
9964
|
+
}
|
9965
|
+
});
|
9966
|
+
var Collapse = defineComponent({
|
9853
9967
|
name: "Collapse",
|
9854
|
-
props:
|
9855
|
-
list: PropTypes.arrayOf(PropTypes.any).def([]),
|
9856
|
-
idFiled: PropTypes.string.def("$index"),
|
9857
|
-
titleField: PropTypes.string.def("name"),
|
9858
|
-
contentField: PropTypes.string.def("content"),
|
9859
|
-
modelValue: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.number).def([]), PropTypes.arrayOf(PropTypes.string).def([]), PropTypes.number.def(-1)]),
|
9860
|
-
accordion: PropTypes.bool.def(false)
|
9861
|
-
},
|
9968
|
+
props: propsCollapse,
|
9862
9969
|
emits: ["item-click", "update:modelValue", "after-leave", "before-enter"],
|
9863
9970
|
setup(props, {
|
9864
9971
|
emit,
|
9865
9972
|
slots
|
9866
9973
|
}) {
|
9867
9974
|
const localActiveItems = ref([]);
|
9868
|
-
const transition = ref(collapseMotion$1(emit));
|
9869
9975
|
watch(() => [props.modelValue], () => {
|
9870
9976
|
const value = props.modelValue;
|
9871
9977
|
if (Array.isArray(value)) {
|
@@ -9878,66 +9984,74 @@ var Component$v = defineComponent({
|
|
9878
9984
|
}, {
|
9879
9985
|
immediate: true
|
9880
9986
|
});
|
9881
|
-
|
9882
|
-
if (typeof item === "string" || typeof item === "number" || typeof item === "boolean") {
|
9883
|
-
return {
|
9884
|
-
$index: index,
|
9885
|
-
name: item
|
9886
|
-
};
|
9887
|
-
}
|
9888
|
-
return __spreadValues({
|
9889
|
-
$index: index
|
9890
|
-
}, item);
|
9891
|
-
}));
|
9987
|
+
provide("localActiveItems", localActiveItems.value);
|
9892
9988
|
const handleItemClick = (item) => {
|
9893
|
-
|
9894
|
-
|
9989
|
+
const {
|
9990
|
+
name
|
9991
|
+
} = item;
|
9895
9992
|
if (props.accordion) {
|
9896
|
-
const activeItemIndex = localActiveItems.value.findIndex((local) => local ===
|
9993
|
+
const activeItemIndex = localActiveItems.value.findIndex((local) => local === name);
|
9897
9994
|
if (activeItemIndex >= 0) {
|
9898
9995
|
localActiveItems.value.splice(activeItemIndex, 1);
|
9899
9996
|
} else {
|
9900
|
-
localActiveItems.value = [
|
9997
|
+
localActiveItems.value = [name];
|
9901
9998
|
}
|
9902
9999
|
} else {
|
9903
|
-
const activeItemIndex = localActiveItems.value.findIndex((local) => local ===
|
10000
|
+
const activeItemIndex = localActiveItems.value.findIndex((local) => local === name);
|
9904
10001
|
if (activeItemIndex >= 0) {
|
9905
10002
|
localActiveItems.value.splice(activeItemIndex, 1);
|
9906
10003
|
} else {
|
9907
|
-
localActiveItems.value.push(
|
10004
|
+
localActiveItems.value.push(name);
|
9908
10005
|
}
|
9909
10006
|
}
|
9910
10007
|
emit("item-click", item);
|
9911
10008
|
emit("update:modelValue", localActiveItems.value);
|
9912
10009
|
};
|
9913
|
-
const
|
9914
|
-
|
9915
|
-
|
9916
|
-
|
9917
|
-
|
9918
|
-
|
9919
|
-
|
9920
|
-
|
9921
|
-
|
9922
|
-
|
9923
|
-
|
9924
|
-
|
9925
|
-
|
9926
|
-
|
9927
|
-
|
9928
|
-
|
9929
|
-
|
9930
|
-
|
10010
|
+
const className = "bk-collapse-wrapper";
|
10011
|
+
if (!Array.isArray(props.list) || !props.list.length) {
|
10012
|
+
return () => {
|
10013
|
+
var _a;
|
10014
|
+
return createVNode("div", {
|
10015
|
+
"class": className
|
10016
|
+
}, [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
|
10017
|
+
};
|
10018
|
+
}
|
10019
|
+
const collapseData = computed(() => (props.list || []).map((item, index) => {
|
10020
|
+
if (typeof item === "string" || typeof item === "number" || typeof item === "boolean") {
|
10021
|
+
return {
|
10022
|
+
$index: index,
|
10023
|
+
name: item
|
10024
|
+
};
|
10025
|
+
}
|
10026
|
+
return __spreadValues({
|
10027
|
+
$index: index
|
10028
|
+
}, item);
|
10029
|
+
}));
|
10030
|
+
const renderItems = () => collapseData.value.map((item, index) => {
|
10031
|
+
const name = item[props.idFiled] || index;
|
10032
|
+
let title = item[props.titleField];
|
10033
|
+
if (slots.title) {
|
10034
|
+
if (typeof slots.title === "function") {
|
10035
|
+
title = slots.title(item);
|
10036
|
+
} else {
|
10037
|
+
title = slots.title;
|
9931
10038
|
}
|
9932
|
-
}
|
10039
|
+
}
|
10040
|
+
return createVNode(CollapsePanel, {
|
10041
|
+
"key": index,
|
10042
|
+
"item-click": handleItemClick,
|
10043
|
+
"disabled": item.disabled,
|
10044
|
+
"name": name,
|
10045
|
+
"title": title,
|
10046
|
+
"content": item[props.contentField]
|
10047
|
+
}, null);
|
9933
10048
|
});
|
9934
|
-
const className = "bk-collapse-wrapper";
|
9935
10049
|
return () => createVNode("div", {
|
9936
10050
|
"class": className
|
9937
10051
|
}, [renderItems()]);
|
9938
10052
|
}
|
9939
10053
|
});
|
9940
|
-
const BkCollapse =
|
10054
|
+
const BkCollapse = withInstallProps(Collapse, { CollapsePanel });
|
9941
10055
|
const propsMixin$1 = {
|
9942
10056
|
isShow: PropTypes.bool.def(false),
|
9943
10057
|
width: PropTypes.oneOfType([String, Number]).def("50%"),
|
@@ -12412,9 +12526,12 @@ var usePlatform = () => {
|
|
12412
12526
|
var useFloating = (props, ctx, refReference, refContent, refArrow, refRoot) => {
|
12413
12527
|
const localIsShow = ref(false);
|
12414
12528
|
const isElementFullScreen = () => {
|
12415
|
-
var _a, _b;
|
12529
|
+
var _a, _b, _c;
|
12416
12530
|
const elReference = resolveTargetElement((_a = refReference.value) == null ? void 0 : _a.$el);
|
12417
|
-
|
12531
|
+
if ((_b = document.fullscreenElement) == null ? void 0 : _b.shadowRoot) {
|
12532
|
+
return document.fullscreenElement.shadowRoot.contains(elReference);
|
12533
|
+
}
|
12534
|
+
return (_c = document.fullscreenElement) == null ? void 0 : _c.contains(elReference);
|
12418
12535
|
};
|
12419
12536
|
const themeList = ["dark", "light"];
|
12420
12537
|
const compTheme = computed(() => {
|
@@ -25909,6 +26026,18 @@ var CascaderPanel = defineComponent({
|
|
25909
26026
|
if ((_a = node.children) == null ? void 0 : _a.length) {
|
25910
26027
|
menus.list.push(node.children);
|
25911
26028
|
activePath.value.push(node);
|
26029
|
+
return;
|
26030
|
+
}
|
26031
|
+
if (store.config.isRemote && !node.isLeaf) {
|
26032
|
+
node.loading = true;
|
26033
|
+
const updateNodes = (nodeData) => {
|
26034
|
+
store.appendNodes(nodeData, node || null);
|
26035
|
+
menus.list.push(node.children);
|
26036
|
+
activePath.value.push(node);
|
26037
|
+
node.loading = false;
|
26038
|
+
};
|
26039
|
+
store.config.remoteMethod(node, updateNodes);
|
26040
|
+
console.log("remote fuck here");
|
25912
26041
|
}
|
25913
26042
|
};
|
25914
26043
|
const nodeEvent = (node) => {
|
@@ -25948,6 +26077,11 @@ var CascaderPanel = defineComponent({
|
|
25948
26077
|
node.setNodeCheck(value);
|
25949
26078
|
nodeCheckHandler(node);
|
25950
26079
|
};
|
26080
|
+
const iconRender = (node) => node.loading ? createVNode(spinner, {
|
26081
|
+
"class": "icon-spinner"
|
26082
|
+
}, null) : createVNode(angleRight, {
|
26083
|
+
"class": "icon-angle-right"
|
26084
|
+
}, null);
|
25951
26085
|
return {
|
25952
26086
|
menus,
|
25953
26087
|
activePath,
|
@@ -25957,7 +26091,8 @@ var CascaderPanel = defineComponent({
|
|
25957
26091
|
isCheckedNode,
|
25958
26092
|
checkValue,
|
25959
26093
|
nodeClear,
|
25960
|
-
checkNode
|
26094
|
+
checkNode,
|
26095
|
+
iconRender
|
25961
26096
|
};
|
25962
26097
|
},
|
25963
26098
|
render() {
|
@@ -25980,9 +26115,7 @@ var CascaderPanel = defineComponent({
|
|
25980
26115
|
"onChange": (val) => this.checkNode(node, val)
|
25981
26116
|
}, null), createVNode("span", {
|
25982
26117
|
"class": "bk-cascader-node-name"
|
25983
|
-
}, [node.name]), !node.isLeaf ?
|
25984
|
-
"class": "icon-angle-right"
|
25985
|
-
}, null) : ""]))]))]);
|
26118
|
+
}, [node.name]), !node.isLeaf ? this.iconRender(node) : ""]))]))]);
|
25986
26119
|
}
|
25987
26120
|
});
|
25988
26121
|
class Node$1 {
|
@@ -25990,25 +26123,30 @@ class Node$1 {
|
|
25990
26123
|
this.data = node;
|
25991
26124
|
this.config = config;
|
25992
26125
|
this.parent = parent || null;
|
26126
|
+
this.leaf = node.leaf;
|
25993
26127
|
this.level = !this.parent ? 1 : this.parent.level + 1;
|
25994
26128
|
this.initState();
|
25995
26129
|
}
|
25996
26130
|
initState() {
|
25997
|
-
var _a;
|
25998
26131
|
const { idKey, nameKey, childrenKey } = this.config;
|
25999
26132
|
this.id = this.data[idKey];
|
26000
26133
|
this.name = this.data[nameKey];
|
26001
26134
|
this.loading = false;
|
26135
|
+
this.loaded = false;
|
26002
26136
|
this.checked = false;
|
26003
26137
|
const childrenData = this.data[childrenKey];
|
26004
26138
|
this.children = (childrenData || []).map((child) => new Node$1(child, this.config, this));
|
26005
|
-
this.hasChildren = ((_a = this.children) == null ? void 0 : _a.length) !== 0;
|
26006
26139
|
this.pathNodes = this.calculateNodesPath();
|
26007
26140
|
this.path = this.pathNodes.map((node) => node.id);
|
26008
26141
|
this.pathNames = this.pathNodes.map((node) => node.name);
|
26009
26142
|
}
|
26010
26143
|
get isLeaf() {
|
26011
|
-
|
26144
|
+
var _a;
|
26145
|
+
if (this.config.isRemote) {
|
26146
|
+
const isLeaf = this.leaf || (this.loaded ? !this.children.length : false);
|
26147
|
+
return isLeaf;
|
26148
|
+
}
|
26149
|
+
return !(Array.isArray(this.children) && ((_a = this.children) == null ? void 0 : _a.length) !== 0);
|
26012
26150
|
}
|
26013
26151
|
get isDisabled() {
|
26014
26152
|
return this.data.disabled;
|
@@ -26039,8 +26177,8 @@ class Store {
|
|
26039
26177
|
constructor(props) {
|
26040
26178
|
const { list } = props;
|
26041
26179
|
this.data = list;
|
26042
|
-
this.config = filterProperty(props, ["list"]);
|
26043
26180
|
this.nodes = this.data.map((node) => new Node$1(node, this.config));
|
26181
|
+
this.config = props;
|
26044
26182
|
}
|
26045
26183
|
getNodes() {
|
26046
26184
|
return this.nodes;
|
@@ -26056,6 +26194,14 @@ class Store {
|
|
26056
26194
|
const nodes = this.getFlattedNodes().filter((node) => arrayEqual(node.path, value));
|
26057
26195
|
return (_a = nodes[0]) != null ? _a : null;
|
26058
26196
|
}
|
26197
|
+
appendNode(nodeData, parentNode) {
|
26198
|
+
const node = new Node$1(nodeData, this.config, parentNode);
|
26199
|
+
const children = parentNode ? parentNode.children : this.nodes;
|
26200
|
+
children.push(node);
|
26201
|
+
}
|
26202
|
+
appendNodes(nodeDataList, parentNode) {
|
26203
|
+
nodeDataList.forEach((node) => this.appendNode(node, parentNode));
|
26204
|
+
}
|
26059
26205
|
}
|
26060
26206
|
var Component$5 = defineComponent({
|
26061
26207
|
name: "Cascader",
|