@gientech/modual 2.0.11 → 2.1.1
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-DybWMK4d.js → GientechStreamReader-AvqfscDM.js} +2 -2
- package/assets/{index-D9lYd8TZ.js → index-B3zi0w0x.js} +1 -1
- package/assets/{index-B1ZDDbC1.js → index-BB1f6JnZ.js} +1 -1
- package/assets/{index-DYhXjvk4.js → index-BDoDq_qz.js} +1 -1
- package/assets/index-BRq6VK9v.js +285 -0
- package/assets/{index-s0cmC4Ks.js → index-BfDZSwG3.js} +1 -1
- package/assets/index-CJZ9OITS.js +1403 -0
- package/assets/{index-S4W4X-HN.js → index-CUWsjoSm.js} +1 -1
- package/assets/{index-CBTA5S-5.js → index-DKwGCqM2.js} +1 -1
- package/assets/{index-NFQIKNFn.js → index-DNMf-zgr.js} +1 -1
- package/assets/{index-CN2AYX8Q.js → index-md7-ni21.js} +1 -1
- package/assets/{plus-G7zGXf6S.js → plus-CldFV1Lg.js} +1 -1
- package/assets/style-BXl32bWg.js +16 -0
- package/assets/style.css +1 -1
- package/assets/{x-vfKYzKkK.js → x-D-pV1NCt.js} +1 -1
- package/assistantConfig.js +1 -1
- package/chat.js +2 -2
- package/database.js +1 -1
- package/databaseId.js +1 -1
- package/databaseTable.js +1 -1
- 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-D0DDewJ2.js +0 -1398
- package/assets/index-LDFwTu47.js +0 -280
- package/assets/style-Bn7b5XHU.js +0 -21
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var zn=Object.defineProperty;var Sn=m=>{throw TypeError(m)};var Gn=(m,a,A)=>a in m?zn(m,a,{enumerable:!0,configurable:!0,writable:!0,value:A}):m[a]=A;var ee=(m,a,A)=>Gn(m,typeof a!="symbol"?a+"":a,A),an=(m,a,A)=>a.has(m)||Sn("Cannot "+A);var R=(m,a,A)=>(an(m,a,"read from private field"),A?A.call(m):a.get(m)),Ot=(m,a,A)=>a.has(m)?Sn("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(m):a.set(m,A),It=(m,a,A,f)=>(an(m,a,"write to private field"),f?f.call(m,A):a.set(m,A),A),Dt=(m,a,A)=>(an(m,a,"access private method"),A);var on=(m,a,A,f)=>({set _(_){It(m,a,_,A)},get _(){return R(m,a,f)}});import{jsxs,jsx,Fragment}from"react/jsx-runtime";import React__default,{forwardRef,createElement,useState,useRef,useEffect,useCallback,useMemo}from"react";import{a as createLucideIcon,a7 as getAugmentedNamespace,d as dt$1,b as axios}from"./index-
|
|
1
|
+
var zn=Object.defineProperty;var Sn=m=>{throw TypeError(m)};var Gn=(m,a,A)=>a in m?zn(m,a,{enumerable:!0,configurable:!0,writable:!0,value:A}):m[a]=A;var ee=(m,a,A)=>Gn(m,typeof a!="symbol"?a+"":a,A),an=(m,a,A)=>a.has(m)||Sn("Cannot "+A);var R=(m,a,A)=>(an(m,a,"read from private field"),A?A.call(m):a.get(m)),Ot=(m,a,A)=>a.has(m)?Sn("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(m):a.set(m,A),It=(m,a,A,f)=>(an(m,a,"write to private field"),f?f.call(m,A):a.set(m,A),A),Dt=(m,a,A)=>(an(m,a,"access private method"),A);var on=(m,a,A,f)=>({set _(_){It(m,a,_,A)},get _(){return R(m,a,f)}});import{jsxs,jsx,Fragment}from"react/jsx-runtime";import React__default,{forwardRef,createElement,useState,useRef,useEffect,useCallback,useMemo}from"react";import{a as createLucideIcon,a7 as getAugmentedNamespace,d as dt$1,b as axios}from"./index-BRq6VK9v.js";import{L as L6,X as Xs}from"./index-CJZ9OITS.js";import{c as ChevronRight}from"./index-md7-ni21.js";import{X}from"./x-D-pV1NCt.js";/**
|
|
2
2
|
* @license lucide-react v0.456.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -167,7 +167,7 @@ var zn=Object.defineProperty;var Sn=m=>{throw TypeError(m)};var Gn=(m,a,A)=>a in
|
|
|
167
167
|
0% { transform: rotate(0deg); }
|
|
168
168
|
100% { transform: rotate(360deg); }
|
|
169
169
|
}
|
|
170
|
-
`))},We=(m,a)=>{var A,f,_,V,q;console.log("=== Fviewer renderTextContent ==="),console.log("data:",m),console.log("data.content:",m.content);let Y="";typeof m.content=="string"?Y=m.content:(A=m.content)!=null&&A.text?Y=m.content.text:(f=m.content)!=null&&f.content&&(Y=m.content.content),console.log("\u5B9E\u9645\u6587\u672C\u5185\u5BB9:",Y);const M=useRef(null),b=useRef(null);return useEffect(()=>{if(M.current&&b.current&&Y){const w=setTimeout(()=>{var P;const F=((P=M.current)==null?void 0:P.scrollHeight)||0,S=Math.max(F+80,200);b.current&&(b.current.style.minHeight=`${S}px`,console.log("\u6587\u672C\u7EB8\u5F20\u9AD8\u5EA6\u8C03\u6574\u5B8C\u6210:",S))},100);return()=>clearTimeout(w)}},[Y]),React__default.createElement("div",{style:{height:"100%",overflow:"auto",backgroundColor:"#f5f5f5",padding:"20px",display:"flex",justifyContent:"center",position:"relative"}},React__default.createElement("div",{ref:b,style:{width:"100%",maxWidth:"800px",backgroundColor:"white",boxShadow:"0 4px 8px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06)",borderRadius:"8px",padding:"40px",margin:"20px 0",position:"relative",transform:`scale(${a.scale||1})`,transition:"transform 0.2s ease-in-out",transformOrigin:"top center"}},React__default.createElement("div",{ref:M,style:{width:"100%",overflow:"visible"}},React__default.createElement(j6,{dataSource:{type:Xs.TEXT,content:Y},size:"md",theme:{primaryColor:((q=(V=(_=a.styles)==null?void 0:_.theme)==null?void 0:V.colors)==null?void 0:q.primary)||"#007bff",backgroundColor:"transparent",textColor:"#333",borderColor:"transparent",borderRadius:"0",padding:"0"},style:{border:"none",background:"transparent",width:"100%",height:"auto",overflow:"visible"}})),React__default.createElement("div",{style:{position:"absolute",top:"0",left:"0",right:"0",height:"2px",background:"linear-gradient(90deg, #e0e0e0 0%, #f0f0f0 50%, #e0e0e0 100%)",borderTopLeftRadius:"8px",borderTopRightRadius:"8px"}})))},je=({data:m,parentProps:a,isTableMode:A=!1})=>{var f,_,V,q,Y,M,b,w,P,F,S,c;const t=useRef(null),s=useRef(null),o=useRef(null),v=useRef(!1);useRef(0),useRef(null);const[g]=useState(!1),l=(N,U)=>{console.log("=== Markdownit\u6EDA\u52A8\u4E8B\u4EF6\u89E6\u53D1 ==="),console.log("\u6EDA\u52A8\u4F4D\u7F6E:",{scrollTop:N,scrollHeight:U}),a.eventsEmit&&a.eventsEmit("markdown_scroll",{scrollTop:N,scrollHeight:U})},n=()=>{console.log("=== Markdownit\u6EDA\u52A8\u5230\u9876\u90E8 ==="),a.eventsEmit&&a.eventsEmit("markdown_scroll_to_top")},r=()=>{console.log("=== Markdownit\u6EDA\u52A8\u5230\u5E95\u90E8 ==="),a.eventsEmit&&a.eventsEmit("markdown_scroll_to_bottom")},e=useRef();e.current=N=>{var U,G;try{if(!A)return;const bt=typeof m.content=="string"?m.content:((U=m.content)==null?void 0:U.content)||"";if(!bt||O.length===0)return;const wt=JSON.stringify(O.map(H=>({o:H.offsets,c:H.color}))),Mt=`${bt.length}:${bt.substring(0,64)}:${bt.substring(bt.length-64)}|${wt}`;if(((G=N.dataset)==null?void 0:G.tableAnnoRuntimeSig)===Mt)return;setTimeout(()=>{pt(),N.dataset&&(N.dataset.tableAnnoRuntimeSig=Mt)},50)}catch(bt){console.warn("[MarkdownRendered] apply failed",bt)}};const E=React__default.useCallback(N=>{var U;return(U=e.current)==null?void 0:U.call(e,N)},[]),x=useCallback(()=>{var N;if(!g||!t.current)return;const U=window.getSelection();if(!U||U.isCollapsed)return;const G=U.getRangeAt(0),bt=G.toString().trim();if(!bt)return;const wt=t.current;let Mt=0,H=0;const h=document.createTreeWalker(wt,NodeFilter.SHOW_TEXT,{acceptNode:I=>{var $;return($=I.parentElement)!=null&&$.closest("pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}});let u=h.nextNode();for(;u;){if(u===G.startContainer){H=Mt+G.startOffset;break}Mt+=((N=u.textContent)==null?void 0:N.length)||0,u=h.nextNode()}console.log("\u9009\u4E2D\u6587\u672C\u4FE1\u606F:",{text:bt,startOffset:H,charCount:Mt,container:G.startContainer.textContent});const T={id:`md-anno-${Date.now()}`,start:H,end:H+bt.length,color:"#FFE599"};console.log("\u521B\u5EFA\u65B0\u6807\u6CE8:",T),a.eventsEmit&&a.eventsEmit("md_annotation_add",T),U.removeAllRanges()},[g,a.eventsEmit]),L=A?[]:(a.annotationData||[]).filter(N=>"start"in N&&"end"in N&&!("pageNumber"in N)),O=A?(a.annotationData||[]).filter(N=>"offsets"in N&&Array.isArray(N.offsets)):[],yt=useCallback(()=>{if(console.log("=== \u5F00\u59CB\u6E05\u7A7A\u6240\u6709\u6807\u6CE8 ==="),!t.current){console.log("markdownRef\u4E0D\u5B58\u5728\uFF0C\u65E0\u6CD5\u6E05\u7A7A\u6807\u6CE8");return}const N=t.current.querySelectorAll(".md-annotation");console.log("\u6E05\u7A7AMarkdown\u6807\u6CE8\u6570\u91CF:",N.length),N.length>0&&N.forEach(U=>{const G=U.parentNode;G&&G.replaceChild(document.createTextNode(U.textContent||""),U)}),console.log("\u6240\u6709\u6807\u6CE8\u5DF2\u6E05\u7A7A")},[]),St=useCallback(()=>{t.current&&(t.current.querySelectorAll("table").forEach(N=>{Array.from(N.rows).forEach(U=>{Array.from(U.cells).forEach(G=>{G.getAttribute("data-table-annotated")==="1"&&(G.style.removeProperty("background"),G.style.removeProperty("background-color"),G.removeAttribute("data-table-annotated"),G.removeAttribute("title"))})})}),console.log("\u5DF2\u6E05\u7A7A\u6240\u6709\u8868\u683C\u6807\u6CE8"))},[]),pt=useCallback(()=>{if(console.log("=== \u5F00\u59CB\u5E94\u7528\u8868\u683C\u6807\u6CE8 ==="),console.log("tableAnnotations:",O),!t.current){console.log("markdownRef\u4E0D\u5B58\u5728\uFF0C\u9000\u51FA");return}if(St(),!O.length){console.log("\u6CA1\u6709\u8868\u683C\u6807\u6CE8\u6570\u636E\uFF0C\u4EC5\u6E05\u7A7A\u65E7\u6807\u6CE8");return}const N=t.current.querySelectorAll("table");if(console.log("\u627E\u5230\u8868\u683C\u6570\u91CF:",N.length),N.length===0){console.log("\u6CA1\u6709\u627E\u5230\u8868\u683C\u5143\u7D20");return}v.current=!0,O.forEach((U,G)=>{const bt=U.offsets;if(console.log("\u5904\u7406\u8868\u683C\u6807\u6CE8:",U),!Array.isArray(bt)||!bt.length||!Array.isArray(bt[0])||bt[0].length!==2){console.warn("[TableAnnotation] annotation.offsets is not valid",U);return}bt.forEach((wt,Mt)=>{const[H,h]=wt;if(typeof H!="number"||typeof h!="number"){console.warn("[TableAnnotation] offset is not [number, number]",wt);return}N.forEach((u,T)=>{var I;const $=Array.from(u.rows),W=$[H];if(!W){console.warn("[TableAnnotation] row out of range",{row:H,tableIndex:T,totalRows:$.length});return}const i=(I=W.cells)==null?void 0:I[h];if(!i){console.warn("[TableAnnotation] cell is undefined",{row:H,col:h,tableIndex:T});return}const d=U.color||"rgba(255, 229, 153, 0.5)",C=getComputedStyle(i).backgroundColor;i.getAttribute("data-table-annotated")==="1"&&(C===d||i.style.backgroundColor===d)||(i.style.setProperty("background",d,"important"),i.style.setProperty("background-color",d,"important"),i.setAttribute("data-table-annotated","1")),U.content&&(i.title=U.content),Mt===0&&G===0&&setTimeout(()=>{i.scrollIntoView({behavior:"smooth",block:"start"})},300)})})}),requestAnimationFrame(()=>{v.current=!1})},[O,St]),K=useCallback(()=>{if(console.log("=== \u5F00\u59CB\u5E94\u7528Markdown\u6807\u6CE8 ==="),!t.current||!L.length){console.log("\u6761\u4EF6\u4E0D\u6EE1\u8DB3\uFF0C\u8DF3\u8FC7\u6807\u6CE8\u5E94\u7528");return}s.current&&clearTimeout(s.current);const N=()=>{var U;console.log("\u5F00\u59CB\u5E94\u7528\u6807\u6CE8...");const G=(U=t.current)==null?void 0:U.querySelectorAll(".md-annotation");console.log("\u79FB\u9664\u73B0\u6709\u6807\u6CE8\u6570\u91CF:",(G==null?void 0:G.length)||0),G==null||G.forEach(T=>{const I=T.parentNode;I&&I.replaceChild(document.createTextNode(T.textContent||""),T)});const bt=document.createTreeWalker(t.current,NodeFilter.SHOW_TEXT,{acceptNode:T=>{var I;return(I=T.parentElement)!=null&&I.closest("pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),wt=[];let Mt;for(;Mt=bt.nextNode();)wt.push(Mt);if(console.log("\u627E\u5230\u6587\u672C\u8282\u70B9\u6570\u91CF:",wt.length),wt.length===0){console.log("\u6CA1\u6709\u627E\u5230\u6587\u672C\u8282\u70B9\uFF0C\u5EF6\u8FDF\u91CD\u8BD5..."),s.current=setTimeout(()=>{N()},200);return}let H=0;const h=wt.map(T=>{var I;const $=H;return H+=((I=T.textContent)==null?void 0:I.length)||0,{node:T,start:$,end:H,text:T.textContent}});console.log("\u6587\u672C\u8282\u70B9\u4F4D\u7F6E:",h),console.log("\u603B\u6587\u672C\u957F\u5EA6:",H);const u=[...L].sort((T,I)=>I.start-T.start);console.log("\u6392\u5E8F\u540E\u7684\u6807\u6CE8:",u),u.forEach(T=>{const{start:I,end:$,color:W}=T;console.log("\u5904\u7406\u6807\u6CE8:",{annotation:T,nodePositions:h});const i=h.filter(d=>I<d.end&&$>d.start);console.log("\u76F8\u5173\u8282\u70B9\u6570\u91CF:",i.length),i.forEach(({node:d,start:C})=>{var y,k,j,D,p,B;const _t=Math.max(0,I-C),z=Math.min(((y=d.textContent)==null?void 0:y.length)||0,$-C);if(console.log("\u672C\u5730\u4F4D\u7F6E:",{localStart:_t,localEnd:z,nodeTextLength:(k=d.textContent)==null?void 0:k.length}),_t>=z){console.log("\u672C\u5730\u4F4D\u7F6E\u65E0\u6548\uFF0C\u8DF3\u8FC7");return}const Q=((j=d.textContent)==null?void 0:j.slice(0,_t))||"",At=((D=d.textContent)==null?void 0:D.slice(_t,z))||"",kt=((p=d.textContent)==null?void 0:p.slice(z))||"";console.log("\u5206\u5272\u6587\u672C:",{before:Q,annotatedText:At,after:kt});const Rt=document.createElement("span");Rt.className="md-annotation",Rt.style.backgroundColor=W||"#FFE599",Rt.textContent=At;const xt=document.createDocumentFragment();Q&&xt.appendChild(document.createTextNode(Q)),xt.appendChild(Rt),kt&&xt.appendChild(document.createTextNode(kt)),(B=d.parentNode)==null||B.replaceChild(xt,d),console.log("\u6210\u529F\u5E94\u7528\u6807\u6CE8:",At)})})};s.current=setTimeout(()=>{N()},100)},[L]);return useEffect(()=>{var N;if(A){console.log("[MarkdownContentView] table mode: skip effect, wait for onRendered");return}const U=typeof m.content=="string"?m.content:((N=m.content)==null?void 0:N.content)||"";if(!U||typeof U!="string"){console.log("Markdown\u5185\u5BB9\u4E0D\u662F\u5B57\u7B26\u4E32\u7C7B\u578B\uFF0C\u8DF3\u8FC7\u6807\u6CE8\u5E94\u7528");return}if(console.log("=== \u5F00\u59CB\u5E94\u7528Markdown\u6807\u6CE8\u9AD8\u4EAE ==="),console.log("markdownRef.current:",t.current),console.log("isTableMode:",A),console.log("mdAnnotations:",L),console.log("tableAnnotations:",O),console.log("data.content:",m.content),console.log("\u5B9E\u9645\u5185\u5BB9:",U),!t.current){console.log("markdownRef\u4E0D\u5B58\u5728\uFF0C\u9000\u51FA\u6807\u6CE8\u5E94\u7528");return}if(A||yt(),!A&&L.length>0){K();return}console.log("\u6CA1\u6709\u9700\u8981\u5E94\u7528\u7684\u6807\u6CE8")},[A,O,L]),useEffect(()=>{if(!A)return document.addEventListener("mouseup",x),()=>{document.removeEventListener("mouseup",x)}},[x,A]),useEffect(()=>{var N;const U=typeof m.content=="string"?m.content:((N=m.content)==null?void 0:N.content)||"";if(!U||typeof U!="string"){console.log("Markdown\u5185\u5BB9\u4E0D\u662F\u5B57\u7B26\u4E32\u7C7B\u578B\uFF0C\u8DF3\u8FC7\u8C03\u8BD5\u4FE1\u606F\u6253\u5370");return}console.log("=== Markdown\u5185\u5BB9\u4FE1\u606F ==="),console.log("isTableMode:",A),console.log("\u5185\u5BB9\u957F\u5EA6:",U.length||0),typeof U=="string"?(console.log("\u5185\u5BB9\u524D100\u5B57\u7B26:",U.substring(0,100)),console.log("\u5185\u5BB9\u540E100\u5B57\u7B26:",U.substring(U.length-100))):(console.log("\u5185\u5BB9\u4E0D\u662F\u5B57\u7B26\u4E32\u7C7B\u578B:",typeof U),console.log("\u5185\u5BB9\u503C:",U)),console.log("\u6807\u6CE8\u6570\u636E:",L),console.log("\u8868\u683C\u6807\u6CE8\u6570\u636E:",O)},[L,O,A]),useEffect(()=>{if(A&&t.current){const N=setTimeout(()=>{var U;const G=(U=t.current)==null?void 0:U.querySelectorAll("table");G&&G.length>0&&(console.log("\u8C03\u6574\u8868\u683C\u5C3A\u5BF8\uFF0C\u627E\u5230\u8868\u683C\u6570\u91CF:",G.length),G.forEach((bt,wt)=>{if(bt instanceof HTMLTableElement){bt.style.width="100%",bt.style.minWidth="100%",bt.style.tableLayout="auto";const Mt=bt.closest(".markdown-table-mode");Mt&&Mt instanceof HTMLElement&&(Mt.style.width="100%",Mt.style.overflowX="auto"),console.log(`\u8868\u683C ${wt+1} \u5C3A\u5BF8\u8C03\u6574\u5B8C\u6210`)}}))},500);return()=>clearTimeout(N)}},[A,m.content]),useEffect(()=>()=>{s.current&&clearTimeout(s.current),o.current&&(o.current.disconnect(),o.current=null)},[]),React__default.createElement("div",{style:{height:"100%",width:"100%",overflow:"auto"},className:`markdown-container markdown-scrollbar ${A?"markdown-table-mode":""}`},React__default.createElement("style",null,Le),React__default.createElement("div",{ref:t},React__default.createElement(j6,{dataSource:{type:Xs.MARKDOWN,content:(()=>{var N,U;return typeof m.content=="string"?m.content:(N=m.content)!=null&&N.text?m.content.text:(U=m.content)!=null&&U.content?m.content.content:""})()},size:"md",onScroll:A?void 0:l,onScrollToTop:A?void 0:n,onScrollToBottom:A?void 0:r,onRendered:E,theme:{primaryColor:((V=(_=(f=a.styles)==null?void 0:f.theme)==null?void 0:_.colors)==null?void 0:V.primary)||"#007bff",backgroundColor:((M=(Y=(q=a.styles)==null?void 0:q.theme)==null?void 0:Y.colors)==null?void 0:M.background)||"#f8f9fa",textColor:((P=(w=(b=a.styles)==null?void 0:b.theme)==null?void 0:w.colors)==null?void 0:P.text)||"#343a40",borderColor:((c=(S=(F=a.styles)==null?void 0:F.theme)==null?void 0:S.colors)==null?void 0:c.border)||"#dee2e6",borderRadius:A?"0px":"8px",padding:A?"0px":"20px"},style:{height:"100%",border:"none",background:"transparent",overflowY:A?"visible":"scroll"}})))},Oe=({markdown:m,onRendered:a,tableAnnotations:A=[]})=>{const f=useRef(null),_=q=>{const Y=q.split(/\r?\n/).filter(F=>F.trim().length>0);let M=-1;for(let F=0;F<Y.length-1;F++){const S=Y[F].trim(),c=Y[F+1].trim();if(S.startsWith("|")&&S.endsWith("|")&&c.replace(/\s|:|\|/g,"").match(/^[-]+$/)){M=F;break}}if(M===-1)return null;const b=Y[M].split("|").slice(1,-1).map(F=>F.trim()),w=[];for(let F=M+2;F<Y.length;F++){const S=Y[F].trim();if(!S.startsWith("|")||!S.endsWith("|"))break;w.push(S)}const P=w.map(F=>F.split("|").slice(1,-1).map(S=>S.trim()));return{headers:b,rows:P}},V=React__default.useMemo(()=>_(m),[m]);return useEffect(()=>{const q=()=>{try{if(!f.current)return;const M=f.current.querySelectorAll("table");if(M.forEach(b=>{Array.from(b.rows).forEach(w=>{Array.from(w.cells).forEach(P=>{P.getAttribute("data-table-annotated")==="1"&&(P.style.removeProperty("background"),P.style.removeProperty("background-color"),P.removeAttribute("data-table-annotated"),P.removeAttribute("title"))})})}),!A.length||!M||M.length===0)return;A.forEach((b,w)=>{(b.offsets||[]).forEach((P,F)=>{const[S,c]=P;M.forEach(t=>{var s;const o=Array.from(t.rows)[S];if(!o)return;const v=(s=o.cells)==null?void 0:s[c];if(!v)return;const g=b.color||"rgba(255, 229, 153, 0.5)";v.getAttribute("data-table-annotated")==="1"||(v.style.setProperty("background",g,"important"),v.style.setProperty("background-color",g,"important"),v.setAttribute("data-table-annotated","1"),b.content&&(v.title=b.content)),w===0&&F===0&&setTimeout(()=>v.scrollIntoView({behavior:"smooth",block:"start"}),50)})})})}catch(M){console.warn("[MinimalMarkdownTable] apply annotations failed",M)}},Y=requestAnimationFrame(()=>{q(),a&&a()});return()=>cancelAnimationFrame(Y)},[m,A,a]),V?React__default.createElement("div",{ref:f,className:"markdown-table-mode z-mdtbl-wrapper"},React__default.createElement("style",null,`
|
|
170
|
+
`))},We=(m,a)=>{var A,f,_,V,q;console.log("=== Fviewer renderTextContent ==="),console.log("data:",m),console.log("data.content:",m.content);let Y="";typeof m.content=="string"?Y=m.content:(A=m.content)!=null&&A.text?Y=m.content.text:(f=m.content)!=null&&f.content&&(Y=m.content.content),console.log("\u5B9E\u9645\u6587\u672C\u5185\u5BB9:",Y);const M=useRef(null),b=useRef(null);return useEffect(()=>{if(M.current&&b.current&&Y){const w=setTimeout(()=>{var P;const F=((P=M.current)==null?void 0:P.scrollHeight)||0,S=Math.max(F+80,200);b.current&&(b.current.style.minHeight=`${S}px`,console.log("\u6587\u672C\u7EB8\u5F20\u9AD8\u5EA6\u8C03\u6574\u5B8C\u6210:",S))},100);return()=>clearTimeout(w)}},[Y]),React__default.createElement("div",{style:{height:"100%",overflow:"auto",backgroundColor:"#f5f5f5",padding:"20px",display:"flex",justifyContent:"center",position:"relative"}},React__default.createElement("div",{ref:b,style:{width:"100%",maxWidth:"800px",backgroundColor:"white",boxShadow:"0 4px 8px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06)",borderRadius:"8px",padding:"40px",margin:"20px 0",position:"relative",transform:`scale(${a.scale||1})`,transition:"transform 0.2s ease-in-out",transformOrigin:"top center"}},React__default.createElement("div",{ref:M,style:{width:"100%",overflow:"visible"}},React__default.createElement(L6,{dataSource:{type:Xs.TEXT,content:Y},size:"md",theme:{primaryColor:((q=(V=(_=a.styles)==null?void 0:_.theme)==null?void 0:V.colors)==null?void 0:q.primary)||"#007bff",backgroundColor:"transparent",textColor:"#333",borderColor:"transparent",borderRadius:"0",padding:"0"},style:{border:"none",background:"transparent",width:"100%",height:"auto",overflow:"visible"}})),React__default.createElement("div",{style:{position:"absolute",top:"0",left:"0",right:"0",height:"2px",background:"linear-gradient(90deg, #e0e0e0 0%, #f0f0f0 50%, #e0e0e0 100%)",borderTopLeftRadius:"8px",borderTopRightRadius:"8px"}})))},je=({data:m,parentProps:a,isTableMode:A=!1})=>{var f,_,V,q,Y,M,b,w,P,F,S,c;const t=useRef(null),s=useRef(null),o=useRef(null),v=useRef(!1);useRef(0),useRef(null);const[g]=useState(!1),l=(N,U)=>{console.log("=== Markdownit\u6EDA\u52A8\u4E8B\u4EF6\u89E6\u53D1 ==="),console.log("\u6EDA\u52A8\u4F4D\u7F6E:",{scrollTop:N,scrollHeight:U}),a.eventsEmit&&a.eventsEmit("markdown_scroll",{scrollTop:N,scrollHeight:U})},n=()=>{console.log("=== Markdownit\u6EDA\u52A8\u5230\u9876\u90E8 ==="),a.eventsEmit&&a.eventsEmit("markdown_scroll_to_top")},r=()=>{console.log("=== Markdownit\u6EDA\u52A8\u5230\u5E95\u90E8 ==="),a.eventsEmit&&a.eventsEmit("markdown_scroll_to_bottom")},e=useRef();e.current=N=>{var U,G;try{if(!A)return;const bt=typeof m.content=="string"?m.content:((U=m.content)==null?void 0:U.content)||"";if(!bt||O.length===0)return;const wt=JSON.stringify(O.map(H=>({o:H.offsets,c:H.color}))),Mt=`${bt.length}:${bt.substring(0,64)}:${bt.substring(bt.length-64)}|${wt}`;if(((G=N.dataset)==null?void 0:G.tableAnnoRuntimeSig)===Mt)return;setTimeout(()=>{pt(),N.dataset&&(N.dataset.tableAnnoRuntimeSig=Mt)},50)}catch(bt){console.warn("[MarkdownRendered] apply failed",bt)}};const E=React__default.useCallback(N=>{var U;return(U=e.current)==null?void 0:U.call(e,N)},[]),x=useCallback(()=>{var N;if(!g||!t.current)return;const U=window.getSelection();if(!U||U.isCollapsed)return;const G=U.getRangeAt(0),bt=G.toString().trim();if(!bt)return;const wt=t.current;let Mt=0,H=0;const h=document.createTreeWalker(wt,NodeFilter.SHOW_TEXT,{acceptNode:I=>{var $;return($=I.parentElement)!=null&&$.closest("pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}});let u=h.nextNode();for(;u;){if(u===G.startContainer){H=Mt+G.startOffset;break}Mt+=((N=u.textContent)==null?void 0:N.length)||0,u=h.nextNode()}console.log("\u9009\u4E2D\u6587\u672C\u4FE1\u606F:",{text:bt,startOffset:H,charCount:Mt,container:G.startContainer.textContent});const T={id:`md-anno-${Date.now()}`,start:H,end:H+bt.length,color:"#FFE599"};console.log("\u521B\u5EFA\u65B0\u6807\u6CE8:",T),a.eventsEmit&&a.eventsEmit("md_annotation_add",T),U.removeAllRanges()},[g,a.eventsEmit]),L=A?[]:(a.annotationData||[]).filter(N=>"start"in N&&"end"in N&&!("pageNumber"in N)),O=A?(a.annotationData||[]).filter(N=>"offsets"in N&&Array.isArray(N.offsets)):[],yt=useCallback(()=>{if(console.log("=== \u5F00\u59CB\u6E05\u7A7A\u6240\u6709\u6807\u6CE8 ==="),!t.current){console.log("markdownRef\u4E0D\u5B58\u5728\uFF0C\u65E0\u6CD5\u6E05\u7A7A\u6807\u6CE8");return}const N=t.current.querySelectorAll(".md-annotation");console.log("\u6E05\u7A7AMarkdown\u6807\u6CE8\u6570\u91CF:",N.length),N.length>0&&N.forEach(U=>{const G=U.parentNode;G&&G.replaceChild(document.createTextNode(U.textContent||""),U)}),console.log("\u6240\u6709\u6807\u6CE8\u5DF2\u6E05\u7A7A")},[]),St=useCallback(()=>{t.current&&(t.current.querySelectorAll("table").forEach(N=>{Array.from(N.rows).forEach(U=>{Array.from(U.cells).forEach(G=>{G.getAttribute("data-table-annotated")==="1"&&(G.style.removeProperty("background"),G.style.removeProperty("background-color"),G.removeAttribute("data-table-annotated"),G.removeAttribute("title"))})})}),console.log("\u5DF2\u6E05\u7A7A\u6240\u6709\u8868\u683C\u6807\u6CE8"))},[]),pt=useCallback(()=>{if(console.log("=== \u5F00\u59CB\u5E94\u7528\u8868\u683C\u6807\u6CE8 ==="),console.log("tableAnnotations:",O),!t.current){console.log("markdownRef\u4E0D\u5B58\u5728\uFF0C\u9000\u51FA");return}if(St(),!O.length){console.log("\u6CA1\u6709\u8868\u683C\u6807\u6CE8\u6570\u636E\uFF0C\u4EC5\u6E05\u7A7A\u65E7\u6807\u6CE8");return}const N=t.current.querySelectorAll("table");if(console.log("\u627E\u5230\u8868\u683C\u6570\u91CF:",N.length),N.length===0){console.log("\u6CA1\u6709\u627E\u5230\u8868\u683C\u5143\u7D20");return}v.current=!0,O.forEach((U,G)=>{const bt=U.offsets;if(console.log("\u5904\u7406\u8868\u683C\u6807\u6CE8:",U),!Array.isArray(bt)||!bt.length||!Array.isArray(bt[0])||bt[0].length!==2){console.warn("[TableAnnotation] annotation.offsets is not valid",U);return}bt.forEach((wt,Mt)=>{const[H,h]=wt;if(typeof H!="number"||typeof h!="number"){console.warn("[TableAnnotation] offset is not [number, number]",wt);return}N.forEach((u,T)=>{var I;const $=Array.from(u.rows),W=$[H];if(!W){console.warn("[TableAnnotation] row out of range",{row:H,tableIndex:T,totalRows:$.length});return}const i=(I=W.cells)==null?void 0:I[h];if(!i){console.warn("[TableAnnotation] cell is undefined",{row:H,col:h,tableIndex:T});return}const d=U.color||"rgba(255, 229, 153, 0.5)",C=getComputedStyle(i).backgroundColor;i.getAttribute("data-table-annotated")==="1"&&(C===d||i.style.backgroundColor===d)||(i.style.setProperty("background",d,"important"),i.style.setProperty("background-color",d,"important"),i.setAttribute("data-table-annotated","1")),U.content&&(i.title=U.content),Mt===0&&G===0&&setTimeout(()=>{i.scrollIntoView({behavior:"smooth",block:"start"})},300)})})}),requestAnimationFrame(()=>{v.current=!1})},[O,St]),K=useCallback(()=>{if(console.log("=== \u5F00\u59CB\u5E94\u7528Markdown\u6807\u6CE8 ==="),!t.current||!L.length){console.log("\u6761\u4EF6\u4E0D\u6EE1\u8DB3\uFF0C\u8DF3\u8FC7\u6807\u6CE8\u5E94\u7528");return}s.current&&clearTimeout(s.current);const N=()=>{var U;console.log("\u5F00\u59CB\u5E94\u7528\u6807\u6CE8...");const G=(U=t.current)==null?void 0:U.querySelectorAll(".md-annotation");console.log("\u79FB\u9664\u73B0\u6709\u6807\u6CE8\u6570\u91CF:",(G==null?void 0:G.length)||0),G==null||G.forEach(T=>{const I=T.parentNode;I&&I.replaceChild(document.createTextNode(T.textContent||""),T)});const bt=document.createTreeWalker(t.current,NodeFilter.SHOW_TEXT,{acceptNode:T=>{var I;return(I=T.parentElement)!=null&&I.closest("pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),wt=[];let Mt;for(;Mt=bt.nextNode();)wt.push(Mt);if(console.log("\u627E\u5230\u6587\u672C\u8282\u70B9\u6570\u91CF:",wt.length),wt.length===0){console.log("\u6CA1\u6709\u627E\u5230\u6587\u672C\u8282\u70B9\uFF0C\u5EF6\u8FDF\u91CD\u8BD5..."),s.current=setTimeout(()=>{N()},200);return}let H=0;const h=wt.map(T=>{var I;const $=H;return H+=((I=T.textContent)==null?void 0:I.length)||0,{node:T,start:$,end:H,text:T.textContent}});console.log("\u6587\u672C\u8282\u70B9\u4F4D\u7F6E:",h),console.log("\u603B\u6587\u672C\u957F\u5EA6:",H);const u=[...L].sort((T,I)=>I.start-T.start);console.log("\u6392\u5E8F\u540E\u7684\u6807\u6CE8:",u),u.forEach(T=>{const{start:I,end:$,color:W}=T;console.log("\u5904\u7406\u6807\u6CE8:",{annotation:T,nodePositions:h});const i=h.filter(d=>I<d.end&&$>d.start);console.log("\u76F8\u5173\u8282\u70B9\u6570\u91CF:",i.length),i.forEach(({node:d,start:C})=>{var y,k,j,D,p,B;const _t=Math.max(0,I-C),z=Math.min(((y=d.textContent)==null?void 0:y.length)||0,$-C);if(console.log("\u672C\u5730\u4F4D\u7F6E:",{localStart:_t,localEnd:z,nodeTextLength:(k=d.textContent)==null?void 0:k.length}),_t>=z){console.log("\u672C\u5730\u4F4D\u7F6E\u65E0\u6548\uFF0C\u8DF3\u8FC7");return}const Q=((j=d.textContent)==null?void 0:j.slice(0,_t))||"",At=((D=d.textContent)==null?void 0:D.slice(_t,z))||"",kt=((p=d.textContent)==null?void 0:p.slice(z))||"";console.log("\u5206\u5272\u6587\u672C:",{before:Q,annotatedText:At,after:kt});const Rt=document.createElement("span");Rt.className="md-annotation",Rt.style.backgroundColor=W||"#FFE599",Rt.textContent=At;const xt=document.createDocumentFragment();Q&&xt.appendChild(document.createTextNode(Q)),xt.appendChild(Rt),kt&&xt.appendChild(document.createTextNode(kt)),(B=d.parentNode)==null||B.replaceChild(xt,d),console.log("\u6210\u529F\u5E94\u7528\u6807\u6CE8:",At)})})};s.current=setTimeout(()=>{N()},100)},[L]);return useEffect(()=>{var N;if(A){console.log("[MarkdownContentView] table mode: skip effect, wait for onRendered");return}const U=typeof m.content=="string"?m.content:((N=m.content)==null?void 0:N.content)||"";if(!U||typeof U!="string"){console.log("Markdown\u5185\u5BB9\u4E0D\u662F\u5B57\u7B26\u4E32\u7C7B\u578B\uFF0C\u8DF3\u8FC7\u6807\u6CE8\u5E94\u7528");return}if(console.log("=== \u5F00\u59CB\u5E94\u7528Markdown\u6807\u6CE8\u9AD8\u4EAE ==="),console.log("markdownRef.current:",t.current),console.log("isTableMode:",A),console.log("mdAnnotations:",L),console.log("tableAnnotations:",O),console.log("data.content:",m.content),console.log("\u5B9E\u9645\u5185\u5BB9:",U),!t.current){console.log("markdownRef\u4E0D\u5B58\u5728\uFF0C\u9000\u51FA\u6807\u6CE8\u5E94\u7528");return}if(A||yt(),!A&&L.length>0){K();return}console.log("\u6CA1\u6709\u9700\u8981\u5E94\u7528\u7684\u6807\u6CE8")},[A,O,L]),useEffect(()=>{if(!A)return document.addEventListener("mouseup",x),()=>{document.removeEventListener("mouseup",x)}},[x,A]),useEffect(()=>{var N;const U=typeof m.content=="string"?m.content:((N=m.content)==null?void 0:N.content)||"";if(!U||typeof U!="string"){console.log("Markdown\u5185\u5BB9\u4E0D\u662F\u5B57\u7B26\u4E32\u7C7B\u578B\uFF0C\u8DF3\u8FC7\u8C03\u8BD5\u4FE1\u606F\u6253\u5370");return}console.log("=== Markdown\u5185\u5BB9\u4FE1\u606F ==="),console.log("isTableMode:",A),console.log("\u5185\u5BB9\u957F\u5EA6:",U.length||0),typeof U=="string"?(console.log("\u5185\u5BB9\u524D100\u5B57\u7B26:",U.substring(0,100)),console.log("\u5185\u5BB9\u540E100\u5B57\u7B26:",U.substring(U.length-100))):(console.log("\u5185\u5BB9\u4E0D\u662F\u5B57\u7B26\u4E32\u7C7B\u578B:",typeof U),console.log("\u5185\u5BB9\u503C:",U)),console.log("\u6807\u6CE8\u6570\u636E:",L),console.log("\u8868\u683C\u6807\u6CE8\u6570\u636E:",O)},[L,O,A]),useEffect(()=>{if(A&&t.current){const N=setTimeout(()=>{var U;const G=(U=t.current)==null?void 0:U.querySelectorAll("table");G&&G.length>0&&(console.log("\u8C03\u6574\u8868\u683C\u5C3A\u5BF8\uFF0C\u627E\u5230\u8868\u683C\u6570\u91CF:",G.length),G.forEach((bt,wt)=>{if(bt instanceof HTMLTableElement){bt.style.width="100%",bt.style.minWidth="100%",bt.style.tableLayout="auto";const Mt=bt.closest(".markdown-table-mode");Mt&&Mt instanceof HTMLElement&&(Mt.style.width="100%",Mt.style.overflowX="auto"),console.log(`\u8868\u683C ${wt+1} \u5C3A\u5BF8\u8C03\u6574\u5B8C\u6210`)}}))},500);return()=>clearTimeout(N)}},[A,m.content]),useEffect(()=>()=>{s.current&&clearTimeout(s.current),o.current&&(o.current.disconnect(),o.current=null)},[]),React__default.createElement("div",{style:{height:"100%",width:"100%",overflow:"auto"},className:`markdown-container markdown-scrollbar ${A?"markdown-table-mode":""}`},React__default.createElement("style",null,Le),React__default.createElement("div",{ref:t},React__default.createElement(L6,{dataSource:{type:Xs.MARKDOWN,content:(()=>{var N,U;return typeof m.content=="string"?m.content:(N=m.content)!=null&&N.text?m.content.text:(U=m.content)!=null&&U.content?m.content.content:""})()},size:"md",onScroll:A?void 0:l,onScrollToTop:A?void 0:n,onScrollToBottom:A?void 0:r,onRendered:E,theme:{primaryColor:((V=(_=(f=a.styles)==null?void 0:f.theme)==null?void 0:_.colors)==null?void 0:V.primary)||"#007bff",backgroundColor:((M=(Y=(q=a.styles)==null?void 0:q.theme)==null?void 0:Y.colors)==null?void 0:M.background)||"#f8f9fa",textColor:((P=(w=(b=a.styles)==null?void 0:b.theme)==null?void 0:w.colors)==null?void 0:P.text)||"#343a40",borderColor:((c=(S=(F=a.styles)==null?void 0:F.theme)==null?void 0:S.colors)==null?void 0:c.border)||"#dee2e6",borderRadius:A?"0px":"8px",padding:A?"0px":"20px"},style:{height:"100%",border:"none",background:"transparent",overflowY:A?"visible":"scroll"}})))},Oe=({markdown:m,onRendered:a,tableAnnotations:A=[]})=>{const f=useRef(null),_=q=>{const Y=q.split(/\r?\n/).filter(F=>F.trim().length>0);let M=-1;for(let F=0;F<Y.length-1;F++){const S=Y[F].trim(),c=Y[F+1].trim();if(S.startsWith("|")&&S.endsWith("|")&&c.replace(/\s|:|\|/g,"").match(/^[-]+$/)){M=F;break}}if(M===-1)return null;const b=Y[M].split("|").slice(1,-1).map(F=>F.trim()),w=[];for(let F=M+2;F<Y.length;F++){const S=Y[F].trim();if(!S.startsWith("|")||!S.endsWith("|"))break;w.push(S)}const P=w.map(F=>F.split("|").slice(1,-1).map(S=>S.trim()));return{headers:b,rows:P}},V=React__default.useMemo(()=>_(m),[m]);return useEffect(()=>{const q=()=>{try{if(!f.current)return;const M=f.current.querySelectorAll("table");if(M.forEach(b=>{Array.from(b.rows).forEach(w=>{Array.from(w.cells).forEach(P=>{P.getAttribute("data-table-annotated")==="1"&&(P.style.removeProperty("background"),P.style.removeProperty("background-color"),P.removeAttribute("data-table-annotated"),P.removeAttribute("title"))})})}),!A.length||!M||M.length===0)return;A.forEach((b,w)=>{(b.offsets||[]).forEach((P,F)=>{const[S,c]=P;M.forEach(t=>{var s;const o=Array.from(t.rows)[S];if(!o)return;const v=(s=o.cells)==null?void 0:s[c];if(!v)return;const g=b.color||"rgba(255, 229, 153, 0.5)";v.getAttribute("data-table-annotated")==="1"||(v.style.setProperty("background",g,"important"),v.style.setProperty("background-color",g,"important"),v.setAttribute("data-table-annotated","1"),b.content&&(v.title=b.content)),w===0&&F===0&&setTimeout(()=>v.scrollIntoView({behavior:"smooth",block:"start"}),50)})})})}catch(M){console.warn("[MinimalMarkdownTable] apply annotations failed",M)}},Y=requestAnimationFrame(()=>{q(),a&&a()});return()=>cancelAnimationFrame(Y)},[m,A,a]),V?React__default.createElement("div",{ref:f,className:"markdown-table-mode z-mdtbl-wrapper"},React__default.createElement("style",null,`
|
|
171
171
|
.z-mdtbl-wrapper { overflow: auto; position: relative; }
|
|
172
172
|
.z-mdtbl { border-collapse: separate; border-spacing: 0; background: transparent; box-shadow: 0 1px 3px rgba(16,24,40,.08), 0 1px 2px rgba(16,24,40,.06); border-radius: 8px; }
|
|
173
173
|
.z-mdtbl th, .z-mdtbl td { border: 1px solid #e5e7eb; padding: 10px 14px; font-size: 13px; line-height: 1.4; color: inherit; }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import*as a from"react";import c,{useEffect as Kt,useMemo as Vt}from"react";import{ac as je,A as G,H as Pe,M as Y,f as E,L as X,a5 as nt,E as Gt,ad as Jt,J as Ft,g as vt,m as ft,ae as Ut,r as ht,k as $,af as at,U as Qt,ag as Yt,ah as Zt,ai as kt,aj as ei,ak as ti,al as ii,w as ni,am as ai,u as St,s as ri,an as oi,ao as li,S as ci,N as si,o as ui,K as bt}from"./index-LDFwTu47.js";var di={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z"}}]},name:"right",theme:"outlined"},mi=function(t,n){return a.createElement(je,G({},t,{ref:n,icon:di}))},rt=a.forwardRef(mi),gi={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"}}]},name:"left",theme:"outlined"},pi=function(t,n){return a.createElement(je,G({},t,{ref:n,icon:gi}))},ot=a.forwardRef(pi);function vi(e,t,n){var i=n||{},r=i.noTrailing,g=r===void 0?!1:r,f=i.noLeading,h=f===void 0?!1:f,m=i.debounceMode,y=m===void 0?void 0:m,S,d=!1,x=0;function O(){S&&clearTimeout(S)}function _(v){var N=v||{},I=N.upcomingOnly,R=I===void 0?!1:I;O(),d=!R}function j(){for(var v=arguments.length,N=new Array(v),I=0;I<v;I++)N[I]=arguments[I];var R=this,W=Date.now()-x;if(d)return;function l(){x=Date.now(),t.apply(R,N)}function z(){S=void 0}!h&&y&&!S&&l(),O(),y===void 0&&W>e?h?(x=Date.now(),g||(S=setTimeout(y?z:l,e))):l():g!==!0&&(S=setTimeout(y?z:l,y===void 0?e-W:e))}return j.cancel=_,j}function fi(e,t,n){var i={},r=i.atBegin,g=r===void 0?!1:r;return vi(e,t,{debounceMode:g!==!1})}var hi={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M272.9 512l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L186.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H532c6.7 0 10.4-7.7 6.3-12.9L272.9 512zm304 0l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L490.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H836c6.7 0 10.4-7.7 6.3-12.9L576.9 512z"}}]},name:"double-left",theme:"outlined"},Si=function(t,n){return a.createElement(je,G({},t,{ref:n,icon:hi}))},lt=a.forwardRef(Si),bi={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M533.2 492.3L277.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H188c-6.7 0-10.4 7.7-6.3 12.9L447.1 512 181.7 851.1A7.98 7.98 0 00188 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5zm304 0L581.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H492c-6.7 0-10.4 7.7-6.3 12.9L751.1 512 485.7 851.1A7.98 7.98 0 00492 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5z"}}]},name:"double-right",theme:"outlined"},$i=function(t,n){return a.createElement(je,G({},t,{ref:n,icon:bi}))},ct=a.forwardRef($i),Ci={items_per_page:"\u6761/\u9875",jump_to:"\u8DF3\u81F3",jump_to_confirm:"\u786E\u5B9A",page:"\u9875",prev_page:"\u4E0A\u4E00\u9875",next_page:"\u4E0B\u4E00\u9875",prev_5:"\u5411\u524D 5 \u9875",next_5:"\u5411\u540E 5 \u9875",prev_3:"\u5411\u524D 3 \u9875",next_3:"\u5411\u540E 3 \u9875",page_size:"\u9875\u7801"},yi=[10,20,50,100],xi=function(t){var n=t.pageSizeOptions,i=n===void 0?yi:n,r=t.locale,g=t.changeSize,f=t.pageSize,h=t.goButton,m=t.quickGo,y=t.rootPrefixCls,S=t.disabled,d=t.buildOptionText,x=t.showSizeChanger,O=t.sizeChangerRender,_=c.useState(""),j=Pe(_,2),v=j[0],N=j[1],I=function(){return!v||Number.isNaN(v)?void 0:Number(v)},R=typeof d=="function"?d:function(p){return"".concat(p," ").concat(r.items_per_page)},W=function(b){N(b.target.value)},l=function(b){h||v===""||(N(""),!(b.relatedTarget&&(b.relatedTarget.className.indexOf("".concat(y,"-item-link"))>=0||b.relatedTarget.className.indexOf("".concat(y,"-item"))>=0))&&(m==null||m(I())))},z=function(b){v!==""&&(b.keyCode===Y.ENTER||b.type==="click")&&(N(""),m==null||m(I()))},K=function(){return i.some(function(b){return b.toString()===f.toString()})?i:i.concat([f]).sort(function(b,L){var ee=Number.isNaN(Number(b))?0:Number(b),V=Number.isNaN(Number(L))?0:Number(L);return ee-V})},w="".concat(y,"-options");if(!x&&!m)return null;var B=null,H=null,J=null;return x&&O&&(B=O({disabled:S,size:f,onSizeChange:function(b){g==null||g(Number(b))},"aria-label":r.page_size,className:"".concat(w,"-size-changer"),options:K().map(function(p){return{label:R(p),value:p}})})),m&&(h&&(J=typeof h=="boolean"?c.createElement("button",{type:"button",onClick:z,onKeyUp:z,disabled:S,className:"".concat(w,"-quick-jumper-button")},r.jump_to_confirm):c.createElement("span",{onClick:z,onKeyUp:z},h)),H=c.createElement("div",{className:"".concat(w,"-quick-jumper")},r.jump_to,c.createElement("input",{disabled:S,type:"text",value:v,onChange:W,onKeyUp:z,onBlur:l,"aria-label":r.page}),r.page,J)),c.createElement("li",{className:w},B,H)},ve=function(t){var n=t.rootPrefixCls,i=t.page,r=t.active,g=t.className,f=t.showTitle,h=t.onClick,m=t.onKeyPress,y=t.itemRender,S="".concat(n,"-item"),d=E(S,"".concat(S,"-").concat(i),X(X({},"".concat(S,"-active"),r),"".concat(S,"-disabled"),!i),g),x=function(){h(i)},O=function(v){m(v,h,i)},_=y(i,"page",c.createElement("a",{rel:"nofollow"},i));return _?c.createElement("li",{title:f?String(i):null,className:d,onClick:x,onKeyDown:O,tabIndex:0},_):null},zi=function(t,n,i){return i};function st(){}function ut(e){var t=Number(e);return typeof t=="number"&&!Number.isNaN(t)&&isFinite(t)&&Math.floor(t)===t}function ae(e,t,n){var i=typeof e>"u"?t:e;return Math.floor((n-1)/i)+1}var Ni=function(t){var n=t.prefixCls,i=n===void 0?"rc-pagination":n,r=t.selectPrefixCls,g=r===void 0?"rc-select":r,f=t.className,h=t.current,m=t.defaultCurrent,y=m===void 0?1:m,S=t.total,d=S===void 0?0:S,x=t.pageSize,O=t.defaultPageSize,_=O===void 0?10:O,j=t.onChange,v=j===void 0?st:j,N=t.hideOnSinglePage,I=t.align,R=t.showPrevNextJumpers,W=R===void 0?!0:R,l=t.showQuickJumper,z=t.showLessItems,K=t.showTitle,w=K===void 0?!0:K,B=t.onShowSizeChange,H=B===void 0?st:B,J=t.locale,p=J===void 0?Ci:J,b=t.style,L=t.totalBoundaryShowSizeChanger,ee=L===void 0?50:L,V=t.disabled,D=t.simple,A=t.showTotal,Z=t.showSizeChanger,Me=Z===void 0?d>ee:Z,Be=t.sizeChangerRender,Te=t.pageSizeOptions,fe=t.itemRender,te=fe===void 0?zi:fe,he=t.jumpPrevIcon,F=t.jumpNextIcon,ie=t.prevIcon,le=t.nextIcon,ce=c.useRef(null),ne=nt(10,{value:x,defaultValue:_}),Se=Pe(ne,2),M=Se[0],be=Se[1],De=nt(1,{value:h,defaultValue:y,postState:function(u){return Math.max(1,Math.min(u,ae(void 0,M,d)))}}),re=Pe(De,2),s=re[0],U=re[1],_e=c.useState(s),Xe=Pe(_e,2),oe=Xe[0],$e=Xe[1];Kt(function(){$e(s)},[s]);var We=Math.max(1,s-(z?3:5)),Ke=Math.min(ae(void 0,M,d),s+(z?3:5));function Ce(o,u){var C=o||c.createElement("button",{type:"button","aria-label":u,className:"".concat(i,"-item-link")});return typeof o=="function"&&(C=c.createElement(o,Ft({},t))),C}function Ve(o){var u=o.target.value,C=ae(void 0,M,d),k;return u===""?k=u:Number.isNaN(Number(u))?k=oe:u>=C?k=C:k=Number(u),k}function Nt(o){return ut(o)&&o!==s&&ut(d)&&d>0}var Et=d>M?l:!1;function It(o){(o.keyCode===Y.UP||o.keyCode===Y.DOWN)&&o.preventDefault()}function Ge(o){var u=Ve(o);switch(u!==oe&&$e(u),o.keyCode){case Y.ENTER:q(u);break;case Y.UP:q(u-1);break;case Y.DOWN:q(u+1);break}}function wt(o){q(Ve(o))}function Pt(o){var u=ae(o,M,d),C=s>u&&u!==0?u:s;be(o),$e(C),H==null||H(s,o),U(C),v==null||v(C,o)}function q(o){if(Nt(o)&&!V){var u=ae(void 0,M,d),C=o;return o>u?C=u:o<1&&(C=1),C!==oe&&$e(C),U(C),v==null||v(C,M),C}return s}var ye=s>1,xe=s<ae(void 0,M,d);function Je(){ye&&q(s-1)}function Fe(){xe&&q(s+1)}function Ue(){q(We)}function Qe(){q(Ke)}function se(o,u){if(o.key==="Enter"||o.charCode===Y.ENTER||o.keyCode===Y.ENTER){for(var C=arguments.length,k=new Array(C>2?C-2:0),we=2;we<C;we++)k[we-2]=arguments[we];u.apply(void 0,k)}}function Ot(o){se(o,Je)}function jt(o){se(o,Fe)}function Mt(o){se(o,Ue)}function Bt(o){se(o,Qe)}function Tt(o){var u=te(o,"prev",Ce(ie,"prev page"));return c.isValidElement(u)?c.cloneElement(u,{disabled:!ye}):u}function Dt(o){var u=te(o,"next",Ce(le,"next page"));return c.isValidElement(u)?c.cloneElement(u,{disabled:!xe}):u}function ze(o){(o.type==="click"||o.keyCode===Y.ENTER)&&q(oe)}var Ye=null,_t=Gt(t,{aria:!0,data:!0}),Rt=A&&c.createElement("li",{className:"".concat(i,"-total-text")},A(d,[d===0?0:(s-1)*M+1,s*M>d?d:s*M])),Ze=null,P=ae(void 0,M,d);if(N&&d<=M)return null;var T=[],ue={rootPrefixCls:i,onClick:q,onKeyPress:se,showTitle:w,itemRender:te,page:-1},Ht=s-1>0?s-1:0,Lt=s+1<P?s+1:P,Ne=l&&l.goButton,At=Jt(D)==="object"?D.readOnly:!D,de=Ne,ke=null;D&&(Ne&&(typeof Ne=="boolean"?de=c.createElement("button",{type:"button",onClick:ze,onKeyUp:ze},p.jump_to_confirm):de=c.createElement("span",{onClick:ze,onKeyUp:ze},Ne),de=c.createElement("li",{title:w?"".concat(p.jump_to).concat(s,"/").concat(P):null,className:"".concat(i,"-simple-pager")},de)),ke=c.createElement("li",{title:w?"".concat(s,"/").concat(P):null,className:"".concat(i,"-simple-pager")},At?oe:c.createElement("input",{type:"text","aria-label":p.jump_to,value:oe,disabled:V,onKeyDown:It,onKeyUp:Ge,onChange:Ge,onBlur:wt,size:3}),c.createElement("span",{className:"".concat(i,"-slash")},"/"),P));var Q=z?1:2;if(P<=3+Q*2){P||T.push(c.createElement(ve,G({},ue,{key:"noPager",page:1,className:"".concat(i,"-item-disabled")})));for(var me=1;me<=P;me+=1)T.push(c.createElement(ve,G({},ue,{key:me,page:me,active:s===me})))}else{var qt=z?p.prev_3:p.prev_5,Xt=z?p.next_3:p.next_5,et=te(We,"jump-prev",Ce(he,"prev page")),tt=te(Ke,"jump-next",Ce(F,"next page"));W&&(Ye=et?c.createElement("li",{title:w?qt:null,key:"prev",onClick:Ue,tabIndex:0,onKeyDown:Mt,className:E("".concat(i,"-jump-prev"),X({},"".concat(i,"-jump-prev-custom-icon"),!!he))},et):null,Ze=tt?c.createElement("li",{title:w?Xt:null,key:"next",onClick:Qe,tabIndex:0,onKeyDown:Bt,className:E("".concat(i,"-jump-next"),X({},"".concat(i,"-jump-next-custom-icon"),!!F))},tt):null);var Re=Math.max(1,s-Q),He=Math.min(s+Q,P);s-1<=Q&&(He=1+Q*2),P-s<=Q&&(Re=P-Q*2);for(var ge=Re;ge<=He;ge+=1)T.push(c.createElement(ve,G({},ue,{key:ge,page:ge,active:s===ge})));if(s-1>=Q*2&&s!==3&&(T[0]=c.cloneElement(T[0],{className:E("".concat(i,"-item-after-jump-prev"),T[0].props.className)}),T.unshift(Ye)),P-s>=Q*2&&s!==P-2){var it=T[T.length-1];T[T.length-1]=c.cloneElement(it,{className:E("".concat(i,"-item-before-jump-next"),it.props.className)}),T.push(Ze)}Re!==1&&T.unshift(c.createElement(ve,G({},ue,{key:1,page:1}))),He!==P&&T.push(c.createElement(ve,G({},ue,{key:P,page:P})))}var Ee=Tt(Ht);if(Ee){var Le=!ye||!P;Ee=c.createElement("li",{title:w?p.prev_page:null,onClick:Je,tabIndex:Le?null:0,onKeyDown:Ot,className:E("".concat(i,"-prev"),X({},"".concat(i,"-disabled"),Le)),"aria-disabled":Le},Ee)}var Ie=Dt(Lt);if(Ie){var pe,Ae;D?(pe=!xe,Ae=ye?0:null):(pe=!xe||!P,Ae=pe?null:0),Ie=c.createElement("li",{title:w?p.next_page:null,onClick:Fe,tabIndex:Ae,onKeyDown:jt,className:E("".concat(i,"-next"),X({},"".concat(i,"-disabled"),pe)),"aria-disabled":pe},Ie)}var Wt=E(i,f,X(X(X(X(X({},"".concat(i,"-start"),I==="start"),"".concat(i,"-center"),I==="center"),"".concat(i,"-end"),I==="end"),"".concat(i,"-simple"),D),"".concat(i,"-disabled"),V));return c.createElement("ul",G({className:Wt,style:b,ref:ce},_t),Rt,Ee,D?ke:T,Ie,c.createElement(xi,{locale:p,rootPrefixCls:i,disabled:V,selectPrefixCls:g,changeSize:Pt,pageSize:M,pageSizeOptions:Te,quickGo:Et?q:null,goButton:de,showSizeChanger:Me,sizeChangerRender:Be}))};const Ei=e=>{const{componentCls:t}=e;return{[`${t}-disabled`]:{"&, &:hover":{cursor:"not-allowed",[`${t}-item-link`]:{color:e.colorTextDisabled,cursor:"not-allowed"}},"&:focus-visible":{cursor:"not-allowed",[`${t}-item-link`]:{color:e.colorTextDisabled,cursor:"not-allowed"}}},[`&${t}-disabled`]:{cursor:"not-allowed",[`${t}-item`]:{cursor:"not-allowed",backgroundColor:"transparent","&:hover, &:active":{backgroundColor:"transparent"},a:{color:e.colorTextDisabled,backgroundColor:"transparent",border:"none",cursor:"not-allowed"},"&-active":{borderColor:e.colorBorder,backgroundColor:e.itemActiveBgDisabled,"&:hover, &:active":{backgroundColor:e.itemActiveBgDisabled},a:{color:e.itemActiveColorDisabled}}},[`${t}-item-link`]:{color:e.colorTextDisabled,cursor:"not-allowed","&:hover, &:active":{backgroundColor:"transparent"},[`${t}-simple&`]:{backgroundColor:"transparent","&:hover, &:active":{backgroundColor:"transparent"}}},[`${t}-simple-pager`]:{color:e.colorTextDisabled},[`${t}-jump-prev, ${t}-jump-next`]:{[`${t}-item-link-icon`]:{opacity:0},[`${t}-item-ellipsis`]:{opacity:1}}}}},Ii=e=>{const{componentCls:t}=e;return{[`&${t}-mini ${t}-total-text, &${t}-mini ${t}-simple-pager`]:{height:e.itemSizeSM,lineHeight:$(e.itemSizeSM)},[`&${t}-mini ${t}-item`]:{minWidth:e.itemSizeSM,height:e.itemSizeSM,margin:0,lineHeight:$(e.calc(e.itemSizeSM).sub(2).equal())},[`&${t}-mini ${t}-prev, &${t}-mini ${t}-next`]:{minWidth:e.itemSizeSM,height:e.itemSizeSM,margin:0,lineHeight:$(e.itemSizeSM)},[`&${t}-mini:not(${t}-disabled)`]:{[`${t}-prev, ${t}-next`]:{[`&:hover ${t}-item-link`]:{backgroundColor:e.colorBgTextHover},[`&:active ${t}-item-link`]:{backgroundColor:e.colorBgTextActive},[`&${t}-disabled:hover ${t}-item-link`]:{backgroundColor:"transparent"}}},[`
|
|
1
|
+
import*as a from"react";import c,{useEffect as Kt,useMemo as Vt}from"react";import{ac as je,A as G,H as Pe,M as Y,f as E,L as X,a5 as nt,E as Gt,ad as Jt,J as Ft,g as vt,m as ft,ae as Ut,r as ht,k as $,af as at,U as Qt,ag as Yt,ah as Zt,ai as kt,aj as ei,ak as ti,al as ii,w as ni,am as ai,u as St,s as ri,an as oi,ao as li,S as ci,N as si,o as ui,K as bt}from"./index-BRq6VK9v.js";var di={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z"}}]},name:"right",theme:"outlined"},mi=function(t,n){return a.createElement(je,G({},t,{ref:n,icon:di}))},rt=a.forwardRef(mi),gi={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"}}]},name:"left",theme:"outlined"},pi=function(t,n){return a.createElement(je,G({},t,{ref:n,icon:gi}))},ot=a.forwardRef(pi);function vi(e,t,n){var i=n||{},r=i.noTrailing,g=r===void 0?!1:r,f=i.noLeading,h=f===void 0?!1:f,m=i.debounceMode,y=m===void 0?void 0:m,S,d=!1,x=0;function O(){S&&clearTimeout(S)}function _(v){var N=v||{},I=N.upcomingOnly,R=I===void 0?!1:I;O(),d=!R}function j(){for(var v=arguments.length,N=new Array(v),I=0;I<v;I++)N[I]=arguments[I];var R=this,W=Date.now()-x;if(d)return;function l(){x=Date.now(),t.apply(R,N)}function z(){S=void 0}!h&&y&&!S&&l(),O(),y===void 0&&W>e?h?(x=Date.now(),g||(S=setTimeout(y?z:l,e))):l():g!==!0&&(S=setTimeout(y?z:l,y===void 0?e-W:e))}return j.cancel=_,j}function fi(e,t,n){var i={},r=i.atBegin,g=r===void 0?!1:r;return vi(e,t,{debounceMode:g!==!1})}var hi={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M272.9 512l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L186.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H532c6.7 0 10.4-7.7 6.3-12.9L272.9 512zm304 0l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L490.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H836c6.7 0 10.4-7.7 6.3-12.9L576.9 512z"}}]},name:"double-left",theme:"outlined"},Si=function(t,n){return a.createElement(je,G({},t,{ref:n,icon:hi}))},lt=a.forwardRef(Si),bi={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M533.2 492.3L277.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H188c-6.7 0-10.4 7.7-6.3 12.9L447.1 512 181.7 851.1A7.98 7.98 0 00188 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5zm304 0L581.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H492c-6.7 0-10.4 7.7-6.3 12.9L751.1 512 485.7 851.1A7.98 7.98 0 00492 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5z"}}]},name:"double-right",theme:"outlined"},$i=function(t,n){return a.createElement(je,G({},t,{ref:n,icon:bi}))},ct=a.forwardRef($i),Ci={items_per_page:"\u6761/\u9875",jump_to:"\u8DF3\u81F3",jump_to_confirm:"\u786E\u5B9A",page:"\u9875",prev_page:"\u4E0A\u4E00\u9875",next_page:"\u4E0B\u4E00\u9875",prev_5:"\u5411\u524D 5 \u9875",next_5:"\u5411\u540E 5 \u9875",prev_3:"\u5411\u524D 3 \u9875",next_3:"\u5411\u540E 3 \u9875",page_size:"\u9875\u7801"},yi=[10,20,50,100],xi=function(t){var n=t.pageSizeOptions,i=n===void 0?yi:n,r=t.locale,g=t.changeSize,f=t.pageSize,h=t.goButton,m=t.quickGo,y=t.rootPrefixCls,S=t.disabled,d=t.buildOptionText,x=t.showSizeChanger,O=t.sizeChangerRender,_=c.useState(""),j=Pe(_,2),v=j[0],N=j[1],I=function(){return!v||Number.isNaN(v)?void 0:Number(v)},R=typeof d=="function"?d:function(p){return"".concat(p," ").concat(r.items_per_page)},W=function(b){N(b.target.value)},l=function(b){h||v===""||(N(""),!(b.relatedTarget&&(b.relatedTarget.className.indexOf("".concat(y,"-item-link"))>=0||b.relatedTarget.className.indexOf("".concat(y,"-item"))>=0))&&(m==null||m(I())))},z=function(b){v!==""&&(b.keyCode===Y.ENTER||b.type==="click")&&(N(""),m==null||m(I()))},K=function(){return i.some(function(b){return b.toString()===f.toString()})?i:i.concat([f]).sort(function(b,L){var ee=Number.isNaN(Number(b))?0:Number(b),V=Number.isNaN(Number(L))?0:Number(L);return ee-V})},w="".concat(y,"-options");if(!x&&!m)return null;var B=null,H=null,J=null;return x&&O&&(B=O({disabled:S,size:f,onSizeChange:function(b){g==null||g(Number(b))},"aria-label":r.page_size,className:"".concat(w,"-size-changer"),options:K().map(function(p){return{label:R(p),value:p}})})),m&&(h&&(J=typeof h=="boolean"?c.createElement("button",{type:"button",onClick:z,onKeyUp:z,disabled:S,className:"".concat(w,"-quick-jumper-button")},r.jump_to_confirm):c.createElement("span",{onClick:z,onKeyUp:z},h)),H=c.createElement("div",{className:"".concat(w,"-quick-jumper")},r.jump_to,c.createElement("input",{disabled:S,type:"text",value:v,onChange:W,onKeyUp:z,onBlur:l,"aria-label":r.page}),r.page,J)),c.createElement("li",{className:w},B,H)},ve=function(t){var n=t.rootPrefixCls,i=t.page,r=t.active,g=t.className,f=t.showTitle,h=t.onClick,m=t.onKeyPress,y=t.itemRender,S="".concat(n,"-item"),d=E(S,"".concat(S,"-").concat(i),X(X({},"".concat(S,"-active"),r),"".concat(S,"-disabled"),!i),g),x=function(){h(i)},O=function(v){m(v,h,i)},_=y(i,"page",c.createElement("a",{rel:"nofollow"},i));return _?c.createElement("li",{title:f?String(i):null,className:d,onClick:x,onKeyDown:O,tabIndex:0},_):null},zi=function(t,n,i){return i};function st(){}function ut(e){var t=Number(e);return typeof t=="number"&&!Number.isNaN(t)&&isFinite(t)&&Math.floor(t)===t}function ae(e,t,n){var i=typeof e>"u"?t:e;return Math.floor((n-1)/i)+1}var Ni=function(t){var n=t.prefixCls,i=n===void 0?"rc-pagination":n,r=t.selectPrefixCls,g=r===void 0?"rc-select":r,f=t.className,h=t.current,m=t.defaultCurrent,y=m===void 0?1:m,S=t.total,d=S===void 0?0:S,x=t.pageSize,O=t.defaultPageSize,_=O===void 0?10:O,j=t.onChange,v=j===void 0?st:j,N=t.hideOnSinglePage,I=t.align,R=t.showPrevNextJumpers,W=R===void 0?!0:R,l=t.showQuickJumper,z=t.showLessItems,K=t.showTitle,w=K===void 0?!0:K,B=t.onShowSizeChange,H=B===void 0?st:B,J=t.locale,p=J===void 0?Ci:J,b=t.style,L=t.totalBoundaryShowSizeChanger,ee=L===void 0?50:L,V=t.disabled,D=t.simple,A=t.showTotal,Z=t.showSizeChanger,Me=Z===void 0?d>ee:Z,Be=t.sizeChangerRender,Te=t.pageSizeOptions,fe=t.itemRender,te=fe===void 0?zi:fe,he=t.jumpPrevIcon,F=t.jumpNextIcon,ie=t.prevIcon,le=t.nextIcon,ce=c.useRef(null),ne=nt(10,{value:x,defaultValue:_}),Se=Pe(ne,2),M=Se[0],be=Se[1],De=nt(1,{value:h,defaultValue:y,postState:function(u){return Math.max(1,Math.min(u,ae(void 0,M,d)))}}),re=Pe(De,2),s=re[0],U=re[1],_e=c.useState(s),Xe=Pe(_e,2),oe=Xe[0],$e=Xe[1];Kt(function(){$e(s)},[s]);var We=Math.max(1,s-(z?3:5)),Ke=Math.min(ae(void 0,M,d),s+(z?3:5));function Ce(o,u){var C=o||c.createElement("button",{type:"button","aria-label":u,className:"".concat(i,"-item-link")});return typeof o=="function"&&(C=c.createElement(o,Ft({},t))),C}function Ve(o){var u=o.target.value,C=ae(void 0,M,d),k;return u===""?k=u:Number.isNaN(Number(u))?k=oe:u>=C?k=C:k=Number(u),k}function Nt(o){return ut(o)&&o!==s&&ut(d)&&d>0}var Et=d>M?l:!1;function It(o){(o.keyCode===Y.UP||o.keyCode===Y.DOWN)&&o.preventDefault()}function Ge(o){var u=Ve(o);switch(u!==oe&&$e(u),o.keyCode){case Y.ENTER:q(u);break;case Y.UP:q(u-1);break;case Y.DOWN:q(u+1);break}}function wt(o){q(Ve(o))}function Pt(o){var u=ae(o,M,d),C=s>u&&u!==0?u:s;be(o),$e(C),H==null||H(s,o),U(C),v==null||v(C,o)}function q(o){if(Nt(o)&&!V){var u=ae(void 0,M,d),C=o;return o>u?C=u:o<1&&(C=1),C!==oe&&$e(C),U(C),v==null||v(C,M),C}return s}var ye=s>1,xe=s<ae(void 0,M,d);function Je(){ye&&q(s-1)}function Fe(){xe&&q(s+1)}function Ue(){q(We)}function Qe(){q(Ke)}function se(o,u){if(o.key==="Enter"||o.charCode===Y.ENTER||o.keyCode===Y.ENTER){for(var C=arguments.length,k=new Array(C>2?C-2:0),we=2;we<C;we++)k[we-2]=arguments[we];u.apply(void 0,k)}}function Ot(o){se(o,Je)}function jt(o){se(o,Fe)}function Mt(o){se(o,Ue)}function Bt(o){se(o,Qe)}function Tt(o){var u=te(o,"prev",Ce(ie,"prev page"));return c.isValidElement(u)?c.cloneElement(u,{disabled:!ye}):u}function Dt(o){var u=te(o,"next",Ce(le,"next page"));return c.isValidElement(u)?c.cloneElement(u,{disabled:!xe}):u}function ze(o){(o.type==="click"||o.keyCode===Y.ENTER)&&q(oe)}var Ye=null,_t=Gt(t,{aria:!0,data:!0}),Rt=A&&c.createElement("li",{className:"".concat(i,"-total-text")},A(d,[d===0?0:(s-1)*M+1,s*M>d?d:s*M])),Ze=null,P=ae(void 0,M,d);if(N&&d<=M)return null;var T=[],ue={rootPrefixCls:i,onClick:q,onKeyPress:se,showTitle:w,itemRender:te,page:-1},Ht=s-1>0?s-1:0,Lt=s+1<P?s+1:P,Ne=l&&l.goButton,At=Jt(D)==="object"?D.readOnly:!D,de=Ne,ke=null;D&&(Ne&&(typeof Ne=="boolean"?de=c.createElement("button",{type:"button",onClick:ze,onKeyUp:ze},p.jump_to_confirm):de=c.createElement("span",{onClick:ze,onKeyUp:ze},Ne),de=c.createElement("li",{title:w?"".concat(p.jump_to).concat(s,"/").concat(P):null,className:"".concat(i,"-simple-pager")},de)),ke=c.createElement("li",{title:w?"".concat(s,"/").concat(P):null,className:"".concat(i,"-simple-pager")},At?oe:c.createElement("input",{type:"text","aria-label":p.jump_to,value:oe,disabled:V,onKeyDown:It,onKeyUp:Ge,onChange:Ge,onBlur:wt,size:3}),c.createElement("span",{className:"".concat(i,"-slash")},"/"),P));var Q=z?1:2;if(P<=3+Q*2){P||T.push(c.createElement(ve,G({},ue,{key:"noPager",page:1,className:"".concat(i,"-item-disabled")})));for(var me=1;me<=P;me+=1)T.push(c.createElement(ve,G({},ue,{key:me,page:me,active:s===me})))}else{var qt=z?p.prev_3:p.prev_5,Xt=z?p.next_3:p.next_5,et=te(We,"jump-prev",Ce(he,"prev page")),tt=te(Ke,"jump-next",Ce(F,"next page"));W&&(Ye=et?c.createElement("li",{title:w?qt:null,key:"prev",onClick:Ue,tabIndex:0,onKeyDown:Mt,className:E("".concat(i,"-jump-prev"),X({},"".concat(i,"-jump-prev-custom-icon"),!!he))},et):null,Ze=tt?c.createElement("li",{title:w?Xt:null,key:"next",onClick:Qe,tabIndex:0,onKeyDown:Bt,className:E("".concat(i,"-jump-next"),X({},"".concat(i,"-jump-next-custom-icon"),!!F))},tt):null);var Re=Math.max(1,s-Q),He=Math.min(s+Q,P);s-1<=Q&&(He=1+Q*2),P-s<=Q&&(Re=P-Q*2);for(var ge=Re;ge<=He;ge+=1)T.push(c.createElement(ve,G({},ue,{key:ge,page:ge,active:s===ge})));if(s-1>=Q*2&&s!==3&&(T[0]=c.cloneElement(T[0],{className:E("".concat(i,"-item-after-jump-prev"),T[0].props.className)}),T.unshift(Ye)),P-s>=Q*2&&s!==P-2){var it=T[T.length-1];T[T.length-1]=c.cloneElement(it,{className:E("".concat(i,"-item-before-jump-next"),it.props.className)}),T.push(Ze)}Re!==1&&T.unshift(c.createElement(ve,G({},ue,{key:1,page:1}))),He!==P&&T.push(c.createElement(ve,G({},ue,{key:P,page:P})))}var Ee=Tt(Ht);if(Ee){var Le=!ye||!P;Ee=c.createElement("li",{title:w?p.prev_page:null,onClick:Je,tabIndex:Le?null:0,onKeyDown:Ot,className:E("".concat(i,"-prev"),X({},"".concat(i,"-disabled"),Le)),"aria-disabled":Le},Ee)}var Ie=Dt(Lt);if(Ie){var pe,Ae;D?(pe=!xe,Ae=ye?0:null):(pe=!xe||!P,Ae=pe?null:0),Ie=c.createElement("li",{title:w?p.next_page:null,onClick:Fe,tabIndex:Ae,onKeyDown:jt,className:E("".concat(i,"-next"),X({},"".concat(i,"-disabled"),pe)),"aria-disabled":pe},Ie)}var Wt=E(i,f,X(X(X(X(X({},"".concat(i,"-start"),I==="start"),"".concat(i,"-center"),I==="center"),"".concat(i,"-end"),I==="end"),"".concat(i,"-simple"),D),"".concat(i,"-disabled"),V));return c.createElement("ul",G({className:Wt,style:b,ref:ce},_t),Rt,Ee,D?ke:T,Ie,c.createElement(xi,{locale:p,rootPrefixCls:i,disabled:V,selectPrefixCls:g,changeSize:Pt,pageSize:M,pageSizeOptions:Te,quickGo:Et?q:null,goButton:de,showSizeChanger:Me,sizeChangerRender:Be}))};const Ei=e=>{const{componentCls:t}=e;return{[`${t}-disabled`]:{"&, &:hover":{cursor:"not-allowed",[`${t}-item-link`]:{color:e.colorTextDisabled,cursor:"not-allowed"}},"&:focus-visible":{cursor:"not-allowed",[`${t}-item-link`]:{color:e.colorTextDisabled,cursor:"not-allowed"}}},[`&${t}-disabled`]:{cursor:"not-allowed",[`${t}-item`]:{cursor:"not-allowed",backgroundColor:"transparent","&:hover, &:active":{backgroundColor:"transparent"},a:{color:e.colorTextDisabled,backgroundColor:"transparent",border:"none",cursor:"not-allowed"},"&-active":{borderColor:e.colorBorder,backgroundColor:e.itemActiveBgDisabled,"&:hover, &:active":{backgroundColor:e.itemActiveBgDisabled},a:{color:e.itemActiveColorDisabled}}},[`${t}-item-link`]:{color:e.colorTextDisabled,cursor:"not-allowed","&:hover, &:active":{backgroundColor:"transparent"},[`${t}-simple&`]:{backgroundColor:"transparent","&:hover, &:active":{backgroundColor:"transparent"}}},[`${t}-simple-pager`]:{color:e.colorTextDisabled},[`${t}-jump-prev, ${t}-jump-next`]:{[`${t}-item-link-icon`]:{opacity:0},[`${t}-item-ellipsis`]:{opacity:1}}}}},Ii=e=>{const{componentCls:t}=e;return{[`&${t}-mini ${t}-total-text, &${t}-mini ${t}-simple-pager`]:{height:e.itemSizeSM,lineHeight:$(e.itemSizeSM)},[`&${t}-mini ${t}-item`]:{minWidth:e.itemSizeSM,height:e.itemSizeSM,margin:0,lineHeight:$(e.calc(e.itemSizeSM).sub(2).equal())},[`&${t}-mini ${t}-prev, &${t}-mini ${t}-next`]:{minWidth:e.itemSizeSM,height:e.itemSizeSM,margin:0,lineHeight:$(e.itemSizeSM)},[`&${t}-mini:not(${t}-disabled)`]:{[`${t}-prev, ${t}-next`]:{[`&:hover ${t}-item-link`]:{backgroundColor:e.colorBgTextHover},[`&:active ${t}-item-link`]:{backgroundColor:e.colorBgTextActive},[`&${t}-disabled:hover ${t}-item-link`]:{backgroundColor:"transparent"}}},[`
|
|
2
2
|
&${t}-mini ${t}-prev ${t}-item-link,
|
|
3
3
|
&${t}-mini ${t}-next ${t}-item-link
|
|
4
4
|
`]:{backgroundColor:"transparent",borderColor:"transparent","&::after":{height:e.itemSizeSM,lineHeight:$(e.itemSizeSM)}},[`&${t}-mini ${t}-jump-prev, &${t}-mini ${t}-jump-next`]:{height:e.itemSizeSM,marginInlineEnd:0,lineHeight:$(e.itemSizeSM)},[`&${t}-mini ${t}-options`]:{marginInlineStart:e.paginationMiniOptionsMarginInlineStart,"&-size-changer":{top:e.miniOptionsSizeChangerTop},"&-quick-jumper":{height:e.itemSizeSM,lineHeight:$(e.itemSizeSM),input:Object.assign(Object.assign({},ti(e)),{width:e.paginationMiniQuickJumperInputWidth,height:e.controlHeightSM})}}}},wi=e=>{const{componentCls:t}=e;return{[`&${t}-simple`]:{[`${t}-prev, ${t}-next`]:{height:e.itemSize,lineHeight:$(e.itemSize),verticalAlign:"top",[`${t}-item-link`]:{height:e.itemSize,backgroundColor:"transparent",border:0,"&:hover":{backgroundColor:e.colorBgTextHover},"&:active":{backgroundColor:e.colorBgTextActive},"&::after":{height:e.itemSize,lineHeight:$(e.itemSize)}}},[`${t}-simple-pager`]:{display:"inline-flex",alignItems:"center",height:e.itemSize,marginInlineEnd:e.marginXS,input:{boxSizing:"border-box",height:"100%",width:e.quickJumperInputWidth,padding:`0 ${$(e.paginationItemPaddingInline)}`,textAlign:"center",backgroundColor:e.itemInputBg,border:`${$(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadius,outline:"none",transition:`border-color ${e.motionDurationMid}`,color:"inherit","&:hover":{borderColor:e.colorPrimary},"&:focus":{borderColor:e.colorPrimaryHover,boxShadow:`${$(e.inputOutlineOffset)} 0 ${$(e.controlOutlineWidth)} ${e.controlOutline}`},"&[disabled]":{color:e.colorTextDisabled,backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,cursor:"not-allowed"}}},[`&${t}-disabled`]:{[`${t}-prev, ${t}-next`]:{[`${t}-item-link`]:{"&:hover, &:active":{backgroundColor:"transparent"}}}},[`&${t}-mini`]:{[`${t}-prev, ${t}-next`]:{height:e.itemSizeSM,lineHeight:$(e.itemSizeSM),[`${t}-item-link`]:{height:e.itemSizeSM,"&::after":{height:e.itemSizeSM,lineHeight:$(e.itemSizeSM)}}},[`${t}-simple-pager`]:{height:e.itemSizeSM,input:{width:e.paginationMiniQuickJumperInputWidth}}}}}},Pi=e=>{const{componentCls:t}=e;return{[`${t}-jump-prev, ${t}-jump-next`]:{outline:0,[`${t}-item-container`]:{position:"relative",[`${t}-item-link-icon`]:{color:e.colorPrimary,fontSize:e.fontSizeSM,opacity:0,transition:`all ${e.motionDurationMid}`,"&-svg":{top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,margin:"auto"}},[`${t}-item-ellipsis`]:{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,display:"block",margin:"auto",color:e.colorTextDisabled,letterSpacing:e.paginationEllipsisLetterSpacing,textAlign:"center",textIndent:e.paginationEllipsisTextIndent,opacity:1,transition:`all ${e.motionDurationMid}`}},"&:hover":{[`${t}-item-link-icon`]:{opacity:1},[`${t}-item-ellipsis`]:{opacity:0}}},[`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as c,jsx as e,Fragment as Me}from"react/jsx-runtime";import qe,{useState as _,forwardRef as He,useEffect as W,useMemo as ce,useImperativeHandle as Ve,useRef as ne}from"react";import{a as ge,a8 as ve,b as Ke,B as se,d as q,c as We,h as ke,i as O,F as de,a9 as _e,I as fe,S as Y,aa as Ze,ab as Ue,q as te,R as re,a6 as oe}from"./index-
|
|
1
|
+
import{jsxs as c,jsx as e,Fragment as Me}from"react/jsx-runtime";import qe,{useState as _,forwardRef as He,useEffect as W,useMemo as ce,useImperativeHandle as Ve,useRef as ne}from"react";import{a as ge,a8 as ve,b as Ke,B as se,d as q,c as We,h as ke,i as O,F as de,a9 as _e,I as fe,S as Y,aa as Ze,ab as Ue,q as te,R as re,a6 as oe}from"./index-BRq6VK9v.js";import{X as Xe}from"./x-D-pV1NCt.js";import{P as Fe}from"./plus-CldFV1Lg.js";import{M as Ee,s as Be}from"./style-BXl32bWg.js";import{S as Je}from"./index-DNMf-zgr.js";/**
|
|
2
2
|
* @license lucide-react v0.456.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as Ee,jsx as B,Fragment as _l}from"react/jsx-runtime";import*as p from"react";import X,{forwardRef as sr,createElement as Ya,version as dm,useMemo as _t,useState as vt,useRef as Pe,useCallback as Xe,useEffect as wt,useImperativeHandle as Ki,createContext as Li,useContext as An,Children as fm,useLayoutEffect as pm,isValidElement as mm}from"react";import{l as gm,b as hm,a as vm,J as ym,i as bm}from"./index-
|
|
1
|
+
import{jsxs as Ee,jsx as B,Fragment as _l}from"react/jsx-runtime";import*as p from"react";import X,{forwardRef as sr,createElement as Ya,version as dm,useMemo as _t,useState as vt,useRef as Pe,useCallback as Xe,useEffect as wt,useImperativeHandle as Ki,createContext as Li,useContext as An,Children as fm,useLayoutEffect as pm,isValidElement as mm}from"react";import{l as gm,b as hm,a as vm,J as ym,i as bm}from"./index-md7-ni21.js";import{d as Ht,c as xm,h as Cm,i as Js}from"./index-BRq6VK9v.js";import"./style-BXl32bWg.js";import*as wm from"react-dom";import $s,{flushSync as Xa,createPortal as dd,unstable_batchedUpdates as km}from"react-dom";var Gr=(e=>(e.FLAT="files",e.NAV="nav",e))(Gr||{});const Em=()=>B("div",{className:"main relative h-full w-full flex items-center justify-center",children:B("div",{className:"text-2xl font-bold",children:"\u5E94\u7528\u52A0\u8F7D\u4E2D..."})}),Sm=()=>B("div",{className:"main relative h-full w-full flex items-center justify-center",children:B("div",{className:"text-2xl font-bold",children:"\u5E94\u7528\u9519\u8BEF"})}),Am=()=>B("div",{className:"main relative h-full w-full flex items-center justify-center",children:B("div",{className:"text-lg font-medium",children:"\u5BB9\u5668\u52A0\u8F7D\u4E2D..."})}),Om=()=>B("div",{className:"main relative h-full w-full flex items-center justify-center",children:B("div",{className:"text-lg font-medium",children:"\u5BB9\u5668\u9519\u8BEF"})}),Im=()=>B("div",{className:"main relative h-full w-full flex items-center justify-center",children:B("div",{className:"text-base font-medium",children:"\u5185\u5BB9\u52A0\u8F7D\u4E2D..."})}),Nm=()=>B("div",{className:"main relative h-full w-full flex items-center justify-center",children:B("div",{className:"text-base font-medium",children:"\u5185\u5BB9\u9519\u8BEF"})}),Mm=({viewType:e,cardType:t})=>Ee("div",{className:"main relative h-full w-full flex flex-col items-center justify-center",children:[B("div",{className:"text-6xl mb-4",style:{color:"#d1d5db"},children:"\u{1F4ED}"}),B("div",{className:"text-lg font-medium mb-2",style:{color:"#6b7280"},children:e==="card"?"\u6682\u65E0\u6570\u636E":e==="table"?"\u6682\u65E0\u8868\u683C\u6570\u636E":"\u6682\u65E0\u6570\u636E"}),B("div",{className:"text-sm",style:{color:"#9ca3af"},children:e==="card"?"\u70B9\u51FB\u4E0A\u65B9\u6309\u94AE\u6DFB\u52A0\u6570\u636E":e==="table"?"\u8BF7\u5148\u6DFB\u52A0\u6570\u636E\u5230\u8868\u683C\u4E2D":"\u8BF7\u5148\u6DFB\u52A0\u6570\u636E"})]}),xn=(e,t)=>{console.log("[findNodeById] Searching for id:",t,"in nodes:",e);for(const n of e){if(console.log("[findNodeById] Checking node:",n),n.id===t)return console.log("[findNodeById] Found node:",n),n;if(n.children){const r=Array.isArray(n.children)?n.children:Object.values(n.children);console.log("[findNodeById] Searching in children:",r);const o=xn(r,t);if(o)return console.log("[findNodeById] Found in children:",o),o}}return console.log("[findNodeById] Node not found for id:",t),null},Za=e=>{for(const t of e){if(t.type)return t.id;if(t.children){const n=Array.isArray(t.children)?t.children:Object.values(t.children),r=Za(n);if(r)return r}}},Pm=e=>{const t=n=>{let r=[];return n.children&&(r=Array.isArray(n.children)?n.children:Object.values(n.children)),{title:n.label,key:n.id,children:r.length>0?r.map(t):void 0,selectable:!0}};return e.map(t)},Fm=(e,t)=>Array.isArray(e)?t==="table"?e.filter(n=>n&&n.data&&Array.isArray(n.data)):e:e&&typeof e=="object"?[e]:[],Rm=e=>{const t=new Set;return e.forEach(n=>{n.adding&&t.add(n.id)}),t},Bm=(e,t)=>{const[n,r]=vt(()=>{const g=Array.isArray(e)?e:[];return console.log("[useAppState] \u521D\u59CB\u5316innerData:",g),g}),[o,i]=vt(new Set),[a,s]=vt(new Set),[l,c]=vt(""),[u,d]=vt([]);wt(()=>{if(console.log("[useAppState] \u6570\u636E\u6E90\u53D8\u5316:",{dataSource:e,activeNodeType:t}),t==="form"){const f=Array.isArray(e)?e:[];r(f);return}const g=Fm(e,t);console.log("[useAppState] \u9A8C\u8BC1\u540E\u7684\u6570\u636E:",g),r(g);const v=Rm(g);s(v),d([])},[e,t]);const m=Xe(()=>{d([]),c(""),i(new Set)},[]);return{innerData:n,setInnerData:r,pendingIds:o,setPendingIds:i,addingIds:a,setAddingIds:s,fuzzyValue:l,setFuzzyValue:c,selectedIds:u,setSelectedIds:d,resetStateOnNodeChange:m}},jm=(e,t,n,r,o,i,a)=>{const s=Xe((S,M)=>{const{tableId:P,...O}=M||{};M!=null&&M.animate?(r(S.id),e(N=>{if(P)return N.map(R=>{if(R.id===P){const T=[...R.children||[],{...S,adding:!0}];return{...R,children:T}}return R});const F={...S,adding:!0};if((O==null?void 0:O.position)==="start"||(O==null?void 0:O.position)===void 0)return[F,...N];if(typeof(O==null?void 0:O.position)=="number"){const R=[...N];return R.splice(O.position,0,F),R}return[F,...N]})):e(N=>{if(P)return N.map(F=>{if(F.id===P){const R=[...F.children||[],S];return{...F,children:R}}return F});if((O==null?void 0:O.position)==="start")return[S,...N];if(typeof(O==null?void 0:O.position)=="number"){const F=[...N];return F.splice(O.position,0,S),F}return[...N,S]})},[e,r]),l=Xe((S,M)=>{S&&e(P=>{if(!Array.isArray(P))return console.warn("[useAppFunctions] removeItem: prev\u4E0D\u662F\u6570\u7EC4\uFF0C\u91CD\u7F6E\u4E3A\u7A7A\u6570\u7EC4"),[];if(M)return P.map(N=>{if(N.id===M&&N.children){const F=N.children.map(R=>R.id===S?{...R,removing:!0}:R);return{...N,children:F}}return N});const O=P.map(N=>N.id===S?{...N,removing:!0}:N);return console.log("[useAppFunctions] removeItem \u8BBE\u7F6Eremoving",S,O),O})},[e]),c=Xe((S,M)=>{e(P=>Array.isArray(P)?P.map(O=>{if(O.id===M&&O.children){const N=O.children.filter(F=>F.id!==S);if(N.length===0){const{children:F,...R}=O;return R}return{...O,children:N}}return O}):[])},[e]),u=Xe((S,M)=>{!S||S.length===0||e(P=>{if(!Array.isArray(P))return console.warn("[useAppFunctions] removeItems: prev\u4E0D\u662F\u6570\u7EC4\uFF0C\u91CD\u7F6E\u4E3A\u7A7A\u6570\u7EC4"),[];if(M)return P.map(N=>{if(N.id===M&&N.children){const F=N.children.map(R=>S.includes(R.id)?{...R,removing:!0}:R);return{...N,children:F}}return N});const O=P.map(N=>S.includes(N.id)?{...N,removing:!0}:N);return console.log("[useAppFunctions] removeItems \u8BBE\u7F6Eremoving",S,O),O})},[e]),d=Xe(S=>{e(M=>{const P=M.find(O=>O.id===S);return P?P.hasOwnProperty("children")?(console.error(`[addSubTable] \u884C ${S} \u5DF2\u7ECF\u6709\u5B50table\u529F\u80FD\uFF0C\u65E0\u9700\u91CD\u590D\u6DFB\u52A0`),M):M.map(O=>O.id===S?{...O,children:[]}:O):(console.error(`[addSubTable] \u672A\u627E\u5230ID\u4E3A ${S} \u7684\u884C`),M)})},[e]),m=Xe(S=>{e(M=>{const P=M.find(N=>N.id===S);if(!P)return console.error(`[deleteSubTable] \u672A\u627E\u5230ID\u4E3A ${S} \u7684\u884C`),M;if(!P.hasOwnProperty("children"))return console.error(`[deleteSubTable] \u884C ${S} \u6CA1\u6709\u5B50table\u529F\u80FD`),M;const O=(P.children||[]).filter(N=>!N.removing).length;return O>0?(console.error(`[deleteSubTable] \u884C ${S} \u7684\u5B50table\u8FD8\u6709 ${O} \u6761\u6570\u636E\uFF0C\u65E0\u6CD5\u5220\u9664\u5B50table\u529F\u80FD\u3002\u8BF7\u5148\u5220\u9664\u6240\u6709\u5B50table\u6570\u636E\u3002`),M):M.map(N=>{if(N.id===S&&N.hasOwnProperty("children")){const{children:F,...R}=N;return R}return N})})},[e]),g=Xe((S,M,P)=>{M&&e(O=>O.map(N=>P&&N.id===P&&N.children?{...N,children:N.children.map(F=>F.id===M&&typeof F=="object"?v(F,S):F)}:N.id===M&&typeof N=="object"?v(N,S):N))},[e]),v=Xe((S,M)=>{if(Array.isArray(M)){const P=[...S.data];return M.forEach(O=>{const N=P.findIndex(F=>F.columnId===O.columnId);N>=0?P[N]={...P[N],value:O.value}:P.push(O)}),{...S,data:P}}else if(typeof M=="object")return{...S,...M};return S},[]),f=Xe(S=>{if(!S)return;const M=document.querySelector(`[data-item-id="${S}"]`);M&&M.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"})},[]),h=Xe((S,M)=>{e(M?P=>P.map(O=>{if(O.id!==M)return O;if(!O.hasOwnProperty("children"))return console.warn(`[useAppFunctions] \u884C ${M} \u6CA1\u6709children\u5B57\u6BB5\uFF0C\u8DF3\u8FC7\u66F4\u65B0`),O;const N=O.children||[],F=N.findIndex(R=>R.id===S.id);if(F>=0){const R=[...N];return R[F]=S,{...O,children:R}}else return{...O,children:[...N,S]}}):Array.isArray(S)?S:[])},[e]);Xe(S=>{e(M=>Array.isArray(M)?Array.isArray(S)?[...M,...S]:M:Array.isArray(S)?S:[])},[e]);const y=Xe(S=>{t(S)},[t]),x=Xe(S=>{e(M=>M.map(P=>P.id===S?{...P,tableLoading:!0}:P))},[e]),b=Xe(S=>{e(M=>M.map(P=>P.id===S?{...P,tableLoading:!1}:P))},[e]),E=Xe(S=>{n(S)},[n]),w=Xe(S=>i.has(S),[i]),k=Xe(S=>{r(S)},[r]),A=Xe(S=>{o(S)},[o]),C=Xe(S=>a.has(S),[a]);return{addItem:s,removeItem:l,removeItems:u,updateItem:g,scrollToItem:f,syncSourceData:h,addPending:y,removePending:E,isPending:w,addAdding:k,removeAdding:A,isAdding:C,tablePending:x,removeTablePending:b,addSubTable:d,deleteSubTable:m,removeSubTableRow:c}};/**
|
|
2
2
|
* @license lucide-react v0.456.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|