ember-attacher 4.2.0 → 4.3.0

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.
@@ -2,7 +2,7 @@ import Component from '@glimmer/component';
2
2
  import { precompileTemplate } from '@ember/template-compilation';
3
3
  import { setComponentTemplate } from '@ember/component';
4
4
 
5
- var TEMPLATE = precompileTemplate("<BasicAttacher\n @id={{@id}}\n @configKey=\"popover\"\n @ariaRole={{this.ariaRole}}\n @additionalClass={{@additionalClass}}\n @animation={{@animation}}\n @arrow={{@arrow}}\n @autoUpdate={{@autoUpdate}}\n @class={{@class}}\n @explicitTarget={{@explicitTarget}}\n @flip={{@flip}}\n @floatingElementContainer={{@floatingElementContainer}}\n @floatingUiOptions={{@floatingUiOptions}}\n @hideDelay={{@hideDelay}}\n @hideDuration={{@hideDuration}}\n @hideOn={{@hideOn}}\n @interactive={{@interactive}}\n @isOffset={{@isOffset}}\n @isShown={{@isShown}}\n @lazyRender={{@lazyRender}}\n @middleware={{@middleware}}\n @onChange={{@onChange}}\n @onInitializeAttacher={{@onInitializeAttacher}}\n @onWillDestroy={{@onWillDestroy}}\n @overflowPadding={{@overflowPadding}}\n @placement={{@placement}}\n @renderInPlace={{@renderInPlace}}\n @showDelay={{@showDelay}}\n @showDuration={{@showDuration}}\n @showOn={{@showOn}}\n @style={{@style}}\n @useCapture={{@useCapture}}\n ...attributes\n as |popover|\n>{{yield popover}}</BasicAttacher>");
5
+ var TEMPLATE = precompileTemplate("<BasicAttacher\n @id={{@id}}\n @configKey=\"popover\"\n @ariaRole={{this.ariaRole}}\n @additionalClass={{@additionalClass}}\n @animation={{@animation}}\n @arrow={{@arrow}}\n @autoUpdate={{@autoUpdate}}\n @class={{@class}}\n @explicitTarget={{@explicitTarget}}\n @flip={{@flip}}\n @floatingElementContainer={{@floatingElementContainer}}\n @floatingUiOptions={{@floatingUiOptions}}\n @hideDelay={{@hideDelay}}\n @hideDuration={{@hideDuration}}\n @hideOn={{@hideOn}}\n @interactive={{@interactive}}\n @isOffset={{@isOffset}}\n @isShown={{@isShown}}\n @lazyRender={{@lazyRender}}\n @middleware={{@middleware}}\n @onChange={{@onChange}}\n @onInitializeAttacher={{@onInitializeAttacher}}\n @onWillDestroy={{@onWillDestroy}}\n @overflowPadding={{@overflowPadding}}\n @placement={{@placement}}\n @strategy={{@strategy}}\n @renderInPlace={{@renderInPlace}}\n @showDelay={{@showDelay}}\n @showDuration={{@showDuration}}\n @showOn={{@showOn}}\n @style={{@style}}\n @useCapture={{@useCapture}}\n ...attributes\n as |popover|\n>{{yield popover}}</BasicAttacher>");
6
6
 
