@antv/g 5.0.23-alpha.0 → 5.0.23-alpha.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/dist/index.umd.min.js +2 -2
  2. package/es/css/cssom/CSSKeywordValue.d.ts +1 -1
  3. package/es/css/cssom/CSSNumericSumValue.d.ts +1 -1
  4. package/es/css/cssom/CSSNumericValue.d.ts +139 -4
  5. package/es/css/cssom/CSSNumericValue.js +1164 -5
  6. package/es/css/cssom/CSSTransformValue.d.ts +1 -1
  7. package/es/css/cssom/index.d.ts +0 -10
  8. package/es/css/cssom/index.js +1 -11
  9. package/lib/css/cssom/CSSKeywordValue.d.ts +1 -1
  10. package/lib/css/cssom/CSSNumericSumValue.d.ts +1 -1
  11. package/lib/css/cssom/CSSNumericValue.d.ts +139 -4
  12. package/lib/css/cssom/CSSNumericValue.js +1222 -52
  13. package/lib/css/cssom/CSSTransformValue.d.ts +1 -1
  14. package/lib/css/cssom/index.d.ts +0 -10
  15. package/lib/css/cssom/index.js +0 -130
  16. package/package.json +3 -3
  17. package/es/css/cssom/CSSMathInvert.d.ts +0 -14
  18. package/es/css/cssom/CSSMathInvert.js +0 -84
  19. package/es/css/cssom/CSSMathMax.d.ts +0 -17
  20. package/es/css/cssom/CSSMathMax.js +0 -118
  21. package/es/css/cssom/CSSMathMin.d.ts +0 -17
  22. package/es/css/cssom/CSSMathMin.js +0 -119
  23. package/es/css/cssom/CSSMathNegate.d.ts +0 -14
  24. package/es/css/cssom/CSSMathNegate.js +0 -80
  25. package/es/css/cssom/CSSMathProduct.d.ts +0 -16
  26. package/es/css/cssom/CSSMathProduct.js +0 -109
  27. package/es/css/cssom/CSSMathSum.d.ts +0 -17
  28. package/es/css/cssom/CSSMathSum.js +0 -117
  29. package/es/css/cssom/CSSMathValue.d.ts +0 -11
  30. package/es/css/cssom/CSSMathValue.js +0 -27
  31. package/es/css/cssom/CSSMathVariadic.d.ts +0 -9
  32. package/es/css/cssom/CSSMathVariadic.js +0 -44
  33. package/es/css/cssom/CSSNumericValueType.d.ts +0 -33
  34. package/es/css/cssom/CSSNumericValueType.js +0 -259
  35. package/es/css/cssom/CSSUnitValue.d.ts +0 -33
  36. package/es/css/cssom/CSSUnitValue.js +0 -252
  37. package/lib/css/cssom/CSSMathInvert.d.ts +0 -14
  38. package/lib/css/cssom/CSSMathInvert.js +0 -94
  39. package/lib/css/cssom/CSSMathMax.d.ts +0 -17
  40. package/lib/css/cssom/CSSMathMax.js +0 -128
  41. package/lib/css/cssom/CSSMathMin.d.ts +0 -17
  42. package/lib/css/cssom/CSSMathMin.js +0 -128
  43. package/lib/css/cssom/CSSMathNegate.d.ts +0 -14
  44. package/lib/css/cssom/CSSMathNegate.js +0 -89
  45. package/lib/css/cssom/CSSMathProduct.d.ts +0 -16
  46. package/lib/css/cssom/CSSMathProduct.js +0 -119
  47. package/lib/css/cssom/CSSMathSum.d.ts +0 -17
  48. package/lib/css/cssom/CSSMathSum.js +0 -129
  49. package/lib/css/cssom/CSSMathValue.d.ts +0 -11
  50. package/lib/css/cssom/CSSMathValue.js +0 -35
  51. package/lib/css/cssom/CSSMathVariadic.d.ts +0 -9
  52. package/lib/css/cssom/CSSMathVariadic.js +0 -55
  53. package/lib/css/cssom/CSSNumericValueType.d.ts +0 -33
  54. package/lib/css/cssom/CSSNumericValueType.js +0 -272
  55. package/lib/css/cssom/CSSUnitValue.d.ts +0 -33
  56. package/lib/css/cssom/CSSUnitValue.js +0 -267
