tanxin-ui 0.5.0 → 0.5.2

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.
@@ -7871,7 +7871,7 @@ const menuItemProps$1 = {
7871
7871
  function getType(type4) {
7872
7872
  if (["horizontal", "x"].includes(type4))
7873
7873
  return "x";
7874
- else if (["vertical", "xy"].includes(type4))
7874
+ else if (["vertical", "y"].includes(type4))
7875
7875
  return "y";
7876
7876
  else if (type4 == "seperate")
7877
7877
  return type4;
@@ -21908,7 +21908,7 @@ function useVetical(props, openPath, selectedPath, prefixCls, byOptions, menuLis
21908
21908
  const style = {};
21909
21909
  if (props.collapsed)
21910
21910
  style[`width`] = getLength(props.collapsedWidth);
21911
- else if (props.width)
21911
+ else if (props.mainWidth)
21912
21912
  style[`width`] = getLength(props.mainWidth);
21913
21913
  return style;
21914
21914
  });
@@ -22028,17 +22028,17 @@ function useVetical(props, openPath, selectedPath, prefixCls, byOptions, menuLis
22028
22028
  }, [getItemRow(item, level, rightMenu), getChildren(item, level + 1, rightMenu)]);
22029
22029
  };
22030
22030
  const menuElement = () => {
22031
- var _a;
22032
- return createVNode("ul", {
22031
+ var _a, _b;
22032
+ return createVNode(Fragment, null, [(_a = slots.header) == null ? void 0 : _a.call(slots), createVNode("ul", {
22033
22033
  "class": [...classes.value, `is-vertical`],
22034
22034
  "style": styles.value
22035
22035
  }, [byOptions ? menuList.value.map((item) => {
22036
22036
  return renderItem(item, 1, false);
22037
- }) : (_a = slots.default) == null ? void 0 : _a.call(slots)]);
22037
+ }) : (_b = slots.default) == null ? void 0 : _b.call(slots)])]);
22038
22038
  };
22039
22039
  const seperateElement = () => {
22040
- var _a, _b;
22041
- return createVNode("div", {
22040
+ var _a, _b, _c;
22041
+ return createVNode(Fragment, null, [(_a = slots.header) == null ? void 0 : _a.call(slots), createVNode("div", {
22042
22042
  "class": `${prefixCls.value}-seperate`,
22043
22043
  "style": styles.value
22044
22044
  }, [createVNode("ul", {
@@ -22046,11 +22046,11 @@ function useVetical(props, openPath, selectedPath, prefixCls, byOptions, menuLis
22046
22046
  "style": mainStyles.value
22047
22047
  }, [byOptions ? menuList.value.map((item) => {
22048
22048
  return renderItem(item, 1, false);
22049
- }) : (_a = slots.default) == null ? void 0 : _a.call(slots)]), createVNode("ul", {
22049
+ }) : (_b = slots.default) == null ? void 0 : _b.call(slots)]), createVNode("ul", {
22050
22050
  "class": [...subMenuClasses.value, `is-vertical`, `sub-menu`]
22051
22051
  }, [byOptions ? rightMenuList.value.map((item) => {
22052
22052
  return renderItem(item, 1, true);
22053
- }) : (_b = slots.default) == null ? void 0 : _b.call(slots)])]);
22053
+ }) : (_c = slots.default) == null ? void 0 : _c.call(slots)])])]);
22054
22054
  };
22055
22055
  return props.type == "seperate" ? seperateElement() : menuElement();
22056
22056
  }
@@ -22406,6 +22406,7 @@ var Menu = defineComponent({
22406
22406
  watch(() => props.selectedPath, () => {
22407
22407
  selectedPath.value = props.selectedPath;
22408
22408
  openPath.value = props.selectedPath;
22409
+ updateRightMenu();
22409
22410
  }, {
22410
22411
  deep: true
22411
22412
  });
@@ -22457,9 +22458,7 @@ var Menu = defineComponent({
22457
22458
  calculateParentNoIcon(menuList.value);
22458
22459
  }
22459
22460
  };
22460
- onMounted(() => {
22461
- initData();
22462
- setSelectedPath(props.selectedPath);
22461
+ const updateRightMenu = () => {
22463
22462
  if (props.type == "seperate") {
22464
22463
  let firstSelectedItem = null;
22465
22464
  if (selectedPath.value.length > 0) {
@@ -22469,6 +22468,10 @@ var Menu = defineComponent({
22469
22468
  if (firstSelectedItem)
22470
22469
  rightMenuList.value = firstSelectedItem.children;
22471
22470
  }
22471
+ };
22472
+ onMounted(() => {
22473
+ initData();
22474
+ setSelectedPath(props.selectedPath);
22472
22475
  });
22473
22476
  const menuType = getType(props.type);
22474
22477
  const render = () => {