wize-admin-library 0.1.3 → 0.1.4
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.
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { computed as
|
|
2
|
-
function
|
|
3
|
-
var
|
|
4
|
-
e && (
|
|
1
|
+
import { computed as h, ref as p } from "vue";
|
|
2
|
+
function _(i, e, s, t, a, r, o, d) {
|
|
3
|
+
var n = typeof i == "function" ? i.options : i;
|
|
4
|
+
e && (n.render = e, n.staticRenderFns = s, n._compiled = !0), t && (n.functional = !0), r && (n._scopeId = "data-v-" + r);
|
|
5
5
|
var c;
|
|
6
|
-
if (o ? (c = function(
|
|
7
|
-
|
|
6
|
+
if (o ? (c = function(l) {
|
|
7
|
+
l = l || // cached call
|
|
8
8
|
this.$vnode && this.$vnode.ssrContext || // stateful
|
|
9
|
-
this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !
|
|
10
|
-
},
|
|
9
|
+
this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !l && typeof __VUE_SSR_CONTEXT__ < "u" && (l = __VUE_SSR_CONTEXT__), a && a.call(this, l), l && l._registeredComponents && l._registeredComponents.add(o);
|
|
10
|
+
}, n._ssrRegister = c) : a && (c = d ? function() {
|
|
11
11
|
a.call(
|
|
12
12
|
this,
|
|
13
|
-
(
|
|
13
|
+
(n.functional ? this.parent : this).$root.$options.shadowRoot
|
|
14
14
|
);
|
|
15
15
|
} : a), c)
|
|
16
|
-
if (
|
|
17
|
-
|
|
18
|
-
var
|
|
19
|
-
|
|
20
|
-
return c.call(
|
|
16
|
+
if (n.functional) {
|
|
17
|
+
n._injectStyles = c;
|
|
18
|
+
var v = n.render;
|
|
19
|
+
n.render = function(u, C) {
|
|
20
|
+
return c.call(C), v(u, C);
|
|
21
21
|
};
|
|
22
22
|
} else {
|
|
23
|
-
var
|
|
24
|
-
|
|
23
|
+
var f = n.beforeCreate;
|
|
24
|
+
n.beforeCreate = f ? [].concat(f, c) : [c];
|
|
25
25
|
}
|
|
26
26
|
return {
|
|
27
27
|
exports: i,
|
|
28
|
-
options:
|
|
28
|
+
options: n
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
31
|
const w = {
|
|
@@ -66,31 +66,31 @@ const w = {
|
|
|
66
66
|
},
|
|
67
67
|
emits: ["click"],
|
|
68
68
|
setup(i, { emit: e }) {
|
|
69
|
-
const
|
|
69
|
+
const s = i, t = h(() => [
|
|
70
70
|
"wz-btn",
|
|
71
|
-
`wz-btn-${
|
|
72
|
-
`wz-btn-${
|
|
73
|
-
{ "wz-btn-block":
|
|
71
|
+
`wz-btn-${s.variant}`,
|
|
72
|
+
`wz-btn-${s.size}`,
|
|
73
|
+
{ "wz-btn-block": s.block }
|
|
74
74
|
]);
|
|
75
|
-
return { __sfc: !0, props:
|
|
76
|
-
|
|
75
|
+
return { __sfc: !0, props: s, emit: e, classes: t, handleClick: (r) => {
|
|
76
|
+
s.disabled || e("click", r);
|
|
77
77
|
} };
|
|
78
78
|
}
|
|
79
79
|
};
|
|
80
|
-
var
|
|
81
|
-
var e = this,
|
|
82
|
-
return
|
|
83
|
-
},
|
|
80
|
+
var y = function() {
|
|
81
|
+
var e = this, s = e._self._c, t = e._self._setupProxy;
|
|
82
|
+
return s("button", { class: t.classes, attrs: { disabled: e.disabled }, on: { click: t.handleClick } }, [e._t("default")], 2);
|
|
83
|
+
}, g = [], z = /* @__PURE__ */ _(
|
|
84
84
|
w,
|
|
85
|
+
y,
|
|
85
86
|
g,
|
|
86
|
-
z,
|
|
87
87
|
!1,
|
|
88
88
|
null,
|
|
89
89
|
null,
|
|
90
90
|
null,
|
|
91
91
|
null
|
|
92
92
|
);
|
|
93
|
-
const
|
|
93
|
+
const b = z.exports, k = {
|
|
94
94
|
__name: "WzSidebar",
|
|
95
95
|
props: {
|
|
96
96
|
/**
|
|
@@ -147,39 +147,43 @@ const y = b.exports, k = {
|
|
|
147
147
|
},
|
|
148
148
|
emits: ["item-click"],
|
|
149
149
|
setup(i, { emit: e }) {
|
|
150
|
-
const
|
|
151
|
-
if (!
|
|
150
|
+
const s = i, t = p(/* @__PURE__ */ new Set()), a = p(!1), r = h(() => s.collapsed && !a.value), o = (l) => l.key === s.activeKey, d = (l) => l.children && l.children.length > 0, n = (l) => t.value.has(l.key), c = (l) => {
|
|
151
|
+
if (!d(l) || r.value)
|
|
152
152
|
return;
|
|
153
|
-
const u = new Set(
|
|
154
|
-
u.has(
|
|
153
|
+
const u = new Set(t.value);
|
|
154
|
+
u.has(l.key) ? u.delete(l.key) : u.add(l.key), t.value = u;
|
|
155
155
|
};
|
|
156
|
-
return { __sfc: !0, props:
|
|
157
|
-
if (
|
|
158
|
-
e("item-click",
|
|
156
|
+
return { __sfc: !0, props: s, emit: e, openKeys: t, isHovered: a, visuallyCollapsed: r, isActive: o, hasChildren: d, isOpen: n, toggle: c, handleClick: (l) => {
|
|
157
|
+
if (r.value) {
|
|
158
|
+
e("item-click", l);
|
|
159
159
|
return;
|
|
160
160
|
}
|
|
161
|
-
|
|
162
|
-
}, handleChildClick: (
|
|
163
|
-
e("item-click",
|
|
161
|
+
d(l) ? c(l) : e("item-click", l);
|
|
162
|
+
}, handleChildClick: (l) => {
|
|
163
|
+
e("item-click", l);
|
|
164
164
|
} };
|
|
165
165
|
}
|
|
166
166
|
};
|
|
167
167
|
var S = function() {
|
|
168
|
-
var e = this,
|
|
169
|
-
return
|
|
170
|
-
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
return t
|
|
178
|
-
|
|
179
|
-
|
|
168
|
+
var e = this, s = e._self._c, t = e._self._setupProxy;
|
|
169
|
+
return s("aside", { staticClass: "wz-sidebar", class: { "wz-sidebar--collapsed": t.visuallyCollapsed }, on: { mouseenter: function(a) {
|
|
170
|
+
t.isHovered = !0;
|
|
171
|
+
}, mouseleave: function(a) {
|
|
172
|
+
t.isHovered = !1;
|
|
173
|
+
} } }, [s("div", { staticClass: "wz-sidebar-logo" }, [e._t("logo", function() {
|
|
174
|
+
return [e.logoSrc || e.logoMiniSrc ? [t.visuallyCollapsed && e.logoMiniSrc ? s("img", { staticClass: "wz-sidebar-logo-img-mini", attrs: { src: e.logoMiniSrc, alt: "Mini Logo" } }) : !t.visuallyCollapsed && e.logoSrc ? s("img", { staticClass: "wz-sidebar-logo-img", attrs: { src: e.logoSrc, alt: "Logo" } }) : e._e()] : [e.logoIconHtml ? s("span", { staticClass: "wz-sidebar-logo-icon", domProps: { innerHTML: e._s(e.logoIconHtml) } }) : e._e(), s("span", { directives: [{ name: "show", rawName: "v-show", value: !t.visuallyCollapsed, expression: "!visuallyCollapsed" }], staticClass: "wz-sidebar-logo-text" }, [e._v(e._s(e.logoText))])]];
|
|
175
|
+
})], 2), s("nav", { staticClass: "wz-sidebar-nav" }, [e._l(e.items, function(a, r) {
|
|
176
|
+
return [a.type === "group" ? s("div", { directives: [{ name: "show", rawName: "v-show", value: !t.visuallyCollapsed, expression: "!visuallyCollapsed" }], key: `group-${r}`, staticClass: "wz-sidebar-group" }, [e._v(" " + e._s(a.label) + " ")]) : s("div", { key: a.key || r, staticClass: "wz-sidebar-item-wrapper" }, [s("div", { staticClass: "wz-sidebar-item", class: { "wz-sidebar-item--active": t.isActive(a) }, attrs: { title: t.visuallyCollapsed ? a.label : null }, on: { click: function(o) {
|
|
177
|
+
return t.handleClick(a);
|
|
178
|
+
} } }, [s("span", { staticClass: "wz-sidebar-icon" }, [e._t("icon", function() {
|
|
179
|
+
return [a.icon ? s("i", { class: a.icon, staticStyle: { "font-size": "1.125rem" } }) : a.iconHtml ? s("span", { domProps: { innerHTML: e._s(a.iconHtml) } }) : s("i", { staticClass: "ri-checkbox-blank-circle-line", staticStyle: { "font-size": "10px" } })];
|
|
180
|
+
}, { item: a })], 2), s("span", { directives: [{ name: "show", rawName: "v-show", value: !t.visuallyCollapsed, expression: "!visuallyCollapsed" }], staticClass: "wz-sidebar-label" }, [e._v(e._s(a.label))]), t.hasChildren(a) ? s("span", { directives: [{ name: "show", rawName: "v-show", value: !t.visuallyCollapsed, expression: "!visuallyCollapsed" }], staticClass: "wz-sidebar-arrow", class: { "wz-sidebar-arrow--open": t.isOpen(a) } }, [s("i", { staticClass: "ri-arrow-right-s-line", staticStyle: { "font-size": "1.125rem" } })]) : e._e()]), s("div", { directives: [{ name: "show", rawName: "v-show", value: !t.visuallyCollapsed, expression: "!visuallyCollapsed" }], staticClass: "wz-sidebar-children-wrapper", class: { "is-open": t.hasChildren(a) && t.isOpen(a) } }, [s("div", { staticClass: "wz-sidebar-children-inner" }, [t.hasChildren(a) ? s("div", { staticClass: "wz-sidebar-children" }, e._l(a.children, function(o) {
|
|
181
|
+
return s("div", { key: o.key, staticClass: "wz-sidebar-child-item", class: { "wz-sidebar-child-item--active": t.isActive(o) }, on: { click: function(d) {
|
|
182
|
+
return t.handleChildClick(o);
|
|
183
|
+
} } }, [s("span", { staticClass: "wz-sidebar-label" }, [e._v(e._s(o.label))]), t.hasChildren(o) ? s("span", { staticClass: "wz-sidebar-arrow" }, [s("i", { staticClass: "ri-arrow-right-s-line", staticStyle: { "font-size": "1rem" } })]) : e._e()]);
|
|
180
184
|
}), 0) : e._e()])])])];
|
|
181
185
|
})], 2)]);
|
|
182
|
-
}, $ = [], x = /* @__PURE__ */
|
|
186
|
+
}, $ = [], x = /* @__PURE__ */ _(
|
|
183
187
|
k,
|
|
184
188
|
S,
|
|
185
189
|
$,
|
|
@@ -189,7 +193,7 @@ var S = function() {
|
|
|
189
193
|
null,
|
|
190
194
|
null
|
|
191
195
|
);
|
|
192
|
-
const
|
|
196
|
+
const H = x.exports, P = {
|
|
193
197
|
__name: "WzHeader",
|
|
194
198
|
props: {
|
|
195
199
|
/**
|
|
@@ -219,23 +223,23 @@ const P = x.exports, T = {
|
|
|
219
223
|
return { __sfc: !0, props: i, emit: e, initials: (a) => a ? a.split(" ").map((r) => r[0]).slice(0, 2).join("").toUpperCase() : "?" };
|
|
220
224
|
}
|
|
221
225
|
};
|
|
222
|
-
var
|
|
223
|
-
var e = this,
|
|
224
|
-
return
|
|
225
|
-
return
|
|
226
|
-
} } }, [
|
|
227
|
-
return [
|
|
228
|
-
return
|
|
229
|
-
} } }, [
|
|
230
|
-
return
|
|
231
|
-
} } }, [
|
|
232
|
-
}),
|
|
233
|
-
return [
|
|
234
|
-
return
|
|
235
|
-
} } }, [e.user.avatar ?
|
|
236
|
-
}),
|
|
237
|
-
return
|
|
238
|
-
} } }, [
|
|
226
|
+
var T = function() {
|
|
227
|
+
var e = this, s = e._self._c, t = e._self._setupProxy;
|
|
228
|
+
return s("header", { staticClass: "wz-header" }, [s("div", { staticClass: "wz-header-left" }, [s("button", { staticClass: "wz-header-action", attrs: { title: "Toggle menu" }, on: { click: function(a) {
|
|
229
|
+
return t.emit("menu-toggle");
|
|
230
|
+
} } }, [s("i", { class: e.collapsed ? "ri-close-line" : "ri-menu-line", staticStyle: { "font-size": "1.25rem" } })]), e._t("left")], 2), s("div", { staticClass: "wz-header-right" }, [e._t("actions", function() {
|
|
231
|
+
return [s("button", { staticClass: "wz-header-action", attrs: { title: "Search" }, on: { click: function(a) {
|
|
232
|
+
return t.emit("search");
|
|
233
|
+
} } }, [s("i", { staticClass: "ri-search-line", staticStyle: { "font-size": "1.125rem" } })]), e._m(0), e._m(1), s("div", { staticClass: "wz-header-badge" }, [s("button", { staticClass: "wz-header-action", attrs: { title: "Notifications" }, on: { click: function(a) {
|
|
234
|
+
return t.emit("notifications");
|
|
235
|
+
} } }, [s("i", { staticClass: "ri-notification-3-line", staticStyle: { "font-size": "1.125rem" } })]), e.notificationCount > 0 ? s("span", { staticClass: "wz-header-badge-dot" }, [e._v(" " + e._s(e.notificationCount > 9 ? "9+" : e.notificationCount) + " ")]) : e._e()]), e._m(2), e._m(3)];
|
|
236
|
+
}), s("div", { staticClass: "wz-header-divider" }), e._t("user", function() {
|
|
237
|
+
return [s("div", { staticClass: "wz-header-user", on: { click: function(a) {
|
|
238
|
+
return t.emit("user-click");
|
|
239
|
+
} } }, [e.user.avatar ? s("img", { staticClass: "wz-header-user-avatar", attrs: { src: e.user.avatar, alt: e.user.name } }) : s("div", { staticClass: "wz-header-user-avatar-placeholder" }, [e._v(" " + e._s(t.initials(e.user.name)) + " ")]), s("span", { staticClass: "wz-header-user-name" }, [e._v(e._s(e.user.name))])])];
|
|
240
|
+
}), s("button", { staticClass: "wz-header-action", attrs: { title: "Settings" }, on: { click: function(a) {
|
|
241
|
+
return t.emit("settings");
|
|
242
|
+
} } }, [s("i", { staticClass: "ri-settings-3-line", staticStyle: { "font-size": "1.125rem" } })])], 2)]);
|
|
239
243
|
}, N = [function() {
|
|
240
244
|
var i = this, e = i._self._c;
|
|
241
245
|
return i._self._setupProxy, e("button", { staticClass: "wz-header-action", attrs: { title: "Language" } }, [e("i", { staticClass: "ri-global-line", staticStyle: { "font-size": "1.125rem" } })]);
|
|
@@ -248,9 +252,9 @@ var H = function() {
|
|
|
248
252
|
}, function() {
|
|
249
253
|
var i = this, e = i._self._c;
|
|
250
254
|
return i._self._setupProxy, e("button", { staticClass: "wz-header-action", attrs: { title: "Fullscreen" } }, [e("i", { staticClass: "ri-fullscreen-line", staticStyle: { "font-size": "1.125rem" } })]);
|
|
251
|
-
}], R = /* @__PURE__ */
|
|
255
|
+
}], R = /* @__PURE__ */ _(
|
|
256
|
+
P,
|
|
252
257
|
T,
|
|
253
|
-
H,
|
|
254
258
|
N,
|
|
255
259
|
!1,
|
|
256
260
|
null,
|
|
@@ -270,16 +274,16 @@ const W = R.exports, B = {
|
|
|
270
274
|
}
|
|
271
275
|
},
|
|
272
276
|
setup(i) {
|
|
273
|
-
const e = i,
|
|
274
|
-
return { __sfc: !0, props: e, isCollapsed:
|
|
275
|
-
|
|
277
|
+
const e = i, s = p(e.defaultCollapsed);
|
|
278
|
+
return { __sfc: !0, props: e, isCollapsed: s, toggleSidebar: () => {
|
|
279
|
+
s.value = !s.value;
|
|
276
280
|
} };
|
|
277
281
|
}
|
|
278
282
|
};
|
|
279
283
|
var L = function() {
|
|
280
|
-
var e = this,
|
|
281
|
-
return
|
|
282
|
-
}, M = [], O = /* @__PURE__ */
|
|
284
|
+
var e = this, s = e._self._c, t = e._self._setupProxy;
|
|
285
|
+
return s("div", { staticClass: "wz-admin-layout" }, [s("div", { staticClass: "wz-admin-layout-sidebar-container" }, [e._t("sidebar", null, { collapsed: t.isCollapsed })], 2), s("div", { staticClass: "wz-admin-layout-main" }, [s("div", { staticClass: "wz-admin-layout-header-container" }, [e._t("header", null, { toggleSidebar: t.toggleSidebar, collapsed: t.isCollapsed })], 2), s("main", { staticClass: "wz-admin-layout-content" }, [e._t("default")], 2)])]);
|
|
286
|
+
}, M = [], O = /* @__PURE__ */ _(
|
|
283
287
|
B,
|
|
284
288
|
L,
|
|
285
289
|
M,
|
|
@@ -290,20 +294,20 @@ var L = function() {
|
|
|
290
294
|
null
|
|
291
295
|
);
|
|
292
296
|
const F = O.exports, A = {
|
|
293
|
-
WzButton:
|
|
294
|
-
WzSidebar:
|
|
297
|
+
WzButton: b,
|
|
298
|
+
WzSidebar: H,
|
|
295
299
|
WzHeader: W,
|
|
296
300
|
WzLayout: F
|
|
297
|
-
},
|
|
298
|
-
Object.entries(A).forEach(([e,
|
|
299
|
-
i.component(e,
|
|
301
|
+
}, m = (i) => {
|
|
302
|
+
Object.entries(A).forEach(([e, s]) => {
|
|
303
|
+
i.component(e, s);
|
|
300
304
|
});
|
|
301
305
|
};
|
|
302
|
-
typeof window < "u" && window.Vue &&
|
|
303
|
-
const V = { install:
|
|
306
|
+
typeof window < "u" && window.Vue && m(window.Vue);
|
|
307
|
+
const V = { install: m };
|
|
304
308
|
export {
|
|
305
|
-
|
|
309
|
+
b as WzButton,
|
|
306
310
|
W as WzHeader,
|
|
307
|
-
|
|
311
|
+
H as WzSidebar,
|
|
308
312
|
V as default
|
|
309
313
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(d,u){typeof exports=="object"&&typeof module<"u"?u(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],u):(d=typeof globalThis<"u"?globalThis:d||self,u(d.WizeAdminLibrary={},d.Vue))})(this,function(d,u){"use strict";const U="";function p(i,e,s,t,a,r,o,_){var n=typeof i=="function"?i.options:i;e&&(n.render=e,n.staticRenderFns=s,n._compiled=!0),t&&(n.functional=!0),r&&(n._scopeId="data-v-"+r);var c;if(o?(c=function(l){l=l||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,!l&&typeof __VUE_SSR_CONTEXT__<"u"&&(l=__VUE_SSR_CONTEXT__),a&&a.call(this,l),l&&l._registeredComponents&&l._registeredComponents.add(o)},n._ssrRegister=c):a&&(c=_?function(){a.call(this,(n.functional?this.parent:this).$root.$options.shadowRoot)}:a),c)if(n.functional){n._injectStyles=c;var y=n.render;n.render=function(f,z){return c.call(z),y(f,z)}}else{var v=n.beforeCreate;n.beforeCreate=v?[].concat(v,c):[c]}return{exports:i,options:n}}const g={__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 s=i,t=u.computed(()=>["wz-btn",`wz-btn-${s.variant}`,`wz-btn-${s.size}`,{"wz-btn-block":s.block}]);return{__sfc:!0,props:s,emit:e,classes:t,handleClick:r=>{s.disabled||e("click",r)}}}};var b=function(){var e=this,s=e._self._c,t=e._self._setupProxy;return s("button",{class:t.classes,attrs:{disabled:e.disabled},on:{click:t.handleClick}},[e._t("default")],2)},k=[],S=p(g,b,k,!1,null,null,null,null);const C=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 s=i,t=u.ref(new Set),a=u.ref(!1),r=u.computed(()=>s.collapsed&&!a.value),o=l=>l.key===s.activeKey,_=l=>l.children&&l.children.length>0,n=l=>t.value.has(l.key),c=l=>{if(!_(l)||r.value)return;const f=new Set(t.value);f.has(l.key)?f.delete(l.key):f.add(l.key),t.value=f};return{__sfc:!0,props:s,emit:e,openKeys:t,isHovered:a,visuallyCollapsed:r,isActive:o,hasChildren:_,isOpen:n,toggle:c,handleClick:l=>{if(r.value){e("item-click",l);return}_(l)?c(l):e("item-click",l)},handleChildClick:l=>{e("item-click",l)}}}};var x=function(){var e=this,s=e._self._c,t=e._self._setupProxy;return s("aside",{staticClass:"wz-sidebar",class:{"wz-sidebar--collapsed":t.visuallyCollapsed},on:{mouseenter:function(a){t.isHovered=!0},mouseleave:function(a){t.isHovered=!1}}},[s("div",{staticClass:"wz-sidebar-logo"},[e._t("logo",function(){return[e.logoSrc||e.logoMiniSrc?[t.visuallyCollapsed&&e.logoMiniSrc?s("img",{staticClass:"wz-sidebar-logo-img-mini",attrs:{src:e.logoMiniSrc,alt:"Mini Logo"}}):!t.visuallyCollapsed&&e.logoSrc?s("img",{staticClass:"wz-sidebar-logo-img",attrs:{src:e.logoSrc,alt:"Logo"}}):e._e()]:[e.logoIconHtml?s("span",{staticClass:"wz-sidebar-logo-icon",domProps:{innerHTML:e._s(e.logoIconHtml)}}):e._e(),s("span",{directives:[{name:"show",rawName:"v-show",value:!t.visuallyCollapsed,expression:"!visuallyCollapsed"}],staticClass:"wz-sidebar-logo-text"},[e._v(e._s(e.logoText))])]]})],2),s("nav",{staticClass:"wz-sidebar-nav"},[e._l(e.items,function(a,r){return[a.type==="group"?s("div",{directives:[{name:"show",rawName:"v-show",value:!t.visuallyCollapsed,expression:"!visuallyCollapsed"}],key:`group-${r}`,staticClass:"wz-sidebar-group"},[e._v(" "+e._s(a.label)+" ")]):s("div",{key:a.key||r,staticClass:"wz-sidebar-item-wrapper"},[s("div",{staticClass:"wz-sidebar-item",class:{"wz-sidebar-item--active":t.isActive(a)},attrs:{title:t.visuallyCollapsed?a.label:null},on:{click:function(o){return t.handleClick(a)}}},[s("span",{staticClass:"wz-sidebar-icon"},[e._t("icon",function(){return[a.icon?s("i",{class:a.icon,staticStyle:{"font-size":"1.125rem"}}):a.iconHtml?s("span",{domProps:{innerHTML:e._s(a.iconHtml)}}):s("i",{staticClass:"ri-checkbox-blank-circle-line",staticStyle:{"font-size":"10px"}})]},{item:a})],2),s("span",{directives:[{name:"show",rawName:"v-show",value:!t.visuallyCollapsed,expression:"!visuallyCollapsed"}],staticClass:"wz-sidebar-label"},[e._v(e._s(a.label))]),t.hasChildren(a)?s("span",{directives:[{name:"show",rawName:"v-show",value:!t.visuallyCollapsed,expression:"!visuallyCollapsed"}],staticClass:"wz-sidebar-arrow",class:{"wz-sidebar-arrow--open":t.isOpen(a)}},[s("i",{staticClass:"ri-arrow-right-s-line",staticStyle:{"font-size":"1.125rem"}})]):e._e()]),s("div",{directives:[{name:"show",rawName:"v-show",value:!t.visuallyCollapsed,expression:"!visuallyCollapsed"}],staticClass:"wz-sidebar-children-wrapper",class:{"is-open":t.hasChildren(a)&&t.isOpen(a)}},[s("div",{staticClass:"wz-sidebar-children-inner"},[t.hasChildren(a)?s("div",{staticClass:"wz-sidebar-children"},e._l(a.children,function(o){return s("div",{key:o.key,staticClass:"wz-sidebar-child-item",class:{"wz-sidebar-child-item--active":t.isActive(o)},on:{click:function(_){return t.handleChildClick(o)}}},[s("span",{staticClass:"wz-sidebar-label"},[e._v(e._s(o.label))]),t.hasChildren(o)?s("span",{staticClass:"wz-sidebar-arrow"},[s("i",{staticClass:"ri-arrow-right-s-line",staticStyle:{"font-size":"1rem"}})]):e._e()])}),0):e._e()])])])]})],2)])},H=[],T=p($,x,H,!1,null,null,null,null);const h=T.exports,W={__name:"WzHeader",props:{user:{type:Object,default:()=>({name:"User",avatar:null})},notificationCount:{type:Number,default:0},collapsed:{type:Boolean,default:!1}},emits:["menu-toggle","search","notifications","settings","user-click"],setup(i,{emit:e}){return{__sfc:!0,props:i,emit:e,initials:a=>a?a.split(" ").map(r=>r[0]).slice(0,2).join("").toUpperCase():"?"}}};var P=function(){var e=this,s=e._self._c,t=e._self._setupProxy;return s("header",{staticClass:"wz-header"},[s("div",{staticClass:"wz-header-left"},[s("button",{staticClass:"wz-header-action",attrs:{title:"Toggle menu"},on:{click:function(a){return t.emit("menu-toggle")}}},[s("i",{class:e.collapsed?"ri-close-line":"ri-menu-line",staticStyle:{"font-size":"1.25rem"}})]),e._t("left")],2),s("div",{staticClass:"wz-header-right"},[e._t("actions",function(){return[s("button",{staticClass:"wz-header-action",attrs:{title:"Search"},on:{click:function(a){return t.emit("search")}}},[s("i",{staticClass:"ri-search-line",staticStyle:{"font-size":"1.125rem"}})]),e._m(0),e._m(1),s("div",{staticClass:"wz-header-badge"},[s("button",{staticClass:"wz-header-action",attrs:{title:"Notifications"},on:{click:function(a){return t.emit("notifications")}}},[s("i",{staticClass:"ri-notification-3-line",staticStyle:{"font-size":"1.125rem"}})]),e.notificationCount>0?s("span",{staticClass:"wz-header-badge-dot"},[e._v(" "+e._s(e.notificationCount>9?"9+":e.notificationCount)+" ")]):e._e()]),e._m(2),e._m(3)]}),s("div",{staticClass:"wz-header-divider"}),e._t("user",function(){return[s("div",{staticClass:"wz-header-user",on:{click:function(a){return t.emit("user-click")}}},[e.user.avatar?s("img",{staticClass:"wz-header-user-avatar",attrs:{src:e.user.avatar,alt:e.user.name}}):s("div",{staticClass:"wz-header-user-avatar-placeholder"},[e._v(" "+e._s(t.initials(e.user.name))+" ")]),s("span",{staticClass:"wz-header-user-name"},[e._v(e._s(e.user.name))])])]}),s("button",{staticClass:"wz-header-action",attrs:{title:"Settings"},on:{click:function(a){return t.emit("settings")}}},[s("i",{staticClass:"ri-settings-3-line",staticStyle:{"font-size":"1.125rem"}})])],2)])},M=[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"}})])}],N=p(W,P,M,!1,null,null,null,null);const m=N.exports,R={__name:"WzLayout",props:{defaultCollapsed:{type:Boolean,default:!1}},setup(i){const e=i,s=u.ref(e.defaultCollapsed);return{__sfc:!0,props:e,isCollapsed:s,toggleSidebar:()=>{s.value=!s.value}}}};var B=function(){var e=this,s=e._self._c,t=e._self._setupProxy;return s("div",{staticClass:"wz-admin-layout"},[s("div",{staticClass:"wz-admin-layout-sidebar-container"},[e._t("sidebar",null,{collapsed:t.isCollapsed})],2),s("div",{staticClass:"wz-admin-layout-main"},[s("div",{staticClass:"wz-admin-layout-header-container"},[e._t("header",null,{toggleSidebar:t.toggleSidebar,collapsed:t.isCollapsed})],2),s("main",{staticClass:"wz-admin-layout-content"},[e._t("default")],2)])])},L=[],O=p(R,B,L,!1,null,null,null,null);const A=O.exports,F={WzButton:C,WzSidebar:h,WzHeader:m,WzLayout:A},w=i=>{Object.entries(F).forEach(([e,s])=>{i.component(e,s)})};typeof window<"u"&&window.Vue&&w(window.Vue);const V={install:w};d.WzButton=C,d.WzHeader=m,d.WzSidebar=h,d.default=V,Object.defineProperties(d,{__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.4",
|
|
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",
|