@cniot/android-pda-components 0.0.14 → 0.0.18
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.a895b4e7.css +1 -0
- package/build/assets/index.f8af1049.js +279 -0
- package/build/assets/vendor.9e71866b.js +38 -0
- package/build/index.html +4 -4
- package/doc/index.jsx +24 -0
- package/es/index.cjs.js +2 -4
- package/es/index.es.js +1552 -2
- package/es/style.css +1 -1
- package/package.json +2 -1
- package/build/assets/index.77d75e9e.js +0 -1
- package/build/assets/index.c65987ea.css +0 -1
- package/build/assets/vendor.dd3aae6b.js +0 -33
package/es/index.es.js
CHANGED
|
@@ -1,7 +1,1557 @@
|
|
|
1
|
-
var
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
17
|
+
var __publicField = (obj, key, value) => {
|
|
18
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
19
|
+
return value;
|
|
20
|
+
};
|
|
21
|
+
import React, { useState, useEffect, cloneElement, useRef, useCallback } from "react";
|
|
22
|
+
var index$j = "";
|
|
23
|
+
function getTypeClass$1(type) {
|
|
24
|
+
return {
|
|
25
|
+
"center": "op-overlay center",
|
|
26
|
+
"top": "op-overlay top",
|
|
27
|
+
"bottom": "op-overlay bottom"
|
|
28
|
+
}[type] || "op-overlay";
|
|
29
|
+
}
|
|
30
|
+
function Overlay(props) {
|
|
31
|
+
const { verticalPosition = "center", visible = true, closable = false, onClosed = () => {
|
|
32
|
+
} } = props;
|
|
33
|
+
const [hidden, setHidden] = useState(!visible);
|
|
34
|
+
const option = {};
|
|
35
|
+
if (closable) {
|
|
36
|
+
option.onClick = (e) => {
|
|
37
|
+
setHidden(true);
|
|
38
|
+
onClosed();
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
setHidden(!visible);
|
|
43
|
+
}, [visible]);
|
|
44
|
+
return !hidden ? /* @__PURE__ */ React.createElement("div", __spreadValues({
|
|
45
|
+
className: getTypeClass$1(verticalPosition)
|
|
46
|
+
}, option), props.children) : null;
|
|
47
|
+
}
|
|
48
|
+
var index$i = "";
|
|
49
|
+
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
50
|
+
var classnames = { exports: {} };
|
|
2
51
|
/*!
|
|
3
52
|
Copyright (c) 2018 Jed Watson.
|
|
4
53
|
Licensed under the MIT License (MIT), see
|
|
5
54
|
http://jedwatson.github.io/classnames
|
|
6
55
|
*/
|
|
7
|
-
a=r,function(){var e={}.hasOwnProperty;function t(){for(var n=[],a=0;a<arguments.length;a++){var r=arguments[a];if(r){var s=typeof r;if("string"===s||"number"===s)n.push(r);else if(Array.isArray(r)){if(r.length){var l=t.apply(null,r);l&&n.push(l)}}else if("object"===s)if(r.toString===Object.prototype.toString)for(var c in r)e.call(r,c)&&r[c]&&n.push(c);else n.push(r.toString())}}return n.join(" ")}a.exports?(t.default=t,a.exports=t):window.classNames=t}();var s=r.exports;const l=()=>{};class c extends n.Component{constructor(e){super(e)}render(){const{className:e,goBack:t=!0,goBackHandle:a=l,icon:r="scan",title:c="任务",more:i=!1}=this.props;return n.createElement("div",{className:s({[e]:!0,"pda-header":!0})},t&&n.createElement("div",{className:"pda-goback",onClick:a}),r&&n.createElement("div",{className:s({"pda-header-icon":!0,["pda-header-icon-"+r]:!0})}),n.createElement("p",{className:s({"pda-title-text":!0})},c),i&&n.createElement("div",{className:"pda-header-more"}))}}class i extends n.Component{render(){const{type:e="default",width:t,style:a={},onClick:r}=this.props;t&&(a.width=t);let l="pda-button-"+e;return n.createElement("button",{className:s({className:!0,"pda-button":!0,[l]:!0}),style:a,onClick:r},this.props.children)}}class o extends n.Component{render(){return n.createElement("div",{className:s({"button-group":!0})},this.props.children)}}i.Group=o;class u extends n.Component{constructor(e){super(e)}render(){const{className:e,title:t,highlightInfo:a,highlightInfoCN:r,highlightSubInfo:l,highlightSubInfoCN:c,boldInfo:i,infoList:o=[],style:u={},theme:m="light"}=this.props;return n.createElement("div",{className:s({[e]:!0,"pda-info-card":!0,"pda-info-card-dark":"dark"===m}),style:u},n.createElement("p",{className:"pda-info-card-title"},t),n.createElement("p",{className:"pda-info-card-highlight"},n.createElement("span",{className:"pda-info-card-highlight1"},a),n.createElement("span",{className:"pda-info-card-highlight1CN"},r),n.createElement("span",{className:"pda-info-card-highlight2"},l),n.createElement("span",{className:"pda-info-card-highlight2CN"},c)),n.createElement("p",{className:"pda-info-card-bold"},i),o.map(((e,t)=>n.createElement("p",{key:t,className:"pda-info-card-list"},n.createElement("span",null,e.label||"")," ",n.createElement("span",null,e.content||"")))))}}class m extends n.Component{constructor(e){super(e)}render(){const{className:e,header:t,highlightText:a,highlightSubText:r,stateTextList:l=[],stateList:c=[],subInfoList:i=[],style:o={},icon:u}=this.props;return n.createElement("div",{className:s({[e]:!0,"pda-list-item":!0}),style:o},n.createElement("p",{className:"pda-listitem-header"},t),n.createElement("p",{className:"pda-listitem-highlight"},n.createElement("span",null,a),n.createElement("span",null,r)),n.createElement("p",{className:"pda-listitem-state-text"},l.map(((e,t)=>n.createElement("span",{key:t},e.label||"","|")))),n.createElement("div",{className:"pda-listitem-state-block"},c.map(((e,t)=>{const a=(null==e?void 0:e.type)?e.type:"default";return n.createElement("div",{key:t,className:a},e.label||"")}))),i.map(((e,t)=>n.createElement("p",{key:t,className:"pda-listitem-subinfo"},n.createElement("span",null,e.label||"")," ",n.createElement("span",null,e.content||"")))),u?n.createElement("div",{className:"pda-listitem-icon"},n.createElement("div",{className:s({"listitem-icon-container":!0,["listitem-icon-"+u]:!0})})):null)}}function p(){}function d(e){const{title:t="title",message:a="message",okText:r="okText",cancelText:s="cancelText",onClick:l=p}=e;return n.createElement("div",{className:"confirm-wrap"},n.createElement("div",{className:"confirm-title"},t),n.createElement("div",{className:"confirm-message"},a),n.createElement("div",{className:"confirm-btns"},s?n.createElement(i,{onClick:()=>l(!1)},s):null,n.createElement(i,{type:"primary",onClick:()=>l(!0)},r)))}function f(e){return{success:"toast-wrap success",warning:"toast-wrap warning",error:"toast-wrap error"}[e]||"toast-wrap"}function h(e){const{title:t="title",message:a="message",type:r="success"}=e;return n.createElement("div",{className:f(r)},n.createElement("div",{className:"toast-title"},t),n.createElement("div",{className:"toast-message"},a))}function v(e){const{verticalPosition:t="center"}=e;return n.createElement("div",{className:(a=t,{center:"op-overlay center",top:"op-overlay top",bottom:"op-overlay bottom"}[a]||"op-overlay")},e.children);var a}function g(e){var t=String(e).split("by Error:");return t[1]||t[0]}function E(){return(E=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}var b,y=b||(b={});y.Pop="POP",y.Push="PUSH",y.Replace="REPLACE";function N(e){e.preventDefault(),e.returnValue=""}function k(){var e=[];return{get length(){return e.length},push:function(t){return e.push(t),function(){e=e.filter((function(e){return e!==t}))}},call:function(t){e.forEach((function(e){return e&&e(t)}))}}}function x(e){var t=e.pathname,n=e.search;return(void 0===t?"/":t)+(void 0===n?"":n)+(void 0===(e=e.hash)?"":e)}function C(e){var t={};if(e){var n=e.indexOf("#");0<=n&&(t.hash=e.substr(n),e=e.substr(0,n)),0<=(n=e.indexOf("?"))&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}var I={Alert:function(e){const{service:t,data:a={}}=e,{title:r="title",message:s="message",okText:l="okText",cancelText:c=""}=a,i=n.useCallback((function(){t.onNext(!0)}),[t]);return n.createElement(v,{verticalPosition:"bottom"},n.createElement(d,{title:r,message:s,okText:l,cancelText:c,onClick:i}))},Start:function(e){const{action:t,appManager:a,service:r}=e,s=n.useCallback((function(){r.onStart(a.config.appId)}));return n.createElement("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",width:"100vw",height:"100vh"}},n.createElement(i,{type:"primary",onClick:s},"开始作业"),n.createElement("br",null),n.createElement("div",null,a.config.appId),n.createElement("div",null,a.config.groupId))},Toast:function(e){const{data:t={},service:a}=e,{title:r,level:s,message:l}=t;return n.useEffect((()=>{!1!==t.hasNext&&a.onNext("")}),[t,a]),n.createElement(v,{verticalPosition:"bottom"},n.createElement(h,{type:s,title:r,message:g(l)}))},Confirm:function(e){const{service:t,data:a={}}=e,{title:r="title",message:s="message",okText:l="okText",cancelText:c=""}=a,i=n.useCallback((function(e){t.onNext(e)}),[t]);return n.createElement(v,{verticalPosition:"bottom"},n.createElement(d,{title:r,message:s,okText:l,cancelText:c,onClick:i}))},NotFound:function(e){return n.createElement("div",{style:{padding:"20%"}},n.createElement("h1",null,"404 ",n.createElement("small",{style:{fontSize:"60%"}},"Not found")),n.createElement("div",null,e.action.getPage()))},Debug:function(e){const{appManager:t}=e,a=Array.from(t.pageManager.keys()).reverse();return n.useEffect((function(){return function(e){function t(){var e=C(c.location.hash.substr(1)),t=e.pathname,n=e.search;e=e.hash;var a=i.state||{};return[a.idx,{pathname:void 0===t?"/":t,search:void 0===n?"":n,hash:void 0===e?"":e,state:a.usr||null,key:a.key||"default"}]}function n(){if(o)f.call(o),o=null;else{var e=b.Pop,n=t(),a=n[0];if(n=n[1],f.length){if(null!=a){var r=m-a;r&&(o={action:e,location:n,retry:function(){l(-1*r)}},l(r))}}else s(e)}}function a(e){var t=document.querySelector("base"),n="";return t&&t.getAttribute("href")&&(n=-1===(n=(t=c.location.href).indexOf("#"))?t:t.slice(0,n)),n+"#"+("string"==typeof e?e:x(e))}function r(e,t){return void 0===t&&(t=null),E({},p,"string"==typeof e?C(e):e,{state:t,key:Math.random().toString(36).substr(2,8)})}function s(e){u=e,e=t(),m=e[0],p=e[1],d.call({action:u,location:p})}function l(e){i.go(e)}void 0===e&&(e={});var c=void 0===(e=e.window)?document.defaultView:e,i=c.history,o=null;c.addEventListener("popstate",n),c.addEventListener("hashchange",(function(){x(t()[1])!==x(p)&&n()}));var u=b.Pop,m=(e=t())[0],p=e[1],d=k(),f=k();return null==m&&(m=0,i.replaceState(E({},i.state,{idx:m}),"")),{get action(){return u},get location(){return p},createHref:a,push:function e(t,n){var l=b.Push,o=r(t,n);if(!f.length||(f.call({action:l,location:o,retry:function(){e(t,n)}}),0)){var u=[{usr:o.state,key:o.key,idx:m+1},a(o)];o=u[0],u=u[1];try{i.pushState(o,"",u)}catch(p){c.location.assign(u)}s(l)}},replace:function e(t,n){var l=b.Replace,c=r(t,n);f.length&&(f.call({action:l,location:c,retry:function(){e(t,n)}}),1)||(c=[{usr:c.state,key:c.key,idx:m},a(c)],i.replaceState(c[0],"",c[1]),s(l))},go:l,back:function(){l(-1)},forward:function(){l(1)},listen:function(e){return d.push(e)},block:function(e){var t=f.push(e);return 1===f.length&&c.addEventListener("beforeunload",N),function(){t(),f.length||c.removeEventListener("beforeunload",N)}}}}().listen((({action:e,location:n})=>{const a=n.pathname;t.mockToPage(a,{})}))}),[]),n.createElement("div",{className:"local-debug-side"},n.createElement("ul",null,a.map((e=>n.createElement("li",{key:e},n.createElement("a",{href:`#${e}`},e))))))},Prompt:function(e){return n.createElement("div",null,"页面不存在")},Loading:function(e){const[t,a]=n.useState(!1),r=e.edgeService;return n.useEffect((function(){let e=!1;const t=function(t){e=t,t?setTimeout((function(){e===t&&a(!0)}),350):setTimeout((function(){e===t&&a(!1)}),100)};return r.on("IO_STATUS",t),function(){r.off("IO_STATUS",t)}}),[r]),t?n.createElement("div",{style:{position:"absolute",left:0,top:0,zIndex:100}},"LOADING..."):null}};function T(e){const{image:t=T.IMAGE_1,text:a="",subText:r="",transparent:s}=e;return n.createElement("div",{className:s?"presentation-card transparent":"presentation-card"},n.createElement("img",{src:t}),a?n.createElement("div",{className:"text"},a):null,r?n.createElement("div",{className:"sub-text"},r):null)}T.IMAGE_1="https://img.alicdn.com/imgextra/i3/O1CN019Ivkor1ksy3pMGDsz_!!6000000004740-2-tps-280-322.png",T.IMAGE_2="https://img.alicdn.com/imgextra/i1/O1CN01lhSunu1X4VPw1Mlas_!!6000000002870-2-tps-352-158.png",T.IMAGE_3="https://img.alicdn.com/imgextra/i1/O1CN01mreYXo1XfbUsQ7hip_!!6000000002951-2-tps-322-144.png";function w(){}function S(e){const{tabIndex:t=1,onItemClick:a=w}=e;return n.createElement("div",{className:"android-pda-list"},n.Children.map(e.children,((e,r)=>{const s=e.props.onClick;return n.cloneElement(e,Object.assign({tabIndex:t+r},e.props,{onClick:e=>{s&&s(e),a(e)}}),e.props.children)})))}S.Item=function(e){const{onClick:t,title:a,subTitle:r,extra:s,tags:l=[],tabIndex:c}=e;return n.createElement("div",{className:"default-item",onClick:()=>{t(e)},tabIndex:c},n.createElement("div",{className:"text"},n.createElement("div",null,a),n.createElement("div",{className:"sub-text"},r),n.createElement("div",{className:"sub-tags"},l.map((e=>n.createElement("div",{className:"sub-tag-item"},e))))),n.createElement("div",{className:"extra"},s))};class P extends n.Component{constructor(e){super(e)}render(){const{style:e={},header:t,footer:a}=this.props;return n.createElement("div",{className:s({"baselayout-wrapper":!0}),style:e},t&&n.createElement("div",{className:s({"baselayout-header":!0})},t),n.createElement("div",{className:s({"baselayout-container":!0})},this.props.children),a&&n.createElement("div",{className:s({"baselayout-footer":!0})},a))}}const O=()=>{};class A extends n.Component{constructor(){super(...arguments),t(this,"state",{inputVisible:!1}),t(this,"_useInput",null)}render(){const{inputVisible:e}=this.state,{onWakeKeyboard:t=O,onClick:a=O}=this.props;return n.createElement("div",{className:"wakekeyborard"},e?n.createElement("div",{className:"wakekeyborard-overlay"},n.createElement("div",{className:"wakekeyborard-inputbox"},n.createElement("input",{ref:e=>{this._useInput=e},type:"tel"}),n.createElement(i,{type:"primary",onClick:t=>{a(this._useInput.value),this.setState({inputVisible:!e})}},"查询"))):null,e?null:n.createElement("div",{className:"wakekeyborard-icon",onClick:n=>{this.setState({inputVisible:!e}),requestAnimationFrame((()=>{this._useInput.focus(),t()}))}}))}}export{P as BaseLayout,i as Button,d as Confirm,u as InfoCard,S as List,m as ListItem,v as Overlay,I as PageFlowSystemPages,T as Presentation,c as Title,h as Toast,A as WakeKeyborard};
|
|
56
|
+
(function(module) {
|
|
57
|
+
(function() {
|
|
58
|
+
var hasOwn = {}.hasOwnProperty;
|
|
59
|
+
function classNames2() {
|
|
60
|
+
var classes = [];
|
|
61
|
+
for (var i = 0; i < arguments.length; i++) {
|
|
62
|
+
var arg = arguments[i];
|
|
63
|
+
if (!arg)
|
|
64
|
+
continue;
|
|
65
|
+
var argType = typeof arg;
|
|
66
|
+
if (argType === "string" || argType === "number") {
|
|
67
|
+
classes.push(arg);
|
|
68
|
+
} else if (Array.isArray(arg)) {
|
|
69
|
+
if (arg.length) {
|
|
70
|
+
var inner = classNames2.apply(null, arg);
|
|
71
|
+
if (inner) {
|
|
72
|
+
classes.push(inner);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
} else if (argType === "object") {
|
|
76
|
+
if (arg.toString === Object.prototype.toString) {
|
|
77
|
+
for (var key in arg) {
|
|
78
|
+
if (hasOwn.call(arg, key) && arg[key]) {
|
|
79
|
+
classes.push(key);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
} else {
|
|
83
|
+
classes.push(arg.toString());
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return classes.join(" ");
|
|
88
|
+
}
|
|
89
|
+
if (module.exports) {
|
|
90
|
+
classNames2.default = classNames2;
|
|
91
|
+
module.exports = classNames2;
|
|
92
|
+
} else {
|
|
93
|
+
window.classNames = classNames2;
|
|
94
|
+
}
|
|
95
|
+
})();
|
|
96
|
+
})(classnames);
|
|
97
|
+
var classNames = classnames.exports;
|
|
98
|
+
class Button extends React.Component {
|
|
99
|
+
render() {
|
|
100
|
+
const { type = "default", width, style = {}, onClick, className } = this.props;
|
|
101
|
+
if (width)
|
|
102
|
+
style.width = width;
|
|
103
|
+
let buttonType = "pda-button-" + type;
|
|
104
|
+
return /* @__PURE__ */ React.createElement("button", {
|
|
105
|
+
className: classNames({ [className]: true, "pda-button": true, [buttonType]: true }),
|
|
106
|
+
style,
|
|
107
|
+
onClick
|
|
108
|
+
}, this.props.children);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
class ButtonGroup extends React.Component {
|
|
112
|
+
render() {
|
|
113
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
114
|
+
className: classNames({ "button-group": true })
|
|
115
|
+
}, this.props.children);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
Button.Group = ButtonGroup;
|
|
119
|
+
var index$h = "";
|
|
120
|
+
const blankFunc$1 = () => {
|
|
121
|
+
};
|
|
122
|
+
class PdaTitle extends React.Component {
|
|
123
|
+
constructor(props) {
|
|
124
|
+
super(props);
|
|
125
|
+
__publicField(this, "state", {
|
|
126
|
+
showMenu: false
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
render() {
|
|
130
|
+
const { className, goBack = true, goBackHandle = blankFunc$1, icon = "scan", title = "\u4EFB\u52A1", menuList = null } = this.props;
|
|
131
|
+
const { showMenu } = this.state;
|
|
132
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
133
|
+
className: classNames({ [className]: true, "pda-header": true })
|
|
134
|
+
}, goBack && /* @__PURE__ */ React.createElement("div", {
|
|
135
|
+
className: "pda-goback",
|
|
136
|
+
onClick: goBackHandle
|
|
137
|
+
}), icon && /* @__PURE__ */ React.createElement("div", {
|
|
138
|
+
className: classNames({ "pda-header-icon": true, ["pda-header-icon-" + icon]: true })
|
|
139
|
+
}), /* @__PURE__ */ React.createElement("p", {
|
|
140
|
+
className: classNames({ "pda-title-text": true })
|
|
141
|
+
}, title), menuList ? /* @__PURE__ */ React.createElement("div", {
|
|
142
|
+
className: "pda-header-more",
|
|
143
|
+
onClick: (e) => {
|
|
144
|
+
this.setState({ showMenu: true });
|
|
145
|
+
}
|
|
146
|
+
}) : null, /* @__PURE__ */ React.createElement(Overlay, {
|
|
147
|
+
visible: showMenu,
|
|
148
|
+
verticalPosition: "bottom",
|
|
149
|
+
closable: true,
|
|
150
|
+
onClosed: (e) => this.setState({ showMenu: false })
|
|
151
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
152
|
+
className: "pda-menus"
|
|
153
|
+
}, menuList)));
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
var index$g = "";
|
|
157
|
+
class PdaInfoCard$2 extends React.Component {
|
|
158
|
+
constructor(props) {
|
|
159
|
+
super(props);
|
|
160
|
+
}
|
|
161
|
+
render() {
|
|
162
|
+
const { className, title, highlightInfo, infoImage, tagText, highlightInfoCN, highlightSubInfo, percentage, highlightSubInfoCN, boldInfo, infoList = [], style = {}, theme = "light" } = this.props;
|
|
163
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
164
|
+
className: classNames({ [className]: true, "pda-info-card": true, "pda-info-card-dark": theme === "dark" }),
|
|
165
|
+
style
|
|
166
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
167
|
+
className: "pda-info-card-title-section"
|
|
168
|
+
}, /* @__PURE__ */ React.createElement("p", {
|
|
169
|
+
className: "pda-info-card-title"
|
|
170
|
+
}, title), tagText ? /* @__PURE__ */ React.createElement("div", {
|
|
171
|
+
className: "pda-info-card-tag"
|
|
172
|
+
}, /* @__PURE__ */ React.createElement("p", {
|
|
173
|
+
className: "pda-info-card-tag-text"
|
|
174
|
+
}, tagText)) : null), /* @__PURE__ */ React.createElement("div", {
|
|
175
|
+
className: "pda-info-card-highlight-section"
|
|
176
|
+
}, /* @__PURE__ */ React.createElement("p", {
|
|
177
|
+
className: "pda-info-card-highlight"
|
|
178
|
+
}, /* @__PURE__ */ React.createElement("span", {
|
|
179
|
+
className: "pda-info-card-highlight1"
|
|
180
|
+
}, highlightInfo), /* @__PURE__ */ React.createElement("span", {
|
|
181
|
+
className: "pda-info-card-highlight1CN"
|
|
182
|
+
}, highlightInfoCN), /* @__PURE__ */ React.createElement("span", {
|
|
183
|
+
className: "pda-info-card-highlight2"
|
|
184
|
+
}, highlightSubInfo), /* @__PURE__ */ React.createElement("span", {
|
|
185
|
+
className: "pda-info-card-highlight2CN"
|
|
186
|
+
}, highlightSubInfoCN)), infoImage ? /* @__PURE__ */ React.createElement("img", {
|
|
187
|
+
src: infoImage,
|
|
188
|
+
width: 150,
|
|
189
|
+
height: 150
|
|
190
|
+
}) : null), percentage !== void 0 ? /* @__PURE__ */ React.createElement("div", {
|
|
191
|
+
className: "pda-info-card-progress"
|
|
192
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
193
|
+
className: "pda-info-card-progress-inside",
|
|
194
|
+
style: { width: `${percentage * 100}%` }
|
|
195
|
+
})) : null, /* @__PURE__ */ React.createElement("p", {
|
|
196
|
+
className: "pda-info-card-bold"
|
|
197
|
+
}, boldInfo), infoList.map((item, index2) => {
|
|
198
|
+
return /* @__PURE__ */ React.createElement("p", {
|
|
199
|
+
key: index2,
|
|
200
|
+
className: "pda-info-card-list"
|
|
201
|
+
}, /* @__PURE__ */ React.createElement("span", null, item.label || ""), "\xA0\xA0", /* @__PURE__ */ React.createElement("span", null, item.content || ""));
|
|
202
|
+
}));
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
PdaInfoCard$2.IMAGE_1 = "https://img.alicdn.com/imgextra/i2/O1CN01qYuxip1ME9zhdL9XG_!!6000000001402-2-tps-150-150.png";
|
|
206
|
+
var index$f = "";
|
|
207
|
+
class PdaListItem extends React.Component {
|
|
208
|
+
constructor(props) {
|
|
209
|
+
super(props);
|
|
210
|
+
}
|
|
211
|
+
render() {
|
|
212
|
+
const { className, header, onHeightLightClick = () => {
|
|
213
|
+
}, onIconClick = () => {
|
|
214
|
+
}, highlightText, highlightSubText, stateTextList = [], stateList = [], subInfoList = [], style = {}, icon } = this.props;
|
|
215
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
216
|
+
className: classNames({ [className]: true, "pda-list-item": true }),
|
|
217
|
+
style
|
|
218
|
+
}, /* @__PURE__ */ React.createElement("p", {
|
|
219
|
+
className: "pda-listitem-header"
|
|
220
|
+
}, header), /* @__PURE__ */ React.createElement("p", {
|
|
221
|
+
onClick: onHeightLightClick,
|
|
222
|
+
className: "pda-listitem-highlight"
|
|
223
|
+
}, /* @__PURE__ */ React.createElement("span", null, highlightText), /* @__PURE__ */ React.createElement("span", null, highlightSubText)), /* @__PURE__ */ React.createElement("p", {
|
|
224
|
+
className: "pda-listitem-state-text"
|
|
225
|
+
}, stateTextList.map((item, index2) => {
|
|
226
|
+
return /* @__PURE__ */ React.createElement("span", {
|
|
227
|
+
key: index2
|
|
228
|
+
}, item.label || "", "\uFF5C");
|
|
229
|
+
})), /* @__PURE__ */ React.createElement("div", {
|
|
230
|
+
className: "pda-listitem-state-block"
|
|
231
|
+
}, stateList.map((item, index2) => {
|
|
232
|
+
const type = (item == null ? void 0 : item.type) ? item.type : "default";
|
|
233
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
234
|
+
key: index2,
|
|
235
|
+
className: type
|
|
236
|
+
}, item.label || "");
|
|
237
|
+
})), subInfoList.map((item, index2) => {
|
|
238
|
+
return /* @__PURE__ */ React.createElement("p", {
|
|
239
|
+
key: index2,
|
|
240
|
+
className: "pda-listitem-subinfo"
|
|
241
|
+
}, /* @__PURE__ */ React.createElement("span", null, item.label || ""), "\xA0\xA0", /* @__PURE__ */ React.createElement("span", null, item.content || ""));
|
|
242
|
+
}), icon ? /* @__PURE__ */ React.createElement("div", {
|
|
243
|
+
onClick: onIconClick,
|
|
244
|
+
className: "pda-listitem-icon"
|
|
245
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
246
|
+
className: classNames({ "listitem-icon-container": true, ["listitem-icon-" + icon]: true })
|
|
247
|
+
})) : null);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
var index$e = "";
|
|
251
|
+
function empty$1() {
|
|
252
|
+
}
|
|
253
|
+
function Confirm$1(props) {
|
|
254
|
+
const { title = "title", message = "message", okText = "okText", cancelText = "cancelText", onClick = empty$1 } = props;
|
|
255
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
256
|
+
className: "confirm-wrap"
|
|
257
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
258
|
+
className: "confirm-title"
|
|
259
|
+
}, title), /* @__PURE__ */ React.createElement("div", {
|
|
260
|
+
className: "confirm-message"
|
|
261
|
+
}, message), /* @__PURE__ */ React.createElement("div", {
|
|
262
|
+
className: "confirm-btns"
|
|
263
|
+
}, cancelText ? /* @__PURE__ */ React.createElement(Button, {
|
|
264
|
+
className: "confirm-cancel-button",
|
|
265
|
+
onClick: () => onClick(false)
|
|
266
|
+
}, cancelText) : null, /* @__PURE__ */ React.createElement(Button, {
|
|
267
|
+
type: "primary",
|
|
268
|
+
onClick: () => onClick(true)
|
|
269
|
+
}, okText)));
|
|
270
|
+
}
|
|
271
|
+
var index$d = "";
|
|
272
|
+
function getTypeClass(type) {
|
|
273
|
+
return {
|
|
274
|
+
"success": "toast-wrap success",
|
|
275
|
+
"warning": "toast-wrap warning",
|
|
276
|
+
"error": "toast-wrap error"
|
|
277
|
+
}[type] || "toast-wrap";
|
|
278
|
+
}
|
|
279
|
+
function Confirm(props) {
|
|
280
|
+
const { title = "title", message = "message", type = "success", duration = null } = props;
|
|
281
|
+
const [hidden, setHidden] = useState(false);
|
|
282
|
+
if (duration) {
|
|
283
|
+
setTimeout(() => {
|
|
284
|
+
setHidden(true);
|
|
285
|
+
}, duration);
|
|
286
|
+
}
|
|
287
|
+
return !hidden ? /* @__PURE__ */ React.createElement("div", {
|
|
288
|
+
className: getTypeClass(type)
|
|
289
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
290
|
+
className: "toast-title"
|
|
291
|
+
}, title), /* @__PURE__ */ React.createElement("div", {
|
|
292
|
+
className: "toast-message"
|
|
293
|
+
}, message)) : null;
|
|
294
|
+
}
|
|
295
|
+
function Alert(props) {
|
|
296
|
+
const { service, data = {} } = props;
|
|
297
|
+
const { title = "title", message = "message", okText = "okText", cancelText = "" } = data;
|
|
298
|
+
const onClickCallback = React.useCallback(function() {
|
|
299
|
+
service.onNext(true);
|
|
300
|
+
}, [service]);
|
|
301
|
+
return /* @__PURE__ */ React.createElement(Overlay, {
|
|
302
|
+
verticalPosition: "bottom"
|
|
303
|
+
}, /* @__PURE__ */ React.createElement(Confirm$1, {
|
|
304
|
+
title,
|
|
305
|
+
message,
|
|
306
|
+
okText,
|
|
307
|
+
cancelText,
|
|
308
|
+
onClick: onClickCallback
|
|
309
|
+
}));
|
|
310
|
+
}
|
|
311
|
+
function Start(props) {
|
|
312
|
+
const { action, appManager, service } = props;
|
|
313
|
+
const onReStart = React.useCallback(function() {
|
|
314
|
+
service.onStart(appManager.config.appId);
|
|
315
|
+
});
|
|
316
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
317
|
+
style: {
|
|
318
|
+
display: "flex",
|
|
319
|
+
flexDirection: "column",
|
|
320
|
+
justifyContent: "center",
|
|
321
|
+
alignItems: "center",
|
|
322
|
+
width: "100vw",
|
|
323
|
+
height: "100vh"
|
|
324
|
+
}
|
|
325
|
+
}, /* @__PURE__ */ React.createElement(Button, {
|
|
326
|
+
type: "primary",
|
|
327
|
+
onClick: onReStart
|
|
328
|
+
}, "\u5F00\u59CB\u4F5C\u4E1A"), /* @__PURE__ */ React.createElement("br", null), /* @__PURE__ */ React.createElement("div", null, appManager.config.appId), /* @__PURE__ */ React.createElement("div", null, appManager.config.groupId));
|
|
329
|
+
}
|
|
330
|
+
function confirm(props) {
|
|
331
|
+
const { service, data = {} } = props;
|
|
332
|
+
const { title = "title", message = "message", okText = "okText", cancelText = "" } = data;
|
|
333
|
+
const onClickCallback = React.useCallback(function(isConfirm) {
|
|
334
|
+
service.onNext(isConfirm);
|
|
335
|
+
}, [service]);
|
|
336
|
+
return /* @__PURE__ */ React.createElement(Overlay, {
|
|
337
|
+
verticalPosition: "bottom"
|
|
338
|
+
}, /* @__PURE__ */ React.createElement(Confirm$1, {
|
|
339
|
+
title,
|
|
340
|
+
message,
|
|
341
|
+
okText,
|
|
342
|
+
cancelText,
|
|
343
|
+
onClick: onClickCallback
|
|
344
|
+
}));
|
|
345
|
+
}
|
|
346
|
+
function Prompt(props) {
|
|
347
|
+
return /* @__PURE__ */ React.createElement("div", null, "\u9875\u9762\u4E0D\u5B58\u5728");
|
|
348
|
+
}
|
|
349
|
+
function toast(props) {
|
|
350
|
+
const { data = {}, service } = props;
|
|
351
|
+
const { title, level, message, duration = null } = data;
|
|
352
|
+
React.useEffect(() => {
|
|
353
|
+
if (data.hasNext !== false) {
|
|
354
|
+
service.onNext("");
|
|
355
|
+
}
|
|
356
|
+
}, [data, service]);
|
|
357
|
+
const [hidden, setHidden] = useState(false);
|
|
358
|
+
if (duration) {
|
|
359
|
+
setTimeout(() => {
|
|
360
|
+
setHidden(true);
|
|
361
|
+
}, duration);
|
|
362
|
+
}
|
|
363
|
+
return !hidden ? /* @__PURE__ */ React.createElement(Overlay, {
|
|
364
|
+
verticalPosition: "bottom"
|
|
365
|
+
}, /* @__PURE__ */ React.createElement(Confirm, {
|
|
366
|
+
type: level,
|
|
367
|
+
title,
|
|
368
|
+
message: splitMessage(message)
|
|
369
|
+
})) : null;
|
|
370
|
+
}
|
|
371
|
+
function splitMessage(message) {
|
|
372
|
+
var msg = String(message).split("by Error:");
|
|
373
|
+
return msg[1] || msg[0];
|
|
374
|
+
}
|
|
375
|
+
var index$c = "";
|
|
376
|
+
function NotFound(props) {
|
|
377
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
378
|
+
style: { padding: "20%" }
|
|
379
|
+
}, /* @__PURE__ */ React.createElement("h1", null, "404 ", /* @__PURE__ */ React.createElement("small", {
|
|
380
|
+
style: { fontSize: "60%" }
|
|
381
|
+
}, "Not found")), /* @__PURE__ */ React.createElement("div", null, props.action.getPage()));
|
|
382
|
+
}
|
|
383
|
+
function _extends() {
|
|
384
|
+
_extends = Object.assign || function(target) {
|
|
385
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
386
|
+
var source = arguments[i];
|
|
387
|
+
for (var key in source) {
|
|
388
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
389
|
+
target[key] = source[key];
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
return target;
|
|
394
|
+
};
|
|
395
|
+
return _extends.apply(this, arguments);
|
|
396
|
+
}
|
|
397
|
+
var r, B = r || (r = {});
|
|
398
|
+
B.Pop = "POP";
|
|
399
|
+
B.Push = "PUSH";
|
|
400
|
+
B.Replace = "REPLACE";
|
|
401
|
+
var C = function(b) {
|
|
402
|
+
return b;
|
|
403
|
+
};
|
|
404
|
+
function E(b) {
|
|
405
|
+
b.preventDefault();
|
|
406
|
+
b.returnValue = "";
|
|
407
|
+
}
|
|
408
|
+
function F() {
|
|
409
|
+
var b = [];
|
|
410
|
+
return { get length() {
|
|
411
|
+
return b.length;
|
|
412
|
+
}, push: function(h) {
|
|
413
|
+
b.push(h);
|
|
414
|
+
return function() {
|
|
415
|
+
b = b.filter(function(k) {
|
|
416
|
+
return k !== h;
|
|
417
|
+
});
|
|
418
|
+
};
|
|
419
|
+
}, call: function(h) {
|
|
420
|
+
b.forEach(function(k) {
|
|
421
|
+
return k && k(h);
|
|
422
|
+
});
|
|
423
|
+
} };
|
|
424
|
+
}
|
|
425
|
+
function H() {
|
|
426
|
+
return Math.random().toString(36).substr(2, 8);
|
|
427
|
+
}
|
|
428
|
+
function I(b) {
|
|
429
|
+
var h = b.pathname, k = b.search;
|
|
430
|
+
b = b.hash;
|
|
431
|
+
return (h === void 0 ? "/" : h) + (k === void 0 ? "" : k) + (b === void 0 ? "" : b);
|
|
432
|
+
}
|
|
433
|
+
function J(b) {
|
|
434
|
+
var h = {};
|
|
435
|
+
if (b) {
|
|
436
|
+
var k = b.indexOf("#");
|
|
437
|
+
0 <= k && (h.hash = b.substr(k), b = b.substr(0, k));
|
|
438
|
+
k = b.indexOf("?");
|
|
439
|
+
0 <= k && (h.search = b.substr(k), b = b.substr(0, k));
|
|
440
|
+
b && (h.pathname = b);
|
|
441
|
+
}
|
|
442
|
+
return h;
|
|
443
|
+
}
|
|
444
|
+
function createHashHistory(b) {
|
|
445
|
+
function h() {
|
|
446
|
+
var a = J(m.location.hash.substr(1)), e = a.pathname, l = a.search;
|
|
447
|
+
a = a.hash;
|
|
448
|
+
var g = u.state || {};
|
|
449
|
+
return [g.idx, C({ pathname: e === void 0 ? "/" : e, search: l === void 0 ? "" : l, hash: a === void 0 ? "" : a, state: g.usr || null, key: g.key || "default" })];
|
|
450
|
+
}
|
|
451
|
+
function k() {
|
|
452
|
+
if (t)
|
|
453
|
+
c.call(t), t = null;
|
|
454
|
+
else {
|
|
455
|
+
var a = r.Pop, e = h(), l = e[0];
|
|
456
|
+
e = e[1];
|
|
457
|
+
if (c.length)
|
|
458
|
+
if (l != null) {
|
|
459
|
+
var g = q - l;
|
|
460
|
+
g && (t = { action: a, location: e, retry: function() {
|
|
461
|
+
p(-1 * g);
|
|
462
|
+
} }, p(g));
|
|
463
|
+
} else
|
|
464
|
+
;
|
|
465
|
+
else
|
|
466
|
+
A(a);
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
function x(a) {
|
|
470
|
+
var e = document.querySelector("base"), l = "";
|
|
471
|
+
e && e.getAttribute("href") && (e = m.location.href, l = e.indexOf("#"), l = l === -1 ? e : e.slice(0, l));
|
|
472
|
+
return l + "#" + (typeof a === "string" ? a : I(a));
|
|
473
|
+
}
|
|
474
|
+
function z(a, e) {
|
|
475
|
+
e === void 0 && (e = null);
|
|
476
|
+
return C(_extends({}, d, typeof a === "string" ? J(a) : a, { state: e, key: H() }));
|
|
477
|
+
}
|
|
478
|
+
function A(a) {
|
|
479
|
+
v = a;
|
|
480
|
+
a = h();
|
|
481
|
+
q = a[0];
|
|
482
|
+
d = a[1];
|
|
483
|
+
f.call({ action: v, location: d });
|
|
484
|
+
}
|
|
485
|
+
function y(a, e) {
|
|
486
|
+
function l() {
|
|
487
|
+
y(a, e);
|
|
488
|
+
}
|
|
489
|
+
var g = r.Push, n = z(a, e);
|
|
490
|
+
if (!c.length || (c.call({ action: g, location: n, retry: l }), false)) {
|
|
491
|
+
var G = [{ usr: n.state, key: n.key, idx: q + 1 }, x(n)];
|
|
492
|
+
n = G[0];
|
|
493
|
+
G = G[1];
|
|
494
|
+
try {
|
|
495
|
+
u.pushState(n, "", G);
|
|
496
|
+
} catch (K) {
|
|
497
|
+
m.location.assign(G);
|
|
498
|
+
}
|
|
499
|
+
A(g);
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
function w(a, e) {
|
|
503
|
+
function l() {
|
|
504
|
+
w(a, e);
|
|
505
|
+
}
|
|
506
|
+
var g = r.Replace, n = z(a, e);
|
|
507
|
+
c.length && (c.call({
|
|
508
|
+
action: g,
|
|
509
|
+
location: n,
|
|
510
|
+
retry: l
|
|
511
|
+
}), 1) || (n = [{ usr: n.state, key: n.key, idx: q }, x(n)], u.replaceState(n[0], "", n[1]), A(g));
|
|
512
|
+
}
|
|
513
|
+
function p(a) {
|
|
514
|
+
u.go(a);
|
|
515
|
+
}
|
|
516
|
+
b === void 0 && (b = {});
|
|
517
|
+
b = b.window;
|
|
518
|
+
var m = b === void 0 ? document.defaultView : b, u = m.history, t = null;
|
|
519
|
+
m.addEventListener("popstate", k);
|
|
520
|
+
m.addEventListener("hashchange", function() {
|
|
521
|
+
var a = h()[1];
|
|
522
|
+
I(a) !== I(d) && k();
|
|
523
|
+
});
|
|
524
|
+
var v = r.Pop;
|
|
525
|
+
b = h();
|
|
526
|
+
var q = b[0], d = b[1], f = F(), c = F();
|
|
527
|
+
q == null && (q = 0, u.replaceState(_extends({}, u.state, { idx: q }), ""));
|
|
528
|
+
return {
|
|
529
|
+
get action() {
|
|
530
|
+
return v;
|
|
531
|
+
},
|
|
532
|
+
get location() {
|
|
533
|
+
return d;
|
|
534
|
+
},
|
|
535
|
+
createHref: x,
|
|
536
|
+
push: y,
|
|
537
|
+
replace: w,
|
|
538
|
+
go: p,
|
|
539
|
+
back: function() {
|
|
540
|
+
p(-1);
|
|
541
|
+
},
|
|
542
|
+
forward: function() {
|
|
543
|
+
p(1);
|
|
544
|
+
},
|
|
545
|
+
listen: function(a) {
|
|
546
|
+
return f.push(a);
|
|
547
|
+
},
|
|
548
|
+
block: function(a) {
|
|
549
|
+
var e = c.push(a);
|
|
550
|
+
c.length === 1 && m.addEventListener("beforeunload", E);
|
|
551
|
+
return function() {
|
|
552
|
+
e();
|
|
553
|
+
c.length || m.removeEventListener("beforeunload", E);
|
|
554
|
+
};
|
|
555
|
+
}
|
|
556
|
+
};
|
|
557
|
+
}
|
|
558
|
+
var index$b = "";
|
|
559
|
+
function Debug(props) {
|
|
560
|
+
const { appManager } = props;
|
|
561
|
+
const pages = Array.from(appManager.pageManager.keys()).reverse();
|
|
562
|
+
React.useEffect(function() {
|
|
563
|
+
const history = createHashHistory();
|
|
564
|
+
const unListen = history.listen(({ action, location }) => {
|
|
565
|
+
const pathname = location.pathname;
|
|
566
|
+
appManager.mockToPage(pathname, {});
|
|
567
|
+
});
|
|
568
|
+
return unListen;
|
|
569
|
+
}, []);
|
|
570
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
571
|
+
className: "local-debug-side"
|
|
572
|
+
}, /* @__PURE__ */ React.createElement("ul", null, pages.map((pathname) => /* @__PURE__ */ React.createElement("li", {
|
|
573
|
+
key: pathname
|
|
574
|
+
}, /* @__PURE__ */ React.createElement("a", {
|
|
575
|
+
href: `#${pathname}`
|
|
576
|
+
}, pathname)))));
|
|
577
|
+
}
|
|
578
|
+
function Loading$1(props) {
|
|
579
|
+
const [showLoading, setShowLoading] = React.useState(false);
|
|
580
|
+
const edgeService = props.edgeService;
|
|
581
|
+
React.useEffect(function() {
|
|
582
|
+
let currentLoading = false;
|
|
583
|
+
const throttleSetShowLoading = function(loading) {
|
|
584
|
+
currentLoading = loading;
|
|
585
|
+
if (loading) {
|
|
586
|
+
setTimeout(function() {
|
|
587
|
+
if (currentLoading === loading) {
|
|
588
|
+
setShowLoading(true);
|
|
589
|
+
}
|
|
590
|
+
}, 350);
|
|
591
|
+
} else {
|
|
592
|
+
setTimeout(function() {
|
|
593
|
+
if (currentLoading === loading) {
|
|
594
|
+
setShowLoading(false);
|
|
595
|
+
}
|
|
596
|
+
}, 100);
|
|
597
|
+
}
|
|
598
|
+
};
|
|
599
|
+
edgeService.on("IO_STATUS", throttleSetShowLoading);
|
|
600
|
+
return function() {
|
|
601
|
+
edgeService.off("IO_STATUS", throttleSetShowLoading);
|
|
602
|
+
};
|
|
603
|
+
}, [edgeService]);
|
|
604
|
+
return showLoading ? /* @__PURE__ */ React.createElement("div", {
|
|
605
|
+
style: { position: "absolute", left: 0, top: 0, zIndex: 100 }
|
|
606
|
+
}, "LOADING...") : null;
|
|
607
|
+
}
|
|
608
|
+
var index$a = {
|
|
609
|
+
Alert,
|
|
610
|
+
Start,
|
|
611
|
+
Toast: toast,
|
|
612
|
+
Confirm: confirm,
|
|
613
|
+
NotFound,
|
|
614
|
+
Debug,
|
|
615
|
+
Prompt,
|
|
616
|
+
Loading: Loading$1
|
|
617
|
+
};
|
|
618
|
+
var index$9 = "";
|
|
619
|
+
function Presentation(props) {
|
|
620
|
+
const {
|
|
621
|
+
image = Presentation.IMAGE_1,
|
|
622
|
+
text = "",
|
|
623
|
+
subText = "",
|
|
624
|
+
transparent,
|
|
625
|
+
imageStyle
|
|
626
|
+
} = props;
|
|
627
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
628
|
+
className: transparent ? "presentation-card transparent" : "presentation-card"
|
|
629
|
+
}, /* @__PURE__ */ React.createElement("img", {
|
|
630
|
+
src: image,
|
|
631
|
+
style: imageStyle
|
|
632
|
+
}), text ? /* @__PURE__ */ React.createElement("div", {
|
|
633
|
+
className: "text"
|
|
634
|
+
}, text) : null, subText ? /* @__PURE__ */ React.createElement("div", {
|
|
635
|
+
className: "sub-text"
|
|
636
|
+
}, subText) : null);
|
|
637
|
+
}
|
|
638
|
+
Presentation.IMAGE_1 = "https://img.alicdn.com/imgextra/i3/O1CN019Ivkor1ksy3pMGDsz_!!6000000004740-2-tps-280-322.png";
|
|
639
|
+
Presentation.IMAGE_2 = "https://img.alicdn.com/imgextra/i1/O1CN01lhSunu1X4VPw1Mlas_!!6000000002870-2-tps-352-158.png";
|
|
640
|
+
Presentation.IMAGE_3 = "https://img.alicdn.com/imgextra/i1/O1CN01mreYXo1XfbUsQ7hip_!!6000000002951-2-tps-322-144.png";
|
|
641
|
+
Presentation.IMAGE_4 = "https://img.alicdn.com/imgextra/i3/O1CN017gNM8F1Fmmcfti7Dg_!!6000000000530-1-tps-414-286.gif";
|
|
642
|
+
var index$8 = "";
|
|
643
|
+
function empty() {
|
|
644
|
+
}
|
|
645
|
+
function List(props) {
|
|
646
|
+
const { tabIndex = 1, onItemClick = empty, style } = props;
|
|
647
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
648
|
+
className: "android-pda-list",
|
|
649
|
+
style
|
|
650
|
+
}, React.Children.map(props.children, (item, index2) => {
|
|
651
|
+
const itemPropsOnClick = item.props.onClick;
|
|
652
|
+
return React.cloneElement(item, Object.assign({
|
|
653
|
+
tabIndex: tabIndex + index2
|
|
654
|
+
}, item.props, {
|
|
655
|
+
onClick: (event) => {
|
|
656
|
+
itemPropsOnClick && itemPropsOnClick(event);
|
|
657
|
+
onItemClick(event);
|
|
658
|
+
}
|
|
659
|
+
}), item.props.children);
|
|
660
|
+
}));
|
|
661
|
+
}
|
|
662
|
+
function DefaultItem(props) {
|
|
663
|
+
const { onClick, title, subTitle, extra, tags = [], tabIndex } = props;
|
|
664
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
665
|
+
className: "default-item",
|
|
666
|
+
onClick: () => {
|
|
667
|
+
onClick(props);
|
|
668
|
+
},
|
|
669
|
+
tabIndex
|
|
670
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
671
|
+
className: "text"
|
|
672
|
+
}, /* @__PURE__ */ React.createElement("div", null, title), /* @__PURE__ */ React.createElement("div", {
|
|
673
|
+
className: "sub-text"
|
|
674
|
+
}, subTitle), /* @__PURE__ */ React.createElement("div", {
|
|
675
|
+
className: "sub-tags"
|
|
676
|
+
}, tags.map((text) => {
|
|
677
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
678
|
+
className: "sub-tag-item"
|
|
679
|
+
}, text);
|
|
680
|
+
}))), /* @__PURE__ */ React.createElement("div", {
|
|
681
|
+
className: "extra"
|
|
682
|
+
}, extra));
|
|
683
|
+
}
|
|
684
|
+
List.Item = DefaultItem;
|
|
685
|
+
var index$7 = "";
|
|
686
|
+
class BaseLayout extends React.Component {
|
|
687
|
+
constructor(props) {
|
|
688
|
+
super(props);
|
|
689
|
+
}
|
|
690
|
+
render() {
|
|
691
|
+
const { style = {}, header, footer } = this.props;
|
|
692
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
693
|
+
className: classNames({ "baselayout-wrapper": true }),
|
|
694
|
+
style
|
|
695
|
+
}, header && /* @__PURE__ */ React.createElement("div", {
|
|
696
|
+
className: classNames({ "baselayout-header": true })
|
|
697
|
+
}, header), /* @__PURE__ */ React.createElement("div", {
|
|
698
|
+
className: classNames({ "baselayout-container": true })
|
|
699
|
+
}, this.props.children), footer && /* @__PURE__ */ React.createElement("div", {
|
|
700
|
+
className: classNames({ "baselayout-footer": true })
|
|
701
|
+
}, footer));
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
var index$6 = "";
|
|
705
|
+
const blankFunc = () => {
|
|
706
|
+
};
|
|
707
|
+
class WakeKeyborard extends React.Component {
|
|
708
|
+
constructor() {
|
|
709
|
+
super(...arguments);
|
|
710
|
+
__publicField(this, "state", {
|
|
711
|
+
inputVisible: false
|
|
712
|
+
});
|
|
713
|
+
__publicField(this, "_useInput", null);
|
|
714
|
+
}
|
|
715
|
+
render() {
|
|
716
|
+
const { inputVisible } = this.state;
|
|
717
|
+
const { onWakeKeyboard = blankFunc, onClick = blankFunc } = this.props;
|
|
718
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
719
|
+
className: "wakekeyborard"
|
|
720
|
+
}, inputVisible ? /* @__PURE__ */ React.createElement("div", {
|
|
721
|
+
className: "wakekeyborard-overlay"
|
|
722
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
723
|
+
className: "wakekeyborard-inputbox"
|
|
724
|
+
}, /* @__PURE__ */ React.createElement("input", {
|
|
725
|
+
ref: (ref) => {
|
|
726
|
+
this._useInput = ref;
|
|
727
|
+
},
|
|
728
|
+
type: "tel"
|
|
729
|
+
}), /* @__PURE__ */ React.createElement(Button, {
|
|
730
|
+
type: "primary",
|
|
731
|
+
onClick: (e) => {
|
|
732
|
+
onClick(this._useInput.value);
|
|
733
|
+
this.setState({ inputVisible: !inputVisible });
|
|
734
|
+
}
|
|
735
|
+
}, "\u67E5\u8BE2"))) : null, !inputVisible ? /* @__PURE__ */ React.createElement("div", {
|
|
736
|
+
className: "wakekeyborard-icon",
|
|
737
|
+
onClick: (e) => {
|
|
738
|
+
this.setState({ inputVisible: !inputVisible });
|
|
739
|
+
requestAnimationFrame(() => {
|
|
740
|
+
this._useInput.focus();
|
|
741
|
+
onWakeKeyboard();
|
|
742
|
+
});
|
|
743
|
+
}
|
|
744
|
+
}) : null);
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
var index$5 = "";
|
|
748
|
+
var index$4 = "";
|
|
749
|
+
class PdaInfoCard$1 extends React.Component {
|
|
750
|
+
constructor(props) {
|
|
751
|
+
super(props);
|
|
752
|
+
}
|
|
753
|
+
render() {
|
|
754
|
+
const { className, title, isActive, infoList = [], style = {}, index: index2, isLast } = this.props;
|
|
755
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
756
|
+
className: classNames({ [className]: true, "pda-step-card": true }),
|
|
757
|
+
style
|
|
758
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
759
|
+
className: "pda-step-indictor"
|
|
760
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
761
|
+
className: classNames({ "pda-step-indictor-top": true, "pda-step-indictor-top-hidden": index2 === 0 })
|
|
762
|
+
}), /* @__PURE__ */ React.createElement("div", {
|
|
763
|
+
className: classNames({ "pda-step-indictor-center": true, "pda-step-indictor-center-active": isActive })
|
|
764
|
+
}), /* @__PURE__ */ React.createElement("div", {
|
|
765
|
+
className: classNames({ "pda-step-indictor-bottom": true, "pda-step-indictor-bottom-hidden": isLast })
|
|
766
|
+
})), /* @__PURE__ */ React.createElement("div", {
|
|
767
|
+
className: classNames({ "pda-step": true, "pda-step-dark": !isActive })
|
|
768
|
+
}, /* @__PURE__ */ React.createElement("p", {
|
|
769
|
+
className: "pda-step-title"
|
|
770
|
+
}, title), infoList.map((item, index22) => {
|
|
771
|
+
return /* @__PURE__ */ React.createElement("p", {
|
|
772
|
+
key: index22,
|
|
773
|
+
className: "pda-step-list"
|
|
774
|
+
}, /* @__PURE__ */ React.createElement("span", null, item.label || ""), "\xA0\xA0", /* @__PURE__ */ React.createElement("span", null, item.content || ""));
|
|
775
|
+
})));
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
class PdaInfoCard extends React.Component {
|
|
779
|
+
constructor(props) {
|
|
780
|
+
super(props);
|
|
781
|
+
}
|
|
782
|
+
render() {
|
|
783
|
+
const { className, style = {}, theme = "light", current = 0, children } = this.props;
|
|
784
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
785
|
+
className: classNames({ [className]: true }),
|
|
786
|
+
style
|
|
787
|
+
}, (children || []).map((child, index2) => {
|
|
788
|
+
const childProps = __spreadValues({
|
|
789
|
+
index: index2,
|
|
790
|
+
isLast: index2 === (children || []).length - 1
|
|
791
|
+
}, child.props);
|
|
792
|
+
if (index2 === current) {
|
|
793
|
+
childProps.isActive = true;
|
|
794
|
+
} else {
|
|
795
|
+
childProps.isActive = false;
|
|
796
|
+
}
|
|
797
|
+
return cloneElement(child, childProps);
|
|
798
|
+
}));
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
__publicField(PdaInfoCard, "Step", PdaInfoCard$1);
|
|
802
|
+
var index$3 = "";
|
|
803
|
+
class PdaFinishCard extends React.Component {
|
|
804
|
+
constructor(props) {
|
|
805
|
+
super(props);
|
|
806
|
+
}
|
|
807
|
+
render() {
|
|
808
|
+
const { className, title, infoList = [], isError = false, style = {}, onClick = () => {
|
|
809
|
+
}, okText = "\u8FD4\u56DE\u9996\u9875", cancelText = null } = this.props;
|
|
810
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
811
|
+
className: classNames({ [className]: true, "pda-finish-card": true }),
|
|
812
|
+
style
|
|
813
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
814
|
+
className: "pda-finish-card-top"
|
|
815
|
+
}, /* @__PURE__ */ React.createElement("img", {
|
|
816
|
+
className: "pda-finish-card-img",
|
|
817
|
+
width: isError ? 370 : 400,
|
|
818
|
+
height: 269,
|
|
819
|
+
src: isError ? PdaFinishCard.ERROR_SUCCESS : PdaFinishCard.SUCCESS
|
|
820
|
+
}), /* @__PURE__ */ React.createElement("p", {
|
|
821
|
+
className: "pda-finish-card-title"
|
|
822
|
+
}, title), infoList.map((item, index2) => {
|
|
823
|
+
return /* @__PURE__ */ React.createElement("p", {
|
|
824
|
+
key: index2,
|
|
825
|
+
className: "pda-finish-card-list"
|
|
826
|
+
}, /* @__PURE__ */ React.createElement("span", null, item.label || ""), /* @__PURE__ */ React.createElement("span", null, item.content || ""));
|
|
827
|
+
})), /* @__PURE__ */ React.createElement(Button.Group, null, cancelText ? /* @__PURE__ */ React.createElement(Button, {
|
|
828
|
+
type: "dark",
|
|
829
|
+
onClick: () => onClick(false)
|
|
830
|
+
}, cancelText) : null, /* @__PURE__ */ React.createElement(Button, {
|
|
831
|
+
type: "primary",
|
|
832
|
+
onClick: () => onClick(true)
|
|
833
|
+
}, okText)));
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
PdaFinishCard.SUCCESS = "https://img.alicdn.com/imgextra/i2/O1CN01yYwwSx1uNV0M1gHlQ_!!6000000006025-1-tps-630-436.gif";
|
|
837
|
+
PdaFinishCard.ERROR_SUCCESS = "https://img.alicdn.com/imgextra/i3/O1CN01p5Oc5t1VMFWtBomQc_!!6000000002638-1-tps-600-456.gif";
|
|
838
|
+
var index$2 = "";
|
|
839
|
+
class PdaDistanceCard extends React.Component {
|
|
840
|
+
constructor(props) {
|
|
841
|
+
super(props);
|
|
842
|
+
}
|
|
843
|
+
render() {
|
|
844
|
+
const { className, title, infoText, percentage = 0, style = {} } = this.props;
|
|
845
|
+
const distanceImg = "https://img.alicdn.com/imgextra/i3/O1CN01EFksWL1DBZCu0H1JH_!!6000000000178-2-tps-21-30.png";
|
|
846
|
+
const indictorImg = "https://img.alicdn.com/imgextra/i1/O1CN01YEhCSg1aObe8UZq7K_!!6000000003320-2-tps-379-17.png";
|
|
847
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
848
|
+
className: classNames({ [className]: true, "pda-distance-card": true }),
|
|
849
|
+
style
|
|
850
|
+
}, /* @__PURE__ */ React.createElement("p", {
|
|
851
|
+
className: "pda-distance-card-highlight"
|
|
852
|
+
}, /* @__PURE__ */ React.createElement("span", {
|
|
853
|
+
className: "pda-distance-card-highlight1"
|
|
854
|
+
}, title)), /* @__PURE__ */ React.createElement("div", {
|
|
855
|
+
className: "pda-distance-indictor"
|
|
856
|
+
}, /* @__PURE__ */ React.createElement("img", {
|
|
857
|
+
src: distanceImg,
|
|
858
|
+
width: 20,
|
|
859
|
+
height: 29
|
|
860
|
+
}), /* @__PURE__ */ React.createElement("p", null, infoText)), /* @__PURE__ */ React.createElement("div", {
|
|
861
|
+
className: "pda-distance-card-progress"
|
|
862
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
863
|
+
className: "pda-distance-card-progress-inside",
|
|
864
|
+
style: { width: `${percentage * 100}%` }
|
|
865
|
+
}), /* @__PURE__ */ React.createElement("img", {
|
|
866
|
+
className: "pda-distance-card-progress-indictor",
|
|
867
|
+
src: indictorImg
|
|
868
|
+
})), /* @__PURE__ */ React.createElement("div", {
|
|
869
|
+
className: "pda-distance-label"
|
|
870
|
+
}, /* @__PURE__ */ React.createElement("p", null, "\u8FDC"), /* @__PURE__ */ React.createElement("p", null, "\u8FD1")));
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
var index$1 = "";
|
|
874
|
+
function SubCard(props) {
|
|
875
|
+
const { title, context, attrs = [] } = props;
|
|
876
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
877
|
+
className: "android-sub-card"
|
|
878
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
879
|
+
className: "android-sub-card-title"
|
|
880
|
+
}, title), /* @__PURE__ */ React.createElement("div", {
|
|
881
|
+
className: "android-sub-card-context"
|
|
882
|
+
}, context), /* @__PURE__ */ React.createElement("div", {
|
|
883
|
+
className: "android-sub-card-attrs"
|
|
884
|
+
}, attrs.map((text) => {
|
|
885
|
+
return /* @__PURE__ */ React.createElement("div", null, text);
|
|
886
|
+
})));
|
|
887
|
+
}
|
|
888
|
+
var index = "";
|
|
889
|
+
var freeGlobal$1 = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
|
890
|
+
var freeSelf$1 = typeof self == "object" && self && self.Object === Object && self;
|
|
891
|
+
freeGlobal$1 || freeSelf$1 || Function("return this")();
|
|
892
|
+
var freeGlobal = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
|
893
|
+
var freeSelf = typeof self == "object" && self && self.Object === Object && self;
|
|
894
|
+
freeGlobal || freeSelf || Function("return this")();
|
|
895
|
+
function isDocumentVisible() {
|
|
896
|
+
if (typeof document !== "undefined" && typeof document.visibilityState !== "undefined") {
|
|
897
|
+
return document.visibilityState !== "hidden";
|
|
898
|
+
}
|
|
899
|
+
return true;
|
|
900
|
+
}
|
|
901
|
+
function isOnline() {
|
|
902
|
+
if (typeof navigator.onLine !== "undefined") {
|
|
903
|
+
return navigator.onLine;
|
|
904
|
+
}
|
|
905
|
+
return true;
|
|
906
|
+
}
|
|
907
|
+
var __read$7 = function(o, n) {
|
|
908
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
909
|
+
if (!m)
|
|
910
|
+
return o;
|
|
911
|
+
var i = m.call(o), r2, ar = [], e;
|
|
912
|
+
try {
|
|
913
|
+
while ((n === void 0 || n-- > 0) && !(r2 = i.next()).done) {
|
|
914
|
+
ar.push(r2.value);
|
|
915
|
+
}
|
|
916
|
+
} catch (error) {
|
|
917
|
+
e = {
|
|
918
|
+
error
|
|
919
|
+
};
|
|
920
|
+
} finally {
|
|
921
|
+
try {
|
|
922
|
+
if (r2 && !r2.done && (m = i["return"]))
|
|
923
|
+
m.call(i);
|
|
924
|
+
} finally {
|
|
925
|
+
if (e)
|
|
926
|
+
throw e.error;
|
|
927
|
+
}
|
|
928
|
+
}
|
|
929
|
+
return ar;
|
|
930
|
+
};
|
|
931
|
+
(function() {
|
|
932
|
+
for (var ar = [], i = 0; i < arguments.length; i++) {
|
|
933
|
+
ar = ar.concat(__read$7(arguments[i]));
|
|
934
|
+
}
|
|
935
|
+
return ar;
|
|
936
|
+
});
|
|
937
|
+
var __read$6 = function(o, n) {
|
|
938
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
939
|
+
if (!m)
|
|
940
|
+
return o;
|
|
941
|
+
var i = m.call(o), r2, ar = [], e;
|
|
942
|
+
try {
|
|
943
|
+
while ((n === void 0 || n-- > 0) && !(r2 = i.next()).done) {
|
|
944
|
+
ar.push(r2.value);
|
|
945
|
+
}
|
|
946
|
+
} catch (error) {
|
|
947
|
+
e = {
|
|
948
|
+
error
|
|
949
|
+
};
|
|
950
|
+
} finally {
|
|
951
|
+
try {
|
|
952
|
+
if (r2 && !r2.done && (m = i["return"]))
|
|
953
|
+
m.call(i);
|
|
954
|
+
} finally {
|
|
955
|
+
if (e)
|
|
956
|
+
throw e.error;
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
return ar;
|
|
960
|
+
};
|
|
961
|
+
(function() {
|
|
962
|
+
for (var ar = [], i = 0; i < arguments.length; i++) {
|
|
963
|
+
ar = ar.concat(__read$6(arguments[i]));
|
|
964
|
+
}
|
|
965
|
+
return ar;
|
|
966
|
+
});
|
|
967
|
+
var listeners$1 = [];
|
|
968
|
+
var eventsBinded$1 = false;
|
|
969
|
+
if (typeof window !== "undefined" && window.addEventListener && !eventsBinded$1) {
|
|
970
|
+
var revalidate$1 = function revalidate() {
|
|
971
|
+
if (!isDocumentVisible() || !isOnline())
|
|
972
|
+
return;
|
|
973
|
+
for (var i = 0; i < listeners$1.length; i++) {
|
|
974
|
+
var listener = listeners$1[i];
|
|
975
|
+
listener();
|
|
976
|
+
}
|
|
977
|
+
};
|
|
978
|
+
window.addEventListener("visibilitychange", revalidate$1, false);
|
|
979
|
+
window.addEventListener("focus", revalidate$1, false);
|
|
980
|
+
eventsBinded$1 = true;
|
|
981
|
+
}
|
|
982
|
+
var listeners = [];
|
|
983
|
+
var eventsBinded = false;
|
|
984
|
+
if (typeof window !== "undefined" && window.addEventListener && !eventsBinded) {
|
|
985
|
+
var revalidate = function revalidate2() {
|
|
986
|
+
if (!isDocumentVisible())
|
|
987
|
+
return;
|
|
988
|
+
for (var i = 0; i < listeners.length; i++) {
|
|
989
|
+
var listener = listeners[i];
|
|
990
|
+
listener();
|
|
991
|
+
}
|
|
992
|
+
};
|
|
993
|
+
window.addEventListener("visibilitychange", revalidate, false);
|
|
994
|
+
eventsBinded = true;
|
|
995
|
+
}
|
|
996
|
+
var __assign$3 = function() {
|
|
997
|
+
__assign$3 = Object.assign || function(t) {
|
|
998
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
999
|
+
s = arguments[i];
|
|
1000
|
+
for (var p in s) {
|
|
1001
|
+
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
1002
|
+
t[p] = s[p];
|
|
1003
|
+
}
|
|
1004
|
+
}
|
|
1005
|
+
return t;
|
|
1006
|
+
};
|
|
1007
|
+
return __assign$3.apply(this, arguments);
|
|
1008
|
+
};
|
|
1009
|
+
var __read$5 = function(o, n) {
|
|
1010
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
1011
|
+
if (!m)
|
|
1012
|
+
return o;
|
|
1013
|
+
var i = m.call(o), r2, ar = [], e;
|
|
1014
|
+
try {
|
|
1015
|
+
while ((n === void 0 || n-- > 0) && !(r2 = i.next()).done) {
|
|
1016
|
+
ar.push(r2.value);
|
|
1017
|
+
}
|
|
1018
|
+
} catch (error) {
|
|
1019
|
+
e = {
|
|
1020
|
+
error
|
|
1021
|
+
};
|
|
1022
|
+
} finally {
|
|
1023
|
+
try {
|
|
1024
|
+
if (r2 && !r2.done && (m = i["return"]))
|
|
1025
|
+
m.call(i);
|
|
1026
|
+
} finally {
|
|
1027
|
+
if (e)
|
|
1028
|
+
throw e.error;
|
|
1029
|
+
}
|
|
1030
|
+
}
|
|
1031
|
+
return ar;
|
|
1032
|
+
};
|
|
1033
|
+
(function() {
|
|
1034
|
+
for (var ar = [], i = 0; i < arguments.length; i++) {
|
|
1035
|
+
ar = ar.concat(__read$5(arguments[i]));
|
|
1036
|
+
}
|
|
1037
|
+
return ar;
|
|
1038
|
+
});
|
|
1039
|
+
var __assign$2 = function() {
|
|
1040
|
+
__assign$2 = Object.assign || function(t) {
|
|
1041
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
1042
|
+
s = arguments[i];
|
|
1043
|
+
for (var p in s) {
|
|
1044
|
+
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
1045
|
+
t[p] = s[p];
|
|
1046
|
+
}
|
|
1047
|
+
}
|
|
1048
|
+
return t;
|
|
1049
|
+
};
|
|
1050
|
+
return __assign$2.apply(this, arguments);
|
|
1051
|
+
};
|
|
1052
|
+
(function(s, e) {
|
|
1053
|
+
var t = {};
|
|
1054
|
+
for (var p in s) {
|
|
1055
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1056
|
+
t[p] = s[p];
|
|
1057
|
+
}
|
|
1058
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
1059
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
1060
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
1061
|
+
t[p[i]] = s[p[i]];
|
|
1062
|
+
}
|
|
1063
|
+
return t;
|
|
1064
|
+
});
|
|
1065
|
+
var __read$4 = function(o, n) {
|
|
1066
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
1067
|
+
if (!m)
|
|
1068
|
+
return o;
|
|
1069
|
+
var i = m.call(o), r2, ar = [], e;
|
|
1070
|
+
try {
|
|
1071
|
+
while ((n === void 0 || n-- > 0) && !(r2 = i.next()).done) {
|
|
1072
|
+
ar.push(r2.value);
|
|
1073
|
+
}
|
|
1074
|
+
} catch (error) {
|
|
1075
|
+
e = {
|
|
1076
|
+
error
|
|
1077
|
+
};
|
|
1078
|
+
} finally {
|
|
1079
|
+
try {
|
|
1080
|
+
if (r2 && !r2.done && (m = i["return"]))
|
|
1081
|
+
m.call(i);
|
|
1082
|
+
} finally {
|
|
1083
|
+
if (e)
|
|
1084
|
+
throw e.error;
|
|
1085
|
+
}
|
|
1086
|
+
}
|
|
1087
|
+
return ar;
|
|
1088
|
+
};
|
|
1089
|
+
(function() {
|
|
1090
|
+
for (var ar = [], i = 0; i < arguments.length; i++) {
|
|
1091
|
+
ar = ar.concat(__read$4(arguments[i]));
|
|
1092
|
+
}
|
|
1093
|
+
return ar;
|
|
1094
|
+
});
|
|
1095
|
+
var __assign$1 = function() {
|
|
1096
|
+
__assign$1 = Object.assign || function(t) {
|
|
1097
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
1098
|
+
s = arguments[i];
|
|
1099
|
+
for (var p in s) {
|
|
1100
|
+
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
1101
|
+
t[p] = s[p];
|
|
1102
|
+
}
|
|
1103
|
+
}
|
|
1104
|
+
return t;
|
|
1105
|
+
};
|
|
1106
|
+
return __assign$1.apply(this, arguments);
|
|
1107
|
+
};
|
|
1108
|
+
(function(s, e) {
|
|
1109
|
+
var t = {};
|
|
1110
|
+
for (var p in s) {
|
|
1111
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1112
|
+
t[p] = s[p];
|
|
1113
|
+
}
|
|
1114
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
1115
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
1116
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
1117
|
+
t[p[i]] = s[p[i]];
|
|
1118
|
+
}
|
|
1119
|
+
return t;
|
|
1120
|
+
});
|
|
1121
|
+
var __read$3 = function(o, n) {
|
|
1122
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
1123
|
+
if (!m)
|
|
1124
|
+
return o;
|
|
1125
|
+
var i = m.call(o), r2, ar = [], e;
|
|
1126
|
+
try {
|
|
1127
|
+
while ((n === void 0 || n-- > 0) && !(r2 = i.next()).done) {
|
|
1128
|
+
ar.push(r2.value);
|
|
1129
|
+
}
|
|
1130
|
+
} catch (error) {
|
|
1131
|
+
e = {
|
|
1132
|
+
error
|
|
1133
|
+
};
|
|
1134
|
+
} finally {
|
|
1135
|
+
try {
|
|
1136
|
+
if (r2 && !r2.done && (m = i["return"]))
|
|
1137
|
+
m.call(i);
|
|
1138
|
+
} finally {
|
|
1139
|
+
if (e)
|
|
1140
|
+
throw e.error;
|
|
1141
|
+
}
|
|
1142
|
+
}
|
|
1143
|
+
return ar;
|
|
1144
|
+
};
|
|
1145
|
+
(function() {
|
|
1146
|
+
for (var ar = [], i = 0; i < arguments.length; i++) {
|
|
1147
|
+
ar = ar.concat(__read$3(arguments[i]));
|
|
1148
|
+
}
|
|
1149
|
+
return ar;
|
|
1150
|
+
});
|
|
1151
|
+
var ConfigContext = /* @__PURE__ */ React.createContext({});
|
|
1152
|
+
ConfigContext.displayName = "UseRequestConfigContext";
|
|
1153
|
+
var __assign = function() {
|
|
1154
|
+
__assign = Object.assign || function(t) {
|
|
1155
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
1156
|
+
s = arguments[i];
|
|
1157
|
+
for (var p in s) {
|
|
1158
|
+
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
1159
|
+
t[p] = s[p];
|
|
1160
|
+
}
|
|
1161
|
+
}
|
|
1162
|
+
return t;
|
|
1163
|
+
};
|
|
1164
|
+
return __assign.apply(this, arguments);
|
|
1165
|
+
};
|
|
1166
|
+
(function(s, e) {
|
|
1167
|
+
var t = {};
|
|
1168
|
+
for (var p in s) {
|
|
1169
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1170
|
+
t[p] = s[p];
|
|
1171
|
+
}
|
|
1172
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
1173
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
1174
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
1175
|
+
t[p[i]] = s[p[i]];
|
|
1176
|
+
}
|
|
1177
|
+
return t;
|
|
1178
|
+
});
|
|
1179
|
+
var __read$2 = function(o, n) {
|
|
1180
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
1181
|
+
if (!m)
|
|
1182
|
+
return o;
|
|
1183
|
+
var i = m.call(o), r2, ar = [], e;
|
|
1184
|
+
try {
|
|
1185
|
+
while ((n === void 0 || n-- > 0) && !(r2 = i.next()).done) {
|
|
1186
|
+
ar.push(r2.value);
|
|
1187
|
+
}
|
|
1188
|
+
} catch (error) {
|
|
1189
|
+
e = {
|
|
1190
|
+
error
|
|
1191
|
+
};
|
|
1192
|
+
} finally {
|
|
1193
|
+
try {
|
|
1194
|
+
if (r2 && !r2.done && (m = i["return"]))
|
|
1195
|
+
m.call(i);
|
|
1196
|
+
} finally {
|
|
1197
|
+
if (e)
|
|
1198
|
+
throw e.error;
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
return ar;
|
|
1202
|
+
};
|
|
1203
|
+
(function() {
|
|
1204
|
+
for (var ar = [], i = 0; i < arguments.length; i++) {
|
|
1205
|
+
ar = ar.concat(__read$2(arguments[i]));
|
|
1206
|
+
}
|
|
1207
|
+
return ar;
|
|
1208
|
+
});
|
|
1209
|
+
ConfigContext.Provider;
|
|
1210
|
+
function usePersistFn(fn) {
|
|
1211
|
+
var fnRef = useRef(fn);
|
|
1212
|
+
fnRef.current = fn;
|
|
1213
|
+
var persistFn = useRef();
|
|
1214
|
+
if (!persistFn.current) {
|
|
1215
|
+
persistFn.current = function() {
|
|
1216
|
+
var args = [];
|
|
1217
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1218
|
+
args[_i] = arguments[_i];
|
|
1219
|
+
}
|
|
1220
|
+
return fnRef.current.apply(this, args);
|
|
1221
|
+
};
|
|
1222
|
+
}
|
|
1223
|
+
return persistFn.current;
|
|
1224
|
+
}
|
|
1225
|
+
var __awaiter = function(thisArg, _arguments, P, generator) {
|
|
1226
|
+
function adopt(value) {
|
|
1227
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
1228
|
+
resolve(value);
|
|
1229
|
+
});
|
|
1230
|
+
}
|
|
1231
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
1232
|
+
function fulfilled(value) {
|
|
1233
|
+
try {
|
|
1234
|
+
step(generator.next(value));
|
|
1235
|
+
} catch (e) {
|
|
1236
|
+
reject(e);
|
|
1237
|
+
}
|
|
1238
|
+
}
|
|
1239
|
+
function rejected(value) {
|
|
1240
|
+
try {
|
|
1241
|
+
step(generator["throw"](value));
|
|
1242
|
+
} catch (e) {
|
|
1243
|
+
reject(e);
|
|
1244
|
+
}
|
|
1245
|
+
}
|
|
1246
|
+
function step(result) {
|
|
1247
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
1248
|
+
}
|
|
1249
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
1250
|
+
});
|
|
1251
|
+
};
|
|
1252
|
+
var __generator = function(thisArg, body) {
|
|
1253
|
+
var _ = {
|
|
1254
|
+
label: 0,
|
|
1255
|
+
sent: function sent() {
|
|
1256
|
+
if (t[0] & 1)
|
|
1257
|
+
throw t[1];
|
|
1258
|
+
return t[1];
|
|
1259
|
+
},
|
|
1260
|
+
trys: [],
|
|
1261
|
+
ops: []
|
|
1262
|
+
}, f, y, t, g;
|
|
1263
|
+
return g = {
|
|
1264
|
+
next: verb(0),
|
|
1265
|
+
"throw": verb(1),
|
|
1266
|
+
"return": verb(2)
|
|
1267
|
+
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
1268
|
+
return this;
|
|
1269
|
+
}), g;
|
|
1270
|
+
function verb(n) {
|
|
1271
|
+
return function(v) {
|
|
1272
|
+
return step([n, v]);
|
|
1273
|
+
};
|
|
1274
|
+
}
|
|
1275
|
+
function step(op) {
|
|
1276
|
+
if (f)
|
|
1277
|
+
throw new TypeError("Generator is already executing.");
|
|
1278
|
+
while (_) {
|
|
1279
|
+
try {
|
|
1280
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
|
|
1281
|
+
return t;
|
|
1282
|
+
if (y = 0, t)
|
|
1283
|
+
op = [op[0] & 2, t.value];
|
|
1284
|
+
switch (op[0]) {
|
|
1285
|
+
case 0:
|
|
1286
|
+
case 1:
|
|
1287
|
+
t = op;
|
|
1288
|
+
break;
|
|
1289
|
+
case 4:
|
|
1290
|
+
_.label++;
|
|
1291
|
+
return {
|
|
1292
|
+
value: op[1],
|
|
1293
|
+
done: false
|
|
1294
|
+
};
|
|
1295
|
+
case 5:
|
|
1296
|
+
_.label++;
|
|
1297
|
+
y = op[1];
|
|
1298
|
+
op = [0];
|
|
1299
|
+
continue;
|
|
1300
|
+
case 7:
|
|
1301
|
+
op = _.ops.pop();
|
|
1302
|
+
_.trys.pop();
|
|
1303
|
+
continue;
|
|
1304
|
+
default:
|
|
1305
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
1306
|
+
_ = 0;
|
|
1307
|
+
continue;
|
|
1308
|
+
}
|
|
1309
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
1310
|
+
_.label = op[1];
|
|
1311
|
+
break;
|
|
1312
|
+
}
|
|
1313
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
1314
|
+
_.label = t[1];
|
|
1315
|
+
t = op;
|
|
1316
|
+
break;
|
|
1317
|
+
}
|
|
1318
|
+
if (t && _.label < t[2]) {
|
|
1319
|
+
_.label = t[2];
|
|
1320
|
+
_.ops.push(op);
|
|
1321
|
+
break;
|
|
1322
|
+
}
|
|
1323
|
+
if (t[2])
|
|
1324
|
+
_.ops.pop();
|
|
1325
|
+
_.trys.pop();
|
|
1326
|
+
continue;
|
|
1327
|
+
}
|
|
1328
|
+
op = body.call(thisArg, _);
|
|
1329
|
+
} catch (e) {
|
|
1330
|
+
op = [6, e];
|
|
1331
|
+
y = 0;
|
|
1332
|
+
} finally {
|
|
1333
|
+
f = t = 0;
|
|
1334
|
+
}
|
|
1335
|
+
}
|
|
1336
|
+
if (op[0] & 5)
|
|
1337
|
+
throw op[1];
|
|
1338
|
+
return {
|
|
1339
|
+
value: op[0] ? op[1] : void 0,
|
|
1340
|
+
done: true
|
|
1341
|
+
};
|
|
1342
|
+
}
|
|
1343
|
+
};
|
|
1344
|
+
var __read$1 = function(o, n) {
|
|
1345
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
1346
|
+
if (!m)
|
|
1347
|
+
return o;
|
|
1348
|
+
var i = m.call(o), r2, ar = [], e;
|
|
1349
|
+
try {
|
|
1350
|
+
while ((n === void 0 || n-- > 0) && !(r2 = i.next()).done) {
|
|
1351
|
+
ar.push(r2.value);
|
|
1352
|
+
}
|
|
1353
|
+
} catch (error) {
|
|
1354
|
+
e = {
|
|
1355
|
+
error
|
|
1356
|
+
};
|
|
1357
|
+
} finally {
|
|
1358
|
+
try {
|
|
1359
|
+
if (r2 && !r2.done && (m = i["return"]))
|
|
1360
|
+
m.call(i);
|
|
1361
|
+
} finally {
|
|
1362
|
+
if (e)
|
|
1363
|
+
throw e.error;
|
|
1364
|
+
}
|
|
1365
|
+
}
|
|
1366
|
+
return ar;
|
|
1367
|
+
};
|
|
1368
|
+
var __spread = function() {
|
|
1369
|
+
for (var ar = [], i = 0; i < arguments.length; i++) {
|
|
1370
|
+
ar = ar.concat(__read$1(arguments[i]));
|
|
1371
|
+
}
|
|
1372
|
+
return ar;
|
|
1373
|
+
};
|
|
1374
|
+
function useLockFn(fn) {
|
|
1375
|
+
var _this = this;
|
|
1376
|
+
var lockRef = useRef(false);
|
|
1377
|
+
return useCallback(function() {
|
|
1378
|
+
var args = [];
|
|
1379
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1380
|
+
args[_i] = arguments[_i];
|
|
1381
|
+
}
|
|
1382
|
+
return __awaiter(_this, void 0, void 0, function() {
|
|
1383
|
+
var ret, e_1;
|
|
1384
|
+
return __generator(this, function(_a) {
|
|
1385
|
+
switch (_a.label) {
|
|
1386
|
+
case 0:
|
|
1387
|
+
if (lockRef.current)
|
|
1388
|
+
return [
|
|
1389
|
+
2
|
|
1390
|
+
];
|
|
1391
|
+
lockRef.current = true;
|
|
1392
|
+
_a.label = 1;
|
|
1393
|
+
case 1:
|
|
1394
|
+
_a.trys.push([1, 3, , 4]);
|
|
1395
|
+
return [
|
|
1396
|
+
4,
|
|
1397
|
+
fn.apply(void 0, __spread(args))
|
|
1398
|
+
];
|
|
1399
|
+
case 2:
|
|
1400
|
+
ret = _a.sent();
|
|
1401
|
+
lockRef.current = false;
|
|
1402
|
+
return [
|
|
1403
|
+
2,
|
|
1404
|
+
ret
|
|
1405
|
+
];
|
|
1406
|
+
case 3:
|
|
1407
|
+
e_1 = _a.sent();
|
|
1408
|
+
lockRef.current = false;
|
|
1409
|
+
throw e_1;
|
|
1410
|
+
case 4:
|
|
1411
|
+
return [
|
|
1412
|
+
2
|
|
1413
|
+
];
|
|
1414
|
+
}
|
|
1415
|
+
});
|
|
1416
|
+
});
|
|
1417
|
+
}, [fn]);
|
|
1418
|
+
}
|
|
1419
|
+
var __read = function(o, n) {
|
|
1420
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
1421
|
+
if (!m)
|
|
1422
|
+
return o;
|
|
1423
|
+
var i = m.call(o), r2, ar = [], e;
|
|
1424
|
+
try {
|
|
1425
|
+
while ((n === void 0 || n-- > 0) && !(r2 = i.next()).done) {
|
|
1426
|
+
ar.push(r2.value);
|
|
1427
|
+
}
|
|
1428
|
+
} catch (error) {
|
|
1429
|
+
e = {
|
|
1430
|
+
error
|
|
1431
|
+
};
|
|
1432
|
+
} finally {
|
|
1433
|
+
try {
|
|
1434
|
+
if (r2 && !r2.done && (m = i["return"]))
|
|
1435
|
+
m.call(i);
|
|
1436
|
+
} finally {
|
|
1437
|
+
if (e)
|
|
1438
|
+
throw e.error;
|
|
1439
|
+
}
|
|
1440
|
+
}
|
|
1441
|
+
return ar;
|
|
1442
|
+
};
|
|
1443
|
+
(function() {
|
|
1444
|
+
for (var ar = [], i = 0; i < arguments.length; i++) {
|
|
1445
|
+
ar = ar.concat(__read(arguments[i]));
|
|
1446
|
+
}
|
|
1447
|
+
return ar;
|
|
1448
|
+
});
|
|
1449
|
+
const overflowScrollReg = /scroll|auto/i;
|
|
1450
|
+
function isElement(node) {
|
|
1451
|
+
const ELEMENT_NODE_TYPE = 1;
|
|
1452
|
+
return node.tagName !== "HTML" && node.tagName !== "BODY" && node.nodeType === ELEMENT_NODE_TYPE;
|
|
1453
|
+
}
|
|
1454
|
+
function getScrollParent(el, root) {
|
|
1455
|
+
let node = el;
|
|
1456
|
+
while (node && node !== root && isElement(node)) {
|
|
1457
|
+
const { overflowY } = window.getComputedStyle(node);
|
|
1458
|
+
if (overflowScrollReg.test(overflowY)) {
|
|
1459
|
+
return node;
|
|
1460
|
+
}
|
|
1461
|
+
node = node.parentNode;
|
|
1462
|
+
}
|
|
1463
|
+
return root;
|
|
1464
|
+
}
|
|
1465
|
+
function Loading(props) {
|
|
1466
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
1467
|
+
style: {
|
|
1468
|
+
color: props.color || "#999"
|
|
1469
|
+
}
|
|
1470
|
+
}, /* @__PURE__ */ React.createElement("svg", {
|
|
1471
|
+
height: "1em",
|
|
1472
|
+
viewBox: "0 0 100 40",
|
|
1473
|
+
style: { verticalAlign: "-0.125em" }
|
|
1474
|
+
}, /* @__PURE__ */ React.createElement("g", {
|
|
1475
|
+
stroke: "none",
|
|
1476
|
+
strokeWidth: "1",
|
|
1477
|
+
fill: "none",
|
|
1478
|
+
fillRule: "evenodd"
|
|
1479
|
+
}, /* @__PURE__ */ React.createElement("g", {
|
|
1480
|
+
transform: "translate(-100.000000, -71.000000)"
|
|
1481
|
+
}, /* @__PURE__ */ React.createElement("g", {
|
|
1482
|
+
transform: "translate(95.000000, 71.000000)"
|
|
1483
|
+
}, /* @__PURE__ */ React.createElement("g", {
|
|
1484
|
+
transform: "translate(5.000000, 0.000000)"
|
|
1485
|
+
}, [0, 1, 2].map((i) => /* @__PURE__ */ React.createElement("rect", {
|
|
1486
|
+
key: i,
|
|
1487
|
+
fill: "currentColor",
|
|
1488
|
+
x: 20 + i * 26,
|
|
1489
|
+
y: "16",
|
|
1490
|
+
width: "8",
|
|
1491
|
+
height: "8",
|
|
1492
|
+
rx: "2"
|
|
1493
|
+
}, /* @__PURE__ */ React.createElement("animate", {
|
|
1494
|
+
attributeName: "y",
|
|
1495
|
+
from: "16",
|
|
1496
|
+
to: "16",
|
|
1497
|
+
dur: "2s",
|
|
1498
|
+
begin: `${i * 0.2}s`,
|
|
1499
|
+
repeatCount: "indefinite",
|
|
1500
|
+
values: "16; 6; 26; 16; 16",
|
|
1501
|
+
keyTimes: "0; 0.1; 0.3; 0.4; 1",
|
|
1502
|
+
id: "circ-anim"
|
|
1503
|
+
})))))))));
|
|
1504
|
+
}
|
|
1505
|
+
function isWindow(element) {
|
|
1506
|
+
return element === window;
|
|
1507
|
+
}
|
|
1508
|
+
function InfiniteScroll(props) {
|
|
1509
|
+
const { className, hasMore, loadMore, threshold = 0, style } = props;
|
|
1510
|
+
const doLoadMore = useLockFn(async () => {
|
|
1511
|
+
await loadMore();
|
|
1512
|
+
});
|
|
1513
|
+
const elementRef = useRef(null);
|
|
1514
|
+
const check = usePersistFn(() => {
|
|
1515
|
+
if (!hasMore)
|
|
1516
|
+
return;
|
|
1517
|
+
const element = elementRef.current;
|
|
1518
|
+
if (!element)
|
|
1519
|
+
return;
|
|
1520
|
+
const parent = getScrollParent(element);
|
|
1521
|
+
if (!parent)
|
|
1522
|
+
return;
|
|
1523
|
+
const elementTop = element.getBoundingClientRect().top;
|
|
1524
|
+
const current = isWindow(parent) ? window.innerHeight : parent.getBoundingClientRect().bottom;
|
|
1525
|
+
if (current >= elementTop - threshold) {
|
|
1526
|
+
doLoadMore();
|
|
1527
|
+
}
|
|
1528
|
+
});
|
|
1529
|
+
useEffect(() => {
|
|
1530
|
+
check();
|
|
1531
|
+
});
|
|
1532
|
+
useEffect(() => {
|
|
1533
|
+
const element = elementRef.current;
|
|
1534
|
+
if (!element)
|
|
1535
|
+
return;
|
|
1536
|
+
const parent = getScrollParent(element);
|
|
1537
|
+
if (!parent)
|
|
1538
|
+
return;
|
|
1539
|
+
function onScroll() {
|
|
1540
|
+
check();
|
|
1541
|
+
}
|
|
1542
|
+
parent.addEventListener("scroll", onScroll);
|
|
1543
|
+
return () => {
|
|
1544
|
+
parent.removeEventListener("scroll", onScroll);
|
|
1545
|
+
};
|
|
1546
|
+
}, []);
|
|
1547
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
1548
|
+
className: classNames({ [className]: true, "pda-infinite-scroll": true }),
|
|
1549
|
+
style,
|
|
1550
|
+
ref: elementRef
|
|
1551
|
+
}, hasMore ? /* @__PURE__ */ React.createElement("div", {
|
|
1552
|
+
className: "pda-infinite-scroll-view"
|
|
1553
|
+
}, /* @__PURE__ */ React.createElement("span", null, "\u52A0\u8F7D\u4E2D"), /* @__PURE__ */ React.createElement(Loading, null)) : /* @__PURE__ */ React.createElement("div", {
|
|
1554
|
+
className: "pda-infinite-scroll-view"
|
|
1555
|
+
}, /* @__PURE__ */ React.createElement("span", null, "\u6CA1\u6709\u66F4\u591A\u4E86~")));
|
|
1556
|
+
}
|
|
1557
|
+
export { BaseLayout, Button, Confirm$1 as Confirm, PdaDistanceCard as DistanceCard, PdaFinishCard as FinishCard, InfiniteScroll, PdaInfoCard$2 as InfoCard, List, PdaListItem as ListItem, Overlay, index$a as PageFlowSystemPages, Presentation, PdaInfoCard as Steps, SubCard, PdaTitle as Title, Confirm as Toast, WakeKeyborard };
|