display-grid.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 Value = require('../value');
  6. var DisplayGrid = /*#__PURE__*/function (_Value) {
  7. _inheritsLoose(DisplayGrid, _Value);
  8. function DisplayGrid(name, prefixes) {
  9. var _this;
  10. _this = _Value.call(this, name, prefixes) || this;
  11. if (name === 'display-grid') {
  12. _this.name = 'grid';
  13. }
  14. return _this;
  15. }
  16. /**
  17. * Faster check for flex value
  18. */
  19. var _proto = DisplayGrid.prototype;
  20. _proto.check = function check(decl) {
  21. return decl.prop === 'display' && decl.value === this.name;
  22. };
  23. return DisplayGrid;
  24. }(Value);
  25. _defineProperty(DisplayGrid, "names", ['display-grid', 'inline-grid']);
  26. module.exports = DisplayGrid;