2 lines
6.5 KiB
JavaScript
2 lines
6.5 KiB
JavaScript
|
(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[86606],{76734:function(h){h.exports={newColorPicker:"newColorPicker___2va38"}},11751:function(h){h.exports={root:"root___2bSDf",colorWeak:"colorWeak___1yU3e","ant-layout":"ant-layout___3lZ8G",globalSpin:"globalSpin___2czPt","ant-table":"ant-table___3ADWe","ant-table-thead":"ant-table-thead___3RrD_","ant-table-tbody":"ant-table-tbody___2cyZG",formBox:"formBox___2w-Ew",menu:"menu___1greV"}},96328:function(h,_,e){"use strict";var r=e(67294),O=e(79941),U=e(53390),W=e(76734),K=e.n(W),d=e(85893);function j(v){var s=v.offsetTop;return v.offsetParent!=null&&(s+=j(v.offsetParent)),s}function R(v){var s=v.offsetLeft;return v.offsetParent!=null&&(s+=R(v.offsetParent)),s}class M extends r.Component{constructor(){super(...arguments);this.state={displayColorPicker:!1,pageX:0,pageY:0},this.handleClick=s=>{var m=this.props.cssData,f=m===void 0?{devX:0,devY:0}:m,P=f.devX,D=f.devY;this.first=!0;var C=root.clientWidth,c=root.clientHeight,x=$(s.target),t=x.offset().left+P,E=x.offset().top+x.outerHeight()+5+D;t+220>C&&(t=C-220),E+333>c&&(E=c-333),this.setState({displayColorPicker:!this.state.displayColorPicker,pageX:t,pageY:E})},this.handleClear=()=>{var s=this.props.onChange,m=s===void 0?f=>{}:s;this.setState({displayColorPicker:!1,scrollTop:0}),m("transparent")},this.handleClose=()=>{this.setState({displayColorPicker:!1,scrollTop:0})}}render(){var s=this.props,m=s.className,f=m===void 0?"colorPicker":m,P=s.onChange,D=P===void 0?i=>{}:P,C=s.value,c=C===void 0?"#000000":C,x=s.style,t=this.state,E=t.pageX,I=t.pageY,A=i=>{i.rgb.a<1&&!(this.first&&i.rgb.a==0)?D("rgba(".concat(i.rgb.r,", ").concat(i.rgb.g,", ").concat(i.rgb.b,", ").concat(i.rgb.a,")")):D(i.hex),this.first=!1},g=(0,O.ZP)({default:{color:{height:"100%",borderRadius:"2px",background:c},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:I,left:E},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,d.jsxs)("div",{style:x,className:f+" "+K().newColorPicker,children:[(0,d.jsx)("div",{style:g.swatch,onClick:this.handleClick,children:(0,d.jsx)("div",{style:g.colorBox,children:(0,d.jsx)("div",{style:g.color})})}),this.state.displayColorPicker?(0,d.jsxs)("div",{style:g.popover,children:[(0,d.jsx)("div",{style:g.clearBtn,onClick:this.handleClear,children:"\u6E05\u7A7A"}),(0,d.jsx)("div",{style:g.cover,onClick:this.handleClose}),(0,d.jsx)(U.xS,{color:c,onChange:A})]}):null]})}}_.Z=M},86606:function(h,_,e){"use strict";e.r(_),e.d(_,{default:function(){return g}});var r=e(71194),O=e(50146),U=e(57663),W=e(71577),K=e(13062),d=e(71230),j=e(89032),R=e(15746),M=e(11849),v=e(43358),s=e(34041),m=e(67294),f=e(28216),P=e(11751),D=e.n(P),C=e(41273),c=e(30672),x=e(96328),t=e(85893),E,I,A=s.Z.Option,g=(E=(0,f.$j)(i=>{var a=i.commondesign,n=i.page;return{commondesign:a,page:n}}),E(I=class extends m.PureComponent{constructor(){super(...arguments);this.state={visible:!1,width:520,openstyle:"hover",animation:"fadeIn"},this.show=a=>{this.setState({openstyle:a.attr("data-menuopenstyle")||"hover",animation:a.attr("data-menuanimation")||"fadeIn"})},this.updataDomCallBack=a=>{var n=this,l=n.state,o=l.openstyle,y=l.animation,B=this.props.commondesign,p=B.MenuNav,u=p.element,T=p.callback,k=p.callClose,b=u.find(">.menuBox"),L=b.attr("data-mid")||(0,C.U$)(),Z=u.attr("data-mid");b.length<1&&u.append('<div class="module menuBox noLimitX" data-type="container" data-mid="'+L+'" style="top: '+u.outerHeight()+'px; width: 400px; height: 200px;"></div>'),u.
|