@nutui/nutui-react-taro 1.5.2 → 1.5.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 +0 -1
- package/dist/esm/ActionSheet.js +14 -90
- package/dist/esm/Address.js +21 -620
- package/dist/esm/Animate.js +7 -53
- package/dist/esm/AnimatingNumbers.js +7 -125
- package/dist/esm/Audio.js +19 -264
- package/dist/esm/Avatar.js +11 -130
- package/dist/esm/{AvatarContext-15733596.js → AvatarContext-c96afdcc.js} +3 -1
- package/dist/esm/AvatarGroup.js +11 -41
- package/dist/esm/BackTop.js +10 -138
- package/dist/esm/Badge.js +9 -71
- package/dist/esm/Barrage.js +8 -97
- package/dist/esm/Button.js +9 -108
- package/dist/esm/Calendar.js +20 -128
- package/dist/esm/CalendarItem.js +12 -674
- package/dist/esm/Card.js +11 -61
- package/dist/esm/Cascader.js +16 -671
- package/dist/esm/Cell.js +9 -101
- package/dist/esm/CellGroup.js +5 -2
- package/dist/esm/Checkbox.js +7 -5
- package/dist/esm/CheckboxGroup.js +8 -111
- package/dist/esm/CircleProgress.js +8 -114
- package/dist/esm/Col.js +7 -57
- package/dist/esm/Collapse.js +7 -97
- package/dist/esm/CollapseItem.js +8 -146
- package/dist/esm/ConfigProvider.js +8 -187
- package/dist/esm/CountDown.js +9 -247
- package/dist/esm/DatePicker.js +25 -309
- package/dist/esm/Dialog.js +17 -296
- package/dist/esm/Divider.js +7 -34
- package/dist/esm/Drag.js +7 -118
- package/dist/esm/Elevator.js +8 -234
- package/dist/esm/Ellipsis.js +10 -176
- package/dist/esm/Empty.js +8 -79
- package/dist/esm/FixedNav.js +14 -103
- package/dist/esm/Form.js +10 -215
- package/dist/esm/FormItem.js +10 -3
- package/dist/esm/Grid.js +11 -81
- package/dist/esm/GridItem.js +13 -123
- package/dist/esm/Icon.js +5 -2
- package/dist/esm/Image.js +11 -169
- package/dist/esm/ImagePreview.js +19 -225
- package/dist/esm/Indicator.js +7 -50
- package/dist/esm/Infiniteloading.js +14 -215
- package/dist/esm/Input.js +12 -362
- package/dist/esm/InputNumber.js +9 -275
- package/dist/esm/Layout.js +5 -13
- package/dist/esm/Menu.js +10 -153
- package/dist/esm/MenuItem.js +15 -175
- package/dist/esm/NavBar.js +9 -114
- package/dist/esm/NoticeBar.js +10 -568
- package/dist/esm/Notify.js +8 -234
- package/dist/esm/NumberKeyboard.js +17 -247
- package/dist/esm/Overlay.js +6 -2
- package/dist/esm/Pagination.js +9 -168
- package/dist/esm/Picker.js +22 -494
- package/dist/esm/Popover.js +12 -223
- package/dist/esm/Popup.js +13 -193
- package/dist/esm/Price.js +6 -84
- package/dist/esm/Progress.js +9 -122
- package/dist/esm/PullToRefresh.js +13 -276
- package/dist/esm/Radio.js +8 -4
- package/dist/esm/RadioGroup.js +7 -120
- package/dist/esm/Range.js +15 -406
- package/dist/esm/Rate.js +9 -121
- package/dist/esm/Row.js +7 -49
- package/dist/esm/SearchBar.js +12 -235
- package/dist/esm/ShortPassword.js +17 -191
- package/dist/esm/SideNavBar.js +19 -57
- package/dist/esm/SideNavBarItem.js +5 -24
- package/dist/esm/Signature.js +13 -153
- package/dist/esm/Skeleton.js +12 -98
- package/dist/esm/Step.js +10 -87
- package/dist/esm/Steps.js +8 -38
- package/dist/esm/Sticky.js +11 -190
- package/dist/esm/SubSideNavBar.js +6 -78
- package/dist/esm/Swipe.js +10 -230
- package/dist/esm/Swiper.js +9 -490
- package/dist/esm/SwiperItem.js +8 -36
- package/dist/esm/Switch.js +6 -71
- package/dist/esm/TabPane.js +5 -2
- package/dist/esm/Tabbar.js +6 -68
- package/dist/esm/TabbarItem.js +9 -78
- package/dist/esm/Table.js +12 -140
- package/dist/esm/Tabs.js +8 -5
- package/dist/esm/Tag.js +10 -110
- package/dist/esm/TextArea.js +9 -148
- package/dist/esm/TimeDetail.js +9 -67
- package/dist/esm/TimePannel.js +9 -29
- package/dist/esm/TimeSelect.js +19 -171
- package/dist/esm/Toast.js +7 -268
- package/dist/esm/TrendArrow.js +7 -99
- package/dist/esm/Uploader.js +17 -566
- package/dist/esm/{UserContext-101ad4a4.js → UserContext-0aac9a82.js} +3 -1
- package/dist/esm/{UserContext-2629d479.js → UserContext-e402e1a6.js} +3 -1
- package/dist/esm/{UserContext-b33bcf21.js → UserContext-e8176108.js} +3 -1
- package/dist/esm/Video.js +7 -90
- package/dist/esm/VirtualList.js +9 -313
- package/dist/esm/WaterMark.js +11 -111
- package/dist/esm/actionsheet.taro-e6a51446.js +53 -0
- package/dist/esm/address.taro-3a9b6396.js +461 -0
- package/dist/esm/animate.taro-fb7986d6.js +40 -0
- package/dist/esm/animatingnumbers.taro-03e5d61d.js +104 -0
- package/dist/esm/audio.taro-87ec8bf2.js +161 -0
- package/dist/esm/avatar.taro-3676f38f.js +103 -0
- package/dist/esm/avatargroup-f3574510.js +34 -0
- package/dist/esm/backtop.taro-66394a36.js +48 -0
- package/dist/esm/badge.taro-a4e59c11.js +52 -0
- package/dist/esm/barrage.taro-0495a1b2.js +94 -0
- package/dist/esm/{bem-3b438e61.js → bem-350c1702.js} +3 -6
- package/dist/esm/button.taro-9244d065.js +100 -0
- package/dist/esm/calendar.taro-670842ea.js +65 -0
- package/dist/esm/calendaritem.taro-2a603571.js +787 -0
- package/dist/esm/can-use-dom-3eeb5af4.js +6 -0
- package/dist/esm/card.taro-e4c76dad.js +33 -0
- package/dist/esm/cascader.taro-eb1fb011.js +438 -0
- package/dist/esm/cell.taro-a10a74d3.js +64 -0
- package/dist/esm/cellgroup.taro-abe501bc.js +25 -0
- package/dist/esm/checkbox.taro-6120e3e3.js +171 -0
- package/dist/esm/circleprogress.taro-79854448.js +109 -0
- package/dist/esm/col.taro-53eed3cc.js +41 -0
- package/dist/esm/collapse.taro-1a9e4ba2.js +83 -0
- package/dist/esm/collapseitem-4d0bc55d.js +83 -0
- package/dist/esm/configprovider-67d19d3a.js +19 -0
- package/dist/esm/configprovider.taro-8d71eb49.js +42 -0
- package/dist/esm/countdown.taro-5b17c607.js +226 -0
- package/dist/esm/datepicker.taro-6e9b4b8f.js +275 -0
- package/dist/esm/dialog.taro-a3267d29.js +118 -0
- package/dist/esm/divider.taro-26d1d8b4.js +35 -0
- package/dist/esm/drag.taro-79bb8744.js +110 -0
- package/dist/esm/elevator.taro-6019669e.js +178 -0
- package/dist/esm/ellipsis.taro-f15f26da.js +241 -0
- package/dist/esm/empty.taro-04ae4389.js +62 -0
- package/dist/esm/fixednav.taro-1f05acaf.js +53 -0
- package/dist/esm/form.taro-0c8e7a39.js +179 -0
- package/dist/esm/formitem.taro-190a3326.js +89 -0
- package/dist/esm/get-scroll-parent-b4a07e65.js +25 -0
- package/dist/esm/grid.taro-3503b82c.js +61 -0
- package/dist/esm/{grid.context-2ee27d95.js → grid.taro.context-c2bbfb4f.js} +4 -2
- package/dist/esm/griditem.taro-cdb3f119.js +98 -0
- package/dist/esm/icon-296a1bec.js +63 -0
- package/dist/esm/icon.taro-296a1bec.js +63 -0
- package/dist/esm/image.taro-142cf512.js +64 -0
- package/dist/esm/imagepreview.taro-c50bb0a3.js +167 -0
- package/dist/esm/index-5bcb0ff8.js +7 -0
- package/dist/esm/indicator.taro-cba8b010.js +37 -0
- package/dist/esm/infiniteloading.taro-183bccbf.js +144 -0
- package/dist/esm/input.taro-97af6c96.js +240 -0
- package/dist/esm/inputnumber.taro-91f65d17.js +130 -0
- package/dist/esm/layout.taro-9046d093.js +11 -0
- package/dist/esm/menu.taro-7e4038a1.js +99 -0
- package/dist/esm/menuitem.taro-96cc4f15.js +130 -0
- package/dist/esm/navbar.taro-777c4705.js +79 -0
- package/dist/esm/noticebar.taro-4a23cdee.js +448 -0
- package/dist/esm/notify.taro-e17c6f82.js +75 -0
- package/dist/esm/numberkeyboard.taro-1bc24744.js +159 -0
- package/dist/esm/nutui-react.es.js +119 -94
- package/dist/esm/offsetContext-c2a746fa.js +5 -0
- package/dist/esm/overlay.taro-21e87fb1.js +69 -0
- package/dist/esm/pagination.taro-715a173b.js +124 -0
- package/dist/esm/picker.taro-9ad1b7c5.js +473 -0
- package/dist/esm/popover.taro-ad5e76ea.js +156 -0
- package/dist/esm/popup.taro-01676bff.js +137 -0
- package/dist/esm/price.taro-776ed16e.js +83 -0
- package/dist/esm/progress.taro-f0ce38e9.js +90 -0
- package/dist/esm/pulltorefresh.taro-a294f656.js +181 -0
- package/dist/esm/radio.taro-a6eff96c.js +168 -0
- package/dist/esm/range.taro-d8fc7656.js +332 -0
- package/dist/esm/rate.taro-6cdf03bd.js +75 -0
- package/dist/esm/row.taro-f64d4a13.js +46 -0
- package/dist/esm/searchbar.taro-0c25927b.js +152 -0
- package/dist/esm/shortpassword.taro-9ee034f7.js +111 -0
- package/dist/esm/sidenavbar.taro-c307b35e.js +35 -0
- package/dist/esm/sidenavbaritem.taro-5a7965d0.js +12 -0
- package/dist/esm/signature.taro-ec4e713b.js +143 -0
- package/dist/esm/skeleton.taro-76faf63f.js +62 -0
- package/dist/esm/step.taro-b7903e8c.js +59 -0
- package/dist/esm/steps.taro-c82d2252.js +30 -0
- package/dist/esm/sticky.taro-218bda37.js +138 -0
- package/dist/esm/subsidenavbar.taro-69cb9752.js +63 -0
- package/dist/esm/supports-passive-c85ef996.js +18 -0
- package/dist/esm/swipe.taro-ea35f07f.js +177 -0
- package/dist/esm/swiper.taro-7a94e211.js +451 -0
- package/dist/esm/swiperitem-c9e3d0d5.js +29 -0
- package/dist/esm/switch.taro-34ca8228.js +50 -0
- package/dist/esm/tabbar.taro-9acfc2fa.js +59 -0
- package/dist/esm/tabbaritem.taro-bf517487.js +58 -0
- package/dist/esm/table.taro-91fc0c01.js +93 -0
- package/dist/esm/tabpane.taro-4ca340ef.js +23 -0
- package/dist/esm/tabs.taro-6a7524a4.js +140 -0
- package/dist/esm/tag.taro-23ba0834.js +92 -0
- package/dist/esm/textarea.taro-442e7350.js +94 -0
- package/dist/esm/timedetail.taro-5b2f2269.js +44 -0
- package/dist/esm/timepannel.taro-d6e40180.js +22 -0
- package/dist/esm/timeselect.taro-a07036f4.js +133 -0
- package/dist/esm/toast.taro-d6c14811.js +109 -0
- package/dist/esm/trendarrow.taro-b8c5ccd9.js +73 -0
- package/dist/esm/typings-b9828dba.js +9 -0
- package/dist/esm/uploader.taro-587e6bf3.js +492 -0
- package/dist/esm/useClientRect-1f8ed1fe.js +18 -0
- package/dist/esm/useTouch-db24bb5c.js +69 -0
- package/dist/esm/video-f1be8a91.js +67 -0
- package/dist/esm/virtuallist.taro-f0b0270d.js +214 -0
- package/dist/esm/watermark.taro-9ce2ae37.js +114 -0
- package/dist/esm/zh-CN-c779e6c1.js +131 -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 +13030 -14863
- package/dist/nutui.react.umd.js +13029 -14864
- package/dist/style.mjs +1 -1
- package/dist/types/index.d.ts +176 -183
- package/package.json +1 -1
- package/dist/esm/cellgroup-fcc72767.js +0 -34
- package/dist/esm/checkbox-44e13cd0.js +0 -137
- package/dist/esm/date-c7aad4c0.js +0 -97
- package/dist/esm/formitem-8a73a5fb.js +0 -157
- package/dist/esm/get-scroll-parent-5f85dee8.js +0 -24
- package/dist/esm/icon-4ef1581c.js +0 -70
- package/dist/esm/index-030b7245.js +0 -11
- package/dist/esm/offsetContext-3ab00d40.js +0 -16
- package/dist/esm/overlay-de6c79d5.js +0 -83
- package/dist/esm/radio-9f141e6b.js +0 -118
- package/dist/esm/render-bbebb760.js +0 -79
- package/dist/esm/tabpane-01075e6c.js +0 -29
- package/dist/esm/tabs-e1b4e4b1.js +0 -181
- package/dist/esm/typings-f27b58f4.js +0 -8
- package/dist/esm/useClientRect-56bb675b.js +0 -39
- package/dist/esm/useTouch-cf73a407.js +0 -99
package/dist/esm/SearchBar.js
CHANGED
|
@@ -1,237 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import React__default, { useRef, useState, useEffect } from 'react';
|
|
6
|
-
import { c as cn } from './bem-3b438e61.js';
|
|
7
|
-
import { useConfig } from './ConfigProvider.js';
|
|
8
|
-
import Icon from './Icon.js';
|
|
9
|
-
import { C as ComponentDefaults } from './typings-f27b58f4.js';
|
|
1
|
+
import { S as SearchBar } from './searchbar.taro-0c25927b.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
import '@tarojs/taro';
|
|
4
|
+
import './bem-350c1702.js';
|
|
10
5
|
import '@bem-react/classname';
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
readonly: true,
|
|
20
|
-
autoFocus: false,
|
|
21
|
-
label: '',
|
|
22
|
-
leftinIcon: React__default.createElement(Icon, {
|
|
23
|
-
name: "search",
|
|
24
|
-
size: "12"
|
|
25
|
-
})
|
|
26
|
-
});
|
|
27
|
-
var SearchBar = function SearchBar(props) {
|
|
28
|
-
var searchbarBem = cn('searchbar');
|
|
29
|
-
var _useConfig = useConfig(),
|
|
30
|
-
locale = _useConfig.locale;
|
|
31
|
-
var searchRef = useRef(null);
|
|
32
|
-
var _useState = useState(function () {
|
|
33
|
-
return props.value;
|
|
34
|
-
}),
|
|
35
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
36
|
-
value = _useState2[0],
|
|
37
|
-
setValue = _useState2[1];
|
|
38
|
-
var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),
|
|
39
|
-
placeholder = _defaultProps$props.placeholder,
|
|
40
|
-
shape = _defaultProps$props.shape,
|
|
41
|
-
className = _defaultProps$props.className,
|
|
42
|
-
disabled = _defaultProps$props.disabled,
|
|
43
|
-
maxLength = _defaultProps$props.maxLength,
|
|
44
|
-
clearable = _defaultProps$props.clearable,
|
|
45
|
-
clearIconSize = _defaultProps$props.clearIconSize,
|
|
46
|
-
align = _defaultProps$props.align,
|
|
47
|
-
readOnly = _defaultProps$props.readOnly,
|
|
48
|
-
autoFocus = _defaultProps$props.autoFocus,
|
|
49
|
-
label = _defaultProps$props.label,
|
|
50
|
-
actionText = _defaultProps$props.actionText,
|
|
51
|
-
leftinIcon = _defaultProps$props.leftinIcon,
|
|
52
|
-
rightinIcon = _defaultProps$props.rightinIcon,
|
|
53
|
-
leftoutIcon = _defaultProps$props.leftoutIcon,
|
|
54
|
-
rightoutIcon = _defaultProps$props.rightoutIcon,
|
|
55
|
-
onChange = _defaultProps$props.onChange,
|
|
56
|
-
onFocus = _defaultProps$props.onFocus,
|
|
57
|
-
onBlur = _defaultProps$props.onBlur,
|
|
58
|
-
onClear = _defaultProps$props.onClear,
|
|
59
|
-
onCancel = _defaultProps$props.onCancel,
|
|
60
|
-
onSearch = _defaultProps$props.onSearch,
|
|
61
|
-
onClickInput = _defaultProps$props.onClickInput,
|
|
62
|
-
onClickLeftinIcon = _defaultProps$props.onClickLeftinIcon,
|
|
63
|
-
onClickLeftoutIcon = _defaultProps$props.onClickLeftoutIcon,
|
|
64
|
-
onClickRightinIcon = _defaultProps$props.onClickRightinIcon,
|
|
65
|
-
onClickRightoutIcon = _defaultProps$props.onClickRightoutIcon,
|
|
66
|
-
iconClassPrefix = _defaultProps$props.iconClassPrefix,
|
|
67
|
-
iconFontClassName = _defaultProps$props.iconFontClassName;
|
|
68
|
-
var alignClass = "".concat(align);
|
|
69
|
-
var forceFocus = function forceFocus() {
|
|
70
|
-
var searchSelf = searchRef.current;
|
|
71
|
-
searchSelf && searchSelf.focus();
|
|
72
|
-
};
|
|
73
|
-
var change = function change(event) {
|
|
74
|
-
var value = event.target.value;
|
|
75
|
-
onChange && (onChange === null || onChange === void 0 ? void 0 : onChange(value, event));
|
|
76
|
-
setValue(value);
|
|
77
|
-
};
|
|
78
|
-
var focus = function focus(event) {
|
|
79
|
-
var value = event.target.value;
|
|
80
|
-
onFocus && (onFocus === null || onFocus === void 0 ? void 0 : onFocus(value, event));
|
|
81
|
-
};
|
|
82
|
-
var blur = function blur(event) {
|
|
83
|
-
var searchSelf = searchRef.current;
|
|
84
|
-
searchSelf && searchSelf.blur();
|
|
85
|
-
var value = event.target.value;
|
|
86
|
-
onBlur && (onBlur === null || onBlur === void 0 ? void 0 : onBlur(value, event));
|
|
87
|
-
};
|
|
88
|
-
useEffect(function () {
|
|
89
|
-
setValue(props.value);
|
|
90
|
-
}, [props.value]);
|
|
91
|
-
useEffect(function () {
|
|
92
|
-
autoFocus && forceFocus();
|
|
93
|
-
}, [autoFocus]);
|
|
94
|
-
var renderField = function renderField() {
|
|
95
|
-
return React__default.createElement("input", {
|
|
96
|
-
className: "".concat(searchbarBem('input'), " ").concat(searchbarBem(alignClass), " ").concat(shape === 'round' ? searchbarBem('round') : '', " ").concat(clearable ? searchbarBem('input-clear') : ''),
|
|
97
|
-
ref: searchRef,
|
|
98
|
-
style: _objectSpread({}, props.style),
|
|
99
|
-
value: value || '',
|
|
100
|
-
placeholder: placeholder || locale.placeholder,
|
|
101
|
-
disabled: disabled,
|
|
102
|
-
readOnly: readOnly,
|
|
103
|
-
maxLength: maxLength,
|
|
104
|
-
onKeyPress: onKeypress,
|
|
105
|
-
onChange: function onChange(e) {
|
|
106
|
-
return change(e);
|
|
107
|
-
},
|
|
108
|
-
onFocus: function onFocus(e) {
|
|
109
|
-
return focus(e);
|
|
110
|
-
},
|
|
111
|
-
onBlur: function onBlur(e) {
|
|
112
|
-
return blur(e);
|
|
113
|
-
},
|
|
114
|
-
onClick: function onClick(e) {
|
|
115
|
-
return clickInput(e);
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
|
-
};
|
|
119
|
-
var clickInput = function clickInput(e) {
|
|
120
|
-
onClickInput && onClickInput(e);
|
|
121
|
-
};
|
|
122
|
-
var renderLeftinIcon = function renderLeftinIcon() {
|
|
123
|
-
if (!leftinIcon) return null;
|
|
124
|
-
return React__default.createElement("div", {
|
|
125
|
-
className: "".concat(searchbarBem('leftin-icon'), " ").concat(searchbarBem('icon')),
|
|
126
|
-
onClick: function onClick(e) {
|
|
127
|
-
return clickLeftIcon('in-left', e);
|
|
128
|
-
}
|
|
129
|
-
}, leftinIcon);
|
|
130
|
-
};
|
|
131
|
-
var renderLeftoutIcon = function renderLeftoutIcon() {
|
|
132
|
-
if (!leftoutIcon) return null;
|
|
133
|
-
return React__default.createElement("div", {
|
|
134
|
-
className: "".concat(searchbarBem('leftout-icon')),
|
|
135
|
-
onClick: function onClick(e) {
|
|
136
|
-
return clickLeftIcon('out-left', e);
|
|
137
|
-
}
|
|
138
|
-
}, leftoutIcon);
|
|
139
|
-
};
|
|
140
|
-
var clickLeftIcon = function clickLeftIcon(flag, event) {
|
|
141
|
-
if (flag === 'in-left') {
|
|
142
|
-
onClickLeftinIcon && onClickLeftinIcon(value, event);
|
|
143
|
-
} else {
|
|
144
|
-
onClickLeftoutIcon && onClickLeftoutIcon(value, event);
|
|
145
|
-
}
|
|
146
|
-
};
|
|
147
|
-
var renderRightinIcon = function renderRightinIcon() {
|
|
148
|
-
if (!rightinIcon) return null;
|
|
149
|
-
return React__default.createElement("div", {
|
|
150
|
-
className: "".concat(searchbarBem('rightin-icon'), " ").concat(searchbarBem('icon')),
|
|
151
|
-
onClick: function onClick(e) {
|
|
152
|
-
return clickRightIcon('in-right', e);
|
|
153
|
-
}
|
|
154
|
-
}, rightinIcon);
|
|
155
|
-
};
|
|
156
|
-
var renderRightoutIcon = function renderRightoutIcon() {
|
|
157
|
-
if (!rightoutIcon) return null;
|
|
158
|
-
return React__default.createElement("div", {
|
|
159
|
-
className: "".concat(searchbarBem('rightout-icon')),
|
|
160
|
-
onClick: function onClick(e) {
|
|
161
|
-
return clickRightIcon('out-right', e);
|
|
162
|
-
}
|
|
163
|
-
}, rightoutIcon);
|
|
164
|
-
};
|
|
165
|
-
var clickRightIcon = function clickRightIcon(flag, event) {
|
|
166
|
-
if (flag === 'in-left') {
|
|
167
|
-
onClickRightinIcon && onClickRightinIcon(value, event);
|
|
168
|
-
} else {
|
|
169
|
-
onClickRightoutIcon && onClickRightoutIcon(value, event);
|
|
170
|
-
}
|
|
171
|
-
};
|
|
172
|
-
var handleClear = function handleClear() {
|
|
173
|
-
return React__default.createElement("div", {
|
|
174
|
-
className: "".concat(searchbarBem('clear'), " ").concat(rightinIcon ? 'pos-right' : ''),
|
|
175
|
-
onClick: function onClick(e) {
|
|
176
|
-
return clearaVal(e);
|
|
177
|
-
}
|
|
178
|
-
}, React__default.createElement(Icon, {
|
|
179
|
-
classPrefix: iconClassPrefix,
|
|
180
|
-
fontClassName: iconFontClassName,
|
|
181
|
-
name: "circle-close",
|
|
182
|
-
size: clearIconSize,
|
|
183
|
-
color: "#555"
|
|
184
|
-
}));
|
|
185
|
-
};
|
|
186
|
-
var clearaVal = function clearaVal(event) {
|
|
187
|
-
if (disabled || readOnly) {
|
|
188
|
-
return;
|
|
189
|
-
}
|
|
190
|
-
setValue('');
|
|
191
|
-
onClear && onClear(event);
|
|
192
|
-
forceFocus();
|
|
193
|
-
};
|
|
194
|
-
var renderRightLabel = function renderRightLabel() {
|
|
195
|
-
if (actionText) {
|
|
196
|
-
return React__default.createElement("div", {
|
|
197
|
-
className: searchbarBem('action-text'),
|
|
198
|
-
onClick: search
|
|
199
|
-
}, actionText);
|
|
200
|
-
}
|
|
201
|
-
return null;
|
|
202
|
-
};
|
|
203
|
-
var onKeypress = function onKeypress(e) {
|
|
204
|
-
if (e.key === 'Enter') {
|
|
205
|
-
var event = e.nativeEvent;
|
|
206
|
-
if (typeof event.cancelable !== 'boolean' || event.cancelable) {
|
|
207
|
-
event.preventDefault();
|
|
208
|
-
}
|
|
209
|
-
onSearch && onSearch(value);
|
|
210
|
-
}
|
|
211
|
-
};
|
|
212
|
-
var search = function search() {
|
|
213
|
-
onSearch && onSearch(value);
|
|
214
|
-
};
|
|
215
|
-
var renderLabel = function renderLabel() {
|
|
216
|
-
if (label) {
|
|
217
|
-
return React__default.createElement("div", {
|
|
218
|
-
className: searchbarBem('label')
|
|
219
|
-
}, label);
|
|
220
|
-
}
|
|
221
|
-
return null;
|
|
222
|
-
};
|
|
223
|
-
return React__default.createElement("div", {
|
|
224
|
-
className: "".concat(searchbarBem(), " ").concat(disabled ? searchbarBem('disabled') : '', " ").concat(className || ''),
|
|
225
|
-
style: _objectSpread(_objectSpread({}, props.style), {}, {
|
|
226
|
-
background: props.background
|
|
227
|
-
})
|
|
228
|
-
}, renderLeftoutIcon(), renderLabel(), React__default.createElement("div", {
|
|
229
|
-
className: "".concat(searchbarBem('content')),
|
|
230
|
-
style: {
|
|
231
|
-
background: props.inputBackground
|
|
232
|
-
}
|
|
233
|
-
}, renderLeftinIcon(), renderField(), renderRightinIcon(), clearable && value && handleClear()), renderRightoutIcon(), renderRightLabel());
|
|
234
|
-
};
|
|
235
|
-
SearchBar.defaultProps = defaultProps;
|
|
236
|
-
SearchBar.displayName = 'NutSearchBar';
|
|
6
|
+
import './configprovider.taro-8d71eb49.js';
|
|
7
|
+
import 'lodash.kebabcase';
|
|
8
|
+
import './zh-CN-c779e6c1.js';
|
|
9
|
+
import './icon.taro-296a1bec.js';
|
|
10
|
+
import './typings-b9828dba.js';
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
237
14
|
export { SearchBar as default };
|
|
@@ -1,193 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
5
|
-
var _excluded = ["title", "desc", "tips", "visible", "modelValue", "errorMsg", "noButton", "closeOnClickOverlay", "length", "style", "className", "onChange", "onOk", "onTips", "onCancel", "onClose", "onComplete", "iconClassPrefix", "iconFontClassName", "autoFocus"];
|
|
6
|
-
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; }
|
|
7
|
-
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; }
|
|
8
|
-
import React__default, { useRef, useState, useEffect } from 'react';
|
|
9
|
-
import { c as cn } from './bem-3b438e61.js';
|
|
10
|
-
import Popup from './Popup.js';
|
|
11
|
-
import Icon from './Icon.js';
|
|
12
|
-
import { useConfig } from './ConfigProvider.js';
|
|
13
|
-
import { C as ComponentDefaults } from './typings-f27b58f4.js';
|
|
1
|
+
import { S as ShortPassword } from './shortpassword.taro-9ee034f7.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
import './bem-350c1702.js';
|
|
14
4
|
import '@bem-react/classname';
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
onCancel: function onCancel() {},
|
|
30
|
-
onClose: function onClose() {},
|
|
31
|
-
onTips: function onTips() {},
|
|
32
|
-
onComplete: function onComplete(value) {}
|
|
33
|
-
});
|
|
34
|
-
var ShortPassword = function ShortPassword(props) {
|
|
35
|
-
var _useConfig = useConfig(),
|
|
36
|
-
locale = _useConfig.locale;
|
|
37
|
-
var title = props.title,
|
|
38
|
-
desc = props.desc,
|
|
39
|
-
tips = props.tips,
|
|
40
|
-
visible = props.visible,
|
|
41
|
-
modelValue = props.modelValue,
|
|
42
|
-
errorMsg = props.errorMsg,
|
|
43
|
-
noButton = props.noButton,
|
|
44
|
-
closeOnClickOverlay = props.closeOnClickOverlay,
|
|
45
|
-
length = props.length,
|
|
46
|
-
style = props.style,
|
|
47
|
-
className = props.className,
|
|
48
|
-
onChange = props.onChange,
|
|
49
|
-
onOk = props.onOk,
|
|
50
|
-
onTips = props.onTips,
|
|
51
|
-
onCancel = props.onCancel,
|
|
52
|
-
onClose = props.onClose,
|
|
53
|
-
onComplete = props.onComplete,
|
|
54
|
-
iconClassPrefix = props.iconClassPrefix,
|
|
55
|
-
iconFontClassName = props.iconFontClassName,
|
|
56
|
-
autoFocus = props.autoFocus,
|
|
57
|
-
reset = _objectWithoutProperties(props, _excluded);
|
|
58
|
-
var b = cn('shortpassword');
|
|
59
|
-
var textInput = useRef(null);
|
|
60
|
-
var range = function range(val) {
|
|
61
|
-
return Math.min(Math.max(4, val), 6);
|
|
62
|
-
};
|
|
63
|
-
var _useState = useState(visible),
|
|
64
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
65
|
-
innerVisible = _useState2[0],
|
|
66
|
-
setInnerVisible = _useState2[1];
|
|
67
|
-
var _useState3 = useState(range(Number(length))),
|
|
68
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
69
|
-
comLen = _useState4[0],
|
|
70
|
-
setComLen = _useState4[1];
|
|
71
|
-
var _useState5 = useState(''),
|
|
72
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
73
|
-
inputValue = _useState6[0],
|
|
74
|
-
setInputValue = _useState6[1];
|
|
75
|
-
useEffect(function () {
|
|
76
|
-
setInnerVisible(visible);
|
|
77
|
-
}, [visible]);
|
|
78
|
-
useEffect(function () {
|
|
79
|
-
if (typeof modelValue !== 'undefined') {
|
|
80
|
-
setInputValue(modelValue);
|
|
81
|
-
}
|
|
82
|
-
}, [modelValue]);
|
|
83
|
-
var changeValue = function changeValue(e) {
|
|
84
|
-
var inputValue = e.target.value;
|
|
85
|
-
if (String(inputValue).length > comLen) {
|
|
86
|
-
inputValue = inputValue.slice(0, comLen);
|
|
87
|
-
}
|
|
88
|
-
setInputValue(inputValue);
|
|
89
|
-
if (String(inputValue).length === comLen) {
|
|
90
|
-
onComplete && onComplete(inputValue);
|
|
91
|
-
}
|
|
92
|
-
onChange && onChange(inputValue);
|
|
93
|
-
};
|
|
94
|
-
var systemStyle = function systemStyle() {
|
|
95
|
-
var u = navigator.userAgent;
|
|
96
|
-
var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; // g
|
|
97
|
-
var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); // ios终端
|
|
98
|
-
var style = {};
|
|
99
|
-
if (isIOS) {
|
|
100
|
-
style = {
|
|
101
|
-
paddingRight: '1200px'
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
if (isAndroid) {
|
|
105
|
-
style = {
|
|
106
|
-
opacity: 0,
|
|
107
|
-
zIndex: 10
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
return style;
|
|
111
|
-
};
|
|
112
|
-
var focus = function focus() {
|
|
113
|
-
if (textInput.current) {
|
|
114
|
-
textInput.current.focus();
|
|
115
|
-
}
|
|
116
|
-
};
|
|
117
|
-
var sure = function sure() {
|
|
118
|
-
onOk && onOk(inputValue);
|
|
119
|
-
};
|
|
120
|
-
return React__default.createElement("div", null, React__default.createElement(Popup, {
|
|
121
|
-
style: {
|
|
122
|
-
padding: '32px 24px 28px 24px',
|
|
123
|
-
borderRadius: '12px',
|
|
124
|
-
textAlign: 'center'
|
|
125
|
-
},
|
|
126
|
-
visible: innerVisible,
|
|
127
|
-
closeable: true,
|
|
128
|
-
"close-on-click-overlay": closeOnClickOverlay,
|
|
129
|
-
onClickOverlay: onClose,
|
|
130
|
-
onClickCloseIcon: onClose
|
|
131
|
-
}, React__default.createElement("div", _objectSpread({
|
|
132
|
-
className: "".concat(b(), " ").concat(className),
|
|
133
|
-
style: _objectSpread({}, style)
|
|
134
|
-
}, reset), React__default.createElement("div", {
|
|
135
|
-
className: b('title')
|
|
136
|
-
}, title || locale.shortpassword.title), React__default.createElement("div", {
|
|
137
|
-
className: b('subtitle')
|
|
138
|
-
}, desc || locale.shortpassword.desc), React__default.createElement("div", {
|
|
139
|
-
className: b('input')
|
|
140
|
-
}, React__default.createElement("input", {
|
|
141
|
-
ref: textInput,
|
|
142
|
-
className: b('input-real'),
|
|
143
|
-
type: "number",
|
|
144
|
-
style: systemStyle(),
|
|
145
|
-
maxLength: 6,
|
|
146
|
-
value: inputValue,
|
|
147
|
-
autoFocus: autoFocus,
|
|
148
|
-
onChange: function onChange(e) {
|
|
149
|
-
return changeValue(e);
|
|
150
|
-
}
|
|
151
|
-
}), React__default.createElement("div", {
|
|
152
|
-
className: b('input-site')
|
|
153
|
-
}), React__default.createElement("div", {
|
|
154
|
-
className: b('input-fake'),
|
|
155
|
-
onClick: function onClick() {
|
|
156
|
-
return focus();
|
|
157
|
-
}
|
|
158
|
-
}, _toConsumableArray(new Array(comLen).keys()).map(function (item, index) {
|
|
159
|
-
return React__default.createElement("div", {
|
|
160
|
-
className: b('input-fake__li'),
|
|
161
|
-
key: index
|
|
162
|
-
}, String(inputValue).length > index ? React__default.createElement("div", {
|
|
163
|
-
className: b('input-fake__li__icon')
|
|
164
|
-
}) : null);
|
|
165
|
-
}))), React__default.createElement("div", {
|
|
166
|
-
className: b('message')
|
|
167
|
-
}, React__default.createElement("div", {
|
|
168
|
-
className: b('message__error')
|
|
169
|
-
}, errorMsg), tips || locale.shortpassword.tips ? React__default.createElement("div", {
|
|
170
|
-
className: b('message__forget')
|
|
171
|
-
}, React__default.createElement(Icon, {
|
|
172
|
-
classPrefix: iconClassPrefix,
|
|
173
|
-
fontClassName: iconFontClassName,
|
|
174
|
-
className: "icon",
|
|
175
|
-
size: "11px",
|
|
176
|
-
name: "tips"
|
|
177
|
-
}), React__default.createElement("div", {
|
|
178
|
-
onClick: onTips
|
|
179
|
-
}, tips || locale.shortpassword.tips)) : null), !noButton ? React__default.createElement("div", {
|
|
180
|
-
className: b('footer')
|
|
181
|
-
}, React__default.createElement("div", {
|
|
182
|
-
className: b('footer__cancel'),
|
|
183
|
-
onClick: onCancel
|
|
184
|
-
}, locale.cancel), React__default.createElement("div", {
|
|
185
|
-
className: b('footer__sure'),
|
|
186
|
-
onClick: function onClick() {
|
|
187
|
-
return sure();
|
|
188
|
-
}
|
|
189
|
-
}, locale.confirm)) : null)));
|
|
190
|
-
};
|
|
191
|
-
ShortPassword.defaultProps = defaultProps;
|
|
192
|
-
ShortPassword.displayName = 'NutShortPassword';
|
|
5
|
+
import './popup.taro-01676bff.js';
|
|
6
|
+
import 'react-dom';
|
|
7
|
+
import 'react-transition-group';
|
|
8
|
+
import 'classnames';
|
|
9
|
+
import './overlay.taro-21e87fb1.js';
|
|
10
|
+
import '@tarojs/components';
|
|
11
|
+
import './icon.taro-296a1bec.js';
|
|
12
|
+
import './typings-b9828dba.js';
|
|
13
|
+
import './configprovider.taro-8d71eb49.js';
|
|
14
|
+
import 'lodash.kebabcase';
|
|
15
|
+
import './zh-CN-c779e6c1.js';
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
193
19
|
export { ShortPassword as default };
|
package/dist/esm/SideNavBar.js
CHANGED
|
@@ -1,58 +1,20 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
width = _defaultProps$props.width,
|
|
21
|
-
position = _defaultProps$props.position,
|
|
22
|
-
children = _defaultProps$props.children,
|
|
23
|
-
className = _defaultProps$props.className,
|
|
24
|
-
showhead = _defaultProps$props.showhead,
|
|
25
|
-
onClose = _defaultProps$props.onClose,
|
|
26
|
-
rest = _objectWithoutProperties(_defaultProps$props, _excluded);
|
|
27
|
-
var offset = props.offset ? Number(props.offset) : 20;
|
|
28
|
-
return React__default.createElement(Popup, {
|
|
29
|
-
visible: visible,
|
|
30
|
-
style: {
|
|
31
|
-
width: width,
|
|
32
|
-
height: '100%'
|
|
33
|
-
},
|
|
34
|
-
position: position,
|
|
35
|
-
onClose: onClose
|
|
36
|
-
}, React__default.createElement("div", _objectSpread({
|
|
37
|
-
className: className ? "".concat(className, " nut-sidenavbar") : 'nut-sidenavbar'
|
|
38
|
-
}, rest), React__default.createElement("div", {
|
|
39
|
-
className: "nut-sidenavbar__content"
|
|
40
|
-
}, React__default.createElement("div", {
|
|
41
|
-
className: "nut-sidenavbar__list nutShow",
|
|
42
|
-
onClick: handleClick
|
|
43
|
-
}, React__default.createElement("div", {
|
|
44
|
-
className: "nut-sidenavbar__title border-bt ",
|
|
45
|
-
style: {
|
|
46
|
-
paddingLeft: "".concat(offset, "px")
|
|
47
|
-
}
|
|
48
|
-
}, title, " ", React__default.createElement("i", {
|
|
49
|
-
className: "arrow-icon arrow-down"
|
|
50
|
-
})), React__default.createElement(OffsetContext.Provider, {
|
|
51
|
-
value: offset
|
|
52
|
-
}, React__default.createElement("div", {
|
|
53
|
-
className: "nut-sidenavbar__content"
|
|
54
|
-
}, children))))));
|
|
55
|
-
};
|
|
56
|
-
SideNavBar.defaultProps = defaultProps;
|
|
57
|
-
SideNavBar.displayName = 'NutSideNavBar';
|
|
1
|
+
import { S as SideNavBar } from './sidenavbar.taro-c307b35e.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
import './configprovider.taro-8d71eb49.js';
|
|
4
|
+
import 'lodash.kebabcase';
|
|
5
|
+
import './zh-CN-c779e6c1.js';
|
|
6
|
+
import './popup.taro-01676bff.js';
|
|
7
|
+
import 'react-dom';
|
|
8
|
+
import 'react-transition-group';
|
|
9
|
+
import 'classnames';
|
|
10
|
+
import './overlay.taro-21e87fb1.js';
|
|
11
|
+
import './bem-350c1702.js';
|
|
12
|
+
import '@bem-react/classname';
|
|
13
|
+
import '@tarojs/components';
|
|
14
|
+
import './icon.taro-296a1bec.js';
|
|
15
|
+
import './typings-b9828dba.js';
|
|
16
|
+
import './offsetContext-c2a746fa.js';
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
58
20
|
export { SideNavBar as default };
|
|
@@ -1,25 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import React__default from 'react';
|
|
7
|
-
var SideNavBarItem = function SideNavBarItem(props) {
|
|
8
|
-
var title = props.title,
|
|
9
|
-
ikey = props.ikey,
|
|
10
|
-
children = props.children,
|
|
11
|
-
onClick = props.onClick,
|
|
12
|
-
rest = _objectWithoutProperties(props, _excluded);
|
|
13
|
-
var clickFn = function clickFn(e) {
|
|
14
|
-
e.stopPropagation();
|
|
15
|
-
onClick && onClick({
|
|
16
|
-
title: title,
|
|
17
|
-
ikey: ikey
|
|
18
|
-
});
|
|
19
|
-
};
|
|
20
|
-
return React__default.createElement("div", _objectSpread({
|
|
21
|
-
className: "nut-subsidenavbar__item border-bt",
|
|
22
|
-
onClick: clickFn
|
|
23
|
-
}, rest), title);
|
|
24
|
-
};
|
|
1
|
+
import { S as SideNavBarItem } from './sidenavbaritem.taro-5a7965d0.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
25
6
|
export { SideNavBarItem as default };
|