@spectrum-web-components/reactive-controllers 0.39.3 → 0.39.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.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spectrum-web-components/reactive-controllers",
|
|
3
|
-
"version": "0.39.
|
|
3
|
+
"version": "0.39.4",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -79,5 +79,5 @@
|
|
|
79
79
|
"sideEffects": [
|
|
80
80
|
"./**/*.dev.js"
|
|
81
81
|
],
|
|
82
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "f745c90e8e9ea85ff10be025e058b14cc925ec9f"
|
|
83
83
|
}
|
|
@@ -9,6 +9,8 @@ export declare class ElementResolutionController implements ReactiveController {
|
|
|
9
9
|
get selector(): string;
|
|
10
10
|
set selector(selector: string);
|
|
11
11
|
private _selector;
|
|
12
|
+
get selectorAsId(): string;
|
|
13
|
+
get selectorIsId(): boolean;
|
|
12
14
|
constructor(host: ReactiveElement, { selector }?: {
|
|
13
15
|
selector: string;
|
|
14
16
|
});
|
|
@@ -17,4 +19,5 @@ export declare class ElementResolutionController implements ReactiveController {
|
|
|
17
19
|
hostDisconnected(): void;
|
|
18
20
|
private resolveElement;
|
|
19
21
|
private releaseElement;
|
|
22
|
+
private elementIsSelected;
|
|
20
23
|
}
|
|
@@ -12,16 +12,13 @@ export class ElementResolutionController {
|
|
|
12
12
|
if (mutation.type === "childList") {
|
|
13
13
|
const currentElementRemoved = this.element && [...mutation.removedNodes].includes(this.element);
|
|
14
14
|
const matchingElementAdded = !!this.selector && [...mutation.addedNodes].some(
|
|
15
|
-
|
|
16
|
-
var _a;
|
|
17
|
-
return (_a = el == null ? void 0 : el.matches) == null ? void 0 : _a.call(el, this.selector);
|
|
18
|
-
}
|
|
15
|
+
this.elementIsSelected
|
|
19
16
|
);
|
|
20
17
|
needsResolution = needsResolution || currentElementRemoved || matchingElementAdded;
|
|
21
18
|
}
|
|
22
19
|
if (mutation.type === "attributes") {
|
|
23
20
|
const attributeChangedOnCurrentElement = mutation.target === this.element;
|
|
24
|
-
const attributeChangedOnMatchingElement = !!this.selector && mutation.target
|
|
21
|
+
const attributeChangedOnMatchingElement = !!this.selector && this.elementIsSelected(mutation.target);
|
|
25
22
|
needsResolution = needsResolution || attributeChangedOnCurrentElement || attributeChangedOnMatchingElement;
|
|
26
23
|
}
|
|
27
24
|
});
|
|
@@ -29,6 +26,10 @@ export class ElementResolutionController {
|
|
|
29
26
|
this.resolveElement();
|
|
30
27
|
}
|
|
31
28
|
};
|
|
29
|
+
this.elementIsSelected = (el) => {
|
|
30
|
+
var _a;
|
|
31
|
+
return this.selectorIsId ? (el == null ? void 0 : el.id) === this.selectorAsId : (_a = el == null ? void 0 : el.matches) == null ? void 0 : _a.call(el, this.selector);
|
|
32
|
+
};
|
|
32
33
|
this.host = host;
|
|
33
34
|
this.selector = selector;
|
|
34
35
|
this.observer = new MutationObserver(this.mutationCallback);
|
|
@@ -54,6 +55,12 @@ export class ElementResolutionController {
|
|
|
54
55
|
this._selector = selector;
|
|
55
56
|
this.resolveElement();
|
|
56
57
|
}
|
|
58
|
+
get selectorAsId() {
|
|
59
|
+
return this.selector.slice(1);
|
|
60
|
+
}
|
|
61
|
+
get selectorIsId() {
|
|
62
|
+
return !!this.selector && this.selector.startsWith("#");
|
|
63
|
+
}
|
|
57
64
|
hostConnected() {
|
|
58
65
|
this.resolveElement();
|
|
59
66
|
this.observer.observe(this.host.getRootNode(), {
|
|
@@ -72,7 +79,7 @@ export class ElementResolutionController {
|
|
|
72
79
|
return;
|
|
73
80
|
}
|
|
74
81
|
const parent = this.host.getRootNode();
|
|
75
|
-
this.element = parent.querySelector(this.selector);
|
|
82
|
+
this.element = this.selectorIsId ? parent.getElementById(this.selectorAsId) : parent.querySelector(this.selector);
|
|
76
83
|
}
|
|
77
84
|
releaseElement() {
|
|
78
85
|
this.element = null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["ElementResolution.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nCopyright 2022 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\nexport const elementResolverUpdatedSymbol = Symbol('element resolver updated');\n\nexport class ElementResolutionController implements ReactiveController {\n get element(): HTMLElement | null {\n return this._element;\n }\n\n set element(element: HTMLElement | null) {\n if (element === this.element) return;\n const previous = this.element;\n this._element = element;\n // requestUpdate leveraging the exported Symbol() so that the\n // changes can be easily tracked in the host element.\n this.host.requestUpdate(elementResolverUpdatedSymbol, previous);\n }\n\n private _element: HTMLElement | null = null;\n\n private host!: ReactiveElement;\n\n private observer!: MutationObserver;\n\n get selector(): string {\n return this._selector;\n }\n\n set selector(selector: string) {\n if (selector === this.selector) return;\n this.releaseElement();\n this._selector = selector;\n this.resolveElement();\n }\n\n private _selector = '';\n\n constructor(\n host: ReactiveElement,\n { selector }: { selector: string } = { selector: '' }\n ) {\n this.host = host;\n this.selector = selector;\n this.observer = new MutationObserver(this.mutationCallback);\n // Add the controller after the MutationObserver has been created in preparation\n // for the `hostConnected`/`hostDisconnected` callbacks to be run.\n this.host.addController(this);\n }\n\n protected mutationCallback: MutationCallback = (mutationList) => {\n let needsResolution = false;\n mutationList.forEach((mutation) => {\n if (needsResolution) return;\n if (mutation.type === 'childList') {\n const currentElementRemoved =\n this.element &&\n [...mutation.removedNodes].includes(this.element);\n const matchingElementAdded =\n !!this.selector &&\n ([...mutation.addedNodes] as HTMLElement[]).some(
|
|
5
|
-
"mappings": ";AAaO,aAAM,+BAA+B,OAAO,0BAA0B;AAEtE,aAAM,4BAA0D;AAAA,
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2022 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\nexport const elementResolverUpdatedSymbol = Symbol('element resolver updated');\n\nexport class ElementResolutionController implements ReactiveController {\n get element(): HTMLElement | null {\n return this._element;\n }\n\n set element(element: HTMLElement | null) {\n if (element === this.element) return;\n const previous = this.element;\n this._element = element;\n // requestUpdate leveraging the exported Symbol() so that the\n // changes can be easily tracked in the host element.\n this.host.requestUpdate(elementResolverUpdatedSymbol, previous);\n }\n\n private _element: HTMLElement | null = null;\n\n private host!: ReactiveElement;\n\n private observer!: MutationObserver;\n\n get selector(): string {\n return this._selector;\n }\n\n set selector(selector: string) {\n if (selector === this.selector) return;\n this.releaseElement();\n this._selector = selector;\n this.resolveElement();\n }\n\n private _selector = '';\n\n get selectorAsId(): string {\n return this.selector.slice(1);\n }\n\n get selectorIsId(): boolean {\n return !!this.selector && this.selector.startsWith('#');\n }\n\n constructor(\n host: ReactiveElement,\n { selector }: { selector: string } = { selector: '' }\n ) {\n this.host = host;\n this.selector = selector;\n this.observer = new MutationObserver(this.mutationCallback);\n // Add the controller after the MutationObserver has been created in preparation\n // for the `hostConnected`/`hostDisconnected` callbacks to be run.\n this.host.addController(this);\n }\n\n protected mutationCallback: MutationCallback = (mutationList) => {\n let needsResolution = false;\n mutationList.forEach((mutation) => {\n if (needsResolution) return;\n if (mutation.type === 'childList') {\n const currentElementRemoved =\n this.element &&\n [...mutation.removedNodes].includes(this.element);\n const matchingElementAdded =\n !!this.selector &&\n ([...mutation.addedNodes] as HTMLElement[]).some(\n this.elementIsSelected\n );\n needsResolution =\n needsResolution ||\n currentElementRemoved ||\n matchingElementAdded;\n }\n if (mutation.type === 'attributes') {\n const attributeChangedOnCurrentElement =\n mutation.target === this.element;\n const attributeChangedOnMatchingElement =\n !!this.selector &&\n this.elementIsSelected(mutation.target as HTMLElement);\n needsResolution =\n needsResolution ||\n attributeChangedOnCurrentElement ||\n attributeChangedOnMatchingElement;\n }\n });\n if (needsResolution) {\n this.resolveElement();\n }\n };\n\n public hostConnected(): void {\n this.resolveElement();\n this.observer.observe(this.host.getRootNode(), {\n subtree: true,\n childList: true,\n attributes: true,\n });\n }\n\n public hostDisconnected(): void {\n this.releaseElement();\n this.observer.disconnect();\n }\n\n private resolveElement(): void {\n if (!this.selector) {\n this.releaseElement();\n return;\n }\n\n const parent = this.host.getRootNode() as ShadowRoot;\n this.element = this.selectorIsId\n ? (parent.getElementById(this.selectorAsId) as HTMLElement)\n : (parent.querySelector(this.selector) as HTMLElement);\n }\n\n private releaseElement(): void {\n this.element = null;\n }\n\n private elementIsSelected = (el: HTMLElement): boolean => {\n return this.selectorIsId\n ? el?.id === this.selectorAsId\n : el?.matches?.(this.selector);\n };\n}\n"],
|
|
5
|
+
"mappings": ";AAaO,aAAM,+BAA+B,OAAO,0BAA0B;AAEtE,aAAM,4BAA0D;AAAA,EAyCnE,YACI,MACA,EAAE,SAAS,IAA0B,EAAE,UAAU,GAAG,GACtD;AA9BF,SAAQ,WAA+B;AAiBvC,SAAQ,YAAY;AAsBpB,SAAU,mBAAqC,CAAC,iBAAiB;AAC7D,UAAI,kBAAkB;AACtB,mBAAa,QAAQ,CAAC,aAAa;AAC/B,YAAI;AAAiB;AACrB,YAAI,SAAS,SAAS,aAAa;AAC/B,gBAAM,wBACF,KAAK,WACL,CAAC,GAAG,SAAS,YAAY,EAAE,SAAS,KAAK,OAAO;AACpD,gBAAM,uBACF,CAAC,CAAC,KAAK,YACN,CAAC,GAAG,SAAS,UAAU,EAAoB;AAAA,YACxC,KAAK;AAAA,UACT;AACJ,4BACI,mBACA,yBACA;AAAA,QACR;AACA,YAAI,SAAS,SAAS,cAAc;AAChC,gBAAM,mCACF,SAAS,WAAW,KAAK;AAC7B,gBAAM,oCACF,CAAC,CAAC,KAAK,YACP,KAAK,kBAAkB,SAAS,MAAqB;AACzD,4BACI,mBACA,oCACA;AAAA,QACR;AAAA,MACJ,CAAC;AACD,UAAI,iBAAiB;AACjB,aAAK,eAAe;AAAA,MACxB;AAAA,IACJ;AAgCA,SAAQ,oBAAoB,CAAC,OAA6B;AArI9D;AAsIQ,aAAO,KAAK,gBACN,yBAAI,QAAO,KAAK,gBAChB,8BAAI,YAAJ,4BAAc,KAAK;AAAA,IAC7B;AA7EI,SAAK,OAAO;AACZ,SAAK,WAAW;AAChB,SAAK,WAAW,IAAI,iBAAiB,KAAK,gBAAgB;AAG1D,SAAK,KAAK,cAAc,IAAI;AAAA,EAChC;AAAA,EAlDA,IAAI,UAA8B;AAC9B,WAAO,KAAK;AAAA,EAChB;AAAA,EAEA,IAAI,QAAQ,SAA6B;AACrC,QAAI,YAAY,KAAK;AAAS;AAC9B,UAAM,WAAW,KAAK;AACtB,SAAK,WAAW;AAGhB,SAAK,KAAK,cAAc,8BAA8B,QAAQ;AAAA,EAClE;AAAA,EAQA,IAAI,WAAmB;AACnB,WAAO,KAAK;AAAA,EAChB;AAAA,EAEA,IAAI,SAAS,UAAkB;AAC3B,QAAI,aAAa,KAAK;AAAU;AAChC,SAAK,eAAe;AACpB,SAAK,YAAY;AACjB,SAAK,eAAe;AAAA,EACxB;AAAA,EAIA,IAAI,eAAuB;AACvB,WAAO,KAAK,SAAS,MAAM,CAAC;AAAA,EAChC;AAAA,EAEA,IAAI,eAAwB;AACxB,WAAO,CAAC,CAAC,KAAK,YAAY,KAAK,SAAS,WAAW,GAAG;AAAA,EAC1D;AAAA,EAiDO,gBAAsB;AACzB,SAAK,eAAe;AACpB,SAAK,SAAS,QAAQ,KAAK,KAAK,YAAY,GAAG;AAAA,MAC3C,SAAS;AAAA,MACT,WAAW;AAAA,MACX,YAAY;AAAA,IAChB,CAAC;AAAA,EACL;AAAA,EAEO,mBAAyB;AAC5B,SAAK,eAAe;AACpB,SAAK,SAAS,WAAW;AAAA,EAC7B;AAAA,EAEQ,iBAAuB;AAC3B,QAAI,CAAC,KAAK,UAAU;AAChB,WAAK,eAAe;AACpB;AAAA,IACJ;AAEA,UAAM,SAAS,KAAK,KAAK,YAAY;AACrC,SAAK,UAAU,KAAK,eACb,OAAO,eAAe,KAAK,YAAY,IACvC,OAAO,cAAc,KAAK,QAAQ;AAAA,EAC7C;AAAA,EAEQ,iBAAuB;AAC3B,SAAK,UAAU;AAAA,EACnB;AAOJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/src/ElementResolution.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";export const elementResolverUpdatedSymbol=Symbol("element resolver updated");export class ElementResolutionController{constructor(e,{selector:t}={selector:""}){this._element=null;this._selector="";this.mutationCallback=e=>{let t=!1;e.forEach(s=>{if(!t){if(s.type==="childList"){const
|
|
1
|
+
"use strict";export const elementResolverUpdatedSymbol=Symbol("element resolver updated");export class ElementResolutionController{constructor(e,{selector:t}={selector:""}){this._element=null;this._selector="";this.mutationCallback=e=>{let t=!1;e.forEach(s=>{if(!t){if(s.type==="childList"){const r=this.element&&[...s.removedNodes].includes(this.element),l=!!this.selector&&[...s.addedNodes].some(this.elementIsSelected);t=t||r||l}if(s.type==="attributes"){const r=s.target===this.element,l=!!this.selector&&this.elementIsSelected(s.target);t=t||r||l}}}),t&&this.resolveElement()};this.elementIsSelected=e=>{var t;return this.selectorIsId?(e==null?void 0:e.id)===this.selectorAsId:(t=e==null?void 0:e.matches)==null?void 0:t.call(e,this.selector)};this.host=e,this.selector=t,this.observer=new MutationObserver(this.mutationCallback),this.host.addController(this)}get element(){return this._element}set element(e){if(e===this.element)return;const t=this.element;this._element=e,this.host.requestUpdate(elementResolverUpdatedSymbol,t)}get selector(){return this._selector}set selector(e){e!==this.selector&&(this.releaseElement(),this._selector=e,this.resolveElement())}get selectorAsId(){return this.selector.slice(1)}get selectorIsId(){return!!this.selector&&this.selector.startsWith("#")}hostConnected(){this.resolveElement(),this.observer.observe(this.host.getRootNode(),{subtree:!0,childList:!0,attributes:!0})}hostDisconnected(){this.releaseElement(),this.observer.disconnect()}resolveElement(){if(!this.selector){this.releaseElement();return}const e=this.host.getRootNode();this.element=this.selectorIsId?e.getElementById(this.selectorAsId):e.querySelector(this.selector)}releaseElement(){this.element=null}}
|
|
2
2
|
//# sourceMappingURL=ElementResolution.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["ElementResolution.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nCopyright 2022 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\nexport const elementResolverUpdatedSymbol = Symbol('element resolver updated');\n\nexport class ElementResolutionController implements ReactiveController {\n get element(): HTMLElement | null {\n return this._element;\n }\n\n set element(element: HTMLElement | null) {\n if (element === this.element) return;\n const previous = this.element;\n this._element = element;\n // requestUpdate leveraging the exported Symbol() so that the\n // changes can be easily tracked in the host element.\n this.host.requestUpdate(elementResolverUpdatedSymbol, previous);\n }\n\n private _element: HTMLElement | null = null;\n\n private host!: ReactiveElement;\n\n private observer!: MutationObserver;\n\n get selector(): string {\n return this._selector;\n }\n\n set selector(selector: string) {\n if (selector === this.selector) return;\n this.releaseElement();\n this._selector = selector;\n this.resolveElement();\n }\n\n private _selector = '';\n\n constructor(\n host: ReactiveElement,\n { selector }: { selector: string } = { selector: '' }\n ) {\n this.host = host;\n this.selector = selector;\n this.observer = new MutationObserver(this.mutationCallback);\n // Add the controller after the MutationObserver has been created in preparation\n // for the `hostConnected`/`hostDisconnected` callbacks to be run.\n this.host.addController(this);\n }\n\n protected mutationCallback: MutationCallback = (mutationList) => {\n let needsResolution = false;\n mutationList.forEach((mutation) => {\n if (needsResolution) return;\n if (mutation.type === 'childList') {\n const currentElementRemoved =\n this.element &&\n [...mutation.removedNodes].includes(this.element);\n const matchingElementAdded =\n !!this.selector &&\n ([...mutation.addedNodes] as HTMLElement[]).some(
|
|
5
|
-
"mappings": "aAaO,aAAM,6BAA+B,OAAO,0BAA0B,EAEtE,aAAM,2BAA0D,
|
|
6
|
-
"names": ["host", "selector", "mutationList", "needsResolution", "mutation", "currentElementRemoved", "matchingElementAdded", "
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2022 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\nexport const elementResolverUpdatedSymbol = Symbol('element resolver updated');\n\nexport class ElementResolutionController implements ReactiveController {\n get element(): HTMLElement | null {\n return this._element;\n }\n\n set element(element: HTMLElement | null) {\n if (element === this.element) return;\n const previous = this.element;\n this._element = element;\n // requestUpdate leveraging the exported Symbol() so that the\n // changes can be easily tracked in the host element.\n this.host.requestUpdate(elementResolverUpdatedSymbol, previous);\n }\n\n private _element: HTMLElement | null = null;\n\n private host!: ReactiveElement;\n\n private observer!: MutationObserver;\n\n get selector(): string {\n return this._selector;\n }\n\n set selector(selector: string) {\n if (selector === this.selector) return;\n this.releaseElement();\n this._selector = selector;\n this.resolveElement();\n }\n\n private _selector = '';\n\n get selectorAsId(): string {\n return this.selector.slice(1);\n }\n\n get selectorIsId(): boolean {\n return !!this.selector && this.selector.startsWith('#');\n }\n\n constructor(\n host: ReactiveElement,\n { selector }: { selector: string } = { selector: '' }\n ) {\n this.host = host;\n this.selector = selector;\n this.observer = new MutationObserver(this.mutationCallback);\n // Add the controller after the MutationObserver has been created in preparation\n // for the `hostConnected`/`hostDisconnected` callbacks to be run.\n this.host.addController(this);\n }\n\n protected mutationCallback: MutationCallback = (mutationList) => {\n let needsResolution = false;\n mutationList.forEach((mutation) => {\n if (needsResolution) return;\n if (mutation.type === 'childList') {\n const currentElementRemoved =\n this.element &&\n [...mutation.removedNodes].includes(this.element);\n const matchingElementAdded =\n !!this.selector &&\n ([...mutation.addedNodes] as HTMLElement[]).some(\n this.elementIsSelected\n );\n needsResolution =\n needsResolution ||\n currentElementRemoved ||\n matchingElementAdded;\n }\n if (mutation.type === 'attributes') {\n const attributeChangedOnCurrentElement =\n mutation.target === this.element;\n const attributeChangedOnMatchingElement =\n !!this.selector &&\n this.elementIsSelected(mutation.target as HTMLElement);\n needsResolution =\n needsResolution ||\n attributeChangedOnCurrentElement ||\n attributeChangedOnMatchingElement;\n }\n });\n if (needsResolution) {\n this.resolveElement();\n }\n };\n\n public hostConnected(): void {\n this.resolveElement();\n this.observer.observe(this.host.getRootNode(), {\n subtree: true,\n childList: true,\n attributes: true,\n });\n }\n\n public hostDisconnected(): void {\n this.releaseElement();\n this.observer.disconnect();\n }\n\n private resolveElement(): void {\n if (!this.selector) {\n this.releaseElement();\n return;\n }\n\n const parent = this.host.getRootNode() as ShadowRoot;\n this.element = this.selectorIsId\n ? (parent.getElementById(this.selectorAsId) as HTMLElement)\n : (parent.querySelector(this.selector) as HTMLElement);\n }\n\n private releaseElement(): void {\n this.element = null;\n }\n\n private elementIsSelected = (el: HTMLElement): boolean => {\n return this.selectorIsId\n ? el?.id === this.selectorAsId\n : el?.matches?.(this.selector);\n };\n}\n"],
|
|
5
|
+
"mappings": "aAaO,aAAM,6BAA+B,OAAO,0BAA0B,EAEtE,aAAM,2BAA0D,CAyCnE,YACIA,EACA,CAAE,SAAAC,CAAS,EAA0B,CAAE,SAAU,EAAG,EACtD,CA9BF,KAAQ,SAA+B,KAiBvC,KAAQ,UAAY,GAsBpB,KAAU,iBAAsCC,GAAiB,CAC7D,IAAIC,EAAkB,GACtBD,EAAa,QAASE,GAAa,CAC/B,GAAI,CAAAD,EACJ,IAAIC,EAAS,OAAS,YAAa,CAC/B,MAAMC,EACF,KAAK,SACL,CAAC,GAAGD,EAAS,YAAY,EAAE,SAAS,KAAK,OAAO,EAC9CE,EACF,CAAC,CAAC,KAAK,UACN,CAAC,GAAGF,EAAS,UAAU,EAAoB,KACxC,KAAK,iBACT,EACJD,EACIA,GACAE,GACAC,CACR,CACA,GAAIF,EAAS,OAAS,aAAc,CAChC,MAAMG,EACFH,EAAS,SAAW,KAAK,QACvBI,EACF,CAAC,CAAC,KAAK,UACP,KAAK,kBAAkBJ,EAAS,MAAqB,EACzDD,EACIA,GACAI,GACAC,CACR,EACJ,CAAC,EACGL,GACA,KAAK,eAAe,CAE5B,EAgCA,KAAQ,kBAAqBM,GAA6B,CArI9D,IAAAC,EAsIQ,OAAO,KAAK,cACND,GAAA,YAAAA,EAAI,MAAO,KAAK,cAChBC,EAAAD,GAAA,YAAAA,EAAI,UAAJ,YAAAC,EAAA,KAAAD,EAAc,KAAK,SAC7B,EA7EI,KAAK,KAAOT,EACZ,KAAK,SAAWC,EAChB,KAAK,SAAW,IAAI,iBAAiB,KAAK,gBAAgB,EAG1D,KAAK,KAAK,cAAc,IAAI,CAChC,CAlDA,IAAI,SAA8B,CAC9B,OAAO,KAAK,QAChB,CAEA,IAAI,QAAQU,EAA6B,CACrC,GAAIA,IAAY,KAAK,QAAS,OAC9B,MAAMC,EAAW,KAAK,QACtB,KAAK,SAAWD,EAGhB,KAAK,KAAK,cAAc,6BAA8BC,CAAQ,CAClE,CAQA,IAAI,UAAmB,CACnB,OAAO,KAAK,SAChB,CAEA,IAAI,SAASX,EAAkB,CACvBA,IAAa,KAAK,WACtB,KAAK,eAAe,EACpB,KAAK,UAAYA,EACjB,KAAK,eAAe,EACxB,CAIA,IAAI,cAAuB,CACvB,OAAO,KAAK,SAAS,MAAM,CAAC,CAChC,CAEA,IAAI,cAAwB,CACxB,MAAO,CAAC,CAAC,KAAK,UAAY,KAAK,SAAS,WAAW,GAAG,CAC1D,CAiDO,eAAsB,CACzB,KAAK,eAAe,EACpB,KAAK,SAAS,QAAQ,KAAK,KAAK,YAAY,EAAG,CAC3C,QAAS,GACT,UAAW,GACX,WAAY,EAChB,CAAC,CACL,CAEO,kBAAyB,CAC5B,KAAK,eAAe,EACpB,KAAK,SAAS,WAAW,CAC7B,CAEQ,gBAAuB,CAC3B,GAAI,CAAC,KAAK,SAAU,CAChB,KAAK,eAAe,EACpB,MACJ,CAEA,MAAMY,EAAS,KAAK,KAAK,YAAY,EACrC,KAAK,QAAU,KAAK,aACbA,EAAO,eAAe,KAAK,YAAY,EACvCA,EAAO,cAAc,KAAK,QAAQ,CAC7C,CAEQ,gBAAuB,CAC3B,KAAK,QAAU,IACnB,CAOJ",
|
|
6
|
+
"names": ["host", "selector", "mutationList", "needsResolution", "mutation", "currentElementRemoved", "matchingElementAdded", "attributeChangedOnCurrentElement", "attributeChangedOnMatchingElement", "el", "_a", "element", "previous", "parent"]
|
|
7
7
|
}
|