@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.
- 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 +139 -4
- package/es/css/cssom/CSSNumericValue.js +1164 -5
- package/es/css/cssom/CSSTransformValue.d.ts +1 -1
- package/es/css/cssom/index.d.ts +0 -10
- package/es/css/cssom/index.js +1 -11
- 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 +139 -4
- package/lib/css/cssom/CSSNumericValue.js +1222 -52
- package/lib/css/cssom/CSSTransformValue.d.ts +1 -1
- package/lib/css/cssom/index.d.ts +0 -10
- package/lib/css/cssom/index.js +0 -130
- 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/CSSNumericValueType.d.ts +0 -33
- package/es/css/cssom/CSSNumericValueType.js +0 -259
- 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/CSSNumericValueType.d.ts +0 -33
- package/lib/css/cssom/CSSNumericValueType.js +0 -272
- package/lib/css/cssom/CSSUnitValue.d.ts +0 -33
- package/lib/css/cssom/CSSUnitValue.js +0 -267
package/lib/css/cssom/index.d.ts
CHANGED
|
@@ -10,20 +10,10 @@ 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
|
-
export * from './CSSNumericValueType';
|
|
24
15
|
export * from './CSSRGB';
|
|
25
16
|
export * from './CSSGradientValue';
|
|
26
17
|
export * from './CSSStyleValue';
|
|
27
18
|
export * from './CSSTransformValue';
|
|
28
19
|
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) {
|
|
@@ -186,19 +82,6 @@ Object.keys(_CSSNumericValue).forEach(function (key) {
|
|
|
186
82
|
});
|
|
187
83
|
});
|
|
188
84
|
|
|
189
|
-
var _CSSNumericValueType = require("./CSSNumericValueType");
|
|
190
|
-
|
|
191
|
-
Object.keys(_CSSNumericValueType).forEach(function (key) {
|
|
192
|
-
if (key === "default" || key === "__esModule") return;
|
|
193
|
-
if (key in exports && exports[key] === _CSSNumericValueType[key]) return;
|
|
194
|
-
Object.defineProperty(exports, key, {
|
|
195
|
-
enumerable: true,
|
|
196
|
-
get: function get() {
|
|
197
|
-
return _CSSNumericValueType[key];
|
|
198
|
-
}
|
|
199
|
-
});
|
|
200
|
-
});
|
|
201
|
-
|
|
202
85
|
var _CSSRGB = require("./CSSRGB");
|
|
203
86
|
|
|
204
87
|
Object.keys(_CSSRGB).forEach(function (key) {
|
|
@@ -262,17 +145,4 @@ Object.keys(_CSSTranslate).forEach(function (key) {
|
|
|
262
145
|
return _CSSTranslate[key];
|
|
263
146
|
}
|
|
264
147
|
});
|
|
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
148
|
});
|
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.6",
|
|
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.6",
|
|
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": "8c28e04155e41a948c323161a35aeda63c2294a4"
|
|
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
|
-
}
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import { __extends, __values } from "tslib";
|
|
2
|
-
/**
|
|
3
|
-
* The CSSMathMin interface of the CSS_Object_Model represents the CSS min() function.
|
|
4
|
-
* It inherits properties and methods from its parent CSSNumericValue.
|
|
5
|
-
* @see https://chromium.googlesource.com/chromium/src/+/refs/heads/main/third_party/blink/renderer/core/css/cssom/css_math_min.idl
|
|
6
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/CSSMathMin
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import { CSSMathVariadic } from './CSSMathVariadic';
|
|
10
|
-
import { CSSNumericValueType, CSSStyleValueType, typeCheck, Nested, ParenLess } from '.'; // Represents the minimum of one or more CSSNumericValues.
|
|
11
|
-
// @see https://drafts.css-houdini.org/css-typed-om/#cssmathsum
|
|
12
|
-
|
|
13
|
-
var CSSMathMin =
|
|
14
|
-
/** @class */
|
|
15
|
-
function (_super) {
|
|
16
|
-
__extends(CSSMathMin, _super);
|
|
17
|
-
|
|
18
|
-
function CSSMathMin() {
|
|
19
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
20
|
-
|
|
21
|
-
_this.operator = 'min';
|
|
22
|
-
return _this;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
CSSMathMin.create = function (values) {
|
|
26
|
-
var error = false;
|
|
27
|
-
var final_type = typeCheck(values, CSSNumericValueType.add, error);
|
|
28
|
-
return error ? null : new CSSMathMin(values, final_type);
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
CSSMathMin.prototype.clone = function () {
|
|
32
|
-
return new CSSMathMin(this.values, this.type_);
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
CSSMathMin.prototype.getType = function () {
|
|
36
|
-
return CSSStyleValueType.kMinType;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
CSSMathMin.prototype.sumValue = function () {
|
|
40
|
-
var e_1, _a;
|
|
41
|
-
|
|
42
|
-
var cur_min = this.numericValues()[0].sumValue();
|
|
43
|
-
|
|
44
|
-
if (!cur_min.length) {
|
|
45
|
-
return null;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
try {
|
|
49
|
-
for (var _b = __values(this.numericValues()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
50
|
-
var value = _c.value;
|
|
51
|
-
var child_sum = value.sumValue();
|
|
52
|
-
|
|
53
|
-
if (!child_sum.length || JSON.stringify(child_sum[0].units) !== JSON.stringify(cur_min[0].units)) {
|
|
54
|
-
return null;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
if (child_sum[0].value < cur_min[0].value) {
|
|
58
|
-
cur_min = child_sum;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
} catch (e_1_1) {
|
|
62
|
-
e_1 = {
|
|
63
|
-
error: e_1_1
|
|
64
|
-
};
|
|
65
|
-
} finally {
|
|
66
|
-
try {
|
|
67
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
68
|
-
} finally {
|
|
69
|
-
if (e_1) throw e_1.error;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
return cur_min;
|
|
74
|
-
}; // toCalcExpressionNode() {
|
|
75
|
-
// const operands: CSSMathExpressionOperation[] = [];
|
|
76
|
-
// for (const value of this.numericValues()) {
|
|
77
|
-
// const operand = value.toCalcExpressionNode();
|
|
78
|
-
// if (!operand) {
|
|
79
|
-
// continue;
|
|
80
|
-
// }
|
|
81
|
-
// operands.push(operand as CSSMathExpressionOperation);
|
|
82
|
-
// }
|
|
83
|
-
// return CSSMathExpressionOperation.createComparisonFunction(operands, CSSMathOperator.kMin);
|
|
84
|
-
// }
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
CSSMathMin.prototype.buildCSSText = function (nested, paren_less, result) {
|
|
88
|
-
var e_2, _a;
|
|
89
|
-
|
|
90
|
-
result += 'min(';
|
|
91
|
-
var first_iteration = true;
|
|
92
|
-
|
|
93
|
-
try {
|
|
94
|
-
for (var _b = __values(this.numericValues()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
95
|
-
var value = _c.value;
|
|
96
|
-
if (!first_iteration) result += ', ';
|
|
97
|
-
first_iteration = false;
|
|
98
|
-
result = value.buildCSSText(Nested.kYes, ParenLess.kYes, result);
|
|
99
|
-
}
|
|
100
|
-
} catch (e_2_1) {
|
|
101
|
-
e_2 = {
|
|
102
|
-
error: e_2_1
|
|
103
|
-
};
|
|
104
|
-
} finally {
|
|
105
|
-
try {
|
|
106
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
107
|
-
} finally {
|
|
108
|
-
if (e_2) throw e_2.error;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
result += ')';
|
|
113
|
-
return result;
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
return CSSMathMin;
|
|
117
|
-
}(CSSMathVariadic);
|
|
118
|
-
|
|
119
|
-
export { CSSMathMin };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { CSSNumericSumValue, CSSNumericValueType, CSSNumericValue } from '.';
|
|
2
|
-
import { CSSMathValue } from './CSSMathValue';
|
|
3
|
-
import { Nested, ParenLess, CSSStyleValueType } from '.';
|
|
4
|
-
export declare class CSSMathNegate extends CSSMathValue {
|
|
5
|
-
value: CSSNumericValue;
|
|
6
|
-
static create(value: CSSNumericValue): CSSMathNegate;
|
|
7
|
-
constructor(value: CSSNumericValue, type: CSSNumericValueType);
|
|
8
|
-
operator: string;
|
|
9
|
-
clone(): CSSMathNegate;
|
|
10
|
-
getType(): CSSStyleValueType;
|
|
11
|
-
equals(other: CSSNumericValue): any;
|
|
12
|
-
sumValue(): CSSNumericSumValue;
|
|
13
|
-
buildCSSText(nested: Nested, paren_less: ParenLess, result: string): string;
|
|
14
|
-
}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { __extends } from "tslib";
|
|
2
|
-
import { CSSMathValue } from './CSSMathValue';
|
|
3
|
-
import { Nested, ParenLess, CSSStyleValueType } from '.';
|
|
4
|
-
|
|
5
|
-
var CSSMathNegate =
|
|
6
|
-
/** @class */
|
|
7
|
-
function (_super) {
|
|
8
|
-
__extends(CSSMathNegate, _super);
|
|
9
|
-
|
|
10
|
-
function CSSMathNegate(value, type) {
|
|
11
|
-
var _this = _super.call(this, type) || this;
|
|
12
|
-
|
|
13
|
-
_this.value = value;
|
|
14
|
-
_this.operator = 'negate';
|
|
15
|
-
return _this;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
CSSMathNegate.create = function (value) {
|
|
19
|
-
return new CSSMathNegate(value, value.type_);
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
CSSMathNegate.prototype.clone = function () {
|
|
23
|
-
return new CSSMathNegate(this.value, this.type_);
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
CSSMathNegate.prototype.getType = function () {
|
|
27
|
-
return CSSStyleValueType.kNegateType;
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
CSSMathNegate.prototype.equals = function (other) {
|
|
31
|
-
if (other.getType() !== CSSStyleValueType.kNegateType) {
|
|
32
|
-
return false;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
var other_invert = other;
|
|
36
|
-
return this.value.equals(other_invert.value);
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
CSSMathNegate.prototype.sumValue = function () {
|
|
40
|
-
var sum = this.value.sumValue();
|
|
41
|
-
|
|
42
|
-
if (sum.length === 0) {
|
|
43
|
-
return null;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
sum.forEach(function (term) {
|
|
47
|
-
term.value *= -1;
|
|
48
|
-
});
|
|
49
|
-
return sum;
|
|
50
|
-
}; // toCalcExpressionNode(): CSSMathExpressionNode {
|
|
51
|
-
// const right_side = this.value.toCalcExpressionNode();
|
|
52
|
-
// if (!right_side) {
|
|
53
|
-
// return null;
|
|
54
|
-
// }
|
|
55
|
-
// // return CSSMathExpressionOperation::CreateArithmeticOperationSimplified(
|
|
56
|
-
// // CSSMathExpressionNumericLiteral::Create(
|
|
57
|
-
// // -1, CSSPrimitiveValue::UnitType::kNumber),
|
|
58
|
-
// // right_side, CSSMathOperator::kMultiply);
|
|
59
|
-
// }
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
CSSMathNegate.prototype.buildCSSText = function (nested, paren_less, result) {
|
|
63
|
-
if (paren_less == ParenLess.kNo) {
|
|
64
|
-
result += nested === Nested.kYes ? '(' : 'calc(';
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
result += '-';
|
|
68
|
-
result = this.value.buildCSSText(Nested.kYes, ParenLess.kNo, result);
|
|
69
|
-
|
|
70
|
-
if (paren_less === ParenLess.kNo) {
|
|
71
|
-
result += ')';
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
return result;
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
return CSSMathNegate;
|
|
78
|
-
}(CSSMathValue);
|
|
79
|
-
|
|
80
|
-
export { CSSMathNegate };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { CSSNumericValue, CSSNumericSumValue, UnitMap } from '.';
|
|
2
|
-
import { CSSMathVariadic } from './CSSMathVariadic';
|
|
3
|
-
import { CSSStyleValueType, Nested, ParenLess } from '.';
|
|
4
|
-
/**
|
|
5
|
-
* Represents the product of one or more CSSNumericValues.
|
|
6
|
-
* @see https://drafts.css-houdini.org/css-typed-om/#cssmathproduct
|
|
7
|
-
*/
|
|
8
|
-
export declare class CSSMathProduct extends CSSMathVariadic {
|
|
9
|
-
static create(values: CSSNumericValue[]): CSSMathProduct;
|
|
10
|
-
static multiplyUnitMaps(a: UnitMap, b: UnitMap): UnitMap;
|
|
11
|
-
operator: string;
|
|
12
|
-
clone(): CSSMathProduct;
|
|
13
|
-
getType(): CSSStyleValueType;
|
|
14
|
-
sumValue(): CSSNumericSumValue;
|
|
15
|
-
buildCSSText(nested: Nested, paren_less: ParenLess, result: string): string;
|
|
16
|
-
}
|