1/*! For license information please see 5382.16b77ee9.chunk.js.LICENSE.txt */ 2(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[5382],{25380:e=>{function t(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}t.keys=()=>[],t.resolve=t,t.id=25380,e.exports=t},53666:(e,t,r)=>{"use strict";r.d(t,{r:()=>c});var n,i=r(94599);function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},a.apply(this,arguments)}function o(e,t){let{title:r,titleId:o,...c}=e;return i.createElement("svg",a({className:"github",width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":o},c),r?i.createElement("title",{id:o},r):null,n||(n=i.createElement("path",{d:"M10 0C4.475 0 0 4.475 0 10a9.994 9.994 0 006.838 9.488c.5.087.687-.213.687-.476 0-.237-.013-1.024-.013-1.862-2.512.463-3.162-.612-3.362-1.175-.113-.287-.6-1.175-1.025-1.412-.35-.188-.85-.65-.013-.663.788-.013 1.35.725 1.538 1.025.9 1.512 2.337 1.087 2.912.825.088-.65.35-1.088.638-1.338-2.225-.25-4.55-1.112-4.55-4.937 0-1.088.387-1.987 1.025-2.688-.1-.25-.45-1.274.1-2.65 0 0 .837-.262 2.75 1.026a9.28 9.28 0 012.5-.338c.85 0 1.7.112 2.5.337 1.912-1.3 2.75-1.024 2.75-1.024.55 1.375.2 2.4.1 2.65.637.7 1.025 1.587 1.025 2.687 0 3.838-2.337 4.688-4.562 4.938.362.312.675.912.675 1.85 0 1.337-.013 2.412-.013 2.75 0 .262.188.574.688.474A10.016 10.016 0 0020 10c0-5.525-4.475-10-10-10z"})))}const c=i.forwardRef(o);r.p},25746:(e,t,r)=>{"use strict";r.d(t,{r:()=>c});var n,i=r(94599);function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},a.apply(this,arguments)}function o(e,t){let{title:r,titleId:o,...c}=e;return i.createElement("svg",a({width:"256px",height:"256px",viewBox:"0 0 256 256",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":o},c),r?i.createElement("title",{id:o},r):null,n||(n=i.createElement("g",{id:"Page-1",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},i.createElement("path",{d:"M84.4999999,25 L133,60.1408731 L114.474648,117 L54.5253515,117 L36,60.1408731 L84.4999999,25 Z M84.4999999,231 L36,195.859127 L54.5253515,139 L114.474648,139 L133,195.859127 L84.4999999,231 Z M220,158.475503 L163.141427,177 L128,128.499472 L163.139977,80 L219.999104,98.5262065 L220,158.475503 Z",id:"Shape",fill:"#4A4A4A",fillRule:"nonzero"}))))}const c=i.forwardRef(o);r.p},67903:(e,t,r)=>{"use strict";r.d(t,{Z:()=>d});const n={warpper:"index_warpper__nTxI0",inner:"index_inner__9mZFw",icons:"index_icons__N9xD3",nav:"index_nav__u5cFC",badges:"index_badges__Oa-js"};var i,a=r(25746),o=r(53666),c=r(94599);function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},s.apply(this,arguments)}function l(e,t){let{title:r,titleId:n,...a}=e;return c.createElement("svg",s({viewBox:"0 0 1024 1024",width:20,height:20,xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":n},a),r?c.createElement("title",{id:n},r):null,i||(i=c.createElement("path",{d:"M512 1024C229.2224 1024 0 794.7776 0 512S229.2224 0 512 0s512 229.2224 512 512-229.2224 512-512 512z m259.1488-568.8832H480.4096a25.2928 25.2928 0 0 0-25.2928 25.2928l-0.0256 63.2064c0 13.952 11.3152 25.2928 25.2672 25.2928h177.024c13.9776 0 25.2928 11.3152 25.2928 25.2672v12.6464a75.8528 75.8528 0 0 1-75.8528 75.8528H366.592a25.2928 25.2928 0 0 1-25.2672-25.2928v-240.1792a75.8528 75.8528 0 0 1 75.8272-75.8528h353.9456a25.2928 25.2928 0 0 0 25.2672-25.2928l0.0768-63.2064a25.2928 25.2928 0 0 0-25.2672-25.2928H417.152a189.6192 189.6192 0 0 0-189.6192 189.6448v353.9456c0 13.9776 11.3152 25.2928 25.2928 25.2928h372.9408a170.6496 170.6496 0 0 0 170.6496-170.6496v-145.408a25.2928 25.2928 0 0 0-25.2928-25.2672z",fill:"#C71D23"})))}const u=c.forwardRef(l);r.p;var f=r(51962);const h=[{title:"Product",childrens:[{href:"https://github.com/uiwjs/react-native-uiw",title:"React Native UIW"},{href:"https://github.com/uiwjs/react-native-template",title:"React Native Template"},{href:"https://github.com/uiwjs/react-native-alipay",title:"React Native Alipay"},{href:"https://github.com/uiwjs/react-native-amap-geolocation",title:"React Native AMap Geolocation"},{href:"https://uiw.gitee.io/react-native-uiw/",title:"\u56fd\u5185\u955c\u50cf\u7ad9\u70b9 \ud83c\udde8\ud83c\uddf3"}]},{title:"\u76f8\u5173\u8d44\u6e90",childrens:[{href:"https://uiwjs.github.io/icons",title:"Preview Icons"},{href:"https://github.com/react-native-community/upgrade-helper",title:"React Native Upgrade Helper"},{href:"https://github.com/jondot/awesome-react-native",title:"Awesome React Native"},{href:"https://github.com/uiwjs/uiw",title:"UIW on GitHub"}]},{title:"\u76f8\u5173\u7ec4\u4ef6",childrens:[{href:"https://github.com/react-navigation/react-navigation",title:"React Navigation"},{href:"https://github.com/rematch/rematch",title:"Rematch.js"}]},{title:"\u5176\u5b83\u8d44\u6599",childrens:[{href:"https://github.com/facebook/react",title:"React"},{href:"https://github.com/facebook/react-native",title:"React Native"},{href:"https://github.com/jaywcjlove/mocker-api",title:"Mocker API"}
2,{href:"https://www.pgyer.com/",title:"App \u5e94\u7528\u5185\u6d4b\u5206\u53d1\u6258\u7ba1"}]},{title:"\u5b66\u4e60\u8d44\u6599",childrens:[{href:"https://www.reactnative.express/",title:"React Native Express"},{href:"https://www.react.express/",title:"React Express"},{href:"https://jskatas.org/",title:"JavaScript Katas"},{href:"https://www.typescriptlang.org/",title:"TypeScript"},{href:"https://es6.ruanyifeng.com/",title:"ES6 \u5165\u95e8\u6559\u7a0b"}]}];function d(e){const{placement:t}=e;return(0,f.jsx)("footer",{className:n.warpper,children:(0,f.jsxs)("div",{className:n.inner,style:{..."left"===t?{margin:"inherit"}:{}},children:[(0,f.jsx)("div",{className:n.nav,children:h.map(((e,t)=>(0,f.jsx)("nav",{children:(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{children:e.title}),(0,f.jsx)("ul",{children:e.childrens.map(((e,t)=>(0,f.jsx)("li",{children:(0,f.jsx)("a",{href:e.href,target:"__blank",children:e.title})},t)))})]})},t)))}),(0,f.jsxs)("section",{children:[(0,f.jsxs)("div",{className:n.icons,children:[(0,f.jsx)("a",{href:"https://uiwjs.github.io/react-native-uiw/",target:"__blank",children:(0,f.jsx)(a.r,{height:"27",width:"27"})}),(0,f.jsx)("a",{href:"https://github.com/uiwjs/react-native-uiw",target:"__blank",children:(0,f.jsx)(o.r,{})}),(0,f.jsx)("a",{href:"https://gitee.com/uiw/react-native-uiw",target:"__blank",children:(0,f.jsx)(u,{})})]}),(0,f.jsxs)("div",{className:n.icons,children:[(0,f.jsx)("a",{href:"https://github.com/uiwjs/react-native-uiw/issues",target:"__blank",children:(0,f.jsx)("img",{src:"https://img.shields.io/github/issues/uiwjs/react-native-uiw.svg",alt:"Github Issues"})}),(0,f.jsx)("a",{href:"https://github.com/uiwjs/react-native-uiw/network",target:"__blank",children:(0,f.jsx)("img",{src:"https://img.shields.io/github/forks/uiwjs/react-native-uiw.svg",alt:"Github Forks"})}),(0,f.jsx)("a",{href:"https://github.com/uiwjs/react-native-uiw/stargazers",target:"__blank",children:(0,f.jsx)("img",{src:"https://img.shields.io/github/stars/uiwjs/react-native-uiw.svg",alt:"Github Stars"})}),(0,f.jsx)("a",{href:"https://github.com/uiwjs/react-native-uiw/releases",target:"__blank",children:(0,f.jsx)("img",{src:"https://img.shields.io/github/release/uiwjs/react-native-uiw.svg",alt:"Github Release"})}),(0,f.jsx)("a",{href:"https://github.com/uiwjs/react-native-uiw",target:"__blank",children:(0,f.jsx)("img",{src:"https://img.shields.io/dub/l/vibe-d.svg",alt:"License MIT"})}),(0,f.jsx)("a",{href:"https://www.npmjs.com/package/@uiw/react-native",target:"__blank",children:(0,f.jsx)("img",{src:"https://img.shields.io/npm/v/@uiw/react-native.svg",alt:"npm"})})]}),(0,f.jsxs)("p",{children:["Copyright \xa9 2021"," ",(0,f.jsx)("a",{href:"https://github.com/uiwjs",target:"__blank",children:"uiwjs"}),". All rights reserved."]})]})]})})}},76427:(e,t,r)=>{"use strict";r.d(t,{Z:()=>g});var n=r(17186),i=r(41925),a=r(4565),o=r(26706),c=r(47756),s=r(18736),l=r(94599),u=r(51962);function f(e){const{path:t}=e,r=/^http/.test(t||"")?t:"https://github.com/uiwjs/react-native-uiw/edit/master/".concat(null===t||void 0===t?void 0:t.replace(/^\//,""));return(0,u.jsxs)("div",{style:{paddingBlock:20},children:[t&&r&&(0,u.jsx)("a",{href:r,target:"_blank",rel:"noopener noreferrer",style:{color:"#333"},children:"\u5728Github\u4e0a\u7f16\u8f91\u672c\u9875\uff01"}),(0,u.jsx)(o.iz,{type:"vertical"}),(0,u.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:"https://github.com/uiwjs/react-native-uiw/issues",style:{color:"#333"},children:"\u63d0\u4ea4bug"})]})}var h,d,p=r(67903);const m=a.ZP.div(h||(h=(0,n.Z)(["\n width: 100%;\n height: 100%;\n overflow: auto;\n .w-rcpl-preview {\n white-space: normal;\n }\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n"]))),y=(0,a.ZP)(i.Z)(d||(d=(0,n.Z)(["\n padding: 50px 50px 120px 50px;\n /* max-width: 1024px; */\n width: 1024px;\n"]))),v=(e,t,r)=>{if(Reflect.has(e,t)){return"true"===Reflect.get(e,t)}return r},g=e=>{let{path:t,...r}=e;const n=s.ZP.Preview,i=s.ZP.Code,a=s.ZP.Toolbar,h=(0,l.useRef)(null);return(0,u.jsxs)(m,{ref:h,children:[(0,u.jsx)(y,{...r,disableCopy:!0,source:r.source,rehypeRewrite:(e,t,r)=>{if("element"===e.type&&r&&"root"===r.type&&/h(1|2|3|4|5|6)/.test(e.tagName)){const t=e.children&&e.children[0];t&&t.properties&&"true"===t.properties.ariaHidden&&(t.children=[])}},components:{code:e=>{var t;let{inline:o,node:l,...f}=e;const{"data-meta":h,...d}=f;if(o||!(0,c.pN)(h))return(0,u.jsx)("code",{...f});const p=null===(t=l.position)||void 0===t?void 0:t.start.line,m=(0,c.Mx)(h)||String(p),y=r.components["".concat(m)];if(m&&"function"===typeof y){const e=r.data[m].value||"",t=(0,c.aE)(h);return(0,u.jsxs)(s.ZP,{disableCheckered:v(t,"disableCheckered",!0),bordered:v(t,"bordered",!0),children:[(0,u.jsx)(n,{children:(0,u.jsx)(y,{})}),(0,u.jsx)(a,{text:e,copied:v(t,"copied",!0),children:t.title||"\u793a\u4f8b"}),(0,u.jsx)(i,{children:(0,u.jsx)("code",{...d})})]})}return(0,u.jsx)("code",{...d})}}}),(0,u.jsx)(p.Z,{}),(0,u.jsx)(f,{path:t}),(0,u.jsx)(o.kF,{speed:500,children:e=>{let{percent:t,scrollToTop:r}=e;return(0,u.jsx)(o.Cd,{width:50,onClick:()=>r(),format:()=>(0,u.jsx)(o.JO,{type:"arrow-up"}),percent:t})}})]})}},29731:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Component:()=>o});var n=r(76427);const i={components:{8:function(){function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}var t=function(t,r){if(!r&&t&&t.__esModule)return t;if(null===t||"object"!=e(t)&&"function"!=typeof t)return{default:t};var n=c(r);if(n&&n.has(t))return n.get(t);var i={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if("default"!==o&&Object.prototype.hasOwnProperty.call(t,o)){var s=a?Object.getOwnPropertyDescriptor(t,o):null;
vendor: 4,590 bytes, line 2
2s&&(s.get||s.set)?Object.defineProperty(i,o,s):i[o]=t[o]}return i.default=t,n&&n.set(t,i),i}(r(94599)),n=r(56294),i=o(r(10165)),a=o(r(58904));function o(e){return e&&e.__esModule?e:{default:e}}function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(c=function(e){return e?r:t})(e)}function s(){s=function(){return r};var t,r={},n=Object.prototype,i=n.hasOwnProperty,a=Object.defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof Symbol?Symbol:{},c=o.iterator||"@@iterator",l=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(t){f=function(e,t,r){return e[t]=r}}function h(e,t,r,n){var i,o,c=t&&(i=t.prototype,null!=(o=w)&&"undefined"!==typeof Symbol&&o[Symbol.hasInstance]?o[Symbol.hasInstance](i):i instanceof o)?t:w,s=Object.create(c.prototype),l=new D(n||[]);return a(s,"_invoke",{value:I(e,r,l)}),s}function d(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}r.wrap=h;var p="suspendedStart",m="suspendedYield",y="executing",v="completed",g={};function w(){}function b(){}function x(){}var _={};f(_,c,(function(){return this}));var L=Object.getPrototypeOf,j=L&&L(L(P([])));j&&j!==n&&i.call(j,c)&&(_=j);var k=x.prototype=w.prototype=Object.create(_);function S(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function E(t,r){function n(a,o,c,s){var l=d(t[a],t,o);if("throw"!==l.type){var u=l.arg,f=u.value;return f&&"object"==e(f)&&i.call(f,"__await")?r.resolve(f.__await).then((function(e){n("next",e,c,s)}),(function(e){n("throw",e,c,s)})):r.resolve(f).then((function(e){u.value=e,c(u)}),(function(e){return n("throw",e,c,s)}))}s(l.arg)}var o;a(this,"_invoke",{value:function(e,t){function i(){return new r((function(r,i){n(e,t,r,i)}))}return o=o?o.then(i,i):i()}})}function I(e,r,n){var i=p;return function(a,o){if(i===y)throw new Error("Generator is already running");if(i===v){if("throw"===a)throw o;return{value:t,done:!0}}for(n.method=a,n.arg=o;;){var c=n.delegate;if(c){var s=A(c,n);if(s){if(s===g)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===p)throw i=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=y;var l=d(e,r,n);if("normal"===l.type){if(i=n.done?v:m,l.arg===g)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=v,n.method="throw",n.arg=l.arg)}}}function A(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,A(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var a=d(i,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,g;var o=a.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function R(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function D(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(R,this),this.reset(!0)}function P(r){if(r||""===r){var n=r[c];if(n)return n.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var a=-1,o=function e(){for(;++a<r.length;)if(i.call(r,a))return e.value=r[a],e.done=!1,e;return e.value=t,e.done=!0,e};return o.next=o}}throw new TypeError(e(r)+" is not iterable")}return b.prototype=x,a(k,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:b,configurable:!0}),b.displayName=f(x,u,"GeneratorFunction"),r.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},r.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,x):(e.__proto__=x,f(e,u,"GeneratorFunction")),e.prototype=Object.create(k),e},r.awrap=function(e){return{__await:e}},S(E.prototype),f(E.prototype,l,(function(){return this})),r.AsyncIterator=E,r.async=function(e,t,n,i,a){void 0===a&&(a=Promise);var o=new E(h(e,t,n,i),a);return r.isGeneratorFunction(t)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},S(k),f(k,u,"Generator"),f(k,c,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"}
2)),r.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},r.values=P,D.prototype={constructor:D,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(n,i){return c.type="throw",c.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],c=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=i.call(o,"catchLoc"),l=i.call(o,"finallyLoc");if(s&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),T(r),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;T(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:P(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},r}function l(e){return function(e){if(Array.isArray(e))return d(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||h(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t,r,n,i,a,o){try{var c=e[a](o),s=c.value}catch(l){return void r(l)}c.done?t(s):Promise.resolve(s).then(n,i)}function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,a,o,c=[],s=!0,l=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=a.call(r)).done)&&(c.push(n.value),c.length!==t);s=!0);}catch(e){l=!0,i=e}finally{try{if(!s&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(l)throw i}}return c}}(e,t)||h(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e,t){if(e){if("string"===typeof e)return d(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?d(e,t):void 0}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var p=[{name:"@uiw/react-native QuickList",id:1},{name:"@uiw/react-native QuickList",id:2},{name:"@uiw/react-native QuickList",id:3},{name:"@uiw/react-native QuickList",id:4},{name:"@uiw/react-native QuickList",id:5},{name:"@uiw/react-native QuickList",id:6},{name:"@uiw/react-native QuickList",id:7},{name:"@uiw/react-native QuickList",id:8},{name:"@uiw/react-native QuickList",id:9},{name:"@uiw/react-native QuickList",id:10}];return function(e){var r=(0,t.useRef)(),o=f((0,t.useState)(0),2),c=o[0],h=o[1],d=f((0,t.useState)([]),2),m=d[0],y=d[1],v=function(e){return new Promise((function(t){return setTimeout((function(){return t("")}),e)}))},g=function(){var e,t=(e=s().mark((function e(t){var r,n,i,a,o,c,u;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.page,n=t.pageSize,1!==r){e.next=7;break}return e.next=4,v(500);case 4:y(p),e.next=13;break;case 7:for(i=[],a=0;a<n;a++)o=m.length+.1*n+a,c={name:"@uiw/react-native QuickList",id:o},i.push(c);return u=[].concat(l(m),i),e.next=12,v(500);case 12:y(u);case 13:h(40);case 14:case"end":return e.stop()}}),e)})),function(){var t=this,r=arguments;return new Promise((function(n,i){var a=e.apply(t,r);function o(e){u(a,n,i,o,c,"next",e)}function c(e){u(a,n,i,o,c,"throw",e)}o(void 0)}))});return function(e){return t.apply(this,arguments)}}();return t.default.createElement(n.SafeAreaView,{style:{height:300}},t.default.createElement(i.default,{ref:r,onFetch:g,data:m,total:c,renderItem:function(e){return function(e){return t.default.createElement(a.default,{flat:!1},t.default.createElement(n.View,{style:{padding:10,display:"flex",alignItems:"center",flexDirection:"row"}},t.default.createElement(n.View,{style:{marginLeft:10}},t.default.createElement(n.Text,{style:{marginBottom:5,fontSize:18}},"react-native"),t.default.createElement(n.Text,{style:{color:"#808080"}},e.name))))}(e.item)},keyId:"id"}))}}()},data:{8:{name:8,meta:{background:"#bebebe29"},code:'"use strict";\n\nfunction _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }\nfunction _instanceof(left, right) { if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) { return !!right[Symbol.hasInstance](left); } else { return left instanceof right; } }\nvar _react = _interopRequireWildcard(require("react"));\nvar _reactNative = require("react-native");\nvar _QuickList = _interopRequireDefault(require("@uiw/react-native/lib/QuickList"));\nvar _List = _interopRequireDefault(require("@uiw/react-native/lib/List"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }\nfunction _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esMo
2dule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }\nfunction _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && _instanceof(e.prototype, Generator) ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap;
vendor: 5,448 bytes, line 2
2 var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a \'" + n + "\' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEac
2h(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nvar defaultData = [{\n name: \'@uiw/react-native QuickList\',\n id: 1\n}, {\n name: \'@uiw/react-native QuickList\',\n id: 2\n}, {\n name: \'@uiw/react-native QuickList\',\n id: 3\n}, {\n name: \'@uiw/react-native QuickList\',\n id: 4\n}, {\n name: \'@uiw/react-native QuickList\',\n id: 5\n}, {\n name: \'@uiw/react-native QuickList\',\n id: 6\n}, {\n name: \'@uiw/react-native QuickList\',\n id: 7\n}, {\n name: \'@uiw/react-native QuickList\',\n id: 8\n}, {\n name: \'@uiw/react-native QuickList\',\n id: 9\n}, {\n name: \'@uiw/react-native QuickList\',\n id: 10\n}];\nvar QuickListDemo = function QuickListDemo(props) {\n var baseRef = (0, _react.useRef)();\n var _useState = (0, _react.useState)(0),\n _useState2 = _slicedToArray(_useState, 2),\n total = _useState2[0],\n setTotal = _useState2[1];\n var _useState3 = (0, _react.useState)([]),\n _useState4 = _slicedToArray(_useState3, 2),\n data = _useState4[0],\n setData = _useState4[1];\n var sleep = function sleep(time) {\n return new Promise(function (resolve) {\n return setTimeout(function () {\n return resolve(\'\');\n }, time);\n });\n };\n // \u6a21\u62df\u8bf7\u6c42\n var fethList = /*#__PURE__*/function () {\n var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(params) {\n var page, pageSize, fetchData, i, id, name, obj, newData;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n page = params.page, pageSize = params.pageSize;\n if (!(page === 1)) {\n _context.next = 7;\n break;\n }\n _context.next = 4;\n return sleep(500);\n case 4:\n setData(defaultData);\n _context.next = 13;\n break;\n case 7:\n fetchData = [];\n for (i = 0; i < pageSize;
2 i++) {\n id = data.length + 1 / 10 * pageSize + i;\n name = "@uiw/react-native QuickList";\n obj = {\n name: name,\n id: id\n };\n fetchData.push(obj);\n }\n newData = [].concat(_toConsumableArray(data), fetchData);\n _context.next = 12;\n return sleep(500);\n case 12:\n setData(newData);\n case 13:\n setTotal(40);\n case 14:\n case "end":\n return _context.stop();\n }\n }, _callee);\n }));\n return function fethList(_x) {\n return _ref.apply(this, arguments);\n };\n }();\n // \u5217\u8868\u6e32\u67d3\n var ListItem = function ListItem(item) {\n return /*#__PURE__*/_react["default"].createElement(_List["default"], {\n flat: false\n }, /*#__PURE__*/_react["default"].createElement(_reactNative.View, {\n style: {\n padding: 10,\n display: "flex",\n alignItems: "center",\n flexDirection: "row"\n }\n }, /*#__PURE__*/_react["default"].createElement(_reactNative.View, {\n style: {\n marginLeft: 10\n }\n }, /*#__PURE__*/_react["default"].createElement(_reactNative.Text, {\n style: {\n marginBottom: 5,\n fontSize: 18\n }\n }, "react-native"), /*#__PURE__*/_react["default"].createElement(_reactNative.Text, {\n style: {\n color: "#808080"\n }\n }, item.name))));\n };\n return /*#__PURE__*/_react["default"].createElement(_reactNative.SafeAreaView, {\n style: {\n height: 300\n }\n }, /*#__PURE__*/_react["default"].createElement(_QuickList["default"], {\n ref: baseRef,\n onFetch: fethList,\n data: data,\n total: total,\n renderItem: function renderItem(_ref2) {\n var item = _ref2.item;\n return ListItem(item);\n },\n keyId: "id"\n }));\n};\nreturn QuickListDemo;',language:"jsx",value:"import React, { useRef, useState } from 'react';\nimport { SafeAreaView, Image, View, Text } from 'react-native';\nimport QuickList from '@uiw/react-native/lib/QuickList';\nimport List from '@uiw/react-native/lib/List';\n\n\nconst defaultData = [\n { name: '@uiw/react-native QuickList', id: 1 },\n { name: '@uiw/react-native QuickList', id: 2 },\n { name: '@uiw/react-native QuickList', id: 3 },\n { name: '@uiw/react-native QuickList', id: 4 },\n { name: '@uiw/react-native QuickList', id: 5 },\n { name: '@uiw/react-native QuickList', id: 6 },\n { name: '@uiw/react-native QuickList', id: 7 },\n { name: '@uiw/react-native QuickList', id: 8 },\n { name: '@uiw/react-native QuickList', id: 9 },\n { name: '@uiw/react-native QuickList', id: 10 },\n];\n\nconst QuickListDemo = (props) => {\n const baseRef = useRef();\n const [total, setTotal] = useState(0)\n const [data, setData] = useState([])\n const sleep = (time) => new Promise((resolve) => setTimeout(() => resolve(''), time))\n // \u6a21\u62df\u8bf7\u6c42\n const fethList = async (params) => {\n const { page, pageSize } = params\n if (page === 1) {\n await sleep(500)\n setData(defaultData)\n } else {\n let fetchData = []\n for (let i = 0; i < pageSize; i++) {\n const id = (data.length + 1 / 10 * pageSize) + i\n const name = `@uiw/react-native QuickList`;\n let obj = { name, id }\n fetchData.push(obj)\n }\n let newData = [...data, ...fetchData]\n await sleep(500)\n setData(newData)\n }\n setTotal(40)\n }\n // \u5217\u8868\u6e32\u67d3\n const ListItem = (item) => {\n return (\n <List flat={false}>\n <View\n style={{ padding: 10, display: \"flex\", alignItems: \"center\", flexDirection: \"row\" }}>\n <View style={{ marginLeft: 10 }}>\n <Text style={{ marginBottom: 5, fontSize: 18 }}>react-native</Text>\n <Text style={{ color:\"#808080\"}}>{item.name}</Text>\n </View>\n </View>\n </List>\n )\n }\n\n return (\n <SafeAreaView style={{ height:300 }}>\n <QuickList\n ref={baseRef}\n onFetch={fethList}\n data={data}\n total={total}\n renderItem={({ item }) => ListItem(item)}\n keyId=\"id\"\n />\n </SafeAreaView>\n );\n}\nexport default QuickListDemo"}},source:"QuickList \u5feb\u901f\u8bf7\u6c42\u5217\u8868\n---\n\n\u5feb\u901f\u5b8c\u6210\u4e0a\u62c9\u4e0b\u62c9\u8bf7\u6c42\u5217\u8868\u3002\n\n### \u57fa\u7840\u793a\u4f8b\n\n```jsx mdx:preview&background=#bebebe29\nimport React, { useRef, useState } from 'react';\nimport { SafeAreaView, Image, View, Text } from 'react-native';\nimport QuickList from '@uiw/react-native/lib/QuickList';\nimport List from '@uiw/react-native/lib/List';\n\n\nconst defaultData = [\n { name: '@uiw/react-native QuickList', id: 1 },\n { name: '@uiw/react-native QuickList', id: 2 },\n { name: '@uiw/react-native QuickList', id: 3 },\n { name: '@uiw/react-native QuickList', id: 4 },\n { name: '@uiw/react-native QuickList', id: 5 },\n { name: '@uiw/react-native QuickList', id: 6 },\n { name: '@uiw/react-native QuickList', id: 7 },\n { name: '@uiw/react-native QuickList', id: 8 },\n { name: '@uiw/react-native QuickList', id: 9 },\n { name: '@uiw/react-native QuickList', id: 10 },\n];\n\nconst QuickListDemo = (props) =>
2 {\n const baseRef = useRef();\n const [total, setTotal] = useState(0)\n const [data, setData] = useState([])\n const sleep = (time) => new Promise((resolve) => setTimeout(() => resolve(''), time))\n // \u6a21\u62df\u8bf7\u6c42\n const fethList = async (params) => {\n const { page, pageSize } = params\n if (page === 1) {\n await sleep(500)\n setData(defaultData)\n } else {\n let fetchData = []\n for (let i = 0; i < pageSize; i++) {\n const id = (data.length + 1 / 10 * pageSize) + i\n const name = `@uiw/react-native QuickList`;\n let obj = { name, id }\n fetchData.push(obj)\n }\n let newData = [...data, ...fetchData]\n await sleep(500)\n setData(newData)\n }\n setTotal(40)\n }\n // \u5217\u8868\u6e32\u67d3\n const ListItem = (item) => {\n return (\n <List flat={false}>\n <View\n style={{ padding: 10, display: \"flex\", alignItems: \"center\", flexDirection: \"row\" }}>\n <View style={{ marginLeft: 10 }}>\n <Text style={{ marginBottom: 5, fontSize: 18 }}>react-native</Text>\n <Text style={{ color:\"#808080\"}}>{item.name}</Text>\n </View>\n </View>\n </List>\n )\n }\n\n return (\n <SafeAreaView style={{ height:300 }}>\n <QuickList\n ref={baseRef}\n onFetch={fethList}\n data={data}\n total={total}\n renderItem={({ item }) => ListItem(item)}\n keyId=\"id\"\n />\n </SafeAreaView>\n );\n}\nexport default QuickListDemo\n```\n\n### Props\n\n| \u5c5e\u6027 | \u8bf4\u660e | \u7c7b\u578b | \u9ed8\u8ba4\u503c |\n| --- | --- | --- | --- |\n| onFetch | \u8bf7\u6c42\u7684\u63a5\u53e3\u51fd\u6570\uff09 | `(params: any) => void` | - |\n| data | \u6570\u636e | `Array<any>` | [] |\n| renderItem | \u4ecedata\u5217\u8868\u4e2d\u83b7\u53d6\u4e00\u4e2a\u9879\u76ee\u5e76\u5c06\u5176\u6e32\u67d3\u5230\u5217\u8868\u4e2d | `ListRenderItem<any>` | - |\n| keyId | \u552f\u4e00\u5065 | `string` \\| `number` | - |\n| emptyView | \u5f53\u5217\u8868\u4e3a\u7a7a\u65f6\u5448\u73b0 | `() => React.ReactNode` | - |\n| pageSize | \u6bcf\u6b21\u52a0\u8f7d\u6570\u636e\u6761\u6570 | `number` | - |\n| total | \u603b\u6761\u6570 | `number` | - |\n| style | \u6837\u5f0f | `Object` | - |\n",headings:[],headingsList:[]};var a=r(51962);const o=()=>(0,a.jsx)(n.Z,{...i,path:"/packages/core/src/QuickList/README.md"})},58904:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>d});var n=r(94599),i=r(86703),a=r(66396),o=r(88700),c=r(21596),s=r(41758),l=r(51962);class u extends n.PureComponent{render(){const{children:e,style:t,onPress:r,paddingLeft:a,underlayColor:s,extra:u,extraStyle:h,touchableStyle:d,size:p,...m}=this.props;let y={};p&&f[p]&&(y=f[p]);const v=(0,l.jsxs)(i.Z,{style:[f.border,y,t],...m,children:[(0,l.jsx)(i.Z,{style:{flex:1,flexDirection:"row"},children:n.Children.toArray(e).map(((t,r)=>"string"===typeof e?(0,l.jsx)(o.Z,{color:"text",children:e},r):n.isValidElement(t)?n.cloneElement(t,{key:r}):null))}),u&&(0,l.jsx)(i.Z,{style:{paddingRight:10},children:"string"===typeof u?(0,l.jsx)(o.Z,{color:"primary_text",style:h,children:u}):(0,l.jsx)(i.Z,{style:[{flexDirection:"row",alignItems:"center"},h],children:u})})]});return r?(0,l.jsx)(c.Z,{style:[f.warpper,{paddingLeft:a},d],onPress:r,...m,children:v}):(0,l.jsx)(i.Z,{style:[{paddingLeft:a},f.warpper],children:v})}}u.defaultProps={underlayColor:"#DADADA"};const f=s.Z.create({warpper:{},border:{borderBottomWidth:s.Z.hairlineWidth,borderColor:"#CDCDCD",flexDirection:"row",alignItems:"center"},default:{paddingVertical:12},small:{paddingVertical:10},large:{paddingVertical:16}}),h=()=>null;class d extends n.PureComponent{constructor(e){super(e),this.state={data:[]}}static getDerivedStateFromProps(e){if(!e.renderItem){const t=(()=>{const{size:t,extra:r,paddingLeft:i,children:a}=e,o=n.Children.toArray(a).map((e=>{if(!n.isValidElement(e))return null;const a={size:t,...e.props};return n.cloneElement((0,l.jsx)(u,{paddingLeft:i,extra:r,...a}))})).filter(Boolean);return o}
2)();return{data:t}}return null}renderItemChild(e){return e.item}render(){const{renderItem:e,data:t,children:r,titleStyle:c,titleLabelStyle:s,paddingLeft:u,flat:f,size:d,extra:p,title:m,ListHeaderComponent:y,...v}=this.props,g={};e?"function"===typeof e&&(g.data=t,g.renderItem=t=>e({...t})):(g.data=this.state.data,g.renderItem=this.renderItemChild.bind(this));let w=y;return m&&(w=(0,l.jsx)(i.Z,{style:[{paddingLeft:u,paddingVertical:12},c],children:"string"===typeof m?(0,l.jsx)(o.Z,{color:"primary_text",style:[{fontWeight:"500"},s],children:m}):(0,l.jsx)(i.Z,{children:m})})),g.renderItem||(g.renderItem=h),f?(0,l.jsx)(a.Z,{ListHeaderComponent:w,keyExtractor:(e,t)=>t.toString(),...v,...g}):(0,l.jsx)(i.Z,{...v,children:(0,l.jsxs)(l.Fragment,{children:[w,(e&&(!t||0===t.length)||!e&&(!r||0===n.Children.toArray(r).length))&&v.ListEmptyComponent,(g.data||[]).map(((e,t)=>n.cloneElement(g.renderItem&&g.renderItem({item:e,index:t})||(0,l.jsx)(i.Z,{}),{key:t})))]})})}}d.Item=u,d.defaultProps={data:[],paddingLeft:16,flat:!0,size:"default"}},10165:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>d});var n=r(94599),i=r(66396),a=r(86703),o=r(24404),c=r(2172),s=r(51962);const l=()=>(0,s.jsx)(a.Z,{style:{width:"100%",justifyContent:"center",alignItems:"center",paddingVertical:12},children:(0,s.jsx)(o.Z,{children:"\u6682\u65e0\u6570\u636e..."})}),u=()=>(0,s.jsx)(a.Z,{style:{flex:1,paddingVertical:8},children:(0,s.jsx)(c.Z,{size:"large",color:"#000"})}),f=()=>(0,s.jsx)(a.Z,{style:{flex:1,paddingVertical:8},children:(0,s.jsx)(o.Z,{style:{textAlign:"center"},children:"\u6ca1\u6709\u66f4\u591a\u6570\u636e\u4e86"})}),h=(e,t)=>{const{onFetch:r,data:a,renderItem:o=null,keyId:c,emptyView:h=l,pageSize:d=10,total:p=0,style:m,...y}=e,v=0,g=1,w=2;let b=!0;
2const[x,_]=(0,n.useState)(Date.now()),[L,j]=(0,n.useState)(!0),[k,S]=(0,n.useState)(!1),[E,I]=(0,n.useState)(!1),[A,R]=(0,n.useState)(1),[T,D]=(0,n.useState)(v);(0,n.useImperativeHandle)(t,(()=>({executeRefreshAction:async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};R(1);const t={page:1,pageSize:d,...e};r&&await r(t)}}))),(0,n.useEffect)((()=>(b=!0,L&&P().catch((e=>{console.error(e)})),()=>{b=!1})),[L]),(0,n.useEffect)((()=>{if(L||0===p)return;let e=Math.ceil(p/d);D(e===A?w:g)}),[A,p,L,d]);const P=async()=>{if(T===v){R(1),I(!0);const e={page:1,pageSize:d,isRefresh:!0};await r(e),I(!1),j(!1)}},O=async()=>{if(T===v||T===w||E||k)return;S(!0);const e={page:A+1,pageSize:d,isRefresh:!1};await r(e),S(!1),R(A+1)};return(0,s.jsx)(i.Z,{...y,ref:t,onEndReachedThreshold:.1,data:a,renderItem:o,refreshing:E,extraData:a,keyExtractor:e=>e[c],initialNumToRender:d,onRefresh:async()=>{if(b&&!k){R(1),I(!0);const e={page:1,pageSize:d,isRefresh:!0};await r(e),I(!1)}},onEndReached:()=>{const e=Date.now();e-x>1e3&&(O&&O(),_(e))},ListFooterComponent:0===p?null:T===g?u:k||T!==w||0===p?void 0:f,ListEmptyComponent:L||"function"!==typeof h?null:h(),style:m})},d=(0,n.forwardRef)(h)},88700:(e,t,r)=>{"use strict";r.d(t,{Z:()=>s});r(94599);var n=r(24404),i=r(44242),a=r(41726),o=r(51962);const c=e=>{const{color:t="text",children:r,style:c,...s}=e,l=(0,i.useTheme)();return(0,o.jsx)(n.Z,{style:[{color:((0,a.isEmpty)(l.colors)?{[t]:"#ccc"}:l.colors)[t]},c],...s,children:r})};c.displayName="Text";const s=c}}]); 3//# sourceMappingURL=5382.16b77ee9.chunk.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.