wize-admin-library 0.1.0 → 0.1.2
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 +253 -70
- package/dist/wize-admin-library.umd.js +1 -1
- package/package.json +5 -2
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import { computed as
|
|
2
|
-
function
|
|
3
|
-
var
|
|
4
|
-
e && (
|
|
5
|
-
var
|
|
6
|
-
if (o ? (
|
|
7
|
-
|
|
1
|
+
import { computed as m, ref as v } from "vue";
|
|
2
|
+
function f(i, e, t, s, a, r, o, _) {
|
|
3
|
+
var l = typeof i == "function" ? i.options : i;
|
|
4
|
+
e && (l.render = e, l.staticRenderFns = t, l._compiled = !0), s && (l.functional = !0), r && (l._scopeId = "data-v-" + r);
|
|
5
|
+
var c;
|
|
6
|
+
if (o ? (c = function(d) {
|
|
7
|
+
d = d || // cached call
|
|
8
8
|
this.$vnode && this.$vnode.ssrContext || // stateful
|
|
9
|
-
this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !
|
|
10
|
-
},
|
|
11
|
-
|
|
9
|
+
this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !d && typeof __VUE_SSR_CONTEXT__ < "u" && (d = __VUE_SSR_CONTEXT__), a && a.call(this, d), d && d._registeredComponents && d._registeredComponents.add(o);
|
|
10
|
+
}, l._ssrRegister = c) : a && (c = _ ? function() {
|
|
11
|
+
a.call(
|
|
12
12
|
this,
|
|
13
|
-
(
|
|
13
|
+
(l.functional ? this.parent : this).$root.$options.shadowRoot
|
|
14
14
|
);
|
|
15
|
-
} :
|
|
16
|
-
if (
|
|
17
|
-
|
|
18
|
-
var
|
|
19
|
-
|
|
20
|
-
return
|
|
15
|
+
} : a), c)
|
|
16
|
+
if (l.functional) {
|
|
17
|
+
l._injectStyles = c;
|
|
18
|
+
var n = l.render;
|
|
19
|
+
l.render = function(C, p) {
|
|
20
|
+
return c.call(p), n(C, p);
|
|
21
21
|
};
|
|
22
22
|
} else {
|
|
23
|
-
var
|
|
24
|
-
|
|
23
|
+
var u = l.beforeCreate;
|
|
24
|
+
l.beforeCreate = u ? [].concat(u, c) : [c];
|
|
25
25
|
}
|
|
26
26
|
return {
|
|
27
|
-
exports:
|
|
28
|
-
options:
|
|
27
|
+
exports: i,
|
|
28
|
+
options: l
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
|
-
const
|
|
31
|
+
const w = {
|
|
32
32
|
__name: "WzButton",
|
|
33
33
|
props: {
|
|
34
34
|
/**
|
|
35
35
|
* Visual style variant of the button.
|
|
36
|
-
* @values primary, secondary, danger, outline
|
|
36
|
+
* @values primary, secondary, success, danger, warning, info, light, dark, link, outline
|
|
37
37
|
*/
|
|
38
38
|
variant: {
|
|
39
39
|
type: String,
|
|
40
40
|
default: "primary",
|
|
41
|
-
validator: (
|
|
41
|
+
validator: (i) => ["primary", "secondary", "success", "danger", "warning", "info", "light", "dark", "link", "outline"].includes(i)
|
|
42
42
|
},
|
|
43
43
|
/**
|
|
44
44
|
* Size of the button.
|
|
@@ -47,7 +47,7 @@ const h = {
|
|
|
47
47
|
size: {
|
|
48
48
|
type: String,
|
|
49
49
|
default: "md",
|
|
50
|
-
validator: (
|
|
50
|
+
validator: (i) => ["sm", "md", "lg"].includes(i)
|
|
51
51
|
},
|
|
52
52
|
/**
|
|
53
53
|
* Whether the button is disabled.
|
|
@@ -65,62 +65,245 @@ const h = {
|
|
|
65
65
|
}
|
|
66
66
|
},
|
|
67
67
|
emits: ["click"],
|
|
68
|
-
setup(
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}), l = f(() => {
|
|
78
|
-
const o = {
|
|
79
|
-
sm: "wz-text-sm wz-px-3 wz-py-1",
|
|
80
|
-
md: "wz-text-base wz-px-4 wz-py-2",
|
|
81
|
-
lg: "wz-text-lg wz-px-6 wz-py-3"
|
|
82
|
-
};
|
|
83
|
-
return o[r.size] || o.md;
|
|
84
|
-
});
|
|
85
|
-
return { __sfc: !0, props: r, emit: e, variantClasses: s, sizeClasses: l, handleClick: (o) => {
|
|
86
|
-
r.disabled || e("click", o);
|
|
68
|
+
setup(i, { emit: e }) {
|
|
69
|
+
const t = i, s = m(() => [
|
|
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: s, handleClick: (r) => {
|
|
76
|
+
t.disabled || e("click", r);
|
|
87
77
|
} };
|
|
88
78
|
}
|
|
89
79
|
};
|
|
90
|
-
var
|
|
91
|
-
var e = this,
|
|
92
|
-
return
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
80
|
+
var g = function() {
|
|
81
|
+
var e = this, t = e._self._c, s = e._self._setupProxy;
|
|
82
|
+
return t("button", { class: s.classes, attrs: { disabled: e.disabled }, on: { click: s.handleClick } }, [e._t("default")], 2);
|
|
83
|
+
}, z = [], b = /* @__PURE__ */ f(
|
|
84
|
+
w,
|
|
85
|
+
g,
|
|
86
|
+
z,
|
|
87
|
+
!1,
|
|
88
|
+
null,
|
|
89
|
+
null,
|
|
90
|
+
null,
|
|
91
|
+
null
|
|
92
|
+
);
|
|
93
|
+
const y = b.exports, k = {
|
|
94
|
+
__name: "WzSidebar",
|
|
95
|
+
props: {
|
|
96
|
+
/**
|
|
97
|
+
* Array of nav items. Each item is either:
|
|
98
|
+
* - Nav item: { key, label, iconHtml, children[] }
|
|
99
|
+
* - Group label: { type: 'group', label }
|
|
100
|
+
*/
|
|
101
|
+
items: {
|
|
102
|
+
type: Array,
|
|
103
|
+
default: () => []
|
|
104
|
+
},
|
|
105
|
+
/**
|
|
106
|
+
* Key of the currently active item.
|
|
107
|
+
*/
|
|
108
|
+
activeKey: {
|
|
109
|
+
type: String,
|
|
110
|
+
default: null
|
|
111
|
+
},
|
|
112
|
+
/**
|
|
113
|
+
* Main logo image source.
|
|
114
|
+
*/
|
|
115
|
+
logoSrc: {
|
|
116
|
+
type: String,
|
|
117
|
+
default: null
|
|
118
|
+
},
|
|
119
|
+
/**
|
|
120
|
+
* Mini logo image source to show when collapsed.
|
|
121
|
+
*/
|
|
122
|
+
logoMiniSrc: {
|
|
123
|
+
type: String,
|
|
124
|
+
default: null
|
|
125
|
+
},
|
|
126
|
+
/**
|
|
127
|
+
* Brand name shown in the logo area.
|
|
128
|
+
*/
|
|
129
|
+
logoText: {
|
|
130
|
+
type: String,
|
|
131
|
+
default: "Admin"
|
|
132
|
+
},
|
|
133
|
+
/**
|
|
134
|
+
* SVG HTML string for the logo icon.
|
|
135
|
+
*/
|
|
136
|
+
logoIconHtml: {
|
|
137
|
+
type: String,
|
|
138
|
+
default: null
|
|
139
|
+
},
|
|
140
|
+
/**
|
|
141
|
+
* Whether the sidebar is collapsed (mini mode).
|
|
142
|
+
*/
|
|
143
|
+
collapsed: {
|
|
144
|
+
type: Boolean,
|
|
145
|
+
default: !1
|
|
102
146
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
147
|
+
},
|
|
148
|
+
emits: ["item-click"],
|
|
149
|
+
setup(i, { emit: e }) {
|
|
150
|
+
const t = i, s = v(/* @__PURE__ */ new Set()), a = (n) => n.key === t.activeKey, r = (n) => n.children && n.children.length > 0, o = (n) => s.value.has(n.key), _ = (n) => {
|
|
151
|
+
if (!r(n) || t.collapsed)
|
|
152
|
+
return;
|
|
153
|
+
const u = new Set(s.value);
|
|
154
|
+
u.has(n.key) ? u.delete(n.key) : u.add(n.key), s.value = u;
|
|
155
|
+
};
|
|
156
|
+
return { __sfc: !0, props: t, emit: e, openKeys: s, isActive: a, hasChildren: r, isOpen: o, toggle: _, handleClick: (n) => {
|
|
157
|
+
if (t.collapsed) {
|
|
158
|
+
e("item-click", n);
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
r(n) ? _(n) : e("item-click", n);
|
|
162
|
+
}, handleChildClick: (n) => {
|
|
163
|
+
e("item-click", n);
|
|
164
|
+
} };
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
var S = function() {
|
|
168
|
+
var e = this, t = e._self._c, s = e._self._setupProxy;
|
|
169
|
+
return t("aside", { staticClass: "wz-sidebar", class: { "wz-sidebar--collapsed": e.collapsed } }, [t("div", { staticClass: "wz-sidebar-logo" }, [e._t("logo", function() {
|
|
170
|
+
return [e.logoSrc || e.logoMiniSrc ? [e.collapsed && e.logoMiniSrc ? t("img", { staticClass: "wz-sidebar-logo-img-mini", attrs: { src: e.logoMiniSrc, alt: "Mini Logo" } }) : !e.collapsed && 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: !e.collapsed, expression: "!collapsed" }], staticClass: "wz-sidebar-logo-text" }, [e._v(e._s(e.logoText))])]];
|
|
171
|
+
})], 2), t("nav", { staticClass: "wz-sidebar-nav" }, [e._l(e.items, function(a, r) {
|
|
172
|
+
return [a.type === "group" ? t("div", { directives: [{ name: "show", rawName: "v-show", value: !e.collapsed, expression: "!collapsed" }], key: `group-${r}`, staticClass: "wz-sidebar-group" }, [e._v(" " + e._s(a.label) + " ")]) : t("div", { key: a.key || r, staticClass: "wz-sidebar-item-wrapper" }, [t("div", { staticClass: "wz-sidebar-item", class: { "wz-sidebar-item--active": s.isActive(a) }, attrs: { title: e.collapsed ? a.label : null }, on: { click: function(o) {
|
|
173
|
+
return s.handleClick(a);
|
|
174
|
+
} } }, [t("span", { staticClass: "wz-sidebar-icon" }, [e._t("icon", function() {
|
|
175
|
+
return [a.icon ? t("i", { class: a.icon, staticStyle: { "font-size": "1.125rem" } }) : a.iconHtml ? t("span", { domProps: { innerHTML: e._s(a.iconHtml) } }) : t("i", { staticClass: "ri-checkbox-blank-circle-line", staticStyle: { "font-size": "10px" } })];
|
|
176
|
+
}, { item: a })], 2), t("span", { directives: [{ name: "show", rawName: "v-show", value: !e.collapsed, expression: "!collapsed" }], staticClass: "wz-sidebar-label" }, [e._v(e._s(a.label))]), s.hasChildren(a) ? t("span", { directives: [{ name: "show", rawName: "v-show", value: !e.collapsed, expression: "!collapsed" }], staticClass: "wz-sidebar-arrow", class: { "wz-sidebar-arrow--open": s.isOpen(a) } }, [t("i", { staticClass: "ri-arrow-right-s-line", staticStyle: { "font-size": "1.125rem" } })]) : e._e()]), t("div", { directives: [{ name: "show", rawName: "v-show", value: !e.collapsed, expression: "!collapsed" }], staticClass: "wz-sidebar-children-wrapper", class: { "is-open": s.hasChildren(a) && s.isOpen(a) } }, [t("div", { staticClass: "wz-sidebar-children-inner" }, [s.hasChildren(a) ? t("div", { staticClass: "wz-sidebar-children" }, e._l(a.children, function(o) {
|
|
177
|
+
return t("div", { key: o.key, staticClass: "wz-sidebar-child-item", class: { "wz-sidebar-child-item--active": s.isActive(o) }, on: { click: function(_) {
|
|
178
|
+
return s.handleChildClick(o);
|
|
179
|
+
} } }, [t("span", { staticClass: "wz-sidebar-label" }, [e._v(e._s(o.label))]), s.hasChildren(o) ? t("span", { staticClass: "wz-sidebar-arrow" }, [t("i", { staticClass: "ri-arrow-right-s-line", staticStyle: { "font-size": "1rem" } })]) : e._e()]);
|
|
180
|
+
}), 0) : e._e()])])])];
|
|
181
|
+
})], 2)]);
|
|
182
|
+
}, $ = [], x = /* @__PURE__ */ f(
|
|
183
|
+
k,
|
|
184
|
+
S,
|
|
185
|
+
$,
|
|
186
|
+
!1,
|
|
187
|
+
null,
|
|
188
|
+
null,
|
|
189
|
+
null,
|
|
190
|
+
null
|
|
191
|
+
);
|
|
192
|
+
const P = x.exports, T = {
|
|
193
|
+
__name: "WzHeader",
|
|
194
|
+
props: {
|
|
195
|
+
/**
|
|
196
|
+
* User object with name and optional avatar URL.
|
|
197
|
+
*/
|
|
198
|
+
user: {
|
|
199
|
+
type: Object,
|
|
200
|
+
default: () => ({ name: "User", avatar: null })
|
|
201
|
+
},
|
|
202
|
+
/**
|
|
203
|
+
* Number shown on the notification badge. 0 hides the badge.
|
|
204
|
+
*/
|
|
205
|
+
notificationCount: {
|
|
206
|
+
type: Number,
|
|
207
|
+
default: 0
|
|
208
|
+
},
|
|
209
|
+
/**
|
|
210
|
+
* If true, changes the menu icon to a close (X) state.
|
|
211
|
+
*/
|
|
212
|
+
collapsed: {
|
|
213
|
+
type: Boolean,
|
|
214
|
+
default: !1
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
emits: ["menu-toggle", "search", "notifications", "settings", "user-click"],
|
|
218
|
+
setup(i, { emit: e }) {
|
|
219
|
+
return { __sfc: !0, props: i, emit: e, initials: (a) => a ? a.split(" ").map((r) => r[0]).slice(0, 2).join("").toUpperCase() : "?" };
|
|
220
|
+
}
|
|
221
|
+
};
|
|
222
|
+
var H = function() {
|
|
223
|
+
var e = this, t = e._self._c, s = e._self._setupProxy;
|
|
224
|
+
return t("header", { staticClass: "wz-header" }, [t("div", { staticClass: "wz-header-left" }, [t("button", { staticClass: "wz-header-action", attrs: { title: "Toggle menu" }, on: { click: function(a) {
|
|
225
|
+
return s.emit("menu-toggle");
|
|
226
|
+
} } }, [t("i", { class: e.collapsed ? "ri-close-line" : "ri-menu-line", staticStyle: { "font-size": "1.25rem" } })]), e._t("left")], 2), t("div", { staticClass: "wz-header-right" }, [e._t("actions", function() {
|
|
227
|
+
return [t("button", { staticClass: "wz-header-action", attrs: { title: "Search" }, on: { click: function(a) {
|
|
228
|
+
return s.emit("search");
|
|
229
|
+
} } }, [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(a) {
|
|
230
|
+
return s.emit("notifications");
|
|
231
|
+
} } }, [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)];
|
|
232
|
+
}), t("div", { staticClass: "wz-header-divider" }), e._t("user", function() {
|
|
233
|
+
return [t("div", { staticClass: "wz-header-user", on: { click: function(a) {
|
|
234
|
+
return s.emit("user-click");
|
|
235
|
+
} } }, [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(s.initials(e.user.name)) + " ")]), t("span", { staticClass: "wz-header-user-name" }, [e._v(e._s(e.user.name))])])];
|
|
236
|
+
}), t("button", { staticClass: "wz-header-action", attrs: { title: "Settings" }, on: { click: function(a) {
|
|
237
|
+
return s.emit("settings");
|
|
238
|
+
} } }, [t("i", { staticClass: "ri-settings-3-line", staticStyle: { "font-size": "1.125rem" } })])], 2)]);
|
|
239
|
+
}, N = [function() {
|
|
240
|
+
var i = this, e = i._self._c;
|
|
241
|
+
return i._self._setupProxy, e("button", { staticClass: "wz-header-action", attrs: { title: "Language" } }, [e("i", { staticClass: "ri-global-line", staticStyle: { "font-size": "1.125rem" } })]);
|
|
242
|
+
}, function() {
|
|
243
|
+
var i = this, e = i._self._c;
|
|
244
|
+
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" } })]);
|
|
245
|
+
}, function() {
|
|
246
|
+
var i = this, e = i._self._c;
|
|
247
|
+
return i._self._setupProxy, e("button", { staticClass: "wz-header-action", attrs: { title: "Calendar" } }, [e("i", { staticClass: "ri-calendar-line", staticStyle: { "font-size": "1.125rem" } })]);
|
|
248
|
+
}, function() {
|
|
249
|
+
var i = this, e = i._self._c;
|
|
250
|
+
return i._self._setupProxy, e("button", { staticClass: "wz-header-action", attrs: { title: "Fullscreen" } }, [e("i", { staticClass: "ri-fullscreen-line", staticStyle: { "font-size": "1.125rem" } })]);
|
|
251
|
+
}], R = /* @__PURE__ */ f(
|
|
252
|
+
T,
|
|
253
|
+
H,
|
|
254
|
+
N,
|
|
255
|
+
!1,
|
|
256
|
+
null,
|
|
257
|
+
null,
|
|
258
|
+
null,
|
|
259
|
+
null
|
|
260
|
+
);
|
|
261
|
+
const W = R.exports, B = {
|
|
262
|
+
__name: "WzLayout",
|
|
263
|
+
props: {
|
|
264
|
+
/**
|
|
265
|
+
* Whether the sidebar is collapsed initially.
|
|
266
|
+
*/
|
|
267
|
+
defaultCollapsed: {
|
|
268
|
+
type: Boolean,
|
|
269
|
+
default: !1
|
|
270
|
+
}
|
|
271
|
+
},
|
|
272
|
+
setup(i) {
|
|
273
|
+
const e = i, t = v(e.defaultCollapsed);
|
|
274
|
+
return { __sfc: !0, props: e, isCollapsed: t, toggleSidebar: () => {
|
|
275
|
+
t.value = !t.value;
|
|
276
|
+
} };
|
|
277
|
+
}
|
|
278
|
+
};
|
|
279
|
+
var L = function() {
|
|
280
|
+
var e = this, t = e._self._c, s = e._self._setupProxy;
|
|
281
|
+
return t("div", { staticClass: "wz-admin-layout" }, [t("div", { staticClass: "wz-admin-layout-sidebar-container" }, [e._t("sidebar", null, { collapsed: s.isCollapsed })], 2), t("div", { staticClass: "wz-admin-layout-main" }, [t("div", { staticClass: "wz-admin-layout-header-container" }, [e._t("header", null, { toggleSidebar: s.toggleSidebar, collapsed: s.isCollapsed })], 2), t("main", { staticClass: "wz-admin-layout-content" }, [e._t("default")], 2)])]);
|
|
282
|
+
}, M = [], O = /* @__PURE__ */ f(
|
|
283
|
+
B,
|
|
284
|
+
L,
|
|
285
|
+
M,
|
|
108
286
|
!1,
|
|
109
287
|
null,
|
|
110
288
|
null,
|
|
111
289
|
null,
|
|
112
290
|
null
|
|
113
291
|
);
|
|
114
|
-
const
|
|
115
|
-
WzButton:
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
292
|
+
const F = O.exports, A = {
|
|
293
|
+
WzButton: y,
|
|
294
|
+
WzSidebar: P,
|
|
295
|
+
WzHeader: W,
|
|
296
|
+
WzLayout: F
|
|
297
|
+
}, h = (i) => {
|
|
298
|
+
Object.entries(A).forEach(([e, t]) => {
|
|
299
|
+
i.component(e, t);
|
|
119
300
|
});
|
|
120
301
|
};
|
|
121
|
-
typeof window < "u" && window.Vue &&
|
|
122
|
-
const
|
|
302
|
+
typeof window < "u" && window.Vue && h(window.Vue);
|
|
303
|
+
const V = { install: h };
|
|
123
304
|
export {
|
|
124
|
-
|
|
125
|
-
|
|
305
|
+
y as WzButton,
|
|
306
|
+
W as WzHeader,
|
|
307
|
+
P as WzSidebar,
|
|
308
|
+
V as default
|
|
126
309
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(c,_){typeof exports=="object"&&typeof module<"u"?_(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],_):(c=typeof globalThis<"u"?globalThis:c||self,_(c.WizeAdminLibrary={},c.Vue))})(this,function(c,_){"use strict";const U="";function v(i,e,t,s,a,r,o,p){var l=typeof i=="function"?i.options:i;e&&(l.render=e,l.staticRenderFns=t,l._compiled=!0),s&&(l.functional=!0),r&&(l._scopeId="data-v-"+r);var d;if(o?(d=function(u){u=u||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,!u&&typeof __VUE_SSR_CONTEXT__<"u"&&(u=__VUE_SSR_CONTEXT__),a&&a.call(this,u),u&&u._registeredComponents&&u._registeredComponents.add(o)},l._ssrRegister=d):a&&(d=p?function(){a.call(this,(l.functional?this.parent:this).$root.$options.shadowRoot)}:a),d)if(l.functional){l._injectStyles=d;var n=l.render;l.render=function(V,z){return d.call(z),n(V,z)}}else{var f=l.beforeCreate;l.beforeCreate=f?[].concat(f,d):[d]}return{exports:i,options:l}}const g={__name:"WzButton",props:{variant:{type:String,default:"primary",validator:i=>["primary","secondary","success","danger","warning","info","light","dark","link","outline"].includes(i)},size:{type:String,default:"md",validator:i=>["sm","md","lg"].includes(i)},disabled:{type:Boolean,default:!1},block:{type:Boolean,default:!1}},emits:["click"],setup(i,{emit:e}){const t=i,s=_.computed(()=>["wz-btn",`wz-btn-${t.variant}`,`wz-btn-${t.size}`,{"wz-btn-block":t.block}]);return{__sfc:!0,props:t,emit:e,classes:s,handleClick:r=>{t.disabled||e("click",r)}}}};var b=function(){var e=this,t=e._self._c,s=e._self._setupProxy;return t("button",{class:s.classes,attrs:{disabled:e.disabled},on:{click:s.handleClick}},[e._t("default")],2)},y=[],k=v(g,b,y,!1,null,null,null,null);const h=k.exports,S={__name:"WzSidebar",props:{items:{type:Array,default:()=>[]},activeKey:{type:String,default:null},logoSrc:{type:String,default:null},logoMiniSrc:{type:String,default:null},logoText:{type:String,default:"Admin"},logoIconHtml:{type:String,default:null},collapsed:{type:Boolean,default:!1}},emits:["item-click"],setup(i,{emit:e}){const t=i,s=_.ref(new Set),a=n=>n.key===t.activeKey,r=n=>n.children&&n.children.length>0,o=n=>s.value.has(n.key),p=n=>{if(!r(n)||t.collapsed)return;const f=new Set(s.value);f.has(n.key)?f.delete(n.key):f.add(n.key),s.value=f};return{__sfc:!0,props:t,emit:e,openKeys:s,isActive:a,hasChildren:r,isOpen:o,toggle:p,handleClick:n=>{if(t.collapsed){e("item-click",n);return}r(n)?p(n):e("item-click",n)},handleChildClick:n=>{e("item-click",n)}}}};var $=function(){var e=this,t=e._self._c,s=e._self._setupProxy;return t("aside",{staticClass:"wz-sidebar",class:{"wz-sidebar--collapsed":e.collapsed}},[t("div",{staticClass:"wz-sidebar-logo"},[e._t("logo",function(){return[e.logoSrc||e.logoMiniSrc?[e.collapsed&&e.logoMiniSrc?t("img",{staticClass:"wz-sidebar-logo-img-mini",attrs:{src:e.logoMiniSrc,alt:"Mini Logo"}}):!e.collapsed&&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:!e.collapsed,expression:"!collapsed"}],staticClass:"wz-sidebar-logo-text"},[e._v(e._s(e.logoText))])]]})],2),t("nav",{staticClass:"wz-sidebar-nav"},[e._l(e.items,function(a,r){return[a.type==="group"?t("div",{directives:[{name:"show",rawName:"v-show",value:!e.collapsed,expression:"!collapsed"}],key:`group-${r}`,staticClass:"wz-sidebar-group"},[e._v(" "+e._s(a.label)+" ")]):t("div",{key:a.key||r,staticClass:"wz-sidebar-item-wrapper"},[t("div",{staticClass:"wz-sidebar-item",class:{"wz-sidebar-item--active":s.isActive(a)},attrs:{title:e.collapsed?a.label:null},on:{click:function(o){return s.handleClick(a)}}},[t("span",{staticClass:"wz-sidebar-icon"},[e._t("icon",function(){return[a.icon?t("i",{class:a.icon,staticStyle:{"font-size":"1.125rem"}}):a.iconHtml?t("span",{domProps:{innerHTML:e._s(a.iconHtml)}}):t("i",{staticClass:"ri-checkbox-blank-circle-line",staticStyle:{"font-size":"10px"}})]},{item:a})],2),t("span",{directives:[{name:"show",rawName:"v-show",value:!e.collapsed,expression:"!collapsed"}],staticClass:"wz-sidebar-label"},[e._v(e._s(a.label))]),s.hasChildren(a)?t("span",{directives:[{name:"show",rawName:"v-show",value:!e.collapsed,expression:"!collapsed"}],staticClass:"wz-sidebar-arrow",class:{"wz-sidebar-arrow--open":s.isOpen(a)}},[t("i",{staticClass:"ri-arrow-right-s-line",staticStyle:{"font-size":"1.125rem"}})]):e._e()]),t("div",{directives:[{name:"show",rawName:"v-show",value:!e.collapsed,expression:"!collapsed"}],staticClass:"wz-sidebar-children-wrapper",class:{"is-open":s.hasChildren(a)&&s.isOpen(a)}},[t("div",{staticClass:"wz-sidebar-children-inner"},[s.hasChildren(a)?t("div",{staticClass:"wz-sidebar-children"},e._l(a.children,function(o){return t("div",{key:o.key,staticClass:"wz-sidebar-child-item",class:{"wz-sidebar-child-item--active":s.isActive(o)},on:{click:function(p){return s.handleChildClick(o)}}},[t("span",{staticClass:"wz-sidebar-label"},[e._v(e._s(o.label))]),s.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)])},x=[],T=v(S,$,x,!1,null,null,null,null);const C=T.exports,W={__name:"WzHeader",props:{user:{type:Object,default:()=>({name:"User",avatar:null})},notificationCount:{type:Number,default:0},collapsed:{type:Boolean,default:!1}},emits:["menu-toggle","search","notifications","settings","user-click"],setup(i,{emit:e}){return{__sfc:!0,props:i,emit:e,initials:a=>a?a.split(" ").map(r=>r[0]).slice(0,2).join("").toUpperCase():"?"}}};var P=function(){var e=this,t=e._self._c,s=e._self._setupProxy;return t("header",{staticClass:"wz-header"},[t("div",{staticClass:"wz-header-left"},[t("button",{staticClass:"wz-header-action",attrs:{title:"Toggle menu"},on:{click:function(a){return s.emit("menu-toggle")}}},[t("i",{class:e.collapsed?"ri-close-line":"ri-menu-line",staticStyle:{"font-size":"1.25rem"}})]),e._t("left")],2),t("div",{staticClass:"wz-header-right"},[e._t("actions",function(){return[t("button",{staticClass:"wz-header-action",attrs:{title:"Search"},on:{click:function(a){return s.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(a){return s.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"}),e._t("user",function(){return[t("div",{staticClass:"wz-header-user",on:{click:function(a){return s.emit("user-click")}}},[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(s.initials(e.user.name))+" ")]),t("span",{staticClass:"wz-header-user-name"},[e._v(e._s(e.user.name))])])]}),t("button",{staticClass:"wz-header-action",attrs:{title:"Settings"},on:{click:function(a){return s.emit("settings")}}},[t("i",{staticClass:"ri-settings-3-line",staticStyle:{"font-size":"1.125rem"}})])],2)])},H=[function(){var i=this,e=i._self._c;return i._self._setupProxy,e("button",{staticClass:"wz-header-action",attrs:{title:"Language"}},[e("i",{staticClass:"ri-global-line",staticStyle:{"font-size":"1.125rem"}})])},function(){var i=this,e=i._self._c;return i._self._setupProxy,e("button",{staticClass:"wz-header-action",attrs:{title:"Toggle dark mode"}},[e("i",{staticClass:"ri-moon-line",staticStyle:{"font-size":"1.125rem"}})])},function(){var i=this,e=i._self._c;return i._self._setupProxy,e("button",{staticClass:"wz-header-action",attrs:{title:"Calendar"}},[e("i",{staticClass:"ri-calendar-line",staticStyle:{"font-size":"1.125rem"}})])},function(){var i=this,e=i._self._c;return i._self._setupProxy,e("button",{staticClass:"wz-header-action",attrs:{title:"Fullscreen"}},[e("i",{staticClass:"ri-fullscreen-line",staticStyle:{"font-size":"1.125rem"}})])}],M=v(W,P,H,!1,null,null,null,null);const m=M.exports,N={__name:"WzLayout",props:{defaultCollapsed:{type:Boolean,default:!1}},setup(i){const e=i,t=_.ref(e.defaultCollapsed);return{__sfc:!0,props:e,isCollapsed:t,toggleSidebar:()=>{t.value=!t.value}}}};var R=function(){var e=this,t=e._self._c,s=e._self._setupProxy;return t("div",{staticClass:"wz-admin-layout"},[t("div",{staticClass:"wz-admin-layout-sidebar-container"},[e._t("sidebar",null,{collapsed:s.isCollapsed})],2),t("div",{staticClass:"wz-admin-layout-main"},[t("div",{staticClass:"wz-admin-layout-header-container"},[e._t("header",null,{toggleSidebar:s.toggleSidebar,collapsed:s.isCollapsed})],2),t("main",{staticClass:"wz-admin-layout-content"},[e._t("default")],2)])])},B=[],L=v(N,R,B,!1,null,null,null,null);const O=L.exports,A={WzButton:h,WzSidebar:C,WzHeader:m,WzLayout:O},w=i=>{Object.entries(A).forEach(([e,t])=>{i.component(e,t)})};typeof window<"u"&&window.Vue&&w(window.Vue);const F={install:w};c.WzButton=h,c.WzHeader=m,c.WzSidebar=C,c.default=F,Object.defineProperties(c,{__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.2",
|
|
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",
|
|
@@ -47,5 +47,8 @@
|
|
|
47
47
|
"admin",
|
|
48
48
|
"tailwindcss"
|
|
49
49
|
],
|
|
50
|
-
"license": "MIT"
|
|
50
|
+
"license": "MIT",
|
|
51
|
+
"dependencies": {
|
|
52
|
+
"remixicon": "^4.9.1"
|
|
53
|
+
}
|
|
51
54
|
}
|