@mtn-ui/components 0.0.7 → 0.0.10
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/button/index.js +1 -1
- package/dist/chunks/{Button.vue_vue_type_script_setup_true_lang-C2Vc6-OE.js → Button.vue_vue_type_script_setup_true_lang-C7ip0O23.js} +73 -66
- package/dist/chunks/{Button.vue_vue_type_script_setup_true_lang-C2Vc6-OE.js.map → Button.vue_vue_type_script_setup_true_lang-C7ip0O23.js.map} +1 -1
- package/dist/index/index.js +24199 -14623
- package/dist/index/index.js.map +1 -1
- package/dist/index/style.css +1 -1
- package/dist/resolver/index.js +8 -6
- package/dist/resolver/index.js.map +1 -1
- package/dist/types/base-modal/BaseModal.d.ts +25 -0
- package/dist/types/base-modal/index.d.ts +1 -0
- package/dist/types/button/Button.d.ts +1 -1
- package/dist/types/confirm-button/ConfirmButton.d.ts +10 -1
- package/dist/types/confirm-button/types.d.ts +1 -1
- package/dist/types/copy-text/CopyText.d.ts +45 -0
- package/dist/types/copy-text/index.d.ts +2 -0
- package/dist/types/copy-text/types.d.ts +15 -0
- package/dist/types/delete-button/DeleteButton.d.ts +8 -0
- package/dist/types/delete-button/types.d.ts +1 -1
- package/dist/types/dict-badge/types.d.ts +1 -1
- package/dist/types/dict-checkbox/types.d.ts +1 -1
- package/dist/types/dict-radio/types.d.ts +1 -1
- package/dist/types/dict-select/types.d.ts +1 -1
- package/dist/types/dict-tag/types.d.ts +1 -1
- package/dist/types/form/Form.d.ts +34 -0
- package/dist/types/form/context.d.ts +19 -0
- package/dist/types/form/index.d.ts +2 -0
- package/dist/types/form-item/types.d.ts +1 -1
- package/dist/types/form-renderer/types.d.ts +8 -0
- package/dist/types/index.d.ts +10 -1
- package/dist/types/section-title/SectionTitle.d.ts +42 -0
- package/dist/types/section-title/index.d.ts +2 -0
- package/dist/types/section-title/types.d.ts +12 -0
- package/dist/types/section-title/variants.d.ts +7 -0
- package/dist/types/table/Table.d.ts +84 -0
- package/dist/types/table/components/TableColumnConfigurator.d.ts +50 -0
- package/dist/types/table/components/TableDensityControl.d.ts +34 -0
- package/dist/types/table/components/TableSearchBar.d.ts +46 -0
- package/dist/types/table/components/TableToolbar.d.ts +48 -0
- package/dist/types/table/index.d.ts +5 -0
- package/dist/types/table/types.d.ts +97 -0
- package/dist/types/table-action-group/TableActionGroup.d.ts +33 -0
- package/dist/types/table-action-group/TableActionItem.d.ts +16 -0
- package/dist/types/table-action-group/index.d.ts +2 -0
- package/dist/types/table-action-group/types.d.ts +25 -0
- package/package.json +3 -2
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
type Density = 'large' | 'middle' | 'small';
|
|
2
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
3
|
+
modelValue?: Density;
|
|
4
|
+
}>, {
|
|
5
|
+
modelValue: string;
|
|
6
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
7
|
+
"update:modelValue": (args_0: Density) => void;
|
|
8
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
9
|
+
modelValue?: Density;
|
|
10
|
+
}>, {
|
|
11
|
+
modelValue: string;
|
|
12
|
+
}>>> & Readonly<{
|
|
13
|
+
"onUpdate:modelValue"?: ((args_0: Density) => any) | undefined;
|
|
14
|
+
}>, {
|
|
15
|
+
modelValue: Density;
|
|
16
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
17
|
+
export default _default;
|
|
18
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
19
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
20
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
21
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
22
|
+
} : {
|
|
23
|
+
type: import('vue').PropType<T[K]>;
|
|
24
|
+
required: true;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
type __VLS_WithDefaults<P, D> = {
|
|
28
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
29
|
+
default: D[K];
|
|
30
|
+
}> : P[K];
|
|
31
|
+
};
|
|
32
|
+
type __VLS_Prettify<T> = {
|
|
33
|
+
[K in keyof T]: T[K];
|
|
34
|
+
} & {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { SearchField } from '../types';
|
|
2
|
+
|
|
3
|
+
interface Props {
|
|
4
|
+
/** 搜索字段配置 */
|
|
5
|
+
searchList: SearchField[];
|
|
6
|
+
/** 是否加载中(禁用按钮) */
|
|
7
|
+
loading?: boolean;
|
|
8
|
+
}
|
|
9
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
|
|
10
|
+
loading: boolean;
|
|
11
|
+
}>>, {
|
|
12
|
+
/** 设置表单数据(外部主动注入初始值) */
|
|
13
|
+
setFormData: (data: Record<string, unknown>) => void;
|
|
14
|
+
/** 获取当前表单数据 */
|
|
15
|
+
getFormData: () => {
|
|
16
|
+
[x: string]: unknown;
|
|
17
|
+
};
|
|
18
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
19
|
+
reset: () => void;
|
|
20
|
+
search: (params: Record<string, unknown>) => void;
|
|
21
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
|
|
22
|
+
loading: boolean;
|
|
23
|
+
}>>> & Readonly<{
|
|
24
|
+
onReset?: (() => any) | undefined;
|
|
25
|
+
onSearch?: ((params: Record<string, unknown>) => any) | undefined;
|
|
26
|
+
}>, {
|
|
27
|
+
loading: boolean;
|
|
28
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
29
|
+
export default _default;
|
|
30
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
31
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
32
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
33
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
34
|
+
} : {
|
|
35
|
+
type: import('vue').PropType<T[K]>;
|
|
36
|
+
required: true;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
type __VLS_WithDefaults<P, D> = {
|
|
40
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
41
|
+
default: D[K];
|
|
42
|
+
}> : P[K];
|
|
43
|
+
};
|
|
44
|
+
type __VLS_Prettify<T> = {
|
|
45
|
+
[K in keyof T]: T[K];
|
|
46
|
+
} & {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { SearchField } from '../types';
|
|
2
|
+
import { ActionItem } from '../../action-group/types';
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
/** 搜索字段配置 */
|
|
6
|
+
searchList?: SearchField[];
|
|
7
|
+
/** 操作按钮配置 */
|
|
8
|
+
optionsList?: ActionItem[];
|
|
9
|
+
/** 是否加载中(禁用按钮) */
|
|
10
|
+
loading?: boolean;
|
|
11
|
+
}
|
|
12
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
|
|
13
|
+
searchList: () => never[];
|
|
14
|
+
optionsList: () => never[];
|
|
15
|
+
loading: boolean;
|
|
16
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
17
|
+
reset: () => void;
|
|
18
|
+
search: (params: Record<string, unknown>) => void;
|
|
19
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
|
|
20
|
+
searchList: () => never[];
|
|
21
|
+
optionsList: () => never[];
|
|
22
|
+
loading: boolean;
|
|
23
|
+
}>>> & Readonly<{
|
|
24
|
+
onReset?: (() => any) | undefined;
|
|
25
|
+
onSearch?: ((params: Record<string, unknown>) => any) | undefined;
|
|
26
|
+
}>, {
|
|
27
|
+
loading: boolean;
|
|
28
|
+
searchList: SearchField[];
|
|
29
|
+
optionsList: ActionItem[];
|
|
30
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
31
|
+
export default _default;
|
|
32
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
33
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
34
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
35
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
36
|
+
} : {
|
|
37
|
+
type: import('vue').PropType<T[K]>;
|
|
38
|
+
required: true;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
type __VLS_WithDefaults<P, D> = {
|
|
42
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
43
|
+
default: D[K];
|
|
44
|
+
}> : P[K];
|
|
45
|
+
};
|
|
46
|
+
type __VLS_Prettify<T> = {
|
|
47
|
+
[K in keyof T]: T[K];
|
|
48
|
+
} & {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { default as Table } from './Table';
|
|
2
|
+
export { default as TableDensityControl } from './components/TableDensityControl';
|
|
3
|
+
export { default as TableColumnConfigurator } from './components/TableColumnConfigurator';
|
|
4
|
+
export { default as TableSearchBar } from './components/TableSearchBar';
|
|
5
|
+
export * from './types';
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { VNode } from 'vue';
|
|
2
|
+
|
|
3
|
+
/** 表格列类型 */
|
|
4
|
+
export type TableColumnType = 'text' | 'tag' | 'status' | 'date' | 'dateTime' | 'select' | 'copy' | 'custom';
|
|
5
|
+
/** 表格列对齐方式 */
|
|
6
|
+
export type TableColumnAlign = 'left' | 'center' | 'right';
|
|
7
|
+
/** 表格尺寸 */
|
|
8
|
+
export type TableSize = 'large' | 'middle' | 'small';
|
|
9
|
+
/** 列选项(用于 tag、status、select 类型) */
|
|
10
|
+
export interface ColumnOption {
|
|
11
|
+
label: string;
|
|
12
|
+
value: unknown;
|
|
13
|
+
color?: string;
|
|
14
|
+
}
|
|
15
|
+
/** 表格列配置 */
|
|
16
|
+
export interface TableColumn {
|
|
17
|
+
/** 列标题 */
|
|
18
|
+
title: string;
|
|
19
|
+
/** 数据字段 */
|
|
20
|
+
dataIndex: string;
|
|
21
|
+
/** 列类型 */
|
|
22
|
+
type?: TableColumnType;
|
|
23
|
+
/** 列宽 */
|
|
24
|
+
width?: number | string;
|
|
25
|
+
/** 对齐方式 */
|
|
26
|
+
align?: TableColumnAlign;
|
|
27
|
+
/** 固定列 */
|
|
28
|
+
fixed?: 'left' | 'right';
|
|
29
|
+
/** 文本省略 */
|
|
30
|
+
ellipsis?: boolean;
|
|
31
|
+
/** 支持排序 */
|
|
32
|
+
sorter?: boolean;
|
|
33
|
+
/** 列选项(tag/status/select 类型用) */
|
|
34
|
+
options?: ColumnOption[];
|
|
35
|
+
/** 字典类型(tag 类型用,优先级高于 options) */
|
|
36
|
+
dictType?: string;
|
|
37
|
+
/** 自定义渲染(custom 类型或覆盖默认渲染时用,与 antd ColumnType.customRender 签名一致) */
|
|
38
|
+
customRender?: (opt: {
|
|
39
|
+
value: unknown;
|
|
40
|
+
text: unknown;
|
|
41
|
+
record: Record<string, unknown>;
|
|
42
|
+
index: number;
|
|
43
|
+
}) => VNode;
|
|
44
|
+
}
|
|
45
|
+
/** 搜索字段类型(与 FormItemType 对齐) */
|
|
46
|
+
export type SearchFieldType = 'input' | 'text-area' | 'select' | 'radio' | 'checkbox' | 'date-picker' | 'input-number' | 'input-search' | 'tree-select' | 'custom' | 'dict-select';
|
|
47
|
+
/** 搜索字段配置 */
|
|
48
|
+
export interface SearchField {
|
|
49
|
+
/** 字段名 */
|
|
50
|
+
name: string;
|
|
51
|
+
/** 字段标签 */
|
|
52
|
+
label: string;
|
|
53
|
+
/** 字段类型 */
|
|
54
|
+
type: SearchFieldType;
|
|
55
|
+
/** 占位文本 */
|
|
56
|
+
placeholder?: string;
|
|
57
|
+
/** 选项配置(select/radio/checkbox 类型用) */
|
|
58
|
+
options?: {
|
|
59
|
+
label: string;
|
|
60
|
+
value: unknown;
|
|
61
|
+
}[];
|
|
62
|
+
/** 透传给 FormItem 的属性 */
|
|
63
|
+
itemProps?: Record<string, unknown>;
|
|
64
|
+
/** 是否显示标签(搜索栏场景默认 false) */
|
|
65
|
+
showLabel?: boolean;
|
|
66
|
+
/** 是否显示 */
|
|
67
|
+
show?: boolean;
|
|
68
|
+
/** 是否隐藏(展开后才可见,用于搜索栏高级字段) */
|
|
69
|
+
hidden?: boolean;
|
|
70
|
+
/** 占位列宽 */
|
|
71
|
+
span?: number;
|
|
72
|
+
}
|
|
73
|
+
/** 操作按钮配置 */
|
|
74
|
+
export interface OperateButton {
|
|
75
|
+
/** 唯一标识 */
|
|
76
|
+
key: string;
|
|
77
|
+
/** 按钮文本 */
|
|
78
|
+
label: string;
|
|
79
|
+
/** 按钮类型 */
|
|
80
|
+
type?: 'default' | 'primary' | 'danger' | 'link';
|
|
81
|
+
/** 点击事件 */
|
|
82
|
+
onClick: (record?: Record<string, unknown>, index?: number) => void;
|
|
83
|
+
}
|
|
84
|
+
/** 列配置状态 */
|
|
85
|
+
export interface ColumnConfigState {
|
|
86
|
+
order: (string | number)[];
|
|
87
|
+
fixedMap: Record<string | number, 'left' | 'right' | undefined>;
|
|
88
|
+
visible: (string | number)[];
|
|
89
|
+
}
|
|
90
|
+
/** 列元数据 */
|
|
91
|
+
export interface ColumnMeta {
|
|
92
|
+
key: string | number;
|
|
93
|
+
title: string;
|
|
94
|
+
fixed?: 'left' | 'right';
|
|
95
|
+
}
|
|
96
|
+
/** 列键名 */
|
|
97
|
+
export type ColumnKey = string | number;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { TableActionGroupProps, TableActionItem as TableActionItemType } from './types';
|
|
2
|
+
|
|
3
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<TableActionGroupProps>, {
|
|
4
|
+
items: () => never[];
|
|
5
|
+
gap: number;
|
|
6
|
+
width: number;
|
|
7
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<TableActionGroupProps>, {
|
|
8
|
+
items: () => never[];
|
|
9
|
+
gap: number;
|
|
10
|
+
width: number;
|
|
11
|
+
}>>> & Readonly<{}>, {
|
|
12
|
+
width: number;
|
|
13
|
+
items: TableActionItemType[];
|
|
14
|
+
gap: number;
|
|
15
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
16
|
+
export default _default;
|
|
17
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
18
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
19
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
20
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
21
|
+
} : {
|
|
22
|
+
type: import('vue').PropType<T[K]>;
|
|
23
|
+
required: true;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
type __VLS_WithDefaults<P, D> = {
|
|
27
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
28
|
+
default: D[K];
|
|
29
|
+
}> : P[K];
|
|
30
|
+
};
|
|
31
|
+
type __VLS_Prettify<T> = {
|
|
32
|
+
[K in keyof T]: T[K];
|
|
33
|
+
} & {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { TableActionItem } from './types';
|
|
2
|
+
|
|
3
|
+
interface Props {
|
|
4
|
+
item: TableActionItem;
|
|
5
|
+
}
|
|
6
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
7
|
+
export default _default;
|
|
8
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
9
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
10
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
11
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
12
|
+
} : {
|
|
13
|
+
type: import('vue').PropType<T[K]>;
|
|
14
|
+
required: true;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TableActionGroup 表格操作按钮组属性
|
|
3
|
+
*/
|
|
4
|
+
export interface TableActionGroupProps {
|
|
5
|
+
/** 操作项列表 */
|
|
6
|
+
items?: TableActionItem[];
|
|
7
|
+
/** 按钮间距 */
|
|
8
|
+
gap?: number;
|
|
9
|
+
/** 容器宽度(px),用于计算可见按钮数量 */
|
|
10
|
+
width?: number;
|
|
11
|
+
}
|
|
12
|
+
export interface TableActionItem {
|
|
13
|
+
/** 按钮类型 */
|
|
14
|
+
type?: 'button' | 'confirm' | 'delete';
|
|
15
|
+
/** 按钮文字 */
|
|
16
|
+
label: string;
|
|
17
|
+
/** 图标 */
|
|
18
|
+
icon?: unknown;
|
|
19
|
+
/** 点击回调 */
|
|
20
|
+
onClick?: () => void;
|
|
21
|
+
/** 是否隐藏 */
|
|
22
|
+
hidden?: boolean;
|
|
23
|
+
/** 自定义属性 */
|
|
24
|
+
props?: Record<string, unknown>;
|
|
25
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mtn-ui/components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.10",
|
|
4
4
|
"description": "MTN UI Components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index/index.js",
|
|
@@ -80,7 +80,8 @@
|
|
|
80
80
|
"class-variance-authority": "^0.7.1",
|
|
81
81
|
"clsx": "^2.1.1",
|
|
82
82
|
"tailwind-merge": "^3.4.0",
|
|
83
|
-
"
|
|
83
|
+
"vue-draggable-plus": "^0.6.1",
|
|
84
|
+
"@mtn-ui/utils": "0.0.8"
|
|
84
85
|
},
|
|
85
86
|
"scripts": {
|
|
86
87
|
"build": "vite build",
|