@v-c/menu 1.0.0 → 1.0.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.
- package/dist/Divider.cjs +7 -4
- package/dist/Divider.js +1 -1
- package/dist/Icon.cjs +9 -6
- package/dist/Icon.js +3 -3
- package/dist/Menu.cjs +27 -24
- package/dist/Menu.js +10 -10
- package/dist/MenuItem.cjs +35 -31
- package/dist/MenuItem.js +14 -13
- package/dist/MenuItemGroup.cjs +20 -15
- package/dist/MenuItemGroup.js +7 -5
- package/dist/SubMenu/InlineSubMenuList.cjs +6 -3
- package/dist/SubMenu/PopupTrigger.cjs +16 -12
- package/dist/SubMenu/PopupTrigger.js +3 -2
- package/dist/SubMenu/SubMenuList.cjs +6 -3
- package/dist/SubMenu/index.cjs +34 -29
- package/dist/SubMenu/index.js +22 -20
- package/dist/context/IdContext.cjs +1 -0
- package/dist/context/MenuContext.cjs +13 -10
- package/dist/context/MenuContext.js +6 -6
- package/dist/context/PathContext.cjs +1 -0
- package/dist/context/PrivateContext.cjs +1 -0
- package/dist/hooks/useAccessibility.cjs +7 -4
- package/dist/hooks/useActive.cjs +4 -1
- package/dist/hooks/useDirectionStyle.cjs +4 -1
- package/dist/hooks/useKeyRecords.cjs +4 -1
- package/dist/hooks/useMemoCallback.cjs +4 -1
- package/dist/index.cjs +4 -1
- package/dist/interface.cjs +1 -0
- package/dist/placements.cjs +4 -1
- package/dist/utils/commonUtil.cjs +3 -2
- package/dist/utils/motionUtil.cjs +1 -0
- package/dist/utils/nodeUtil.cjs +5 -4
- package/dist/utils/nodeUtil.js +1 -1
- package/dist/utils/timeUtil.cjs +1 -0
- package/dist/utils/warnUtil.cjs +4 -3
- package/dist/utils/warnUtil.js +1 -1
- package/package.json +4 -4
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
Object.
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
2
5
|
const require_rolldown_runtime = require("../_virtual/rolldown_runtime.cjs");
|
|
3
6
|
let vue = require("vue");
|
|
4
|
-
let
|
|
5
|
-
|
|
7
|
+
let _v_c_util_dist_omit = require("@v-c/util/dist/omit");
|
|
8
|
+
_v_c_util_dist_omit = require_rolldown_runtime.__toESM(_v_c_util_dist_omit);
|
|
6
9
|
var MenuContextKey = Symbol("MenuContextKey");
|
|
7
10
|
function mergeProps(origin, target) {
|
|
8
11
|
const clone = { ...origin };
|
|
@@ -21,7 +24,7 @@ function useMenuContextProvider(context) {
|
|
|
21
24
|
var InheritableContextProvider = /* @__PURE__ */ (0, vue.defineComponent)((props, { slots }) => {
|
|
22
25
|
const context = useMenuContext();
|
|
23
26
|
useMenuContextProvider((0, vue.computed)(() => {
|
|
24
|
-
return mergeProps(context?.value ?? {}, (0,
|
|
27
|
+
return mergeProps(context?.value ?? {}, (0, _v_c_util_dist_omit.default)(props, ["locked"]));
|
|
25
28
|
}));
|
|
26
29
|
return () => {
|
|
27
30
|
return slots?.default?.();
|
|
@@ -145,28 +148,28 @@ var InheritableContextProvider = /* @__PURE__ */ (0, vue.defineComponent)((props
|
|
|
145
148
|
},
|
|
146
149
|
itemIcon: {
|
|
147
150
|
type: [
|
|
151
|
+
Object,
|
|
152
|
+
Function,
|
|
148
153
|
String,
|
|
149
154
|
Number,
|
|
150
155
|
null,
|
|
151
156
|
Boolean,
|
|
152
|
-
Array
|
|
153
|
-
Function
|
|
157
|
+
Array
|
|
154
158
|
],
|
|
155
159
|
required: false,
|
|
156
|
-
skipCheck: true,
|
|
157
160
|
default: void 0
|
|
158
161
|
},
|
|
159
162
|
expandIcon: {
|
|
160
163
|
type: [
|
|
164
|
+
Object,
|
|
165
|
+
Function,
|
|
161
166
|
String,
|
|
162
167
|
Number,
|
|
163
168
|
null,
|
|
164
169
|
Boolean,
|
|
165
|
-
Array
|
|
166
|
-
Function
|
|
170
|
+
Array
|
|
167
171
|
],
|
|
168
172
|
required: false,
|
|
169
|
-
skipCheck: true,
|
|
170
173
|
default: void 0
|
|
171
174
|
},
|
|
172
175
|
onItemClick: {
|
|
@@ -142,28 +142,28 @@ var MenuContext_default = /* @__PURE__ */ defineComponent((props, { slots }) =>
|
|
|
142
142
|
},
|
|
143
143
|
itemIcon: {
|
|
144
144
|
type: [
|
|
145
|
+
Object,
|
|
146
|
+
Function,
|
|
145
147
|
String,
|
|
146
148
|
Number,
|
|
147
149
|
null,
|
|
148
150
|
Boolean,
|
|
149
|
-
Array
|
|
150
|
-
Function
|
|
151
|
+
Array
|
|
151
152
|
],
|
|
152
153
|
required: false,
|
|
153
|
-
skipCheck: true,
|
|
154
154
|
default: void 0
|
|
155
155
|
},
|
|
156
156
|
expandIcon: {
|
|
157
157
|
type: [
|
|
158
|
+
Object,
|
|
159
|
+
Function,
|
|
158
160
|
String,
|
|
159
161
|
Number,
|
|
160
162
|
null,
|
|
161
163
|
Boolean,
|
|
162
|
-
Array
|
|
163
|
-
Function
|
|
164
|
+
Array
|
|
164
165
|
],
|
|
165
166
|
required: false,
|
|
166
|
-
skipCheck: true,
|
|
167
167
|
default: void 0
|
|
168
168
|
},
|
|
169
169
|
onItemClick: {
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
Object.
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
2
5
|
const require_rolldown_runtime = require("../_virtual/rolldown_runtime.cjs");
|
|
3
6
|
const require_IdContext = require("../context/IdContext.cjs");
|
|
4
7
|
let vue = require("vue");
|
|
5
|
-
let
|
|
6
|
-
|
|
7
|
-
var { LEFT, RIGHT, UP, DOWN, ENTER, ESC, HOME, END } =
|
|
8
|
+
let _v_c_util_dist_KeyCode = require("@v-c/util/dist/KeyCode");
|
|
9
|
+
_v_c_util_dist_KeyCode = require_rolldown_runtime.__toESM(_v_c_util_dist_KeyCode);
|
|
10
|
+
var { LEFT, RIGHT, UP, DOWN, ENTER, ESC, HOME, END } = _v_c_util_dist_KeyCode.default;
|
|
8
11
|
var ArrowKeys = [
|
|
9
12
|
UP,
|
|
10
13
|
DOWN,
|
package/dist/hooks/useActive.cjs
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
Object.
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
2
5
|
const require_rolldown_runtime = require("../_virtual/rolldown_runtime.cjs");
|
|
3
6
|
const require_MenuContext = require("../context/MenuContext.cjs");
|
|
4
7
|
let vue = require("vue");
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
Object.
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
2
5
|
const require_rolldown_runtime = require("../_virtual/rolldown_runtime.cjs");
|
|
3
6
|
const require_MenuContext = require("../context/MenuContext.cjs");
|
|
4
7
|
let vue = require("vue");
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
Object.
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
2
5
|
const require_rolldown_runtime = require("../_virtual/rolldown_runtime.cjs");
|
|
3
6
|
const require_timeUtil = require("../utils/timeUtil.cjs");
|
|
4
7
|
let vue = require("vue");
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
Object.
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
2
5
|
const require_rolldown_runtime = require("../_virtual/rolldown_runtime.cjs");
|
|
3
6
|
let vue = require("vue");
|
|
4
7
|
function useMemoCallback(callback) {
|
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
Object.
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
2
5
|
const require_PathContext = require("./context/PathContext.cjs");
|
|
3
6
|
const require_Divider = require("./Divider.cjs");
|
|
4
7
|
const require_MenuItem = require("./MenuItem.cjs");
|
package/dist/interface.cjs
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
package/dist/placements.cjs
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
1
2
|
const require_rolldown_runtime = require("../_virtual/rolldown_runtime.cjs");
|
|
2
3
|
let vue = require("vue");
|
|
3
|
-
let
|
|
4
|
+
let _v_c_util_dist_Children_toArray = require("@v-c/util/dist/Children/toArray");
|
|
4
5
|
function parseChildren(children, keyPath) {
|
|
5
|
-
return (0,
|
|
6
|
+
return (0, _v_c_util_dist_Children_toArray.toArray)(children).map((child, index) => {
|
|
6
7
|
if ((0, vue.isVNode)(child)) {
|
|
7
8
|
const key = child.key;
|
|
8
9
|
let eventKey = child.props?.eventKey ?? key;
|
package/dist/utils/nodeUtil.cjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
1
2
|
const require_rolldown_runtime = require("../_virtual/rolldown_runtime.cjs");
|
|
2
3
|
const require_Divider = require("../Divider.cjs");
|
|
3
4
|
const require_MenuItem = require("../MenuItem.cjs");
|
|
@@ -5,7 +6,7 @@ const require_commonUtil = require("./commonUtil.cjs");
|
|
|
5
6
|
const require_index = require("../SubMenu/index.cjs");
|
|
6
7
|
const require_MenuItemGroup = require("../MenuItemGroup.cjs");
|
|
7
8
|
let vue = require("vue");
|
|
8
|
-
let
|
|
9
|
+
let _v_c_util_dist_props_util = require("@v-c/util/dist/props-util");
|
|
9
10
|
function _isSlot(s) {
|
|
10
11
|
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !(0, vue.isVNode)(s);
|
|
11
12
|
}
|
|
@@ -13,14 +14,14 @@ function convertItemsToNodes(list, components, prefixCls, slots) {
|
|
|
13
14
|
const { item: MergedMenuItem, group: MergedMenuItemGroup, submenu: MergedSubMenu, divider: MergedDivider } = components;
|
|
14
15
|
return (list || []).map((opt, index) => {
|
|
15
16
|
if (opt && typeof opt === "object") {
|
|
16
|
-
const { children, key, type
|
|
17
|
+
const { children, key, type, ...restProps } = opt;
|
|
17
18
|
const mergedKey = key ?? `tmp-${index}`;
|
|
18
19
|
let label;
|
|
19
20
|
let extra;
|
|
20
21
|
const _labelRender = slots?.labelRender ? slots.labelRender(opt) : null;
|
|
21
22
|
const _extraRender = slots?.extraRender ? slots.extraRender(opt) : null;
|
|
22
|
-
const labelArr = (0,
|
|
23
|
-
const extraArr = (0,
|
|
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]);
|
|
24
25
|
if (labelArr.length) label = labelArr?.[0];
|
|
25
26
|
if (extraArr.length) extra = extraArr?.[0];
|
|
26
27
|
if (!label) label = opt.label;
|
package/dist/utils/nodeUtil.js
CHANGED
|
@@ -12,7 +12,7 @@ function convertItemsToNodes(list, components, prefixCls, slots) {
|
|
|
12
12
|
const { item: MergedMenuItem, group: MergedMenuItemGroup, submenu: MergedSubMenu, divider: MergedDivider } = components;
|
|
13
13
|
return (list || []).map((opt, index) => {
|
|
14
14
|
if (opt && typeof opt === "object") {
|
|
15
|
-
const { children, key, type
|
|
15
|
+
const { children, key, type, ...restProps } = opt;
|
|
16
16
|
const mergedKey = key ?? `tmp-${index}`;
|
|
17
17
|
let label;
|
|
18
18
|
let extra;
|
package/dist/utils/timeUtil.cjs
CHANGED
package/dist/utils/warnUtil.cjs
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
1
2
|
const require_rolldown_runtime = require("../_virtual/rolldown_runtime.cjs");
|
|
2
|
-
let
|
|
3
|
-
function warnItemProp({ item
|
|
3
|
+
let _v_c_util = require("@v-c/util");
|
|
4
|
+
function warnItemProp({ item, ...restInfo }) {
|
|
4
5
|
Object.defineProperty(restInfo, "item", { get: () => {
|
|
5
|
-
(0,
|
|
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.");
|
|
6
7
|
return item;
|
|
7
8
|
} });
|
|
8
9
|
return restInfo;
|
package/dist/utils/warnUtil.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { warning } from "@v-c/util";
|
|
2
|
-
function warnItemProp({ item
|
|
2
|
+
function warnItemProp({ item, ...restInfo }) {
|
|
3
3
|
Object.defineProperty(restInfo, "item", { get: () => {
|
|
4
4
|
warning(false, "`info.item` is deprecated since we will move to function component that not provides React Node instance in future.");
|
|
5
5
|
return item;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@v-c/menu",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.2",
|
|
5
5
|
"description": "menu ui component for vue",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
"vue": "^3.0.0"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@v-c/overflow": "^1.0.
|
|
29
|
-
"@v-c/trigger": "^1.0.
|
|
30
|
-
"@v-c/util": "^1.0.
|
|
28
|
+
"@v-c/overflow": "^1.0.1",
|
|
29
|
+
"@v-c/trigger": "^1.0.2",
|
|
30
|
+
"@v-c/util": "^1.0.5"
|
|
31
31
|
},
|
|
32
32
|
"scripts": {
|
|
33
33
|
"build": "vite build",
|