ax-libs 0.0.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.
Files changed (73) hide show
  1. package/README.md +5 -0
  2. package/dist/api/basic/controller/BaseController.d.ts +8 -0
  3. package/dist/api/basic/controller/MenuController.d.ts +6 -0
  4. package/dist/api/basic/controller/UserController.d.ts +8 -0
  5. package/dist/api/basic/entity/Menu.d.ts +22 -0
  6. package/dist/api/basic/entity/Role.d.ts +10 -0
  7. package/dist/api/basic/entity/Tenant.d.ts +10 -0
  8. package/dist/api/basic/entity/User.d.ts +19 -0
  9. package/dist/api/basic/entity/dto/Account.d.ts +8 -0
  10. package/dist/api/basic/entity/vo/UserInfo.d.ts +11 -0
  11. package/dist/api/common/BaseData.d.ts +13 -0
  12. package/dist/api/common/Result.d.ts +6 -0
  13. package/dist/ax-lib.css +1 -0
  14. package/dist/ax-lib.js +20592 -0
  15. package/dist/hooks/common/useComponentPool.d.ts +28 -0
  16. package/dist/hooks/common/useDefineProps.d.ts +3 -0
  17. package/dist/hooks/core/useFetch.d.ts +28 -0
  18. package/dist/hooks/core/useList.d.ts +71 -0
  19. package/dist/hooks/core/useState.d.ts +7 -0
  20. package/dist/hooks/index.d.ts +12 -0
  21. package/dist/hooks/ui/exposed/useFormExposed.d.ts +11 -0
  22. package/dist/hooks/ui/exposed/useTableExposed.d.ts +15 -0
  23. package/dist/hooks/ui/useAxButon.d.ts +4 -0
  24. package/dist/hooks/ui/useAxModal.d.ts +8 -0
  25. package/dist/index.d.ts +4 -0
  26. package/dist/plugin/index.d.ts +1 -0
  27. package/dist/plugin/ui.d.ts +10 -0
  28. package/dist/test/main.d.ts +0 -0
  29. package/dist/ui/button/components/button/button.vue.d.ts +25 -0
  30. package/dist/ui/button/components/button/index.d.ts +29 -0
  31. package/dist/ui/button/components/button/props.d.ts +15 -0
  32. package/dist/ui/button/components/fields/index.d.ts +1 -0
  33. package/dist/ui/button/index.d.ts +3 -0
  34. package/dist/ui/button/util/index.d.ts +3 -0
  35. package/dist/ui/form/components/fields/index.d.ts +1 -0
  36. package/dist/ui/form/components/form/form.vue.d.ts +35 -0
  37. package/dist/ui/form/components/form/index.d.ts +57 -0
  38. package/dist/ui/form/components/form/props.d.ts +14 -0
  39. package/dist/ui/form/components/form-item/form-item.vue.d.ts +21 -0
  40. package/dist/ui/form/components/form-item/index.d.ts +39 -0
  41. package/dist/ui/form/components/form-item/props.d.ts +14 -0
  42. package/dist/ui/form/index.d.ts +4 -0
  43. package/dist/ui/form/util/index.d.ts +8 -0
  44. package/dist/ui/index.d.ts +4 -0
  45. package/dist/ui/modal/components/form-modal/form-modal.vue.d.ts +38 -0
  46. package/dist/ui/modal/components/form-modal/index.d.ts +98 -0
  47. package/dist/ui/modal/components/form-modal/props.d.ts +25 -0
  48. package/dist/ui/modal/components/modal/index.d.ts +47 -0
  49. package/dist/ui/modal/components/modal/modal.vue.d.ts +26 -0
  50. package/dist/ui/modal/components/modal/props.d.ts +20 -0
  51. package/dist/ui/modal/index.d.ts +3 -0
  52. package/dist/ui/modal/util/index.d.ts +1 -0
  53. package/dist/ui/table/components/table/index.d.ts +105 -0
  54. package/dist/ui/table/components/table/props.d.ts +36 -0
  55. package/dist/ui/table/components/table/table.vue.d.ts +39 -0
  56. package/dist/ui/table/components/table-column/index.d.ts +3 -0
  57. package/dist/ui/table/components/table-column/props.d.ts +3 -0
  58. package/dist/ui/table/components/table-column/table-column.vue.d.ts +4 -0
  59. package/dist/ui/table/components/table-page/index.d.ts +5 -0
  60. package/dist/ui/table/components/table-page/props.d.ts +5 -0
  61. package/dist/ui/table/components/table-page/table-page.vue.d.ts +4 -0
  62. package/dist/ui/table/components/table-select/index.d.ts +69 -0
  63. package/dist/ui/table/components/table-select/props.d.ts +18 -0
  64. package/dist/ui/table/components/table-select/table-select.vue.d.ts +44 -0
  65. package/dist/ui/table/index.d.ts +4 -0
  66. package/dist/ui/table/util/index.d.ts +1 -0
  67. package/dist/utils/bus.d.ts +1 -0
  68. package/dist/utils/index.d.ts +5 -0
  69. package/dist/utils/object.d.ts +16 -0
  70. package/dist/utils/request.d.ts +12 -0
  71. package/dist/utils/type.d.ts +19 -0
  72. package/dist/utils/ui.d.ts +1 -0
  73. package/package.json +45 -0
