bkui-vue 0.0.1-beta.166 → 0.0.1-beta.167

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
@@ -27440,6 +27440,8 @@ const BkDropdown = withInstallProps(Dropdown, { DropdownMenu, DropdownItem });
27440
27440
  var CascaderPanel = defineComponent({
27441
27441
  name: "CascaderPanel",
27442
27442
  props: {
27443
+ width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).def("auto"),
27444
+ height: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).def(216),
27443
27445
  store: PropTypes.object.def({}),
27444
27446
  modelValue: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.number).def([]), PropTypes.arrayOf(PropTypes.string).def([])])
27445
27447
  },
@@ -27455,6 +27457,14 @@ var CascaderPanel = defineComponent({
27455
27457
  });
27456
27458
  const activePath = ref([]);
27457
27459
  const checkValue = ref([]);
27460
+ const getSizeComputed = (value) => {
27461
+ if (typeof value === "number") {
27462
+ return `${value}px`;
27463
+ }
27464
+ return value;
27465
+ };
27466
+ const panelHeight = getSizeComputed(props2.height);
27467
+ const panelWidth = getSizeComputed(props2.width);
27458
27468
  const updateCheckValue = (value) => {
27459
27469
  if (value.length === 0) {
27460
27470
  menus.list = menus.list.slice(0, 1);
@@ -27555,30 +27565,40 @@ var CascaderPanel = defineComponent({
27555
27565
  isCheckedNode,
27556
27566
  checkValue,
27557
27567
  checkNode,
27558
- iconRender
27568
+ iconRender,
27569
+ panelWidth,
27570
+ panelHeight
27559
27571
  };
27560
27572
  },
27561
27573
  render() {
27562
27574
  return createVNode("div", {
27563
27575
  "class": "bk-cascader-panel-wrapper"
27564
27576
  }, [this.menus.list.map((menu2) => createVNode("ul", {
27565
- "class": "bk-cascader-panel"
27566
- }, [menu2.map((node) => createVNode("li", mergeProps({
27567
- "class": ["bk-cascader-node", {
27568
- "is-selected": this.isNodeInPath(node)
27569
- }, {
27570
- "is-disabled": node.isDisabled
27571
- }, {
27572
- "is-checked": this.isCheckedNode(node, this.checkValue)
27573
- }]
27574
- }, this.nodeEvent(node)), [node.config.multiple && createVNode(BkCheckbox, {
27575
- "disabled": node.isDisabled,
27576
- "modelValue": node.checked,
27577
- "onUpdate:modelValue": ($event) => node.checked = $event,
27578
- "onChange": (val) => this.checkNode(node, val)
27579
- }, null), createVNode("span", {
27580
- "class": "bk-cascader-node-name"
27581
- }, [node.name]), !node.isLeaf ? this.iconRender(node) : ""]))]))]);
27577
+ "class": "bk-cascader-panel bk-scroll-y",
27578
+ "style": {
27579
+ height: this.panelHeight,
27580
+ width: this.panelWidth
27581
+ }
27582
+ }, [menu2.map((node) => {
27583
+ var _a, _b;
27584
+ return createVNode("li", mergeProps({
27585
+ "class": ["bk-cascader-node", {
27586
+ "is-selected": this.isNodeInPath(node)
27587
+ }, {
27588
+ "is-disabled": node.isDisabled
27589
+ }, {
27590
+ "is-checked": this.isCheckedNode(node, this.checkValue)
27591
+ }]
27592
+ }, this.nodeEvent(node)), [node.config.multiple && createVNode(BkCheckbox, {
27593
+ "disabled": node.isDisabled,
27594
+ "modelValue": node.checked,
27595
+ "onUpdate:modelValue": ($event) => node.checked = $event,
27596
+ "onChange": (val) => this.checkNode(node, val)
27597
+ }, null), (_b = (_a = this.$slots).default) == null ? void 0 : _b.call(_a, {
27598
+ node,
27599
+ data: node.data
27600
+ }), !node.isLeaf ? this.iconRender(node) : ""]);
27601
+ })]))]);
27582
27602
  }
27583
27603
  });
27584
27604
  class Node$1 {
@@ -27696,7 +27716,9 @@ var Component$6 = defineComponent({
27696
27716
  childrenKey: PropTypes.string.def("children"),
27697
27717
  separator: PropTypes.string.def("/"),
27698
27718
  limitOneLine: PropTypes.bool.def(false),
27699
- extCls: PropTypes.string.def("")
27719
+ extCls: PropTypes.string.def(""),
27720
+ scrollHeight: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).def(216),
27721
+ scrollWidth: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).def("auto")
27700
27722
  },
27701
27723
  emits: ["update:modelValue", "change", "clear", "toggle"],
27702
27724
  setup(props2, {
@@ -27736,7 +27758,7 @@ var Component$6 = defineComponent({
27736
27758
  }));
27737
27759
  return;
27738
27760
  }
27739
- (_a = popover3 == null ? void 0 : popover3.value) == null ? void 0 : _a.hide();
27761
+ !props2.checkAnyLevel && ((_a = popover3 == null ? void 0 : popover3.value) == null ? void 0 : _a.hide());
27740
27762
  if (val.length === 0) {
27741
27763
  selectedText.value = "";
27742
27764
  } else {
@@ -27854,9 +27876,15 @@ var Component$6 = defineComponent({
27854
27876
  }, [createVNode(CascaderPanel, {
27855
27877
  "store": this.store,
27856
27878
  "ref": "cascaderPanel",
27879
+ "width": this.scrollWidth,
27880
+ "height": this.scrollHeight,
27857
27881
  "modelValue": this.checkedValue,
27858
27882
  "onUpdate:modelValue": ($event) => this.checkedValue = $event
27859
- }, null)])
27883
+ }, {
27884
+ default: (scope) => this.$slots.default ? this.$slots.default(scope) : createVNode("span", {
27885
+ "class": "bk-cascader-node-name"
27886
+ }, [scope.node.name])
27887
+ })])
27860
27888
  })]);
27861
27889
  }
27862
27890
  });