2 lines
3.8 KiB
JavaScript
2 lines
3.8 KiB
JavaScript
"use strict";(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[1455],{76607:(e,t,r)=>{r.d(t,{DateAndPriceBaseProperties:()=>p,allPropertiesStateKeysBase:()=>h,nonThemedFactoryDefaultsBase:()=>c,themedFactoryDefaultsBase:()=>d});var o=r(19625),a=r(24633),s=r(19063),l=r(31229),n=r(12988),i=r(38039);const u=(0,o.getHexColorByName)("color-tv-blue-500"),c={linewidth:2,fontsize:12,fillLabelBackground:!0,fillBackground:!0,backgroundTransparency:60,showVolume:!0,intervalsVisibilities:{...l.intervalsVisibilitiesDefaults},customText:{visible:!1,fontsize:12,bold:!1,italic:!1}},d=new Map([[a.StdTheme.Light,{textcolor:(0,o.getHexColorByName)("color-black"),labelBackgroundColor:(0,o.getHexColorByName)("color-white"),linecolor:u,backgroundColor:(0,s.generateColor)(u,85),shadow:"rgba(0, 0, 0, 0.2)",customText:{color:u}}],[a.StdTheme.Dark,{textcolor:(0,o.getHexColorByName)("color-white"),labelBackgroundColor:(0,o.getHexColorByName)("color-cold-gray-800"),linecolor:u,backgroundColor:(0,s.generateColor)(u,85),shadow:"rgba(0, 0, 0, 0.4)",customText:{color:u}}]]),h=["customText.text"];function m(e){const{showVolume:t=!0,...r}=e;return{...r,showVolume:t}}class p extends i.LineDataSourceProperty{constructor({nonThemedDefaultsKeys:e,themedDefaultsKeys:t,state:r,...o}){super({nonThemedDefaultsKeys:e,themedDefaultsKeys:t,templateKeys:[...e??[],...t??[],...h],state:r?m(r):void 0,...o});const a=r?.customText;this._textProperty=new n.Property(a?.text??""),this.childs().customText?.addChild("text",this._textProperty)}template(){const e=super.template();return e.customText.text=this._textProperty.value(),e}}},70791:(e,t,r)=>{r.r(t),r.d(t,{LineToolDateAndPriceRange:()=>x});var o=r(50151),a=r(29875),s=r(61105),l=r(19625),n=r(24633),i=r(32679),u=r(11402),c=r(6590),d=r(76607);const h=(0,l.getHexColorByName)("color-tv-blue-500"),m={...d.nonThemedFactoryDefaultsBase,drawBorder:!1,borderWidth:1},p=new Map([[n.StdTheme.Light,{...d.themedFactoryDefaultsBase.get(n.StdTheme.Light),borderColor:h}],[n.StdTheme.Dark,{...d.themedFactoryDefaultsBase.get(n.StdTheme.Dark),borderColor:h}]]),g=(0,i.extractThemedColors)((0,o.ensureDefined)(p.get(n.StdTheme.Light)),(0,o.ensureDefined)(p.get(n.StdTheme.Dark))),y=(0,i.extractAllPropertiesKeys)((0,o.ensureDefined)(p.get(n.StdTheme.Light))),C=(0,i.extractAllPropertiesKeys)(m),f=[...new Set([...y,...C,...c.commonLineToolPropertiesStateKeys,...d.allPropertiesStateKeysBase])];class D extends d.DateAndPriceBaseProperties{static create(e,t){return new this({defaultName:"linetooldateandpricerange",factoryDefaultsSupplier:()=>(0,u.factoryDefaultsForCurrentTheme)(m,p),nonThemedDefaultsKeys:C,themedDefaultsKeys:y,allStateKeys:f,themedColors:g,replaceThemedColorsOnThemeChange:!0,state:t,theme:e})}}class x extends a.LineDataSource{constructor(e,t,o,a){super(e,t??x.createProperties(e.backgroundTheme().spawnOwnership()),o,a),this._volumeCalculator=null,Promise.all([r.e(2870),r.e(2211),r.e(1583)]).then(r.bind(r,93955)).then((e=>{this._setPaneViews([new e.DateAndPriceRangePaneView(this,this._model)])}))}destroy(){
|
|
super.destroy(),null!==this._volumeCalculator&&this._volumeCalculator.destroy()}pointsCount(){return 2}name(){return"Date and Price Range"}template(){return this._properties.template()}volume(){if(null===this._volumeCalculator)return NaN;const e=this.points();return this._volumeCalculator.volume(e[0].index,e[1].index)}setOwnerSource(e){e===this._model.mainSeries()&&((0,o.assert)(null===this._volumeCalculator),this._volumeCalculator=new s.SeriesTimeRangeVolumeCalculator(this._model.mainSeries())),super.setOwnerSource(e)}static createProperties(e,t){const r=D.create(e,t);return this._configureProperties(r),r}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([r.e(3401),r.e(3889),r.e(8009),r.e(6204),r.e(1963),r.e(8537)]).then(r.bind(r,14336))).GeneralDatePriceRangeDefinitionsViewModel}}}}]); |