@mtn-ui/components 0.0.1
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 +7 -0
- package/dist/button/index.js.map +1 -0
- package/dist/chunks/Button.vue_vue_type_script_setup_true_lang-ZtoY4huM.js +5498 -0
- package/dist/chunks/Button.vue_vue_type_script_setup_true_lang-ZtoY4huM.js.map +1 -0
- package/dist/index/index.js +11792 -0
- package/dist/index/index.js.map +1 -0
- package/dist/index/style.css +1 -0
- package/dist/types/action-group/ActionGroup.d.ts +41 -0
- package/dist/types/action-group/index.d.ts +2 -0
- package/dist/types/action-group/types.d.ts +61 -0
- package/dist/types/button/Button.d.ts +53 -0
- package/dist/types/button/index.d.ts +3 -0
- package/dist/types/button/types.d.ts +43 -0
- package/dist/types/button/variants.d.ts +33 -0
- package/dist/types/confirm-button/ConfirmButton.d.ts +95 -0
- package/dist/types/confirm-button/index.d.ts +2 -0
- package/dist/types/confirm-button/types.d.ts +45 -0
- package/dist/types/delete-button/DeleteButton.d.ts +70 -0
- package/dist/types/delete-button/index.d.ts +2 -0
- package/dist/types/delete-button/types.d.ts +31 -0
- package/dist/types/index.d.ts +27 -0
- package/dist/types/resolver.d.ts +8 -0
- package/package.json +86 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.mtn-action-group-wrapper[data-v-6a4e52d6]{width:100%;position:relative;display:inline-block}.mtn-action-group-measure[data-v-6a4e52d6]{position:absolute;top:0;left:0;visibility:hidden;pointer-events:none;display:flex;white-space:nowrap}.measure-item[data-v-6a4e52d6]{padding:0 16px;font-size:14px}.mtn-action-group-container[data-v-6a4e52d6]{display:flex;align-items:center}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { ActionItem } from './types';
|
|
2
|
+
|
|
3
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
4
|
+
items?: ActionItem[];
|
|
5
|
+
maxCount?: number;
|
|
6
|
+
size?: "small" | "middle" | "large" | number;
|
|
7
|
+
}>, {
|
|
8
|
+
items: () => never[];
|
|
9
|
+
maxCount: undefined;
|
|
10
|
+
size: string;
|
|
11
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
12
|
+
items?: ActionItem[];
|
|
13
|
+
maxCount?: number;
|
|
14
|
+
size?: "small" | "middle" | "large" | number;
|
|
15
|
+
}>, {
|
|
16
|
+
items: () => never[];
|
|
17
|
+
maxCount: undefined;
|
|
18
|
+
size: string;
|
|
19
|
+
}>>> & Readonly<{}>, {
|
|
20
|
+
size: "small" | "middle" | "large" | number;
|
|
21
|
+
items: ActionItem[];
|
|
22
|
+
maxCount: number;
|
|
23
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
24
|
+
export default _default;
|
|
25
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
26
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
27
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
28
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
29
|
+
} : {
|
|
30
|
+
type: import('vue').PropType<T[K]>;
|
|
31
|
+
required: true;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
type __VLS_WithDefaults<P, D> = {
|
|
35
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
36
|
+
default: D[K];
|
|
37
|
+
}> : P[K];
|
|
38
|
+
};
|
|
39
|
+
type __VLS_Prettify<T> = {
|
|
40
|
+
[K in keyof T]: T[K];
|
|
41
|
+
} & {};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Component } from 'vue';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ActionGroup 组件类型定义
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* ActionItem 类型定义 - 用于 JSON 配置化渲染
|
|
8
|
+
*/
|
|
9
|
+
export interface ActionItem {
|
|
10
|
+
/**
|
|
11
|
+
* 操作项类型
|
|
12
|
+
*/
|
|
13
|
+
type: 'button' | 'confirm' | 'delete';
|
|
14
|
+
/**
|
|
15
|
+
* 按钮文字
|
|
16
|
+
*/
|
|
17
|
+
label?: string;
|
|
18
|
+
/**
|
|
19
|
+
* 图标:直接传组件(如 EditOutlined)或渲染函数 () => h(Icon)
|
|
20
|
+
* 与 props.icon 二选一,优先使用顶层 icon
|
|
21
|
+
*/
|
|
22
|
+
icon?: Component | (() => unknown);
|
|
23
|
+
/**
|
|
24
|
+
* 点击回调函数
|
|
25
|
+
* - button: 绑定到 click 事件
|
|
26
|
+
* - confirm/delete: 绑定到 confirm 事件
|
|
27
|
+
*/
|
|
28
|
+
onClick?: (e?: MouseEvent) => void;
|
|
29
|
+
/**
|
|
30
|
+
* 动态隐藏逻辑
|
|
31
|
+
* - boolean: 直接控制显示/隐藏
|
|
32
|
+
* - function: 动态计算是否隐藏
|
|
33
|
+
*/
|
|
34
|
+
hidden?: boolean | (() => boolean);
|
|
35
|
+
/**
|
|
36
|
+
* 透传给对应组件的其他属性
|
|
37
|
+
* 如 mtnVariant, loading, type, danger, permission 等(图标建议用顶层 icon)
|
|
38
|
+
*/
|
|
39
|
+
props?: Record<string, unknown>;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* ActionGroup 组件属性接口
|
|
43
|
+
*/
|
|
44
|
+
export interface ActionGroupProps {
|
|
45
|
+
/**
|
|
46
|
+
* 最大显示数量,超出部分将收纳到下拉菜单
|
|
47
|
+
* 如果不设置,将根据容器宽度自动计算
|
|
48
|
+
*/
|
|
49
|
+
maxCount?: number;
|
|
50
|
+
/**
|
|
51
|
+
* 项与项之间的间距
|
|
52
|
+
* - 字符串:'small' | 'middle' | 'large',使用预设间距(4 / 6 / 8px)
|
|
53
|
+
* - 数字:自定义间距(单位:px)
|
|
54
|
+
* @default 'middle'
|
|
55
|
+
*/
|
|
56
|
+
size?: 'small' | 'middle' | 'large' | number;
|
|
57
|
+
/**
|
|
58
|
+
* JSON 配置项数组,用于配置化渲染
|
|
59
|
+
*/
|
|
60
|
+
items?: ActionItem[];
|
|
61
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { ButtonProps as AntButtonProps } from 'ant-design-vue';
|
|
2
|
+
import { MtnButtonVariantProps } from './variants';
|
|
3
|
+
import { PermissionAction } from '@mtn-ui/utils';
|
|
4
|
+
|
|
5
|
+
interface Props extends /* @vue-ignore */ Omit<AntButtonProps, 'class'>, /* @vue-ignore */ MtnButtonVariantProps {
|
|
6
|
+
class?: string;
|
|
7
|
+
permission?: string | string[];
|
|
8
|
+
permissionAction?: PermissionAction;
|
|
9
|
+
/**
|
|
10
|
+
* 防抖延迟时间(毫秒)
|
|
11
|
+
* 如果设置了此属性,点击事件会被防抖处理
|
|
12
|
+
* 默认不启用防抖
|
|
13
|
+
*/
|
|
14
|
+
debounceMs?: number;
|
|
15
|
+
}
|
|
16
|
+
declare function __VLS_template(): Partial<Record<NonNullable<string | number>, (_: any) => any>>;
|
|
17
|
+
declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
|
|
18
|
+
mtnVariant: string;
|
|
19
|
+
class: string;
|
|
20
|
+
permissionAction: string;
|
|
21
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
|
|
22
|
+
mtnVariant: string;
|
|
23
|
+
class: string;
|
|
24
|
+
permissionAction: string;
|
|
25
|
+
}>>> & Readonly<{}>, {
|
|
26
|
+
mtnVariant: "none" | "glass" | "gradient" | "soft" | null;
|
|
27
|
+
class: string;
|
|
28
|
+
permissionAction: PermissionAction;
|
|
29
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
30
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
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
|
+
} & {};
|
|
49
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
50
|
+
new (): {
|
|
51
|
+
$slots: S;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { ButtonVariantProps } from './variants';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Button 组件类型定义
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* 按钮变体常量(用于运行时验证)
|
|
8
|
+
*/
|
|
9
|
+
export declare const BUTTON_VARIANTS: readonly ["primary", "default", "danger"];
|
|
10
|
+
/**
|
|
11
|
+
* 按钮尺寸常量(用于运行时验证)
|
|
12
|
+
*/
|
|
13
|
+
export declare const BUTTON_SIZES: readonly ["small", "medium", "large"];
|
|
14
|
+
/**
|
|
15
|
+
* 按钮变体类型
|
|
16
|
+
*/
|
|
17
|
+
export type ButtonVariant = ButtonVariantProps['mtnVariant'];
|
|
18
|
+
/**
|
|
19
|
+
* Button 组件属性接口
|
|
20
|
+
* 基于 CVA 的变体类型,确保类型安全
|
|
21
|
+
* 注意:实际组件使用 Props 接口(在 Button.vue 中定义),此接口用于类型导出
|
|
22
|
+
*/
|
|
23
|
+
export interface ButtonProps extends ButtonVariantProps {
|
|
24
|
+
/**
|
|
25
|
+
* 按钮变体
|
|
26
|
+
* @default 'primary'
|
|
27
|
+
*/
|
|
28
|
+
variant?: ButtonVariant;
|
|
29
|
+
/**
|
|
30
|
+
* 按钮尺寸
|
|
31
|
+
* @default 'medium'
|
|
32
|
+
*/
|
|
33
|
+
size?: typeof BUTTON_SIZES;
|
|
34
|
+
/**
|
|
35
|
+
* 是否禁用
|
|
36
|
+
* @default false
|
|
37
|
+
*/
|
|
38
|
+
disabled?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* 自定义类名
|
|
41
|
+
*/
|
|
42
|
+
class?: string;
|
|
43
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { ClassValue } from 'clsx';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 合并类名工具函数
|
|
6
|
+
* 确保 Tailwind 类名优先级正确(比如 px-4 不会被 p-2 覆盖)
|
|
7
|
+
* 使用 twMerge 处理 Tailwind 类名冲突,clsx 处理条件类名
|
|
8
|
+
*/
|
|
9
|
+
export declare function cn(...inputs: ClassValue[]): string;
|
|
10
|
+
/**
|
|
11
|
+
* MTN Button 组件样式变体定义
|
|
12
|
+
* 基于 Ant Design Vue,添加 MTN 专属风格
|
|
13
|
+
* 使用 CVA (class-variance-authority) 管理样式变体
|
|
14
|
+
*
|
|
15
|
+
* 注意:Tailwind v4 的 important 语法是在类名后加 !,例如 bg-blue-500!
|
|
16
|
+
* 样式通过 Tailwind 类名生成,并在 theme/index.css 中通过 @layer components 增强
|
|
17
|
+
*/
|
|
18
|
+
export declare const mtnButtonVariants: (props?: ({
|
|
19
|
+
mtnVariant?: "none" | "glass" | "gradient" | "soft" | null | undefined;
|
|
20
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
21
|
+
/**
|
|
22
|
+
* MTN Button 组件变体类型
|
|
23
|
+
* 从 CVA 变体中自动推导类型
|
|
24
|
+
*/
|
|
25
|
+
export type MtnButtonVariantProps = VariantProps<typeof mtnButtonVariants>;
|
|
26
|
+
/**
|
|
27
|
+
* 保留旧的 buttonVariants 以保持向后兼容(可选)
|
|
28
|
+
* @deprecated 使用 mtnButtonVariants 代替
|
|
29
|
+
*/
|
|
30
|
+
export declare const buttonVariants: (props?: ({
|
|
31
|
+
mtnVariant?: "none" | "glass" | "gradient" | "soft" | null | undefined;
|
|
32
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
33
|
+
export type ButtonVariantProps = MtnButtonVariantProps;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
/**
|
|
3
|
+
* 确认对话框标题
|
|
4
|
+
*/
|
|
5
|
+
title?: string;
|
|
6
|
+
/**
|
|
7
|
+
* 确认对话框描述(可选)
|
|
8
|
+
*/
|
|
9
|
+
description?: string;
|
|
10
|
+
/**
|
|
11
|
+
* 确认按钮文字
|
|
12
|
+
*/
|
|
13
|
+
okText?: string;
|
|
14
|
+
/**
|
|
15
|
+
* 取消按钮文字
|
|
16
|
+
*/
|
|
17
|
+
cancelText?: string;
|
|
18
|
+
/**
|
|
19
|
+
* 确认按钮类型
|
|
20
|
+
*/
|
|
21
|
+
okType?: 'primary' | 'default' | 'dashed' | 'text' | 'link';
|
|
22
|
+
/**
|
|
23
|
+
* 确认按钮的额外属性(如 danger: true 用于删除等危险操作)
|
|
24
|
+
*/
|
|
25
|
+
okButtonProps?: Record<string, unknown>;
|
|
26
|
+
/**
|
|
27
|
+
* 权限标识,可以是单个权限字符串或权限数组
|
|
28
|
+
* 如果未提供,则不进行权限检查
|
|
29
|
+
*/
|
|
30
|
+
permission?: string | string[];
|
|
31
|
+
/**
|
|
32
|
+
* 权限控制模式
|
|
33
|
+
* - 'hide': 无权限时隐藏按钮(默认)
|
|
34
|
+
* - 'disable': 无权限时禁用按钮
|
|
35
|
+
*/
|
|
36
|
+
permissionAction?: 'hide' | 'disable';
|
|
37
|
+
/**
|
|
38
|
+
* 防抖延迟时间(毫秒)
|
|
39
|
+
* 如果设置了此属性,确认操作会被防抖处理
|
|
40
|
+
* 默认不启用防抖
|
|
41
|
+
*/
|
|
42
|
+
debounceMs?: number;
|
|
43
|
+
}
|
|
44
|
+
declare function __VLS_template(): Partial<Record<string, (_: any) => any>> & {
|
|
45
|
+
description?(_: {}): any;
|
|
46
|
+
};
|
|
47
|
+
declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
|
|
48
|
+
title: string;
|
|
49
|
+
okText: string;
|
|
50
|
+
cancelText: string;
|
|
51
|
+
okType: string;
|
|
52
|
+
permissionAction: string;
|
|
53
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
54
|
+
confirm: (e?: MouseEvent | undefined) => void;
|
|
55
|
+
cancel: (e?: MouseEvent | undefined) => void;
|
|
56
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
|
|
57
|
+
title: string;
|
|
58
|
+
okText: string;
|
|
59
|
+
cancelText: string;
|
|
60
|
+
okType: string;
|
|
61
|
+
permissionAction: string;
|
|
62
|
+
}>>> & Readonly<{
|
|
63
|
+
onConfirm?: ((e?: MouseEvent | undefined) => any) | undefined;
|
|
64
|
+
onCancel?: ((e?: MouseEvent | undefined) => any) | undefined;
|
|
65
|
+
}>, {
|
|
66
|
+
title: string;
|
|
67
|
+
permissionAction: "hide" | "disable";
|
|
68
|
+
okText: string;
|
|
69
|
+
cancelText: string;
|
|
70
|
+
okType: "primary" | "default" | "dashed" | "text" | "link";
|
|
71
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
72
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
73
|
+
export default _default;
|
|
74
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
75
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
76
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
77
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
78
|
+
} : {
|
|
79
|
+
type: import('vue').PropType<T[K]>;
|
|
80
|
+
required: true;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
type __VLS_WithDefaults<P, D> = {
|
|
84
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
85
|
+
default: D[K];
|
|
86
|
+
}> : P[K];
|
|
87
|
+
};
|
|
88
|
+
type __VLS_Prettify<T> = {
|
|
89
|
+
[K in keyof T]: T[K];
|
|
90
|
+
} & {};
|
|
91
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
92
|
+
new (): {
|
|
93
|
+
$slots: S;
|
|
94
|
+
};
|
|
95
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { PopconfirmProps as APopconfirmProps } from 'ant-design-vue';
|
|
2
|
+
import { PermissionAction } from '@mtn-ui/utils';
|
|
3
|
+
import { ButtonProps as MtnButtonProps } from '../button/types';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* ConfirmButton 组件属性接口
|
|
7
|
+
*/
|
|
8
|
+
export interface ConfirmButtonProps extends /* @vue-ignore */ Omit<APopconfirmProps, 'title'>, Omit<MtnButtonProps, 'onClick'> {
|
|
9
|
+
/**
|
|
10
|
+
* 确认对话框标题
|
|
11
|
+
*/
|
|
12
|
+
title?: string;
|
|
13
|
+
/**
|
|
14
|
+
* 确认对话框描述(可选)
|
|
15
|
+
*/
|
|
16
|
+
description?: string;
|
|
17
|
+
/**
|
|
18
|
+
* 确认按钮文字
|
|
19
|
+
*/
|
|
20
|
+
okText?: string;
|
|
21
|
+
/**
|
|
22
|
+
* 取消按钮文字
|
|
23
|
+
*/
|
|
24
|
+
cancelText?: string;
|
|
25
|
+
/**
|
|
26
|
+
* 确认按钮类型
|
|
27
|
+
*/
|
|
28
|
+
okType?: 'primary' | 'default' | 'dashed' | 'text' | 'link';
|
|
29
|
+
/**
|
|
30
|
+
* 确认按钮的额外属性(如 { danger: true } 用于删除等危险操作,弹窗内「确定」会变红)
|
|
31
|
+
*/
|
|
32
|
+
okButtonProps?: Record<string, unknown>;
|
|
33
|
+
/**
|
|
34
|
+
* 权限标识,可以是单个权限字符串或权限数组
|
|
35
|
+
*/
|
|
36
|
+
permission?: string | string[];
|
|
37
|
+
/**
|
|
38
|
+
* 权限控制模式
|
|
39
|
+
*/
|
|
40
|
+
permissionAction?: PermissionAction;
|
|
41
|
+
/**
|
|
42
|
+
* 防抖延迟时间(毫秒)
|
|
43
|
+
*/
|
|
44
|
+
debounceMs?: number;
|
|
45
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
/**
|
|
3
|
+
* 确认对话框标题
|
|
4
|
+
* @default '确定要删除吗?'
|
|
5
|
+
*/
|
|
6
|
+
title?: string;
|
|
7
|
+
/**
|
|
8
|
+
* 确认对话框描述(可选)
|
|
9
|
+
*/
|
|
10
|
+
description?: string;
|
|
11
|
+
/**
|
|
12
|
+
* 是否显示删除图标
|
|
13
|
+
* @default true
|
|
14
|
+
*/
|
|
15
|
+
showIcon?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* 权限标识,可以是单个权限字符串或权限数组
|
|
18
|
+
*/
|
|
19
|
+
permission?: string | string[];
|
|
20
|
+
/**
|
|
21
|
+
* 权限控制模式
|
|
22
|
+
*/
|
|
23
|
+
permissionAction?: 'hide' | 'disable';
|
|
24
|
+
/**
|
|
25
|
+
* 防抖延迟时间(毫秒)
|
|
26
|
+
*/
|
|
27
|
+
debounceMs?: number;
|
|
28
|
+
}
|
|
29
|
+
declare function __VLS_template(): {
|
|
30
|
+
icon?(_: {}): any;
|
|
31
|
+
default?(_: {}): any;
|
|
32
|
+
};
|
|
33
|
+
declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
|
|
34
|
+
title: string;
|
|
35
|
+
showIcon: boolean;
|
|
36
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
37
|
+
confirm: (e?: MouseEvent | undefined) => void;
|
|
38
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
|
|
39
|
+
title: string;
|
|
40
|
+
showIcon: boolean;
|
|
41
|
+
}>>> & Readonly<{
|
|
42
|
+
onConfirm?: ((e?: MouseEvent | undefined) => any) | undefined;
|
|
43
|
+
}>, {
|
|
44
|
+
title: string;
|
|
45
|
+
showIcon: boolean;
|
|
46
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
47
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
48
|
+
export default _default;
|
|
49
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
50
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
51
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
52
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
53
|
+
} : {
|
|
54
|
+
type: import('vue').PropType<T[K]>;
|
|
55
|
+
required: true;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
type __VLS_WithDefaults<P, D> = {
|
|
59
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
60
|
+
default: D[K];
|
|
61
|
+
}> : P[K];
|
|
62
|
+
};
|
|
63
|
+
type __VLS_Prettify<T> = {
|
|
64
|
+
[K in keyof T]: T[K];
|
|
65
|
+
} & {};
|
|
66
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
67
|
+
new (): {
|
|
68
|
+
$slots: S;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { PermissionAction } from '@mtn-ui/utils';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* DeleteButton 组件属性接口
|
|
5
|
+
*/
|
|
6
|
+
export interface DeleteButtonProps {
|
|
7
|
+
/**
|
|
8
|
+
* 确认对话框标题
|
|
9
|
+
*/
|
|
10
|
+
title?: string;
|
|
11
|
+
/**
|
|
12
|
+
* 确认对话框描述(可选)
|
|
13
|
+
*/
|
|
14
|
+
description?: string;
|
|
15
|
+
/**
|
|
16
|
+
* 是否显示删除图标
|
|
17
|
+
*/
|
|
18
|
+
showIcon?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* 权限标识,可以是单个权限字符串或权限数组
|
|
21
|
+
*/
|
|
22
|
+
permission?: string | string[];
|
|
23
|
+
/**
|
|
24
|
+
* 权限控制模式
|
|
25
|
+
*/
|
|
26
|
+
permissionAction?: PermissionAction;
|
|
27
|
+
/**
|
|
28
|
+
* 防抖延迟时间(毫秒)
|
|
29
|
+
*/
|
|
30
|
+
debounceMs?: number;
|
|
31
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Plugin } from 'vue';
|
|
2
|
+
|
|
3
|
+
export * from './button';
|
|
4
|
+
export type * from './button/types';
|
|
5
|
+
export * from './action-group';
|
|
6
|
+
export type * from './action-group/types';
|
|
7
|
+
export * from './confirm-button';
|
|
8
|
+
export type * from './confirm-button/types';
|
|
9
|
+
export * from './delete-button';
|
|
10
|
+
export type * from './delete-button/types';
|
|
11
|
+
export type * from './button/types';
|
|
12
|
+
/**
|
|
13
|
+
* MTN UI Vue Plugin
|
|
14
|
+
* 用于全量注册所有组件
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* import MtnUI from '@mtn-ui/components'
|
|
19
|
+
* import '@mtn-ui/components/style' // 需要手动导入样式
|
|
20
|
+
* app.use(MtnUI)
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
declare const MtnUI: Plugin;
|
|
24
|
+
export default MtnUI;
|
|
25
|
+
export declare const version = "1.0.0";
|
|
26
|
+
export { MtnUIResolver, default as resolver } from './resolver';
|
|
27
|
+
export { usePermission, type UsePermissionOptions, type UsePermissionReturn, type PermissionAction } from '@mtn-ui/utils';
|
package/package.json
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mtn-ui/components",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "MTN UI Components",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/types/index.d.ts",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist"
|
|
11
|
+
],
|
|
12
|
+
"sideEffects": [
|
|
13
|
+
"**/*.css",
|
|
14
|
+
"**/*.scss",
|
|
15
|
+
"./dist/index.css",
|
|
16
|
+
"./dist/**/*.css"
|
|
17
|
+
],
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./dist/types/index.d.ts",
|
|
21
|
+
"development": "./src/index.ts",
|
|
22
|
+
"import": "./dist/index.js"
|
|
23
|
+
},
|
|
24
|
+
"./style": {
|
|
25
|
+
"development": "./src/style.css",
|
|
26
|
+
"import": "./dist/index.css"
|
|
27
|
+
},
|
|
28
|
+
"./button": {
|
|
29
|
+
"types": "./dist/types/button/index.d.ts",
|
|
30
|
+
"development": "./src/button/index.ts",
|
|
31
|
+
"import": "./dist/button/index.js"
|
|
32
|
+
},
|
|
33
|
+
"./resolver": {
|
|
34
|
+
"types": "./dist/types/resolver.d.ts",
|
|
35
|
+
"development": "./src/resolver.ts",
|
|
36
|
+
"import": "./dist/resolver.js"
|
|
37
|
+
},
|
|
38
|
+
"./package.json": "./package.json"
|
|
39
|
+
},
|
|
40
|
+
"publishConfig": {
|
|
41
|
+
"access": "public"
|
|
42
|
+
},
|
|
43
|
+
"keywords": [
|
|
44
|
+
"vue",
|
|
45
|
+
"vue3",
|
|
46
|
+
"component-library",
|
|
47
|
+
"ui",
|
|
48
|
+
"tailwindcss"
|
|
49
|
+
],
|
|
50
|
+
"license": "MIT",
|
|
51
|
+
"repository": {
|
|
52
|
+
"type": "git",
|
|
53
|
+
"url": ""
|
|
54
|
+
},
|
|
55
|
+
"peerDependencies": {
|
|
56
|
+
"@ant-design/icons-vue": ">=7.0.0",
|
|
57
|
+
"@vueuse/core": ">=10.0.0",
|
|
58
|
+
"ant-design-vue": ">=4.0.0",
|
|
59
|
+
"unplugin-vue-components": ">=0.25.0",
|
|
60
|
+
"vue": "^3.5.0"
|
|
61
|
+
},
|
|
62
|
+
"devDependencies": {
|
|
63
|
+
"@ant-design/icons-vue": "^7.0.1",
|
|
64
|
+
"@tailwindcss/vite": "^4.0.0",
|
|
65
|
+
"@vitejs/plugin-vue": "^5.0.0",
|
|
66
|
+
"@vueuse/core": "^11.0.0",
|
|
67
|
+
"ant-design-vue": "^4.2.6",
|
|
68
|
+
"class-variance-authority": "^0.7.1",
|
|
69
|
+
"clsx": "^2.1.1",
|
|
70
|
+
"rollup": "^4.9.0",
|
|
71
|
+
"sass": "^1.77.0",
|
|
72
|
+
"tailwind-merge": "^3.4.0",
|
|
73
|
+
"tailwindcss": "^4.0.0",
|
|
74
|
+
"unplugin-vue-components": "^0.25.0",
|
|
75
|
+
"vite-plugin-dts": "^3.9.0",
|
|
76
|
+
"vue": "^3.5.0",
|
|
77
|
+
"vue-tsc": "^2.0.0"
|
|
78
|
+
},
|
|
79
|
+
"dependencies": {
|
|
80
|
+
"@mtn-ui/utils": "1.0.0"
|
|
81
|
+
},
|
|
82
|
+
"scripts": {
|
|
83
|
+
"build": "vite build",
|
|
84
|
+
"type-check": "vue-tsc --noEmit"
|
|
85
|
+
}
|
|
86
|
+
}
|