@v-c/menu 1.0.6 → 1.0.8
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/Menu.d.ts +1 -0
- package/dist/Menu.js +20 -8
- package/dist/SubMenu/index.d.ts +1 -2
- package/dist/SubMenu/index.js +25 -11
- package/dist/context/MenuContext.js +1 -1
- package/dist/interface.d.ts +4 -1
- package/dist/utils/commonUtil.js +2 -8
- package/dist/utils/nodeUtil.d.ts +1 -0
- package/dist/utils/nodeUtil.js +3 -0
- package/package.json +5 -5
- package/dist/Divider.cjs +0 -38
- package/dist/Icon.cjs +0 -45
- package/dist/Menu.cjs +0 -526
- package/dist/MenuItem.cjs +0 -338
- package/dist/MenuItemGroup.cjs +0 -124
- package/dist/SubMenu/InlineSubMenuList.cjs +0 -63
- package/dist/SubMenu/PopupTrigger.cjs +0 -145
- package/dist/SubMenu/SubMenuList.cjs +0 -23
- package/dist/SubMenu/index.cjs +0 -508
- package/dist/_virtual/rolldown_runtime.cjs +0 -21
- package/dist/context/IdContext.cjs +0 -26
- package/dist/context/MenuContext.cjs +0 -196
- package/dist/context/PathContext.cjs +0 -76
- package/dist/context/PrivateContext.cjs +0 -19
- package/dist/hooks/useAccessibility.cjs +0 -193
- package/dist/hooks/useActive.cjs +0 -31
- package/dist/hooks/useDirectionStyle.cjs +0 -17
- package/dist/hooks/useKeyRecords.cjs +0 -78
- package/dist/hooks/useMemoCallback.cjs +0 -15
- package/dist/index.cjs +0 -24
- package/dist/interface.cjs +0 -1
- package/dist/placements.cjs +0 -80
- package/dist/utils/commonUtil.cjs +0 -28
- package/dist/utils/motionUtil.cjs +0 -6
- package/dist/utils/nodeUtil.cjs +0 -55
- package/dist/utils/timeUtil.cjs +0 -6
- package/dist/utils/warnUtil.cjs +0 -11
package/dist/placements.cjs
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
Object.defineProperties(exports, {
|
|
2
|
-
__esModule: { value: true },
|
|
3
|
-
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
-
});
|
|
5
|
-
var autoAdjustOverflow = {
|
|
6
|
-
adjustX: 1,
|
|
7
|
-
adjustY: 1
|
|
8
|
-
};
|
|
9
|
-
const placements = {
|
|
10
|
-
topLeft: {
|
|
11
|
-
points: ["bl", "tl"],
|
|
12
|
-
overflow: autoAdjustOverflow
|
|
13
|
-
},
|
|
14
|
-
topRight: {
|
|
15
|
-
points: ["br", "tr"],
|
|
16
|
-
overflow: autoAdjustOverflow
|
|
17
|
-
},
|
|
18
|
-
bottomLeft: {
|
|
19
|
-
points: ["tl", "bl"],
|
|
20
|
-
overflow: autoAdjustOverflow
|
|
21
|
-
},
|
|
22
|
-
bottomRight: {
|
|
23
|
-
points: ["tr", "br"],
|
|
24
|
-
overflow: autoAdjustOverflow
|
|
25
|
-
},
|
|
26
|
-
leftTop: {
|
|
27
|
-
points: ["tr", "tl"],
|
|
28
|
-
overflow: autoAdjustOverflow
|
|
29
|
-
},
|
|
30
|
-
leftBottom: {
|
|
31
|
-
points: ["br", "bl"],
|
|
32
|
-
overflow: autoAdjustOverflow
|
|
33
|
-
},
|
|
34
|
-
rightTop: {
|
|
35
|
-
points: ["tl", "tr"],
|
|
36
|
-
overflow: autoAdjustOverflow
|
|
37
|
-
},
|
|
38
|
-
rightBottom: {
|
|
39
|
-
points: ["bl", "br"],
|
|
40
|
-
overflow: autoAdjustOverflow
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
const placementsRtl = {
|
|
44
|
-
topLeft: {
|
|
45
|
-
points: ["bl", "tl"],
|
|
46
|
-
overflow: autoAdjustOverflow
|
|
47
|
-
},
|
|
48
|
-
topRight: {
|
|
49
|
-
points: ["br", "tr"],
|
|
50
|
-
overflow: autoAdjustOverflow
|
|
51
|
-
},
|
|
52
|
-
bottomLeft: {
|
|
53
|
-
points: ["tl", "bl"],
|
|
54
|
-
overflow: autoAdjustOverflow
|
|
55
|
-
},
|
|
56
|
-
bottomRight: {
|
|
57
|
-
points: ["tr", "br"],
|
|
58
|
-
overflow: autoAdjustOverflow
|
|
59
|
-
},
|
|
60
|
-
rightTop: {
|
|
61
|
-
points: ["tr", "tl"],
|
|
62
|
-
overflow: autoAdjustOverflow
|
|
63
|
-
},
|
|
64
|
-
rightBottom: {
|
|
65
|
-
points: ["br", "bl"],
|
|
66
|
-
overflow: autoAdjustOverflow
|
|
67
|
-
},
|
|
68
|
-
leftTop: {
|
|
69
|
-
points: ["tl", "tr"],
|
|
70
|
-
overflow: autoAdjustOverflow
|
|
71
|
-
},
|
|
72
|
-
leftBottom: {
|
|
73
|
-
points: ["bl", "br"],
|
|
74
|
-
overflow: autoAdjustOverflow
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
var placements_default = placements;
|
|
78
|
-
exports.default = placements_default;
|
|
79
|
-
exports.placements = placements;
|
|
80
|
-
exports.placementsRtl = placementsRtl;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_rolldown_runtime = require("../_virtual/rolldown_runtime.cjs");
|
|
3
|
-
let vue = require("vue");
|
|
4
|
-
let _v_c_util_dist_Children_toArray = require("@v-c/util/dist/Children/toArray");
|
|
5
|
-
function parseChildren(children, keyPath) {
|
|
6
|
-
return (0, _v_c_util_dist_Children_toArray.toArray)(children).map((child, index) => {
|
|
7
|
-
if ((0, vue.isVNode)(child)) {
|
|
8
|
-
const key = child.key;
|
|
9
|
-
let eventKey = child.props?.eventKey ?? key;
|
|
10
|
-
const emptyKey = eventKey === null || eventKey === void 0;
|
|
11
|
-
if (emptyKey) eventKey = `tmp_key-${[...keyPath, index].join("-")}`;
|
|
12
|
-
const cloneProps = {
|
|
13
|
-
key: eventKey,
|
|
14
|
-
eventKey
|
|
15
|
-
};
|
|
16
|
-
if (process.env.NODE_ENV !== "production" && emptyKey) cloneProps.warnKey = true;
|
|
17
|
-
return {
|
|
18
|
-
...child,
|
|
19
|
-
props: {
|
|
20
|
-
...child.props,
|
|
21
|
-
...cloneProps
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
return child;
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
exports.parseChildren = parseChildren;
|
package/dist/utils/nodeUtil.cjs
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_rolldown_runtime = require("../_virtual/rolldown_runtime.cjs");
|
|
3
|
-
const require_Divider = require("../Divider.cjs");
|
|
4
|
-
const require_MenuItem = require("../MenuItem.cjs");
|
|
5
|
-
const require_commonUtil = require("./commonUtil.cjs");
|
|
6
|
-
const require_index = require("../SubMenu/index.cjs");
|
|
7
|
-
const require_MenuItemGroup = require("../MenuItemGroup.cjs");
|
|
8
|
-
let vue = require("vue");
|
|
9
|
-
let _v_c_util_dist_props_util = require("@v-c/util/dist/props-util");
|
|
10
|
-
function _isSlot(s) {
|
|
11
|
-
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !(0, vue.isVNode)(s);
|
|
12
|
-
}
|
|
13
|
-
function convertItemsToNodes(list, components, prefixCls, slots) {
|
|
14
|
-
const { item: MergedMenuItem, group: MergedMenuItemGroup, submenu: MergedSubMenu, divider: MergedDivider } = components;
|
|
15
|
-
return (list || []).map((opt, index) => {
|
|
16
|
-
if (opt && typeof opt === "object") {
|
|
17
|
-
const { children, key, type, ...restProps } = opt;
|
|
18
|
-
const mergedKey = key ?? `tmp-${index}`;
|
|
19
|
-
let label;
|
|
20
|
-
let extra;
|
|
21
|
-
const _labelRender = slots?.labelRender ? slots.labelRender(opt) : null;
|
|
22
|
-
const _extraRender = slots?.extraRender ? slots.extraRender(opt) : null;
|
|
23
|
-
const labelArr = (0, _v_c_util_dist_props_util.filterEmpty)(Array.isArray(_labelRender) ? _labelRender : [_labelRender]);
|
|
24
|
-
const extraArr = (0, _v_c_util_dist_props_util.filterEmpty)(Array.isArray(_extraRender) ? _extraRender : [_extraRender]);
|
|
25
|
-
if (labelArr.length) label = labelArr?.[0];
|
|
26
|
-
if (extraArr.length) extra = extraArr?.[0];
|
|
27
|
-
if (!label) label = opt.label;
|
|
28
|
-
if (!extra) extra = opt.extra;
|
|
29
|
-
if (children || type === "group") {
|
|
30
|
-
let _slot2;
|
|
31
|
-
if (type === "group") {
|
|
32
|
-
let _slot;
|
|
33
|
-
return (0, vue.createVNode)(MergedMenuItemGroup, (0, vue.mergeProps)({ "key": mergedKey }, restProps, { "title": label }), _isSlot(_slot = convertItemsToNodes(children, components, prefixCls, slots)) ? _slot : { default: () => [_slot] });
|
|
34
|
-
}
|
|
35
|
-
return (0, vue.createVNode)(MergedSubMenu, (0, vue.mergeProps)({ "key": mergedKey }, restProps, { "title": label }), _isSlot(_slot2 = convertItemsToNodes(children, components, prefixCls, slots)) ? _slot2 : { default: () => [_slot2] });
|
|
36
|
-
}
|
|
37
|
-
if (type === "divider") return (0, vue.createVNode)(MergedDivider, (0, vue.mergeProps)({ "key": mergedKey }, restProps), null);
|
|
38
|
-
return (0, vue.createVNode)(MergedMenuItem, (0, vue.mergeProps)({ "key": mergedKey }, restProps, { "extra": extra }), { default: () => [label, (!!extra || extra === 0) && (0, vue.createVNode)("span", { "class": `${prefixCls}-item-extra` }, [extra])] });
|
|
39
|
-
}
|
|
40
|
-
return null;
|
|
41
|
-
}).filter((opt) => opt);
|
|
42
|
-
}
|
|
43
|
-
function parseItems(children, items, keyPath, components, prefixCls, slots) {
|
|
44
|
-
let childNodes = children;
|
|
45
|
-
const mergedComponents = {
|
|
46
|
-
divider: require_Divider.default,
|
|
47
|
-
item: require_MenuItem.default,
|
|
48
|
-
group: require_MenuItemGroup.default,
|
|
49
|
-
submenu: require_index.default,
|
|
50
|
-
...components
|
|
51
|
-
};
|
|
52
|
-
if (items) childNodes = convertItemsToNodes(items, mergedComponents, prefixCls, slots);
|
|
53
|
-
return require_commonUtil.parseChildren(childNodes, keyPath);
|
|
54
|
-
}
|
|
55
|
-
exports.parseItems = parseItems;
|
package/dist/utils/timeUtil.cjs
DELETED
package/dist/utils/warnUtil.cjs
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_rolldown_runtime = require("../_virtual/rolldown_runtime.cjs");
|
|
3
|
-
let _v_c_util = require("@v-c/util");
|
|
4
|
-
function warnItemProp({ item, ...restInfo }) {
|
|
5
|
-
Object.defineProperty(restInfo, "item", { get: () => {
|
|
6
|
-
(0, _v_c_util.warning)(false, "`info.item` is deprecated since we will move to function component that not provides React Node instance in future.");
|
|
7
|
-
return item;
|
|
8
|
-
} });
|
|
9
|
-
return restInfo;
|
|
10
|
-
}
|
|
11
|
-
exports.warnItemProp = warnItemProp;
|