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.
@@ -1,44 +1,44 @@
1
- import { computed as f } from "vue";
2
- function m(n, e, r, s, l, d, o, p) {
3
- var t = typeof n == "function" ? n.options : n;
4
- e && (t.render = e, t.staticRenderFns = r, t._compiled = !0), s && (t.functional = !0), d && (t._scopeId = "data-v-" + d);
5
- var a;
6
- if (o ? (a = function(i) {
7
- i = i || // cached call
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, !i && typeof __VUE_SSR_CONTEXT__ < "u" && (i = __VUE_SSR_CONTEXT__), l && l.call(this, i), i && i._registeredComponents && i._registeredComponents.add(o);
10
- }, t._ssrRegister = a) : l && (a = p ? function() {
11
- l.call(
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
- (t.functional ? this.parent : this).$root.$options.shadowRoot
13
+ (l.functional ? this.parent : this).$root.$options.shadowRoot
14
14
  );
15
- } : l), a)
16
- if (t.functional) {
17
- t._injectStyles = a;
18
- var z = t.render;
19
- t.render = function(_, u) {
20
- return a.call(u), z(_, u);
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 c = t.beforeCreate;
24
- t.beforeCreate = c ? [].concat(c, a) : [a];
23
+ var u = l.beforeCreate;
24
+ l.beforeCreate = u ? [].concat(u, c) : [c];
25
25
  }
26
26
  return {
27
- exports: n,
28
- options: t
27
+ exports: i,
28
+ options: l
29
29
  };
30
30
  }
31
- const h = {
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: (n) => ["primary", "secondary", "danger", "outline"].includes(n)
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: (n) => ["sm", "md", "lg"].includes(n)
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(n, { emit: e }) {
69
- const r = n, s = f(() => {
70
- const o = {
71
- primary: "wz-bg-primary wz-text-white hover:wz-bg-primary-hover active:wz-bg-primary-hover",
72
- secondary: "wz-bg-secondary wz-text-white hover:wz-opacity-90",
73
- danger: "wz-bg-danger wz-text-white hover:wz-opacity-90",
74
- outline: "wz-border wz-border-primary wz-text-primary wz-bg-transparent hover:wz-bg-primary hover:wz-text-white"
75
- };
76
- return o[r.variant] || o.primary;
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 v = function() {
91
- var e = this, r = e._self._c, s = e._self._setupProxy;
92
- return r("button", { class: [
93
- "wz-inline-flex wz-items-center wz-justify-center",
94
- "wz-rounded-md wz-font-medium wz-cursor-pointer",
95
- "wz-transition-colors wz-duration-200 wz-ease-in-out",
96
- "focus:wz-outline-none focus:wz-ring-2 focus:wz-ring-primary focus:wz-ring-offset-2",
97
- s.variantClasses,
98
- s.sizeClasses,
99
- {
100
- "wz-w-full": e.block,
101
- "wz-opacity-50 wz-cursor-not-allowed": e.disabled
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
- ], attrs: { disabled: e.disabled }, on: { click: s.handleClick } }, [e._t("default")], 2);
104
- }, y = [], b = /* @__PURE__ */ m(
105
- h,
106
- v,
107
- y,
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 g = b.exports, C = {
115
- WzButton: g
116
- }, w = (n) => {
117
- Object.entries(C).forEach(([e, r]) => {
118
- n.component(e, r);
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 && w(window.Vue);
122
- const x = { install: w };
302
+ typeof window < "u" && window.Vue && h(window.Vue);
303
+ const V = { install: h };
123
304
  export {
124
- g as WzButton,
125
- x as default
305
+ y as WzButton,
306
+ W as WzHeader,
307
+ P as WzSidebar,
308
+ V as default
126
309
  };
@@ -1 +1 @@
1
- (function(s,u){typeof exports=="object"&&typeof module<"u"?u(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],u):(s=typeof globalThis<"u"?globalThis:s||self,u(s.WizeAdminLibrary={},s.Vue))})(this,function(s,u){"use strict";const T="";function _(n,e,r,d,l,f,i,C){var t=typeof n=="function"?n.options:n;e&&(t.render=e,t.staticRenderFns=r,t._compiled=!0),d&&(t.functional=!0),f&&(t._scopeId="data-v-"+f);var a;if(i?(a=function(o){o=o||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,!o&&typeof __VUE_SSR_CONTEXT__<"u"&&(o=__VUE_SSR_CONTEXT__),l&&l.call(this,o),o&&o._registeredComponents&&o._registeredComponents.add(i)},t._ssrRegister=a):l&&(a=C?function(){l.call(this,(t.functional?this.parent:this).$root.$options.shadowRoot)}:l),a)if(t.functional){t._injectStyles=a;var k=t.render;t.render=function(x,z){return a.call(z),k(x,z)}}else{var w=t.beforeCreate;t.beforeCreate=w?[].concat(w,a):[a]}return{exports:n,options:t}}const m={__name:"WzButton",props:{variant:{type:String,default:"primary",validator:n=>["primary","secondary","danger","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 r=n,d=u.computed(()=>{const i={primary:"wz-bg-primary wz-text-white hover:wz-bg-primary-hover active:wz-bg-primary-hover",secondary:"wz-bg-secondary wz-text-white hover:wz-opacity-90",danger:"wz-bg-danger wz-text-white hover:wz-opacity-90",outline:"wz-border wz-border-primary wz-text-primary wz-bg-transparent hover:wz-bg-primary hover:wz-text-white"};return i[r.variant]||i.primary}),l=u.computed(()=>{const i={sm:"wz-text-sm wz-px-3 wz-py-1",md:"wz-text-base wz-px-4 wz-py-2",lg:"wz-text-lg wz-px-6 wz-py-3"};return i[r.size]||i.md});return{__sfc:!0,props:r,emit:e,variantClasses:d,sizeClasses:l,handleClick:i=>{r.disabled||e("click",i)}}}};var h=function(){var e=this,r=e._self._c,d=e._self._setupProxy;return r("button",{class:["wz-inline-flex wz-items-center wz-justify-center","wz-rounded-md wz-font-medium wz-cursor-pointer","wz-transition-colors wz-duration-200 wz-ease-in-out","focus:wz-outline-none focus:wz-ring-2 focus:wz-ring-primary focus:wz-ring-offset-2",d.variantClasses,d.sizeClasses,{"wz-w-full":e.block,"wz-opacity-50 wz-cursor-not-allowed":e.disabled}],attrs:{disabled:e.disabled},on:{click:d.handleClick}},[e._t("default")],2)},v=[],y=_(m,h,v,!1,null,null,null,null);const c=y.exports,b={WzButton:c},p=n=>{Object.entries(b).forEach(([e,r])=>{n.component(e,r)})};typeof window<"u"&&window.Vue&&p(window.Vue);const g={install:p};s.WzButton=c,s.default=g,Object.defineProperties(s,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
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.0",
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
  }