1 | "use strict";
|
---|
2 |
|
---|
3 | exports.__esModule = true;
|
---|
4 | exports["default"] = void 0;
|
---|
5 |
|
---|
6 | var _cssesc = _interopRequireDefault(require("cssesc"));
|
---|
7 |
|
---|
8 | var _util = require("../util");
|
---|
9 |
|
---|
10 | var _node = _interopRequireDefault(require("./node"));
|
---|
11 |
|
---|
12 | var _types = require("./types");
|
---|
13 |
|
---|
14 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
---|
15 |
|
---|
16 | 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); } }
|
---|
17 |
|
---|
18 | function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
---|
19 |
|
---|
20 | function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
|
---|
21 |
|
---|
22 | function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
---|
23 |
|
---|
24 | var ClassName = /*#__PURE__*/function (_Node) {
|
---|
25 | _inheritsLoose(ClassName, _Node);
|
---|
26 |
|
---|
27 | function ClassName(opts) {
|
---|
28 | var _this;
|
---|
29 |
|
---|
30 | _this = _Node.call(this, opts) || this;
|
---|
31 | _this.type = _types.CLASS;
|
---|
32 | _this._constructed = true;
|
---|
33 | return _this;
|
---|
34 | }
|
---|
35 |
|
---|
36 | var _proto = ClassName.prototype;
|
---|
37 |
|
---|
38 | _proto.valueToString = function valueToString() {
|
---|
39 | return '.' + _Node.prototype.valueToString.call(this);
|
---|
40 | };
|
---|
41 |
|
---|
42 | _createClass(ClassName, [{
|
---|
43 | key: "value",
|
---|
44 | get: function get() {
|
---|
45 | return this._value;
|
---|
46 | },
|
---|
47 | set: function set(v) {
|
---|
48 | if (this._constructed) {
|
---|
49 | var escaped = (0, _cssesc["default"])(v, {
|
---|
50 | isIdentifier: true
|
---|
51 | });
|
---|
52 |
|
---|
53 | if (escaped !== v) {
|
---|
54 | (0, _util.ensureObject)(this, "raws");
|
---|
55 | this.raws.value = escaped;
|
---|
56 | } else if (this.raws) {
|
---|
57 | delete this.raws.value;
|
---|
58 | }
|
---|
59 | }
|
---|
60 |
|
---|
61 | this._value = v;
|
---|
62 | }
|
---|
63 | }]);
|
---|
64 |
|
---|
65 | return ClassName;
|
---|
66 | }(_node["default"]);
|
---|
67 |
|
---|
68 | exports["default"] = ClassName;
|
---|
69 | module.exports = exports.default; |
---|