tanxin-ui 0.4.9 → 0.5.1
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/tanxin-ui.es.js +13 -7
- package/dist/tanxin-ui.umd.js +5 -5
- package/es/menu/src/context.js +1 -1
- package/es/menu/src/menu.js +6 -3
- package/es/menu/src/use-pop.js +1 -1
- package/es/menu/src/use-vertical.js +5 -2
- package/lib/menu/src/context.js +1 -1
- package/lib/menu/src/menu.js +6 -3
- package/lib/menu/src/use-pop.js +1 -1
- package/lib/menu/src/use-vertical.js +5 -2
- package/package.json +1 -1
package/dist/tanxin-ui.es.js
CHANGED
|
@@ -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", "
|
|
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.
|
|
21911
|
+
else if (props.mainWidth)
|
|
21912
21912
|
style[`width`] = getLength(props.mainWidth);
|
|
21913
21913
|
return style;
|
|
21914
21914
|
});
|
|
@@ -21937,6 +21937,9 @@ function useVetical(props, openPath, selectedPath, prefixCls, byOptions, menuLis
|
|
|
21937
21937
|
const indent = getLengthNumber(props.indent);
|
|
21938
21938
|
const getItemContent = (item, level = 0, rightMenu) => {
|
|
21939
21939
|
const levelNum = realLevel(item, level);
|
|
21940
|
+
let label = props.firstShort ? item.labelShort : item.label;
|
|
21941
|
+
if (!label)
|
|
21942
|
+
label = item.label;
|
|
21940
21943
|
return createVNode(Fragment, null, [createVNode("span", {
|
|
21941
21944
|
"style": getSpanStyles(item.noIcon, levelNum, indent)
|
|
21942
21945
|
}, [item.icon ? createVNode(resolveComponent("t-icon"), {
|
|
@@ -21945,7 +21948,7 @@ function useVetical(props, openPath, selectedPath, prefixCls, byOptions, menuLis
|
|
|
21945
21948
|
default: () => [item.icon, createTextVNode(" ")]
|
|
21946
21949
|
}) : null]), createVNode("div", {
|
|
21947
21950
|
"class": `${prefixCls.value}-item-title-words`
|
|
21948
|
-
}, [
|
|
21951
|
+
}, [label]), item.children && item.children.length > 0 && !item.isGroup && props.collapsable && !(props.type == "seperate" && !rightMenu) ? createVNode(resolveComponent("t-icon"), {
|
|
21949
21952
|
"class": `${prefixCls.value}-item-title-arrow`
|
|
21950
21953
|
}, {
|
|
21951
21954
|
default: () => [createVNode(IosArrowDown, null, null)]
|
|
@@ -22212,7 +22215,7 @@ function usePop(props, selectedPath, prefixCls, byOptions, menuList, popperFuns)
|
|
|
22212
22215
|
default: () => [item.icon]
|
|
22213
22216
|
}) : null]), createVNode("div", {
|
|
22214
22217
|
"class": `${prefixCls.value}-item-title-words`
|
|
22215
|
-
}, [props.firstShort ? item.
|
|
22218
|
+
}, [props.firstShort ? item.label : item.label]), item.children && item.children.length > 0 && props.collapsable ? createVNode(resolveComponent("t-icon"), {
|
|
22216
22219
|
"class": `${prefixCls.value}-item-title-arrow-pop`
|
|
22217
22220
|
}, {
|
|
22218
22221
|
default: () => [createVNode(ChevronForward, null, null)]
|
|
@@ -22403,6 +22406,7 @@ var Menu = defineComponent({
|
|
|
22403
22406
|
watch(() => props.selectedPath, () => {
|
|
22404
22407
|
selectedPath.value = props.selectedPath;
|
|
22405
22408
|
openPath.value = props.selectedPath;
|
|
22409
|
+
updateRightMenu();
|
|
22406
22410
|
}, {
|
|
22407
22411
|
deep: true
|
|
22408
22412
|
});
|
|
@@ -22454,9 +22458,7 @@ var Menu = defineComponent({
|
|
|
22454
22458
|
calculateParentNoIcon(menuList.value);
|
|
22455
22459
|
}
|
|
22456
22460
|
};
|
|
22457
|
-
|
|
22458
|
-
initData();
|
|
22459
|
-
setSelectedPath(props.selectedPath);
|
|
22461
|
+
const updateRightMenu = () => {
|
|
22460
22462
|
if (props.type == "seperate") {
|
|
22461
22463
|
let firstSelectedItem = null;
|
|
22462
22464
|
if (selectedPath.value.length > 0) {
|
|
@@ -22466,6 +22468,10 @@ var Menu = defineComponent({
|
|
|
22466
22468
|
if (firstSelectedItem)
|
|
22467
22469
|
rightMenuList.value = firstSelectedItem.children;
|
|
22468
22470
|
}
|
|
22471
|
+
};
|
|
22472
|
+
onMounted(() => {
|
|
22473
|
+
initData();
|
|
22474
|
+
setSelectedPath(props.selectedPath);
|
|
22469
22475
|
});
|
|
22470
22476
|
const menuType = getType(props.type);
|
|
22471
22477
|
const render = () => {
|