vuesp-components 2.0.9 → 2.1.0
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/App.vue.d.ts +1 -1
- package/dist/App.vue.d.ts.map +1 -1
- package/dist/components/dashboard/cards/CardBase.vue.d.ts +28 -0
- package/dist/components/dashboard/cards/CardBase.vue.d.ts.map +1 -1
- package/dist/components/dashboard/cards/CardButton.vue.d.ts +29 -1
- package/dist/components/dashboard/cards/CardButton.vue.d.ts.map +1 -1
- package/dist/components/dashboard/cards/CardDate.vue.d.ts +29 -1
- package/dist/components/dashboard/cards/CardDate.vue.d.ts.map +1 -1
- package/dist/components/dashboard/cards/CardDimmer.vue.d.ts +29 -1
- package/dist/components/dashboard/cards/CardDimmer.vue.d.ts.map +1 -1
- package/dist/components/dashboard/cards/CardInfo.vue.d.ts +14 -0
- package/dist/components/dashboard/cards/CardInfo.vue.d.ts.map +1 -1
- package/dist/components/dashboard/cards/CardInput.vue.d.ts +29 -1
- package/dist/components/dashboard/cards/CardInput.vue.d.ts.map +1 -1
- package/dist/components/dashboard/cards/CardList.vue.d.ts +29 -1
- package/dist/components/dashboard/cards/CardList.vue.d.ts.map +1 -1
- package/dist/components/dashboard/edit/ItemEdit.vue.d.ts +3 -0
- package/dist/components/dashboard/edit/ItemEdit.vue.d.ts.map +1 -1
- package/dist/components/dashboard/edit/types.d.ts +2 -0
- package/dist/components/dashboard/edit/types.d.ts.map +1 -1
- package/dist/components/ui/dialog/VDialog.vue.d.ts +7 -2
- package/dist/components/ui/dialog/VDialog.vue.d.ts.map +1 -1
- package/dist/components/ui/dialog/VPopup.vue.d.ts +4 -1
- package/dist/components/ui/dialog/VPopup.vue.d.ts.map +1 -1
- package/dist/components/ui/dropdown/VDropdown.vue.d.ts.map +1 -1
- package/dist/components/ui/dropdown/types.d.ts +2 -0
- package/dist/components/ui/dropdown/types.d.ts.map +1 -1
- package/dist/components/ui/list/VList.vue.d.ts.map +1 -1
- package/dist/components/ui/select/VSelect.vue.d.ts.map +1 -1
- package/dist/components/ui/select/types.d.ts +2 -1
- package/dist/components/ui/select/types.d.ts.map +1 -1
- package/dist/composables/index.es.js +115 -108
- package/dist/dashboard/index.d.ts +1 -0
- package/dist/dashboard/index.d.ts.map +1 -1
- package/dist/dashboard/index.es.js +39 -32
- package/dist/helpers/index.es.js +56 -46
- package/dist/index.es.js +2630 -2281
- package/dist/plugins/index.es.js +59 -57
- package/dist/style.css +1 -0
- package/dist/useSwipeDown-E8KeNvRa.js +436 -0
- package/package.json +3 -3
- package/dist/dashboard/lists.d.ts +0 -4
- package/dist/dashboard/lists.d.ts.map +0 -1
- package/dist/useDialog-Biu5-ZSJ.js +0 -396
- package/dist/vuesp-components.css +0 -2
|
@@ -1,109 +1,116 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
function
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
1
|
+
import { ref as z, reactive as y, watch as B, computed as k } from "vue";
|
|
2
|
+
import { u as R, a as W } from "../useSwipeDown-E8KeNvRa.js";
|
|
3
|
+
function I(w) {
|
|
4
|
+
const { validationSchema: l, initialValues: m = {} } = w, d = typeof l == "function", v = z(
|
|
5
|
+
d ? l(m) : l
|
|
6
|
+
), F = (t) => {
|
|
7
|
+
v.value = t;
|
|
8
|
+
const e = Object.keys(t), o = Object.keys(c);
|
|
9
|
+
e.forEach((s) => {
|
|
10
|
+
s in c || (c[s] = m[s] ?? "", a[s] = [], u[s] = !1, h[s] = !1);
|
|
11
|
+
}), o.forEach((s) => {
|
|
12
|
+
e.includes(s) || (delete c[s], delete a[s], delete u[s], delete h[s]);
|
|
13
|
+
}), E();
|
|
14
|
+
}, c = y({}), a = y({}), u = y({}), h = y({}), f = /* @__PURE__ */ new Map(), D = () => {
|
|
15
|
+
Object.keys(v.value).forEach((t) => {
|
|
16
|
+
c[t] = m[t] ?? "", a[t] = [], u[t] = !1, h[t] = !1;
|
|
17
|
+
});
|
|
18
|
+
}, i = () => d ? l(c) : v.value, g = (t, e) => {
|
|
19
|
+
const s = i()[t] || [], n = [];
|
|
20
|
+
for (const r of s) {
|
|
21
|
+
const p = r(e, c);
|
|
22
|
+
p !== !0 && n.push(p);
|
|
23
|
+
}
|
|
24
|
+
return a[t] = n, n.length === 0;
|
|
25
|
+
}, S = (t, e) => {
|
|
26
|
+
const o = i();
|
|
27
|
+
if (!o[t]) return;
|
|
28
|
+
g(t, e);
|
|
29
|
+
const s = f.get(t);
|
|
30
|
+
s && s.forEach((n) => {
|
|
31
|
+
o[n] && g(n, c[n]);
|
|
32
|
+
});
|
|
33
|
+
}, E = () => {
|
|
34
|
+
f.clear();
|
|
35
|
+
const t = i();
|
|
36
|
+
Object.keys(t).forEach((e) => {
|
|
37
|
+
(t[e] || []).forEach((s) => {
|
|
38
|
+
if (typeof s == "function" && s.name === "sameAs") {
|
|
39
|
+
const n = s.toString().match(/['"](.*?)['"]/);
|
|
40
|
+
if (n) {
|
|
41
|
+
const r = n[1];
|
|
42
|
+
f.has(r) || f.set(r, /* @__PURE__ */ new Set()), f.get(r).add(e);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
}, O = () => {
|
|
48
|
+
const t = i();
|
|
49
|
+
let e = !0;
|
|
50
|
+
return Object.keys(t).forEach((o) => {
|
|
51
|
+
g(o, c[o]) || (e = !1);
|
|
52
|
+
}), e;
|
|
53
|
+
}, V = (t, e = {}) => {
|
|
54
|
+
i()[t] || console.warn(`Field "${t}" not found in current validationSchema`);
|
|
55
|
+
const s = k({
|
|
56
|
+
get: () => c[t],
|
|
57
|
+
set: (r) => {
|
|
58
|
+
c[t] = r, h[t] = !0, S(t, r);
|
|
59
|
+
}
|
|
60
|
+
}), n = k(() => {
|
|
61
|
+
var j;
|
|
62
|
+
const r = {
|
|
63
|
+
errors: a[t] || [],
|
|
64
|
+
touched: u[t] || !1,
|
|
65
|
+
dirty: h[t] || !1
|
|
66
|
+
}, p = {
|
|
67
|
+
message: (j = a[t]) == null ? void 0 : j[0],
|
|
68
|
+
onInput: (b) => {
|
|
69
|
+
const K = b.target;
|
|
70
|
+
s.value = K.value;
|
|
71
|
+
},
|
|
72
|
+
onBlur: () => {
|
|
73
|
+
u[t] = !0, S(t, c[t]);
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
if (e.props) {
|
|
77
|
+
const b = e.props(r);
|
|
78
|
+
return { ...p, ...b };
|
|
79
|
+
}
|
|
80
|
+
return p;
|
|
81
|
+
});
|
|
82
|
+
return [s, n];
|
|
83
|
+
}, x = (t) => async (e) => {
|
|
84
|
+
e && e.preventDefault();
|
|
85
|
+
const o = i();
|
|
86
|
+
Object.keys(o).forEach((n) => {
|
|
87
|
+
u[n] = !0;
|
|
88
|
+
}), O() && await t(c);
|
|
89
|
+
}, A = () => {
|
|
90
|
+
const t = i();
|
|
91
|
+
Object.keys(t).forEach((e) => {
|
|
92
|
+
c[e] = m[e] || "", a[e] = [], u[e] = !1, h[e] = !1;
|
|
93
|
+
});
|
|
94
|
+
};
|
|
95
|
+
return D(), E(), d && B(
|
|
96
|
+
() => c,
|
|
97
|
+
() => {
|
|
98
|
+
const t = l(c), e = v.value, o = Object.keys(t), s = Object.keys(e);
|
|
99
|
+
(o.length !== s.length || o.some((n) => !s.includes(n))) && F(t);
|
|
100
|
+
},
|
|
101
|
+
{ deep: !0 }
|
|
102
|
+
), {
|
|
103
|
+
values: c,
|
|
104
|
+
errors: a,
|
|
105
|
+
defineField: V,
|
|
106
|
+
handleSubmit: x,
|
|
107
|
+
resetForm: A,
|
|
108
|
+
validate: O,
|
|
109
|
+
updateSchema: F
|
|
110
|
+
};
|
|
107
111
|
}
|
|
108
|
-
|
|
109
|
-
|
|
112
|
+
export {
|
|
113
|
+
R as useDialog,
|
|
114
|
+
I as useForm,
|
|
115
|
+
W as useSwipeDown
|
|
116
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { TypeGetDataValue, TypeGetParamsData, IDashboardItem, GetTypeByPath } from '../types/types';
|
|
2
|
+
export declare const dashboardCards: string[];
|
|
2
3
|
export declare const getDataValue: TypeGetDataValue;
|
|
3
4
|
export declare const getParamsData: TypeGetParamsData;
|
|
4
5
|
export declare const getFunction: (body: string | undefined) => Function | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/dashboard/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAExG,eAAO,MAAM,YAAY,EAAE,gBAY1B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,iBAE3B,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,MAAM,MAAM,GAAG,SAAS,oBAInD,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,CAAC,EAAE,MAAM,cAAc,EAAE,OAAO,OAAO,EAAE,QAAQ,CAAC,QAU9E,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,CAAC,EAAE,MAAM,cAAc,EAAE,QAAQ,CAAC;;;;;;;;;;;;CAkB9D,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/dashboard/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAExG,eAAO,MAAM,cAAc,UAAwD,CAAC;AAEpF,eAAO,MAAM,YAAY,EAAE,gBAY1B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,iBAE3B,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,MAAM,MAAM,GAAG,SAAS,oBAInD,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,CAAC,EAAE,MAAM,cAAc,EAAE,OAAO,OAAO,EAAE,QAAQ,CAAC,QAU9E,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,CAAC,EAAE,MAAM,cAAc,EAAE,QAAQ,CAAC;;;;;;;;;;;;CAkB9D,CAAC"}
|
|
@@ -1,33 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
1
|
+
const v = ["button", "info", "dimmer", "date", "input", "list"], p = (t, r) => {
|
|
2
|
+
const c = t.split(".");
|
|
3
|
+
let n = r;
|
|
4
|
+
for (const e of c)
|
|
5
|
+
if (n !== null && typeof n == "object" && e in n)
|
|
6
|
+
n = n[e];
|
|
7
|
+
else
|
|
8
|
+
return;
|
|
9
|
+
return n;
|
|
10
|
+
}, f = ({ args: t }, r) => t.map((c) => p(c, r)), u = (t) => t ? (t = t.includes("return") ? t : `return ${t}`, new Function("v", "a", "b", "c", t)) : null, F = (t, r, c) => {
|
|
11
|
+
const [, ...n] = f(t, c);
|
|
12
|
+
let e = null;
|
|
13
|
+
try {
|
|
14
|
+
const o = u(t.set);
|
|
15
|
+
o && (e = o(r, ...n));
|
|
16
|
+
} catch (o) {
|
|
17
|
+
console.warn(o);
|
|
18
|
+
}
|
|
19
|
+
return e;
|
|
20
|
+
}, d = (t, r) => {
|
|
21
|
+
const c = f(t, r), [n, e, o, l] = c;
|
|
22
|
+
let s = n ?? "", i = s;
|
|
23
|
+
try {
|
|
24
|
+
const a = u(t.get);
|
|
25
|
+
a && (s = a(s, e, o, l));
|
|
26
|
+
const g = u(t.getTo);
|
|
27
|
+
g && (i = g(s, e, o, l));
|
|
28
|
+
} catch (a) {
|
|
29
|
+
console.warn(a);
|
|
30
|
+
}
|
|
31
|
+
return { ...t, value: s, valueTo: i };
|
|
32
|
+
};
|
|
33
|
+
export {
|
|
34
|
+
v as dashboardCards,
|
|
35
|
+
p as getDataValue,
|
|
36
|
+
u as getFunction,
|
|
37
|
+
f as getParamsData,
|
|
38
|
+
d as getStateItem,
|
|
39
|
+
F as setStateItem
|
|
31
40
|
};
|
|
32
|
-
//#endregion
|
|
33
|
-
export { e as getDataValue, n as getFunction, t as getParamsData, i as getStateItem, r as setStateItem };
|
package/dist/helpers/index.es.js
CHANGED
|
@@ -1,46 +1,56 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
1
|
+
const c = (t) => {
|
|
2
|
+
try {
|
|
3
|
+
return t ? JSON.parse(t) : null;
|
|
4
|
+
} catch (e) {
|
|
5
|
+
return console.warn(e), t;
|
|
6
|
+
}
|
|
7
|
+
}, s = (t) => typeof t == "object" ? JSON.stringify(t) : t, g = (t) => c(s(t)), h = (t) => {
|
|
8
|
+
const e = ["B", "KB", "MB"];
|
|
9
|
+
if (t == 0) return "0 B";
|
|
10
|
+
let o = Math.floor(Math.log(t) / Math.log(1024));
|
|
11
|
+
return o > 1 && (o = 1), Math.round(t / Math.pow(1024, o)) + " " + e[o];
|
|
12
|
+
}, f = (t, e = { year: "numeric", month: "numeric", day: "numeric" }, o = []) => new Date(t).toLocaleDateString(o, e), S = (t, e = { minute: "2-digit", hour: "2-digit" }, o = []) => new Date(t).toLocaleTimeString(o, e), r = (t) => t >= 10 ? t : `0${t}`, p = (t) => {
|
|
13
|
+
const e = Math.floor(t % 31536e3 % 2628e3 / 86400), o = Math.floor(t % (3600 * 24) / 3600), n = Math.floor(t % 3600 / 60), m = Math.floor(t % 60);
|
|
14
|
+
return `${e ? e + " days " : ""} ${r(o)}:${r(n)}:${r(m)}`;
|
|
15
|
+
}, w = (t) => t.join("."), y = (t) => t.split(".").map((e) => +e), M = (t, e = "file") => {
|
|
16
|
+
const o = document.createElement("a");
|
|
17
|
+
o.setAttribute("download", e), o.href = t, document.body.appendChild(o), o.click(), o.remove();
|
|
18
|
+
}, T = (t) => new Promise((e, o) => {
|
|
19
|
+
const n = document.createElement("script");
|
|
20
|
+
n.src = t, n.type = "text/javascript", n.async = !0, n.onload = () => e(n), n.onerror = () => o(new Error(`Ошибка загрузки скрипта: ${t}`)), document.head.appendChild(n);
|
|
21
|
+
}), i = (t) => (e, o) => o ? c(t.getItem(e)) : t.getItem(e), l = (t) => (e, o) => {
|
|
22
|
+
t && t.setItem(e, typeof o == "string" ? o : s(o));
|
|
23
|
+
}, u = i(localStorage), a = l(localStorage), E = i(sessionStorage), L = l(sessionStorage), $ = (t = "isShow") => {
|
|
24
|
+
const e = u(t);
|
|
25
|
+
return e || a(t, "true"), !e;
|
|
26
|
+
}, j = (t) => {
|
|
27
|
+
a("theme", t), document.documentElement.classList.remove("dark"), document.documentElement.classList.remove("light"), document.documentElement.classList.add(t);
|
|
28
|
+
}, d = (t, e) => {
|
|
29
|
+
if (!t) return null;
|
|
30
|
+
for (const o of t)
|
|
31
|
+
if (!(e === "/" || o.path === "/") && (o.path === e || e.includes(o.path)))
|
|
32
|
+
return o;
|
|
33
|
+
return null;
|
|
34
|
+
}, B = (t, e) => d(t, e);
|
|
35
|
+
export {
|
|
36
|
+
r as addZero,
|
|
37
|
+
w as arrToStr,
|
|
38
|
+
j as changeTheme,
|
|
39
|
+
g as clone,
|
|
40
|
+
M as createDownloadLink,
|
|
41
|
+
f as dateUtcToString,
|
|
42
|
+
d as findMenuItem,
|
|
43
|
+
B as getPageTitle,
|
|
44
|
+
$ as isNewVersion,
|
|
45
|
+
c as jsonParse,
|
|
46
|
+
s as jsonString,
|
|
47
|
+
T as loadScript,
|
|
48
|
+
u as localGet,
|
|
49
|
+
a as localSet,
|
|
50
|
+
p as secToTime,
|
|
51
|
+
E as sessionGet,
|
|
52
|
+
L as sessionSet,
|
|
53
|
+
y as strToArr,
|
|
54
|
+
S as timeUtcToString,
|
|
55
|
+
h as toByte
|
|
56
|
+
};
|