Source

dom/isUserInputElement.js

"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var parseBooleanStr_1 = __importDefault(require("../utils/parseBooleanStr"));
/**
 * The elements include:
 * select, textarea, input[type=text], input[type=date], input[type=password],
 * input[type=email], input[type=number], div[contenteditable]
 * @param el
 * @category dom
 * @module isUserInputElement
 */
var isUserInputElement = function (el) { return (/^select$/i.test(el.tagName)
    || /^textarea$/i.test(el.tagName)
    || (/^div$/i.test(el.tagName) && (0, parseBooleanStr_1.default)(el.contentEditable) === true)
    || (/^input$/i.test(el.tagName)
        && /^(text|date|password|email|number)$/i.test(el.type))); };
exports.default = isUserInputElement;