@haiilo/catalyst 12.3.3 → 12.3.4

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.
@@ -12283,6 +12283,26 @@ const CatTooltip = class {
12283
12283
  if (this.trigger && !this.trigger.hasAttribute('aria-describedby')) {
12284
12284
  this.trigger.setAttribute('aria-describedby', this.id);
12285
12285
  }
12286
+ this.addListeners();
12287
+ }
12288
+ connectedCallback() {
12289
+ this.addListeners();
12290
+ }
12291
+ componentWillRender() {
12292
+ this.inactive = this.disabled || (!this.content && !this.hostElement.querySelector('[slot="content"]'));
12293
+ }
12294
+ disconnectedCallback() {
12295
+ this.removeListeners();
12296
+ }
12297
+ render() {
12298
+ return (index.h(index.Host, { key: '57a9ac430370343a6c3d380c0dff2ad5cbe1570a' }, index.h("slot", { key: '1343be0a1563d7c70d5cf43db775be22bb50e93c' }), index.h("div", { key: 'f91d3091272e218e352eb8313614c39540b41973', ref: el => (this.tooltip = el), id: this.id, role: "tooltip", "aria-hidden": !this.open, "aria-live": this.open ? 'polite' : 'off', class: {
12299
+ tooltip: true,
12300
+ 'tooltip-hidden': this.inactive,
12301
+ 'tooltip-round': this.round,
12302
+ [`tooltip-${this.size}`]: Boolean(this.size)
12303
+ } }, index.h("slot", { key: '8410c56713fa2182bde55ed6053667fc2bbf5e33', name: "content" }, index.h("p", { key: '894c80f4b0a2831ca5f21cd2063ab9fe4d15df53' }, this.content)))));
12304
+ }
12305
+ addListeners() {
12286
12306
  if (isTouchDevice) {
12287
12307
  window.addEventListener('touchstart', this.boundWindowTouchStartListener);
12288
12308
  this.trigger?.addEventListener('touchstart', this.boundTouchStartListener);
@@ -12295,10 +12315,7 @@ const CatTooltip = class {
12295
12315
  this.trigger?.addEventListener('mouseleave', this.boundHideListener);
12296
12316
  }
12297
12317
  }
12298
- componentWillRender() {
12299
- this.inactive = this.disabled || (!this.content && !this.hostElement.querySelector('[slot="content"]'));
12300
- }
12301
- disconnectedCallback() {
12318
+ removeListeners() {
12302
12319
  if (isTouchDevice) {
12303
12320
  window.removeEventListener('touchstart', this.boundWindowTouchStartListener);
12304
12321
  this.trigger?.removeEventListener('touchstart', this.boundTouchStartListener);
@@ -12311,14 +12328,6 @@ const CatTooltip = class {
12311
12328
  this.trigger?.removeEventListener('focusout', this.boundHideListener);
12312
12329
  }
12313
12330
  }
12314
- render() {
12315
- return (index.h(index.Host, { key: 'a4d508bd463b29935745236c388f31b4bc01516f' }, index.h("slot", { key: 'b1992e73fa0e53b58493b8253c10823d562dac05' }), index.h("div", { key: 'd33515016f4d31548d9628f23d778acde69be531', ref: el => (this.tooltip = el), id: this.id, role: "tooltip", "aria-hidden": !this.open, "aria-live": this.open ? 'polite' : 'off', class: {
12316
- tooltip: true,
12317
- 'tooltip-hidden': this.inactive,
12318
- 'tooltip-round': this.round,
12319
- [`tooltip-${this.size}`]: Boolean(this.size)
12320
- } }, index.h("slot", { key: '58c5455be822bf8bc9476c2e5086e0299805791f', name: "content" }, index.h("p", { key: '56d35f4ec8846ad8928c72a269fd5ed19bf087e1' }, this.content)))));
12321
- }
12322
12331
  async update() {
12323
12332
  if (this.trigger && this.tooltip) {
12324
12333
  await computePosition(this.trigger, this.tooltip, {