@ray-js/components 0.5.8-beta-1 → 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.
- package/lib/Button/Button.thing.js +0 -2
- package/lib/CheckboxGroup/CheckboxGroup.js +0 -1
- package/lib/CheckboxGroup/CheckboxGroup.thing.js +0 -1
- package/lib/CheckboxGroup/CheckboxGroup.wechat.js +0 -1
- package/lib/Icon/Icon.thing.js +0 -2
- package/lib/Input/Input.thing.js +0 -3
- package/lib/Input/Input.wechat.js +0 -1
- package/lib/RadioGroup/RadioGroup.thing.js +0 -1
- package/lib/RadioGroup/RadioGroup.wechat.js +0 -1
- package/lib/ScrollView/ScrollView.thing.js +0 -2
- package/lib/Swiper/Swiper.thing.d.ts +0 -3
- package/lib/Swiper/Swiper.thing.js +1 -2
- package/lib/Textarea/Textarea.thing.js +0 -1
- package/lib/Textarea/Textarea.wechat.js +0 -1
- package/lib/View/View.thing.js +0 -2
- package/lib/utils/handleProps.js +0 -1
- package/lib/utils/index.d.ts +1 -2
- package/package.json +4 -4
- 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.d.ts +0 -4
- package/lib/Form/Form.native.js +0 -8
- 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,449 +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.object.to-string.js";
|
8
|
-
import "core-js/modules/web.dom-collections.for-each.js";
|
9
|
-
import "core-js/modules/es.array.index-of.js";
|
10
|
-
import "core-js/modules/es.array.concat.js";
|
11
|
-
import "core-js/modules/es.number.constructor.js";
|
12
|
-
import React from 'react';
|
13
|
-
import { View, TouchableOpacity, Platform, Text, StyleSheet } from 'react-native';
|
14
|
-
import { defaultProps } from './props';
|
15
|
-
import Modal from '../Modal';
|
16
|
-
import PickerView from '../PickerView';
|
17
|
-
|
18
|
-
var DatePicker = /*#__PURE__*/function (_React$Component) {
|
19
|
-
_inherits(DatePicker, _React$Component);
|
20
|
-
|
21
|
-
var _super = _createSuper(DatePicker);
|
22
|
-
|
23
|
-
function DatePicker(props) {
|
24
|
-
var _this;
|
25
|
-
|
26
|
-
_classCallCheck(this, DatePicker);
|
27
|
-
|
28
|
-
_this = _super.call(this, props);
|
29
|
-
|
30
|
-
_defineProperty(_assertThisInitialized(_this), "format", function (time) {
|
31
|
-
var year = time.getFullYear(); //获取年份。
|
32
|
-
|
33
|
-
var month = time.getMonth() + 1; //获取月份。
|
34
|
-
|
35
|
-
var day = time.getDate(); //获取天
|
36
|
-
|
37
|
-
return {
|
38
|
-
year: year,
|
39
|
-
month: month,
|
40
|
-
day: day
|
41
|
-
};
|
42
|
-
});
|
43
|
-
|
44
|
-
_defineProperty(_assertThisInitialized(_this), "getDateListArr", function () {
|
45
|
-
var _this$props = _this.props,
|
46
|
-
start = _this$props.start,
|
47
|
-
end = _this$props.end; //获取开始时间和结束时间的时间戳
|
48
|
-
|
49
|
-
var startTime = new Date(start).getTime();
|
50
|
-
var endTime = new Date(end).getTime();
|
51
|
-
var dateArr = []; // 存放区间数据的数组
|
52
|
-
|
53
|
-
var stamp;
|
54
|
-
|
55
|
-
for (stamp = startTime; stamp <= endTime;) {
|
56
|
-
dateArr.push(_this.format(new Date(stamp)));
|
57
|
-
stamp += 24 * 60 * 60 * 1000;
|
58
|
-
} //此时的dateArr 格式为[{year: 2020, month: 10, day: 1},{year: 2020, month: 10, day: 2},....] 可以在这里打印下看看
|
59
|
-
|
60
|
-
|
61
|
-
var listArr = []; // 存放转换后的数组 把扁平化的数据转换为 层级结构的
|
62
|
-
|
63
|
-
dateArr.forEach(function (item, index) {
|
64
|
-
if (index === 0) {
|
65
|
-
listArr.push({
|
66
|
-
year: item.year,
|
67
|
-
monthArr: [{
|
68
|
-
yearItem: item.year,
|
69
|
-
month: item.month,
|
70
|
-
dayArr: [item.day]
|
71
|
-
}]
|
72
|
-
});
|
73
|
-
} else {
|
74
|
-
// 不是第一次,就需要两个数组对比如果有一样的就再对比
|
75
|
-
//some()函数 用于检测数组中的元素是否满足指定条件.
|
76
|
-
// 如果有一个元素满足条件,则表达式返回true , 剩余的元素不会再执行检测
|
77
|
-
var yearFlag = listArr.some(function (listItem) {
|
78
|
-
// 如果年份相等,就要循环月份数组
|
79
|
-
if (listItem.year == item.year) {
|
80
|
-
// 如果有一个元素满足条件,则表达式返回true , 剩余的元素不会再执行检测
|
81
|
-
var monthFlag = listItem.monthArr.some(function (monthItem) {
|
82
|
-
// 如果月份相等,就把天push进去,return true
|
83
|
-
if (monthItem.month == item.month) {
|
84
|
-
monthItem.dayArr.push(item.day);
|
85
|
-
return true;
|
86
|
-
}
|
87
|
-
}); // 如果月开关是fasle 就代表月份没有一样的 push就行了
|
88
|
-
|
89
|
-
if (!monthFlag) {
|
90
|
-
listItem.monthArr.push({
|
91
|
-
yearItem: item.year,
|
92
|
-
month: item.month,
|
93
|
-
dayArr: [item.day]
|
94
|
-
});
|
95
|
-
}
|
96
|
-
|
97
|
-
return true;
|
98
|
-
}
|
99
|
-
}); // 如果年开关是fasle 就代表年份没有一样的 push就行了
|
100
|
-
|
101
|
-
if (!yearFlag) {
|
102
|
-
// 如果年份不相等,年份数组push
|
103
|
-
listArr.push({
|
104
|
-
year: item.year,
|
105
|
-
monthArr: [{
|
106
|
-
yearItem: item.year,
|
107
|
-
month: item.month,
|
108
|
-
dayArr: [item.day]
|
109
|
-
}]
|
110
|
-
});
|
111
|
-
}
|
112
|
-
}
|
113
|
-
});
|
114
|
-
return listArr;
|
115
|
-
});
|
116
|
-
|
117
|
-
_defineProperty(_assertThisInitialized(_this), "getCurrentValue", function (value) {
|
118
|
-
var valueTime = new Date(value).getTime();
|
119
|
-
|
120
|
-
var _this$format = _this.format(new Date(valueTime)),
|
121
|
-
year = _this$format.year,
|
122
|
-
month = _this$format.month,
|
123
|
-
day = _this$format.day;
|
124
|
-
|
125
|
-
return {
|
126
|
-
currentYear: year,
|
127
|
-
currentMonth: month,
|
128
|
-
currentDay: day
|
129
|
-
};
|
130
|
-
});
|
131
|
-
|
132
|
-
_defineProperty(_assertThisInitialized(_this), "calculateValue", function (value) {
|
133
|
-
if (value < 10) {
|
134
|
-
return "0".concat(value);
|
135
|
-
} else {
|
136
|
-
return "".concat(value);
|
137
|
-
}
|
138
|
-
});
|
139
|
-
|
140
|
-
_defineProperty(_assertThisInitialized(_this), "getRangeAndValue", function (value) {
|
141
|
-
var fields = _this.props.fields;
|
142
|
-
|
143
|
-
var dateListArr = _this.getDateListArr();
|
144
|
-
|
145
|
-
var _this$getCurrentValue = _this.getCurrentValue(value),
|
146
|
-
currentYear = _this$getCurrentValue.currentYear,
|
147
|
-
currentMonth = _this$getCurrentValue.currentMonth,
|
148
|
-
currentDay = _this$getCurrentValue.currentDay;
|
149
|
-
|
150
|
-
var yearArr = [];
|
151
|
-
var monthArr = [];
|
152
|
-
var dayArr = [];
|
153
|
-
var range = [];
|
154
|
-
dateListArr.forEach(function (item) {
|
155
|
-
yearArr.push("".concat(item.year));
|
156
|
-
|
157
|
-
if (item.year === currentYear) {
|
158
|
-
item.monthArr.forEach(function (monthItem) {
|
159
|
-
monthArr.push(_this.calculateValue(monthItem.month));
|
160
|
-
|
161
|
-
if (monthItem.month === currentMonth) {
|
162
|
-
monthItem.dayArr.forEach(function (dayItem) {
|
163
|
-
dayArr.push(_this.calculateValue(dayItem));
|
164
|
-
});
|
165
|
-
}
|
166
|
-
});
|
167
|
-
}
|
168
|
-
});
|
169
|
-
|
170
|
-
switch (fields) {
|
171
|
-
case 'year':
|
172
|
-
range.push.apply(range, yearArr);
|
173
|
-
return {
|
174
|
-
range: range,
|
175
|
-
currentValue: yearArr.indexOf("".concat(currentYear)),
|
176
|
-
dateListArr: dateListArr
|
177
|
-
};
|
178
|
-
|
179
|
-
case 'month':
|
180
|
-
range.push(yearArr, monthArr);
|
181
|
-
return {
|
182
|
-
range: range,
|
183
|
-
currentValue: [yearArr.indexOf("".concat(currentYear)), monthArr.indexOf(_this.calculateValue(currentMonth))],
|
184
|
-
dateListArr: dateListArr
|
185
|
-
};
|
186
|
-
|
187
|
-
case 'day':
|
188
|
-
range.push(yearArr, monthArr, dayArr);
|
189
|
-
return {
|
190
|
-
range: range,
|
191
|
-
currentValue: [yearArr.indexOf("".concat(currentYear)), monthArr.indexOf(_this.calculateValue(currentMonth)), dayArr.indexOf(_this.calculateValue(currentDay))],
|
192
|
-
dateListArr: dateListArr
|
193
|
-
};
|
194
|
-
|
195
|
-
default:
|
196
|
-
return {
|
197
|
-
range: [],
|
198
|
-
currentValue: [],
|
199
|
-
dateListArr: dateListArr
|
200
|
-
};
|
201
|
-
}
|
202
|
-
});
|
203
|
-
|
204
|
-
_defineProperty(_assertThisInitialized(_this), "_handleCancel", function () {
|
205
|
-
var onCancel = _this.props.onCancel;
|
206
|
-
typeof onCancel === 'function' && onCancel({
|
207
|
-
type: 'cancel',
|
208
|
-
origin: null
|
209
|
-
});
|
210
|
-
|
211
|
-
_this.setState({
|
212
|
-
visible: false
|
213
|
-
});
|
214
|
-
});
|
215
|
-
|
216
|
-
_defineProperty(_assertThisInitialized(_this), "_handleConfirm", function () {
|
217
|
-
var _this$state = _this.state,
|
218
|
-
changeValue = _this$state.changeValue,
|
219
|
-
range = _this$state.range;
|
220
|
-
var _this$props2 = _this.props,
|
221
|
-
onChange = _this$props2.onChange,
|
222
|
-
fields = _this$props2.fields;
|
223
|
-
var result = '';
|
224
|
-
|
225
|
-
if (fields === 'day') {
|
226
|
-
result = range[0][changeValue[0]] + '-' + range[1][changeValue[1]] + '-' + range[2][changeValue[2]];
|
227
|
-
} else if (fields === 'month') {
|
228
|
-
result = range[0][changeValue[0]] + '-' + range[1][changeValue[1]];
|
229
|
-
} else {
|
230
|
-
result = range[changeValue];
|
231
|
-
}
|
232
|
-
|
233
|
-
console.log('result', result);
|
234
|
-
typeof onChange === 'function' && onChange({
|
235
|
-
type: 'change',
|
236
|
-
value: result,
|
237
|
-
origin: null
|
238
|
-
});
|
239
|
-
|
240
|
-
_this.setState({
|
241
|
-
visible: false,
|
242
|
-
value: changeValue
|
243
|
-
});
|
244
|
-
});
|
245
|
-
|
246
|
-
_defineProperty(_assertThisInitialized(_this), "_handlePickerChange", function (event) {
|
247
|
-
var value = event.value,
|
248
|
-
column = event.column;
|
249
|
-
var fields = _this.props.fields;
|
250
|
-
var range = _this.state.range;
|
251
|
-
|
252
|
-
if (fields === 'year') {
|
253
|
-
_this.setState({
|
254
|
-
changeValue: value
|
255
|
-
});
|
256
|
-
} else if (fields === 'month') {
|
257
|
-
var year = "".concat(range[0][value[0]]);
|
258
|
-
var month = "".concat(range[1][value[1]]);
|
259
|
-
var endYear = range[0][range[0].length - 1];
|
260
|
-
|
261
|
-
var _this$getRangeAndValu = _this.getRangeAndValue(year),
|
262
|
-
newRange = _this$getRangeAndValu.range;
|
263
|
-
|
264
|
-
var monthIndex = newRange[1].indexOf(month);
|
265
|
-
value[1] = monthIndex === -1 ? year === endYear ? newRange[1].length - 1 : 0 : monthIndex;
|
266
|
-
|
267
|
-
if (column === 0) {
|
268
|
-
_this.setState({
|
269
|
-
changeValue: value,
|
270
|
-
range: newRange
|
271
|
-
});
|
272
|
-
} else {
|
273
|
-
_this.setState({
|
274
|
-
changeValue: value,
|
275
|
-
range: newRange
|
276
|
-
});
|
277
|
-
}
|
278
|
-
} else {
|
279
|
-
var _year = "".concat(range[0][value[0]]);
|
280
|
-
|
281
|
-
var _month = "".concat(range[1][value[1]]);
|
282
|
-
|
283
|
-
var day = "".concat(range[2][value[2]]);
|
284
|
-
|
285
|
-
if (column === 0) {
|
286
|
-
var _this$getRangeAndValu2 = _this.getRangeAndValue("".concat(_year, "-").concat(_month, "-").concat(day)),
|
287
|
-
_newRange = _this$getRangeAndValu2.range;
|
288
|
-
|
289
|
-
var _monthIndex = _newRange[1].indexOf(_month);
|
290
|
-
|
291
|
-
var startMonth = _newRange[1][0];
|
292
|
-
value[1] = _monthIndex === -1 ? Number(_month) < Number(startMonth) ? 0 : _newRange[1].length - 1 : _monthIndex; // 订正月份
|
293
|
-
|
294
|
-
_month = "".concat(_newRange[1][value[1]]);
|
295
|
-
|
296
|
-
var _this$getRangeAndValu3 = _this.getRangeAndValue("".concat(_year, "-").concat(_month, "-").concat(day)),
|
297
|
-
modifiedRange = _this$getRangeAndValu3.range;
|
298
|
-
|
299
|
-
var dayIndex = modifiedRange[2].indexOf(day);
|
300
|
-
var startDay = modifiedRange[2][0];
|
301
|
-
value[2] = dayIndex === -1 ? Number(day) < Number(startDay) ? 0 : modifiedRange[2].length - 1 : dayIndex;
|
302
|
-
|
303
|
-
_this.setState({
|
304
|
-
changeValue: value,
|
305
|
-
range: modifiedRange
|
306
|
-
});
|
307
|
-
} else if (column === 1) {
|
308
|
-
var _this$getRangeAndValu4 = _this.getRangeAndValue("".concat(_year, "-").concat(_month)),
|
309
|
-
_newRange2 = _this$getRangeAndValu4.range;
|
310
|
-
|
311
|
-
var _dayIndex = _newRange2[2].indexOf(day);
|
312
|
-
|
313
|
-
var _startDay = _newRange2[2][0];
|
314
|
-
value[2] = _dayIndex === -1 ? Number(day) < Number(_startDay) ? 0 : _newRange2[2].length - 1 : _dayIndex;
|
315
|
-
|
316
|
-
_this.setState({
|
317
|
-
changeValue: value,
|
318
|
-
range: _newRange2
|
319
|
-
});
|
320
|
-
} else {
|
321
|
-
_this.setState({
|
322
|
-
changeValue: value
|
323
|
-
});
|
324
|
-
}
|
325
|
-
}
|
326
|
-
});
|
327
|
-
|
328
|
-
_defineProperty(_assertThisInitialized(_this), "renderTitleView", function () {
|
329
|
-
var _this$props3 = _this.props,
|
330
|
-
confirmText = _this$props3.confirmText,
|
331
|
-
cancelText = _this$props3.cancelText;
|
332
|
-
return /*#__PURE__*/React.createElement(View, {
|
333
|
-
style: styles.title
|
334
|
-
}, /*#__PURE__*/React.createElement(TouchableOpacity, {
|
335
|
-
style: styles.button,
|
336
|
-
activeOpacity: 0.8,
|
337
|
-
onPress: _this._handleCancel
|
338
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
339
|
-
style: styles.text
|
340
|
-
}, cancelText)), /*#__PURE__*/React.createElement(TouchableOpacity, {
|
341
|
-
style: styles.button,
|
342
|
-
activeOpacity: 0.8,
|
343
|
-
onPress: _this._handleConfirm
|
344
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
345
|
-
style: [styles.text, {
|
346
|
-
color: '#007AFF'
|
347
|
-
}]
|
348
|
-
}, confirmText)));
|
349
|
-
});
|
350
|
-
|
351
|
-
var _this$getRangeAndValu5 = _this.getRangeAndValue(props.value || props.start),
|
352
|
-
_range = _this$getRangeAndValu5.range,
|
353
|
-
currentValue = _this$getRangeAndValu5.currentValue,
|
354
|
-
_dateListArr = _this$getRangeAndValu5.dateListArr;
|
355
|
-
|
356
|
-
_this.state = {
|
357
|
-
visible: false,
|
358
|
-
value: currentValue,
|
359
|
-
changeValue: currentValue,
|
360
|
-
dateListArr: _dateListArr,
|
361
|
-
range: _range
|
362
|
-
};
|
363
|
-
return _this;
|
364
|
-
}
|
365
|
-
|
366
|
-
_createClass(DatePicker, [{
|
367
|
-
key: "componentDidUpdate",
|
368
|
-
value: function componentDidUpdate(prevProps) {
|
369
|
-
var _this$props4 = this.props,
|
370
|
-
value = _this$props4.value,
|
371
|
-
start = _this$props4.start;
|
372
|
-
|
373
|
-
var _this$getRangeAndValu6 = this.getRangeAndValue(value || start),
|
374
|
-
range = _this$getRangeAndValu6.range,
|
375
|
-
currentValue = _this$getRangeAndValu6.currentValue;
|
376
|
-
|
377
|
-
if (value !== prevProps.value) {
|
378
|
-
this.setState({
|
379
|
-
value: currentValue,
|
380
|
-
range: range
|
381
|
-
});
|
382
|
-
}
|
383
|
-
}
|
384
|
-
}, {
|
385
|
-
key: "render",
|
386
|
-
value: function render() {
|
387
|
-
var _this2 = this;
|
388
|
-
|
389
|
-
var _this$props5 = this.props,
|
390
|
-
children = _this$props5.children,
|
391
|
-
disabled = _this$props5.disabled;
|
392
|
-
var _this$state2 = this.state,
|
393
|
-
visible = _this$state2.visible,
|
394
|
-
value = _this$state2.value,
|
395
|
-
range = _this$state2.range;
|
396
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(TouchableOpacity, {
|
397
|
-
onPress: function onPress() {
|
398
|
-
return _this2.setState({
|
399
|
-
visible: true
|
400
|
-
});
|
401
|
-
},
|
402
|
-
disabled: disabled,
|
403
|
-
activeOpacity: 0.8
|
404
|
-
}, children), /*#__PURE__*/React.createElement(Modal, {
|
405
|
-
show: visible,
|
406
|
-
position: 'bottom'
|
407
|
-
}, this.renderTitleView(), Platform.OS === 'android' && /*#__PURE__*/React.createElement(View, {
|
408
|
-
style: {
|
409
|
-
backgroundColor: '#fff',
|
410
|
-
height: 2
|
411
|
-
}
|
412
|
-
}), /*#__PURE__*/React.createElement(PickerView, {
|
413
|
-
range: range,
|
414
|
-
value: value,
|
415
|
-
style: {
|
416
|
-
backgroundColor: '#fff'
|
417
|
-
},
|
418
|
-
onChange: this._handlePickerChange
|
419
|
-
})));
|
420
|
-
}
|
421
|
-
}]);
|
422
|
-
|
423
|
-
return DatePicker;
|
424
|
-
}(React.Component);
|
425
|
-
|
426
|
-
_defineProperty(DatePicker, "displayName", '_DatePicker');
|
427
|
-
|
428
|
-
_defineProperty(DatePicker, "defaultProps", defaultProps);
|
429
|
-
|
430
|
-
export { DatePicker as default };
|
431
|
-
var styles = StyleSheet.create({
|
432
|
-
button: {
|
433
|
-
height: 54,
|
434
|
-
width: 68,
|
435
|
-
alignItems: 'center',
|
436
|
-
justifyContent: 'center'
|
437
|
-
},
|
438
|
-
title: {
|
439
|
-
flexDirection: 'row',
|
440
|
-
justifyContent: 'space-between',
|
441
|
-
backgroundColor: '#fff',
|
442
|
-
borderBottomColor: 'rgba(0, 0, 0, 0.05)',
|
443
|
-
borderBottomWidth: StyleSheet.hairlineWidth
|
444
|
-
},
|
445
|
-
text: {
|
446
|
-
fontSize: 18,
|
447
|
-
color: '#333'
|
448
|
-
}
|
449
|
-
});
|
package/lib/Form/Form.native.js
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* ✔ type
|
3
|
-
* ✔ size
|
4
|
-
* ✔ color
|
5
|
-
*/
|
6
|
-
import React from 'react';
|
7
|
-
import { StyleProp, ViewStyle } from 'react-native';
|
8
|
-
export interface IconProps {
|
9
|
-
style?: StyleProp<ViewStyle>;
|
10
|
-
type: string;
|
11
|
-
size?: number;
|
12
|
-
color?: string;
|
13
|
-
}
|
14
|
-
declare const _Icon: React.FC<IconProps>;
|
15
|
-
export default _Icon;
|
package/lib/Icon/Icon.native.js
DELETED
@@ -1,48 +0,0 @@
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
2
|
-
|
3
|
-
/**
|
4
|
-
* ✔ type
|
5
|
-
* ✔ size
|
6
|
-
* ✔ color
|
7
|
-
*/
|
8
|
-
import React from 'react';
|
9
|
-
import { View, Image } from 'react-native';
|
10
|
-
import IconFont from 'tuya-panel-icon';
|
11
|
-
import { iconList } from '../assets/icons';
|
12
|
-
import iconJson from './iconfont-rn/iconfont.json';
|
13
|
-
|
14
|
-
var _Icon = function (props) {
|
15
|
-
var style = props.style,
|
16
|
-
_props$type = props.type,
|
17
|
-
type = _props$type === void 0 ? 'success_no_circle' : _props$type,
|
18
|
-
_props$size = props.size,
|
19
|
-
size = _props$size === void 0 ? 23 : _props$size,
|
20
|
-
color = props.color;
|
21
|
-
var iconColor = color;
|
22
|
-
|
23
|
-
if (iconJson[type]) {
|
24
|
-
return /*#__PURE__*/React.createElement(IconFont, _extends({}, props, {
|
25
|
-
d: iconJson[type],
|
26
|
-
size: size,
|
27
|
-
color: iconColor
|
28
|
-
}));
|
29
|
-
}
|
30
|
-
|
31
|
-
return /*#__PURE__*/React.createElement(View, {
|
32
|
-
style: [style, {
|
33
|
-
width: size,
|
34
|
-
height: size
|
35
|
-
}]
|
36
|
-
}, /*#__PURE__*/React.createElement(Image, {
|
37
|
-
source: iconList[type],
|
38
|
-
style: {
|
39
|
-
width: size,
|
40
|
-
height: size,
|
41
|
-
tintColor: iconColor
|
42
|
-
},
|
43
|
-
tintColor: iconColor
|
44
|
-
}));
|
45
|
-
};
|
46
|
-
|
47
|
-
_Icon.displayName = '_Icon';
|
48
|
-
export default _Icon;
|
@@ -1,28 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { LayoutChangeEvent, StyleProp, ImageStyle } from 'react-native';
|
3
|
-
import { ImageProps } from './props';
|
4
|
-
interface IProps extends Omit<ImageProps, 'mode' | 'style'> {
|
5
|
-
mode?: 'aspectFit' | 'aspectFill' | 'scaleToFill' | 'widthFix';
|
6
|
-
style?: StyleProp<ImageStyle>;
|
7
|
-
}
|
8
|
-
export interface ImageState {
|
9
|
-
ratio: number;
|
10
|
-
layoutWidth: number;
|
11
|
-
}
|
12
|
-
export declare class _Image extends React.Component<IProps, ImageState> {
|
13
|
-
static defaultProps: {
|
14
|
-
src: string;
|
15
|
-
mode: string;
|
16
|
-
};
|
17
|
-
state: ImageState;
|
18
|
-
hasLayout: boolean;
|
19
|
-
_onLoad: () => void;
|
20
|
-
_onError: () => void;
|
21
|
-
onLayout: (event: LayoutChangeEvent) => void;
|
22
|
-
loadImg: (props: IProps) => void;
|
23
|
-
componentDidMount(): void;
|
24
|
-
shouldComponentUpdate(nextProps: IProps): boolean;
|
25
|
-
componentDidUpdate(prevProps: IProps): void;
|
26
|
-
render(): JSX.Element;
|
27
|
-
}
|
28
|
-
export default _Image;
|