@mtn-ui/components 1.0.7 → 1.0.9

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.
@@ -1,68 +1,4 @@
1
- export declare const Table: import('../../../../shared/index.ts').WithInstall<import('vue').DefineComponent<import('vue').ExtractPropTypes<{
2
- columns: {
3
- type: import('vue').PropType<import('ant-design-vue').TableProps["columns"]>;
4
- required: boolean;
5
- };
6
- dataSource: {
7
- type: import('vue').PropType<import('ant-design-vue').TableProps["dataSource"]>;
8
- default: () => never[];
9
- };
10
- rowKey: {
11
- type: import('vue').PropType<import('ant-design-vue').TableProps["rowKey"]>;
12
- default: string;
13
- };
14
- pagination: {
15
- type: import('vue').PropType<import('ant-design-vue').TableProps["pagination"]>;
16
- default: undefined;
17
- };
18
- loading: {
19
- type: BooleanConstructor;
20
- default: boolean;
21
- };
22
- bordered: {
23
- type: BooleanConstructor;
24
- default: boolean;
25
- };
26
- size: {
27
- type: import('vue').PropType<"small" | "middle" | "large">;
28
- default: string;
29
- };
30
- }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
31
- columns: {
32
- type: import('vue').PropType<import('ant-design-vue').TableProps["columns"]>;
33
- required: boolean;
34
- };
35
- dataSource: {
36
- type: import('vue').PropType<import('ant-design-vue').TableProps["dataSource"]>;
37
- default: () => never[];
38
- };
39
- rowKey: {
40
- type: import('vue').PropType<import('ant-design-vue').TableProps["rowKey"]>;
41
- default: string;
42
- };
43
- pagination: {
44
- type: import('vue').PropType<import('ant-design-vue').TableProps["pagination"]>;
45
- default: undefined;
46
- };
47
- loading: {
48
- type: BooleanConstructor;
49
- default: boolean;
50
- };
51
- bordered: {
52
- type: BooleanConstructor;
53
- default: boolean;
54
- };
55
- size: {
56
- type: import('vue').PropType<"small" | "middle" | "large">;
57
- default: string;
58
- };
59
- }>> & Readonly<{}>, {
60
- size: "small" | "middle" | "large";
61
- loading: boolean;
62
- rowKey: string | import('ant-design-vue/es/vc-table/interface').GetRowKey<any> | undefined;
63
- dataSource: any[] | undefined;
64
- pagination: false | import('ant-design-vue').TablePaginationConfig | undefined;
65
- bordered: boolean;
66
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>>;
1
+ import { Table } from 'ant-design-vue';
2
+ export * from './table';
3
+ export { Table };
67
4
  export default Table;
68
- export * from './props';
@@ -1,67 +1,128 @@
1
- declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
2
- columns: {
3
- type: import('vue').PropType<import('ant-design-vue').TableProps["columns"]>;
4
- required: boolean;
5
- };
6
- dataSource: {
7
- type: import('vue').PropType<import('ant-design-vue').TableProps["dataSource"]>;
8
- default: () => never[];
9
- };
10
- rowKey: {
11
- type: import('vue').PropType<import('ant-design-vue').TableProps["rowKey"]>;
12
- default: string;
13
- };
14
- pagination: {
15
- type: import('vue').PropType<import('ant-design-vue').TableProps["pagination"]>;
16
- default: undefined;
17
- };
18
- loading: {
19
- type: BooleanConstructor;
20
- default: boolean;
21
- };
22
- bordered: {
23
- type: BooleanConstructor;
24
- default: boolean;
25
- };
26
- size: {
27
- type: import('vue').PropType<"small" | "middle" | "large">;
28
- default: string;
29
- };
30
- }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
31
- columns: {
32
- type: import('vue').PropType<import('ant-design-vue').TableProps["columns"]>;
33
- required: boolean;
34
- };
35
- dataSource: {
36
- type: import('vue').PropType<import('ant-design-vue').TableProps["dataSource"]>;
37
- default: () => never[];
38
- };
39
- rowKey: {
40
- type: import('vue').PropType<import('ant-design-vue').TableProps["rowKey"]>;
41
- default: string;
42
- };
43
- pagination: {
44
- type: import('vue').PropType<import('ant-design-vue').TableProps["pagination"]>;
45
- default: undefined;
46
- };
47
- loading: {
48
- type: BooleanConstructor;
49
- default: boolean;
50
- };
51
- bordered: {
52
- type: BooleanConstructor;
53
- default: boolean;
54
- };
55
- size: {
56
- type: import('vue').PropType<"small" | "middle" | "large">;
57
- default: string;
58
- };
59
- }>> & Readonly<{}>, {
60
- size: "small" | "middle" | "large";
61
- loading: boolean;
62
- rowKey: string | import('ant-design-vue/es/vc-table/interface').GetRowKey<any> | undefined;
63
- dataSource: any[] | undefined;
64
- pagination: false | import('ant-design-vue').TablePaginationConfig | undefined;
65
- bordered: boolean;
66
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
67
- export default _default;
1
+ import { ButtonProps } from 'ant-design-vue/es/button/buttonTypes';
2
+ import { ColumnType } from 'ant-design-vue/es/table/interface';
3
+ import { TableProps } from 'ant-design-vue/es/table/Table';
4
+ /**
5
+ * 表格列类型枚举
6
+ */
7
+ export declare enum TableColumnTypeEnum {
8
+ /** 文本 */
9
+ TEXT = "text",
10
+ /** 标签 */
11
+ TAG = "tag",
12
+ /** 日期 */
13
+ DATE = "date",
14
+ /** 日期时间 */
15
+ DATETIME = "dateTime",
16
+ /** 下拉选择 */
17
+ SELECT = "select",
18
+ /** 状态 */
19
+ STATUS = "status",
20
+ /** 自定义 */
21
+ CUSTOM = "custom"
22
+ }
23
+ /**
24
+ * 表格列对齐方式枚举
25
+ */
26
+ export declare enum TableColumnAlignEnum {
27
+ /** 左对齐 */
28
+ LEFT = "left",
29
+ /** 居中对齐 */
30
+ CENTER = "center",
31
+ /** 右对齐 */
32
+ RIGHT = "right"
33
+ }
34
+ /**
35
+ * 表格尺寸枚举
36
+ */
37
+ export declare enum TableSizeEnum {
38
+ /** 小尺寸 */
39
+ SMALL = "small",
40
+ /** 中等尺寸 */
41
+ MIDDLE = "middle",
42
+ /** 大尺寸 */
43
+ LARGE = "large"
44
+ }
45
+ /**
46
+ * 表格选择类型枚举
47
+ */
48
+ export declare enum TableSelectionTypeEnum {
49
+ /** 复选框 */
50
+ CHECKBOX = "checkbox",
51
+ /** 单选框 */
52
+ RADIO = "radio"
53
+ }
54
+ /**
55
+ * 按钮位置枚举
56
+ */
57
+ export declare enum ButtonPositionEnum {
58
+ /** 左侧 */
59
+ LEFT = "left",
60
+ /** 右侧 */
61
+ RIGHT = "right"
62
+ }
63
+ /**
64
+ * 搜索配置项
65
+ */
66
+ export interface SearchConfigItem {
67
+ /** 字段名 */
68
+ key: string;
69
+ /** 标签 */
70
+ label: string;
71
+ /** 输入框类型 */
72
+ type?: "input" | "select" | "date" | "dateRange";
73
+ /** 占位符 */
74
+ placeholder?: string;
75
+ /** 选项(用于 select 类型) */
76
+ options?: Array<{
77
+ label: string;
78
+ value: any;
79
+ }>;
80
+ /** 默认值 */
81
+ defaultValue?: any;
82
+ /** 其他属性 */
83
+ [key: string]: any;
84
+ }
85
+ /**
86
+ * 操作按钮配置
87
+ */
88
+ export interface OperateButtonConfig {
89
+ /** 按钮唯一标识 */
90
+ key: string;
91
+ /** 按钮文本 */
92
+ label: string;
93
+ /** 按钮类型 */
94
+ type?: "primary" | "default" | "dashed" | "link" | "text";
95
+ /** 是否危险按钮 */
96
+ danger?: boolean;
97
+ /** 是否禁用 */
98
+ disabled?: boolean;
99
+ /** 点击事件 */
100
+ onClick?: () => void | Promise<void>;
101
+ /** 其他按钮属性 */
102
+ [key: string]: any;
103
+ }
104
+ export interface TableColumn extends Omit<ColumnType, "customRender"> {
105
+ type: TableColumnTypeEnum;
106
+ customRender?: (value: any, record: any, index: number) => any;
107
+ options?: any[];
108
+ color?: string;
109
+ }
110
+ export interface TableAction extends Omit<ButtonProps, "onClick"> {
111
+ key: string;
112
+ label: string;
113
+ position?: ButtonPositionEnum;
114
+ onClick: (record: any, index: number) => void;
115
+ }
116
+ export interface TableConfig extends Omit<TableProps, "columns"> {
117
+ columns: TableColumn[];
118
+ searchList?: SearchConfigItem[];
119
+ operateList?: OperateButtonConfig[];
120
+ }
121
+ export interface TableGeneratorConfig {
122
+ id: string;
123
+ name: string;
124
+ description?: string;
125
+ config: TableConfig;
126
+ createdAt?: string;
127
+ updatedAt?: string;
128
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mtn-ui/components",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "type": "module",
5
5
  "description": "Core components for mtn-ui",
6
6
  "main": "./dist/index.cjs",
@@ -1,7 +0,0 @@
1
- import { withInstall as t } from "@mtn-ui/shared";
2
- import o from "./table.js";
3
- const r = t(o);
4
- export {
5
- r as Table,
6
- r as default
7
- };
@@ -1,35 +0,0 @@
1
- const e = {
2
- // 继承 antd 的所有 props
3
- columns: {
4
- type: Array,
5
- required: !0
6
- },
7
- dataSource: {
8
- type: Array,
9
- default: () => []
10
- },
11
- rowKey: {
12
- type: [String, Function],
13
- default: "id"
14
- },
15
- pagination: {
16
- type: [Object, Boolean],
17
- default: void 0
18
- },
19
- loading: {
20
- type: Boolean,
21
- default: !1
22
- },
23
- bordered: {
24
- type: Boolean,
25
- default: !1
26
- },
27
- size: {
28
- type: String,
29
- default: "middle"
30
- }
31
- // 可以添加更多自定义 props
32
- };
33
- export {
34
- e as tableProps
35
- };
@@ -1,37 +0,0 @@
1
- import { ExtractPropTypes, PropType } from 'vue';
2
- import { TableProps as AntdTableProps } from 'ant-design-vue';
3
- /**
4
- * 继承 Ant Design Table 的 Props
5
- * 可以添加自定义 props 或覆盖默认值
6
- */
7
- export declare const tableProps: {
8
- columns: {
9
- type: PropType<AntdTableProps["columns"]>;
10
- required: boolean;
11
- };
12
- dataSource: {
13
- type: PropType<AntdTableProps["dataSource"]>;
14
- default: () => never[];
15
- };
16
- rowKey: {
17
- type: PropType<AntdTableProps["rowKey"]>;
18
- default: string;
19
- };
20
- pagination: {
21
- type: PropType<AntdTableProps["pagination"]>;
22
- default: undefined;
23
- };
24
- loading: {
25
- type: BooleanConstructor;
26
- default: boolean;
27
- };
28
- bordered: {
29
- type: BooleanConstructor;
30
- default: boolean;
31
- };
32
- size: {
33
- type: PropType<"small" | "middle" | "large">;
34
- default: string;
35
- };
36
- };
37
- export type TableProps = ExtractPropTypes<typeof tableProps>;