@workday/canvas-kit-popup-stack 7.0.0-alpha.0-next.3 → 7.0.0-alpha.0-next.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.
@@ -1,6 +1,13 @@
1
1
  "use strict";
2
- function __export(m) {
3
- for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
4
- }
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
5
12
  Object.defineProperty(exports, "__esModule", { value: true });
6
- __export(require("./lib/PopupStack"));
13
+ __exportStar(require("./lib/PopupStack"), exports);
@@ -142,96 +142,6 @@ export declare function resetStack(): void;
142
142
  *
143
143
  * @param adapter The parts of the PopupStack that we want to override
144
144
  */
145
- export declare const createAdapter: (adapter: Partial<{
146
- /**
147
- * Create a HTMLElement as the container for the popup stack item. The returned element reference
148
- * will be the reference to be passed to all other methods. The Popup Stack will control when this
149
- * element is added and removed from the DOM as well as the `z-index` style property. Your content
150
- * should be added to this element.
151
- */
152
- createContainer(): HTMLElement;
153
- /**
154
- * Adds a PopupStackItem to the stack. This should only be called when the item is rendered to the
155
- * page. Z-indexes are set when the item is added to the stack. If your application requires
156
- * popups to be registered initially, but rendered when the user triggers some event, call this
157
- * method when the event triggers.
158
- */
159
- add(item: PopupStackItem): void;
160
- /**
161
- * Removes an item from a stack by its `HTMLElement` reference. This should be called when a popup
162
- * is "closed" or when the element is removed from the page entirely to ensure proper memory
163
- * cleanup. A popup will be removed from the stack it is a part of. This will not automatically be
164
- * called when the element is removed from the DOM. This method will reset z-index values of the
165
- * stack.
166
- */
167
- remove(element: HTMLElement): void;
168
- /**
169
- * Returns true when the provided `element` is at the top of the stack. It will return false if it
170
- * is not the top of the stack or is not found in the stack. The `element` should be the same
171
- * reference that was passed to `add`
172
- */
173
- isTopmost(element: HTMLElement): boolean;
174
- /**
175
- * Returns an array of elements defined by the `element` passed to `add`. This method return
176
- * elements in the order of lowest z-index to highest z-index. Some popup behaviors will need to
177
- * make decisions based on z-index order.
178
- */
179
- getElements(stackOverride?: Stack | undefined): HTMLElement[];
180
- /**
181
- * Bring the element to the top of the stack. This is useful for persistent popups to place them
182
- * on top of the stack when clicked. If an `owner` was provided to an item when it was added and
183
- * that owner is a DOM child of another item in the stack, that item will be considered a "parent"
184
- * to this item. If the previous are true, all "children" stack items will be brought to top as
185
- * well and will be on top of the element passed to `bringToTop`. This maintains stack item
186
- * "hierarchy" so that stack items like Popups and Tooltips don't get pushed behind elements they
187
- * are supposed to be on top of.
188
- *
189
- * This does not need to be called when a popup is added since added popups are already place on
190
- * the top of the stack.
191
- */
192
- bringToTop(element: HTMLElement): void;
193
- /**
194
- * Compares a Popup by its element reference against the event target and the stack. An event
195
- * target is considered to be "contained" by an element under the following conditions:
196
- * - The `eventTarget` is a DOM child of the popup element
197
- * - The `eventTarget` is the `owner` element passed when it was added to the stack
198
- * - The `eventTarget` is a DOM child of the `owner` element
199
- *
200
- * This method should be used instead of `element.contains` so that clicking a popup target can
201
- * opt-in to toggling. Otherwise there is no way to opt-out of toggle behavior (because the target
202
- * is not inside `element`).
203
- */
204
- contains(element: HTMLElement, eventTarget: HTMLElement): boolean;
205
- /**
206
- * Add a new stack context for popups. This method could be called with the same element multiple
207
- * times, but should only push a new stack context once. The most common use-case for calling
208
- * `pushStackContext` is when entering fullscreen, but multiple fullscreen listeners could be
209
- * pushing the same element which is very difficult to ensure only one stack is used. To mitigate,
210
- * this method filters out multiple calls to push the same element as a new stack context.
211
- */
212
- pushStackContext(container: HTMLElement): void;
213
- /**
214
- * Remove the topmost stack context. The stack context will only be removed if the top stack
215
- * context container element matches to guard against accidental remove of other stack contexts
216
- * you don't own.
217
- */
218
- popStackContext(container: HTMLElement): void;
219
- /**
220
- * Transfer the popup stack item into the current popup stack context.
221
- *
222
- * An example might be a popup
223
- * that is opened and an element goes into fullscreen. The default popup stack context is
224
- * `document.body`, but the [Fullscreen
225
- * API](https://developer.mozilla.org/en-US/docs/Web/API/Fullscreen_API) will only render elements
226
- * that are children of the fullscreen element. If the popup isn't transferred to the current
227
- * popup stack context, the popup will remain open, but will no longer be rendered. This method
228
- * will transfer that popup to the fullscreen element so that it will render. Popups created while
229
- * in a fullscreen context that need to be transferred back when fullscreen is exited should also
230
- * call this method. While popups may still render when fullscreen is exited, popups will be
231
- * members of different popup stack contexts which will cause unspecified results (like the escape
232
- * key will choose the wrong popup as the "topmost").
233
- */
234
- transferToCurrentContext(item: PopupStackItem): void;
235
- }>) => void;
145
+ export declare const createAdapter: (adapter: Partial<typeof PopupStack>) => void;
236
146
  export {};
