Skip to content

Commit e3f6aa8

Browse files
committed
feature: hideAction新增 resize | scroll 支持
1 parent 4f49b6d commit e3f6aa8

File tree

12 files changed

+132
-52
lines changed

12 files changed

+132
-52
lines changed

docs/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
overflow: auto;
1616
}
1717
</style>
18-
<link href="static\css\vendors.e646e3e1.css" rel="stylesheet"><link href="static\css\index.1f40c003.css" rel="stylesheet"></head>
18+
<link href="static\css\vendors.e646e3e1.css" rel="stylesheet"><link href="static\css\index.f9427e34.css" rel="stylesheet"></head>
1919

2020
<body style="background:#F5F5F5">
2121
<div class="demo" id="demo">
2222
</div>
23-
<script src="static\js\vendors.db7aeff8.chunk.js"></script><script src="static\js\index.228bcd76.js"></script></body>
23+
<script src="static\js\vendors.aed3cfaf.chunk.js"></script><script src="static\js\index.f2e49df6.js"></script></body>
2424

2525
</html>
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/static/js/index.228bcd76.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 34 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/static/js/index.f2e49df6.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 21 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -29182,39 +29182,18 @@ exports.default = _default;
2918229182

2918329183

2918429184
exports.__esModule = true;
29185-
exports.transitionTimeout = transitionTimeout;
2918629185
exports.classNamesShape = exports.timeoutsShape = void 0;
2918729186

2918829187
var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"));
2918929188

2919029189
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2919129190

29192-
function transitionTimeout(transitionType) {
29193-
var timeoutPropName = 'transition' + transitionType + 'Timeout';
29194-
var enabledPropName = 'transition' + transitionType;
29195-
return function (props) {
29196-
// If the transition is enabled
29197-
if (props[enabledPropName]) {
29198-
// If no timeout duration is provided
29199-
if (props[timeoutPropName] == null) {
29200-
return new Error(timeoutPropName + ' wasn\'t supplied to CSSTransitionGroup: ' + 'this can cause unreliable animations and won\'t be supported in ' + 'a future version of React. See ' + 'https://fb.me/react-animation-transition-group-timeout for more ' + 'information.'); // If the duration isn't a number
29201-
} else if (typeof props[timeoutPropName] !== 'number') {
29202-
return new Error(timeoutPropName + ' must be a number (in milliseconds)');
29203-
}
29204-
}
29205-
29206-
return null;
29207-
};
29208-
}
29209-
29210-
var timeoutsShape = _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.shape({
29191+
var timeoutsShape = true ? _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.shape({
2921129192
enter: _propTypes.default.number,
2921229193
exit: _propTypes.default.number
29213-
}).isRequired]);
29214-
29194+
}).isRequired]) : undefined;
2921529195
exports.timeoutsShape = timeoutsShape;
29216-
29217-
var classNamesShape = _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.shape({
29196+
var classNamesShape = true ? _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.shape({
2921829197
enter: _propTypes.default.string,
2921929198
exit: _propTypes.default.string,
2922029199
active: _propTypes.default.string
@@ -29225,8 +29204,7 @@ var classNamesShape = _propTypes.default.oneOfType([_propTypes.default.string, _
2922529204
exit: _propTypes.default.string,
2922629205
exitDone: _propTypes.default.string,
2922729206
exitActive: _propTypes.default.string
29228-
})]);
29229-
29207+
})]) : undefined;
2923029208
exports.classNamesShape = classNamesShape;
2923129209

2923229210
/***/ }),
@@ -29770,7 +29748,6 @@ function (_React$Component) {
2977029748
_using(pos, feedback);
2977129749
}
2977229750

29773-
console.log(feedback);
2977429751
result.direction = directionMap[feedback[feedback.important]];
2977529752
result.pos = pos;
2977629753
result.feedback = feedback;
@@ -29812,22 +29789,23 @@ function (_React$Component) {
2981229789
if (direction) {
2981329790
(0, _addClass.default)(popup, "".concat(this.props.prefixCls, "-direction-").concat(direction));
2981429791
}
29815-
}
29792+
} //.toFixed()
29793+
2981629794

2981729795
if ('left' in pos) {
29818-
popup.style.left = pos.left.toFixed() + 'px';
29796+
popup.style.left = ~~pos.left + 'px';
2981929797
}
2982029798

2982129799
if ('top' in pos) {
29822-
popup.style.top = pos.top.toFixed() + 'px';
29800+
popup.style.top = ~~pos.top + 'px';
2982329801
}
2982429802

2982529803
if ('right' in pos) {
29826-
popup.style.right = pos.right.toFixed() + 'px';
29804+
popup.style.right = ~~pos.right + 'px';
2982729805
}
2982829806

2982929807
if ('bottom' in pos) {
29830-
popup.style.bottom = pos.bottom.toFixed() + 'px';
29808+
popup.style.bottom = ~~pos.bottom + 'px';
2983129809
}
2983229810
}
2983329811
/**
@@ -30234,11 +30212,14 @@ function (_React$Component) {
3023430212
}
3023530213

3023630214
(0, _createClass2.default)(Portal, [{
30215+
key: "componentDidUpdate",
30216+
value: function componentDidUpdate() {
30217+
this.props.didUpdate();
30218+
}
30219+
}, {
3023730220
key: "componentDidMount",
3023830221
value: function componentDidMount() {
30239-
this.setState({
30240-
container: this.props.getContainer()
30241-
});
30222+
this.componentDidUpdate();
3024230223
}
3024330224
}, {
3024430225
key: "render",
@@ -30261,13 +30242,14 @@ function (_React$Component) {
3026130242
exports.default = Portal;
3026230243
(0, _defineProperty2.default)(Portal, "propTypes", {
3026330244
children: _propTypes.default.node.isRequired,
30264-
getContainer: _propTypes.default.func
30245+
getContainer: _propTypes.default.func,
30246+
didUpdate: _propTypes.default.func
3026530247
});
3026630248
(0, _defineProperty2.default)(Portal, "defaultProps", {
30267-
container: document.body,
3026830249
getContainer: function getContainer() {
3026930250
return document.body;
30270-
}
30251+
},
30252+
didUpdate: function didUpdate() {}
3027130253
});
3027230254

3027330255
/***/ }),
@@ -34183,4 +34165,4 @@ if (!self.fetch) {
3418334165
/***/ })
3418434166

3418534167
}]);
34186-
//# sourceMappingURL=vendors.db7aeff8.chunk.js.map
34168+
//# sourceMappingURL=vendors.aed3cfaf.chunk.js.map

docs/static/js/vendors.aed3cfaf.chunk.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/static/js/vendors.db7aeff8.chunk.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/demos/demo1.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class Select extends React.Component {
3636
placement={this.promise}
3737
popup="AAAAAAAA"
3838
action="click"
39+
hideAction="resize,scroll"
3940
>
4041
<span className="arrow">V</span>
4142
</Trigger>

0 commit comments

Comments
 (0)