@destyler/popover 0.0.1-beta.12 → 0.0.1-beta.14
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/LICENSE +21 -0
- package/dist/component.cjs +1 -1
- package/dist/component.d.cts +3 -3
- package/dist/component.d.mts +3 -3
- package/dist/component.d.ts +3 -3
- package/dist/component.mjs +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/shared/{popover.b75b8d61.d.ts → popover.1e7c063d.d.cts} +1 -1
- package/dist/shared/{popover.b75b8d61.d.cts → popover.1e7c063d.d.mts} +1 -1
- package/dist/shared/{popover.b75b8d61.d.mts → popover.1e7c063d.d.ts} +1 -1
- package/dist/shared/{popover.1439b1d2.mjs → popover.a25f925c.mjs} +11 -11
- package/dist/shared/{popover.5d0578ba.cjs → popover.f0fbccbe.cjs} +10 -10
- package/package.json +10 -10
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023-PRESENT Elone Hoo
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/component.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const vue = require('vue');
|
|
4
4
|
const popper = require('@destyler/popper');
|
|
5
|
-
const index = require('./shared/popover.
|
|
5
|
+
const index = require('./shared/popover.f0fbccbe.cjs');
|
|
6
6
|
require('@destyler/primitive');
|
|
7
7
|
require('@destyler/shared');
|
|
8
8
|
require('@destyler/composition');
|
package/dist/component.d.cts
CHANGED
|
@@ -4,8 +4,8 @@ import * as _destyler_primitive from '@destyler/primitive';
|
|
|
4
4
|
import { AsTag } from '@destyler/primitive';
|
|
5
5
|
import * as _destyler_shared from '@destyler/shared';
|
|
6
6
|
import { ExtractPublicPropTypes, Measurable } from '@destyler/shared';
|
|
7
|
-
import { P as PopoverRootContext } from './shared/popover.
|
|
8
|
-
export { D as DestylerPopoverArrow, a as DestylerPopoverArrowProps, b as DestylerPopoverClose, c as DestylerPopoverCloseProps, d as DestylerPopoverContent, e as DestylerPopoverContentProps, f as DestylerPopoverPortal, g as DestylerPopoverPortalProps, h as DestylerPopoverRoot, i as DestylerPopoverRootProps, j as DestylerPopoverTrigger, k as DestylerPopoverTriggerProps } from './shared/popover.
|
|
7
|
+
import { P as PopoverRootContext } from './shared/popover.1e7c063d.cjs';
|
|
8
|
+
export { D as DestylerPopoverArrow, a as DestylerPopoverArrowProps, b as DestylerPopoverClose, c as DestylerPopoverCloseProps, d as DestylerPopoverContent, e as DestylerPopoverContentProps, f as DestylerPopoverPortal, g as DestylerPopoverPortalProps, h as DestylerPopoverRoot, i as DestylerPopoverRootProps, j as DestylerPopoverTrigger, k as DestylerPopoverTriggerProps } from './shared/popover.1e7c063d.cjs';
|
|
9
9
|
import * as _vue_shared from '@vue/shared';
|
|
10
10
|
|
|
11
11
|
declare const destylerPopoverAnchorProps: {
|
|
@@ -465,7 +465,7 @@ declare const DestylerPopoverContentModal: vue.DefineComponent<{
|
|
|
465
465
|
readonly onPlaced?: (() => void) | undefined;
|
|
466
466
|
} & {}> & Record<string, any>>;
|
|
467
467
|
isRightClickOutsideRef: vue.Ref<boolean>;
|
|
468
|
-
|
|
468
|
+
forwardRef: (ref: Element | vue.ComponentPublicInstance | null) => void;
|
|
469
469
|
}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, string[], string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
470
470
|
readonly side: {
|
|
471
471
|
readonly type: vue.PropType<"top" | "right" | "bottom" | "left">;
|
package/dist/component.d.mts
CHANGED
|
@@ -4,8 +4,8 @@ import * as _destyler_primitive from '@destyler/primitive';
|
|
|
4
4
|
import { AsTag } from '@destyler/primitive';
|
|
5
5
|
import * as _destyler_shared from '@destyler/shared';
|
|
6
6
|
import { ExtractPublicPropTypes, Measurable } from '@destyler/shared';
|
|
7
|
-
import { P as PopoverRootContext } from './shared/popover.
|
|
8
|
-
export { D as DestylerPopoverArrow, a as DestylerPopoverArrowProps, b as DestylerPopoverClose, c as DestylerPopoverCloseProps, d as DestylerPopoverContent, e as DestylerPopoverContentProps, f as DestylerPopoverPortal, g as DestylerPopoverPortalProps, h as DestylerPopoverRoot, i as DestylerPopoverRootProps, j as DestylerPopoverTrigger, k as DestylerPopoverTriggerProps } from './shared/popover.
|
|
7
|
+
import { P as PopoverRootContext } from './shared/popover.1e7c063d.mjs';
|
|
8
|
+
export { D as DestylerPopoverArrow, a as DestylerPopoverArrowProps, b as DestylerPopoverClose, c as DestylerPopoverCloseProps, d as DestylerPopoverContent, e as DestylerPopoverContentProps, f as DestylerPopoverPortal, g as DestylerPopoverPortalProps, h as DestylerPopoverRoot, i as DestylerPopoverRootProps, j as DestylerPopoverTrigger, k as DestylerPopoverTriggerProps } from './shared/popover.1e7c063d.mjs';
|
|
9
9
|
import * as _vue_shared from '@vue/shared';
|
|
10
10
|
|
|
11
11
|
declare const destylerPopoverAnchorProps: {
|
|
@@ -465,7 +465,7 @@ declare const DestylerPopoverContentModal: vue.DefineComponent<{
|
|
|
465
465
|
readonly onPlaced?: (() => void) | undefined;
|
|
466
466
|
} & {}> & Record<string, any>>;
|
|
467
467
|
isRightClickOutsideRef: vue.Ref<boolean>;
|
|
468
|
-
|
|
468
|
+
forwardRef: (ref: Element | vue.ComponentPublicInstance | null) => void;
|
|
469
469
|
}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, string[], string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
470
470
|
readonly side: {
|
|
471
471
|
readonly type: vue.PropType<"top" | "right" | "bottom" | "left">;
|
package/dist/component.d.ts
CHANGED
|
@@ -4,8 +4,8 @@ import * as _destyler_primitive from '@destyler/primitive';
|
|
|
4
4
|
import { AsTag } from '@destyler/primitive';
|
|
5
5
|
import * as _destyler_shared from '@destyler/shared';
|
|
6
6
|
import { ExtractPublicPropTypes, Measurable } from '@destyler/shared';
|
|
7
|
-
import { P as PopoverRootContext } from './shared/popover.
|
|
8
|
-
export { D as DestylerPopoverArrow, a as DestylerPopoverArrowProps, b as DestylerPopoverClose, c as DestylerPopoverCloseProps, d as DestylerPopoverContent, e as DestylerPopoverContentProps, f as DestylerPopoverPortal, g as DestylerPopoverPortalProps, h as DestylerPopoverRoot, i as DestylerPopoverRootProps, j as DestylerPopoverTrigger, k as DestylerPopoverTriggerProps } from './shared/popover.
|
|
7
|
+
import { P as PopoverRootContext } from './shared/popover.1e7c063d.js';
|
|
8
|
+
export { D as DestylerPopoverArrow, a as DestylerPopoverArrowProps, b as DestylerPopoverClose, c as DestylerPopoverCloseProps, d as DestylerPopoverContent, e as DestylerPopoverContentProps, f as DestylerPopoverPortal, g as DestylerPopoverPortalProps, h as DestylerPopoverRoot, i as DestylerPopoverRootProps, j as DestylerPopoverTrigger, k as DestylerPopoverTriggerProps } from './shared/popover.1e7c063d.js';
|
|
9
9
|
import * as _vue_shared from '@vue/shared';
|
|
10
10
|
|
|
11
11
|
declare const destylerPopoverAnchorProps: {
|
|
@@ -465,7 +465,7 @@ declare const DestylerPopoverContentModal: vue.DefineComponent<{
|
|
|
465
465
|
readonly onPlaced?: (() => void) | undefined;
|
|
466
466
|
} & {}> & Record<string, any>>;
|
|
467
467
|
isRightClickOutsideRef: vue.Ref<boolean>;
|
|
468
|
-
|
|
468
|
+
forwardRef: (ref: Element | vue.ComponentPublicInstance | null) => void;
|
|
469
469
|
}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, string[], string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
470
470
|
readonly side: {
|
|
471
471
|
readonly type: vue.PropType<"top" | "right" | "bottom" | "left">;
|
package/dist/component.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent, onBeforeMount, onUnmounted, h, mergeProps } from 'vue';
|
|
2
2
|
import { DestylerPopperAnchor } from '@destyler/popper';
|
|
3
|
-
import { i as injectPopoverRootContext } from './shared/popover.
|
|
4
|
-
export { D as DestylerPopoverArrow, a as DestylerPopoverClose, b as DestylerPopoverContent, c as DestylerPopoverContentImpl, d as DestylerPopoverContentModal, e as DestylerPopoverContentNonModal, f as DestylerPopoverPortal, g as DestylerPopoverRoot, h as DestylerPopoverTrigger } from './shared/popover.
|
|
3
|
+
import { i as injectPopoverRootContext } from './shared/popover.a25f925c.mjs';
|
|
4
|
+
export { D as DestylerPopoverArrow, a as DestylerPopoverClose, b as DestylerPopoverContent, c as DestylerPopoverContentImpl, d as DestylerPopoverContentModal, e as DestylerPopoverContentNonModal, f as DestylerPopoverPortal, g as DestylerPopoverRoot, h as DestylerPopoverTrigger } from './shared/popover.a25f925c.mjs';
|
|
5
5
|
import '@destyler/primitive';
|
|
6
6
|
import '@destyler/shared';
|
|
7
7
|
import '@destyler/composition';
|
package/dist/index.cjs
CHANGED
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { D as DestylerPopoverArrow, a as DestylerPopoverArrowProps, b as DestylerPopoverClose, c as DestylerPopoverCloseProps, d as DestylerPopoverContent, e as DestylerPopoverContentProps, f as DestylerPopoverPortal, g as DestylerPopoverPortalProps, h as DestylerPopoverRoot, i as DestylerPopoverRootProps, j as DestylerPopoverTrigger, k as DestylerPopoverTriggerProps } from './shared/popover.
|
|
1
|
+
export { D as DestylerPopoverArrow, a as DestylerPopoverArrowProps, b as DestylerPopoverClose, c as DestylerPopoverCloseProps, d as DestylerPopoverContent, e as DestylerPopoverContentProps, f as DestylerPopoverPortal, g as DestylerPopoverPortalProps, h as DestylerPopoverRoot, i as DestylerPopoverRootProps, j as DestylerPopoverTrigger, k as DestylerPopoverTriggerProps } from './shared/popover.1e7c063d.cjs';
|
|
2
2
|
import 'vue';
|
|
3
3
|
import '@destyler/primitive';
|
|
4
4
|
import '@destyler/shared';
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { D as DestylerPopoverArrow, a as DestylerPopoverArrowProps, b as DestylerPopoverClose, c as DestylerPopoverCloseProps, d as DestylerPopoverContent, e as DestylerPopoverContentProps, f as DestylerPopoverPortal, g as DestylerPopoverPortalProps, h as DestylerPopoverRoot, i as DestylerPopoverRootProps, j as DestylerPopoverTrigger, k as DestylerPopoverTriggerProps } from './shared/popover.
|
|
1
|
+
export { D as DestylerPopoverArrow, a as DestylerPopoverArrowProps, b as DestylerPopoverClose, c as DestylerPopoverCloseProps, d as DestylerPopoverContent, e as DestylerPopoverContentProps, f as DestylerPopoverPortal, g as DestylerPopoverPortalProps, h as DestylerPopoverRoot, i as DestylerPopoverRootProps, j as DestylerPopoverTrigger, k as DestylerPopoverTriggerProps } from './shared/popover.1e7c063d.mjs';
|
|
2
2
|
import 'vue';
|
|
3
3
|
import '@destyler/primitive';
|
|
4
4
|
import '@destyler/shared';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { D as DestylerPopoverArrow, a as DestylerPopoverArrowProps, b as DestylerPopoverClose, c as DestylerPopoverCloseProps, d as DestylerPopoverContent, e as DestylerPopoverContentProps, f as DestylerPopoverPortal, g as DestylerPopoverPortalProps, h as DestylerPopoverRoot, i as DestylerPopoverRootProps, j as DestylerPopoverTrigger, k as DestylerPopoverTriggerProps } from './shared/popover.
|
|
1
|
+
export { D as DestylerPopoverArrow, a as DestylerPopoverArrowProps, b as DestylerPopoverClose, c as DestylerPopoverCloseProps, d as DestylerPopoverContent, e as DestylerPopoverContentProps, f as DestylerPopoverPortal, g as DestylerPopoverPortalProps, h as DestylerPopoverRoot, i as DestylerPopoverRootProps, j as DestylerPopoverTrigger, k as DestylerPopoverTriggerProps } from './shared/popover.1e7c063d.js';
|
|
2
2
|
import 'vue';
|
|
3
3
|
import '@destyler/primitive';
|
|
4
4
|
import '@destyler/shared';
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { D as DestylerPopoverArrow, a as DestylerPopoverClose, b as DestylerPopoverContent, f as DestylerPopoverPortal, g as DestylerPopoverRoot, h as DestylerPopoverTrigger } from './shared/popover.
|
|
1
|
+
export { D as DestylerPopoverArrow, a as DestylerPopoverClose, b as DestylerPopoverContent, f as DestylerPopoverPortal, g as DestylerPopoverRoot, h as DestylerPopoverTrigger } from './shared/popover.a25f925c.mjs';
|
|
2
2
|
import 'vue';
|
|
3
3
|
import '@destyler/popper';
|
|
4
4
|
import '@destyler/primitive';
|
|
@@ -590,7 +590,7 @@ declare const DestylerPopoverTrigger: vue.DefineComponent<{
|
|
|
590
590
|
};
|
|
591
591
|
}, {
|
|
592
592
|
rootContext: PopoverRootContext;
|
|
593
|
-
|
|
593
|
+
forwardRef: (ref: Element | vue.ComponentPublicInstance | null) => void;
|
|
594
594
|
}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
595
595
|
readonly asChild: {
|
|
596
596
|
readonly type: PropType<boolean>;
|
|
@@ -590,7 +590,7 @@ declare const DestylerPopoverTrigger: vue.DefineComponent<{
|
|
|
590
590
|
};
|
|
591
591
|
}, {
|
|
592
592
|
rootContext: PopoverRootContext;
|
|
593
|
-
|
|
593
|
+
forwardRef: (ref: Element | vue.ComponentPublicInstance | null) => void;
|
|
594
594
|
}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
595
595
|
readonly asChild: {
|
|
596
596
|
readonly type: PropType<boolean>;
|
|
@@ -590,7 +590,7 @@ declare const DestylerPopoverTrigger: vue.DefineComponent<{
|
|
|
590
590
|
};
|
|
591
591
|
}, {
|
|
592
592
|
rootContext: PopoverRootContext;
|
|
593
|
-
|
|
593
|
+
forwardRef: (ref: Element | vue.ComponentPublicInstance | null) => void;
|
|
594
594
|
}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
595
595
|
readonly asChild: {
|
|
596
596
|
readonly type: PropType<boolean>;
|
|
@@ -2,7 +2,7 @@ import { defineComponent, h, mergeProps, toRef, ref, withDirectives, onMounted }
|
|
|
2
2
|
import { DestylerPopperArrow, DestylerPopperRoot, DestylerPopperContent, DestylerPopperAnchor } from '@destyler/popper';
|
|
3
3
|
import { DestylerPrimitive } from '@destyler/primitive';
|
|
4
4
|
import { createContext } from '@destyler/shared';
|
|
5
|
-
import { useVModel, useId, useForwardProps, useFocusGuards, useForwardPropsEmits,
|
|
5
|
+
import { useVModel, useId, useForwardProps, useFocusGuards, useForwardPropsEmits, useForwardExpose, useHideOthers } from '@destyler/composition';
|
|
6
6
|
import { DestylerPresence } from '@destyler/presence';
|
|
7
7
|
import { DestylerDismissableLayer } from '@destyler/dismissable-layer';
|
|
8
8
|
import { DestylerFocusScope } from '@destyler/focus-scope';
|
|
@@ -291,27 +291,27 @@ const DestylerPopoverContentModal = defineComponent({
|
|
|
291
291
|
const rootContext = injectPopoverRootContext();
|
|
292
292
|
const isRightClickOutsideRef = ref(false);
|
|
293
293
|
const forwarded = useForwardPropsEmits(props, emit);
|
|
294
|
-
const {
|
|
294
|
+
const { forwardRef, currentElement } = useForwardExpose();
|
|
295
295
|
useHideOthers(currentElement);
|
|
296
296
|
return {
|
|
297
297
|
rootContext,
|
|
298
298
|
forwarded,
|
|
299
299
|
isRightClickOutsideRef,
|
|
300
|
-
|
|
300
|
+
forwardRef
|
|
301
301
|
};
|
|
302
302
|
},
|
|
303
303
|
render() {
|
|
304
304
|
return h(DestylerPopoverContentImpl, {
|
|
305
|
-
|
|
305
|
+
ref: (el) => this.forwardRef(el),
|
|
306
306
|
...mergeProps(this.forwarded),
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
307
|
+
trapFocus: this.rootContext.open.value,
|
|
308
|
+
disableOutsidePointerEvents: true,
|
|
309
|
+
onCloseAutoFocusPrevent: (event) => {
|
|
310
310
|
this.$emit("closeAutoFocus", event);
|
|
311
311
|
if (!this.isRightClickOutsideRef)
|
|
312
312
|
this.rootContext.triggerElement.value?.focus();
|
|
313
313
|
},
|
|
314
|
-
|
|
314
|
+
onPointerDownOutside: (event) => {
|
|
315
315
|
this.$emit("pointerDownOutside", event);
|
|
316
316
|
const originalEvent = event.detail.originalEvent;
|
|
317
317
|
const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
|
|
@@ -456,20 +456,20 @@ const DestylerPopoverTrigger = defineComponent({
|
|
|
456
456
|
props: destylerPopoverTriggerProps,
|
|
457
457
|
setup() {
|
|
458
458
|
const rootContext = injectPopoverRootContext();
|
|
459
|
-
const {
|
|
459
|
+
const { forwardRef, currentElement: triggerElement } = useForwardExpose();
|
|
460
460
|
onMounted(() => {
|
|
461
461
|
rootContext.triggerElement.value = triggerElement.value;
|
|
462
462
|
});
|
|
463
463
|
return {
|
|
464
464
|
rootContext,
|
|
465
|
-
|
|
465
|
+
forwardRef
|
|
466
466
|
};
|
|
467
467
|
},
|
|
468
468
|
render() {
|
|
469
469
|
return h(this.rootContext.hasCustomAnchor.value ? DestylerPrimitive : DestylerPopperAnchor, {
|
|
470
470
|
asChild: true
|
|
471
471
|
}, h(DestylerPrimitive, {
|
|
472
|
-
"ref":
|
|
472
|
+
"ref": (el) => this.forwardRef(el),
|
|
473
473
|
"type": this.$props.as === "button" ? "button" : void 0,
|
|
474
474
|
"as": this.$props.as,
|
|
475
475
|
"aria-haspopup": "dialog",
|
|
@@ -293,27 +293,27 @@ const DestylerPopoverContentModal = vue.defineComponent({
|
|
|
293
293
|
const rootContext = injectPopoverRootContext();
|
|
294
294
|
const isRightClickOutsideRef = vue.ref(false);
|
|
295
295
|
const forwarded = composition.useForwardPropsEmits(props, emit);
|
|
296
|
-
const {
|
|
296
|
+
const { forwardRef, currentElement } = composition.useForwardExpose();
|
|
297
297
|
composition.useHideOthers(currentElement);
|
|
298
298
|
return {
|
|
299
299
|
rootContext,
|
|
300
300
|
forwarded,
|
|
301
301
|
isRightClickOutsideRef,
|
|
302
|
-
|
|
302
|
+
forwardRef
|
|
303
303
|
};
|
|
304
304
|
},
|
|
305
305
|
render() {
|
|
306
306
|
return vue.h(DestylerPopoverContentImpl, {
|
|
307
|
-
|
|
307
|
+
ref: (el) => this.forwardRef(el),
|
|
308
308
|
...vue.mergeProps(this.forwarded),
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
309
|
+
trapFocus: this.rootContext.open.value,
|
|
310
|
+
disableOutsidePointerEvents: true,
|
|
311
|
+
onCloseAutoFocusPrevent: (event) => {
|
|
312
312
|
this.$emit("closeAutoFocus", event);
|
|
313
313
|
if (!this.isRightClickOutsideRef)
|
|
314
314
|
this.rootContext.triggerElement.value?.focus();
|
|
315
315
|
},
|
|
316
|
-
|
|
316
|
+
onPointerDownOutside: (event) => {
|
|
317
317
|
this.$emit("pointerDownOutside", event);
|
|
318
318
|
const originalEvent = event.detail.originalEvent;
|
|
319
319
|
const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
|
|
@@ -458,20 +458,20 @@ const DestylerPopoverTrigger = vue.defineComponent({
|
|
|
458
458
|
props: destylerPopoverTriggerProps,
|
|
459
459
|
setup() {
|
|
460
460
|
const rootContext = injectPopoverRootContext();
|
|
461
|
-
const {
|
|
461
|
+
const { forwardRef, currentElement: triggerElement } = composition.useForwardExpose();
|
|
462
462
|
vue.onMounted(() => {
|
|
463
463
|
rootContext.triggerElement.value = triggerElement.value;
|
|
464
464
|
});
|
|
465
465
|
return {
|
|
466
466
|
rootContext,
|
|
467
|
-
|
|
467
|
+
forwardRef
|
|
468
468
|
};
|
|
469
469
|
},
|
|
470
470
|
render() {
|
|
471
471
|
return vue.h(this.rootContext.hasCustomAnchor.value ? primitive.DestylerPrimitive : popper.DestylerPopperAnchor, {
|
|
472
472
|
asChild: true
|
|
473
473
|
}, vue.h(primitive.DestylerPrimitive, {
|
|
474
|
-
"ref":
|
|
474
|
+
"ref": (el) => this.forwardRef(el),
|
|
475
475
|
"type": this.$props.as === "button" ? "button" : void 0,
|
|
476
476
|
"as": this.$props.as,
|
|
477
477
|
"aria-haspopup": "dialog",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@destyler/popover",
|
|
3
|
-
"version": "0.0.1-beta.
|
|
3
|
+
"version": "0.0.1-beta.14",
|
|
4
4
|
"description": "unstyled popover component for vue",
|
|
5
5
|
"author": "Elone Hoo <elonehoo@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -33,15 +33,15 @@
|
|
|
33
33
|
"vue": ">=3.3.4"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@destyler/composition": "0.0.1-beta.
|
|
37
|
-
"@destyler/
|
|
38
|
-
"@destyler/
|
|
39
|
-
"@destyler/
|
|
40
|
-
"@destyler/primitive": "0.0.1-beta.
|
|
41
|
-
"@destyler/
|
|
42
|
-
"@destyler/
|
|
43
|
-
"@destyler/
|
|
44
|
-
"@destyler/
|
|
36
|
+
"@destyler/composition": "0.0.1-beta.14",
|
|
37
|
+
"@destyler/focus-scope": "0.0.1-beta.14",
|
|
38
|
+
"@destyler/directives": "0.0.1-beta.14",
|
|
39
|
+
"@destyler/dismissable-layer": "0.0.1-beta.14",
|
|
40
|
+
"@destyler/primitive": "0.0.1-beta.14",
|
|
41
|
+
"@destyler/presence": "0.0.1-beta.14",
|
|
42
|
+
"@destyler/teleport": "0.0.1-beta.14",
|
|
43
|
+
"@destyler/popper": "0.0.1-beta.14",
|
|
44
|
+
"@destyler/shared": "0.0.1-beta.14"
|
|
45
45
|
},
|
|
46
46
|
"scripts": {
|
|
47
47
|
"clear": "rimraf ./dist",
|