10 lines
27 KiB
JavaScript
10 lines
27 KiB
JavaScript
(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[355],{53336:function(e,t){var n,s,o;s=[t],n=function(e){"use strict";function t(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}Object.defineProperty(e,"__esModule",{value:!0});var n=!1;if("undefined"!=typeof window){var s={get passive(){n=!0}};window.addEventListener("testPassive",null,s),window.removeEventListener("testPassive",null,s)}var o="undefined"!=typeof window&&window.navigator&&window.navigator.platform&&/iP(ad|hone|od)/.test(window.navigator.platform),i=[],r=!1,a=-1,c=void 0,l=void 0,u=function(e){return i.some((function(t){return!(!t.options.allowTouchMove||!t.options.allowTouchMove(e))}))},h=function(e){var t=e||window.event;return!!u(t.target)||1<t.touches.length||(t.preventDefault&&t.preventDefault(),!1)},d=function(){setTimeout((function(){void 0!==l&&(document.body.style.paddingRight=l,l=void 0),void 0!==c&&(document.body.style.overflow=c,c=void 0)}))};e.disableBodyScroll=function(e,s){if(o){if(!e)return void console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.");if(e&&!i.some((function(t){return t.targetElement===e}))){var d={targetElement:e,options:s||{}};i=[].concat(t(i),[d]),e.ontouchstart=function(e){1===e.targetTouches.length&&(a=e.targetTouches[0].clientY)},e.ontouchmove=function(t){var n,s,o,i;1===t.targetTouches.length&&(s=e,i=(n=t).targetTouches[0].clientY-a,!u(n.target)&&(s&&0===s.scrollTop&&0<i||(o=s)&&o.scrollHeight-o.scrollTop<=o.clientHeight&&i<0?h(n):n.stopPropagation()))},r||(document.addEventListener("touchmove",h,n?{passive:!1}:void 0),r=!0)}}else{p=s,setTimeout((function(){if(void 0===l){var e=!!p&&!0===p.reserveScrollBarGap,t=window.innerWidth-document.documentElement.clientWidth;e&&0<t&&(l=document.body.style.paddingRight,document.body.style.paddingRight=t+"px")}void 0===c&&(c=document.body.style.overflow,document.body.style.overflow="hidden")}));var m={targetElement:e,options:s||{}};i=[].concat(t(i),[m])}var p},e.clearAllBodyScrollLocks=function(){o?(i.forEach((function(e){e.targetElement.ontouchstart=null,e.targetElement.ontouchmove=null})),r&&(document.removeEventListener("touchmove",h,n?{passive:!1}:void 0),r=!1),i=[],a=-1):(d(),i=[])},e.enableBodyScroll=function(e){if(o){if(!e)return void console.error("enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.");e.ontouchstart=null,e.ontouchmove=null,i=i.filter((function(t){return t.targetElement!==e})),r&&0===i.length&&(document.removeEventListener("touchmove",h,n?{passive:!1}:void 0),r=!1)}else 1===i.length&&i[0].targetElement===e?(d(),i=[]):i=i.filter((function(t){return t.targetElement!==e}))}},void 0===(o="function"==typeof n?n.apply(t,s):n)||(e.exports=o)},98297:e=>{e.exports={"checkbox-size":"18px","checkbox-primary-default-bg":"var(--color-container-fill-primary-neutral-extra-bold)","checkbox-primary-hover-bg":"var(--color-container-fill-primary-neutral-bold)",
|
|
"checkbox-primary-active-bg":"var(--color-container-fill-primary-neutral-medium)","checkbox-primary-fg":"var(--color-container-fill-quinary-inverse)","checkbox-danger-default-bg":"var(--color-container-fill-primary-danger-bold)","checkbox-danger-hover-bg":"var(--color-container-fill-primary-danger-semi-bold)","checkbox-danger-active-bg":"var(--color-container-fill-primary-danger)","checkbox-danger-fg":"var(--color-container-fill-quaternary-inverse)",wrapper:"wrapper-GZajBGIm",input:"input-GZajBGIm",focusOutline:"focusOutline-GZajBGIm",primary:"primary-GZajBGIm",disabled:"disabled-GZajBGIm",danger:"danger-GZajBGIm",view:"view-GZajBGIm"}},44859:e=>{e.exports={"checkbox-size":"18px",box:"box-vgla_e5o",unchecked:"unchecked-vgla_e5o",checked:"checked-vgla_e5o",mixed:"mixed-vgla_e5o",disabled:"disabled-vgla_e5o",checkedMark:"checkedMark-vgla_e5o",mixedMark:"mixedMark-vgla_e5o"}},75332:e=>{e.exports={loader:"loader-UL6iwcBa",static:"static-UL6iwcBa",item:"item-UL6iwcBa","tv-button-loader":"tv-button-loader-UL6iwcBa",medium:"medium-UL6iwcBa",small:"small-UL6iwcBa",black:"black-UL6iwcBa",white:"white-UL6iwcBa",gray:"gray-UL6iwcBa",primary:"primary-UL6iwcBa"}},89981:e=>{e.exports={accessible:"accessible-rm8yeqY4"}},83327:e=>{e.exports={loaderWrap:"loaderWrap-jGEARQlM",big:"big-jGEARQlM",loader:"loader-jGEARQlM"}},70995:e=>{e.exports={item:"item-GJX1EXhk",interactive:"interactive-GJX1EXhk",hovered:"hovered-GJX1EXhk",disabled:"disabled-GJX1EXhk",active:"active-GJX1EXhk",shortcut:"shortcut-GJX1EXhk",normal:"normal-GJX1EXhk",big:"big-GJX1EXhk",iconCell:"iconCell-GJX1EXhk",icon:"icon-GJX1EXhk",content:"content-GJX1EXhk",label:"label-GJX1EXhk",checked:"checked-GJX1EXhk",toolbox:"toolbox-GJX1EXhk",showToolboxOnHover:"showToolboxOnHover-GJX1EXhk",arrowIcon:"arrowIcon-GJX1EXhk",subMenu:"subMenu-GJX1EXhk",invisibleHotkey:"invisibleHotkey-GJX1EXhk"}},55461:e=>{e.exports={row:"row-DFIg7eOh",line:"line-DFIg7eOh",hint:"hint-DFIg7eOh"}},34235:e=>{e.exports={menu:"menu-Tx5xMZww"}},26001:e=>{e.exports={item:"item-WJDah4zD",emptyIcons:"emptyIcons-WJDah4zD",loading:"loading-WJDah4zD",disabled:"disabled-WJDah4zD",interactive:"interactive-WJDah4zD",hovered:"hovered-WJDah4zD",normal:"normal-WJDah4zD",big:"big-WJDah4zD",icon:"icon-WJDah4zD",label:"label-WJDah4zD",title:"title-WJDah4zD",nested:"nested-WJDah4zD",shortcut:"shortcut-WJDah4zD",remove:"remove-WJDah4zD"}},49445:e=>{e.exports={separator:"separator-Ymxd0dt_"}},73832:e=>{e.exports={favorite:"favorite-_FRQhM5Y",hovered:"hovered-_FRQhM5Y",disabled:"disabled-_FRQhM5Y",focused:"focused-_FRQhM5Y",active:"active-_FRQhM5Y",checked:"checked-_FRQhM5Y"}},36779:e=>{e.exports={button:"button-iLKiGOdQ",hovered:"hovered-iLKiGOdQ",disabled:"disabled-iLKiGOdQ",focused:"focused-iLKiGOdQ",active:"active-iLKiGOdQ",hidden:"hidden-iLKiGOdQ"}},71236:(e,t,n)=>{"use strict";n.d(t,{CheckboxInput:()=>h});var s=n(79474),o=n(14487),i=n.n(o),r=n(40197),a=n(11864),c=n(94350),l=n(98297),u=n.n(l);function h(e){const t=e.intent??"primary";return s.createElement("span",{
|
|
className:i()(u().wrapper,e.disabled&&u().disabled,e.className),title:e.title,style:e.style},s.createElement("span",{className:i()(u().view,u()[t])},s.createElement(c.CheckboxViewImpl,{checked:e.checked,disabled:e.disabled})),s.createElement("input",{id:e.id,tabIndex:e.tabIndex,className:i()(u()[t],u().input),type:"checkbox",name:e.name,checked:!1!==e.checked,disabled:e.disabled,value:e.value,role:e.role,onChange:e.onChange,ref:e.reference,"aria-checked":(()=>{switch(e.checked){case!0:return"true";case!1:return"false";case"mixed":return"mixed"}})(),"aria-required":e.ariaRequired,"aria-describedby":e.ariaDescribedby,"aria-invalid":e.ariaInvalid,"data-qa-id":e.dataQaId,...(0,r.filterDataProps)(e)}),s.createElement("div",{className:u().focusOutline}))}(0,a.makeSwitchGroupItem)(h)},94350:(e,t,n)=>{"use strict";n.d(t,{CheckboxViewImpl:()=>h});var s=n(79474),o=n(14487),i=n.n(o),r=n(64588),a=n(17070),c=n.n(a),l=n(44859),u=n.n(l);function h(e){const{checked:t,disabled:n}=e;return s.createElement("div",{className:i()(u().box,!0===t&&u().checked,!1===t&&u().unchecked,"mixed"===t&&u().mixed,n&&u().disabled)},!0===t&&s.createElement(r.BlockIcon,{icon:c(),className:u().checkedMark}),"mixed"===t&&s.createElement("div",{className:u().mixedMark}))}},61597:(e,t,n)=>{"use strict";n.d(t,{Loader:()=>l});var s,o=n(79474),i=n(14487),r=n.n(i),a=n(75332),c=n.n(a);function l(e){const{className:t,size:n="medium",staticPosition:s,color:i="black"}=e,a=r()(c().item,c()[i],c()[n]);return o.createElement("span",{className:r()(c().loader,s&&c().static,t)},o.createElement("span",{className:a}),o.createElement("span",{className:a}),o.createElement("span",{className:a}))}!function(e){e.Medium="medium",e.Small="small"}(s||(s={}))},11864:(e,t,n)=>{"use strict";n.d(t,{SwitchGroup:()=>r,makeSwitchGroupItem:()=>a});var s=n(79474),o=n(16687);const i=(0,s.createContext)({getName:()=>"",getValues:()=>[],getOnChange:()=>o.default,subscribe:o.default,unsubscribe:o.default});class r extends s.PureComponent{constructor(e){super(e),this._subscriptions=new Set,this._getName=()=>this.props.name,this._getValues=()=>this.props.values,this._getOnChange=()=>this.props.onChange,this._subscribe=e=>{this._subscriptions.add(e)},this._unsubscribe=e=>{this._subscriptions.delete(e)},this.state={switchGroupContext:{getName:this._getName,getValues:this._getValues,getOnChange:this._getOnChange,subscribe:this._subscribe,unsubscribe:this._unsubscribe}}}render(){return s.createElement(i.Provider,{value:this.state.switchGroupContext},this.props.children)}componentDidUpdate(e){this._notify(this._getUpdates(this.props.values,e.values))}_notify(e){this._subscriptions.forEach((t=>t(e)))}_getUpdates(e,t){return[...t,...e].filter((n=>t.includes(n)?!e.includes(n):e.includes(n)))}}function a(e){var t;return t=class extends s.PureComponent{constructor(){super(...arguments),this._onChange=e=>{this.context.getOnChange()(e.target.value)},this._onUpdate=e=>{e.includes(this.props.value)&&this.forceUpdate()}}componentDidMount(){this.context.subscribe(this._onUpdate)}render(){
|
|
return s.createElement(e,{...this.props,name:this._getName(),onChange:this._onChange,checked:this._isChecked()})}componentWillUnmount(){this.context.unsubscribe(this._onUpdate)}_getName(){return this.context.getName()}_isChecked(){return this.context.getValues().includes(this.props.value)}},t.contextType=i,t}},28390:(e,t,n)=>{"use strict";n.d(t,{useActiveDescendant:()=>i});var s=n(79474),o=n(73064);function i(e,t=[]){const[n,i]=(0,s.useState)(!1),r=(0,o.useFunctionalRefObject)(e);return(0,s.useLayoutEffect)((()=>{const e=r.current;if(null===e)return;const t=e=>{switch(e.type){case"active-descendant-focus":i(!0);break;case"active-descendant-blur":i(!1)}};return e.addEventListener("active-descendant-focus",t),e.addEventListener("active-descendant-blur",t),()=>{e.removeEventListener("active-descendant-focus",t),e.removeEventListener("active-descendant-blur",t)}}),t),[r,n]}},62369:(e,t,n)=>{"use strict";n.d(t,{ContextMenuAction:()=>k});var s=n(79474),o=n(85842),i=n(40197),r=n(78972),a=n(11463),c=n(14487),l=n.n(c),u=n(61597),h=n(27156),d=n(83327);function m(e){const{size:t="normal"}=e;return s.createElement(h.ContextMenuItem,{size:t,jsxLabel:s.createElement("div",{className:l()(d.loaderWrap,d[t])},s.createElement(u.Loader,{className:d.loader})),noInteractive:!0,onMouseOver:e.onMouseOver})}var p=n(47893),v=n(21404),b=n(89981);const g=(0,s.forwardRef)((function(e,t){const{className:n,...o}=e,[i,r]=(0,v.useRovingTabindexElement)(t);return s.createElement(h.ContextMenuItem,{...o,className:l()(b.accessible,n),reference:i,tabIndex:r,onKeyDown:function(e){if(e.target!==e.currentTarget)return;const t=(0,p.hashFromEvent)(e);13!==t&&32!==t||(e.preventDefault(),i.current instanceof HTMLElement&&i.current.click())},"data-role":"menuitem","aria-disabled":e.disabled||void 0})}));var f=n(81458);var x=n(64906),E=n(17656);class k extends s.PureComponent{constructor(e){super(e),this._itemRef=null,this._menuElementRef=s.createRef(),this._menuRef=null,this._handleClick=e=>{e.isDefaultPrevented()||this.state.disabled||(this._hasSubItems()?this._showSubMenu():(this.state.doNotCloseOnClick||(0,a.globalCloseMenu)(),this.props.action.execute(),this._trackEvent(),this.props.onExecute&&this.props.onExecute(this.props.action)))},this._handleClickToolbox=()=>{(0,a.globalCloseMenu)()},this._handleItemMouseOver=()=>{this._showSubMenu(),this._setCurrentContextValue()},this._handleMenuMouseOver=()=>{this._setCurrentContextValue()},this._showSubMenu=()=>{this.props.onShowSubMenu(this.props.action)},this._calcSubMenuPos=e=>function(e,t,n={x:0,y:10}){if(t){const{left:n,right:s,top:o}=t.getBoundingClientRect(),i=document.documentElement.clientWidth,r={x:n-e,y:o},a={x:s,y:o};return(0,f.isRtl)()?n<=e?a:r:i-s>=e?a:r}return n}(e.contentWidth,this._itemRef),this._updateState=e=>{this.setState(e.getState())},this._setItemRef=e=>{this._itemRef=e},this._handleMenuRef=e=>{this._menuRef=e},this._registerSubmenu=()=>this.context?.registerSubmenu(this.props.action.id,(e=>(0,
|
|
o.ensureNotNull)(this._itemRef).contains(e)||null!==this._menuElementRef.current&&this._menuElementRef.current.contains(e))),this.state={...this.props.action.getState()}}componentDidMount(){this.props.action.onUpdate().subscribe(this,this._updateState),this.state.subItems.length&&(this._unsubscribe=this._registerSubmenu()),this.props.reference&&(this._itemRef=this.props.reference.current)}componentDidUpdate(e,t){t.loading!==this.state.loading&&this.props.onRequestUpdate?.(),0===t.subItems.length&&this.state.subItems.length>0&&(this._unsubscribe=this._registerSubmenu()),t.subItems.length>0&&0===this.state.subItems.length&&this._unsubscribe?.(),t.subItems!==this.state.subItems&&null!==this._menuRef&&this._menuRef.update()}componentWillUnmount(){this.props.action.onUpdate().unsubscribe(this,this._updateState),this._unsubscribe&&this._unsubscribe()}render(){const e=this.context?.current?this.context.current===this.props.action.id:this.props.isSubMenuOpened;return this.state.loading?s.createElement(m,{size:this.state.size}):s.createElement(g,{...(0,i.filterDataProps)(this.props),theme:this.props.theme,ref:this.props.reference??this._setItemRef,onClick:this._handleClick,onClickToolbox:this._handleClickToolbox,onMouseOver:this._handleItemMouseOver,hovered:e,hasSubItems:this._hasSubItems(),actionName:this.state.name,checkboxInput:this.props.checkboxInput,selected:this.props.selected,className:this.props.className,...this.state},s.createElement(E.ContextMenu,{isOpened:e,items:this.state.subItems,position:this._calcSubMenuPos,menuStatName:this.props.menuStatName,parentStatName:this._getStatName(),menuElementReference:this._menuElementRef,onMouseOver:this.state.subItems.length?this._handleMenuMouseOver:void 0,ref:this._handleMenuRef}))}_setCurrentContextValue(){this.state.subItems.length&&this.context?.setCurrent(this.props.action.id)}_hasSubItems(){return this.state.subItems.length>0}_trackEvent(){const e=this._getStatName();(0,x.trackEvent)("ContextMenuClick",this.props.menuStatName||"",e)}_getStatName(){return[this.props.parentStatName,this.state.statName].filter((e=>Boolean(e))).join(".")}}k.contextType=r.SubmenuContext},27156:(e,t,n)=>{"use strict";n.d(t,{ContextMenuItem:()=>E,DEFAUL_CONTEXT_MENU_ITEM_THEME:()=>f});var s=n(79474),o=n(14487),i=n(71236),r=n(16905),a=n(45958),c=n(25030),l=n(57058),u=n(62466),h=n(39720),d=n(25740),m=n(40197),p=n(32509),v=n(95633),b=n(51894),g=n(70995);const f=g,x=(0,r.isFeaturesetEnabled)("items_favoriting");class E extends s.PureComponent{constructor(){super(...arguments),this._handleMouseOver=e=>{(0,c.isTouchEvent)(e.nativeEvent)||this.props.onMouseOver&&this.props.onMouseOver()},this._handleClickToolbox=e=>{e.stopPropagation(),this.props.onClickToolbox&&this.props.onClickToolbox()}}render(){const{hasSubItems:e,shortcutHint:t,hint:n,invisibleHotkey:i,favourite:r,theme:c=g,size:l="normal",onKeyDown:d,label:p,jsxLabel:v,styledLabel:f}=this.props,E=this.props.checkable&&this.props.checkboxInput?"label":"div";return s.createElement(s.Fragment,null,s.createElement("tr",{...(0,
|
|
m.filterDataProps)(this.props),...(0,m.filterAriaProps)(this.props),id:this.props.id,className:o(this.props.className,c.item,!this.props.noInteractive&&c.interactive,this.props.hovered&&c.hovered,this.props.disabled&&c.disabled,this.props.active&&c.active,this.props.selected&&c.selected,c[l]),onClick:this.props.onClick,onMouseOver:this._handleMouseOver,ref:this.props.reference,"data-action-name":this.props.actionName,tabIndex:this.props.tabIndex,onKeyDown:d},x&&void 0!==r&&s.createElement("td",{className:c.favoriteActionCell},s.createElement(u.FavoriteButton,{id:`${this.props.id}-favorite`,className:c.favourite,isFilled:r,onClick:this.props.onFavouriteClick,"data-role":"list-item-action"})),s.createElement("td",{className:o(c.iconCell),"data-icon-cell":!0},this._icon(c)),s.createElement("td",{className:c.contentCell},s.createElement(E,{className:c.content},s.createElement("span",{className:o(c.label,this.props.checked&&c.checked),"data-label":!0},!v&&f?f.map((({text:e,...t},n)=>s.createElement("span",{key:n,style:t},e))):v??p),this._toolbox(c),e&&s.createElement("span",{className:c.arrowIcon,dangerouslySetInnerHTML:{__html:b},"data-submenu-arrow":!0}),!e&&t&&!a.CheckMobile.any()&&s.createElement(h.Hint,{className:o(i&&c.invisibleHotkey),text:t}),!e&&!t&&n&&s.createElement(h.Hint,{text:n})))),s.createElement("tr",{className:c.subMenu},s.createElement("td",null,this.props.children)))}_icon(e){if(this.props.checkable){if(this.props.checkboxInput)return s.createElement(i.CheckboxInput,{className:o(e.checkboxInput),checked:!!this.props.checked});if(this.props.checked){const t=!this.props.icon&&!this.props.iconChecked,n=this.props.iconChecked||this.props.icon||v;return s.createElement("span",{className:e.icon,dangerouslySetInnerHTML:{__html:n},"data-icon-checkmark":t})}return this.props.icon?s.createElement("span",{className:e.icon,dangerouslySetInnerHTML:{__html:this.props.icon}}):s.createElement("span",{className:e.icon})}return this.props.icon?s.createElement("span",{className:e.icon,dangerouslySetInnerHTML:{__html:this.props.icon}}):null}_toolbox(e){return this.props.toolbox?s.createElement("span",{className:o(e.toolbox,this.props.showToolboxOnHover&&e.showToolboxOnHover),onClick:this._handleClickToolbox,"data-toolbox":!0},this._renderToolboxContent()):null}_renderToolboxContent(){return this.props.toolbox&&this.props.toolbox.type===d.ToolboxType.Delete?s.createElement(l.RemoveButton,{icon:p,onClick:this.props.toolbox.action}):null}}},17656:(e,t,n)=>{"use strict";n.d(t,{ContextMenu:()=>y,OverlapContextMenu:()=>M});var s=n(79474),o=n(14487),i=n.n(o),r=n(43514),a=n(86738),c=n(61726);class l extends s.PureComponent{constructor(){super(...arguments),this._handleKeyDown=e=>{e.keyCode===this.props.keyCode&&this.props.handler(e)}}componentDidMount(){document.addEventListener(this.props.eventType||"keydown",this._handleKeyDown,!1)}componentWillUnmount(){document.removeEventListener(this.props.eventType||"keydown",this._handleKeyDown,!1)}render(){return null}}var u=n(13769),h=n(17896),d=n(54466),m=n(49445);function p(e){
|
|
return s.createElement("li",{className:m.separator})}var v=n(69780),b=n(77690),g=n(11463);function f(e){const t=e.action.custom()??e.action,[n,o]=(0,s.useState)((()=>t.getState())),[i,r]=(0,s.useState)(!1),a=!!n.subItems.length,c=a&&i;return(0,s.useEffect)((()=>{const e=()=>o(t.getState());return t.onUpdate().subscribe(null,e),()=>{t.onUpdate().unsubscribe(null,e)}}),[]),s.createElement(v.ContextMenuItem,{...n,onClick:function(e){if(n.disabled||e.defaultPrevented)return;if(a)return void r(!0);n.doNotCloseOnClick||(0,g.globalCloseMenu)();t.execute()},isLoading:n.loading,isHovered:c},c&&s.createElement(b.Drawer,{onClose:l},s.createElement(k,{items:n.subItems,parentAction:t,closeNested:l})));function l(e){e&&e.preventDefault(),r(!1)}}var x=n(19245),E=n(34550);function k(e){const{items:t,parentAction:n,closeNested:o}=e,i=!Boolean(n)&&t.every((e=>!Boolean("separator"!==e.type&&(e.getState().icon||e.getState().checkable))));return s.createElement(x.EmptyIconsContext.Provider,{value:i},s.createElement("ul",null,n&&s.createElement(s.Fragment,null,s.createElement(v.ContextMenuItem,{label:n.getState().label,isTitle:!0,active:!1,disabled:!1,subItems:[],checkable:!1,checked:!1,doNotCloseOnClick:!1,icon:E,onClick:o}),s.createElement(p,null)),t.map((e=>{switch(e.type){case"action":return s.createElement(f,{key:e.id,action:e});case"separator":return s.createElement(p,{key:e.id})}}))))}const w=s.createContext(null);var _=n(60714),C=n(34235);class y extends s.PureComponent{constructor(e){super(e),this._menuRef=s.createRef(),this._handleRequestUpdate=()=>{this.update()},this._handleClose=()=>{this.props.onClose&&this.props.onClose()},this._handleOutsideClickClose=e=>{const{doNotCloseOn:t,onClose:n}=this.props;!n||void 0!==t&&t.contains(e.target)||n()},this._handleFocusOnOpen=()=>{this.props.menuElementReference?.current&&this.props.takeFocus&&this.props.menuElementReference?.current.focus({preventScroll:!0})},this._handleFocus=e=>{this.props.isKeyboardEvent&&e.target&&(0,_.focusFirstMenuItem)(e.target)},this.state={}}render(){const{isOpened:e,onClose:t,items:n,doNotCloseOn:o,menuStatName:r,parentStatName:m,takeFocus:p,...v}=this.props;return e&&n.length>0?s.createElement(h.DrawerManager,null,s.createElement(l,{keyCode:27,eventType:"keyup",handler:this._handleClose}),s.createElement(d.MatchMedia,{rule:"(max-width: 440px)"},(t=>this._isDrawer(t)?s.createElement(w.Provider,{value:{type:"drawer"}},s.createElement(b.Drawer,{onClose:this._handleClose,position:"Bottom","data-name":v["data-name"]},s.createElement(k,{items:n}))):s.createElement(w.Provider,{value:{type:"menu"}},s.createElement(c.OutsideEvent,{handler:this._handleOutsideClickClose,mouseDown:!0,touchStart:!0,reference:this.props.menuElementReference},(t=>s.createElement(a.Menu,{...v,reference:t,className:i()(C.menu,"context-menu"),onClose:this._handleClose,noMomentumBasedScroll:!0,ref:this._menuRef,tabIndex:p?-1:void 0,onOpen:this._handleFocusOnOpen,onFocus:this._handleFocus,onKeyDown:_.handleAccessibleMenuKeyDown},s.createElement(u.ActionsTable,{items:n,menuStatName:r,
|
|
parentStatName:m,parentIsOpened:e,onRequestUpdate:this._handleRequestUpdate})))))))):null}update(){this._menuRef.current&&this._menuRef.current.update(),this.props.isKeyboardEvent&&this.props.menuElementReference?.current&&document.activeElement===this.props.menuElementReference.current&&(0,_.focusFirstMenuItem)(this.props.menuElementReference.current)}_isDrawer(e){return void 0===this.props.mode?e:"drawer"===this.props.mode}}const M=(0,r.makeOverlapable)(y)},25740:(e,t,n)=>{"use strict";var s;n.d(t,{ToolboxType:()=>s}),function(e){e[e.Delete=0]="Delete"}(s||(s={}))},39720:(e,t,n)=>{"use strict";n.d(t,{Hint:()=>a});var s=n(79474),o=n(14487),i=n.n(o),r=n(70995);function a(e){const{text:t="",className:n}=e;return s.createElement("span",{className:i()(r.shortcut,n)},t)}},69780:(e,t,n)=>{"use strict";n.d(t,{ContextMenuItem:()=>p});var s=n(79474),o=n(14487),i=n.n(o),r=n(66334),a=n(61597),c=n(19245),l=n(39720),u=n(38056),h=n(80596),d=n(32509),m=n(26001);function p(e){const{className:t,isTitle:n,isLoading:o,isHovered:p,active:v,checkable:b,disabled:g,checked:f,icon:x,iconChecked:E,hint:k,subItems:w,label:_,styledLabel:C,onClick:y,children:M,toolbox:N,jsxLabel:I,size:S="normal"}=e,D=(0,s.useContext)(c.EmptyIconsContext),O=!!w.length;return o?s.createElement("li",{className:i()(t,m.item,m.loading,m[S])},s.createElement(a.Loader,null)):s.createElement("li",{className:i()(t,m.item,m.interactive,n&&m.title,g&&m.disabled,p&&m.hovered,v&&m.active,D&&m.emptyIcons,m[S]),onClick:y},s.createElement(r.Icon,{className:i()(m.icon),icon:function(){if(b&&f)return E||x||u;return x}()}),s.createElement("span",{className:i()(m.label)},!I&&C?C.map((({text:e,...t},n)=>s.createElement("span",{key:n,style:t},e))):I??_),!!N&&s.createElement(r.Icon,{onClick:function(){N&&N.action()},className:m.remove,icon:d}),!O&&k&&s.createElement(l.Hint,{className:m.shortcut,text:k}),O&&s.createElement(r.Icon,{className:m.nested,icon:h}),M)}},19245:(e,t,n)=>{"use strict";n.d(t,{EmptyIconsContext:()=>s});const s=n(79474).createContext(!1)},92381:(e,t,n)=>{"use strict";n.d(t,{RemoveTitleType:()=>s,removeTitlesMap:()=>i});var s,o=n(91599);!function(e){e.Add="add",e.Remove="remove"}(s||(s={}));const i={[s.Add]:o.t(null,void 0,n(99529)),[s.Remove]:o.t(null,void 0,n(16590))}},62466:(e,t,n)=>{"use strict";n.d(t,{FavoriteButton:()=>d});var s=n(79474),o=n(14487),i=n.n(o),r=n(66334),a=n(92381),c=n(28390),l=n(72995),u=n(89658),h=n(73832);function d(e){const{className:t,isFilled:n,isActive:o,onClick:d,title:m,...p}=e,[v,b]=(0,c.useActiveDescendant)(null),g=m??(n?a.removeTitlesMap[a.RemoveTitleType.Remove]:a.removeTitlesMap[a.RemoveTitleType.Add]);return(0,s.useLayoutEffect)((()=>{const e=v.current;e instanceof HTMLElement&&g&&e.dispatchEvent(new CustomEvent("common-tooltip-update"))}),[g,v]),s.createElement(r.Icon,{...p,className:i()(h.favorite,"apply-common-tooltip",n&&h.checked,o&&h.active,b&&h.focused,t),onClick:d,icon:n?l:u,title:g,ariaLabel:g,ref:v})}},57058:(e,t,n)=>{"use strict";n.d(t,{RemoveButton:()=>h})
|
|
;var s=n(91599),o=n(79474),i=n(14487),r=n.n(i),a=n(66334),c=n(28390),l=n(6693),u=n(36779);function h(e){const{className:t,isActive:i,onClick:h,onMouseDown:d,title:m,hidden:p,"data-name":v="remove-button",icon:b,...g}=e,[f,x]=(0,c.useActiveDescendant)(null);return o.createElement(a.Icon,{...g,"data-name":v,className:r()(u.button,"apply-common-tooltip",i&&u.active,p&&u.hidden,x&&u.focused,t),icon:b||l,onClick:h,onMouseDown:d,title:m??s.t(null,void 0,n(91126)),ariaLabel:m??s.t(null,void 0,n(91126)),ref:f})}},13769:(e,t,n)=>{"use strict";n.d(t,{ActionsTable:()=>a});var s=n(79474),o=n(55461);function i(e){return s.createElement("tr",{className:o.row},s.createElement("td",null,s.createElement("div",{className:o.line})),s.createElement("td",null,s.createElement("div",{className:o.line}),e.hint?s.createElement("div",{className:o.hint},e.hint):null))}var r=n(62369);class a extends s.PureComponent{constructor(e){super(e),this._handleShowSubMenu=e=>{const t=e.getState();this.setState({showSubMenuOf:t.subItems.length?e:void 0})},this.state={}}render(){return s.createElement("table",null,s.createElement("tbody",null,this.props.items.map((e=>this._item(e)))))}static getDerivedStateFromProps(e,t){return!e.parentIsOpened&&t.showSubMenuOf?{showSubMenuOf:void 0}:null}_item(e){switch(e.type){case"separator":return s.createElement(i,{key:e.id,hint:e.getHint()});case"action":const t=e.custom()??e;return s.createElement(r.ContextMenuAction,{key:t.id,action:t,onShowSubMenu:this._handleShowSubMenu,isSubMenuOpened:this.state.showSubMenuOf===t,menuStatName:this.props.menuStatName,parentStatName:this.props.parentStatName,onRequestUpdate:this.props.onRequestUpdate})}}}},95633:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path fill="currentColor" d="M22 9.06 11 20 6 14.7l1.09-1.02 3.94 4.16L20.94 8 22 9.06Z"/></svg>'},17070:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 11 9" width="11" height="9" fill="none"><path stroke="currentColor" stroke-width="2" d="M0.999878 4L3.99988 7L9.99988 1"/></svg>'},34550:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28" fill="none"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16.5 20L11 14.5 16.5 9"/></svg>'},80596:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" width="18" height="18" fill="none"><path stroke="currentColor" d="M8 5l3.5 3.5L8 12"/></svg>'},38056:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28" fill="none"><path stroke="currentColor" stroke-linecap="round" stroke-width="1.5" d="M7 15l5 5L23 9"/></svg>'},6693:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18"><path fill="currentColor" d="M9.707 9l4.647-4.646-.707-.708L9 8.293 4.354 3.646l-.708.708L8.293 9l-4.647 4.646.708.708L9 9.707l4.646 4.647.708-.707L9.707 9z"/></svg>'},51894:e=>{
|
|
e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 16" width="10" height="16"><path d="M.6 1.4l1.4-1.4 8 8-8 8-1.4-1.4 6.389-6.532-6.389-6.668z"/></svg>'},72995:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" width="18" height="18" fill="none"><path fill="currentColor" d="M9 1l2.35 4.76 5.26.77-3.8 3.7.9 5.24L9 13l-4.7 2.47.9-5.23-3.8-3.71 5.25-.77L9 1z"/></svg>'},89658:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" width="18" height="18" fill="none"><path stroke="currentColor" d="M9 2.13l1.903 3.855.116.236.26.038 4.255.618-3.079 3.001-.188.184.044.259.727 4.237-3.805-2L9 12.434l-.233.122-3.805 2.001.727-4.237.044-.26-.188-.183-3.079-3.001 4.255-.618.26-.038.116-.236L9 2.13z"/></svg>'}}]); |