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
@@ -24,7 +24,10 @@ var E = ["depth"], D = p({
24
24
  default: () => void 0
25
25
  },
26
26
  icon: { default: "" },
27
- subIcon: { default: () => w },
27
+ subIcon: {
28
+ type: [String, Boolean],
29
+ default: () => w
30
+ },
28
31
  depth: { default: () => void 0 }
29
32
  },
30
33
  setup(p) {
@@ -37,12 +40,9 @@ var E = ["depth"], D = p({
37
40
  k("children", A.value)
38
41
  ]), M = o(() => {
39
42
  var e;
40
- return (e = p.depth) == null ? F.value : e;
41
- }), N = o(() => !A.value || p.disabled), P = m(r, null), F = o(() => P == null ? void 0 : P.depth.value), I = o(() => P.theme.value), L = o(() => P.reverseTheme.value), R = o(() => {
42
- var e;
43
- return P == null || (e = P.submenuOffset) == null ? void 0 : e.value;
44
- }), z = (e) => {
45
- e.stopPropagation(), !(A.value || p.disabled) && (P == null || P.select(p.value, {
43
+ return (e = p.depth) == null ? P.value : e;
44
+ }), N = o(() => !A.value || p.disabled), { depth: P, theme: F, reverseTheme: I, submenuOffset: L, select: R } = m(r), z = (e) => {
45
+ e.stopPropagation(), !(A.value || p.disabled) && R(p.value, {
46
46
  label: p.label,
47
47
  disabled: p.disabled,
48
48
  value: p.value,
@@ -51,12 +51,12 @@ var E = ["depth"], D = p({
51
51
  icon: p.icon,
52
52
  subIcon: p.subIcon,
53
53
  depth: M.value
54
- }));
55
- }, B = C(async () => await T(p.icon)), V = C(async () => await T(p.subIcon)), H = x("tooltipRef"), U = o(() => {
54
+ });
55
+ }, B = C(async () => await T(p.icon)), V = C(async () => await T(p.subIcon || "")), H = x("tooltipRef"), U = o(() => {
56
56
  var e;
57
57
  let t = (e = H.value) == null ? void 0 : e.floatingPlacement;
58
58
  return [{ "transform-origin": i[t] }];
59
- }), { currentTheme: W } = t(I.value, L.value);
59
+ }), { currentTheme: W } = t(F.value, I.value);
60
60
  return (e, t) => (g(), l("li", {
61
61
  class: h(j.value),
62
62
  depth: M.value,
@@ -72,9 +72,9 @@ var E = ["depth"], D = p({
72
72
  "show-arrow": !1,
73
73
  transform: !1,
74
74
  transition: "dropdown",
75
- offset: R.value,
76
- theme: I.value,
77
- "reverse-theme": L.value
75
+ offset: b(L),
76
+ theme: b(F),
77
+ "reverse-theme": b(I)
78
78
  }, {
79
79
  content: S(() => {
80
80
  var t;
@@ -91,29 +91,29 @@ var E = ["depth"], D = p({
91
91
  }, null, 8, ["class", "options"])) : _(e.$slots, "default", {}, () => [d(y(p.label), 1)], void 0, 2)];
92
92
  }),
93
93
  default: S(() => [u("div", { class: h([b(D)("label-wrap")]) }, [
94
- p.icon ? (g(), l("div", {
94
+ _(e.$slots, "icon", {}, () => [p.icon ? (g(), l("div", {
95
95
  key: 0,
96
96
  class: h([b(D)("icon")])
97
- }, [_(e.$slots, "icon", {}, () => [typeof b(B) == "string" ? (g(), l("i", {
97
+ }, [typeof b(B) == "string" ? (g(), l("i", {
98
98
  key: 0,
99
99
  class: h([b(B)]),
100
100
  "aria-hidden": "true"
101
101
  }, null, 2)) : (g(), s(v(b(B)), {
102
102
  key: 1,
103
103
  "aria-hidden": "true"
104
- }))])], 2)) : c("", !0),
104
+ }))], 2)) : c("", !0)]),
105
105
  u("div", { class: h([b(D)("label")]) }, [_(e.$slots, "default", {}, () => [d(y(p.label), 1)])], 2),
106
- p.subIcon && A.value ? (g(), l("div", {
107
- key: 1,
106
+ _(e.$slots, "sub-icon", {}, () => [p.subIcon && A.value ? (g(), l("div", {
107
+ key: 0,
108
108
  class: h([b(D)("subicon")])
109
- }, [_(e.$slots, "sub-icon", {}, () => [typeof b(V) == "string" ? (g(), l("i", {
109
+ }, [typeof b(V) == "string" ? (g(), l("i", {
110
110
  key: 0,
111
111
  class: h([b(V)]),
112
112
  "aria-hidden": "true"
113
113
  }, null, 2)) : (g(), s(v(b(V)), {
114
114
  key: 1,
115
115
  "aria-hidden": "true"
116
- }))])], 2)) : c("", !0)
116
+ }))], 2)) : c("", !0)])
117
117
  ], 2)]),
118
118
  _: 3
119
119
  }, 8, [
@@ -1,7 +1,7 @@
1
1
  import { normalizeOptions 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 { useSlotFirstNode as n } from "../../../composables/use-slot-node/index.mjs";
4
+ import { useSlotFirstNode as n } from "../../../composables/use-slot-nodes/index.mjs";
5
5
  import "../../../composables/index.mjs";
6
6
  import { ReTooltip as r } from "../../tooltip/index.mjs";
7
7
  import { _dropdownProvideKey as i, originsMap as a } from "./constants.mjs";
@@ -91,7 +91,10 @@ var C = d({
91
91
  default: !0
92
92
  },
93
93
  cssDuration: { default: 300 },
94
- appear: { type: Boolean },
94
+ appear: {
95
+ type: Boolean,
96
+ default: !0
97
+ },
95
98
  arrowSize: { default: 8 },
96
99
  arrowOffset: { default: 4 },
97
100
  arrowOptions: { default: () => void 0 },
@@ -181,6 +184,7 @@ var C = d({
181
184
  "hide-delay": d.hideDelay,
182
185
  transition: d.transition,
183
186
  "css-duration": d.cssDuration,
187
+ appear: d.appear,
184
188
  "css-transition": d.cssTransition,
185
189
  transform: !1,
186
190
  "show-arrow": d.showArrow,
@@ -217,7 +221,7 @@ var C = d({
217
221
  }, null, 8, ["options"])) : u("", !0)])]),
218
222
  default: S(() => [(p(), l(_(L.value)))]),
219
223
  _: 3
220
- }, 8, "visible.width.height.max-width.max-height.floating-class.floating-style.disabled.theme.placement.trigger.reverse-theme.show-delay.hide-delay.transition.css-duration.css-transition.show-arrow.offset.teleported.append-to.persistent.boundary.element-context.alt-boundary.root-boundary.arrow-size.arrow-offset.flip-offset.arrow-options.flip-options.inline-options.is-external.external-ref.is-virtual.virtual-ref.onBeforeEnter.onEnter.onAfterEnter.onBeforeLeave.onLeave.onAfterLeave.onEnterCancelled.onLeaveCancelled".split(".")));
224
+ }, 8, "visible.width.height.max-width.max-height.floating-class.floating-style.disabled.theme.placement.trigger.reverse-theme.show-delay.hide-delay.transition.css-duration.appear.css-transition.show-arrow.offset.teleported.append-to.persistent.boundary.element-context.alt-boundary.root-boundary.arrow-size.arrow-offset.flip-offset.arrow-options.flip-options.inline-options.is-external.external-ref.is-virtual.virtual-ref.onBeforeEnter.onEnter.onAfterEnter.onBeforeLeave.onLeave.onAfterLeave.onEnterCancelled.onLeaveCancelled".split(".")));
221
225
  }
