@ray-js/components 0.6.14 → 0.6.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/Progress/Progress.d.ts +4 -0
- package/lib/Progress/Progress.js +13 -0
- package/lib/Progress/Progress.thing.d.ts +4 -0
- package/lib/Progress/Progress.thing.js +17 -0
- package/lib/Progress/Progress.wechat.d.ts +4 -0
- package/lib/Progress/Progress.wechat.js +17 -0
- package/lib/Progress/index.d.ts +3 -0
- package/lib/Progress/index.js +2 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +2 -2
- package/package.json +4 -4
- package/lib/Button/index.md +0 -41
- package/lib/Camera/index.md +0 -48
- package/lib/Checkbox/index.md +0 -34
- package/lib/CheckboxGroup/index.md +0 -37
- package/lib/CoverView/index.md +0 -26
- package/lib/DatePicker/index.md +0 -38
- package/lib/Form/index.md +0 -30
- package/lib/Icon/index.md +0 -33
- package/lib/Image/index.md +0 -50
- package/lib/Input/index.md +0 -43
- package/lib/IpcPlayer/index.md +0 -82
- package/lib/Label/index.md +0 -31
- package/lib/LinearGradient/index.md +0 -34
- package/lib/Map/index.md +0 -126
- package/lib/Modal/index.md +0 -33
- package/lib/Motion/Fade/index.d.ts +0 -4
- package/lib/Motion/Fade/index.js +0 -28
- package/lib/Motion/Fade/index.thing.d.ts +0 -4
- package/lib/Motion/Fade/index.thing.js +0 -78
- package/lib/Motion/Fade/index.wechat.d.ts +0 -4
- package/lib/Motion/Fade/index.wechat.js +0 -78
- package/lib/Motion/PullUp/index.d.ts +0 -4
- package/lib/Motion/PullUp/index.js +0 -28
- package/lib/Motion/PullUp/index.thing.d.ts +0 -4
- package/lib/Motion/PullUp/index.thing.js +0 -82
- package/lib/Motion/PullUp/index.wechat.d.ts +0 -4
- package/lib/Motion/PullUp/index.wechat.js +0 -82
- package/lib/Motion/PushDown/index.d.ts +0 -4
- package/lib/Motion/PushDown/index.js +0 -28
- package/lib/Motion/PushDown/index.thing.d.ts +0 -4
- package/lib/Motion/PushDown/index.thing.js +0 -82
- package/lib/Motion/PushDown/index.wechat.d.ts +0 -4
- package/lib/Motion/PushDown/index.wechat.js +0 -82
- package/lib/Motion/ScaleFadeIn/index.d.ts +0 -4
- package/lib/Motion/ScaleFadeIn/index.js +0 -28
- package/lib/Motion/ScaleFadeIn/index.thing.d.ts +0 -4
- package/lib/Motion/ScaleFadeIn/index.thing.js +0 -83
- package/lib/Motion/ScaleFadeIn/index.wechat.d.ts +0 -4
- package/lib/Motion/ScaleFadeIn/index.wechat.js +0 -83
- package/lib/Motion/ScalePullDown/index.d.ts +0 -4
- package/lib/Motion/ScalePullDown/index.js +0 -28
- package/lib/Motion/ScalePullDown/index.thing.d.ts +0 -4
- package/lib/Motion/ScalePullDown/index.thing.js +0 -103
- package/lib/Motion/ScalePullDown/index.wechat.d.ts +0 -4
- package/lib/Motion/ScalePullDown/index.wechat.js +0 -103
- package/lib/Motion/index.d.ts +0 -14
- package/lib/Motion/index.js +0 -14
- package/lib/Motion/index.md +0 -69
- package/lib/Motion/props.d.ts +0 -97
- package/lib/Motion/props.js +0 -62
- package/lib/MovableArea/index.md +0 -23
- package/lib/MovableView/index.md +0 -61
- package/lib/NativeVideo/index.md +0 -74
- package/lib/PageContainer/index.md +0 -42
- package/lib/Picker/index.md +0 -37
- package/lib/PickerView/index.md +0 -33
- package/lib/PickerViewColumn/index.md +0 -23
- package/lib/RadialGradient/index.md +0 -34
- package/lib/Radio/index.md +0 -30
- package/lib/RadioGroup/index.md +0 -41
- package/lib/RichText/index.md +0 -117
- package/lib/ScrollView/index.md +0 -37
- package/lib/Slider/index.md +0 -63
- package/lib/Swiper/index.md +0 -44
- package/lib/SwiperItem/index.md +0 -23
- package/lib/Switch/index.md +0 -31
- package/lib/Text/index.md +0 -29
- package/lib/Textarea/index.md +0 -46
- package/lib/TimePicker/index.md +0 -37
- package/lib/View/index.md +0 -33
- package/lib/WebView/index.md +0 -33
@@ -1,82 +0,0 @@
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
2
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
3
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
4
|
-
var _excluded = ["style", "className", "children", "show", "onShow", "onHide", "showDuration", "hideDuration", "dropHeight", "delay"];
|
5
|
-
import * as React from 'react';
|
6
|
-
import { inlineStyle } from '@ray-js/framework-shared';
|
7
|
-
import { View } from '@ray-js/components';
|
8
|
-
import { defaultMotionPushDownProps } from '../props';
|
9
|
-
|
10
|
-
var PushDown = function (props) {
|
11
|
-
var isPreShow = React.useRef(false);
|
12
|
-
|
13
|
-
var style = props.style,
|
14
|
-
className = props.className,
|
15
|
-
children = props.children,
|
16
|
-
show = props.show,
|
17
|
-
onShow = props.onShow,
|
18
|
-
onHide = props.onHide,
|
19
|
-
showDuration = props.showDuration,
|
20
|
-
hideDuration = props.hideDuration,
|
21
|
-
dropHeight = props.dropHeight,
|
22
|
-
delay = props.delay,
|
23
|
-
restProps = _objectWithoutProperties(props, _excluded);
|
24
|
-
|
25
|
-
var _React$useState = React.useState(undefined),
|
26
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
27
|
-
anim = _React$useState2[0],
|
28
|
-
setAnim = _React$useState2[1];
|
29
|
-
|
30
|
-
var _React$useState3 = React.useState(false),
|
31
|
-
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
32
|
-
isAddNode = _React$useState4[0],
|
33
|
-
setIsAddNode = _React$useState4[1]; // 是否将节点渲染到页面上
|
34
|
-
|
35
|
-
|
36
|
-
var animationRef = React.useRef(null);
|
37
|
-
var isFirstRenderRef = React.useRef(true);
|
38
|
-
React.useEffect(function () {
|
39
|
-
animationRef.current = ty.createAnimation({
|
40
|
-
duration: 0,
|
41
|
-
timingFunction: 'ease'
|
42
|
-
});
|
43
|
-
}, []);
|
44
|
-
React.useEffect(function () {
|
45
|
-
if (show) {
|
46
|
-
isPreShow.current = true;
|
47
|
-
setIsAddNode(true);
|
48
|
-
} else if (isPreShow.current) {
|
49
|
-
isPreShow.current = false;
|
50
|
-
setTimeout(function () {
|
51
|
-
setIsAddNode(false);
|
52
|
-
}, delay + hideDuration);
|
53
|
-
}
|
54
|
-
|
55
|
-
if (isFirstRenderRef.current) {
|
56
|
-
isFirstRenderRef.current = false;
|
57
|
-
animationRef.current.translateY(show ? 0 : -dropHeight).step({
|
58
|
-
duration: 0
|
59
|
-
});
|
60
|
-
} else {
|
61
|
-
animationRef.current.translateY(show ? 0 : -dropHeight).step({
|
62
|
-
duration: show ? showDuration : hideDuration,
|
63
|
-
delay: delay
|
64
|
-
});
|
65
|
-
}
|
66
|
-
|
67
|
-
var temp = animationRef.current.export();
|
68
|
-
setTimeout(function () {
|
69
|
-
setAnim(temp);
|
70
|
-
}, 20);
|
71
|
-
show && typeof onShow === 'function' && onShow();
|
72
|
-
!show && typeof onHide === 'function' && onHide();
|
73
|
-
}, [show]);
|
74
|
-
return isAddNode && /*#__PURE__*/React.createElement(View, _extends({
|
75
|
-
animation: anim,
|
76
|
-
style: inlineStyle(style),
|
77
|
-
className: className
|
78
|
-
}, restProps), children);
|
79
|
-
};
|
80
|
-
|
81
|
-
PushDown.defaultProps = defaultMotionPushDownProps;
|
82
|
-
export default PushDown;
|
@@ -1,82 +0,0 @@
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
2
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
3
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
4
|
-
var _excluded = ["style", "className", "children", "show", "onShow", "onHide", "showDuration", "hideDuration", "dropHeight", "delay"];
|
5
|
-
import * as React from 'react';
|
6
|
-
import { inlineStyle } from '@ray-js/framework-shared';
|
7
|
-
import { View } from '@ray-js/components';
|
8
|
-
import { defaultMotionPushDownProps } from '../props';
|
9
|
-
|
10
|
-
var PushDown = function (props) {
|
11
|
-
var isPreShow = React.useRef(false);
|
12
|
-
|
13
|
-
var style = props.style,
|
14
|
-
className = props.className,
|
15
|
-
children = props.children,
|
16
|
-
show = props.show,
|
17
|
-
onShow = props.onShow,
|
18
|
-
onHide = props.onHide,
|
19
|
-
showDuration = props.showDuration,
|
20
|
-
hideDuration = props.hideDuration,
|
21
|
-
dropHeight = props.dropHeight,
|
22
|
-
delay = props.delay,
|
23
|
-
restProps = _objectWithoutProperties(props, _excluded);
|
24
|
-
|
25
|
-
var _React$useState = React.useState(undefined),
|
26
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
27
|
-
anim = _React$useState2[0],
|
28
|
-
setAnim = _React$useState2[1];
|
29
|
-
|
30
|
-
var _React$useState3 = React.useState(false),
|
31
|
-
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
32
|
-
isAddNode = _React$useState4[0],
|
33
|
-
setIsAddNode = _React$useState4[1]; // 是否将节点渲染到页面上
|
34
|
-
|
35
|
-
|
36
|
-
var animationRef = React.useRef(null);
|
37
|
-
var isFirstRenderRef = React.useRef(true);
|
38
|
-
React.useEffect(function () {
|
39
|
-
animationRef.current = wx.createAnimation({
|
40
|
-
duration: 0,
|
41
|
-
timingFunction: 'ease'
|
42
|
-
});
|
43
|
-
}, []);
|
44
|
-
React.useEffect(function () {
|
45
|
-
if (show) {
|
46
|
-
isPreShow.current = true;
|
47
|
-
setIsAddNode(true);
|
48
|
-
} else if (isPreShow.current) {
|
49
|
-
isPreShow.current = false;
|
50
|
-
setTimeout(function () {
|
51
|
-
setIsAddNode(false);
|
52
|
-
}, delay + hideDuration);
|
53
|
-
}
|
54
|
-
|
55
|
-
if (isFirstRenderRef.current) {
|
56
|
-
isFirstRenderRef.current = false;
|
57
|
-
animationRef.current.translateY(show ? 0 : -dropHeight).step({
|
58
|
-
duration: 0
|
59
|
-
});
|
60
|
-
} else {
|
61
|
-
animationRef.current.translateY(show ? 0 : -dropHeight).step({
|
62
|
-
duration: show ? showDuration : hideDuration,
|
63
|
-
delay: delay
|
64
|
-
});
|
65
|
-
}
|
66
|
-
|
67
|
-
var temp = animationRef.current.export();
|
68
|
-
setTimeout(function () {
|
69
|
-
setAnim(temp);
|
70
|
-
}, 20);
|
71
|
-
show && typeof onShow === 'function' && onShow();
|
72
|
-
!show && typeof onHide === 'function' && onHide();
|
73
|
-
}, [show]);
|
74
|
-
return isAddNode && /*#__PURE__*/React.createElement(View, _extends({
|
75
|
-
animation: anim,
|
76
|
-
style: inlineStyle(style),
|
77
|
-
className: className
|
78
|
-
}, restProps), children);
|
79
|
-
};
|
80
|
-
|
81
|
-
PushDown.defaultProps = defaultMotionPushDownProps;
|
82
|
-
export default PushDown;
|
@@ -1,28 +0,0 @@
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
2
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
3
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
4
|
-
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
5
|
-
import React from 'react';
|
6
|
-
|
7
|
-
var Fade = /*#__PURE__*/function (_React$Component) {
|
8
|
-
_inherits(Fade, _React$Component);
|
9
|
-
|
10
|
-
var _super = _createSuper(Fade);
|
11
|
-
|
12
|
-
function Fade() {
|
13
|
-
_classCallCheck(this, Fade);
|
14
|
-
|
15
|
-
return _super.apply(this, arguments);
|
16
|
-
}
|
17
|
-
|
18
|
-
_createClass(Fade, [{
|
19
|
-
key: "render",
|
20
|
-
value: function render() {
|
21
|
-
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", null, "\u672A\u5B9E\u73B0"));
|
22
|
-
}
|
23
|
-
}]);
|
24
|
-
|
25
|
-
return Fade;
|
26
|
-
}(React.Component);
|
27
|
-
|
28
|
-
export { Fade as default };
|
@@ -1,83 +0,0 @@
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
2
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
3
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
4
|
-
var _excluded = ["style", "className", "children", "show", "onShow", "onHide", "showDuration", "hideDuration", "delay", "initScale", "finalScale"];
|
5
|
-
import * as React from 'react';
|
6
|
-
import { inlineStyle } from '@ray-js/framework-shared';
|
7
|
-
import { View } from '@ray-js/components';
|
8
|
-
import { defaultMotionScaleFadeInProps } from '../props';
|
9
|
-
|
10
|
-
var ScaleFadeIn = function (props) {
|
11
|
-
var isPreShow = React.useRef(false);
|
12
|
-
|
13
|
-
var style = props.style,
|
14
|
-
className = props.className,
|
15
|
-
children = props.children,
|
16
|
-
show = props.show,
|
17
|
-
onShow = props.onShow,
|
18
|
-
onHide = props.onHide,
|
19
|
-
showDuration = props.showDuration,
|
20
|
-
hideDuration = props.hideDuration,
|
21
|
-
delay = props.delay,
|
22
|
-
initScale = props.initScale,
|
23
|
-
finalScale = props.finalScale,
|
24
|
-
restProps = _objectWithoutProperties(props, _excluded);
|
25
|
-
|
26
|
-
var _React$useState = React.useState(false),
|
27
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
28
|
-
isAddNode = _React$useState2[0],
|
29
|
-
setIsAddNode = _React$useState2[1]; // 是否将节点渲染到页面上
|
30
|
-
|
31
|
-
|
32
|
-
var _React$useState3 = React.useState(undefined),
|
33
|
-
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
34
|
-
anim = _React$useState4[0],
|
35
|
-
setAnim = _React$useState4[1];
|
36
|
-
|
37
|
-
var animationRef = React.useRef(null);
|
38
|
-
var isFirstRenderRef = React.useRef(true);
|
39
|
-
React.useEffect(function () {
|
40
|
-
animationRef.current = ty.createAnimation({
|
41
|
-
duration: 0,
|
42
|
-
timingFunction: 'ease'
|
43
|
-
});
|
44
|
-
}, []);
|
45
|
-
React.useEffect(function () {
|
46
|
-
if (show) {
|
47
|
-
isPreShow.current = true;
|
48
|
-
setIsAddNode(true);
|
49
|
-
} else if (isPreShow.current) {
|
50
|
-
isPreShow.current = false;
|
51
|
-
setTimeout(function () {
|
52
|
-
setIsAddNode(false);
|
53
|
-
}, delay + hideDuration);
|
54
|
-
}
|
55
|
-
|
56
|
-
if (isFirstRenderRef.current) {
|
57
|
-
isFirstRenderRef.current = false;
|
58
|
-
animationRef.current.scale(show ? 1 : initScale).opacity(show ? 1 : 0).step({
|
59
|
-
duration: 0
|
60
|
-
});
|
61
|
-
} else {
|
62
|
-
animationRef.current.scale(show ? 1 : finalScale).opacity(show ? 1 : 0).step({
|
63
|
-
duration: show ? showDuration : hideDuration,
|
64
|
-
delay: delay
|
65
|
-
});
|
66
|
-
}
|
67
|
-
|
68
|
-
var temp = animationRef.current.export();
|
69
|
-
setTimeout(function () {
|
70
|
-
setAnim(temp);
|
71
|
-
}, 20);
|
72
|
-
show && typeof onShow === 'function' && onShow();
|
73
|
-
!show && typeof onHide === 'function' && onHide();
|
74
|
-
}, [show]);
|
75
|
-
return isAddNode && /*#__PURE__*/React.createElement(View, _extends({
|
76
|
-
animation: anim,
|
77
|
-
style: inlineStyle(style),
|
78
|
-
className: className
|
79
|
-
}, restProps), children);
|
80
|
-
};
|
81
|
-
|
82
|
-
ScaleFadeIn.defaultProps = defaultMotionScaleFadeInProps;
|
83
|
-
export default ScaleFadeIn;
|
@@ -1,83 +0,0 @@
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
2
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
3
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
4
|
-
var _excluded = ["style", "className", "children", "show", "onShow", "onHide", "showDuration", "hideDuration", "delay", "initScale", "finalScale"];
|
5
|
-
import * as React from 'react';
|
6
|
-
import { inlineStyle } from '@ray-js/framework-shared';
|
7
|
-
import { View } from '@ray-js/components';
|
8
|
-
import { defaultMotionScaleFadeInProps } from '../props';
|
9
|
-
|
10
|
-
var ScaleFadeIn = function (props) {
|
11
|
-
var isPreShow = React.useRef(false);
|
12
|
-
|
13
|
-
var style = props.style,
|
14
|
-
className = props.className,
|
15
|
-
children = props.children,
|
16
|
-
show = props.show,
|
17
|
-
onShow = props.onShow,
|
18
|
-
onHide = props.onHide,
|
19
|
-
showDuration = props.showDuration,
|
20
|
-
hideDuration = props.hideDuration,
|
21
|
-
delay = props.delay,
|
22
|
-
initScale = props.initScale,
|
23
|
-
finalScale = props.finalScale,
|
24
|
-
restProps = _objectWithoutProperties(props, _excluded);
|
25
|
-
|
26
|
-
var _React$useState = React.useState(false),
|
27
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
28
|
-
isAddNode = _React$useState2[0],
|
29
|
-
setIsAddNode = _React$useState2[1]; // 是否将节点渲染到页面上
|
30
|
-
|
31
|
-
|
32
|
-
var _React$useState3 = React.useState(undefined),
|
33
|
-
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
34
|
-
anim = _React$useState4[0],
|
35
|
-
setAnim = _React$useState4[1];
|
36
|
-
|
37
|
-
var animationRef = React.useRef(null);
|
38
|
-
var isFirstRenderRef = React.useRef(true);
|
39
|
-
React.useEffect(function () {
|
40
|
-
animationRef.current = wx.createAnimation({
|
41
|
-
duration: 0,
|
42
|
-
timingFunction: 'ease'
|
43
|
-
});
|
44
|
-
}, []);
|
45
|
-
React.useEffect(function () {
|
46
|
-
if (show) {
|
47
|
-
isPreShow.current = true;
|
48
|
-
setIsAddNode(true);
|
49
|
-
} else if (isPreShow.current) {
|
50
|
-
isPreShow.current = false;
|
51
|
-
setTimeout(function () {
|
52
|
-
setIsAddNode(false);
|
53
|
-
}, delay + hideDuration);
|
54
|
-
}
|
55
|
-
|
56
|
-
if (isFirstRenderRef.current) {
|
57
|
-
isFirstRenderRef.current = false;
|
58
|
-
animationRef.current.scale(show ? 1 : initScale).opacity(show ? 1 : 0).step({
|
59
|
-
duration: 0
|
60
|
-
});
|
61
|
-
} else {
|
62
|
-
animationRef.current.scale(show ? 1 : finalScale).opacity(show ? 1 : 0).step({
|
63
|
-
duration: show ? showDuration : hideDuration,
|
64
|
-
delay: delay
|
65
|
-
});
|
66
|
-
}
|
67
|
-
|
68
|
-
var temp = animationRef.current.export();
|
69
|
-
setTimeout(function () {
|
70
|
-
setAnim(temp);
|
71
|
-
}, 20);
|
72
|
-
show && typeof onShow === 'function' && onShow();
|
73
|
-
!show && typeof onHide === 'function' && onHide();
|
74
|
-
}, [show]);
|
75
|
-
return isAddNode && /*#__PURE__*/React.createElement(View, _extends({
|
76
|
-
animation: anim,
|
77
|
-
style: inlineStyle(style),
|
78
|
-
className: className
|
79
|
-
}, restProps), children);
|
80
|
-
};
|
81
|
-
|
82
|
-
ScaleFadeIn.defaultProps = defaultMotionScaleFadeInProps;
|
83
|
-
export default ScaleFadeIn;
|
@@ -1,28 +0,0 @@
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
2
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
3
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
4
|
-
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
5
|
-
import React from 'react';
|
6
|
-
|
7
|
-
var Fade = /*#__PURE__*/function (_React$Component) {
|
8
|
-
_inherits(Fade, _React$Component);
|
9
|
-
|
10
|
-
var _super = _createSuper(Fade);
|
11
|
-
|
12
|
-
function Fade() {
|
13
|
-
_classCallCheck(this, Fade);
|
14
|
-
|
15
|
-
return _super.apply(this, arguments);
|
16
|
-
}
|
17
|
-
|
18
|
-
_createClass(Fade, [{
|
19
|
-
key: "render",
|
20
|
-
value: function render() {
|
21
|
-
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", null, "\u672A\u5B9E\u73B0"));
|
22
|
-
}
|
23
|
-
}]);
|
24
|
-
|
25
|
-
return Fade;
|
26
|
-
}(React.Component);
|
27
|
-
|
28
|
-
export { Fade as default };
|
@@ -1,103 +0,0 @@
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
2
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
3
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
4
|
-
var _excluded = ["style", "className", "children", "show", "onShow", "onHide", "showDuration", "hideDuration", "delay", "initScale", "dropHeight"];
|
5
|
-
import * as React from 'react';
|
6
|
-
import { inlineStyle } from '@ray-js/framework-shared';
|
7
|
-
import { View } from '@ray-js/components';
|
8
|
-
import { defaultMotionScalePullDownProps } from '../props';
|
9
|
-
|
10
|
-
var ScalePullDown = function (props) {
|
11
|
-
var isPreShow = React.useRef(false);
|
12
|
-
|
13
|
-
var style = props.style,
|
14
|
-
className = props.className,
|
15
|
-
children = props.children,
|
16
|
-
show = props.show,
|
17
|
-
onShow = props.onShow,
|
18
|
-
onHide = props.onHide,
|
19
|
-
showDuration = props.showDuration,
|
20
|
-
hideDuration = props.hideDuration,
|
21
|
-
delay = props.delay,
|
22
|
-
initScale = props.initScale,
|
23
|
-
dropHeight = props.dropHeight,
|
24
|
-
restProps = _objectWithoutProperties(props, _excluded);
|
25
|
-
|
26
|
-
var _React$useState = React.useState(undefined),
|
27
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
28
|
-
anim = _React$useState2[0],
|
29
|
-
setAnim = _React$useState2[1];
|
30
|
-
|
31
|
-
var _React$useState3 = React.useState(false),
|
32
|
-
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
33
|
-
isAddNode = _React$useState4[0],
|
34
|
-
setIsAddNode = _React$useState4[1]; // 是否将节点渲染到页面上
|
35
|
-
|
36
|
-
|
37
|
-
var animationRef = React.useRef(null);
|
38
|
-
var isFirstRenderRef = React.useRef(true);
|
39
|
-
React.useEffect(function () {
|
40
|
-
animationRef.current = ty.createAnimation({
|
41
|
-
duration: 0,
|
42
|
-
timingFunction: 'ease'
|
43
|
-
});
|
44
|
-
}, []);
|
45
|
-
React.useEffect(function () {
|
46
|
-
if (show) {
|
47
|
-
isPreShow.current = true;
|
48
|
-
setIsAddNode(true);
|
49
|
-
} else if (isPreShow.current) {
|
50
|
-
isPreShow.current = false;
|
51
|
-
setTimeout(function () {
|
52
|
-
setIsAddNode(false);
|
53
|
-
}, delay + hideDuration);
|
54
|
-
}
|
55
|
-
|
56
|
-
if (isFirstRenderRef.current) {
|
57
|
-
isFirstRenderRef.current = false;
|
58
|
-
animationRef.current.scale(show ? 1 : initScale).opacity(show ? 1 : 0).step({
|
59
|
-
duration: 0
|
60
|
-
});
|
61
|
-
var temp = animationRef.current.export();
|
62
|
-
setAnim(temp);
|
63
|
-
} else {
|
64
|
-
if (show) {
|
65
|
-
animationRef.current.scale(1).opacity(1).step({
|
66
|
-
duration: showDuration,
|
67
|
-
delay: delay
|
68
|
-
});
|
69
|
-
|
70
|
-
var _temp = animationRef.current.export();
|
71
|
-
|
72
|
-
setTimeout(function () {
|
73
|
-
setAnim(_temp);
|
74
|
-
}, 20);
|
75
|
-
} else {
|
76
|
-
animationRef.current.opacity(0).translateY(dropHeight).step({
|
77
|
-
duration: hideDuration,
|
78
|
-
delay: delay
|
79
|
-
});
|
80
|
-
|
81
|
-
var _temp2 = animationRef.current.export();
|
82
|
-
|
83
|
-
setAnim(_temp2);
|
84
|
-
setTimeout(function () {
|
85
|
-
setAnim(animationRef.current.translateY(0).scale(0).step({
|
86
|
-
duration: 0
|
87
|
-
}).export());
|
88
|
-
}, delay + hideDuration);
|
89
|
-
}
|
90
|
-
}
|
91
|
-
|
92
|
-
show && typeof onShow === 'function' && onShow();
|
93
|
-
!show && typeof onHide === 'function' && onHide();
|
94
|
-
}, [show]);
|
95
|
-
return isAddNode && /*#__PURE__*/React.createElement(View, _extends({
|
96
|
-
animation: anim,
|
97
|
-
style: inlineStyle(style),
|
98
|
-
className: className
|
99
|
-
}, restProps), children);
|
100
|
-
};
|
101
|
-
|
102
|
-
ScalePullDown.defaultProps = defaultMotionScalePullDownProps;
|
103
|
-
export default ScalePullDown;
|
@@ -1,103 +0,0 @@
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
2
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
3
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
4
|
-
var _excluded = ["style", "className", "children", "show", "onShow", "onHide", "showDuration", "hideDuration", "delay", "initScale", "dropHeight"];
|
5
|
-
import * as React from 'react';
|
6
|
-
import { inlineStyle } from '@ray-js/framework-shared';
|
7
|
-
import { View } from '@ray-js/components';
|
8
|
-
import { defaultMotionScalePullDownProps } from '../props';
|
9
|
-
|
10
|
-
var ScalePullDown = function (props) {
|
11
|
-
var isPreShow = React.useRef(false);
|
12
|
-
|
13
|
-
var style = props.style,
|
14
|
-
className = props.className,
|
15
|
-
children = props.children,
|
16
|
-
show = props.show,
|
17
|
-
onShow = props.onShow,
|
18
|
-
onHide = props.onHide,
|
19
|
-
showDuration = props.showDuration,
|
20
|
-
hideDuration = props.hideDuration,
|
21
|
-
delay = props.delay,
|
22
|
-
initScale = props.initScale,
|
23
|
-
dropHeight = props.dropHeight,
|
24
|
-
restProps = _objectWithoutProperties(props, _excluded);
|
25
|
-
|
26
|
-
var _React$useState = React.useState(undefined),
|
27
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
28
|
-
anim = _React$useState2[0],
|
29
|
-
setAnim = _React$useState2[1];
|
30
|
-
|
31
|
-
var _React$useState3 = React.useState(false),
|
32
|
-
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
33
|
-
isAddNode = _React$useState4[0],
|
34
|
-
setIsAddNode = _React$useState4[1]; // 是否将节点渲染到页面上
|
35
|
-
|
36
|
-
|
37
|
-
var animationRef = React.useRef(null);
|
38
|
-
var isFirstRenderRef = React.useRef(true);
|
39
|
-
React.useEffect(function () {
|
40
|
-
animationRef.current = wx.createAnimation({
|
41
|
-
duration: 0,
|
42
|
-
timingFunction: 'ease'
|
43
|
-
});
|
44
|
-
}, []);
|
45
|
-
React.useEffect(function () {
|
46
|
-
if (show) {
|
47
|
-
isPreShow.current = true;
|
48
|
-
setIsAddNode(true);
|
49
|
-
} else if (isPreShow.current) {
|
50
|
-
isPreShow.current = false;
|
51
|
-
setTimeout(function () {
|
52
|
-
setIsAddNode(false);
|
53
|
-
}, delay + hideDuration);
|
54
|
-
}
|
55
|
-
|
56
|
-
if (isFirstRenderRef.current) {
|
57
|
-
isFirstRenderRef.current = false;
|
58
|
-
animationRef.current.scale(show ? 1 : initScale).opacity(show ? 1 : 0).step({
|
59
|
-
duration: 0
|
60
|
-
});
|
61
|
-
var temp = animationRef.current.export();
|
62
|
-
setAnim(temp);
|
63
|
-
} else {
|
64
|
-
if (show) {
|
65
|
-
animationRef.current.scale(1).opacity(1).step({
|
66
|
-
duration: showDuration,
|
67
|
-
delay: delay
|
68
|
-
});
|
69
|
-
|
70
|
-
var _temp = animationRef.current.export();
|
71
|
-
|
72
|
-
setTimeout(function () {
|
73
|
-
setAnim(_temp);
|
74
|
-
}, 20);
|
75
|
-
} else {
|
76
|
-
animationRef.current.opacity(0).translateY(dropHeight).step({
|
77
|
-
duration: hideDuration,
|
78
|
-
delay: delay
|
79
|
-
});
|
80
|
-
|
81
|
-
var _temp2 = animationRef.current.export();
|
82
|
-
|
83
|
-
setAnim(_temp2);
|
84
|
-
setTimeout(function () {
|
85
|
-
setAnim(animationRef.current.translateY(0).scale(0).step({
|
86
|
-
duration: 0
|
87
|
-
}).export());
|
88
|
-
}, delay + hideDuration);
|
89
|
-
}
|
90
|
-
}
|
91
|
-
|
92
|
-
show && typeof onShow === 'function' && onShow();
|
93
|
-
!show && typeof onHide === 'function' && onHide();
|
94
|
-
}, [show]);
|
95
|
-
return isAddNode && /*#__PURE__*/React.createElement(View, _extends({
|
96
|
-
animation: anim,
|
97
|
-
style: inlineStyle(style),
|
98
|
-
className: className
|
99
|
-
}, restProps), children);
|
100
|
-
};
|
101
|
-
|
102
|
-
ScalePullDown.defaultProps = defaultMotionScalePullDownProps;
|
103
|
-
export default ScalePullDown;
|
package/lib/Motion/index.d.ts
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
import Fade from './Fade';
|
2
|
-
import PullUp from './PullUp';
|
3
|
-
import ScaleFadeIn from './ScaleFadeIn';
|
4
|
-
import ScalePullDown from './ScalePullDown';
|
5
|
-
import PushDown from './PushDown';
|
6
|
-
export * from './props';
|
7
|
-
declare const Motion: {
|
8
|
-
Fade: typeof Fade;
|
9
|
-
PullUp: typeof PullUp;
|
10
|
-
ScaleFadeIn: typeof ScaleFadeIn;
|
11
|
-
ScalePullDown: typeof ScalePullDown;
|
12
|
-
PushDown: typeof PushDown;
|
13
|
-
};
|
14
|
-
export default Motion;
|
package/lib/Motion/index.js
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
import Fade from './Fade';
|
2
|
-
import PullUp from './PullUp';
|
3
|
-
import ScaleFadeIn from './ScaleFadeIn';
|
4
|
-
import ScalePullDown from './ScalePullDown';
|
5
|
-
import PushDown from './PushDown';
|
6
|
-
export * from './props';
|
7
|
-
var Motion = {
|
8
|
-
Fade: Fade,
|
9
|
-
PullUp: PullUp,
|
10
|
-
ScaleFadeIn: ScaleFadeIn,
|
11
|
-
ScalePullDown: ScalePullDown,
|
12
|
-
PushDown: PushDown
|
13
|
-
};
|
14
|
-
export default Motion;
|