@maas/vue-equipment 0.32.1 → 0.32.2
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/MagicAccordion/src/components/MagicAccordionContent.vue +6 -7
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionContent.vue.d.ts +3 -1
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionProvider.vue +1 -1
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue +5 -1
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue.d.ts +3 -1
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue +1 -1
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue.d.ts +3 -1
- package/dist/plugins/MagicAutoSize/src/components/MagicAutoSize.vue +3 -3
- package/package.json +1 -1
package/dist/nuxt/module.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div :class="['magic-accordion-content', { '-active':
|
|
2
|
+
<div :class="['magic-accordion-content', { '-active': view?.active }]">
|
|
3
3
|
<magic-auto-size :immediate="true" :width="false">
|
|
4
4
|
<transition
|
|
5
|
+
mode="out-in"
|
|
5
6
|
:name="state.options.transition"
|
|
6
7
|
:on-before-enter="onBeforeEnter"
|
|
7
8
|
:on-enter="onEnter"
|
|
@@ -10,8 +11,8 @@
|
|
|
10
11
|
:on-leave="onLeave"
|
|
11
12
|
:on-after-leave="onAfterLeave"
|
|
12
13
|
>
|
|
13
|
-
<primitive :as-child="asChild" v-
|
|
14
|
-
<slot />
|
|
14
|
+
<primitive :as-child="asChild" v-show="view?.active">
|
|
15
|
+
<slot :is-active="view?.active" />
|
|
15
16
|
</primitive>
|
|
16
17
|
</transition>
|
|
17
18
|
</magic-auto-size>
|
|
@@ -19,7 +20,7 @@
|
|
|
19
20
|
</template>
|
|
20
21
|
|
|
21
22
|
<script lang="ts" setup>
|
|
22
|
-
import {
|
|
23
|
+
import { inject } from 'vue'
|
|
23
24
|
import { Primitive } from '@maas/vue-primitive'
|
|
24
25
|
import { useAccordionView } from '../composables/private/useAccordionView'
|
|
25
26
|
import { useAccordionState } from '../composables/private/useAccordionState'
|
|
@@ -52,8 +53,6 @@ const state = initializeState()
|
|
|
52
53
|
const { getView } = useAccordionView(instanceId)
|
|
53
54
|
const view = getView(viewId)
|
|
54
55
|
|
|
55
|
-
const isActive = computed(() => view?.active)
|
|
56
|
-
|
|
57
56
|
const {
|
|
58
57
|
onBeforeEnter,
|
|
59
58
|
onEnter,
|
|
@@ -68,5 +67,5 @@ const {
|
|
|
68
67
|
</script>
|
|
69
68
|
|
|
70
69
|
<style>
|
|
71
|
-
:root{--magic-accordion-enter-
|
|
70
|
+
:root{--magic-accordion-enter-transition:fade-in 150ms var(--ease-in-out);--magic-accordion-leave-transition:all 200ms var(--ease-in-out-sharp);--magic-accordion-size-transition:all 200ms var(--ease-in-out-sharp);--magic-accordion-content-clip-path:inset(0)}.magic-accordion-content{--magic-auto-size-transition:var(--magic-accordion-size-transition);clip-path:var(--magic-accordion-content-clip-path)}.magic-accordion-enter-active{position:relative;transition:var(--magic-accordion-enter-transition)}.magic-accordion-leave-active{height:0;transition:var(--magic-accordion-leave-transition)}
|
|
72
71
|
</style>
|
|
@@ -4,7 +4,9 @@ interface MagicAccordionContentProps {
|
|
|
4
4
|
asChild?: boolean;
|
|
5
5
|
}
|
|
6
6
|
declare function __VLS_template(): {
|
|
7
|
-
default?(_: {
|
|
7
|
+
default?(_: {
|
|
8
|
+
isActive: any;
|
|
9
|
+
}): any;
|
|
8
10
|
};
|
|
9
11
|
declare const __VLS_component: import("vue").DefineComponent<__VLS_TypePropsToOption<MagicAccordionContentProps>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<MagicAccordionContentProps>>>, {}, {}>;
|
|
10
12
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
@mouseeenter="onMouseenter"
|
|
8
8
|
@click="onClick"
|
|
9
9
|
>
|
|
10
|
-
<slot />
|
|
10
|
+
<slot :is-active="view?.active" />
|
|
11
11
|
</primitive>
|
|
12
12
|
</template>
|
|
13
13
|
|
|
@@ -19,6 +19,7 @@ import { useAccordionTrigger } from '../composables/private/useAccordionTrigger'
|
|
|
19
19
|
import { MagicAccordionInstanceId, MagicAccordionViewId } from '../symbols'
|
|
20
20
|
import type { Interaction } from '../types'
|
|
21
21
|
import { useAccordionState } from '../composables/private/useAccordionState'
|
|
22
|
+
import { useAccordionView } from '../composables/private/useAccordionView'
|
|
22
23
|
|
|
23
24
|
interface MagicAccordionTriggerProps {
|
|
24
25
|
disabled?: MaybeRef<boolean>
|
|
@@ -51,6 +52,9 @@ if (!viewId) {
|
|
|
51
52
|
const { initializeState } = useAccordionState(instanceId)
|
|
52
53
|
const state = initializeState()
|
|
53
54
|
|
|
55
|
+
const { getView } = useAccordionView(instanceId)
|
|
56
|
+
const view = getView(viewId)
|
|
57
|
+
|
|
54
58
|
const mappedDisabled = computed(
|
|
55
59
|
() => toValue(props.disabled) || state.options.disabled
|
|
56
60
|
)
|
|
@@ -6,7 +6,9 @@ interface MagicAccordionTriggerProps {
|
|
|
6
6
|
asChild?: boolean;
|
|
7
7
|
}
|
|
8
8
|
declare function __VLS_template(): {
|
|
9
|
-
default?(_: {
|
|
9
|
+
default?(_: {
|
|
10
|
+
isActive: any;
|
|
11
|
+
}): any;
|
|
10
12
|
};
|
|
11
13
|
declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<MagicAccordionTriggerProps>, {
|
|
12
14
|
disabled: boolean;
|
|
@@ -4,7 +4,9 @@ interface MagicAccordionViewProps {
|
|
|
4
4
|
activeOnMounted?: boolean;
|
|
5
5
|
}
|
|
6
6
|
declare function __VLS_template(): {
|
|
7
|
-
default?(_: {
|
|
7
|
+
default?(_: {
|
|
8
|
+
isActive: any;
|
|
9
|
+
}): any;
|
|
8
10
|
};
|
|
9
11
|
declare const __VLS_component: import("vue").DefineComponent<__VLS_TypePropsToOption<MagicAccordionViewProps>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<MagicAccordionViewProps>>>, {}, {}>;
|
|
10
12
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
@@ -78,7 +78,6 @@ const child = computed(() => {
|
|
|
78
78
|
useMutationObserver(
|
|
79
79
|
elRef,
|
|
80
80
|
(mutations) => {
|
|
81
|
-
console.log('mutations:', mutations)
|
|
82
81
|
const addedNode = mutations
|
|
83
82
|
.flatMap((m) => [...m.addedNodes])
|
|
84
83
|
.find((n) => n instanceof HTMLElement)
|
|
@@ -127,12 +126,13 @@ useResizeObserver(content, () => {
|
|
|
127
126
|
|
|
128
127
|
onMounted(() => {
|
|
129
128
|
if (elRef.value) {
|
|
130
|
-
const
|
|
131
|
-
const filtered = Array.from(
|
|
129
|
+
const elements = elRef.value.querySelectorAll('*')
|
|
130
|
+
const filtered = Array.from(elements).find(
|
|
132
131
|
(node) => node instanceof HTMLElement
|
|
133
132
|
)
|
|
134
133
|
|
|
135
134
|
if (!!filtered && filtered instanceof HTMLElement) {
|
|
135
|
+
content.value = filtered
|
|
136
136
|
size.value = {
|
|
137
137
|
width: filtered.offsetWidth + padding.value.x,
|
|
138
138
|
height: filtered.offsetHeight + padding.value.y,
|
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.32.
|
|
4
|
+
"version": "0.32.2",
|
|
5
5
|
"author": "Robin Scholz <https://github.com/robinscholz>, Christoph Jeworutzki <https://github.com/ChristophJeworutzki>",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"devDependencies": {
|