@vue-interface/btn-dropdown 4.1.1 → 4.1.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/btn-dropdown.js +126 -119
- package/dist/btn-dropdown.js.map +1 -1
- package/dist/btn-dropdown.umd.cjs +1 -1
- package/dist/btn-dropdown.umd.cjs.map +1 -1
- package/dist/src/BtnDropdown.vue.d.ts +319 -3
- package/dist/src/BtnDropdownSingle.vue.d.ts +157 -0
- package/dist/src/BtnDropdownSplit.vue.d.ts +167 -0
- package/package.json +5 -2
- package/src/BtnDropdown.vue +11 -0
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { BtnDropdownProps } from './useDropdownHandler';
|
|
2
|
+
declare function __VLS_template(): {
|
|
3
|
+
attrs: Partial<{}>;
|
|
4
|
+
slots: {
|
|
5
|
+
button?(_: {
|
|
6
|
+
expanded: boolean;
|
|
7
|
+
onBlur: (e: FocusEvent) => void;
|
|
8
|
+
onClickToggle: (e: MouseEvent) => void;
|
|
9
|
+
}): any;
|
|
10
|
+
button?(_: {
|
|
11
|
+
expanded: boolean;
|
|
12
|
+
onBlur: (e: FocusEvent) => void;
|
|
13
|
+
onClickToggle: (e: MouseEvent) => void;
|
|
14
|
+
}): any;
|
|
15
|
+
toggle?(_: {
|
|
16
|
+
target: (el: HTMLElement) => HTMLElement;
|
|
17
|
+
expanded: boolean;
|
|
18
|
+
onBlur: (e: FocusEvent) => void;
|
|
19
|
+
onClickToggle: (e: MouseEvent) => void;
|
|
20
|
+
}): any;
|
|
21
|
+
default?(_: {}): any;
|
|
22
|
+
};
|
|
23
|
+
refs: {
|
|
24
|
+
target: HTMLButtonElement;
|
|
25
|
+
menu: ({
|
|
26
|
+
$: import('vue').ComponentInternalInstance;
|
|
27
|
+
$data: {};
|
|
28
|
+
$props: {
|
|
29
|
+
readonly align?: "left" | "right" | undefined;
|
|
30
|
+
readonly show?: boolean | undefined;
|
|
31
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
|
|
32
|
+
$attrs: {
|
|
33
|
+
[x: string]: unknown;
|
|
34
|
+
};
|
|
35
|
+
$refs: {
|
|
36
|
+
[x: string]: unknown;
|
|
37
|
+
};
|
|
38
|
+
$slots: Readonly<{
|
|
39
|
+
[name: string]: import('vue').Slot<any> | undefined;
|
|
40
|
+
}>;
|
|
41
|
+
$root: import('vue').ComponentPublicInstance | null;
|
|
42
|
+
$parent: import('vue').ComponentPublicInstance | null;
|
|
43
|
+
$host: Element | null;
|
|
44
|
+
$emit: (event: string, ...args: any[]) => void;
|
|
45
|
+
$el: HTMLDivElement;
|
|
46
|
+
$options: import('vue').ComponentOptionsBase<Readonly<{
|
|
47
|
+
align?: "left" | "right";
|
|
48
|
+
show?: boolean;
|
|
49
|
+
}> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
|
|
50
|
+
align: "left" | "right";
|
|
51
|
+
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
|
|
52
|
+
beforeCreate?: (() => void) | (() => void)[];
|
|
53
|
+
created?: (() => void) | (() => void)[];
|
|
54
|
+
beforeMount?: (() => void) | (() => void)[];
|
|
55
|
+
mounted?: (() => void) | (() => void)[];
|
|
56
|
+
beforeUpdate?: (() => void) | (() => void)[];
|
|
57
|
+
updated?: (() => void) | (() => void)[];
|
|
58
|
+
activated?: (() => void) | (() => void)[];
|
|
59
|
+
deactivated?: (() => void) | (() => void)[];
|
|
60
|
+
beforeDestroy?: (() => void) | (() => void)[];
|
|
61
|
+
beforeUnmount?: (() => void) | (() => void)[];
|
|
62
|
+
destroyed?: (() => void) | (() => void)[];
|
|
63
|
+
unmounted?: (() => void) | (() => void)[];
|
|
64
|
+
renderTracked?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
|
65
|
+
renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
|
66
|
+
errorCaptured?: ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void)[];
|
|
67
|
+
};
|
|
68
|
+
$forceUpdate: () => void;
|
|
69
|
+
$nextTick: typeof import('vue').nextTick;
|
|
70
|
+
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
|
|
71
|
+
} & Readonly<{
|
|
72
|
+
align: "left" | "right";
|
|
73
|
+
}> & Omit<Readonly<{
|
|
74
|
+
align?: "left" | "right";
|
|
75
|
+
show?: boolean;
|
|
76
|
+
}> & Readonly<{}>, "align"> & import('vue').ShallowUnwrapRef<{}> & {} & import('vue').ComponentCustomProperties & {} & {
|
|
77
|
+
$slots: {
|
|
78
|
+
default?(_: {}): any;
|
|
79
|
+
};
|
|
80
|
+
}) | null;
|
|
81
|
+
};
|
|
82
|
+
rootEl: HTMLDivElement;
|
|
83
|
+
};
|
|
84
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
85
|
+
declare const __VLS_component: import('vue').DefineComponent<BtnDropdownProps, {
|
|
86
|
+
show: () => void;
|
|
87
|
+
hide: () => void;
|
|
88
|
+
toggle: () => void;
|
|
89
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
90
|
+
show: () => any;
|
|
91
|
+
click: (event: MouseEvent) => any;
|
|
92
|
+
clickToggle: (event: MouseEvent) => any;
|
|
93
|
+
hide: () => any;
|
|
94
|
+
}, string, import('vue').PublicProps, Readonly<BtnDropdownProps> & Readonly<{
|
|
95
|
+
onShow?: (() => any) | undefined;
|
|
96
|
+
onClick?: ((event: MouseEvent) => any) | undefined;
|
|
97
|
+
onClickToggle?: ((event: MouseEvent) => any) | undefined;
|
|
98
|
+
onHide?: (() => any) | undefined;
|
|
99
|
+
}>, {
|
|
100
|
+
caret: boolean;
|
|
101
|
+
variant: string;
|
|
102
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
103
|
+
target: HTMLButtonElement;
|
|
104
|
+
menu: ({
|
|
105
|
+
$: import('vue').ComponentInternalInstance;
|
|
106
|
+
$data: {};
|
|
107
|
+
$props: {
|
|
108
|
+
readonly align?: "left" | "right" | undefined;
|
|
109
|
+
readonly show?: boolean | undefined;
|
|
110
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
|
|
111
|
+
$attrs: {
|
|
112
|
+
[x: string]: unknown;
|
|
113
|
+
};
|
|
114
|
+
$refs: {
|
|
115
|
+
[x: string]: unknown;
|
|
116
|
+
};
|
|
117
|
+
$slots: Readonly<{
|
|
118
|
+
[name: string]: import('vue').Slot<any> | undefined;
|
|
119
|
+
}>;
|
|
120
|
+
$root: import('vue').ComponentPublicInstance | null;
|
|
121
|
+
$parent: import('vue').ComponentPublicInstance | null;
|
|
122
|
+
$host: Element | null;
|
|
123
|
+
$emit: (event: string, ...args: any[]) => void;
|
|
124
|
+
$el: HTMLDivElement;
|
|
125
|
+
$options: import('vue').ComponentOptionsBase<Readonly<{
|
|
126
|
+
align?: "left" | "right";
|
|
127
|
+
show?: boolean;
|
|
128
|
+
}> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
|
|
129
|
+
align: "left" | "right";
|
|
130
|
+
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
|
|
131
|
+
beforeCreate?: (() => void) | (() => void)[];
|
|
132
|
+
created?: (() => void) | (() => void)[];
|
|
133
|
+
beforeMount?: (() => void) | (() => void)[];
|
|
134
|
+
mounted?: (() => void) | (() => void)[];
|
|
135
|
+
beforeUpdate?: (() => void) | (() => void)[];
|
|
136
|
+
updated?: (() => void) | (() => void)[];
|
|
137
|
+
activated?: (() => void) | (() => void)[];
|
|
138
|
+
deactivated?: (() => void) | (() => void)[];
|
|
139
|
+
beforeDestroy?: (() => void) | (() => void)[];
|
|
140
|
+
beforeUnmount?: (() => void) | (() => void)[];
|
|
141
|
+
destroyed?: (() => void) | (() => void)[];
|
|
142
|
+
unmounted?: (() => void) | (() => void)[];
|
|
143
|
+
renderTracked?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
|
144
|
+
renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
|
145
|
+
errorCaptured?: ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void)[];
|
|
146
|
+
};
|
|
147
|
+
$forceUpdate: () => void;
|
|
148
|
+
$nextTick: typeof import('vue').nextTick;
|
|
149
|
+
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
|
|
150
|
+
} & Readonly<{
|
|
151
|
+
align: "left" | "right";
|
|
152
|
+
}> & Omit<Readonly<{
|
|
153
|
+
align?: "left" | "right";
|
|
154
|
+
show?: boolean;
|
|
155
|
+
}> & Readonly<{}>, "align"> & import('vue').ShallowUnwrapRef<{}> & {} & import('vue').ComponentCustomProperties & {} & {
|
|
156
|
+
$slots: {
|
|
157
|
+
default?(_: {}): any;
|
|
158
|
+
};
|
|
159
|
+
}) | null;
|
|
160
|
+
}, HTMLDivElement>;
|
|
161
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
162
|
+
export default _default;
|
|
163
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
164
|
+
new (): {
|
|
165
|
+
$slots: S;
|
|
166
|
+
};
|
|
167
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue-interface/btn-dropdown",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.2",
|
|
4
4
|
"description": "A Vue button dropdown component.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/btn-dropdown.umd.cjs",
|
|
@@ -49,7 +49,10 @@
|
|
|
49
49
|
"@floating-ui/vue": "^1.1.6",
|
|
50
50
|
"vue": "^3.3.4",
|
|
51
51
|
"@vue-interface/btn": "5.0.5",
|
|
52
|
-
"@vue-interface/dropdown-menu": "3.0.
|
|
52
|
+
"@vue-interface/dropdown-menu": "3.0.7"
|
|
53
|
+
},
|
|
54
|
+
"devDependencies": {
|
|
55
|
+
"vue-component-type-helpers": "^3.2.2"
|
|
53
56
|
},
|
|
54
57
|
"scripts": {
|
|
55
58
|
"dev": "vite",
|
package/src/BtnDropdown.vue
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { useTemplateRef } from 'vue';
|
|
3
|
+
import { type ComponentExposed } from 'vue-component-type-helpers';
|
|
2
4
|
import BtnDropdownSingle from './BtnDropdownSingle.vue';
|
|
3
5
|
import BtnDropdownSplit from './BtnDropdownSplit.vue';
|
|
4
6
|
import { BtnDropdownEvents, BtnDropdownProps } from './useDropdownHandler';
|
|
@@ -11,10 +13,19 @@ const props = withDefaults(defineProps<{
|
|
|
11
13
|
});
|
|
12
14
|
|
|
13
15
|
const emit = defineEmits<BtnDropdownEvents>();
|
|
16
|
+
|
|
17
|
+
const el = useTemplateRef<ComponentExposed<typeof BtnDropdownSingle | typeof BtnDropdownSplit>>('el');
|
|
18
|
+
|
|
19
|
+
defineExpose({
|
|
20
|
+
hide: () => el.value?.hide(),
|
|
21
|
+
show: () => el.value?.show(),
|
|
22
|
+
toggle: () => el.value?.toggle(),
|
|
23
|
+
});
|
|
14
24
|
</script>
|
|
15
25
|
|
|
16
26
|
<template>
|
|
17
27
|
<Component
|
|
28
|
+
ref="el"
|
|
18
29
|
:is="!split ? BtnDropdownSingle : BtnDropdownSplit"
|
|
19
30
|
v-bind="props"
|
|
20
31
|
@click="(e: MouseEvent) => emit('click', e)"
|