@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/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 = /* @__PURE__ */ (() => "*{margin:0;padding:0}div{box-sizing:border-box}body{--pda-image-1: url(https://img.alicdn.com/imgextra/i3/O1CN01PRSptR1YO1wOlBHCr_!!6000000003048-1-tps-240-240.gif);--pda-image-2: url(https://img.alicdn.com/imgextra/i3/O1CN01O46CYm1Gc4yvZtk7A_!!6000000000642-2-tps-36-64.png);--pda-image-3: url(https://img.alicdn.com/imgextra/i3/O1CN017UD9RM1vCKxsjxsrE_!!6000000006136-2-tps-68-68.png);--pda-image-4: url(https://img.alicdn.com/imgextra/i3/O1CN0170QXc91udWriUp19S_!!6000000006060-2-tps-74-72.png);--pda-image-5: url(https://img.alicdn.com/imgextra/i3/O1CN01EMphgH1ylYGXImCZn_!!6000000006619-2-tps-70-70.png);--pda-image-6: url(https://img.alicdn.com/imgextra/i3/O1CN01dTdXds1p9gz4wKAve_!!6000000005318-2-tps-70-26.png);--pda-image-7: url(https://img.alicdn.com/imgextra/i3/O1CN01SKQH1k1p7rQYTBXdn_!!6000000005314-2-tps-56-60.png);--pda-image-8: url(https://img.alicdn.com/imgextra/i3/O1CN01WnYl6Z1qBM3uInOvw_!!6000000005457-2-tps-40-68.png);--pda-image-10: url(https://img.alicdn.com/imgextra/i3/O1CN01FkZisA1tCg1sj3b6U_!!6000000005866-2-tps-40-58.png);--pda-image-11: url(https://img.alicdn.com/imgextra/i3/O1CN01kxYh3U25Xzr9nAcYp_!!6000000007537-2-tps-240-240.png)}\n")();
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 _classnames_2_3_1_classnames = { exports: {} };
12
+ var _classnames_2_5_1_classnames = { exports: {} };
13
13
  /*!
14
- Copyright (c) 2018 Jed Watson.
15
- Licensed under the MIT License (MIT), see
16
- http://jedwatson.github.io/classnames
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 (!arg)
26
- continue;
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));
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.join(" ");
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
- })(_classnames_2_3_1_classnames);
59
- var classNames = _classnames_2_3_1_classnames.exports;
60
- var index$E = /* @__PURE__ */ (() => '.op-overlay{top:0;left:0;position:fixed;right:0;bottom:0;display:flex;justify-content:center;align-items:center;z-index:100;background-color:none}.op-overlay:before{content:"";position:absolute;z-index:1;background-color:#000;opacity:.6;left:0;top:0;width:100vw;height:100vh}.op-overlay>div{position:relative;z-index:2}.op-overlay.center{align-items:center;justify-content:center}.op-overlay.top{align-items:flex-start;justify-content:center}.op-overlay.bottom{align-items:flex-end;justify-content:center}.op-overlay.bottom .toast-wrap{margin-bottom:10px}\n')();
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$D = /* @__PURE__ */ (() => ".pda-header{background-color:#000;display:flex;flex-direction:row;align-items:center;color:#fff;height:84px;padding-right:12px}.pda-header .header-click-area{padding-right:16px;height:100%;display:flex;align-items:center;flex-direction:row}.pda-header .pda-header-icon{height:100%;width:65px;background-size:100%;background-repeat:no-repeat;background-position:center}.pda-header .pda-header-icon:active{background-color:#d8d8d8}.pda-header .pda-header-icon-back{background-image:var(--pda-image-2);background-size:17px 32px}.pda-header .pda-header-icon-scan{background-image:var(--pda-image-3);background-size:34px auto}.pda-header .pda-header-icon-select{background-image:var(--pda-image-4);background-size:36px auto}.pda-header .pda-header-icon-read{background-image:var(--pda-image-5);background-size:35px auto}.pda-header .pda-title-text{font-size:40px;flex:1;line-height:1.25em}.pda-header .pda-header-more{background-image:var(--pda-image-6);background-size:36px auto}.pda-header .pda-header-config{background-image:var(--pda-image-7);background-size:36px auto}.pda-header .pda-menus{background-color:#fff;border-radius:8px 8px 0 0;width:100%;padding:24px;display:flex;flex-direction:column}.pda-header .pda-menus>*{margin-bottom:12px}\n")();
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 === "object") {
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 === "number")
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 === "object") {
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$C = /* @__PURE__ */ (() => ".pda-button{display:block;box-sizing:border-box;padding-right:0;text-align:center;font-size:40px;height:90px;line-height:40px;color:#fff;background-color:#f3f4f8;border-radius:10px;width:100%;border-width:0;word-break:keep-all}.pda-button.pda-button-default{color:#000}.pda-button:active{background-color:#979797}.pda-button.pda-button-primary{background-color:#0091ea}.pda-button.pda-button-primary:active{background-color:#0074bb}.pda-button.pda-button-dark{background-color:#282828}.pda-button.pda-button-dark:active{background-color:#979797}.pda-button.pda-button-cutout{color:#0091ea;border-width:4px;border-color:#0091ea}.button-group{display:flex;flex-direction:row;padding:20px 24px;width:100%}.button-group .pda-button:not(:last-child){margin-right:16px}\n")();
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$B(props) {
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(function() {
314
- if (menuShortcutKey) {
315
- return bindShortcutKey(getShortcutKeyCodes(menuShortcutKey), function() {
316
- setShowMenus(true);
317
- });
318
- }
319
- }, [menuShortcutKey]);
320
- React.useEffect(function() {
321
- if (backShortcutKey && onBack) {
322
- return bindShortcutKey(getShortcutKeyCodes(backShortcutKey), function() {
323
- onBack("back");
324
- });
325
- }
326
- }, [backShortcutKey, onBack]);
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 == "back") {
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$A = /* @__PURE__ */ (() => ".pda-info-card{border-radius:16px;padding:16px;background-color:#fff;word-break:break-word}.pda-info-card .divda-info-card-title{font-size:32px;line-height:32px}.pda-info-card .pda-info-card-title-section{display:flex;flex-direction:row;justify-content:space-between;align-items:center}.pda-info-card .pda-info-card-title-section .pda-info-card-title{font-size:32px;color:#666}.pda-info-card .pda-info-card-title-section .pda-info-card-tag{display:flex;align-items:center;justify-content:center;height:36px;padding:0 8px;background-color:#fc0;border-radius:8px}.pda-info-card .pda-info-card-highlight-section{display:flex;flex-direction:row;justify-content:space-between;align-items:flex-start}.pda-info-card .pda-info-card-highlight-section .pda-info-card-title{font-size:32px;color:#666;margin-top:20px}.pda-info-card .pda-info-card-highlight-section .pda-info-card-highlight{font-size:80px;line-height:64px;color:#0091ea;font-weight:700;padding-top:12px;display:flex;flex-direction:row;align-items:flex-end;flex-wrap:wrap}.pda-info-card .pda-info-card-highlight-section .pda-info-card-highlight .pda-info-card-highlight1CN{font-size:64px}.pda-info-card .pda-info-card-highlight-section .pda-info-card-highlight .pda-info-card-highlight2{font-size:50px;line-height:40px}.pda-info-card .pda-info-card-highlight-section .pda-info-card-highlight .pda-info-card-highlight2CN{font-size:40px;line-height:40px}.pda-info-card .pda-info-card-bold{font-weight:700;font-size:40px;line-height:48px;color:#000;margin-top:16px}.pda-info-card .pda-info-card-list{margin-top:12px;color:#4a4a4a;font-size:32px;line-height:32px;word-break:break-all}.pda-info-card-progress{background-color:#f3f4f8;height:12px;border-radius:6px;margin-top:16px}.pda-info-card-progress .pda-info-card-progress-inside{background-color:#0091ea;height:12px;border-radius:6px}.pda-info-card.pda-info-card-dark{background-color:#000}.pda-info-card.pda-info-card-dark .pda-info-card-title{color:#999}.pda-info-card.pda-info-card-dark .pda-info-card-highlight,.pda-info-card.pda-info-card-dark .pda-info-card-bold{color:#fff}.pda-info-card.pda-info-card-dark .pda-info-card-list{color:#999}\n")();
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$z = /* @__PURE__ */ (() => ".pda-list-item{padding:24px 16px;border-radius:16px;position:relative}.pda-list-item div{margin:0}.pda-list-item>div{margin-bottom:12px}.pda-list-item>div:last-child{margin-bottom:0}.pda-list-item .pda-listitem-highlight{width:100%;font-size:40px;line-height:40px;font-weight:700;color:#fff;display:flex;flex-direction:row;justify-content:space-between}.pda-list-item .pda-listitem-highlight div:first-child{flex:1;word-break:normal;white-space:normal;word-break:break-word}.pda-list-item .pda-listitem-header,.pda-list-item .pda-listitem-state-text,.pda-list-item .pda-listitem-subinfo{font-size:32px;line-height:32px;color:#999;word-break:break-all}.pda-list-item .pda-listitem-state-block{display:flex;flex-direction:row;flex-wrap:wrap;margin-bottom:0}.pda-list-item .pda-listitem-state-block>div{padding:6px 10px;border-radius:4px;background-color:#0091ea;margin-bottom:12px;margin-right:12px;font-size:24px;line-height:24px}.pda-list-item .pda-listitem-state-block>div.success{background-color:#0f0}.pda-list-item .pda-listitem-state-block>div.warning{background-color:#fc0}.pda-list-item .pda-listitem-state-block>div.error{background-color:red}.pda-list-item .pda-listitem-icon{position:absolute;top:0;right:0;width:60px;height:60px;background-color:#0091ea;border-radius:0 16px;display:flex;justify-content:center;align-items:center;opacity:.85}.pda-list-item .listitem-icon-container{background-size:100%;background-repeat:no-repeat;width:16px;height:24px}.pda-list-item .listitem-icon-next{background-image:var(--pda-image-10)}\n")();
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$y = /* @__PURE__ */ (() => ".confirm-wrap{background:#ffffff;border-radius:6px 6px 0 0;padding-top:24px;width:100%}.confirm-wrap .confirm-content{padding:0 24px}.confirm-wrap .confirm-title{font-size:28.8px;font-weight:700}.confirm-wrap .confirm-message,.confirm-wrap .confirm-sub-message{font-size:26.4px;margin-bottom:12px}.confirm-wrap .confirm-sub-block{display:flex;flex-direction:row}.confirm-wrap .confirm-sub-block .confirm-sub-label{white-space:nowrap}.confirm-wrap .confirm-sub-block .confirm-sub-content{margin-left:12px;word-wrap:break-word;word-break:break-all}.confirm-wrap .confirm-btns>*:not(:first-child){padding-top:0}.confirm-wrap.confirm-warning{background-color:red}.confirm-wrap.confirm-warning .pda-button{background-color:transparent;color:#000;border:2px solid black;border-radius:40px}\n")();
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$x = /* @__PURE__ */ (() => ".toast-wrap{background:#00ff00;border-radius:6px;padding:10px 15px;width:100%;box-sizing:border-box}.toast-wrap.warning{background-color:#ffcb00}.toast-wrap.error{background-color:red}.toast-wrap .toast-title{font-size:50px;font-weight:700;word-wrap:break-word}.toast-wrap .toast-message{font-size:32px;word-wrap:break-word}.loading-box{background-color:#fff;border-radius:5%;display:flex;flex-direction:column;align-items:center;padding:10px 20px;margin-top:-10%}.loading-box svg{width:50px;height:50px;animation:rotate 1.5s linear infinite;margin:10px}@keyframes rotate{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n")();
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("WindvanePlugin", "invoke", JSON.stringify(params), function(e) {
599
- }, function(e) {
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("WindvanePlugin", "invoke", JSON.stringify(params));
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(defaultProps, p);
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$w = /* @__PURE__ */ (() => '.op-overlay{top:0;left:0;position:fixed;right:0;bottom:0;display:flex;justify-content:center;align-items:center;z-index:100;background-color:none}.op-overlay:before{content:"";position:absolute;z-index:1;background-color:#000;opacity:.6;left:0;top:0;width:100vw;height:100vh}.op-overlay>div{position:relative;z-index:2}.op-overlay.center{align-items:center;justify-content:center}.op-overlay.top{align-items:flex-start;justify-content:center}.op-overlay.bottom{align-items:flex-end;justify-content:center}.op-overlay.bottom .toast-wrap{margin-bottom:10px}\n')();
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$v = /* @__PURE__ */ (() => ".prompt-dialog{background:#ffffff;border-radius:6px 6px 0 0;padding:10px;width:80%}.prompt-dialog .prompt-title{font-size:30px;margin:10px 0}.prompt-dialog .prompt-input{transition:all .1s linear;border:1px solid #dcdfe6;background-color:#fff;outline:0;margin:0;font-weight:400;vertical-align:middle;background-color:#0000;color:#1f2633;font-size:24px;box-sizing:border-box;width:100%;padding:.5em;border-radius:4px}.prompt-dialog .prompt-input:hover,.prompt-dialog .prompt-input:active,.prompt-dialog .prompt-input:focus{border-color:#03c1fd}.prompt-dialog .prompt-btns{display:flex;margin-top:10px}.prompt-dialog .prompt-btns .pda-button{margin-left:10px}.prompt-dialog .prompt-btns .pda-button:first-child{margin-left:0}\n")();
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$u = /* @__PURE__ */ (() => ".mini-app-start-page{display:flex;flex-direction:column;justify-content:center;align-items:center;width:100vw;height:100vh}.mini-app-start-page button{padding:.3em 3em;border-radius:6px;border:none;font-size:36px;background-color:#00bdff;color:#fff;margin-top:20px}.mini-app-start-page button:active{transform:scale(.95)}.mini-app-start-page .desc{opacity:.3}\n")();
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$t = /* @__PURE__ */ (() => ".loading-wrap{position:fixed;z-index:1000;left:0;top:0;background-color:#00000080;height:100vh;width:100vw;display:flex;align-items:center;justify-content:center}.loading-wrap .loading-box{background-color:#fff;border-radius:5%;display:flex;flex-direction:column;align-items:center;padding:10px 20px;margin-top:-10%}.loading-wrap .loading-box svg{width:50px;height:50px;animation:rotate 1.5s linear infinite;margin:10px}@keyframes rotate{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n")();
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(function() {
972
- let currentLoading = false;
973
- const throttleSetShowLoading = function(loading2) {
974
- currentLoading = loading2;
975
- if (loading2) {
976
- setTimeout(function() {
977
- if (currentLoading === loading2) {
978
- setShowLoading(true);
979
- }
980
- }, 350);
981
- } else {
982
- setTimeout(function() {
983
- if (currentLoading === loading2) {
984
- setShowLoading(false);
985
- }
986
- }, 100);
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
- edgeService.on("IO_STATUS", throttleSetShowLoading);
993
- return function() {
994
- edgeService.off("IO_STATUS", throttleSetShowLoading);
995
- };
996
- }, [edgeService]);
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("WindvanePlugin", "invoke", JSON.stringify(params));
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$s = {
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$r = /* @__PURE__ */ (() => ".presentation-card{margin:12px;background-color:#fff;border-radius:6px;text-align:center;padding:20px 6px}.presentation-card img{width:70%;height:auto}.presentation-card.transparent{background-color:transparent;color:#fff;margin-top:80px}.presentation-card .text{margin-top:12px;font-weight:700;font-size:32px}.presentation-card .sub-text{margin-top:6px;font-weight:700;font-size:24px;line-height:24px;color:#999;word-wrap:break-word}\n")();
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$q = /* @__PURE__ */ (() => ".android-pda-list{--base-font-size: 36px}.android-pda-list .android-pda-list-title{font-size:calc(var(--base-font-size) * .6);color:#fff;line-height:2em}.android-pda-list .default-item{background-color:#282828;font-size:var(--base-font-size);padding:10px;border-radius:6px;color:#fff;display:flex;justify-content:space-between;align-items:center;cursor:pointer;margin-bottom:10px;word-break:break-word}.android-pda-list .default-item:hover,.android-pda-list .default-item:active,.android-pda-list .default-item:focus{background-color:#0061a1}.android-pda-list .default-item .text{flex:1}.android-pda-list .default-item .sub-text{font-size:80%;opacity:.7;line-height:1em;word-wrap:break-word}.android-pda-list .default-item .sub-tags{display:flex;margin-top:10px}.android-pda-list .default-item .sub-tags .sub-tag-item{background-color:#008fed;padding:.3em;font-size:40%;margin-right:5px;border-radius:6px;color:#fff;line-height:1em}.android-pda-list .default-item .sub-tags .sub-tag-item:first-child{margin-left:0}.android-pda-list .default-item .extra{font-size:80%;opacity:.7}\n")();
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$p = /* @__PURE__ */ (() => ".baselayout-wrapper{display:flex;flex-direction:column;background-color:#000;padding:85px 0}.baselayout-wrapper .baselayout-header{position:fixed;width:100%;top:0;z-index:2}.baselayout-wrapper .baselayout-footer{position:fixed;bottom:0;width:100%;background-color:#000;z-index:1}.baselayout-wrapper .baselayout-container{padding:0 24px 16px;overflow-x:auto;flex:1}.baselayout-wrapper .baselayout-container>*{margin-bottom:16px}.baselayout-wrapper .loading{position:absolute;top:0;left:0;right:0;bottom:0;color:#fff;background-color:#0006;background-image:var(--pda-image-1);background-repeat:no-repeat;background-position:center;background-size:120px 120px}\n")();
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("WindvanePlugin", "invoke", "{'domain': 'keyboard', 'method': 'changeScanMode', 'params': {'scanMode': 'barcode'}}", function(e) {
1428
- }, function(e) {
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$o = /* @__PURE__ */ (() => ".wakekeyborard .wakekeyborard-icon{width:80px;height:80px;background-image:var(--pda-image-11);background-size:100%;position:fixed;right:24px;bottom:24px}.wakekeyborard-overlay{position:fixed;top:0;right:0;left:0;bottom:0;background-color:#dedede33;z-index:10}.wakekeyborard-inputbox{width:100%;display:flex;flex-direction:row;height:85px;position:absolute;bottom:0;left:0;right:0}.wakekeyborard-inputbox input{width:100%;border-radius:16px 0 0;border:0;font-size:42px;background-color:#fff;padding-left:20px}.wakekeyborard-inputbox input:focus{outline:none}.wakekeyborard-inputbox input::-webkit-input-placeholder{color:#d1d1d6;font-size:32px}.wakekeyborard-inputbox button{width:150px;border:0;border-radius:0 16px 0 0;background-color:#fff}\n")();
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$n = /* @__PURE__ */ (() => ".v-mask{position:fixed;top:0;left:0;z-index:1000;display:block;width:100%;height:100%;background:rgba(0,0,0,.75);opacity:1;display:unset}.v-mask .image-viewer-content{width:100vw;height:100vh;max-height:-webkit-fill-available;touch-action:none}.v-mask .image-viewer-slides{height:100%;position:relative;z-index:1;cursor:grab;touch-action:none}.v-mask .image-viewer-indicator{position:absolute;z-index:2;left:50%;top:12px;transform:translate(-50%);color:#e6e6e6;font-size:14px}.v-mask .viewer-image-close{position:absolute;right:6px}.v-mask .viewer-image-close svg{fill:#fff;background:rgba(0,0,0,.3);box-sizing:content-box;height:24px;padding:12px;width:24px}.v-mask .image-viewer-slides-inner{height:100%;white-space:nowrap}.v-mask .image-viewer-image-wrapper{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.v-mask .image-viewer-image-wrapper img{display:block;max-width:100%;max-height:100%}.v-mask .viewer-image-arrow{position:absolute;top:calc(50% - 10px);z-index:999}.v-mask .viewer-image-arrow svg{fill:#fff;background:rgba(0,0,0,.3);box-sizing:content-box;height:24px;padding:18px;width:24px}.v-mask .viewer-prev{left:0}.v-mask .viewer-next{right:0}.v-mask .image-viewer-loading{display:flex;justify-content:center;align-items:center;position:fixed;left:0;top:0;width:100%;height:100%;background-color:#0000009d;z-index:998}.v-mask .image-viewer-loading .image-viewer-loading-reactor{animation:PhotoView__delayShow .4s linear both}.v-mask .image-viewer-loading .image-viewer-loading-reactor svg{animation:PhotoView__rotate .6s linear infinite}@keyframes PhotoView__rotate{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes PhotoView__delayShow{0%,50%{opacity:0}to{opacity:1}}\n")();
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("WVCamera", "takePhoto", params, function(e) {
1830
- const plugin = {
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: "getBase64",
1833
- params: {
1834
- filePath: e.localPath
1835
- }
1883
+ method: "takePhoto",
1884
+ params: { compressSize }
1836
1885
  };
1837
- window.WindVane.call("WindvanePlugin", "invoke", JSON.stringify(plugin), function(res) {
1838
- beforeUpload && beforeUpload(res.data);
1839
- onBeforeUpload && onBeforeUpload(res.data);
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
- }, function(err) {
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$m = /* @__PURE__ */ (() => ".image-uploader-wrap{display:inline-flex;flex-wrap:wrap;margin-bottom:8px}.image-space-item{margin-right:8px;padding-bottom:8px}.image-space-item .image-uploader-cell{position:relative;width:80px;height:80px;border-radius:4px;overflow:hidden}.image-space-item .image-uploader-cell-image{width:80px;height:80px}.image-space-item .image-uploader-cell-delete{position:absolute;top:0;right:0;width:14px;height:14px;background-color:#000000b3;border-radius:0 0 0 12px;font-size:8px;color:#fff;cursor:pointer}.image-space-item .image-uploader-cell-delete .uploader-delete-icon{position:absolute;right:2px;top:2px;display:inline-block;object-fit:cover;width:8px;height:8px}.image-space-item .image-uploader-img{object-fit:cover;display:block;width:100%;height:100%}.image-space-item .image-uploader-upload-button-wrap{position:relative}.image-space-item .image-uploader-upload-button-wrap .image-uploader-upload-button{display:flex;justify-content:center;align-items:center;background-color:#a2a2a2;cursor:pointer}.image-space-item .image-uploader-upload-button-wrap .uploader-add-icon{display:inline-block;object-fit:cover;width:32px;height:32px}.image-uploader-loading{display:flex;justify-content:center;align-items:center;position:fixed;left:0;top:0;width:100%;height:100%;background-color:#0000009d}.image-uploader-loading .image-uploader-loading-reactor{animation:PhotoView__delayShow .4s linear both}.image-uploader-loading .image-uploader-loading-reactor svg{animation:PhotoView__rotate .6s linear infinite}@keyframes PhotoView__rotate{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes PhotoView__delayShow{0%,50%{opacity:0}to{opacity:1}}\n")();
1928
- var index$l = /* @__PURE__ */ (() => "")();
1929
- var index$k = /* @__PURE__ */ (() => ".pda-step-card{display:flex;flex-direction:row}.pda-step-card .pda-step-indictor{display:flex;flex-direction:column;align-items:center;margin-right:16px}.pda-step-card .pda-step-indictor .pda-step-indictor-top{width:1px;background-color:#bec0c6;flex:1}.pda-step-card .pda-step-indictor .pda-step-indictor-top-hidden{background-color:#fff0}.pda-step-card .pda-step-indictor .pda-step-indictor-center{height:24px;width:24px;border-radius:12px;background-color:#bec0c6}.pda-step-card .pda-step-indictor .pda-step-indictor-center-active{background-color:#0091ea}.pda-step-card .pda-step-indictor .pda-step-indictor-bottom{flex:1;width:1px;background-color:#bec0c6}.pda-step-card .pda-step-indictor .pda-step-indictor-bottom-hidden{background-color:#fff0}.pda-step{border-radius:16px;padding:24px 16px;background-color:#fff;margin-bottom:16px}.pda-step p{margin:0}.pda-step .pda-step-title{font-size:60px;color:#0091ea}.pda-step .pda-step-list{margin-top:8px;color:#4a4a4a;font-size:32px;line-height:32px}.pda-step.pda-step-dark{background-color:#000}.pda-step.pda-step-dark .pda-step-title{color:#fff}.pda-step.pda-step-dark .pda-step-list{color:#bec0c6}\n")();
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$j = /* @__PURE__ */ (() => ".pda-finish-card-top{display:flex;flex-direction:column;align-items:center;color:#fff}.pda-finish-card-top .pda-finish-card-img{width:100%;margin:50px auto 0}.pda-finish-card-top .pda-finish-card-title{font-size:50px;line-height:50px;color:#fff;font-weight:500;margin-bottom:16px;text-align:center}.pda-finish-card-top .pda-finish-card-list{margin-top:12px;color:#999;font-size:32px;line-height:30px;text-align:center}\n")();
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$i = /* @__PURE__ */ (() => ".pda-distance-card{border-radius:16px;padding:36px 16px;background-color:#fff}.pda-distance-card p{margin:0;font-size:28px;color:#738399}.pda-distance-card .pda-distance-card-highlight{font-size:60px;line-height:64px;color:#0091ea}.pda-distance-card .pda-distance-indictor{margin-top:36px;display:flex}.pda-distance-card .pda-distance-card-progress{background-color:#ebecf2;height:34px;border-radius:6px;border:4px solid #D9D9D9;margin-top:8px;position:relative}.pda-distance-card .pda-distance-card-progress .pda-distance-card-progress-indictor{position:absolute;bottom:0;left:5px}.pda-distance-card .pda-distance-card-progress .pda-distance-card-progress-inside{background-color:#0091ea;height:26px;border-radius:6px 0 0 6px}.pda-distance-card .pda-distance-label{display:flex;justify-content:space-between}\n")();
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$h = /* @__PURE__ */ (() => ".android-sub-card{background:#282828;border-radius:16px;padding:10px;color:#fff}.android-sub-card .android-sub-card-title-section{display:flex;justify-content:space-between}.android-sub-card .android-sub-card-title-section .android-sub-card-title{opacity:.6;font-size:21.312px}.android-sub-card .android-sub-card-title-section .android-sub-card-tag{margin-bottom:0}.android-sub-card .android-sub-card-title-section .android-sub-card-tag>div{padding:6px 10px;border-radius:4px;background-color:#0091ea;color:#fff;font-size:15.984px;line-height:15.984px}.android-sub-card .android-sub-card-title-section .android-sub-card-tag>div.success{background-color:#0f0}.android-sub-card .android-sub-card-title-section .android-sub-card-tag>div.warning{background-color:#fc0;color:#000}.android-sub-card .android-sub-card-title-section .android-sub-card-tag>div.error{background-color:red}.android-sub-card .android-sub-card-context{font-size:60px;line-height:60px;font-weight:700;word-break:break-all;word-wrap:break-word;margin-top:16px}.android-sub-card .android-sub-card-name{font-size:40px;line-height:40px;font-weight:700;margin-top:16px;margin-bottom:12px}.android-sub-card .android-sub-card-attrs{font-size:32px;line-height:32px;color:#999}.android-sub-card .android-sub-card-attrs>div{margin-top:12px}\n")();
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$g = /* @__PURE__ */ (() => ".select-card{padding-top:12px}.select-card p{color:#999;font-size:32px;line-height:40px;margin-bottom:12px;padding-left:16px}.select-card .select-card-content{background-color:#282828;padding:24px 24px 24px 16px;border-radius:16px;display:flex;flex-direction:row;justify-content:space-between;color:#fff;font-size:40px;line-height:40px}.select-card .select-icon{background-image:var(--pda-image-8);background-size:100%;background-repeat:no-repeat;background-position:center;width:20px}\n")();
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$f = /* @__PURE__ */ (() => ".pda-app-list .pda-app-group{margin:25px}.pda-app-list .pda-app-group .group-name{line-height:1em;margin:0;font-size:32px;color:#fff;font-weight:400;opacity:.6}.pda-app-list .pda-app-group .group-apps{display:flex;flex-wrap:wrap;justify-content:space-between;margin-top:25px}.pda-app-list .pda-app-group .group-apps .app-item{display:flex;flex-direction:column;justify-content:center;align-items:center;background-image:linear-gradient(138deg,#0091EA 0%,#095FFF 100%);border-radius:12px;font-size:32px;color:#fff;min-height:126px;flex:1;min-width:48%;max-width:48%;margin-bottom:25px;cursor:pointer}.pda-app-list .pda-app-group .group-apps .app-item:hover,.pda-app-list .pda-app-group .group-apps .app-item:active,.pda-app-list .pda-app-group .group-apps .app-item:focus{background-image:linear-gradient(45deg,#0091EA 0%,#095FFF 100%);box-shadow:0 0 1px 2px #fff}.pda-app-list .pda-app-group .group-apps .app-item .app-name{text-align:center}.pda-app-list .pda-app-group .group-apps .app-item .app-subname{font-size:50%}\n")();
2191
+ var index$e = "";
2119
2192
  function empty() {
2120
2193
  }
2121
- function index$e(props) {
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$d = /* @__PURE__ */ (() => ".pda-infinite-scroll{margin-top:10px}.pda-infinite-scroll span{color:#999}.pda-infinite-scroll .pda-infinite-scroll-view{display:flex;align-items:center;justify-content:center}\n")();
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$c = /* @__PURE__ */ (() => ".action-sheet{position:fixed;z-index:1000;width:100%;height:100%;background-color:#00000059;top:0;left:0;display:none}.action-sheet .action-sheet-container{position:absolute;background-color:#fff;z-index:1010;width:100%;bottom:0;left:0;max-height:80%;border-radius:9.9px 9.9px 0 0;padding-bottom:10.56px;display:flex;flex-direction:column}.action-sheet .action-sheet-container .action-sheet-body{flex:1;overflow-y:auto}.action-sheet .action-sheet-container .action-sheet-sticky-bottom{border-top:2px solid #F2F2F2}.action-sheet .action-sheet-container .action-sheet-item{margin:10.56px 15.84px 0;background-color:#f3f4f8;height:54px;display:flex;align-items:center;justify-content:center;font-size:24px;border-radius:9.9px}.action-sheet .action-sheet-container .action-sheet-sticky-bottom-row{display:flex}.action-sheet.show{display:block}.action-sheet.show .action-sheet-container{animation:slide-in .3s ease-out}@keyframes slide-in{0%{transform:translateY(100%);opacity:0}to{transform:translateY(0);opacity:1}}\n")();
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$b = /* @__PURE__ */ (() => ".pda-tag{display:inline-block;padding:6px 10px;border-radius:4px;background-color:#0091ea;margin-bottom:12px;margin-right:12px;font-size:24px;line-height:24px;word-break:keep-all}.pda-tag.pda-tag-success{background-color:#0f0}.pda-tag.pda-tag-warning{background-color:#fc0}.pda-tag.pda-tag-error{background-color:red}\n")();
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$a = /* @__PURE__ */ (() => ".simple-card{display:inline-block;padding:12px 0 12px 18px;border-radius:12px}.simple-card .simple-card-title{font-weight:700;font-size:56px;line-height:40px;margin-top:12px}.simple-card .simple-card-content{font-size:28px;line-height:40px;margin-top:12px}.simple-card.simple-card-default{background-color:#f3f4f9}.simple-card.simple-card-default .simple-card-title{color:#0091ea}.simple-card.simple-card-default .simple-card-content{color:#000}.simple-card.simple-card-error{background-color:red}.simple-card.simple-card-error .simple-card-title{color:#fff}.simple-card.simple-card-error .simple-card-content{color:#ffafb1}.simple-card.simple-card-dark{background-color:#282828}.simple-card.simple-card-dark .simple-card-title{color:#fff}.simple-card.simple-card-dark .simple-card-content{color:#999}\n")();
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$9 = /* @__PURE__ */ (() => ".simple-card-block{background-color:#fff;padding:24px 12px;border-radius:12px}.simple-card-block .simple-card-block-header{display:flex;justify-content:space-between}.simple-card-block .simple-card-block-title{color:#666;font-size:32px;line-height:32px}.simple-card-block .simple-card-block-content{display:flex;flex-wrap:wrap}.simple-card-block .simple-card-block-content>div{min-width:190px;margin-right:12px;margin-top:12px}\n")();
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$8 = /* @__PURE__ */ (() => ".lattice-mouth .lattice-mouth-row{display:flex}.lattice-mouth .lattice-mouth-row .lattice-mouth-item{--font-size: 14px;--color: #ffffff;--background-color: #BFBFBF;color:var(--color);background-color:var(--background-color);font-size:var(--font-size);flex:1;flex-direction:column;display:flex;margin:1%;border-radius:4px;overflow:hidden}.lattice-mouth .lattice-mouth-row .lattice-mouth-item.highlight{--color: #ffffff;--background-color: #008FED}.lattice-mouth .lattice-mouth-row .lattice-mouth-item.active{--color: #ffffff;--background-color: #282828}.lattice-mouth .lattice-mouth-row .lattice-mouth-item.default{--color: #ffffff;--background-color: #BFBFBF}.lattice-mouth .lattice-mouth-row .lattice-mouth-item.complete{--color: #000000;--background-color: #00FF00}.lattice-mouth .lattice-mouth-row .lattice-mouth-item.error{--color: #ffffff;--background-color: #f30f30}.lattice-mouth .lattice-mouth-row .lattice-mouth-item .lattice-mouth-value{text-align:center;flex:1;font-size:150%;min-height:2em;display:flex;justify-content:center;align-items:center}.lattice-mouth .lattice-mouth-row .lattice-mouth-item .lattice-mouth-label{background-color:#0000004d;text-align:center;min-height:1em}\n")();
2558
- function index$7(props) {
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((_2, colIndex) => renderItem(dataSource, rowIndex, colIndex, col)));
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$1(dataSource, rowIndex, colIndex, col) || {};
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$1(dataSource, rowIndex, colIndex, col) {
2661
+ function getDataSourceItem(dataSource, rowIndex, colIndex, col) {
2587
2662
  return dataSource[rowIndex * col + colIndex];
2588
2663
  }
2589
- var index$6 = /* @__PURE__ */ (() => ".android-op-card{--base-font-size: 20px;--background-color: #ffffff;--color: #282828;--main-color: #008fed;--border-radius: 6px;--progress-background-color: rgba(160, 160, 160, .5);--progress-foreground-color: #008fed;--tag-background-color: #008fed;--tag-color: #ffffff;background-color:var(--background-color);font-size:var(--base-font-size);color:var(--color);border-radius:var(--border-radius);padding:2%;position:relative}.android-op-card .card-h1{color:var(--color);opacity:.7;font-weight:700}.android-op-card .card-content{font-size:calc(var(--base-font-size) * 2.5);color:var(--main-color);font-weight:700;display:flex;align-items:baseline;line-height:1.1em;word-break:break-word}.android-op-card .card-content small{font-size:50%}.android-op-card .card-progress{background-color:var(--progress-background-color);border-radius:1em;overflow:hidden;height:1em;font-size:calc(var(--base-font-size) * .6);margin-bottom:1em}.android-op-card .card-progress .card-progress-bar{background-color:var(--progress-foreground-color);height:1em;opacity:1.5}.android-op-card .card-main-title{font-size:calc(var(--base-font-size) * 1.6);line-height:1.5em;margin-bottom:.2em}.android-op-card .card-info-list{color:var(--color);opacity:.6}.android-op-card .card-tags{display:flex;margin-top:.5em}.android-op-card .card-tags.top{position:absolute;top:4%;right:1%}.android-op-card .card-tags .card-tags-item{font-size:calc(var(--base-font-size) * .8);color:var(--tag-color);border-radius:.3em;background-color:var(--tag-background-color);padding:.2em .3em;margin-right:.5em}.android-op-card .actions{margin:10px -2% -2%;display:flex}.android-op-card .actions .btn{border-top:1px solid var(--color);opacity:.5;flex:1;display:flex;cursor:pointer;justify-content:center;align-items:center;line-height:2.5em;border-left:1px solid var(--color);color:var(--main-color)}.android-op-card .actions .btn:first-child{border-left:none}.android-op-card .actions .btn.warning{color:red}.android-op-card .actions .btn:hover,.android-op-card .actions .btn:active{opacity:1}\n")();
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$5 = /* @__PURE__ */ (() => ".android-pda-picker{--base-font-size: 24px;--border-radius: 6px;position:relative;background-color:#282828;display:flex;align-items:center;padding:.5em;border-radius:var(--border-radius);font-size:var(--base-font-size)}.android-pda-picker .label{color:#fff}.android-pda-picker .text{color:#999;min-height:1em;display:flex;flex:1;justify-content:flex-end;margin-right:10px}.android-pda-picker .icon{display:block;background-image:var(--pda-image-8);background-size:100%;background-repeat:no-repeat;background-position:center;width:20px;height:20px}.android-pda-picker-overlay{--base-font-size: 24px;display:block;width:100%;background-color:#000}.android-pda-picker-overlay .title{display:flex;align-items:center;color:#000;border-top:1px solid #727272;border-bottom:1px solid #353535;font-size:var(--base-font-size);position:relative;z-index:1;padding:1em}.android-pda-picker-overlay .title .filter-input{font-size:var(--base-font-size);box-sizing:border-box;padding:.5em .5em .5em 2em;background-color:#282828;border:none;color:#fff;border-radius:6px;flex:1}.android-pda-picker-overlay .title .filter-input:focus{background-color:#7e7e7e;outline:1px solid #00ccff}.android-pda-picker-overlay .title .filter-input:focus~.search-icon{color:#fff}.android-pda-picker-overlay .title .filter-input:focus~.cancel{display:block}.android-pda-picker-overlay .title .cancel{display:none;padding:0 1em;color:#fff}.android-pda-picker-overlay .title .search-icon{position:absolute;color:#ababab;top:1.5em;left:1.5em}.android-pda-picker-overlay .android-pda-picker-list{font-size:var(--base-font-size);height:70vh;overflow-y:auto;padding:1em}\n")();
2669
- function index$4(props) {
2743
+ var index$4 = "";
2744
+ function index$3(props) {
2670
2745
  const {
2671
- label = "\u8BF7\u9009\u62E9",
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
- setCurrentValue(getDataSourceItem(dataSource, value !== void 0 ? value : defaultValue));
2685
- }, [dataSource, value]);
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
- }, currentValue ? currentValue.label : placeholder), /* @__PURE__ */ React.createElement("span", {
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
- const newItem = getDataSourceItem(dataSource, item.value);
2728
- setFilter("");
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: filterLabel(dataSource, filter).map((item) => {
2814
+ dataSource: currentDataSource.map((item, index2) => {
2738
2815
  return {
2739
- title: item.label,
2740
- value: item.value
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$3(props) {
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$2 = /* @__PURE__ */ (() => ".android-op-input-item{--base-font-size: 25px;--color: #ffffff;--background-color: #545454;position:relative;background-color:var(--background-color);border-radius:6px}.android-op-input-item label{display:flex;align-items:center}.android-op-input-item .label-text{font-size:var(--base-font-size);color:var(--color);position:absolute;left:.5em}.android-op-input-item input{background-color:transparent;border:none;flex:1;font-size:calc(var(--base-font-size) * 1.2);padding:.5em;text-align:right;color:var(--color)}.android-op-input-item input:focus{outline:#ffffff}\n")();
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$1(props) {
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$e as AppList, BaseLayout, Button, List as Card, Confirm, PdaDistanceCard as DistanceCard, PdaFinishCard as FinishCard, index$B as Header, ImageUploader, ImageViewer, InfiniteScroll, PdaInfoCard$2 as InfoCard, index$1 as InputItem, Keyborard, index$7 as LatticeMouth, List$1 as List, ListItem, index$3 as Loading, Overlay$1 as Overlay, PDA_IMAGE_PATH, index$s as PageFlowSystemPages, index$4 as Picker, Presentation, SelectCard, SimpleCard, SimpleCardBlock, PdaInfoCard as Steps, SubCard, Tag, PdaListItem as TaskCard, PdaTitle as Title, Toast, WakeKeyborard, index as useFiled };
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 };