vue-tippy 6.0.0-alpha.58 → 6.0.0-alpha.60

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * vue-tippy v6.0.0-alpha.58
2
+ * vue-tippy v6.0.0-alpha.60
3
3
  * (c) 2022
4
4
  * @license MIT
5
5
  */
@@ -4470,7 +4470,7 @@ function useTippyComponent(opts = {}, children) {
4470
4470
  instance,
4471
4471
  TippyComponent: vue.h(TippyComponent, {
4472
4472
  ...opts,
4473
- onVnodeMounted: vnode => {
4473
+ onVnodeMounted: (vnode) => {
4474
4474
  //@ts-ignore
4475
4475
  instance.value = vnode.component.ctx;
4476
4476
  },
@@ -4504,66 +4504,69 @@ function useSingleton(instances, optionalProps) {
4504
4504
  };
4505
4505
  }
4506
4506
 
4507
- // const pluginProps = [
4508
- // 'animateFill',
4509
- // 'followCursor',
4510
- // 'inlinePositioning',
4511
- // 'sticky',
4512
- // ]
4513
- const booleanProps = [
4514
- 'a11y',
4515
- 'allowHTML',
4516
- 'arrow',
4517
- 'flip',
4518
- 'flipOnUpdate',
4519
- 'hideOnClick',
4520
- 'ignoreAttributes',
4521
- 'inertia',
4522
- 'interactive',
4523
- 'lazy',
4524
- 'multiple',
4525
- 'showOnInit',
4526
- 'touch',
4527
- 'touchHold',
4528
- ];
4529
- let props = {};
4530
- props['hideOnClick'] = {
4531
- type: [String, Boolean],
4532
- default: tippy.defaultProps.hideOnClick,
4533
- };
4534
- props['to'] = {};
4535
- props['tag'] = {
4536
- default: 'span'
4537
- };
4538
- props['contentTag'] = {
4539
- default: 'span'
4540
- };
4541
- props['contentClass'] = {
4542
- default: null
4543
- };
4544
- Object.keys(tippy.defaultProps).forEach((prop) => {
4545
- if (props[prop]) {
4546
- return;
4547
- }
4548
- if (booleanProps.includes(prop)) {
4549
- props[prop] = {
4550
- // TODO: add SVGElement and DocumentFragment for arrow prop
4551
- type: prop === 'arrow' ? [String, Boolean, Function] : Boolean,
4552
- default: function () {
4553
- return tippy.defaultProps[prop];
4554
- },
4555
- };
4556
- }
4557
- else {
4558
- props[prop] = {
4559
- default: function () {
4560
- return tippy.defaultProps[prop];
4561
- },
4562
- };
4563
- }
4564
- });
4565
4507
  const TippyComponent = vue.defineComponent({
4566
- props,
4508
+ props: {
4509
+ to: {
4510
+ type: [String, Function],
4511
+ },
4512
+ tag: {
4513
+ type: String,
4514
+ default: 'span'
4515
+ },
4516
+ contentTag: {
4517
+ type: String,
4518
+ default: 'span'
4519
+ },
4520
+ contentClass: {
4521
+ type: String,
4522
+ default: null
4523
+ },
4524
+ appendTo: { default: () => tippy.defaultProps['appendTo'] },
4525
+ aria: { default: () => tippy.defaultProps['aria'] },
4526
+ delay: { default: () => tippy.defaultProps['delay'] },
4527
+ duration: { default: () => tippy.defaultProps['duration'] },
4528
+ getReferenceClientRect: { default: () => tippy.defaultProps['getReferenceClientRect'] },
4529
+ hideOnClick: { default: () => tippy.defaultProps['hideOnClick'] },
4530
+ ignoreAttributes: { default: () => tippy.defaultProps['ignoreAttributes'] },
4531
+ interactive: { default: () => tippy.defaultProps['interactive'] },
4532
+ interactiveBorder: { default: () => tippy.defaultProps['interactiveBorder'] },
4533
+ interactiveDebounce: { default: () => tippy.defaultProps['interactiveDebounce'] },
4534
+ moveTransition: { default: () => tippy.defaultProps['moveTransition'] },
4535
+ offset: { default: () => tippy.defaultProps['offset'] },
4536
+ onAfterUpdate: { default: () => tippy.defaultProps['onAfterUpdate'] },
4537
+ onBeforeUpdate: { default: () => tippy.defaultProps['onBeforeUpdate'] },
4538
+ onCreate: { default: () => tippy.defaultProps['onCreate'] },
4539
+ onDestroy: { default: () => tippy.defaultProps['onDestroy'] },
4540
+ onHidden: { default: () => tippy.defaultProps['onHidden'] },
4541
+ onHide: { default: () => tippy.defaultProps['onHide'] },
4542
+ onMount: { default: () => tippy.defaultProps['onMount'] },
4543
+ onShow: { default: () => tippy.defaultProps['onShow'] },
4544
+ onShown: { default: () => tippy.defaultProps['onShown'] },
4545
+ onTrigger: { default: () => tippy.defaultProps['onTrigger'] },
4546
+ onUntrigger: { default: () => tippy.defaultProps['onUntrigger'] },
4547
+ onClickOutside: { default: () => tippy.defaultProps['onClickOutside'] },
4548
+ placement: { default: () => tippy.defaultProps['placement'] },
4549
+ plugins: { default: () => tippy.defaultProps['plugins'] },
4550
+ popperOptions: { default: () => tippy.defaultProps['popperOptions'] },
4551
+ render: { default: () => tippy.defaultProps['render'] },
4552
+ showOnCreate: { default: () => tippy.defaultProps['showOnCreate'] },
4553
+ touch: { default: () => tippy.defaultProps['touch'] },
4554
+ trigger: { default: () => tippy.defaultProps['trigger'] },
4555
+ triggerTarget: { default: () => tippy.defaultProps['triggerTarget'] },
4556
+ animateFill: { default: () => tippy.defaultProps['animateFill'] },
4557
+ followCursor: { default: () => tippy.defaultProps['followCursor'] },
4558
+ inlinePositioning: { default: () => tippy.defaultProps['inlinePositioning'] },
4559
+ sticky: { default: () => tippy.defaultProps['sticky'] },
4560
+ allowHTML: { default: () => tippy.defaultProps['allowHTML'] },
4561
+ animation: { default: () => tippy.defaultProps['animation'] },
4562
+ arrow: { default: () => tippy.defaultProps['arrow'] },
4563
+ content: { default: () => tippy.defaultProps['content'] },
4564
+ inertia: { default: () => tippy.defaultProps['inertia'] },
4565
+ maxWidth: { default: () => tippy.defaultProps['maxWidth'] },
4566
+ role: { default: () => tippy.defaultProps['role'] },
4567
+ theme: { default: () => tippy.defaultProps['theme'] },
4568
+ zIndex: { default: () => tippy.defaultProps['zIndex'] }
4569
+ },
4567
4570
  emits: ['state'],
4568
4571
  setup(props, { slots, emit, expose }) {
4569
4572
  const elem = vue.ref();
@@ -4604,38 +4607,28 @@ const TippyComponent = vue.defineComponent({
4604
4607
  if (slots.content)
4605
4608
  tippy.setContent(() => contentElem.value);
4606
4609
  });
4607
- let exposed = {
4610
+ let exposed = vue.reactive({
4608
4611
  elem,
4609
4612
  contentElem,
4610
4613
  mounted,
4611
4614
  ...tippy
4612
- };
4615
+ });
4613
4616
  expose(exposed);
4614
4617
  return () => {
4615
- let exposedUnref = {
4616
- elem: elem.value,
4617
- contentElem: contentElem.value,
4618
- mounted: mounted.value,
4619
- ...Object.keys(tippy).reduce((acc, key) => {
4620
- //@ts-ignore
4621
- acc[key] = vue.unref(tippy[key]);
4622
- return acc;
4623
- }, {})
4624
- };
4625
- const slot = slots.default ? slots.default(exposedUnref) : [];
4618
+ const slot = slots.default ? slots.default(exposed) : [];
4626
4619
  return vue.h(props.tag, { ref: elem, 'data-v-tippy': '' }, slots.content ? [
4627
4620
  slot,
4628
4621
  vue.h(props.contentTag, {
4629
4622
  ref: contentElem,
4630
4623
  style: { display: mounted.value ? 'inherit' : 'none' },
4631
4624
  class: props.contentClass
4632
- }, slots.content(exposedUnref)),
4625
+ }, slots.content(exposed)),
4633
4626
  ] : slot);
4634
4627
  };
4635
4628
  },
4636
4629
  });
4637
4630
 
4638
- const booleanProps$1 = [
4631
+ const booleanProps = [
4639
4632
  'a11y',
4640
4633
  'allowHTML',
4641
4634
  'arrow',
@@ -4651,10 +4644,10 @@ const booleanProps$1 = [
4651
4644
  'touch',
4652
4645
  'touchHold',
4653
4646
  ];
4654
- let props$1 = {};
4647
+ let props = {};
4655
4648
  Object.keys(tippy.defaultProps).forEach((prop) => {
4656
- if (booleanProps$1.includes(prop)) {
4657
- props$1[prop] = {
4649
+ if (booleanProps.includes(prop)) {
4650
+ props[prop] = {
4658
4651
  type: Boolean,
4659
4652
  default: function () {
4660
4653
  return tippy.defaultProps[prop];
@@ -4662,7 +4655,7 @@ Object.keys(tippy.defaultProps).forEach((prop) => {
4662
4655
  };
4663
4656
  }
4664
4657
  else {
4665
- props$1[prop] = {
4658
+ props[prop] = {
4666
4659
  default: function () {
4667
4660
  return tippy.defaultProps[prop];
4668
4661
  },
@@ -4670,7 +4663,7 @@ Object.keys(tippy.defaultProps).forEach((prop) => {
4670
4663
  }
4671
4664
  });
4672
4665
  const TippySingleton = vue.defineComponent({
4673
- props: props$1,
4666
+ props,
4674
4667
  setup(props) {
4675
4668
  const instances = vue.ref([]);
4676
4669
  const { singleton } = useSingleton(instances, props);