@destyler/tooltip 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 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.
@@ -464,7 +464,7 @@ const DestylerTooltipContentHoverable = vue.defineComponent({
464
464
  name: "DestylerTooltipContentHoverable",
465
465
  props: destylerTooltipContentImplProps,
466
466
  setup() {
467
- const { customElement, currentElement } = composition.useCustomElement();
467
+ const { forwardRef, currentElement } = composition.useForwardExpose();
468
468
  const { trigger, onClose } = injectTooltipRootContext();
469
469
  const providerContext = injectTooltipProviderContext();
470
470
  const pointerGraceArea = vue.ref(null);
@@ -515,12 +515,12 @@ const DestylerTooltipContentHoverable = vue.defineComponent({
515
515
  }
516
516
  });
517
517
  return {
518
- customElement
518
+ forwardRef
519
519
  };
520
520
  },
521
521
  render() {
522
522
  return vue.h(DestylerTooltipContentImpl, {
523
- ref: "customElement",
523
+ ref: (el) => this.forwardRef(el),
524
524
  ...vue.mergeProps(this.$props)
525
525
  }, {
526
526
  default: () => this.$slots.default?.()
@@ -599,7 +599,7 @@ const DestylerTooltipTrigger = vue.defineComponent({
599
599
  setup() {
600
600
  const rootContext = injectTooltipRootContext();
601
601
  const providerContext = injectTooltipProviderContext();
602
- const { customElement, currentElement: triggerElement } = composition.useCustomElement();
602
+ const { forwardRef, currentElement: triggerElement } = composition.useForwardExpose();
603
603
  const isPointerDown = vue.ref(false);
604
604
  const hasPointerMoveOpened = vue.ref(false);
605
605
  function handlePointerUp() {
@@ -615,7 +615,7 @@ const DestylerTooltipTrigger = vue.defineComponent({
615
615
  return {
616
616
  rootContext,
617
617
  providerContext,
618
- customElement,
618
+ forwardRef,
619
619
  isPointerDown,
620
620
  hasPointerMoveOpened,
621
621
  handlePointerDown
@@ -625,7 +625,7 @@ const DestylerTooltipTrigger = vue.defineComponent({
625
625
  return vue.h(popper.DestylerPopperAnchor, {
626
626
  asChild: true
627
627
  }, vue.h(primitive.DestylerPrimitive, {
628
- "ref": "customElement",
628
+ "ref": (el) => this.forwardRef(el),
629
629
  "aria-describedby": this.rootContext.open.value ? this.rootContext.contentId : void 0,
630
630
  "data-state": this.rootContext.stateAttribute.value,
631
631
  "as": this.$props.as,
@@ -1,5 +1,5 @@
1
- import { T as TooltipContext } from './shared/tooltip.9a2c60a8.cjs';
2
- export { D as DestylerTooltipArrow, a as DestylerTooltipArrowProps, b as DestylerTooltipContent, c as DestylerTooltipContentProps, d as DestylerTooltipPortal, e as DestylerTooltipPortalProps, f as DestylerTooltipProvider, g as DestylerTooltipProviderProps, h as DestylerTooltipRoot, i as DestylerTooltipRootProps, j as DestylerTooltipTrigger, k as DestylerTooltipTriggerProps } from './shared/tooltip.9a2c60a8.cjs';
1
+ import { T as TooltipContext } from './shared/tooltip.c6cf698c.cjs';
2
+ export { D as DestylerTooltipArrow, a as DestylerTooltipArrowProps, b as DestylerTooltipContent, c as DestylerTooltipContentProps, d as DestylerTooltipPortal, e as DestylerTooltipPortalProps, f as DestylerTooltipProvider, g as DestylerTooltipProviderProps, h as DestylerTooltipRoot, i as DestylerTooltipRootProps, j as DestylerTooltipTrigger, k as DestylerTooltipTriggerProps } from './shared/tooltip.c6cf698c.cjs';
3
3
  import * as vue from 'vue';
4
4
  import { PropType, Component } from 'vue';
5
5
  import * as _destyler_primitive from '@destyler/primitive';
@@ -73,7 +73,7 @@ declare const DestylerTooltipContentHoverable: vue.DefineComponent<{
73
73
  readonly required: false;
74
74
  };
75
75
  }, {
76
- customElement: vue.Ref<vue.ComponentPublicInstance | undefined>;
76
+ forwardRef: (ref: Element | vue.ComponentPublicInstance | null) => void;
77
77
  }, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
78
78
  readonly as: {
79
79
  readonly type: vue.PropType<_destyler_primitive.AsTag | vue.Component>;
@@ -1,5 +1,5 @@
1
- import { T as TooltipContext } from './shared/tooltip.9a2c60a8.mjs';
2
- export { D as DestylerTooltipArrow, a as DestylerTooltipArrowProps, b as DestylerTooltipContent, c as DestylerTooltipContentProps, d as DestylerTooltipPortal, e as DestylerTooltipPortalProps, f as DestylerTooltipProvider, g as DestylerTooltipProviderProps, h as DestylerTooltipRoot, i as DestylerTooltipRootProps, j as DestylerTooltipTrigger, k as DestylerTooltipTriggerProps } from './shared/tooltip.9a2c60a8.mjs';
1
+ import { T as TooltipContext } from './shared/tooltip.c6cf698c.mjs';
2
+ export { D as DestylerTooltipArrow, a as DestylerTooltipArrowProps, b as DestylerTooltipContent, c as DestylerTooltipContentProps, d as DestylerTooltipPortal, e as DestylerTooltipPortalProps, f as DestylerTooltipProvider, g as DestylerTooltipProviderProps, h as DestylerTooltipRoot, i as DestylerTooltipRootProps, j as DestylerTooltipTrigger, k as DestylerTooltipTriggerProps } from './shared/tooltip.c6cf698c.mjs';
3
3
  import * as vue from 'vue';
4
4
  import { PropType, Component } from 'vue';
5
5
  import * as _destyler_primitive from '@destyler/primitive';
@@ -73,7 +73,7 @@ declare const DestylerTooltipContentHoverable: vue.DefineComponent<{
73
73
  readonly required: false;
74
74
  };
75
75
  }, {
76
- customElement: vue.Ref<vue.ComponentPublicInstance | undefined>;
76
+ forwardRef: (ref: Element | vue.ComponentPublicInstance | null) => void;
77
77
  }, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
78
78
  readonly as: {
79
79
  readonly type: vue.PropType<_destyler_primitive.AsTag | vue.Component>;
@@ -1,5 +1,5 @@
1
- import { T as TooltipContext } from './shared/tooltip.9a2c60a8.js';
2
- export { D as DestylerTooltipArrow, a as DestylerTooltipArrowProps, b as DestylerTooltipContent, c as DestylerTooltipContentProps, d as DestylerTooltipPortal, e as DestylerTooltipPortalProps, f as DestylerTooltipProvider, g as DestylerTooltipProviderProps, h as DestylerTooltipRoot, i as DestylerTooltipRootProps, j as DestylerTooltipTrigger, k as DestylerTooltipTriggerProps } from './shared/tooltip.9a2c60a8.js';
1
+ import { T as TooltipContext } from './shared/tooltip.c6cf698c.js';
2
+ export { D as DestylerTooltipArrow, a as DestylerTooltipArrowProps, b as DestylerTooltipContent, c as DestylerTooltipContentProps, d as DestylerTooltipPortal, e as DestylerTooltipPortalProps, f as DestylerTooltipProvider, g as DestylerTooltipProviderProps, h as DestylerTooltipRoot, i as DestylerTooltipRootProps, j as DestylerTooltipTrigger, k as DestylerTooltipTriggerProps } from './shared/tooltip.c6cf698c.js';
3
3
  import * as vue from 'vue';
4
4
  import { PropType, Component } from 'vue';
5
5
  import * as _destyler_primitive from '@destyler/primitive';
@@ -73,7 +73,7 @@ declare const DestylerTooltipContentHoverable: vue.DefineComponent<{
73
73
  readonly required: false;
74
74
  };
75
75
  }, {
76
- customElement: vue.Ref<vue.ComponentPublicInstance | undefined>;
76
+ forwardRef: (ref: Element | vue.ComponentPublicInstance | null) => void;
77
77
  }, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
78
78
  readonly as: {
79
79
  readonly type: vue.PropType<_destyler_primitive.AsTag | vue.Component>;
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, h, mergeProps, toRefs, ref, computed, watch, useSlots, onMounted, watchEffect } from 'vue';
2
2
  import { DestylerPopperArrow, DestylerPopperRoot, DestylerPopperContent, DestylerPopperAnchor } from '@destyler/popper';
3
- import { useTimeoutFn, useVModel, useId, useCustomElement, useForwardPropsEmits } from '@destyler/composition';
3
+ import { useTimeoutFn, useVModel, useId, useForwardExpose, useForwardPropsEmits } from '@destyler/composition';
4
4
  import { createContext, isPointInPolygon } from '@destyler/shared';
5
5
  import { useEventListener } from '@vueuse/core';
6
6
  import { DestylerDismissableLayer } from '@destyler/dismissable-layer';
@@ -462,7 +462,7 @@ const DestylerTooltipContentHoverable = defineComponent({
462
462
  name: "DestylerTooltipContentHoverable",
463
463
  props: destylerTooltipContentImplProps,
464
464
  setup() {
465
- const { customElement, currentElement } = useCustomElement();
465
+ const { forwardRef, currentElement } = useForwardExpose();
466
466
  const { trigger, onClose } = injectTooltipRootContext();
467
467
  const providerContext = injectTooltipProviderContext();
468
468
  const pointerGraceArea = ref(null);
@@ -513,12 +513,12 @@ const DestylerTooltipContentHoverable = defineComponent({
513
513
  }
514
514
  });
515
515
  return {
516
- customElement
516
+ forwardRef
517
517
  };
518
518
  },
519
519
  render() {
520
520
  return h(DestylerTooltipContentImpl, {
521
- ref: "customElement",
521
+ ref: (el) => this.forwardRef(el),
522
522
  ...mergeProps(this.$props)
523
523
  }, {
524
524
  default: () => this.$slots.default?.()
@@ -597,7 +597,7 @@ const DestylerTooltipTrigger = defineComponent({
597
597
  setup() {
598
598
  const rootContext = injectTooltipRootContext();
599
599
  const providerContext = injectTooltipProviderContext();
600
- const { customElement, currentElement: triggerElement } = useCustomElement();
600
+ const { forwardRef, currentElement: triggerElement } = useForwardExpose();
601
601
  const isPointerDown = ref(false);
602
602
  const hasPointerMoveOpened = ref(false);
603
603
  function handlePointerUp() {
@@ -613,7 +613,7 @@ const DestylerTooltipTrigger = defineComponent({
613
613
  return {
614
614
  rootContext,
615
615
  providerContext,
616
- customElement,
616
+ forwardRef,
617
617
  isPointerDown,
618
618
  hasPointerMoveOpened,
619
619
  handlePointerDown
@@ -623,7 +623,7 @@ const DestylerTooltipTrigger = defineComponent({
623
623
  return h(DestylerPopperAnchor, {
624
624
  asChild: true
625
625
  }, h(DestylerPrimitive, {
626
- "ref": "customElement",
626
+ "ref": (el) => this.forwardRef(el),
627
627
  "aria-describedby": this.rootContext.open.value ? this.rootContext.contentId : void 0,
628
628
  "data-state": this.rootContext.stateAttribute.value,
629
629
  "as": this.$props.as,
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- export { D as DestylerTooltipArrow, a as DestylerTooltipArrowProps, b as DestylerTooltipContent, c as DestylerTooltipContentProps, d as DestylerTooltipPortal, e as DestylerTooltipPortalProps, f as DestylerTooltipProvider, g as DestylerTooltipProviderProps, h as DestylerTooltipRoot, i as DestylerTooltipRootProps, j as DestylerTooltipTrigger, k as DestylerTooltipTriggerProps } from './shared/tooltip.9a2c60a8.cjs';
1
+ export { D as DestylerTooltipArrow, a as DestylerTooltipArrowProps, b as DestylerTooltipContent, c as DestylerTooltipContentProps, d as DestylerTooltipPortal, e as DestylerTooltipPortalProps, f as DestylerTooltipProvider, g as DestylerTooltipProviderProps, h as DestylerTooltipRoot, i as DestylerTooltipRootProps, j as DestylerTooltipTrigger, k as DestylerTooltipTriggerProps } from './shared/tooltip.c6cf698c.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 DestylerTooltipArrow, a as DestylerTooltipArrowProps, b as DestylerTooltipContent, c as DestylerTooltipContentProps, d as DestylerTooltipPortal, e as DestylerTooltipPortalProps, f as DestylerTooltipProvider, g as DestylerTooltipProviderProps, h as DestylerTooltipRoot, i as DestylerTooltipRootProps, j as DestylerTooltipTrigger, k as DestylerTooltipTriggerProps } from './shared/tooltip.9a2c60a8.mjs';
1
+ export { D as DestylerTooltipArrow, a as DestylerTooltipArrowProps, b as DestylerTooltipContent, c as DestylerTooltipContentProps, d as DestylerTooltipPortal, e as DestylerTooltipPortalProps, f as DestylerTooltipProvider, g as DestylerTooltipProviderProps, h as DestylerTooltipRoot, i as DestylerTooltipRootProps, j as DestylerTooltipTrigger, k as DestylerTooltipTriggerProps } from './shared/tooltip.c6cf698c.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 DestylerTooltipArrow, a as DestylerTooltipArrowProps, b as DestylerTooltipContent, c as DestylerTooltipContentProps, d as DestylerTooltipPortal, e as DestylerTooltipPortalProps, f as DestylerTooltipProvider, g as DestylerTooltipProviderProps, h as DestylerTooltipRoot, i as DestylerTooltipRootProps, j as DestylerTooltipTrigger, k as DestylerTooltipTriggerProps } from './shared/tooltip.9a2c60a8.js';
1
+ export { D as DestylerTooltipArrow, a as DestylerTooltipArrowProps, b as DestylerTooltipContent, c as DestylerTooltipContentProps, d as DestylerTooltipPortal, e as DestylerTooltipPortalProps, f as DestylerTooltipProvider, g as DestylerTooltipProviderProps, h as DestylerTooltipRoot, i as DestylerTooltipRootProps, j as DestylerTooltipTrigger, k as DestylerTooltipTriggerProps } from './shared/tooltip.c6cf698c.js';
2
2
  import 'vue';
3
3
  import '@destyler/primitive';
4
4
  import '@destyler/shared';
@@ -577,7 +577,7 @@ declare const DestylerTooltipTrigger: vue.DefineComponent<{
577
577
  }, {
578
578
  rootContext: TooltipContext;
579
579
  providerContext: TooltipProviderContext;
580
- customElement: vue.Ref<vue.ComponentPublicInstance | undefined>;
580
+ forwardRef: (ref: Element | vue.ComponentPublicInstance | null) => void;
581
581
  isPointerDown: vue.Ref<boolean>;
582
582
  hasPointerMoveOpened: vue.Ref<boolean>;
583
583
  handlePointerDown: () => void;
@@ -577,7 +577,7 @@ declare const DestylerTooltipTrigger: vue.DefineComponent<{
577
577
  }, {
578
578
  rootContext: TooltipContext;
579
579
  providerContext: TooltipProviderContext;
580
- customElement: vue.Ref<vue.ComponentPublicInstance | undefined>;
580
+ forwardRef: (ref: Element | vue.ComponentPublicInstance | null) => void;
581
581
  isPointerDown: vue.Ref<boolean>;
582
582
  hasPointerMoveOpened: vue.Ref<boolean>;
583
583
  handlePointerDown: () => void;
@@ -577,7 +577,7 @@ declare const DestylerTooltipTrigger: vue.DefineComponent<{
577
577
  }, {
578
578
  rootContext: TooltipContext;
579
579
  providerContext: TooltipProviderContext;
580
- customElement: vue.Ref<vue.ComponentPublicInstance | undefined>;
580
+ forwardRef: (ref: Element | vue.ComponentPublicInstance | null) => void;
581
581
  isPointerDown: vue.Ref<boolean>;
582
582
  hasPointerMoveOpened: vue.Ref<boolean>;
583
583
  handlePointerDown: () => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@destyler/tooltip",
3
- "version": "0.0.1-beta.12",
3
+ "version": "0.0.1-beta.14",
4
4
  "description": "unstyled tooltip component for vue",
5
5
  "author": "Elone Hoo <elonehoo@gmail.com>",
6
6
  "license": "MIT",
@@ -34,13 +34,13 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "@vueuse/core": "^10.7.2",
37
- "@destyler/composition": "0.0.1-beta.12",
38
- "@destyler/dismissable-layer": "0.0.1-beta.12",
39
- "@destyler/popper": "0.0.1-beta.12",
40
- "@destyler/teleport": "0.0.1-beta.12",
41
- "@destyler/shared": "0.0.1-beta.12",
42
- "@destyler/primitive": "0.0.1-beta.12",
43
- "@destyler/visually-hidden": "0.0.1-beta.12"
37
+ "@destyler/composition": "0.0.1-beta.14",
38
+ "@destyler/shared": "0.0.1-beta.14",
39
+ "@destyler/visually-hidden": "0.0.1-beta.14",
40
+ "@destyler/popper": "0.0.1-beta.14",
41
+ "@destyler/primitive": "0.0.1-beta.14",
42
+ "@destyler/teleport": "0.0.1-beta.14",
43
+ "@destyler/dismissable-layer": "0.0.1-beta.14"
44
44
  },
45
45
  "scripts": {
46
46
  "clear": "rimraf ./dist",