@@ -0,0 +1,28 @@
1
+ import { Component } from 'vue';
2
+ import { ListConfig } from '..';
3
+ export interface ComponentPool<T> {
4
+ source?: T[];
5
+ className?: string;
6
+ }
7
+ export interface FieldsConfig<T extends Record<string, any>> extends ListConfig<T> {
8
+ fields: T[];
9
+ className?: string;
10
+ }
11
+ export declare function useComponentPool<T extends Record<string, any>>(component: Component, options?: FieldsConfig<T>): readonly [import('vue').DefineComponent<{}, (() => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
12
+ [key: string]: any;
13
+ }>) | (() => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
14
+ [key: string]: any;
15
+ }>[]), {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>, {
16
+ readonly config: import('..').StateApi<ListConfig<T>>;
17
+ readonly source: (source: T[]) => void;
18
+ readonly add: (data: T) => void;
19
+ readonly set: (data: import('ts-essentials').DeepPartial<import('..').ListItem<T>>, key: number | T[keyof T]) => boolean;
20
+ readonly get: (key: number | T[keyof T]) => import('..').ListItem<T> | null;
21
+ readonly hide: (key: number | T[keyof T]) => boolean;
22
+ readonly del: (key: number | T[keyof T]) => boolean;
23
+ readonly remove: (key: number | T[keyof T]) => boolean;
24
+ readonly expand: (bool?: boolean) => void;
25
+ readonly configInfo: () => ListConfig<T>;
26
+ readonly setClass: import('..').StateApi<string | undefined>;
27
+ readonly getList: () => import('..').ListItem<T>[];
28
+ }];
@@ -0,0 +1,3 @@
1
+ export declare function useDefineProps<T extends Record<string, any> = any>(props: T, defaultProps?: Partial<T>): import('vue').ComputedRef<Partial<T> & {
2
+ [k: string]: any;
3
+ }>;
@@ -0,0 +1,28 @@
1
+ import { Result } from '../../utils';
2
+ import { StateApi } from '..';
3
+ import { Ref } from 'vue';
4
+ export type RequestFetch<P, R> = ((params: P) => Promise<Result<R>>) | (() => Promise<Result<R>>) | null;
5
+ export interface FetchOptions<T, R> {
6
+ params?: T;
7
+ beforeFetch?: (params: T) => T;
8
+ success?: (data: Result<R>) => void;
9
+ fail?: (data: Result<any>) => void;
10
+ error?: (err: any) => void;
11
+ loading?: boolean;
12
+ immediate?: boolean;
13
+ }
14
+ export interface FetchApi<P, R> {
15
+ /** 响应式的配置对象,支持读取和修改配置 */
16
+ readonly setConfig: StateApi<FetchOptions<P, R>>;
17
+ /** 动态替换或设置当前的请求 API 函数 */
18
+ readonly setApi: StateApi<RequestFetch<P, R>>;
19
+ /** 手动发起网络请求,可传入局部参数进行合并 */
20
+ readonly load: (params?: P) => Promise<any>;
21
+ /** 获取当前完整的配置信息 */
22
+ readonly getConfig: () => FetchOptions<P, R>;
23
+ readonly get: () => any;
24
+ readonly getReady: () => boolean;
25
+ readonly setParams: (data: P, load?: boolean) => void;
26
+ readonly reload: () => void;
27
+ }
28
+ export declare function useFetch<P, R>(request: RequestFetch<P, R>, options?: FetchOptions<P, R>): [Ref<any>, FetchApi<P, R>];
@@ -0,0 +1,71 @@
1
+ import { StateApi } from '..';
2
+ import { ComputedRef } from 'vue';
3
+ import { DeepPartial } from 'ts-essentials';
4
+ /**
5
+ * 列表项的基础类型
6
+ * @template T - 原始数据的类型,必须继承自 Record<string, any>
7
+ * @description 在原始数据类型 T 的基础上,扩展了内部使用的 _key(唯一标识)和 _hidden(显隐状态)属性
8
+ */
9
+ export type ListItem<T extends Record<string, any>> = T & {
10
+ _key: keyof T | number;
11
+ _hidden: boolean;
12
+ };
13
+ /**
14
+ * useList 组合式函数的配置项接口
15
+ * @template T - 列表数据的类型
16
+ */
17
+ export interface ListConfig<T extends Record<string, any>> {
18
+ /** 指定作为唯一标识的字段名,若不指定则使用内部自增计数 */
19
+ key?: keyof T;
20
+ /** 列表展示的截断数量,配合 expand 使用 */
21
+ over?: number;
22
+ /** 是否默认展开全部列表 */
23
+ expand?: boolean;
24
+ /**
25
+ * 移除策略:
26
+ * 'if' - 物理删除(从数组中移除)
27
+ * 'show' - 视觉隐藏(仅标记 _hidden 为 true)
28
+ */
29
+ strategy?: 'if' | 'show';
30
+ }
31
+ /**
32
+ * useList 组合式函数对外暴露的 API 接口
33
+ * @template T - 列表数据的类型
34
+ */
35
+ export interface ListApi<T extends Record<string, any>> {
36
+ /** 更新列表配置 */
37
+ readonly config: StateApi<ListConfig<T>>;
38
+ /** 重置或替换整个列表的数据源 */
39
+ readonly source: (source: T[]) => void;
40
+ /** 向列表中添加一项 */
41
+ readonly add: (data: T) => void;
42
+ /** 根据 key 更新列表中的某一项(深度合并) */
43
+ readonly set: (data: DeepPartial<ListItem<T>>, key: number | T[keyof T]) => boolean;
44
+ /** 根据 key 获取列表中的某一项原始数据 */
45
+ readonly get: (key: number | T[keyof T]) => ListItem<T> | null;
46
+ /** 根据 key 隐藏列表中的某一项(仅修改 _hidden 状态) */
47
+ readonly hide: (key: number | T[keyof T]) => boolean;
48
+ /** 根据 key 物理删除列表中的某一项 */
49
+ readonly del: (key: number | T[keyof T]) => boolean;
50
+ /** 根据配置的 strategy 策略移除某一项(物理删除或视觉隐藏) */
51
+ readonly remove: (key: number | T[keyof T]) => boolean;
52
+ /** 切换或设置列表的展开/收起状态 */
53
+ readonly expand: (bool?: boolean) => void;
54
+ /** 获取当前列表的配置信息 */
55
+ readonly configInfo: () => ListConfig<T>;
56
+ }
57
+ /**
58
+ * useList 组合式函数的返回值类型定义
59
+ * @template T - 列表数据的类型
60
+ */
61
+ export type UseListResult<T extends Record<string, any>> = [ComputedRef<ListItem<T>[]>, ListApi<T>];
62
+ /**
63
+ * 强大的 Vue3 列表管理组合式函数
64
+ * @template T - 列表数据的类型,必须继承自 Record<string, any>
65
+ * @param {T[]} [_source=[]] - 初始化的列表数据数组
66
+ * @param {ListConfig<T>} [options={}] - 列表的配置项
67
+ * @returns {UseListResult<T>} 返回一个元组,包含响应式的 list 和一系列操作方法
68
+ * @example
69
+ * const [list, { add, del, set }] = useList([{ id: 1, name: 'A' }], { key: 'id' });
70
+ */
71
+ export declare function useList<T extends Record<string, any>>(_source?: T[], options?: ListConfig<T>): UseListResult<T>;
@@ -0,0 +1,7 @@
1
+ import { Ref } from 'vue';
2
+ export type StateApi<T> = (data: T, write?: boolean) => void;
3
+ export type StateResult<T> = [
4
+ Ref<T>,
5
+ StateApi<T>
6
+ ];
7
+ export declare function useState<T>(initialState: T): StateResult<T>;
@@ -0,0 +1,12 @@
1
+ export * from './core/useState';
2
+ export * from './core/useList';
3
+ export * from './core/useFetch';
4
+ export * from './ui/useAxButon';
5
+ export * from './ui/useAxModal';
6
+ export * from './ui/useAxFormModal';
7
+ export * from './ui/useAxTable';
8
+ export * from './ui/useAxForm';
9
+ export * from './common/useComponentPool';
10
+ export * from './common/useDefineProps';
11
+ export * from './ui/exposed/useFormExposed';
12
+ export * from './ui/exposed/useTableExposed.ts';
@@ -0,0 +1,11 @@
1
+ import { Ref } from 'vue';
2
+ import { AxFormInstance } from '../../../ui/form';
3
+ export declare function useAxFormExpose<T>(form: Ref<AxFormInstance>): {
4
+ getValues: () => T;
5
+ getFlForm: () => import('element-plus').FormInstance | undefined;
6
+ getFields: () => (keyof T)[];
7
+ getDefaultValues: () => {} & Record<string, any>;
8
+ setValues: (data: Partial<T>) => void;
9
+ resetValues: () => void;
10
+ clearValues: () => void;
11
+ };
@@ -0,0 +1,15 @@
1
+ import { Ref } from 'vue';
2
+ import { AxTableInstance } from '../../../ui/table';
3
+ import { FetchOptions, RequestFetch } from '../..';
4
+ import { PageData } from '../../../utils';
5
+ export declare function useTableExposed<P, R>(table: Ref<AxTableInstance>): {
6
+ load: (params?: P) => void;
7
+ setConfig: (config: FetchOptions<P, R[] | PageData<R>>) => void;
8
+ setApi: (api: RequestFetch<P, R[] | PageData<R>>) => void;
9
+ getConfig: () => FetchOptions<P, R>;
10
+ get: () => any;
11
+ getReady: () => boolean;
12
+ setParams: (data: P, load?: boolean) => void;
13
+ getElTable: () => import('element-plus').TableInstance | undefined;
14
+ reload: () => void;
15
+ };
@@ -0,0 +1,4 @@
1
+ import { AxButtonOptions } from '../../ui/button';
2
+ export declare function useAxButon(options?: AxButtonOptions): readonly [import('vue').DefineComponent<{}, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
3
+ [key: string]: any;
4
+ }>, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>, import('..').StateApi<AxButtonOptions>];
@@ -0,0 +1,8 @@
1
+ import { AxModalOptions } from '../../ui/modal';
2
+ export declare function useAxModal(options?: AxModalOptions): readonly [import('vue').DefineComponent<{}, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
3
+ [key: string]: any;
4
+ }>, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>, {
5
+ readonly setModal: import('..').StateApi<import('lodash').Omit<AxModalOptions, "slot" | "buttonConfig">>;
6
+ readonly close: () => void;
7
+ readonly open: () => void;
8
+ }];
@@ -0,0 +1,4 @@
1
+ export * from './ui';
2
+ export * from './plugin';
3
+ export * from './hooks';
4
+ export * from './utils';
@@ -0,0 +1 @@
1
+ export * from './ui';
@@ -0,0 +1,10 @@
1
+ import { App } from 'vue';
2
+ export declare const buttonPlugin: {
3
+ install(): void;
4
+ };
5
+ export declare const formPlugin: {
6
+ install(): void;
7
+ };
8
+ export declare const axUI: {
9
+ install(app: App): void;
10
+ };
File without changes
@@ -0,0 +1,25 @@
1
+ import { AxButtonProps } from '../../..';
2
+ import { ButtonProps } from 'element-plus';
3
+ declare const __VLS_export: <T = ButtonProps>(__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
+ props: import('vue').PublicProps & __VLS_PrettifyLocal<AxButtonProps<T> & {
5
+ onClick?: (() => any) | undefined;
6
+ onDblclick?: (() => any) | undefined;
7
+ }> & (typeof globalThis extends {
8
+ __VLS_PROPS_FALLBACK: infer P;
9
+ } ? P : {});
10
+ expose: (exposed: {}) => void;
11
+ attrs: any;
12
+ slots: {
13
+ default?: (props: {}) => any;
14
+ };
15
+ emit: ((evt: "click") => void) & ((evt: "dblclick") => void);
16
+ }>) => import('vue').VNode & {
17
+ __ctx?: Awaited<typeof __VLS_setup>;
18
+ };
19
+ declare const _default: typeof __VLS_export;
20
+ export default _default;
21
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
22
+ [K in keyof T]: T[K];
23
+ } : {
24
+ [K in keyof T as K]: T[K];
25
+ }) & {};
@@ -0,0 +1,29 @@
1
+ export * from './props';
2
+ export declare const AxButton: <T = import('element-plus').ButtonProps>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: {
3
+ attrs: any;
4
+ emit: ((evt: "click") => void) & ((evt: "dblclick") => void);
5
+ slots: {
6
+ default?: (props: {}) => any;
7
+ };
8
+ }, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
9
+ props: import('vue').PublicProps & {
10
+ type?: string | undefined;
11
+ componentProps?: T | undefined;
12
+ text?: string | undefined;
13
+ auth?: string | undefined;
14
+ className?: string | undefined;
15
+ onClick?: (() => any) | undefined;
16
+ onDblclick?: (() => any) | undefined;
17
+ } & (typeof globalThis extends {
18
+ __VLS_PROPS_FALLBACK: infer P;
19
+ } ? P : {});
20
+ expose: (exposed: {}) => void;
21
+ attrs: any;
22
+ slots: {
23
+ default?: (props: {}) => any;
24
+ };
25
+ emit: ((evt: "click") => void) & ((evt: "dblclick") => void);
26
+ }>) => import('vue').VNode & {
27
+ __ctx?: Awaited<typeof __VLS_setup>;
28
+ };
29
+ export default AxButton;
@@ -0,0 +1,15 @@
1
+ import { ButtonProps } from 'element-plus';
2
+ import { EmitsToProps } from '../../../../utils';
3
+ export interface AxButtonProps<T = ButtonProps> {
4
+ type?: string;
5
+ componentProps?: T;
6
+ text?: string;
7
+ auth?: string;
8
+ className?: string;
9
+ }
10
+ export interface AxButtonEmits {
11
+ 'click': [];
12
+ 'dblclick': [];
13
+ }
14
+ export interface AxButtonOptions extends AxButtonProps, EmitsToProps<AxButtonEmits> {
15
+ }
@@ -0,0 +1 @@
1
+ export declare const initButtonFields: () => void;
@@ -0,0 +1,3 @@
1
+ export * from './components/fields';
2
+ export * from './components/button';
3
+ export * from './util';
@@ -0,0 +1,3 @@
1
+ import { Component } from 'vue';
2
+ export declare const buttonFields: Record<string, Component>;
3
+ export declare const addButtonField: (type: string, component: Component) => void;
@@ -0,0 +1 @@
1
+ export declare const initFormFields: () => void;
@@ -0,0 +1,35 @@
1
+ import { FormInstance } from 'element-plus';
2
+ import { AxFormProps } from './props';
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
+ props: import('vue').PublicProps & __VLS_PrettifyLocal<AxFormProps & {
5
+ onSubmit?: ((data: T) => any) | undefined;
6
+ onChange?: ((data: T) => any) | undefined;
7
+ }> & (typeof globalThis extends {
8
+ __VLS_PROPS_FALLBACK: infer P;
9
+ } ? P : {});
10
+ expose: (exposed: import('vue').ShallowUnwrapRef<{
11
+ getElForm: () => FormInstance | undefined;
12
+ getValues: () => T;
13
+ getFields: () => (keyof T)[];
14
+ getDefaultValues: () => {} & T;
15
+ setValues: (values: Partial<T>) => void;
16
+ resetValues: () => void;
17
+ clearValues: () => void;
18
+ }>) => void;
19
+ attrs: any;
20
+ slots: {
21
+ default?: (props: {}) => any;
22
+ } & {
23
+ button?: (props: {}) => any;
24
+ };
25
+ emit: ((evt: "submit", data: T) => void) & ((evt: "change", data: T) => void);
26
+ }>) => import('vue').VNode & {
27
+ __ctx?: Awaited<typeof __VLS_setup>;
28
+ };
29
+ declare const _default: typeof __VLS_export;
30
+ export default _default;
31
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
32
+ [K in keyof T]: T[K];
33
+ } : {
34
+ [K in keyof T as K]: T[K];
35
+ }) & {};
@@ -0,0 +1,57 @@
1
+ import { default as form } from './form.vue';
2
+ import { ComponentExposed } from 'vue-component-type-helpers';
3
+ export * from './props';
4
+ export type AxFormInstance = ComponentExposed<typeof form>;
5
+ export declare const AxForm: <T extends Record<string, any>>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: {
6
+ attrs: any;
7
+ emit: ((evt: "submit", data: T) => void) & ((evt: "change", data: T) => void);
8
+ slots: {
9
+ default?: (props: {}) => any;
10
+ } & {
11
+ button?: (props: {}) => any;
12
+ };
13
+ }, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
14
+ props: import('vue').PublicProps & {
15
+ isDefault?: boolean | undefined;
16
+ submitButton?: import('../../..').AxButtonProps | undefined;
17
+ loading?: boolean | undefined;
18
+ size?: import('element-plus').ComponentSize | undefined;
19
+ disabled?: boolean | undefined;
20
+ rules?: import('element-plus').FormRules | undefined;
21
+ labelPosition?: "left" | "right" | "top" | undefined;
22
+ requireAsteriskPosition?: "left" | "right" | undefined;
23
+ labelWidth?: string | number | undefined;
24
+ labelSuffix?: string | undefined;
25
+ inline?: boolean | undefined;
26
+ inlineMessage?: boolean | undefined;
27
+ statusIcon?: boolean | undefined;
28
+ showMessage?: boolean | undefined;
29
+ validateOnRuleChange?: boolean | undefined;
30
+ hideRequiredAsterisk?: boolean | undefined;
31
+ scrollToError?: boolean | undefined;
32
+ scrollIntoViewOptions?: (ScrollIntoViewOptions | boolean) | undefined;
33
+ onSubmit?: ((data: T) => any) | undefined;
34
+ onChange?: ((data: T) => any) | undefined;
35
+ } & (typeof globalThis extends {
36
+ __VLS_PROPS_FALLBACK: infer P;
37
+ } ? P : {});
38
+ expose: (exposed: import('vue').ShallowUnwrapRef<{
39
+ getElForm: () => import('element-plus').FormInstance | undefined;
40
+ getValues: () => T;
41
+ getFields: () => (keyof T)[];
42
+ getDefaultValues: () => {} & T;
43
+ setValues: (values: Partial<T>) => void;
44
+ resetValues: () => void;
45
+ clearValues: () => void;
46
+ }>) => void;
47
+ attrs: any;
48
+ slots: {
49
+ default?: (props: {}) => any;
50
+ } & {
51
+ button?: (props: {}) => any;
52
+ };
53
+ emit: ((evt: "submit", data: T) => void) & ((evt: "change", data: T) => void);
54
+ }>) => import('vue').VNode & {
55
+ __ctx?: Awaited<typeof __VLS_setup>;
56
+ };
57
+ export default AxForm;
@@ -0,0 +1,14 @@
1
+ import { FormProps } from 'element-plus';
2
+ import { AxButtonProps } from '../../../button';
3
+ import { EmitsToProps } from '../../../../utils';
4
+ export interface AxFormProps extends Omit<FormProps, 'model'> {
5
+ isDefault?: boolean;
6
+ submitButton?: AxButtonProps;
7
+ loading?: boolean;
8
+ }
9
+ export interface AxFormEmits<T> {
10
+ 'submit': [data: T];
11
+ 'change': [data: T];
12
+ }
13
+ export interface AxFormOptions<T> extends AxFormProps, EmitsToProps<AxFormEmits<T>> {
14
+ }
@@ -0,0 +1,21 @@
1
+ import { AxFormItemProps } from './props';
2
+ 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<{
3
+ props: import('vue').PublicProps & __VLS_PrettifyLocal<AxFormItemProps<T>> & (typeof globalThis extends {
4
+ __VLS_PROPS_FALLBACK: infer P;
5
+ } ? P : {});
6
+ expose: (exposed: {}) => void;
7
+ attrs: any;
8
+ slots: {
9
+ [x: string]: ((props: {}) => any) | undefined;
10
+ };
11
+ emit: {};
12
+ }>) => import('vue').VNode & {
13
+ __ctx?: Awaited<typeof __VLS_setup>;
14
+ };
15
+ declare const _default: typeof __VLS_export;
16
+ export default _default;
17
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
18
+ [K in keyof T]: T[K];
19
+ } : {
20
+ [K in keyof T as K]: T[K];
21
+ }) & {};
@@ -0,0 +1,39 @@
1
+ export declare const AxFormItem: <T extends Record<string, any>>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: {
2
+ attrs: any;
3
+ emit: {};
4
+ slots: {
5
+ [x: string]: ((props: {}) => any) | undefined;
6
+ };
7
+ }, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
8
+ props: import('vue').PublicProps & {
9
+ fieldName: keyof T;
10
+ type?: string | undefined;
11
+ defaultValue?: any;
12
+ vtypes?: string[] | undefined;
13
+ label?: string | undefined;
14
+ componentProps?: Record<string, any> | undefined;
15
+ placeholder?: string | undefined;
16
+ size?: import('element-plus').ComponentSize | undefined;
17
+ validateStatus?: import('element-plus').FormItemValidateState | undefined;
18
+ required?: boolean | undefined;
19
+ rules?: import('element-plus/es/utils/typescript.mjs').Arrayable<import('element-plus').FormItemRule> | undefined;
20
+ labelPosition?: "left" | "right" | "top" | "" | undefined;
21
+ labelWidth?: string | number | undefined;
22
+ inlineMessage?: boolean | undefined;
23
+ showMessage?: boolean | undefined;
24
+ error?: string | undefined;
25
+ for?: string | undefined;
26
+ } & (typeof globalThis extends {
27
+ __VLS_PROPS_FALLBACK: infer P;
28
+ } ? P : {});
29
+ expose: (exposed: {}) => void;
30
+ attrs: any;
31
+ slots: {
32
+ [x: string]: ((props: {}) => any) | undefined;
33
+ };
34
+ emit: {};
35
+ }>) => import('vue').VNode & {
36
+ __ctx?: Awaited<typeof __VLS_setup>;
37
+ };
38
+ export default AxFormItem;
39
+ export * from './props';
@@ -0,0 +1,14 @@
1
+ import { FormItemProps, InputEmits, SelectEmits, CheckboxEmits, RadioEmits, CalendarEmits, CascaderEmits } from 'element-plus';
2
+ import { EmitsToProps } from '../../../../utils';
3
+ export interface AxFormItemProps<T extends Record<string, any>> extends Omit<FormItemProps, 'prop'> {
4
+ fieldName: keyof T;
5
+ type?: string;
6
+ defaultValue?: any;
7
+ vtypes?: string[];
8
+ label?: string;
9
+ componentProps?: Record<string, any>;
10
+ placeholder?: string;
11
+ }
12
+ export type AxFormItemEmits = RadioEmits & CascaderEmits & InputEmits & SelectEmits & CheckboxEmits & CalendarEmits;
13
+ export interface AxFormItemOptions<T extends Record<string, any>> extends AxFormItemProps<T>, EmitsToProps<AxFormItemEmits> {
14
+ }
@@ -0,0 +1,4 @@
1
+ export * from './components/fields';
2
+ export * from './components/form';
3
+ export * from './components/form-item';
4
+ export * from './util';
@@ -0,0 +1,8 @@
1
+ import { Component } from 'vue';
2
+ import { FormItemRule } from 'element-plus';
3
+ export type VFormItemRule = FormItemRule | (() => FormItemRule) | ((type: string, label?: string) => FormItemRule);
4
+ export declare const formFields: Record<string, Component>;
5
+ export declare const formRules: Record<string, VFormItemRule>;
6
+ export declare const addFormFields: (type: string, component: Component) => void;
7
+ export declare const addFormRules: (type: string, rule: any) => void;
8
+ export declare const isTip: (type: string) => "请选择" | "请输入";
@@ -0,0 +1,4 @@
1
+ export * from './button';
2
+ export * from './form';
3
+ export * from './modal';
4
+ export * from './table';
@@ -0,0 +1,38 @@
1
+ import { DrawerInstance } from 'element-plus';
2
+ import { AxFormModalProps } from './props';
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
+ props: import('vue').PublicProps & __VLS_PrettifyLocal<AxFormModalProps & {
5
+ onChange?: ((data: T) => any) | undefined;
6
+ "onUpdate:open"?: ((data: boolean) => any) | undefined;
7
+ onConfirm?: ((data: T) => any) | undefined;
8
+ }> & (typeof globalThis extends {
9
+ __VLS_PROPS_FALLBACK: infer P;
10
+ } ? P : {});
11
+ expose: (exposed: import('vue').ShallowUnwrapRef<{
12
+ getValues: () => T;
13
+ getFlForm: () => import('element-plus').FormInstance | undefined;
14
+ getFields: () => (keyof T)[];
15
+ getDefaultValues: () => {} & Record<string, any>;
16
+ setValues: (data: Partial<T>) => void;
17
+ resetValues: () => void;
18
+ clearValues: () => void;
19
+ getModal: () => DrawerInstance | undefined;
20
+ close: () => void;
21
+ }>) => void;
22
+ attrs: any;
23
+ slots: {
24
+ default?: (props: {}) => any;
25
+ } & {
26
+ footer?: (props: {}) => any;
27
+ };
28
+ emit: ((evt: "change", data: T) => void) & ((evt: "update:open", data: boolean) => void) & ((evt: "confirm", data: T) => void);
29
+ }>) => import('vue').VNode & {
30
+ __ctx?: Awaited<typeof __VLS_setup>;
31
+ };
32
+ declare const _default: typeof __VLS_export;
33
+ export default _default;
34
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
35
+ [K in keyof T]: T[K];
36
+ } : {
37
+ [K in keyof T as K]: T[K];
38
+ }) & {};