@ember-eui/core 5.12.6 → 5.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -149,6 +149,10 @@ export type EuiPopoverArgs = {
149
149
  'aria-labelledby'?: string;
150
150
 
151
151
  tabindex?: string | number;
152
+
153
+ focusTrapOptions?: {
154
+ onClickOutside?: (e: Event) => void;
155
+ };
152
156
  };
153
157
 
154
158
  type AnchorPosition = 'up' | 'right' | 'down' | 'left';
@@ -296,10 +300,14 @@ export default class EuiPopoverComponent extends Component<EuiPopoverArgs> {
296
300
 
297
301
  @action
298
302
  onClickOutside(event: Event): void {
299
- // only close the popover if the event source isn't the anchor button
300
- // otherwise, it is up to the anchor to toggle the popover's open status
301
- if (this.button && this.button.contains(event.target as Node) === false) {
302
- this.closePopover();
303
+ if (this.args.focusTrapOptions?.onClickOutside) {
304
+ this.args.focusTrapOptions.onClickOutside(event);
305
+ } else {
306
+ // only close the popover if the event source isn't the anchor button
307
+ // otherwise, it is up to the anchor to toggle the popover's open status
308
+ if (this.button && this.button.contains(event.target as Node) === false) {
309
+ this.closePopover();
310
+ }
303
311
  }
304
312
  }
305
313
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ember-eui/core",
3
- "version": "5.12.6",
3
+ "version": "5.14.0",
4
4
  "description": "Ember Components for Elastic UI",
5
5
  "keywords": [
6
6
  "ember-addon",
@@ -63,6 +63,7 @@
63
63
  "ember-cached-decorator-polyfill": "^0.1.4",
64
64
  "ember-cli-babel": "^7.26.11",
65
65
  "ember-cli-htmlbars": "^6.0.1",
66
+ "ember-cli-string-helpers": "^6.1.0",
66
67
  "ember-cli-typescript": "4.2.1",
67
68
  "ember-composable-helpers": "^4.4.1",
68
69
  "ember-element-helper": "^0.6.0",
@@ -137,7 +138,6 @@
137
138
  "ember-cli-inject-live-reload": "^2.1.0",
138
139
  "ember-cli-netlify": "^0.4.1",
139
140
  "ember-cli-sri": "^2.1.1",
140
- "ember-cli-string-helpers": "^6.1.0",
141
141
  "ember-cli-terser": "^4.0.2",
142
142
  "ember-cli-typescript-blueprints": "^3.0.0",
143
143
  "ember-disable-prototype-extensions": "^1.1.3",
@@ -186,5 +186,5 @@
186
186
  "volta": {
187
187
  "extends": "../../package.json"
188
188
  },
189
- "gitHead": "5f9f20f5e0df1bacb65469314440bfa806767edd"
189
+ "gitHead": "edae1f225594be9f1ac0eafdb9c25e9409984d5c"
190
190
  }