@ray-js/components 0.5.7-beta-2 → 0.5.9-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 (80) hide show
  1. package/lib/Button/Button.thing.js +0 -2
  2. package/lib/CheckboxGroup/CheckboxGroup.js +0 -1
  3. package/lib/CheckboxGroup/CheckboxGroup.thing.js +0 -1
  4. package/lib/CheckboxGroup/CheckboxGroup.wechat.js +0 -1
  5. package/lib/Icon/Icon.thing.js +0 -2
  6. package/lib/Input/Input.thing.js +0 -3
  7. package/lib/Input/Input.wechat.js +0 -1
  8. package/lib/RadioGroup/RadioGroup.thing.js +0 -1
  9. package/lib/RadioGroup/RadioGroup.wechat.js +0 -1
  10. package/lib/ScrollView/ScrollView.thing.js +0 -2
  11. package/lib/Swiper/Swiper.thing.d.ts +0 -3
  12. package/lib/Swiper/Swiper.thing.js +1 -2
  13. package/lib/Textarea/Textarea.thing.js +0 -1
  14. package/lib/Textarea/Textarea.wechat.js +0 -1
  15. package/lib/View/View.thing.js +0 -2
  16. package/lib/utils/handleProps.js +0 -1
  17. package/lib/utils/index.d.ts +1 -2
  18. package/package.json +4 -4
  19. package/lib/Button/Button.native.d.ts +0 -29
  20. package/lib/Button/Button.native.js +0 -229
  21. package/lib/Checkbox/Checkbox.native.d.ts +0 -28
  22. package/lib/Checkbox/Checkbox.native.js +0 -118
  23. package/lib/CheckboxGroup/CheckboxGroup.native.d.ts +0 -18
  24. package/lib/CheckboxGroup/CheckboxGroup.native.js +0 -99
  25. package/lib/ClickableSimplified/index.native.d.ts +0 -42
  26. package/lib/ClickableSimplified/index.native.js +0 -166
  27. package/lib/DatePicker/DatePicker.native.d.ts +0 -34
  28. package/lib/DatePicker/DatePicker.native.js +0 -449
  29. package/lib/Form/Form.native.d.ts +0 -4
  30. package/lib/Form/Form.native.js +0 -8
  31. package/lib/Icon/Icon.native.d.ts +0 -15
  32. package/lib/Icon/Icon.native.js +0 -48
  33. package/lib/Image/Image.native.d.ts +0 -28
  34. package/lib/Image/Image.native.js +0 -219
  35. package/lib/Input/Input.native.d.ts +0 -32
  36. package/lib/Input/Input.native.js +0 -212
  37. package/lib/Label/Label.native.d.ts +0 -4
  38. package/lib/Label/Label.native.js +0 -29
  39. package/lib/LinearGradient/LinearGradient.native.d.ts +0 -16
  40. package/lib/LinearGradient/LinearGradient.native.js +0 -60
  41. package/lib/Modal/Modal.native.d.ts +0 -24
  42. package/lib/Modal/Modal.native.js +0 -98
  43. package/lib/Motion/Fade/index.native.d.ts +0 -2
  44. package/lib/Motion/Fade/index.native.js +0 -3
  45. package/lib/Motion/PullUp/index.native.d.ts +0 -2
  46. package/lib/Motion/PullUp/index.native.js +0 -3
  47. package/lib/Motion/PushDown/index.native.d.ts +0 -2
  48. package/lib/Motion/PushDown/index.native.js +0 -3
  49. package/lib/Motion/ScaleFadeIn/index.native.d.ts +0 -2
  50. package/lib/Motion/ScaleFadeIn/index.native.js +0 -3
  51. package/lib/Motion/ScalePullDown/index.native.d.ts +0 -2
  52. package/lib/Motion/ScalePullDown/index.native.js +0 -3
  53. package/lib/Picker/Picker.native.d.ts +0 -22
  54. package/lib/Picker/Picker.native.js +0 -181
  55. package/lib/PickerView/PickerView.native.d.ts +0 -31
  56. package/lib/PickerView/PickerView.native.js +0 -175
  57. package/lib/PickerViewColumn/PickerViewColumn.native.d.ts +0 -31
  58. package/lib/PickerViewColumn/PickerViewColumn.native.js +0 -175
  59. package/lib/RadialGradient/RadialGradient.native.d.ts +0 -17
  60. package/lib/RadialGradient/RadialGradient.native.js +0 -52
  61. package/lib/Radio/Radio.native.d.ts +0 -30
  62. package/lib/Radio/Radio.native.js +0 -132
  63. package/lib/RadioGroup/RadioGroup.native.d.ts +0 -18
  64. package/lib/RadioGroup/RadioGroup.native.js +0 -99
  65. package/lib/ScrollView/ScrollView.native.d.ts +0 -57
  66. package/lib/ScrollView/ScrollView.native.js +0 -283
  67. package/lib/Slider/Slider.native.d.ts +0 -21
  68. package/lib/Slider/Slider.native.js +0 -114
  69. package/lib/Swiper/Swiper.native.d.ts +0 -6
  70. package/lib/Swiper/Swiper.native.js +0 -68
  71. package/lib/Switch/Switch.native.d.ts +0 -25
  72. package/lib/Switch/Switch.native.js +0 -128
  73. package/lib/Text/Text.native.d.ts +0 -8
  74. package/lib/Text/Text.native.js +0 -37
  75. package/lib/Textarea/Textarea.native.d.ts +0 -4
  76. package/lib/Textarea/Textarea.native.js +0 -26
  77. package/lib/TimePicker/TimePicker.native.d.ts +0 -39
  78. package/lib/TimePicker/TimePicker.native.js +0 -319
  79. package/lib/View/View.native.d.ts +0 -2
  80. package/lib/View/View.native.js +0 -35
