isClickableInput.js 799 B

1234567891011121314151617181920
  1. 'use strict';
  2. var isElementType = require('../misc/isElementType.js');
  3. var clickableInputTypes = /*#__PURE__*/ function(clickableInputTypes) {
  4. clickableInputTypes["button"] = "button";
  5. clickableInputTypes["color"] = "color";
  6. clickableInputTypes["file"] = "file";
  7. clickableInputTypes["image"] = "image";
  8. clickableInputTypes["reset"] = "reset";
  9. clickableInputTypes["submit"] = "submit";
  10. clickableInputTypes["checkbox"] = "checkbox";
  11. clickableInputTypes["radio"] = "radio";
  12. return clickableInputTypes;
  13. }(clickableInputTypes || {});
  14. function isClickableInput(element) {
  15. return isElementType.isElementType(element, 'button') || isElementType.isElementType(element, 'input') && element.type in clickableInputTypes;
  16. }
  17. exports.isClickableInput = isClickableInput;