diff --git a/.travis.yml b/.travis.yml index 908a1a89..818244b6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ notifications: - yiminghe@gmail.com node_js: -- 12 +- 14 before_install: - | diff --git a/examples/ant-design.tsx b/examples/ant-design.tsx index 6e03053c..f7c02103 100644 --- a/examples/ant-design.tsx +++ b/examples/ant-design.tsx @@ -3,7 +3,8 @@ import '../assets/index.less'; import * as React from 'react'; import Dialog from '../src/DialogWrap'; -const clearPath = 'M793 242H366v-74c0-6.7-7.7-10.4-12.9' + +const clearPath = + 'M793 242H366v-74c0-6.7-7.7-10.4-12.9' + '-6.3l-142 112c-4.1 3.2-4.1 9.4 0 12.6l142 112c' + '5.2 4.1 12.9 0.4 12.9-6.3v-74h415v470H175c-4.4' + ' 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h618c35.3 0 64-' + @@ -19,22 +20,22 @@ const getSvg = (path: string, props = {}, align = false) => { fill="currentColor" style={align ? { verticalAlign: '-.125em ' } : {}} > - + ); }; const MyControl = () => { - const [visible1, setVisible1] = React.useState(false); + const [visible1, setVisible1] = React.useState(true); const [visible2, setVisible2] = React.useState(false); - const [visible3, setVisible3] = React.useState(true); + const [visible3, setVisible3] = React.useState(false); const [width, setWidth] = React.useState(600); const [destroyOnClose, setDestroyOnClose] = React.useState(false); const [center, setCenter] = React.useState(false); const [mousePosition, setMousePosition] = React.useState({ x: null, - y: null + y: null, }); const [useIcon, setUseIcon] = React.useState(false); const [forceRender, setForceRender] = React.useState(false); @@ -45,45 +46,45 @@ const MyControl = () => { y: e.pageY, }); setVisible1(true); - } + }; const onClose = () => { setVisible1(false); - } + }; const onClose2 = () => { setVisible2(false); - } + }; const onClose3 = () => { setVisible3(false); - } + }; const closeAll = () => { setVisible1(false); setVisible2(false); setVisible3(false); - } + }; const onDestroyOnCloseChange = (e: React.ChangeEvent) => { setDestroyOnClose(e.target.checked); - } + }; const onForceRenderChange = (e: React.ChangeEvent) => { setForceRender(e.target.checked); - } + }; const changeWidth = () => { setWidth(width === 600 ? 800 : 600); - } + }; const centerEvent = (e: React.ChangeEvent) => { setCenter(e.target.checked); - } + }; const toggleCloseIcon = () => { setUseIcon(!useIcon); - } + }; const style = { width }; @@ -109,66 +110,92 @@ const MyControl = () => { >

basic modal

- - - + + +
); const dialog2 = ( - +

basic modal

- - - - + + + +
); const dialog3 = ( - +

initialized with forceRender and visbile true

- - - + + +
); return ( -
+