@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.
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@maas/vue-equipment",
3
3
  "configKey": "vueEquipment",
4
- "version": "0.11.4"
4
+ "version": "0.11.5"
5
5
  }
@@ -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
- & .magic-toast__inner {
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
- & .magic-toast__inner {
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
- & .magic-toast__inner {
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
- & .magic-toast__inner {
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 { Options, Toast } from './../../types.js';
2
+ import type { ToastOptions, Toast } from './../../types.js';
3
3
  type Args = {
4
4
  id: MaybeRef<string>;
5
- mappedOptions: Options;
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
- { id: el.id, height: mappedEl.offsetHeight }
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) {
@@ -28,6 +28,10 @@ type ToastOptions = {
28
28
  type ActiveElement = {
29
29
  id: string;
30
30
  height: number;
31
+ padding: {
32
+ top: number;
33
+ bottom: number;
34
+ };
31
35
  };
32
36
  type ToastEvents = {
33
37
  beforeEnter: string;
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.5",
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",