@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.
Files changed (141) hide show
  1. package/LICENSE.md +9 -0
  2. package/lib/Button/Button.js +1 -3
  3. package/lib/Button/Button.thing.js +15 -17
  4. package/lib/Button/Button.wechat.js +15 -17
  5. package/lib/Button/props.js +1 -1
  6. package/lib/Camera/Camera.d.ts +2 -1
  7. package/lib/Camera/Camera.js +3 -3
  8. package/lib/Camera/Camera.thing.js +1 -3
  9. package/lib/Camera/Camera.wechat.d.ts +2 -1
  10. package/lib/Camera/Camera.wechat.js +2 -2
  11. package/lib/Checkbox/Checkbox.js +1 -3
  12. package/lib/Checkbox/Checkbox.thing.js +8 -9
  13. package/lib/Checkbox/Checkbox.wechat.js +9 -10
  14. package/lib/CheckboxGroup/CheckboxGroup.js +15 -19
  15. package/lib/CheckboxGroup/CheckboxGroup.thing.js +12 -17
  16. package/lib/CheckboxGroup/CheckboxGroup.wechat.js +12 -17
  17. package/lib/CheckboxGroup/props.d.ts +1 -1
  18. package/lib/CoverView/CoverView.js +1 -3
  19. package/lib/CoverView/CoverView.thing.js +1 -3
  20. package/lib/CoverView/CoverView.wechat.d.ts +2 -1
  21. package/lib/CoverView/CoverView.wechat.js +0 -2
  22. package/lib/CoverView/props.d.ts +1 -1
  23. package/lib/CoverView/props.js +1 -1
  24. package/lib/Form/Form.js +12 -12
  25. package/lib/Form/Form.thing.js +1 -3
  26. package/lib/Form/Form.wechat.js +19 -25
  27. package/lib/Form/props.d.ts +1 -1
  28. package/lib/Icon/Icon.js +10 -10
  29. package/lib/Icon/Icon.thing.js +10 -10
  30. package/lib/Icon/Icon.wechat.js +10 -10
  31. package/lib/Icon/iconfont/iconfont.js +13 -20
  32. package/lib/Icon/props.d.ts +1 -1
  33. package/lib/Icon/props.js +1 -1
  34. package/lib/Iframe/Iframe.d.ts +2 -1
  35. package/lib/Iframe/Iframe.js +3 -3
  36. package/lib/Iframe/Iframe.thing.js +1 -3
  37. package/lib/Iframe/Iframe.wechat.d.ts +2 -1
  38. package/lib/Iframe/Iframe.wechat.js +3 -3
  39. package/lib/Image/Image.js +6 -8
  40. package/lib/Image/Image.thing.js +8 -10
  41. package/lib/Image/Image.wechat.js +25 -32
  42. package/lib/Input/Input.js +28 -26
  43. package/lib/Input/Input.thing.js +35 -36
  44. package/lib/Input/Input.wechat.js +46 -47
  45. package/lib/Input/props.d.ts +1 -1
  46. package/lib/Input/props.js +1 -1
  47. package/lib/IpcPlayer/IpcPlayer.d.ts +2 -1
  48. package/lib/IpcPlayer/IpcPlayer.js +3 -3
  49. package/lib/IpcPlayer/IpcPlayer.thing.js +1 -3
  50. package/lib/IpcPlayer/IpcPlayer.wechat.d.ts +2 -1
  51. package/lib/IpcPlayer/IpcPlayer.wechat.js +2 -2
  52. package/lib/Label/Label.js +7 -8
  53. package/lib/Label/Label.thing.js +8 -8
  54. package/lib/Label/Label.wechat.js +8 -8
  55. package/lib/Map/Map.js +1 -3
  56. package/lib/Map/Map.thing.js +1 -3
  57. package/lib/Map/Map.wechat.js +1 -3
  58. package/lib/Modal/index.js +4 -2
  59. package/lib/Modal/index.web.js +6 -4
  60. package/lib/MovableArea/MovableArea.js +5 -4
  61. package/lib/MovableArea/MovableArea.thing.js +1 -3
  62. package/lib/MovableArea/MovableArea.wechat.js +1 -3
  63. package/lib/MovableView/MovableView.js +12 -11
  64. package/lib/MovableView/MovableView.thing.js +1 -3
  65. package/lib/MovableView/MovableView.wechat.js +1 -3
  66. package/lib/NativeVideo/NativeVideo.d.ts +2 -1
  67. package/lib/NativeVideo/NativeVideo.js +3 -3
  68. package/lib/NativeVideo/NativeVideo.thing.js +1 -3
  69. package/lib/NativeVideo/NativeVideo.wechat.d.ts +2 -1
  70. package/lib/NativeVideo/NativeVideo.wechat.js +2 -2
  71. package/lib/PageContainer/PageContainer.js +12 -19
  72. package/lib/PageContainer/PageContainer.thing.d.ts +2 -1
  73. package/lib/PageContainer/PageContainer.thing.js +0 -2
  74. package/lib/PageContainer/PageContainer.wechat.d.ts +2 -1
  75. package/lib/PageContainer/PageContainer.wechat.js +0 -2
  76. package/lib/PageContainer/props.d.ts +2 -2
  77. package/lib/PageContainer/props.js +3 -3
  78. package/lib/Picker/Picker.js +22 -31
  79. package/lib/Picker/Picker.thing.js +25 -31
  80. package/lib/Picker/Picker.wechat.js +25 -31
  81. package/lib/PickerView/PickerView.js +23 -34
  82. package/lib/PickerView/PickerView.thing.js +16 -19
  83. package/lib/PickerView/PickerView.wechat.js +16 -19
  84. package/lib/PickerViewColumn/PickerViewColumn.js +4 -4
  85. package/lib/PickerViewColumn/PickerViewColumn.thing.js +6 -7
  86. package/lib/PickerViewColumn/PickerViewColumn.wechat.js +6 -7
  87. package/lib/Progress/Progress.js +1 -3
  88. package/lib/Progress/Progress.thing.js +6 -7
  89. package/lib/Progress/Progress.wechat.js +6 -7
  90. package/lib/Radio/Radio.js +1 -3
  91. package/lib/Radio/Radio.thing.js +8 -9
  92. package/lib/Radio/Radio.wechat.js +9 -10
  93. package/lib/RadioGroup/RadioGroup.js +12 -18
  94. package/lib/RadioGroup/RadioGroup.thing.js +15 -21
  95. package/lib/RadioGroup/RadioGroup.wechat.js +12 -17
  96. package/lib/RadioGroup/props.d.ts +1 -1
  97. package/lib/RichText/RichText.js +1 -1
  98. package/lib/RichText/RichText.thing.js +1 -3
  99. package/lib/RichText/RichText.wechat.js +1 -3
  100. package/lib/ScrollView/ScrollView.js +12 -13
  101. package/lib/ScrollView/ScrollView.thing.js +6 -7
  102. package/lib/ScrollView/ScrollView.wechat.js +6 -7
  103. package/lib/Slider/Slider.js +4 -8
  104. package/lib/Slider/Slider.thing.js +13 -14
  105. package/lib/Slider/Slider.wechat.js +14 -15
  106. package/lib/Slider/props.js +1 -1
  107. package/lib/Swiper/Swiper.d.ts +1 -1
  108. package/lib/Swiper/Swiper.js +23 -33
  109. package/lib/Swiper/Swiper.thing.d.ts +1 -1
  110. package/lib/Swiper/Swiper.thing.js +17 -24
  111. package/lib/Swiper/Swiper.wechat.d.ts +1 -1
  112. package/lib/Swiper/Swiper.wechat.js +17 -24
  113. package/lib/Swiper/props.d.ts +1 -1
  114. package/lib/Swiper/props.js +2 -2
  115. package/lib/SwiperItem/SwiperItem.js +4 -4
  116. package/lib/SwiperItem/SwiperItem.thing.js +8 -9
  117. package/lib/SwiperItem/SwiperItem.wechat.js +8 -9
  118. package/lib/Switch/Switch.js +5 -8
  119. package/lib/Switch/Switch.thing.js +12 -14
  120. package/lib/Switch/Switch.wechat.js +12 -14
  121. package/lib/Switch/props.js +1 -1
  122. package/lib/Text/Text.js +1 -3
  123. package/lib/Text/Text.thing.js +1 -3
  124. package/lib/Text/Text.wechat.js +19 -25
  125. package/lib/Textarea/Textarea.js +13 -14
  126. package/lib/Textarea/Textarea.thing.js +25 -22
  127. package/lib/Textarea/Textarea.wechat.js +25 -22
  128. package/lib/Textarea/props.d.ts +1 -1
  129. package/lib/View/View.js +28 -32
  130. package/lib/View/View.thing.js +33 -35
  131. package/lib/View/View.wechat.js +33 -35
  132. package/lib/View/props.js +1 -1
  133. package/lib/WebView/WebView.js +1 -3
  134. package/lib/WebView/WebView.thing.js +1 -3
  135. package/lib/WebView/WebView.wechat.js +1 -3
  136. package/lib/assets/icons.js +1 -1
  137. package/lib/core/index.js +5 -12
  138. package/lib/types/event.d.ts +1 -1
  139. package/lib/types/index.js +1 -0
  140. package/lib/utils/handleProps.js +26 -41
  141. package/package.json +7 -7
@@ -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
- var _excluded = ["className", "style", "id", "onChange", "onTouchStart", "onTouchMove", "onTouchEnd", "onTouchCancel", "onClick", "onCancel"];
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
- var Picker = function (props) {
11
- var className = props.className,
12
- style = props.style,
13
- id = props.id,
14
- onChange = props.onChange,
15
- onTouchStart = props.onTouchStart,
16
- onTouchMove = props.onTouchMove,
17
- onTouchEnd = props.onTouchEnd,
18
- onTouchCancel = props.onTouchCancel,
19
- onClick = props.onClick,
20
- onCancel = props.onCancel,
21
- restProps = _objectWithoutProperties(props, _excluded);
22
-
23
- var _useTouch = useTouch({
24
- onTouchStart: onTouchStart,
25
- onTouchMove: onTouchMove,
26
- onTouchEnd: onTouchEnd,
27
- onTouchCancel: onTouchCancel,
28
- onClick: 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: function handleChange(e) {
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: function handleCancel(e) {
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: function handleColumnChange(e) {
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;
@@ -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;