@frontile/overlays 0.17.0-beta.5 → 0.17.0-beta.7

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.
Files changed (38) hide show
  1. package/declarations/components/overlay.d.ts +5 -0
  2. package/declarations/components/overlay.d.ts.map +1 -1
  3. package/declarations/components/popover.d.ts +12 -3
  4. package/declarations/components/popover.d.ts.map +1 -1
  5. package/dist/components/backdrop.js +8 -8
  6. package/dist/components/backdrop.js.map +1 -1
  7. package/dist/components/drawer/body.js +10 -9
  8. package/dist/components/drawer/body.js.map +1 -1
  9. package/dist/components/drawer/footer.js +10 -9
  10. package/dist/components/drawer/footer.js.map +1 -1
  11. package/dist/components/drawer/header.js +10 -9
  12. package/dist/components/drawer/header.js.map +1 -1
  13. package/dist/components/drawer.js +15 -19
  14. package/dist/components/drawer.js.map +1 -1
  15. package/dist/components/modal/body.js +10 -9
  16. package/dist/components/modal/body.js.map +1 -1
  17. package/dist/components/modal/footer.js +10 -9
  18. package/dist/components/modal/footer.js.map +1 -1
  19. package/dist/components/modal/header.js +10 -9
  20. package/dist/components/modal/header.js.map +1 -1
  21. package/dist/components/modal.js +15 -19
  22. package/dist/components/modal.js.map +1 -1
  23. package/dist/components/overlay.js +16 -197
  24. package/dist/components/overlay.js.map +1 -1
  25. package/dist/components/popover.js +159 -128
  26. package/dist/components/popover.js.map +1 -1
  27. package/dist/components/portal.js +1 -2
  28. package/dist/components/portal.js.map +1 -1
  29. package/dist/index.js +2 -2
  30. package/dist/overlay-DoxxotyF.js +270 -0
  31. package/dist/overlay-DoxxotyF.js.map +1 -0
  32. package/dist/{portal-Es7o21X5.js → portal-CGKQ_924.js} +18 -22
  33. package/dist/{portal-Es7o21X5.js.map → portal-CGKQ_924.js.map} +1 -1
  34. package/package.json +41 -44
  35. package/declarations/portal-Es7o21X5.d.ts +0 -5
  36. package/declarations/portal-Es7o21X5.d.ts.map +0 -1
  37. package/dist/portal-D1N7TxUb.js +0 -167
  38. package/dist/portal-D1N7TxUb.js.map +0 -1
