@cniot/android-pda-components 1.1.2-beta.6 → 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.77abdbf5.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 +253 -412
- 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
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
25
|
+
if (arg) {
|
|
26
|
+
classes = appendClass(classes, parseValue(arg));
|
|
27
|
+
}
|
|
28
|
+
}
|
|
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);
|
|
47
48
|
}
|
|
48
49
|
}
|
|
49
|
-
return classes
|
|
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",
|
|
@@ -71,8 +81,7 @@ function Overlay$1(props) {
|
|
|
71
81
|
visible = true,
|
|
72
82
|
closable = false,
|
|
73
83
|
onClosed = () => {
|
|
74
|
-
}
|
|
75
|
-
onClick
|
|
84
|
+
}
|
|
76
85
|
} = props;
|
|
77
86
|
const overlayRef = React.useRef();
|
|
78
87
|
const [hidden, setHidden] = useState(!visible);
|
|
@@ -87,13 +96,10 @@ function Overlay$1(props) {
|
|
|
87
96
|
setHidden(true);
|
|
88
97
|
onClosed();
|
|
89
98
|
}
|
|
90
|
-
if (e.target === overlayRef.current) {
|
|
91
|
-
onClick && onClick();
|
|
92
|
-
}
|
|
93
99
|
}
|
|
94
100
|
}, props.children) : null;
|
|
95
101
|
}
|
|
96
|
-
var index$
|
|
102
|
+
var index$C = "";
|
|
97
103
|
const blankFunc$6 = () => {
|
|
98
104
|
};
|
|
99
105
|
class PdaTitle extends React.Component {
|
|
@@ -146,12 +152,12 @@ class PdaTitle extends React.Component {
|
|
|
146
152
|
var _keycode_2_2_1_keycode = { exports: {} };
|
|
147
153
|
(function(module, exports) {
|
|
148
154
|
function keyCode(searchInput) {
|
|
149
|
-
if (searchInput && typeof searchInput
|
|
155
|
+
if (searchInput && "object" === typeof searchInput) {
|
|
150
156
|
var hasKeyCode = searchInput.which || searchInput.keyCode || searchInput.charCode;
|
|
151
157
|
if (hasKeyCode)
|
|
152
158
|
searchInput = hasKeyCode;
|
|
153
159
|
}
|
|
154
|
-
if (typeof searchInput
|
|
160
|
+
if ("number" === typeof searchInput)
|
|
155
161
|
return names[searchInput];
|
|
156
162
|
var search = String(searchInput);
|
|
157
163
|
var foundNamedKey = codes[search.toLowerCase()];
|
|
@@ -165,7 +171,7 @@ var _keycode_2_2_1_keycode = { exports: {} };
|
|
|
165
171
|
return void 0;
|
|
166
172
|
}
|
|
167
173
|
keyCode.isEventKey = function isEventKey(event, nameOrCode) {
|
|
168
|
-
if (event && typeof event
|
|
174
|
+
if (event && "object" === typeof event) {
|
|
169
175
|
var keyCode2 = event.which || event.keyCode || event.charCode;
|
|
170
176
|
if (keyCode2 === null || keyCode2 === void 0) {
|
|
171
177
|
return false;
|
|
@@ -272,7 +278,7 @@ var _keycode_2_2_1_keycode = { exports: {} };
|
|
|
272
278
|
}
|
|
273
279
|
})(_keycode_2_2_1_keycode, _keycode_2_2_1_keycode.exports);
|
|
274
280
|
var keycode = _keycode_2_2_1_keycode.exports;
|
|
275
|
-
var index$
|
|
281
|
+
var index$B = "";
|
|
276
282
|
function Button(props) {
|
|
277
283
|
const { type = "default", onClick, className = "", tabIndex = 1, dataClick = "" } = props;
|
|
278
284
|
let opt = {};
|
|
@@ -295,7 +301,7 @@ Button.Group = ButtonGroup;
|
|
|
295
301
|
const SPECIAL_KEY_MAP = ["fn"];
|
|
296
302
|
const empty$3 = () => {
|
|
297
303
|
};
|
|
298
|
-
function index$
|
|
304
|
+
function index$A(props) {
|
|
299
305
|
const {
|
|
300
306
|
onBack,
|
|
301
307
|
icon,
|
|
@@ -310,20 +316,32 @@ function index$B(props) {
|
|
|
310
316
|
backShortcutKey
|
|
311
317
|
} = props;
|
|
312
318
|
const [showMenus, setShowMenus] = React.useState(false);
|
|
313
|
-
React.useEffect(
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
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
|
+
);
|
|
327
345
|
React.useEffect(() => {
|
|
328
346
|
return onKeyBoradBack(function() {
|
|
329
347
|
onBack && onBack("back");
|
|
@@ -403,7 +421,7 @@ function bindShortcutKey(keys, callback) {
|
|
|
403
421
|
}
|
|
404
422
|
function onKeyBoradBack(fn) {
|
|
405
423
|
function keyPressed(data) {
|
|
406
|
-
if (data.param.originValue
|
|
424
|
+
if ("back" == data.param.originValue) {
|
|
407
425
|
fn && fn();
|
|
408
426
|
}
|
|
409
427
|
}
|
|
@@ -418,7 +436,7 @@ function addEventListener(node, eventName, fn) {
|
|
|
418
436
|
node.removeEventListener(eventName, fn);
|
|
419
437
|
};
|
|
420
438
|
}
|
|
421
|
-
var index$
|
|
439
|
+
var index$z = "";
|
|
422
440
|
class PdaInfoCard$2 extends React.Component {
|
|
423
441
|
constructor(props) {
|
|
424
442
|
super(props);
|
|
@@ -497,7 +515,7 @@ class PdaInfoCard$2 extends React.Component {
|
|
|
497
515
|
}
|
|
498
516
|
}
|
|
499
517
|
PdaInfoCard$2.IMAGE_1 = `${window.PDA_IMAGE_PATH}O1CN01qYuxip1ME9zhdL9XG_!!6000000001402-2-tps-150-150.png`;
|
|
500
|
-
var index$
|
|
518
|
+
var index$y = "";
|
|
501
519
|
class PdaListItem extends React.Component {
|
|
502
520
|
constructor(props) {
|
|
503
521
|
super(props);
|
|
@@ -543,7 +561,7 @@ class PdaListItem extends React.Component {
|
|
|
543
561
|
}));
|
|
544
562
|
}
|
|
545
563
|
}
|
|
546
|
-
var index$
|
|
564
|
+
var index$x = "";
|
|
547
565
|
function empty$2() {
|
|
548
566
|
}
|
|
549
567
|
function Confirm(props) {
|
|
@@ -588,16 +606,22 @@ function Confirm(props) {
|
|
|
588
606
|
dataClick: item.dataClick
|
|
589
607
|
}, item.label))) : null));
|
|
590
608
|
}
|
|
591
|
-
var index$
|
|
609
|
+
var index$w = "";
|
|
592
610
|
function WindVaneLog(param) {
|
|
593
611
|
const params = {
|
|
594
612
|
domain: "logger",
|
|
595
613
|
method: "deviceLog",
|
|
596
614
|
params: param
|
|
597
615
|
};
|
|
598
|
-
WindVane.call(
|
|
599
|
-
|
|
600
|
-
|
|
616
|
+
WindVane.call(
|
|
617
|
+
"WindvanePlugin",
|
|
618
|
+
"invoke",
|
|
619
|
+
JSON.stringify(params),
|
|
620
|
+
function(e) {
|
|
621
|
+
},
|
|
622
|
+
function(e) {
|
|
623
|
+
}
|
|
624
|
+
);
|
|
601
625
|
}
|
|
602
626
|
function resolveContainer(getContainer) {
|
|
603
627
|
const container = typeof getContainer === "function" ? getContainer() : getContainer;
|
|
@@ -623,7 +647,11 @@ function playSound(sound) {
|
|
|
623
647
|
method: "playSound",
|
|
624
648
|
params: { sound }
|
|
625
649
|
};
|
|
626
|
-
WindVane.call(
|
|
650
|
+
WindVane.call(
|
|
651
|
+
"WindvanePlugin",
|
|
652
|
+
"invoke",
|
|
653
|
+
JSON.stringify(params)
|
|
654
|
+
);
|
|
627
655
|
}
|
|
628
656
|
}
|
|
629
657
|
function getTypeClass$1(type) {
|
|
@@ -712,7 +740,10 @@ const defaultProps = {
|
|
|
712
740
|
duration: 2e3
|
|
713
741
|
};
|
|
714
742
|
function show(p) {
|
|
715
|
-
const props = mergeProps(
|
|
743
|
+
const props = mergeProps(
|
|
744
|
+
defaultProps,
|
|
745
|
+
p
|
|
746
|
+
);
|
|
716
747
|
let timer = 0;
|
|
717
748
|
const { getContainer = () => document.body } = props;
|
|
718
749
|
const container = document.createElement("div");
|
|
@@ -844,7 +875,7 @@ function confirm(props) {
|
|
|
844
875
|
onClick: onNext
|
|
845
876
|
}));
|
|
846
877
|
}
|
|
847
|
-
var index$
|
|
878
|
+
var index$v = "";
|
|
848
879
|
function getTypeClass(type) {
|
|
849
880
|
return {
|
|
850
881
|
center: "op-overlay center",
|
|
@@ -858,8 +889,7 @@ function Overlay(props) {
|
|
|
858
889
|
visible = true,
|
|
859
890
|
closable = false,
|
|
860
891
|
onClosed = () => {
|
|
861
|
-
}
|
|
862
|
-
onClick
|
|
892
|
+
}
|
|
863
893
|
} = props;
|
|
864
894
|
const overlayRef = React.useRef();
|
|
865
895
|
const [hidden, setHidden] = useState(!visible);
|
|
@@ -874,13 +904,10 @@ function Overlay(props) {
|
|
|
874
904
|
setHidden(true);
|
|
875
905
|
onClosed();
|
|
876
906
|
}
|
|
877
|
-
if (e.target === overlayRef.current) {
|
|
878
|
-
onClick && onClick();
|
|
879
|
-
}
|
|
880
907
|
}
|
|
881
908
|
}, props.children) : null;
|
|
882
909
|
}
|
|
883
|
-
var index$
|
|
910
|
+
var index$u = "";
|
|
884
911
|
function Prompt(props) {
|
|
885
912
|
const inputRef = React.useRef();
|
|
886
913
|
const { data = {}, onNext } = props;
|
|
@@ -940,23 +967,24 @@ function toast(props) {
|
|
|
940
967
|
React.useEffect(() => {
|
|
941
968
|
setHidden(false);
|
|
942
969
|
}, [action.sequence]);
|
|
943
|
-
return /* @__PURE__ */ React.createElement(Overlay$1, {
|
|
944
|
-
verticalPosition: "bottom"
|
|
945
|
-
visible: !hidden,
|
|
946
|
-
onClick: () => setHidden(true)
|
|
970
|
+
return !hidden ? /* @__PURE__ */ React.createElement(Overlay$1, {
|
|
971
|
+
verticalPosition: "bottom"
|
|
947
972
|
}, /* @__PURE__ */ React.createElement("div", {
|
|
948
973
|
style: { width: "90%" }
|
|
949
974
|
}, /* @__PURE__ */ React.createElement(Toast, {
|
|
950
975
|
type: level,
|
|
951
976
|
title,
|
|
952
|
-
message: splitMessage(message)
|
|
953
|
-
|
|
977
|
+
message: splitMessage(message),
|
|
978
|
+
onClick: () => {
|
|
979
|
+
setHidden(true);
|
|
980
|
+
}
|
|
981
|
+
}))) : null;
|
|
954
982
|
}
|
|
955
983
|
function splitMessage(message) {
|
|
956
984
|
var msg = String(message).split("by Error:");
|
|
957
985
|
return msg[1] || msg[0];
|
|
958
986
|
}
|
|
959
|
-
var index$
|
|
987
|
+
var index$t = "";
|
|
960
988
|
function NotFound(props) {
|
|
961
989
|
return /* @__PURE__ */ React.createElement("div", {
|
|
962
990
|
style: { padding: "20%" }
|
|
@@ -964,36 +992,39 @@ function NotFound(props) {
|
|
|
964
992
|
style: { fontSize: "60%" }
|
|
965
993
|
}, "Not found")), /* @__PURE__ */ React.createElement("div", null, props.action.getPage()));
|
|
966
994
|
}
|
|
967
|
-
var index$
|
|
995
|
+
var index$s = "";
|
|
968
996
|
function Loading$1(props) {
|
|
969
997
|
const [showLoading, setShowLoading] = React.useState(props.visible);
|
|
970
998
|
const edgeService = props.edgeService;
|
|
971
|
-
React.useEffect(
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
if (!edgeService)
|
|
990
|
-
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
|
+
}
|
|
991
1017
|
};
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
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
|
+
);
|
|
997
1028
|
return showLoading ? /* @__PURE__ */ React.createElement("div", {
|
|
998
1029
|
className: "loading-wrap"
|
|
999
1030
|
}, /* @__PURE__ */ React.createElement("div", {
|
|
@@ -1017,7 +1048,11 @@ function PlaySound({ data, service, action }) {
|
|
|
1017
1048
|
method: "playSound",
|
|
1018
1049
|
params: { sound }
|
|
1019
1050
|
};
|
|
1020
|
-
WindVane.call(
|
|
1051
|
+
WindVane.call(
|
|
1052
|
+
"WindvanePlugin",
|
|
1053
|
+
"invoke",
|
|
1054
|
+
JSON.stringify(params)
|
|
1055
|
+
);
|
|
1021
1056
|
}
|
|
1022
1057
|
service.onNext({});
|
|
1023
1058
|
return null;
|
|
@@ -1026,7 +1061,7 @@ function Debug() {
|
|
|
1026
1061
|
console.warn('Please stop using "Debug" Components');
|
|
1027
1062
|
return null;
|
|
1028
1063
|
}
|
|
1029
|
-
var index$
|
|
1064
|
+
var index$r = {
|
|
1030
1065
|
Alert,
|
|
1031
1066
|
Start,
|
|
1032
1067
|
Toast: toast,
|
|
@@ -1037,7 +1072,7 @@ var index$s = {
|
|
|
1037
1072
|
Loading: Loading$1,
|
|
1038
1073
|
PlaySound
|
|
1039
1074
|
};
|
|
1040
|
-
var index$
|
|
1075
|
+
var index$q = "";
|
|
1041
1076
|
function Presentation(props) {
|
|
1042
1077
|
const {
|
|
1043
1078
|
image = Presentation.IMAGE_1,
|
|
@@ -1059,7 +1094,7 @@ Presentation.IMAGE_1 = `${window.PDA_IMAGE_PATH}O1CN019Ivkor1ksy3pMGDsz_!!600000
|
|
|
1059
1094
|
Presentation.IMAGE_2 = `${window.PDA_IMAGE_PATH}O1CN01lhSunu1X4VPw1Mlas_!!6000000002870-2-tps-352-158.png`;
|
|
1060
1095
|
Presentation.IMAGE_3 = `${window.PDA_IMAGE_PATH}O1CN01mreYXo1XfbUsQ7hip_!!6000000002951-2-tps-322-144.png`;
|
|
1061
1096
|
Presentation.IMAGE_4 = `${window.PDA_IMAGE_PATH}O1CN017gNM8F1Fmmcfti7Dg_!!6000000000530-1-tps-414-286.gif`;
|
|
1062
|
-
var index$
|
|
1097
|
+
var index$p = "";
|
|
1063
1098
|
function empty$1() {
|
|
1064
1099
|
}
|
|
1065
1100
|
function List$1(props) {
|
|
@@ -1114,7 +1149,7 @@ function DefaultItem(props) {
|
|
|
1114
1149
|
}, extra));
|
|
1115
1150
|
}
|
|
1116
1151
|
List$1.Item = DefaultItem;
|
|
1117
|
-
var index$
|
|
1152
|
+
var index$o = "";
|
|
1118
1153
|
const blankFunc$5 = () => {
|
|
1119
1154
|
};
|
|
1120
1155
|
class BaseLayoutContainer extends React.Component {
|
|
@@ -1424,9 +1459,15 @@ class BarcodeScan extends React.Component {
|
|
|
1424
1459
|
document.addEventListener("keyup", this._handleKeyUp);
|
|
1425
1460
|
}
|
|
1426
1461
|
document.addEventListener("BarcodeScan", this.onScanBarcode);
|
|
1427
|
-
WindVane.call(
|
|
1428
|
-
|
|
1429
|
-
|
|
1462
|
+
WindVane.call(
|
|
1463
|
+
"WindvanePlugin",
|
|
1464
|
+
"invoke",
|
|
1465
|
+
"{'domain': 'keyboard', 'method': 'changeScanMode', 'params': {'scanMode': 'barcode'}}",
|
|
1466
|
+
function(e) {
|
|
1467
|
+
},
|
|
1468
|
+
function(e) {
|
|
1469
|
+
}
|
|
1470
|
+
);
|
|
1430
1471
|
}
|
|
1431
1472
|
componentWillUnmount() {
|
|
1432
1473
|
const { onBarcodeScan } = this.props;
|
|
@@ -1480,7 +1521,7 @@ class BaseLayout extends React.Component {
|
|
|
1480
1521
|
});
|
|
1481
1522
|
}
|
|
1482
1523
|
}
|
|
1483
|
-
var index$
|
|
1524
|
+
var index$n = "";
|
|
1484
1525
|
const blankFunc$1 = () => {
|
|
1485
1526
|
};
|
|
1486
1527
|
function Keyborard(props) {
|
|
@@ -1628,7 +1669,7 @@ class UploadeButton extends Component {
|
|
|
1628
1669
|
}))));
|
|
1629
1670
|
}
|
|
1630
1671
|
}
|
|
1631
|
-
var index$
|
|
1672
|
+
var index$m = "";
|
|
1632
1673
|
const classPrefix$1 = "image-viewer";
|
|
1633
1674
|
class ImageViewer extends Component {
|
|
1634
1675
|
constructor(props) {
|
|
@@ -1825,24 +1866,56 @@ class ImageUploader extends Component {
|
|
|
1825
1866
|
};
|
|
1826
1867
|
});
|
|
1827
1868
|
__publicField(this, "handlerUpload", (params) => {
|
|
1828
|
-
const { beforeUpload, onBeforeUpload } = this.props;
|
|
1829
|
-
window.WindVane.call("
|
|
1830
|
-
|
|
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 = {
|
|
1831
1882
|
domain: "camera",
|
|
1832
|
-
method: "
|
|
1833
|
-
params: {
|
|
1834
|
-
filePath: e.localPath
|
|
1835
|
-
}
|
|
1883
|
+
method: "takePhoto",
|
|
1884
|
+
params: { compressSize }
|
|
1836
1885
|
};
|
|
1837
|
-
window.WindVane.call(
|
|
1838
|
-
|
|
1839
|
-
|
|
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
|
+
});
|
|
1840
1915
|
}, function(err) {
|
|
1841
|
-
console.log("failure " + JSON.stringify(err));
|
|
1916
|
+
console.log("takePhoto failure: " + JSON.stringify(err));
|
|
1842
1917
|
});
|
|
1843
|
-
}
|
|
1844
|
-
console.log("takePhoto failure: " + JSON.stringify(err));
|
|
1845
|
-
});
|
|
1918
|
+
}
|
|
1846
1919
|
});
|
|
1847
1920
|
__publicField(this, "onDelete", (item, index2) => {
|
|
1848
1921
|
const { onDelete } = this.props;
|
|
@@ -1924,9 +1997,9 @@ class ImageUploader extends Component {
|
|
|
1924
1997
|
}));
|
|
1925
1998
|
}
|
|
1926
1999
|
}
|
|
1927
|
-
var index$
|
|
1928
|
-
var index$
|
|
1929
|
-
var index$
|
|
2000
|
+
var index$l = "";
|
|
2001
|
+
var index$k = "";
|
|
2002
|
+
var index$j = "";
|
|
1930
2003
|
class PdaInfoCard$1 extends React.Component {
|
|
1931
2004
|
constructor(props) {
|
|
1932
2005
|
super(props);
|
|
@@ -1981,7 +2054,7 @@ class PdaInfoCard extends React.Component {
|
|
|
1981
2054
|
}
|
|
1982
2055
|
}
|
|
1983
2056
|
__publicField(PdaInfoCard, "Step", PdaInfoCard$1);
|
|
1984
|
-
var index$
|
|
2057
|
+
var index$i = "";
|
|
1985
2058
|
class PdaFinishCard extends React.Component {
|
|
1986
2059
|
constructor(props) {
|
|
1987
2060
|
super(props);
|
|
@@ -2035,7 +2108,7 @@ class PdaFinishCard extends React.Component {
|
|
|
2035
2108
|
}
|
|
2036
2109
|
PdaFinishCard.SUCCESS = `${window.PDA_IMAGE_PATH}O1CN01OL2UYg24792knbTtC_!!6000000007343-1-tps-506-415.gif`;
|
|
2037
2110
|
PdaFinishCard.ERROR_SUCCESS = `${window.PDA_IMAGE_PATH}O1CN01p5Oc5t1VMFWtBomQc_!!6000000002638-1-tps-600-456.gif`;
|
|
2038
|
-
var index$
|
|
2111
|
+
var index$h = "";
|
|
2039
2112
|
class PdaDistanceCard extends React.Component {
|
|
2040
2113
|
constructor(props) {
|
|
2041
2114
|
super(props);
|
|
@@ -2076,7 +2149,7 @@ class PdaDistanceCard extends React.Component {
|
|
|
2076
2149
|
}, /* @__PURE__ */ React.createElement("p", null, "\u8FDC"), /* @__PURE__ */ React.createElement("p", null, "\u8FD1")));
|
|
2077
2150
|
}
|
|
2078
2151
|
}
|
|
2079
|
-
var index$
|
|
2152
|
+
var index$g = "";
|
|
2080
2153
|
function SubCard(props) {
|
|
2081
2154
|
const { title, context, name, tag, attrs = [], style } = props;
|
|
2082
2155
|
return /* @__PURE__ */ React.createElement("div", {
|
|
@@ -2102,7 +2175,7 @@ function SubCard(props) {
|
|
|
2102
2175
|
}, text);
|
|
2103
2176
|
})));
|
|
2104
2177
|
}
|
|
2105
|
-
var index$
|
|
2178
|
+
var index$f = "";
|
|
2106
2179
|
function SelectCard(props) {
|
|
2107
2180
|
const { title, label, select = true, onClick = (e) => {
|
|
2108
2181
|
} } = props;
|
|
@@ -2115,10 +2188,10 @@ function SelectCard(props) {
|
|
|
2115
2188
|
className: "select-icon"
|
|
2116
2189
|
}) : null, " "));
|
|
2117
2190
|
}
|
|
2118
|
-
var index$
|
|
2191
|
+
var index$e = "";
|
|
2119
2192
|
function empty() {
|
|
2120
2193
|
}
|
|
2121
|
-
function index$
|
|
2194
|
+
function index$d(props) {
|
|
2122
2195
|
const { dataSource = [], onClickItem = empty } = props;
|
|
2123
2196
|
let tabIndex = 1;
|
|
2124
2197
|
return /* @__PURE__ */ React.createElement("div", {
|
|
@@ -2146,7 +2219,7 @@ function index$e(props) {
|
|
|
2146
2219
|
})));
|
|
2147
2220
|
}));
|
|
2148
2221
|
}
|
|
2149
|
-
var index$
|
|
2222
|
+
var index$c = "";
|
|
2150
2223
|
function usePersistFn(fn) {
|
|
2151
2224
|
var fnRef = useRef(fn);
|
|
2152
2225
|
fnRef.current = fn;
|
|
@@ -2464,7 +2537,7 @@ function InfiniteScroll(props) {
|
|
|
2464
2537
|
className: "pda-infinite-scroll-view"
|
|
2465
2538
|
}, /* @__PURE__ */ React.createElement("span", null, "\u6CA1\u6709\u66F4\u591A\u4E86~")));
|
|
2466
2539
|
}
|
|
2467
|
-
var index$
|
|
2540
|
+
var index$b = "";
|
|
2468
2541
|
function ActionSheet(props) {
|
|
2469
2542
|
const {
|
|
2470
2543
|
className = "",
|
|
@@ -2512,14 +2585,14 @@ function ActionSheet(props) {
|
|
|
2512
2585
|
}, item.title);
|
|
2513
2586
|
})) : null));
|
|
2514
2587
|
}
|
|
2515
|
-
var index$
|
|
2588
|
+
var index$a = "";
|
|
2516
2589
|
function Tag(props) {
|
|
2517
2590
|
const { className = void 0, label = "label", type = "success" } = props;
|
|
2518
2591
|
return /* @__PURE__ */ React.createElement("div", {
|
|
2519
2592
|
className: classNames({ [className]: true, "pda-tag": true, ["pda-tag-" + type]: true })
|
|
2520
2593
|
}, label);
|
|
2521
2594
|
}
|
|
2522
|
-
var index$
|
|
2595
|
+
var index$9 = "";
|
|
2523
2596
|
function SimpleCard(props) {
|
|
2524
2597
|
const { className = "", title = "", content = "", type = "default", onClick = () => {
|
|
2525
2598
|
} } = props;
|
|
@@ -2532,7 +2605,7 @@ function SimpleCard(props) {
|
|
|
2532
2605
|
className: "simple-card-content"
|
|
2533
2606
|
}, content)) : null;
|
|
2534
2607
|
}
|
|
2535
|
-
var index$
|
|
2608
|
+
var index$8 = "";
|
|
2536
2609
|
function SimpleCardBlock(props) {
|
|
2537
2610
|
const { className = void 0, dataSource = [], title = "", tag } = props;
|
|
2538
2611
|
return /* @__PURE__ */ React.createElement("div", {
|
|
@@ -2554,8 +2627,8 @@ function SimpleCardBlock(props) {
|
|
|
2554
2627
|
});
|
|
2555
2628
|
})) : null);
|
|
2556
2629
|
}
|
|
2557
|
-
var index$
|
|
2558
|
-
function index$
|
|
2630
|
+
var index$7 = "";
|
|
2631
|
+
function index$6(props) {
|
|
2559
2632
|
const { row = 3, col = 3, dataSource = [] } = props;
|
|
2560
2633
|
return /* @__PURE__ */ React.createElement("div", {
|
|
2561
2634
|
className: "lattice-mouth"
|
|
@@ -2563,7 +2636,9 @@ function index$7(props) {
|
|
|
2563
2636
|
return /* @__PURE__ */ React.createElement("div", {
|
|
2564
2637
|
className: "lattice-mouth-row",
|
|
2565
2638
|
key: rowIndex
|
|
2566
|
-
}, Array.from(Array(col)).map(
|
|
2639
|
+
}, Array.from(Array(col)).map(
|
|
2640
|
+
(_2, colIndex) => renderItem(dataSource, rowIndex, colIndex, col)
|
|
2641
|
+
));
|
|
2567
2642
|
}));
|
|
2568
2643
|
}
|
|
2569
2644
|
function renderItem(dataSource, rowIndex, colIndex, col) {
|
|
@@ -2572,7 +2647,7 @@ function renderItem(dataSource, rowIndex, colIndex, col) {
|
|
|
2572
2647
|
value,
|
|
2573
2648
|
label,
|
|
2574
2649
|
style = {}
|
|
2575
|
-
} = getDataSourceItem
|
|
2650
|
+
} = getDataSourceItem(dataSource, rowIndex, colIndex, col) || {};
|
|
2576
2651
|
return /* @__PURE__ */ React.createElement("div", {
|
|
2577
2652
|
className: `lattice-mouth-item ${color}`,
|
|
2578
2653
|
style,
|
|
@@ -2583,10 +2658,10 @@ function renderItem(dataSource, rowIndex, colIndex, col) {
|
|
|
2583
2658
|
className: "lattice-mouth-label"
|
|
2584
2659
|
}, label));
|
|
2585
2660
|
}
|
|
2586
|
-
function getDataSourceItem
|
|
2661
|
+
function getDataSourceItem(dataSource, rowIndex, colIndex, col) {
|
|
2587
2662
|
return dataSource[rowIndex * col + colIndex];
|
|
2588
2663
|
}
|
|
2589
|
-
var index$
|
|
2664
|
+
var index$5 = "";
|
|
2590
2665
|
const DARK_STYLE = {
|
|
2591
2666
|
"--base-font-size": "20px",
|
|
2592
2667
|
"--background-color": "#282828",
|
|
@@ -2665,32 +2740,37 @@ function SplitContent(props) {
|
|
|
2665
2740
|
className: "card-content"
|
|
2666
2741
|
}, content[0]);
|
|
2667
2742
|
}
|
|
2668
|
-
var index$
|
|
2669
|
-
function index$
|
|
2743
|
+
var index$4 = "";
|
|
2744
|
+
function index$3(props) {
|
|
2670
2745
|
const {
|
|
2671
|
-
|
|
2672
|
-
dataSource = [],
|
|
2746
|
+
dataSource,
|
|
2673
2747
|
value,
|
|
2674
2748
|
defaultValue,
|
|
2675
2749
|
placeholder = "\u8BF7\u9009\u62E9",
|
|
2676
|
-
useDetail = true,
|
|
2677
2750
|
onChange,
|
|
2678
2751
|
localSearch = true
|
|
2679
2752
|
} = props;
|
|
2680
2753
|
const [display, setDisplay] = React.useState(false);
|
|
2681
|
-
const [currentValue, setCurrentValue] = React.useState();
|
|
2682
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
|
+
});
|
|
2683
2760
|
React.useEffect(() => {
|
|
2684
|
-
|
|
2685
|
-
|
|
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
|
+
});
|
|
2686
2768
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", {
|
|
2687
2769
|
className: "android-pda-picker",
|
|
2688
2770
|
onClick: () => setDisplay(true)
|
|
2689
2771
|
}, /* @__PURE__ */ React.createElement("span", {
|
|
2690
|
-
className: "label"
|
|
2691
|
-
}, label), /* @__PURE__ */ React.createElement("span", {
|
|
2692
2772
|
className: "text"
|
|
2693
|
-
},
|
|
2773
|
+
}, selected.label ? selected.label : placeholder), /* @__PURE__ */ React.createElement("span", {
|
|
2694
2774
|
className: "icon"
|
|
2695
2775
|
})), display ? /* @__PURE__ */ React.createElement(Overlay$1, {
|
|
2696
2776
|
verticalPosition: "bottom",
|
|
@@ -2724,30 +2804,21 @@ function index$4(props) {
|
|
|
2724
2804
|
className: "android-pda-picker-list"
|
|
2725
2805
|
}, /* @__PURE__ */ React.createElement(List$1, {
|
|
2726
2806
|
onClickItem: (item) => {
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
setCurrentValue(newItem);
|
|
2730
|
-
if (useDetail) {
|
|
2731
|
-
onChange(newItem);
|
|
2732
|
-
} else {
|
|
2733
|
-
onChange(newItem.value);
|
|
2807
|
+
if (!isControlled) {
|
|
2808
|
+
setSelected(currentDataSource[item.index]);
|
|
2734
2809
|
}
|
|
2810
|
+
setFilter("");
|
|
2811
|
+
onChange(currentDataSource[item.index]);
|
|
2735
2812
|
setDisplay(false);
|
|
2736
2813
|
},
|
|
2737
|
-
dataSource:
|
|
2814
|
+
dataSource: currentDataSource.map((item, index2) => {
|
|
2738
2815
|
return {
|
|
2739
|
-
|
|
2740
|
-
|
|
2816
|
+
index: index2,
|
|
2817
|
+
title: item.label
|
|
2741
2818
|
};
|
|
2742
2819
|
})
|
|
2743
2820
|
})))) : null);
|
|
2744
2821
|
}
|
|
2745
|
-
function filterLabel(dataSource, filter) {
|
|
2746
|
-
return dataSource.filter((item) => new RegExp(filter).test(item.label));
|
|
2747
|
-
}
|
|
2748
|
-
function getDataSourceItem(dataSource, item) {
|
|
2749
|
-
return dataSource.find((it) => it.value === item || it.value == (item == null ? void 0 : item.value));
|
|
2750
|
-
}
|
|
2751
2822
|
function SearchIcon() {
|
|
2752
2823
|
return /* @__PURE__ */ React.createElement("svg", {
|
|
2753
2824
|
className: "search-icon",
|
|
@@ -2776,7 +2847,7 @@ function SearchIcon() {
|
|
|
2776
2847
|
fillRule: "nonzero"
|
|
2777
2848
|
}))));
|
|
2778
2849
|
}
|
|
2779
|
-
function index$
|
|
2850
|
+
function index$2(props) {
|
|
2780
2851
|
const { visible, text = "LOADING..." } = props;
|
|
2781
2852
|
if (!visible) {
|
|
2782
2853
|
return null;
|
|
@@ -2796,7 +2867,7 @@ function index$3(props) {
|
|
|
2796
2867
|
"p-id": "2179"
|
|
2797
2868
|
})), /* @__PURE__ */ React.createElement("div", null, text)));
|
|
2798
2869
|
}
|
|
2799
|
-
var index$
|
|
2870
|
+
var index$1 = "";
|
|
2800
2871
|
function getRightValue(value, max, min) {
|
|
2801
2872
|
if (value !== "") {
|
|
2802
2873
|
if (typeof min === "number") {
|
|
@@ -2810,7 +2881,7 @@ function getRightValue(value, max, min) {
|
|
|
2810
2881
|
return value;
|
|
2811
2882
|
}
|
|
2812
2883
|
}
|
|
2813
|
-
function index
|
|
2884
|
+
function index(props) {
|
|
2814
2885
|
const {
|
|
2815
2886
|
label = "",
|
|
2816
2887
|
autoFocus = true,
|
|
@@ -2879,235 +2950,5 @@ function index$1(props) {
|
|
|
2879
2950
|
}
|
|
2880
2951
|
})));
|
|
2881
2952
|
}
|
|
2882
|
-
const Apply = Function.prototype.apply;
|
|
2883
|
-
const privateMap = /* @__PURE__ */ new WeakMap();
|
|
2884
|
-
function internal(obj) {
|
|
2885
|
-
if (!privateMap.has(obj)) {
|
|
2886
|
-
privateMap.set(obj, {});
|
|
2887
|
-
}
|
|
2888
|
-
return privateMap.get(obj);
|
|
2889
|
-
}
|
|
2890
|
-
class EventEmitter {
|
|
2891
|
-
constructor(maxListeners = null, localConsole = console) {
|
|
2892
|
-
const self = internal(this);
|
|
2893
|
-
self._events = /* @__PURE__ */ new Set();
|
|
2894
|
-
self._callbacks = {};
|
|
2895
|
-
self._console = localConsole;
|
|
2896
|
-
self._maxListeners = maxListeners === null ? null : parseInt(maxListeners, 10);
|
|
2897
|
-
return this;
|
|
2898
|
-
}
|
|
2899
|
-
_addCallback(eventName, callback, context, weight) {
|
|
2900
|
-
this._getCallbacks(eventName).push({
|
|
2901
|
-
callback,
|
|
2902
|
-
context,
|
|
2903
|
-
weight
|
|
2904
|
-
});
|
|
2905
|
-
this._getCallbacks(eventName).sort((a, b) => a.weight > b.weight);
|
|
2906
|
-
return this;
|
|
2907
|
-
}
|
|
2908
|
-
_getCallbacks(eventName) {
|
|
2909
|
-
return internal(this)._callbacks[eventName];
|
|
2910
|
-
}
|
|
2911
|
-
_getCallbackIndex(eventName, callback) {
|
|
2912
|
-
return this._has(eventName) ? this._getCallbacks(eventName).findIndex((element) => element.callback === callback) : null;
|
|
2913
|
-
}
|
|
2914
|
-
_achieveMaxListener(eventName) {
|
|
2915
|
-
return internal(this)._maxListeners !== null && internal(this)._maxListeners <= this.listenersNumber(eventName);
|
|
2916
|
-
}
|
|
2917
|
-
_callbackIsExists(eventName, callback, context) {
|
|
2918
|
-
const callbackInd = this._getCallbackIndex(eventName, callback);
|
|
2919
|
-
const activeCallback = callbackInd !== -1 ? this._getCallbacks(eventName)[callbackInd] : void 0;
|
|
2920
|
-
return callbackInd !== -1 && activeCallback && activeCallback.context === context;
|
|
2921
|
-
}
|
|
2922
|
-
_has(eventName) {
|
|
2923
|
-
return internal(this)._events.has(eventName);
|
|
2924
|
-
}
|
|
2925
|
-
on(eventName, callback, context = null, weight = 1) {
|
|
2926
|
-
const self = internal(this);
|
|
2927
|
-
if (typeof callback !== "function") {
|
|
2928
|
-
throw new TypeError(`${callback} is not a function`);
|
|
2929
|
-
}
|
|
2930
|
-
if (!this._has(eventName)) {
|
|
2931
|
-
self._events.add(eventName);
|
|
2932
|
-
self._callbacks[eventName] = [];
|
|
2933
|
-
} else {
|
|
2934
|
-
if (this._achieveMaxListener(eventName)) {
|
|
2935
|
-
self._console.warn(`Max listeners (${self._maxListeners}) for event "${eventName}" is reached!`);
|
|
2936
|
-
}
|
|
2937
|
-
if (this._callbackIsExists(...arguments)) {
|
|
2938
|
-
self._console.warn(`Event "${eventName}" already has the callback ${callback}.`);
|
|
2939
|
-
}
|
|
2940
|
-
}
|
|
2941
|
-
this._addCallback(...arguments);
|
|
2942
|
-
return this;
|
|
2943
|
-
}
|
|
2944
|
-
once(eventName, callback, context = null, weight = 1) {
|
|
2945
|
-
const onceCallback = (...args) => {
|
|
2946
|
-
this.off(eventName, onceCallback);
|
|
2947
|
-
return Apply.call(callback, context, args);
|
|
2948
|
-
};
|
|
2949
|
-
return this.on(eventName, onceCallback, context, weight);
|
|
2950
|
-
}
|
|
2951
|
-
off(eventName, callback = null) {
|
|
2952
|
-
const self = internal(this);
|
|
2953
|
-
let callbackInd;
|
|
2954
|
-
if (this._has(eventName)) {
|
|
2955
|
-
if (callback === null) {
|
|
2956
|
-
self._events.delete(eventName);
|
|
2957
|
-
self._callbacks[eventName] = null;
|
|
2958
|
-
} else {
|
|
2959
|
-
callbackInd = this._getCallbackIndex(eventName, callback);
|
|
2960
|
-
if (callbackInd !== -1) {
|
|
2961
|
-
self._callbacks[eventName].splice(callbackInd, 1);
|
|
2962
|
-
this.off(...arguments);
|
|
2963
|
-
}
|
|
2964
|
-
}
|
|
2965
|
-
}
|
|
2966
|
-
return this;
|
|
2967
|
-
}
|
|
2968
|
-
emit(eventName, ...args) {
|
|
2969
|
-
if (this._has(eventName)) {
|
|
2970
|
-
this._getCallbacks(eventName).forEach((element) => Apply.call(element.callback, element.context, args));
|
|
2971
|
-
}
|
|
2972
|
-
return this;
|
|
2973
|
-
}
|
|
2974
|
-
clear() {
|
|
2975
|
-
const self = internal(this);
|
|
2976
|
-
self._events.clear();
|
|
2977
|
-
self._callbacks = {};
|
|
2978
|
-
return this;
|
|
2979
|
-
}
|
|
2980
|
-
listenersNumber(eventName) {
|
|
2981
|
-
return this._has(eventName) ? this._getCallbacks(eventName).length : null;
|
|
2982
|
-
}
|
|
2983
|
-
}
|
|
2984
|
-
class JSONWatch extends EventEmitter {
|
|
2985
|
-
constructor(data) {
|
|
2986
|
-
super();
|
|
2987
|
-
this.data = data || {};
|
|
2988
|
-
}
|
|
2989
|
-
on(a, b) {
|
|
2990
|
-
if (a.indexOf(",") > -1) {
|
|
2991
|
-
a.split(",").forEach((i) => {
|
|
2992
|
-
super.on(i, b);
|
|
2993
|
-
});
|
|
2994
|
-
} else {
|
|
2995
|
-
super.on(a, b);
|
|
2996
|
-
}
|
|
2997
|
-
}
|
|
2998
|
-
off(a, b) {
|
|
2999
|
-
if (a.indexOf(",") > -1) {
|
|
3000
|
-
a.split(",").forEach((i) => {
|
|
3001
|
-
super.off(i, b);
|
|
3002
|
-
});
|
|
3003
|
-
} else {
|
|
3004
|
-
super.off(a, b);
|
|
3005
|
-
}
|
|
3006
|
-
}
|
|
3007
|
-
get(path) {
|
|
3008
|
-
return this.getVariable(path);
|
|
3009
|
-
}
|
|
3010
|
-
getVariable(path) {
|
|
3011
|
-
if (typeof path !== "string") {
|
|
3012
|
-
console.warn("Not string:", path);
|
|
3013
|
-
return "";
|
|
3014
|
-
}
|
|
3015
|
-
if (path === "$ALL") {
|
|
3016
|
-
return this.data;
|
|
3017
|
-
}
|
|
3018
|
-
if (path.indexOf(".") > -1) {
|
|
3019
|
-
path = path.split(".");
|
|
3020
|
-
let ret = this.data;
|
|
3021
|
-
for (let i = 0; i < path.length; i++) {
|
|
3022
|
-
ret = ret[path[i]];
|
|
3023
|
-
if (ret === void 0 || ret === null) {
|
|
3024
|
-
return;
|
|
3025
|
-
}
|
|
3026
|
-
}
|
|
3027
|
-
return ret;
|
|
3028
|
-
}
|
|
3029
|
-
return this.data[path];
|
|
3030
|
-
}
|
|
3031
|
-
set(path, value) {
|
|
3032
|
-
if (path.indexOf(".") > -1) {
|
|
3033
|
-
const paths = path.split(".");
|
|
3034
|
-
let ret = this.data;
|
|
3035
|
-
for (let i = 0; i < paths.length - 1; i++) {
|
|
3036
|
-
if (ret[paths[i]] === void 0) {
|
|
3037
|
-
ret = ret[paths[i]] = {};
|
|
3038
|
-
} else {
|
|
3039
|
-
ret = ret[paths[i]];
|
|
3040
|
-
}
|
|
3041
|
-
}
|
|
3042
|
-
ret[paths[paths.length - 1]] = value;
|
|
3043
|
-
} else {
|
|
3044
|
-
this.data[path] = value;
|
|
3045
|
-
}
|
|
3046
|
-
this.emit(path, value);
|
|
3047
|
-
if (value && Object.keys(value).length) {
|
|
3048
|
-
Object.keys(value).forEach((key) => {
|
|
3049
|
-
this.emit(`${path}.${key}`, value[key]);
|
|
3050
|
-
});
|
|
3051
|
-
}
|
|
3052
|
-
this.emit("$updated", [path, value]);
|
|
3053
|
-
}
|
|
3054
|
-
}
|
|
3055
|
-
__publicField(JSONWatch, "getVariableByJSON", getVariableByJSON);
|
|
3056
|
-
function getVariableByJSON(params, engine) {
|
|
3057
|
-
if (typeof params === "string") {
|
|
3058
|
-
if (/^\$.+/.test(params)) {
|
|
3059
|
-
return engine.getVariable(params);
|
|
3060
|
-
}
|
|
3061
|
-
return params;
|
|
3062
|
-
}
|
|
3063
|
-
if (Array.isArray(params)) {
|
|
3064
|
-
return params.map((i) => getVariableByJSON(i, engine));
|
|
3065
|
-
}
|
|
3066
|
-
if (Object.prototype.toString.call(params) === "[object Object]") {
|
|
3067
|
-
const newParams = {};
|
|
3068
|
-
for (const key in params) {
|
|
3069
|
-
if (Object.prototype.hasOwnProperty.call(params, key)) {
|
|
3070
|
-
newParams[key] = getVariableByJSON(params[key], engine);
|
|
3071
|
-
}
|
|
3072
|
-
}
|
|
3073
|
-
return newParams;
|
|
3074
|
-
}
|
|
3075
|
-
return params;
|
|
3076
|
-
}
|
|
3077
|
-
class Filed extends JSONWatch {
|
|
3078
|
-
constructor(defaultData, validate = {}) {
|
|
3079
|
-
super(defaultData);
|
|
3080
|
-
}
|
|
3081
|
-
getProps(key) {
|
|
3082
|
-
return {
|
|
3083
|
-
value: this.get(key),
|
|
3084
|
-
onChange: (value) => {
|
|
3085
|
-
if (value && value.target && value.preventDefault) {
|
|
3086
|
-
value = value.target.value;
|
|
3087
|
-
}
|
|
3088
|
-
this.set(key, value);
|
|
3089
|
-
}
|
|
3090
|
-
};
|
|
3091
|
-
}
|
|
3092
|
-
getValue(key) {
|
|
3093
|
-
return this.get(key);
|
|
3094
|
-
}
|
|
3095
|
-
getValues() {
|
|
3096
|
-
return this.data;
|
|
3097
|
-
}
|
|
3098
|
-
setValue(key, value) {
|
|
3099
|
-
this.set(key, value);
|
|
3100
|
-
}
|
|
3101
|
-
}
|
|
3102
|
-
function index(defaultData, validate) {
|
|
3103
|
-
const [, forceUpdate] = React.useState({});
|
|
3104
|
-
const [filed] = React.useState(() => {
|
|
3105
|
-
return new Filed(defaultData, validate);
|
|
3106
|
-
});
|
|
3107
|
-
React.useEffect(() => {
|
|
3108
|
-
filed.on("$updated", () => forceUpdate({}));
|
|
3109
|
-
});
|
|
3110
|
-
return filed;
|
|
3111
|
-
}
|
|
3112
2953
|
const ListItem = PdaListItem;
|
|
3113
|
-
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 };
|