@topthink/components 1.1.17 → 1.1.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/{image-ABW--2T_.js → image-BVvxDwVl.js} +1 -1
- package/es/{index-G9mlY0TI.js → index--SMDMMzR.js} +1 -1
- package/es/{index-HmAJCQve.js → index-8k84-7hx.js} +1 -1
- package/es/{index-AYHIBg7t.js → index-MSITE73l.js} +3 -3
- package/es/{index-vyjfGmoW.js → index-heSjErrZ.js} +1 -1
- package/es/index.js +1 -1
- package/es/{infinite-scroller-TKokPIae.js → infinite-scroller-YJ-osFqj.js} +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t,Fragment as r}from"react/jsx-runtime";import{memo as e,useContext as i,useState as o,useEffect as s}from"react";import{I as a}from"./index-
|
|
1
|
+
import{jsx as t,Fragment as r}from"react/jsx-runtime";import{memo as e,useContext as i,useState as o,useEffect as s}from"react";import{I as a}from"./index-MSITE73l.js";import{useInView as m}from"react-intersection-observer";import"sweetalert2/dist/sweetalert2.js";import"sweetalert2-react-content";import"react-bootstrap";import"lodash";import"axios";import"query-string";import"retry-axios";import"notistack";import"path";import"react-async-hook";import"styled-components";import"dayjs";import"dayjs/locale/zh-cn";import"dayjs/plugin/relativeTime";import"dayjs/plugin/duration";import"classnames";import"use-url-search-params";import"copy-to-clipboard";import"goober";import"immer";var n=e((e=>{let{lazy:n=!0,...p}=e;const{registerImage:c,setShow:l,setCurrent:d,getId:h}=i(a),[g,u]=o(),[w,f]=o(!1),{ref:y,inView:v}=m({threshold:.2,skip:!n,initialInView:!0}),[j]=o(h);if(s((()=>{if(p.src)return c(j,p.src)}),[]),w)return t(r,{children:p.alt?`[图片加载失败:${p.alt}]`:" "});const x=!v&&n&&g?"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25'%3e %3crect width='1' height='1' fill='none'/%3e%3c/svg%3e":p.src;return t("img",{width:g?.[0],height:g?.[1],onLoad:t=>{g||u([t.currentTarget.clientWidth,t.currentTarget.clientHeight])},onError:()=>{f(!0)},ref:y,...p,alt:void 0,src:x,onClick:()=>{d(j),l(!0)}})}));export{n as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as t,jsx as r}from"react/jsx-runtime";import{useState as o,useCallback as e}from"react";import i,{useController as n,useLightboxState as a}from"yet-another-react-lightbox";import s from"yet-another-react-lightbox/plugins/counter";import l from"yet-another-react-lightbox/plugins/download";import m from"yet-another-react-lightbox/plugins/zoom";import p from"yet-another-react-lightbox/plugins/thumbnails";import"yet-another-react-lightbox/styles.css";import"yet-another-react-lightbox/plugins/counter.css";import"yet-another-react-lightbox/plugins/thumbnails.css";import{I as c}from"./index-
|
|
1
|
+
import{jsxs as t,jsx as r}from"react/jsx-runtime";import{useState as o,useCallback as e}from"react";import i,{useController as n,useLightboxState as a}from"yet-another-react-lightbox";import s from"yet-another-react-lightbox/plugins/counter";import l from"yet-another-react-lightbox/plugins/download";import m from"yet-another-react-lightbox/plugins/zoom";import p from"yet-another-react-lightbox/plugins/thumbnails";import"yet-another-react-lightbox/styles.css";import"yet-another-react-lightbox/plugins/counter.css";import"yet-another-react-lightbox/plugins/thumbnails.css";import{I as c}from"./index-MSITE73l.js";import u from"styled-components";import"sweetalert2/dist/sweetalert2.js";import"sweetalert2-react-content";import"react-bootstrap";import"lodash";import"axios";import"query-string";import"retry-axios";import"notistack";import"path";import"react-async-hook";import"dayjs";import"dayjs/locale/zh-cn";import"dayjs/plugin/relativeTime";import"dayjs/plugin/duration";import"classnames";import"use-url-search-params";import"copy-to-clipboard";import"goober";import"immer";import"react-intersection-observer";const d={counter:s,zoom:m,download:l,thumbnails:p};let g=0;function h(i){let{children:s,render:l,zoom:m,toolbar:p,plugins:u=["counter","zoom","download"]}=i;const[h,y]=o((()=>new Map)),[x,f]=o(),[w,_]=o(!1),j=e(((t,r)=>(y((o=>new Map(o).set(t,r))),()=>{y((r=>{const o=new Map(r);return o.delete(t)?o:r}))})),[]),k=Array.from(h.keys()),v=k.indexOf(x),z=k.map((t=>{const r=h.get(t);return"string"==typeof r?{src:r}:{render:r}})),C=e((()=>g++),[]);return t(c.Provider,{value:{images:h,current:x,setCurrent:f,setShow:_,registerImage:j,getId:C},children:[s,r(b,{plugins:u.map((t=>d[t])),open:w,index:v,close:()=>_(!1),slides:z,carousel:{finite:!0,preload:3},toolbar:p?.({useController:n,useLightboxState:a}),zoom:m,render:{...l,buttonPrev:z.length<=1?()=>null:void 0,buttonNext:z.length<=1?()=>null:void 0,slide:t=>{let{slide:r}=t;if("render"in r)return r.render()}},controller:{closeOnBackdropClick:!0}})]})}const b=u(i)`
|
|
2
2
|
--yarl__color_backdrop: rgba(0, 0, 0, .7);
|
|
3
3
|
--yarl__thumbnails_container_background_color: rgba(0, 0, 0, .9);
|
|
4
4
|
`;export{h as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import n from"rc-table";import{unstable_batchedUpdates as o}from"react-dom";import{FormControl as a,Table as i}from"react-bootstrap";import{useUrlSearchParams as c}from"use-url-search-params";import{isEqual as l,omit as s}from"lodash";import*as d from"react";import{useState as p,useCallback as m,useRef as u,useEffect as h,useMemo as f,memo as g,forwardRef as y,useImperativeHandle as v}from"react";import{B as b,u as x,P as w,a as j,b as C,r as k,i as S,N as E,L as z,T as O,C as V,S as N}from"./index-
|
|
1
|
+
import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import n from"rc-table";import{unstable_batchedUpdates as o}from"react-dom";import{FormControl as a,Table as i}from"react-bootstrap";import{useUrlSearchParams as c}from"use-url-search-params";import{isEqual as l,omit as s}from"lodash";import*as d from"react";import{useState as p,useCallback as m,useRef as u,useEffect as h,useMemo as f,memo as g,forwardRef as y,useImperativeHandle as v}from"react";import{B as b,u as x,P as w,a as j,b as C,r as k,i as S,N as E,L as z,T as O,C as V,S as N}from"./index-MSITE73l.js";import M from"styled-components";import H from"./index-heSjErrZ.js";import q from"dayjs";import"sweetalert2/dist/sweetalert2.js";import"sweetalert2-react-content";import"axios";import"query-string";import"retry-axios";import"notistack";import"path";import"react-async-hook";import"dayjs/locale/zh-cn";import"dayjs/plugin/relativeTime";import"dayjs/plugin/duration";import"classnames";import"copy-to-clipboard";import"goober";import"immer";import"react-intersection-observer";import"@topthink/json-form";const K=function(t){let{indeterminate:r=!1,...n}=t;const o=u(null);return h((()=>{o.current&&(o.current.indeterminate=r)}),[r]),e("input",{ref:o,...n,className:"form-check-input",type:"checkbox"})};var B;function D(){return D=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},D.apply(this,arguments)}const P=e=>d.createElement("svg",D({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"currentColor",viewBox:"0 0 1024 1024"},e),B||(B=d.createElement("path",{d:"M252.069 906.496h520.283c89.582 0 134.144-44.562 134.144-132.846V250.331c0-88.283-44.562-132.845-134.144-132.845H252.069c-89.143 0-134.583 44.141-134.583 132.845V773.67c0 88.704 45.44 132.845 134.583 132.845zm1.28-68.992c-42.844 0-66.853-22.71-66.853-67.291V253.806c0-44.58 24.01-67.292 66.853-67.292h517.723c42.423 0 66.432 22.711 66.432 67.292v516.388c0 44.58-24.01 67.292-66.432 67.292zM511.78 714.496c22.71 0 36.425-15.854 36.425-40.704V547.365H682.35c24.009 0 40.722-12.874 40.722-35.584 0-23.132-15.854-36.426-40.722-36.426H548.206V340.773c0-24.85-13.715-40.704-36.425-40.704s-35.566 16.713-35.566 40.722v134.583H342.49c-24.85 0-41.142 13.275-41.142 36.407 0 22.71 17.152 35.584 41.142 35.584h133.724v126.427c0 23.99 12.855 40.704 35.566 40.704"})));var T;function Y(){return Y=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},Y.apply(this,arguments)}const F=e=>d.createElement("svg",Y({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"currentColor",viewBox:"0 0 1024 1024"},e),T||(T=d.createElement("path",{d:"M252.069 906.496h520.283c89.582 0 134.144-44.562 134.144-132.846V250.331c0-88.283-44.562-132.845-134.144-132.845H252.069c-89.143 0-134.583 44.141-134.583 132.845V773.67c0 88.704 45.44 132.845 134.583 132.845zm1.28-68.992c-42.844 0-66.853-22.71-66.853-67.291V253.806c0-44.58 24.01-67.292 66.853-67.292h517.723c42.423 0 66.432 22.711 66.432 67.292v516.388c0 44.58-24.01 67.292-66.432 67.292zm86.582-289.719h344.576c23.991 0 40.704-12.855 40.704-35.566 0-23.15-15.433-36.425-40.704-36.425H339.931c-24.868 0-40.722 13.276-40.722 36.425 0 22.711 16.713 35.566 40.722 35.566"})));function I(r){let{data:n,options:o,columns:a,onSearch:i}=r;const[c,s]=p(0),[d,u]=p(n);h((()=>{l(n,d)||(u(n),s((e=>e+1)))}),[n]);const[g,y,v]=f((()=>{const e={"ui:col":10,"ui:order":o.order},t={},r={};o.fields.forEach((n=>{const i=a.find((e=>e.dataIndex===n));if(i){const a=i.title;if("string"==typeof a){if(e[n]={"ui:col":4,"ui:labelCol":3,"ui:placeholder":"请输入",...o.ui?.[n]},i.valueEnum){const t=i.valueEnum;return e[n]["ui:placeholder"]="请选择",r[n]={title:a,type:"string",enum:Object.keys(t).flatMap((e=>"string"==typeof t[e].text?[e]:[])),enumNames:Object.keys(t).flatMap((e=>{const r=t[e].text;return"string"==typeof r?[r]:[]}))}}t[n]=void 0,r[n]={title:a,type:"string"}}}})),o.extraFields&&Object.entries(o.extraFields).forEach((n=>{let[a,i]=n;e[a]={"ui:col":4,"ui:labelCol":3,"ui:placeholder":"请输入",...o.ui?.[a]},t[a]=void 0,r[a]={title:i,type:"string"}}));return[{type:"object",properties:r},e,t]}),[o.fields,o.extraFields]),x=m((e=>{let{formData:t}=e;u(t),i({...v,...t})}),[i,v]),w=m((()=>{i(v)}),[i,v]);return e(R,{children:e(H,{formContext:{layout:"horizontal"},schema:g,uiSchema:y,onSubmit:x,formData:d,children:e("div",{className:"col-12 col-md-2 ms-auto mt-md-auto",children:t("div",{className:"justify-content-end d-flex gap-2 ",children:[e(b,{className:"px-4",onClick:w,variant:"secondary",children:"重置"}),e(b,{className:"px-4",type:"submit",variant:"primary",children:"查询"})]})})})},c)}const R=M.div`
|
|
2
2
|
margin-bottom: 1rem;
|
|
3
3
|
`;function _(t){let{keyword:r,onKeywordChange:n}=t;const[o,i]=p(r),c=x(n,500);h((()=>{i(r)}),[r]);const l=m((e=>{i(e.target.value),c(e.target.value)}),[c,i]);return e(a,{value:o,onChange:l,type:"search",placeholder:"Search..."})}const A=M.thead`
|
|
4
4
|
th {
|
|
@@ -25,7 +25,7 @@ import e from"sweetalert2/dist/sweetalert2.js";import t from"sweetalert2-react-c
|
|
|
25
25
|
`;function Be(e){let{loading:t=!0,children:o,variant:a="primary",animation:i="border",wrap:s,...c}=e;return t?(o&&(o=n("p",{className:"mt-3 text-secondary",children:o})),o=r($e,{inverted:!0,active:!0,children:[n(k,{animation:i,variant:a,...c}),o]}),s?n(Ee,{$height:"number"==typeof s?s:150,children:o}):o):null}const Ee=G.div`
|
|
26
26
|
position: relative;
|
|
27
27
|
height: ${e=>`${e.$height}px`};
|
|
28
|
-
`,Le=f((async()=>{const{QRCodeSVG:e}=await import("qrcode.react");return{default:e}}));function _e(e){return n(p,{fallback:null,children:n(Le,{...e})})}const De=function(e){let{state:t,message:r,resolve:o}=e;const i=a(!0),{result:c,checkUrl:l,onComplete:d}=r,[u,h]=ze(!1);return s((()=>{je({url:l,method:"post",data:{order_no:c.order_no},raxConfig:{shouldRetry:e=>i.current&&449===e.response?.status}}).then((()=>{d?.(),o()})).catch((()=>null))}),[]),n(be,{...t,centered:!0,onHide:()=>{i.current=!1,t.onHide()},backdrop:"static",header:"支付结果",okText:"已完成支付",okButtonProps:{loading:u},onOk:async e=>{e.preventDefault();try{h(!0),await je({url:l,method:"post",data:{order_no:c.order_no,force:!0},raxConfig:{shouldRetry:()=>!1}}),d?.(),o()}catch(e){Ne(e)&&xe.error(e.message)}finally{h(!1)}},cancelText:"取消",children:"请在新打开的页面上进行支付,支付完成后再关闭此窗口"})},Re=function(e){let{state:t,message:o,resolve:i}=e;const c=a(!0),{result:{pay_options:l,order_no:d},checkUrl:u,onComplete:h}=o,[m,f]=ze(l.channels.alipay?"alipay":"wechat"),[p,g]=ze(!1);s((()=>{je({url:u,method:"post",data:{order_no:d},raxConfig:{shouldRetry:e=>c.current&&449===e.response?.status}}).then((()=>{h?.(),i()})).catch((()=>null))}),[]);const{loading:y,result:w}=Te({url:l.url,method:"POST",data:{channel:m,order_no:d}},{refreshDeps:[m]});return r(be,{...t,onHide:()=>{c.current=!1,t.onHide()},centered:!0,backdrop:"static",header:"收银台",okText:"已完成支付",okButtonProps:{loading:p},onOk:async e=>{e.preventDefault();try{g(!0),await je({url:u,method:"post",data:{order_no:d,force:{channel:m}},raxConfig:{shouldRetry:()=>!1}}),h?.(),i()}catch(e){Ne(e)&&xe.error(e.message)}finally{g(!1)}},cancelText:"取消",children:[r("dl",{className:"row",children:[n("dt",{className:"col-3",children:"商品名称"}),n("dd",{className:"col-9",children:l.subject})]}),r("dl",{className:"row",children:[n("dt",{className:"col-3",children:"支付金额"}),n("dd",{className:"col-9 text-success h3",children:Pe(l.amount/100)})]}),r("dl",{className:"row",children:[n("dt",{className:"col-3",children:"支付方式"}),n("dd",{className:"col-9",children:r(S,{children:[l.channels.alipay&&n(j,{id:"payment-alipay",type:"radio",variant:"alipay"===m?"primary":"outline-primary",name:"alipay",value:"alipay",checked:"alipay"===m,onChange:()=>f("alipay"),children:"支付宝"}),l.channels.alipay&&n(j,{id:"payment-wechat",type:"radio",variant:"wechat"===m?"primary":"outline-primary",name:"wechat",value:"wechat",checked:"wechat"===m,onChange:()=>f("wechat"),children:"微信支付"})]})})]}),r("dl",{className:"row mb-0",children:[n("dt",{className:"col-3",children:"扫码支付"}),r("dd",{className:"col-9",children:[n(Be,{loading:y,wrap:200}),w&&n(_e,{size:200,value:w.data})]})]})]})};function Me(e){const{result:t}=e;t.pay_url?(window.opener=null,window.innerWidth<992?location.href=t.pay_url:(window.open(t.pay_url),pe(De,e))):pe(Re,e)}function Fe(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;const n=["","K","M","G"];let r=0;for(;e>=1024&&r<n.length-1;)e/=1024,r++;return e%1==0&&(t=0),e.toFixed(t)+n[r]}function Oe(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;const n=["","K","M","G"];let r=0;for(;e>=1e3&&r<n.length-1;)e/=1e3,r++;return e%1==0&&(t=0),e.toFixed(t)+n[r]}function Ae(e){const t=q.extname(e);return!(!/^data:image\//.test(e)&&!/(webp|svg|png|gif|jpg|jpeg|jfif|bmp|dpg|ico)$/i.test(t))||!/^data:/.test(e)&&!t}function Ue(e){const t=document.createElement("a");return t.href=e,t.href}Y.locale("zh-cn"),Y.extend(Q),Y.extend(J);const Ie={success:n("i",{className:"bi bi-check-circle-fill text-success"}),error:n("i",{className:"bi bi-exclamation-circle-fill text-danger"}),info:n("i",{className:"bi bi-info-circle-fill text-info"}),warning:n("i",{className:"bi bi-exclamation-triangle-fill text-warning"})};function qe(e){let{className:t,status:o,title:a,icon:i,extra:s}=e;return!i&&o&&(i=Ie[o]),r(We,{className:t,children:[i&&n(Ge,{children:i}),a&&n(Ke,{children:a}),s&&n(Ve,{children:s})]})}const We=G.div`
|
|
28
|
+
`,Le=f((async()=>{const{QRCodeSVG:e}=await import("qrcode.react");return{default:e}}));function _e(e){return n(p,{fallback:null,children:n(Le,{...e})})}const De=function(e){let{state:t,message:r,resolve:o}=e;const i=a(!0),{result:c,checkUrl:l,onComplete:d}=r,[u,h]=ze(!1);return s((()=>{je({url:l,method:"post",data:{order_no:c.order_no},raxConfig:{shouldRetry:e=>i.current&&449===e.response?.status}}).then((()=>{d?.(),o()})).catch((()=>null))}),[]),n(be,{...t,centered:!0,onHide:()=>{i.current=!1,t.onHide()},backdrop:"static",header:"支付结果",okText:"已完成支付",okButtonProps:{loading:u},onOk:async e=>{e.preventDefault();try{h(!0),await je({url:l,method:"post",data:{order_no:c.order_no,force:!0},raxConfig:{shouldRetry:()=>!1}}),d?.(),o()}catch(e){Ne(e)&&xe.error(e.message)}finally{h(!1)}},cancelText:"取消",children:"请在新打开的页面上进行支付,支付完成后再关闭此窗口"})},Re=function(e){let{state:t,message:o,resolve:i}=e;const c=a(!0),{result:{pay_options:l,order_no:d},checkUrl:u,onComplete:h}=o,[m,f]=ze(l.channels.alipay?"alipay":"wechat"),[p,g]=ze(!1);s((()=>{je({url:u,method:"post",data:{order_no:d},raxConfig:{shouldRetry:e=>c.current&&449===e.response?.status}}).then((()=>{h?.(),i()})).catch((()=>null))}),[]);const{loading:y,result:w}=Te({url:l.url,method:"POST",data:{channel:m,order_no:d}},{refreshDeps:[m]});return r(be,{...t,onHide:()=>{c.current=!1,t.onHide()},centered:!0,backdrop:"static",header:"收银台",okText:"已完成支付",okButtonProps:{loading:p},onOk:async e=>{e.preventDefault();try{g(!0),await je({url:u,method:"post",data:{order_no:d,force:{channel:m}},raxConfig:{shouldRetry:()=>!1}}),h?.(),i()}catch(e){Ne(e)&&xe.error(e.message)}finally{g(!1)}},cancelText:"取消",children:[r("dl",{className:"row",children:[n("dt",{className:"col-3",children:"商品名称"}),n("dd",{className:"col-9",children:l.subject})]}),r("dl",{className:"row",children:[n("dt",{className:"col-3",children:"支付金额"}),n("dd",{className:"col-9 text-success h3",children:Pe(l.amount/100)})]}),r("dl",{className:"row",children:[n("dt",{className:"col-3",children:"支付方式"}),n("dd",{className:"col-9",children:r(S,{children:[l.channels.alipay&&n(j,{id:"payment-alipay",type:"radio",variant:"alipay"===m?"primary":"outline-primary",name:"alipay",value:"alipay",checked:"alipay"===m,onChange:()=>f("alipay"),children:"支付宝"}),l.channels.alipay&&n(j,{id:"payment-wechat",type:"radio",variant:"wechat"===m?"primary":"outline-primary",name:"wechat",value:"wechat",checked:"wechat"===m,onChange:()=>f("wechat"),children:"微信支付"})]})})]}),r("dl",{className:"row mb-0",children:[n("dt",{className:"col-3",children:"扫码支付"}),r("dd",{className:"col-9",children:[n(Be,{loading:y,wrap:200}),w&&n(_e,{size:200,value:w.data})]})]})]})};function Me(e){const{result:t}=e;t.pay_url?(window.opener=null,window.innerWidth<992?location.href=t.pay_url:(window.open(t.pay_url),pe(De,e))):pe(Re,e)}function Fe(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;const n=["","K","M","G"];let r=0;for(;e>=1024&&r<n.length-1;)e/=1024,r++;return e%1==0&&(t=0),e.toFixed(t)+n[r]}function Oe(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;const n=["","K","M","G"];let r=0;for(;e>=1e3&&r<n.length-1;)e/=1e3,r++;return e%1==0&&(t=0),e.toFixed(t)+n[r]}function Ae(e){const t=q.extname(e);return!(!/^data:image\//.test(e)&&!/(webp|svg|png|gif|jpg|jpeg|jfif|bmp|dpg|ico)$/i.test(t))||!/^data:/.test(e)&&!t}function Ue(e){if(/^https?:\/\//.test(e))return e;const t=document.createElement("a");return t.href=e,t.href}Y.locale("zh-cn"),Y.extend(Q),Y.extend(J);const Ie={success:n("i",{className:"bi bi-check-circle-fill text-success"}),error:n("i",{className:"bi bi-exclamation-circle-fill text-danger"}),info:n("i",{className:"bi bi-info-circle-fill text-info"}),warning:n("i",{className:"bi bi-exclamation-triangle-fill text-warning"})};function qe(e){let{className:t,status:o,title:a,icon:i,extra:s}=e;return!i&&o&&(i=Ie[o]),r(We,{className:t,children:[i&&n(Ge,{children:i}),a&&n(Ke,{children:a}),s&&n(Ve,{children:s})]})}const We=G.div`
|
|
29
29
|
padding: 48px 32px;
|
|
30
30
|
`,Ge=G.div`
|
|
31
31
|
margin-bottom: 24px;
|
|
@@ -67,12 +67,12 @@ import e from"sweetalert2/dist/sweetalert2.js";import t from"sweetalert2-react-c
|
|
|
67
67
|
margin-bottom: 4px;
|
|
68
68
|
color: rgba(0, 0, 0, .45);
|
|
69
69
|
font-size: 1.1rem;
|
|
70
|
-
`;function mt(){}function ft(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}function pt(e){return"current_page"in e}function gt(e){let{total:t=0,onChange:o=mt,defaultCurrent:a=1,defaultPageSize:c=10,className:l,...d}=e;const[m,f]=i(a),[p,g]=i(c);s((()=>{ft(d.current)&&f(d.current)}),[d.current]),s((()=>{ft(d.pageSize)&&g(d.pageSize)}),[d.pageSize]);const y=h((()=>Math.floor((t-1)/p)+1),[t,p]),w=u((e=>()=>{e!==m&&(f(e),o(e,p))}),[o,m,p]),v=m-1>0?m-1:0,b=m+1<y?m+1:y,x=[];let k=null,N=null,C=null,S=null;if(y<=7)for(let e=1;e<=y;e+=1){const t=m===e;x.push(n(H.Item,{active:t,onClick:w(e),children:e},e))}else{S=n(H.Last,{onClick:w(y)},"last"),C=n(H.First,{onClick:w(1)},"first"),k=n(H.Prev,{onClick:w(v)},"prev"),N=n(H.Next,{onClick:w(b)},"next");let e=Math.max(1,m-2),t=Math.min(m+2,y);m-1<=2&&(t=5),y-m<=2&&(e=y-4);for(let r=e;r<=t;r+=1){const e=m===r;x.push(n(H.Item,{active:e,onClick:w(r),children:r},r))}m-1>=4&&3!==m&&x.unshift(k),y-m>=4&&m!==y-2&&x.push(N),1!==e&&x.unshift(C),t!==y&&x.push(S)}return r("div",{className:X("mb-3 d-flex align-column-center justify-content-between",l),children:[r("div",{className:"d-flex align-items-center",children:["共 ",t," 条"]}),n(H,{className:"mb-0",children:x})]})}function yt(e){let{className:t,value:r,locale:a="zh-CN",currency:i=!0,options:s={}}=e;const c=h((()=>{let e;return e=i?{style:"currency",currency:"CNY"}:{minimumFractionDigits:2},new Intl.NumberFormat(a,{...e,...s})}),[i,a,s]);return t?n("span",{className:t,children:c.format(r)}):n(o,{children:c.format(r)})}function wt(e){let{loading:t,disabled:r,children:o,...a}=e;return n(N,{...a,disabled:t||r,children:t?"Loading…":o})}const vt=f((()=>import("./image-zoom-OrIPGqh0.js")));function bt(e){return n(p,{fallback:null,children:n(vt,{...e})})}const xt=m(((e,t)=>{let{confirm:n,onSuccess:r,children:o,disabled:a,as:i=we,onError:s,...c}=e;const[l,d]=ze(!1),h=u((async e=>{e.preventDefault(),e.stopPropagation();try{if(d(!0),n&&!await be.confirm({message:n}))return;let e;if("onRequest"in c)e=await c.onRequest();else{const t="string"==typeof c.url?{url:c.url,method:c.method}:{method:c.method,...c.url};e=await je(t)}r&&r(e)}catch(e){if(!(e instanceof Error))throw e;s?s(e):xe.error(e.message,{preventDuplicate:!0})}finally{d(!1)}}),[c,d]);return y(i,{...R(c,["onRequest","url","method"]),disabled:a||l,onClick:h,ref:t},o)})),kt=f((()=>import("./index-
|
|
70
|
+
`;function mt(){}function ft(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}function pt(e){return"current_page"in e}function gt(e){let{total:t=0,onChange:o=mt,defaultCurrent:a=1,defaultPageSize:c=10,className:l,...d}=e;const[m,f]=i(a),[p,g]=i(c);s((()=>{ft(d.current)&&f(d.current)}),[d.current]),s((()=>{ft(d.pageSize)&&g(d.pageSize)}),[d.pageSize]);const y=h((()=>Math.floor((t-1)/p)+1),[t,p]),w=u((e=>()=>{e!==m&&(f(e),o(e,p))}),[o,m,p]),v=m-1>0?m-1:0,b=m+1<y?m+1:y,x=[];let k=null,N=null,C=null,S=null;if(y<=7)for(let e=1;e<=y;e+=1){const t=m===e;x.push(n(H.Item,{active:t,onClick:w(e),children:e},e))}else{S=n(H.Last,{onClick:w(y)},"last"),C=n(H.First,{onClick:w(1)},"first"),k=n(H.Prev,{onClick:w(v)},"prev"),N=n(H.Next,{onClick:w(b)},"next");let e=Math.max(1,m-2),t=Math.min(m+2,y);m-1<=2&&(t=5),y-m<=2&&(e=y-4);for(let r=e;r<=t;r+=1){const e=m===r;x.push(n(H.Item,{active:e,onClick:w(r),children:r},r))}m-1>=4&&3!==m&&x.unshift(k),y-m>=4&&m!==y-2&&x.push(N),1!==e&&x.unshift(C),t!==y&&x.push(S)}return r("div",{className:X("mb-3 d-flex align-column-center justify-content-between",l),children:[r("div",{className:"d-flex align-items-center",children:["共 ",t," 条"]}),n(H,{className:"mb-0",children:x})]})}function yt(e){let{className:t,value:r,locale:a="zh-CN",currency:i=!0,options:s={}}=e;const c=h((()=>{let e;return e=i?{style:"currency",currency:"CNY"}:{minimumFractionDigits:2},new Intl.NumberFormat(a,{...e,...s})}),[i,a,s]);return t?n("span",{className:t,children:c.format(r)}):n(o,{children:c.format(r)})}function wt(e){let{loading:t,disabled:r,children:o,...a}=e;return n(N,{...a,disabled:t||r,children:t?"Loading…":o})}const vt=f((()=>import("./image-zoom-OrIPGqh0.js")));function bt(e){return n(p,{fallback:null,children:n(vt,{...e})})}const xt=m(((e,t)=>{let{confirm:n,onSuccess:r,children:o,disabled:a,as:i=we,onError:s,...c}=e;const[l,d]=ze(!1),h=u((async e=>{e.preventDefault(),e.stopPropagation();try{if(d(!0),n&&!await be.confirm({message:n}))return;let e;if("onRequest"in c)e=await c.onRequest();else{const t="string"==typeof c.url?{url:c.url,method:c.method}:{method:c.method,...c.url};e=await je(t)}r&&r(e)}catch(e){if(!(e instanceof Error))throw e;s?s(e):xe.error(e.message,{preventDuplicate:!0})}finally{d(!1)}}),[c,d]);return y(i,{...R(c,["onRequest","url","method"]),disabled:a||l,onClick:h,ref:t},o)})),kt=f((()=>import("./index-heSjErrZ.js"))),Nt=m(((e,t)=>n(p,{fallback:null,children:n(kt,{...e,ref:t})}))),Ct=f((()=>import("./index-8k84-7hx.js"))),St=m(((e,t)=>n(p,{fallback:null,children:n(Ct,{...e,ref:t})})));let jt=0;function zt(){let{onHide:e,onShow:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const[n,r]=i(!1),[o,a]=i(`visible-${jt}`),s=u((()=>{r(!1),e&&e()}),[r,e]),c=u((()=>{a("visible-"+ ++jt)}),[a,jt]);return{visible:n,show:u((()=>{r(!0),t&&t()}),[r,t]),hide:s,state:{show:n,onHide:s,onExited:c,key:o}}}const Pt=m(((e,t)=>{let{text:a,onOk:i,modalProps:s,children:c,onShow:l,onHide:d,confirmLoading:u,as:h=we,...m}=e;const{state:f,show:p,hide:g}=zt({onShow:l,onHide:d});w(t,(()=>({close:g})));const v=y(h,{...m,onClick:e=>{e.preventDefault(),e.stopPropagation(),p()}},a);return r(o,{children:[v,n(be,{header:a,...s,...f,confirmLoading:u,onOk:async e=>{if(i){!1===await i()&&e.preventDefault()}},children:c})]})})),Tt=m(((e,t)=>{let{text:o,onSuccess:s,onSubmit:c,buttonProps:l,modalProps:d,children:h,...m}=e;const[f,p]=i(!1),g=a(null),y=a(null);w(t,(()=>({close:()=>{g.current?.close()}})));const v=u((()=>(y.current?.submit(),!1)),[]),b=u((e=>{s&&s(e),g.current?.close()}),[s]),x=u((async(e,t)=>{c&&await c(e,t)&&g.current?.close()}),[c]);return n(Pt,{ref:g,text:o,...l,modalProps:d,onOk:v,confirmLoading:f,children:r(Nt,{...m,onSubmitting:p,ref:y,onSuccess:b,onSubmit:x,children:[h,n("input",{type:"submit",hidden:!0})]})})}));function $t(e){let{header:t,children:o,closable:a=!0,show:i,onHide:s,bodyAs:c,headerAs:l="h5",...d}=e;return r(B,{...d,onHide:s,show:i,children:[t&&n(B.Header,{closeButton:a,children:n(B.Title,{as:l,children:t})}),n(B.Body,{as:c,children:o})]})}const Ht=m(((e,t)=>{let{text:a,offcanvasProps:i,children:s,onShow:c,onHide:l,as:d=we,...u}=e;const{state:h,show:m,hide:f}=zt({onShow:c,onHide:l});w(t,(()=>({close:f})));const p=y(d,{...u,onClick:m},a);return r(o,{children:[p,n($t,{header:a,...i,...h,children:s})]})}));function Bt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const n=a(e);return s((()=>{n.current=e})),u((function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.current?.(...t)}),t)}function Et(e){const{value:t,defaultValue:n,onChange:r,shouldUpdate:o=((e,t)=>e!==t)}=e,a=Bt(r),s=Bt(o),[c,l]=i(n),d=void 0!==t,u=d?t:c,h=Bt((e=>{const t="function"==typeof e?e(u):e;s(u,t)&&(d||l(t),a(t))}),[d,a,u,s]);return[u,h]}const Lt=m(((e,t)=>{let{className:o,rowClassName:c,paginate:l=!0,sync:d=!1,columns:h=3,source:m,renderItem:f,renderEmpty:p}=e;const[g,y]=i([]),[v,b]=i(l?{total:0,current:1,pageSize:10}:null),[x,k]=i(!0),[N,C]=Z({}),[S,j]=Et({value:d?N.page||1:void 0,defaultValue:1,onChange:e=>{d&&C({page:e||void 0})}}),z=u((async function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]||k(!0);try{let e;const t={page:S>1?S:void 0};e="string"==typeof m?await je({url:m,params:t}):await m(t),l&&pt(e)?(e.last_page>1?b({total:e.total,current:e.current_page,pageSize:e.per_page}):b(null),e=e.data):b(null),y(e)}catch(e){}finally{k(!1)}}),[m,y,S]);s((()=>{z()}),[S]),s((()=>{P.current={reload:z}}),[z]);const P=a({reload:z});return w(t,(()=>P.current)),r(_t,{className:o,children:[n(Be,{wrap:!0,loading:x}),0===g.length&&!x&&p?.(),n(E,{className:X(c,"g-4"),children:g.map(((e,t)=>n(L,{className:"d-flex",md:12/h,children:f(e)},`card-${t}`)))}),v&&n(Dt,{...v,onChange:j})]})})),_t=G.div`
|
|
71
71
|
|
|
72
72
|
`,Dt=G(gt)`
|
|
73
73
|
margin-bottom: 0;
|
|
74
74
|
justify-content: flex-end;
|
|
75
75
|
margin-top: 1rem;
|
|
76
|
-
`;var Rt=v(Lt);function Mt(){const[e,t]=i(!1),n=a();return s((()=>()=>{n.current&&clearTimeout(n.current)}),[]),{copied:e,copy:u((e=>{ee(e),t(!0),n.current&&clearTimeout(n.current),n.current=setTimeout((()=>{t(!1),n.current=void 0}),3e3)}),[])}}function Ft(e){let{as:t="div",className:r,content:o,tooltip:a=!0,placement:i}=e;const{copy:s,copied:c}=Mt(),l=a?n("i",c?{className:"bi bi-clipboard-check"}:{className:"bi bi-clipboard"}):c?"已复制":"复制",d=y(t,{role:"button",className:r,onClick:()=>{"function"==typeof o&&(o=o()),s(o)}},l);return a?n(ge,{tooltip:c?"已复制":"复制",placement:i,children:d}):d}const Ot=c({images:new Map,current:0,setCurrent:()=>null,setShow:()=>null,registerImage:()=>()=>null,getId:()=>0}),At=f((()=>import("./index
|
|
76
|
+
`;var Rt=v(Lt);function Mt(){const[e,t]=i(!1),n=a();return s((()=>()=>{n.current&&clearTimeout(n.current)}),[]),{copied:e,copy:u((e=>{ee(e),t(!0),n.current&&clearTimeout(n.current),n.current=setTimeout((()=>{t(!1),n.current=void 0}),3e3)}),[])}}function Ft(e){let{as:t="div",className:r,content:o,tooltip:a=!0,placement:i}=e;const{copy:s,copied:c}=Mt(),l=a?n("i",c?{className:"bi bi-clipboard-check"}:{className:"bi bi-clipboard"}):c?"已复制":"复制",d=y(t,{role:"button",className:r,onClick:()=>{"function"==typeof o&&(o=o()),s(o)}},l);return a?n(ge,{tooltip:c?"已复制":"复制",placement:i,children:d}):d}const Ot=c({images:new Map,current:0,setCurrent:()=>null,setShow:()=>null,registerImage:()=>()=>null,getId:()=>0}),At=f((()=>import("./index--SMDMMzR.js"))),Ut=f((()=>import("./image-BVvxDwVl.js")));function It(e){return n(p,{fallback:null,children:n(At,{...e})})}It.Image=function(e){return n(p,{fallback:null,children:n(Ut,{...e})})},It.Context=Ot;const qt=f((()=>import("./infinite-scroller-YJ-osFqj.js"))),Wt=m(((e,t)=>n(p,{fallback:null,children:n(qt,{...e,ref:t})}))),Gt=f((()=>import("./slider-KuqHu6UH.js")));function Kt(e){return n(p,{fallback:null,children:n(Gt,{...e})})}function Vt(e){let{children:t}=e;return r(I,{children:[n(Yt,{}),t]})}const Yt=V`
|
|
77
77
|
${te.extractCss()}
|
|
78
78
|
`,Qt=f((()=>import("./cascader-pKgfaE9t.js")));function Jt(e){return n(p,{fallback:null,children:n(Qt,{...e})})}const Xt=f((()=>import("./select-WnBtupzS.js")));function Zt(e){return n(p,{fallback:null,children:n(Xt,{...e})})}function en(e,t,n){const r=a(e),o=a(M(e,t,n));return s((()=>{r.current=e})),s((()=>{o.current=M((function(){r.current(...arguments)}),t,n)}),[t,n]),o.current}function tn(e){const[t,n]=i((()=>ne("function"==typeof e?e():e,!0)));return[t,u((e=>{n("function"==typeof e?re(e):ne(e))}),[])]}function nn(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"lg";function t(){const t=e=>{switch(e){case"xxl":return window.innerWidth>=1400;case"xl":return window.innerWidth>=1200;case"lg":return window.innerWidth>=992;case"md":return window.innerWidth>=768;case"sm":return window.innerWidth>=576;default:return!0}};return{isMobile:!t(e),width:window.innerWidth,match:t}}const[n,r]=i(t),o=en((()=>{r(t())}),100);return s((()=>(window.addEventListener("resize",o),()=>window.removeEventListener("resize",o))),[]),n}var rn;!function(e){e[e.init=0]="init",e[e.play=1]="play",e[e.pause=2]="pause",e[e.end=3]="end"}(rn||(rn={}));const on=(e,t)=>{let n=a(!1);const[r,o]=i((()=>{const{lang:e="default",name:n=""}=t.voice||{};return{isPlaying:!1,status:rn[rn.init],lang:t.lang||"default",voiceInfo:{lang:e,name:n},rate:t.rate||1,pitch:t.pitch||1,volume:t.volume||1}})),c=u((()=>{n.current&&o((e=>({...e,isPlaying:!0,status:rn[rn.play]})))}),[]),l=u((()=>{n.current&&o((e=>({...e,isPlaying:!1,status:rn[rn.pause]})))}),[]),d=u((()=>{n.current&&o((e=>({...e,isPlaying:!1,status:rn[rn.end]})))}),[]);return s((()=>{n.current=!0;const r=new SpeechSynthesisUtterance(e);return t.lang&&(r.lang=t.lang),t.voice&&(r.voice=t.voice),r.rate=t.rate||1,r.pitch=t.pitch||1,r.volume=t.volume||1,r.onstart=c,r.onpause=l,r.onresume=c,r.onend=d,window.speechSynthesis.speak(r),()=>{n.current=!1}}),[]),r};function an(e,t){s((()=>{const t=e();!async function(){await t}()}),t)}export{zt as $,Pt as A,we as B,Ye as C,be as D,tt as E,Nt as F,$t as G,ge as H,Ot as I,Rt as J,Ft as K,Be as L,se as M,yt as N,Ht as O,gt as P,It as Q,qe as R,nt as S,ye as T,Wt as U,Kt as V,_e as W,Vt as X,Jt as Y,Zt as Z,Te as _,nn as a,Mt as a0,on as a1,an as a2,Ne as a3,Ce as a4,Et as b,ze as c,tn as d,xe as e,ke as f,Fe as g,Pe as h,pt as i,Oe as j,Ae as k,Ue as l,et as m,Xe as n,Ze as o,st as p,ct as q,je as r,lt as s,wt as t,en as u,bt as v,Me as w,xt as x,St as y,Tt as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";import o,{getRegistry as r}from"@topthink/json-form";import*as a from"react";import{forwardRef as e,useState as n,useCallback as i}from"react";import s from"axios";import{c as p,r as m,B as l}from"./index-
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import o,{getRegistry as r}from"@topthink/json-form";import*as a from"react";import{forwardRef as e,useState as n,useCallback as i}from"react";import s from"axios";import{c as p,r as m,B as l}from"./index-MSITE73l.js";import{mapValues as c}from"lodash";import"sweetalert2/dist/sweetalert2.js";import"sweetalert2-react-content";import"react-bootstrap";import"query-string";import"retry-axios";import"notistack";import"path";import"react-async-hook";import"styled-components";import"dayjs";import"dayjs/locale/zh-cn";import"dayjs/plugin/relativeTime";import"dayjs/plugin/duration";import"classnames";import"use-url-search-params";import"copy-to-clipboard";import"goober";import"immer";import"react-intersection-observer";const d=require("ajv-i18n/localize/zh"),u=a.lazy((()=>import("./editor-widget-ZqrBTAWC.js"))),f=o=>t(a.Suspense,{fallback:null,children:t(u,{...o})}),y={upload:function(o){let{options:a,...e}=o;const{widgets:n}=r();return a.endpoint&&(a.onUpload=async t=>{const o=new FormData;o.set("file",t);const{url:r,value:e}=await m({url:a.endpoint,method:"post",data:o});return{url:r,value:e}}),t(n.upload,{...e,options:a})},avatar:function(o){let{options:a,...e}=o;const{widgets:n}=r();return a.endpoint&&(a.onUpload=async t=>{const o=new FormData;o.set("file",t);const{url:r}=await m({url:a.endpoint,method:"post",data:o});return r}),t(n.avatar,{...e,options:a})},editor:function(o){let{options:r,...a}=o;return r.endpoint&&(r.onUpload=async t=>{const o=new FormData;o.set("file",t);const{url:a}=await m({url:r.endpoint,method:"post",data:o});return a}),t(f,{...a,options:r})},typeahead:function(o){let{options:a,...e}=o;const{widgets:n}=r();return a.endpoint&&(a.onSearch=async t=>{let{value:o,query:r}=t;return await m({url:a.endpoint,params:{value:o,query:r}})}),t(n.typeahead,{...e,options:a})}},h=e(((r,a)=>{let{action:e,method:u="post",onSuccess:f,formData:h,onSubmitting:w,onSubmit:g,onChange:v,submitText:b="保存",transformData:j,children:x,...D}=r;const[S,k]=n(),[q,z]=p(!1),[_,E]=n(h),F=i((async(t,o)=>{if(!q)try{if(z(!0),w&&w(!0),e){let{formData:o}=t;j&&(o=j(o));try{const t=await m({url:e,method:u,data:o});return k(void 0),f&&await f(t),t}catch(t){if(!s.isAxiosError(t))throw t;k((t=>{const o=t.errors;return"string"==typeof o?{__errors:[o]}:c(o,(t=>({__errors:[t]})))})(t))}}else if(g)return await g(t,o)}finally{z(!1),w&&w(!1)}}),[e,u,g]),U=i((t=>{const{formData:o}=t;E(o),v&&v(t)}),[E,v]),C=i((t=>(t=t.map((t=>({keyword:t.name,dataPath:t.property,...t}))),d(t),t)),[]),N=t(l,{className:"px-4",loading:q,type:"submit",variant:"primary",children:b});return"function"==typeof x&&(x=x({submit:N,loading:q})),t(o,{ref:a,extraErrors:S,onSubmit:F,transformErrors:C,noHtml5Validate:!0,noValidate:!0,...D,formData:_,onChange:U,widgets:y,children:x||t("div",{className:"col-12",children:N})})}));export{h as default};
|
package/es/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{B as Button,C as Card,J as CardList,Y as Cascader,K as Clipboard,E as Error,F as Form,v as ImageZoom,U as InfiniteScroller,Q as Lightbox,L as Loader,t as LoadingButton,M as Message,D as Modal,A as ModalButton,z as ModalForm,N as NumberFormat,G as Offcanvas,O as OffcanvasButton,P as Pagination,m as Panel,n as PanelGroup,W as Qrcode,x as RequestButton,R as Result,Z as Select,V as Slider,S as Space,s as Statistic,q as Step,p as Steps,y as Table,e as Toast,X as ToastProvider,H as Tooltip,j as formatLongNumber,h as formatNumber,g as formatSize,l as getAbsoluteUrl,k as isImageUrl,f as isRecord,a3 as isRequestError,r as request,a4 as showRequestError,a2 as useAsyncEffect,a0 as useClipboard,b as useControllableState,u as useDebounce,d as useImmer,$ as useOverlayState,o as usePanel,_ as useRequest,c as useSafeState,a1 as useSpeech,a as useWindowSize,w as waitPayComplete}from"./index-
|
|
1
|
+
export{B as Button,C as Card,J as CardList,Y as Cascader,K as Clipboard,E as Error,F as Form,v as ImageZoom,U as InfiniteScroller,Q as Lightbox,L as Loader,t as LoadingButton,M as Message,D as Modal,A as ModalButton,z as ModalForm,N as NumberFormat,G as Offcanvas,O as OffcanvasButton,P as Pagination,m as Panel,n as PanelGroup,W as Qrcode,x as RequestButton,R as Result,Z as Select,V as Slider,S as Space,s as Statistic,q as Step,p as Steps,y as Table,e as Toast,X as ToastProvider,H as Tooltip,j as formatLongNumber,h as formatNumber,g as formatSize,l as getAbsoluteUrl,k as isImageUrl,f as isRecord,a3 as isRequestError,r as request,a4 as showRequestError,a2 as useAsyncEffect,a0 as useClipboard,b as useControllableState,u as useDebounce,d as useImmer,$ as useOverlayState,o as usePanel,_ as useRequest,c as useSafeState,a1 as useSpeech,a as useWindowSize,w as waitPayComplete}from"./index-MSITE73l.js";export{StyleSheetManager,ThemeProvider,createGlobalStyle,css,keyframes,default as styled}from"styled-components";export{useAsync,useAsyncCallback}from"react-async-hook";export{useInView}from"react-intersection-observer";export{default as queryString}from"query-string";export{freeze,immerable,produce}from"immer";export{default as dayjs}from"dayjs";import"sweetalert2/dist/sweetalert2.js";import"sweetalert2-react-content";import"react/jsx-runtime";import"react";import"react-bootstrap";import"lodash";import"axios";import"retry-axios";import"notistack";import"path";import"dayjs/locale/zh-cn";import"dayjs/plugin/relativeTime";import"dayjs/plugin/duration";import"classnames";import"use-url-search-params";import"copy-to-clipboard";import"goober";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";import{memo as a,forwardRef as r,useState as e,useCallback as o,useImperativeHandle as i}from"react";import s from"react-infinite-scroller";import{d as n,r as m,i as p}from"./index-
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{memo as a,forwardRef as r,useState as e,useCallback as o,useImperativeHandle as i}from"react";import s from"react-infinite-scroller";import{d as n,r as m,i as p}from"./index-MSITE73l.js";import{last as d}from"lodash";import"sweetalert2/dist/sweetalert2.js";import"sweetalert2-react-content";import"react-bootstrap";import"axios";import"query-string";import"retry-axios";import"notistack";import"path";import"react-async-hook";import"styled-components";import"dayjs";import"dayjs/locale/zh-cn";import"dayjs/plugin/relativeTime";import"dayjs/plugin/duration";import"classnames";import"use-url-search-params";import"copy-to-clipboard";import"goober";import"immer";import"react-intersection-observer";var c=a(r(((a,r)=>{let{source:c,render:l,as:u,useWindow:g,className:f,getState:y,limit:h=10}=a;const[j,w]=e(!1),[x,b]=n({params:{},end:!1,data:[]}),v=o((async function(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!j){w(!0);try{let a;const r=t?{}:x.params;a="string"==typeof c?await m({url:c,params:r}):await c(r),y||(y=t=>p(t)?{params:{page:t.current_page+1},end:t.current_page>=t.last_page,data:t.data}:{params:{offset:d(t)?.id},end:t.length<h,data:t});const e=y(a);b({...e,data:t?e.data:[...x.data,...e.data]})}catch{b({...x,end:!0})}finally{w(!1)}}}),[c,x,y,j]),_=o((()=>{v(!0)}),[v]);i(r,(()=>({reload:_})),[_]);const k=o((t=>{b((a=>{const r=t(a.data);r&&(a.data=r)}))}),[b]);return t(s,{className:f,hasMore:!x.end,pageStart:0,loadMore:()=>{v()},useWindow:g,element:u,children:l({data:x.data,setData:k,end:x.end,loading:j,action:{reload:_}})})})));export{c as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@topthink/components",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.20",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"prebuild": "rimraf es types",
|
|
6
6
|
"build": "rollup -c --environment NODE_ENV:production",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"@toast-ui/editor": "^3.2.2",
|
|
21
21
|
"@toast-ui/react-editor": "^3.2.3",
|
|
22
22
|
"@topthink/bootstrap": "^1.0.27",
|
|
23
|
-
"@topthink/json-form": "^1.0.
|
|
23
|
+
"@topthink/json-form": "^1.0.64",
|
|
24
24
|
"@types/react-infinite-scroller": "^1.2.5",
|
|
25
25
|
"ajv-i18n": "^4.0.0",
|
|
26
26
|
"axios": "^0.27.2",
|
|
@@ -75,5 +75,5 @@
|
|
|
75
75
|
},
|
|
76
76
|
"author": "yunwuxin <tzzhangyajun@qq.com> (https://github.com/yunwuxin)",
|
|
77
77
|
"license": "MIT",
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "2882430e8d716f6ea89805710a6ac98593d47f78"
|
|
79
79
|
}
|