aliases.js 1.5 KB

123456789101112131415161718192021222324252627282930313233
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.aliases = void 0;
  4. /**
  5. * Aliases are pseudos that are expressed as selectors.
  6. */
  7. exports.aliases = {
  8. // Links
  9. "any-link": ":is(a, area, link)[href]",
  10. link: ":any-link:not(:visited)",
  11. // Forms
  12. // https://html.spec.whatwg.org/multipage/scripting.html#disabled-elements
  13. disabled: ":is(\n :is(button, input, select, textarea, optgroup, option)[disabled],\n optgroup[disabled] > option,\n fieldset[disabled]:not(fieldset[disabled] legend:first-of-type *)\n )",
  14. enabled: ":not(:disabled)",
  15. checked: ":is(:is(input[type=radio], input[type=checkbox])[checked], option:selected)",
  16. required: ":is(input, select, textarea)[required]",
  17. optional: ":is(input, select, textarea):not([required])",
  18. // JQuery extensions
  19. // https://html.spec.whatwg.org/multipage/form-elements.html#concept-option-selectedness
  20. selected: "option:is([selected], select:not([multiple]):not(:has(> option[selected])) > :first-of-type)",
  21. checkbox: "[type=checkbox]",
  22. file: "[type=file]",
  23. password: "[type=password]",
  24. radio: "[type=radio]",
  25. reset: "[type=reset]",
  26. image: "[type=image]",
  27. submit: "[type=submit]",
  28. parent: ":not(:empty)",
  29. header: ":is(h1, h2, h3, h4, h5, h6)",
  30. button: ":is(button, input[type=button])",
  31. input: ":is(input, textarea, select, button)",
  32. text: "input:is(:not([type!='']), [type=text])",
  33. };