source: trip-planner-front/node_modules/autoprefixer/lib/hacks/grid-row-column.js

Last change on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 1.9 KB
Line 
1"use strict";
2
3function _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; }
4
5function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _defaults(subClass, superClass); }
6
7function _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; }
8
9var Declaration = require('../declaration');
10
11var utils = require('./grid-utils');
12
13var GridRowColumn = /*#__PURE__*/function (_Declaration) {
14 _inheritsLoose(GridRowColumn, _Declaration);
15
16 function GridRowColumn() {
17 return _Declaration.apply(this, arguments) || this;
18 }
19
20 var _proto = GridRowColumn.prototype;
21
22 /**
23 * Translate grid-row / grid-column to separate -ms- prefixed properties
24 */
25 _proto.insert = function insert(decl, prefix, prefixes) {
26 if (prefix !== '-ms-') return _Declaration.prototype.insert.call(this, decl, prefix, prefixes);
27 var values = utils.parse(decl);
28
29 var _utils$translate = utils.translate(values, 0, 1),
30 start = _utils$translate[0],
31 span = _utils$translate[1];
32
33 var hasStartValueSpan = values[0] && values[0].includes('span');
34
35 if (hasStartValueSpan) {
36 span = values[0].join('').replace(/\D/g, '');
37 }
38
39 [[decl.prop, start], [decl.prop + "-span", span]].forEach(function (_ref) {
40 var prop = _ref[0],
41 value = _ref[1];
42 utils.insertDecl(decl, prop, value);
43 });
44 return undefined;
45 };
46
47 return GridRowColumn;
48}(Declaration);
49
50_defineProperty(GridRowColumn, "names", ['grid-row', 'grid-column']);
51
52module.exports = GridRowColumn;
Note: See TracBrowser for help on using the repository browser.