akar 2.0.7 → 2.0.8
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/Combobox/ComboboxInput.cjs +6 -1
- package/dist/Combobox/ComboboxInput.cjs.map +1 -1
- package/dist/Combobox/ComboboxInput.js +6 -1
- package/dist/Combobox/ComboboxInput.js.map +1 -1
- package/dist/Dialog/DialogOverlayImpl.cjs +5 -1
- package/dist/Dialog/DialogOverlayImpl.cjs.map +1 -1
- package/dist/Dialog/DialogOverlayImpl.js +5 -1
- package/dist/Dialog/DialogOverlayImpl.js.map +1 -1
- package/dist/NavigationMenu/NavigationMenuRoot.cjs +16 -3
- package/dist/NavigationMenu/NavigationMenuRoot.cjs.map +1 -1
- package/dist/NavigationMenu/NavigationMenuRoot.js +16 -3
- package/dist/NavigationMenu/NavigationMenuRoot.js.map +1 -1
- package/dist/ScrollArea/ScrollAreaScrollbarX.cjs +3 -0
- package/dist/ScrollArea/ScrollAreaScrollbarX.cjs.map +1 -1
- package/dist/ScrollArea/ScrollAreaScrollbarX.js +4 -1
- package/dist/ScrollArea/ScrollAreaScrollbarX.js.map +1 -1
- package/dist/ScrollArea/ScrollAreaScrollbarY.cjs +3 -0
- package/dist/ScrollArea/ScrollAreaScrollbarY.cjs.map +1 -1
- package/dist/ScrollArea/ScrollAreaScrollbarY.js +4 -1
- package/dist/ScrollArea/ScrollAreaScrollbarY.js.map +1 -1
- package/dist/constant.d.cts.map +1 -1
- package/dist/index2.d.ts.map +1 -1
- package/dist/index4.d.cts +645 -645
- package/dist/index4.d.cts.map +1 -1
- package/dist/index4.d.ts +631 -631
- package/dist/index4.d.ts.map +1 -1
- package/dist/internal.d.cts +2 -2
- package/dist/internal.d.ts +2 -2
- package/package.json +3 -3
- package/src/Combobox/ComboboxInput.vue +14 -1
- package/src/Dialog/DialogOverlayImpl.vue +1 -1
- package/src/NavigationMenu/NavigationMenuRoot.vue +21 -4
- package/src/ScrollArea/ScrollAreaScrollbarX.vue +8 -1
- package/src/ScrollArea/ScrollAreaScrollbarY.vue +7 -1
- package/src/test/utils.ts +0 -2
package/dist/internal.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./index2.cjs";
|
|
2
2
|
import "./index3.cjs";
|
|
3
3
|
import { MenuArrowProps, MenuCheckboxItemEmits, MenuCheckboxItemProps, MenuContentEmits, MenuContentProps, MenuEmits, MenuGroupProps, MenuItemEmits, MenuItemIndicatorProps, MenuItemProps, MenuLabelProps, MenuPortalProps, MenuProps, MenuRadioGroupEmits, MenuRadioGroupProps, MenuRadioItemEmits, MenuRadioItemProps, MenuSeparatorProps, MenuSubContentEmits, MenuSubContentProps, MenuSubEmits, MenuSubProps, MenuSubTriggerProps, PopperAnchorProps, _default$277 as _default$13, _default$278 as _default$8, _default$279 as _default, _default$280 as _default$6, _default$281 as _default$10, _default$282 as _default$3, _default$283 as _default$14, _default$284 as _default$12, _default$285 as _default$2, _default$286 as _default$1, _default$287 as _default$11, _default$288 as _default$7, _default$290 as _default$9, _default$291 as _default$4, _default$292 as _default$5, injectMenuContext, injectMenuRootContext } from "./index4.cjs";
|
|
4
|
-
import * as
|
|
4
|
+
import * as vue41 from "vue";
|
|
5
5
|
|
|
6
6
|
//#region src/Menu/MenuAnchor.vue.d.ts
|
|
7
7
|
interface MenuAnchorProps extends PopperAnchorProps {}
|
|
@@ -9,7 +9,7 @@ declare var __VLS_8: {};
|
|
|
9
9
|
type __VLS_Slots = {} & {
|
|
10
10
|
default?: (props: typeof __VLS_8) => any;
|
|
11
11
|
};
|
|
12
|
-
declare const __VLS_base:
|
|
12
|
+
declare const __VLS_base: vue41.DefineComponent<MenuAnchorProps, {}, {}, {}, {}, vue41.ComponentOptionsMixin, vue41.ComponentOptionsMixin, {}, string, vue41.PublicProps, Readonly<MenuAnchorProps> & Readonly<{}>, {}, {}, {}, {}, string, vue41.ComponentProvideOptions, false, {}, any>;
|
|
13
13
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
14
14
|
declare const _default$15: typeof __VLS_export;
|
|
15
15
|
type __VLS_WithSlots<T, S> = T & {
|
package/dist/internal.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./index2.js";
|
|
2
2
|
import "./index3.js";
|
|
3
3
|
import { MenuArrowProps, MenuCheckboxItemEmits, MenuCheckboxItemProps, MenuContentEmits, MenuContentProps, MenuEmits, MenuGroupProps, MenuItemEmits, MenuItemIndicatorProps, MenuItemProps, MenuLabelProps, MenuPortalProps, MenuProps, MenuRadioGroupEmits, MenuRadioGroupProps, MenuRadioItemEmits, MenuRadioItemProps, MenuSeparatorProps, MenuSubContentEmits, MenuSubContentProps, MenuSubEmits, MenuSubProps, MenuSubTriggerProps, PopperAnchorProps, _default$277 as _default$13, _default$278 as _default$8, _default$279 as _default, _default$280 as _default$6, _default$281 as _default$10, _default$282 as _default$3, _default$283 as _default$14, _default$284 as _default$12, _default$285 as _default$2, _default$286 as _default$1, _default$287 as _default$11, _default$288 as _default$7, _default$290 as _default$9, _default$291 as _default$4, _default$292 as _default$5, injectMenuContext, injectMenuRootContext } from "./index4.js";
|
|
4
|
-
import * as
|
|
4
|
+
import * as vue88 from "vue";
|
|
5
5
|
|
|
6
6
|
//#region src/Menu/MenuAnchor.vue.d.ts
|
|
7
7
|
interface MenuAnchorProps extends PopperAnchorProps {}
|
|
@@ -9,7 +9,7 @@ declare var __VLS_8: {};
|
|
|
9
9
|
type __VLS_Slots = {} & {
|
|
10
10
|
default?: (props: typeof __VLS_8) => any;
|
|
11
11
|
};
|
|
12
|
-
declare const __VLS_base:
|
|
12
|
+
declare const __VLS_base: vue88.DefineComponent<MenuAnchorProps, {}, {}, {}, {}, vue88.ComponentOptionsMixin, vue88.ComponentOptionsMixin, {}, string, vue88.PublicProps, Readonly<MenuAnchorProps> & Readonly<{}>, {}, {}, {}, {}, string, vue88.ComponentProvideOptions, false, {}, any>;
|
|
13
13
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
14
14
|
declare const _default$15: typeof __VLS_export;
|
|
15
15
|
type __VLS_WithSlots<T, S> = T & {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "akar",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.8",
|
|
5
5
|
"description": "Vue UI primitives components",
|
|
6
6
|
"author": "Vinicunca Contributors (https://github.com/vinicunca)",
|
|
7
7
|
"license": "MIT",
|
|
@@ -111,14 +111,14 @@
|
|
|
111
111
|
"@tsconfig/node24": "^24.0.0",
|
|
112
112
|
"@types/jsdom": "^28.0.0",
|
|
113
113
|
"@types/node": "^24.0.13",
|
|
114
|
-
"@vitejs/plugin-vue": "^6.0.
|
|
114
|
+
"@vitejs/plugin-vue": "^6.0.7",
|
|
115
115
|
"@vitest/coverage-istanbul": "^3.2.4",
|
|
116
116
|
"@vue/test-utils": "^2.4.10",
|
|
117
117
|
"@vue/tsconfig": "^0.7.0",
|
|
118
118
|
"jsdom": "^26.1.0",
|
|
119
119
|
"size-limit": "^12.0.1",
|
|
120
120
|
"tsdown": "^0.12.9",
|
|
121
|
-
"vite": "^8.0.
|
|
121
|
+
"vite": "^8.0.14",
|
|
122
122
|
"vitest": "^3.2.4",
|
|
123
123
|
"vitest-axe": "0.1.0",
|
|
124
124
|
"vitest-canvas-mock": "^0.3.3",
|
|
@@ -78,7 +78,20 @@ function handleBlur(ev: FocusEvent) {
|
|
|
78
78
|
const isInsideContent = document.getElementById(rootContext.contentId)?.contains(nextFocus);
|
|
79
79
|
|
|
80
80
|
if (!isInsideRoot && !isInsideContent) {
|
|
81
|
-
|
|
81
|
+
// Delay to let FocusScope's focus-restoration (handleFocusOut) run first.
|
|
82
|
+
// Without this, closing fires before FocusScope can pull focus back inside,
|
|
83
|
+
// causing a second combobox to immediately close when switching between two.
|
|
84
|
+
requestAnimationFrame(() => {
|
|
85
|
+
if (!rootContext.open.value) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
const active = document.activeElement;
|
|
89
|
+
const isStillOutside = !rootContext.parentElement.value?.contains(active)
|
|
90
|
+
&& !document.getElementById(rootContext.contentId)?.contains(active);
|
|
91
|
+
if (isStillOutside) {
|
|
92
|
+
rootContext.onOpenChange(false);
|
|
93
|
+
}
|
|
94
|
+
});
|
|
82
95
|
}
|
|
83
96
|
}
|
|
84
97
|
|
|
@@ -141,12 +141,13 @@ const { delayDuration, skipDelayDuration, dir: propDir, disableClickTrigger, dis
|
|
|
141
141
|
const dir = useDirection(propDir);
|
|
142
142
|
|
|
143
143
|
const isDelaySkipped = refAutoReset(false, skipDelayDuration);
|
|
144
|
+
const skipNextClose = ref(false);
|
|
144
145
|
const computedDelay = computed(() => {
|
|
145
146
|
const isOpen = modelValue.value !== '';
|
|
146
147
|
if (isOpen || isDelaySkipped.value) {
|
|
147
148
|
return 150;
|
|
148
|
-
}
|
|
149
|
-
|
|
149
|
+
} else {
|
|
150
|
+
// 150ms for user to switch trigger or move into content view
|
|
150
151
|
return delayDuration.value;
|
|
151
152
|
}
|
|
152
153
|
});
|
|
@@ -154,8 +155,17 @@ const computedDelay = computed(() => {
|
|
|
154
155
|
const debouncedFn = useDebounceFn((val?: string) => {
|
|
155
156
|
// passing `undefined` meant to reset the debounce timer
|
|
156
157
|
if (isString(val)) {
|
|
158
|
+
if (val === '' && skipNextClose.value) {
|
|
159
|
+
skipNextClose.value = false;
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
|
|
157
163
|
previousValue.value = modelValue.value;
|
|
158
164
|
modelValue.value = val;
|
|
165
|
+
|
|
166
|
+
if (val === '') {
|
|
167
|
+
isDelaySkipped.value = true;
|
|
168
|
+
}
|
|
159
169
|
}
|
|
160
170
|
}, computedDelay);
|
|
161
171
|
|
|
@@ -193,10 +203,16 @@ provideNavigationMenuContext({
|
|
|
193
203
|
viewport.value = val;
|
|
194
204
|
},
|
|
195
205
|
onTriggerEnter: (val) => {
|
|
196
|
-
|
|
206
|
+
if (modelValue.value !== '') {
|
|
207
|
+
skipNextClose.value = true;
|
|
208
|
+
previousValue.value = modelValue.value;
|
|
209
|
+
modelValue.value = val;
|
|
210
|
+
} else {
|
|
211
|
+
debouncedFn(val);
|
|
212
|
+
}
|
|
197
213
|
},
|
|
198
214
|
onTriggerLeave: () => {
|
|
199
|
-
|
|
215
|
+
skipNextClose.value = false;
|
|
200
216
|
debouncedFn('');
|
|
201
217
|
},
|
|
202
218
|
onContentEnter: () => {
|
|
@@ -204,6 +220,7 @@ provideNavigationMenuContext({
|
|
|
204
220
|
},
|
|
205
221
|
onContentLeave: () => {
|
|
206
222
|
if (!props.disablePointerLeaveClose) {
|
|
223
|
+
skipNextClose.value = false;
|
|
207
224
|
debouncedFn('');
|
|
208
225
|
}
|
|
209
226
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { computed, onMounted } from 'vue';
|
|
2
|
+
import { computed, onMounted, onUnmounted } from 'vue';
|
|
3
3
|
import { useForwardExpose } from '@/shared';
|
|
4
4
|
import { injectScrollAreaRootContext } from './ScrollAreaRoot.vue';
|
|
5
5
|
import ScrollAreaScrollbarImpl from './ScrollAreaScrollbarImpl.vue';
|
|
@@ -16,6 +16,13 @@ onMounted(() => {
|
|
|
16
16
|
rootContext.onScrollbarXChange(scrollbarElement.value);
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
|
+
|
|
20
|
+
// Clear the registration on unmount so consumers (e.g. ScrollAreaCorner) don't
|
|
21
|
+
// hold a stale reference once the scrollbar is removed (e.g. between hover cycles).
|
|
22
|
+
onUnmounted(() => {
|
|
23
|
+
rootContext.onScrollbarXChange(null);
|
|
24
|
+
});
|
|
25
|
+
|
|
19
26
|
const sizes = computed(() => scrollbarVisibleContext.sizes.value);
|
|
20
27
|
</script>
|
|
21
28
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { computed, onMounted } from 'vue';
|
|
2
|
+
import { computed, onMounted, onUnmounted } from 'vue';
|
|
3
3
|
import { useForwardExpose } from '@/shared';
|
|
4
4
|
import { injectScrollAreaRootContext } from './ScrollAreaRoot.vue';
|
|
5
5
|
import ScrollAreaScrollbarImpl from './ScrollAreaScrollbarImpl.vue';
|
|
@@ -17,6 +17,12 @@ onMounted(() => {
|
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
19
|
|
|
20
|
+
// Clear the registration on unmount so consumers (e.g. ScrollAreaCorner) don't
|
|
21
|
+
// hold a stale reference once the scrollbar is removed (e.g. between hover cycles).
|
|
22
|
+
onUnmounted(() => {
|
|
23
|
+
rootContext.onScrollbarYChange(null);
|
|
24
|
+
});
|
|
25
|
+
|
|
20
26
|
const sizes = computed(() => scrollbarVisibleContext.sizes.value);
|
|
21
27
|
</script>
|
|
22
28
|
|
package/src/test/utils.ts
CHANGED