mc-plus 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.
- package/dist/es/hooks-c7yYlQyM.js +15 -0
- package/dist/es/index.js +46 -10
- package/dist/es/mc-alert-DoOso0Gr.js +12 -0
- package/dist/es/{mc-button-D6IV1cvA.js → mc-button-CUHRxe0J.js} +3 -3
- package/dist/es/mc-checkbox-B38O15cu.js +11 -0
- package/dist/es/{mc-collapse-DE4emHTm.js → mc-collapse-HNiVA8cx.js} +2 -2
- package/dist/es/{mc-icon-B0xq3JPC.js → mc-icon--CImsgxi.js} +1 -1
- package/dist/es/mc-input-C0-hVMB4.js +16 -0
- package/dist/es/mc-message-CypXiHrq.js +51 -0
- package/dist/es/mc-radio-BZwvlo2W.js +23 -0
- package/dist/es/mc-select-AXjlPhsg.js +52 -0
- package/dist/es/mc-switch-B6sZH0JJ.js +11 -0
- package/dist/es/mc-table-CT4Mb5B4.js +252 -0
- package/dist/es/mc-tag-aW5PUBk2.js +33 -0
- package/dist/es/mc-toast-CmkXAYH6.js +52 -0
- package/dist/es/mc-tooltip-CSuvzJyd.js +33 -0
- package/dist/es/theme/index.css +1 -1
- package/dist/es/theme/mc-alert.css +1 -0
- package/dist/es/theme/mc-checkbox.css +1 -0
- package/dist/es/theme/mc-input.css +1 -0
- package/dist/es/theme/mc-message.css +1 -0
- package/dist/es/theme/mc-radio.css +1 -0
- package/dist/es/theme/mc-select.css +1 -0
- package/dist/es/theme/mc-switch.css +1 -0
- package/dist/es/theme/mc-table.css +1 -0
- package/dist/es/theme/mc-tag.css +1 -0
- package/dist/es/theme/mc-toast.css +1 -0
- package/dist/es/theme/mc-tooltip.css +1 -0
- package/dist/es/{utils-CDDTlenj.js → utils-BwgRXuj9.js} +1 -1
- package/dist/es/vendor-CNzO2Q1s.js +506 -0
- package/dist/index.css +1 -1
- package/dist/types/components/index.d.ts +12 -1
- package/dist/types/components/mc-alert/index.d.ts +49 -0
- package/dist/types/components/mc-alert/types.d.ts +17 -0
- package/dist/types/components/mc-checkbox/index.d.ts +29 -0
- package/dist/types/components/mc-checkbox/types.d.ts +15 -0
- package/dist/types/components/mc-form/constanst.d.ts +4 -0
- package/dist/types/components/mc-form/types.d.ts +47 -0
- package/dist/types/components/mc-input/index.d.ts +57 -0
- package/dist/types/components/mc-input/types.d.ts +17 -0
- package/dist/types/components/mc-message/index.d.ts +61 -0
- package/dist/types/components/mc-message/types.d.ts +34 -0
- package/dist/types/components/mc-radio/constant.d.ts +3 -0
- package/dist/types/components/mc-radio/index.d.ts +51 -0
- package/dist/types/components/mc-radio/types.d.ts +20 -0
- package/dist/types/components/mc-select/constant.d.ts +4 -0
- package/dist/types/components/mc-select/index.d.ts +93 -0
- package/dist/types/components/mc-select/types.d.ts +42 -0
- package/dist/types/components/mc-switch/index.d.ts +45 -0
- package/dist/types/components/mc-switch/types.d.ts +15 -0
- package/dist/types/components/mc-table/composables/usePagination.d.ts +11 -0
- package/dist/types/components/mc-table/composables/useTableScroll.d.ts +13 -0
- package/dist/types/components/mc-table/composables/useTableSort.d.ts +17 -0
- package/dist/types/components/mc-table/index.d.ts +7 -0
- package/dist/types/components/mc-table/types.d.ts +168 -0
- package/dist/types/components/mc-tag/index.d.ts +60 -0
- package/dist/types/components/mc-tag/types.d.ts +28 -0
- package/dist/types/components/mc-toast/index.d.ts +61 -0
- package/dist/types/components/mc-toast/toast.d.ts +19 -0
- package/dist/types/components/mc-toast/types.d.ts +21 -0
- package/dist/types/components/mc-tooltip/index.d.ts +65 -0
- package/dist/types/components/mc-tooltip/types.d.ts +20 -0
- package/dist/types/hooks/index.d.ts +2 -0
- package/dist/types/hooks/useClickOutside.d.ts +2 -0
- package/dist/types/hooks/useEventListener.d.ts +2 -0
- package/dist/umd/index.css +1 -1
- package/dist/umd/index.css.gz +0 -0
- package/dist/umd/index.umd.cjs +3 -1
- package/dist/umd/index.umd.cjs.gz +0 -0
- package/package.json +4 -1
- package/dist/es/vendor-D4RgMZ9r.js +0 -171
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { TableColumn } from '../types';
|
|
3
|
+
export declare function useTableScroll(columns: Ref<TableColumn[]>, headerRef: Ref<{
|
|
4
|
+
headerWrapper?: HTMLDivElement;
|
|
5
|
+
} | undefined>, bodyRef: Ref<{
|
|
6
|
+
bodyWrapper?: HTMLDivElement;
|
|
7
|
+
} | undefined>): {
|
|
8
|
+
hasHorizontalScroll: Ref<boolean, boolean>;
|
|
9
|
+
columnsWithFixed: import('vue').ComputedRef<TableColumn[]>;
|
|
10
|
+
checkHorizontalScroll: () => void;
|
|
11
|
+
syncHeaderScroll: () => void;
|
|
12
|
+
initScrollSync: () => void;
|
|
13
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { SortConfig, SortOrder, TableColumn } from '../types';
|
|
3
|
+
export declare function useTableSort(data: Ref<Record<string, unknown>[]>, columns: Ref<TableColumn[]>, defaultSort?: SortConfig): {
|
|
4
|
+
sortedData: import('vue').ComputedRef<Record<string, unknown>[]>;
|
|
5
|
+
currentSort: Ref<{
|
|
6
|
+
prop: string;
|
|
7
|
+
order: SortOrder;
|
|
8
|
+
} | null, SortConfig | {
|
|
9
|
+
prop: string;
|
|
10
|
+
order: SortOrder;
|
|
11
|
+
} | null>;
|
|
12
|
+
handleSort: (column: TableColumn) => {
|
|
13
|
+
prop: string;
|
|
14
|
+
order: SortOrder;
|
|
15
|
+
} | null | undefined;
|
|
16
|
+
getSortOrder: (prop: string) => SortOrder;
|
|
17
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { default as McTable } from './mc-table.vue';
|
|
2
|
+
export { McTable };
|
|
3
|
+
export default McTable;
|
|
4
|
+
export * from './composables/usePagination';
|
|
5
|
+
export * from './composables/useTableScroll';
|
|
6
|
+
export * from './composables/useTableSort';
|
|
7
|
+
export * from './types';
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
export type RowData = Record<string, unknown>;
|
|
3
|
+
export type SortDirection = "asc" | "desc";
|
|
4
|
+
export type SortOrder = SortDirection | null;
|
|
5
|
+
export type AlignType = "left" | "center" | "right";
|
|
6
|
+
export type ColumnFixed = boolean | "left" | "right";
|
|
7
|
+
export interface TableProps {
|
|
8
|
+
data: RowData[];
|
|
9
|
+
columns: TableColumn[];
|
|
10
|
+
showHeader?: boolean;
|
|
11
|
+
height?: string | number;
|
|
12
|
+
maxHeight?: string | number;
|
|
13
|
+
rowKey?: string;
|
|
14
|
+
emptyText?: string;
|
|
15
|
+
pagination?: PaginationConfig;
|
|
16
|
+
loading?: boolean;
|
|
17
|
+
loadingText?: string;
|
|
18
|
+
loadingConfig?: LoadingConfig;
|
|
19
|
+
highlightCurrentRow?: boolean;
|
|
20
|
+
selectable?: boolean;
|
|
21
|
+
selectedRows?: RowData[];
|
|
22
|
+
selectOnRowClick?: boolean;
|
|
23
|
+
spanMethod?: (params: {
|
|
24
|
+
row: RowData;
|
|
25
|
+
column: TableColumn;
|
|
26
|
+
rowIndex: number;
|
|
27
|
+
columnIndex: number;
|
|
28
|
+
}) => {
|
|
29
|
+
rowspan?: number;
|
|
30
|
+
colspan?: number;
|
|
31
|
+
} | [number, number];
|
|
32
|
+
initData?: (params: {
|
|
33
|
+
pageSize: number;
|
|
34
|
+
pageNum: number;
|
|
35
|
+
}) => Promise<{
|
|
36
|
+
data: RowData[];
|
|
37
|
+
total: number;
|
|
38
|
+
}>;
|
|
39
|
+
defaultSort?: SortConfig;
|
|
40
|
+
}
|
|
41
|
+
export interface PaginationConfig {
|
|
42
|
+
currentPage?: number;
|
|
43
|
+
pageSize?: number;
|
|
44
|
+
total: number;
|
|
45
|
+
pageSizes?: number[];
|
|
46
|
+
background?: boolean;
|
|
47
|
+
}
|
|
48
|
+
export interface LoadingConfig {
|
|
49
|
+
text?: string;
|
|
50
|
+
spinner?: string;
|
|
51
|
+
background?: string;
|
|
52
|
+
customClass?: string;
|
|
53
|
+
}
|
|
54
|
+
export interface SortConfig {
|
|
55
|
+
prop: string;
|
|
56
|
+
order: SortOrder;
|
|
57
|
+
}
|
|
58
|
+
export interface TableColumn {
|
|
59
|
+
prop: string;
|
|
60
|
+
label: string;
|
|
61
|
+
width?: number | string;
|
|
62
|
+
fixed?: ColumnFixed;
|
|
63
|
+
formatter?: (row: RowData, column: TableColumn, cellValue: unknown, index: number) => unknown;
|
|
64
|
+
align?: AlignType;
|
|
65
|
+
headerAlign?: AlignType;
|
|
66
|
+
className?: string;
|
|
67
|
+
headerClassName?: string;
|
|
68
|
+
slot?: string;
|
|
69
|
+
colSpan?: number | ((row: RowData, column: TableColumn, index: number) => number);
|
|
70
|
+
rowSpan?: number | ((row: RowData, column: TableColumn, index: number) => number);
|
|
71
|
+
sortable?: boolean;
|
|
72
|
+
sortOrder?: SortOrder;
|
|
73
|
+
sortMethod?: (a: unknown, b: unknown) => number;
|
|
74
|
+
}
|
|
75
|
+
export interface TableEmits {
|
|
76
|
+
(e: "row-click", row: RowData, index: number): void;
|
|
77
|
+
(e: "header-click", column: TableColumn, event: Event): void;
|
|
78
|
+
(e: "page-change", payload: {
|
|
79
|
+
pageSize: number;
|
|
80
|
+
pageNum: number;
|
|
81
|
+
}): void;
|
|
82
|
+
(e: "page-size-change", pageSize: number): void;
|
|
83
|
+
(e: "sort-change", config: SortConfig): void;
|
|
84
|
+
(e: "current-change", currentRow: RowData | null): void;
|
|
85
|
+
(e: "selection-change", selectedRows: RowData[]): void;
|
|
86
|
+
(e: "select", row: RowData, selected: boolean): void;
|
|
87
|
+
(e: "select-all", selected: boolean): void;
|
|
88
|
+
(e: "update:selectedRows", selectedRows: RowData[]): void;
|
|
89
|
+
}
|
|
90
|
+
export interface CellSlotProps {
|
|
91
|
+
row: RowData;
|
|
92
|
+
column: TableColumn;
|
|
93
|
+
$index: number;
|
|
94
|
+
value: unknown;
|
|
95
|
+
prop: string;
|
|
96
|
+
}
|
|
97
|
+
export interface HeaderSlotProps {
|
|
98
|
+
column: TableColumn;
|
|
99
|
+
index: number;
|
|
100
|
+
}
|
|
101
|
+
export interface TableInstance {
|
|
102
|
+
ref: Ref<HTMLElement | undefined>;
|
|
103
|
+
refresh: () => Promise<void>;
|
|
104
|
+
clearSort: () => void;
|
|
105
|
+
toggleRowSelection: (row: RowData, selected?: boolean) => void;
|
|
106
|
+
toggleAllSelection: (selected: boolean) => void;
|
|
107
|
+
clearSelection: () => void;
|
|
108
|
+
getSelectedRows: () => RowData[];
|
|
109
|
+
}
|
|
110
|
+
export interface TableCellProps {
|
|
111
|
+
row: Record<string, unknown>;
|
|
112
|
+
column: TableColumn;
|
|
113
|
+
rowIndex: number;
|
|
114
|
+
columnIndex: number;
|
|
115
|
+
pagination?: {
|
|
116
|
+
currentPage?: number;
|
|
117
|
+
pageSize?: number;
|
|
118
|
+
total: number;
|
|
119
|
+
};
|
|
120
|
+
spanMethod?: (data: {
|
|
121
|
+
row: Record<string, unknown>;
|
|
122
|
+
column: TableColumn;
|
|
123
|
+
rowIndex: number;
|
|
124
|
+
columnIndex: number;
|
|
125
|
+
}) => {
|
|
126
|
+
rowspan?: number;
|
|
127
|
+
colspan?: number;
|
|
128
|
+
} | [number, number];
|
|
129
|
+
}
|
|
130
|
+
export interface McTableHeaderProps {
|
|
131
|
+
columns: TableColumn[];
|
|
132
|
+
showHeader?: boolean;
|
|
133
|
+
getSortOrder?: (prop: string) => SortOrder;
|
|
134
|
+
selectable?: boolean;
|
|
135
|
+
isAllSelected?: boolean;
|
|
136
|
+
isIndeterminate?: boolean;
|
|
137
|
+
}
|
|
138
|
+
export interface TableHeaderEmits {
|
|
139
|
+
(e: "header-click", column: TableColumn, event: Event): void;
|
|
140
|
+
(e: "sort-change", column: TableColumn): void;
|
|
141
|
+
(e: "select-all", selected: boolean): void;
|
|
142
|
+
}
|
|
143
|
+
export interface McTableBodyProps {
|
|
144
|
+
data: Record<string, unknown>[];
|
|
145
|
+
columns: TableColumn[];
|
|
146
|
+
rowKey?: string;
|
|
147
|
+
emptyText?: string;
|
|
148
|
+
height?: string | number;
|
|
149
|
+
maxHeight?: string | number;
|
|
150
|
+
pagination?: PaginationConfig;
|
|
151
|
+
spanMethod?: (data: {
|
|
152
|
+
row: Record<string, unknown>;
|
|
153
|
+
column: TableColumn;
|
|
154
|
+
rowIndex: number;
|
|
155
|
+
columnIndex: number;
|
|
156
|
+
}) => {
|
|
157
|
+
rowspan?: number;
|
|
158
|
+
colspan?: number;
|
|
159
|
+
} | [number, number];
|
|
160
|
+
getRowClass?: (row: Record<string, unknown>, index: number) => string[];
|
|
161
|
+
selectable?: boolean;
|
|
162
|
+
selectedRows?: RowData[];
|
|
163
|
+
selectOnRowClick?: boolean;
|
|
164
|
+
}
|
|
165
|
+
export interface TableBodyEmits {
|
|
166
|
+
(e: "row-click", row: Record<string, unknown>, index: number): void;
|
|
167
|
+
(e: "select", row: RowData, selected: boolean): void;
|
|
168
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export * from './types';
|
|
2
|
+
export declare const McTag: {
|
|
3
|
+
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('../../core').TagProps> & Readonly<{
|
|
4
|
+
onClick?: ((val: MouseEvent) => any) | undefined;
|
|
5
|
+
onClose?: ((val: MouseEvent) => any) | undefined;
|
|
6
|
+
}>, {
|
|
7
|
+
ref: import('vue').Ref<HTMLDivElement | void>;
|
|
8
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
9
|
+
click: (val: MouseEvent) => any;
|
|
10
|
+
close: (val: MouseEvent) => any;
|
|
11
|
+
}, import('vue').PublicProps, {
|
|
12
|
+
size: import('../../core').TagSize;
|
|
13
|
+
type: import('../../core').TagType;
|
|
14
|
+
closable: boolean;
|
|
15
|
+
disabled: boolean;
|
|
16
|
+
radius: import('../../core').TagRadius;
|
|
17
|
+
}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
|
|
18
|
+
_ref: HTMLDivElement;
|
|
19
|
+
}, any, import('vue').ComponentProvideOptions, {
|
|
20
|
+
P: {};
|
|
21
|
+
B: {};
|
|
22
|
+
D: {};
|
|
23
|
+
C: {};
|
|
24
|
+
M: {};
|
|
25
|
+
Defaults: {};
|
|
26
|
+
}, Readonly<import('../../core').TagProps> & Readonly<{
|
|
27
|
+
onClick?: ((val: MouseEvent) => any) | undefined;
|
|
28
|
+
onClose?: ((val: MouseEvent) => any) | undefined;
|
|
29
|
+
}>, {
|
|
30
|
+
ref: import('vue').Ref<HTMLDivElement | void>;
|
|
31
|
+
}, {}, {}, {}, {
|
|
32
|
+
size: import('../../core').TagSize;
|
|
33
|
+
type: import('../../core').TagType;
|
|
34
|
+
closable: boolean;
|
|
35
|
+
disabled: boolean;
|
|
36
|
+
radius: import('../../core').TagRadius;
|
|
37
|
+
}>;
|
|
38
|
+
__isFragment?: never;
|
|
39
|
+
__isTeleport?: never;
|
|
40
|
+
__isSuspense?: never;
|
|
41
|
+
} & import('vue').ComponentOptionsBase<Readonly<import('../../core').TagProps> & Readonly<{
|
|
42
|
+
onClick?: ((val: MouseEvent) => any) | undefined;
|
|
43
|
+
onClose?: ((val: MouseEvent) => any) | undefined;
|
|
44
|
+
}>, {
|
|
45
|
+
ref: import('vue').Ref<HTMLDivElement | void>;
|
|
46
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
47
|
+
click: (val: MouseEvent) => any;
|
|
48
|
+
close: (val: MouseEvent) => any;
|
|
49
|
+
}, string, {
|
|
50
|
+
size: import('../../core').TagSize;
|
|
51
|
+
type: import('../../core').TagType;
|
|
52
|
+
closable: boolean;
|
|
53
|
+
disabled: boolean;
|
|
54
|
+
radius: import('../../core').TagRadius;
|
|
55
|
+
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
56
|
+
$slots: {
|
|
57
|
+
default?(_: {}): any;
|
|
58
|
+
};
|
|
59
|
+
}) & import('vue').Plugin;
|
|
60
|
+
export default McTag;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { IconType } from '../mc-icon/types';
|
|
3
|
+
export type TagType = "primary" | "plain";
|
|
4
|
+
export type TagSize = "medium" | "large" | "small";
|
|
5
|
+
export type TagRadius = "default" | "round" | "circle" | "square";
|
|
6
|
+
export interface TagProps {
|
|
7
|
+
type?: TagType;
|
|
8
|
+
size?: TagSize;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
closable?: boolean;
|
|
11
|
+
color?: string;
|
|
12
|
+
textColor?: string;
|
|
13
|
+
backgroundColor?: string;
|
|
14
|
+
selectedTextColor?: string;
|
|
15
|
+
selectedBackgroundColor?: string;
|
|
16
|
+
radius?: TagRadius;
|
|
17
|
+
height?: string;
|
|
18
|
+
width?: string;
|
|
19
|
+
icon?: IconType;
|
|
20
|
+
selected?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface TagEmits {
|
|
23
|
+
(e: "click", val: MouseEvent): void;
|
|
24
|
+
(e: "close", val: MouseEvent): void;
|
|
25
|
+
}
|
|
26
|
+
export interface TagInstance {
|
|
27
|
+
ref: Ref<HTMLDivElement | void>;
|
|
28
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export * from './toast';
|
|
2
|
+
export * from './types';
|
|
3
|
+
export declare const McToast: {
|
|
4
|
+
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('../../core').ToastProps> & Readonly<{
|
|
5
|
+
onClose?: (() => any) | undefined;
|
|
6
|
+
}>, {
|
|
7
|
+
ref: import('vue').Ref<HTMLDivElement | void>;
|
|
8
|
+
close: () => void;
|
|
9
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
10
|
+
close: () => any;
|
|
11
|
+
}, import('vue').PublicProps, {
|
|
12
|
+
title: string;
|
|
13
|
+
type: import('../../core').ToastType;
|
|
14
|
+
message: string;
|
|
15
|
+
duration: number;
|
|
16
|
+
showClose: boolean;
|
|
17
|
+
position: import('../../core').ToastPosition;
|
|
18
|
+
}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
|
|
19
|
+
_ref: HTMLDivElement;
|
|
20
|
+
}, HTMLDivElement, import('vue').ComponentProvideOptions, {
|
|
21
|
+
P: {};
|
|
22
|
+
B: {};
|
|
23
|
+
D: {};
|
|
24
|
+
C: {};
|
|
25
|
+
M: {};
|
|
26
|
+
Defaults: {};
|
|
27
|
+
}, Readonly<import('../../core').ToastProps> & Readonly<{
|
|
28
|
+
onClose?: (() => any) | undefined;
|
|
29
|
+
}>, {
|
|
30
|
+
ref: import('vue').Ref<HTMLDivElement | void>;
|
|
31
|
+
close: () => void;
|
|
32
|
+
}, {}, {}, {}, {
|
|
33
|
+
title: string;
|
|
34
|
+
type: import('../../core').ToastType;
|
|
35
|
+
message: string;
|
|
36
|
+
duration: number;
|
|
37
|
+
showClose: boolean;
|
|
38
|
+
position: import('../../core').ToastPosition;
|
|
39
|
+
}>;
|
|
40
|
+
__isFragment?: never;
|
|
41
|
+
__isTeleport?: never;
|
|
42
|
+
__isSuspense?: never;
|
|
43
|
+
} & import('vue').ComponentOptionsBase<Readonly<import('../../core').ToastProps> & Readonly<{
|
|
44
|
+
onClose?: (() => any) | undefined;
|
|
45
|
+
}>, {
|
|
46
|
+
ref: import('vue').Ref<HTMLDivElement | void>;
|
|
47
|
+
close: () => void;
|
|
48
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
49
|
+
close: () => any;
|
|
50
|
+
}, string, {
|
|
51
|
+
title: string;
|
|
52
|
+
type: import('../../core').ToastType;
|
|
53
|
+
message: string;
|
|
54
|
+
duration: number;
|
|
55
|
+
showClose: boolean;
|
|
56
|
+
position: import('../../core').ToastPosition;
|
|
57
|
+
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & import('vue').Plugin;
|
|
58
|
+
declare const _default: {
|
|
59
|
+
install: (app: any) => void;
|
|
60
|
+
};
|
|
61
|
+
export default _default;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ToastProps } from './types';
|
|
2
|
+
export declare const createToast: (options: ToastProps | string) => {
|
|
3
|
+
close: () => void;
|
|
4
|
+
};
|
|
5
|
+
export declare const toast: (options: ToastProps | string) => {
|
|
6
|
+
close: () => void;
|
|
7
|
+
};
|
|
8
|
+
export declare const toastPrimary: (options: ToastProps | string) => {
|
|
9
|
+
close: () => void;
|
|
10
|
+
};
|
|
11
|
+
export declare const toastSuccess: (options: ToastProps | string) => {
|
|
12
|
+
close: () => void;
|
|
13
|
+
};
|
|
14
|
+
export declare const toastWarning: (options: ToastProps | string) => {
|
|
15
|
+
close: () => void;
|
|
16
|
+
};
|
|
17
|
+
export declare const toastError: (options: ToastProps | string) => {
|
|
18
|
+
close: () => void;
|
|
19
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { IconType } from '../mc-icon/types';
|
|
3
|
+
export type ToastType = "primary" | "success" | "warning" | "error" | "info";
|
|
4
|
+
export type ToastPosition = "top" | "bottom";
|
|
5
|
+
export interface ToastProps {
|
|
6
|
+
type?: ToastType;
|
|
7
|
+
title?: string;
|
|
8
|
+
message?: string;
|
|
9
|
+
icon?: IconType;
|
|
10
|
+
showClose?: boolean;
|
|
11
|
+
duration?: number;
|
|
12
|
+
position?: ToastPosition;
|
|
13
|
+
onClose?: () => void;
|
|
14
|
+
}
|
|
15
|
+
export interface ToastEmits {
|
|
16
|
+
(e: "close"): void;
|
|
17
|
+
}
|
|
18
|
+
export interface ToastInstance {
|
|
19
|
+
ref: Ref<HTMLDivElement | void>;
|
|
20
|
+
close: () => void;
|
|
21
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export * from './types';
|
|
2
|
+
export declare const McTooltip: {
|
|
3
|
+
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('../../core').TooltipProps> & Readonly<{
|
|
4
|
+
"onVisible:change"?: ((value: boolean) => any) | undefined;
|
|
5
|
+
"onClick:outside"?: (() => any) | undefined;
|
|
6
|
+
}>, {
|
|
7
|
+
show(): void;
|
|
8
|
+
hide(): void;
|
|
9
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
10
|
+
"visible:change": (value: boolean) => any;
|
|
11
|
+
"click:outside": () => any;
|
|
12
|
+
}, import('vue').PublicProps, {
|
|
13
|
+
trigger: import('../../core').TooltipTrigger;
|
|
14
|
+
placement: import('@popperjs/core').Placement;
|
|
15
|
+
showTimeout: number;
|
|
16
|
+
hideTimeout: number;
|
|
17
|
+
transitionName: string;
|
|
18
|
+
}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
|
|
19
|
+
containerNode: HTMLDivElement;
|
|
20
|
+
triggerNode: HTMLDivElement;
|
|
21
|
+
popperNode: HTMLDivElement;
|
|
22
|
+
}, HTMLDivElement, import('vue').ComponentProvideOptions, {
|
|
23
|
+
P: {};
|
|
24
|
+
B: {};
|
|
25
|
+
D: {};
|
|
26
|
+
C: {};
|
|
27
|
+
M: {};
|
|
28
|
+
Defaults: {};
|
|
29
|
+
}, Readonly<import('../../core').TooltipProps> & Readonly<{
|
|
30
|
+
"onVisible:change"?: ((value: boolean) => any) | undefined;
|
|
31
|
+
"onClick:outside"?: (() => any) | undefined;
|
|
32
|
+
}>, {
|
|
33
|
+
show(): void;
|
|
34
|
+
hide(): void;
|
|
35
|
+
}, {}, {}, {}, {
|
|
36
|
+
trigger: import('../../core').TooltipTrigger;
|
|
37
|
+
placement: import('@popperjs/core').Placement;
|
|
38
|
+
showTimeout: number;
|
|
39
|
+
hideTimeout: number;
|
|
40
|
+
transitionName: string;
|
|
41
|
+
}>;
|
|
42
|
+
__isFragment?: never;
|
|
43
|
+
__isTeleport?: never;
|
|
44
|
+
__isSuspense?: never;
|
|
45
|
+
} & import('vue').ComponentOptionsBase<Readonly<import('../../core').TooltipProps> & Readonly<{
|
|
46
|
+
"onVisible:change"?: ((value: boolean) => any) | undefined;
|
|
47
|
+
"onClick:outside"?: (() => any) | undefined;
|
|
48
|
+
}>, {
|
|
49
|
+
show(): void;
|
|
50
|
+
hide(): void;
|
|
51
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
52
|
+
"visible:change": (value: boolean) => any;
|
|
53
|
+
"click:outside": () => any;
|
|
54
|
+
}, string, {
|
|
55
|
+
trigger: import('../../core').TooltipTrigger;
|
|
56
|
+
placement: import('@popperjs/core').Placement;
|
|
57
|
+
showTimeout: number;
|
|
58
|
+
hideTimeout: number;
|
|
59
|
+
transitionName: string;
|
|
60
|
+
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
61
|
+
$slots: {
|
|
62
|
+
default?(_: {}): any;
|
|
63
|
+
content?(_: {}): any;
|
|
64
|
+
};
|
|
65
|
+
}) & import('vue').Plugin;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Placement, Options } from '@popperjs/core';
|
|
2
|
+
export type TooltipTrigger = "hover" | "click";
|
|
3
|
+
export interface TooltipProps {
|
|
4
|
+
content?: string;
|
|
5
|
+
trigger?: TooltipTrigger;
|
|
6
|
+
placement?: Placement;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
popperOptions?: Partial<Options>;
|
|
9
|
+
showTimeout?: number;
|
|
10
|
+
hideTimeout?: number;
|
|
11
|
+
transitionName?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface TooltipEmits {
|
|
14
|
+
(e: "visible:change", value: boolean): void;
|
|
15
|
+
(e: "click:outside"): void;
|
|
16
|
+
}
|
|
17
|
+
export interface TooltipInstance {
|
|
18
|
+
show(): void;
|
|
19
|
+
hide(): void;
|
|
20
|
+
}
|