@ray-js/components 0.4.0 → 0.4.4-beta-1

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 (94) hide show
  1. package/lib/Button/props.d.ts +61 -1
  2. package/lib/Checkbox/index.md +1 -1
  3. package/lib/Checkbox/props.d.ts +20 -0
  4. package/lib/CheckboxGroup/CheckboxGroup.tuya.js +5 -2
  5. package/lib/CheckboxGroup/CheckboxGroup.wechat.js +5 -2
  6. package/lib/CheckboxGroup/props.d.ts +15 -0
  7. package/lib/DatePicker/index.md +2 -0
  8. package/lib/DatePicker/props.d.ts +70 -2
  9. package/lib/Form/props.d.ts +10 -0
  10. package/lib/Icon/iconfont/iconfont.android.js +1 -1
  11. package/lib/Icon/iconfont/iconfont.css +196 -193
  12. package/lib/Icon/iconfont/iconfont.ios.js +1 -1
  13. package/lib/Icon/iconfont/iconfont.js +9 -9
  14. package/lib/Icon/iconfont/iconfont.json +1 -1
  15. package/lib/Icon/iconfont/iconfont.tuya.js +9 -9
  16. package/lib/Icon/iconfont/iconfont.web.js +9 -9
  17. package/lib/Icon/iconfont/iconfont.wechat.js +9 -9
  18. package/lib/Icon/iconfont-rn/iconfont.json +1 -1
  19. package/lib/Icon/props.d.ts +15 -0
  20. package/lib/Image/props.d.ts +30 -4
  21. package/lib/Input/props.d.ts +105 -2
  22. package/lib/Label/props.d.ts +3 -5
  23. package/lib/LinearGradient/index.md +2 -1
  24. package/lib/LinearGradient/props.d.ts +10 -0
  25. package/lib/Modal/index.md +2 -1
  26. package/lib/Modal/props.d.ts +35 -0
  27. package/lib/Motion/index.md +2 -1
  28. package/lib/Motion/props.d.ts +5 -0
  29. package/lib/Picker/index.md +2 -0
  30. package/lib/Picker/props.d.ts +65 -2
  31. package/lib/PickerView/PickerView.tuya.js +5 -2
  32. package/lib/PickerView/PickerView.wechat.js +5 -2
  33. package/lib/PickerView/index.md +1 -1
  34. package/lib/PickerView/props.d.ts +30 -3
  35. package/lib/PickerViewColumn/PickerViewColumn.tuya.d.ts +3 -3
  36. package/lib/PickerViewColumn/PickerViewColumn.tuya.js +8 -57
  37. package/lib/PickerViewColumn/PickerViewColumn.wechat.d.ts +3 -3
  38. package/lib/PickerViewColumn/PickerViewColumn.wechat.js +8 -58
  39. package/lib/PickerViewColumn/index.md +5 -3
  40. package/lib/PickerViewColumn/props.d.ts +1 -12
  41. package/lib/RadialGradient/index.md +2 -1
  42. package/lib/RadialGradient/props.d.ts +10 -0
  43. package/lib/Radio/props.d.ts +20 -0
  44. package/lib/RadioGroup/RadioGroup.tuya.js +5 -2
  45. package/lib/RadioGroup/RadioGroup.wechat.js +5 -2
  46. package/lib/RadioGroup/index.md +1 -1
  47. package/lib/RadioGroup/props.d.ts +31 -3
  48. package/lib/ScrollView/props.d.ts +76 -3
  49. package/lib/Slider/props.d.ts +80 -0
  50. package/lib/Swiper/Swiper.js +12 -7
  51. package/lib/Swiper/Swiper.tuya.js +11 -6
  52. package/lib/Swiper/Swiper.web.js +12 -7
  53. package/lib/Swiper/Swiper.wechat.js +11 -6
  54. package/lib/Swiper/props.d.ts +45 -9
  55. package/lib/SwiperItem/SwiperItem.android.js +1 -0
  56. package/lib/SwiperItem/SwiperItem.d.ts +4 -0
  57. package/lib/SwiperItem/SwiperItem.ios.js +1 -0
  58. package/lib/SwiperItem/SwiperItem.js +1 -0
  59. package/lib/SwiperItem/SwiperItem.tuya.d.ts +4 -0
  60. package/lib/SwiperItem/SwiperItem.tuya.js +22 -0
  61. package/lib/SwiperItem/SwiperItem.web.js +14 -0
  62. package/lib/SwiperItem/SwiperItem.wechat.d.ts +4 -0
  63. package/lib/SwiperItem/SwiperItem.wechat.js +22 -0
  64. package/lib/SwiperItem/index.android.js +1 -0
  65. package/lib/SwiperItem/index.d.ts +3 -0
  66. package/lib/SwiperItem/index.ios.js +1 -0
  67. package/lib/SwiperItem/index.js +3 -0
  68. package/lib/SwiperItem/index.md +23 -0
  69. package/lib/SwiperItem/index.tuya.js +3 -0
  70. package/lib/SwiperItem/index.web.js +3 -0
  71. package/lib/SwiperItem/index.wechat.js +3 -0
  72. package/lib/SwiperItem/props.android.js +1 -0
  73. package/lib/SwiperItem/props.d.ts +5 -0
  74. package/lib/SwiperItem/props.ios.js +1 -0
  75. package/lib/SwiperItem/props.js +1 -0
  76. package/lib/SwiperItem/props.tuya.js +1 -0
  77. package/lib/SwiperItem/props.web.js +1 -0
  78. package/lib/SwiperItem/props.wechat.js +1 -0
  79. package/lib/Switch/props.d.ts +40 -0
  80. package/lib/Text/props.d.ts +15 -1
  81. package/lib/Textarea/index.md +1 -1
  82. package/lib/Textarea/props.d.ts +60 -2
  83. package/lib/TimePicker/index.md +2 -0
  84. package/lib/TimePicker/props.d.ts +55 -2
  85. package/lib/View/props.d.ts +20 -0
  86. package/lib/index.android.js +1 -1
  87. package/lib/index.d.ts +1 -0
  88. package/lib/index.ios.js +1 -1
  89. package/lib/index.js +1 -0
  90. package/lib/index.tuya.js +1 -0
  91. package/lib/index.web.js +1 -0
  92. package/lib/index.wechat.js +1 -0
  93. package/lib/types/index.d.ts +66 -3
  94. package/package.json +5 -5
