@weitutech/by-components-v3 1.1.17 → 1.1.18

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.
@@ -0,0 +1,8 @@
1
+ import ByDialog from './src/dialog.vue';
2
+ import ByDialogService from './src/ByDialogService';
3
+ import type { DialogService, DialogOptions, DialogResult, DialogButton, DialogProps } from './src/types';
4
+ export { ByDialog };
5
+ export { ByDialogService };
6
+ export type { DialogService, DialogOptions, DialogResult, DialogButton, DialogProps };
7
+ export default ByDialog;
8
+ export declare const dialogService: DialogService;
@@ -0,0 +1,4 @@
1
+ import type { DialogService } from './types.ts';
2
+ declare const ByDialogService: DialogService;
3
+ export default ByDialogService;
4
+ export { ByDialogService };
@@ -0,0 +1,35 @@
1
+ import type { DialogButton, DialogProps } from './types';
2
+ import './dialog.scss';
3
+ declare var __VLS_10: {}, __VLS_12: {};
4
+ type __VLS_Slots = {} & {
5
+ default?: (props: typeof __VLS_10) => any;
6
+ } & {
7
+ footer?: (props: typeof __VLS_12) => any;
8
+ };
9
+ declare const __VLS_component: import("vue").DefineComponent<DialogProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
10
+ cancel: (button: DialogButton, index: number) => any;
11
+ close: () => any;
12
+ confirm: (button: DialogButton, index: number) => any;
13
+ "update:visible": (visible: boolean) => any;
14
+ }, string, import("vue").PublicProps, Readonly<DialogProps> & Readonly<{
15
+ onCancel?: (button: DialogButton, index: number) => any;
16
+ onClose?: () => any;
17
+ onConfirm?: (button: DialogButton, index: number) => any;
18
+ "onUpdate:visible"?: (visible: boolean) => any;
19
+ }>, {
20
+ title: string;
21
+ width: string;
22
+ closeOnClickModal: boolean;
23
+ content: string;
24
+ customClass: string;
25
+ visible: boolean;
26
+ showFooter: boolean;
27
+ buttons: DialogButton[];
28
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
29
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
30
+ export default _default;
31
+ type __VLS_WithSlots<T, S> = T & {
32
+ new (): {
33
+ $slots: S;
34
+ };
35
+ };
@@ -0,0 +1,109 @@
1
+ /**
2
+ * 弹窗按钮配置接口
3
+ */
4
+ export interface DialogButton {
5
+ /** 按钮文本 */
6
+ text: string;
7
+ /** 按钮类型 */
8
+ type?: 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'text' | 'default';
9
+ /** 按钮尺寸 */
10
+ size?: 'large' | 'default' | 'small';
11
+ /** 是否显示加载状态 */
12
+ loading?: boolean;
13
+ /** 是否禁用 */
14
+ disabled?: boolean;
15
+ /** 自定义类名 */
16
+ class?: string;
17
+ /** 自定义样式 */
18
+ style?: string | Record<string, any>;
19
+ /** 图标 */
20
+ icon?: string;
21
+ /** 按钮动作 */
22
+ action?: string;
23
+ /** 按钮点击回调 */
24
+ callback?: () => boolean | void | Promise<boolean | void>;
25
+ }
26
+ /**
27
+ * 弹窗组件Props接口
28
+ */
29
+ export interface DialogProps {
30
+ /** 是否显示弹窗 */
31
+ visible: boolean;
32
+ /** 弹窗宽度 */
33
+ width?: string;
34
+ /** 标题 */
35
+ title?: string;
36
+ /** 内容(当没有插槽时使用) */
37
+ content?: string;
38
+ /** 是否显示底部按钮区域 */
39
+ showFooter?: boolean;
40
+ /** 是否点击模态层关闭弹窗 */
41
+ closeOnClickModal?: boolean;
42
+ /** 按钮配置 */
43
+ buttons?: DialogButton[];
44
+ /** 自定义类名 */
45
+ customClass?: string;
46
+ }
47
+ /**
48
+ * 弹窗服务选项接口
49
+ */
50
+ export interface DialogOptions extends Partial<DialogProps> {
51
+ /** 弹窗标题 */
52
+ title?: string;
53
+ /** 弹窗内容 */
54
+ content?: string;
55
+ /** 弹窗宽度 */
56
+ width?: string;
57
+ /** 距离顶部位置 */
58
+ top?: string;
59
+ /** 是否显示遮罩层 */
60
+ modal?: boolean;
61
+ /** 是否锁定滚动 */
62
+ lockScroll?: boolean;
63
+ /** 是否点击遮罩层关闭 */
64
+ closeOnClickModal?: boolean;
65
+ /** 是否按ESC键关闭 */
66
+ closeOnPressEscape?: boolean;
67
+ /** 是否显示关闭按钮 */
68
+ showClose?: boolean;
69
+ /** 是否居中显示 */
70
+ center?: boolean;
71
+ /** 自定义类名 */
72
+ customClass?: string;
73
+ /** 是否显示底部按钮区域 */
74
+ showFooter?: boolean;
75
+ /** 按钮配置 */
76
+ buttons?: DialogButton[];
77
+ }
78
+ /**
79
+ * 弹窗服务返回结果接口
80
+ */
81
+ export interface DialogResult {
82
+ /** 动作类型 */
83
+ action: string;
84
+ /** 按钮配置 */
85
+ button?: DialogButton;
86
+ /** 按钮索引 */
87
+ index?: number;
88
+ }
89
+ /**
90
+ * 弹窗服务接口
91
+ */
92
+ export interface DialogService {
93
+ /** 警告弹窗 */
94
+ alert: (content: string, title?: string, options?: DialogOptions) => Promise<DialogResult>;
95
+ /** 确认弹窗 */
96
+ confirm: (content: string, title?: string, options?: DialogOptions) => Promise<DialogResult>;
97
+ /** 成功提示弹窗 */
98
+ success: (content: string, title?: string, options?: DialogOptions) => Promise<DialogResult>;
99
+ /** 错误提示弹窗 */
100
+ error: (content: string, title?: string, options?: DialogOptions) => Promise<DialogResult>;
101
+ /** 信息提示弹窗 */
102
+ info: (content: string, title?: string, options?: DialogOptions) => Promise<DialogResult>;
103
+ /** 自定义弹窗 */
104
+ custom: (options: DialogOptions) => Promise<DialogResult>;
105
+ /** 显示弹窗 */
106
+ show: (options: DialogOptions) => Promise<DialogResult>;
107
+ /** 作为 Vue 插件安装(可选) */
108
+ install?: (app: import('vue').App) => void;
109
+ }
@@ -2,6 +2,7 @@ import type { App } from 'vue';
2
2
  export * from './form/src/props';
3
3
  export * from './pager/types';
4
4
  export * from './tool-bar/ToolBarType';
5
+ export * from './dialog/src/types';
5
6
  import 'vxe-pc-ui/lib/style.css';
6
7
  import 'vxe-table/lib/style.css';
7
8
  import './index.scss';
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ export default _default;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@weitutech/by-components-v3",
4
- "version": "1.1.17",
4
+ "version": "1.1.18",
5
5
  "private": false,
6
6
  "main": "/src/main.ts",
7
7
  "module": "./dist/by-components-v3.js",