@nutui/nutui-react-taro 1.3.2-beta.0 → 1.3.3-beta.0
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/CHANGELOG.md +18 -0
- package/dist/esm/ActionSheet/style/index.js +2 -2
- package/dist/esm/ActionSheet.js +2 -2
- package/dist/esm/Address/style/index.js +4 -4
- package/dist/esm/AnimatingNumbers/style/index.js +2 -2
- package/dist/esm/Audio/style/index.js +4 -4
- package/dist/esm/Avatar/style/index.js +2 -2
- package/dist/esm/AvatarGroup/style/index.js +1 -1
- package/dist/esm/BackTop/style/index.js +2 -2
- package/dist/esm/Badge/style/index.js +1 -1
- package/dist/esm/Barrage/style/index.js +1 -1
- package/dist/esm/Button/style/index.js +2 -2
- package/dist/esm/Calendar/style/index.js +2 -2
- package/dist/esm/CalendarItem/style/index.js +1 -1
- package/dist/esm/Card/style/index.js +3 -3
- package/dist/esm/Cascader/style/index.js +2 -2
- package/dist/esm/Cell/style/index.js +2 -2
- package/dist/esm/CellGroup/style/index.js +1 -1
- package/dist/esm/Checkbox/style/index.js +2 -2
- package/dist/esm/CheckboxGroup/style/index.js +1 -1
- package/dist/esm/CircleProgress/style/index.js +1 -1
- package/dist/esm/Col/style/index.js +1 -1
- package/dist/esm/Collapse/style/index.js +2 -2
- package/dist/esm/CollapseItem/style/index.js +2 -2
- package/dist/esm/ConfigProvider/style/index.js +1 -1
- package/dist/esm/CountDown/style/index.js +1 -1
- package/dist/esm/DatePicker/style/index.js +2 -2
- package/dist/esm/DatePicker.js +8 -5
- package/dist/esm/Dialog/style/index.js +2 -2
- package/dist/esm/Divider/style/index.js +1 -1
- package/dist/esm/Drag/style/index.js +1 -1
- package/dist/esm/Elevator/style/index.js +1 -1
- package/dist/esm/Empty/style/index.js +1 -1
- package/dist/esm/FixedNav/style/index.js +3 -3
- package/dist/esm/FixedNav.js +2 -2
- package/dist/esm/Grid/style/index.js +1 -1
- package/dist/esm/GridItem/style/index.js +1 -1
- package/dist/esm/Icon/style/index.js +2 -1
- package/dist/esm/ImagePreview/style/index.js +1 -1
- package/dist/esm/Indicator/style/index.js +1 -1
- package/dist/esm/Infiniteloading/style/index.js +2 -2
- package/dist/esm/Input/style/index.js +2 -2
- package/dist/esm/InputNumber/style/index.js +2 -2
- package/dist/esm/Layout/style/index.js +1 -1
- package/dist/esm/Menu/style/index.js +2 -2
- package/dist/esm/MenuItem/style/index.js +3 -3
- package/dist/esm/NavBar/style/index.js +1 -1
- package/dist/esm/NoticeBar/style/index.js +2 -2
- package/dist/esm/NoticeBar.js +2 -2
- package/dist/esm/Notify/style/index.js +1 -1
- package/dist/esm/NumberKeyboard/style/index.js +1 -1
- package/dist/esm/Overlay/style/index.js +1 -1
- package/dist/esm/Pagination/style/index.js +1 -1
- package/dist/esm/Picker/style/index.js +2 -2
- package/dist/esm/Picker.js +5 -4
- package/dist/esm/Popover/style/index.js +2 -2
- package/dist/esm/Popup/style/index.js +3 -3
- package/dist/esm/Price/style/index.js +1 -1
- package/dist/esm/Progress/style/index.js +2 -2
- package/dist/esm/PullToRefresh/style/index.js +1 -1
- package/dist/esm/Radio/style/index.js +2 -2
- package/dist/esm/RadioGroup/style/index.js +1 -1
- package/dist/esm/Range/style/index.js +2 -2
- package/dist/esm/Rate/style/index.js +2 -2
- package/dist/esm/Rate.js +3 -3
- package/dist/esm/Row/style/index.js +1 -1
- package/dist/esm/SearchBar/style/index.js +1 -1
- package/dist/esm/ShortPassword/style/index.js +3 -3
- package/dist/esm/SideNavBar/style/index.js +1 -1
- package/dist/esm/SideNavBarItem/style/index.js +1 -1
- package/dist/esm/Signature/style/index.js +2 -2
- package/dist/esm/Skeleton/style/index.js +1 -1
- package/dist/esm/Step/style/index.js +2 -2
- package/dist/esm/Steps/style/index.js +1 -1
- package/dist/esm/SubSideNavBar/style/index.js +1 -1
- package/dist/esm/Swipe/style/index.js +1 -1
- package/dist/esm/Swiper/style/index.js +1 -1
- package/dist/esm/SwiperItem/style/index.js +1 -1
- package/dist/esm/Switch/style/index.js +1 -1
- package/dist/esm/TabPane/style/index.js +1 -1
- package/dist/esm/Tabbar/style/index.js +1 -1
- package/dist/esm/TabbarItem/style/index.js +2 -2
- package/dist/esm/Table/style/index.js +1 -1
- package/dist/esm/Tabs/style/index.js +2 -2
- package/dist/esm/Tag/style/index.js +2 -2
- package/dist/esm/TextArea/style/index.js +1 -1
- package/dist/esm/TimeDetail/style/index.js +1 -1
- package/dist/esm/TimePannel/style/index.js +1 -1
- package/dist/esm/TimeSelect/style/index.js +3 -3
- package/dist/esm/Toast/style/index.js +2 -2
- package/dist/esm/Uploader/style/index.js +2 -2
- package/dist/esm/Video/style/index.js +1 -1
- package/dist/esm/VirtualList/style/index.js +1 -1
- package/dist/esm/{actionsheet.taro-1b3e7972.js → actionsheet.taro-9d4ce0c8.js} +3 -2
- package/dist/esm/datepicker.taro-318e9561.js +364 -0
- package/dist/esm/{fixednav.taro-6c0279ba.js → fixednav.taro-da09d1e7.js} +1 -8
- package/dist/esm/{noticebar.taro-f8bb6ae8.js → noticebar.taro-dcaf6497.js} +3 -5
- package/dist/esm/nutui-react.es.js +7 -8
- package/dist/esm/{picker.taro-6b663b69.js → picker.taro-62ce13e0.js} +14 -1
- package/dist/esm/{rate.taro-bb2e6c87.js → rate.taro-6b1cbe5f.js} +14 -18
- package/dist/locales/base.js +1 -1
- package/dist/locales/en-US.js +1 -1
- package/dist/locales/id-ID.js +1 -1
- package/dist/locales/zh-CN.js +1 -1
- package/dist/locales/zh-TW.js +1 -1
- package/dist/nutui.react.es.js +377 -1052
- package/dist/nutui.react.umd.js +378 -1053
- package/dist/packages/icon/icon.scss +0 -1
- package/dist/style.es.js +1 -1
- package/dist/types/picker/pickerSlot.taro.d.ts +1 -1
- package/dist/types/rate/rate.taro.d.ts +1 -1
- package/package.json +5 -3
- package/dist/esm/datepicker.taro-440e6da6.js +0 -923
- package/dist/esm/useRefs-032cf186.js +0 -313
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
|
|
2
|
+
import '../../../packages/timedetail/timedetail.scss'
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
|
|
2
|
+
import '../../../packages/timepannel/timepannel.scss'
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import '../../TimePannel/style'
|
|
2
|
+
import '../../TimeDetail/style'
|
|
3
|
+
import '../../../packages/timeselect/timeselect.scss'
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import '../../Icon/style'
|
|
2
|
+
import '../../../packages/toast/toast.scss'
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
import '../../Icon/style'
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import '../../../packages/uploader/uploader.scss'
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
|
|
2
|
+
import '../../../packages/video/video.scss'
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
|
|
2
|
+
import '../../../packages/virtuallist/virtuallist.scss'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["cancelTxt", "optionTag", "optionSubTag", "chooseTagValue", "title", "color", "description", "menuItems", "onCancel", "onChoose", "visible", "className", "style"];
|
|
3
|
+
var _excluded = ["children", "cancelTxt", "optionTag", "optionSubTag", "chooseTagValue", "title", "color", "description", "menuItems", "onCancel", "onChoose", "visible", "className", "style"];
|
|
4
4
|
|
|
5
5
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6
6
|
|
|
@@ -27,6 +27,7 @@ var defaultProps = {
|
|
|
27
27
|
|
|
28
28
|
var ActionSheet = function ActionSheet(props) {
|
|
29
29
|
var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),
|
|
30
|
+
children = _defaultProps$props.children,
|
|
30
31
|
cancelTxt = _defaultProps$props.cancelTxt,
|
|
31
32
|
optionTag = _defaultProps$props.optionTag,
|
|
32
33
|
optionSubTag = _defaultProps$props.optionSubTag,
|
|
@@ -87,7 +88,7 @@ var ActionSheet = function ActionSheet(props) {
|
|
|
87
88
|
}, item[optionTag], React__default.createElement("div", {
|
|
88
89
|
className: "subdesc"
|
|
89
90
|
}, item[optionSubTag]));
|
|
90
|
-
})) :
|
|
91
|
+
})) : children, cancelTxt && React__default.createElement("div", {
|
|
91
92
|
className: b('cancel'),
|
|
92
93
|
onClick: function onClick() {
|
|
93
94
|
return cancelActionSheet();
|
|
@@ -0,0 +1,364 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
5
|
+
var _excluded = ["minDate", "maxDate", "type", "isShowChinese", "minuteStep", "modelValue", "visible", "title", "formatter", "onCloseDatePicker", "onConfirmDatePicker", "filter", "threeDimensional", "className", "style"];
|
|
6
|
+
|
|
7
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8
|
+
|
|
9
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
10
|
+
|
|
11
|
+
import React__default, { useState, useRef, useEffect } from 'react';
|
|
12
|
+
import { P as Picker } from './picker.taro-62ce13e0.js';
|
|
13
|
+
var currentYear = new Date().getFullYear();
|
|
14
|
+
var defaultProps = {
|
|
15
|
+
modelValue: null,
|
|
16
|
+
visible: false,
|
|
17
|
+
title: '',
|
|
18
|
+
type: 'date',
|
|
19
|
+
isShowChinese: false,
|
|
20
|
+
threeDimensional: true,
|
|
21
|
+
minuteStep: 1,
|
|
22
|
+
minDate: new Date(currentYear - 10, 0, 1),
|
|
23
|
+
maxDate: new Date(currentYear + 10, 11, 31)
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
var DatePicker = function DatePicker(props) {
|
|
27
|
+
var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),
|
|
28
|
+
minDate = _defaultProps$props.minDate,
|
|
29
|
+
maxDate = _defaultProps$props.maxDate,
|
|
30
|
+
type = _defaultProps$props.type,
|
|
31
|
+
isShowChinese = _defaultProps$props.isShowChinese,
|
|
32
|
+
minuteStep = _defaultProps$props.minuteStep,
|
|
33
|
+
modelValue = _defaultProps$props.modelValue,
|
|
34
|
+
visible = _defaultProps$props.visible,
|
|
35
|
+
title = _defaultProps$props.title,
|
|
36
|
+
formatter = _defaultProps$props.formatter,
|
|
37
|
+
onCloseDatePicker = _defaultProps$props.onCloseDatePicker,
|
|
38
|
+
onConfirmDatePicker = _defaultProps$props.onConfirmDatePicker,
|
|
39
|
+
filter = _defaultProps$props.filter,
|
|
40
|
+
threeDimensional = _defaultProps$props.threeDimensional,
|
|
41
|
+
className = _defaultProps$props.className,
|
|
42
|
+
style = _defaultProps$props.style,
|
|
43
|
+
rest = _objectWithoutProperties(_defaultProps$props, _excluded);
|
|
44
|
+
|
|
45
|
+
var _useState = useState(false),
|
|
46
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
47
|
+
show = _useState2[0],
|
|
48
|
+
setShow = _useState2[1];
|
|
49
|
+
|
|
50
|
+
var _useState3 = useState(modelValue),
|
|
51
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
52
|
+
currentDate = _useState4[0],
|
|
53
|
+
setCurrentDate = _useState4[1];
|
|
54
|
+
|
|
55
|
+
var _useState5 = useState([]),
|
|
56
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
57
|
+
defaultValue = _useState6[0],
|
|
58
|
+
setDefaultValue = _useState6[1];
|
|
59
|
+
|
|
60
|
+
var _useState7 = useState([]),
|
|
61
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
62
|
+
listData = _useState8[0],
|
|
63
|
+
setListData = _useState8[1];
|
|
64
|
+
|
|
65
|
+
var pickerRef = useRef(null);
|
|
66
|
+
|
|
67
|
+
var isDate = function isDate(val) {
|
|
68
|
+
return Object.prototype.toString.call(val) === '[object Date]' && !Number.isNaN(val.getTime());
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
var zhCNType = {
|
|
72
|
+
day: '日',
|
|
73
|
+
year: '年',
|
|
74
|
+
month: '月',
|
|
75
|
+
hour: '时',
|
|
76
|
+
minute: '分',
|
|
77
|
+
seconds: '秒'
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
var formatValue = function formatValue(value) {
|
|
81
|
+
var cvalue = value;
|
|
82
|
+
|
|
83
|
+
if (!cvalue || cvalue && !isDate(cvalue)) {
|
|
84
|
+
cvalue = minDate;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
var timestmp = Math.max(cvalue.getTime(), minDate.getTime());
|
|
88
|
+
timestmp = Math.min(timestmp, maxDate.getTime());
|
|
89
|
+
return new Date(timestmp);
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
function getMonthEndDay(year, month) {
|
|
93
|
+
return new Date(year, month, 0).getDate();
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
var getBoundary = function getBoundary(type, value) {
|
|
97
|
+
var _ref;
|
|
98
|
+
|
|
99
|
+
var boundary = type === 'min' ? minDate : maxDate;
|
|
100
|
+
var year = boundary.getFullYear();
|
|
101
|
+
var month = 1;
|
|
102
|
+
var date = 1;
|
|
103
|
+
var hour = 0;
|
|
104
|
+
var minute = 0;
|
|
105
|
+
|
|
106
|
+
if (type === 'max') {
|
|
107
|
+
month = 12;
|
|
108
|
+
date = getMonthEndDay(value.getFullYear(), value.getMonth() + 1);
|
|
109
|
+
hour = 23;
|
|
110
|
+
minute = 59;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
var seconds = minute;
|
|
114
|
+
|
|
115
|
+
if (value.getFullYear() === year) {
|
|
116
|
+
month = boundary.getMonth() + 1;
|
|
117
|
+
|
|
118
|
+
if (value.getMonth() + 1 === month) {
|
|
119
|
+
date = boundary.getDate();
|
|
120
|
+
|
|
121
|
+
if (value.getDate() === date) {
|
|
122
|
+
hour = boundary.getHours();
|
|
123
|
+
|
|
124
|
+
if (value.getHours() === hour) {
|
|
125
|
+
minute = boundary.getMinutes();
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
return _ref = {}, _defineProperty(_ref, "".concat(type, "Year"), year), _defineProperty(_ref, "".concat(type, "Month"), month), _defineProperty(_ref, "".concat(type, "Date"), date), _defineProperty(_ref, "".concat(type, "Hour"), hour), _defineProperty(_ref, "".concat(type, "Minute"), minute), _defineProperty(_ref, "".concat(type, "Seconds"), seconds), _ref;
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
var ranges = function ranges(date) {
|
|
135
|
+
var curDate = date || currentDate;
|
|
136
|
+
console.log(11, currentDate);
|
|
137
|
+
if (!curDate) return [];
|
|
138
|
+
|
|
139
|
+
var _getBoundary = getBoundary('max', curDate),
|
|
140
|
+
maxYear = _getBoundary.maxYear,
|
|
141
|
+
maxDate = _getBoundary.maxDate,
|
|
142
|
+
maxMonth = _getBoundary.maxMonth,
|
|
143
|
+
maxHour = _getBoundary.maxHour,
|
|
144
|
+
maxMinute = _getBoundary.maxMinute,
|
|
145
|
+
maxSeconds = _getBoundary.maxSeconds;
|
|
146
|
+
|
|
147
|
+
var _getBoundary2 = getBoundary('min', curDate),
|
|
148
|
+
minYear = _getBoundary2.minYear,
|
|
149
|
+
minDate = _getBoundary2.minDate,
|
|
150
|
+
minMonth = _getBoundary2.minMonth,
|
|
151
|
+
minHour = _getBoundary2.minHour,
|
|
152
|
+
minMinute = _getBoundary2.minMinute,
|
|
153
|
+
minSeconds = _getBoundary2.minSeconds;
|
|
154
|
+
|
|
155
|
+
var result = [{
|
|
156
|
+
type: 'year',
|
|
157
|
+
range: [minYear, maxYear]
|
|
158
|
+
}, {
|
|
159
|
+
type: 'month',
|
|
160
|
+
range: [minMonth, maxMonth]
|
|
161
|
+
}, {
|
|
162
|
+
type: 'day',
|
|
163
|
+
range: [minDate, maxDate]
|
|
164
|
+
}, {
|
|
165
|
+
type: 'hour',
|
|
166
|
+
range: [minHour, maxHour]
|
|
167
|
+
}, {
|
|
168
|
+
type: 'minute',
|
|
169
|
+
range: [minMinute, maxMinute]
|
|
170
|
+
}, {
|
|
171
|
+
type: 'seconds',
|
|
172
|
+
range: [minSeconds, maxSeconds]
|
|
173
|
+
}];
|
|
174
|
+
|
|
175
|
+
switch (type.toLocaleLowerCase()) {
|
|
176
|
+
case 'date':
|
|
177
|
+
result = result.slice(0, 3);
|
|
178
|
+
break;
|
|
179
|
+
|
|
180
|
+
case 'datetime':
|
|
181
|
+
result = result.slice(0, 5);
|
|
182
|
+
break;
|
|
183
|
+
|
|
184
|
+
case 'time':
|
|
185
|
+
result = result.slice(3, 6);
|
|
186
|
+
break;
|
|
187
|
+
|
|
188
|
+
case 'year-month':
|
|
189
|
+
result = result.slice(0, 2);
|
|
190
|
+
break;
|
|
191
|
+
|
|
192
|
+
case 'month-day':
|
|
193
|
+
result = result.slice(1, 3);
|
|
194
|
+
break;
|
|
195
|
+
|
|
196
|
+
case 'datehour':
|
|
197
|
+
result = result.slice(0, 4);
|
|
198
|
+
break;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
return result;
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
var updateChooseValueCustmer = function updateChooseValueCustmer(index, selectedValue, cacheValueData) {
|
|
205
|
+
if (['date', 'datetime', 'datehour', 'month-day', 'year-month'].includes(type.toLocaleLowerCase())) {
|
|
206
|
+
var _date;
|
|
207
|
+
|
|
208
|
+
var formatDate = [];
|
|
209
|
+
selectedValue.forEach(function (item) {
|
|
210
|
+
formatDate.push(item);
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
if (type.toLocaleLowerCase() === 'month-day' && formatDate.length < 3) {
|
|
214
|
+
formatDate.unshift(new Date(modelValue || minDate || maxDate).getFullYear());
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
if (type.toLocaleLowerCase() === 'year-month' && formatDate.length < 3) {
|
|
218
|
+
formatDate.push(new Date(modelValue || minDate || maxDate).getDate());
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
var year = Number(formatDate[0]);
|
|
222
|
+
var month = Number(formatDate[1]) - 1;
|
|
223
|
+
var day = Math.min(Number(formatDate[2]), getMonthEndDay(Number(formatDate[0]), Number(formatDate[1])));
|
|
224
|
+
var date = null;
|
|
225
|
+
|
|
226
|
+
if (type.toLocaleLowerCase() === 'date' || type.toLocaleLowerCase() === 'month-day' || type.toLocaleLowerCase() === 'year-month') {
|
|
227
|
+
date = new Date(year, month, day);
|
|
228
|
+
} else if (type.toLocaleLowerCase() === 'datetime') {
|
|
229
|
+
date = new Date(year, month, day, Number(formatDate[3]), Number(formatDate[4]));
|
|
230
|
+
} else if (type.toLocaleLowerCase() === 'datehour') {
|
|
231
|
+
date = new Date(year, month, day, Number(formatDate[3]));
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
var isEqual = (currentDate === null || currentDate === void 0 ? void 0 : currentDate.getTime()) === ((_date = date) === null || _date === void 0 ? void 0 : _date.getTime());
|
|
235
|
+
date && isDate(date) && !isEqual && setCurrentDate(formatValue(date));
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
props.onChangeDatePicker && props.onChangeDatePicker(index, selectedValue, cacheValueData);
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
var padZero = function padZero(num) {
|
|
242
|
+
var targetLength = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
|
|
243
|
+
var str = "".concat(num);
|
|
244
|
+
|
|
245
|
+
while (str.length < targetLength) {
|
|
246
|
+
str = "0".concat(str);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
return str;
|
|
250
|
+
};
|
|
251
|
+
|
|
252
|
+
var formatterOption = function formatterOption(type, value) {
|
|
253
|
+
var fOption = null;
|
|
254
|
+
|
|
255
|
+
if (formatter) {
|
|
256
|
+
fOption = formatter(type, {
|
|
257
|
+
text: padZero(value, 2),
|
|
258
|
+
value: padZero(value, 2)
|
|
259
|
+
});
|
|
260
|
+
} else {
|
|
261
|
+
var padMin = padZero(value, 2);
|
|
262
|
+
var fatter = isShowChinese ? zhCNType[type] : '';
|
|
263
|
+
fOption = {
|
|
264
|
+
text: padMin + fatter,
|
|
265
|
+
value: padMin
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
return fOption;
|
|
270
|
+
};
|
|
271
|
+
|
|
272
|
+
var generateValue = function generateValue(min, max, val, type, columnIndex) {
|
|
273
|
+
var cmin = min;
|
|
274
|
+
var arr = [];
|
|
275
|
+
var index = 0;
|
|
276
|
+
|
|
277
|
+
while (cmin <= max) {
|
|
278
|
+
arr.push(formatterOption(type, cmin));
|
|
279
|
+
|
|
280
|
+
if (type === 'minute') {
|
|
281
|
+
cmin += minuteStep;
|
|
282
|
+
} else {
|
|
283
|
+
cmin++;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
if (cmin <= val) {
|
|
287
|
+
index++;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
defaultValue[columnIndex] = arr[index].value;
|
|
292
|
+
setDefaultValue(_toConsumableArray(defaultValue));
|
|
293
|
+
|
|
294
|
+
if (props.filter && props.filter(type, arr)) {
|
|
295
|
+
return props.filter(type, arr);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
return arr;
|
|
299
|
+
};
|
|
300
|
+
|
|
301
|
+
var getDateIndex = function getDateIndex(type) {
|
|
302
|
+
if (!currentDate) return 0;
|
|
303
|
+
var d = 0;
|
|
304
|
+
|
|
305
|
+
if (type === 'year') {
|
|
306
|
+
d = currentDate.getFullYear();
|
|
307
|
+
} else if (type === 'month') {
|
|
308
|
+
d = currentDate.getMonth() + 1;
|
|
309
|
+
} else if (type === 'day') {
|
|
310
|
+
d = currentDate.getDate();
|
|
311
|
+
} else if (type === 'hour') {
|
|
312
|
+
d = currentDate.getHours();
|
|
313
|
+
} else if (type === 'minute') {
|
|
314
|
+
d = currentDate.getMinutes();
|
|
315
|
+
} else if (type === 'seconds') {
|
|
316
|
+
d = currentDate.getSeconds();
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
return d;
|
|
320
|
+
};
|
|
321
|
+
|
|
322
|
+
var columns = function columns(date) {
|
|
323
|
+
var val = ranges(date).map(function (res, columnIndex) {
|
|
324
|
+
return generateValue(res.range[0], res.range[1], getDateIndex(res.type), res.type, columnIndex);
|
|
325
|
+
});
|
|
326
|
+
return val || [];
|
|
327
|
+
};
|
|
328
|
+
|
|
329
|
+
useEffect(function () {
|
|
330
|
+
setCurrentDate(formatValue(modelValue)); // initDefault()
|
|
331
|
+
}, []);
|
|
332
|
+
useEffect(function () {
|
|
333
|
+
setCurrentDate(formatValue(modelValue));
|
|
334
|
+
}, [modelValue]);
|
|
335
|
+
useEffect(function () {
|
|
336
|
+
setShow(visible);
|
|
337
|
+
}, [visible]);
|
|
338
|
+
useEffect(function () {
|
|
339
|
+
if (currentDate) {
|
|
340
|
+
setListData(columns());
|
|
341
|
+
}
|
|
342
|
+
}, [currentDate]);
|
|
343
|
+
return React__default.createElement("div", _objectSpread({
|
|
344
|
+
className: "nut-datepicker ".concat(className || ''),
|
|
345
|
+
style: style
|
|
346
|
+
}, rest), listData.length > 0 && React__default.createElement(Picker, {
|
|
347
|
+
isVisible: show,
|
|
348
|
+
listData: listData,
|
|
349
|
+
onClose: onCloseDatePicker,
|
|
350
|
+
defaultValueData: defaultValue,
|
|
351
|
+
onConfirm: function onConfirm(values, options) {
|
|
352
|
+
return onConfirmDatePicker && onConfirmDatePicker(values, options);
|
|
353
|
+
},
|
|
354
|
+
onChange: function onChange(index, value, list) {
|
|
355
|
+
return updateChooseValueCustmer(index, value, list);
|
|
356
|
+
},
|
|
357
|
+
threeDimensional: threeDimensional,
|
|
358
|
+
ref: pickerRef
|
|
359
|
+
}));
|
|
360
|
+
};
|
|
361
|
+
|
|
362
|
+
DatePicker.defaultProps = defaultProps;
|
|
363
|
+
DatePicker.displayName = 'NutDatePicker';
|
|
364
|
+
export { DatePicker as D };
|
|
@@ -54,14 +54,7 @@ var FixedNav = function FixedNav(props) {
|
|
|
54
54
|
var onUpdateValue = function onUpdateValue() {
|
|
55
55
|
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !visible;
|
|
56
56
|
onChange(value);
|
|
57
|
-
};
|
|
58
|
-
// const classes = () => {
|
|
59
|
-
// return `${fixednavClass} ${type} ${visible ? 'active' : ''}`
|
|
60
|
-
// }
|
|
61
|
-
// useEffect(() => {
|
|
62
|
-
// setClassNames(classes())
|
|
63
|
-
// }, [visible])
|
|
64
|
-
|
|
57
|
+
};
|
|
65
58
|
|
|
66
59
|
return React__default.createElement("div", _objectSpread({
|
|
67
60
|
className: classes,
|
|
@@ -54,7 +54,7 @@ var NoticeBar = function NoticeBar(props) {
|
|
|
54
54
|
click = _defaultProps$props.click;
|
|
55
55
|
|
|
56
56
|
var wrap = useRef(null);
|
|
57
|
-
var content = useRef(null);
|
|
57
|
+
var content = useRef(null);
|
|
58
58
|
|
|
59
59
|
var _useState = useState(true),
|
|
60
60
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -108,7 +108,6 @@ var NoticeBar = function NoticeBar(props) {
|
|
|
108
108
|
isCanScroll = _useState20[0],
|
|
109
109
|
SetIsCanScroll = _useState20[1];
|
|
110
110
|
|
|
111
|
-
useState(0);
|
|
112
111
|
useEffect(function () {
|
|
113
112
|
if (direction === 'vertical') {
|
|
114
113
|
if (children) {
|
|
@@ -234,7 +233,7 @@ var NoticeBar = function NoticeBar(props) {
|
|
|
234
233
|
|
|
235
234
|
var startRollEasy = function startRollEasy() {
|
|
236
235
|
showhorseLamp();
|
|
237
|
-
var timerCurr =
|
|
236
|
+
var timerCurr = setInterval(showhorseLamp, ~~(height / speed / 4) * 1000 + Number(standTime));
|
|
238
237
|
SetTimer(timerCurr);
|
|
239
238
|
};
|
|
240
239
|
|
|
@@ -313,7 +312,6 @@ var NoticeBar = function NoticeBar(props) {
|
|
|
313
312
|
};
|
|
314
313
|
|
|
315
314
|
var contentStyle = {
|
|
316
|
-
// paddingLeft: firstRound ? 0 : `${wrapWidth}px`,
|
|
317
315
|
animationDelay: "".concat(firstRound ? delay : 0, "s"),
|
|
318
316
|
animationDuration: "".concat(duration, "s"),
|
|
319
317
|
transform: "translateX(".concat(firstRound ? 0 : "".concat(wrapWidth, "px"), ")")
|
|
@@ -357,7 +355,7 @@ var NoticeBar = function NoticeBar(props) {
|
|
|
357
355
|
className: "wrap"
|
|
358
356
|
}, React__default.createElement("div", {
|
|
359
357
|
ref: content,
|
|
360
|
-
className: "content ".concat(animationClass, " ").concat(isEllipsis()
|
|
358
|
+
className: "content ".concat(animationClass, " ").concat(isEllipsis() ? 'nut-ellipsis' : ''),
|
|
361
359
|
style: contentStyle,
|
|
362
360
|
onAnimationEnd: onAnimationEnd
|
|
363
361
|
}, children, text)), closeMode || rightIcon ? React__default.createElement("div", {
|
|
@@ -12,7 +12,7 @@ export { D as Divider } from './divider.taro-5236fe6a.js';
|
|
|
12
12
|
export { G as Grid } from './grid.taro-5d75c0ad.js';
|
|
13
13
|
export { G as GridItem } from './griditem.taro-edb212e3.js';
|
|
14
14
|
export { N as NavBar } from './navbar.taro-2e969a0f.js';
|
|
15
|
-
export { F as FixedNav } from './fixednav.taro-
|
|
15
|
+
export { F as FixedNav } from './fixednav.taro-da09d1e7.js';
|
|
16
16
|
export { T as Tabbar } from './tabbar.taro-da72fa2c.js';
|
|
17
17
|
export { T as TabbarItem } from './tabbaritem.taro-d0f2cec9.js';
|
|
18
18
|
export { E as Elevator } from './elevator.taro-8e385785.js';
|
|
@@ -29,21 +29,21 @@ export { R as Range } from './range.taro-ef3b30f0.js';
|
|
|
29
29
|
export { C as Calendar } from './calendar.taro-1fc76ba0.js';
|
|
30
30
|
export { C as Checkbox } from './checkbox.taro-9d05ae76.js';
|
|
31
31
|
export { C as CheckboxGroup } from './checkboxgroup.taro-3d380042.js';
|
|
32
|
-
export { D as DatePicker } from './datepicker.taro-
|
|
32
|
+
export { D as DatePicker } from './datepicker.taro-318e9561.js';
|
|
33
33
|
export { I as InputNumber } from './inputnumber.taro-102203f3.js';
|
|
34
34
|
export { I as Input } from './input.taro-505632ac.js';
|
|
35
35
|
export { R as Radio } from './radio.taro-1c63512f.js';
|
|
36
36
|
export { R as RadioGroup } from './radiogroup.taro-b5dad516.js';
|
|
37
|
-
export { R as Rate } from './rate.taro-
|
|
37
|
+
export { R as Rate } from './rate.taro-6b1cbe5f.js';
|
|
38
38
|
export { C as CalendarItem } from './calendaritem.taro-11333579.js';
|
|
39
|
-
export { P as Picker } from './picker.taro-
|
|
39
|
+
export { P as Picker } from './picker.taro-62ce13e0.js';
|
|
40
40
|
export { S as ShortPassword } from './shortpassword.taro-2db97cc8.js';
|
|
41
41
|
export { T as TextArea } from './textarea.taro-388d1f90.js';
|
|
42
42
|
export { U as Uploader } from './uploader.taro-b232b2d3.js';
|
|
43
43
|
export { C as Cascader } from './cascader.taro-d7e71bdf.js';
|
|
44
44
|
export { S as SearchBar } from './searchbar.taro-81867286.js';
|
|
45
45
|
export { N as NumberKeyboard } from './numberkeyboard.taro-cf7d06f4.js';
|
|
46
|
-
export { A as ActionSheet } from './actionsheet.taro-
|
|
46
|
+
export { A as ActionSheet } from './actionsheet.taro-9d4ce0c8.js';
|
|
47
47
|
export { B as BackTop } from './backtop.taro-eb9359e8.js';
|
|
48
48
|
export { D as Drag } from './drag.taro-56e8c87a.js';
|
|
49
49
|
export { D as Dialog } from './dialog.taro-0e53ade9.js';
|
|
@@ -54,7 +54,7 @@ export { T as Toast } from './toast.taro-d4ecd6af.js';
|
|
|
54
54
|
export { S as Swipe } from './swipe.taro-dfb9a049.js';
|
|
55
55
|
export { P as PullToRefresh } from './pulltorefresh.taro-8846f019.js';
|
|
56
56
|
export { C as CircleProgress } from './circleprogress.taro-1a38e1c6.js';
|
|
57
|
-
export { N as NoticeBar } from './noticebar.taro-
|
|
57
|
+
export { N as NoticeBar } from './noticebar.taro-dcaf6497.js';
|
|
58
58
|
export { S as Steps } from './steps.taro-943f4fbb.js';
|
|
59
59
|
export { S as Step } from './step-9a048771.js';
|
|
60
60
|
export { S as Swiper } from './swiper.taro-448cd0ad.js';
|
|
@@ -99,10 +99,9 @@ import '@react-spring/web';
|
|
|
99
99
|
import './offsetContext-0e3d04b3.js';
|
|
100
100
|
import './useTouch-a2ea68c6.js';
|
|
101
101
|
import './useClientRect-8b7cc406.js';
|
|
102
|
-
import './useRefs-032cf186.js';
|
|
103
102
|
import './icon-8dc4de10.js';
|
|
104
|
-
import './configprovider-3e87d67a.js';
|
|
105
103
|
import './render-4a3856cb.js';
|
|
106
104
|
import './UserContext-68f62e66.js';
|
|
107
105
|
import './UserContext-b4181162.js';
|
|
108
106
|
import './AvatarContext-7153ad2b.js';
|
|
107
|
+
import './configprovider-3e87d67a.js';
|
|
@@ -11,7 +11,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
11
11
|
|
|
12
12
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
13
13
|
import React__default, { useState, useRef, useEffect, useImperativeHandle } from 'react';
|
|
14
|
-
import {
|
|
14
|
+
import { P as Popup } from './popup.taro-8363fbae.js';
|
|
15
15
|
import { u as useTouch } from './useTouch-a2ea68c6.js';
|
|
16
16
|
import { g as getRectByTaro } from './useClientRect-8b7cc406.js';
|
|
17
17
|
import { u as useConfig } from './configprovider.taro-6c7b3056.js';
|
|
@@ -340,6 +340,19 @@ var InternalPickerSlot = function InternalPickerSlot(props, ref) {
|
|
|
340
340
|
|
|
341
341
|
var PickerSlot = React__default.forwardRef(InternalPickerSlot);
|
|
342
342
|
|
|
343
|
+
function useRefs() {
|
|
344
|
+
var refs = React__default.useRef([]);
|
|
345
|
+
var setRefs = React__default.useCallback(function (index) {
|
|
346
|
+
return function (el) {
|
|
347
|
+
if (el) refs.current[index] = el;
|
|
348
|
+
};
|
|
349
|
+
}, []);
|
|
350
|
+
var reset = React__default.useCallback(function () {
|
|
351
|
+
refs.current = [];
|
|
352
|
+
}, []);
|
|
353
|
+
return [refs.current, setRefs, reset];
|
|
354
|
+
}
|
|
355
|
+
|
|
343
356
|
var InternalPicker = function InternalPicker(props, ref) {
|
|
344
357
|
var _useConfig = useConfig(),
|
|
345
358
|
locale = _useConfig.locale;
|
|
@@ -7,7 +7,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
7
7
|
|
|
8
8
|
import React__default, { useState, useEffect } from 'react';
|
|
9
9
|
import { c as cn } from './bem-893ad28d.js';
|
|
10
|
-
import { I as Icon } from './icon
|
|
10
|
+
import { I as Icon } from './icon-8dc4de10.js';
|
|
11
11
|
var defaultProps = {
|
|
12
12
|
count: 5,
|
|
13
13
|
modelValue: 0,
|
|
@@ -37,7 +37,7 @@ var Rate = function Rate(props) {
|
|
|
37
37
|
readonly = _defaultProps$props.readonly,
|
|
38
38
|
allowHalf = _defaultProps$props.allowHalf,
|
|
39
39
|
spacing = _defaultProps$props.spacing,
|
|
40
|
-
|
|
40
|
+
onChange = _defaultProps$props.onChange;
|
|
41
41
|
|
|
42
42
|
var b = cn('rate');
|
|
43
43
|
var bi = cn('rate-item');
|
|
@@ -76,20 +76,18 @@ var Rate = function Rate(props) {
|
|
|
76
76
|
var value = 0;
|
|
77
77
|
if (index === 1 && score === index) ;else {
|
|
78
78
|
value = index;
|
|
79
|
-
|
|
80
|
-
if (allowHalf) {
|
|
81
|
-
var _e$target, _e$target$className;
|
|
82
|
-
|
|
83
|
-
console.log('e', e);
|
|
84
|
-
|
|
85
|
-
if (e !== null && e !== void 0 && (_e$target = e.target) !== null && _e$target !== void 0 && (_e$target$className = _e$target.className) !== null && _e$target$className !== void 0 && _e$target$className.includes('__icon--half')) {
|
|
86
|
-
value -= 0.5;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
79
|
}
|
|
90
80
|
value = Math.max(value, Number(minimizeValue));
|
|
91
81
|
setScore(value);
|
|
92
|
-
|
|
82
|
+
onChange && onChange(value);
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
var onHalfClick = function onHalfClick(event, n) {
|
|
86
|
+
event.preventDefault();
|
|
87
|
+
event.stopPropagation();
|
|
88
|
+
var value = Math.max(Number(minimizeValue), n - 0.5);
|
|
89
|
+
setScore(value);
|
|
90
|
+
onChange && onChange(value);
|
|
93
91
|
};
|
|
94
92
|
|
|
95
93
|
return React__default.createElement("div", {
|
|
@@ -110,15 +108,13 @@ var Rate = function Rate(props) {
|
|
|
110
108
|
name: n <= score ? checkedIcon : uncheckedIcon,
|
|
111
109
|
color: n <= score ? activeColor : voidColor
|
|
112
110
|
}), allowHalf && score > n - 1 && React__default.createElement(Icon, {
|
|
111
|
+
onClick: function onClick(event) {
|
|
112
|
+
return onHalfClick(event, n);
|
|
113
|
+
},
|
|
113
114
|
className: "".concat(bi('icon'), " ").concat(bi('icon--half')),
|
|
114
115
|
color: n <= score ? activeColor : voidColor,
|
|
115
116
|
size: iconSize,
|
|
116
117
|
name: checkedIcon
|
|
117
|
-
}), allowHalf && score < n - 1 && React__default.createElement(Icon, {
|
|
118
|
-
className: "".concat(bi('icon'), " ").concat(bi('icon--disabled'), " ").concat(bi('icon--half')),
|
|
119
|
-
color: voidColor,
|
|
120
|
-
size: iconSize,
|
|
121
|
-
name: uncheckedIcon
|
|
122
118
|
}));
|
|
123
119
|
}));
|
|
124
120
|
};
|
package/dist/locales/base.js
CHANGED
package/dist/locales/en-US.js
CHANGED
package/dist/locales/id-ID.js
CHANGED
package/dist/locales/zh-CN.js
CHANGED