@cniot/android-pda-components 0.2.20 → 0.2.21

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