@@ -1,198 +1,17 @@
1
- import _initializerDefineProperty from '@babel/runtime/helpers/esm/initializerDefineProperty';
2
- import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
3
- import _applyDecoratedDescriptor from '@babel/runtime/helpers/esm/applyDecoratedDescriptor';
4
- import '@babel/runtime/helpers/esm/initializerWarningHelper';
5
- import Component from '@glimmer/component';
6
- import { tracked } from '@glimmer/tracking';
7
- import { action } from '@ember/object';
8
- import { later } from '@ember/runloop';
9
- import { on } from '@ember/modifier';
10
- import { cssTransition } from 'ember-css-transitions';
11
- import { useStyles } from '@frontile/theme';
12
- import { modifier } from 'ember-modifier';
13
- import { focusTrap } from 'ember-focus-trap';
14
- import onClickOutside from 'ember-click-outside/modifiers/on-click-outside';
15
- import { Backdrop } from './backdrop.js';
16
- import { P as Portal, f as findParentPortal, g as getElementByAttribute } from '../portal-Es7o21X5.js';
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-CGKQ_924.js';
13
+ import '@embroider/macros';
14
+ import '@ember/template-compilation';
15
+ import '@ember/component';
16
+ export { O as Overlay, O as default } from '../overlay-DoxxotyF.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","initializer","action","Object","getOwnPropertyDescriptor"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAmBA,SAASA,gBAAiBA,CAAAC,OAAoB,EAAU;AACtD,EAAA,MAAMC,SAASC,gBAAiB,CAAAF,OAAA,CAAA;EAChC,I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;AAAAC,EAAAA,WAAA,cAAA;AAAA,IAAA,OAAmB,KAAM;AAAA;AAAA,CAAA,CAAA,EAAAP,yBAAA,CAAAC,MAAA,CAAAC,SAAA,yBAYzBM,MAAA,CAAA,EAAAC,MAAA,CAAAC,wBAAA,CAAAT,MAAA,CAAAC,SAAA,EAAA,oBAAA,CAAA,EAAAD,MAAA,CAAAC,SAAA,CAAAF,EAAAA,yBAAA,CAAAC,MAAA,CAAAC,SAAA,EAAA,oBAAA,EAAA,CAcAM,MAAA,CAAAC,EAAAA,MAAA,CAAAC,wBAAA,CAAAT,MAAA,CAAAC,SAAA,EAAAD,oBAAAA,CAAAA,EAAAA,MAAA,CAAAC,SAAA,CAAA,EAAAF,yBAAA,CAAAC,MAAA,CAAAC,SAAA,EAYAM,wBAAAA,EAAAA,CAAAA,MAAA,GAAAC,MAAA,CAAAC,wBAAA,CAAAT,MAAA,CAAAC,SAAA,6BAAAD,MAAA,CAAAC,SAAA,CAAAF,EAAAA,yBAAA,CAAAC,MAAA,CAAAC,SAAA,EAAA,eAAA,EAAA,CAOAM,MAAA,CAAA,EAAAC,MAAA,CAAAC,wBAAA,CAAAT,MAAA,CAAAC,SAAA,EAAA,eAAA,CAAA,EAAAD,MAAA,CAAAC,SAAA,GAAAD,MAAA;;;;"}
1
+ {"version":3,"file":"overlay.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;"}
@@ -1,9 +1,5 @@
1
- import _initializerDefineProperty from '@babel/runtime/helpers/esm/initializerDefineProperty';
2
- import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
3
- import _applyDecoratedDescriptor from '@babel/runtime/helpers/esm/applyDecoratedDescriptor';
4
- import '@babel/runtime/helpers/esm/initializerWarningHelper';
5
1
  import Component from '@glimmer/component';
6
- import { Overlay } from './overlay.js';
2
+ import { d as decorateFieldV2, i as initializeDeferredDecorator, O as Overlay } from '../overlay-DoxxotyF.js';
7
3
  import { tracked } from '@glimmer/tracking';
8
4
  import { Velcro } from 'ember-velcro';
9
5
  import { assert } from '@ember/debug';
@@ -15,138 +11,159 @@ import { debounce } from '@ember/runloop';
15
11
  import { precompileTemplate } from '@ember/template-compilation';
16
12
  import { setComponentTemplate } from '@ember/component';
17
13
 
