bi-components-library 1.0.4 → 1.0.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/dist/bi-components-library.css +1 -1
- package/dist/index.es.js +1734 -679
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +6 -6
- package/dist/index.umd.js.map +1 -1
- package/package.json +9 -15
package/dist/index.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(X,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("react"),require("antd"),require("@ant-design/icons"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","antd","@ant-design/icons","react-dom"],r):(X=typeof globalThis<"u"?globalThis:X||self,r(X.SealSeekBIComponents={},X.React,X.antd,X.AntdIcons,X.ReactDOM))})(this,function(X,r,B,ce,Oe){"use strict";var fe={exports:{}},de={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var ve;function qe(){if(ve)return de;ve=1;var t=Symbol.for("react.transitional.element"),f=Symbol.for("react.fragment");function d(l,c,y){var S=null;if(y!==void 0&&(S=""+y),c.key!==void 0&&(S=""+c.key),"key"in c){y={};for(var g in c)g!=="key"&&(y[g]=c[g])}else y=c;return c=y.ref,{$$typeof:t,type:l,key:S,ref:c!==void 0?c:null,props:y}}return de.Fragment=f,de.jsx=d,de.jsxs=d,de}var pe={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,20 +14,20 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
17
|
+
*/var xe;function Me(){return xe||(xe=1,process.env.NODE_ENV!=="production"&&function(){function t(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===H?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case C:return"Fragment";case x:return"Profiler";case b:return"StrictMode";case I:return"Suspense";case q:return"SuspenseList";case D:return"Activity"}if(typeof i=="object")switch(typeof i.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),i.$$typeof){case j:return"Portal";case w:return(i.displayName||"Context")+".Provider";case N:return(i._context.displayName||"Context")+".Consumer";case T:var O=i.render;return i=i.displayName,i||(i=O.displayName||O.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case M:return O=i.displayName||null,O!==null?O:t(i.type)||"Memo";case F:O=i._payload,i=i._init;try{return t(i(O))}catch{}}return null}function f(i){return""+i}function d(i){try{f(i);var O=!1}catch{O=!0}if(O){O=console;var z=O.error,Q=typeof Symbol=="function"&&Symbol.toStringTag&&i[Symbol.toStringTag]||i.constructor.name||"Object";return z.call(O,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",Q),f(i)}}function l(i){if(i===C)return"<>";if(typeof i=="object"&&i!==null&&i.$$typeof===F)return"<...>";try{var O=t(i);return O?"<"+O+">":"<...>"}catch{return"<...>"}}function c(){var i=P.A;return i===null?null:i.getOwner()}function y(){return Error("react-stack-top-frame")}function S(i){if(U.call(i,"key")){var O=Object.getOwnPropertyDescriptor(i,"key").get;if(O&&O.isReactWarning)return!1}return i.key!==void 0}function g(i,O){function z(){V||(V=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",O))}z.isReactWarning=!0,Object.defineProperty(i,"key",{get:z,configurable:!0})}function e(){var i=t(this.type);return K[i]||(K[i]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),i=this.props.ref,i!==void 0?i:null}function a(i,O,z,Q,re,u,m,s){return z=u.ref,i={$$typeof:o,type:i,key:O,props:u,_owner:re},(z!==void 0?z:null)!==null?Object.defineProperty(i,"ref",{enumerable:!1,get:e}):Object.defineProperty(i,"ref",{enumerable:!1,value:null}),i._store={},Object.defineProperty(i._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(i,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(i,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:m}),Object.defineProperty(i,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:s}),Object.freeze&&(Object.freeze(i.props),Object.freeze(i)),i}function R(i,O,z,Q,re,u,m,s){var h=O.children;if(h!==void 0)if(Q)if(ee(h)){for(Q=0;Q<h.length;Q++)n(h[Q]);Object.freeze&&Object.freeze(h)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else n(h);if(U.call(O,"key")){h=t(i);var v=Object.keys(O).filter(function(_){return _!=="key"});Q=0<v.length?"{key: someKey, "+v.join(": ..., ")+": ...}":"{key: someKey}",se[h+Q]||(v=0<v.length?"{"+v.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
18
18
|
let props = %s;
|
|
19
19
|
<%s {...props} />
|
|
20
20
|
React keys must be passed directly to JSX without using spread:
|
|
21
21
|
let props = %s;
|
|
22
|
-
<%s key={someKey} {...props} />`,B,g,H,g),J[g+B]=!0)}if(g=null,x!==void 0&&(i(x),g=""+x),_(d)&&(i(d.key),g=""+d.key),"key"in d){x={};for(var K in d)K!=="key"&&(x[K]=d[K])}else x=d;return g&&p(x,typeof e=="function"?e.displayName||e.name||"Unknown":e),N(e,g,M,G,s(),x,$,m)}function A(e){typeof e=="object"&&e!==null&&e.$$typeof===b&&e._store&&(e._store.validated=1)}var P=t,b=Symbol.for("react.transitional.element"),V=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),y=Symbol.for("react.profiler"),v=Symbol.for("react.consumer"),C=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),W=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),F=Symbol.for("react.lazy"),R=Symbol.for("react.activity"),L=Symbol.for("react.client.reference"),E=P.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=Object.prototype.hasOwnProperty,Y=Array.isArray,a=console.createTask?console.createTask:function(){return null};P={react_stack_bottom_frame:function(e){return e()}};var u,S={},j=P.react_stack_bottom_frame.bind(P,f)(),U=a(c(f)),J={};Z.Fragment=O,Z.jsx=function(e,d,x,B,G){var M=1e4>E.recentlyCreatedOwnerStacks++;return I(e,d,x,!1,B,G,M?Error("react-stack-top-frame"):j,M?a(c(e)):U)},Z.jsxs=function(e,d,x,B,G){var M=1e4>E.recentlyCreatedOwnerStacks++;return I(e,d,x,!0,B,G,M?Error("react-stack-top-frame"):j,M?a(c(e)):U)}}()),Z}var ae;function we(){return ae||(ae=1,process.env.NODE_ENV==="production"?ee.exports=he():ee.exports=be()),ee.exports}var n=we();const oe=({variant:r="primary",loading:l=!1,children:i,...c})=>{const s=f=>{switch(f){case"primary":return"primary";case"ghost":return"default";case"dashed":return"dashed";case"link":return"link";case"text":return"text";default:return"primary"}};return n.jsx(w.Button,{...c,type:s(r),loading:l,ghost:r==="ghost",children:i})};oe.__docgenInfo={displayName:"Button",description:"基础按钮,用于触发操作",props:{variant:{name:"variant",required:!1,description:"视觉风格",type:{name:"ButtonVariant",raw:'"primary" | "ghost" | "dashed" | "link" | "text"'},defaultValue:{value:'"primary"'}},loading:{name:"loading",required:!1,description:"是否加载中",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}},children:{name:"children",required:!1,description:"按钮内容",type:{name:"ReactNode",raw:"React.ReactNode"}},size:{name:"size",required:!1,description:"按钮大小",type:{name:"ButtonSize",raw:'"small" | "middle" | "large"'}},disabled:{name:"disabled",required:!1,description:"是否禁用",type:{name:"boolean",raw:"boolean"}},onClick:{name:"onClick",required:!1,description:"点击事件",type:{name:"function",raw:"(event: MouseEvent) => void"}}}};const se=({title:r,children:l,bordered:i=!0,hoverable:c=!1,size:s="default",...f})=>n.jsx(w.Card,{...f,title:r,bordered:i,hoverable:c,size:s,children:l});se.__docgenInfo={displayName:"Card",description:"卡片容器,用于分组内容",props:{title:{name:"title",required:!1,description:"标题",type:{name:"ReactNode",raw:"React.ReactNode"}},children:{name:"children",required:!1,description:"内容区域",type:{name:"ReactNode",raw:"React.ReactNode"}},bordered:{name:"bordered",required:!1,description:"是否显示边框",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},hoverable:{name:"hoverable",required:!1,description:"是否可悬停",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}},size:{name:"size",required:!1,description:"卡片大小",type:{name:"CardSize",raw:'"default" | "small"'},defaultValue:{value:'"default"'}},loading:{name:"loading",required:!1,description:"是否加载中",type:{name:"boolean",raw:"boolean"}},actions:{name:"actions",required:!1,description:"卡片操作组",type:{name:"ReactNode[]",raw:"React.ReactNode[]"}}}};const ie=({showDefaultFooter:r=!0,...l})=>{const i=l.footer!==void 0?l.footer:r?(c,{OkBtn:s,CancelBtn:f})=>n.jsxs(n.Fragment,{children:[n.jsx(s,{}),n.jsx(f,{})]}):null;return n.jsx(w.Modal,{...l,footer:i})};ie.__docgenInfo={displayName:"AppModal",description:"应用级模态框组件,基于 Ant Design Modal 封装",props:{showDefaultFooter:{name:"showDefaultFooter",required:!1,description:"是否显示默认的确定和取消按钮",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},title:{name:"title",required:!1,description:"模态框标题",type:{name:"ReactNode",raw:"React.ReactNode"}},open:{name:"open",required:!1,description:"是否显示模态框",type:{name:"boolean",raw:"boolean"}},onCancel:{name:"onCancel",required:!1,description:"取消按钮点击事件",type:{name:"function",raw:"(e: React.MouseEvent<HTMLElement>) => void"}},onOk:{name:"onOk",required:!1,description:"确定按钮点击事件",type:{name:"function",raw:"(e: React.MouseEvent<HTMLElement>) => void"}},children:{name:"children",required:!1,description:"模态框内容",type:{name:"ReactNode",raw:"React.ReactNode"}},width:{name:"width",required:!1,description:"模态框宽度",type:{name:"string | number",raw:"string | number"}},centered:{name:"centered",required:!1,description:"是否居中显示",type:{name:"boolean",raw:"boolean"}},maskClosable:{name:"maskClosable",required:!1,description:"点击蒙层是否允许关闭",type:{name:"boolean",raw:"boolean"}}}};const le=({scrollX:r,showPagination:l=!0,defaultPageSize:i=10,...c})=>n.jsx(w.Table,{...c,scroll:{x:r||"max-content",y:"50vh"},pagination:l?{hideOnSinglePage:!0,showSizeChanger:!0,showQuickJumper:!0,defaultPageSize:i,...c.pagination}:!1});le.__docgenInfo={displayName:"PageTable",description:"页面级表格组件,高度铺满容器,自动滚动",props:{scrollX:{name:"scrollX",required:!1,description:"水平滚动宽度",type:{name:"number",raw:"number"}},showPagination:{name:"showPagination",required:!1,description:"是否显示分页器",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},defaultPageSize:{name:"defaultPageSize",required:!1,description:"默认页面大小",type:{name:"number",raw:"number"},defaultValue:{value:"10"}},columns:{name:"columns",required:!1,description:"表格列配置",type:{name:"ColumnType[]",raw:"ColumnType<any>[]"}},dataSource:{name:"dataSource",required:!1,description:"数据源",type:{name:"any[]",raw:"any[]"}},loading:{name:"loading",required:!1,description:"是否加载中",type:{name:"boolean",raw:"boolean"}},rowKey:{name:"rowKey",required:!1,description:"行数据的 Key",type:{name:"string | function",raw:"string | ((record: any) => string)"}}}};const ve=X.createFromIconfontCN({scriptUrl:["https://at.alicdn.com/t/c/font_4968458_eh91gfr4j9e.js"]}),ce=({name:r,size:l,color:i,style:c,...s})=>{const f={fontSize:l,color:i,...c};return n.jsx(ve,{...s,type:r,style:f})};ce.__docgenInfo={displayName:"XcIcon",description:"自定义图标组件,基于 iconfont",props:{name:{name:"name",required:!0,description:"图标名称",type:{name:"string",raw:"string"}},size:{name:"size",required:!1,description:"图标大小",type:{name:"number | string",raw:"number | string"}},color:{name:"color",required:!1,description:"图标颜色",type:{name:"string",raw:"string"}},className:{name:"className",required:!1,description:"自定义类名",type:{name:"string",raw:"string"}},style:{name:"style",required:!1,description:"自定义样式",type:{name:"CSSProperties",raw:"React.CSSProperties"}}}};const ue=({loading:r,description:l="暂无数据",className:i,emptyChildren:c,loadingText:s,emptyImage:f})=>r?n.jsxs(w.Flex,{className:`pt-10 w-full ${i||""}`,align:"center",justify:"center",vertical:!0,children:[n.jsx(w.Spin,{size:"large"}),s&&n.jsx("div",{className:"mt-4 text-gray-500",children:s})]}):n.jsx(w.Flex,{className:`pt-10 w-full ${i||""}`,align:"center",justify:"center",children:n.jsx(w.Empty,{image:f,description:l,imageStyle:{height:180},children:c})});ue.__docgenInfo={displayName:"EmptyAndSpin",description:"空状态和加载状态组合组件",props:{loading:{name:"loading",required:!0,description:"是否加载中",type:{name:"boolean",raw:"boolean"}},description:{name:"description",required:!1,description:"空状态描述",type:{name:"ReactNode",raw:"React.ReactNode"},defaultValue:{value:'"暂无数据"'}},className:{name:"className",required:!1,description:"自定义类名",type:{name:"string",raw:"string"}},emptyChildren:{name:"emptyChildren",required:!1,description:"空状态额外内容",type:{name:"ReactNode",raw:"React.ReactNode"}},loadingText:{name:"loadingText",required:!1,description:"加载中提示文字",type:{name:"string",raw:"string"}},emptyImage:{name:"emptyImage",required:!1,description:"空状态图片",type:{name:"string",raw:"string"}}}};const de=({onClick:r,showText:l=!1,className:i,size:c="small",type:s="default"})=>n.jsx(w.Button,{size:c,type:s,icon:n.jsx(X.LeftOutlined,{}),className:`cursor-pointer ${i||""}`,onClick:r,children:l&&"返回"});de.__docgenInfo={displayName:"BackButton",description:"返回按钮组件",props:{onClick:{name:"onClick",required:!1,description:"点击事件",type:{name:"function",raw:"() => void"}},showText:{name:"showText",required:!1,description:"是否显示文字",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}},className:{name:"className",required:!1,description:"自定义类名",type:{name:"string",raw:"string"}},size:{name:"size",required:!1,description:"按钮大小",type:{name:"ButtonSize",raw:'"small" | "middle" | "large"'},defaultValue:{value:'"small"'}},type:{name:"type",required:!1,description:"按钮类型",type:{name:"ButtonType",raw:'"primary" | "default" | "dashed" | "link" | "text"'},defaultValue:{value:'"default"'}}}};const fe=({removePadding:r=!0,className:l,...i})=>{const c=r?`px-0 h-auto ${l||""}`:l;return n.jsx(w.Button,{type:"link",...i,className:c,children:i.children})};fe.__docgenInfo={displayName:"LinkButton",description:"链接样式按钮组件,适用于表格操作列",props:{removePadding:{name:"removePadding",required:!1,description:"是否去除默认内边距",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},children:{name:"children",required:!1,description:"按钮内容",type:{name:"ReactNode",raw:"React.ReactNode"}},onClick:{name:"onClick",required:!1,description:"点击事件",type:{name:"function",raw:"(event: React.MouseEvent<HTMLButtonElement>) => void"}},disabled:{name:"disabled",required:!1,description:"是否禁用",type:{name:"boolean",raw:"boolean"}},className:{name:"className",required:!1,description:"自定义类名",type:{name:"string",raw:"string"}}}};const{Option:xe}=w.Select,me=({columns:r,request:l,searchFields:i=[],showSearch:c=!0,showRefresh:s=!0,defaultPageSize:f=10,pageSizeOptions:_=["10","20","50","100"],autoLoad:p=!0,externalParams:k={},...N})=>{const[I,A]=t.useState([]),[P,b]=t.useState(!1),[V,O]=t.useState({current:1,pageSize:f,total:0}),[o,y]=t.useState({}),[v,C]=t.useState({}),[h]=w.Form.useForm(),D=t.useRef(V);D.current=V;const W=t.useRef(k);W.current=k;const z=t.useRef(!1),F=t.useMemo(()=>r.map(a=>{const{sortable:u,render:S,...j}=a;return{...j,sorter:u?!0:void 0,render:S||(U=>U)}}),[r]),R=t.useCallback(async(a={})=>{if(l){b(!0);try{const u={page:D.current.current,pageSize:D.current.pageSize,sortField:v.field,sortOrder:v.order,searchParams:{...o,...W.current},...a},S=await l(u);S.success&&(A(S.data),O(j=>({...j,total:S.total,current:u.page||j.current})))}catch(u){console.error("加载数据失败:",u)}finally{b(!1)}}},[l,v,o]),L=t.useCallback(a=>{y(a),O(u=>({...u,current:1}))},[]),E=t.useCallback(()=>{h.resetFields(),y({}),O(a=>({...a,current:1}))},[h]),q=t.useCallback(()=>{R()},[R]),Y=t.useCallback((a,u,S)=>{const j={current:a.current||1,pageSize:a.pageSize||f,total:a.total||0},U={field:S?.field,order:S?.order};O(j),C(U)},[f]);return t.useEffect(()=>{const a=Object.keys(k).length>0;(p&&!z.current||a)&&(R(),z.current=!0)},[p,k,R]),n.jsxs("div",{children:[c&&i.length>0&&n.jsx(w.Card,{size:"small",style:{marginBottom:16},children:n.jsxs(w.Form,{form:h,layout:"inline",onFinish:L,initialValues:i.reduce((a,u)=>(u.defaultValue!==void 0&&(a[u.key]=u.defaultValue),a),{}),children:[i.map(a=>n.jsx(w.Form.Item,{name:a.key,label:a.label,children:a.type==="input"?n.jsx(w.Input,{placeholder:a.placeholder||`请输入${a.label}`,style:{width:200}}):n.jsx(w.Select,{placeholder:a.placeholder||`请选择${a.label}`,style:{width:200},allowClear:!0,children:a.options?.map(u=>n.jsx(xe,{value:u.value,children:u.label},u.value))})},a.key)),n.jsx(w.Form.Item,{children:n.jsxs(w.Space,{children:[n.jsx(w.Button,{type:"primary",htmlType:"submit",icon:n.jsx(X.SearchOutlined,{}),children:"查询"}),n.jsx(w.Button,{onClick:E,children:"重置"}),s&&n.jsx(w.Button,{icon:n.jsx(X.ReloadOutlined,{}),onClick:q,children:"刷新"})]})})]})}),n.jsx(w.Table,{...N,columns:F,dataSource:I,loading:P,pagination:{...V,showSizeChanger:!0,showQuickJumper:!0,showTotal:(a,u)=>`第 ${u[0]}-${u[1]} 条/共 ${a} 条`,pageSizeOptions:_},onChange:Y,scroll:{x:"max-content",y:"50vh"}})]})};me.__docgenInfo={displayName:"AdvancedTable",description:"高阶表格组件,支持异步请求、搜索、排序等功能",props:{columns:{name:"columns",required:!0,description:"列配置",type:{name:"AdvancedColumnType[]",raw:"AdvancedColumnType<any>[]"}},request:{name:"request",required:!1,description:"异步请求函数",type:{name:"function",raw:"(params: RequestParams) => Promise<RequestResponse>"}},searchFields:{name:"searchFields",required:!1,description:"搜索字段配置",type:{name:"SearchFieldConfig[]",raw:"SearchFieldConfig[]"},defaultValue:{value:"[]"}},showSearch:{name:"showSearch",required:!1,description:"是否显示搜索区域",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},showRefresh:{name:"showRefresh",required:!1,description:"是否显示刷新按钮",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},defaultPageSize:{name:"defaultPageSize",required:!1,description:"默认页面大小",type:{name:"number",raw:"number"},defaultValue:{value:"10"}},pageSizeOptions:{name:"pageSizeOptions",required:!1,description:"页面大小选项",type:{name:"string[]",raw:"string[]"},defaultValue:{value:'["10", "20", "50", "100"]'}},autoLoad:{name:"autoLoad",required:!1,description:"是否自动加载",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},externalParams:{name:"externalParams",required:!1,description:"外部请求参数",type:{name:"Record<string, any>",raw:"Record<string, any>"},defaultValue:{value:"{}"}}}};const pe=({texts:r=[],placeholder:l="请输入内容",animationSpeed:i=100,autoPlay:c=!0,value:s,onChange:f,..._})=>{const[p,k]=t.useState(""),[N,I]=t.useState(0),[A,P]=t.useState(!1),[b,V]=t.useState(!1),[O,o]=t.useState(!1),y=t.useRef(void 0),v=t.useRef(void 0),C=t.useRef(r),h=t.useRef(N),D=t.useRef(b),W=t.useRef(p);t.useEffect(()=>{C.current=r,h.current=N,D.current=b,W.current=p});const z=t.useCallback((a,u)=>{let S=0;o(!0);const j=()=>{S<a.length?(k(a.slice(0,S+1)),S++,v.current=window.setTimeout(j,i)):(o(!1),u?.())};j()},[i]),F=t.useCallback(a=>{let u=W.current.length;const S=()=>{u>0?(k(W.current.slice(0,u-1)),u--,v.current=window.setTimeout(S,i/2)):a?.()};S()},[i]),R=t.useCallback(()=>{if(C.current.length===0||D.current)return;P(!0);const a=C.current[h.current];W.current?F(()=>{z(a,()=>{y.current=window.setTimeout(()=>{I(u=>(u+1)%C.current.length),P(!1)},2e3)})}):z(a,()=>{y.current=window.setTimeout(()=>{I(u=>(u+1)%C.current.length),P(!1)},2e3)})},[F,z]);t.useEffect(()=>(c&&r.length>0&&!b&&R(),()=>{y.current&&window.clearTimeout(y.current),v.current&&window.clearTimeout(v.current)}),[N,b,c,r.length,R]),t.useEffect(()=>{!A&&c&&r.length>0&&!b&&R()},[N,A,c,r.length,b,R]);const L=a=>{V(!0),y.current&&window.clearTimeout(y.current),v.current&&window.clearTimeout(v.current),P(!1),o(!1),_.onFocus?.(a)},E=a=>{V(!1),!s&&r.length>0&&(k(""),I(0)),_.onBlur?.(a)},q=a=>{f?.(a.target.value),_.onChange?.(a)},Y=()=>b||s?l:p||l;return n.jsxs("div",{style:{position:"relative"},children:[n.jsx(w.Input,{..._,value:s,onChange:q,onFocus:L,onBlur:E,placeholder:Y(),style:{..._.style,position:"relative",zIndex:1}}),!b&&!s&&p&&n.jsxs("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",paddingLeft:11,paddingRight:11,color:"#bfbfbf",pointerEvents:"none",zIndex:2,fontSize:14,fontFamily:"inherit"},children:[n.jsx("span",{children:p}),O&&n.jsx("span",{style:{display:"inline-block",width:1,height:"1.2em",backgroundColor:"#1890ff",marginLeft:2,animation:"blink 1s infinite"}})]}),n.jsx("style",{children:`
|
|
22
|
+
<%s key={someKey} {...props} />`,Q,h,v,h),se[h+Q]=!0)}if(h=null,z!==void 0&&(d(z),h=""+z),S(O)&&(d(O.key),h=""+O.key),"key"in O){z={};for(var k in O)k!=="key"&&(z[k]=O[k])}else z=O;return h&&g(z,typeof i=="function"?i.displayName||i.name||"Unknown":i),a(i,h,u,re,c(),z,m,s)}function n(i){typeof i=="object"&&i!==null&&i.$$typeof===o&&i._store&&(i._store.validated=1)}var A=r,o=Symbol.for("react.transitional.element"),j=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),x=Symbol.for("react.profiler"),N=Symbol.for("react.consumer"),w=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),q=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),F=Symbol.for("react.lazy"),D=Symbol.for("react.activity"),H=Symbol.for("react.client.reference"),P=A.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U=Object.prototype.hasOwnProperty,ee=Array.isArray,E=console.createTask?console.createTask:function(){return null};A={react_stack_bottom_frame:function(i){return i()}};var V,K={},J=A.react_stack_bottom_frame.bind(A,y)(),oe=E(l(y)),se={};pe.Fragment=C,pe.jsx=function(i,O,z,Q,re){var u=1e4>P.recentlyCreatedOwnerStacks++;return R(i,O,z,!1,Q,re,u?Error("react-stack-top-frame"):J,u?E(l(i)):oe)},pe.jsxs=function(i,O,z,Q,re){var u=1e4>P.recentlyCreatedOwnerStacks++;return R(i,O,z,!0,Q,re,u?Error("react-stack-top-frame"):J,u?E(l(i)):oe)}}()),pe}var we;function De(){return we||(we=1,process.env.NODE_ENV==="production"?fe.exports=qe():fe.exports=Me()),fe.exports}var p=De();const Ee=({variant:t="primary",loading:f=!1,children:d,...l})=>{const c=y=>{switch(y){case"primary":return"primary";case"ghost":return"default";case"dashed":return"dashed";case"link":return"link";case"text":return"text";default:return"primary"}};return p.jsx(B.Button,{...l,type:c(t),loading:f,ghost:t==="ghost",children:d})};Ee.__docgenInfo={displayName:"Button",description:"基础按钮,用于触发操作",props:{variant:{name:"variant",required:!1,description:"视觉风格",type:{name:"ButtonVariant",raw:'"primary" | "ghost" | "dashed" | "link" | "text"'},defaultValue:{value:'"primary"'}},loading:{name:"loading",required:!1,description:"是否加载中",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}},children:{name:"children",required:!1,description:"按钮内容",type:{name:"ReactNode",raw:"React.ReactNode"}},size:{name:"size",required:!1,description:"按钮大小",type:{name:"ButtonSize",raw:'"small" | "middle" | "large"'}},disabled:{name:"disabled",required:!1,description:"是否禁用",type:{name:"boolean",raw:"boolean"}},onClick:{name:"onClick",required:!1,description:"点击事件",type:{name:"function",raw:"(event: MouseEvent) => void"}}}};const ke=({title:t,children:f,bordered:d=!0,hoverable:l=!1,size:c="default",...y})=>p.jsx(B.Card,{...y,title:t,bordered:d,hoverable:l,size:c,children:f});ke.__docgenInfo={displayName:"Card",description:"卡片容器,用于分组内容",props:{title:{name:"title",required:!1,description:"标题",type:{name:"ReactNode",raw:"React.ReactNode"}},children:{name:"children",required:!1,description:"内容区域",type:{name:"ReactNode",raw:"React.ReactNode"}},bordered:{name:"bordered",required:!1,description:"是否显示边框",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},hoverable:{name:"hoverable",required:!1,description:"是否可悬停",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}},size:{name:"size",required:!1,description:"卡片大小",type:{name:"CardSize",raw:'"default" | "small"'},defaultValue:{value:'"default"'}},loading:{name:"loading",required:!1,description:"是否加载中",type:{name:"boolean",raw:"boolean"}},actions:{name:"actions",required:!1,description:"卡片操作组",type:{name:"ReactNode[]",raw:"React.ReactNode[]"}}}};const Te=({showDefaultFooter:t=!0,...f})=>{const d=f.footer!==void 0?f.footer:t?(l,{OkBtn:c,CancelBtn:y})=>p.jsxs(p.Fragment,{children:[p.jsx(c,{}),p.jsx(y,{})]}):null;return p.jsx(B.Modal,{...f,footer:d})};Te.__docgenInfo={displayName:"AppModal",description:"应用级模态框组件,基于 Ant Design Modal 封装",props:{showDefaultFooter:{name:"showDefaultFooter",required:!1,description:"是否显示默认的确定和取消按钮",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},title:{name:"title",required:!1,description:"模态框标题",type:{name:"ReactNode",raw:"React.ReactNode"}},open:{name:"open",required:!1,description:"是否显示模态框",type:{name:"boolean",raw:"boolean"}},onCancel:{name:"onCancel",required:!1,description:"取消按钮点击事件",type:{name:"function",raw:"(e: React.MouseEvent<HTMLElement>) => void"}},onOk:{name:"onOk",required:!1,description:"确定按钮点击事件",type:{name:"function",raw:"(e: React.MouseEvent<HTMLElement>) => void"}},children:{name:"children",required:!1,description:"模态框内容",type:{name:"ReactNode",raw:"React.ReactNode"}},width:{name:"width",required:!1,description:"模态框宽度",type:{name:"string | number",raw:"string | number"}},centered:{name:"centered",required:!1,description:"是否居中显示",type:{name:"boolean",raw:"boolean"}},maskClosable:{name:"maskClosable",required:!1,description:"点击蒙层是否允许关闭",type:{name:"boolean",raw:"boolean"}}}};const Ce=({scrollX:t,showPagination:f=!0,defaultPageSize:d=10,...l})=>p.jsx(B.Table,{...l,scroll:{x:t||"max-content",y:"50vh"},pagination:f?{hideOnSinglePage:!0,showSizeChanger:!0,showQuickJumper:!0,defaultPageSize:d,...l.pagination}:!1});Ce.__docgenInfo={displayName:"PageTable",description:"页面级表格组件,高度铺满容器,自动滚动",props:{scrollX:{name:"scrollX",required:!1,description:"水平滚动宽度",type:{name:"number",raw:"number"}},showPagination:{name:"showPagination",required:!1,description:"是否显示分页器",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},defaultPageSize:{name:"defaultPageSize",required:!1,description:"默认页面大小",type:{name:"number",raw:"number"},defaultValue:{value:"10"}},columns:{name:"columns",required:!1,description:"表格列配置",type:{name:"ColumnType[]",raw:"ColumnType<any>[]"}},dataSource:{name:"dataSource",required:!1,description:"数据源",type:{name:"any[]",raw:"any[]"}},loading:{name:"loading",required:!1,description:"是否加载中",type:{name:"boolean",raw:"boolean"}},rowKey:{name:"rowKey",required:!1,description:"行数据的 Key",type:{name:"string | function",raw:"string | ((record: any) => string)"}}}};const Pe=ce.createFromIconfontCN({scriptUrl:["https://at.alicdn.com/t/c/font_4968458_eh91gfr4j9e.js"]}),Ne=({name:t,size:f,color:d,style:l,...c})=>{const y={fontSize:f,color:d,...l};return p.jsx(Pe,{...c,type:t,style:y})};Ne.__docgenInfo={displayName:"XcIcon",description:"自定义图标组件,基于 iconfont",props:{name:{name:"name",required:!0,description:"图标名称",type:{name:"string",raw:"string"}},size:{name:"size",required:!1,description:"图标大小",type:{name:"number | string",raw:"number | string"}},color:{name:"color",required:!1,description:"图标颜色",type:{name:"string",raw:"string"}},className:{name:"className",required:!1,description:"自定义类名",type:{name:"string",raw:"string"}},style:{name:"style",required:!1,description:"自定义样式",type:{name:"CSSProperties",raw:"React.CSSProperties"}}}};const Se=({loading:t,description:f="暂无数据",className:d,emptyChildren:l,loadingText:c,emptyImage:y})=>t?p.jsxs(B.Flex,{className:`pt-10 w-full ${d||""}`,align:"center",justify:"center",vertical:!0,children:[p.jsx(B.Spin,{size:"large"}),c&&p.jsx("div",{className:"mt-4 text-gray-500",children:c})]}):p.jsx(B.Flex,{className:`pt-10 w-full ${d||""}`,align:"center",justify:"center",children:p.jsx(B.Empty,{image:y,description:f,imageStyle:{height:180},children:l})});Se.__docgenInfo={displayName:"EmptyAndSpin",description:"空状态和加载状态组合组件",props:{loading:{name:"loading",required:!0,description:"是否加载中",type:{name:"boolean",raw:"boolean"}},description:{name:"description",required:!1,description:"空状态描述",type:{name:"ReactNode",raw:"React.ReactNode"},defaultValue:{value:'"暂无数据"'}},className:{name:"className",required:!1,description:"自定义类名",type:{name:"string",raw:"string"}},emptyChildren:{name:"emptyChildren",required:!1,description:"空状态额外内容",type:{name:"ReactNode",raw:"React.ReactNode"}},loadingText:{name:"loadingText",required:!1,description:"加载中提示文字",type:{name:"string",raw:"string"}},emptyImage:{name:"emptyImage",required:!1,description:"空状态图片",type:{name:"string",raw:"string"}}}};const Re=({onClick:t,showText:f=!1,className:d,size:l="small",type:c="default"})=>p.jsx(B.Button,{size:l,type:c,icon:p.jsx(ce.LeftOutlined,{}),className:`cursor-pointer ${d||""}`,onClick:t,children:f&&"返回"});Re.__docgenInfo={displayName:"BackButton",description:"返回按钮组件",props:{onClick:{name:"onClick",required:!1,description:"点击事件",type:{name:"function",raw:"() => void"}},showText:{name:"showText",required:!1,description:"是否显示文字",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}},className:{name:"className",required:!1,description:"自定义类名",type:{name:"string",raw:"string"}},size:{name:"size",required:!1,description:"按钮大小",type:{name:"ButtonSize",raw:'"small" | "middle" | "large"'},defaultValue:{value:'"small"'}},type:{name:"type",required:!1,description:"按钮类型",type:{name:"ButtonType",raw:'"primary" | "default" | "dashed" | "link" | "text"'},defaultValue:{value:'"default"'}}}};const Ae=({removePadding:t=!0,className:f,...d})=>{const l=t?`px-0 h-auto ${f||""}`:f;return p.jsx(B.Button,{type:"link",...d,className:l,children:d.children})};Ae.__docgenInfo={displayName:"LinkButton",description:"链接样式按钮组件,适用于表格操作列",props:{removePadding:{name:"removePadding",required:!1,description:"是否去除默认内边距",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},children:{name:"children",required:!1,description:"按钮内容",type:{name:"ReactNode",raw:"React.ReactNode"}},onClick:{name:"onClick",required:!1,description:"点击事件",type:{name:"function",raw:"(event: React.MouseEvent<HTMLButtonElement>) => void"}},disabled:{name:"disabled",required:!1,description:"是否禁用",type:{name:"boolean",raw:"boolean"}},className:{name:"className",required:!1,description:"自定义类名",type:{name:"string",raw:"string"}}}};const{Option:Be}=B.Select,Ie=({columns:t,request:f,searchFields:d=[],showSearch:l=!0,showRefresh:c=!0,defaultPageSize:y=10,pageSizeOptions:S=["10","20","50","100"],autoLoad:g=!0,externalParams:e={},...a})=>{const[R,n]=r.useState([]),[A,o]=r.useState(!1),[j,C]=r.useState({current:1,pageSize:y,total:0}),[b,x]=r.useState({}),[N,w]=r.useState({}),[T]=B.Form.useForm(),I=r.useRef(j);I.current=j;const q=r.useRef(e);q.current=e;const M=r.useRef(!1),F=r.useMemo(()=>t.map(E=>{const{sortable:V,render:K,...J}=E;return{...J,sorter:V?!0:void 0,render:K||(oe=>oe)}}),[t]),D=r.useCallback(async(E={})=>{if(f){o(!0);try{const V={page:I.current.current,pageSize:I.current.pageSize,sortField:N.field,sortOrder:N.order,searchParams:{...b,...q.current},...E},K=await f(V);K.success&&(n(K.data),C(J=>({...J,total:K.total,current:V.page||J.current})))}catch(V){console.error("加载数据失败:",V)}finally{o(!1)}}},[f,N,b]),H=r.useCallback(E=>{x(E),C(V=>({...V,current:1}))},[]),P=r.useCallback(()=>{T.resetFields(),x({}),C(E=>({...E,current:1}))},[T]),U=r.useCallback(()=>{D()},[D]),ee=r.useCallback((E,V,K)=>{const J={current:E.current||1,pageSize:E.pageSize||y,total:E.total||0},oe={field:K?.field,order:K?.order};C(J),w(oe)},[y]);return r.useEffect(()=>{const E=Object.keys(e).length>0;(g&&!M.current||E)&&(D(),M.current=!0)},[g,e,D]),p.jsxs("div",{children:[l&&d.length>0&&p.jsx(B.Card,{size:"small",style:{marginBottom:16},children:p.jsxs(B.Form,{form:T,layout:"inline",onFinish:H,initialValues:d.reduce((E,V)=>(V.defaultValue!==void 0&&(E[V.key]=V.defaultValue),E),{}),children:[d.map(E=>p.jsx(B.Form.Item,{name:E.key,label:E.label,children:E.type==="input"?p.jsx(B.Input,{placeholder:E.placeholder||`请输入${E.label}`,style:{width:200}}):p.jsx(B.Select,{placeholder:E.placeholder||`请选择${E.label}`,style:{width:200},allowClear:!0,children:E.options?.map(V=>p.jsx(Be,{value:V.value,children:V.label},V.value))})},E.key)),p.jsx(B.Form.Item,{children:p.jsxs(B.Space,{children:[p.jsx(B.Button,{type:"primary",htmlType:"submit",icon:p.jsx(ce.SearchOutlined,{}),children:"查询"}),p.jsx(B.Button,{onClick:P,children:"重置"}),c&&p.jsx(B.Button,{icon:p.jsx(ce.ReloadOutlined,{}),onClick:U,children:"刷新"})]})})]})}),p.jsx(B.Table,{...a,columns:F,dataSource:R,loading:A,pagination:{...j,showSizeChanger:!0,showQuickJumper:!0,showTotal:(E,V)=>`第 ${V[0]}-${V[1]} 条/共 ${E} 条`,pageSizeOptions:S},onChange:ee,scroll:{x:"max-content",y:"50vh"}})]})};Ie.__docgenInfo={displayName:"AdvancedTable",description:"高阶表格组件,支持异步请求、搜索、排序等功能",props:{columns:{name:"columns",required:!0,description:"列配置",type:{name:"AdvancedColumnType[]",raw:"AdvancedColumnType<any>[]"}},request:{name:"request",required:!1,description:"异步请求函数",type:{name:"function",raw:"(params: RequestParams) => Promise<RequestResponse>"}},searchFields:{name:"searchFields",required:!1,description:"搜索字段配置",type:{name:"SearchFieldConfig[]",raw:"SearchFieldConfig[]"},defaultValue:{value:"[]"}},showSearch:{name:"showSearch",required:!1,description:"是否显示搜索区域",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},showRefresh:{name:"showRefresh",required:!1,description:"是否显示刷新按钮",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},defaultPageSize:{name:"defaultPageSize",required:!1,description:"默认页面大小",type:{name:"number",raw:"number"},defaultValue:{value:"10"}},pageSizeOptions:{name:"pageSizeOptions",required:!1,description:"页面大小选项",type:{name:"string[]",raw:"string[]"},defaultValue:{value:'["10", "20", "50", "100"]'}},autoLoad:{name:"autoLoad",required:!1,description:"是否自动加载",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},externalParams:{name:"externalParams",required:!1,description:"外部请求参数",type:{name:"Record<string, any>",raw:"Record<string, any>"},defaultValue:{value:"{}"}}}};function me(t,f,d){if(!t.current)return;const l=new Set,c={};for(const n of f)n.exclusionGroup&&n.exclusionGroup!=="separator"&&(l.add(n.exclusionGroup),c[n.exclusionGroup]||(c[n.exclusionGroup]=[]),c[n.exclusionGroup].push({type:n.type,key:n.key,exclusionGroup:n.exclusionGroup}));const y={};for(const n of l){y[n]=!1;for(const A of c[n])if(A.type==="upload"&&A.key){if(d[A.key]!==null&&d[A.key]!==void 0){y[n]=!0;break}}else if(A.type==="variable"&&A.key){const o=t.current.querySelector(`[data-type="variable"][data-key="${A.key}"]`);if(o&&o.innerText.replace(/[\u200B\n]/g,"").trim().length>0){y[n]=!0;break}}}const S=f.some(n=>n.exclusionGroup==="separator"),e=Object.keys(y).filter(n=>y[n]).length>0;let a=null;if(e&&S){for(const n of f)if(n.exclusionGroup&&n.exclusionGroup!=="separator"&&y[n.exclusionGroup]){a=n.exclusionGroup;break}}for(const n of l){const A=t.current.querySelectorAll(`[data-group="${n}"]`);S&&e&&a?n===a?A.forEach(o=>{o.classList.contains("required-upload-group")?o.style.setProperty("display","inline-flex","important"):(o.classList.contains("exclusion-wrapper"),o.style.setProperty("display","inline-block","important"))}):A.forEach(o=>{o.style.display="none",o.style.setProperty("display","none","important")}):A.forEach(o=>{o.classList.contains("required-upload-group")?o.style.setProperty("display","inline-flex","important"):(o.classList.contains("exclusion-wrapper"),o.style.setProperty("display","inline-block","important"))})}t.current.querySelectorAll('[data-group="separator"]').forEach(n=>{n.style.display=e?"none":"inline"})}function ye(t,f,d,l){if(!t.current){l(!1);return}const c=[];for(let e=0;e<f.length;e++){const a=f[e];if((a.type==="variable"||a.type==="upload"||a.type==="multi-variable")&&a.required&&a.key){c.push({exclusionGroup:a.exclusionGroup||"",key:a.key,type:a.type==="multi-variable"?"variable":a.type,isMultiVariable:a.type==="multi-variable"});continue}if(a.type==="text"&&a.className?.includes("rte-text-required")&&a.exclusionGroup)for(let R=e+1;R<f.length;R++){const n=f[R];if(n.exclusionGroup===a.exclusionGroup&&(n.type==="variable"||n.type==="upload")&&n.key){c.push({exclusionGroup:a.exclusionGroup,key:n.key,type:n.type});break}}}const y=f.some(e=>e.exclusionGroup==="separator");let S=!1;if(y&&c.length>1){const e=f.findIndex(n=>n.exclusionGroup==="separator"),a=c.filter(n=>f.findIndex(o=>(o.type==="variable"||o.type==="upload")&&o.key===n.key&&o.exclusionGroup===n.exclusionGroup)<e),R=c.filter(n=>f.findIndex(o=>(o.type==="variable"||o.type==="upload")&&o.key===n.key&&o.exclusionGroup===n.exclusionGroup)>e);S=a.length>0&&R.length>0}if(c.length===0){l(!0);return}const g=c.filter(e=>{if(!t.current)return!1;const a=t.current.querySelectorAll(`[data-group="${e.exclusionGroup}"]`);return a.length===0?!1:a[0].style.display!=="none"});if(g.length===0){l(!0);return}if(S){let e=!1;for(const a of g)if(a.type==="upload"&&a.key){if(d[a.key]!==null&&d[a.key]!==void 0){e=!0;break}}else if(a.type==="variable"&&a.key)if(a.isMultiVariable){const R=t.current.querySelectorAll(`[data-type="variable"][data-multi-key="${a.key}"]`);let n=!1;for(const A of Array.from(R))if(A.innerText.replace(/[\u200B\n]/g,"").trim().length>0){n=!0;break}if(n){e=!0;break}}else{const R=t.current.querySelector(`[data-type="variable"][data-key="${a.key}"]`);if(R&&R.innerText.replace(/[\u200B\n]/g,"").trim().length>0){e=!0;break}}l(e)}else{let e=!0;for(const a of g)if(a.type==="upload"&&a.key){if(d[a.key]===null||d[a.key]===void 0){e=!1;break}}else if(a.type==="variable"&&a.key)if(a.isMultiVariable){const R=t.current.querySelectorAll(`[data-type="variable"][data-multi-key="${a.key}"]`);let n=!1;for(const A of Array.from(R))if(A.innerText.replace(/[\u200B\n]/g,"").trim().length>0){n=!0;break}if(!n){e=!1;break}}else{const R=t.current.querySelector(`[data-type="variable"][data-key="${a.key}"]`);if(!R){e=!1;break}if(R.innerText.replace(/[\u200B\n]/g,"").trim().length===0){e=!1;break}}l(e)}}function he(t,f){if(!t.current)return;t.current.querySelectorAll('[data-type="variable"]').forEach(l=>{const c=l.innerText.replace(/\n/g,"");c.replace(/\u200B/g,"")?l.classList.remove("show-placeholder"):(c!==""&&(l.innerText=""),l.classList.add("show-placeholder"))})}function Fe(t,f,d,l,c,y={}){if(!t.current)return;let S="",g=0;for(;g<f.length;){const e=f[g],a=g+1<f.length?f[g+1]:null;if(e.type==="text"&&(e.text?.includes("icon-bitian")||e.className==="rte-text-required")&&a){const C=a.type==="upload"&&a.exclusionGroup==="fileInput"&&e.exclusionGroup==="fileInput"&&e.exclusionGroup===a.exclusionGroup,b=a.type==="variable"&&a.exclusionGroup==="textInput"&&e.exclusionGroup==="textInput"&&e.exclusionGroup===a.exclusionGroup;if(C){const N=`<span ${e.exclusionGroup?`data-group="${e.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group">`,w="</span>";let T="";e.className?T=`<span class="${e.className}">${e.text??""}</span>`:T=e.text??"";const I=a,q=d[I.key]!==null&&d[I.key]!==void 0,M=q?d[I.key]?.name:I.text,F=q?"":"hidden",D=I.tooltip&&!q?"":"hidden",H=q?"has-file":"",P=q&&M?` data-file-name="${M.replace(/"/g,""")}"`:"",U=`<span contenteditable="false" data-type="upload" data-key="${I.key}" class="upload-chip"><span class="upload-inner-wrapper ${H}"><span class="upload-icon">${q?"<i class='iconfont icon-exlwenjian'></i>":"<i class='iconfont icon-shangchuan1'></i>"}</span><span class="upload-label"${P}>${M||I.text}</span>${I.tooltip?`<i contenteditable="false" class="iconfont icon-tishi upload-info-icon ${D}" data-upload-key="${I.key}" data-tooltip="${I.tooltip}" title="提示"></i>`:""}<span class="file-remove-btn ${F}" title="移除文件">×</span></span></span>`;S+=N+T+U+w,g+=2;continue}if(b){const N=`<span ${e.exclusionGroup?`data-group="${e.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group">`,w="</span>";let T="";e.className?T=`<span class="${e.className}">${e.text??""}</span>`:T=e.text??"";const I=a,M=(I.key?c[I.key]:void 0)||I.text||"",F=!M,D=F?"":M,H=F?"show-placeholder":"",P=I.exclusionGroup?` data-group="${I.exclusionGroup}"`:"",U=I.tooltip?` data-tooltip="${I.tooltip.replace(/"/g,""")}" data-variable-key="${I.key||""}"`:"",ee=I.tooltip&&F?"":"hidden",E=`<span contenteditable="true" data-type="variable" data-key="${I.key}" data-placeholder="${I.placeholder||""}"${P}${U} class="variable-chip ${H}">${D}${I.tooltip?`<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${ee}" data-variable-key="${I.key}" data-tooltip="${I.tooltip.replace(/"/g,""")}" title="提示"></i>`:""}</span>`;S+=N+T+E+w,g+=2;continue}}const n=e.exclusionGroup?`data-group="${e.exclusionGroup}"`:"",A=e.exclusionGroup?`<span ${n} class="exclusion-wrapper">`:"",o=e.exclusionGroup?"</span>":"";let j="";if(e.type==="tag"){const C=l?"":'<span class="tag-close-btn" title="Clear (ESC)"><svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6L6 18M6 6l12 12"/></svg></span>',b=l?' data-locked="true"':"",x=e.tooltip?` data-tooltip="${e.tooltip.replace(/"/g,""")}" data-tag-key="${e.key||""}"`:"";j=`<span contenteditable="false" class="tag-node group"${b}${x}><span class="tag-label">${e.text}</span>${C}</span>`}else if(e.type==="text"){const C=l?' data-locked="true" contenteditable="false"':' contenteditable="false"';e.className?j=`<span class="${e.className}"${C}>${e.text??""}</span>`:j=l?`<span${C}>${e.text??""}</span>`:`<span contenteditable="false">${e.text??""}</span>`}else if(e.type==="variable"&&e.key){const b=c[e.key]||e.text||"",x=!b,N=x?"":b,w=x?"show-placeholder":"",T=e.exclusionGroup?` data-group="${e.exclusionGroup}"`:"",I=e.tooltip?` data-tooltip="${e.tooltip.replace(/"/g,""")}" data-variable-key="${e.key||""}"`:"",q=e.tooltip&&x?"":"hidden",M=`<span contenteditable="true" data-type="variable" data-key="${e.key}" data-placeholder="${e.placeholder||""}"${T}${I} class="variable-chip ${w}">${N}${e.tooltip?`<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${q}" data-variable-key="${e.key}" data-tooltip="${e.tooltip.replace(/"/g,""")}" title="提示"></i>`:""}</span>`;e.required?j=`<span ${e.exclusionGroup?`data-group="${e.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${M}</span>`:j=M}else if(e.type==="upload"&&e.key){const C=d[e.key]!==null&&d[e.key]!==void 0,b=C?d[e.key]?.name:e.text,x=C?"":"hidden",N=e.tooltip&&!C?"":"hidden",w=C?"has-file":"",T=C&&b?` data-file-name="${b.replace(/"/g,""")}"`:"",I=`<span contenteditable="false" data-type="upload" data-key="${e.key}" class="upload-chip"><span class="upload-inner-wrapper ${w}"><span class="upload-icon">${C?"<i class='iconfont icon-exlwenjian'></i>":"<i class='iconfont icon-shangchuan1'></i>"}</span><span class="upload-label"${T}>${b||e.text}</span>${e.tooltip?`<i contenteditable="false" class="iconfont icon-tishi upload-info-icon ${N}" data-upload-key="${e.key}" data-tooltip="${e.tooltip}" title="提示"></i>`:""}<span class="file-remove-btn ${x}" title="移除文件">×</span></span></span>`;e.required?j=`<span ${e.exclusionGroup?`data-group="${e.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${I}</span>`:j=I}else if(e.type==="multi-variable"&&e.key){const C=e.maxCount||9,b=y[e.key]||1,x=Math.min(b,C);let N="";for(let w=0;w<x;w++){const T=`${e.key}_${w}`,I=c[T]||"",q=!I,M=q?"":I,F=q?"show-placeholder":"",D=e.tooltip?` data-tooltip="${e.tooltip.replace(/"/g,""")}" data-variable-key="${e.key||""}"`:"",H=e.tooltip&&q?"":"hidden",P=`<span contenteditable="true" data-type="variable" data-key="${T}" data-multi-key="${e.key}" data-index="${w}" data-placeholder="${e.placeholder||""}"${D} class="variable-chip ${F}">${M}${e.tooltip?`<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${H}" data-variable-key="${e.key}" data-tooltip="${e.tooltip.replace(/"/g,""")}" title="提示"></i>`:""}</span>`;N+=P}e.required?j=`<span ${e.exclusionGroup?`data-group="${e.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${N}</span>`:j=N}S+=A+j+o,g++}t.current&&(t.current.innerHTML=S,setTimeout(()=>{if(!t.current)return;t.current.querySelectorAll('[data-type="variable"]').forEach(a=>{const R=a.innerText.replace(/\n/g,"");R.replace(/\u200B/g,"")?a.classList.remove("show-placeholder"):(R!==""&&(a.innerText=""),a.classList.add("show-placeholder"))})},0))}function Ge(t,f,d,l,c={},y,S){const g=r.useCallback(()=>{if(!t.current)return;if(f.length===0){t.current.innerHTML="";return}let e={};const a=t.current,R=a.__tempVariableValues;if(R?(e=R,delete a.__tempVariableValues):t.current.querySelectorAll('[data-type="variable"]').forEach(A=>{const o=A.dataset.key;if(o){const j=A.innerText.replace(/[\u200B\n]/g,"").trim();j&&(e[o]=j)}}),Fe(t,f,d,l,e,c),y?.current){const{key:n,offset:A}=y.current;setTimeout(()=>{if(!t.current)return;const o=t.current.querySelector(`[data-type="variable"][data-key="${n}"]`);if(o){try{const j=document.createRange(),C=document.createTreeWalker(o,NodeFilter.SHOW_TEXT,null);let b=0,x=null,N=0;for(;C.nextNode();){const w=C.currentNode,T=w.textContent?.length||0;if(b+T>=A){x=w,N=A-b;break}b+=T}if(x){j.setStart(x,Math.min(N,x.textContent?.length||0)),j.collapse(!0);const w=window.getSelection();w&&(w.removeAllRanges(),w.addRange(j),o.focus())}else{j.selectNodeContents(o),j.collapse(!1);const w=window.getSelection();w&&(w.removeAllRanges(),w.addRange(j),o.focus())}}catch{const j=document.createRange();j.selectNodeContents(o),j.collapse(!1);const C=window.getSelection();C&&(C.removeAllRanges(),C.addRange(j),o.focus())}y.current=null}},0)}},[f,d,l,t,c,y,S]);r.useEffect(()=>{g()},[g])}function ze(t,f,d,l){r.useEffect(()=>{const c=t.current;if(!c)return;const y=g=>{const e=g.target?.closest(".upload-info-icon");if(e&&e.classList.contains("upload-info-icon")){const a=e.dataset.uploadKey;a&&l({key:a,anchorEl:e,type:"upload"})}},S=g=>{const e=g.target?.closest(".upload-info-icon"),a=g.relatedTarget;e&&e.classList.contains("upload-info-icon")&&(!a||!c.contains(a)?l(null):a.closest(".upload-info-icon")||l(null))};return c.addEventListener("mouseover",y,!0),c.addEventListener("mouseout",S,!0),()=>{c.removeEventListener("mouseover",y,!0),c.removeEventListener("mouseout",S,!0)}},[f,d,t,l])}function He(t,f,d){r.useEffect(()=>{if(!t.current)return;const l=g=>{const e=g.currentTarget,a=e.dataset.tooltip,R=e.dataset.tagKey||"";a&&d({key:R,anchorEl:e,type:"tag"})},c=()=>{d(null)};let y;const S=()=>{if(!t.current)return;t.current.querySelectorAll(".tag-node[data-tooltip]").forEach(e=>{e.addEventListener("mouseenter",l),e.addEventListener("mouseleave",c)})};return y=requestAnimationFrame(()=>{y=requestAnimationFrame(S)}),()=>{cancelAnimationFrame(y),t.current&&t.current.querySelectorAll(".tag-node[data-tooltip]").forEach(e=>{e.removeEventListener("mouseenter",l),e.removeEventListener("mouseleave",c)})}},[f,t,d])}function We(t,f,d){r.useEffect(()=>{const l=t.current;if(!l)return;const c=S=>{const g=S.target?.closest(".variable-info-icon");if(g&&g.classList.contains("variable-info-icon")){const e=g.dataset.variableKey;e&&d({key:e,anchorEl:g,type:"variable"})}},y=S=>{const g=S.target?.closest(".variable-info-icon"),e=S.relatedTarget;g&&g.classList.contains("variable-info-icon")&&(!e||!l.contains(e)?d(null):e.closest(".variable-info-icon")||d(null))};return l.addEventListener("mouseover",c,!0),l.addEventListener("mouseout",y,!0),()=>{l.removeEventListener("mouseover",c,!0),l.removeEventListener("mouseout",y,!0)}},[f,t,d])}function Xe(t,f,d,l){r.useEffect(()=>{if(!t.current)return;const c=e=>{const a=e.currentTarget;a.dataset.fileName&&l({key:"",anchorEl:a,type:"upload-label"})},y=()=>{l(null)};let S;const g=()=>{if(!t.current)return;t.current.querySelectorAll(".upload-label[data-file-name]").forEach(a=>{a.addEventListener("mouseenter",c),a.addEventListener("mouseleave",y)})};return S=requestAnimationFrame(()=>{S=requestAnimationFrame(g)}),()=>{cancelAnimationFrame(S),t.current&&t.current.querySelectorAll(".upload-label[data-file-name]").forEach(a=>{a.removeEventListener("mouseenter",c),a.removeEventListener("mouseleave",y)})}},[f,d,t,l])}function Ke(t,f,d,l){r.useEffect(()=>{me(t,f,d),ye(t,f,d,l)},[d,f,t,l])}function Ye(t,f){r.useEffect(()=>{if(!t.current)return;let d=!1,l=0;const c=()=>{d=!0},y=()=>{d=!1,l=Date.now()};let S=!1,g=0;const e=()=>{S=!0},a=()=>{S=!1,g=Date.now()},R=()=>{g=Date.now()},n=()=>{if(!t.current)return;const o=window.getSelection();if(!o||o.rangeCount===0||f.current||d||S||Date.now()-g<500)return;const j=o.getRangeAt(0);if(!j.collapsed){t.current.contains(j.commonAncestorContainer)||o.removeAllRanges();return}const C=o.anchorNode;if(!C)return;if(!t.current.contains(C)){o.removeAllRanges();return}let b=null;if(C.nodeType===Node.ELEMENT_NODE?b=C.closest('[data-type="variable"]'):C.nodeType===Node.TEXT_NODE&&C.parentElement&&(b=C.parentElement.closest('[data-type="variable"]')),!b){if(Date.now()-l>500)return;const x=t.current.querySelectorAll('[data-type="variable"]');if(x.length>0){let N=null;for(const w of Array.from(x))if(w.style.display!=="none"){N=w;break}if(!N&&x.length>0&&(N=x[0]),N){const w=document.createRange();w.selectNodeContents(N),w.collapse(!1),o.removeAllRanges(),o.addRange(w),N.focus()}else o.removeAllRanges()}else o.removeAllRanges()}},A=t.current;return A&&(A.addEventListener("compositionstart",e),A.addEventListener("compositionend",a),A.addEventListener("input",R)),document.addEventListener("mousedown",c),document.addEventListener("mouseup",y),document.addEventListener("selectionchange",n),()=>{const o=t.current;o&&(o.removeEventListener("compositionstart",e),o.removeEventListener("compositionend",a),o.removeEventListener("input",R)),document.removeEventListener("mousedown",c),document.removeEventListener("mouseup",y),document.removeEventListener("selectionchange",n)}},[t,f])}const _e=({config:t,onSend:f,isProcessing:d=!1,disabled:l=!1,width:c,lockStructure:y=!1,agentOptions:S=[],onAgentSelect:g,onAgentExit:e,loading:a=!1,placeholder:R})=>{const n=r.useRef(null),A=r.useRef(null),[o,j]=r.useState({}),[C,b]=r.useState(null),[x,N]=r.useState(null),w=r.useRef(!1),T=r.useRef(null),[I,q]=r.useState(!1),M=r.useRef(null),[F,D]=r.useState(!0),[H,P]=r.useState(()=>{const u={};return t.forEach(m=>{m.type==="multi-variable"&&m.key&&(u[m.key]=1)}),u});r.useEffect(()=>{P(u=>{const m={};return t.forEach(s=>{s.type==="multi-variable"&&s.key&&(m[s.key]=u[s.key]||1)}),m})},[t]),Ge(n,t,o,y,H,M),ze(n,t,o,N),He(n,t,N),Xe(n,t,o,N),We(n,t,N),Ke(n,t,o,q),Ye(n,w),r.useEffect(()=>{if(t.length>0){D(!1);return}const u=()=>{if(!n.current){D(!0);return}const s=n.current.textContent?.replace(/[\u200B\n]/g,"").trim()||"",h=n.current.querySelectorAll('[data-type="variable"]'),v=n.current.querySelectorAll('[data-type="upload"]');let k=!1;h.forEach(L=>{(L.textContent?.replace(/[\u200B\n]/g,"").trim()||"")&&(k=!0)}),v.forEach(L=>{L.querySelector(".upload-inner-wrapper.has-file")&&(k=!0)});const _=!s&&!k;D(_),t.length===0&&q(!_)};u();const m=new MutationObserver(u);return n.current&&m.observe(n.current,{childList:!0,subtree:!0,characterData:!0}),()=>{m.disconnect()}},[t]);const U=u=>{if(l){u.preventDefault();return}u.preventDefault();const m=u.clipboardData.getData("text/plain"),s=window.getSelection();if(s&&s.rangeCount>0){const h=s.anchorNode;if(h){let v=null;if(h.nodeType===Node.ELEMENT_NODE?v=h.closest('[data-type="variable"]'):h.nodeType===Node.TEXT_NODE&&h.parentElement&&(v=h.parentElement.closest('[data-type="variable"]')),v){const k=v.dataset.multiKey;if(k){const _=m.split(/[,\n\r\t]+/).map(L=>L.trim()).filter(L=>L.length>0);if(_.length>1){const L=parseInt(v.dataset.index||"0",10),G=t.find(te=>te.type==="multi-variable"&&te.key===k)?.maxCount||9,Y=H[k]||1,$=Math.min(L+_.length,G);$>Y&&P(Z=>({...Z,[k]:$})),setTimeout(()=>{n.current&&(_.forEach((Z,te)=>{const ae=L+te;if(ae>=G)return;const W=`${k}_${ae}`,ne=n.current.querySelector(`[data-type="variable"][data-key="${W}"]`);ne&&(ne.innerText=Z,ne.classList.remove("show-placeholder"))}),i())},0);return}}}}}document.execCommand("insertText",!1,m),i()},ee=u=>{if(u.target.files&&u.target.files[0]&&C){const m=u.target.files[0],s=C;j(h=>({...h,[s]:m}))}u.target&&(u.target.value=""),b(null)},E=u=>{j(m=>{const s={...m};return delete s[u],s})},V=u=>{const m=u.target;if(m.closest(".tag-close-btn")){if(u.preventDefault(),u.stopPropagation(),y)return;N(null),e?e():n.current&&(n.current.innerHTML="",n.current.focus());return}if(y){const v=m.closest(".tag-node"),k=m.closest('[data-type="text"]');if(v||k){u.preventDefault(),u.stopPropagation();const _=window.getSelection();_&&_.removeAllRanges();return}}m.closest('[data-type="variable"]')||(T.current={x:u.clientX,y:u.clientY},w.current=!1,m.closest(".file-remove-btn")&&(u.preventDefault(),u.stopPropagation()))},K=u=>{if(!u.target.closest('[data-type="variable"]')&&T.current){const h=Math.abs(u.clientX-T.current.x),v=Math.abs(u.clientY-T.current.y);(h>3||v>3)&&(w.current=!0)}},J=u=>{if(u.target.closest('[data-type="variable"]')){T.current=null,w.current=!1;return}T.current=null,w.current=!1},oe=u=>{if(l)return;const m=u.target;if(m.closest(".tag-close-btn")){u.preventDefault(),u.stopPropagation();return}if(t.length===0)return;if(m.closest('[data-type="text"]')){u.preventDefault(),u.stopPropagation();const L=window.getSelection();L&&L.removeAllRanges();return}if(y&&m.closest(".tag-node")){u.preventDefault(),u.stopPropagation();const G=window.getSelection();G&&G.removeAllRanges();return}if(m.closest('[data-type="variable"]')){if(w.current)return;setTimeout(()=>{const L=window.getSelection();L&&!L.isCollapsed||he(n)},10);return}const k=m.closest(".file-remove-btn");if(k){u.preventDefault(),u.stopPropagation();const G=k.closest('[data-type="upload"]')?.dataset.key;G&&E(G);return}const _=m.closest('[data-type="upload"]');if(_){const L=_.dataset.key;L&&(b(L),A.current?.click());return}},se=u=>{const s=u.target.closest('[data-type="variable"]');if(s){const h=window.getSelection();if(h){const v=document.createRange(),k=s.textContent||"";if(k.replace(/\u200B/g,"")){let L=0,G=k.length;k.startsWith("")&&(L=1),k.endsWith("")&&k.length>1&&(G=k.length-1);const Y=s.firstChild;Y&&Y.nodeType===Node.TEXT_NODE?(v.setStart(Y,L),v.setEnd(Y,G)):v.selectNodeContents(s)}else v.selectNodeContents(s),v.collapse(!0);h.removeAllRanges(),h.addRange(v)}}},i=()=>{if(t.length===0){if(n.current){const s=!(n.current.textContent?.replace(/[\u200B\n]/g,"").trim()||"");D(s),q(!s)}return}if(he(n),n.current&&n.current.querySelectorAll('[data-type="variable"]').forEach(s=>{const h=s.querySelector(".variable-info-icon");if(h){let v=!1;const k=document.createTreeWalker(s,NodeFilter.SHOW_TEXT,{acceptNode:_=>h.contains(_)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});for(;k.nextNode();)if(k.currentNode.textContent?.replace(/[\u200B\n]/g,"").trim()){v=!0;break}v?h.classList.add("hidden"):h.classList.remove("hidden")}}),me(n,t,o),ye(n,t,o,q),!n.current)return;t.filter(m=>m.type==="multi-variable"&&m.key).forEach(m=>{if(!m.key)return;const s=m.maxCount||9,h=H[m.key]||1,v=[];for(let Y=0;Y<h;Y++){const $=`${m.key}_${Y}`,Z=n.current.querySelector(`[data-type="variable"][data-key="${$}"][data-multi-key="${m.key}"]`);if(Z){const te=Z.innerText.replace(/[\u200B\n]/g,"").trim();v.push(te)}}const _=(v[v.length-1]||"")==="";let L=!1,G=-1;for(let Y=0;Y<v.length-1;Y++)if(v[Y]===""){L=!0,G=Y;break}if(L&&G>=0){const Y=window.getSelection();if(Y&&Y.rangeCount>0){const W=Y.getRangeAt(0),ne=W.startContainer,le=ne.nodeType===Node.ELEMENT_NODE?ne.closest('[data-type="variable"][data-multi-key]'):ne.parentElement?.closest('[data-type="variable"][data-multi-key]');if(le){const ie=le.dataset.key;if(ie){const ue=document.createRange();ue.setStartBefore(le),ue.setEnd(W.startContainer,W.startOffset);const be=ue.toString().length;M.current={key:ie,offset:be}}}}const $=[...v];for(let W=G;W<$.length-1;W++)$[W]=$[W+1];$.pop();const Z={};$.forEach((W,ne)=>{W&&(Z[`${m.key}_${ne}`]=W)});const te=Math.max(_?$.length:$.length+1,1);n.current.querySelectorAll('[data-type="variable"]').forEach(W=>{const ne=W.dataset.key,le=W.dataset.multiKey;if(ne&&le!==m.key){const ie=W.innerText.replace(/[\u200B\n]/g,"").trim();ie&&(Z[ne]=ie)}}),n.current.__tempVariableValues=Z,P(W=>({...W,[m.key]:te}));return}if(!_){const Y=h-1,$=`${m.key}_${Y}`,Z=n.current.querySelector(`[data-type="variable"][data-key="${$}"][data-multi-key="${m.key}"]`);if(Z&&Z.innerText.replace(/[\u200B\n]/g,"").trim().length>0&&h<s){const ae=window.getSelection();if(ae&&ae.rangeCount>0){const W=ae.getRangeAt(0),ne=W.startContainer,le=ne.nodeType===Node.ELEMENT_NODE?ne.closest('[data-type="variable"][data-multi-key]'):ne.parentElement?.closest('[data-type="variable"][data-multi-key]');if(le){const ie=le.dataset.key;if(ie){const ue=document.createRange();ue.setStartBefore(le),ue.setEnd(W.startContainer,W.startOffset);const be=ue.toString().length;M.current={key:ie,offset:be}}}}P(W=>({...W,[m.key]:h+1}))}}})},O=()=>{n.current&&(he(n),me(n,t,o),ye(n,t,o,q))},z=u=>{if(l){u.preventDefault();return}const m=window.getSelection();if(m&&m.rangeCount>0){const s=m.anchorNode;let h=null;if(s&&(s.nodeType===Node.ELEMENT_NODE?h=s.closest('[data-type="text"]'):s.nodeType===Node.TEXT_NODE&&s.parentElement&&(h=s.parentElement.closest('[data-type="text"]'))),h){if(u.preventDefault(),u.stopPropagation(),n.current){const v=n.current.querySelector('[data-type="variable"], [data-type="upload"]');v&&v.focus()}return}}if(y&&m&&m.rangeCount>0){const s=m.anchorNode;let h=null;if(s&&(s.nodeType===Node.ELEMENT_NODE?h=s.closest(".tag-node"):s.nodeType===Node.TEXT_NODE&&s.parentElement&&(h=s.parentElement.closest(".tag-node"))),h){if(u.preventDefault(),u.stopPropagation(),n.current){const v=n.current.querySelector('[data-type="variable"], [data-type="upload"]');v&&v.focus()}return}}if(u.key==="Enter"&&!u.shiftKey&&(u.preventDefault(),Q()),u.key==="Escape"&&n.current){if(y){u.preventDefault();return}n.current.innerHTML="",n.current.focus()}if(u.key==="Backspace"){const s=window.getSelection();if(s&&s.rangeCount>0){const h=s.getRangeAt(0),v=s.anchorNode;if(y){let _=null,L=null;if(v&&(v.nodeType===Node.ELEMENT_NODE?(_=v.closest(".tag-node"),L=v.closest('[data-type="text"]')):v.nodeType===Node.TEXT_NODE&&v.parentElement&&(_=v.parentElement.closest(".tag-node"),L=v.parentElement.closest('[data-type="text"]'))),(_||L)&&h.collapsed&&h.startOffset===0){u.preventDefault();return}}let k=null;if(v&&(v.nodeType===Node.ELEMENT_NODE?k=v.closest('[data-type="variable"]'):v.nodeType===Node.TEXT_NODE&&v.parentElement&&(k=v.parentElement.closest('[data-type="variable"]'))),k){if(!h.collapsed)return;const _=k.innerText;if(_===""||_===""){u.preventDefault();return}if(h.startOffset===0){u.preventDefault();return}if(_.startsWith("")&&h.startOffset===1){u.preventDefault();return}}}}},Q=()=>{if(d||l||a||!I||!n.current)return;if(t.length===0){const k=n.current.textContent?.replace(/[\u200B\n]/g,"").trim()||"";if(!k)return;f(k,k);return}const u=n.current;let m="";const s={},h=k=>{if(!(k.nodeType===Node.ELEMENT_NODE&&k.style.display==="none")){if(k.nodeType===Node.TEXT_NODE)m+=(k.textContent||"").replace(/\u200B/g,"");else if(k.nodeType===Node.ELEMENT_NODE){const _=k,L=_.dataset.type,G=_.dataset.key;if(L==="variable"&&G){let Y="";const $=document.createTreeWalker(_,NodeFilter.SHOW_TEXT,{acceptNode:te=>{const ae=_.querySelector(".variable-info-icon");return ae&&ae.contains(te)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}});for(;$.nextNode();)Y+=$.currentNode.textContent||"";const Z=Y.replace(/[\u200B\n]/g,"").trim();if(Z){const te=_.dataset.multiKey;if(te){s[te]||(s[te]=[]);const ae=s[te];ae.push(Z),ae.length>1&&(m+=" "),m+=Z}else s[G]=Z,m+=Z}}else if(L==="upload"&&G)s[G]=o[G]??null,o[G]&&(m+=` [附带文件: ${o[G]?.name}] `);else{if(_.classList.contains("tag-close-btn")||_.classList.contains("file-remove-btn"))return;_.getAttribute("contenteditable")==="false"&&!L&&_.classList.contains("tag-node")?m+=_.innerText:_.childNodes.forEach(h)}}}};if(u.childNodes.forEach(h),m=m.trim(),!m)return;const v=new FormData;v.append("fullPrompt",m),Object.keys(s).forEach(k=>{const _=s[k];_!=null&&(_ instanceof File?v.append(k,_):Array.isArray(_)?_.forEach((L,G)=>{L!=null&&(L instanceof File?v.append(`${k}[${G}]`,L):typeof L=="string"?v.append(`${k}[${G}]`,L):v.append(`${k}[${G}]`,String(L)))}):typeof _=="string"?v.append(k,_):v.append(k,String(_)))}),f(v,m)},re=c?{width:typeof c=="number"?`${c}px`:c}:{};return p.jsxs("div",{className:"rich-text-editor",style:re,"data-disabled":l,children:[p.jsx("div",{ref:n,className:`rte-editor ${t.length===0?"rte-editor-default":""} ${F&&R?"rte-editor-empty":""}`,contentEditable:t.length===0,suppressContentEditableWarning:!0,"data-placeholder":R,onMouseDown:V,onMouseMove:K,onMouseUp:J,onClick:oe,onDoubleClick:se,onInput:i,onKeyDown:z,onPaste:U,onBlur:O}),p.jsx("input",{type:"file",ref:A,className:"rte-file-input",accept:".csv,.xlsx,.xls,.txt,.pdf,image/*",onChange:ee}),p.jsxs("div",{className:"rich-text-editor-footer",children:[p.jsx("div",{className:"rich-text-editor-footer-left",children:p.jsxs("div",{className:"rich-text-editor-brand",children:[p.jsxs("div",{className:"rte-brand-badge",children:[p.jsx("img",{src:"https://oospublic.sealseek.cn/file/website/ball.png",alt:""}),p.jsx("span",{className:"rte-brand-text",children:"SealSeek 1.0"})]}),p.jsx(B.Dropdown,{placement:"top",menu:{items:S.map(u=>({key:u.key,label:p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[u.icon&&p.jsx("i",{className:u.icon}),p.jsx("span",{children:u.label})]}),onClick:()=>{g?.(u)}}))},trigger:["click"],disabled:l||d,children:p.jsxs("div",{className:"rte-agent-badge",style:{cursor:S.length>0?"pointer":"default"},children:[p.jsx("i",{className:"iconfont icon-zhinengti"}),p.jsx("span",{className:"rte-agent-text",children:"智能体"})]})})]})}),p.jsx("button",{type:"button",onClick:Q,disabled:d||l||a||!I,className:"rich-text-editor-send-button",children:d||a?p.jsx("span",{className:"rte-send-spinner"}):p.jsx("i",{className:"iconfont icon-fasong"})})]}),x?.anchorEl&&(()=>{if(!document.body.contains(x.anchorEl))return null;let u="";return x.type==="upload"?u=t.find(s=>s.type==="upload"&&s.key===x.key)?.tooltip||"":x.type==="tag"?u=x.anchorEl.dataset.tooltip||"":x.type==="upload-label"?u=x.anchorEl.dataset.fileName||"":x.type==="variable"&&(u=x.anchorEl.dataset.tooltip||""),Oe.createPortal(p.jsx(B.Tooltip,{arrow:!1,title:p.jsx("div",{style:{maxWidth:"200px",fontSize:"12px",color:"#fff"},children:u}),open:!0,placement:"top",getPopupContainer:()=>document.body,overlayInnerStyle:{background:"var(--neutral-800, #262626)"},children:p.jsx("div",{style:{position:"fixed",left:`${x.anchorEl.getBoundingClientRect().left}px`,top:`${x.anchorEl.getBoundingClientRect().top}px`,width:`${x.anchorEl.offsetWidth}px`,height:`${x.anchorEl.offsetHeight}px`,pointerEvents:"none"}})}),document.body)})()]})};_e.__docgenInfo={displayName:"RichTextEditor",description:"结构化富文本输入组件,支持标签、变量输入块、文件上传以及互斥显示逻辑。",props:{config:{name:"config",required:!0,description:"结构化输入配置节点数组",type:{name:"InputNode[]",raw:"InputNode[]"}},onSend:{name:"onSend",required:!0,description:"点击发送按钮时的回调,返回数据与拼接后的 Prompt",type:{name:"function",raw:"(data: Record<string, any>, fullPrompt: string) => void"}},isProcessing:{name:"isProcessing",required:!1,description:"是否处于处理状态(禁用输入与发送)",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}}}};const je=({texts:t=[],placeholder:f="请输入内容",animationSpeed:d=100,autoPlay:l=!0,value:c,onChange:y,...S})=>{const[g,e]=r.useState(""),[a,R]=r.useState(0),[n,A]=r.useState(!1),[o,j]=r.useState(!1),[C,b]=r.useState(!1),x=r.useRef(void 0),N=r.useRef(void 0),w=r.useRef(t),T=r.useRef(a),I=r.useRef(o),q=r.useRef(g);r.useEffect(()=>{w.current=t,T.current=a,I.current=o,q.current=g});const M=r.useCallback((E,V)=>{let K=0;b(!0);const J=()=>{K<E.length?(e(E.slice(0,K+1)),K++,N.current=window.setTimeout(J,d)):(b(!1),V?.())};J()},[d]),F=r.useCallback(E=>{let V=q.current.length;const K=()=>{V>0?(e(q.current.slice(0,V-1)),V--,N.current=window.setTimeout(K,d/2)):E?.()};K()},[d]),D=r.useCallback(()=>{if(w.current.length===0||I.current)return;A(!0);const E=w.current[T.current];q.current?F(()=>{M(E,()=>{x.current=window.setTimeout(()=>{R(V=>(V+1)%w.current.length),A(!1)},2e3)})}):M(E,()=>{x.current=window.setTimeout(()=>{R(V=>(V+1)%w.current.length),A(!1)},2e3)})},[F,M]);r.useEffect(()=>(l&&t.length>0&&!o&&D(),()=>{x.current&&window.clearTimeout(x.current),N.current&&window.clearTimeout(N.current)}),[a,o,l,t.length,D]),r.useEffect(()=>{!n&&l&&t.length>0&&!o&&D()},[a,n,l,t.length,o,D]);const H=E=>{j(!0),x.current&&window.clearTimeout(x.current),N.current&&window.clearTimeout(N.current),A(!1),b(!1),S.onFocus?.(E)},P=E=>{j(!1),!c&&t.length>0&&(e(""),R(0)),S.onBlur?.(E)},U=E=>{y?.(E.target.value),S.onChange?.(E)},ee=()=>o||c?f:g||f;return p.jsxs("div",{style:{position:"relative"},children:[p.jsx(B.Input,{...S,value:c,onChange:U,onFocus:H,onBlur:P,placeholder:ee(),style:{...S.style,position:"relative",zIndex:1}}),!o&&!c&&g&&p.jsxs("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",paddingLeft:11,paddingRight:11,color:"#bfbfbf",pointerEvents:"none",zIndex:2,fontSize:14,fontFamily:"inherit"},children:[p.jsx("span",{children:g}),C&&p.jsx("span",{style:{display:"inline-block",width:1,height:"1.2em",backgroundColor:"#1890ff",marginLeft:2,animation:"blink 1s infinite"}})]}),p.jsx("style",{children:`
|
|
23
23
|
@keyframes blink {
|
|
24
24
|
0%, 50% { opacity: 1; }
|
|
25
25
|
51%, 100% { opacity: 0; }
|
|
26
26
|
}
|
|
27
|
-
`})]})};
|
|
27
|
+
`})]})};je.__docgenInfo={displayName:"DynamicInput",description:"动态文案输入框组件,支持流式文字动画效果",props:{texts:{name:"texts",required:!0,description:"动态展示的文案数组",type:{name:"string[]",raw:"string[]"}},placeholder:{name:"placeholder",required:!1,description:"输入框占位符",type:{name:"string",raw:"string"},defaultValue:{value:'"请输入内容"'}},animationSpeed:{name:"animationSpeed",required:!1,description:"动画速度(毫秒)",type:{name:"number",raw:"number"},defaultValue:{value:"100"}},autoPlay:{name:"autoPlay",required:!1,description:"是否自动播放动画",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},value:{name:"value",required:!1,description:"输入框值",type:{name:"string",raw:"string"}},onChange:{name:"onChange",required:!1,description:"输入框变化回调",type:{name:"function",raw:"(value: string) => void"}}}};const Le=({texts:t=[],placeholder:f="请输入内容",animationSpeed:d=100,autoPlay:l=!0,value:c="",onChange:y,onSubmit:S,maxLength:g=500,showCount:e=!0,submitText:a="发送",disabled:R=!1,rows:n=4,style:A,...o})=>{const[j,C]=r.useState(""),[b,x]=r.useState(0),[N,w]=r.useState(!1),[T,I]=r.useState(!1),[q,M]=r.useState(!1),[F,D]=r.useState(c||""),H=r.useRef(void 0),P=r.useRef(void 0),U=r.useRef(t),ee=r.useRef(b),E=r.useRef(T),V=r.useRef(j),K=r.useRef(null);r.useEffect(()=>{U.current=t,ee.current=b,E.current=T,V.current=j});const J=r.useCallback((s,h)=>{let v=0;M(!0);const k=()=>{v<s.length?(C(s.slice(0,v+1)),v++,P.current=window.setTimeout(k,d)):(M(!1),h?.())};k()},[d]),oe=r.useCallback(s=>{let h=V.current.length;const v=()=>{h>0?(C(V.current.slice(0,h-1)),h--,P.current=window.setTimeout(v,d/2)):s?.()};v()},[d]),se=r.useCallback(()=>{if(U.current.length===0||E.current)return;w(!0);const s=U.current[ee.current];V.current?oe(()=>{J(s,()=>{H.current=window.setTimeout(()=>{x(h=>(h+1)%U.current.length),w(!1)},2e3)})}):J(s,()=>{H.current=window.setTimeout(()=>{x(h=>(h+1)%U.current.length),w(!1)},2e3)})},[oe,J]);r.useEffect(()=>(l&&t.length>0&&!T&&se(),()=>{H.current&&window.clearTimeout(H.current),P.current&&window.clearTimeout(P.current)}),[b,T,l,t.length,se]),r.useEffect(()=>{!N&&l&&t.length>0&&!T&&se()},[b,N,l,t.length,T,se]);const i=s=>{I(!0),H.current&&window.clearTimeout(H.current),P.current&&window.clearTimeout(P.current),w(!1),M(!1),o.onFocus?.(s)},O=s=>{I(!1),!c&&t.length>0&&(C(""),x(0)),o.onBlur?.(s)},z=s=>{const h=s.target.value;g&&h.length>g||(y?y(h):D(h),o.onChange?.(s))},Q=()=>{const s=y?c:F;s.trim()&&!R&&(S?.(s),y||D(""))},re=s=>{(s.ctrlKey||s.metaKey)&&s.key==="Enter"&&(s.preventDefault(),Q()),o.onKeyDown?.(s)},u=y?c:F,m=R||!u.trim()||(g?u.length>g:!1);return p.jsxs("div",{style:{position:"relative",...A},children:[p.jsxs("div",{style:{position:"relative"},children:[p.jsx("textarea",{ref:K,value:y?c:F,onChange:z,onFocus:s=>{s.target.style.borderColor="#1890ff",s.target.style.boxShadow="0 0 0 2px rgba(24, 144, 255, 0.2)",i(s)},onBlur:s=>{s.target.style.borderColor="#d9d9d9",s.target.style.boxShadow="none",O(s)},onKeyDown:re,placeholder:T||u?f:"",maxLength:g,rows:n,disabled:R,style:{width:"100%",minHeight:`${n*24+16}px`,padding:"8px 60px 8px 12px",border:"1px solid #d9d9d9",borderRadius:"6px",fontSize:"14px",lineHeight:"1.5",fontFamily:"inherit",resize:"vertical",outline:"none",transition:"border-color 0.3s, box-shadow 0.3s",backgroundColor:"#fff",...o.style},...o}),!T&&!u&&j&&p.jsxs("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"flex-start",paddingTop:8,paddingLeft:12,paddingRight:12,color:"#bfbfbf",pointerEvents:"none",zIndex:2,fontSize:14,fontFamily:"inherit",lineHeight:"1.5"},children:[p.jsx("span",{children:j}),q&&p.jsx("span",{style:{display:"inline-block",width:1,height:"1.2em",backgroundColor:"#1890ff",marginLeft:2,animation:"blink 1s infinite"}})]}),p.jsx("div",{style:{position:"absolute",bottom:8,right:8,zIndex:3},children:p.jsx(B.Button,{type:"primary",size:"small",icon:p.jsx(ce.SendOutlined,{}),onClick:Q,disabled:m,style:{borderRadius:6,minWidth:32,height:32,display:"flex",alignItems:"center",justifyContent:"center"},children:a})})]}),e&&p.jsxs("div",{style:{marginTop:4,textAlign:"right",fontSize:"12px",color:"#999"},children:[u.length,"/",g]}),p.jsx("style",{children:`
|
|
28
28
|
@keyframes blink {
|
|
29
29
|
0%, 50% { opacity: 1; }
|
|
30
30
|
51%, 100% { opacity: 0; }
|
|
31
31
|
}
|
|
32
|
-
`})]})};
|
|
32
|
+
`})]})};Le.__docgenInfo={displayName:"DynamicTextArea",description:"动态文案文本域组件,支持流式文字动画效果",props:{texts:{name:"texts",required:!0,description:"动态展示的文案数组",type:{name:"string[]",raw:"string[]"}},placeholder:{name:"placeholder",required:!1,description:"输入框占位符",type:{name:"string",raw:"string"},defaultValue:{value:'"请输入内容"'}},animationSpeed:{name:"animationSpeed",required:!1,description:"动画速度(毫秒)",type:{name:"number",raw:"number"},defaultValue:{value:"100"}},autoPlay:{name:"autoPlay",required:!1,description:"是否自动播放动画",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},value:{name:"value",required:!1,description:"输入框值",type:{name:"string",raw:"string"}},onChange:{name:"onChange",required:!1,description:"输入框变化回调",type:{name:"function",raw:"(value: string) => void"}},onSubmit:{name:"onSubmit",required:!1,description:"提交回调",type:{name:"function",raw:"(value: string) => void"}},maxLength:{name:"maxLength",required:!1,description:"最大输入字数",type:{name:"number",raw:"number"},defaultValue:{value:"500"}},showCount:{name:"showCount",required:!1,description:"是否显示字数统计",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},submitText:{name:"submitText",required:!1,description:"提交按钮文本",type:{name:"string",raw:"string"},defaultValue:{value:'"发送"'}},disabled:{name:"disabled",required:!1,description:"是否禁用提交按钮",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}},rows:{name:"rows",required:!1,description:"文本域行数",type:{name:"number",raw:"number"},defaultValue:{value:"4"}}}};const ge=({src:t,poster:f,width:d=300,height:l,videoWidth:c,videoHeight:y,showPlayButton:S=!0,autoPlayOnHover:g=!0,onClick:e,onVideoLoaded:a,onVideoPlay:R,onVideoPause:n,onVideoEnded:A,className:o,style:j,...C})=>{const b=r.useRef(null),[x,N]=r.useState(!1),[w,T]=r.useState(!1),[I,q]=r.useState(!1),M=r.useCallback(()=>{b.current&&(b.current.play(),N(!0),R?.())},[R]),F=r.useCallback(()=>{b.current&&(b.current.pause(),N(!1),n?.())},[n]),D=r.useCallback(J=>{J.stopPropagation(),x?F():M()},[x,M,F]),H=r.useCallback(()=>{T(!0),g&&!x&&M()},[g,x,M]),P=r.useCallback(()=>{T(!1),g&&x&&F()},[g,x,F]),U=r.useCallback(()=>{q(!0),a?.()},[a]),ee=r.useCallback(()=>{N(!0),R?.()},[R]),E=r.useCallback(()=>{N(!1),n?.()},[n]),V=r.useCallback(()=>{N(!1),A?.()},[A]),K=r.useCallback(J=>{e?.(J)},[e]);return p.jsx(B.Card,{...C,className:`video-card ${o||""}`,style:{width:d,height:l,padding:0,overflow:"hidden",cursor:e?"pointer":"default",border:"none",borderRadius:0,...j},bordered:!1,onMouseEnter:H,onMouseLeave:P,onClick:K,children:p.jsxs("div",{className:"video-card-container",children:[p.jsx("video",{ref:b,src:t,poster:f,preload:"metadata",onLoadedData:U,onPlay:ee,onPause:E,onEnded:V,muted:!0,loop:!0}),S&&p.jsx("div",{className:`video-play-button ${w?"hovered":""}`,onClick:D,children:x?p.jsx(ce.PauseCircleOutlined,{className:"play-icon"}):p.jsx(ce.PlayCircleOutlined,{className:"play-icon"})}),!I&&p.jsx("div",{className:"video-loading-mask",children:p.jsx("div",{className:"loading-spinner"})})]})})};ge.__docgenInfo={displayName:"VideoCard",description:"视频卡片组件,支持鼠标悬浮播放控制",props:{src:{name:"src",required:!0,description:"视频源地址",type:{name:"string",raw:"string"}},poster:{name:"poster",required:!1,description:"视频海报图片",type:{name:"string",raw:"string"}},width:{name:"width",required:!1,description:"卡片宽度",type:{name:"number | string",raw:"number | string"},defaultValue:{value:"300"}},height:{name:"height",required:!1,description:"卡片高度",type:{name:"number | string",raw:"number | string"}},videoWidth:{name:"videoWidth",required:!1,description:"视频宽度",type:{name:"number | string",raw:"number | string"},defaultValue:{value:'"100%"'}},videoHeight:{name:"videoHeight",required:!1,description:"视频高度",type:{name:"number | string",raw:"number | string"},defaultValue:{value:'"100%"'}},showPlayButton:{name:"showPlayButton",required:!1,description:"是否显示播放按钮",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},autoPlayOnHover:{name:"autoPlayOnHover",required:!1,description:"是否自动播放(鼠标悬浮时)",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},onClick:{name:"onClick",required:!1,description:"点击事件",type:{name:"function",raw:"(event: React.MouseEvent<HTMLDivElement>) => void"}},onVideoLoaded:{name:"onVideoLoaded",required:!1,description:"视频加载完成事件",type:{name:"function",raw:"() => void"}},onVideoPlay:{name:"onVideoPlay",required:!1,description:"视频播放事件",type:{name:"function",raw:"() => void"}},onVideoPause:{name:"onVideoPause",required:!1,description:"视频暂停事件",type:{name:"function",raw:"() => void"}},onVideoEnded:{name:"onVideoEnded",required:!1,description:"视频结束事件",type:{name:"function",raw:"() => void"}},className:{name:"className",required:!1,description:"自定义样式类名",type:{name:"string",raw:"string"}},style:{name:"style",required:!1,description:"自定义样式",type:{name:"CSSProperties",raw:"React.CSSProperties"}}}};const Ue=t=>[".mp4",".webm",".ogg",".mov",".avi",".wmv",".flv",".mkv"].some(d=>t.toLowerCase().includes(d)),Je=t=>t.type?t.type:Ue(t.url)?"video":"image",Ve=({items:t,columns:f,gap:d=0,responsive:l=!0,breakpoints:c={xs:1,sm:2,md:3,lg:4,xl:5,xxl:6},className:y,style:S,onClick:g})=>{const e=r.useRef(null),[a,R]=r.useState(f||c.md||3),n=r.useRef(new Map),A=r.useCallback(()=>{if(!l||f)return f||c.md||3;const b=window.innerWidth;return b<576?c.xs||1:b<768?c.sm||2:b<992?c.md||3:b<1200?c.lg||4:b<1600?c.xl||5:c.xxl||6},[l,f,c]),o=r.useCallback(()=>{if(!e.current)return;const b=a,x=e.current,w=(x.offsetWidth-d*(b-1))/b,T=new Array(b).fill(0);t.forEach((q,M)=>{const F=q.id||M,D=n.current.get(F);if(!D)return;const H=Math.min(...T),P=T.indexOf(H),U=P*(w+d),ee=T[P];D.style.position="absolute",D.style.left=`${U}px`,D.style.top=`${ee}px`,D.style.width=`${w}px`,T[P]+=D.offsetHeight+d});const I=Math.max(...T);x.style.height=`${I}px`},[t,a,d]);r.useEffect(()=>{const b=()=>{const x=A();x!==a&&R(x)};if(l)return window.addEventListener("resize",b),b(),()=>window.removeEventListener("resize",b)},[l,A,a]),r.useEffect(()=>{const b=setTimeout(()=>{o()},100);return()=>clearTimeout(b)},[t,a,o]);const j=r.useCallback(()=>{o()},[o]),C=r.useCallback(b=>{g&&g(b),b.onClick?.(b)},[g]);return p.jsx("div",{ref:e,className:`waterfall-container ${y||""}`,style:{position:"relative",width:"100%",...S},children:t.map((b,x)=>{const N=b.id||x,w=Je(b);return p.jsx("div",{ref:T=>{T?n.current.set(N,T):n.current.delete(N)},className:"waterfall-item",children:w==="video"?p.jsx("div",{style:{width:"100%",position:"relative",paddingBottom:"56.25%",cursor:g||b.onClick?"pointer":"default"},children:p.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%"},children:p.jsx(ge,{src:b.url,poster:b.poster,width:"100%",height:"100%",onClick:()=>C(b),onVideoLoaded:j,autoPlayOnHover:!0,showPlayButton:!1})})}):p.jsx("div",{className:"waterfall-image-wrapper",onClick:()=>C(b),style:{cursor:g||b.onClick?"pointer":"default"},children:p.jsx("img",{src:b.url,alt:`瀑布流图片 ${x+1}`,className:"waterfall-image",onLoad:j,onError:j,style:{display:"block",width:"100%",height:"auto"}})})},N)})})};Ve.__docgenInfo={displayName:"Waterfall",description:"瀑布流布局组件,支持图片和视频混合展示",props:{items:{name:"items",required:!0,description:"媒体资源数组",type:{name:"WaterfallItem[]",raw:"WaterfallItem[]"}},columns:{name:"columns",required:!1,description:"列数(默认会根据屏幕宽度自动响应)",type:{name:"number",raw:"number"}},gap:{name:"gap",required:!1,description:"间隔大小",type:{name:"number",raw:"number"},defaultValue:{value:"0"}},responsive:{name:"responsive",required:!1,description:"是否启用响应式布局",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},breakpoints:{name:"breakpoints",required:!1,description:"响应式断点配置",type:{name:"object",raw:"{ xs?: number; sm?: number; md?: number; lg?: number; xl?: number; xxl?: number; }"}},className:{name:"className",required:!1,description:"自定义类名",type:{name:"string",raw:"string"}},style:{name:"style",required:!1,description:"自定义样式",type:{name:"CSSProperties",raw:"React.CSSProperties"}},onClick:{name:"onClick",required:!1,description:"点击回调",type:{name:"function",raw:"(item: any) => void"}}}};const Qe={algorithm:B.theme.defaultAlgorithm,token:{colorPrimary:"#3b82f6",colorSuccess:"#10b981",colorWarning:"#f59e0b",colorError:"#ef4444",colorInfo:"#3b82f6",colorBgBase:"#ffffff",colorBgContainer:"#ffffff",colorBgElevated:"#ffffff",colorBgLayout:"#f8fafc",colorTextBase:"#1e293b",colorText:"#1e293b",colorTextSecondary:"#64748b",colorTextTertiary:"#94a3b8",colorTextQuaternary:"#cbd5e1",colorBorder:"#e2e8f0",colorBorderSecondary:"#f1f5f9",boxShadow:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",boxShadowSecondary:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",borderRadius:8,borderRadiusLG:12,borderRadiusSM:6,fontFamily:"Inter, system-ui, Arial, sans-serif",fontSize:14,fontSizeLG:16,fontSizeSM:12,padding:16,paddingLG:24,paddingSM:12,paddingXS:8,controlHeight:32,controlHeightLG:40,controlHeightSM:24},components:{Button:{borderRadius:8,controlHeight:32,fontWeight:500},Card:{borderRadiusLG:12,boxShadow:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)"},Input:{borderRadius:8,controlHeight:32},Table:{borderRadiusLG:8,headerBg:"#f8fafc",headerColor:"#374151"}}};X.AdvancedTable=Ie,X.AppModal=Te,X.BackButton=Re,X.Button=Ee,X.Card=ke,X.DynamicInput=je,X.DynamicTextArea=Le,X.EmptyAndSpin=Se,X.LinkButton=Ae,X.PageTable=Ce,X.RichTextEditor=_e,X.VideoCard=ge,X.Waterfall=Ve,X.XcIcon=Ne,X.lightTheme=Qe,Object.defineProperty(X,Symbol.toStringTag,{value:"Module"})});
|
|
33
33
|
//# sourceMappingURL=index.umd.js.map
|