"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[2317],{32317(b,o,e){e.d(o,{FormatStringTransfomerEditor:()=>c});var a=e(14553),l=e(55501),m=e(17727),d=e(59978),n=e(52358),i=e(72480),_=e(6634),E=e(87748),u=e(12592),f=e(38758);function c({input:O,options:t,onChange:s}){const M={settings:{width:30,filter:r=>r.type===m.PU.string,placeholderText:(0,n.t)("transformers.format-string-transfomer-editor.field-name-picker-settings.placeholderText.select-text-field","Select text field"),noFieldsMessage:(0,n.t)("transformers.format-string-transfomer-editor.field-name-picker-settings.noFieldsMessage.no-text-fields-found","No text fields found")},name:"",id:"",editor:()=>null},P=(0,l.useCallback)(r=>{s({...t,stringField:r??""})},[s,t]),D=(0,l.useCallback)(r=>{const g=r.value??d.gs.UpperCase;s({...t,outputFormat:g})},[s,t]),h=(0,l.useCallback)(r=>{s({...t,substringStart:r??0})},[s,t]),x=(0,l.useCallback)(r=>{s({...t,substringEnd:r??0})},[s,t]),C=Object.values(d.gs).map(r=>({label:r,value:r}));return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(_.C,{children:[(0,a.jsx)(i.I,{label:(0,n.t)("transformers.format-string-transfomer-editor.label-field","Field"),labelWidth:10,children:(0,a.jsx)(u.O,{context:{data:O},value:t.stringField??"",onChange:P,item:M})}),(0,a.jsx)(i.I,{label:(0,n.t)("transformers.format-string-transfomer-editor.label-format","Format"),labelWidth:10,children:(0,a.jsx)(E.l6,{options:C,value:t.outputFormat,onChange:D,width:20})})]}),t.outputFormat===d.gs.Substring&&(0,a.jsxs)(_.C,{children:[(0,a.jsx)(i.I,{label:(0,n.t)("transformers.format-string-transfomer-editor.label-substring-range","Substring range"),labelWidth:15,children:(0,a.jsx)(f.Q,{min:0,value:t.substringStart??0,onChange:h,width:7})}),(0,a.jsx)(i.I,{children:(0,a.jsx)(f.Q,{min:0,value:t.substringEnd??0,onChange:x,width:7})})]})]})}}}]);

//# sourceMappingURL=2317-react19.a2bc4fb759ab4d3dea94.js.map