rappel-ui 1.0.39 → 1.0.41
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/cjs/components/dropdown/src/dropdown-item.vue_vue_type_script_setup_true_lang.js +1 -1
- package/cjs/components/dropdown/src/dropdown.vue_vue_type_script_setup_true_lang.js +1 -1
- package/cjs/components/dropdown/src/types.d.ts +6 -6
- package/cjs/components/menu/index.d.ts +46 -4
- package/cjs/components/menu/src/loop.vue.d.ts +8 -3
- package/cjs/components/menu/src/loop.vue_vue_type_script_setup_true_lang.js +1 -1
- package/cjs/components/menu/src/menu-item.vue.d.ts +16 -2
- package/cjs/components/menu/src/menu-item.vue_vue_type_script_setup_true_lang.js +1 -1
- package/cjs/components/menu/src/menu.vue.d.ts +3 -1
- package/cjs/components/menu/src/menu.vue_vue_type_script_setup_true_lang.js +1 -1
- package/cjs/components/menu/src/submenu.vue_vue_type_script_setup_true_lang.js +1 -1
- package/cjs/components/menu/src/types.d.ts +17 -13
- package/cjs/components/popconfirm/src/popconfirm.vue_vue_type_script_setup_true_lang.js +1 -1
- package/cjs/components/popover/src/popover.vue_vue_type_script_setup_true_lang.js +1 -1
- package/cjs/components/tooltip/src/tooltip.vue_vue_type_script_setup_true_lang.js +1 -1
- package/cjs/composables/index.d.ts +1 -1
- package/cjs/composables/index.js +1 -1
- package/cjs/composables/{use-slot-node → use-slot-nodes}/index.d.ts +1 -0
- package/cjs/composables/use-slot-nodes/index.js +1 -0
- package/cjs/index.d.ts +44 -3
- package/cjs/index.js +1 -1
- package/dist/index.css +1 -1
- package/dist/index.umd.js +9 -9
- package/es/components/dropdown/src/dropdown-item.vue_vue_type_script_setup_true_lang.mjs +20 -20
- package/es/components/dropdown/src/dropdown.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/es/components/dropdown/src/types.d.ts +6 -6
- package/es/components/menu/index.d.ts +46 -4
- package/es/components/menu/src/loop.vue.d.ts +8 -3
- package/es/components/menu/src/loop.vue_vue_type_script_setup_true_lang.mjs +102 -13
- package/es/components/menu/src/menu-item.vue.d.ts +16 -2
- package/es/components/menu/src/menu-item.vue_vue_type_script_setup_true_lang.mjs +169 -195
- package/es/components/menu/src/menu.vue.d.ts +3 -1
- package/es/components/menu/src/menu.vue_vue_type_script_setup_true_lang.mjs +72 -60
- package/es/components/menu/src/submenu.vue_vue_type_script_setup_true_lang.mjs +73 -105
- package/es/components/menu/src/types.d.ts +17 -13
- package/es/components/popconfirm/src/popconfirm.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/es/components/popover/src/popover.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/es/components/tooltip/src/tooltip.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/es/composables/index.d.ts +1 -1
- package/es/composables/index.mjs +2 -2
- package/es/composables/{use-slot-node → use-slot-nodes}/index.d.ts +1 -0
- package/es/composables/use-slot-nodes/index.mjs +14 -0
- package/es/index.d.ts +44 -3
- package/es/index.mjs +70 -70
- package/package.json +2 -2
- package/theme-chalk/index.css +1 -1
- package/theme-chalk/re-menu.css +1 -1
- package/theme-chalk/src/menu.scss +12 -0
- package/cjs/composables/use-slot-node/index.js +0 -1
- package/es/composables/use-slot-node/index.mjs +0 -10
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { toPx as e } from "../../../utils/util.mjs";
|
|
2
2
|
import "../../../utils/index.mjs";
|
|
3
3
|
import { useNamespace as t } from "../../../composables/use-namespace/index.mjs";
|
|
4
|
-
import { useTheme as
|
|
4
|
+
import { useTheme as ee } from "../../../composables/use-theme/index.mjs";
|
|
5
5
|
import "../../../composables/index.mjs";
|
|
6
|
-
import { ReTooltip as
|
|
7
|
-
import { _menuProvideKey as
|
|
8
|
-
import
|
|
9
|
-
import { computed as
|
|
10
|
-
import { computedAsync as
|
|
11
|
-
import { ArrowDownward as
|
|
6
|
+
import { ReTooltip as te } from "../../tooltip/index.mjs";
|
|
7
|
+
import { _menuProvideKey as n } from "./constants.mjs";
|
|
8
|
+
import r from "./loop.mjs";
|
|
9
|
+
import { computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, createVNode as ne, defineComponent as u, inject as re, normalizeClass as d, normalizeStyle as f, onMounted as ie, openBlock as p, ref as ae, renderSlot as m, resolveDynamicComponent as h, toDisplayString as g, unref as _, useAttrs as oe, useSlots as se, useTemplateRef as ce, withCtx as v } from "vue";
|
|
10
|
+
import { computedAsync as y } from "@vueuse/core";
|
|
11
|
+
import { ArrowDownward as b, getAsyncIcon as x } from "@rappel-ui/svg-icons";
|
|
12
12
|
//#region packages/components/menu/src/menu-item.vue?vue&type=script&setup=true&lang.ts
|
|
13
|
-
var
|
|
13
|
+
var le = ["depth"], S = u({
|
|
14
14
|
name: "ReMenuItem",
|
|
15
15
|
__name: "menu-item",
|
|
16
16
|
props: {
|
|
@@ -26,207 +26,181 @@ var E = ["depth"], D = f({
|
|
|
26
26
|
default: () => void 0
|
|
27
27
|
},
|
|
28
28
|
icon: { default: "" },
|
|
29
|
-
subIcon: {
|
|
29
|
+
subIcon: {
|
|
30
|
+
type: [String, Boolean],
|
|
31
|
+
default: () => b
|
|
32
|
+
},
|
|
30
33
|
depth: { default: () => void 0 }
|
|
31
34
|
},
|
|
32
|
-
setup(
|
|
33
|
-
let { n:
|
|
35
|
+
setup(u, { expose: b }) {
|
|
36
|
+
let { n: S, nm: C, ns: w, is: T, has: ue } = t("menu"), E = i(() => {
|
|
34
37
|
var e, t;
|
|
35
|
-
return (e =
|
|
36
|
-
}),
|
|
37
|
-
e !==
|
|
38
|
-
label:
|
|
39
|
-
disabled:
|
|
40
|
-
value:
|
|
41
|
-
children:
|
|
42
|
-
hasChildren:
|
|
43
|
-
icon:
|
|
44
|
-
subIcon:
|
|
45
|
-
depth:
|
|
38
|
+
return (e = u.hasChildren) == null ? ((t = u.children) == null ? void 0 : t.length) > 0 : e;
|
|
39
|
+
}), D = i(() => !(E.value && !u.disabled)), O = oe(), k = ae(!1), { currentItem: de, theme: A, collapse: fe, cssDuration: j, depth: pe, offset: me, submenuOffset: he, closeOnSelect: M, direction: N, selectedKey: P, labelPadding: F, trigger: I, topSubMenusKeys: L, submenuClosers: R, select: z, showArrow: B, placement: V, registerDescendant: H } = re(n), ge = (e) => {
|
|
40
|
+
e !== u.value || E.value || u.disabled || z(u.value, {
|
|
41
|
+
label: u.label,
|
|
42
|
+
disabled: u.disabled,
|
|
43
|
+
value: u.value,
|
|
44
|
+
children: u.children,
|
|
45
|
+
hasChildren: u.hasChildren,
|
|
46
|
+
icon: u.icon,
|
|
47
|
+
subIcon: u.subIcon,
|
|
48
|
+
depth: X.value
|
|
46
49
|
}, !1);
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
label:
|
|
50
|
-
disabled:
|
|
51
|
-
value:
|
|
52
|
-
children:
|
|
53
|
-
hasChildren:
|
|
54
|
-
icon:
|
|
55
|
-
subIcon:
|
|
56
|
-
depth:
|
|
57
|
-
}),
|
|
50
|
+
}, _e = (e) => {
|
|
51
|
+
e.stopPropagation(), !(E.value || u.disabled || X.value === -1) && (z(u.value, {
|
|
52
|
+
label: u.label,
|
|
53
|
+
disabled: u.disabled,
|
|
54
|
+
value: u.value,
|
|
55
|
+
children: u.children,
|
|
56
|
+
hasChildren: u.hasChildren,
|
|
57
|
+
icon: u.icon,
|
|
58
|
+
subIcon: u.subIcon,
|
|
59
|
+
depth: X.value
|
|
60
|
+
}), M != null && M.value && (R == null || R.forEach((e) => {
|
|
58
61
|
var t;
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
}, F = C(async () => await T(f.icon)), I = C(async () => await T(f.subIcon)), L = a(() => {
|
|
65
|
-
var e;
|
|
66
|
-
return (N == null || (e = N.currentItem.value) == null ? void 0 : e.value) === f.value;
|
|
67
|
-
}), R = a(() => {
|
|
68
|
-
var e;
|
|
69
|
-
return N == null || (e = N.collapse) == null ? void 0 : e.value;
|
|
70
|
-
}), z = a(() => {
|
|
71
|
-
var e;
|
|
72
|
-
return N == null || (e = N.cssDuration) == null ? void 0 : e.value;
|
|
73
|
-
}), B = a(() => {
|
|
74
|
-
var e;
|
|
75
|
-
return N == null || (e = N.depth) == null ? void 0 : e.value;
|
|
76
|
-
}), V = a(() => {
|
|
77
|
-
var e;
|
|
78
|
-
return N == null || (e = N.offset) == null ? void 0 : e.value;
|
|
79
|
-
}), H = a(() => {
|
|
80
|
-
var e;
|
|
81
|
-
return N == null || (e = N.submenuOffset) == null ? void 0 : e.value;
|
|
82
|
-
}), U = a(() => {
|
|
83
|
-
var e;
|
|
84
|
-
return N == null || (e = N.closeOnSelect) == null ? void 0 : e.value;
|
|
85
|
-
}), W = a(() => {
|
|
62
|
+
return e == null || (t = e.close) == null ? void 0 : t.call(e);
|
|
63
|
+
})));
|
|
64
|
+
}, U = y(async () => await x(u.icon)), W = y(async () => await x(u.subIcon || "")), ve = i(() => {
|
|
86
65
|
var e;
|
|
87
|
-
return
|
|
88
|
-
}), G =
|
|
66
|
+
return ((e = de.value) == null ? void 0 : e.value) === u.value;
|
|
67
|
+
}), { currentTheme: G } = ee(A.value, D.value), K = i(() => [
|
|
68
|
+
S(),
|
|
69
|
+
C("tooltip"),
|
|
70
|
+
T(G.value, !!G.value)
|
|
71
|
+
]), ye = i(() => X.value === 0 && !(O != null && O["is-more"]) || X.value === -1 ? me.value : he.value), q = i(() => X.value === 0 && !(O != null && O["is-more"]) || X.value === -1), J = se(), be = i(() => !(J != null && J["item-submenu"]) && !E.value ? "hover" : I.value), Y = i(() => ({ "--menu-transition-duration": `${j.value}ms` })), xe = i(() => [{ padding: `0 ${e(F.value)}` }]), Se = i(() => [
|
|
72
|
+
w("item"),
|
|
73
|
+
T("disabled", u.disabled),
|
|
74
|
+
ue("children", E.value),
|
|
75
|
+
T("selected", ve.value)
|
|
76
|
+
]), X = i(() => {
|
|
89
77
|
var e;
|
|
90
|
-
return
|
|
91
|
-
}),
|
|
92
|
-
|
|
93
|
-
return N == null || (e = N.labelPadding) == null ? void 0 : e.value;
|
|
94
|
-
}), q = a(() => {
|
|
95
|
-
var e;
|
|
96
|
-
return N == null || (e = N.trigger) == null ? void 0 : e.value;
|
|
97
|
-
}), J = a(() => N.theme.value), { currentTheme: Y } = n(J.value, j.value), X = a(() => ({ "--menu-transition-duration": `${z.value}ms` })), ie = a(() => [{ padding: `0 ${e(K.value)}` }]), ae = a(() => [
|
|
98
|
-
O("item"),
|
|
99
|
-
k("disabled", f.disabled),
|
|
100
|
-
ne("children", A.value),
|
|
101
|
-
k("selected", L.value)
|
|
102
|
-
]), Z = a(() => {
|
|
103
|
-
var e;
|
|
104
|
-
return (e = f.depth) == null ? B.value : e;
|
|
105
|
-
}), oe = a(typeof (N == null ? void 0 : N.placement) == "function" ? () => {
|
|
106
|
-
var e;
|
|
107
|
-
return N == null || (e = N.placement) == null ? void 0 : e.call(N, W.value, Z.value, A.value);
|
|
108
|
-
} : () => W.value === "vertical" ? Z.value === 0 ? "right" : "right-start" : Z.value === 0 ? "bottom" : "right-start"), se = a(() => W.value === "vertical" ? !R.value || !A.value && Z.value !== 0 || A.value && Z.value !== 0 && f.disabled : f.disabled || !A.value), ce = a(typeof (N == null ? void 0 : N.showArrow) == "function" ? () => {
|
|
109
|
-
var e;
|
|
110
|
-
return N == null || (e = N.showArrow) == null ? void 0 : e.call(N, Z.value);
|
|
111
|
-
} : () => Z.value === 0);
|
|
112
|
-
if (U.value && !f.disabled) {
|
|
113
|
-
var Q;
|
|
78
|
+
return (e = u.depth) == null ? pe.value : e;
|
|
79
|
+
}), Z = i(typeof V == "function" ? () => V(N.value, X.value, E.value) : () => N.value === "vertical" ? X.value === 0 ? "right" : "right-start" : X.value === -1 ? "bottom-end" : X.value === 0 && !(O != null && O["is-more"]) ? "bottom" : "right-start"), Ce = i(() => N.value === "vertical" ? !fe.value || !E.value && X.value !== 0 || E.value && X.value !== 0 && u.disabled : u.disabled || !E.value), Q = i(typeof B == "function" ? () => B(X.value) : () => X.value === 0 && !(O != null && O["is-more"]));
|
|
80
|
+
if (M.value && !u.disabled) {
|
|
114
81
|
let e = {
|
|
115
|
-
value:
|
|
82
|
+
value: u.value,
|
|
116
83
|
close: () => {
|
|
117
|
-
|
|
84
|
+
k.value = !1;
|
|
118
85
|
}
|
|
119
86
|
};
|
|
120
|
-
|
|
121
|
-
var $;
|
|
122
|
-
N == null || ($ = N.submenuClosers) == null || $.push(e);
|
|
123
|
-
}
|
|
87
|
+
R.some((e) => e.value === u.value) || R.push(e);
|
|
124
88
|
}
|
|
125
|
-
let
|
|
126
|
-
if (
|
|
89
|
+
let we = () => {
|
|
90
|
+
if (X.value === 0 && E.value) {
|
|
127
91
|
var e;
|
|
128
|
-
|
|
92
|
+
(e = L.value) == null || e.push(u.value);
|
|
129
93
|
}
|
|
130
|
-
};
|
|
131
|
-
return
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
}, [
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
"
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
94
|
+
}, $ = ce("itemRef");
|
|
95
|
+
return ie(() => {
|
|
96
|
+
H == null || H(u.value), we(), ge(P == null ? void 0 : P.value);
|
|
97
|
+
}), b({
|
|
98
|
+
itemRef: $,
|
|
99
|
+
hasChild: E,
|
|
100
|
+
showArrow: Q,
|
|
101
|
+
placement: Z,
|
|
102
|
+
visible: k,
|
|
103
|
+
value: u.value,
|
|
104
|
+
label: u.label,
|
|
105
|
+
disabled: u.disabled,
|
|
106
|
+
icon: u.icon,
|
|
107
|
+
subIcon: u.subIcon,
|
|
108
|
+
depth: X.value,
|
|
109
|
+
children: u.children
|
|
110
|
+
}), (e, t) => (p(), s("li", {
|
|
111
|
+
ref_key: "itemRef",
|
|
112
|
+
ref: $,
|
|
113
|
+
class: d(Se.value),
|
|
114
|
+
depth: X.value,
|
|
115
|
+
onClick: _e
|
|
116
|
+
}, [ne(_(te), {
|
|
117
|
+
visible: k.value,
|
|
118
|
+
"onUpdate:visible": t[0] || (t[0] = (e) => k.value = e),
|
|
119
|
+
"floating-class": [E.value && !u.disabled ? _(C)("tooltip") : _(C)("cover"), _(T)("disabled", u.disabled)],
|
|
120
|
+
disabled: Ce.value,
|
|
121
|
+
teleported: q.value,
|
|
122
|
+
placement: Z.value,
|
|
123
|
+
"show-arrow": Q.value,
|
|
124
|
+
theme: _(A),
|
|
125
|
+
"reverse-theme": D.value,
|
|
126
|
+
"css-duration": _(j),
|
|
127
|
+
transform: !1,
|
|
128
|
+
offset: ye.value,
|
|
129
|
+
transition: "menu",
|
|
130
|
+
trigger: be.value
|
|
131
|
+
}, {
|
|
132
|
+
content: v(() => {
|
|
133
|
+
var t;
|
|
134
|
+
return [(t = e.$slots) != null && t["item-submenu"] && !u.disabled ? (p(), a(r, {
|
|
135
|
+
key: 0,
|
|
136
|
+
class: d(K.value),
|
|
137
|
+
"is-more": e.$attrs["is-more"],
|
|
138
|
+
style: f(Y.value)
|
|
139
|
+
}, {
|
|
140
|
+
default: v(() => [m(e.$slots, "item-submenu")]),
|
|
141
|
+
_: 3
|
|
142
|
+
}, 8, [
|
|
143
|
+
"class",
|
|
144
|
+
"is-more",
|
|
145
|
+
"style"
|
|
146
|
+
])) : E.value && !u.disabled ? (p(), a(r, {
|
|
147
|
+
key: 1,
|
|
148
|
+
class: d(K.value),
|
|
149
|
+
style: f(Y.value),
|
|
150
|
+
"is-more": e.$attrs["is-more"],
|
|
151
|
+
options: u.children
|
|
152
|
+
}, null, 8, [
|
|
153
|
+
"class",
|
|
154
|
+
"style",
|
|
155
|
+
"is-more",
|
|
156
|
+
"options"
|
|
157
|
+
])) : m(e.$slots, "default", {}, () => [l(g(u.label), 1)], void 0, 2)];
|
|
158
|
+
}),
|
|
159
|
+
default: v(() => [c("div", {
|
|
160
|
+
class: d([_(w)("label-wrap")]),
|
|
161
|
+
style: f(xe.value),
|
|
162
|
+
tabindex: "0"
|
|
163
|
+
}, [
|
|
164
|
+
m(e.$slots, "icon", {}, () => [u.icon ? (p(), s("div", {
|
|
165
|
+
key: 0,
|
|
166
|
+
class: d([_(w)("icon")])
|
|
167
|
+
}, [typeof _(U) == "string" ? (p(), s("i", {
|
|
168
|
+
key: 0,
|
|
169
|
+
class: d([_(U)]),
|
|
170
|
+
"aria-hidden": "true"
|
|
171
|
+
}, null, 2)) : (p(), a(h(_(U)), {
|
|
172
|
+
key: 1,
|
|
173
|
+
"aria-hidden": "true"
|
|
174
|
+
}))], 2)) : o("", !0)]),
|
|
175
|
+
c("div", { class: d([_(w)("label")]) }, [m(e.$slots, "default", {}, () => [l(g(u.label), 1)])], 2),
|
|
176
|
+
m(e.$slots, "sub-icon", {}, () => [u.subIcon && E.value ? (p(), s("div", {
|
|
177
|
+
key: 0,
|
|
178
|
+
class: d([_(w)("subicon")])
|
|
179
|
+
}, [typeof _(W) == "string" ? (p(), s("i", {
|
|
180
|
+
key: 0,
|
|
181
|
+
class: d([_(W), _(S)("svg-icon")]),
|
|
182
|
+
"aria-hidden": "true"
|
|
183
|
+
}, null, 2)) : (p(), a(h(_(W)), {
|
|
184
|
+
key: 1,
|
|
185
|
+
class: d([_(S)("svg-icon")]),
|
|
186
|
+
"aria-hidden": "true"
|
|
187
|
+
}, null, 8, ["class"]))], 2)) : o("", !0)])
|
|
188
|
+
], 6)]),
|
|
189
|
+
_: 3
|
|
190
|
+
}, 8, [
|
|
191
|
+
"visible",
|
|
192
|
+
"floating-class",
|
|
193
|
+
"disabled",
|
|
194
|
+
"teleported",
|
|
195
|
+
"placement",
|
|
196
|
+
"show-arrow",
|
|
197
|
+
"theme",
|
|
198
|
+
"reverse-theme",
|
|
199
|
+
"css-duration",
|
|
200
|
+
"offset",
|
|
201
|
+
"trigger"
|
|
202
|
+
]), m(e.$slots, "submenu")], 10, le));
|
|
229
203
|
}
|
|
230
204
|
});
|
|
231
205
|
//#endregion
|
|
232
|
-
export {
|
|
206
|
+
export { S as default };
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { MenuProps, MenuOption } from './types';
|
|
2
2
|
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
3
|
-
declare var __VLS_8: {};
|
|
3
|
+
declare var __VLS_8: {}, __VLS_11: {};
|
|
4
4
|
type __VLS_Slots = {} & {
|
|
5
5
|
default?: (props: typeof __VLS_8) => any;
|
|
6
|
+
} & {
|
|
7
|
+
'ellipsis-icon'?: (props: typeof __VLS_11) => any;
|
|
6
8
|
};
|
|
7
9
|
declare const __VLS_base: DefineComponent<MenuProps, {
|
|
8
10
|
select: (value: any, item: MenuOption, exeEmit?: boolean) => void;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { normalizeOptions as e } from "../../../utils/util.mjs";
|
|
1
|
+
import { normalizeOptions as e, toPx as t } from "../../../utils/util.mjs";
|
|
2
2
|
import "../../../utils/index.mjs";
|
|
3
|
-
import { useNamespace as
|
|
4
|
-
import { useTheme as
|
|
3
|
+
import { useNamespace as n } from "../../../composables/use-namespace/index.mjs";
|
|
4
|
+
import { useTheme as r } from "../../../composables/use-theme/index.mjs";
|
|
5
5
|
import "../../../composables/index.mjs";
|
|
6
|
-
import { _menuProvideKey as
|
|
7
|
-
import
|
|
8
|
-
import { useMenuEmits as
|
|
9
|
-
import { computed as
|
|
6
|
+
import { _menuProvideKey as i } from "./constants.mjs";
|
|
7
|
+
import a from "./loop.mjs";
|
|
8
|
+
import { useMenuEmits as o } from "./use-menu-emit.mjs";
|
|
9
|
+
import { computed as s, createBlock as c, defineComponent as l, normalizeClass as u, normalizeStyle as d, openBlock as f, provide as p, ref as m, renderSlot as h, withCtx as g } from "vue";
|
|
10
|
+
import { MoreDotCircleHorizontal as _ } from "@rappel-ui/svg-icons";
|
|
10
11
|
//#region packages/components/menu/src/menu.vue?vue&type=script&setup=true&lang.ts
|
|
11
|
-
var
|
|
12
|
+
var v = l({
|
|
12
13
|
name: "ReMenu",
|
|
13
14
|
__name: "menu",
|
|
14
15
|
props: {
|
|
@@ -22,6 +23,10 @@ var g = c({
|
|
|
22
23
|
type: Boolean,
|
|
23
24
|
default: !1
|
|
24
25
|
},
|
|
26
|
+
ellipsis: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: !0
|
|
29
|
+
},
|
|
25
30
|
offset: { default: 10 },
|
|
26
31
|
submenuOffset: { default: () => ({
|
|
27
32
|
mainAxis: 0,
|
|
@@ -40,6 +45,7 @@ var g = c({
|
|
|
40
45
|
default: !1
|
|
41
46
|
},
|
|
42
47
|
trigger: { default: "hover" },
|
|
48
|
+
ellipsisIcon: { default: () => _ },
|
|
43
49
|
placement: {
|
|
44
50
|
type: Function,
|
|
45
51
|
default: void 0
|
|
@@ -50,63 +56,69 @@ var g = c({
|
|
|
50
56
|
}
|
|
51
57
|
},
|
|
52
58
|
emits: ["select"],
|
|
53
|
-
setup(
|
|
54
|
-
let { select:
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
]),
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
setup(l, { expose: _, emit: v }) {
|
|
60
|
+
let { select: y } = o(v), { n: b, nm: x, is: S } = n("menu"), { currentTheme: C } = r(l.theme, !1), w = s(() => [
|
|
61
|
+
b(),
|
|
62
|
+
S(C.value, !!C.value),
|
|
63
|
+
S("collapse", l.collapse),
|
|
64
|
+
x(l.direction)
|
|
65
|
+
]), T = s(() => ({
|
|
66
|
+
"--menu-transition-duration": `${l.cssDuration}ms`,
|
|
67
|
+
[`--${b("menu-label-padding")}`]: l.direction === "vertical" && l.collapse ? t(l.labelPadding) : void 0
|
|
68
|
+
})), E = m(null), D = (e, t, n = !0) => {
|
|
69
|
+
t.disabled || (E.value = t, n && (y(e, t), R.value = void 0), M(e));
|
|
70
|
+
}, O = Object.assign({}, {
|
|
62
71
|
label: "label",
|
|
63
72
|
value: "value",
|
|
64
73
|
disabled: "disabled",
|
|
65
74
|
children: "children"
|
|
66
|
-
},
|
|
75
|
+
}, l.mapper || {}), k = (e) => ({
|
|
67
76
|
...e,
|
|
68
|
-
label: e[
|
|
69
|
-
value: e[
|
|
70
|
-
disabled: e[
|
|
71
|
-
children: e[
|
|
72
|
-
}),
|
|
73
|
-
|
|
74
|
-
},
|
|
75
|
-
let t =
|
|
76
|
-
t > -1 &&
|
|
77
|
-
},
|
|
78
|
-
return
|
|
79
|
-
select:
|
|
80
|
-
currentItem:
|
|
81
|
-
cssDuration:
|
|
82
|
-
transition:
|
|
83
|
-
collapse:
|
|
84
|
-
submenuSubscribers:
|
|
85
|
-
broadcastSelect:
|
|
86
|
-
unsubscribeSubmenu:
|
|
87
|
-
depth:
|
|
88
|
-
hasOptions:
|
|
89
|
-
openedKeys:
|
|
90
|
-
offset:
|
|
91
|
-
submenuOffset:
|
|
92
|
-
closeOnSelect:
|
|
93
|
-
submenuClosers:
|
|
94
|
-
direction:
|
|
95
|
-
selectedKey:
|
|
96
|
-
indent:
|
|
97
|
-
labelPadding:
|
|
98
|
-
accordion:
|
|
99
|
-
topSubMenusKeys:
|
|
100
|
-
trigger:
|
|
101
|
-
placement:
|
|
102
|
-
showArrow:
|
|
103
|
-
theme:
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
77
|
+
label: e[O.label],
|
|
78
|
+
value: e[O.value],
|
|
79
|
+
disabled: e[O.disabled],
|
|
80
|
+
children: e[O.children]
|
|
81
|
+
}), A = s(() => e(l.options, k)), j = [], M = (e) => {
|
|
82
|
+
j.forEach((t) => t.onSelectChange(e));
|
|
83
|
+
}, N = (e) => {
|
|
84
|
+
let t = j.indexOf(e);
|
|
85
|
+
t > -1 && j.splice(t, 1);
|
|
86
|
+
}, P = m(0), F = m(l.openedKeys), I = m([]), L = [], R = m(l.selectedKey);
|
|
87
|
+
return p(i, {
|
|
88
|
+
select: D,
|
|
89
|
+
currentItem: E,
|
|
90
|
+
cssDuration: s(() => l.cssDuration),
|
|
91
|
+
transition: s(() => l.transition),
|
|
92
|
+
collapse: s(() => l.collapse),
|
|
93
|
+
submenuSubscribers: j,
|
|
94
|
+
broadcastSelect: M,
|
|
95
|
+
unsubscribeSubmenu: N,
|
|
96
|
+
depth: P,
|
|
97
|
+
hasOptions: s(() => !!l.options),
|
|
98
|
+
openedKeys: F,
|
|
99
|
+
offset: s(() => l.offset),
|
|
100
|
+
submenuOffset: s(() => l.submenuOffset),
|
|
101
|
+
closeOnSelect: s(() => l.closeOnSelect),
|
|
102
|
+
submenuClosers: L,
|
|
103
|
+
direction: s(() => l.direction),
|
|
104
|
+
selectedKey: R,
|
|
105
|
+
indent: s(() => l.indent),
|
|
106
|
+
labelPadding: s(() => l.labelPadding),
|
|
107
|
+
accordion: s(() => l.accordion),
|
|
108
|
+
topSubMenusKeys: I,
|
|
109
|
+
trigger: s(() => l.trigger),
|
|
110
|
+
placement: l.placement,
|
|
111
|
+
showArrow: l.showArrow,
|
|
112
|
+
theme: s(() => l.theme),
|
|
113
|
+
ellipsis: s(() => l.ellipsis),
|
|
114
|
+
ellipsisIcon: s(() => l.ellipsisIcon)
|
|
115
|
+
}), _({ select: D }), (e, t) => (f(), c(a, {
|
|
116
|
+
class: u(w.value),
|
|
117
|
+
style: d(T.value),
|
|
118
|
+
options: l.options ? A.value : void 0
|
|
108
119
|
}, {
|
|
109
|
-
|
|
120
|
+
"ellipsis-icon": g(() => [h(e.$slots, "ellipsis-icon")]),
|
|
121
|
+
default: g(() => [h(e.$slots, "default")]),
|
|
110
122
|
_: 3
|
|
111
123
|
}, 8, [
|
|
112
124
|
"class",
|
|
@@ -116,4 +128,4 @@ var g = c({
|
|
|
116
128
|
}
|
|
117
129
|
});
|
|
118
130
|
//#endregion
|
|
119
|
-
export {
|
|
131
|
+
export { v as default };
|