@maas/vue-equipment 0.11.4 → 0.11.6
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/nuxt/module.json +1 -1
- package/dist/plugins/MagicToast/src/components/MagicToast.vue +16 -22
- package/dist/plugins/MagicToast/src/components/MagicToastComponent.vue +5 -4
- package/dist/plugins/MagicToast/src/composables/private/useToastCallback.d.ts +6 -2
- package/dist/plugins/MagicToast/src/composables/private/useToastCallback.mjs +9 -1
- package/dist/plugins/MagicToast/src/types/index.d.ts +4 -0
- package/package.json +1 -1
package/dist/nuxt/module.json
CHANGED
|
@@ -130,9 +130,10 @@ watch(
|
|
|
130
130
|
--magic-toast-padding-x: 1rem;
|
|
131
131
|
--magic-toast-padding-y: 1rem;
|
|
132
132
|
|
|
133
|
-
--mt-multiplier: 1;
|
|
134
|
-
--mt-
|
|
135
|
-
--mt-
|
|
133
|
+
--mt-multiplier-x: 1;
|
|
134
|
+
--mt-multiplier-y: 1;
|
|
135
|
+
--mt-align-items: flex-start;
|
|
136
|
+
--mt-justify-content: center;
|
|
136
137
|
}
|
|
137
138
|
|
|
138
139
|
.magic-toast {
|
|
@@ -156,12 +157,9 @@ watch(
|
|
|
156
157
|
max-height: 100%;
|
|
157
158
|
width: 100%;
|
|
158
159
|
height: 100%;
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
transform: translateX(var(--mt-transform-x, -50%))
|
|
163
|
-
translateY(var(--mt-transform-y, -50%));
|
|
164
|
-
}
|
|
160
|
+
display: flex;
|
|
161
|
+
align-items: var(--mt-align-items);
|
|
162
|
+
justify-content: var(--mt-justify-content);
|
|
165
163
|
}
|
|
166
164
|
|
|
167
165
|
.magic-toast__inner * {
|
|
@@ -173,11 +171,10 @@ watch(
|
|
|
173
171
|
.magic-toast.-top-right {
|
|
174
172
|
--magic-toast-transform-y: 10;
|
|
175
173
|
--magic-toast-enter-animation: slide-ttb-in 300ms ease;
|
|
176
|
-
--mt-multiplier: 1;
|
|
174
|
+
--mt-multiplier-y: 1;
|
|
175
|
+
--mt-align-items: flex-start;
|
|
177
176
|
& .magic-toast-component {
|
|
178
|
-
top: 0;
|
|
179
177
|
padding-top: var(--magic-toast-padding-y, 1rem);
|
|
180
|
-
--mt-transform-y: 0;
|
|
181
178
|
}
|
|
182
179
|
}
|
|
183
180
|
|
|
@@ -186,44 +183,41 @@ watch(
|
|
|
186
183
|
.magic-toast.-bottom-right {
|
|
187
184
|
--magic-toast-transform-y: 10;
|
|
188
185
|
--magic-toast-enter-animation: slide-btt-in 300ms ease;
|
|
189
|
-
--mt-multiplier: -1;
|
|
186
|
+
--mt-multiplier-y: -1;
|
|
187
|
+
--mt-align-items: flex-end;
|
|
190
188
|
& .magic-toast-component {
|
|
191
|
-
top: unset;
|
|
192
|
-
bottom: 0;
|
|
193
189
|
padding-bottom: var(--magic-toast-padding-y, 1rem);
|
|
194
|
-
--mt-transform-y: 0;
|
|
195
190
|
}
|
|
196
191
|
}
|
|
197
192
|
|
|
198
193
|
.magic-toast.-top-left,
|
|
199
194
|
.magic-toast.-bottom-left {
|
|
195
|
+
--mt-justify-content: flex-start;
|
|
200
196
|
& .magic-toast-component {
|
|
201
|
-
left: 0;
|
|
202
197
|
padding-left: var(--magic-toast-padding-x, 1rem);
|
|
203
|
-
--mt-transform-x: 0;
|
|
204
198
|
}
|
|
205
199
|
}
|
|
206
200
|
|
|
207
201
|
.magic-toast.-top-right,
|
|
208
202
|
.magic-toast.-bottom-right {
|
|
203
|
+
--mt-justify-content: flex-end;
|
|
209
204
|
& .magic-toast-component {
|
|
210
|
-
left: unset;
|
|
211
|
-
right: 0;
|
|
212
205
|
padding-right: var(--magic-toast-padding-x, 1rem);
|
|
213
|
-
--mt-transform-x: 0;
|
|
214
206
|
}
|
|
215
207
|
}
|
|
216
208
|
|
|
217
209
|
.magic-toast.-from-left {
|
|
218
210
|
--magic-toast-enter-animation: slide-ltr-in 300ms ease;
|
|
219
211
|
--magic-toast-transform-y: 0;
|
|
220
|
-
--magic-toast-transform-x:
|
|
212
|
+
--magic-toast-transform-x: 30;
|
|
213
|
+
--mt-multiplier-x: 1;
|
|
221
214
|
}
|
|
222
215
|
|
|
223
216
|
.magic-toast.-from-right {
|
|
224
217
|
--magic-toast-enter-animation: slide-rtl-in 300ms ease;
|
|
225
218
|
--magic-toast-transform-y: 0;
|
|
226
219
|
--magic-toast-transform-x: 30;
|
|
220
|
+
--mt-multiplier-x: -1;
|
|
227
221
|
}
|
|
228
222
|
|
|
229
223
|
.magic-toast--list-enter-active {
|
|
@@ -39,7 +39,7 @@ function setIndex() {
|
|
|
39
39
|
|
|
40
40
|
function setOffset() {
|
|
41
41
|
const offset = newerSiblings.value.reduce((acc, curr) => {
|
|
42
|
-
return acc + curr.height
|
|
42
|
+
return acc + curr.height - curr.padding.top - curr.padding.bottom
|
|
43
43
|
}, 0)
|
|
44
44
|
elRef.value?.style.setProperty('--mt-offset', `${offset}`)
|
|
45
45
|
}
|
|
@@ -65,10 +65,10 @@ watchEffect(() => {
|
|
|
65
65
|
--mt-offset: 0;
|
|
66
66
|
--mt-matrix-scale: calc(1 - (var(--magic-toast-scale) * var(--mt-index, 0)));
|
|
67
67
|
--mt-matrix-transform-x: calc(
|
|
68
|
-
var(--magic-toast-transform-x) * var(--mt-index, 0) * var(--mt-multiplier)
|
|
68
|
+
var(--magic-toast-transform-x) * var(--mt-index, 0) * var(--mt-multiplier-x)
|
|
69
69
|
);
|
|
70
70
|
--mt-matrix-transform-y: calc(
|
|
71
|
-
var(--magic-toast-transform-y) * var(--mt-index, 0) * var(--mt-multiplier)
|
|
71
|
+
var(--magic-toast-transform-y) * var(--mt-index, 0) * var(--mt-multiplier-y)
|
|
72
72
|
);
|
|
73
73
|
position: absolute;
|
|
74
74
|
list-style: none;
|
|
@@ -91,11 +91,12 @@ watchEffect(() => {
|
|
|
91
91
|
|
|
92
92
|
.magic-toast-component.expanded {
|
|
93
93
|
--mt-matrix-scale: 1;
|
|
94
|
-
--mt-matrix-transform-y: calc(
|
|
94
|
+
--mt-matrix-transform-y: calc(var(--mt-offset) * var(--mt-multiplier-y));
|
|
95
95
|
--mt-matrix-transform-x: 0;
|
|
96
96
|
&:not(:last-child) {
|
|
97
97
|
& .magic-toast-component__inner {
|
|
98
98
|
padding-bottom: calc(var(--magic-toast-gap) * var(--mt-index));
|
|
99
|
+
padding-top: calc(var(--magic-toast-gap) * var(--mt-index));
|
|
99
100
|
}
|
|
100
101
|
}
|
|
101
102
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type Ref, type MaybeRef } from 'vue';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ToastOptions, Toast } from './../../types.js';
|
|
3
3
|
type Args = {
|
|
4
4
|
id: MaybeRef<string>;
|
|
5
|
-
mappedOptions:
|
|
5
|
+
mappedOptions: ToastOptions;
|
|
6
6
|
count: Ref<number | undefined>;
|
|
7
7
|
oldest: Ref<Toast | undefined>;
|
|
8
8
|
};
|
|
@@ -16,6 +16,10 @@ export declare function useToastCallback({ id, mappedOptions, count, oldest }: A
|
|
|
16
16
|
activeElements: Ref<{
|
|
17
17
|
id: string;
|
|
18
18
|
height: number;
|
|
19
|
+
padding: {
|
|
20
|
+
top: number;
|
|
21
|
+
bottom: number;
|
|
22
|
+
};
|
|
19
23
|
}[]>;
|
|
20
24
|
};
|
|
21
25
|
export {};
|
|
@@ -14,9 +14,17 @@ export function useToastCallback({ id, mappedOptions, count, oldest }) {
|
|
|
14
14
|
function onAfterEnter(el) {
|
|
15
15
|
useToastEmitter().emit("afterEnter", toValue(id));
|
|
16
16
|
const mappedEl = el;
|
|
17
|
+
const style = window.getComputedStyle(mappedEl);
|
|
17
18
|
activeElements.value = [
|
|
18
19
|
...activeElements.value,
|
|
19
|
-
{
|
|
20
|
+
{
|
|
21
|
+
id: el.id,
|
|
22
|
+
height: mappedEl.offsetHeight,
|
|
23
|
+
padding: {
|
|
24
|
+
top: parseInt(style.paddingTop),
|
|
25
|
+
bottom: parseInt(style.paddingBottom)
|
|
26
|
+
}
|
|
27
|
+
}
|
|
20
28
|
];
|
|
21
29
|
}
|
|
22
30
|
function onBeforeLeave(_el) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maas/vue-equipment",
|
|
3
3
|
"description": "A magic collection of Vue composables, plugins, components and directives",
|
|
4
|
-
"version": "0.11.
|
|
4
|
+
"version": "0.11.6",
|
|
5
5
|
"author": "Robin Scholz <https://github.com/robinscholz>, Christoph Jeworutzki <https://github.com/ChristophJeworutzki>",
|
|
6
6
|
"devDependencies": {
|
|
7
7
|
"@antfu/ni": "^0.21.5",
|