@cniot/android-pda-components 0.2.38 → 0.2.41
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.cd58c2ee.css +1 -0
- package/build/assets/{index.551abe71.js → index.ee8f6d1b.js} +74 -32
- package/build/assets/vendor.e223953a.js +40 -0
- package/build/index.html +3 -3
- package/change.md +2 -0
- package/doc/index.jsx +13 -0
- package/es/index.cjs.js +3 -3
- package/es/index.es.js +380 -31
- package/es/style.css +1 -1
- package/package.json +1 -1
- package/build/assets/index.8396e44f.css +0 -1
- package/build/assets/vendor.5080796b.js +0 -40
package/es/index.es.js
CHANGED
|
@@ -33,10 +33,10 @@ var __publicField = (obj, key, value) => {
|
|
|
33
33
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
34
34
|
return value;
|
|
35
35
|
};
|
|
36
|
-
import React, { useState, useEffect, useRef, cloneElement, useCallback } from "react";
|
|
36
|
+
import React, { useState, useEffect, useRef, Component, cloneElement, useCallback } from "react";
|
|
37
37
|
import ReactDOM from "react-dom";
|
|
38
38
|
var global = "";
|
|
39
|
-
var
|
|
39
|
+
var classnames = { exports: {} };
|
|
40
40
|
/*!
|
|
41
41
|
Copyright (c) 2018 Jed Watson.
|
|
42
42
|
Licensed under the MIT License (MIT), see
|
|
@@ -82,9 +82,9 @@ var _classnames_2_3_1_classnames = { exports: {} };
|
|
|
82
82
|
window.classNames = classNames2;
|
|
83
83
|
}
|
|
84
84
|
})();
|
|
85
|
-
})(
|
|
86
|
-
var classNames =
|
|
87
|
-
var index$
|
|
85
|
+
})(classnames);
|
|
86
|
+
var classNames = classnames.exports;
|
|
87
|
+
var index$v = "";
|
|
88
88
|
function getTypeClass$2(type) {
|
|
89
89
|
return {
|
|
90
90
|
"center": "op-overlay center",
|
|
@@ -113,7 +113,7 @@ function Overlay$1(props) {
|
|
|
113
113
|
className: getTypeClass$2(verticalPosition)
|
|
114
114
|
}, option), props.children) : null;
|
|
115
115
|
}
|
|
116
|
-
var index$
|
|
116
|
+
var index$u = "";
|
|
117
117
|
const blankFunc$6 = () => {
|
|
118
118
|
};
|
|
119
119
|
class PdaTitle extends React.Component {
|
|
@@ -152,7 +152,7 @@ class PdaTitle extends React.Component {
|
|
|
152
152
|
}, menuList)));
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
|
-
var
|
|
155
|
+
var keycode$1 = { exports: {} };
|
|
156
156
|
(function(module, exports) {
|
|
157
157
|
function keyCode(searchInput) {
|
|
158
158
|
if (searchInput && typeof searchInput === "object") {
|
|
@@ -279,9 +279,9 @@ var _keycode_2_2_1_keycode = { exports: {} };
|
|
|
279
279
|
for (var alias in aliases) {
|
|
280
280
|
codes[alias] = aliases[alias];
|
|
281
281
|
}
|
|
282
|
-
})(
|
|
283
|
-
var keycode =
|
|
284
|
-
var index$
|
|
282
|
+
})(keycode$1, keycode$1.exports);
|
|
283
|
+
var keycode = keycode$1.exports;
|
|
284
|
+
var index$t = "";
|
|
285
285
|
function Button(props) {
|
|
286
286
|
const { type = "default", onClick, className = "", tabIndex = 1, dataClick = "" } = props;
|
|
287
287
|
let opt = {};
|
|
@@ -303,7 +303,7 @@ Button.Group = ButtonGroup;
|
|
|
303
303
|
const SPECIAL_KEY_MAP = ["fn"];
|
|
304
304
|
const empty$3 = () => {
|
|
305
305
|
};
|
|
306
|
-
function index$
|
|
306
|
+
function index$s(props) {
|
|
307
307
|
const {
|
|
308
308
|
onBack,
|
|
309
309
|
icon,
|
|
@@ -422,7 +422,7 @@ function addEventListener(node, eventName, fn) {
|
|
|
422
422
|
node.removeEventListener(eventName, fn);
|
|
423
423
|
};
|
|
424
424
|
}
|
|
425
|
-
var index$
|
|
425
|
+
var index$r = "";
|
|
426
426
|
class PdaInfoCard$2 extends React.Component {
|
|
427
427
|
constructor(props) {
|
|
428
428
|
super(props);
|
|
@@ -480,7 +480,7 @@ class PdaInfoCard$2 extends React.Component {
|
|
|
480
480
|
}
|
|
481
481
|
}
|
|
482
482
|
PdaInfoCard$2.IMAGE_1 = "https://img.alicdn.com/imgextra/i2/O1CN01qYuxip1ME9zhdL9XG_!!6000000001402-2-tps-150-150.png";
|
|
483
|
-
var index$
|
|
483
|
+
var index$q = "";
|
|
484
484
|
class PdaListItem extends React.Component {
|
|
485
485
|
constructor(props) {
|
|
486
486
|
super(props);
|
|
@@ -526,7 +526,7 @@ class PdaListItem extends React.Component {
|
|
|
526
526
|
}));
|
|
527
527
|
}
|
|
528
528
|
}
|
|
529
|
-
var index$
|
|
529
|
+
var index$p = "";
|
|
530
530
|
function empty$2() {
|
|
531
531
|
}
|
|
532
532
|
function Confirm(props) {
|
|
@@ -571,7 +571,7 @@ function Confirm(props) {
|
|
|
571
571
|
dataClick: item.dataClick
|
|
572
572
|
}, item.label))) : null));
|
|
573
573
|
}
|
|
574
|
-
var index$
|
|
574
|
+
var index$o = "";
|
|
575
575
|
function WindVaneLog(param) {
|
|
576
576
|
const params = {
|
|
577
577
|
domain: "logger",
|
|
@@ -755,7 +755,7 @@ function confirm(props) {
|
|
|
755
755
|
onClick: onNext
|
|
756
756
|
})));
|
|
757
757
|
}
|
|
758
|
-
var index$
|
|
758
|
+
var index$n = "";
|
|
759
759
|
function getTypeClass(type) {
|
|
760
760
|
return {
|
|
761
761
|
"center": "op-overlay center",
|
|
@@ -784,7 +784,7 @@ function Overlay(props) {
|
|
|
784
784
|
className: getTypeClass(verticalPosition)
|
|
785
785
|
}, option), props.children) : null;
|
|
786
786
|
}
|
|
787
|
-
var index$
|
|
787
|
+
var index$m = "";
|
|
788
788
|
function Prompt(props) {
|
|
789
789
|
const inputRef = React.useRef();
|
|
790
790
|
const { data = {}, onNext } = props;
|
|
@@ -855,7 +855,7 @@ function splitMessage(message) {
|
|
|
855
855
|
var msg = String(message).split("by Error:");
|
|
856
856
|
return msg[1] || msg[0];
|
|
857
857
|
}
|
|
858
|
-
var index$
|
|
858
|
+
var index$l = "";
|
|
859
859
|
function NotFound(props) {
|
|
860
860
|
return /* @__PURE__ */ React.createElement("div", {
|
|
861
861
|
style: { padding: "20%" }
|
|
@@ -956,7 +956,7 @@ function createHashHistory(b) {
|
|
|
956
956
|
}
|
|
957
957
|
function z(a, e) {
|
|
958
958
|
e === void 0 && (e = null);
|
|
959
|
-
return C(_extends({
|
|
959
|
+
return C(_extends({}, d, typeof a === "string" ? J(a) : a, { state: e, key: H() }));
|
|
960
960
|
}
|
|
961
961
|
function A(a) {
|
|
962
962
|
v = a;
|
|
@@ -987,7 +987,11 @@ function createHashHistory(b) {
|
|
|
987
987
|
w(a, e);
|
|
988
988
|
}
|
|
989
989
|
var g = r.Replace, n = z(a, e);
|
|
990
|
-
c.length && (c.call({
|
|
990
|
+
c.length && (c.call({
|
|
991
|
+
action: g,
|
|
992
|
+
location: n,
|
|
993
|
+
retry: l
|
|
994
|
+
}), 1) || (n = [{ usr: n.state, key: n.key, idx: q }, x(n)], u.replaceState(n[0], "", n[1]), A(g));
|
|
991
995
|
}
|
|
992
996
|
function p(a) {
|
|
993
997
|
u.go(a);
|
|
@@ -1034,7 +1038,7 @@ function createHashHistory(b) {
|
|
|
1034
1038
|
}
|
|
1035
1039
|
};
|
|
1036
1040
|
}
|
|
1037
|
-
var index$
|
|
1041
|
+
var index$k = "";
|
|
1038
1042
|
function Debug(props) {
|
|
1039
1043
|
const { appManager } = props;
|
|
1040
1044
|
const pages = Array.from(appManager.pageManager.keys()).reverse();
|
|
@@ -1100,7 +1104,7 @@ function PlaySound({ data, service, action }) {
|
|
|
1100
1104
|
service.onNext({});
|
|
1101
1105
|
return null;
|
|
1102
1106
|
}
|
|
1103
|
-
var index$
|
|
1107
|
+
var index$j = {
|
|
1104
1108
|
Alert,
|
|
1105
1109
|
Start,
|
|
1106
1110
|
Toast: toast,
|
|
@@ -1111,7 +1115,7 @@ var index$h = {
|
|
|
1111
1115
|
Loading: Loading$1,
|
|
1112
1116
|
PlaySound
|
|
1113
1117
|
};
|
|
1114
|
-
var index$
|
|
1118
|
+
var index$i = "";
|
|
1115
1119
|
function Presentation(props) {
|
|
1116
1120
|
const {
|
|
1117
1121
|
image = Presentation.IMAGE_1,
|
|
@@ -1133,7 +1137,7 @@ Presentation.IMAGE_1 = "https://img.alicdn.com/imgextra/i3/O1CN019Ivkor1ksy3pMGD
|
|
|
1133
1137
|
Presentation.IMAGE_2 = "https://img.alicdn.com/imgextra/i1/O1CN01lhSunu1X4VPw1Mlas_!!6000000002870-2-tps-352-158.png";
|
|
1134
1138
|
Presentation.IMAGE_3 = "https://img.alicdn.com/imgextra/i1/O1CN01mreYXo1XfbUsQ7hip_!!6000000002951-2-tps-322-144.png";
|
|
1135
1139
|
Presentation.IMAGE_4 = "https://img.alicdn.com/imgextra/i3/O1CN017gNM8F1Fmmcfti7Dg_!!6000000000530-1-tps-414-286.gif";
|
|
1136
|
-
var index$
|
|
1140
|
+
var index$h = "";
|
|
1137
1141
|
function empty$1() {
|
|
1138
1142
|
}
|
|
1139
1143
|
function List(props) {
|
|
@@ -1179,7 +1183,7 @@ function DefaultItem(props) {
|
|
|
1179
1183
|
}, extra));
|
|
1180
1184
|
}
|
|
1181
1185
|
List.Item = DefaultItem;
|
|
1182
|
-
var index$
|
|
1186
|
+
var index$g = "";
|
|
1183
1187
|
const blankFunc$5 = () => {
|
|
1184
1188
|
};
|
|
1185
1189
|
class BaseLayoutContainer extends React.Component {
|
|
@@ -1521,7 +1525,7 @@ class BaseLayout extends React.Component {
|
|
|
1521
1525
|
return /* @__PURE__ */ React.createElement(BaseLayoutContainer, __spreadValues({}, props));
|
|
1522
1526
|
}
|
|
1523
1527
|
}
|
|
1524
|
-
var index$
|
|
1528
|
+
var index$f = "";
|
|
1525
1529
|
const blankFunc$1 = () => {
|
|
1526
1530
|
};
|
|
1527
1531
|
function Keyborard(props) {
|
|
@@ -1597,6 +1601,351 @@ function WakeKeyborard(props) {
|
|
|
1597
1601
|
}) : null);
|
|
1598
1602
|
}
|
|
1599
1603
|
WakeKeyborard.Keyborard = Keyborard;
|
|
1604
|
+
const classPrefix$3 = "image-uploader";
|
|
1605
|
+
class PreviewItem extends Component {
|
|
1606
|
+
constructor(props) {
|
|
1607
|
+
super(props);
|
|
1608
|
+
this.state = {};
|
|
1609
|
+
}
|
|
1610
|
+
renderDelete() {
|
|
1611
|
+
return /* @__PURE__ */ React.createElement("span", {
|
|
1612
|
+
className: `${classPrefix$3}-cell-delete`,
|
|
1613
|
+
onClick: this.props.onDelete
|
|
1614
|
+
}, /* @__PURE__ */ React.createElement("img", {
|
|
1615
|
+
className: "uploader-delete-icon",
|
|
1616
|
+
alt: "close",
|
|
1617
|
+
src: "https://img.alicdn.com/imgextra/i2/O1CN01MInPNX1FWIOjjrlea_!!6000000000494-2-tps-32-32.png"
|
|
1618
|
+
}));
|
|
1619
|
+
}
|
|
1620
|
+
render() {
|
|
1621
|
+
const { src, deletable, onView, box } = this.props;
|
|
1622
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
1623
|
+
className: "image-space-item"
|
|
1624
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
1625
|
+
className: `${classPrefix$3}-cell`,
|
|
1626
|
+
style: { width: box, height: box }
|
|
1627
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
1628
|
+
className: `${classPrefix$3}-cell-image`,
|
|
1629
|
+
style: { width: box, height: box }
|
|
1630
|
+
}, /* @__PURE__ */ React.createElement("img", {
|
|
1631
|
+
className: `${classPrefix$3}-img`,
|
|
1632
|
+
src,
|
|
1633
|
+
fit: "cover",
|
|
1634
|
+
onClick: onView
|
|
1635
|
+
})), deletable && this.renderDelete()));
|
|
1636
|
+
}
|
|
1637
|
+
}
|
|
1638
|
+
const classPrefix$2 = "image-uploader";
|
|
1639
|
+
class UploadeButton extends Component {
|
|
1640
|
+
constructor(props) {
|
|
1641
|
+
super(props);
|
|
1642
|
+
this.state = {};
|
|
1643
|
+
}
|
|
1644
|
+
render() {
|
|
1645
|
+
const { box } = this.props;
|
|
1646
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
1647
|
+
className: `image-space-item`
|
|
1648
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
1649
|
+
className: `${classPrefix$2}-upload-button-wrap`,
|
|
1650
|
+
onClick: this.props.onUpload
|
|
1651
|
+
}, /* @__PURE__ */ React.createElement("span", {
|
|
1652
|
+
className: `${classPrefix$2}-upload-button image-uploader-cell`,
|
|
1653
|
+
style: { width: box, height: box }
|
|
1654
|
+
}, /* @__PURE__ */ React.createElement("img", {
|
|
1655
|
+
className: "uploader-add-icon",
|
|
1656
|
+
alt: "add",
|
|
1657
|
+
src: "https://img.alicdn.com/imgextra/i1/O1CN01RipHZ11yVyprbUP5B_!!6000000006585-2-tps-32-32.png"
|
|
1658
|
+
}))));
|
|
1659
|
+
}
|
|
1660
|
+
}
|
|
1661
|
+
var index$e = "";
|
|
1662
|
+
const classPrefix$1 = "image-viewer";
|
|
1663
|
+
class ImageViewer extends Component {
|
|
1664
|
+
constructor(props) {
|
|
1665
|
+
super(props);
|
|
1666
|
+
__publicField(this, "onShow", (index2 = 0) => {
|
|
1667
|
+
const { props } = this;
|
|
1668
|
+
let newIdx = 0;
|
|
1669
|
+
if (typeof index2 !== "number") {
|
|
1670
|
+
newIdx = 0;
|
|
1671
|
+
} else {
|
|
1672
|
+
newIdx = index2 > props.images.length - 1 ? 0 : index2;
|
|
1673
|
+
}
|
|
1674
|
+
this.setState({
|
|
1675
|
+
visible: true,
|
|
1676
|
+
currentIndex: newIdx,
|
|
1677
|
+
loading: true
|
|
1678
|
+
});
|
|
1679
|
+
});
|
|
1680
|
+
__publicField(this, "onHide", () => {
|
|
1681
|
+
this.setState({
|
|
1682
|
+
visible: false
|
|
1683
|
+
});
|
|
1684
|
+
});
|
|
1685
|
+
__publicField(this, "handleImageLoaded", (e) => {
|
|
1686
|
+
this.setState({
|
|
1687
|
+
loading: false
|
|
1688
|
+
});
|
|
1689
|
+
});
|
|
1690
|
+
__publicField(this, "onClickMask", (e) => {
|
|
1691
|
+
if (e.target.getAttribute("class") !== "image-viewer-image-wrapper" && e.target.getAttribute("class") !== "image-viewer-loading")
|
|
1692
|
+
return;
|
|
1693
|
+
const { afterClose } = this.props;
|
|
1694
|
+
this.setState({
|
|
1695
|
+
visible: false
|
|
1696
|
+
}, () => {
|
|
1697
|
+
afterClose && afterClose();
|
|
1698
|
+
});
|
|
1699
|
+
});
|
|
1700
|
+
__publicField(this, "onClose", () => {
|
|
1701
|
+
const { onDelete, images } = this.props;
|
|
1702
|
+
const { currentIndex } = this.state;
|
|
1703
|
+
if (images.length === 0) {
|
|
1704
|
+
this.setState({
|
|
1705
|
+
visible: false
|
|
1706
|
+
}, () => {
|
|
1707
|
+
onDelete && onDelete(images[currentIndex], currentIndex);
|
|
1708
|
+
});
|
|
1709
|
+
} else {
|
|
1710
|
+
this.setState({
|
|
1711
|
+
currentIndex: 0,
|
|
1712
|
+
visible: false
|
|
1713
|
+
}, () => {
|
|
1714
|
+
onDelete && onDelete(images[currentIndex], currentIndex);
|
|
1715
|
+
});
|
|
1716
|
+
}
|
|
1717
|
+
});
|
|
1718
|
+
__publicField(this, "onPrev", (e) => {
|
|
1719
|
+
e.stopPropagation();
|
|
1720
|
+
const { currentIndex } = this.state;
|
|
1721
|
+
this.setState({
|
|
1722
|
+
currentIndex: currentIndex - 1,
|
|
1723
|
+
loading: true
|
|
1724
|
+
});
|
|
1725
|
+
});
|
|
1726
|
+
__publicField(this, "onNext", (e) => {
|
|
1727
|
+
e.stopPropagation();
|
|
1728
|
+
const { currentIndex } = this.state;
|
|
1729
|
+
this.setState({
|
|
1730
|
+
currentIndex: currentIndex + 1,
|
|
1731
|
+
loading: true
|
|
1732
|
+
});
|
|
1733
|
+
});
|
|
1734
|
+
this.state = {
|
|
1735
|
+
visible: false,
|
|
1736
|
+
currentIndex: 0,
|
|
1737
|
+
loading: false
|
|
1738
|
+
};
|
|
1739
|
+
}
|
|
1740
|
+
render() {
|
|
1741
|
+
const { currentIndex, visible, loading } = this.state;
|
|
1742
|
+
const { images } = this.props;
|
|
1743
|
+
return /* @__PURE__ */ React.createElement("div", null, visible ? /* @__PURE__ */ React.createElement("div", {
|
|
1744
|
+
className: "v-mask",
|
|
1745
|
+
onClick: this.onClickMask
|
|
1746
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
1747
|
+
className: `v-mask-content`
|
|
1748
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
1749
|
+
className: `${classPrefix$1}-content`
|
|
1750
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
1751
|
+
className: `${classPrefix$1}-slides`
|
|
1752
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
1753
|
+
className: "image-viewer-indicator"
|
|
1754
|
+
}, currentIndex + 1, " / ", images.length), /* @__PURE__ */ React.createElement("div", {
|
|
1755
|
+
className: "viewer-image-close",
|
|
1756
|
+
onClick: this.onClose
|
|
1757
|
+
}, /* @__PURE__ */ React.createElement("svg", {
|
|
1758
|
+
width: "44",
|
|
1759
|
+
height: "44",
|
|
1760
|
+
viewBox: "0 0 768 768"
|
|
1761
|
+
}, /* @__PURE__ */ React.createElement("path", {
|
|
1762
|
+
fill: "#FFF",
|
|
1763
|
+
d: "M607.5 205.5l-178.5 178.5 178.5 178.5-45 45-178.5-178.5-178.5 178.5-45-45 178.5-178.5-178.5-178.5 45-45 178.5 178.5 178.5-178.5z"
|
|
1764
|
+
}))), /* @__PURE__ */ React.createElement("div", {
|
|
1765
|
+
className: "image-viewer-slides-inner"
|
|
1766
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
1767
|
+
className: "image-viewer-image-wrapper"
|
|
1768
|
+
}, /* @__PURE__ */ React.createElement("img", {
|
|
1769
|
+
src: this.props.images[currentIndex].url,
|
|
1770
|
+
style: { width: loading ? 1 : "auto" },
|
|
1771
|
+
onLoad: this.handleImageLoaded
|
|
1772
|
+
}))), images.length > 1 ? /* @__PURE__ */ React.createElement(React.Fragment, null, currentIndex === 0 ? null : /* @__PURE__ */ React.createElement("div", {
|
|
1773
|
+
className: "viewer-image-arrow viewer-prev",
|
|
1774
|
+
onClick: this.onPrev
|
|
1775
|
+
}, /* @__PURE__ */ React.createElement("svg", {
|
|
1776
|
+
width: "44",
|
|
1777
|
+
height: "44",
|
|
1778
|
+
viewBox: "0 0 768 768"
|
|
1779
|
+
}, /* @__PURE__ */ React.createElement("path", {
|
|
1780
|
+
d: "M640.5 352.5v63h-390l178.5 180-45 45-256.5-256.5 256.5-256.5 45 45-178.5 180h390z"
|
|
1781
|
+
}))), currentIndex === images.length - 1 ? null : /* @__PURE__ */ React.createElement("div", {
|
|
1782
|
+
className: "viewer-image-arrow viewer-next",
|
|
1783
|
+
onClick: this.onNext
|
|
1784
|
+
}, /* @__PURE__ */ React.createElement("svg", {
|
|
1785
|
+
width: "44",
|
|
1786
|
+
height: "44",
|
|
1787
|
+
viewBox: "0 0 768 768"
|
|
1788
|
+
}, /* @__PURE__ */ React.createElement("path", {
|
|
1789
|
+
d: "M384 127.5l256.5 256.5-256.5 256.5-45-45 178.5-180h-390v-63h390l-178.5-180z"
|
|
1790
|
+
})))) : null))), loading ? /* @__PURE__ */ React.createElement("div", {
|
|
1791
|
+
className: `${classPrefix$1}-loading`,
|
|
1792
|
+
onClick: this.onClose
|
|
1793
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
1794
|
+
className: `${classPrefix$1}-loading-reactor`
|
|
1795
|
+
}, /* @__PURE__ */ React.createElement("svg", {
|
|
1796
|
+
viewBox: "0 0 32 32",
|
|
1797
|
+
width: "36",
|
|
1798
|
+
height: "36",
|
|
1799
|
+
fill: "white"
|
|
1800
|
+
}, /* @__PURE__ */ React.createElement("path", {
|
|
1801
|
+
opacity: ".25",
|
|
1802
|
+
d: "M16 0 A16 16 0 0 0 16 32 A16 16 0 0 0 16 0 M16 4 A12 12 0 0 1 16 28 A12 12 0 0 1 16 4"
|
|
1803
|
+
}), /* @__PURE__ */ React.createElement("path", {
|
|
1804
|
+
d: "M16 0 A16 16 0 0 1 32 16 L28 16 A12 12 0 0 0 16 4z"
|
|
1805
|
+
})))) : null) : null);
|
|
1806
|
+
}
|
|
1807
|
+
}
|
|
1808
|
+
const classPrefix = "image-uploader";
|
|
1809
|
+
class ImageUploader extends Component {
|
|
1810
|
+
constructor(props) {
|
|
1811
|
+
super(props);
|
|
1812
|
+
__publicField(this, "onViewImage", (index2) => {
|
|
1813
|
+
this.imgRef.onShow(index2);
|
|
1814
|
+
});
|
|
1815
|
+
__publicField(this, "onClickAdd", () => {
|
|
1816
|
+
const { capture } = this.props;
|
|
1817
|
+
const self = this;
|
|
1818
|
+
const isCameraMode = capture && capture === "camera";
|
|
1819
|
+
const params = {
|
|
1820
|
+
type: "0",
|
|
1821
|
+
mode: isCameraMode ? "camera" : "photo"
|
|
1822
|
+
};
|
|
1823
|
+
const p = {
|
|
1824
|
+
ios: "taobao://",
|
|
1825
|
+
android: "com.taobao.taobao"
|
|
1826
|
+
};
|
|
1827
|
+
window.WindVane.call("Base", "isInstall", p, function() {
|
|
1828
|
+
self.handlerUpload(params);
|
|
1829
|
+
}, function() {
|
|
1830
|
+
self.handlerUploadNavigator();
|
|
1831
|
+
});
|
|
1832
|
+
});
|
|
1833
|
+
__publicField(this, "handlerUploadNavigator", () => {
|
|
1834
|
+
const { beforeUpload } = this.props;
|
|
1835
|
+
const dom = document.querySelector("#inputFile");
|
|
1836
|
+
dom.click();
|
|
1837
|
+
dom.onchange = (e) => {
|
|
1838
|
+
let fileData = e.target.files[0];
|
|
1839
|
+
const reader = new FileReader();
|
|
1840
|
+
reader.readAsDataURL(fileData);
|
|
1841
|
+
reader.onload = (event) => {
|
|
1842
|
+
const base64 = event.target.result;
|
|
1843
|
+
beforeUpload && beforeUpload({
|
|
1844
|
+
data: base64
|
|
1845
|
+
});
|
|
1846
|
+
};
|
|
1847
|
+
const windowURL = window.URL || window.webkitURL;
|
|
1848
|
+
const imgSrc = windowURL.createObjectURL(fileData);
|
|
1849
|
+
const { images } = this.state;
|
|
1850
|
+
const uid = (Math.random() * 1e4).toFixed(0);
|
|
1851
|
+
this.setState({
|
|
1852
|
+
images: [...images, { id: uid, url: imgSrc }]
|
|
1853
|
+
});
|
|
1854
|
+
};
|
|
1855
|
+
});
|
|
1856
|
+
__publicField(this, "handlerUpload", (params) => {
|
|
1857
|
+
const { beforeUpload } = this.props;
|
|
1858
|
+
window.WindVane.call("WVCamera", "takePhoto", params, function(e) {
|
|
1859
|
+
const plugin = {
|
|
1860
|
+
domain: "camera",
|
|
1861
|
+
method: "getBase64",
|
|
1862
|
+
params: {
|
|
1863
|
+
filePath: e.localPath
|
|
1864
|
+
}
|
|
1865
|
+
};
|
|
1866
|
+
window.WindVane.call("WindvanePlugin", "invoke", JSON.stringify(plugin), function(res) {
|
|
1867
|
+
beforeUpload && beforeUpload(res.data);
|
|
1868
|
+
}, function(err) {
|
|
1869
|
+
console.log("failure " + JSON.stringify(err));
|
|
1870
|
+
});
|
|
1871
|
+
}, function(err) {
|
|
1872
|
+
console.log("takePhoto failure: " + JSON.stringify(err));
|
|
1873
|
+
});
|
|
1874
|
+
});
|
|
1875
|
+
__publicField(this, "onDelete", (item, index2) => {
|
|
1876
|
+
const { onDelete } = this.props;
|
|
1877
|
+
onDelete && onDelete(item, index2);
|
|
1878
|
+
});
|
|
1879
|
+
__publicField(this, "_showLoading", () => {
|
|
1880
|
+
this.setState({
|
|
1881
|
+
loading: true
|
|
1882
|
+
});
|
|
1883
|
+
});
|
|
1884
|
+
__publicField(this, "_hideLoading", () => {
|
|
1885
|
+
setTimeout(() => {
|
|
1886
|
+
this.setState({
|
|
1887
|
+
loading: false
|
|
1888
|
+
});
|
|
1889
|
+
}, 10 * 1e3);
|
|
1890
|
+
});
|
|
1891
|
+
this.state = {
|
|
1892
|
+
images: [],
|
|
1893
|
+
loading: false
|
|
1894
|
+
};
|
|
1895
|
+
}
|
|
1896
|
+
componentDidMount() {
|
|
1897
|
+
this.setState({
|
|
1898
|
+
images: this.props.value
|
|
1899
|
+
});
|
|
1900
|
+
}
|
|
1901
|
+
render() {
|
|
1902
|
+
const { value, loading = false } = this.props;
|
|
1903
|
+
const { maxCount = 1, deletable = false, capture = "camera", box = 80 } = this.props;
|
|
1904
|
+
const { images } = this.state;
|
|
1905
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", {
|
|
1906
|
+
className: `${classPrefix}`
|
|
1907
|
+
}, /* @__PURE__ */ React.createElement("input", {
|
|
1908
|
+
type: "file",
|
|
1909
|
+
name: "file",
|
|
1910
|
+
accept: "image/*",
|
|
1911
|
+
id: "inputFile",
|
|
1912
|
+
style: { display: "none" }
|
|
1913
|
+
}), /* @__PURE__ */ React.createElement("div", {
|
|
1914
|
+
className: `${classPrefix}-wrap`
|
|
1915
|
+
}, images && images.map((item, index2) => {
|
|
1916
|
+
return /* @__PURE__ */ React.createElement(PreviewItem, {
|
|
1917
|
+
src: item.url,
|
|
1918
|
+
key: item.url,
|
|
1919
|
+
box,
|
|
1920
|
+
deletable,
|
|
1921
|
+
onDelete: () => this.onDelete(item, index2),
|
|
1922
|
+
onView: () => this.onViewImage(index2)
|
|
1923
|
+
});
|
|
1924
|
+
}), images && images.length < maxCount ? /* @__PURE__ */ React.createElement(UploadeButton, {
|
|
1925
|
+
box,
|
|
1926
|
+
onUpload: this.onClickAdd
|
|
1927
|
+
}) : null)), loading ? /* @__PURE__ */ React.createElement("div", {
|
|
1928
|
+
className: `${classPrefix}-loading`
|
|
1929
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
1930
|
+
className: `${classPrefix}-loading-reactor`
|
|
1931
|
+
}, /* @__PURE__ */ React.createElement("svg", {
|
|
1932
|
+
viewBox: "0 0 32 32",
|
|
1933
|
+
width: "36",
|
|
1934
|
+
height: "36",
|
|
1935
|
+
fill: "white"
|
|
1936
|
+
}, /* @__PURE__ */ React.createElement("path", {
|
|
1937
|
+
opacity: ".25",
|
|
1938
|
+
d: "M16 0 A16 16 0 0 0 16 32 A16 16 0 0 0 16 0 M16 4 A12 12 0 0 1 16 28 A12 12 0 0 1 16 4"
|
|
1939
|
+
}), /* @__PURE__ */ React.createElement("path", {
|
|
1940
|
+
d: "M16 0 A16 16 0 0 1 32 16 L28 16 A12 12 0 0 0 16 4z"
|
|
1941
|
+
})))) : null, /* @__PURE__ */ React.createElement(ImageViewer, {
|
|
1942
|
+
ref: (ref) => this.imgRef = ref,
|
|
1943
|
+
images: value,
|
|
1944
|
+
onDelete: this.onDelete
|
|
1945
|
+
}));
|
|
1946
|
+
}
|
|
1947
|
+
}
|
|
1948
|
+
var index$d = "";
|
|
1600
1949
|
var index$c = "";
|
|
1601
1950
|
var index$b = "";
|
|
1602
1951
|
class PdaInfoCard$1 extends React.Component {
|
|
@@ -1816,7 +2165,7 @@ function usePersistFn(fn) {
|
|
|
1816
2165
|
}
|
|
1817
2166
|
return persistFn.current;
|
|
1818
2167
|
}
|
|
1819
|
-
var __awaiter =
|
|
2168
|
+
var __awaiter = function(thisArg, _arguments, P, generator) {
|
|
1820
2169
|
function adopt(value) {
|
|
1821
2170
|
return value instanceof P ? value : new P(function(resolve) {
|
|
1822
2171
|
resolve(value);
|
|
@@ -1843,7 +2192,7 @@ var __awaiter = globalThis && globalThis.__awaiter || function(thisArg, _argumen
|
|
|
1843
2192
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
1844
2193
|
});
|
|
1845
2194
|
};
|
|
1846
|
-
var __generator =
|
|
2195
|
+
var __generator = function(thisArg, body) {
|
|
1847
2196
|
var _ = {
|
|
1848
2197
|
label: 0,
|
|
1849
2198
|
sent: function sent() {
|
|
@@ -1935,7 +2284,7 @@ var __generator = globalThis && globalThis.__generator || function(thisArg, body
|
|
|
1935
2284
|
};
|
|
1936
2285
|
}
|
|
1937
2286
|
};
|
|
1938
|
-
var __read =
|
|
2287
|
+
var __read = function(o, n) {
|
|
1939
2288
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
1940
2289
|
if (!m)
|
|
1941
2290
|
return o;
|
|
@@ -1959,7 +2308,7 @@ var __read = globalThis && globalThis.__read || function(o, n) {
|
|
|
1959
2308
|
}
|
|
1960
2309
|
return ar;
|
|
1961
2310
|
};
|
|
1962
|
-
var __spread =
|
|
2311
|
+
var __spread = function() {
|
|
1963
2312
|
for (var ar = [], i = 0; i < arguments.length; i++) {
|
|
1964
2313
|
ar = ar.concat(__read(arguments[i]));
|
|
1965
2314
|
}
|
|
@@ -2208,4 +2557,4 @@ function SimpleCardBlock(props) {
|
|
|
2208
2557
|
})) : null);
|
|
2209
2558
|
}
|
|
2210
2559
|
const ListItem = PdaListItem;
|
|
2211
|
-
export { ActionSheet, index$5 as AppList, BaseLayout, Button, Confirm, PdaDistanceCard as DistanceCard, PdaFinishCard as FinishCard, index$
|
|
2560
|
+
export { ActionSheet, index$5 as AppList, BaseLayout, Button, Confirm, PdaDistanceCard as DistanceCard, PdaFinishCard as FinishCard, index$s as Header, ImageUploader, ImageViewer, InfiniteScroll, PdaInfoCard$2 as InfoCard, Keyborard, List, ListItem, Overlay$1 as Overlay, index$j as PageFlowSystemPages, Presentation, SelectCard, SimpleCard, SimpleCardBlock, PdaInfoCard as Steps, SubCard, Tag, PdaListItem as TaskCard, PdaTitle as Title, Toast, WakeKeyborard };
|