@ftjs/antd 0.3.0 → 0.4.0

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 (33) hide show
  1. package/dist/antd-table/ft-antd-table.vue.d.ts +65 -0
  2. package/dist/antd-table/index.d.ts +3 -0
  3. package/dist/antd-table/type.d.ts +55 -0
  4. package/dist/antd-table/use-edit.d.ts +14 -0
  5. package/dist/form/components/auto-complete.d.ts +1 -1
  6. package/dist/form/components/cascader.d.ts +1 -1
  7. package/dist/form/components/checkbox.d.ts +1 -1
  8. package/dist/form/components/date-picker.d.ts +1 -1
  9. package/dist/form/components/input-number.d.ts +1 -1
  10. package/dist/form/components/input.d.ts +1 -1
  11. package/dist/form/components/mentions.d.ts +1 -1
  12. package/dist/form/components/radio.d.ts +1 -1
  13. package/dist/form/components/range-picker.d.ts +1 -1
  14. package/dist/form/components/rate.d.ts +1 -1
  15. package/dist/form/components/select.d.ts +1 -1
  16. package/dist/form/components/slider.d.ts +1 -1
  17. package/dist/form/components/switch.d.ts +1 -1
  18. package/dist/form/components/textarea.d.ts +1 -1
  19. package/dist/form/components/tree-select.d.ts +1 -1
  20. package/dist/form/components/upload.d.ts +1 -1
  21. package/dist/form/define-form.d.ts +31 -98
  22. package/dist/form/form-content.vue.d.ts +17 -0
  23. package/dist/form/ft-antd-form-search.vue.d.ts +21 -0
  24. package/dist/form/ft-antd-form.vue.d.ts +20 -0
  25. package/dist/form/register.d.ts +13 -52
  26. package/dist/index.d.ts +3 -4
  27. package/dist/index.js +1033 -837
  28. package/dist/vxe-table/ft-vxe-table.vue.d.ts +94 -0
  29. package/dist/vxe-table/index.d.ts +2 -0
  30. package/dist/vxe-table/types.d.ts +51 -0
  31. package/package.json +2 -2
  32. package/dist/antd-table/define-table.d.ts +0 -139
  33. package/dist/vxe-table/define-vxe-table.d.ts +0 -114
