ax-libs 0.0.2 → 0.0.4
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.css +1 -1
- package/dist/ax-lib.js +3516 -3422
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/style/useDark.d.ts +1 -0
- package/dist/hooks/style/useTheme.d.ts +1 -0
- package/dist/hooks/ui/useAxForm.d.ts +22 -0
- package/dist/hooks/ui/useAxFormModal.d.ts +20 -0
- package/dist/hooks/ui/useAxTable.d.ts +21 -0
- package/dist/ui/form/components/form/form.vue.d.ts +1 -1
- package/dist/ui/modal/components/modal/modal.vue.d.ts +1 -1
- package/dist/ui/table/components/table/props.d.ts +2 -2
- package/dist/utils/ui.d.ts +2 -1
- package/package.json +2 -1
package/dist/hooks/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useDark(): readonly [import('vue').Ref<boolean, boolean>, import('..').StateApi<boolean>];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useTheme(_color: string): readonly [import('vue').Ref<string, string>, import('..').StateApi<string>];
|
|
@@ -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 {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FormInstance } from 'element-plus';
|
|
2
|
-
import { AxFormProps } from '
|
|
2
|
+
import { AxFormProps } from '../../..';
|
|
3
3
|
declare const __VLS_export: <T extends Record<string, any>>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
4
4
|
props: import('vue').PublicProps & __VLS_PrettifyLocal<AxFormProps & {
|
|
5
5
|
onSubmit?: ((data: T) => any) | undefined;
|
|
@@ -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;
|
package/dist/utils/ui.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare const changeDark: (bool: boolean) => void;
|
|
2
|
+
export declare const changeTheme: (color?: string) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ax-libs",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"module": "./dist/ax-lib.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"private": false,
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@element-plus/icons-vue": "^2.3.2",
|
|
32
32
|
"axios": "^1.16.0",
|
|
33
|
+
"colord": "^2.9.3",
|
|
33
34
|
"element-plus": "^2.13.7",
|
|
34
35
|
"lodash": "^4.18.1",
|
|
35
36
|
"mitt": "^3.0.1",
|