@ray-js/components 1.3.21 → 1.3.23
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/LICENSE.md +9 -0
- 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 +19 -25
- package/lib/Form/props.d.ts +1 -1
- package/lib/Icon/Icon.js +10 -10
- package/lib/Icon/Icon.thing.js +10 -10
- package/lib/Icon/Icon.wechat.js +10 -10
- 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 +25 -32
- package/lib/Input/Input.js +28 -26
- package/lib/Input/Input.thing.js +35 -36
- package/lib/Input/Input.wechat.js +46 -47
- package/lib/Input/props.d.ts +1 -1
- package/lib/Input/props.js +1 -1
- 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 +22 -31
- package/lib/Picker/Picker.thing.js +25 -31
- package/lib/Picker/Picker.wechat.js +25 -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 +23 -33
- package/lib/Swiper/Swiper.thing.d.ts +1 -1
- package/lib/Swiper/Swiper.thing.js +17 -24
- package/lib/Swiper/Swiper.wechat.d.ts +1 -1
- package/lib/Swiper/Swiper.wechat.js +17 -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 +19 -25
- package/lib/Textarea/Textarea.js +13 -14
- package/lib/Textarea/Textarea.thing.js +25 -22
- package/lib/Textarea/Textarea.wechat.js +25 -22
- package/lib/Textarea/props.d.ts +1 -1
- package/lib/View/View.js +28 -32
- package/lib/View/View.thing.js +33 -35
- package/lib/View/View.wechat.js +33 -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 +5 -12
- package/lib/types/event.d.ts +1 -1
- package/lib/types/index.js +1 -0
- package/lib/utils/handleProps.js +26 -41
- package/package.json +7 -7
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,21 @@
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
2
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
3
2
|
import * as React from 'react';
|
4
3
|
import { useTouch } from '@ray-js/framework-shared';
|
5
4
|
import { useEventListener } from 'ahooks';
|
6
5
|
import handleProps from '../utils/handleProps';
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
6
|
+
let countArr = 1;
|
7
|
+
const Picker = props => {
|
8
|
+
const {
|
9
|
+
onTouchStart,
|
10
|
+
onTouchMove,
|
11
|
+
onTouchEnd,
|
12
|
+
onTouchCancel,
|
13
|
+
onClick,
|
14
|
+
children
|
15
|
+
} = props;
|
16
|
+
const currentNode = React.useRef(null);
|
17
|
+
useEventListener('change', e => {
|
18
18
|
var _props$onChange;
|
19
|
-
|
20
19
|
(_props$onChange = props.onChange) === null || _props$onChange === void 0 ? void 0 : _props$onChange.call(props, {
|
21
20
|
type: 'change',
|
22
21
|
value: e.detail.value,
|
@@ -25,9 +24,8 @@ var Picker = function (props) {
|
|
25
24
|
}, {
|
26
25
|
target: currentNode
|
27
26
|
});
|
28
|
-
useEventListener('cancel',
|
27
|
+
useEventListener('cancel', e => {
|
29
28
|
var _props$onCancel;
|
30
|
-
|
31
29
|
(_props$onCancel = props.onCancel) === null || _props$onCancel === void 0 ? void 0 : _props$onCancel.call(props, {
|
32
30
|
type: 'cancel',
|
33
31
|
origin: e
|
@@ -35,29 +33,23 @@ var Picker = function (props) {
|
|
35
33
|
}, {
|
36
34
|
target: currentNode
|
37
35
|
});
|
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++) {
|
36
|
+
const [, handlers] = useTouch({
|
37
|
+
onTouchStart,
|
38
|
+
onTouchMove,
|
39
|
+
onTouchEnd,
|
40
|
+
onTouchCancel,
|
41
|
+
onClick
|
42
|
+
});
|
43
|
+
const multiarr = arr => {
|
44
|
+
for (let i = 0; i < arr.length; i++) {
|
51
45
|
if (arr[i] instanceof Array) {
|
52
46
|
countArr++;
|
53
47
|
arr = arr[i];
|
54
48
|
multiarr(arr);
|
55
49
|
}
|
56
50
|
}
|
57
|
-
|
58
51
|
return countArr;
|
59
52
|
};
|
60
|
-
|
61
53
|
return (
|
62
54
|
/*#__PURE__*/
|
63
55
|
// @ts-ignore
|
@@ -67,6 +59,5 @@ var Picker = function (props) {
|
|
67
59
|
}), children)
|
68
60
|
);
|
69
61
|
};
|
70
|
-
|
71
62
|
Picker.displayName = 'Picker';
|
72
63
|
export default Picker;
|
@@ -1,51 +1,46 @@
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
2
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
3
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
4
|
-
|
3
|
+
const _excluded = ["className", "style", "id", "onChange", "onTouchStart", "onTouchMove", "onTouchEnd", "onTouchCancel", "onClick", "onCancel"];
|
5
4
|
import clsx from 'clsx';
|
6
5
|
import * as React from 'react';
|
7
6
|
import { inlineStyle, useTouch } from '@ray-js/framework-shared';
|
8
7
|
import { Picker as RemaxPicker } from '@ray-js/adapter';
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
style
|
13
|
-
id
|
14
|
-
onChange
|
15
|
-
onTouchStart
|
16
|
-
onTouchMove
|
17
|
-
onTouchEnd
|
18
|
-
onTouchCancel
|
19
|
-
onClick
|
20
|
-
onCancel
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
onTouchStart
|
25
|
-
onTouchMove
|
26
|
-
onTouchEnd
|
27
|
-
onTouchCancel
|
28
|
-
onClick
|
29
|
-
})
|
30
|
-
_useTouch2 = _slicedToArray(_useTouch, 2),
|
31
|
-
touching = _useTouch2[0],
|
32
|
-
handlers = _useTouch2[1];
|
33
|
-
|
8
|
+
const Picker = props => {
|
9
|
+
const {
|
10
|
+
className,
|
11
|
+
style,
|
12
|
+
id,
|
13
|
+
onChange,
|
14
|
+
onTouchStart,
|
15
|
+
onTouchMove,
|
16
|
+
onTouchEnd,
|
17
|
+
onTouchCancel,
|
18
|
+
onClick,
|
19
|
+
onCancel
|
20
|
+
} = props,
|
21
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
22
|
+
const [touching, handlers] = useTouch({
|
23
|
+
onTouchStart,
|
24
|
+
onTouchMove,
|
25
|
+
onTouchEnd,
|
26
|
+
onTouchCancel,
|
27
|
+
onClick
|
28
|
+
});
|
34
29
|
return /*#__PURE__*/React.createElement(RemaxPicker, _extends({
|
35
|
-
onChange:
|
30
|
+
onChange: e => {
|
36
31
|
onChange === null || onChange === void 0 ? void 0 : onChange({
|
37
32
|
type: e.type,
|
38
33
|
value: e.detail.value,
|
39
34
|
origin: e
|
40
35
|
});
|
41
36
|
},
|
42
|
-
onCancel:
|
37
|
+
onCancel: e => {
|
43
38
|
onCancel === null || onCancel === void 0 ? void 0 : onCancel({
|
44
39
|
type: e.type,
|
45
40
|
origin: e
|
46
41
|
});
|
47
42
|
},
|
48
|
-
onColumnChange:
|
43
|
+
onColumnChange: e => {
|
49
44
|
onCancel === null || onCancel === void 0 ? void 0 : onCancel({
|
50
45
|
type: e.type,
|
51
46
|
value: e.detail.value,
|
@@ -56,5 +51,4 @@ var Picker = function (props) {
|
|
56
51
|
className: clsx(className)
|
57
52
|
}, restProps, handlers), props.children);
|
58
53
|
};
|
59
|
-
|
60
54
|
export default Picker;
|