@cniot/android-pda-components 1.1.2-beta.5 → 1.1.2-beta.7
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.78ca2ea7.js → index.7a660331.js} +59 -77
- package/build/assets/index.e0ad8d6d.css +1 -0
- package/build/index.html +2 -2
- package/change.md +0 -9
- package/doc/index.jsx +0 -6
- package/es/index.cjs.js +6 -6
- package/es/index.es.js +245 -398
- package/es/style.css +1 -1
- package/package.json +5 -7
- package/build/assets/index.5bbfc9f6.css +0 -1
package/es/index.es.js
CHANGED
|
@@ -6,47 +6,57 @@ var __publicField = (obj, key, value) => {
|
|
|
6
6
|
};
|
|
7
7
|
import React, { useState, useEffect, forwardRef, useImperativeHandle, createRef, useRef, Component, cloneElement, useCallback } from "react";
|
|
8
8
|
import ReactDOM from "react-dom";
|
|
9
|
-
var global =
|
|
9
|
+
var global = "";
|
|
10
10
|
window.PDA_IMAGE_PATH = window.PDA_IMAGE_PATH ? window.PDA_IMAGE_PATH : "https://img.alicdn.com/imgextra/i3/";
|
|
11
11
|
const PDA_IMAGE_PATH = window.PDA_IMAGE_PATH;
|
|
12
|
-
var
|
|
12
|
+
var _classnames_2_5_1_classnames = { exports: {} };
|
|
13
13
|
/*!
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
Copyright (c) 2018 Jed Watson.
|
|
15
|
+
Licensed under the MIT License (MIT), see
|
|
16
|
+
http://jedwatson.github.io/classnames
|
|
17
17
|
*/
|
|
18
18
|
(function(module) {
|
|
19
19
|
(function() {
|
|
20
20
|
var hasOwn = {}.hasOwnProperty;
|
|
21
21
|
function classNames2() {
|
|
22
|
-
var classes =
|
|
22
|
+
var classes = "";
|
|
23
23
|
for (var i = 0; i < arguments.length; i++) {
|
|
24
24
|
var arg = arguments[i];
|
|
25
|
-
if (
|
|
26
|
-
|
|
27
|
-
var argType = typeof arg;
|
|
28
|
-
if (argType === "string" || argType === "number") {
|
|
29
|
-
classes.push(arg);
|
|
30
|
-
} else if (Array.isArray(arg)) {
|
|
31
|
-
if (arg.length) {
|
|
32
|
-
var inner = classNames2.apply(null, arg);
|
|
33
|
-
if (inner) {
|
|
34
|
-
classes.push(inner);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
} else if (argType === "object") {
|
|
38
|
-
if (arg.toString === Object.prototype.toString) {
|
|
39
|
-
for (var key in arg) {
|
|
40
|
-
if (hasOwn.call(arg, key) && arg[key]) {
|
|
41
|
-
classes.push(key);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
} else {
|
|
45
|
-
classes.push(arg.toString());
|
|
46
|
-
}
|
|
25
|
+
if (arg) {
|
|
26
|
+
classes = appendClass(classes, parseValue(arg));
|
|
47
27
|
}
|
|
48
28
|
}
|
|
49
|
-
return classes
|
|
29
|
+
return classes;
|
|
30
|
+
}
|
|
31
|
+
function parseValue(arg) {
|
|
32
|
+
if (typeof arg === "string" || typeof arg === "number") {
|
|
33
|
+
return arg;
|
|
34
|
+
}
|
|
35
|
+
if (typeof arg !== "object") {
|
|
36
|
+
return "";
|
|
37
|
+
}
|
|
38
|
+
if (Array.isArray(arg)) {
|
|
39
|
+
return classNames2.apply(null, arg);
|
|
40
|
+
}
|
|
41
|
+
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) {
|
|
42
|
+
return arg.toString();
|
|
43
|
+
}
|
|
44
|
+
var classes = "";
|
|
45
|
+
for (var key in arg) {
|
|
46
|
+
if (hasOwn.call(arg, key) && arg[key]) {
|
|
47
|
+
classes = appendClass(classes, key);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return classes;
|
|
51
|
+
}
|
|
52
|
+
function appendClass(value, newClass) {
|
|
53
|
+
if (!newClass) {
|
|
54
|
+
return value;
|
|
55
|
+
}
|
|
56
|
+
if (value) {
|
|
57
|
+
return value + " " + newClass;
|
|
58
|
+
}
|
|
59
|
+
return value + newClass;
|
|
50
60
|
}
|
|
51
61
|
if (module.exports) {
|
|
52
62
|
classNames2.default = classNames2;
|
|
@@ -55,9 +65,9 @@ var _classnames_2_3_1_classnames = { exports: {} };
|
|
|
55
65
|
window.classNames = classNames2;
|
|
56
66
|
}
|
|
57
67
|
})();
|
|
58
|
-
})(
|
|
59
|
-
var classNames =
|
|
60
|
-
var index$
|
|
68
|
+
})(_classnames_2_5_1_classnames);
|
|
69
|
+
var classNames = _classnames_2_5_1_classnames.exports;
|
|
70
|
+
var index$D = "";
|
|
61
71
|
function getTypeClass$2(type) {
|
|
62
72
|
return {
|
|
63
73
|
center: "op-overlay center",
|
|
@@ -89,7 +99,7 @@ function Overlay$1(props) {
|
|
|
89
99
|
}
|
|
90
100
|
}, props.children) : null;
|
|
91
101
|
}
|
|
92
|
-
var index$
|
|
102
|
+
var index$C = "";
|
|
93
103
|
const blankFunc$6 = () => {
|
|
94
104
|
};
|
|
95
105
|
class PdaTitle extends React.Component {
|
|
@@ -142,12 +152,12 @@ class PdaTitle extends React.Component {
|
|
|
142
152
|
var _keycode_2_2_1_keycode = { exports: {} };
|
|
143
153
|
(function(module, exports) {
|
|
144
154
|
function keyCode(searchInput) {
|
|
145
|
-
if (searchInput && typeof searchInput
|
|
155
|
+
if (searchInput && "object" === typeof searchInput) {
|
|
146
156
|
var hasKeyCode = searchInput.which || searchInput.keyCode || searchInput.charCode;
|
|
147
157
|
if (hasKeyCode)
|
|
148
158
|
searchInput = hasKeyCode;
|
|
149
159
|
}
|
|
150
|
-
if (typeof searchInput
|
|
160
|
+
if ("number" === typeof searchInput)
|
|
151
161
|
return names[searchInput];
|
|
152
162
|
var search = String(searchInput);
|
|
153
163
|
var foundNamedKey = codes[search.toLowerCase()];
|
|
@@ -161,7 +171,7 @@ var _keycode_2_2_1_keycode = { exports: {} };
|
|
|
161
171
|
return void 0;
|
|
162
172
|
}
|
|
163
173
|
keyCode.isEventKey = function isEventKey(event, nameOrCode) {
|
|
164
|
-
if (event && typeof event
|
|
174
|
+
if (event && "object" === typeof event) {
|
|
165
175
|
var keyCode2 = event.which || event.keyCode || event.charCode;
|
|
166
176
|
if (keyCode2 === null || keyCode2 === void 0) {
|
|
167
177
|
return false;
|
|
@@ -268,7 +278,7 @@ var _keycode_2_2_1_keycode = { exports: {} };
|
|
|
268
278
|
}
|
|
269
279
|
})(_keycode_2_2_1_keycode, _keycode_2_2_1_keycode.exports);
|
|
270
280
|
var keycode = _keycode_2_2_1_keycode.exports;
|
|
271
|
-
var index$
|
|
281
|
+
var index$B = "";
|
|
272
282
|
function Button(props) {
|
|
273
283
|
const { type = "default", onClick, className = "", tabIndex = 1, dataClick = "" } = props;
|
|
274
284
|
let opt = {};
|
|
@@ -291,7 +301,7 @@ Button.Group = ButtonGroup;
|
|
|
291
301
|
const SPECIAL_KEY_MAP = ["fn"];
|
|
292
302
|
const empty$3 = () => {
|
|
293
303
|
};
|
|
294
|
-
function index$
|
|
304
|
+
function index$A(props) {
|
|
295
305
|
const {
|
|
296
306
|
onBack,
|
|
297
307
|
icon,
|
|
@@ -306,20 +316,32 @@ function index$B(props) {
|
|
|
306
316
|
backShortcutKey
|
|
307
317
|
} = props;
|
|
308
318
|
const [showMenus, setShowMenus] = React.useState(false);
|
|
309
|
-
React.useEffect(
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
319
|
+
React.useEffect(
|
|
320
|
+
function() {
|
|
321
|
+
if (menuShortcutKey) {
|
|
322
|
+
return bindShortcutKey(
|
|
323
|
+
getShortcutKeyCodes(menuShortcutKey),
|
|
324
|
+
function() {
|
|
325
|
+
setShowMenus(true);
|
|
326
|
+
}
|
|
327
|
+
);
|
|
328
|
+
}
|
|
329
|
+
},
|
|
330
|
+
[menuShortcutKey]
|
|
331
|
+
);
|
|
332
|
+
React.useEffect(
|
|
333
|
+
function() {
|
|
334
|
+
if (backShortcutKey && onBack) {
|
|
335
|
+
return bindShortcutKey(
|
|
336
|
+
getShortcutKeyCodes(backShortcutKey),
|
|
337
|
+
function() {
|
|
338
|
+
onBack("back");
|
|
339
|
+
}
|
|
340
|
+
);
|
|
341
|
+
}
|
|
342
|
+
},
|
|
343
|
+
[backShortcutKey, onBack]
|
|
344
|
+
);
|
|
323
345
|
React.useEffect(() => {
|
|
324
346
|
return onKeyBoradBack(function() {
|
|
325
347
|
onBack && onBack("back");
|
|
@@ -399,7 +421,7 @@ function bindShortcutKey(keys, callback) {
|
|
|
399
421
|
}
|
|
400
422
|
function onKeyBoradBack(fn) {
|
|
401
423
|
function keyPressed(data) {
|
|
402
|
-
if (data.param.originValue
|
|
424
|
+
if ("back" == data.param.originValue) {
|
|
403
425
|
fn && fn();
|
|
404
426
|
}
|
|
405
427
|
}
|
|
@@ -414,7 +436,7 @@ function addEventListener(node, eventName, fn) {
|
|
|
414
436
|
node.removeEventListener(eventName, fn);
|
|
415
437
|
};
|
|
416
438
|
}
|
|
417
|
-
var index$
|
|
439
|
+
var index$z = "";
|
|
418
440
|
class PdaInfoCard$2 extends React.Component {
|
|
419
441
|
constructor(props) {
|
|
420
442
|
super(props);
|
|
@@ -493,7 +515,7 @@ class PdaInfoCard$2 extends React.Component {
|
|
|
493
515
|
}
|
|
494
516
|
}
|
|
495
517
|
PdaInfoCard$2.IMAGE_1 = `${window.PDA_IMAGE_PATH}O1CN01qYuxip1ME9zhdL9XG_!!6000000001402-2-tps-150-150.png`;
|
|
496
|
-
var index$
|
|
518
|
+
var index$y = "";
|
|
497
519
|
class PdaListItem extends React.Component {
|
|
498
520
|
constructor(props) {
|
|
499
521
|
super(props);
|
|
@@ -539,7 +561,7 @@ class PdaListItem extends React.Component {
|
|
|
539
561
|
}));
|
|
540
562
|
}
|
|
541
563
|
}
|
|
542
|
-
var index$
|
|
564
|
+
var index$x = "";
|
|
543
565
|
function empty$2() {
|
|
544
566
|
}
|
|
545
567
|
function Confirm(props) {
|
|
@@ -584,16 +606,22 @@ function Confirm(props) {
|
|
|
584
606
|
dataClick: item.dataClick
|
|
585
607
|
}, item.label))) : null));
|
|
586
608
|
}
|
|
587
|
-
var index$
|
|
609
|
+
var index$w = "";
|
|
588
610
|
function WindVaneLog(param) {
|
|
589
611
|
const params = {
|
|
590
612
|
domain: "logger",
|
|
591
613
|
method: "deviceLog",
|
|
592
614
|
params: param
|
|
593
615
|
};
|
|
594
|
-
WindVane.call(
|
|
595
|
-
|
|
596
|
-
|
|
616
|
+
WindVane.call(
|
|
617
|
+
"WindvanePlugin",
|
|
618
|
+
"invoke",
|
|
619
|
+
JSON.stringify(params),
|
|
620
|
+
function(e) {
|
|
621
|
+
},
|
|
622
|
+
function(e) {
|
|
623
|
+
}
|
|
624
|
+
);
|
|
597
625
|
}
|
|
598
626
|
function resolveContainer(getContainer) {
|
|
599
627
|
const container = typeof getContainer === "function" ? getContainer() : getContainer;
|
|
@@ -619,7 +647,11 @@ function playSound(sound) {
|
|
|
619
647
|
method: "playSound",
|
|
620
648
|
params: { sound }
|
|
621
649
|
};
|
|
622
|
-
WindVane.call(
|
|
650
|
+
WindVane.call(
|
|
651
|
+
"WindvanePlugin",
|
|
652
|
+
"invoke",
|
|
653
|
+
JSON.stringify(params)
|
|
654
|
+
);
|
|
623
655
|
}
|
|
624
656
|
}
|
|
625
657
|
function getTypeClass$1(type) {
|
|
@@ -708,7 +740,10 @@ const defaultProps = {
|
|
|
708
740
|
duration: 2e3
|
|
709
741
|
};
|
|
710
742
|
function show(p) {
|
|
711
|
-
const props = mergeProps(
|
|
743
|
+
const props = mergeProps(
|
|
744
|
+
defaultProps,
|
|
745
|
+
p
|
|
746
|
+
);
|
|
712
747
|
let timer = 0;
|
|
713
748
|
const { getContainer = () => document.body } = props;
|
|
714
749
|
const container = document.createElement("div");
|
|
@@ -840,7 +875,7 @@ function confirm(props) {
|
|
|
840
875
|
onClick: onNext
|
|
841
876
|
}));
|
|
842
877
|
}
|
|
843
|
-
var index$
|
|
878
|
+
var index$v = "";
|
|
844
879
|
function getTypeClass(type) {
|
|
845
880
|
return {
|
|
846
881
|
center: "op-overlay center",
|
|
@@ -872,7 +907,7 @@ function Overlay(props) {
|
|
|
872
907
|
}
|
|
873
908
|
}, props.children) : null;
|
|
874
909
|
}
|
|
875
|
-
var index$
|
|
910
|
+
var index$u = "";
|
|
876
911
|
function Prompt(props) {
|
|
877
912
|
const inputRef = React.useRef();
|
|
878
913
|
const { data = {}, onNext } = props;
|
|
@@ -933,8 +968,7 @@ function toast(props) {
|
|
|
933
968
|
setHidden(false);
|
|
934
969
|
}, [action.sequence]);
|
|
935
970
|
return !hidden ? /* @__PURE__ */ React.createElement(Overlay$1, {
|
|
936
|
-
verticalPosition: "bottom"
|
|
937
|
-
closable: true
|
|
971
|
+
verticalPosition: "bottom"
|
|
938
972
|
}, /* @__PURE__ */ React.createElement("div", {
|
|
939
973
|
style: { width: "90%" }
|
|
940
974
|
}, /* @__PURE__ */ React.createElement(Toast, {
|
|
@@ -950,7 +984,7 @@ function splitMessage(message) {
|
|
|
950
984
|
var msg = String(message).split("by Error:");
|
|
951
985
|
return msg[1] || msg[0];
|
|
952
986
|
}
|
|
953
|
-
var index$
|
|
987
|
+
var index$t = "";
|
|
954
988
|
function NotFound(props) {
|
|
955
989
|
return /* @__PURE__ */ React.createElement("div", {
|
|
956
990
|
style: { padding: "20%" }
|
|
@@ -958,36 +992,39 @@ function NotFound(props) {
|
|
|
958
992
|
style: { fontSize: "60%" }
|
|
959
993
|
}, "Not found")), /* @__PURE__ */ React.createElement("div", null, props.action.getPage()));
|
|
960
994
|
}
|
|
961
|
-
var index$
|
|
995
|
+
var index$s = "";
|
|
962
996
|
function Loading$1(props) {
|
|
963
997
|
const [showLoading, setShowLoading] = React.useState(props.visible);
|
|
964
998
|
const edgeService = props.edgeService;
|
|
965
|
-
React.useEffect(
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
if (!edgeService)
|
|
984
|
-
return () => {
|
|
999
|
+
React.useEffect(
|
|
1000
|
+
function() {
|
|
1001
|
+
let currentLoading = false;
|
|
1002
|
+
const throttleSetShowLoading = function(loading2) {
|
|
1003
|
+
currentLoading = loading2;
|
|
1004
|
+
if (loading2) {
|
|
1005
|
+
setTimeout(function() {
|
|
1006
|
+
if (currentLoading === loading2) {
|
|
1007
|
+
setShowLoading(true);
|
|
1008
|
+
}
|
|
1009
|
+
}, 350);
|
|
1010
|
+
} else {
|
|
1011
|
+
setTimeout(function() {
|
|
1012
|
+
if (currentLoading === loading2) {
|
|
1013
|
+
setShowLoading(false);
|
|
1014
|
+
}
|
|
1015
|
+
}, 100);
|
|
1016
|
+
}
|
|
985
1017
|
};
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
1018
|
+
if (!edgeService)
|
|
1019
|
+
return () => {
|
|
1020
|
+
};
|
|
1021
|
+
edgeService.on("IO_STATUS", throttleSetShowLoading);
|
|
1022
|
+
return function() {
|
|
1023
|
+
edgeService.off("IO_STATUS", throttleSetShowLoading);
|
|
1024
|
+
};
|
|
1025
|
+
},
|
|
1026
|
+
[edgeService]
|
|
1027
|
+
);
|
|
991
1028
|
return showLoading ? /* @__PURE__ */ React.createElement("div", {
|
|
992
1029
|
className: "loading-wrap"
|
|
993
1030
|
}, /* @__PURE__ */ React.createElement("div", {
|
|
@@ -1011,7 +1048,11 @@ function PlaySound({ data, service, action }) {
|
|
|
1011
1048
|
method: "playSound",
|
|
1012
1049
|
params: { sound }
|
|
1013
1050
|
};
|
|
1014
|
-
WindVane.call(
|
|
1051
|
+
WindVane.call(
|
|
1052
|
+
"WindvanePlugin",
|
|
1053
|
+
"invoke",
|
|
1054
|
+
JSON.stringify(params)
|
|
1055
|
+
);
|
|
1015
1056
|
}
|
|
1016
1057
|
service.onNext({});
|
|
1017
1058
|
return null;
|
|
@@ -1020,7 +1061,7 @@ function Debug() {
|
|
|
1020
1061
|
console.warn('Please stop using "Debug" Components');
|
|
1021
1062
|
return null;
|
|
1022
1063
|
}
|
|
1023
|
-
var index$
|
|
1064
|
+
var index$r = {
|
|
1024
1065
|
Alert,
|
|
1025
1066
|
Start,
|
|
1026
1067
|
Toast: toast,
|
|
@@ -1031,7 +1072,7 @@ var index$s = {
|
|
|
1031
1072
|
Loading: Loading$1,
|
|
1032
1073
|
PlaySound
|
|
1033
1074
|
};
|
|
1034
|
-
var index$
|
|
1075
|
+
var index$q = "";
|
|
1035
1076
|
function Presentation(props) {
|
|
1036
1077
|
const {
|
|
1037
1078
|
image = Presentation.IMAGE_1,
|
|
@@ -1053,7 +1094,7 @@ Presentation.IMAGE_1 = `${window.PDA_IMAGE_PATH}O1CN019Ivkor1ksy3pMGDsz_!!600000
|
|
|
1053
1094
|
Presentation.IMAGE_2 = `${window.PDA_IMAGE_PATH}O1CN01lhSunu1X4VPw1Mlas_!!6000000002870-2-tps-352-158.png`;
|
|
1054
1095
|
Presentation.IMAGE_3 = `${window.PDA_IMAGE_PATH}O1CN01mreYXo1XfbUsQ7hip_!!6000000002951-2-tps-322-144.png`;
|
|
1055
1096
|
Presentation.IMAGE_4 = `${window.PDA_IMAGE_PATH}O1CN017gNM8F1Fmmcfti7Dg_!!6000000000530-1-tps-414-286.gif`;
|
|
1056
|
-
var index$
|
|
1097
|
+
var index$p = "";
|
|
1057
1098
|
function empty$1() {
|
|
1058
1099
|
}
|
|
1059
1100
|
function List$1(props) {
|
|
@@ -1108,7 +1149,7 @@ function DefaultItem(props) {
|
|
|
1108
1149
|
}, extra));
|
|
1109
1150
|
}
|
|
1110
1151
|
List$1.Item = DefaultItem;
|
|
1111
|
-
var index$
|
|
1152
|
+
var index$o = "";
|
|
1112
1153
|
const blankFunc$5 = () => {
|
|
1113
1154
|
};
|
|
1114
1155
|
class BaseLayoutContainer extends React.Component {
|
|
@@ -1418,9 +1459,15 @@ class BarcodeScan extends React.Component {
|
|
|
1418
1459
|
document.addEventListener("keyup", this._handleKeyUp);
|
|
1419
1460
|
}
|
|
1420
1461
|
document.addEventListener("BarcodeScan", this.onScanBarcode);
|
|
1421
|
-
WindVane.call(
|
|
1422
|
-
|
|
1423
|
-
|
|
1462
|
+
WindVane.call(
|
|
1463
|
+
"WindvanePlugin",
|
|
1464
|
+
"invoke",
|
|
1465
|
+
"{'domain': 'keyboard', 'method': 'changeScanMode', 'params': {'scanMode': 'barcode'}}",
|
|
1466
|
+
function(e) {
|
|
1467
|
+
},
|
|
1468
|
+
function(e) {
|
|
1469
|
+
}
|
|
1470
|
+
);
|
|
1424
1471
|
}
|
|
1425
1472
|
componentWillUnmount() {
|
|
1426
1473
|
const { onBarcodeScan } = this.props;
|
|
@@ -1474,7 +1521,7 @@ class BaseLayout extends React.Component {
|
|
|
1474
1521
|
});
|
|
1475
1522
|
}
|
|
1476
1523
|
}
|
|
1477
|
-
var index$
|
|
1524
|
+
var index$n = "";
|
|
1478
1525
|
const blankFunc$1 = () => {
|
|
1479
1526
|
};
|
|
1480
1527
|
function Keyborard(props) {
|
|
@@ -1622,7 +1669,7 @@ class UploadeButton extends Component {
|
|
|
1622
1669
|
}))));
|
|
1623
1670
|
}
|
|
1624
1671
|
}
|
|
1625
|
-
var index$
|
|
1672
|
+
var index$m = "";
|
|
1626
1673
|
const classPrefix$1 = "image-viewer";
|
|
1627
1674
|
class ImageViewer extends Component {
|
|
1628
1675
|
constructor(props) {
|
|
@@ -1819,24 +1866,56 @@ class ImageUploader extends Component {
|
|
|
1819
1866
|
};
|
|
1820
1867
|
});
|
|
1821
1868
|
__publicField(this, "handlerUpload", (params) => {
|
|
1822
|
-
const { beforeUpload, onBeforeUpload } = this.props;
|
|
1823
|
-
window.WindVane.call("
|
|
1824
|
-
|
|
1869
|
+
const { beforeUpload, onBeforeUpload, compressSize = 200 } = this.props;
|
|
1870
|
+
window.WindVane.call("WindvanePlugin", "invoke", JSON.stringify({ domain: "camera", method: "getVersion" }), function(res) {
|
|
1871
|
+
var _a;
|
|
1872
|
+
if (((_a = res == null ? void 0 : res.data) == null ? void 0 : _a.version) === "1.1.2-beta.7") {
|
|
1873
|
+
newFn();
|
|
1874
|
+
} else {
|
|
1875
|
+
old();
|
|
1876
|
+
}
|
|
1877
|
+
}, function(err) {
|
|
1878
|
+
oldFn();
|
|
1879
|
+
});
|
|
1880
|
+
function newFn() {
|
|
1881
|
+
var params2 = {
|
|
1825
1882
|
domain: "camera",
|
|
1826
|
-
method: "
|
|
1827
|
-
params: {
|
|
1828
|
-
filePath: e.localPath
|
|
1829
|
-
}
|
|
1883
|
+
method: "takePhoto",
|
|
1884
|
+
params: { compressSize }
|
|
1830
1885
|
};
|
|
1831
|
-
window.WindVane.call(
|
|
1832
|
-
|
|
1833
|
-
|
|
1886
|
+
window.WindVane.call(
|
|
1887
|
+
"WindvanePlugin",
|
|
1888
|
+
"invoke",
|
|
1889
|
+
JSON.stringify(params2),
|
|
1890
|
+
function(e) {
|
|
1891
|
+
const base64 = e.data.imageBase64;
|
|
1892
|
+
beforeUpload && beforeUpload({ base64 });
|
|
1893
|
+
onBeforeUpload && onBeforeUpload({ base64 });
|
|
1894
|
+
},
|
|
1895
|
+
(err) => {
|
|
1896
|
+
console.log("takePhoto failure: " + JSON.stringify(err));
|
|
1897
|
+
}
|
|
1898
|
+
);
|
|
1899
|
+
}
|
|
1900
|
+
function oldFn() {
|
|
1901
|
+
window.WindVane.call("WVCamera", "takePhoto", params, function(e) {
|
|
1902
|
+
const plugin = {
|
|
1903
|
+
domain: "camera",
|
|
1904
|
+
method: "getBase64",
|
|
1905
|
+
params: {
|
|
1906
|
+
filePath: e.localPath
|
|
1907
|
+
}
|
|
1908
|
+
};
|
|
1909
|
+
window.WindVane.call("WindvanePlugin", "invoke", JSON.stringify(plugin), function(res) {
|
|
1910
|
+
beforeUpload && beforeUpload(res.data);
|
|
1911
|
+
onBeforeUpload && onBeforeUpload(res.data);
|
|
1912
|
+
}, function(err) {
|
|
1913
|
+
console.log("failure " + JSON.stringify(err));
|
|
1914
|
+
});
|
|
1834
1915
|
}, function(err) {
|
|
1835
|
-
console.log("failure " + JSON.stringify(err));
|
|
1916
|
+
console.log("takePhoto failure: " + JSON.stringify(err));
|
|
1836
1917
|
});
|
|
1837
|
-
}
|
|
1838
|
-
console.log("takePhoto failure: " + JSON.stringify(err));
|
|
1839
|
-
});
|
|
1918
|
+
}
|
|
1840
1919
|
});
|
|
1841
1920
|
__publicField(this, "onDelete", (item, index2) => {
|
|
1842
1921
|
const { onDelete } = this.props;
|
|
@@ -1918,9 +1997,9 @@ class ImageUploader extends Component {
|
|
|
1918
1997
|
}));
|
|
1919
1998
|
}
|
|
1920
1999
|
}
|
|
1921
|
-
var index$
|
|
1922
|
-
var index$
|
|
1923
|
-
var index$
|
|
2000
|
+
var index$l = "";
|
|
2001
|
+
var index$k = "";
|
|
2002
|
+
var index$j = "";
|
|
1924
2003
|
class PdaInfoCard$1 extends React.Component {
|
|
1925
2004
|
constructor(props) {
|
|
1926
2005
|
super(props);
|
|
@@ -1975,7 +2054,7 @@ class PdaInfoCard extends React.Component {
|
|
|
1975
2054
|
}
|
|
1976
2055
|
}
|
|
1977
2056
|
__publicField(PdaInfoCard, "Step", PdaInfoCard$1);
|
|
1978
|
-
var index$
|
|
2057
|
+
var index$i = "";
|
|
1979
2058
|
class PdaFinishCard extends React.Component {
|
|
1980
2059
|
constructor(props) {
|
|
1981
2060
|
super(props);
|
|
@@ -2029,7 +2108,7 @@ class PdaFinishCard extends React.Component {
|
|
|
2029
2108
|
}
|
|
2030
2109
|
PdaFinishCard.SUCCESS = `${window.PDA_IMAGE_PATH}O1CN01OL2UYg24792knbTtC_!!6000000007343-1-tps-506-415.gif`;
|
|
2031
2110
|
PdaFinishCard.ERROR_SUCCESS = `${window.PDA_IMAGE_PATH}O1CN01p5Oc5t1VMFWtBomQc_!!6000000002638-1-tps-600-456.gif`;
|
|
2032
|
-
var index$
|
|
2111
|
+
var index$h = "";
|
|
2033
2112
|
class PdaDistanceCard extends React.Component {
|
|
2034
2113
|
constructor(props) {
|
|
2035
2114
|
super(props);
|
|
@@ -2070,7 +2149,7 @@ class PdaDistanceCard extends React.Component {
|
|
|
2070
2149
|
}, /* @__PURE__ */ React.createElement("p", null, "\u8FDC"), /* @__PURE__ */ React.createElement("p", null, "\u8FD1")));
|
|
2071
2150
|
}
|
|
2072
2151
|
}
|
|
2073
|
-
var index$
|
|
2152
|
+
var index$g = "";
|
|
2074
2153
|
function SubCard(props) {
|
|
2075
2154
|
const { title, context, name, tag, attrs = [], style } = props;
|
|
2076
2155
|
return /* @__PURE__ */ React.createElement("div", {
|
|
@@ -2096,7 +2175,7 @@ function SubCard(props) {
|
|
|
2096
2175
|
}, text);
|
|
2097
2176
|
})));
|
|
2098
2177
|
}
|
|
2099
|
-
var index$
|
|
2178
|
+
var index$f = "";
|
|
2100
2179
|
function SelectCard(props) {
|
|
2101
2180
|
const { title, label, select = true, onClick = (e) => {
|
|
2102
2181
|
} } = props;
|
|
@@ -2109,10 +2188,10 @@ function SelectCard(props) {
|
|
|
2109
2188
|
className: "select-icon"
|
|
2110
2189
|
}) : null, " "));
|
|
2111
2190
|
}
|
|
2112
|
-
var index$
|
|
2191
|
+
var index$e = "";
|
|
2113
2192
|
function empty() {
|
|
2114
2193
|
}
|
|
2115
|
-
function index$
|
|
2194
|
+
function index$d(props) {
|
|
2116
2195
|
const { dataSource = [], onClickItem = empty } = props;
|
|
2117
2196
|
let tabIndex = 1;
|
|
2118
2197
|
return /* @__PURE__ */ React.createElement("div", {
|
|
@@ -2140,7 +2219,7 @@ function index$e(props) {
|
|
|
2140
2219
|
})));
|
|
2141
2220
|
}));
|
|
2142
2221
|
}
|
|
2143
|
-
var index$
|
|
2222
|
+
var index$c = "";
|
|
2144
2223
|
function usePersistFn(fn) {
|
|
2145
2224
|
var fnRef = useRef(fn);
|
|
2146
2225
|
fnRef.current = fn;
|
|
@@ -2458,7 +2537,7 @@ function InfiniteScroll(props) {
|
|
|
2458
2537
|
className: "pda-infinite-scroll-view"
|
|
2459
2538
|
}, /* @__PURE__ */ React.createElement("span", null, "\u6CA1\u6709\u66F4\u591A\u4E86~")));
|
|
2460
2539
|
}
|
|
2461
|
-
var index$
|
|
2540
|
+
var index$b = "";
|
|
2462
2541
|
function ActionSheet(props) {
|
|
2463
2542
|
const {
|
|
2464
2543
|
className = "",
|
|
@@ -2506,14 +2585,14 @@ function ActionSheet(props) {
|
|
|
2506
2585
|
}, item.title);
|
|
2507
2586
|
})) : null));
|
|
2508
2587
|
}
|
|
2509
|
-
var index$
|
|
2588
|
+
var index$a = "";
|
|
2510
2589
|
function Tag(props) {
|
|
2511
2590
|
const { className = void 0, label = "label", type = "success" } = props;
|
|
2512
2591
|
return /* @__PURE__ */ React.createElement("div", {
|
|
2513
2592
|
className: classNames({ [className]: true, "pda-tag": true, ["pda-tag-" + type]: true })
|
|
2514
2593
|
}, label);
|
|
2515
2594
|
}
|
|
2516
|
-
var index$
|
|
2595
|
+
var index$9 = "";
|
|
2517
2596
|
function SimpleCard(props) {
|
|
2518
2597
|
const { className = "", title = "", content = "", type = "default", onClick = () => {
|
|
2519
2598
|
} } = props;
|
|
@@ -2526,7 +2605,7 @@ function SimpleCard(props) {
|
|
|
2526
2605
|
className: "simple-card-content"
|
|
2527
2606
|
}, content)) : null;
|
|
2528
2607
|
}
|
|
2529
|
-
var index$
|
|
2608
|
+
var index$8 = "";
|
|
2530
2609
|
function SimpleCardBlock(props) {
|
|
2531
2610
|
const { className = void 0, dataSource = [], title = "", tag } = props;
|
|
2532
2611
|
return /* @__PURE__ */ React.createElement("div", {
|
|
@@ -2548,8 +2627,8 @@ function SimpleCardBlock(props) {
|
|
|
2548
2627
|
});
|
|
2549
2628
|
})) : null);
|
|
2550
2629
|
}
|
|
2551
|
-
var index$
|
|
2552
|
-
function index$
|
|
2630
|
+
var index$7 = "";
|
|
2631
|
+
function index$6(props) {
|
|
2553
2632
|
const { row = 3, col = 3, dataSource = [] } = props;
|
|
2554
2633
|
return /* @__PURE__ */ React.createElement("div", {
|
|
2555
2634
|
className: "lattice-mouth"
|
|
@@ -2557,7 +2636,9 @@ function index$7(props) {
|
|
|
2557
2636
|
return /* @__PURE__ */ React.createElement("div", {
|
|
2558
2637
|
className: "lattice-mouth-row",
|
|
2559
2638
|
key: rowIndex
|
|
2560
|
-
}, Array.from(Array(col)).map(
|
|
2639
|
+
}, Array.from(Array(col)).map(
|
|
2640
|
+
(_2, colIndex) => renderItem(dataSource, rowIndex, colIndex, col)
|
|
2641
|
+
));
|
|
2561
2642
|
}));
|
|
2562
2643
|
}
|
|
2563
2644
|
function renderItem(dataSource, rowIndex, colIndex, col) {
|
|
@@ -2566,7 +2647,7 @@ function renderItem(dataSource, rowIndex, colIndex, col) {
|
|
|
2566
2647
|
value,
|
|
2567
2648
|
label,
|
|
2568
2649
|
style = {}
|
|
2569
|
-
} = getDataSourceItem
|
|
2650
|
+
} = getDataSourceItem(dataSource, rowIndex, colIndex, col) || {};
|
|
2570
2651
|
return /* @__PURE__ */ React.createElement("div", {
|
|
2571
2652
|
className: `lattice-mouth-item ${color}`,
|
|
2572
2653
|
style,
|
|
@@ -2577,10 +2658,10 @@ function renderItem(dataSource, rowIndex, colIndex, col) {
|
|
|
2577
2658
|
className: "lattice-mouth-label"
|
|
2578
2659
|
}, label));
|
|
2579
2660
|
}
|
|
2580
|
-
function getDataSourceItem
|
|
2661
|
+
function getDataSourceItem(dataSource, rowIndex, colIndex, col) {
|
|
2581
2662
|
return dataSource[rowIndex * col + colIndex];
|
|
2582
2663
|
}
|
|
2583
|
-
var index$
|
|
2664
|
+
var index$5 = "";
|
|
2584
2665
|
const DARK_STYLE = {
|
|
2585
2666
|
"--base-font-size": "20px",
|
|
2586
2667
|
"--background-color": "#282828",
|
|
@@ -2659,32 +2740,37 @@ function SplitContent(props) {
|
|
|
2659
2740
|
className: "card-content"
|
|
2660
2741
|
}, content[0]);
|
|
2661
2742
|
}
|
|
2662
|
-
var index$
|
|
2663
|
-
function index$
|
|
2743
|
+
var index$4 = "";
|
|
2744
|
+
function index$3(props) {
|
|
2664
2745
|
const {
|
|
2665
|
-
|
|
2666
|
-
dataSource = [],
|
|
2746
|
+
dataSource,
|
|
2667
2747
|
value,
|
|
2668
2748
|
defaultValue,
|
|
2669
2749
|
placeholder = "\u8BF7\u9009\u62E9",
|
|
2670
|
-
useDetail = true,
|
|
2671
2750
|
onChange,
|
|
2672
2751
|
localSearch = true
|
|
2673
2752
|
} = props;
|
|
2674
2753
|
const [display, setDisplay] = React.useState(false);
|
|
2675
|
-
const [currentValue, setCurrentValue] = React.useState();
|
|
2676
2754
|
const [filter, setFilter] = React.useState("");
|
|
2755
|
+
const isControlled = value !== void 0;
|
|
2756
|
+
const [selected, setSelected] = React.useState(() => {
|
|
2757
|
+
const currentValue = isControlled ? value : defaultValue;
|
|
2758
|
+
return dataSource.find((item) => item.value === currentValue) || {};
|
|
2759
|
+
});
|
|
2677
2760
|
React.useEffect(() => {
|
|
2678
|
-
|
|
2679
|
-
|
|
2761
|
+
if (isControlled) {
|
|
2762
|
+
setSelected(dataSource.find((item) => item.value === value) || {});
|
|
2763
|
+
}
|
|
2764
|
+
}, [value]);
|
|
2765
|
+
const currentDataSource = dataSource.filter((item) => {
|
|
2766
|
+
return new RegExp(filter).test(item.label);
|
|
2767
|
+
});
|
|
2680
2768
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", {
|
|
2681
2769
|
className: "android-pda-picker",
|
|
2682
2770
|
onClick: () => setDisplay(true)
|
|
2683
2771
|
}, /* @__PURE__ */ React.createElement("span", {
|
|
2684
|
-
className: "label"
|
|
2685
|
-
}, label), /* @__PURE__ */ React.createElement("span", {
|
|
2686
2772
|
className: "text"
|
|
2687
|
-
},
|
|
2773
|
+
}, selected.label ? selected.label : placeholder), /* @__PURE__ */ React.createElement("span", {
|
|
2688
2774
|
className: "icon"
|
|
2689
2775
|
})), display ? /* @__PURE__ */ React.createElement(Overlay$1, {
|
|
2690
2776
|
verticalPosition: "bottom",
|
|
@@ -2718,30 +2804,21 @@ function index$4(props) {
|
|
|
2718
2804
|
className: "android-pda-picker-list"
|
|
2719
2805
|
}, /* @__PURE__ */ React.createElement(List$1, {
|
|
2720
2806
|
onClickItem: (item) => {
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
setCurrentValue(newItem);
|
|
2724
|
-
if (useDetail) {
|
|
2725
|
-
onChange(newItem);
|
|
2726
|
-
} else {
|
|
2727
|
-
onChange(newItem.value);
|
|
2807
|
+
if (!isControlled) {
|
|
2808
|
+
setSelected(currentDataSource[item.index]);
|
|
2728
2809
|
}
|
|
2810
|
+
setFilter("");
|
|
2811
|
+
onChange(currentDataSource[item.index]);
|
|
2729
2812
|
setDisplay(false);
|
|
2730
2813
|
},
|
|
2731
|
-
dataSource:
|
|
2814
|
+
dataSource: currentDataSource.map((item, index2) => {
|
|
2732
2815
|
return {
|
|
2733
|
-
|
|
2734
|
-
|
|
2816
|
+
index: index2,
|
|
2817
|
+
title: item.label
|
|
2735
2818
|
};
|
|
2736
2819
|
})
|
|
2737
2820
|
})))) : null);
|
|
2738
2821
|
}
|
|
2739
|
-
function filterLabel(dataSource, filter) {
|
|
2740
|
-
return dataSource.filter((item) => new RegExp(filter).test(item.label));
|
|
2741
|
-
}
|
|
2742
|
-
function getDataSourceItem(dataSource, item) {
|
|
2743
|
-
return dataSource.find((it) => it.value === item || it.value == (item == null ? void 0 : item.value));
|
|
2744
|
-
}
|
|
2745
2822
|
function SearchIcon() {
|
|
2746
2823
|
return /* @__PURE__ */ React.createElement("svg", {
|
|
2747
2824
|
className: "search-icon",
|
|
@@ -2770,7 +2847,7 @@ function SearchIcon() {
|
|
|
2770
2847
|
fillRule: "nonzero"
|
|
2771
2848
|
}))));
|
|
2772
2849
|
}
|
|
2773
|
-
function index$
|
|
2850
|
+
function index$2(props) {
|
|
2774
2851
|
const { visible, text = "LOADING..." } = props;
|
|
2775
2852
|
if (!visible) {
|
|
2776
2853
|
return null;
|
|
@@ -2790,7 +2867,7 @@ function index$3(props) {
|
|
|
2790
2867
|
"p-id": "2179"
|
|
2791
2868
|
})), /* @__PURE__ */ React.createElement("div", null, text)));
|
|
2792
2869
|
}
|
|
2793
|
-
var index$
|
|
2870
|
+
var index$1 = "";
|
|
2794
2871
|
function getRightValue(value, max, min) {
|
|
2795
2872
|
if (value !== "") {
|
|
2796
2873
|
if (typeof min === "number") {
|
|
@@ -2804,7 +2881,7 @@ function getRightValue(value, max, min) {
|
|
|
2804
2881
|
return value;
|
|
2805
2882
|
}
|
|
2806
2883
|
}
|
|
2807
|
-
function index
|
|
2884
|
+
function index(props) {
|
|
2808
2885
|
const {
|
|
2809
2886
|
label = "",
|
|
2810
2887
|
autoFocus = true,
|
|
@@ -2873,235 +2950,5 @@ function index$1(props) {
|
|
|
2873
2950
|
}
|
|
2874
2951
|
})));
|
|
2875
2952
|
}
|
|
2876
|
-
const Apply = Function.prototype.apply;
|
|
2877
|
-
const privateMap = /* @__PURE__ */ new WeakMap();
|
|
2878
|
-
function internal(obj) {
|
|
2879
|
-
if (!privateMap.has(obj)) {
|
|
2880
|
-
privateMap.set(obj, {});
|
|
2881
|
-
}
|
|
2882
|
-
return privateMap.get(obj);
|
|
2883
|
-
}
|
|
2884
|
-
class EventEmitter {
|
|
2885
|
-
constructor(maxListeners = null, localConsole = console) {
|
|
2886
|
-
const self = internal(this);
|
|
2887
|
-
self._events = /* @__PURE__ */ new Set();
|
|
2888
|
-
self._callbacks = {};
|
|
2889
|
-
self._console = localConsole;
|
|
2890
|
-
self._maxListeners = maxListeners === null ? null : parseInt(maxListeners, 10);
|
|
2891
|
-
return this;
|
|
2892
|
-
}
|
|
2893
|
-
_addCallback(eventName, callback, context, weight) {
|
|
2894
|
-
this._getCallbacks(eventName).push({
|
|
2895
|
-
callback,
|
|
2896
|
-
context,
|
|
2897
|
-
weight
|
|
2898
|
-
});
|
|
2899
|
-
this._getCallbacks(eventName).sort((a, b) => a.weight > b.weight);
|
|
2900
|
-
return this;
|
|
2901
|
-
}
|
|
2902
|
-
_getCallbacks(eventName) {
|
|
2903
|
-
return internal(this)._callbacks[eventName];
|
|
2904
|
-
}
|
|
2905
|
-
_getCallbackIndex(eventName, callback) {
|
|
2906
|
-
return this._has(eventName) ? this._getCallbacks(eventName).findIndex((element) => element.callback === callback) : null;
|
|
2907
|
-
}
|
|
2908
|
-
_achieveMaxListener(eventName) {
|
|
2909
|
-
return internal(this)._maxListeners !== null && internal(this)._maxListeners <= this.listenersNumber(eventName);
|
|
2910
|
-
}
|
|
2911
|
-
_callbackIsExists(eventName, callback, context) {
|
|
2912
|
-
const callbackInd = this._getCallbackIndex(eventName, callback);
|
|
2913
|
-
const activeCallback = callbackInd !== -1 ? this._getCallbacks(eventName)[callbackInd] : void 0;
|
|
2914
|
-
return callbackInd !== -1 && activeCallback && activeCallback.context === context;
|
|
2915
|
-
}
|
|
2916
|
-
_has(eventName) {
|
|
2917
|
-
return internal(this)._events.has(eventName);
|
|
2918
|
-
}
|
|
2919
|
-
on(eventName, callback, context = null, weight = 1) {
|
|
2920
|
-
const self = internal(this);
|
|
2921
|
-
if (typeof callback !== "function") {
|
|
2922
|
-
throw new TypeError(`${callback} is not a function`);
|
|
2923
|
-
}
|
|
2924
|
-
if (!this._has(eventName)) {
|
|
2925
|
-
self._events.add(eventName);
|
|
2926
|
-
self._callbacks[eventName] = [];
|
|
2927
|
-
} else {
|
|
2928
|
-
if (this._achieveMaxListener(eventName)) {
|
|
2929
|
-
self._console.warn(`Max listeners (${self._maxListeners}) for event "${eventName}" is reached!`);
|
|
2930
|
-
}
|
|
2931
|
-
if (this._callbackIsExists(...arguments)) {
|
|
2932
|
-
self._console.warn(`Event "${eventName}" already has the callback ${callback}.`);
|
|
2933
|
-
}
|
|
2934
|
-
}
|
|
2935
|
-
this._addCallback(...arguments);
|
|
2936
|
-
return this;
|
|
2937
|
-
}
|
|
2938
|
-
once(eventName, callback, context = null, weight = 1) {
|
|
2939
|
-
const onceCallback = (...args) => {
|
|
2940
|
-
this.off(eventName, onceCallback);
|
|
2941
|
-
return Apply.call(callback, context, args);
|
|
2942
|
-
};
|
|
2943
|
-
return this.on(eventName, onceCallback, context, weight);
|
|
2944
|
-
}
|
|
2945
|
-
off(eventName, callback = null) {
|
|
2946
|
-
const self = internal(this);
|
|
2947
|
-
let callbackInd;
|
|
2948
|
-
if (this._has(eventName)) {
|
|
2949
|
-
if (callback === null) {
|
|
2950
|
-
self._events.delete(eventName);
|
|
2951
|
-
self._callbacks[eventName] = null;
|
|
2952
|
-
} else {
|
|
2953
|
-
callbackInd = this._getCallbackIndex(eventName, callback);
|
|
2954
|
-
if (callbackInd !== -1) {
|
|
2955
|
-
self._callbacks[eventName].splice(callbackInd, 1);
|
|
2956
|
-
this.off(...arguments);
|
|
2957
|
-
}
|
|
2958
|
-
}
|
|
2959
|
-
}
|
|
2960
|
-
return this;
|
|
2961
|
-
}
|
|
2962
|
-
emit(eventName, ...args) {
|
|
2963
|
-
if (this._has(eventName)) {
|
|
2964
|
-
this._getCallbacks(eventName).forEach((element) => Apply.call(element.callback, element.context, args));
|
|
2965
|
-
}
|
|
2966
|
-
return this;
|
|
2967
|
-
}
|
|
2968
|
-
clear() {
|
|
2969
|
-
const self = internal(this);
|
|
2970
|
-
self._events.clear();
|
|
2971
|
-
self._callbacks = {};
|
|
2972
|
-
return this;
|
|
2973
|
-
}
|
|
2974
|
-
listenersNumber(eventName) {
|
|
2975
|
-
return this._has(eventName) ? this._getCallbacks(eventName).length : null;
|
|
2976
|
-
}
|
|
2977
|
-
}
|
|
2978
|
-
class JSONWatch extends EventEmitter {
|
|
2979
|
-
constructor(data) {
|
|
2980
|
-
super();
|
|
2981
|
-
this.data = data || {};
|
|
2982
|
-
}
|
|
2983
|
-
on(a, b) {
|
|
2984
|
-
if (a.indexOf(",") > -1) {
|
|
2985
|
-
a.split(",").forEach((i) => {
|
|
2986
|
-
super.on(i, b);
|
|
2987
|
-
});
|
|
2988
|
-
} else {
|
|
2989
|
-
super.on(a, b);
|
|
2990
|
-
}
|
|
2991
|
-
}
|
|
2992
|
-
off(a, b) {
|
|
2993
|
-
if (a.indexOf(",") > -1) {
|
|
2994
|
-
a.split(",").forEach((i) => {
|
|
2995
|
-
super.off(i, b);
|
|
2996
|
-
});
|
|
2997
|
-
} else {
|
|
2998
|
-
super.off(a, b);
|
|
2999
|
-
}
|
|
3000
|
-
}
|
|
3001
|
-
get(path) {
|
|
3002
|
-
return this.getVariable(path);
|
|
3003
|
-
}
|
|
3004
|
-
getVariable(path) {
|
|
3005
|
-
if (typeof path !== "string") {
|
|
3006
|
-
console.warn("Not string:", path);
|
|
3007
|
-
return "";
|
|
3008
|
-
}
|
|
3009
|
-
if (path === "$ALL") {
|
|
3010
|
-
return this.data;
|
|
3011
|
-
}
|
|
3012
|
-
if (path.indexOf(".") > -1) {
|
|
3013
|
-
path = path.split(".");
|
|
3014
|
-
let ret = this.data;
|
|
3015
|
-
for (let i = 0; i < path.length; i++) {
|
|
3016
|
-
ret = ret[path[i]];
|
|
3017
|
-
if (ret === void 0 || ret === null) {
|
|
3018
|
-
return;
|
|
3019
|
-
}
|
|
3020
|
-
}
|
|
3021
|
-
return ret;
|
|
3022
|
-
}
|
|
3023
|
-
return this.data[path];
|
|
3024
|
-
}
|
|
3025
|
-
set(path, value) {
|
|
3026
|
-
if (path.indexOf(".") > -1) {
|
|
3027
|
-
const paths = path.split(".");
|
|
3028
|
-
let ret = this.data;
|
|
3029
|
-
for (let i = 0; i < paths.length - 1; i++) {
|
|
3030
|
-
if (ret[paths[i]] === void 0) {
|
|
3031
|
-
ret = ret[paths[i]] = {};
|
|
3032
|
-
} else {
|
|
3033
|
-
ret = ret[paths[i]];
|
|
3034
|
-
}
|
|
3035
|
-
}
|
|
3036
|
-
ret[paths[paths.length - 1]] = value;
|
|
3037
|
-
} else {
|
|
3038
|
-
this.data[path] = value;
|
|
3039
|
-
}
|
|
3040
|
-
this.emit(path, value);
|
|
3041
|
-
if (value && Object.keys(value).length) {
|
|
3042
|
-
Object.keys(value).forEach((key) => {
|
|
3043
|
-
this.emit(`${path}.${key}`, value[key]);
|
|
3044
|
-
});
|
|
3045
|
-
}
|
|
3046
|
-
this.emit("$updated", [path, value]);
|
|
3047
|
-
}
|
|
3048
|
-
}
|
|
3049
|
-
__publicField(JSONWatch, "getVariableByJSON", getVariableByJSON);
|
|
3050
|
-
function getVariableByJSON(params, engine) {
|
|
3051
|
-
if (typeof params === "string") {
|
|
3052
|
-
if (/^\$.+/.test(params)) {
|
|
3053
|
-
return engine.getVariable(params);
|
|
3054
|
-
}
|
|
3055
|
-
return params;
|
|
3056
|
-
}
|
|
3057
|
-
if (Array.isArray(params)) {
|
|
3058
|
-
return params.map((i) => getVariableByJSON(i, engine));
|
|
3059
|
-
}
|
|
3060
|
-
if (Object.prototype.toString.call(params) === "[object Object]") {
|
|
3061
|
-
const newParams = {};
|
|
3062
|
-
for (const key in params) {
|
|
3063
|
-
if (Object.prototype.hasOwnProperty.call(params, key)) {
|
|
3064
|
-
newParams[key] = getVariableByJSON(params[key], engine);
|
|
3065
|
-
}
|
|
3066
|
-
}
|
|
3067
|
-
return newParams;
|
|
3068
|
-
}
|
|
3069
|
-
return params;
|
|
3070
|
-
}
|
|
3071
|
-
class Filed extends JSONWatch {
|
|
3072
|
-
constructor(defaultData, validate = {}) {
|
|
3073
|
-
super(defaultData);
|
|
3074
|
-
}
|
|
3075
|
-
getProps(key) {
|
|
3076
|
-
return {
|
|
3077
|
-
value: this.get(key),
|
|
3078
|
-
onChange: (value) => {
|
|
3079
|
-
if (value && value.target && value.preventDefault) {
|
|
3080
|
-
value = value.target.value;
|
|
3081
|
-
}
|
|
3082
|
-
this.set(key, value);
|
|
3083
|
-
}
|
|
3084
|
-
};
|
|
3085
|
-
}
|
|
3086
|
-
getValue(key) {
|
|
3087
|
-
return this.get(key);
|
|
3088
|
-
}
|
|
3089
|
-
getValues() {
|
|
3090
|
-
return this.data;
|
|
3091
|
-
}
|
|
3092
|
-
setValue(key, value) {
|
|
3093
|
-
this.set(key, value);
|
|
3094
|
-
}
|
|
3095
|
-
}
|
|
3096
|
-
function index(defaultData, validate) {
|
|
3097
|
-
const [, forceUpdate] = React.useState({});
|
|
3098
|
-
const [filed] = React.useState(() => {
|
|
3099
|
-
return new Filed(defaultData, validate);
|
|
3100
|
-
});
|
|
3101
|
-
React.useEffect(() => {
|
|
3102
|
-
filed.on("$updated", () => forceUpdate({}));
|
|
3103
|
-
});
|
|
3104
|
-
return filed;
|
|
3105
|
-
}
|
|
3106
2953
|
const ListItem = PdaListItem;
|
|
3107
|
-
export { ActionSheet, index$
|
|
2954
|
+
export { ActionSheet, index$d as AppList, BaseLayout, Button, List as Card, Confirm, PdaDistanceCard as DistanceCard, PdaFinishCard as FinishCard, index$A as Header, ImageUploader, ImageViewer, InfiniteScroll, PdaInfoCard$2 as InfoCard, index as InputItem, Keyborard, index$6 as LatticeMouth, List$1 as List, ListItem, index$2 as Loading, Overlay$1 as Overlay, PDA_IMAGE_PATH, index$r as PageFlowSystemPages, index$3 as Picker, Presentation, SelectCard, SimpleCard, SimpleCardBlock, PdaInfoCard as Steps, SubCard, Tag, PdaListItem as TaskCard, PdaTitle as Title, Toast, WakeKeyborard };
|