@@ -0,0 +1,94 @@
1
+ import { FtVxeTableProps } from './types';
2
+ import { VxeGridInstance } from 'vxe-table';
3
+ declare const _default: <T extends Record<string, any>, S 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_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
4
+ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, never> & FtVxeTableProps<T, S> & Partial<{}>> & import('vue').PublicProps;
5
+ expose(exposed: import('vue').ShallowUnwrapRef<{
6
+ /**
7
+ * 搜索组件实例
8
+ */
9
+ searchRef: Readonly<import('vue').ShallowRef<import('vue').ShallowUnwrapRef<{
10
+ formInstance: import('vue').Ref<import('ant-design-vue').FormInstance | undefined, import('ant-design-vue').FormInstance | undefined>;
11
+ formData: import('vue').WritableComputedRef<any, any>;
12
+ resetToDefault: import('@ftjs/core').ResetToDefault;
13
+ getFormData: import('@ftjs/core').GetFormData<S>;
14
+ setAsDefault: import('@ftjs/core').SetAsDefault<S>;
15
+ }> | null>>;
16
+ /**
17
+ * 表格组件实例
18
+ */
19
+ gridRef: import('vue').Ref<VxeGridInstance<T> | undefined, VxeGridInstance<T> | undefined>;
20
+ /**
21
+ * 获取分页信息
22
+ */
23
+ getPagination(): {
24
+ page: number;
25
+ pageSize: number;
26
+ };
27
+ /**
28
+ * 获取搜索信息
29
+ */
30
+ getSearchInfo(): {};
31
+ }>): void;
32
+ attrs: any;
33
+ slots: {
34
+ [x: string]: ((props: {
35
+ [key: string]: any;
36
+ $table: import('vxe-table').VxeTableConstructor<any>;
37
+ $grid: import('vxe-table').VxeGridConstructor<any> | null | undefined;
38
+ rowid: string;
39
+ row: any;
40
+ rowIndex: number;
41
+ $rowIndex: number;
42
+ _rowIndex: number;
43
+ column: import("vxe-table").VxeTableDefines.ColumnInfo<any>;
44
+ columnIndex: number;
45
+ $columnIndex: number;
46
+ _columnIndex: number;
47
+ type: string;
48
+ fixed: import("vxe-table").VxeColumnPropTypes.Fixed;
49
+ checked?: boolean;
50
+ indeterminate?: boolean;
51
+ seq: string | number;
52
+ level: number;
53
+ isEdit: boolean;
54
+ isHidden: boolean;
55
+ visibleData: any[];
56
+ data: any[];
57
+ items: any[];
58
+ }) => any) | undefined;
59
+ [x: number]: ((props: {
60
+ [key: string]: any;
61
+ $table: import('vxe-table').VxeTableConstructor<any>;
62
+ $grid: import('vxe-table').VxeGridConstructor<any> | null | undefined;
63
+ rowid: string;
64
+ row: any;
65
+ rowIndex: number;
66
+ $rowIndex: number;
67
+ _rowIndex: number;
68
+ column: import("vxe-table").VxeTableDefines.ColumnInfo<any>;
69
+ columnIndex: number;
70
+ $columnIndex: number;
71
+ _columnIndex: number;
72
+ type: string;
73
+ fixed: import("vxe-table").VxeColumnPropTypes.Fixed;
74
+ checked?: boolean;
75
+ indeterminate?: boolean;
76
+ seq: string | number;
77
+ level: number;
78
+ isEdit: boolean;
79
+ isHidden: boolean;
80
+ visibleData: any[];
81
+ data: any[];
82
+ items: any[];
83
+ }) => any) | undefined;
84
+ pager?: ((props: {}) => any) | undefined;
85
+ loading?: ((props: {}) => any) | undefined;
86
+ };
87
+ emit: {};
88
+ }>) => import('vue').VNode & {
89
+ __ctx?: Awaited<typeof __VLS_setup>;
90
+ };
91
+ export default _default;
92
+ type __VLS_PrettifyLocal<T> = {
93
+ [K in keyof T]: T[K];
94
+ } & {};
@@ -0,0 +1,2 @@
1
+ export { default as FtVxeTable } from './ft-vxe-table.vue';
2
+ export * from './types';
@@ -0,0 +1,51 @@
1
+ import { FtBaseTableProps, FtTableColumn, ValueOf } from '@ftjs/core';
2
+ import { VxeGridProps, VxeGridPropTypes } from 'vxe-table';
3
+ import { FtAntdFormSearchProps } from '../form/define-form';
4
+ import { FtAntdFormColumn } from '../form/register';
5
+ import { EditMap } from '../antd-table/column-edit';
6
+ type ExtractType<T> = T extends {
7
+ type: infer U;
8
+ } ? U : never;
9
+ /**
10
+ * 列定义
11
+ */
12
+ type VxeTableColumn<T extends Record<string, any>, S extends Record<string, any>> = FtTableColumn<T, FtAntdFormColumn<S> | ExtractType<FtAntdFormColumn<S>>> & Omit<VxeGridPropTypes.Column<T>, "title" | "editRender"> & {
13
+ /**
14
+ * 行内编辑
15
+ */
16
+ edit?: keyof EditMap<T> | ValueOf<EditMap<T>>;
17
+ };
18
+ /**
19
+ * 内部表格 props
20
+ */
21
+ interface InternalVxeTableProps<TableData extends Record<string, any>> extends Omit<VxeGridProps<TableData>, "columns" | "minHeight"> {
22
+ }
23
+ export interface FtVxeTableProps<T extends Record<string, any>, S extends Record<string, any>> extends FtBaseTableProps<T, VxeTableColumn<T, S>, FtAntdFormColumn<S>> {
24
+ /**
25
+ * 是否初始化搜索
26
+ *
27
+ * @default true
28
+ */
29
+ initSearch?: boolean;
30
+ /**
31
+ * 是否自适应父元素(flex布局)剩余高度
32
+ *
33
+ * 如果为true,则table会占据父元素的剩余高度,此时可以通过 {@link minHeight} 控制最小高度,避免高度不够展示内容
34
+ * @default true
35
+ */
36
+ fitFlexHeight?: boolean;
37
+ /**
38
+ * 最小高度
39
+ * @default 310
40
+ */
41
+ minHeight?: number;
42
+ /**
43
+ * 是否隐藏分页
44
+ * @default false
45
+ */
46
+ hidePagination?: boolean;
47
+ internalTableProps?: InternalVxeTableProps<T>;
48
+ internalFormProps?: FtAntdFormSearchProps<S>;
49
+ onSearch: () => Promise<void> | void;
50
+ }
51
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ftjs/antd",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "keywords": [],
5
5
  "author": "",
