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

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.
@@ -1,9 +1,9 @@
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
  */
6
- import { getCurrentInstance, ref, onMounted, onUnmounted, isRef, isReactive, watch, isVNode, render as render$1, h, defineComponent, nextTick, unref } from 'vue';
6
+ import { getCurrentInstance, ref, onMounted, onUnmounted, isRef, isReactive, watch, isVNode, render as render$1, h, defineComponent, nextTick, unref, reactive } from 'vue';
7
7
 
8
8
  var top = 'top';
9
9
  var bottom = 'bottom';
@@ -4150,7 +4150,7 @@ function useTippyComponent(opts = {}, children) {
4150
4150
  instance,
4151
4151
  TippyComponent: h(TippyComponent, {
4152
4152
  ...opts,
4153
- onVnodeMounted: vnode => {
4153
+ onVnodeMounted: (vnode) => {
4154
4154
  //@ts-ignore
4155
4155
  instance.value = vnode.component.ctx;
4156
4156
  },
@@ -4184,66 +4184,69 @@ function useSingleton(instances, optionalProps) {
4184
4184
  };
4185
4185
  }
4186
4186
 
4187
- // const pluginProps = [
4188
- // 'animateFill',
4189
- // 'followCursor',
4190
- // 'inlinePositioning',
4191
- // 'sticky',
4192
- // ]
4193
- const booleanProps = [
4194
- 'a11y',
4195
- 'allowHTML',
4196
- 'arrow',
4197
- 'flip',
4198
- 'flipOnUpdate',
4199
- 'hideOnClick',
4200
- 'ignoreAttributes',
4201
- 'inertia',
4202
- 'interactive',
4203
- 'lazy',
4204
- 'multiple',
4205
- 'showOnInit',
4206
- 'touch',
4207
- 'touchHold',
4208
- ];
4209
- let props = {};
4210
- props['hideOnClick'] = {
4211
- type: [String, Boolean],
4212
- default: tippy.defaultProps.hideOnClick,
4213
- };
4214
- props['to'] = {};
4215
- props['tag'] = {
4216
- default: 'span'
4217
- };
4218
- props['contentTag'] = {
4219
- default: 'span'
4220
- };
4221
- props['contentClass'] = {
4222
- default: null
4223
- };
4224
- Object.keys(tippy.defaultProps).forEach((prop) => {
4225
- if (props[prop]) {
4226
- return;
4227
- }
4228
- if (booleanProps.includes(prop)) {
4229
- props[prop] = {
4230
- // TODO: add SVGElement and DocumentFragment for arrow prop
4231
- type: prop === 'arrow' ? [String, Boolean, Function] : Boolean,
4232
- default: function () {
4233
- return tippy.defaultProps[prop];
4234
- },
4235
- };
4236
- }
4237
- else {
4238
- props[prop] = {
4239
- default: function () {
4240
- return tippy.defaultProps[prop];
4241
- },
4242
- };
4243
- }
4244
- });
4245
4187
  const TippyComponent = defineComponent({
4246
- props,
4188
+ props: {
4189
+ to: {
4190
+ type: [String, Function],
4191
+ },
4192
+ tag: {
4193
+ type: String,
4194
+ default: 'span'
4195
+ },
4196
+ contentTag: {
4197
+ type: String,
4198
+ default: 'span'
4199
+ },
4200
+ contentClass: {
4201
+ type: String,
4202
+ default: null
4203
+ },
4204
+ appendTo: { default: () => tippy.defaultProps['appendTo'] },
4205
+ aria: { default: () => tippy.defaultProps['aria'] },
4206
+ delay: { default: () => tippy.defaultProps['delay'] },
4207
+ duration: { default: () => tippy.defaultProps['duration'] },
4208
+ getReferenceClientRect: { default: () => tippy.defaultProps['getReferenceClientRect'] },
4209
+ hideOnClick: { default: () => tippy.defaultProps['hideOnClick'] },
4210
+ ignoreAttributes: { default: () => tippy.defaultProps['ignoreAttributes'] },
4211
+ interactive: { default: () => tippy.defaultProps['interactive'] },
4212
+ interactiveBorder: { default: () => tippy.defaultProps['interactiveBorder'] },
4213
+ interactiveDebounce: { default: () => tippy.defaultProps['interactiveDebounce'] },
4214
+ moveTransition: { default: () => tippy.defaultProps['moveTransition'] },
4215
+ offset: { default: () => tippy.defaultProps['offset'] },
4216
+ onAfterUpdate: { default: () => tippy.defaultProps['onAfterUpdate'] },
4217
+ onBeforeUpdate: { default: () => tippy.defaultProps['onBeforeUpdate'] },
4218
+ onCreate: { default: () => tippy.defaultProps['onCreate'] },
4219
+ onDestroy: { default: () => tippy.defaultProps['onDestroy'] },
4220
+ onHidden: { default: () => tippy.defaultProps['onHidden'] },
4221
+ onHide: { default: () => tippy.defaultProps['onHide'] },
4222
+ onMount: { default: () => tippy.defaultProps['onMount'] },
4223
+ onShow: { default: () => tippy.defaultProps['onShow'] },
4224
+ onShown: { default: () => tippy.defaultProps['onShown'] },
4225
+ onTrigger: { default: () => tippy.defaultProps['onTrigger'] },
4226
+ onUntrigger: { default: () => tippy.defaultProps['onUntrigger'] },
4227
+ onClickOutside: { default: () => tippy.defaultProps['onClickOutside'] },
4228
+ placement: { default: () => tippy.defaultProps['placement'] },
4229
+ plugins: { default: () => tippy.defaultProps['plugins'] },
4230
+ popperOptions: { default: () => tippy.defaultProps['popperOptions'] },
4231
+ render: { default: () => tippy.defaultProps['render'] },
4232
+ showOnCreate: { default: () => tippy.defaultProps['showOnCreate'] },
4233
+ touch: { default: () => tippy.defaultProps['touch'] },
4234
+ trigger: { default: () => tippy.defaultProps['trigger'] },
4235
+ triggerTarget: { default: () => tippy.defaultProps['triggerTarget'] },
4236
+ animateFill: { default: () => tippy.defaultProps['animateFill'] },
4237
+ followCursor: { default: () => tippy.defaultProps['followCursor'] },
4238
+ inlinePositioning: { default: () => tippy.defaultProps['inlinePositioning'] },
4239
+ sticky: { default: () => tippy.defaultProps['sticky'] },
4240
+ allowHTML: { default: () => tippy.defaultProps['allowHTML'] },
4241
+ animation: { default: () => tippy.defaultProps['animation'] },
4242
+ arrow: { default: () => tippy.defaultProps['arrow'] },
4243
+ content: { default: () => tippy.defaultProps['content'] },
4244
+ inertia: { default: () => tippy.defaultProps['inertia'] },
4245
+ maxWidth: { default: () => tippy.defaultProps['maxWidth'] },
4246
+ role: { default: () => tippy.defaultProps['role'] },
4247
+ theme: { default: () => tippy.defaultProps['theme'] },
4248
+ zIndex: { default: () => tippy.defaultProps['zIndex'] }
4249
+ },
4247
4250
  emits: ['state'],
4248
4251
  setup(props, { slots, emit, expose }) {
4249
4252
  const elem = ref();
@@ -4284,38 +4287,28 @@ const TippyComponent = defineComponent({
4284
4287
  if (slots.content)
4285
4288
  tippy.setContent(() => contentElem.value);
4286
4289
  });
4287
- let exposed = {
4290
+ let exposed = reactive({
4288
4291
  elem,
4289
4292
  contentElem,
4290
4293
  mounted,
4291
4294
  ...tippy
4292
- };
4295
+ });
4293
4296
  expose(exposed);
4294
4297
  return () => {
4295
- let exposedUnref = {
4296
- elem: elem.value,
4297
- contentElem: contentElem.value,
4298
- mounted: mounted.value,
4299
- ...Object.keys(tippy).reduce((acc, key) => {
4300
- //@ts-ignore
4301
- acc[key] = unref(tippy[key]);
4302
- return acc;
4303
- }, {})
4304
- };
4305
- const slot = slots.default ? slots.default(exposedUnref) : [];
4298
+ const slot = slots.default ? slots.default(exposed) : [];
4306
4299
  return h(props.tag, { ref: elem, 'data-v-tippy': '' }, slots.content ? [
4307
4300
  slot,
4308
4301
  h(props.contentTag, {
4309
4302
  ref: contentElem,
4310
4303
  style: { display: mounted.value ? 'inherit' : 'none' },
4311
4304
  class: props.contentClass
4312
- }, slots.content(exposedUnref)),
4305
+ }, slots.content(exposed)),
4313
4306
  ] : slot);
4314
4307
  };
4315
4308
  },
4316
4309
  });
4317
4310
 
4318
- const booleanProps$1 = [
4311
+ const booleanProps = [
4319
4312
  'a11y',
4320
4313
  'allowHTML',
4321
4314
  'arrow',
@@ -4331,10 +4324,10 @@ const booleanProps$1 = [
4331
4324
  'touch',
4332
4325
  'touchHold',
4333
4326
  ];
4334
- let props$1 = {};
4327
+ let props = {};
4335
4328
  Object.keys(tippy.defaultProps).forEach((prop) => {
4336
- if (booleanProps$1.includes(prop)) {
4337
- props$1[prop] = {
4329
+ if (booleanProps.includes(prop)) {
4330
+ props[prop] = {
4338
4331
  type: Boolean,
4339
4332
  default: function () {
4340
4333
  return tippy.defaultProps[prop];
@@ -4342,7 +4335,7 @@ Object.keys(tippy.defaultProps).forEach((prop) => {
4342
4335
  };
4343
4336
  }
4344
4337
  else {
4345
- props$1[prop] = {
4338
+ props[prop] = {
4346
4339
  default: function () {
4347
4340
  return tippy.defaultProps[prop];
4348
4341
  },
@@ -4350,7 +4343,7 @@ Object.keys(tippy.defaultProps).forEach((prop) => {
4350
4343
  }
4351
4344
  });
4352
4345
  const TippySingleton = defineComponent({
4353
- props: props$1,
4346
+ props,
4354
4347
  setup(props) {
4355
4348
  const instances = ref([]);
4356
4349
  const { singleton } = useSingleton(instances, props);
@@ -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
  */
@@ -4467,7 +4467,7 @@ var VueTippy = (function (exports, vue) {
4467
4467
  instance,
4468
4468
  TippyComponent: vue.h(TippyComponent, {
4469
4469
  ...opts,
4470
- onVnodeMounted: vnode => {
4470
+ onVnodeMounted: (vnode) => {
4471
4471
  //@ts-ignore
4472
4472
  instance.value = vnode.component.ctx;
4473
4473
  },
@@ -4501,66 +4501,69 @@ var VueTippy = (function (exports, vue) {
4501
4501
  };
4502
4502
  }
4503
4503
 
4504
- // const pluginProps = [
4505
- // 'animateFill',
4506
- // 'followCursor',
4507
- // 'inlinePositioning',
4508
- // 'sticky',
4509
- // ]
4510
- const booleanProps = [
4511
- 'a11y',
4512
- 'allowHTML',
4513
- 'arrow',
4514
- 'flip',
4515
- 'flipOnUpdate',
4516
- 'hideOnClick',
4517
- 'ignoreAttributes',
4518
- 'inertia',
4519
- 'interactive',
4520
- 'lazy',
4521
- 'multiple',
4522
- 'showOnInit',
4523
- 'touch',
4524
- 'touchHold',
4525
- ];
4526
- let props = {};
4527
- props['hideOnClick'] = {
4528
- type: [String, Boolean],
4529
- default: tippy.defaultProps.hideOnClick,
4530
- };
4531
- props['to'] = {};
4532
- props['tag'] = {
4533
- default: 'span'
4534
- };
4535
- props['contentTag'] = {
4536
- default: 'span'
4537
- };
4538
- props['contentClass'] = {
4539
- default: null
4540
- };
4541
- Object.keys(tippy.defaultProps).forEach((prop) => {
4542
- if (props[prop]) {
4543
- return;
4544
- }
4545
- if (booleanProps.includes(prop)) {
4546
- props[prop] = {
4547
- // TODO: add SVGElement and DocumentFragment for arrow prop
4548
- type: prop === 'arrow' ? [String, Boolean, Function] : Boolean,
4549
- default: function () {
4550
- return tippy.defaultProps[prop];
4551
- },
4552
- };
4553
- }
4554
- else {
4555
- props[prop] = {
4556
- default: function () {
4557
- return tippy.defaultProps[prop];
4558
- },
4559
- };
4560
- }
4561
- });
4562
4504
  const TippyComponent = vue.defineComponent({
4563
- props,
4505
+ props: {
4506
+ to: {
4507
+ type: [String, Function],
4508
+ },
4509
+ tag: {
4510
+ type: String,
4511
+ default: 'span'
4512
+ },
4513
+ contentTag: {
4514
+ type: String,
4515
+ default: 'span'
4516
+ },
4517
+ contentClass: {
4518
+ type: String,
4519
+ default: null
4520
+ },
4521
+ appendTo: { default: () => tippy.defaultProps['appendTo'] },
4522
+ aria: { default: () => tippy.defaultProps['aria'] },
4523
+ delay: { default: () => tippy.defaultProps['delay'] },
4524
+ duration: { default: () => tippy.defaultProps['duration'] },
4525
+ getReferenceClientRect: { default: () => tippy.defaultProps['getReferenceClientRect'] },
4526
+ hideOnClick: { default: () => tippy.defaultProps['hideOnClick'] },
4527
+ ignoreAttributes: { default: () => tippy.defaultProps['ignoreAttributes'] },
4528
+ interactive: { default: () => tippy.defaultProps['interactive'] },
4529
+ interactiveBorder: { default: () => tippy.defaultProps['interactiveBorder'] },
4530
+ interactiveDebounce: { default: () => tippy.defaultProps['interactiveDebounce'] },
4531
+ moveTransition: { default: () => tippy.defaultProps['moveTransition'] },
4532
+ offset: { default: () => tippy.defaultProps['offset'] },
4533
+ onAfterUpdate: { default: () => tippy.defaultProps['onAfterUpdate'] },
4534
+ onBeforeUpdate: { default: () => tippy.defaultProps['onBeforeUpdate'] },
4535
+ onCreate: { default: () => tippy.defaultProps['onCreate'] },
4536
+ onDestroy: { default: () => tippy.defaultProps['onDestroy'] },
4537
+ onHidden: { default: () => tippy.defaultProps['onHidden'] },
4538
+ onHide: { default: () => tippy.defaultProps['onHide'] },
4539
+ onMount: { default: () => tippy.defaultProps['onMount'] },
4540
+ onShow: { default: () => tippy.defaultProps['onShow'] },
4541
+ onShown: { default: () => tippy.defaultProps['onShown'] },
4542
+ onTrigger: { default: () => tippy.defaultProps['onTrigger'] },
4543
+ onUntrigger: { default: () => tippy.defaultProps['onUntrigger'] },
4544
+ onClickOutside: { default: () => tippy.defaultProps['onClickOutside'] },
4545
+ placement: { default: () => tippy.defaultProps['placement'] },
4546
+ plugins: { default: () => tippy.defaultProps['plugins'] },
4547
+ popperOptions: { default: () => tippy.defaultProps['popperOptions'] },
4548
+ render: { default: () => tippy.defaultProps['render'] },
4549
+ showOnCreate: { default: () => tippy.defaultProps['showOnCreate'] },
4550
+ touch: { default: () => tippy.defaultProps['touch'] },
4551
+ trigger: { default: () => tippy.defaultProps['trigger'] },
4552
+ triggerTarget: { default: () => tippy.defaultProps['triggerTarget'] },
4553
+ animateFill: { default: () => tippy.defaultProps['animateFill'] },
4554
+ followCursor: { default: () => tippy.defaultProps['followCursor'] },
4555
+ inlinePositioning: { default: () => tippy.defaultProps['inlinePositioning'] },
4556
+ sticky: { default: () => tippy.defaultProps['sticky'] },
4557
+ allowHTML: { default: () => tippy.defaultProps['allowHTML'] },
4558
+ animation: { default: () => tippy.defaultProps['animation'] },
4559
+ arrow: { default: () => tippy.defaultProps['arrow'] },
4560
+ content: { default: () => tippy.defaultProps['content'] },
4561
+ inertia: { default: () => tippy.defaultProps['inertia'] },
4562
+ maxWidth: { default: () => tippy.defaultProps['maxWidth'] },
4563
+ role: { default: () => tippy.defaultProps['role'] },
4564
+ theme: { default: () => tippy.defaultProps['theme'] },
4565
+ zIndex: { default: () => tippy.defaultProps['zIndex'] }
4566
+ },
4564
4567
  emits: ['state'],
4565
4568
  setup(props, { slots, emit, expose }) {
4566
4569
  const elem = vue.ref();
@@ -4601,38 +4604,28 @@ var VueTippy = (function (exports, vue) {
4601
4604
  if (slots.content)
4602
4605
  tippy.setContent(() => contentElem.value);
4603
4606
  });
4604
- let exposed = {
4607
+ let exposed = vue.reactive({
4605
4608
  elem,
4606
4609
  contentElem,
4607
4610
  mounted,
4608
4611
  ...tippy
4609
- };
4612
+ });
4610
4613
  expose(exposed);
4611
4614
  return () => {
4612
- let exposedUnref = {
4613
- elem: elem.value,
4614
- contentElem: contentElem.value,
4615
- mounted: mounted.value,
4616
- ...Object.keys(tippy).reduce((acc, key) => {
4617
- //@ts-ignore
4618
- acc[key] = vue.unref(tippy[key]);
4619
- return acc;
4620
- }, {})
4621
- };
4622
- const slot = slots.default ? slots.default(exposedUnref) : [];
4615
+ const slot = slots.default ? slots.default(exposed) : [];
4623
4616
  return vue.h(props.tag, { ref: elem, 'data-v-tippy': '' }, slots.content ? [
4624
4617
  slot,
4625
4618
  vue.h(props.contentTag, {
4626
4619
  ref: contentElem,
4627
4620
  style: { display: mounted.value ? 'inherit' : 'none' },
4628
4621
  class: props.contentClass
4629
- }, slots.content(exposedUnref)),
4622
+ }, slots.content(exposed)),
4630
4623
  ] : slot);
4631
4624
  };
4632
4625
  },
4633
4626
  });
4634
4627
 
4635
- const booleanProps$1 = [
4628
+ const booleanProps = [
4636
4629
  'a11y',
4637
4630
  'allowHTML',
4638
4631
  'arrow',
@@ -4648,10 +4641,10 @@ var VueTippy = (function (exports, vue) {
4648
4641
  'touch',
4649
4642
  'touchHold',
4650
4643
  ];
4651
- let props$1 = {};
4644
+ let props = {};
4652
4645
  Object.keys(tippy.defaultProps).forEach((prop) => {
4653
- if (booleanProps$1.includes(prop)) {
4654
- props$1[prop] = {
4646
+ if (booleanProps.includes(prop)) {
4647
+ props[prop] = {
4655
4648
  type: Boolean,
4656
4649
  default: function () {
4657
4650
  return tippy.defaultProps[prop];
@@ -4659,7 +4652,7 @@ var VueTippy = (function (exports, vue) {
4659
4652
  };
4660
4653
  }
4661
4654
  else {
4662
- props$1[prop] = {
4655
+ props[prop] = {
4663
4656
  default: function () {
4664
4657
  return tippy.defaultProps[prop];
4665
4658
  },
@@ -4667,7 +4660,7 @@ var VueTippy = (function (exports, vue) {
4667
4660
  }
4668
4661
  });
4669
4662
  const TippySingleton = vue.defineComponent({
4670
- props: props$1,
4663
+ props,
4671
4664
  setup(props) {
4672
4665
  const instances = vue.ref([]);
4673
4666
  const { singleton } = useSingleton(instances, props);