18
- var _class, _descriptor, _descriptor2, _descriptor3, _Popover, _Content;
19
- let Popover = (_class = (_Popover = class Popover extends Component {
20
- constructor(...args) {
21
- super(...args);
22
- _defineProperty(this, "triggerEl", void 0);
23
- _defineProperty(this, "menuId", guidFor(this));
24
- _initializerDefineProperty(this, "_isOpen", _descriptor, this);
25
- _initializerDefineProperty(this, "isClosing", _descriptor2, this);
26
- _initializerDefineProperty(this, "preventFocusRestore", _descriptor3, this);
27
- _defineProperty(this, "toggle", event => {
28
- // stops event bubbling to prevent parent click event
29
- if (typeof event?.stopPropagation === 'function') {
14
+ class Popover extends Component {
15
+ triggerEl;
16
+ menuId = guidFor(this);
17
+ static {
18
+ decorateFieldV2(this.prototype, "_isOpen", [tracked], function () {
19
+ return false;
20
+ });
21
+ }
22
+ #_isOpen = (initializeDeferredDecorator(this, "_isOpen"), void 0);
23
+ static {
24
+ decorateFieldV2(this.prototype, "isClosing", [tracked], function () {
25
+ return false;
26
+ });
27
+ }
28
+ #isClosing = (initializeDeferredDecorator(this, "isClosing"), void 0);
29
+ static {
30
+ decorateFieldV2(this.prototype, "preventFocusRestore", [tracked], function () {
31
+ return false;
32
+ });
33
+ }
34
+ #preventFocusRestore = (initializeDeferredDecorator(this, "preventFocusRestore"), void 0);
35
+ static {
36
+ decorateFieldV2(this.prototype, "triggerWidth", [tracked]);
37
+ }
38
+ #triggerWidth = (initializeDeferredDecorator(this, "triggerWidth"), void 0);
39
+ get isOpen() {
40
+ if (typeof this.args.isOpen !== 'undefined' && typeof this.args.onOpenChange === 'function') {
41
+ return this.args.isOpen;
42
+ }
43
+ return this._isOpen;
44
+ }
45
+ toggle = event => {
46
+ // stops event bubbling to prevent parent click event
47
+ if (typeof event?.stopPropagation === 'function') {
48
+ event.stopPropagation();
49
+ }
50
+ if (this.isOpen) {
51
+ this.close();
52
+ } else {
53
+ this.open();
54
+ }
55
+ };
56
+ open = () => {
57
+ if (this.isClosing) {
58
+ return;
59
+ }
60
+ if (typeof this.args.onOpenChange === 'function') {
61
+ this.args.onOpenChange(true);
62
+ } else {
63
+ this._isOpen = true;
64
+ }
65
+ };
66
+ close = () => {
67
+ this.isClosing = true;
68
+ if (typeof this.args.onOpenChange === 'function') {
69
+ this.args.onOpenChange(false);
70
+ } else {
71
+ this._isOpen = false;
72
+ }
73
+ if (typeof this.args.didClose === 'function') {
74
+ this.args.didClose();
75
+ }
76
+ debounce(this, this.didClose, 90);
77
+ };
78
+ trigger = modifier((el, [eventType]) => {
79
+ this.triggerEl = el;
80
+ requestAnimationFrame(() => {
81
+ this.triggerWidth = Math.round(el.offsetWidth);
82
+ });
83
+ let observer;
84
+ if (eventType !== 'hover') {
85
+ observer = new ResizeObserver(entries => {
86
+ for (let entry of entries) {
87
+ this.triggerWidth = Math.round(entry.target.offsetWidth);
88
+ }
89
+ });
90
+ observer.observe(el);
91
+ }
92
+ const debounceDuration = 100;
93
+ const open = () => {
94
+ debounce(this, this.open, debounceDuration);
95
+ };
96
+ const close = () => {
97
+ debounce(this, this.close, debounceDuration);
98
+ };
99
+ const onKeydown = event => {
100
+ if (this.isOpen && event.key === 'Escape') {
101
+ this.close();
30
102
  event.stopPropagation();
31
103
  }
32
- if (this.isOpen) {
33
- this.close();
34
- } else {
104
+ if (!this.isOpen && (event.key === 'ArrowDown' || event.key === 'ArrowUp')) {
35
105
  this.open();
106
+ event.stopPropagation();
36
107
  }
37
- });
38
- _defineProperty(this, "open", () => {
39
- if (this.isClosing) {
40
- return;
41
- }
42
- if (typeof this.args.onOpenChange === 'function') {
43
- this.args.onOpenChange(true);
44
- } else {
45
- this._isOpen = true;
46
- }
47
- });
48
- _defineProperty(this, "close", () => {
49
- this.isClosing = true;
50
- if (typeof this.args.onOpenChange === 'function') {
51
- this.args.onOpenChange(false);
52
- } else {
53
- this._isOpen = false;
108
+ if (this.isOpen && event.key === 'Tab') {
109
+ this.preventFocusRestore = true;
110
+ this.close();
54
111
  }
55
- if (typeof this.args.didClose === 'function') {
56
- this.args.didClose();
112
+ // Open when a letter is pressed
113
+ if (!this.isOpen && event.code === `Key${event.key.toUpperCase()}`) {
114
+ this.open();
57
115
  }
58
- debounce(this, this.didClose, 90);
59
- });
60
- _defineProperty(this, "trigger", modifier((el, [eventType]) => {
61
- this.triggerEl = el;
62
- const debounceDuration = 100;
63
- const open = () => {
64
- debounce(this, this.open, debounceDuration);
65
- };
66
- const close = () => {
67
- debounce(this, this.close, debounceDuration);
68
- };
116
+ };
117
+ if (eventType === 'hover') {
118
+ this.preventFocusRestore = true;
119
+ el.addEventListener('mouseenter', open);
120
+ el.addEventListener('mouseleave', close);
121
+ } else {
122
+ el.addEventListener('keydown', onKeydown);
123
+ el.addEventListener('click', this.toggle);
124
+ }
125
+ el.setAttribute('aria-haspopup', 'true');
126
+ el.setAttribute('aria-controls', this.menuId);
127
+ el.setAttribute('aria-expanded', this.isOpen.toString());
128
+ return () => {
69
129
  if (eventType === 'hover') {
70
- this.preventFocusRestore = true;
71
- el.addEventListener('mouseenter', open);
72
- el.addEventListener('mouseleave', close);
130
+ el.removeEventListener('mouseenter', open);
131
+ el.removeEventListener('mouseleave', close);
73
132
  } else {
74
- el.addEventListener('click', this.toggle);
133
+ el.removeEventListener('click', this.toggle);
134
+ el.removeEventListener('keydown', onKeydown);
75
135
  }
76
- el.setAttribute('aria-haspopup', 'true');
77
- el.setAttribute('aria-controls', this.menuId);
78
- el.setAttribute('aria-expanded', this.isOpen.toString());
79
- return () => {
80
- if (eventType === 'hover') {
81
- el.removeEventListener('mouseenter', open);
82
- el.removeEventListener('mouseleave', close);
83
- } else {
84
- el.removeEventListener('click', this.toggle);
85
- }
86
- this.triggerEl = undefined;
87
- };
88
- }));
89
- _defineProperty(this, "updateAriaExtanded", modifier(_ => {
90
- if (this.triggerEl) {
91
- this.triggerEl.setAttribute('aria-expanded', this.isOpen.toString());
136
+ if (observer) {
137
+ observer.disconnect();
92
138
  }
93
- }));
94
- _defineProperty(this, "didClose", () => {
95
- if (!this.isDestroyed || !this.isDestroying) {
96
- this.isClosing = false;
97
- }
98
- });
99
- }
100
- get isOpen() {
101
- if (typeof this.args.isOpen !== 'undefined' && typeof this.args.onOpenChange === 'function') {
102
- return this.args.isOpen;
139
+ this.triggerEl = undefined;
140
+ };
141
+ });
142
+ updateAriaExtanded = modifier(_ => {
143
+ if (this.triggerEl) {
144
+ this.triggerEl.setAttribute('aria-expanded', this.isOpen.toString());
103
145
  }
104
- return this._isOpen;
105
- }
106
- }, setComponentTemplate(precompileTemplate("\n <Velcro @placement={{if @placement @placement \"bottom-start\"}} @strategy={{if @strategy @strategy \"absolute\"}} @offsetOptions={{if @offsetOptions @offsetOptions 5}} @flipOptions={{@flipOptions}} @middleware={{@middleware}} @shiftOptions={{@shiftOptions}} as |velcro|>\n {{yield (hash anchor=velcro.hook isOpen=this.isOpen open=this.open close=this.close toggle=this.toggle trigger=this.trigger Content=(component Content id=this.menuId loop=velcro.loop isOpen=this.isOpen toggle=this.toggle internalDidClose=this.didClose preventFocusRestore=this.preventFocusRestore))}}\n </Velcro>\n ", {
107
- strictMode: true,
108
- scope: () => ({
109
- Velcro,
110
- hash,
111
- Content
112
- })
113
- }), _Popover), _Popover), _descriptor = _applyDecoratedDescriptor(_class.prototype, "_isOpen", [tracked], {
114
- configurable: true,
115
- enumerable: true,
116
- writable: true,
117
- initializer: function () {
118
- return false;
119
- }
120
- }), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, "isClosing", [tracked], {
121
- configurable: true,
122
- enumerable: true,
123
- writable: true,
124
- initializer: function () {
125
- return false;
126
- }
127
- }), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, "preventFocusRestore", [tracked], {
128
- configurable: true,
129
- enumerable: true,
130
- writable: true,
131
- initializer: function () {
132
- return false;
146
+ });
147
+ didClose = () => {
148
+ if (!this.isDestroyed || !this.isDestroying) {
149
+ this.isClosing = false;
150
+ }
151
+ };
152
+ static {
153
+ setComponentTemplate(precompileTemplate("\n <Velcro @placement={{if @placement @placement \"bottom-start\"}} @strategy={{if @strategy @strategy \"absolute\"}} @offsetOptions={{if @offsetOptions @offsetOptions 5}} @flipOptions={{@flipOptions}} @middleware={{@middleware}} @shiftOptions={{@shiftOptions}} as |velcro|>\n {{yield (hash anchor=velcro.hook isOpen=this.isOpen open=this.open close=this.close toggle=this.toggle trigger=this.trigger Content=(component Content id=this.menuId loop=velcro.loop isOpen=this.isOpen toggle=this.toggle internalDidClose=this.didClose preventFocusRestore=this.preventFocusRestore triggerWidth=this.triggerWidth))}}\n </Velcro>\n ", {
154
+ strictMode: true,
155
+ scope: () => ({
156
+ Velcro,
157
+ hash,
158
+ Content
159
+ })
160
+ }), this);
133
161
  }
134
- }), _class);
162
+ }
135
163
  /**
136
164
  * Component yielded from Popover
137
165
  */
138
166
  class Content extends Component {
139
- constructor(...args) {
140
- super(...args);
141
- _defineProperty(this, "didClose", () => {
142
- if (typeof this.args.internalDidClose === 'function') {
143
- this.args.internalDidClose();
144
- }
145
- if (typeof this.args.didClose === 'function') {
146
- this.args.didClose();
147
- }
148
- });
149
- }
150
167
  get loop() {
151
168
  assert('The Popover is not properly configured; the @loop is undefined. This issue may arise from failing to set up the anchor.', this.args.loop);
152
169
  return this.args.loop;
@@ -187,14 +204,28 @@ class Content extends Component {
187
204
  }
188
205
  return true;
189
206
  }
207
+ didClose = () => {
208
+ if (typeof this.args.internalDidClose === 'function') {
209
+ this.args.internalDidClose();
210
+ }
211
+ if (typeof this.args.didClose === 'function') {
212
+ this.args.didClose();
213
+ }
214
+ };
215
+ updateTriggerWidth = modifier(el => {
216
+ if (el && this.args.triggerWidth) {
217
+ el.style.setProperty('--trigger-width', `${this.args.triggerWidth}px`);
218
+ }
219
+ });
220
+ static {
221
+ setComponentTemplate(precompileTemplate("\n <Overlay @blockScroll={{this.blockScroll}} @transition={{this.transition}} @backdrop={{this.backdrop}} @customContentModifier={{this.loop}} @disableFlexContent={{true}} @isOpen={{@isOpen}} @onClose={{@toggle}} @onOpen={{@onOpen}} @didClose={{this.didClose}} @renderInPlace={{@renderInPlace}} @target={{@target}} @transitionDuration={{@transitionDuration}} @disableTransitions={{@disableTransitions}} @disableFocusTrap={{this.disableFocusTrap}} @focusTrapOptions={{@focusTrapOptions}} @closeOnOutsideClick={{@closeOnOutsideClick}} @closeOnEscapeKey={{@closeOnEscapeKey}} @backdropTransition={{@backdropTransition}} @class={{this.classNames}} @preventFocusRestore={{@preventFocusRestore}} @preventAutoFocus={{@preventAutoFocus}} id={{@id}} ...attributes {{this.updateTriggerWidth @triggerWidth}}>\n {{yield}}\n </Overlay>\n ", {
222
+ strictMode: true,
223
+ scope: () => ({
224
+ Overlay
225
+ })
226
+ }), this);
227
+ }
190
228
  }
191
- _Content = Content;
192
- setComponentTemplate(precompileTemplate("\n <Overlay @blockScroll={{this.blockScroll}} @transition={{this.transition}} @backdrop={{this.backdrop}} @customContentModifier={{this.loop}} @disableFlexContent={{true}} @isOpen={{@isOpen}} @onClose={{@toggle}} @onOpen={{@onOpen}} @didClose={{this.didClose}} @renderInPlace={{@renderInPlace}} @target={{@target}} @transitionDuration={{@transitionDuration}} @disableTransitions={{@disableTransitions}} @disableFocusTrap={{this.disableFocusTrap}} @focusTrapOptions={{@focusTrapOptions}} @closeOnOutsideClick={{@closeOnOutsideClick}} @closeOnEscapeKey={{@closeOnEscapeKey}} @backdropTransition={{@backdropTransition}} @class={{this.classNames}} @preventFocusRestore={{@preventFocusRestore}} id={{@id}} ...attributes>\n {{yield}}\n </Overlay>\n ", {
193
- strictMode: true,
194
- scope: () => ({
195
- Overlay
196
- })
197
- }), _Content);
198
229
 
199
230
  export { Popover, Popover as default };
200
231
  //# sourceMappingURL=popover.js.map