You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
1.7 KiB

4 years ago
  1. "use strict";
  2. function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
  3. function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _defaults(subClass, superClass); }
  4. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  5. var Selector = require('../selector');
  6. var Placeholder =
  7. /*#__PURE__*/
  8. function (_Selector) {
  9. _inheritsLoose(Placeholder, _Selector);
  10. function Placeholder() {
  11. return _Selector.apply(this, arguments) || this;
  12. }
  13. var _proto = Placeholder.prototype;
  14. /**
  15. * Add old mozilla to possible prefixes
  16. */
  17. _proto.possible = function possible() {
  18. return _Selector.prototype.possible.call(this).concat(['-moz- old', '-ms- old']);
  19. }
  20. /**
  21. * Return different selectors depend on prefix
  22. */
  23. ;
  24. _proto.prefixed = function prefixed(prefix) {
  25. if (prefix === '-webkit-') {
  26. return '::-webkit-input-placeholder';
  27. }
  28. if (prefix === '-ms-') {
  29. return '::-ms-input-placeholder';
  30. }
  31. if (prefix === '-ms- old') {
  32. return ':-ms-input-placeholder';
  33. }
  34. if (prefix === '-moz- old') {
  35. return ':-moz-placeholder';
  36. }
  37. return "::" + prefix + "placeholder";
  38. };
  39. return Placeholder;
  40. }(Selector);
  41. _defineProperty(Placeholder, "names", ['::placeholder']);
  42. module.exports = Placeholder;