@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.
Files changed (118) hide show
  1. package/lib/Button/Button.js +1 -3
  2. package/lib/Button/Button.thing.js +15 -17
  3. package/lib/Button/Button.wechat.js +15 -17
  4. package/lib/Button/props.js +1 -1
  5. package/lib/Camera/Camera.js +3 -3
  6. package/lib/Camera/Camera.thing.js +1 -3
  7. package/lib/Camera/Camera.wechat.js +2 -2
  8. package/lib/Checkbox/Checkbox.js +1 -3
  9. package/lib/Checkbox/Checkbox.thing.js +8 -9
  10. package/lib/Checkbox/Checkbox.wechat.js +9 -10
  11. package/lib/CheckboxGroup/CheckboxGroup.js +15 -19
  12. package/lib/CheckboxGroup/CheckboxGroup.thing.js +12 -17
  13. package/lib/CheckboxGroup/CheckboxGroup.wechat.js +12 -17
  14. package/lib/CoverView/CoverView.js +1 -3
  15. package/lib/CoverView/CoverView.thing.js +1 -3
  16. package/lib/CoverView/CoverView.wechat.js +0 -2
  17. package/lib/CoverView/props.js +1 -1
  18. package/lib/Form/Form.js +12 -12
  19. package/lib/Form/Form.thing.js +1 -3
  20. package/lib/Form/Form.wechat.js +20 -25
  21. package/lib/Icon/Icon.js +7 -7
  22. package/lib/Icon/Icon.thing.js +7 -7
  23. package/lib/Icon/Icon.wechat.js +7 -7
  24. package/lib/Icon/iconfont/iconfont.js +13 -20
  25. package/lib/Icon/props.js +1 -1
  26. package/lib/Iframe/Iframe.js +3 -3
  27. package/lib/Iframe/Iframe.thing.js +1 -3
  28. package/lib/Iframe/Iframe.wechat.js +3 -3
  29. package/lib/Image/Image.js +6 -8
  30. package/lib/Image/Image.thing.js +8 -10
  31. package/lib/Image/Image.wechat.js +26 -32
  32. package/lib/Input/Input.js +29 -26
  33. package/lib/Input/Input.thing.js +36 -36
  34. package/lib/Input/Input.wechat.js +47 -47
  35. package/lib/Input/props.d.ts +6 -24
  36. package/lib/Input/props.js +1 -3
  37. package/lib/IpcPlayer/IpcPlayer.js +3 -3
  38. package/lib/IpcPlayer/IpcPlayer.thing.js +1 -3
  39. package/lib/IpcPlayer/IpcPlayer.wechat.js +2 -2
  40. package/lib/Label/Label.js +7 -8
  41. package/lib/Label/Label.thing.js +8 -8
  42. package/lib/Label/Label.wechat.js +8 -8
  43. package/lib/Map/Map.js +1 -3
  44. package/lib/Map/Map.thing.js +1 -3
  45. package/lib/Map/Map.wechat.js +1 -3
  46. package/lib/Modal/index.js +4 -2
  47. package/lib/Modal/index.web.js +6 -4
  48. package/lib/MovableArea/MovableArea.js +5 -4
  49. package/lib/MovableArea/MovableArea.thing.js +1 -3
  50. package/lib/MovableArea/MovableArea.wechat.js +1 -3
  51. package/lib/MovableView/MovableView.js +12 -11
  52. package/lib/MovableView/MovableView.thing.js +1 -3
  53. package/lib/MovableView/MovableView.wechat.js +1 -3
  54. package/lib/NativeVideo/NativeVideo.js +3 -3
  55. package/lib/NativeVideo/NativeVideo.thing.js +1 -3
  56. package/lib/NativeVideo/NativeVideo.wechat.js +2 -2
  57. package/lib/PageContainer/PageContainer.js +12 -19
  58. package/lib/PageContainer/PageContainer.thing.js +0 -2
  59. package/lib/PageContainer/PageContainer.wechat.js +0 -2
  60. package/lib/PageContainer/props.js +3 -3
  61. package/lib/Picker/Picker.js +23 -31
  62. package/lib/Picker/Picker.thing.js +26 -31
  63. package/lib/Picker/Picker.wechat.js +26 -31
  64. package/lib/PickerView/PickerView.js +23 -34
  65. package/lib/PickerView/PickerView.thing.js +16 -19
  66. package/lib/PickerView/PickerView.wechat.js +16 -19
  67. package/lib/PickerViewColumn/PickerViewColumn.js +4 -4
  68. package/lib/PickerViewColumn/PickerViewColumn.thing.js +6 -7
  69. package/lib/PickerViewColumn/PickerViewColumn.wechat.js +6 -7
  70. package/lib/Progress/Progress.js +1 -3
  71. package/lib/Progress/Progress.thing.js +6 -7
  72. package/lib/Progress/Progress.wechat.js +6 -7
  73. package/lib/Radio/Radio.js +1 -3
  74. package/lib/Radio/Radio.thing.js +8 -9
  75. package/lib/Radio/Radio.wechat.js +9 -10
  76. package/lib/RadioGroup/RadioGroup.js +12 -18
  77. package/lib/RadioGroup/RadioGroup.thing.js +15 -21
  78. package/lib/RadioGroup/RadioGroup.wechat.js +12 -17
  79. package/lib/RichText/RichText.js +1 -1
  80. package/lib/RichText/RichText.thing.js +1 -3
  81. package/lib/RichText/RichText.wechat.js +1 -3
  82. package/lib/ScrollView/ScrollView.js +12 -13
  83. package/lib/ScrollView/ScrollView.thing.js +6 -7
  84. package/lib/ScrollView/ScrollView.wechat.js +6 -7
  85. package/lib/Slider/Slider.js +4 -8
  86. package/lib/Slider/Slider.thing.js +13 -14
  87. package/lib/Slider/Slider.wechat.js +14 -15
  88. package/lib/Slider/props.js +1 -1
  89. package/lib/Swiper/Swiper.js +24 -33
  90. package/lib/Swiper/Swiper.thing.js +18 -24
  91. package/lib/Swiper/Swiper.wechat.js +18 -24
  92. package/lib/Swiper/props.js +2 -2
  93. package/lib/SwiperItem/SwiperItem.js +4 -4
  94. package/lib/SwiperItem/SwiperItem.thing.js +8 -9
  95. package/lib/SwiperItem/SwiperItem.wechat.js +8 -9
  96. package/lib/Switch/Switch.js +5 -8
  97. package/lib/Switch/Switch.thing.js +12 -14
  98. package/lib/Switch/Switch.wechat.js +12 -14
  99. package/lib/Switch/props.js +1 -1
  100. package/lib/Text/Text.js +1 -3
  101. package/lib/Text/Text.thing.js +1 -3
  102. package/lib/Text/Text.wechat.js +20 -25
  103. package/lib/Textarea/Textarea.js +13 -24
  104. package/lib/Textarea/Textarea.thing.js +26 -30
  105. package/lib/Textarea/Textarea.wechat.js +26 -30
  106. package/lib/Textarea/props.d.ts +3 -9
  107. package/lib/View/View.js +29 -32
  108. package/lib/View/View.thing.js +34 -35
  109. package/lib/View/View.wechat.js +34 -35
  110. package/lib/View/props.js +1 -1
  111. package/lib/WebView/WebView.js +1 -3
  112. package/lib/WebView/WebView.thing.js +1 -3
  113. package/lib/WebView/WebView.wechat.js +1 -3
  114. package/lib/assets/icons.js +1 -1
  115. package/lib/core/index.js +4 -11
  116. package/lib/types/index.js +1 -0
  117. package/lib/utils/handleProps.js +26 -40
  118. 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
