@tmagic/table 1.4.0-beta.1 → 1.4.0-beta.2
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/package.json +5 -5
- package/src/schema.ts +6 -6
- package/types/Table.vue.d.ts +2 -2
- package/types/schema.d.ts +6 -6
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.4.0-beta.
|
|
2
|
+
"version": "1.4.0-beta.2",
|
|
3
3
|
"name": "@tmagic/table",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": [
|
|
@@ -29,14 +29,14 @@
|
|
|
29
29
|
"url": "https://github.com/Tencent/tmagic-editor.git"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@tmagic/design": "1.4.0-beta.
|
|
33
|
-
"@tmagic/form": "1.4.0-beta.
|
|
34
|
-
"@tmagic/utils": "1.4.0-beta.
|
|
32
|
+
"@tmagic/design": "1.4.0-beta.2",
|
|
33
|
+
"@tmagic/form": "1.4.0-beta.2",
|
|
34
|
+
"@tmagic/utils": "1.4.0-beta.2",
|
|
35
35
|
"lodash-es": "^4.17.21",
|
|
36
36
|
"vue": "^3.4.21"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
|
-
"@tmagic/form": "1.4.0-beta.
|
|
39
|
+
"@tmagic/form": "1.4.0-beta.2",
|
|
40
40
|
"vue": "^3.4.21"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
package/src/schema.ts
CHANGED
|
@@ -33,7 +33,7 @@ export interface ColumnActionConfig {
|
|
|
33
33
|
action?: (data: { data: any }) => void;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
export
|
|
36
|
+
export interface ColumnConfig<T = any> {
|
|
37
37
|
form?: FormConfig;
|
|
38
38
|
rules?: any;
|
|
39
39
|
values?: FormValue;
|
|
@@ -43,12 +43,12 @@ export type ColumnConfig = {
|
|
|
43
43
|
fixed?: 'left' | 'right' | boolean;
|
|
44
44
|
width?: number | string;
|
|
45
45
|
actions?: ColumnActionConfig[];
|
|
46
|
-
type?: 'popover' | 'expand' | 'component' | string | ((value: any, row:
|
|
46
|
+
type?: 'popover' | 'expand' | 'component' | string | ((value: any, row: T) => string);
|
|
47
47
|
text?: string;
|
|
48
48
|
prop?: string;
|
|
49
49
|
showHeader?: boolean;
|
|
50
50
|
table?: ColumnConfig[];
|
|
51
|
-
formatter?: 'datetime' | ((item: any, row:
|
|
51
|
+
formatter?: 'datetime' | ((item: any, row: T) => any);
|
|
52
52
|
popover?: {
|
|
53
53
|
placement: string;
|
|
54
54
|
width: string;
|
|
@@ -57,9 +57,9 @@ export type ColumnConfig = {
|
|
|
57
57
|
};
|
|
58
58
|
sortable?: boolean | 'custom';
|
|
59
59
|
action?: 'tip' | 'actionLink' | 'img' | 'link' | 'tag';
|
|
60
|
-
handler?: (row:
|
|
60
|
+
handler?: (row: T) => void;
|
|
61
61
|
/** 当type为expand时有效,展开为html */
|
|
62
|
-
expandContent?: (row:
|
|
62
|
+
expandContent?: (row: T, prop?: string) => string;
|
|
63
63
|
/** 当type为expand时,展开为vue组件;当type为component时显示的组件 */
|
|
64
64
|
component?: any;
|
|
65
65
|
/** 当type为expand时,展开的vue组件props;当type为component时显示的组件的props */
|
|
@@ -68,4 +68,4 @@ export type ColumnConfig = {
|
|
|
68
68
|
listeners?: any;
|
|
69
69
|
/** 当type为tip时有效,显示文案 */
|
|
70
70
|
buttonText?: string;
|
|
71
|
-
}
|
|
71
|
+
}
|
package/types/Table.vue.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ColumnConfig } from './schema';
|
|
2
2
|
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<{
|
|
3
3
|
data: any[];
|
|
4
|
-
columns?: ColumnConfig[] | undefined;
|
|
4
|
+
columns?: ColumnConfig<any>[] | undefined;
|
|
5
5
|
/** 合并行或列的计算方法 */
|
|
6
6
|
spanMethod?: ((data: {
|
|
7
7
|
row: any;
|
|
@@ -41,7 +41,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
41
41
|
"cell-click": (...args: any[]) => void;
|
|
42
42
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<{
|
|
43
43
|
data: any[];
|
|
44
|
-
columns?: ColumnConfig[] | undefined;
|
|
44
|
+
columns?: ColumnConfig<any>[] | undefined;
|
|
45
45
|
/** 合并行或列的计算方法 */
|
|
46
46
|
spanMethod?: ((data: {
|
|
47
47
|
row: any;
|
package/types/schema.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export interface ColumnActionConfig {
|
|
|
15
15
|
data: any;
|
|
16
16
|
}) => void;
|
|
17
17
|
}
|
|
18
|
-
export
|
|
18
|
+
export interface ColumnConfig<T = any> {
|
|
19
19
|
form?: FormConfig;
|
|
20
20
|
rules?: any;
|
|
21
21
|
values?: FormValue;
|
|
@@ -25,12 +25,12 @@ export type ColumnConfig = {
|
|
|
25
25
|
fixed?: 'left' | 'right' | boolean;
|
|
26
26
|
width?: number | string;
|
|
27
27
|
actions?: ColumnActionConfig[];
|
|
28
|
-
type?: 'popover' | 'expand' | 'component' | string | ((value: any, row:
|
|
28
|
+
type?: 'popover' | 'expand' | 'component' | string | ((value: any, row: T) => string);
|
|
29
29
|
text?: string;
|
|
30
30
|
prop?: string;
|
|
31
31
|
showHeader?: boolean;
|
|
32
32
|
table?: ColumnConfig[];
|
|
33
|
-
formatter?: 'datetime' | ((item: any, row:
|
|
33
|
+
formatter?: 'datetime' | ((item: any, row: T) => any);
|
|
34
34
|
popover?: {
|
|
35
35
|
placement: string;
|
|
36
36
|
width: string;
|
|
@@ -39,9 +39,9 @@ export type ColumnConfig = {
|
|
|
39
39
|
};
|
|
40
40
|
sortable?: boolean | 'custom';
|
|
41
41
|
action?: 'tip' | 'actionLink' | 'img' | 'link' | 'tag';
|
|
42
|
-
handler?: (row:
|
|
42
|
+
handler?: (row: T) => void;
|
|
43
43
|
/** 当type为expand时有效,展开为html */
|
|
44
|
-
expandContent?: (row:
|
|
44
|
+
expandContent?: (row: T, prop?: string) => string;
|
|
45
45
|
/** 当type为expand时,展开为vue组件;当type为component时显示的组件 */
|
|
46
46
|
component?: any;
|
|
47
47
|
/** 当type为expand时,展开的vue组件props;当type为component时显示的组件的props */
|
|
@@ -50,4 +50,4 @@ export type ColumnConfig = {
|
|
|
50
50
|
listeners?: any;
|
|
51
51
|
/** 当type为tip时有效,显示文案 */
|
|
52
52
|
buttonText?: string;
|
|
53
|
-
}
|
|
53
|
+
}
|