项目原始demo,不改动
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
Ce dépôt est archivé. Vous pouvez voir les fichiers et le cloner, mais vous ne pouvez pas pousser ni ouvrir de ticket/demande d'ajout.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  5. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
  6. var Declaration = require('../declaration');
  7. var GridEnd = function (_Declaration) {
  8. _inherits(GridEnd, _Declaration);
  9. function GridEnd() {
  10. _classCallCheck(this, GridEnd);
  11. return _possibleConstructorReturn(this, _Declaration.apply(this, arguments));
  12. }
  13. /**
  14. * Do not add prefix for unsupported value in IE
  15. */
  16. GridEnd.prototype.check = function check(decl) {
  17. return decl.value.indexOf('span') !== -1;
  18. };
  19. /**
  20. * Return a final spec property
  21. */
  22. GridEnd.prototype.normalize = function normalize(prop) {
  23. return prop.replace(/(-span|-end)/, '');
  24. };
  25. /**
  26. * Change property name for IE
  27. */
  28. GridEnd.prototype.prefixed = function prefixed(prop, prefix) {
  29. var result = _Declaration.prototype.prefixed.call(this, prop, prefix);
  30. if (prefix === '-ms-') {
  31. result = result.replace('-end', '-span');
  32. }
  33. return result;
  34. };
  35. /**
  36. * Change repeating syntax for IE
  37. */
  38. GridEnd.prototype.set = function set(decl, prefix) {
  39. if (prefix === '-ms-') {
  40. decl.value = decl.value.replace(/span\s/i, '');
  41. }
  42. return _Declaration.prototype.set.call(this, decl, prefix);
  43. };
  44. return GridEnd;
  45. }(Declaration);
  46. Object.defineProperty(GridEnd, 'names', {
  47. enumerable: true,
  48. writable: true,
  49. value: ['grid-row-end', 'grid-column-end', 'grid-row-span', 'grid-column-span']
  50. });
  51. module.exports = GridEnd;