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