@antv/g 5.0.23-alpha.0 → 5.0.23-alpha.2
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.
- package/dist/index.umd.min.js +2 -2
- package/es/css/cssom/CSSKeywordValue.d.ts +1 -1
- package/es/css/cssom/CSSNumericSumValue.d.ts +1 -1
- package/es/css/cssom/CSSNumericValue.d.ts +108 -4
- package/es/css/cssom/CSSNumericValue.js +908 -5
- package/es/css/cssom/CSSNumericValueType.d.ts +1 -1
- package/es/css/cssom/CSSNumericValueType.js +1 -1
- package/es/css/cssom/CSSTransformValue.d.ts +1 -1
- package/es/css/cssom/index.d.ts +0 -9
- package/es/css/cssom/index.js +1 -10
- package/lib/css/cssom/CSSKeywordValue.d.ts +1 -1
- package/lib/css/cssom/CSSNumericSumValue.d.ts +1 -1
- package/lib/css/cssom/CSSNumericValue.d.ts +108 -4
- package/lib/css/cssom/CSSNumericValue.js +965 -52
- package/lib/css/cssom/CSSNumericValueType.d.ts +1 -1
- package/lib/css/cssom/CSSNumericValueType.js +59 -59
- package/lib/css/cssom/CSSTransformValue.d.ts +1 -1
- package/lib/css/cssom/index.d.ts +0 -9
- package/lib/css/cssom/index.js +0 -117
- package/package.json +3 -3
- package/es/css/cssom/CSSMathInvert.d.ts +0 -14
- package/es/css/cssom/CSSMathInvert.js +0 -84
- package/es/css/cssom/CSSMathMax.d.ts +0 -17
- package/es/css/cssom/CSSMathMax.js +0 -118
- package/es/css/cssom/CSSMathMin.d.ts +0 -17
- package/es/css/cssom/CSSMathMin.js +0 -119
- package/es/css/cssom/CSSMathNegate.d.ts +0 -14
- package/es/css/cssom/CSSMathNegate.js +0 -80
- package/es/css/cssom/CSSMathProduct.d.ts +0 -16
- package/es/css/cssom/CSSMathProduct.js +0 -109
- package/es/css/cssom/CSSMathSum.d.ts +0 -17
- package/es/css/cssom/CSSMathSum.js +0 -117
- package/es/css/cssom/CSSMathValue.d.ts +0 -11
- package/es/css/cssom/CSSMathValue.js +0 -27
- package/es/css/cssom/CSSMathVariadic.d.ts +0 -9
- package/es/css/cssom/CSSMathVariadic.js +0 -44
- package/es/css/cssom/CSSUnitValue.d.ts +0 -33
- package/es/css/cssom/CSSUnitValue.js +0 -252
- package/lib/css/cssom/CSSMathInvert.d.ts +0 -14
- package/lib/css/cssom/CSSMathInvert.js +0 -94
- package/lib/css/cssom/CSSMathMax.d.ts +0 -17
- package/lib/css/cssom/CSSMathMax.js +0 -128
- package/lib/css/cssom/CSSMathMin.d.ts +0 -17
- package/lib/css/cssom/CSSMathMin.js +0 -128
- package/lib/css/cssom/CSSMathNegate.d.ts +0 -14
- package/lib/css/cssom/CSSMathNegate.js +0 -89
- package/lib/css/cssom/CSSMathProduct.d.ts +0 -16
- package/lib/css/cssom/CSSMathProduct.js +0 -119
- package/lib/css/cssom/CSSMathSum.d.ts +0 -17
- package/lib/css/cssom/CSSMathSum.js +0 -129
- package/lib/css/cssom/CSSMathValue.d.ts +0 -11
- package/lib/css/cssom/CSSMathValue.js +0 -35
- package/lib/css/cssom/CSSMathVariadic.d.ts +0 -9
- package/lib/css/cssom/CSSMathVariadic.js +0 -55
- package/lib/css/cssom/CSSUnitValue.d.ts +0 -33
- package/lib/css/cssom/CSSUnitValue.js +0 -267
|
@@ -9,7 +9,7 @@ exports.unitTypeToBaseType = unitTypeToBaseType;
|
|
|
9
9
|
|
|
10
10
|
var _utils = require("../../utils");
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _types = require("./types");
|
|
13
13
|
|
|
14
14
|
// https://drafts.css-houdini.org/css-typed-om/#enumdef-cssnumericbasetype
|
|
15
15
|
var BaseType;
|
|
@@ -27,76 +27,76 @@ exports.BaseType = BaseType;
|
|
|
27
27
|
})(BaseType || (exports.BaseType = BaseType = {}));
|
|
28
28
|
|
|
29
29
|
function unitTypeToBaseType(unit) {
|
|
30
|
-
(0, _utils.DCHECK_NE)(unit,
|
|
30
|
+
(0, _utils.DCHECK_NE)(unit, _types.UnitType.kNumber);
|
|
31
31
|
|
|
32
32
|
switch (unit) {
|
|
33
|
-
case
|
|
34
|
-
case
|
|
35
|
-
case
|
|
36
|
-
case
|
|
37
|
-
case
|
|
38
|
-
case
|
|
39
|
-
case
|
|
40
|
-
case
|
|
41
|
-
case
|
|
42
|
-
case
|
|
43
|
-
case
|
|
44
|
-
case
|
|
45
|
-
case
|
|
46
|
-
case
|
|
47
|
-
case
|
|
48
|
-
case
|
|
49
|
-
case
|
|
50
|
-
case
|
|
51
|
-
case
|
|
52
|
-
case
|
|
53
|
-
case
|
|
54
|
-
case
|
|
55
|
-
case
|
|
56
|
-
case
|
|
57
|
-
case
|
|
58
|
-
case
|
|
59
|
-
case
|
|
60
|
-
case
|
|
61
|
-
case
|
|
62
|
-
case
|
|
63
|
-
case
|
|
64
|
-
case
|
|
65
|
-
case
|
|
66
|
-
case
|
|
67
|
-
case
|
|
68
|
-
case
|
|
69
|
-
case
|
|
70
|
-
case
|
|
71
|
-
case
|
|
72
|
-
case
|
|
73
|
-
case
|
|
74
|
-
case
|
|
33
|
+
case _types.UnitType.kEms:
|
|
34
|
+
case _types.UnitType.kExs:
|
|
35
|
+
case _types.UnitType.kPixels:
|
|
36
|
+
case _types.UnitType.kCentimeters:
|
|
37
|
+
case _types.UnitType.kMillimeters:
|
|
38
|
+
case _types.UnitType.kQuarterMillimeters:
|
|
39
|
+
case _types.UnitType.kInches:
|
|
40
|
+
case _types.UnitType.kPoints:
|
|
41
|
+
case _types.UnitType.kPicas:
|
|
42
|
+
case _types.UnitType.kUserUnits:
|
|
43
|
+
case _types.UnitType.kViewportWidth:
|
|
44
|
+
case _types.UnitType.kViewportHeight:
|
|
45
|
+
case _types.UnitType.kViewportInlineSize:
|
|
46
|
+
case _types.UnitType.kViewportBlockSize:
|
|
47
|
+
case _types.UnitType.kViewportMin:
|
|
48
|
+
case _types.UnitType.kViewportMax:
|
|
49
|
+
case _types.UnitType.kSmallViewportWidth:
|
|
50
|
+
case _types.UnitType.kSmallViewportHeight:
|
|
51
|
+
case _types.UnitType.kSmallViewportInlineSize:
|
|
52
|
+
case _types.UnitType.kSmallViewportBlockSize:
|
|
53
|
+
case _types.UnitType.kSmallViewportMin:
|
|
54
|
+
case _types.UnitType.kSmallViewportMax:
|
|
55
|
+
case _types.UnitType.kLargeViewportWidth:
|
|
56
|
+
case _types.UnitType.kLargeViewportHeight:
|
|
57
|
+
case _types.UnitType.kLargeViewportInlineSize:
|
|
58
|
+
case _types.UnitType.kLargeViewportBlockSize:
|
|
59
|
+
case _types.UnitType.kLargeViewportMin:
|
|
60
|
+
case _types.UnitType.kLargeViewportMax:
|
|
61
|
+
case _types.UnitType.kDynamicViewportWidth:
|
|
62
|
+
case _types.UnitType.kDynamicViewportHeight:
|
|
63
|
+
case _types.UnitType.kDynamicViewportInlineSize:
|
|
64
|
+
case _types.UnitType.kDynamicViewportBlockSize:
|
|
65
|
+
case _types.UnitType.kDynamicViewportMin:
|
|
66
|
+
case _types.UnitType.kDynamicViewportMax:
|
|
67
|
+
case _types.UnitType.kContainerWidth:
|
|
68
|
+
case _types.UnitType.kContainerHeight:
|
|
69
|
+
case _types.UnitType.kContainerInlineSize:
|
|
70
|
+
case _types.UnitType.kContainerBlockSize:
|
|
71
|
+
case _types.UnitType.kContainerMin:
|
|
72
|
+
case _types.UnitType.kContainerMax:
|
|
73
|
+
case _types.UnitType.kRems:
|
|
74
|
+
case _types.UnitType.kChs:
|
|
75
75
|
return BaseType.kLength;
|
|
76
76
|
|
|
77
|
-
case
|
|
78
|
-
case
|
|
77
|
+
case _types.UnitType.kMilliseconds:
|
|
78
|
+
case _types.UnitType.kSeconds:
|
|
79
79
|
return BaseType.kTime;
|
|
80
80
|
|
|
81
|
-
case
|
|
82
|
-
case
|
|
83
|
-
case
|
|
84
|
-
case
|
|
81
|
+
case _types.UnitType.kDegrees:
|
|
82
|
+
case _types.UnitType.kRadians:
|
|
83
|
+
case _types.UnitType.kGradians:
|
|
84
|
+
case _types.UnitType.kTurns:
|
|
85
85
|
return BaseType.kAngle;
|
|
86
86
|
|
|
87
|
-
case
|
|
88
|
-
case
|
|
87
|
+
case _types.UnitType.kHertz:
|
|
88
|
+
case _types.UnitType.kKilohertz:
|
|
89
89
|
return BaseType.kFrequency;
|
|
90
90
|
|
|
91
|
-
case
|
|
92
|
-
case
|
|
93
|
-
case
|
|
91
|
+
case _types.UnitType.kDotsPerPixel:
|
|
92
|
+
case _types.UnitType.kDotsPerInch:
|
|
93
|
+
case _types.UnitType.kDotsPerCentimeter:
|
|
94
94
|
return BaseType.kResolution;
|
|
95
95
|
|
|
96
|
-
case
|
|
96
|
+
case _types.UnitType.kFraction:
|
|
97
97
|
return BaseType.kFlex;
|
|
98
98
|
|
|
99
|
-
case
|
|
99
|
+
case _types.UnitType.kPercentage:
|
|
100
100
|
return BaseType.kPercent;
|
|
101
101
|
|
|
102
102
|
default:
|
|
@@ -139,7 +139,7 @@ var CSSNumericValueType =
|
|
|
139
139
|
function () {
|
|
140
140
|
function CSSNumericValueType(unit, exponent) {
|
|
141
141
|
if (unit === void 0) {
|
|
142
|
-
unit =
|
|
142
|
+
unit = _types.UnitType.kNumber;
|
|
143
143
|
}
|
|
144
144
|
|
|
145
145
|
if (exponent === void 0) {
|
|
@@ -152,7 +152,7 @@ function () {
|
|
|
152
152
|
this.hasPercentHint = false;
|
|
153
153
|
this.exponents = new Array(BaseType.kNumBaseTypes).fill(0);
|
|
154
154
|
|
|
155
|
-
if (unit !==
|
|
155
|
+
if (unit !== _types.UnitType.kNumber) {
|
|
156
156
|
this.setExponent(unitTypeToBaseType(unit), exponent);
|
|
157
157
|
}
|
|
158
158
|
}
|
package/lib/css/cssom/index.d.ts
CHANGED
|
@@ -10,14 +10,6 @@ export * from './types';
|
|
|
10
10
|
export * from './CSSColorValue';
|
|
11
11
|
export * from './CSSKeywordValue';
|
|
12
12
|
export * from './CSSMathOperator';
|
|
13
|
-
export * from './CSSMathInvert';
|
|
14
|
-
export * from './CSSMathMax';
|
|
15
|
-
export * from './CSSMathMin';
|
|
16
|
-
export * from './CSSMathNegate';
|
|
17
|
-
export * from './CSSMathProduct';
|
|
18
|
-
export * from './CSSMathSum';
|
|
19
|
-
export * from './CSSMathValue';
|
|
20
|
-
export * from './CSSMathVariadic';
|
|
21
13
|
export * from './CSSNumericSumValue';
|
|
22
14
|
export * from './CSSNumericValue';
|
|
23
15
|
export * from './CSSNumericValueType';
|
|
@@ -26,4 +18,3 @@ export * from './CSSGradientValue';
|
|
|
26
18
|
export * from './CSSStyleValue';
|
|
27
19
|
export * from './CSSTransformValue';
|
|
28
20
|
export * from './CSSTranslate';
|
|
29
|
-
export * from './CSSUnitValue';
|
package/lib/css/cssom/index.js
CHANGED
|
@@ -56,110 +56,6 @@ Object.keys(_CSSMathOperator).forEach(function (key) {
|
|
|
56
56
|
});
|
|
57
57
|
});
|
|
58
58
|
|
|
59
|
-
var _CSSMathInvert = require("./CSSMathInvert");
|
|
60
|
-
|
|
61
|
-
Object.keys(_CSSMathInvert).forEach(function (key) {
|
|
62
|
-
if (key === "default" || key === "__esModule") return;
|
|
63
|
-
if (key in exports && exports[key] === _CSSMathInvert[key]) return;
|
|
64
|
-
Object.defineProperty(exports, key, {
|
|
65
|
-
enumerable: true,
|
|
66
|
-
get: function get() {
|
|
67
|
-
return _CSSMathInvert[key];
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
var _CSSMathMax = require("./CSSMathMax");
|
|
73
|
-
|
|
74
|
-
Object.keys(_CSSMathMax).forEach(function (key) {
|
|
75
|
-
if (key === "default" || key === "__esModule") return;
|
|
76
|
-
if (key in exports && exports[key] === _CSSMathMax[key]) return;
|
|
77
|
-
Object.defineProperty(exports, key, {
|
|
78
|
-
enumerable: true,
|
|
79
|
-
get: function get() {
|
|
80
|
-
return _CSSMathMax[key];
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
var _CSSMathMin = require("./CSSMathMin");
|
|
86
|
-
|
|
87
|
-
Object.keys(_CSSMathMin).forEach(function (key) {
|
|
88
|
-
if (key === "default" || key === "__esModule") return;
|
|
89
|
-
if (key in exports && exports[key] === _CSSMathMin[key]) return;
|
|
90
|
-
Object.defineProperty(exports, key, {
|
|
91
|
-
enumerable: true,
|
|
92
|
-
get: function get() {
|
|
93
|
-
return _CSSMathMin[key];
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
var _CSSMathNegate = require("./CSSMathNegate");
|
|
99
|
-
|
|
100
|
-
Object.keys(_CSSMathNegate).forEach(function (key) {
|
|
101
|
-
if (key === "default" || key === "__esModule") return;
|
|
102
|
-
if (key in exports && exports[key] === _CSSMathNegate[key]) return;
|
|
103
|
-
Object.defineProperty(exports, key, {
|
|
104
|
-
enumerable: true,
|
|
105
|
-
get: function get() {
|
|
106
|
-
return _CSSMathNegate[key];
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
});
|
|
110
|
-
|
|
111
|
-
var _CSSMathProduct = require("./CSSMathProduct");
|
|
112
|
-
|
|
113
|
-
Object.keys(_CSSMathProduct).forEach(function (key) {
|
|
114
|
-
if (key === "default" || key === "__esModule") return;
|
|
115
|
-
if (key in exports && exports[key] === _CSSMathProduct[key]) return;
|
|
116
|
-
Object.defineProperty(exports, key, {
|
|
117
|
-
enumerable: true,
|
|
118
|
-
get: function get() {
|
|
119
|
-
return _CSSMathProduct[key];
|
|
120
|
-
}
|
|
121
|
-
});
|
|
122
|
-
});
|
|
123
|
-
|
|
124
|
-
var _CSSMathSum = require("./CSSMathSum");
|
|
125
|
-
|
|
126
|
-
Object.keys(_CSSMathSum).forEach(function (key) {
|
|
127
|
-
if (key === "default" || key === "__esModule") return;
|
|
128
|
-
if (key in exports && exports[key] === _CSSMathSum[key]) return;
|
|
129
|
-
Object.defineProperty(exports, key, {
|
|
130
|
-
enumerable: true,
|
|
131
|
-
get: function get() {
|
|
132
|
-
return _CSSMathSum[key];
|
|
133
|
-
}
|
|
134
|
-
});
|
|
135
|
-
});
|
|
136
|
-
|
|
137
|
-
var _CSSMathValue = require("./CSSMathValue");
|
|
138
|
-
|
|
139
|
-
Object.keys(_CSSMathValue).forEach(function (key) {
|
|
140
|
-
if (key === "default" || key === "__esModule") return;
|
|
141
|
-
if (key in exports && exports[key] === _CSSMathValue[key]) return;
|
|
142
|
-
Object.defineProperty(exports, key, {
|
|
143
|
-
enumerable: true,
|
|
144
|
-
get: function get() {
|
|
145
|
-
return _CSSMathValue[key];
|
|
146
|
-
}
|
|
147
|
-
});
|
|
148
|
-
});
|
|
149
|
-
|
|
150
|
-
var _CSSMathVariadic = require("./CSSMathVariadic");
|
|
151
|
-
|
|
152
|
-
Object.keys(_CSSMathVariadic).forEach(function (key) {
|
|
153
|
-
if (key === "default" || key === "__esModule") return;
|
|
154
|
-
if (key in exports && exports[key] === _CSSMathVariadic[key]) return;
|
|
155
|
-
Object.defineProperty(exports, key, {
|
|
156
|
-
enumerable: true,
|
|
157
|
-
get: function get() {
|
|
158
|
-
return _CSSMathVariadic[key];
|
|
159
|
-
}
|
|
160
|
-
});
|
|
161
|
-
});
|
|
162
|
-
|
|
163
59
|
var _CSSNumericSumValue = require("./CSSNumericSumValue");
|
|
164
60
|
|
|
165
61
|
Object.keys(_CSSNumericSumValue).forEach(function (key) {
|
|
@@ -262,17 +158,4 @@ Object.keys(_CSSTranslate).forEach(function (key) {
|
|
|
262
158
|
return _CSSTranslate[key];
|
|
263
159
|
}
|
|
264
160
|
});
|
|
265
|
-
});
|
|
266
|
-
|
|
267
|
-
var _CSSUnitValue = require("./CSSUnitValue");
|
|
268
|
-
|
|
269
|
-
Object.keys(_CSSUnitValue).forEach(function (key) {
|
|
270
|
-
if (key === "default" || key === "__esModule") return;
|
|
271
|
-
if (key in exports && exports[key] === _CSSUnitValue[key]) return;
|
|
272
|
-
Object.defineProperty(exports, key, {
|
|
273
|
-
enumerable: true,
|
|
274
|
-
get: function get() {
|
|
275
|
-
return _CSSUnitValue[key];
|
|
276
|
-
}
|
|
277
|
-
});
|
|
278
161
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antv/g",
|
|
3
|
-
"version": "5.0.23-alpha.
|
|
3
|
+
"version": "5.0.23-alpha.2",
|
|
4
4
|
"description": "A core module including ECS and DI container.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"homepage": "https://github.com/antvis/g#readme",
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@antv/g-math": "^1.0.20-alpha.
|
|
41
|
+
"@antv/g-math": "^1.0.20-alpha.2",
|
|
42
42
|
"@antv/util": "^3.0.0",
|
|
43
43
|
"@types/offscreencanvas": "^2019.6.4",
|
|
44
44
|
"d3-color": "^1.4.0",
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"scripts": {
|
|
53
53
|
"umd": "webpack"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "af1c0b90600f8b68d1008877bc98aefa308fefa8"
|
|
56
56
|
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { CSSMathValue } from './CSSMathValue';
|
|
2
|
-
import type { CSSNumericSumValue, CSSNumericValue } from '.';
|
|
3
|
-
import { CSSNumericValueType, CSSStyleValueType, Nested, ParenLess } from '.';
|
|
4
|
-
export declare class CSSMathInvert extends CSSMathValue {
|
|
5
|
-
private value;
|
|
6
|
-
static create(value: CSSNumericValue): CSSMathInvert;
|
|
7
|
-
constructor(value: CSSNumericValue, type: CSSNumericValueType);
|
|
8
|
-
operator: string;
|
|
9
|
-
clone(): CSSMathInvert;
|
|
10
|
-
getType(): CSSStyleValueType;
|
|
11
|
-
equals(other: CSSNumericValue): any;
|
|
12
|
-
sumValue(): CSSNumericSumValue;
|
|
13
|
-
buildCSSText(nested: Nested, paren_less: ParenLess, result: string): string;
|
|
14
|
-
}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { __extends } from "tslib";
|
|
2
|
-
import { CSSMathValue } from './CSSMathValue';
|
|
3
|
-
import { CSSNumericValueType, CSSStyleValueType, Nested, ParenLess } from '.';
|
|
4
|
-
|
|
5
|
-
var CSSMathInvert =
|
|
6
|
-
/** @class */
|
|
7
|
-
function (_super) {
|
|
8
|
-
__extends(CSSMathInvert, _super);
|
|
9
|
-
|
|
10
|
-
function CSSMathInvert(value, type) {
|
|
11
|
-
var _this = _super.call(this, type) || this;
|
|
12
|
-
|
|
13
|
-
_this.value = value;
|
|
14
|
-
_this.operator = 'invert';
|
|
15
|
-
return _this;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
CSSMathInvert.create = function (value) {
|
|
19
|
-
var type = CSSNumericValueType.negateExponents(value.type_);
|
|
20
|
-
return new CSSMathInvert(value, type);
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
CSSMathInvert.prototype.clone = function () {
|
|
24
|
-
return new CSSMathInvert(this.value, this.type_);
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
CSSMathInvert.prototype.getType = function () {
|
|
28
|
-
return CSSStyleValueType.kInvertType;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
CSSMathInvert.prototype.equals = function (other) {
|
|
32
|
-
if (other.getType() !== CSSStyleValueType.kInvertType) {
|
|
33
|
-
return false;
|
|
34
|
-
} // We can safely cast here as we know 'other' has the same type as us.
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
var other_invert = other;
|
|
38
|
-
return this.value.equals(other_invert.value);
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
CSSMathInvert.prototype.sumValue = function () {
|
|
42
|
-
var sum = this.value.sumValue();
|
|
43
|
-
|
|
44
|
-
if (sum.length === 0 || sum.length !== 1 || sum[0].value === 0) {
|
|
45
|
-
return null;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
Object.keys(sum[0].units).forEach(function (key) {
|
|
49
|
-
sum[0].units[key] *= -1;
|
|
50
|
-
});
|
|
51
|
-
sum[0].value = 1.0 / sum[0].value;
|
|
52
|
-
return sum;
|
|
53
|
-
}; // toCalcExpressionNode(): CSSMathExpressionNode {
|
|
54
|
-
// const right_side = this.value.toCalcExpressionNode();
|
|
55
|
-
// if (!right_side) {
|
|
56
|
-
// return null;
|
|
57
|
-
// }
|
|
58
|
-
// // return CSSMathExpressionOperation::CreateArithmeticOperation(
|
|
59
|
-
// // CSSMathExpressionNumericLiteral::Create(
|
|
60
|
-
// // 1, UnitType.kNumber),
|
|
61
|
-
// // right_side, CSSMathOperator.kDivide);
|
|
62
|
-
// return null;
|
|
63
|
-
// }
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
CSSMathInvert.prototype.buildCSSText = function (nested, paren_less, result) {
|
|
67
|
-
if (paren_less == ParenLess.kNo) {
|
|
68
|
-
result += nested === Nested.kYes ? '(' : 'calc(';
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
result += '1 / ';
|
|
72
|
-
result = this.value.buildCSSText(Nested.kYes, ParenLess.kNo, result);
|
|
73
|
-
|
|
74
|
-
if (paren_less === ParenLess.kNo) {
|
|
75
|
-
result += ')';
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
return result;
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
return CSSMathInvert;
|
|
82
|
-
}(CSSMathValue);
|
|
83
|
-
|
|
84
|
-
export { CSSMathInvert };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The CSSMathMin interface of the CSS_Object_Model represents the CSS min() function.
|
|
3
|
-
* It inherits properties and methods from its parent CSSNumericValue.
|
|
4
|
-
* @see https://chromium.googlesource.com/chromium/src/+/refs/heads/main/third_party/blink/renderer/core/css/cssom/css_math_min.idl
|
|
5
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/CSSMathMax
|
|
6
|
-
*/
|
|
7
|
-
import { CSSMathVariadic } from './CSSMathVariadic';
|
|
8
|
-
import type { CSSNumericValue, CSSNumericSumValue } from '.';
|
|
9
|
-
import { Nested, ParenLess, CSSStyleValueType } from '.';
|
|
10
|
-
export declare class CSSMathMax extends CSSMathVariadic {
|
|
11
|
-
static create(values: CSSNumericValue[]): CSSMathMax;
|
|
12
|
-
operator: string;
|
|
13
|
-
clone(): CSSMathMax;
|
|
14
|
-
getType(): CSSStyleValueType;
|
|
15
|
-
sumValue(): CSSNumericSumValue;
|
|
16
|
-
buildCSSText(nested: Nested, paren_less: ParenLess, result: string): string;
|
|
17
|
-
}
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The CSSMathMin interface of the CSS_Object_Model represents the CSS min() function.
|
|
3
|
-
* It inherits properties and methods from its parent CSSNumericValue.
|
|
4
|
-
* @see https://chromium.googlesource.com/chromium/src/+/refs/heads/main/third_party/blink/renderer/core/css/cssom/css_math_min.idl
|
|
5
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/CSSMathMax
|
|
6
|
-
*/
|
|
7
|
-
import { __extends, __values } from "tslib";
|
|
8
|
-
import { CSSMathVariadic } from './CSSMathVariadic';
|
|
9
|
-
import { Nested, ParenLess, CSSNumericValueType, CSSStyleValueType, typeCheck } from '.'; // Represents the maximum of one or more CSSNumericValues.
|
|
10
|
-
// @see https://drafts.css-houdini.org/css-typed-om/#cssmathsum
|
|
11
|
-
|
|
12
|
-
var CSSMathMax =
|
|
13
|
-
/** @class */
|
|
14
|
-
function (_super) {
|
|
15
|
-
__extends(CSSMathMax, _super);
|
|
16
|
-
|
|
17
|
-
function CSSMathMax() {
|
|
18
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
19
|
-
|
|
20
|
-
_this.operator = 'max';
|
|
21
|
-
return _this;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
CSSMathMax.create = function (values) {
|
|
25
|
-
var error = false;
|
|
26
|
-
var final_type = typeCheck(values, CSSNumericValueType.add, error);
|
|
27
|
-
return error ? null : new CSSMathMax(values, final_type);
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
CSSMathMax.prototype.clone = function () {
|
|
31
|
-
return new CSSMathMax(this.values, this.type_);
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
CSSMathMax.prototype.getType = function () {
|
|
35
|
-
return CSSStyleValueType.kMaxType;
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
CSSMathMax.prototype.sumValue = function () {
|
|
39
|
-
var e_1, _a;
|
|
40
|
-
|
|
41
|
-
var cur_max = this.numericValues()[0].sumValue();
|
|
42
|
-
|
|
43
|
-
if (!cur_max.length) {
|
|
44
|
-
return null;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
try {
|
|
48
|
-
for (var _b = __values(this.numericValues()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
49
|
-
var value = _c.value;
|
|
50
|
-
var child_sum = value.sumValue();
|
|
51
|
-
|
|
52
|
-
if (!child_sum.length || JSON.stringify(child_sum[0].units) !== JSON.stringify(cur_max[0].units)) {
|
|
53
|
-
return null;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
if (child_sum[0].value < cur_max[0].value) {
|
|
57
|
-
cur_max = child_sum;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
} catch (e_1_1) {
|
|
61
|
-
e_1 = {
|
|
62
|
-
error: e_1_1
|
|
63
|
-
};
|
|
64
|
-
} finally {
|
|
65
|
-
try {
|
|
66
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
67
|
-
} finally {
|
|
68
|
-
if (e_1) throw e_1.error;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
return cur_max;
|
|
73
|
-
}; // toCalcExpressionNode() {
|
|
74
|
-
// const operands: CSSMathExpressionOperation[] = [];
|
|
75
|
-
// for (const value of this.numericValues()) {
|
|
76
|
-
// const operand = value.toCalcExpressionNode();
|
|
77
|
-
// if (!operand) {
|
|
78
|
-
// continue;
|
|
79
|
-
// }
|
|
80
|
-
// operands.push(operand as CSSMathExpressionOperation);
|
|
81
|
-
// }
|
|
82
|
-
// return CSSMathExpressionOperation.createComparisonFunction(operands, CSSMathOperator.kMax);
|
|
83
|
-
// }
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
CSSMathMax.prototype.buildCSSText = function (nested, paren_less, result) {
|
|
87
|
-
var e_2, _a;
|
|
88
|
-
|
|
89
|
-
result += 'max(';
|
|
90
|
-
var first_iteration = true;
|
|
91
|
-
|
|
92
|
-
try {
|
|
93
|
-
for (var _b = __values(this.numericValues()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
94
|
-
var value = _c.value;
|
|
95
|
-
if (!first_iteration) result += ', ';
|
|
96
|
-
first_iteration = false;
|
|
97
|
-
result = value.buildCSSText(Nested.kYes, ParenLess.kYes, result);
|
|
98
|
-
}
|
|
99
|
-
} catch (e_2_1) {
|
|
100
|
-
e_2 = {
|
|
101
|
-
error: e_2_1
|
|
102
|
-
};
|
|
103
|
-
} finally {
|
|
104
|
-
try {
|
|
105
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
106
|
-
} finally {
|
|
107
|
-
if (e_2) throw e_2.error;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
result += ')';
|
|
112
|
-
return result;
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
return CSSMathMax;
|
|
116
|
-
}(CSSMathVariadic);
|
|
117
|
-
|
|
118
|
-
export { CSSMathMax };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The CSSMathMin interface of the CSS_Object_Model represents the CSS min() function.
|
|
3
|
-
* It inherits properties and methods from its parent CSSNumericValue.
|
|
4
|
-
* @see https://chromium.googlesource.com/chromium/src/+/refs/heads/main/third_party/blink/renderer/core/css/cssom/css_math_min.idl
|
|
5
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/CSSMathMin
|
|
6
|
-
*/
|
|
7
|
-
import { CSSMathVariadic } from './CSSMathVariadic';
|
|
8
|
-
import type { CSSNumericValue, CSSNumericSumValue } from '.';
|
|
9
|
-
import { CSSStyleValueType, Nested, ParenLess } from '.';
|
|
10
|
-
export declare class CSSMathMin extends CSSMathVariadic {
|
|
11
|
-
static create(values: CSSNumericValue[]): CSSMathMin;
|
|
12
|
-
operator: string;
|
|
13
|
-
clone(): CSSMathMin;
|
|
14
|
-
getType(): CSSStyleValueType;
|
|
15
|
-
sumValue(): CSSNumericSumValue;
|
|
16
|
-
buildCSSText(nested: Nested, paren_less: ParenLess, result: string): string;
|
|
17
|
-
}
|