wize-admin-library 0.1.5 → 0.1.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/style.css +1 -1
- package/dist/wize-admin-library.es.js +109 -100
- package/dist/wize-admin-library.umd.js +1 -1
- package/package.json +1 -1
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import { computed as h, ref as _, onMounted as w, onBeforeUnmount as g } from "vue";
|
|
2
|
-
function p(
|
|
3
|
-
var l = typeof
|
|
4
|
-
e && (l.render = e, l.staticRenderFns =
|
|
2
|
+
function p(i, e, t, a, s, r, c, d) {
|
|
3
|
+
var l = typeof i == "function" ? i.options : i;
|
|
4
|
+
e && (l.render = e, l.staticRenderFns = t, l._compiled = !0), a && (l.functional = !0), r && (l._scopeId = "data-v-" + r);
|
|
5
5
|
var o;
|
|
6
|
-
if (c ? (o = function(
|
|
7
|
-
|
|
6
|
+
if (c ? (o = function(n) {
|
|
7
|
+
n = n || // cached call
|
|
8
8
|
this.$vnode && this.$vnode.ssrContext || // stateful
|
|
9
|
-
this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !
|
|
10
|
-
}, l._ssrRegister = o) :
|
|
11
|
-
|
|
9
|
+
this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !n && typeof __VUE_SSR_CONTEXT__ < "u" && (n = __VUE_SSR_CONTEXT__), s && s.call(this, n), n && n._registeredComponents && n._registeredComponents.add(c);
|
|
10
|
+
}, l._ssrRegister = o) : s && (o = d ? function() {
|
|
11
|
+
s.call(
|
|
12
12
|
this,
|
|
13
13
|
(l.functional ? this.parent : this).$root.$options.shadowRoot
|
|
14
14
|
);
|
|
15
|
-
} :
|
|
15
|
+
} : s), o)
|
|
16
16
|
if (l.functional) {
|
|
17
17
|
l._injectStyles = o;
|
|
18
18
|
var f = l.render;
|
|
19
|
-
l.render = function(
|
|
20
|
-
return o.call(C), f(
|
|
19
|
+
l.render = function(u, C) {
|
|
20
|
+
return o.call(C), f(u, C);
|
|
21
21
|
};
|
|
22
22
|
} else {
|
|
23
23
|
var v = l.beforeCreate;
|
|
24
24
|
l.beforeCreate = v ? [].concat(v, o) : [o];
|
|
25
25
|
}
|
|
26
26
|
return {
|
|
27
|
-
exports:
|
|
27
|
+
exports: i,
|
|
28
28
|
options: l
|
|
29
29
|
};
|
|
30
30
|
}
|
|
@@ -38,7 +38,7 @@ const y = {
|
|
|
38
38
|
variant: {
|
|
39
39
|
type: String,
|
|
40
40
|
default: "primary",
|
|
41
|
-
validator: (
|
|
41
|
+
validator: (i) => ["primary", "secondary", "success", "danger", "warning", "info", "light", "dark", "link", "outline"].includes(i)
|
|
42
42
|
},
|
|
43
43
|
/**
|
|
44
44
|
* Size of the button.
|
|
@@ -47,7 +47,7 @@ const y = {
|
|
|
47
47
|
size: {
|
|
48
48
|
type: String,
|
|
49
49
|
default: "md",
|
|
50
|
-
validator: (
|
|
50
|
+
validator: (i) => ["sm", "md", "lg"].includes(i)
|
|
51
51
|
},
|
|
52
52
|
/**
|
|
53
53
|
* Whether the button is disabled.
|
|
@@ -65,21 +65,21 @@ const y = {
|
|
|
65
65
|
}
|
|
66
66
|
},
|
|
67
67
|
emits: ["click"],
|
|
68
|
-
setup(
|
|
69
|
-
const
|
|
68
|
+
setup(i, { emit: e }) {
|
|
69
|
+
const t = i, a = h(() => [
|
|
70
70
|
"wz-btn",
|
|
71
|
-
`wz-btn-${
|
|
72
|
-
`wz-btn-${
|
|
73
|
-
{ "wz-btn-block":
|
|
71
|
+
`wz-btn-${t.variant}`,
|
|
72
|
+
`wz-btn-${t.size}`,
|
|
73
|
+
{ "wz-btn-block": t.block }
|
|
74
74
|
]);
|
|
75
|
-
return { __sfc: !0, props:
|
|
76
|
-
|
|
75
|
+
return { __sfc: !0, props: t, emit: e, classes: a, handleClick: (r) => {
|
|
76
|
+
t.disabled || e("click", r);
|
|
77
77
|
} };
|
|
78
78
|
}
|
|
79
79
|
};
|
|
80
80
|
var z = function() {
|
|
81
|
-
var e = this,
|
|
82
|
-
return
|
|
81
|
+
var e = this, t = e._self._c, a = e._self._setupProxy;
|
|
82
|
+
return t("button", { class: a.classes, attrs: { disabled: e.disabled }, on: { click: a.handleClick } }, [e._t("default")], 2);
|
|
83
83
|
}, b = [], k = /* @__PURE__ */ p(
|
|
84
84
|
y,
|
|
85
85
|
z,
|
|
@@ -146,41 +146,41 @@ const S = k.exports, $ = {
|
|
|
146
146
|
}
|
|
147
147
|
},
|
|
148
148
|
emits: ["item-click"],
|
|
149
|
-
setup(
|
|
150
|
-
const
|
|
151
|
-
if (!
|
|
149
|
+
setup(i, { emit: e }) {
|
|
150
|
+
const t = i, a = _(/* @__PURE__ */ new Set()), s = _(!1), r = h(() => t.collapsed && !s.value), c = (n) => n.key === t.activeKey, d = (n) => n.children && n.children.length > 0, l = (n) => a.value.has(n.key), o = (n) => {
|
|
151
|
+
if (!d(n) || r.value)
|
|
152
152
|
return;
|
|
153
|
-
const
|
|
154
|
-
|
|
153
|
+
const u = new Set(a.value);
|
|
154
|
+
u.has(n.key) ? u.delete(n.key) : u.add(n.key), a.value = u;
|
|
155
155
|
};
|
|
156
|
-
return { __sfc: !0, props:
|
|
156
|
+
return { __sfc: !0, props: t, emit: e, openKeys: a, isHovered: s, visuallyCollapsed: r, isActive: c, hasChildren: d, isOpen: l, toggle: o, handleClick: (n) => {
|
|
157
157
|
if (r.value) {
|
|
158
|
-
e("item-click",
|
|
158
|
+
e("item-click", n);
|
|
159
159
|
return;
|
|
160
160
|
}
|
|
161
|
-
|
|
162
|
-
}, handleChildClick: (
|
|
163
|
-
e("item-click",
|
|
161
|
+
d(n) ? o(n) : e("item-click", n);
|
|
162
|
+
}, handleChildClick: (n) => {
|
|
163
|
+
e("item-click", n);
|
|
164
164
|
} };
|
|
165
165
|
}
|
|
166
166
|
};
|
|
167
167
|
var M = function() {
|
|
168
|
-
var e = this,
|
|
169
|
-
return
|
|
168
|
+
var e = this, t = e._self._c, a = e._self._setupProxy;
|
|
169
|
+
return t("aside", { staticClass: "wz-sidebar", class: { "wz-sidebar--collapsed": a.visuallyCollapsed }, on: { mouseenter: function(s) {
|
|
170
170
|
a.isHovered = !0;
|
|
171
|
-
}, mouseleave: function(
|
|
171
|
+
}, mouseleave: function(s) {
|
|
172
172
|
a.isHovered = !1;
|
|
173
|
-
} } }, [
|
|
174
|
-
return [e.logoSrc || e.logoMiniSrc ? [a.visuallyCollapsed && e.logoMiniSrc ?
|
|
175
|
-
})], 2),
|
|
176
|
-
return [
|
|
177
|
-
return a.handleClick(
|
|
178
|
-
} } }, [
|
|
179
|
-
return [
|
|
180
|
-
}, { item:
|
|
181
|
-
return
|
|
173
|
+
} } }, [t("div", { staticClass: "wz-sidebar-logo" }, [e._t("logo", function() {
|
|
174
|
+
return [e.logoSrc || e.logoMiniSrc ? [a.visuallyCollapsed && e.logoMiniSrc ? t("img", { staticClass: "wz-sidebar-logo-img-mini", attrs: { src: e.logoMiniSrc, alt: "Mini Logo" } }) : !a.visuallyCollapsed && e.logoSrc ? t("img", { staticClass: "wz-sidebar-logo-img", attrs: { src: e.logoSrc, alt: "Logo" } }) : e._e()] : [e.logoIconHtml ? t("span", { staticClass: "wz-sidebar-logo-icon", domProps: { innerHTML: e._s(e.logoIconHtml) } }) : e._e(), t("span", { directives: [{ name: "show", rawName: "v-show", value: !a.visuallyCollapsed, expression: "!visuallyCollapsed" }], staticClass: "wz-sidebar-logo-text" }, [e._v(e._s(e.logoText))])]];
|
|
175
|
+
})], 2), t("nav", { staticClass: "wz-sidebar-nav" }, [e._l(e.items, function(s, r) {
|
|
176
|
+
return [s.type === "group" ? t("div", { directives: [{ name: "show", rawName: "v-show", value: !a.visuallyCollapsed, expression: "!visuallyCollapsed" }], key: `group-${r}`, staticClass: "wz-sidebar-group" }, [e._v(" " + e._s(s.label) + " ")]) : t("div", { key: s.key || r, staticClass: "wz-sidebar-item-wrapper" }, [t("div", { staticClass: "wz-sidebar-item", class: { "wz-sidebar-item--active": a.isActive(s) }, attrs: { title: a.visuallyCollapsed ? s.label : null }, on: { click: function(c) {
|
|
177
|
+
return a.handleClick(s);
|
|
178
|
+
} } }, [t("span", { staticClass: "wz-sidebar-icon" }, [e._t("icon", function() {
|
|
179
|
+
return [s.icon ? t("i", { class: s.icon, staticStyle: { "font-size": "1.125rem" } }) : s.iconHtml ? t("span", { domProps: { innerHTML: e._s(s.iconHtml) } }) : t("i", { staticClass: "ri-checkbox-blank-circle-line", staticStyle: { "font-size": "10px" } })];
|
|
180
|
+
}, { item: s })], 2), t("span", { directives: [{ name: "show", rawName: "v-show", value: !a.visuallyCollapsed, expression: "!visuallyCollapsed" }], staticClass: "wz-sidebar-label" }, [e._v(e._s(s.label))]), a.hasChildren(s) ? t("span", { directives: [{ name: "show", rawName: "v-show", value: !a.visuallyCollapsed, expression: "!visuallyCollapsed" }], staticClass: "wz-sidebar-arrow", class: { "wz-sidebar-arrow--open": a.isOpen(s) } }, [t("i", { staticClass: "ri-arrow-right-s-line", staticStyle: { "font-size": "1.125rem" } })]) : e._e()]), t("div", { directives: [{ name: "show", rawName: "v-show", value: !a.visuallyCollapsed, expression: "!visuallyCollapsed" }], staticClass: "wz-sidebar-children-wrapper", class: { "is-open": a.hasChildren(s) && a.isOpen(s) } }, [t("div", { staticClass: "wz-sidebar-children-inner" }, [a.hasChildren(s) ? t("div", { staticClass: "wz-sidebar-children" }, e._l(s.children, function(c) {
|
|
181
|
+
return t("div", { key: c.key, staticClass: "wz-sidebar-child-item", class: { "wz-sidebar-child-item--active": a.isActive(c) }, on: { click: function(d) {
|
|
182
182
|
return a.handleChildClick(c);
|
|
183
|
-
} } }, [
|
|
183
|
+
} } }, [t("span", { staticClass: "wz-sidebar-label" }, [e._v(e._s(c.label))]), a.hasChildren(c) ? t("span", { staticClass: "wz-sidebar-arrow" }, [t("i", { staticClass: "ri-arrow-right-s-line", staticStyle: { "font-size": "1rem" } })]) : e._e()]);
|
|
184
184
|
}), 0) : e._e()])])])];
|
|
185
185
|
})], 2)]);
|
|
186
186
|
}, x = [], I = /* @__PURE__ */ p(
|
|
@@ -193,7 +193,7 @@ var M = function() {
|
|
|
193
193
|
null,
|
|
194
194
|
null
|
|
195
195
|
);
|
|
196
|
-
const H = I.exports,
|
|
196
|
+
const H = I.exports, L = {
|
|
197
197
|
__name: "WzHeader",
|
|
198
198
|
props: {
|
|
199
199
|
/**
|
|
@@ -237,66 +237,73 @@ const H = I.exports, U = {
|
|
|
237
237
|
userSubtitle: {
|
|
238
238
|
type: String,
|
|
239
239
|
default: ""
|
|
240
|
+
},
|
|
241
|
+
/**
|
|
242
|
+
* Main logo image source to display in header (mobile only)
|
|
243
|
+
*/
|
|
244
|
+
logoSrc: {
|
|
245
|
+
type: String,
|
|
246
|
+
default: null
|
|
240
247
|
}
|
|
241
248
|
},
|
|
242
249
|
emits: ["menu-toggle", "search", "notifications", "settings", "user-click", "action-click", "user-menu-click"],
|
|
243
|
-
setup(
|
|
244
|
-
const
|
|
245
|
-
|
|
246
|
-
},
|
|
247
|
-
e("user-menu-click", o),
|
|
250
|
+
setup(i, { emit: e }) {
|
|
251
|
+
const t = i, a = (o) => o ? o.split(" ").map((f) => f[0]).slice(0, 2).join("").toUpperCase() : "?", s = _(!1), r = _(null), c = () => {
|
|
252
|
+
s.value = !s.value, e("user-click");
|
|
253
|
+
}, d = (o) => {
|
|
254
|
+
e("user-menu-click", o), s.value = !1;
|
|
248
255
|
}, l = (o) => {
|
|
249
|
-
r.value && !r.value.contains(o.target) && (
|
|
256
|
+
r.value && !r.value.contains(o.target) && (s.value = !1);
|
|
250
257
|
};
|
|
251
258
|
return w(() => {
|
|
252
259
|
document.addEventListener("click", l);
|
|
253
260
|
}), g(() => {
|
|
254
261
|
document.removeEventListener("click", l);
|
|
255
|
-
}), { __sfc: !0, props:
|
|
262
|
+
}), { __sfc: !0, props: t, emit: e, initials: a, isUserMenuOpen: s, userMenuContainer: r, toggleUserMenu: c, handleUserItemClick: d, handleClickOutside: l };
|
|
256
263
|
}
|
|
257
264
|
};
|
|
258
|
-
var
|
|
259
|
-
var e = this,
|
|
260
|
-
return
|
|
265
|
+
var U = function() {
|
|
266
|
+
var e = this, t = e._self._c, a = e._self._setupProxy;
|
|
267
|
+
return t("header", { staticClass: "wz-header" }, [t("div", { staticClass: "wz-header-left" }, [e.logoSrc ? t("img", { staticClass: "wz-header-mobile-logo", attrs: { src: e.logoSrc, alt: "Brand Logo" } }) : e._e(), t("button", { staticClass: "wz-header-action wz-header-hamburger", attrs: { title: "Toggle menu" }, on: { click: function(s) {
|
|
261
268
|
return a.emit("menu-toggle");
|
|
262
|
-
} } }, [
|
|
263
|
-
return [e.actionItems && e.actionItems.length ? [e._l(e.actionItems, function(
|
|
264
|
-
return [
|
|
265
|
-
return a.emit("action-click",
|
|
266
|
-
} } }, [
|
|
267
|
-
return a.emit("action-click",
|
|
268
|
-
} } }, [
|
|
269
|
-
})] : [
|
|
269
|
+
} } }, [t("i", { staticClass: "wz-header-icon-desktop", class: e.collapsed ? "ri-close-line" : "ri-menu-line", staticStyle: { "font-size": "1.25rem" } }), t("i", { staticClass: "wz-header-icon-mobile ri-menu-line", staticStyle: { "font-size": "1.25rem", display: "none" } })]), e._t("left")], 2), t("div", { staticClass: "wz-header-right" }, [e._t("actions", function() {
|
|
270
|
+
return [e.actionItems && e.actionItems.length ? [e._l(e.actionItems, function(s) {
|
|
271
|
+
return [s.badge ? t("div", { key: "badge-" + s.key, staticClass: "wz-header-badge" }, [t("button", { staticClass: "wz-header-action", attrs: { title: s.key }, on: { click: function(r) {
|
|
272
|
+
return a.emit("action-click", s);
|
|
273
|
+
} } }, [t("i", { class: s.icon, staticStyle: { "font-size": "1.125rem" } })]), s.badgeCount || e.notificationCount > 0 ? t("span", { staticClass: "wz-header-badge-dot" }, [e._v(" " + e._s(s.badgeCount || e.notificationCount > 9 ? "9+" : s.badgeCount || e.notificationCount) + " ")]) : e._e()]) : t("button", { key: s.key, staticClass: "wz-header-action", attrs: { title: s.key }, on: { click: function(r) {
|
|
274
|
+
return a.emit("action-click", s);
|
|
275
|
+
} } }, [t("i", { class: s.icon, staticStyle: { "font-size": "1.125rem" } })])];
|
|
276
|
+
})] : [t("button", { staticClass: "wz-header-action", attrs: { title: "Search" }, on: { click: function(s) {
|
|
270
277
|
return a.emit("search");
|
|
271
|
-
} } }, [
|
|
278
|
+
} } }, [t("i", { staticClass: "ri-search-line", staticStyle: { "font-size": "1.125rem" } })]), e._m(0), e._m(1), t("div", { staticClass: "wz-header-badge" }, [t("button", { staticClass: "wz-header-action", attrs: { title: "Notifications" }, on: { click: function(s) {
|
|
272
279
|
return a.emit("notifications");
|
|
273
|
-
} } }, [
|
|
274
|
-
}),
|
|
275
|
-
return [
|
|
276
|
-
return
|
|
277
|
-
} } }, [e.user.avatar ?
|
|
278
|
-
}), e.userMenuItems && e.userMenuItems.length > 0 ?
|
|
279
|
-
return
|
|
280
|
-
return a.handleUserItemClick(
|
|
281
|
-
} } }, [
|
|
282
|
-
}), 0)]) : e._e()], 2),
|
|
280
|
+
} } }, [t("i", { staticClass: "ri-notification-3-line", staticStyle: { "font-size": "1.125rem" } })]), e.notificationCount > 0 ? t("span", { staticClass: "wz-header-badge-dot" }, [e._v(" " + e._s(e.notificationCount > 9 ? "9+" : e.notificationCount) + " ")]) : e._e()]), e._m(2), e._m(3)]];
|
|
281
|
+
}), t("div", { staticClass: "wz-header-divider" }), t("div", { ref: "userMenuContainer", staticClass: "wz-header-user-wrapper" }, [e._t("user", function() {
|
|
282
|
+
return [t("div", { staticClass: "wz-header-user", on: { click: function(s) {
|
|
283
|
+
return s.stopPropagation(), a.toggleUserMenu.apply(null, arguments);
|
|
284
|
+
} } }, [e.user.avatar ? t("img", { staticClass: "wz-header-user-avatar", attrs: { src: e.user.avatar, alt: e.user.name } }) : t("div", { staticClass: "wz-header-user-avatar-placeholder" }, [e._v(" " + e._s(a.initials(e.user.name)) + " ")]), t("span", { staticClass: "wz-header-user-name" }, [e._v(e._s(e.user.name))])])];
|
|
285
|
+
}), e.userMenuItems && e.userMenuItems.length > 0 ? t("div", { directives: [{ name: "show", rawName: "v-show", value: a.isUserMenuOpen, expression: "isUserMenuOpen" }], staticClass: "wz-header-dropdown" }, [t("div", { staticClass: "wz-header-dropdown-header" }, [t("div", { staticClass: "wz-header-dropdown-title" }, [e._v(e._s(e.user.name))]), e.userSubtitle ? t("div", { staticClass: "wz-header-dropdown-subtitle" }, [e._v(e._s(e.userSubtitle))]) : e._e()]), t("div", { staticClass: "wz-header-dropdown-body" }, e._l(e.userMenuItems, function(s, r) {
|
|
286
|
+
return t("div", { key: r, staticClass: "wz-header-dropdown-item", class: { "wz-header-dropdown-item--logout": s.isLogout }, on: { click: function(c) {
|
|
287
|
+
return a.handleUserItemClick(s);
|
|
288
|
+
} } }, [s.icon && !s.isLogout ? t("i", { class: s.icon }) : e._e(), t("span", [e._v(e._s(s.label))])]);
|
|
289
|
+
}), 0)]) : e._e()], 2), t("button", { staticClass: "wz-header-action", attrs: { title: "Settings" }, on: { click: function(s) {
|
|
283
290
|
return a.emit("settings");
|
|
284
|
-
} } }, [
|
|
291
|
+
} } }, [t("i", { staticClass: "ri-settings-3-line wz-anim-spin", staticStyle: { "font-size": "1.125rem", display: "inline-block" } })])], 2)]);
|
|
285
292
|
}, O = [function() {
|
|
286
|
-
var
|
|
287
|
-
return
|
|
293
|
+
var i = this, e = i._self._c;
|
|
294
|
+
return i._self._setupProxy, e("button", { staticClass: "wz-header-action", attrs: { title: "Language" } }, [e("i", { staticClass: "ri-global-line", staticStyle: { "font-size": "1.125rem" } })]);
|
|
288
295
|
}, function() {
|
|
289
|
-
var
|
|
290
|
-
return
|
|
296
|
+
var i = this, e = i._self._c;
|
|
297
|
+
return i._self._setupProxy, e("button", { staticClass: "wz-header-action", attrs: { title: "Toggle dark mode" } }, [e("i", { staticClass: "ri-moon-line", staticStyle: { "font-size": "1.125rem" } })]);
|
|
291
298
|
}, function() {
|
|
292
|
-
var
|
|
293
|
-
return
|
|
299
|
+
var i = this, e = i._self._c;
|
|
300
|
+
return i._self._setupProxy, e("button", { staticClass: "wz-header-action", attrs: { title: "Calendar" } }, [e("i", { staticClass: "ri-calendar-line", staticStyle: { "font-size": "1.125rem" } })]);
|
|
294
301
|
}, function() {
|
|
295
|
-
var
|
|
296
|
-
return
|
|
302
|
+
var i = this, e = i._self._c;
|
|
303
|
+
return i._self._setupProxy, e("button", { staticClass: "wz-header-action", attrs: { title: "Fullscreen" } }, [e("i", { staticClass: "ri-fullscreen-line", staticStyle: { "font-size": "1.125rem" } })]);
|
|
297
304
|
}], P = /* @__PURE__ */ p(
|
|
298
|
-
U,
|
|
299
305
|
L,
|
|
306
|
+
U,
|
|
300
307
|
O,
|
|
301
308
|
!1,
|
|
302
309
|
null,
|
|
@@ -315,34 +322,36 @@ const N = P.exports, T = {
|
|
|
315
322
|
default: !1
|
|
316
323
|
}
|
|
317
324
|
},
|
|
318
|
-
setup(
|
|
319
|
-
const e =
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
325
|
+
setup(i) {
|
|
326
|
+
const e = i, t = _(e.defaultCollapsed), a = () => {
|
|
327
|
+
t.value = !t.value;
|
|
328
|
+
};
|
|
329
|
+
return w(() => {
|
|
330
|
+
typeof window < "u" && window.innerWidth <= 768 && (t.value = !0);
|
|
331
|
+
}), { __sfc: !0, props: e, isCollapsed: t, toggleSidebar: a };
|
|
323
332
|
}
|
|
324
333
|
};
|
|
325
|
-
var
|
|
326
|
-
var e = this,
|
|
327
|
-
return
|
|
328
|
-
},
|
|
334
|
+
var W = function() {
|
|
335
|
+
var e = this, t = e._self._c, a = e._self._setupProxy;
|
|
336
|
+
return t("div", { staticClass: "wz-admin-layout" }, [t("div", { staticClass: "wz-admin-layout-sidebar-container" }, [a.isCollapsed ? e._e() : t("div", { staticClass: "wz-admin-layout-backdrop", on: { click: a.toggleSidebar } }), e._t("sidebar", null, { collapsed: a.isCollapsed })], 2), t("div", { staticClass: "wz-admin-layout-main" }, [t("div", { staticClass: "wz-admin-layout-header-container" }, [e._t("header", null, { toggleSidebar: a.toggleSidebar, collapsed: a.isCollapsed })], 2), t("main", { staticClass: "wz-admin-layout-content" }, [e._t("default")], 2)])]);
|
|
337
|
+
}, B = [], R = /* @__PURE__ */ p(
|
|
329
338
|
T,
|
|
330
|
-
R,
|
|
331
339
|
W,
|
|
340
|
+
B,
|
|
332
341
|
!1,
|
|
333
342
|
null,
|
|
334
343
|
null,
|
|
335
344
|
null,
|
|
336
345
|
null
|
|
337
346
|
);
|
|
338
|
-
const A =
|
|
347
|
+
const A = R.exports, F = {
|
|
339
348
|
WzButton: S,
|
|
340
349
|
WzSidebar: H,
|
|
341
350
|
WzHeader: N,
|
|
342
351
|
WzLayout: A
|
|
343
|
-
}, m = (
|
|
344
|
-
Object.entries(F).forEach(([e,
|
|
345
|
-
|
|
352
|
+
}, m = (i) => {
|
|
353
|
+
Object.entries(F).forEach(([e, t]) => {
|
|
354
|
+
i.component(e, t);
|
|
346
355
|
});
|
|
347
356
|
};
|
|
348
357
|
typeof window < "u" && window.Vue && m(window.Vue);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(u,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],d):(u=typeof globalThis<"u"?globalThis:u||self,d(u.WizeAdminLibrary={},u.Vue))})(this,function(u,d){"use strict";const F="";function p(n,e,t,a,s,r,c,f){var l=typeof n=="function"?n.options:n;e&&(l.render=e,l.staticRenderFns=t,l._compiled=!0),a&&(l.functional=!0),r&&(l._scopeId="data-v-"+r);var o;if(c?(o=function(i){i=i||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,!i&&typeof __VUE_SSR_CONTEXT__<"u"&&(i=__VUE_SSR_CONTEXT__),s&&s.call(this,i),i&&i._registeredComponents&&i._registeredComponents.add(c)},l._ssrRegister=o):s&&(o=f?function(){s.call(this,(l.functional?this.parent:this).$root.$options.shadowRoot)}:s),o)if(l.functional){l._injectStyles=o;var v=l.render;l.render=function(_,g){return o.call(g),v(_,g)}}else{var C=l.beforeCreate;l.beforeCreate=C?[].concat(C,o):[o]}return{exports:n,options:l}}const z={__name:"WzButton",props:{variant:{type:String,default:"primary",validator:n=>["primary","secondary","success","danger","warning","info","light","dark","link","outline"].includes(n)},size:{type:String,default:"md",validator:n=>["sm","md","lg"].includes(n)},disabled:{type:Boolean,default:!1},block:{type:Boolean,default:!1}},emits:["click"],setup(n,{emit:e}){const t=n,a=d.computed(()=>["wz-btn",`wz-btn-${t.variant}`,`wz-btn-${t.size}`,{"wz-btn-block":t.block}]);return{__sfc:!0,props:t,emit:e,classes:a,handleClick:r=>{t.disabled||e("click",r)}}}};var b=function(){var e=this,t=e._self._c,a=e._self._setupProxy;return t("button",{class:a.classes,attrs:{disabled:e.disabled},on:{click:a.handleClick}},[e._t("default")],2)},k=[],S=p(z,b,k,!1,null,null,null,null);const h=S.exports,$={__name:"WzSidebar",props:{items:{type:Array,default:()=>[]},activeKey:{type:String,default:null},logoSrc:{type:String,default:null},logoMiniSrc:{type:String,default:null},logoText:{type:String,default:"Admin"},logoIconHtml:{type:String,default:null},collapsed:{type:Boolean,default:!1}},emits:["item-click"],setup(n,{emit:e}){const t=n,a=d.ref(new Set),s=d.ref(!1),r=d.computed(()=>t.collapsed&&!s.value),c=i=>i.key===t.activeKey,f=i=>i.children&&i.children.length>0,l=i=>a.value.has(i.key),o=i=>{if(!f(i)||r.value)return;const _=new Set(a.value);_.has(i.key)?_.delete(i.key):_.add(i.key),a.value=_};return{__sfc:!0,props:t,emit:e,openKeys:a,isHovered:s,visuallyCollapsed:r,isActive:c,hasChildren:f,isOpen:l,toggle:o,handleClick:i=>{if(r.value){e("item-click",i);return}f(i)?o(i):e("item-click",i)},handleChildClick:i=>{e("item-click",i)}}}};var M=function(){var e=this,t=e._self._c,a=e._self._setupProxy;return t("aside",{staticClass:"wz-sidebar",class:{"wz-sidebar--collapsed":a.visuallyCollapsed},on:{mouseenter:function(s){a.isHovered=!0},mouseleave:function(s){a.isHovered=!1}}},[t("div",{staticClass:"wz-sidebar-logo"},[e._t("logo",function(){return[e.logoSrc||e.logoMiniSrc?[a.visuallyCollapsed&&e.logoMiniSrc?t("img",{staticClass:"wz-sidebar-logo-img-mini",attrs:{src:e.logoMiniSrc,alt:"Mini Logo"}}):!a.visuallyCollapsed&&e.logoSrc?t("img",{staticClass:"wz-sidebar-logo-img",attrs:{src:e.logoSrc,alt:"Logo"}}):e._e()]:[e.logoIconHtml?t("span",{staticClass:"wz-sidebar-logo-icon",domProps:{innerHTML:e._s(e.logoIconHtml)}}):e._e(),t("span",{directives:[{name:"show",rawName:"v-show",value:!a.visuallyCollapsed,expression:"!visuallyCollapsed"}],staticClass:"wz-sidebar-logo-text"},[e._v(e._s(e.logoText))])]]})],2),t("nav",{staticClass:"wz-sidebar-nav"},[e._l(e.items,function(s,r){return[s.type==="group"?t("div",{directives:[{name:"show",rawName:"v-show",value:!a.visuallyCollapsed,expression:"!visuallyCollapsed"}],key:`group-${r}`,staticClass:"wz-sidebar-group"},[e._v(" "+e._s(s.label)+" ")]):t("div",{key:s.key||r,staticClass:"wz-sidebar-item-wrapper"},[t("div",{staticClass:"wz-sidebar-item",class:{"wz-sidebar-item--active":a.isActive(s)},attrs:{title:a.visuallyCollapsed?s.label:null},on:{click:function(c){return a.handleClick(s)}}},[t("span",{staticClass:"wz-sidebar-icon"},[e._t("icon",function(){return[s.icon?t("i",{class:s.icon,staticStyle:{"font-size":"1.125rem"}}):s.iconHtml?t("span",{domProps:{innerHTML:e._s(s.iconHtml)}}):t("i",{staticClass:"ri-checkbox-blank-circle-line",staticStyle:{"font-size":"10px"}})]},{item:s})],2),t("span",{directives:[{name:"show",rawName:"v-show",value:!a.visuallyCollapsed,expression:"!visuallyCollapsed"}],staticClass:"wz-sidebar-label"},[e._v(e._s(s.label))]),a.hasChildren(s)?t("span",{directives:[{name:"show",rawName:"v-show",value:!a.visuallyCollapsed,expression:"!visuallyCollapsed"}],staticClass:"wz-sidebar-arrow",class:{"wz-sidebar-arrow--open":a.isOpen(s)}},[t("i",{staticClass:"ri-arrow-right-s-line",staticStyle:{"font-size":"1.125rem"}})]):e._e()]),t("div",{directives:[{name:"show",rawName:"v-show",value:!a.visuallyCollapsed,expression:"!visuallyCollapsed"}],staticClass:"wz-sidebar-children-wrapper",class:{"is-open":a.hasChildren(s)&&a.isOpen(s)}},[t("div",{staticClass:"wz-sidebar-children-inner"},[a.hasChildren(s)?t("div",{staticClass:"wz-sidebar-children"},e._l(s.children,function(c){return t("div",{key:c.key,staticClass:"wz-sidebar-child-item",class:{"wz-sidebar-child-item--active":a.isActive(c)},on:{click:function(f){return a.handleChildClick(c)}}},[t("span",{staticClass:"wz-sidebar-label"},[e._v(e._s(c.label))]),a.hasChildren(c)?t("span",{staticClass:"wz-sidebar-arrow"},[t("i",{staticClass:"ri-arrow-right-s-line",staticStyle:{"font-size":"1rem"}})]):e._e()])}),0):e._e()])])])]})],2)])},x=[],H=p($,M,x,!1,null,null,null,null);const m=H.exports,I={__name:"WzHeader",props:{user:{type:Object,default:()=>({name:"User",avatar:null})},notificationCount:{type:Number,default:0},collapsed:{type:Boolean,default:!1},actionItems:{type:Array,default:()=>[]},userMenuItems:{type:Array,default:()=>[]},userSubtitle:{type:String,default:""}},emits:["menu-toggle","search","notifications","settings","user-click","action-click","user-menu-click"],setup(n,{emit:e}){const t=n,a=o=>o?o.split(" ").map(v=>v[0]).slice(0,2).join("").toUpperCase():"?",s=d.ref(!1),r=d.ref(null),c=()=>{s.value=!s.value,e("user-click")},f=o=>{e("user-menu-click",o),s.value=!1},l=o=>{r.value&&!r.value.contains(o.target)&&(s.value=!1)};return d.onMounted(()=>{document.addEventListener("click",l)}),d.onBeforeUnmount(()=>{document.removeEventListener("click",l)}),{__sfc:!0,props:t,emit:e,initials:a,isUserMenuOpen:s,userMenuContainer:r,toggleUserMenu:c,handleUserItemClick:f,handleClickOutside:l}}};var T=function(){var e=this,t=e._self._c,a=e._self._setupProxy;return t("header",{staticClass:"wz-header"},[t("div",{staticClass:"wz-header-left"},[t("button",{staticClass:"wz-header-action",attrs:{title:"Toggle menu"},on:{click:function(s){return a.emit("menu-toggle")}}},[t("i",{class:e.collapsed?"ri-close-line":"ri-menu-line",staticStyle:{"font-size":"1.25rem"}})]),e._t("left")],2),t("div",{staticClass:"wz-header-right"},[e._t("actions",function(){return[e.actionItems&&e.actionItems.length?[e._l(e.actionItems,function(s){return[s.badge?t("div",{key:"badge-"+s.key,staticClass:"wz-header-badge"},[t("button",{staticClass:"wz-header-action",attrs:{title:s.key},on:{click:function(r){return a.emit("action-click",s)}}},[t("i",{class:s.icon,staticStyle:{"font-size":"1.125rem"}})]),s.badgeCount||e.notificationCount>0?t("span",{staticClass:"wz-header-badge-dot"},[e._v(" "+e._s(s.badgeCount||e.notificationCount>9?"9+":s.badgeCount||e.notificationCount)+" ")]):e._e()]):t("button",{key:s.key,staticClass:"wz-header-action",attrs:{title:s.key},on:{click:function(r){return a.emit("action-click",s)}}},[t("i",{class:s.icon,staticStyle:{"font-size":"1.125rem"}})])]})]:[t("button",{staticClass:"wz-header-action",attrs:{title:"Search"},on:{click:function(s){return a.emit("search")}}},[t("i",{staticClass:"ri-search-line",staticStyle:{"font-size":"1.125rem"}})]),e._m(0),e._m(1),t("div",{staticClass:"wz-header-badge"},[t("button",{staticClass:"wz-header-action",attrs:{title:"Notifications"},on:{click:function(s){return a.emit("notifications")}}},[t("i",{staticClass:"ri-notification-3-line",staticStyle:{"font-size":"1.125rem"}})]),e.notificationCount>0?t("span",{staticClass:"wz-header-badge-dot"},[e._v(" "+e._s(e.notificationCount>9?"9+":e.notificationCount)+" ")]):e._e()]),e._m(2),e._m(3)]]}),t("div",{staticClass:"wz-header-divider"}),t("div",{ref:"userMenuContainer",staticClass:"wz-header-user-wrapper"},[e._t("user",function(){return[t("div",{staticClass:"wz-header-user",on:{click:function(s){return s.stopPropagation(),a.toggleUserMenu.apply(null,arguments)}}},[e.user.avatar?t("img",{staticClass:"wz-header-user-avatar",attrs:{src:e.user.avatar,alt:e.user.name}}):t("div",{staticClass:"wz-header-user-avatar-placeholder"},[e._v(" "+e._s(a.initials(e.user.name))+" ")]),t("span",{staticClass:"wz-header-user-name"},[e._v(e._s(e.user.name))])])]}),e.userMenuItems&&e.userMenuItems.length>0?t("div",{directives:[{name:"show",rawName:"v-show",value:a.isUserMenuOpen,expression:"isUserMenuOpen"}],staticClass:"wz-header-dropdown"},[t("div",{staticClass:"wz-header-dropdown-header"},[t("div",{staticClass:"wz-header-dropdown-title"},[e._v(e._s(e.user.name))]),e.userSubtitle?t("div",{staticClass:"wz-header-dropdown-subtitle"},[e._v(e._s(e.userSubtitle))]):e._e()]),t("div",{staticClass:"wz-header-dropdown-body"},e._l(e.userMenuItems,function(s,r){return t("div",{key:r,staticClass:"wz-header-dropdown-item",class:{"wz-header-dropdown-item--logout":s.isLogout},on:{click:function(c){return a.handleUserItemClick(s)}}},[s.icon&&!s.isLogout?t("i",{class:s.icon}):e._e(),t("span",[e._v(e._s(s.label))])])}),0)]):e._e()],2),t("button",{staticClass:"wz-header-action",attrs:{title:"Settings"},on:{click:function(s){return a.emit("settings")}}},[t("i",{staticClass:"ri-settings-3-line wz-anim-spin",staticStyle:{"font-size":"1.125rem",display:"inline-block"}})])],2)])},W=[function(){var n=this,e=n._self._c;return n._self._setupProxy,e("button",{staticClass:"wz-header-action",attrs:{title:"Language"}},[e("i",{staticClass:"ri-global-line",staticStyle:{"font-size":"1.125rem"}})])},function(){var n=this,e=n._self._c;return n._self._setupProxy,e("button",{staticClass:"wz-header-action",attrs:{title:"Toggle dark mode"}},[e("i",{staticClass:"ri-moon-line",staticStyle:{"font-size":"1.125rem"}})])},function(){var n=this,e=n._self._c;return n._self._setupProxy,e("button",{staticClass:"wz-header-action",attrs:{title:"Calendar"}},[e("i",{staticClass:"ri-calendar-line",staticStyle:{"font-size":"1.125rem"}})])},function(){var n=this,e=n._self._c;return n._self._setupProxy,e("button",{staticClass:"wz-header-action",attrs:{title:"Fullscreen"}},[e("i",{staticClass:"ri-fullscreen-line",staticStyle:{"font-size":"1.125rem"}})])}],L=p(I,T,W,!1,null,null,null,null);const w=L.exports,O={__name:"WzLayout",props:{defaultCollapsed:{type:Boolean,default:!1}},setup(n){const e=n,t=d.ref(e.defaultCollapsed);return{__sfc:!0,props:e,isCollapsed:t,toggleSidebar:()=>{t.value=!t.value}}}};var P=function(){var e=this,t=e._self._c,a=e._self._setupProxy;return t("div",{staticClass:"wz-admin-layout"},[t("div",{staticClass:"wz-admin-layout-sidebar-container"},[e._t("sidebar",null,{collapsed:a.isCollapsed})],2),t("div",{staticClass:"wz-admin-layout-main"},[t("div",{staticClass:"wz-admin-layout-header-container"},[e._t("header",null,{toggleSidebar:a.toggleSidebar,collapsed:a.isCollapsed})],2),t("main",{staticClass:"wz-admin-layout-content"},[e._t("default")],2)])])},U=[],N=p(O,P,U,!1,null,null,null,null);const B=N.exports,R={WzButton:h,WzSidebar:m,WzHeader:w,WzLayout:B},y=n=>{Object.entries(R).forEach(([e,t])=>{n.component(e,t)})};typeof window<"u"&&window.Vue&&y(window.Vue);const A={install:y};u.WzButton=h,u.WzHeader=w,u.WzSidebar=m,u.default=A,Object.defineProperties(u,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(u,c){typeof exports=="object"&&typeof module<"u"?c(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],c):(u=typeof globalThis<"u"?globalThis:u||self,c(u.WizeAdminLibrary={},u.Vue))})(this,function(u,c){"use strict";const F="";function p(i,e,t,a,s,r,d,f){var l=typeof i=="function"?i.options:i;e&&(l.render=e,l.staticRenderFns=t,l._compiled=!0),a&&(l.functional=!0),r&&(l._scopeId="data-v-"+r);var o;if(d?(o=function(n){n=n||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,!n&&typeof __VUE_SSR_CONTEXT__<"u"&&(n=__VUE_SSR_CONTEXT__),s&&s.call(this,n),n&&n._registeredComponents&&n._registeredComponents.add(d)},l._ssrRegister=o):s&&(o=f?function(){s.call(this,(l.functional?this.parent:this).$root.$options.shadowRoot)}:s),o)if(l.functional){l._injectStyles=o;var v=l.render;l.render=function(_,y){return o.call(y),v(_,y)}}else{var C=l.beforeCreate;l.beforeCreate=C?[].concat(C,o):[o]}return{exports:i,options:l}}const z={__name:"WzButton",props:{variant:{type:String,default:"primary",validator:i=>["primary","secondary","success","danger","warning","info","light","dark","link","outline"].includes(i)},size:{type:String,default:"md",validator:i=>["sm","md","lg"].includes(i)},disabled:{type:Boolean,default:!1},block:{type:Boolean,default:!1}},emits:["click"],setup(i,{emit:e}){const t=i,a=c.computed(()=>["wz-btn",`wz-btn-${t.variant}`,`wz-btn-${t.size}`,{"wz-btn-block":t.block}]);return{__sfc:!0,props:t,emit:e,classes:a,handleClick:r=>{t.disabled||e("click",r)}}}};var b=function(){var e=this,t=e._self._c,a=e._self._setupProxy;return t("button",{class:a.classes,attrs:{disabled:e.disabled},on:{click:a.handleClick}},[e._t("default")],2)},k=[],S=p(z,b,k,!1,null,null,null,null);const h=S.exports,$={__name:"WzSidebar",props:{items:{type:Array,default:()=>[]},activeKey:{type:String,default:null},logoSrc:{type:String,default:null},logoMiniSrc:{type:String,default:null},logoText:{type:String,default:"Admin"},logoIconHtml:{type:String,default:null},collapsed:{type:Boolean,default:!1}},emits:["item-click"],setup(i,{emit:e}){const t=i,a=c.ref(new Set),s=c.ref(!1),r=c.computed(()=>t.collapsed&&!s.value),d=n=>n.key===t.activeKey,f=n=>n.children&&n.children.length>0,l=n=>a.value.has(n.key),o=n=>{if(!f(n)||r.value)return;const _=new Set(a.value);_.has(n.key)?_.delete(n.key):_.add(n.key),a.value=_};return{__sfc:!0,props:t,emit:e,openKeys:a,isHovered:s,visuallyCollapsed:r,isActive:d,hasChildren:f,isOpen:l,toggle:o,handleClick:n=>{if(r.value){e("item-click",n);return}f(n)?o(n):e("item-click",n)},handleChildClick:n=>{e("item-click",n)}}}};var M=function(){var e=this,t=e._self._c,a=e._self._setupProxy;return t("aside",{staticClass:"wz-sidebar",class:{"wz-sidebar--collapsed":a.visuallyCollapsed},on:{mouseenter:function(s){a.isHovered=!0},mouseleave:function(s){a.isHovered=!1}}},[t("div",{staticClass:"wz-sidebar-logo"},[e._t("logo",function(){return[e.logoSrc||e.logoMiniSrc?[a.visuallyCollapsed&&e.logoMiniSrc?t("img",{staticClass:"wz-sidebar-logo-img-mini",attrs:{src:e.logoMiniSrc,alt:"Mini Logo"}}):!a.visuallyCollapsed&&e.logoSrc?t("img",{staticClass:"wz-sidebar-logo-img",attrs:{src:e.logoSrc,alt:"Logo"}}):e._e()]:[e.logoIconHtml?t("span",{staticClass:"wz-sidebar-logo-icon",domProps:{innerHTML:e._s(e.logoIconHtml)}}):e._e(),t("span",{directives:[{name:"show",rawName:"v-show",value:!a.visuallyCollapsed,expression:"!visuallyCollapsed"}],staticClass:"wz-sidebar-logo-text"},[e._v(e._s(e.logoText))])]]})],2),t("nav",{staticClass:"wz-sidebar-nav"},[e._l(e.items,function(s,r){return[s.type==="group"?t("div",{directives:[{name:"show",rawName:"v-show",value:!a.visuallyCollapsed,expression:"!visuallyCollapsed"}],key:`group-${r}`,staticClass:"wz-sidebar-group"},[e._v(" "+e._s(s.label)+" ")]):t("div",{key:s.key||r,staticClass:"wz-sidebar-item-wrapper"},[t("div",{staticClass:"wz-sidebar-item",class:{"wz-sidebar-item--active":a.isActive(s)},attrs:{title:a.visuallyCollapsed?s.label:null},on:{click:function(d){return a.handleClick(s)}}},[t("span",{staticClass:"wz-sidebar-icon"},[e._t("icon",function(){return[s.icon?t("i",{class:s.icon,staticStyle:{"font-size":"1.125rem"}}):s.iconHtml?t("span",{domProps:{innerHTML:e._s(s.iconHtml)}}):t("i",{staticClass:"ri-checkbox-blank-circle-line",staticStyle:{"font-size":"10px"}})]},{item:s})],2),t("span",{directives:[{name:"show",rawName:"v-show",value:!a.visuallyCollapsed,expression:"!visuallyCollapsed"}],staticClass:"wz-sidebar-label"},[e._v(e._s(s.label))]),a.hasChildren(s)?t("span",{directives:[{name:"show",rawName:"v-show",value:!a.visuallyCollapsed,expression:"!visuallyCollapsed"}],staticClass:"wz-sidebar-arrow",class:{"wz-sidebar-arrow--open":a.isOpen(s)}},[t("i",{staticClass:"ri-arrow-right-s-line",staticStyle:{"font-size":"1.125rem"}})]):e._e()]),t("div",{directives:[{name:"show",rawName:"v-show",value:!a.visuallyCollapsed,expression:"!visuallyCollapsed"}],staticClass:"wz-sidebar-children-wrapper",class:{"is-open":a.hasChildren(s)&&a.isOpen(s)}},[t("div",{staticClass:"wz-sidebar-children-inner"},[a.hasChildren(s)?t("div",{staticClass:"wz-sidebar-children"},e._l(s.children,function(d){return t("div",{key:d.key,staticClass:"wz-sidebar-child-item",class:{"wz-sidebar-child-item--active":a.isActive(d)},on:{click:function(f){return a.handleChildClick(d)}}},[t("span",{staticClass:"wz-sidebar-label"},[e._v(e._s(d.label))]),a.hasChildren(d)?t("span",{staticClass:"wz-sidebar-arrow"},[t("i",{staticClass:"ri-arrow-right-s-line",staticStyle:{"font-size":"1rem"}})]):e._e()])}),0):e._e()])])])]})],2)])},x=[],W=p($,M,x,!1,null,null,null,null);const m=W.exports,H={__name:"WzHeader",props:{user:{type:Object,default:()=>({name:"User",avatar:null})},notificationCount:{type:Number,default:0},collapsed:{type:Boolean,default:!1},actionItems:{type:Array,default:()=>[]},userMenuItems:{type:Array,default:()=>[]},userSubtitle:{type:String,default:""},logoSrc:{type:String,default:null}},emits:["menu-toggle","search","notifications","settings","user-click","action-click","user-menu-click"],setup(i,{emit:e}){const t=i,a=o=>o?o.split(" ").map(v=>v[0]).slice(0,2).join("").toUpperCase():"?",s=c.ref(!1),r=c.ref(null),d=()=>{s.value=!s.value,e("user-click")},f=o=>{e("user-menu-click",o),s.value=!1},l=o=>{r.value&&!r.value.contains(o.target)&&(s.value=!1)};return c.onMounted(()=>{document.addEventListener("click",l)}),c.onBeforeUnmount(()=>{document.removeEventListener("click",l)}),{__sfc:!0,props:t,emit:e,initials:a,isUserMenuOpen:s,userMenuContainer:r,toggleUserMenu:d,handleUserItemClick:f,handleClickOutside:l}}};var I=function(){var e=this,t=e._self._c,a=e._self._setupProxy;return t("header",{staticClass:"wz-header"},[t("div",{staticClass:"wz-header-left"},[e.logoSrc?t("img",{staticClass:"wz-header-mobile-logo",attrs:{src:e.logoSrc,alt:"Brand Logo"}}):e._e(),t("button",{staticClass:"wz-header-action wz-header-hamburger",attrs:{title:"Toggle menu"},on:{click:function(s){return a.emit("menu-toggle")}}},[t("i",{staticClass:"wz-header-icon-desktop",class:e.collapsed?"ri-close-line":"ri-menu-line",staticStyle:{"font-size":"1.25rem"}}),t("i",{staticClass:"wz-header-icon-mobile ri-menu-line",staticStyle:{"font-size":"1.25rem",display:"none"}})]),e._t("left")],2),t("div",{staticClass:"wz-header-right"},[e._t("actions",function(){return[e.actionItems&&e.actionItems.length?[e._l(e.actionItems,function(s){return[s.badge?t("div",{key:"badge-"+s.key,staticClass:"wz-header-badge"},[t("button",{staticClass:"wz-header-action",attrs:{title:s.key},on:{click:function(r){return a.emit("action-click",s)}}},[t("i",{class:s.icon,staticStyle:{"font-size":"1.125rem"}})]),s.badgeCount||e.notificationCount>0?t("span",{staticClass:"wz-header-badge-dot"},[e._v(" "+e._s(s.badgeCount||e.notificationCount>9?"9+":s.badgeCount||e.notificationCount)+" ")]):e._e()]):t("button",{key:s.key,staticClass:"wz-header-action",attrs:{title:s.key},on:{click:function(r){return a.emit("action-click",s)}}},[t("i",{class:s.icon,staticStyle:{"font-size":"1.125rem"}})])]})]:[t("button",{staticClass:"wz-header-action",attrs:{title:"Search"},on:{click:function(s){return a.emit("search")}}},[t("i",{staticClass:"ri-search-line",staticStyle:{"font-size":"1.125rem"}})]),e._m(0),e._m(1),t("div",{staticClass:"wz-header-badge"},[t("button",{staticClass:"wz-header-action",attrs:{title:"Notifications"},on:{click:function(s){return a.emit("notifications")}}},[t("i",{staticClass:"ri-notification-3-line",staticStyle:{"font-size":"1.125rem"}})]),e.notificationCount>0?t("span",{staticClass:"wz-header-badge-dot"},[e._v(" "+e._s(e.notificationCount>9?"9+":e.notificationCount)+" ")]):e._e()]),e._m(2),e._m(3)]]}),t("div",{staticClass:"wz-header-divider"}),t("div",{ref:"userMenuContainer",staticClass:"wz-header-user-wrapper"},[e._t("user",function(){return[t("div",{staticClass:"wz-header-user",on:{click:function(s){return s.stopPropagation(),a.toggleUserMenu.apply(null,arguments)}}},[e.user.avatar?t("img",{staticClass:"wz-header-user-avatar",attrs:{src:e.user.avatar,alt:e.user.name}}):t("div",{staticClass:"wz-header-user-avatar-placeholder"},[e._v(" "+e._s(a.initials(e.user.name))+" ")]),t("span",{staticClass:"wz-header-user-name"},[e._v(e._s(e.user.name))])])]}),e.userMenuItems&&e.userMenuItems.length>0?t("div",{directives:[{name:"show",rawName:"v-show",value:a.isUserMenuOpen,expression:"isUserMenuOpen"}],staticClass:"wz-header-dropdown"},[t("div",{staticClass:"wz-header-dropdown-header"},[t("div",{staticClass:"wz-header-dropdown-title"},[e._v(e._s(e.user.name))]),e.userSubtitle?t("div",{staticClass:"wz-header-dropdown-subtitle"},[e._v(e._s(e.userSubtitle))]):e._e()]),t("div",{staticClass:"wz-header-dropdown-body"},e._l(e.userMenuItems,function(s,r){return t("div",{key:r,staticClass:"wz-header-dropdown-item",class:{"wz-header-dropdown-item--logout":s.isLogout},on:{click:function(d){return a.handleUserItemClick(s)}}},[s.icon&&!s.isLogout?t("i",{class:s.icon}):e._e(),t("span",[e._v(e._s(s.label))])])}),0)]):e._e()],2),t("button",{staticClass:"wz-header-action",attrs:{title:"Settings"},on:{click:function(s){return a.emit("settings")}}},[t("i",{staticClass:"ri-settings-3-line wz-anim-spin",staticStyle:{"font-size":"1.125rem",display:"inline-block"}})])],2)])},L=[function(){var i=this,e=i._self._c;return i._self._setupProxy,e("button",{staticClass:"wz-header-action",attrs:{title:"Language"}},[e("i",{staticClass:"ri-global-line",staticStyle:{"font-size":"1.125rem"}})])},function(){var i=this,e=i._self._c;return i._self._setupProxy,e("button",{staticClass:"wz-header-action",attrs:{title:"Toggle dark mode"}},[e("i",{staticClass:"ri-moon-line",staticStyle:{"font-size":"1.125rem"}})])},function(){var i=this,e=i._self._c;return i._self._setupProxy,e("button",{staticClass:"wz-header-action",attrs:{title:"Calendar"}},[e("i",{staticClass:"ri-calendar-line",staticStyle:{"font-size":"1.125rem"}})])},function(){var i=this,e=i._self._c;return i._self._setupProxy,e("button",{staticClass:"wz-header-action",attrs:{title:"Fullscreen"}},[e("i",{staticClass:"ri-fullscreen-line",staticStyle:{"font-size":"1.125rem"}})])}],T=p(H,I,L,!1,null,null,null,null);const w=T.exports,O={__name:"WzLayout",props:{defaultCollapsed:{type:Boolean,default:!1}},setup(i){const e=i,t=c.ref(e.defaultCollapsed),a=()=>{t.value=!t.value};return c.onMounted(()=>{typeof window<"u"&&window.innerWidth<=768&&(t.value=!0)}),{__sfc:!0,props:e,isCollapsed:t,toggleSidebar:a}}};var P=function(){var e=this,t=e._self._c,a=e._self._setupProxy;return t("div",{staticClass:"wz-admin-layout"},[t("div",{staticClass:"wz-admin-layout-sidebar-container"},[a.isCollapsed?e._e():t("div",{staticClass:"wz-admin-layout-backdrop",on:{click:a.toggleSidebar}}),e._t("sidebar",null,{collapsed:a.isCollapsed})],2),t("div",{staticClass:"wz-admin-layout-main"},[t("div",{staticClass:"wz-admin-layout-header-container"},[e._t("header",null,{toggleSidebar:a.toggleSidebar,collapsed:a.isCollapsed})],2),t("main",{staticClass:"wz-admin-layout-content"},[e._t("default")],2)])])},U=[],B=p(O,P,U,!1,null,null,null,null);const N=B.exports,R={WzButton:h,WzSidebar:m,WzHeader:w,WzLayout:N},g=i=>{Object.entries(R).forEach(([e,t])=>{i.component(e,t)})};typeof window<"u"&&window.Vue&&g(window.Vue);const A={install:g};u.WzButton=h,u.WzHeader=w,u.WzSidebar=m,u.default=A,Object.defineProperties(u,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wize-admin-library",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"description": "A reusable, lightweight, and highly customizable Vue 2.7 component library for admin panels.",
|
|
5
5
|
"main": "dist/wize-admin-library.umd.js",
|
|
6
6
|
"module": "dist/wize-admin-library.es.js",
|