bkui-vue 0.0.1-beta.142 → 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.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, isVNode, Fragment, toRefs, onUnmounted, Teleport, resolveDirective, customRef, onBeforeMount, toRef, vModelText, watchEffect, onUpdated, render as render$1, toRaw, withModifiers, TransitionGroup, shallowRef } from "vue";
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 = "";
@@ -8480,7 +8480,7 @@ const warn = (props, context) => {
8480
8480
  warn.displayName = "warn";
8481
8481
  warn.inheritAttrs = false;
8482
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"}}]}');
8483
- var Component$G = defineComponent({
8483
+ var Component$F = defineComponent({
8484
8484
  name: "Alert",
8485
8485
  props: {
8486
8486
  theme: PropTypes.theme(["info", "success", "warning", "error"]).def("info"),
@@ -8537,8 +8537,8 @@ var Component$G = defineComponent({
8537
8537
  }, [this.closeText ? this.closeText : createVNode(closeLine, null, null)])])]);
8538
8538
  }
8539
8539
  });
8540
- const BkAlert = withInstall(Component$G);
8541
- var Component$F = defineComponent({
8540
+ const BkAlert = withInstall(Component$F);
8541
+ var Component$E = defineComponent({
8542
8542
  name: "AnimateNumber",
8543
8543
  props: {
8544
8544
  value: PropTypes.number.def(0),
@@ -8586,7 +8586,7 @@ var Component$F = defineComponent({
8586
8586
  return () => createVNode("span", null, [formatValue.value]);
8587
8587
  }
8588
8588
  });
8589
- const BkAnimateNumber = withInstall(Component$F);
8589
+ const BkAnimateNumber = withInstall(Component$E);
8590
8590
  const on$1 = (() => {
8591
8591
  if (document.addEventListener) {
8592
8592
  return (element, event, handler) => {
@@ -8615,7 +8615,7 @@ const off$1 = (() => {
8615
8615
  }
8616
8616
  };
8617
8617
  })();
8618
- var Component$E = defineComponent({
8618
+ var Component$D = defineComponent({
8619
8619
  name: "Affix",
8620
8620
  props: {
8621
8621
  offsetTop: PropTypes.number.def(0),
@@ -8740,8 +8740,8 @@ var Component$E = defineComponent({
8740
8740
  };
8741
8741
  }
8742
8742
  });
8743
- const BkAffix = withInstall(Component$E);
8744
- var Component$D = defineComponent({
8743
+ const BkAffix = withInstall(Component$D);
8744
+ var Component$C = defineComponent({
8745
8745
  name: "Backtop",
8746
8746
  props: {
8747
8747
  visibilityHeight: PropTypes.number.def(200),
@@ -8808,8 +8808,8 @@ var Component$D = defineComponent({
8808
8808
  });
8809
8809
  }
8810
8810
  });
8811
- const BkBacktop = withInstall(Component$D);
8812
- var Component$C = defineComponent({
8811
+ const BkBacktop = withInstall(Component$C);
8812
+ var Component$B = defineComponent({
8813
8813
  name: "Badge",
8814
8814
  props: {
8815
8815
  theme: PropTypes.string.def("primary"),
@@ -8885,8 +8885,8 @@ var Component$C = defineComponent({
8885
8885
  }, [(_f = (_e = (_d = this.$slots).icon) == null ? void 0 : _e.call(_d)) != null ? _f : number]) : ""]);
8886
8886
  }
8887
8887
  });
8888
- const BkBadge = withInstall(Component$C);
8889
- var Component$B = defineComponent({
8888
+ const BkBadge = withInstall(Component$B);
8889
+ var Component$A = defineComponent({
8890
8890
  name: "Breadcrumb",
8891
8891
  props: {
8892
8892
  extCls: PropTypes.string,
@@ -8985,7 +8985,7 @@ var BreadcrumbItem = defineComponent({
8985
8985
  };
8986
8986
  }
8987
8987
  });
8988
- const BkBreadcrumb = withInstallProps(Component$B, { Item: BreadcrumbItem });
8988
+ const BkBreadcrumb = withInstallProps(Component$A, { Item: BreadcrumbItem });
8989
8989
  let BkLoadingMode;
8990
8990
  (function(BkLoadingMode2) {
8991
8991
  BkLoadingMode2["Default"] = "default";
@@ -9016,7 +9016,7 @@ const loadingTypes = {
9016
9016
  color: PropTypes.string.def("white"),
9017
9017
  zIndex: PropTypes.number.def(1)
9018
9018
  };
9019
- var Component$A = defineComponent({
9019
+ var Component$z = defineComponent({
9020
9020
  name: "Loading",
9021
9021
  props: loadingTypes,
9022
9022
  setup(props, ctx) {
@@ -9072,7 +9072,7 @@ var Component$A = defineComponent({
9072
9072
  };
9073
9073
  }
9074
9074
  });
9075
- const BkLoading = withInstallProps(Component$A, { setDefaultIndicator, BkLoadingMode, BkLoadingSize }, true);
9075
+ const BkLoading = withInstallProps(Component$z, { setDefaultIndicator, BkLoadingMode, BkLoadingSize }, true);
9076
9076
  const btnSizes = ["", "small", "large"];
9077
9077
  const buttonProps = {
9078
9078
  theme: PropTypes.theme().def(""),
@@ -9092,7 +9092,7 @@ const buttonProps = {
9092
9092
  default: "button"
9093
9093
  }
9094
9094
  };
9095
- var Component$z = defineComponent({
9095
+ var Component$y = defineComponent({
9096
9096
  name: "Button",
9097
9097
  props: buttonProps,
9098
9098
  emits: ["click", "mouseover"],
@@ -9183,7 +9183,7 @@ var ButtonGroup = defineComponent({
9183
9183
  };
9184
9184
  }
9185
9185
  });
9186
- const BkButton = withInstallProps(Component$z, { ButtonGroup });
9186
+ const BkButton = withInstallProps(Component$y, { ButtonGroup });
9187
9187
  const inputType = {
9188
9188
  type: PropTypes.string.def("text"),
9189
9189
  clearable: PropTypes.bool,
@@ -9246,7 +9246,7 @@ const inputEmitEventsType = {
9246
9246
  [EVENTS$2.COMPOSITIONUPDATE]: CompositionEventFunction,
9247
9247
  [EVENTS$2.COMPOSITIONEND]: CompositionEventFunction
9248
9248
  };
9249
- var Component$y = defineComponent({
9249
+ var Component$x = defineComponent({
9250
9250
  name: "Input",
9251
9251
  inheritAttrs: false,
9252
9252
  props: inputType,
@@ -9462,8 +9462,8 @@ var Component$y = defineComponent({
9462
9462
  };
9463
9463
  }
9464
9464
  });
9465
- const BkInput = withInstall(Component$y);
9466
- var Component$x = defineComponent({
9465
+ const BkInput = withInstall(Component$x);
9466
+ var Component$w = defineComponent({
9467
9467
  name: "Card",
9468
9468
  props: {
9469
9469
  title: PropTypes.string,
@@ -9556,7 +9556,7 @@ var Component$x = defineComponent({
9556
9556
  }, [(_l = (_k = (_j = this.$slots).footer) == null ? void 0 : _k.call(_j)) != null ? _l : "Footer"]) : ""]) : ""]);
9557
9557
  }
9558
9558
  });
9559
- const BkCard = withInstall(Component$x);
9559
+ const BkCard = withInstall(Component$w);
9560
9560
  const checkboxGroupKey = Symbol("CheckboxGroup");
9561
9561
  function useFocus$1() {
9562
9562
  const isFocus = ref(false);
@@ -9657,7 +9657,7 @@ const checkboxProps = {
9657
9657
  beforeChange: PropTypes.func,
9658
9658
  size: PropTypes.size().def("large")
9659
9659
  };
9660
- var Component$w = defineComponent({
9660
+ var Component$v = defineComponent({
9661
9661
  name: "Checkbox",
9662
9662
  props: checkboxProps,
9663
9663
  emits: ["update:modelValue", "change"],
@@ -9761,7 +9761,33 @@ var BkCheckboxGroup = defineComponent({
9761
9761
  }, [(_a = this.$slots) == null ? void 0 : _a.default()]);
9762
9762
  }
9763
9763
  });
9764
- const BkCheckbox = withInstallProps(Component$w, { Group: BkCheckboxGroup });
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);
9765
9791
  const trimArr$1 = function(s2) {
9766
9792
  return (s2 || "").split(" ").filter((item) => !!item.trim());
9767
9793
  };
@@ -9841,23 +9867,111 @@ const collapseMotion$1 = (emit) => ({
9841
9867
  emit("after-leave");
9842
9868
  }
9843
9869
  });
9844
- var Component$v = defineComponent({
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({
9845
9967
  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
- },
9968
+ props: propsCollapse,
9854
9969
  emits: ["item-click", "update:modelValue", "after-leave", "before-enter"],
9855
9970
  setup(props, {
9856
9971
  emit,
9857
9972
  slots
9858
9973
  }) {
9859
9974
  const localActiveItems = ref([]);
9860
- const transition = ref(collapseMotion$1(emit));
9861
9975
  watch(() => [props.modelValue], () => {
9862
9976
  const value = props.modelValue;
9863
9977
  if (Array.isArray(value)) {
@@ -9870,66 +9984,74 @@ var Component$v = defineComponent({
9870
9984
  }, {
9871
9985
  immediate: true
9872
9986
  });
9873
- const collapseData = computed(() => (props.list || []).map((item, index) => {
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
- }));
9987
+ provide("localActiveItems", localActiveItems.value);
9884
9988
  const handleItemClick = (item) => {
9885
- if (item.disabled)
9886
- return;
9989
+ const {
9990
+ name
9991
+ } = item;
9887
9992
  if (props.accordion) {
9888
- const activeItemIndex = localActiveItems.value.findIndex((local) => local === item[props.idFiled]);
9993
+ const activeItemIndex = localActiveItems.value.findIndex((local) => local === name);
9889
9994
  if (activeItemIndex >= 0) {
9890
9995
  localActiveItems.value.splice(activeItemIndex, 1);
9891
9996
  } else {
9892
- localActiveItems.value = [item[props.idFiled]];
9997
+ localActiveItems.value = [name];
9893
9998
  }
9894
9999
  } else {
9895
- const activeItemIndex = localActiveItems.value.findIndex((local) => local === item[props.idFiled]);
10000
+ const activeItemIndex = localActiveItems.value.findIndex((local) => local === name);
9896
10001
  if (activeItemIndex >= 0) {
9897
10002
  localActiveItems.value.splice(activeItemIndex, 1);
9898
10003
  } else {
9899
- localActiveItems.value.push(item[props.idFiled]);
10004
+ localActiveItems.value.push(name);
9900
10005
  }
9901
10006
  }
9902
10007
  emit("item-click", item);
9903
10008
  emit("update:modelValue", localActiveItems.value);
9904
10009
  };
9905
- const isItemActive = (item) => localActiveItems.value.includes(item[props.idFiled]);
9906
- const renderItems = () => collapseData.value.map((item) => {
9907
- var _a, _b;
9908
- return createVNode("div", {
9909
- "class": `bk-collapse-item ${item.disabled ? "is-disabled" : ""} ${isItemActive(item) ? "bk-collapse-item-active" : ""}`
9910
- }, [createVNode("div", {
9911
- "class": "bk-collapse-header",
9912
- "onClick": () => handleItemClick(item)
9913
- }, [createVNode("span", {
9914
- "class": "bk-collapse-title"
9915
- }, [(_b = (_a = slots.default) == null ? void 0 : _a.call(slots, item)) != null ? _b : item[props.titleField]]), createVNode(angleRight, {
9916
- "class": `bk-collapse-icon ${isItemActive(item) && "rotate-icon" || ""}`
9917
- }, null)]), createVNode(Transition, transition.value, {
9918
- default: () => {
9919
- var _a2, _b2;
9920
- return [withDirectives(createVNode("div", {
9921
- "class": `bk-collapse-content ${isItemActive(item) && "active" || ""}`
9922
- }, [(_b2 = (_a2 = slots.content) == null ? void 0 : _a2.call(slots, item)) != null ? _b2 : item[props.contentField]]), [[vShow, isItemActive(item)]])];
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;
9923
10038
  }
9924
- })]);
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);
9925
10048
  });
9926
- const className = "bk-collapse-wrapper";
9927
10049
  return () => createVNode("div", {
9928
10050
  "class": className
9929
10051
  }, [renderItems()]);
9930
10052
  }
9931
10053
  });
9932
- const BkCollapse = withInstall(Component$v);
10054
+ const BkCollapse = withInstallProps(Collapse, { CollapsePanel });
9933
10055
  const propsMixin$1 = {
9934
10056
  isShow: PropTypes.bool.def(false),
9935
10057
  width: PropTypes.oneOfType([String, Number]).def("50%"),