- var PickerView = function (props) {
11
- var className = props.className,
12
- range = props.range,
13
- children = props.children;
14
- var currentNode = React.useRef(null);
15
- useEventListener('change', function (e) {
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
- var countArray = function (array) {
28
- var countArr = 1;
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 || function renderPickerColumn() {
45
+ }), children || (() => {
52
46
  if (countArray(props.range) > 1) {
53
- return props.range.map(function (item, index) {
47
+ return props.range.map((item, index) => {
54
48
  return /*#__PURE__*/React.createElement(PickerViewColumn, {
55
49
  key: index
56
- }, item.map(function (i, id) {
57
- return /*#__PURE__*/React.createElement("div", {
58
- key: id,
59
- className: styles.pcWrp
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(function (item, index) {
65
- return /*#__PURE__*/React.createElement("div", {
66
- key: index,
67
- className: styles.pcWrp
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
- var _excluded = ["className", "style", "id", "onChange", "onPickstart", "onPickend", "children"];
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
- var Picker = function (props) {
11
- var className = props.className,
12
- style = props.style,
13
- id = props.id,
14
- onChange = props.onChange,
15
- onPickstart = props.onPickstart,
16
- onPickend = props.onPickend,
17
- children = props.children,
18
- restProps = _objectWithoutProperties(props, _excluded);
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: function handleChange(e) {
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: function handlePickstart(e) {
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: function handlePickend(e) {
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), function renderChildren() {
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
- var _excluded = ["className", "style", "id", "onChange", "onPickstart", "onPickend", "children"];
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
- var Picker = function (props) {
11
- var className = props.className,
12
- style = props.style,
13
- id = props.id,
14
- onChange = props.onChange,
15
- onPickstart = props.onPickstart,
16
- onPickend = props.onPickend,
17
- children = props.children,
18
- restProps = _objectWithoutProperties(props, _excluded);
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: function handleChange(e) {
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: function handlePickstart(e) {
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: function handlePickend(e) {
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), function renderChildren() {
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
- var PickerViewColumn = function (props) {
5
- var children = props.children;
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
- var _excluded = ["style"];
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
- var PickerViewColumn = function (props) {
9
- var style = props.style,
10
- restProps = _objectWithoutProperties(props, _excluded);
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
- var _excluded = ["style"];
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
- var PickerViewColumn = function (props) {
9
- var style = props.style,
10
- restProps = _objectWithoutProperties(props, _excluded);
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,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
- var _excluded = ["style"];
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
- var Progress = function (props) {
9
- var style = props.style,
10
- restProps = _objectWithoutProperties(props, _excluded);
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
- var _excluded = ["style"];
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
- var Progress = function (props) {
9
- var style = props.style,
10
- restProps = _objectWithoutProperties(props, _excluded);
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,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;
@@ -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
- var _excluded = ["className", "style", "id"];
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
- var Radio = function (props) {
10
- var className = props.className,
11
- style = props.style,
12
- id = props.id,
13
- restProps = _objectWithoutProperties(props, _excluded);
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
- var _excluded = ["className", "style", "id", "color"];
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
- var Radio = function (props) {
10
- var className = props.className,
11
- style = props.style,
12
- id = props.id,
13
- color = props.color,
14
- restProps = _objectWithoutProperties(props, _excluded);
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
- var RadioGroup = function (props) {
8
- var options = props.options,
9
- disabled = props.disabled,
10
- children = props.children;
11
- var currentNode = React.useRef(null);
12
- useEventListener('change', function (e) {
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 || function renderOptions() {
28
- return options.map(function (item, index) {
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
- var _excluded = ["options", "name", "disabled", "onChange", "children", "style"];
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
- var options = props.options,
14
- name = props.name,
15
- disabled = props.disabled,
16
- _props$onChange = props.onChange,
17
- onChange = _props$onChange === void 0 ? function () {} : _props$onChange,
18
- children = props.children,
19
- style = props.style,
20
- restProps = _objectWithoutProperties(props, _excluded);
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: function handleOnChange(e) {
26
+ onChange: e => {
29
27
  !disabled && onChange(e);
30
28
  }
31
- }, restProps), function renderChildren() {
32
- return children;
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
- var RadioGroup = function (props) {
8
- var options = props.options,
9
- name = props.name,
10
- disabled = props.disabled,
11
- _props$onChange = props.onChange,
12
- onChange = _props$onChange === void 0 ? function () {} : _props$onChange,
13
- children = props.children;
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: function handleOnChange(e) {
15
+ onChange: e => {
17
16
  !disabled && onChange(e);
18
17
  }
19
- }, function renderChildren() {
20
- return children;
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;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import handleProps from '../utils/handleProps';
3
- export var RichText = function (props) {
3
+ export const RichText = props => {
4
4
  // @ts-ignore
5
5
  return /*#__PURE__*/React.createElement("v-rich-text", handleProps(props));
6
6
  };
@@ -1,8 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { RichText as RemaxRichText } from '@ray-js/adapter';
3
-
4
- var RichText = function (props) {
3
+ const RichText = props => {
5
4
  return /*#__PURE__*/React.createElement(RemaxRichText, props);
6
5
  };
7
-
8
6
  export default RichText;
@@ -1,8 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { RichText as RemaxRichText } from '@ray-js/adapter';
3
-
4
- var RichText = function (props) {
3
+ const RichText = props => {
5
4
  return /*#__PURE__*/React.createElement(RemaxRichText, props);
6
5
  };
7
-
8
6
  export default RichText;