222
226
  });
223
227
  //#endregion
@@ -19,17 +19,17 @@ export interface DropdownOption {
19
19
  children?: DropdownOption[];
20
20
  hasChildren?: boolean;
21
21
  icon?: string | Component;
22
- subIcon?: string | Component;
22
+ subIcon?: string | Component | false;
23
23
  depth?: number;
24
24
  }
25
25
  export interface DropdownProvides {
26
26
  select: (value: any, item: DropdownOption) => void;
27
27
  depth: Ref<number>;
28
- hasOptions?: ComputedRef<boolean>;
29
- cssDuration?: ComputedRef<number>;
30
- theme?: ComputedRef<Theme>;
31
- reverseTheme?: ComputedRef<boolean>;
32
- submenuOffset?: ComputedRef<OffsetOptions>;
28
+ hasOptions: ComputedRef<boolean>;
29
+ cssDuration: ComputedRef<number>;
30
+ theme: ComputedRef<Theme>;
31
+ reverseTheme: ComputedRef<boolean>;
32
+ submenuOffset: ComputedRef<OffsetOptions>;
33
33
  }
34
34
  export interface DropdownSubmenuProps {
35
35
  item?: DropdownOption;
@@ -1,5 +1,6 @@
1
- import { CreateComponentPublicInstanceWithMixins, ComponentOptionsMixin, PublicProps, GlobalComponents, GlobalDirectives, ComponentProvideOptions, ComponentOptionsBase, VNodeProps, AllowedComponentProps, ComponentCustomProps } from 'vue';
1
+ import { CreateComponentPublicInstanceWithMixins, ComponentOptionsMixin, PublicProps, GlobalComponents, GlobalDirectives, ComponentProvideOptions, ComponentOptionsBase, VNodeProps, AllowedComponentProps, ComponentCustomProps, ShallowRef, ComputedRef, Ref, Component } from 'vue';
2
2
  import { MenuProps, MenuOption, SubmenuProps } from './index.ts';
3
+ import { Placement } from '@floating-ui/vue';
3
4
  export * from './src/types.ts';
4
5
  export * from './src/use-menu-emit.ts';
5
6
  export declare const ReMenu: {
@@ -33,6 +34,8 @@ export declare const ReMenu: {
33
34
  }, string, {}, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & VNodeProps & AllowedComponentProps & ComponentCustomProps & (new () => {
34
35
  $slots: {
35
36
  default?: (props: {}) => any;
37
+ } & {
38
+ 'ellipsis-icon'?: (props: {}) => any;
36
39
  };
37
40
  });
38
41
  export declare const ReSubmenu: {
@@ -57,18 +60,57 @@ export declare const ReSubmenu: {
57
60
  };
58
61
  });
59
62
  export declare const ReMenuItem: {
60
- new (...args: any[]): CreateComponentPublicInstanceWithMixins<Readonly< MenuOption> & Readonly<{}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {}, false, {}, {}, GlobalComponents, GlobalDirectives, string, {}, any, ComponentProvideOptions, {
63
+ new (...args: any[]): CreateComponentPublicInstanceWithMixins<Readonly< MenuOption> & Readonly<{}>, {
64
+ itemRef: Readonly< ShallowRef<HTMLLIElement | null, HTMLLIElement | null>>;
65
+ hasChild: ComputedRef<boolean>;
66
+ showArrow: ComputedRef<boolean>;
67
+ placement: ComputedRef<Placement>;
68
+ visible: Ref<boolean, boolean>;
69
+ value: any;
70
+ label: string | undefined;
71
+ disabled: boolean | undefined;
72
+ icon: string | Component;
73
+ subIcon: string | false | Component | undefined;
74
+ depth: number;
75
+ children: MenuOption[];
76
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {}, false, {}, {}, GlobalComponents, GlobalDirectives, string, {}, any, ComponentProvideOptions, {
61
77
  P: {};
62
78
  B: {};
63
79
  D: {};
64
80
  C: {};
65
81
  M: {};
66
82
  Defaults: {};
67
- }, Readonly< MenuOption> & Readonly<{}>, {}, {}, {}, {}, {}>;
83
+ }, Readonly< MenuOption> & Readonly<{}>, {
84
+ itemRef: Readonly< ShallowRef<HTMLLIElement | null, HTMLLIElement | null>>;
85
+ hasChild: ComputedRef<boolean>;
86
+ showArrow: ComputedRef<boolean>;
87
+ placement: ComputedRef<Placement>;
88
+ visible: Ref<boolean, boolean>;
89
+ value: any;
90
+ label: string | undefined;
91
+ disabled: boolean | undefined;
92
+ icon: string | Component;
93
+ subIcon: string | false | Component | undefined;
94
+ depth: number;
95
+ children: MenuOption[];
96
+ }, {}, {}, {}, {}>;
68
97
  __isFragment?: never;
69
98
  __isTeleport?: never;
70
99
  __isSuspense?: never;
71
- } & ComponentOptionsBase<Readonly< MenuOption> & Readonly<{}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {}, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & VNodeProps & AllowedComponentProps & ComponentCustomProps & (new () => {
100
+ } & ComponentOptionsBase<Readonly< MenuOption> & Readonly<{}>, {
101
+ itemRef: Readonly< ShallowRef<HTMLLIElement | null, HTMLLIElement | null>>;
102
+ hasChild: ComputedRef<boolean>;
103
+ showArrow: ComputedRef<boolean>;
104
+ placement: ComputedRef<Placement>;
105
+ visible: Ref<boolean, boolean>;
106
+ value: any;
107
+ label: string | undefined;
108
+ disabled: boolean | undefined;
109
+ icon: string | Component;
110
+ subIcon: string | false | Component | undefined;
111
+ depth: number;
112
+ children: MenuOption[];
113
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {}, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & VNodeProps & AllowedComponentProps & ComponentCustomProps & (new () => {
72
114
  $slots: {
73
115
  icon?: (props: {}) => any;
74
116
  } & {
@@ -1,13 +1,18 @@
1
1
  import { MenuOption } from './types';
2
- import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
+ import { DefineComponent, ShallowRef, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
3
3
  type __VLS_Props = {
4
4
  options?: MenuOption[];
5
5
  };
6
- declare var __VLS_1: {};
6
+ declare var __VLS_1: {}, __VLS_28: {};
7
7
  type __VLS_Slots = {} & {
8
8
  default?: (props: typeof __VLS_1) => any;
9
+ } & {
10
+ 'ellipsis-icon'?: (props: typeof __VLS_28) => any;
9
11
  };
10
- declare const __VLS_base: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
12
+ declare const __VLS_base: DefineComponent<__VLS_Props, {
13
+ loopRef: Readonly< ShallowRef<HTMLUListElement | null>>;
14
+ update: () => Promise<void>;
15
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
11
16
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
12
17
  declare const _default: typeof __VLS_export;
13
18
  export default _default;
@@ -1,22 +1,117 @@
1
- import e from "./menu-item.mjs";
2
- import t from "./submenu.mjs";
3
- import { Fragment as n, createBlock as r, createElementBlock as i, defineComponent as a, mergeProps as o, openBlock as s, renderList as c, renderSlot as l } from "vue";
1
+ import { useSlotNodes as e } from "../../../composables/use-slot-nodes/index.mjs";
2
+ import "../../../composables/index.mjs";
3
+ import { _menuProvideKey as t } from "./constants.mjs";
4
+ import n from "./menu-item.mjs";
5
+ import r from "./submenu.mjs";
6
+ import { Fragment as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createSlots as l, defineComponent as u, inject as d, mergeProps as f, nextTick as p, onMounted as m, onUnmounted as h, openBlock as g, renderList as _, renderSlot as v, resolveDynamicComponent as y, shallowRef as b, unref as x, useSlots as S, useTemplateRef as C, watch as w, withCtx as T } from "vue";
7
+ import { computedAsync as E, useDebounceFn as D, useElementSize as O } from "@vueuse/core";
8
+ import { getAsyncIcon as k } from "@rappel-ui/svg-icons";
4
9
  //#region packages/components/menu/src/loop.vue?vue&type=script&setup=true&lang.ts
5
- var u = a({
10
+ var A = u({
6
11
  __name: "loop",
7
12
  props: { options: { default: () => void 0 } },
8
- setup(a) {
9
- return (u, d) => (s(), i("ul", null, [l(u.$slots, "default", {}, () => [(s(!0), i(n, null, c(a.options, (a) => {
10
- var c;
11
- return s(), i(n, { key: typeof a.value == "boolean" ? a.label : a.value }, [a != null && (c = a.children) != null && c.length ? (s(), r(t, {
13
+ setup(u, { expose: A }) {
14
+ let j = C("loopRef"), M = C("moreRef"), N = b([]), P = b([]), F = b([]), { depth: I, hasOptions: L, direction: R, ellipsis: z, ellipsisIcon: B } = d(t), V = a(() => {
15
+ var e;
16
+ return R.value === "horizontal" && z != null && z.value ? N.value : (e = u.options) == null ? [] : e;
17
+ }), H = E(async () => await k(B == null ? void 0 : B.value) || ""), U = b(!1), W = () => {
18
+ let e = j.value;
19
+ return e ? e.scrollWidth > e.clientWidth : !1;
20
+ }, G = S(), K = () => {
21
+ var e, t;
22
+ let n = (e = (t = M.value) == null ? void 0 : t.itemRef) == null ? M.value : e, r = j.value;
23
+ if (!n || !r) return -1;
24
+ let i = r.offsetWidth, a = Array.from(r.children), o = n.offsetWidth;
25
+ return a.findIndex((e) => (o += e.offsetWidth, o > i));
26
+ }, q = (e, t) => {
27
+ P.value = e.splice(t, e.length - t);
28
+ }, J = (t, n) => {
29
+ var r, i, a;
30
+ let o = e(t), s = (r = o == null || (i = o[0]) == null ? void 0 : i.children) == null ? [] : r, c = (a = s == null ? void 0 : s.length) == null ? 0 : a;
31
+ for (let e = n; e < c; e++) {
32
+ var l;
33
+ (l = j.value) == null || l.children[e].setAttribute("is-hidden", "true");
34
+ }
35
+ F.value = s.splice(n, s.length - n).map((e) => ({
36
+ ...e,
37
+ props: {
38
+ ...e.props,
39
+ "is-more": !0
40
+ }
41
+ }));
42
+ }, Y = async () => {
43
+ var e;
44
+ if (N.value = [...(e = u.options) == null ? [] : e], I.value === 0 && R.value !== "vertical" && z.value) {
45
+ if (!L.value && j.value && j.value.querySelectorAll("li[is-hidden=\"true\"]").forEach((e) => {
46
+ e.setAttribute("is-hidden", "false");
47
+ }), await p(), W()) {
48
+ U.value = !0, await p();
49
+ let e = K();
50
+ if (e === -1) return;
51
+ L.value ? q(N.value, e) : J(G, e);
52
+ } else U.value = !1, F.value = [], P.value = [];
53
+ }
54
+ }, X = D(Y, 100), Z = () => {
55
+ let e = [];
56
+ if (z.value) {
57
+ let { width: t, stop: n } = O(j.value), { stop: r } = w(t, () => {
58
+ X();
59
+ });
60
+ e.push(n, r);
61
+ }
62
+ return { cleanup: () => {
63
+ e.forEach((e) => e());
64
+ } };
65
+ }, Q = [], $ = () => {
66
+ Q.forEach((e) => e());
67
+ }, ee = async () => {
68
+ if (z.value) {
69
+ await Y();
70
+ let { cleanup: e } = Z();
71
+ Q.push(e);
72
+ }
73
+ };
74
+ return m(() => {
75
+ ee();
76
+ }), h(() => {
77
+ $();
78
+ }), A({
79
+ loopRef: j,
80
+ update: Y
81
+ }), (e, t) => (g(), c("ul", {
82
+ ref_key: "loopRef",
83
+ ref: j
84
+ }, [v(e.$slots, "default", {}, () => [(g(!0), c(i, null, _(V.value, (t) => {
85
+ var a;
86
+ return g(), c(i, { key: typeof t.value == "boolean" ? t.label : t.value }, [t != null && (a = t.children) != null && a.length ? (g(), o(r, {
12
87
  key: 0,
13
- item: a
14
- }, null, 8, ["item"])) : (s(), r(e, o({
88
+ item: t,
89
+ "is-more": e.$attrs["is-more"]
90
+ }, null, 8, ["item", "is-more"])) : (g(), o(n, f({
15
91
  key: 1,
16
92
  ref_for: !0
17
- }, a), null, 16))], 64);
18
- }), 128))])]));
93
+ }, t, { "is-more": e.$attrs["is-more"] }), null, 16, ["is-more"]))], 64);
94
+ }), 128))]), U.value ? (g(), o(n, {
95
+ key: 0,
96
+ ref_key: "moreRef",
97
+ ref: M,
98
+ value: "more",
99
+ children: P.value,
100
+ "has-children": "",
101
+ "sub-icon": !1,
102
+ depth: -1,
103
+ "is-more": !0,
104
+ class: "is-more",
105
+ icon: x(H)
106
+ }, l({
107
+ icon: T(() => [v(e.$slots, "ellipsis-icon")]),
108
+ _: 2
109
+ }, [x(L) ? void 0 : {
110
+ name: "item-submenu",
111
+ fn: T(() => [(g(), o(y(() => F.value)))]),
112
+ key: "0"
113
+ }]), 1032, ["children", "icon"])) : s("", !0)], 512));
19
114
  }
20
115
  });
21
116
  //#endregion
22
- export { u as default };
117
+ export { A as default };
@@ -1,5 +1,6 @@
1
1
  import { MenuOption } from './types';
2
- import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
+ import { DefineComponent, ShallowRef, ComputedRef, Ref, Component, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
3
+ import { Placement } from '@floating-ui/vue';
3
4
  declare var __VLS_7: {}, __VLS_14: {}, __VLS_16: {}, __VLS_30: {}, __VLS_37: {}, __VLS_39: {};
4
5
  type __VLS_Slots = {} & {
5
6
  icon?: (props: typeof __VLS_7) => any;
@@ -14,7 +15,20 @@ type __VLS_Slots = {} & {
14
15
  } & {
15
16
  submenu?: (props: typeof __VLS_39) => any;
16
17
  };
17
- declare const __VLS_base: DefineComponent<MenuOption, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<MenuOption> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
18
+ declare const __VLS_base: DefineComponent<MenuOption, {
19
+ itemRef: Readonly< ShallowRef<HTMLLIElement | null, HTMLLIElement | null>>;
20
+ hasChild: ComputedRef<boolean>;
21
+ showArrow: ComputedRef<boolean>;
22
+ placement: ComputedRef<Placement>;
23
+ visible: Ref<boolean, boolean>;
24
+ value: any;
25
+ label: string | undefined;
26
+ disabled: boolean | undefined;
27
+ icon: string | Component;
28
+ subIcon: string | false | Component | undefined;
29
+ depth: number;
30
+ children: MenuOption[];
31
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<MenuOption> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
18
32
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
19
33
  declare const _default: typeof __VLS_export;
20
34
  export default _default;