@maas/vue-equipment 0.11.5 → 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 +14 -13
- package/dist/plugins/MagicToast/src/components/MagicToastComponent.vue +4 -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,7 +130,8 @@ watch(
|
|
|
130
130
|
--magic-toast-padding-x: 1rem;
|
|
131
131
|
--magic-toast-padding-y: 1rem;
|
|
132
132
|
|
|
133
|
-
--mt-multiplier: 1;
|
|
133
|
+
--mt-multiplier-x: 1;
|
|
134
|
+
--mt-multiplier-y: 1;
|
|
134
135
|
--mt-align-items: flex-start;
|
|
135
136
|
--mt-justify-content: center;
|
|
136
137
|
}
|
|
@@ -170,10 +171,10 @@ watch(
|
|
|
170
171
|
.magic-toast.-top-right {
|
|
171
172
|
--magic-toast-transform-y: 10;
|
|
172
173
|
--magic-toast-enter-animation: slide-ttb-in 300ms ease;
|
|
173
|
-
--mt-multiplier: 1;
|
|
174
|
-
|
|
174
|
+
--mt-multiplier-y: 1;
|
|
175
|
+
--mt-align-items: flex-start;
|
|
176
|
+
& .magic-toast-component {
|
|
175
177
|
padding-top: var(--magic-toast-padding-y, 1rem);
|
|
176
|
-
--mt-align-items: flex-start;
|
|
177
178
|
}
|
|
178
179
|
}
|
|
179
180
|
|
|
@@ -182,26 +183,26 @@ watch(
|
|
|
182
183
|
.magic-toast.-bottom-right {
|
|
183
184
|
--magic-toast-transform-y: 10;
|
|
184
185
|
--magic-toast-enter-animation: slide-btt-in 300ms ease;
|
|
185
|
-
--mt-multiplier: -1;
|
|
186
|
-
|
|
186
|
+
--mt-multiplier-y: -1;
|
|
187
|
+
--mt-align-items: flex-end;
|
|
188
|
+
& .magic-toast-component {
|
|
187
189
|
padding-bottom: var(--magic-toast-padding-y, 1rem);
|
|
188
|
-
--mt-align-items: flex-end;
|
|
189
190
|
}
|
|
190
191
|
}
|
|
191
192
|
|
|
192
193
|
.magic-toast.-top-left,
|
|
193
194
|
.magic-toast.-bottom-left {
|
|
194
|
-
|
|
195
|
+
--mt-justify-content: flex-start;
|
|
196
|
+
& .magic-toast-component {
|
|
195
197
|
padding-left: var(--magic-toast-padding-x, 1rem);
|
|
196
|
-
--mt-justify-content: flex-start;
|
|
197
198
|
}
|
|
198
199
|
}
|
|
199
200
|
|
|
200
201
|
.magic-toast.-top-right,
|
|
201
202
|
.magic-toast.-bottom-right {
|
|
202
|
-
|
|
203
|
+
--mt-justify-content: flex-end;
|
|
204
|
+
& .magic-toast-component {
|
|
203
205
|
padding-right: var(--magic-toast-padding-x, 1rem);
|
|
204
|
-
--mt-justify-content: flex-end;
|
|
205
206
|
}
|
|
206
207
|
}
|
|
207
208
|
|
|
@@ -209,14 +210,14 @@ watch(
|
|
|
209
210
|
--magic-toast-enter-animation: slide-ltr-in 300ms ease;
|
|
210
211
|
--magic-toast-transform-y: 0;
|
|
211
212
|
--magic-toast-transform-x: 30;
|
|
212
|
-
--mt-multiplier: 1;
|
|
213
|
+
--mt-multiplier-x: 1;
|
|
213
214
|
}
|
|
214
215
|
|
|
215
216
|
.magic-toast.-from-right {
|
|
216
217
|
--magic-toast-enter-animation: slide-rtl-in 300ms ease;
|
|
217
218
|
--magic-toast-transform-y: 0;
|
|
218
219
|
--magic-toast-transform-x: 30;
|
|
219
|
-
--mt-multiplier: -1;
|
|
220
|
+
--mt-multiplier-x: -1;
|
|
220
221
|
}
|
|
221
222
|
|
|
222
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,7 +91,7 @@ watchEffect(() => {
|
|
|
91
91
|
|
|
92
92
|
.magic-toast-component.expanded {
|
|
93
93
|
--mt-matrix-scale: 1;
|
|
94
|
-
--mt-matrix-transform-y: calc(var(--mt-offset) * var(--mt-multiplier));
|
|
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 {
|
|
@@ -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",
|