1 line
2.8 KiB
JavaScript
1 line
2.8 KiB
JavaScript
"use strict";(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[3966,1277],{11924:(e,t,r)=>{r.r(t),r.d(t,{LineToolBalloon:()=>c});var o=r(50151),i=r(11542),n=r(32679),s=r(10568),l=r(12988),a=r(73305);const p=i.t(null,void 0,r(9818));class c extends s.InplaceTextLineDataSource{constructor(e,t,r,o){super(e,t??c.createProperties(e.backgroundTheme().spawnOwnership()),r,o),this._createPaneView()}pointsCount(){return 1}name(){return"Balloon"}template(){const e=super.template();return e.text=this.properties().childs().text.value(),e}shouldBeRemovedOnDeselect(){return""===this._properties.childs().text.value().trim()}editableTextProperties(){(0,o.assert)(!1,"unexpected method call")}static createProperties(e,t){const r=new n.DefaultProperty({defaultName:"linetoolballoon",state:t,theme:e});return this._configureProperties(r),r}_applyTemplateImpl(e){super._applyTemplateImpl(e),this.properties().childs().text.setValue(e.text)}_getPropertyDefinitionsViewModelClass(){return Promise.all([r.e(3401),r.e(3889),r.e(8009),r.e(6204),r.e(1963),r.e(8537)]).then(r.bind(r,18046)).then((e=>e.BalloonDefinitionsViewModel))}_createPaneView(){Promise.all([r.e(2870),r.e(2211),r.e(1583)]).then(r.bind(r,82462)).then((e=>{this._setPaneViews([new e.BalloonPaneView(this,this._model)])}))}static _configureProperties(e){super._configureProperties(e),e.hasChild("text")||e.addChild("text",new l.Property(this._defaultText)),e.addExcludedKey("text",1),e.addChild("linesColors",new a.LineToolColorsProperty([e.childs().borderColor])),e.addChild("textsColors",new a.LineToolColorsProperty([e.childs().color]))}}c._defaultText=p},74451:(e,t,r)=>{r.r(t),r.d(t,{LineToolComment:()=>a});var o=r(94784),i=r(88960),n=r(42752),s=r(32679),l=r(11924);class a extends l.LineToolBalloon{constructor(e,t,r,o){super(e,t??a.createProperties(e.backgroundTheme().spawnOwnership()),r,o)}name(){return"Comment"}activateEditingOnCreation(){return!0}editableTextProperties(){return{text:this.properties().childs().text,textColor:this.properties().childs().color}}static createProperties(e,t){const r=new s.DefaultProperty({defaultName:"linetoolcomment",state:t,theme:e});return a._configureProperties(r),r}_normalizePoint(e,t){return super._normalizePointWithoutOffset(e)??super._normalizePoint(e,t)}_createPaneView(){Promise.all([r.e(2870),r.e(2211),r.e(1583)]).then(r.bind(r,39157)).then((e=>{this._setPaneViews([new e.CommentPaneView(this,this._model,this._openTextEditor.bind(this),this._closeTextEditor.bind(this),this.onSelectionChange.bind(this))])}))}_createDataSourceBackgroundColorWV(){const e=(0,o.generateColorCached)(),{backgroundColor:t,transparency:r}=this.properties().childs();return(0,i.combine)((()=>e(t.value(),r.value())),(0,n.convertPropertyToWatchedValue)(t).ownership(),(0,n.convertPropertyToWatchedValue)(r).ownership()).ownership()}}a._defaultText=""}}]); |