@tylertech/forge-core 2.2.2 → 2.3.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.
@@ -637,11 +637,12 @@ export function deepQuerySelectorAll(rootElement, selectors, checkRootElement =
637
637
  }
638
638
  /**
639
639
  * Gets the currently focused element within the document by also traversing shadow roots.
640
+ * @param {Document} doc The document to get the active element from. Defaults to the current document.
640
641
  * @returns {Element}
641
642
  */
642
- export function getActiveElement() {
643
- const activeElement = document.activeElement;
644
- if (!activeElement || activeElement === document.body) {
643
+ export function getActiveElement(doc = document) {
644
+ const activeElement = doc.activeElement;
645
+ if (!activeElement || activeElement === doc.body) {
645
646
  return activeElement;
646
647
  }
647
648
  return getActiveShadowElement(activeElement);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tylertech/forge-core",
3
- "version": "2.2.2",
3
+ "version": "2.3.0",
4
4
  "description": "A library of core web utilities that support Forge Web Component libraries.",
5
5
  "author": "Tyler Technologies, Inc.",
6
6
  "license": "Apache-2.0",
@@ -211,9 +211,10 @@ export declare function matchesSelectors(el: Element | Node, selectors: string |
211
211
  export declare function deepQuerySelectorAll(rootElement: Element, selectors: string | string[], checkRootElement?: boolean): Element[];
212
212
  /**
213
213
  * Gets the currently focused element within the document by also traversing shadow roots.
214
+ * @param {Document} doc The document to get the active element from. Defaults to the current document.
214
215
  * @returns {Element}
215
216
  */
216
- export declare function getActiveElement(): Element;
217
+ export declare function getActiveElement(doc?: Document): Element;
217
218
  /**
218
219
  * Gets the active element within the provided elements shadow root. If the element
219
220
  * does not have a shadow root, the provided element is returned.