8 changed files with 187 additions and 29 deletions
@ -0,0 +1,66 @@ |
|||
import { |
|||
Button, |
|||
ButtonGroup, |
|||
Card, |
|||
ControlGroup, |
|||
Elevation, |
|||
FormGroup, |
|||
HotkeysProvider, |
|||
Icon, |
|||
InputGroup, |
|||
Overlay, |
|||
TextArea, |
|||
} from "@blueprintjs/core" |
|||
import { Cell, Column, Table2 } from "@blueprintjs/table" |
|||
import React from "react" |
|||
import cs from "classnames" |
|||
import style from "./dialog.module.scss" |
|||
import { useState } from "react" |
|||
|
|||
export default function Dialog(props: any) { |
|||
const { isOpen, setIsOpen } = props |
|||
|
|||
const [title, setTitle] = useState<string>("") |
|||
|
|||
function onInput(){ |
|||
console.log('onInput'); |
|||
} |
|||
function onChange(){ |
|||
console.log('onChange'); |
|||
} |
|||
return ( |
|||
<Overlay |
|||
isOpen={isOpen} |
|||
onClose={() => { |
|||
setIsOpen(false) |
|||
}} |
|||
> |
|||
<div className={cs(style.dialog)}> |
|||
<Card> |
|||
<form className="addClock clearfix"> |
|||
<FormGroup label="标题" labelFor="title-input" labelInfo="(required)"> |
|||
<InputGroup value={title} onChange={e => setTitle(e.target.value)} id="title-input" placeholder="请输入标题" /> |
|||
</FormGroup> |
|||
<FormGroup helperText="一个通用的时间表示法" label="时间区间" labelFor="time-input" labelInfo="(required)"> |
|||
<InputGroup onInput={()=>onInput()} onChange={()=>onChange()} id="time-input" placeholder="请输入时间区间" /> |
|||
</FormGroup> |
|||
<FormGroup label="描述" labelFor="desc-input"> |
|||
<TextArea id="desc-input" style={{ width: "100%" }} growVertically={true} large={true} intent="primary" /> |
|||
</FormGroup> |
|||
<ButtonGroup style={{ float: "right" }}> |
|||
<Button |
|||
intent="primary" |
|||
onClick={() => { |
|||
setIsOpen(true) |
|||
}} |
|||
> |
|||
确认 |
|||
</Button> |
|||
<Button intent="danger">取消</Button> |
|||
</ButtonGroup> |
|||
</form> |
|||
</Card> |
|||
</div> |
|||
</Overlay> |
|||
) |
|||
} |
@ -0,0 +1,31 @@ |
|||
.dialog { |
|||
left: calc(50vw - 200px); |
|||
width: 400px; |
|||
margin: 10vh 0; |
|||
top: 0; |
|||
&:global(.bp3-overlay-appear), |
|||
&:global(.bp3-overlay-enter) { |
|||
transform: translateY(-50vh) rotate(-10deg); |
|||
} |
|||
|
|||
&:global(.bp3-overlay-appear-active), |
|||
&:global(.bp3-overlay-enter-active) { |
|||
transform: translateY(0) rotate(0deg); |
|||
transition-delay: 0; |
|||
transition-duration: 0.3s; |
|||
transition-property: transform; |
|||
transition-timing-function: cubic-bezier(0.54, 1.12, 0.38, 1.11); |
|||
} |
|||
|
|||
&:global(.bp3-overlay-exit) { |
|||
transform: translateY(0) rotate(0deg); |
|||
} |
|||
|
|||
&:global(.bp3-overlay-exit-active) { |
|||
transform: translateY(150vh) rotate(-20deg); |
|||
transition-delay: 0; |
|||
transition-duration: 0.5s; |
|||
transition-property: transform; |
|||
transition-timing-function: cubic-bezier(0.4, 1, 0.75, 0.9); |
|||
} |
|||
} |
@ -1,12 +1,12 @@ |
|||
.container{ |
|||
.container { |
|||
padding: 20px; |
|||
max-width: 100%; |
|||
margin: 0 auto; |
|||
.title{ |
|||
.title { |
|||
font-size: 25px; |
|||
font-weight: bolder; |
|||
} |
|||
.opeation{ |
|||
.opeation { |
|||
margin: 20px 0; |
|||
} |
|||
} |
|||
|
Loading…
Reference in new issue