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.
@@ -1,10 +1,10 @@
1
- import { IVDragDropProps, IVDragDropItem } from './types';
1
+ import { IVDragDropProps } from './types';
2
2
  declare function __VLS_template(): {
3
3
  attrs: Partial<{}>;
4
4
  slots: {
5
5
  default?(_: {
6
- item: IVDragDropItem;
7
- key: number;
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: IVDragDropItem[]) => any;
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: IVDragDropItem[]) => any) | undefined;
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,EAAmB,cAAc,EAAE,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"}
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: IVDragDropItem[];
5
+ items: any[];
6
6
  itemKey?: 'id';
7
7
  }
8
8
  export interface IVDragDropEmits {
9
- (e: 'update:items', items: IVDragDropItem[]): void;
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,cAAc,EAAE,CAAC;IACxB,OAAO,CAAC,EAAE,IAAI,CAAC;CAChB;AACD,MAAM,WAAW,eAAe;IAC9B,CAAC,CAAC,EAAE,cAAc,EAAE,KAAK,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC;IACnD,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
+ {"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;AAsEA,OAAO,KAAK,EAAE,WAAW,EAAe,MAAM,4BAA4B,CAAC;;;;;;;;;;;;AAsL3E,wBASG"}
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: unknown, values?: Record<string, unknown>) => true | string;
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: unknown;
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, unknown>;
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, unknown>;
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, unknown>;
26
+ initialValues?: Record<string, any>;
27
27
  }
28
28
  export interface UseFormReturn {
29
- values: Record<string, unknown>;
29
+ values: Record<string, any>;
30
30
  errors: Record<string, string[]>;
31
- defineField: <T = unknown>(name: string, options?: DefineFieldOptions) => [Ref<T>, ComputedRef<Record<string, unknown>>];
32
- handleSubmit: (callback: (values: Record<string, unknown>) => void | Promise<void>) => (event?: Event) => Promise<void>;
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 @@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app';
2
- export * from './fetch';
3
2
  export * from './general';
4
3
  export * from './web-api';
5
- export * from './utils';
6
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,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"}
@@ -1,56 +1,56 @@
1
- import { k as h, l as p, b as f, c as m, n as T, d as y, a as g, f as w, g as S, i as b, j as E, e as P, o as $, p as j, q as B, s as D, r as F, u as U, m as k, t as J, h as L } from "../utils-DxCyEA-K.js";
2
- const s = async (t) => {
1
+ const c = (t) => {
3
2
  try {
4
- const e = await t;
5
- return e.ok ? await e.json() : null;
3
+ return t ? JSON.parse(t) : null;
6
4
  } catch (e) {
7
- return console.error(e), null;
5
+ return console.warn(e), t;
8
6
  }
9
- }, a = {
10
- get: (t, e) => fetch(t, e),
11
- post: (t, e) => fetch(t, { method: "POST", ...e }),
12
- put: (t, e) => fetch(t, { method: "PUT", ...e }),
13
- delete: (t, e) => fetch(t, { method: "DELETE", ...e }),
14
- $get: (t, e) => s(fetch(t, e)),
15
- $post: (t, e) => s(fetch(t, { method: "POST", ...e })),
16
- $put: (t, e) => s(fetch(t, { method: "PUT", ...e })),
17
- $delete: (t, e) => s(fetch(t, { method: "DELETE", ...e }))
18
- }, c = async (t) => {
19
- const { body: e, status: o } = await a.get(t);
20
- if (!e) return [];
21
- const n = await e.getReader().read(), r = n.value ? Array.from(n.value) : [];
22
- return o === 200 ? r : [];
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
- const o = new FormData();
25
- return o.append("file[0]", new Blob([e], { type: "octet/stream" }), t), a.$post("/fs", { body: o });
26
- }, i = (t, e) => {
27
- const o = new FormData();
28
- return o.append("file[0]", new Blob([JSON.stringify(e)], { type: "application/json" }), t), a.$post("/fs", { body: o });
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
- h as addZero,
32
- p as arrToStr,
33
- f as changeTheme,
34
- m as clone,
35
- T as createDownloadLink,
36
- y as dateUtcToString,
37
- g as debounce,
38
- c as downloadBinary,
39
- w as findMenuItem,
40
- S as getPageTitle,
41
- b as isNewVersion,
42
- E as jsonParse,
43
- P as jsonString,
44
- $ as loadScript,
45
- j as localGet,
46
- B as localSet,
47
- D as secToTime,
48
- F as sessionGet,
49
- U as sessionSet,
50
- k as strToArr,
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
  };