@solfacil/girassol 0.4.0 → 0.6.0
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/README.md +32 -13
- package/dist/components.d.ts +1 -0
- package/dist/components.json +1 -1
- package/dist/girassol.es.js +1877 -1602
- package/dist/girassol.umd.js +6 -6
- package/dist/style.css +1 -1
- package/dist/theme/solfacil/borders.d.ts +0 -1
- package/dist/theme/solfacil/effects.d.ts +1 -0
- package/dist/theme/solfacil/screens.d.ts +17 -5
- package/dist/types/components/forms/button/button-destructive/ButtonDestructive.vue.d.ts +30 -7
- package/dist/types/components/forms/inputs/input-core/Input.vue.d.ts +1 -1
- package/dist/types/components/forms/inputs/input-text/InputText.vue.d.ts +3 -3
- package/dist/types/components/forms/inputs/input-textarea/InputTextarea.vue.d.ts +3 -3
- package/dist/types/components/forms/inputs/types.d.ts +1 -1
- package/dist/types/components/forms/select/types.d.ts +1 -1
- package/dist/types/components/forms/switch/Switch.vue.d.ts +3 -0
- package/dist/types/components/loader/CircleLoader.vue.d.ts +3 -3
- package/dist/types/components/modal/Modal.vue.d.ts +209 -0
- package/dist/types/components/modal/index.d.ts +2 -0
- package/dist/types/components/modal/modal.spec.d.ts +1 -0
- package/dist/types/components/modal/types.d.ts +16 -0
- package/dist/types/components/overlay/Overlay.vue.d.ts +2 -0
- package/dist/types/composables/use-modal/index.d.ts +4 -0
- package/dist/types/composables/use-toast/Toast.vue.d.ts +29 -25
- package/dist/types/composables/use-toast/index.d.ts +11 -6
- package/dist/types/composables/use-toast/types.d.ts +31 -4
- package/dist/types/index.d.ts +316 -17
- package/package.json +9 -4
- package/theme/solfacil/borders.ts +0 -1
- package/theme/solfacil/effects.ts +6 -4
- package/theme/solfacil/screens.ts +16 -5
- package/vite.config.ts +5 -0
- package/cli/build/cli.js +0 -68
- package/cli/build/commands/create:component.js +0 -124
- package/cli/build/commands/generate:plugin.js +0 -89
- package/cli/build/commands/generate:types.js +0 -76
- package/cli/build/commands/girassol-cli.js +0 -52
- package/cli/build/extensions/cli-extension.js +0 -17
- package/cli/build/templates/components.d.ts.ejs +0 -1
- package/cli/build/templates/nuxt-plugin.ejs +0 -8
- package/cli/build/templates/vue-plugin.ejs +0 -5
- package/cli/build/templates/windi.config.ts.ejs +0 -3
- package/cli/build/types/cli.d.ts +0 -1
- package/cli/build/types/commands/create:component.d.ts +0 -1
- package/cli/build/types/commands/generate:plugin.d.ts +0 -1
- package/cli/build/types/commands/generate:types.d.ts +0 -7
- package/cli/build/types/commands/girassol-cli.d.ts +0 -1
- package/cli/build/types/extensions/cli-extension.d.ts +0 -1
- package/cli/build/types/types.d.ts +0 -0
- package/cli/build/types.js +0 -2
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
2
|
-
size: '
|
|
2
|
+
size: 'small' | 'medium' | 'large';
|
|
3
3
|
dark?: boolean | undefined;
|
|
4
4
|
title?: string | undefined;
|
|
5
5
|
}>, {
|
|
6
6
|
size: string;
|
|
7
7
|
title: string;
|
|
8
8
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
9
|
-
size: '
|
|
9
|
+
size: 'small' | 'medium' | 'large';
|
|
10
10
|
dark?: boolean | undefined;
|
|
11
11
|
title?: string | undefined;
|
|
12
12
|
}>, {
|
|
@@ -14,7 +14,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
14
14
|
title: string;
|
|
15
15
|
}>>>, {
|
|
16
16
|
title: string;
|
|
17
|
-
size: '
|
|
17
|
+
size: 'small' | 'medium' | 'large';
|
|
18
18
|
}>;
|
|
19
19
|
export default _default;
|
|
20
20
|
declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import type { Modal } from './types';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
new (...args: any[]): {
|
|
4
|
+
$: import("vue").ComponentInternalInstance;
|
|
5
|
+
$data: {};
|
|
6
|
+
$props: Partial<{
|
|
7
|
+
title: Modal['title'];
|
|
8
|
+
size: Modal['size'];
|
|
9
|
+
target: string;
|
|
10
|
+
}> & Omit<Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
11
|
+
id: Modal['id'];
|
|
12
|
+
size?: import("./types").Size | undefined;
|
|
13
|
+
title?: string | undefined;
|
|
14
|
+
isOpen?: Modal['isOpen'];
|
|
15
|
+
target?: Modal['target'];
|
|
16
|
+
actionPrimaryText?: Modal['actionPrimaryText'];
|
|
17
|
+
actionSecondaryText?: Modal['actionSecondaryText'];
|
|
18
|
+
actionTertiaryText?: Modal['actionTertiaryText'];
|
|
19
|
+
}>, {
|
|
20
|
+
target: string;
|
|
21
|
+
title: string;
|
|
22
|
+
size: () => {
|
|
23
|
+
desktop: string;
|
|
24
|
+
mobile: string;
|
|
25
|
+
};
|
|
26
|
+
}>>> & {
|
|
27
|
+
onClose?: (() => any) | undefined;
|
|
28
|
+
onOpen?: (() => any) | undefined;
|
|
29
|
+
"onUpdate:isOpen"?: ((value: boolean) => any) | undefined;
|
|
30
|
+
"onAction:primary"?: (() => any) | undefined;
|
|
31
|
+
"onAction:secondary"?: (() => any) | undefined;
|
|
32
|
+
"onAction:tertiary"?: (() => any) | undefined;
|
|
33
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "title" | "size" | "target">;
|
|
34
|
+
$attrs: {
|
|
35
|
+
[x: string]: unknown;
|
|
36
|
+
};
|
|
37
|
+
$refs: {
|
|
38
|
+
[x: string]: unknown;
|
|
39
|
+
};
|
|
40
|
+
$slots: Readonly<{
|
|
41
|
+
[name: string]: import("vue").Slot | undefined;
|
|
42
|
+
}>;
|
|
43
|
+
$root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
|
|
44
|
+
$parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
|
|
45
|
+
$emit: ((event: "close") => void) & ((event: "open") => void) & ((event: "update:isOpen", value: boolean) => void) & ((event: "action:primary") => void) & ((event: "action:secondary") => void) & ((event: "action:tertiary") => void);
|
|
46
|
+
$el: any;
|
|
47
|
+
$options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
48
|
+
id: Modal['id'];
|
|
49
|
+
size?: import("./types").Size | undefined;
|
|
50
|
+
title?: string | undefined;
|
|
51
|
+
isOpen?: Modal['isOpen'];
|
|
52
|
+
target?: Modal['target'];
|
|
53
|
+
actionPrimaryText?: Modal['actionPrimaryText'];
|
|
54
|
+
actionSecondaryText?: Modal['actionSecondaryText'];
|
|
55
|
+
actionTertiaryText?: Modal['actionTertiaryText'];
|
|
56
|
+
}>, {
|
|
57
|
+
target: string;
|
|
58
|
+
title: string;
|
|
59
|
+
size: () => {
|
|
60
|
+
desktop: string;
|
|
61
|
+
mobile: string;
|
|
62
|
+
};
|
|
63
|
+
}>>> & {
|
|
64
|
+
onClose?: (() => any) | undefined;
|
|
65
|
+
onOpen?: (() => any) | undefined;
|
|
66
|
+
"onUpdate:isOpen"?: ((value: boolean) => any) | undefined;
|
|
67
|
+
"onAction:primary"?: (() => any) | undefined;
|
|
68
|
+
"onAction:secondary"?: (() => any) | undefined;
|
|
69
|
+
"onAction:tertiary"?: (() => any) | undefined;
|
|
70
|
+
}, {
|
|
71
|
+
close: () => void;
|
|
72
|
+
open: () => void;
|
|
73
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
74
|
+
close: () => void;
|
|
75
|
+
} & {
|
|
76
|
+
open: () => void;
|
|
77
|
+
} & {
|
|
78
|
+
"update:isOpen": (value: boolean) => void;
|
|
79
|
+
} & {
|
|
80
|
+
"action:primary": () => void;
|
|
81
|
+
} & {
|
|
82
|
+
"action:secondary": () => void;
|
|
83
|
+
} & {
|
|
84
|
+
"action:tertiary": () => void;
|
|
85
|
+
}, string, {
|
|
86
|
+
title: Modal['title'];
|
|
87
|
+
size: Modal['size'];
|
|
88
|
+
target: string;
|
|
89
|
+
}> & {
|
|
90
|
+
beforeCreate?: ((() => void) | (() => void)[]) | undefined;
|
|
91
|
+
created?: ((() => void) | (() => void)[]) | undefined;
|
|
92
|
+
beforeMount?: ((() => void) | (() => void)[]) | undefined;
|
|
93
|
+
mounted?: ((() => void) | (() => void)[]) | undefined;
|
|
94
|
+
beforeUpdate?: ((() => void) | (() => void)[]) | undefined;
|
|
95
|
+
updated?: ((() => void) | (() => void)[]) | undefined;
|
|
96
|
+
activated?: ((() => void) | (() => void)[]) | undefined;
|
|
97
|
+
deactivated?: ((() => void) | (() => void)[]) | undefined;
|
|
98
|
+
beforeDestroy?: ((() => void) | (() => void)[]) | undefined;
|
|
99
|
+
beforeUnmount?: ((() => void) | (() => void)[]) | undefined;
|
|
100
|
+
destroyed?: ((() => void) | (() => void)[]) | undefined;
|
|
101
|
+
unmounted?: ((() => void) | (() => void)[]) | undefined;
|
|
102
|
+
renderTracked?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
|
|
103
|
+
renderTriggered?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
|
|
104
|
+
errorCaptured?: (((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null, info: string) => boolean | void)[]) | undefined;
|
|
105
|
+
};
|
|
106
|
+
$forceUpdate: () => void;
|
|
107
|
+
$nextTick: typeof import("vue").nextTick;
|
|
108
|
+
$watch(source: string | Function, cb: Function, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
|
|
109
|
+
} & Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
110
|
+
id: Modal['id'];
|
|
111
|
+
size?: import("./types").Size | undefined;
|
|
112
|
+
title?: string | undefined;
|
|
113
|
+
isOpen?: Modal['isOpen'];
|
|
114
|
+
target?: Modal['target'];
|
|
115
|
+
actionPrimaryText?: Modal['actionPrimaryText'];
|
|
116
|
+
actionSecondaryText?: Modal['actionSecondaryText'];
|
|
117
|
+
actionTertiaryText?: Modal['actionTertiaryText'];
|
|
118
|
+
}>, {
|
|
119
|
+
target: string;
|
|
120
|
+
title: string;
|
|
121
|
+
size: () => {
|
|
122
|
+
desktop: string;
|
|
123
|
+
mobile: string;
|
|
124
|
+
};
|
|
125
|
+
}>>> & {
|
|
126
|
+
onClose?: (() => any) | undefined;
|
|
127
|
+
onOpen?: (() => any) | undefined;
|
|
128
|
+
"onUpdate:isOpen"?: ((value: boolean) => any) | undefined;
|
|
129
|
+
"onAction:primary"?: (() => any) | undefined;
|
|
130
|
+
"onAction:secondary"?: (() => any) | undefined;
|
|
131
|
+
"onAction:tertiary"?: (() => any) | undefined;
|
|
132
|
+
} & import("vue").ShallowUnwrapRef<{
|
|
133
|
+
close: () => void;
|
|
134
|
+
open: () => void;
|
|
135
|
+
}> & {} & import("vue").ComponentCustomProperties;
|
|
136
|
+
__isFragment?: undefined;
|
|
137
|
+
__isTeleport?: undefined;
|
|
138
|
+
__isSuspense?: undefined;
|
|
139
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
140
|
+
id: Modal['id'];
|
|
141
|
+
size?: import("./types").Size | undefined;
|
|
142
|
+
title?: string | undefined;
|
|
143
|
+
isOpen?: Modal['isOpen'];
|
|
144
|
+
target?: Modal['target'];
|
|
145
|
+
actionPrimaryText?: Modal['actionPrimaryText'];
|
|
146
|
+
actionSecondaryText?: Modal['actionSecondaryText'];
|
|
147
|
+
actionTertiaryText?: Modal['actionTertiaryText'];
|
|
148
|
+
}>, {
|
|
149
|
+
target: string;
|
|
150
|
+
title: string;
|
|
151
|
+
size: () => {
|
|
152
|
+
desktop: string;
|
|
153
|
+
mobile: string;
|
|
154
|
+
};
|
|
155
|
+
}>>> & {
|
|
156
|
+
onClose?: (() => any) | undefined;
|
|
157
|
+
onOpen?: (() => any) | undefined;
|
|
158
|
+
"onUpdate:isOpen"?: ((value: boolean) => any) | undefined;
|
|
159
|
+
"onAction:primary"?: (() => any) | undefined;
|
|
160
|
+
"onAction:secondary"?: (() => any) | undefined;
|
|
161
|
+
"onAction:tertiary"?: (() => any) | undefined;
|
|
162
|
+
}, {
|
|
163
|
+
close: () => void;
|
|
164
|
+
open: () => void;
|
|
165
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
166
|
+
close: () => void;
|
|
167
|
+
} & {
|
|
168
|
+
open: () => void;
|
|
169
|
+
} & {
|
|
170
|
+
"update:isOpen": (value: boolean) => void;
|
|
171
|
+
} & {
|
|
172
|
+
"action:primary": () => void;
|
|
173
|
+
} & {
|
|
174
|
+
"action:secondary": () => void;
|
|
175
|
+
} & {
|
|
176
|
+
"action:tertiary": () => void;
|
|
177
|
+
}, string, {
|
|
178
|
+
title: Modal['title'];
|
|
179
|
+
size: Modal['size'];
|
|
180
|
+
target: string;
|
|
181
|
+
}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
182
|
+
$slots: {
|
|
183
|
+
default: (_: {}) => any;
|
|
184
|
+
'action-tertiary': (_: {
|
|
185
|
+
id: string;
|
|
186
|
+
}) => any;
|
|
187
|
+
'action-secondary': (_: {
|
|
188
|
+
id: string;
|
|
189
|
+
}) => any;
|
|
190
|
+
'action-primary': (_: {
|
|
191
|
+
id: string;
|
|
192
|
+
}) => any;
|
|
193
|
+
};
|
|
194
|
+
});
|
|
195
|
+
export default _default;
|
|
196
|
+
declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
197
|
+
declare type __VLS_TypePropsToRuntimeProps<T> = {
|
|
198
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
199
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
200
|
+
} : {
|
|
201
|
+
type: import('vue').PropType<T[K]>;
|
|
202
|
+
required: true;
|
|
203
|
+
};
|
|
204
|
+
};
|
|
205
|
+
declare type __VLS_WithDefaults<P, D> = {
|
|
206
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? P[K] & {
|
|
207
|
+
default: D[K];
|
|
208
|
+
} : P[K];
|
|
209
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare type DesktopSize = 'small' | 'medium' | 'large' | 'extra-large' | 'full';
|
|
2
|
+
export declare type MobileSize = 'bottom-sheet' | 'full';
|
|
3
|
+
export declare type Size = {
|
|
4
|
+
desktop?: DesktopSize;
|
|
5
|
+
mobile?: MobileSize;
|
|
6
|
+
};
|
|
7
|
+
export interface Modal {
|
|
8
|
+
id: string;
|
|
9
|
+
size: Size;
|
|
10
|
+
title: string;
|
|
11
|
+
isOpen?: boolean;
|
|
12
|
+
target?: string;
|
|
13
|
+
actionPrimaryText?: string;
|
|
14
|
+
actionSecondaryText?: string;
|
|
15
|
+
actionTertiaryText?: string;
|
|
16
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { Position,
|
|
1
|
+
import type { Position, ToastContent, ToastOptions } from './types';
|
|
2
2
|
declare const _default: {
|
|
3
3
|
new (...args: any[]): {
|
|
4
4
|
$: import("vue").ComponentInternalInstance;
|
|
5
5
|
$data: {};
|
|
6
6
|
$props: Partial<{
|
|
7
|
-
type:
|
|
7
|
+
type: ToastOptions['type'];
|
|
8
8
|
position: Position;
|
|
9
9
|
offset: number;
|
|
10
10
|
visible: boolean;
|
|
@@ -12,19 +12,20 @@ declare const _default: {
|
|
|
12
12
|
showIcon: boolean;
|
|
13
13
|
}> & Omit<Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
14
14
|
id: string | number;
|
|
15
|
-
type:
|
|
15
|
+
type: ToastOptions['type'];
|
|
16
16
|
visible?: boolean | undefined;
|
|
17
|
-
title
|
|
18
|
-
description
|
|
17
|
+
title?: ToastContent['title'];
|
|
18
|
+
description: ToastContent['description'];
|
|
19
|
+
actionText?: ToastContent['actionText'];
|
|
19
20
|
timeout: number;
|
|
20
21
|
hideProgressBar?: boolean | undefined;
|
|
21
22
|
showIcon?: boolean | undefined;
|
|
22
23
|
offset: number;
|
|
23
|
-
|
|
24
|
+
onAction?: (() => void) | undefined;
|
|
24
25
|
onCloseHandler?: (() => void) | undefined;
|
|
25
26
|
position?: Position | undefined;
|
|
26
27
|
}>, {
|
|
27
|
-
type: ToastType | undefined;
|
|
28
|
+
type: import("./types").ToastType | undefined;
|
|
28
29
|
delay: number | undefined;
|
|
29
30
|
showIcon: boolean | undefined;
|
|
30
31
|
position: Position | undefined;
|
|
@@ -47,19 +48,20 @@ declare const _default: {
|
|
|
47
48
|
$el: any;
|
|
48
49
|
$options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
49
50
|
id: string | number;
|
|
50
|
-
type:
|
|
51
|
+
type: ToastOptions['type'];
|
|
51
52
|
visible?: boolean | undefined;
|
|
52
|
-
title
|
|
53
|
-
description
|
|
53
|
+
title?: ToastContent['title'];
|
|
54
|
+
description: ToastContent['description'];
|
|
55
|
+
actionText?: ToastContent['actionText'];
|
|
54
56
|
timeout: number;
|
|
55
57
|
hideProgressBar?: boolean | undefined;
|
|
56
58
|
showIcon?: boolean | undefined;
|
|
57
59
|
offset: number;
|
|
58
|
-
|
|
60
|
+
onAction?: (() => void) | undefined;
|
|
59
61
|
onCloseHandler?: (() => void) | undefined;
|
|
60
62
|
position?: Position | undefined;
|
|
61
63
|
}>, {
|
|
62
|
-
type: ToastType | undefined;
|
|
64
|
+
type: import("./types").ToastType | undefined;
|
|
63
65
|
delay: number | undefined;
|
|
64
66
|
showIcon: boolean | undefined;
|
|
65
67
|
position: Position | undefined;
|
|
@@ -67,7 +69,7 @@ declare const _default: {
|
|
|
67
69
|
offset: number;
|
|
68
70
|
visible: boolean;
|
|
69
71
|
}>>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
|
|
70
|
-
type:
|
|
72
|
+
type: ToastOptions['type'];
|
|
71
73
|
position: Position;
|
|
72
74
|
offset: number;
|
|
73
75
|
visible: boolean;
|
|
@@ -95,19 +97,20 @@ declare const _default: {
|
|
|
95
97
|
$watch(source: string | Function, cb: Function, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
|
|
96
98
|
} & Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
97
99
|
id: string | number;
|
|
98
|
-
type:
|
|
100
|
+
type: ToastOptions['type'];
|
|
99
101
|
visible?: boolean | undefined;
|
|
100
|
-
title
|
|
101
|
-
description
|
|
102
|
+
title?: ToastContent['title'];
|
|
103
|
+
description: ToastContent['description'];
|
|
104
|
+
actionText?: ToastContent['actionText'];
|
|
102
105
|
timeout: number;
|
|
103
106
|
hideProgressBar?: boolean | undefined;
|
|
104
107
|
showIcon?: boolean | undefined;
|
|
105
108
|
offset: number;
|
|
106
|
-
|
|
109
|
+
onAction?: (() => void) | undefined;
|
|
107
110
|
onCloseHandler?: (() => void) | undefined;
|
|
108
111
|
position?: Position | undefined;
|
|
109
112
|
}>, {
|
|
110
|
-
type: ToastType | undefined;
|
|
113
|
+
type: import("./types").ToastType | undefined;
|
|
111
114
|
delay: number | undefined;
|
|
112
115
|
showIcon: boolean | undefined;
|
|
113
116
|
position: Position | undefined;
|
|
@@ -120,19 +123,20 @@ declare const _default: {
|
|
|
120
123
|
__isSuspense?: undefined;
|
|
121
124
|
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
122
125
|
id: string | number;
|
|
123
|
-
type:
|
|
126
|
+
type: ToastOptions['type'];
|
|
124
127
|
visible?: boolean | undefined;
|
|
125
|
-
title
|
|
126
|
-
description
|
|
128
|
+
title?: ToastContent['title'];
|
|
129
|
+
description: ToastContent['description'];
|
|
130
|
+
actionText?: ToastContent['actionText'];
|
|
127
131
|
timeout: number;
|
|
128
132
|
hideProgressBar?: boolean | undefined;
|
|
129
133
|
showIcon?: boolean | undefined;
|
|
130
134
|
offset: number;
|
|
131
|
-
|
|
135
|
+
onAction?: (() => void) | undefined;
|
|
132
136
|
onCloseHandler?: (() => void) | undefined;
|
|
133
137
|
position?: Position | undefined;
|
|
134
138
|
}>, {
|
|
135
|
-
type: ToastType | undefined;
|
|
139
|
+
type: import("./types").ToastType | undefined;
|
|
136
140
|
delay: number | undefined;
|
|
137
141
|
showIcon: boolean | undefined;
|
|
138
142
|
position: Position | undefined;
|
|
@@ -140,7 +144,7 @@ declare const _default: {
|
|
|
140
144
|
offset: number;
|
|
141
145
|
visible: boolean;
|
|
142
146
|
}>>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
|
|
143
|
-
type:
|
|
147
|
+
type: ToastOptions['type'];
|
|
144
148
|
position: Position;
|
|
145
149
|
offset: number;
|
|
146
150
|
visible: boolean;
|
|
@@ -149,7 +153,7 @@ declare const _default: {
|
|
|
149
153
|
}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
150
154
|
$slots: {
|
|
151
155
|
'icon-status': (_: {
|
|
152
|
-
type: ToastType;
|
|
156
|
+
type: import("./types").ToastType | undefined;
|
|
153
157
|
}) => any;
|
|
154
158
|
title: (_: {}) => any;
|
|
155
159
|
description: (_: {}) => any;
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ContentTostParams, Position, ToastOptionsLimited } from './types';
|
|
2
|
+
declare type createToastReturn = {
|
|
3
|
+
close: (id: number, position: Position) => void;
|
|
4
|
+
};
|
|
5
|
+
declare function clearAllToasts(): void;
|
|
2
6
|
export declare function useToast(): {
|
|
3
|
-
createToast: (content:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
+
createToast: (content: ContentTostParams, options?: ToastOptionsLimited | undefined) => createToastReturn;
|
|
8
|
+
createErrorToast: (content: ContentTostParams, options?: ToastOptionsLimited | undefined) => createToastReturn;
|
|
9
|
+
createSuccessToast: (content: ContentTostParams, options?: ToastOptionsLimited | undefined) => createToastReturn;
|
|
10
|
+
createInformativeToast: (content: ContentTostParams, options?: ToastOptionsLimited | undefined) => createToastReturn;
|
|
11
|
+
createWarningToast: (content: ContentTostParams, options?: ToastOptionsLimited | undefined) => createToastReturn;
|
|
12
|
+
clearAllToasts: typeof clearAllToasts;
|
|
7
13
|
};
|
|
8
|
-
declare function close(id: number, position: Position): void;
|
|
9
14
|
export {};
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import type { VNode } from 'vue';
|
|
2
|
-
export declare type ToastType = '
|
|
2
|
+
export declare type ToastType = 'informative' | 'error' | 'warning' | 'success';
|
|
3
3
|
export declare type Position = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'top-center' | 'bottom-center';
|
|
4
4
|
export interface ToastContent {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
type?: ToastType;
|
|
6
|
+
title?: string;
|
|
7
|
+
description: string;
|
|
8
|
+
actionText?: string;
|
|
9
|
+
onAction?: () => void;
|
|
7
10
|
}
|
|
8
11
|
export interface ToastOptions {
|
|
9
12
|
type?: ToastType;
|
|
@@ -13,7 +16,17 @@ export interface ToastOptions {
|
|
|
13
16
|
showCloseButton?: boolean;
|
|
14
17
|
hideProgressBar?: boolean;
|
|
15
18
|
onClose?: () => void;
|
|
16
|
-
|
|
19
|
+
}
|
|
20
|
+
export interface ToastContentLimited {
|
|
21
|
+
type?: ToastType;
|
|
22
|
+
title?: string;
|
|
23
|
+
description: string;
|
|
24
|
+
actionText?: string;
|
|
25
|
+
onAction?: () => void;
|
|
26
|
+
}
|
|
27
|
+
export interface ToastOptionsLimited {
|
|
28
|
+
type?: ToastType;
|
|
29
|
+
timeout?: number;
|
|
17
30
|
}
|
|
18
31
|
export interface ToastObject {
|
|
19
32
|
toastVNode: VNode;
|
|
@@ -21,3 +34,17 @@ export interface ToastObject {
|
|
|
21
34
|
}
|
|
22
35
|
export declare const TOAST_GAP = 12;
|
|
23
36
|
export declare const DEFAULT_OPTIONS: ToastOptions;
|
|
37
|
+
export interface ToastComponent {
|
|
38
|
+
id: string | number;
|
|
39
|
+
type: ToastType;
|
|
40
|
+
visible?: boolean;
|
|
41
|
+
title?: ToastContent['title'];
|
|
42
|
+
description: ToastContent['description'];
|
|
43
|
+
actionText?: ToastContent['actionText'];
|
|
44
|
+
timeout: number;
|
|
45
|
+
offset: number;
|
|
46
|
+
onAction?: ToastOptions['onClose'];
|
|
47
|
+
hideProgress?: boolean;
|
|
48
|
+
showIcon?: boolean;
|
|
49
|
+
}
|
|
50
|
+
export declare type ContentTostParams = ToastContent | string;
|