@anweb/nuxt-ancore 1.16.9 → 1.16.11
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
CHANGED
|
@@ -50,11 +50,6 @@ const config = computed(() => {
|
|
|
50
50
|
const canSwipe = computed(() => Scroll.arrivedState.top && !config.value.fullscreen);
|
|
51
51
|
onMounted(() => {
|
|
52
52
|
target.value = refDialog.value?.$el || null;
|
|
53
|
-
if (!config.value.fullscreen) {
|
|
54
|
-
onClickOutside(refDialog, () => Dialogs.close(props.dialog), {
|
|
55
|
-
ignore: [".an-dialog"]
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
53
|
Swipe = useSwipe(target, {
|
|
59
54
|
onSwipeStart,
|
|
60
55
|
onSwipe,
|
|
@@ -73,9 +68,7 @@ onMounted(() => {
|
|
|
73
68
|
aria-modal="true"
|
|
74
69
|
class="an-dialog -flex -flex__column"
|
|
75
70
|
:class="[{ '-fullscreen': config.fullscreen }, config.class]"
|
|
76
|
-
@
|
|
77
|
-
@click.self="mouseDownOnBackdrop && !config.fullscreen && Dialogs.close(props.dialog);
|
|
78
|
-
mouseDownOnBackdrop = false"
|
|
71
|
+
@click.self="!config.fullscreen && Dialogs.close(props.dialog)"
|
|
79
72
|
>
|
|
80
73
|
<component
|
|
81
74
|
ref="refDialog"
|
|
@@ -25,35 +25,36 @@ const name = computed(() => {
|
|
|
25
25
|
return `--an-dropdown-${id}`;
|
|
26
26
|
});
|
|
27
27
|
const menuId = computed(() => `an-dropdown-menu-${id}`);
|
|
28
|
+
const supportsAnchor = computed(() => !isMounted.value || CSS.supports("anchor-name", "none"));
|
|
28
29
|
onClickOutside(refTarget, close, { ignore: [refMenu] });
|
|
29
30
|
useEventListener(document, "keydown", onKeydown);
|
|
30
31
|
defineExpose({ toggle, close });
|
|
31
32
|
</script>
|
|
32
33
|
|
|
33
34
|
<template>
|
|
34
|
-
<div ref="refTarget" class="an-dropdown__button" v-bind="$attrs">
|
|
35
|
-
<div
|
|
36
|
-
:aria-expanded="state"
|
|
37
|
-
:aria-controls="menuId"
|
|
38
|
-
aria-haspopup="true"
|
|
39
|
-
>
|
|
40
|
-
<slot name="button" :toggle="toggle" />
|
|
41
|
-
</div>
|
|
42
|
-
|
|
43
|
-
<teleport to="body" :disabled="!isMounted">
|
|
44
|
-
<div
|
|
45
|
-
v-show="state"
|
|
46
|
-
ref="refMenu"
|
|
47
|
-
:id="menuId"
|
|
48
|
-
role="menu"
|
|
49
|
-
class="an-dropdown__menu"
|
|
50
|
-
>
|
|
51
|
-
<slot name="menu" :close="close" />
|
|
52
|
-
</div>
|
|
53
|
-
</teleport>
|
|
54
|
-
</div>
|
|
35
|
+
<div ref="refTarget" class="an-dropdown__button" v-bind="$attrs">
|
|
36
|
+
<div
|
|
37
|
+
:aria-expanded="state"
|
|
38
|
+
:aria-controls="menuId"
|
|
39
|
+
aria-haspopup="true"
|
|
40
|
+
>
|
|
41
|
+
<slot name="button" :toggle="toggle" />
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
<teleport to="body" :disabled="!isMounted || !supportsAnchor">
|
|
45
|
+
<div
|
|
46
|
+
v-show="state"
|
|
47
|
+
ref="refMenu"
|
|
48
|
+
:id="menuId"
|
|
49
|
+
role="menu"
|
|
50
|
+
class="an-dropdown__menu"
|
|
51
|
+
>
|
|
52
|
+
<slot name="menu" :close="close" />
|
|
53
|
+
</div>
|
|
54
|
+
</teleport>
|
|
55
|
+
</div>
|
|
55
56
|
</template>
|
|
56
57
|
|
|
57
58
|
<style scoped>
|
|
58
|
-
.an-dropdown__button{anchor-name:v-bind(name)}.an-dropdown__menu{position:fixed;position-anchor:v-bind(name);position-area:v-bind(area);position-try-fallbacks:top span-right,bottom span-left,top span-left;z-index:1000}
|
|
59
|
+
.an-dropdown__button{anchor-name:v-bind(name)}.an-dropdown__menu{position:fixed;position-anchor:v-bind(name);position-area:v-bind(area);position-try-fallbacks:top span-right,bottom span-left,top span-left;z-index:1000}@supports not (anchor-name:none){.an-dropdown__button{position:relative}.an-dropdown__menu{left:0;position:absolute;top:100%;z-index:1000}}
|
|
59
60
|
</style>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anweb/nuxt-ancore",
|
|
3
|
-
"version": "1.16.
|
|
3
|
+
"version": "1.16.11",
|
|
4
4
|
"description": "AnCore Nuxt module",
|
|
5
5
|
"repository": "https://github.com/ANLTD/ancore",
|
|
6
6
|
"license": "MIT",
|
|
@@ -48,4 +48,4 @@
|
|
|
48
48
|
"nuxt": "^4.4.2",
|
|
49
49
|
"typescript": "~5.9.3"
|
|
50
50
|
}
|
|
51
|
-
}
|
|
51
|
+
}
|