- Updated all component headers and documentation
- Changed navbar and footer branding
- Updated homepage hero badge
- Modified page title in index.html
- Simplified footer text to 'Built with ❤️'
- Consistent V2 capitalization across all references
25 lines
1.0 KiB
JavaScript
25 lines
1.0 KiB
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.getActiveElement = void 0;
|
|
/**
|
|
* returns active element from document or from nested shadowdoms
|
|
*/
|
|
var safe_1 = require("./safe");
|
|
/**
|
|
* returns current active element. If the active element is a "container" itself(shadowRoot or iframe) returns active element inside it
|
|
* @param [inDocument]
|
|
*/
|
|
var getActiveElement = function (inDocument) {
|
|
if (inDocument === void 0) { inDocument = document; }
|
|
if (!inDocument || !inDocument.activeElement) {
|
|
return undefined;
|
|
}
|
|
var activeElement = inDocument.activeElement;
|
|
return (activeElement.shadowRoot
|
|
? (0, exports.getActiveElement)(activeElement.shadowRoot)
|
|
: activeElement instanceof HTMLIFrameElement && (0, safe_1.safeProbe)(function () { return activeElement.contentWindow.document; })
|
|
? (0, exports.getActiveElement)(activeElement.contentWindow.document)
|
|
: activeElement);
|
|
};
|
|
exports.getActiveElement = getActiveElement;
|