"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[3851],{31737(M,u,n){n.r(u),n.d(u,{plugin:()=>V});var g=n(68256),t=n(21288),e=n(7500),p=n(13678),c=n(46824),r=n(37256),m=n(55025);const f=l=>(0,r._$)(l);var h=n(52180),i=n(25238),d=n(18550);class v{getSuggestionsForData(a){const{dataSummary:o}=a;if(!o.hasData||!o.hasNumberField)return;const s=a.getListAppender({name:"",pluginId:"bargauge",options:{},fieldConfig:{defaults:{custom:{}},overrides:[]}});o.numberFieldCount>50||(o.hasStringField&&o.frameCount===1&&o.rowCountTotal<30?(s.append({name:d.m.BarGaugeBasic,options:{reduceOptions:{values:!0,calcs:[]},displayMode:e.eX.Basic,orientation:t.wV.Horizontal},fieldConfig:{defaults:{color:{mode:"continuous-GrYlRd"}},overrides:[]}}),s.append({name:d.m.BarGaugeLCD,options:{reduceOptions:{values:!0,calcs:[]},displayMode:e.eX.Lcd,orientation:t.wV.Horizontal},fieldConfig:{defaults:{color:{mode:"continuous-GrYlRd"}},overrides:[]}})):(s.append({name:d.m.BarGaugeBasic,options:{displayMode:e.eX.Basic,orientation:t.wV.Horizontal,reduceOptions:{values:!1,calcs:["lastNotNull"]}},fieldConfig:{defaults:{color:{mode:"continuous-GrYlRd"}},overrides:[]}}),s.append({name:d.m.BarGaugeLCD,options:{displayMode:e.eX.Lcd,orientation:t.wV.Horizontal,reduceOptions:{values:!1,calcs:["lastNotNull"]}},fieldConfig:{defaults:{color:{mode:"continuous-GrYlRd"}},overrides:[]}})))}}const V=new g.m(h.d).useFieldConfig().setPanelOptions(l=>{(0,m.L)(l),(0,m.h)(l),p.H(l,!0,!1),c.I(l),l.addRadio({path:"displayMode",name:"Display mode",settings:{options:[{value:e.eX.Gradient,label:"Gradient"},{value:e.eX.Lcd,label:"Retro LCD"},{value:e.eX.Basic,label:"Basic"}]},defaultValue:i.K.displayMode}).addRadio({path:"valueMode",name:"Value display",settings:{options:[{value:e.$l.Color,label:"Value color"},{value:e.$l.Text,label:"Text color"},{value:e.$l.Hidden,label:"Hidden"}]},defaultValue:i.K.valueMode}).addRadio({path:"namePlacement",name:"Name placement",settings:{options:[{value:e.TZ.Auto,label:"Auto"},{value:e.TZ.Top,label:"Top"},{value:e.TZ.Left,label:"Left"},{value:e.TZ.Hidden,label:"Hidden"}]},defaultValue:i.K.namePlacement,showIf:a=>a.orientation!==t.wV.Vertical}).addRadio({path:"namePlacement",name:"Name placement",settings:{options:[{value:e.TZ.Auto,label:"Auto"},{value:e.TZ.Hidden,label:"Hidden"}]},defaultValue:i.K.namePlacement,showIf:a=>a.orientation===t.wV.Vertical}).addBooleanSwitch({path:"showUnfilled",name:"Show unfilled area",description:"When enabled renders the unfilled region as gray",defaultValue:i.K.showUnfilled,showIf:a=>a.displayMode!=="lcd"}).addRadio({path:"sizing",name:"Bar size",settings:{options:[{value:e.T6.Auto,label:"Auto"},{value:e.T6.Manual,label:"Manual"}]},defaultValue:i.K.sizing}).addSliderInput({path:"minVizWidth",name:"Min width",description:"Minimum column width (vertical orientation)",defaultValue:i.K.minVizWidth,settings:{min:0,max:300,step:1},showIf:a=>a.sizing===e.T6.Manual&&(a.orientation===t.wV.Auto||a.orientation===t.wV.Vertical)}).addSliderInput({path:"minVizHeight",name:"Min height",description:"Minimum row height (horizontal orientation)",defaultValue:i.K.minVizHeight,settings:{min:0,max:300,step:1},showIf:a=>a.sizing===e.T6.Manual&&(a.orientation===t.wV.Auto||a.orientation===t.wV.Horizontal)}).addSliderInput({path:"maxVizHeight",name:"Max height",description:"Maximum row height (horizontal orientation)",defaultValue:i.K.maxVizHeight,settings:{min:0,max:300,step:1},showIf:a=>a.sizing===e.T6.Manual&&(a.orientation===t.wV.Auto||a.orientation===t.wV.Horizontal)})}).setPanelChangeHandler(r.gl).setMigrationHandler(f).setSuggestionsSupplier(new v)}}]);

//# sourceMappingURL=barGaugePanel.1272d9c9098c53a4f260.js.map