@@ -1,114 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
- import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
4
- import _createClass from "@babel/runtime/helpers/esm/createClass";
5
- import _inherits from "@babel/runtime/helpers/esm/inherits";
6
- import _createSuper from "@babel/runtime/helpers/esm/createSuper";
7
- import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
8
- var _excluded = ["min", "max", "step", "backgroundColor", "activeColor", "blockSize", "blockColor", "onChange", "onChanging", "showValue"];
9
- import React from 'react';
10
- import { View, Text } from 'react-native';
11
- import SliderBase from 'tuya-panel-slider/lib/slider';
12
- import { sliderDefault } from './props';
13
-
14
- var Slider = /*#__PURE__*/function (_React$Component) {
15
- _inherits(Slider, _React$Component);
16
-
17
- var _super = _createSuper(Slider);
18
-
19
- function Slider(props) {
20
- var _this;
21
-
22
- _classCallCheck(this, Slider);
23
-
24
- _this = _super.call(this, props);
25
- _this.state = {
26
- currentValue: props.value
27
- };
28
- return _this;
29
- }
30
-
31
- _createClass(Slider, [{
32
- key: "componentDidUpdate",
33
- value: function componentDidUpdate(prevProps) {
34
- if (prevProps.value !== this.props.value) {
35
- this.setState({
36
- currentValue: this.props.value
37
- });
38
- }
39
- }
40
- }, {
41
- key: "render",
42
- value: function render() {
43
- var _this2 = this;
44
-
45
- var _this$props = this.props,
46
- min = _this$props.min,
47
- max = _this$props.max,
48
- step = _this$props.step,
49
- backgroundColor = _this$props.backgroundColor,
50
- activeColor = _this$props.activeColor,
51
- blockSize = _this$props.blockSize,
52
- blockColor = _this$props.blockColor,
53
- onChange = _this$props.onChange,
54
- onChanging = _this$props.onChanging,
55
- showValue = _this$props.showValue,
56
- rest = _objectWithoutProperties(_this$props, _excluded);
57
-
58
- return /*#__PURE__*/React.createElement(View, {
59
- style: {
60
- flexDirection: 'row',
61
- alignItems: 'center'
62
- }
63
- }, /*#__PURE__*/React.createElement(SliderBase, _extends({
64
- trackStyle: {
65
- width: 312,
66
- height: 4
67
- }
68
- }, rest, {
69
- minimumValue: min,
70
- maximumValue: max,
71
- stepValue: step,
72
- maximumTrackTintColor: backgroundColor,
73
- minimumTrackTintColor: activeColor,
74
- thumbTouchSize: {
75
- width: blockSize,
76
- height: blockSize
77
- },
78
- thumbTintColor: blockColor,
79
- onSlidingComplete: function onSlidingComplete(value) {
80
- _this2.setState({
81
- currentValue: value
82
- });
83
-
84
- typeof onChange === 'function' && onChange({
85
- type: 'change',
86
- value: value,
87
- origin: undefined
88
- });
89
- },
90
- onValueChange: function onValueChange(value) {
91
- _this2.setState({
92
- currentValue: value
93
- });
94
-
95
- typeof onChanging === 'function' && onChanging({
96
- type: 'changing',
97
- value: value,
98
- origin: undefined
99
- });
100
- }
101
- })), showValue && /*#__PURE__*/React.createElement(Text, {
102
- style: {
103
- marginLeft: 15
104
- }
105
- }, this.state.currentValue));
106
- }
107
- }]);
108
-
109
- return Slider;
110
- }(React.Component);
111
-
112
- _defineProperty(Slider, "defaultProps", sliderDefault);
113
-
114
- export { Slider as default };
@@ -1,6 +0,0 @@
1
- import { SwiperProps } from './props';
2
- declare const Swiper: {
3
- (props: any): JSX.Element | null;
4
- defaultProps: Partial<SwiperProps<any>>;
5
- };
6
- export default Swiper;
@@ -1,68 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
3
- import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
4
- var _excluded = ["style", "vertical", "circular", "autoplay", "current", "dotActiveColor", "dotColor", "dots", "interval", "dataSource", "renderItem", "onAfterChange", "onchange"],
5
- _excluded2 = ["width", "height"];
6
- import "core-js/modules/es.array.map.js";
7
- import React from 'react';
8
- import OriginSwiper from 'react-native-swiper';
9
- import { defaultSwiperProps } from './props';
10
-
11
- var Swiper = function (props) {
12
- var style = props.style,
13
- vertical = props.vertical,
14
- circular = props.circular,
15
- autoplay = props.autoplay,
16
- current = props.current,
17
- dotActiveColor = props.dotActiveColor,
18
- dotColor = props.dotColor,
19
- dots = props.dots,
20
- interval = props.interval,
21
- dataSource = props.dataSource,
22
- renderItem = props.renderItem,
23
- onAfterChange = props.onAfterChange,
24
- onchange = props.onchange,
25
- rest = _objectWithoutProperties(props, _excluded);
26
-
27
- var width = style.width,
28
- height = style.height,
29
- restStyle = _objectWithoutProperties(style, _excluded2);
30
-
31
- if (!dataSource || dataSource.length === 0 || !renderItem) return null;
32
- return /*#__PURE__*/React.createElement(OriginSwiper, _extends({}, rest, {
33
- style: _objectSpread({}, restStyle),
34
- width: width,
35
- height: height,
36
- showsButtons: false,
37
- horizontal: !vertical,
38
- loop: circular,
39
- autoplay: autoplay,
40
- index: current,
41
- activeDotColor: dotActiveColor,
42
- dotColor: dotColor,
43
- showsPagination: dots,
44
- autoplayTimeout: interval / 1000,
45
- onIndexChanged: function _handleIndexChange(index) {
46
- typeof onchange === 'function' && onchange({
47
- type: 'change',
48
- current: index,
49
- origin: null
50
- });
51
- },
52
- onMomentumScrollEnd: function _handleIndexChangeEnd(event, state) {
53
- var index = state.index;
54
- typeof onAfterChange === 'function' && onAfterChange({
55
- type: 'afterchange',
56
- current: index,
57
- origin: null
58
- });
59
- }
60
- }), dataSource.map(function (item, index) {
61
- if (renderItem) {
62
- return renderItem(item, index);
63
- }
64
- }));
65
- };
66
-
67
- Swiper.defaultProps = defaultSwiperProps;
68
- export default Swiper;
@@ -1,25 +0,0 @@
1
- import React from 'react';
2
- import { GestureResponderEvent } from 'react-native';
3
- import { SwitchProps } from './props';
4
- export interface ISwitchState {
5
- checked: boolean;
6
- }
7
- export default class _Switch extends React.Component<SwitchProps, ISwitchState> {
8
- static displayName: string;
9
- static defaultProps: {
10
- type: string;
11
- color: string;
12
- disabled: boolean;
13
- };
14
- $touchable: React.RefObject<any>;
15
- state: {
16
- checked: boolean;
17
- };
18
- _simulateNativePress: (evt: GestureResponderEvent) => void;
19
- onCheckedChange: (event: {
20
- value: string;
21
- checked: boolean;
22
- }) => void;
23
- onSwitchChange: (isChecked: boolean) => void;
24
- render(): JSX.Element;
25
- }
@@ -1,128 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
- import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
4
- import _createClass from "@babel/runtime/helpers/esm/createClass";
5
- import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
6
- import _inherits from "@babel/runtime/helpers/esm/inherits";
7
- import _createSuper from "@babel/runtime/helpers/esm/createSuper";
8
- import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
9
- var _excluded = ["style", "color", "disabled", "type"];
10
- import "core-js/modules/es.array.concat.js";
11
- import React from 'react';
12
- import Switch from 'tuya-panel-switch/lib/switch';
13
- import Checkbox from '../Checkbox';
14
- import { defaultSwitchProps } from './props';
15
-
16
- var _Switch = /*#__PURE__*/function (_React$Component) {
17
- _inherits(_Switch, _React$Component);
18
-
19
- var _super = _createSuper(_Switch);
20
-
21
- function _Switch() {
22
- var _this;
23
-
24
- _classCallCheck(this, _Switch);
25
-
26
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
27
- args[_key] = arguments[_key];
28
- }
29
-
30
- _this = _super.call.apply(_super, [this].concat(args));
31
-
32
- _defineProperty(_assertThisInitialized(_this), "$touchable", /*#__PURE__*/React.createRef());
33
-
34
- _defineProperty(_assertThisInitialized(_this), "state", {
35
- checked: !!_this.props.checked
36
- });
37
-
38
- _defineProperty(_assertThisInitialized(_this), "_simulateNativePress", function (evt) {
39
- var type = _this.props.type;
40
-
41
- if (type === 'checkbox') {
42
- var node = _this.$touchable.current;
43
- node && node._simulateNativePress(evt);
44
- } else {
45
- _this.setState({
46
- checked: !_this.state.checked
47
- });
48
- }
49
- });
50
-
51
- _defineProperty(_assertThisInitialized(_this), "onCheckedChange", function (event) {
52
- var checked = event.checked;
53
- var onChange = _this.props.onChange;
54
- typeof onChange === 'function' && onChange({
55
- type: 'change',
56
- value: checked
57
- });
58
-
59
- _this.setState({
60
- checked: checked
61
- });
62
- });
63
-
64
- _defineProperty(_assertThisInitialized(_this), "onSwitchChange", function (isChecked) {
65
- var onChange = _this.props.onChange;
66
- typeof onChange === 'function' && onChange({
67
- type: 'change',
68
- value: isChecked
69
- });
70
-
71
- _this.setState({
72
- checked: isChecked
73
- });
74
- });
75
-
76
- return _this;
77
- }
78
-
79
- _createClass(_Switch, [{
80
- key: "render",
81
- value: function render() {
82
- var _this$props = this.props,
83
- style = _this$props.style,
84
- color = _this$props.color,
85
- disabled = _this$props.disabled,
86
- type = _this$props.type,
87
- rest = _objectWithoutProperties(_this$props, _excluded);
88
-
89
- var checked = this.state.checked;
90
-
91
- if (type === 'checkbox') {
92
- return /*#__PURE__*/React.createElement(Checkbox, {
93
- checked: this.state.checked,
94
- style: style,
95
- disabled: disabled,
96
- onChange: this.onCheckedChange,
97
- ref: this.$touchable
98
- });
99
- }
100
-
101
- return /*#__PURE__*/React.createElement(Switch, _extends({
102
- size: {
103
- width: 50,
104
- height: 30,
105
- activeSize: 26,
106
- margin: 2
107
- },
108
- thumbTintColor: "#FFFFFF",
109
- tintColor: 'rgba(0,0,0,0.12)'
110
- }, rest, {
111
- value: checked,
112
- onValueChange: this.onSwitchChange,
113
- style: style,
114
- onTintColor: color,
115
- disabled: disabled,
116
- ref: this.$touchable
117
- }));
118
- }
119
- }]);
120
-
121
- return _Switch;
122
- }(React.Component);
123
-
124
- _defineProperty(_Switch, "displayName", 'Switch');
125
-
126
- _defineProperty(_Switch, "defaultProps", defaultSwitchProps);
127
-
128
- export { _Switch as default };
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- import { StyleProp, ViewStyle } from 'react-native';
3
- import { TextProps } from './props';
4
- export interface IProps extends Omit<TextProps, 'style'> {
5
- style?: StyleProp<ViewStyle>;
6
- }
7
- declare const _Text: React.FC<IProps>;
8
- export default _Text;
@@ -1,37 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
- import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
- var _excluded = ["selectable", "onClick", "style", "children"];
4
- import React from 'react';
5
- import { Text } from 'react-native';
6
-
7
- var _Text = function (props) {
8
- var selectable = props.selectable,
9
- onClick = props.onClick,
10
- style = props.style,
11
- children = props.children,
12
- rest = _objectWithoutProperties(props, _excluded);
13
-
14
- var clickProps = {
15
- onPress: undefined
16
- };
17
- if (onClick) clickProps.onPress = function onTextClick(event) {
18
- var nativeEvent = event.nativeEvent;
19
- var timestamp = nativeEvent.timestamp,
20
- pageX = nativeEvent.pageX,
21
- pageY = nativeEvent.pageY;
22
- typeof onClick === 'function' && onClick({
23
- type: 'click',
24
- timeStamp: timestamp,
25
- pageX: pageX,
26
- pageY: pageY,
27
- origin: event
28
- });
29
- };
30
- return /*#__PURE__*/React.createElement(Text, _extends({
31
- selectable: !!selectable,
32
- style: style
33
- }, rest, clickProps), children);
34
- };
35
-
36
- _Text.displayName = '_Text';
37
- export default _Text;
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import { TextareaProps } from './props';
3
- declare const _Textarea: React.FC<TextareaProps>;
4
- export default _Textarea;
@@ -1,26 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
- import React from 'react';
3
- import Input from '../Input';
4
- import { omit } from '../utils';
5
-
6
- var _Textarea = function (props) {
7
- var autoHeight = props.autoHeight,
8
- onLineChange = props.onLineChange,
9
- focus = props.focus,
10
- maxLength = props.maxLength;
11
- return /*#__PURE__*/React.createElement(Input, _extends({
12
- _multiline: true,
13
- _autoHeight: autoHeight,
14
- _onLineChange: function _handleLineChange(event) {
15
- // console
16
- typeof onLineChange === 'function' && onLineChange(event);
17
- },
18
- focus: !!focus,
19
- confirmType: "next"
20
- }, omit(props, ['type', 'password', 'confirmType', 'confirmHold', 'autoHeight', 'onLineChange', 'maxLength']), {
21
- maxLength: maxLength
22
- }));
23
- };
24
-
25
- _Textarea.displayName = '_Textarea';
26
- export default _Textarea;
@@ -1,39 +0,0 @@
1
- import React from 'react';
2
- import { TimePickerProps } from './props';
3
- interface IState {
4
- visible: boolean;
5
- value: string;
6
- changeValue: string;
7
- range: string[][];
8
- }
9
- export default class TimerPicker extends React.Component<TimePickerProps, IState> {
10
- static displayName: string;
11
- static defaultProps: {
12
- cancelText: string;
13
- confirmText: string;
14
- start: string;
15
- end: string;
16
- };
17
- constructor(props: TimePickerProps);
18
- componentDidUpdate(prevProps: Readonly<TimePickerProps>): void;
19
- getTimeRange: () => {
20
- startHour: number;
21
- startMinute: number;
22
- endHour: number;
23
- endMinute: number;
24
- };
25
- getRange: (value: string) => {
26
- range: string[][];
27
- rangeObj: {
28
- [key: string]: string[];
29
- };
30
- };
31
- calculateValue: (value: number) => string;
32
- valueToIndex: () => number[];
33
- _handleCancel: () => void;
34
- _handleConfirm: () => void;
35
- _handlePickerChange: (event: any, range: string[][]) => void;
36
- renderTitleView: () => JSX.Element;
37
- render(): JSX.Element;
38
- }
39
- export {};