vue-tippy 6.0.0-alpha.56 → 6.0.0-alpha.59

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,9 +1,9 @@
1
1
  /*!
2
- * vue-tippy v6.0.0-alpha.56
2
+ * vue-tippy v6.0.0-alpha.59
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,58 +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
- Object.keys(tippy.defaultProps).forEach((prop) => {
4211
- if (booleanProps.includes(prop)) {
4212
- props[prop] = {
4213
- type: prop === 'arrow' ? [String, Boolean, ...typeof Element !== 'undefined' ? [SVGElement, DocumentFragment] : [Function]] : Boolean,
4214
- default: function () {
4215
- return tippy.defaultProps[prop];
4216
- },
4217
- };
4218
- }
4219
- else {
4220
- props[prop] = {
4221
- default: function () {
4222
- return tippy.defaultProps[prop];
4223
- },
4224
- };
4225
- }
4226
- });
4227
- props['to'] = {};
4228
- props['tag'] = {
4229
- default: 'span'
4230
- };
4231
- props['contentTag'] = {
4232
- default: 'span'
4233
- };
4234
- props['contentClass'] = {
4235
- default: null
4236
- };
4237
4187
  const TippyComponent = defineComponent({
4238
- props,
4188
+ props: {
4189
+ to: {
4190
+ type: [String, Element],
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
+ },
4239
4250
  emits: ['state'],
4240
4251
  setup(props, { slots, emit, expose }) {
4241
4252
  const elem = ref();
@@ -4271,43 +4282,33 @@ const TippyComponent = defineComponent({
4271
4282
  watch(tippy.state, () => {
4272
4283
  emit('state', unref(tippy.state));
4273
4284
  }, { immediate: true, deep: true });
4274
- watch(props, () => {
4285
+ watch(() => props, () => {
4275
4286
  tippy.setProps(getOptions());
4276
4287
  if (slots.content)
4277
4288
  tippy.setContent(() => contentElem.value);
4278
4289
  });
4279
- let exposed = {
4290
+ let exposed = reactive({
4280
4291
  elem,
4281
4292
  contentElem,
4282
4293
  mounted,
4283
4294
  ...tippy
4284
- };
4295
+ });
4285
4296
  expose(exposed);
4286
4297
  return () => {
4287
- let exposedUnref = {
4288
- elem: elem.value,
4289
- contentElem: contentElem.value,
4290
- mounted: mounted.value,
4291
- ...Object.keys(tippy).reduce((acc, key) => {
4292
- //@ts-ignore
4293
- acc[key] = unref(tippy[key]);
4294
- return acc;
4295
- }, {})
4296
- };
4297
- const slot = slots.default ? slots.default(exposedUnref) : [];
4298
+ const slot = slots.default ? slots.default(exposed) : [];
4298
4299
  return h(props.tag, { ref: elem, 'data-v-tippy': '' }, slots.content ? [
4299
4300
  slot,
4300
4301
  h(props.contentTag, {
4301
4302
  ref: contentElem,
4302
4303
  style: { display: mounted.value ? 'inherit' : 'none' },
4303
4304
  class: props.contentClass
4304
- }, slots.content(exposedUnref)),
4305
+ }, slots.content(exposed)),
4305
4306
  ] : slot);
4306
4307
  };
4307
4308
  },
4308
4309
  });
4309
4310
 
4310
- const booleanProps$1 = [
4311
+ const booleanProps = [
4311
4312
  'a11y',
4312
4313
  'allowHTML',
4313
4314
  'arrow',
@@ -4323,10 +4324,10 @@ const booleanProps$1 = [
4323
4324
  'touch',
4324
4325
  'touchHold',
4325
4326
  ];
4326
- let props$1 = {};
4327
+ let props = {};
4327
4328
  Object.keys(tippy.defaultProps).forEach((prop) => {
4328
- if (booleanProps$1.includes(prop)) {
4329
- props$1[prop] = {
4329
+ if (booleanProps.includes(prop)) {
4330
+ props[prop] = {
4330
4331
  type: Boolean,
4331
4332
  default: function () {
4332
4333
  return tippy.defaultProps[prop];
@@ -4334,7 +4335,7 @@ Object.keys(tippy.defaultProps).forEach((prop) => {
4334
4335
  };
4335
4336
  }
4336
4337
  else {
4337
- props$1[prop] = {
4338
+ props[prop] = {
4338
4339
  default: function () {
4339
4340
  return tippy.defaultProps[prop];
4340
4341
  },
@@ -4342,7 +4343,7 @@ Object.keys(tippy.defaultProps).forEach((prop) => {
4342
4343
  }
4343
4344
  });
4344
4345
  const TippySingleton = defineComponent({
4345
- props: props$1,
4346
+ props,
4346
4347
  setup(props) {
4347
4348
  const instances = ref([]);
4348
4349
  const { singleton } = useSingleton(instances, props);
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * vue-tippy v6.0.0-alpha.56
2
+ * vue-tippy v6.0.0-alpha.59
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,58 +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
- Object.keys(tippy.defaultProps).forEach((prop) => {
4528
- if (booleanProps.includes(prop)) {
4529
- props[prop] = {
4530
- type: prop === 'arrow' ? [String, Boolean, ...typeof Element !== 'undefined' ? [SVGElement, DocumentFragment] : [Function]] : Boolean,
4531
- default: function () {
4532
- return tippy.defaultProps[prop];
4533
- },
4534
- };
4535
- }
4536
- else {
4537
- props[prop] = {
4538
- default: function () {
4539
- return tippy.defaultProps[prop];
4540
- },
4541
- };
4542
- }
4543
- });
4544
- props['to'] = {};
4545
- props['tag'] = {
4546
- default: 'span'
4547
- };
4548
- props['contentTag'] = {
4549
- default: 'span'
4550
- };
4551
- props['contentClass'] = {
4552
- default: null
4553
- };
4554
4504
  const TippyComponent = vue.defineComponent({
4555
- props,
4505
+ props: {
4506
+ to: {
4507
+ type: [String, Element],
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
+ },
4556
4567
  emits: ['state'],
4557
4568
  setup(props, { slots, emit, expose }) {
4558
4569
  const elem = vue.ref();
@@ -4588,43 +4599,33 @@ var VueTippy = (function (exports, vue) {
4588
4599
  vue.watch(tippy.state, () => {
4589
4600
  emit('state', vue.unref(tippy.state));
4590
4601
  }, { immediate: true, deep: true });
4591
- vue.watch(props, () => {
4602
+ vue.watch(() => props, () => {
4592
4603
  tippy.setProps(getOptions());
4593
4604
  if (slots.content)
4594
4605
  tippy.setContent(() => contentElem.value);
4595
4606
  });
4596
- let exposed = {
4607
+ let exposed = vue.reactive({
4597
4608
  elem,
4598
4609
  contentElem,
4599
4610
  mounted,
4600
4611
  ...tippy
4601
- };
4612
+ });
4602
4613
  expose(exposed);
4603
4614
  return () => {
4604
- let exposedUnref = {
4605
- elem: elem.value,
4606
- contentElem: contentElem.value,
4607
- mounted: mounted.value,
4608
- ...Object.keys(tippy).reduce((acc, key) => {
4609
- //@ts-ignore
4610
- acc[key] = vue.unref(tippy[key]);
4611
- return acc;
4612
- }, {})
4613
- };
4614
- const slot = slots.default ? slots.default(exposedUnref) : [];
4615
+ const slot = slots.default ? slots.default(exposed) : [];
4615
4616
  return vue.h(props.tag, { ref: elem, 'data-v-tippy': '' }, slots.content ? [
4616
4617
  slot,
4617
4618
  vue.h(props.contentTag, {
4618
4619
  ref: contentElem,
4619
4620
  style: { display: mounted.value ? 'inherit' : 'none' },
4620
4621
  class: props.contentClass
4621
- }, slots.content(exposedUnref)),
4622
+ }, slots.content(exposed)),
4622
4623
  ] : slot);
4623
4624
  };
4624
4625
  },
4625
4626
  });
4626
4627
 
4627
- const booleanProps$1 = [
4628
+ const booleanProps = [
4628
4629
  'a11y',
4629
4630
  'allowHTML',
4630
4631
  'arrow',
@@ -4640,10 +4641,10 @@ var VueTippy = (function (exports, vue) {
4640
4641
  'touch',
4641
4642
  'touchHold',
4642
4643
  ];
4643
- let props$1 = {};
4644
+ let props = {};
4644
4645
  Object.keys(tippy.defaultProps).forEach((prop) => {
4645
- if (booleanProps$1.includes(prop)) {
4646
- props$1[prop] = {
4646
+ if (booleanProps.includes(prop)) {
4647
+ props[prop] = {
4647
4648
  type: Boolean,
4648
4649
  default: function () {
4649
4650
  return tippy.defaultProps[prop];
@@ -4651,7 +4652,7 @@ var VueTippy = (function (exports, vue) {
4651
4652
  };
4652
4653
  }
4653
4654
  else {
4654
- props$1[prop] = {
4655
+ props[prop] = {
4655
4656
  default: function () {
4656
4657
  return tippy.defaultProps[prop];
4657
4658
  },
@@ -4659,7 +4660,7 @@ var VueTippy = (function (exports, vue) {
4659
4660
  }
4660
4661
  });
4661
4662
  const TippySingleton = vue.defineComponent({
4662
- props: props$1,
4663
+ props,
4663
4664
  setup(props) {
4664
4665
  const instances = vue.ref([]);
4665
4666
  const { singleton } = useSingleton(instances, props);