@ray-js/components 0.5.8-beta-1 → 0.5.9
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.
- package/lib/Button/{Button.thing.d.ts → Button.tuya.d.ts} +0 -0
- package/lib/Button/{Button.thing.js → Button.tuya.js} +1 -1
- package/lib/Checkbox/{Checkbox.thing.d.ts → Checkbox.tuya.d.ts} +0 -0
- package/lib/Checkbox/{Checkbox.thing.js → Checkbox.tuya.js} +1 -1
- package/lib/CheckboxGroup/{CheckboxGroup.thing.d.ts → CheckboxGroup.tuya.d.ts} +0 -0
- package/lib/CheckboxGroup/{CheckboxGroup.thing.js → CheckboxGroup.tuya.js} +1 -1
- package/lib/CoverView/{CoverView.thing.d.ts → CoverView.tuya.d.ts} +0 -0
- package/lib/CoverView/{CoverView.thing.js → CoverView.tuya.js} +1 -1
- package/lib/DatePicker/{DatePicker.thing.d.ts → DatePicker.tuya.d.ts} +0 -0
- package/lib/DatePicker/{DatePicker.thing.js → DatePicker.tuya.js} +1 -1
- package/lib/Form/{Form.native.d.ts → Form.tuya.d.ts} +0 -0
- package/lib/Form/{Form.thing.js → Form.tuya.js} +1 -1
- package/lib/Icon/{Icon.thing.d.ts → Icon.tuya.d.ts} +0 -0
- package/lib/Icon/{Icon.thing.js → Icon.tuya.js} +0 -0
- package/lib/Image/{Image.thing.d.ts → Image.tuya.d.ts} +0 -0
- package/lib/Image/{Image.thing.js → Image.tuya.js} +1 -1
- package/lib/Input/{Input.thing.d.ts → Input.tuya.d.ts} +0 -0
- package/lib/Input/{Input.thing.js → Input.tuya.js} +1 -1
- package/lib/IpcPlayer/{IpcPlayer.thing.d.ts → IpcPlayer.tuya.d.ts} +0 -0
- package/lib/IpcPlayer/{IpcPlayer.thing.js → IpcPlayer.tuya.js} +1 -1
- package/lib/IpcPlayer/props.d.ts +1 -1
- package/lib/Label/{Label.thing.d.ts → Label.tuya.d.ts} +0 -0
- package/lib/Label/{Label.thing.js → Label.tuya.js} +1 -1
- package/lib/LinearGradient/{LinearGradient.thing.d.ts → LinearGradient.tuya.d.ts} +0 -0
- package/lib/LinearGradient/{LinearGradient.thing.js → LinearGradient.tuya.js} +0 -0
- package/lib/Modal/{Modal.thing.d.ts → Modal.tuya.d.ts} +0 -0
- package/lib/Modal/{Modal.thing.js → Modal.tuya.js} +0 -0
- package/lib/Motion/Fade/{index.thing.d.ts → index.tuya.d.ts} +0 -0
- package/lib/Motion/Fade/{index.thing.js → index.tuya.js} +0 -0
- package/lib/Motion/PullUp/{index.thing.d.ts → index.tuya.d.ts} +0 -0
- package/lib/Motion/PullUp/{index.thing.js → index.tuya.js} +0 -0
- package/lib/Motion/PushDown/{index.thing.d.ts → index.tuya.d.ts} +0 -0
- package/lib/Motion/PushDown/{index.thing.js → index.tuya.js} +0 -0
- package/lib/Motion/ScaleFadeIn/{index.thing.d.ts → index.tuya.d.ts} +0 -0
- package/lib/Motion/ScaleFadeIn/{index.thing.js → index.tuya.js} +0 -0
- package/lib/Motion/ScalePullDown/{index.thing.d.ts → index.tuya.d.ts} +0 -0
- package/lib/Motion/ScalePullDown/{index.thing.js → index.tuya.js} +0 -0
- package/lib/PageContainer/{PageContainer.thing.d.ts → PageContainer.tuya.d.ts} +0 -0
- package/lib/PageContainer/{PageContainer.thing.js → PageContainer.tuya.js} +1 -1
- package/lib/PageContainer/props.d.ts +1 -1
- package/lib/Picker/{Picker.thing.d.ts → Picker.tuya.d.ts} +0 -0
- package/lib/Picker/{Picker.thing.js → Picker.tuya.js} +1 -1
- package/lib/PickerView/{PickerView.thing.d.ts → PickerView.tuya.d.ts} +0 -0
- package/lib/PickerView/{PickerView.thing.js → PickerView.tuya.js} +1 -1
- package/lib/PickerViewColumn/{PickerViewColumn.thing.d.ts → PickerViewColumn.tuya.d.ts} +0 -0
- package/lib/PickerViewColumn/{PickerViewColumn.thing.js → PickerViewColumn.tuya.js} +1 -1
- package/lib/PickerViewColumn/PickerViewColumn.wechat.js +1 -1
- package/lib/RadialGradient/{RadialGradient.thing.d.ts → RadialGradient.tuya.d.ts} +0 -0
- package/lib/RadialGradient/{RadialGradient.thing.js → RadialGradient.tuya.js} +0 -0
- package/lib/Radio/{Radio.thing.d.ts → Radio.tuya.d.ts} +0 -0
- package/lib/Radio/{Radio.thing.js → Radio.tuya.js} +1 -1
- package/lib/RadioGroup/{RadioGroup.thing.d.ts → RadioGroup.tuya.d.ts} +0 -0
- package/lib/RadioGroup/{RadioGroup.thing.js → RadioGroup.tuya.js} +1 -1
- package/lib/ScrollView/{ScrollView.thing.d.ts → ScrollView.tuya.d.ts} +0 -0
- package/lib/ScrollView/{ScrollView.thing.js → ScrollView.tuya.js} +1 -1
- package/lib/Slider/{Slider.thing.d.ts → Slider.tuya.d.ts} +0 -0
- package/lib/Slider/{Slider.thing.js → Slider.tuya.js} +1 -1
- package/lib/Swiper/{Swiper.thing.d.ts → Swiper.tuya.d.ts} +0 -0
- package/lib/Swiper/{Swiper.thing.js → Swiper.tuya.js} +1 -1
- package/lib/SwiperItem/{SwiperItem.thing.d.ts → SwiperItem.tuya.d.ts} +0 -0
- package/lib/SwiperItem/{SwiperItem.thing.js → SwiperItem.tuya.js} +1 -1
- package/lib/SwiperItem/SwiperItem.wechat.js +1 -1
- package/lib/Switch/{Switch.thing.d.ts → Switch.tuya.d.ts} +0 -0
- package/lib/Switch/{Switch.thing.js → Switch.tuya.js} +1 -1
- package/lib/Text/{Text.thing.d.ts → Text.tuya.d.ts} +0 -0
- package/lib/Text/{Text.thing.js → Text.tuya.js} +1 -1
- package/lib/Textarea/{Textarea.thing.d.ts → Textarea.tuya.d.ts} +0 -0
- package/lib/Textarea/{Textarea.thing.js → Textarea.tuya.js} +1 -1
- package/lib/TimePicker/{TimePicker.thing.d.ts → TimePicker.tuya.d.ts} +0 -0
- package/lib/TimePicker/{TimePicker.thing.js → TimePicker.tuya.js} +1 -1
- package/lib/View/{View.thing.d.ts → View.tuya.d.ts} +0 -0
- package/lib/View/{View.thing.js → View.tuya.js} +1 -1
- package/lib/utils/index.d.ts +1 -2
- package/package.json +5 -5
- package/lib/Button/Button.native.d.ts +0 -29
- package/lib/Button/Button.native.js +0 -229
- package/lib/Checkbox/Checkbox.native.d.ts +0 -28
- package/lib/Checkbox/Checkbox.native.js +0 -118
- package/lib/CheckboxGroup/CheckboxGroup.native.d.ts +0 -18
- package/lib/CheckboxGroup/CheckboxGroup.native.js +0 -99
- package/lib/ClickableSimplified/index.native.d.ts +0 -42
- package/lib/ClickableSimplified/index.native.js +0 -166
- package/lib/DatePicker/DatePicker.native.d.ts +0 -34
- package/lib/DatePicker/DatePicker.native.js +0 -449
- package/lib/Form/Form.native.js +0 -8
- package/lib/Form/Form.thing.d.ts +0 -4
- package/lib/Icon/Icon.native.d.ts +0 -15
- package/lib/Icon/Icon.native.js +0 -48
- package/lib/Image/Image.native.d.ts +0 -28
- package/lib/Image/Image.native.js +0 -219
- package/lib/Input/Input.native.d.ts +0 -32
- package/lib/Input/Input.native.js +0 -212
- package/lib/Label/Label.native.d.ts +0 -4
- package/lib/Label/Label.native.js +0 -29
- package/lib/LinearGradient/LinearGradient.native.d.ts +0 -16
- package/lib/LinearGradient/LinearGradient.native.js +0 -60
- package/lib/Modal/Modal.native.d.ts +0 -24
- package/lib/Modal/Modal.native.js +0 -98
- package/lib/Motion/Fade/index.native.d.ts +0 -2
- package/lib/Motion/Fade/index.native.js +0 -3
- package/lib/Motion/PullUp/index.native.d.ts +0 -2
- package/lib/Motion/PullUp/index.native.js +0 -3
- package/lib/Motion/PushDown/index.native.d.ts +0 -2
- package/lib/Motion/PushDown/index.native.js +0 -3
- package/lib/Motion/ScaleFadeIn/index.native.d.ts +0 -2
- package/lib/Motion/ScaleFadeIn/index.native.js +0 -3
- package/lib/Motion/ScalePullDown/index.native.d.ts +0 -2
- package/lib/Motion/ScalePullDown/index.native.js +0 -3
- package/lib/Picker/Picker.native.d.ts +0 -22
- package/lib/Picker/Picker.native.js +0 -181
- package/lib/PickerView/PickerView.native.d.ts +0 -31
- package/lib/PickerView/PickerView.native.js +0 -175
- package/lib/PickerViewColumn/PickerViewColumn.native.d.ts +0 -31
- package/lib/PickerViewColumn/PickerViewColumn.native.js +0 -175
- package/lib/RadialGradient/RadialGradient.native.d.ts +0 -17
- package/lib/RadialGradient/RadialGradient.native.js +0 -52
- package/lib/Radio/Radio.native.d.ts +0 -30
- package/lib/Radio/Radio.native.js +0 -132
- package/lib/RadioGroup/RadioGroup.native.d.ts +0 -18
- package/lib/RadioGroup/RadioGroup.native.js +0 -99
- package/lib/ScrollView/ScrollView.native.d.ts +0 -57
- package/lib/ScrollView/ScrollView.native.js +0 -283
- package/lib/Slider/Slider.native.d.ts +0 -21
- package/lib/Slider/Slider.native.js +0 -114
- package/lib/Swiper/Swiper.native.d.ts +0 -6
- package/lib/Swiper/Swiper.native.js +0 -68
- package/lib/Switch/Switch.native.d.ts +0 -25
- package/lib/Switch/Switch.native.js +0 -128
- package/lib/Text/Text.native.d.ts +0 -8
- package/lib/Text/Text.native.js +0 -37
- package/lib/Textarea/Textarea.native.d.ts +0 -4
- package/lib/Textarea/Textarea.native.js +0 -26
- package/lib/TimePicker/TimePicker.native.d.ts +0 -39
- package/lib/TimePicker/TimePicker.native.js +0 -319
- package/lib/View/View.native.d.ts +0 -2
- package/lib/View/View.native.js +0 -35
@@ -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 {};
|
@@ -1,319 +0,0 @@
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
2
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
3
|
-
import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
|
4
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
5
|
-
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
6
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
7
|
-
import "core-js/modules/es.regexp.exec.js";
|
8
|
-
import "core-js/modules/es.string.split.js";
|
9
|
-
import "core-js/modules/es.number.constructor.js";
|
10
|
-
import "core-js/modules/es.array.index-of.js";
|
11
|
-
import "core-js/modules/es.array.concat.js";
|
12
|
-
import React from 'react';
|
13
|
-
import { View, Text, TouchableOpacity, StyleSheet, Platform } from 'react-native';
|
14
|
-
import { IDefaultTimePickerProps } from './props';
|
15
|
-
import Modal from '../Modal';
|
16
|
-
import PickerView from '../PickerView';
|
17
|
-
|
18
|
-
var TimerPicker = /*#__PURE__*/function (_React$Component) {
|
19
|
-
_inherits(TimerPicker, _React$Component);
|
20
|
-
|
21
|
-
var _super = _createSuper(TimerPicker);
|
22
|
-
|
23
|
-
function TimerPicker(props) {
|
24
|
-
var _this;
|
25
|
-
|
26
|
-
_classCallCheck(this, TimerPicker);
|
27
|
-
|
28
|
-
_this = _super.call(this, props);
|
29
|
-
|
30
|
-
_defineProperty(_assertThisInitialized(_this), "getTimeRange", function () {
|
31
|
-
var _this$props = _this.props,
|
32
|
-
start = _this$props.start,
|
33
|
-
end = _this$props.end;
|
34
|
-
var startArr = start.split(':');
|
35
|
-
var endArr = end.split(':');
|
36
|
-
var startHour = Number(startArr[0]);
|
37
|
-
var startMinute = Number(startArr[1]);
|
38
|
-
var endHour = Number(endArr[0]);
|
39
|
-
var endMinute = Number(endArr[1]);
|
40
|
-
return {
|
41
|
-
startHour: startHour,
|
42
|
-
startMinute: startMinute,
|
43
|
-
endHour: endHour,
|
44
|
-
endMinute: endMinute
|
45
|
-
};
|
46
|
-
});
|
47
|
-
|
48
|
-
_defineProperty(_assertThisInitialized(_this), "getRange", function (value) {
|
49
|
-
var rangeObj = {};
|
50
|
-
var range = [];
|
51
|
-
var valueArr = value.split(':');
|
52
|
-
var hour = valueArr[0];
|
53
|
-
var hourRange = [];
|
54
|
-
|
55
|
-
var _this$getTimeRange = _this.getTimeRange(),
|
56
|
-
startHour = _this$getTimeRange.startHour,
|
57
|
-
startMinute = _this$getTimeRange.startMinute,
|
58
|
-
endHour = _this$getTimeRange.endHour,
|
59
|
-
endMinute = _this$getTimeRange.endMinute;
|
60
|
-
|
61
|
-
for (var i = startHour; endMinute === 0 ? i < endHour : i <= endHour; i++) {
|
62
|
-
var minuteRange = [];
|
63
|
-
|
64
|
-
if (i === startHour) {
|
65
|
-
for (var j = startMinute; j <= 59; j++) {
|
66
|
-
minuteRange.push(_this.calculateValue(j));
|
67
|
-
}
|
68
|
-
} else if (i === endHour) {
|
69
|
-
for (var _j = 0; _j <= endMinute; _j++) {
|
70
|
-
minuteRange.push(_this.calculateValue(_j));
|
71
|
-
}
|
72
|
-
} else if (i < endHour && i > startHour) {
|
73
|
-
for (var _j2 = 0; _j2 <= 59; _j2++) {
|
74
|
-
minuteRange.push(_this.calculateValue(_j2));
|
75
|
-
}
|
76
|
-
}
|
77
|
-
|
78
|
-
hourRange.push(_this.calculateValue(i));
|
79
|
-
rangeObj[_this.calculateValue(i)] = minuteRange;
|
80
|
-
}
|
81
|
-
|
82
|
-
range.push(hourRange, rangeObj[hour]);
|
83
|
-
return {
|
84
|
-
range: range,
|
85
|
-
rangeObj: rangeObj
|
86
|
-
};
|
87
|
-
});
|
88
|
-
|
89
|
-
_defineProperty(_assertThisInitialized(_this), "calculateValue", function (value) {
|
90
|
-
if (value < 10) {
|
91
|
-
return "0".concat(value);
|
92
|
-
} else {
|
93
|
-
return "".concat(value);
|
94
|
-
}
|
95
|
-
});
|
96
|
-
|
97
|
-
_defineProperty(_assertThisInitialized(_this), "valueToIndex", function () {
|
98
|
-
var _this$state = _this.state,
|
99
|
-
changeValue = _this$state.changeValue,
|
100
|
-
range = _this$state.range;
|
101
|
-
var valueArr = changeValue.split(':');
|
102
|
-
var hour = valueArr[0];
|
103
|
-
var Minute = valueArr[1];
|
104
|
-
var hourIndex = range[0].indexOf(hour);
|
105
|
-
var minuteIndex = range[1].indexOf(Minute);
|
106
|
-
return [hourIndex, minuteIndex];
|
107
|
-
});
|
108
|
-
|
109
|
-
_defineProperty(_assertThisInitialized(_this), "_handleCancel", function () {
|
110
|
-
var onCancel = _this.props.onCancel;
|
111
|
-
var value = _this.state.value;
|
112
|
-
|
113
|
-
var _this$getRange = _this.getRange(value),
|
114
|
-
range = _this$getRange.range;
|
115
|
-
|
116
|
-
typeof onCancel === 'function' && onCancel({
|
117
|
-
type: 'cancel',
|
118
|
-
origin: null
|
119
|
-
});
|
120
|
-
|
121
|
-
_this.setState({
|
122
|
-
visible: false,
|
123
|
-
changeValue: value,
|
124
|
-
range: range
|
125
|
-
});
|
126
|
-
});
|
127
|
-
|
128
|
-
_defineProperty(_assertThisInitialized(_this), "_handleConfirm", function () {
|
129
|
-
var onChange = _this.props.onChange;
|
130
|
-
var changeValue = _this.state.changeValue;
|
131
|
-
typeof onChange === 'function' && onChange({
|
132
|
-
type: 'change',
|
133
|
-
value: changeValue,
|
134
|
-
origin: null
|
135
|
-
});
|
136
|
-
|
137
|
-
_this.setState({
|
138
|
-
visible: false
|
139
|
-
});
|
140
|
-
});
|
141
|
-
|
142
|
-
_defineProperty(_assertThisInitialized(_this), "_handlePickerChange", function (event, range) {
|
143
|
-
var value = event.value,
|
144
|
-
column = event.column; // 滑动之前的时间
|
145
|
-
|
146
|
-
var changeValue = _this.state.changeValue; // 初始时间 - 结束时间的对象{ hour: minute[]}
|
147
|
-
|
148
|
-
var _this$getRange2 = _this.getRange(changeValue),
|
149
|
-
rangeObj = _this$getRange2.rangeObj;
|
150
|
-
|
151
|
-
var valueArr = changeValue.split(':'); // 滑动操作前的小时
|
152
|
-
|
153
|
-
Number(valueArr[0]); // 滑动操作前的分钟
|
154
|
-
|
155
|
-
var beforeMinute = Number(valueArr[1]);
|
156
|
-
|
157
|
-
var _this$getTimeRange2 = _this.getTimeRange(),
|
158
|
-
startHour = _this$getTimeRange2.startHour,
|
159
|
-
startMinute = _this$getTimeRange2.startMinute,
|
160
|
-
endHour = _this$getTimeRange2.endHour,
|
161
|
-
endMinute = _this$getTimeRange2.endMinute; // 滑动后的小时(字符串)
|
162
|
-
|
163
|
-
|
164
|
-
var hourString = range[0][value[0]]; // 滑动后的小时(数字)
|
165
|
-
|
166
|
-
var hour = Number(hourString); // 滑动后的分钟(数字)
|
167
|
-
|
168
|
-
var minute; // 滑动的是小时轴(第一列)
|
169
|
-
|
170
|
-
if (column === 0) {
|
171
|
-
if (hour === startHour) {
|
172
|
-
// 分钟选择 Max[初始时间的分钟, 滑动前的分钟]
|
173
|
-
minute = Math.max(startMinute, beforeMinute);
|
174
|
-
} else if (hour === endHour) {
|
175
|
-
// 分钟选择 Min[结束时间的分钟, 滑动前的分钟]
|
176
|
-
minute = Math.min(endMinute, beforeMinute);
|
177
|
-
} else {
|
178
|
-
minute = beforeMinute;
|
179
|
-
}
|
180
|
-
} else {
|
181
|
-
// 滑动的是分钟轴(第二列)
|
182
|
-
// 滑动后小时对应的分钟数组
|
183
|
-
var minuteArr = rangeObj[range[0][value[0]]];
|
184
|
-
minute = Number(minuteArr[value[1]]);
|
185
|
-
}
|
186
|
-
|
187
|
-
var newValue = "".concat(_this.calculateValue(hour), ":").concat(_this.calculateValue(minute));
|
188
|
-
|
189
|
-
var _this$getRange3 = _this.getRange(newValue),
|
190
|
-
newRange = _this$getRange3.range;
|
191
|
-
|
192
|
-
_this.setState({
|
193
|
-
changeValue: newValue,
|
194
|
-
range: newRange
|
195
|
-
});
|
196
|
-
});
|
197
|
-
|
198
|
-
_defineProperty(_assertThisInitialized(_this), "renderTitleView", function () {
|
199
|
-
var _this$props2 = _this.props,
|
200
|
-
confirmText = _this$props2.confirmText,
|
201
|
-
cancelText = _this$props2.cancelText;
|
202
|
-
return /*#__PURE__*/React.createElement(View, {
|
203
|
-
style: styles.title
|
204
|
-
}, /*#__PURE__*/React.createElement(TouchableOpacity, {
|
205
|
-
style: styles.button,
|
206
|
-
activeOpacity: 0.8,
|
207
|
-
onPress: _this._handleCancel
|
208
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
209
|
-
style: styles.text
|
210
|
-
}, cancelText)), /*#__PURE__*/React.createElement(TouchableOpacity, {
|
211
|
-
style: styles.button,
|
212
|
-
activeOpacity: 0.8,
|
213
|
-
onPress: _this._handleConfirm
|
214
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
215
|
-
style: [styles.text, {
|
216
|
-
color: '#007AFF'
|
217
|
-
}]
|
218
|
-
}, confirmText)));
|
219
|
-
});
|
220
|
-
|
221
|
-
var _value = props.value || props.start;
|
222
|
-
|
223
|
-
var _this$getRange4 = _this.getRange(_value),
|
224
|
-
_range = _this$getRange4.range;
|
225
|
-
|
226
|
-
_this.state = {
|
227
|
-
visible: false,
|
228
|
-
value: _value,
|
229
|
-
changeValue: _value,
|
230
|
-
range: _range
|
231
|
-
};
|
232
|
-
return _this;
|
233
|
-
}
|
234
|
-
|
235
|
-
_createClass(TimerPicker, [{
|
236
|
-
key: "componentDidUpdate",
|
237
|
-
value: function componentDidUpdate(prevProps) {
|
238
|
-
var value = this.props.value;
|
239
|
-
|
240
|
-
if (value !== prevProps.value) {
|
241
|
-
var _this$getRange5 = this.getRange(value),
|
242
|
-
range = _this$getRange5.range;
|
243
|
-
|
244
|
-
this.setState({
|
245
|
-
value: value,
|
246
|
-
changeValue: value,
|
247
|
-
range: range
|
248
|
-
});
|
249
|
-
}
|
250
|
-
} // 获取开始时间 - 结束时间范围
|
251
|
-
|
252
|
-
}, {
|
253
|
-
key: "render",
|
254
|
-
value: function render() {
|
255
|
-
var _this2 = this;
|
256
|
-
|
257
|
-
var _this$props3 = this.props,
|
258
|
-
children = _this$props3.children,
|
259
|
-
disabled = _this$props3.disabled;
|
260
|
-
var _this$state2 = this.state,
|
261
|
-
visible = _this$state2.visible,
|
262
|
-
range = _this$state2.range;
|
263
|
-
var newValue = this.valueToIndex();
|
264
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(TouchableOpacity, {
|
265
|
-
onPress: function onPress() {
|
266
|
-
return _this2.setState({
|
267
|
-
visible: true
|
268
|
-
});
|
269
|
-
},
|
270
|
-
disabled: disabled,
|
271
|
-
activeOpacity: 0.8
|
272
|
-
}, children), /*#__PURE__*/React.createElement(Modal, {
|
273
|
-
show: visible,
|
274
|
-
position: 'bottom'
|
275
|
-
}, this.renderTitleView(), Platform.OS === 'android' && /*#__PURE__*/React.createElement(View, {
|
276
|
-
style: {
|
277
|
-
backgroundColor: '#fff',
|
278
|
-
height: 2
|
279
|
-
}
|
280
|
-
}), /*#__PURE__*/React.createElement(PickerView, {
|
281
|
-
range: range,
|
282
|
-
value: newValue,
|
283
|
-
style: {
|
284
|
-
backgroundColor: '#fff'
|
285
|
-
},
|
286
|
-
onChange: function onChange(e) {
|
287
|
-
return _this2._handlePickerChange(e, range);
|
288
|
-
}
|
289
|
-
})));
|
290
|
-
}
|
291
|
-
}]);
|
292
|
-
|
293
|
-
return TimerPicker;
|
294
|
-
}(React.Component);
|
295
|
-
|
296
|
-
_defineProperty(TimerPicker, "displayName", '_TimerPicker');
|
297
|
-
|
298
|
-
_defineProperty(TimerPicker, "defaultProps", IDefaultTimePickerProps);
|
299
|
-
|
300
|
-
export { TimerPicker as default };
|
301
|
-
var styles = StyleSheet.create({
|
302
|
-
button: {
|
303
|
-
height: 54,
|
304
|
-
width: 68,
|
305
|
-
alignItems: 'center',
|
306
|
-
justifyContent: 'center'
|
307
|
-
},
|
308
|
-
title: {
|
309
|
-
flexDirection: 'row',
|
310
|
-
justifyContent: 'space-between',
|
311
|
-
backgroundColor: '#fff',
|
312
|
-
borderBottomColor: 'rgba(0, 0, 0, 0.05)',
|
313
|
-
borderBottomWidth: StyleSheet.hairlineWidth
|
314
|
-
},
|
315
|
-
text: {
|
316
|
-
fontSize: 18,
|
317
|
-
color: '#333'
|
318
|
-
}
|
319
|
-
});
|
package/lib/View/View.native.js
DELETED
@@ -1,35 +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"];
|
5
|
-
import "core-js/modules/es.array.map.js";
|
6
|
-
import React from 'react';
|
7
|
-
import { View, Text } from 'react-native';
|
8
|
-
import ClickableSimplified from '../ClickableSimplified';
|
9
|
-
import { extracteTextStyle } from '../utils';
|
10
|
-
|
11
|
-
var stringToText = function (child, props) {
|
12
|
-
return typeof child === 'string' || typeof child === 'number' ? /*#__PURE__*/React.createElement(Text, props, child) : child;
|
13
|
-
};
|
14
|
-
|
15
|
-
var _View = function (props) {
|
16
|
-
var style = props.style,
|
17
|
-
rest = _objectWithoutProperties(props, _excluded);
|
18
|
-
|
19
|
-
var textStyle = extracteTextStyle(props.style);
|
20
|
-
var child = Array.isArray(props.children) ? props.children.map(function (c, i) {
|
21
|
-
return stringToText(c, _objectSpread(_objectSpread({
|
22
|
-
key: i
|
23
|
-
}, props), {}, {
|
24
|
-
style: textStyle
|
25
|
-
}));
|
26
|
-
}) : stringToText(props.children, _objectSpread(_objectSpread({}, props), {}, {
|
27
|
-
style: textStyle
|
28
|
-
}));
|
29
|
-
return /*#__PURE__*/React.createElement(View, _extends({}, rest, {
|
30
|
-
style: style
|
31
|
-
}), child);
|
32
|
-
};
|
33
|
-
|
34
|
-
_View.displayName = 'View';
|
35
|
-
export default ClickableSimplified(_View);
|