@keycloak/keycloak-ui-shared 25.0.0 → 25.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/context/environment.d.ts +16 -7
- package/dist/keycloak-ui-shared.js +104 -104
- package/package.json +3 -3
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
/** The base environment variables that are shared between the Admin and Account Consoles. */
|
|
2
2
|
export type BaseEnvironment = {
|
|
3
3
|
/**
|
|
4
|
-
* The URL to the root of the Keycloak server, this is **NOT** always equivalent to the URL of the Admin Console.
|
|
5
|
-
* For example, the Keycloak server could be hosted on `auth.example.com` and Admin Console may be hosted on `admin.example.com`.
|
|
4
|
+
* The URL to the root of the Keycloak server, including the path if present, this is **NOT** always equivalent to the URL of the Admin Console.
|
|
5
|
+
* For example, the Keycloak server could be hosted on `auth.example.com` and Admin Console may be hosted on `admin.example.com/some/path`.
|
|
6
|
+
*
|
|
7
|
+
* Note that this URL is normalized not to include a trailing slash, so take this into account when constructing URLs.
|
|
6
8
|
*
|
|
7
9
|
* @see {@link https://www.keycloak.org/server/hostname#_administration_console}
|
|
8
10
|
*/
|
|
9
|
-
|
|
11
|
+
serverBaseUrl: string;
|
|
10
12
|
/** The identifier of the realm used to authenticate the user. */
|
|
11
13
|
realm: string;
|
|
12
14
|
/** The identifier of the client used to authenticate the user. */
|
|
@@ -19,9 +21,16 @@ export type BaseEnvironment = {
|
|
|
19
21
|
logoUrl: string;
|
|
20
22
|
};
|
|
21
23
|
/**
|
|
22
|
-
*
|
|
23
|
-
* These variables are injected by Keycloak into the `index.ftl` as a script tag, the contents of which can be parsed as JSON.
|
|
24
|
+
* Extracts the environment variables from the document, these variables are injected by Keycloak as a script tag, the contents of which can be parsed as JSON. For example:
|
|
24
25
|
*
|
|
25
|
-
|
|
26
|
+
*```html
|
|
27
|
+
* <script id="environment" type="application/json">
|
|
28
|
+
* {
|
|
29
|
+
* "realm": "master",
|
|
30
|
+
* "clientId": "security-admin-console",
|
|
31
|
+
* "etc": "..."
|
|
32
|
+
* }
|
|
33
|
+
* </script>
|
|
34
|
+
* ```
|
|
26
35
|
*/
|
|
27
|
-
export declare function getInjectedEnvironment<T>(
|
|
36
|
+
export declare function getInjectedEnvironment<T>(): T;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsxs as v, jsx as t, Fragment as Y } from "react/jsx-runtime";
|
|
2
|
-
import { AlertGroup as tt, Alert as nt, AlertVariant as re, AlertActionCloseButton as rt, Page as lt, Modal as Pe, ModalVariant as at, Button as
|
|
3
|
-
import { createContext as ye, useContext as ve, useState as T, useCallback as He, useEffect as be, useMemo as P, useRef as ee, forwardRef as
|
|
2
|
+
import { AlertGroup as tt, Alert as nt, AlertVariant as re, AlertActionCloseButton as rt, Page as lt, Modal as Pe, ModalVariant as at, Button as R, TextContent as it, Text as ae, TextVariants as st, Spinner as ot, FormHelperText as ue, HelperText as he, HelperTextItem as me, Popover as ct, Icon as ie, FormGroup as Ve, NumberInput as dt, ValidatedOptions as M, InputGroup as pe, InputGroupItem as se, TextInput as Q, Select as X, MenuToggle as W, MenuToggleStatus as fe, SelectList as Z, SelectOption as ge, TextInputGroup as Me, TextInputGroupMain as Ne, ChipGroup as qe, Chip as Be, TextInputGroupUtilities as Le, Switch as ut, TextArea as _e, Title as ht, Card as mt, CardHeader as pt, CardTitle as ft, CardBody as gt, Grid as yt, GridItem as xe, PageSection as vt, JumpLinks as bt, JumpLinksItem as Ct, ButtonVariant as we, Checkbox as It, Radio as kt, MenuFooter as xt, Dropdown as wt, DropdownList as At, DropdownItem as Ae, Brand as Tt, Avatar as St } from "@patternfly/react-core";
|
|
3
|
+
import { createContext as ye, useContext as ve, useState as T, useCallback as He, useEffect as be, useMemo as P, useRef as ee, forwardRef as Ot, useId as Ft, Fragment as Ue, Children as $e } from "react";
|
|
4
4
|
import { useTranslation as Ce } from "react-i18next";
|
|
5
|
-
import
|
|
6
|
-
import { ExclamationCircleIcon as
|
|
5
|
+
import Et from "keycloak-js";
|
|
6
|
+
import { ExclamationCircleIcon as Rt, HelpIcon as Te, EyeIcon as Dt, EyeSlashIcon as Pt, TimesIcon as Ge, CubeIcon as Vt, PaypalIcon as Mt, InstagramIcon as Nt, BitbucketIcon as qt, MicrosoftIcon as Bt, TwitterIcon as Lt, StackOverflowIcon as _t, OpenshiftIcon as Ht, LinkedinIcon as Ut, GoogleIcon as $t, GitlabIcon as Gt, FacebookSquareIcon as Wt, GithubIcon as Kt, MinusCircleIcon as jt, PlusCircleIcon as zt, EllipsisVIcon as Jt } from "@patternfly/react-icons";
|
|
7
7
|
import { useFormContext as te, Controller as U, useController as Ie, FormProvider as Yt, useWatch as Qt } from "react-hook-form";
|
|
8
8
|
import { get as G } from "lodash-es";
|
|
9
9
|
import { PageHeader as Xt, PageHeaderTools as Zt, PageHeaderToolsGroup as en, PageHeaderToolsItem as le } from "@patternfly/react-core/deprecated";
|
|
@@ -62,7 +62,7 @@ import './main.css';const We = ye(void 0), rr = () => ve(We), nn = ({ children:
|
|
|
62
62
|
showClose: !1,
|
|
63
63
|
isOpen: !0,
|
|
64
64
|
actions: [
|
|
65
|
-
/* @__PURE__ */ t(
|
|
65
|
+
/* @__PURE__ */ t(R, { variant: "primary", onClick: a, children: n("tryAgain") }, "tryAgain")
|
|
66
66
|
],
|
|
67
67
|
children: /* @__PURE__ */ v(it, { children: [
|
|
68
68
|
/* @__PURE__ */ t(ae, { children: n("somethingWentWrongDescription") }),
|
|
@@ -141,8 +141,8 @@ const lr = () => {
|
|
|
141
141
|
}) => {
|
|
142
142
|
oe = mn();
|
|
143
143
|
const r = ee(!1), [l, a] = T(!1), [i, s] = T(), c = P(() => {
|
|
144
|
-
const o = new
|
|
145
|
-
url: e.
|
|
144
|
+
const o = new Et({
|
|
145
|
+
url: e.serverBaseUrl,
|
|
146
146
|
realm: e.realm,
|
|
147
147
|
clientId: e.clientId
|
|
148
148
|
});
|
|
@@ -158,15 +158,15 @@ const lr = () => {
|
|
|
158
158
|
}).then(() => a(!0)).catch((d) => s(d)), r.current = !0;
|
|
159
159
|
}, [c]), i ? /* @__PURE__ */ t(rn, { error: i }) : l ? /* @__PURE__ */ t(oe.Provider, { value: { environment: e, keycloak: c }, children: /* @__PURE__ */ t(nn, { children: /* @__PURE__ */ t(hn, { children: n }) }) }) : /* @__PURE__ */ t(ot, {});
|
|
160
160
|
};
|
|
161
|
-
function ir(
|
|
162
|
-
const n = document.getElementById("environment");
|
|
163
|
-
|
|
161
|
+
function ir() {
|
|
162
|
+
const n = document.getElementById("environment")?.textContent;
|
|
163
|
+
if (typeof n != "string")
|
|
164
|
+
throw new Error("Environment variables not found in the document.");
|
|
164
165
|
try {
|
|
165
|
-
|
|
166
|
+
return JSON.parse(n);
|
|
166
167
|
} catch {
|
|
167
|
-
|
|
168
|
+
throw new Error("Unable to parse environment variables as JSON.");
|
|
168
169
|
}
|
|
169
|
-
return { ...e, ...r };
|
|
170
170
|
}
|
|
171
171
|
const sr = ({
|
|
172
172
|
modalTitle: e,
|
|
@@ -177,7 +177,7 @@ const sr = ({
|
|
|
177
177
|
buttonVariant: i,
|
|
178
178
|
buttonTestRole: s,
|
|
179
179
|
onContinue: c,
|
|
180
|
-
component: o =
|
|
180
|
+
component: o = R,
|
|
181
181
|
children: d,
|
|
182
182
|
...m
|
|
183
183
|
}) => {
|
|
@@ -203,7 +203,7 @@ const sr = ({
|
|
|
203
203
|
onClose: () => h(!1),
|
|
204
204
|
actions: [
|
|
205
205
|
/* @__PURE__ */ t(
|
|
206
|
-
|
|
206
|
+
R,
|
|
207
207
|
{
|
|
208
208
|
id: "modal-confirm",
|
|
209
209
|
variant: "primary",
|
|
@@ -215,7 +215,7 @@ const sr = ({
|
|
|
215
215
|
"confirm"
|
|
216
216
|
),
|
|
217
217
|
/* @__PURE__ */ t(
|
|
218
|
-
|
|
218
|
+
R,
|
|
219
219
|
{
|
|
220
220
|
id: "modal-cancel",
|
|
221
221
|
variant: "secondary",
|
|
@@ -229,7 +229,7 @@ const sr = ({
|
|
|
229
229
|
}
|
|
230
230
|
)
|
|
231
231
|
] });
|
|
232
|
-
}, je = ({ message: e, ...n }) => /* @__PURE__ */ t(ue, { ...n, children: /* @__PURE__ */ t(he, { children: /* @__PURE__ */ t(me, { icon: /* @__PURE__ */ t(
|
|
232
|
+
}, je = ({ message: e, ...n }) => /* @__PURE__ */ t(ue, { ...n, children: /* @__PURE__ */ t(he, { children: /* @__PURE__ */ t(me, { icon: /* @__PURE__ */ t(Rt, {}), variant: "error", children: e }) }) }), ze = ({
|
|
233
233
|
helpText: e,
|
|
234
234
|
fieldLabelId: n,
|
|
235
235
|
noVerticalAlign: r = !0,
|
|
@@ -334,16 +334,16 @@ const sr = ({
|
|
|
334
334
|
}
|
|
335
335
|
) }),
|
|
336
336
|
e && /* @__PURE__ */ t(
|
|
337
|
-
|
|
337
|
+
R,
|
|
338
338
|
{
|
|
339
339
|
variant: "control",
|
|
340
340
|
"aria-label": l("showPassword"),
|
|
341
341
|
onClick: () => i(!a),
|
|
342
|
-
children: a ? /* @__PURE__ */ t(
|
|
342
|
+
children: a ? /* @__PURE__ */ t(Dt, {}) : /* @__PURE__ */ t(Pt, {})
|
|
343
343
|
}
|
|
344
344
|
)
|
|
345
345
|
] });
|
|
346
|
-
}, Je =
|
|
346
|
+
}, Je = Ot(
|
|
347
347
|
(e, n) => /* @__PURE__ */ t(pn, { ...e, innerRef: n })
|
|
348
348
|
);
|
|
349
349
|
Je.displayName = "PasswordInput";
|
|
@@ -433,7 +433,7 @@ const cr = (e) => {
|
|
|
433
433
|
y(Array.isArray(h) ? [g] : g), m(!1);
|
|
434
434
|
},
|
|
435
435
|
isOpen: d,
|
|
436
|
-
children: /* @__PURE__ */ t(Z, { children: l.map((u) => /* @__PURE__ */ t(ge, { value:
|
|
436
|
+
children: /* @__PURE__ */ t(Z, { children: l.map((u) => /* @__PURE__ */ t(ge, { value: B(u), children: ke(u) ? u : u.value }, B(u))) })
|
|
437
437
|
}
|
|
438
438
|
)
|
|
439
439
|
}
|
|
@@ -455,17 +455,17 @@ const cr = (e) => {
|
|
|
455
455
|
const {
|
|
456
456
|
control: m,
|
|
457
457
|
formState: { errors: y }
|
|
458
|
-
} = te(), [h, u] = T(!1), [x, g] = T(""), [f, w] = T(0),
|
|
458
|
+
} = te(), [h, u] = T(!1), [x, g] = T(""), [f, w] = T(0), D = ee(), C = l.filter(
|
|
459
459
|
(p) => z(p).toLowerCase().startsWith(x.toLowerCase())
|
|
460
460
|
), b = P(
|
|
461
461
|
() => C.map((p, I) => /* @__PURE__ */ t(
|
|
462
462
|
ge,
|
|
463
463
|
{
|
|
464
|
-
value:
|
|
464
|
+
value: B(p),
|
|
465
465
|
isFocused: f === I,
|
|
466
466
|
children: z(p)
|
|
467
467
|
},
|
|
468
|
-
|
|
468
|
+
B(p)
|
|
469
469
|
)),
|
|
470
470
|
[f, C]
|
|
471
471
|
), q = (p, I) => {
|
|
@@ -473,7 +473,7 @@ const cr = (e) => {
|
|
|
473
473
|
switch (u(!0), p.key) {
|
|
474
474
|
case "Enter": {
|
|
475
475
|
p.preventDefault(), o !== H.typeaheadMulti ? g(z(A)) : g(""), I.onChange(
|
|
476
|
-
Array.isArray(I.value) ? [...I.value,
|
|
476
|
+
Array.isArray(I.value) ? [...I.value, B(A)] : B(A)
|
|
477
477
|
), u(!1), w(0);
|
|
478
478
|
break;
|
|
479
479
|
}
|
|
@@ -542,18 +542,18 @@ const cr = (e) => {
|
|
|
542
542
|
},
|
|
543
543
|
onKeyDown: (A) => q(A, p),
|
|
544
544
|
autoComplete: "off",
|
|
545
|
-
innerRef:
|
|
545
|
+
innerRef: D,
|
|
546
546
|
role: "combobox",
|
|
547
547
|
isExpanded: h,
|
|
548
548
|
"aria-controls": "select-typeahead-listbox",
|
|
549
549
|
children: o === H.typeaheadMulti && Array.isArray(p.value) && /* @__PURE__ */ t(qe, { "aria-label": "Current selections", children: p.value.map(
|
|
550
550
|
(A, k) => /* @__PURE__ */ t(
|
|
551
|
-
|
|
551
|
+
Be,
|
|
552
552
|
{
|
|
553
553
|
onClick: (S) => {
|
|
554
554
|
S.stopPropagation(), p.onChange(
|
|
555
555
|
p.value.filter(
|
|
556
|
-
(
|
|
556
|
+
(O) => O !== B(A)
|
|
557
557
|
)
|
|
558
558
|
);
|
|
559
559
|
},
|
|
@@ -564,12 +564,12 @@ const cr = (e) => {
|
|
|
564
564
|
) })
|
|
565
565
|
}
|
|
566
566
|
),
|
|
567
|
-
/* @__PURE__ */ t(
|
|
568
|
-
|
|
567
|
+
/* @__PURE__ */ t(Le, { children: !!x && /* @__PURE__ */ t(
|
|
568
|
+
R,
|
|
569
569
|
{
|
|
570
570
|
variant: "plain",
|
|
571
571
|
onClick: () => {
|
|
572
|
-
p.onChange(void 0), g(""),
|
|
572
|
+
p.onChange(void 0), g(""), D?.current?.focus();
|
|
573
573
|
},
|
|
574
574
|
"aria-label": "Clear input value",
|
|
575
575
|
children: /* @__PURE__ */ t(Ge, { "aria-hidden": !0 })
|
|
@@ -595,7 +595,7 @@ const cr = (e) => {
|
|
|
595
595
|
);
|
|
596
596
|
};
|
|
597
597
|
var H = /* @__PURE__ */ ((e) => (e.single = "single", e.typeahead = "typeahead", e.typeaheadMulti = "typeaheadMulti", e))(H || {});
|
|
598
|
-
const $ = (e) => typeof e[0] != "string", ke = (e) => typeof e == "string",
|
|
598
|
+
const $ = (e) => typeof e[0] != "string", ke = (e) => typeof e == "string", B = (e) => ke(e) ? e : e.key, yn = ({
|
|
599
599
|
variant: e = "single",
|
|
600
600
|
...n
|
|
601
601
|
}) => e === "single" ? /* @__PURE__ */ t(fn, { ...n }) : /* @__PURE__ */ t(gn, { ...n, variant: e }), dr = ({
|
|
@@ -717,9 +717,9 @@ function bn(e) {
|
|
|
717
717
|
case "stackoverflow":
|
|
718
718
|
return _t;
|
|
719
719
|
case "twitter":
|
|
720
|
-
return Bt;
|
|
721
|
-
case "microsoft":
|
|
722
720
|
return Lt;
|
|
721
|
+
case "microsoft":
|
|
722
|
+
return Bt;
|
|
723
723
|
case "bitbucket":
|
|
724
724
|
return qt;
|
|
725
725
|
case "instagram":
|
|
@@ -755,7 +755,7 @@ const Cn = "_title_180i0_2", In = {
|
|
|
755
755
|
scrollId: r,
|
|
756
756
|
className: l
|
|
757
757
|
}) => {
|
|
758
|
-
const a =
|
|
758
|
+
const a = Ft();
|
|
759
759
|
return /* @__PURE__ */ v(mt, { id: a, className: l, isFlat: !0, children: [
|
|
760
760
|
/* @__PURE__ */ t(pt, { className: "kc-form-panel__header", children: /* @__PURE__ */ t(ft, { tabIndex: 0, children: /* @__PURE__ */ t(Ye, { id: r, title: e }) }) }),
|
|
761
761
|
/* @__PURE__ */ t(gt, { className: "kc-form-panel__body", children: n })
|
|
@@ -769,7 +769,7 @@ const Cn = "_title_180i0_2", In = {
|
|
|
769
769
|
}, wn = "_panel_1cdve_1", An = "_sticky_1cdve_5", Se = {
|
|
770
770
|
panel: wn,
|
|
771
771
|
sticky: An
|
|
772
|
-
}, Tn = "kc-main-content-page-container",
|
|
772
|
+
}, Tn = "kc-main-content-page-container", Oe = (e) => e.replace(/\s+/g, "-"), Sn = ({
|
|
773
773
|
label: e,
|
|
774
774
|
sections: n,
|
|
775
775
|
borders: r = !1,
|
|
@@ -781,7 +781,7 @@ const Cn = "_title_180i0_2", In = {
|
|
|
781
781
|
);
|
|
782
782
|
return /* @__PURE__ */ v(yt, { hasGutter: !0, ...l, children: [
|
|
783
783
|
/* @__PURE__ */ t(xe, { md: 8, sm: 12, children: a.map(({ title: i, panel: s }) => {
|
|
784
|
-
const c =
|
|
784
|
+
const c = Oe(i.toLowerCase());
|
|
785
785
|
return /* @__PURE__ */ t(Ue, { children: r ? /* @__PURE__ */ t(
|
|
786
786
|
kn,
|
|
787
787
|
{
|
|
@@ -800,7 +800,7 @@ const Cn = "_title_180i0_2", In = {
|
|
|
800
800
|
label: e,
|
|
801
801
|
offset: 100,
|
|
802
802
|
children: a.map(({ title: i }) => {
|
|
803
|
-
const s =
|
|
803
|
+
const s = Oe(i.toLowerCase());
|
|
804
804
|
return (
|
|
805
805
|
// note that JumpLinks currently does not work with spaces in the href
|
|
806
806
|
/* @__PURE__ */ t(
|
|
@@ -817,7 +817,7 @@ const Cn = "_title_180i0_2", In = {
|
|
|
817
817
|
}
|
|
818
818
|
) }) })
|
|
819
819
|
] });
|
|
820
|
-
},
|
|
820
|
+
}, On = (e, n, r) => (e.isValid || r) && (e.isDirty || n) && !e.isLoading && !e.isValidating && !e.isSubmitting, pr = ({
|
|
821
821
|
formState: e,
|
|
822
822
|
isDisabled: n = !1,
|
|
823
823
|
allowInvalid: r = !1,
|
|
@@ -825,21 +825,21 @@ const Cn = "_title_180i0_2", In = {
|
|
|
825
825
|
children: a,
|
|
826
826
|
...i
|
|
827
827
|
}) => /* @__PURE__ */ t(
|
|
828
|
-
|
|
828
|
+
R,
|
|
829
829
|
{
|
|
830
830
|
variant: "primary",
|
|
831
|
-
isDisabled: e && !
|
|
831
|
+
isDisabled: e && !On(e, l, r) || n,
|
|
832
832
|
...i,
|
|
833
833
|
type: "submit",
|
|
834
834
|
children: a
|
|
835
835
|
}
|
|
836
|
-
),
|
|
836
|
+
), Fn = (e) => {
|
|
837
837
|
try {
|
|
838
838
|
return new Intl.DisplayNames([e], { type: "language" }).of(e);
|
|
839
839
|
} catch {
|
|
840
840
|
return e;
|
|
841
841
|
}
|
|
842
|
-
},
|
|
842
|
+
}, En = ({
|
|
843
843
|
t: e,
|
|
844
844
|
form: n,
|
|
845
845
|
supportedLocales: r,
|
|
@@ -848,7 +848,7 @@ const Cn = "_title_180i0_2", In = {
|
|
|
848
848
|
const a = P(
|
|
849
849
|
() => r.map((i) => ({
|
|
850
850
|
key: i,
|
|
851
|
-
value: e(`locale_${i}`,
|
|
851
|
+
value: e(`locale_${i}`, Fn(i) ?? i)
|
|
852
852
|
})).sort((i, s) => i.value.localeCompare(s.value, l)),
|
|
853
853
|
[r, l, e]
|
|
854
854
|
);
|
|
@@ -863,7 +863,7 @@ const Cn = "_title_180i0_2", In = {
|
|
|
863
863
|
variant: a.length >= 10 ? "typeahead" : "single"
|
|
864
864
|
}
|
|
865
865
|
) }) : null;
|
|
866
|
-
}, Qe = (e) => e?.includes("${"), Xe = (e) => e.substring(2, e.length - 1),
|
|
866
|
+
}, Qe = (e) => e?.includes("${"), Xe = (e) => e.substring(2, e.length - 1), L = (e, n, r) => (Qe(n) ? e(Xe(n)) : n) || r, ce = (e, n) => L(e, n.displayName, n.name), Rn = ["username", "firstName", "lastName", "email"], Ze = (e) => e && Rn.includes(e), N = (e) => `${Ze(e) ? "" : "attributes."}${e?.replaceAll(
|
|
867
867
|
".",
|
|
868
868
|
"🍺"
|
|
869
869
|
)}`, fr = (e) => e.replaceAll(".", "🍺"), gr = (e) => e.replaceAll("🍺", ".");
|
|
@@ -886,18 +886,18 @@ function ne({
|
|
|
886
886
|
required: e,
|
|
887
887
|
validators: n
|
|
888
888
|
}) {
|
|
889
|
-
return e ||
|
|
889
|
+
return e || Dn(n);
|
|
890
890
|
}
|
|
891
|
-
function
|
|
891
|
+
function Dn(e) {
|
|
892
892
|
return e && "length" in e && "min" in e.length && typeof e.length.min == "number" ? e.length.min > 0 : !1;
|
|
893
893
|
}
|
|
894
894
|
function vr(e) {
|
|
895
895
|
if (typeof e != "object" || e === null || !("responseData" in e))
|
|
896
896
|
return !1;
|
|
897
897
|
const { responseData: n } = e;
|
|
898
|
-
return
|
|
898
|
+
return Fe(n) ? !0 : typeof n != "object" || n === null || !("errors" in n) || !Array.isArray(n.errors) ? !1 : n.errors.every(Fe);
|
|
899
899
|
}
|
|
900
|
-
function
|
|
900
|
+
function Fe(e) {
|
|
901
901
|
return !(typeof e != "object" || e === null || !("field" in e) || typeof e.field != "string" || !("errorMessage" in e) || typeof e.errorMessage != "string");
|
|
902
902
|
}
|
|
903
903
|
const K = ({
|
|
@@ -907,7 +907,7 @@ const K = ({
|
|
|
907
907
|
renderer: l,
|
|
908
908
|
children: a
|
|
909
909
|
}) => {
|
|
910
|
-
const i =
|
|
910
|
+
const i = L(
|
|
911
911
|
e,
|
|
912
912
|
r.annotations?.inputHelperTextBefore
|
|
913
913
|
), {
|
|
@@ -980,7 +980,7 @@ const K = ({
|
|
|
980
980
|
m(n, b, {
|
|
981
981
|
shouldDirty: !0
|
|
982
982
|
});
|
|
983
|
-
},
|
|
983
|
+
}, D = r.startsWith("html") ? r.substring(6) : "text";
|
|
984
984
|
return be(() => {
|
|
985
985
|
d(n);
|
|
986
986
|
}, [d]), /* @__PURE__ */ t("div", { id: c, children: u.map((C, b) => /* @__PURE__ */ v(Ue, { children: [
|
|
@@ -993,12 +993,12 @@ const K = ({
|
|
|
993
993
|
name: `${n}.${b}.value`,
|
|
994
994
|
value: C,
|
|
995
995
|
isDisabled: i,
|
|
996
|
-
type:
|
|
996
|
+
type: D,
|
|
997
997
|
...o
|
|
998
998
|
}
|
|
999
999
|
) }),
|
|
1000
1000
|
/* @__PURE__ */ t(se, { children: /* @__PURE__ */ t(
|
|
1001
|
-
|
|
1001
|
+
R,
|
|
1002
1002
|
{
|
|
1003
1003
|
"data-testid": "remove" + b,
|
|
1004
1004
|
variant: we.link,
|
|
@@ -1011,7 +1011,7 @@ const K = ({
|
|
|
1011
1011
|
) })
|
|
1012
1012
|
] }),
|
|
1013
1013
|
b === u.length - 1 && /* @__PURE__ */ v(
|
|
1014
|
-
|
|
1014
|
+
R,
|
|
1015
1015
|
{
|
|
1016
1016
|
variant: we.link,
|
|
1017
1017
|
onClick: g,
|
|
@@ -1027,7 +1027,7 @@ const K = ({
|
|
|
1027
1027
|
}
|
|
1028
1028
|
)
|
|
1029
1029
|
] }, b)) });
|
|
1030
|
-
},
|
|
1030
|
+
}, Ee = (e) => {
|
|
1031
1031
|
const { form: n, inputType: r, attribute: l } = e, a = ne(l), i = r.startsWith("multiselect"), s = i ? It : kt, c = l.validators?.options?.options || [], o = l.annotations?.inputOptionLabels || {};
|
|
1032
1032
|
return /* @__PURE__ */ t(K, { ...e, children: /* @__PURE__ */ t(
|
|
1033
1033
|
U,
|
|
@@ -1040,7 +1040,7 @@ const K = ({
|
|
|
1040
1040
|
{
|
|
1041
1041
|
id: m,
|
|
1042
1042
|
"data-testid": m,
|
|
1043
|
-
label:
|
|
1043
|
+
label: L(e.t, o[m], m),
|
|
1044
1044
|
value: m,
|
|
1045
1045
|
isChecked: d.value.includes(m),
|
|
1046
1046
|
onChange: () => {
|
|
@@ -1072,7 +1072,7 @@ const K = ({
|
|
|
1072
1072
|
}) => {
|
|
1073
1073
|
const [u, x] = T(!1), g = ee(), f = () => {
|
|
1074
1074
|
x(!u), n(!u);
|
|
1075
|
-
}, w = () => i === "parent" && g.current?.parentElement || "inline",
|
|
1075
|
+
}, w = () => i === "parent" && g.current?.parentElement || "inline", D = $e.toArray(
|
|
1076
1076
|
y
|
|
1077
1077
|
);
|
|
1078
1078
|
return /* @__PURE__ */ t(
|
|
@@ -1104,7 +1104,7 @@ const K = ({
|
|
|
1104
1104
|
"aria-label": h["aria-label"],
|
|
1105
1105
|
icon: d,
|
|
1106
1106
|
isFullWidth: !0,
|
|
1107
|
-
children:
|
|
1107
|
+
children: D.find((b) => b.props.value === l)?.props.children || l || h["aria-label"]
|
|
1108
1108
|
}
|
|
1109
1109
|
),
|
|
1110
1110
|
isOpen: a,
|
|
@@ -1131,15 +1131,15 @@ const K = ({
|
|
|
1131
1131
|
children: f,
|
|
1132
1132
|
...w
|
|
1133
1133
|
}) => {
|
|
1134
|
-
const [
|
|
1134
|
+
const [D, C] = T(""), [b, q] = T(0), p = ee(), I = $e.toArray(
|
|
1135
1135
|
f
|
|
1136
1136
|
), A = () => {
|
|
1137
1137
|
r?.(!w.isOpen);
|
|
1138
1138
|
}, k = (S) => {
|
|
1139
|
-
const
|
|
1139
|
+
const O = I[b];
|
|
1140
1140
|
switch (r?.(!0), S.key) {
|
|
1141
1141
|
case "Enter": {
|
|
1142
|
-
S.preventDefault(), a !== V.typeaheadMulti ? C(
|
|
1142
|
+
S.preventDefault(), a !== V.typeaheadMulti ? C(O.props.value) : C(""), n?.(O.props.value), r?.(!1), q(0);
|
|
1143
1143
|
break;
|
|
1144
1144
|
}
|
|
1145
1145
|
case "Escape": {
|
|
@@ -1153,8 +1153,8 @@ const K = ({
|
|
|
1153
1153
|
case "ArrowUp":
|
|
1154
1154
|
case "ArrowDown": {
|
|
1155
1155
|
S.preventDefault();
|
|
1156
|
-
let
|
|
1157
|
-
S.key === "ArrowUp" && (b === 0 ?
|
|
1156
|
+
let F = 0;
|
|
1157
|
+
S.key === "ArrowUp" && (b === 0 ? F = I.length - 1 : F = b - 1), S.key === "ArrowDown" && (b === I.length - 1 ? F = 0 : F = b + 1), q(F);
|
|
1158
1158
|
break;
|
|
1159
1159
|
}
|
|
1160
1160
|
}
|
|
@@ -1165,7 +1165,7 @@ const K = ({
|
|
|
1165
1165
|
...w,
|
|
1166
1166
|
onClick: A,
|
|
1167
1167
|
onOpenChange: () => r?.(!1),
|
|
1168
|
-
onSelect: (S,
|
|
1168
|
+
onSelect: (S, O) => n?.(O || ""),
|
|
1169
1169
|
maxMenuHeight: J(c),
|
|
1170
1170
|
popperProps: { direction: m, width: J(o) },
|
|
1171
1171
|
toggle: (S) => /* @__PURE__ */ t(
|
|
@@ -1184,32 +1184,32 @@ const K = ({
|
|
|
1184
1184
|
Ne,
|
|
1185
1185
|
{
|
|
1186
1186
|
placeholder: s,
|
|
1187
|
-
value: a === V.typeahead && y ? y :
|
|
1187
|
+
value: a === V.typeahead && y ? y : D,
|
|
1188
1188
|
onClick: A,
|
|
1189
|
-
onChange: (
|
|
1190
|
-
C(
|
|
1189
|
+
onChange: (O, F) => {
|
|
1190
|
+
C(F), l?.(F);
|
|
1191
1191
|
},
|
|
1192
|
-
onKeyDown: (
|
|
1192
|
+
onKeyDown: (O) => k(O),
|
|
1193
1193
|
autoComplete: "off",
|
|
1194
1194
|
innerRef: p,
|
|
1195
1195
|
role: "combobox",
|
|
1196
1196
|
isExpanded: w.isOpen,
|
|
1197
1197
|
"aria-controls": "select-typeahead-listbox",
|
|
1198
1198
|
"aria-label": h,
|
|
1199
|
-
children: a === V.typeaheadMulti && Array.isArray(y) && (u || /* @__PURE__ */ t(qe, { ...x, children: y.map((
|
|
1200
|
-
|
|
1199
|
+
children: a === V.typeaheadMulti && Array.isArray(y) && (u || /* @__PURE__ */ t(qe, { ...x, children: y.map((O, F) => /* @__PURE__ */ t(
|
|
1200
|
+
Be,
|
|
1201
1201
|
{
|
|
1202
1202
|
onClick: (et) => {
|
|
1203
|
-
et.stopPropagation(), n?.(
|
|
1203
|
+
et.stopPropagation(), n?.(O);
|
|
1204
1204
|
},
|
|
1205
|
-
children:
|
|
1205
|
+
children: O
|
|
1206
1206
|
},
|
|
1207
|
-
|
|
1207
|
+
F
|
|
1208
1208
|
)) }))
|
|
1209
1209
|
}
|
|
1210
1210
|
),
|
|
1211
|
-
/* @__PURE__ */ t(
|
|
1212
|
-
|
|
1211
|
+
/* @__PURE__ */ t(Le, { children: !!D && /* @__PURE__ */ t(
|
|
1212
|
+
R,
|
|
1213
1213
|
{
|
|
1214
1214
|
variant: "plain",
|
|
1215
1215
|
onClick: () => {
|
|
@@ -1233,10 +1233,10 @@ var V = /* @__PURE__ */ ((e) => (e.single = "single", e.typeahead = "typeahead",
|
|
|
1233
1233
|
const J = (e) => typeof e == "number" ? e + "px" : e, qn = ({
|
|
1234
1234
|
variant: e = "single",
|
|
1235
1235
|
...n
|
|
1236
|
-
}) => e === "single" ? /* @__PURE__ */ t(Mn, { ...n }) : /* @__PURE__ */ t(Nn, { ...n, variant: e }),
|
|
1236
|
+
}) => e === "single" ? /* @__PURE__ */ t(Mn, { ...n }) : /* @__PURE__ */ t(Nn, { ...n, variant: e }), Re = (e) => {
|
|
1237
1237
|
const { t: n, form: r, inputType: l, attribute: a } = e, [i, s] = T(!1), [c, o] = T(""), d = l === "multiselect", m = (g, f) => {
|
|
1238
1238
|
d ? f.value.includes(g) ? f.onChange(f.value.filter((w) => w !== g)) : Array.isArray(f.value) ? f.onChange([...f.value, g]) : f.onChange([g]) : f.onChange(g === f.value ? "" : g);
|
|
1239
|
-
}, y = a.validators?.options?.options || [], h = a.annotations?.inputOptionLabels || {}, u = (g) =>
|
|
1239
|
+
}, y = a.validators?.options?.options || [], h = a.annotations?.inputOptionLabels || {}, u = (g) => L(e.t, h[g], g), x = (g) => y.filter(
|
|
1240
1240
|
(f) => u(f).toLowerCase().includes(c.toLowerCase())
|
|
1241
1241
|
).map((f) => /* @__PURE__ */ t(
|
|
1242
1242
|
ge,
|
|
@@ -1274,7 +1274,7 @@ const J = (e) => typeof e == "number" ? e + "px" : e, qn = ({
|
|
|
1274
1274
|
)
|
|
1275
1275
|
}
|
|
1276
1276
|
) });
|
|
1277
|
-
},
|
|
1277
|
+
}, Bn = (e) => {
|
|
1278
1278
|
const { form: n, attribute: r } = e, l = ne(r);
|
|
1279
1279
|
return /* @__PURE__ */ t(K, { ...e, children: /* @__PURE__ */ t(
|
|
1280
1280
|
vn,
|
|
@@ -1288,7 +1288,7 @@ const J = (e) => typeof e == "number" ? e + "px" : e, qn = ({
|
|
|
1288
1288
|
isRequired: l
|
|
1289
1289
|
}
|
|
1290
1290
|
) });
|
|
1291
|
-
},
|
|
1291
|
+
}, E = (e) => {
|
|
1292
1292
|
const { form: n, inputType: r, attribute: l } = e, a = ne(l), i = r.startsWith("html") ? r.substring(6) : "text";
|
|
1293
1293
|
return /* @__PURE__ */ t(K, { ...e, children: /* @__PURE__ */ t(
|
|
1294
1294
|
Q,
|
|
@@ -1296,7 +1296,7 @@ const J = (e) => typeof e == "number" ? e + "px" : e, qn = ({
|
|
|
1296
1296
|
id: l.name,
|
|
1297
1297
|
"data-testid": l.name,
|
|
1298
1298
|
type: i,
|
|
1299
|
-
placeholder:
|
|
1299
|
+
placeholder: L(
|
|
1300
1300
|
e.t,
|
|
1301
1301
|
l.annotations?.inputTypePlaceholder
|
|
1302
1302
|
),
|
|
@@ -1306,21 +1306,21 @@ const J = (e) => typeof e == "number" ? e + "px" : e, qn = ({
|
|
|
1306
1306
|
}
|
|
1307
1307
|
) });
|
|
1308
1308
|
}, de = {
|
|
1309
|
-
text:
|
|
1310
|
-
textarea:
|
|
1311
|
-
select:
|
|
1312
|
-
"select-radiobuttons":
|
|
1313
|
-
multiselect:
|
|
1314
|
-
"multiselect-checkboxes":
|
|
1315
|
-
"html5-email":
|
|
1316
|
-
"html5-tel":
|
|
1317
|
-
"html5-url":
|
|
1318
|
-
"html5-number":
|
|
1319
|
-
"html5-range":
|
|
1320
|
-
"html5-datetime-local":
|
|
1321
|
-
"html5-date":
|
|
1322
|
-
"html5-month":
|
|
1323
|
-
"html5-time":
|
|
1309
|
+
text: E,
|
|
1310
|
+
textarea: Bn,
|
|
1311
|
+
select: Re,
|
|
1312
|
+
"select-radiobuttons": Ee,
|
|
1313
|
+
multiselect: Re,
|
|
1314
|
+
"multiselect-checkboxes": Ee,
|
|
1315
|
+
"html5-email": E,
|
|
1316
|
+
"html5-tel": E,
|
|
1317
|
+
"html5-url": E,
|
|
1318
|
+
"html5-number": E,
|
|
1319
|
+
"html5-range": E,
|
|
1320
|
+
"html5-datetime-local": E,
|
|
1321
|
+
"html5-date": E,
|
|
1322
|
+
"html5-month": E,
|
|
1323
|
+
"html5-time": E,
|
|
1324
1324
|
"multi-input": Pn
|
|
1325
1325
|
}, br = ({
|
|
1326
1326
|
t: e,
|
|
@@ -1355,11 +1355,11 @@ const J = (e) => typeof e == "number" ? e + "px" : e, qn = ({
|
|
|
1355
1355
|
{
|
|
1356
1356
|
label: e("jumpToSection"),
|
|
1357
1357
|
sections: c.filter((o) => o.attributes.length > 0).map(({ group: o, attributes: d }) => ({
|
|
1358
|
-
title:
|
|
1358
|
+
title: L(e, o.displayHeader, o.name) || e("general"),
|
|
1359
1359
|
panel: /* @__PURE__ */ v("div", { className: "pf-v5-c-form", children: [
|
|
1360
|
-
o.displayDescription && /* @__PURE__ */ t(ae, { className: "pf-v5-u-pb-lg", children:
|
|
1360
|
+
o.displayDescription && /* @__PURE__ */ t(ae, { className: "pf-v5-u-pb-lg", children: L(e, o.displayDescription, "") }),
|
|
1361
1361
|
d.map((m) => /* @__PURE__ */ t(
|
|
1362
|
-
|
|
1362
|
+
Ln,
|
|
1363
1363
|
{
|
|
1364
1364
|
t: e,
|
|
1365
1365
|
form: n,
|
|
@@ -1374,7 +1374,7 @@ const J = (e) => typeof e == "number" ? e + "px" : e, qn = ({
|
|
|
1374
1374
|
}))
|
|
1375
1375
|
}
|
|
1376
1376
|
);
|
|
1377
|
-
},
|
|
1377
|
+
}, Ln = ({
|
|
1378
1378
|
t: e,
|
|
1379
1379
|
form: n,
|
|
1380
1380
|
renderer: r,
|
|
@@ -1386,7 +1386,7 @@ const J = (e) => typeof e == "number" ? e + "px" : e, qn = ({
|
|
|
1386
1386
|
N(i.name)
|
|
1387
1387
|
), c = P(() => Hn(i), [i]), o = i.multivalued || $n(s) && i.annotations?.inputType === void 0 ? de["multi-input"] : de[c];
|
|
1388
1388
|
return i.name === "locale" ? /* @__PURE__ */ t(
|
|
1389
|
-
|
|
1389
|
+
En,
|
|
1390
1390
|
{
|
|
1391
1391
|
form: n,
|
|
1392
1392
|
supportedLocales: l,
|
|
@@ -1531,7 +1531,7 @@ const Un = (e) => typeof e == "string" && e in de, $n = (e) => Array.isArray(e)
|
|
|
1531
1531
|
] }) })
|
|
1532
1532
|
]
|
|
1533
1533
|
}
|
|
1534
|
-
),
|
|
1534
|
+
), De = ({
|
|
1535
1535
|
isKebab: e = !1,
|
|
1536
1536
|
title: n,
|
|
1537
1537
|
dropDownItems: r,
|
|
@@ -1610,7 +1610,7 @@ const Cr = ({
|
|
|
1610
1610
|
md: "hidden"
|
|
1611
1611
|
},
|
|
1612
1612
|
children: /* @__PURE__ */ t(
|
|
1613
|
-
|
|
1613
|
+
De,
|
|
1614
1614
|
{
|
|
1615
1615
|
"data-testid": "options-kebab",
|
|
1616
1616
|
isKebab: !0,
|
|
@@ -1631,7 +1631,7 @@ const Cr = ({
|
|
|
1631
1631
|
md: "visible"
|
|
1632
1632
|
},
|
|
1633
1633
|
children: /* @__PURE__ */ t(
|
|
1634
|
-
|
|
1634
|
+
De,
|
|
1635
1635
|
{
|
|
1636
1636
|
"data-testid": "options",
|
|
1637
1637
|
dropDownItems: [...o, h],
|
|
@@ -1676,7 +1676,7 @@ export {
|
|
|
1676
1676
|
ir as getInjectedEnvironment,
|
|
1677
1677
|
sn as isDefined,
|
|
1678
1678
|
vr as isUserProfileError,
|
|
1679
|
-
|
|
1679
|
+
L as label,
|
|
1680
1680
|
Tn as mainPageContentId,
|
|
1681
1681
|
yr as setUserProfileServerError,
|
|
1682
1682
|
rr as useAlerts,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@keycloak/keycloak-ui-shared",
|
|
3
|
-
"version": "25.0.
|
|
3
|
+
"version": "25.0.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/keycloak-ui-shared.js",
|
|
6
6
|
"types": "./dist/keycloak-ui-shared.d.ts",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"react-dom": "^18.3.1",
|
|
47
47
|
"react-hook-form": "7.51.5",
|
|
48
48
|
"react-i18next": "^14.1.2",
|
|
49
|
-
"@keycloak/keycloak-admin-client": "25.0.
|
|
50
|
-
"keycloak-js": "25.0.
|
|
49
|
+
"@keycloak/keycloak-admin-client": "25.0.2",
|
|
50
|
+
"keycloak-js": "25.0.2"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@types/lodash-es": "^4.17.12",
|