mhz-helpers 1.1.0 → 1.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.
- package/dist/composables/useAuth.d.ts +1 -1
- package/dist/composables/usePage.d.ts +8 -21
- package/dist/helpers/api.d.ts +1 -1
- package/dist/helpers/api.spec.d.ts +1 -0
- package/dist/helpers/clone.spec.d.ts +1 -0
- package/dist/helpers/date.d.ts +14 -1
- package/dist/helpers/date.spec.d.ts +1 -0
- package/dist/helpers/id.d.ts +1 -4
- package/dist/helpers/id.spec.d.ts +1 -0
- package/dist/helpers/link.spec.d.ts +1 -0
- package/dist/helpers/numbers.d.ts +2 -1
- package/dist/helpers/numbers.spec.d.ts +1 -0
- package/dist/helpers/password.spec.d.ts +1 -0
- package/dist/helpers/query.spec.d.ts +1 -0
- package/dist/helpers/test.spec.d.ts +1 -0
- package/dist/index.js +476 -459
- package/package.json +7 -3
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export declare const isAuth: Readonly<import('vue').Ref<boolean, boolean>>;
|
|
2
2
|
export declare function setAuth(auth: boolean): void;
|
|
3
3
|
export declare function logout(url: string, deleteAuthHeader: () => void, tokenName: string): void;
|
|
4
|
-
export declare function setCookieToken(token: string, tokenName: string): void;
|
|
5
4
|
export declare function getCookieToken(tokenName: string): string | undefined;
|
|
5
|
+
export declare function setCookieToken(token: string, tokenName: string): void;
|
|
6
6
|
export declare function deleteCookieToken(tokenName: string): void;
|
|
7
7
|
export declare function useAuth(): {
|
|
8
8
|
auth: (token: string, setAuthHeader: (token: string) => void, tokenName: string) => void;
|
|
@@ -8,30 +8,17 @@ export interface IPageQuery {
|
|
|
8
8
|
sort: ISortOption;
|
|
9
9
|
filter: object;
|
|
10
10
|
}
|
|
11
|
-
export
|
|
11
|
+
export interface IPageParams {
|
|
12
12
|
page: number;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
page: number;
|
|
16
|
-
sort: string | undefined;
|
|
13
|
+
}
|
|
14
|
+
export interface IPageSortParams extends IPageParams {
|
|
17
15
|
dir: string;
|
|
18
|
-
|
|
16
|
+
sort?: string;
|
|
17
|
+
initiator?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare function convertParams(params: Ref<IPageQuery | number>, initiator?: string): IPageSortParams | IPageParams;
|
|
19
20
|
export declare function usePage(filter?: object): {
|
|
20
|
-
query: Ref<
|
|
21
|
-
page: number;
|
|
22
|
-
sort: {
|
|
23
|
-
value?: string | undefined;
|
|
24
|
-
isAsc: boolean;
|
|
25
|
-
};
|
|
26
|
-
filter: object;
|
|
27
|
-
}, IPageQuery | {
|
|
28
|
-
page: number;
|
|
29
|
-
sort: {
|
|
30
|
-
value?: string | undefined;
|
|
31
|
-
isAsc: boolean;
|
|
32
|
-
};
|
|
33
|
-
filter: object;
|
|
34
|
-
}>;
|
|
21
|
+
query: Ref<IPageQuery, IPageQuery>;
|
|
35
22
|
resetQuery: (value: string | ISortOption) => void;
|
|
36
23
|
setQueryPage: (pageToSet: number) => void;
|
|
37
24
|
setQueryFilter: (filterToSet?: object) => void;
|
package/dist/helpers/api.d.ts
CHANGED
|
@@ -2,4 +2,4 @@ export declare const api: import('axios').AxiosStatic;
|
|
|
2
2
|
export declare function setBaseURL(url: string): void;
|
|
3
3
|
export declare function setAuthHeader(token: string): void;
|
|
4
4
|
export declare function deleteAuthHeader(): void;
|
|
5
|
-
export declare function handleError(error: unknown):
|
|
5
|
+
export declare function handleError(error: unknown): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/helpers/date.d.ts
CHANGED
|
@@ -2,4 +2,17 @@ export declare function addZero(value: number): string;
|
|
|
2
2
|
export declare function formatDuration(duration?: number): string;
|
|
3
3
|
export declare function formatDate(dateRaw?: string | Date | null, lang?: 'ru' | 'en'): string;
|
|
4
4
|
export declare function formatDateTime(dateRaw?: string | Date | null, lang?: 'ru' | 'en'): string;
|
|
5
|
-
export declare function subtractDates(
|
|
5
|
+
export declare function subtractDates(dateBig?: string | Date | null, dateSmall?: string | Date | null, isRawResult?: boolean): string | number;
|
|
6
|
+
export interface IDatesGap {
|
|
7
|
+
dateFrom: Date;
|
|
8
|
+
dateTo: Date;
|
|
9
|
+
dateFromPrev: Date;
|
|
10
|
+
dateToPrev: Date;
|
|
11
|
+
}
|
|
12
|
+
export declare function getDatesByDayGap(gap: number): IDatesGap;
|
|
13
|
+
export interface IWeekDays {
|
|
14
|
+
dateFrom: Date;
|
|
15
|
+
dateTo: Date;
|
|
16
|
+
label: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function getFirstAndLastWeekDays(weeksCount: number): IWeekDays[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/helpers/id.d.ts
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
export declare function createTempId(): string;
|
|
2
2
|
export declare function deleteTempId<T extends {
|
|
3
3
|
_id?: string;
|
|
4
|
-
}>(array: T[]): T[];
|
|
5
|
-
export declare function deleteId<T extends {
|
|
6
|
-
_id?: string;
|
|
7
|
-
}>(array: T[]): T[];
|
|
4
|
+
}>(array: T[], isDeleteAllIds?: boolean): T[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export declare function formatPercent(percent: number): string;
|
|
1
|
+
export declare function formatPercent(percent: number | null): string;
|
|
2
|
+
export declare function getPercentDiff(cur: number, prev: number): number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|