nav tabs on admin dashboard
This commit is contained in:
162
node_modules/postcss-selector-parser/dist/selectors/node.js
generated
vendored
162
node_modules/postcss-selector-parser/dist/selectors/node.js
generated
vendored
@@ -2,12 +2,16 @@
|
||||
|
||||
exports.__esModule = true;
|
||||
|
||||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
||||
|
||||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
||||
|
||||
var _util = require('../util');
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
var cloneNode = function cloneNode(obj, parent) {
|
||||
if ((typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) !== 'object') {
|
||||
if ((typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) !== 'object' || obj === null) {
|
||||
return obj;
|
||||
}
|
||||
|
||||
@@ -36,26 +40,19 @@ var cloneNode = function cloneNode(obj, parent) {
|
||||
return cloned;
|
||||
};
|
||||
|
||||
var _class = function () {
|
||||
function _class() {
|
||||
var Node = function () {
|
||||
function Node() {
|
||||
var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
|
||||
_classCallCheck(this, _class);
|
||||
_classCallCheck(this, Node);
|
||||
|
||||
for (var key in opts) {
|
||||
this[key] = opts[key];
|
||||
}
|
||||
var _opts$spaces = opts.spaces;
|
||||
_opts$spaces = _opts$spaces === undefined ? {} : _opts$spaces;
|
||||
var _opts$spaces$before = _opts$spaces.before,
|
||||
before = _opts$spaces$before === undefined ? '' : _opts$spaces$before,
|
||||
_opts$spaces$after = _opts$spaces.after,
|
||||
after = _opts$spaces$after === undefined ? '' : _opts$spaces$after;
|
||||
|
||||
this.spaces = { before: before, after: after };
|
||||
Object.assign(this, opts);
|
||||
this.spaces = this.spaces || {};
|
||||
this.spaces.before = this.spaces.before || '';
|
||||
this.spaces.after = this.spaces.after || '';
|
||||
}
|
||||
|
||||
_class.prototype.remove = function remove() {
|
||||
Node.prototype.remove = function remove() {
|
||||
if (this.parent) {
|
||||
this.parent.removeChild(this);
|
||||
}
|
||||
@@ -63,7 +60,7 @@ var _class = function () {
|
||||
return this;
|
||||
};
|
||||
|
||||
_class.prototype.replaceWith = function replaceWith() {
|
||||
Node.prototype.replaceWith = function replaceWith() {
|
||||
if (this.parent) {
|
||||
for (var index in arguments) {
|
||||
this.parent.insertBefore(this, arguments[index]);
|
||||
@@ -73,15 +70,15 @@ var _class = function () {
|
||||
return this;
|
||||
};
|
||||
|
||||
_class.prototype.next = function next() {
|
||||
Node.prototype.next = function next() {
|
||||
return this.parent.at(this.parent.index(this) + 1);
|
||||
};
|
||||
|
||||
_class.prototype.prev = function prev() {
|
||||
Node.prototype.prev = function prev() {
|
||||
return this.parent.at(this.parent.index(this) - 1);
|
||||
};
|
||||
|
||||
_class.prototype.clone = function clone() {
|
||||
Node.prototype.clone = function clone() {
|
||||
var overrides = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
|
||||
var cloned = cloneNode(this);
|
||||
@@ -91,12 +88,129 @@ var _class = function () {
|
||||
return cloned;
|
||||
};
|
||||
|
||||
_class.prototype.toString = function toString() {
|
||||
return [this.spaces.before, String(this.value), this.spaces.after].join('');
|
||||
/**
|
||||
* Some non-standard syntax doesn't follow normal escaping rules for css.
|
||||
* This allows non standard syntax to be appended to an existing property
|
||||
* by specifying the escaped value. By specifying the escaped value,
|
||||
* illegal characters are allowed to be directly inserted into css output.
|
||||
* @param {string} name the property to set
|
||||
* @param {any} value the unescaped value of the property
|
||||
* @param {string} valueEscaped optional. the escaped value of the property.
|
||||
*/
|
||||
|
||||
|
||||
Node.prototype.appendToPropertyAndEscape = function appendToPropertyAndEscape(name, value, valueEscaped) {
|
||||
if (!this.raws) {
|
||||
this.raws = {};
|
||||
}
|
||||
var originalValue = this[name];
|
||||
var originalEscaped = this.raws[name];
|
||||
this[name] = originalValue + value; // this may trigger a setter that updates raws, so it has to be set first.
|
||||
if (originalEscaped || valueEscaped !== value) {
|
||||
this.raws[name] = (originalEscaped || originalValue) + valueEscaped;
|
||||
} else {
|
||||
delete this.raws[name]; // delete any escaped value that was created by the setter.
|
||||
}
|
||||
};
|
||||
|
||||
return _class;
|
||||
/**
|
||||
* Some non-standard syntax doesn't follow normal escaping rules for css.
|
||||
* This allows the escaped value to be specified directly, allowing illegal
|
||||
* characters to be directly inserted into css output.
|
||||
* @param {string} name the property to set
|
||||
* @param {any} value the unescaped value of the property
|
||||
* @param {string} valueEscaped the escaped value of the property.
|
||||
*/
|
||||
|
||||
|
||||
Node.prototype.setPropertyAndEscape = function setPropertyAndEscape(name, value, valueEscaped) {
|
||||
if (!this.raws) {
|
||||
this.raws = {};
|
||||
}
|
||||
this[name] = value; // this may trigger a setter that updates raws, so it has to be set first.
|
||||
this.raws[name] = valueEscaped;
|
||||
};
|
||||
|
||||
/**
|
||||
* When you want a value to passed through to CSS directly. This method
|
||||
* deletes the corresponding raw value causing the stringifier to fallback
|
||||
* to the unescaped value.
|
||||
* @param {string} name the property to set.
|
||||
* @param {any} value The value that is both escaped and unescaped.
|
||||
*/
|
||||
|
||||
|
||||
Node.prototype.setPropertyWithoutEscape = function setPropertyWithoutEscape(name, value) {
|
||||
this[name] = value; // this may trigger a setter that updates raws, so it has to be set first.
|
||||
if (this.raws) {
|
||||
delete this.raws[name];
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {number} line The number (starting with 1)
|
||||
* @param {number} column The column number (starting with 1)
|
||||
*/
|
||||
|
||||
|
||||
Node.prototype.isAtPosition = function isAtPosition(line, column) {
|
||||
if (this.source && this.source.start && this.source.end) {
|
||||
if (this.source.start.line > line) {
|
||||
return false;
|
||||
}
|
||||
if (this.source.end.line < line) {
|
||||
return false;
|
||||
}
|
||||
if (this.source.start.line === line && this.source.start.column > column) {
|
||||
return false;
|
||||
}
|
||||
if (this.source.end.line === line && this.source.end.column < column) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return undefined;
|
||||
};
|
||||
|
||||
Node.prototype.stringifyProperty = function stringifyProperty(name) {
|
||||
return this.raws && this.raws[name] || this[name];
|
||||
};
|
||||
|
||||
Node.prototype.toString = function toString() {
|
||||
return [this.rawSpaceBefore, String(this.stringifyProperty("value")), this.rawSpaceAfter].join('');
|
||||
};
|
||||
|
||||
_createClass(Node, [{
|
||||
key: 'rawSpaceBefore',
|
||||
get: function get() {
|
||||
var rawSpace = this.raws && this.raws.spaces && this.raws.spaces.before;
|
||||
if (rawSpace === undefined) {
|
||||
rawSpace = this.spaces && this.spaces.before;
|
||||
}
|
||||
return rawSpace || "";
|
||||
},
|
||||
set: function set(raw) {
|
||||
(0, _util.ensureObject)(this, "raws", "spaces");
|
||||
this.raws.spaces.before = raw;
|
||||
}
|
||||
}, {
|
||||
key: 'rawSpaceAfter',
|
||||
get: function get() {
|
||||
var rawSpace = this.raws && this.raws.spaces && this.raws.spaces.after;
|
||||
if (rawSpace === undefined) {
|
||||
rawSpace = this.spaces.after;
|
||||
}
|
||||
return rawSpace || "";
|
||||
},
|
||||
set: function set(raw) {
|
||||
(0, _util.ensureObject)(this, "raws", "spaces");
|
||||
this.raws.spaces.after = raw;
|
||||
}
|
||||
}]);
|
||||
|
||||
return Node;
|
||||
}();
|
||||
|
||||
exports.default = _class;
|
||||
exports.default = Node;
|
||||
module.exports = exports['default'];
|
||||
Reference in New Issue
Block a user