@frontile/overlays 0.17.0-beta.2 → 0.17.0-beta.21
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/declarations/-private/dom.d.ts +0 -1
- package/declarations/components/backdrop.d.ts +0 -1
- package/declarations/components/drawer/body.d.ts +0 -1
- package/declarations/components/drawer/footer.d.ts +0 -1
- package/declarations/components/drawer/header.d.ts +0 -1
- package/declarations/components/drawer.d.ts +12 -13
- package/declarations/components/modal/body.d.ts +0 -1
- package/declarations/components/modal/footer.d.ts +0 -1
- package/declarations/components/modal/header.d.ts +0 -1
- package/declarations/components/modal.d.ts +11 -12
- package/declarations/components/overlay.d.ts +8 -2
- package/declarations/components/popover.d.ts +12 -4
- package/declarations/components/portal-target.d.ts +0 -1
- package/declarations/components/portal.d.ts +0 -1
- package/declarations/index.d.ts +0 -1
- package/declarations/template-registry.d.ts +0 -1
- package/dist/components/backdrop.js +8 -8
- package/dist/components/backdrop.js.map +1 -1
- package/dist/components/drawer/body.js +10 -9
- package/dist/components/drawer/body.js.map +1 -1
- package/dist/components/drawer/footer.js +10 -9
- package/dist/components/drawer/footer.js.map +1 -1
- package/dist/components/drawer/header.js +10 -9
- package/dist/components/drawer/header.js.map +1 -1
- package/dist/components/drawer.js +15 -19
- package/dist/components/drawer.js.map +1 -1
- package/dist/components/modal/body.js +10 -9
- package/dist/components/modal/body.js.map +1 -1
- package/dist/components/modal/footer.js +10 -9
- package/dist/components/modal/footer.js.map +1 -1
- package/dist/components/modal/header.js +10 -9
- package/dist/components/modal/header.js.map +1 -1
- package/dist/components/modal.js +15 -19
- package/dist/components/modal.js.map +1 -1
- package/dist/components/overlay.js +16 -197
- package/dist/components/overlay.js.map +1 -1
- package/dist/components/popover.js +159 -128
- package/dist/components/popover.js.map +1 -1
- package/dist/components/portal-target.js.map +1 -1
- package/dist/components/portal.js +1 -2
- package/dist/components/portal.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/overlay-CtCgH4Fk.js +270 -0
- package/dist/overlay-CtCgH4Fk.js.map +1 -0
- package/dist/{portal-Es7o21X5.js → portal-lZU6177n.js} +21 -22
- package/dist/portal-lZU6177n.js.map +1 -0
- package/package.json +48 -51
- package/declarations/-private/dom.d.ts.map +0 -1
- package/declarations/components/backdrop.d.ts.map +0 -1
- package/declarations/components/drawer/body.d.ts.map +0 -1
- package/declarations/components/drawer/footer.d.ts.map +0 -1
- package/declarations/components/drawer/header.d.ts.map +0 -1
- package/declarations/components/drawer.d.ts.map +0 -1
- package/declarations/components/modal/body.d.ts.map +0 -1
- package/declarations/components/modal/footer.d.ts.map +0 -1
- package/declarations/components/modal/header.d.ts.map +0 -1
- package/declarations/components/modal.d.ts.map +0 -1
- package/declarations/components/overlay.d.ts.map +0 -1
- package/declarations/components/popover.d.ts.map +0 -1
- package/declarations/components/portal-target.d.ts.map +0 -1
- package/declarations/components/portal.d.ts.map +0 -1
- package/declarations/index.d.ts.map +0 -1
- package/declarations/portal-Es7o21X5.d.ts +0 -5
- package/declarations/portal-Es7o21X5.d.ts.map +0 -1
- package/declarations/template-registry.d.ts.map +0 -1
- package/dist/portal-D1N7TxUb.js +0 -167
- package/dist/portal-D1N7TxUb.js.map +0 -1
- package/dist/portal-Es7o21X5.js.map +0 -1
|
@@ -3,15 +3,16 @@ import { twMerge } from '@frontile/theme';
|
|
|
3
3
|
import { precompileTemplate } from '@ember/template-compilation';
|
|
4
4
|
import { setComponentTemplate } from '@ember/component';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
6
|
+
class ModalFooter extends Component {
|
|
7
|
+
static {
|
|
8
|
+
setComponentTemplate(precompileTemplate("\n <div class={{twMerge @classFromParent @class}} ...attributes>\n {{yield}}\n </div>\n ", {
|
|
9
|
+
strictMode: true,
|
|
10
|
+
scope: () => ({
|
|
11
|
+
twMerge
|
|
12
|
+
})
|
|
13
|
+
}), this);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
15
16
|
|
|
16
17
|
export { ModalFooter as default };
|
|
17
18
|
//# sourceMappingURL=footer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"footer.js","sources":["../../../src/components/modal/footer.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { twMerge } from '@frontile/theme';\n\nexport interface ModalFooterArgs {\n class?: string;\n\n /**\n * @internal\n */\n classFromParent?: string;\n}\n\nexport interface ModalFooterSignature {\n Args: ModalFooterArgs;\n Element: HTMLDivElement;\n Blocks: {\n default: [];\n };\n}\n\nexport default class ModalFooter extends Component<ModalFooterSignature> {\n <template>\n <div class={{twMerge @classFromParent @class}} ...attributes>\n {{yield}}\n </div>\n </template>\n}\n"],"names":["ModalFooter","Component","
|
|
1
|
+
{"version":3,"file":"footer.js","sources":["../../../src/components/modal/footer.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { twMerge } from '@frontile/theme';\n\nexport interface ModalFooterArgs {\n class?: string;\n\n /**\n * @internal\n */\n classFromParent?: string;\n}\n\nexport interface ModalFooterSignature {\n Args: ModalFooterArgs;\n Element: HTMLDivElement;\n Blocks: {\n default: [];\n };\n}\n\nexport default class ModalFooter extends Component<ModalFooterSignature> {\n <template>\n <div class={{twMerge @classFromParent @class}} ...attributes>\n {{yield}}\n </div>\n </template>\n}\n"],"names":["ModalFooter","Component","setComponentTemplate","precompileTemplate","strictMode","scope","twMerge"],"mappings":";;;;;AAoBe,MAAMA,oBAAoBC,SAAA,CAAU;AACjD,EAAA;IAAAC,oBAAA,CAAAC,kBAAA,CAAA,sGAAA,EAIA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
@@ -3,15 +3,16 @@ import { twMerge } from '@frontile/theme';
|
|
|
3
3
|
import { precompileTemplate } from '@ember/template-compilation';
|
|
4
4
|
import { setComponentTemplate } from '@ember/component';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
6
|
+
class ModalHeader extends Component {
|
|
7
|
+
static {
|
|
8
|
+
setComponentTemplate(precompileTemplate("\n <div id={{@labelledById}} class={{twMerge @classFromParent @class}} ...attributes>\n {{yield}}\n </div>\n ", {
|
|
9
|
+
strictMode: true,
|
|
10
|
+
scope: () => ({
|
|
11
|
+
twMerge
|
|
12
|
+
})
|
|
13
|
+
}), this);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
15
16
|
|
|
16
17
|
export { ModalHeader as default };
|
|
17
18
|
//# sourceMappingURL=header.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header.js","sources":["../../../src/components/modal/header.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { twMerge } from '@frontile/theme';\n\nexport interface ModalHeaderArgs {\n class?: string;\n /**\n * The id used to reference labelledById in Modal component\n */\n labelledById: string;\n\n /**\n * @internal\n */\n classFromParent?: string;\n}\n\nexport interface ModalHeaderSignature {\n Args: ModalHeaderArgs;\n Element: HTMLDivElement;\n Blocks: {\n default: [];\n };\n}\n\nexport default class ModalHeader extends Component<ModalHeaderSignature> {\n <template>\n <div\n id={{@labelledById}}\n class={{twMerge @classFromParent @class}}\n ...attributes\n >\n {{yield}}\n </div>\n </template>\n}\n"],"names":["ModalHeader","Component","
|
|
1
|
+
{"version":3,"file":"header.js","sources":["../../../src/components/modal/header.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { twMerge } from '@frontile/theme';\n\nexport interface ModalHeaderArgs {\n class?: string;\n /**\n * The id used to reference labelledById in Modal component\n */\n labelledById: string;\n\n /**\n * @internal\n */\n classFromParent?: string;\n}\n\nexport interface ModalHeaderSignature {\n Args: ModalHeaderArgs;\n Element: HTMLDivElement;\n Blocks: {\n default: [];\n };\n}\n\nexport default class ModalHeader extends Component<ModalHeaderSignature> {\n <template>\n <div\n id={{@labelledById}}\n class={{twMerge @classFromParent @class}}\n ...attributes\n >\n {{yield}}\n </div>\n </template>\n}\n"],"names":["ModalHeader","Component","setComponentTemplate","precompileTemplate","strictMode","scope","twMerge"],"mappings":";;;;;AAwBe,MAAMA,oBAAoBC,SAAA,CAAU;AACjD,EAAA;IAAAC,oBAAA,CAAAC,kBAAA,CAAA,2HAAA,EAQA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
package/dist/components/modal.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
2
1
|
import Component from '@glimmer/component';
|
|
3
2
|
import { guidFor } from '@ember/object/internals';
|
|
4
3
|
import { hash } from '@ember/helper';
|
|
5
|
-
import { Overlay } from '
|
|
4
|
+
import { O as Overlay } from '../overlay-CtCgH4Fk.js';
|
|
6
5
|
import ModalFooter from './modal/footer.js';
|
|
7
6
|
import ModalBody from './modal/body.js';
|
|
8
7
|
import ModalHeader from './modal/header.js';
|
|
@@ -11,12 +10,8 @@ import { useStyles } from '@frontile/theme';
|
|
|
11
10
|
import { precompileTemplate } from '@ember/template-compilation';
|
|
12
11
|
import { setComponentTemplate } from '@ember/component';
|
|
13
12
|
|
|
14
|
-
var _Modal;
|
|
15
13
|
class Modal extends Component {
|
|
16
|
-
|
|
17
|
-
super(...args);
|
|
18
|
-
_defineProperty(this, "headerId", `${guidFor(this)}-header`);
|
|
19
|
-
}
|
|
14
|
+
headerId = `${guidFor(this)}-header`;
|
|
20
15
|
get preventClosing() {
|
|
21
16
|
return this.args.allowClosing === false;
|
|
22
17
|
}
|
|
@@ -47,19 +42,20 @@ class Modal extends Component {
|
|
|
47
42
|
}
|
|
48
43
|
return options;
|
|
49
44
|
}
|
|
45
|
+
static {
|
|
46
|
+
setComponentTemplate(precompileTemplate("\n <Overlay @isOpen={{@isOpen}} @onClose={{@onClose}} @onOpen={{@onOpen}} @didClose={{@didClose}} @renderInPlace={{@renderInPlace}} @target={{@target}} @transitionDuration={{@transitionDuration}} @backdrop={{@backdrop}} @disableTransitions={{@disableTransitions}} @disableFocusTrap={{@disableFocusTrap}} @focusTrapOptions={{@focusTrapOptions}} @closeOnOutsideClick={{if this.preventClosing false @closeOnOutsideClick}} @closeOnEscapeKey={{if this.preventClosing false @closeOnEscapeKey}} @backdropTransition={{@backdropTransition}} @transition={{this.transition}} @closeOnOverlayElementClick={{true}}>\n <div class={{this.classes.base class=@classes.base}} tabindex=\"0\" role=\"dialog\" aria-labelledby={{this.headerId}} ...attributes>\n {{#if this.showCloseButton}}\n <CloseButton @onPress={{@onClose}} @size={{@closeButtonSize}} @class={{this.classes.closeButton class=@classes.closeButton}} />\n {{/if}}\n\n {{yield (hash CloseButton=(component CloseButton onPress=@onClose class=(this.classes.closeButton class=@classes.closeButton)) Header=(component ModalHeader labelledById=this.headerId classFromParent=(this.classes.header class=@classes.header)) Body=(component ModalBody classFromParent=(this.classes.body class=@classes.body)) Footer=(component ModalFooter classFromParent=(this.classes.footer class=@classes.footer)) headerId=this.headerId)}}\n </div>\n </Overlay>\n ", {
|
|
47
|
+
strictMode: true,
|
|
48
|
+
scope: () => ({
|
|
49
|
+
Overlay,
|
|
50
|
+
CloseButton,
|
|
51
|
+
hash,
|
|
52
|
+
ModalHeader,
|
|
53
|
+
ModalBody,
|
|
54
|
+
ModalFooter
|
|
55
|
+
})
|
|
56
|
+
}), this);
|
|
57
|
+
}
|
|
50
58
|
}
|
|
51
|
-
_Modal = Modal;
|
|
52
|
-
setComponentTemplate(precompileTemplate("\n <Overlay @isOpen={{@isOpen}} @onClose={{@onClose}} @onOpen={{@onOpen}} @didClose={{@didClose}} @renderInPlace={{@renderInPlace}} @target={{@target}} @transitionDuration={{@transitionDuration}} @backdrop={{@backdrop}} @disableTransitions={{@disableTransitions}} @disableFocusTrap={{@disableFocusTrap}} @focusTrapOptions={{@focusTrapOptions}} @closeOnOutsideClick={{if this.preventClosing false @closeOnOutsideClick}} @closeOnEscapeKey={{if this.preventClosing false @closeOnEscapeKey}} @backdropTransition={{@backdropTransition}} @transition={{this.transition}} @closeOnOverlayElementClick={{true}}>\n <div class={{this.classes.base class=@classes.base}} tabindex=\"0\" role=\"dialog\" aria-labelledby={{this.headerId}} ...attributes>\n {{#if this.showCloseButton}}\n <CloseButton @onClick={{@onClose}} @size={{@closeButtonSize}} @class={{this.classes.closeButton class=@classes.closeButton}} />\n {{/if}}\n\n {{yield (hash CloseButton=(component CloseButton onClick=@onClose class=(this.classes.closeButton class=@classes.closeButton)) Header=(component ModalHeader labelledById=this.headerId classFromParent=(this.classes.header class=@classes.header)) Body=(component ModalBody classFromParent=(this.classes.body class=@classes.body)) Footer=(component ModalFooter classFromParent=(this.classes.footer class=@classes.footer)) headerId=this.headerId)}}\n </div>\n </Overlay>\n ", {
|
|
53
|
-
strictMode: true,
|
|
54
|
-
scope: () => ({
|
|
55
|
-
Overlay,
|
|
56
|
-
CloseButton,
|
|
57
|
-
hash,
|
|
58
|
-
ModalHeader,
|
|
59
|
-
ModalBody,
|
|
60
|
-
ModalFooter
|
|
61
|
-
})
|
|
62
|
-
}), _Modal);
|
|
63
59
|
|
|
64
60
|
export { Modal as default };
|
|
65
61
|
//# sourceMappingURL=modal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal.js","sources":["../../src/components/modal.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { guidFor } from '@ember/object/internals';\nimport { hash } from '@ember/helper';\nimport Overlay, { type OverlaySignature } from './overlay';\nimport ModalFooter from './modal/footer';\nimport ModalBody from './modal/body';\nimport ModalHeader from './modal/header';\nimport { CloseButton } from '@frontile/buttons';\nimport {\n useStyles,\n type SlotsToClasses,\n type ModalSlots,\n type ModalVariants\n} from '@frontile/theme';\nimport type { WithBoundArgs } from '@glint/template';\n\nexport interface ModalArgs\n extends Pick<\n OverlaySignature['Args'],\n | 'isOpen'\n | 'onOpen'\n | 'onClose'\n | 'didClose'\n | 'renderInPlace'\n | 'target'\n | 'transitionDuration'\n | 'backdrop'\n | 'disableTransitions'\n | 'disableFocusTrap'\n | 'focusTrapOptions'\n | 'closeOnOutsideClick'\n | 'closeOnEscapeKey'\n | 'backdropTransition'\n > {\n /**\n * The transition to be used in the Modal.\n *\n * @defaultValue {name: 'overlay-transition--zoom'}\n */\n transition?: OverlaySignature['Args']['transition'];\n\n /**\n * If set to false, the close button will not be displayed,\n * closeOnOutsideClick will be set to false, and closeOnEscapeKey will also be set\n * to false.\n *\n * @defaultValue true\n */\n allowClosing?: boolean;\n\n /**\n * If set to false, the close button will not be displayed.\n *\n * @defaultValue true\n */\n allowCloseButton?: boolean;\n\n /**\n * The Close Button size.\n */\n closeButtonSize?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n\n /**\n * If set to true, the modal will be vertically centered\n *\n * @defaultValue false\n */\n isCentered?: boolean;\n\n /**\n * The Modal size.\n *\n * @defaultValue 'lg'\n */\n size?: ModalVariants['size'];\n\n classes?: SlotsToClasses<ModalSlots>;\n}\n\nexport interface ModalSignature {\n Args: ModalArgs;\n Blocks: {\n default: [\n {\n CloseButton: WithBoundArgs<typeof CloseButton, '
|
|
1
|
+
{"version":3,"file":"modal.js","sources":["../../src/components/modal.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { guidFor } from '@ember/object/internals';\nimport { hash } from '@ember/helper';\nimport Overlay, { type OverlaySignature } from './overlay';\nimport ModalFooter from './modal/footer';\nimport ModalBody from './modal/body';\nimport ModalHeader from './modal/header';\nimport { CloseButton } from '@frontile/buttons';\nimport {\n useStyles,\n type SlotsToClasses,\n type ModalSlots,\n type ModalVariants\n} from '@frontile/theme';\nimport type { WithBoundArgs } from '@glint/template';\n\nexport interface ModalArgs\n extends Pick<\n OverlaySignature['Args'],\n | 'isOpen'\n | 'onOpen'\n | 'onClose'\n | 'didClose'\n | 'renderInPlace'\n | 'target'\n | 'transitionDuration'\n | 'backdrop'\n | 'disableTransitions'\n | 'disableFocusTrap'\n | 'focusTrapOptions'\n | 'closeOnOutsideClick'\n | 'closeOnEscapeKey'\n | 'backdropTransition'\n > {\n /**\n * The transition to be used in the Modal.\n *\n * @defaultValue {name: 'overlay-transition--zoom'}\n */\n transition?: OverlaySignature['Args']['transition'];\n\n /**\n * If set to false, the close button will not be displayed,\n * closeOnOutsideClick will be set to false, and closeOnEscapeKey will also be set\n * to false.\n *\n * @defaultValue true\n */\n allowClosing?: boolean;\n\n /**\n * If set to false, the close button will not be displayed.\n *\n * @defaultValue true\n */\n allowCloseButton?: boolean;\n\n /**\n * The Close Button size.\n */\n closeButtonSize?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n\n /**\n * If set to true, the modal will be vertically centered\n *\n * @defaultValue false\n */\n isCentered?: boolean;\n\n /**\n * The Modal size.\n *\n * @defaultValue 'lg'\n */\n size?: ModalVariants['size'];\n\n classes?: SlotsToClasses<ModalSlots>;\n}\n\nexport interface ModalSignature {\n Args: ModalArgs;\n Blocks: {\n default: [\n {\n CloseButton: WithBoundArgs<typeof CloseButton, 'onPress' | 'class'>;\n Header: WithBoundArgs<\n typeof ModalHeader,\n 'labelledById' | 'classFromParent'\n >;\n Body: WithBoundArgs<typeof ModalBody, 'classFromParent'>;\n Footer: WithBoundArgs<typeof ModalFooter, 'classFromParent'>;\n headerId: string;\n }\n ];\n };\n Element: HTMLDivElement;\n}\n\nexport default class Modal extends Component<ModalSignature> {\n headerId = `${guidFor(this)}-header`;\n\n get preventClosing(): boolean {\n return this.args.allowClosing === false;\n }\n\n get showCloseButton(): boolean {\n return (\n this.args.allowClosing !== false && this.args.allowCloseButton !== false\n );\n }\n\n get size() {\n return this.args.size || 'lg';\n }\n\n get classes() {\n const { modal } = useStyles();\n\n return modal({\n size: this.size,\n isCentered: this.args.isCentered\n });\n }\n\n get transition() {\n let options: OverlaySignature['Args']['transition'] = {\n name: 'overlay-transition--zoom'\n };\n\n if (typeof this.args.transition === 'object') {\n return { ...options, ...this.args.transition };\n }\n\n return options;\n }\n\n <template>\n <Overlay\n @isOpen={{@isOpen}}\n @onClose={{@onClose}}\n @onOpen={{@onOpen}}\n @didClose={{@didClose}}\n @renderInPlace={{@renderInPlace}}\n @target={{@target}}\n @transitionDuration={{@transitionDuration}}\n @backdrop={{@backdrop}}\n @disableTransitions={{@disableTransitions}}\n @disableFocusTrap={{@disableFocusTrap}}\n @focusTrapOptions={{@focusTrapOptions}}\n @closeOnOutsideClick={{if this.preventClosing false @closeOnOutsideClick}}\n @closeOnEscapeKey={{if this.preventClosing false @closeOnEscapeKey}}\n @backdropTransition={{@backdropTransition}}\n @transition={{this.transition}}\n @closeOnOverlayElementClick={{true}}\n >\n <div\n class={{this.classes.base class=@classes.base}}\n tabindex=\"0\"\n role=\"dialog\"\n aria-labelledby={{this.headerId}}\n ...attributes\n >\n {{#if this.showCloseButton}}\n <CloseButton\n @onPress={{@onClose}}\n @size={{@closeButtonSize}}\n @class={{this.classes.closeButton class=@classes.closeButton}}\n />\n {{/if}}\n\n {{yield\n (hash\n CloseButton=(component\n CloseButton\n onPress=@onClose\n class=(this.classes.closeButton class=@classes.closeButton)\n )\n Header=(component\n ModalHeader\n labelledById=this.headerId\n classFromParent=(this.classes.header class=@classes.header)\n )\n Body=(component\n ModalBody classFromParent=(this.classes.body class=@classes.body)\n )\n Footer=(component\n ModalFooter\n classFromParent=(this.classes.footer class=@classes.footer)\n )\n headerId=this.headerId\n )\n }}\n </div>\n </Overlay>\n </template>\n}\n"],"names":["Modal","Component","headerId","guidFor","preventClosing","args","allowClosing","showCloseButton","allowCloseButton","size","classes","modal","useStyles","isCentered","transition","options","name","setComponentTemplate","precompileTemplate","strictMode","scope","Overlay","CloseButton","hash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AA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
@@ -1,198 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import '@
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
|
|
17
|
-
import { macroCondition, isTesting } from '@embroider/macros';
|
|
18
|
-
import { precompileTemplate } from '@ember/template-compilation';
|
|
19
|
-
import { setComponentTemplate } from '@ember/component';
|
|
20
|
-
|
|
21
|
-
var _class, _descriptor, _Overlay;
|
|
22
|
-
function hasNestedPortals(element) {
|
|
23
|
-
const portal = findParentPortal(element);
|
|
24
|
-
if (!portal) {
|
|
25
|
-
return false;
|
|
26
|
-
}
|
|
27
|
-
const childPortal = getElementByAttribute(portal, 'data-portal');
|
|
28
|
-
if (childPortal) {
|
|
29
|
-
return true;
|
|
30
|
-
}
|
|
31
|
-
return false;
|
|
32
|
-
}
|
|
33
|
-
// finds if the el has a parent with the id `ember-basic-dropdown-wormhole` or a role of `alert`
|
|
34
|
-
function hasWormholeOrAlertParentElement(el) {
|
|
35
|
-
let parent = el.parentElement;
|
|
36
|
-
while (parent) {
|
|
37
|
-
if (parent.id === 'ember-basic-dropdown-wormhole' || parent.role === 'alert') {
|
|
38
|
-
return true;
|
|
39
|
-
}
|
|
40
|
-
parent = parent.parentElement;
|
|
41
|
-
}
|
|
42
|
-
return false;
|
|
43
|
-
}
|
|
44
|
-
let Overlay = (_class = (_Overlay = class Overlay extends Component {
|
|
45
|
-
constructor(...args) {
|
|
46
|
-
super(...args);
|
|
47
|
-
_initializerDefineProperty(this, "keepOpen", _descriptor, this);
|
|
48
|
-
_defineProperty(this, "contentElement", void 0);
|
|
49
|
-
_defineProperty(this, "focusedElement", void 0);
|
|
50
|
-
_defineProperty(this, "mouseDownContentElement", null);
|
|
51
|
-
_defineProperty(this, "setupContent", modifier(el => {
|
|
52
|
-
let transitionDuration = this.args.transitionDuration || 200;
|
|
53
|
-
if (!this.isAnimationEnabled) {
|
|
54
|
-
transitionDuration = 0;
|
|
55
|
-
}
|
|
56
|
-
later(() => {
|
|
57
|
-
if (this.isDestroyed) return;
|
|
58
|
-
if (this.args.disableFocusTrap !== true) return;
|
|
59
|
-
el.focus();
|
|
60
|
-
}, transitionDuration);
|
|
61
|
-
this.contentElement = el;
|
|
62
|
-
this.keepOpen = true;
|
|
63
|
-
this.focusedElement = document.activeElement;
|
|
64
|
-
if (this.args.renderInPlace !== true && this.args.blockScroll !== false) {
|
|
65
|
-
document.body.style.overflow = 'hidden';
|
|
66
|
-
}
|
|
67
|
-
if (typeof this.args.onOpen === 'function') {
|
|
68
|
-
this.args.onOpen();
|
|
69
|
-
}
|
|
70
|
-
return () => {
|
|
71
|
-
this.contentElement = undefined;
|
|
72
|
-
if (this.args.renderInPlace !== true && this.args.blockScroll !== false) {
|
|
73
|
-
document.body.style.overflow = '';
|
|
74
|
-
}
|
|
75
|
-
const {
|
|
76
|
-
didClose
|
|
77
|
-
} = this.args;
|
|
78
|
-
later(() => {
|
|
79
|
-
if (!this.isDestroyed) this.keepOpen = false;
|
|
80
|
-
if (typeof didClose === 'function' && !this.isDestroyed) {
|
|
81
|
-
didClose();
|
|
82
|
-
}
|
|
83
|
-
// restore focus
|
|
84
|
-
if (!this.args.preventFocusRestore && this.focusedElement && this.focusedElement.tabIndex > -1 && typeof this.focusedElement.focus !== 'undefined') {
|
|
85
|
-
this.focusedElement.focus();
|
|
86
|
-
}
|
|
87
|
-
}, transitionDuration);
|
|
88
|
-
};
|
|
89
|
-
}));
|
|
90
|
-
}
|
|
91
|
-
handleClose() {
|
|
92
|
-
if (this.args.isOpen && typeof this.args.onClose === 'function') {
|
|
93
|
-
this.args.onClose();
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
handleContentClick(event) {
|
|
97
|
-
if (this.args.closeOnOutsideClick !== false && this.args.closeOnOverlayElementClick === true && event.target === this.contentElement && this.mouseDownContentElement == this.contentElement && !hasNestedPortals(this.contentElement) && !hasWormholeOrAlertParentElement(event.target)) {
|
|
98
|
-
this.handleClose();
|
|
99
|
-
}
|
|
100
|
-
this.mouseDownContentElement = null;
|
|
101
|
-
}
|
|
102
|
-
handleOutsideClick(e) {
|
|
103
|
-
if (this.args.closeOnOutsideClick !== false && this.contentElement && !hasNestedPortals(this.contentElement) && !hasWormholeOrAlertParentElement(e.target)) {
|
|
104
|
-
this.handleClose();
|
|
105
|
-
e.preventDefault();
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
handleContentMouseDown(event) {
|
|
109
|
-
if (this.args.closeOnOverlayElementClick === true) {
|
|
110
|
-
this.mouseDownContentElement = event.target;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
handleKeyDown(event) {
|
|
114
|
-
if (event.key === 'Escape' && this.args.closeOnEscapeKey !== false) {
|
|
115
|
-
this.handleClose();
|
|
116
|
-
event.preventDefault();
|
|
117
|
-
event.stopImmediatePropagation();
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
get isVisible() {
|
|
121
|
-
return this.args.isOpen || this.keepOpen;
|
|
122
|
-
}
|
|
123
|
-
get backdrop() {
|
|
124
|
-
if (!this.args.isOpen) {
|
|
125
|
-
return 'none';
|
|
126
|
-
}
|
|
127
|
-
return this.args.backdrop || 'faded';
|
|
128
|
-
}
|
|
129
|
-
get isAnimationEnabled() {
|
|
130
|
-
if (macroCondition(isTesting())) {
|
|
131
|
-
return false;
|
|
132
|
-
}
|
|
133
|
-
return !(this.args.disableTransitions === true);
|
|
134
|
-
}
|
|
135
|
-
get focusTrapOptions() {
|
|
136
|
-
return this.args.focusTrapOptions || {
|
|
137
|
-
clickOutsideDeactivates: true,
|
|
138
|
-
allowOutsideClick: true
|
|
139
|
-
};
|
|
140
|
-
}
|
|
141
|
-
get classes() {
|
|
142
|
-
const {
|
|
143
|
-
overlay
|
|
144
|
-
} = useStyles();
|
|
145
|
-
return overlay({
|
|
146
|
-
class: this.args.class,
|
|
147
|
-
inPlace: this.args.renderInPlace,
|
|
148
|
-
enableFlexContent: !(this.args.disableFlexContent === true)
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
get customContentModifier() {
|
|
152
|
-
if (this.args.customContentModifier) {
|
|
153
|
-
return this.args.customContentModifier;
|
|
154
|
-
}
|
|
155
|
-
return modifier(() => {});
|
|
156
|
-
}
|
|
157
|
-
get backdropTransition() {
|
|
158
|
-
if (this.args.backdropTransition) {
|
|
159
|
-
return this.args.backdropTransition;
|
|
160
|
-
}
|
|
161
|
-
return {
|
|
162
|
-
isEnabled: this.isAnimationEnabled
|
|
163
|
-
};
|
|
164
|
-
}
|
|
165
|
-
get transition() {
|
|
166
|
-
let options = {
|
|
167
|
-
name: 'overlay-transition--fade',
|
|
168
|
-
isEnabled: this.isAnimationEnabled
|
|
169
|
-
};
|
|
170
|
-
if (typeof this.args.transition === 'object') {
|
|
171
|
-
return {
|
|
172
|
-
...options,
|
|
173
|
-
...this.args.transition
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
|
-
return options;
|
|
177
|
-
}
|
|
178
|
-
}, setComponentTemplate(precompileTemplate("\n {{!-- template-lint-disable no-invalid-interactive --}}\n {{!-- template-lint-disable no-pointer-down-event-binding --}}\n\n {{#if this.isVisible}}\n <Portal @renderInPlace={{@renderInPlace}} @target={{@target}}>\n <Backdrop @type={{this.backdrop}} @inPlace={{@renderInPlace}} @transition={{this.backdropTransition}} />\n\n {{#if @isOpen}}\n <div {{this.setupContent}} {{on \"click\" this.handleContentClick}} {{on \"keydown\" this.handleKeyDown}} {{on \"mousedown\" this.handleContentMouseDown}} {{cssTransition didTransitionIn=this.transition.didTransitionIn didTransitionOut=this.transition.didTransitionOut enterClass=this.transition.enterClass enterActiveClass=this.transition.enterActiveClass enterToClass=this.transition.enterToClass isEnabled=this.transition.isEnabled leaveClass=this.transition.leaveClass leaveActiveClass=this.transition.leaveActiveClass leaveToClass=this.transition.leaveToClass name=this.transition.name parentSelector=this.transition.parentSelector}} {{onClickOutside this.handleOutsideClick capture=true}} {{focusTrap isActive=(if @disableFocusTrap false @isOpen) focusTrapOptions=this.focusTrapOptions}} class={{this.classes}} {{!-- Keep this custom modifer by last--}} {{this.customContentModifier}} data-component=\"overlay\" tabindex=\"0\" ...attributes>\n {{yield}}\n </div>\n {{/if}}\n </Portal>\n {{/if}}\n ", {
|
|
179
|
-
strictMode: true,
|
|
180
|
-
scope: () => ({
|
|
181
|
-
Portal,
|
|
182
|
-
Backdrop,
|
|
183
|
-
on,
|
|
184
|
-
cssTransition,
|
|
185
|
-
onClickOutside,
|
|
186
|
-
focusTrap
|
|
187
|
-
})
|
|
188
|
-
}), _Overlay), _Overlay), _descriptor = _applyDecoratedDescriptor(_class.prototype, "keepOpen", [tracked], {
|
|
189
|
-
configurable: true,
|
|
190
|
-
enumerable: true,
|
|
191
|
-
writable: true,
|
|
192
|
-
initializer: function () {
|
|
193
|
-
return false;
|
|
194
|
-
}
|
|
195
|
-
}), _applyDecoratedDescriptor(_class.prototype, "handleContentClick", [action], Object.getOwnPropertyDescriptor(_class.prototype, "handleContentClick"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "handleOutsideClick", [action], Object.getOwnPropertyDescriptor(_class.prototype, "handleOutsideClick"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "handleContentMouseDown", [action], Object.getOwnPropertyDescriptor(_class.prototype, "handleContentMouseDown"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "handleKeyDown", [action], Object.getOwnPropertyDescriptor(_class.prototype, "handleKeyDown"), _class.prototype), _class);
|
|
196
|
-
|
|
197
|
-
export { Overlay, Overlay as default };
|
|
1
|
+
import '@glimmer/component';
|
|
2
|
+
import '@glimmer/tracking';
|
|
3
|
+
import '@ember/object';
|
|
4
|
+
import '@ember/runloop';
|
|
5
|
+
import '@ember/modifier';
|
|
6
|
+
import 'ember-css-transitions';
|
|
7
|
+
import '@frontile/theme';
|
|
8
|
+
import 'ember-modifier';
|
|
9
|
+
import 'ember-focus-trap';
|
|
10
|
+
import 'ember-click-outside/modifiers/on-click-outside';
|
|
11
|
+
import './backdrop.js';
|
|
12
|
+
import '../portal-lZU6177n.js';
|
|
13
|
+
import '@embroider/macros';
|
|
14
|
+
import '@ember/template-compilation';
|
|
15
|
+
import '@ember/component';
|
|
16
|
+
export { O as Overlay, O as default } from '../overlay-CtCgH4Fk.js';
|
|
198
17
|
//# sourceMappingURL=overlay.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overlay.js","sources":["../../src/components/overlay.gts"],"sourcesContent":["/* eslint-disable ember/no-runloop */\nimport Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { action } from '@ember/object';\nimport { later } from '@ember/runloop';\nimport { on } from '@ember/modifier';\nimport { cssTransition } from 'ember-css-transitions';\nimport { useStyles } from '@frontile/theme';\nimport { modifier } from 'ember-modifier';\n// @ts-ignore\nimport { focusTrap } from 'ember-focus-trap';\nimport onClickOutside from 'ember-click-outside/modifiers/on-click-outside';\nimport { Backdrop, type BackdropSignature } from './backdrop';\nimport { Portal, findParentPortal, type PortalSignature } from './portal';\nimport { getElementByAttribute } from '../-private/dom';\nimport type { ModifierLike } from '@glint/template';\nimport type { CssTransitionSignature } from 'ember-css-transitions/modifiers/css-transition';\nimport { isTesting, macroCondition } from '@embroider/macros';\n\nfunction hasNestedPortals(element: HTMLElement): boolean {\n const portal = findParentPortal(element);\n if (!portal) {\n return false;\n }\n const childPortal = getElementByAttribute(portal, 'data-portal');\n if (childPortal) {\n return true;\n }\n\n return false;\n}\n\n// finds if the el has a parent with the id `ember-basic-dropdown-wormhole` or a role of `alert`\nfunction hasWormholeOrAlertParentElement(el: HTMLElement) {\n let parent = el.parentElement;\n while (parent) {\n if (\n parent.id === 'ember-basic-dropdown-wormhole' ||\n parent.role === 'alert'\n ) {\n return true;\n }\n parent = parent.parentElement;\n }\n return false;\n}\n\ninterface Args\n extends Pick<PortalSignature['Args'], 'renderInPlace' | 'target'> {\n /**\n * Duration of the animation\n *\n * @defaultValue 200\n */\n transitionDuration?: number;\n\n backdrop?: BackdropSignature['Args']['type'];\n\n backdropTransition?: BackdropSignature['Args']['transition'];\n\n /**\n * Disable css transitions\n *\n * @defaultValue false\n */\n disableTransitions?: boolean;\n\n /**\n * Whether the focus trap is disabled or not\n *\n * @defaultValue false\n */\n disableFocusTrap?: boolean;\n\n /**\n * Focus trap options\n *\n * @defaultValue { clickOutsideDeactivates: true, allowOutsideClick: true }\n */\n focusTrapOptions?: unknown;\n\n /**\n * Whether it is open or not\n */\n isOpen: boolean;\n\n /**\n * A function that will be called when closed\n */\n onClose?: () => void;\n\n /**\n * A function that will be called when closing is finished executing, this\n * includes waiting for animations/transitions to finish.\n */\n didClose?: () => void;\n\n /**\n * A function that will be called when opened\n */\n onOpen?: () => void;\n\n /**\n * Whether to close when the area outside (the backdrop) is clicked\n *\n * @defaultValue true\n */\n closeOnOutsideClick?: boolean;\n\n /**\n * Whether to close when the overlay element is clicked, used for modal and drawer components.\n *\n * @defaultValue false\n */\n closeOnOverlayElementClick?: boolean;\n\n /**\n * Whether to close when the escape key is pressed\n *\n * @defaultValue true\n */\n closeOnEscapeKey?: boolean;\n\n /**\n * Transition options\n *\n * @defaultValue {name:'overlay-transition--fade'}\n */\n transition?: CssTransitionSignature['Args']['Named'];\n\n disableFlexContent?: boolean;\n customContentModifier?: ModifierLike<{ Element: HTMLElement }>;\n class?: string;\n /**\n * @defaultValue false\n */\n preventFocusRestore?: boolean;\n\n /**\n * @defaultValue true\n */\n blockScroll?: boolean;\n}\n\ninterface OverlaySignature {\n Args: Args;\n Element: HTMLDivElement;\n Blocks: { default: [] };\n}\n\nclass Overlay extends Component<OverlaySignature> {\n @tracked keepOpen = false;\n\n contentElement: HTMLElement | undefined;\n focusedElement: Element | null | undefined;\n mouseDownContentElement: EventTarget | null = null;\n\n handleClose(): void {\n if (this.args.isOpen && typeof this.args.onClose === 'function') {\n this.args.onClose();\n }\n }\n\n @action handleContentClick(event: MouseEvent): void {\n if (\n this.args.closeOnOutsideClick !== false &&\n this.args.closeOnOverlayElementClick === true &&\n event.target === this.contentElement &&\n this.mouseDownContentElement == this.contentElement &&\n !hasNestedPortals(this.contentElement) &&\n !hasWormholeOrAlertParentElement(event.target as HTMLElement)\n ) {\n this.handleClose();\n }\n this.mouseDownContentElement = null;\n }\n\n @action handleOutsideClick(e: Event): void {\n if (\n this.args.closeOnOutsideClick !== false &&\n this.contentElement &&\n !hasNestedPortals(this.contentElement) &&\n !hasWormholeOrAlertParentElement(e.target as HTMLElement)\n ) {\n this.handleClose();\n e.preventDefault();\n }\n }\n\n @action\n handleContentMouseDown(event: MouseEvent): void {\n if (this.args.closeOnOverlayElementClick === true) {\n this.mouseDownContentElement = event.target;\n }\n }\n\n @action\n handleKeyDown(event: KeyboardEvent): void {\n if (event.key === 'Escape' && this.args.closeOnEscapeKey !== false) {\n this.handleClose();\n event.preventDefault();\n event.stopImmediatePropagation();\n }\n }\n\n setupContent = modifier((el: HTMLDivElement) => {\n let transitionDuration = this.args.transitionDuration || 200;\n if (!this.isAnimationEnabled) {\n transitionDuration = 0;\n }\n later(() => {\n if (this.isDestroyed) return;\n if (this.args.disableFocusTrap !== true) return;\n el.focus();\n }, transitionDuration);\n\n this.contentElement = el;\n this.keepOpen = true;\n this.focusedElement = document.activeElement;\n\n if (this.args.renderInPlace !== true && this.args.blockScroll !== false) {\n document.body.style.overflow = 'hidden';\n }\n\n if (typeof this.args.onOpen === 'function') {\n this.args.onOpen();\n }\n return () => {\n this.contentElement = undefined;\n\n if (this.args.renderInPlace !== true && this.args.blockScroll !== false) {\n document.body.style.overflow = '';\n }\n\n const { didClose } = this.args;\n later(() => {\n if (!this.isDestroyed) this.keepOpen = false;\n if (typeof didClose === 'function' && !this.isDestroyed) {\n didClose();\n }\n\n // restore focus\n if (\n !this.args.preventFocusRestore &&\n this.focusedElement &&\n (this.focusedElement as HTMLElement).tabIndex > -1 &&\n typeof (this.focusedElement as HTMLElement).focus !== 'undefined'\n ) {\n (this.focusedElement as HTMLElement).focus();\n }\n }, transitionDuration);\n };\n });\n\n get isVisible(): boolean {\n return this.args.isOpen || this.keepOpen;\n }\n\n get backdrop(): BackdropSignature['Args']['type'] {\n if (!this.args.isOpen) {\n return 'none';\n }\n return this.args.backdrop || 'faded';\n }\n\n get isAnimationEnabled(): boolean {\n if (macroCondition(isTesting())) {\n return false;\n }\n return !(this.args.disableTransitions === true);\n }\n\n get focusTrapOptions(): unknown {\n return (\n this.args.focusTrapOptions || {\n clickOutsideDeactivates: true,\n allowOutsideClick: true\n }\n );\n }\n\n get classes() {\n const { overlay } = useStyles();\n\n return overlay({\n class: this.args.class,\n inPlace: this.args.renderInPlace,\n enableFlexContent: !(this.args.disableFlexContent === true)\n });\n }\n\n get customContentModifier() {\n if (this.args.customContentModifier) {\n return this.args.customContentModifier;\n }\n\n return modifier(() => {});\n }\n\n get backdropTransition() {\n if (this.args.backdropTransition) {\n return this.args.backdropTransition;\n }\n\n return { isEnabled: this.isAnimationEnabled };\n }\n\n get transition() {\n let options: BackdropSignature['Args']['transition'] = {\n name: 'overlay-transition--fade',\n isEnabled: this.isAnimationEnabled\n };\n\n if (typeof this.args.transition === 'object') {\n return { ...options, ...this.args.transition };\n }\n\n return options;\n }\n\n <template>\n {{! template-lint-disable no-invalid-interactive }}\n {{! template-lint-disable no-pointer-down-event-binding }}\n\n {{#if this.isVisible}}\n <Portal @renderInPlace={{@renderInPlace}} @target={{@target}}>\n <Backdrop\n @type={{this.backdrop}}\n @inPlace={{@renderInPlace}}\n @transition={{this.backdropTransition}}\n />\n\n {{#if @isOpen}}\n <div\n {{this.setupContent}}\n {{on \"click\" this.handleContentClick}}\n {{on \"keydown\" this.handleKeyDown}}\n {{on \"mousedown\" this.handleContentMouseDown}}\n {{cssTransition\n didTransitionIn=this.transition.didTransitionIn\n didTransitionOut=this.transition.didTransitionOut\n enterClass=this.transition.enterClass\n enterActiveClass=this.transition.enterActiveClass\n enterToClass=this.transition.enterToClass\n isEnabled=this.transition.isEnabled\n leaveClass=this.transition.leaveClass\n leaveActiveClass=this.transition.leaveActiveClass\n leaveToClass=this.transition.leaveToClass\n name=this.transition.name\n parentSelector=this.transition.parentSelector\n }}\n {{onClickOutside this.handleOutsideClick capture=true}}\n {{focusTrap\n isActive=(if @disableFocusTrap false @isOpen)\n focusTrapOptions=this.focusTrapOptions\n }}\n class={{this.classes}}\n {{! Keep this custom modifer by last}}\n {{this.customContentModifier}}\n data-component=\"overlay\"\n tabindex=\"0\"\n ...attributes\n >\n {{yield}}\n </div>\n {{/if}}\n </Portal>\n {{/if}}\n </template>\n}\n\nexport { Overlay, type OverlaySignature };\nexport default Overlay;\n"],"names":["hasNestedPortals","element","portal","findParentPortal","childPortal","getElementByAttribute","hasWormholeOrAlertParentElement","el","parent","parentElement","id","role","Overlay","Component","constructor","args","_initializerDefineProperty","_descriptor","_defineProperty","modifier","transitionDuration","isAnimationEnabled","later","isDestroyed","disableFocusTrap","focus","contentElement","keepOpen","focusedElement","document","activeElement","renderInPlace","blockScroll","body","style","overflow","onOpen","undefined","didClose","preventFocusRestore","tabIndex","handleClose","isOpen","onClose","handleContentClick","event","closeOnOutsideClick","closeOnOverlayElementClick","target","mouseDownContentElement","handleOutsideClick","e","preventDefault","handleContentMouseDown","handleKeyDown","key","closeOnEscapeKey","stopImmediatePropagation","isVisible","backdrop","macroCondition","isTesting","disableTransitions","focusTrapOptions","clickOutsideDeactivates","allowOutsideClick","classes","overlay","useStyles","class","inPlace","enableFlexContent","disableFlexContent","customContentModifier","backdropTransition","isEnabled","transition","options","name","setComponentTemplate","precompileTemplate","strictMode","scope","Portal","Backdrop","on","cssTransition","onClickOutside","focusTrap","_Overlay","_applyDecoratedDescriptor","_class","prototype","tracked","configurable","enumerable","writable","init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