wize-admin-library 0.1.20 → 0.1.21
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 +533 -545
- package/dist/wize-admin-library.umd.js +1 -1
- package/package.json +54 -54
|
@@ -1,545 +1,533 @@
|
|
|
1
|
-
import { computed as
|
|
2
|
-
function f(
|
|
3
|
-
var
|
|
4
|
-
e && (
|
|
5
|
-
var
|
|
6
|
-
if (o ? (
|
|
7
|
-
|
|
8
|
-
this.$vnode && this.$vnode.ssrContext || // stateful
|
|
9
|
-
this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !
|
|
10
|
-
},
|
|
11
|
-
s.call(
|
|
12
|
-
this,
|
|
13
|
-
(
|
|
14
|
-
);
|
|
15
|
-
} : s),
|
|
16
|
-
if (
|
|
17
|
-
|
|
18
|
-
var
|
|
19
|
-
|
|
20
|
-
return
|
|
21
|
-
};
|
|
22
|
-
} else {
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
return {
|
|
27
|
-
exports:
|
|
28
|
-
options:
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
const y = {
|
|
32
|
-
__name: "WzButton",
|
|
33
|
-
props: {
|
|
34
|
-
/**
|
|
35
|
-
* Visual style variant of the button.
|
|
36
|
-
* @values primary, secondary, success, danger, warning, info, light, dark, link, outline
|
|
37
|
-
*/
|
|
38
|
-
variant: {
|
|
39
|
-
type: String,
|
|
40
|
-
default: "primary",
|
|
41
|
-
validator: (
|
|
42
|
-
},
|
|
43
|
-
/**
|
|
44
|
-
* Size of the button.
|
|
45
|
-
* @values sm, md, lg
|
|
46
|
-
*/
|
|
47
|
-
size: {
|
|
48
|
-
type: String,
|
|
49
|
-
default: "md",
|
|
50
|
-
validator: (
|
|
51
|
-
},
|
|
52
|
-
/**
|
|
53
|
-
* Whether the button is disabled.
|
|
54
|
-
*/
|
|
55
|
-
disabled: {
|
|
56
|
-
type: Boolean,
|
|
57
|
-
default: !1
|
|
58
|
-
},
|
|
59
|
-
/**
|
|
60
|
-
* If true, renders as a block-level button (full width).
|
|
61
|
-
*/
|
|
62
|
-
block: {
|
|
63
|
-
type: Boolean,
|
|
64
|
-
default: !1
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
emits: ["click"],
|
|
68
|
-
setup(
|
|
69
|
-
const t =
|
|
70
|
-
"wz-btn",
|
|
71
|
-
`wz-btn-${t.variant}`,
|
|
72
|
-
`wz-btn-${t.size}`,
|
|
73
|
-
{ "wz-btn-block": t.block }
|
|
74
|
-
]);
|
|
75
|
-
return { __sfc: !0, props: t, emit: e, classes: a, handleClick: (l) => {
|
|
76
|
-
t.disabled || e("click", l);
|
|
77
|
-
} };
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
var m = function() {
|
|
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
|
-
}, b = [], k = /* @__PURE__ */ f(
|
|
84
|
-
y,
|
|
85
|
-
m,
|
|
86
|
-
b,
|
|
87
|
-
!1,
|
|
88
|
-
null,
|
|
89
|
-
null,
|
|
90
|
-
null,
|
|
91
|
-
null
|
|
92
|
-
);
|
|
93
|
-
const S = k.exports, $ = {
|
|
94
|
-
__name: "WzLayout",
|
|
95
|
-
props: {
|
|
96
|
-
/**
|
|
97
|
-
* Whether the sidebar is collapsed initially.
|
|
98
|
-
*/
|
|
99
|
-
defaultCollapsed: {
|
|
100
|
-
type: Boolean,
|
|
101
|
-
default: !1
|
|
102
|
-
},
|
|
103
|
-
/**
|
|
104
|
-
* Defines layout navigation architecture ('vertical' | 'horizontal')
|
|
105
|
-
*/
|
|
106
|
-
navigationStyle: {
|
|
107
|
-
type: String,
|
|
108
|
-
default: "vertical"
|
|
109
|
-
},
|
|
110
|
-
/**
|
|
111
|
-
* Layout visual theme ('light' | 'dark')
|
|
112
|
-
*/
|
|
113
|
-
theme: {
|
|
114
|
-
type: String,
|
|
115
|
-
default: "light"
|
|
116
|
-
}
|
|
117
|
-
},
|
|
118
|
-
setup(
|
|
119
|
-
const e =
|
|
120
|
-
t.value = !t.value;
|
|
121
|
-
};
|
|
122
|
-
return
|
|
123
|
-
typeof window < "u" && window.innerWidth <= 768 && (t.value = !0);
|
|
124
|
-
}), { __sfc: !0, props: e, isCollapsed: t, toggleSidebar: a };
|
|
125
|
-
}
|
|
126
|
-
};
|
|
127
|
-
var x = function() {
|
|
128
|
-
var e = this, t = e._self._c, a = e._self._setupProxy;
|
|
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
|
-
}, M = [], P = /* @__PURE__ */ f(
|
|
131
|
-
$,
|
|
132
|
-
x,
|
|
133
|
-
M,
|
|
134
|
-
!1,
|
|
135
|
-
null,
|
|
136
|
-
null,
|
|
137
|
-
null,
|
|
138
|
-
null
|
|
139
|
-
);
|
|
140
|
-
const W = P.exports, H = {
|
|
141
|
-
__name: "WzSidebar",
|
|
142
|
-
props: {
|
|
143
|
-
/**
|
|
144
|
-
* Array of nav items. Each item is either:
|
|
145
|
-
* - Nav item: { key, label, iconHtml, children[] }
|
|
146
|
-
* - Group label: { type: 'group', label }
|
|
147
|
-
*/
|
|
148
|
-
items: {
|
|
149
|
-
type: Array,
|
|
150
|
-
default: () => []
|
|
151
|
-
},
|
|
152
|
-
/**
|
|
153
|
-
* Key of the currently active item.
|
|
154
|
-
*/
|
|
155
|
-
activeKey: {
|
|
156
|
-
type: String,
|
|
157
|
-
default: null
|
|
158
|
-
},
|
|
159
|
-
/**
|
|
160
|
-
* Main logo image source.
|
|
161
|
-
*/
|
|
162
|
-
logoSrc: {
|
|
163
|
-
type: String,
|
|
164
|
-
default: null
|
|
165
|
-
},
|
|
166
|
-
/**
|
|
167
|
-
* Mini logo image source to show when collapsed.
|
|
168
|
-
*/
|
|
169
|
-
logoMiniSrc: {
|
|
170
|
-
type: String,
|
|
171
|
-
default: null
|
|
172
|
-
},
|
|
173
|
-
/**
|
|
174
|
-
* Brand name shown in the logo area.
|
|
175
|
-
*/
|
|
176
|
-
logoText: {
|
|
177
|
-
type: String,
|
|
178
|
-
default: "Admin"
|
|
179
|
-
},
|
|
180
|
-
/**
|
|
181
|
-
* SVG HTML string for the logo icon.
|
|
182
|
-
*/
|
|
183
|
-
logoIconHtml: {
|
|
184
|
-
type: String,
|
|
185
|
-
default: null
|
|
186
|
-
},
|
|
187
|
-
/**
|
|
188
|
-
* Whether the sidebar is collapsed (mini mode).
|
|
189
|
-
*/
|
|
190
|
-
collapsed: {
|
|
191
|
-
type: Boolean,
|
|
192
|
-
default: !1
|
|
193
|
-
}
|
|
194
|
-
},
|
|
195
|
-
emits: ["item-click"],
|
|
196
|
-
setup(
|
|
197
|
-
const t =
|
|
198
|
-
if (!
|
|
199
|
-
return;
|
|
200
|
-
const
|
|
201
|
-
|
|
202
|
-
};
|
|
203
|
-
return { __sfc: !0, props: t, emit: e, openKeys: a, isHovered: s, visuallyCollapsed: l, isActive: o, hasChildren:
|
|
204
|
-
if (l.value) {
|
|
205
|
-
e("item-click",
|
|
206
|
-
return;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
}, handleChildClick: (
|
|
210
|
-
e("item-click",
|
|
211
|
-
} };
|
|
212
|
-
}
|
|
213
|
-
};
|
|
214
|
-
var
|
|
215
|
-
var e = this, t = e._self._c, a = e._self._setupProxy;
|
|
216
|
-
return t("aside", { staticClass: "wz-sidebar", class: { "wz-sidebar--collapsed": a.visuallyCollapsed }, on: { mouseenter: function(s) {
|
|
217
|
-
a.isHovered = !0;
|
|
218
|
-
}, mouseleave: function(s) {
|
|
219
|
-
a.isHovered = !1;
|
|
220
|
-
} } }, [t("div", { staticClass: "wz-sidebar-logo" }, [e._t("logo", function() {
|
|
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
|
-
})], 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(o) {
|
|
224
|
-
return a.handleClick(s);
|
|
225
|
-
} } }, [t("span", { staticClass: "wz-sidebar-icon" }, [e._t("icon", function() {
|
|
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(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(
|
|
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
|
-
}), 0) : e._e()])])])];
|
|
232
|
-
})], 2)]);
|
|
233
|
-
},
|
|
234
|
-
H,
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
!1,
|
|
238
|
-
null,
|
|
239
|
-
null,
|
|
240
|
-
null,
|
|
241
|
-
null
|
|
242
|
-
);
|
|
243
|
-
const T =
|
|
244
|
-
__name: "WzHeader",
|
|
245
|
-
props: {
|
|
246
|
-
/**
|
|
247
|
-
* User object with name and optional avatar URL.
|
|
248
|
-
*/
|
|
249
|
-
user: {
|
|
250
|
-
type: Object,
|
|
251
|
-
default: () => ({ name: "User", avatar: null })
|
|
252
|
-
},
|
|
253
|
-
/**
|
|
254
|
-
* Number shown on the notification badge. 0 hides the badge.
|
|
255
|
-
*/
|
|
256
|
-
notificationCount: {
|
|
257
|
-
type: Number,
|
|
258
|
-
default: 0
|
|
259
|
-
},
|
|
260
|
-
/**
|
|
261
|
-
* If true, changes the menu icon to a close (X) state.
|
|
262
|
-
*/
|
|
263
|
-
collapsed: {
|
|
264
|
-
type: Boolean,
|
|
265
|
-
default: !1
|
|
266
|
-
},
|
|
267
|
-
/**
|
|
268
|
-
* Action items array of objects { key, icon, badge, badgeCount? }
|
|
269
|
-
*/
|
|
270
|
-
actionItems: {
|
|
271
|
-
type: Array,
|
|
272
|
-
default: () => []
|
|
273
|
-
},
|
|
274
|
-
/**
|
|
275
|
-
* Dropdown menu items for the user { key, label, icon, isLogout? }
|
|
276
|
-
*/
|
|
277
|
-
userMenuItems: {
|
|
278
|
-
type: Array,
|
|
279
|
-
default: () => []
|
|
280
|
-
},
|
|
281
|
-
/**
|
|
282
|
-
* Subtitle to show below the username inside the dropdown
|
|
283
|
-
*/
|
|
284
|
-
userSubtitle: {
|
|
285
|
-
type: String,
|
|
286
|
-
default: ""
|
|
287
|
-
},
|
|
288
|
-
/**
|
|
289
|
-
* Main logo image source to display in header (mobile only)
|
|
290
|
-
*/
|
|
291
|
-
logoSrc: {
|
|
292
|
-
type: String,
|
|
293
|
-
default: ""
|
|
294
|
-
},
|
|
295
|
-
/**
|
|
296
|
-
* Layout hierarchy style ('vertical' | 'horizontal')
|
|
297
|
-
*/
|
|
298
|
-
layoutMode: {
|
|
299
|
-
type: String,
|
|
300
|
-
default: "vertical"
|
|
301
|
-
}
|
|
302
|
-
},
|
|
303
|
-
emits: ["menu-toggle", "search", "notifications", "settings", "user-click", "action-click", "user-menu-click"],
|
|
304
|
-
setup(
|
|
305
|
-
const t =
|
|
306
|
-
s.value = !s.value, e("user-click");
|
|
307
|
-
},
|
|
308
|
-
e("user-menu-click",
|
|
309
|
-
},
|
|
310
|
-
l.value && !l.value.contains(
|
|
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: o, handleUserItemClick:
|
|
317
|
-
}
|
|
318
|
-
};
|
|
319
|
-
var
|
|
320
|
-
var e = this, t = e._self._c, a = e._self._setupProxy;
|
|
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
|
-
return e.$emit("menu-toggle");
|
|
323
|
-
} } }, [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) {
|
|
324
|
-
return e.$emit("menu-toggle");
|
|
325
|
-
} } }, [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() {
|
|
326
|
-
return [e.actionItems && e.actionItems.length ? [e._l(e.actionItems, function(s) {
|
|
327
|
-
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) {
|
|
328
|
-
return a.emit("action-click", s);
|
|
329
|
-
} } }, [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) {
|
|
330
|
-
return a.emit("action-click", s);
|
|
331
|
-
} } }, [t("i", { class: s.icon, staticStyle: { "font-size": "1.125rem" } })])];
|
|
332
|
-
})] : [t("button", { staticClass: "wz-header-action", attrs: { title: "Search" }, on: { click: function(s) {
|
|
333
|
-
return a.emit("search");
|
|
334
|
-
} } }, [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) {
|
|
335
|
-
return a.emit("notifications");
|
|
336
|
-
} } }, [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)]];
|
|
337
|
-
}), t("div", { staticClass: "wz-header-divider" }), t("div", { ref: "userMenuContainer", staticClass: "wz-header-user-wrapper" }, [e._t("user", function() {
|
|
338
|
-
return [t("div", { staticClass: "wz-header-user", on: { click: function(s) {
|
|
339
|
-
return s.stopPropagation(), a.toggleUserMenu.apply(null, arguments);
|
|
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
|
-
}), 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(o) {
|
|
343
|
-
return a.handleUserItemClick(s);
|
|
344
|
-
} } }, [s.icon && !s.isLogout ? t("i", { class: s.icon }) : e._e(), t("span", [e._v(e._s(s.label))])]);
|
|
345
|
-
}), 0)]) : e._e()], 2), t("button", { staticClass: "wz-header-action", attrs: { title: "Settings" }, on: { click: function(s) {
|
|
346
|
-
return a.emit("settings");
|
|
347
|
-
} } }, [t("i", { staticClass: "ri-settings-3-line wz-anim-spin", staticStyle: { "font-size": "1.125rem", display: "inline-block" } })])], 2)]);
|
|
348
|
-
}, R = [function() {
|
|
349
|
-
var
|
|
350
|
-
return
|
|
351
|
-
}, function() {
|
|
352
|
-
var
|
|
353
|
-
return
|
|
354
|
-
}, function() {
|
|
355
|
-
var
|
|
356
|
-
return
|
|
357
|
-
}, function() {
|
|
358
|
-
var
|
|
359
|
-
return
|
|
360
|
-
}],
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
R,
|
|
364
|
-
!1,
|
|
365
|
-
null,
|
|
366
|
-
null,
|
|
367
|
-
null,
|
|
368
|
-
null
|
|
369
|
-
);
|
|
370
|
-
const B =
|
|
371
|
-
__name: "WzSettingsPanel",
|
|
372
|
-
props: {
|
|
373
|
-
/**
|
|
374
|
-
* Defines if the Settings Drawer is currently open
|
|
375
|
-
*/
|
|
376
|
-
isOpen: {
|
|
377
|
-
type: Boolean,
|
|
378
|
-
default: !1
|
|
379
|
-
},
|
|
380
|
-
/**
|
|
381
|
-
* Title shown at the top of the Switcher
|
|
382
|
-
*/
|
|
383
|
-
title: {
|
|
384
|
-
type: String,
|
|
385
|
-
default: "Switcher"
|
|
386
|
-
},
|
|
387
|
-
/**
|
|
388
|
-
* Active values mapped by ID. e.g. { themeMode: 'light', navigationStyle: 'vertical' }
|
|
389
|
-
*/
|
|
390
|
-
value: {
|
|
391
|
-
type: Object,
|
|
392
|
-
default: () => ({})
|
|
393
|
-
},
|
|
394
|
-
/**
|
|
395
|
-
* Array of extra dynamic setting blocks to inject globally below the defaults
|
|
396
|
-
*/
|
|
397
|
-
extraSettings: {
|
|
398
|
-
type: Array,
|
|
399
|
-
default: () => []
|
|
400
|
-
}
|
|
401
|
-
},
|
|
402
|
-
emits: ["close", "input", "setting-change"],
|
|
403
|
-
setup(
|
|
404
|
-
const t =
|
|
405
|
-
{
|
|
406
|
-
id: "themeMode",
|
|
407
|
-
title: "Theme Color Mode:",
|
|
408
|
-
options: [
|
|
409
|
-
{ value: "light", label: "Light" },
|
|
410
|
-
{ value: "dark", label: "Dark" }
|
|
411
|
-
]
|
|
412
|
-
},
|
|
413
|
-
{
|
|
414
|
-
id: "navigationStyle",
|
|
415
|
-
title: "Navigation Styles:",
|
|
416
|
-
options: [
|
|
417
|
-
{ value: "vertical", label: "Vertical" },
|
|
418
|
-
{ value: "horizontal", label: "Horizontal" }
|
|
419
|
-
]
|
|
420
|
-
}
|
|
421
|
-
], s =
|
|
422
|
-
return { __sfc: !0, props: t, emit: e, baseSettings: a, allSettings: s, handleSelection: (
|
|
423
|
-
const
|
|
424
|
-
e("input",
|
|
425
|
-
}, closePanel: () => {
|
|
426
|
-
e("close");
|
|
427
|
-
} };
|
|
428
|
-
}
|
|
429
|
-
};
|
|
430
|
-
var
|
|
431
|
-
var e = this, t = e._self._c, a = e._self._setupProxy;
|
|
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
|
-
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(o) {
|
|
435
|
-
return a.handleSelection(s.id, l.value);
|
|
436
|
-
} } }), t("span", { staticClass: "wz-settings-radio-text" }, [e._v(e._s(l.label))])]);
|
|
437
|
-
}), 0)])];
|
|
438
|
-
})], 2)])]);
|
|
439
|
-
},
|
|
440
|
-
var
|
|
441
|
-
return
|
|
442
|
-
}],
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
!1,
|
|
447
|
-
null,
|
|
448
|
-
null,
|
|
449
|
-
null,
|
|
450
|
-
null
|
|
451
|
-
);
|
|
452
|
-
const
|
|
453
|
-
__name: "WzHorizontalNav",
|
|
454
|
-
props: {
|
|
455
|
-
items: {
|
|
456
|
-
type: Array,
|
|
457
|
-
default: () => []
|
|
458
|
-
},
|
|
459
|
-
activeKey: {
|
|
460
|
-
type: String,
|
|
461
|
-
default: null
|
|
462
|
-
}
|
|
463
|
-
},
|
|
464
|
-
emits: ["item-click"],
|
|
465
|
-
setup(
|
|
466
|
-
const t =
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
}
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
};
|
|
535
|
-
typeof window < "u" && window.Vue && z(window.Vue);
|
|
536
|
-
const Z = { install: z };
|
|
537
|
-
export {
|
|
538
|
-
S as WzButton,
|
|
539
|
-
B as WzHeader,
|
|
540
|
-
J as WzHorizontalNav,
|
|
541
|
-
W as WzLayout,
|
|
542
|
-
V as WzSettingsPanel,
|
|
543
|
-
T as WzSidebar,
|
|
544
|
-
Z as default
|
|
545
|
-
};
|
|
1
|
+
import { computed as h, ref as v, onMounted as w, onBeforeUnmount as z } from "vue";
|
|
2
|
+
function f(i, e, t, a, s, l, o, u) {
|
|
3
|
+
var c = typeof i == "function" ? i.options : i;
|
|
4
|
+
e && (c.render = e, c.staticRenderFns = t, c._compiled = !0), a && (c.functional = !0), l && (c._scopeId = "data-v-" + l);
|
|
5
|
+
var r;
|
|
6
|
+
if (o ? (r = function(n) {
|
|
7
|
+
n = n || // cached call
|
|
8
|
+
this.$vnode && this.$vnode.ssrContext || // stateful
|
|
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(o);
|
|
10
|
+
}, c._ssrRegister = r) : s && (r = u ? function() {
|
|
11
|
+
s.call(
|
|
12
|
+
this,
|
|
13
|
+
(c.functional ? this.parent : this).$root.$options.shadowRoot
|
|
14
|
+
);
|
|
15
|
+
} : s), r)
|
|
16
|
+
if (c.functional) {
|
|
17
|
+
c._injectStyles = r;
|
|
18
|
+
var _ = c.render;
|
|
19
|
+
c.render = function(d, C) {
|
|
20
|
+
return r.call(C), _(d, C);
|
|
21
|
+
};
|
|
22
|
+
} else {
|
|
23
|
+
var p = c.beforeCreate;
|
|
24
|
+
c.beforeCreate = p ? [].concat(p, r) : [r];
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
exports: i,
|
|
28
|
+
options: c
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
const y = {
|
|
32
|
+
__name: "WzButton",
|
|
33
|
+
props: {
|
|
34
|
+
/**
|
|
35
|
+
* Visual style variant of the button.
|
|
36
|
+
* @values primary, secondary, success, danger, warning, info, light, dark, link, outline
|
|
37
|
+
*/
|
|
38
|
+
variant: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: "primary",
|
|
41
|
+
validator: (i) => ["primary", "secondary", "success", "danger", "warning", "info", "light", "dark", "link", "outline"].includes(i)
|
|
42
|
+
},
|
|
43
|
+
/**
|
|
44
|
+
* Size of the button.
|
|
45
|
+
* @values sm, md, lg
|
|
46
|
+
*/
|
|
47
|
+
size: {
|
|
48
|
+
type: String,
|
|
49
|
+
default: "md",
|
|
50
|
+
validator: (i) => ["sm", "md", "lg"].includes(i)
|
|
51
|
+
},
|
|
52
|
+
/**
|
|
53
|
+
* Whether the button is disabled.
|
|
54
|
+
*/
|
|
55
|
+
disabled: {
|
|
56
|
+
type: Boolean,
|
|
57
|
+
default: !1
|
|
58
|
+
},
|
|
59
|
+
/**
|
|
60
|
+
* If true, renders as a block-level button (full width).
|
|
61
|
+
*/
|
|
62
|
+
block: {
|
|
63
|
+
type: Boolean,
|
|
64
|
+
default: !1
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
emits: ["click"],
|
|
68
|
+
setup(i, { emit: e }) {
|
|
69
|
+
const t = i, a = h(() => [
|
|
70
|
+
"wz-btn",
|
|
71
|
+
`wz-btn-${t.variant}`,
|
|
72
|
+
`wz-btn-${t.size}`,
|
|
73
|
+
{ "wz-btn-block": t.block }
|
|
74
|
+
]);
|
|
75
|
+
return { __sfc: !0, props: t, emit: e, classes: a, handleClick: (l) => {
|
|
76
|
+
t.disabled || e("click", l);
|
|
77
|
+
} };
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
var m = function() {
|
|
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
|
+
}, b = [], k = /* @__PURE__ */ f(
|
|
84
|
+
y,
|
|
85
|
+
m,
|
|
86
|
+
b,
|
|
87
|
+
!1,
|
|
88
|
+
null,
|
|
89
|
+
null,
|
|
90
|
+
null,
|
|
91
|
+
null
|
|
92
|
+
);
|
|
93
|
+
const S = k.exports, $ = {
|
|
94
|
+
__name: "WzLayout",
|
|
95
|
+
props: {
|
|
96
|
+
/**
|
|
97
|
+
* Whether the sidebar is collapsed initially.
|
|
98
|
+
*/
|
|
99
|
+
defaultCollapsed: {
|
|
100
|
+
type: Boolean,
|
|
101
|
+
default: !1
|
|
102
|
+
},
|
|
103
|
+
/**
|
|
104
|
+
* Defines layout navigation architecture ('vertical' | 'horizontal')
|
|
105
|
+
*/
|
|
106
|
+
navigationStyle: {
|
|
107
|
+
type: String,
|
|
108
|
+
default: "vertical"
|
|
109
|
+
},
|
|
110
|
+
/**
|
|
111
|
+
* Layout visual theme ('light' | 'dark')
|
|
112
|
+
*/
|
|
113
|
+
theme: {
|
|
114
|
+
type: String,
|
|
115
|
+
default: "light"
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
setup(i) {
|
|
119
|
+
const e = i, t = v(e.defaultCollapsed), a = () => {
|
|
120
|
+
t.value = !t.value;
|
|
121
|
+
};
|
|
122
|
+
return w(() => {
|
|
123
|
+
typeof window < "u" && window.innerWidth <= 768 && (t.value = !0);
|
|
124
|
+
}), { __sfc: !0, props: e, isCollapsed: t, toggleSidebar: a };
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
var x = function() {
|
|
128
|
+
var e = this, t = e._self._c, a = e._self._setupProxy;
|
|
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
|
+
}, M = [], P = /* @__PURE__ */ f(
|
|
131
|
+
$,
|
|
132
|
+
x,
|
|
133
|
+
M,
|
|
134
|
+
!1,
|
|
135
|
+
null,
|
|
136
|
+
null,
|
|
137
|
+
null,
|
|
138
|
+
null
|
|
139
|
+
);
|
|
140
|
+
const W = P.exports, H = {
|
|
141
|
+
__name: "WzSidebar",
|
|
142
|
+
props: {
|
|
143
|
+
/**
|
|
144
|
+
* Array of nav items. Each item is either:
|
|
145
|
+
* - Nav item: { key, label, iconHtml, children[] }
|
|
146
|
+
* - Group label: { type: 'group', label }
|
|
147
|
+
*/
|
|
148
|
+
items: {
|
|
149
|
+
type: Array,
|
|
150
|
+
default: () => []
|
|
151
|
+
},
|
|
152
|
+
/**
|
|
153
|
+
* Key of the currently active item.
|
|
154
|
+
*/
|
|
155
|
+
activeKey: {
|
|
156
|
+
type: String,
|
|
157
|
+
default: null
|
|
158
|
+
},
|
|
159
|
+
/**
|
|
160
|
+
* Main logo image source.
|
|
161
|
+
*/
|
|
162
|
+
logoSrc: {
|
|
163
|
+
type: String,
|
|
164
|
+
default: null
|
|
165
|
+
},
|
|
166
|
+
/**
|
|
167
|
+
* Mini logo image source to show when collapsed.
|
|
168
|
+
*/
|
|
169
|
+
logoMiniSrc: {
|
|
170
|
+
type: String,
|
|
171
|
+
default: null
|
|
172
|
+
},
|
|
173
|
+
/**
|
|
174
|
+
* Brand name shown in the logo area.
|
|
175
|
+
*/
|
|
176
|
+
logoText: {
|
|
177
|
+
type: String,
|
|
178
|
+
default: "Admin"
|
|
179
|
+
},
|
|
180
|
+
/**
|
|
181
|
+
* SVG HTML string for the logo icon.
|
|
182
|
+
*/
|
|
183
|
+
logoIconHtml: {
|
|
184
|
+
type: String,
|
|
185
|
+
default: null
|
|
186
|
+
},
|
|
187
|
+
/**
|
|
188
|
+
* Whether the sidebar is collapsed (mini mode).
|
|
189
|
+
*/
|
|
190
|
+
collapsed: {
|
|
191
|
+
type: Boolean,
|
|
192
|
+
default: !1
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
emits: ["item-click"],
|
|
196
|
+
setup(i, { emit: e }) {
|
|
197
|
+
const t = i, a = v(/* @__PURE__ */ new Set()), s = v(!1), l = h(() => t.collapsed && !s.value), o = (n) => n.key === t.activeKey, u = (n) => n.children && n.children.length > 0, c = (n) => a.value.has(n.key), r = (n) => {
|
|
198
|
+
if (!u(n) || l.value)
|
|
199
|
+
return;
|
|
200
|
+
const d = new Set(a.value);
|
|
201
|
+
d.has(n.key) ? d.delete(n.key) : d.add(n.key), a.value = d;
|
|
202
|
+
};
|
|
203
|
+
return { __sfc: !0, props: t, emit: e, openKeys: a, isHovered: s, visuallyCollapsed: l, isActive: o, hasChildren: u, isOpen: c, toggle: r, handleClick: (n) => {
|
|
204
|
+
if (l.value) {
|
|
205
|
+
e("item-click", n);
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
u(n) ? r(n) : e("item-click", n);
|
|
209
|
+
}, handleChildClick: (n) => {
|
|
210
|
+
e("item-click", n);
|
|
211
|
+
} };
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
var N = function() {
|
|
215
|
+
var e = this, t = e._self._c, a = e._self._setupProxy;
|
|
216
|
+
return t("aside", { staticClass: "wz-sidebar", class: { "wz-sidebar--collapsed": a.visuallyCollapsed }, on: { mouseenter: function(s) {
|
|
217
|
+
a.isHovered = !0;
|
|
218
|
+
}, mouseleave: function(s) {
|
|
219
|
+
a.isHovered = !1;
|
|
220
|
+
} } }, [t("div", { staticClass: "wz-sidebar-logo" }, [e._t("logo", function() {
|
|
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
|
+
})], 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(o) {
|
|
224
|
+
return a.handleClick(s);
|
|
225
|
+
} } }, [t("span", { staticClass: "wz-sidebar-icon" }, [e._t("icon", function() {
|
|
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(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(u) {
|
|
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
|
+
}), 0) : e._e()])])])];
|
|
232
|
+
})], 2)]);
|
|
233
|
+
}, O = [], L = /* @__PURE__ */ f(
|
|
234
|
+
H,
|
|
235
|
+
N,
|
|
236
|
+
O,
|
|
237
|
+
!1,
|
|
238
|
+
null,
|
|
239
|
+
null,
|
|
240
|
+
null,
|
|
241
|
+
null
|
|
242
|
+
);
|
|
243
|
+
const T = L.exports, I = {
|
|
244
|
+
__name: "WzHeader",
|
|
245
|
+
props: {
|
|
246
|
+
/**
|
|
247
|
+
* User object with name and optional avatar URL.
|
|
248
|
+
*/
|
|
249
|
+
user: {
|
|
250
|
+
type: Object,
|
|
251
|
+
default: () => ({ name: "User", avatar: null })
|
|
252
|
+
},
|
|
253
|
+
/**
|
|
254
|
+
* Number shown on the notification badge. 0 hides the badge.
|
|
255
|
+
*/
|
|
256
|
+
notificationCount: {
|
|
257
|
+
type: Number,
|
|
258
|
+
default: 0
|
|
259
|
+
},
|
|
260
|
+
/**
|
|
261
|
+
* If true, changes the menu icon to a close (X) state.
|
|
262
|
+
*/
|
|
263
|
+
collapsed: {
|
|
264
|
+
type: Boolean,
|
|
265
|
+
default: !1
|
|
266
|
+
},
|
|
267
|
+
/**
|
|
268
|
+
* Action items array of objects { key, icon, badge, badgeCount? }
|
|
269
|
+
*/
|
|
270
|
+
actionItems: {
|
|
271
|
+
type: Array,
|
|
272
|
+
default: () => []
|
|
273
|
+
},
|
|
274
|
+
/**
|
|
275
|
+
* Dropdown menu items for the user { key, label, icon, isLogout? }
|
|
276
|
+
*/
|
|
277
|
+
userMenuItems: {
|
|
278
|
+
type: Array,
|
|
279
|
+
default: () => []
|
|
280
|
+
},
|
|
281
|
+
/**
|
|
282
|
+
* Subtitle to show below the username inside the dropdown
|
|
283
|
+
*/
|
|
284
|
+
userSubtitle: {
|
|
285
|
+
type: String,
|
|
286
|
+
default: ""
|
|
287
|
+
},
|
|
288
|
+
/**
|
|
289
|
+
* Main logo image source to display in header (mobile only)
|
|
290
|
+
*/
|
|
291
|
+
logoSrc: {
|
|
292
|
+
type: String,
|
|
293
|
+
default: ""
|
|
294
|
+
},
|
|
295
|
+
/**
|
|
296
|
+
* Layout hierarchy style ('vertical' | 'horizontal')
|
|
297
|
+
*/
|
|
298
|
+
layoutMode: {
|
|
299
|
+
type: String,
|
|
300
|
+
default: "vertical"
|
|
301
|
+
}
|
|
302
|
+
},
|
|
303
|
+
emits: ["menu-toggle", "search", "notifications", "settings", "user-click", "action-click", "user-menu-click"],
|
|
304
|
+
setup(i, { emit: e }) {
|
|
305
|
+
const t = i, a = (r) => r ? r.split(" ").map((_) => _[0]).slice(0, 2).join("").toUpperCase() : "?", s = v(!1), l = v(null), o = () => {
|
|
306
|
+
s.value = !s.value, e("user-click");
|
|
307
|
+
}, u = (r) => {
|
|
308
|
+
e("user-menu-click", r), s.value = !1;
|
|
309
|
+
}, c = (r) => {
|
|
310
|
+
l.value && !l.value.contains(r.target) && (s.value = !1);
|
|
311
|
+
};
|
|
312
|
+
return w(() => {
|
|
313
|
+
document.addEventListener("click", c);
|
|
314
|
+
}), z(() => {
|
|
315
|
+
document.removeEventListener("click", c);
|
|
316
|
+
}), { __sfc: !0, props: t, emit: e, initials: a, isUserMenuOpen: s, userMenuContainer: l, toggleUserMenu: o, handleUserItemClick: u, handleClickOutside: c };
|
|
317
|
+
}
|
|
318
|
+
};
|
|
319
|
+
var U = function() {
|
|
320
|
+
var e = this, t = e._self._c, a = e._self._setupProxy;
|
|
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
|
+
return e.$emit("menu-toggle");
|
|
323
|
+
} } }, [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) {
|
|
324
|
+
return e.$emit("menu-toggle");
|
|
325
|
+
} } }, [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() {
|
|
326
|
+
return [e.actionItems && e.actionItems.length ? [e._l(e.actionItems, function(s) {
|
|
327
|
+
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) {
|
|
328
|
+
return a.emit("action-click", s);
|
|
329
|
+
} } }, [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) {
|
|
330
|
+
return a.emit("action-click", s);
|
|
331
|
+
} } }, [t("i", { class: s.icon, staticStyle: { "font-size": "1.125rem" } })])];
|
|
332
|
+
})] : [t("button", { staticClass: "wz-header-action", attrs: { title: "Search" }, on: { click: function(s) {
|
|
333
|
+
return a.emit("search");
|
|
334
|
+
} } }, [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) {
|
|
335
|
+
return a.emit("notifications");
|
|
336
|
+
} } }, [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)]];
|
|
337
|
+
}), t("div", { staticClass: "wz-header-divider" }), t("div", { ref: "userMenuContainer", staticClass: "wz-header-user-wrapper" }, [e._t("user", function() {
|
|
338
|
+
return [t("div", { staticClass: "wz-header-user", on: { click: function(s) {
|
|
339
|
+
return s.stopPropagation(), a.toggleUserMenu.apply(null, arguments);
|
|
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
|
+
}), 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(o) {
|
|
343
|
+
return a.handleUserItemClick(s);
|
|
344
|
+
} } }, [s.icon && !s.isLogout ? t("i", { class: s.icon }) : e._e(), t("span", [e._v(e._s(s.label))])]);
|
|
345
|
+
}), 0)]) : e._e()], 2), t("button", { staticClass: "wz-header-action", attrs: { title: "Settings" }, on: { click: function(s) {
|
|
346
|
+
return a.emit("settings");
|
|
347
|
+
} } }, [t("i", { staticClass: "ri-settings-3-line wz-anim-spin", staticStyle: { "font-size": "1.125rem", display: "inline-block" } })])], 2)]);
|
|
348
|
+
}, R = [function() {
|
|
349
|
+
var i = this, e = i._self._c;
|
|
350
|
+
return i._self._setupProxy, e("button", { staticClass: "wz-header-action", attrs: { title: "Language" } }, [e("i", { staticClass: "ri-global-line", staticStyle: { "font-size": "1.125rem" } })]);
|
|
351
|
+
}, function() {
|
|
352
|
+
var i = this, e = i._self._c;
|
|
353
|
+
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" } })]);
|
|
354
|
+
}, function() {
|
|
355
|
+
var i = this, e = i._self._c;
|
|
356
|
+
return i._self._setupProxy, e("button", { staticClass: "wz-header-action", attrs: { title: "Calendar" } }, [e("i", { staticClass: "ri-calendar-line", staticStyle: { "font-size": "1.125rem" } })]);
|
|
357
|
+
}, function() {
|
|
358
|
+
var i = this, e = i._self._c;
|
|
359
|
+
return i._self._setupProxy, e("button", { staticClass: "wz-header-action", attrs: { title: "Fullscreen" } }, [e("i", { staticClass: "ri-fullscreen-line", staticStyle: { "font-size": "1.125rem" } })]);
|
|
360
|
+
}], A = /* @__PURE__ */ f(
|
|
361
|
+
I,
|
|
362
|
+
U,
|
|
363
|
+
R,
|
|
364
|
+
!1,
|
|
365
|
+
null,
|
|
366
|
+
null,
|
|
367
|
+
null,
|
|
368
|
+
null
|
|
369
|
+
);
|
|
370
|
+
const B = A.exports, F = {
|
|
371
|
+
__name: "WzSettingsPanel",
|
|
372
|
+
props: {
|
|
373
|
+
/**
|
|
374
|
+
* Defines if the Settings Drawer is currently open
|
|
375
|
+
*/
|
|
376
|
+
isOpen: {
|
|
377
|
+
type: Boolean,
|
|
378
|
+
default: !1
|
|
379
|
+
},
|
|
380
|
+
/**
|
|
381
|
+
* Title shown at the top of the Switcher
|
|
382
|
+
*/
|
|
383
|
+
title: {
|
|
384
|
+
type: String,
|
|
385
|
+
default: "Switcher"
|
|
386
|
+
},
|
|
387
|
+
/**
|
|
388
|
+
* Active values mapped by ID. e.g. { themeMode: 'light', navigationStyle: 'vertical' }
|
|
389
|
+
*/
|
|
390
|
+
value: {
|
|
391
|
+
type: Object,
|
|
392
|
+
default: () => ({})
|
|
393
|
+
},
|
|
394
|
+
/**
|
|
395
|
+
* Array of extra dynamic setting blocks to inject globally below the defaults
|
|
396
|
+
*/
|
|
397
|
+
extraSettings: {
|
|
398
|
+
type: Array,
|
|
399
|
+
default: () => []
|
|
400
|
+
}
|
|
401
|
+
},
|
|
402
|
+
emits: ["close", "input", "setting-change"],
|
|
403
|
+
setup(i, { emit: e }) {
|
|
404
|
+
const t = i, a = [
|
|
405
|
+
{
|
|
406
|
+
id: "themeMode",
|
|
407
|
+
title: "Theme Color Mode:",
|
|
408
|
+
options: [
|
|
409
|
+
{ value: "light", label: "Light" },
|
|
410
|
+
{ value: "dark", label: "Dark" }
|
|
411
|
+
]
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
id: "navigationStyle",
|
|
415
|
+
title: "Navigation Styles:",
|
|
416
|
+
options: [
|
|
417
|
+
{ value: "vertical", label: "Vertical" },
|
|
418
|
+
{ value: "horizontal", label: "Horizontal" }
|
|
419
|
+
]
|
|
420
|
+
}
|
|
421
|
+
], s = h(() => [...a, ...t.extraSettings]);
|
|
422
|
+
return { __sfc: !0, props: t, emit: e, baseSettings: a, allSettings: s, handleSelection: (u, c) => {
|
|
423
|
+
const r = { ...t.value, [u]: c };
|
|
424
|
+
e("input", r), e("setting-change", { id: u, value: c });
|
|
425
|
+
}, closePanel: () => {
|
|
426
|
+
e("close");
|
|
427
|
+
} };
|
|
428
|
+
}
|
|
429
|
+
};
|
|
430
|
+
var K = function() {
|
|
431
|
+
var e = this, t = e._self._c, a = e._self._setupProxy;
|
|
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
|
+
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(o) {
|
|
435
|
+
return a.handleSelection(s.id, l.value);
|
|
436
|
+
} } }), t("span", { staticClass: "wz-settings-radio-text" }, [e._v(e._s(l.label))])]);
|
|
437
|
+
}), 0)])];
|
|
438
|
+
})], 2)])]);
|
|
439
|
+
}, X = [function() {
|
|
440
|
+
var i = this, e = i._self._c;
|
|
441
|
+
return i._self._setupProxy, e("div", { staticClass: "wz-settings-tabs" }, [e("div", { staticClass: "wz-settings-tab wz-settings-tab--active" }, [i._v("Theme Style")])]);
|
|
442
|
+
}], V = /* @__PURE__ */ f(
|
|
443
|
+
F,
|
|
444
|
+
K,
|
|
445
|
+
X,
|
|
446
|
+
!1,
|
|
447
|
+
null,
|
|
448
|
+
null,
|
|
449
|
+
null,
|
|
450
|
+
null
|
|
451
|
+
);
|
|
452
|
+
const E = V.exports, j = {
|
|
453
|
+
__name: "WzHorizontalNav",
|
|
454
|
+
props: {
|
|
455
|
+
items: {
|
|
456
|
+
type: Array,
|
|
457
|
+
default: () => []
|
|
458
|
+
},
|
|
459
|
+
activeKey: {
|
|
460
|
+
type: String,
|
|
461
|
+
default: null
|
|
462
|
+
}
|
|
463
|
+
},
|
|
464
|
+
emits: ["item-click"],
|
|
465
|
+
setup(i, { emit: e }) {
|
|
466
|
+
const t = i, a = v(null), s = v(null), l = v(0);
|
|
467
|
+
return { __sfc: !0, props: t, emit: e, track: a, wrapper: s, translateX: l, scroll: (r) => {
|
|
468
|
+
if (!a.value || !s.value)
|
|
469
|
+
return;
|
|
470
|
+
const _ = a.value.scrollWidth, p = s.value.clientWidth;
|
|
471
|
+
if (_ <= p) {
|
|
472
|
+
l.value = 0;
|
|
473
|
+
return;
|
|
474
|
+
}
|
|
475
|
+
let n = l.value + r;
|
|
476
|
+
n > 0 && (n = 0);
|
|
477
|
+
const d = -(_ - p);
|
|
478
|
+
n < d && (n = d), l.value = n;
|
|
479
|
+
}, handleClick: (r) => {
|
|
480
|
+
e("item-click", r);
|
|
481
|
+
}, handleChildClick: (r) => {
|
|
482
|
+
e("item-click", r);
|
|
483
|
+
} };
|
|
484
|
+
}
|
|
485
|
+
};
|
|
486
|
+
var D = function() {
|
|
487
|
+
var e = this, t = e._self._c, a = e._self._setupProxy;
|
|
488
|
+
return t("div", { staticClass: "wz-horizontal-nav" }, [t("button", { staticClass: "wz-horizontal-nav-arrow wz-horizontal-nav-arrow--left", on: { click: function(s) {
|
|
489
|
+
return a.scroll(250);
|
|
490
|
+
} } }, [t("i", { staticClass: "ri-arrow-left-s-line" })]), t("div", { ref: "wrapper", staticClass: "wz-horizontal-nav-track-wrapper" }, [t("div", { ref: "track", staticClass: "wz-horizontal-nav-track", style: { transform: `translateX(${a.translateX}px)` } }, [e._l(e.items, function(s, l) {
|
|
491
|
+
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((o) => o.key === e.activeKey) }, on: { click: function(o) {
|
|
492
|
+
return a.handleClick(s);
|
|
493
|
+
} } }, [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", staticStyle: { "margin-left": "4px", "margin-right": "0", "font-size": "1rem" } }) : e._e(), s.children && s.children.length > 0 ? t("div", { staticClass: "wz-horizontal-nav-dropdown" }, e._l(s.children, function(o) {
|
|
494
|
+
return t("div", { key: o.key, staticClass: "wz-horizontal-active-child", class: { "wz-horizontal-active-child--active": o.key === e.activeKey }, on: { click: function(u) {
|
|
495
|
+
return u.stopPropagation(), a.handleChildClick(o);
|
|
496
|
+
} } }, [e._v(" " + e._s(o.label) + " ")]);
|
|
497
|
+
}), 0) : e._e()]) : e._e()];
|
|
498
|
+
})], 2)]), t("button", { staticClass: "wz-horizontal-nav-arrow wz-horizontal-nav-arrow--right", on: { click: function(s) {
|
|
499
|
+
return a.scroll(-250);
|
|
500
|
+
} } }, [t("i", { staticClass: "ri-arrow-right-s-line" })])]);
|
|
501
|
+
}, q = [], G = /* @__PURE__ */ f(
|
|
502
|
+
j,
|
|
503
|
+
D,
|
|
504
|
+
q,
|
|
505
|
+
!1,
|
|
506
|
+
null,
|
|
507
|
+
null,
|
|
508
|
+
null,
|
|
509
|
+
null
|
|
510
|
+
);
|
|
511
|
+
const J = G.exports, Q = {
|
|
512
|
+
WzButton: S,
|
|
513
|
+
WzSidebar: T,
|
|
514
|
+
WzHeader: B,
|
|
515
|
+
WzLayout: W,
|
|
516
|
+
WzSettingsPanel: E,
|
|
517
|
+
WzHorizontalNav: J
|
|
518
|
+
}, g = (i) => {
|
|
519
|
+
Object.entries(Q).forEach(([e, t]) => {
|
|
520
|
+
i.component(e, t);
|
|
521
|
+
});
|
|
522
|
+
};
|
|
523
|
+
typeof window < "u" && window.Vue && g(window.Vue);
|
|
524
|
+
const Z = { install: g };
|
|
525
|
+
export {
|
|
526
|
+
S as WzButton,
|
|
527
|
+
B as WzHeader,
|
|
528
|
+
J as WzHorizontalNav,
|
|
529
|
+
W as WzLayout,
|
|
530
|
+
E as WzSettingsPanel,
|
|
531
|
+
T as WzSidebar,
|
|
532
|
+
Z as default
|
|
533
|
+
};
|