@mtn-ui/components 0.0.6 → 0.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.
- package/dist/button/index.js +1 -1
- package/dist/chunks/{Button.vue_vue_type_script_setup_true_lang-CfbO8ovs.js → Button.vue_vue_type_script_setup_true_lang-C7ip0O23.js} +973 -928
- package/dist/chunks/{Button.vue_vue_type_script_setup_true_lang-CfbO8ovs.js.map → Button.vue_vue_type_script_setup_true_lang-C7ip0O23.js.map} +1 -1
- package/dist/index/index.js +43238 -9546
- package/dist/index/index.js.map +1 -1
- package/dist/index/style.css +1 -1
- package/dist/resolver/index.js +33 -18
- package/dist/resolver/index.js.map +1 -1
- package/dist/types/auto-tooltip/AutoTooltip.d.ts +61 -0
- package/dist/types/auto-tooltip/index.d.ts +2 -0
- package/dist/types/auto-tooltip/types.d.ts +14 -0
- 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/content-container/ContentContainer.d.ts +48 -0
- package/dist/types/content-container/index.d.ts +2 -0
- package/dist/types/content-container/types.d.ts +12 -0
- 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/DictBadge.d.ts +48 -0
- package/dist/types/dict-badge/index.d.ts +2 -0
- package/dist/types/dict-badge/types.d.ts +23 -0
- package/dist/types/dict-checkbox/DictCheckbox.d.ts +54 -0
- package/dist/types/dict-checkbox/index.d.ts +2 -0
- package/dist/types/dict-checkbox/types.d.ts +23 -0
- package/dist/types/dict-radio/DictRadio.d.ts +57 -0
- package/dist/types/dict-radio/index.d.ts +2 -0
- package/dist/types/dict-radio/types.d.ts +25 -0
- package/dist/types/dict-select/DictSelect.d.ts +61 -0
- package/dist/types/dict-select/index.d.ts +2 -0
- package/dist/types/dict-select/types.d.ts +22 -0
- package/dist/types/dict-tag/DictTag.d.ts +48 -0
- package/dist/types/dict-tag/index.d.ts +2 -0
- package/dist/types/dict-tag/types.d.ts +23 -0
- 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/FormItem.d.ts +39 -0
- package/dist/types/form-item/constants.d.ts +9 -0
- package/dist/types/form-item/index.d.ts +4 -0
- package/dist/types/form-item/types.d.ts +46 -0
- package/dist/types/form-item/validator.d.ts +1 -0
- package/dist/types/form-renderer/FormRenderer.d.ts +37 -0
- package/dist/types/form-renderer/helpers.d.ts +9 -0
- package/dist/types/form-renderer/index.d.ts +3 -0
- package/dist/types/form-renderer/types.d.ts +21 -0
- package/dist/types/form-row/FormRow.d.ts +33 -0
- package/dist/types/form-row/index.d.ts +2 -0
- package/dist/types/form-row/types.d.ts +11 -0
- package/dist/types/index.d.ts +32 -1
- package/dist/types/search-bar/SearchBar.d.ts +60 -0
- package/dist/types/search-bar/index.d.ts +2 -0
- package/dist/types/search-bar/types.d.ts +58 -0
- 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,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 配置化搜索项:用于 searchList,支持基础/高级(isHidden)与多种控件类型
|
|
3
|
+
*/
|
|
4
|
+
export interface SearchConfigItem {
|
|
5
|
+
/** 字段名,对应 model 的 key */
|
|
6
|
+
key: string;
|
|
7
|
+
/** 控件类型 */
|
|
8
|
+
type: 'input' | 'search' | 'select' | 'date' | 'dateRange' | 'custom';
|
|
9
|
+
/** 展示名称(高级区域表单项 label) */
|
|
10
|
+
name?: string;
|
|
11
|
+
/** 占位文案 */
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
/** 下拉选项(type=select 时) */
|
|
14
|
+
options?: Array<{
|
|
15
|
+
label: string;
|
|
16
|
+
value: string | number;
|
|
17
|
+
}>;
|
|
18
|
+
/** true 时放入高级搜索折叠区 */
|
|
19
|
+
isHidden?: boolean;
|
|
20
|
+
/** 默认值 */
|
|
21
|
+
defaultValue?: unknown;
|
|
22
|
+
/** 控件宽度(像素) */
|
|
23
|
+
width?: number;
|
|
24
|
+
/** 控件样式 */
|
|
25
|
+
style?: Record<string, string | number>;
|
|
26
|
+
/** 透传给控件的 props */
|
|
27
|
+
props?: Record<string, unknown>;
|
|
28
|
+
/** 自定义渲染(type=custom 时),返回 VNode 或组件 */
|
|
29
|
+
render?: (ctx: {
|
|
30
|
+
value: unknown;
|
|
31
|
+
onChange: (v: unknown) => void;
|
|
32
|
+
item: SearchConfigItem;
|
|
33
|
+
}) => import('vue').VNode | import('vue').Component;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* SearchBar 组件 Props
|
|
37
|
+
* 用于表格上方搜索区。支持两种用法:1)插槽 + FormItem;2)配置 searchList(基础 + 高级展开),不含操作按钮区。
|
|
38
|
+
*/
|
|
39
|
+
export interface SearchBarProps {
|
|
40
|
+
/** 表单数据对象(与内部 FormItem 的 form-data 或配置项绑定共用) */
|
|
41
|
+
model: Record<string, unknown>;
|
|
42
|
+
/** 配置化搜索项列表;有值时使用配置化 UI(基础行 + 高级展开),无值时使用默认插槽 */
|
|
43
|
+
searchList?: SearchConfigItem[];
|
|
44
|
+
/** 每行表单项列数(仅插槽模式生效,传给 FormRow) */
|
|
45
|
+
cols?: number;
|
|
46
|
+
/** 列间距(仅插槽模式生效) */
|
|
47
|
+
gutter?: number | [number, number];
|
|
48
|
+
/** 查询按钮文案 */
|
|
49
|
+
searchText?: string;
|
|
50
|
+
/** 重置按钮文案 */
|
|
51
|
+
resetText?: string;
|
|
52
|
+
/** 展开/收起文案,[展开, 收起] */
|
|
53
|
+
expandText?: [string, string];
|
|
54
|
+
/** 是否在点击查询前进行表单校验 */
|
|
55
|
+
validateBeforeSearch?: boolean;
|
|
56
|
+
/** 自定义类名 */
|
|
57
|
+
class?: string;
|
|
58
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { SectionTitleProps } from './types';
|
|
2
|
+
|
|
3
|
+
declare function __VLS_template(): {
|
|
4
|
+
default?(_: {}): any;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<SectionTitleProps>, {
|
|
7
|
+
noTop: boolean;
|
|
8
|
+
noPadding: boolean;
|
|
9
|
+
accentColor: string;
|
|
10
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<SectionTitleProps>, {
|
|
11
|
+
noTop: boolean;
|
|
12
|
+
noPadding: boolean;
|
|
13
|
+
accentColor: string;
|
|
14
|
+
}>>> & Readonly<{}>, {
|
|
15
|
+
accentColor: string;
|
|
16
|
+
noTop: boolean;
|
|
17
|
+
noPadding: boolean;
|
|
18
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
19
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
20
|
+
export default _default;
|
|
21
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
22
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
23
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
24
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
25
|
+
} : {
|
|
26
|
+
type: import('vue').PropType<T[K]>;
|
|
27
|
+
required: true;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
type __VLS_WithDefaults<P, D> = {
|
|
31
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
32
|
+
default: D[K];
|
|
33
|
+
}> : P[K];
|
|
34
|
+
};
|
|
35
|
+
type __VLS_Prettify<T> = {
|
|
36
|
+
[K in keyof T]: T[K];
|
|
37
|
+
} & {};
|
|
38
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
39
|
+
new (): {
|
|
40
|
+
$slots: S;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ClassValue } from 'clsx';
|
|
2
|
+
|
|
3
|
+
export declare function cn(...inputs: ClassValue[]): string;
|
|
4
|
+
export declare const sectionTitleVariants: (props?: ({
|
|
5
|
+
noTop?: boolean | null | undefined;
|
|
6
|
+
noPadding?: boolean | null | undefined;
|
|
7
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { TableColumn, SearchField } from './types';
|
|
2
|
+
import { ActionItem } from '../action-group/types';
|
|
3
|
+
|
|
4
|
+
interface PaginationConfig {
|
|
5
|
+
current?: number;
|
|
6
|
+
pageSize?: number;
|
|
7
|
+
page_size?: number;
|
|
8
|
+
total?: number;
|
|
9
|
+
[key: string]: unknown;
|
|
10
|
+
}
|
|
11
|
+
interface Props {
|
|
12
|
+
/** 列配置 */
|
|
13
|
+
columns: TableColumn[];
|
|
14
|
+
/** 数据源 */
|
|
15
|
+
dataSource?: unknown[];
|
|
16
|
+
/** 加载状态 */
|
|
17
|
+
loading?: boolean;
|
|
18
|
+
/** 分页配置 */
|
|
19
|
+
pagination?: boolean | PaginationConfig;
|
|
20
|
+
/** antd Table scroll 配置 */
|
|
21
|
+
scroll?: {
|
|
22
|
+
x?: number | string;
|
|
23
|
+
y?: number | string;
|
|
24
|
+
};
|
|
25
|
+
/** 行唯一标识字段(默认 'id') */
|
|
26
|
+
rowKey?: string;
|
|
27
|
+
/** 搜索字段配置 */
|
|
28
|
+
searchList?: SearchField[];
|
|
29
|
+
/** 操作按钮配置 */
|
|
30
|
+
optionsList?: ActionItem[];
|
|
31
|
+
/** 启用密度控制(默认 true) */
|
|
32
|
+
enableDensityControl?: boolean;
|
|
33
|
+
}
|
|
34
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
|
|
35
|
+
dataSource: () => never[];
|
|
36
|
+
loading: boolean;
|
|
37
|
+
pagination: boolean;
|
|
38
|
+
rowKey: string;
|
|
39
|
+
searchList: () => never[];
|
|
40
|
+
optionsList: () => never[];
|
|
41
|
+
enableDensityControl: boolean;
|
|
42
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
43
|
+
reset: () => void;
|
|
44
|
+
search: (params: Record<string, unknown>) => void;
|
|
45
|
+
change: (pagination: unknown) => void;
|
|
46
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
|
|
47
|
+
dataSource: () => never[];
|
|
48
|
+
loading: boolean;
|
|
49
|
+
pagination: boolean;
|
|
50
|
+
rowKey: string;
|
|
51
|
+
searchList: () => never[];
|
|
52
|
+
optionsList: () => never[];
|
|
53
|
+
enableDensityControl: boolean;
|
|
54
|
+
}>>> & Readonly<{
|
|
55
|
+
onReset?: (() => any) | undefined;
|
|
56
|
+
onSearch?: ((params: Record<string, unknown>) => any) | undefined;
|
|
57
|
+
onChange?: ((pagination: unknown) => any) | undefined;
|
|
58
|
+
}>, {
|
|
59
|
+
dataSource: unknown[];
|
|
60
|
+
loading: boolean;
|
|
61
|
+
pagination: boolean | PaginationConfig;
|
|
62
|
+
searchList: SearchField[];
|
|
63
|
+
optionsList: ActionItem[];
|
|
64
|
+
rowKey: string;
|
|
65
|
+
enableDensityControl: boolean;
|
|
66
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
67
|
+
export default _default;
|
|
68
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
69
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
70
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
71
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
72
|
+
} : {
|
|
73
|
+
type: import('vue').PropType<T[K]>;
|
|
74
|
+
required: true;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
type __VLS_WithDefaults<P, D> = {
|
|
78
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
79
|
+
default: D[K];
|
|
80
|
+
}> : P[K];
|
|
81
|
+
};
|
|
82
|
+
type __VLS_Prettify<T> = {
|
|
83
|
+
[K in keyof T]: T[K];
|
|
84
|
+
} & {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { ColumnConfigState, ColumnMeta } from '../types';
|
|
2
|
+
|
|
3
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
4
|
+
columns?: ColumnMeta[];
|
|
5
|
+
modelValue?: ColumnConfigState;
|
|
6
|
+
}>, {
|
|
7
|
+
columns: () => never[];
|
|
8
|
+
modelValue: () => {
|
|
9
|
+
order: never[];
|
|
10
|
+
fixedMap: {};
|
|
11
|
+
visible: never[];
|
|
12
|
+
};
|
|
13
|
+
}>>, {
|
|
14
|
+
draggable: import('vue').ObjectDirective<HTMLElement, [list: import('vue-draggable-plus').MaybeRef<any[]>, options?: import('vue-draggable-plus').MaybeRef<import('vue-draggable-plus').UseDraggableOptions<any>> | undefined] | import('vue-draggable-plus').MaybeRef<any[]>, string, any>;
|
|
15
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
16
|
+
"update:modelValue": (args_0: ColumnConfigState) => void;
|
|
17
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
18
|
+
columns?: ColumnMeta[];
|
|
19
|
+
modelValue?: ColumnConfigState;
|
|
20
|
+
}>, {
|
|
21
|
+
columns: () => never[];
|
|
22
|
+
modelValue: () => {
|
|
23
|
+
order: never[];
|
|
24
|
+
fixedMap: {};
|
|
25
|
+
visible: never[];
|
|
26
|
+
};
|
|
27
|
+
}>>> & Readonly<{
|
|
28
|
+
"onUpdate:modelValue"?: ((args_0: ColumnConfigState) => any) | undefined;
|
|
29
|
+
}>, {
|
|
30
|
+
modelValue: ColumnConfigState;
|
|
31
|
+
columns: ColumnMeta[];
|
|
32
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
33
|
+
export default _default;
|
|
34
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
35
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
36
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
37
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
38
|
+
} : {
|
|
39
|
+
type: import('vue').PropType<T[K]>;
|
|
40
|
+
required: true;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
type __VLS_WithDefaults<P, D> = {
|
|
44
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
45
|
+
default: D[K];
|
|
46
|
+
}> : P[K];
|
|
47
|
+
};
|
|
48
|
+
type __VLS_Prettify<T> = {
|
|
49
|
+
[K in keyof T]: T[K];
|
|
50
|
+
} & {};
|
|
@@ -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.9",
|
|
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",
|