Files
ai/charting_library/bundles/general-chart-properties-dialog.efb2c0f56f646a659b5e.js

6 lines
17 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[7078],{47461:e=>{e.exports={backButton:"backButton-pbr_BOzj"}},21703:e=>{e.exports={wrapper:"wrapper-a7Y2yl3G",container:"container-a7Y2yl3G",tab:"tab-a7Y2yl3G",active:"active-a7Y2yl3G",title:"title-a7Y2yl3G",icon:"icon-a7Y2yl3G",titleText:"titleText-a7Y2yl3G",nested:"nested-a7Y2yl3G",isTablet:"isTablet-a7Y2yl3G",isMobile:"isMobile-a7Y2yl3G"}},80556:e=>{e.exports={"tablet-normal-breakpoint":"screen and (max-width: 768px)","tablet-small-breakpoint":"screen and (max-width: 430px)",withSidebar:"withSidebar-E5yydi0j",content:"content-E5yydi0j",tabContent:"tabContent-E5yydi0j",applyToAllButton:"applyToAllButton-E5yydi0j"}},1117:e=>{e.exports={themesButtonText:"themesButtonText-hJtL5aqJ",themesButtonIcon:"themesButtonIcon-hJtL5aqJ",defaultsButtonText:"defaultsButtonText-hJtL5aqJ",defaultsButtonItem:"defaultsButtonItem-hJtL5aqJ"}},45829:e=>{e.exports={separator:"separator-w5iW5vBm",small:"small-w5iW5vBm",normal:"normal-w5iW5vBm",large:"large-w5iW5vBm"}},22265:(e,t,a)=>{"use strict";a.d(t,{DialogSidebarContainer:()=>m,DialogSidebarWrapper:()=>h,DialogSidebarItem:()=>d});var l=a(50959),i=a(97754),n=a.n(i),o=a(9745),s=a(68648),r=a(21703);function c(e){return{isMobile:"mobile"===e,isTablet:"tablet"===e}}function m(e){const{mode:t,className:a,...i}=e,{isMobile:o,isTablet:s}=c(t),m=n()(r.container,s&&r.isTablet,o&&r.isMobile,a);return l.createElement("div",{...i,className:m,"data-role":"dialog-sidebar"})}function h(e){return l.createElement("div",{className:r.wrapper,...e})}function d(e){const{mode:t,title:a,icon:i,isActive:m,onClick:h,...d}=e,{isMobile:p,isTablet:u}=c(t);return l.createElement("div",{...d,className:n()(r.tab,u&&r.isTablet,p&&r.isMobile,m&&r.active),onClick:h},l.createElement(o.Icon,{className:r.icon,icon:i}),!u&&l.createElement("span",{className:r.title},l.createElement("span",{className:r.titleText},a),p&&l.createElement(o.Icon,{className:r.nested,icon:s})))}},72811:(e,t,a)=>{"use strict";a.r(t),a.d(t,{GeneralChartPropertiesDialogRenderer:()=>Z});var l=a(44352),i=a(50959),n=a(962),o=a(94720),s=a(53942),r=a(50182),c=a(66849),m=a(40296),h=a(56840),d=a.n(h),p=a(57737),u=a(90692),b=a(9745),g=a(95276),y=a(16396),_=a(51613),C=a(8840),v=(a(93731),a(3615));const T=l.t(null,void 0,a(40837));var f=a(50655),k=a(86339),A=a(96040),S=a(51768),P=a(70412),E=a(32563),w=a(1117);function B(e){const{themeName:t,chartWidgetCollection:a,onRemove:l,manager:n}=e,[o,s]=(0,P.useHover)(),r=i.useCallback((()=>function(e,t,a){window.is_authenticated&&(0,v.showConfirm)({text:T.format({name:e}),onConfirm:({dialogClose:a})=>{(0,C.removeTheme)(e),t&&t(e),a()}},a)}(t,l,n)),[t,l,n]),c=i.useCallback((()=>{(0,C.loadTheme)(a,{themeName:t,standardTheme:!1}).then((()=>{a.readOnly()||window.saver.saveChartSilently(),(0,S.trackEvent)("GUI","Switch to custom theme")}))}),[t,a]);return i.createElement("div",{...s},i.createElement(y.PopupMenuItem,{className:w.defaultsButtonItem,isActive:!1,label:t,onClick:c,toolbox:i.createElement(A.RemoveButton,{hidden:!E.mobiletouch&&!o,onClick:r})
}))}var D=a(44996);const M=l.t(null,void 0,a(19611)),z=l.t(null,void 0,a(73169)),x=((0,k.appendEllipsis)(l.t(null,void 0,a(9908))),l.t(null,void 0,a(75819)));class I extends i.PureComponent{constructor(e){super(e),this._manager=null,this._handleApplyDefaults=()=>{const{model:e,chartWidgetCollection:t}=this.props;e.restorePreferences();const a=(0,C.getCurrentTheme)().name;(0,C.loadTheme)(t,{themeName:a,standardTheme:!0,applyOverrides:!0})},this._handleSaveAs=()=>{0},this._handleRemoveTheme=e=>{this.setState({themes:this.state.themes.filter((t=>t!==e))})},this._syncThemeList=()=>{0},this.state={themes:[]},this._syncThemeList()}render(){return i.createElement(f.SlotContext.Consumer,null,(e=>(this._manager=e,i.createElement(u.MatchMedia,{rule:"screen and (max-width: 768px)"},(e=>i.createElement(g.ControlDisclosure,{id:"series-theme-manager",className:!e&&w.themesButtonText,hideArrowButton:e,"data-name":"theme-select",buttonChildren:this._getPlaceHolderItem(e)},this._getThemeItems(e)))))))}_getPlaceHolderItem(e){return e?i.createElement(b.Icon,{className:w.themesButtonIcon,icon:D}):M}_getThemeItems(e){const{isApplyToAllVisible:t,chartWidgetCollection:a,applyToAllCallback:l}=this.props,{themes:n}=this.state;return i.createElement(i.Fragment,null,e&&t&&i.createElement(y.PopupMenuItem,{className:w.defaultsButtonItem,isActive:!1,label:x,onClick:l}),i.createElement(y.PopupMenuItem,{className:w.defaultsButtonItem,isActive:!1,label:z,onClick:this._handleApplyDefaults}),!1,n.length>0&&i.createElement(i.Fragment,null,i.createElement(_.PopupMenuSeparator,{key:"separator"}),n.map((e=>i.createElement(B,{key:e,themeName:e,onRemove:this._handleRemoveTheme,chartWidgetCollection:a,manager:this._manager})))))}}var N=a(59064),L=a(71953),W=a(24437),V=a(22265),q=a(86656);const G={areaSymbolMinTick:"normal",areaSymbolTimezone:"normal",barSymbolMinTick:"normal",barSymbolTimezone:"normal",baselineSymbolMinTick:"normal",baselineSymbolTimezone:"normal",candleSymbolMinTick:"normal",candleSymbolTimezone:"normal",dateFormat:"normal",haSymbolMinTick:"normal",haSymbolTimezone:"normal",hiloSymbolMinTick:"normal",hiloSymbolTimezone:"normal",hollowCandleSymbolMinTick:"normal",hollowCandleSymbolTimezone:"normal",kagiAtrLength:"normal",kagiReversalAmount:"normal",kagiStyle:"normal",kagiSymbolMinTick:"normal",kagiSymbolTimezone:"normal",lineSymbolMinTick:"normal",lineSymbolTimezone:"normal",sessionId:"normal",lockScale:"normal",mainSeriesSymbolAreaPriceSource:"normal",mainSeriesSymbolBaseLevelPercentage:"normal",mainSeriesSymbolBaseLinePriceSource:"normal",mainSeriesSymbolLinePriceSource:"normal",mainSeriesSymbolStyleType:"normal",navButtons:"big",paneButtons:"big",scalesCurrencyUnit:"big",pbLb:"normal",pbSymbolMinTick:"normal",pbSymbolTimezone:"normal",pnfAtrLength:"normal",pnfBoxSize:"normal",pnfReversalAmount:"normal",pnfSources:"normal",pnfStyle:"normal",pnfSymbolMinTick:"normal",pnfSymbolTimezone:"normal",rangeSymbolMinTick:"normal",rangeSymbolTimezone:"normal",renkoAtrLength:"normal",renkoBoxSize:"normal",renkoStyle:"normal",
renkoSymbolMinTick:"normal",renkoSymbolTimezone:"normal",scalesPlacement:"normal",symbolLastValueLabel:"big",symbolTextSource:"normal"};var R=a(48199),Y=a(47461);function j(e){return i.createElement(R.BackButton,{className:Y.backButton,size:"medium","aria-label":l.t(null,{context:"input"},a(16936)),preservePaddings:!0,...e})}var H=a(80556);const U="properties_dialog.last_page_id";class J extends i.PureComponent{constructor(e){var t;super(e),this._renderChildren=({requestResize:e,isSmallWidth:t})=>(this._requestResize=e,i.createElement("div",{className:H.content},this._renderTabs(t),this._renderTabContent(t))),this._renderApplyToAllButton=()=>i.createElement(u.MatchMedia,{rule:W.DialogBreakpoints.TabletNormal},(e=>this._renderApplyToAll(e))),this._renderFooterLeft=()=>{const{model:e,chartWidgetCollection:t}=this.props,{isApplyToAllVisible:a}=this.state;return i.createElement(I,{model:e,isApplyToAllVisible:a,applyToAllCallback:this._handleApplyToAll,chartWidgetCollection:t})},this._createTabClickHandler=e=>()=>this._selectPage(e),this._selectPage=(e,t)=>{const{activePage:a}=this.state;e!==a&&(a&&a.definitions.unsubscribe(this._onChangeActivePageDefinitions),null!==e&&(t||d().setValue(U,e.id),e.definitions.subscribe(this._onChangeActivePageDefinitions)),this.setState({activePage:e,tableKey:Date.now()},(()=>{this._requestResize&&this._requestResize()})))},this._onChangeActivePageDefinitions=()=>{L.logger.logNormal("Definition collection was updated"),this.setState({tableKey:Date.now()},(()=>{this._requestResize&&this._requestResize()}))},this._onTabVisibilityChanged=()=>{const e=this.props.pages.filter((e=>e.visible.value()));this.setState({visiblePages:e});const t=this.state.activePage;null===t||e.includes(t)||this._selectPage(0===e.length?null:e[0],!0)},this._handleCancel=()=>{this.props.onCancel(),this.props.onClose()},this._handleSubmit=()=>{this.props.onSubmit(),this.props.onClose()},this._handleScroll=()=>{N.globalCloseDelegate.fire()},this._handleApplyToAll=()=>{const{chartWidgetCollection:e,model:t}=this.props,{isApplyToAllVisible:a}=this.state;a&&e.applyPreferencesToAllCharts(t)},this._syncApplyToAllVisibility=()=>{const{chartWidgetCollection:e}=this.props;this.setState({isApplyToAllVisible:(0,p.isMultipleLayout)(e.layout.value())})},this._handleBackClick=()=>{const{activePage:e}=this.state;e&&e.definitions.unsubscribe(this._onChangeActivePageDefinitions),this.setState({activePage:null})};const{pages:a,activePageId:l}=e,n=a.filter((e=>e.visible.value()));let o=null!==(t=n.find((e=>e.id===l)))&&void 0!==t?t:null;if(!o){const e=d().getValue(U),t=n.find((t=>t.id===e));o=t||(n.length>0?n[0]:null)}this.state={activePage:o,visiblePages:n,isApplyToAllVisible:(0,p.isMultipleLayout)(e.chartWidgetCollection.layout.value()),tableKey:Date.now()}}componentDidMount(){const{chartWidgetCollection:e,pages:t}=this.props,{activePage:a}=this.state;e.layout.subscribe(this._syncApplyToAllVisibility),a&&a.definitions.subscribe(this._onChangeActivePageDefinitions),t.forEach((e=>e.visible.subscribe(this._onTabVisibilityChanged)))}
componentWillUnmount(){const{chartWidgetCollection:e,pages:t}=this.props,{activePage:a}=this.state;a&&a.definitions.unsubscribe(this._onChangeActivePageDefinitions),e.layout.unsubscribe(this._syncApplyToAllVisibility),t.forEach((e=>e.visible.unsubscribe(this._onTabVisibilityChanged)))}render(){const{isOpened:e,onClose:t}=this.props,{activePage:n}=this.state;return i.createElement(u.MatchMedia,{rule:W.DialogBreakpoints.TabletSmall},(o=>i.createElement(r.AdaptiveConfirmDialog,{className:H.withSidebar,dataName:"series-properties-dialog",onClose:t,isOpened:e,title:null!==n&&o?n.title:l.t(null,void 0,a(74207)),footerLeftRenderer:this._renderFooterLeft,additionalButtons:this._renderApplyToAllButton(),additionalHeaderElement:null!==n&&o?i.createElement(j,{onClick:this._handleBackClick}):void 0,onSubmit:this._handleSubmit,onCancel:this._handleCancel,render:this._renderChildren,submitOnEnterKey:!1})))}_renderTabContent(e){const{pages:t}=this.props,a=this._getCurrentPage(e);if(a){const e=t.find((e=>e.id===a.id)),l=e?e.definitions.value():[];return i.createElement(q.TouchScrollContainer,{className:H.tabContent,onScroll:this._handleScroll},i.createElement(c.ControlCustomWidthContext.Provider,{value:G},i.createElement(m.PropertyTable,{key:this.state.tableKey},l.map((e=>i.createElement(s.Section,{key:e.id,definition:e}))))))}return null}_renderTabs(e){const{activePage:t,visiblePages:a}=this.state;if(t&&e)return null;const l=this._getCurrentPage(e);return i.createElement(u.MatchMedia,{rule:W.DialogBreakpoints.TabletNormal},(e=>i.createElement(u.MatchMedia,{rule:W.DialogBreakpoints.TabletSmall},(t=>{const n=t?"mobile":e?"tablet":void 0;return i.createElement(V.DialogSidebarContainer,{mode:n,onScroll:this._handleScroll},a.map((e=>i.createElement(V.DialogSidebarItem,{key:e.id,mode:n,"data-name":e.id,title:e.title,icon:e.icon,onClick:this._createTabClickHandler(e),isActive:l?e.id===l.id:void 0}))))}))))}_renderApplyToAll(e){const{isApplyToAllVisible:t}=this.state;return!e&&t&&i.createElement("span",{className:H.applyToAllButton},i.createElement(o.Button,{appearance:"stroke",onClick:this._handleApplyToAll},l.t(null,void 0,a(75819))))}_getCurrentPage(e){const{pages:t}=this.props,{activePage:a}=this.state;let l=null;return a?l=a:!e&&t.length&&(l=t[0]),l}}var O=a(76422),F=a(88279);const K=l.t(null,void 0,a(74207));class Z extends F.DialogRenderer{constructor(e){super(),this._handleClose=()=>{n.unmountComponentAtNode(this._container),this._setVisibility(!1),this._onClose&&this._onClose()},this._handleSubmit=()=>{},this._handleCancel=()=>{this._model.undoToCheckpoint(this._checkpoint)},this._propertyPages=e.propertyPages,this._model=e.model,this._activePageId=e.activePageId,this._onClose=e.onClose,this._chartWidgetCollection=e.chartWidgetCollection,this._checkpoint=this._ensureCheckpoint(e.undoCheckPoint)}hide(e){e?this._handleCancel():this._handleSubmit(),this._handleClose()}isVisible(){return this.visible().value()}show(){n.render(i.createElement(J,{title:K,isOpened:!0,onSubmit:this._handleSubmit,onClose:this._handleClose,
onCancel:this._handleCancel,pages:this._propertyPages,model:this._model,activePageId:this._activePageId,chartWidgetCollection:this._chartWidgetCollection}),this._container),this._setVisibility(!0),O.emit("edit_object_dialog",{objectType:"mainSeries",scriptTitle:this._model.mainSeries().title()})}_ensureCheckpoint(e){return void 0===e&&(e=this._model.createUndoCheckpoint()),e}}},51613:(e,t,a)=>{"use strict";a.d(t,{PopupMenuSeparator:()=>s});var l=a(50959),i=a(97754),n=a.n(i),o=a(45829);function s(e){const{size:t="normal",className:a,ariaHidden:i=!1}=e;return l.createElement("div",{className:n()(o.separator,"small"===t&&o.small,"normal"===t&&o.normal,"large"===t&&o.large,a),role:"separator","aria-hidden":i})}},68648: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-width="1.3" d="M12 9l5 5-5 5"/></svg>'},74207:e=>{e.exports={ar:["إعدادات الرسم البياني"],ca_ES:["Configuració de gràfics"],cs:"Chart settings",de:["Chart Einstellungen"],el:"Chart settings",en:"Chart settings",es:["Configuración del gráfico"],fa:"Chart settings",fr:["Paramètres du graphique"],he_IL:["הגדרות גרף"],hu_HU:"Chart settings",id_ID:["Pengaturan chart"],it:["Impostazioni grafico"],ja:["チャート設定"],ko:["차트 세팅"],ms_MY:["Tetapan Carta"],nl_NL:"Chart settings",pl:["Ustawienia wykresu"],pt:["Configurações do gráfico"],ro:"Chart settings",ru:["Настройки графика"],sv:["Diagraminställningar"],th:["การตั้งค่าชาร์ต"],tr:["Grafik ayarları"],vi:["Cài đặt biểu đồ"],zh:["图表设置"],zh_TW:["圖表設定"]}},73169:e=>{e.exports={ar:["تطبيق الإعدادات الافتراضية"],ca_ES:["Aplica configuracions per defecte"],cs:["Apply Defaults"],de:["Voreinstellungen anwenden"],el:["Apply Defaults"],en:"Apply defaults",es:["Aplicar configuraciones por defecto"],fa:["Apply Defaults"],fr:["Appliquer les paramètres par défaut"],he_IL:["החל ברירת מחדל"],hu_HU:["Alapértelmezett Alkalmazása"],id_ID:["Terapkan Pengaturan Awal"],it:["Applica predefiniti"],ja:["デフォルトを適用"],ko:["기본설정"],ms_MY:["Guna Pakai Lalai"],nl_NL:["Apply Defaults"],pl:["Zastosuj domyślne"],pt:["Aplicar padrões"],ro:["Apply Defaults"],ru:["Применить по умолчанию"],sv:["Tillämpa standardinställningarna"],th:["ตั้งให้เป็นค่าเบื้องต้น"],tr:["Varsayılanları uygula"],vi:["Áp dụng Nhiều mặc định"],zh:["应用默认"],zh_TW:["套用預設值"]}},75819:e=>{e.exports={ar:["تفعيل على الكل"],ca_ES:["Aplica-ho a tot"],cs:"Apply to all",de:["Auf alle Anwenden"],el:"Apply to all",en:"Apply to all",es:["Aplica a todo"],fa:"Apply to all",fr:["Appliquer à tous"],he_IL:["החל על הכל"],hu_HU:"Apply to all",id_ID:["Terapkan ke seluruh"],it:["Applica su tutti"],ja:["すべてに適用"],ko:["모두 적용"],ms_MY:["Tertakluk untuk semua"],nl_NL:"Apply to all",pl:["Zastosuj do wszystkich"],pt:["Aplicar a todos"],ro:"Apply to all",ru:["Применить ко всем"],sv:["Använd för alla"],th:["ดำเนินการกับทั้งหมด"],tr:["Hepsine uygula"],vi:["Áp dụng cho tất cả"],zh:["应用至全部"],zh_TW:["全部套用"]}},40837:e=>{e.exports={ar:['هل تريد حقًا حذف قالب الرسم البياني "{name}"؟'],
ca_ES:["De debò que voleu eliminar la plantilla de gràfic '{name}'?"],cs:"Do you really want to delete Chart Template '{name}' ?",de:["Möchten Sie die Chart-Vorlage '{name}' wirklich löschen?"],el:"Do you really want to delete Chart Template '{name}' ?",en:"Do you really want to delete Chart Template '{name}' ?",es:["¿Está seguro de que desea eliminar la plantilla de gráfico '{name}'?"],fa:"Do you really want to delete Chart Template '{name}' ?",fr:['Voulez-vous vraiment supprimer le modèle de graphique "{name}"?'],he_IL:["האם אתה באמת רוצה למחוק את תבנית הגרף '{name}'?"],hu_HU:"Do you really want to delete Chart Template '{name}' ?",id_ID:["Apakah anda benar-benar ingin menghapus Template Chart '{name}' ?"],it:["Si vuole davvero cancellare il modello del grafico '{name}'?"],ja:["本当にチャートテンプレート '{name}' を削除しますか?"],ko:["차트 템플릿 '{name}'를 정말 삭제하시겠습니까?"],ms_MY:["Adakah anda benar-benar ingin memadamkan Templat Carta '{name}' ?"],nl_NL:"Do you really want to delete Chart Template '{name}' ?",pl:["Czy na pewno chcesz usunąć szablon wykresu „{name}”?"],pt:["Você realmente quer apagar o Template '{name}' do Gráfico?"],ro:"Do you really want to delete Chart Template '{name}' ?",ru:['Вы действительно хотите удалить шаблон графика "{name}"?'],sv:['Vill du verkligen radera diagrammall "{name}"?'],th:["คุณต้องการลบเทมเพลตแผนภูมิ '{name}' หรือไม่"],tr:["'{name}' Grafik Taslağını gerçekten silmek istiyor musunuz?"],vi:["Bạn có thực sự muốn xoá Mẫu Biểu đồ '{name}' không?"],zh:["您真的要删除图表模板'{name}'吗?"],zh_TW:["您真的要刪除圖表模板'{name}'嗎?"]}}}]);