237
147
  //# sourceMappingURL=PopupStack.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PopupStack.d.ts","sourceRoot":"","sources":["../../../lib/PopupStack.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,OAAO,EAAE,WAAW,CAAC;IACrB;;;;;;;;;;;;;;;OAeG;IACH,KAAK,CAAC,EAAE,WAAW,CAAC;CACrB;AASD;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAO9D;AA0DD,UAAU,KAAK;IACb,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,WAAW,CAAC;IAC9B,MAAM,EAAE;QACN,GAAG,EAAE,MAAM,CAAC;QACZ,GAAG,EAAE,MAAM,CAAC;QACZ,QAAQ,EAAE,OAAO,QAAQ,CAAC;KAC3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ACtC;AAwFD,eAAO,MAAM,UAAU;IACrB;;;;;OAKG;uBACgB,WAAW;IAS9B;;;;;OAKG;cACO,cAAc,GAAG,IAAI;IAY/B;;;;;;OAMG;oBACa,WAAW,GAAG,IAAI;IAelC;;;;OAIG;uBACgB,WAAW,GAAG,OAAO;IAaxC;;;;OAIG;oDACiC,WAAW,EAAE;IAQjD;;;;;;;;;;;OAWG;wBACiB,WAAW,GAAG,IAAI;IA6BtC;;;;;;;;;;OAUG;sBACe,WAAW,eAAe,WAAW,GAAG,OAAO;IA2BjE;;;;;;OAMG;gCACyB,WAAW,GAAG,IAAI;IAoB9C;;;;OAIG;+BACwB,WAAW,GAAG,IAAI;IAY7C;;;;;;;;;;;;;;OAcG;mCAC4B,cAAc,GAAG,IAAI;CAqBrD,CAAC;AAEF;;;GAGG;AACH,wBAAgB,UAAU,SAEzB;AAED;;;GAGG;AACH,eAAO,MAAM,aAAa,YAAa,QAAQ,iBAAiB,CAAC,SAEhE,CAAC"}
@@ -10,6 +10,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
10
10
  return (mod && mod.__esModule) ? mod : { "default": mod };
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.createAdapter = exports.resetStack = exports.PopupStack = exports.getValue = void 0;
13
14
  var screenfull_1 = __importDefault(require("screenfull"));
