@cniot/android-pda-components 0.2.17 → 0.2.21
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/README.md +4 -21
- package/build/assets/index.51a8714a.css +1 -0
- package/build/assets/{index.8c37299c.js → index.b428d9a3.js} +29 -29
- package/build/assets/vendor.999402d8.js +40 -0
- package/build/index.html +3 -3
- package/change.md +7 -0
- package/package.json +1 -1
- package/packages/AppList/doc.jsx +138 -0
- package/packages/AppList/index.jsx +33 -0
- package/packages/AppList/index.less +52 -0
- package/packages/BaseLayout/BarcodeScan.jsx +88 -0
- package/packages/BaseLayout/BaseLayoutContainer.jsx +208 -0
- package/packages/BaseLayout/RfidOnce.jsx +106 -0
- package/packages/BaseLayout/RfidScan.jsx +118 -0
- package/packages/BaseLayout/doc.jsx +177 -0
- package/packages/BaseLayout/index.jsx +52 -0
- package/packages/BaseLayout/index.less +47 -0
- package/packages/Button/doc.jsx +62 -0
- package/packages/Button/index.jsx +27 -0
- package/packages/Button/index.less +62 -0
- package/packages/Confirm/doc.jsx +147 -0
- package/packages/Confirm/index.jsx +71 -0
- package/packages/Confirm/index.less +55 -0
- package/packages/Header/doc.jsx +171 -0
- package/packages/Header/index.jsx +191 -0
- package/packages/Header/index.less +71 -0
- package/packages/InfoCard/doc.jsx +244 -0
- package/packages/InfoCard/index.jsx +67 -0
- package/packages/InfoCard/index.less +111 -0
- package/packages/List/doc.jsx +89 -0
- package/packages/List/index.jsx +54 -0
- package/packages/List/index.less +43 -0
- package/packages/Overlay/doc.jsx +103 -0
- package/packages/Overlay/index.jsx +42 -0
- package/packages/Overlay/index.less +28 -0
- package/packages/PdaActionSheet/doc.jsx +193 -0
- package/packages/PdaActionSheet/index.jsx +44 -0
- package/packages/PdaActionSheet/index.less +65 -0
- package/packages/PdaDistanceCard/doc.jsx +62 -0
- package/packages/PdaDistanceCard/index.jsx +35 -0
- package/packages/PdaDistanceCard/index.less +42 -0
- package/packages/PdaFinishCard/doc.jsx +111 -0
- package/packages/PdaFinishCard/index.jsx +62 -0
- package/packages/PdaFinishCard/index.less +62 -0
- package/packages/PdaInfiniteScroll/doc.jsx +121 -0
- package/packages/PdaInfiniteScroll/index.jsx +114 -0
- package/packages/PdaInfiniteScroll/index.less +12 -0
- package/packages/PdaInfiniteScroll/utils.jsx +25 -0
- package/packages/PdaSteps/PdaStep/index.jsx +38 -0
- package/packages/PdaSteps/PdaStep/index.less +70 -0
- package/packages/PdaSteps/PdaSteps/index.jsx +33 -0
- package/packages/PdaSteps/PdaSteps/index.less +0 -0
- package/packages/PdaSteps/doc.jsx +131 -0
- package/packages/PdaSteps/index.jsx +5 -0
- package/packages/PdaTitle/doc.jsx +102 -0
- package/packages/PdaTitle/index.jsx +51 -0
- package/packages/Presentation/doc.jsx +72 -0
- package/packages/Presentation/index.jsx +25 -0
- package/packages/Presentation/index.less +31 -0
- package/packages/SelectCard/doc.jsx +57 -0
- package/packages/SelectCard/index.jsx +13 -0
- package/packages/SelectCard/index.less +30 -0
- package/packages/SimpleCard/doc.jsx +59 -0
- package/packages/SimpleCard/index.jsx +13 -0
- package/packages/SimpleCard/index.less +38 -0
- package/packages/SimpleCardBlock/doc.jsx +77 -0
- package/packages/SimpleCardBlock/index.jsx +43 -0
- package/packages/SimpleCardBlock/index.less +26 -0
- package/packages/SubCard/doc.jsx +63 -0
- package/packages/SubCard/index.jsx +28 -0
- package/packages/SubCard/index.less +64 -0
- package/packages/Tag/doc.jsx +47 -0
- package/packages/Tag/index.jsx +12 -0
- package/packages/Tag/index.less +22 -0
- package/packages/TaskCard/doc.jsx +151 -0
- package/packages/TaskCard/index.jsx +65 -0
- package/packages/TaskCard/index.less +101 -0
- package/packages/Toast/doc.jsx +112 -0
- package/packages/Toast/index.jsx +7 -0
- package/packages/Toast/index.less +23 -0
- package/packages/Toast/methods.jsx +77 -0
- package/packages/Toast/toast.jsx +96 -0
- package/packages/WakeKeyborard/doc.jsx +170 -0
- package/packages/WakeKeyborard/index.jsx +61 -0
- package/packages/WakeKeyborard/index.less +55 -0
- package/packages/WakeKeyborard/keyborard.jsx +61 -0
- package/packages/doc.jsx +19 -0
- package/packages/global.less +7 -0
- package/packages/index.jsx +60 -0
- package/packages/index.less +3 -0
- package/packages/pageflow-system-pages/alert/doc.jsx +70 -0
- package/packages/pageflow-system-pages/alert/index.jsx +22 -0
- package/packages/pageflow-system-pages/confirm/doc.jsx +118 -0
- package/packages/pageflow-system-pages/confirm/index.jsx +31 -0
- package/packages/pageflow-system-pages/debug/index.jsx +27 -0
- package/packages/pageflow-system-pages/debug/index.less +5 -0
- package/packages/pageflow-system-pages/index.jsx +38 -0
- package/packages/pageflow-system-pages/loading/index.jsx +37 -0
- package/packages/pageflow-system-pages/not-found/index.jsx +12 -0
- package/packages/pageflow-system-pages/not-found/index.less +26 -0
- package/packages/pageflow-system-pages/prompt/doc.jsx +95 -0
- package/packages/pageflow-system-pages/prompt/index.jsx +43 -0
- package/packages/pageflow-system-pages/prompt/index.less +44 -0
- package/packages/pageflow-system-pages/start/index.jsx +28 -0
- package/packages/pageflow-system-pages/start/index.less +12 -0
- package/packages/pageflow-system-pages/toast/doc.jsx +76 -0
- package/packages/pageflow-system-pages/toast/index.jsx +42 -0
- package/packages/utils/index.js +56 -0
- package/packages/variable.less +4 -0
- package/build/assets/index.b8d6d64c.css +0 -1
- package/build/assets/vendor.5080796b.js +0 -40
- package/es/index.cjs.js +0 -7
- package/es/index.es.js +0 -2170
- package/es/style.css +0 -1
package/es/index.es.js
DELETED
|
@@ -1,2170 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defProps = Object.defineProperties;
|
|
3
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (a, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
var __objRest = (source, exclude) => {
|
|
21
|
-
var target = {};
|
|
22
|
-
for (var prop in source)
|
|
23
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
-
target[prop] = source[prop];
|
|
25
|
-
if (source != null && __getOwnPropSymbols)
|
|
26
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
-
target[prop] = source[prop];
|
|
29
|
-
}
|
|
30
|
-
return target;
|
|
31
|
-
};
|
|
32
|
-
var __publicField = (obj, key, value) => {
|
|
33
|
-
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
34
|
-
return value;
|
|
35
|
-
};
|
|
36
|
-
import React, { useState, useEffect, useRef, cloneElement, useCallback } from "react";
|
|
37
|
-
import ReactDOM from "react-dom";
|
|
38
|
-
var global = "";
|
|
39
|
-
var _classnames_2_3_1_classnames = { exports: {} };
|
|
40
|
-
/*!
|
|
41
|
-
Copyright (c) 2018 Jed Watson.
|
|
42
|
-
Licensed under the MIT License (MIT), see
|
|
43
|
-
http://jedwatson.github.io/classnames
|
|
44
|
-
*/
|
|
45
|
-
(function(module) {
|
|
46
|
-
(function() {
|
|
47
|
-
var hasOwn = {}.hasOwnProperty;
|
|
48
|
-
function classNames2() {
|
|
49
|
-
var classes = [];
|
|
50
|
-
for (var i = 0; i < arguments.length; i++) {
|
|
51
|
-
var arg = arguments[i];
|
|
52
|
-
if (!arg)
|
|
53
|
-
continue;
|
|
54
|
-
var argType = typeof arg;
|
|
55
|
-
if (argType === "string" || argType === "number") {
|
|
56
|
-
classes.push(arg);
|
|
57
|
-
} else if (Array.isArray(arg)) {
|
|
58
|
-
if (arg.length) {
|
|
59
|
-
var inner = classNames2.apply(null, arg);
|
|
60
|
-
if (inner) {
|
|
61
|
-
classes.push(inner);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
} else if (argType === "object") {
|
|
65
|
-
if (arg.toString === Object.prototype.toString) {
|
|
66
|
-
for (var key in arg) {
|
|
67
|
-
if (hasOwn.call(arg, key) && arg[key]) {
|
|
68
|
-
classes.push(key);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
} else {
|
|
72
|
-
classes.push(arg.toString());
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
return classes.join(" ");
|
|
77
|
-
}
|
|
78
|
-
if (module.exports) {
|
|
79
|
-
classNames2.default = classNames2;
|
|
80
|
-
module.exports = classNames2;
|
|
81
|
-
} else {
|
|
82
|
-
window.classNames = classNames2;
|
|
83
|
-
}
|
|
84
|
-
})();
|
|
85
|
-
})(_classnames_2_3_1_classnames);
|
|
86
|
-
var classNames = _classnames_2_3_1_classnames.exports;
|
|
87
|
-
var index$u = "";
|
|
88
|
-
function getTypeClass$2(type) {
|
|
89
|
-
return {
|
|
90
|
-
"center": "op-overlay center",
|
|
91
|
-
"top": "op-overlay top",
|
|
92
|
-
"bottom": "op-overlay bottom"
|
|
93
|
-
}[type] || "op-overlay";
|
|
94
|
-
}
|
|
95
|
-
function Overlay$1(props) {
|
|
96
|
-
const { verticalPosition = "center", visible = true, closable = false, onClosed = () => {
|
|
97
|
-
} } = props;
|
|
98
|
-
const [hidden, setHidden] = useState(!visible);
|
|
99
|
-
useEffect(() => {
|
|
100
|
-
setHidden(!visible);
|
|
101
|
-
}, [visible]);
|
|
102
|
-
const option = {};
|
|
103
|
-
if (closable) {
|
|
104
|
-
option.onClick = (e) => {
|
|
105
|
-
setHidden(true);
|
|
106
|
-
onClosed();
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
useEffect(() => {
|
|
110
|
-
setHidden(!visible);
|
|
111
|
-
}, [visible]);
|
|
112
|
-
return !hidden ? /* @__PURE__ */ React.createElement("div", __spreadValues({
|
|
113
|
-
className: getTypeClass$2(verticalPosition)
|
|
114
|
-
}, option), props.children) : null;
|
|
115
|
-
}
|
|
116
|
-
var index$t = "";
|
|
117
|
-
const blankFunc$6 = () => {
|
|
118
|
-
};
|
|
119
|
-
class PdaTitle extends React.Component {
|
|
120
|
-
constructor(props) {
|
|
121
|
-
super(props);
|
|
122
|
-
__publicField(this, "state", {
|
|
123
|
-
showMenu: false
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
render() {
|
|
127
|
-
const { className, goBack = true, goBackHandle = blankFunc$6, icon = "scan", title = "\u4EFB\u52A1", menuList = null } = this.props;
|
|
128
|
-
const { showMenu } = this.state;
|
|
129
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
130
|
-
className: classNames({ [className]: true, "pda-header": true })
|
|
131
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
132
|
-
className: "header-click-area",
|
|
133
|
-
onClick: goBack ? goBackHandle : blankFunc$6
|
|
134
|
-
}, goBack && /* @__PURE__ */ React.createElement("div", {
|
|
135
|
-
className: "pda-goback"
|
|
136
|
-
}), icon && /* @__PURE__ */ React.createElement("div", {
|
|
137
|
-
className: classNames({ "pda-header-icon": true, ["pda-header-icon-" + icon]: true })
|
|
138
|
-
})), /* @__PURE__ */ React.createElement("p", {
|
|
139
|
-
className: classNames({ "pda-title-text": true })
|
|
140
|
-
}, title), menuList ? /* @__PURE__ */ React.createElement("div", {
|
|
141
|
-
className: "pda-header-more",
|
|
142
|
-
onClick: (e) => {
|
|
143
|
-
this.setState({ showMenu: true });
|
|
144
|
-
}
|
|
145
|
-
}) : null, /* @__PURE__ */ React.createElement(Overlay$1, {
|
|
146
|
-
visible: showMenu,
|
|
147
|
-
verticalPosition: "bottom",
|
|
148
|
-
closable: true,
|
|
149
|
-
onClosed: (e) => this.setState({ showMenu: false })
|
|
150
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
151
|
-
className: "pda-menus"
|
|
152
|
-
}, menuList)));
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
var _keycode_2_2_1_keycode = { exports: {} };
|
|
156
|
-
(function(module, exports) {
|
|
157
|
-
function keyCode(searchInput) {
|
|
158
|
-
if (searchInput && typeof searchInput === "object") {
|
|
159
|
-
var hasKeyCode = searchInput.which || searchInput.keyCode || searchInput.charCode;
|
|
160
|
-
if (hasKeyCode)
|
|
161
|
-
searchInput = hasKeyCode;
|
|
162
|
-
}
|
|
163
|
-
if (typeof searchInput === "number")
|
|
164
|
-
return names[searchInput];
|
|
165
|
-
var search = String(searchInput);
|
|
166
|
-
var foundNamedKey = codes[search.toLowerCase()];
|
|
167
|
-
if (foundNamedKey)
|
|
168
|
-
return foundNamedKey;
|
|
169
|
-
var foundNamedKey = aliases[search.toLowerCase()];
|
|
170
|
-
if (foundNamedKey)
|
|
171
|
-
return foundNamedKey;
|
|
172
|
-
if (search.length === 1)
|
|
173
|
-
return search.charCodeAt(0);
|
|
174
|
-
return void 0;
|
|
175
|
-
}
|
|
176
|
-
keyCode.isEventKey = function isEventKey(event, nameOrCode) {
|
|
177
|
-
if (event && typeof event === "object") {
|
|
178
|
-
var keyCode2 = event.which || event.keyCode || event.charCode;
|
|
179
|
-
if (keyCode2 === null || keyCode2 === void 0) {
|
|
180
|
-
return false;
|
|
181
|
-
}
|
|
182
|
-
if (typeof nameOrCode === "string") {
|
|
183
|
-
var foundNamedKey = codes[nameOrCode.toLowerCase()];
|
|
184
|
-
if (foundNamedKey) {
|
|
185
|
-
return foundNamedKey === keyCode2;
|
|
186
|
-
}
|
|
187
|
-
var foundNamedKey = aliases[nameOrCode.toLowerCase()];
|
|
188
|
-
if (foundNamedKey) {
|
|
189
|
-
return foundNamedKey === keyCode2;
|
|
190
|
-
}
|
|
191
|
-
} else if (typeof nameOrCode === "number") {
|
|
192
|
-
return nameOrCode === keyCode2;
|
|
193
|
-
}
|
|
194
|
-
return false;
|
|
195
|
-
}
|
|
196
|
-
};
|
|
197
|
-
exports = module.exports = keyCode;
|
|
198
|
-
var codes = exports.code = exports.codes = {
|
|
199
|
-
"backspace": 8,
|
|
200
|
-
"tab": 9,
|
|
201
|
-
"enter": 13,
|
|
202
|
-
"shift": 16,
|
|
203
|
-
"ctrl": 17,
|
|
204
|
-
"alt": 18,
|
|
205
|
-
"pause/break": 19,
|
|
206
|
-
"caps lock": 20,
|
|
207
|
-
"esc": 27,
|
|
208
|
-
"space": 32,
|
|
209
|
-
"page up": 33,
|
|
210
|
-
"page down": 34,
|
|
211
|
-
"end": 35,
|
|
212
|
-
"home": 36,
|
|
213
|
-
"left": 37,
|
|
214
|
-
"up": 38,
|
|
215
|
-
"right": 39,
|
|
216
|
-
"down": 40,
|
|
217
|
-
"insert": 45,
|
|
218
|
-
"delete": 46,
|
|
219
|
-
"command": 91,
|
|
220
|
-
"left command": 91,
|
|
221
|
-
"right command": 93,
|
|
222
|
-
"numpad *": 106,
|
|
223
|
-
"numpad +": 107,
|
|
224
|
-
"numpad -": 109,
|
|
225
|
-
"numpad .": 110,
|
|
226
|
-
"numpad /": 111,
|
|
227
|
-
"num lock": 144,
|
|
228
|
-
"scroll lock": 145,
|
|
229
|
-
"my computer": 182,
|
|
230
|
-
"my calculator": 183,
|
|
231
|
-
";": 186,
|
|
232
|
-
"=": 187,
|
|
233
|
-
",": 188,
|
|
234
|
-
"-": 189,
|
|
235
|
-
".": 190,
|
|
236
|
-
"/": 191,
|
|
237
|
-
"`": 192,
|
|
238
|
-
"[": 219,
|
|
239
|
-
"\\": 220,
|
|
240
|
-
"]": 221,
|
|
241
|
-
"'": 222
|
|
242
|
-
};
|
|
243
|
-
var aliases = exports.aliases = {
|
|
244
|
-
"windows": 91,
|
|
245
|
-
"\u21E7": 16,
|
|
246
|
-
"\u2325": 18,
|
|
247
|
-
"\u2303": 17,
|
|
248
|
-
"\u2318": 91,
|
|
249
|
-
"ctl": 17,
|
|
250
|
-
"control": 17,
|
|
251
|
-
"option": 18,
|
|
252
|
-
"pause": 19,
|
|
253
|
-
"break": 19,
|
|
254
|
-
"caps": 20,
|
|
255
|
-
"return": 13,
|
|
256
|
-
"escape": 27,
|
|
257
|
-
"spc": 32,
|
|
258
|
-
"spacebar": 32,
|
|
259
|
-
"pgup": 33,
|
|
260
|
-
"pgdn": 34,
|
|
261
|
-
"ins": 45,
|
|
262
|
-
"del": 46,
|
|
263
|
-
"cmd": 91
|
|
264
|
-
};
|
|
265
|
-
/*!
|
|
266
|
-
* Programatically add the following
|
|
267
|
-
*/
|
|
268
|
-
for (i = 97; i < 123; i++)
|
|
269
|
-
codes[String.fromCharCode(i)] = i - 32;
|
|
270
|
-
for (var i = 48; i < 58; i++)
|
|
271
|
-
codes[i - 48] = i;
|
|
272
|
-
for (i = 1; i < 13; i++)
|
|
273
|
-
codes["f" + i] = i + 111;
|
|
274
|
-
for (i = 0; i < 10; i++)
|
|
275
|
-
codes["numpad " + i] = i + 96;
|
|
276
|
-
var names = exports.names = exports.title = {};
|
|
277
|
-
for (i in codes)
|
|
278
|
-
names[codes[i]] = i;
|
|
279
|
-
for (var alias in aliases) {
|
|
280
|
-
codes[alias] = aliases[alias];
|
|
281
|
-
}
|
|
282
|
-
})(_keycode_2_2_1_keycode, _keycode_2_2_1_keycode.exports);
|
|
283
|
-
var keycode = _keycode_2_2_1_keycode.exports;
|
|
284
|
-
var index$s = "";
|
|
285
|
-
function Button(props) {
|
|
286
|
-
const { type = "default", onClick, className = "", tabIndex = 1, dataClick = "" } = props;
|
|
287
|
-
let opt = {};
|
|
288
|
-
if (dataClick) {
|
|
289
|
-
opt["data-click"] = dataClick;
|
|
290
|
-
}
|
|
291
|
-
return /* @__PURE__ */ React.createElement("button", __spreadValues({
|
|
292
|
-
className: `pda-button pda-button-${type} ${className}`,
|
|
293
|
-
onClick,
|
|
294
|
-
tabIndex
|
|
295
|
-
}, opt), props.children);
|
|
296
|
-
}
|
|
297
|
-
function ButtonGroup(props) {
|
|
298
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
299
|
-
className: "button-group"
|
|
300
|
-
}, props.children);
|
|
301
|
-
}
|
|
302
|
-
Button.Group = ButtonGroup;
|
|
303
|
-
var index$r = "";
|
|
304
|
-
const SPECIAL_KEY_MAP = ["fn"];
|
|
305
|
-
const empty$3 = () => {
|
|
306
|
-
};
|
|
307
|
-
function index$q(props) {
|
|
308
|
-
const {
|
|
309
|
-
onBack,
|
|
310
|
-
icon,
|
|
311
|
-
title,
|
|
312
|
-
menus = [],
|
|
313
|
-
onClickMenuItem = empty$3,
|
|
314
|
-
cancelMenuText,
|
|
315
|
-
menuShortcutKey,
|
|
316
|
-
backShortcutKey
|
|
317
|
-
} = props;
|
|
318
|
-
const [showMenus, setShowMenus] = React.useState(false);
|
|
319
|
-
React.useEffect(function() {
|
|
320
|
-
if (menuShortcutKey) {
|
|
321
|
-
return bindShortcutKey(getShortcutKeyCodes(menuShortcutKey), function() {
|
|
322
|
-
setShowMenus(true);
|
|
323
|
-
});
|
|
324
|
-
}
|
|
325
|
-
}, [menuShortcutKey]);
|
|
326
|
-
React.useEffect(function() {
|
|
327
|
-
if (backShortcutKey && onBack) {
|
|
328
|
-
return bindShortcutKey(getShortcutKeyCodes(backShortcutKey), function() {
|
|
329
|
-
onBack("back");
|
|
330
|
-
});
|
|
331
|
-
}
|
|
332
|
-
}, [backShortcutKey, onBack]);
|
|
333
|
-
React.useEffect(() => {
|
|
334
|
-
return onKeyBoradBack(function() {
|
|
335
|
-
onBack && onBack("back");
|
|
336
|
-
});
|
|
337
|
-
}, []);
|
|
338
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
339
|
-
className: "pda-header"
|
|
340
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
341
|
-
className: "header-click-area"
|
|
342
|
-
}, onBack ? /* @__PURE__ */ React.createElement("div", {
|
|
343
|
-
className: "pda-goback",
|
|
344
|
-
onClick: () => onBack("back")
|
|
345
|
-
}) : null, icon && /* @__PURE__ */ React.createElement("div", {
|
|
346
|
-
className: `pda-header-icon pda-header-icon-${icon}`
|
|
347
|
-
})), /* @__PURE__ */ React.createElement("div", {
|
|
348
|
-
className: "pda-title-text"
|
|
349
|
-
}, title), menus && menus.length ? /* @__PURE__ */ React.createElement("div", {
|
|
350
|
-
className: "pda-header-more",
|
|
351
|
-
onClick: () => setShowMenus(true)
|
|
352
|
-
}) : null, /* @__PURE__ */ React.createElement(Overlay$1, {
|
|
353
|
-
visible: showMenus,
|
|
354
|
-
verticalPosition: "bottom",
|
|
355
|
-
closable: false,
|
|
356
|
-
onClosed: () => setShowMenus(false)
|
|
357
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
358
|
-
className: "pda-menus"
|
|
359
|
-
}, menus.map((item, index2) => {
|
|
360
|
-
return /* @__PURE__ */ React.createElement(Button, {
|
|
361
|
-
onClick: () => {
|
|
362
|
-
setShowMenus(false);
|
|
363
|
-
onClickMenuItem(item);
|
|
364
|
-
},
|
|
365
|
-
key: item.key || index2
|
|
366
|
-
}, item.label);
|
|
367
|
-
}), cancelMenuText ? /* @__PURE__ */ React.createElement("div", {
|
|
368
|
-
style: { marginTop: 20 }
|
|
369
|
-
}, /* @__PURE__ */ React.createElement(Button, {
|
|
370
|
-
onClick: () => setShowMenus(false)
|
|
371
|
-
}, cancelMenuText)) : null)));
|
|
372
|
-
}
|
|
373
|
-
function getShortcutKeyCodes(shortcutKey) {
|
|
374
|
-
const shortcutKeys = shortcutKey.indexOf(",") > -1 ? shortcutKey.split(",") : [shortcutKey];
|
|
375
|
-
return shortcutKeys.map((k) => {
|
|
376
|
-
if (SPECIAL_KEY_MAP.indexOf(k.toLowerCase()) > -1) {
|
|
377
|
-
return k.toLowerCase();
|
|
378
|
-
}
|
|
379
|
-
const kc = keycode(k);
|
|
380
|
-
if (kc === void 0) {
|
|
381
|
-
console.warn("OPButton.shortcutKey error key value by:", k);
|
|
382
|
-
}
|
|
383
|
-
return kc;
|
|
384
|
-
}).filter((k) => k !== void 0);
|
|
385
|
-
}
|
|
386
|
-
function bindShortcutKey(keys, callback) {
|
|
387
|
-
function keyUpCallback(event) {
|
|
388
|
-
const key = event.key.toLowerCase();
|
|
389
|
-
const keyCode = SPECIAL_KEY_MAP.indexOf(key) > -1 ? key : event.keyCode;
|
|
390
|
-
if (keys.indexOf(keyCode) > -1) {
|
|
391
|
-
callback && callback(event);
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
document.addEventListener("keyup", keyUpCallback);
|
|
395
|
-
return function() {
|
|
396
|
-
document.removeEventListener("keyup", keyUpCallback);
|
|
397
|
-
};
|
|
398
|
-
}
|
|
399
|
-
function onKeyBoradBack(fn) {
|
|
400
|
-
function keyPressed(data) {
|
|
401
|
-
if (data.param.originValue == "back") {
|
|
402
|
-
fn && fn();
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
document.addEventListener("keyPressed", keyPressed, false);
|
|
406
|
-
return function() {
|
|
407
|
-
document.removeEventListener("keyPressed", keyPressed);
|
|
408
|
-
};
|
|
409
|
-
}
|
|
410
|
-
var index$p = "";
|
|
411
|
-
class PdaInfoCard$2 extends React.Component {
|
|
412
|
-
constructor(props) {
|
|
413
|
-
super(props);
|
|
414
|
-
}
|
|
415
|
-
render() {
|
|
416
|
-
const { className = "", title, highlightInfo, subTitle, subHighlightInfo, subHighlightSubInfo, infoImage, tagText, highlightInfoCN, highlightSubInfo, percentage, highlightSubInfoCN, boldInfo, infoList = [], style = {}, theme = "light" } = this.props;
|
|
417
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
418
|
-
className: classNames({ [className]: true, "pda-info-card": true, "pda-info-card-dark": theme === "dark" }),
|
|
419
|
-
style
|
|
420
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
421
|
-
className: "pda-info-card-title-section"
|
|
422
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
423
|
-
className: "pda-info-card-title"
|
|
424
|
-
}, title), tagText ? /* @__PURE__ */ React.createElement("div", {
|
|
425
|
-
className: "pda-info-card-tag"
|
|
426
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
427
|
-
className: "pda-info-card-tag-text"
|
|
428
|
-
}, tagText)) : null), /* @__PURE__ */ React.createElement("div", {
|
|
429
|
-
className: "pda-info-card-highlight-section"
|
|
430
|
-
}, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("div", {
|
|
431
|
-
className: "pda-info-card-highlight"
|
|
432
|
-
}, /* @__PURE__ */ React.createElement("span", {
|
|
433
|
-
className: "pda-info-card-highlight1"
|
|
434
|
-
}, highlightInfo), /* @__PURE__ */ React.createElement("span", {
|
|
435
|
-
className: "pda-info-card-highlight1CN"
|
|
436
|
-
}, highlightInfoCN), /* @__PURE__ */ React.createElement("span", {
|
|
437
|
-
className: "pda-info-card-highlight2"
|
|
438
|
-
}, highlightSubInfo), /* @__PURE__ */ React.createElement("span", {
|
|
439
|
-
className: "pda-info-card-highlight2CN"
|
|
440
|
-
}, highlightSubInfoCN)), subTitle ? /* @__PURE__ */ React.createElement("div", {
|
|
441
|
-
className: "pda-info-card-title"
|
|
442
|
-
}, subTitle) : null, subHighlightInfo ? /* @__PURE__ */ React.createElement("div", {
|
|
443
|
-
className: "pda-info-card-highlight"
|
|
444
|
-
}, /* @__PURE__ */ React.createElement("span", {
|
|
445
|
-
className: "pda-info-card-highlight1"
|
|
446
|
-
}, subHighlightInfo), /* @__PURE__ */ React.createElement("span", {
|
|
447
|
-
className: "pda-info-card-highlight2"
|
|
448
|
-
}, subHighlightSubInfo)) : null), infoImage ? /* @__PURE__ */ React.createElement("img", {
|
|
449
|
-
src: infoImage,
|
|
450
|
-
width: 150,
|
|
451
|
-
height: 150
|
|
452
|
-
}) : null), percentage !== void 0 ? /* @__PURE__ */ React.createElement("div", {
|
|
453
|
-
className: "pda-info-card-progress"
|
|
454
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
455
|
-
className: "pda-info-card-progress-inside",
|
|
456
|
-
style: { width: `${percentage * 100}%` }
|
|
457
|
-
})) : null, /* @__PURE__ */ React.createElement("div", {
|
|
458
|
-
className: "pda-info-card-bold"
|
|
459
|
-
}, boldInfo), infoList.map((item, index2) => {
|
|
460
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
461
|
-
key: index2,
|
|
462
|
-
className: "pda-info-card-list"
|
|
463
|
-
}, /* @__PURE__ */ React.createElement("span", null, item.label || ""), "\xA0\xA0", /* @__PURE__ */ React.createElement("span", null, item.content || ""));
|
|
464
|
-
}));
|
|
465
|
-
}
|
|
466
|
-
}
|
|
467
|
-
PdaInfoCard$2.IMAGE_1 = "https://img.alicdn.com/imgextra/i2/O1CN01qYuxip1ME9zhdL9XG_!!6000000001402-2-tps-150-150.png";
|
|
468
|
-
var index$o = "";
|
|
469
|
-
class PdaListItem extends React.Component {
|
|
470
|
-
constructor(props) {
|
|
471
|
-
super(props);
|
|
472
|
-
}
|
|
473
|
-
render() {
|
|
474
|
-
const { className, header, onClick = () => {
|
|
475
|
-
}, onHeightLightClick = () => {
|
|
476
|
-
}, onIconClick = () => {
|
|
477
|
-
}, highlightText, highlightSubText, stateTextList = [], stateList = [], subInfoList = [], style = {}, icon } = this.props;
|
|
478
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
479
|
-
className: classNames({ [className]: true, "pda-list-item": true }),
|
|
480
|
-
style,
|
|
481
|
-
onClick
|
|
482
|
-
}, !!header ? /* @__PURE__ */ React.createElement("div", {
|
|
483
|
-
className: "pda-listitem-header"
|
|
484
|
-
}, header) : null, /* @__PURE__ */ React.createElement("div", {
|
|
485
|
-
onClick: onHeightLightClick,
|
|
486
|
-
className: classNames({ "pda-listitem-highlight": true })
|
|
487
|
-
}, /* @__PURE__ */ React.createElement("div", null, highlightText), /* @__PURE__ */ React.createElement("div", null, highlightSubText)), /* @__PURE__ */ React.createElement("div", {
|
|
488
|
-
className: "pda-listitem-state-text"
|
|
489
|
-
}, stateTextList.map((item, index2) => {
|
|
490
|
-
return /* @__PURE__ */ React.createElement("span", {
|
|
491
|
-
key: index2
|
|
492
|
-
}, item.label || "", "\uFF5C");
|
|
493
|
-
})), /* @__PURE__ */ React.createElement("div", {
|
|
494
|
-
className: "pda-listitem-state-block"
|
|
495
|
-
}, stateList.map((item, index2) => {
|
|
496
|
-
const type = item && item.type ? item.type : "default";
|
|
497
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
498
|
-
key: index2,
|
|
499
|
-
className: type
|
|
500
|
-
}, item.label || "");
|
|
501
|
-
})), icon ? /* @__PURE__ */ React.createElement("div", {
|
|
502
|
-
onClick: onIconClick,
|
|
503
|
-
className: "pda-listitem-icon"
|
|
504
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
505
|
-
className: classNames({ "listitem-icon-container": true, ["listitem-icon-" + icon]: true })
|
|
506
|
-
})) : null, subInfoList.map((item, index2) => {
|
|
507
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
508
|
-
key: index2,
|
|
509
|
-
className: "pda-listitem-subinfo"
|
|
510
|
-
}, /* @__PURE__ */ React.createElement("span", null, item.label || ""), "\xA0\xA0", /* @__PURE__ */ React.createElement("span", null, item.content || ""));
|
|
511
|
-
}));
|
|
512
|
-
}
|
|
513
|
-
}
|
|
514
|
-
var index$n = "";
|
|
515
|
-
function empty$2() {
|
|
516
|
-
}
|
|
517
|
-
function Confirm(props) {
|
|
518
|
-
const { title = "title", message = null, subMessage = [], okText = "okText", cancelText = null, okDataClick = null, cancelDataClick = null, onClick = empty$2, type = "primary", insertButtons = [], appendButtons = [] } = props;
|
|
519
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
520
|
-
className: classNames({ "confirm-wrap": true, ["confirm-" + type]: true })
|
|
521
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
522
|
-
className: "confirm-content"
|
|
523
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
524
|
-
className: "confirm-title"
|
|
525
|
-
}, title), message ? /* @__PURE__ */ React.createElement("div", {
|
|
526
|
-
className: "confirm-message"
|
|
527
|
-
}, message) : null, subMessage.length ? /* @__PURE__ */ React.createElement("div", {
|
|
528
|
-
className: "confirm-sub-message"
|
|
529
|
-
}, subMessage.map((item, index2) => {
|
|
530
|
-
const { label, content } = item;
|
|
531
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
532
|
-
className: "confirm-sub-block",
|
|
533
|
-
key: label ? label : index2
|
|
534
|
-
}, /* @__PURE__ */ React.createElement("p", {
|
|
535
|
-
className: "confirm-sub-label"
|
|
536
|
-
}, label ? label + " : " : ""), /* @__PURE__ */ React.createElement("p", {
|
|
537
|
-
className: "confirm-sub-content"
|
|
538
|
-
}, content || ""));
|
|
539
|
-
})) : null), /* @__PURE__ */ React.createElement("div", {
|
|
540
|
-
className: "confirm-btns"
|
|
541
|
-
}, insertButtons.length > 0 ? /* @__PURE__ */ React.createElement(Button.Group, null, insertButtons.map((item, index2) => /* @__PURE__ */ React.createElement(Button, {
|
|
542
|
-
key: index2,
|
|
543
|
-
onClick: () => onClick(item.value),
|
|
544
|
-
dataClick: item.dataClick
|
|
545
|
-
}, item.label))) : null, /* @__PURE__ */ React.createElement(Button.Group, null, cancelText ? /* @__PURE__ */ React.createElement(Button, {
|
|
546
|
-
className: "confirm-cancel-button",
|
|
547
|
-
onClick: () => onClick(false),
|
|
548
|
-
dataClick: cancelDataClick
|
|
549
|
-
}, cancelText) : null, /* @__PURE__ */ React.createElement(Button, {
|
|
550
|
-
type: "primary",
|
|
551
|
-
onClick: () => onClick(true),
|
|
552
|
-
dataClick: okDataClick
|
|
553
|
-
}, okText)), appendButtons.length > 0 ? /* @__PURE__ */ React.createElement(Button.Group, null, appendButtons.map((item, index2) => /* @__PURE__ */ React.createElement(Button, {
|
|
554
|
-
key: index2,
|
|
555
|
-
onClick: () => onClick(item.value),
|
|
556
|
-
dataClick: item.dataClick
|
|
557
|
-
}, item.label))) : null));
|
|
558
|
-
}
|
|
559
|
-
var index$m = "";
|
|
560
|
-
function WindVaneLog(param) {
|
|
561
|
-
const params = {
|
|
562
|
-
domain: "logger",
|
|
563
|
-
method: "deviceLog",
|
|
564
|
-
params: param
|
|
565
|
-
};
|
|
566
|
-
WindVane.call("WindvanePlugin", "invoke", JSON.stringify(params), function(e) {
|
|
567
|
-
}, function(e) {
|
|
568
|
-
});
|
|
569
|
-
}
|
|
570
|
-
function resolveContainer(getContainer) {
|
|
571
|
-
const container = typeof getContainer === "function" ? getContainer() : getContainer;
|
|
572
|
-
return container || document.body;
|
|
573
|
-
}
|
|
574
|
-
function isUndefined(v) {
|
|
575
|
-
return v === void 0;
|
|
576
|
-
}
|
|
577
|
-
function mergeProps(...items) {
|
|
578
|
-
function customizer(objValue, srcValue) {
|
|
579
|
-
return isUndefined(srcValue) ? objValue : srcValue;
|
|
580
|
-
}
|
|
581
|
-
let ret = Object.assign({}, items[0]);
|
|
582
|
-
for (let i = 1; i < items.length; i++) {
|
|
583
|
-
ret = Object.assign(ret, items[i], customizer);
|
|
584
|
-
}
|
|
585
|
-
return ret;
|
|
586
|
-
}
|
|
587
|
-
function playSound(sound) {
|
|
588
|
-
if (window.WindVane) {
|
|
589
|
-
var params = {
|
|
590
|
-
domain: "audio",
|
|
591
|
-
method: "playSound",
|
|
592
|
-
params: { sound }
|
|
593
|
-
};
|
|
594
|
-
WindVane.call("WindvanePlugin", "invoke", JSON.stringify(params));
|
|
595
|
-
}
|
|
596
|
-
}
|
|
597
|
-
function getTypeClass$1(type) {
|
|
598
|
-
return {
|
|
599
|
-
"success": "toast-wrap success",
|
|
600
|
-
"warning": "toast-wrap warning",
|
|
601
|
-
"error": "toast-wrap error"
|
|
602
|
-
}[type] || "toast-wrap";
|
|
603
|
-
}
|
|
604
|
-
function Toast(props) {
|
|
605
|
-
const { title = "title", message = "message", type = "success", duration = null } = props;
|
|
606
|
-
const [hidden, setHidden] = useState(false);
|
|
607
|
-
useEffect(() => {
|
|
608
|
-
if (window.WindVane) {
|
|
609
|
-
if (type === "warning") {
|
|
610
|
-
playSound("error1");
|
|
611
|
-
window.WindVane.call("WVMotion", "vibrate", { duration: 400 });
|
|
612
|
-
} else if (type === "error") {
|
|
613
|
-
playSound("error2");
|
|
614
|
-
window.WindVane.call("WVMotion", "vibrate", { duration: 200 });
|
|
615
|
-
setTimeout(() => {
|
|
616
|
-
window.WindVane.call("WVMotion", "vibrate", { duration: 300 });
|
|
617
|
-
}, 250);
|
|
618
|
-
}
|
|
619
|
-
}
|
|
620
|
-
}, []);
|
|
621
|
-
if (duration) {
|
|
622
|
-
setTimeout(() => {
|
|
623
|
-
setHidden(true);
|
|
624
|
-
}, duration);
|
|
625
|
-
}
|
|
626
|
-
return !hidden ? /* @__PURE__ */ React.createElement("div", {
|
|
627
|
-
className: getTypeClass$1(type)
|
|
628
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
629
|
-
className: "toast-title"
|
|
630
|
-
}, title), /* @__PURE__ */ React.createElement("div", {
|
|
631
|
-
className: "toast-message"
|
|
632
|
-
}, message)) : null;
|
|
633
|
-
}
|
|
634
|
-
const defaultProps$1 = {
|
|
635
|
-
maskClickable: true,
|
|
636
|
-
stopPropagation: ["click"]
|
|
637
|
-
};
|
|
638
|
-
const InternalToast = (p) => {
|
|
639
|
-
const props = mergeProps(defaultProps$1, p);
|
|
640
|
-
const { maskClickable, content, icon, position, title, message, type, visible } = props;
|
|
641
|
-
return /* @__PURE__ */ React.createElement(Overlay$1, {
|
|
642
|
-
visible,
|
|
643
|
-
verticalPosition: "bottom",
|
|
644
|
-
closable: true
|
|
645
|
-
}, /* @__PURE__ */ React.createElement(Toast, {
|
|
646
|
-
title,
|
|
647
|
-
message,
|
|
648
|
-
type
|
|
649
|
-
}));
|
|
650
|
-
};
|
|
651
|
-
const containers = [];
|
|
652
|
-
function unmount(container) {
|
|
653
|
-
const unmountResult = ReactDOM.unmountComponentAtNode(container);
|
|
654
|
-
if (unmountResult && container.parentNode) {
|
|
655
|
-
container.parentNode.removeChild(container);
|
|
656
|
-
}
|
|
657
|
-
}
|
|
658
|
-
const defaultProps = {
|
|
659
|
-
duration: 2e3
|
|
660
|
-
};
|
|
661
|
-
function show(p) {
|
|
662
|
-
const props = mergeProps(defaultProps, p);
|
|
663
|
-
let timer = 0;
|
|
664
|
-
const { getContainer = () => document.body } = props;
|
|
665
|
-
const container = document.createElement("div");
|
|
666
|
-
const bodyContainer = resolveContainer(getContainer);
|
|
667
|
-
bodyContainer.appendChild(container);
|
|
668
|
-
clear();
|
|
669
|
-
containers.push(container);
|
|
670
|
-
function TempToast() {
|
|
671
|
-
const [visible, setVisible] = useState(true);
|
|
672
|
-
useEffect(() => {
|
|
673
|
-
return () => {
|
|
674
|
-
props.afterClose && props.afterClose();
|
|
675
|
-
};
|
|
676
|
-
}, []);
|
|
677
|
-
useEffect(() => {
|
|
678
|
-
if (props.duration === 0) {
|
|
679
|
-
return;
|
|
680
|
-
}
|
|
681
|
-
timer = window.setTimeout(() => {
|
|
682
|
-
setVisible(false);
|
|
683
|
-
}, props.duration);
|
|
684
|
-
return () => {
|
|
685
|
-
window.clearTimeout(timer);
|
|
686
|
-
};
|
|
687
|
-
}, []);
|
|
688
|
-
return /* @__PURE__ */ React.createElement(InternalToast, __spreadProps(__spreadValues({}, props), {
|
|
689
|
-
getContainer: () => container,
|
|
690
|
-
visible,
|
|
691
|
-
afterClose: () => {
|
|
692
|
-
unmount(container);
|
|
693
|
-
}
|
|
694
|
-
}));
|
|
695
|
-
}
|
|
696
|
-
ReactDOM.render(/* @__PURE__ */ React.createElement(TempToast, null), container);
|
|
697
|
-
}
|
|
698
|
-
function clear() {
|
|
699
|
-
while (true) {
|
|
700
|
-
const container = containers.pop();
|
|
701
|
-
if (!container)
|
|
702
|
-
break;
|
|
703
|
-
unmount(container);
|
|
704
|
-
}
|
|
705
|
-
}
|
|
706
|
-
Toast.show = show;
|
|
707
|
-
Toast.clear = clear;
|
|
708
|
-
function Alert(props) {
|
|
709
|
-
const { service, data = {} } = props;
|
|
710
|
-
const onClickCallback = React.useCallback(function() {
|
|
711
|
-
service.onNext(true);
|
|
712
|
-
}, [service]);
|
|
713
|
-
return /* @__PURE__ */ React.createElement(Overlay$1, {
|
|
714
|
-
verticalPosition: "bottom"
|
|
715
|
-
}, /* @__PURE__ */ React.createElement(Confirm, __spreadProps(__spreadValues({}, data), {
|
|
716
|
-
onClick: onClickCallback
|
|
717
|
-
})));
|
|
718
|
-
}
|
|
719
|
-
function Start(props) {
|
|
720
|
-
const { action, appManager, service } = props;
|
|
721
|
-
const onReStart = React.useCallback(function() {
|
|
722
|
-
service.onStart(appManager.config.appId);
|
|
723
|
-
});
|
|
724
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
725
|
-
style: {
|
|
726
|
-
display: "flex",
|
|
727
|
-
flexDirection: "column",
|
|
728
|
-
justifyContent: "center",
|
|
729
|
-
alignItems: "center",
|
|
730
|
-
width: "100vw",
|
|
731
|
-
height: "100vh"
|
|
732
|
-
}
|
|
733
|
-
}, /* @__PURE__ */ React.createElement(Button, {
|
|
734
|
-
type: "primary",
|
|
735
|
-
onClick: onReStart
|
|
736
|
-
}, "\u5F00\u59CB\u4F5C\u4E1A"), /* @__PURE__ */ React.createElement("br", null), /* @__PURE__ */ React.createElement("div", null, appManager.config.appId), /* @__PURE__ */ React.createElement("div", null, appManager.config.groupId));
|
|
737
|
-
}
|
|
738
|
-
function confirm(props) {
|
|
739
|
-
const { service, data = {} } = props;
|
|
740
|
-
const onClickCallback = React.useCallback(function(v) {
|
|
741
|
-
service.onNext(v);
|
|
742
|
-
}, [service]);
|
|
743
|
-
return /* @__PURE__ */ React.createElement(Overlay$1, {
|
|
744
|
-
verticalPosition: "bottom"
|
|
745
|
-
}, /* @__PURE__ */ React.createElement(Confirm, __spreadProps(__spreadValues({}, data), {
|
|
746
|
-
onClick: onClickCallback
|
|
747
|
-
})));
|
|
748
|
-
}
|
|
749
|
-
var index$l = "";
|
|
750
|
-
function getTypeClass(type) {
|
|
751
|
-
return {
|
|
752
|
-
"center": "op-overlay center",
|
|
753
|
-
"top": "op-overlay top",
|
|
754
|
-
"bottom": "op-overlay bottom"
|
|
755
|
-
}[type] || "op-overlay";
|
|
756
|
-
}
|
|
757
|
-
function Overlay(props) {
|
|
758
|
-
const { verticalPosition = "center", visible = true, closable = false, onClosed = () => {
|
|
759
|
-
} } = props;
|
|
760
|
-
const [hidden, setHidden] = useState(!visible);
|
|
761
|
-
useEffect(() => {
|
|
762
|
-
setHidden(!visible);
|
|
763
|
-
}, [visible]);
|
|
764
|
-
const option = {};
|
|
765
|
-
if (closable) {
|
|
766
|
-
option.onClick = (e) => {
|
|
767
|
-
setHidden(true);
|
|
768
|
-
onClosed();
|
|
769
|
-
};
|
|
770
|
-
}
|
|
771
|
-
useEffect(() => {
|
|
772
|
-
setHidden(!visible);
|
|
773
|
-
}, [visible]);
|
|
774
|
-
return !hidden ? /* @__PURE__ */ React.createElement("div", __spreadValues({
|
|
775
|
-
className: getTypeClass(verticalPosition)
|
|
776
|
-
}, option), props.children) : null;
|
|
777
|
-
}
|
|
778
|
-
var index$k = "";
|
|
779
|
-
function Prompt(props) {
|
|
780
|
-
const inputRef = React.useRef();
|
|
781
|
-
const { data = {}, onNext } = props;
|
|
782
|
-
const { placeholder, defaultValue, title = "\u8BF7\u8F93\u5165", type = "text", okText = "\u786E\u8BA4", cancelText = "\u53D6\u6D88" } = data;
|
|
783
|
-
return /* @__PURE__ */ React.createElement(Overlay, {
|
|
784
|
-
verticalPosition: "center",
|
|
785
|
-
closable: false
|
|
786
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
787
|
-
className: "prompt-dialog"
|
|
788
|
-
}, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("h1", {
|
|
789
|
-
className: "prompt-title"
|
|
790
|
-
}, title), /* @__PURE__ */ React.createElement("input", {
|
|
791
|
-
className: "prompt-input",
|
|
792
|
-
autoFocus: true,
|
|
793
|
-
ref: inputRef,
|
|
794
|
-
placeholder,
|
|
795
|
-
type,
|
|
796
|
-
defaultValue,
|
|
797
|
-
onKeyUp: (e) => {
|
|
798
|
-
if (e.keyCode === 13) {
|
|
799
|
-
onNext(getInputValue(inputRef.current));
|
|
800
|
-
}
|
|
801
|
-
}
|
|
802
|
-
}), /* @__PURE__ */ React.createElement("div", {
|
|
803
|
-
className: "prompt-btns"
|
|
804
|
-
}, cancelText ? /* @__PURE__ */ React.createElement(Button, {
|
|
805
|
-
onClick: () => onNext("back")
|
|
806
|
-
}, cancelText) : null, /* @__PURE__ */ React.createElement(Button, {
|
|
807
|
-
type: "primary",
|
|
808
|
-
onClick: () => {
|
|
809
|
-
onNext(getInputValue(inputRef.current));
|
|
810
|
-
}
|
|
811
|
-
}, okText)))));
|
|
812
|
-
}
|
|
813
|
-
function getInputValue(input) {
|
|
814
|
-
const value = input.value || "";
|
|
815
|
-
return String(value).trim();
|
|
816
|
-
}
|
|
817
|
-
function toast(props) {
|
|
818
|
-
const { data = {}, onNext, service } = props;
|
|
819
|
-
const { title, level, message, duration = null } = data;
|
|
820
|
-
const [hidden, setHidden] = useState(false);
|
|
821
|
-
React.useEffect(() => {
|
|
822
|
-
if (data.hasNext === void 0) {
|
|
823
|
-
onNext("");
|
|
824
|
-
}
|
|
825
|
-
let timeout = null;
|
|
826
|
-
if (duration) {
|
|
827
|
-
timeout = setTimeout(() => {
|
|
828
|
-
setHidden(true);
|
|
829
|
-
}, duration);
|
|
830
|
-
}
|
|
831
|
-
return () => {
|
|
832
|
-
clearTimeout(timeout);
|
|
833
|
-
};
|
|
834
|
-
}, [data]);
|
|
835
|
-
return !hidden ? /* @__PURE__ */ React.createElement(Overlay$1, {
|
|
836
|
-
verticalPosition: "bottom"
|
|
837
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
838
|
-
style: { width: "90%" }
|
|
839
|
-
}, /* @__PURE__ */ React.createElement(Toast, {
|
|
840
|
-
type: level,
|
|
841
|
-
title,
|
|
842
|
-
message: splitMessage(message)
|
|
843
|
-
}))) : null;
|
|
844
|
-
}
|
|
845
|
-
function splitMessage(message) {
|
|
846
|
-
var msg = String(message).split("by Error:");
|
|
847
|
-
return msg[1] || msg[0];
|
|
848
|
-
}
|
|
849
|
-
var index$j = "";
|
|
850
|
-
function NotFound(props) {
|
|
851
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
852
|
-
style: { padding: "20%" }
|
|
853
|
-
}, /* @__PURE__ */ React.createElement("h1", null, "404 ", /* @__PURE__ */ React.createElement("small", {
|
|
854
|
-
style: { fontSize: "60%" }
|
|
855
|
-
}, "Not found")), /* @__PURE__ */ React.createElement("div", null, props.action.getPage()));
|
|
856
|
-
}
|
|
857
|
-
function _extends() {
|
|
858
|
-
_extends = Object.assign || function(target) {
|
|
859
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
860
|
-
var source = arguments[i];
|
|
861
|
-
for (var key in source) {
|
|
862
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
863
|
-
target[key] = source[key];
|
|
864
|
-
}
|
|
865
|
-
}
|
|
866
|
-
}
|
|
867
|
-
return target;
|
|
868
|
-
};
|
|
869
|
-
return _extends.apply(this, arguments);
|
|
870
|
-
}
|
|
871
|
-
var r, B = r || (r = {});
|
|
872
|
-
B.Pop = "POP";
|
|
873
|
-
B.Push = "PUSH";
|
|
874
|
-
B.Replace = "REPLACE";
|
|
875
|
-
var C = function(b) {
|
|
876
|
-
return b;
|
|
877
|
-
};
|
|
878
|
-
function E(b) {
|
|
879
|
-
b.preventDefault();
|
|
880
|
-
b.returnValue = "";
|
|
881
|
-
}
|
|
882
|
-
function F() {
|
|
883
|
-
var b = [];
|
|
884
|
-
return { get length() {
|
|
885
|
-
return b.length;
|
|
886
|
-
}, push: function(h) {
|
|
887
|
-
b.push(h);
|
|
888
|
-
return function() {
|
|
889
|
-
b = b.filter(function(k) {
|
|
890
|
-
return k !== h;
|
|
891
|
-
});
|
|
892
|
-
};
|
|
893
|
-
}, call: function(h) {
|
|
894
|
-
b.forEach(function(k) {
|
|
895
|
-
return k && k(h);
|
|
896
|
-
});
|
|
897
|
-
} };
|
|
898
|
-
}
|
|
899
|
-
function H() {
|
|
900
|
-
return Math.random().toString(36).substr(2, 8);
|
|
901
|
-
}
|
|
902
|
-
function I(b) {
|
|
903
|
-
var h = b.pathname, k = b.search;
|
|
904
|
-
b = b.hash;
|
|
905
|
-
return (h === void 0 ? "/" : h) + (k === void 0 ? "" : k) + (b === void 0 ? "" : b);
|
|
906
|
-
}
|
|
907
|
-
function J(b) {
|
|
908
|
-
var h = {};
|
|
909
|
-
if (b) {
|
|
910
|
-
var k = b.indexOf("#");
|
|
911
|
-
0 <= k && (h.hash = b.substr(k), b = b.substr(0, k));
|
|
912
|
-
k = b.indexOf("?");
|
|
913
|
-
0 <= k && (h.search = b.substr(k), b = b.substr(0, k));
|
|
914
|
-
b && (h.pathname = b);
|
|
915
|
-
}
|
|
916
|
-
return h;
|
|
917
|
-
}
|
|
918
|
-
function createHashHistory(b) {
|
|
919
|
-
function h() {
|
|
920
|
-
var a = J(m.location.hash.substr(1)), e = a.pathname, l = a.search;
|
|
921
|
-
a = a.hash;
|
|
922
|
-
var g = u.state || {};
|
|
923
|
-
return [g.idx, C({ pathname: e === void 0 ? "/" : e, search: l === void 0 ? "" : l, hash: a === void 0 ? "" : a, state: g.usr || null, key: g.key || "default" })];
|
|
924
|
-
}
|
|
925
|
-
function k() {
|
|
926
|
-
if (t)
|
|
927
|
-
c.call(t), t = null;
|
|
928
|
-
else {
|
|
929
|
-
var a = r.Pop, e = h(), l = e[0];
|
|
930
|
-
e = e[1];
|
|
931
|
-
if (c.length)
|
|
932
|
-
if (l != null) {
|
|
933
|
-
var g = q - l;
|
|
934
|
-
g && (t = { action: a, location: e, retry: function() {
|
|
935
|
-
p(-1 * g);
|
|
936
|
-
} }, p(g));
|
|
937
|
-
} else
|
|
938
|
-
;
|
|
939
|
-
else
|
|
940
|
-
A(a);
|
|
941
|
-
}
|
|
942
|
-
}
|
|
943
|
-
function x(a) {
|
|
944
|
-
var e = document.querySelector("base"), l = "";
|
|
945
|
-
e && e.getAttribute("href") && (e = m.location.href, l = e.indexOf("#"), l = l === -1 ? e : e.slice(0, l));
|
|
946
|
-
return l + "#" + (typeof a === "string" ? a : I(a));
|
|
947
|
-
}
|
|
948
|
-
function z(a, e) {
|
|
949
|
-
e === void 0 && (e = null);
|
|
950
|
-
return C(_extends({ pathname: d.pathname, hash: "", search: "" }, typeof a === "string" ? J(a) : a, { state: e, key: H() }));
|
|
951
|
-
}
|
|
952
|
-
function A(a) {
|
|
953
|
-
v = a;
|
|
954
|
-
a = h();
|
|
955
|
-
q = a[0];
|
|
956
|
-
d = a[1];
|
|
957
|
-
f.call({ action: v, location: d });
|
|
958
|
-
}
|
|
959
|
-
function y(a, e) {
|
|
960
|
-
function l() {
|
|
961
|
-
y(a, e);
|
|
962
|
-
}
|
|
963
|
-
var g = r.Push, n = z(a, e);
|
|
964
|
-
if (!c.length || (c.call({ action: g, location: n, retry: l }), false)) {
|
|
965
|
-
var G = [{ usr: n.state, key: n.key, idx: q + 1 }, x(n)];
|
|
966
|
-
n = G[0];
|
|
967
|
-
G = G[1];
|
|
968
|
-
try {
|
|
969
|
-
u.pushState(n, "", G);
|
|
970
|
-
} catch (K) {
|
|
971
|
-
m.location.assign(G);
|
|
972
|
-
}
|
|
973
|
-
A(g);
|
|
974
|
-
}
|
|
975
|
-
}
|
|
976
|
-
function w(a, e) {
|
|
977
|
-
function l() {
|
|
978
|
-
w(a, e);
|
|
979
|
-
}
|
|
980
|
-
var g = r.Replace, n = z(a, e);
|
|
981
|
-
c.length && (c.call({ action: g, location: n, retry: l }), 1) || (n = [{ usr: n.state, key: n.key, idx: q }, x(n)], u.replaceState(n[0], "", n[1]), A(g));
|
|
982
|
-
}
|
|
983
|
-
function p(a) {
|
|
984
|
-
u.go(a);
|
|
985
|
-
}
|
|
986
|
-
b === void 0 && (b = {});
|
|
987
|
-
b = b.window;
|
|
988
|
-
var m = b === void 0 ? document.defaultView : b, u = m.history, t = null;
|
|
989
|
-
m.addEventListener("popstate", k);
|
|
990
|
-
m.addEventListener("hashchange", function() {
|
|
991
|
-
var a = h()[1];
|
|
992
|
-
I(a) !== I(d) && k();
|
|
993
|
-
});
|
|
994
|
-
var v = r.Pop;
|
|
995
|
-
b = h();
|
|
996
|
-
var q = b[0], d = b[1], f = F(), c = F();
|
|
997
|
-
q == null && (q = 0, u.replaceState(_extends({}, u.state, { idx: q }), ""));
|
|
998
|
-
return {
|
|
999
|
-
get action() {
|
|
1000
|
-
return v;
|
|
1001
|
-
},
|
|
1002
|
-
get location() {
|
|
1003
|
-
return d;
|
|
1004
|
-
},
|
|
1005
|
-
createHref: x,
|
|
1006
|
-
push: y,
|
|
1007
|
-
replace: w,
|
|
1008
|
-
go: p,
|
|
1009
|
-
back: function() {
|
|
1010
|
-
p(-1);
|
|
1011
|
-
},
|
|
1012
|
-
forward: function() {
|
|
1013
|
-
p(1);
|
|
1014
|
-
},
|
|
1015
|
-
listen: function(a) {
|
|
1016
|
-
return f.push(a);
|
|
1017
|
-
},
|
|
1018
|
-
block: function(a) {
|
|
1019
|
-
var e = c.push(a);
|
|
1020
|
-
c.length === 1 && m.addEventListener("beforeunload", E);
|
|
1021
|
-
return function() {
|
|
1022
|
-
e();
|
|
1023
|
-
c.length || m.removeEventListener("beforeunload", E);
|
|
1024
|
-
};
|
|
1025
|
-
}
|
|
1026
|
-
};
|
|
1027
|
-
}
|
|
1028
|
-
var index$i = "";
|
|
1029
|
-
function Debug(props) {
|
|
1030
|
-
const { appManager } = props;
|
|
1031
|
-
const pages = Array.from(appManager.pageManager.keys()).reverse();
|
|
1032
|
-
React.useEffect(function() {
|
|
1033
|
-
const history = createHashHistory();
|
|
1034
|
-
const unListen = history.listen(({ action, location }) => {
|
|
1035
|
-
const pathname = location.pathname;
|
|
1036
|
-
appManager.mockToPage(pathname, {});
|
|
1037
|
-
});
|
|
1038
|
-
return unListen;
|
|
1039
|
-
}, []);
|
|
1040
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
1041
|
-
className: "local-debug-side"
|
|
1042
|
-
}, /* @__PURE__ */ React.createElement("ul", null, pages.map((pathname) => /* @__PURE__ */ React.createElement("li", {
|
|
1043
|
-
key: pathname
|
|
1044
|
-
}, /* @__PURE__ */ React.createElement("a", {
|
|
1045
|
-
href: `#${pathname}`
|
|
1046
|
-
}, pathname)))));
|
|
1047
|
-
}
|
|
1048
|
-
function Loading$1(props) {
|
|
1049
|
-
const [showLoading, setShowLoading] = React.useState(false);
|
|
1050
|
-
const edgeService = props.edgeService;
|
|
1051
|
-
React.useEffect(function() {
|
|
1052
|
-
let currentLoading = false;
|
|
1053
|
-
const throttleSetShowLoading = function(loading) {
|
|
1054
|
-
currentLoading = loading;
|
|
1055
|
-
if (loading) {
|
|
1056
|
-
setTimeout(function() {
|
|
1057
|
-
if (currentLoading === loading) {
|
|
1058
|
-
setShowLoading(true);
|
|
1059
|
-
}
|
|
1060
|
-
}, 350);
|
|
1061
|
-
} else {
|
|
1062
|
-
setTimeout(function() {
|
|
1063
|
-
if (currentLoading === loading) {
|
|
1064
|
-
setShowLoading(false);
|
|
1065
|
-
}
|
|
1066
|
-
}, 100);
|
|
1067
|
-
}
|
|
1068
|
-
};
|
|
1069
|
-
edgeService.on("IO_STATUS", throttleSetShowLoading);
|
|
1070
|
-
return function() {
|
|
1071
|
-
edgeService.off("IO_STATUS", throttleSetShowLoading);
|
|
1072
|
-
};
|
|
1073
|
-
}, [edgeService]);
|
|
1074
|
-
return showLoading ? /* @__PURE__ */ React.createElement("div", {
|
|
1075
|
-
style: { position: "absolute", left: 0, top: 0, zIndex: 100 }
|
|
1076
|
-
}, "LOADING...") : null;
|
|
1077
|
-
}
|
|
1078
|
-
function PlaySound({ data, service, action }) {
|
|
1079
|
-
const { sound } = data;
|
|
1080
|
-
if (window.WindVane) {
|
|
1081
|
-
var params = {
|
|
1082
|
-
domain: "audio",
|
|
1083
|
-
method: "playSound",
|
|
1084
|
-
params: { sound }
|
|
1085
|
-
};
|
|
1086
|
-
WindVane.call("WindvanePlugin", "invoke", JSON.stringify(params));
|
|
1087
|
-
}
|
|
1088
|
-
service.onNext({});
|
|
1089
|
-
return null;
|
|
1090
|
-
}
|
|
1091
|
-
var index$h = {
|
|
1092
|
-
Alert,
|
|
1093
|
-
Start,
|
|
1094
|
-
Toast: toast,
|
|
1095
|
-
Confirm: confirm,
|
|
1096
|
-
NotFound,
|
|
1097
|
-
Debug,
|
|
1098
|
-
Prompt,
|
|
1099
|
-
Loading: Loading$1,
|
|
1100
|
-
PlaySound
|
|
1101
|
-
};
|
|
1102
|
-
var index$g = "";
|
|
1103
|
-
function Presentation(props) {
|
|
1104
|
-
const {
|
|
1105
|
-
image = Presentation.IMAGE_1,
|
|
1106
|
-
text = "",
|
|
1107
|
-
subText = "",
|
|
1108
|
-
transparent
|
|
1109
|
-
} = props;
|
|
1110
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
1111
|
-
className: transparent ? "presentation-card transparent" : "presentation-card"
|
|
1112
|
-
}, /* @__PURE__ */ React.createElement("img", {
|
|
1113
|
-
src: image
|
|
1114
|
-
}), text ? /* @__PURE__ */ React.createElement("div", {
|
|
1115
|
-
className: "text"
|
|
1116
|
-
}, text) : null, subText ? /* @__PURE__ */ React.createElement("div", {
|
|
1117
|
-
className: "sub-text"
|
|
1118
|
-
}, subText) : null);
|
|
1119
|
-
}
|
|
1120
|
-
Presentation.IMAGE_1 = "https://img.alicdn.com/imgextra/i3/O1CN019Ivkor1ksy3pMGDsz_!!6000000004740-2-tps-280-322.png";
|
|
1121
|
-
Presentation.IMAGE_2 = "https://img.alicdn.com/imgextra/i1/O1CN01lhSunu1X4VPw1Mlas_!!6000000002870-2-tps-352-158.png";
|
|
1122
|
-
Presentation.IMAGE_3 = "https://img.alicdn.com/imgextra/i1/O1CN01mreYXo1XfbUsQ7hip_!!6000000002951-2-tps-322-144.png";
|
|
1123
|
-
Presentation.IMAGE_4 = "https://img.alicdn.com/imgextra/i3/O1CN017gNM8F1Fmmcfti7Dg_!!6000000000530-1-tps-414-286.gif";
|
|
1124
|
-
var index$f = "";
|
|
1125
|
-
function empty$1() {
|
|
1126
|
-
}
|
|
1127
|
-
function List(props) {
|
|
1128
|
-
const { dataSource = [], onClickItem, onItemClick = empty$1 } = props;
|
|
1129
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
1130
|
-
className: "android-pda-list"
|
|
1131
|
-
}, dataSource.map((item, index2) => {
|
|
1132
|
-
return /* @__PURE__ */ React.createElement(DefaultItem, {
|
|
1133
|
-
key: item.key || index2,
|
|
1134
|
-
dataSource: item,
|
|
1135
|
-
onClick: onClickItem || onItemClick
|
|
1136
|
-
});
|
|
1137
|
-
}), props.children);
|
|
1138
|
-
}
|
|
1139
|
-
function DefaultItem(props) {
|
|
1140
|
-
const dataSource = props.dataSource || {
|
|
1141
|
-
title: props.title,
|
|
1142
|
-
subTitle: props.subTitle,
|
|
1143
|
-
extra: props.extra,
|
|
1144
|
-
tags: props.tags
|
|
1145
|
-
};
|
|
1146
|
-
const { title, subTitle, extra, tags = [], tabIndex } = dataSource;
|
|
1147
|
-
const { onClick } = props;
|
|
1148
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
1149
|
-
className: "default-item",
|
|
1150
|
-
onClick: () => {
|
|
1151
|
-
onClick(props.dataSource);
|
|
1152
|
-
},
|
|
1153
|
-
tabIndex
|
|
1154
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
1155
|
-
className: "text"
|
|
1156
|
-
}, /* @__PURE__ */ React.createElement("div", null, title), /* @__PURE__ */ React.createElement("div", {
|
|
1157
|
-
className: "sub-text"
|
|
1158
|
-
}, subTitle), /* @__PURE__ */ React.createElement("div", {
|
|
1159
|
-
className: "sub-tags"
|
|
1160
|
-
}, tags.map((text) => {
|
|
1161
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
1162
|
-
className: "sub-tag-item",
|
|
1163
|
-
key: text
|
|
1164
|
-
}, text);
|
|
1165
|
-
}))), /* @__PURE__ */ React.createElement("div", {
|
|
1166
|
-
className: "extra"
|
|
1167
|
-
}, extra));
|
|
1168
|
-
}
|
|
1169
|
-
List.Item = DefaultItem;
|
|
1170
|
-
var index$e = "";
|
|
1171
|
-
const blankFunc$5 = () => {
|
|
1172
|
-
};
|
|
1173
|
-
class BaseLayoutContainer extends React.Component {
|
|
1174
|
-
constructor(props) {
|
|
1175
|
-
super(props);
|
|
1176
|
-
this.state = {
|
|
1177
|
-
showLoading: false
|
|
1178
|
-
};
|
|
1179
|
-
this._handleKeyUp = (e) => {
|
|
1180
|
-
const { onScan = blankFunc$5, onEnter = blankFunc$5, onEsc = blankFunc$5, onDelete = blankFunc$5, scanMode = null } = this.props;
|
|
1181
|
-
const { code, keyCode, key } = e;
|
|
1182
|
-
if (code === "Enter") {
|
|
1183
|
-
e.preventDefault();
|
|
1184
|
-
onEnter(e);
|
|
1185
|
-
return;
|
|
1186
|
-
}
|
|
1187
|
-
if (code === "Delete") {
|
|
1188
|
-
e.preventDefault();
|
|
1189
|
-
onDelete(e);
|
|
1190
|
-
return;
|
|
1191
|
-
}
|
|
1192
|
-
if (code === "Esc") {
|
|
1193
|
-
e.preventDefault();
|
|
1194
|
-
onEsc(e);
|
|
1195
|
-
return;
|
|
1196
|
-
}
|
|
1197
|
-
};
|
|
1198
|
-
this._handleBeforeUnload = (e) => {
|
|
1199
|
-
e.returnValue = "\u786E\u5B9A\u79BB\u5F00\u5F53\u524D\u9875\u9762\u5417\uFF1F";
|
|
1200
|
-
return true;
|
|
1201
|
-
};
|
|
1202
|
-
this._handleUnload = (e) => {
|
|
1203
|
-
WindVane.call("WindvanePlugin", "invoke", "{'domain': 'rfid', 'method': 'stopRfidScan', 'params':null}", function(e2) {
|
|
1204
|
-
}, function(e2) {
|
|
1205
|
-
});
|
|
1206
|
-
const stopParam = {
|
|
1207
|
-
tag: "stopRfid",
|
|
1208
|
-
level: "d",
|
|
1209
|
-
message: "stop rfid scan!!!"
|
|
1210
|
-
};
|
|
1211
|
-
WindVaneLog(stopParam);
|
|
1212
|
-
WindVaneLog(stopParam);
|
|
1213
|
-
};
|
|
1214
|
-
}
|
|
1215
|
-
componentDidMount() {
|
|
1216
|
-
window.onunload = this._handleUnload;
|
|
1217
|
-
document.addEventListener("keyup", this._handleKeyUp);
|
|
1218
|
-
}
|
|
1219
|
-
componentWillUnmount() {
|
|
1220
|
-
window.onbeforeunload = null;
|
|
1221
|
-
window.onunload = null;
|
|
1222
|
-
document.removeEventListener("keyup", this._handleKeyUp);
|
|
1223
|
-
}
|
|
1224
|
-
shouldComponentUpdate(nextProps, nextState) {
|
|
1225
|
-
if (nextProps.loading && !this.props.loading) {
|
|
1226
|
-
this.setState({
|
|
1227
|
-
showLoading: true
|
|
1228
|
-
});
|
|
1229
|
-
if (nextProps.loadingTimeout) {
|
|
1230
|
-
setTimeout(() => {
|
|
1231
|
-
this.setState({
|
|
1232
|
-
showLoading: false
|
|
1233
|
-
});
|
|
1234
|
-
}, nextProps.loadingTimeout);
|
|
1235
|
-
}
|
|
1236
|
-
}
|
|
1237
|
-
if (!nextProps.loading && this.state.showLoading) {
|
|
1238
|
-
this.setState({
|
|
1239
|
-
showLoading: false
|
|
1240
|
-
});
|
|
1241
|
-
}
|
|
1242
|
-
return true;
|
|
1243
|
-
}
|
|
1244
|
-
render() {
|
|
1245
|
-
const props = this.props;
|
|
1246
|
-
const { style = {}, header, footer, loading } = this.props;
|
|
1247
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
1248
|
-
className: classNames({ "baselayout-wrapper": true }),
|
|
1249
|
-
style
|
|
1250
|
-
}, header && /* @__PURE__ */ React.createElement("div", {
|
|
1251
|
-
className: classNames({ "baselayout-header": true })
|
|
1252
|
-
}, header), /* @__PURE__ */ React.createElement("div", {
|
|
1253
|
-
className: classNames({ "baselayout-container": true })
|
|
1254
|
-
}, props.children), footer && /* @__PURE__ */ React.createElement("div", {
|
|
1255
|
-
className: classNames({ "baselayout-footer": true })
|
|
1256
|
-
}, footer), this.state.showLoading ? /* @__PURE__ */ React.createElement("div", {
|
|
1257
|
-
className: "loading"
|
|
1258
|
-
}) : null);
|
|
1259
|
-
}
|
|
1260
|
-
}
|
|
1261
|
-
const blankFunc$4 = () => {
|
|
1262
|
-
};
|
|
1263
|
-
class RfidOnce$1 extends React.Component {
|
|
1264
|
-
constructor(props) {
|
|
1265
|
-
super(props);
|
|
1266
|
-
this._rfidBeginScan = false;
|
|
1267
|
-
this._handleRfidScan = (e) => {
|
|
1268
|
-
const { onRfidOnce, onRfidBoxOnce, onRfidPalletOnce } = this.props;
|
|
1269
|
-
const data = e.param;
|
|
1270
|
-
const isBox = data.rfidData.startsWith("0F006");
|
|
1271
|
-
const isPallet = data.rfidData.startsWith("0F011");
|
|
1272
|
-
playSound("single_recog");
|
|
1273
|
-
if (isPallet) {
|
|
1274
|
-
let rfidData = data.rfidData;
|
|
1275
|
-
data.originData = rfidData;
|
|
1276
|
-
data.rfidData = rfidData.substr(5, 12);
|
|
1277
|
-
}
|
|
1278
|
-
if (onRfidBoxOnce && isBox) {
|
|
1279
|
-
this._stopWork();
|
|
1280
|
-
onRfidBoxOnce(data);
|
|
1281
|
-
} else if (onRfidPalletOnce && isPallet) {
|
|
1282
|
-
this._stopWork();
|
|
1283
|
-
onRfidPalletOnce(data);
|
|
1284
|
-
}
|
|
1285
|
-
if (onRfidOnce) {
|
|
1286
|
-
this._stopWork();
|
|
1287
|
-
onRfidOnce(data);
|
|
1288
|
-
}
|
|
1289
|
-
};
|
|
1290
|
-
this._startWork = (e) => {
|
|
1291
|
-
document.addEventListener("ContinuousRfidScan", this._handleRfidScan);
|
|
1292
|
-
WindVane.call("WindvanePlugin", "invoke", "{'domain': 'rfid', 'method': 'startScan', 'params': null}", function(e2) {
|
|
1293
|
-
}, function(e2) {
|
|
1294
|
-
});
|
|
1295
|
-
this._rfidBeginScan = true;
|
|
1296
|
-
};
|
|
1297
|
-
this._stopWork = (e) => {
|
|
1298
|
-
document.removeEventListener("ContinuousRfidScan", this._handleRfidScan);
|
|
1299
|
-
WindVane.call("WindvanePlugin", "invoke", "{'domain': 'rfid', 'method': 'stopRfidScan', 'params':null}", function(e2) {
|
|
1300
|
-
}, function(e2) {
|
|
1301
|
-
});
|
|
1302
|
-
};
|
|
1303
|
-
this._handleKeyDown = (e) => {
|
|
1304
|
-
const { code, keyCode, key } = e;
|
|
1305
|
-
if (code === "F22" || code === "F23" || code === "F24" || code === "F9" || code === "F16") {
|
|
1306
|
-
if (!this._rfidBeginScan) {
|
|
1307
|
-
this._startWork();
|
|
1308
|
-
}
|
|
1309
|
-
}
|
|
1310
|
-
};
|
|
1311
|
-
this._handleKeyUp = (e) => {
|
|
1312
|
-
const { code, keyCode, key } = e;
|
|
1313
|
-
if (code === "F22" || code === "F23" || code === "F24" || code === "F9" || code === "F16") {
|
|
1314
|
-
this._stopWork();
|
|
1315
|
-
this._rfidBeginScan = false;
|
|
1316
|
-
}
|
|
1317
|
-
};
|
|
1318
|
-
}
|
|
1319
|
-
componentDidMount() {
|
|
1320
|
-
document.addEventListener("keydown", this._handleKeyDown);
|
|
1321
|
-
document.addEventListener("keyup", this._handleKeyUp);
|
|
1322
|
-
WindVane.call("WindvanePlugin", "invoke", "{'domain': 'keyboard', 'method': 'changeScanMode', 'params': {'scanMode': 'RFID'}}", function(e) {
|
|
1323
|
-
}, function(e) {
|
|
1324
|
-
});
|
|
1325
|
-
}
|
|
1326
|
-
componentWillUnmount() {
|
|
1327
|
-
document.removeEventListener("keydown", this._handleKeyDown);
|
|
1328
|
-
document.removeEventListener("keyup", this._handleKeyUp);
|
|
1329
|
-
this._stopWork();
|
|
1330
|
-
}
|
|
1331
|
-
render() {
|
|
1332
|
-
const props = this.props;
|
|
1333
|
-
const _a = props, { onRfidOnce = blankFunc$4 } = _a, opts = __objRest(_a, ["onRfidOnce"]);
|
|
1334
|
-
return /* @__PURE__ */ React.createElement(BaseLayoutContainer, __spreadValues({}, opts));
|
|
1335
|
-
}
|
|
1336
|
-
}
|
|
1337
|
-
const blankFunc$3 = () => {
|
|
1338
|
-
};
|
|
1339
|
-
class RfidOnce extends React.Component {
|
|
1340
|
-
constructor(props) {
|
|
1341
|
-
super(props);
|
|
1342
|
-
this._rfidBeginScan = false;
|
|
1343
|
-
this._handleRfidScan = (e) => {
|
|
1344
|
-
const { onRfidScan, onRfidBoxScan, onRfidPalletScan } = this.props;
|
|
1345
|
-
const data = e.param;
|
|
1346
|
-
const isBox = data.rfidData.startsWith("0F006");
|
|
1347
|
-
const isPallet = data.rfidData.startsWith("0F011");
|
|
1348
|
-
if (isPallet) {
|
|
1349
|
-
let rfidData = data.rfidData;
|
|
1350
|
-
data.originData = rfidData;
|
|
1351
|
-
data.rfidData = rfidData.substr(5, 12);
|
|
1352
|
-
}
|
|
1353
|
-
if (isBox && onRfidBoxScan) {
|
|
1354
|
-
onRfidBoxScan(data);
|
|
1355
|
-
} else if (isPallet && onRfidPalletScan) {
|
|
1356
|
-
onRfidPalletScan(data);
|
|
1357
|
-
}
|
|
1358
|
-
if (onRfidScan) {
|
|
1359
|
-
onRfidScan(data);
|
|
1360
|
-
}
|
|
1361
|
-
};
|
|
1362
|
-
this._startWork = (e) => {
|
|
1363
|
-
document.addEventListener("ContinuousRfidScan", this._handleRfidScan);
|
|
1364
|
-
WindVane.call("WindvanePlugin", "invoke", "{'domain': 'rfid', 'method': 'startScan', 'params': null}", function(e2) {
|
|
1365
|
-
}, function(e2) {
|
|
1366
|
-
});
|
|
1367
|
-
this._rfidBeginScan = true;
|
|
1368
|
-
};
|
|
1369
|
-
this._stopWork = (e) => {
|
|
1370
|
-
document.removeEventListener("ContinuousRfidScan", this._handleRfidScan);
|
|
1371
|
-
WindVane.call("WindvanePlugin", "invoke", "{'domain': 'rfid', 'method': 'stopRfidScan', 'params':null}", function(e2) {
|
|
1372
|
-
}, function(e2) {
|
|
1373
|
-
});
|
|
1374
|
-
};
|
|
1375
|
-
this._handleKeyDown = (e) => {
|
|
1376
|
-
const { code, keyCode, key } = e;
|
|
1377
|
-
if (code === "F22" || code === "F23" || code === "F24" || code === "F9" || code === "F16") {
|
|
1378
|
-
if (!this._rfidBeginScan) {
|
|
1379
|
-
this._startWork();
|
|
1380
|
-
}
|
|
1381
|
-
}
|
|
1382
|
-
};
|
|
1383
|
-
this._handleKeyUp = (e) => {
|
|
1384
|
-
const { code, keyCode, key } = e;
|
|
1385
|
-
if (code === "F22" || code === "F23" || code === "F24" || code === "F9" || code === "F16") {
|
|
1386
|
-
this._stopWork();
|
|
1387
|
-
this._rfidBeginScan = false;
|
|
1388
|
-
}
|
|
1389
|
-
};
|
|
1390
|
-
}
|
|
1391
|
-
componentDidMount() {
|
|
1392
|
-
const { autoRfidScan = false, rfidReaderSleep } = this.props;
|
|
1393
|
-
WindVane.call("WindvanePlugin", "invoke", "{'domain': 'keyboard', 'method': 'changeScanMode', 'params': {'scanMode': 'RFID'}}", function(e) {
|
|
1394
|
-
}, function(e) {
|
|
1395
|
-
});
|
|
1396
|
-
if (!autoRfidScan) {
|
|
1397
|
-
document.addEventListener("keydown", this._handleKeyDown);
|
|
1398
|
-
document.addEventListener("keyup", this._handleKeyUp);
|
|
1399
|
-
} else {
|
|
1400
|
-
if (!rfidReaderSleep) {
|
|
1401
|
-
this._startWork();
|
|
1402
|
-
}
|
|
1403
|
-
}
|
|
1404
|
-
}
|
|
1405
|
-
componentWillUnmount() {
|
|
1406
|
-
document.removeEventListener("keydown", this._handleKeyDown);
|
|
1407
|
-
document.removeEventListener("keyup", this._handleKeyUp);
|
|
1408
|
-
this._stopWork();
|
|
1409
|
-
}
|
|
1410
|
-
shouldComponentUpdate(nextProps, nextState) {
|
|
1411
|
-
if (this.props.autoRfidScan && this.props.rfidReaderSleep !== nextProps.rfidReaderSleep) {
|
|
1412
|
-
if (!nextProps.rfidReaderSleep) {
|
|
1413
|
-
this._startWork();
|
|
1414
|
-
} else {
|
|
1415
|
-
this._stopWork();
|
|
1416
|
-
}
|
|
1417
|
-
}
|
|
1418
|
-
return true;
|
|
1419
|
-
}
|
|
1420
|
-
render() {
|
|
1421
|
-
const props = this.props;
|
|
1422
|
-
const _a = props, { onRfidScan = blankFunc$3, autoRfidScan } = _a, opts = __objRest(_a, ["onRfidScan", "autoRfidScan"]);
|
|
1423
|
-
return /* @__PURE__ */ React.createElement(BaseLayoutContainer, __spreadValues({}, opts));
|
|
1424
|
-
}
|
|
1425
|
-
}
|
|
1426
|
-
__publicField(RfidOnce, "defaultProps", {
|
|
1427
|
-
rfidReaderSleep: false
|
|
1428
|
-
});
|
|
1429
|
-
const blankFunc$2 = () => {
|
|
1430
|
-
};
|
|
1431
|
-
class BarcodeScan extends React.Component {
|
|
1432
|
-
constructor(props) {
|
|
1433
|
-
super(props);
|
|
1434
|
-
this._barcodeBeginScan = false;
|
|
1435
|
-
this._handleBarcodeScan = (e) => {
|
|
1436
|
-
const { onBarcodeScan } = this.props;
|
|
1437
|
-
this._stopWork();
|
|
1438
|
-
playSound("scan");
|
|
1439
|
-
onBarcodeScan(e.param);
|
|
1440
|
-
};
|
|
1441
|
-
this._startWork = (e) => {
|
|
1442
|
-
document.addEventListener("BarcodeScan", this._handleBarcodeScan);
|
|
1443
|
-
this._barcodeBeginScan = true;
|
|
1444
|
-
};
|
|
1445
|
-
this._stopWork = (e) => {
|
|
1446
|
-
document.removeEventListener("BarcodeScan", this._handleBarcodeScan);
|
|
1447
|
-
};
|
|
1448
|
-
this._handleKeyDown = (e) => {
|
|
1449
|
-
const { code, keyCode, key } = e;
|
|
1450
|
-
if (code === "F22" || code === "F23" || code === "F24" || code === "F9" || code === "F16") {
|
|
1451
|
-
if (!this._barcodeBeginScan) {
|
|
1452
|
-
this._startWork();
|
|
1453
|
-
}
|
|
1454
|
-
}
|
|
1455
|
-
};
|
|
1456
|
-
this._handleKeyUp = (e) => {
|
|
1457
|
-
const { code, keyCode, key } = e;
|
|
1458
|
-
if (code === "F22" || code === "F23" || code === "F24" || code === "F9" || code === "F16") {
|
|
1459
|
-
this._stopWork();
|
|
1460
|
-
this._barcodeBeginScan = false;
|
|
1461
|
-
}
|
|
1462
|
-
};
|
|
1463
|
-
}
|
|
1464
|
-
componentDidMount() {
|
|
1465
|
-
document.addEventListener("keydown", this._handleKeyDown);
|
|
1466
|
-
document.addEventListener("keyup", this._handleKeyUp);
|
|
1467
|
-
WindVane.call("WindvanePlugin", "invoke", "{'domain': 'keyboard', 'method': 'changeScanMode', 'params': {'scanMode': 'barcode'}}", function(e) {
|
|
1468
|
-
}, function(e) {
|
|
1469
|
-
});
|
|
1470
|
-
}
|
|
1471
|
-
componentWillUnmount() {
|
|
1472
|
-
document.removeEventListener("keydown", this._handleKeyDown);
|
|
1473
|
-
document.removeEventListener("keyup", this._handleKeyUp);
|
|
1474
|
-
}
|
|
1475
|
-
render() {
|
|
1476
|
-
const props = this.props;
|
|
1477
|
-
const _a = props, { onBarcodeScan = blankFunc$2 } = _a, opts = __objRest(_a, ["onBarcodeScan"]);
|
|
1478
|
-
return /* @__PURE__ */ React.createElement(BaseLayoutContainer, __spreadValues({}, opts));
|
|
1479
|
-
}
|
|
1480
|
-
}
|
|
1481
|
-
class BaseLayout extends React.Component {
|
|
1482
|
-
constructor(props) {
|
|
1483
|
-
super(props);
|
|
1484
|
-
}
|
|
1485
|
-
render() {
|
|
1486
|
-
const props = this.props;
|
|
1487
|
-
const { onBarcodeScan, onRfidOnce, onRfidBoxOnce, onRfidPalletOnce, onRfidScan, onRfidBoxScan, onRfidPalletScan } = props;
|
|
1488
|
-
if (onRfidOnce || onRfidBoxOnce || onRfidPalletOnce) {
|
|
1489
|
-
return /* @__PURE__ */ React.createElement(RfidOnce$1, __spreadValues({}, props));
|
|
1490
|
-
}
|
|
1491
|
-
if (onRfidScan || onRfidBoxScan || onRfidPalletScan) {
|
|
1492
|
-
return /* @__PURE__ */ React.createElement(RfidOnce, __spreadValues({}, props));
|
|
1493
|
-
}
|
|
1494
|
-
if (onBarcodeScan) {
|
|
1495
|
-
return /* @__PURE__ */ React.createElement(BarcodeScan, __spreadValues({}, props));
|
|
1496
|
-
}
|
|
1497
|
-
return /* @__PURE__ */ React.createElement(BaseLayoutContainer, __spreadValues({}, props));
|
|
1498
|
-
}
|
|
1499
|
-
}
|
|
1500
|
-
var index$d = "";
|
|
1501
|
-
const blankFunc$1 = () => {
|
|
1502
|
-
};
|
|
1503
|
-
function Keyborard(props) {
|
|
1504
|
-
const { label = "\u67E5\u8BE2", onWakeKeyboard = blankFunc$1, onClick = blankFunc$1, onHidden = blankFunc$1, type = "tel", placeholder = "\u8BF7\u8F93\u5165" } = props;
|
|
1505
|
-
const inputRef = useRef(null);
|
|
1506
|
-
const [visible, setVisible] = useState(true);
|
|
1507
|
-
useEffect(() => {
|
|
1508
|
-
const handleKeyUp = (e) => {
|
|
1509
|
-
const { code, keyCode, key } = e;
|
|
1510
|
-
if (code === "Enter") {
|
|
1511
|
-
e.preventDefault();
|
|
1512
|
-
onClick(inputRef.current.value, e);
|
|
1513
|
-
onHidden(true);
|
|
1514
|
-
setVisible(false);
|
|
1515
|
-
return;
|
|
1516
|
-
}
|
|
1517
|
-
};
|
|
1518
|
-
requestAnimationFrame(() => {
|
|
1519
|
-
inputRef.current.focus();
|
|
1520
|
-
onWakeKeyboard();
|
|
1521
|
-
});
|
|
1522
|
-
document.addEventListener("keyup", handleKeyUp);
|
|
1523
|
-
return () => {
|
|
1524
|
-
document.removeEventListener("keyup", handleKeyUp);
|
|
1525
|
-
};
|
|
1526
|
-
}, []);
|
|
1527
|
-
if (!visible)
|
|
1528
|
-
return null;
|
|
1529
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
1530
|
-
className: "wakekeyborard-overlay",
|
|
1531
|
-
onClick: (e) => {
|
|
1532
|
-
if (e.target.className && e.target.className.includes("wakekeyborard-overlay")) {
|
|
1533
|
-
onHidden(false);
|
|
1534
|
-
setVisible(false);
|
|
1535
|
-
}
|
|
1536
|
-
}
|
|
1537
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
1538
|
-
className: "wakekeyborard-inputbox"
|
|
1539
|
-
}, /* @__PURE__ */ React.createElement("input", {
|
|
1540
|
-
ref: inputRef,
|
|
1541
|
-
type,
|
|
1542
|
-
placeholder
|
|
1543
|
-
}), /* @__PURE__ */ React.createElement(Button, {
|
|
1544
|
-
type: "cutout",
|
|
1545
|
-
onClick: (e) => {
|
|
1546
|
-
onClick(inputRef.current.value, e);
|
|
1547
|
-
onHidden(true);
|
|
1548
|
-
setVisible(false);
|
|
1549
|
-
}
|
|
1550
|
-
}, label)));
|
|
1551
|
-
}
|
|
1552
|
-
const blankFunc = () => {
|
|
1553
|
-
};
|
|
1554
|
-
function WakeKeyborard(props) {
|
|
1555
|
-
const [inputVisible, setInputVisible] = useState(props.autoWakeup || false);
|
|
1556
|
-
const _a = props, { onClick = blankFunc, onHidden = blankFunc } = _a, keyborardProps = __objRest(_a, ["onClick", "onHidden"]);
|
|
1557
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
1558
|
-
className: "wakekeyborard"
|
|
1559
|
-
}, inputVisible ? /* @__PURE__ */ React.createElement(Keyborard, __spreadValues({
|
|
1560
|
-
onClick: (v, e) => {
|
|
1561
|
-
onClick(v);
|
|
1562
|
-
setInputVisible(!inputVisible);
|
|
1563
|
-
},
|
|
1564
|
-
onHidden: (s) => {
|
|
1565
|
-
setInputVisible(false);
|
|
1566
|
-
onHidden(s);
|
|
1567
|
-
}
|
|
1568
|
-
}, keyborardProps)) : null, !inputVisible ? /* @__PURE__ */ React.createElement("div", {
|
|
1569
|
-
className: "wakekeyborard-icon",
|
|
1570
|
-
onClick: (e) => {
|
|
1571
|
-
setInputVisible(!inputVisible);
|
|
1572
|
-
}
|
|
1573
|
-
}) : null);
|
|
1574
|
-
}
|
|
1575
|
-
WakeKeyborard.Keyborard = Keyborard;
|
|
1576
|
-
var index$c = "";
|
|
1577
|
-
var index$b = "";
|
|
1578
|
-
class PdaInfoCard$1 extends React.Component {
|
|
1579
|
-
constructor(props) {
|
|
1580
|
-
super(props);
|
|
1581
|
-
}
|
|
1582
|
-
render() {
|
|
1583
|
-
const { className, title, isActive, infoList = [], style = {}, index: index2, isLast } = this.props;
|
|
1584
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
1585
|
-
className: classNames({ [className]: true, "pda-step-card": true }),
|
|
1586
|
-
style
|
|
1587
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
1588
|
-
className: "pda-step-indictor"
|
|
1589
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
1590
|
-
className: classNames({ "pda-step-indictor-top": true, "pda-step-indictor-top-hidden": index2 === 0 })
|
|
1591
|
-
}), /* @__PURE__ */ React.createElement("div", {
|
|
1592
|
-
className: classNames({ "pda-step-indictor-center": true, "pda-step-indictor-center-active": isActive })
|
|
1593
|
-
}), /* @__PURE__ */ React.createElement("div", {
|
|
1594
|
-
className: classNames({ "pda-step-indictor-bottom": true, "pda-step-indictor-bottom-hidden": isLast })
|
|
1595
|
-
})), /* @__PURE__ */ React.createElement("div", {
|
|
1596
|
-
className: classNames({ "pda-step": true, "pda-step-dark": !isActive })
|
|
1597
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
1598
|
-
className: "pda-step-title"
|
|
1599
|
-
}, title), infoList.map((item, index22) => {
|
|
1600
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
1601
|
-
key: index22,
|
|
1602
|
-
className: "pda-step-list"
|
|
1603
|
-
}, /* @__PURE__ */ React.createElement("span", null, item.label || ""), "\xA0\xA0", /* @__PURE__ */ React.createElement("span", null, item.content || ""));
|
|
1604
|
-
})));
|
|
1605
|
-
}
|
|
1606
|
-
}
|
|
1607
|
-
class PdaInfoCard extends React.Component {
|
|
1608
|
-
constructor(props) {
|
|
1609
|
-
super(props);
|
|
1610
|
-
}
|
|
1611
|
-
render() {
|
|
1612
|
-
const { className, style = {}, theme = "light", current = 0, children } = this.props;
|
|
1613
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
1614
|
-
className: classNames({ [className]: true }),
|
|
1615
|
-
style
|
|
1616
|
-
}, (children || []).map((child, index2) => {
|
|
1617
|
-
const childProps = __spreadValues({
|
|
1618
|
-
index: index2,
|
|
1619
|
-
isLast: index2 === (children || []).length - 1
|
|
1620
|
-
}, child.props);
|
|
1621
|
-
if (index2 === current) {
|
|
1622
|
-
childProps.isActive = true;
|
|
1623
|
-
} else {
|
|
1624
|
-
childProps.isActive = false;
|
|
1625
|
-
}
|
|
1626
|
-
return cloneElement(child, childProps);
|
|
1627
|
-
}));
|
|
1628
|
-
}
|
|
1629
|
-
}
|
|
1630
|
-
__publicField(PdaInfoCard, "Step", PdaInfoCard$1);
|
|
1631
|
-
var index$a = "";
|
|
1632
|
-
class PdaFinishCard extends React.Component {
|
|
1633
|
-
constructor(props) {
|
|
1634
|
-
super(props);
|
|
1635
|
-
}
|
|
1636
|
-
componentDidMount() {
|
|
1637
|
-
if (this.props.isError) {
|
|
1638
|
-
playSound("success3");
|
|
1639
|
-
} else {
|
|
1640
|
-
playSound("success2");
|
|
1641
|
-
}
|
|
1642
|
-
}
|
|
1643
|
-
render() {
|
|
1644
|
-
const { className, title, infoList = [], isError = false, buttonMultiLines = false, style = {}, onClick = () => {
|
|
1645
|
-
}, okText = "\u8FD4\u56DE\u9996\u9875", cancelText = null } = this.props;
|
|
1646
|
-
const footer = /* @__PURE__ */ React.createElement(Button.Group, null, cancelText ? /* @__PURE__ */ React.createElement(Button, {
|
|
1647
|
-
style: buttonMultiLines ? { height: "auto", lineHeight: "50px" } : {},
|
|
1648
|
-
type: "dark",
|
|
1649
|
-
onClick: () => onClick(false)
|
|
1650
|
-
}, cancelText) : null, /* @__PURE__ */ React.createElement(Button, {
|
|
1651
|
-
type: "primary",
|
|
1652
|
-
style: buttonMultiLines ? { height: "auto", lineHeight: "normal" } : {},
|
|
1653
|
-
onClick: () => onClick(true)
|
|
1654
|
-
}, okText));
|
|
1655
|
-
return /* @__PURE__ */ React.createElement(BaseLayout, {
|
|
1656
|
-
footer
|
|
1657
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
1658
|
-
className: "pda-finish-card-top"
|
|
1659
|
-
}, /* @__PURE__ */ React.createElement("img", {
|
|
1660
|
-
className: "pda-finish-card-img",
|
|
1661
|
-
src: isError ? PdaFinishCard.ERROR_SUCCESS : PdaFinishCard.SUCCESS
|
|
1662
|
-
}), /* @__PURE__ */ React.createElement("p", {
|
|
1663
|
-
className: "pda-finish-card-title"
|
|
1664
|
-
}, title), infoList.map((item, index2) => {
|
|
1665
|
-
return /* @__PURE__ */ React.createElement("p", {
|
|
1666
|
-
key: index2,
|
|
1667
|
-
className: "pda-finish-card-list"
|
|
1668
|
-
}, /* @__PURE__ */ React.createElement("span", null, item.label || ""), /* @__PURE__ */ React.createElement("span", null, item.content || ""));
|
|
1669
|
-
})));
|
|
1670
|
-
}
|
|
1671
|
-
}
|
|
1672
|
-
PdaFinishCard.SUCCESS = "https://img.alicdn.com/imgextra/i3/O1CN01OL2UYg24792knbTtC_!!6000000007343-1-tps-506-415.gif";
|
|
1673
|
-
PdaFinishCard.ERROR_SUCCESS = "https://img.alicdn.com/imgextra/i3/O1CN01p5Oc5t1VMFWtBomQc_!!6000000002638-1-tps-600-456.gif";
|
|
1674
|
-
var index$9 = "";
|
|
1675
|
-
class PdaDistanceCard extends React.Component {
|
|
1676
|
-
constructor(props) {
|
|
1677
|
-
super(props);
|
|
1678
|
-
}
|
|
1679
|
-
render() {
|
|
1680
|
-
const { className, title, infoText, percentage = 0, style = {} } = this.props;
|
|
1681
|
-
const distanceImg = "https://img.alicdn.com/imgextra/i3/O1CN01EFksWL1DBZCu0H1JH_!!6000000000178-2-tps-21-30.png";
|
|
1682
|
-
const indictorImg = "https://img.alicdn.com/imgextra/i1/O1CN01YEhCSg1aObe8UZq7K_!!6000000003320-2-tps-379-17.png";
|
|
1683
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
1684
|
-
className: classNames({ [className]: true, "pda-distance-card": true }),
|
|
1685
|
-
style
|
|
1686
|
-
}, /* @__PURE__ */ React.createElement("p", {
|
|
1687
|
-
className: "pda-distance-card-highlight"
|
|
1688
|
-
}, /* @__PURE__ */ React.createElement("span", {
|
|
1689
|
-
className: "pda-distance-card-highlight1"
|
|
1690
|
-
}, title)), /* @__PURE__ */ React.createElement("div", {
|
|
1691
|
-
className: "pda-distance-indictor"
|
|
1692
|
-
}, /* @__PURE__ */ React.createElement("img", {
|
|
1693
|
-
src: distanceImg,
|
|
1694
|
-
width: 20,
|
|
1695
|
-
height: 29
|
|
1696
|
-
}), /* @__PURE__ */ React.createElement("p", null, infoText)), /* @__PURE__ */ React.createElement("div", {
|
|
1697
|
-
className: "pda-distance-card-progress"
|
|
1698
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
1699
|
-
className: "pda-distance-card-progress-inside",
|
|
1700
|
-
style: { width: `${percentage * 100}%` }
|
|
1701
|
-
}), /* @__PURE__ */ React.createElement("img", {
|
|
1702
|
-
className: "pda-distance-card-progress-indictor",
|
|
1703
|
-
src: indictorImg
|
|
1704
|
-
})), /* @__PURE__ */ React.createElement("div", {
|
|
1705
|
-
className: "pda-distance-label"
|
|
1706
|
-
}, /* @__PURE__ */ React.createElement("p", null, "\u8FDC"), /* @__PURE__ */ React.createElement("p", null, "\u8FD1")));
|
|
1707
|
-
}
|
|
1708
|
-
}
|
|
1709
|
-
var index$8 = "";
|
|
1710
|
-
function SubCard(props) {
|
|
1711
|
-
const { title, context, name, tag, attrs = [], style } = props;
|
|
1712
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
1713
|
-
className: "android-sub-card",
|
|
1714
|
-
style
|
|
1715
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
1716
|
-
className: "android-sub-card-title-section"
|
|
1717
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
1718
|
-
className: "android-sub-card-title"
|
|
1719
|
-
}, title), tag ? /* @__PURE__ */ React.createElement("div", {
|
|
1720
|
-
className: "android-sub-card-tag"
|
|
1721
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
1722
|
-
className: tag.type
|
|
1723
|
-
}, tag.label || "")) : null), /* @__PURE__ */ React.createElement("div", {
|
|
1724
|
-
className: "android-sub-card-context"
|
|
1725
|
-
}, context), name ? /* @__PURE__ */ React.createElement("div", {
|
|
1726
|
-
className: "android-sub-card-name"
|
|
1727
|
-
}, name) : null, /* @__PURE__ */ React.createElement("div", {
|
|
1728
|
-
className: "android-sub-card-attrs"
|
|
1729
|
-
}, attrs.map((text) => {
|
|
1730
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
1731
|
-
key: text
|
|
1732
|
-
}, text);
|
|
1733
|
-
})));
|
|
1734
|
-
}
|
|
1735
|
-
var index$7 = "";
|
|
1736
|
-
function SelectCard(props) {
|
|
1737
|
-
const { title, label, select = true, onClick = (e) => {
|
|
1738
|
-
} } = props;
|
|
1739
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
1740
|
-
className: "select-card"
|
|
1741
|
-
}, /* @__PURE__ */ React.createElement("p", null, title), /* @__PURE__ */ React.createElement("div", {
|
|
1742
|
-
className: "select-card-content",
|
|
1743
|
-
onClick
|
|
1744
|
-
}, label, " ", select ? /* @__PURE__ */ React.createElement("span", {
|
|
1745
|
-
className: "select-icon"
|
|
1746
|
-
}) : null, " "));
|
|
1747
|
-
}
|
|
1748
|
-
var index$6 = "";
|
|
1749
|
-
function empty() {
|
|
1750
|
-
}
|
|
1751
|
-
function index$5(props) {
|
|
1752
|
-
const { dataSource = [], onClickItem = empty } = props;
|
|
1753
|
-
let tabIndex = 1;
|
|
1754
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
1755
|
-
className: "pda-app-list"
|
|
1756
|
-
}, dataSource.map((item) => {
|
|
1757
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
1758
|
-
className: "pda-app-group",
|
|
1759
|
-
key: item.groupName
|
|
1760
|
-
}, /* @__PURE__ */ React.createElement("h2", {
|
|
1761
|
-
className: "group-name"
|
|
1762
|
-
}, item.groupName), /* @__PURE__ */ React.createElement("div", {
|
|
1763
|
-
className: "group-apps"
|
|
1764
|
-
}, item.list.map((it) => {
|
|
1765
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
1766
|
-
className: "app-item",
|
|
1767
|
-
key: it.name,
|
|
1768
|
-
autoFocus: tabIndex === 1,
|
|
1769
|
-
tabIndex: tabIndex++,
|
|
1770
|
-
onClick: () => onClickItem(it)
|
|
1771
|
-
}, /* @__PURE__ */ React.createElement("span", {
|
|
1772
|
-
className: "app-name"
|
|
1773
|
-
}, it.name), /* @__PURE__ */ React.createElement("span", {
|
|
1774
|
-
className: "app-subname"
|
|
1775
|
-
}, it.subname));
|
|
1776
|
-
})));
|
|
1777
|
-
}));
|
|
1778
|
-
}
|
|
1779
|
-
var index$4 = "";
|
|
1780
|
-
function usePersistFn(fn) {
|
|
1781
|
-
var fnRef = useRef(fn);
|
|
1782
|
-
fnRef.current = fn;
|
|
1783
|
-
var persistFn = useRef();
|
|
1784
|
-
if (!persistFn.current) {
|
|
1785
|
-
persistFn.current = function() {
|
|
1786
|
-
var args = [];
|
|
1787
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1788
|
-
args[_i] = arguments[_i];
|
|
1789
|
-
}
|
|
1790
|
-
return fnRef.current.apply(this, args);
|
|
1791
|
-
};
|
|
1792
|
-
}
|
|
1793
|
-
return persistFn.current;
|
|
1794
|
-
}
|
|
1795
|
-
var __awaiter = globalThis && globalThis.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
1796
|
-
function adopt(value) {
|
|
1797
|
-
return value instanceof P ? value : new P(function(resolve) {
|
|
1798
|
-
resolve(value);
|
|
1799
|
-
});
|
|
1800
|
-
}
|
|
1801
|
-
return new (P || (P = Promise))(function(resolve, reject) {
|
|
1802
|
-
function fulfilled(value) {
|
|
1803
|
-
try {
|
|
1804
|
-
step(generator.next(value));
|
|
1805
|
-
} catch (e) {
|
|
1806
|
-
reject(e);
|
|
1807
|
-
}
|
|
1808
|
-
}
|
|
1809
|
-
function rejected(value) {
|
|
1810
|
-
try {
|
|
1811
|
-
step(generator["throw"](value));
|
|
1812
|
-
} catch (e) {
|
|
1813
|
-
reject(e);
|
|
1814
|
-
}
|
|
1815
|
-
}
|
|
1816
|
-
function step(result) {
|
|
1817
|
-
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
1818
|
-
}
|
|
1819
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
1820
|
-
});
|
|
1821
|
-
};
|
|
1822
|
-
var __generator = globalThis && globalThis.__generator || function(thisArg, body) {
|
|
1823
|
-
var _ = {
|
|
1824
|
-
label: 0,
|
|
1825
|
-
sent: function sent() {
|
|
1826
|
-
if (t[0] & 1)
|
|
1827
|
-
throw t[1];
|
|
1828
|
-
return t[1];
|
|
1829
|
-
},
|
|
1830
|
-
trys: [],
|
|
1831
|
-
ops: []
|
|
1832
|
-
}, f, y, t, g;
|
|
1833
|
-
return g = {
|
|
1834
|
-
next: verb(0),
|
|
1835
|
-
"throw": verb(1),
|
|
1836
|
-
"return": verb(2)
|
|
1837
|
-
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
1838
|
-
return this;
|
|
1839
|
-
}), g;
|
|
1840
|
-
function verb(n) {
|
|
1841
|
-
return function(v) {
|
|
1842
|
-
return step([n, v]);
|
|
1843
|
-
};
|
|
1844
|
-
}
|
|
1845
|
-
function step(op) {
|
|
1846
|
-
if (f)
|
|
1847
|
-
throw new TypeError("Generator is already executing.");
|
|
1848
|
-
while (_) {
|
|
1849
|
-
try {
|
|
1850
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
|
|
1851
|
-
return t;
|
|
1852
|
-
if (y = 0, t)
|
|
1853
|
-
op = [op[0] & 2, t.value];
|
|
1854
|
-
switch (op[0]) {
|
|
1855
|
-
case 0:
|
|
1856
|
-
case 1:
|
|
1857
|
-
t = op;
|
|
1858
|
-
break;
|
|
1859
|
-
case 4:
|
|
1860
|
-
_.label++;
|
|
1861
|
-
return {
|
|
1862
|
-
value: op[1],
|
|
1863
|
-
done: false
|
|
1864
|
-
};
|
|
1865
|
-
case 5:
|
|
1866
|
-
_.label++;
|
|
1867
|
-
y = op[1];
|
|
1868
|
-
op = [0];
|
|
1869
|
-
continue;
|
|
1870
|
-
case 7:
|
|
1871
|
-
op = _.ops.pop();
|
|
1872
|
-
_.trys.pop();
|
|
1873
|
-
continue;
|
|
1874
|
-
default:
|
|
1875
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
1876
|
-
_ = 0;
|
|
1877
|
-
continue;
|
|
1878
|
-
}
|
|
1879
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
1880
|
-
_.label = op[1];
|
|
1881
|
-
break;
|
|
1882
|
-
}
|
|
1883
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
1884
|
-
_.label = t[1];
|
|
1885
|
-
t = op;
|
|
1886
|
-
break;
|
|
1887
|
-
}
|
|
1888
|
-
if (t && _.label < t[2]) {
|
|
1889
|
-
_.label = t[2];
|
|
1890
|
-
_.ops.push(op);
|
|
1891
|
-
break;
|
|
1892
|
-
}
|
|
1893
|
-
if (t[2])
|
|
1894
|
-
_.ops.pop();
|
|
1895
|
-
_.trys.pop();
|
|
1896
|
-
continue;
|
|
1897
|
-
}
|
|
1898
|
-
op = body.call(thisArg, _);
|
|
1899
|
-
} catch (e) {
|
|
1900
|
-
op = [6, e];
|
|
1901
|
-
y = 0;
|
|
1902
|
-
} finally {
|
|
1903
|
-
f = t = 0;
|
|
1904
|
-
}
|
|
1905
|
-
}
|
|
1906
|
-
if (op[0] & 5)
|
|
1907
|
-
throw op[1];
|
|
1908
|
-
return {
|
|
1909
|
-
value: op[0] ? op[1] : void 0,
|
|
1910
|
-
done: true
|
|
1911
|
-
};
|
|
1912
|
-
}
|
|
1913
|
-
};
|
|
1914
|
-
var __read = globalThis && globalThis.__read || function(o, n) {
|
|
1915
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
1916
|
-
if (!m)
|
|
1917
|
-
return o;
|
|
1918
|
-
var i = m.call(o), r2, ar = [], e;
|
|
1919
|
-
try {
|
|
1920
|
-
while ((n === void 0 || n-- > 0) && !(r2 = i.next()).done) {
|
|
1921
|
-
ar.push(r2.value);
|
|
1922
|
-
}
|
|
1923
|
-
} catch (error) {
|
|
1924
|
-
e = {
|
|
1925
|
-
error
|
|
1926
|
-
};
|
|
1927
|
-
} finally {
|
|
1928
|
-
try {
|
|
1929
|
-
if (r2 && !r2.done && (m = i["return"]))
|
|
1930
|
-
m.call(i);
|
|
1931
|
-
} finally {
|
|
1932
|
-
if (e)
|
|
1933
|
-
throw e.error;
|
|
1934
|
-
}
|
|
1935
|
-
}
|
|
1936
|
-
return ar;
|
|
1937
|
-
};
|
|
1938
|
-
var __spread = globalThis && globalThis.__spread || function() {
|
|
1939
|
-
for (var ar = [], i = 0; i < arguments.length; i++) {
|
|
1940
|
-
ar = ar.concat(__read(arguments[i]));
|
|
1941
|
-
}
|
|
1942
|
-
return ar;
|
|
1943
|
-
};
|
|
1944
|
-
function useLockFn(fn) {
|
|
1945
|
-
var _this = this;
|
|
1946
|
-
var lockRef = useRef(false);
|
|
1947
|
-
return useCallback(function() {
|
|
1948
|
-
var args = [];
|
|
1949
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1950
|
-
args[_i] = arguments[_i];
|
|
1951
|
-
}
|
|
1952
|
-
return __awaiter(_this, void 0, void 0, function() {
|
|
1953
|
-
var ret, e_1;
|
|
1954
|
-
return __generator(this, function(_a) {
|
|
1955
|
-
switch (_a.label) {
|
|
1956
|
-
case 0:
|
|
1957
|
-
if (lockRef.current)
|
|
1958
|
-
return [
|
|
1959
|
-
2
|
|
1960
|
-
];
|
|
1961
|
-
lockRef.current = true;
|
|
1962
|
-
_a.label = 1;
|
|
1963
|
-
case 1:
|
|
1964
|
-
_a.trys.push([1, 3, , 4]);
|
|
1965
|
-
return [
|
|
1966
|
-
4,
|
|
1967
|
-
fn.apply(void 0, __spread(args))
|
|
1968
|
-
];
|
|
1969
|
-
case 2:
|
|
1970
|
-
ret = _a.sent();
|
|
1971
|
-
lockRef.current = false;
|
|
1972
|
-
return [
|
|
1973
|
-
2,
|
|
1974
|
-
ret
|
|
1975
|
-
];
|
|
1976
|
-
case 3:
|
|
1977
|
-
e_1 = _a.sent();
|
|
1978
|
-
lockRef.current = false;
|
|
1979
|
-
throw e_1;
|
|
1980
|
-
case 4:
|
|
1981
|
-
return [
|
|
1982
|
-
2
|
|
1983
|
-
];
|
|
1984
|
-
}
|
|
1985
|
-
});
|
|
1986
|
-
});
|
|
1987
|
-
}, [fn]);
|
|
1988
|
-
}
|
|
1989
|
-
const overflowScrollReg = /scroll|auto/i;
|
|
1990
|
-
function isElement(node) {
|
|
1991
|
-
const ELEMENT_NODE_TYPE = 1;
|
|
1992
|
-
return node.tagName !== "HTML" && node.tagName !== "BODY" && node.nodeType === ELEMENT_NODE_TYPE;
|
|
1993
|
-
}
|
|
1994
|
-
function getScrollParent(el, root) {
|
|
1995
|
-
let node = el;
|
|
1996
|
-
while (node && node !== root && isElement(node)) {
|
|
1997
|
-
const { overflowY } = window.getComputedStyle(node);
|
|
1998
|
-
if (overflowScrollReg.test(overflowY)) {
|
|
1999
|
-
return node;
|
|
2000
|
-
}
|
|
2001
|
-
node = node.parentNode;
|
|
2002
|
-
}
|
|
2003
|
-
return root;
|
|
2004
|
-
}
|
|
2005
|
-
function Loading(props) {
|
|
2006
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
2007
|
-
style: {
|
|
2008
|
-
color: props.color || "#999"
|
|
2009
|
-
}
|
|
2010
|
-
}, /* @__PURE__ */ React.createElement("svg", {
|
|
2011
|
-
height: "1em",
|
|
2012
|
-
viewBox: "0 0 100 40",
|
|
2013
|
-
style: { verticalAlign: "-0.125em" }
|
|
2014
|
-
}, /* @__PURE__ */ React.createElement("g", {
|
|
2015
|
-
stroke: "none",
|
|
2016
|
-
strokeWidth: "1",
|
|
2017
|
-
fill: "none",
|
|
2018
|
-
fillRule: "evenodd"
|
|
2019
|
-
}, /* @__PURE__ */ React.createElement("g", {
|
|
2020
|
-
transform: "translate(-100.000000, -71.000000)"
|
|
2021
|
-
}, /* @__PURE__ */ React.createElement("g", {
|
|
2022
|
-
transform: "translate(95.000000, 71.000000)"
|
|
2023
|
-
}, /* @__PURE__ */ React.createElement("g", {
|
|
2024
|
-
transform: "translate(5.000000, 0.000000)"
|
|
2025
|
-
}, [0, 1, 2].map((i) => /* @__PURE__ */ React.createElement("rect", {
|
|
2026
|
-
key: i,
|
|
2027
|
-
fill: "currentColor",
|
|
2028
|
-
x: 20 + i * 26,
|
|
2029
|
-
y: "16",
|
|
2030
|
-
width: "8",
|
|
2031
|
-
height: "8",
|
|
2032
|
-
rx: "2"
|
|
2033
|
-
}, /* @__PURE__ */ React.createElement("animate", {
|
|
2034
|
-
attributeName: "y",
|
|
2035
|
-
from: "16",
|
|
2036
|
-
to: "16",
|
|
2037
|
-
dur: "2s",
|
|
2038
|
-
begin: `${i * 0.2}s`,
|
|
2039
|
-
repeatCount: "indefinite",
|
|
2040
|
-
values: "16; 6; 26; 16; 16",
|
|
2041
|
-
keyTimes: "0; 0.1; 0.3; 0.4; 1",
|
|
2042
|
-
id: "circ-anim"
|
|
2043
|
-
})))))))));
|
|
2044
|
-
}
|
|
2045
|
-
function isWindow(element) {
|
|
2046
|
-
return element === window;
|
|
2047
|
-
}
|
|
2048
|
-
function InfiniteScroll(props) {
|
|
2049
|
-
const { className, hasMore, loadMore, threshold = 0, style } = props;
|
|
2050
|
-
const doLoadMore = useLockFn(async () => {
|
|
2051
|
-
await loadMore();
|
|
2052
|
-
});
|
|
2053
|
-
const elementRef = useRef(null);
|
|
2054
|
-
const check = usePersistFn(() => {
|
|
2055
|
-
if (!hasMore)
|
|
2056
|
-
return;
|
|
2057
|
-
const element = elementRef.current;
|
|
2058
|
-
if (!element)
|
|
2059
|
-
return;
|
|
2060
|
-
const parent = getScrollParent(element);
|
|
2061
|
-
if (!parent)
|
|
2062
|
-
return;
|
|
2063
|
-
const elementTop = element.getBoundingClientRect().top;
|
|
2064
|
-
const current = isWindow(parent) ? window.innerHeight : parent.getBoundingClientRect().bottom;
|
|
2065
|
-
if (current >= elementTop - threshold) {
|
|
2066
|
-
doLoadMore();
|
|
2067
|
-
}
|
|
2068
|
-
});
|
|
2069
|
-
useEffect(() => {
|
|
2070
|
-
check();
|
|
2071
|
-
});
|
|
2072
|
-
useEffect(() => {
|
|
2073
|
-
const element = elementRef.current;
|
|
2074
|
-
if (!element)
|
|
2075
|
-
return;
|
|
2076
|
-
const parent = getScrollParent(element);
|
|
2077
|
-
if (!parent)
|
|
2078
|
-
return;
|
|
2079
|
-
function onScroll() {
|
|
2080
|
-
check();
|
|
2081
|
-
}
|
|
2082
|
-
parent.addEventListener("scroll", onScroll);
|
|
2083
|
-
return () => {
|
|
2084
|
-
parent.removeEventListener("scroll", onScroll);
|
|
2085
|
-
};
|
|
2086
|
-
}, []);
|
|
2087
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
2088
|
-
className: classNames({ [className]: true, "pda-infinite-scroll": true }),
|
|
2089
|
-
style,
|
|
2090
|
-
ref: elementRef
|
|
2091
|
-
}, hasMore ? /* @__PURE__ */ React.createElement("div", {
|
|
2092
|
-
className: "pda-infinite-scroll-view"
|
|
2093
|
-
}, /* @__PURE__ */ React.createElement("span", null, "\u52A0\u8F7D\u4E2D"), /* @__PURE__ */ React.createElement(Loading, null)) : /* @__PURE__ */ React.createElement("div", {
|
|
2094
|
-
className: "pda-infinite-scroll-view"
|
|
2095
|
-
}, /* @__PURE__ */ React.createElement("span", null, "\u6CA1\u6709\u66F4\u591A\u4E86~")));
|
|
2096
|
-
}
|
|
2097
|
-
var index$3 = "";
|
|
2098
|
-
function ActionSheet(props) {
|
|
2099
|
-
const { className = "", visible, actions = [], stickyToBottomActions = [], stickyToBottomDirection = "column", infiniteScroll = null } = props;
|
|
2100
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
2101
|
-
className: classNames({ [className]: true, "action-sheet": true, "show": visible })
|
|
2102
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
2103
|
-
className: "action-sheet-container"
|
|
2104
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
2105
|
-
className: "action-sheet-body"
|
|
2106
|
-
}, actions.map((item, index2) => {
|
|
2107
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
2108
|
-
onClick: () => {
|
|
2109
|
-
item.onClick(item.key);
|
|
2110
|
-
},
|
|
2111
|
-
className: "action-sheet-item",
|
|
2112
|
-
key: index2
|
|
2113
|
-
}, item.title);
|
|
2114
|
-
}), infiniteScroll ? /* @__PURE__ */ React.createElement(InfiniteScroll, __spreadValues({}, infiniteScroll)) : null), stickyToBottomActions.length > 0 ? /* @__PURE__ */ React.createElement("div", {
|
|
2115
|
-
className: classNames({ "action-sheet-sticky-bottom": true, ["action-sheet-sticky-bottom-" + stickyToBottomDirection]: true })
|
|
2116
|
-
}, stickyToBottomActions.map((item, index2) => {
|
|
2117
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
2118
|
-
onClick: () => {
|
|
2119
|
-
item.onClick(item.key);
|
|
2120
|
-
},
|
|
2121
|
-
className: "action-sheet-item",
|
|
2122
|
-
key: index2
|
|
2123
|
-
}, item.title);
|
|
2124
|
-
})) : null));
|
|
2125
|
-
}
|
|
2126
|
-
var index$2 = "";
|
|
2127
|
-
function Tag(props) {
|
|
2128
|
-
const { className = void 0, label = "label", type = "success" } = props;
|
|
2129
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
2130
|
-
className: classNames({ [className]: true, "pda-tag": true, ["pda-tag-" + type]: true })
|
|
2131
|
-
}, label);
|
|
2132
|
-
}
|
|
2133
|
-
var index$1 = "";
|
|
2134
|
-
function SimpleCard(props) {
|
|
2135
|
-
const { className = void 0, title = "", content = "", type = "default", onClick = () => {
|
|
2136
|
-
} } = props;
|
|
2137
|
-
return title || content ? /* @__PURE__ */ React.createElement("div", {
|
|
2138
|
-
className: classNames({ [className]: true, "simple-card": true, ["simple-card-" + type]: true }),
|
|
2139
|
-
onClick
|
|
2140
|
-
}, /* @__PURE__ */ React.createElement("p", {
|
|
2141
|
-
className: "simple-card-title"
|
|
2142
|
-
}, title), /* @__PURE__ */ React.createElement("p", {
|
|
2143
|
-
className: "simple-card-content"
|
|
2144
|
-
}, content)) : null;
|
|
2145
|
-
}
|
|
2146
|
-
var index = "";
|
|
2147
|
-
function SimpleCardBlock(props) {
|
|
2148
|
-
const { className = void 0, dataSource = [], title = "", tag } = props;
|
|
2149
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
2150
|
-
className: classNames({ [className]: true, "simple-card-block": true })
|
|
2151
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
2152
|
-
className: "simple-card-block-header"
|
|
2153
|
-
}, /* @__PURE__ */ React.createElement("p", {
|
|
2154
|
-
className: "simple-card-block-title"
|
|
2155
|
-
}, title), tag ? /* @__PURE__ */ React.createElement("div", {
|
|
2156
|
-
style: { marginLeft: 12 }
|
|
2157
|
-
}, /* @__PURE__ */ React.createElement(Tag, __spreadValues({}, tag))) : null), dataSource.length > 0 ? /* @__PURE__ */ React.createElement("div", {
|
|
2158
|
-
className: "simple-card-block-content"
|
|
2159
|
-
}, dataSource.map((item, index2) => {
|
|
2160
|
-
return /* @__PURE__ */ React.createElement(SimpleCard, __spreadValues({
|
|
2161
|
-
key: index2
|
|
2162
|
-
}, item));
|
|
2163
|
-
}), /* @__PURE__ */ React.createElement("div", {
|
|
2164
|
-
style: { display: "inline-block", padding: "12px 18px" }
|
|
2165
|
-
}), /* @__PURE__ */ React.createElement("div", {
|
|
2166
|
-
style: { display: "inline-block", padding: "0 18px", margin: 0 }
|
|
2167
|
-
})) : null);
|
|
2168
|
-
}
|
|
2169
|
-
const ListItem = PdaListItem;
|
|
2170
|
-
export { ActionSheet, index$5 as AppList, BaseLayout, Button, Confirm, PdaDistanceCard as DistanceCard, PdaFinishCard as FinishCard, index$q as Header, InfiniteScroll, PdaInfoCard$2 as InfoCard, Keyborard, List, ListItem, Overlay$1 as Overlay, index$h as PageFlowSystemPages, Presentation, SelectCard, SimpleCard, SimpleCardBlock, PdaInfoCard as Steps, SubCard, Tag, PdaListItem as TaskCard, PdaTitle as Title, Toast, WakeKeyborard };
|