@heartlandone/vega-react 2.96.0 → 2.98.0
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.
|
@@ -32,6 +32,7 @@ function splitChildren(children) {
|
|
|
32
32
|
class VegaPopoverInner extends React.PureComponent {
|
|
33
33
|
constructor(props) {
|
|
34
34
|
super(props);
|
|
35
|
+
this.state = { isMounted: false };
|
|
35
36
|
this.host = null;
|
|
36
37
|
this.popoverMount = null;
|
|
37
38
|
this.contentBox = null;
|
|
@@ -126,6 +127,9 @@ class VegaPopoverInner extends React.PureComponent {
|
|
|
126
127
|
this.popoverMount.setAttribute("slot", "popover");
|
|
127
128
|
}
|
|
128
129
|
}
|
|
130
|
+
componentDidMount() {
|
|
131
|
+
this.setState({ isMounted: true });
|
|
132
|
+
}
|
|
129
133
|
componentWillUnmount() {
|
|
130
134
|
var _a;
|
|
131
135
|
this.isUnmounting = true;
|
|
@@ -139,10 +143,12 @@ class VegaPopoverInner extends React.PureComponent {
|
|
|
139
143
|
}
|
|
140
144
|
render() {
|
|
141
145
|
const _a = this.props, { children, forwardedRef } = _a, restProps = __rest(_a, ["children", "forwardedRef"]);
|
|
146
|
+
const { isMounted } = this.state;
|
|
142
147
|
const [popoverChildren, otherChildren] = splitChildren(children);
|
|
143
148
|
return (React.createElement(React.Fragment, null,
|
|
144
149
|
React.createElement(VegaPopoverBase, Object.assign({}, restProps, { ref: this.setHostRef }), otherChildren),
|
|
145
|
-
|
|
150
|
+
isMounted &&
|
|
151
|
+
popoverChildren.length > 0 &&
|
|
146
152
|
this.popoverMount &&
|
|
147
153
|
ReactDOM.createPortal(popoverChildren, this.popoverMount)));
|
|
148
154
|
}
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@heartlandone/vega-react",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.97.0",
|
|
4
4
|
"description": "React specific wrapper for @heartlandone/vega",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"module": "./index.js",
|
|
9
9
|
"types": "./index.d.ts",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@heartlandone/vega": "2.
|
|
11
|
+
"@heartlandone/vega": "2.97.0"
|
|
12
12
|
},
|
|
13
13
|
"peerDependencies": {
|
|
14
14
|
"react": ">=16.7.0",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@heartlandone/vega-react",
|
|
3
3
|
"sideEffects": false,
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.98.0",
|
|
5
5
|
"description": "React specific wrapper for @heartlandone/vega",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
7
|
"scripts": {
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"typescript": "^4.0.0"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@heartlandone/vega": "2.
|
|
47
|
+
"@heartlandone/vega": "2.98.0"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"react": ">=16.7.0",
|