@kong/kongponents 9.19.1 → 9.20.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/kongponents.es.js +2928 -2929
- package/dist/kongponents.umd.js +13 -13
- package/dist/types/composables/useUtilities.d.ts +14 -12
- package/package.json +2 -2
|
@@ -2,15 +2,17 @@ import type { Ref } from 'vue';
|
|
|
2
2
|
import type { IConfig } from 'swrv';
|
|
3
3
|
import type { AxiosResponse, AxiosError } from 'axios';
|
|
4
4
|
import type { IKey, fetcherFn } from 'swrv/dist/types';
|
|
5
|
+
import type { SwrvState } from '../../types';
|
|
5
6
|
export default function useUtilities(): {
|
|
6
7
|
useRequest: <Data = unknown, Error = {
|
|
7
8
|
message: string;
|
|
8
9
|
}>(key: IKey, fn?: fetcherFn<AxiosResponse<Data>>, config?: IConfig) => {
|
|
9
|
-
data: import("vue").ComputedRef<
|
|
10
|
-
response: Ref<
|
|
11
|
-
error: Ref<
|
|
10
|
+
data: import("vue").ComputedRef<Data | undefined>;
|
|
11
|
+
response: Ref<AxiosResponse<Data, any> | undefined, AxiosResponse<Data, any> | undefined>;
|
|
12
|
+
error: Ref<AxiosError<Error, any> | undefined, AxiosError<Error, any> | undefined>;
|
|
12
13
|
isValidating: Ref<boolean, boolean>;
|
|
13
|
-
|
|
14
|
+
isLoading: Ref<boolean, boolean>;
|
|
15
|
+
revalidate: (data?: fetcherFn<AxiosResponse<Data, any>> | undefined, opts?: import("swrv/dist/types").revalidateOptions) => Promise<void>;
|
|
14
16
|
};
|
|
15
17
|
useDebounce: <F extends (...args: any[]) => any>(fn: F, defaultDelay?: number) => {
|
|
16
18
|
debouncedFn: (...args: Parameters<F>) => void;
|
|
@@ -22,15 +24,15 @@ export default function useUtilities(): {
|
|
|
22
24
|
};
|
|
23
25
|
useSwrvState: (response: Ref<any>, error: Ref<any>, isValidating: Ref<boolean>) => {
|
|
24
26
|
hasData: Ref<boolean, boolean>;
|
|
25
|
-
state: Ref<
|
|
27
|
+
state: Ref<SwrvState, SwrvState>;
|
|
26
28
|
swrvState: {
|
|
27
|
-
VALIDATING:
|
|
28
|
-
VALIDATING_HAS_DATA:
|
|
29
|
-
PENDING:
|
|
30
|
-
SUCCESS:
|
|
31
|
-
SUCCESS_HAS_DATA:
|
|
32
|
-
ERROR:
|
|
33
|
-
STALE_IF_ERROR:
|
|
29
|
+
readonly VALIDATING: "VALIDATING";
|
|
30
|
+
readonly VALIDATING_HAS_DATA: "VALIDATING_HAS_DATA";
|
|
31
|
+
readonly PENDING: "PENDING";
|
|
32
|
+
readonly SUCCESS: "SUCCESS";
|
|
33
|
+
readonly SUCCESS_HAS_DATA: "SUCCESS_HAS_DATA";
|
|
34
|
+
readonly ERROR: "ERROR";
|
|
35
|
+
readonly STALE_IF_ERROR: "STALE_IF_ERROR";
|
|
34
36
|
};
|
|
35
37
|
};
|
|
36
38
|
getSizeFromString: (sizeStr: string) => string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kong/kongponents",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.20.0",
|
|
4
4
|
"description": "Kong Component library",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"lodash-es": "^4.17.21",
|
|
65
65
|
"nanoid": "^5.0.9",
|
|
66
66
|
"sortablejs": "^1.15.6",
|
|
67
|
-
"swrv": "^1.0
|
|
67
|
+
"swrv": "^1.1.0",
|
|
68
68
|
"v-calendar": "^3.1.2",
|
|
69
69
|
"virtua": "^0.39.3",
|
|
70
70
|
"vue-draggable-next": "^2.2.1"
|