@una-ui/nuxt-edge 0.65.0-29341014.3b6637b → 0.65.0-29352768.cbf4574
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/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/components/elements/accordion/Accordion.vue +86 -0
- package/dist/runtime/components/elements/accordion/Accordion.vue.d.ts +71 -0
- package/dist/runtime/components/elements/accordion/AccordionContent.vue +24 -0
- package/dist/runtime/components/elements/accordion/AccordionContent.vue.d.ts +13 -0
- package/dist/runtime/components/elements/accordion/AccordionHeader.vue +17 -0
- package/dist/runtime/components/elements/accordion/AccordionHeader.vue.d.ts +13 -0
- package/dist/runtime/components/elements/accordion/AccordionItem.vue +59 -0
- package/dist/runtime/components/elements/accordion/AccordionItem.vue.d.ts +27 -0
- package/dist/runtime/components/elements/accordion/AccordionTrigger.vue +56 -0
- package/dist/runtime/components/elements/accordion/AccordionTrigger.vue.d.ts +16 -0
- package/dist/runtime/components/elements/avatar/Avatar.vue.d.ts +1 -1
- package/dist/runtime/components/navigation-menu/NavigationMenuLink.vue.d.ts +1 -1
- package/dist/runtime/components/navigation-menu/NavigationMenuTrigger.vue.d.ts +1 -1
- package/dist/runtime/components/sidebar/SidebarProvider.vue.d.ts +1 -1
- package/dist/runtime/components/toggle-group/ToggleGroupItem.vue.d.ts +1 -1
- package/dist/runtime/types/accordion.d.ts +36 -91
- package/dist/runtime/utils/index.d.ts +1 -1
- package/package.json +4 -5
- package/dist/runtime/components/elements/Accordion.vue +0 -212
- package/dist/runtime/components/elements/Accordion.vue.d.ts +0 -28
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { reactiveOmit } from "@vueuse/core";
|
|
3
|
+
import { defu } from "defu";
|
|
4
|
+
import { AccordionRoot, useForwardPropsEmits } from "reka-ui";
|
|
5
|
+
import { computed } from "vue";
|
|
6
|
+
import { cn } from "../../../utils";
|
|
7
|
+
import NAccordionItem from "./AccordionItem.vue";
|
|
8
|
+
const props = defineProps({
|
|
9
|
+
accordion: { type: String, required: false, default: "divider border" },
|
|
10
|
+
items: { type: Array, required: false },
|
|
11
|
+
una: { type: Object, required: false },
|
|
12
|
+
_accordionItem: { type: Object, required: false },
|
|
13
|
+
_accordionHeader: { type: Object, required: false },
|
|
14
|
+
_accordionTrigger: { type: Object, required: false },
|
|
15
|
+
_accordionContent: { type: Object, required: false },
|
|
16
|
+
collapsible: { type: Boolean, required: false, default: true },
|
|
17
|
+
disabled: { type: Boolean, required: false },
|
|
18
|
+
dir: { type: String, required: false },
|
|
19
|
+
orientation: { type: String, required: false },
|
|
20
|
+
unmountOnHide: { type: Boolean, required: false },
|
|
21
|
+
asChild: { type: Boolean, required: false },
|
|
22
|
+
as: { type: null, required: false },
|
|
23
|
+
type: { type: String, required: false, default: "single" },
|
|
24
|
+
modelValue: { type: null, required: false },
|
|
25
|
+
defaultValue: { type: null, required: false }
|
|
26
|
+
});
|
|
27
|
+
const emits = defineEmits(["update:modelValue"]);
|
|
28
|
+
const rootProps = useForwardPropsEmits(reactiveOmit(props, ["una", "items", "_accordionTrigger", "_accordionContent", "_accordionHeader", "_accordionItem"]), emits);
|
|
29
|
+
const items = computed(() => {
|
|
30
|
+
if (import.meta.dev) {
|
|
31
|
+
const reservedValues = ["header", "trigger", "content", "item", "default"];
|
|
32
|
+
for (const item of props.items ?? []) {
|
|
33
|
+
if (reservedValues.includes(item.value)) {
|
|
34
|
+
console.warn(`[AccordionItem]: The value '${item.value}' is reserved and may cause unexpected behavior. Please choose a different value.`);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return props.items;
|
|
39
|
+
});
|
|
40
|
+
</script>
|
|
41
|
+
|
|
42
|
+
<template>
|
|
43
|
+
<AccordionRoot
|
|
44
|
+
v-slot="{ modelValue }"
|
|
45
|
+
v-bind="rootProps"
|
|
46
|
+
:class="cn(
|
|
47
|
+
una?.accordion
|
|
48
|
+
)"
|
|
49
|
+
>
|
|
50
|
+
<slot :model-value>
|
|
51
|
+
<NAccordionItem
|
|
52
|
+
v-for="(item, index) in items"
|
|
53
|
+
:key="item.value"
|
|
54
|
+
v-bind="defu(item, _accordionItem)"
|
|
55
|
+
:_accordion-trigger="defu(item._accordionTrigger, _accordionTrigger)"
|
|
56
|
+
:_accordion-content="defu(item._accordionContent, _accordionContent)"
|
|
57
|
+
:_accordion-header="defu(item._accordionHeader, _accordionHeader)"
|
|
58
|
+
:una="defu(item.una, una)"
|
|
59
|
+
>
|
|
60
|
+
<template #default="{ open }">
|
|
61
|
+
<slot :name="`${item.value}-item`" :open :item :index>
|
|
62
|
+
<slot name="item" :open :item :index />
|
|
63
|
+
</slot>
|
|
64
|
+
</template>
|
|
65
|
+
|
|
66
|
+
<template #header="{ open }">
|
|
67
|
+
<slot :name="`${item.value}-header`" :open :item :index>
|
|
68
|
+
<slot name="header" :open :item :index />
|
|
69
|
+
</slot>
|
|
70
|
+
</template>
|
|
71
|
+
|
|
72
|
+
<template #trigger="{ open }">
|
|
73
|
+
<slot :name="`${item.value}-trigger`" :open :item :index>
|
|
74
|
+
<slot name="trigger" :open :item :index />
|
|
75
|
+
</slot>
|
|
76
|
+
</template>
|
|
77
|
+
|
|
78
|
+
<template #content="{ open }">
|
|
79
|
+
<slot :name="`${item.value}-content`" :open :item :index>
|
|
80
|
+
<slot name="content" :open :item :index />
|
|
81
|
+
</slot>
|
|
82
|
+
</template>
|
|
83
|
+
</NAccordionItem>
|
|
84
|
+
</slot>
|
|
85
|
+
</AccordionRoot>
|
|
86
|
+
</template>
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { NAccordionProps } from '../../../types/index.js';
|
|
2
|
+
declare var __VLS_6: {
|
|
3
|
+
modelValue: any;
|
|
4
|
+
}, __VLS_12: any, __VLS_13: {
|
|
5
|
+
open: any;
|
|
6
|
+
item: any;
|
|
7
|
+
index: any;
|
|
8
|
+
}, __VLS_15: {
|
|
9
|
+
open: any;
|
|
10
|
+
item: any;
|
|
11
|
+
index: any;
|
|
12
|
+
}, __VLS_18: any, __VLS_19: {
|
|
13
|
+
open: any;
|
|
14
|
+
item: any;
|
|
15
|
+
index: any;
|
|
16
|
+
}, __VLS_21: {
|
|
17
|
+
open: any;
|
|
18
|
+
item: any;
|
|
19
|
+
index: any;
|
|
20
|
+
}, __VLS_24: any, __VLS_25: {
|
|
21
|
+
open: any;
|
|
22
|
+
item: any;
|
|
23
|
+
index: any;
|
|
24
|
+
}, __VLS_27: {
|
|
25
|
+
open: any;
|
|
26
|
+
item: any;
|
|
27
|
+
index: any;
|
|
28
|
+
}, __VLS_30: any, __VLS_31: {
|
|
29
|
+
open: any;
|
|
30
|
+
item: any;
|
|
31
|
+
index: any;
|
|
32
|
+
}, __VLS_33: {
|
|
33
|
+
open: any;
|
|
34
|
+
item: any;
|
|
35
|
+
index: any;
|
|
36
|
+
};
|
|
37
|
+
type __VLS_Slots = {} & {
|
|
38
|
+
[K in NonNullable<typeof __VLS_12>]?: (props: typeof __VLS_13) => any;
|
|
39
|
+
} & {
|
|
40
|
+
[K in NonNullable<typeof __VLS_18>]?: (props: typeof __VLS_19) => any;
|
|
41
|
+
} & {
|
|
42
|
+
[K in NonNullable<typeof __VLS_24>]?: (props: typeof __VLS_25) => any;
|
|
43
|
+
} & {
|
|
44
|
+
[K in NonNullable<typeof __VLS_30>]?: (props: typeof __VLS_31) => any;
|
|
45
|
+
} & {
|
|
46
|
+
default?: (props: typeof __VLS_6) => any;
|
|
47
|
+
} & {
|
|
48
|
+
item?: (props: typeof __VLS_15) => any;
|
|
49
|
+
} & {
|
|
50
|
+
header?: (props: typeof __VLS_21) => any;
|
|
51
|
+
} & {
|
|
52
|
+
trigger?: (props: typeof __VLS_27) => any;
|
|
53
|
+
} & {
|
|
54
|
+
content?: (props: typeof __VLS_33) => any;
|
|
55
|
+
};
|
|
56
|
+
declare const __VLS_component: import("vue").DefineComponent<NAccordionProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
57
|
+
"update:modelValue": (value: string | string[] | undefined) => any;
|
|
58
|
+
}, string, import("vue").PublicProps, Readonly<NAccordionProps> & Readonly<{
|
|
59
|
+
"onUpdate:modelValue"?: ((value: string | string[] | undefined) => any) | undefined;
|
|
60
|
+
}>, {
|
|
61
|
+
type: "multiple" | "single";
|
|
62
|
+
accordion: string;
|
|
63
|
+
collapsible: boolean;
|
|
64
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
65
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
66
|
+
export default _default;
|
|
67
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
68
|
+
new (): {
|
|
69
|
+
$slots: S;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { reactiveOmit } from "@vueuse/core";
|
|
3
|
+
import { AccordionContent, useForwardProps } from "reka-ui";
|
|
4
|
+
import { cn } from "../../../utils";
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
una: { type: Object, required: false },
|
|
7
|
+
forceMount: { type: Boolean, required: false },
|
|
8
|
+
asChild: { type: Boolean, required: false },
|
|
9
|
+
as: { type: null, required: false }
|
|
10
|
+
});
|
|
11
|
+
const forwardProps = useForwardProps(reactiveOmit(props, ["una"]));
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<AccordionContent v-bind="forwardProps" :class="cn('accordion-content group/accordion-content', una?.accordionContent)">
|
|
16
|
+
<div :class="cn('accordion-panel', una?.accordionPanel)">
|
|
17
|
+
<slot />
|
|
18
|
+
</div>
|
|
19
|
+
</AccordionContent>
|
|
20
|
+
</template>
|
|
21
|
+
|
|
22
|
+
<style scoped>
|
|
23
|
+
.accordion-content[data-state=open]{animation:accordionIn .3s cubic-bezier(.86,0,.07,1)}.accordion-content[data-state=closed]{animation:accordionOut .3s cubic-bezier(.86,0,.07,1)}@keyframes accordionIn{0%{height:0}to{height:var(--reka-accordion-content-height)}}@keyframes accordionOut{0%{height:var(--reka-accordion-content-height)}to{height:0}}
|
|
24
|
+
</style>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { NAccordionContentProps } from '../../../types/accordion.js';
|
|
2
|
+
declare var __VLS_6: {};
|
|
3
|
+
type __VLS_Slots = {} & {
|
|
4
|
+
default?: (props: typeof __VLS_6) => any;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_component: import("vue").DefineComponent<NAccordionContentProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<NAccordionContentProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
8
|
+
export default _default;
|
|
9
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
10
|
+
new (): {
|
|
11
|
+
$slots: S;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { reactiveOmit } from "@vueuse/core";
|
|
3
|
+
import { AccordionHeader, useForwardProps } from "reka-ui";
|
|
4
|
+
import { cn } from "../../../utils";
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
una: { type: Object, required: false },
|
|
7
|
+
asChild: { type: Boolean, required: false },
|
|
8
|
+
as: { type: null, required: false }
|
|
9
|
+
});
|
|
10
|
+
const forwardProps = useForwardProps(reactiveOmit(props, ["una"]));
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<AccordionHeader v-bind="forwardProps" :class="cn('accordion-header', una?.accordionHeader)">
|
|
15
|
+
<slot />
|
|
16
|
+
</AccordionHeader>
|
|
17
|
+
</template>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { NAccordionHeaderProps } from '../../../types/accordion.js';
|
|
2
|
+
declare var __VLS_6: {};
|
|
3
|
+
type __VLS_Slots = {} & {
|
|
4
|
+
default?: (props: typeof __VLS_6) => any;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_component: import("vue").DefineComponent<NAccordionHeaderProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<NAccordionHeaderProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
8
|
+
export default _default;
|
|
9
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
10
|
+
new (): {
|
|
11
|
+
$slots: S;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { reactiveOmit } from "@vueuse/core";
|
|
3
|
+
import { AccordionItem, Primitive, useForwardProps } from "reka-ui";
|
|
4
|
+
import { cn } from "../../../utils";
|
|
5
|
+
import NAccordionContent from "./AccordionContent.vue";
|
|
6
|
+
import NAccordionHeader from "./AccordionHeader.vue";
|
|
7
|
+
import NAccordionTrigger from "./AccordionTrigger.vue";
|
|
8
|
+
const props = defineProps({
|
|
9
|
+
label: { type: String, required: false },
|
|
10
|
+
content: { type: String, required: false },
|
|
11
|
+
una: { type: Object, required: false },
|
|
12
|
+
_accordionHeader: { type: Object, required: false },
|
|
13
|
+
_accordionTrigger: { type: Object, required: false },
|
|
14
|
+
_accordionContent: { type: Object, required: false },
|
|
15
|
+
disabled: { type: Boolean, required: false },
|
|
16
|
+
value: { type: String, required: true },
|
|
17
|
+
unmountOnHide: { type: Boolean, required: false },
|
|
18
|
+
asChild: { type: Boolean, required: false },
|
|
19
|
+
as: { type: null, required: false }
|
|
20
|
+
});
|
|
21
|
+
const forwardProps = useForwardProps(reactiveOmit(props, ["una", "label", "content", "_accordionContent", "_accordionHeader", "_accordionTrigger"]));
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<template>
|
|
25
|
+
<AccordionItem
|
|
26
|
+
v-slot="{ open }"
|
|
27
|
+
v-bind="forwardProps"
|
|
28
|
+
:class="cn('accordion-item', una?.accordionItem)"
|
|
29
|
+
>
|
|
30
|
+
<slot :open>
|
|
31
|
+
<NAccordionHeader :una v-bind="_accordionHeader">
|
|
32
|
+
<Primitive
|
|
33
|
+
as-child
|
|
34
|
+
:label
|
|
35
|
+
v-bind="_accordionTrigger"
|
|
36
|
+
:una="{
|
|
37
|
+
btnLeading: cn('accordion-leading', una?.accordionLeading),
|
|
38
|
+
btnTrailing: cn(
|
|
39
|
+
'accordion-trailing',
|
|
40
|
+
una?.accordionTrailing,
|
|
41
|
+
open ? una?.accordionTrailingOpen : una?.accordionTrailingClose
|
|
42
|
+
)
|
|
43
|
+
}"
|
|
44
|
+
>
|
|
45
|
+
<slot name="header" :open>
|
|
46
|
+
<NAccordionTrigger>
|
|
47
|
+
<slot name="trigger" :open />
|
|
48
|
+
</NAccordionTrigger>
|
|
49
|
+
</slot>
|
|
50
|
+
</Primitive>
|
|
51
|
+
</NAccordionHeader>
|
|
52
|
+
<NAccordionContent :una v-bind="_accordionContent">
|
|
53
|
+
<slot name="content" :open>
|
|
54
|
+
{{ content }}
|
|
55
|
+
</slot>
|
|
56
|
+
</NAccordionContent>
|
|
57
|
+
</slot>
|
|
58
|
+
</AccordionItem>
|
|
59
|
+
</template>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { NAccordionItemProps } from '../../../types/accordion.js';
|
|
2
|
+
declare var __VLS_6: {
|
|
3
|
+
open: any;
|
|
4
|
+
}, __VLS_15: {
|
|
5
|
+
open: any;
|
|
6
|
+
}, __VLS_20: {
|
|
7
|
+
open: any;
|
|
8
|
+
}, __VLS_25: {
|
|
9
|
+
open: any;
|
|
10
|
+
};
|
|
11
|
+
type __VLS_Slots = {} & {
|
|
12
|
+
default?: (props: typeof __VLS_6) => any;
|
|
13
|
+
} & {
|
|
14
|
+
header?: (props: typeof __VLS_15) => any;
|
|
15
|
+
} & {
|
|
16
|
+
trigger?: (props: typeof __VLS_20) => any;
|
|
17
|
+
} & {
|
|
18
|
+
content?: (props: typeof __VLS_25) => any;
|
|
19
|
+
};
|
|
20
|
+
declare const __VLS_component: import("vue").DefineComponent<NAccordionItemProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<NAccordionItemProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
21
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
22
|
+
export default _default;
|
|
23
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
24
|
+
new (): {
|
|
25
|
+
$slots: S;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { reactiveOmit } from "@vueuse/core";
|
|
3
|
+
import { AccordionTrigger, useForwardProps } from "reka-ui";
|
|
4
|
+
import { cn } from "../../../utils";
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
una: { type: Object, required: false },
|
|
7
|
+
asChild: { type: Boolean, required: false },
|
|
8
|
+
as: { type: null, required: false },
|
|
9
|
+
type: { type: String, required: false },
|
|
10
|
+
loadingPlacement: { type: String, required: false },
|
|
11
|
+
icon: { type: Boolean, required: false },
|
|
12
|
+
disabled: { type: Boolean, required: false },
|
|
13
|
+
reverse: { type: Boolean, required: false },
|
|
14
|
+
loading: { type: Boolean, required: false },
|
|
15
|
+
block: { type: Boolean, required: false },
|
|
16
|
+
to: { type: null, required: false },
|
|
17
|
+
label: { type: String, required: false },
|
|
18
|
+
btn: { type: String, required: false, default: "~ text" },
|
|
19
|
+
leading: { type: String, required: false },
|
|
20
|
+
trailing: { type: String, required: false, default: "accordion-trailing-icon" },
|
|
21
|
+
size: { type: String, required: false },
|
|
22
|
+
square: { type: null, required: false },
|
|
23
|
+
rounded: { type: null, required: false },
|
|
24
|
+
class: { type: null, required: false },
|
|
25
|
+
breadcrumbActive: { type: String, required: false },
|
|
26
|
+
breadcrumbInactive: { type: String, required: false },
|
|
27
|
+
paginationSelected: { type: String, required: false },
|
|
28
|
+
paginationUnselected: { type: String, required: false },
|
|
29
|
+
dropdownMenu: { type: String, required: false },
|
|
30
|
+
toggleOn: { type: String, required: false },
|
|
31
|
+
toggleOff: { type: String, required: false },
|
|
32
|
+
tabsActive: { type: String, required: false },
|
|
33
|
+
tabsInactive: { type: String, required: false },
|
|
34
|
+
navigationMenu: { type: String, required: false },
|
|
35
|
+
navigationMenuLink: { type: String, required: false },
|
|
36
|
+
ariaLabel: { type: String, required: false }
|
|
37
|
+
});
|
|
38
|
+
const forwardProps = useForwardProps(reactiveOmit(props, ["una"]));
|
|
39
|
+
</script>
|
|
40
|
+
|
|
41
|
+
<template>
|
|
42
|
+
<AccordionTrigger
|
|
43
|
+
class="group/accordion-trigger accordion-trigger"
|
|
44
|
+
v-bind="forwardProps"
|
|
45
|
+
as-child
|
|
46
|
+
:una="{
|
|
47
|
+
...una,
|
|
48
|
+
btn: cn('accordion-trigger-padding', una?.btn),
|
|
49
|
+
btnLabel: cn('accordion-trigger-label', una?.btnLabel)
|
|
50
|
+
}"
|
|
51
|
+
>
|
|
52
|
+
<slot>
|
|
53
|
+
<NButton />
|
|
54
|
+
</slot>
|
|
55
|
+
</AccordionTrigger>
|
|
56
|
+
</template>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { NAccordionTriggerProps } from '../../../types/accordion.js';
|
|
2
|
+
declare var __VLS_6: {};
|
|
3
|
+
type __VLS_Slots = {} & {
|
|
4
|
+
default?: (props: typeof __VLS_6) => any;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_component: import("vue").DefineComponent<NAccordionTriggerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<NAccordionTriggerProps> & Readonly<{}>, {
|
|
7
|
+
btn: string;
|
|
8
|
+
trailing: string;
|
|
9
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
11
|
+
export default _default;
|
|
12
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
13
|
+
new (): {
|
|
14
|
+
$slots: S;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
@@ -7,9 +7,9 @@ type __VLS_Slots = {} & {
|
|
|
7
7
|
};
|
|
8
8
|
declare const __VLS_component: import("vue").DefineComponent<NAvatarProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<NAvatarProps> & Readonly<{}>, {
|
|
9
9
|
size: import("vue").HTMLAttributes["class"];
|
|
10
|
+
as: import("reka-ui").AsTag | import("vue").Component;
|
|
10
11
|
square: import("vue").HTMLAttributes["class"];
|
|
11
12
|
rounded: import("vue").HTMLAttributes["class"];
|
|
12
|
-
as: import("reka-ui").AsTag | import("vue").Component;
|
|
13
13
|
avatar: import("vue").HTMLAttributes["class"];
|
|
14
14
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
15
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
@@ -15,8 +15,8 @@ declare const __VLS_component: import("vue").DefineComponent<NNavigationMenuLink
|
|
|
15
15
|
}>) => any) | undefined;
|
|
16
16
|
}>, {
|
|
17
17
|
btn: string;
|
|
18
|
-
navigationMenuLink: string;
|
|
19
18
|
as: import("reka-ui").AsTag | import("vue").Component;
|
|
19
|
+
navigationMenuLink: string;
|
|
20
20
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
21
21
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
22
22
|
export default _default;
|
|
@@ -6,8 +6,8 @@ type __VLS_Slots = {} & {
|
|
|
6
6
|
declare const __VLS_component: import("vue").DefineComponent<NNavigationMenuTriggerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<NNavigationMenuTriggerProps> & Readonly<{}>, {
|
|
7
7
|
btn: string;
|
|
8
8
|
trailing: string;
|
|
9
|
-
navigationMenu: string;
|
|
10
9
|
as: import("reka-ui").AsTag | import("vue").Component;
|
|
10
|
+
navigationMenu: string;
|
|
11
11
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
12
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
13
13
|
export default _default;
|
|
@@ -8,8 +8,8 @@ declare const __VLS_component: import("vue").DefineComponent<NSidebarProviderPro
|
|
|
8
8
|
}, string, import("vue").PublicProps, Readonly<NSidebarProviderProps> & Readonly<{
|
|
9
9
|
"onUpdate:open"?: ((open: boolean) => any) | undefined;
|
|
10
10
|
}>, {
|
|
11
|
-
defaultOpen: boolean;
|
|
12
11
|
open: boolean;
|
|
12
|
+
defaultOpen: boolean;
|
|
13
13
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
14
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
15
15
|
export default _default;
|
|
@@ -5,8 +5,8 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<NToggleGro
|
|
|
5
5
|
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
6
6
|
}>, {
|
|
7
7
|
icon: boolean;
|
|
8
|
-
square: import("vue").HTMLAttributes["class"];
|
|
9
8
|
as: import("reka-ui").AsTag | import("vue").Component;
|
|
9
|
+
square: import("vue").HTMLAttributes["class"];
|
|
10
10
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
11
11
|
default?: (props: any) => any;
|
|
12
12
|
}>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { AccordionContentProps, AccordionHeaderProps, AccordionItemProps, AccordionRootProps, AccordionTriggerProps } from 'reka-ui';
|
|
1
2
|
import type { NButtonProps } from './button.js';
|
|
2
|
-
export interface NAccordionProps extends
|
|
3
|
+
export interface NAccordionProps extends AccordionRootProps {
|
|
3
4
|
/**
|
|
4
5
|
* Allows you to add `UnaUI` accordion preset properties,
|
|
5
6
|
* Think of it as a shortcut for adding options or variants to the preset if available.
|
|
@@ -8,110 +9,54 @@ export interface NAccordionProps extends Omit<NButtonProps, 'una'> {
|
|
|
8
9
|
* But you can add your own in the configuration file.
|
|
9
10
|
*/
|
|
10
11
|
accordion?: string;
|
|
11
|
-
/**
|
|
12
|
-
* Update leading icon when accordion button item is open,
|
|
13
|
-
* Accepts icon name and utility classes
|
|
14
|
-
*/
|
|
15
|
-
trailingOpen?: string;
|
|
16
|
-
/**
|
|
17
|
-
* Update leading icon when accordion button item is closed,
|
|
18
|
-
* Accepts icon name and utility classes
|
|
19
|
-
*/
|
|
20
|
-
trailingClose?: string;
|
|
21
|
-
/**
|
|
22
|
-
* Allow multiple accordion items to be open at the same time
|
|
23
|
-
*
|
|
24
|
-
* @default false
|
|
25
|
-
*/
|
|
26
|
-
multiple?: boolean;
|
|
27
|
-
/**
|
|
28
|
-
* Allow accordion item to be open by default
|
|
29
|
-
*
|
|
30
|
-
* @default false
|
|
31
|
-
*/
|
|
32
|
-
defaultOpen?: boolean;
|
|
33
|
-
/**
|
|
34
|
-
* Removes border and divider from accordion
|
|
35
|
-
*
|
|
36
|
-
* @default false
|
|
37
|
-
*/
|
|
38
|
-
unstyle?: boolean;
|
|
39
|
-
/**
|
|
40
|
-
* By default, the accordion is unmounted for performance reasons,
|
|
41
|
-
* This means that the accordion will not be rendered until it is opened,
|
|
42
|
-
* If you want to render the accordion when the page loads, you can use the `mounted` prop.
|
|
43
|
-
*
|
|
44
|
-
* @default false
|
|
45
|
-
*/
|
|
46
|
-
mounted?: boolean;
|
|
47
12
|
/**
|
|
48
13
|
* List of items to be rendered,
|
|
49
14
|
* It extends the `NButtonProps` interface
|
|
50
15
|
*
|
|
51
16
|
* @see https://github.com/una-ui/una-ui/blob/main/packages/nuxt/src/runtime/types/button.ts
|
|
52
17
|
*/
|
|
53
|
-
items
|
|
18
|
+
items?: NAccordionItemProps[];
|
|
54
19
|
/**
|
|
55
20
|
* `UnaUI` preset configuration
|
|
56
21
|
*
|
|
57
22
|
* @see https://github.com/una-ui/una-ui/blob/main/packages/preset/src/_shortcuts/accordion.ts
|
|
58
23
|
*/
|
|
59
|
-
una?:
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
} & NButtonProps['una'];
|
|
24
|
+
una?: NAccordionUnaProps & NButtonProps['una'];
|
|
25
|
+
_accordionItem?: Omit<NAccordionItemProps, 'una' | 'value'>;
|
|
26
|
+
_accordionHeader?: Omit<NAccordionHeaderProps, 'una'>;
|
|
27
|
+
_accordionTrigger?: Omit<NButtonProps, 'una'>;
|
|
28
|
+
_accordionContent?: Omit<NAccordionContentProps, 'una'>;
|
|
29
|
+
}
|
|
30
|
+
export interface NAccordionContentProps extends AccordionContentProps {
|
|
31
|
+
una?: Pick<NAccordionUnaProps, 'accordionContent' | 'accordionPanel'>;
|
|
32
|
+
}
|
|
33
|
+
export interface NAccordionHeaderProps extends AccordionHeaderProps {
|
|
34
|
+
una?: Pick<NAccordionUnaProps, 'accordionHeader' | 'accordionTrigger' | 'accordionTrailing' | 'accordionTrailingClose' | 'accordionTrailingOpen' | 'accordionLeading'>;
|
|
71
35
|
}
|
|
72
|
-
export interface
|
|
36
|
+
export interface NAccordionTriggerProps extends AccordionTriggerProps, NButtonProps {
|
|
37
|
+
una?: Pick<NAccordionUnaProps, 'accordionTrigger' | 'accordionTrailing' | 'accordionTrailingClose' | 'accordionTrailingOpen' | 'accordionLeading'> & NButtonProps['una'];
|
|
38
|
+
}
|
|
39
|
+
export interface NAccordionItemProps extends AccordionItemProps {
|
|
40
|
+
label?: string;
|
|
73
41
|
/**
|
|
74
42
|
* Accordion item content
|
|
75
43
|
*/
|
|
76
44
|
content?: string;
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* Allow accordion item to be open by default
|
|
95
|
-
*
|
|
96
|
-
* @default false
|
|
97
|
-
*/
|
|
98
|
-
defaultOpen?: boolean;
|
|
99
|
-
/**
|
|
100
|
-
* Close other accordion items when item is open
|
|
101
|
-
*
|
|
102
|
-
* @default false
|
|
103
|
-
*/
|
|
104
|
-
closeOthers?: boolean;
|
|
105
|
-
/**
|
|
106
|
-
* By default, all the accordion item is unmounted for performance reasons,
|
|
107
|
-
* You can use the `mounted` prop to render the accordion specific on item.
|
|
108
|
-
*
|
|
109
|
-
* @default false
|
|
110
|
-
*/
|
|
111
|
-
mounted?: boolean;
|
|
112
|
-
/**
|
|
113
|
-
* Allow dynamic attributes to be added to the accordion item,
|
|
114
|
-
*
|
|
115
|
-
*/
|
|
116
|
-
[key: string]: any;
|
|
45
|
+
una?: Omit<NAccordionUnaProps, 'accordion'> & NButtonProps['una'];
|
|
46
|
+
_accordionHeader?: Omit<NAccordionHeaderProps, 'una'>;
|
|
47
|
+
_accordionTrigger?: Omit<NAccordionTriggerProps, 'una'>;
|
|
48
|
+
_accordionContent?: Omit<NAccordionContentProps, 'una'>;
|
|
49
|
+
}
|
|
50
|
+
interface NAccordionUnaProps {
|
|
51
|
+
accordion?: string;
|
|
52
|
+
accordionItem?: string;
|
|
53
|
+
accordionTrailing?: string;
|
|
54
|
+
accordionTrailingOpen?: string;
|
|
55
|
+
accordionTrailingClose?: string;
|
|
56
|
+
accordionLeading?: string;
|
|
57
|
+
accordionHeader?: string;
|
|
58
|
+
accordionTrigger?: string;
|
|
59
|
+
accordionContent?: string;
|
|
60
|
+
accordionPanel?: string;
|
|
117
61
|
}
|
|
62
|
+
export {};
|
|
@@ -2,7 +2,7 @@ export * from './cn.js';
|
|
|
2
2
|
export declare function rgbToHex(r: number, g: number, b: number): string;
|
|
3
3
|
export declare function hexToRgb(hex: string): [number, number, number];
|
|
4
4
|
export declare function randomId(prefix: string): string;
|
|
5
|
-
export declare function omitProps<T extends Record<string, any
|
|
5
|
+
export declare function omitProps<T extends Record<string, any>, K extends keyof T>(obj: T, propsToOmit: Array<K>): Omit<T, K>;
|
|
6
6
|
export declare function pickProps<T extends Record<string, any>>(obj: T, propsToPick: Array<keyof T>): Partial<T>;
|
|
7
7
|
/**
|
|
8
8
|
* We want to get the first non-undefined value,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@una-ui/nuxt-edge",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.65.0-
|
|
4
|
+
"version": "0.65.0-29352768.cbf4574",
|
|
5
5
|
"description": "Nuxt module for @una-ui",
|
|
6
6
|
"author": "Phojie Rengel <phojrengel@gmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -36,13 +36,12 @@
|
|
|
36
36
|
"dist"
|
|
37
37
|
],
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@headlessui/vue": "^1.7.23",
|
|
40
39
|
"@iconify/utils": "^2.3.0",
|
|
41
40
|
"@nuxt/kit": "^3.19.2",
|
|
42
41
|
"@nuxtjs/color-mode": "^3.5.2",
|
|
43
42
|
"@tanstack/vue-table": "^8.21.3",
|
|
44
|
-
"@una-ui/extractor-vue-script": "npm:@una-ui/extractor-vue-script-edge@0.65.0-
|
|
45
|
-
"@una-ui/preset": "npm:@una-ui/preset-edge@0.65.0-
|
|
43
|
+
"@una-ui/extractor-vue-script": "npm:@una-ui/extractor-vue-script-edge@0.65.0-29352768.cbf4574",
|
|
44
|
+
"@una-ui/preset": "npm:@una-ui/preset-edge@0.65.0-29352768.cbf4574",
|
|
46
45
|
"@unocss/core": "^66.5.3",
|
|
47
46
|
"@unocss/nuxt": "^66.5.3",
|
|
48
47
|
"@unocss/preset-attributify": "^66.5.3",
|
|
@@ -63,7 +62,7 @@
|
|
|
63
62
|
"vaul-vue": "^0.4.1"
|
|
64
63
|
},
|
|
65
64
|
"devDependencies": {
|
|
66
|
-
"@iconify-json/lucide": "^1.2.
|
|
65
|
+
"@iconify-json/lucide": "^1.2.70",
|
|
67
66
|
"@iconify-json/radix-icons": "^1.2.5",
|
|
68
67
|
"@iconify-json/tabler": "^1.2.23",
|
|
69
68
|
"@nuxt/module-builder": "^1.0.2",
|
|
@@ -1,212 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import {
|
|
3
|
-
Disclosure,
|
|
4
|
-
DisclosureButton,
|
|
5
|
-
DisclosurePanel
|
|
6
|
-
} from "@headlessui/vue";
|
|
7
|
-
import { createReusableTemplate } from "@vueuse/core";
|
|
8
|
-
import { computed, ref } from "vue";
|
|
9
|
-
import { pickProps } from "../../utils";
|
|
10
|
-
import NButton from "./Button.vue";
|
|
11
|
-
import NIcon from "./Icon.vue";
|
|
12
|
-
const props = defineProps({
|
|
13
|
-
accordion: { type: String, required: false },
|
|
14
|
-
trailingOpen: { type: String, required: false, default: "accordion-trailing-icon" },
|
|
15
|
-
trailingClose: { type: String, required: false },
|
|
16
|
-
multiple: { type: Boolean, required: false },
|
|
17
|
-
defaultOpen: { type: Boolean, required: false },
|
|
18
|
-
unstyle: { type: Boolean, required: false },
|
|
19
|
-
mounted: { type: Boolean, required: false },
|
|
20
|
-
items: { type: Array, required: true },
|
|
21
|
-
una: { type: Object, required: false },
|
|
22
|
-
type: { type: String, required: false },
|
|
23
|
-
loadingPlacement: { type: String, required: false, default: "trailing" },
|
|
24
|
-
icon: { type: Boolean, required: false },
|
|
25
|
-
disabled: { type: Boolean, required: false },
|
|
26
|
-
reverse: { type: Boolean, required: false },
|
|
27
|
-
loading: { type: Boolean, required: false },
|
|
28
|
-
block: { type: Boolean, required: false },
|
|
29
|
-
to: { type: null, required: false },
|
|
30
|
-
label: { type: String, required: false },
|
|
31
|
-
btn: { type: String, required: false },
|
|
32
|
-
leading: { type: String, required: false },
|
|
33
|
-
trailing: { type: String, required: false },
|
|
34
|
-
size: { type: String, required: false },
|
|
35
|
-
square: { type: null, required: false },
|
|
36
|
-
rounded: { type: null, required: false },
|
|
37
|
-
class: { type: null, required: false },
|
|
38
|
-
breadcrumbActive: { type: String, required: false },
|
|
39
|
-
breadcrumbInactive: { type: String, required: false },
|
|
40
|
-
paginationSelected: { type: String, required: false },
|
|
41
|
-
paginationUnselected: { type: String, required: false },
|
|
42
|
-
dropdownMenu: { type: String, required: false },
|
|
43
|
-
toggleOn: { type: String, required: false },
|
|
44
|
-
toggleOff: { type: String, required: false },
|
|
45
|
-
tabsActive: { type: String, required: false },
|
|
46
|
-
tabsInactive: { type: String, required: false },
|
|
47
|
-
navigationMenu: { type: String, required: false },
|
|
48
|
-
navigationMenuLink: { type: String, required: false },
|
|
49
|
-
ariaLabel: { type: String, required: false }
|
|
50
|
-
});
|
|
51
|
-
const buttonRefs = ref([]);
|
|
52
|
-
function closeOthers(index) {
|
|
53
|
-
if (props.multiple && props.items[index] && !props.items[index].closeOthers)
|
|
54
|
-
return;
|
|
55
|
-
buttonRefs.value.filter((_, i) => i !== index).forEach((close) => close());
|
|
56
|
-
}
|
|
57
|
-
function onEnter(element, done) {
|
|
58
|
-
const el = element;
|
|
59
|
-
el.style.height = "0";
|
|
60
|
-
el.style.height = `${element.scrollHeight}px`;
|
|
61
|
-
el.addEventListener("transitionend", done, { once: true });
|
|
62
|
-
}
|
|
63
|
-
function onAfterEnter(element) {
|
|
64
|
-
const el = element;
|
|
65
|
-
el.style.height = "auto";
|
|
66
|
-
}
|
|
67
|
-
function onBeforeLeave(element) {
|
|
68
|
-
const el = element;
|
|
69
|
-
el.style.height = `${el.scrollHeight}px`;
|
|
70
|
-
}
|
|
71
|
-
function onLeave(element, done) {
|
|
72
|
-
const el = element;
|
|
73
|
-
el.style.height = "0";
|
|
74
|
-
el.addEventListener("transitionend", done, { once: true });
|
|
75
|
-
}
|
|
76
|
-
const [DefineTemplate, ReuseTemplate] = createReusableTemplate();
|
|
77
|
-
const pickedProps = pickProps(props, ["reverse", "icon", "btn", "label", "leading", "loading", "loadingPlacement", "una", "trailing", "leading", "to", "type", "disabled"]);
|
|
78
|
-
function mergedProps(itemProps) {
|
|
79
|
-
return Object.assign(pickedProps, itemProps);
|
|
80
|
-
}
|
|
81
|
-
const btnVariants = ["solid", "outline", "soft", "ghost", "link", "text"];
|
|
82
|
-
const hasVariant = computed(() => btnVariants.some((btnVariants2) => props.btn?.includes(btnVariants2)));
|
|
83
|
-
const isBaseVariant = computed(() => props.btn?.includes("~"));
|
|
84
|
-
</script>
|
|
85
|
-
|
|
86
|
-
<template>
|
|
87
|
-
<div
|
|
88
|
-
:accordion="accordion"
|
|
89
|
-
class="accordion"
|
|
90
|
-
:class="[
|
|
91
|
-
unstyle ? 'space-y-3' : 'accordion-(border divider)',
|
|
92
|
-
una?.accordion
|
|
93
|
-
]"
|
|
94
|
-
>
|
|
95
|
-
<DefineTemplate v-slot="{ item, close, index, open }">
|
|
96
|
-
<slot
|
|
97
|
-
:name="item.content ? 'content' : index"
|
|
98
|
-
:item="item" :index="index" :open="open" :close="close"
|
|
99
|
-
>
|
|
100
|
-
<div
|
|
101
|
-
accordion="panel"
|
|
102
|
-
:class="[
|
|
103
|
-
una?.accordionPanel,
|
|
104
|
-
{ 'border-t-0': unstyle }
|
|
105
|
-
]"
|
|
106
|
-
>
|
|
107
|
-
{{ item.content }}
|
|
108
|
-
</div>
|
|
109
|
-
</slot>
|
|
110
|
-
</DefineTemplate>
|
|
111
|
-
|
|
112
|
-
<Disclosure
|
|
113
|
-
v-for="(item, i) in items"
|
|
114
|
-
:key="i"
|
|
115
|
-
v-slot="{ open, close }"
|
|
116
|
-
as="div"
|
|
117
|
-
accordion="item"
|
|
118
|
-
:default-open="item.defaultOpen || defaultOpen"
|
|
119
|
-
:class="una?.accordionItem"
|
|
120
|
-
>
|
|
121
|
-
<DisclosureButton
|
|
122
|
-
:ref="() => buttonRefs[i] = close"
|
|
123
|
-
as="template"
|
|
124
|
-
:disabled="item.disabled || disabled"
|
|
125
|
-
@click="closeOthers(i)"
|
|
126
|
-
>
|
|
127
|
-
<slot name="label" :item="item" :index="i" :open="open" :close="close">
|
|
128
|
-
<NButton
|
|
129
|
-
v-bind="mergedProps(item)"
|
|
130
|
-
:btn="`~ block ${btn || ''}`"
|
|
131
|
-
:class="[
|
|
132
|
-
{ 'accordion-button-default-variant': !hasVariant && !isBaseVariant },
|
|
133
|
-
{ 'accordion-button-padding': !unstyle },
|
|
134
|
-
una?.accordionButton
|
|
135
|
-
]"
|
|
136
|
-
:una="{
|
|
137
|
-
btn: 'h-auto accordion-button',
|
|
138
|
-
btnLabel: 'accordion-label'
|
|
139
|
-
}"
|
|
140
|
-
>
|
|
141
|
-
<template #leading>
|
|
142
|
-
<!-- TODO: fix conditional statement -->
|
|
143
|
-
<NIcon
|
|
144
|
-
v-if="leading || item.leading"
|
|
145
|
-
accordion="leading"
|
|
146
|
-
:class="una?.accordionLeading"
|
|
147
|
-
:name="item.leading || leading || ''"
|
|
148
|
-
aria-hidden="true"
|
|
149
|
-
/>
|
|
150
|
-
</template>
|
|
151
|
-
|
|
152
|
-
<template #trailing>
|
|
153
|
-
<span
|
|
154
|
-
v-if="trailingOpen || trailingClose"
|
|
155
|
-
accordion="trailing"
|
|
156
|
-
:class="[
|
|
157
|
-
trailingClose || !trailingClose && open ? una?.accordionTrailingClose || 'accordion-trailing-close' : una?.accordionTrailingOpen || 'accordion-trailing-open',
|
|
158
|
-
una?.accordionTrailing
|
|
159
|
-
]"
|
|
160
|
-
>
|
|
161
|
-
<NIcon
|
|
162
|
-
v-if="(open || !trailingClose) && trailingOpen"
|
|
163
|
-
:name="trailingOpen"
|
|
164
|
-
aria-hidden="true"
|
|
165
|
-
/>
|
|
166
|
-
<NIcon
|
|
167
|
-
v-else-if="!open && trailingClose"
|
|
168
|
-
:name="trailingClose"
|
|
169
|
-
aria-hidden="true"
|
|
170
|
-
/>
|
|
171
|
-
</span>
|
|
172
|
-
</template>
|
|
173
|
-
</NButton>
|
|
174
|
-
</slot>
|
|
175
|
-
</DisclosureButton>
|
|
176
|
-
|
|
177
|
-
<Transition
|
|
178
|
-
:enter-active-class="una?.accordionLeaveActive || 'accordion-leave-active'"
|
|
179
|
-
:leave-active-class="una?.accordionEnterActive || 'accordion-enter-active'"
|
|
180
|
-
@enter="onEnter"
|
|
181
|
-
@after-enter="onAfterEnter"
|
|
182
|
-
@before-leave="onBeforeLeave"
|
|
183
|
-
@leave="onLeave"
|
|
184
|
-
>
|
|
185
|
-
<DisclosurePanel v-if="!item.mounted || !mounted">
|
|
186
|
-
<ReuseTemplate
|
|
187
|
-
v-bind="{
|
|
188
|
-
item,
|
|
189
|
-
index: i,
|
|
190
|
-
open,
|
|
191
|
-
close
|
|
192
|
-
}"
|
|
193
|
-
/>
|
|
194
|
-
</DisclosurePanel>
|
|
195
|
-
<DisclosurePanel
|
|
196
|
-
v-else
|
|
197
|
-
v-show="open"
|
|
198
|
-
static
|
|
199
|
-
>
|
|
200
|
-
<ReuseTemplate
|
|
201
|
-
v-bind="{
|
|
202
|
-
item,
|
|
203
|
-
index: i,
|
|
204
|
-
open,
|
|
205
|
-
close
|
|
206
|
-
}"
|
|
207
|
-
/>
|
|
208
|
-
</DisclosurePanel>
|
|
209
|
-
</Transition>
|
|
210
|
-
</Disclosure>
|
|
211
|
-
</div>
|
|
212
|
-
</template>
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { NAccordionProps } from '../../types/index.js';
|
|
2
|
-
declare var __VLS_6: any, __VLS_7: {
|
|
3
|
-
item: any;
|
|
4
|
-
index: any;
|
|
5
|
-
open: any;
|
|
6
|
-
close: any;
|
|
7
|
-
}, __VLS_21: {
|
|
8
|
-
item: any;
|
|
9
|
-
index: any;
|
|
10
|
-
open: any;
|
|
11
|
-
close: any;
|
|
12
|
-
};
|
|
13
|
-
type __VLS_Slots = {} & {
|
|
14
|
-
[K in NonNullable<typeof __VLS_6>]?: (props: typeof __VLS_7) => any;
|
|
15
|
-
} & {
|
|
16
|
-
label?: (props: typeof __VLS_21) => any;
|
|
17
|
-
};
|
|
18
|
-
declare const __VLS_component: import("vue").DefineComponent<NAccordionProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<NAccordionProps> & Readonly<{}>, {
|
|
19
|
-
loadingPlacement: "leading" | "trailing" | "label";
|
|
20
|
-
trailingOpen: string;
|
|
21
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
22
|
-
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
23
|
-
export default _default;
|
|
24
|
-
type __VLS_WithSlots<T, S> = T & {
|
|
25
|
-
new (): {
|
|
26
|
-
$slots: S;
|
|
27
|
-
};
|
|
28
|
-
};
|