@ray-js/components 1.4.0-alpha.1 → 1.4.0-alpha.10
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/Button/Button.js +1 -3
- package/lib/Button/Button.thing.js +15 -17
- package/lib/Button/Button.wechat.js +15 -17
- package/lib/Button/props.js +1 -1
- package/lib/Camera/Camera.d.ts +2 -1
- package/lib/Camera/Camera.js +3 -3
- package/lib/Camera/Camera.thing.js +1 -3
- package/lib/Camera/Camera.wechat.d.ts +2 -1
- package/lib/Camera/Camera.wechat.js +2 -2
- package/lib/Checkbox/Checkbox.js +1 -3
- package/lib/Checkbox/Checkbox.thing.js +8 -9
- package/lib/Checkbox/Checkbox.wechat.js +9 -10
- package/lib/CheckboxGroup/CheckboxGroup.js +15 -19
- package/lib/CheckboxGroup/CheckboxGroup.thing.js +12 -17
- package/lib/CheckboxGroup/CheckboxGroup.wechat.js +12 -17
- package/lib/CheckboxGroup/props.d.ts +1 -1
- package/lib/CoverView/CoverView.js +1 -3
- package/lib/CoverView/CoverView.thing.js +1 -3
- package/lib/CoverView/CoverView.wechat.d.ts +2 -1
- package/lib/CoverView/CoverView.wechat.js +0 -2
- package/lib/CoverView/props.d.ts +1 -1
- package/lib/CoverView/props.js +1 -1
- package/lib/Form/Form.js +12 -12
- package/lib/Form/Form.thing.js +1 -3
- package/lib/Form/Form.wechat.js +20 -25
- package/lib/Form/props.d.ts +1 -1
- package/lib/Icon/Icon.js +7 -7
- package/lib/Icon/Icon.thing.js +7 -7
- package/lib/Icon/Icon.wechat.js +7 -7
- package/lib/Icon/iconfont/iconfont.js +13 -20
- package/lib/Icon/props.d.ts +1 -1
- package/lib/Icon/props.js +1 -1
- package/lib/Iframe/Iframe.d.ts +2 -1
- package/lib/Iframe/Iframe.js +3 -3
- package/lib/Iframe/Iframe.thing.js +1 -3
- package/lib/Iframe/Iframe.wechat.d.ts +2 -1
- package/lib/Iframe/Iframe.wechat.js +3 -3
- package/lib/Image/Image.js +6 -8
- package/lib/Image/Image.thing.js +8 -10
- package/lib/Image/Image.wechat.js +26 -32
- package/lib/Input/Input.js +29 -26
- package/lib/Input/Input.thing.js +36 -36
- package/lib/Input/Input.wechat.js +47 -47
- package/lib/Input/props.d.ts +11 -21
- package/lib/Input/props.js +1 -3
- package/lib/IpcPlayer/IpcPlayer.d.ts +2 -1
- package/lib/IpcPlayer/IpcPlayer.js +3 -3
- package/lib/IpcPlayer/IpcPlayer.thing.js +1 -3
- package/lib/IpcPlayer/IpcPlayer.wechat.d.ts +2 -1
- package/lib/IpcPlayer/IpcPlayer.wechat.js +2 -2
- package/lib/Label/Label.js +7 -8
- package/lib/Label/Label.thing.js +8 -8
- package/lib/Label/Label.wechat.js +8 -8
- package/lib/Map/Map.js +1 -3
- package/lib/Map/Map.thing.js +1 -3
- package/lib/Map/Map.wechat.js +1 -3
- package/lib/Modal/index.js +4 -2
- package/lib/Modal/index.web.js +6 -4
- package/lib/MovableArea/MovableArea.js +5 -4
- package/lib/MovableArea/MovableArea.thing.js +1 -3
- package/lib/MovableArea/MovableArea.wechat.js +1 -3
- package/lib/MovableView/MovableView.js +12 -11
- package/lib/MovableView/MovableView.thing.js +1 -3
- package/lib/MovableView/MovableView.wechat.js +1 -3
- package/lib/NativeVideo/NativeVideo.d.ts +2 -1
- package/lib/NativeVideo/NativeVideo.js +3 -3
- package/lib/NativeVideo/NativeVideo.thing.js +1 -3
- package/lib/NativeVideo/NativeVideo.wechat.d.ts +2 -1
- package/lib/NativeVideo/NativeVideo.wechat.js +2 -2
- package/lib/PageContainer/PageContainer.js +12 -19
- package/lib/PageContainer/PageContainer.thing.d.ts +2 -1
- package/lib/PageContainer/PageContainer.thing.js +0 -2
- package/lib/PageContainer/PageContainer.wechat.d.ts +2 -1
- package/lib/PageContainer/PageContainer.wechat.js +0 -2
- package/lib/PageContainer/props.d.ts +2 -2
- package/lib/PageContainer/props.js +3 -3
- package/lib/Picker/Picker.js +23 -31
- package/lib/Picker/Picker.thing.js +26 -31
- package/lib/Picker/Picker.wechat.js +26 -31
- package/lib/PickerView/PickerView.js +23 -34
- package/lib/PickerView/PickerView.thing.js +16 -19
- package/lib/PickerView/PickerView.wechat.js +16 -19
- package/lib/PickerViewColumn/PickerViewColumn.js +4 -4
- package/lib/PickerViewColumn/PickerViewColumn.thing.js +6 -7
- package/lib/PickerViewColumn/PickerViewColumn.wechat.js +6 -7
- package/lib/Progress/Progress.js +1 -3
- package/lib/Progress/Progress.thing.js +6 -7
- package/lib/Progress/Progress.wechat.js +6 -7
- package/lib/Radio/Radio.js +1 -3
- package/lib/Radio/Radio.thing.js +8 -9
- package/lib/Radio/Radio.wechat.js +9 -10
- package/lib/RadioGroup/RadioGroup.js +12 -18
- package/lib/RadioGroup/RadioGroup.thing.js +15 -21
- package/lib/RadioGroup/RadioGroup.wechat.js +12 -17
- package/lib/RadioGroup/props.d.ts +1 -1
- package/lib/RichText/RichText.js +1 -1
- package/lib/RichText/RichText.thing.js +1 -3
- package/lib/RichText/RichText.wechat.js +1 -3
- package/lib/ScrollView/ScrollView.js +12 -13
- package/lib/ScrollView/ScrollView.thing.js +6 -7
- package/lib/ScrollView/ScrollView.wechat.js +6 -7
- package/lib/Slider/Slider.js +4 -8
- package/lib/Slider/Slider.thing.js +13 -14
- package/lib/Slider/Slider.wechat.js +14 -15
- package/lib/Slider/props.js +1 -1
- package/lib/Swiper/Swiper.d.ts +1 -1
- package/lib/Swiper/Swiper.js +24 -33
- package/lib/Swiper/Swiper.thing.d.ts +1 -1
- package/lib/Swiper/Swiper.thing.js +18 -24
- package/lib/Swiper/Swiper.wechat.d.ts +1 -1
- package/lib/Swiper/Swiper.wechat.js +18 -24
- package/lib/Swiper/props.d.ts +1 -1
- package/lib/Swiper/props.js +2 -2
- package/lib/SwiperItem/SwiperItem.js +4 -4
- package/lib/SwiperItem/SwiperItem.thing.js +8 -9
- package/lib/SwiperItem/SwiperItem.wechat.js +8 -9
- package/lib/Switch/Switch.js +5 -8
- package/lib/Switch/Switch.thing.js +12 -14
- package/lib/Switch/Switch.wechat.js +12 -14
- package/lib/Switch/props.js +1 -1
- package/lib/Text/Text.js +1 -3
- package/lib/Text/Text.thing.js +1 -3
- package/lib/Text/Text.wechat.js +20 -25
- package/lib/Textarea/Textarea.js +13 -24
- package/lib/Textarea/Textarea.thing.js +26 -30
- package/lib/Textarea/Textarea.wechat.js +26 -30
- package/lib/Textarea/props.d.ts +4 -10
- package/lib/View/View.js +29 -32
- package/lib/View/View.thing.js +34 -35
- package/lib/View/View.wechat.js +34 -35
- package/lib/View/props.js +1 -1
- package/lib/WebView/WebView.js +1 -3
- package/lib/WebView/WebView.thing.js +1 -3
- package/lib/WebView/WebView.wechat.js +1 -3
- package/lib/assets/icons.js +1 -1
- package/lib/core/index.js +4 -11
- package/lib/types/event.d.ts +1 -1
- package/lib/types/index.js +1 -0
- package/lib/utils/handleProps.js +26 -40
- package/package.json +25 -25
- package/LICENSE.md +0 -9
- package/lib/Modal/index.web.d.ts +0 -2
@@ -1,7 +1,7 @@
|
|
1
|
-
import React from 'react';
|
1
|
+
import React from 'react';
|
2
2
|
|
3
|
-
|
3
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
4
|
+
const IpcPlayer = () => {
|
4
5
|
return /*#__PURE__*/React.createElement("div", null, "web\u7AEF\u6682\u672A\u5B9E\u73B0");
|
5
6
|
};
|
6
|
-
|
7
7
|
export default IpcPlayer;
|
@@ -1,8 +1,6 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import { IpcPlayer as RemaxIpcPlayer } from '@ray-js/adapter';
|
3
|
-
|
4
|
-
var IpcPlayer = function (props) {
|
3
|
+
const IpcPlayer = props => {
|
5
4
|
return /*#__PURE__*/React.createElement(RemaxIpcPlayer, props);
|
6
5
|
};
|
7
|
-
|
8
6
|
export default IpcPlayer;
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
-
import { View } from '@ray-js/components';
|
2
|
+
import { View } from '@ray-js/components';
|
3
3
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
4
5
|
function IpcPlayer() {
|
5
6
|
return /*#__PURE__*/React.createElement(View, null, "\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F\u7AEF\u6682\u672A\u5B9E\u73B0");
|
6
7
|
}
|
7
|
-
|
8
8
|
export default IpcPlayer;
|
package/lib/Label/Label.js
CHANGED
@@ -1,17 +1,16 @@
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
3
|
-
|
3
|
+
const _excluded = ["htmlFor"];
|
4
4
|
import * as React from 'react';
|
5
5
|
import handleProps from '../utils/handleProps';
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
6
|
+
const Label = props => {
|
7
|
+
const {
|
8
|
+
htmlFor
|
9
|
+
} = props,
|
10
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
11
|
+
// @ts-ignore
|
12
12
|
return /*#__PURE__*/React.createElement("v-label", _extends({
|
13
13
|
for: htmlFor
|
14
14
|
}, handleProps(restProps)));
|
15
15
|
};
|
16
|
-
|
17
16
|
export default Label;
|
package/lib/Label/Label.thing.js
CHANGED
@@ -3,13 +3,14 @@ import clsx from 'clsx';
|
|
3
3
|
import { inlineStyle } from '@ray-js/framework-shared';
|
4
4
|
import { Label as RemaxLabel } from '@ray-js/adapter';
|
5
5
|
import styles from './index.module.less';
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
6
|
+
const Label = props => {
|
7
|
+
const {
|
8
|
+
id,
|
9
|
+
style,
|
10
|
+
className,
|
11
|
+
htmlFor,
|
12
|
+
children
|
13
|
+
} = props;
|
13
14
|
return /*#__PURE__*/React.createElement(RemaxLabel, {
|
14
15
|
for: htmlFor,
|
15
16
|
id: id,
|
@@ -17,5 +18,4 @@ var Label = function (props) {
|
|
17
18
|
className: clsx('ray-label', styles.label, className)
|
18
19
|
}, children);
|
19
20
|
};
|
20
|
-
|
21
21
|
export default Label;
|
@@ -3,13 +3,14 @@ import clsx from 'clsx';
|
|
3
3
|
import { inlineStyle } from '@ray-js/framework-shared';
|
4
4
|
import { Label as RemaxLabel } from '@ray-core/wechat';
|
5
5
|
import styles from './index.module.less';
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
6
|
+
const Label = props => {
|
7
|
+
const {
|
8
|
+
id,
|
9
|
+
style,
|
10
|
+
className,
|
11
|
+
htmlFor,
|
12
|
+
children
|
13
|
+
} = props;
|
13
14
|
return /*#__PURE__*/React.createElement(RemaxLabel, {
|
14
15
|
for: htmlFor,
|
15
16
|
id: id,
|
@@ -17,5 +18,4 @@ var Label = function (props) {
|
|
17
18
|
className: clsx('ray-label', styles.label, className)
|
18
19
|
}, children);
|
19
20
|
};
|
20
|
-
|
21
21
|
export default Label;
|
package/lib/Map/Map.js
CHANGED
package/lib/Map/Map.thing.js
CHANGED
package/lib/Map/Map.wechat.js
CHANGED
package/lib/Modal/index.js
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
import { usePageInstance, createPortal } from '@ray-js/runtime';
|
2
2
|
export default function Modal(_ref) {
|
3
|
-
|
4
|
-
|
3
|
+
let {
|
4
|
+
children
|
5
|
+
} = _ref;
|
6
|
+
const inst = usePageInstance();
|
5
7
|
return createPortal(children, inst.modalContainer);
|
6
8
|
}
|
package/lib/Modal/index.web.js
CHANGED
@@ -1,11 +1,13 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import ReactDOM from 'react-dom';
|
3
3
|
export default function Modal(_ref) {
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
let {
|
5
|
+
children
|
6
|
+
} = _ref;
|
7
|
+
const domNode = React.useRef(document.createElement('div'));
|
8
|
+
React.useEffect(() => {
|
7
9
|
document.body.appendChild(domNode.current);
|
8
|
-
return
|
10
|
+
return () => {
|
9
11
|
document.body.removeChild(domNode.current);
|
10
12
|
};
|
11
13
|
}, []);
|
@@ -1,10 +1,11 @@
|
|
1
|
-
import "
|
1
|
+
import _objectDestructuringEmpty from "@babel/runtime/helpers/esm/objectDestructuringEmpty";
|
2
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
2
3
|
import React from 'react';
|
3
4
|
import handleProps from '../utils/handleProps';
|
4
5
|
import { MovableArea as RemaxMovableArea } from '@ray-js/adapter';
|
5
|
-
export
|
6
|
-
|
7
|
-
|
6
|
+
export const MovableArea = props => {
|
7
|
+
const restProps = _extends({}, (_objectDestructuringEmpty(props), props));
|
8
|
+
// @ts-ignore
|
8
9
|
return /*#__PURE__*/React.createElement("v-movable-area", handleProps(restProps));
|
9
10
|
};
|
10
11
|
MovableArea.defaultProps = RemaxMovableArea.defaultProps;
|
@@ -1,8 +1,6 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import { MovableArea as RemaxMovableArea } from '@ray-js/adapter';
|
3
|
-
|
4
|
-
var MovableArea = function (props) {
|
3
|
+
const MovableArea = props => {
|
5
4
|
return /*#__PURE__*/React.createElement(RemaxMovableArea, props);
|
6
5
|
};
|
7
|
-
|
8
6
|
export default MovableArea;
|
@@ -1,8 +1,6 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import { MovableArea as RemaxMovableArea } from '@ray-js/adapter';
|
3
|
-
|
4
|
-
var MovableArea = function (props) {
|
3
|
+
const MovableArea = props => {
|
5
4
|
return /*#__PURE__*/React.createElement(RemaxMovableArea, props);
|
6
5
|
};
|
7
|
-
|
8
6
|
export default MovableArea;
|
@@ -1,18 +1,19 @@
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
2
2
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
4
|
-
|
4
|
+
const _excluded = ["onChange", "onScale"];
|
5
5
|
import React from 'react';
|
6
6
|
import { useEventListener } from 'ahooks';
|
7
7
|
import handleProps from '../utils/handleProps';
|
8
8
|
import { MovableView as RemaxMovableView } from '@ray-js/adapter';
|
9
|
-
export
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
9
|
+
export const MovableView = props => {
|
10
|
+
const {
|
11
|
+
onChange,
|
12
|
+
onScale
|
13
|
+
} = props,
|
14
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
15
|
+
const currentNode = React.useRef(null);
|
16
|
+
useEventListener('change', e => {
|
16
17
|
onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread(_objectSpread({
|
17
18
|
type: 'change'
|
18
19
|
}, e.detail), {}, {
|
@@ -21,7 +22,7 @@ export var MovableView = function (props) {
|
|
21
22
|
}, {
|
22
23
|
target: currentNode
|
23
24
|
});
|
24
|
-
useEventListener('scale',
|
25
|
+
useEventListener('scale', e => {
|
25
26
|
onScale === null || onScale === void 0 ? void 0 : onScale(_objectSpread(_objectSpread({
|
26
27
|
type: 'scale'
|
27
28
|
}, e.detail), {}, {
|
@@ -29,8 +30,8 @@ export var MovableView = function (props) {
|
|
29
30
|
}));
|
30
31
|
}, {
|
31
32
|
target: currentNode
|
32
|
-
});
|
33
|
-
|
33
|
+
});
|
34
|
+
// @ts-ignore
|
34
35
|
return /*#__PURE__*/React.createElement("v-movable-view", _extends({
|
35
36
|
ref: currentNode
|
36
37
|
}, handleProps(restProps)));
|
@@ -1,8 +1,6 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import { MovableView as RemaxMovableView } from '@ray-js/adapter';
|
3
|
-
|
4
|
-
var MovableView = function (props) {
|
3
|
+
const MovableView = props => {
|
5
4
|
return /*#__PURE__*/React.createElement(RemaxMovableView, props);
|
6
5
|
};
|
7
|
-
|
8
6
|
export default MovableView;
|
@@ -1,8 +1,6 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import { MovableView as RemaxMovableView } from '@ray-js/adapter';
|
3
|
-
|
4
|
-
var MovableView = function (props) {
|
3
|
+
const MovableView = props => {
|
5
4
|
return /*#__PURE__*/React.createElement(RemaxMovableView, props);
|
6
5
|
};
|
7
|
-
|
8
6
|
export default MovableView;
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import React from 'react';
|
1
|
+
import React from 'react';
|
2
2
|
|
3
|
-
|
3
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
4
|
+
const NativeVideo = () => {
|
4
5
|
return /*#__PURE__*/React.createElement("div", null, "web\u7AEF\u6682\u672A\u5B9E\u73B0");
|
5
6
|
};
|
6
|
-
|
7
7
|
export default NativeVideo;
|
@@ -1,8 +1,6 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import { NativeVideo as RemaxNativeVideo } from '@ray-js/adapter';
|
3
|
-
|
4
|
-
var NativeVideo = function (props) {
|
3
|
+
const NativeVideo = props => {
|
5
4
|
return /*#__PURE__*/React.createElement(RemaxNativeVideo, props);
|
6
5
|
};
|
7
|
-
|
8
6
|
export default NativeVideo;
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
-
import { View } from '@ray-js/components';
|
2
|
+
import { View } from '@ray-js/components';
|
3
3
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
4
5
|
function NativeVideo() {
|
5
6
|
return /*#__PURE__*/React.createElement(View, null, "\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F\u7AEF\u6682\u672A\u5B9E\u73B0");
|
6
7
|
}
|
7
|
-
|
8
8
|
export default NativeVideo;
|
@@ -3,13 +3,13 @@ import React, { useRef } from 'react';
|
|
3
3
|
import { useEventListener } from 'ahooks';
|
4
4
|
import { defaultPageContainerProps } from './props';
|
5
5
|
import handleProps from '../utils/handleProps';
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
6
|
+
const PageContainer = props => {
|
7
|
+
const {
|
8
|
+
children
|
9
|
+
} = props;
|
10
|
+
const currentNode = useRef(null);
|
11
|
+
useEventListener('clickoverlay', e => {
|
11
12
|
var _props$onClickOverlay;
|
12
|
-
|
13
13
|
(_props$onClickOverlay = props.onClickOverlay) === null || _props$onClickOverlay === void 0 ? void 0 : _props$onClickOverlay.call(props, {
|
14
14
|
type: 'clickoverlay',
|
15
15
|
origin: e
|
@@ -17,9 +17,8 @@ var PageContainer = function (props) {
|
|
17
17
|
}, {
|
18
18
|
target: currentNode
|
19
19
|
});
|
20
|
-
useEventListener('beforeenter',
|
20
|
+
useEventListener('beforeenter', e => {
|
21
21
|
var _props$onBeforeEnter;
|
22
|
-
|
23
22
|
(_props$onBeforeEnter = props.onBeforeEnter) === null || _props$onBeforeEnter === void 0 ? void 0 : _props$onBeforeEnter.call(props, {
|
24
23
|
type: 'beforeenter',
|
25
24
|
origin: e
|
@@ -27,9 +26,8 @@ var PageContainer = function (props) {
|
|
27
26
|
}, {
|
28
27
|
target: currentNode
|
29
28
|
});
|
30
|
-
useEventListener('enter',
|
29
|
+
useEventListener('enter', e => {
|
31
30
|
var _props$onEnter;
|
32
|
-
|
33
31
|
(_props$onEnter = props.onEnter) === null || _props$onEnter === void 0 ? void 0 : _props$onEnter.call(props, {
|
34
32
|
type: 'enter',
|
35
33
|
origin: e
|
@@ -37,9 +35,8 @@ var PageContainer = function (props) {
|
|
37
35
|
}, {
|
38
36
|
target: currentNode
|
39
37
|
});
|
40
|
-
useEventListener('afterenter',
|
38
|
+
useEventListener('afterenter', e => {
|
41
39
|
var _props$onAfterEnter;
|
42
|
-
|
43
40
|
(_props$onAfterEnter = props.onAfterEnter) === null || _props$onAfterEnter === void 0 ? void 0 : _props$onAfterEnter.call(props, {
|
44
41
|
type: 'afterenter',
|
45
42
|
origin: e
|
@@ -47,9 +44,8 @@ var PageContainer = function (props) {
|
|
47
44
|
}, {
|
48
45
|
target: currentNode
|
49
46
|
});
|
50
|
-
useEventListener('beforeleave',
|
47
|
+
useEventListener('beforeleave', e => {
|
51
48
|
var _props$onBeforeLeave;
|
52
|
-
|
53
49
|
(_props$onBeforeLeave = props.onBeforeLeave) === null || _props$onBeforeLeave === void 0 ? void 0 : _props$onBeforeLeave.call(props, {
|
54
50
|
type: 'beforeleave',
|
55
51
|
origin: e
|
@@ -57,9 +53,8 @@ var PageContainer = function (props) {
|
|
57
53
|
}, {
|
58
54
|
target: currentNode
|
59
55
|
});
|
60
|
-
useEventListener('leave',
|
56
|
+
useEventListener('leave', e => {
|
61
57
|
var _props$onLeave;
|
62
|
-
|
63
58
|
(_props$onLeave = props.onLeave) === null || _props$onLeave === void 0 ? void 0 : _props$onLeave.call(props, {
|
64
59
|
type: 'leave',
|
65
60
|
origin: e
|
@@ -67,9 +62,8 @@ var PageContainer = function (props) {
|
|
67
62
|
}, {
|
68
63
|
target: currentNode
|
69
64
|
});
|
70
|
-
useEventListener('afterleave',
|
65
|
+
useEventListener('afterleave', e => {
|
71
66
|
var _props$onAfterLeave;
|
72
|
-
|
73
67
|
(_props$onAfterLeave = props.onAfterLeave) === null || _props$onAfterLeave === void 0 ? void 0 : _props$onAfterLeave.call(props, {
|
74
68
|
type: 'afterleave',
|
75
69
|
origin: e
|
@@ -85,6 +79,5 @@ var PageContainer = function (props) {
|
|
85
79
|
}), children)
|
86
80
|
);
|
87
81
|
};
|
88
|
-
|
89
82
|
PageContainer.defaultProps = defaultPageContainerProps;
|
90
83
|
export default PageContainer;
|
@@ -1,12 +1,12 @@
|
|
1
1
|
import { BaseProps } from '../types';
|
2
2
|
import * as React from 'react';
|
3
3
|
import { BaseEvent } from '@ray-js/adapter/esm/types/component';
|
4
|
-
export
|
4
|
+
export type PageContainerEventType = {
|
5
5
|
type: string;
|
6
6
|
value?: any;
|
7
7
|
origin: BaseEvent;
|
8
8
|
};
|
9
|
-
export
|
9
|
+
export type PageContainerProps = BaseProps & {
|
10
10
|
/** 文本是否可选 */
|
11
11
|
show?: boolean;
|
12
12
|
duration?: number;
|
@@ -1,9 +1,9 @@
|
|
1
|
-
export
|
1
|
+
export const defaultPageContainerProps = {
|
2
2
|
show: false,
|
3
3
|
duration: 300,
|
4
4
|
zIndex: 100,
|
5
5
|
overlay: true,
|
6
6
|
position: 'bottom',
|
7
|
-
round: false
|
8
|
-
|
7
|
+
round: false
|
8
|
+
// closeOnSlideDown: false,
|
9
9
|
};
|
package/lib/Picker/Picker.js
CHANGED
@@ -1,22 +1,22 @@
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
2
|
-
import
|
2
|
+
import "core-js/modules/web.dom-collections.iterator.js";
|
3
3
|
import * as React from 'react';
|
4
4
|
import { useTouch } from '@ray-js/framework-shared';
|
5
5
|
import { useEventListener } from 'ahooks';
|
6
6
|
import handleProps from '../utils/handleProps';
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
7
|
+
let countArr = 1;
|
8
|
+
const Picker = props => {
|
9
|
+
const {
|
10
|
+
onTouchStart,
|
11
|
+
onTouchMove,
|
12
|
+
onTouchEnd,
|
13
|
+
onTouchCancel,
|
14
|
+
onClick,
|
15
|
+
children
|
16
|
+
} = props;
|
17
|
+
const currentNode = React.useRef(null);
|
18
|
+
useEventListener('change', e => {
|
18
19
|
var _props$onChange;
|
19
|
-
|
20
20
|
(_props$onChange = props.onChange) === null || _props$onChange === void 0 ? void 0 : _props$onChange.call(props, {
|
21
21
|
type: 'change',
|
22
22
|
value: e.detail.value,
|
@@ -25,9 +25,8 @@ var Picker = function (props) {
|
|
25
25
|
}, {
|
26
26
|
target: currentNode
|
27
27
|
});
|
28
|
-
useEventListener('cancel',
|
28
|
+
useEventListener('cancel', e => {
|
29
29
|
var _props$onCancel;
|
30
|
-
|
31
30
|
(_props$onCancel = props.onCancel) === null || _props$onCancel === void 0 ? void 0 : _props$onCancel.call(props, {
|
32
31
|
type: 'cancel',
|
33
32
|
origin: e
|
@@ -35,29 +34,23 @@ var Picker = function (props) {
|
|
35
34
|
}, {
|
36
35
|
target: currentNode
|
37
36
|
});
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
handlers = _useTouch2[1];
|
48
|
-
|
49
|
-
var multiarr = function (arr) {
|
50
|
-
for (var i = 0; i < arr.length; i++) {
|
37
|
+
const [, handlers] = useTouch({
|
38
|
+
onTouchStart,
|
39
|
+
onTouchMove,
|
40
|
+
onTouchEnd,
|
41
|
+
onTouchCancel,
|
42
|
+
onClick
|
43
|
+
});
|
44
|
+
const multiarr = arr => {
|
45
|
+
for (let i = 0; i < arr.length; i++) {
|
51
46
|
if (arr[i] instanceof Array) {
|
52
47
|
countArr++;
|
53
48
|
arr = arr[i];
|
54
49
|
multiarr(arr);
|
55
50
|
}
|
56
51
|
}
|
57
|
-
|
58
52
|
return countArr;
|
59
53
|
};
|
60
|
-
|
61
54
|
return (
|
62
55
|
/*#__PURE__*/
|
63
56
|
// @ts-ignore
|
@@ -67,6 +60,5 @@ var Picker = function (props) {
|
|
67
60
|
}), children)
|
68
61
|
);
|
69
62
|
};
|
70
|
-
|
71
63
|
Picker.displayName = 'Picker';
|
72
64
|
export default Picker;
|