@keycloak/keycloak-ui-shared 26.3.4 → 26.4.0
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/keycloak-ui-shared.js +104 -102
- package/package.json +8 -8
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { jsx as t, jsxs as v, Fragment as j } from "react/jsx-runtime";
|
|
2
|
-
import { AlertGroup as en, Alert as tn, AlertVariant as
|
|
2
|
+
import { AlertGroup as en, Alert as tn, AlertVariant as Le, AlertActionCloseButton as nn, Page as rn, Modal as Ct, ModalVariant as an, TextContent as ln, Text as Ce, Button as N, Spinner as kt, FormHelperText as We, HelperText as je, HelperTextItem as Ge, Popover as on, Icon as Be, FormGroup as It, NumberInput as sn, ValidatedOptions as K, InputGroup as xe, InputGroupItem as Ne, TextInput as Se, Select as Te, SelectList as Ee, SelectOption as ze, MenuToggle as me, MenuToggleStatus as Je, TextInputGroup as wt, TextInputGroupMain as xt, ChipGroup as Ye, Chip as Qe, TextInputGroupUtilities as St, Switch as cn, TextArea as Tt, FileUpload as dn, Title as un, Card as hn, CardHeader as mn, CardTitle as pn, CardBody as fn, Grid as gn, GridItem as ot, PageSection as yn, JumpLinks as bn, JumpLinksItem as vn, ButtonVariant as Ie, Checkbox as Cn, Radio as kn, MenuFooter as In, Dropdown as wn, DropdownList as xn, DropdownItem as st, Masthead as Sn, MastheadToggle as Tn, PageToggleButton as En, MastheadBrand as An, MastheadContent as Rn, Toolbar as ke, ToolbarContent as _e, ToolbarItem as W, Avatar as Dn, Bullseye as On, EmptyState as Fn, EmptyStateIcon as ct, EmptyStateHeader as Pn, EmptyStateBody as Vn, EmptyStateFooter as Mn, EmptyStateActions as Ln, SearchInput as Bn, Divider as Nn, Pagination as _n, Badge as qn } from "@patternfly/react-core";
|
|
3
3
|
import { createContext as Et, useContext as At, useRef as J, useEffect as le, useCallback as he, useState as E, useMemo as q, forwardRef as $n, useId as Rt, Fragment as Dt, Children as Ot, Component as Un, isValidElement as Kn } from "react";
|
|
4
4
|
import { useTranslation as _ } from "react-i18next";
|
|
5
5
|
import { NetworkError as Ft } from "@keycloak/keycloak-admin-client";
|
|
6
6
|
import Hn from "keycloak-js";
|
|
7
|
-
import { ExclamationCircleIcon as Wn, HelpIcon as dt, EyeIcon as jn, EyeSlashIcon as Gn, TimesIcon as Pt, CubeIcon as zn, PaypalIcon as Jn, InstagramIcon as Yn, BitbucketIcon as Qn, MicrosoftIcon as Xn, TwitterIcon as Zn, StackOverflowIcon as er, OpenshiftIcon as tr, LinkedinIcon as nr, GoogleIcon as rr, GitlabIcon as ar, FacebookSquareIcon as lr, GithubIcon as ir, MinusCircleIcon as or, PlusCircleIcon as
|
|
7
|
+
import { ExclamationCircleIcon as Wn, HelpIcon as dt, EyeIcon as jn, EyeSlashIcon as Gn, TimesIcon as Pt, CubeIcon as zn, PaypalIcon as Jn, InstagramIcon as Yn, BitbucketIcon as Qn, MicrosoftIcon as Xn, TwitterIcon as Zn, StackOverflowIcon as er, OpenshiftIcon as tr, LinkedinIcon as nr, GoogleIcon as rr, GitlabIcon as ar, FacebookSquareIcon as lr, GithubIcon as ir, MinusCircleIcon as or, PlusCircleIcon as Vt, EllipsisVIcon as sr, BarsIcon as cr, SearchIcon as dr, SyncAltIcon as ur } from "@patternfly/react-icons";
|
|
8
8
|
import { useFormContext as Ae, Controller as ie, useController as Re, FormProvider as hr, useWatch as mr } from "react-hook-form";
|
|
9
|
-
import { get as
|
|
9
|
+
import { get as B, cloneDeep as pr, intersectionBy as fr } from "lodash-es";
|
|
10
10
|
import be from "@patternfly/react-styles/css/components/Avatar/avatar";
|
|
11
11
|
import { css as gr } from "@patternfly/react-styles";
|
|
12
|
-
import { Table as yr, TableVariant as br, Thead as vr, Tr as ve, Th as
|
|
12
|
+
import { Table as yr, TableVariant as br, Thead as vr, Tr as ve, Th as Ve, Tbody as ut, Td as re, ExpandableRowContent as Cr, ActionsColumn as kr, TableText as Ir } from "@patternfly/react-table";
|
|
13
13
|
import './main.css';function Xe(e, n) {
|
|
14
14
|
const r = Et(n);
|
|
15
15
|
return r.displayName = e, r;
|
|
16
16
|
}
|
|
17
|
-
const wr = ["error", "errorMessage"],
|
|
17
|
+
const wr = ["error", "errorMessage"], Me = "error_description";
|
|
18
18
|
function xr(e) {
|
|
19
19
|
if (typeof e == "string")
|
|
20
20
|
return e;
|
|
21
21
|
if (e instanceof Ft)
|
|
22
|
-
return
|
|
22
|
+
return Mt(e.responseData);
|
|
23
23
|
if (e instanceof Error)
|
|
24
24
|
return e.message;
|
|
25
25
|
throw new Error("Unable to determine error message.");
|
|
@@ -31,10 +31,10 @@ function Sr(e) {
|
|
|
31
31
|
return Tr(n);
|
|
32
32
|
}
|
|
33
33
|
function Tr(e) {
|
|
34
|
-
if (typeof e == "object" && e !== null &&
|
|
35
|
-
return e[
|
|
34
|
+
if (typeof e == "object" && e !== null && Me in e && typeof e[Me] == "string")
|
|
35
|
+
return e[Me];
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function Mt(e) {
|
|
38
38
|
if (!(typeof e != "object" || e === null))
|
|
39
39
|
for (const n of wr) {
|
|
40
40
|
const r = e[n];
|
|
@@ -87,7 +87,7 @@ function Dr({ alerts: e, onCloseAlert: n }) {
|
|
|
87
87
|
{
|
|
88
88
|
"data-testid": o === 0 ? "last-alert" : void 0,
|
|
89
89
|
isLiveRegion: !0,
|
|
90
|
-
variant:
|
|
90
|
+
variant: Le[a],
|
|
91
91
|
component: "p",
|
|
92
92
|
variantLabel: "",
|
|
93
93
|
title: l,
|
|
@@ -105,12 +105,12 @@ function Dr({ alerts: e, onCloseAlert: n }) {
|
|
|
105
105
|
}
|
|
106
106
|
);
|
|
107
107
|
}
|
|
108
|
-
const Or = 8e3,
|
|
108
|
+
const Or = 8e3, Lt = Xe(
|
|
109
109
|
"AlertContext",
|
|
110
110
|
void 0
|
|
111
|
-
), _a = () => Ze(
|
|
111
|
+
), _a = () => Ze(Lt), Fr = ({ children: e }) => {
|
|
112
112
|
const { t: n } = _(), r = Rr(), [a, l] = E([]), i = (u) => l((h) => h.filter((c) => c.id !== u)), o = he(
|
|
113
|
-
(u, h =
|
|
113
|
+
(u, h = Le.success, c) => {
|
|
114
114
|
const y = {
|
|
115
115
|
id: Er(),
|
|
116
116
|
message: u,
|
|
@@ -123,16 +123,16 @@ const Or = 8e3, Bt = Xe(
|
|
|
123
123
|
), s = he(
|
|
124
124
|
(u, h) => {
|
|
125
125
|
const c = n(u, { error: xr(h) }), y = Sr(h);
|
|
126
|
-
o(c,
|
|
126
|
+
o(c, Le.danger, y);
|
|
127
127
|
},
|
|
128
128
|
[o, n]
|
|
129
129
|
), d = q(() => ({ addAlert: o, addError: s }), [o, s]);
|
|
130
|
-
return /* @__PURE__ */ v(
|
|
130
|
+
return /* @__PURE__ */ v(Lt.Provider, { value: d, children: [
|
|
131
131
|
/* @__PURE__ */ t(Dr, { alerts: a, onCloseAlert: i }),
|
|
132
132
|
e
|
|
133
133
|
] });
|
|
134
134
|
}, Pr = (e) => {
|
|
135
|
-
const { t: n, i18n: r } = _(), a = e.error, l =
|
|
135
|
+
const { t: n, i18n: r } = _(), a = e.error, l = Vr(a), i = Mt(a);
|
|
136
136
|
console.error(a);
|
|
137
137
|
function o() {
|
|
138
138
|
location.href = location.origin + location.pathname;
|
|
@@ -152,10 +152,10 @@ const Or = 8e3, Bt = Xe(
|
|
|
152
152
|
}
|
|
153
153
|
) });
|
|
154
154
|
};
|
|
155
|
-
function
|
|
155
|
+
function Vr(e) {
|
|
156
156
|
return e instanceof Error ? e.message : null;
|
|
157
157
|
}
|
|
158
|
-
function
|
|
158
|
+
function Mr(e, n, r) {
|
|
159
159
|
const [a, l] = E(
|
|
160
160
|
() => e.getItem(n) ?? r
|
|
161
161
|
), i = he((o) => {
|
|
@@ -169,11 +169,11 @@ function Lr(e, n, r) {
|
|
|
169
169
|
return () => window.removeEventListener("storage", o);
|
|
170
170
|
}, [e, n]), [a, i];
|
|
171
171
|
}
|
|
172
|
-
function
|
|
172
|
+
function Bt(e, n, r) {
|
|
173
173
|
const a = q(
|
|
174
174
|
() => JSON.stringify(r),
|
|
175
175
|
[r]
|
|
176
|
-
), [l, i] =
|
|
176
|
+
), [l, i] = Mr(
|
|
177
177
|
e,
|
|
178
178
|
n,
|
|
179
179
|
a
|
|
@@ -186,8 +186,8 @@ function Vt(e, n, r) {
|
|
|
186
186
|
const Nt = Xe(
|
|
187
187
|
"HelpContext",
|
|
188
188
|
void 0
|
|
189
|
-
),
|
|
190
|
-
const [n, r] =
|
|
189
|
+
), Lr = () => Ze(Nt), Br = ({ children: e }) => {
|
|
190
|
+
const [n, r] = Bt(localStorage, "helpEnabled", !0);
|
|
191
191
|
function a() {
|
|
192
192
|
r(!n);
|
|
193
193
|
}
|
|
@@ -223,7 +223,7 @@ const qa = () => {
|
|
|
223
223
|
responseMode: "query",
|
|
224
224
|
scope: e.scope
|
|
225
225
|
}).then(() => l(!0)).catch((u) => o(u)), r.current = !0;
|
|
226
|
-
}, [s]), i ? /* @__PURE__ */ t(Pr, { error: i }) : a ? /* @__PURE__ */ t(qe.Provider, { value: { environment: e, keycloak: s }, children: /* @__PURE__ */ t(Fr, { children: /* @__PURE__ */ t(
|
|
226
|
+
}, [s]), i ? /* @__PURE__ */ t(Pr, { error: i }) : a ? /* @__PURE__ */ t(qe.Provider, { value: { environment: e, keycloak: s }, children: /* @__PURE__ */ t(Fr, { children: /* @__PURE__ */ t(Br, { children: n }) }) }) : /* @__PURE__ */ t(kt, {});
|
|
227
227
|
};
|
|
228
228
|
function Ua() {
|
|
229
229
|
const n = document.getElementById("environment")?.textContent;
|
|
@@ -302,7 +302,7 @@ const Ka = ({
|
|
|
302
302
|
noVerticalAlign: r = !0,
|
|
303
303
|
unWrap: a = !1
|
|
304
304
|
}) => {
|
|
305
|
-
const { enabled: l } =
|
|
305
|
+
const { enabled: l } = Lr();
|
|
306
306
|
return l ? /* @__PURE__ */ t(on, { bodyContent: e, children: /* @__PURE__ */ v(j, { children: [
|
|
307
307
|
!a && /* @__PURE__ */ t(
|
|
308
308
|
"button",
|
|
@@ -311,10 +311,10 @@ const Ka = ({
|
|
|
311
311
|
"aria-label": n,
|
|
312
312
|
onClick: (i) => i.preventDefault(),
|
|
313
313
|
className: "pf-v5-c-form__group-label-help",
|
|
314
|
-
children: /* @__PURE__ */ t(
|
|
314
|
+
children: /* @__PURE__ */ t(Be, { isInline: r, children: /* @__PURE__ */ t(dt, {}) })
|
|
315
315
|
}
|
|
316
316
|
),
|
|
317
|
-
a && /* @__PURE__ */ t(
|
|
317
|
+
a && /* @__PURE__ */ t(Be, { isInline: r, children: /* @__PURE__ */ t(dt, {}) })
|
|
318
318
|
] }) }) : null;
|
|
319
319
|
};
|
|
320
320
|
function oe(e) {
|
|
@@ -475,7 +475,7 @@ const Wa = (e) => {
|
|
|
475
475
|
name: n,
|
|
476
476
|
label: r,
|
|
477
477
|
isRequired: C,
|
|
478
|
-
error:
|
|
478
|
+
error: B(c, n),
|
|
479
479
|
labelIcon: o,
|
|
480
480
|
children: /* @__PURE__ */ t(
|
|
481
481
|
ie,
|
|
@@ -501,7 +501,7 @@ const Wa = (e) => {
|
|
|
501
501
|
onClick: () => g(!y),
|
|
502
502
|
isExpanded: y,
|
|
503
503
|
isFullWidth: !0,
|
|
504
|
-
status:
|
|
504
|
+
status: B(c, n) ? Je.danger : void 0,
|
|
505
505
|
"aria-label": r,
|
|
506
506
|
isDisabled: s,
|
|
507
507
|
children: te(a) ? a.find(
|
|
@@ -545,7 +545,7 @@ const Wa = (e) => {
|
|
|
545
545
|
...l
|
|
546
546
|
],
|
|
547
547
|
[l, a]
|
|
548
|
-
),
|
|
548
|
+
), L = A.filter(
|
|
549
549
|
(f) => ee(f).toLowerCase().startsWith(R.toLowerCase())
|
|
550
550
|
), H = (f, k) => {
|
|
551
551
|
k.value.includes(f) ? (k.onChange(k.value.filter((D) => D !== f)), te(a) && I(
|
|
@@ -554,8 +554,8 @@ const Wa = (e) => {
|
|
|
554
554
|
...T,
|
|
555
555
|
A.find((D) => D.key === f)
|
|
556
556
|
]));
|
|
557
|
-
},
|
|
558
|
-
const D =
|
|
557
|
+
}, V = (f, k) => {
|
|
558
|
+
const D = L[m];
|
|
559
559
|
switch (C(!0), f.key) {
|
|
560
560
|
case "Enter": {
|
|
561
561
|
f.preventDefault(), p(F ? "" : ee(D)), H(ae(D), k), C(!1), S(0);
|
|
@@ -586,7 +586,7 @@ const Wa = (e) => {
|
|
|
586
586
|
name: n,
|
|
587
587
|
label: r,
|
|
588
588
|
isRequired: x,
|
|
589
|
-
error:
|
|
589
|
+
error: B(y, n),
|
|
590
590
|
labelIcon: o,
|
|
591
591
|
children: /* @__PURE__ */ t(
|
|
592
592
|
ie,
|
|
@@ -614,7 +614,7 @@ const Wa = (e) => {
|
|
|
614
614
|
},
|
|
615
615
|
isExpanded: g,
|
|
616
616
|
isFullWidth: !0,
|
|
617
|
-
status:
|
|
617
|
+
status: B(y, n) ? Je.danger : void 0,
|
|
618
618
|
children: /* @__PURE__ */ v(wt, { isPlain: !0, children: [
|
|
619
619
|
/* @__PURE__ */ t(
|
|
620
620
|
xt,
|
|
@@ -627,7 +627,7 @@ const Wa = (e) => {
|
|
|
627
627
|
onChange: (D, O) => {
|
|
628
628
|
p(O), d?.(O);
|
|
629
629
|
},
|
|
630
|
-
onKeyDown: (D) =>
|
|
630
|
+
onKeyDown: (D) => V(D, f),
|
|
631
631
|
autoComplete: "off",
|
|
632
632
|
innerRef: b,
|
|
633
633
|
role: "combobox",
|
|
@@ -674,7 +674,7 @@ const Wa = (e) => {
|
|
|
674
674
|
F && Array.isArray(f.value) ? (p(""), H(O || "", f)) : (f.onChange(Array.isArray(f.value) ? [O] : O), C(!1));
|
|
675
675
|
},
|
|
676
676
|
isOpen: g,
|
|
677
|
-
children: /* @__PURE__ */ t(Ee, { children:
|
|
677
|
+
children: /* @__PURE__ */ t(Ee, { children: L.map((k, D) => /* @__PURE__ */ t(
|
|
678
678
|
ze,
|
|
679
679
|
{
|
|
680
680
|
value: ae(k),
|
|
@@ -706,9 +706,7 @@ function Ga(e, n, r) {
|
|
|
706
706
|
(e.responseData.errors !== void 0 ? e.responseData.errors : [e.responseData]).forEach((a) => {
|
|
707
707
|
const l = Object.assign(
|
|
708
708
|
{},
|
|
709
|
-
a.params?.map(
|
|
710
|
-
(i) => $e(i?.toString()) ? r(Ue(i)) : i
|
|
711
|
-
)
|
|
709
|
+
a.params?.map((i) => $e(i) ? r(Ue(i)) : i)
|
|
712
710
|
);
|
|
713
711
|
n(Q(a.field), {
|
|
714
712
|
message: r(
|
|
@@ -766,6 +764,7 @@ const Ja = ({
|
|
|
766
764
|
id: l.name,
|
|
767
765
|
"data-testid": Hr(l.name),
|
|
768
766
|
label: e,
|
|
767
|
+
"aria-label": l.label,
|
|
769
768
|
isChecked: n ? u === "true" : u,
|
|
770
769
|
onChange: (h, c) => {
|
|
771
770
|
const y = n ? c.toString() : c;
|
|
@@ -872,7 +871,7 @@ const Ja = ({
|
|
|
872
871
|
);
|
|
873
872
|
}, Za = ({ icon: e }) => {
|
|
874
873
|
const n = jr(e);
|
|
875
|
-
return /* @__PURE__ */ t(
|
|
874
|
+
return /* @__PURE__ */ t(Be, { size: "lg", children: /* @__PURE__ */ t(n, { alt: e }) });
|
|
876
875
|
};
|
|
877
876
|
function jr(e) {
|
|
878
877
|
switch (e) {
|
|
@@ -1053,7 +1052,7 @@ const Gr = "_title_180i0_2", zr = {
|
|
|
1053
1052
|
r.annotations?.inputHelperTextBefore
|
|
1054
1053
|
), {
|
|
1055
1054
|
formState: { errors: o }
|
|
1056
|
-
} = n, s = a?.(r), d =
|
|
1055
|
+
} = n, s = a?.(r), d = B(o, Q(r.name));
|
|
1057
1056
|
return /* @__PURE__ */ v(
|
|
1058
1057
|
It,
|
|
1059
1058
|
{
|
|
@@ -1090,6 +1089,7 @@ const Gr = "_title_180i0_2", zr = {
|
|
|
1090
1089
|
form: n,
|
|
1091
1090
|
"aria-label": Ke(e, r),
|
|
1092
1091
|
name: Q(r.name),
|
|
1092
|
+
defaultValue: [r.defaultValue || ""],
|
|
1093
1093
|
addButtonLabel: e("addMultivaluedLabel", {
|
|
1094
1094
|
fieldLabel: Ke(e, r)
|
|
1095
1095
|
}),
|
|
@@ -1161,7 +1161,7 @@ const Gr = "_title_180i0_2", zr = {
|
|
|
1161
1161
|
"data-testid": "addValue",
|
|
1162
1162
|
isDisabled: !T || i,
|
|
1163
1163
|
children: [
|
|
1164
|
-
/* @__PURE__ */ t(
|
|
1164
|
+
/* @__PURE__ */ t(Vt, {}),
|
|
1165
1165
|
" ",
|
|
1166
1166
|
e(l || "add")
|
|
1167
1167
|
]
|
|
@@ -1175,7 +1175,7 @@ const Gr = "_title_180i0_2", zr = {
|
|
|
1175
1175
|
{
|
|
1176
1176
|
name: Q(a.name),
|
|
1177
1177
|
control: n.control,
|
|
1178
|
-
defaultValue:
|
|
1178
|
+
defaultValue: a.defaultValue,
|
|
1179
1179
|
render: ({ field: h }) => /* @__PURE__ */ t(j, { children: s.map((c) => /* @__PURE__ */ t(
|
|
1180
1180
|
o,
|
|
1181
1181
|
{
|
|
@@ -1279,13 +1279,13 @@ const Gr = "_title_180i0_2", zr = {
|
|
|
1279
1279
|
}) => {
|
|
1280
1280
|
const [T, I] = E(""), [b, x] = E(0), F = J(), A = Ot.toArray(
|
|
1281
1281
|
m
|
|
1282
|
-
),
|
|
1282
|
+
), L = () => {
|
|
1283
1283
|
r?.(!S.isOpen);
|
|
1284
|
-
}, H = (
|
|
1284
|
+
}, H = (V) => {
|
|
1285
1285
|
const f = A[b];
|
|
1286
|
-
switch (r?.(!0),
|
|
1286
|
+
switch (r?.(!0), V.key) {
|
|
1287
1287
|
case "Enter": {
|
|
1288
|
-
|
|
1288
|
+
V.preventDefault(), l !== z.typeaheadMulti ? I(f.props.value) : I(""), n?.(f.props.value), r?.(!1), x(0);
|
|
1289
1289
|
break;
|
|
1290
1290
|
}
|
|
1291
1291
|
case "Escape": {
|
|
@@ -1298,9 +1298,9 @@ const Gr = "_title_180i0_2", zr = {
|
|
|
1298
1298
|
}
|
|
1299
1299
|
case "ArrowUp":
|
|
1300
1300
|
case "ArrowDown": {
|
|
1301
|
-
|
|
1301
|
+
V.preventDefault();
|
|
1302
1302
|
let k = 0;
|
|
1303
|
-
|
|
1303
|
+
V.key === "ArrowUp" && (b === 0 ? k = A.length - 1 : k = b - 1), V.key === "ArrowDown" && (b === A.length - 1 ? k = 0 : k = b + 1), x(k);
|
|
1304
1304
|
break;
|
|
1305
1305
|
}
|
|
1306
1306
|
}
|
|
@@ -1309,17 +1309,17 @@ const Gr = "_title_180i0_2", zr = {
|
|
|
1309
1309
|
Te,
|
|
1310
1310
|
{
|
|
1311
1311
|
...S,
|
|
1312
|
-
onClick:
|
|
1313
|
-
onOpenChange: (
|
|
1314
|
-
onSelect: (
|
|
1312
|
+
onClick: L,
|
|
1313
|
+
onOpenChange: (V) => r?.(V),
|
|
1314
|
+
onSelect: (V, f) => {
|
|
1315
1315
|
n?.(f || ""), a?.(""), I("");
|
|
1316
1316
|
},
|
|
1317
1317
|
maxMenuHeight: we(s),
|
|
1318
1318
|
popperProps: { direction: h, width: we(d) },
|
|
1319
|
-
toggle: (
|
|
1319
|
+
toggle: (V) => /* @__PURE__ */ t(
|
|
1320
1320
|
me,
|
|
1321
1321
|
{
|
|
1322
|
-
ref:
|
|
1322
|
+
ref: V,
|
|
1323
1323
|
id: e,
|
|
1324
1324
|
variant: "typeahead",
|
|
1325
1325
|
onClick: () => r?.(!0),
|
|
@@ -1334,7 +1334,7 @@ const Gr = "_title_180i0_2", zr = {
|
|
|
1334
1334
|
{
|
|
1335
1335
|
placeholder: o,
|
|
1336
1336
|
value: l === z.typeahead && c ? c : T,
|
|
1337
|
-
onClick:
|
|
1337
|
+
onClick: L,
|
|
1338
1338
|
onChange: (f, k) => {
|
|
1339
1339
|
I(k), a?.(k);
|
|
1340
1340
|
},
|
|
@@ -1400,7 +1400,7 @@ const we = (e) => typeof e == "number" ? e + "px" : e, sa = ({
|
|
|
1400
1400
|
ie,
|
|
1401
1401
|
{
|
|
1402
1402
|
name: Q(l.name),
|
|
1403
|
-
defaultValue:
|
|
1403
|
+
defaultValue: l.defaultValue,
|
|
1404
1404
|
control: r.control,
|
|
1405
1405
|
render: ({ field: p }) => /* @__PURE__ */ t(
|
|
1406
1406
|
sa,
|
|
@@ -1434,7 +1434,8 @@ const we = (e) => typeof e == "number" ? e + "px" : e, sa = ({
|
|
|
1434
1434
|
cols: r.annotations?.inputTypeCols,
|
|
1435
1435
|
rows: r.annotations?.inputTypeRows,
|
|
1436
1436
|
readOnly: r.readOnly,
|
|
1437
|
-
isRequired: a
|
|
1437
|
+
isRequired: a,
|
|
1438
|
+
defaultValue: r.defaultValue
|
|
1438
1439
|
}
|
|
1439
1440
|
) });
|
|
1440
1441
|
}, U = (e) => {
|
|
@@ -1453,6 +1454,7 @@ const we = (e) => typeof e == "number" ? e + "px" : e, sa = ({
|
|
|
1453
1454
|
),
|
|
1454
1455
|
isDisabled: a.readOnly,
|
|
1455
1456
|
isRequired: l,
|
|
1457
|
+
defaultValue: a.defaultValue,
|
|
1456
1458
|
...n.register(Q(a.name))
|
|
1457
1459
|
}
|
|
1458
1460
|
) });
|
|
@@ -1851,10 +1853,10 @@ const ba = () => {
|
|
|
1851
1853
|
isDisabled: d = !1,
|
|
1852
1854
|
children: u
|
|
1853
1855
|
}) => /* @__PURE__ */ v(Fn, { "data-testid": "empty-state", variant: "lg", children: [
|
|
1854
|
-
a && l ? /* @__PURE__ */ t(ct, { icon: dr }) : a && /* @__PURE__ */ t(ct, { icon: s ||
|
|
1856
|
+
a && l ? /* @__PURE__ */ t(ct, { icon: dr }) : a && /* @__PURE__ */ t(ct, { icon: s || Vt }),
|
|
1855
1857
|
/* @__PURE__ */ t(Pn, { titleText: e, headingLevel: "h1" }),
|
|
1856
|
-
/* @__PURE__ */ t(
|
|
1857
|
-
/* @__PURE__ */ v(
|
|
1858
|
+
/* @__PURE__ */ t(Vn, { children: n }),
|
|
1859
|
+
/* @__PURE__ */ v(Mn, { children: [
|
|
1858
1860
|
i && /* @__PURE__ */ t(
|
|
1859
1861
|
N,
|
|
1860
1862
|
{
|
|
@@ -1866,7 +1868,7 @@ const ba = () => {
|
|
|
1866
1868
|
}
|
|
1867
1869
|
),
|
|
1868
1870
|
u,
|
|
1869
|
-
o && /* @__PURE__ */ t(
|
|
1871
|
+
o && /* @__PURE__ */ t(Ln, { children: o.map((h) => /* @__PURE__ */ t(
|
|
1870
1872
|
N,
|
|
1871
1873
|
{
|
|
1872
1874
|
"data-testid": `${h.text.replace(/\W+/g, "-").toLowerCase()}-empty-action`,
|
|
@@ -1898,7 +1900,7 @@ const ba = () => {
|
|
|
1898
1900
|
i && /* @__PURE__ */ t(W, { children: /* @__PURE__ */ v(xe, { "data-testid": i, children: [
|
|
1899
1901
|
l,
|
|
1900
1902
|
o && /* @__PURE__ */ t(
|
|
1901
|
-
|
|
1903
|
+
Bn,
|
|
1902
1904
|
{
|
|
1903
1905
|
"data-testid": "table-search-input",
|
|
1904
1906
|
placeholder: o,
|
|
@@ -2033,16 +2035,16 @@ function wa({
|
|
|
2033
2035
|
T(F);
|
|
2034
2036
|
} else if (b === -1) {
|
|
2035
2037
|
const F = S.map(
|
|
2036
|
-
(A) =>
|
|
2038
|
+
(A) => B(A, "id")
|
|
2037
2039
|
);
|
|
2038
2040
|
T(
|
|
2039
2041
|
x ? [...C, ...n.map((A) => A.data)] : C.filter(
|
|
2040
|
-
(A) => !F.includes(
|
|
2042
|
+
(A) => !F.includes(B(A, "id"))
|
|
2041
2043
|
)
|
|
2042
2044
|
);
|
|
2043
2045
|
} else
|
|
2044
2046
|
T(x ? [...C, n[b].data] : C.filter(
|
|
2045
|
-
(F) =>
|
|
2047
|
+
(F) => B(F, "id") !== n[b].data.id
|
|
2046
2048
|
));
|
|
2047
2049
|
};
|
|
2048
2050
|
return /* @__PURE__ */ v(
|
|
@@ -2053,9 +2055,9 @@ function wa({
|
|
|
2053
2055
|
"aria-label": g(l),
|
|
2054
2056
|
children: [
|
|
2055
2057
|
/* @__PURE__ */ t(vr, { children: /* @__PURE__ */ v(ve, { children: [
|
|
2056
|
-
s && /* @__PURE__ */ t(
|
|
2058
|
+
s && /* @__PURE__ */ t(Ve, { screenReaderText: g("expandRow") }),
|
|
2057
2059
|
d && /* @__PURE__ */ t(
|
|
2058
|
-
|
|
2060
|
+
Ve,
|
|
2059
2061
|
{
|
|
2060
2062
|
screenReaderText: g("selectAll"),
|
|
2061
2063
|
select: c ? void 0 : {
|
|
@@ -2067,7 +2069,7 @@ function wa({
|
|
|
2067
2069
|
}
|
|
2068
2070
|
),
|
|
2069
2071
|
e.map((b) => /* @__PURE__ */ t(
|
|
2070
|
-
|
|
2072
|
+
Ve,
|
|
2071
2073
|
{
|
|
2072
2074
|
screenReaderText: g("expandRow"),
|
|
2073
2075
|
className: b.transforms?.[0]().className,
|
|
@@ -2081,13 +2083,13 @@ function wa({
|
|
|
2081
2083
|
re,
|
|
2082
2084
|
{
|
|
2083
2085
|
expand: n[x + 1].cells.length === 0 ? void 0 : {
|
|
2084
|
-
isExpanded:
|
|
2086
|
+
isExpanded: p[x] ?? !1,
|
|
2085
2087
|
rowIndex: x,
|
|
2086
2088
|
expandId: "expandable-row-",
|
|
2087
|
-
onToggle: (F, A,
|
|
2088
|
-
s(
|
|
2089
|
+
onToggle: (F, A, L) => {
|
|
2090
|
+
s(L, A);
|
|
2089
2091
|
const H = [...p];
|
|
2090
|
-
H[x] =
|
|
2092
|
+
H[x] = L, m(H);
|
|
2091
2093
|
}
|
|
2092
2094
|
}
|
|
2093
2095
|
}
|
|
@@ -2101,7 +2103,7 @@ function wa({
|
|
|
2101
2103
|
actionResolver: a
|
|
2102
2104
|
}
|
|
2103
2105
|
)
|
|
2104
|
-
] }) : /* @__PURE__ */ v(ve, { isExpanded:
|
|
2106
|
+
] }) : /* @__PURE__ */ v(ve, { isExpanded: p[x - 1] ?? !1, children: [
|
|
2105
2107
|
/* @__PURE__ */ t(re, {}),
|
|
2106
2108
|
/* @__PURE__ */ t(re, { colSpan: e.length, children: /* @__PURE__ */ t(Cr, { children: /* @__PURE__ */ t(Ia, { row: b }) }) })
|
|
2107
2109
|
] }) }, x)) : /* @__PURE__ */ t(ut, { children: n.map((b, x) => /* @__PURE__ */ v(ve, { isExpanded: p[x], children: [
|
|
@@ -2110,11 +2112,11 @@ function wa({
|
|
|
2110
2112
|
{
|
|
2111
2113
|
select: {
|
|
2112
2114
|
rowIndex: x,
|
|
2113
|
-
onSelect: (F, A,
|
|
2114
|
-
I(
|
|
2115
|
+
onSelect: (F, A, L) => {
|
|
2116
|
+
I(L, A);
|
|
2115
2117
|
},
|
|
2116
2118
|
isSelected: !!C.find(
|
|
2117
|
-
(F) =>
|
|
2119
|
+
(F) => B(F, "id") === b.data.id
|
|
2118
2120
|
),
|
|
2119
2121
|
variant: c ? "radio" : "checkbox",
|
|
2120
2122
|
isDisabled: b.disableSelection
|
|
@@ -2157,42 +2159,42 @@ function xa({
|
|
|
2157
2159
|
isSearching: S = !1,
|
|
2158
2160
|
...T
|
|
2159
2161
|
}) {
|
|
2160
|
-
const { t: I } = _(), [b, x] = E([]), [F, A] = E(), [
|
|
2162
|
+
const { t: I } = _(), [b, x] = E([]), [F, A] = E(), [L, H] = E(), [V, f] = E(!1), [k, D] = Bt(
|
|
2161
2163
|
localStorage,
|
|
2162
2164
|
"pageSize",
|
|
2163
2165
|
10
|
|
2164
|
-
), [O, se] = E(k), [$, ce] = E(0), [G, Oe] = E(""), tt = J(), [fe, Gt] = E(0), nt = J(), rt = () => Gt(fe + 1), zt = Rt(), at = (w, P) => w.map((
|
|
2165
|
-
if ("cellFormatters" in
|
|
2166
|
-
const Z =
|
|
2167
|
-
return
|
|
2166
|
+
), [O, se] = E(k), [$, ce] = E(0), [G, Oe] = E(""), tt = J(), [fe, Gt] = E(0), nt = J(), rt = () => Gt(fe + 1), zt = Rt(), at = (w, P) => w.map((M) => {
|
|
2167
|
+
if ("cellFormatters" in M) {
|
|
2168
|
+
const Z = B(P, M.name);
|
|
2169
|
+
return M.cellFormatters?.reduce((de, ye) => ye(de), Z);
|
|
2168
2170
|
}
|
|
2169
|
-
if (
|
|
2170
|
-
const Z =
|
|
2171
|
+
if (M.cellRenderer) {
|
|
2172
|
+
const Z = M.cellRenderer;
|
|
2171
2173
|
return { title: /* @__PURE__ */ t(Z, { ...P }) };
|
|
2172
2174
|
}
|
|
2173
|
-
return
|
|
2175
|
+
return B(P, M.name);
|
|
2174
2176
|
}), lt = (w) => {
|
|
2175
|
-
const P = (
|
|
2176
|
-
return w.map((
|
|
2177
|
-
const de = d ? d(
|
|
2177
|
+
const P = (M) => s?.[0]?.enabled?.(M);
|
|
2178
|
+
return w.map((M, Z) => {
|
|
2179
|
+
const de = d ? d(M) : !1, ye = [
|
|
2178
2180
|
{
|
|
2179
|
-
data:
|
|
2181
|
+
data: M,
|
|
2180
2182
|
disableSelection: de,
|
|
2181
2183
|
disableActions: de,
|
|
2182
|
-
selected: !!b.find((Zt) =>
|
|
2183
|
-
isOpen: P(
|
|
2184
|
-
cells: at(h,
|
|
2184
|
+
selected: !!b.find((Zt) => B(Zt, "id") === B(M, "id")),
|
|
2185
|
+
isOpen: P(M) ? !1 : void 0,
|
|
2186
|
+
cells: at(h, M)
|
|
2185
2187
|
}
|
|
2186
2188
|
];
|
|
2187
2189
|
return s && ye.push({
|
|
2188
2190
|
parent: Z * 2,
|
|
2189
|
-
cells: P(
|
|
2191
|
+
cells: P(M) ? at(s, M) : []
|
|
2190
2192
|
}), ye;
|
|
2191
2193
|
}).flat();
|
|
2192
2194
|
}, Fe = (w) => ["string", "number"].includes(typeof w) ? w.toString() : w instanceof Array ? w.map(Fe).join("") : typeof w == "object" ? Fe(
|
|
2193
2195
|
Kn(w.title) ? w.title.props : Object.values(w)
|
|
2194
2196
|
) : "", it = q(
|
|
2195
|
-
() => G === "" || r ? void 0 : lt(
|
|
2197
|
+
() => G === "" || r ? void 0 : lt(L || []).filter(
|
|
2196
2198
|
(w) => w.cells.some(
|
|
2197
2199
|
(P) => P && Fe(P).toLowerCase().includes(G.toLowerCase())
|
|
2198
2200
|
)
|
|
@@ -2203,7 +2205,7 @@ function xa({
|
|
|
2203
2205
|
async () => {
|
|
2204
2206
|
f(!0);
|
|
2205
2207
|
const w = tt.current === "" && G !== "";
|
|
2206
|
-
return w && ce(0), tt.current = G, typeof u == "function" ? fe === nt.current &&
|
|
2208
|
+
return w && ce(0), tt.current = G, typeof u == "function" ? fe === nt.current && L ? L : await u(w ? 0 : $, O + 1, G) : u;
|
|
2207
2209
|
},
|
|
2208
2210
|
(w) => {
|
|
2209
2211
|
nt.current = fe, r || (H(w), w.length > $ ? w = w.slice($, $ + O + 1) : ce(0));
|
|
@@ -2218,7 +2220,7 @@ function xa({
|
|
|
2218
2220
|
typeof u != "function" ? u : void 0
|
|
2219
2221
|
]
|
|
2220
2222
|
);
|
|
2221
|
-
const Jt = () => c && pr(c).map((w, P) => (delete w.onRowClick, w.onClick = async (
|
|
2223
|
+
const Jt = () => c && pr(c).map((w, P) => (delete w.onRowClick, w.onClick = async (M, Z) => {
|
|
2222
2224
|
await c[P].onRowClick(
|
|
2223
2225
|
(it || F)[Z].data
|
|
2224
2226
|
) && (r || Oe(""), rt());
|
|
@@ -2255,7 +2257,7 @@ function xa({
|
|
|
2255
2257
|
] }),
|
|
2256
2258
|
subToolbar: R,
|
|
2257
2259
|
children: [
|
|
2258
|
-
!
|
|
2260
|
+
!V && !ge && /* @__PURE__ */ t(
|
|
2259
2261
|
wa,
|
|
2260
2262
|
{
|
|
2261
2263
|
...T,
|
|
@@ -2275,7 +2277,7 @@ function xa({
|
|
|
2275
2277
|
ariaLabelKey: e
|
|
2276
2278
|
}
|
|
2277
2279
|
),
|
|
2278
|
-
!
|
|
2280
|
+
!V && ge && Pe && /* @__PURE__ */ t(
|
|
2279
2281
|
va,
|
|
2280
2282
|
{
|
|
2281
2283
|
hasIcon: !0,
|
|
@@ -2295,8 +2297,8 @@ function xa({
|
|
|
2295
2297
|
]
|
|
2296
2298
|
}
|
|
2297
2299
|
),
|
|
2298
|
-
|
|
2299
|
-
!
|
|
2300
|
+
V && /* @__PURE__ */ t(ba, {}),
|
|
2301
|
+
!V && ge && !Pe && p
|
|
2300
2302
|
] });
|
|
2301
2303
|
}
|
|
2302
2304
|
const Sa = ({ link: e, organization: n }) => {
|
|
@@ -2391,7 +2393,7 @@ export {
|
|
|
2391
2393
|
_t as FormErrorText,
|
|
2392
2394
|
Jr as FormPanel,
|
|
2393
2395
|
el as FormSubmitButton,
|
|
2394
|
-
|
|
2396
|
+
Br as Help,
|
|
2395
2397
|
qt as HelpItem,
|
|
2396
2398
|
Za as IconMapper,
|
|
2397
2399
|
xa as KeycloakDataTable,
|
|
@@ -2422,7 +2424,7 @@ export {
|
|
|
2422
2424
|
xr as getErrorMessage,
|
|
2423
2425
|
Ua as getInjectedEnvironment,
|
|
2424
2426
|
Tr as getNetworkErrorDescription,
|
|
2425
|
-
|
|
2427
|
+
Mt as getNetworkErrorMessage,
|
|
2426
2428
|
Ar as isDefined,
|
|
2427
2429
|
za as isUserProfileError,
|
|
2428
2430
|
ne as label,
|
|
@@ -2432,8 +2434,8 @@ export {
|
|
|
2432
2434
|
qa as useEnvironment,
|
|
2433
2435
|
Wt as useErrorBoundary,
|
|
2434
2436
|
ya as useFetch,
|
|
2435
|
-
|
|
2437
|
+
Lr as useHelp,
|
|
2436
2438
|
Ze as useRequiredContext,
|
|
2437
2439
|
Rr as useSetTimeout,
|
|
2438
|
-
|
|
2440
|
+
Bt as useStoredState
|
|
2439
2441
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@keycloak/keycloak-ui-shared",
|
|
3
|
-
"version": "26.
|
|
3
|
+
"version": "26.4.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/keycloak-ui-shared.js",
|
|
6
6
|
"types": "./dist/keycloak-ui-shared.d.ts",
|
|
@@ -43,23 +43,23 @@
|
|
|
43
43
|
"@patternfly/react-icons": "^5.4.2",
|
|
44
44
|
"@patternfly/react-styles": "^5.4.1",
|
|
45
45
|
"@patternfly/react-table": "^5.4.16",
|
|
46
|
-
"i18next": "^25.2
|
|
46
|
+
"i18next": "^25.5.2",
|
|
47
47
|
"keycloak-js": "^26.2.0",
|
|
48
48
|
"lodash-es": "^4.17.21",
|
|
49
49
|
"react": "^18.3.1",
|
|
50
50
|
"react-dom": "^18.3.1",
|
|
51
|
-
"react-hook-form": "7.
|
|
52
|
-
"react-i18next": "^15.
|
|
53
|
-
"@keycloak/keycloak-admin-client": "26.
|
|
51
|
+
"react-hook-form": "7.63.0",
|
|
52
|
+
"react-i18next": "^15.7.3",
|
|
53
|
+
"@keycloak/keycloak-admin-client": "26.4.0"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@types/lodash-es": "^4.17.12",
|
|
57
57
|
"@types/react": "^18.3.18",
|
|
58
58
|
"@types/react-dom": "^18.3.5",
|
|
59
|
-
"@vitejs/plugin-react-swc": "^
|
|
59
|
+
"@vitejs/plugin-react-swc": "^4.1.0",
|
|
60
60
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
61
|
-
"vite": "^7.
|
|
62
|
-
"vite-plugin-checker": "^0.
|
|
61
|
+
"vite": "^7.1.6",
|
|
62
|
+
"vite-plugin-checker": "^0.10.3",
|
|
63
63
|
"vite-plugin-dts": "^4.5.4",
|
|
64
64
|
"vite-plugin-lib-inject-css": "^2.2.2",
|
|
65
65
|
"vitest": "^3.2.4"
|