ax-libs 0.0.2 → 0.0.3
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/ax-lib.js
CHANGED
|
@@ -20237,7 +20237,7 @@ function U6(e = {}) {
|
|
|
20237
20237
|
button: () => de(a)
|
|
20238
20238
|
});
|
|
20239
20239
|
}
|
|
20240
|
-
}), { setForm: n, ...u, buttonApi: l, fieldsApi: r }];
|
|
20240
|
+
}), { setForm: n, ...u, buttonApi: l, fieldsApi: r, requestApi: s }];
|
|
20241
20241
|
}
|
|
20242
20242
|
const ZT = { class: "ax-table" }, QT = {
|
|
20243
20243
|
key: 0,
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { AxFormProps, AxFormOptions, AxFormItemOptions } from '../../ui/form';
|
|
2
|
+
import { FetchApi, FetchOptions, FormApi, ListApi, RequestFetch, StateApi } from '..';
|
|
3
|
+
import { FieldsConfig } from '../common/useComponentPool.ts';
|
|
4
|
+
import { Component } from 'vue';
|
|
5
|
+
import { AxButtonOptions } from '../../ui/button';
|
|
6
|
+
export interface FormOptions<T extends Record<string, any>, R = any> extends Partial<AxFormOptions<T>> {
|
|
7
|
+
fieldsConfig?: FieldsConfig<AxFormItemOptions<T>>;
|
|
8
|
+
buttonsConfig?: FieldsConfig<AxButtonOptions>;
|
|
9
|
+
apiConfig?: FetchOptions<T, R>;
|
|
10
|
+
api?: RequestFetch<T, R>;
|
|
11
|
+
}
|
|
12
|
+
type UseAxFormReturn<T extends Record<string, any>, R = any> = readonly [
|
|
13
|
+
Component,
|
|
14
|
+
{
|
|
15
|
+
setForm: StateApi<AxFormProps>;
|
|
16
|
+
fieldsApi: ListApi<AxFormItemOptions<T>>;
|
|
17
|
+
buttonApi: ListApi<AxButtonOptions>;
|
|
18
|
+
requestApi: FetchApi<T, R>;
|
|
19
|
+
} & FormApi
|
|
20
|
+
];
|
|
21
|
+
export declare function useAxForm<T extends Record<string, any>, R = any>(options?: FormOptions<T, R>): UseAxFormReturn<T, R>;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { AxFormModalOptions, AxFormModalProps } from '../../ui/modal';
|
|
2
|
+
import { FetchApi, ListApi, StateApi } from '..';
|
|
3
|
+
import { Component } from 'vue';
|
|
4
|
+
import { AxButtonOptions } from '../../ui/button';
|
|
5
|
+
import { AxFormItemOptions } from '../../ui/form';
|
|
6
|
+
import { useAxFormExpose } from './exposed/useFormExposed.ts';
|
|
7
|
+
export type FormApi = ReturnType<typeof useAxFormExpose>;
|
|
8
|
+
type UseAxFormModalReturn<T extends Record<string, any>, R = any> = readonly [
|
|
9
|
+
Component,
|
|
10
|
+
{
|
|
11
|
+
setModal: StateApi<AxFormModalProps>;
|
|
12
|
+
fieldsApi: ListApi<AxFormItemOptions<T>>;
|
|
13
|
+
buttonApi: ListApi<AxButtonOptions>;
|
|
14
|
+
requestApi: FetchApi<T, R>;
|
|
15
|
+
close?: () => void;
|
|
16
|
+
open: () => void;
|
|
17
|
+
} & FormApi
|
|
18
|
+
];
|
|
19
|
+
export declare function useAxFormModal<T extends Record<string, any>, R = any>(options?: AxFormModalOptions<T, R>): UseAxFormModalReturn<T, R>;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Component } from 'vue';
|
|
2
|
+
import { AxTableOptions, AxTableProps, AxTableColumnProps, AxTableSelectOptions, AxTablePageProps } from '../../ui/table';
|
|
3
|
+
import { FormApi, ListApi, StateApi } from '..';
|
|
4
|
+
import { AxFormItemOptions } from '../../ui/form';
|
|
5
|
+
import { AxButtonOptions } from '../../ui/button';
|
|
6
|
+
import { useTableExposed } from './exposed/useTableExposed.ts';
|
|
7
|
+
export type TableApi = ReturnType<typeof useTableExposed>;
|
|
8
|
+
type UseAxTableReturn<P extends Record<string, any>> = readonly [
|
|
9
|
+
Component,
|
|
10
|
+
{
|
|
11
|
+
columnsApi: ListApi<AxTableColumnProps>;
|
|
12
|
+
formApi: FormApi;
|
|
13
|
+
setSearchForm: StateApi<AxTableSelectOptions<P>>;
|
|
14
|
+
setTable: StateApi<AxTableProps>;
|
|
15
|
+
fieldsApi: ListApi<AxFormItemOptions<P>>;
|
|
16
|
+
buttonsApi: ListApi<AxButtonOptions>;
|
|
17
|
+
setPage: StateApi<AxTablePageProps>;
|
|
18
|
+
} & TableApi
|
|
19
|
+
];
|
|
20
|
+
export declare function useAxTable<T extends Record<string, any>, P extends Record<string, any>>(options?: AxTableOptions<T, P>): UseAxTableReturn<P>;
|
|
21
|
+
export {};
|
|
@@ -9,10 +9,10 @@ export interface AxTableProps<T extends Record<string, any> = any> extends Parti
|
|
|
9
9
|
api?: RequestFetch<any, T[] | PageData<T>>;
|
|
10
10
|
apiConfig?: FetchOptions<any, T[] | PageData<T>>;
|
|
11
11
|
}
|
|
12
|
-
export type AxTableOptions<T extends Record<string, any
|
|
12
|
+
export type AxTableOptions<T extends Record<string, any>, P extends Record<string, any>> = Partial<AxTableProps<T>> & {
|
|
13
13
|
columnsConfig?: FieldsConfig<AxTableColumnProps>;
|
|
14
14
|
pageConfig?: AxTablePageProps;
|
|
15
|
-
searchForm?: AxTableSelectOptions<
|
|
15
|
+
searchForm?: AxTableSelectOptions<P>;
|
|
16
16
|
toolConfig?: FieldsConfig<AxButtonOptions>;
|
|
17
17
|
onScroll?: ((...args: T[]) => any) | undefined;
|
|
18
18
|
onSelect?: ((...args: T[]) => any) | undefined;
|