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

theme.keycloak.v2.admin.resources.assets.NewRealmForm-DgZ-NOmr.js Maven / Gradle / Ivy

There is a newer version: 26.0.7
Show newest version
import{jsxs as o,Fragment as w,jsx as e}from"react/jsx-runtime";import{useState as R}from"react";import{u as b,a as A,d as C,dt as S,e7 as y,f as V,g as x,P as D,F as E,y as N,A as T,h as k,i as I,Q as P,S as j,c6 as q}from"./main-C7ps2lmX.js";import{D as H}from"./SwitchControl-C_9Y74oV.js";import{F as J}from"./FormAccess-DyLNkc18.js";import{J as K}from"./JsonFileUpload-DGJ9M0nq.js";import{V as O}from"./ViewHeader-B7eeFzFA.js";import"react-dom";import"./copy-icon-ACZmDH8e.js";import"./FileUploadForm-BgyzQxBE.js";import"./FileUpload-CumNwlWc.js";import"./CodeEditor-C-nZkUJx.js";import"./EmptyStateFooter-DqmBOP2I.js";import"./EmptyStateActions-DWNUFByn.js";function re(){const{adminClient:n}=b(),{t:a}=A(),l=C(),{refresh:i,whoAmI:m}=S(),{refresh:c}=y(),{addAlert:d,addError:u}=V(),[h,f]=R(),s=x({mode:"onChange"}),{handleSubmit:p,setValue:v,formState:F}=s,g=r=>{const t={id:"",realm:"",enabled:!0};P(r||t,v),f(r||t)};return o(w,{children:[e(O,{titleKey:"createRealm",subKey:"realmExplain"}),e(D,{variant:"light",children:e(E,{...s,children:o(J,{isHorizontal:!0,onSubmit:p(async r=>{try{await n.realms.create({...h,...j(r)}),d(a("saveRealmSuccess")),i(),await c(),l(q({realm:r.realm}))}catch(t){u("saveRealmError",t)}}),role:"view-realm",isReadOnly:!m.canCreateRealm(),children:[e(K,{id:"kc-realm-filename",allowEditingUploadedText:!0,onChange:g}),e(N,{name:"realm",label:a("realmNameField"),rules:{required:a("required")}}),e(H,{name:"enabled",label:a("enabled"),defaultValue:!0}),o(T,{children:[e(k,{formState:F,allowInvalid:!0,allowNonDirty:!0,children:a("create")}),e(I,{variant:"link",onClick:()=>l(-1),children:a("cancel")})]})]})})})]})}export{re as default};
//# sourceMappingURL=NewRealmForm-DgZ-NOmr.js.map




© 2015 - 2025 Weber Informatics LLC | Privacy Policy