@ray-js/components 1.4.0-alpha.2 → 1.4.0-alpha.4
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.js +3 -3
- package/lib/Camera/Camera.thing.js +1 -3
- 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/CoverView/CoverView.js +1 -3
- package/lib/CoverView/CoverView.thing.js +1 -3
- package/lib/CoverView/CoverView.wechat.js +0 -2
- 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/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.js +1 -1
- package/lib/Iframe/Iframe.js +3 -3
- package/lib/Iframe/Iframe.thing.js +1 -3
- 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 +6 -24
- package/lib/Input/props.js +1 -3
- package/lib/IpcPlayer/IpcPlayer.js +3 -3
- package/lib/IpcPlayer/IpcPlayer.thing.js +1 -3
- 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.js +3 -3
- package/lib/NativeVideo/NativeVideo.thing.js +1 -3
- package/lib/NativeVideo/NativeVideo.wechat.js +2 -2
- package/lib/PageContainer/PageContainer.js +12 -19
- package/lib/PageContainer/PageContainer.thing.js +0 -2
- package/lib/PageContainer/PageContainer.wechat.js +0 -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/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.js +24 -33
- package/lib/Swiper/Swiper.thing.js +18 -24
- package/lib/Swiper/Swiper.wechat.js +18 -24
- 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 +3 -9
- 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/index.js +1 -0
- package/lib/utils/handleProps.js +26 -40
- package/package.json +5 -5
@@ -1,20 +1,19 @@
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
2
|
-
import "core-js/modules/es.array.map.js";
|
3
2
|
import * as React from 'react';
|
4
3
|
import clsx from 'clsx';
|
5
4
|
import { useEventListener } from 'ahooks';
|
6
5
|
import PickerViewColumn from '../PickerViewColumn';
|
7
6
|
import handleProps from '../utils/handleProps';
|
8
7
|
import styles from './index.module.less';
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
8
|
+
const PickerView = props => {
|
9
|
+
const {
|
10
|
+
className,
|
11
|
+
range,
|
12
|
+
children
|
13
|
+
} = props;
|
14
|
+
const currentNode = React.useRef(null);
|
15
|
+
useEventListener('change', e => {
|
16
16
|
var _props$onChange;
|
17
|
-
|
18
17
|
(_props$onChange = props.onChange) === null || _props$onChange === void 0 ? void 0 : _props$onChange.call(props, {
|
19
18
|
type: 'change',
|
20
19
|
value: e.detail.value,
|
@@ -23,54 +22,44 @@ var PickerView = function (props) {
|
|
23
22
|
}, {
|
24
23
|
target: currentNode
|
25
24
|
});
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
var multiarr = function (arr) {
|
31
|
-
for (var i = 0; i < arr.length; i++) {
|
25
|
+
const countArray = array => {
|
26
|
+
let countArr = 1;
|
27
|
+
const multiarr = arr => {
|
28
|
+
for (let i = 0; i < arr.length; i++) {
|
32
29
|
if (arr[i] instanceof Array) {
|
33
30
|
countArr++;
|
34
31
|
arr = arr[i];
|
35
32
|
multiarr(arr);
|
36
33
|
}
|
37
34
|
}
|
38
|
-
|
39
35
|
return countArr;
|
40
36
|
};
|
41
|
-
|
42
37
|
return multiarr(array);
|
43
38
|
};
|
44
|
-
|
45
39
|
return (
|
46
40
|
/*#__PURE__*/
|
47
41
|
// @ts-ignore
|
48
42
|
React.createElement("v-picker-view", _extends({}, handleProps(props), {
|
49
43
|
ref: currentNode,
|
50
44
|
class: clsx(styles.pickerViewWrp, className)
|
51
|
-
}), children ||
|
45
|
+
}), children || (() => {
|
52
46
|
if (countArray(props.range) > 1) {
|
53
|
-
return props.range.map(
|
47
|
+
return props.range.map((item, index) => {
|
54
48
|
return /*#__PURE__*/React.createElement(PickerViewColumn, {
|
55
49
|
key: index
|
56
|
-
}, item.map(
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
}, i);
|
61
|
-
}));
|
50
|
+
}, item.map((i, id) => /*#__PURE__*/React.createElement("div", {
|
51
|
+
key: id,
|
52
|
+
className: styles.pcWrp
|
53
|
+
}, i)));
|
62
54
|
});
|
63
55
|
} else {
|
64
|
-
return /*#__PURE__*/React.createElement(PickerViewColumn, null, range.map(
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
}, item);
|
69
|
-
}));
|
56
|
+
return /*#__PURE__*/React.createElement(PickerViewColumn, null, range.map((item, index) => /*#__PURE__*/React.createElement("div", {
|
57
|
+
key: index,
|
58
|
+
className: styles.pcWrp
|
59
|
+
}, item)));
|
70
60
|
}
|
71
|
-
}())
|
61
|
+
})())
|
72
62
|
);
|
73
63
|
};
|
74
|
-
|
75
64
|
PickerView.displayName = 'PickerView';
|
76
65
|
export default PickerView;
|
@@ -1,38 +1,38 @@
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
3
|
-
|
3
|
+
const _excluded = ["className", "style", "id", "onChange", "onPickstart", "onPickend", "children"];
|
4
4
|
import clsx from 'clsx';
|
5
5
|
import * as React from 'react';
|
6
6
|
import { inlineStyle } from '@ray-js/framework-shared';
|
7
7
|
import { PickerView as RemaxPickerView } from '@ray-js/adapter';
|
8
8
|
import styles from './index.module.less';
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
style
|
13
|
-
id
|
14
|
-
onChange
|
15
|
-
onPickstart
|
16
|
-
onPickend
|
17
|
-
children
|
18
|
-
|
19
|
-
|
9
|
+
const Picker = props => {
|
10
|
+
const {
|
11
|
+
className,
|
12
|
+
style,
|
13
|
+
id,
|
14
|
+
onChange,
|
15
|
+
onPickstart,
|
16
|
+
onPickend,
|
17
|
+
children
|
18
|
+
} = props,
|
19
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
20
20
|
return /*#__PURE__*/React.createElement(RemaxPickerView, _extends({
|
21
|
-
onChange:
|
21
|
+
onChange: e => {
|
22
22
|
onChange === null || onChange === void 0 ? void 0 : onChange({
|
23
23
|
type: 'change',
|
24
24
|
value: e.detail.value,
|
25
25
|
origin: e
|
26
26
|
});
|
27
27
|
},
|
28
|
-
onPickstart:
|
28
|
+
onPickstart: e => {
|
29
29
|
onPickstart === null || onPickstart === void 0 ? void 0 : onPickstart({
|
30
30
|
type: 'pickstart',
|
31
31
|
value: e.detail.value,
|
32
32
|
origin: e
|
33
33
|
});
|
34
34
|
},
|
35
|
-
onPickend:
|
35
|
+
onPickend: e => {
|
36
36
|
onPickend === null || onPickend === void 0 ? void 0 : onPickend({
|
37
37
|
type: 'pickend',
|
38
38
|
value: e.detail.value,
|
@@ -41,9 +41,6 @@ var Picker = function (props) {
|
|
41
41
|
},
|
42
42
|
style: inlineStyle(style),
|
43
43
|
className: clsx(styles.pickerViewWrp, className)
|
44
|
-
}, restProps),
|
45
|
-
return children;
|
46
|
-
}());
|
44
|
+
}, restProps), (() => children)());
|
47
45
|
};
|
48
|
-
|
49
46
|
export default Picker;
|
@@ -1,38 +1,38 @@
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
3
|
-
|
3
|
+
const _excluded = ["className", "style", "id", "onChange", "onPickstart", "onPickend", "children"];
|
4
4
|
import clsx from 'clsx';
|
5
5
|
import * as React from 'react';
|
6
6
|
import { inlineStyle } from '@ray-js/framework-shared';
|
7
7
|
import { PickerView as RemaxPickerView } from '@ray-js/adapter';
|
8
8
|
import styles from './index.module.less';
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
style
|
13
|
-
id
|
14
|
-
onChange
|
15
|
-
onPickstart
|
16
|
-
onPickend
|
17
|
-
children
|
18
|
-
|
19
|
-
|
9
|
+
const Picker = props => {
|
10
|
+
const {
|
11
|
+
className,
|
12
|
+
style,
|
13
|
+
id,
|
14
|
+
onChange,
|
15
|
+
onPickstart,
|
16
|
+
onPickend,
|
17
|
+
children
|
18
|
+
} = props,
|
19
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
20
20
|
return /*#__PURE__*/React.createElement(RemaxPickerView, _extends({
|
21
|
-
onChange:
|
21
|
+
onChange: e => {
|
22
22
|
onChange === null || onChange === void 0 ? void 0 : onChange({
|
23
23
|
type: 'change',
|
24
24
|
value: e.detail.value,
|
25
25
|
origin: e
|
26
26
|
});
|
27
27
|
},
|
28
|
-
onPickstart:
|
28
|
+
onPickstart: e => {
|
29
29
|
onPickstart === null || onPickstart === void 0 ? void 0 : onPickstart({
|
30
30
|
type: 'pickstart',
|
31
31
|
value: e.detail.value,
|
32
32
|
origin: e
|
33
33
|
});
|
34
34
|
},
|
35
|
-
onPickend:
|
35
|
+
onPickend: e => {
|
36
36
|
onPickend === null || onPickend === void 0 ? void 0 : onPickend({
|
37
37
|
type: 'pickend',
|
38
38
|
value: e.detail.value,
|
@@ -41,9 +41,6 @@ var Picker = function (props) {
|
|
41
41
|
},
|
42
42
|
style: inlineStyle(style),
|
43
43
|
className: clsx(styles.pickerViewWrp, className)
|
44
|
-
}, restProps),
|
45
|
-
return children;
|
46
|
-
}());
|
44
|
+
}, restProps), (() => children)());
|
47
45
|
};
|
48
|
-
|
49
46
|
export default Picker;
|
@@ -1,14 +1,14 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import handleProps from '../utils/handleProps';
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
const PickerViewColumn = props => {
|
4
|
+
const {
|
5
|
+
children
|
6
|
+
} = props;
|
6
7
|
return (
|
7
8
|
/*#__PURE__*/
|
8
9
|
// @ts-ignore
|
9
10
|
React.createElement("v-picker-view-column", handleProps(props), children)
|
10
11
|
);
|
11
12
|
};
|
12
|
-
|
13
13
|
PickerViewColumn.displayName = 'PickerViewColumn';
|
14
14
|
export default PickerViewColumn;
|
@@ -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 = ["style"];
|
4
4
|
import * as React from 'react';
|
5
5
|
import { inlineStyle } from '@ray-js/framework-shared';
|
6
6
|
import { PickerViewColumn as RemaxViewColumnPicker } from '@ray-js/adapter';
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
7
|
+
const PickerViewColumn = props => {
|
8
|
+
const {
|
9
|
+
style
|
10
|
+
} = props,
|
11
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
12
12
|
return /*#__PURE__*/React.createElement(RemaxViewColumnPicker, _extends({
|
13
13
|
style: inlineStyle(style)
|
14
14
|
}, restProps));
|
15
15
|
};
|
16
|
-
|
17
16
|
export default PickerViewColumn;
|
@@ -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 = ["style"];
|
4
4
|
import * as React from 'react';
|
5
5
|
import { inlineStyle } from '@ray-js/framework-shared';
|
6
6
|
import { PickerViewColumn as RemaxViewColumnPicker } from '@ray-js/adapter';
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
7
|
+
const PickerViewColumn = props => {
|
8
|
+
const {
|
9
|
+
style
|
10
|
+
} = props,
|
11
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
12
12
|
return /*#__PURE__*/React.createElement(RemaxViewColumnPicker, _extends({
|
13
13
|
style: inlineStyle(style)
|
14
14
|
}, restProps));
|
15
15
|
};
|
16
|
-
|
17
16
|
export default PickerViewColumn;
|
package/lib/Progress/Progress.js
CHANGED
@@ -1,13 +1,11 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import handleProps from '../utils/handleProps';
|
3
|
-
|
4
|
-
var Progress = function (props) {
|
3
|
+
const Progress = props => {
|
5
4
|
return (
|
6
5
|
/*#__PURE__*/
|
7
6
|
// @ts-ignore
|
8
7
|
React.createElement("v-progress", handleProps(props))
|
9
8
|
);
|
10
9
|
};
|
11
|
-
|
12
10
|
Progress.displayName = 'Progress';
|
13
11
|
export default Progress;
|
@@ -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 = ["style"];
|
4
4
|
import * as React from 'react';
|
5
5
|
import { inlineStyle } from '@ray-js/framework-shared';
|
6
6
|
import { Progress as RemaxProgress } from '@ray-js/adapter';
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
7
|
+
const Progress = props => {
|
8
|
+
const {
|
9
|
+
style
|
10
|
+
} = props,
|
11
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
12
12
|
return /*#__PURE__*/React.createElement(RemaxProgress, _extends({
|
13
13
|
style: inlineStyle(style)
|
14
14
|
}, restProps));
|
15
15
|
};
|
16
|
-
|
17
16
|
export default Progress;
|
@@ -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 = ["style"];
|
4
4
|
import * as React from 'react';
|
5
5
|
import { inlineStyle } from '@ray-js/framework-shared';
|
6
6
|
import { Progress as RemaxProgress } from '@ray-js/adapter';
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
7
|
+
const Progress = props => {
|
8
|
+
const {
|
9
|
+
style
|
10
|
+
} = props,
|
11
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
12
12
|
return /*#__PURE__*/React.createElement(RemaxProgress, _extends({
|
13
13
|
style: inlineStyle(style)
|
14
14
|
}, restProps));
|
15
15
|
};
|
16
|
-
|
17
16
|
export default Progress;
|
package/lib/Radio/Radio.js
CHANGED
@@ -1,10 +1,8 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import handleProps from '../utils/handleProps';
|
3
|
-
|
4
|
-
var Radio = function (props) {
|
3
|
+
const Radio = props => {
|
5
4
|
// @ts-ignore
|
6
5
|
return /*#__PURE__*/React.createElement("v-radio", handleProps(props));
|
7
6
|
};
|
8
|
-
|
9
7
|
Radio.displayName = 'Radio';
|
10
8
|
export default Radio;
|
package/lib/Radio/Radio.thing.js
CHANGED
@@ -1,22 +1,21 @@
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
3
|
-
|
3
|
+
const _excluded = ["className", "style", "id"];
|
4
4
|
import clsx from 'clsx';
|
5
5
|
import * as React from 'react';
|
6
6
|
import { inlineStyle } from '@ray-js/framework-shared';
|
7
7
|
import { Radio as RemaxRadio } from '@ray-js/adapter';
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
style
|
12
|
-
id
|
13
|
-
|
14
|
-
|
8
|
+
const Radio = props => {
|
9
|
+
const {
|
10
|
+
className,
|
11
|
+
style,
|
12
|
+
id
|
13
|
+
} = props,
|
14
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
15
15
|
return /*#__PURE__*/React.createElement(RemaxRadio, _extends({
|
16
16
|
id: id,
|
17
17
|
style: inlineStyle(style),
|
18
18
|
className: clsx('ray-radio', className)
|
19
19
|
}, restProps));
|
20
20
|
};
|
21
|
-
|
22
21
|
export default Radio;
|
@@ -1,18 +1,18 @@
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
3
|
-
|
3
|
+
const _excluded = ["className", "style", "id", "color"];
|
4
4
|
import clsx from 'clsx';
|
5
5
|
import * as React from 'react';
|
6
6
|
import { inlineStyle } from '@ray-js/framework-shared';
|
7
7
|
import { Radio as RemaxRadio } from '@ray-core/wechat';
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
style
|
12
|
-
id
|
13
|
-
color
|
14
|
-
|
15
|
-
|
8
|
+
const Radio = props => {
|
9
|
+
const {
|
10
|
+
className,
|
11
|
+
style,
|
12
|
+
id,
|
13
|
+
color
|
14
|
+
} = props,
|
15
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
16
16
|
return /*#__PURE__*/React.createElement(RemaxRadio, _extends({
|
17
17
|
id: id,
|
18
18
|
color: color || '#007aff',
|
@@ -20,5 +20,4 @@ var Radio = function (props) {
|
|
20
20
|
className: clsx('ray-radio', className)
|
21
21
|
}, restProps));
|
22
22
|
};
|
23
|
-
|
24
23
|
export default Radio;
|
@@ -1,17 +1,16 @@
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
2
|
-
import "core-js/modules/es.array.map.js";
|
3
2
|
import * as React from 'react';
|
4
3
|
import { useEventListener } from 'ahooks';
|
5
4
|
import handleProps from '../utils/handleProps';
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
5
|
+
const RadioGroup = props => {
|
6
|
+
const {
|
7
|
+
options,
|
8
|
+
disabled,
|
9
|
+
children
|
10
|
+
} = props;
|
11
|
+
const currentNode = React.useRef(null);
|
12
|
+
useEventListener('change', e => {
|
13
13
|
var _props$onChange;
|
14
|
-
|
15
14
|
!disabled && ((_props$onChange = props.onChange) === null || _props$onChange === void 0 ? void 0 : _props$onChange.call(props, {
|
16
15
|
type: 'change',
|
17
16
|
value: e.detail.value
|
@@ -24,23 +23,19 @@ var RadioGroup = function (props) {
|
|
24
23
|
// @ts-ignore
|
25
24
|
React.createElement("v-radio-group", _extends({}, handleProps(props), {
|
26
25
|
ref: currentNode
|
27
|
-
}), children ||
|
28
|
-
return options.map(
|
26
|
+
}), children || (() => {
|
27
|
+
return options.map((item, index) => {
|
29
28
|
var _item$checked;
|
30
|
-
|
31
|
-
var radioProps = {
|
29
|
+
const radioProps = {
|
32
30
|
value: item.value,
|
33
31
|
color: item.color
|
34
32
|
};
|
35
|
-
|
36
33
|
if ((_item$checked = item.checked) !== null && _item$checked !== void 0 ? _item$checked : false) {
|
37
34
|
radioProps.checked = true;
|
38
35
|
}
|
39
|
-
|
40
36
|
if (disabled || item.disabled || false) {
|
41
37
|
radioProps.disabled = true;
|
42
38
|
}
|
43
|
-
|
44
39
|
return (
|
45
40
|
/*#__PURE__*/
|
46
41
|
// @ts-ignore
|
@@ -49,9 +44,8 @@ var RadioGroup = function (props) {
|
|
49
44
|
}, /*#__PURE__*/React.createElement("v-radio", radioProps), item.label)
|
50
45
|
);
|
51
46
|
});
|
52
|
-
}())
|
47
|
+
})())
|
53
48
|
);
|
54
49
|
};
|
55
|
-
|
56
50
|
RadioGroup.displayName = 'RadioGroup';
|
57
51
|
export default RadioGroup;
|
@@ -1,39 +1,34 @@
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
3
|
-
|
4
|
-
import "core-js/modules/es.array.map.js";
|
3
|
+
const _excluded = ["options", "name", "disabled", "onChange", "children", "style"];
|
5
4
|
import * as React from 'react';
|
6
5
|
import { RadioGroup as RemaxRadioGroup } from '@ray-js/adapter';
|
7
6
|
import Radio from '../Radio';
|
8
7
|
import Label from '../Label';
|
9
8
|
import { inlineStyle } from '@ray-js/framework-shared';
|
10
|
-
|
11
|
-
var RadioGroup = function (props) {
|
9
|
+
const RadioGroup = props => {
|
12
10
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
onChange =
|
18
|
-
children
|
19
|
-
style
|
20
|
-
|
21
|
-
|
11
|
+
const {
|
12
|
+
options,
|
13
|
+
name,
|
14
|
+
disabled,
|
15
|
+
onChange = () => {},
|
16
|
+
children,
|
17
|
+
style
|
18
|
+
} = props,
|
19
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
22
20
|
return (
|
23
21
|
/*#__PURE__*/
|
24
22
|
// @ts-ignore
|
25
23
|
React.createElement(RemaxRadioGroup, _extends({
|
26
24
|
style: inlineStyle(style),
|
27
25
|
name: name,
|
28
|
-
onChange:
|
26
|
+
onChange: e => {
|
29
27
|
!disabled && onChange(e);
|
30
28
|
}
|
31
|
-
}, restProps),
|
32
|
-
return
|
33
|
-
}() || function renderOptions() {
|
34
|
-
return options.map(function (item, index) {
|
29
|
+
}, restProps), (() => children)() || (() => {
|
30
|
+
return options.map((item, index) => {
|
35
31
|
var _item$checked;
|
36
|
-
|
37
32
|
return /*#__PURE__*/React.createElement(Label, {
|
38
33
|
key: index + '_' + item.value
|
39
34
|
}, /*#__PURE__*/React.createElement(Radio, {
|
@@ -43,8 +38,7 @@ var RadioGroup = function (props) {
|
|
43
38
|
color: item.color
|
44
39
|
}), item.label);
|
45
40
|
});
|
46
|
-
}())
|
41
|
+
})())
|
47
42
|
);
|
48
43
|
};
|
49
|
-
|
50
44
|
export default RadioGroup;
|
@@ -1,27 +1,23 @@
|
|
1
|
-
import "core-js/modules/es.array.map.js";
|
2
1
|
import * as React from 'react';
|
3
2
|
import { RadioGroup as RemaxRadioGroup } from '@ray-core/wechat';
|
4
3
|
import Radio from '../Radio';
|
5
4
|
import Label from '../Label';
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
5
|
+
const RadioGroup = props => {
|
6
|
+
const {
|
7
|
+
options,
|
8
|
+
name,
|
9
|
+
disabled,
|
10
|
+
onChange = () => {},
|
11
|
+
children
|
12
|
+
} = props;
|
14
13
|
return /*#__PURE__*/React.createElement(RemaxRadioGroup, {
|
15
14
|
name: name,
|
16
|
-
onChange:
|
15
|
+
onChange: e => {
|
17
16
|
!disabled && onChange(e);
|
18
17
|
}
|
19
|
-
},
|
20
|
-
return
|
21
|
-
}() || function renderOptions() {
|
22
|
-
return options.map(function (item, index) {
|
18
|
+
}, (() => children)() || (() => {
|
19
|
+
return options.map((item, index) => {
|
23
20
|
var _item$checked;
|
24
|
-
|
25
21
|
return /*#__PURE__*/React.createElement(Label, {
|
26
22
|
key: index + '_' + item.value
|
27
23
|
}, /*#__PURE__*/React.createElement(Radio, {
|
@@ -31,7 +27,6 @@ var RadioGroup = function (props) {
|
|
31
27
|
color: item.color
|
32
28
|
}), item.label);
|
33
29
|
});
|
34
|
-
}());
|
30
|
+
})());
|
35
31
|
};
|
36
|
-
|
37
32
|
export default RadioGroup;
|
package/lib/RichText/RichText.js
CHANGED