iconPanel.f9129614ef572cb76841.js 1.9 KB

12
  1. "use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[53],{94646:(t,e,i)=>{i.r(e),i.d(e,{plugin:()=>c});var s=i(43215),n=i(19735),o=i(36166),a=i(68404),d=i(66601),r=i(32924),h=i(48567),p=i(45916);function l(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class u extends a.Component{constructor(t){super(t),l(this,"element",void 0),l(this,"initElement",(t=>(this.element=new r.f(n.e,t.options.root),this.updateSize(t),this.element.updateData(this.dims),this.element))),l(this,"updateSize",(t=>{const{width:e,height:i}=t;this.element.options.constraint={vertical:d.fJ.Top,horizontal:d._5.Left},this.element.options.placement={left:0,top:0,width:e,height:i}})),l(this,"dims",{getColor:t=>(0,h.FP)(this.props.data,t),getScale:t=>(0,h.pb)(this.props.data,t),getScalar:t=>(0,h.z2)(this.props.data,t),getText:t=>(0,h.WO)(this.props.data,t),getResource:t=>(0,h.Qz)(this.props.data,t)}),this.element=this.initElement(t)}shouldComponentUpdate(t){var e,i;const{width:s,height:n,data:o}=this.props;let a=!1;return s===t.width&&n===t.height||(this.updateSize(t),a=!0),o!==t.data&&(this.element.updateData(this.dims),a=!0),(null===(e=this.props.options)||void 0===e?void 0:e.root)!==(null===(i=t.options)||void 0===i?void 0:i.root)&&(this.initElement(t),a=!0),a}render(){const{width:t,height:e}=this.props;return(0,p.jsx)("div",{style:{width:t,height:e,overflow:"hidden",position:"relative"},children:this.element.render()})}}const g={root:{config:{path:{mode:h.Q8.Fixed,fixed:"img/icons/unicons/analysis.svg"},fill:{fixed:"green"}}}},c=new s.PanelPlugin(u).setNoPadding().useFieldConfig({standardOptions:{[s.FieldConfigProperty.Mappings]:{settings:{icon:!0}}}}).setPanelOptions((t=>{t.addNestedOptions({category:["Icon"],path:"root",build:(t,e)=>{n.e.registerOptionsUI(t,e),o.I.addBackground(t,e),o.I.addBorder(t,e)},defaultValue:g.root})}))}}]);
  2. //# sourceMappingURL=iconPanel.f9129614ef572cb76841.js.map