@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/Notify.js
CHANGED
|
@@ -1,236 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
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; }
|
|
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
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
11
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
12
|
-
import * as React from 'react';
|
|
13
|
-
import * as ReactDOM from 'react-dom';
|
|
14
|
-
import classNames from 'classnames';
|
|
15
|
-
import { CSSTransition } from 'react-transition-group';
|
|
16
|
-
import { c as cn } from './bem-3b438e61.js';
|
|
17
|
-
import { r as render } from './render-bbebb760.js';
|
|
1
|
+
import { N as Notify } from './notify.taro-e17c6f82.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
import 'classnames';
|
|
4
|
+
import 'react-transition-group';
|
|
5
|
+
import './bem-350c1702.js';
|
|
18
6
|
import '@bem-react/classname';
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
function Notification(props) {
|
|
23
|
-
var _this;
|
|
24
|
-
_classCallCheck(this, Notification);
|
|
25
|
-
_this = _super.call(this, props);
|
|
26
|
-
_defineProperty(_assertThisInitialized(_this), "closeTimer", void 0);
|
|
27
|
-
_this.close = _this.close.bind(_assertThisInitialized(_this));
|
|
28
|
-
_this.startCloseTimer = _this.startCloseTimer.bind(_assertThisInitialized(_this));
|
|
29
|
-
_this.clearCloseTimer = _this.clearCloseTimer.bind(_assertThisInitialized(_this));
|
|
30
|
-
_this.clickCover = _this.clickCover.bind(_assertThisInitialized(_this));
|
|
31
|
-
_this.state = {
|
|
32
|
-
show: true
|
|
33
|
-
};
|
|
34
|
-
return _this;
|
|
35
|
-
}
|
|
36
|
-
_createClass(Notification, [{
|
|
37
|
-
key: "close",
|
|
38
|
-
value: function close() {
|
|
39
|
-
this.setState({
|
|
40
|
-
show: false
|
|
41
|
-
});
|
|
42
|
-
this.clearCloseTimer();
|
|
43
|
-
if (this.props.id) {
|
|
44
|
-
var element = document.getElementById(this.props.id);
|
|
45
|
-
element && element.parentNode && element.parentNode.removeChild(element);
|
|
46
|
-
}
|
|
47
|
-
this.props.onClosed();
|
|
48
|
-
}
|
|
49
|
-
}, {
|
|
50
|
-
key: "startCloseTimer",
|
|
51
|
-
value: function startCloseTimer() {
|
|
52
|
-
var _this2 = this;
|
|
53
|
-
var duration = this.props.duration;
|
|
54
|
-
if (duration) {
|
|
55
|
-
this.closeTimer = window.setTimeout(function () {
|
|
56
|
-
_this2.close();
|
|
57
|
-
}, duration);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}, {
|
|
61
|
-
key: "clearCloseTimer",
|
|
62
|
-
value: function clearCloseTimer() {
|
|
63
|
-
if (this.closeTimer) {
|
|
64
|
-
clearTimeout(this.closeTimer);
|
|
65
|
-
this.closeTimer = -1;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}, {
|
|
69
|
-
key: "clickCover",
|
|
70
|
-
value: function clickCover() {
|
|
71
|
-
this.props.onClick();
|
|
72
|
-
}
|
|
73
|
-
}, {
|
|
74
|
-
key: "componentDidMount",
|
|
75
|
-
value: function componentDidMount() {
|
|
76
|
-
this.startCloseTimer();
|
|
77
|
-
}
|
|
78
|
-
}, {
|
|
79
|
-
key: "componentWillUnmount",
|
|
80
|
-
value: function componentWillUnmount() {
|
|
81
|
-
this.clearCloseTimer();
|
|
82
|
-
}
|
|
83
|
-
}, {
|
|
84
|
-
key: "render",
|
|
85
|
-
value: function render() {
|
|
86
|
-
var _this$props = this.props,
|
|
87
|
-
children = _this$props.children,
|
|
88
|
-
style = _this$props.style,
|
|
89
|
-
msg = _this$props.msg,
|
|
90
|
-
color = _this$props.color,
|
|
91
|
-
background = _this$props.background,
|
|
92
|
-
type = _this$props.type,
|
|
93
|
-
className = _this$props.className,
|
|
94
|
-
position = _this$props.position,
|
|
95
|
-
isWrapTeleport = _this$props.isWrapTeleport;
|
|
96
|
-
this.state;
|
|
97
|
-
cn('notify');
|
|
98
|
-
var classes = classNames(_defineProperty({
|
|
99
|
-
'nut-notify--popup-top': position === 'top',
|
|
100
|
-
'nut-notify--popup-bottom': position === 'bottom',
|
|
101
|
-
'nut-notify': true
|
|
102
|
-
}, "nut-notify--".concat(type), true));
|
|
103
|
-
return React.createElement(React.Fragment, null, React.createElement(CSSTransition, {
|
|
104
|
-
"in": this.state.show,
|
|
105
|
-
timeout: 300,
|
|
106
|
-
classNames: "fade",
|
|
107
|
-
unmountOnExit: true,
|
|
108
|
-
appear: true,
|
|
109
|
-
position: position,
|
|
110
|
-
isWrapTeleport: isWrapTeleport
|
|
111
|
-
}, React.createElement("div", {
|
|
112
|
-
className: "".concat(classes, " ").concat(className),
|
|
113
|
-
style: {
|
|
114
|
-
color: "".concat(color || ''),
|
|
115
|
-
background: "".concat(background || '')
|
|
116
|
-
},
|
|
117
|
-
onClick: this.clickCover
|
|
118
|
-
}, children || msg)));
|
|
119
|
-
}
|
|
120
|
-
}]);
|
|
121
|
-
return Notification;
|
|
122
|
-
}(React.PureComponent);
|
|
123
|
-
_defineProperty(Notification, "newInstance", void 0);
|
|
124
|
-
Notification.newInstance = function (properties, callback) {
|
|
125
|
-
var element = document.createElement('div');
|
|
126
|
-
var id = properties.id ? properties.id : "".concat(new Date().getTime());
|
|
127
|
-
element.id = id;
|
|
128
|
-
properties.id = id;
|
|
129
|
-
document.body.appendChild(element);
|
|
130
|
-
var called = false;
|
|
131
|
-
function ref(instance) {
|
|
132
|
-
if (called) {
|
|
133
|
-
return;
|
|
134
|
-
}
|
|
135
|
-
called = true;
|
|
136
|
-
callback({
|
|
137
|
-
component: instance,
|
|
138
|
-
destroy: function destroy() {
|
|
139
|
-
setTimeout(function () {
|
|
140
|
-
ReactDOM.unmountComponentAtNode(element);
|
|
141
|
-
element && element.parentNode && element.parentNode.removeChild(element);
|
|
142
|
-
}, 300);
|
|
143
|
-
}
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
render(React.createElement(Notification, _objectSpread(_objectSpread({}, properties), {}, {
|
|
147
|
-
ref: ref
|
|
148
|
-
})), element);
|
|
149
|
-
};
|
|
150
|
-
var messageInstance = null;
|
|
151
|
-
var options = {
|
|
152
|
-
msg: '',
|
|
153
|
-
id: '',
|
|
154
|
-
duration: 3000,
|
|
155
|
-
color: '',
|
|
156
|
-
type: 'danger',
|
|
157
|
-
className: '',
|
|
158
|
-
position: 'top',
|
|
159
|
-
onClosed: function onClosed() {},
|
|
160
|
-
onClick: function onClick() {}
|
|
161
|
-
};
|
|
162
|
-
function getInstance(props, callback) {
|
|
163
|
-
if (messageInstance) {
|
|
164
|
-
messageInstance.destroy();
|
|
165
|
-
messageInstance = null;
|
|
166
|
-
}
|
|
167
|
-
Notification.newInstance(props, function (notification) {
|
|
168
|
-
return callback && callback(notification);
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
function notice(opts) {
|
|
172
|
-
// function close() {
|
|
173
|
-
// if (messageInstance) {
|
|
174
|
-
// messageInstance.destroy()
|
|
175
|
-
// messageInstance = null
|
|
176
|
-
// }
|
|
177
|
-
// }
|
|
178
|
-
opts = _objectSpread(_objectSpread({}, options), opts);
|
|
179
|
-
getInstance(opts, function (notification) {
|
|
180
|
-
messageInstance = notification;
|
|
181
|
-
});
|
|
182
|
-
}
|
|
183
|
-
var errorMsg = function errorMsg(msg) {
|
|
184
|
-
if (!msg) {
|
|
185
|
-
console.warn('[NutUI Notify]: msg不能为空');
|
|
186
|
-
}
|
|
187
|
-
};
|
|
188
|
-
var Notify = {
|
|
189
|
-
text: function text(msg) {
|
|
190
|
-
var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
191
|
-
errorMsg(msg);
|
|
192
|
-
return notice(_objectSpread({
|
|
193
|
-
msg: msg,
|
|
194
|
-
type: 'base'
|
|
195
|
-
}, option));
|
|
196
|
-
},
|
|
197
|
-
success: function success(msg) {
|
|
198
|
-
var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
199
|
-
errorMsg(msg);
|
|
200
|
-
return notice(_objectSpread({
|
|
201
|
-
msg: msg,
|
|
202
|
-
type: 'success'
|
|
203
|
-
}, option));
|
|
204
|
-
},
|
|
205
|
-
primary: function primary(msg) {
|
|
206
|
-
var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
207
|
-
errorMsg(msg);
|
|
208
|
-
return notice(_objectSpread({
|
|
209
|
-
msg: msg,
|
|
210
|
-
type: 'primary'
|
|
211
|
-
}, option));
|
|
212
|
-
},
|
|
213
|
-
danger: function danger(msg) {
|
|
214
|
-
var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
215
|
-
errorMsg(msg);
|
|
216
|
-
return notice(_objectSpread({
|
|
217
|
-
msg: msg,
|
|
218
|
-
type: 'danger'
|
|
219
|
-
}, option));
|
|
220
|
-
},
|
|
221
|
-
warn: function warn(msg) {
|
|
222
|
-
var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
223
|
-
errorMsg(msg);
|
|
224
|
-
return notice(_objectSpread({
|
|
225
|
-
msg: msg,
|
|
226
|
-
type: 'warning'
|
|
227
|
-
}, option));
|
|
228
|
-
},
|
|
229
|
-
hide: function hide() {
|
|
230
|
-
if (messageInstance) {
|
|
231
|
-
messageInstance.destroy();
|
|
232
|
-
messageInstance = null;
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
};
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
236
10
|
export { Notify as default };
|
|
@@ -1,249 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
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; }
|
|
6
|
-
import React__default, { useState, useEffect } from 'react';
|
|
7
|
-
import classNames from 'classnames';
|
|
8
|
-
import { c as cn } from './bem-3b438e61.js';
|
|
9
|
-
import Popup from './Popup.js';
|
|
10
|
-
import { useConfig } from './ConfigProvider.js';
|
|
1
|
+
import { N as NumberKeyboard } from './numberkeyboard.taro-1bc24744.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
import 'classnames';
|
|
4
|
+
import './bem-350c1702.js';
|
|
11
5
|
import '@bem-react/classname';
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
var _useConfig = useConfig(),
|
|
26
|
-
locale = _useConfig.locale;
|
|
27
|
-
var title = props.title,
|
|
28
|
-
confirmText = props.confirmText,
|
|
29
|
-
visible = props.visible,
|
|
30
|
-
overlay = props.overlay,
|
|
31
|
-
type = props.type,
|
|
32
|
-
customKey = props.customKey,
|
|
33
|
-
randomKeys = props.randomKeys,
|
|
34
|
-
popClass = props.popClass,
|
|
35
|
-
style = props.style,
|
|
36
|
-
className = props.className,
|
|
37
|
-
onChange = props.onChange,
|
|
38
|
-
onDelete = props.onDelete,
|
|
39
|
-
onClose = props.onClose;
|
|
40
|
-
var b = cn('numberkeyboard');
|
|
41
|
-
var _useState = useState(visible),
|
|
42
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
43
|
-
show = _useState2[0],
|
|
44
|
-
setShow = _useState2[1];
|
|
45
|
-
var _useState3 = useState(undefined),
|
|
46
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
47
|
-
clickKeyIndex = _useState4[0],
|
|
48
|
-
setClickKeyIndex = _useState4[1];
|
|
49
|
-
var _useState5 = useState([]),
|
|
50
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
51
|
-
keysList = _useState6[0],
|
|
52
|
-
setKeysList = _useState6[1];
|
|
53
|
-
useEffect(function () {
|
|
54
|
-
setShow(visible);
|
|
55
|
-
}, [visible]);
|
|
56
|
-
var defaultKey = function defaultKey() {
|
|
57
|
-
var leftBottomKey = {
|
|
58
|
-
id: 'lock',
|
|
59
|
-
type: 'lock'
|
|
60
|
-
};
|
|
61
|
-
if (customKey) {
|
|
62
|
-
var customKeys = Array.isArray(customKey) ? customKey : [customKey];
|
|
63
|
-
if (customKeys.length > 0) {
|
|
64
|
-
var newCustomKey = customKeys[0];
|
|
65
|
-
leftBottomKey = {
|
|
66
|
-
id: newCustomKey,
|
|
67
|
-
type: 'custom'
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
return [].concat(_toConsumableArray(getBasicKeys()), [leftBottomKey, {
|
|
72
|
-
id: 0,
|
|
73
|
-
type: 'number'
|
|
74
|
-
}, {
|
|
75
|
-
id: 'delete',
|
|
76
|
-
type: 'delete'
|
|
77
|
-
}]);
|
|
78
|
-
};
|
|
79
|
-
var getBasicKeys = function getBasicKeys() {
|
|
80
|
-
var keys = [];
|
|
81
|
-
for (var i = 1; i <= 9; i++) {
|
|
82
|
-
keys.push({
|
|
83
|
-
id: i,
|
|
84
|
-
type: 'number'
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
if (randomKeys) {
|
|
88
|
-
return keys.sort(function () {
|
|
89
|
-
return Math.random() > 0.5 ? 1 : -1;
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
return keys;
|
|
93
|
-
};
|
|
94
|
-
var genCustomKeys = function genCustomKeys() {
|
|
95
|
-
var keys = getBasicKeys();
|
|
96
|
-
if (!customKey) return [];
|
|
97
|
-
var customKeys = Array.isArray(customKey) ? customKey : [customKey];
|
|
98
|
-
if (customKeys.length > 2) {
|
|
99
|
-
customKeys = [customKeys[0], customKeys[1]];
|
|
100
|
-
}
|
|
101
|
-
if (customKeys.length === 2 && props.title && props.type !== 'rightColumn') {
|
|
102
|
-
customKeys = [customKeys[0]];
|
|
103
|
-
}
|
|
104
|
-
if (customKeys.length === 1) {
|
|
105
|
-
if (props.title && props.type !== 'rightColumn') {
|
|
106
|
-
keys.push({
|
|
107
|
-
id: customKeys[0],
|
|
108
|
-
type: 'custom'
|
|
109
|
-
}, {
|
|
110
|
-
id: 0,
|
|
111
|
-
type: 'number'
|
|
112
|
-
}, {
|
|
113
|
-
id: 'delete',
|
|
114
|
-
type: 'delete'
|
|
115
|
-
});
|
|
116
|
-
} else {
|
|
117
|
-
keys.push({
|
|
118
|
-
id: 0,
|
|
119
|
-
type: 'number'
|
|
120
|
-
}, {
|
|
121
|
-
id: customKeys[0],
|
|
122
|
-
type: 'custom'
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
} else if (customKeys.length === 2) {
|
|
126
|
-
keys.push({
|
|
127
|
-
id: customKeys[0],
|
|
128
|
-
type: 'custom'
|
|
129
|
-
}, {
|
|
130
|
-
id: 0,
|
|
131
|
-
type: 'number'
|
|
132
|
-
}, {
|
|
133
|
-
id: customKeys[1],
|
|
134
|
-
type: 'custom'
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
return keys;
|
|
138
|
-
};
|
|
139
|
-
useEffect(function () {
|
|
140
|
-
if (props.type === 'rightColumn' || props.title !== '') {
|
|
141
|
-
setKeysList(genCustomKeys());
|
|
142
|
-
} else {
|
|
143
|
-
setKeysList(defaultKey());
|
|
144
|
-
}
|
|
145
|
-
}, []);
|
|
146
|
-
var onTouchstart = function onTouchstart(item, event) {
|
|
147
|
-
event.stopPropagation();
|
|
148
|
-
setClickKeyIndex(item.id);
|
|
149
|
-
if (item.type === 'number' || item.type === 'custom') {
|
|
150
|
-
onChange && onChange(item.id);
|
|
151
|
-
}
|
|
152
|
-
if (item.type === 'lock') {
|
|
153
|
-
onClose && onClose();
|
|
154
|
-
}
|
|
155
|
-
if (item.type === 'delete') {
|
|
156
|
-
onDelete && onDelete();
|
|
157
|
-
}
|
|
158
|
-
};
|
|
159
|
-
var onTouchMove = function onTouchMove(event) {
|
|
160
|
-
event.stopPropagation();
|
|
161
|
-
};
|
|
162
|
-
var onTouchEnd = function onTouchEnd(event) {
|
|
163
|
-
event.preventDefault();
|
|
164
|
-
setClickKeyIndex(undefined);
|
|
165
|
-
};
|
|
166
|
-
return React__default.createElement("div", null, React__default.createElement(Popup, {
|
|
167
|
-
visible: show,
|
|
168
|
-
position: "bottom",
|
|
169
|
-
popClass: popClass,
|
|
170
|
-
onClickOverlay: onClose,
|
|
171
|
-
overlay: overlay,
|
|
172
|
-
onClickCloseIcon: onClose,
|
|
173
|
-
overlayStyle: {
|
|
174
|
-
backgroundColor: 'rgba(0, 0, 0, 0)'
|
|
175
|
-
}
|
|
176
|
-
}, React__default.createElement("div", {
|
|
177
|
-
className: "".concat(b(), " ").concat(className),
|
|
178
|
-
style: _objectSpread({}, style)
|
|
179
|
-
}, title ? React__default.createElement("div", {
|
|
180
|
-
className: b('header')
|
|
181
|
-
}, React__default.createElement("h3", {
|
|
182
|
-
className: b('header__tit')
|
|
183
|
-
}, title), type === 'default' ? React__default.createElement("span", {
|
|
184
|
-
className: b('header__close'),
|
|
185
|
-
onClick: onClose
|
|
186
|
-
}, locale.done) : null) : null, React__default.createElement("div", {
|
|
187
|
-
className: b('body')
|
|
188
|
-
}, React__default.createElement("div", {
|
|
189
|
-
className: b('body__keys')
|
|
190
|
-
}, keysList === null || keysList === void 0 ? void 0 : keysList.map(function (item, index) {
|
|
191
|
-
return React__default.createElement("div", {
|
|
192
|
-
key: index,
|
|
193
|
-
className: classNames({
|
|
194
|
-
'key-board-wrapper': true,
|
|
195
|
-
'key-board-wrapper-large': item.id === 0 && type === 'rightColumn' && Array.isArray(customKey) && customKey.length === 1
|
|
196
|
-
})
|
|
197
|
-
}, React__default.createElement("div", {
|
|
198
|
-
className: classNames({
|
|
199
|
-
key: true,
|
|
200
|
-
active: item.id === clickKeyIndex,
|
|
201
|
-
lock: item.type === 'lock',
|
|
202
|
-
"delete": item.type === 'delete'
|
|
203
|
-
}),
|
|
204
|
-
onTouchStart: function onTouchStart(event) {
|
|
205
|
-
return onTouchstart(item, event);
|
|
206
|
-
},
|
|
207
|
-
onTouchMove: onTouchMove,
|
|
208
|
-
onTouchEnd: onTouchEnd
|
|
209
|
-
}, item.type === 'number' || item.type === 'custom' ? React__default.createElement("div", null, item.id) : null, item.type === 'lock' ? React__default.createElement("img", {
|
|
210
|
-
src: "https://img11.360buyimg.com/imagetools/jfs/t1/146371/38/8485/738/5f606425Eca239740/14f4b4f5f20d8a68.png",
|
|
211
|
-
alt: ""
|
|
212
|
-
}) : null, item.type === 'delete' ? React__default.createElement("img", {
|
|
213
|
-
src: "https://img11.360buyimg.com/imagetools/jfs/t1/129395/8/12735/2030/5f61ac37E70cab338/fb477dc11f46056c.png",
|
|
214
|
-
alt: ""
|
|
215
|
-
}) : null));
|
|
216
|
-
})), type === 'rightColumn' ? React__default.createElement("div", {
|
|
217
|
-
className: b('sidebar')
|
|
218
|
-
}, React__default.createElement("div", {
|
|
219
|
-
className: "key-board-wrapper"
|
|
220
|
-
}, React__default.createElement("div", {
|
|
221
|
-
className: classNames({
|
|
222
|
-
key: true,
|
|
223
|
-
active: clickKeyIndex === 'delete'
|
|
224
|
-
}),
|
|
225
|
-
onTouchStart: function onTouchStart(event) {
|
|
226
|
-
return onTouchstart({
|
|
227
|
-
id: 'delete',
|
|
228
|
-
type: 'delete'
|
|
229
|
-
}, event);
|
|
230
|
-
},
|
|
231
|
-
onTouchMove: onTouchMove,
|
|
232
|
-
onTouchEnd: onTouchEnd
|
|
233
|
-
}, React__default.createElement("img", {
|
|
234
|
-
src: "https://img11.360buyimg.com/imagetools/jfs/t1/129395/8/12735/2030/5f61ac37E70cab338/fb477dc11f46056c.png",
|
|
235
|
-
alt: ""
|
|
236
|
-
}))), React__default.createElement("div", {
|
|
237
|
-
className: "key-board-wrapper key-board-finish",
|
|
238
|
-
onClick: onClose
|
|
239
|
-
}, React__default.createElement("div", {
|
|
240
|
-
className: classNames({
|
|
241
|
-
key: true,
|
|
242
|
-
finish: true,
|
|
243
|
-
activeFinsh: clickKeyIndex === 'finish'
|
|
244
|
-
})
|
|
245
|
-
}, confirmText || locale.done))) : null))));
|
|
246
|
-
};
|
|
247
|
-
NumberKeyboard.defaultProps = defaultProps;
|
|
248
|
-
NumberKeyboard.displayName = 'NutNumberKeyboard';
|
|
6
|
+
import './popup.taro-01676bff.js';
|
|
7
|
+
import 'react-dom';
|
|
8
|
+
import 'react-transition-group';
|
|
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
|
+
|
|
249
19
|
export { NumberKeyboard as default };
|
package/dist/esm/Overlay.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import { O as Overlay } from './overlay-
|
|
1
|
+
import { O as Overlay } from './overlay.taro-21e87fb1.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import 'classnames';
|
|
4
|
-
import './bem-
|
|
4
|
+
import './bem-350c1702.js';
|
|
5
5
|
import '@bem-react/classname';
|
|
6
|
+
import '@tarojs/components';
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
6
10
|
export { Overlay as default };
|