wize-admin-library 0.1.22 → 0.1.23
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/wize-admin-library.es.js +130 -136
- package/dist/wize-admin-library.umd.js +1 -1
- package/package.json +1 -1
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { computed as
|
|
2
|
-
function
|
|
3
|
-
var
|
|
4
|
-
e && (
|
|
1
|
+
import { computed as h, ref as _, onMounted as w, onBeforeUnmount as g } from "vue";
|
|
2
|
+
function f(n, e, t, a, s, l, o, d) {
|
|
3
|
+
var r = typeof n == "function" ? n.options : n;
|
|
4
|
+
e && (r.render = e, r.staticRenderFns = t, r._compiled = !0), a && (r.functional = !0), l && (r._scopeId = "data-v-" + l);
|
|
5
5
|
var c;
|
|
6
|
-
if (
|
|
6
|
+
if (o ? (c = function(i) {
|
|
7
7
|
i = i || // cached call
|
|
8
8
|
this.$vnode && this.$vnode.ssrContext || // stateful
|
|
9
|
-
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(
|
|
10
|
-
},
|
|
9
|
+
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(o);
|
|
10
|
+
}, r._ssrRegister = c) : s && (c = d ? function() {
|
|
11
11
|
s.call(
|
|
12
12
|
this,
|
|
13
|
-
(
|
|
13
|
+
(r.functional ? this.parent : this).$root.$options.shadowRoot
|
|
14
14
|
);
|
|
15
15
|
} : s), c)
|
|
16
|
-
if (
|
|
17
|
-
|
|
18
|
-
var
|
|
19
|
-
|
|
20
|
-
return c.call(
|
|
16
|
+
if (r.functional) {
|
|
17
|
+
r._injectStyles = c;
|
|
18
|
+
var v = r.render;
|
|
19
|
+
r.render = function(p, C) {
|
|
20
|
+
return c.call(C), v(p, C);
|
|
21
21
|
};
|
|
22
22
|
} else {
|
|
23
|
-
var
|
|
24
|
-
|
|
23
|
+
var u = r.beforeCreate;
|
|
24
|
+
r.beforeCreate = u ? [].concat(u, c) : [c];
|
|
25
25
|
}
|
|
26
26
|
return {
|
|
27
27
|
exports: n,
|
|
28
|
-
options:
|
|
28
|
+
options: r
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
|
-
const
|
|
31
|
+
const y = {
|
|
32
32
|
__name: "WzButton",
|
|
33
33
|
props: {
|
|
34
34
|
/**
|
|
@@ -66,7 +66,7 @@ const k = {
|
|
|
66
66
|
},
|
|
67
67
|
emits: ["click"],
|
|
68
68
|
setup(n, { emit: e }) {
|
|
69
|
-
const t = n, a =
|
|
69
|
+
const t = n, a = h(() => [
|
|
70
70
|
"wz-btn",
|
|
71
71
|
`wz-btn-${t.variant}`,
|
|
72
72
|
`wz-btn-${t.size}`,
|
|
@@ -77,20 +77,20 @@ const k = {
|
|
|
77
77
|
} };
|
|
78
78
|
}
|
|
79
79
|
};
|
|
80
|
-
var
|
|
80
|
+
var m = function() {
|
|
81
81
|
var e = this, t = e._self._c, a = e._self._setupProxy;
|
|
82
82
|
return t("button", { class: a.classes, attrs: { disabled: e.disabled }, on: { click: a.handleClick } }, [e._t("default")], 2);
|
|
83
|
-
},
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
83
|
+
}, b = [], k = /* @__PURE__ */ f(
|
|
84
|
+
y,
|
|
85
|
+
m,
|
|
86
|
+
b,
|
|
87
87
|
!1,
|
|
88
88
|
null,
|
|
89
89
|
null,
|
|
90
90
|
null,
|
|
91
91
|
null
|
|
92
92
|
);
|
|
93
|
-
const
|
|
93
|
+
const S = k.exports, $ = {
|
|
94
94
|
__name: "WzLayout",
|
|
95
95
|
props: {
|
|
96
96
|
/**
|
|
@@ -119,25 +119,25 @@ const M = x.exports, P = {
|
|
|
119
119
|
const e = n, t = _(e.defaultCollapsed), a = () => {
|
|
120
120
|
t.value = !t.value;
|
|
121
121
|
};
|
|
122
|
-
return
|
|
122
|
+
return w(() => {
|
|
123
123
|
typeof window < "u" && window.innerWidth <= 768 && (t.value = !0);
|
|
124
124
|
}), { __sfc: !0, props: e, isCollapsed: t, toggleSidebar: a };
|
|
125
125
|
}
|
|
126
126
|
};
|
|
127
|
-
var
|
|
127
|
+
var x = function() {
|
|
128
128
|
var e = this, t = e._self._c, a = e._self._setupProxy;
|
|
129
129
|
return t("div", { staticClass: "wz-admin-layout", class: "is-" + e.navigationStyle, attrs: { "data-theme": e.theme } }, [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), e.navigationStyle === "horizontal" ? t("div", { staticClass: "wz-admin-layout-horizontal-nav-container" }, [e._t("horizontal-nav")], 2) : e._e(), t("main", { staticClass: "wz-admin-layout-content" }, [e._t("default")], 2)])]);
|
|
130
|
-
},
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
130
|
+
}, M = [], P = /* @__PURE__ */ f(
|
|
131
|
+
$,
|
|
132
|
+
x,
|
|
133
|
+
M,
|
|
134
134
|
!1,
|
|
135
135
|
null,
|
|
136
136
|
null,
|
|
137
137
|
null,
|
|
138
138
|
null
|
|
139
139
|
);
|
|
140
|
-
const W =
|
|
140
|
+
const W = P.exports, H = {
|
|
141
141
|
__name: "WzSidebar",
|
|
142
142
|
props: {
|
|
143
143
|
/**
|
|
@@ -194,24 +194,24 @@ const W = O.exports, L = {
|
|
|
194
194
|
},
|
|
195
195
|
emits: ["item-click"],
|
|
196
196
|
setup(n, { emit: e }) {
|
|
197
|
-
const t = n, a = _(/* @__PURE__ */ new Set()), s = _(!1), l =
|
|
198
|
-
if (!
|
|
197
|
+
const t = n, a = _(/* @__PURE__ */ new Set()), s = _(!1), l = h(() => t.collapsed && !s.value), o = (i) => i.key === t.activeKey, d = (i) => i.children && i.children.length > 0, r = (i) => a.value.has(i.key), c = (i) => {
|
|
198
|
+
if (!d(i) || l.value)
|
|
199
199
|
return;
|
|
200
|
-
const
|
|
201
|
-
|
|
200
|
+
const p = new Set(a.value);
|
|
201
|
+
p.has(i.key) ? p.delete(i.key) : p.add(i.key), a.value = p;
|
|
202
202
|
};
|
|
203
|
-
return { __sfc: !0, props: t, emit: e, openKeys: a, isHovered: s, visuallyCollapsed: l, isActive:
|
|
203
|
+
return { __sfc: !0, props: t, emit: e, openKeys: a, isHovered: s, visuallyCollapsed: l, isActive: o, hasChildren: d, isOpen: r, toggle: c, handleClick: (i) => {
|
|
204
204
|
if (l.value) {
|
|
205
205
|
e("item-click", i);
|
|
206
206
|
return;
|
|
207
207
|
}
|
|
208
|
-
|
|
208
|
+
d(i) ? c(i) : e("item-click", i);
|
|
209
209
|
}, handleChildClick: (i) => {
|
|
210
210
|
e("item-click", i);
|
|
211
211
|
} };
|
|
212
212
|
}
|
|
213
213
|
};
|
|
214
|
-
var
|
|
214
|
+
var L = function() {
|
|
215
215
|
var e = this, t = e._self._c, a = e._self._setupProxy;
|
|
216
216
|
return t("aside", { staticClass: "wz-sidebar", class: { "wz-sidebar--collapsed": a.visuallyCollapsed }, on: { mouseenter: function(s) {
|
|
217
217
|
a.isHovered = !0;
|
|
@@ -220,27 +220,27 @@ var N = function() {
|
|
|
220
220
|
} } }, [t("div", { staticClass: "wz-sidebar-logo" }, [e._t("logo", function() {
|
|
221
221
|
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))])]];
|
|
222
222
|
})], 2), t("nav", { staticClass: "wz-sidebar-nav" }, [e._l(e.items, function(s, l) {
|
|
223
|
-
return [s.type === "group" ? t("div", { directives: [{ name: "show", rawName: "v-show", value: !a.visuallyCollapsed, expression: "!visuallyCollapsed" }], key: `group-${l}`, staticClass: "wz-sidebar-group" }, [e._v(" " + e._s(s.label) + " ")]) : t("div", { key: s.key || l, 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(
|
|
223
|
+
return [s.type === "group" ? t("div", { directives: [{ name: "show", rawName: "v-show", value: !a.visuallyCollapsed, expression: "!visuallyCollapsed" }], key: `group-${l}`, staticClass: "wz-sidebar-group" }, [e._v(" " + e._s(s.label) + " ")]) : t("div", { key: s.key || l, 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(o) {
|
|
224
224
|
return a.handleClick(s);
|
|
225
225
|
} } }, [t("span", { staticClass: "wz-sidebar-icon" }, [e._t("icon", function() {
|
|
226
226
|
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" } })];
|
|
227
|
-
}, { 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(
|
|
228
|
-
return t("div", { key:
|
|
229
|
-
return a.handleChildClick(
|
|
230
|
-
} } }, [t("span", { staticClass: "wz-sidebar-label" }, [e._v(e._s(
|
|
227
|
+
}, { 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(o) {
|
|
228
|
+
return t("div", { key: o.key, staticClass: "wz-sidebar-child-item", class: { "wz-sidebar-child-item--active": a.isActive(o) }, on: { click: function(d) {
|
|
229
|
+
return a.handleChildClick(o);
|
|
230
|
+
} } }, [t("span", { staticClass: "wz-sidebar-label" }, [e._v(e._s(o.label))]), a.hasChildren(o) ? t("span", { staticClass: "wz-sidebar-arrow" }, [t("i", { staticClass: "ri-arrow-right-s-line", staticStyle: { "font-size": "1rem" } })]) : e._e()]);
|
|
231
231
|
}), 0) : e._e()])])])];
|
|
232
232
|
})], 2)]);
|
|
233
|
-
},
|
|
233
|
+
}, N = [], O = /* @__PURE__ */ f(
|
|
234
|
+
H,
|
|
234
235
|
L,
|
|
235
236
|
N,
|
|
236
|
-
I,
|
|
237
237
|
!1,
|
|
238
238
|
null,
|
|
239
239
|
null,
|
|
240
240
|
null,
|
|
241
241
|
null
|
|
242
242
|
);
|
|
243
|
-
const
|
|
243
|
+
const T = O.exports, I = {
|
|
244
244
|
__name: "WzHeader",
|
|
245
245
|
props: {
|
|
246
246
|
/**
|
|
@@ -302,21 +302,21 @@ const U = R.exports, B = {
|
|
|
302
302
|
},
|
|
303
303
|
emits: ["menu-toggle", "search", "notifications", "settings", "user-click", "action-click", "user-menu-click"],
|
|
304
304
|
setup(n, { emit: e }) {
|
|
305
|
-
const t = n, a = (c) => c ? c.split(" ").map((
|
|
305
|
+
const t = n, a = (c) => c ? c.split(" ").map((v) => v[0]).slice(0, 2).join("").toUpperCase() : "?", s = _(!1), l = _(null), o = () => {
|
|
306
306
|
s.value = !s.value, e("user-click");
|
|
307
|
-
},
|
|
307
|
+
}, d = (c) => {
|
|
308
308
|
e("user-menu-click", c), s.value = !1;
|
|
309
|
-
},
|
|
309
|
+
}, r = (c) => {
|
|
310
310
|
l.value && !l.value.contains(c.target) && (s.value = !1);
|
|
311
311
|
};
|
|
312
|
-
return
|
|
313
|
-
document.addEventListener("click",
|
|
314
|
-
}),
|
|
315
|
-
document.removeEventListener("click",
|
|
316
|
-
}), { __sfc: !0, props: t, emit: e, initials: a, isUserMenuOpen: s, userMenuContainer: l, toggleUserMenu:
|
|
312
|
+
return w(() => {
|
|
313
|
+
document.addEventListener("click", r);
|
|
314
|
+
}), g(() => {
|
|
315
|
+
document.removeEventListener("click", r);
|
|
316
|
+
}), { __sfc: !0, props: t, emit: e, initials: a, isUserMenuOpen: s, userMenuContainer: l, toggleUserMenu: o, handleUserItemClick: d, handleClickOutside: r };
|
|
317
317
|
}
|
|
318
318
|
};
|
|
319
|
-
var
|
|
319
|
+
var R = function() {
|
|
320
320
|
var e = this, t = e._self._c, a = e._self._setupProxy;
|
|
321
321
|
return t("header", { staticClass: "wz-header", class: { "wz-header--horizontal": e.layoutMode === "horizontal" } }, [t("div", { staticClass: "wz-header-left" }, [e.layoutMode === "vertical" ? t("button", { staticClass: "wz-header-action wz-header-icon-desktop", attrs: { title: "Toggle Menu" }, on: { click: function(s) {
|
|
322
322
|
return e.$emit("menu-toggle");
|
|
@@ -339,13 +339,13 @@ var A = function() {
|
|
|
339
339
|
return s.stopPropagation(), a.toggleUserMenu.apply(null, arguments);
|
|
340
340
|
} } }, [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))])])];
|
|
341
341
|
}), 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, l) {
|
|
342
|
-
return t("div", { key: l, staticClass: "wz-header-dropdown-item", class: { "wz-header-dropdown-item--logout": s.isLogout }, on: { click: function(
|
|
342
|
+
return t("div", { key: l, staticClass: "wz-header-dropdown-item", class: { "wz-header-dropdown-item--logout": s.isLogout }, on: { click: function(o) {
|
|
343
343
|
return a.handleUserItemClick(s);
|
|
344
344
|
} } }, [s.icon && !s.isLogout ? t("i", { class: s.icon }) : e._e(), t("span", [e._v(e._s(s.label))])]);
|
|
345
345
|
}), 0)]) : e._e()], 2), t("button", { staticClass: "wz-header-action", attrs: { title: "Settings" }, on: { click: function(s) {
|
|
346
346
|
return a.emit("settings");
|
|
347
347
|
} } }, [t("i", { staticClass: "ri-settings-3-line wz-anim-spin", staticStyle: { "font-size": "1.125rem", display: "inline-block" } })])], 2)]);
|
|
348
|
-
},
|
|
348
|
+
}, U = [function() {
|
|
349
349
|
var n = this, e = n._self._c;
|
|
350
350
|
return n._self._setupProxy, e("button", { staticClass: "wz-header-action", attrs: { title: "Language" } }, [e("i", { staticClass: "ri-global-line", staticStyle: { "font-size": "1.125rem" } })]);
|
|
351
351
|
}, function() {
|
|
@@ -357,17 +357,17 @@ var A = function() {
|
|
|
357
357
|
}, function() {
|
|
358
358
|
var n = this, e = n._self._c;
|
|
359
359
|
return n._self._setupProxy, e("button", { staticClass: "wz-header-action", attrs: { title: "Fullscreen" } }, [e("i", { staticClass: "ri-fullscreen-line", staticStyle: { "font-size": "1.125rem" } })]);
|
|
360
|
-
}],
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
360
|
+
}], B = /* @__PURE__ */ f(
|
|
361
|
+
I,
|
|
362
|
+
R,
|
|
363
|
+
U,
|
|
364
364
|
!1,
|
|
365
365
|
null,
|
|
366
366
|
null,
|
|
367
367
|
null,
|
|
368
368
|
null
|
|
369
369
|
);
|
|
370
|
-
const
|
|
370
|
+
const A = B.exports, D = {
|
|
371
371
|
__name: "WzSettingsPanel",
|
|
372
372
|
props: {
|
|
373
373
|
/**
|
|
@@ -418,38 +418,38 @@ const K = F.exports, E = {
|
|
|
418
418
|
{ value: "horizontal", label: "Horizontal" }
|
|
419
419
|
]
|
|
420
420
|
}
|
|
421
|
-
], s =
|
|
422
|
-
return { __sfc: !0, props: t, emit: e, baseSettings: a, allSettings: s, handleSelection: (
|
|
423
|
-
const c = { ...t.value, [
|
|
424
|
-
e("input", c), e("setting-change", { id:
|
|
421
|
+
], s = h(() => [...a, ...t.extraSettings]);
|
|
422
|
+
return { __sfc: !0, props: t, emit: e, baseSettings: a, allSettings: s, handleSelection: (d, r) => {
|
|
423
|
+
const c = { ...t.value, [d]: r };
|
|
424
|
+
e("input", c), e("setting-change", { id: d, value: r });
|
|
425
425
|
}, closePanel: () => {
|
|
426
426
|
e("close");
|
|
427
427
|
} };
|
|
428
428
|
}
|
|
429
429
|
};
|
|
430
|
-
var
|
|
430
|
+
var F = function() {
|
|
431
431
|
var e = this, t = e._self._c, a = e._self._setupProxy;
|
|
432
432
|
return t("div", { staticClass: "wz-settings", class: { "wz-settings--open": e.isOpen } }, [t("div", { staticClass: "wz-settings-overlay", on: { click: a.closePanel } }), t("aside", { staticClass: "wz-settings-panel" }, [t("div", { staticClass: "wz-settings-header" }, [t("h3", { staticClass: "wz-settings-title" }, [e._v(e._s(e.title))]), t("button", { staticClass: "wz-settings-close", attrs: { title: "Close Settings" }, on: { click: a.closePanel } }, [t("i", { staticClass: "ri-close-circle-line" })])]), e._m(0), t("div", { staticClass: "wz-settings-body" }, [e._l(a.allSettings, function(s) {
|
|
433
433
|
return [t("div", { staticClass: "wz-settings-section" }, [t("h4", { staticClass: "wz-settings-section-title" }, [e._v(e._s(s.title))]), t("div", { staticClass: "wz-settings-radio-group" }, e._l(s.options, function(l) {
|
|
434
|
-
return t("label", { key: l.value, staticClass: "wz-settings-radio-label" }, [t("div", { staticClass: "wz-settings-radio-circle", class: { "wz-settings-radio-circle--active": e.value[s.id] === l.value } }, [t("span", { directives: [{ name: "show", rawName: "v-show", value: e.value[s.id] === l.value, expression: "value[setting.id] === opt.value" }], staticClass: "wz-settings-radio-dot" })]), t("input", { staticClass: "wz-settings-radio-native", attrs: { type: "radio", name: s.id }, domProps: { value: l.value, checked: e.value[s.id] === l.value }, on: { change: function(
|
|
434
|
+
return t("label", { key: l.value, staticClass: "wz-settings-radio-label" }, [t("div", { staticClass: "wz-settings-radio-circle", class: { "wz-settings-radio-circle--active": e.value[s.id] === l.value } }, [t("span", { directives: [{ name: "show", rawName: "v-show", value: e.value[s.id] === l.value, expression: "value[setting.id] === opt.value" }], staticClass: "wz-settings-radio-dot" })]), t("input", { staticClass: "wz-settings-radio-native", attrs: { type: "radio", name: s.id }, domProps: { value: l.value, checked: e.value[s.id] === l.value }, on: { change: function(o) {
|
|
435
435
|
return a.handleSelection(s.id, l.value);
|
|
436
436
|
} } }), t("span", { staticClass: "wz-settings-radio-text" }, [e._v(e._s(l.label))])]);
|
|
437
437
|
}), 0)])];
|
|
438
438
|
})], 2)])]);
|
|
439
|
-
},
|
|
439
|
+
}, K = [function() {
|
|
440
440
|
var n = this, e = n._self._c;
|
|
441
441
|
return n._self._setupProxy, e("div", { staticClass: "wz-settings-tabs" }, [e("div", { staticClass: "wz-settings-tab wz-settings-tab--active" }, [n._v("Theme Style")])]);
|
|
442
|
-
}],
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
442
|
+
}], E = /* @__PURE__ */ f(
|
|
443
|
+
D,
|
|
444
|
+
F,
|
|
445
|
+
K,
|
|
446
446
|
!1,
|
|
447
447
|
null,
|
|
448
448
|
null,
|
|
449
449
|
null,
|
|
450
450
|
null
|
|
451
451
|
);
|
|
452
|
-
const
|
|
452
|
+
const V = E.exports, j = {
|
|
453
453
|
__name: "WzHorizontalNav",
|
|
454
454
|
props: {
|
|
455
455
|
items: {
|
|
@@ -463,90 +463,84 @@ const q = X.exports, G = {
|
|
|
463
463
|
},
|
|
464
464
|
emits: ["item-click"],
|
|
465
465
|
setup(n, { emit: e }) {
|
|
466
|
-
const t = n, a = _(null), s = (
|
|
467
|
-
a.value && a.value.scrollBy({ left:
|
|
468
|
-
}, l = _(null),
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
466
|
+
const t = n, a = _(null), s = (u) => {
|
|
467
|
+
a.value && a.value.scrollBy({ left: u * 250, behavior: "smooth" });
|
|
468
|
+
}, l = _(null), o = _({}), d = (u) => {
|
|
469
|
+
const i = u.getBoundingClientRect();
|
|
470
|
+
o.value = {
|
|
471
|
+
top: i.bottom + 2 + "px",
|
|
472
|
+
left: i.left + "px"
|
|
473
|
+
};
|
|
474
|
+
}, r = (u, i) => {
|
|
475
|
+
if (!u.children || u.children.length === 0) {
|
|
476
|
+
e("item-click", u), l.value = null;
|
|
474
477
|
return;
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
}, p = () => {
|
|
482
|
-
o(), u = setTimeout(() => {
|
|
483
|
-
l.value = null;
|
|
484
|
-
}, 150);
|
|
485
|
-
}, w = () => {
|
|
486
|
-
o();
|
|
487
|
-
}, i = (d) => {
|
|
488
|
-
d.children && d.children.length > 0 || e("item-click", d);
|
|
489
|
-
}, v = (d) => {
|
|
490
|
-
e("item-click", d), l.value = null;
|
|
491
|
-
}, f = () => {
|
|
492
|
-
l.value = null;
|
|
478
|
+
}
|
|
479
|
+
l.value === u.key ? l.value = null : (d(i.currentTarget), l.value = u.key);
|
|
480
|
+
}, c = (u) => {
|
|
481
|
+
e("item-click", u), l.value = null;
|
|
482
|
+
}, v = (u) => {
|
|
483
|
+
u.target.closest(".wz-horizontal-nav") || (l.value = null);
|
|
493
484
|
};
|
|
494
|
-
return
|
|
495
|
-
document.addEventListener("click",
|
|
496
|
-
}),
|
|
497
|
-
document.removeEventListener("click",
|
|
498
|
-
}), { __sfc: !0, props: t, emit: e, trackWrapper: a, scroll: s, openDropdown: l, dropdownStyle:
|
|
485
|
+
return w(() => {
|
|
486
|
+
document.addEventListener("click", v);
|
|
487
|
+
}), g(() => {
|
|
488
|
+
document.removeEventListener("click", v);
|
|
489
|
+
}), { __sfc: !0, props: t, emit: e, trackWrapper: a, scroll: s, openDropdown: l, dropdownStyle: o, positionDropdown: d, toggleDropdown: r, handleChildClick: c, handleDocClick: v };
|
|
499
490
|
}
|
|
500
491
|
};
|
|
501
|
-
var
|
|
492
|
+
var X = function() {
|
|
502
493
|
var e = this, t = e._self._c, a = e._self._setupProxy;
|
|
503
494
|
return t("div", { staticClass: "wz-horizontal-nav" }, [t("button", { staticClass: "wz-horizontal-nav-arrow", on: { click: function(s) {
|
|
504
|
-
return a.scroll(-1);
|
|
495
|
+
return s.stopPropagation(), a.scroll(-1);
|
|
505
496
|
} } }, [t("i", { staticClass: "ri-arrow-left-s-line" })]), t("div", { ref: "trackWrapper", staticClass: "wz-horizontal-nav-track-wrapper" }, [t("div", { staticClass: "wz-horizontal-nav-track" }, [e._l(e.items, function(s, l) {
|
|
506
|
-
return [s.type !== "group" ? t("div", { key: s.key || l, staticClass: "wz-horizontal-nav-item", class: {
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
497
|
+
return [s.type !== "group" ? t("div", { key: s.key || l, staticClass: "wz-horizontal-nav-item", class: {
|
|
498
|
+
"wz-horizontal-nav-item--active": s.key === e.activeKey || s.children && s.children.some((o) => o.key === e.activeKey),
|
|
499
|
+
"wz-horizontal-nav-item--open": a.openDropdown === s.key
|
|
500
|
+
}, on: { click: function(o) {
|
|
501
|
+
return o.stopPropagation(), a.toggleDropdown(s, o);
|
|
502
|
+
} } }, [s.icon ? t("i", { class: s.icon }) : e._e(), t("span", [e._v(e._s(s.label))]), s.children && s.children.length > 0 ? t("i", { staticClass: "ri-arrow-down-s-line wz-horizontal-nav-chevron" }) : e._e()]) : e._e()];
|
|
511
503
|
})], 2)]), t("button", { staticClass: "wz-horizontal-nav-arrow", on: { click: function(s) {
|
|
512
|
-
return a.scroll(1);
|
|
513
|
-
} } }, [t("i", { staticClass: "ri-arrow-right-s-line" })]), a.openDropdown ? t("div", { staticClass: "wz-horizontal-nav-dropdown", style: a.dropdownStyle, on: {
|
|
504
|
+
return s.stopPropagation(), a.scroll(1);
|
|
505
|
+
} } }, [t("i", { staticClass: "ri-arrow-right-s-line" })]), a.openDropdown ? t("div", { staticClass: "wz-horizontal-nav-dropdown", style: a.dropdownStyle, on: { click: function(s) {
|
|
506
|
+
s.stopPropagation();
|
|
507
|
+
} } }, [e._l(e.items, function(s) {
|
|
514
508
|
return [s.key === a.openDropdown && s.children ? e._l(s.children, function(l) {
|
|
515
|
-
return t("div", { key: l.key, staticClass: "wz-horizontal-dropdown-child", class: { "wz-horizontal-dropdown-child--active": l.key === e.activeKey }, on: { click: function(
|
|
516
|
-
return
|
|
509
|
+
return t("div", { key: l.key, staticClass: "wz-horizontal-dropdown-child", class: { "wz-horizontal-dropdown-child--active": l.key === e.activeKey }, on: { click: function(o) {
|
|
510
|
+
return o.stopPropagation(), a.handleChildClick(l);
|
|
517
511
|
} } }, [e._v(" " + e._s(l.label) + " ")]);
|
|
518
512
|
}) : e._e()];
|
|
519
513
|
})], 2) : e._e()]);
|
|
520
|
-
},
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
514
|
+
}, q = [], G = /* @__PURE__ */ f(
|
|
515
|
+
j,
|
|
516
|
+
X,
|
|
517
|
+
q,
|
|
524
518
|
!1,
|
|
525
519
|
null,
|
|
526
520
|
null,
|
|
527
521
|
null,
|
|
528
522
|
null
|
|
529
523
|
);
|
|
530
|
-
const
|
|
531
|
-
WzButton:
|
|
532
|
-
WzSidebar:
|
|
533
|
-
WzHeader:
|
|
524
|
+
const J = G.exports, Q = {
|
|
525
|
+
WzButton: S,
|
|
526
|
+
WzSidebar: T,
|
|
527
|
+
WzHeader: A,
|
|
534
528
|
WzLayout: W,
|
|
535
|
-
WzSettingsPanel:
|
|
536
|
-
WzHorizontalNav:
|
|
537
|
-
},
|
|
538
|
-
Object.entries(
|
|
529
|
+
WzSettingsPanel: V,
|
|
530
|
+
WzHorizontalNav: J
|
|
531
|
+
}, z = (n) => {
|
|
532
|
+
Object.entries(Q).forEach(([e, t]) => {
|
|
539
533
|
n.component(e, t);
|
|
540
534
|
});
|
|
541
535
|
};
|
|
542
|
-
typeof window < "u" && window.Vue &&
|
|
543
|
-
const
|
|
536
|
+
typeof window < "u" && window.Vue && z(window.Vue);
|
|
537
|
+
const Z = { install: z };
|
|
544
538
|
export {
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
539
|
+
S as WzButton,
|
|
540
|
+
A as WzHeader,
|
|
541
|
+
J as WzHorizontalNav,
|
|
548
542
|
W as WzLayout,
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
543
|
+
V as WzSettingsPanel,
|
|
544
|
+
T as WzSidebar,
|
|
545
|
+
Z as default
|
|
552
546
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(v,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],d):(v=typeof globalThis<"u"?globalThis:v||self,d(v.WizeAdminLibrary={},v.Vue))})(this,function(v,d){"use strict";const ee="";function f(n,e,t,a,s,l,r,u){var o=typeof n=="function"?n.options:n;e&&(o.render=e,o.staticRenderFns=t,o._compiled=!0),a&&(o.functional=!0),l&&(o._scopeId="data-v-"+l);var c;if(r?(c=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(r)},o._ssrRegister=c):s&&(c=u?function(){s.call(this,(o.functional?this.parent:this).$root.$options.shadowRoot)}:s),c)if(o.functional){o._injectStyles=c;var h=o.render;o.render=function(p,w){return c.call(w),h(p,w)}}else{var C=o.beforeCreate;o.beforeCreate=C?[].concat(C,c):[c]}return{exports:n,options:o}}const M={__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:l=>{t.disabled||e("click",l)}}}};var P=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)},x=[],W=f(M,P,x,!1,null,null,null,null);const g=W.exports,H={__name:"WzLayout",props:{defaultCollapsed:{type:Boolean,default:!1},navigationStyle:{type:String,default:"vertical"},theme:{type:String,default:"light"}},setup(n){const e=n,t=d.ref(e.defaultCollapsed),a=()=>{t.value=!t.value};return d.onMounted(()=>{typeof window<"u"&&window.innerWidth<=768&&(t.value=!0)}),{__sfc:!0,props:e,isCollapsed:t,toggleSidebar:a}}};var T=function(){var e=this,t=e._self._c,a=e._self._setupProxy;return t("div",{staticClass:"wz-admin-layout",class:"is-"+e.navigationStyle,attrs:{"data-theme":e.theme}},[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),e.navigationStyle==="horizontal"?t("div",{staticClass:"wz-admin-layout-horizontal-nav-container"},[e._t("horizontal-nav")],2):e._e(),t("main",{staticClass:"wz-admin-layout-content"},[e._t("default")],2)])])},L=[],O=f(H,T,L,!1,null,null,null,null);const z=O.exports,N={__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),l=d.computed(()=>t.collapsed&&!s.value),r=i=>i.key===t.activeKey,u=i=>i.children&&i.children.length>0,o=i=>a.value.has(i.key),c=i=>{if(!u(i)||l.value)return;const p=new Set(a.value);p.has(i.key)?p.delete(i.key):p.add(i.key),a.value=p};return{__sfc:!0,props:t,emit:e,openKeys:a,isHovered:s,visuallyCollapsed:l,isActive:r,hasChildren:u,isOpen:o,toggle:c,handleClick:i=>{if(l.value){e("item-click",i);return}u(i)?c(i):e("item-click",i)},handleChildClick:i=>{e("item-click",i)}}}};var B=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,l){return[s.type==="group"?t("div",{directives:[{name:"show",rawName:"v-show",value:!a.visuallyCollapsed,expression:"!visuallyCollapsed"}],key:`group-${l}`,staticClass:"wz-sidebar-group"},[e._v(" "+e._s(s.label)+" ")]):t("div",{key:s.key||l,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(r){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(r){return t("div",{key:r.key,staticClass:"wz-sidebar-child-item",class:{"wz-sidebar-child-item--active":a.isActive(r)},on:{click:function(u){return a.handleChildClick(r)}}},[t("span",{staticClass:"wz-sidebar-label"},[e._v(e._s(r.label))]),a.hasChildren(r)?t("span",{staticClass:"wz-sidebar-arrow"},[t("i",{staticClass:"ri-arrow-right-s-line",staticStyle:{"font-size":"1rem"}})]):e._e()])}),0):e._e()])])])]})],2)])},U=[],I=f(N,B,U,!1,null,null,null,null);const y=I.exports,R={__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:""},layoutMode:{type:String,default:"vertical"}},emits:["menu-toggle","search","notifications","settings","user-click","action-click","user-menu-click"],setup(n,{emit:e}){const t=n,a=c=>c?c.split(" ").map(h=>h[0]).slice(0,2).join("").toUpperCase():"?",s=d.ref(!1),l=d.ref(null),r=()=>{s.value=!s.value,e("user-click")},u=c=>{e("user-menu-click",c),s.value=!1},o=c=>{l.value&&!l.value.contains(c.target)&&(s.value=!1)};return d.onMounted(()=>{document.addEventListener("click",o)}),d.onBeforeUnmount(()=>{document.removeEventListener("click",o)}),{__sfc:!0,props:t,emit:e,initials:a,isUserMenuOpen:s,userMenuContainer:l,toggleUserMenu:r,handleUserItemClick:u,handleClickOutside:o}}};var A=function(){var e=this,t=e._self._c,a=e._self._setupProxy;return t("header",{staticClass:"wz-header",class:{"wz-header--horizontal":e.layoutMode==="horizontal"}},[t("div",{staticClass:"wz-header-left"},[e.layoutMode==="vertical"?t("button",{staticClass:"wz-header-action wz-header-icon-desktop",attrs:{title:"Toggle Menu"},on:{click:function(s){return e.$emit("menu-toggle")}}},[t("i",{class:e.collapsed?"ri-menu-unfold-line":"ri-menu-fold-line"})]):e._e(),t("button",{staticClass:"wz-header-action wz-header-icon-mobile",staticStyle:{display:"none"},attrs:{title:"Toggle Menu"},on:{click:function(s){return e.$emit("menu-toggle")}}},[t("i",{staticClass:"ri-menu-2-line"})]),t("div",{staticClass:"wz-header-dynamic-logo",class:e.layoutMode==="horizontal"?"wz-header-logo-always-visible":"wz-header-mobile-logo"},[e.logoSrc?t("img",{staticClass:"wz-header-dynamic-logo-img",attrs:{src:e.logoSrc,alt:"Logo"}}):e._e()]),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(l){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(l){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,l){return t("div",{key:l,staticClass:"wz-header-dropdown-item",class:{"wz-header-dropdown-item--logout":s.isLogout},on:{click:function(r){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)])},D=[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"}})])}],F=f(R,A,D,!1,null,null,null,null);const m=F.exports,K={__name:"WzSettingsPanel",props:{isOpen:{type:Boolean,default:!1},title:{type:String,default:"Switcher"},value:{type:Object,default:()=>({})},extraSettings:{type:Array,default:()=>[]}},emits:["close","input","setting-change"],setup(n,{emit:e}){const t=n,a=[{id:"themeMode",title:"Theme Color Mode:",options:[{value:"light",label:"Light"},{value:"dark",label:"Dark"}]},{id:"navigationStyle",title:"Navigation Styles:",options:[{value:"vertical",label:"Vertical"},{value:"horizontal",label:"Horizontal"}]}],s=d.computed(()=>[...a,...t.extraSettings]);return{__sfc:!0,props:t,emit:e,baseSettings:a,allSettings:s,handleSelection:(u,o)=>{const c={...t.value,[u]:o};e("input",c),e("setting-change",{id:u,value:o})},closePanel:()=>{e("close")}}}};var E=function(){var e=this,t=e._self._c,a=e._self._setupProxy;return t("div",{staticClass:"wz-settings",class:{"wz-settings--open":e.isOpen}},[t("div",{staticClass:"wz-settings-overlay",on:{click:a.closePanel}}),t("aside",{staticClass:"wz-settings-panel"},[t("div",{staticClass:"wz-settings-header"},[t("h3",{staticClass:"wz-settings-title"},[e._v(e._s(e.title))]),t("button",{staticClass:"wz-settings-close",attrs:{title:"Close Settings"},on:{click:a.closePanel}},[t("i",{staticClass:"ri-close-circle-line"})])]),e._m(0),t("div",{staticClass:"wz-settings-body"},[e._l(a.allSettings,function(s){return[t("div",{staticClass:"wz-settings-section"},[t("h4",{staticClass:"wz-settings-section-title"},[e._v(e._s(s.title))]),t("div",{staticClass:"wz-settings-radio-group"},e._l(s.options,function(l){return t("label",{key:l.value,staticClass:"wz-settings-radio-label"},[t("div",{staticClass:"wz-settings-radio-circle",class:{"wz-settings-radio-circle--active":e.value[s.id]===l.value}},[t("span",{directives:[{name:"show",rawName:"v-show",value:e.value[s.id]===l.value,expression:"value[setting.id] === opt.value"}],staticClass:"wz-settings-radio-dot"})]),t("input",{staticClass:"wz-settings-radio-native",attrs:{type:"radio",name:s.id},domProps:{value:l.value,checked:e.value[s.id]===l.value},on:{change:function(r){return a.handleSelection(s.id,l.value)}}}),t("span",{staticClass:"wz-settings-radio-text"},[e._v(e._s(l.label))])])}),0)])]})],2)])])},V=[function(){var n=this,e=n._self._c;return n._self._setupProxy,e("div",{staticClass:"wz-settings-tabs"},[e("div",{staticClass:"wz-settings-tab wz-settings-tab--active"},[n._v("Theme Style")])])}],j=f(K,E,V,!1,null,null,null,null);const b=j.exports,X={__name:"WzHorizontalNav",props:{items:{type:Array,default:()=>[]},activeKey:{type:String,default:null}},emits:["item-click"],setup(n,{emit:e}){const t=n,a=d.ref(null),s=_=>{a.value&&a.value.scrollBy({left:_*250,behavior:"smooth"})},l=d.ref(null),r=d.ref({});let u=null;const o=()=>{u&&(clearTimeout(u),u=null)},c=(_,Z)=>{if(!_.children||_.children.length===0)return;o();const $=Z.currentTarget.getBoundingClientRect();r.value={top:$.bottom+"px",left:$.left+"px"},l.value=_.key},h=()=>{o(),u=setTimeout(()=>{l.value=null},150)},C=()=>{o()},i=_=>{_.children&&_.children.length>0||e("item-click",_)},p=_=>{e("item-click",_),l.value=null},w=()=>{l.value=null};return d.onMounted(()=>{document.addEventListener("click",w)}),d.onBeforeUnmount(()=>{document.removeEventListener("click",w),o()}),{__sfc:!0,props:t,emit:e,trackWrapper:a,scroll:s,openDropdown:l,dropdownStyle:r,hideTimer:u,clearHideTimer:o,showDropdown:c,scheduleHide:h,keepDropdownOpen:C,handleClick:i,handleChildClick:p,handleDocClick:w}}};var q=function(){var e=this,t=e._self._c,a=e._self._setupProxy;return t("div",{staticClass:"wz-horizontal-nav"},[t("button",{staticClass:"wz-horizontal-nav-arrow",on:{click:function(s){return a.scroll(-1)}}},[t("i",{staticClass:"ri-arrow-left-s-line"})]),t("div",{ref:"trackWrapper",staticClass:"wz-horizontal-nav-track-wrapper"},[t("div",{staticClass:"wz-horizontal-nav-track"},[e._l(e.items,function(s,l){return[s.type!=="group"?t("div",{key:s.key||l,staticClass:"wz-horizontal-nav-item",class:{"wz-horizontal-nav-item--active":s.key===e.activeKey||s.children&&s.children.some(r=>r.key===e.activeKey)},on:{click:function(r){return r.stopPropagation(),a.handleClick(s)},mouseenter:function(r){return a.showDropdown(s,r)},mouseleave:a.scheduleHide}},[s.icon?t("i",{class:s.icon}):e._e(),t("span",[e._v(e._s(s.label))]),s.children&&s.children.length>0?t("i",{staticClass:"ri-arrow-down-s-line wz-horizontal-nav-chevron"}):e._e()]):e._e()]})],2)]),t("button",{staticClass:"wz-horizontal-nav-arrow",on:{click:function(s){return a.scroll(1)}}},[t("i",{staticClass:"ri-arrow-right-s-line"})]),a.openDropdown?t("div",{staticClass:"wz-horizontal-nav-dropdown",style:a.dropdownStyle,on:{mouseenter:a.keepDropdownOpen,mouseleave:a.scheduleHide}},[e._l(e.items,function(s){return[s.key===a.openDropdown&&s.children?e._l(s.children,function(l){return t("div",{key:l.key,staticClass:"wz-horizontal-dropdown-child",class:{"wz-horizontal-dropdown-child--active":l.key===e.activeKey},on:{click:function(r){return r.stopPropagation(),a.handleChildClick(l)}}},[e._v(" "+e._s(l.label)+" ")])}):e._e()]})],2):e._e()])},G=[],J=f(X,q,G,!1,null,null,null,null);const k=J.exports,Q={WzButton:g,WzSidebar:y,WzHeader:m,WzLayout:z,WzSettingsPanel:b,WzHorizontalNav:k},S=n=>{Object.entries(Q).forEach(([e,t])=>{n.component(e,t)})};typeof window<"u"&&window.Vue&&S(window.Vue);const Y={install:S};v.WzButton=g,v.WzHeader=m,v.WzHorizontalNav=k,v.WzLayout=z,v.WzSettingsPanel=b,v.WzSidebar=y,v.default=Y,Object.defineProperties(v,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(_,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],d):(_=typeof globalThis<"u"?globalThis:_||self,d(_.WizeAdminLibrary={},_.Vue))})(this,function(_,d){"use strict";const Q="";function f(n,e,t,a,s,i,o,v){var r=typeof n=="function"?n.options:n;e&&(r.render=e,r.staticRenderFns=t,r._compiled=!0),a&&(r.functional=!0),i&&(r._scopeId="data-v-"+i);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__),s&&s.call(this,l),l&&l._registeredComponents&&l._registeredComponents.add(o)},r._ssrRegister=c):s&&(c=v?function(){s.call(this,(r.functional?this.parent:this).$root.$options.shadowRoot)}:s),c)if(r.functional){r._injectStyles=c;var p=r.render;r.render=function(h,k){return c.call(k),p(h,k)}}else{var u=r.beforeCreate;r.beforeCreate=u?[].concat(u,c):[c]}return{exports:n,options:r}}const S={__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:i=>{t.disabled||e("click",i)}}}};var $=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)},M=[],P=f(S,$,M,!1,null,null,null,null);const w=P.exports,x={__name:"WzLayout",props:{defaultCollapsed:{type:Boolean,default:!1},navigationStyle:{type:String,default:"vertical"},theme:{type:String,default:"light"}},setup(n){const e=n,t=d.ref(e.defaultCollapsed),a=()=>{t.value=!t.value};return d.onMounted(()=>{typeof window<"u"&&window.innerWidth<=768&&(t.value=!0)}),{__sfc:!0,props:e,isCollapsed:t,toggleSidebar:a}}};var W=function(){var e=this,t=e._self._c,a=e._self._setupProxy;return t("div",{staticClass:"wz-admin-layout",class:"is-"+e.navigationStyle,attrs:{"data-theme":e.theme}},[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),e.navigationStyle==="horizontal"?t("div",{staticClass:"wz-admin-layout-horizontal-nav-container"},[e._t("horizontal-nav")],2):e._e(),t("main",{staticClass:"wz-admin-layout-content"},[e._t("default")],2)])])},H=[],L=f(x,W,H,!1,null,null,null,null);const C=L.exports,T={__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),i=d.computed(()=>t.collapsed&&!s.value),o=l=>l.key===t.activeKey,v=l=>l.children&&l.children.length>0,r=l=>a.value.has(l.key),c=l=>{if(!v(l)||i.value)return;const h=new Set(a.value);h.has(l.key)?h.delete(l.key):h.add(l.key),a.value=h};return{__sfc:!0,props:t,emit:e,openKeys:a,isHovered:s,visuallyCollapsed:i,isActive:o,hasChildren:v,isOpen:r,toggle:c,handleClick:l=>{if(i.value){e("item-click",l);return}v(l)?c(l):e("item-click",l)},handleChildClick:l=>{e("item-click",l)}}}};var N=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,i){return[s.type==="group"?t("div",{directives:[{name:"show",rawName:"v-show",value:!a.visuallyCollapsed,expression:"!visuallyCollapsed"}],key:`group-${i}`,staticClass:"wz-sidebar-group"},[e._v(" "+e._s(s.label)+" ")]):t("div",{key:s.key||i,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(o){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(o){return t("div",{key:o.key,staticClass:"wz-sidebar-child-item",class:{"wz-sidebar-child-item--active":a.isActive(o)},on:{click:function(v){return a.handleChildClick(o)}}},[t("span",{staticClass:"wz-sidebar-label"},[e._v(e._s(o.label))]),a.hasChildren(o)?t("span",{staticClass:"wz-sidebar-arrow"},[t("i",{staticClass:"ri-arrow-right-s-line",staticStyle:{"font-size":"1rem"}})]):e._e()])}),0):e._e()])])])]})],2)])},O=[],B=f(T,N,O,!1,null,null,null,null);const g=B.exports,U={__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:""},layoutMode:{type:String,default:"vertical"}},emits:["menu-toggle","search","notifications","settings","user-click","action-click","user-menu-click"],setup(n,{emit:e}){const t=n,a=c=>c?c.split(" ").map(p=>p[0]).slice(0,2).join("").toUpperCase():"?",s=d.ref(!1),i=d.ref(null),o=()=>{s.value=!s.value,e("user-click")},v=c=>{e("user-menu-click",c),s.value=!1},r=c=>{i.value&&!i.value.contains(c.target)&&(s.value=!1)};return d.onMounted(()=>{document.addEventListener("click",r)}),d.onBeforeUnmount(()=>{document.removeEventListener("click",r)}),{__sfc:!0,props:t,emit:e,initials:a,isUserMenuOpen:s,userMenuContainer:i,toggleUserMenu:o,handleUserItemClick:v,handleClickOutside:r}}};var I=function(){var e=this,t=e._self._c,a=e._self._setupProxy;return t("header",{staticClass:"wz-header",class:{"wz-header--horizontal":e.layoutMode==="horizontal"}},[t("div",{staticClass:"wz-header-left"},[e.layoutMode==="vertical"?t("button",{staticClass:"wz-header-action wz-header-icon-desktop",attrs:{title:"Toggle Menu"},on:{click:function(s){return e.$emit("menu-toggle")}}},[t("i",{class:e.collapsed?"ri-menu-unfold-line":"ri-menu-fold-line"})]):e._e(),t("button",{staticClass:"wz-header-action wz-header-icon-mobile",staticStyle:{display:"none"},attrs:{title:"Toggle Menu"},on:{click:function(s){return e.$emit("menu-toggle")}}},[t("i",{staticClass:"ri-menu-2-line"})]),t("div",{staticClass:"wz-header-dynamic-logo",class:e.layoutMode==="horizontal"?"wz-header-logo-always-visible":"wz-header-mobile-logo"},[e.logoSrc?t("img",{staticClass:"wz-header-dynamic-logo-img",attrs:{src:e.logoSrc,alt:"Logo"}}):e._e()]),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(i){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(i){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,i){return t("div",{key:i,staticClass:"wz-header-dropdown-item",class:{"wz-header-dropdown-item--logout":s.isLogout},on:{click:function(o){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)])},R=[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"}})])}],A=f(U,I,R,!1,null,null,null,null);const z=A.exports,D={__name:"WzSettingsPanel",props:{isOpen:{type:Boolean,default:!1},title:{type:String,default:"Switcher"},value:{type:Object,default:()=>({})},extraSettings:{type:Array,default:()=>[]}},emits:["close","input","setting-change"],setup(n,{emit:e}){const t=n,a=[{id:"themeMode",title:"Theme Color Mode:",options:[{value:"light",label:"Light"},{value:"dark",label:"Dark"}]},{id:"navigationStyle",title:"Navigation Styles:",options:[{value:"vertical",label:"Vertical"},{value:"horizontal",label:"Horizontal"}]}],s=d.computed(()=>[...a,...t.extraSettings]);return{__sfc:!0,props:t,emit:e,baseSettings:a,allSettings:s,handleSelection:(v,r)=>{const c={...t.value,[v]:r};e("input",c),e("setting-change",{id:v,value:r})},closePanel:()=>{e("close")}}}};var F=function(){var e=this,t=e._self._c,a=e._self._setupProxy;return t("div",{staticClass:"wz-settings",class:{"wz-settings--open":e.isOpen}},[t("div",{staticClass:"wz-settings-overlay",on:{click:a.closePanel}}),t("aside",{staticClass:"wz-settings-panel"},[t("div",{staticClass:"wz-settings-header"},[t("h3",{staticClass:"wz-settings-title"},[e._v(e._s(e.title))]),t("button",{staticClass:"wz-settings-close",attrs:{title:"Close Settings"},on:{click:a.closePanel}},[t("i",{staticClass:"ri-close-circle-line"})])]),e._m(0),t("div",{staticClass:"wz-settings-body"},[e._l(a.allSettings,function(s){return[t("div",{staticClass:"wz-settings-section"},[t("h4",{staticClass:"wz-settings-section-title"},[e._v(e._s(s.title))]),t("div",{staticClass:"wz-settings-radio-group"},e._l(s.options,function(i){return t("label",{key:i.value,staticClass:"wz-settings-radio-label"},[t("div",{staticClass:"wz-settings-radio-circle",class:{"wz-settings-radio-circle--active":e.value[s.id]===i.value}},[t("span",{directives:[{name:"show",rawName:"v-show",value:e.value[s.id]===i.value,expression:"value[setting.id] === opt.value"}],staticClass:"wz-settings-radio-dot"})]),t("input",{staticClass:"wz-settings-radio-native",attrs:{type:"radio",name:s.id},domProps:{value:i.value,checked:e.value[s.id]===i.value},on:{change:function(o){return a.handleSelection(s.id,i.value)}}}),t("span",{staticClass:"wz-settings-radio-text"},[e._v(e._s(i.label))])])}),0)])]})],2)])])},K=[function(){var n=this,e=n._self._c;return n._self._setupProxy,e("div",{staticClass:"wz-settings-tabs"},[e("div",{staticClass:"wz-settings-tab wz-settings-tab--active"},[n._v("Theme Style")])])}],E=f(D,F,K,!1,null,null,null,null);const y=E.exports,V={__name:"WzHorizontalNav",props:{items:{type:Array,default:()=>[]},activeKey:{type:String,default:null}},emits:["item-click"],setup(n,{emit:e}){const t=n,a=d.ref(null),s=u=>{a.value&&a.value.scrollBy({left:u*250,behavior:"smooth"})},i=d.ref(null),o=d.ref({}),v=u=>{const l=u.getBoundingClientRect();o.value={top:l.bottom+2+"px",left:l.left+"px"}},r=(u,l)=>{if(!u.children||u.children.length===0){e("item-click",u),i.value=null;return}i.value===u.key?i.value=null:(v(l.currentTarget),i.value=u.key)},c=u=>{e("item-click",u),i.value=null},p=u=>{u.target.closest(".wz-horizontal-nav")||(i.value=null)};return d.onMounted(()=>{document.addEventListener("click",p)}),d.onBeforeUnmount(()=>{document.removeEventListener("click",p)}),{__sfc:!0,props:t,emit:e,trackWrapper:a,scroll:s,openDropdown:i,dropdownStyle:o,positionDropdown:v,toggleDropdown:r,handleChildClick:c,handleDocClick:p}}};var j=function(){var e=this,t=e._self._c,a=e._self._setupProxy;return t("div",{staticClass:"wz-horizontal-nav"},[t("button",{staticClass:"wz-horizontal-nav-arrow",on:{click:function(s){return s.stopPropagation(),a.scroll(-1)}}},[t("i",{staticClass:"ri-arrow-left-s-line"})]),t("div",{ref:"trackWrapper",staticClass:"wz-horizontal-nav-track-wrapper"},[t("div",{staticClass:"wz-horizontal-nav-track"},[e._l(e.items,function(s,i){return[s.type!=="group"?t("div",{key:s.key||i,staticClass:"wz-horizontal-nav-item",class:{"wz-horizontal-nav-item--active":s.key===e.activeKey||s.children&&s.children.some(o=>o.key===e.activeKey),"wz-horizontal-nav-item--open":a.openDropdown===s.key},on:{click:function(o){return o.stopPropagation(),a.toggleDropdown(s,o)}}},[s.icon?t("i",{class:s.icon}):e._e(),t("span",[e._v(e._s(s.label))]),s.children&&s.children.length>0?t("i",{staticClass:"ri-arrow-down-s-line wz-horizontal-nav-chevron"}):e._e()]):e._e()]})],2)]),t("button",{staticClass:"wz-horizontal-nav-arrow",on:{click:function(s){return s.stopPropagation(),a.scroll(1)}}},[t("i",{staticClass:"ri-arrow-right-s-line"})]),a.openDropdown?t("div",{staticClass:"wz-horizontal-nav-dropdown",style:a.dropdownStyle,on:{click:function(s){s.stopPropagation()}}},[e._l(e.items,function(s){return[s.key===a.openDropdown&&s.children?e._l(s.children,function(i){return t("div",{key:i.key,staticClass:"wz-horizontal-dropdown-child",class:{"wz-horizontal-dropdown-child--active":i.key===e.activeKey},on:{click:function(o){return o.stopPropagation(),a.handleChildClick(i)}}},[e._v(" "+e._s(i.label)+" ")])}):e._e()]})],2):e._e()])},X=[],q=f(V,j,X,!1,null,null,null,null);const m=q.exports,G={WzButton:w,WzSidebar:g,WzHeader:z,WzLayout:C,WzSettingsPanel:y,WzHorizontalNav:m},b=n=>{Object.entries(G).forEach(([e,t])=>{n.component(e,t)})};typeof window<"u"&&window.Vue&&b(window.Vue);const J={install:b};_.WzButton=w,_.WzHeader=z,_.WzHorizontalNav=m,_.WzLayout=C,_.WzSettingsPanel=y,_.WzSidebar=g,_.default=J,Object.defineProperties(_,{__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.23",
|
|
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",
|