3 lines
7.4 KiB
JavaScript
3 lines
7.4 KiB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([[38],{"5YsI":function(e,t,o){e.exports={button:"button-1SoiPS-f",hover:"hover-1SoiPS-f",arrow:"arrow-1SoiPS-f",arrowWrap:"arrowWrap-1SoiPS-f",isOpened:"isOpened-1SoiPS-f"}},"82wv":function(e,t,o){"use strict";o.d(t,"a",(function(){return u}));var r=o("q1tI"),n=o("TSYQ"),i=o("9dlw"),a=o("ML8+"),s=o("ijHL"),c=o("mkWe"),l=o("Sn4D"),p=o("Iksw"),d=o("5YsI");class u extends r.PureComponent{constructor(e){super(e),this._wrapperRef=null,this._controller=r.createRef(),this._handleWrapperRef=e=>{this._wrapperRef=e,this.props.reference&&this.props.reference(e)},this._handleClick=e=>{e.target instanceof Node&&e.currentTarget.contains(e.target)&&(this._handleToggleDropdown(),this.props.onClick&&this.props.onClick(e,!this.state.isOpened))},this._handleToggleDropdown=e=>{const{onClose:t,onOpen:o}=this.props,{isOpened:r}=this.state,n="boolean"==typeof e?e:!r;this.setState({isOpened:n}),n&&o&&o(),!n&&t&&t()},this._handleClose=()=>{this.close()},this.state={isOpened:!1}}render(){const{id:e,arrow:t,children:o,content:d,isDisabled:u,isDrawer:h,drawerPosition:m="Bottom",isShowTooltip:f,minWidth:v,title:b,className:w,menuClassName:D,maxHeight:g,hotKey:O,theme:k,menuDataName:N}=this.props,{isOpened:T}=this.state,E=n(w,k.button,{"apply-common-tooltip":f||!u,[k.isDisabled]:u,[k.isOpened]:T}),S=T&&h&&m,_={horizontalMargin:this.props.horizontalMargin||0,verticalMargin:this.props.verticalMargin||2,verticalAttachEdge:this.props.verticalAttachEdge,horizontalAttachEdge:this.props.horizontalAttachEdge,verticalDropDirection:this.props.verticalDropDirection,horizontalDropDirection:this.props.horizontalDropDirection};return r.createElement("div",Object.assign({id:e,className:E,onClick:u?void 0:this._handleClick,title:b,"data-tooltip-hotkey":O,ref:this._handleWrapperRef,"data-role":"button"},Object(s.b)(this.props)),d,t&&r.createElement("div",{className:k.arrow},r.createElement("div",{className:k.arrowWrap},r.createElement(a.a,{dropped:T}))),S?r.createElement(c.b,null,r.createElement(l.a,{onClose:this._handleClose,position:m,"data-name":N},o)):r.createElement(i.a,{controller:this._controller,closeOnClickOutside:this.props.closeOnClickOutside,doNotCloseOn:this,isOpened:T,minWidth:v,onClose:this._handleClose,position:Object(p.e)(this._wrapperRef,_),className:D,maxHeight:g,"data-name":N},o))}close(){this._handleToggleDropdown(!1)}update(){null!==this._controller.current&&this._controller.current.update()}}u.defaultProps={arrow:!0,closeOnClickOutside:!0,theme:d}},Iksw:function(e,t,o){"use strict";o.d(t,"c",(function(){return r})),o.d(t,"a",(function(){return n})),o.d(t,"d",(function(){return i})),o.d(t,"b",(function(){return a})),o.d(t,"e",(function(){return l}));var r,n,i,a,s=o("Eyy1");!function(e){e[e.Top=0]="Top",e[e.Bottom=1]="Bottom"}(r||(r={})),function(e){e[e.Left=0]="Left",e[e.Right=1]="Right"}(n||(n={})),function(e){e[e.FromTopToBottom=0]="FromTopToBottom",e[e.FromBottomToTop=1]="FromBottomToTop"}(i||(i={})),function(e){e[e.FromLeftToRight=0]="FromLeftToRight",
|
|
e[e.FromRightToLeft=1]="FromRightToLeft"}(a||(a={}));const c={verticalAttachEdge:r.Bottom,horizontalAttachEdge:n.Left,verticalDropDirection:i.FromTopToBottom,horizontalDropDirection:a.FromLeftToRight,verticalMargin:0,horizontalMargin:0};function l(e,t){return(o,l)=>{const p=Object(s.ensureNotNull)(e).getBoundingClientRect(),{verticalAttachEdge:d=c.verticalAttachEdge,verticalDropDirection:u=c.verticalDropDirection,horizontalAttachEdge:h=c.horizontalAttachEdge,horizontalDropDirection:m=c.horizontalDropDirection,horizontalMargin:f=c.horizontalMargin,verticalMargin:v=c.verticalMargin}=t,b=d===r.Top?-1*v:v,w=h===n.Right?p.right:p.left,D=d===r.Top?p.top:p.bottom;return{x:w-(m===a.FromRightToLeft?o:0)+f,y:D-(u===i.FromBottomToTop?l:0)+b}}}},"ML8+":function(e,t,o){"use strict";o.d(t,"a",(function(){return c}));var r=o("q1tI"),n=o("TSYQ"),i=o("Iivm"),a=o("cvzQ"),s=o("R4+T");function c(e){const{dropped:t,className:o}=e;return r.createElement(i.a,{className:n(o,a.icon,{[a.dropped]:t}),icon:s})}},Sn4D:function(e,t,o){"use strict";o.d(t,"a",(function(){return m}));var r=o("q1tI"),n=o.n(r),i=o("Eyy1"),a=o("TSYQ"),s=o("x0D+"),c=o("Nkvk"),l=o("AiMB"),p=o("mkWe"),d=o("qFKp"),u=o("X0gx"),h=o("sHQ4");function m(e){const{position:t,onClose:o,children:m,className:f,theme:v=h}=e,b=Object(i.ensureNotNull)(Object(r.useContext)(p.a)),[w,D]=Object(r.useState)(0),g=Object(r.useRef)(null),O=Object(r.useContext)(u.a);return Object(r.useEffect)(()=>{var e;return null===(e=g.current)||void 0===e||e.focus({preventScroll:!0}),O.subscribe(b,o),Object(c.setFixedBodyState)(!0),d.CheckMobile.iOS()&&Object(s.disableBodyScroll)(Object(i.ensureNotNull)(g.current)),D(b.addDrawer()),()=>{O.unsubscribe(b,o);const e=b.removeDrawer();d.CheckMobile.iOS()&&Object(s.enableBodyScroll)(Object(i.ensureNotNull)(g.current)),0===e&&Object(c.setFixedBodyState)(!1)}},[]),n.a.createElement(l.a,null,n.a.createElement("div",{className:a(h.wrap,h["position"+t])},w===b.currentDrawer&&n.a.createElement("div",{className:h.backdrop,onClick:o}),n.a.createElement("div",{className:a(h.drawer,v.drawer,h["position"+t],f),ref:function(e){g.current=e},tabIndex:-1,onScroll:function(e){e.stopPropagation()},"data-name":e["data-name"]},m)))}},bQ7Y:function(e,t,o){e.exports={button:"button-2Vpz_LXc",hover:"hover-2Vpz_LXc",isInteractive:"isInteractive-2Vpz_LXc",isGrouped:"isGrouped-2Vpz_LXc",isActive:"isActive-2Vpz_LXc",isOpened:"isOpened-2Vpz_LXc",isDisabled:"isDisabled-2Vpz_LXc",text:"text-2Vpz_LXc",icon:"icon-2Vpz_LXc"}},cvzQ:function(e,t,o){e.exports={icon:"icon-19OjtB6A",dropped:"dropped-19OjtB6A"}},mkWe:function(e,t,o){"use strict";o.d(t,"b",(function(){return i})),o.d(t,"a",(function(){return a}));var r=o("q1tI"),n=o.n(r);class i extends n.a.PureComponent{constructor(e){super(e),this._addDrawer=()=>{const e=this.state.currentDrawer+1;return this.setState({currentDrawer:e}),e},this._removeDrawer=()=>{const e=this.state.currentDrawer-1;return this.setState({currentDrawer:e}),e},this.state={currentDrawer:0}}render(){return n.a.createElement(a.Provider,{value:{addDrawer:this._addDrawer,
|
|
removeDrawer:this._removeDrawer,currentDrawer:this.state.currentDrawer}},this.props.children)}}const a=n.a.createContext(null)},sHQ4:function(e,t,o){e.exports={wrap:"wrap-164vy-kj",positionBottom:"positionBottom-164vy-kj",backdrop:"backdrop-164vy-kj",drawer:"drawer-164vy-kj",positionLeft:"positionLeft-164vy-kj"}},tU7i:function(e,t,o){"use strict";o.d(t,"a",(function(){return c})),o.d(t,"b",(function(){return l}));var r=o("mrSG"),n=o("q1tI"),i=o("TSYQ"),a=o("Iivm"),s=o("bQ7Y");const c=s,l=n.forwardRef((e,t)=>{const{icon:o,isActive:c,isOpened:l,isDisabled:p,isGrouped:d,isHovered:u,onClick:h,text:m,textBeforeIcon:f,title:v,theme:b=s,className:w,forceInteractive:D,"data-name":g}=e,O=Object(r.a)(e,["icon","isActive","isOpened","isDisabled","isGrouped","isHovered","onClick","text","textBeforeIcon","title","theme","className","forceInteractive","data-name"]),k=i(w,b.button,v&&"apply-common-tooltip",{[b.isActive]:c,[b.isOpened]:l,[b.isInteractive]:(D||Boolean(h))&&!p,[b.isDisabled]:p,[b.isGrouped]:d,[b.hover]:u}),N=o&&("string"==typeof o?n.createElement(a.a,{className:b.icon,icon:o}):n.cloneElement(o,{className:i(b.icon,o.props.className)}));return n.createElement("div",Object.assign({},O,{ref:t,"data-role":"button",className:k,onClick:p?void 0:h,title:v,"data-name":g}),f&&m&&n.createElement("div",{className:i("js-button-text",b.text)},m),N,!f&&m&&n.createElement("div",{className:i("js-button-text",b.text)},m))})}}]); |