@fewangsit/wangsvue-fats 1.0.0-alpha.115 → 1.0.0-alpha.117

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.
@@ -24,6 +24,27 @@ export type FilterMatchMode =
24
24
  | 'BETWEEN'
25
25
  | 'DATE_BETWEEN';
26
26
 
27
+ /**
28
+ * Represents a function type for fetching options based on query parameters.
29
+ *
30
+ * @template T - The type of query parameters, extending `QueryParams`. Defaults to `any`.
31
+ *
32
+ * This function can have one of the following signatures:
33
+ * - A synchronous function that takes query parameters and returns an array of `Option` objects.
34
+ * - An asynchronous function that takes query parameters and returns a `Promise` resolving to an array of `Option` objects.
35
+ * - An asynchronous function that takes query parameters and returns a `Promise` resolving to an `AxiosResponse` containing a `FetchOptionResponse` object.
36
+ *
37
+ * @param args - The query parameters of type `T` used to fetch the options.
38
+ * @returns One of the following:
39
+ * - An array of `Option` objects.
40
+ * - A `Promise` resolving to an array of `Option` objects.
41
+ * - A `Promise` resolving to an `AxiosResponse` containing a `FetchOptionResponse` object.
42
+ */
43
+ export type FetchOptionFn<T extends QueryParams = any> =
44
+ | ((args: T) => Option[])
45
+ | ((args: T) => Promise<Option[]>)
46
+ | ((args: T) => Promise<AxiosResponse<FetchOptionResponse<T>>>);
47
+
27
48
  // More specific filter field types
28
49
  export interface MultiSelectFilterField extends MultiSelectProps {
29
50
  type: 'multiselect';
@@ -37,14 +58,7 @@ export interface MultiSelectFilterField extends MultiSelectProps {
37
58
  field: string;
38
59
  optionField?: string; // @example - actionOptions
39
60
  params?: QueryParams; // Additional QueryParams for the fetchOptionFn
40
-
41
- /**
42
- * @param args - The query parameters to be passed to the fetchOptionFn.
43
- */
44
- fetchOptionFn?:
45
- | ((args?: any) => Option[] | undefined) // Sync function to fetch options
46
- | ((args?: any) => Promise<Option[] | undefined>) // Async function
47
- | ((args?: any) => Promise<AxiosResponse<FetchOptionResponse<any>>>); // The service method handle fetching options
61
+ fetchOptionFn?: FetchOptionFn;
48
62
  }
49
63
 
50
64
  export interface DropdownFilterField extends DropdownProps {
@@ -59,9 +73,7 @@ export interface DropdownFilterField extends DropdownProps {
59
73
  field: string;
60
74
  optionField?: string; // @example - actionOptions
61
75
  params?: QueryParams; // Additional QueryParams for the fetchOptionFn
62
- fetchOptionFn?:
63
- | ((args?: any) => Option[] | undefined) // Sync function to fetch options
64
- | ((args?: any) => Promise<Option[]> | undefined); // Async function
76
+ fetchOptionFn?: FetchOptionFn;
65
77
  }
66
78
 
67
79
  export interface RangeNumberFilterField extends InputRangeNumberProps {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fewangsit/wangsvue-fats",
3
- "version": "1.0.0-alpha.115",
3
+ "version": "1.0.0-alpha.117",
4
4
  "author": "Wangsit FE Developer",
5
5
  "description": "Fixed Asset Tagsamurai VueJS Component Library",
6
6
  "type": "module",