@@ -1,4 +1,4 @@
1
1
  import * as React from 'react';
2
- import { PickerViewProps } from './props';
3
- declare const Picker: React.FC<PickerViewProps>;
4
- export default Picker;
2
+ import { PickerViewColumnProps } from './props';
3
+ declare const PickerViewColumn: React.FC<PickerViewColumnProps>;
4
+ export default PickerViewColumn;
@@ -1,72 +1,22 @@
1
- import { PickerView as _PickerView } from "@remax/wechat/esm/hostComponents/PickerView/index";
2
1
  import _extends from "@babel/runtime/helpers/esm/extends";
3
- import { PickerViewColumn as _PickerViewColumn } from "@remax/wechat/esm/hostComponents/PickerViewColumn/index";
4
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
5
- var _excluded = ["className", "style", "id", "onChange", "range"];
6
- import "core-js/modules/es.array.map.js";
3
+ var _excluded = ["className", "style", "id"];
7
4
  import clsx from 'clsx';
8
5
  import * as React from 'react';
9
6
  import { inlineStyle } from '@ray-js/framework-shared';
10
- import { View } from '@ray-js/components';
11
- import styles from './index.module.less';
7
+ import { PickerViewColumn as RemaxPickerViewColumn } from '@ray-js/remax-tuya';
12
8
 
