@uiw/react-overlay
Advanced tools
Comparing version 4.21.18 to 4.21.19
{ | ||
"name": "@uiw/react-overlay", | ||
"version": "4.21.18", | ||
"version": "4.21.19", | ||
"description": "Overlay component", | ||
@@ -47,6 +47,6 @@ "author": "Kenny Wong <wowohoo@qq.com>", | ||
"dependencies": { | ||
"@uiw/react-portal": "^4.21.18", | ||
"@uiw/utils": "^4.21.18", | ||
"@uiw/react-portal": "^4.21.19", | ||
"@uiw/utils": "^4.21.19", | ||
"react-transition-group": "~4.4.2" | ||
} | ||
} |
@@ -18,9 +18,7 @@ Overlay 基础弹出层 | ||
<!--rehype:bgWhite=true&codeSandbox=true&codePen=true--> | ||
```jsx | ||
```jsx mdx:preview&bg=#fff | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import { Overlay, Button, Card } from 'uiw'; | ||
function Demo() { | ||
export default function Demo() { | ||
const [isOpen, setIsOpen] = React.useState(false); | ||
@@ -65,4 +63,2 @@ const [hasBackdrop, setHasBackdrop] = React.useState(true); | ||
} | ||
ReactDOM.render(<Demo />, _mount_); | ||
``` | ||
@@ -72,9 +68,7 @@ | ||
<!--rehype:bgWhite=true&codeSandbox=true&codePen=true--> | ||
```jsx | ||
```jsx mdx:preview&bg=#fff | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import { Overlay, Button } from 'uiw'; | ||
import { Overlay, Button, Icon } from 'uiw'; | ||
function Demo() { | ||
export default function Demo() { | ||
const [isOpen, setIsOpen] = React.useState(false); | ||
@@ -140,4 +134,2 @@ return ( | ||
} | ||
ReactDOM.render(<Demo />, _mount_); | ||
``` | ||
@@ -149,9 +141,7 @@ | ||
<!--rehype:bgWhite=true&noScroll=true&codeSandbox=true&codePen=true--> | ||
```jsx | ||
```jsx mdx:preview&bg=#fff | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import { Overlay, Button, Card } from 'uiw'; | ||
function Demo() { | ||
export default function Demo() { | ||
const [isOpen, setIsOpen] = React.useState(false); | ||
@@ -162,7 +152,7 @@ function toggleOverlay(e) { | ||
return ( | ||
<div> | ||
<div style={{ position: 'relative', minHeight: 200 }}> | ||
<Button type="primary" onClick={toggleOverlay}>点击弹出内容</Button> | ||
<Overlay usePortal={false} isOpen={isOpen} onClose={toggleOverlay}> | ||
<Card active style={{ width: 500 }} active> | ||
<h3 style={{marginTop: 0}}>基础弹出层</h3> | ||
<h3 style={{marginTop: 0}}>基础弹出层1</h3> | ||
<p>Portals 是 react 16 提供的官方解决方案,使得组件可以脱离父组件层级挂载在DOM树的任何位置,我们利用这个方法,可将模态对话框生成到根节点的外面,默认情况生成到跟节点的外面,通过将 usePortal 设置为 false 将对话框生成在父组件层级挂载的DOM树中。</p> | ||
@@ -175,4 +165,2 @@ <Button type="danger" onClick={toggleOverlay}>关闭</Button> | ||
} | ||
ReactDOM.render(<Demo />, _mount_); | ||
``` | ||
@@ -186,9 +174,7 @@ | ||
<!--rehype:bgWhite=true&codeSandbox=true&codePen=true--> | ||
```jsx | ||
```jsx mdx:preview&bg=#fff | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import { Overlay, Button, Card } from 'uiw'; | ||
function Demo() { | ||
export default function Demo() { | ||
const [isOpen, setIsOpen] = React.useState(false); | ||
@@ -216,4 +202,2 @@ function toggleOverlay(e) { | ||
} | ||
ReactDOM.render(<Demo />, _mount_); | ||
``` | ||
@@ -220,0 +204,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
71538
291
Updated@uiw/react-portal@^4.21.19
Updated@uiw/utils@^4.21.19