@antv/g 5.1.0 → 5.1.1
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/properties/CSSPropertyLocalPosition.js +11 -16
- package/es/display-objects/CustomElement.d.ts +6 -2
- package/es/display-objects/CustomElement.js +15 -5
- package/lib/css/properties/CSSPropertyLocalPosition.js +11 -16
- package/lib/display-objects/CustomElement.d.ts +6 -2
- package/lib/display-objects/CustomElement.js +13 -4
- package/package.json +3 -3
|
@@ -42,22 +42,6 @@ function (_super) {
|
|
|
42
42
|
|
|
43
43
|
break;
|
|
44
44
|
|
|
45
|
-
case Shape.RECT:
|
|
46
|
-
case Shape.GROUP:
|
|
47
|
-
case Shape.IMAGE:
|
|
48
|
-
case Shape.HTML:
|
|
49
|
-
case Shape.TEXT:
|
|
50
|
-
case Shape.MESH:
|
|
51
|
-
if (!isNil(object.parsedStyle.x)) {
|
|
52
|
-
x = object.parsedStyle.x.value;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
if (!isNil(object.parsedStyle.y)) {
|
|
56
|
-
y = object.parsedStyle.y.value;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
break;
|
|
60
|
-
|
|
61
45
|
case Shape.LINE:
|
|
62
46
|
var _b = object.parsedStyle,
|
|
63
47
|
x1 = _b.x1,
|
|
@@ -70,6 +54,17 @@ function (_super) {
|
|
|
70
54
|
y = minY;
|
|
71
55
|
z = 0;
|
|
72
56
|
break;
|
|
57
|
+
|
|
58
|
+
default:
|
|
59
|
+
if (!isNil(object.parsedStyle.x)) {
|
|
60
|
+
x = object.parsedStyle.x.value;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (!isNil(object.parsedStyle.y)) {
|
|
64
|
+
y = object.parsedStyle.y.value;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
break;
|
|
73
68
|
}
|
|
74
69
|
|
|
75
70
|
object.parsedStyle.defX = x || 0;
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { DisplayObject } from './DisplayObject';
|
|
2
2
|
import type { DisplayObjectConfig } from '../dom/interfaces';
|
|
3
3
|
import type { BaseStyleProps } from '../types';
|
|
4
|
+
export interface BaseCustomElementStyleProps extends BaseStyleProps {
|
|
5
|
+
x?: number | string;
|
|
6
|
+
y?: number | string;
|
|
7
|
+
}
|
|
4
8
|
/**
|
|
5
9
|
* shadow root
|
|
6
10
|
* @see https://yuque.antfin-inc.com/antv/czqvg5/pgqipg
|
|
7
11
|
*/
|
|
8
|
-
export declare abstract class CustomElement<CustomElementStyleProps extends
|
|
9
|
-
constructor(
|
|
12
|
+
export declare abstract class CustomElement<CustomElementStyleProps extends BaseCustomElementStyleProps> extends DisplayObject<CustomElementStyleProps> {
|
|
13
|
+
constructor({ style, ...rest }?: DisplayObjectConfig<CustomElementStyleProps>);
|
|
10
14
|
/**
|
|
11
15
|
* fired after element insert into DOM tree
|
|
12
16
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __extends } from "tslib";
|
|
1
|
+
import { __assign, __extends, __rest } from "tslib";
|
|
2
2
|
import { DisplayObject } from './DisplayObject';
|
|
3
3
|
import { ElementEvent } from '../dom/interfaces';
|
|
4
4
|
/**
|
|
@@ -12,12 +12,22 @@ function (_super) {
|
|
|
12
12
|
__extends(CustomElement, _super); // private shadowNodes: DisplayObject[] = [];
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
function CustomElement(
|
|
16
|
-
if (
|
|
17
|
-
|
|
15
|
+
function CustomElement(_a) {
|
|
16
|
+
if (_a === void 0) {
|
|
17
|
+
_a = {};
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
var _this =
|
|
20
|
+
var _this = this;
|
|
21
|
+
|
|
22
|
+
var style = _a.style,
|
|
23
|
+
rest = __rest(_a, ["style"]);
|
|
24
|
+
|
|
25
|
+
_this = _super.call(this, __assign({
|
|
26
|
+
style: __assign({
|
|
27
|
+
x: '',
|
|
28
|
+
y: ''
|
|
29
|
+
}, style)
|
|
30
|
+
}, rest)) || this;
|
|
21
31
|
|
|
22
32
|
_this.handleMounted = function (e) {
|
|
23
33
|
if (e.target === e.currentTarget) {
|
|
@@ -53,22 +53,6 @@ function (_super) {
|
|
|
53
53
|
|
|
54
54
|
break;
|
|
55
55
|
|
|
56
|
-
case _types.Shape.RECT:
|
|
57
|
-
case _types.Shape.GROUP:
|
|
58
|
-
case _types.Shape.IMAGE:
|
|
59
|
-
case _types.Shape.HTML:
|
|
60
|
-
case _types.Shape.TEXT:
|
|
61
|
-
case _types.Shape.MESH:
|
|
62
|
-
if (!(0, _utils.isNil)(object.parsedStyle.x)) {
|
|
63
|
-
x = object.parsedStyle.x.value;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
if (!(0, _utils.isNil)(object.parsedStyle.y)) {
|
|
67
|
-
y = object.parsedStyle.y.value;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
break;
|
|
71
|
-
|
|
72
56
|
case _types.Shape.LINE:
|
|
73
57
|
var _b = object.parsedStyle,
|
|
74
58
|
x1 = _b.x1,
|
|
@@ -81,6 +65,17 @@ function (_super) {
|
|
|
81
65
|
y = minY;
|
|
82
66
|
z = 0;
|
|
83
67
|
break;
|
|
68
|
+
|
|
69
|
+
default:
|
|
70
|
+
if (!(0, _utils.isNil)(object.parsedStyle.x)) {
|
|
71
|
+
x = object.parsedStyle.x.value;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (!(0, _utils.isNil)(object.parsedStyle.y)) {
|
|
75
|
+
y = object.parsedStyle.y.value;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
break;
|
|
84
79
|
}
|
|
85
80
|
|
|
86
81
|
object.parsedStyle.defX = x || 0;
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { DisplayObject } from './DisplayObject';
|
|
2
2
|
import type { DisplayObjectConfig } from '../dom/interfaces';
|
|
3
3
|
import type { BaseStyleProps } from '../types';
|
|
4
|
+
export interface BaseCustomElementStyleProps extends BaseStyleProps {
|
|
5
|
+
x?: number | string;
|
|
6
|
+
y?: number | string;
|
|
7
|
+
}
|
|
4
8
|
/**
|
|
5
9
|
* shadow root
|
|
6
10
|
* @see https://yuque.antfin-inc.com/antv/czqvg5/pgqipg
|
|
7
11
|
*/
|
|
8
|
-
export declare abstract class CustomElement<CustomElementStyleProps extends
|
|
9
|
-
constructor(
|
|
12
|
+
export declare abstract class CustomElement<CustomElementStyleProps extends BaseCustomElementStyleProps> extends DisplayObject<CustomElementStyleProps> {
|
|
13
|
+
constructor({ style, ...rest }?: DisplayObjectConfig<CustomElementStyleProps>);
|
|
10
14
|
/**
|
|
11
15
|
* fired after element insert into DOM tree
|
|
12
16
|
*/
|
|
@@ -20,12 +20,21 @@ var CustomElement =
|
|
|
20
20
|
function (_super) {
|
|
21
21
|
(0, _tslib.__extends)(CustomElement, _super); // private shadowNodes: DisplayObject[] = [];
|
|
22
22
|
|
|
23
|
-
function CustomElement(
|
|
24
|
-
if (
|
|
25
|
-
|
|
23
|
+
function CustomElement(_a) {
|
|
24
|
+
if (_a === void 0) {
|
|
25
|
+
_a = {};
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
var _this =
|
|
28
|
+
var _this = this;
|
|
29
|
+
|
|
30
|
+
var style = _a.style,
|
|
31
|
+
rest = (0, _tslib.__rest)(_a, ["style"]);
|
|
32
|
+
_this = _super.call(this, (0, _tslib.__assign)({
|
|
33
|
+
style: (0, _tslib.__assign)({
|
|
34
|
+
x: '',
|
|
35
|
+
y: ''
|
|
36
|
+
}, style)
|
|
37
|
+
}, rest)) || this;
|
|
29
38
|
|
|
30
39
|
_this.handleMounted = function (e) {
|
|
31
40
|
if (e.target === e.currentTarget) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antv/g",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.1",
|
|
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.1.
|
|
41
|
+
"@antv/g-math": "^1.1.1",
|
|
42
42
|
"@antv/util": "^3.0.0",
|
|
43
43
|
"@types/offscreencanvas": "^2019.6.4",
|
|
44
44
|
"d3-color": "^1.4.0",
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"scripts": {
|
|
54
54
|
"umd": "webpack"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "5152e91b7489c53f5d2a5c3d7cb645716c506f26"
|
|
57
57
|
}
|