@@ -1,272 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.CSSNumericValueType = exports.BaseType = void 0;
7
- exports.baseTypeToString = baseTypeToString;
8
- exports.unitTypeToBaseType = unitTypeToBaseType;
9
-
10
- var _utils = require("../../utils");
11
-
12
- var _ = require(".");
13
-
14
- // https://drafts.css-houdini.org/css-typed-om/#enumdef-cssnumericbasetype
15
- var BaseType;
16
- exports.BaseType = BaseType;
17
-
18
- (function (BaseType) {
19
- BaseType[BaseType["kLength"] = 0] = "kLength";
20
- BaseType[BaseType["kAngle"] = 1] = "kAngle";
21
- BaseType[BaseType["kTime"] = 2] = "kTime";
22
- BaseType[BaseType["kFrequency"] = 3] = "kFrequency";
23
- BaseType[BaseType["kResolution"] = 4] = "kResolution";
24
- BaseType[BaseType["kFlex"] = 5] = "kFlex";
25
- BaseType[BaseType["kPercent"] = 6] = "kPercent";
26
- BaseType[BaseType["kNumBaseTypes"] = 7] = "kNumBaseTypes";
27
- })(BaseType || (exports.BaseType = BaseType = {}));
28
-
29
- function unitTypeToBaseType(unit) {
30
- (0, _utils.DCHECK_NE)(unit, _.UnitType.kNumber);
31
-
32
- switch (unit) {
33
- case _.UnitType.kEms:
34
- case _.UnitType.kExs:
35
- case _.UnitType.kPixels:
36
- case _.UnitType.kCentimeters:
37
- case _.UnitType.kMillimeters:
38
- case _.UnitType.kQuarterMillimeters:
39
- case _.UnitType.kInches:
40
- case _.UnitType.kPoints:
41
- case _.UnitType.kPicas:
42
- case _.UnitType.kUserUnits:
43
- case _.UnitType.kViewportWidth:
44
- case _.UnitType.kViewportHeight:
45
- case _.UnitType.kViewportInlineSize:
46
- case _.UnitType.kViewportBlockSize:
47
- case _.UnitType.kViewportMin:
48
- case _.UnitType.kViewportMax:
49
- case _.UnitType.kSmallViewportWidth:
50
- case _.UnitType.kSmallViewportHeight:
51
- case _.UnitType.kSmallViewportInlineSize:
52
- case _.UnitType.kSmallViewportBlockSize:
53
- case _.UnitType.kSmallViewportMin:
54
- case _.UnitType.kSmallViewportMax:
55
- case _.UnitType.kLargeViewportWidth:
56
- case _.UnitType.kLargeViewportHeight:
57
- case _.UnitType.kLargeViewportInlineSize:
58
- case _.UnitType.kLargeViewportBlockSize:
59
- case _.UnitType.kLargeViewportMin:
60
- case _.UnitType.kLargeViewportMax:
61
- case _.UnitType.kDynamicViewportWidth:
62
- case _.UnitType.kDynamicViewportHeight:
63
- case _.UnitType.kDynamicViewportInlineSize:
64
- case _.UnitType.kDynamicViewportBlockSize:
65
- case _.UnitType.kDynamicViewportMin:
66
- case _.UnitType.kDynamicViewportMax:
67
- case _.UnitType.kContainerWidth:
68
- case _.UnitType.kContainerHeight:
69
- case _.UnitType.kContainerInlineSize:
70
- case _.UnitType.kContainerBlockSize:
71
- case _.UnitType.kContainerMin:
72
- case _.UnitType.kContainerMax:
73
- case _.UnitType.kRems:
74
- case _.UnitType.kChs:
75
- return BaseType.kLength;
76
-
77
- case _.UnitType.kMilliseconds:
78
- case _.UnitType.kSeconds:
79
- return BaseType.kTime;
80
-
81
- case _.UnitType.kDegrees:
82
- case _.UnitType.kRadians:
83
- case _.UnitType.kGradians:
84
- case _.UnitType.kTurns:
85
- return BaseType.kAngle;
86
-
87
- case _.UnitType.kHertz:
88
- case _.UnitType.kKilohertz:
89
- return BaseType.kFrequency;
90
-
91
- case _.UnitType.kDotsPerPixel:
92
- case _.UnitType.kDotsPerInch:
93
- case _.UnitType.kDotsPerCentimeter:
94
- return BaseType.kResolution;
95
-
96
- case _.UnitType.kFraction:
97
- return BaseType.kFlex;
98
-
99
- case _.UnitType.kPercentage:
100
- return BaseType.kPercent;
101
-
102
- default:
103
- return BaseType.kLength;
104
- }
105
- }
106
-
107
- function baseTypeToString(baseType) {
108
- switch (baseType) {
109
- case BaseType.kLength:
110
- return 'length';
111
-
112
- case BaseType.kAngle:
113
- return 'angle';
114
-
115
- case BaseType.kTime:
116
- return 'time';
117
-
118
- case BaseType.kFrequency:
119
- return 'frequency';
120
-
121
- case BaseType.kResolution:
122
- return 'resolution';
123
-
124
- case BaseType.kFlex:
125
- return 'flex';
126
-
127
- case BaseType.kPercent:
128
- return 'percent';
129
-
130
- default:
131
- break;
132
- }
133
-
134
- return '';
135
- }
136
-
137
- var CSSNumericValueType =
138
- /** @class */
139
- function () {
140
- function CSSNumericValueType(unit, exponent) {
141
- if (unit === void 0) {
142
- unit = _.UnitType.kNumber;
143
- }
144
-
145
- if (exponent === void 0) {
146
- exponent = 1;
147
- }
148
-
149
- this.exponents = [];
150
- this.numNonZeroEntries = 0;
151
- this.percentHint = BaseType.kPercent;
152
- this.hasPercentHint = false;
153
- this.exponents = new Array(BaseType.kNumBaseTypes).fill(0);
154
-
155
- if (unit !== _.UnitType.kNumber) {
156
- this.setExponent(unitTypeToBaseType(unit), exponent);
157
- }
158
- }
159
-
160
- CSSNumericValueType.prototype.applyPercentHint = function (hint) {
161
- (0, _utils.DCHECK_NE)(hint, BaseType.kPercent);
162
- this.setExponent(hint, this.exponent(hint) + this.exponent(BaseType.kPercent));
163
- this.setExponent(BaseType.kPercent, 0);
164
- this.percentHint = hint;
165
- this.hasPercentHint = true;
166
- };
167
-
168
- CSSNumericValueType.prototype.hasNonZeroEntries = function () {
169
- return this.numNonZeroEntries > 0;
170
- };
171
-
172
- CSSNumericValueType.prototype.isOnlyNonZeroEntry = function (baseType, value) {
173
- (0, _utils.DCHECK_NE)(value, 0);
174
- return this.numNonZeroEntries === 1 && this.exponent(baseType) === value;
175
- };
176
-
177
- CSSNumericValueType.prototype.exponent = function (type) {
178
- return this.exponents[type];
179
- };
180
-
181
- CSSNumericValueType.prototype.setExponent = function (type, newValue) {
182
- var oldValue = this.exponents[type];
183
-
184
- if (oldValue == 0 && newValue !== 0) {
185
- this.numNonZeroEntries++;
186
- } else if (oldValue !== 0 && newValue == 0) {
187
- this.numNonZeroEntries--;
188
- }
189
-
190
- this.exponents[type] = newValue;
191
- };
192
-
193
- CSSNumericValueType.negateExponents = function (type) {
194
- type.exponents.forEach(function (v) {
195
- return v *= -1;
196
- });
197
- return type;
198
- };
199
-
200
- CSSNumericValueType.prototype.matchesBaseType = function (baseType) {
201
- (0, _utils.DCHECK_NE)(baseType, BaseType.kPercent);
202
- return this.isOnlyNonZeroEntry(baseType, 1) && !this.hasPercentHint;
203
- };
204
-
205
- CSSNumericValueType.prototype.matchesPercentage = function () {
206
- return this.isOnlyNonZeroEntry(BaseType.kPercent, 1);
207
- };
208
-
209
- CSSNumericValueType.prototype.matchesBaseTypePercentage = function (baseType) {
210
- (0, _utils.DCHECK_NE)(baseType, BaseType.kPercent);
211
- return this.isOnlyNonZeroEntry(baseType, 1) || this.isOnlyNonZeroEntry(BaseType.kPercent, 1);
212
- };
213
-
214
- CSSNumericValueType.prototype.matchesNumber = function () {
215
- return !this.hasNonZeroEntries() && !this.hasPercentHint;
216
- };
217
-
218
- CSSNumericValueType.prototype.matchesNumberPercentage = function () {
219
- return !this.hasNonZeroEntries() || this.isOnlyNonZeroEntry(BaseType.kPercent, 1);
220
- };
221
-
222
- CSSNumericValueType.add = function (type1, type2, error) {
223
- if (type1.hasPercentHint && type2.hasPercentHint && type1.percentHint != type2.percentHint) {
224
- error = true;
225
- return type1;
226
- }
227
-
228
- if (type1.hasPercentHint) type2.applyPercentHint(type1.percentHint);else if (type2.hasPercentHint) type1.applyPercentHint(type2.percentHint);
229
- (0, _utils.DCHECK_EQ)(type1.percentHint, type2.percentHint); // Match up base types. Try to use the percent hint to match up any
230
- // differences.
231
-
232
- for (var i = 0; i < BaseType.kNumBaseTypes; ++i) {
233
- var base_type = i;
234
-
235
- if (type1.exponents[i] !== type2.exponents[i]) {
236
- if (base_type !== BaseType.kPercent) {
237
- type1.applyPercentHint(base_type);
238
- type2.applyPercentHint(base_type);
239
- }
240
-
241
- if (type1.exponents[i] !== type2.exponents[i]) {
242
- error = true;
243
- return type1;
244
- }
245
- }
246
- }
247
-
248
- error = false;
249
- return type1;
250
- };
251
-
252
- CSSNumericValueType.multiply = function (type1, type2, error) {
253
- if (type1.hasPercentHint && type2.hasPercentHint && type1.percentHint != type2.percentHint) {
254
- error = true;
255
- return type1;
256
- }
257
-
258
- if (type1.hasPercentHint) type2.applyPercentHint(type1.percentHint);else if (type2.hasPercentHint) type1.applyPercentHint(type2.percentHint);
259
-
260
- for (var i = 0; i < BaseType.kNumBaseTypes; ++i) {
261
- var base_type = i;
262
- type1.setExponent(base_type, type1.exponent(base_type) + type2.exponent(base_type));
263
- }
264
-
265
- error = false;
266
- return type1;
267
- };
268
-
269
- return CSSNumericValueType;
270
- }();
271
-
272
- exports.CSSNumericValueType = CSSNumericValueType;
@@ -1,33 +0,0 @@
1
- /**
2
- * The CSSUnitValue interface of the CSS_Object_Model represents values that contain a single unit type.
3
- * For example, "42px" would be represented by a CSSNumericValue.
4
- *
5
- * @see https://developer.mozilla.org/en-US/docs/Web/API/CSSUnitValue
6
- */
7
- import { CSSMathInvert } from './CSSMathInvert';
8
- import type { CSSNumericSumValue } from './CSSNumericSumValue';
9
- import type { Nested, ParenLess } from '.';
10
- import { CSSNumericValue } from './CSSNumericValue';
11
- import { CSSStyleValueType, UnitType } from '.';
12
- /**
13
- * Represents numeric values that can be expressed as a single number plus a
14
- * unit (or a naked number or percentage).
15
- * @see https://drafts.css-houdini.org/css-typed-om/#cssunitvalue
16
- */
17
- export declare class CSSUnitValue extends CSSNumericValue {
18
- static toCanonicalUnit(unit: UnitType): UnitType.kUnknown | UnitType.kNumber | UnitType.kPixels | UnitType.kDegrees | UnitType.kSeconds | UnitType.kHertz | UnitType.kDotsPerPixel;
19
- static toCanonicalUnitIfPossible(unit: UnitType): UnitType;
20
- static formatInfinityOrNaN(number: number, suffix?: string): string;
21
- static formatNumber(number: number, suffix?: string): string;
22
- unit: UnitType;
23
- value: number;
24
- constructor(value: number, unitOrName?: UnitType | string);
25
- clone(): CSSUnitValue;
26
- convertTo(target_unit: UnitType): CSSUnitValue;
27
- equals(other: CSSNumericValue): boolean;
28
- getType(): CSSStyleValueType;
29
- sumValue(): CSSNumericSumValue;
30
- negate(): CSSUnitValue;
31
- invert(): CSSUnitValue | CSSMathInvert;
32
- buildCSSText(n: Nested, p: ParenLess, result: string): string;
33
- }
@@ -1,267 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.CSSUnitValue = void 0;
7
-
8
- var _tslib = require("tslib");
9
-
10
- var _utils = require("../../utils");
11
-
12
- var _CSSMathInvert = require("./CSSMathInvert");
13
-
14
- var _CSSNumericValue = require("./CSSNumericValue");
15
-
16
- var _CSSNumericValueType = require("./CSSNumericValueType");
17
-
18
- var _ = require(".");
19
-
20
- var _CSSStyleValue = require("./CSSStyleValue");
21
-
22
- /**
23
- * The CSSUnitValue interface of the CSS_Object_Model represents values that contain a single unit type.
24
- * For example, "42px" would be represented by a CSSNumericValue.
25
- *
26
- * @see https://developer.mozilla.org/en-US/docs/Web/API/CSSUnitValue
27
- */
28
-
29
- /**
30
- * Represents numeric values that can be expressed as a single number plus a
31
- * unit (or a naked number or percentage).
32
- * @see https://drafts.css-houdini.org/css-typed-om/#cssunitvalue
33
- */
34
- var CSSUnitValue =
35
- /** @class */
36
- function (_super) {
37
- (0, _tslib.__extends)(CSSUnitValue, _super);
38
-
39
- function CSSUnitValue(value, unitOrName) {
40
- if (unitOrName === void 0) {
41
- unitOrName = _.UnitType.kNumber;
42
- }
43
-
44
- var _this = this;
45
-
46
- var unit;
47
-
48
- if (typeof unitOrName === 'string') {
49
- unit = CSSUnitValue.unitFromName(unitOrName);
50
- } else {
51
- unit = unitOrName;
52
- }
53
-
54
- (0, _utils.DCHECK)(CSSUnitValue.isValidUnit(unit));
55
- _this = _super.call(this, new _CSSNumericValueType.CSSNumericValueType(unit)) || this;
56
- _this.unit = unit;
57
- _this.value = value;
58
- return _this;
59
- } // static fromCSSValue(value: CSSNumericLiteralValue) {
60
- // let unit = value.type;
61
- // if (unit === UnitType.kInteger) unit = UnitType.kNumber;
62
- // if (!this.isValidUnit(unit)) return null;
63
- // return new CSSUnitValue(value.getDoubleValue(), unit);
64
- // }
65
-
66
-
67
- CSSUnitValue.toCanonicalUnit = function (unit) {
68
- return this.canonicalUnitTypeForCategory(this.unitTypeToUnitCategory(unit));
69
- };
70
-
71
- CSSUnitValue.toCanonicalUnitIfPossible = function (unit) {
72
- var canonical_unit = this.toCanonicalUnit(unit);
73
- if (canonical_unit === _.UnitType.kUnknown) return unit;
74
- return canonical_unit;
75
- };
76
-
77
- CSSUnitValue.formatInfinityOrNaN = function (number, suffix) {
78
- if (suffix === void 0) {
79
- suffix = '';
80
- }
81
-
82
- var result = '';
83
-
84
- if (!Number.isFinite(number)) {
85
- if (number > 0) result = 'infinity';else result = '-infinity';
86
- } else {
87
- (0, _utils.DCHECK)(Number.isNaN(number));
88
- result = 'NaN';
89
- }
90
-
91
- return result += suffix;
92
- };
93
-
94
- CSSUnitValue.formatNumber = function (number, suffix) {
95
- if (suffix === void 0) {
96
- suffix = '';
97
- }
98
-
99
- return number + suffix;
100
- };
101
-
102
- CSSUnitValue.prototype.clone = function () {
103
- return new CSSUnitValue(this.value, this.unit);
104
- };
105
-
106
- CSSUnitValue.prototype.convertTo = function (target_unit) {
107
- if (this.unit === target_unit) {
108
- return new CSSUnitValue(this.value, this.unit);
109
- } // Instead of defining the scale factors for every unit to every other unit,
110
- // we simply convert to the canonical unit and back since we already have
111
- // the scale factors for canonical units.
112
-
113
-
114
- var canonical_unit = CSSUnitValue.toCanonicalUnit(this.unit);
115
-
116
- if (canonical_unit !== CSSUnitValue.toCanonicalUnit(target_unit) || canonical_unit === _.UnitType.kUnknown) {
117
- return null;
118
- }
119
-
120
- var scale_factor = _CSSStyleValue.CSSStyleValue.conversionToCanonicalUnitsScaleFactor(this.unit) / _CSSStyleValue.CSSStyleValue.conversionToCanonicalUnitsScaleFactor(target_unit);
121
-
122
- return new CSSUnitValue(this.value * scale_factor, target_unit);
123
- };
124
-
125
- CSSUnitValue.prototype.equals = function (other) {
126
- var other_unit_value = other;
127
- return this.value === other_unit_value.value && this.unit === other_unit_value.unit;
128
- };
129
-
130
- CSSUnitValue.prototype.getType = function () {
131
- return _.CSSStyleValueType.kUnitType;
132
- }; // toCSSValue() {
133
- // return new CSSNumericLiteralValue(this.value, this.unit);
134
- // }
135
- // // const CSSPrimitiveValue* ToCSSValueWithProperty(CSSPropertyID) const final;
136
- // toCalcExpressionNode() {
137
- // return CSSMathExpressionNumericLiteral.create(
138
- // new CSSNumericLiteralValue(this.value, this.unit),
139
- // );
140
- // }
141
-
142
-
143
- CSSUnitValue.prototype.sumValue = function () {
144
- var sum = [];
145
- var unit_map = {};
146
-
147
- if (this.unit !== _.UnitType.kNumber) {
148
- unit_map[CSSUnitValue.toCanonicalUnitIfPossible(this.unit)] = 1;
149
- }
150
-
151
- sum.push({
152
- value: this.value * _CSSStyleValue.CSSStyleValue.conversionToCanonicalUnitsScaleFactor(this.unit),
153
- units: unit_map
154
- });
155
- return sum;
156
- };
157
-
158
- CSSUnitValue.prototype.negate = function () {
159
- return new CSSUnitValue(-this.value, this.unit);
160
- };
161
-
162
- CSSUnitValue.prototype.invert = function () {
163
- if (this.unit === _.UnitType.kNumber) {
164
- if (this.value === 0) return null;
165
- return new CSSUnitValue(1.0 / this.value, this.unit);
166
- }
167
-
168
- return _CSSMathInvert.CSSMathInvert.create(this);
169
- };
170
-
171
- CSSUnitValue.prototype.buildCSSText = function (n, p, result) {
172
- var text;
173
-
174
- switch (this.unit) {
175
- case _.UnitType.kUnknown:
176
- // FIXME
177
- break;
178
-
179
- case _.UnitType.kInteger:
180
- text = Number(this.value).toFixed(0);
181
- break;
182
-
183
- case _.UnitType.kNumber:
184
- case _.UnitType.kPercentage:
185
- case _.UnitType.kEms:
186
- case _.UnitType.kQuirkyEms:
187
- case _.UnitType.kExs:
188
- case _.UnitType.kRems:
189
- case _.UnitType.kChs:
190
- case _.UnitType.kPixels:
191
- case _.UnitType.kCentimeters:
192
- case _.UnitType.kDotsPerPixel:
193
- case _.UnitType.kDotsPerInch:
194
- case _.UnitType.kDotsPerCentimeter:
195
- case _.UnitType.kMillimeters:
196
- case _.UnitType.kQuarterMillimeters:
197
- case _.UnitType.kInches:
198
- case _.UnitType.kPoints:
199
- case _.UnitType.kPicas:
200
- case _.UnitType.kUserUnits:
201
- case _.UnitType.kDegrees:
202
- case _.UnitType.kRadians:
203
- case _.UnitType.kGradians:
204
- case _.UnitType.kMilliseconds:
205
- case _.UnitType.kSeconds:
206
- case _.UnitType.kHertz:
207
- case _.UnitType.kKilohertz:
208
- case _.UnitType.kTurns:
209
- case _.UnitType.kFraction:
210
- case _.UnitType.kViewportWidth:
211
- case _.UnitType.kViewportHeight:
212
- case _.UnitType.kViewportInlineSize:
213
- case _.UnitType.kViewportBlockSize:
214
- case _.UnitType.kViewportMin:
215
- case _.UnitType.kViewportMax:
216
- case _.UnitType.kSmallViewportWidth:
217
- case _.UnitType.kSmallViewportHeight:
218
- case _.UnitType.kSmallViewportInlineSize:
219
- case _.UnitType.kSmallViewportBlockSize:
220
- case _.UnitType.kSmallViewportMin:
221
- case _.UnitType.kSmallViewportMax:
222
- case _.UnitType.kLargeViewportWidth:
223
- case _.UnitType.kLargeViewportHeight:
224
- case _.UnitType.kLargeViewportInlineSize:
225
- case _.UnitType.kLargeViewportBlockSize:
226
- case _.UnitType.kLargeViewportMin:
227
- case _.UnitType.kLargeViewportMax:
228
- case _.UnitType.kDynamicViewportWidth:
229
- case _.UnitType.kDynamicViewportHeight:
230
- case _.UnitType.kDynamicViewportInlineSize:
231
- case _.UnitType.kDynamicViewportBlockSize:
232
- case _.UnitType.kDynamicViewportMin:
233
- case _.UnitType.kDynamicViewportMax:
234
- case _.UnitType.kContainerWidth:
235
- case _.UnitType.kContainerHeight:
236
- case _.UnitType.kContainerInlineSize:
237
- case _.UnitType.kContainerBlockSize:
238
- case _.UnitType.kContainerMin:
239
- case _.UnitType.kContainerMax:
240
- {
241
- var kMinInteger = -999999;
242
- var kMaxInteger = 999999;
243
- var value = this.value;
244
- var unit = CSSUnitValue.unitTypeToString(this.unit);
245
-
246
- if (value < kMinInteger || value > kMaxInteger) {
247
- var unit_1 = CSSUnitValue.unitTypeToString(this.unit);
248
-
249
- if (!Number.isFinite(value) || Number.isNaN(value)) {
250
- text = CSSUnitValue.formatInfinityOrNaN(value, unit_1);
251
- } else {
252
- text = CSSUnitValue.formatNumber(value, unit_1);
253
- }
254
- } else {
255
- text = "".concat(value).concat(unit);
256
- }
257
- }
258
- }
259
-
260
- result += text;
261
- return result;
262
- };
263
-
264
- return CSSUnitValue;
265
- }(_CSSNumericValue.CSSNumericValue);
266
-
267
- exports.CSSUnitValue = CSSUnitValue;