13
- var Picker = function (props) {
9
+ var PickerViewColumn = function (props) {
14
10
  var className = props.className,
15
11
  style = props.style,
16
12
  id = props.id,
17
- onChange = props.onChange,
18
- range = props.range,
19
13
  restProps = _objectWithoutProperties(props, _excluded);
20
14
 
21
- var countArray = function (array) {
22
- var countArr = 1;
23
-
24
- var multiarr = function (arr) {
25
- for (var i = 0; i < arr.length; i++) {
26
- if (arr[i] instanceof Array) {
27
- countArr++;
28
- arr = arr[i];
29
- multiarr(arr);
30
- }
31
- }
32
-
33
- return countArr;
34
- };
35
-
36
- return multiarr(array);
37
- };
38
-
39
- return /*#__PURE__*/React.createElement(_PickerView, _extends({
40
- onChange: function handleChange(e) {
41
- onChange === null || onChange === void 0 ? void 0 : onChange({
42
- type: 'change',
43
- value: e.detail.value,
44
- origin: e
45
- });
46
- },
15
+ return /*#__PURE__*/React.createElement(RemaxPickerViewColumn, _extends({
16
+ id: id,
47
17
  style: inlineStyle(style),
48
- className: clsx(styles.pickerViewWrp, className)
49
- }, restProps), function renderPickerColumn() {
50
- if (countArray(props.range) > 1) {
51
- return props.range.map(function (item, index) {
52
- return /*#__PURE__*/React.createElement(_PickerViewColumn, {
53
- key: index
54
- }, item.map(function (i, id) {
55
- return /*#__PURE__*/React.createElement(View, {
56
- key: id,
57
- className: styles.pcWrp
58
- }, i);
59
- }));
60
- });
61
- } else {
62
- return /*#__PURE__*/React.createElement(_PickerViewColumn, null, range.map(function (item, index) {
63
- return /*#__PURE__*/React.createElement(View, {
64
- key: index,
65
- className: styles.pcWrp
66
- }, item);
67
- }));
68
- }
69
- }());
18
+ className: clsx('ray-picker-view-column', className)
19
+ }, restProps));
70
20
  };
71
21
 
72
- export default Picker;
22
+ export default PickerViewColumn;
@@ -8,14 +8,16 @@ group:
8
8
 
9
9
  # PickerViewColumn
10
10
 
11
- 滚动选择器子项。需要配合 `<PickerView />` 使用, 仅可放置于 PickerView 中,其高度会自动设置成与 PickerView 的选中框的高度一致(仅支持 web)
11
+ 滚动选择器子项。需要配合 `<PickerView />` 使用, 仅可放置于 PickerView 中,其高度会自动设置成与 PickerView 的选中框的高度一致。
12
12
 
13
13
  ## 示例代码
14
14
 
15
- 请参考 PickerView 组件
16
-
17
15
  ## 导入
18
16
 
19
17
  ```js
20
18
  import { PickerViewColumn } from '@ray-js/components'
21
19
  ```
20
+
21
+ ## 代码演示
22
+
23
+ <code src="./demos/basicChildren.tsx" title="单选 - 子节点" background="#f2f4f6" />
@@ -1,16 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { BaseProps } from '../types';
3
- import { TouchEventHandler } from '@ray-js/framework-shared';
2
+ import { BaseProps, TouchEventHandler } from '../types';
4
3
  export interface PickerViewColumnProps extends BaseProps, TouchEventHandler {
5
4
  children?: React.ReactNode | string;
6
5
  }
7
- export interface PickerViewProps extends BaseProps {
8
- value?: number | number[];
9
- fontSize?: number;
10
- range?: string[] | string[][];
11
- onChange?: (e: {
12
- type: 'change';
13
- value: number | number[];
14
- origin?: any;
15
- }) => void;
16
- }
@@ -4,6 +4,7 @@ nav:
4
4
  path: /components
5
5
  group:
6
6
  title: 视图容器
7
+ hide: true
7
8
  ---
8
9
 
9
10
  # RadialGradient
@@ -13,7 +14,7 @@ RadialGradient 为径向渐变,与线性渐变相似,只是它是从一个
13
14
  ## 导入
14
15
 
15
16
  ```js
16
- import { RadialGradient } from '@ray-js/components';
17
+ import { RadialGradient } from '@ray-js/components'
17
18
  ```
18
19
 
19
20
  ## 示例代码
@@ -5,7 +5,17 @@ interface StopsProps {
5
5
  stopColor: string;
6
6
  }
7
7
  export interface RadialGradientProps extends BaseProps {
8
+ /**
9
+ * @description.en width
10
+ * @description.zh 宽度
11
+ * @default undefined
12
+ */
8
13
  width: number;
14
+ /**
15
+ * @description.en height
16
+ * @description.zh 高度
17
+ * @default undefined
18
+ */
9
19
  height: number;
10
20
  /**
11
21
  * @description.zh 最外侧圆的x轴坐标点
@@ -1,7 +1,27 @@
1
1
  import { BaseProps, TouchEventHandler } from '../types';
2
2
  export interface RadioProps extends BaseProps, TouchEventHandler {
3
+ /**
4
+ * @description.en Radio id. When the radio is selected, the radio.group change event carries the value of the radio
5
+ * @description.zh radio 标识。当该 radio 选中时,Radio.Group 的 change 事件会携带 radio 的 value
6
+ * @default undefined
7
+ */
3
8
  value?: string;
9
+ /**
10
+ * @description.en Whether it is currently selected can be set to default
11
+ * @description.zh 当前是否选中,可用来设置默认选中
12
+ * @default false
13
+ */
4
14
  checked?: boolean;
15
+ /**
16
+ * @description.en disabled
17
+ * @description.zh 是否禁用
18
+ * @default false
19
+ */
5
20
  disabled?: boolean;
21
+ /**
22
+ * @description.en color
23
+ * @description.zh 颜色
24
+ * @default '#007AFF'
25
+ */
6
26
  color?: string;
7
27
  }
@@ -10,13 +10,16 @@ var RadioGroup = function (props) {
10
10
  name = props.name,
11
11
  disabled = props.disabled,
12
12
  _props$onChange = props.onChange,
13
- onChange = _props$onChange === void 0 ? function () {} : _props$onChange;
13
+ onChange = _props$onChange === void 0 ? function () {} : _props$onChange,
14
+ children = props.children;
14
15
  return /*#__PURE__*/React.createElement(RemaxRadioGroup, {
15
16
  name: name,
16
17
  onChange: function handleOnChange(e) {
17
18
  !disabled && onChange(e);
18
19
  }
19
- }, function renderOptions() {
20
+ }, function renderChildren() {
21
+ return children;
22
+ }() || function renderOptions() {
20
23
  return options.map(function (item, index) {
21
24
  var _item$checked;
22
25
 
@@ -10,13 +10,16 @@ var RadioGroup = function (props) {
10
10
  name = props.name,
11
11
  disabled = props.disabled,
12
12
  _props$onChange = props.onChange,
13
- onChange = _props$onChange === void 0 ? function () {} : _props$onChange;
13
+ onChange = _props$onChange === void 0 ? function () {} : _props$onChange,
14
+ children = props.children;
14
15
  return /*#__PURE__*/React.createElement(_RadioGroup, {
15
16
  name: name,
16
17
  onChange: function handleOnChange(e) {
17
18
  !disabled && onChange(e);
18
19
  }
19
- }, function renderOptions() {
20
+ }, function renderChildren() {
21
+ return children;
22
+ }() || function renderOptions() {
20
23
  return options.map(function (item, index) {
21
24
  var _item$checked;
22
25
 
@@ -19,7 +19,7 @@ import { RadioGroup } from '@ray-js/components'
19
19
  ## 示例代码
20
20
 
21
21
  <code src="./demos/group.tsx" title="一组数据 - 选项" background="#f2f4f6" height="500px" />
22
- <code src="./demos/groupChildren.tsx" title="一组数据 - 子节点(仅支持web端)" background="#f2f4f6" height="500px" />
22
+ <code src="./demos/groupChildren.tsx" title="一组数据 - 子节点" background="#f2f4f6" height="500px" />
23
23
  <code src="./demos/groupDisabled.tsx" title="全部禁止" background="#f2f4f6" height="500px" />
24
24
 
25
25
  ## Props
@@ -1,16 +1,44 @@
1
- /// <reference types="react" />
2
1
  import { BaseProps, TouchEventHandler } from '../types';
3
2
  import { RadioProps } from '../Radio/props';
4
3
  export declare type RadioGroupOption = RadioProps & {
5
4
  label: string;
6
5
  };
7
6
  export interface RadioGroupProps extends BaseProps, TouchEventHandler {
8
- options?: RadioGroupOption[];
7
+ /**
8
+ * @description.en options
9
+ * @description.zh 组项
10
+ * @default undefined
11
+ */
12
+ options: RadioGroupOption[];
13
+ /**
14
+ * @description.en name
15
+ * @description.zh 姓名
16
+ * @default undefined
17
+ */
9
18
  name?: string;
19
+ /**
20
+ * @description.en disabled
21
+ * @description.zh 是否禁用
22
+ * @default false
23
+ */
10
24
  disabled?: boolean;
25
+ /**
26
+ * @description.en onChange
27
+ * @description.zh 选中项发生改变时触发 change 事件
28
+ * @default undefined
29
+ */
11
30
  onChange?: (event: {
31
+ /**
32
+ * @description.en type
33
+ * @description.zh 类型
34
+ * @default undefined
35
+ */
12
36
  type: 'change';
37
+ /**
38
+ * @description.en value
39
+ * @description.zh 价值
40
+ * @default undefined
41
+ */
13
42
  value: string[];
14
43
  }) => void;
15
- children?: React.ReactNode;
16
44
  }
@@ -3,23 +3,78 @@ import { NativeScrollEvent, NativeSyntheticEvent } from 'react-native';
3
3
  import { GenericEvent as WxScrollEvent } from '@remax/wechat';
4
4
  export interface ScrollViewProps extends BaseProps {
5
5
  /** (default: false) 允许横向滚动 1.0.0 */
6
+ /**
7
+ * @description.en Allow horizontal scrolling
8
+ * @description.zh 允许横向滚动
9
+ * @default false
10
+ */
6
11
  scrollX?: boolean;
7
12
  /** (default: false) 允许纵向滚动 1.0.0 */
13
+ /**
14
+ * @description.en Allow longitudinal roll
15
+ * @description.zh 允许纵向滚动
16
+ * @default false
17
+ */
8
18
  scrollY?: boolean;
9
19
  /** 设置竖向滚动条位置 1.0.0 */
20
+ /**
21
+ * @description.en Sets the vertical scroll bar position
22
+ * @description.zh 设置竖向滚动条位置
23
+ * @default undefined
24
+ */
10
25
  scrollTop?: number;
11
26
  /** 设置横向滚动条位置 1.0.0 */
27
+ /**
28
+ * @description.en Sets the horizontal scroll bar position
29
+ * @description.zh 设置横向滚动条位置
30
+ * @default undefined
31
+ */
12
32
  scrollLeft?: number;
13
- /** (default: 50) 距顶部/左边多远时,触发 onScrollToUpper 事件 1.0.0 */
33
+ /** (default: 50) */
34
+ /**
35
+ * @description.en How far from the top/left is the on Scroll To Upper event 1.0.0 triggered
36
+ * @description.zh 距顶部/左边多远时,触发 onScrollToUpper 事件 1.0.0
37
+ * @default 50
38
+ */
14
39
  upperThreshold?: number;
15
40
  /** (default: 50) 距底部/右边多远时,触发 onScrollToLower 事件 1.0.0 */
41
+ /**
42
+ * @description.en The on Scroll To Lower event 1.0.0 is triggered when it is far from the bottom/right
43
+ * @description.zh 距底部/右边多远时,触发 onScrollToLower 事件 1.0.0
44
+ * @default 50
45
+ */
16
46
  lowerThreshold?: number;
17
47
  /** (default: false) 在设置滚动条位置时使用动画过渡 1.0.0 */
48
+ /**
49
+ * @description.en Animate transition 1.0.0 when setting the scrollbar position
50
+ * @description.zh 在设置滚动条位置时使用动画过渡 1.0.0
51
+ * @default false
52
+ */
18
53
  scrollWithAnimation?: boolean;
19
54
  /** 滚动时触发,event.detail = {scrollLeft, scrollTop, scrollHeight, scrollWidth, deltaX, deltaY} 1.0.0 */
55
+ /**
56
+ * @description.en onScroll
57
+ * @description.zh 滚动时触发
58
+ * @default undefined
59
+ */
20
60
  onScroll?: (event: {
61
+ /**
62
+ * @description.en type
63
+ * @description.zh 类型
64
+ * @default undefined
65
+ */
21
66
  type: 'scroll';
67
+ /**
68
+ * @description.en Horizontal scroll bar position
69
+ * @description.zh 横向滚动条位置
70
+ * @default undefined
71
+ */
22
72
  scrollLeft: number;
73
+ /**
74
+ * @description.en Vertical scroll bar position
75
+ * @description.zh 竖向滚动条位置
76
+ * @default undefined
77
+ */
23
78
  scrollTop: number;
24
79
  scrollHeight: number;
25
80
  scrollWidth: number;
@@ -27,14 +82,32 @@ export interface ScrollViewProps extends BaseProps {
27
82
  deltaY: number;
28
83
  origin: NativeSyntheticEvent<NativeScrollEvent> | WxScrollEvent;
29
84
  }) => any;
30
- /** 滚动到顶部/左边时触发 1.0.0 */
85
+ /**
86
+ * @description.en Trigger 1.0.0 when scrolling to the top/left
87
+ * @description.zh 滚动到顶部/左边时触发 1.0.0
88
+ * @default undefined
89
+ */
31
90
  onScrollToUpper?: (event: {
91
+ /**
92
+ * @description.en type
93
+ * @description.zh 类型
94
+ * @default undefined
95
+ */
32
96
  type: 'scrolltoupper';
33
97
  direction: 'top' | 'left';
34
98
  origin: NativeSyntheticEvent<NativeScrollEvent> | WxScrollEvent | Event;
35
99
  }) => any;
36
- /** 滚动到底部/右边时触发 1.0.0 */
100
+ /**
101
+ * @description.en Triggered when scrolling to the bottom/right
102
+ * @description.zh 滚动到底部/右边时触发
103
+ * @default undefined
104
+ */
37
105
  onScrollToLower?: (event: {
106
+ /**
107
+ * @description.en type
108
+ * @description.zh 类型
109
+ * @default undefined
110
+ */
38
111
  type: 'scrolltolower';
39
112
  direction: 'bottom' | 'right';
40
113
  origin: NativeSyntheticEvent<NativeScrollEvent> | WxScrollEvent | Event;
@@ -1,22 +1,102 @@
1
1
  import { BaseProps } from '../types';
2
2
  export interface SliderProps extends BaseProps {
3
+ /**
4
+ * @description.en min
5
+ * @description.zh 最小值
6
+ * @default 0
7
+ */
3
8
  min?: number;
9
+ /**
10
+ * @description.en max
11
+ * @description.zh 最大值
12
+ * @default 100
13
+ */
4
14
  max?: number;
15
+ /**
16
+ * @description.en The value must be greater than 0 and divisible by (max-min)
17
+ * @description.zh 步长,取值必须大于 0,并且可被(max - min)整除
18
+ * @default 1
19
+ */
5
20
  step?: number;
21
+ /**
22
+ * @description.en disabled
23
+ * @description.zh 是否禁用
24
+ * @default false
25
+ */
6
26
  disabled?: boolean;
27
+ /**
28
+ * @description.en value
29
+ * @description.zh 当前取值
30
+ * @default 0
31
+ */
7
32
  value?: number;
33
+ /**
34
+ * @description.en activeColor
35
+ * @description.zh 已选择的颜色
36
+ * @default #007aff
37
+ */
8
38
  activeColor?: string;
39
+ /**
40
+ * @description.en backgroundColor
41
+ * @description.zh 背景条的颜色
42
+ * @default rgba(0,0,0,.2)
43
+ */
9
44
  backgroundColor?: string;
45
+ /**
46
+ * @description.en blockSize
47
+ * @description.zh 滑块的大小,取值范围为 12 - 28
48
+ * @default 28
49
+ */
10
50
  blockSize?: number;
51
+ /**
52
+ * @description.en blockColor
53
+ * @description.zh 滑块的颜色
54
+ * @default #ffffff
55
+ */
11
56
  blockColor?: string;
57
+ /**
58
+ * @description.en showValue
59
+ * @description.zh 是否显示当前 value
60
+ * @default false
61
+ */
12
62
  showValue?: boolean;
63
+ /**
64
+ * @description.en onChange
65
+ * @description.zh 完成一次拖动后触发的事件,event.detail = {value}
66
+ * @default undefined
67
+ */
13
68
  onChange?: (event: {
69
+ /**
70
+ * @description.en type
71
+ * @description.zh 类型
72
+ * @default undefined
73
+ */
14
74
  type: string;
75
+ /**
76
+ * @description.en value
77
+ * @description.zh value
78
+ * @default undefined
79
+ */
15
80
  value: number;
16
81
  origin: any;
17
82
  }) => void;
83
+ /**
84
+ * @description.en onChanging
85
+ * @description.zh 拖动过程中触发的事件,event.detail = {value}
86
+ * @default undefined
87
+ */
18
88
  onChanging?: (event: {
89
+ /**
90
+ * @description.en type
91
+ * @description.zh 类型
92
+ * @default undefined
93
+ */
19
94
  type: string;
95
+ /**
96
+ * @description.en value
97
+ * @description.zh 价值
98
+ * @default undefined
99
+ */
20
100
  value: number;
21
101
  origin: any;
22
102
  }) => void;
@@ -1,7 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
4
- var _excluded = ["id", "style", "className", "current", "dataSource", "onAfterChange", "onChange", "renderItem"];
4
+ var _excluded = ["id", "style", "className", "current", "dataSource", "onAfterChange", "onChange", "renderItem", "children"];
5
5
  import "core-js/modules/es.array.map.js";
6
6
  // import clsx from 'clsx';
7
7
  import * as React from 'react';
@@ -18,6 +18,7 @@ function Swiper(props) {
18
18
  onAfterChange = props.onAfterChange,
19
19
  onChange = props.onChange,
20
20
  renderItem = props.renderItem,
21
+ children = props.children,
21
22
  restProps = _objectWithoutProperties(props, _excluded);
22
23
 
23
24
  var _React$useState = React.useState(current),
@@ -56,12 +57,16 @@ function Swiper(props) {
56
57
  // @ts-ignore
57
58
  React.createElement("ty-swiper", _extends({
58
59
  ref: currentNode
59
- }, handleProps(restProps)), dataSource.map(function (item, index) {
60
- // @ts-ignore
61
- return /*#__PURE__*/React.createElement("ty-swiper-item", {
62
- key: index
63
- }, renderItem(item, index));
64
- }))
60
+ }, handleProps(restProps)), function renderChildren() {
61
+ return children;
62
+ }() || function renderSwiperItem() {
63
+ return dataSource.map(function (item, index) {
64
+ // @ts-ignore
65
+ return /*#__PURE__*/React.createElement("ty-swiper-item", {
66
+ key: index
67
+ }, renderItem(item, index));
68
+ });
69
+ }())
65
70
  );
66
71
  }
67
72
 
@@ -1,7 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
4
- var _excluded = ["id", "style", "className", "current", "dataSource", "onAfterChange", "onChange", "renderItem"];
4
+ var _excluded = ["id", "style", "className", "current", "dataSource", "onAfterChange", "onChange", "renderItem", "children"];
5
5
  import "core-js/modules/es.array.map.js";
6
6
  import clsx from 'clsx';
7
7
  import * as React from 'react';
@@ -19,6 +19,7 @@ function Swiper(props) {
19
19
  onAfterChange = props.onAfterChange,
20
20
  onChange = props.onChange,
21
21
  renderItem = props.renderItem,
22
+ children = props.children,
22
23
  restProps = _objectWithoutProperties(props, _excluded);
23
24
 
24
25
  var _React$useState = React.useState(current),
@@ -44,11 +45,15 @@ function Swiper(props) {
44
45
  onAfterChange === null || onAfterChange === void 0 ? void 0 : onAfterChange(event);
45
46
  },
46
47
  current: internalCurrent
47
- }, propsAlias(restProps, SwiperPropsAlias)), dataSource.map(function (item, index) {
48
- return /*#__PURE__*/React.createElement(RemaxSwiperItem, {
49
- key: index
50
- }, renderItem(item, index));
51
- }));
48
+ }, propsAlias(restProps, SwiperPropsAlias)), function () {
49
+ return children;
50
+ }() || function () {
51
+ return dataSource.map(function (item, index) {
52
+ return /*#__PURE__*/React.createElement(RemaxSwiperItem, {
53
+ key: index
54
+ }, renderItem(item, index));
55
+ });
56
+ }());
52
57
  }
53
58
 
54
59
  Swiper.defaultProps = defaultSwiperProps;
@@ -1,7 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
4
- var _excluded = ["id", "style", "className", "current", "dataSource", "onAfterChange", "onChange", "renderItem"];
4
+ var _excluded = ["id", "style", "className", "current", "dataSource", "onAfterChange", "onChange", "renderItem", "children"];
5
5
  import "core-js/modules/es.array.map.js";
6
6
  // import clsx from 'clsx';
7
7
  import * as React from 'react';
@@ -18,6 +18,7 @@ function Swiper(props) {
18
18
  onAfterChange = props.onAfterChange,
19
19
  onChange = props.onChange,
20
20
  renderItem = props.renderItem,
21
+ children = props.children,
21
22
  restProps = _objectWithoutProperties(props, _excluded);
22
23
 
23
24
  var _React$useState = React.useState(current),
@@ -56,12 +57,16 @@ function Swiper(props) {
56
57
  // @ts-ignore
57
58
  React.createElement("ty-swiper", _extends({
58
59
  ref: currentNode
59
- }, handleProps(restProps)), dataSource.map(function (item, index) {
60
- // @ts-ignore
61
- return /*#__PURE__*/React.createElement("ty-swiper-item", {
62
- key: index
63
- }, renderItem(item, index));
64
- }))
60
+ }, handleProps(restProps)), function renderChildren() {
61
+ return children;
62
+ }() || function renderSwiperItem() {
63
+ return dataSource.map(function (item, index) {
64
+ // @ts-ignore
65
+ return /*#__PURE__*/React.createElement("ty-swiper-item", {
66
+ key: index
67
+ }, renderItem(item, index));
68
+ });
69
+ }())
65
70
  );
66
71
  }
67
72
 
@@ -3,7 +3,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
3
3
  import { SwiperItem as _SwiperItem } from "@remax/wechat/esm/hostComponents/SwiperItem/index";
4
4
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
5
5
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
6
- var _excluded = ["id", "style", "className", "current", "dataSource", "onAfterChange", "onChange", "renderItem"];
6
+ var _excluded = ["id", "style", "className", "current", "dataSource", "onAfterChange", "onChange", "renderItem", "children"];
7
7
  import "core-js/modules/es.array.map.js";
8
8
  import clsx from 'clsx';
9
9
  import * as React from 'react';
@@ -20,6 +20,7 @@ function Swiper(props) {
20
20
  onAfterChange = props.onAfterChange,
21
21
  onChange = props.onChange,
22
22
  renderItem = props.renderItem,
23
+ children = props.children,
23
24
  restProps = _objectWithoutProperties(props, _excluded);
24
25
 
25
26
  var _React$useState = React.useState(current),
@@ -45,11 +46,15 @@ function Swiper(props) {
45
46
  onAfterChange === null || onAfterChange === void 0 ? void 0 : onAfterChange(event);
46
47
  },
47
48
  current: internalCurrent
48
- }, propsAlias(restProps, SwiperPropsAlias)), dataSource.map(function (item, index) {
49
- return /*#__PURE__*/React.createElement(_SwiperItem, {
50
- key: index
51
- }, renderItem(item, index));
52
- }));
49
+ }, propsAlias(restProps, SwiperPropsAlias)), function () {
50
+ return children;
51
+ }() || function () {
52
+ return dataSource.map(function (item, index) {
53
+ return /*#__PURE__*/React.createElement(_SwiperItem, {
54
+ key: index
55
+ }, renderItem(item, index));
56
+ });
57
+ }());
53
58
  }
54
59
 
55
60
  Swiper.defaultProps = defaultSwiperProps;