grid-start.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 Declaration = require('../declaration');
  6. var GridStart =
  7. /*#__PURE__*/
  8. function (_Declaration) {
  9. _inheritsLoose(GridStart, _Declaration);
  10. function GridStart() {
  11. return _Declaration.apply(this, arguments) || this;
  12. }
  13. var _proto = GridStart.prototype;
  14. /**
  15. * Do not add prefix for unsupported value in IE
  16. */
  17. _proto.check = function check(decl) {
  18. var value = decl.value;
  19. return value.indexOf('/') === -1 || value.indexOf('span') !== -1;
  20. }
  21. /**
  22. * Return a final spec property
  23. */
  24. ;
  25. _proto.normalize = function normalize(prop) {
  26. return prop.replace('-start', '');
  27. }
  28. /**
  29. * Change property name for IE
  30. */
  31. ;
  32. _proto.prefixed = function prefixed(prop, prefix) {
  33. var result = _Declaration.prototype.prefixed.call(this, prop, prefix);
  34. if (prefix === '-ms-') {
  35. result = result.replace('-start', '');
  36. }
  37. return result;
  38. };
  39. return GridStart;
  40. }(Declaration);
  41. _defineProperty(GridStart, "names", ['grid-row-start', 'grid-column-start']);
  42. module.exports = GridStart;