@nutui/nutui-react-taro 1.5.2-beta.1 → 1.5.2
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/dist/esm/ActionSheet.js +90 -14
- package/dist/esm/Address.js +620 -21
- package/dist/esm/Animate.js +53 -7
- package/dist/esm/AnimatingNumbers.js +125 -7
- package/dist/esm/Audio.js +264 -19
- package/dist/esm/Avatar.js +130 -11
- package/dist/esm/{AvatarContext-c96afdcc.js → AvatarContext-15733596.js} +1 -3
- package/dist/esm/AvatarGroup.js +41 -11
- package/dist/esm/BackTop.js +138 -10
- package/dist/esm/Badge.js +71 -9
- package/dist/esm/Barrage.js +97 -8
- package/dist/esm/Button.js +108 -9
- package/dist/esm/Calendar.js +128 -20
- package/dist/esm/CalendarItem.js +674 -12
- package/dist/esm/Card.js +61 -11
- package/dist/esm/Cascader.js +671 -16
- package/dist/esm/Cell.js +101 -9
- package/dist/esm/CellGroup.js +2 -5
- package/dist/esm/Checkbox.js +5 -7
- package/dist/esm/CheckboxGroup.js +111 -8
- package/dist/esm/CircleProgress.js +114 -8
- package/dist/esm/Col.js +57 -7
- package/dist/esm/Collapse.js +97 -7
- package/dist/esm/CollapseItem.js +146 -8
- package/dist/esm/ConfigProvider.js +187 -8
- package/dist/esm/CountDown.js +247 -9
- package/dist/esm/DatePicker.js +309 -25
- package/dist/esm/Dialog.js +296 -17
- package/dist/esm/Divider.js +34 -7
- package/dist/esm/Drag.js +118 -7
- package/dist/esm/Elevator.js +234 -8
- package/dist/esm/Ellipsis.js +176 -10
- package/dist/esm/Empty.js +79 -8
- package/dist/esm/FixedNav.js +103 -14
- package/dist/esm/Form.js +215 -10
- package/dist/esm/FormItem.js +3 -10
- package/dist/esm/Grid.js +81 -11
- package/dist/esm/GridItem.js +123 -13
- package/dist/esm/Icon.js +2 -5
- package/dist/esm/Image.js +169 -11
- package/dist/esm/ImagePreview.js +225 -19
- package/dist/esm/Indicator.js +50 -7
- package/dist/esm/Infiniteloading.js +215 -14
- package/dist/esm/Input.js +362 -12
- package/dist/esm/InputNumber.js +275 -9
- package/dist/esm/Layout.js +13 -5
- package/dist/esm/Menu.js +153 -10
- package/dist/esm/MenuItem.js +175 -15
- package/dist/esm/NavBar.js +114 -9
- package/dist/esm/NoticeBar.js +568 -10
- package/dist/esm/Notify.js +234 -8
- package/dist/esm/NumberKeyboard.js +247 -17
- package/dist/esm/Overlay.js +2 -6
- package/dist/esm/Pagination.js +168 -9
- package/dist/esm/Picker.js +494 -22
- package/dist/esm/Popover.js +223 -12
- package/dist/esm/Popup.js +193 -13
- package/dist/esm/Price.js +84 -6
- package/dist/esm/Progress.js +122 -9
- package/dist/esm/PullToRefresh.js +276 -13
- package/dist/esm/Radio.js +4 -8
- package/dist/esm/RadioGroup.js +120 -7
- package/dist/esm/Range.js +406 -15
- package/dist/esm/Rate.js +121 -9
- package/dist/esm/Row.js +49 -7
- package/dist/esm/SearchBar.js +235 -12
- package/dist/esm/ShortPassword.js +191 -17
- package/dist/esm/SideNavBar.js +57 -19
- package/dist/esm/SideNavBarItem.js +24 -5
- package/dist/esm/Signature.js +153 -13
- package/dist/esm/Skeleton.js +98 -12
- package/dist/esm/Step.js +87 -10
- package/dist/esm/Steps.js +38 -8
- package/dist/esm/Sticky.js +190 -11
- package/dist/esm/SubSideNavBar.js +78 -6
- package/dist/esm/Swipe.js +230 -10
- package/dist/esm/Swiper.js +490 -9
- package/dist/esm/SwiperItem.js +36 -8
- package/dist/esm/Switch.js +71 -6
- package/dist/esm/TabPane.js +2 -5
- package/dist/esm/Tabbar.js +68 -6
- package/dist/esm/TabbarItem.js +78 -9
- package/dist/esm/Table.js +140 -12
- package/dist/esm/Tabs.js +5 -8
- package/dist/esm/Tag.js +110 -10
- package/dist/esm/TextArea.js +148 -9
- package/dist/esm/TimeDetail.js +67 -9
- package/dist/esm/TimePannel.js +29 -9
- package/dist/esm/TimeSelect.js +171 -19
- package/dist/esm/Toast.js +268 -7
- package/dist/esm/TrendArrow.js +99 -7
- package/dist/esm/Uploader.js +566 -17
- package/dist/esm/{UserContext-0aac9a82.js → UserContext-101ad4a4.js} +1 -3
- package/dist/esm/{UserContext-e402e1a6.js → UserContext-2629d479.js} +1 -3
- package/dist/esm/{UserContext-e8176108.js → UserContext-b33bcf21.js} +1 -3
- package/dist/esm/Video.js +90 -7
- package/dist/esm/VirtualList.js +313 -9
- package/dist/esm/WaterMark.js +111 -11
- package/dist/esm/{bem-350c1702.js → bem-3b438e61.js} +6 -3
- package/dist/esm/cellgroup-fcc72767.js +34 -0
- package/dist/esm/checkbox-44e13cd0.js +137 -0
- package/dist/esm/date-c7aad4c0.js +97 -0
- package/dist/esm/formitem-8a73a5fb.js +157 -0
- package/dist/esm/get-scroll-parent-5f85dee8.js +24 -0
- package/dist/esm/{grid.taro.context-c2bbfb4f.js → grid.context-2ee27d95.js} +2 -4
- package/dist/esm/icon-4ef1581c.js +70 -0
- package/dist/esm/index-030b7245.js +11 -0
- package/dist/esm/nutui-react.es.js +94 -119
- package/dist/esm/offsetContext-3ab00d40.js +16 -0
- package/dist/esm/overlay-de6c79d5.js +83 -0
- package/dist/esm/radio-9f141e6b.js +118 -0
- package/dist/esm/render-bbebb760.js +79 -0
- package/dist/esm/tabpane-01075e6c.js +29 -0
- package/dist/esm/tabs-e1b4e4b1.js +181 -0
- package/dist/esm/typings-f27b58f4.js +8 -0
- package/dist/esm/useClientRect-56bb675b.js +39 -0
- package/dist/esm/useTouch-cf73a407.js +99 -0
- 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/locales/zh-UG.js +1 -1
- package/dist/nutui.react.mjs +15025 -13192
- package/dist/nutui.react.umd.js +15004 -13169
- package/dist/style.mjs +1 -1
- package/dist/types/index.d.ts +183 -176
- package/package.json +1 -1
- package/dist/esm/actionsheet.taro-e6a51446.js +0 -53
- package/dist/esm/address.taro-3a9b6396.js +0 -461
- package/dist/esm/animate.taro-fb7986d6.js +0 -40
- package/dist/esm/animatingnumbers.taro-03e5d61d.js +0 -104
- package/dist/esm/audio.taro-87ec8bf2.js +0 -161
- package/dist/esm/avatar.taro-3676f38f.js +0 -103
- package/dist/esm/avatargroup-f3574510.js +0 -34
- package/dist/esm/backtop.taro-66394a36.js +0 -48
- package/dist/esm/badge.taro-a4e59c11.js +0 -52
- package/dist/esm/barrage.taro-0495a1b2.js +0 -94
- package/dist/esm/button.taro-9244d065.js +0 -100
- package/dist/esm/calendar.taro-670842ea.js +0 -65
- package/dist/esm/calendaritem.taro-2a603571.js +0 -787
- package/dist/esm/can-use-dom-3eeb5af4.js +0 -6
- package/dist/esm/card.taro-e4c76dad.js +0 -33
- package/dist/esm/cascader.taro-eb1fb011.js +0 -438
- package/dist/esm/cell.taro-a10a74d3.js +0 -64
- package/dist/esm/cellgroup.taro-abe501bc.js +0 -25
- package/dist/esm/checkbox.taro-6120e3e3.js +0 -171
- package/dist/esm/circleprogress.taro-79854448.js +0 -109
- package/dist/esm/col.taro-53eed3cc.js +0 -41
- package/dist/esm/collapse.taro-1a9e4ba2.js +0 -83
- package/dist/esm/collapseitem-4d0bc55d.js +0 -83
- package/dist/esm/configprovider-67d19d3a.js +0 -19
- package/dist/esm/configprovider.taro-8d71eb49.js +0 -42
- package/dist/esm/countdown.taro-5b17c607.js +0 -226
- package/dist/esm/datepicker.taro-6e9b4b8f.js +0 -275
- package/dist/esm/dialog.taro-a3267d29.js +0 -118
- package/dist/esm/divider.taro-26d1d8b4.js +0 -35
- package/dist/esm/drag.taro-79bb8744.js +0 -110
- package/dist/esm/elevator.taro-6019669e.js +0 -178
- package/dist/esm/ellipsis.taro-f15f26da.js +0 -241
- package/dist/esm/empty.taro-04ae4389.js +0 -62
- package/dist/esm/fixednav.taro-1f05acaf.js +0 -53
- package/dist/esm/form.taro-0c8e7a39.js +0 -179
- package/dist/esm/formitem.taro-190a3326.js +0 -89
- package/dist/esm/get-scroll-parent-b4a07e65.js +0 -25
- package/dist/esm/grid.taro-3503b82c.js +0 -61
- package/dist/esm/griditem.taro-cdb3f119.js +0 -98
- package/dist/esm/icon-296a1bec.js +0 -63
- package/dist/esm/icon.taro-296a1bec.js +0 -63
- package/dist/esm/image.taro-142cf512.js +0 -64
- package/dist/esm/imagepreview.taro-c50bb0a3.js +0 -167
- package/dist/esm/index-5bcb0ff8.js +0 -7
- package/dist/esm/indicator.taro-cba8b010.js +0 -37
- package/dist/esm/infiniteloading.taro-183bccbf.js +0 -144
- package/dist/esm/input.taro-97af6c96.js +0 -240
- package/dist/esm/inputnumber.taro-91f65d17.js +0 -130
- package/dist/esm/layout.taro-9046d093.js +0 -11
- package/dist/esm/menu.taro-7e4038a1.js +0 -99
- package/dist/esm/menuitem.taro-96cc4f15.js +0 -130
- package/dist/esm/navbar.taro-777c4705.js +0 -79
- package/dist/esm/noticebar.taro-4a23cdee.js +0 -448
- package/dist/esm/notify.taro-e17c6f82.js +0 -75
- package/dist/esm/numberkeyboard.taro-1bc24744.js +0 -159
- package/dist/esm/offsetContext-c2a746fa.js +0 -5
- package/dist/esm/overlay.taro-21e87fb1.js +0 -69
- package/dist/esm/pagination.taro-715a173b.js +0 -124
- package/dist/esm/picker.taro-9ad1b7c5.js +0 -473
- package/dist/esm/popover.taro-ad5e76ea.js +0 -156
- package/dist/esm/popup.taro-01676bff.js +0 -137
- package/dist/esm/price.taro-776ed16e.js +0 -83
- package/dist/esm/progress.taro-f0ce38e9.js +0 -90
- package/dist/esm/pulltorefresh.taro-a294f656.js +0 -181
- package/dist/esm/radio.taro-a6eff96c.js +0 -168
- package/dist/esm/range.taro-d8fc7656.js +0 -332
- package/dist/esm/rate.taro-6cdf03bd.js +0 -75
- package/dist/esm/row.taro-f64d4a13.js +0 -46
- package/dist/esm/searchbar.taro-0c25927b.js +0 -152
- package/dist/esm/shortpassword.taro-9ee034f7.js +0 -111
- package/dist/esm/sidenavbar.taro-c307b35e.js +0 -35
- package/dist/esm/sidenavbaritem.taro-5a7965d0.js +0 -12
- package/dist/esm/signature.taro-ec4e713b.js +0 -143
- package/dist/esm/skeleton.taro-76faf63f.js +0 -62
- package/dist/esm/step.taro-b7903e8c.js +0 -59
- package/dist/esm/steps.taro-c82d2252.js +0 -30
- package/dist/esm/sticky.taro-218bda37.js +0 -138
- package/dist/esm/subsidenavbar.taro-69cb9752.js +0 -63
- package/dist/esm/supports-passive-c85ef996.js +0 -18
- package/dist/esm/swipe.taro-ea35f07f.js +0 -177
- package/dist/esm/swiper.taro-7a94e211.js +0 -451
- package/dist/esm/swiperitem-c9e3d0d5.js +0 -29
- package/dist/esm/switch.taro-34ca8228.js +0 -50
- package/dist/esm/tabbar.taro-9acfc2fa.js +0 -59
- package/dist/esm/tabbaritem.taro-bf517487.js +0 -58
- package/dist/esm/table.taro-91fc0c01.js +0 -93
- package/dist/esm/tabpane.taro-4ca340ef.js +0 -23
- package/dist/esm/tabs.taro-6a7524a4.js +0 -140
- package/dist/esm/tag.taro-23ba0834.js +0 -92
- package/dist/esm/textarea.taro-442e7350.js +0 -94
- package/dist/esm/timedetail.taro-5b2f2269.js +0 -44
- package/dist/esm/timepannel.taro-d6e40180.js +0 -22
- package/dist/esm/timeselect.taro-a07036f4.js +0 -133
- package/dist/esm/toast.taro-d6c14811.js +0 -109
- package/dist/esm/trendarrow.taro-b8c5ccd9.js +0 -73
- package/dist/esm/typings-b9828dba.js +0 -9
- package/dist/esm/uploader.taro-587e6bf3.js +0 -492
- package/dist/esm/useClientRect-1f8ed1fe.js +0 -18
- package/dist/esm/useTouch-db24bb5c.js +0 -69
- package/dist/esm/video-f1be8a91.js +0 -67
- package/dist/esm/virtuallist.taro-f0b0270d.js +0 -214
- package/dist/esm/watermark.taro-9ce2ae37.js +0 -114
- package/dist/esm/zh-CN-c779e6c1.js +0 -131
|
@@ -1,448 +0,0 @@
|
|
|
1
|
-
import React__default, { useRef, useState, useMemo, useEffect } from 'react';
|
|
2
|
-
import classNames from 'classnames';
|
|
3
|
-
import { I as Icon } from './icon.taro-296a1bec.js';
|
|
4
|
-
import { c as cn } from './bem-350c1702.js';
|
|
5
|
-
import { g as getRectByTaro } from './useClientRect-1f8ed1fe.js';
|
|
6
|
-
import { C as ComponentDefaults } from './typings-b9828dba.js';
|
|
7
|
-
|
|
8
|
-
const defaultProps = {
|
|
9
|
-
...ComponentDefaults,
|
|
10
|
-
// 滚动方向 across 横向 vertical 纵向
|
|
11
|
-
direction: 'across',
|
|
12
|
-
list: [],
|
|
13
|
-
standTime: 1000,
|
|
14
|
-
complexAm: false,
|
|
15
|
-
height: 40,
|
|
16
|
-
text: '',
|
|
17
|
-
closeMode: false,
|
|
18
|
-
wrapable: false,
|
|
19
|
-
leftIcon: '',
|
|
20
|
-
color: '',
|
|
21
|
-
background: '',
|
|
22
|
-
delay: 1,
|
|
23
|
-
scrollable: null,
|
|
24
|
-
speed: 50,
|
|
25
|
-
};
|
|
26
|
-
const NoticeBar = (props) => {
|
|
27
|
-
const { children, className, style, direction, list, standTime, complexAm, height, text, closeMode, wrapable, leftIcon, color, background, delay, scrollable, speed, rightIcon, close, click, onClose, onClick, onClickItem, iconClassPrefix, iconFontClassName, } = {
|
|
28
|
-
...defaultProps,
|
|
29
|
-
...props,
|
|
30
|
-
};
|
|
31
|
-
const wrap = useRef(null);
|
|
32
|
-
const content = useRef(null);
|
|
33
|
-
const [showNoticeBar, SetShowNoticeBar] = useState(true);
|
|
34
|
-
const scrollList = useRef([]);
|
|
35
|
-
const [wrapWidth, SetWrapWidth] = useState(0);
|
|
36
|
-
const [firstRound, SetFirstRound] = useState(true);
|
|
37
|
-
const [duration, SetDuration] = useState(0);
|
|
38
|
-
const [offsetWidth, SetOffsetW] = useState(0);
|
|
39
|
-
const [animationClass, SetAnimationClass] = useState('');
|
|
40
|
-
const [animate, SetAnimate] = useState(false);
|
|
41
|
-
const [distance, SetDistance] = useState(0);
|
|
42
|
-
const [timer, SetTimer] = useState(0);
|
|
43
|
-
const [isCanScroll, SetIsCanScroll] = useState(null);
|
|
44
|
-
const isVertical = direction === 'vertical';
|
|
45
|
-
const [rect, setRect] = useState(null);
|
|
46
|
-
let active = 0;
|
|
47
|
-
const [vLeftIcon, setLeftIcon] = useState('');
|
|
48
|
-
const [ready, setReady] = useState(false);
|
|
49
|
-
const container = useRef(null);
|
|
50
|
-
const innerRef = useRef(null);
|
|
51
|
-
const _swiper = useRef({
|
|
52
|
-
moving: false,
|
|
53
|
-
autoplayTimer: null,
|
|
54
|
-
width: 0,
|
|
55
|
-
height: 0,
|
|
56
|
-
offset: 0,
|
|
57
|
-
size: 0,
|
|
58
|
-
});
|
|
59
|
-
const [childOffset, setChildOffset] = useState([]);
|
|
60
|
-
const [offset, setOffset] = useState(0);
|
|
61
|
-
const { childs, childCount } = useMemo(() => {
|
|
62
|
-
let childCount = 0;
|
|
63
|
-
const childs = React__default.Children.map(children, (child) => {
|
|
64
|
-
if (!React__default.isValidElement(child))
|
|
65
|
-
return null;
|
|
66
|
-
childCount++;
|
|
67
|
-
return child;
|
|
68
|
-
});
|
|
69
|
-
return {
|
|
70
|
-
childs,
|
|
71
|
-
childCount,
|
|
72
|
-
};
|
|
73
|
-
}, [children]);
|
|
74
|
-
let trackSize = childCount * Number(height);
|
|
75
|
-
const minOffset = (() => {
|
|
76
|
-
if (rect) {
|
|
77
|
-
const base = isVertical ? rect.height : rect.width;
|
|
78
|
-
return base - Number(height) * childCount;
|
|
79
|
-
}
|
|
80
|
-
return 0;
|
|
81
|
-
})();
|
|
82
|
-
useEffect(() => {
|
|
83
|
-
if (isVertical) {
|
|
84
|
-
// 兼容老版本无左侧Icon问题
|
|
85
|
-
if (leftIcon !== '') {
|
|
86
|
-
setLeftIcon(leftIcon);
|
|
87
|
-
}
|
|
88
|
-
else {
|
|
89
|
-
setLeftIcon('close');
|
|
90
|
-
}
|
|
91
|
-
if (children) {
|
|
92
|
-
scrollList.current = [].concat(childs);
|
|
93
|
-
}
|
|
94
|
-
else {
|
|
95
|
-
scrollList.current = [].concat(list);
|
|
96
|
-
// startRollEasy()
|
|
97
|
-
setTimeout(() => {
|
|
98
|
-
startRollEasy();
|
|
99
|
-
}, Number(standTime));
|
|
100
|
-
}
|
|
101
|
-
setTimeout(() => {
|
|
102
|
-
complexAm && startRoll();
|
|
103
|
-
}, Number(standTime));
|
|
104
|
-
}
|
|
105
|
-
else {
|
|
106
|
-
initScrollWrap();
|
|
107
|
-
}
|
|
108
|
-
return () => {
|
|
109
|
-
// 销毁事件
|
|
110
|
-
clearInterval(timer);
|
|
111
|
-
};
|
|
112
|
-
}, []);
|
|
113
|
-
useEffect(() => {
|
|
114
|
-
initScrollWrap();
|
|
115
|
-
}, [text]);
|
|
116
|
-
useEffect(() => {
|
|
117
|
-
if (list && list.length) {
|
|
118
|
-
scrollList.current = [].concat(list);
|
|
119
|
-
}
|
|
120
|
-
}, [list]);
|
|
121
|
-
const initScrollWrap = (value) => {
|
|
122
|
-
if (showNoticeBar === false) {
|
|
123
|
-
return;
|
|
124
|
-
}
|
|
125
|
-
setTimeout(async () => {
|
|
126
|
-
if (!wrap.current || !content.current) {
|
|
127
|
-
return;
|
|
128
|
-
}
|
|
129
|
-
const warpRes = await getRectByTaro(wrap.current);
|
|
130
|
-
const contentRes = await getRectByTaro(content.current);
|
|
131
|
-
const wrapW = warpRes.width;
|
|
132
|
-
const offsetW = contentRes.width;
|
|
133
|
-
const canScroll = scrollable == null ? offsetW > wrapW : scrollable;
|
|
134
|
-
SetIsCanScroll(canScroll);
|
|
135
|
-
if (canScroll) {
|
|
136
|
-
SetWrapWidth(wrapW);
|
|
137
|
-
SetOffsetW(offsetW);
|
|
138
|
-
SetDuration(offsetW / speed);
|
|
139
|
-
SetAnimationClass('play');
|
|
140
|
-
}
|
|
141
|
-
else {
|
|
142
|
-
SetAnimationClass('');
|
|
143
|
-
}
|
|
144
|
-
}, 0);
|
|
145
|
-
};
|
|
146
|
-
const handleClick = (event) => {
|
|
147
|
-
click && click(event);
|
|
148
|
-
onClick && onClick(event);
|
|
149
|
-
};
|
|
150
|
-
const onClickIcon = (event) => {
|
|
151
|
-
event.stopPropagation();
|
|
152
|
-
SetShowNoticeBar(!closeMode);
|
|
153
|
-
close && close(event);
|
|
154
|
-
onClose && onClose(event);
|
|
155
|
-
};
|
|
156
|
-
const onAnimationEnd = () => {
|
|
157
|
-
SetFirstRound(false);
|
|
158
|
-
setTimeout(() => {
|
|
159
|
-
SetDuration((offsetWidth + wrapWidth) / speed);
|
|
160
|
-
SetAnimationClass('play-infinite');
|
|
161
|
-
}, 0);
|
|
162
|
-
};
|
|
163
|
-
/**
|
|
164
|
-
* 滚动方式一
|
|
165
|
-
*/
|
|
166
|
-
const startRollEasy = () => {
|
|
167
|
-
showhorseLamp();
|
|
168
|
-
const time = height / speed / 4 < 1
|
|
169
|
-
? Number((height / speed / 4).toFixed(1)) * 1000
|
|
170
|
-
: ~~(height / speed / 4) * 1000;
|
|
171
|
-
const timerCurr = window.setInterval(showhorseLamp, time + Number(standTime));
|
|
172
|
-
SetTimer(timerCurr);
|
|
173
|
-
};
|
|
174
|
-
const showhorseLamp = () => {
|
|
175
|
-
SetAnimate(true);
|
|
176
|
-
const time = height / speed / 4 < 1
|
|
177
|
-
? Number((height / speed / 4).toFixed(1)) * 1000
|
|
178
|
-
: ~~(height / speed / 4) * 1000;
|
|
179
|
-
setTimeout(() => {
|
|
180
|
-
scrollList.current.push(scrollList.current[0]);
|
|
181
|
-
scrollList.current.shift();
|
|
182
|
-
SetAnimate(false);
|
|
183
|
-
}, time);
|
|
184
|
-
};
|
|
185
|
-
const startRoll = () => {
|
|
186
|
-
const timerCurr = window.setInterval(() => {
|
|
187
|
-
const chunk = 100;
|
|
188
|
-
for (let i = 0; i < chunk; i++) {
|
|
189
|
-
scroll(i, !(i < chunk - 1));
|
|
190
|
-
}
|
|
191
|
-
}, Number(standTime) + 100 * speed);
|
|
192
|
-
SetTimer(timerCurr);
|
|
193
|
-
};
|
|
194
|
-
const scroll = (n, last) => {
|
|
195
|
-
SetAnimate(true);
|
|
196
|
-
setTimeout(() => {
|
|
197
|
-
let long = distance;
|
|
198
|
-
long -= height / 100;
|
|
199
|
-
SetDistance(long);
|
|
200
|
-
if (last) {
|
|
201
|
-
scrollList.current.push(scrollList.current[0]);
|
|
202
|
-
scrollList.current.shift();
|
|
203
|
-
SetDistance(0);
|
|
204
|
-
SetAnimate(false);
|
|
205
|
-
}
|
|
206
|
-
}, n * speed);
|
|
207
|
-
};
|
|
208
|
-
/**
|
|
209
|
-
* 点击滚动单元
|
|
210
|
-
*/
|
|
211
|
-
const handleClickIcon = (event) => {
|
|
212
|
-
event.stopPropagation();
|
|
213
|
-
SetShowNoticeBar(!closeMode);
|
|
214
|
-
close && close(event);
|
|
215
|
-
onClose && onClose(event);
|
|
216
|
-
};
|
|
217
|
-
const iconShow = () => {
|
|
218
|
-
if (leftIcon === 'close' || vLeftIcon === 'close') {
|
|
219
|
-
return false;
|
|
220
|
-
}
|
|
221
|
-
return true;
|
|
222
|
-
};
|
|
223
|
-
const iconBg = () => {
|
|
224
|
-
let iconBg = '';
|
|
225
|
-
if (leftIcon) {
|
|
226
|
-
iconBg = leftIcon;
|
|
227
|
-
}
|
|
228
|
-
return iconBg;
|
|
229
|
-
};
|
|
230
|
-
const isEllipsis = () => {
|
|
231
|
-
if (isCanScroll == null) {
|
|
232
|
-
return wrapable;
|
|
233
|
-
}
|
|
234
|
-
return !isCanScroll && !wrapable;
|
|
235
|
-
};
|
|
236
|
-
const contentStyle = {
|
|
237
|
-
animationDelay: `${firstRound ? delay : 0}s`,
|
|
238
|
-
animationDuration: `${duration}s`,
|
|
239
|
-
transform: `translateX(${firstRound ? 0 : `${wrapWidth}px`})`,
|
|
240
|
-
};
|
|
241
|
-
const barStyle = {
|
|
242
|
-
color,
|
|
243
|
-
background,
|
|
244
|
-
height: isVertical ? `${height}px` : '',
|
|
245
|
-
};
|
|
246
|
-
const duringTime = height / speed / 4 < 1
|
|
247
|
-
? Number((height / speed / 4).toFixed(1))
|
|
248
|
-
: ~~(height / speed / 4);
|
|
249
|
-
const noDuring = height / speed < 1 ? (height / speed).toFixed(1) : ~~(height / speed);
|
|
250
|
-
const horseLampStyle = {
|
|
251
|
-
transform: complexAm ? `translateY(${distance}px)` : '',
|
|
252
|
-
transition: animate
|
|
253
|
-
? `all ${duringTime === 0 ? noDuring : duringTime}s`
|
|
254
|
-
: '',
|
|
255
|
-
marginTop: animate ? `-${height}px` : '',
|
|
256
|
-
};
|
|
257
|
-
const b = cn('noticebar');
|
|
258
|
-
const noticebarClass = classNames({
|
|
259
|
-
'nut-noticebar-page': true,
|
|
260
|
-
withicon: closeMode,
|
|
261
|
-
close: closeMode,
|
|
262
|
-
wrapable,
|
|
263
|
-
});
|
|
264
|
-
/**
|
|
265
|
-
* 垂直自定义滚动方式
|
|
266
|
-
*/
|
|
267
|
-
const init = (active = +0) => {
|
|
268
|
-
if (!container?.current)
|
|
269
|
-
return;
|
|
270
|
-
setTimeout(async () => {
|
|
271
|
-
const rects = await getRectByTaro(container?.current);
|
|
272
|
-
const _active = Math.max(Math.min(childCount - 1, active), 0);
|
|
273
|
-
const _height = rects.height;
|
|
274
|
-
trackSize = childCount * Number(_height);
|
|
275
|
-
const targetOffset = getOffset(_active);
|
|
276
|
-
_swiper.current.moving = true;
|
|
277
|
-
if (ready) {
|
|
278
|
-
_swiper.current.moving = false;
|
|
279
|
-
}
|
|
280
|
-
active = _active;
|
|
281
|
-
setRect(rects);
|
|
282
|
-
setOffset(targetOffset);
|
|
283
|
-
setReady(true);
|
|
284
|
-
}, 0);
|
|
285
|
-
};
|
|
286
|
-
useEffect(() => {
|
|
287
|
-
if (ready) {
|
|
288
|
-
stopAutoPlay();
|
|
289
|
-
autoplay();
|
|
290
|
-
}
|
|
291
|
-
return () => {
|
|
292
|
-
setReady(false);
|
|
293
|
-
};
|
|
294
|
-
}, [ready]);
|
|
295
|
-
useEffect(() => {
|
|
296
|
-
if (isVertical && children) {
|
|
297
|
-
setTimeout(() => {
|
|
298
|
-
init();
|
|
299
|
-
stopAutoPlay();
|
|
300
|
-
autoplay();
|
|
301
|
-
}, 300);
|
|
302
|
-
}
|
|
303
|
-
}, [children, container?.current]);
|
|
304
|
-
// 清除定时器
|
|
305
|
-
const stopAutoPlay = () => {
|
|
306
|
-
clearTimeout(_swiper.current.autoplayTimer);
|
|
307
|
-
_swiper.current.autoplayTimer = null;
|
|
308
|
-
};
|
|
309
|
-
// 定时轮播
|
|
310
|
-
const autoplay = () => {
|
|
311
|
-
if (childCount <= 1)
|
|
312
|
-
return;
|
|
313
|
-
stopAutoPlay();
|
|
314
|
-
_swiper.current.autoplayTimer = setTimeout(() => {
|
|
315
|
-
next();
|
|
316
|
-
autoplay();
|
|
317
|
-
}, Number(standTime) + 100 * speed);
|
|
318
|
-
};
|
|
319
|
-
// 切换方法
|
|
320
|
-
const move = ({ pace = 0, offset = 0 }) => {
|
|
321
|
-
if (childCount <= 1)
|
|
322
|
-
return;
|
|
323
|
-
const targetActive = getActive(pace);
|
|
324
|
-
// 父级容器偏移量
|
|
325
|
-
const targetOffset = getOffset(targetActive, offset);
|
|
326
|
-
// 如果循环,调整开头结尾图片位置
|
|
327
|
-
if (Array.isArray(children) && children[0] && targetOffset !== minOffset) {
|
|
328
|
-
const rightBound = targetOffset < minOffset;
|
|
329
|
-
childOffset[0] = rightBound ? trackSize : 0;
|
|
330
|
-
}
|
|
331
|
-
if (Array.isArray(children) &&
|
|
332
|
-
children[childCount - 1] &&
|
|
333
|
-
targetOffset !== 0) {
|
|
334
|
-
const leftBound = targetOffset > 0;
|
|
335
|
-
childOffset[childCount - 1] = leftBound ? -trackSize : 0;
|
|
336
|
-
}
|
|
337
|
-
setChildOffset(childOffset);
|
|
338
|
-
active = targetActive;
|
|
339
|
-
setOffset(targetOffset);
|
|
340
|
-
getStyle(targetOffset);
|
|
341
|
-
};
|
|
342
|
-
// 下一页
|
|
343
|
-
const next = () => {
|
|
344
|
-
resettPosition();
|
|
345
|
-
requestFrame(() => {
|
|
346
|
-
requestFrame(() => {
|
|
347
|
-
_swiper.current.moving = false;
|
|
348
|
-
move({
|
|
349
|
-
pace: 1,
|
|
350
|
-
});
|
|
351
|
-
});
|
|
352
|
-
});
|
|
353
|
-
};
|
|
354
|
-
const handleItemClick = (event, value) => {
|
|
355
|
-
onClickItem && onClickItem(event, value);
|
|
356
|
-
};
|
|
357
|
-
const getStyle = (moveOffset = offset) => {
|
|
358
|
-
const target = innerRef.current;
|
|
359
|
-
let _offset = 0;
|
|
360
|
-
// 容器高度-元素高度
|
|
361
|
-
const val = rect.height - height;
|
|
362
|
-
_offset = moveOffset + Number(active === childCount - 1 && val / 2);
|
|
363
|
-
target.style.transitionDuration = `${_swiper.current.moving ? 0 : standTime}ms`;
|
|
364
|
-
target.style.height = `${Number(height) * childCount}px`;
|
|
365
|
-
target.style.transform = `translate3D(0,${_offset}px,0)`;
|
|
366
|
-
};
|
|
367
|
-
// 无缝滚动第一个元素位移控制
|
|
368
|
-
const itemStyle = (index) => {
|
|
369
|
-
const style = {};
|
|
370
|
-
if (height) {
|
|
371
|
-
style.height = `${height}px`;
|
|
372
|
-
style.lineHeight = `${height}px`;
|
|
373
|
-
}
|
|
374
|
-
const offset = childOffset[index];
|
|
375
|
-
if (offset) {
|
|
376
|
-
style.transform = `translate3D(0,${offset}px,0)`;
|
|
377
|
-
}
|
|
378
|
-
return style;
|
|
379
|
-
};
|
|
380
|
-
// 确定当前active 元素
|
|
381
|
-
const getActive = (pace) => {
|
|
382
|
-
if (pace) {
|
|
383
|
-
const _active = active + pace;
|
|
384
|
-
return range(_active, -1, childCount);
|
|
385
|
-
}
|
|
386
|
-
return active;
|
|
387
|
-
};
|
|
388
|
-
// 计算位移
|
|
389
|
-
const getOffset = (active, offset = 0) => {
|
|
390
|
-
const currentPosition = active * Number(height);
|
|
391
|
-
const targetOffset = offset - currentPosition;
|
|
392
|
-
return targetOffset;
|
|
393
|
-
};
|
|
394
|
-
// 浏览器 帧 事件
|
|
395
|
-
const requestFrame = (fn) => {
|
|
396
|
-
window.requestAnimationFrame.call(window, fn);
|
|
397
|
-
};
|
|
398
|
-
// 取值 方法
|
|
399
|
-
const range = (num, min, max) => {
|
|
400
|
-
return Math.min(Math.max(num, min), max);
|
|
401
|
-
};
|
|
402
|
-
// 重置首尾位置信息
|
|
403
|
-
const resettPosition = () => {
|
|
404
|
-
_swiper.current.moving = true;
|
|
405
|
-
if (active <= -1) {
|
|
406
|
-
move({ pace: childCount });
|
|
407
|
-
}
|
|
408
|
-
if (active >= childCount) {
|
|
409
|
-
move({ pace: -childCount });
|
|
410
|
-
}
|
|
411
|
-
};
|
|
412
|
-
useEffect(() => {
|
|
413
|
-
return () => {
|
|
414
|
-
stopAutoPlay();
|
|
415
|
-
};
|
|
416
|
-
}, []);
|
|
417
|
-
return (React__default.createElement("div", { className: `${b()} ${className || ''}`, style: style },
|
|
418
|
-
showNoticeBar && direction === 'across' ? (React__default.createElement("div", { className: noticebarClass, style: barStyle, onClick: handleClick },
|
|
419
|
-
iconShow() ? (React__default.createElement("div", { className: "left-icon", style: { backgroundImage: `url(${iconBg() || ''})` } }, !iconBg() ? (React__default.createElement(Icon, { classPrefix: iconClassPrefix, fontClassName: iconFontClassName, name: "notice", size: "16", color: color })) : null)) : null,
|
|
420
|
-
React__default.createElement("div", { ref: wrap, className: "wrap" },
|
|
421
|
-
React__default.createElement("div", { ref: content, className: `content ${animationClass} ${isEllipsis() ? 'nut-ellipsis' : ''}`, style: contentStyle, onAnimationEnd: onAnimationEnd },
|
|
422
|
-
children,
|
|
423
|
-
text)),
|
|
424
|
-
closeMode || rightIcon ? (React__default.createElement("div", { className: "right-icon", onClick: onClickIcon },
|
|
425
|
-
React__default.createElement(Icon, { classPrefix: iconClassPrefix, fontClassName: iconFontClassName, name: rightIcon || 'close', color: color }))) : null)) : null,
|
|
426
|
-
showNoticeBar && scrollList.current.length > 0 && isVertical ? (React__default.createElement("div", { className: "nut-noticebar-vertical", style: barStyle, ref: container, onClick: handleClick },
|
|
427
|
-
iconShow() ? (React__default.createElement("div", { className: "left-icon", style: { backgroundImage: `url(${iconBg() || ''})` } }, !iconBg() ? (React__default.createElement(Icon, { classPrefix: iconClassPrefix, fontClassName: iconFontClassName, name: "notice", size: "16", color: color })) : null)) : null,
|
|
428
|
-
children ? (React__default.createElement(React__default.Fragment, null,
|
|
429
|
-
React__default.createElement("div", { className: "nut-noticebar__inner", ref: innerRef }, scrollList.current.map((item, index) => {
|
|
430
|
-
return (React__default.createElement("div", { className: "scroll-inner ", style: itemStyle(index), key: index, onClick: (e) => {
|
|
431
|
-
handleItemClick(e, item);
|
|
432
|
-
} }, item));
|
|
433
|
-
})))) : (React__default.createElement("div", { className: "horseLamp_list", style: horseLampStyle }, scrollList.current.map((item, index) => {
|
|
434
|
-
return (
|
|
435
|
-
// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
|
|
436
|
-
React__default.createElement("div", { className: "horseLamp_list_item", style: { height }, key: index, onClick: (e) => {
|
|
437
|
-
handleItemClick(e, item);
|
|
438
|
-
} }, item));
|
|
439
|
-
}))),
|
|
440
|
-
React__default.createElement("div", { className: "go", onClick: (e) => {
|
|
441
|
-
handleClickIcon(e);
|
|
442
|
-
} }, rightIcon ||
|
|
443
|
-
(closeMode ? (React__default.createElement(Icon, { classPrefix: iconClassPrefix, fontClassName: iconFontClassName, name: rightIcon || 'close', color: color, size: "11px" })) : null)))) : null));
|
|
444
|
-
};
|
|
445
|
-
NoticeBar.defaultProps = defaultProps;
|
|
446
|
-
NoticeBar.displayName = 'NutNoticeBar';
|
|
447
|
-
|
|
448
|
-
export { NoticeBar as N };
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import React__default, { useState, useEffect } from 'react';
|
|
2
|
-
import classNames from 'classnames';
|
|
3
|
-
import { CSSTransition } from 'react-transition-group';
|
|
4
|
-
import { c as cn } from './bem-350c1702.js';
|
|
5
|
-
|
|
6
|
-
const defaultProps = {
|
|
7
|
-
id: '',
|
|
8
|
-
msg: '',
|
|
9
|
-
color: '',
|
|
10
|
-
duration: 3000,
|
|
11
|
-
type: 'danger',
|
|
12
|
-
className: '',
|
|
13
|
-
background: '',
|
|
14
|
-
position: 'top',
|
|
15
|
-
isWrapTeleport: true,
|
|
16
|
-
visible: false,
|
|
17
|
-
onClosed: () => { },
|
|
18
|
-
onClick: () => { },
|
|
19
|
-
};
|
|
20
|
-
const Notify = (props) => {
|
|
21
|
-
const { id, children, style, msg, color, background, type, className, position, isWrapTeleport, visible, duration, onClosed, onClick, ...rest } = { ...defaultProps, ...props };
|
|
22
|
-
let timer;
|
|
23
|
-
const [showNotify, SetShow] = useState(false);
|
|
24
|
-
useEffect(() => {
|
|
25
|
-
if (visible) {
|
|
26
|
-
SetShow(true);
|
|
27
|
-
show();
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
hide();
|
|
31
|
-
}
|
|
32
|
-
}, [visible]);
|
|
33
|
-
const clickHandle = () => {
|
|
34
|
-
onClick();
|
|
35
|
-
};
|
|
36
|
-
const show = () => {
|
|
37
|
-
clearTimer();
|
|
38
|
-
if (duration) {
|
|
39
|
-
timer = window.setTimeout(() => {
|
|
40
|
-
hide();
|
|
41
|
-
}, duration);
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
const clearTimer = () => {
|
|
45
|
-
if (timer) {
|
|
46
|
-
clearTimeout(timer);
|
|
47
|
-
timer = null;
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
const hide = () => {
|
|
51
|
-
SetShow(false);
|
|
52
|
-
if (id) {
|
|
53
|
-
const element = document.getElementById(id);
|
|
54
|
-
element && element.parentNode && element.parentNode.removeChild(element);
|
|
55
|
-
}
|
|
56
|
-
onClosed();
|
|
57
|
-
};
|
|
58
|
-
cn('notify');
|
|
59
|
-
const classes = classNames({
|
|
60
|
-
'nut-notify--popup-top': position === 'top',
|
|
61
|
-
'nut-notify--popup-bottom': position === 'bottom',
|
|
62
|
-
'nut-notify': true,
|
|
63
|
-
[`nut-notify--${type}`]: true,
|
|
64
|
-
});
|
|
65
|
-
return (React__default.createElement(React__default.Fragment, null,
|
|
66
|
-
React__default.createElement(CSSTransition, { in: showNotify, timeout: 300, classNames: "fade", unmountOnExit: true, appear: true, position: position, id: id },
|
|
67
|
-
React__default.createElement("div", { className: `${classes} ${className}`, style: {
|
|
68
|
-
color: `${color || ''}`,
|
|
69
|
-
background: `${background || ''}`,
|
|
70
|
-
}, onClick: clickHandle }, children || msg))));
|
|
71
|
-
};
|
|
72
|
-
Notify.defaultProps = defaultProps;
|
|
73
|
-
Notify.displayName = 'NutNotify';
|
|
74
|
-
|
|
75
|
-
export { Notify as N };
|
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
import React__default, { useState, useEffect } from 'react';
|
|
2
|
-
import classNames from 'classnames';
|
|
3
|
-
import { c as cn } from './bem-350c1702.js';
|
|
4
|
-
import { P as Popup } from './popup.taro-01676bff.js';
|
|
5
|
-
import { u as useConfig } from './configprovider.taro-8d71eb49.js';
|
|
6
|
-
|
|
7
|
-
const defaultProps = {
|
|
8
|
-
confirmText: '',
|
|
9
|
-
title: '',
|
|
10
|
-
visible: false,
|
|
11
|
-
overlay: false,
|
|
12
|
-
type: 'default',
|
|
13
|
-
customKey: [],
|
|
14
|
-
className: '',
|
|
15
|
-
randomKeys: false,
|
|
16
|
-
popClass: '',
|
|
17
|
-
onClose: () => { },
|
|
18
|
-
};
|
|
19
|
-
const NumberKeyboard = (props) => {
|
|
20
|
-
const { locale } = useConfig();
|
|
21
|
-
const { title, confirmText, visible, overlay, type, customKey, randomKeys, popClass, style, className, onChange, onDelete, onClose, } = props;
|
|
22
|
-
const b = cn('numberkeyboard');
|
|
23
|
-
const [show, setShow] = useState(visible);
|
|
24
|
-
const [clickKeyIndex, setClickKeyIndex] = useState(undefined);
|
|
25
|
-
const [keysList, setKeysList] = useState([]);
|
|
26
|
-
useEffect(() => {
|
|
27
|
-
setShow(visible);
|
|
28
|
-
}, [visible]);
|
|
29
|
-
const defaultKey = () => {
|
|
30
|
-
let leftBottomKey = {
|
|
31
|
-
id: 'lock',
|
|
32
|
-
type: 'lock',
|
|
33
|
-
};
|
|
34
|
-
if (customKey) {
|
|
35
|
-
const customKeys = Array.isArray(customKey)
|
|
36
|
-
? customKey
|
|
37
|
-
: [customKey];
|
|
38
|
-
if (customKeys.length > 0) {
|
|
39
|
-
const newCustomKey = customKeys[0];
|
|
40
|
-
leftBottomKey = {
|
|
41
|
-
id: newCustomKey,
|
|
42
|
-
type: 'custom',
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
return [
|
|
47
|
-
...getBasicKeys(),
|
|
48
|
-
leftBottomKey,
|
|
49
|
-
{ id: 0, type: 'number' },
|
|
50
|
-
{ id: 'delete', type: 'delete' },
|
|
51
|
-
];
|
|
52
|
-
};
|
|
53
|
-
const getBasicKeys = () => {
|
|
54
|
-
const keys = [];
|
|
55
|
-
for (let i = 1; i <= 9; i++) {
|
|
56
|
-
keys.push({ id: i, type: 'number' });
|
|
57
|
-
}
|
|
58
|
-
if (randomKeys) {
|
|
59
|
-
return keys.sort(() => (Math.random() > 0.5 ? 1 : -1));
|
|
60
|
-
}
|
|
61
|
-
return keys;
|
|
62
|
-
};
|
|
63
|
-
const genCustomKeys = () => {
|
|
64
|
-
const keys = getBasicKeys();
|
|
65
|
-
if (!customKey)
|
|
66
|
-
return [];
|
|
67
|
-
let customKeys = Array.isArray(customKey) ? customKey : [customKey];
|
|
68
|
-
if (customKeys.length > 2) {
|
|
69
|
-
customKeys = [customKeys[0], customKeys[1]];
|
|
70
|
-
}
|
|
71
|
-
if (customKeys.length === 2 &&
|
|
72
|
-
props.title &&
|
|
73
|
-
props.type !== 'rightColumn') {
|
|
74
|
-
customKeys = [customKeys[0]];
|
|
75
|
-
}
|
|
76
|
-
if (customKeys.length === 1) {
|
|
77
|
-
if (props.title && props.type !== 'rightColumn') {
|
|
78
|
-
keys.push({ id: customKeys[0], type: 'custom' }, { id: 0, type: 'number' }, { id: 'delete', type: 'delete' });
|
|
79
|
-
}
|
|
80
|
-
else {
|
|
81
|
-
keys.push({ id: 0, type: 'number' }, { id: customKeys[0], type: 'custom' });
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
else if (customKeys.length === 2) {
|
|
85
|
-
keys.push({ id: customKeys[0], type: 'custom' }, { id: 0, type: 'number' }, { id: customKeys[1], type: 'custom' });
|
|
86
|
-
}
|
|
87
|
-
return keys;
|
|
88
|
-
};
|
|
89
|
-
useEffect(() => {
|
|
90
|
-
if (props.type === 'rightColumn' || props.title !== '') {
|
|
91
|
-
setKeysList(genCustomKeys());
|
|
92
|
-
}
|
|
93
|
-
else {
|
|
94
|
-
setKeysList(defaultKey());
|
|
95
|
-
}
|
|
96
|
-
}, []);
|
|
97
|
-
const onTouchstart = (item, event) => {
|
|
98
|
-
event.stopPropagation();
|
|
99
|
-
setClickKeyIndex(item.id);
|
|
100
|
-
if (item.type === 'number' || item.type === 'custom') {
|
|
101
|
-
onChange && onChange(item.id);
|
|
102
|
-
}
|
|
103
|
-
if (item.type === 'lock') {
|
|
104
|
-
onClose && onClose();
|
|
105
|
-
}
|
|
106
|
-
if (item.type === 'delete') {
|
|
107
|
-
onDelete && onDelete();
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
|
-
const onTouchMove = (event) => {
|
|
111
|
-
event.stopPropagation();
|
|
112
|
-
};
|
|
113
|
-
const onTouchEnd = (event) => {
|
|
114
|
-
event.preventDefault();
|
|
115
|
-
setClickKeyIndex(undefined);
|
|
116
|
-
};
|
|
117
|
-
return (React__default.createElement("div", null,
|
|
118
|
-
React__default.createElement(Popup, { visible: show, overlay: overlay, position: "bottom", popClass: popClass, onClickOverlay: onClose, onClickCloseIcon: onClose, overlayStyle: { backgroundColor: 'rgba(0, 0, 0, 0)' } },
|
|
119
|
-
React__default.createElement("div", { className: `${b()} ${className}`, style: { ...style } },
|
|
120
|
-
title ? (React__default.createElement("div", { className: b('header') },
|
|
121
|
-
React__default.createElement("h3", { className: b('header__tit') }, title),
|
|
122
|
-
type === 'default' ? (React__default.createElement("span", { className: b('header__close'), onClick: onClose }, locale.done)) : null)) : null,
|
|
123
|
-
React__default.createElement("div", { className: b('body') },
|
|
124
|
-
React__default.createElement("div", { className: b('body__keys') }, keysList?.map((item, index) => {
|
|
125
|
-
return (React__default.createElement("div", { key: index, className: classNames({
|
|
126
|
-
'key-board-wrapper': true,
|
|
127
|
-
'key-board-wrapper-large': item.id === 0 &&
|
|
128
|
-
type === 'rightColumn' &&
|
|
129
|
-
Array.isArray(customKey) &&
|
|
130
|
-
customKey.length === 1,
|
|
131
|
-
}) },
|
|
132
|
-
React__default.createElement("div", { className: classNames({
|
|
133
|
-
key: true,
|
|
134
|
-
active: item.id === clickKeyIndex,
|
|
135
|
-
lock: item.type === 'lock',
|
|
136
|
-
delete: item.type === 'delete',
|
|
137
|
-
}), onTouchStart: (event) => onTouchstart(item, event), onTouchMove: onTouchMove, onTouchEnd: onTouchEnd },
|
|
138
|
-
item.type === 'number' || item.type === 'custom' ? (React__default.createElement("div", null, item.id)) : null,
|
|
139
|
-
item.type === 'lock' ? (React__default.createElement("img", { src: "https://img11.360buyimg.com/imagetools/jfs/t1/146371/38/8485/738/5f606425Eca239740/14f4b4f5f20d8a68.png", alt: "" })) : null,
|
|
140
|
-
item.type === 'delete' ? (React__default.createElement("img", { src: "https://img11.360buyimg.com/imagetools/jfs/t1/129395/8/12735/2030/5f61ac37E70cab338/fb477dc11f46056c.png", alt: "" })) : null)));
|
|
141
|
-
})),
|
|
142
|
-
type === 'rightColumn' ? (React__default.createElement("div", { className: b('sidebar') },
|
|
143
|
-
React__default.createElement("div", { className: "key-board-wrapper" },
|
|
144
|
-
React__default.createElement("div", { className: classNames({
|
|
145
|
-
key: true,
|
|
146
|
-
active: clickKeyIndex === 'delete',
|
|
147
|
-
}), onTouchStart: (event) => onTouchstart({ id: 'delete', type: 'delete' }, event), onTouchMove: onTouchMove, onTouchEnd: onTouchEnd },
|
|
148
|
-
React__default.createElement("img", { src: "https://img11.360buyimg.com/imagetools/jfs/t1/129395/8/12735/2030/5f61ac37E70cab338/fb477dc11f46056c.png", alt: "" }))),
|
|
149
|
-
React__default.createElement("div", { className: "key-board-wrapper key-board-finish", onClick: onClose },
|
|
150
|
-
React__default.createElement("div", { className: classNames({
|
|
151
|
-
key: true,
|
|
152
|
-
finish: true,
|
|
153
|
-
activeFinsh: clickKeyIndex === 'finish',
|
|
154
|
-
}) }, confirmText || locale.done)))) : null)))));
|
|
155
|
-
};
|
|
156
|
-
NumberKeyboard.defaultProps = defaultProps;
|
|
157
|
-
NumberKeyboard.displayName = 'NutNumberKeyboard';
|
|
158
|
-
|
|
159
|
-
export { NumberKeyboard as N };
|