"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[3561],{95942(g,E,r){r.d(E,{SortByTransformerEditor:()=>O});var e=r(74848),d=r(96540),s=r(52358),f=r(72396),n=r(72480),v=r(6634),m=r(87748),D=r(29798),M=r(75251);const O=({input:P,options:t,onChange:_})=>{const i=(0,M.ZI)(P).map(a=>({label:a,value:a})),c=(0,f.w)().getVariables().map(a=>({label:"$"+a.name,value:"$"+a.name})),o=(0,d.useCallback)((a,l)=>{_({...t,sort:[l]})},[_,t]),C=t.sort?.length?t.sort:[{}];return(0,e.jsx)("div",{children:C.map((a,l)=>(0,e.jsxs)(v.C,{children:[(0,e.jsx)(n.I,{label:(0,s.t)("transformers.sort-by-transformer-editor.label-field","Field"),labelWidth:10,grow:!0,children:(0,e.jsx)(m.l6,{options:[...i,...c],value:a.field,placeholder:(0,s.t)("transformers.sort-by-transformer-editor.placeholder-select-field","Select field"),onChange:u=>{o(l,{...a,field:u.value})}})}),(0,e.jsx)(n.I,{label:(0,s.t)("transformers.sort-by-transformer-editor.label-reverse","Reverse"),children:(0,e.jsx)(D.K,{value:!!a.desc,onChange:()=>{o(l,{...a,desc:!a.desc})}})})]},`${a.field}/${l}`))})}}}]);

//# sourceMappingURL=3561.f40add6e6ba0bfde9e41.js.map