geneeantd 0.0.20 → 0.0.22
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/genee-antd.es.js
CHANGED
|
@@ -58166,8 +58166,8 @@ const JJ = _n((e, t) => {
|
|
|
58166
58166
|
] });
|
|
58167
58167
|
}, zY = {
|
|
58168
58168
|
token: {
|
|
58169
|
-
colorPrimary: "#
|
|
58170
|
-
colorPrimaryHover: "#
|
|
58169
|
+
colorPrimary: "#920d92ff",
|
|
58170
|
+
colorPrimaryHover: "#6728a2ff",
|
|
58171
58171
|
colorPrimaryActive: "#258D70",
|
|
58172
58172
|
colorPrimaryText: "#2BA07F",
|
|
58173
58173
|
colorPrimaryTextHover: "#36C196",
|
package/dist/genee-antd.umd.js
CHANGED
|
@@ -564,4 +564,4 @@ ${o}
|
|
|
564
564
|
border-left: 0;
|
|
565
565
|
border-right: 0;
|
|
566
566
|
}
|
|
567
|
-
`,FU=1,HU=3,AU=1,BU=(function(e){yU(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.cropperRef=c.createRef(),n.imageRef=c.createRef(),n.videoRef=c.createRef(),n.containerPosition={x:0,y:0},n.containerRef=null,n.styleRef=null,n.containerRect=null,n.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},n.dragStartPosition={x:0,y:0},n.dragStartCrop={x:0,y:0},n.gestureZoomStart=0,n.gestureRotationStart=0,n.isTouching=!1,n.lastPinchDistance=0,n.lastPinchRotation=0,n.rafDragTimeout=null,n.rafPinchTimeout=null,n.wheelTimer=null,n.currentDoc=typeof document<"u"?document:null,n.currentWindow=typeof window<"u"?window:null,n.resizeObserver=null,n.previousCropSize=null,n.isInitialized=!1,n.state={cropSize:null,hasWheelJustStarted:!1,mediaObjectFit:void 0},n.initResizeObserver=function(){if(!(typeof window.ResizeObserver>"u"||!n.containerRef)){var r=!0;n.resizeObserver=new window.ResizeObserver(function(o){if(r){r=!1;return}n.computeSizes()}),n.resizeObserver.observe(n.containerRef)}},n.preventZoomSafari=function(r){return r.preventDefault()},n.cleanEvents=function(){n.currentDoc&&(n.currentDoc.removeEventListener("mousemove",n.onMouseMove),n.currentDoc.removeEventListener("mouseup",n.onDragStopped),n.currentDoc.removeEventListener("touchmove",n.onTouchMove),n.currentDoc.removeEventListener("touchend",n.onDragStopped),n.currentDoc.removeEventListener("gesturechange",n.onGestureChange),n.currentDoc.removeEventListener("gestureend",n.onGestureEnd),n.currentDoc.removeEventListener("scroll",n.onScroll))},n.clearScrollEvent=function(){n.containerRef&&n.containerRef.removeEventListener("wheel",n.onWheel),n.wheelTimer&&clearTimeout(n.wheelTimer)},n.onMediaLoad=function(){var r=n.computeSizes();r&&(n.previousCropSize=r,n.emitCropData(),n.setInitialCrop(r),n.isInitialized=!0),n.props.onMediaLoaded&&n.props.onMediaLoaded(n.mediaSize)},n.setInitialCrop=function(r){if(n.props.initialCroppedAreaPercentages){var o=RU(n.props.initialCroppedAreaPercentages,n.mediaSize,n.props.rotation,r,n.props.minZoom,n.props.maxZoom),a=o.crop,i=o.zoom;n.props.onCropChange(a),n.props.onZoomChange&&n.props.onZoomChange(i)}else if(n.props.initialCroppedAreaPixels){var l=jU(n.props.initialCroppedAreaPixels,n.mediaSize,n.props.rotation,r,n.props.minZoom,n.props.maxZoom),a=l.crop,i=l.zoom;n.props.onCropChange(a),n.props.onZoomChange&&n.props.onZoomChange(i)}},n.computeSizes=function(){var r,o,a,i,l,s,u=n.imageRef.current||n.videoRef.current;if(u&&n.containerRef){n.containerRect=n.containerRef.getBoundingClientRect(),n.saveContainerPosition();var d=n.containerRect.width/n.containerRect.height,f=((r=n.imageRef.current)===null||r===void 0?void 0:r.naturalWidth)||((o=n.videoRef.current)===null||o===void 0?void 0:o.videoWidth)||0,m=((a=n.imageRef.current)===null||a===void 0?void 0:a.naturalHeight)||((i=n.videoRef.current)===null||i===void 0?void 0:i.videoHeight)||0,p=u.offsetWidth<f||u.offsetHeight<m,g=f/m,h=void 0;if(p)switch(n.state.mediaObjectFit){default:case"contain":h=d>g?{width:n.containerRect.height*g,height:n.containerRect.height}:{width:n.containerRect.width,height:n.containerRect.width/g};break;case"horizontal-cover":h={width:n.containerRect.width,height:n.containerRect.width/g};break;case"vertical-cover":h={width:n.containerRect.height*g,height:n.containerRect.height};break}else h={width:u.offsetWidth,height:u.offsetHeight};n.mediaSize=Kn(Kn({},h),{naturalWidth:f,naturalHeight:m}),n.props.setMediaSize&&n.props.setMediaSize(n.mediaSize);var v=n.props.cropSize?n.props.cropSize:MU(n.mediaSize.width,n.mediaSize.height,n.containerRect.width,n.containerRect.height,n.props.aspect,n.props.rotation);return(((l=n.state.cropSize)===null||l===void 0?void 0:l.height)!==v.height||((s=n.state.cropSize)===null||s===void 0?void 0:s.width)!==v.width)&&n.props.onCropSizeChange&&n.props.onCropSizeChange(v),n.setState({cropSize:v},n.recomputeCropPosition),n.props.setCropSize&&n.props.setCropSize(v),v}},n.saveContainerPosition=function(){if(n.containerRef){var r=n.containerRef.getBoundingClientRect();n.containerPosition={x:r.left,y:r.top}}},n.onMouseDown=function(r){n.currentDoc&&(r.preventDefault(),n.currentDoc.addEventListener("mousemove",n.onMouseMove),n.currentDoc.addEventListener("mouseup",n.onDragStopped),n.saveContainerPosition(),n.onDragStart(t.getMousePoint(r)))},n.onMouseMove=function(r){return n.onDrag(t.getMousePoint(r))},n.onScroll=function(r){n.currentDoc&&(r.preventDefault(),n.saveContainerPosition())},n.onTouchStart=function(r){n.currentDoc&&(n.isTouching=!0,!(n.props.onTouchRequest&&!n.props.onTouchRequest(r))&&(n.currentDoc.addEventListener("touchmove",n.onTouchMove,{passive:!1}),n.currentDoc.addEventListener("touchend",n.onDragStopped),n.saveContainerPosition(),r.touches.length===2?n.onPinchStart(r):r.touches.length===1&&n.onDragStart(t.getTouchPoint(r.touches[0]))))},n.onTouchMove=function(r){r.preventDefault(),r.touches.length===2?n.onPinchMove(r):r.touches.length===1&&n.onDrag(t.getTouchPoint(r.touches[0]))},n.onGestureStart=function(r){n.currentDoc&&(r.preventDefault(),n.currentDoc.addEventListener("gesturechange",n.onGestureChange),n.currentDoc.addEventListener("gestureend",n.onGestureEnd),n.gestureZoomStart=n.props.zoom,n.gestureRotationStart=n.props.rotation)},n.onGestureChange=function(r){if(r.preventDefault(),!n.isTouching){var o=t.getMousePoint(r),a=n.gestureZoomStart-1+r.scale;if(n.setNewZoom(a,o,{shouldUpdatePosition:!0}),n.props.onRotationChange){var i=n.gestureRotationStart+r.rotation;n.props.onRotationChange(i)}}},n.onGestureEnd=function(r){n.cleanEvents()},n.onDragStart=function(r){var o,a,i=r.x,l=r.y;n.dragStartPosition={x:i,y:l},n.dragStartCrop=Kn({},n.props.crop),(a=(o=n.props).onInteractionStart)===null||a===void 0||a.call(o)},n.onDrag=function(r){var o=r.x,a=r.y;n.currentWindow&&(n.rafDragTimeout&&n.currentWindow.cancelAnimationFrame(n.rafDragTimeout),n.rafDragTimeout=n.currentWindow.requestAnimationFrame(function(){if(n.state.cropSize&&!(o===void 0||a===void 0)){var i=o-n.dragStartPosition.x,l=a-n.dragStartPosition.y,s={x:n.dragStartCrop.x+i,y:n.dragStartCrop.y+l},u=n.props.restrictPosition?rs(s,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):s;n.props.onCropChange(u)}}))},n.onDragStopped=function(){var r,o;n.isTouching=!1,n.cleanEvents(),n.emitCropData(),(o=(r=n.props).onInteractionEnd)===null||o===void 0||o.call(r)},n.onWheel=function(r){if(n.currentWindow&&!(n.props.onWheelRequest&&!n.props.onWheelRequest(r))){r.preventDefault();var o=t.getMousePoint(r),a=NU(r).pixelY,i=n.props.zoom-a*n.props.zoomSpeed/200;n.setNewZoom(i,o,{shouldUpdatePosition:!0}),n.state.hasWheelJustStarted||n.setState({hasWheelJustStarted:!0},function(){var l,s;return(s=(l=n.props).onInteractionStart)===null||s===void 0?void 0:s.call(l)}),n.wheelTimer&&clearTimeout(n.wheelTimer),n.wheelTimer=n.currentWindow.setTimeout(function(){return n.setState({hasWheelJustStarted:!1},function(){var l,s;return(s=(l=n.props).onInteractionEnd)===null||s===void 0?void 0:s.call(l)})},250)}},n.getPointOnContainer=function(r,o){var a=r.x,i=r.y;if(!n.containerRect)throw new Error("The Cropper is not mounted");return{x:n.containerRect.width/2-(a-o.x),y:n.containerRect.height/2-(i-o.y)}},n.getPointOnMedia=function(r){var o=r.x,a=r.y,i=n.props,l=i.crop,s=i.zoom;return{x:(o+l.x)/s,y:(a+l.y)/s}},n.setNewZoom=function(r,o,a){var i=a===void 0?{}:a,l=i.shouldUpdatePosition,s=l===void 0?!0:l;if(!(!n.state.cropSize||!n.props.onZoomChange)){var u=qu(r,n.props.minZoom,n.props.maxZoom);if(s){var d=n.getPointOnContainer(o,n.containerPosition),f=n.getPointOnMedia(d),m={x:f.x*u-d.x,y:f.y*u-d.y},p=n.props.restrictPosition?rs(m,n.mediaSize,n.state.cropSize,u,n.props.rotation):m;n.props.onCropChange(p)}n.props.onZoomChange(u)}},n.getCropData=function(){if(!n.state.cropSize)return null;var r=n.props.restrictPosition?rs(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;return zU(r,n.mediaSize,n.state.cropSize,n.getAspect(),n.props.zoom,n.props.rotation,n.props.restrictPosition)},n.emitCropData=function(){var r=n.getCropData();if(r){var o=r.croppedAreaPercentages,a=r.croppedAreaPixels;n.props.onCropComplete&&n.props.onCropComplete(o,a),n.props.onCropAreaChange&&n.props.onCropAreaChange(o,a)}},n.emitCropAreaChange=function(){var r=n.getCropData();if(r){var o=r.croppedAreaPercentages,a=r.croppedAreaPixels;n.props.onCropAreaChange&&n.props.onCropAreaChange(o,a)}},n.recomputeCropPosition=function(){var r,o;if(n.state.cropSize){var a=n.props.crop;if(n.isInitialized&&(!((r=n.previousCropSize)===null||r===void 0)&&r.width)&&(!((o=n.previousCropSize)===null||o===void 0)&&o.height)){var i=Math.abs(n.previousCropSize.width-n.state.cropSize.width)>1e-6||Math.abs(n.previousCropSize.height-n.state.cropSize.height)>1e-6;if(i){var l=n.state.cropSize.width/n.previousCropSize.width,s=n.state.cropSize.height/n.previousCropSize.height;a={x:n.props.crop.x*l,y:n.props.crop.y*s}}}var u=n.props.restrictPosition?rs(a,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):a;n.previousCropSize=n.state.cropSize,n.props.onCropChange(u),n.emitCropData()}},n.onKeyDown=function(r){var o,a,i=n.props,l=i.crop,s=i.onCropChange,u=i.keyboardStep,d=i.zoom,f=i.rotation,m=u;if(n.state.cropSize){r.shiftKey&&(m*=.2);var p=Kn({},l);switch(r.key){case"ArrowUp":p.y-=m,r.preventDefault();break;case"ArrowDown":p.y+=m,r.preventDefault();break;case"ArrowLeft":p.x-=m,r.preventDefault();break;case"ArrowRight":p.x+=m,r.preventDefault();break;default:return}n.props.restrictPosition&&(p=rs(p,n.mediaSize,n.state.cropSize,d,f)),r.repeat||(a=(o=n.props).onInteractionStart)===null||a===void 0||a.call(o),s(p)}},n.onKeyUp=function(r){var o,a;switch(r.key){case"ArrowUp":case"ArrowDown":case"ArrowLeft":case"ArrowRight":r.preventDefault();break;default:return}n.emitCropData(),(a=(o=n.props).onInteractionEnd)===null||a===void 0||a.call(o)},n}return t.prototype.componentDidMount=function(){!this.currentDoc||!this.currentWindow||(this.containerRef&&(this.containerRef.ownerDocument&&(this.currentDoc=this.containerRef.ownerDocument),this.currentDoc.defaultView&&(this.currentWindow=this.currentDoc.defaultView),this.initResizeObserver(),typeof window.ResizeObserver>"u"&&this.currentWindow.addEventListener("resize",this.computeSizes),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.onGestureStart)),this.currentDoc.addEventListener("scroll",this.onScroll),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=VU,this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef&&this.props.setVideoRef(this.videoRef),this.props.setCropperRef&&this.props.setCropperRef(this.cropperRef))},t.prototype.componentWillUnmount=function(){var n,r;!this.currentDoc||!this.currentWindow||(typeof window.ResizeObserver>"u"&&this.currentWindow.removeEventListener("resize",this.computeSizes),(n=this.resizeObserver)===null||n===void 0||n.disconnect(),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef&&((r=this.styleRef.parentNode)===null||r===void 0||r.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent())},t.prototype.componentDidUpdate=function(n){var r,o,a,i,l,s,u,d,f;n.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):n.aspect!==this.props.aspect?this.computeSizes():n.objectFit!==this.props.objectFit?this.computeSizes():n.zoom!==this.props.zoom?this.recomputeCropPosition():((r=n.cropSize)===null||r===void 0?void 0:r.height)!==((o=this.props.cropSize)===null||o===void 0?void 0:o.height)||((a=n.cropSize)===null||a===void 0?void 0:a.width)!==((i=this.props.cropSize)===null||i===void 0?void 0:i.width)?this.computeSizes():(((l=n.crop)===null||l===void 0?void 0:l.x)!==((s=this.props.crop)===null||s===void 0?void 0:s.x)||((u=n.crop)===null||u===void 0?void 0:u.y)!==((d=this.props.crop)===null||d===void 0?void 0:d.y))&&this.emitCropAreaChange(),n.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),n.video!==this.props.video&&((f=this.videoRef.current)===null||f===void 0||f.load());var m=this.getObjectFit();m!==this.state.mediaObjectFit&&this.setState({mediaObjectFit:m},this.computeSizes)},t.prototype.getAspect=function(){var n=this.props,r=n.cropSize,o=n.aspect;return r?r.width/r.height:o},t.prototype.getObjectFit=function(){var n,r,o,a;if(this.props.objectFit==="cover"){var i=this.imageRef.current||this.videoRef.current;if(i&&this.containerRef){this.containerRect=this.containerRef.getBoundingClientRect();var l=this.containerRect.width/this.containerRect.height,s=((n=this.imageRef.current)===null||n===void 0?void 0:n.naturalWidth)||((r=this.videoRef.current)===null||r===void 0?void 0:r.videoWidth)||0,u=((o=this.imageRef.current)===null||o===void 0?void 0:o.naturalHeight)||((a=this.videoRef.current)===null||a===void 0?void 0:a.videoHeight)||0,d=s/u;return d<l?"horizontal-cover":"vertical-cover"}return"horizontal-cover"}return this.props.objectFit},t.prototype.onPinchStart=function(n){var r=t.getTouchPoint(n.touches[0]),o=t.getTouchPoint(n.touches[1]);this.lastPinchDistance=BN(r,o),this.lastPinchRotation=WN(r,o),this.onDragStart(XN(r,o))},t.prototype.onPinchMove=function(n){var r=this;if(!(!this.currentDoc||!this.currentWindow)){var o=t.getTouchPoint(n.touches[0]),a=t.getTouchPoint(n.touches[1]),i=XN(o,a);this.onDrag(i),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame(function(){var l=BN(o,a),s=r.props.zoom*(l/r.lastPinchDistance);r.setNewZoom(s,i,{shouldUpdatePosition:!1}),r.lastPinchDistance=l;var u=WN(o,a),d=r.props.rotation+(u-r.lastPinchRotation);r.props.onRotationChange&&r.props.onRotationChange(d),r.lastPinchRotation=u})}},t.prototype.render=function(){var n=this,r,o=this.props,a=o.image,i=o.video,l=o.mediaProps,s=o.cropperProps,u=o.transform,d=o.crop,f=d.x,m=d.y,p=o.rotation,g=o.zoom,h=o.cropShape,v=o.showGrid,b=o.roundCropAreaPixels,y=o.style,C=y.containerStyle,x=y.cropAreaStyle,S=y.mediaStyle,w=o.classes,O=w.containerClassName,N=w.cropAreaClassName,E=w.mediaClassName,M=(r=this.state.mediaObjectFit)!==null&&r!==void 0?r:this.getObjectFit();return c.createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(R){return n.containerRef=R},"data-testid":"container",style:C,className:Gu("reactEasyCrop_Container",O)},a?c.createElement("img",Kn({alt:"",className:Gu("reactEasyCrop_Image",M==="contain"&&"reactEasyCrop_Contain",M==="horizontal-cover"&&"reactEasyCrop_Cover_Horizontal",M==="vertical-cover"&&"reactEasyCrop_Cover_Vertical",E)},l,{src:a,ref:this.imageRef,style:Kn(Kn({},S),{transform:u||"translate(".concat(f,"px, ").concat(m,"px) rotate(").concat(p,"deg) scale(").concat(g,")")}),onLoad:this.onMediaLoad})):i&&c.createElement("video",Kn({autoPlay:!0,playsInline:!0,loop:!0,muted:!0,className:Gu("reactEasyCrop_Video",M==="contain"&&"reactEasyCrop_Contain",M==="horizontal-cover"&&"reactEasyCrop_Cover_Horizontal",M==="vertical-cover"&&"reactEasyCrop_Cover_Vertical",E)},l,{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:Kn(Kn({},S),{transform:u||"translate(".concat(f,"px, ").concat(m,"px) rotate(").concat(p,"deg) scale(").concat(g,")")}),controls:!1}),(Array.isArray(i)?i:[{src:i}]).map(function(T){return c.createElement("source",Kn({key:T.src},T))})),this.state.cropSize&&c.createElement("div",Kn({ref:this.cropperRef,style:Kn(Kn({},x),{width:b?Math.round(this.state.cropSize.width):this.state.cropSize.width,height:b?Math.round(this.state.cropSize.height):this.state.cropSize.height}),tabIndex:0,onKeyDown:this.onKeyDown,onKeyUp:this.onKeyUp,"data-testid":"cropper",className:Gu("reactEasyCrop_CropArea",h==="round"&&"reactEasyCrop_CropAreaRound",v&&"reactEasyCrop_CropAreaGrid",N)},s)))},t.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:HU,minZoom:FU,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},cropperProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0,keyboardStep:AU},t.getMousePoint=function(n){return{x:Number(n.clientX),y:Number(n.clientY)}},t.getTouchPoint=function(n){return{x:Number(n.clientX),y:Number(n.clientY)}},t})(c.Component);const io="img-crop",Og=1,os=.1,Qu=0,KN=-180,ZN=180,Pg=1,as=.01,WU=P.forwardRef((e,t)=>{const{cropperRef:n,zoomSlider:r,rotationSlider:o,aspectSlider:a,showReset:i,resetBtnText:l,modalImage:s,aspect:u,minZoom:d,maxZoom:f,minAspect:m,maxAspect:p,cropShape:g,showGrid:h,cropperProps:v}=e,[b,y]=P.useState({x:0,y:0}),[C,x]=P.useState(Og),[S,w]=P.useState(Qu),[O,N]=P.useState(u),E=P.useRef({width:0,height:0,x:0,y:0}),M=P.useCallback((j,L)=>{E.current=L},[]),T=P.useRef(u);T.current!==u&&(T.current=u,N(u));const R=C!==Og||S!==Qu||O!==u,k=()=>{x(Og),w(Qu),N(u)};P.useImperativeHandle(t,()=>({rotation:S,cropPixelsRef:E,onReset:k}));const z="[display:flex] [align-items:center] [width:60%] [margin-inline:auto]",D="[display:flex] [align-items:center] [justify-content:center] [height:32px] [width:32px] [background:transparent] [border:0] [font-family:inherit] [font-size:18px] [cursor:pointer] disabled:[opacity:20%] disabled:[cursor:default]",I="[flex:1]";return se.jsxs(se.Fragment,{children:[se.jsx(BU,Object.assign({},v,{ref:n,image:s,crop:b,zoom:C,rotation:S,aspect:O,minZoom:d,maxZoom:f,zoomWithScroll:r,cropShape:g,showGrid:h,onCropChange:y,onZoomChange:x,onRotationChange:w,onCropComplete:M,classes:{containerClassName:`${io}-container ![position:relative] [width:100%] [height:40vh] [&~section:first-of-type]:[margin-top:16px] [&~section:last-of-type]:[margin-bottom:16px]`,mediaClassName:`${io}-media`}})),r&&se.jsxs("section",{className:`${io}-control ${io}-control-zoom ${z}`,children:[se.jsx("button",{className:D,onClick:()=>x(+(C-os).toFixed(1)),disabled:C-os<d,children:"-"}),se.jsx(fu,{className:I,min:d,max:f,step:os,value:C,onChange:x}),se.jsx("button",{className:D,onClick:()=>x(+(C+os).toFixed(1)),disabled:C+os>f,children:"+"})]}),o&&se.jsxs("section",{className:`${io}-control ${io}-control-rotation ${z}`,children:[se.jsx("button",{className:`${D} [font-size:16px]`,onClick:()=>w(S-Pg),disabled:S===KN,children:"↺"}),se.jsx(fu,{className:I,min:KN,max:ZN,step:Pg,value:S,onChange:w}),se.jsx("button",{className:`${D} [font-size:16px]`,onClick:()=>w(S+Pg),disabled:S===ZN,children:"↻"})]}),a&&se.jsxs("section",{className:`${io}-control ${io}-control-aspect ${z}`,children:[se.jsx("button",{className:D,onClick:()=>N(+(O-as).toFixed(2)),disabled:O-as<m,children:"↕"}),se.jsx(fu,{className:I,min:m,max:p,step:as,value:O,onChange:N}),se.jsx("button",{className:D,onClick:()=>N(+(O+as).toFixed(2)),disabled:O+as>p,children:"↔"})]}),i&&(r||o||a)&&se.jsx(on,{className:"[position:absolute] [bottom:20px]",style:R?{}:{opacity:.3,pointerEvents:"none"},onClick:k,children:l})]})});var XU=P.memo(WU),KU="/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */.visible{visibility:visible}.\\!\\[position\\:relative\\]{position:relative!important}.\\[position\\:absolute\\]{position:absolute}.\\[bottom\\:20px\\]{bottom:20px}.container{width:100%}.\\[margin-inline\\:auto\\]{margin-inline:auto}.\\[display\\:flex\\]{display:flex}.grid{display:grid}.\\[height\\:32px\\]{height:32px}.\\[height\\:40vh\\]{height:40vh}.\\[width\\:32px\\]{width:32px}.\\[width\\:60\\%\\]{width:60%}.\\[width\\:100\\%\\]{width:100%}.\\[flex\\:1\\]{flex:1}.\\[cursor\\:pointer\\]{cursor:pointer}.\\[align-items\\:center\\]{align-items:center}.\\[justify-content\\:center\\]{justify-content:center}.\\[font-family\\:inherit\\]{font-family:inherit}.\\[font-size\\:16px\\]{font-size:16px}.\\[font-size\\:18px\\]{font-size:18px}.\\[background\\:transparent\\]{background:transparent}.\\[border\\:0\\]{border:0}.disabled\\:\\[cursor\\:default\\]{&:disabled{cursor:default}}.disabled\\:\\[opacity\\:20\\%\\]{&:disabled{opacity:20%}}.\\[\\&\\~section\\:first-of-type\\]\\:\\[margin-top\\:16px\\]{&~section:first-of-type{margin-top:16px}}.\\[\\&\\~section\\:last-of-type\\]\\:\\[margin-bottom\\:16px\\]{&~section:last-of-type{margin-bottom:16px}}";(function(){if(typeof document>"u")return;const e=document.createElement("style"),t=document.querySelector('meta[name="csp-nonce"]');t&&t.content&&e.setAttribute("nonce",t.content),e.textContent=KU,document.head.appendChild(e)})();const ZU=P.forwardRef((e,t)=>{const{quality:n=.4,fillColor:r="white",zoomSlider:o=!0,rotationSlider:a=!1,aspectSlider:i=!1,showReset:l=!1,resetText:s,aspect:u=1,minZoom:d=1,maxZoom:f=3,minAspect:m=.5,maxAspect:p=2,cropShape:g="rect",showGrid:h=!1,cropperProps:v,modalClassName:b,modalTitle:y,modalWidth:C,modalOk:x,modalCancel:S,onModalOk:w,onModalCancel:O,modalProps:N,beforeCrop:E,children:M}=e,T=P.useRef({});T.current.onModalOk=w,T.current.onModalCancel=O,T.current.beforeCrop=E;const R=P.useRef(null),k=P.useCallback(Q=>{var $;const _=document.createElement("canvas"),G=_.getContext("2d"),Y=((($=Q?.getRootNode)===null||$===void 0?void 0:$.call(Q))||document).querySelector(`.${io}-media`),{width:ee,height:K,x:ue,y:ce}=R.current.cropPixelsRef.current;if(a&&R.current.rotation!==Qu){const{naturalWidth:me,naturalHeight:fe}=Y,le=R.current.rotation*(Math.PI/180),ge=Math.abs(Math.sin(le)),pe=Math.abs(Math.cos(le)),de=me*pe+fe*ge,xe=fe*pe+me*ge;_.width=de,_.height=xe,G.fillStyle=r,G.fillRect(0,0,de,xe);const Ne=de/2,je=xe/2;G.translate(Ne,je),G.rotate(le),G.translate(-Ne,-je);const Re=(de-me)/2,ke=(xe-fe)/2;G.drawImage(Y,0,0,me,fe,Re,ke,me,fe);const Fe=G.getImageData(0,0,de,xe);_.width=ee,_.height=K,G.putImageData(Fe,-ue,-ce)}else _.width=ee,_.height=K,G.fillStyle=r,G.fillRect(0,0,ee,K),G.drawImage(Y,ue,ce,ee,K,0,0,ee,K);return _},[r,a]),[z,D]=P.useState(!1),[I,j]=P.useState(""),L=P.useRef(void 0),V=P.useRef(void 0),H=P.useCallback(Q=>Yu(void 0,[Q],void 0,function*({beforeUpload:$,file:_,resolve:G,reject:ae}){const Y=_;if(typeof $!="function"){G(Y);return}try{const ee=yield $(_,[_]);G(ee===!1?!1:ee!==!0&&ee||Y)}catch(ee){ae(ee)}}),[]),W=P.useCallback(Q=>(($,_)=>new Promise((G,ae)=>Yu(void 0,void 0,void 0,function*(){let Y=$;if(typeof T.current.beforeCrop=="function")try{const K=yield T.current.beforeCrop($,_);if(K===!1)return H({beforeUpload:Q,file:$,resolve:G,reject:ae});K!==!0&&(Y=K||$)}catch{return H({beforeUpload:Q,file:$,resolve:G,reject:ae})}const ee=new FileReader;ee.addEventListener("load",()=>{typeof ee.result=="string"&&(D(!0),setTimeout(()=>{j(ee.result)},10))}),ee.readAsDataURL(Y),L.current=()=>{var K,ue;D(!1),j(""),R.current.onReset();let ce=!1;(ue=(K=T.current).onModalCancel)===null||ue===void 0||ue.call(K,me=>{G(me),ce=!0}),ce||G(Oa.LIST_IGNORE)},V.current=K=>Yu(void 0,void 0,void 0,function*(){D(!1),j(""),R.current.onReset();const ue=k(K.target),{type:ce,name:me,uid:fe}=Y;ue.toBlob(le=>Yu(void 0,void 0,void 0,function*(){const ge=new File([le],me,{type:ce});Object.assign(ge,{uid:fe}),H({beforeUpload:Q,file:ge,resolve:pe=>{var de,xe;G(pe),(xe=(de=T.current).onModalOk)===null||xe===void 0||xe.call(de,pe)},reject:pe=>{var de,xe;ae(pe),(xe=(de=T.current).onModalOk)===null||xe===void 0||xe.call(de,pe)}})}),ce,n)})}))),[k,n,H]),X=P.useCallback(Q=>{const $=Array.isArray(Q)?Q[0]:Q,_=$.props,{beforeUpload:G,accept:ae}=_,Y=CU(_,["beforeUpload","accept"]);return Object.assign(Object.assign({},$),{props:Object.assign(Object.assign({},Y),{accept:ae||"image/*",beforeUpload:W(G)})})},[W]),F=P.useMemo(()=>{const Q={};return C!==void 0&&(Q.width=C),x!==void 0&&(Q.okText=x),S!==void 0&&(Q.cancelText=S),Q},[S,x,C]),A=`${io}-modal${b?` ${b}`:""}`,J=(typeof window>"u"?"":window.navigator.language)==="zh-CN",ne=y||(J?"编辑图片":"Edit image"),q=s||(J?"重置":"Reset");return se.jsxs(se.Fragment,{children:[X(M),se.jsx(Nr,Object.assign({},N,F,{open:z,title:ne,onCancel:L.current,onOk:V.current,wrapClassName:A,maskClosable:!1,destroyOnHidden:!0,children:se.jsx(XU,{ref:R,cropperRef:t,zoomSlider:o,rotationSlider:a,aspectSlider:i,showReset:l,resetBtnText:q,modalImage:I,aspect:u,minZoom:d,maxZoom:f,minAspect:m,maxAspect:p,cropShape:g,showGrid:h,cropperProps:v})}))]})}),$u={avatarUpload:"_avatarUpload_vcunw_1",avatar:"_avatar_vcunw_1",avatarPlaceholder:"_avatarPlaceholder_vcunw_12",uploadTip:"_uploadTip_vcunw_17"},UU=e=>{const{avatarImg:t,uploadTip:n,avatarTypes:r,avatarMaxSize:o,showCrop:a=!0,imgCropProps:i,onFileChange:l}=e,[s,u]=P.useState(t),[d,f]=P.useState(!1);P.useEffect(()=>{u(t)},[t]);const m=h=>new Promise((v,b)=>{const y=new FileReader;y.readAsDataURL(h),y.onload=()=>{typeof y.result=="string"?v(y.result):b(new Error("文件转换Base64失败"))},y.onerror=C=>b(C)}),p=async h=>{try{f(!0);const v=await m(h);u(v),l&&l(v,h)}catch{}finally{f(!1)}return Oa.LIST_IGNORE},g=async h=>{if(r?.length){const v=h.name.split(".").pop()?.toLowerCase()||"";if(!r.includes(v))return Cu.error(`仅支持${r.join("、")}格式文件`),Oa.LIST_IGNORE}return o&&!(h.size/1024<o)?(Cu.error(`文件大小不能超过${o}KB!`),Oa.LIST_IGNORE):a};return se.jsxs("div",{className:$u.avatarUpload,children:[s?se.jsx("img",{src:s,className:$u.avatar}):se.jsx(ju,{className:$u.avatarPlaceholder}),se.jsx(ZU,{beforeCrop:g,...i,children:se.jsx(Oa,{showUploadList:!1,maxCount:1,beforeUpload:p,children:se.jsx(on,{type:"primary",icon:se.jsx(qp,{}),loading:d,children:"上传头像"})})}),!!n&&se.jsx("div",{className:$u.uploadTip,children:n})]})},Wr={doubleColLayout:"_doubleColLayout_aebel_2",sider:"_sider_aebel_11",contentWrapper:"_contentWrapper_aebel_18",content:"_content_aebel_18",menuItem:"_menuItem_aebel_32",active:"_active_aebel_42",scrollActive:"_scrollActive_aebel_46",buttonGroup:"_buttonGroup_aebel_59",buttonItem:"_buttonItem_aebel_72",dragBar:"_dragBar_aebel_82"},{Sider:JU,Content:YU}=Ao,qU=({leftMenu:e,menuActiveKey:t,menuItemClick:n,rightContent:r,activeMode:o="normal",leftWidth:a=250,siderStyle:i={},contentStyle:l={},layoutStyle:s={height:"100%"},onCollapse:u,topBarOptions:d,resizeConfig:f={enabled:!0,minWidth:180,maxWidth:550}})=>{const[m,p]=P.useState(a),[g,h]=P.useState(!1),v=P.useRef(null);P.useEffect(()=>{typeof a=="number"&&p(a)},[a]);const b=y=>{if(!f.enabled)return;y.preventDefault(),h(!0);let C=!0;const x=w=>{if(!C)return;const O=v.current?.parentElement;if(!O)return;const N=O.getBoundingClientRect();let E=w.clientX-N.left-10;f.minWidth&&(E=Math.max(E,f.minWidth)),f.maxWidth&&(E=Math.min(E,f.maxWidth)),p(E),f.onWidthChange&&f.onWidthChange(E)},S=()=>{C=!1,h(!1),document.removeEventListener("mousemove",x),document.removeEventListener("mouseup",S)};return document.addEventListener("mousemove",x),document.addEventListener("mouseup",S),()=>{document.removeEventListener("mousemove",x),document.removeEventListener("mouseup",S)}};return se.jsxs(Ao,{className:`${Wr.doubleColLayout} ${g?"resizing":""}`,style:{...s},children:[se.jsx(JU,{width:m,theme:"light",onCollapse:u,className:Wr.sider,style:{...i,transition:g?"none":"width 0.3s ease"},children:e&&e.map(y=>se.jsx("div",{className:`${Wr.menuItem} ${y.key===t?o==="normal"?Wr.active:Wr.scrollActive:""}`,onClick:()=>n&&n(y),children:y.label},y.key))}),se.jsx("div",{ref:v,className:Wr.dragBar,onMouseDown:b,style:{opacity:g?.8:1}}),se.jsx(Ao,{className:Wr.contentWrapper,style:{...l,transition:g?"none":"all 0.3s ease"},children:se.jsxs(YU,{className:Wr.content,style:{},children:[d?.barList&&se.jsx("div",{className:Wr.buttonGroup,children:d.barList.map(y=>se.jsx("div",{className:`${Wr.buttonItem} ${y.key===d.barActiveKey?Wr.active:""}`,onClick:()=>d.barClick&&d.barClick(y),children:y.label},y.key))}),r]})})]})},Eo={detailView:"_detailView_yqf2w_1",detailViewTop:"_detailViewTop_yqf2w_4",detailViewTopBreadcrumb:"_detailViewTopBreadcrumb_yqf2w_10",detailViewContent:"_detailViewContent_yqf2w_14",detailViewContentItem:"_detailViewContentItem_yqf2w_19",detailViewTopLeft:"_detailViewTopLeft_yqf2w_25",detailViewTopRightItem:"_detailViewTopRightItem_yqf2w_28",detailViewTabs:"_detailViewTabs_yqf2w_34"},GU=e=>{const[t,n]=P.useState(e.tabs?.items[0].childrenContent),r=o=>{n(e.tabs?.items.find(a=>a.key===o)?.childrenContent),e.tabs?.onChange?.(o)};return se.jsxs("div",{className:Eo.detailView,children:[se.jsxs("div",{className:Eo.detailViewTop,children:[se.jsxs("div",{className:Eo.detailViewTopLeft,children:[se.jsxs("div",{className:Eo.detailViewTopBreadcrumb,children:[se.jsx(on,{style:{marginRight:10},icon:se.jsx(Ni,{})}),se.jsx("span",{style:{fontSize:20},children:e.title})]}),se.jsx("div",{children:e.overview})]}),se.jsx("div",{className:Eo.detailViewTopRight,children:se.jsxs("div",{className:Eo.detailViewTopRightItem,children:[se.jsx("div",{children:e.buttonBar}),se.jsx("div",{style:{marginTop:16},children:e.statistic})]})})]}),se.jsx("div",{className:Eo.detailViewTabs,children:se.jsx(ou,{defaultActiveKey:e.tabs?.defaultActiveKey,items:e.tabs?.items,onChange:r})}),se.jsx("div",{className:Eo.detailViewContent,children:se.jsx("div",{className:Eo.detailViewContentItem,children:t})})]})},QU={token:{colorPrimary:"#2BA07F",colorPrimaryHover:"#36C196",colorPrimaryActive:"#258D70",colorPrimaryText:"#2BA07F",colorPrimaryTextHover:"#36C196",colorPrimaryTextActive:"#258D70",colorSuccess:"#36C196"}};Vn.AvatarUpload=UU,Vn.DetailView=GU,Vn.DoubleColLayout=qU,Vn.DynamicForm=gg,Vn.FilterForm=rU,Vn.FloatCard=pN,Vn.Login=pU,Vn.RemoteSelect=bU,Vn.TablePlus=_Z,Vn.defaultTheme=QU,Object.defineProperty(Vn,Symbol.toStringTag,{value:"Module"})}));
|
|
567
|
+
`,FU=1,HU=3,AU=1,BU=(function(e){yU(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.cropperRef=c.createRef(),n.imageRef=c.createRef(),n.videoRef=c.createRef(),n.containerPosition={x:0,y:0},n.containerRef=null,n.styleRef=null,n.containerRect=null,n.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},n.dragStartPosition={x:0,y:0},n.dragStartCrop={x:0,y:0},n.gestureZoomStart=0,n.gestureRotationStart=0,n.isTouching=!1,n.lastPinchDistance=0,n.lastPinchRotation=0,n.rafDragTimeout=null,n.rafPinchTimeout=null,n.wheelTimer=null,n.currentDoc=typeof document<"u"?document:null,n.currentWindow=typeof window<"u"?window:null,n.resizeObserver=null,n.previousCropSize=null,n.isInitialized=!1,n.state={cropSize:null,hasWheelJustStarted:!1,mediaObjectFit:void 0},n.initResizeObserver=function(){if(!(typeof window.ResizeObserver>"u"||!n.containerRef)){var r=!0;n.resizeObserver=new window.ResizeObserver(function(o){if(r){r=!1;return}n.computeSizes()}),n.resizeObserver.observe(n.containerRef)}},n.preventZoomSafari=function(r){return r.preventDefault()},n.cleanEvents=function(){n.currentDoc&&(n.currentDoc.removeEventListener("mousemove",n.onMouseMove),n.currentDoc.removeEventListener("mouseup",n.onDragStopped),n.currentDoc.removeEventListener("touchmove",n.onTouchMove),n.currentDoc.removeEventListener("touchend",n.onDragStopped),n.currentDoc.removeEventListener("gesturechange",n.onGestureChange),n.currentDoc.removeEventListener("gestureend",n.onGestureEnd),n.currentDoc.removeEventListener("scroll",n.onScroll))},n.clearScrollEvent=function(){n.containerRef&&n.containerRef.removeEventListener("wheel",n.onWheel),n.wheelTimer&&clearTimeout(n.wheelTimer)},n.onMediaLoad=function(){var r=n.computeSizes();r&&(n.previousCropSize=r,n.emitCropData(),n.setInitialCrop(r),n.isInitialized=!0),n.props.onMediaLoaded&&n.props.onMediaLoaded(n.mediaSize)},n.setInitialCrop=function(r){if(n.props.initialCroppedAreaPercentages){var o=RU(n.props.initialCroppedAreaPercentages,n.mediaSize,n.props.rotation,r,n.props.minZoom,n.props.maxZoom),a=o.crop,i=o.zoom;n.props.onCropChange(a),n.props.onZoomChange&&n.props.onZoomChange(i)}else if(n.props.initialCroppedAreaPixels){var l=jU(n.props.initialCroppedAreaPixels,n.mediaSize,n.props.rotation,r,n.props.minZoom,n.props.maxZoom),a=l.crop,i=l.zoom;n.props.onCropChange(a),n.props.onZoomChange&&n.props.onZoomChange(i)}},n.computeSizes=function(){var r,o,a,i,l,s,u=n.imageRef.current||n.videoRef.current;if(u&&n.containerRef){n.containerRect=n.containerRef.getBoundingClientRect(),n.saveContainerPosition();var d=n.containerRect.width/n.containerRect.height,f=((r=n.imageRef.current)===null||r===void 0?void 0:r.naturalWidth)||((o=n.videoRef.current)===null||o===void 0?void 0:o.videoWidth)||0,m=((a=n.imageRef.current)===null||a===void 0?void 0:a.naturalHeight)||((i=n.videoRef.current)===null||i===void 0?void 0:i.videoHeight)||0,p=u.offsetWidth<f||u.offsetHeight<m,g=f/m,h=void 0;if(p)switch(n.state.mediaObjectFit){default:case"contain":h=d>g?{width:n.containerRect.height*g,height:n.containerRect.height}:{width:n.containerRect.width,height:n.containerRect.width/g};break;case"horizontal-cover":h={width:n.containerRect.width,height:n.containerRect.width/g};break;case"vertical-cover":h={width:n.containerRect.height*g,height:n.containerRect.height};break}else h={width:u.offsetWidth,height:u.offsetHeight};n.mediaSize=Kn(Kn({},h),{naturalWidth:f,naturalHeight:m}),n.props.setMediaSize&&n.props.setMediaSize(n.mediaSize);var v=n.props.cropSize?n.props.cropSize:MU(n.mediaSize.width,n.mediaSize.height,n.containerRect.width,n.containerRect.height,n.props.aspect,n.props.rotation);return(((l=n.state.cropSize)===null||l===void 0?void 0:l.height)!==v.height||((s=n.state.cropSize)===null||s===void 0?void 0:s.width)!==v.width)&&n.props.onCropSizeChange&&n.props.onCropSizeChange(v),n.setState({cropSize:v},n.recomputeCropPosition),n.props.setCropSize&&n.props.setCropSize(v),v}},n.saveContainerPosition=function(){if(n.containerRef){var r=n.containerRef.getBoundingClientRect();n.containerPosition={x:r.left,y:r.top}}},n.onMouseDown=function(r){n.currentDoc&&(r.preventDefault(),n.currentDoc.addEventListener("mousemove",n.onMouseMove),n.currentDoc.addEventListener("mouseup",n.onDragStopped),n.saveContainerPosition(),n.onDragStart(t.getMousePoint(r)))},n.onMouseMove=function(r){return n.onDrag(t.getMousePoint(r))},n.onScroll=function(r){n.currentDoc&&(r.preventDefault(),n.saveContainerPosition())},n.onTouchStart=function(r){n.currentDoc&&(n.isTouching=!0,!(n.props.onTouchRequest&&!n.props.onTouchRequest(r))&&(n.currentDoc.addEventListener("touchmove",n.onTouchMove,{passive:!1}),n.currentDoc.addEventListener("touchend",n.onDragStopped),n.saveContainerPosition(),r.touches.length===2?n.onPinchStart(r):r.touches.length===1&&n.onDragStart(t.getTouchPoint(r.touches[0]))))},n.onTouchMove=function(r){r.preventDefault(),r.touches.length===2?n.onPinchMove(r):r.touches.length===1&&n.onDrag(t.getTouchPoint(r.touches[0]))},n.onGestureStart=function(r){n.currentDoc&&(r.preventDefault(),n.currentDoc.addEventListener("gesturechange",n.onGestureChange),n.currentDoc.addEventListener("gestureend",n.onGestureEnd),n.gestureZoomStart=n.props.zoom,n.gestureRotationStart=n.props.rotation)},n.onGestureChange=function(r){if(r.preventDefault(),!n.isTouching){var o=t.getMousePoint(r),a=n.gestureZoomStart-1+r.scale;if(n.setNewZoom(a,o,{shouldUpdatePosition:!0}),n.props.onRotationChange){var i=n.gestureRotationStart+r.rotation;n.props.onRotationChange(i)}}},n.onGestureEnd=function(r){n.cleanEvents()},n.onDragStart=function(r){var o,a,i=r.x,l=r.y;n.dragStartPosition={x:i,y:l},n.dragStartCrop=Kn({},n.props.crop),(a=(o=n.props).onInteractionStart)===null||a===void 0||a.call(o)},n.onDrag=function(r){var o=r.x,a=r.y;n.currentWindow&&(n.rafDragTimeout&&n.currentWindow.cancelAnimationFrame(n.rafDragTimeout),n.rafDragTimeout=n.currentWindow.requestAnimationFrame(function(){if(n.state.cropSize&&!(o===void 0||a===void 0)){var i=o-n.dragStartPosition.x,l=a-n.dragStartPosition.y,s={x:n.dragStartCrop.x+i,y:n.dragStartCrop.y+l},u=n.props.restrictPosition?rs(s,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):s;n.props.onCropChange(u)}}))},n.onDragStopped=function(){var r,o;n.isTouching=!1,n.cleanEvents(),n.emitCropData(),(o=(r=n.props).onInteractionEnd)===null||o===void 0||o.call(r)},n.onWheel=function(r){if(n.currentWindow&&!(n.props.onWheelRequest&&!n.props.onWheelRequest(r))){r.preventDefault();var o=t.getMousePoint(r),a=NU(r).pixelY,i=n.props.zoom-a*n.props.zoomSpeed/200;n.setNewZoom(i,o,{shouldUpdatePosition:!0}),n.state.hasWheelJustStarted||n.setState({hasWheelJustStarted:!0},function(){var l,s;return(s=(l=n.props).onInteractionStart)===null||s===void 0?void 0:s.call(l)}),n.wheelTimer&&clearTimeout(n.wheelTimer),n.wheelTimer=n.currentWindow.setTimeout(function(){return n.setState({hasWheelJustStarted:!1},function(){var l,s;return(s=(l=n.props).onInteractionEnd)===null||s===void 0?void 0:s.call(l)})},250)}},n.getPointOnContainer=function(r,o){var a=r.x,i=r.y;if(!n.containerRect)throw new Error("The Cropper is not mounted");return{x:n.containerRect.width/2-(a-o.x),y:n.containerRect.height/2-(i-o.y)}},n.getPointOnMedia=function(r){var o=r.x,a=r.y,i=n.props,l=i.crop,s=i.zoom;return{x:(o+l.x)/s,y:(a+l.y)/s}},n.setNewZoom=function(r,o,a){var i=a===void 0?{}:a,l=i.shouldUpdatePosition,s=l===void 0?!0:l;if(!(!n.state.cropSize||!n.props.onZoomChange)){var u=qu(r,n.props.minZoom,n.props.maxZoom);if(s){var d=n.getPointOnContainer(o,n.containerPosition),f=n.getPointOnMedia(d),m={x:f.x*u-d.x,y:f.y*u-d.y},p=n.props.restrictPosition?rs(m,n.mediaSize,n.state.cropSize,u,n.props.rotation):m;n.props.onCropChange(p)}n.props.onZoomChange(u)}},n.getCropData=function(){if(!n.state.cropSize)return null;var r=n.props.restrictPosition?rs(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;return zU(r,n.mediaSize,n.state.cropSize,n.getAspect(),n.props.zoom,n.props.rotation,n.props.restrictPosition)},n.emitCropData=function(){var r=n.getCropData();if(r){var o=r.croppedAreaPercentages,a=r.croppedAreaPixels;n.props.onCropComplete&&n.props.onCropComplete(o,a),n.props.onCropAreaChange&&n.props.onCropAreaChange(o,a)}},n.emitCropAreaChange=function(){var r=n.getCropData();if(r){var o=r.croppedAreaPercentages,a=r.croppedAreaPixels;n.props.onCropAreaChange&&n.props.onCropAreaChange(o,a)}},n.recomputeCropPosition=function(){var r,o;if(n.state.cropSize){var a=n.props.crop;if(n.isInitialized&&(!((r=n.previousCropSize)===null||r===void 0)&&r.width)&&(!((o=n.previousCropSize)===null||o===void 0)&&o.height)){var i=Math.abs(n.previousCropSize.width-n.state.cropSize.width)>1e-6||Math.abs(n.previousCropSize.height-n.state.cropSize.height)>1e-6;if(i){var l=n.state.cropSize.width/n.previousCropSize.width,s=n.state.cropSize.height/n.previousCropSize.height;a={x:n.props.crop.x*l,y:n.props.crop.y*s}}}var u=n.props.restrictPosition?rs(a,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):a;n.previousCropSize=n.state.cropSize,n.props.onCropChange(u),n.emitCropData()}},n.onKeyDown=function(r){var o,a,i=n.props,l=i.crop,s=i.onCropChange,u=i.keyboardStep,d=i.zoom,f=i.rotation,m=u;if(n.state.cropSize){r.shiftKey&&(m*=.2);var p=Kn({},l);switch(r.key){case"ArrowUp":p.y-=m,r.preventDefault();break;case"ArrowDown":p.y+=m,r.preventDefault();break;case"ArrowLeft":p.x-=m,r.preventDefault();break;case"ArrowRight":p.x+=m,r.preventDefault();break;default:return}n.props.restrictPosition&&(p=rs(p,n.mediaSize,n.state.cropSize,d,f)),r.repeat||(a=(o=n.props).onInteractionStart)===null||a===void 0||a.call(o),s(p)}},n.onKeyUp=function(r){var o,a;switch(r.key){case"ArrowUp":case"ArrowDown":case"ArrowLeft":case"ArrowRight":r.preventDefault();break;default:return}n.emitCropData(),(a=(o=n.props).onInteractionEnd)===null||a===void 0||a.call(o)},n}return t.prototype.componentDidMount=function(){!this.currentDoc||!this.currentWindow||(this.containerRef&&(this.containerRef.ownerDocument&&(this.currentDoc=this.containerRef.ownerDocument),this.currentDoc.defaultView&&(this.currentWindow=this.currentDoc.defaultView),this.initResizeObserver(),typeof window.ResizeObserver>"u"&&this.currentWindow.addEventListener("resize",this.computeSizes),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.onGestureStart)),this.currentDoc.addEventListener("scroll",this.onScroll),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=VU,this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef&&this.props.setVideoRef(this.videoRef),this.props.setCropperRef&&this.props.setCropperRef(this.cropperRef))},t.prototype.componentWillUnmount=function(){var n,r;!this.currentDoc||!this.currentWindow||(typeof window.ResizeObserver>"u"&&this.currentWindow.removeEventListener("resize",this.computeSizes),(n=this.resizeObserver)===null||n===void 0||n.disconnect(),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef&&((r=this.styleRef.parentNode)===null||r===void 0||r.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent())},t.prototype.componentDidUpdate=function(n){var r,o,a,i,l,s,u,d,f;n.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):n.aspect!==this.props.aspect?this.computeSizes():n.objectFit!==this.props.objectFit?this.computeSizes():n.zoom!==this.props.zoom?this.recomputeCropPosition():((r=n.cropSize)===null||r===void 0?void 0:r.height)!==((o=this.props.cropSize)===null||o===void 0?void 0:o.height)||((a=n.cropSize)===null||a===void 0?void 0:a.width)!==((i=this.props.cropSize)===null||i===void 0?void 0:i.width)?this.computeSizes():(((l=n.crop)===null||l===void 0?void 0:l.x)!==((s=this.props.crop)===null||s===void 0?void 0:s.x)||((u=n.crop)===null||u===void 0?void 0:u.y)!==((d=this.props.crop)===null||d===void 0?void 0:d.y))&&this.emitCropAreaChange(),n.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),n.video!==this.props.video&&((f=this.videoRef.current)===null||f===void 0||f.load());var m=this.getObjectFit();m!==this.state.mediaObjectFit&&this.setState({mediaObjectFit:m},this.computeSizes)},t.prototype.getAspect=function(){var n=this.props,r=n.cropSize,o=n.aspect;return r?r.width/r.height:o},t.prototype.getObjectFit=function(){var n,r,o,a;if(this.props.objectFit==="cover"){var i=this.imageRef.current||this.videoRef.current;if(i&&this.containerRef){this.containerRect=this.containerRef.getBoundingClientRect();var l=this.containerRect.width/this.containerRect.height,s=((n=this.imageRef.current)===null||n===void 0?void 0:n.naturalWidth)||((r=this.videoRef.current)===null||r===void 0?void 0:r.videoWidth)||0,u=((o=this.imageRef.current)===null||o===void 0?void 0:o.naturalHeight)||((a=this.videoRef.current)===null||a===void 0?void 0:a.videoHeight)||0,d=s/u;return d<l?"horizontal-cover":"vertical-cover"}return"horizontal-cover"}return this.props.objectFit},t.prototype.onPinchStart=function(n){var r=t.getTouchPoint(n.touches[0]),o=t.getTouchPoint(n.touches[1]);this.lastPinchDistance=BN(r,o),this.lastPinchRotation=WN(r,o),this.onDragStart(XN(r,o))},t.prototype.onPinchMove=function(n){var r=this;if(!(!this.currentDoc||!this.currentWindow)){var o=t.getTouchPoint(n.touches[0]),a=t.getTouchPoint(n.touches[1]),i=XN(o,a);this.onDrag(i),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame(function(){var l=BN(o,a),s=r.props.zoom*(l/r.lastPinchDistance);r.setNewZoom(s,i,{shouldUpdatePosition:!1}),r.lastPinchDistance=l;var u=WN(o,a),d=r.props.rotation+(u-r.lastPinchRotation);r.props.onRotationChange&&r.props.onRotationChange(d),r.lastPinchRotation=u})}},t.prototype.render=function(){var n=this,r,o=this.props,a=o.image,i=o.video,l=o.mediaProps,s=o.cropperProps,u=o.transform,d=o.crop,f=d.x,m=d.y,p=o.rotation,g=o.zoom,h=o.cropShape,v=o.showGrid,b=o.roundCropAreaPixels,y=o.style,C=y.containerStyle,x=y.cropAreaStyle,S=y.mediaStyle,w=o.classes,O=w.containerClassName,N=w.cropAreaClassName,E=w.mediaClassName,M=(r=this.state.mediaObjectFit)!==null&&r!==void 0?r:this.getObjectFit();return c.createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(R){return n.containerRef=R},"data-testid":"container",style:C,className:Gu("reactEasyCrop_Container",O)},a?c.createElement("img",Kn({alt:"",className:Gu("reactEasyCrop_Image",M==="contain"&&"reactEasyCrop_Contain",M==="horizontal-cover"&&"reactEasyCrop_Cover_Horizontal",M==="vertical-cover"&&"reactEasyCrop_Cover_Vertical",E)},l,{src:a,ref:this.imageRef,style:Kn(Kn({},S),{transform:u||"translate(".concat(f,"px, ").concat(m,"px) rotate(").concat(p,"deg) scale(").concat(g,")")}),onLoad:this.onMediaLoad})):i&&c.createElement("video",Kn({autoPlay:!0,playsInline:!0,loop:!0,muted:!0,className:Gu("reactEasyCrop_Video",M==="contain"&&"reactEasyCrop_Contain",M==="horizontal-cover"&&"reactEasyCrop_Cover_Horizontal",M==="vertical-cover"&&"reactEasyCrop_Cover_Vertical",E)},l,{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:Kn(Kn({},S),{transform:u||"translate(".concat(f,"px, ").concat(m,"px) rotate(").concat(p,"deg) scale(").concat(g,")")}),controls:!1}),(Array.isArray(i)?i:[{src:i}]).map(function(T){return c.createElement("source",Kn({key:T.src},T))})),this.state.cropSize&&c.createElement("div",Kn({ref:this.cropperRef,style:Kn(Kn({},x),{width:b?Math.round(this.state.cropSize.width):this.state.cropSize.width,height:b?Math.round(this.state.cropSize.height):this.state.cropSize.height}),tabIndex:0,onKeyDown:this.onKeyDown,onKeyUp:this.onKeyUp,"data-testid":"cropper",className:Gu("reactEasyCrop_CropArea",h==="round"&&"reactEasyCrop_CropAreaRound",v&&"reactEasyCrop_CropAreaGrid",N)},s)))},t.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:HU,minZoom:FU,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},cropperProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0,keyboardStep:AU},t.getMousePoint=function(n){return{x:Number(n.clientX),y:Number(n.clientY)}},t.getTouchPoint=function(n){return{x:Number(n.clientX),y:Number(n.clientY)}},t})(c.Component);const io="img-crop",Og=1,os=.1,Qu=0,KN=-180,ZN=180,Pg=1,as=.01,WU=P.forwardRef((e,t)=>{const{cropperRef:n,zoomSlider:r,rotationSlider:o,aspectSlider:a,showReset:i,resetBtnText:l,modalImage:s,aspect:u,minZoom:d,maxZoom:f,minAspect:m,maxAspect:p,cropShape:g,showGrid:h,cropperProps:v}=e,[b,y]=P.useState({x:0,y:0}),[C,x]=P.useState(Og),[S,w]=P.useState(Qu),[O,N]=P.useState(u),E=P.useRef({width:0,height:0,x:0,y:0}),M=P.useCallback((j,L)=>{E.current=L},[]),T=P.useRef(u);T.current!==u&&(T.current=u,N(u));const R=C!==Og||S!==Qu||O!==u,k=()=>{x(Og),w(Qu),N(u)};P.useImperativeHandle(t,()=>({rotation:S,cropPixelsRef:E,onReset:k}));const z="[display:flex] [align-items:center] [width:60%] [margin-inline:auto]",D="[display:flex] [align-items:center] [justify-content:center] [height:32px] [width:32px] [background:transparent] [border:0] [font-family:inherit] [font-size:18px] [cursor:pointer] disabled:[opacity:20%] disabled:[cursor:default]",I="[flex:1]";return se.jsxs(se.Fragment,{children:[se.jsx(BU,Object.assign({},v,{ref:n,image:s,crop:b,zoom:C,rotation:S,aspect:O,minZoom:d,maxZoom:f,zoomWithScroll:r,cropShape:g,showGrid:h,onCropChange:y,onZoomChange:x,onRotationChange:w,onCropComplete:M,classes:{containerClassName:`${io}-container ![position:relative] [width:100%] [height:40vh] [&~section:first-of-type]:[margin-top:16px] [&~section:last-of-type]:[margin-bottom:16px]`,mediaClassName:`${io}-media`}})),r&&se.jsxs("section",{className:`${io}-control ${io}-control-zoom ${z}`,children:[se.jsx("button",{className:D,onClick:()=>x(+(C-os).toFixed(1)),disabled:C-os<d,children:"-"}),se.jsx(fu,{className:I,min:d,max:f,step:os,value:C,onChange:x}),se.jsx("button",{className:D,onClick:()=>x(+(C+os).toFixed(1)),disabled:C+os>f,children:"+"})]}),o&&se.jsxs("section",{className:`${io}-control ${io}-control-rotation ${z}`,children:[se.jsx("button",{className:`${D} [font-size:16px]`,onClick:()=>w(S-Pg),disabled:S===KN,children:"↺"}),se.jsx(fu,{className:I,min:KN,max:ZN,step:Pg,value:S,onChange:w}),se.jsx("button",{className:`${D} [font-size:16px]`,onClick:()=>w(S+Pg),disabled:S===ZN,children:"↻"})]}),a&&se.jsxs("section",{className:`${io}-control ${io}-control-aspect ${z}`,children:[se.jsx("button",{className:D,onClick:()=>N(+(O-as).toFixed(2)),disabled:O-as<m,children:"↕"}),se.jsx(fu,{className:I,min:m,max:p,step:as,value:O,onChange:N}),se.jsx("button",{className:D,onClick:()=>N(+(O+as).toFixed(2)),disabled:O+as>p,children:"↔"})]}),i&&(r||o||a)&&se.jsx(on,{className:"[position:absolute] [bottom:20px]",style:R?{}:{opacity:.3,pointerEvents:"none"},onClick:k,children:l})]})});var XU=P.memo(WU),KU="/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */.visible{visibility:visible}.\\!\\[position\\:relative\\]{position:relative!important}.\\[position\\:absolute\\]{position:absolute}.\\[bottom\\:20px\\]{bottom:20px}.container{width:100%}.\\[margin-inline\\:auto\\]{margin-inline:auto}.\\[display\\:flex\\]{display:flex}.grid{display:grid}.\\[height\\:32px\\]{height:32px}.\\[height\\:40vh\\]{height:40vh}.\\[width\\:32px\\]{width:32px}.\\[width\\:60\\%\\]{width:60%}.\\[width\\:100\\%\\]{width:100%}.\\[flex\\:1\\]{flex:1}.\\[cursor\\:pointer\\]{cursor:pointer}.\\[align-items\\:center\\]{align-items:center}.\\[justify-content\\:center\\]{justify-content:center}.\\[font-family\\:inherit\\]{font-family:inherit}.\\[font-size\\:16px\\]{font-size:16px}.\\[font-size\\:18px\\]{font-size:18px}.\\[background\\:transparent\\]{background:transparent}.\\[border\\:0\\]{border:0}.disabled\\:\\[cursor\\:default\\]{&:disabled{cursor:default}}.disabled\\:\\[opacity\\:20\\%\\]{&:disabled{opacity:20%}}.\\[\\&\\~section\\:first-of-type\\]\\:\\[margin-top\\:16px\\]{&~section:first-of-type{margin-top:16px}}.\\[\\&\\~section\\:last-of-type\\]\\:\\[margin-bottom\\:16px\\]{&~section:last-of-type{margin-bottom:16px}}";(function(){if(typeof document>"u")return;const e=document.createElement("style"),t=document.querySelector('meta[name="csp-nonce"]');t&&t.content&&e.setAttribute("nonce",t.content),e.textContent=KU,document.head.appendChild(e)})();const ZU=P.forwardRef((e,t)=>{const{quality:n=.4,fillColor:r="white",zoomSlider:o=!0,rotationSlider:a=!1,aspectSlider:i=!1,showReset:l=!1,resetText:s,aspect:u=1,minZoom:d=1,maxZoom:f=3,minAspect:m=.5,maxAspect:p=2,cropShape:g="rect",showGrid:h=!1,cropperProps:v,modalClassName:b,modalTitle:y,modalWidth:C,modalOk:x,modalCancel:S,onModalOk:w,onModalCancel:O,modalProps:N,beforeCrop:E,children:M}=e,T=P.useRef({});T.current.onModalOk=w,T.current.onModalCancel=O,T.current.beforeCrop=E;const R=P.useRef(null),k=P.useCallback(Q=>{var $;const _=document.createElement("canvas"),G=_.getContext("2d"),Y=((($=Q?.getRootNode)===null||$===void 0?void 0:$.call(Q))||document).querySelector(`.${io}-media`),{width:ee,height:K,x:ue,y:ce}=R.current.cropPixelsRef.current;if(a&&R.current.rotation!==Qu){const{naturalWidth:me,naturalHeight:fe}=Y,le=R.current.rotation*(Math.PI/180),ge=Math.abs(Math.sin(le)),pe=Math.abs(Math.cos(le)),de=me*pe+fe*ge,xe=fe*pe+me*ge;_.width=de,_.height=xe,G.fillStyle=r,G.fillRect(0,0,de,xe);const Ne=de/2,je=xe/2;G.translate(Ne,je),G.rotate(le),G.translate(-Ne,-je);const Re=(de-me)/2,ke=(xe-fe)/2;G.drawImage(Y,0,0,me,fe,Re,ke,me,fe);const Fe=G.getImageData(0,0,de,xe);_.width=ee,_.height=K,G.putImageData(Fe,-ue,-ce)}else _.width=ee,_.height=K,G.fillStyle=r,G.fillRect(0,0,ee,K),G.drawImage(Y,ue,ce,ee,K,0,0,ee,K);return _},[r,a]),[z,D]=P.useState(!1),[I,j]=P.useState(""),L=P.useRef(void 0),V=P.useRef(void 0),H=P.useCallback(Q=>Yu(void 0,[Q],void 0,function*({beforeUpload:$,file:_,resolve:G,reject:ae}){const Y=_;if(typeof $!="function"){G(Y);return}try{const ee=yield $(_,[_]);G(ee===!1?!1:ee!==!0&&ee||Y)}catch(ee){ae(ee)}}),[]),W=P.useCallback(Q=>(($,_)=>new Promise((G,ae)=>Yu(void 0,void 0,void 0,function*(){let Y=$;if(typeof T.current.beforeCrop=="function")try{const K=yield T.current.beforeCrop($,_);if(K===!1)return H({beforeUpload:Q,file:$,resolve:G,reject:ae});K!==!0&&(Y=K||$)}catch{return H({beforeUpload:Q,file:$,resolve:G,reject:ae})}const ee=new FileReader;ee.addEventListener("load",()=>{typeof ee.result=="string"&&(D(!0),setTimeout(()=>{j(ee.result)},10))}),ee.readAsDataURL(Y),L.current=()=>{var K,ue;D(!1),j(""),R.current.onReset();let ce=!1;(ue=(K=T.current).onModalCancel)===null||ue===void 0||ue.call(K,me=>{G(me),ce=!0}),ce||G(Oa.LIST_IGNORE)},V.current=K=>Yu(void 0,void 0,void 0,function*(){D(!1),j(""),R.current.onReset();const ue=k(K.target),{type:ce,name:me,uid:fe}=Y;ue.toBlob(le=>Yu(void 0,void 0,void 0,function*(){const ge=new File([le],me,{type:ce});Object.assign(ge,{uid:fe}),H({beforeUpload:Q,file:ge,resolve:pe=>{var de,xe;G(pe),(xe=(de=T.current).onModalOk)===null||xe===void 0||xe.call(de,pe)},reject:pe=>{var de,xe;ae(pe),(xe=(de=T.current).onModalOk)===null||xe===void 0||xe.call(de,pe)}})}),ce,n)})}))),[k,n,H]),X=P.useCallback(Q=>{const $=Array.isArray(Q)?Q[0]:Q,_=$.props,{beforeUpload:G,accept:ae}=_,Y=CU(_,["beforeUpload","accept"]);return Object.assign(Object.assign({},$),{props:Object.assign(Object.assign({},Y),{accept:ae||"image/*",beforeUpload:W(G)})})},[W]),F=P.useMemo(()=>{const Q={};return C!==void 0&&(Q.width=C),x!==void 0&&(Q.okText=x),S!==void 0&&(Q.cancelText=S),Q},[S,x,C]),A=`${io}-modal${b?` ${b}`:""}`,J=(typeof window>"u"?"":window.navigator.language)==="zh-CN",ne=y||(J?"编辑图片":"Edit image"),q=s||(J?"重置":"Reset");return se.jsxs(se.Fragment,{children:[X(M),se.jsx(Nr,Object.assign({},N,F,{open:z,title:ne,onCancel:L.current,onOk:V.current,wrapClassName:A,maskClosable:!1,destroyOnHidden:!0,children:se.jsx(XU,{ref:R,cropperRef:t,zoomSlider:o,rotationSlider:a,aspectSlider:i,showReset:l,resetBtnText:q,modalImage:I,aspect:u,minZoom:d,maxZoom:f,minAspect:m,maxAspect:p,cropShape:g,showGrid:h,cropperProps:v})}))]})}),$u={avatarUpload:"_avatarUpload_vcunw_1",avatar:"_avatar_vcunw_1",avatarPlaceholder:"_avatarPlaceholder_vcunw_12",uploadTip:"_uploadTip_vcunw_17"},UU=e=>{const{avatarImg:t,uploadTip:n,avatarTypes:r,avatarMaxSize:o,showCrop:a=!0,imgCropProps:i,onFileChange:l}=e,[s,u]=P.useState(t),[d,f]=P.useState(!1);P.useEffect(()=>{u(t)},[t]);const m=h=>new Promise((v,b)=>{const y=new FileReader;y.readAsDataURL(h),y.onload=()=>{typeof y.result=="string"?v(y.result):b(new Error("文件转换Base64失败"))},y.onerror=C=>b(C)}),p=async h=>{try{f(!0);const v=await m(h);u(v),l&&l(v,h)}catch{}finally{f(!1)}return Oa.LIST_IGNORE},g=async h=>{if(r?.length){const v=h.name.split(".").pop()?.toLowerCase()||"";if(!r.includes(v))return Cu.error(`仅支持${r.join("、")}格式文件`),Oa.LIST_IGNORE}return o&&!(h.size/1024<o)?(Cu.error(`文件大小不能超过${o}KB!`),Oa.LIST_IGNORE):a};return se.jsxs("div",{className:$u.avatarUpload,children:[s?se.jsx("img",{src:s,className:$u.avatar}):se.jsx(ju,{className:$u.avatarPlaceholder}),se.jsx(ZU,{beforeCrop:g,...i,children:se.jsx(Oa,{showUploadList:!1,maxCount:1,beforeUpload:p,children:se.jsx(on,{type:"primary",icon:se.jsx(qp,{}),loading:d,children:"上传头像"})})}),!!n&&se.jsx("div",{className:$u.uploadTip,children:n})]})},Wr={doubleColLayout:"_doubleColLayout_aebel_2",sider:"_sider_aebel_11",contentWrapper:"_contentWrapper_aebel_18",content:"_content_aebel_18",menuItem:"_menuItem_aebel_32",active:"_active_aebel_42",scrollActive:"_scrollActive_aebel_46",buttonGroup:"_buttonGroup_aebel_59",buttonItem:"_buttonItem_aebel_72",dragBar:"_dragBar_aebel_82"},{Sider:JU,Content:YU}=Ao,qU=({leftMenu:e,menuActiveKey:t,menuItemClick:n,rightContent:r,activeMode:o="normal",leftWidth:a=250,siderStyle:i={},contentStyle:l={},layoutStyle:s={height:"100%"},onCollapse:u,topBarOptions:d,resizeConfig:f={enabled:!0,minWidth:180,maxWidth:550}})=>{const[m,p]=P.useState(a),[g,h]=P.useState(!1),v=P.useRef(null);P.useEffect(()=>{typeof a=="number"&&p(a)},[a]);const b=y=>{if(!f.enabled)return;y.preventDefault(),h(!0);let C=!0;const x=w=>{if(!C)return;const O=v.current?.parentElement;if(!O)return;const N=O.getBoundingClientRect();let E=w.clientX-N.left-10;f.minWidth&&(E=Math.max(E,f.minWidth)),f.maxWidth&&(E=Math.min(E,f.maxWidth)),p(E),f.onWidthChange&&f.onWidthChange(E)},S=()=>{C=!1,h(!1),document.removeEventListener("mousemove",x),document.removeEventListener("mouseup",S)};return document.addEventListener("mousemove",x),document.addEventListener("mouseup",S),()=>{document.removeEventListener("mousemove",x),document.removeEventListener("mouseup",S)}};return se.jsxs(Ao,{className:`${Wr.doubleColLayout} ${g?"resizing":""}`,style:{...s},children:[se.jsx(JU,{width:m,theme:"light",onCollapse:u,className:Wr.sider,style:{...i,transition:g?"none":"width 0.3s ease"},children:e&&e.map(y=>se.jsx("div",{className:`${Wr.menuItem} ${y.key===t?o==="normal"?Wr.active:Wr.scrollActive:""}`,onClick:()=>n&&n(y),children:y.label},y.key))}),se.jsx("div",{ref:v,className:Wr.dragBar,onMouseDown:b,style:{opacity:g?.8:1}}),se.jsx(Ao,{className:Wr.contentWrapper,style:{...l,transition:g?"none":"all 0.3s ease"},children:se.jsxs(YU,{className:Wr.content,style:{},children:[d?.barList&&se.jsx("div",{className:Wr.buttonGroup,children:d.barList.map(y=>se.jsx("div",{className:`${Wr.buttonItem} ${y.key===d.barActiveKey?Wr.active:""}`,onClick:()=>d.barClick&&d.barClick(y),children:y.label},y.key))}),r]})})]})},Eo={detailView:"_detailView_yqf2w_1",detailViewTop:"_detailViewTop_yqf2w_4",detailViewTopBreadcrumb:"_detailViewTopBreadcrumb_yqf2w_10",detailViewContent:"_detailViewContent_yqf2w_14",detailViewContentItem:"_detailViewContentItem_yqf2w_19",detailViewTopLeft:"_detailViewTopLeft_yqf2w_25",detailViewTopRightItem:"_detailViewTopRightItem_yqf2w_28",detailViewTabs:"_detailViewTabs_yqf2w_34"},GU=e=>{const[t,n]=P.useState(e.tabs?.items[0].childrenContent),r=o=>{n(e.tabs?.items.find(a=>a.key===o)?.childrenContent),e.tabs?.onChange?.(o)};return se.jsxs("div",{className:Eo.detailView,children:[se.jsxs("div",{className:Eo.detailViewTop,children:[se.jsxs("div",{className:Eo.detailViewTopLeft,children:[se.jsxs("div",{className:Eo.detailViewTopBreadcrumb,children:[se.jsx(on,{style:{marginRight:10},icon:se.jsx(Ni,{})}),se.jsx("span",{style:{fontSize:20},children:e.title})]}),se.jsx("div",{children:e.overview})]}),se.jsx("div",{className:Eo.detailViewTopRight,children:se.jsxs("div",{className:Eo.detailViewTopRightItem,children:[se.jsx("div",{children:e.buttonBar}),se.jsx("div",{style:{marginTop:16},children:e.statistic})]})})]}),se.jsx("div",{className:Eo.detailViewTabs,children:se.jsx(ou,{defaultActiveKey:e.tabs?.defaultActiveKey,items:e.tabs?.items,onChange:r})}),se.jsx("div",{className:Eo.detailViewContent,children:se.jsx("div",{className:Eo.detailViewContentItem,children:t})})]})},QU={token:{colorPrimary:"#920d92ff",colorPrimaryHover:"#6728a2ff",colorPrimaryActive:"#258D70",colorPrimaryText:"#2BA07F",colorPrimaryTextHover:"#36C196",colorPrimaryTextActive:"#258D70",colorSuccess:"#36C196"}};Vn.AvatarUpload=UU,Vn.DetailView=GU,Vn.DoubleColLayout=qU,Vn.DynamicForm=gg,Vn.FilterForm=rU,Vn.FloatCard=pN,Vn.Login=pU,Vn.RemoteSelect=bU,Vn.TablePlus=_Z,Vn.defaultTheme=QU,Object.defineProperty(Vn,Symbol.toStringTag,{value:"Module"})}));
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|