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

theme.keycloak.v2.admin.resources.assets.SearchFilter-5d051f5f.js Maven / Gradle / Ivy

There is a newer version: 25.0.1
Show newest version
import{u as S,r as x,d as _,j as e,A as f,D as y,E as O,G as F}from"./index-0cda761d.js";import{g as w,c as D,d as T,b,A as g}from"./ClientScopeTypes-d24d11d6.js";import{S as h,b as j}from"./Select-68736f55.js";import{F as k}from"./filter-icon-56a9cd24.js";import{b as m}from"./ToolbarContent-fee3570e.js";const N=({clientId:s,selectedRows:o,refresh:d})=>{const{t:l}=S("client-scopes"),[r,i]=x.useState(!1),{addAlert:n,addError:p}=_();return e.jsx(h,{toggleId:"change-type-dropdown","aria-label":"change-type-to",isOpen:r,selections:[],isDisabled:o.length===0,placeholderText:l("changeTypeTo"),onToggle:i,onSelect:async(t,a)=>{try{await Promise.all(o.map(c=>s?w(s,c,c.type,a):D(c,a))),i(!1),d(),n(l("clientScopeSuccess"),f.success)}catch(c){p("clients:clientScopeError",c)}},children:T(l,s?void 0:b)})},C=["all","saml","openid-connect"],v=(s="")=>o=>o.name?.includes(s),G=s=>o=>s===g.none||o.type===s,L=s=>o=>s==="all"||o.protocol===s,u=({searchType:s,withProtocol:o=!1,onSelect:d})=>{const{t:l}=S("clients"),[r,i]=x.useState(!1),n=t=>e.jsx(F,{onClick:()=>{d(t),i(!1)},children:l(`clientScopeSearch.${t}`)},t),p=[n("name"),n("type")];return o&&p.push(n("protocol")),e.jsx(y,{className:"keycloak__client-scopes__searchtype",toggle:e.jsxs(O,{id:"toggle-id",onToggle:i,children:[e.jsx(k,{})," ",l(`clientScopeSearch.${s}`)]}),isOpen:r,dropdownItems:p})},R=({searchType:s,onSelect:o,type:d,onType:l,protocol:r,onProtocol:i})=>{const{t:n}=S("client-scopes"),[p,t]=x.useState(!1);return e.jsxs(e.Fragment,{children:[s==="type"&&e.jsxs(e.Fragment,{children:[e.jsx(m,{children:e.jsx(u,{searchType:s,onSelect:o,withProtocol:!!r})}),e.jsx(m,{children:e.jsxs(h,{className:"keycloak__client-scopes__searchtype",onToggle:t,isOpen:p,selections:[d===g.none?n("common:allTypes"):n(`common:clientScope.${d}`)],onSelect:(a,c)=>{l(c),t(!1)},children:[e.jsx(j,{value:g.none,children:n("common:allTypes")}),e.jsx(e.Fragment,{children:T(n)})]})})]}),s==="protocol"&&!!r&&e.jsxs(e.Fragment,{children:[e.jsx(m,{children:e.jsx(u,{searchType:s,onSelect:o,withProtocol:!0})}),e.jsx(m,{children:e.jsx(h,{className:"keycloak__client-scopes__searchtype",onToggle:t,isOpen:p,selections:[n(`protocolTypes.${r}`)],onSelect:(a,c)=>{i?.(c),t(!1)},children:C.map(a=>e.jsx(j,{value:a,children:n(`protocolTypes.${a}`)},a))})})]})]})};export{N as C,u as S,R as a,v as n,L as p,G as t};
//# sourceMappingURL=SearchFilter-5d051f5f.js.map




© 2015 - 2024 Weber Informatics LLC | Privacy Policy