14
15
  function getLast(items) {
15
16
  if (items.length) {
@@ -397,9 +398,10 @@ exports.resetStack = resetStack;
397
398
  *
398
399
  * @param adapter The parts of the PopupStack that we want to override
399
400
  */
400
- exports.createAdapter = function (adapter) {
401
+ var createAdapter = function (adapter) {
401
402
  stack._adapter = adapter;
402
403
  };
404
+ exports.createAdapter = createAdapter;
403
405
  // keep track of the element ourselves to avoid accidentally popping off someone else's stack
404
406
  // context
405
407
  var element = null;
@@ -142,96 +142,6 @@ export declare function resetStack(): void;
142
142
  *
143
143
  * @param adapter The parts of the PopupStack that we want to override
144
144
  */
145
- export declare const createAdapter: (adapter: Partial<{
146
- /**
147
- * Create a HTMLElement as the container for the popup stack item. The returned element reference
148
- * will be the reference to be passed to all other methods. The Popup Stack will control when this
149
- * element is added and removed from the DOM as well as the `z-index` style property. Your content
150
- * should be added to this element.
151
- */
152
- createContainer(): HTMLElement;
153
- /**
154
- * Adds a PopupStackItem to the stack. This should only be called when the item is rendered to the
155
- * page. Z-indexes are set when the item is added to the stack. If your application requires
156
- * popups to be registered initially, but rendered when the user triggers some event, call this
157
- * method when the event triggers.
158
- */
159
- add(item: PopupStackItem): void;
160
- /**
161
- * Removes an item from a stack by its `HTMLElement` reference. This should be called when a popup
162
- * is "closed" or when the element is removed from the page entirely to ensure proper memory
163
- * cleanup. A popup will be removed from the stack it is a part of. This will not automatically be
164
- * called when the element is removed from the DOM. This method will reset z-index values of the
165
- * stack.
166
- */
167
- remove(element: HTMLElement): void;
168
- /**
169
- * Returns true when the provided `element` is at the top of the stack. It will return false if it
170
- * is not the top of the stack or is not found in the stack. The `element` should be the same
171
- * reference that was passed to `add`
172
- */
173
- isTopmost(element: HTMLElement): boolean;
174
- /**
175
- * Returns an array of elements defined by the `element` passed to `add`. This method return
176
- * elements in the order of lowest z-index to highest z-index. Some popup behaviors will need to
177
- * make decisions based on z-index order.
178
- */
179
- getElements(stackOverride?: Stack | undefined): HTMLElement[];
180
- /**
181
- * Bring the element to the top of the stack. This is useful for persistent popups to place them
182
- * on top of the stack when clicked. If an `owner` was provided to an item when it was added and
183
- * that owner is a DOM child of another item in the stack, that item will be considered a "parent"
184
- * to this item. If the previous are true, all "children" stack items will be brought to top as
185
- * well and will be on top of the element passed to `bringToTop`. This maintains stack item
186
- * "hierarchy" so that stack items like Popups and Tooltips don't get pushed behind elements they
187
- * are supposed to be on top of.
188
- *
189
- * This does not need to be called when a popup is added since added popups are already place on
190
- * the top of the stack.
191
- */
192
- bringToTop(element: HTMLElement): void;
193
- /**
194
- * Compares a Popup by its element reference against the event target and the stack. An event
195
- * target is considered to be "contained" by an element under the following conditions:
196
- * - The `eventTarget` is a DOM child of the popup element
197
- * - The `eventTarget` is the `owner` element passed when it was added to the stack
198
- * - The `eventTarget` is a DOM child of the `owner` element
199
- *
200
- * This method should be used instead of `element.contains` so that clicking a popup target can
201
- * opt-in to toggling. Otherwise there is no way to opt-out of toggle behavior (because the target
202
- * is not inside `element`).
203
- */
204
- contains(element: HTMLElement, eventTarget: HTMLElement): boolean;
205
- /**
206
- * Add a new stack context for popups. This method could be called with the same element multiple
207
- * times, but should only push a new stack context once. The most common use-case for calling
208
- * `pushStackContext` is when entering fullscreen, but multiple fullscreen listeners could be
209
- * pushing the same element which is very difficult to ensure only one stack is used. To mitigate,
210
- * this method filters out multiple calls to push the same element as a new stack context.
211
- */
212
- pushStackContext(container: HTMLElement): void;
213
- /**
214
- * Remove the topmost stack context. The stack context will only be removed if the top stack
215
- * context container element matches to guard against accidental remove of other stack contexts
216
- * you don't own.
217
- */
218
- popStackContext(container: HTMLElement): void;
219
- /**
220
- * Transfer the popup stack item into the current popup stack context.
221
- *
222
- * An example might be a popup
223
- * that is opened and an element goes into fullscreen. The default popup stack context is
224
- * `document.body`, but the [Fullscreen
225
- * API](https://developer.mozilla.org/en-US/docs/Web/API/Fullscreen_API) will only render elements
226
- * that are children of the fullscreen element. If the popup isn't transferred to the current
227
- * popup stack context, the popup will remain open, but will no longer be rendered. This method
228
- * will transfer that popup to the fullscreen element so that it will render. Popups created while
229
- * in a fullscreen context that need to be transferred back when fullscreen is exited should also
230
- * call this method. While popups may still render when fullscreen is exited, popups will be
231
- * members of different popup stack contexts which will cause unspecified results (like the escape
232
- * key will choose the wrong popup as the "topmost").
233
- */
234
- transferToCurrentContext(item: PopupStackItem): void;
235
- }>) => void;
145
+ export declare const createAdapter: (adapter: Partial<typeof PopupStack>) => void;
236
146
  export {};
237
147
  //# sourceMappingURL=PopupStack.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PopupStack.d.ts","sourceRoot":"","sources":["../../../lib/PopupStack.ts"],"names":[],"mappings":"AAEA;;GAEG;AAC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;IACrB;;;;;;;;;;;;;;;OAeG;IACH,KAAK,CAAC,EAAE,WAAW,CAAC;CACrB;AASD;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAO9D;AA0DD,UAAU,KAAK;IACb,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,WAAW,CAAC;IAC9B,MAAM,EAAE;QACN,GAAG,EAAE,MAAM,CAAC;QACZ,GAAG,EAAE,MAAM,CAAC;QACZ,QAAQ,EAAE,OAAO,QAAQ,CAAC;KAC3B,CAAC;IACF,QAAQ,EAAE,OAAO,CAAC,OAAO,UAAU,CAAC,CAAC;CACtC;AAwFD,eAAO,MAAM,UAAU;IACrB;;;;;OAKG;uBACgB,WAAW;IAS9B;;;;;OAKG;cACO,cAAc,GAAG,IAAI;IAY/B;;;;;;OAMG;oBACa,WAAW,GAAG,IAAI;IAelC;;;;OAIG;uBACgB,WAAW,GAAG,OAAO;IAaxC;;;;OAIG;oDACiC,WAAW,EAAE;IAQjD;;;;;;;;;;;OAWG;wBACiB,WAAW,GAAG,IAAI;IA6BtC;;;;;;;;;;OAUG;sBACe,WAAW,eAAe,WAAW,GAAG,OAAO;IA2BjE;;;;;;OAMG;gCACyB,WAAW,GAAG,IAAI;IAoB9C;;;;OAIG;+BACwB,WAAW,GAAG,IAAI;IAY7C;;;;;;;;;;;;;;OAcG;mCAC4B,cAAc,GAAG,IAAI;CAqBrD,CAAC;AAEF;;;GAGG;AACH,wBAAgB,UAAU,SAEzB;AAED;;;GAGG;AACH,eAAO,MAAM,aAAa,YAAa,QAAQ,iBAAiB,CAAC,SAEhE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workday/canvas-kit-popup-stack",
3
- "version": "7.0.0-alpha.0-next.3+14a81c7e",
3
+ "version": "7.0.0-alpha.0-next.7+23568685",
4
4
  "description": "Stack for managing popup UIs to coordinate global concerns like escape key handling and rendering order",
5
5
  "author": "Workday, Inc. (https://www.workday.com)",
6
6
  "license": "Apache-2.0",
@@ -45,5 +45,5 @@
45
45
  "dependencies": {
46
46
  "screenfull": "^5.2.0"
47
47
  },
48
- "gitHead": "14a81c7ef3deb9efaf67fa3ec9cc2d2a3161b00b"
48
+ "gitHead": "23568685fec785046d37cb320289d8ab9e74e283"
49
49
  }
@@ -142,96 +142,6 @@ export declare function resetStack(): void;
142
142
  *
143
143
  * @param adapter The parts of the PopupStack that we want to override
144
144
  */
145
- export declare const createAdapter: (adapter: Partial<{
146
- /**
147
- * Create a HTMLElement as the container for the popup stack item. The returned element reference
148
- * will be the reference to be passed to all other methods. The Popup Stack will control when this
149
- * element is added and removed from the DOM as well as the `z-index` style property. Your content
150
- * should be added to this element.
151
- */
152
- createContainer(): HTMLElement;
153
- /**
154
- * Adds a PopupStackItem to the stack. This should only be called when the item is rendered to the
155
- * page. Z-indexes are set when the item is added to the stack. If your application requires
156
- * popups to be registered initially, but rendered when the user triggers some event, call this
157
- * method when the event triggers.
158
- */
159
- add(item: PopupStackItem): void;
160
- /**
161
- * Removes an item from a stack by its `HTMLElement` reference. This should be called when a popup
162
- * is "closed" or when the element is removed from the page entirely to ensure proper memory
163
- * cleanup. A popup will be removed from the stack it is a part of. This will not automatically be
164
- * called when the element is removed from the DOM. This method will reset z-index values of the
165
- * stack.
166
- */
167
- remove(element: HTMLElement): void;
168
- /**
169
- * Returns true when the provided `element` is at the top of the stack. It will return false if it
170
- * is not the top of the stack or is not found in the stack. The `element` should be the same
171
- * reference that was passed to `add`
172
- */
173
- isTopmost(element: HTMLElement): boolean;
174
- /**
175
- * Returns an array of elements defined by the `element` passed to `add`. This method return
176
- * elements in the order of lowest z-index to highest z-index. Some popup behaviors will need to
177
- * make decisions based on z-index order.
178
- */
179
- getElements(stackOverride?: Stack | undefined): HTMLElement[];
180
- /**
181
- * Bring the element to the top of the stack. This is useful for persistent popups to place them
182
- * on top of the stack when clicked. If an `owner` was provided to an item when it was added and
183
- * that owner is a DOM child of another item in the stack, that item will be considered a "parent"
184
- * to this item. If the previous are true, all "children" stack items will be brought to top as
185
- * well and will be on top of the element passed to `bringToTop`. This maintains stack item
186
- * "hierarchy" so that stack items like Popups and Tooltips don't get pushed behind elements they
187
- * are supposed to be on top of.
188
- *
189
- * This does not need to be called when a popup is added since added popups are already place on
190
- * the top of the stack.
191
- */
192
- bringToTop(element: HTMLElement): void;
193
- /**
194
- * Compares a Popup by its element reference against the event target and the stack. An event
195
- * target is considered to be "contained" by an element under the following conditions:
196
- * - The `eventTarget` is a DOM child of the popup element
197
- * - The `eventTarget` is the `owner` element passed when it was added to the stack
198
- * - The `eventTarget` is a DOM child of the `owner` element
199
- *
200
- * This method should be used instead of `element.contains` so that clicking a popup target can
201
- * opt-in to toggling. Otherwise there is no way to opt-out of toggle behavior (because the target
202
- * is not inside `element`).
203
- */
204
- contains(element: HTMLElement, eventTarget: HTMLElement): boolean;
205
- /**
206
- * Add a new stack context for popups. This method could be called with the same element multiple
207
- * times, but should only push a new stack context once. The most common use-case for calling
208
- * `pushStackContext` is when entering fullscreen, but multiple fullscreen listeners could be
209
- * pushing the same element which is very difficult to ensure only one stack is used. To mitigate,
210
- * this method filters out multiple calls to push the same element as a new stack context.
211
- */
212
- pushStackContext(container: HTMLElement): void;
213
- /**
214
- * Remove the topmost stack context. The stack context will only be removed if the top stack
215
- * context container element matches to guard against accidental remove of other stack contexts
216
- * you don't own.
217
- */
218
- popStackContext(container: HTMLElement): void;
219
- /**
220
- * Transfer the popup stack item into the current popup stack context.
221
- *
222
- * An example might be a popup
223
- * that is opened and an element goes into fullscreen. The default popup stack context is
224
- * `document.body`, but the [Fullscreen
225
- * API](https://developer.mozilla.org/en-US/docs/Web/API/Fullscreen_API) will only render elements
226
- * that are children of the fullscreen element. If the popup isn't transferred to the current
227
- * popup stack context, the popup will remain open, but will no longer be rendered. This method
228
- * will transfer that popup to the fullscreen element so that it will render. Popups created while
229
- * in a fullscreen context that need to be transferred back when fullscreen is exited should also
230
- * call this method. While popups may still render when fullscreen is exited, popups will be
231
- * members of different popup stack contexts which will cause unspecified results (like the escape
232
- * key will choose the wrong popup as the "topmost").
233
- */
234
- transferToCurrentContext(item: PopupStackItem): void;
235
- }>) => void;
145
+ export declare const createAdapter: (adapter: Partial<typeof PopupStack>) => void;
236
146
  export {};
237
147
  //# sourceMappingURL=PopupStack.d.ts.map
@@ -142,96 +142,6 @@ export declare function resetStack(): void;
142
142
  *
143
143
  * @param adapter The parts of the PopupStack that we want to override
144
144
  */
145
- export declare const createAdapter: (adapter: Partial<{
146
- /**
147
- * Create a HTMLElement as the container for the popup stack item. The returned element reference
148
- * will be the reference to be passed to all other methods. The Popup Stack will control when this
149
- * element is added and removed from the DOM as well as the `z-index` style property. Your content
150
- * should be added to this element.
151
- */
152
- createContainer(): HTMLElement;
153
- /**
154
- * Adds a PopupStackItem to the stack. This should only be called when the item is rendered to the
155
- * page. Z-indexes are set when the item is added to the stack. If your application requires
156
- * popups to be registered initially, but rendered when the user triggers some event, call this
157
- * method when the event triggers.
158
- */
159
- add(item: PopupStackItem): void;
160
- /**
161
- * Removes an item from a stack by its `HTMLElement` reference. This should be called when a popup
162
- * is "closed" or when the element is removed from the page entirely to ensure proper memory
163
- * cleanup. A popup will be removed from the stack it is a part of. This will not automatically be
164
- * called when the element is removed from the DOM. This method will reset z-index values of the
165
- * stack.
166
- */
167
- remove(element: HTMLElement): void;
168
- /**
169
- * Returns true when the provided `element` is at the top of the stack. It will return false if it
170
- * is not the top of the stack or is not found in the stack. The `element` should be the same
171
- * reference that was passed to `add`
172
- */
173
- isTopmost(element: HTMLElement): boolean;
174
- /**
175
- * Returns an array of elements defined by the `element` passed to `add`. This method return
176
- * elements in the order of lowest z-index to highest z-index. Some popup behaviors will need to
177
- * make decisions based on z-index order.
178
- */
179
- getElements(stackOverride?: Stack | undefined): HTMLElement[];
180
- /**
181
- * Bring the element to the top of the stack. This is useful for persistent popups to place them
182
- * on top of the stack when clicked. If an `owner` was provided to an item when it was added and
183
- * that owner is a DOM child of another item in the stack, that item will be considered a "parent"
184
- * to this item. If the previous are true, all "children" stack items will be brought to top as
185
- * well and will be on top of the element passed to `bringToTop`. This maintains stack item
186
- * "hierarchy" so that stack items like Popups and Tooltips don't get pushed behind elements they
187
- * are supposed to be on top of.
188
- *
189
- * This does not need to be called when a popup is added since added popups are already place on
190
- * the top of the stack.
191
- */
192
- bringToTop(element: HTMLElement): void;
193
- /**
194
- * Compares a Popup by its element reference against the event target and the stack. An event
195
- * target is considered to be "contained" by an element under the following conditions:
196
- * - The `eventTarget` is a DOM child of the popup element
197
- * - The `eventTarget` is the `owner` element passed when it was added to the stack
198
- * - The `eventTarget` is a DOM child of the `owner` element
199
- *
200
- * This method should be used instead of `element.contains` so that clicking a popup target can
201
- * opt-in to toggling. Otherwise there is no way to opt-out of toggle behavior (because the target
202
- * is not inside `element`).
203
- */
204
- contains(element: HTMLElement, eventTarget: HTMLElement): boolean;
205
- /**
206
- * Add a new stack context for popups. This method could be called with the same element multiple
207
- * times, but should only push a new stack context once. The most common use-case for calling
208
- * `pushStackContext` is when entering fullscreen, but multiple fullscreen listeners could be
209
- * pushing the same element which is very difficult to ensure only one stack is used. To mitigate,
210
- * this method filters out multiple calls to push the same element as a new stack context.
211
- */
212
- pushStackContext(container: HTMLElement): void;
213
- /**
214
- * Remove the topmost stack context. The stack context will only be removed if the top stack
215
- * context container element matches to guard against accidental remove of other stack contexts
216
- * you don't own.
217
- */
218
- popStackContext(container: HTMLElement): void;
219
- /**
220
- * Transfer the popup stack item into the current popup stack context.
221
- *
222
- * An example might be a popup
223
- * that is opened and an element goes into fullscreen. The default popup stack context is
224
- * `document.body`, but the [Fullscreen
225
- * API](https://developer.mozilla.org/en-US/docs/Web/API/Fullscreen_API) will only render elements
226
- * that are children of the fullscreen element. If the popup isn't transferred to the current
227
- * popup stack context, the popup will remain open, but will no longer be rendered. This method
228
- * will transfer that popup to the fullscreen element so that it will render. Popups created while
229
- * in a fullscreen context that need to be transferred back when fullscreen is exited should also
230
- * call this method. While popups may still render when fullscreen is exited, popups will be
231
- * members of different popup stack contexts which will cause unspecified results (like the escape
232
- * key will choose the wrong popup as the "topmost").
233
- */
234
- transferToCurrentContext(item: PopupStackItem): void;
235
- }>) => void;
145
+ export declare const createAdapter: (adapter: Partial<typeof PopupStack>) => void;
236
146
  export {};
237
147
  //# sourceMappingURL=PopupStack.d.ts.map