@win2win/shared-ui 0.2.48 → 0.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.
@@ -0,0 +1,4 @@
1
+ import { JsonObject } from "@win2win/shared";
2
+ import { AxiosInstance } from "axios";
3
+ export declare function createFetchUniq(axiosInstance: AxiosInstance): <T = any>(route: string, params: JsonObject, tokenKey: string) => Promise<NonNullable<T> | null>;
4
+ //# sourceMappingURL=fetchUniqFactory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetchUniqFactory.d.ts","sourceRoot":"","sources":["../../../src/composables/fetching/fetchUniqFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAc,EAAE,aAAa,EAAqB,MAAM,OAAO,CAAC;AAKhE,wBAAgB,eAAe,CAAC,aAAa,EAAE,aAAa,IAG1B,CAAC,GAAG,GAAG,EACrC,OAAO,MAAM,EACb,QAAQ,UAAU,EAClB,UAAU,MAAM,oCAwBnB"}
@@ -0,0 +1,6 @@
1
+ import { JsonObject } from "@win2win/shared";
2
+ declare let fetchUniqInstance: (<T>(route: string, params: JsonObject, tokenKey: string) => Promise<T | null>) | null;
3
+ export declare function setFetchUniq(instance: typeof fetchUniqInstance): void;
4
+ export declare function getFetchUniq(): <T>(route: string, params: JsonObject, tokenKey: string) => Promise<T | null>;
5
+ export {};
6
+ //# sourceMappingURL=fetchUniqProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetchUniqProvider.d.ts","sourceRoot":"","sources":["../../../src/composables/fetching/fetchUniqProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,QAAA,IAAI,iBAAiB,EACjB,CAAC,CAAC,CAAC,EACD,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,UAAU,EAClB,QAAQ,EAAE,MAAM,KACb,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,GACvB,IAAW,CAAC;AAEhB,wBAAgB,YAAY,CAAC,QAAQ,EAAE,OAAO,iBAAiB,QAE9D;AAED,wBAAgB,YAAY,KAXtB,CAAC,SACM,MAAM,UACL,UAAU,YACR,MAAM,KACb,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAczB"}
@@ -0,0 +1,6 @@
1
+ export * from "./fetchUniqFactory";
2
+ export * from "./fetchUniqProvider";
3
+ export * from "./types";
4
+ export * from "./useFetch";
5
+ export * from "./useFetchPages";
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/composables/fetching/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,29 @@
1
+ import { MaybeRef } from "vue";
2
+ export type RefetchType = "active" | "all" | "none" | "inactive";
3
+ export interface FetchOptions {
4
+ refetchType?: RefetchType;
5
+ retry?: number;
6
+ refetchOnMount?: "always" | boolean;
7
+ refetchOnWindowFocus?: "always" | boolean;
8
+ staleTime?: number;
9
+ keepPreviousData?: boolean;
10
+ enabled?: MaybeRef<boolean> | (() => boolean);
11
+ defaultValue?: any;
12
+ }
13
+ export type QueryKey = (string | number | null | object)[];
14
+ export type Params = Record<string, any>;
15
+ export type Path = string;
16
+ export interface DataCollectionResponse<T> {
17
+ items: T[];
18
+ count: number;
19
+ nextCursor: number;
20
+ }
21
+ export interface QTablePagination {
22
+ sortBy: string;
23
+ descending: boolean;
24
+ page: number;
25
+ rowsPerPage: number;
26
+ rowsNumber: number;
27
+ }
28
+ export declare const DEFAULT_FETCH_OPTIONS: FetchOptions;
29
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/composables/fetching/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAE/B,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,KAAK,GAAG,MAAM,GAAG,UAAU,CAAC;AACjE,MAAM,WAAW,YAAY;IAC3B,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IACpC,oBAAoB,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,OAAO,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,OAAO,CAAC,CAAC;IAC9C,YAAY,CAAC,EAAE,GAAG,CAAC;CACpB;AAED,MAAM,MAAM,QAAQ,GAAG,CAAC,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,MAAM,CAAC,EAAE,CAAC;AAC3D,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AACzC,MAAM,MAAM,IAAI,GAAG,MAAM,CAAC;AAE1B,MAAM,WAAW,sBAAsB,CAAC,CAAC;IACvC,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,OAAO,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,qBAAqB,EAAE,YAOnC,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { MaybeRef } from "vue";
2
+ import { FetchOptions, Params, Path, QueryKey } from "./types";
3
+ export declare function useFetch<T>(queryKey: MaybeRef<QueryKey>, path: MaybeRef<Path>, params?: MaybeRef<Params | null>, map?: (data: any) => T, options?: FetchOptions): {
4
+ pending: import("vue").Ref<false, false> | import("vue").Ref<true, true>;
5
+ fetching: import("vue").Ref<boolean, boolean>;
6
+ data: import("vue").ComputedRef<T>;
7
+ refetch: (options?: import("@tanstack/vue-query").RefetchOptions) => Promise<import("@tanstack/vue-query").QueryObserverResult<T | null, Error>>;
8
+ invalidate: () => Promise<void>;
9
+ };
10
+ //# sourceMappingURL=useFetch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFetch.d.ts","sourceRoot":"","sources":["../../../src/composables/fetching/useFetch.ts"],"names":[],"mappings":"AAEA,OAAO,EAAY,QAAQ,EAAE,MAAM,KAAK,CAAC;AAGzC,OAAO,EAEL,YAAY,EACZ,MAAM,EACN,IAAI,EACJ,QAAQ,EACT,MAAM,SAAS,CAAC;AAEjB,wBAAgB,QAAQ,CAAC,CAAC,EACxB,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC,EAC5B,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,EACpB,MAAM,CAAC,EAAE,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAC,EAChC,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,CAAC,EACtB,OAAO,CAAC,EAAE,YAAY;;;;;;EA8CvB"}
@@ -0,0 +1,16 @@
1
+ import { FilterQueryParams } from "@win2win/shared";
2
+ import { MaybeRef, Ref } from "vue";
3
+ import { DataCollectionResponse, FetchOptions, QTablePagination } from "./types";
4
+ export declare function useFetchPages<T = any>(pagination: MaybeRef<QTablePagination>, filters: MaybeRef<FilterQueryParams>, path: MaybeRef<string>, options?: FetchOptions): {
5
+ pending: Ref<false, false> | Ref<true, true>;
6
+ fetching: Ref<boolean, boolean>;
7
+ items: import("vue").ComputedRef<T[]>;
8
+ refetch: (options?: import("@tanstack/vue-query").RefetchOptions) => Promise<import("@tanstack/vue-query").QueryObserverResult<DataCollectionResponse<T> | null, Error>>;
9
+ invalidate: () => Promise<void>;
10
+ count: import("vue").WritableComputedRef<number, number>;
11
+ page: import("vue").WritableComputedRef<number, number>;
12
+ prevPage: () => void;
13
+ nextPage: () => void;
14
+ isPlaceholderData: Ref<false, false> | Ref<true, true>;
15
+ };
16
+ //# sourceMappingURL=useFetchPages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFetchPages.d.ts","sourceRoot":"","sources":["../../../src/composables/fetching/useFetchPages.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,iBAAiB,EAGlB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAmB,QAAQ,EAAE,GAAG,EAAS,MAAM,KAAK,CAAC;AAG5D,OAAO,EACL,sBAAsB,EAEtB,YAAY,EACZ,gBAAgB,EACjB,MAAM,SAAS,CAAC;AAEjB,wBAAgB,aAAa,CAAC,CAAC,GAAG,GAAG,EACnC,UAAU,EAAE,QAAQ,CAAC,gBAAgB,CAAC,EACtC,OAAO,EAAE,QAAQ,CAAC,iBAAiB,CAAC,EACpC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,EACtB,OAAO,CAAC,EAAE,YAAY;;;;;;;;;;;EAqGvB"}
@@ -1,2 +1,4 @@
1
- export * from './useDragAndDrop';
1
+ export * from "./fetching";
2
+ export * from "./useDragAndDrop";
3
+ export * from "./utils";
2
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/composables/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/composables/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,SAAS,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { MaybeRef } from "vue";
2
+ export declare const getValue: <T = any>(value: MaybeRef<any>, defaultValue?: any) => T;
3
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/composables/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,QAAQ,EAAE,MAAM,KAAK,CAAC;AAEtC,eAAO,MAAM,QAAQ,GAAI,CAAC,GAAG,GAAG,EAC9B,OAAO,QAAQ,CAAC,GAAG,CAAC,EACpB,eAAc,GAAU,KACvB,CAMF,CAAC"}