@elliemae/ds-portal 3.36.0-rc.0 → 3.37.0-next.0
Sign up to get free protection for your applications and to get access to all the features.
package/dist/cjs/DSPortal.js
CHANGED
@@ -68,8 +68,7 @@ class DSPortal extends import_react.Component {
|
|
68
68
|
}
|
69
69
|
}
|
70
70
|
createPortalContainer() {
|
71
|
-
if (!import_ds_utilities.DOCUMENT)
|
72
|
-
return null;
|
71
|
+
if (!import_ds_utilities.DOCUMENT) return null;
|
73
72
|
const { className } = this.props;
|
74
73
|
const { cssClassName } = (0, import_ds_classnames.convertPropToCssClassName)(blockName, className);
|
75
74
|
const container = import_ds_utilities.DOCUMENT.createElement("div");
|
package/dist/cjs/DSPortal.js.map
CHANGED
@@ -2,6 +2,6 @@
|
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../src/DSPortal.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
4
4
|
"sourcesContent": ["/* eslint-disable react/prop-types */\nimport React, { Component } from 'react';\nimport ReactDOM from 'react-dom';\nimport { convertPropToCssClassName } from '@elliemae/ds-classnames';\nimport { isFunction, DOCUMENT } from '@elliemae/ds-utilities';\n\nconst blockName = 'portal';\n\nconst canRenderPortal = isFunction(ReactDOM.createPortal);\n\n// TODO: If this is rendered on server, is going to break\n\nclass DSPortal extends Component {\n // eslint-disable-next-line react/static-property-placement\n static defaultProps = { onRender: () => null };\n\n constructor(props) {\n super(props);\n\n this.createPortalContainer = this.createPortalContainer.bind(this);\n this.renderNoPortal = this.renderNoPortal.bind(this);\n }\n\n // eslint-disable-next-line react/state-in-constructor\n state = { isMounted: false };\n\n componentDidMount() {\n const { onRender } = this.props;\n this.portalEl = this.createPortalContainer();\n if (DOCUMENT && this.portalEl) {\n DOCUMENT.body.appendChild(this.portalEl);\n onRender();\n this.setState({ isMounted: true });\n }\n }\n\n componentDidUpdate() {\n if (!canRenderPortal) {\n this.renderNoPortal();\n }\n }\n\n componentWillUnmount() {\n if (this.portalEl) {\n this.portalEl.parentNode.removeChild(this.portalEl);\n }\n }\n\n createPortalContainer() {\n if (!DOCUMENT) return null;\n\n const { className } = this.props;\n const { cssClassName } = convertPropToCssClassName(blockName, className);\n const container = DOCUMENT.createElement('div');\n container.classList.add(cssClassName);\n container.setAttribute('data-testid', 'portal');\n\n return container;\n }\n\n renderNoPortal() {\n const { children } = this.props;\n ReactDOM.unstable_renderSubtreeIntoContainer(this, <div>{children}</div>, this.portalEl);\n }\n\n render() {\n const { children } = this.props;\n const { isMounted } = this.state;\n return !canRenderPortal || !isMounted ? null : ReactDOM.createPortal(children, this.portalEl);\n }\n}\nexport { DSPortal };\nexport default DSPortal;\n", "import * as React from 'react';\nexport { React };\n"],
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD8DgC;AA7DvD,mBAAiC;AACjC,uBAAqB;AACrB,2BAA0C;AAC1C,0BAAqC;AAErC,MAAM,YAAY;AAElB,MAAM,sBAAkB,gCAAW,iBAAAA,QAAS,YAAY;AAIxD,MAAM,iBAAiB,uBAAU;AAAA,EAI/B,YAAY,OAAO;AACjB,UAAM,KAAK;AAOb;AAAA,iBAAQ,EAAE,WAAW,MAAM;AALzB,SAAK,wBAAwB,KAAK,sBAAsB,KAAK,IAAI;AACjE,SAAK,iBAAiB,KAAK,eAAe,KAAK,IAAI;AAAA,EACrD;AAAA,EAKA,oBAAoB;AAClB,UAAM,EAAE,SAAS,IAAI,KAAK;AAC1B,SAAK,WAAW,KAAK,sBAAsB;AAC3C,QAAI,gCAAY,KAAK,UAAU;AAC7B,mCAAS,KAAK,YAAY,KAAK,QAAQ;AACvC,eAAS;AACT,WAAK,SAAS,EAAE,WAAW,KAAK,CAAC;AAAA,IACnC;AAAA,EACF;AAAA,EAEA,qBAAqB;AACnB,QAAI,CAAC,iBAAiB;AACpB,WAAK,eAAe;AAAA,IACtB;AAAA,EACF;AAAA,EAEA,uBAAuB;AACrB,QAAI,KAAK,UAAU;AACjB,WAA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AO;AAAA,EACT;AAAA,EAEA,iBAAiB;AACf,UAAM,EAAE,SAAS,IAAI,KAAK;AAC1B,qBAAAA,QAAS,oCAAoC,MAAM,4CAAC,SAAK,UAAS,GAAQ,KAAK,QAAQ;AAAA,EACzF;AAAA,EAEA,SAAS;AACP,UAAM,EAAE,SAAS,IAAI,KAAK;AAC1B,UAAM,EAAE,UAAU,IAAI,KAAK;AAC3B,WAAO,CAAC,mBAAmB,CAAC,YAAY,OAAO,iBAAAA,QAAS,aAAa,UAAU,KAAK,QAAQ;AAAA,EAC9F;AACF;AAAA;AA1DM,SAEG,eAAe,EAAE,UAAU,MAAM,KAAK;AA0D/C,IAAO,mBAAQ;",
|
6
6
|
"names": ["ReactDOM"]
|
7
7
|
}
|
package/dist/esm/DSPortal.js
CHANGED
@@ -34,8 +34,7 @@ class DSPortal extends Component {
|
|
34
34
|
}
|
35
35
|
}
|
36
36
|
createPortalContainer() {
|
37
|
-
if (!DOCUMENT)
|
38
|
-
return null;
|
37
|
+
if (!DOCUMENT) return null;
|
39
38
|
const { className } = this.props;
|
40
39
|
const { cssClassName } = convertPropToCssClassName(blockName, className);
|
41
40
|
const container = DOCUMENT.createElement("div");
|
package/dist/esm/DSPortal.js.map
CHANGED
@@ -2,6 +2,6 @@
|
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/DSPortal.tsx"],
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\nimport React, { Component } from 'react';\nimport ReactDOM from 'react-dom';\nimport { convertPropToCssClassName } from '@elliemae/ds-classnames';\nimport { isFunction, DOCUMENT } from '@elliemae/ds-utilities';\n\nconst blockName = 'portal';\n\nconst canRenderPortal = isFunction(ReactDOM.createPortal);\n\n// TODO: If this is rendered on server, is going to break\n\nclass DSPortal extends Component {\n // eslint-disable-next-line react/static-property-placement\n static defaultProps = { onRender: () => null };\n\n constructor(props) {\n super(props);\n\n this.createPortalContainer = this.createPortalContainer.bind(this);\n this.renderNoPortal = this.renderNoPortal.bind(this);\n }\n\n // eslint-disable-next-line react/state-in-constructor\n state = { isMounted: false };\n\n componentDidMount() {\n const { onRender } = this.props;\n this.portalEl = this.createPortalContainer();\n if (DOCUMENT && this.portalEl) {\n DOCUMENT.body.appendChild(this.portalEl);\n onRender();\n this.setState({ isMounted: true });\n }\n }\n\n componentDidUpdate() {\n if (!canRenderPortal) {\n this.renderNoPortal();\n }\n }\n\n componentWillUnmount() {\n if (this.portalEl) {\n this.portalEl.parentNode.removeChild(this.portalEl);\n }\n }\n\n createPortalContainer() {\n if (!DOCUMENT) return null;\n\n const { className } = this.props;\n const { cssClassName } = convertPropToCssClassName(blockName, className);\n const container = DOCUMENT.createElement('div');\n container.classList.add(cssClassName);\n container.setAttribute('data-testid', 'portal');\n\n return container;\n }\n\n renderNoPortal() {\n const { children } = this.props;\n ReactDOM.unstable_renderSubtreeIntoContainer(this, <div>{children}</div>, this.portalEl);\n }\n\n render() {\n const { children } = this.props;\n const { isMounted } = this.state;\n return !canRenderPortal || !isMounted ? null : ReactDOM.createPortal(children, this.portalEl);\n }\n}\nexport { DSPortal };\nexport default DSPortal;\n"],
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;AC8DgC;AA7DvD,SAAgB,iBAAiB;AACjC,OAAO,cAAc;AACrB,SAAS,iCAAiC;AAC1C,SAAS,YAAY,gBAAgB;AAErC,MAAM,YAAY;AAElB,MAAM,kBAAkB,WAAW,SAAS,YAAY;AAIxD,MAAM,iBAAiB,UAAU;AAAA,EAI/B,YAAY,OAAO;AACjB,UAAM,KAAK;AAOb;AAAA,iBAAQ,EAAE,WAAW,MAAM;AALzB,SAAK,wBAAwB,KAAK,sBAAsB,KAAK,IAAI;AACjE,SAAK,iBAAiB,KAAK,eAAe,KAAK,IAAI;AAAA,EACrD;AAAA,EAKA,oBAAoB;AAClB,UAAM,EAAE,SAAS,IAAI,KAAK;AAC1B,SAAK,WAAW,KAAK,sBA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AEA,wBAAwB;AACtB,QAAI,CAAC,SAAU,QAAO;AAEtB,UAAM,EAAE,UAAU,IAAI,KAAK;AAC3B,UAAM,EAAE,aAAa,IAAI,0BAA0B,WAAW,SAAS;AACvE,UAAM,YAAY,SAAS,cAAc,KAAK;AAC9C,cAAU,UAAU,IAAI,YAAY;AACpC,cAAU,aAAa,eAAe,QAAQ;AAE9C,WAAO;AAAA,EACT;AAAA,EAEA,iBAAiB;AACf,UAAM,EAAE,SAAS,IAAI,KAAK;AAC1B,aAAS,oCAAoC,MAAM,oBAAC,SAAK,UAAS,GAAQ,KAAK,QAAQ;AAAA,EACzF;AAAA,EAEA,SAAS;AACP,UAAM,EAAE,SAAS,IAAI,KAAK;AAC1B,UAAM,EAAE,UAAU,IAAI,KAAK;AAC3B,WAAO,CAAC,mBAAmB,CAAC,YAAY,OAAO,SAAS,aAAa,UAAU,KAAK,QAAQ;AAAA,EAC9F;AACF;AAAA;AA1DM,SAEG,eAAe,EAAE,UAAU,MAAM,KAAK;AA0D/C,IAAO,mBAAQ;",
|
6
6
|
"names": []
|
7
7
|
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import React, { Component } from 'react';
|
2
|
+
declare class DSPortal extends Component {
|
3
|
+
static defaultProps: {
|
4
|
+
onRender: () => null;
|
5
|
+
};
|
6
|
+
constructor(props: any);
|
7
|
+
state: {
|
8
|
+
isMounted: boolean;
|
9
|
+
};
|
10
|
+
componentDidMount(): void;
|
11
|
+
componentDidUpdate(): void;
|
12
|
+
componentWillUnmount(): void;
|
13
|
+
createPortalContainer(): HTMLDivElement | null;
|
14
|
+
renderNoPortal(): void;
|
15
|
+
render(): React.ReactPortal | null;
|
16
|
+
}
|
17
|
+
export { DSPortal };
|
18
|
+
export default DSPortal;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@elliemae/ds-portal",
|
3
|
-
"version": "3.
|
3
|
+
"version": "3.37.0-next.0",
|
4
4
|
"license": "MIT",
|
5
5
|
"description": "ICE MT - Dimsum - Portal",
|
6
6
|
"files": [
|
@@ -36,13 +36,13 @@
|
|
36
36
|
"indent": 4
|
37
37
|
},
|
38
38
|
"dependencies": {
|
39
|
-
"@elliemae/ds-classnames": "3.
|
40
|
-
"@elliemae/ds-utilities": "3.
|
39
|
+
"@elliemae/ds-classnames": "3.37.0-next.0",
|
40
|
+
"@elliemae/ds-utilities": "3.37.0-next.0"
|
41
41
|
},
|
42
42
|
"devDependencies": {
|
43
43
|
"@elliemae/pui-cli": "~9.0.0-next.31",
|
44
44
|
"styled-components": "~5.3.9",
|
45
|
-
"@elliemae/ds-monorepo-devops": "3.
|
45
|
+
"@elliemae/ds-monorepo-devops": "3.37.0-next.0"
|
46
46
|
},
|
47
47
|
"peerDependencies": {
|
48
48
|
"react": "^17.0.2",
|