vuesp-components 1.3.0 → 1.3.1
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/components/ui/drag-drop/VDragDrop.vue.d.ts +5 -5
- package/dist/components/ui/drag-drop/VDragDrop.vue.d.ts.map +1 -1
- package/dist/components/ui/drag-drop/types.d.ts +2 -2
- package/dist/components/ui/drag-drop/types.d.ts.map +1 -1
- package/dist/components/ui/func/VFunc.vue.d.ts.map +1 -1
- package/dist/composables/types.d.ts +8 -8
- package/dist/composables/types.d.ts.map +1 -1
- package/dist/helpers/index.d.ts +0 -2
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/helpers/index.es.js +50 -50
- package/dist/index.es.js +994 -962
- package/package.json +1 -1
- package/dist/helpers/fetch.d.ts +0 -14
- package/dist/helpers/fetch.d.ts.map +0 -1
- package/dist/helpers/utils.d.ts +0 -2
- package/dist/helpers/utils.d.ts.map +0 -1
- package/dist/utils-DxCyEA-K.js +0 -62
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { IVDragDropProps
|
|
1
|
+
import { IVDragDropProps } from './types';
|
|
2
2
|
declare function __VLS_template(): {
|
|
3
3
|
attrs: Partial<{}>;
|
|
4
4
|
slots: {
|
|
5
5
|
default?(_: {
|
|
6
|
-
item:
|
|
7
|
-
key:
|
|
6
|
+
item: any;
|
|
7
|
+
key: any;
|
|
8
8
|
index: number;
|
|
9
9
|
isDragging: boolean;
|
|
10
10
|
}): any;
|
|
@@ -14,7 +14,7 @@ declare function __VLS_template(): {
|
|
|
14
14
|
};
|
|
15
15
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
16
16
|
declare const __VLS_component: import('vue').DefineComponent<IVDragDropProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
17
|
-
"update:items": (items:
|
|
17
|
+
"update:items": (items: any[]) => any;
|
|
18
18
|
"order-change": (payload: {
|
|
19
19
|
fromIndex: number;
|
|
20
20
|
toIndex: number;
|
|
@@ -22,7 +22,7 @@ declare const __VLS_component: import('vue').DefineComponent<IVDragDropProps, {}
|
|
|
22
22
|
newOrder: unknown[];
|
|
23
23
|
}) => any;
|
|
24
24
|
}, string, import('vue').PublicProps, Readonly<IVDragDropProps & {
|
|
25
|
-
"onUpdate:items"?: ((items:
|
|
25
|
+
"onUpdate:items"?: ((items: any[]) => any) | undefined;
|
|
26
26
|
"onOrder-change"?: ((payload: {
|
|
27
27
|
fromIndex: number;
|
|
28
28
|
toIndex: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VDragDrop.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/drag-drop/VDragDrop.vue"],"names":[],"mappings":"AA6BA;AAmFA,OAAO,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"VDragDrop.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/drag-drop/VDragDrop.vue"],"names":[],"mappings":"AA6BA;AAmFA,OAAO,EAAE,eAAe,EAAmC,MAAM,iCAAiC,CAAC;AAwDnG,iBAAS,cAAc;WAyET,OAAO,IAA6B;;;;;;;YAVrB,GAAG;;;;EAe/B;AAgBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;6EAQnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAQpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -2,11 +2,11 @@ export interface IVDragDropItem {
|
|
|
2
2
|
id: number;
|
|
3
3
|
}
|
|
4
4
|
export interface IVDragDropProps {
|
|
5
|
-
items:
|
|
5
|
+
items: any[];
|
|
6
6
|
itemKey?: 'id';
|
|
7
7
|
}
|
|
8
8
|
export interface IVDragDropEmits {
|
|
9
|
-
(e: 'update:items', items:
|
|
9
|
+
(e: 'update:items', items: any[]): void;
|
|
10
10
|
(e: 'order-change', payload: {
|
|
11
11
|
fromIndex: number;
|
|
12
12
|
toIndex: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/drag-drop/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/drag-drop/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,GAAG,EAAE,CAAC;IACb,OAAO,CAAC,EAAE,IAAI,CAAC;CAChB;AACD,MAAM,WAAW,eAAe;IAC9B,CAAC,CAAC,EAAE,cAAc,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;IACxC,CAAC,CAAC,EAAE,cAAc,EAAE,OAAO,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,OAAO,CAAC;QAAC,QAAQ,EAAE,OAAO,EAAE,CAAA;KAAE,GAAG,IAAI,CAAC;CACrH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VFunc.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/func/VFunc.vue"],"names":[],"mappings":"AAuBA;
|
|
1
|
+
{"version":3,"file":"VFunc.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/func/VFunc.vue"],"names":[],"mappings":"AAuBA;AAqEA,OAAO,KAAK,EAAE,WAAW,EAAe,MAAM,4BAA4B,CAAC;;;;;;;;;;;;AAqL3E,wBASG"}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { Ref, ComputedRef } from 'vue';
|
|
2
|
-
export type Validator = (value:
|
|
2
|
+
export type Validator = (value: string, values?: Record<string, any>) => true | string;
|
|
3
3
|
export type ValidationSchema = Record<string, Validator[]>;
|
|
4
4
|
export interface FieldState {
|
|
5
|
-
value:
|
|
5
|
+
value: string | number;
|
|
6
6
|
errors: string[];
|
|
7
7
|
touched: boolean;
|
|
8
8
|
dirty: boolean;
|
|
9
9
|
}
|
|
10
10
|
export interface FormState {
|
|
11
|
-
values: Record<string,
|
|
11
|
+
values: Record<string, any>;
|
|
12
12
|
errors: Record<string, string[]>;
|
|
13
13
|
touched: Record<string, boolean>;
|
|
14
14
|
dirty: Record<string, boolean>;
|
|
15
15
|
}
|
|
16
16
|
export interface DefineFieldOptions {
|
|
17
|
-
props?: (context: FieldContext) => Record<string,
|
|
17
|
+
props?: (context: FieldContext) => Record<string, any>;
|
|
18
18
|
}
|
|
19
19
|
export interface FieldContext {
|
|
20
20
|
errors: string[];
|
|
@@ -23,13 +23,13 @@ export interface FieldContext {
|
|
|
23
23
|
}
|
|
24
24
|
export interface UseFormOptions {
|
|
25
25
|
validationSchema: ValidationSchema;
|
|
26
|
-
initialValues?: Record<string,
|
|
26
|
+
initialValues?: Record<string, any>;
|
|
27
27
|
}
|
|
28
28
|
export interface UseFormReturn {
|
|
29
|
-
values: Record<string,
|
|
29
|
+
values: Record<string, any>;
|
|
30
30
|
errors: Record<string, string[]>;
|
|
31
|
-
defineField: <T =
|
|
32
|
-
handleSubmit: (callback: (values: Record<string,
|
|
31
|
+
defineField: <T = any>(name: string, options?: DefineFieldOptions) => [Ref<T>, ComputedRef<Record<string, any>>];
|
|
32
|
+
handleSubmit: (callback: (values: Record<string, any>) => void | Promise<void>) => (event?: Event) => Promise<void>;
|
|
33
33
|
resetForm: () => void;
|
|
34
34
|
validate: () => boolean;
|
|
35
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/composables/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,KAAK,CAAC;AAE5C,MAAM,MAAM,SAAS,GAAG,CAAC,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/composables/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,KAAK,CAAC;AAE5C,MAAM,MAAM,SAAS,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,GAAG,MAAM,CAAC;AACvF,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;AAE3D,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC5B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACjC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACxD;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,cAAc;IAC7B,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACrC;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC5B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACjC,WAAW,EAAE,CAAC,CAAC,GAAG,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,kBAAkB,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;IACjH,YAAY,EAAE,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,KAAK,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACpH,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,QAAQ,EAAE,MAAM,OAAO,CAAC;CACzB"}
|
package/dist/helpers/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC"}
|
package/dist/helpers/index.es.js
CHANGED
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
|
|
2
|
-
const s = async (t) => {
|
|
1
|
+
const c = (t) => {
|
|
3
2
|
try {
|
|
4
|
-
|
|
5
|
-
return e.ok ? await e.json() : null;
|
|
3
|
+
return t ? JSON.parse(t) : null;
|
|
6
4
|
} catch (e) {
|
|
7
|
-
return console.
|
|
5
|
+
return console.warn(e), t;
|
|
8
6
|
}
|
|
9
|
-
},
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const n =
|
|
22
|
-
|
|
7
|
+
}, s = (t) => typeof t == "object" ? JSON.stringify(t) : t, h = (t) => c(s(t)), g = (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("."), M = (t) => t.split(".").map((e) => +e), y = (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) => c(t.getItem(e)), a = (t) => (e, o) => {
|
|
22
|
+
t && t.setItem(e, s(o));
|
|
23
|
+
}, u = i(localStorage), l = a(localStorage), E = i(sessionStorage), L = a(sessionStorage), $ = (t = "isShow") => {
|
|
24
|
+
const e = u(t);
|
|
25
|
+
return e || l(t, !0), !e;
|
|
26
|
+
}, j = (t) => {
|
|
27
|
+
l("theme", t), document.documentElement.classList.remove("dark"), document.documentElement.classList.remove("light"), document.documentElement.classList.add(t);
|
|
23
28
|
}, d = (t, e) => {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
return
|
|
29
|
-
};
|
|
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);
|
|
30
35
|
export {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
J as timeUtcToString,
|
|
52
|
-
L as toByte,
|
|
53
|
-
d as uploadBinary,
|
|
54
|
-
i as uploadJson,
|
|
55
|
-
a as useFetch
|
|
36
|
+
r as addZero,
|
|
37
|
+
w as arrToStr,
|
|
38
|
+
j as changeTheme,
|
|
39
|
+
h as clone,
|
|
40
|
+
y 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
|
+
l as localSet,
|
|
50
|
+
p as secToTime,
|
|
51
|
+
E as sessionGet,
|
|
52
|
+
L as sessionSet,
|
|
53
|
+
M as strToArr,
|
|
54
|
+
S as timeUtcToString,
|
|
55
|
+
g as toByte
|
|
56
56
|
};
|