- 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
22 lines
869 B
JavaScript
22 lines
869 B
JavaScript
import { FOCUS_ALLOW } from './constants';
|
|
import { contains } from './utils/DOMutils';
|
|
import { toArray } from './utils/array';
|
|
import { getActiveElement } from './utils/getActiveElement';
|
|
/**
|
|
* checks if focus is hidden FROM the focus-lock
|
|
* ie contained inside a node focus-lock shall ignore
|
|
*
|
|
* This is a utility function coupled with {@link FOCUS_ALLOW} constant
|
|
*
|
|
* @returns {boolean} focus is currently is in "allow" area
|
|
*/
|
|
export var focusIsHidden = function (inDocument) {
|
|
if (inDocument === void 0) { inDocument = document; }
|
|
var activeElement = getActiveElement(inDocument);
|
|
if (!activeElement) {
|
|
return false;
|
|
}
|
|
// this does not support setting FOCUS_ALLOW within shadow dom
|
|
return toArray(inDocument.querySelectorAll("[".concat(FOCUS_ALLOW, "]"))).some(function (node) { return contains(node, activeElement); });
|
|
};
|