@gientech/modual 1.8.5 → 1.8.6
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/assets/{GientechStreamReader-C7an1QrK.js → GientechStreamReader-BafFiNMI.js} +1 -1
- package/assets/{index-tplNfcnA.js → index-BH8au9G9.js} +2 -2
- package/assets/{index-OjluyvX1.js → index-BbHMAb8g.js} +2 -2
- package/assets/{index-CFqsgVcx.js → index-BbpyNfEd.js} +35 -35
- package/assets/{index-8usKJjKH.js → index-CCjG4bD0.js} +15 -15
- package/assets/{index-Di5Ga230.js → index-CPOAXITM.js} +2 -2
- package/assets/index-CuySCBtZ.js +576 -0
- package/assets/{index-BmVOh6oe.js → index-Dkwp9YpO.js} +1 -1
- package/assets/{index-6Ox5f3GI.js → index-DnJqVq9Q.js} +1 -1
- package/assets/{index-B0fJUyM7.js → index-Wjs4Vb6x.js} +1 -1
- package/assets/{index-DhczpnL_.js → index-fhKUis2J.js} +128 -129
- package/assets/{plus-Dbo_i_9Z.js → plus-Dmpl3gd8.js} +2 -2
- package/assets/{style-bUXwVVWZ.js → style-CNIDlcUL.js} +5 -5
- package/assets/{x-C7NWGGXn.js → x-BjRa5XLp.js} +2 -2
- package/assistantConfig.js +1 -1
- package/chat.js +1 -1
- package/database.js +2 -2
- package/databaseId.js +1 -1
- package/databaseTable.js +2 -2
- package/index.js +1 -1
- package/modelManage.js +1 -1
- package/package.json +1 -1
- package/sensitive.js +1 -1
- package/streamFilesReader.js +1 -1
- package/assets/index-D4NnOWbo.js +0 -576
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a}from"./index-BbHMAb8g.js";/**
|
|
2
2
|
* @license lucide-react v0.456.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const a
|
|
6
|
+
*/const s=a("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);export{s as P};
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import{ac as sn,
|
|
1
|
+
import{ac as sn,A as X,H as K,ad as we,E as qe,f as I,L as _e,M as De,ap as cn,y as bt,J as F,_ as U,aq as yt,g as Ve,m as Ge,K as $e,r as ht,ar as xt,l as ne,as as Re,at as dn,au as $t,av as St,aw as Ot,ax as un,ay as Ue,az as fn,aA as mn,B as Xe,aB as Et,z as gn,p as Nt,aC as vn,aD as Je,P as Cn,aE as pn,k as H,aF as Ke,u as bn,an as Ye,aG as Pt,aH as yn,$ as hn,S as xn,aI as $n,O as Sn,Q as et,U as On,V as En,W as Nn,X as Pn,Y as je,al as wn,aJ as jn,aK as Ze,am as In,aL as wt,aM as jt,aN as Rn,aO as Mn}from"./index-BbHMAb8g.js";import*as r from"react";import N,{useContext as fe,useRef as ie,useState as tt,useEffect as Ie,useMemo as Tn}from"react";import{createPortal as kn}from"react-dom";var Bn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"info-circle",theme:"filled"},Hn=function(t,o){return r.createElement(sn,X({},t,{ref:o,icon:Bn}))},It=r.forwardRef(Hn),Rt=r.forwardRef(function(e,t){var o=e.prefixCls,n=e.style,a=e.className,s=e.duration,d=s===void 0?4.5:s,i=e.showProgress,l=e.pauseOnHover,u=l===void 0?!0:l,c=e.eventKey,f=e.content,m=e.closable,g=e.closeIcon,C=g===void 0?"x":g,p=e.props,v=e.onClick,x=e.onNoticeClose,b=e.times,y=e.hovering,S=r.useState(!1),E=K(S,2),h=E[0],T=E[1],j=r.useState(0),$=K(j,2),O=$[0],P=$[1],B=r.useState(0),L=K(B,2),w=L[0],_=L[1],k=y||h,R=d>0&&i,D=function(){x(c)},Y=function(M){(M.key==="Enter"||M.code==="Enter"||M.keyCode===De.ENTER)&&D()};r.useEffect(function(){if(!k&&d>0){var q=Date.now()-w,M=setTimeout(function(){D()},d*1e3-w);return function(){u&&clearTimeout(M),_(Date.now()-q)}}},[d,k,b]),r.useEffect(function(){if(!k&&R&&(u||w===0)){var q=performance.now(),M,A=function le(){cancelAnimationFrame(M),M=requestAnimationFrame(function(ae){var J=ae+w-q,oe=Math.min(J/(d*1e3),1);P(oe*100),oe<1&&le()})};return A(),function(){u&&cancelAnimationFrame(M)}}},[d,w,k,R,b]);var Z=r.useMemo(function(){return we(m)==="object"&&m!==null?m:m?{closeIcon:C}:{}},[m,C]),Q=qe(Z,!0),W=100-(!O||O<0?0:O>100?100:O),V="".concat(o,"-notice");return r.createElement("div",X({},p,{ref:t,className:I(V,a,_e({},"".concat(V,"-closable"),m)),style:n,onMouseEnter:function(M){var A;T(!0),p==null||(A=p.onMouseEnter)===null||A===void 0||A.call(p,M)},onMouseLeave:function(M){var A;T(!1),p==null||(A=p.onMouseLeave)===null||A===void 0||A.call(p,M)},onClick:v}),r.createElement("div",{className:"".concat(V,"-content")},f),m&&r.createElement("a",X({tabIndex:0,className:"".concat(V,"-close"),onKeyDown:Y,"aria-label":"Close"},Q,{onClick:function(M){M.preventDefault(),M.stopPropagation(),D()}}),Z.closeIcon),R&&r.createElement("progress",{className:"".concat(V,"-progress"),max:"100",value:W},W+"%"))}),Mt=N.createContext({}),zn=function(t){var o=t.children,n=t.classNames;return N.createElement(Mt.Provider,{value:{classNames:n}},o)},nt=8,ot=3,at=16,Fn=function(t){var o={offset:nt,threshold:ot,gap:at};if(t&&we(t)==="object"){var n,a,s;o.offset=(n=t.offset)!==null&&n!==void 0?n:nt,o.threshold=(a=t.threshold)!==null&&a!==void 0?a:ot,o.gap=(s=t.gap)!==null&&s!==void 0?s:at}return[!!t,o]},An=["className","style","classNames","styles"],Ln=function(t){var o=t.configList,n=t.placement,a=t.prefixCls,s=t.className,d=t.style,i=t.motion,l=t.onAllNoticeRemoved,u=t.onNoticeClose,c=t.stack,f=fe(Mt),m=f.classNames,g=ie({}),C=tt(null),p=K(C,2),v=p[0],x=p[1],b=tt([]),y=K(b,2),S=y[0],E=y[1],h=o.map(function(k){return{config:k,key:String(k.key)}}),T=Fn(c),j=K(T,2),$=j[0],O=j[1],P=O.offset,B=O.threshold,L=O.gap,w=$&&(S.length>0||h.length<=B),_=typeof i=="function"?i(n):i;return Ie(function(){$&&S.length>1&&E(function(k){return k.filter(function(R){return h.some(function(D){var Y=D.key;return R===Y})})})},[S,h,$]),Ie(function(){var k;if($&&g.current[(k=h[h.length-1])===null||k===void 0?void 0:k.key]){var R;x(g.current[(R=h[h.length-1])===null||R===void 0?void 0:R.key])}},[h,$]),N.createElement(cn,X({key:n,className:I(a,"".concat(a,"-").concat(n),m==null?void 0:m.list,s,_e(_e({},"".concat(a,"-stack"),!!$),"".concat(a,"-stack-expanded"),w)),style:d,keys:h,motionAppear:!0},_,{onAllRemoved:function(){l(n)}}),function(k,R){var D=k.config,Y=k.className,Z=k.style,Q=k.index,W=D,V=W.key,q=W.times,M=String(V),A=D,le=A.className,ae=A.style,J=A.classNames,oe=A.styles,ye=bt(A,An),ce=h.findIndex(function(Pe){return Pe.key===M}),de={};if($){var se=h.length-1-(ce>-1?ce:Q-1),z=n==="top"||n==="bottom"?"-50%":"0";if(se>0){var ee,he,G;de.height=w?(ee=g.current[M])===null||ee===void 0?void 0:ee.offsetHeight:v==null?void 0:v.offsetHeight;for(var xe=0,ue=0;ue<se;ue++){var Be;xe+=((Be=g.current[h[h.length-1-ue].key])===null||Be===void 0?void 0:Be.offsetHeight)+L}var an=(w?xe:se*P)*(n.startsWith("top")?1:-1),rn=!w&&v!==null&&v!==void 0&&v.offsetWidth&&(he=g.current[M])!==null&&he!==void 0&&he.offsetWidth?((v==null?void 0:v.offsetWidth)-P*2*(se<3?se:3))/((G=g.current[M])===null||G===void 0?void 0:G.offsetWidth):1;de.transform="translate3d(".concat(z,", ").concat(an,"px, 0) scaleX(").concat(rn,")")}else de.transform="translate3d(".concat(z,", 0, 0)")}return N.createElement("div",{ref:R,className:I("".concat(a,"-notice-wrapper"),Y,J==null?void 0:J.wrapper),style:F(F(F({},Z),de),oe==null?void 0:oe.wrapper),onMouseEnter:function(){return E(function(me){return me.includes(M)?me:[].concat(U(me),[M])})},onMouseLeave:function(){return E(function(me){return me.filter(function(ln){return ln!==M})})}},N.createElement(Rt,X({},ye,{ref:function(me){ce>-1?g.current[M]=me:delete g.current[M]},prefixCls:a,classNames:J,styles:oe,className:I(le,m==null?void 0:m.notice),style:ae,times:q,key:V,eventKey:V,onNoticeClose:u,hovering:$&&S.length>0})))})},_n=r.forwardRef(function(e,t){var o=e.prefixCls,n=o===void 0?"rc-notification":o,a=e.container,s=e.motion,d=e.maxCount,i=e.className,l=e.style,u=e.onAllRemoved,c=e.stack,f=e.renderNotifications,m=r.useState([]),g=K(m,2),C=g[0],p=g[1],v=function($){var O,P=C.find(function(B){return B.key===$});P==null||(O=P.onClose)===null||O===void 0||O.call(P),p(function(B){return B.filter(function(L){return L.key!==$})})};r.useImperativeHandle(t,function(){return{open:function($){p(function(O){var P=U(O),B=P.findIndex(function(_){return _.key===$.key}),L=F({},$);if(B>=0){var w;L.times=(((w=O[B])===null||w===void 0?void 0:w.times)||0)+1,P[B]=L}else L.times=0,P.push(L);return d>0&&P.length>d&&(P=P.slice(-d)),P})},close:function($){v($)},destroy:function(){p([])}}});var x=r.useState({}),b=K(x,2),y=b[0],S=b[1];r.useEffect(function(){var j={};C.forEach(function($){var O=$.placement,P=O===void 0?"topRight":O;P&&(j[P]=j[P]||[],j[P].push($))}),Object.keys(y).forEach(function($){j[$]=j[$]||[]}),S(j)},[C]);var E=function($){S(function(O){var P=F({},O),B=P[$]||[];return B.length||delete P[$],P})},h=r.useRef(!1);if(r.useEffect(function(){Object.keys(y).length>0?h.current=!0:h.current&&(u==null||u(),h.current=!1)},[y]),!a)return null;var T=Object.keys(y);return kn(r.createElement(r.Fragment,null,T.map(function(j){var $=y[j],O=r.createElement(Ln,{key:j,configList:$,placement:j,prefixCls:n,className:i==null?void 0:i(j),style:l==null?void 0:l(j),motion:s,onNoticeClose:v,onAllNoticeRemoved:E,stack:c});return f?f(O,{prefixCls:n,key:j}):O})),a)}),Dn=["getContainer","motion","prefixCls","maxCount","className","style","onAllRemoved","stack","renderNotifications"],Wn=function(){return document.body},rt=0;function qn(){for(var e={},t=arguments.length,o=new Array(t),n=0;n<t;n++)o[n]=arguments[n];return o.forEach(function(a){a&&Object.keys(a).forEach(function(s){var d=a[s];d!==void 0&&(e[s]=d)})}),e}function Vn(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.getContainer,o=t===void 0?Wn:t,n=e.motion,a=e.prefixCls,s=e.maxCount,d=e.className,i=e.style,l=e.onAllRemoved,u=e.stack,c=e.renderNotifications,f=bt(e,Dn),m=r.useState(),g=K(m,2),C=g[0],p=g[1],v=r.useRef(),x=r.createElement(_n,{container:C,ref:v,prefixCls:a,motion:n,maxCount:s,className:d,style:i,onAllRemoved:l,stack:u,renderNotifications:c}),b=r.useState([]),y=K(b,2),S=y[0],E=y[1],h=yt(function(j){var $=qn(f,j);($.key===null||$.key===void 0)&&($.key="rc-notification-".concat(rt),rt+=1),E(function(O){return[].concat(U(O),[{type:"open",config:$}])})}),T=r.useMemo(function(){return{open:h,close:function($){E(function(O){return[].concat(U(O),[{type:"close",key:$}])})},destroy:function(){E(function($){return[].concat(U($),[{type:"destroy"}])})}}},[]);return r.useEffect(function(){p(o())}),r.useEffect(function(){if(v.current&&S.length){S.forEach(function(O){switch(O.type){case"open":v.current.open(O.config);break;case"close":v.current.close(O.key);break;case"destroy":v.current.destroy();break}});var j,$;E(function(O){return(j!==O||!$)&&(j=O,$=O.filter(function(P){return!S.includes(P)})),$})}},[S]),[T,x]}const Gn=()=>{const[e,t]=r.useState([]),o=r.useCallback(n=>(t(a=>[].concat(U(a),[n])),()=>{t(a=>a.filter(s=>s!==n))}),[]);return[e,o]},Un=e=>{const{componentCls:t,iconCls:o,boxShadow:n,colorText:a,colorSuccess:s,colorError:d,colorWarning:i,colorInfo:l,fontSizeLG:u,motionEaseInOutCirc:c,motionDurationSlow:f,marginXS:m,paddingXS:g,borderRadiusLG:C,zIndexPopup:p,contentPadding:v,contentBg:x}=e,b=`${t}-notice`,y=new $e("MessageMoveIn",{"0%":{padding:0,transform:"translateY(-100%)",opacity:0},"100%":{padding:g,transform:"translateY(0)",opacity:1}}),S=new $e("MessageMoveOut",{"0%":{maxHeight:e.height,padding:g,opacity:1},"100%":{maxHeight:0,padding:0,opacity:0}}),E={padding:g,textAlign:"center",[`${t}-custom-content`]:{display:"flex",alignItems:"center"},[`${t}-custom-content > ${o}`]:{marginInlineEnd:m,fontSize:u},[`${b}-content`]:{display:"inline-block",padding:v,background:x,borderRadius:C,boxShadow:n,pointerEvents:"all"},[`${t}-success > ${o}`]:{color:s},[`${t}-error > ${o}`]:{color:d},[`${t}-warning > ${o}`]:{color:i},[`${t}-info > ${o},
|
|
2
2
|
${t}-loading > ${o}`]:{color:l}};return[{[t]:Object.assign(Object.assign({},ht(e)),{color:a,position:"fixed",top:m,width:"100%",pointerEvents:"none",zIndex:p,[`${t}-move-up`]:{animationFillMode:"forwards"},[`
|
|
3
3
|
${t}-move-up-appear,
|
|
4
4
|
${t}-move-up-enter
|
|
5
5
|
`]:{animationName:y,animationDuration:f,animationPlayState:"paused",animationTimingFunction:c},[`
|
|
6
6
|
${t}-move-up-appear${t}-move-up-appear-active,
|
|
7
7
|
${t}-move-up-enter${t}-move-up-enter-active
|
|
8
|
-
`]:{animationPlayState:"running"},[`${t}-move-up-leave`]:{animationName:S,animationDuration:f,animationPlayState:"paused",animationTimingFunction:c},[`${t}-move-up-leave${t}-move-up-leave-active`]:{animationPlayState:"running"},"&-rtl":{direction:"rtl",span:{direction:"rtl"}}})},{[t]:{[`${b}-wrapper`]:Object.assign({},E)}},{[`${t}-notice-pure-panel`]:Object.assign(Object.assign({},E),{padding:0,textAlign:"start"})}]},
|
|
8
|
+
`]:{animationPlayState:"running"},[`${t}-move-up-leave`]:{animationName:S,animationDuration:f,animationPlayState:"paused",animationTimingFunction:c},[`${t}-move-up-leave${t}-move-up-leave-active`]:{animationPlayState:"running"},"&-rtl":{direction:"rtl",span:{direction:"rtl"}}})},{[t]:{[`${b}-wrapper`]:Object.assign({},E)}},{[`${t}-notice-pure-panel`]:Object.assign(Object.assign({},E),{padding:0,textAlign:"start"})}]},Xn=e=>({zIndexPopup:e.zIndexPopupBase+xt+10,contentBg:e.colorBgElevated,contentPadding:`${(e.controlHeightLG-e.fontSize*e.lineHeight)/2}px ${e.paddingSM}px`}),Tt=Ve("Message",e=>{const t=Ge(e,{height:150});return Un(t)},Xn);var Kn=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(o[n[a]]=e[n[a]]);return o};const Yn={info:r.createElement(It,null),success:r.createElement(Ot,null),error:r.createElement(St,null),warning:r.createElement($t,null),loading:r.createElement(dn,null)},kt=({prefixCls:e,type:t,icon:o,children:n})=>r.createElement("div",{className:I(`${e}-custom-content`,`${e}-${t}`)},o||Yn[t],r.createElement("span",null,n)),Zn=e=>{const{prefixCls:t,className:o,type:n,icon:a,content:s}=e,d=Kn(e,["prefixCls","className","type","icon","content"]),{getPrefixCls:i}=r.useContext(ne),l=t||i("message"),u=Re(l),[c,f,m]=Tt(l,u);return c(r.createElement(Rt,Object.assign({},d,{prefixCls:l,className:I(o,f,`${l}-notice-pure-panel`,m,u),eventKey:"pure",duration:null,content:r.createElement(kt,{prefixCls:l,type:n,icon:a},s)})))};function Qn(e,t){return{motionName:t??`${e}-move-up`}}function Qe(e){let t;const o=new Promise(a=>{t=e(()=>{a(!0)})}),n=()=>{t==null||t()};return n.then=(a,s)=>o.then(a,s),n.promise=o,n}var Jn=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(o[n[a]]=e[n[a]]);return o};const eo=8,to=3,no=({children:e,prefixCls:t})=>{const o=Re(t),[n,a,s]=Tt(t,o);return n(r.createElement(zn,{classNames:{list:I(a,s,o)}},e))},oo=(e,{prefixCls:t,key:o})=>r.createElement(no,{prefixCls:t,key:o},e),ao=r.forwardRef((e,t)=>{const{top:o,prefixCls:n,getContainer:a,maxCount:s,duration:d=to,rtl:i,transitionName:l,onAllRemoved:u}=e,{getPrefixCls:c,getPopupContainer:f,message:m,direction:g}=r.useContext(ne),C=n||c("message"),p=()=>({left:"50%",transform:"translateX(-50%)",top:o??eo}),v=()=>I({[`${C}-rtl`]:i??g==="rtl"}),x=()=>Qn(C,l),b=r.createElement("span",{className:`${C}-close-x`},r.createElement(Ue,{className:`${C}-close-icon`})),[y,S]=Vn({prefixCls:C,style:p,className:v,motion:x,closable:!1,closeIcon:b,duration:d,getContainer:()=>(a==null?void 0:a())||(f==null?void 0:f())||document.body,maxCount:s,onAllRemoved:u,renderNotifications:oo});return r.useImperativeHandle(t,()=>Object.assign(Object.assign({},y),{prefixCls:C,message:m})),S});let lt=0;function Bt(e){const t=r.useRef(null);return un(),[r.useMemo(()=>{const n=l=>{var u;(u=t.current)===null||u===void 0||u.close(l)},a=l=>{if(!t.current){const h=()=>{};return h.then=()=>{},h}const{open:u,prefixCls:c,message:f}=t.current,m=`${c}-notice`,{content:g,icon:C,type:p,key:v,className:x,style:b,onClose:y}=l,S=Jn(l,["content","icon","type","key","className","style","onClose"]);let E=v;return E==null&&(lt+=1,E=`antd-message-${lt}`),Qe(h=>(u(Object.assign(Object.assign({},S),{key:E,content:r.createElement(kt,{prefixCls:c,type:p,icon:C},g),placement:"top",className:I(p&&`${m}-${p}`,x,f==null?void 0:f.className),style:Object.assign(Object.assign({},f==null?void 0:f.style),b),onClose:()=>{y==null||y(),h()}})),()=>{n(E)}))},d={open:a,destroy:l=>{var u;l!==void 0?n(l):(u=t.current)===null||u===void 0||u.destroy()}};return["info","success","warning","error","loading"].forEach(l=>{const u=(c,f,m)=>{let g;c&&typeof c=="object"&&"content"in c?g=c:g={content:c};let C,p;typeof f=="function"?p=f:(C=f,p=m);const v=Object.assign(Object.assign({onClose:p,duration:C},g),{type:l});return a(v)};d[l]=u}),d},[]),r.createElement(ao,Object.assign({key:"message-holder"},e,{ref:t}))]}function ro(e){return Bt(e)}const lo=new $e("antFadeIn",{"0%":{opacity:0},"100%":{opacity:1}}),so=new $e("antFadeOut",{"0%":{opacity:1},"100%":{opacity:0}}),io=(e,t=!1)=>{const{antCls:o}=e,n=`${o}-fade`,a=t?"&":"";return[fn(n,lo,so,e.motionDurationMid,t),{[`
|
|
9
9
|
${a}${n}-enter,
|
|
10
10
|
${a}${n}-appear
|
|
11
|
-
`]:{opacity:0,animationTimingFunction:"linear"},[`${a}${n}-leave`]:{animationTimingFunction:"linear"}}]},He=e=>typeof(e==null?void 0:e.then)=="function",Ht=e=>{const{type:t,children:o,prefixCls:n,buttonProps:a,close:s,autoFocus:d,emitEvent:i,isSilent:l,quitOnNullishReturnValue:u,actionFn:c}=e,f=r.useRef(!1),m=r.useRef(null),[g,C]=mn(!1),p=(...b)=>{s==null||s.apply(void 0,b)};r.useEffect(()=>{let b=null;return d&&(b=setTimeout(()=>{var y;(y=m.current)===null||y===void 0||y.focus({preventScroll:!0})})),()=>{b&&clearTimeout(b)}},[d]);const v=b=>{He(b)&&(C(!0),b.then((...y)=>{C(!1,!0),p.apply(void 0,y),f.current=!1},y=>{if(C(!1,!0),f.current=!1,!(l!=null&&l()))return Promise.reject(y)}))},x=b=>{if(f.current)return;if(f.current=!0,!c){p();return}let y;if(i){if(y=c(b),u&&!He(y)){f.current=!1,p(b);return}}else if(c.length)y=c(s),f.current=!1;else if(y=c(),!He(y)){p();return}v(y)};return r.createElement(Ke,Object.assign({},Et(t),{onClick:x,loading:g,prefixCls:n},a,{ref:m}),o)},Ee=N.createContext({}),{Provider:zt}=Ee,st=()=>{const{autoFocusButton:e,cancelButtonProps:t,cancelTextLocale:o,isSilent:n,mergedOkCancel:a,rootPrefixCls:s,close:d,onCancel:i,onConfirm:l}=fe(Ee);return a?N.createElement(Ht,{isSilent:n,actionFn:i,close:(...u)=>{d==null||d.apply(void 0,u),l==null||l(!1)},autoFocus:e==="cancel",buttonProps:t,prefixCls:`${s}-btn`},o):null},it=()=>{const{autoFocusButton:e,close:t,isSilent:o,okButtonProps:n,rootPrefixCls:a,okTextLocale:s,okType:d,onConfirm:i,onOk:l}=fe(Ee);return N.createElement(Ht,{isSilent:o,type:d||"primary",actionFn:l,close:(...u)=>{t==null||t.apply(void 0,u),i==null||i(!0)},autoFocus:e==="ok",buttonProps:n,prefixCls:`${a}-btn`},s)};var Ft=r.createContext({});function ct(e,t,o){var n=t;return!n&&o&&(n="".concat(e,"-").concat(o)),n}function dt(e,t){var o=e["page".concat(t?"Y":"X","Offset")],n="scroll".concat(t?"Top":"Left");if(typeof o!="number"){var a=e.document;o=a.documentElement[n],typeof o!="number"&&(o=a.body[n])}return o}function co(e){var t=e.getBoundingClientRect(),o={left:t.left,top:t.top},n=e.ownerDocument,a=n.defaultView||n.parentWindow;return o.left+=dt(a),o.top+=dt(a,!0),o}const uo=r.memo(function(e){var t=e.children;return t},function(e,t){var o=t.shouldUpdate;return!o});var fo={width:0,height:0,overflow:"hidden",outline:"none"},mo={outline:"none"},At=N.forwardRef(function(e,t){var o=e.prefixCls,n=e.className,a=e.style,s=e.title,d=e.ariaId,i=e.footer,l=e.closable,u=e.closeIcon,c=e.onClose,f=e.children,m=e.bodyStyle,g=e.bodyProps,C=e.modalRender,p=e.onMouseDown,v=e.onMouseUp,x=e.holderRef,b=e.visible,y=e.forceRender,S=e.width,E=e.height,h=e.classNames,T=e.styles,j=N.useContext(Ft),$=j.panel,O=gn(x,$),P=ie(),B=ie();N.useImperativeHandle(t,function(){return{focus:function(){var W;(W=P.current)===null||W===void 0||W.focus({preventScroll:!0})},changeActive:function(W){var V=document,q=V.activeElement;W&&q===B.current?P.current.focus({preventScroll:!0}):!W&&q===P.current&&B.current.focus({preventScroll:!0})}}});var L={};S!==void 0&&(L.width=S),E!==void 0&&(L.height=E);var w=i?N.createElement("div",{className:I("".concat(o,"-footer"),h==null?void 0:h.footer),style:F({},T==null?void 0:T.footer)},i):null,_=s?N.createElement("div",{className:I("".concat(o,"-header"),h==null?void 0:h.header),style:F({},T==null?void 0:T.header)},N.createElement("div",{className:"".concat(o,"-title"),id:d},s)):null,k=Tn(function(){return we(l)==="object"&&l!==null?l:l?{closeIcon:u??N.createElement("span",{className:"".concat(o,"-close-x")})}:{}},[l,u,o]),R=qe(k,!0),D=we(l)==="object"&&l.disabled,Y=l?N.createElement("button",K({type:"button",onClick:c,"aria-label":"Close"},R,{className:"".concat(o,"-close"),disabled:D}),k.closeIcon):null,Z=N.createElement("div",{className:I("".concat(o,"-content"),h==null?void 0:h.content),style:T==null?void 0:T.content},Y,_,N.createElement("div",K({className:I("".concat(o,"-body"),h==null?void 0:h.body),style:F(F({},m),T==null?void 0:T.body)},g),f),w);return N.createElement("div",{key:"dialog-element",role:"dialog","aria-labelledby":s?d:null,"aria-modal":"true",ref:O,style:F(F({},a),L),className:I(o,n),onMouseDown:p,onMouseUp:v},N.createElement("div",{ref:P,tabIndex:0,style:mo},N.createElement(uo,{shouldUpdate:b||y},C?C(Z):Z)),N.createElement("div",{tabIndex:0,ref:B,style:fo}))}),Lt=r.forwardRef(function(e,t){var o=e.prefixCls,n=e.title,a=e.style,s=e.className,d=e.visible,i=e.forceRender,l=e.destroyOnClose,u=e.motionName,c=e.ariaId,f=e.onVisibleChanged,m=e.mousePosition,g=ie(),C=r.useState(),p=X(C,2),v=p[0],x=p[1],b={};v&&(b.transformOrigin=v);function y(){var S=co(g.current);x(m&&(m.x||m.y)?"".concat(m.x-S.left,"px ").concat(m.y-S.top,"px"):"")}return r.createElement(Nt,{visible:d,onVisibleChanged:f,onAppearPrepare:y,onEnterPrepare:y,forceRender:i,motionName:u,removeOnLeave:l,ref:g},function(S,E){var h=S.className,T=S.style;return r.createElement(At,K({},e,{ref:t,title:n,ariaId:c,prefixCls:o,holderRef:E,style:F(F(F({},T),a),b),className:I(s,h)}))})});Lt.displayName="Content";var go=function(t){var o=t.prefixCls,n=t.style,a=t.visible,s=t.maskProps,d=t.motionName,i=t.className;return r.createElement(Nt,{key:"mask",visible:a,motionName:d,leavedClassName:"".concat(o,"-mask-hidden")},function(l,u){var c=l.className,f=l.style;return r.createElement("div",K({ref:u,style:F(F({},f),n),className:I("".concat(o,"-mask"),c,i)},s))})},vo=function(t){var o=t.prefixCls,n=o===void 0?"rc-dialog":o,a=t.zIndex,s=t.visible,d=s===void 0?!1:s,i=t.keyboard,l=i===void 0?!0:i,u=t.focusTriggerAfterClose,c=u===void 0?!0:u,f=t.wrapStyle,m=t.wrapClassName,g=t.wrapProps,C=t.onClose,p=t.afterOpenChange,v=t.afterClose,x=t.transitionName,b=t.animation,y=t.closable,S=y===void 0?!0:y,E=t.mask,h=E===void 0?!0:E,T=t.maskTransitionName,j=t.maskAnimation,$=t.maskClosable,O=$===void 0?!0:$,P=t.maskStyle,B=t.maskProps,L=t.rootClassName,w=t.classNames,_=t.styles,k=ie(),R=ie(),D=ie(),Y=r.useState(d),Z=X(Y,2),Q=Z[0],W=Z[1],V=vn();function q(){Je(R.current,document.activeElement)||(k.current=document.activeElement)}function M(){if(!Je(R.current,document.activeElement)){var z;(z=D.current)===null||z===void 0||z.focus()}}function A(z){if(z)M();else{if(W(!1),h&&k.current&&c){try{k.current.focus({preventScroll:!0})}catch{}k.current=null}Q&&(v==null||v())}p==null||p(z)}function le(z){C==null||C(z)}var ae=ie(!1),J=ie(),oe=function(){clearTimeout(J.current),ae.current=!0},ye=function(){J.current=setTimeout(function(){ae.current=!1})},ce=null;O&&(ce=function(ee){ae.current?ae.current=!1:R.current===ee.target&&le(ee)});function de(z){if(l&&z.keyCode===De.ESC){z.stopPropagation(),le(z);return}d&&z.keyCode===De.TAB&&D.current.changeActive(!z.shiftKey)}Ie(function(){d&&(W(!0),q())},[d]),Ie(function(){return function(){clearTimeout(J.current)}},[]);var se=F(F(F({zIndex:a},f),_==null?void 0:_.wrapper),{},{display:Q?null:"none"});return r.createElement("div",K({className:I("".concat(n,"-root"),L)},qe(t,{data:!0})),r.createElement(go,{prefixCls:n,visible:h&&d,motionName:ct(n,T,j),style:F(F({zIndex:a},P),_==null?void 0:_.mask),maskProps:B,className:w==null?void 0:w.mask}),r.createElement("div",K({tabIndex:-1,onKeyDown:de,className:I("".concat(n,"-wrap"),m,w==null?void 0:w.wrapper),ref:R,onClick:ce,style:se},g),r.createElement(Lt,K({},t,{onMouseDown:oe,onMouseUp:ye,ref:D,closable:S,ariaId:V,prefixCls:n,visible:d&&Q,onClose:le,onVisibleChanged:A,motionName:ct(n,x,b)}))))},_t=function(t){var o=t.visible,n=t.getContainer,a=t.forceRender,s=t.destroyOnClose,d=s===void 0?!1:s,i=t.afterClose,l=t.panelRef,u=r.useState(o),c=X(u,2),f=c[0],m=c[1],g=r.useMemo(function(){return{panel:l}},[l]);return r.useEffect(function(){o&&m(!0)},[o]),!a&&d&&!f?null:r.createElement(Ft.Provider,{value:g},r.createElement(Cn,{open:o||a||f,autoDestroy:!1,getContainer:n,autoLock:o||f},r.createElement(vo,K({},t,{destroyOnClose:d,afterClose:function(){i==null||i(),m(!1)}}))))};_t.displayName="Dialog";const Co=()=>pn()&&window.document.documentElement,Me=e=>{const{prefixCls:t,className:o,style:n,size:a,shape:s}=e,d=I({[`${t}-lg`]:a==="large",[`${t}-sm`]:a==="small"}),i=I({[`${t}-circle`]:s==="circle",[`${t}-square`]:s==="square",[`${t}-round`]:s==="round"}),l=r.useMemo(()=>typeof a=="number"?{width:a,height:a,lineHeight:`${a}px`}:{},[a]);return r.createElement("span",{className:I(t,d,i,o),style:Object.assign(Object.assign({},l),n)})},po=new $e("ant-skeleton-loading",{"0%":{backgroundPosition:"100% 50%"},"100%":{backgroundPosition:"0 50%"}}),Te=e=>({height:e,lineHeight:H(e)}),Ce=e=>Object.assign({width:e},Te(e)),bo=e=>({background:e.skeletonLoadingBackground,backgroundSize:"400% 100%",animationName:po,animationDuration:e.skeletonLoadingMotionDuration,animationTimingFunction:"ease",animationIterationCount:"infinite"}),ze=(e,t)=>Object.assign({width:t(e).mul(5).equal(),minWidth:t(e).mul(5).equal()},Te(e)),yo=e=>{const{skeletonAvatarCls:t,gradientFromColor:o,controlHeight:n,controlHeightLG:a,controlHeightSM:s}=e;return{[t]:Object.assign({display:"inline-block",verticalAlign:"top",background:o},Ce(n)),[`${t}${t}-circle`]:{borderRadius:"50%"},[`${t}${t}-lg`]:Object.assign({},Ce(a)),[`${t}${t}-sm`]:Object.assign({},Ce(s))}},ho=e=>{const{controlHeight:t,borderRadiusSM:o,skeletonInputCls:n,controlHeightLG:a,controlHeightSM:s,gradientFromColor:d,calc:i}=e;return{[n]:Object.assign({display:"inline-block",verticalAlign:"top",background:d,borderRadius:o},ze(t,i)),[`${n}-lg`]:Object.assign({},ze(a,i)),[`${n}-sm`]:Object.assign({},ze(s,i))}},ut=e=>Object.assign({width:e},Te(e)),xo=e=>{const{skeletonImageCls:t,imageSizeBase:o,gradientFromColor:n,borderRadiusSM:a,calc:s}=e;return{[t]:Object.assign(Object.assign({display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"middle",background:n,borderRadius:a},ut(s(o).mul(2).equal())),{[`${t}-path`]:{fill:"#bfbfbf"},[`${t}-svg`]:Object.assign(Object.assign({},ut(o)),{maxWidth:s(o).mul(4).equal(),maxHeight:s(o).mul(4).equal()}),[`${t}-svg${t}-svg-circle`]:{borderRadius:"50%"}}),[`${t}${t}-circle`]:{borderRadius:"50%"}}},Fe=(e,t,o)=>{const{skeletonButtonCls:n}=e;return{[`${o}${n}-circle`]:{width:t,minWidth:t,borderRadius:"50%"},[`${o}${n}-round`]:{borderRadius:t}}},Ae=(e,t)=>Object.assign({width:t(e).mul(2).equal(),minWidth:t(e).mul(2).equal()},Te(e)),$o=e=>{const{borderRadiusSM:t,skeletonButtonCls:o,controlHeight:n,controlHeightLG:a,controlHeightSM:s,gradientFromColor:d,calc:i}=e;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({[o]:Object.assign({display:"inline-block",verticalAlign:"top",background:d,borderRadius:t,width:i(n).mul(2).equal(),minWidth:i(n).mul(2).equal()},Ae(n,i))},Fe(e,n,o)),{[`${o}-lg`]:Object.assign({},Ae(a,i))}),Fe(e,a,`${o}-lg`)),{[`${o}-sm`]:Object.assign({},Ae(s,i))}),Fe(e,s,`${o}-sm`))},So=e=>{const{componentCls:t,skeletonAvatarCls:o,skeletonTitleCls:n,skeletonParagraphCls:a,skeletonButtonCls:s,skeletonInputCls:d,skeletonImageCls:i,controlHeight:l,controlHeightLG:u,controlHeightSM:c,gradientFromColor:f,padding:m,marginSM:g,borderRadius:C,titleHeight:p,blockRadius:v,paragraphLiHeight:x,controlHeightXS:b,paragraphMarginTop:y}=e;return{[t]:{display:"table",width:"100%",[`${t}-header`]:{display:"table-cell",paddingInlineEnd:m,verticalAlign:"top",[o]:Object.assign({display:"inline-block",verticalAlign:"top",background:f},Ce(l)),[`${o}-circle`]:{borderRadius:"50%"},[`${o}-lg`]:Object.assign({},Ce(u)),[`${o}-sm`]:Object.assign({},Ce(c))},[`${t}-content`]:{display:"table-cell",width:"100%",verticalAlign:"top",[n]:{width:"100%",height:p,background:f,borderRadius:v,[`+ ${a}`]:{marginBlockStart:c}},[a]:{padding:0,"> li":{width:"100%",height:x,listStyle:"none",background:f,borderRadius:v,"+ li":{marginBlockStart:b}}},[`${a}> li:last-child:not(:first-child):not(:nth-child(2))`]:{width:"61%"}},[`&-round ${t}-content`]:{[`${n}, ${a} > li`]:{borderRadius:C}}},[`${t}-with-avatar ${t}-content`]:{[n]:{marginBlockStart:g,[`+ ${a}`]:{marginBlockStart:y}}},[`${t}${t}-element`]:Object.assign(Object.assign(Object.assign(Object.assign({display:"inline-block",width:"auto"},$o(e)),yo(e)),ho(e)),xo(e)),[`${t}${t}-block`]:{width:"100%",[s]:{width:"100%"},[d]:{width:"100%"}},[`${t}${t}-active`]:{[`
|
|
11
|
+
`]:{opacity:0,animationTimingFunction:"linear"},[`${a}${n}-leave`]:{animationTimingFunction:"linear"}}]},He=e=>typeof(e==null?void 0:e.then)=="function",Ht=e=>{const{type:t,children:o,prefixCls:n,buttonProps:a,close:s,autoFocus:d,emitEvent:i,isSilent:l,quitOnNullishReturnValue:u,actionFn:c}=e,f=r.useRef(!1),m=r.useRef(null),[g,C]=mn(!1),p=(...b)=>{s==null||s.apply(void 0,b)};r.useEffect(()=>{let b=null;return d&&(b=setTimeout(()=>{var y;(y=m.current)===null||y===void 0||y.focus({preventScroll:!0})})),()=>{b&&clearTimeout(b)}},[d]);const v=b=>{He(b)&&(C(!0),b.then((...y)=>{C(!1,!0),p.apply(void 0,y),f.current=!1},y=>{if(C(!1,!0),f.current=!1,!(l!=null&&l()))return Promise.reject(y)}))},x=b=>{if(f.current)return;if(f.current=!0,!c){p();return}let y;if(i){if(y=c(b),u&&!He(y)){f.current=!1,p(b);return}}else if(c.length)y=c(s),f.current=!1;else if(y=c(),!He(y)){p();return}v(y)};return r.createElement(Xe,Object.assign({},Et(t),{onClick:x,loading:g,prefixCls:n},a,{ref:m}),o)},Ee=N.createContext({}),{Provider:zt}=Ee,st=()=>{const{autoFocusButton:e,cancelButtonProps:t,cancelTextLocale:o,isSilent:n,mergedOkCancel:a,rootPrefixCls:s,close:d,onCancel:i,onConfirm:l}=fe(Ee);return a?N.createElement(Ht,{isSilent:n,actionFn:i,close:(...u)=>{d==null||d.apply(void 0,u),l==null||l(!1)},autoFocus:e==="cancel",buttonProps:t,prefixCls:`${s}-btn`},o):null},it=()=>{const{autoFocusButton:e,close:t,isSilent:o,okButtonProps:n,rootPrefixCls:a,okTextLocale:s,okType:d,onConfirm:i,onOk:l}=fe(Ee);return N.createElement(Ht,{isSilent:o,type:d||"primary",actionFn:l,close:(...u)=>{t==null||t.apply(void 0,u),i==null||i(!0)},autoFocus:e==="ok",buttonProps:n,prefixCls:`${a}-btn`},s)};var Ft=r.createContext({});function ct(e,t,o){var n=t;return!n&&o&&(n="".concat(e,"-").concat(o)),n}function dt(e,t){var o=e["page".concat(t?"Y":"X","Offset")],n="scroll".concat(t?"Top":"Left");if(typeof o!="number"){var a=e.document;o=a.documentElement[n],typeof o!="number"&&(o=a.body[n])}return o}function co(e){var t=e.getBoundingClientRect(),o={left:t.left,top:t.top},n=e.ownerDocument,a=n.defaultView||n.parentWindow;return o.left+=dt(a),o.top+=dt(a,!0),o}const uo=r.memo(function(e){var t=e.children;return t},function(e,t){var o=t.shouldUpdate;return!o});var fo={width:0,height:0,overflow:"hidden",outline:"none"},mo={outline:"none"},At=N.forwardRef(function(e,t){var o=e.prefixCls,n=e.className,a=e.style,s=e.title,d=e.ariaId,i=e.footer,l=e.closable,u=e.closeIcon,c=e.onClose,f=e.children,m=e.bodyStyle,g=e.bodyProps,C=e.modalRender,p=e.onMouseDown,v=e.onMouseUp,x=e.holderRef,b=e.visible,y=e.forceRender,S=e.width,E=e.height,h=e.classNames,T=e.styles,j=N.useContext(Ft),$=j.panel,O=gn(x,$),P=ie(),B=ie();N.useImperativeHandle(t,function(){return{focus:function(){var W;(W=P.current)===null||W===void 0||W.focus({preventScroll:!0})},changeActive:function(W){var V=document,q=V.activeElement;W&&q===B.current?P.current.focus({preventScroll:!0}):!W&&q===P.current&&B.current.focus({preventScroll:!0})}}});var L={};S!==void 0&&(L.width=S),E!==void 0&&(L.height=E);var w=i?N.createElement("div",{className:I("".concat(o,"-footer"),h==null?void 0:h.footer),style:F({},T==null?void 0:T.footer)},i):null,_=s?N.createElement("div",{className:I("".concat(o,"-header"),h==null?void 0:h.header),style:F({},T==null?void 0:T.header)},N.createElement("div",{className:"".concat(o,"-title"),id:d},s)):null,k=Tn(function(){return we(l)==="object"&&l!==null?l:l?{closeIcon:u??N.createElement("span",{className:"".concat(o,"-close-x")})}:{}},[l,u,o]),R=qe(k,!0),D=we(l)==="object"&&l.disabled,Y=l?N.createElement("button",X({type:"button",onClick:c,"aria-label":"Close"},R,{className:"".concat(o,"-close"),disabled:D}),k.closeIcon):null,Z=N.createElement("div",{className:I("".concat(o,"-content"),h==null?void 0:h.content),style:T==null?void 0:T.content},Y,_,N.createElement("div",X({className:I("".concat(o,"-body"),h==null?void 0:h.body),style:F(F({},m),T==null?void 0:T.body)},g),f),w);return N.createElement("div",{key:"dialog-element",role:"dialog","aria-labelledby":s?d:null,"aria-modal":"true",ref:O,style:F(F({},a),L),className:I(o,n),onMouseDown:p,onMouseUp:v},N.createElement("div",{ref:P,tabIndex:0,style:mo},N.createElement(uo,{shouldUpdate:b||y},C?C(Z):Z)),N.createElement("div",{tabIndex:0,ref:B,style:fo}))}),Lt=r.forwardRef(function(e,t){var o=e.prefixCls,n=e.title,a=e.style,s=e.className,d=e.visible,i=e.forceRender,l=e.destroyOnClose,u=e.motionName,c=e.ariaId,f=e.onVisibleChanged,m=e.mousePosition,g=ie(),C=r.useState(),p=K(C,2),v=p[0],x=p[1],b={};v&&(b.transformOrigin=v);function y(){var S=co(g.current);x(m&&(m.x||m.y)?"".concat(m.x-S.left,"px ").concat(m.y-S.top,"px"):"")}return r.createElement(Nt,{visible:d,onVisibleChanged:f,onAppearPrepare:y,onEnterPrepare:y,forceRender:i,motionName:u,removeOnLeave:l,ref:g},function(S,E){var h=S.className,T=S.style;return r.createElement(At,X({},e,{ref:t,title:n,ariaId:c,prefixCls:o,holderRef:E,style:F(F(F({},T),a),b),className:I(s,h)}))})});Lt.displayName="Content";var go=function(t){var o=t.prefixCls,n=t.style,a=t.visible,s=t.maskProps,d=t.motionName,i=t.className;return r.createElement(Nt,{key:"mask",visible:a,motionName:d,leavedClassName:"".concat(o,"-mask-hidden")},function(l,u){var c=l.className,f=l.style;return r.createElement("div",X({ref:u,style:F(F({},f),n),className:I("".concat(o,"-mask"),c,i)},s))})},vo=function(t){var o=t.prefixCls,n=o===void 0?"rc-dialog":o,a=t.zIndex,s=t.visible,d=s===void 0?!1:s,i=t.keyboard,l=i===void 0?!0:i,u=t.focusTriggerAfterClose,c=u===void 0?!0:u,f=t.wrapStyle,m=t.wrapClassName,g=t.wrapProps,C=t.onClose,p=t.afterOpenChange,v=t.afterClose,x=t.transitionName,b=t.animation,y=t.closable,S=y===void 0?!0:y,E=t.mask,h=E===void 0?!0:E,T=t.maskTransitionName,j=t.maskAnimation,$=t.maskClosable,O=$===void 0?!0:$,P=t.maskStyle,B=t.maskProps,L=t.rootClassName,w=t.classNames,_=t.styles,k=ie(),R=ie(),D=ie(),Y=r.useState(d),Z=K(Y,2),Q=Z[0],W=Z[1],V=vn();function q(){Je(R.current,document.activeElement)||(k.current=document.activeElement)}function M(){if(!Je(R.current,document.activeElement)){var z;(z=D.current)===null||z===void 0||z.focus()}}function A(z){if(z)M();else{if(W(!1),h&&k.current&&c){try{k.current.focus({preventScroll:!0})}catch{}k.current=null}Q&&(v==null||v())}p==null||p(z)}function le(z){C==null||C(z)}var ae=ie(!1),J=ie(),oe=function(){clearTimeout(J.current),ae.current=!0},ye=function(){J.current=setTimeout(function(){ae.current=!1})},ce=null;O&&(ce=function(ee){ae.current?ae.current=!1:R.current===ee.target&&le(ee)});function de(z){if(l&&z.keyCode===De.ESC){z.stopPropagation(),le(z);return}d&&z.keyCode===De.TAB&&D.current.changeActive(!z.shiftKey)}Ie(function(){d&&(W(!0),q())},[d]),Ie(function(){return function(){clearTimeout(J.current)}},[]);var se=F(F(F({zIndex:a},f),_==null?void 0:_.wrapper),{},{display:Q?null:"none"});return r.createElement("div",X({className:I("".concat(n,"-root"),L)},qe(t,{data:!0})),r.createElement(go,{prefixCls:n,visible:h&&d,motionName:ct(n,T,j),style:F(F({zIndex:a},P),_==null?void 0:_.mask),maskProps:B,className:w==null?void 0:w.mask}),r.createElement("div",X({tabIndex:-1,onKeyDown:de,className:I("".concat(n,"-wrap"),m,w==null?void 0:w.wrapper),ref:R,onClick:ce,style:se},g),r.createElement(Lt,X({},t,{onMouseDown:oe,onMouseUp:ye,ref:D,closable:S,ariaId:V,prefixCls:n,visible:d&&Q,onClose:le,onVisibleChanged:A,motionName:ct(n,x,b)}))))},_t=function(t){var o=t.visible,n=t.getContainer,a=t.forceRender,s=t.destroyOnClose,d=s===void 0?!1:s,i=t.afterClose,l=t.panelRef,u=r.useState(o),c=K(u,2),f=c[0],m=c[1],g=r.useMemo(function(){return{panel:l}},[l]);return r.useEffect(function(){o&&m(!0)},[o]),!a&&d&&!f?null:r.createElement(Ft.Provider,{value:g},r.createElement(Cn,{open:o||a||f,autoDestroy:!1,getContainer:n,autoLock:o||f},r.createElement(vo,X({},t,{destroyOnClose:d,afterClose:function(){i==null||i(),m(!1)}}))))};_t.displayName="Dialog";const Co=()=>pn()&&window.document.documentElement,Me=e=>{const{prefixCls:t,className:o,style:n,size:a,shape:s}=e,d=I({[`${t}-lg`]:a==="large",[`${t}-sm`]:a==="small"}),i=I({[`${t}-circle`]:s==="circle",[`${t}-square`]:s==="square",[`${t}-round`]:s==="round"}),l=r.useMemo(()=>typeof a=="number"?{width:a,height:a,lineHeight:`${a}px`}:{},[a]);return r.createElement("span",{className:I(t,d,i,o),style:Object.assign(Object.assign({},l),n)})},po=new $e("ant-skeleton-loading",{"0%":{backgroundPosition:"100% 50%"},"100%":{backgroundPosition:"0 50%"}}),Te=e=>({height:e,lineHeight:H(e)}),Ce=e=>Object.assign({width:e},Te(e)),bo=e=>({background:e.skeletonLoadingBackground,backgroundSize:"400% 100%",animationName:po,animationDuration:e.skeletonLoadingMotionDuration,animationTimingFunction:"ease",animationIterationCount:"infinite"}),ze=(e,t)=>Object.assign({width:t(e).mul(5).equal(),minWidth:t(e).mul(5).equal()},Te(e)),yo=e=>{const{skeletonAvatarCls:t,gradientFromColor:o,controlHeight:n,controlHeightLG:a,controlHeightSM:s}=e;return{[t]:Object.assign({display:"inline-block",verticalAlign:"top",background:o},Ce(n)),[`${t}${t}-circle`]:{borderRadius:"50%"},[`${t}${t}-lg`]:Object.assign({},Ce(a)),[`${t}${t}-sm`]:Object.assign({},Ce(s))}},ho=e=>{const{controlHeight:t,borderRadiusSM:o,skeletonInputCls:n,controlHeightLG:a,controlHeightSM:s,gradientFromColor:d,calc:i}=e;return{[n]:Object.assign({display:"inline-block",verticalAlign:"top",background:d,borderRadius:o},ze(t,i)),[`${n}-lg`]:Object.assign({},ze(a,i)),[`${n}-sm`]:Object.assign({},ze(s,i))}},ut=e=>Object.assign({width:e},Te(e)),xo=e=>{const{skeletonImageCls:t,imageSizeBase:o,gradientFromColor:n,borderRadiusSM:a,calc:s}=e;return{[t]:Object.assign(Object.assign({display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"middle",background:n,borderRadius:a},ut(s(o).mul(2).equal())),{[`${t}-path`]:{fill:"#bfbfbf"},[`${t}-svg`]:Object.assign(Object.assign({},ut(o)),{maxWidth:s(o).mul(4).equal(),maxHeight:s(o).mul(4).equal()}),[`${t}-svg${t}-svg-circle`]:{borderRadius:"50%"}}),[`${t}${t}-circle`]:{borderRadius:"50%"}}},Fe=(e,t,o)=>{const{skeletonButtonCls:n}=e;return{[`${o}${n}-circle`]:{width:t,minWidth:t,borderRadius:"50%"},[`${o}${n}-round`]:{borderRadius:t}}},Ae=(e,t)=>Object.assign({width:t(e).mul(2).equal(),minWidth:t(e).mul(2).equal()},Te(e)),$o=e=>{const{borderRadiusSM:t,skeletonButtonCls:o,controlHeight:n,controlHeightLG:a,controlHeightSM:s,gradientFromColor:d,calc:i}=e;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({[o]:Object.assign({display:"inline-block",verticalAlign:"top",background:d,borderRadius:t,width:i(n).mul(2).equal(),minWidth:i(n).mul(2).equal()},Ae(n,i))},Fe(e,n,o)),{[`${o}-lg`]:Object.assign({},Ae(a,i))}),Fe(e,a,`${o}-lg`)),{[`${o}-sm`]:Object.assign({},Ae(s,i))}),Fe(e,s,`${o}-sm`))},So=e=>{const{componentCls:t,skeletonAvatarCls:o,skeletonTitleCls:n,skeletonParagraphCls:a,skeletonButtonCls:s,skeletonInputCls:d,skeletonImageCls:i,controlHeight:l,controlHeightLG:u,controlHeightSM:c,gradientFromColor:f,padding:m,marginSM:g,borderRadius:C,titleHeight:p,blockRadius:v,paragraphLiHeight:x,controlHeightXS:b,paragraphMarginTop:y}=e;return{[t]:{display:"table",width:"100%",[`${t}-header`]:{display:"table-cell",paddingInlineEnd:m,verticalAlign:"top",[o]:Object.assign({display:"inline-block",verticalAlign:"top",background:f},Ce(l)),[`${o}-circle`]:{borderRadius:"50%"},[`${o}-lg`]:Object.assign({},Ce(u)),[`${o}-sm`]:Object.assign({},Ce(c))},[`${t}-content`]:{display:"table-cell",width:"100%",verticalAlign:"top",[n]:{width:"100%",height:p,background:f,borderRadius:v,[`+ ${a}`]:{marginBlockStart:c}},[a]:{padding:0,"> li":{width:"100%",height:x,listStyle:"none",background:f,borderRadius:v,"+ li":{marginBlockStart:b}}},[`${a}> li:last-child:not(:first-child):not(:nth-child(2))`]:{width:"61%"}},[`&-round ${t}-content`]:{[`${n}, ${a} > li`]:{borderRadius:C}}},[`${t}-with-avatar ${t}-content`]:{[n]:{marginBlockStart:g,[`+ ${a}`]:{marginBlockStart:y}}},[`${t}${t}-element`]:Object.assign(Object.assign(Object.assign(Object.assign({display:"inline-block",width:"auto"},$o(e)),yo(e)),ho(e)),xo(e)),[`${t}${t}-block`]:{width:"100%",[s]:{width:"100%"},[d]:{width:"100%"}},[`${t}${t}-active`]:{[`
|
|
12
12
|
${n},
|
|
13
13
|
${a} > li,
|
|
14
14
|
${o},
|
|
15
15
|
${s},
|
|
16
16
|
${d},
|
|
17
17
|
${i}
|
|
18
|
-
`]:Object.assign({},bo(e))}}},Oo=e=>{const{colorFillContent:t,colorFill:o}=e,n=t,a=o;return{color:n,colorGradientEnd:a,gradientFromColor:n,gradientToColor:a,titleHeight:e.controlHeight/2,blockRadius:e.borderRadiusSM,paragraphMarginTop:e.marginLG+e.marginXXS,paragraphLiHeight:e.controlHeight/2}},pe=Ve("Skeleton",e=>{const{componentCls:t,calc:o}=e,n=Ge(e,{skeletonAvatarCls:`${t}-avatar`,skeletonTitleCls:`${t}-title`,skeletonParagraphCls:`${t}-paragraph`,skeletonButtonCls:`${t}-button`,skeletonInputCls:`${t}-input`,skeletonImageCls:`${t}-image`,imageSizeBase:o(e.controlHeight).mul(1.5).equal(),borderRadius:100,skeletonLoadingBackground:`linear-gradient(90deg, ${e.gradientFromColor} 25%, ${e.gradientToColor} 37%, ${e.gradientFromColor} 63%)`,skeletonLoadingMotionDuration:"1.4s"});return So(n)},Oo,{deprecatedTokens:[["color","gradientFromColor"],["colorGradientEnd","gradientToColor"]]}),Eo=e=>{const{prefixCls:t,className:o,rootClassName:n,active:a,shape:s="circle",size:d="default"}=e,{getPrefixCls:i}=r.useContext(ne),l=i("skeleton",t),[u,c,f]=pe(l),m=Xe(e,["prefixCls","className"]),g=I(l,`${l}-element`,{[`${l}-active`]:a},o,n,c,f);return u(r.createElement("div",{className:g},r.createElement(Me,Object.assign({prefixCls:`${l}-avatar`,shape:s,size:d},m))))},No=e=>{const{prefixCls:t,className:o,rootClassName:n,active:a,block:s=!1,size:d="default"}=e,{getPrefixCls:i}=r.useContext(ne),l=i("skeleton",t),[u,c,f]=pe(l),m=Xe(e,["prefixCls"]),g=I(l,`${l}-element`,{[`${l}-active`]:a,[`${l}-block`]:s},o,n,c,f);return u(r.createElement("div",{className:g},r.createElement(Me,Object.assign({prefixCls:`${l}-button`,size:d},m))))},Po="M365.714286 329.142857q0 45.714286-32.036571 77.677714t-77.677714 32.036571-77.677714-32.036571-32.036571-77.677714 32.036571-77.677714 77.677714-32.036571 77.677714 32.036571 32.036571 77.677714zM950.857143 548.571429l0 256-804.571429 0 0-109.714286 182.857143-182.857143 91.428571 91.428571 292.571429-292.571429zM1005.714286 146.285714l-914.285714 0q-7.460571 0-12.873143 5.412571t-5.412571 12.873143l0 694.857143q0 7.460571 5.412571 12.873143t12.873143 5.412571l914.285714 0q7.460571 0 12.873143-5.412571t5.412571-12.873143l0-694.857143q0-7.460571-5.412571-12.873143t-12.873143-5.412571zM1097.142857 164.571429l0 694.857143q0 37.741714-26.843429 64.585143t-64.585143 26.843429l-914.285714 0q-37.741714 0-64.585143-26.843429t-26.843429-64.585143l0-694.857143q0-37.741714 26.843429-64.585143t64.585143-26.843429l914.285714 0q37.741714 0 64.585143 26.843429t26.843429 64.585143z",wo=e=>{const{prefixCls:t,className:o,rootClassName:n,style:a,active:s}=e,{getPrefixCls:d}=r.useContext(ne),i=d("skeleton",t),[l,u,c]=pe(i),f=I(i,`${i}-element`,{[`${i}-active`]:s},o,n,u,c);return l(r.createElement("div",{className:f},r.createElement("div",{className:I(`${i}-image`,o),style:a},r.createElement("svg",{viewBox:"0 0 1098 1024",xmlns:"http://www.w3.org/2000/svg",className:`${i}-image-svg`},r.createElement("title",null,"Image placeholder"),r.createElement("path",{d:Po,className:`${i}-image-path`})))))},jo=e=>{const{prefixCls:t,className:o,rootClassName:n,active:a,block:s,size:d="default"}=e,{getPrefixCls:i}=r.useContext(ne),l=i("skeleton",t),[u,c,f]=pe(l),m=Xe(e,["prefixCls"]),g=I(l,`${l}-element`,{[`${l}-active`]:a,[`${l}-block`]:s},o,n,c,f);return u(r.createElement("div",{className:g},r.createElement(Me,Object.assign({prefixCls:`${l}-input`,size:d},m))))},Io=e=>{const{prefixCls:t,className:o,rootClassName:n,style:a,active:s,children:d}=e,{getPrefixCls:i}=r.useContext(ne),l=i("skeleton",t),[u,c,f]=pe(l),m=I(l,`${l}-element`,{[`${l}-active`]:s},c,o,n,f);return u(r.createElement("div",{className:m},r.createElement("div",{className:I(`${l}-image`,o),style:a},d)))},Ro=(e,t)=>{const{width:o,rows:n=2}=t;if(Array.isArray(o))return o[e];if(n-1===e)return o},Mo=e=>{const{prefixCls:t,className:o,style:n,rows:a=0}=e,s=Array.from({length:a}).map((d,i)=>r.createElement("li",{key:i,style:{width:Ro(i,e)}}));return r.createElement("ul",{className:I(t,o),style:n},s)},To=({prefixCls:e,className:t,width:o,style:n})=>r.createElement("h3",{className:I(e,t),style:Object.assign({width:o},n)});function Le(e){return e&&typeof e=="object"?e:{}}function ko(e,t){return e&&!t?{size:"large",shape:"square"}:{size:"large",shape:"circle"}}function Bo(e,t){return!e&&t?{width:"38%"}:e&&t?{width:"50%"}:{}}function Ho(e,t){const o={};return(!e||!t)&&(o.width="61%"),!e&&t?o.rows=3:o.rows=2,o}const be=e=>{const{prefixCls:t,loading:o,className:n,rootClassName:a,style:s,children:d,avatar:i=!1,title:l=!0,paragraph:u=!0,active:c,round:f}=e,{getPrefixCls:m,direction:g,className:C,style:p}=bn("skeleton"),v=m("skeleton",t),[x,b,y]=pe(v);if(o||!("loading"in e)){const S=!!i,E=!!l,h=!!u;let T;if(S){const O=Object.assign(Object.assign({prefixCls:`${v}-avatar`},ko(E,h)),Le(i));T=r.createElement("div",{className:`${v}-header`},r.createElement(Me,Object.assign({},O)))}let j;if(E||h){let O;if(E){const B=Object.assign(Object.assign({prefixCls:`${v}-title`},Bo(S,h)),Le(l));O=r.createElement(To,Object.assign({},B))}let P;if(h){const B=Object.assign(Object.assign({prefixCls:`${v}-paragraph`},Ho(S,E)),Le(u));P=r.createElement(Mo,Object.assign({},B))}j=r.createElement("div",{className:`${v}-content`},O,P)}const $=I(v,{[`${v}-with-avatar`]:S,[`${v}-active`]:c,[`${v}-rtl`]:g==="rtl",[`${v}-round`]:f},C,n,a,b,y);return x(r.createElement("div",{className:$,style:Object.assign(Object.assign({},p),s)},T,j))}return d??null};be.Button=No;be.Avatar=Eo;be.Input=jo;be.Image=wo;be.Node=Io;function ft(){}const zo=r.createContext({add:ft,remove:ft});function Fo(e){const t=r.useContext(zo),o=r.useRef(null);return yt(a=>{if(a){const s=e?a.querySelector(e):a;s&&(t.add(s),o.current=s)}else t.remove(o.current)})}const mt=()=>{const{cancelButtonProps:e,cancelTextLocale:t,onCancel:o}=fe(Ee);return N.createElement(Ke,Object.assign({onClick:o},e),t)},gt=()=>{const{confirmLoading:e,okButtonProps:t,okType:o,okTextLocale:n,onOk:a}=fe(Ee);return N.createElement(Ke,Object.assign({},Et(o),{loading:e,onClick:a},t),n)};function Dt(e,t){return N.createElement("span",{className:`${e}-close-x`},t||N.createElement(Ue,{className:`${e}-close-icon`}))}const Wt=e=>{const{okText:t,okType:o="primary",cancelText:n,confirmLoading:a,onOk:s,onCancel:d,okButtonProps:i,cancelButtonProps:l,footer:u}=e,[c]=Ye("Modal",Pt()),f=t||(c==null?void 0:c.okText),m=n||(c==null?void 0:c.cancelText),g=N.useMemo(()=>({confirmLoading:a,okButtonProps:i,cancelButtonProps:l,okTextLocale:f,cancelTextLocale:m,okType:o,onOk:s,onCancel:d}),[a,i,l,f,m,o,s,d]);let C;return typeof u=="function"||typeof u>"u"?(C=N.createElement(N.Fragment,null,N.createElement(mt,null),N.createElement(gt,null)),typeof u=="function"&&(C=u(C,{OkBtn:gt,CancelBtn:mt})),C=N.createElement(zt,{value:g},C)):C=u,N.createElement(yn,{disabled:!1},C)};function vt(e){return{position:e,inset:0}}const Ao=e=>{const{componentCls:t,antCls:o}=e;return[{[`${t}-root`]:{[`${t}${o}-zoom-enter, ${t}${o}-zoom-appear`]:{transform:"none",opacity:0,animationDuration:e.motionDurationSlow,userSelect:"none"},[`${t}${o}-zoom-leave ${t}-content`]:{pointerEvents:"none"},[`${t}-mask`]:Object.assign(Object.assign({},vt("fixed")),{zIndex:e.zIndexPopupBase,height:"100%",backgroundColor:e.colorBgMask,pointerEvents:"none",[`${t}-hidden`]:{display:"none"}}),[`${t}-wrap`]:Object.assign(Object.assign({},vt("fixed")),{zIndex:e.zIndexPopupBase,overflow:"auto",outline:0,WebkitOverflowScrolling:"touch"})}},{[`${t}-root`]:io(e)}]},Lo=e=>{const{componentCls:t}=e;return[{[`${t}-root`]:{[`${t}-wrap-rtl`]:{direction:"rtl"},[`${t}-centered`]:{textAlign:"center","&::before":{display:"inline-block",width:0,height:"100%",verticalAlign:"middle",content:'""'},[t]:{top:0,display:"inline-block",paddingBottom:0,textAlign:"start",verticalAlign:"middle"}},[`@media (max-width: ${e.screenSMMax}px)`]:{[t]:{maxWidth:"calc(100vw - 16px)",margin:`${H(e.marginXS)} auto`},[`${t}-centered`]:{[t]:{flex:1}}}}},{[t]:Object.assign(Object.assign({},ht(e)),{pointerEvents:"none",position:"relative",top:100,width:"auto",maxWidth:`calc(100vw - ${H(e.calc(e.margin).mul(2).equal())})`,margin:"0 auto",paddingBottom:e.paddingLG,[`${t}-title`]:{margin:0,color:e.titleColor,fontWeight:e.fontWeightStrong,fontSize:e.titleFontSize,lineHeight:e.titleLineHeight,wordWrap:"break-word"},[`${t}-content`]:{position:"relative",backgroundColor:e.contentBg,backgroundClip:"padding-box",border:0,borderRadius:e.borderRadiusLG,boxShadow:e.boxShadow,pointerEvents:"auto",padding:e.contentPadding},[`${t}-close`]:Object.assign({position:"absolute",top:e.calc(e.modalHeaderHeight).sub(e.modalCloseBtnSize).div(2).equal(),insetInlineEnd:e.calc(e.modalHeaderHeight).sub(e.modalCloseBtnSize).div(2).equal(),zIndex:e.calc(e.zIndexPopupBase).add(10).equal(),padding:0,color:e.modalCloseIconColor,fontWeight:e.fontWeightStrong,lineHeight:1,textDecoration:"none",background:"transparent",borderRadius:e.borderRadiusSM,width:e.modalCloseBtnSize,height:e.modalCloseBtnSize,border:0,outline:0,cursor:"pointer",transition:`color ${e.motionDurationMid}, background-color ${e.motionDurationMid}`,"&-x":{display:"flex",fontSize:e.fontSizeLG,fontStyle:"normal",lineHeight:H(e.modalCloseBtnSize),justifyContent:"center",textTransform:"none",textRendering:"auto"},"&:disabled":{pointerEvents:"none"},"&:hover":{color:e.modalCloseIconHoverColor,backgroundColor:e.colorBgTextHover,textDecoration:"none"},"&:active":{backgroundColor:e.colorBgTextActive}},xn(e)),[`${t}-header`]:{color:e.colorText,background:e.headerBg,borderRadius:`${H(e.borderRadiusLG)} ${H(e.borderRadiusLG)} 0 0`,marginBottom:e.headerMarginBottom,padding:e.headerPadding,borderBottom:e.headerBorderBottom},[`${t}-body`]:{fontSize:e.fontSize,lineHeight:e.lineHeight,wordWrap:"break-word",padding:e.bodyPadding,[`${t}-body-skeleton`]:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",margin:`${H(e.margin)} auto`}},[`${t}-footer`]:{textAlign:"end",background:e.footerBg,marginTop:e.footerMarginTop,padding:e.footerPadding,borderTop:e.footerBorderTop,borderRadius:e.footerBorderRadius,[`> ${e.antCls}-btn + ${e.antCls}-btn`]:{marginInlineStart:e.marginXS}},[`${t}-open`]:{overflow:"hidden"}})},{[`${t}-pure-panel`]:{top:"auto",padding:0,display:"flex",flexDirection:"column",[`${t}-content,
|
|
18
|
+
`]:Object.assign({},bo(e))}}},Oo=e=>{const{colorFillContent:t,colorFill:o}=e,n=t,a=o;return{color:n,colorGradientEnd:a,gradientFromColor:n,gradientToColor:a,titleHeight:e.controlHeight/2,blockRadius:e.borderRadiusSM,paragraphMarginTop:e.marginLG+e.marginXXS,paragraphLiHeight:e.controlHeight/2}},pe=Ve("Skeleton",e=>{const{componentCls:t,calc:o}=e,n=Ge(e,{skeletonAvatarCls:`${t}-avatar`,skeletonTitleCls:`${t}-title`,skeletonParagraphCls:`${t}-paragraph`,skeletonButtonCls:`${t}-button`,skeletonInputCls:`${t}-input`,skeletonImageCls:`${t}-image`,imageSizeBase:o(e.controlHeight).mul(1.5).equal(),borderRadius:100,skeletonLoadingBackground:`linear-gradient(90deg, ${e.gradientFromColor} 25%, ${e.gradientToColor} 37%, ${e.gradientFromColor} 63%)`,skeletonLoadingMotionDuration:"1.4s"});return So(n)},Oo,{deprecatedTokens:[["color","gradientFromColor"],["colorGradientEnd","gradientToColor"]]}),Eo=e=>{const{prefixCls:t,className:o,rootClassName:n,active:a,shape:s="circle",size:d="default"}=e,{getPrefixCls:i}=r.useContext(ne),l=i("skeleton",t),[u,c,f]=pe(l),m=Ke(e,["prefixCls","className"]),g=I(l,`${l}-element`,{[`${l}-active`]:a},o,n,c,f);return u(r.createElement("div",{className:g},r.createElement(Me,Object.assign({prefixCls:`${l}-avatar`,shape:s,size:d},m))))},No=e=>{const{prefixCls:t,className:o,rootClassName:n,active:a,block:s=!1,size:d="default"}=e,{getPrefixCls:i}=r.useContext(ne),l=i("skeleton",t),[u,c,f]=pe(l),m=Ke(e,["prefixCls"]),g=I(l,`${l}-element`,{[`${l}-active`]:a,[`${l}-block`]:s},o,n,c,f);return u(r.createElement("div",{className:g},r.createElement(Me,Object.assign({prefixCls:`${l}-button`,size:d},m))))},Po="M365.714286 329.142857q0 45.714286-32.036571 77.677714t-77.677714 32.036571-77.677714-32.036571-32.036571-77.677714 32.036571-77.677714 77.677714-32.036571 77.677714 32.036571 32.036571 77.677714zM950.857143 548.571429l0 256-804.571429 0 0-109.714286 182.857143-182.857143 91.428571 91.428571 292.571429-292.571429zM1005.714286 146.285714l-914.285714 0q-7.460571 0-12.873143 5.412571t-5.412571 12.873143l0 694.857143q0 7.460571 5.412571 12.873143t12.873143 5.412571l914.285714 0q7.460571 0 12.873143-5.412571t5.412571-12.873143l0-694.857143q0-7.460571-5.412571-12.873143t-12.873143-5.412571zM1097.142857 164.571429l0 694.857143q0 37.741714-26.843429 64.585143t-64.585143 26.843429l-914.285714 0q-37.741714 0-64.585143-26.843429t-26.843429-64.585143l0-694.857143q0-37.741714 26.843429-64.585143t64.585143-26.843429l914.285714 0q37.741714 0 64.585143 26.843429t26.843429 64.585143z",wo=e=>{const{prefixCls:t,className:o,rootClassName:n,style:a,active:s}=e,{getPrefixCls:d}=r.useContext(ne),i=d("skeleton",t),[l,u,c]=pe(i),f=I(i,`${i}-element`,{[`${i}-active`]:s},o,n,u,c);return l(r.createElement("div",{className:f},r.createElement("div",{className:I(`${i}-image`,o),style:a},r.createElement("svg",{viewBox:"0 0 1098 1024",xmlns:"http://www.w3.org/2000/svg",className:`${i}-image-svg`},r.createElement("title",null,"Image placeholder"),r.createElement("path",{d:Po,className:`${i}-image-path`})))))},jo=e=>{const{prefixCls:t,className:o,rootClassName:n,active:a,block:s,size:d="default"}=e,{getPrefixCls:i}=r.useContext(ne),l=i("skeleton",t),[u,c,f]=pe(l),m=Ke(e,["prefixCls"]),g=I(l,`${l}-element`,{[`${l}-active`]:a,[`${l}-block`]:s},o,n,c,f);return u(r.createElement("div",{className:g},r.createElement(Me,Object.assign({prefixCls:`${l}-input`,size:d},m))))},Io=e=>{const{prefixCls:t,className:o,rootClassName:n,style:a,active:s,children:d}=e,{getPrefixCls:i}=r.useContext(ne),l=i("skeleton",t),[u,c,f]=pe(l),m=I(l,`${l}-element`,{[`${l}-active`]:s},c,o,n,f);return u(r.createElement("div",{className:m},r.createElement("div",{className:I(`${l}-image`,o),style:a},d)))},Ro=(e,t)=>{const{width:o,rows:n=2}=t;if(Array.isArray(o))return o[e];if(n-1===e)return o},Mo=e=>{const{prefixCls:t,className:o,style:n,rows:a=0}=e,s=Array.from({length:a}).map((d,i)=>r.createElement("li",{key:i,style:{width:Ro(i,e)}}));return r.createElement("ul",{className:I(t,o),style:n},s)},To=({prefixCls:e,className:t,width:o,style:n})=>r.createElement("h3",{className:I(e,t),style:Object.assign({width:o},n)});function Le(e){return e&&typeof e=="object"?e:{}}function ko(e,t){return e&&!t?{size:"large",shape:"square"}:{size:"large",shape:"circle"}}function Bo(e,t){return!e&&t?{width:"38%"}:e&&t?{width:"50%"}:{}}function Ho(e,t){const o={};return(!e||!t)&&(o.width="61%"),!e&&t?o.rows=3:o.rows=2,o}const be=e=>{const{prefixCls:t,loading:o,className:n,rootClassName:a,style:s,children:d,avatar:i=!1,title:l=!0,paragraph:u=!0,active:c,round:f}=e,{getPrefixCls:m,direction:g,className:C,style:p}=bn("skeleton"),v=m("skeleton",t),[x,b,y]=pe(v);if(o||!("loading"in e)){const S=!!i,E=!!l,h=!!u;let T;if(S){const O=Object.assign(Object.assign({prefixCls:`${v}-avatar`},ko(E,h)),Le(i));T=r.createElement("div",{className:`${v}-header`},r.createElement(Me,Object.assign({},O)))}let j;if(E||h){let O;if(E){const B=Object.assign(Object.assign({prefixCls:`${v}-title`},Bo(S,h)),Le(l));O=r.createElement(To,Object.assign({},B))}let P;if(h){const B=Object.assign(Object.assign({prefixCls:`${v}-paragraph`},Ho(S,E)),Le(u));P=r.createElement(Mo,Object.assign({},B))}j=r.createElement("div",{className:`${v}-content`},O,P)}const $=I(v,{[`${v}-with-avatar`]:S,[`${v}-active`]:c,[`${v}-rtl`]:g==="rtl",[`${v}-round`]:f},C,n,a,b,y);return x(r.createElement("div",{className:$,style:Object.assign(Object.assign({},p),s)},T,j))}return d??null};be.Button=No;be.Avatar=Eo;be.Input=jo;be.Image=wo;be.Node=Io;function ft(){}const zo=r.createContext({add:ft,remove:ft});function Fo(e){const t=r.useContext(zo),o=r.useRef(null);return yt(a=>{if(a){const s=e?a.querySelector(e):a;s&&(t.add(s),o.current=s)}else t.remove(o.current)})}const mt=()=>{const{cancelButtonProps:e,cancelTextLocale:t,onCancel:o}=fe(Ee);return N.createElement(Xe,Object.assign({onClick:o},e),t)},gt=()=>{const{confirmLoading:e,okButtonProps:t,okType:o,okTextLocale:n,onOk:a}=fe(Ee);return N.createElement(Xe,Object.assign({},Et(o),{loading:e,onClick:a},t),n)};function Dt(e,t){return N.createElement("span",{className:`${e}-close-x`},t||N.createElement(Ue,{className:`${e}-close-icon`}))}const Wt=e=>{const{okText:t,okType:o="primary",cancelText:n,confirmLoading:a,onOk:s,onCancel:d,okButtonProps:i,cancelButtonProps:l,footer:u}=e,[c]=Ye("Modal",Pt()),f=t||(c==null?void 0:c.okText),m=n||(c==null?void 0:c.cancelText),g=N.useMemo(()=>({confirmLoading:a,okButtonProps:i,cancelButtonProps:l,okTextLocale:f,cancelTextLocale:m,okType:o,onOk:s,onCancel:d}),[a,i,l,f,m,o,s,d]);let C;return typeof u=="function"||typeof u>"u"?(C=N.createElement(N.Fragment,null,N.createElement(mt,null),N.createElement(gt,null)),typeof u=="function"&&(C=u(C,{OkBtn:gt,CancelBtn:mt})),C=N.createElement(zt,{value:g},C)):C=u,N.createElement(yn,{disabled:!1},C)};function vt(e){return{position:e,inset:0}}const Ao=e=>{const{componentCls:t,antCls:o}=e;return[{[`${t}-root`]:{[`${t}${o}-zoom-enter, ${t}${o}-zoom-appear`]:{transform:"none",opacity:0,animationDuration:e.motionDurationSlow,userSelect:"none"},[`${t}${o}-zoom-leave ${t}-content`]:{pointerEvents:"none"},[`${t}-mask`]:Object.assign(Object.assign({},vt("fixed")),{zIndex:e.zIndexPopupBase,height:"100%",backgroundColor:e.colorBgMask,pointerEvents:"none",[`${t}-hidden`]:{display:"none"}}),[`${t}-wrap`]:Object.assign(Object.assign({},vt("fixed")),{zIndex:e.zIndexPopupBase,overflow:"auto",outline:0,WebkitOverflowScrolling:"touch"})}},{[`${t}-root`]:io(e)}]},Lo=e=>{const{componentCls:t}=e;return[{[`${t}-root`]:{[`${t}-wrap-rtl`]:{direction:"rtl"},[`${t}-centered`]:{textAlign:"center","&::before":{display:"inline-block",width:0,height:"100%",verticalAlign:"middle",content:'""'},[t]:{top:0,display:"inline-block",paddingBottom:0,textAlign:"start",verticalAlign:"middle"}},[`@media (max-width: ${e.screenSMMax}px)`]:{[t]:{maxWidth:"calc(100vw - 16px)",margin:`${H(e.marginXS)} auto`},[`${t}-centered`]:{[t]:{flex:1}}}}},{[t]:Object.assign(Object.assign({},ht(e)),{pointerEvents:"none",position:"relative",top:100,width:"auto",maxWidth:`calc(100vw - ${H(e.calc(e.margin).mul(2).equal())})`,margin:"0 auto",paddingBottom:e.paddingLG,[`${t}-title`]:{margin:0,color:e.titleColor,fontWeight:e.fontWeightStrong,fontSize:e.titleFontSize,lineHeight:e.titleLineHeight,wordWrap:"break-word"},[`${t}-content`]:{position:"relative",backgroundColor:e.contentBg,backgroundClip:"padding-box",border:0,borderRadius:e.borderRadiusLG,boxShadow:e.boxShadow,pointerEvents:"auto",padding:e.contentPadding},[`${t}-close`]:Object.assign({position:"absolute",top:e.calc(e.modalHeaderHeight).sub(e.modalCloseBtnSize).div(2).equal(),insetInlineEnd:e.calc(e.modalHeaderHeight).sub(e.modalCloseBtnSize).div(2).equal(),zIndex:e.calc(e.zIndexPopupBase).add(10).equal(),padding:0,color:e.modalCloseIconColor,fontWeight:e.fontWeightStrong,lineHeight:1,textDecoration:"none",background:"transparent",borderRadius:e.borderRadiusSM,width:e.modalCloseBtnSize,height:e.modalCloseBtnSize,border:0,outline:0,cursor:"pointer",transition:`color ${e.motionDurationMid}, background-color ${e.motionDurationMid}`,"&-x":{display:"flex",fontSize:e.fontSizeLG,fontStyle:"normal",lineHeight:H(e.modalCloseBtnSize),justifyContent:"center",textTransform:"none",textRendering:"auto"},"&:disabled":{pointerEvents:"none"},"&:hover":{color:e.modalCloseIconHoverColor,backgroundColor:e.colorBgTextHover,textDecoration:"none"},"&:active":{backgroundColor:e.colorBgTextActive}},xn(e)),[`${t}-header`]:{color:e.colorText,background:e.headerBg,borderRadius:`${H(e.borderRadiusLG)} ${H(e.borderRadiusLG)} 0 0`,marginBottom:e.headerMarginBottom,padding:e.headerPadding,borderBottom:e.headerBorderBottom},[`${t}-body`]:{fontSize:e.fontSize,lineHeight:e.lineHeight,wordWrap:"break-word",padding:e.bodyPadding,[`${t}-body-skeleton`]:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",margin:`${H(e.margin)} auto`}},[`${t}-footer`]:{textAlign:"end",background:e.footerBg,marginTop:e.footerMarginTop,padding:e.footerPadding,borderTop:e.footerBorderTop,borderRadius:e.footerBorderRadius,[`> ${e.antCls}-btn + ${e.antCls}-btn`]:{marginInlineStart:e.marginXS}},[`${t}-open`]:{overflow:"hidden"}})},{[`${t}-pure-panel`]:{top:"auto",padding:0,display:"flex",flexDirection:"column",[`${t}-content,
|
|
19
19
|
${t}-body,
|
|
20
20
|
${t}-confirm-body-wrapper`]:{display:"flex",flexDirection:"column",flex:"auto"},[`${t}-confirm-body`]:{marginBottom:"auto"}}}]},_o=e=>{const{componentCls:t}=e;return{[`${t}-root`]:{[`${t}-wrap-rtl`]:{direction:"rtl",[`${t}-confirm-body`]:{direction:"rtl"}}}}},Do=e=>{const{componentCls:t}=e,o=$n(e),n=Object.assign({},o);delete n.xs;const a=`--${t.replace(".","")}-`,s=Object.keys(n).map(d=>({[`@media (min-width: ${H(n[d])})`]:{width:`var(${a}${d}-width)`}}));return{[`${t}-root`]:{[t]:[].concat(U(Object.keys(o).map((d,i)=>{const l=Object.keys(o)[i-1];return l?{[`${a}${d}-width`]:`var(${a}${l}-width)`}:null})),[{width:`var(${a}xs-width)`}],U(s))}}},qt=e=>{const t=e.padding,o=e.fontSizeHeading5,n=e.lineHeightHeading5;return Ge(e,{modalHeaderHeight:e.calc(e.calc(n).mul(o).equal()).add(e.calc(t).mul(2).equal()).equal(),modalFooterBorderColorSplit:e.colorSplit,modalFooterBorderStyle:e.lineType,modalFooterBorderWidth:e.lineWidth,modalCloseIconColor:e.colorIcon,modalCloseIconHoverColor:e.colorIconHover,modalCloseBtnSize:e.controlHeight,modalConfirmIconSize:e.fontHeight,modalTitleHeight:e.calc(e.titleFontSize).mul(e.titleLineHeight).equal()})},Vt=e=>({footerBg:"transparent",headerBg:e.colorBgElevated,titleLineHeight:e.lineHeightHeading5,titleFontSize:e.fontSizeHeading5,contentBg:e.colorBgElevated,titleColor:e.colorTextHeading,contentPadding:e.wireframe?0:`${H(e.paddingMD)} ${H(e.paddingContentHorizontalLG)}`,headerPadding:e.wireframe?`${H(e.padding)} ${H(e.paddingLG)}`:0,headerBorderBottom:e.wireframe?`${H(e.lineWidth)} ${e.lineType} ${e.colorSplit}`:"none",headerMarginBottom:e.wireframe?0:e.marginXS,bodyPadding:e.wireframe?e.paddingLG:0,footerPadding:e.wireframe?`${H(e.paddingXS)} ${H(e.padding)}`:0,footerBorderTop:e.wireframe?`${H(e.lineWidth)} ${e.lineType} ${e.colorSplit}`:"none",footerBorderRadius:e.wireframe?`0 0 ${H(e.borderRadiusLG)} ${H(e.borderRadiusLG)}`:0,footerMarginTop:e.wireframe?0:e.marginSM,confirmBodyPadding:e.wireframe?`${H(e.padding*2)} ${H(e.padding*2)} ${H(e.paddingLG)}`:0,confirmIconMarginInlineEnd:e.wireframe?e.margin:e.marginSM,confirmBtnsMarginTop:e.wireframe?e.marginLG:e.marginSM}),Gt=Ve("Modal",e=>{const t=qt(e);return[Lo(t),_o(t),Ao(t),hn(t,"zoom"),Do(t)]},Vt,{unitless:{titleLineHeight:!0}});var Wo=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(o[n[a]]=e[n[a]]);return o};let We;const qo=e=>{We={x:e.pageX,y:e.pageY},setTimeout(()=>{We=null},100)};Co()&&document.documentElement.addEventListener("click",qo,!0);const Ut=e=>{const{prefixCls:t,className:o,rootClassName:n,open:a,wrapClassName:s,centered:d,getContainer:i,focusTriggerAfterClose:l=!0,style:u,visible:c,width:f=520,footer:m,classNames:g,styles:C,children:p,loading:v,confirmLoading:x,zIndex:b,mousePosition:y,onOk:S,onCancel:E,destroyOnHidden:h,destroyOnClose:T,panelRef:j=null,modalRender:$}=e,O=Wo(e,["prefixCls","className","rootClassName","open","wrapClassName","centered","getContainer","focusTriggerAfterClose","style","visible","width","footer","classNames","styles","children","loading","confirmLoading","zIndex","mousePosition","onOk","onCancel","destroyOnHidden","destroyOnClose","panelRef","modalRender"]),{getPopupContainer:P,getPrefixCls:B,direction:L,modal:w}=r.useContext(ne),_=G=>{x||E==null||E(G)},k=G=>{S==null||S(G)},R=B("modal",t),D=B(),Y=Re(R),[Z,Q,W]=Gt(R,Y),V=I(s,{[`${R}-centered`]:d??(w==null?void 0:w.centered),[`${R}-wrap-rtl`]:L==="rtl"}),q=m!==null&&!v?r.createElement(Wt,Object.assign({},e,{onOk:k,onCancel:_})):null,[M,A,le,ae]=Sn(et(e),et(w),{closable:!0,closeIcon:r.createElement(Ue,{className:`${R}-close-icon`}),closeIconRender:G=>Dt(R,G)}),J=$?G=>r.createElement("div",{className:`${R}-render`},$(G)):void 0,oe=`.${R}-${$?"render":"content"}`,ye=Fo(oe),ce=On(j,ye),[de,se]=En("Modal",b),[z,ee]=r.useMemo(()=>f&&typeof f=="object"?[void 0,f]:[f,void 0],[f]),he=r.useMemo(()=>{const G={};return ee&&Object.keys(ee).forEach(xe=>{const ue=ee[xe];ue!==void 0&&(G[`--${R}-${xe}-width`]=typeof ue=="number"?`${ue}px`:ue)}),G},[R,ee]);return Z(r.createElement(Nn,{form:!0,space:!0},r.createElement(Pn.Provider,{value:se},r.createElement(_t,Object.assign({width:z},O,{zIndex:de,getContainer:i===void 0?P:i,prefixCls:R,rootClassName:I(Q,n,W,Y),footer:q,visible:a??c,mousePosition:y??We,onClose:_,closable:M&&Object.assign({disabled:le,closeIcon:A},ae),closeIcon:A,focusTriggerAfterClose:l,transitionName:je(D,"zoom",e.transitionName),maskTransitionName:je(D,"fade",e.maskTransitionName),className:I(Q,o,w==null?void 0:w.className),style:Object.assign(Object.assign(Object.assign({},w==null?void 0:w.style),u),he),classNames:Object.assign(Object.assign(Object.assign({},w==null?void 0:w.classNames),g),{wrapper:I(V,g==null?void 0:g.wrapper)}),styles:Object.assign(Object.assign({},w==null?void 0:w.styles),C),panelRef:ce,destroyOnClose:h??T,modalRender:J}),v?r.createElement(be,{active:!0,title:!1,paragraph:{rows:4},className:`${R}-body-skeleton`}):p))))},Vo=e=>{const{componentCls:t,titleFontSize:o,titleLineHeight:n,modalConfirmIconSize:a,fontSize:s,lineHeight:d,modalTitleHeight:i,fontHeight:l,confirmBodyPadding:u}=e,c=`${t}-confirm`;return{[c]:{"&-rtl":{direction:"rtl"},[`${e.antCls}-modal-header`]:{display:"none"},[`${c}-body-wrapper`]:Object.assign({},jn()),[`&${t} ${t}-body`]:{padding:u},[`${c}-body`]:{display:"flex",flexWrap:"nowrap",alignItems:"start",[`> ${e.iconCls}`]:{flex:"none",fontSize:a,marginInlineEnd:e.confirmIconMarginInlineEnd,marginTop:e.calc(e.calc(l).sub(a).equal()).div(2).equal()},[`&-has-title > ${e.iconCls}`]:{marginTop:e.calc(e.calc(i).sub(a).equal()).div(2).equal()}},[`${c}-paragraph`]:{display:"flex",flexDirection:"column",flex:"auto",rowGap:e.marginXS,maxWidth:`calc(100% - ${H(e.marginSM)})`},[`${e.iconCls} + ${c}-paragraph`]:{maxWidth:`calc(100% - ${H(e.calc(e.modalConfirmIconSize).add(e.marginSM).equal())})`},[`${c}-title`]:{color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:o,lineHeight:n},[`${c}-content`]:{color:e.colorText,fontSize:s,lineHeight:d},[`${c}-btns`]:{textAlign:"end",marginTop:e.confirmBtnsMarginTop,[`${e.antCls}-btn + ${e.antCls}-btn`]:{marginBottom:0,marginInlineStart:e.marginXS}}},[`${c}-error ${c}-body > ${e.iconCls}`]:{color:e.colorError},[`${c}-warning ${c}-body > ${e.iconCls},
|
|
21
|
-
${c}-confirm ${c}-body > ${e.iconCls}`]:{color:e.colorWarning},[`${c}-info ${c}-body > ${e.iconCls}`]:{color:e.colorInfo},[`${c}-success ${c}-body > ${e.iconCls}`]:{color:e.colorSuccess}}},Go=wn(["Modal","confirm"],e=>{const t=qt(e);return Vo(t)},Vt,{order:-1e3});var Uo=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(o[n[a]]=e[n[a]]);return o};const Kt=e=>{const{prefixCls:t,icon:o,okText:n,cancelText:a,confirmPrefixCls:s,type:d,okCancel:i,footer:l,locale:u}=e,c=Uo(e,["prefixCls","icon","okText","cancelText","confirmPrefixCls","type","okCancel","footer","locale"]);let f=o;if(!o&&o!==null)switch(d){case"info":f=r.createElement(It,null);break;case"success":f=r.createElement(Ot,null);break;case"error":f=r.createElement(St,null);break;default:f=r.createElement($t,null)}const m=i??d==="confirm",g=e.autoFocusButton===null?!1:e.autoFocusButton||"ok",[C]=Ye("Modal"),p=u||C,v=n||(m?p==null?void 0:p.okText:p==null?void 0:p.justOkText),x=a||(p==null?void 0:p.cancelText),b=r.useMemo(()=>Object.assign({autoFocusButton:g,cancelTextLocale:x,okTextLocale:v,mergedOkCancel:m},c),[g,x,v,m,c]),y=r.createElement(r.Fragment,null,r.createElement(st,null),r.createElement(it,null)),S=e.title!==void 0&&e.title!==null,E=`${s}-body`;return r.createElement("div",{className:`${s}-body-wrapper`},r.createElement("div",{className:I(E,{[`${E}-has-title`]:S})},f,r.createElement("div",{className:`${s}-paragraph`},S&&r.createElement("span",{className:`${s}-title`},e.title),r.createElement("div",{className:`${s}-content`},e.content))),l===void 0||typeof l=="function"?r.createElement(zt,{value:b},r.createElement("div",{className:`${s}-btns`},typeof l=="function"?l(y,{OkBtn:it,CancelBtn:st}):y)):l,r.createElement(Go,{prefixCls:t}))},Ko=e=>{const{close:t,zIndex:o,maskStyle:n,direction:a,prefixCls:s,wrapClassName:d,rootPrefixCls:i,bodyStyle:l,closable:u=!1,onConfirm:c,styles:f,title:m}=e,g=`${s}-confirm`,C=e.width||416,p=e.style||{},v=e.mask===void 0?!0:e.mask,x=e.maskClosable===void 0?!1:e.maskClosable,b=I(g,`${g}-${e.type}`,{[`${g}-rtl`]:a==="rtl"},e.className),[,y]=In(),S=r.useMemo(()=>o!==void 0?o:y.zIndexPopupBase+xt,[o,y]);return r.createElement(Ut,Object.assign({},e,{className:b,wrapClassName:I({[`${g}-centered`]:!!e.centered},d),onCancel:()=>{t==null||t({triggerCancel:!0}),c==null||c(!1)},title:m,footer:null,transitionName:je(i||"","zoom",e.transitionName),maskTransitionName:je(i||"","fade",e.maskTransitionName),mask:v,maskClosable:x,style:p,styles:Object.assign({body:l,mask:n},f),width:C,zIndex:S,closable:u}),r.createElement(Kt,Object.assign({},e,{confirmPrefixCls:g})))},Xt=e=>{const{rootPrefixCls:t,iconPrefixCls:o,direction:n,theme:a}=e;return r.createElement(Ze,{prefixCls:t,iconPrefixCls:o,direction:n,theme:a},r.createElement(Ko,Object.assign({},e)))},ge=[];let Yt="";function Zt(){return Yt}const Xo=e=>{var t,o;const{prefixCls:n,getContainer:a,direction:s}=e,d=Pt(),i=fe(ne),l=Zt()||i.getPrefixCls(),u=n||`${l}-modal`;let c=a;return c===!1&&(c=void 0),N.createElement(Xt,Object.assign({},e,{rootPrefixCls:l,prefixCls:u,iconPrefixCls:i.iconPrefixCls,theme:i.theme,direction:s??i.direction,locale:(o=(t=i.locale)===null||t===void 0?void 0:t.Modal)!==null&&o!==void 0?o:d,getContainer:c}))};function Ne(e){const t=wt(),o=document.createDocumentFragment();let n=Object.assign(Object.assign({},e),{close:l,open:!0}),a,s;function d(...c){var f;if(c.some(C=>C==null?void 0:C.triggerCancel)){var g;(f=e.onCancel)===null||f===void 0||(g=f).call.apply(g,[e,()=>{}].concat(U(c.slice(1))))}for(let C=0;C<ge.length;C++)if(ge[C]===l){ge.splice(C,1);break}s()}const i=c=>{clearTimeout(a),a=setTimeout(()=>{const f=t.getPrefixCls(void 0,Zt()),m=t.getIconPrefixCls(),g=t.getTheme(),C=N.createElement(Xo,Object.assign({},c));s=jt()(N.createElement(Ze,{prefixCls:f,iconPrefixCls:m,theme:g},typeof t.holderRender=="function"?t.holderRender(C):C),o)})};function l(...c){n=Object.assign(Object.assign({},n),{open:!1,afterClose:()=>{typeof e.afterClose=="function"&&e.afterClose(),d.apply(this,c)}}),n.visible&&delete n.visible,i(n)}function u(c){typeof c=="function"?n=c(n):n=Object.assign(Object.assign({},n),c),i(n)}return i(n),ge.push(l),{destroy:l,update:u}}function Qt(e){return Object.assign(Object.assign({},e),{type:"warning"})}function Jt(e){return Object.assign(Object.assign({},e),{type:"info"})}function en(e){return Object.assign(Object.assign({},e),{type:"success"})}function tn(e){return Object.assign(Object.assign({},e),{type:"error"})}function nn(e){return Object.assign(Object.assign({},e),{type:"confirm"})}function Yo({rootPrefixCls:e}){Yt=e}var Zo=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(o[n[a]]=e[n[a]]);return o};const Qo=(e,t)=>{var o,{afterClose:n,config:a}=e,s=Zo(e,["afterClose","config"]);const[d,i]=r.useState(!0),[l,u]=r.useState(a),{direction:c,getPrefixCls:f}=r.useContext(ne),m=f("modal"),g=f(),C=()=>{var b;n(),(b=l.afterClose)===null||b===void 0||b.call(l)},p=(...b)=>{var y;if(i(!1),b.some(h=>h==null?void 0:h.triggerCancel)){var E;(y=l.onCancel)===null||y===void 0||(E=y).call.apply(E,[l,()=>{}].concat(U(b.slice(1))))}};r.useImperativeHandle(t,()=>({destroy:p,update:b=>{u(y=>{const S=typeof b=="function"?b(y):b;return Object.assign(Object.assign({},y),S)})}}));const v=(o=l.okCancel)!==null&&o!==void 0?o:l.type==="confirm",[x]=Ye("Modal",Rn.Modal);return r.createElement(Xt,Object.assign({prefixCls:m,rootPrefixCls:g},l,{close:p,open:d,afterClose:C,okText:l.okText||(v?x==null?void 0:x.okText:x==null?void 0:x.justOkText),direction:l.direction||c,cancelText:l.cancelText||(x==null?void 0:x.cancelText)},s))},Jo=r.forwardRef(Qo);let Ct=0;const ea=r.memo(r.forwardRef((e,t)=>{const[o,n]=Gn();return r.useImperativeHandle(t,()=>({patchElement:n}),[n]),r.createElement(r.Fragment,null,o)}));function ta(){const e=r.useRef(null),[t,o]=r.useState([]);r.useEffect(()=>{t.length&&(U(t).forEach(d=>{d()}),o([]))},[t]);const n=r.useCallback(s=>function(i){var l;Ct+=1;const u=r.createRef();let c;const f=new Promise(v=>{c=v});let m=!1,g;const C=r.createElement(Jo,{key:`modal-${Ct}`,config:s(i),ref:u,afterClose:()=>{g==null||g()},isSilent:()=>m,onConfirm:v=>{c(v)}});return g=(l=e.current)===null||l===void 0?void 0:l.patchElement(C),g&&ge.push(g),{destroy:()=>{function v(){var x;(x=u.current)===null||x===void 0||x.destroy()}u.current?v():o(x=>[].concat(U(x),[v]))},update:v=>{function x(){var b;(b=u.current)===null||b===void 0||b.update(v)}u.current?x():o(b=>[].concat(U(b),[x]))},then:v=>(m=!0,f.then(v))}},[]);return[r.useMemo(()=>({info:n(Jt),success:n(en),error:n(tn),warning:n(Qt),confirm:n(nn)}),[n]),r.createElement(ea,{key:"modal-holder",ref:e})]}const na=N.createContext({});let te=null,ve=e=>e(),Se=[],Oe={};function pt(){const{getContainer:e,duration:t,rtl:o,maxCount:n,top:a}=Oe,s=(e==null?void 0:e())||document.body;return{getContainer:()=>s,duration:t,rtl:o,maxCount:n,top:a}}const oa=N.forwardRef((e,t)=>{const{messageConfig:o,sync:n}=e,{getPrefixCls:a}=fe(ne),s=Oe.prefixCls||a("message"),d=fe(na),[i,l]=Bt(Object.assign(Object.assign(Object.assign({},o),{prefixCls:s}),d.message));return N.useImperativeHandle(t,()=>{const u=Object.assign({},i);return Object.keys(u).forEach(c=>{u[c]=(...f)=>(n(),i[c].apply(i,f))}),{instance:u,sync:n}}),l}),aa=N.forwardRef((e,t)=>{const[o,n]=N.useState(pt),a=()=>{n(pt)};N.useEffect(a,[]);const s=wt(),d=s.getRootPrefixCls(),i=s.getIconPrefixCls(),l=s.getTheme(),u=N.createElement(oa,{ref:t,sync:a,messageConfig:o});return N.createElement(Ze,{prefixCls:d,iconPrefixCls:i,theme:l},s.holderRender?s.holderRender(u):u)}),ke=()=>{if(!te){const e=document.createDocumentFragment(),t={fragment:e};te=t,ve(()=>{jt()(N.createElement(aa,{ref:n=>{const{instance:a,sync:s}=n||{};Promise.resolve().then(()=>{!t.instance&&a&&(t.instance=a,t.sync=s,ke())})}}),e)});return}te.instance&&(Se.forEach(e=>{const{type:t,skipped:o}=e;if(!o)switch(t){case"open":{ve(()=>{const n=te.instance.open(Object.assign(Object.assign({},Oe),e.config));n==null||n.then(e.resolve),e.setCloseFn(n)});break}case"destroy":ve(()=>{te==null||te.instance.destroy(e.key)});break;default:ve(()=>{var n;const a=(n=te.instance)[t].apply(n,U(e.args));a==null||a.then(e.resolve),e.setCloseFn(a)})}}),Se=[])};function ra(e){Oe=Object.assign(Object.assign({},Oe),e),ve(()=>{var t;(t=te==null?void 0:te.sync)===null||t===void 0||t.call(te)})}function la(e){const t=Qe(o=>{let n;const a={type:"open",config:e,resolve:o,setCloseFn:s=>{n=s}};return Se.push(a),()=>{n?ve(()=>{n()}):a.skipped=!0}});return ke(),t}function sa(e,t){const o=Qe(n=>{let a;const s={type:e,args:t,resolve:n,setCloseFn:d=>{a=d}};return Se.push(s),()=>{a?ve(()=>{a()}):s.skipped=!0}});return ke(),o}const ia=e=>{Se.push({type:"destroy",key:e}),ke()},ca=["success","info","warning","error","loading"],da={open:la,destroy:ia,config:ra,useMessage:ro,_InternalPanelDoNotUseOrYouWillBeFired:Zn},ua=da;ca.forEach(e=>{ua[e]=(...t)=>sa(e,t)});var fa=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(o[n[a]]=e[n[a]]);return o};const ma=e=>{const{prefixCls:t,className:o,closeIcon:n,closable:a,type:s,title:d,children:i,footer:l}=e,u=fa(e,["prefixCls","className","closeIcon","closable","type","title","children","footer"]),{getPrefixCls:c}=r.useContext(ne),f=c(),m=t||c("modal"),g=Re(f),[C,p,v]=Gt(m,g),x=`${m}-confirm`;let b={};return s?b={closable:a??!1,title:"",footer:"",children:r.createElement(Kt,Object.assign({},e,{prefixCls:m,confirmPrefixCls:x,rootPrefixCls:f,content:i}))}:b={closable:a??!0,title:d,footer:l!==null&&r.createElement(Wt,Object.assign({},e)),children:i},C(r.createElement(At,Object.assign({prefixCls:m,className:I(p,`${m}-pure-panel`,s&&x,s&&`${x}-${s}`,o,v,g)},u,{closeIcon:Dt(m,n),closable:a},b)))},ga=Mn(ma);function on(e){return Ne(Qt(e))}const re=Ut;re.useModal=ta;re.info=function(t){return Ne(Jt(t))};re.success=function(t){return Ne(en(t))};re.error=function(t){return Ne(tn(t))};re.warning=on;re.warn=on;re.confirm=function(t){return Ne(nn(t))};re.destroyAll=function(){for(;ge.length;){const t=ge.pop();t&&t()}};re.config=Yo;re._InternalPanelDoNotUseOrYouWillBeFired=ga;export{Ht as A,re as M,be as S,io as i,ua as s,Fo as u};
|
|
21
|
+
${c}-confirm ${c}-body > ${e.iconCls}`]:{color:e.colorWarning},[`${c}-info ${c}-body > ${e.iconCls}`]:{color:e.colorInfo},[`${c}-success ${c}-body > ${e.iconCls}`]:{color:e.colorSuccess}}},Go=wn(["Modal","confirm"],e=>{const t=qt(e);return Vo(t)},Vt,{order:-1e3});var Uo=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(o[n[a]]=e[n[a]]);return o};const Xt=e=>{const{prefixCls:t,icon:o,okText:n,cancelText:a,confirmPrefixCls:s,type:d,okCancel:i,footer:l,locale:u}=e,c=Uo(e,["prefixCls","icon","okText","cancelText","confirmPrefixCls","type","okCancel","footer","locale"]);let f=o;if(!o&&o!==null)switch(d){case"info":f=r.createElement(It,null);break;case"success":f=r.createElement(Ot,null);break;case"error":f=r.createElement(St,null);break;default:f=r.createElement($t,null)}const m=i??d==="confirm",g=e.autoFocusButton===null?!1:e.autoFocusButton||"ok",[C]=Ye("Modal"),p=u||C,v=n||(m?p==null?void 0:p.okText:p==null?void 0:p.justOkText),x=a||(p==null?void 0:p.cancelText),b=r.useMemo(()=>Object.assign({autoFocusButton:g,cancelTextLocale:x,okTextLocale:v,mergedOkCancel:m},c),[g,x,v,m,c]),y=r.createElement(r.Fragment,null,r.createElement(st,null),r.createElement(it,null)),S=e.title!==void 0&&e.title!==null,E=`${s}-body`;return r.createElement("div",{className:`${s}-body-wrapper`},r.createElement("div",{className:I(E,{[`${E}-has-title`]:S})},f,r.createElement("div",{className:`${s}-paragraph`},S&&r.createElement("span",{className:`${s}-title`},e.title),r.createElement("div",{className:`${s}-content`},e.content))),l===void 0||typeof l=="function"?r.createElement(zt,{value:b},r.createElement("div",{className:`${s}-btns`},typeof l=="function"?l(y,{OkBtn:it,CancelBtn:st}):y)):l,r.createElement(Go,{prefixCls:t}))},Xo=e=>{const{close:t,zIndex:o,maskStyle:n,direction:a,prefixCls:s,wrapClassName:d,rootPrefixCls:i,bodyStyle:l,closable:u=!1,onConfirm:c,styles:f,title:m}=e,g=`${s}-confirm`,C=e.width||416,p=e.style||{},v=e.mask===void 0?!0:e.mask,x=e.maskClosable===void 0?!1:e.maskClosable,b=I(g,`${g}-${e.type}`,{[`${g}-rtl`]:a==="rtl"},e.className),[,y]=In(),S=r.useMemo(()=>o!==void 0?o:y.zIndexPopupBase+xt,[o,y]);return r.createElement(Ut,Object.assign({},e,{className:b,wrapClassName:I({[`${g}-centered`]:!!e.centered},d),onCancel:()=>{t==null||t({triggerCancel:!0}),c==null||c(!1)},title:m,footer:null,transitionName:je(i||"","zoom",e.transitionName),maskTransitionName:je(i||"","fade",e.maskTransitionName),mask:v,maskClosable:x,style:p,styles:Object.assign({body:l,mask:n},f),width:C,zIndex:S,closable:u}),r.createElement(Xt,Object.assign({},e,{confirmPrefixCls:g})))},Kt=e=>{const{rootPrefixCls:t,iconPrefixCls:o,direction:n,theme:a}=e;return r.createElement(Ze,{prefixCls:t,iconPrefixCls:o,direction:n,theme:a},r.createElement(Xo,Object.assign({},e)))},ge=[];let Yt="";function Zt(){return Yt}const Ko=e=>{var t,o;const{prefixCls:n,getContainer:a,direction:s}=e,d=Pt(),i=fe(ne),l=Zt()||i.getPrefixCls(),u=n||`${l}-modal`;let c=a;return c===!1&&(c=void 0),N.createElement(Kt,Object.assign({},e,{rootPrefixCls:l,prefixCls:u,iconPrefixCls:i.iconPrefixCls,theme:i.theme,direction:s??i.direction,locale:(o=(t=i.locale)===null||t===void 0?void 0:t.Modal)!==null&&o!==void 0?o:d,getContainer:c}))};function Ne(e){const t=wt(),o=document.createDocumentFragment();let n=Object.assign(Object.assign({},e),{close:l,open:!0}),a,s;function d(...c){var f;if(c.some(C=>C==null?void 0:C.triggerCancel)){var g;(f=e.onCancel)===null||f===void 0||(g=f).call.apply(g,[e,()=>{}].concat(U(c.slice(1))))}for(let C=0;C<ge.length;C++)if(ge[C]===l){ge.splice(C,1);break}s()}const i=c=>{clearTimeout(a),a=setTimeout(()=>{const f=t.getPrefixCls(void 0,Zt()),m=t.getIconPrefixCls(),g=t.getTheme(),C=N.createElement(Ko,Object.assign({},c));s=jt()(N.createElement(Ze,{prefixCls:f,iconPrefixCls:m,theme:g},typeof t.holderRender=="function"?t.holderRender(C):C),o)})};function l(...c){n=Object.assign(Object.assign({},n),{open:!1,afterClose:()=>{typeof e.afterClose=="function"&&e.afterClose(),d.apply(this,c)}}),n.visible&&delete n.visible,i(n)}function u(c){typeof c=="function"?n=c(n):n=Object.assign(Object.assign({},n),c),i(n)}return i(n),ge.push(l),{destroy:l,update:u}}function Qt(e){return Object.assign(Object.assign({},e),{type:"warning"})}function Jt(e){return Object.assign(Object.assign({},e),{type:"info"})}function en(e){return Object.assign(Object.assign({},e),{type:"success"})}function tn(e){return Object.assign(Object.assign({},e),{type:"error"})}function nn(e){return Object.assign(Object.assign({},e),{type:"confirm"})}function Yo({rootPrefixCls:e}){Yt=e}var Zo=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(o[n[a]]=e[n[a]]);return o};const Qo=(e,t)=>{var o,{afterClose:n,config:a}=e,s=Zo(e,["afterClose","config"]);const[d,i]=r.useState(!0),[l,u]=r.useState(a),{direction:c,getPrefixCls:f}=r.useContext(ne),m=f("modal"),g=f(),C=()=>{var b;n(),(b=l.afterClose)===null||b===void 0||b.call(l)},p=(...b)=>{var y;if(i(!1),b.some(h=>h==null?void 0:h.triggerCancel)){var E;(y=l.onCancel)===null||y===void 0||(E=y).call.apply(E,[l,()=>{}].concat(U(b.slice(1))))}};r.useImperativeHandle(t,()=>({destroy:p,update:b=>{u(y=>{const S=typeof b=="function"?b(y):b;return Object.assign(Object.assign({},y),S)})}}));const v=(o=l.okCancel)!==null&&o!==void 0?o:l.type==="confirm",[x]=Ye("Modal",Rn.Modal);return r.createElement(Kt,Object.assign({prefixCls:m,rootPrefixCls:g},l,{close:p,open:d,afterClose:C,okText:l.okText||(v?x==null?void 0:x.okText:x==null?void 0:x.justOkText),direction:l.direction||c,cancelText:l.cancelText||(x==null?void 0:x.cancelText)},s))},Jo=r.forwardRef(Qo);let Ct=0;const ea=r.memo(r.forwardRef((e,t)=>{const[o,n]=Gn();return r.useImperativeHandle(t,()=>({patchElement:n}),[n]),r.createElement(r.Fragment,null,o)}));function ta(){const e=r.useRef(null),[t,o]=r.useState([]);r.useEffect(()=>{t.length&&(U(t).forEach(d=>{d()}),o([]))},[t]);const n=r.useCallback(s=>function(i){var l;Ct+=1;const u=r.createRef();let c;const f=new Promise(v=>{c=v});let m=!1,g;const C=r.createElement(Jo,{key:`modal-${Ct}`,config:s(i),ref:u,afterClose:()=>{g==null||g()},isSilent:()=>m,onConfirm:v=>{c(v)}});return g=(l=e.current)===null||l===void 0?void 0:l.patchElement(C),g&&ge.push(g),{destroy:()=>{function v(){var x;(x=u.current)===null||x===void 0||x.destroy()}u.current?v():o(x=>[].concat(U(x),[v]))},update:v=>{function x(){var b;(b=u.current)===null||b===void 0||b.update(v)}u.current?x():o(b=>[].concat(U(b),[x]))},then:v=>(m=!0,f.then(v))}},[]);return[r.useMemo(()=>({info:n(Jt),success:n(en),error:n(tn),warning:n(Qt),confirm:n(nn)}),[n]),r.createElement(ea,{key:"modal-holder",ref:e})]}const na=N.createContext({});let te=null,ve=e=>e(),Se=[],Oe={};function pt(){const{getContainer:e,duration:t,rtl:o,maxCount:n,top:a}=Oe,s=(e==null?void 0:e())||document.body;return{getContainer:()=>s,duration:t,rtl:o,maxCount:n,top:a}}const oa=N.forwardRef((e,t)=>{const{messageConfig:o,sync:n}=e,{getPrefixCls:a}=fe(ne),s=Oe.prefixCls||a("message"),d=fe(na),[i,l]=Bt(Object.assign(Object.assign(Object.assign({},o),{prefixCls:s}),d.message));return N.useImperativeHandle(t,()=>{const u=Object.assign({},i);return Object.keys(u).forEach(c=>{u[c]=(...f)=>(n(),i[c].apply(i,f))}),{instance:u,sync:n}}),l}),aa=N.forwardRef((e,t)=>{const[o,n]=N.useState(pt),a=()=>{n(pt)};N.useEffect(a,[]);const s=wt(),d=s.getRootPrefixCls(),i=s.getIconPrefixCls(),l=s.getTheme(),u=N.createElement(oa,{ref:t,sync:a,messageConfig:o});return N.createElement(Ze,{prefixCls:d,iconPrefixCls:i,theme:l},s.holderRender?s.holderRender(u):u)}),ke=()=>{if(!te){const e=document.createDocumentFragment(),t={fragment:e};te=t,ve(()=>{jt()(N.createElement(aa,{ref:n=>{const{instance:a,sync:s}=n||{};Promise.resolve().then(()=>{!t.instance&&a&&(t.instance=a,t.sync=s,ke())})}}),e)});return}te.instance&&(Se.forEach(e=>{const{type:t,skipped:o}=e;if(!o)switch(t){case"open":{ve(()=>{const n=te.instance.open(Object.assign(Object.assign({},Oe),e.config));n==null||n.then(e.resolve),e.setCloseFn(n)});break}case"destroy":ve(()=>{te==null||te.instance.destroy(e.key)});break;default:ve(()=>{var n;const a=(n=te.instance)[t].apply(n,U(e.args));a==null||a.then(e.resolve),e.setCloseFn(a)})}}),Se=[])};function ra(e){Oe=Object.assign(Object.assign({},Oe),e),ve(()=>{var t;(t=te==null?void 0:te.sync)===null||t===void 0||t.call(te)})}function la(e){const t=Qe(o=>{let n;const a={type:"open",config:e,resolve:o,setCloseFn:s=>{n=s}};return Se.push(a),()=>{n?ve(()=>{n()}):a.skipped=!0}});return ke(),t}function sa(e,t){const o=Qe(n=>{let a;const s={type:e,args:t,resolve:n,setCloseFn:d=>{a=d}};return Se.push(s),()=>{a?ve(()=>{a()}):s.skipped=!0}});return ke(),o}const ia=e=>{Se.push({type:"destroy",key:e}),ke()},ca=["success","info","warning","error","loading"],da={open:la,destroy:ia,config:ra,useMessage:ro,_InternalPanelDoNotUseOrYouWillBeFired:Zn},ua=da;ca.forEach(e=>{ua[e]=(...t)=>sa(e,t)});var fa=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(o[n[a]]=e[n[a]]);return o};const ma=e=>{const{prefixCls:t,className:o,closeIcon:n,closable:a,type:s,title:d,children:i,footer:l}=e,u=fa(e,["prefixCls","className","closeIcon","closable","type","title","children","footer"]),{getPrefixCls:c}=r.useContext(ne),f=c(),m=t||c("modal"),g=Re(f),[C,p,v]=Gt(m,g),x=`${m}-confirm`;let b={};return s?b={closable:a??!1,title:"",footer:"",children:r.createElement(Xt,Object.assign({},e,{prefixCls:m,confirmPrefixCls:x,rootPrefixCls:f,content:i}))}:b={closable:a??!0,title:d,footer:l!==null&&r.createElement(Wt,Object.assign({},e)),children:i},C(r.createElement(At,Object.assign({prefixCls:m,className:I(p,`${m}-pure-panel`,s&&x,s&&`${x}-${s}`,o,v,g)},u,{closeIcon:Dt(m,n),closable:a},b)))},ga=Mn(ma);function on(e){return Ne(Qt(e))}const re=Ut;re.useModal=ta;re.info=function(t){return Ne(Jt(t))};re.success=function(t){return Ne(en(t))};re.error=function(t){return Ne(tn(t))};re.warning=on;re.warn=on;re.confirm=function(t){return Ne(nn(t))};re.destroyAll=function(){for(;ge.length;){const t=ge.pop();t&&t()}};re.config=Yo;re._InternalPanelDoNotUseOrYouWillBeFired=ga;export{Ht as A,re as M,be as S,io as i,ua as s,Fo as u};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a as e}from"./index-BbHMAb8g.js";/**
|
|
2
2
|
* @license lucide-react v0.456.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const
|
|
6
|
+
*/const a=e("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);export{a as X};
|
package/assistantConfig.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"react/jsx-runtime";import"react";import{C as l}from"./assets/index-
|
|
1
|
+
import"react/jsx-runtime";import"react";import{C as l}from"./assets/index-CCjG4bD0.js";import"./assets/style-CNIDlcUL.js";import"./assets/index-BbHMAb8g.js";import"./assets/x-BjRa5XLp.js";import"./assets/plus-Dmpl3gd8.js";import"./assets/index-Wjs4Vb6x.js";import"react-dom";export{l as default};
|
package/chat.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as Z,jsxs as et,Fragment as hp}from"react/jsx-runtime";import*as C from"react";import ke,{useRef as tt,useEffect as vt,Component as AC,forwardRef as Ai,createElement as Jl,createContext as fs,version as $H,useMemo as Vt,useContext as or,useState as at,Children as aI,useCallback as o3,useImperativeHandle as Sc,useLayoutEffect as sI,cloneElement as lI,isValidElement as cI,PureComponent as AH}from"react";import{
|
|
1
|
+
import{jsx as Z,jsxs as et,Fragment as hp}from"react/jsx-runtime";import*as C from"react";import ke,{useRef as tt,useEffect as vt,Component as AC,forwardRef as Ai,createElement as Jl,createContext as fs,version as $H,useMemo as Vt,useContext as or,useState as at,Children as aI,useCallback as o3,useImperativeHandle as Sc,useLayoutEffect as sI,cloneElement as lI,isValidElement as cI,PureComponent as AH}from"react";import{a as Ji,g as OC,au as uI,l as $c,an as dI,aN as fI,B as So,aB as OH,f as sr,u as hI,a5 as pI,aF as NC,H as NH,aE as MH,ad as ql,J as r2,y as gI,A as Yi,bT as o2,T as MC,m as mI,r as vI,k as xo,K as i2,b5 as DH,av as TH,ay as PH,aw as IH,bU as FH,ac as xd,G as RH,bV as La,bW as eo,_ as Fi,bz as yI,bA as bI,aW as xI,L as Er,bN as Lr,aV as EI,E as BH,aJ as wI,bh as CI,bX as i3,bC as _H,bY as jH,p as kI,bu as LH,bE as zH,ap as HH,o as a3,at as s3,aZ as WH,bZ as VH,aP as SI,b as Ur,I as Wu,i as DC,F as Ra,aK as pp,b_ as $I,bR as GH,h as qH,b$ as sm}from"./assets/index-BbHMAb8g.js";import{I as ar,d as l3,C as AI,T as UH,e as YH}from"./assets/index-fhKUis2J.js";import*as XH from"react-dom";import c3,{flushSync as Vu,createPortal as OI,unstable_batchedUpdates as KH}from"react-dom";import{D as ZH,T as QH,F as JH,q as u3}from"./assets/index-BbpyNfEd.js";import{u as pa}from"./assets/index-CpW6Dhpp.js";/* empty css */import{A as eW,i as tW,s as rr,M as gp,S as Xd}from"./assets/style-CNIDlcUL.js";import{P as NI}from"./assets/plus-Dmpl3gd8.js";import{S as a2}from"./assets/index-CCjG4bD0.js";import{X as mp}from"./assets/x-BjRa5XLp.js";import{g as d3,P as nW,a as MI}from"./assets/index-BH8au9G9.js";import{C as rW,G as DI,c as oW,r as iW}from"./assets/GientechStreamReader-BafFiNMI.js";import{B as oCe}from"./assets/GientechStreamReader-BafFiNMI.js";import{P as aW}from"./assets/index-CPOAXITM.js";import"./database.js";import"./databaseTable.js";import"./modelManage.js";import"./sensitive.js";import{D as sW}from"./assets/index-DnJqVq9Q.js";import"./assets/index-Wjs4Vb6x.js";import"./assets/index-CuySCBtZ.js";import"./assets/index-Dkwp9YpO.js";/**
|
|
2
2
|
* @license lucide-react v0.456.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
package/database.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as Z,jsx as l,Fragment as de}from"react/jsx-runtime";import{useState as y,useMemo as T,useRef as q,useEffect as De}from"react";import{J as Q,i as me,m as ge}from"./assets/index-DhczpnL_.js";import{a as be,T as ye,d as Ee}from"./assets/index-OjluyvX1.js";import{E as K}from"./assets/index-D4NnOWbo.js";import{M as $,s as H}from"./assets/style-bUXwVVWZ.js";/* empty css */import"react-dom";const Fe=({url:m,token:z,role:B,eventsEmit:F})=>{const c=be.create({baseURL:m,timeout:1e6});return c.interceptors.request.use(e=>{let t=z;return!t&&!["user/login","user/kaptcha","user/regist"].some(u=>e.url.includes(u))?(F&&F("request:error_auth",{errorMsg:"\u672A\u767B\u5F55\u6216token\u5DF2\u8FC7\u671F",redirect:"/login"}),Promise.reject(new Error("\u672A\u767B\u5F55\u6216token\u5DF2\u8FC7\u671F"))):(e.headers.Authorization=t||"",e.headers.userName=B==="\u672A\u767B\u5F55\u7528\u6237"?"":B,e)}),c.interceptors.response.use(e=>{const t=["user/kaptcha"],r=e.data;if(t.some(p=>e.config.url&&e.config.url.includes(p))||r.size&&r.type)return r;const{success:u,errorMsg:g,errorCode:D}=r;return u?r:(F&&F("request:error_business",{errorCode:D,errorMsg:g||"\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",response:r}),!1)},async e=>{var t,r,u,g,D,p,A,h,N;if(e.message==="canceled")return Promise.reject(e);if(F){let d="request:error_network",v={errorMsg:"\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25",error:e};((t=e==null?void 0:e.response)==null?void 0:t.status)===401?(d="request:error_auth",v={errorMsg:"\u6CA1\u6709\u8DB3\u591F\u6743\u9650",error:e,redirect:"/login"}):(((u=(r=e==null?void 0:e.response)==null?void 0:r.data)==null?void 0:u.errorCode)==="30013"||((D=(g=e==null?void 0:e.response)==null?void 0:g.data)==null?void 0:D.errorCode)==="30023")&&(d="request:error_business",v={errorCode:(A=(p=e==null?void 0:e.response)==null?void 0:p.data)==null?void 0:A.errorCode,errorMsg:((N=(h=e==null?void 0:e.response)==null?void 0:h.data)==null?void 0:N.errorMsg)||"\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",error:e}),F(d,v)}return console.log("Error occurs",e),Promise.reject(e)}),{getDatabaseList:async e=>{try{const t=await c.get(`/queryPageDBList?${new URLSearchParams(e).toString()}`),{success:r,data:u}=t;if(r)return u}catch(t){console.log("getDatabaseList error:",t)}},getShareDatabaseList:async e=>{try{const t=await c.get(`/queryShareDBList?${new URLSearchParams(e).toString()}`),{success:r,data:u}=t;if(r)return u}catch(t){console.log("getShareDatabaseList error:",t)}},delDatabaseById:async(e,t)=>{const r=O(t);try{const u=await c.delete(`/${r}/deleteDB/${e}`),{success:g,data:D}=u;if(g)return D}catch(u){console.log("delDatabaseById error:",u)}},saveDatabase:async(e,t)=>{const r=O(t);try{const u=await c.post(`/${r}/saveDBInfo`,e),{success:g,data:D}=u;if(g)return D}catch(u){console.log("saveDatabase error:",u)}},testConnection:async e=>{try{const t=await c.post("/directDB/testConnect",e),{success:r,data:u}=t;if(r)return u}catch(t){console.log("testConnection error:",t)}},syncSchema:async e=>{try{const t=await c.get(`/directDB/syncSchema/${e}`),{success:r,data:u}=t;if(r)return u}catch(t){console.log("syncSchema error:",t)}}}},O=m=>m=="DataTable"?"dataTable":"directDB",pe="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzYiIGhlaWdodD0iMzYiIHZpZXdCb3g9IjAgMCAzNiAzNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTE0IDEyQzE0IDEwLjg5NTQgMTQuODk1NCAxMCAxNiAxMEgyOUMzMS4yMDkxIDEwIDMzIDExLjc5MDkgMzMgMTRWMjZDMzMgMzAuNDE4MyAyOS40MTgzIDM0IDI1IDM0SDE2QzE0Ljg5NTQgMzQgMTQgMzMuMTA0NiAxNCAzMlYxMloiIGZpbGw9InVybCgjcGFpbnQwX2xpbmVhcl80NDcyXzE4MDUyKSIvPgo8Zm9yZWlnbk9iamVjdCB4PSItMSIgeT0iLTEiIHdpZHRoPSIzMiIgaGVpZ2h0PSIzNiI+PGRpdiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94aHRtbCIgc3R5bGU9ImJhY2tkcm9wLWZpbHRlcjpibHVyKDJweCk7Y2xpcC1wYXRoOnVybCgjYmdibHVyXzBfNDQ3Ml8xODA1Ml9jbGlwX3BhdGgpO2hlaWdodDoxMDAlO3dpZHRoOjEwMCUiPjwvZGl2PjwvZm9yZWlnbk9iamVjdD48ZyBkYXRhLWZpZ21hLWJnLWJsdXItcmFkaXVzPSI0Ij4KPHBhdGggZD0iTTMgN0MzIDQuNzkwODYgNC43OTA4NiAzIDcgM0gyM0MyNS4yMDkxIDMgMjcgNC43OTA4NiAyNyA3VjE5QzI3IDI1LjYyNzQgMjEuNjI3NCAzMSAxNSAzMUg3QzQuNzkwODYgMzEgMyAyOS4yMDkxIDMgMjdWN1oiIGZpbGw9IndoaXRlIiBmaWxsLW9wYWNpdHk9IjAuNDYiLz4KPHBhdGggZD0iTTcgMy4yNUgyM0MyNS4wNzExIDMuMjUgMjYuNzUgNC45Mjg5MyAyNi43NSA3VjE5QzI2Ljc1IDI1LjQ4OTMgMjEuNDg5MyAzMC43NSAxNSAzMC43NUg3QzQuOTI4OTMgMzAuNzUgMy4yNSAyOS4wNzExIDMuMjUgMjdWN0MzLjI1IDQuOTI4OTMgNC45Mjg5MyAzLjI1IDcgMy4yNVoiIHN0cm9rZT0id2hpdGUiIHN0cm9rZS1vcGFjaXR5PSIwLjM0IiBzdHJva2Utd2lkdGg9IjAuNSIvPgo8L2c+CjxnIGZpbHRlcj0idXJsKCNmaWx0ZXIxX2RfNDQ3Ml8xODA1MikiPgo8cGF0aCBkPSJNMTQgMTlWMTEuNjY2NyIgc3Ryb2tlPSJ3aGl0ZSIgc3Ryb2tlLXdpZHRoPSIxLjgzOTcyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPHBhdGggZD0iTTExIDE0TDEyIDEzTDE0IDExTDE2IDEzTDE3IDE0IiBzdHJva2U9IndoaXRlIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8cGF0aCBkPSJNMTAgMjJIMTgiIHN0cm9rZT0id2hpdGUiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIi8+CjwvZz4KPGRlZnM+CjxjbGlwUGF0aCBpZD0iYmdibHVyXzBfNDQ3Ml8xODA1Ml9jbGlwX3BhdGgiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEgMSkiPjxwYXRoIGQ9Ik0zIDdDMyA0Ljc5MDg2IDQuNzkwODYgMyA3IDNIMjNDMjUuMjA5MSAzIDI3IDQuNzkwODYgMjcgN1YxOUMyNyAyNS42Mjc0IDIxLjYyNzQgMzEgMTUgMzFIN0M0Ljc5MDg2IDMxIDMgMjkuMjA5MSAzIDI3VjdaIi8+CjwvY2xpcFBhdGg+PGZpbHRlciBpZD0iZmlsdGVyMV9kXzQ0NzJfMTgwNTIiIHg9IjUiIHk9IjYiIHdpZHRoPSIxOCIgaGVpZ2h0PSIyMSIgZmlsdGVyVW5pdHM9InVzZXJTcGFjZU9uVXNlIiBjb2xvci1pbnRlcnBvbGF0aW9uLWZpbHRlcnM9InNSR0IiPgo8ZmVGbG9vZCBmbG9vZC1vcGFjaXR5PSIwIiByZXN1bHQ9IkJhY2tncm91bmRJbWFnZUZpeCIvPgo8ZmVDb2xvck1hdHJpeCBpbj0iU291cmNlQWxwaGEiIHR5cGU9Im1hdHJpeCIgdmFsdWVzPSIwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAxMjcgMCIgcmVzdWx0PSJoYXJkQWxwaGEiLz4KPGZlT2Zmc2V0Lz4KPGZlR2F1c3NpYW5CbHVyIHN0ZERldmlhdGlvbj0iMiIvPgo8ZmVDb21wb3NpdGUgaW4yPSJoYXJkQWxwaGEiIG9wZXJhdG9yPSJvdXQiLz4KPGZlQ29sb3JNYXRyaXggdHlwZT0ibWF0cml4IiB2YWx1ZXM9IjAgMCAwIDAgMCAwIDAgMCAwIDAuMzk2MDc4IDAgMCAwIDAgMC45ODQzMTQgMCAwIDAgMC40IDAiLz4KPGZlQmxlbmQgbW9kZT0ibm9ybWFsIiBpbjI9IkJhY2tncm91bmRJbWFnZUZpeCIgcmVzdWx0PSJlZmZlY3QxX2Ryb3BTaGFkb3dfNDQ3Ml8xODA1MiIvPgo8ZmVCbGVuZCBtb2RlPSJub3JtYWwiIGluPSJTb3VyY2VHcmFwaGljIiBpbjI9ImVmZmVjdDFfZHJvcFNoYWRvd180NDcyXzE4MDUyIiByZXN1bHQ9InNoYXBlIi8+CjwvZmlsdGVyPgo8bGluZWFyR3JhZGllbnQgaWQ9InBhaW50MF9saW5lYXJfNDQ3Ml8xODA1MiIgeDE9IjIzLjUiIHkxPSIxMCIgeDI9IjIzLjUiIHkyPSIzNCIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPgo8c3RvcCBzdG9wLWNvbG9yPSIjNjRBMEZEIi8+CjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iIzAxNUFGRiIvPgo8L2xpbmVhckdyYWRpZW50Pgo8L2RlZnM+Cjwvc3ZnPgo=",Ie=""+new URL("assets/database_connect.svg",import.meta.url).href,Me=""+new URL("assets/MySQL.svg",import.meta.url).href,fe=""+new URL("assets/SQLServer.png",import.meta.url).href,Ce=""+new URL("assets/PostgreSQL.png",import.meta.url).href,Ae=""+new URL("assets/Doris.png",import.meta.url).href,he=[{label:"MySQL",value:"MySQL",icon:Me},{label:"PostgreSQL",value:"PostgreSQL",icon:Ce},{label:"SQLServer",value:"SQLServer",icon:fe},{label:"Doris",value:"Doris",icon:Ae}],Be=({drawerTitle:m,drawerVisible:z,isConnectSuccess:B,handleDrawerClose:F,dbInfo:c,dbType:n,eventsEmit:M})=>{const[G,W]=y(!1),[R,w]=y(!1),[e,t]=y({}),[r,u]=y(!1),g=T(()=>({id:n,layout:"vertical",formWidth:"500px",fields:[{id:"name",name:"name",label:"\u6570\u636E\u5E93\u540D\u79F0",type:"input",required:!0,placeholder:"\u4EC5\u652F\u6301\u6C49\u5B57\u3001\u6570\u5B57\u3001\u82F1\u6587\u3001\u7B26\u53F7",validate:a=>{if(!a)return"\u6570\u636E\u5E93\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A";if(!/[\u4E00-\u9FA5A-Za-z0-9\W]/.test(a))return"\u4EC5\u652F\u6301\u6C49\u5B57\u3001\u6570\u5B57\u3001\u82F1\u6587\u3001\u7B26\u53F7"},counter:100},{id:"description",name:"description",label:"\u6570\u636E\u5E93\u63CF\u8FF0",type:"textarea",counter:150,required:!1,placeholder:"\u8BF7\u8F93\u5165\u6570\u636E\u5E93\u63CF\u8FF0,\u6B64\u63CF\u8FF0\u4EC5\u7528\u4E8E\u533A\u5206\u4E0D\u540C\u6570\u636E\u5E93,\u4E0D\u4F1A\u5F71\u54CD\u6570\u636E\u5E93\u8C03\u7528",defaultValue:""}]}),[n,c]),D=T(()=>({id:n,layout:"vertical",formWidth:"470px",fields:[{id:"name",name:"name",label:"\u6570\u636E\u5E93\u540D\u79F0",type:"input",required:!0,placeholder:"\u4EC5\u652F\u6301\u6C49\u5B57\u3001\u6570\u5B57\u3001\u82F1\u6587\u3001\u7B26\u53F7",validate:a=>{if(!a)return"\u6570\u636E\u5E93\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A";if(!/[\u4E00-\u9FA5A-Za-z0-9\W]/.test(a))return"\u4EC5\u652F\u6301\u6C49\u5B57\u3001\u6570\u5B57\u3001\u82F1\u6587\u3001\u7B26\u53F7"},counter:100},{id:"description",name:"description",label:"\u6570\u636E\u5E93\u63CF\u8FF0",type:"textarea",required:!1,counter:150,placeholder:"\u8BF7\u8F93\u5165\u6570\u636E\u5E93\u63CF\u8FF0,\u6B64\u63CF\u8FF0\u4EC5\u7528\u4E8E\u533A\u5206\u4E0D\u540C\u6570\u636E\u5E93,\u4E0D\u4F1A\u5F71\u54CD\u6570\u636E\u5E93\u8C03\u7528",defaultValue:""},{id:"db-info",label:"\u76F4\u8FDE\u6570\u636E\u6E90\u4FE1\u606F",type:"title",level:2},{id:"dbType",name:"dbType",label:"\u6570\u636E\u6E90\u7C7B\u578B",type:"select",disabled:!!c,required:!0,options:he.map(a=>{const{label:i,value:I,icon:x}=a;return{label:i,value:I,render:()=>Z("div",{className:"flex items-center gap-2",children:[l("img",{src:x,width:24}),l("span",{children:i})]})}})},{id:"dbHost",name:"dbHost",label:"\u4E3B\u673A\u5730\u5740",type:"input",required:!0,disabled:!!c,placeholder:"\u8BF7\u8F93\u5165IP\u5730\u5740\u6216\u8005\u57DF\u540D"},{id:"dbPort",name:"dbPort",label:"\u7AEF\u53E3\u53F7",type:"number",required:!0,disabled:!!c,placeholder:"\u8BF7\u8F93\u5165\u7AEF\u53E3\u540D\u79F0"},{id:"dbDatabase",name:"dbDatabase",label:"\u8FDE\u63A5\u6570\u636E\u5E93\u540D",disabled:!!c,placeholder:"\u8BF7\u8F93\u5165\u8FDE\u63A5\u6570\u636E\u5E93\u540D",required:!0,type:"input"},{type:"col",children:[{id:"dbUser",type:"input",name:"dbUser",label:"\u7528\u6237\u540D",disabled:!!c,placeholder:"\u8BF7\u8F93\u5165\u7528\u6237\u540D",required:!0},{id:"dbPassword",type:"password",name:"dbPassword",label:"\u5BC6\u7801",placeholder:"\u8BF7\u8F93\u5165\u5BC6\u7801",required:!0,disabled:r?!1:!!c}]}]}),[n,c,r]),p=q(null),A=(a,i,I)=>{switch(console.log("[Form] eventsEmit:",a,i,I),a){case"form:ready":i.formRef&&(p.current=i.formRef);break;case"form_field_change":console.log("\u5B57\u6BB5\u503C\u53D8\u5316:",i),t(x=>({...x,[i.fieldId]:i.value}));break;case"form_validation_error":console.log("\u8868\u5355\u9A8C\u8BC1\u9519\u8BEF:",i);break;default:console.log("\u672A\u5904\u7406\u7684\u4E8B\u4EF6:",a,i)}M==null||M(a,i,I)},h=async()=>{try{W(!0);const a=await p.current.getAllData();a.isValid&&(console.log(a,"==="),n=="DirectDB"&&m=="\u7F16\u8F91\u6570\u636E\u5E93"&&!r&&(a.fields=a.fields.filter(i=>i.name=="name"||i.name=="description")),await M("form_submitted",a,void 0),u(!1))}catch(a){console.error("\u274C \u63D0\u4EA4\u8868\u5355\u6570\u636E\u5931\u8D25:",a)}finally{W(!1)}},N=async()=>{try{w(!0);const a=await p.current.getAllData();if(a.isValid){const i=a.fields.reduce((I,x)=>(I[x.name]=x.value,I),{});await M("form:connect_test",i,void 0)}}catch{w(!1)}finally{w(!1)}},d=T(()=>{const a=n=="DataTable"?g:D;return{label:"\u52A8\u6001\u8868\u5355\u793A\u4F8B",defaultActiveId:a.id,model:null,views:[{label:"\u7528\u6237\u6CE8\u518C\u8868\u5355",id:a.id,type:"form",size:"md",formWidth:a.formWidth,formConfig:{layout:a.layout,showReset:!1,showSubmit:!1,formWidth:a.formWidth,getFormData:()=>({...e,timestamp:new Date().toISOString(),formId:a.id}),onFieldChange:(i,I)=>{A("form_field_change",{fieldId:i,value:I},void 0)},onValidationError:i=>{A("form_validation_error",i,void 0)}}}],dataSource:[{id:a.id,fields:a.fields,defaultValues:{...c}}],eventsEmit:A}},[n,g,D,z,c]),v=T(()=>n=="DirectDB"?c?r&&!B:!B:!1,[n,B,r,z]);return Z($,{title:m,width:620,onCancel:()=>{F(),u(!1)},open:z,destroyOnHidden:!0,footer:Z("div",{className:"flex justify-end gap-3",style:{justifyContent:"end"},children:[l(Q,{mode:"default",label:"\u53D6\u6D88",onClick:()=>{F(),u(!1)}}),l(Q,{mode:"primary",label:"\u786E\u8BA4",loading:G,disabled:v,onClick:h})]}),children:[l(K,{...d},"example-form"),n==="DirectDB"&&l(de,{children:m=="\u7F16\u8F91\u6570\u636E\u5E93"&&!r?l(Q,{mode:"primary",className:"mt-[10px]",label:"\u4FEE\u6539\u5BC6\u7801",onClick:()=>{u(!0),p.current.setValues({dbPassword:void 0})}}):l(ye,{title:"\u9700\u901A\u8FC7\u6D4B\u8BD5\u624D\u53EF\u521B\u5EFA\u6210\u529F",children:l(Q,{mode:"primary",className:"mt-[10px]",label:"\u8FDE\u63A5\u6D4B\u8BD5",loading:R,onClick:N})})})]})},we=""+new URL("assets/empty.png",import.meta.url).href,{confirm:Ne}=$,ve=Ee.div`
|
|
1
|
+
import{jsxs as Z,jsx as l,Fragment as de}from"react/jsx-runtime";import{useState as y,useMemo as T,useRef as q,useEffect as De}from"react";import{J as Q,s as me,m as be}from"./assets/index-fhKUis2J.js";import{b as ge,T as ye,d as Ee}from"./assets/index-BbHMAb8g.js";import{O as K}from"./assets/index-CuySCBtZ.js";import{M as $,s as H}from"./assets/style-CNIDlcUL.js";/* empty css */import"react-dom";const Fe=({url:m,token:z,role:B,eventsEmit:F})=>{const c=ge.create({baseURL:m,timeout:1e6});return c.interceptors.request.use(e=>{let t=z;return!t&&!["user/login","user/kaptcha","user/regist"].some(u=>e.url.includes(u))?(F&&F("request:error_auth",{errorMsg:"\u672A\u767B\u5F55\u6216token\u5DF2\u8FC7\u671F",redirect:"/login"}),Promise.reject(new Error("\u672A\u767B\u5F55\u6216token\u5DF2\u8FC7\u671F"))):(e.headers.Authorization=t||"",e.headers.userName=B==="\u672A\u767B\u5F55\u7528\u6237"?"":B,e)}),c.interceptors.response.use(e=>{const t=["user/kaptcha"],r=e.data;if(t.some(p=>e.config.url&&e.config.url.includes(p))||r.size&&r.type)return r;const{success:u,errorMsg:b,errorCode:D}=r;return u?r:(F&&F("request:error_business",{errorCode:D,errorMsg:b||"\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",response:r}),!1)},async e=>{var t,r,u,b,D,p,A,h,N;if(e.message==="canceled")return Promise.reject(e);if(F){let d="request:error_network",v={errorMsg:"\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25",error:e};((t=e==null?void 0:e.response)==null?void 0:t.status)===401?(d="request:error_auth",v={errorMsg:"\u6CA1\u6709\u8DB3\u591F\u6743\u9650",error:e,redirect:"/login"}):(((u=(r=e==null?void 0:e.response)==null?void 0:r.data)==null?void 0:u.errorCode)==="30013"||((D=(b=e==null?void 0:e.response)==null?void 0:b.data)==null?void 0:D.errorCode)==="30023")&&(d="request:error_business",v={errorCode:(A=(p=e==null?void 0:e.response)==null?void 0:p.data)==null?void 0:A.errorCode,errorMsg:((N=(h=e==null?void 0:e.response)==null?void 0:h.data)==null?void 0:N.errorMsg)||"\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",error:e}),F(d,v)}return console.log("Error occurs",e),Promise.reject(e)}),{getDatabaseList:async e=>{try{const t=await c.get(`/queryPageDBList?${new URLSearchParams(e).toString()}`),{success:r,data:u}=t;if(r)return u}catch(t){console.log("getDatabaseList error:",t)}},getShareDatabaseList:async e=>{try{const t=await c.get(`/queryShareDBList?${new URLSearchParams(e).toString()}`),{success:r,data:u}=t;if(r)return u}catch(t){console.log("getShareDatabaseList error:",t)}},delDatabaseById:async(e,t)=>{const r=O(t);try{const u=await c.delete(`/${r}/deleteDB/${e}`),{success:b,data:D}=u;if(b)return D}catch(u){console.log("delDatabaseById error:",u)}},saveDatabase:async(e,t)=>{const r=O(t);try{const u=await c.post(`/${r}/saveDBInfo`,e),{success:b,data:D}=u;if(b)return D}catch(u){console.log("saveDatabase error:",u)}},testConnection:async e=>{try{const t=await c.post("/directDB/testConnect",e),{success:r,data:u}=t;if(r)return u}catch(t){console.log("testConnection error:",t)}},syncSchema:async e=>{try{const t=await c.get(`/directDB/syncSchema/${e}`),{success:r,data:u}=t;if(r)return u}catch(t){console.log("syncSchema error:",t)}}}},O=m=>m=="DataTable"?"dataTable":"directDB",pe="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzYiIGhlaWdodD0iMzYiIHZpZXdCb3g9IjAgMCAzNiAzNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTE0IDEyQzE0IDEwLjg5NTQgMTQuODk1NCAxMCAxNiAxMEgyOUMzMS4yMDkxIDEwIDMzIDExLjc5MDkgMzMgMTRWMjZDMzMgMzAuNDE4MyAyOS40MTgzIDM0IDI1IDM0SDE2QzE0Ljg5NTQgMzQgMTQgMzMuMTA0NiAxNCAzMlYxMloiIGZpbGw9InVybCgjcGFpbnQwX2xpbmVhcl80NDcyXzE4MDUyKSIvPgo8Zm9yZWlnbk9iamVjdCB4PSItMSIgeT0iLTEiIHdpZHRoPSIzMiIgaGVpZ2h0PSIzNiI+PGRpdiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94aHRtbCIgc3R5bGU9ImJhY2tkcm9wLWZpbHRlcjpibHVyKDJweCk7Y2xpcC1wYXRoOnVybCgjYmdibHVyXzBfNDQ3Ml8xODA1Ml9jbGlwX3BhdGgpO2hlaWdodDoxMDAlO3dpZHRoOjEwMCUiPjwvZGl2PjwvZm9yZWlnbk9iamVjdD48ZyBkYXRhLWZpZ21hLWJnLWJsdXItcmFkaXVzPSI0Ij4KPHBhdGggZD0iTTMgN0MzIDQuNzkwODYgNC43OTA4NiAzIDcgM0gyM0MyNS4yMDkxIDMgMjcgNC43OTA4NiAyNyA3VjE5QzI3IDI1LjYyNzQgMjEuNjI3NCAzMSAxNSAzMUg3QzQuNzkwODYgMzEgMyAyOS4yMDkxIDMgMjdWN1oiIGZpbGw9IndoaXRlIiBmaWxsLW9wYWNpdHk9IjAuNDYiLz4KPHBhdGggZD0iTTcgMy4yNUgyM0MyNS4wNzExIDMuMjUgMjYuNzUgNC45Mjg5MyAyNi43NSA3VjE5QzI2Ljc1IDI1LjQ4OTMgMjEuNDg5MyAzMC43NSAxNSAzMC43NUg3QzQuOTI4OTMgMzAuNzUgMy4yNSAyOS4wNzExIDMuMjUgMjdWN0MzLjI1IDQuOTI4OTMgNC45Mjg5MyAzLjI1IDcgMy4yNVoiIHN0cm9rZT0id2hpdGUiIHN0cm9rZS1vcGFjaXR5PSIwLjM0IiBzdHJva2Utd2lkdGg9IjAuNSIvPgo8L2c+CjxnIGZpbHRlcj0idXJsKCNmaWx0ZXIxX2RfNDQ3Ml8xODA1MikiPgo8cGF0aCBkPSJNMTQgMTlWMTEuNjY2NyIgc3Ryb2tlPSJ3aGl0ZSIgc3Ryb2tlLXdpZHRoPSIxLjgzOTcyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPHBhdGggZD0iTTExIDE0TDEyIDEzTDE0IDExTDE2IDEzTDE3IDE0IiBzdHJva2U9IndoaXRlIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8cGF0aCBkPSJNMTAgMjJIMTgiIHN0cm9rZT0id2hpdGUiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIi8+CjwvZz4KPGRlZnM+CjxjbGlwUGF0aCBpZD0iYmdibHVyXzBfNDQ3Ml8xODA1Ml9jbGlwX3BhdGgiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEgMSkiPjxwYXRoIGQ9Ik0zIDdDMyA0Ljc5MDg2IDQuNzkwODYgMyA3IDNIMjNDMjUuMjA5MSAzIDI3IDQuNzkwODYgMjcgN1YxOUMyNyAyNS42Mjc0IDIxLjYyNzQgMzEgMTUgMzFIN0M0Ljc5MDg2IDMxIDMgMjkuMjA5MSAzIDI3VjdaIi8+CjwvY2xpcFBhdGg+PGZpbHRlciBpZD0iZmlsdGVyMV9kXzQ0NzJfMTgwNTIiIHg9IjUiIHk9IjYiIHdpZHRoPSIxOCIgaGVpZ2h0PSIyMSIgZmlsdGVyVW5pdHM9InVzZXJTcGFjZU9uVXNlIiBjb2xvci1pbnRlcnBvbGF0aW9uLWZpbHRlcnM9InNSR0IiPgo8ZmVGbG9vZCBmbG9vZC1vcGFjaXR5PSIwIiByZXN1bHQ9IkJhY2tncm91bmRJbWFnZUZpeCIvPgo8ZmVDb2xvck1hdHJpeCBpbj0iU291cmNlQWxwaGEiIHR5cGU9Im1hdHJpeCIgdmFsdWVzPSIwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAxMjcgMCIgcmVzdWx0PSJoYXJkQWxwaGEiLz4KPGZlT2Zmc2V0Lz4KPGZlR2F1c3NpYW5CbHVyIHN0ZERldmlhdGlvbj0iMiIvPgo8ZmVDb21wb3NpdGUgaW4yPSJoYXJkQWxwaGEiIG9wZXJhdG9yPSJvdXQiLz4KPGZlQ29sb3JNYXRyaXggdHlwZT0ibWF0cml4IiB2YWx1ZXM9IjAgMCAwIDAgMCAwIDAgMCAwIDAuMzk2MDc4IDAgMCAwIDAgMC45ODQzMTQgMCAwIDAgMC40IDAiLz4KPGZlQmxlbmQgbW9kZT0ibm9ybWFsIiBpbjI9IkJhY2tncm91bmRJbWFnZUZpeCIgcmVzdWx0PSJlZmZlY3QxX2Ryb3BTaGFkb3dfNDQ3Ml8xODA1MiIvPgo8ZmVCbGVuZCBtb2RlPSJub3JtYWwiIGluPSJTb3VyY2VHcmFwaGljIiBpbjI9ImVmZmVjdDFfZHJvcFNoYWRvd180NDcyXzE4MDUyIiByZXN1bHQ9InNoYXBlIi8+CjwvZmlsdGVyPgo8bGluZWFyR3JhZGllbnQgaWQ9InBhaW50MF9saW5lYXJfNDQ3Ml8xODA1MiIgeDE9IjIzLjUiIHkxPSIxMCIgeDI9IjIzLjUiIHkyPSIzNCIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPgo8c3RvcCBzdG9wLWNvbG9yPSIjNjRBMEZEIi8+CjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iIzAxNUFGRiIvPgo8L2xpbmVhckdyYWRpZW50Pgo8L2RlZnM+Cjwvc3ZnPgo=",Ie=""+new URL("assets/database_connect.svg",import.meta.url).href,Me=""+new URL("assets/MySQL.svg",import.meta.url).href,fe=""+new URL("assets/SQLServer.png",import.meta.url).href,Ce=""+new URL("assets/PostgreSQL.png",import.meta.url).href,Ae=""+new URL("assets/Doris.png",import.meta.url).href,he=[{label:"MySQL",value:"MySQL",icon:Me},{label:"PostgreSQL",value:"PostgreSQL",icon:Ce},{label:"SQLServer",value:"SQLServer",icon:fe},{label:"Doris",value:"Doris",icon:Ae}],Be=({drawerTitle:m,drawerVisible:z,isConnectSuccess:B,handleDrawerClose:F,dbInfo:c,dbType:n,eventsEmit:M})=>{const[G,W]=y(!1),[R,w]=y(!1),[e,t]=y({}),[r,u]=y(!1),b=T(()=>({id:n,layout:"vertical",formWidth:"500px",fields:[{id:"name",name:"name",label:"\u6570\u636E\u5E93\u540D\u79F0",type:"input",required:!0,placeholder:"\u4EC5\u652F\u6301\u6C49\u5B57\u3001\u6570\u5B57\u3001\u82F1\u6587\u3001\u7B26\u53F7",validate:a=>{if(!a)return"\u6570\u636E\u5E93\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A";if(!/[\u4E00-\u9FA5A-Za-z0-9\W]/.test(a))return"\u4EC5\u652F\u6301\u6C49\u5B57\u3001\u6570\u5B57\u3001\u82F1\u6587\u3001\u7B26\u53F7"},counter:100},{id:"description",name:"description",label:"\u6570\u636E\u5E93\u63CF\u8FF0",type:"textarea",counter:150,required:!1,placeholder:"\u8BF7\u8F93\u5165\u6570\u636E\u5E93\u63CF\u8FF0,\u6B64\u63CF\u8FF0\u4EC5\u7528\u4E8E\u533A\u5206\u4E0D\u540C\u6570\u636E\u5E93,\u4E0D\u4F1A\u5F71\u54CD\u6570\u636E\u5E93\u8C03\u7528",defaultValue:""}]}),[n,c]),D=T(()=>({id:n,layout:"vertical",formWidth:"470px",fields:[{id:"name",name:"name",label:"\u6570\u636E\u5E93\u540D\u79F0",type:"input",required:!0,placeholder:"\u4EC5\u652F\u6301\u6C49\u5B57\u3001\u6570\u5B57\u3001\u82F1\u6587\u3001\u7B26\u53F7",validate:a=>{if(!a)return"\u6570\u636E\u5E93\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A";if(!/[\u4E00-\u9FA5A-Za-z0-9\W]/.test(a))return"\u4EC5\u652F\u6301\u6C49\u5B57\u3001\u6570\u5B57\u3001\u82F1\u6587\u3001\u7B26\u53F7"},counter:100},{id:"description",name:"description",label:"\u6570\u636E\u5E93\u63CF\u8FF0",type:"textarea",required:!1,counter:150,placeholder:"\u8BF7\u8F93\u5165\u6570\u636E\u5E93\u63CF\u8FF0,\u6B64\u63CF\u8FF0\u4EC5\u7528\u4E8E\u533A\u5206\u4E0D\u540C\u6570\u636E\u5E93,\u4E0D\u4F1A\u5F71\u54CD\u6570\u636E\u5E93\u8C03\u7528",defaultValue:""},{id:"db-info",label:"\u76F4\u8FDE\u6570\u636E\u6E90\u4FE1\u606F",type:"title",level:2},{id:"dbType",name:"dbType",label:"\u6570\u636E\u6E90\u7C7B\u578B",type:"select",disabled:!!c,required:!0,options:he.map(a=>{const{label:i,value:I,icon:x}=a;return{label:i,value:I,render:()=>Z("div",{className:"flex items-center gap-2",children:[l("img",{src:x,width:24}),l("span",{children:i})]})}})},{id:"dbHost",name:"dbHost",label:"\u4E3B\u673A\u5730\u5740",type:"input",required:!0,disabled:!!c,placeholder:"\u8BF7\u8F93\u5165IP\u5730\u5740\u6216\u8005\u57DF\u540D"},{id:"dbPort",name:"dbPort",label:"\u7AEF\u53E3\u53F7",type:"number",required:!0,disabled:!!c,placeholder:"\u8BF7\u8F93\u5165\u7AEF\u53E3\u540D\u79F0"},{id:"dbDatabase",name:"dbDatabase",label:"\u8FDE\u63A5\u6570\u636E\u5E93\u540D",disabled:!!c,placeholder:"\u8BF7\u8F93\u5165\u8FDE\u63A5\u6570\u636E\u5E93\u540D",required:!0,type:"input"},{type:"col",children:[{id:"dbUser",type:"input",name:"dbUser",label:"\u7528\u6237\u540D",disabled:!!c,placeholder:"\u8BF7\u8F93\u5165\u7528\u6237\u540D",required:!0},{id:"dbPassword",type:"password",name:"dbPassword",label:"\u5BC6\u7801",placeholder:"\u8BF7\u8F93\u5165\u5BC6\u7801",required:!0,disabled:r?!1:!!c}]}]}),[n,c,r]),p=q(null),A=(a,i,I)=>{switch(console.log("[Form] eventsEmit:",a,i,I),a){case"form:ready":i.formRef&&(p.current=i.formRef);break;case"form_field_change":console.log("\u5B57\u6BB5\u503C\u53D8\u5316:",i),t(x=>({...x,[i.fieldId]:i.value}));break;case"form_validation_error":console.log("\u8868\u5355\u9A8C\u8BC1\u9519\u8BEF:",i);break;default:console.log("\u672A\u5904\u7406\u7684\u4E8B\u4EF6:",a,i)}M==null||M(a,i,I)},h=async()=>{try{W(!0);const a=await p.current.getAllData();a.isValid&&(console.log(a,"==="),n=="DirectDB"&&m=="\u7F16\u8F91\u6570\u636E\u5E93"&&!r&&(a.fields=a.fields.filter(i=>i.name=="name"||i.name=="description")),await M("form_submitted",a,void 0),u(!1))}catch(a){console.error("\u274C \u63D0\u4EA4\u8868\u5355\u6570\u636E\u5931\u8D25:",a)}finally{W(!1)}},N=async()=>{try{w(!0);const a=await p.current.getAllData();if(a.isValid){const i=a.fields.reduce((I,x)=>(I[x.name]=x.value,I),{});await M("form:connect_test",i,void 0)}}catch{w(!1)}finally{w(!1)}},d=T(()=>{const a=n=="DataTable"?b:D;return{label:"\u52A8\u6001\u8868\u5355\u793A\u4F8B",defaultActiveId:a.id,model:null,views:[{label:"\u7528\u6237\u6CE8\u518C\u8868\u5355",id:a.id,type:"form",size:"md",formWidth:a.formWidth,formConfig:{layout:a.layout,showReset:!1,showSubmit:!1,formWidth:a.formWidth,getFormData:()=>({...e,timestamp:new Date().toISOString(),formId:a.id}),onFieldChange:(i,I)=>{A("form_field_change",{fieldId:i,value:I},void 0)},onValidationError:i=>{A("form_validation_error",i,void 0)}}}],dataSource:[{id:a.id,fields:a.fields,defaultValues:{...c}}],eventsEmit:A}},[n,b,D,z,c]),v=T(()=>n=="DirectDB"?c?r&&!B:!B:!1,[n,B,r,z]);return Z($,{title:m,width:620,onCancel:()=>{F(),u(!1)},open:z,destroyOnHidden:!0,footer:Z("div",{className:"flex justify-end gap-3",style:{justifyContent:"end"},children:[l(Q,{mode:"default",label:"\u53D6\u6D88",onClick:()=>{F(),u(!1)}}),l(Q,{mode:"primary",label:"\u786E\u8BA4",loading:G,disabled:v,onClick:h})]}),children:[l(K,{...d},"example-form"),n==="DirectDB"&&l(de,{children:m=="\u7F16\u8F91\u6570\u636E\u5E93"&&!r?l(Q,{mode:"primary",className:"mt-[10px]",label:"\u4FEE\u6539\u5BC6\u7801",onClick:()=>{u(!0),p.current.setValues({dbPassword:void 0})}}):l(ye,{title:"\u9700\u901A\u8FC7\u6D4B\u8BD5\u624D\u53EF\u521B\u5EFA\u6210\u529F",children:l(Q,{mode:"primary",className:"mt-[10px]",label:"\u8FDE\u63A5\u6D4B\u8BD5",loading:R,onClick:N})})})]})},we=""+new URL("assets/empty.png",import.meta.url).href,{confirm:Ne}=$,ve=Ee.div`
|
|
2
2
|
width: 282px;
|
|
3
3
|
height: 81px;
|
|
4
4
|
display: flex;
|
|
@@ -17,4 +17,4 @@ import{jsxs as Z,jsx as l,Fragment as de}from"react/jsx-runtime";import{useState
|
|
|
17
17
|
background-color: #F1F5FF;
|
|
18
18
|
};
|
|
19
19
|
border: 1px solid #EBEBEB
|
|
20
|
-
`,xe=[{key:"add_file_db",label:"\u4E0A\u4F20\u6570\u636E\u5E93",dsc:"\u901A\u8FC7\u4E0A\u4F20Excel\u3001csv\u7B49\u683C\u5F0F\u6570\u636E\u8868\u521B\u5EFA\u6570\u636E\u5E93\u3002",icon:pe},{key:"add_direct_db",label:"\u76F4\u8FDE\u6570\u636E\u5E93",dsc:"\u901A\u8FC7\u4E0E\u5DF2\u6709\u4E1A\u52A1\u5EFA\u7ACB\u8FDE\u63A5\u521B\u5EFA\u6570\u636E\u5E93\u3002",icon:Ie}],We=m=>{const{url:z,token:B,role:F,CustomComponents:c,getBtnDisabled:n}=m,[M,G]=y("my-db"),[W,R]=y({app:"ready",container:"ready",content:"ready"}),[w,e]=y(!1),[t,r]=y([{id:"my-db",data:[]},{id:"shared-db",data:[]}]),u=q(null),[
|
|
20
|
+
`,xe=[{key:"add_file_db",label:"\u4E0A\u4F20\u6570\u636E\u5E93",dsc:"\u901A\u8FC7\u4E0A\u4F20Excel\u3001csv\u7B49\u683C\u5F0F\u6570\u636E\u8868\u521B\u5EFA\u6570\u636E\u5E93\u3002",icon:pe},{key:"add_direct_db",label:"\u76F4\u8FDE\u6570\u636E\u5E93",dsc:"\u901A\u8FC7\u4E0E\u5DF2\u6709\u4E1A\u52A1\u5EFA\u7ACB\u8FDE\u63A5\u521B\u5EFA\u6570\u636E\u5E93\u3002",icon:Ie}],We=m=>{const{url:z,token:B,role:F,CustomComponents:c,getBtnDisabled:n}=m,[M,G]=y("my-db"),[W,R]=y({app:"ready",container:"ready",content:"ready"}),[w,e]=y(!1),[t,r]=y([{id:"my-db",data:[]},{id:"shared-db",data:[]}]),u=q(null),[b,D]=y(!1),[p,A]=y(""),[h,N]=y("DataTable"),[d,v]=y(),[a,i]=y(!1),{getDatabaseList:I,delDatabaseById:x,saveDatabase:ee,testConnection:ue,getShareDatabaseList:te,syncSchema:ae}=Fe({url:z,token:B,role:F,eventsEmit:m.eventsEmit}),J=T(()=>[{label:"\u6211\u7684\u6570\u636E\u5E93",id:"my-db",type:"card",cardType:"database",rowHeight:220,viewPageSize:12,viewBehavior:"pagination",actions:[{label:"\u7F16\u8F91",key:"edit"},{label:"\u5220\u9664",key:"delete"}],toolbar:[{type:"customized",key:"add",render:()=>l(me,{mode:"primary",label:"\u521B\u5EFA\u6570\u636E\u5E93",actions:xe.map(o=>({key:o.key,component:l(ve,{children:Z("div",{className:"flex flex-grow",children:[l("div",{className:"mr-[6px]",children:l("img",{src:o.icon})}),Z("div",{children:[l("div",{className:"text-base font-bold mb-1 text-[14px]",children:o.label}),l("div",{className:"text-[#888] text-[10px]",children:o.dsc})]})]})},o.key)})),eventEmit:_})},{type:"fuzzy_search",key:"search",label:"\u8F93\u5165\u540D\u79F0\u641C\u7D22",searchKeys:["name","description"],position:"right"}]},{label:"\u5171\u4EAB\u6570\u636E\u5E93",id:"shared-db",type:"card",cardType:"database",rowHeight:240,toolbar:[{type:"fuzzy_search",key:"search",label:"\u641C\u7D22",position:"right"}],actions:[{label:"\u7F16\u8F91",key:"edit"},{label:"\u5220\u9664",key:"delete"}]}],[t]);De(()=>{R(o=>({...o,content:"loading"})),se()},[]);const se=async()=>{var o,s,f,g;try{const[C,j]=await Promise.allSettled([I({pageNo:1,pageSize:999}),te({pageNo:1,pageSize:999})]);let L=[];if(C.status==="fulfilled"&&C.value&&(o=C.value)!=null&&o.records){const S=Y((s=C.value)==null?void 0:s.records);L.push({id:"my-db",data:S||[]})}if(j.status==="fulfilled"&&j.value&&(f=j.value)!=null&&f.records){const S=Y((g=j.value)==null?void 0:g.records);L.push({id:"shared-db",data:S||[]})}r(L),R(S=>({...S,content:"ready"}))}catch(C){console.log("[DatabaseApiError] getDatabaseList:",C)}},Y=o=>(o||[]).map(s=>{const f=U("shared-db").map((g,C)=>({...g,key:g.type==="divider"?`${g.key}_${s.id}`:g.key,disabled:n&&n(g.key=="edit"?7:4,s.permission)}));return s.datasourceType=="DirectDB"&&f.push({label:"\u540C\u6B65\u8868\u7ED3\u6784",key:"sync_schema",disabled:n&&n(7,s.permission)}),console.log("[DatabaseViewAdopter] actions:",f),{...s,actions:f||[]}}),re="admin",ie=()=>Z("div",{className:"flex flex-col items-center justify-center h-full",children:[l("div",{className:"text-xl font-semibold mb-3",style:{color:"#374151"},children:l("img",{src:we,width:120})}),l("div",{className:"text-base mb-6",style:{color:"#6b7280"},children:"\u6682\u65E0\u6570\u636E\uFF0C\u8BF7\u5148\u6DFB\u52A0\u6570\u636E\u5E93"})]}),U=o=>{const s=J.find(g=>g.id===o);return(s==null?void 0:s.actions)||[]},oe=T(()=>{var s;const o=((s=t==null?void 0:t.find(f=>f.id===M))==null?void 0:s.data)||[];return w?[]:o},[M,t,w]),X=()=>{D(!1),i(!1),v(void 0)},ce=async o=>{console.log("[DatabaseViewAdopter] \u6D4B\u8BD5\u8FDE\u63A5:",o);const s=await ue(o);return s&&(i(!0),H.success("\u8FDE\u63A5\u6D4B\u8BD5\u6210\u529F\uFF01")),s};async function _(o,s,f){var g,C,j,L,S;switch(console.log("[DatabaseViewAdopter] mergedEventsEmit",o,s),o){case"card_delete":Ne({title:"\u786E\u8BA4\u5220\u9664\u6570\u636E\u5E93\uFF1F",content:"\u5220\u9664\u540E\uFF0C\u8BE5\u6570\u636E\u5E93\u5C06\u65E0\u6CD5\u6062\u590D",okText:"\u5220\u9664",cancelText:"\u53D6\u6D88",async onOk(){await x(s.id,s.datasourceType)&&(u!=null&&u.current)&&(u==null||u.current.appFn.removeItem(s.id))},onCancel(){console.log("Cancel")}});break;case"card_edit":A("\u7F16\u8F91\u6570\u636E\u5E93"),D(!0),N(s.datasourceType),delete s.render,v(s);break;case"select":G(s.id);break;case"filesDir_clicked":G(s.id);break;case"dropdown_action":A("\u521B\u5EFA\u6570\u636E\u5E93"),D(!0),s.key=="add_file_db"?N("DataTable"):N("DirectDB");break;case"form_submitted":try{const k=s.fields.reduce((P,E)=>(P[E.name]=E.value,P),{}),le=d?{id:d==null?void 0:d.id,...k}:k,V=await ee(le,h);if(V){if(d){const P={...d,...k,datasourceType:h,actions:U("my-db").map((E,ne)=>({...E,key:E.type==="divider"?`${E.key}_${V}`:E.key,allow:!0}))};(C=(g=u==null?void 0:u.current)==null?void 0:g.appFn)==null||C.updateItem(P,d==null?void 0:d.id),H.success("\u6570\u636E\u5E93\u7F16\u8F91\u6210\u529F\uFF01")}else{const P={...k,...V,createBy:re,datasourceType:h,actions:U("my-db").map((E,ne)=>({...E,key:E.type==="divider"?`${E.key}_${V}`:E.key,allow:!0}))};(L=(j=u==null?void 0:u.current)==null?void 0:j.appFn)==null||L.addItem(P,{animate:!0,position:"start"}),H.success("\u6570\u636E\u5E93\u521B\u5EFA\u6210\u529F\uFF01")}return V}}catch(k){console.error("\u4FDD\u5B58\u5931\u8D25\uFF01",k)}finally{X()}break;case"form:connect_test":return await ce(s);case"toolbar_test_empty":console.log("[DatabaseViewAdopter] toolbar_test_empty \u4E8B\u4EF6\u89E6\u53D1"),e(!w);break;case"card_sync_schema":await ae(s.id)&&(i(!0),H.success("\u540C\u6B65\u8868\u7ED3\u6784\u6210\u529F\uFF01"));break;default:(S=m.eventsEmit)==null||S.call(m,o,s);break}}return Z(be,{title:"\u6570\u636E\u5E93\u7BA1\u7406",children:[l(K,{ref:u,label:"",model:"tabs",defaultActiveId:M,views:J,dataSource:oe,eventsEmit:_,status:W,CustomComponents:{EmptyData:ie,...c},styles:m.styles},"db"),l(Be,{drawerTitle:p,drawerVisible:b,isConnectSuccess:a,dbType:h,dbInfo:d,handleDrawerClose:X,eventsEmit:_})]})};export{We as default};
|
package/databaseId.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"react/jsx-runtime";import"react";import"./assets/index-CpW6Dhpp.js";import"./assets/index-
|
|
1
|
+
import"react/jsx-runtime";import"react";import"./assets/index-CpW6Dhpp.js";import"./assets/index-fhKUis2J.js";import"./assets/index-BbHMAb8g.js";import"./assets/index-CuySCBtZ.js";/* empty css */import"./assets/style-CNIDlcUL.js";import{D as g}from"./assets/index-BH8au9G9.js";import"react-dom";import"./assets/index-BbpyNfEd.js";import"./assets/index-CPOAXITM.js";import"./assets/index-Wjs4Vb6x.js";import"./assets/index-DnJqVq9Q.js";import"./assets/x-BjRa5XLp.js";import"./assets/index-Dkwp9YpO.js";export{g as default};
|
package/databaseTable.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{jsxs as Y,jsx as N}from"react/jsx-runtime";import*as f from"react";import F,{useContext as de,Children as $e,useState as
|
|
1
|
+
import{jsxs as Y,jsx as N}from"react/jsx-runtime";import*as f from"react";import F,{useContext as de,Children as $e,useState as k,useRef as Le,useEffect as Ne,useMemo as Pe}from"react";import{u as ce}from"./assets/index-CpW6Dhpp.js";import{a as ze,l as ge,f as G,o as Fe,q as ue,g as Me,m as Te,k as E,r as _e,u as Oe,s as Ae,v as je,_ as ye,w as Re,x as be,R as xe,D as He,b as qe,I as We,B as ke}from"./assets/index-BbHMAb8g.js";import{J as Se,m as Ge}from"./assets/index-fhKUis2J.js";import{D as Ve}from"./assets/index-DnJqVq9Q.js";import{P as Xe,S as Ue}from"./assets/index-CPOAXITM.js";import{X as Je}from"./assets/x-BjRa5XLp.js";import{O as Ke}from"./assets/index-CuySCBtZ.js";/* empty css */import{M as Ye,s as Ce}from"./assets/style-CNIDlcUL.js";import"react-dom";/**
|
|
2
2
|
* @license lucide-react v0.456.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const Qe=ze("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]),pe=F.createContext({});pe.Consumer;var ve=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,i=Object.getOwnPropertySymbols(t);o<i.length;o++)e.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(t,i[o])&&(n[i[o]]=t[i[o]]);return n};const Ze=t=>{var{prefixCls:e,className:n,avatar:i,title:o,description:p}=t,$=ve(t,["prefixCls","className","avatar","title","description"]);const{getPrefixCls:y}=de(ge),h=y("list",e),a=k(`${h}-item-meta`,n),d=F.createElement("div",{className:`${h}-item-meta-content`},o&&F.createElement("h4",{className:`${h}-item-meta-title`},o),p&&F.createElement("div",{className:`${h}-item-meta-description`},p));return F.createElement("div",Object.assign({},$,{className:a}),i&&F.createElement("div",{className:`${h}-item-meta-avatar`},i),(o||p)&&d)},et=F.forwardRef((t,e)=>{const{prefixCls:n,children:i,actions:o,extra:p,styles:$,className:y,classNames:h,colStyle:a}=t,d=ve(t,["prefixCls","children","actions","extra","styles","className","classNames","colStyle"]),{grid:s,itemLayout:r}=de(pe),{getPrefixCls:g,list:u}=de(ge),D=I=>{var v,O;return k((O=(v=u==null?void 0:u.item)===null||v===void 0?void 0:v.classNames)===null||O===void 0?void 0:O[I],h==null?void 0:h[I])},x=I=>{var v,O;return Object.assign(Object.assign({},(O=(v=u==null?void 0:u.item)===null||v===void 0?void 0:v.styles)===null||O===void 0?void 0:O[I]),$==null?void 0:$[I])},A=()=>{let I=!1;return $e.forEach(i,v=>{typeof v=="string"&&(I=!0)}),I&&$e.count(i)>1},L=()=>r==="vertical"?!!p:!A(),S=g("list",n),P=o&&o.length>0&&F.createElement("ul",{className:k(`${S}-item-action`,D("actions")),key:"actions",style:x("actions")},o.map((I,v)=>F.createElement("li",{key:`${S}-item-action-${v}`},I,v!==o.length-1&&F.createElement("em",{className:`${S}-item-action-split`})))),q=s?"div":"li",R=F.createElement(q,Object.assign({},d,s?{}:{ref:e},{className:k(`${S}-item`,{[`${S}-item-no-flex`]:!L()},y)}),r==="vertical"&&p?[F.createElement("div",{className:`${S}-item-main`,key:"content"},i,P),F.createElement("div",{className:k(`${S}-item-extra`,D("extra")),key:"extra",style:x("extra")},p)]:[i,P,Fe(p,{key:"extra"})]);return s?F.createElement(ue,{ref:e,flex:1,style:a},R):R}),Ee=et;Ee.Meta=Ze;const tt=t=>{const{listBorderedCls:e,componentCls:n,paddingLG:i,margin:o,itemPaddingSM:p,itemPaddingLG:$,marginLG:y,borderRadiusLG:h}=t,a=E(t.calc(h).sub(t.lineWidth).equal());return{[e]:{border:`${E(t.lineWidth)} ${t.lineType} ${t.colorBorder}`,borderRadius:h,[`${n}-header`]:{borderRadius:`${a} ${a} 0 0`},[`${n}-footer`]:{borderRadius:`0 0 ${a} ${a}`},[`${n}-header,${n}-footer,${n}-item`]:{paddingInline:i},[`${n}-pagination`]:{margin:`${E(o)} ${E(y)}`}},[`${e}${n}-sm`]:{[`${n}-item,${n}-header,${n}-footer`]:{padding:p}},[`${e}${n}-lg`]:{[`${n}-item,${n}-header,${n}-footer`]:{padding:$}}}},at=t=>{const{componentCls:e,screenSM:n,screenMD:i,marginLG:o,marginSM:p,margin:$}=t;return{[`@media screen and (max-width:${i}px)`]:{[e]:{[`${e}-item`]:{[`${e}-item-action`]:{marginInlineStart:o}}},[`${e}-vertical`]:{[`${e}-item`]:{[`${e}-item-extra`]:{marginInlineStart:o}}}},[`@media screen and (max-width: ${n}px)`]:{[e]:{[`${e}-item`]:{flexWrap:"wrap",[`${e}-action`]:{marginInlineStart:p}}},[`${e}-vertical`]:{[`${e}-item`]:{flexWrap:"wrap-reverse",[`${e}-item-main`]:{minWidth:t.contentWidth},[`${e}-item-extra`]:{margin:`auto auto ${E($)}`}}}}}},nt=t=>{const{componentCls:e,antCls:n,controlHeight:i,minHeight:o,paddingSM:p,marginLG:$,padding:y,itemPadding:h,colorPrimary:a,itemPaddingSM:d,itemPaddingLG:s,paddingXS:r,margin:g,colorText:u,colorTextDescription:D,motionDurationSlow:x,lineWidth:A,headerBg:L,footerBg:S,emptyTextPadding:P,metaMarginBottom:q,avatarMarginRight:R,titleMarginBottom:I,descriptionFontSize:v}=t;return{[e]:Object.assign(Object.assign({},_e(t)),{position:"relative","--rc-virtual-list-scrollbar-bg":t.colorSplit,"*":{outline:"none"},[`${e}-header`]:{background:L},[`${e}-footer`]:{background:S},[`${e}-header, ${e}-footer`]:{paddingBlock:p},[`${e}-pagination`]:{marginBlockStart:$,[`${n}-pagination-options`]:{textAlign:"start"}},[`${e}-spin`]:{minHeight:o,textAlign:"center"},[`${e}-items`]:{margin:0,padding:0,listStyle:"none"},[`${e}-item`]:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:h,color:u,[`${e}-item-meta`]:{display:"flex",flex:1,alignItems:"flex-start",maxWidth:"100%",[`${e}-item-meta-avatar`]:{marginInlineEnd:R},[`${e}-item-meta-content`]:{flex:"1 0",width:0,color:u},[`${e}-item-meta-title`]:{margin:`0 0 ${E(t.marginXXS)} 0`,color:u,fontSize:t.fontSize,lineHeight:t.lineHeight,"> a":{color:u,transition:`all ${x}`,"&:hover":{color:a}}},[`${e}-item-meta-description`]:{color:D,fontSize:v,lineHeight:t.lineHeight}},[`${e}-item-action`]:{flex:"0 0 auto",marginInlineStart:t.marginXXL,padding:0,fontSize:0,listStyle:"none","& > li":{position:"relative",display:"inline-block",padding:`0 ${E(r)}`,color:D,fontSize:t.fontSize,lineHeight:t.lineHeight,textAlign:"center","&:first-child":{paddingInlineStart:0}},[`${e}-item-action-split`]:{position:"absolute",insetBlockStart:"50%",insetInlineEnd:0,width:A,height:t.calc(t.fontHeight).sub(t.calc(t.marginXXS).mul(2)).equal(),transform:"translateY(-50%)",backgroundColor:t.colorSplit}}},[`${e}-empty`]:{padding:`${E(y)} 0`,color:D,fontSize:t.fontSizeSM,textAlign:"center"},[`${e}-empty-text`]:{padding:P,color:t.colorTextDisabled,fontSize:t.fontSize,textAlign:"center"},[`${e}-item-no-flex`]:{display:"block"}}),[`${e}-grid ${n}-col > ${e}-item`]:{display:"block",maxWidth:"100%",marginBlockEnd:g,paddingBlock:0,borderBlockEnd:"none"},[`${e}-vertical ${e}-item`]:{alignItems:"initial",[`${e}-item-main`]:{display:"block",flex:1},[`${e}-item-extra`]:{marginInlineStart:$},[`${e}-item-meta`]:{marginBlockEnd:q,[`${e}-item-meta-title`]:{marginBlockStart:0,marginBlockEnd:I,color:u,fontSize:t.fontSizeLG,lineHeight:t.lineHeightLG}},[`${e}-item-action`]:{marginBlockStart:y,marginInlineStart:"auto","> li":{padding:`0 ${E(y)}`,"&:first-child":{paddingInlineStart:0}}}},[`${e}-split ${e}-item`]:{borderBlockEnd:`${E(t.lineWidth)} ${t.lineType} ${t.colorSplit}`,"&:last-child":{borderBlockEnd:"none"}},[`${e}-split ${e}-header`]:{borderBlockEnd:`${E(t.lineWidth)} ${t.lineType} ${t.colorSplit}`},[`${e}-split${e}-empty ${e}-footer`]:{borderTop:`${E(t.lineWidth)} ${t.lineType} ${t.colorSplit}`},[`${e}-loading ${e}-spin-nested-loading`]:{minHeight:i},[`${e}-split${e}-something-after-last-item ${n}-spin-container > ${e}-items > ${e}-item:last-child`]:{borderBlockEnd:`${E(t.lineWidth)} ${t.lineType} ${t.colorSplit}`},[`${e}-lg ${e}-item`]:{padding:s},[`${e}-sm ${e}-item`]:{padding:d},[`${e}:not(${e}-vertical)`]:{[`${e}-item-no-flex`]:{[`${e}-item-action`]:{float:"right"}}}}},it=t=>({contentWidth:220,itemPadding:`${E(t.paddingContentVertical)} 0`,itemPaddingSM:`${E(t.paddingContentVerticalSM)} ${E(t.paddingContentHorizontal)}`,itemPaddingLG:`${E(t.paddingContentVerticalLG)} ${E(t.paddingContentHorizontalLG)}`,headerBg:"transparent",footerBg:"transparent",emptyTextPadding:t.padding,metaMarginBottom:t.padding,avatarMarginRight:t.padding,titleMarginBottom:t.paddingSM,descriptionFontSize:t.fontSize}),st=Me("List",t=>{const e=Te(t,{listBorderedCls:`${t.componentCls}-bordered`,minHeight:t.controlHeightLG});return[nt(e),tt(e),at(e)]},it);var ot=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,i=Object.getOwnPropertySymbols(t);o<i.length;o++)e.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(t,i[o])&&(n[i[o]]=t[i[o]]);return n};function rt(t,e){const{pagination:n=!1,prefixCls:i,bordered:o=!1,split:p=!0,className:$,rootClassName:y,style:h,children:a,itemLayout:d,loadMore:s,grid:r,dataSource:g=[],size:u,header:D,footer:x,loading:A=!1,rowKey:L,renderItem:S,locale:P}=t,q=ot(t,["pagination","prefixCls","bordered","split","className","rootClassName","style","children","itemLayout","loadMore","grid","dataSource","size","header","footer","loading","rowKey","renderItem","locale"]),R=n&&typeof n=="object"?n:{},[I,v]=f.useState(R.defaultCurrent||1),[O,te]=f.useState(R.defaultPageSize||10),{getPrefixCls:ae,direction:ne,className:ie,style:se}=Ae("list"),{renderEmpty:U}=f.useContext(ge),l={current:1,total:0,position:"bottom"},c=C=>(_,W)=>{var le;v(_),te(W),n&&((le=n==null?void 0:n[C])===null||le===void 0||le.call(n,_,W))},b=c("onChange"),M=c("onShowSizeChange"),H=(C,_)=>{if(!S)return null;let W;return typeof L=="function"?W=L(C):L?W=C[L]:W=C.key,W||(W=`list-item-${_}`),f.createElement(f.Fragment,{key:W},S(C,_))},T=!!(s||n||x),m=ae("list",i),[V,B,z]=st(m);let j=A;typeof j=="boolean"&&(j={spinning:j});const J=!!(j!=null&&j.spinning),K=Oe(u);let X="";switch(K){case"large":X="lg";break;case"small":X="sm";break}const Q=k(m,{[`${m}-vertical`]:d==="vertical",[`${m}-${X}`]:X,[`${m}-split`]:p,[`${m}-bordered`]:o,[`${m}-loading`]:J,[`${m}-grid`]:!!r,[`${m}-something-after-last-item`]:T,[`${m}-rtl`]:ne==="rtl"},ie,$,y,B,z),w=je(l,{total:g.length,current:I,pageSize:O},n||{}),De=Math.ceil(w.total/w.pageSize);w.current=Math.min(w.current,De);const fe=n&&f.createElement("div",{className:k(`${m}-pagination`)},f.createElement(Xe,Object.assign({align:"end"},w,{onChange:b,onShowSizeChange:M})));let oe=ye(g);n&&g.length>(w.current-1)*w.pageSize&&(oe=ye(g).splice((w.current-1)*w.pageSize,w.pageSize));const we=Object.keys(r||{}).some(C=>["xs","sm","md","lg","xl","xxl"].includes(C)),he=Re(we),Z=f.useMemo(()=>{for(let C=0;C<be.length;C+=1){const _=be[C];if(he[_])return _}},[he]),Ie=f.useMemo(()=>{if(!r)return;const C=Z&&r[Z]?r[Z]:r.column;if(C)return{width:`${100/C}%`,maxWidth:`${100/C}%`}},[JSON.stringify(r),Z]);let re=J&&f.createElement("div",{style:{minHeight:53}});if(oe.length>0){const C=oe.map(H);re=r?f.createElement(xe,{gutter:r.gutter},f.Children.map(C,_=>f.createElement("div",{key:_==null?void 0:_.key,style:Ie},_))):f.createElement("ul",{className:`${m}-items`},C)}else!a&&!J&&(re=f.createElement("div",{className:`${m}-empty-text`},(P==null?void 0:P.emptyText)||(U==null?void 0:U("List"))||f.createElement(He,{componentName:"List"})));const ee=w.position,Be=f.useMemo(()=>({grid:r,itemLayout:d}),[JSON.stringify(r),d]);return V(f.createElement(pe.Provider,{value:Be},f.createElement("div",Object.assign({ref:e,style:Object.assign(Object.assign({},se),h),className:Q},q),(ee==="top"||ee==="both")&&fe,D&&f.createElement("div",{className:`${m}-header`},D),f.createElement(Ue,Object.assign({},j),re,a),x&&f.createElement("div",{className:`${m}-footer`},x),s||(ee==="bottom"||ee==="both")&&fe)))}const lt=f.forwardRef(rt),me=lt;me.Item=Ee;const ct=({url:t,token:e,role:n,eventsEmit:i})=>{const o=qe.create({baseURL:t,timeout:1e6});return o.interceptors.request.use(a=>{let d=e;return!d&&!["user/login","user/kaptcha","user/regist"].some(r=>a.url.includes(r))?(i&&i("request:error_auth",{errorMsg:"\u672A\u767B\u5F55\u6216token\u5DF2\u8FC7\u671F",redirect:"/login"}),Promise.reject(new Error("\u672A\u767B\u5F55\u6216token\u5DF2\u8FC7\u671F"))):(a.headers.Authorization=d||"",a.headers.userName=n==="\u672A\u767B\u5F55\u7528\u6237"?"":n,a)}),o.interceptors.response.use(a=>{const d=["user/kaptcha"],s=a.data;if(d.some(D=>a.config.url&&a.config.url.includes(D))||s.size&&s.type)return s;const{success:r,errorMsg:g,errorCode:u}=s;return r?s:(i&&i("request:error_business",{errorCode:u,errorMsg:g||"\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",response:s}),!1)},a=>{var d,s,r,g,u,D,x,A,L;if(a.message==="canceled")return Promise.reject(a);if(i){let S="request:error_network",P={errorMsg:"\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25",error:a};((d=a==null?void 0:a.response)==null?void 0:d.status)===401?(S="request:error_auth",P={errorMsg:"\u6CA1\u6709\u8DB3\u591F\u6743\u9650",error:a,redirect:"/login"}):(((r=(s=a==null?void 0:a.response)==null?void 0:s.data)==null?void 0:r.errorCode)==="30013"||((u=(g=a==null?void 0:a.response)==null?void 0:g.data)==null?void 0:u.errorCode)==="30023")&&(S="request:error_business",P={errorCode:(x=(D=a==null?void 0:a.response)==null?void 0:D.data)==null?void 0:x.errorCode,errorMsg:((L=(A=a==null?void 0:a.response)==null?void 0:A.data)==null?void 0:L.errorMsg)||"\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",error:a}),i(S,P)}return Promise.reject(a)}),{getTableDataList:async({dbId:a,name:d,params:s})=>{try{const r=await o.get(`/directDB/queryTableData/${a}/${d}?${new URLSearchParams(s).toString()}`),{success:g,data:u}=r;if(g)return u}catch(r){return console.log("getTableDataList error:",r),!1}},updateTableData:async(a,d)=>{try{const s=await o.post(`/dataTable/dataUpdateRow/${a}`,{...d}),{success:r,data:g}=s;if(r)return g}catch(s){return console.log("updateTableData error:",s),!1}},delTableDataById:async({tableId:a,rowId:d})=>{try{const s=await o.delete(`/dataTable/dataDeleteRow/${a}/${d}`),{success:r,data:g}=s;if(r)return g}catch(s){console.log("delTableDataById error:",s)}},getFileDataList:async({fileId:a,params:d})=>{try{const s=await o.get(`/dataTable/queryTableFileData/${a}?${new URLSearchParams(d).toString()}`),{success:r,data:g}=s;return r?g:!1}catch(s){return console.log("e",s),!1}}}},dt=({drawerVisible:t,handleDrawerClose:e,rowData:n})=>{const[i,o]=G(n.data),[p,$]=G(null),[y,h]=G(""),a=s=>{h(s.value),$(s.columnId)},d=s=>{y.trim()&&(o(i.map(r=>r.columnId===s?{...r,value:y}:r)),$(null))};return Y(Ve,{title:"\u5217\u6570\u503C\u4FEE\u6539",placement:"right",width:840,onClose:()=>e("cancel"),open:t,closeIcon:!1,extra:N(Je,{size:20,color:"#888888",onClick:()=>e("cancel"),className:"cursor-pointer"}),footer:Y("div",{className:"flex justify-end items-center gap-3",style:{justifyContent:"end"},children:[N(Se,{mode:"default",label:"\u53D6\u6D88",onClick:()=>e("cancel")}),N(Se,{mode:"primary",label:"\u786E\u8BA4",onClick:async()=>{await e("confirm",i)}})]}),children:[Y(xe,{gutter:16,style:{padding:"12px 18px",background:"#fafafa",borderBottom:"1px solid #f0f0f0",fontWeight:"bold"},children:[N(ue,{span:4,children:"\u5217\u540D\u79F0"}),N(ue,{span:20,children:"\u6570\u503C"})]}),N(me,{dataSource:i,renderItem:s=>N(me.Item,{actions:[p!==s.columnId&&N(Ge,{type:"text",icon:N(Qe,{size:14}),onClick:()=>a(s)})],children:Y("div",{style:{display:"flex",width:"100%",height:"54px",lineHeight:"54px"},children:[N("div",{style:{width:"150px",marginLeft:15},children:s.columnName}),N("div",{style:{width:"550px"},children:p===s.columnId?N(We,{value:y,onChange:r=>h(r.target.value),onPressEnter:()=>d(s.columnId),onBlur:()=>d(s.columnId)}):N("div",{className:"w-full truncate",title:s.value,children:s.value})})]})})})]})},{confirm:ut}=Ye;function Et({url:t,token:e,fileId:n,role:i,dbType:o,dbId:p,tableId:$,tableName:y,CustomComponents:h,eventsEmit:a,getBtnDisabled:d}){const[s,r]=G(!1),g=Le(null),[u,D]=G(),[x,A]=G(),[L,S]=G(),[P,q]=G({app:"ready",container:"ready",content:"ready"}),{getTableDataList:R,updateTableData:I,delTableDataById:v,getFileDataList:O}=ct({url:t,token:e,role:i,eventsEmit:a});Ne(()=>{q(l=>({...l,content:"loading"})),te()},[]);const te=async()=>{try{if(o=="DirectDB"){const l=await R({dbId:p,name:y,params:{pageNo:1,pageSize:60}});l&&(l.columns=((l==null?void 0:l.columns)||[]).map(c=>({...c,id:c.id||ce(4)})),l.dataList=(l.dataList||[]).map((c,b)=>({...c,__absIndex:b})),A(l),S(l.permission),q(c=>({...c,content:"ready"})))}else{const l=await O({fileId:n,params:{pageNo:1,pageSize:60}});l&&(l.dataList=(l.dataList||[]).map((c,b)=>({...c,__absIndex:b})),l.columns=((l==null?void 0:l.columns)||[]).map(c=>({...c,id:c.id||ce(4)})),A(l),S(l.permission),q(c=>({...c,content:"ready"})))}}catch(l){console.log("[DatabaseApiError] getDataList:",l)}},ae=l=>((l==null?void 0:l.dataList)||[]).map(b=>{const H=((l==null?void 0:l.columns)||[]).filter(T=>T.physicalName!=="id").map(T=>({columnId:T.id,columnName:T.businessName,physicalName:T.physicalName,value:b[T.physicalName]||"-",type:b.dataType=="DATETIME"?"date":"paragraph"}));return o=="DataTable"&&H.push({columnId:"actions",value:"edit",label:"\u4FEE\u6539",disabled:d&&d(7,L)},{columnId:"actions",value:"delete",label:"\u5220\u9664",disabled:d&&d(4,L)}),{id:b.id,data:H,__absIndex:b.__absIndex}}),ne=l=>{const b=((l==null?void 0:l.columns)||[]).filter(M=>M.physicalName!=="id").map(M=>({title:o=="DirectDB"?M.physicalName:M.businessName,id:M.id,type:M.dataType=="DATETIME"?"date":"paragraph"}));return o=="DataTable"&&b.push({id:"actions",title:"\u64CD\u4F5C",type:"action"}),b},ie=async(l,c,b)=>{var M,H;switch(console.log("[DatabaseTableView] eventsEmit:",l,c,b),l){case"pagination:request_merge_data":{try{const m=(M=c==null?void 0:c.request)==null?void 0:M.pageNo,V=(H=c==null?void 0:c.request)==null?void 0:H.pageSize;if(!m||!V)return;let B;o=="DirectDB"?B=await R({dbId:p,name:y,params:{pageNo:m,pageSize:V}}):B=await O({fileId:n,params:{pageNo:m,pageSize:V}}),B&&(B.dataList=(B.dataList||[]).map((z,j)=>({...z,__absIndex:(m-1)*V+j})),B.columns=((B==null?void 0:B.columns)||[]).map(z=>({...z,id:z.id||ce(4)})),A(z=>{var Q;if(!z)return B;const j=Array.isArray(z.dataList)?z.dataList:[],J=Array.isArray(B.dataList)?B.dataList:[],K=new Map;j.forEach(w=>K.set(w.id,w)),J.forEach(w=>K.set(w.id,w));const X=Array.from(K.values());return{...z,dataList:X,total:z.total??B.total,columns:(Q=z.columns)!=null&&Q.length?z.columns:B.columns}}))}catch(m){console.log("[DatabaseApiError] pagination:request_merge_data:",m)}break}case"table_action_edit":r(!0);const T=(c.data||[]).filter(m=>m.columnId!=="actions");D({id:c.id,data:T});break;case"table_action_delete":try{ut({title:"\u786E\u8BA4\u5220\u9664\u6570\u636E\uFF1F",content:"\u5220\u9664\u540E\uFF0C\u8BE5\u6570\u636E\u5C06\u65E0\u6CD5\u6062\u590D",okText:"\u5220\u9664",cancelText:"\u53D6\u6D88",async onOk(){await v({tableId:$,rowId:c.id})&&(Ce.success("\u8868\u6570\u636E\u5220\u9664\u6210\u529F"),b.removeItem(c.id))},onCancel(){console.log("Cancel")}})}catch{console.log("\u5220\u9664\u8868\u6570\u636E\u5931\u8D25")}break;default:a==null||a(l,c);break}},se=async(l,c)=>{if(l=="confirm")try{const b=c.reduce((H,T)=>(H[T.physicalName]=T.value,H),{});await I($,{...b,id:u==null?void 0:u.id})&&g.current&&(Ce.success("\u6570\u636E\u4FEE\u6539\u6210\u529F"),g.current.appFn.updateItem(c,u==null?void 0:u.id))}catch(b){console.log("[TableRowApiError] updateTableData:",b)}r(!1),D(void 0)},U=Pe(()=>({label:"\u6570\u636E\u5E93\u8868\u683C",defaultActiveId:"database-table",model:null,views:[{label:"\u6570\u636E\u8868\u540D\u79F0",id:"database-table",type:"table",total:(x==null?void 0:x.totalData)||999,requestPagesize:60,viewPageSize:10,allowMultiSelect:!1,columns:ne(x),viewBehavior:"pagination"}],dataSource:ae(x),eventsEmit:ie}),[x,a,o,L]);return Y(ke,{title:y,goBack:()=>{a==null||a("goBack",{})},children:[N(Ke,{ref:g,status:P,CustomComponents:{...h},...U},"table-data"),u&&N(dt,{drawerVisible:s,tableId:n,handleDrawerClose:se,rowData:u})]})}export{Et as default};
|
|
6
|
+
*/const Qe=ze("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]),pe=F.createContext({});pe.Consumer;var ve=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,i=Object.getOwnPropertySymbols(t);o<i.length;o++)e.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(t,i[o])&&(n[i[o]]=t[i[o]]);return n};const Ze=t=>{var{prefixCls:e,className:n,avatar:i,title:o,description:p}=t,$=ve(t,["prefixCls","className","avatar","title","description"]);const{getPrefixCls:y}=de(ge),h=y("list",e),a=G(`${h}-item-meta`,n),d=F.createElement("div",{className:`${h}-item-meta-content`},o&&F.createElement("h4",{className:`${h}-item-meta-title`},o),p&&F.createElement("div",{className:`${h}-item-meta-description`},p));return F.createElement("div",Object.assign({},$,{className:a}),i&&F.createElement("div",{className:`${h}-item-meta-avatar`},i),(o||p)&&d)},et=F.forwardRef((t,e)=>{const{prefixCls:n,children:i,actions:o,extra:p,styles:$,className:y,classNames:h,colStyle:a}=t,d=ve(t,["prefixCls","children","actions","extra","styles","className","classNames","colStyle"]),{grid:s,itemLayout:r}=de(pe),{getPrefixCls:g,list:u}=de(ge),D=I=>{var v,A;return G((A=(v=u==null?void 0:u.item)===null||v===void 0?void 0:v.classNames)===null||A===void 0?void 0:A[I],h==null?void 0:h[I])},x=I=>{var v,A;return Object.assign(Object.assign({},(A=(v=u==null?void 0:u.item)===null||v===void 0?void 0:v.styles)===null||A===void 0?void 0:A[I]),$==null?void 0:$[I])},O=()=>{let I=!1;return $e.forEach(i,v=>{typeof v=="string"&&(I=!0)}),I&&$e.count(i)>1},L=()=>r==="vertical"?!!p:!O(),S=g("list",n),P=o&&o.length>0&&F.createElement("ul",{className:G(`${S}-item-action`,D("actions")),key:"actions",style:x("actions")},o.map((I,v)=>F.createElement("li",{key:`${S}-item-action-${v}`},I,v!==o.length-1&&F.createElement("em",{className:`${S}-item-action-split`})))),q=s?"div":"li",R=F.createElement(q,Object.assign({},d,s?{}:{ref:e},{className:G(`${S}-item`,{[`${S}-item-no-flex`]:!L()},y)}),r==="vertical"&&p?[F.createElement("div",{className:`${S}-item-main`,key:"content"},i,P),F.createElement("div",{className:G(`${S}-item-extra`,D("extra")),key:"extra",style:x("extra")},p)]:[i,P,Fe(p,{key:"extra"})]);return s?F.createElement(ue,{ref:e,flex:1,style:a},R):R}),Ee=et;Ee.Meta=Ze;const tt=t=>{const{listBorderedCls:e,componentCls:n,paddingLG:i,margin:o,itemPaddingSM:p,itemPaddingLG:$,marginLG:y,borderRadiusLG:h}=t,a=E(t.calc(h).sub(t.lineWidth).equal());return{[e]:{border:`${E(t.lineWidth)} ${t.lineType} ${t.colorBorder}`,borderRadius:h,[`${n}-header`]:{borderRadius:`${a} ${a} 0 0`},[`${n}-footer`]:{borderRadius:`0 0 ${a} ${a}`},[`${n}-header,${n}-footer,${n}-item`]:{paddingInline:i},[`${n}-pagination`]:{margin:`${E(o)} ${E(y)}`}},[`${e}${n}-sm`]:{[`${n}-item,${n}-header,${n}-footer`]:{padding:p}},[`${e}${n}-lg`]:{[`${n}-item,${n}-header,${n}-footer`]:{padding:$}}}},at=t=>{const{componentCls:e,screenSM:n,screenMD:i,marginLG:o,marginSM:p,margin:$}=t;return{[`@media screen and (max-width:${i}px)`]:{[e]:{[`${e}-item`]:{[`${e}-item-action`]:{marginInlineStart:o}}},[`${e}-vertical`]:{[`${e}-item`]:{[`${e}-item-extra`]:{marginInlineStart:o}}}},[`@media screen and (max-width: ${n}px)`]:{[e]:{[`${e}-item`]:{flexWrap:"wrap",[`${e}-action`]:{marginInlineStart:p}}},[`${e}-vertical`]:{[`${e}-item`]:{flexWrap:"wrap-reverse",[`${e}-item-main`]:{minWidth:t.contentWidth},[`${e}-item-extra`]:{margin:`auto auto ${E($)}`}}}}}},nt=t=>{const{componentCls:e,antCls:n,controlHeight:i,minHeight:o,paddingSM:p,marginLG:$,padding:y,itemPadding:h,colorPrimary:a,itemPaddingSM:d,itemPaddingLG:s,paddingXS:r,margin:g,colorText:u,colorTextDescription:D,motionDurationSlow:x,lineWidth:O,headerBg:L,footerBg:S,emptyTextPadding:P,metaMarginBottom:q,avatarMarginRight:R,titleMarginBottom:I,descriptionFontSize:v}=t;return{[e]:Object.assign(Object.assign({},_e(t)),{position:"relative","--rc-virtual-list-scrollbar-bg":t.colorSplit,"*":{outline:"none"},[`${e}-header`]:{background:L},[`${e}-footer`]:{background:S},[`${e}-header, ${e}-footer`]:{paddingBlock:p},[`${e}-pagination`]:{marginBlockStart:$,[`${n}-pagination-options`]:{textAlign:"start"}},[`${e}-spin`]:{minHeight:o,textAlign:"center"},[`${e}-items`]:{margin:0,padding:0,listStyle:"none"},[`${e}-item`]:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:h,color:u,[`${e}-item-meta`]:{display:"flex",flex:1,alignItems:"flex-start",maxWidth:"100%",[`${e}-item-meta-avatar`]:{marginInlineEnd:R},[`${e}-item-meta-content`]:{flex:"1 0",width:0,color:u},[`${e}-item-meta-title`]:{margin:`0 0 ${E(t.marginXXS)} 0`,color:u,fontSize:t.fontSize,lineHeight:t.lineHeight,"> a":{color:u,transition:`all ${x}`,"&:hover":{color:a}}},[`${e}-item-meta-description`]:{color:D,fontSize:v,lineHeight:t.lineHeight}},[`${e}-item-action`]:{flex:"0 0 auto",marginInlineStart:t.marginXXL,padding:0,fontSize:0,listStyle:"none","& > li":{position:"relative",display:"inline-block",padding:`0 ${E(r)}`,color:D,fontSize:t.fontSize,lineHeight:t.lineHeight,textAlign:"center","&:first-child":{paddingInlineStart:0}},[`${e}-item-action-split`]:{position:"absolute",insetBlockStart:"50%",insetInlineEnd:0,width:O,height:t.calc(t.fontHeight).sub(t.calc(t.marginXXS).mul(2)).equal(),transform:"translateY(-50%)",backgroundColor:t.colorSplit}}},[`${e}-empty`]:{padding:`${E(y)} 0`,color:D,fontSize:t.fontSizeSM,textAlign:"center"},[`${e}-empty-text`]:{padding:P,color:t.colorTextDisabled,fontSize:t.fontSize,textAlign:"center"},[`${e}-item-no-flex`]:{display:"block"}}),[`${e}-grid ${n}-col > ${e}-item`]:{display:"block",maxWidth:"100%",marginBlockEnd:g,paddingBlock:0,borderBlockEnd:"none"},[`${e}-vertical ${e}-item`]:{alignItems:"initial",[`${e}-item-main`]:{display:"block",flex:1},[`${e}-item-extra`]:{marginInlineStart:$},[`${e}-item-meta`]:{marginBlockEnd:q,[`${e}-item-meta-title`]:{marginBlockStart:0,marginBlockEnd:I,color:u,fontSize:t.fontSizeLG,lineHeight:t.lineHeightLG}},[`${e}-item-action`]:{marginBlockStart:y,marginInlineStart:"auto","> li":{padding:`0 ${E(y)}`,"&:first-child":{paddingInlineStart:0}}}},[`${e}-split ${e}-item`]:{borderBlockEnd:`${E(t.lineWidth)} ${t.lineType} ${t.colorSplit}`,"&:last-child":{borderBlockEnd:"none"}},[`${e}-split ${e}-header`]:{borderBlockEnd:`${E(t.lineWidth)} ${t.lineType} ${t.colorSplit}`},[`${e}-split${e}-empty ${e}-footer`]:{borderTop:`${E(t.lineWidth)} ${t.lineType} ${t.colorSplit}`},[`${e}-loading ${e}-spin-nested-loading`]:{minHeight:i},[`${e}-split${e}-something-after-last-item ${n}-spin-container > ${e}-items > ${e}-item:last-child`]:{borderBlockEnd:`${E(t.lineWidth)} ${t.lineType} ${t.colorSplit}`},[`${e}-lg ${e}-item`]:{padding:s},[`${e}-sm ${e}-item`]:{padding:d},[`${e}:not(${e}-vertical)`]:{[`${e}-item-no-flex`]:{[`${e}-item-action`]:{float:"right"}}}}},it=t=>({contentWidth:220,itemPadding:`${E(t.paddingContentVertical)} 0`,itemPaddingSM:`${E(t.paddingContentVerticalSM)} ${E(t.paddingContentHorizontal)}`,itemPaddingLG:`${E(t.paddingContentVerticalLG)} ${E(t.paddingContentHorizontalLG)}`,headerBg:"transparent",footerBg:"transparent",emptyTextPadding:t.padding,metaMarginBottom:t.padding,avatarMarginRight:t.padding,titleMarginBottom:t.paddingSM,descriptionFontSize:t.fontSize}),st=Me("List",t=>{const e=Te(t,{listBorderedCls:`${t.componentCls}-bordered`,minHeight:t.controlHeightLG});return[nt(e),tt(e),at(e)]},it);var ot=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,i=Object.getOwnPropertySymbols(t);o<i.length;o++)e.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(t,i[o])&&(n[i[o]]=t[i[o]]);return n};function rt(t,e){const{pagination:n=!1,prefixCls:i,bordered:o=!1,split:p=!0,className:$,rootClassName:y,style:h,children:a,itemLayout:d,loadMore:s,grid:r,dataSource:g=[],size:u,header:D,footer:x,loading:O=!1,rowKey:L,renderItem:S,locale:P}=t,q=ot(t,["pagination","prefixCls","bordered","split","className","rootClassName","style","children","itemLayout","loadMore","grid","dataSource","size","header","footer","loading","rowKey","renderItem","locale"]),R=n&&typeof n=="object"?n:{},[I,v]=f.useState(R.defaultCurrent||1),[A,te]=f.useState(R.defaultPageSize||10),{getPrefixCls:ae,direction:ne,className:ie,style:se}=Oe("list"),{renderEmpty:U}=f.useContext(ge),l={current:1,total:0,position:"bottom"},c=C=>(_,W)=>{var le;v(_),te(W),n&&((le=n==null?void 0:n[C])===null||le===void 0||le.call(n,_,W))},b=c("onChange"),M=c("onShowSizeChange"),H=(C,_)=>{if(!S)return null;let W;return typeof L=="function"?W=L(C):L?W=C[L]:W=C.key,W||(W=`list-item-${_}`),f.createElement(f.Fragment,{key:W},S(C,_))},T=!!(s||n||x),m=ae("list",i),[V,B,z]=st(m);let j=O;typeof j=="boolean"&&(j={spinning:j});const J=!!(j!=null&&j.spinning),K=Ae(u);let X="";switch(K){case"large":X="lg";break;case"small":X="sm";break}const Q=G(m,{[`${m}-vertical`]:d==="vertical",[`${m}-${X}`]:X,[`${m}-split`]:p,[`${m}-bordered`]:o,[`${m}-loading`]:J,[`${m}-grid`]:!!r,[`${m}-something-after-last-item`]:T,[`${m}-rtl`]:ne==="rtl"},ie,$,y,B,z),w=je(l,{total:g.length,current:I,pageSize:A},n||{}),De=Math.ceil(w.total/w.pageSize);w.current=Math.min(w.current,De);const fe=n&&f.createElement("div",{className:G(`${m}-pagination`)},f.createElement(Xe,Object.assign({align:"end"},w,{onChange:b,onShowSizeChange:M})));let oe=ye(g);n&&g.length>(w.current-1)*w.pageSize&&(oe=ye(g).splice((w.current-1)*w.pageSize,w.pageSize));const we=Object.keys(r||{}).some(C=>["xs","sm","md","lg","xl","xxl"].includes(C)),he=Re(we),Z=f.useMemo(()=>{for(let C=0;C<be.length;C+=1){const _=be[C];if(he[_])return _}},[he]),Ie=f.useMemo(()=>{if(!r)return;const C=Z&&r[Z]?r[Z]:r.column;if(C)return{width:`${100/C}%`,maxWidth:`${100/C}%`}},[JSON.stringify(r),Z]);let re=J&&f.createElement("div",{style:{minHeight:53}});if(oe.length>0){const C=oe.map(H);re=r?f.createElement(xe,{gutter:r.gutter},f.Children.map(C,_=>f.createElement("div",{key:_==null?void 0:_.key,style:Ie},_))):f.createElement("ul",{className:`${m}-items`},C)}else!a&&!J&&(re=f.createElement("div",{className:`${m}-empty-text`},(P==null?void 0:P.emptyText)||(U==null?void 0:U("List"))||f.createElement(He,{componentName:"List"})));const ee=w.position,Be=f.useMemo(()=>({grid:r,itemLayout:d}),[JSON.stringify(r),d]);return V(f.createElement(pe.Provider,{value:Be},f.createElement("div",Object.assign({ref:e,style:Object.assign(Object.assign({},se),h),className:Q},q),(ee==="top"||ee==="both")&&fe,D&&f.createElement("div",{className:`${m}-header`},D),f.createElement(Ue,Object.assign({},j),re,a),x&&f.createElement("div",{className:`${m}-footer`},x),s||(ee==="bottom"||ee==="both")&&fe)))}const lt=f.forwardRef(rt),me=lt;me.Item=Ee;const ct=({url:t,token:e,role:n,eventsEmit:i})=>{const o=qe.create({baseURL:t,timeout:1e6});return o.interceptors.request.use(a=>{let d=e;return!d&&!["user/login","user/kaptcha","user/regist"].some(r=>a.url.includes(r))?(i&&i("request:error_auth",{errorMsg:"\u672A\u767B\u5F55\u6216token\u5DF2\u8FC7\u671F",redirect:"/login"}),Promise.reject(new Error("\u672A\u767B\u5F55\u6216token\u5DF2\u8FC7\u671F"))):(a.headers.Authorization=d||"",a.headers.userName=n==="\u672A\u767B\u5F55\u7528\u6237"?"":n,a)}),o.interceptors.response.use(a=>{const d=["user/kaptcha"],s=a.data;if(d.some(D=>a.config.url&&a.config.url.includes(D))||s.size&&s.type)return s;const{success:r,errorMsg:g,errorCode:u}=s;return r?s:(i&&i("request:error_business",{errorCode:u,errorMsg:g||"\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",response:s}),!1)},a=>{var d,s,r,g,u,D,x,O,L;if(a.message==="canceled")return Promise.reject(a);if(i){let S="request:error_network",P={errorMsg:"\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25",error:a};((d=a==null?void 0:a.response)==null?void 0:d.status)===401?(S="request:error_auth",P={errorMsg:"\u6CA1\u6709\u8DB3\u591F\u6743\u9650",error:a,redirect:"/login"}):(((r=(s=a==null?void 0:a.response)==null?void 0:s.data)==null?void 0:r.errorCode)==="30013"||((u=(g=a==null?void 0:a.response)==null?void 0:g.data)==null?void 0:u.errorCode)==="30023")&&(S="request:error_business",P={errorCode:(x=(D=a==null?void 0:a.response)==null?void 0:D.data)==null?void 0:x.errorCode,errorMsg:((L=(O=a==null?void 0:a.response)==null?void 0:O.data)==null?void 0:L.errorMsg)||"\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",error:a}),i(S,P)}return Promise.reject(a)}),{getTableDataList:async({dbId:a,name:d,params:s})=>{try{const r=await o.get(`/directDB/queryTableData/${a}/${d}?${new URLSearchParams(s).toString()}`),{success:g,data:u}=r;if(g)return u}catch(r){return console.log("getTableDataList error:",r),!1}},updateTableData:async(a,d)=>{try{const s=await o.post(`/dataTable/dataUpdateRow/${a}`,{...d}),{success:r,data:g}=s;if(r)return g}catch(s){return console.log("updateTableData error:",s),!1}},delTableDataById:async({tableId:a,rowId:d})=>{try{const s=await o.delete(`/dataTable/dataDeleteRow/${a}/${d}`),{success:r,data:g}=s;if(r)return g}catch(s){console.log("delTableDataById error:",s)}},getFileDataList:async({fileId:a,params:d})=>{try{const s=await o.get(`/dataTable/queryTableFileData/${a}?${new URLSearchParams(d).toString()}`),{success:r,data:g}=s;return r?g:!1}catch(s){return console.log("e",s),!1}}}},dt=({drawerVisible:t,handleDrawerClose:e,rowData:n})=>{const[i,o]=k(n.data),[p,$]=k(null),[y,h]=k(""),a=s=>{h(s.value),$(s.columnId)},d=s=>{y.trim()&&(o(i.map(r=>r.columnId===s?{...r,value:y}:r)),$(null))};return Y(Ve,{title:"\u5217\u6570\u503C\u4FEE\u6539",placement:"right",width:840,onClose:()=>e("cancel"),open:t,closeIcon:!1,extra:N(Je,{size:20,color:"#888888",onClick:()=>e("cancel"),className:"cursor-pointer"}),footer:Y("div",{className:"flex justify-end items-center gap-3",style:{justifyContent:"end"},children:[N(Se,{mode:"default",label:"\u53D6\u6D88",onClick:()=>e("cancel")}),N(Se,{mode:"primary",label:"\u786E\u8BA4",onClick:async()=>{await e("confirm",i)}})]}),children:[Y(xe,{gutter:16,style:{padding:"12px 18px",background:"#fafafa",borderBottom:"1px solid #f0f0f0",fontWeight:"bold"},children:[N(ue,{span:4,children:"\u5217\u540D\u79F0"}),N(ue,{span:20,children:"\u6570\u503C"})]}),N(me,{dataSource:i,renderItem:s=>N(me.Item,{actions:[p!==s.columnId&&N(ke,{type:"text",icon:N(Qe,{size:14}),onClick:()=>a(s)})],children:Y("div",{style:{display:"flex",width:"100%",height:"54px",lineHeight:"54px"},children:[N("div",{style:{width:"150px",marginLeft:15},children:s.columnName}),N("div",{style:{width:"550px"},children:p===s.columnId?N(We,{value:y,onChange:r=>h(r.target.value),onPressEnter:()=>d(s.columnId),onBlur:()=>d(s.columnId)}):N("div",{className:"w-full truncate",title:s.value,children:s.value})})]})})})]})},{confirm:ut}=Ye;function Et({url:t,token:e,fileId:n,role:i,dbType:o,dbId:p,tableId:$,tableName:y,CustomComponents:h,eventsEmit:a,getBtnDisabled:d}){const[s,r]=k(!1),g=Le(null),[u,D]=k(),[x,O]=k(),[L,S]=k(),[P,q]=k({app:"ready",container:"ready",content:"ready"}),{getTableDataList:R,updateTableData:I,delTableDataById:v,getFileDataList:A}=ct({url:t,token:e,role:i,eventsEmit:a});Ne(()=>{q(l=>({...l,content:"loading"})),te()},[]);const te=async()=>{try{if(o=="DirectDB"){const l=await R({dbId:p,name:y,params:{pageNo:1,pageSize:60}});l&&(l.columns=((l==null?void 0:l.columns)||[]).map(c=>({...c,id:c.id||ce(4)})),l.dataList=(l.dataList||[]).map((c,b)=>({...c,__absIndex:b})),O(l),S(l.permission),q(c=>({...c,content:"ready"})))}else{const l=await A({fileId:n,params:{pageNo:1,pageSize:60}});l&&(l.dataList=(l.dataList||[]).map((c,b)=>({...c,__absIndex:b})),l.columns=((l==null?void 0:l.columns)||[]).map(c=>({...c,id:c.id||ce(4)})),O(l),S(l.permission),q(c=>({...c,content:"ready"})))}}catch(l){console.log("[DatabaseApiError] getDataList:",l)}},ae=l=>((l==null?void 0:l.dataList)||[]).map(b=>{const H=((l==null?void 0:l.columns)||[]).filter(T=>T.physicalName!=="id").map(T=>({columnId:T.id,columnName:T.businessName,physicalName:T.physicalName,value:b[T.physicalName]||"-",type:b.dataType=="DATETIME"?"date":"paragraph"}));return o=="DataTable"&&H.push({columnId:"actions",value:"edit",label:"\u4FEE\u6539",disabled:d&&d(7,L)},{columnId:"actions",value:"delete",label:"\u5220\u9664",disabled:d&&d(4,L)}),{id:b.id,data:H,__absIndex:b.__absIndex}}),ne=l=>{const b=((l==null?void 0:l.columns)||[]).filter(M=>M.physicalName!=="id").map(M=>({title:o=="DirectDB"?M.physicalName:M.businessName,id:M.id,type:M.dataType=="DATETIME"?"date":"paragraph"}));return o=="DataTable"&&b.push({id:"actions",title:"\u64CD\u4F5C",type:"action"}),b},ie=async(l,c,b)=>{var M,H;switch(console.log("[DatabaseTableView] eventsEmit:",l,c,b),l){case"pagination:request_merge_data":{try{const m=(M=c==null?void 0:c.request)==null?void 0:M.pageNo,V=(H=c==null?void 0:c.request)==null?void 0:H.pageSize;if(!m||!V)return;let B;o=="DirectDB"?B=await R({dbId:p,name:y,params:{pageNo:m,pageSize:V}}):B=await A({fileId:n,params:{pageNo:m,pageSize:V}}),B&&(B.dataList=(B.dataList||[]).map((z,j)=>({...z,__absIndex:(m-1)*V+j})),B.columns=((B==null?void 0:B.columns)||[]).map(z=>({...z,id:z.id||ce(4)})),O(z=>{var Q;if(!z)return B;const j=Array.isArray(z.dataList)?z.dataList:[],J=Array.isArray(B.dataList)?B.dataList:[],K=new Map;j.forEach(w=>K.set(w.id,w)),J.forEach(w=>K.set(w.id,w));const X=Array.from(K.values());return{...z,dataList:X,total:z.total??B.total,columns:(Q=z.columns)!=null&&Q.length?z.columns:B.columns}}))}catch(m){console.log("[DatabaseApiError] pagination:request_merge_data:",m)}break}case"table_action_edit":r(!0);const T=(c.data||[]).filter(m=>m.columnId!=="actions");D({id:c.id,data:T});break;case"table_action_delete":try{ut({title:"\u786E\u8BA4\u5220\u9664\u6570\u636E\uFF1F",content:"\u5220\u9664\u540E\uFF0C\u8BE5\u6570\u636E\u5C06\u65E0\u6CD5\u6062\u590D",okText:"\u5220\u9664",cancelText:"\u53D6\u6D88",async onOk(){await v({tableId:$,rowId:c.id})&&(Ce.success("\u8868\u6570\u636E\u5220\u9664\u6210\u529F"),b.removeItem(c.id))},onCancel(){console.log("Cancel")}})}catch{console.log("\u5220\u9664\u8868\u6570\u636E\u5931\u8D25")}break;default:a==null||a(l,c);break}},se=async(l,c)=>{if(l=="confirm")try{const b=c.reduce((H,T)=>(H[T.physicalName]=T.value,H),{});await I($,{...b,id:u==null?void 0:u.id})&&g.current&&(Ce.success("\u6570\u636E\u4FEE\u6539\u6210\u529F"),g.current.appFn.updateItem(c,u==null?void 0:u.id))}catch(b){console.log("[TableRowApiError] updateTableData:",b)}r(!1),D(void 0)},U=Pe(()=>({label:"\u6570\u636E\u5E93\u8868\u683C",defaultActiveId:"database-table",model:null,views:[{label:"\u6570\u636E\u8868\u540D\u79F0",id:"database-table",type:"table",total:(x==null?void 0:x.totalData)||999,requestPagesize:60,viewPageSize:10,allowMultiSelect:!1,columns:ne(x),viewBehavior:"pagination"}],dataSource:ae(x),eventsEmit:ie}),[x,a,o,L]);return Y(Ge,{title:y,goBack:()=>{a==null||a("goBack",{})},children:[N(Ke,{ref:g,status:P,CustomComponents:{...h},...U},"table-data"),u&&N(dt,{drawerVisible:s,tableId:n,handleDrawerClose:se,rowData:u})]})}export{Et as default};
|
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DrawerType as y}from"./chat.js";import"./database.js";import"./assets/index-
|
|
1
|
+
import{DrawerType as y}from"./chat.js";import"./database.js";import"./assets/index-BH8au9G9.js";import"./databaseTable.js";import"react/jsx-runtime";import"react";import"./modelManage.js";import"./sensitive.js";import{G as F,B as P}from"./assets/GientechStreamReader-BafFiNMI.js";import"./assets/index-CCjG4bD0.js";import{i as S}from"./assets/index-BbHMAb8g.js";import"./assets/index-fhKUis2J.js";import"react-dom";import"./assets/index-BbpyNfEd.js";import"./assets/index-CPOAXITM.js";import"./assets/index-Wjs4Vb6x.js";import"./assets/index-CpW6Dhpp.js";/* empty css */import"./assets/style-CNIDlcUL.js";import"./assets/plus-Dmpl3gd8.js";import"./assets/x-BjRa5XLp.js";import"./assets/index-DnJqVq9Q.js";import"./assets/index-CuySCBtZ.js";import"./assets/index-Dkwp9YpO.js";export{y as DrawerType,F as GientechStreamReader,S as defaultTheme,P as registerPDFWorker};
|