@huyooo/ui 0.7.8 → 0.7.9

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/user.js CHANGED
@@ -1,4 +1,4 @@
1
- import { d as r, U as e, a as n, b as o, c as t, S as U } from "./UserAccountMenu-DXWF1zNh.js";
1
+ import { d as r, U as e, a as n, b as o, c as t, S as U } from "./UserAccountMenu-Zh8wCvYz.js";
2
2
  export {
3
3
  r as UserAccountMenu,
4
4
  e as UserAvatar,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@huyooo/ui",
3
- "version": "0.7.8",
3
+ "version": "0.7.9",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "files": [
@@ -1,148 +0,0 @@
1
- import { defineComponent as I, createElementBlock as l, createCommentVNode as k, openBlock as u, normalizeClass as y, createBlock as h, createElementVNode as d, unref as m, toDisplayString as N, ref as A, watch as E, Fragment as g, renderList as B, createVNode as M, Transition as D, withCtx as z, withDirectives as F, vShow as L } from "vue";
2
- import { Icon as C } from "@iconify/vue";
3
- import { _ as V } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
- const O = {
5
- class: "menu-item__name"
6
- }, T = /* @__PURE__ */ I({
7
- __name: "MenuItem",
8
- props: {
9
- hidden: {
10
- type: Boolean,
11
- default: !1
12
- },
13
- path: {
14
- default: ""
15
- },
16
- icon: {
17
- default: ""
18
- },
19
- name: {},
20
- active: {
21
- type: Boolean,
22
- default: !1
23
- }
24
- },
25
- emits: ["click"],
26
- setup(f, {
27
- emit: v
28
- }) {
29
- const n = f, p = v;
30
- return (o, i) => n.hidden ? k("", !0) : (u(), l("div", {
31
- key: 0,
32
- class: y(["menu-item", {
33
- "menu-item--active": n.active
34
- }]),
35
- onClick: i[0] || (i[0] = (w) => p("click"))
36
- }, [n.icon ? (u(), h(m(C), {
37
- key: 0,
38
- class: "menu-item__icon",
39
- icon: n.icon,
40
- width: 16
41
- }, null, 8, ["icon"])) : k("", !0), d("span", O, N(n.name), 1)], 2));
42
- }
43
- }), $ = /* @__PURE__ */ V(T, [["__scopeId", "data-v-594d133c"]]), b = {
44
- class: "menu"
45
- }, j = ["onClick"], q = {
46
- class: "menu-group__header-content"
47
- }, G = {
48
- class: "menu-group__title"
49
- }, H = {
50
- class: "menu-group__children"
51
- }, J = /* @__PURE__ */ I({
52
- __name: "Menu",
53
- props: {
54
- menus: {
55
- default: () => []
56
- },
57
- selectedKeys: {
58
- default: () => []
59
- },
60
- defaultExpandAll: {
61
- type: Boolean,
62
- default: !0
63
- }
64
- },
65
- emits: ["update:selectedKeys", "change"],
66
- setup(f, {
67
- emit: v
68
- }) {
69
- const n = f, p = v, o = A([]);
70
- function i() {
71
- n.defaultExpandAll ? o.value = n.menus.filter((a) => a.children && a.children.length > 0).map((a, s) => a.path || s.toString()) : (o.value = [], n.menus.forEach((a, s) => {
72
- var e;
73
- (e = a.children) != null && e.some((c) => n.selectedKeys.includes(c.path)) && o.value.push(a.path || s.toString());
74
- }));
75
- }
76
- function w(a) {
77
- const s = o.value.indexOf(a);
78
- s > -1 ? o.value.splice(s, 1) : o.value.push(a);
79
- }
80
- function x(a) {
81
- p("change", a), p("update:selectedKeys", [a.path]);
82
- }
83
- return E(() => n.menus, i, {
84
- immediate: !0,
85
- deep: !0
86
- }), E(() => n.selectedKeys, (a) => {
87
- n.menus.forEach((s, e) => {
88
- var r;
89
- const c = s.path || e.toString();
90
- (r = s.children) != null && r.some((_) => a.includes(_.path)) && (o.value.includes(c) || o.value.push(c));
91
- });
92
- }, {
93
- deep: !0
94
- }), (a, s) => (u(), l("div", b, [(u(!0), l(g, null, B(n.menus, (e, c) => {
95
- var r, _, K;
96
- return u(), l("div", {
97
- key: e.path || c,
98
- class: "menu-group"
99
- }, [e.children && e.children.length > 0 ? (u(), l(g, {
100
- key: 0
101
- }, [d("div", {
102
- class: y(["menu-group__header", {
103
- "menu-group__header--expanded": o.value.includes(e.path || c.toString())
104
- }]),
105
- onClick: (t) => w(e.path || c.toString())
106
- }, [d("div", q, [(r = e == null ? void 0 : e.meta) != null && r.icon || e != null && e.icon ? (u(), h(m(C), {
107
- key: 0,
108
- class: "menu-group__icon",
109
- icon: ((_ = e == null ? void 0 : e.meta) == null ? void 0 : _.icon) || (e == null ? void 0 : e.icon),
110
- width: 16
111
- }, null, 8, ["icon"])) : k("", !0), d("span", G, N(e.name), 1)]), M(m(C), {
112
- class: y(["menu-group__arrow", {
113
- "menu-group__arrow--expanded": o.value.includes(e.path || c.toString())
114
- }]),
115
- icon: "mingcute:down-line",
116
- width: 14
117
- }, null, 8, ["class"])], 10, j), M(D, {
118
- name: "collapse"
119
- }, {
120
- default: z(() => [F(d("div", H, [(u(!0), l(g, null, B(e.children, (t) => {
121
- var S;
122
- return u(), h($, {
123
- key: t.path,
124
- hidden: t == null ? void 0 : t.hidden,
125
- path: t.path,
126
- icon: ((S = t == null ? void 0 : t.meta) == null ? void 0 : S.icon) || (t == null ? void 0 : t.icon),
127
- name: t.name,
128
- active: n.selectedKeys.includes(t.path),
129
- onClick: (P) => x(t)
130
- }, null, 8, ["hidden", "path", "icon", "name", "active", "onClick"]);
131
- }), 128))], 512), [[L, o.value.includes(e.path || c.toString())]])]),
132
- _: 2
133
- }, 1024)], 64)) : (u(), h($, {
134
- key: 1,
135
- hidden: e == null ? void 0 : e.hidden,
136
- path: e.path,
137
- icon: ((K = e == null ? void 0 : e.meta) == null ? void 0 : K.icon) || (e == null ? void 0 : e.icon),
138
- name: e.name,
139
- active: n.selectedKeys.includes(e.path),
140
- onClick: (t) => x(e)
141
- }, null, 8, ["hidden", "path", "icon", "name", "active", "onClick"]))]);
142
- }), 128))]));
143
- }
144
- }), W = /* @__PURE__ */ V(J, [["__scopeId", "data-v-733a2502"]]);
145
- export {
146
- W as M,
147
- $ as a
148
- };