7
7
  class AttachPopover extends Component {
8
8
  get ariaRole() {
@@ -1,15 +1,12 @@
1
- import { _ as _applyDecoratedDescriptor, g as getListenerTarget } from '../target-resolution-Bz738VeA.js';
2
1
  import Component from '@glimmer/component';
3
- import { action } from '@ember/object';
4
2
  import DEFAULTS from '../defaults.js';
5
3
  import { getOwner } from '@ember/application';
6
4
  import { precompileTemplate } from '@ember/template-compilation';
7
5
  import { setComponentTemplate } from '@ember/component';
8
6
 
9
- var TEMPLATE = precompileTemplate("<BasicAttacher\n @id={{@id}}\n @configKey=\"tooltip\"\n @ariaRole={{this.ariaRole}}\n @additionalClass={{this.additionalClass}}\n @animation={{@animation}}\n @arrow={{@arrow}}\n @autoUpdate={{@autoUpdate}}\n @class={{@class}}\n @explicitTarget={{@explicitTarget}}\n @flip={{@flip}}\n @floatingElementContainer={{@floatingElementContainer}}\n @floatingUiOptions={{@floatingUiOptions}}\n @hideDelay={{@hideDelay}}\n @hideDuration={{@hideDuration}}\n @hideOn={{@hideOn}}\n @interactive={{@interactive}}\n @isOffset={{@isOffset}}\n @isShown={{@isShown}}\n @lazyRender={{@lazyRender}}\n @middleware={{@middleware}}\n @onChange={{@onChange}}\n @onInitializeAttacher={{this.onInitializeAttacher}}\n @onWillDestroy={{this.onWillDestroy}}\n @overflowPadding={{@overflowPadding}}\n @placement={{@placement}}\n @renderInPlace={{@renderInPlace}}\n @showDelay={{@showDelay}}\n @showDuration={{@showDuration}}\n @showOn={{@showOn}}\n @style={{@style}}\n @useCapture={{@useCapture}}\n ...attributes\n as |tooltip|\n>{{yield tooltip}}</BasicAttacher>");
7
+ var TEMPLATE = precompileTemplate("<BasicAttacher\n @id={{@id}}\n @configKey=\"tooltip\"\n @ariaRole={{this.ariaRole}}\n @additionalClass={{this.additionalClass}}\n @animation={{@animation}}\n @arrow={{@arrow}}\n @autoUpdate={{@autoUpdate}}\n @class={{@class}}\n @explicitTarget={{@explicitTarget}}\n @flip={{@flip}}\n @floatingElementContainer={{@floatingElementContainer}}\n @floatingUiOptions={{@floatingUiOptions}}\n @hideDelay={{@hideDelay}}\n @hideDuration={{@hideDuration}}\n @hideOn={{@hideOn}}\n @interactive={{@interactive}}\n @isOffset={{@isOffset}}\n @isShown={{@isShown}}\n @lazyRender={{@lazyRender}}\n @middleware={{@middleware}}\n @onChange={{@onChange}}\n @onInitializeAttacher={{@onInitializeAttacher}}\n @onWillDestroy={{@onWillDestroy}}\n @overflowPadding={{@overflowPadding}}\n @placement={{@placement}}\n @strategy={{@strategy}}\n @renderInPlace={{@renderInPlace}}\n @showDelay={{@showDelay}}\n @showDuration={{@showDuration}}\n @showOn={{@showOn}}\n @style={{@style}}\n @useCapture={{@useCapture}}\n ...attributes\n as |tooltip|\n>{{yield tooltip}}</BasicAttacher>");
10
8
 
11
- var _class;
12
- let AttachTooltip = (_class = class AttachTooltip extends Component {
9
+ class AttachTooltip extends Component {
13
10
  get ariaRole() {
14
11
  return this.args.ariaRole || 'tooltip';
15
12
  }
@@ -20,21 +17,7 @@ let AttachTooltip = (_class = class AttachTooltip extends Component {
20
17
  } = getOwner(this).resolveRegistration('config:environment').emberAttacher || {};
21
18
  return tooltip?.tooltipClass ?? tooltipClass ?? DEFAULTS.tooltipClass;
22
19
  }
23
- onInitializeAttacher(currentTarget, id) {
24
- const elementTarget = getListenerTarget(currentTarget);
25
- if (!elementTarget) {
26
- return;
27
- }
28
- if (elementTarget.getAttribute('aria-describedby') != id) {
29
- const oldTarget = document.querySelector(`[aria-describedby="${id}"]`);
30
- oldTarget?.removeAttribute('aria-describedby');
31
- elementTarget.setAttribute('aria-describedby', id);
32
- }
33
- }
34
- onWillDestroy(currentTarget) {
35
- getListenerTarget(currentTarget)?.removeAttribute('aria-describedby');
36
- }
37
- }, _applyDecoratedDescriptor(_class.prototype, "onInitializeAttacher", [action], Object.getOwnPropertyDescriptor(_class.prototype, "onInitializeAttacher"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "onWillDestroy", [action], Object.getOwnPropertyDescriptor(_class.prototype, "onWillDestroy"), _class.prototype), _class);
20
+ }
38
21
  setComponentTemplate(TEMPLATE, AttachTooltip);
39
22
 
40
23
  export { AttachTooltip as default };
@@ -1 +1 @@
1
- {"version":3,"file":"attach-tooltip.js","sources":["../../src/components/attach-tooltip.js"],"sourcesContent":["import Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport DEFAULTS from '../defaults';\nimport { getOwner } from '@ember/application';\nimport { getListenerTarget } from '../lib/target-resolution.js';\n\nexport default class AttachTooltip extends Component {\n get ariaRole() {\n return this.args.ariaRole || 'tooltip';\n }\n\n get additionalClass() {\n const { tooltip, tooltipClass } = getOwner(this).resolveRegistration('config:environment').emberAttacher || {}\n\n return tooltip?.tooltipClass ?? tooltipClass ?? DEFAULTS.tooltipClass;\n }\n\n @action\n onInitializeAttacher(currentTarget, id) {\n const elementTarget = getListenerTarget(currentTarget);\n\n if (!elementTarget) {\n return;\n }\n\n if (elementTarget.getAttribute('aria-describedby') != id) {\n const oldTarget = document.querySelector(`[aria-describedby=\"${id}\"]`);\n\n oldTarget?.removeAttribute('aria-describedby');\n elementTarget.setAttribute('aria-describedby', id);\n }\n }\n\n @action\n onWillDestroy(currentTarget) {\n getListenerTarget(currentTarget)?.removeAttribute('aria-describedby');\n }\n}\n"],"names":["AttachTooltip","_class","Component","ariaRole","args","additionalClass","tooltip","tooltipClass","getOwner","resolveRegistration","emberAttacher","DEFAULTS","onInitializeAttacher","currentTarget","id","elementTarget","getListenerTarget","getAttribute","oldTarget","document","querySelector","removeAttribute","setAttribute","onWillDestroy","_applyDecoratedDescriptor","prototype","action","Object","getOwnPropertyDescriptor","setComponentTemplate","TEMPLATE"],"mappings":";;;;;;;;;;;AAIgE,IAE3CA,aAAa,IAAAC,MAAA,GAAnB,MAAMD,aAAa,SAASE,SAAS,CAAC;EACnD,IAAIC,QAAQA,GAAG;AACb,IAAA,OAAO,IAAI,CAACC,IAAI,CAACD,QAAQ,IAAI,SAAS;AACxC,EAAA;EAEA,IAAIE,eAAeA,GAAG;IACpB,MAAM;MAAEC,OAAO;AAAEC,MAAAA;AAAa,KAAC,GAAGC,QAAQ,CAAC,IAAI,CAAC,CAACC,mBAAmB,CAAC,oBAAoB,CAAC,CAACC,aAAa,IAAI,EAAE;IAE9G,OAAOJ,OAAO,EAAEC,YAAY,IAAIA,YAAY,IAAII,QAAQ,CAACJ,YAAY;AACvE,EAAA;AAGAK,EAAAA,oBAAoBA,CAACC,aAAa,EAAEC,EAAE,EAAE;AACtC,IAAA,MAAMC,aAAa,GAAGC,iBAAiB,CAACH,aAAa,CAAC;IAEtD,IAAI,CAACE,aAAa,EAAE;AAClB,MAAA;AACF,IAAA;IAEA,IAAIA,aAAa,CAACE,YAAY,CAAC,kBAAkB,CAAC,IAAIH,EAAE,EAAE;MACxD,MAAMI,SAAS,GAAGC,QAAQ,CAACC,aAAa,CAAC,CAAA,mBAAA,EAAsBN,EAAE,CAAA,EAAA,CAAI,CAAC;AAEtEI,MAAAA,SAAS,EAAEG,eAAe,CAAC,kBAAkB,CAAC;AAC9CN,MAAAA,aAAa,CAACO,YAAY,CAAC,kBAAkB,EAAER,EAAE,CAAC;AACpD,IAAA;AACF,EAAA;EAGAS,aAAaA,CAACV,aAAa,EAAE;AAC3BG,IAAAA,iBAAiB,CAACH,aAAa,CAAC,EAAEQ,eAAe,CAAC,kBAAkB,CAAC;AACvE,EAAA;AACF,CAAC,EAAAG,yBAAA,CAAAvB,MAAA,CAAAwB,SAAA,2BApBEC,MAAM,CAAA,EAAAC,MAAA,CAAAC,wBAAA,CAAA3B,MAAA,CAAAwB,SAAA,EAAA,sBAAA,CAAA,EAAAxB,MAAA,CAAAwB,SAAA,CAAA,EAAAD,yBAAA,CAAAvB,MAAA,CAAAwB,SAAA,EAAA,eAAA,EAAA,CAgBNC,MAAM,GAAAC,MAAA,CAAAC,wBAAA,CAAA3B,MAAA,CAAAwB,SAAA,EAAA,eAAA,CAAA,EAAAxB,MAAA,CAAAwB,SAAA,GAAAxB,MAAA;AA3ByB4B,oBAAA,CAAAC,QAAA,EAAb9B,aAAa,CAAA;;"}
1
+ {"version":3,"file":"attach-tooltip.js","sources":["../../src/components/attach-tooltip.js"],"sourcesContent":["import Component from '@glimmer/component';\nimport DEFAULTS from '../defaults';\nimport { getOwner } from '@ember/application';\n\nexport default class AttachTooltip extends Component {\n get ariaRole() {\n return this.args.ariaRole || 'tooltip';\n }\n\n get additionalClass() {\n const { tooltip, tooltipClass } = getOwner(this).resolveRegistration('config:environment').emberAttacher || {};\n\n return tooltip?.tooltipClass ?? tooltipClass ?? DEFAULTS.tooltipClass;\n }\n}\n"],"names":["AttachTooltip","Component","ariaRole","args","additionalClass","tooltip","tooltipClass","getOwner","resolveRegistration","emberAttacher","DEFAULTS","setComponentTemplate","TEMPLATE"],"mappings":";;;;;;;;AAIe,MAAMA,aAAa,SAASC,SAAS,CAAC;EACnD,IAAIC,QAAQA,GAAG;AACb,IAAA,OAAO,IAAI,CAACC,IAAI,CAACD,QAAQ,IAAI,SAAS;AACxC,EAAA;EAEA,IAAIE,eAAeA,GAAG;IACpB,MAAM;MAAEC,OAAO;AAAEC,MAAAA;AAAa,KAAC,GAAGC,QAAQ,CAAC,IAAI,CAAC,CAACC,mBAAmB,CAAC,oBAAoB,CAAC,CAACC,aAAa,IAAI,EAAE;IAE9G,OAAOJ,OAAO,EAAEC,YAAY,IAAIA,YAAY,IAAII,QAAQ,CAACJ,YAAY;AACvE,EAAA;AACF;AAACK,oBAAA,CAAAC,QAAA,EAVoBZ,aAAa,CAAA;;"}