@arex95/vue-core 1.0.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.
Files changed (44) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +2 -0
  3. package/dist/composables/axios/axiosFetch.d.ts +10 -0
  4. package/dist/composables/axios/createFetch.d.ts +10 -0
  5. package/dist/composables/axios/index.d.ts +3 -0
  6. package/dist/composables/axios/useVueQuery.d.ts +192 -0
  7. package/dist/composables/breakpoints/index.d.ts +1 -0
  8. package/dist/composables/breakpoints/useBreakpoint.d.ts +62 -0
  9. package/dist/composables/filters/index.d.ts +1 -0
  10. package/dist/composables/filters/useFilter.d.ts +16 -0
  11. package/dist/composables/index.d.ts +5 -0
  12. package/dist/composables/paginators/index.d.ts +1 -0
  13. package/dist/composables/paginators/usePaginator.d.ts +14 -0
  14. package/dist/composables/sorters/index.d.ts +1 -0
  15. package/dist/composables/sorters/useSorter.d.ts +14 -0
  16. package/dist/config/axios/axiosConfig.d.ts +47 -0
  17. package/dist/config/axios/index.d.ts +2 -0
  18. package/dist/config/index.d.ts +1 -0
  19. package/dist/constants/breakpointEnum.d.ts +31 -0
  20. package/dist/constants/exceptionEnum.d.ts +30 -0
  21. package/dist/constants/fileTypesEnum.d.ts +25 -0
  22. package/dist/constants/httpEnum.d.ts +21 -0
  23. package/dist/constants/index.d.ts +6 -0
  24. package/dist/constants/keyCodeEnum.d.ts +10 -0
  25. package/dist/constants/storageEnum.d.ts +50 -0
  26. package/dist/index.d.ts +6 -0
  27. package/dist/rest/RestStd.d.ts +70 -0
  28. package/dist/rest/index.d.ts +1 -0
  29. package/dist/types/AxiosOptionsParameter.d.ts +31 -0
  30. package/dist/types/ExtendedQueryOptions.d.ts +6 -0
  31. package/dist/types/index.d.ts +2 -0
  32. package/dist/utils/browser.d.ts +30 -0
  33. package/dist/utils/dates.d.ts +71 -0
  34. package/dist/utils/debounces.d.ts +57 -0
  35. package/dist/utils/exports.d.ts +34 -0
  36. package/dist/utils/files.d.ts +46 -0
  37. package/dist/utils/index.d.ts +9 -0
  38. package/dist/utils/io.d.ts +168 -0
  39. package/dist/utils/objects.d.ts +109 -0
  40. package/dist/utils/strings.d.ts +63 -0
  41. package/dist/utils/validations.d.ts +114 -0
  42. package/dist/vue-core.cjs.js +2118 -0
  43. package/dist/vue-core.esm.js +1993 -0
  44. package/package.json +45 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 arexdev
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,2 @@
1
+ # npm-arex-core
2
+ arex core npm distribution
@@ -0,0 +1,10 @@
1
+ import { AxiosInstance, AxiosRequestConfig } from 'axios';
2
+ /**
3
+ * Custom composable function for making API requests with Axios.
4
+ *
5
+ * @template T The expected return type of the API request.
6
+ * @param {AxiosInstance} axios - The Axios instance for making HTTP requests.
7
+ * @param {AxiosRequestConfig} axiosRequest - Configuration for the Axios request.
8
+ * @returns {Promise<T>} A promise with the result of the API request.
9
+ */
10
+ export default function axiosFetch<T>(axios: AxiosInstance, axiosRequest: AxiosRequestConfig): Promise<T>;
@@ -0,0 +1,10 @@
1
+ import { AxiosInstance, AxiosRequestConfig } from 'axios';
2
+ import { UseQueryOptions } from '@tanstack/vue-query';
3
+ /**
4
+ * Creates a fetchComposable for Axios requests with an optional custom instance.
5
+ * @param fetchComposable - The composable to use for the request (can be any fetch function).
6
+ * @param apiUrl - The base URL for the Axios instance.
7
+ * @param axiosInstance - An optional custom Axios instance to use for the request.
8
+ * @returns A function that handles the request using the provided composable.
9
+ */
10
+ export default function createFetch(fetchComposable: Function, apiUrl: string, axiosInstance?: AxiosInstance): (axiosRequestConfig: AxiosRequestConfig, options?: UseQueryOptions) => any;
@@ -0,0 +1,3 @@
1
+ export * from './axiosFetch';
2
+ export * from './createFetch';
3
+ export * from './useVueQuery';
@@ -0,0 +1,192 @@
1
+ import { AxiosInstance, AxiosRequestConfig } from 'axios';
2
+ import type { ExtendedQueryOptions } from '../../types';
3
+ /**
4
+ * Custom composable for integrating Axios requests with Vue Query.
5
+ *
6
+ * @template T - The type of data expected from the query.
7
+ * @param {AxiosInstance} axios - Axios instance used for making HTTP requests.
8
+ * @param {AxiosRequestConfig} axiosRequest - Initial Axios request configuration.
9
+ * @param {ExtendedQueryOptions<T>} [queryOptions] - Optional Vue Query options with server execution flag.
10
+ * @returns {object} Composable functions and query state for managing API requests.
11
+ */
12
+ export default function useVueQuery<T>(axios: AxiosInstance, axiosRequest: AxiosRequestConfig, queryOptions?: ExtendedQueryOptions): {
13
+ data: import("vue").Ref<T, T>;
14
+ error: import("vue").Ref<unknown, unknown>;
15
+ isError: import("vue").Ref<true, true>;
16
+ isPending: import("vue").Ref<false, false>;
17
+ isLoading: import("vue").Ref<false, false>;
18
+ isLoadingError: import("vue").Ref<false, false>;
19
+ isRefetchError: import("vue").Ref<true, true>;
20
+ isSuccess: import("vue").Ref<false, false>;
21
+ isPlaceholderData: import("vue").Ref<false, false>;
22
+ status: import("vue").Ref<"error", "error">;
23
+ dataUpdatedAt: import("vue").Ref<number, number>;
24
+ errorUpdatedAt: import("vue").Ref<number, number>;
25
+ failureCount: import("vue").Ref<number, number>;
26
+ failureReason: import("vue").Ref<unknown, unknown>;
27
+ errorUpdateCount: import("vue").Ref<number, number>;
28
+ isFetched: import("vue").Ref<boolean, boolean>;
29
+ isFetchedAfterMount: import("vue").Ref<boolean, boolean>;
30
+ isFetching: import("vue").Ref<boolean, boolean>;
31
+ isInitialLoading: import("vue").Ref<boolean, boolean>;
32
+ isPaused: import("vue").Ref<boolean, boolean>;
33
+ isRefetching: import("vue").Ref<boolean, boolean>;
34
+ isStale: import("vue").Ref<boolean, boolean>;
35
+ refetch: (options?: import("@tanstack/vue-query").RefetchOptions) => Promise<import("@tanstack/vue-query").QueryObserverResult<T, unknown>>;
36
+ fetchStatus: import("vue").Ref<import("@tanstack/vue-query").FetchStatus, import("@tanstack/vue-query").FetchStatus>;
37
+ promise: import("vue").Ref<Promise<T>, Promise<T>>;
38
+ suspense: () => Promise<import("@tanstack/vue-query").QueryObserverResult<T, unknown>>;
39
+ execute: (newKey?: Array<any>, newRequestParams?: object, newQueryOptions?: ExtendedQueryOptions) => void;
40
+ onResult: (cb: (data: T) => void) => void;
41
+ onError: (callback: (e: unknown) => void) => void;
42
+ } | {
43
+ data: import("vue").Ref<T, T>;
44
+ error: import("vue").Ref<null, null>;
45
+ isError: import("vue").Ref<false, false>;
46
+ isPending: import("vue").Ref<false, false>;
47
+ isLoading: import("vue").Ref<false, false>;
48
+ isLoadingError: import("vue").Ref<false, false>;
49
+ isRefetchError: import("vue").Ref<false, false>;
50
+ isSuccess: import("vue").Ref<true, true>;
51
+ isPlaceholderData: import("vue").Ref<false, false>;
52
+ status: import("vue").Ref<"success", "success">;
53
+ dataUpdatedAt: import("vue").Ref<number, number>;
54
+ errorUpdatedAt: import("vue").Ref<number, number>;
55
+ failureCount: import("vue").Ref<number, number>;
56
+ failureReason: import("vue").Ref<unknown, unknown>;
57
+ errorUpdateCount: import("vue").Ref<number, number>;
58
+ isFetched: import("vue").Ref<boolean, boolean>;
59
+ isFetchedAfterMount: import("vue").Ref<boolean, boolean>;
60
+ isFetching: import("vue").Ref<boolean, boolean>;
61
+ isInitialLoading: import("vue").Ref<boolean, boolean>;
62
+ isPaused: import("vue").Ref<boolean, boolean>;
63
+ isRefetching: import("vue").Ref<boolean, boolean>;
64
+ isStale: import("vue").Ref<boolean, boolean>;
65
+ refetch: (options?: import("@tanstack/vue-query").RefetchOptions) => Promise<import("@tanstack/vue-query").QueryObserverResult<T, unknown>>;
66
+ fetchStatus: import("vue").Ref<import("@tanstack/vue-query").FetchStatus, import("@tanstack/vue-query").FetchStatus>;
67
+ promise: import("vue").Ref<Promise<T>, Promise<T>>;
68
+ suspense: () => Promise<import("@tanstack/vue-query").QueryObserverResult<T, unknown>>;
69
+ execute: (newKey?: Array<any>, newRequestParams?: object, newQueryOptions?: ExtendedQueryOptions) => void;
70
+ onResult: (cb: (data: T) => void) => void;
71
+ onError: (callback: (e: unknown) => void) => void;
72
+ } | {
73
+ data: import("vue").Ref<undefined, undefined>;
74
+ error: import("vue").Ref<unknown, unknown>;
75
+ isError: import("vue").Ref<true, true>;
76
+ isPending: import("vue").Ref<false, false>;
77
+ isLoading: import("vue").Ref<false, false>;
78
+ isLoadingError: import("vue").Ref<true, true>;
79
+ isRefetchError: import("vue").Ref<false, false>;
80
+ isSuccess: import("vue").Ref<false, false>;
81
+ isPlaceholderData: import("vue").Ref<false, false>;
82
+ status: import("vue").Ref<"error", "error">;
83
+ dataUpdatedAt: import("vue").Ref<number, number>;
84
+ errorUpdatedAt: import("vue").Ref<number, number>;
85
+ failureCount: import("vue").Ref<number, number>;
86
+ failureReason: import("vue").Ref<unknown, unknown>;
87
+ errorUpdateCount: import("vue").Ref<number, number>;
88
+ isFetched: import("vue").Ref<boolean, boolean>;
89
+ isFetchedAfterMount: import("vue").Ref<boolean, boolean>;
90
+ isFetching: import("vue").Ref<boolean, boolean>;
91
+ isInitialLoading: import("vue").Ref<boolean, boolean>;
92
+ isPaused: import("vue").Ref<boolean, boolean>;
93
+ isRefetching: import("vue").Ref<boolean, boolean>;
94
+ isStale: import("vue").Ref<boolean, boolean>;
95
+ refetch: (options?: import("@tanstack/vue-query").RefetchOptions) => Promise<import("@tanstack/vue-query").QueryObserverResult<T, unknown>>;
96
+ fetchStatus: import("vue").Ref<import("@tanstack/vue-query").FetchStatus, import("@tanstack/vue-query").FetchStatus>;
97
+ promise: import("vue").Ref<Promise<T>, Promise<T>>;
98
+ suspense: () => Promise<import("@tanstack/vue-query").QueryObserverResult<T, unknown>>;
99
+ execute: (newKey?: Array<any>, newRequestParams?: object, newQueryOptions?: ExtendedQueryOptions) => void;
100
+ onResult: (cb: (data: T) => void) => void;
101
+ onError: (callback: (e: unknown) => void) => void;
102
+ } | {
103
+ data: import("vue").Ref<undefined, undefined>;
104
+ error: import("vue").Ref<null, null>;
105
+ isError: import("vue").Ref<false, false>;
106
+ isPending: import("vue").Ref<true, true>;
107
+ isLoading: import("vue").Ref<true, true>;
108
+ isLoadingError: import("vue").Ref<false, false>;
109
+ isRefetchError: import("vue").Ref<false, false>;
110
+ isSuccess: import("vue").Ref<false, false>;
111
+ isPlaceholderData: import("vue").Ref<false, false>;
112
+ status: import("vue").Ref<"pending", "pending">;
113
+ dataUpdatedAt: import("vue").Ref<number, number>;
114
+ errorUpdatedAt: import("vue").Ref<number, number>;
115
+ failureCount: import("vue").Ref<number, number>;
116
+ failureReason: import("vue").Ref<unknown, unknown>;
117
+ errorUpdateCount: import("vue").Ref<number, number>;
118
+ isFetched: import("vue").Ref<boolean, boolean>;
119
+ isFetchedAfterMount: import("vue").Ref<boolean, boolean>;
120
+ isFetching: import("vue").Ref<boolean, boolean>;
121
+ isInitialLoading: import("vue").Ref<boolean, boolean>;
122
+ isPaused: import("vue").Ref<boolean, boolean>;
123
+ isRefetching: import("vue").Ref<boolean, boolean>;
124
+ isStale: import("vue").Ref<boolean, boolean>;
125
+ refetch: (options?: import("@tanstack/vue-query").RefetchOptions) => Promise<import("@tanstack/vue-query").QueryObserverResult<T, unknown>>;
126
+ fetchStatus: import("vue").Ref<import("@tanstack/vue-query").FetchStatus, import("@tanstack/vue-query").FetchStatus>;
127
+ promise: import("vue").Ref<Promise<T>, Promise<T>>;
128
+ suspense: () => Promise<import("@tanstack/vue-query").QueryObserverResult<T, unknown>>;
129
+ execute: (newKey?: Array<any>, newRequestParams?: object, newQueryOptions?: ExtendedQueryOptions) => void;
130
+ onResult: (cb: (data: T) => void) => void;
131
+ onError: (callback: (e: unknown) => void) => void;
132
+ } | {
133
+ data: import("vue").Ref<undefined, undefined>;
134
+ error: import("vue").Ref<null, null>;
135
+ isError: import("vue").Ref<false, false>;
136
+ isPending: import("vue").Ref<true, true>;
137
+ isLoadingError: import("vue").Ref<false, false>;
138
+ isRefetchError: import("vue").Ref<false, false>;
139
+ isSuccess: import("vue").Ref<false, false>;
140
+ isPlaceholderData: import("vue").Ref<false, false>;
141
+ status: import("vue").Ref<"pending", "pending">;
142
+ dataUpdatedAt: import("vue").Ref<number, number>;
143
+ errorUpdatedAt: import("vue").Ref<number, number>;
144
+ failureCount: import("vue").Ref<number, number>;
145
+ failureReason: import("vue").Ref<unknown, unknown>;
146
+ errorUpdateCount: import("vue").Ref<number, number>;
147
+ isFetched: import("vue").Ref<boolean, boolean>;
148
+ isFetchedAfterMount: import("vue").Ref<boolean, boolean>;
149
+ isFetching: import("vue").Ref<boolean, boolean>;
150
+ isLoading: import("vue").Ref<boolean, boolean>;
151
+ isInitialLoading: import("vue").Ref<boolean, boolean>;
152
+ isPaused: import("vue").Ref<boolean, boolean>;
153
+ isRefetching: import("vue").Ref<boolean, boolean>;
154
+ isStale: import("vue").Ref<boolean, boolean>;
155
+ refetch: (options?: import("@tanstack/vue-query").RefetchOptions) => Promise<import("@tanstack/vue-query").QueryObserverResult<T, unknown>>;
156
+ fetchStatus: import("vue").Ref<import("@tanstack/vue-query").FetchStatus, import("@tanstack/vue-query").FetchStatus>;
157
+ promise: import("vue").Ref<Promise<T>, Promise<T>>;
158
+ suspense: () => Promise<import("@tanstack/vue-query").QueryObserverResult<T, unknown>>;
159
+ execute: (newKey?: Array<any>, newRequestParams?: object, newQueryOptions?: ExtendedQueryOptions) => void;
160
+ onResult: (cb: (data: T) => void) => void;
161
+ onError: (callback: (e: unknown) => void) => void;
162
+ } | {
163
+ data: import("vue").Ref<T, T>;
164
+ isError: import("vue").Ref<false, false>;
165
+ error: import("vue").Ref<null, null>;
166
+ isPending: import("vue").Ref<false, false>;
167
+ isLoading: import("vue").Ref<false, false>;
168
+ isLoadingError: import("vue").Ref<false, false>;
169
+ isRefetchError: import("vue").Ref<false, false>;
170
+ isSuccess: import("vue").Ref<true, true>;
171
+ isPlaceholderData: import("vue").Ref<true, true>;
172
+ status: import("vue").Ref<"success", "success">;
173
+ dataUpdatedAt: import("vue").Ref<number, number>;
174
+ errorUpdatedAt: import("vue").Ref<number, number>;
175
+ failureCount: import("vue").Ref<number, number>;
176
+ failureReason: import("vue").Ref<unknown, unknown>;
177
+ errorUpdateCount: import("vue").Ref<number, number>;
178
+ isFetched: import("vue").Ref<boolean, boolean>;
179
+ isFetchedAfterMount: import("vue").Ref<boolean, boolean>;
180
+ isFetching: import("vue").Ref<boolean, boolean>;
181
+ isInitialLoading: import("vue").Ref<boolean, boolean>;
182
+ isPaused: import("vue").Ref<boolean, boolean>;
183
+ isRefetching: import("vue").Ref<boolean, boolean>;
184
+ isStale: import("vue").Ref<boolean, boolean>;
185
+ refetch: (options?: import("@tanstack/vue-query").RefetchOptions) => Promise<import("@tanstack/vue-query").QueryObserverResult<T, unknown>>;
186
+ fetchStatus: import("vue").Ref<import("@tanstack/vue-query").FetchStatus, import("@tanstack/vue-query").FetchStatus>;
187
+ promise: import("vue").Ref<Promise<T>, Promise<T>>;
188
+ suspense: () => Promise<import("@tanstack/vue-query").QueryObserverResult<T, unknown>>;
189
+ execute: (newKey?: Array<any>, newRequestParams?: object, newQueryOptions?: ExtendedQueryOptions) => void;
190
+ onResult: (cb: (data: T) => void) => void;
191
+ onError: (callback: (e: unknown) => void) => void;
192
+ };
@@ -0,0 +1 @@
1
+ export * from './useBreakpoint';
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Composable to manage breakpoints using Tailwind CSS and shared window resize listener.
3
+ *
4
+ * @returns {Object} An object containing the breakpoints and their states.
5
+ */
6
+ export default function useBreakpoint(): {
7
+ current: import("vue").ComputedRef<("sm" | "md" | "lg" | "xl" | "2xl")[]>;
8
+ active: import("vue").ComputedRef<"" | "sm" | "md" | "lg" | "xl" | "2xl">;
9
+ sm_S: import("vue").ComputedRef<boolean>;
10
+ sm_SE: import("vue").ComputedRef<boolean>;
11
+ sm_GE: import("vue").ComputedRef<boolean>;
12
+ sm_md: import("vue").ComputedRef<boolean>;
13
+ sm_xl: import("vue").ComputedRef<boolean>;
14
+ sm_2xl: import("vue").ComputedRef<boolean>;
15
+ md_S: import("vue").ComputedRef<boolean>;
16
+ md_SE: import("vue").ComputedRef<boolean>;
17
+ md_GE: import("vue").ComputedRef<boolean>;
18
+ md_lg: import("vue").ComputedRef<boolean>;
19
+ md_xl: import("vue").ComputedRef<boolean>;
20
+ md_2xl: import("vue").ComputedRef<boolean>;
21
+ lg_S: import("vue").ComputedRef<boolean>;
22
+ lg_SE: import("vue").ComputedRef<boolean>;
23
+ lg_GE: import("vue").ComputedRef<boolean>;
24
+ lg_xl: import("vue").ComputedRef<boolean>;
25
+ lg_2xl: import("vue").ComputedRef<boolean>;
26
+ xl_S: import("vue").ComputedRef<boolean>;
27
+ xl_SE: import("vue").ComputedRef<boolean>;
28
+ xl_GE: import("vue").ComputedRef<boolean>;
29
+ xl_2xl: import("vue").ComputedRef<boolean>;
30
+ _2xl_S: import("vue").ComputedRef<boolean>;
31
+ _2xl_SE: import("vue").ComputedRef<boolean>;
32
+ _2xl_GE: import("vue").ComputedRef<boolean>;
33
+ isGreaterThanBreakpoint: import("vue").ComputedRef<boolean>;
34
+ reactiveBreakpoint: import("vue").Ref<"sm" | "md" | "lg" | "xl" | "2xl", "sm" | "md" | "lg" | "xl" | "2xl">;
35
+ breakpointsTailwind: {
36
+ sm: number;
37
+ md: number;
38
+ lg: number;
39
+ xl: number;
40
+ '2xl': number;
41
+ };
42
+ windowWidth: import("vue").ShallowRef<number, number>;
43
+ windowHeight: import("vue").ShallowRef<number, number>;
44
+ mobile: import("vue").ComputedRef<boolean>;
45
+ tablet: import("vue").ComputedRef<boolean>;
46
+ laptop: import("vue").ComputedRef<boolean>;
47
+ desktop: import("vue").ComputedRef<boolean>;
48
+ breakpoints: Record<"sm" | "md" | "lg" | "xl" | "2xl", import("vue").ComputedRef<boolean>> & {
49
+ greaterOrEqual: (k: import("vue").MaybeRefOrGetter<"sm" | "md" | "lg" | "xl" | "2xl">) => import("vue").ComputedRef<boolean>;
50
+ smallerOrEqual: (k: import("vue").MaybeRefOrGetter<"sm" | "md" | "lg" | "xl" | "2xl">) => import("vue").ComputedRef<boolean>;
51
+ greater(k: import("vue").MaybeRefOrGetter<"sm" | "md" | "lg" | "xl" | "2xl">): import("vue").ComputedRef<boolean>;
52
+ smaller(k: import("vue").MaybeRefOrGetter<"sm" | "md" | "lg" | "xl" | "2xl">): import("vue").ComputedRef<boolean>;
53
+ between(a: import("vue").MaybeRefOrGetter<"sm" | "md" | "lg" | "xl" | "2xl">, b: import("vue").MaybeRefOrGetter<"sm" | "md" | "lg" | "xl" | "2xl">): import("vue").ComputedRef<boolean>;
54
+ isGreater(k: import("vue").MaybeRefOrGetter<"sm" | "md" | "lg" | "xl" | "2xl">): boolean;
55
+ isGreaterOrEqual(k: import("vue").MaybeRefOrGetter<"sm" | "md" | "lg" | "xl" | "2xl">): boolean;
56
+ isSmaller(k: import("vue").MaybeRefOrGetter<"sm" | "md" | "lg" | "xl" | "2xl">): boolean;
57
+ isSmallerOrEqual(k: import("vue").MaybeRefOrGetter<"sm" | "md" | "lg" | "xl" | "2xl">): boolean;
58
+ isInBetween(a: import("vue").MaybeRefOrGetter<"sm" | "md" | "lg" | "xl" | "2xl">, b: import("vue").MaybeRefOrGetter<"sm" | "md" | "lg" | "xl" | "2xl">): boolean;
59
+ current: () => import("vue").ComputedRef<("sm" | "md" | "lg" | "xl" | "2xl")[]>;
60
+ active(): import("vue").ComputedRef<"" | "sm" | "md" | "lg" | "xl" | "2xl">;
61
+ };
62
+ };
@@ -0,0 +1 @@
1
+ export * from './useFilter';
@@ -0,0 +1,16 @@
1
+ /**
2
+ * A composable function that filters objects based on a specific field and criteria.
3
+ *
4
+ * @param {Object[]} items - The list of objects to filter.
5
+ * @param {Object} filterConfig - Configuration for the filter, specifying the field, the data type to filter, and the criteria.
6
+ * @param {string} filterConfig.field - The field in the objects to filter.
7
+ * @param {string} filterConfig.type - The data type of the field ('date', 'string', 'number', 'boolean').
8
+ * @param {any} filterConfig.criteria - The criteria for filtering. Can be a date range, a string to search, a number range, or a boolean value.
9
+ *
10
+ * @returns {Object[]} - The filtered list of objects.
11
+ */
12
+ export default function useFilter<T extends Record<string, any>>(items: T[], filterConfig: {
13
+ field: string;
14
+ type: 'date' | 'string' | 'number' | 'boolean';
15
+ criteria: any;
16
+ }): T[];
@@ -0,0 +1,5 @@
1
+ export * from './axios';
2
+ export * from './breakpoints';
3
+ export * from './filters';
4
+ export * from './paginators';
5
+ export * from './sorters';
@@ -0,0 +1 @@
1
+ export * from './usePaginator';
@@ -0,0 +1,14 @@
1
+ import { Ref } from "vue";
2
+ /**
3
+ * Composable to handle pagination logic.
4
+ *
5
+ * @param page - Reactive ref for the current page number.
6
+ * @param total - Reactive ref for total number of items.
7
+ * @param pageSize - Reactive ref for number of items per page.
8
+ * @returns An object with pagination controls.
9
+ */
10
+ export default function usePagination(page: Ref<number>, total: Ref<number>, pageSize: Ref<number>): {
11
+ totalPages: import("vue").ComputedRef<number>;
12
+ canFetchNextPage: () => boolean;
13
+ canFetchPreviousPage: () => boolean;
14
+ };
@@ -0,0 +1 @@
1
+ export * from './useSorter';
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Custom composable for sorting products based on a selected criterion.
3
+ * @param {Array} items - The array of products to sort.
4
+ * @param {Array} criteriaList - The list of available sorting criteria.
5
+ * @param {Number} selectedCriteria - The currently selected sorting criterion.
6
+ * @returns {ComputedRef<Array>} - The sorted array of products.
7
+ */
8
+ export declare function useSorter(items: any[], criteriaList: {
9
+ value: number;
10
+ label: string;
11
+ field: string;
12
+ order: string;
13
+ type: string;
14
+ }[], selectedCriteria: number): any[];
@@ -0,0 +1,47 @@
1
+ import { AxiosInstance } from 'axios';
2
+ /**
3
+ * AxiosService class encapsulates the Axios configuration and logic.
4
+ * It manages request and response interceptors and provides methods for making HTTP requests.
5
+ */
6
+ export default class AxiosService {
7
+ private readonly instance;
8
+ private cancelTokenSource;
9
+ private activeRequests;
10
+ /**
11
+ * Initializes the AxiosService instance by creating an Axios instance with default configuration
12
+ * and setting up request and response interceptors.
13
+ */
14
+ constructor(url: string);
15
+ /**
16
+ * Initializes request and response interceptors for the Axios instance.
17
+ */
18
+ private initializeInterceptors;
19
+ /**
20
+ * Returns the number of active requests.
21
+ */
22
+ getActiveRequests(): number;
23
+ /**
24
+ * Handles unauthorized access errors (401).
25
+ */
26
+ private handleUnauthorized;
27
+ /**
28
+ * Returns the Axios instance with the configured settings and interceptors.
29
+ * @returns {AxiosInstance} The configured Axios instance.
30
+ */
31
+ getAxiosInstance(): AxiosInstance;
32
+ /**
33
+ * Cancels all ongoing requests.
34
+ */
35
+ cancelAllRequests(): void;
36
+ /**
37
+ * Sets a new header for the Axios instance.
38
+ * @param {string} key - The header key.
39
+ * @param {string} value - The header value.
40
+ */
41
+ setHeader(key: string, value: string): void;
42
+ /**
43
+ * Removes a header from the Axios instance.
44
+ * @param {string} key - The header key to remove.
45
+ */
46
+ removeHeader(key: string): void;
47
+ }
@@ -0,0 +1,2 @@
1
+ export * from './axiosConfig';
2
+ export { default as AxiosService } from './axiosConfig';
@@ -0,0 +1 @@
1
+ export * from './axios';
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Object defining available screen sizes as constants.
3
+ * @readonly
4
+ */
5
+ export declare const sizeEnum: {
6
+ readonly XS: "XS";
7
+ readonly SM: "SM";
8
+ readonly MD: "MD";
9
+ readonly LG: "LG";
10
+ readonly XL: "XL";
11
+ readonly XXL: "XXL";
12
+ };
13
+ /**
14
+ * Object defining breakpoints for design based on screen width.
15
+ * Values are in pixels.
16
+ * @readonly
17
+ */
18
+ export declare const screenEnum: {
19
+ readonly XS: 480;
20
+ readonly SM: 576;
21
+ readonly MD: 768;
22
+ readonly LG: 992;
23
+ readonly XL: 1200;
24
+ readonly XXL: 1600;
25
+ };
26
+ /**
27
+ * Map that associates each screen size defined in `sizeEnum` with its corresponding pixel value from `screenEnum`.
28
+ * @type {Map<typeof sizeEnum[keyof typeof sizeEnum], number>}
29
+ */
30
+ declare const screenMap: Map<"XS" | "SM" | "MD" | "LG" | "XL" | "XXL", number>;
31
+ export { screenMap };
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Object defining various exception codes.
3
+ * @readonly
4
+ */
5
+ export declare const ExceptionEnum: {
6
+ /**
7
+ * HTTP status code for page access forbidden.
8
+ */
9
+ readonly PAGE_NOT_ACCESS: 403;
10
+ /**
11
+ * HTTP status code for page not found.
12
+ */
13
+ readonly PAGE_NOT_FOUND: 404;
14
+ /**
15
+ * HTTP status code for general server error.
16
+ */
17
+ readonly ERROR: 500;
18
+ /**
19
+ * HTTP status code for bad request.
20
+ */
21
+ readonly BAD_REQUEST: 406;
22
+ /**
23
+ * Custom error code for network errors.
24
+ */
25
+ readonly NET_WORK_ERROR: 10000;
26
+ /**
27
+ * Custom code indicating no data on the page, not actually an exception page.
28
+ */
29
+ readonly PAGE_NOT_DATA: 10100;
30
+ };
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Object defining various image MIME types.
3
+ * @readonly
4
+ */
5
+ export declare const ImageTypes: {
6
+ readonly apng: "image/apng";
7
+ readonly bmp: "image/bmp";
8
+ readonly gif: "image/gif";
9
+ readonly jpeg: "image/jpeg";
10
+ readonly pjpeg: "image/pjpeg";
11
+ readonly png: "image/png";
12
+ readonly svg: "image/svg+xml";
13
+ readonly tiff: "image/tiff";
14
+ readonly webp: "image/webp";
15
+ readonly xicon: "image/x-icon";
16
+ };
17
+ /**
18
+ * Object defining various file meta types.
19
+ * @readonly
20
+ */
21
+ export declare const FileMetaTypes: {
22
+ readonly images: "image/*";
23
+ readonly audios: "audio/*";
24
+ readonly videos: "video/*";
25
+ };
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Object representing different content types for HTTP headers.
3
+ * @readonly
4
+ */
5
+ export declare const ContentTypeEnum: {
6
+ /**
7
+ * Content type for JSON.
8
+ * @constant
9
+ */
10
+ readonly JSON: "application/json;charset=UTF-8";
11
+ /**
12
+ * Content type for URL-encoded form data.
13
+ * @constant
14
+ */
15
+ readonly FORM_URLENCODED: "application/x-www-form-urlencoded;charset=UTF-8";
16
+ /**
17
+ * Content type for multipart form data with file uploads.
18
+ * @constant
19
+ */
20
+ readonly FORM_DATA: "multipart/form-data;charset=UTF-8";
21
+ };
@@ -0,0 +1,6 @@
1
+ export * from './breakpointEnum';
2
+ export * from './exceptionEnum';
3
+ export * from './fileTypesEnum';
4
+ export * from './httpEnum';
5
+ export * from './keyCodeEnum';
6
+ export * from './storageEnum';
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Object defining various key codes for keyboard events.
3
+ * @readonly
4
+ */
5
+ export declare const KeyCodeEnum: {
6
+ readonly UP: 38;
7
+ readonly DOWN: 40;
8
+ readonly ENTER: 13;
9
+ readonly ESC: 27;
10
+ };
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Key used for storing the authentication token.
3
+ * @constant {string}
4
+ */
5
+ export declare const TOKEN_KEY = "TOKEN__";
6
+ /**
7
+ * Key used for storing the locale information.
8
+ * @constant {string}
9
+ */
10
+ export declare const LOCALE_KEY = "LOCALE__";
11
+ /**
12
+ * Key used for storing user information.
13
+ * @constant {string}
14
+ */
15
+ export declare const USER_INFO_KEY = "USER__INFO__";
16
+ /**
17
+ * Key used for storing role information.
18
+ * @constant {string}
19
+ */
20
+ export declare const ROLES_KEY = "ROLES__KEY__";
21
+ /**
22
+ * Key used for storing project configuration.
23
+ * @constant {string}
24
+ */
25
+ export declare const PROJ_CFG_KEY = "PROJ__CFG__KEY__";
26
+ /**
27
+ * Key used for storing lock information.
28
+ * @constant {string}
29
+ */
30
+ export declare const LOCK_INFO_KEY = "LOCK__INFO__KEY__";
31
+ /**
32
+ * Key used for base global local cache.
33
+ * @constant {string}
34
+ */
35
+ export declare const APP_LOCAL_CACHE_KEY = "COMMON__LOCAL__KEY";
36
+ /**
37
+ * Key used for base global session cache.
38
+ * @constant {string}
39
+ */
40
+ export declare const APP_SESSION_CACHE_KEY = "COMMON__SESSION__KEY";
41
+ /**
42
+ * Object defining types of cache storage.
43
+ * @readonly
44
+ */
45
+ export declare const CacheTypeEnum: {
46
+ /** Represents session storage */
47
+ readonly SESSION: 0;
48
+ /** Represents local storage */
49
+ readonly LOCAL: 1;
50
+ };
@@ -0,0 +1,6 @@
1
+ export * from './rest';
2
+ export * from './composables';
3
+ export * from './config';
4
+ export * from './constants';
5
+ export * from './types';
6
+ export * from './utils';