@apicurio/common-ui-components 1.0.6 → 1.0.8

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/README.md CHANGED
@@ -1,27 +1,24 @@
1
- # React + TypeScript + Vite
1
+ # Apicurio Common UI Components
2
+ This library contains some React + Patternfly UI components that are used across multiple Apicurio
3
+ UI projects.
2
4
 
3
- This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
5
+ ## Building
6
+ Use standard Node/NPM tooling to build the code in this library.
4
7
 
5
- Currently, two official plugins are available:
6
-
7
- - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
8
- - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
9
-
10
- ## Expanding the ESLint configuration
11
-
12
- If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
8
+ ```
9
+ npm install
10
+ npm run lint
11
+ npm run build
12
+ ```
13
13
 
14
- - Configure the top-level `parserOptions` property like this:
14
+ ## Developing
15
+ This library includes a demo application that showcases the components it provides, and allows easy
16
+ iterative development.
15
17
 
16
- ```js
17
- parserOptions: {
18
- ecmaVersion: 'latest',
19
- sourceType: 'module',
20
- project: ['./tsconfig.json', './tsconfig.node.json'],
21
- tsconfigRootDir: __dirname,
22
- },
18
+ ```
19
+ npm install
20
+ npm run dev
23
21
  ```
24
22
 
25
- - Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
26
- - Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
27
- - Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list
23
+ Once running, open your browser to the URL indicated by the output of `npm run dev`. You will
24
+ see the showcase application.
@@ -0,0 +1,10 @@
1
+ import { FunctionComponent } from "react";
2
+ /**
3
+ * Properties
4
+ */
5
+ export type DateTimeProps = {
6
+ date: Date | string | undefined;
7
+ format?: string;
8
+ locale?: string;
9
+ };
10
+ export declare const DateTime: FunctionComponent<DateTimeProps>;
@@ -0,0 +1,5 @@
1
+ import { FunctionComponent } from "react";
2
+ export type FromNowProps = {
3
+ date: Date | string | undefined;
4
+ };
5
+ export declare const FromNow: FunctionComponent<FromNowProps>;
@@ -9,6 +9,8 @@ export type ObjectDropdownProps = {
9
9
  onSelect: (value: any | undefined) => void;
10
10
  itemToString: (value: any) => string;
11
11
  itemIsDivider?: (value: any) => boolean;
12
+ itemIsVisible?: (value: any) => boolean;
13
+ itemIsDisabled?: (value: any) => boolean;
12
14
  itemToTestId?: (value: any) => string;
13
15
  noSelectionLabel?: string;
14
16
  menuAppendTo?: HTMLElement | (() => HTMLElement) | "inline";
@@ -0,0 +1,9 @@
1
+ import { FunctionComponent } from "react";
2
+ /**
3
+ * Properties
4
+ */
5
+ export type ToggleIconProps = {
6
+ expanded: boolean;
7
+ onClick: () => void;
8
+ };
9
+ export declare const ToggleIcon: FunctionComponent<ToggleIconProps>;
@@ -1,7 +1,10 @@
1
+ export * from "./DateTime";
2
+ export * from "./FromNow";
1
3
  export * from "./If";
2
4
  export * from "./IfNotEmpty";
3
5
  export * from "./IfNotLoading";
4
6
  export * from "./ListWithToolbar";
5
7
  export * from "./ObjectDropdown";
6
8
  export * from "./ObjectSelect";
9
+ export * from "./ToggleIcon";
7
10
  export * from "./UrlUpload";
package/dist/main.js CHANGED
@@ -1,179 +1,194 @@
1
- import { jsx as t, jsxs as g, Fragment as ie } from "react/jsx-runtime";
2
- import y, { useState as v, useEffect as D, useRef as w, useCallback as L, useMemo as j, memo as V, forwardRef as E } from "react";
3
- import { EmptyState as re, EmptyStateVariant as be, EmptyStateHeader as oe, EmptyStateBody as pe, Spinner as A, Alert as Te, Dropdown as Se, MenuToggle as H, DropdownList as Ie, Divider as le, DropdownItem as ye, Select as G, SelectOption as K, TextInput as Ce, Button as X, TextArea as we, AboutModal as xe, TextContent as Ne, Text as Y, TextVariants as Z, TextList as ee, TextListItem as f, Modal as ae, Progress as Oe, EmptyStateIcon as Re, Pagination as _e, PaginationVariant as ke, Skeleton as Fe, SearchInput as Le, SelectList as $e, ToolbarItem as De, InputGroup as Ee, ToolbarToggleGroup as ze, ToolbarGroup as Pe, ToolbarFilter as Ae } from "@patternfly/react-core";
4
- import { EllipsisVIcon as He, FilterIcon as ce } from "@patternfly/react-icons";
5
- import { Tr as z, Td as q, Th as We, Table as Be, Thead as Me, Tbody as je, ActionsColumn as Ue } from "@patternfly/react-table";
6
- const C = ({ condition: e, children: n }) => (typeof e == "boolean" ? e : e()) ? /* @__PURE__ */ t(y.Fragment, { children: n }) : /* @__PURE__ */ t(y.Fragment, {}), nt = ({ collection: e, emptyState: n, emptyStateTitle: i, emptyStateMessage: r, children: c }) => {
7
- const d = () => !e || e.length === 0, l = n || /* @__PURE__ */ g(re, { variant: be.xs, children: [
8
- /* @__PURE__ */ t(oe, { titleText: i || "None found", headingLevel: "h4" }),
9
- /* @__PURE__ */ t(pe, { children: r || "No items found." })
1
+ import { jsx as t, jsxs as u, Fragment as W } from "react/jsx-runtime";
2
+ import p, { useState as v, useEffect as te, memo as V, forwardRef as F, useCallback as q, useMemo as J } from "react";
3
+ import { DateTime as j } from "luxon";
4
+ import { EmptyState as ne, EmptyStateVariant as ve, EmptyStateHeader as ie, EmptyStateBody as be, Spinner as x, Alert as pe, Dropdown as Te, MenuToggle as $, DropdownList as Ie, Divider as oe, DropdownItem as ye, Select as B, SelectOption as U, TextInput as Se, Button as Q, TextArea as Ce, AboutModal as Ne, TextContent as we, Text as X, TextVariants as Y, TextList as Z, TextListItem as f, Modal as le, Progress as De, EmptyStateIcon as Oe, Pagination as Fe, PaginationVariant as Le, Skeleton as _e, SearchInput as xe, SelectList as $e, ToolbarItem as ke, InputGroup as Re, ToolbarToggleGroup as Pe, ToolbarGroup as Ae, ToolbarFilter as Ee } from "@patternfly/react-core";
5
+ import { EllipsisVIcon as Me, ChevronDownIcon as je, ChevronRightIcon as He, FilterIcon as ae } from "@patternfly/react-icons";
6
+ import { Tr as L, Td as G, Th as We, Table as Ve, Thead as Be, Tbody as Ue, ActionsColumn as Ge } from "@patternfly/react-table";
7
+ import ze from "use-resize-observer";
8
+ const Ke = (e) => {
9
+ const [n, i] = v(null), o = e.format || "locale";
10
+ return te(() => {
11
+ let a;
12
+ if (e.date && typeof e.date == "string" ? a = j.fromISO(e.date) : e.date && typeof e.date == "object" && (a = j.fromJSDate(e.date)), a) {
13
+ const r = {
14
+ locale: e.locale
15
+ };
16
+ i(o === "fromNow" ? a.toRelative() : o === "locale" ? a.toLocaleString(j.DATETIME_FULL, r) : a.toFormat(o, r));
17
+ } else
18
+ i(null);
19
+ }, [e.date]), /* @__PURE__ */ t("span", { children: n || "" });
20
+ }, lt = (e) => /* @__PURE__ */ t(Ke, { date: e.date, format: "fromNow" }), y = ({ condition: e, children: n }) => (typeof e == "boolean" ? e : e()) ? /* @__PURE__ */ t(p.Fragment, { children: n }) : /* @__PURE__ */ t(p.Fragment, {}), at = ({ collection: e, emptyState: n, emptyStateTitle: i, emptyStateMessage: o, children: a }) => {
21
+ const r = () => !e || e.length === 0, c = n || /* @__PURE__ */ u(ne, { variant: ve.xs, children: [
22
+ /* @__PURE__ */ t(ie, { titleText: i || "None found", headingLevel: "h4" }),
23
+ /* @__PURE__ */ t(be, { children: o || "No items found." })
10
24
  ] });
11
- return d() ? /* @__PURE__ */ t(y.Fragment, { children: l }) : /* @__PURE__ */ t(y.Fragment, { children: c });
12
- }, P = ({ isLoading: e, loadingComponent: n, children: i }) => {
13
- const r = () => typeof e == "boolean" ? e : e(), c = n || /* @__PURE__ */ t(A, {});
14
- return r() ? /* @__PURE__ */ t(y.Fragment, { children: c }) : /* @__PURE__ */ t(y.Fragment, { children: i });
15
- }, it = ({ toolbar: e, alwaysShowToolbar: n, emptyState: i, filteredEmptyState: r, isLoading: c, isError: d, loadingComponent: l, errorComponent: o, isEmpty: a, isFiltered: s, children: h }) => {
16
- const b = n || !a || s || d;
17
- return o || (o = /* @__PURE__ */ t("div", { style: { padding: "15px", backgroundColor: "white" }, children: /* @__PURE__ */ t(Te, { isInline: !0, variant: "danger", title: "Error: Something went wrong!", children: /* @__PURE__ */ t("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__ */ g(y.Fragment, { children: [
18
- /* @__PURE__ */ t(C, { condition: b, children: e }),
19
- /* @__PURE__ */ g(P, { isLoading: c, loadingComponent: l, children: [
20
- /* @__PURE__ */ t(C, { condition: !a && !d, children: h }),
21
- /* @__PURE__ */ t(C, { condition: a && s && !d, children: r }),
22
- /* @__PURE__ */ t(C, { condition: a && !s && !d, children: i }),
23
- /* @__PURE__ */ t(C, { condition: d, children: o })
25
+ return r() ? /* @__PURE__ */ t(p.Fragment, { children: c }) : /* @__PURE__ */ t(p.Fragment, { children: a });
26
+ }, _ = ({ isLoading: e, loadingComponent: n, children: i }) => {
27
+ const o = () => typeof e == "boolean" ? e : e(), a = n || /* @__PURE__ */ t(x, {});
28
+ return o() ? /* @__PURE__ */ t(p.Fragment, { children: a }) : /* @__PURE__ */ t(p.Fragment, { children: i });
29
+ }, rt = ({ toolbar: e, alwaysShowToolbar: n, emptyState: i, filteredEmptyState: o, isLoading: a, isError: r, loadingComponent: c, errorComponent: l, isEmpty: s, isFiltered: d, children: g }) => {
30
+ const T = n || !s || d || r;
31
+ return l || (l = /* @__PURE__ */ t("div", { style: { padding: "15px", backgroundColor: "white" }, children: /* @__PURE__ */ t(pe, { isInline: !0, variant: "danger", title: "Error: Something went wrong!", children: /* @__PURE__ */ t("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__ */ u(p.Fragment, { children: [
32
+ /* @__PURE__ */ t(y, { condition: T, children: e }),
33
+ /* @__PURE__ */ u(_, { isLoading: a, loadingComponent: c, children: [
34
+ /* @__PURE__ */ t(y, { condition: !s && !r, children: g }),
35
+ /* @__PURE__ */ t(y, { condition: s && d && !r, children: o }),
36
+ /* @__PURE__ */ t(y, { condition: s && !d && !r, children: i }),
37
+ /* @__PURE__ */ t(y, { condition: r, children: l })
24
38
  ] })
25
39
  ] });
26
- }, rt = (e) => {
27
- const [n, i] = v(!1), r = (a, s) => {
40
+ }, ct = (e) => {
41
+ const [n, i] = v(!1), o = (s, d) => {
28
42
  i(!1);
29
- const h = s;
30
- h !== void 0 && h >= 0 ? e.onSelect(e.items[h]) : e.onSelect(void 0);
31
- }, c = () => {
43
+ const g = d;
44
+ g !== void 0 && g >= 0 ? e.onSelect(e.items[g]) : e.onSelect(void 0);
45
+ }, a = () => {
32
46
  i(!n);
33
- }, d = (a) => {
34
- let s;
35
- return e.itemToTestId !== void 0 && (s = e.itemToTestId(a)), s;
36
- }, l = e.popperProps || {
47
+ }, r = (s) => {
48
+ let d;
49
+ return e.itemToTestId !== void 0 && (d = e.itemToTestId(s)), d;
50
+ }, c = e.popperProps || {
37
51
  appendTo: e.menuAppendTo
38
52
  };
39
- let o = /* @__PURE__ */ t(He, { title: e.label });
40
- return e.isKebab || (o = /* @__PURE__ */ t(y.Fragment, { children: e.label })), /* @__PURE__ */ t(
41
- Se,
53
+ let l = /* @__PURE__ */ t(Me, { title: e.label });
54
+ return e.isKebab || (l = /* @__PURE__ */ t(p.Fragment, { children: e.label })), /* @__PURE__ */ t(
55
+ Te,
42
56
  {
43
57
  isOpen: n,
44
- onSelect: r,
45
- onOpenChange: (a) => i(a),
46
- toggle: (a) => /* @__PURE__ */ t(
47
- H,
58
+ onSelect: o,
59
+ onOpenChange: (s) => i(s),
60
+ toggle: (s) => /* @__PURE__ */ t(
61
+ $,
48
62
  {
49
63
  "data-testid": e.testId,
50
- ref: a,
51
- onClick: c,
64
+ ref: s,
65
+ onClick: a,
52
66
  isExpanded: n,
53
67
  variant: e.isKebab ? "plain" : "default",
54
- children: o
68
+ children: l
55
69
  }
56
70
  ),
57
71
  ouiaId: "ObjectDropdown",
58
- popperProps: l,
72
+ popperProps: c,
59
73
  shouldFocusToggleOnSelect: !0,
60
- children: /* @__PURE__ */ t(Ie, { children: e.items.map((a, s) => e.itemIsDivider && e.itemIsDivider(a) ? /* @__PURE__ */ t(le, { component: "li" }, `divider-${s}`) : /* @__PURE__ */ t(
74
+ children: /* @__PURE__ */ t(Ie, { children: e.items.map((s, d) => e.itemIsVisible !== void 0 && !e.itemIsVisible(s) ? /* @__PURE__ */ t(W, {}) : e.itemIsDivider && e.itemIsDivider(s) ? /* @__PURE__ */ t(oe, { component: "li" }, `divider-${d}`) : /* @__PURE__ */ t(
61
75
  ye,
62
76
  {
63
- value: s,
64
- component: (h) => /* @__PURE__ */ t("button", { ...h, "data-testid": d(a) }),
65
- children: e.itemToString(a)
77
+ value: d,
78
+ isDisabled: e.itemIsDisabled === void 0 ? !1 : e.itemIsDisabled(s),
79
+ component: (g) => /* @__PURE__ */ t("button", { ...g, "data-testid": r(s) }),
80
+ children: e.itemToString(s)
66
81
  },
67
- `action-${s}`
82
+ `action-${d}`
68
83
  )) })
69
84
  }
70
85
  );
71
- }, ot = (e) => {
72
- var o;
73
- const [n, i] = v(!1), r = (a, s) => {
74
- i(!1), e.onSelect(e.items[s]);
75
- }, c = () => {
86
+ }, st = (e) => {
87
+ var l;
88
+ const [n, i] = v(!1), o = (s, d) => {
89
+ i(!1), e.onSelect(e.items[d]);
90
+ }, a = () => {
76
91
  i(!n);
77
- }, d = (a) => {
78
- let s;
79
- return e.itemToTestId !== void 0 && (s = e.itemToTestId(a)), s;
92
+ }, r = (s) => {
93
+ let d;
94
+ return e.itemToTestId !== void 0 && (d = e.itemToTestId(s)), d;
80
95
  };
81
96
  return /* @__PURE__ */ t(
82
- G,
97
+ B,
83
98
  {
84
- toggle: (a) => /* @__PURE__ */ t(
85
- H,
99
+ toggle: (s) => /* @__PURE__ */ t(
100
+ $,
86
101
  {
87
- ref: a,
102
+ ref: s,
88
103
  className: e.toggleClassname || "menu-toggle",
89
- onClick: c,
104
+ onClick: a,
90
105
  "data-testid": e.testId,
91
106
  isExpanded: n,
92
107
  children: e.value ? e.itemToString(e.value) : e.noSelectionLabel
93
108
  }
94
109
  ),
95
110
  id: e.toggleId,
96
- onSelect: r,
111
+ onSelect: o,
97
112
  onOpenChange: i,
98
113
  isOpen: n,
99
- children: (o = e.items) == null ? void 0 : o.map((a, s) => e.itemIsDivider && e.itemIsDivider(a) ? /* @__PURE__ */ t(le, {}, s) : /* @__PURE__ */ t(
100
- K,
114
+ children: (l = e.items) == null ? void 0 : l.map((s, d) => e.itemIsDivider && e.itemIsDivider(s) ? /* @__PURE__ */ t(oe, {}, d) : /* @__PURE__ */ t(
115
+ U,
101
116
  {
102
- isSelected: a === e.value,
103
- component: (h) => /* @__PURE__ */ t("button", { ...h, "data-testid": d(a) }),
104
- value: s,
105
- children: e.itemToString(a)
117
+ isSelected: s === e.value,
118
+ component: (g) => /* @__PURE__ */ t("button", { ...g, "data-testid": r(s) }),
119
+ value: d,
120
+ children: e.itemToString(s)
106
121
  },
107
- s
122
+ d
108
123
  ))
109
124
  }
110
125
  );
111
- }, de = {
126
+ }, dt = ({ expanded: e, onClick: n }) => e ? /* @__PURE__ */ t(je, { onClick: n, style: { cursor: "pointer" } }) : /* @__PURE__ */ t(He, { onClick: n, style: { cursor: "pointer" } }), re = {
112
127
  padding: "5px",
113
128
  minHeight: "128px",
114
129
  borderRight: 0,
115
130
  borderLeft: 0,
116
131
  borderBottom: "1px solid #666",
117
132
  backgroundColor: "rgb(240, 240, 240)"
118
- }, Ve = {
119
- ...de,
133
+ }, qe = {
134
+ ...re,
120
135
  color: "red",
121
136
  overflow: "auto"
122
- }, lt = (e) => {
123
- const [n, i] = v(""), [r, c] = v(""), [d, l] = v(!1), [o, a] = v(), s = (p, O) => {
124
- i(O);
125
- }, h = () => n != null && n.trim().length > 0, b = () => o != null && o.trim().length > 0, x = () => {
126
- l(!0), e.onUrlFetch(n).then((p) => {
127
- a(void 0), c(p), l(!1), e.onChange(p, n);
128
- }).catch((p) => {
129
- a(p.message), l(!1);
137
+ }, ht = (e) => {
138
+ const [n, i] = v(""), [o, a] = v(""), [r, c] = v(!1), [l, s] = v(), d = (I, R) => {
139
+ i(R);
140
+ }, g = () => n != null && n.trim().length > 0, T = () => l != null && l.trim().length > 0, D = () => {
141
+ c(!0), e.onUrlFetch(n).then((I) => {
142
+ s(void 0), a(I), c(!1), e.onChange(I, n);
143
+ }).catch((I) => {
144
+ s(I.message), c(!1);
130
145
  });
131
- }, S = () => {
132
- i(""), c(""), e.onChange(void 0, void 0);
133
- }, N = /* @__PURE__ */ g("div", { className: "url-upload-loading", style: de, children: [
134
- /* @__PURE__ */ t(A, { size: "md", className: "spinner", style: { marginRight: "5px" } }),
146
+ }, C = () => {
147
+ i(""), a(""), e.onChange(void 0, void 0);
148
+ }, k = /* @__PURE__ */ u("div", { className: "url-upload-loading", style: re, children: [
149
+ /* @__PURE__ */ t(x, { size: "md", className: "spinner", style: { marginRight: "5px" } }),
135
150
  /* @__PURE__ */ t("span", { className: "spinner-message", children: "Loading URL content" })
136
151
  ] });
137
- return /* @__PURE__ */ g("div", { className: "url-upload", "data-testid": e.testId, children: [
138
- /* @__PURE__ */ g("div", { className: "url-upload-flex", style: { display: "flex" }, children: [
152
+ return /* @__PURE__ */ u("div", { className: "url-upload", "data-testid": e.testId, children: [
153
+ /* @__PURE__ */ u("div", { className: "url-upload-flex", style: { display: "flex" }, children: [
139
154
  /* @__PURE__ */ t("div", { className: "url-upload-url", style: { flexGrow: 1 }, children: /* @__PURE__ */ t(
140
- Ce,
155
+ Se,
141
156
  {
142
157
  "data-testid": `${e.testId}-input`,
143
158
  value: n,
144
159
  type: "text",
145
160
  placeholder: e.urlPlaceholder,
146
161
  id: e.id,
147
- onChange: s,
162
+ onChange: d,
148
163
  "aria-label": "url input"
149
164
  }
150
165
  ) }),
151
- /* @__PURE__ */ t("div", { className: "url-fetch-button", children: /* @__PURE__ */ t(X, { "data-testid": `${e.testId}-fetch`, variant: "control", isDisabled: !h(), onClick: x, children: "Fetch" }) }),
152
- /* @__PURE__ */ t("div", { className: "url-clear-button", children: /* @__PURE__ */ t(X, { "data-testid": `${e.testId}-clear`, variant: "control", isDisabled: !h(), onClick: S, children: "Clear" }) })
166
+ /* @__PURE__ */ t("div", { className: "url-fetch-button", children: /* @__PURE__ */ t(Q, { "data-testid": `${e.testId}-fetch`, variant: "control", isDisabled: !g(), onClick: D, children: "Fetch" }) }),
167
+ /* @__PURE__ */ t("div", { className: "url-clear-button", children: /* @__PURE__ */ t(Q, { "data-testid": `${e.testId}-clear`, variant: "control", isDisabled: !g(), onClick: C, children: "Clear" }) })
153
168
  ] }),
154
- /* @__PURE__ */ t("div", { className: "url-upload-preview", children: /* @__PURE__ */ g(P, { isLoading: d, loadingComponent: N, children: [
155
- /* @__PURE__ */ t(C, { condition: b, children: /* @__PURE__ */ g("div", { className: "url-upload-error", style: Ve, children: [
169
+ /* @__PURE__ */ t("div", { className: "url-upload-preview", children: /* @__PURE__ */ u(_, { isLoading: r, loadingComponent: k, children: [
170
+ /* @__PURE__ */ t(y, { condition: T, children: /* @__PURE__ */ u("div", { className: "url-upload-error", style: qe, children: [
156
171
  /* @__PURE__ */ t("div", { children: "Error getting content from URL." }),
157
- /* @__PURE__ */ t("div", { children: o })
172
+ /* @__PURE__ */ t("div", { children: l })
158
173
  ] }) }),
159
- /* @__PURE__ */ t(C, { condition: !b(), children: /* @__PURE__ */ t(
160
- we,
174
+ /* @__PURE__ */ t(y, { condition: !T(), children: /* @__PURE__ */ t(
175
+ Ce,
161
176
  {
162
177
  "data-testid": `${e.testId}-preview`,
163
178
  "aria-label": "url-content",
164
- value: r,
179
+ value: o,
165
180
  readOnly: !0,
166
181
  style: { minHeight: "128px" }
167
182
  }
168
183
  ) })
169
184
  ] }) })
170
185
  ] });
171
- }, at = (e) => {
172
- const [n, i] = v(), [r, c] = v(), d = (l) => typeof l == "string" ? l : l === void 0 ? "" : l.toDateString();
173
- return D(() => {
174
- e.isOpen && (typeof e.frontendInfo == "function" ? e.frontendInfo().then(i) : i(e.frontendInfo), typeof e.backendInfo == "function" ? e.backendInfo().then(c) : c(e.backendInfo));
186
+ }, mt = (e) => {
187
+ const [n, i] = v(), [o, a] = v(), r = (c) => typeof c == "string" ? c : c === void 0 ? "" : c.toDateString();
188
+ return te(() => {
189
+ e.isOpen && (typeof e.frontendInfo == "function" ? e.frontendInfo().then(i) : i(e.frontendInfo), typeof e.backendInfo == "function" ? e.backendInfo().then(a) : a(e.backendInfo));
175
190
  }, [e.isOpen]), /* @__PURE__ */ t(
176
- xe,
191
+ Ne,
177
192
  {
178
193
  className: "app-about-modal",
179
194
  isOpen: e.isOpen,
@@ -182,34 +197,34 @@ const C = ({ condition: e, children: n }) => (typeof e == "boolean" ? e : e()) ?
182
197
  brandImageSrc: e.brandImageSrc,
183
198
  brandImageAlt: e.brandImageAlt,
184
199
  "aria-label": e.brandImageAlt,
185
- children: /* @__PURE__ */ g(Ne, { className: "app-about-modal-content", style: { marginTop: "-25px" }, children: [
186
- /* @__PURE__ */ t(Y, { component: Z.h2, children: "Web console info" }),
187
- /* @__PURE__ */ t(P, { isLoading: n === void 0, children: /* @__PURE__ */ g(ee, { component: "dl", children: [
200
+ children: /* @__PURE__ */ u(we, { className: "app-about-modal-content", style: { marginTop: "-25px" }, children: [
201
+ /* @__PURE__ */ t(X, { component: Y.h2, children: "Web console info" }),
202
+ /* @__PURE__ */ t(_, { isLoading: n === void 0, children: /* @__PURE__ */ u(Z, { component: "dl", children: [
188
203
  /* @__PURE__ */ t(f, { component: "dt", children: "Project" }),
189
204
  /* @__PURE__ */ t(f, { component: "dd", children: /* @__PURE__ */ t("a", { href: n == null ? void 0 : n.url, target: "_blank", children: n == null ? void 0 : n.name }) }),
190
205
  /* @__PURE__ */ t(f, { component: "dt", children: "Version" }),
191
206
  /* @__PURE__ */ t(f, { component: "dd", children: n == null ? void 0 : n.version }),
192
207
  /* @__PURE__ */ t(f, { component: "dt", children: "Built on" }),
193
- /* @__PURE__ */ t(f, { component: "dd", children: d(n == null ? void 0 : n.builtOn) }),
208
+ /* @__PURE__ */ t(f, { component: "dd", children: r(n == null ? void 0 : n.builtOn) }),
194
209
  /* @__PURE__ */ t(f, { component: "dt", children: "Digest" }),
195
210
  /* @__PURE__ */ t(f, { component: "dd", children: n == null ? void 0 : n.digest })
196
211
  ] }) }),
197
- /* @__PURE__ */ t(Y, { style: { marginTop: "40px" }, component: Z.h2, children: e.backendLabel }),
198
- /* @__PURE__ */ t(P, { isLoading: r === void 0, children: /* @__PURE__ */ g(ee, { component: "dl", children: [
212
+ /* @__PURE__ */ t(X, { style: { marginTop: "40px" }, component: Y.h2, children: e.backendLabel }),
213
+ /* @__PURE__ */ t(_, { isLoading: o === void 0, children: /* @__PURE__ */ u(Z, { component: "dl", children: [
199
214
  /* @__PURE__ */ t(f, { component: "dt", children: "Name" }),
200
- /* @__PURE__ */ t(f, { component: "dd", children: (r == null ? void 0 : r.name) || "" }),
215
+ /* @__PURE__ */ t(f, { component: "dd", children: (o == null ? void 0 : o.name) || "" }),
201
216
  /* @__PURE__ */ t(f, { component: "dt", children: "Description" }),
202
- /* @__PURE__ */ t(f, { component: "dd", children: (r == null ? void 0 : r.description) || "" }),
217
+ /* @__PURE__ */ t(f, { component: "dd", children: (o == null ? void 0 : o.description) || "" }),
203
218
  /* @__PURE__ */ t(f, { component: "dt", children: "Version" }),
204
- /* @__PURE__ */ t(f, { component: "dd", children: (r == null ? void 0 : r.version) || "" }),
219
+ /* @__PURE__ */ t(f, { component: "dd", children: (o == null ? void 0 : o.version) || "" }),
205
220
  /* @__PURE__ */ t(f, { component: "dt", children: "Built on" }),
206
- /* @__PURE__ */ t(f, { component: "dd", children: d(r == null ? void 0 : r.builtOn) })
221
+ /* @__PURE__ */ t(f, { component: "dd", children: r(o == null ? void 0 : o.builtOn) })
207
222
  ] }) })
208
223
  ] })
209
224
  }
210
225
  );
211
- }, ct = (e) => /* @__PURE__ */ g(
212
- ae,
226
+ }, gt = (e) => /* @__PURE__ */ u(
227
+ le,
213
228
  {
214
229
  title: "Please Wait",
215
230
  variant: "small",
@@ -220,12 +235,12 @@ const C = ({ condition: e, children: n }) => (typeof e == "boolean" ? e : e()) ?
220
235
  "aria-label": "please-wait-modal",
221
236
  style: { marginTop: "-15px" },
222
237
  children: [
223
- /* @__PURE__ */ t(A, { size: "md", className: "spinner" }),
238
+ /* @__PURE__ */ t(x, { size: "md", className: "spinner" }),
224
239
  /* @__PURE__ */ t("span", { className: "message", style: { fontSize: "15px", color: "#333", marginLeft: "10px" }, children: e.message })
225
240
  ]
226
241
  }
227
- ), dt = (e) => /* @__PURE__ */ t(
228
- ae,
242
+ ), ut = (e) => /* @__PURE__ */ t(
243
+ le,
229
244
  {
230
245
  title: e.title,
231
246
  variant: "small",
@@ -234,480 +249,403 @@ const C = ({ condition: e, children: n }) => (typeof e == "boolean" ? e : e()) ?
234
249
  onClose: e.onClose,
235
250
  className: "progress pf-m-redhat-font",
236
251
  "aria-label": "progress-modal",
237
- children: /* @__PURE__ */ t(Oe, { title: e.message, value: e.progress })
252
+ children: /* @__PURE__ */ t(De, { title: e.message, value: e.progress })
238
253
  }
239
254
  );
240
- function st() {
241
- return /* @__PURE__ */ t(re, { children: /* @__PURE__ */ t(
242
- oe,
255
+ function ft() {
256
+ return /* @__PURE__ */ t(ne, { children: /* @__PURE__ */ t(
257
+ ie,
243
258
  {
244
259
  titleText: "Loading",
245
260
  headingLevel: "h4",
246
- icon: /* @__PURE__ */ t(Re, { icon: A })
261
+ icon: /* @__PURE__ */ t(Oe, { icon: x })
247
262
  }
248
263
  ) });
249
264
  }
250
- function ht({
265
+ function vt({
251
266
  itemCount: e,
252
267
  page: n,
253
268
  perPage: i,
254
- isCompact: r = !1,
255
- onChange: c,
256
- variant: d = ke.top
269
+ isCompact: o = !1,
270
+ onChange: a,
271
+ variant: r = Le.top
257
272
  }) {
258
273
  return /* @__PURE__ */ t(
259
- _e,
274
+ Fe,
260
275
  {
261
276
  itemCount: e,
262
277
  page: n,
263
278
  perPage: i,
264
- onSetPage: (l, o) => c(o, i),
265
- onPerPageSelect: (l, o) => c(1, o),
266
- variant: d,
267
- isCompact: r
279
+ onSetPage: (c, l) => a(l, i),
280
+ onPerPageSelect: (c, l) => a(1, l),
281
+ variant: r,
282
+ isCompact: o
268
283
  }
269
284
  );
270
285
  }
271
- function Ge(e, n) {
272
- var i = w(null), r = w(null);
273
- r.current = n;
274
- var c = w(null);
275
- D(function() {
276
- d();
277
- });
278
- var d = L(function() {
279
- var l = c.current, o = r.current, a = l || (o ? o instanceof Element ? o : o.current : null);
280
- i.current && i.current.element === a && i.current.subscriber === e || (i.current && i.current.cleanup && i.current.cleanup(), i.current = {
281
- element: a,
282
- subscriber: e,
283
- // Only calling the subscriber, if there's an actual element to report.
284
- // Setting cleanup to undefined unless a subscriber returns one, as an existing cleanup function would've been just called.
285
- cleanup: a ? e(a) : void 0
286
- });
287
- }, [e]);
288
- return D(function() {
289
- return function() {
290
- i.current && i.current.cleanup && (i.current.cleanup(), i.current = null);
291
- };
292
- }, []), L(function(l) {
293
- c.current = l, d();
294
- }, [d]);
295
- }
296
- function te(e, n, i) {
297
- return e[n] ? e[n][0] ? e[n][0][i] : (
298
- // TS complains about this, because the RO entry type follows the spec and does not reflect Firefox's current
299
- // behaviour of returning objects instead of arrays for `borderBoxSize` and `contentBoxSize`.
300
- // @ts-ignore
301
- e[n][i]
302
- ) : n === "contentBoxSize" ? e.contentRect[i === "inlineSize" ? "width" : "height"] : void 0;
303
- }
304
- function Ke(e) {
305
- e === void 0 && (e = {});
306
- var n = e.onResize, i = w(void 0);
307
- i.current = n;
308
- var r = e.round || Math.round, c = w(), d = v({
309
- width: void 0,
310
- height: void 0
311
- }), l = d[0], o = d[1], a = w(!1);
312
- D(function() {
313
- return a.current = !1, function() {
314
- a.current = !0;
315
- };
316
- }, []);
317
- var s = w({
318
- width: void 0,
319
- height: void 0
320
- }), h = Ge(L(function(b) {
321
- return (!c.current || c.current.box !== e.box || c.current.round !== r) && (c.current = {
322
- box: e.box,
323
- round: r,
324
- instance: new ResizeObserver(function(x) {
325
- var S = x[0], N = e.box === "border-box" ? "borderBoxSize" : e.box === "device-pixel-content-box" ? "devicePixelContentBoxSize" : "contentBoxSize", p = te(S, N, "inlineSize"), O = te(S, N, "blockSize"), T = p ? r(p) : void 0, _ = O ? r(O) : void 0;
326
- if (s.current.width !== T || s.current.height !== _) {
327
- var R = {
328
- width: T,
329
- height: _
330
- };
331
- s.current.width = T, s.current.height = _, i.current ? i.current(R) : a.current || o(R);
332
- }
333
- })
334
- }), c.current.instance.observe(b, {
335
- box: e.box
336
- }), function() {
337
- c.current && c.current.instance.unobserve(b);
338
- };
339
- }, [e.box, r]), e.ref);
340
- return j(function() {
341
- return {
342
- ref: h,
343
- width: l.width,
344
- height: l.height
345
- };
346
- }, [h, l.width, l.height]);
347
- }
348
- function qe({ columns: e, rows: n, getTd: i = () => q }) {
349
- const r = new Array(e).fill(0).map((d, l) => {
350
- const o = i(l);
351
- return /* @__PURE__ */ t(o, { children: /* @__PURE__ */ t(
352
- Fe,
286
+ function Je({ columns: e, rows: n, getTd: i = () => G }) {
287
+ const o = new Array(e).fill(0).map((r, c) => {
288
+ const l = i(c);
289
+ return /* @__PURE__ */ t(l, { children: /* @__PURE__ */ t(
290
+ _e,
353
291
  {
354
- screenreaderText: l === 0 ? "Loading data" : void 0
292
+ screenreaderText: c === 0 ? "Loading data" : void 0
355
293
  }
356
- ) }, `cell_${l}`);
357
- }), c = new Array(n).fill(0).map((d, l) => /* @__PURE__ */ t(z, { children: r }, `row_${l}`));
358
- return /* @__PURE__ */ t(ie, { children: c });
294
+ ) }, `cell_${c}`);
295
+ }), a = new Array(n).fill(0).map((r, c) => /* @__PURE__ */ t(L, { children: o }, `row_${c}`));
296
+ return /* @__PURE__ */ t(W, { children: a });
359
297
  }
360
- const ut = ({
298
+ const bt = ({
361
299
  ariaLabel: e,
362
300
  minimumColumnWidth: n = 250,
363
301
  columns: i,
364
- data: r,
365
- renderHeader: c,
366
- renderCell: d,
367
- renderActions: l,
368
- isColumnSortable: o,
369
- isRowDeleted: a,
370
- isRowSelected: s,
371
- expectedLength: h = 3,
372
- onRowClick: b,
373
- setActionCellOuiaId: x,
374
- setRowOuiaId: S,
375
- tableOuiaId: N,
376
- children: p,
377
- variant: O
302
+ data: o,
303
+ renderHeader: a,
304
+ renderCell: r,
305
+ renderActions: c,
306
+ isColumnSortable: l,
307
+ isRowDeleted: s,
308
+ isRowSelected: d,
309
+ expectedLength: g = 3,
310
+ onRowClick: T,
311
+ setActionCellOuiaId: D,
312
+ setRowOuiaId: C,
313
+ tableOuiaId: k,
314
+ children: I,
315
+ variant: R
378
316
  }) => {
379
- const [T, _] = v(1e3);
380
- let R;
381
- const ue = ({ width: u }) => {
382
- R && cancelAnimationFrame(R), u && (R = requestAnimationFrame(() => {
383
- _(u);
317
+ const [S, de] = v(1e3);
318
+ let P;
319
+ const he = ({ width: h }) => {
320
+ P && cancelAnimationFrame(P), h && (P = requestAnimationFrame(() => {
321
+ de(h);
384
322
  }));
385
- }, { ref: me } = Ke({ onResize: ue }), W = T >= 576, $ = L(
386
- (u) => W && u !== 0 && u !== i.length - 1,
387
- [i, W]
388
- ), ge = j(() => i.map((u, m) => {
389
- const I = E(
390
- ({ children: k, ...F }, M) => /* @__PURE__ */ t(
391
- se,
323
+ }, { ref: me } = ze({ onResize: he }), A = S >= 576, O = q(
324
+ (h) => A && h !== 0 && h !== i.length - 1,
325
+ [i, A]
326
+ ), ge = J(() => i.map((h, m) => {
327
+ const b = F(
328
+ ({ children: N, ...w }, M) => /* @__PURE__ */ t(
329
+ ce,
392
330
  {
393
331
  position: m,
394
- tableWidth: T,
332
+ tableWidth: S,
395
333
  columnWidth: n,
396
- canHide: $(m),
397
- sort: o ? o(u) : void 0,
398
- ...F,
334
+ canHide: O(m),
335
+ sort: l ? l(h) : void 0,
336
+ ...w,
399
337
  ref: M,
400
- children: k
338
+ children: N
401
339
  }
402
340
  )
403
341
  );
404
- return I.displayName = "ResponsiveThCurried", c({
405
- Th: I,
406
- key: `header_${u}`,
407
- column: u,
342
+ return b.displayName = "ResponsiveThCurried", a({
343
+ Th: b,
344
+ key: `header_${h}`,
345
+ column: h,
408
346
  colIndex: m
409
347
  });
410
348
  }), [
411
- $,
349
+ O,
412
350
  i,
413
- o,
351
+ l,
414
352
  n,
415
- c,
416
- T
417
- ]), B = L(
418
- (u) => {
419
- const m = E(
420
- ({ children: I, ...k }, F) => /* @__PURE__ */ t(
421
- U,
353
+ a,
354
+ S
355
+ ]), E = q(
356
+ (h) => {
357
+ const m = F(
358
+ ({ children: b, ...N }, w) => /* @__PURE__ */ t(
359
+ H,
422
360
  {
423
- position: u,
424
- tableWidth: T,
361
+ position: h,
362
+ tableWidth: S,
425
363
  columnWidth: n,
426
- canHide: $(u),
427
- ...k,
428
- ref: F,
429
- children: I
364
+ canHide: O(h),
365
+ ...N,
366
+ ref: w,
367
+ children: b
430
368
  }
431
369
  )
432
370
  );
433
371
  return m.displayName = "ResponsiveTdCurried", m;
434
372
  },
435
- [$, n, T]
436
- ), fe = j(
437
- () => i.map((u, m) => B(m)),
438
- [i, B]
373
+ [O, n, S]
374
+ ), ue = J(
375
+ () => i.map((h, m) => E(m)),
376
+ [i, E]
439
377
  );
440
- return /* @__PURE__ */ g(
441
- Be,
378
+ return /* @__PURE__ */ u(
379
+ Ve,
442
380
  {
443
381
  "aria-label": e,
444
382
  gridBreakPoint: "",
445
383
  ref: me,
446
- className: W ? "" : "pf-m-grid",
447
- ouiaId: N,
448
- variant: O,
384
+ className: A ? "" : "pf-m-grid",
385
+ ouiaId: k,
386
+ variant: R,
449
387
  children: [
450
- /* @__PURE__ */ t(Me, { children: /* @__PURE__ */ t(z, { children: ge }) }),
451
- /* @__PURE__ */ g(je, { children: [
452
- r === void 0 && /* @__PURE__ */ t(
453
- qe,
388
+ /* @__PURE__ */ t(Be, { children: /* @__PURE__ */ t(L, { children: ge }) }),
389
+ /* @__PURE__ */ u(Ue, { children: [
390
+ o === void 0 && /* @__PURE__ */ t(
391
+ Je,
454
392
  {
455
393
  columns: i.length,
456
- rows: h,
457
- getTd: B
394
+ rows: g,
395
+ getTd: E
458
396
  }
459
397
  ),
460
- r == null ? void 0 : r.map((u, m) => {
461
- const I = a !== void 0 && a({ row: u, rowIndex: m }), k = s !== void 0 && s({ row: u, rowIndex: m }), F = !I && b ? () => b({ row: u, rowIndex: m }) : void 0, M = i.map((J, Q) => d({
462
- Td: fe[Q],
463
- key: `row_${m}_cell_${J}`,
464
- column: J,
465
- colIndex: Q,
398
+ o == null ? void 0 : o.map((h, m) => {
399
+ const b = s !== void 0 && s({ row: h, rowIndex: m }), N = d !== void 0 && d({ row: h, rowIndex: m }), w = !b && T ? () => T({ row: h, rowIndex: m }) : void 0, M = i.map((z, K) => r({
400
+ Td: ue[K],
401
+ key: `row_${m}_cell_${z}`,
402
+ column: z,
403
+ colIndex: K,
466
404
  rowIndex: m,
467
- row: u
468
- })), ve = !I && l && /* @__PURE__ */ t(
469
- U,
405
+ row: h
406
+ })), fe = !b && c && /* @__PURE__ */ t(
407
+ H,
470
408
  {
471
409
  position: i.length,
472
- tableWidth: T,
410
+ tableWidth: S,
473
411
  columnWidth: n,
474
412
  canHide: !1,
475
413
  isActionCell: !0,
476
- "data-testid": x ? x({ row: u, rowIndex: m }) : `actions-for-row-${m}`,
477
- children: l({ rowIndex: m, row: u, ActionsColumn: Ue })
414
+ "data-testid": D ? D({ row: h, rowIndex: m }) : `actions-for-row-${m}`,
415
+ children: c({ rowIndex: m, row: h, ActionsColumn: Ge })
478
416
  }
479
417
  );
480
- return /* @__PURE__ */ g(
481
- he,
418
+ return /* @__PURE__ */ u(
419
+ se,
482
420
  {
483
- isDeleted: I,
484
- isSelected: k,
485
- onClick: F,
486
- rowOuiaId: S == null ? void 0 : S({ row: u, rowIndex: m }),
421
+ isDeleted: b,
422
+ isSelected: N,
423
+ onClick: w,
424
+ rowOuiaId: C == null ? void 0 : C({ row: h, rowIndex: m }),
487
425
  children: [
488
426
  M,
489
- ve
427
+ fe
490
428
  ]
491
429
  },
492
430
  `row_${m}`
493
431
  );
494
432
  }),
495
- (r == null ? void 0 : r.length) === 0 && /* @__PURE__ */ t(z, { children: /* @__PURE__ */ t(q, { colSpan: i.length, children: p }) })
433
+ (o == null ? void 0 : o.length) === 0 && /* @__PURE__ */ t(L, { children: /* @__PURE__ */ t(G, { colSpan: i.length, children: I }) })
496
434
  ] })
497
435
  ]
498
436
  }
499
437
  );
500
- }, se = V(
501
- E((e, n) => {
438
+ }, ce = V(
439
+ F((e, n) => {
502
440
  const {
503
441
  tableWidth: i,
504
- columnWidth: r,
505
- position: c,
506
- canHide: d,
507
- className: l = "",
508
- children: o,
509
- ...a
510
- } = e, s = d && i < r * (c + 1) ? "pf-m-hidden" : "pf-m-visible";
442
+ columnWidth: o,
443
+ position: a,
444
+ canHide: r,
445
+ className: c = "",
446
+ children: l,
447
+ ...s
448
+ } = e, d = r && i < o * (a + 1) ? "pf-m-hidden" : "pf-m-visible";
511
449
  return /* @__PURE__ */ t(
512
450
  We,
513
451
  {
514
452
  ref: n,
515
- className: `${s} ${l}`,
516
- ...a,
517
- children: o
453
+ className: `${d} ${c}`,
454
+ ...s,
455
+ children: l
518
456
  }
519
457
  );
520
458
  })
521
459
  );
522
- se.displayName = "ResponsiveTh";
523
- const U = V(
524
- E((e, n) => {
460
+ ce.displayName = "ResponsiveTh";
461
+ const H = V(
462
+ F((e, n) => {
525
463
  const {
526
464
  tableWidth: i,
527
- columnWidth: r,
528
- position: c,
529
- canHide: d,
530
- className: l = "",
531
- children: o,
532
- ...a
533
- } = e, s = d && i < r * (c + 1) ? "pf-m-hidden" : "pf-m-visible";
465
+ columnWidth: o,
466
+ position: a,
467
+ canHide: r,
468
+ className: c = "",
469
+ children: l,
470
+ ...s
471
+ } = e, d = r && i < o * (a + 1) ? "pf-m-hidden" : "pf-m-visible";
534
472
  return /* @__PURE__ */ t(
535
- q,
473
+ G,
536
474
  {
537
475
  ref: n,
538
- className: `${s} ${l}`,
539
- ...a,
540
- children: o
476
+ className: `${d} ${c}`,
477
+ ...s,
478
+ children: l
541
479
  }
542
480
  );
543
481
  })
544
482
  );
545
- U.displayName = "ResponsiveTd";
546
- const he = V(
547
- ({ isDeleted: e, isSelected: n, onClick: i, children: r, rowOuiaId: c }) => /* @__PURE__ */ t(
548
- z,
483
+ H.displayName = "ResponsiveTd";
484
+ const se = V(
485
+ ({ isDeleted: e, isSelected: n, onClick: i, children: o, rowOuiaId: a }) => /* @__PURE__ */ t(
486
+ L,
549
487
  {
550
- onRowClick: (d) => {
551
- (d == null ? void 0 : d.target) instanceof HTMLElement && (["a", "button"].includes(d.target.tagName.toLowerCase()) || i && i());
488
+ onRowClick: (r) => {
489
+ (r == null ? void 0 : r.target) instanceof HTMLElement && (["a", "button"].includes(r.target.tagName.toLowerCase()) || i && i());
552
490
  },
553
- ouiaId: c,
491
+ ouiaId: a,
554
492
  isRowSelected: n,
555
493
  className: e ? "mas--ResponsiveTable__Tr--deleted" : void 0,
556
- "data-testid": [n && "row-selected", e && "row-deleted"].filter((d) => !!d).join(" "),
494
+ "data-testid": [n && "row-selected", e && "row-deleted"].filter((r) => !!r).join(" "),
557
495
  role: "row",
558
- children: r
496
+ children: o
559
497
  }
560
498
  )
561
499
  );
562
- he.displayName = "DeletableRow";
563
- const Je = ({ label: e, onSearch: n }) => {
564
- const i = (r, c, d) => {
565
- n(c);
500
+ se.displayName = "DeletableRow";
501
+ const Qe = ({ label: e, onSearch: n }) => {
502
+ const i = (o, a, r) => {
503
+ n(a);
566
504
  };
567
505
  return /* @__PURE__ */ t(
568
- Le,
506
+ xe,
569
507
  {
570
508
  placeholder: `Filter by ${e}`,
571
509
  onSearch: i
572
510
  }
573
511
  );
574
512
  };
575
- function ne({
513
+ function ee({
576
514
  options: e,
577
515
  value: n,
578
516
  onChange: i,
579
- ouiaId: r
517
+ ouiaId: o
580
518
  }) {
581
- const [c, d] = v(!1);
519
+ const [a, r] = v(!1);
582
520
  return /* @__PURE__ */ t(
583
- G,
521
+ B,
584
522
  {
585
- toggle: (o) => /* @__PURE__ */ t(
586
- H,
523
+ toggle: (l) => /* @__PURE__ */ t(
524
+ $,
587
525
  {
588
- ref: o,
589
- onClick: () => d((a) => !a),
590
- isExpanded: c,
526
+ ref: l,
527
+ onClick: () => r((s) => !s),
528
+ isExpanded: a,
591
529
  variant: "plain",
592
- children: /* @__PURE__ */ t(ce, {})
530
+ children: /* @__PURE__ */ t(ae, {})
593
531
  }
594
532
  ),
595
533
  "aria-label": "table:select_filter",
596
534
  selected: n,
597
- isOpen: c,
598
- onSelect: (o, a) => {
599
- i(a), d(!1);
535
+ isOpen: a,
536
+ onSelect: (l, s) => {
537
+ i(s), r(!1);
600
538
  },
601
- ouiaId: r,
602
- children: /* @__PURE__ */ t($e, { children: e.map((o, a) => /* @__PURE__ */ t(K, { value: o, children: o }, a)) })
539
+ ouiaId: o,
540
+ children: /* @__PURE__ */ t($e, { children: e.map((l, s) => /* @__PURE__ */ t(U, { value: l, children: l }, s)) })
603
541
  }
604
542
  );
605
543
  }
606
- function Qe({
544
+ function Xe({
607
545
  label: e,
608
546
  chips: n,
609
547
  options: i,
610
- onToggle: r
548
+ onToggle: o
611
549
  }) {
612
- const [c, d] = v(!1);
550
+ const [a, r] = v(!1);
613
551
  return /* @__PURE__ */ t(
614
- G,
552
+ B,
615
553
  {
616
554
  "aria-label": e,
617
- onSelect: (l, o) => {
618
- r(o);
555
+ onSelect: (c, l) => {
556
+ o(l);
619
557
  },
620
558
  selected: n,
621
- isOpen: c,
622
- toggle: (l) => /* @__PURE__ */ t(
623
- H,
559
+ isOpen: a,
560
+ toggle: (c) => /* @__PURE__ */ t(
561
+ $,
624
562
  {
625
- ref: l,
626
- onClick: () => d((o) => !o),
627
- isExpanded: c,
563
+ ref: c,
564
+ onClick: () => r((l) => !l),
565
+ isExpanded: a,
628
566
  style: {
629
567
  width: "200px"
630
568
  },
631
569
  children: `Filter by ${e}`
632
570
  }
633
571
  ),
634
- children: Object.entries(i).map(([l, o]) => /* @__PURE__ */ t(K, { value: l, hasCheckbox: !0, children: o }, l))
572
+ children: Object.entries(i).map(([c, l]) => /* @__PURE__ */ t(U, { value: c, hasCheckbox: !0, children: l }, c))
635
573
  }
636
574
  );
637
575
  }
638
- function mt({ filters: e, breakpoint: n = "md" }) {
639
- const i = Object.keys(e), [r, c] = v(i[0]), d = (l, o) => {
640
- switch (o.type) {
576
+ function pt({ filters: e, breakpoint: n = "md" }) {
577
+ const i = Object.keys(e), [o, a] = v(i[0]), r = (c, l) => {
578
+ switch (l.type) {
641
579
  case "search":
642
580
  return /* @__PURE__ */ t(
643
- Je,
581
+ Qe,
644
582
  {
645
- onSearch: o.onSearch,
646
- label: l,
647
- validate: o.validate,
648
- errorMessage: o.errorMessage
583
+ onSearch: l.onSearch,
584
+ label: c,
585
+ validate: l.validate,
586
+ errorMessage: l.errorMessage
649
587
  }
650
588
  );
651
589
  case "checkbox":
652
590
  return /* @__PURE__ */ t(
653
- Qe,
591
+ Xe,
654
592
  {
655
- chips: o.chips,
656
- options: o.options,
657
- onToggle: o.onToggle,
658
- label: l
593
+ chips: l.chips,
594
+ options: l.options,
595
+ onToggle: l.onToggle,
596
+ label: c
659
597
  }
660
598
  );
661
599
  }
662
600
  };
663
- return /* @__PURE__ */ g(ie, { children: [
601
+ return /* @__PURE__ */ u(W, { children: [
664
602
  /* @__PURE__ */ t(
665
- De,
603
+ ke,
666
604
  {
667
605
  variant: "search-filter",
668
606
  visibility: { default: "hidden", [n]: "visible" },
669
607
  "data-testid": "large-viewport-toolbar",
670
- children: /* @__PURE__ */ g(Ee, { children: [
608
+ children: /* @__PURE__ */ u(Re, { children: [
671
609
  i.length > 1 && /* @__PURE__ */ t(
672
- ne,
610
+ ee,
673
611
  {
674
612
  options: i,
675
- value: r,
676
- onChange: c,
613
+ value: o,
614
+ onChange: a,
677
615
  ouiaId: "chip-filter-selector-large-viewport"
678
616
  }
679
617
  ),
680
- d(r, e[r])
618
+ r(o, e[o])
681
619
  ] })
682
620
  }
683
621
  ),
684
622
  /* @__PURE__ */ t(
685
- ze,
623
+ Pe,
686
624
  {
687
- toggleIcon: /* @__PURE__ */ t(ce, {}),
625
+ toggleIcon: /* @__PURE__ */ t(ae, {}),
688
626
  breakpoint: n,
689
627
  visibility: { default: "visible", [n]: "hidden" },
690
- children: /* @__PURE__ */ g(Pe, { variant: "filter-group", children: [
628
+ children: /* @__PURE__ */ u(Ae, { variant: "filter-group", children: [
691
629
  i.length > 1 && /* @__PURE__ */ t(
692
- ne,
630
+ ee,
693
631
  {
694
632
  options: i,
695
- value: r,
696
- onChange: c,
633
+ value: o,
634
+ onChange: a,
697
635
  ouiaId: "chip-filter-selector-small-viewport"
698
636
  }
699
637
  ),
700
- Object.entries(e).map(([l, o], a) => /* @__PURE__ */ t(
701
- Ae,
638
+ Object.entries(e).map(([c, l], s) => /* @__PURE__ */ t(
639
+ Ee,
702
640
  {
703
- chips: o.type === "checkbox" ? o.chips.map((s) => ({ key: s, node: o.options[s] })) : o.chips,
704
- deleteChip: (s, h) => o.onRemoveChip(typeof h == "string" ? h : h.key),
705
- deleteChipGroup: o.onRemoveGroup,
706
- categoryName: l,
707
- showToolbarItem: l === r,
708
- children: l === r && d(l, o)
641
+ chips: l.type === "checkbox" ? l.chips.map((d) => ({ key: d, node: l.options[d] })) : l.chips,
642
+ deleteChip: (d, g) => l.onRemoveChip(typeof g == "string" ? g : g.key),
643
+ deleteChipGroup: l.onRemoveGroup,
644
+ categoryName: c,
645
+ showToolbarItem: c === o,
646
+ children: c === o && r(c, l)
709
647
  },
710
- a
648
+ s
711
649
  ))
712
650
  ] })
713
651
  }
@@ -715,25 +653,28 @@ function mt({ filters: e, breakpoint: n = "md" }) {
715
653
  ] });
716
654
  }
717
655
  export {
718
- at as AppAboutModal,
719
- mt as ChipFilter,
720
- he as DeletableRow,
721
- Qe as FilterCheckbox,
722
- Je as FilterSearch,
723
- ne as FilterSelector,
724
- C as If,
725
- nt as IfNotEmpty,
726
- P as IfNotLoading,
727
- it as ListWithToolbar,
728
- st as Loading,
729
- rt as ObjectDropdown,
730
- ot as ObjectSelect,
731
- ht as Pagination,
732
- ct as PleaseWaitModal,
733
- dt as ProgressModal,
734
- ut as ResponsiveTable,
735
- U as ResponsiveTd,
736
- se as ResponsiveTh,
737
- qe as TableSkeleton,
738
- lt as UrlUpload
656
+ mt as AppAboutModal,
657
+ pt as ChipFilter,
658
+ Ke as DateTime,
659
+ se as DeletableRow,
660
+ Xe as FilterCheckbox,
661
+ Qe as FilterSearch,
662
+ ee as FilterSelector,
663
+ lt as FromNow,
664
+ y as If,
665
+ at as IfNotEmpty,
666
+ _ as IfNotLoading,
667
+ rt as ListWithToolbar,
668
+ ft as Loading,
669
+ ct as ObjectDropdown,
670
+ st as ObjectSelect,
671
+ vt as Pagination,
672
+ gt as PleaseWaitModal,
673
+ ut as ProgressModal,
674
+ bt as ResponsiveTable,
675
+ H as ResponsiveTd,
676
+ ce as ResponsiveTh,
677
+ Je as TableSkeleton,
678
+ dt as ToggleIcon,
679
+ ht as UrlUpload
739
680
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@apicurio/common-ui-components",
3
3
  "private": false,
4
- "version": "1.0.6",
4
+ "version": "1.0.8",
5
5
  "type": "module",
6
6
  "main": "dist/main.js",
7
7
  "types": "dist/main.d.ts",