Skip to content

Commit c2a16d4

Browse files
committed
日常开发提交
1 parent bff811d commit c2a16d4

File tree

7 files changed

+194
-133
lines changed

7 files changed

+194
-133
lines changed

examples/demos/demo1.js

Lines changed: 48 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,22 @@ import React, { Component } from "react";
22
import { findDOMNode } from "react-dom";
33
import Trigger from "../../src";
44

5-
function TriggerButton({ placement, offset }) {
5+
const animateClassNames = {
6+
appear: "animated",
7+
appearActive: "fadeBottomIn",
8+
enter: "animated",
9+
enterActive: "fadeBottomIn",
10+
enterDone: "",
11+
exit: "animated",
12+
exitActive: "fadeBottomOut",
13+
exitDone: "",
14+
};
15+
16+
function TriggerButton({ text, ...props }) {
617
return (
718
<Trigger
8-
placement={placement}
919
offset={2}
20+
// maskClosable={false}
1021
popup={
1122
<div
1223
style={{
@@ -20,8 +31,9 @@ function TriggerButton({ placement, offset }) {
2031
test...
2132
</div>
2233
}
34+
{...props}
2335
>
24-
<button>{placement}</button>
36+
<button>{text || props.placement}</button>
2537
</Trigger>
2638
);
2739
}
@@ -51,6 +63,39 @@ export default class DEMO extends Component {
5163
<TriggerButton placement="rightTop" />
5264
<TriggerButton placement="right" />
5365
<TriggerButton placement="rightBottom" />
66+
<hr />
67+
<TriggerButton
68+
placement="bottomLeft"
69+
action="contextMenu"
70+
text="action:contextMenu"
71+
popupTransition={{ classNames: animateClassNames, timeout: 300 }}
72+
/>
73+
<TriggerButton
74+
placement="bottomLeft"
75+
action="click"
76+
text="action:click"
77+
popupTransition={{ classNames: animateClassNames, timeout: 300 }}
78+
/>
79+
<TriggerButton
80+
placement="bottomLeft"
81+
action="hover"
82+
text="action:hover"
83+
delay={200}
84+
popupTransition={{ classNames: animateClassNames, timeout: 300 }}
85+
/>
86+
<TriggerButton
87+
placement="bottomLeft"
88+
action="focus"
89+
text="action:focus"
90+
popupTransition={{ classNames: animateClassNames, timeout: 300 }}
91+
/>
92+
<hr />
93+
<TriggerButton placement="bottomLeft" mask text="mask" />
94+
<TriggerButton
95+
placement="bottomLeft"
96+
popupTransition={{ classNames: animateClassNames, timeout: 300 }}
97+
text="popupTransition"
98+
/>
5499
</div>
55100
);
56101
}

examples/index.html

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
<!DOCTYPE html>
2-
<html style="width:100%; height:100%; overflow:hidden;">
2+
<html>
3+
<head>
4+
<meta charset="utf-8" />
5+
<title>popup</title>
6+
<meta
7+
name="viewport"
8+
content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1"
9+
/>
10+
<style type="text/css">
11+
.demo {
12+
width: 800px;
13+
height: 450px;
14+
margin: 100px auto;
15+
background: #fff;
16+
font-size: 12px;
17+
overflow: auto;
18+
}
19+
</style>
20+
</head>
321

4-
<head>
5-
<meta charset="utf-8">
6-
<title>popup</title>
7-
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1">
8-
<style type="text/css">
9-
.demo {
10-
width: 800px;
11-
height: 450px;
12-
margin: 100px auto;
13-
background: #FFF;
14-
font-size: 12px;
15-
overflow: auto;
16-
}
17-
</style>
18-
</head>
19-
20-
<body style="background:#F5F5F5">
21-
<div class="demo" id="demo">
22-
</div>
23-
</body>
24-
25-
</html>
22+
<body style="background: #f5f5f5;">
23+
<div class="demo" id="demo"></div>
24+
</body>
25+
</html>

package-lock.json

Lines changed: 13 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"classnames": "^2.2.6",
4949
"dom-helpers": "^5.1.4",
5050
"jq-position": "^1.0.0",
51-
"react-widget-popup": "^3.4.3",
51+
"react-widget-popup": "^3.4.5",
5252
"react-widget-portal": "^1.2.0"
5353
},
5454
"devDependencies": {

src/PopupRootComponent.js

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)