filesbox/web/dist/21457.2ea5e097.async.js

2 lines
7.4 KiB
JavaScript
Raw Permalink Normal View History

2024-07-26 06:10:54 +00:00
(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[21457],{76734:function(B){B.exports={newColorPicker:"newColorPicker___2va38"}},96328:function(B,w,o){"use strict";var y=o(67294),_=o(79941),h=o(53390),R=o(76734),p=o.n(R),g=o(85893);function n(e){var a=e.offsetTop;return e.offsetParent!=null&&(a+=n(e.offsetParent)),a}function Z(e){var a=e.offsetLeft;return e.offsetParent!=null&&(a+=Z(e.offsetParent)),a}class O extends y.Component{constructor(){super(...arguments);this.state={displayColorPicker:!1,pageX:0,pageY:0},this.handleClick=a=>{var x=this.props.cssData,v=x===void 0?{devX:0,devY:0}:x,A=v.devX,r=v.devY;this.first=!0;var s=root.clientWidth,b=root.clientHeight,u=$(a.target),S=u.offset().left+A,m=u.offset().top+u.outerHeight()+5+r;S+220>s&&(S=s-220),m+333>b&&(m=b-333),this.setState({displayColorPicker:!this.state.displayColorPicker,pageX:S,pageY:m})},this.handleClear=()=>{var a=this.props.onChange,x=a===void 0?v=>{}:a;this.setState({displayColorPicker:!1,scrollTop:0}),x("transparent")},this.handleClose=()=>{this.setState({displayColorPicker:!1,scrollTop:0})}}render(){var a=this.props,x=a.className,v=x===void 0?"colorPicker":x,A=a.onChange,r=A===void 0?i=>{}:A,s=a.value,b=s===void 0?"#000000":s,u=a.style,S=this.state,m=S.pageX,l=S.pageY,f=i=>{i.rgb.a<1&&!(this.first&&i.rgb.a==0)?r("rgba(".concat(i.rgb.r,", ").concat(i.rgb.g,", ").concat(i.rgb.b,", ").concat(i.rgb.a,")")):r(i.hex),this.first=!1},t=(0,_.ZP)({default:{color:{height:"100%",borderRadius:"2px",background:b},colorBox:{height:"100%",borderRadius:"2px",boxShadow:"0 0 0 1px rgba(0,0,0,.1)",background:'url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg==")'},swatch:{width:"100%",height:"100%",padding:"2px",background:"#fff",borderRadius:"1px",boxShadow:"0 0 0 1px rgba(0,0,0,.1)",display:"inline-block",cursor:"pointer"},popover:{position:"fixed",zIndex:"101",background:"#ccc",top:l,left:m},cover:{position:"fixed",top:"0px",right:"0px",bottom:"0px",left:"0px"},clearBtn:{position:"absolute",bottom:"10px",height:"18px",lineHeight:"18px",right:"8px",zIndex:1,fontSize:"12px",cursor:"pointer"}}});return(0,g.jsxs)("div",{style:u,className:v+" "+p().newColorPicker,children:[(0,g.jsx)("div",{style:t.swatch,onClick:this.handleClick,children:(0,g.jsx)("div",{style:t.colorBox,children:(0,g.jsx)("div",{style:t.color})})}),this.state.displayColorPicker?(0,g.jsxs)("div",{style:t.popover,children:[(0,g.jsx)("div",{style:t.clearBtn,onClick:this.handleClear,children:"\u6E05\u7A7A"}),(0,g.jsx)("div",{style:t.cover,onClick:this.handleClose}),(0,g.jsx)(h.xS,{color:b,onChange:f})]}):null]})}}w.Z=O},21457:function(B,w,o){"use strict";o.r(w),o.d(w,{default:function(){return S}});var y=o(13062),_=o(71230),h=o(11849),R=o(77883),p=o(85986),g=o(89032),n=o(15746),Z=o(67294),O=o(28216),e=o(56173),a=o(41273),x=o(96328),v=o(30672),A=o(44258),r=o.n(A),s=o(85893),b,u,S=(b=(0,O.$j)(m=>{var l=m.globaldesign,f=m.commondesign;return{globaldesign:l,commondesign:f}}),b(u=class extends Z.Component{constructor(){super(...arguments);this.state={boxShadowX:0,boxShadowY:0,boxShadowBlur:0,boxShadowSpread:0,boxShadowColor:"#ccc"}}componentDidMount(){this.updateComponentDom()}componentDidUpdate(l,f){var t=this,i=t.props.globaldesign.selectElement,E=l.globaldesign.selectElement,C=i&&i.attr("data-mid"),P=E&&E.attr("data-mid");P!==C&&this.updateComponentDom()}updateComponentDom(){var l=this,f=l.props.globaldesign.selectElement;if(!f)return!1;var t=(0,a.ol)(f.css("boxShadow"));l.setState({boxShadowX:t.x,boxShadowY:t.y,boxShadowBlur:t.blur,boxShadowSpread:t.spread,boxShadowColor:t.color})}shouldComponentUpdate(){return!window.startMouseMove}renderShadow(){var l=this,f=l.props.globaldesign,t=f.selectElement,i=f.version,E=l.state,C=E.boxShadowX,P=E.boxShadowY,M=E.boxShadowBlur,j=E.boxShadowSpread,D=E.boxShadowColor,c=(0,v.lw)((0,v.Kd)()),T={value:C,size:"small",min:0,onChange:d=>{l.setState({boxShadowX:d}),t.css({boxShadow:(0,e.bf)(d)+" "+(0,e.bf)(P)+" "+(0,e.bf)(M)+" "+(0,e.b