6
6
  "license": "MIT",
@@ -30,7 +30,7 @@
30
30
  "vite": "^6.1.0",
31
31
  "vite-plugin-dts": "^4.5.0",
32
32
  "vue-tsc": "2.2.0",
33
- "@ftjs/core": "0.3.0"
33
+ "@ftjs/core": "0.4.0"
34
34
  },
35
35
  "peerDependencies": {
36
36
  "@ant-design/icons-vue": ">=7.0.0",
@@ -1,139 +0,0 @@
1
- import { ValueOf, FtTableColumn, FtTablePropsMap } from '@ftjs/core';
2
- import { Table, TableColumnType, TableProps as AntTableProps } from 'ant-design-vue';
3
- import { FormColumn, FormExposed } from '../form/register';
4
- import { ComponentSlots } from 'vue-component-type-helpers';
5
- import { EditMap } from './column-edit';
6
- declare module "@ftjs/core" {
7
- interface TableTypeMap<TableData extends Record<string, any>, SearchData extends Record<string, any> = TableData> {
8
- antd: {
9
- tableSlots: TableSlots<TableData>;
10
- tableColumn: TableColumn<TableData>;
11
- formColumn: FormColumn<SearchData>;
12
- extendedProps: ExtendedProps<TableData, SearchData>;
13
- internalTableProps: InternalTableProps<TableData>;
14
- internalFormProps: {};
15
- };
16
- }
17
- }
18
- /**
19
- * 表格暴露的方法
20
- */
21
- interface TableExposed<TableData extends Record<string, any>, SearchData extends Record<string, any> = TableData> {
22
- /**
23
- * 刷新表格
24
- */
25
- refresh: () => void;
26
- /**
27
- * 表单暴露的方法
28
- */
29
- formExposed: FormExposed<SearchData>;
30
- /**
31
- * 编辑行
32
- */
33
- editRowMap: Map<TableData, TableData>;
34
- /**
35
- * 设置编辑行
36
- */
37
- setEditRow: (row: TableData) => void;
38
- /**
39
- * 取消编辑行
40
- */
41
- cancelEditRow: (row: TableData) => void;
42
- /**
43
- * 保存编辑行
44
- */
45
- saveEditRow: (row: TableData) => void;
46
- /**
47
- * 滚动到指定行
48
- */
49
- scrollToRow: (row: TableData) => void;
50
- /**
51
- * 滚动到指定行索引
52
- */
53
- scrollToIndex: (index: number) => void;
54
- }
55
- /**
56
- * 列定义
57
- */
58
- interface TableColumn<TableData extends Record<string, any>> extends FtTableColumn<TableData>, Omit<TableColumnType<TableData>, "title" | "dataIndex"> {
59
- /**
60
- * 行内编辑
61
- */
62
- edit?: keyof EditMap<TableData> | ValueOf<EditMap<TableData>>;
63
- }
64
- /**
65
- * 内部表格 props
66
- */
67
- interface InternalTableProps<TableData extends Record<string, any>> extends Omit<AntTableProps<TableData>, "columns" | "pagination" | "loading"> {
68
- }
69
- /**
70
- * 表格插槽
71
- */
72
- interface TableSlots<_TableData extends Record<string, any>> extends ComponentSlots<typeof Table> {
73
- buttons?: () => any;
74
- tools?: () => any;
75
- }
76
- interface ExtendedProps<TableData extends Record<string, any>, SearchData extends Record<string, any> = TableData> {
77
- /**
78
- * 是否初始化搜索
79
- *
80
- * @default true
81
- */
82
- initSearch?: boolean;
83
- /**
84
- * 是否自适应父元素(flex布局)剩余高度
85
- *
86
- * 如果为true,则table会占据父元素的剩余高度,此时可以通过 {@link minHeight} 控制最小高度,避免高度不够展示内容
87
- * @default true
88
- */
89
- fitFlexHeight?: boolean;
90
- /**
91
- * 自适应父元素(flex布局)剩余高度时,最小高度
92
- * @default 210
93
- */
94
- minHeight?: number;
95
- /**
96
- * 是否隐藏分页
97
- * @default false
98
- */
99
- hidePagination?: boolean;
100
- exposed?: TableExposed<TableData, SearchData>;
101
- "onUpdate:exposed"?: (exposed: TableExposed<TableData, SearchData>) => void;
102
- onChange?: AntTableProps<TableData>["onChange"];
103
- onExpand?: AntTableProps<TableData>["onExpand"];
104
- onExpandedRowsChange?: AntTableProps<TableData>["onExpandedRowsChange"];
105
- onResizeColumn?: AntTableProps<TableData>["onResizeColumn"];
106
- onSearch?: (searchData: SearchData, info: OnSearchInfo) => void;
107
- }
108
- interface OnSearchInfo {
109
- /**
110
- * 分页信息
111
- */
112
- pagination?: Pagination;
113
- }
114
- interface Pagination {
115
- page: number;
116
- pageSize: number;
117
- }
118
- export declare const FtTable: new <TableData extends Record<string, any>, SearchData extends Record<string, any> = TableData>(props: ((import('@ftjs/core').FtTableIntrinsicProps<TableData, SearchData, "antd"> & (ExtendedProps<TableData, SearchData> & ({
119
- [x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
120
- } | {
121
- [x: `on${Capitalize<string>}`]: ((...args: never) => any) | undefined;
122
- }))) & import('vue').VNodeProps) & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps) => import('vue').CreateComponentPublicInstanceWithMixins<import('@ftjs/core').FtTableIntrinsicProps<TableData, SearchData, "antd"> & (ExtendedProps<TableData, SearchData> & ({
123
- [x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
124
- } | {
125
- [x: `on${Capitalize<string>}`]: ((...args: never) => any) | undefined;
126
- })), {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, import('vue').EmitsOptions, import('vue').PublicProps, {}, false, {}, import('vue').SlotsType<TableSlots<TableData>>, {}, {}, string, {}, any, import('vue').ComponentProvideOptions, {
127
- P: {};
128
- B: {};
129
- D: {};
130
- C: {};
131
- M: {};
132
- Defaults: {};
133
- }, (import('@ftjs/core').FtTableIntrinsicProps<TableData, SearchData, "antd"> & ExtendedProps<TableData, SearchData> & {
134
- [x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
135
- }) | (import('@ftjs/core').FtTableIntrinsicProps<TableData, SearchData, "antd"> & ExtendedProps<TableData, SearchData> & {
136
- [x: `on${Capitalize<string>}`]: ((...args: never) => any) | undefined;
137
- }), {}, {}, {}, {}, {}>;
138
- export type FtTableProps<TableData extends Record<string, any>, SearchData extends Record<string, any> = TableData> = FtTablePropsMap<TableData, SearchData, "antd">;
139
- export {};
@@ -1,114 +0,0 @@
1
- import { FtTableColumn, FtTablePropsMap, ValueOf } from '@ftjs/core';
2
- import { VxeGridProps, VxeGridSlots, VxeGridInstance, VxeGridPropTypes } from 'vxe-table';
3
- import { FormColumn, FormExposed } from '../form/register';
4
- import { EditMap } from '../antd-table/column-edit';
5
- declare module "@ftjs/core" {
6
- interface TableTypeMap<TableData extends Record<string, any>, SearchData extends Record<string, any> = TableData> {
7
- "vxe-table": {
8
- tableSlots: VxeTableSlots<TableData> & {
9
- buttons: () => any;
10
- tools: () => any;
11
- };
12
- tableColumn: VxeTableColumn<TableData>;
13
- formColumn: FormColumn<SearchData>;
14
- extendedProps: VxeExtendedProps<TableData, SearchData>;
15
- internalTableProps: InternalVxeTableProps<TableData>;
16
- internalFormProps: {};
17
- };
18
- }
19
- }
20
- /**
21
- * 表格暴露的方法
22
- */
23
- interface VxeTableExposed<TableData extends Record<string, any>, SearchData extends Record<string, any> = TableData> {
24
- /**
25
- * 刷新表格
26
- */
27
- refresh: () => Promise<void>;
28
- /**
29
- * 表单暴露的方法
30
- */
31
- formExposed: FormExposed<SearchData>;
32
- /**
33
- * 表格暴露的方法
34
- */
35
- tableExposed: VxeGridInstance<TableData>;
36
- }
37
- /**
38
- * 列定义
39
- */
40
- type VxeTableColumn<TableData extends Record<string, any>> = FtTableColumn<TableData> & Omit<VxeGridPropTypes.Column<TableData>, "title" | "editRender"> & {
41
- /**
42
- * 行内编辑
43
- */
44
- edit?: keyof EditMap<TableData> | ValueOf<EditMap<TableData>>;
45
- };
46
- /**
47
- * 内部表格 props
48
- */
49
- interface InternalVxeTableProps<TableData extends Record<string, any>> extends Omit<VxeGridProps<TableData>, "columns" | "minHeight"> {
50
- }
51
- /**
52
- * 表格插槽
53
- */
54
- interface VxeTableSlots<TableData extends Record<string, any>> extends VxeGridSlots<TableData> {
55
- }
56
- interface VxeExtendedProps<TableData extends Record<string, any>, SearchData extends Record<string, any> = TableData> {
57
- /**
58
- * 是否初始化搜索
59
- *
60
- * @default true
61
- */
62
- initSearch?: boolean;
63
- /**
64
- * 是否自适应父元素(flex布局)剩余高度
65
- *
66
- * 如果为true,则table会占据父元素的剩余高度,此时可以通过 {@link minHeight} 控制最小高度,避免高度不够展示内容
67
- * @default true
68
- */
69
- fitFlexHeight?: boolean;
70
- /**
71
- * 最小高度
72
- * @default 310
73
- */
74
- minHeight?: number;
75
- /**
76
- * 是否隐藏分页
77
- * @default false
78
- */
79
- hidePagination?: boolean;
80
- exposed?: VxeTableExposed<TableData, SearchData>;
81
- "onUpdate:exposed"?: (exposed: VxeTableExposed<TableData, SearchData>) => void;
82
- onSearch: (searchData: SearchData, info: {
83
- pagination?: VxePagination;
84
- }) => Promise<void> | void;
85
- }
86
- interface VxePagination {
87
- page: number;
88
- pageSize: number;
89
- }
90
- export declare const FtVxeTable: new <TableData extends Record<string, any>, SearchData extends Record<string, any> = TableData>(props: ((import('@ftjs/core').FtTableIntrinsicProps<TableData, SearchData, "vxe-table"> & (VxeExtendedProps<TableData, SearchData> & ({
91
- [x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
92
- } | {
93
- [x: `on${Capitalize<string>}`]: ((...args: never) => any) | undefined;
94
- }))) & import('vue').VNodeProps) & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps) => import('vue').CreateComponentPublicInstanceWithMixins<import('@ftjs/core').FtTableIntrinsicProps<TableData, SearchData, "vxe-table"> & (VxeExtendedProps<TableData, SearchData> & ({
95
- [x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
96
- } | {
97
- [x: `on${Capitalize<string>}`]: ((...args: never) => any) | undefined;
98
- })), {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, import('vue').EmitsOptions, import('vue').PublicProps, {}, false, {}, import('vue').SlotsType<VxeTableSlots<TableData> & {
99
- buttons: () => any;
100
- tools: () => any;
101
- }>, {}, {}, string, {}, any, import('vue').ComponentProvideOptions, {
102
- P: {};
103
- B: {};
104
- D: {};
105
- C: {};
106
- M: {};
107
- Defaults: {};
108
- }, (import('@ftjs/core').FtTableIntrinsicProps<TableData, SearchData, "vxe-table"> & VxeExtendedProps<TableData, SearchData> & {
109
- [x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
110
- }) | (import('@ftjs/core').FtTableIntrinsicProps<TableData, SearchData, "vxe-table"> & VxeExtendedProps<TableData, SearchData> & {
111
- [x: `on${Capitalize<string>}`]: ((...args: never) => any) | undefined;
112
- }), {}, {}, {}, {}, {}>;
113
- export type FtVxeTableProps<TableData extends Record<string, any>, SearchData extends Record<string, any> = TableData> = FtTablePropsMap<TableData, SearchData, "vxe-table">;
114
- export {};