appsalutely 0.1.6 → 0.1.8
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/appsalutely.js
CHANGED
|
@@ -3,37 +3,37 @@ import { ref as b, watch as M, computed as F, defineComponent as x, useModel as
|
|
|
3
3
|
import { useRouter as q, RouterView as R } from "vue-router";
|
|
4
4
|
import { VApp as J, VProgressLinear as G, VAppBar as O, VMain as H, VFooter as K, VBtn as V, VNavigationDrawer as Q, VList as X, VSnackbar as Y, VContainer as Z, VBreadcrumbs as ee, VCard as U, VForm as W, VCardText as I, VTextField as D, VListItem as te, VIcon as le, VOtpInput as oe } from "vuetify/components";
|
|
5
5
|
import { defineStore as C } from "pinia";
|
|
6
|
-
const
|
|
6
|
+
const ae = C("colorMode", () => {
|
|
7
7
|
const l = b(localStorage.getItem("colorMode") == "dark" ? "dark" : "light");
|
|
8
|
-
function
|
|
8
|
+
function a() {
|
|
9
9
|
l.value = l.value === "dark" ? "light" : "dark";
|
|
10
10
|
}
|
|
11
|
-
function o(
|
|
12
|
-
localStorage.setItem("colorMode",
|
|
11
|
+
function o(r) {
|
|
12
|
+
localStorage.setItem("colorMode", r), document.documentElement.setAttribute("data-theme", r);
|
|
13
13
|
}
|
|
14
|
-
return M(l, (
|
|
15
|
-
}),
|
|
16
|
-
const l = b([]),
|
|
17
|
-
function o(
|
|
18
|
-
return
|
|
19
|
-
n
|
|
20
|
-
},
|
|
14
|
+
return M(l, (r) => o(r)), o(l.value), { mode: l, toggle: a };
|
|
15
|
+
}), re = C("footer", () => {
|
|
16
|
+
const l = b([]), a = F(() => l.value.length > 0 ? l.value[l.value.length - 1] : null);
|
|
17
|
+
function o(n) {
|
|
18
|
+
return n.id || (n.id = (/* @__PURE__ */ new Date()).getTime().toString()), n.timeout === void 0 && (n.timeout = 5e3), l.value.push(n), n.timeout && setTimeout(() => {
|
|
19
|
+
r(n.id);
|
|
20
|
+
}, n.timeout), n.id;
|
|
21
21
|
}
|
|
22
|
-
function n
|
|
23
|
-
l.value = l.value.filter((f) => f.id !==
|
|
22
|
+
function r(n) {
|
|
23
|
+
l.value = l.value.filter((f) => f.id !== n);
|
|
24
24
|
}
|
|
25
|
-
return { messages: l, current:
|
|
26
|
-
}),
|
|
27
|
-
const l = b([]),
|
|
25
|
+
return { messages: l, current: a, addMessage: o, removeMessage: r };
|
|
26
|
+
}), ne = C("notify", () => {
|
|
27
|
+
const l = b([]), a = b({});
|
|
28
28
|
function o(e) {
|
|
29
|
-
return e.id ?
|
|
30
|
-
|
|
29
|
+
return e.id ? r(e.id) : e.id = (/* @__PURE__ */ new Date()).getTime().toString(), e.timeout === void 0 && (e.timeout = 5e3), l.value.push(e), e.timeout && (a.value[e.id] = setTimeout(() => {
|
|
30
|
+
r(e.id);
|
|
31
31
|
}, e.timeout)), e.id;
|
|
32
32
|
}
|
|
33
|
-
function
|
|
34
|
-
l.value = l.value.filter((k) => k.id !== e),
|
|
33
|
+
function r(e) {
|
|
34
|
+
l.value = l.value.filter((k) => k.id !== e), a.value[e] && (clearTimeout(a.value[e]), delete a.value[e]);
|
|
35
35
|
}
|
|
36
|
-
function
|
|
36
|
+
function n(e) {
|
|
37
37
|
return o({ text: e, type: "info" });
|
|
38
38
|
}
|
|
39
39
|
function f(e) {
|
|
@@ -45,7 +45,7 @@ const ne = C("colorMode", () => {
|
|
|
45
45
|
function i(e) {
|
|
46
46
|
return o({ text: e, type: "error" });
|
|
47
47
|
}
|
|
48
|
-
return { messages: l, add: o, remove:
|
|
48
|
+
return { messages: l, add: o, remove: r, info: n, success: f, warning: u, error: i };
|
|
49
49
|
}), ue = { class: "d-flex flex-column pa-4 h-100" }, ie = ["textContent"], ye = /* @__PURE__ */ x({
|
|
50
50
|
__name: "AppBase",
|
|
51
51
|
props: {
|
|
@@ -54,8 +54,8 @@ const ne = C("colorMode", () => {
|
|
|
54
54
|
},
|
|
55
55
|
emits: ["update:drawerOpen"],
|
|
56
56
|
setup(l) {
|
|
57
|
-
const
|
|
58
|
-
return M(
|
|
57
|
+
const a = ae(), o = $(l, "drawerOpen"), r = b(!1), n = re(), f = b(!1), u = b(null), i = ne(), e = q(), k = A();
|
|
58
|
+
return M(r, (y) => {
|
|
59
59
|
localStorage.setItem("drawerDocked", String(y));
|
|
60
60
|
}), E(() => {
|
|
61
61
|
e.beforeEach(() => {
|
|
@@ -64,9 +64,9 @@ const ne = C("colorMode", () => {
|
|
|
64
64
|
}, 300);
|
|
65
65
|
}), e.afterEach(() => {
|
|
66
66
|
u.value && (clearTimeout(u.value), u.value = null), f.value = !1;
|
|
67
|
-
}),
|
|
67
|
+
}), r.value = localStorage.getItem("drawerDocked") === "true", o.value = r.value;
|
|
68
68
|
}), (y, v) => (m(), c(t(J), {
|
|
69
|
-
theme: t(
|
|
69
|
+
theme: t(a).mode
|
|
70
70
|
}, {
|
|
71
71
|
default: s(() => [
|
|
72
72
|
f.value ? (m(), c(t(G), {
|
|
@@ -98,20 +98,20 @@ const ne = C("colorMode", () => {
|
|
|
98
98
|
default: s(() => [
|
|
99
99
|
d(t(K), { class: "py-0 w-100 d-flex align-center" }, {
|
|
100
100
|
default: s(() => [
|
|
101
|
-
t(
|
|
101
|
+
t(n).current ? (m(), S("span", {
|
|
102
102
|
key: 0,
|
|
103
|
-
textContent: P(t(
|
|
104
|
-
class: z([t(
|
|
103
|
+
textContent: P(t(n).current.text),
|
|
104
|
+
class: z([t(n).current.type ? {} : { ["text-" + t(n).current.type]: !0 }, "overflow-hidden text-no-wrap"]),
|
|
105
105
|
style: { "text-overflow": "ellipsis" }
|
|
106
106
|
}, null, 10, ie)) : g("", !0),
|
|
107
|
-
t(
|
|
107
|
+
t(n).current && t(n).current.actions ? (m(!0), S(T, { key: 1 }, L(Object.entries(t(n).current.actions), (p, _) => (m(), c(t(V), {
|
|
108
108
|
text: p[0],
|
|
109
109
|
onClick: p[1],
|
|
110
110
|
key: _,
|
|
111
111
|
density: "comfortable",
|
|
112
112
|
variant: "tonal",
|
|
113
113
|
class: "mx-2 px-2 text-none",
|
|
114
|
-
color: t(
|
|
114
|
+
color: t(n).current.type
|
|
115
115
|
}, null, 8, ["text", "onClick", "color"]))), 128)) : g("", !0),
|
|
116
116
|
v[2] || (v[2] = w("div", { class: "me-auto" }, null, -1)),
|
|
117
117
|
h(y.$slots, "footer")
|
|
@@ -128,8 +128,8 @@ const ne = C("colorMode", () => {
|
|
|
128
128
|
"onUpdate:modelValue": v[1] || (v[1] = (p) => o.value = p),
|
|
129
129
|
width: "250",
|
|
130
130
|
"rail-width": "58",
|
|
131
|
-
rail:
|
|
132
|
-
mobile:
|
|
131
|
+
rail: r.value,
|
|
132
|
+
mobile: r.value ? !1 : void 0
|
|
133
133
|
}, {
|
|
134
134
|
default: s(() => [
|
|
135
135
|
d(t(X), {
|
|
@@ -140,13 +140,13 @@ const ne = C("colorMode", () => {
|
|
|
140
140
|
h(y.$slots, "drawer"),
|
|
141
141
|
v[3] || (v[3] = w("div", { class: "flex-grow-1" }, null, -1)),
|
|
142
142
|
d(t(V), {
|
|
143
|
-
onClick: v[0] || (v[0] = (p) =>
|
|
143
|
+
onClick: v[0] || (v[0] = (p) => r.value = !r.value),
|
|
144
144
|
icon: "mdi-pin-outline",
|
|
145
145
|
rounded: "rounded",
|
|
146
146
|
density: "comfortable",
|
|
147
|
-
title:
|
|
147
|
+
title: r.value ? "Undock sidebar" : "Dock sidebar",
|
|
148
148
|
class: "ma-1 ms-auto",
|
|
149
|
-
variant:
|
|
149
|
+
variant: r.value ? "tonal" : "text"
|
|
150
150
|
}, null, 8, ["title", "variant"])
|
|
151
151
|
]),
|
|
152
152
|
_: 3,
|
|
@@ -183,31 +183,31 @@ const ne = C("colorMode", () => {
|
|
|
183
183
|
fluid: { type: Boolean, default: !0 }
|
|
184
184
|
},
|
|
185
185
|
setup(l) {
|
|
186
|
-
return (
|
|
187
|
-
fluid:
|
|
186
|
+
return (a, o) => (m(), c(t(Z), {
|
|
187
|
+
fluid: a.fluid,
|
|
188
188
|
class: "h-100 d-flex flex-column py-0 h-100"
|
|
189
189
|
}, {
|
|
190
190
|
default: s(() => [
|
|
191
|
-
|
|
191
|
+
a.breadcrumbs ? (m(), c(t(ee), {
|
|
192
192
|
key: 0,
|
|
193
|
-
items:
|
|
193
|
+
items: a.breadcrumbs,
|
|
194
194
|
density: "comfortable",
|
|
195
195
|
class: "pa-0 flex-wrap"
|
|
196
196
|
}, null, 8, ["items"])) : g("", !0),
|
|
197
|
-
h(
|
|
197
|
+
h(a.$slots, "default")
|
|
198
198
|
]),
|
|
199
199
|
_: 3
|
|
200
200
|
}, 8, ["fluid"]));
|
|
201
201
|
}
|
|
202
|
-
}), se = (l,
|
|
202
|
+
}), se = (l, a) => {
|
|
203
203
|
const o = l.__vccOpts || l;
|
|
204
|
-
for (const [
|
|
205
|
-
o[
|
|
204
|
+
for (const [r, n] of a)
|
|
205
|
+
o[r] = n;
|
|
206
206
|
return o;
|
|
207
207
|
}, de = {}, me = { class: "h-100 d-flex align-center" };
|
|
208
|
-
function fe(l,
|
|
208
|
+
function fe(l, a) {
|
|
209
209
|
return m(), S(T, null, [
|
|
210
|
-
|
|
210
|
+
a[0] || (a[0] = w("span", {
|
|
211
211
|
class: "border-s mx-3",
|
|
212
212
|
style: { height: "32px" }
|
|
213
213
|
}, null, -1)),
|
|
@@ -233,8 +233,8 @@ const xe = /* @__PURE__ */ se(de, [["render", fe]]), ke = /* @__PURE__ */ x({
|
|
|
233
233
|
passwordModifiers: {}
|
|
234
234
|
}),
|
|
235
235
|
emits: /* @__PURE__ */ B(["submit"], ["update:username", "update:password"]),
|
|
236
|
-
setup(l, { emit:
|
|
237
|
-
const o = $(l, "username"),
|
|
236
|
+
setup(l, { emit: a }) {
|
|
237
|
+
const o = $(l, "username"), r = $(l, "password"), n = a, f = b(!1);
|
|
238
238
|
return (u, i) => (m(), c(t(U), {
|
|
239
239
|
title: u.title,
|
|
240
240
|
"min-width": u.minWidth,
|
|
@@ -242,7 +242,7 @@ const xe = /* @__PURE__ */ se(de, [["render", fe]]), ke = /* @__PURE__ */ x({
|
|
|
242
242
|
}, {
|
|
243
243
|
default: s(() => [
|
|
244
244
|
d(t(W), {
|
|
245
|
-
onSubmit: i[2] || (i[2] = N((e) =>
|
|
245
|
+
onSubmit: i[2] || (i[2] = N((e) => n("submit", o.value, r.value), ["prevent"])),
|
|
246
246
|
modelValue: f.value,
|
|
247
247
|
"onUpdate:modelValue": i[3] || (i[3] = (e) => f.value = e)
|
|
248
248
|
}, {
|
|
@@ -258,8 +258,8 @@ const xe = /* @__PURE__ */ se(de, [["render", fe]]), ke = /* @__PURE__ */ x({
|
|
|
258
258
|
autofocus: ""
|
|
259
259
|
}, null, 8, ["modelValue", "label", "rules"]),
|
|
260
260
|
d(t(D), {
|
|
261
|
-
modelValue:
|
|
262
|
-
"onUpdate:modelValue": i[1] || (i[1] = (e) =>
|
|
261
|
+
modelValue: r.value,
|
|
262
|
+
"onUpdate:modelValue": i[1] || (i[1] = (e) => r.value = e),
|
|
263
263
|
label: u.passwordLabel,
|
|
264
264
|
type: "password",
|
|
265
265
|
rules: [(e) => !!e || "Password is required"],
|
|
@@ -289,23 +289,27 @@ const xe = /* @__PURE__ */ se(de, [["render", fe]]), ke = /* @__PURE__ */ x({
|
|
|
289
289
|
__name: "NavDrawerLink",
|
|
290
290
|
props: {
|
|
291
291
|
to: {},
|
|
292
|
+
href: {},
|
|
293
|
+
target: {},
|
|
292
294
|
icon: {},
|
|
293
295
|
text: {}
|
|
294
296
|
},
|
|
295
297
|
setup(l) {
|
|
296
|
-
return (
|
|
298
|
+
return (a, o) => (m(), c(t(te), {
|
|
297
299
|
role: "option",
|
|
298
|
-
to:
|
|
300
|
+
to: a.to,
|
|
301
|
+
href: a.href,
|
|
302
|
+
target: a.target,
|
|
299
303
|
slim: ""
|
|
300
304
|
}, {
|
|
301
305
|
prepend: s(() => [
|
|
302
|
-
d(t(le), { icon:
|
|
306
|
+
d(t(le), { icon: a.icon }, null, 8, ["icon"])
|
|
303
307
|
]),
|
|
304
308
|
default: s(() => [
|
|
305
|
-
w("span", ce, P(
|
|
309
|
+
w("span", ce, P(a.text), 1)
|
|
306
310
|
]),
|
|
307
311
|
_: 1
|
|
308
|
-
}, 8, ["to"]));
|
|
312
|
+
}, 8, ["to", "href", "target"]));
|
|
309
313
|
}
|
|
310
314
|
}), Se = /* @__PURE__ */ x({
|
|
311
315
|
__name: "OTPForm",
|
|
@@ -323,10 +327,10 @@ const xe = /* @__PURE__ */ se(de, [["render", fe]]), ke = /* @__PURE__ */ x({
|
|
|
323
327
|
otpModifiers: {}
|
|
324
328
|
}),
|
|
325
329
|
emits: /* @__PURE__ */ B(["submit"], ["update:otp"]),
|
|
326
|
-
setup(l, { emit:
|
|
327
|
-
const o = $(l, "otp"),
|
|
330
|
+
setup(l, { emit: a }) {
|
|
331
|
+
const o = $(l, "otp"), r = a, n = l, f = F(() => o.value.length === n.length);
|
|
328
332
|
return M(o, () => {
|
|
329
|
-
|
|
333
|
+
n.autosubmit && o.value.length === n.length && r("submit", o.value);
|
|
330
334
|
}), (u, i) => (m(), c(t(U), {
|
|
331
335
|
title: u.title,
|
|
332
336
|
subtitle: u.subtitle,
|
|
@@ -335,7 +339,7 @@ const xe = /* @__PURE__ */ se(de, [["render", fe]]), ke = /* @__PURE__ */ x({
|
|
|
335
339
|
}, {
|
|
336
340
|
default: s(() => [
|
|
337
341
|
d(t(W), {
|
|
338
|
-
onSubmit: i[1] || (i[1] = N((e) =>
|
|
342
|
+
onSubmit: i[1] || (i[1] = N((e) => r("submit", o.value), ["prevent"])),
|
|
339
343
|
"model-value": f.value
|
|
340
344
|
}, {
|
|
341
345
|
default: s(() => [
|
|
@@ -387,7 +391,7 @@ export {
|
|
|
387
391
|
_e as NavDrawerLink,
|
|
388
392
|
Se as OTPForm,
|
|
389
393
|
$e as filters,
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
394
|
+
ae as useColorMode,
|
|
395
|
+
re as useFooter,
|
|
396
|
+
ne as useNotify
|
|
393
397
|
};
|
package/dist/appsalutely.umd.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode("html{overflow:auto}html[data-theme=dark]{color-scheme:dark}html[data-theme=light]{color-scheme:light}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
|
-
(function(s,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("vue-router"),require("vuetify/components"),require("pinia")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router","vuetify/components","pinia"],e):(s=typeof globalThis<"u"?globalThis:s||self,e(s.appsalutely={},s.Vue,s.VueRouter,s.VuetifyComponents,s.Pinia))})(this,function(s,e,b,i,w){"use strict";const y=w.defineStore("colorMode",()=>{const r=e.ref(localStorage.getItem("colorMode")=="dark"?"dark":"light");function a(){r.value=r.value==="dark"?"light":"dark"}function l(o){localStorage.setItem("colorMode",o),document.documentElement.setAttribute("data-theme",o)}return e.watch(r,o=>l(o)),l(r.value),{mode:r,toggle:a}}),k=w.defineStore("footer",()=>{const r=e.ref([]),a=e.computed(()=>r.value.length>0?r.value[r.value.length-1]:null);function l(n){return n.id||(n.id=new Date().getTime().toString()),n.timeout===void 0&&(n.timeout=5e3),r.value.push(n),n.timeout&&setTimeout(()=>{o(n.id)},n.timeout),n.id}function o(n){r.value=r.value.filter(f=>f.id!==n)}return{messages:r,current:a,addMessage:l,removeMessage:o}}),g=w.defineStore("notify",()=>{const r=e.ref([]),a=e.ref({});function l(t){return t.id?o(t.id):t.id=new Date().getTime().toString(),t.timeout===void 0&&(t.timeout=5e3),r.value.push(t),t.timeout&&(a.value[t.id]=setTimeout(()=>{o(t.id)},t.timeout)),t.id}function o(t){r.value=r.value.filter(h=>h.id!==t),a.value[t]&&(clearTimeout(a.value[t]),delete a.value[t])}function n(t){return l({text:t,type:"info"})}function f(t){return l({text:t,type:"success"})}function d(t){return l({text:t,type:"warning"})}function u(t){return l({text:t,type:"error"})}return{messages:r,add:l,remove:o,info:n,success:f,warning:d,error:u}}),B={class:"d-flex flex-column pa-4 h-100"},x=["textContent"],C=e.defineComponent({__name:"AppBase",props:{drawerOpen:{type:Boolean,default:!1},drawerOpenModifiers:{}},emits:["update:drawerOpen"],setup(r){const a=y(),l=e.useModel(r,"drawerOpen"),o=e.ref(!1),n=k(),f=e.ref(!1),d=e.ref(null),u=g(),t=b.useRouter(),h=e.useSlots();return e.watch(o,p=>{localStorage.setItem("drawerDocked",String(p))}),e.onBeforeMount(()=>{t.beforeEach(()=>{d.value=setTimeout(()=>{f.value=!0},300)}),t.afterEach(()=>{d.value&&(clearTimeout(d.value),d.value=null),f.value=!1}),o.value=localStorage.getItem("drawerDocked")==="true",l.value=o.value}),(p,m)=>(e.openBlock(),e.createBlock(e.unref(i.VApp),{theme:e.unref(a).mode},{default:e.withCtx(()=>[f.value?(e.openBlock(),e.createBlock(e.unref(i.VProgressLinear),{key:0,indeterminate:"",class:"mb-n1",style:{"z-index":"100000",opacity:"0.5"},height:"1"})):e.createCommentVNode("",!0),e.createVNode(e.unref(i.VAppBar),{height:"64"},{default:e.withCtx(()=>[e.renderSlot(p.$slots,"header")]),_:3}),e.createVNode(e.unref(i.VMain),{class:"bg-surface-light"},{default:e.withCtx(()=>[e.createElementVNode("div",B,[e.createVNode(e.unref(b.RouterView))])]),_:1}),e.unref(h).footer?(e.openBlock(),e.createBlock(e.unref(i.VAppBar),{key:1,height:"40",location:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(i.VFooter),{class:"py-0 w-100 d-flex align-center"},{default:e.withCtx(()=>[e.unref(n).current?(e.openBlock(),e.createElementBlock("span",{key:0,textContent:e.toDisplayString(e.unref(n).current.text),class:e.normalizeClass([e.unref(n).current.type?{}:{["text-"+e.unref(n).current.type]:!0},"overflow-hidden text-no-wrap"]),style:{"text-overflow":"ellipsis"}},null,10,x)):e.createCommentVNode("",!0),e.unref(n).current&&e.unref(n).current.actions?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(Object.entries(e.unref(n).current.actions),(c,V)=>(e.openBlock(),e.createBlock(e.unref(i.VBtn),{text:c[0],onClick:c[1],key:V,density:"comfortable",variant:"tonal",class:"mx-2 px-2 text-none",color:e.unref(n).current.type},null,8,["text","onClick","color"]))),128)):e.createCommentVNode("",!0),m[2]||(m[2]=e.createElementVNode("div",{class:"me-auto"},null,-1)),e.renderSlot(p.$slots,"footer")]),_:3,__:[2]})]),_:3})):e.createCommentVNode("",!0),e.unref(h).drawer?(e.openBlock(),e.createBlock(e.unref(i.VNavigationDrawer),{key:2,modelValue:l.value,"onUpdate:modelValue":m[1]||(m[1]=c=>l.value=c),width:"250","rail-width":"58",rail:o.value,mobile:o.value?!1:void 0},{default:e.withCtx(()=>[e.createVNode(e.unref(i.VList),{class:"h-100 d-flex flex-column",nav:""},{default:e.withCtx(()=>[e.renderSlot(p.$slots,"drawer"),m[3]||(m[3]=e.createElementVNode("div",{class:"flex-grow-1"},null,-1)),e.createVNode(e.unref(i.VBtn),{onClick:m[0]||(m[0]=c=>o.value=!o.value),icon:"mdi-pin-outline",rounded:"rounded",density:"comfortable",title:o.value?"Undock sidebar":"Dock sidebar",class:"ma-1 ms-auto",variant:o.value?"tonal":"text"},null,8,["title","variant"])]),_:3,__:[3]})]),_:3},8,["modelValue","rail","mobile"])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(u).messages,(c,V)=>(e.openBlock(),e.createBlock(e.unref(i.VSnackbar),{key:V,"model-value":!0,text:c.text,color:c.type,location:"bottom end",style:e.normalizeStyle({bottom:`${V*56}px`}),timeout:-1},{actions:e.withCtx(()=>[e.createVNode(e.unref(i.VBtn),{icon:"mdi-close",onClick:U=>e.unref(u).remove(c.id)},null,8,["onClick"])]),_:2},1032,["text","color","style"]))),128))]),_:3},8,["theme"]))}}),N=e.defineComponent({__name:"DashboardPage",props:{breadcrumbs:{},fluid:{type:Boolean,default:!0}},setup(r){return(a,l)=>(e.openBlock(),e.createBlock(e.unref(i.VContainer),{fluid:a.fluid,class:"h-100 d-flex flex-column py-0 h-100"},{default:e.withCtx(()=>[a.breadcrumbs?(e.openBlock(),e.createBlock(e.unref(i.VBreadcrumbs),{key:0,items:a.breadcrumbs,density:"comfortable",class:"pa-0 flex-wrap"},null,8,["items"])):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"default")]),_:3},8,["fluid"]))}}),S=(r,a)=>{const l=r.__vccOpts||r;for(const[o,n]of a)l[o]=n;return l},M={},T={class:"h-100 d-flex align-center"};function _(r,a){return e.openBlock(),e.createElementBlock(e.Fragment,null,[a[0]||(a[0]=e.createElementVNode("span",{class:"border-s mx-3",style:{height:"32px"}},null,-1)),e.createElementVNode("span",T,[e.renderSlot(r.$slots,"default")])],64)}const $=S(M,[["render",_]]),F=e.defineComponent({__name:"LoginForm",props:e.mergeModels({title:{default:"Log in"},submitButtonText:{default:"Log in"},minWidth:{},maxWidth:{},loading:{type:Boolean},usernameLabel:{default:"Username"},passwordLabel:{default:"Password"}},{username:{default:""},usernameModifiers:{},password:{default:""},passwordModifiers:{}}),emits:e.mergeModels(["submit"],["update:username","update:password"]),setup(r,{emit:a}){const l=e.useModel(r,"username"),o=e.useModel(r,"password"),n=a,f=e.ref(!1);return(d,u)=>(e.openBlock(),e.createBlock(e.unref(i.VCard),{title:d.title,"min-width":d.minWidth,"max-width":d.maxWidth},{default:e.withCtx(()=>[e.createVNode(e.unref(i.VForm),{onSubmit:u[2]||(u[2]=e.withModifiers(t=>n("submit",l.value,o.value),["prevent"])),modelValue:f.value,"onUpdate:modelValue":u[3]||(u[3]=t=>f.value=t)},{default:e.withCtx(()=>[e.createVNode(e.unref(i.VCardText),{class:"d-flex flex-column"},{default:e.withCtx(()=>[e.createVNode(e.unref(i.VTextField),{modelValue:l.value,"onUpdate:modelValue":u[0]||(u[0]=t=>l.value=t),label:d.usernameLabel,rules:[t=>!!t||"Username is required"],"persistent-placeholder":"",autofocus:""},null,8,["modelValue","label","rules"]),e.createVNode(e.unref(i.VTextField),{modelValue:o.value,"onUpdate:modelValue":u[1]||(u[1]=t=>o.value=t),label:d.passwordLabel,type:"password",rules:[t=>!!t||"Password is required"],"persistent-placeholder":""},null,8,["modelValue","label","rules"]),e.createVNode(e.unref(i.VBtn),{disabled:!f.value,type:"submit",color:"primary",variant:"flat",text:d.submitButtonText,loading:d.loading,class:"align-self-center"},null,8,["disabled","text","loading"]),e.renderSlot(d.$slots,"beneath")]),_:3})]),_:3},8,["modelValue"])]),_:3},8,["title","min-width","max-width"]))}}),L={class:"text-no-wrap overflow-hidden"},O=e.defineComponent({__name:"NavDrawerLink",props:{to:{},icon:{},text:{}},setup(r){return(a,l)=>(e.openBlock(),e.createBlock(e.unref(i.VListItem),{role:"option",to:a.to,slim:""},{prepend:e.withCtx(()=>[e.createVNode(e.unref(i.VIcon),{icon:a.icon},null,8,["icon"])]),default:e.withCtx(()=>[e.createElementVNode("span",L,e.toDisplayString(a.text),1)]),_:1},8,["to"]))}}),E=e.defineComponent({__name:"OTPForm",props:e.mergeModels({title:{default:"2FA Verification"},subtitle:{default:"Enter the code from your authenticator app"},submitButtonText:{default:"Verify"},minWidth:{},maxWidth:{},loading:{type:Boolean},length:{default:6},autosubmit:{type:Boolean,default:!0}},{otp:{default:""},otpModifiers:{}}),emits:e.mergeModels(["submit"],["update:otp"]),setup(r,{emit:a}){const l=e.useModel(r,"otp"),o=a,n=r,f=e.computed(()=>l.value.length===n.length);return e.watch(l,()=>{n.autosubmit&&l.value.length===n.length&&o("submit",l.value)}),(d,u)=>(e.openBlock(),e.createBlock(e.unref(i.VCard),{title:d.title,subtitle:d.subtitle,"min-width":d.minWidth,"max-width":d.maxWidth},{default:e.withCtx(()=>[e.createVNode(e.unref(i.VForm),{onSubmit:u[1]||(u[1]=e.withModifiers(t=>o("submit",l.value),["prevent"])),"model-value":f.value},{default:e.withCtx(()=>[e.createVNode(e.unref(i.VCardText),{class:"d-flex flex-column"},{default:e.withCtx(()=>[e.createVNode(e.unref(i.VOtpInput),{modelValue:l.value,"onUpdate:modelValue":u[0]||(u[0]=t=>l.value=t),label:"OTP","persistent-placeholder":"",autofocus:"",length:d.length},null,8,["modelValue","length"]),e.createVNode(e.unref(i.VBtn),{disabled:!f.value,type:"submit",color:"primary",variant:"flat",text:d.submitButtonText,loading:d.loading,class:"align-self-center"},null,8,["disabled","text","loading"]),e.renderSlot(d.$slots,"beneath")]),_:3})]),_:3},8,["model-value"])]),_:3},8,["title","subtitle","min-width","max-width"]))}});function D(r){return!r||r.length===0?{}:{filter:JSON.stringify(r)}}const P=Object.freeze(Object.defineProperty({__proto__:null,asParams:D},Symbol.toStringTag,{value:"Module"}));s.AppBase=C,s.DashboardPage=N,s.FooterSection=$,s.LoginForm=F,s.NavDrawerLink=O,s.OTPForm=E,s.filters=P,s.useColorMode=y,s.useFooter=k,s.useNotify=g,Object.defineProperty(s,Symbol.toStringTag,{value:"Module"})});
|
|
2
|
+
(function(s,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("vue-router"),require("vuetify/components"),require("pinia")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router","vuetify/components","pinia"],e):(s=typeof globalThis<"u"?globalThis:s||self,e(s.appsalutely={},s.Vue,s.VueRouter,s.VuetifyComponents,s.Pinia))})(this,function(s,e,b,i,w){"use strict";const g=w.defineStore("colorMode",()=>{const r=e.ref(localStorage.getItem("colorMode")=="dark"?"dark":"light");function o(){r.value=r.value==="dark"?"light":"dark"}function l(n){localStorage.setItem("colorMode",n),document.documentElement.setAttribute("data-theme",n)}return e.watch(r,n=>l(n)),l(r.value),{mode:r,toggle:o}}),y=w.defineStore("footer",()=>{const r=e.ref([]),o=e.computed(()=>r.value.length>0?r.value[r.value.length-1]:null);function l(a){return a.id||(a.id=new Date().getTime().toString()),a.timeout===void 0&&(a.timeout=5e3),r.value.push(a),a.timeout&&setTimeout(()=>{n(a.id)},a.timeout),a.id}function n(a){r.value=r.value.filter(u=>u.id!==a)}return{messages:r,current:o,addMessage:l,removeMessage:n}}),k=w.defineStore("notify",()=>{const r=e.ref([]),o=e.ref({});function l(t){return t.id?n(t.id):t.id=new Date().getTime().toString(),t.timeout===void 0&&(t.timeout=5e3),r.value.push(t),t.timeout&&(o.value[t.id]=setTimeout(()=>{n(t.id)},t.timeout)),t.id}function n(t){r.value=r.value.filter(h=>h.id!==t),o.value[t]&&(clearTimeout(o.value[t]),delete o.value[t])}function a(t){return l({text:t,type:"info"})}function u(t){return l({text:t,type:"success"})}function d(t){return l({text:t,type:"warning"})}function f(t){return l({text:t,type:"error"})}return{messages:r,add:l,remove:n,info:a,success:u,warning:d,error:f}}),B={class:"d-flex flex-column pa-4 h-100"},C=["textContent"],x=e.defineComponent({__name:"AppBase",props:{drawerOpen:{type:Boolean,default:!1},drawerOpenModifiers:{}},emits:["update:drawerOpen"],setup(r){const o=g(),l=e.useModel(r,"drawerOpen"),n=e.ref(!1),a=y(),u=e.ref(!1),d=e.ref(null),f=k(),t=b.useRouter(),h=e.useSlots();return e.watch(n,p=>{localStorage.setItem("drawerDocked",String(p))}),e.onBeforeMount(()=>{t.beforeEach(()=>{d.value=setTimeout(()=>{u.value=!0},300)}),t.afterEach(()=>{d.value&&(clearTimeout(d.value),d.value=null),u.value=!1}),n.value=localStorage.getItem("drawerDocked")==="true",l.value=n.value}),(p,m)=>(e.openBlock(),e.createBlock(e.unref(i.VApp),{theme:e.unref(o).mode},{default:e.withCtx(()=>[u.value?(e.openBlock(),e.createBlock(e.unref(i.VProgressLinear),{key:0,indeterminate:"",class:"mb-n1",style:{"z-index":"100000",opacity:"0.5"},height:"1"})):e.createCommentVNode("",!0),e.createVNode(e.unref(i.VAppBar),{height:"64"},{default:e.withCtx(()=>[e.renderSlot(p.$slots,"header")]),_:3}),e.createVNode(e.unref(i.VMain),{class:"bg-surface-light"},{default:e.withCtx(()=>[e.createElementVNode("div",B,[e.createVNode(e.unref(b.RouterView))])]),_:1}),e.unref(h).footer?(e.openBlock(),e.createBlock(e.unref(i.VAppBar),{key:1,height:"40",location:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(i.VFooter),{class:"py-0 w-100 d-flex align-center"},{default:e.withCtx(()=>[e.unref(a).current?(e.openBlock(),e.createElementBlock("span",{key:0,textContent:e.toDisplayString(e.unref(a).current.text),class:e.normalizeClass([e.unref(a).current.type?{}:{["text-"+e.unref(a).current.type]:!0},"overflow-hidden text-no-wrap"]),style:{"text-overflow":"ellipsis"}},null,10,C)):e.createCommentVNode("",!0),e.unref(a).current&&e.unref(a).current.actions?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(Object.entries(e.unref(a).current.actions),(c,V)=>(e.openBlock(),e.createBlock(e.unref(i.VBtn),{text:c[0],onClick:c[1],key:V,density:"comfortable",variant:"tonal",class:"mx-2 px-2 text-none",color:e.unref(a).current.type},null,8,["text","onClick","color"]))),128)):e.createCommentVNode("",!0),m[2]||(m[2]=e.createElementVNode("div",{class:"me-auto"},null,-1)),e.renderSlot(p.$slots,"footer")]),_:3,__:[2]})]),_:3})):e.createCommentVNode("",!0),e.unref(h).drawer?(e.openBlock(),e.createBlock(e.unref(i.VNavigationDrawer),{key:2,modelValue:l.value,"onUpdate:modelValue":m[1]||(m[1]=c=>l.value=c),width:"250","rail-width":"58",rail:n.value,mobile:n.value?!1:void 0},{default:e.withCtx(()=>[e.createVNode(e.unref(i.VList),{class:"h-100 d-flex flex-column",nav:""},{default:e.withCtx(()=>[e.renderSlot(p.$slots,"drawer"),m[3]||(m[3]=e.createElementVNode("div",{class:"flex-grow-1"},null,-1)),e.createVNode(e.unref(i.VBtn),{onClick:m[0]||(m[0]=c=>n.value=!n.value),icon:"mdi-pin-outline",rounded:"rounded",density:"comfortable",title:n.value?"Undock sidebar":"Dock sidebar",class:"ma-1 ms-auto",variant:n.value?"tonal":"text"},null,8,["title","variant"])]),_:3,__:[3]})]),_:3},8,["modelValue","rail","mobile"])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(f).messages,(c,V)=>(e.openBlock(),e.createBlock(e.unref(i.VSnackbar),{key:V,"model-value":!0,text:c.text,color:c.type,location:"bottom end",style:e.normalizeStyle({bottom:`${V*56}px`}),timeout:-1},{actions:e.withCtx(()=>[e.createVNode(e.unref(i.VBtn),{icon:"mdi-close",onClick:U=>e.unref(f).remove(c.id)},null,8,["onClick"])]),_:2},1032,["text","color","style"]))),128))]),_:3},8,["theme"]))}}),N=e.defineComponent({__name:"DashboardPage",props:{breadcrumbs:{},fluid:{type:Boolean,default:!0}},setup(r){return(o,l)=>(e.openBlock(),e.createBlock(e.unref(i.VContainer),{fluid:o.fluid,class:"h-100 d-flex flex-column py-0 h-100"},{default:e.withCtx(()=>[o.breadcrumbs?(e.openBlock(),e.createBlock(e.unref(i.VBreadcrumbs),{key:0,items:o.breadcrumbs,density:"comfortable",class:"pa-0 flex-wrap"},null,8,["items"])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"default")]),_:3},8,["fluid"]))}}),S=(r,o)=>{const l=r.__vccOpts||r;for(const[n,a]of o)l[n]=a;return l},M={},T={class:"h-100 d-flex align-center"};function _(r,o){return e.openBlock(),e.createElementBlock(e.Fragment,null,[o[0]||(o[0]=e.createElementVNode("span",{class:"border-s mx-3",style:{height:"32px"}},null,-1)),e.createElementVNode("span",T,[e.renderSlot(r.$slots,"default")])],64)}const $=S(M,[["render",_]]),F=e.defineComponent({__name:"LoginForm",props:e.mergeModels({title:{default:"Log in"},submitButtonText:{default:"Log in"},minWidth:{},maxWidth:{},loading:{type:Boolean},usernameLabel:{default:"Username"},passwordLabel:{default:"Password"}},{username:{default:""},usernameModifiers:{},password:{default:""},passwordModifiers:{}}),emits:e.mergeModels(["submit"],["update:username","update:password"]),setup(r,{emit:o}){const l=e.useModel(r,"username"),n=e.useModel(r,"password"),a=o,u=e.ref(!1);return(d,f)=>(e.openBlock(),e.createBlock(e.unref(i.VCard),{title:d.title,"min-width":d.minWidth,"max-width":d.maxWidth},{default:e.withCtx(()=>[e.createVNode(e.unref(i.VForm),{onSubmit:f[2]||(f[2]=e.withModifiers(t=>a("submit",l.value,n.value),["prevent"])),modelValue:u.value,"onUpdate:modelValue":f[3]||(f[3]=t=>u.value=t)},{default:e.withCtx(()=>[e.createVNode(e.unref(i.VCardText),{class:"d-flex flex-column"},{default:e.withCtx(()=>[e.createVNode(e.unref(i.VTextField),{modelValue:l.value,"onUpdate:modelValue":f[0]||(f[0]=t=>l.value=t),label:d.usernameLabel,rules:[t=>!!t||"Username is required"],"persistent-placeholder":"",autofocus:""},null,8,["modelValue","label","rules"]),e.createVNode(e.unref(i.VTextField),{modelValue:n.value,"onUpdate:modelValue":f[1]||(f[1]=t=>n.value=t),label:d.passwordLabel,type:"password",rules:[t=>!!t||"Password is required"],"persistent-placeholder":""},null,8,["modelValue","label","rules"]),e.createVNode(e.unref(i.VBtn),{disabled:!u.value,type:"submit",color:"primary",variant:"flat",text:d.submitButtonText,loading:d.loading,class:"align-self-center"},null,8,["disabled","text","loading"]),e.renderSlot(d.$slots,"beneath")]),_:3})]),_:3},8,["modelValue"])]),_:3},8,["title","min-width","max-width"]))}}),L={class:"text-no-wrap overflow-hidden"},O=e.defineComponent({__name:"NavDrawerLink",props:{to:{},href:{},target:{},icon:{},text:{}},setup(r){return(o,l)=>(e.openBlock(),e.createBlock(e.unref(i.VListItem),{role:"option",to:o.to,href:o.href,target:o.target,slim:""},{prepend:e.withCtx(()=>[e.createVNode(e.unref(i.VIcon),{icon:o.icon},null,8,["icon"])]),default:e.withCtx(()=>[e.createElementVNode("span",L,e.toDisplayString(o.text),1)]),_:1},8,["to","href","target"]))}}),E=e.defineComponent({__name:"OTPForm",props:e.mergeModels({title:{default:"2FA Verification"},subtitle:{default:"Enter the code from your authenticator app"},submitButtonText:{default:"Verify"},minWidth:{},maxWidth:{},loading:{type:Boolean},length:{default:6},autosubmit:{type:Boolean,default:!0}},{otp:{default:""},otpModifiers:{}}),emits:e.mergeModels(["submit"],["update:otp"]),setup(r,{emit:o}){const l=e.useModel(r,"otp"),n=o,a=r,u=e.computed(()=>l.value.length===a.length);return e.watch(l,()=>{a.autosubmit&&l.value.length===a.length&&n("submit",l.value)}),(d,f)=>(e.openBlock(),e.createBlock(e.unref(i.VCard),{title:d.title,subtitle:d.subtitle,"min-width":d.minWidth,"max-width":d.maxWidth},{default:e.withCtx(()=>[e.createVNode(e.unref(i.VForm),{onSubmit:f[1]||(f[1]=e.withModifiers(t=>n("submit",l.value),["prevent"])),"model-value":u.value},{default:e.withCtx(()=>[e.createVNode(e.unref(i.VCardText),{class:"d-flex flex-column"},{default:e.withCtx(()=>[e.createVNode(e.unref(i.VOtpInput),{modelValue:l.value,"onUpdate:modelValue":f[0]||(f[0]=t=>l.value=t),label:"OTP","persistent-placeholder":"",autofocus:"",length:d.length},null,8,["modelValue","length"]),e.createVNode(e.unref(i.VBtn),{disabled:!u.value,type:"submit",color:"primary",variant:"flat",text:d.submitButtonText,loading:d.loading,class:"align-self-center"},null,8,["disabled","text","loading"]),e.renderSlot(d.$slots,"beneath")]),_:3})]),_:3},8,["model-value"])]),_:3},8,["title","subtitle","min-width","max-width"]))}});function D(r){return!r||r.length===0?{}:{filter:JSON.stringify(r)}}const P=Object.freeze(Object.defineProperty({__proto__:null,asParams:D},Symbol.toStringTag,{value:"Module"}));s.AppBase=x,s.DashboardPage=N,s.FooterSection=$,s.LoginForm=F,s.NavDrawerLink=O,s.OTPForm=E,s.filters=P,s.useColorMode=g,s.useFooter=y,s.useNotify=k,Object.defineProperty(s,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "appsalutely",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
"build": "vite build && vue-tsc",
|
|
19
19
|
"type-check": "vue-tsc --build",
|
|
20
20
|
"lint": "eslint . --fix",
|
|
21
|
-
"format": "prettier --write src/"
|
|
21
|
+
"format": "prettier --write src/",
|
|
22
|
+
"ci-tasks": "npm run lint && npm run format && npm run type-check"
|
|
22
23
|
},
|
|
23
24
|
"peerDependencies": {
|
|
24
25
|
"pinia": "^3.0.2",
|