rappel-ui 1.0.38 → 1.0.40

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