@apicurio/common-ui-components 2.0.12 → 2.0.15
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/auth/useAuth.d.ts +1 -0
- package/dist/main.js +98 -85
- package/package.json +5 -1
package/dist/auth/useAuth.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export interface AuthService {
|
|
|
13
13
|
getToken: () => Promise<string | undefined>;
|
|
14
14
|
getUsernameAndPassword: () => UsernameAndPassword | undefined;
|
|
15
15
|
login: (username: string, password: string) => Promise<void>;
|
|
16
|
+
refresh: () => Promise<void>;
|
|
16
17
|
logout: () => Promise<void>;
|
|
17
18
|
}
|
|
18
19
|
/**
|
package/dist/main.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import j, { createContext as gt, useContext as ut, useState as T, useEffect as pe, memo as Pe, forwardRef as ne, useCallback as Ne, useMemo as
|
|
1
|
+
import j, { createContext as gt, useContext as ut, useState as T, useEffect as pe, memo as Pe, forwardRef as ne, useCallback as Ne, useMemo as De } from "react";
|
|
2
2
|
import { jsx as a, jsxs as v, Fragment as Re } from "react/jsx-runtime";
|
|
3
|
-
import { useInterval as _t, Tooltip as pt, EmptyState as oe, EmptyStateVariant as ft, EmptyStateHeader as ae, EmptyStateBody as ve, Spinner as te, Alert as wt, Dropdown as mt, MenuToggle as Je, DropdownList as vt, Divider as Ke, DropdownItem as St, Select as yt, SelectOption as bt, TextInput as ce, Button as le, TextArea as kt, AboutModal as Tt, TextContent as It, Text as
|
|
4
|
-
import { EllipsisVIcon as Nt, ChevronDownIcon as
|
|
3
|
+
import { useInterval as _t, Tooltip as pt, EmptyState as oe, EmptyStateVariant as ft, EmptyStateHeader as ae, EmptyStateBody as ve, Spinner as te, Alert as wt, Dropdown as mt, MenuToggle as Je, DropdownList as vt, Divider as Ke, DropdownItem as St, Select as yt, SelectOption as bt, TextInput as ce, Button as le, TextArea as kt, AboutModal as Tt, TextContent as It, Text as qe, TextVariants as Le, TextList as $e, TextListItem as b, Modal as Ue, Form as Be, FormGroup as He, Progress as Et, EmptyStateIcon as ze, ChipGroup as Ct, Chip as Pt, InputGroup as Rt, ButtonVariant as Ut, Pagination as xt, PaginationVariant as At, Skeleton as Ot } from "@patternfly/react-core";
|
|
4
|
+
import { EllipsisVIcon as Nt, ChevronDownIcon as Dt, ChevronRightIcon as qt, ErrorCircleOIcon as Lt, SearchIcon as $t } from "@patternfly/react-icons";
|
|
5
5
|
import { DateTime as ie } from "luxon";
|
|
6
6
|
import { Tr as de, Td as xe, Th as Ht, Table as jt, Thead as Ft, Tbody as Mt, ActionsColumn as Wt } from "@patternfly/react-table";
|
|
7
7
|
import Jt from "use-resize-observer";
|
|
@@ -82,22 +82,22 @@ var Gt = {
|
|
|
82
82
|
}
|
|
83
83
|
e.setLogger = i;
|
|
84
84
|
})(he || (he = {}));
|
|
85
|
-
var p = class
|
|
85
|
+
var p = class q {
|
|
86
86
|
constructor(t) {
|
|
87
87
|
this._name = t;
|
|
88
88
|
}
|
|
89
89
|
/* eslint-disable @typescript-eslint/no-unsafe-enum-comparison */
|
|
90
90
|
debug(...t) {
|
|
91
|
-
$ >= 4 && H.debug(
|
|
91
|
+
$ >= 4 && H.debug(q._format(this._name, this._method), ...t);
|
|
92
92
|
}
|
|
93
93
|
info(...t) {
|
|
94
|
-
$ >= 3 && H.info(
|
|
94
|
+
$ >= 3 && H.info(q._format(this._name, this._method), ...t);
|
|
95
95
|
}
|
|
96
96
|
warn(...t) {
|
|
97
|
-
$ >= 2 && H.warn(
|
|
97
|
+
$ >= 2 && H.warn(q._format(this._name, this._method), ...t);
|
|
98
98
|
}
|
|
99
99
|
error(...t) {
|
|
100
|
-
$ >= 1 && H.error(
|
|
100
|
+
$ >= 1 && H.error(q._format(this._name, this._method), ...t);
|
|
101
101
|
}
|
|
102
102
|
/* eslint-enable @typescript-eslint/no-unsafe-enum-comparison */
|
|
103
103
|
throw(t) {
|
|
@@ -108,7 +108,7 @@ var p = class D {
|
|
|
108
108
|
return s._method = t, s.debug("begin"), s;
|
|
109
109
|
}
|
|
110
110
|
static createStatic(t, s) {
|
|
111
|
-
const i = new
|
|
111
|
+
const i = new q(`${t}.${s}`);
|
|
112
112
|
return i.debug("begin"), i;
|
|
113
113
|
}
|
|
114
114
|
static _format(t, s) {
|
|
@@ -118,16 +118,16 @@ var p = class D {
|
|
|
118
118
|
/* eslint-disable @typescript-eslint/no-unsafe-enum-comparison */
|
|
119
119
|
// helpers for static class methods
|
|
120
120
|
static debug(t, ...s) {
|
|
121
|
-
$ >= 4 && H.debug(
|
|
121
|
+
$ >= 4 && H.debug(q._format(t), ...s);
|
|
122
122
|
}
|
|
123
123
|
static info(t, ...s) {
|
|
124
|
-
$ >= 3 && H.info(
|
|
124
|
+
$ >= 3 && H.info(q._format(t), ...s);
|
|
125
125
|
}
|
|
126
126
|
static warn(t, ...s) {
|
|
127
|
-
$ >= 2 && H.warn(
|
|
127
|
+
$ >= 2 && H.warn(q._format(t), ...s);
|
|
128
128
|
}
|
|
129
129
|
static error(t, ...s) {
|
|
130
|
-
$ >= 1 && H.error(
|
|
130
|
+
$ >= 1 && H.error(q._format(t), ...s);
|
|
131
131
|
}
|
|
132
132
|
/* eslint-enable @typescript-eslint/no-unsafe-enum-comparison */
|
|
133
133
|
};
|
|
@@ -706,7 +706,7 @@ var C = Ve, W = class {
|
|
|
706
706
|
fetchRequestCredentials: f,
|
|
707
707
|
refreshTokenAllowedScope: m,
|
|
708
708
|
// extra
|
|
709
|
-
extraQueryParams:
|
|
709
|
+
extraQueryParams: D = {},
|
|
710
710
|
extraTokenParams: J = {},
|
|
711
711
|
extraHeaders: K = {},
|
|
712
712
|
dpop: X,
|
|
@@ -719,7 +719,7 @@ var C = Ve, W = class {
|
|
|
719
719
|
const se = typeof window < "u" ? window.localStorage : new Ge();
|
|
720
720
|
this.stateStore = new Qe({ store: se });
|
|
721
721
|
}
|
|
722
|
-
if (this.refreshTokenAllowedScope = m, this.extraQueryParams =
|
|
722
|
+
if (this.refreshTokenAllowedScope = m, this.extraQueryParams = D, this.extraTokenParams = J, this.extraHeaders = K, this.dpop = X, this.dpop && !((Y = this.dpop) != null && Y.store))
|
|
723
723
|
throw new Error("A DPoPStore is required when dpop is enabled");
|
|
724
724
|
}
|
|
725
725
|
}, rs = class {
|
|
@@ -2410,28 +2410,38 @@ const Us = (e) => (V = Rs(Cs, e), new Es({
|
|
|
2410
2410
|
} catch (e) {
|
|
2411
2411
|
console.error("[Auth] Error logging in using OIDC: ", e);
|
|
2412
2412
|
}
|
|
2413
|
-
}, As = async () =>
|
|
2414
|
-
|
|
2415
|
-
|
|
2413
|
+
}, As = async () => {
|
|
2414
|
+
try {
|
|
2415
|
+
console.debug("[Auth] Refreshing token using OIDC"), await (u == null ? void 0 : u.signinSilent());
|
|
2416
|
+
} catch (e) {
|
|
2417
|
+
console.error("[Auth] Error refreshing token using OIDC: ", e);
|
|
2418
|
+
}
|
|
2419
|
+
}, Os = async () => {
|
|
2420
|
+
const e = await (u == null ? void 0 : u.getUser()), t = e == null ? void 0 : e.id_token;
|
|
2421
|
+
return u == null ? void 0 : u.removeUser().then(() => u == null ? void 0 : u.signoutRedirect({
|
|
2422
|
+
id_token_hint: t,
|
|
2423
|
+
post_logout_redirect_uri: V.logoutUrl || window.location.href
|
|
2424
|
+
}));
|
|
2425
|
+
}, Ns = async () => await (u == null ? void 0 : u.getUser()) != null, Ds = async () => {
|
|
2416
2426
|
const e = await (u == null ? void 0 : u.getUser());
|
|
2417
2427
|
return Promise.resolve(e == null ? void 0 : e.access_token);
|
|
2418
2428
|
}, qs = async () => {
|
|
2419
2429
|
const e = await (u == null ? void 0 : u.getUser());
|
|
2420
2430
|
return Promise.resolve(e == null ? void 0 : e.id_token);
|
|
2421
|
-
},
|
|
2431
|
+
}, Ls = async () => {
|
|
2422
2432
|
const e = await (u == null ? void 0 : u.getUser());
|
|
2423
2433
|
return Promise.resolve(e == null ? void 0 : e.profile.preferred_username);
|
|
2424
2434
|
};
|
|
2425
2435
|
let Q, ee;
|
|
2426
|
-
const
|
|
2436
|
+
const $s = async (e, t) => {
|
|
2427
2437
|
try {
|
|
2428
2438
|
console.debug("[Auth] Setting Username and Password for BasicAuth"), Q = e, ee = t;
|
|
2429
2439
|
} catch (s) {
|
|
2430
2440
|
console.error("[Auth] Error logging in using BasicAuth: ", s);
|
|
2431
2441
|
}
|
|
2432
|
-
},
|
|
2442
|
+
}, Hs = async () => {
|
|
2433
2443
|
console.debug("[Auth] Logout for BasicAuth"), Q = void 0, ee = void 0, window.location.reload();
|
|
2434
|
-
},
|
|
2444
|
+
}, js = async () => Q !== void 0 && ee !== void 0, Fs = async () => Promise.resolve(Q), Ms = () => {
|
|
2435
2445
|
if (Q !== void 0 && ee != null)
|
|
2436
2446
|
return {
|
|
2437
2447
|
username: Q,
|
|
@@ -2442,29 +2452,31 @@ const Ls = async (e, t) => {
|
|
|
2442
2452
|
return e.type === "oidc" ? (u === void 0 && (console.debug("[Auth] Creating OIDC UserManager with options: ", e.options), u = Us(e.options)), {
|
|
2443
2453
|
isOidcAuthEnabled: () => !0,
|
|
2444
2454
|
isBasicAuthEnabled: () => !1,
|
|
2445
|
-
isAuthenticated:
|
|
2455
|
+
isAuthenticated: Ns,
|
|
2446
2456
|
getToken: async () => {
|
|
2447
2457
|
if (e.options.logTokens) {
|
|
2448
2458
|
const t = await (u == null ? void 0 : u.getUser());
|
|
2449
2459
|
console.debug("[Auth] ID Token:"), console.debug(t == null ? void 0 : t.id_token), console.debug("[Auth] Access Token:"), console.debug(t == null ? void 0 : t.access_token);
|
|
2450
2460
|
}
|
|
2451
|
-
return e.options.tokenType === "id" ? qs() :
|
|
2461
|
+
return e.options.tokenType === "id" ? qs() : Ds();
|
|
2452
2462
|
},
|
|
2453
2463
|
getUsernameAndPassword: () => {
|
|
2454
2464
|
},
|
|
2455
|
-
getUsername:
|
|
2465
|
+
getUsername: Ls,
|
|
2456
2466
|
login: xs,
|
|
2457
|
-
|
|
2467
|
+
refresh: As,
|
|
2468
|
+
logout: Os
|
|
2458
2469
|
}) : e.type === "basic" ? {
|
|
2459
2470
|
isOidcAuthEnabled: () => !1,
|
|
2460
2471
|
isBasicAuthEnabled: () => !0,
|
|
2461
|
-
isAuthenticated:
|
|
2472
|
+
isAuthenticated: js,
|
|
2462
2473
|
getToken: async () => {
|
|
2463
2474
|
},
|
|
2464
|
-
getUsernameAndPassword:
|
|
2465
|
-
getUsername:
|
|
2466
|
-
login:
|
|
2467
|
-
|
|
2475
|
+
getUsernameAndPassword: Ms,
|
|
2476
|
+
getUsername: Fs,
|
|
2477
|
+
login: $s,
|
|
2478
|
+
refresh: () => Promise.resolve(),
|
|
2479
|
+
logout: Hs
|
|
2468
2480
|
} : {
|
|
2469
2481
|
isOidcAuthEnabled: () => !1,
|
|
2470
2482
|
isBasicAuthEnabled: () => !1,
|
|
@@ -2474,6 +2486,7 @@ const Ls = async (e, t) => {
|
|
|
2474
2486
|
getUsernameAndPassword: () => {
|
|
2475
2487
|
},
|
|
2476
2488
|
login: () => Promise.resolve(),
|
|
2489
|
+
refresh: () => Promise.resolve(),
|
|
2477
2490
|
logout: () => Promise.resolve()
|
|
2478
2491
|
};
|
|
2479
2492
|
}, Ee = (e) => {
|
|
@@ -2493,7 +2506,7 @@ const Ls = async (e, t) => {
|
|
|
2493
2506
|
return pe(() => {
|
|
2494
2507
|
o();
|
|
2495
2508
|
}, [e.date]), n === "fromNow" ? /* @__PURE__ */ a(pt, { content: /* @__PURE__ */ a("span", { children: i }), children: /* @__PURE__ */ a("span", { children: t }) }) : /* @__PURE__ */ a("span", { children: t });
|
|
2496
|
-
},
|
|
2509
|
+
}, ei = (e) => /* @__PURE__ */ a(Ee, { date: e.date, format: "fromNow" }), O = ({ condition: e, children: t }) => (typeof e == "boolean" ? e : e()) ? /* @__PURE__ */ a(j.Fragment, { children: t }) : /* @__PURE__ */ a(j.Fragment, {}), ti = ({ collection: e, emptyState: t, emptyStateTitle: s, emptyStateMessage: i, children: r }) => {
|
|
2497
2510
|
const n = () => !e || e.length === 0, o = t || /* @__PURE__ */ v(oe, { variant: ft.xs, children: [
|
|
2498
2511
|
/* @__PURE__ */ a(ae, { titleText: s || "None found", headingLevel: "h4" }),
|
|
2499
2512
|
/* @__PURE__ */ a(ve, { children: i || "No items found." })
|
|
@@ -2502,7 +2515,7 @@ const Ls = async (e, t) => {
|
|
|
2502
2515
|
}, _e = ({ isLoading: e, loadingComponent: t, children: s }) => {
|
|
2503
2516
|
const i = () => typeof e == "boolean" ? e : e(), r = t || /* @__PURE__ */ a(te, {});
|
|
2504
2517
|
return i() ? /* @__PURE__ */ a(j.Fragment, { children: r }) : /* @__PURE__ */ a(j.Fragment, { children: s });
|
|
2505
|
-
},
|
|
2518
|
+
}, si = ({ toolbar: e, alwaysShowToolbar: t, emptyState: s, filteredEmptyState: i, isLoading: r, isError: n, loadingComponent: o, errorComponent: c, isEmpty: l, isFiltered: d, children: h }) => {
|
|
2506
2519
|
const g = t || !l || d || n;
|
|
2507
2520
|
return c || (c = /* @__PURE__ */ a("div", { style: { padding: "15px", backgroundColor: "white" }, children: /* @__PURE__ */ a(wt, { isInline: !0, variant: "danger", title: "Error: Something went wrong!", children: /* @__PURE__ */ a("p", { children: "Something went wrong with the action you attempted, but we're not sure what it was. Try reloading the page and hopef for a better result, or contact your admin to report the error." }) }) })), /* @__PURE__ */ v(j.Fragment, { children: [
|
|
2508
2521
|
/* @__PURE__ */ a(O, { condition: g, children: e }),
|
|
@@ -2513,7 +2526,7 @@ const Ls = async (e, t) => {
|
|
|
2513
2526
|
/* @__PURE__ */ a(O, { condition: n, children: c })
|
|
2514
2527
|
] })
|
|
2515
2528
|
] });
|
|
2516
|
-
},
|
|
2529
|
+
}, ii = (e) => {
|
|
2517
2530
|
const [t, s] = T(!1), i = (l, d) => {
|
|
2518
2531
|
s(!1);
|
|
2519
2532
|
const h = d;
|
|
@@ -2559,7 +2572,7 @@ const Ls = async (e, t) => {
|
|
|
2559
2572
|
)) })
|
|
2560
2573
|
}
|
|
2561
2574
|
);
|
|
2562
|
-
},
|
|
2575
|
+
}, Ws = (e) => {
|
|
2563
2576
|
var l;
|
|
2564
2577
|
const [t, s] = T(!1), i = (d, h) => {
|
|
2565
2578
|
s(!1), e.onSelect(e.items[h]);
|
|
@@ -2602,18 +2615,18 @@ const Ls = async (e, t) => {
|
|
|
2602
2615
|
))
|
|
2603
2616
|
}
|
|
2604
2617
|
);
|
|
2605
|
-
},
|
|
2618
|
+
}, ri = ({ expanded: e, onClick: t }) => e ? /* @__PURE__ */ a(Dt, { onClick: t, style: { cursor: "pointer" } }) : /* @__PURE__ */ a(qt, { onClick: t, style: { cursor: "pointer" } }), lt = {
|
|
2606
2619
|
padding: "5px",
|
|
2607
2620
|
minHeight: "128px",
|
|
2608
2621
|
borderRight: 0,
|
|
2609
2622
|
borderLeft: 0,
|
|
2610
2623
|
borderBottom: "1px solid #666",
|
|
2611
2624
|
backgroundColor: "rgb(240, 240, 240)"
|
|
2612
|
-
},
|
|
2625
|
+
}, Js = {
|
|
2613
2626
|
...lt,
|
|
2614
2627
|
color: "red",
|
|
2615
2628
|
overflow: "auto"
|
|
2616
|
-
},
|
|
2629
|
+
}, ni = (e) => {
|
|
2617
2630
|
const [t, s] = T(""), [i, r] = T(""), [n, o] = T(!1), [c, l] = T(), d = (k, A) => {
|
|
2618
2631
|
s(A);
|
|
2619
2632
|
}, h = () => t != null && t.trim().length > 0, g = () => c != null && c.trim().length > 0, _ = () => {
|
|
@@ -2646,7 +2659,7 @@ const Ls = async (e, t) => {
|
|
|
2646
2659
|
/* @__PURE__ */ a("div", { className: "url-clear-button", children: /* @__PURE__ */ a(le, { "data-testid": `${e.testId}-clear`, variant: "control", isDisabled: !h(), onClick: S, children: "Clear" }) })
|
|
2647
2660
|
] }),
|
|
2648
2661
|
/* @__PURE__ */ a("div", { className: "url-upload-preview", children: /* @__PURE__ */ v(_e, { isLoading: n, loadingComponent: x, children: [
|
|
2649
|
-
/* @__PURE__ */ a(O, { condition: g, children: /* @__PURE__ */ v("div", { className: "url-upload-error", style:
|
|
2662
|
+
/* @__PURE__ */ a(O, { condition: g, children: /* @__PURE__ */ v("div", { className: "url-upload-error", style: Js, children: [
|
|
2650
2663
|
/* @__PURE__ */ a("div", { children: "Error getting content from URL." }),
|
|
2651
2664
|
/* @__PURE__ */ a("div", { children: c })
|
|
2652
2665
|
] }) }),
|
|
@@ -2662,7 +2675,7 @@ const Ls = async (e, t) => {
|
|
|
2662
2675
|
) })
|
|
2663
2676
|
] }) })
|
|
2664
2677
|
] });
|
|
2665
|
-
},
|
|
2678
|
+
}, oi = (e) => {
|
|
2666
2679
|
const [t, s] = T(), [i, r] = T();
|
|
2667
2680
|
return pe(() => {
|
|
2668
2681
|
e.isOpen && (typeof e.frontendInfo == "function" ? e.frontendInfo().then(s) : s(e.frontendInfo), typeof e.backendInfo == "function" ? e.backendInfo().then(r) : r(e.backendInfo));
|
|
@@ -2677,7 +2690,7 @@ const Ls = async (e, t) => {
|
|
|
2677
2690
|
brandImageAlt: e.brandImageAlt,
|
|
2678
2691
|
"aria-label": e.brandImageAlt,
|
|
2679
2692
|
children: /* @__PURE__ */ v(It, { className: "app-about-modal-content", style: { marginTop: "-25px" }, children: [
|
|
2680
|
-
/* @__PURE__ */ a(
|
|
2693
|
+
/* @__PURE__ */ a(qe, { component: Le.h2, children: "Web console info" }),
|
|
2681
2694
|
/* @__PURE__ */ a(_e, { isLoading: t === void 0, children: /* @__PURE__ */ v($e, { component: "dl", children: [
|
|
2682
2695
|
/* @__PURE__ */ a(b, { component: "dt", children: "Project" }),
|
|
2683
2696
|
/* @__PURE__ */ a(b, { component: "dd", children: /* @__PURE__ */ a("a", { href: t == null ? void 0 : t.url, target: "_blank", children: t == null ? void 0 : t.name }) }),
|
|
@@ -2688,7 +2701,7 @@ const Ls = async (e, t) => {
|
|
|
2688
2701
|
/* @__PURE__ */ a(b, { component: "dt", children: "Digest" }),
|
|
2689
2702
|
/* @__PURE__ */ a(b, { component: "dd", children: t == null ? void 0 : t.digest })
|
|
2690
2703
|
] }) }),
|
|
2691
|
-
/* @__PURE__ */ a(
|
|
2704
|
+
/* @__PURE__ */ a(qe, { style: { marginTop: "40px" }, component: Le.h2, children: e.backendLabel }),
|
|
2692
2705
|
/* @__PURE__ */ a(_e, { isLoading: i === void 0, children: /* @__PURE__ */ v($e, { component: "dl", children: [
|
|
2693
2706
|
/* @__PURE__ */ a(b, { component: "dt", children: "Name" }),
|
|
2694
2707
|
/* @__PURE__ */ a(b, { component: "dd", children: (i == null ? void 0 : i.name) || "" }),
|
|
@@ -2702,7 +2715,7 @@ const Ls = async (e, t) => {
|
|
|
2702
2715
|
] })
|
|
2703
2716
|
}
|
|
2704
2717
|
);
|
|
2705
|
-
},
|
|
2718
|
+
}, Ks = (e) => {
|
|
2706
2719
|
const [t, s] = T({
|
|
2707
2720
|
username: "",
|
|
2708
2721
|
password: ""
|
|
@@ -2777,7 +2790,7 @@ const Ls = async (e, t) => {
|
|
|
2777
2790
|
] })
|
|
2778
2791
|
}
|
|
2779
2792
|
);
|
|
2780
|
-
},
|
|
2793
|
+
}, ai = (e) => /* @__PURE__ */ v(
|
|
2781
2794
|
Ue,
|
|
2782
2795
|
{
|
|
2783
2796
|
title: "Please Wait",
|
|
@@ -2793,7 +2806,7 @@ const Ls = async (e, t) => {
|
|
|
2793
2806
|
/* @__PURE__ */ a("span", { className: "message", style: { fontSize: "15px", color: "#333", marginLeft: "10px" }, children: e.message })
|
|
2794
2807
|
]
|
|
2795
2808
|
}
|
|
2796
|
-
),
|
|
2809
|
+
), ci = (e) => /* @__PURE__ */ a(
|
|
2797
2810
|
Ue,
|
|
2798
2811
|
{
|
|
2799
2812
|
title: e.title,
|
|
@@ -2805,7 +2818,7 @@ const Ls = async (e, t) => {
|
|
|
2805
2818
|
"aria-label": "progress-modal",
|
|
2806
2819
|
children: /* @__PURE__ */ a(Et, { title: e.message, value: e.progress })
|
|
2807
2820
|
}
|
|
2808
|
-
),
|
|
2821
|
+
), li = (e) => {
|
|
2809
2822
|
const [t, s] = T(
|
|
2810
2823
|
0
|
|
2811
2824
|
/* AUTHENTICATING */
|
|
@@ -2835,24 +2848,24 @@ const Ls = async (e, t) => {
|
|
|
2835
2848
|
/* @__PURE__ */ a(ae, { titleText: "Loading", headingLevel: "h4" }),
|
|
2836
2849
|
/* @__PURE__ */ a(ve, { children: /* @__PURE__ */ a(te, { size: "xl", "aria-label": "Loading spinner" }) })
|
|
2837
2850
|
] }) }),
|
|
2838
|
-
/* @__PURE__ */ a(O, { condition: t === 0 && i.isBasicAuthEnabled(), children: /* @__PURE__ */ a(
|
|
2851
|
+
/* @__PURE__ */ a(O, { condition: t === 0 && i.isBasicAuthEnabled(), children: /* @__PURE__ */ a(Ks, { onLogin: r }) }),
|
|
2839
2852
|
/* @__PURE__ */ a(O, { condition: t === 2, children: /* @__PURE__ */ v(oe, { children: [
|
|
2840
2853
|
/* @__PURE__ */ a(ae, { titleText: "Empty state", headingLevel: "h4", icon: /* @__PURE__ */ a(ze, { icon: Lt }) }),
|
|
2841
2854
|
/* @__PURE__ */ a(ve, { children: "Authentication failed." })
|
|
2842
2855
|
] }) }),
|
|
2843
2856
|
/* @__PURE__ */ a(O, { condition: t === 1, children: e.children })
|
|
2844
2857
|
] });
|
|
2845
|
-
},
|
|
2858
|
+
}, di = (e) => {
|
|
2846
2859
|
const t = ct();
|
|
2847
2860
|
return (() => {
|
|
2848
2861
|
let i = !0;
|
|
2849
2862
|
return e.enabled !== void 0 && (i = i && (t.isOidcAuthEnabled() === e.enabled || t.isBasicAuthEnabled() === e.enabled)), i;
|
|
2850
2863
|
})() ? /* @__PURE__ */ a(j.Fragment, { children: e.children }) : /* @__PURE__ */ a(j.Fragment, {});
|
|
2851
|
-
},
|
|
2864
|
+
}, hi = (e) => /* @__PURE__ */ a(Ct, { categoryName: e.categoryName || "Filters", isClosable: !0, onClick: e.onClearAllCriteria, children: e.criteria.map((t, s) => /* @__PURE__ */ v(Pt, { onClick: () => e.onRemoveCriteria(t), children: [
|
|
2852
2865
|
/* @__PURE__ */ a("b", { children: t.filterBy.label }),
|
|
2853
2866
|
/* @__PURE__ */ a("span", { children: ": " }),
|
|
2854
2867
|
/* @__PURE__ */ a("span", { children: t.filterValue })
|
|
2855
|
-
] }, s)) }),
|
|
2868
|
+
] }, s)) }), gi = (e) => {
|
|
2856
2869
|
const [t, s] = T(e.filterTypes[0]), [i, r] = T(""), n = (o) => {
|
|
2857
2870
|
o && o.preventDefault(), e.onAddCriteria({
|
|
2858
2871
|
filterBy: t,
|
|
@@ -2863,7 +2876,7 @@ const Ls = async (e, t) => {
|
|
|
2863
2876
|
s(e.filterTypes[0]);
|
|
2864
2877
|
}, [e.filterTypes]), /* @__PURE__ */ a(Be, { onSubmit: n, children: /* @__PURE__ */ v(Rt, { children: [
|
|
2865
2878
|
/* @__PURE__ */ a(
|
|
2866
|
-
|
|
2879
|
+
Ws,
|
|
2867
2880
|
{
|
|
2868
2881
|
value: t,
|
|
2869
2882
|
items: e.filterTypes,
|
|
@@ -2898,7 +2911,7 @@ const Ls = async (e, t) => {
|
|
|
2898
2911
|
)
|
|
2899
2912
|
] }) });
|
|
2900
2913
|
};
|
|
2901
|
-
function
|
|
2914
|
+
function ui() {
|
|
2902
2915
|
return /* @__PURE__ */ a(oe, { children: /* @__PURE__ */ a(
|
|
2903
2916
|
ae,
|
|
2904
2917
|
{
|
|
@@ -2908,7 +2921,7 @@ function gi() {
|
|
|
2908
2921
|
}
|
|
2909
2922
|
) });
|
|
2910
2923
|
}
|
|
2911
|
-
function
|
|
2924
|
+
function _i({
|
|
2912
2925
|
itemCount: e,
|
|
2913
2926
|
page: t,
|
|
2914
2927
|
perPage: s,
|
|
@@ -2929,7 +2942,7 @@ function ui({
|
|
|
2929
2942
|
}
|
|
2930
2943
|
);
|
|
2931
2944
|
}
|
|
2932
|
-
function
|
|
2945
|
+
function Bs({ columns: e, rows: t, getTd: s = () => xe }) {
|
|
2933
2946
|
const i = new Array(e).fill(0).map((n, o) => {
|
|
2934
2947
|
const c = s(o);
|
|
2935
2948
|
return /* @__PURE__ */ a(c, { children: /* @__PURE__ */ a(
|
|
@@ -2941,7 +2954,7 @@ function Ks({ columns: e, rows: t, getTd: s = () => xe }) {
|
|
|
2941
2954
|
}), r = new Array(t).fill(0).map((n, o) => /* @__PURE__ */ a(de, { children: i }, `row_${o}`));
|
|
2942
2955
|
return /* @__PURE__ */ a(Re, { children: r });
|
|
2943
2956
|
}
|
|
2944
|
-
const
|
|
2957
|
+
const pi = ({
|
|
2945
2958
|
ariaLabel: e,
|
|
2946
2959
|
minimumColumnWidth: t = 250,
|
|
2947
2960
|
columns: s,
|
|
@@ -2969,8 +2982,8 @@ const _i = ({
|
|
|
2969
2982
|
}, { ref: R } = Jt({ onResize: F }), w = I >= 576, E = Ne(
|
|
2970
2983
|
(f) => w && f !== 0 && f !== s.length - 1,
|
|
2971
2984
|
[s, w]
|
|
2972
|
-
), U =
|
|
2973
|
-
const
|
|
2985
|
+
), U = De(() => s.map((f, m) => {
|
|
2986
|
+
const D = ne(
|
|
2974
2987
|
({ children: J, ...K }, X) => /* @__PURE__ */ a(
|
|
2975
2988
|
dt,
|
|
2976
2989
|
{
|
|
@@ -2985,8 +2998,8 @@ const _i = ({
|
|
|
2985
2998
|
}
|
|
2986
2999
|
)
|
|
2987
3000
|
);
|
|
2988
|
-
return
|
|
2989
|
-
Th:
|
|
3001
|
+
return D.displayName = "ResponsiveThCurried", r({
|
|
3002
|
+
Th: D,
|
|
2990
3003
|
key: `header_${f}`,
|
|
2991
3004
|
column: f,
|
|
2992
3005
|
colIndex: m
|
|
@@ -3001,7 +3014,7 @@ const _i = ({
|
|
|
3001
3014
|
]), y = Ne(
|
|
3002
3015
|
(f) => {
|
|
3003
3016
|
const m = ne(
|
|
3004
|
-
({ children:
|
|
3017
|
+
({ children: D, ...J }, K) => /* @__PURE__ */ a(
|
|
3005
3018
|
Ce,
|
|
3006
3019
|
{
|
|
3007
3020
|
position: f,
|
|
@@ -3010,14 +3023,14 @@ const _i = ({
|
|
|
3010
3023
|
canHide: E(f),
|
|
3011
3024
|
...J,
|
|
3012
3025
|
ref: K,
|
|
3013
|
-
children:
|
|
3026
|
+
children: D
|
|
3014
3027
|
}
|
|
3015
3028
|
)
|
|
3016
3029
|
);
|
|
3017
3030
|
return m.displayName = "ResponsiveTdCurried", m;
|
|
3018
3031
|
},
|
|
3019
3032
|
[E, t, I]
|
|
3020
|
-
), z =
|
|
3033
|
+
), z = De(
|
|
3021
3034
|
() => s.map((f, m) => y(m)),
|
|
3022
3035
|
[s, y]
|
|
3023
3036
|
);
|
|
@@ -3034,7 +3047,7 @@ const _i = ({
|
|
|
3034
3047
|
/* @__PURE__ */ a(Ft, { children: /* @__PURE__ */ a(de, { children: U }) }),
|
|
3035
3048
|
/* @__PURE__ */ v(Mt, { children: [
|
|
3036
3049
|
i === void 0 && /* @__PURE__ */ a(
|
|
3037
|
-
|
|
3050
|
+
Bs,
|
|
3038
3051
|
{
|
|
3039
3052
|
columns: s.length,
|
|
3040
3053
|
rows: h,
|
|
@@ -3042,14 +3055,14 @@ const _i = ({
|
|
|
3042
3055
|
}
|
|
3043
3056
|
),
|
|
3044
3057
|
i == null ? void 0 : i.map((f, m) => {
|
|
3045
|
-
const
|
|
3058
|
+
const D = l !== void 0 && l({ row: f, rowIndex: m }), J = d !== void 0 && d({ row: f, rowIndex: m }), K = !D && g ? () => g({ row: f, rowIndex: m }) : void 0, X = s.map((Y, se) => n({
|
|
3046
3059
|
Td: z[se],
|
|
3047
3060
|
key: `row_${m}_cell_${Y}`,
|
|
3048
3061
|
column: Y,
|
|
3049
3062
|
colIndex: se,
|
|
3050
3063
|
rowIndex: m,
|
|
3051
3064
|
row: f
|
|
3052
|
-
})), fe = !
|
|
3065
|
+
})), fe = !D && o && /* @__PURE__ */ a(
|
|
3053
3066
|
Ce,
|
|
3054
3067
|
{
|
|
3055
3068
|
position: s.length,
|
|
@@ -3064,7 +3077,7 @@ const _i = ({
|
|
|
3064
3077
|
return /* @__PURE__ */ v(
|
|
3065
3078
|
ht,
|
|
3066
3079
|
{
|
|
3067
|
-
isDeleted:
|
|
3080
|
+
isDeleted: D,
|
|
3068
3081
|
isSelected: J,
|
|
3069
3082
|
onClick: K,
|
|
3070
3083
|
rowOuiaId: S == null ? void 0 : S({ row: f, rowIndex: m }),
|
|
@@ -3145,31 +3158,31 @@ const ht = Pe(
|
|
|
3145
3158
|
);
|
|
3146
3159
|
ht.displayName = "DeletableRow";
|
|
3147
3160
|
export {
|
|
3148
|
-
|
|
3149
|
-
|
|
3161
|
+
oi as AppAboutModal,
|
|
3162
|
+
li as ApplicationAuth,
|
|
3150
3163
|
Kt as AuthConfigContext,
|
|
3151
|
-
|
|
3152
|
-
|
|
3164
|
+
Ks as BasicAuthModal,
|
|
3165
|
+
gi as ChipFilterInput,
|
|
3153
3166
|
Ee as DateTime,
|
|
3154
3167
|
ht as DeletableRow,
|
|
3155
|
-
|
|
3156
|
-
|
|
3168
|
+
hi as FilterChips,
|
|
3169
|
+
ei as FromNow,
|
|
3157
3170
|
O as If,
|
|
3158
|
-
|
|
3159
|
-
|
|
3171
|
+
di as IfAuth,
|
|
3172
|
+
ti as IfNotEmpty,
|
|
3160
3173
|
_e as IfNotLoading,
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3174
|
+
si as ListWithToolbar,
|
|
3175
|
+
ui as Loading,
|
|
3176
|
+
ii as ObjectDropdown,
|
|
3177
|
+
Ws as ObjectSelect,
|
|
3178
|
+
_i as Pagination,
|
|
3179
|
+
ai as PleaseWaitModal,
|
|
3180
|
+
ci as ProgressModal,
|
|
3181
|
+
pi as ResponsiveTable,
|
|
3169
3182
|
Ce as ResponsiveTd,
|
|
3170
3183
|
dt as ResponsiveTh,
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3184
|
+
Bs as TableSkeleton,
|
|
3185
|
+
ri as ToggleIcon,
|
|
3186
|
+
ni as UrlUpload,
|
|
3174
3187
|
ct as useAuth
|
|
3175
3188
|
};
|
package/package.json
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apicurio/common-ui-components",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.15",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/main.js",
|
|
7
7
|
"types": "dist/main.d.ts",
|
|
8
8
|
"files": [
|
|
9
9
|
"dist"
|
|
10
10
|
],
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "https://github.com/Apicurio/apicurio-common-ui-components"
|
|
14
|
+
},
|
|
11
15
|
"scripts": {
|
|
12
16
|
"clean": "rimraf dist",
|
|
13
17
|
"dev": "vite",
|