eco-vue-js 0.4.14 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/Button/WButtonAction.vue.js +1 -0
- package/dist/components/InfiniteList/WInfiniteList.vue.d.ts +16 -13
- package/dist/components/InfiniteList/WInfiniteList.vue.d.ts.map +1 -1
- package/dist/components/InfiniteList/WInfiniteList.vue.js +4 -2
- package/dist/components/InfiniteList/WInfiniteListPages.vue.d.ts +16 -13
- package/dist/components/InfiniteList/WInfiniteListPages.vue.d.ts.map +1 -1
- package/dist/components/InfiniteList/WInfiniteListPages.vue.js +4 -2
- package/dist/components/InfiniteList/components/InfiniteListPage.vue.d.ts +10 -7
- package/dist/components/InfiniteList/components/InfiniteListPage.vue.d.ts.map +1 -1
- package/dist/components/InfiniteList/components/InfiniteListPage.vue.js +5 -3
- package/dist/components/InfiniteList/components/InfiniteListPageTitle.vue.d.ts +29 -17
- package/dist/components/InfiniteList/components/InfiniteListPageTitle.vue.d.ts.map +1 -1
- package/dist/components/InfiniteList/components/InfiniteListPageTitle.vue.js +1 -1
- package/dist/components/InfiniteList/use/useInfiniteListHeader.js +1 -0
- package/dist/components/Select/WSelect.vue.d.ts +12 -12
- package/dist/components/Select/WSelect.vue.d.ts.map +1 -1
- package/dist/components/Select/WSelectAsync.vue.d.ts +7 -4
- package/dist/components/Select/WSelectAsync.vue.d.ts.map +1 -1
- package/dist/components/Select/WSelectAsync.vue.js +4 -2
- package/dist/components/Select/WSelectAsyncList.vue.d.ts +10 -7
- package/dist/components/Select/WSelectAsyncList.vue.d.ts.map +1 -1
- package/dist/components/Select/WSelectAsyncList.vue.js +4 -2
- package/dist/components/Select/WSelectAsyncSingle.vue.d.ts +7 -4
- package/dist/components/Select/WSelectAsyncSingle.vue.d.ts.map +1 -1
- package/dist/components/Select/WSelectAsyncSingle.vue.js +4 -2
- package/dist/components/Select/WSelectSingle.vue.d.ts +10 -10
- package/dist/components/Select/WSelectSingle.vue.d.ts.map +1 -1
- package/dist/components/Select/WSelectSingle.vue.js +1 -1
- package/dist/components/Select/components/SelectAsyncList.vue.d.ts +10 -7
- package/dist/components/Select/components/SelectAsyncList.vue.d.ts.map +1 -1
- package/dist/components/Select/components/SelectAsyncList.vue.js +4 -2
- package/dist/components/Select/components/SelectAsyncPrefix.vue.d.ts +7 -4
- package/dist/components/Select/components/SelectAsyncPrefix.vue.d.ts.map +1 -1
- package/dist/components/Select/components/SelectAsyncPrefix.vue.js +4 -2
- package/dist/components/Select/components/SelectAsyncPrefixPage.vue.d.ts +7 -4
- package/dist/components/Select/components/SelectAsyncPrefixPage.vue.d.ts.map +1 -1
- package/dist/components/Select/components/SelectAsyncPrefixPage.vue.js +3 -1
- package/dist/main.d.ts +1 -0
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +1 -0
- package/dist/types/global.d.ts +11 -9
- package/dist/utils/useDefaultQuery.d.ts +7 -0
- package/dist/utils/useDefaultQuery.d.ts.map +1 -0
- package/dist/utils/useDefaultQuery.js +12 -0
- package/package.json +5 -2
package/dist/types/global.d.ts
CHANGED
@@ -40,14 +40,16 @@ declare type DefaultData = {id: number, [key: string]: unknown}
|
|
40
40
|
|
41
41
|
type Params = Parameters<import('@tanstack/vue-query').QueryClient['setQueriesData']>
|
42
42
|
|
43
|
-
declare type
|
43
|
+
declare type ApiErrorDefault = unknown
|
44
44
|
|
45
|
-
declare type
|
46
|
-
|
47
|
-
setData: (updater: TQueryFnData, options?: Params[2]) => ReturnType<import('@tanstack/vue-query').QueryClient['setQueriesData']>
|
48
|
-
}
|
45
|
+
declare type UseQueryDefault<TQueryFnData = unknown, TError = ApiErrorDefault, TData = TQueryFnData, TQueryKey extends import('@tanstack/vue-query').QueryKey = import('@tanstack/vue-query').QueryKey> =
|
46
|
+
typeof import('../utils/useDefaultQuery').useDefaultQuery<TQueryFnData, TError, TData, TQueryKey>
|
49
47
|
|
50
|
-
declare type
|
51
|
-
|
52
|
-
|
53
|
-
|
48
|
+
declare type QueryOptions<Data, Error = ApiErrorDefault> = Partial<Parameters<typeof import('../utils/useDefaultQuery').useDefaultQuery<Data, Error>>[0]>
|
49
|
+
|
50
|
+
declare type UseQueryEmpty<Model, ApiError> = (options?: QueryOptions<Model, ApiError>) => ReturnType<typeof import('../utils/useDefaultQuery').useDefaultQuery<Model, ApiError>>
|
51
|
+
|
52
|
+
declare type UseQueryWithParams<Model, ApiError, QueryParams> =
|
53
|
+
(queryParams: import('vue').MaybeRef<QueryParams>, options?: QueryOptions<Model, ApiError>) => ReturnType<typeof import('../utils/useDefaultQuery').useDefaultQuery<Model, ApiError>>
|
54
|
+
|
55
|
+
declare type UseQueryPaginated<Model, ApiError, QueryParams> = UseQueryWithParams<PaginatedResponse<Model>, ApiError, QueryParams>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { type QueryClient, type UseQueryReturnType, type QueryKey } from '@tanstack/vue-query';
|
2
|
+
type Params = Parameters<QueryClient['setQueriesData']>;
|
3
|
+
export declare const useDefaultQuery: <TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(options: import("@tanstack/vue-query").UseQueryOptions<TQueryFnData, TError, TData, TQueryFnData, TQueryKey>, queryClient?: QueryClient | undefined) => UseQueryReturnType<TData, TError> & {
|
4
|
+
setData: (updater: TQueryFnData, options?: Params[2]) => ReturnType<QueryClient['setQueriesData']>;
|
5
|
+
};
|
6
|
+
export {};
|
7
|
+
//# sourceMappingURL=useDefaultQuery.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useDefaultQuery.d.ts","sourceRoot":"","sources":["../../src/utils/useDefaultQuery.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,KAAK,WAAW,EAAE,KAAK,kBAAkB,EAAE,KAAK,QAAQ,EAAC,MAAM,qBAAqB,CAAA;AAEtH,KAAK,MAAM,GAAG,UAAU,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC,CAAA;AAEvD,eAAO,MAAM,eAAe;uBAEL,YAAY,YAAY,MAAM,CAAC,CAAC,CAAC,KAAK,WAAW,WAAW,CAAC,gBAAgB,CAAC,CAAC;CAUrG,CAAA"}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { useQueryClient, useQuery } from '@tanstack/vue-query';
|
2
|
+
|
3
|
+
const useDefaultQuery = (...args) => {
|
4
|
+
const queryClient = args[1] ?? useQueryClient();
|
5
|
+
const setData = (updater, options) => queryClient.setQueriesData({ queryKey: "queryKey" in args[0] ? args[0].queryKey : void 0 }, updater, options);
|
6
|
+
return {
|
7
|
+
...useQuery(...args),
|
8
|
+
setData
|
9
|
+
};
|
10
|
+
};
|
11
|
+
|
12
|
+
export { useDefaultQuery };
|
package/package.json
CHANGED
@@ -4,14 +4,14 @@
|
|
4
4
|
"type": "git",
|
5
5
|
"url": "https://github.com/rsmple/eco-vue-js.git"
|
6
6
|
},
|
7
|
-
"version": "0.
|
7
|
+
"version": "0.5.0",
|
8
8
|
"scripts": {
|
9
9
|
"dev": "vite",
|
10
10
|
"build": "run-p type-check build-only",
|
11
11
|
"preview": "vite preview",
|
12
12
|
"test:unit": "vitest --environment jsdom --root src/",
|
13
13
|
"build-only": "vite build",
|
14
|
-
"type-check": "vue-tsc --noEmit -p tsconfig.
|
14
|
+
"type-check": "vue-tsc --noEmit -p tsconfig.vue.json --composite false",
|
15
15
|
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
|
16
16
|
"lint:no-fix": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --ignore-path .gitignore",
|
17
17
|
"write-imports": "node write-imports.js"
|
@@ -99,6 +99,9 @@
|
|
99
99
|
"./dist/utils/Tooltip": {
|
100
100
|
"import": "./dist/utils/Tooltip.js"
|
101
101
|
},
|
102
|
+
"./dist/utils/useDefaultQuery": {
|
103
|
+
"import": "./dist/utils/useDefaultQuery.js"
|
104
|
+
},
|
102
105
|
"./dist/components/ActionsBar/WActionsBar.vue": {
|
103
106
|
"import": "./dist/components/ActionsBar/WActionsBar.vue.js"
|
104
107
|
},
|