@nutui/nutui-react 2.0.0-alpha.0 → 2.0.0-alpha.10
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 +137 -638
- package/dist/esm/Address.js +1 -1
- package/dist/esm/Animate.js +6 -7
- package/dist/esm/Audio.js +28 -27
- package/dist/esm/Avatar.js +30 -25
- package/dist/esm/AvatarGroup.js +10 -15
- package/dist/esm/Badge.js +4 -73
- package/dist/esm/CalendarItem.js +2 -12
- package/dist/esm/Cascader.js +67 -69
- package/dist/esm/Checkbox.js +1 -2
- package/dist/esm/CheckboxGroup.js +18 -20
- package/dist/esm/CircleProgress.js +20 -25
- package/dist/esm/Col.js +4 -3
- package/dist/esm/DatePicker.js +10 -10
- package/dist/esm/Dialog.js +162 -171
- package/dist/esm/Divider.js +4 -3
- package/dist/esm/Drag.js +7 -9
- package/dist/esm/Elevator.js +39 -41
- package/dist/esm/Ellipsis.js +13 -12
- package/dist/esm/Empty.js +18 -26
- package/dist/esm/Image.js +5 -10
- package/dist/esm/ImagePreview.js +67 -58
- package/dist/esm/Indicator.js +4 -4
- package/dist/esm/Input.js +87 -193
- package/dist/esm/Menu.js +75 -73
- package/dist/esm/MenuItem.js +29 -27
- package/dist/esm/NavBar.js +17 -48
- package/dist/esm/NoticeBar.js +50 -87
- package/dist/esm/Notify.js +35 -46
- package/dist/esm/NumberKeyboard.js +137 -195
- package/dist/esm/Picker.js +175 -160
- package/dist/esm/Popup.js +24 -33
- package/dist/esm/Price.js +22 -23
- package/dist/esm/Progress.js +74 -67
- package/dist/esm/PullToRefresh.js +8 -8
- package/dist/esm/Radio.js +2 -0
- package/dist/esm/RadioGroup.js +31 -51
- package/dist/esm/Range/style/index.js +1 -1
- package/dist/esm/Range.js +119 -174
- package/dist/esm/Row.js +6 -5
- package/dist/esm/SideNavBar.js +0 -2
- package/dist/esm/Skeleton.js +1 -1
- package/dist/esm/Step.js +23 -28
- package/dist/esm/Steps/style/index.js +1 -1
- package/dist/esm/Steps.js +10 -11
- package/dist/esm/Swipe.js +4 -10
- package/dist/esm/Swiper.js +86 -91
- package/dist/esm/SwiperItem.js +1 -1
- package/dist/esm/Switch.js +16 -30
- package/dist/esm/TabPane.js +39 -5
- package/dist/esm/Tabbar/style/index.js +1 -1
- package/dist/esm/Tabbar.js +29 -33
- package/dist/esm/TabbarItem.js +5 -75
- package/dist/esm/Table.js +20 -34
- package/dist/esm/Tabs.js +2 -2
- package/dist/esm/TextArea.js +53 -81
- package/dist/esm/Uploader.js +49 -52
- package/dist/esm/badge2.js +69 -0
- package/dist/esm/cellgroup2.js +5 -4
- package/dist/esm/checkbox2.js +34 -47
- package/dist/esm/nutui-react.es.js +170 -170
- package/dist/esm/overlay2.js +12 -14
- package/dist/esm/radio2.js +52 -54
- package/dist/esm/raf.js +16 -0
- package/dist/esm/tabbaritem2.js +61 -0
- package/dist/esm/tabs2.js +126 -95
- 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 +23562 -24489
- package/dist/nutui.react.umd.js +23560 -24487
- package/dist/packages/audio/audio.scss +2 -15
- package/dist/packages/badge/badge.scss +8 -18
- package/dist/packages/calendar/calendar.scss +0 -30
- package/dist/packages/cascader/cascader.scss +0 -26
- package/dist/packages/cellgroup/cellgroup.scss +20 -16
- package/dist/packages/checkbox/checkbox.scss +8 -11
- package/dist/packages/circleprogress/circleprogress.scss +0 -9
- package/dist/packages/dialog/dialog.scss +36 -65
- package/dist/packages/elevator/elevator.scss +2 -28
- package/dist/packages/empty/empty.scss +0 -9
- package/dist/packages/imagepreview/imagepreview.scss +52 -16
- package/dist/packages/input/input.scss +13 -180
- package/dist/packages/menu/menu.scss +44 -55
- package/dist/packages/menuitem/menuitem.scss +16 -26
- package/dist/packages/navbar/navbar.scss +16 -115
- package/dist/packages/noticebar/noticebar.scss +18 -19
- package/dist/packages/notify/notify.scss +1 -1
- package/dist/packages/numberkeyboard/numberkeyboard.scss +29 -77
- package/dist/packages/overlay/overlay.scss +11 -4
- package/dist/packages/picker/picker.scss +66 -137
- package/dist/packages/popup/popup.scss +0 -16
- package/dist/packages/price/price.scss +8 -0
- package/dist/packages/progress/progress.scss +19 -58
- package/dist/packages/pulltorefresh/pulltorefresh.scss +0 -8
- package/dist/packages/radio/radio.scss +13 -32
- package/dist/packages/radiogroup/radiogroup.scss +17 -51
- package/dist/packages/range/range.scss +24 -49
- package/dist/packages/row/row.scss +13 -31
- package/dist/packages/sidenavbar/sidenavbar.scss +0 -19
- package/dist/packages/step/step.scss +9 -62
- package/dist/packages/steps/steps.scss +2 -0
- package/dist/packages/swiper/swiper.scss +3 -18
- package/dist/packages/switch/switch.scss +13 -31
- package/dist/packages/tabbar/tabbar.scss +16 -22
- package/dist/packages/tabbaritem/tabbaritem.scss +9 -70
- package/dist/packages/table/table.scss +0 -56
- package/dist/packages/tabs/tabs.scss +196 -225
- package/dist/packages/textarea/textarea.scss +5 -12
- package/dist/packages/uploader/uploader.scss +2 -28
- package/dist/style.css +1 -1
- package/dist/style.mjs +1 -1
- package/dist/styles/themes/default.scss +17 -18
- package/dist/styles/variables-jmapp.scss +120 -240
- package/dist/styles/variables.scss +139 -252
- package/dist/types/index.d.ts +565 -708
- package/package.json +2 -2
- package/dist/esm/Icon.js +0 -83
- package/dist/esm/tabpane2.js +0 -44
- package/dist/packages/icon/icon.scss +0 -0
- /package/dist/esm/{AvatarContext.js → context.js} +0 -0
- /package/dist/esm/{UserContext2.js → context2.js} +0 -0
- /package/dist/esm/{UserContext3.js → context3.js} +0 -0
package/dist/esm/Notify.js
CHANGED
|
@@ -55,12 +55,12 @@ function _isNativeReflectConstruct() {
|
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
import * as React from "react";
|
|
58
|
-
import * as ReactDOM from "react-dom";
|
|
59
58
|
import classNames from "classnames";
|
|
60
59
|
import { CSSTransition } from "react-transition-group";
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import "
|
|
60
|
+
import { r as render, u as unmount } from "./render.js";
|
|
61
|
+
import { C as ComponentDefaults } from "./typings.js";
|
|
62
|
+
import "react-dom";
|
|
63
|
+
var classPrefix = "nut-notify";
|
|
64
64
|
var Notification = /* @__PURE__ */ function(_React$PureComponent) {
|
|
65
65
|
_inherits(Notification2, _React$PureComponent);
|
|
66
66
|
var _super = _createSuper(Notification2);
|
|
@@ -89,7 +89,7 @@ var Notification = /* @__PURE__ */ function(_React$PureComponent) {
|
|
|
89
89
|
var element = document.getElementById(this.props.id);
|
|
90
90
|
element && element.parentNode && element.parentNode.removeChild(element);
|
|
91
91
|
}
|
|
92
|
-
this.props.
|
|
92
|
+
this.props.onClose();
|
|
93
93
|
}
|
|
94
94
|
}, {
|
|
95
95
|
key: "startCloseTimer",
|
|
@@ -128,30 +128,22 @@ var Notification = /* @__PURE__ */ function(_React$PureComponent) {
|
|
|
128
128
|
}, {
|
|
129
129
|
key: "render",
|
|
130
130
|
value: function render2() {
|
|
131
|
-
var
|
|
132
|
-
this.
|
|
133
|
-
|
|
134
|
-
var classes = classNames(_defineProperty(
|
|
135
|
-
"nut-notify--popup-top": position === "top",
|
|
136
|
-
"nut-notify--popup-bottom": position === "bottom",
|
|
137
|
-
"nut-notify": true
|
|
138
|
-
}, "nut-notify--".concat(type), true));
|
|
131
|
+
var _classNames;
|
|
132
|
+
var _this$props = this.props, style = _this$props.style, message = _this$props.message, type = _this$props.type, className = _this$props.className, position = _this$props.position;
|
|
133
|
+
var show = this.state.show;
|
|
134
|
+
var classes = classNames((_classNames = {}, _defineProperty(_classNames, "".concat(classPrefix, "--popup-top"), position === "top"), _defineProperty(_classNames, "".concat(classPrefix, "--popup-bottom"), position === "bottom"), _defineProperty(_classNames, "".concat(classPrefix), true), _defineProperty(_classNames, "".concat(classPrefix, "--").concat(type), true), _classNames));
|
|
139
135
|
return React.createElement(React.Fragment, null, React.createElement(CSSTransition, {
|
|
140
|
-
"in":
|
|
136
|
+
"in": show,
|
|
141
137
|
timeout: 300,
|
|
142
138
|
classNames: "fade",
|
|
143
139
|
unmountOnExit: true,
|
|
144
140
|
appear: true,
|
|
145
|
-
position
|
|
146
|
-
isWrapTeleport
|
|
141
|
+
position
|
|
147
142
|
}, React.createElement("div", {
|
|
148
143
|
className: "".concat(classes, " ").concat(className),
|
|
149
|
-
style
|
|
150
|
-
color: "".concat(color || ""),
|
|
151
|
-
background: "".concat(background || "")
|
|
152
|
-
},
|
|
144
|
+
style,
|
|
153
145
|
onClick: this.clickCover
|
|
154
|
-
},
|
|
146
|
+
}, message)));
|
|
155
147
|
}
|
|
156
148
|
}]);
|
|
157
149
|
return Notification2;
|
|
@@ -173,7 +165,7 @@ Notification.newInstance = function(properties, callback) {
|
|
|
173
165
|
component: instance,
|
|
174
166
|
destroy: function destroy() {
|
|
175
167
|
setTimeout(function() {
|
|
176
|
-
|
|
168
|
+
unmount(element);
|
|
177
169
|
element && element.parentNode && element.parentNode.removeChild(element);
|
|
178
170
|
}, 300);
|
|
179
171
|
}
|
|
@@ -184,19 +176,16 @@ Notification.newInstance = function(properties, callback) {
|
|
|
184
176
|
})), element);
|
|
185
177
|
};
|
|
186
178
|
var messageInstance = null;
|
|
187
|
-
var options = {
|
|
188
|
-
msg: "",
|
|
179
|
+
var options = _objectSpread(_objectSpread({}, ComponentDefaults), {}, {
|
|
189
180
|
id: "",
|
|
190
181
|
duration: 3e3,
|
|
191
|
-
color: "",
|
|
192
182
|
type: "danger",
|
|
193
|
-
className: "",
|
|
194
183
|
position: "top",
|
|
195
|
-
|
|
184
|
+
onClose: function onClose() {
|
|
196
185
|
},
|
|
197
186
|
onClick: function onClick() {
|
|
198
187
|
}
|
|
199
|
-
};
|
|
188
|
+
});
|
|
200
189
|
function getInstance(props, callback) {
|
|
201
190
|
if (messageInstance) {
|
|
202
191
|
messageInstance.destroy();
|
|
@@ -212,49 +201,49 @@ function notice(opts) {
|
|
|
212
201
|
messageInstance = notification;
|
|
213
202
|
});
|
|
214
203
|
}
|
|
215
|
-
var errorMsg = function errorMsg2(
|
|
216
|
-
if (!
|
|
217
|
-
console.warn("[NutUI Notify]:
|
|
204
|
+
var errorMsg = function errorMsg2(message) {
|
|
205
|
+
if (!message) {
|
|
206
|
+
console.warn("[NutUI Notify]: message不能为空");
|
|
218
207
|
}
|
|
219
208
|
};
|
|
220
209
|
var Notify = {
|
|
221
|
-
text: function text(
|
|
210
|
+
text: function text(message) {
|
|
222
211
|
var option = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
223
|
-
errorMsg(
|
|
212
|
+
errorMsg(message);
|
|
224
213
|
return notice(_objectSpread({
|
|
225
|
-
|
|
214
|
+
message,
|
|
226
215
|
type: "base"
|
|
227
216
|
}, option));
|
|
228
217
|
},
|
|
229
|
-
success: function success(
|
|
218
|
+
success: function success(message) {
|
|
230
219
|
var option = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
231
|
-
errorMsg(
|
|
220
|
+
errorMsg(message);
|
|
232
221
|
return notice(_objectSpread({
|
|
233
|
-
|
|
222
|
+
message,
|
|
234
223
|
type: "success"
|
|
235
224
|
}, option));
|
|
236
225
|
},
|
|
237
|
-
primary: function primary(
|
|
226
|
+
primary: function primary(message) {
|
|
238
227
|
var option = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
239
|
-
errorMsg(
|
|
228
|
+
errorMsg(message);
|
|
240
229
|
return notice(_objectSpread({
|
|
241
|
-
|
|
230
|
+
message,
|
|
242
231
|
type: "primary"
|
|
243
232
|
}, option));
|
|
244
233
|
},
|
|
245
|
-
danger: function danger(
|
|
234
|
+
danger: function danger(message) {
|
|
246
235
|
var option = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
247
|
-
errorMsg(
|
|
236
|
+
errorMsg(message);
|
|
248
237
|
return notice(_objectSpread({
|
|
249
|
-
|
|
238
|
+
message,
|
|
250
239
|
type: "danger"
|
|
251
240
|
}, option));
|
|
252
241
|
},
|
|
253
|
-
warn: function warn(
|
|
242
|
+
warn: function warn(message) {
|
|
254
243
|
var option = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
255
|
-
errorMsg(
|
|
244
|
+
errorMsg(message);
|
|
256
245
|
return notice(_objectSpread({
|
|
257
|
-
|
|
246
|
+
message,
|
|
258
247
|
type: "warning"
|
|
259
248
|
}, option));
|
|
260
249
|
},
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
3
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
3
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
5
|
+
var _excluded = ["title", "confirmText", "visible", "type", "custom", "random", "style", "className", "onChange", "onDelete", "onClose", "onConfirm"];
|
|
4
6
|
function ownKeys(object, enumerableOnly) {
|
|
5
7
|
var keys = Object.keys(object);
|
|
6
8
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -22,226 +24,166 @@ function _objectSpread(target) {
|
|
|
22
24
|
}
|
|
23
25
|
return target;
|
|
24
26
|
}
|
|
25
|
-
import React__default, {
|
|
27
|
+
import React__default, { useMemo, useState } from "react";
|
|
26
28
|
import classNames from "classnames";
|
|
27
|
-
import {
|
|
29
|
+
import { RectDown } from "@nutui/icons-react";
|
|
28
30
|
import Popup from "./Popup.js";
|
|
29
31
|
import { useConfig } from "./ConfigProvider.js";
|
|
30
|
-
import "
|
|
31
|
-
var defaultProps = {
|
|
32
|
-
confirmText: "",
|
|
33
|
-
title: "",
|
|
32
|
+
import { C as ComponentDefaults } from "./typings.js";
|
|
33
|
+
var defaultProps = _objectSpread(_objectSpread({}, ComponentDefaults), {}, {
|
|
34
34
|
visible: false,
|
|
35
|
-
overlay: true,
|
|
36
35
|
type: "default",
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
randomKeys: false,
|
|
40
|
-
popClass: "",
|
|
36
|
+
custom: [],
|
|
37
|
+
random: false,
|
|
41
38
|
onClose: function onClose() {
|
|
42
39
|
}
|
|
43
|
-
};
|
|
40
|
+
});
|
|
44
41
|
var NumberKeyboard = function NumberKeyboard2(props) {
|
|
45
42
|
var _useConfig = useConfig(), locale = _useConfig.locale;
|
|
46
|
-
var title = props.title, confirmText = props.confirmText, visible = props.visible,
|
|
47
|
-
var
|
|
48
|
-
var
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
return [].concat(_toConsumableArray(getBasicKeys()), [leftBottomKey, {
|
|
70
|
-
id: 0,
|
|
71
|
-
type: "number"
|
|
43
|
+
var title = props.title, confirmText = props.confirmText, visible = props.visible, type = props.type, custom = props.custom, random = props.random, style = props.style, className = props.className, onChange = props.onChange, onDelete = props.onDelete, onClose2 = props.onClose, onConfirm = props.onConfirm, rest = _objectWithoutProperties(props, _excluded);
|
|
44
|
+
var classPrefix = "nut-numberkeyboard";
|
|
45
|
+
var getBasicKeys = function getBasicKeys2() {
|
|
46
|
+
var keys = new Array(9).fill(0).map(function(_, index) {
|
|
47
|
+
return {
|
|
48
|
+
id: String(index + 1),
|
|
49
|
+
type: "num"
|
|
50
|
+
};
|
|
51
|
+
});
|
|
52
|
+
return random ? keys.sort(function() {
|
|
53
|
+
return Math.random() > 0.5 ? 1 : -1;
|
|
54
|
+
}) : keys;
|
|
55
|
+
};
|
|
56
|
+
var getCustomKeys = function getCustomKeys2() {
|
|
57
|
+
var customKeys = [{
|
|
58
|
+
id: "close",
|
|
59
|
+
type: "close"
|
|
60
|
+
}, {
|
|
61
|
+
id: "0",
|
|
62
|
+
type: "num"
|
|
72
63
|
}, {
|
|
73
64
|
id: "delete",
|
|
74
65
|
type: "delete"
|
|
75
|
-
}]
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
id: i,
|
|
82
|
-
type: "number"
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
if (randomKeys) {
|
|
86
|
-
return keys.sort(function() {
|
|
87
|
-
return Math.random() > 0.5 ? 1 : -1;
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
return keys;
|
|
91
|
-
};
|
|
92
|
-
var genCustomKeys = function genCustomKeys2() {
|
|
93
|
-
var keys = getBasicKeys();
|
|
94
|
-
if (!customKey)
|
|
95
|
-
return [];
|
|
96
|
-
var customKeys = Array.isArray(customKey) ? customKey : [customKey];
|
|
97
|
-
if (customKeys.length > 2) {
|
|
98
|
-
customKeys = [customKeys[0], customKeys[1]];
|
|
99
|
-
}
|
|
100
|
-
if (customKeys.length === 2 && props.title && props.type !== "rightColumn") {
|
|
101
|
-
customKeys = [customKeys[0]];
|
|
102
|
-
}
|
|
103
|
-
if (customKeys.length === 1) {
|
|
104
|
-
if (props.title && props.type !== "rightColumn") {
|
|
105
|
-
keys.push({
|
|
106
|
-
id: customKeys[0],
|
|
107
|
-
type: "custom"
|
|
108
|
-
}, {
|
|
109
|
-
id: 0,
|
|
110
|
-
type: "number"
|
|
111
|
-
}, {
|
|
112
|
-
id: "delete",
|
|
113
|
-
type: "delete"
|
|
114
|
-
});
|
|
115
|
-
} else {
|
|
116
|
-
keys.push({
|
|
117
|
-
id: 0,
|
|
118
|
-
type: "number"
|
|
119
|
-
}, {
|
|
120
|
-
id: customKeys[0],
|
|
121
|
-
type: "custom"
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
} else if (customKeys.length === 2) {
|
|
125
|
-
keys.push({
|
|
126
|
-
id: customKeys[0],
|
|
127
|
-
type: "custom"
|
|
128
|
-
}, {
|
|
129
|
-
id: 0,
|
|
130
|
-
type: "number"
|
|
131
|
-
}, {
|
|
132
|
-
id: customKeys[1],
|
|
66
|
+
}];
|
|
67
|
+
if (!custom)
|
|
68
|
+
return customKeys;
|
|
69
|
+
if (custom.length > 0) {
|
|
70
|
+
customKeys[0] = {
|
|
71
|
+
id: custom[0],
|
|
133
72
|
type: "custom"
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
return keys;
|
|
137
|
-
};
|
|
138
|
-
useEffect(function() {
|
|
139
|
-
if (props.type === "rightColumn" || props.title !== "") {
|
|
140
|
-
setKeysList(genCustomKeys());
|
|
141
|
-
} else {
|
|
142
|
-
setKeysList(defaultKey());
|
|
143
|
-
}
|
|
144
|
-
}, []);
|
|
145
|
-
var onTouchstart = function onTouchstart2(item, event) {
|
|
146
|
-
event.stopPropagation();
|
|
147
|
-
setClickKeyIndex(item.id);
|
|
148
|
-
if (item.type === "number" || item.type === "custom") {
|
|
149
|
-
onChange && onChange(item.id);
|
|
73
|
+
};
|
|
150
74
|
}
|
|
151
|
-
if (
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
75
|
+
if (custom.length > 1) {
|
|
76
|
+
customKeys[2] = {
|
|
77
|
+
id: custom[1],
|
|
78
|
+
type: "custom"
|
|
79
|
+
};
|
|
156
80
|
}
|
|
81
|
+
return customKeys;
|
|
157
82
|
};
|
|
158
|
-
var
|
|
159
|
-
|
|
83
|
+
var keysList = useMemo(function() {
|
|
84
|
+
return [].concat(_toConsumableArray(getBasicKeys()), _toConsumableArray(getCustomKeys()));
|
|
85
|
+
}, [type, random, custom]);
|
|
86
|
+
var DeleteIcon = function DeleteIcon2() {
|
|
87
|
+
return React__default.createElement("svg", {
|
|
88
|
+
viewBox: "0 0 1024 1024",
|
|
89
|
+
width: "36",
|
|
90
|
+
height: "36"
|
|
91
|
+
}, React__default.createElement("path", {
|
|
92
|
+
d: "M875.594 186.122H390.803a51.162 51.162 0 0 0-36.18 14.986L79.91 475.821a51.166 51.166 0 0 0 0 72.358l274.714 274.712a51.164 51.164 0 0 0 36.179 14.986h484.791c46.033 0 83.484-37.45 83.484-83.483V269.606c.001-46.033-37.45-83.484-83.483-83.484zm32.32 568.274c0 17.85-14.473 32.318-32.32 32.318H390.803L116.089 512l274.714-274.714h484.791c17.849 0 32.32 14.47 32.32 32.32v484.789z",
|
|
93
|
+
fill: "currentColor"
|
|
94
|
+
}), React__default.createElement("path", {
|
|
95
|
+
d: "M753.945 360.214l-121.43 121.429-121.43-121.429s-16.062-8.224-30.356 6.072c-14.295 14.295-6.073 30.357-6.073 30.357l121.43 121.428L486.8 627.357s-8.222 16.062 6.072 30.357c14.297 14.296 30.358 6.072 30.358 6.072l109.286-109.285 109.286 109.285s16.062 8.224 30.357-6.072c14.295-14.295 6.07-30.357 6.07-30.357L668.944 518.072l121.431-121.43s8.22-16.061-6.074-30.356c-14.294-14.296-30.356-6.072-30.356-6.072z",
|
|
96
|
+
fill: "currentColor"
|
|
97
|
+
}));
|
|
160
98
|
};
|
|
161
|
-
var
|
|
162
|
-
|
|
163
|
-
|
|
99
|
+
var NumberKeyboardKey = function NumberKeyboardKey2(props2) {
|
|
100
|
+
var item = props2.item;
|
|
101
|
+
var _useState = useState(false), _useState2 = _slicedToArray(_useState, 2), active = _useState2[0], setActive = _useState2[1];
|
|
102
|
+
var _onTouchStart = function onTouchStart() {
|
|
103
|
+
setActive(true);
|
|
104
|
+
};
|
|
105
|
+
var _onTouchEnd = function onTouchEnd(item2) {
|
|
106
|
+
setActive(false);
|
|
107
|
+
if (item2.type === "num" || item2.type === "custom") {
|
|
108
|
+
onChange && onChange(item2.id);
|
|
109
|
+
}
|
|
110
|
+
if (item2.type === "close") {
|
|
111
|
+
onClose2 && onClose2();
|
|
112
|
+
}
|
|
113
|
+
if (item2.type === "delete") {
|
|
114
|
+
onDelete && onDelete();
|
|
115
|
+
}
|
|
116
|
+
if (item2.type === "confirm") {
|
|
117
|
+
onConfirm && onConfirm();
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
return React__default.createElement("div", {
|
|
121
|
+
key: item.id,
|
|
122
|
+
className: "".concat(classPrefix, "__body__wrapper")
|
|
123
|
+
}, React__default.createElement("div", {
|
|
124
|
+
className: classNames({
|
|
125
|
+
key: true,
|
|
126
|
+
active,
|
|
127
|
+
close: item.type === "close",
|
|
128
|
+
"delete": item.type === "delete",
|
|
129
|
+
confirm: item.type === "confirm"
|
|
130
|
+
}),
|
|
131
|
+
onTouchStart: function onTouchStart() {
|
|
132
|
+
return _onTouchStart();
|
|
133
|
+
},
|
|
134
|
+
onTouchEnd: function onTouchEnd() {
|
|
135
|
+
return _onTouchEnd(item);
|
|
136
|
+
},
|
|
137
|
+
onTouchCancel: function onTouchCancel() {
|
|
138
|
+
return _onTouchEnd(item);
|
|
139
|
+
}
|
|
140
|
+
}, (item.type === "num" || item.type === "custom") && React__default.createElement("div", null, item.id), item.type === "delete" && React__default.createElement(DeleteIcon, null), item.type === "close" && React__default.createElement(RectDown, {
|
|
141
|
+
width: 25,
|
|
142
|
+
height: 25
|
|
143
|
+
}), item.type === "confirm" && React__default.createElement(React__default.Fragment, null, confirmText || locale.done)));
|
|
164
144
|
};
|
|
165
|
-
return React__default.createElement(
|
|
166
|
-
visible
|
|
145
|
+
return React__default.createElement(Popup, _objectSpread({
|
|
146
|
+
visible,
|
|
167
147
|
position: "bottom",
|
|
168
|
-
popClass,
|
|
169
148
|
onClickOverlay: onClose2,
|
|
170
|
-
overlay,
|
|
171
149
|
onClickCloseIcon: onClose2,
|
|
172
150
|
overlayStyle: {
|
|
173
151
|
backgroundColor: "rgba(0, 0, 0, 0)"
|
|
174
152
|
}
|
|
175
|
-
}, React__default.createElement("div", {
|
|
176
|
-
className:
|
|
177
|
-
style
|
|
178
|
-
}, title
|
|
179
|
-
className:
|
|
153
|
+
}, rest), React__default.createElement("div", {
|
|
154
|
+
className: classNames(classPrefix, className),
|
|
155
|
+
style
|
|
156
|
+
}, title && React__default.createElement("div", {
|
|
157
|
+
className: "".concat(classPrefix, "__header")
|
|
180
158
|
}, React__default.createElement("h3", {
|
|
181
|
-
className:
|
|
182
|
-
}, title), type === "default"
|
|
183
|
-
className:
|
|
184
|
-
onClick: onClose2
|
|
185
|
-
}, locale.done) : null) : null, React__default.createElement("div", {
|
|
186
|
-
className: b("body")
|
|
187
|
-
}, React__default.createElement("div", {
|
|
188
|
-
className: b("body__keys")
|
|
189
|
-
}, keysList === null || keysList === void 0 ? void 0 : keysList.map(function(item, index) {
|
|
190
|
-
return React__default.createElement("div", {
|
|
191
|
-
key: index,
|
|
192
|
-
className: classNames({
|
|
193
|
-
"key-board-wrapper": true,
|
|
194
|
-
"key-board-wrapper-large": item.id === 0 && type === "rightColumn" && Array.isArray(customKey) && customKey.length === 1
|
|
195
|
-
})
|
|
196
|
-
}, React__default.createElement("div", {
|
|
197
|
-
className: classNames({
|
|
198
|
-
key: true,
|
|
199
|
-
active: item.id === clickKeyIndex,
|
|
200
|
-
lock: item.type === "lock",
|
|
201
|
-
"delete": item.type === "delete"
|
|
202
|
-
}),
|
|
203
|
-
onTouchStart: function onTouchStart(event) {
|
|
204
|
-
return onTouchstart(item, event);
|
|
205
|
-
},
|
|
206
|
-
onTouchMove,
|
|
207
|
-
onTouchEnd
|
|
208
|
-
}, item.type === "number" || item.type === "custom" ? React__default.createElement("div", null, item.id) : null, item.type === "lock" ? React__default.createElement("img", {
|
|
209
|
-
src: "https://img11.360buyimg.com/imagetools/jfs/t1/146371/38/8485/738/5f606425Eca239740/14f4b4f5f20d8a68.png",
|
|
210
|
-
alt: ""
|
|
211
|
-
}) : null, item.type === "delete" ? React__default.createElement("img", {
|
|
212
|
-
src: "https://img11.360buyimg.com/imagetools/jfs/t1/129395/8/12735/2030/5f61ac37E70cab338/fb477dc11f46056c.png",
|
|
213
|
-
alt: ""
|
|
214
|
-
}) : null));
|
|
215
|
-
})), type === "rightColumn" ? React__default.createElement("div", {
|
|
216
|
-
className: b("sidebar")
|
|
217
|
-
}, React__default.createElement("div", {
|
|
218
|
-
className: "key-board-wrapper"
|
|
219
|
-
}, React__default.createElement("div", {
|
|
220
|
-
className: classNames({
|
|
221
|
-
key: true,
|
|
222
|
-
active: clickKeyIndex === "delete"
|
|
223
|
-
}),
|
|
224
|
-
onTouchStart: function onTouchStart(event) {
|
|
225
|
-
return onTouchstart({
|
|
226
|
-
id: "delete",
|
|
227
|
-
type: "delete"
|
|
228
|
-
}, event);
|
|
229
|
-
},
|
|
230
|
-
onTouchMove,
|
|
231
|
-
onTouchEnd
|
|
232
|
-
}, React__default.createElement("img", {
|
|
233
|
-
src: "https://img11.360buyimg.com/imagetools/jfs/t1/129395/8/12735/2030/5f61ac37E70cab338/fb477dc11f46056c.png",
|
|
234
|
-
alt: ""
|
|
235
|
-
}))), React__default.createElement("div", {
|
|
236
|
-
className: "key-board-wrapper key-board-finish",
|
|
159
|
+
className: "".concat(classPrefix, "__header__title")
|
|
160
|
+
}, title), type === "default" && React__default.createElement("span", {
|
|
161
|
+
className: "".concat(classPrefix, "__header__close"),
|
|
237
162
|
onClick: onClose2
|
|
163
|
+
}, locale.done)), React__default.createElement("div", {
|
|
164
|
+
className: "".concat(classPrefix, "__body")
|
|
238
165
|
}, React__default.createElement("div", {
|
|
239
|
-
className:
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
166
|
+
className: "".concat(classPrefix, "__body__keys")
|
|
167
|
+
}, keysList === null || keysList === void 0 ? void 0 : keysList.map(function(item) {
|
|
168
|
+
return React__default.createElement(NumberKeyboardKey, {
|
|
169
|
+
key: item.id,
|
|
170
|
+
item
|
|
171
|
+
});
|
|
172
|
+
})), type === "rightColumn" && React__default.createElement("div", {
|
|
173
|
+
className: "".concat(classPrefix, "__sidebar")
|
|
174
|
+
}, React__default.createElement(NumberKeyboardKey, {
|
|
175
|
+
key: "delete",
|
|
176
|
+
item: {
|
|
177
|
+
id: "delete",
|
|
178
|
+
type: "delete"
|
|
179
|
+
}
|
|
180
|
+
}), React__default.createElement(NumberKeyboardKey, {
|
|
181
|
+
key: "confirm",
|
|
182
|
+
item: {
|
|
183
|
+
id: "confirm",
|
|
184
|
+
type: "confirm"
|
|
185
|
+
}
|
|
186
|
+
})))));
|
|
245
187
|
};
|
|
246
188
|
NumberKeyboard.defaultProps = defaultProps;
|
|
247
189
|
NumberKeyboard.displayName = "NutNumberKeyboard";
|