All Downloads are FREE. Search and download functionalities are using the official Maven repository.

theme.keycloak.v2.admin.resources.assets.ClientSelect-ab12f3f6.js Maven / Gradle / Ivy

There is a newer version: 25.0.1
Show newest version
import{u as F,a as T,r as i,q as b,g as q,j as s,F as y,h as O,C as A}from"./index-0cda761d.js";import{S as E,a as L,b as x}from"./Select-68736f55.js";const _=({name:a,label:n,helpText:m,defaultValue:f,namespace:c,isDisabled:S=!1,required:u=!1})=>{const{t:r}=F(c),{control:j,formState:{errors:C}}=T(),[g,d]=i.useState(!1),[p,v]=i.useState([]),[o,I]=i.useState("");b(()=>{const e={max:20};return o&&(e.clientId=o,e.search=!0),q.clients.find(e)},e=>v(e),[o]);const h=e=>[s.jsx(x,{value:"",children:r("common:none")},"empty"),...e.map(t=>s.jsx(x,{value:t.clientId},t.id))];return s.jsx(y,{label:r(n),isRequired:u,labelIcon:s.jsx(O,{helpText:r(m),fieldLabelId:`${c}:${n}`}),fieldId:a,validated:C[a]?"error":"default",helperTextInvalid:r("common:required"),children:s.jsx(A,{name:a,defaultValue:f||"",control:j,rules:u?{required:!0}:{},render:({field:e})=>s.jsx(E,{toggleId:a,variant:L.typeahead,onToggle:t=>d(t),isOpen:g,isDisabled:S,selections:e.value,onFilter:(t,l)=>(I(l),h(p)),onSelect:(t,l)=>{e.onChange(l.toString()),d(!1)},typeAheadAriaLabel:r(n),children:h(p)})})})};export{_ as C};
//# sourceMappingURL=ClientSelect-ab12f3f6.js.map




© 2015 - 2024 Weber Informatics LLC | Privacy Policy