@reportportal/ui-kit 0.0.1-alpha.10 → 0.0.1-alpha.11

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.
@@ -1,274 +0,0 @@
1
- import { jsxs as i, jsx as s } from "react/jsx-runtime";
2
- import { c as d } from "./bind-06a7ff84.js";
3
- import * as u from "react";
4
- import { useState as h } from "react";
5
- import { Popover as C } from "./popover.js";
6
- import { B as v } from "./button-7fb84fde.js";
7
- import { F as T } from "./fieldText-d80b29ba.js";
8
- import { B as m } from "./baseIconButton-7bc53dec.js";
9
- const $ = (e) => /* @__PURE__ */ u.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "#A2AAB5", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ u.createElement("path", { d: "M12 13L4 8L12 3L12 13Z" })), y = (e) => /* @__PURE__ */ u.createElement("svg", { width: 13, height: 12, viewBox: "0 0 13 12", fill: "#A2AAB5", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ u.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M0 12L2 12L2 2.38498e-08L1.90798e-07 0L0 12ZM13 1L5 6L13 11L13 1Z" })), O = {
10
- "item-counter": "_item-counter_4g6do_1"
11
- }, B = d.bind(O), P = ({
12
- activePage: e,
13
- pageSize: n,
14
- totalItems: o,
15
- ofText: l,
16
- itemsText: a
17
- }) => {
18
- const r = e * n, c = r - n;
19
- return /* @__PURE__ */ i("div", { className: B("item-counter"), children: [
20
- `${c + 1} - ${r < o ? r : o}`,
21
- ` ${l} ${o} ${a}`
22
- ] });
23
- }, k = "_selected_183l8_32", I = {
24
- "size-selector": "_size-selector_183l8_1",
25
- "size-option": "_size-option_183l8_6",
26
- selected: k
27
- }, w = d.bind(I), E = ({
28
- currentSize: e,
29
- options: n,
30
- onClickOption: o
31
- }) => /* @__PURE__ */ s("div", { className: w("size-selector"), children: n.map((l) => /* @__PURE__ */ s(
32
- "button",
33
- {
34
- className: w("size-option", { selected: l === e }),
35
- onClick: () => {
36
- o(l);
37
- },
38
- children: l
39
- },
40
- l
41
- )) }), j = {
42
- "page-size-control": "_page-size-control_gnurh_1",
43
- "size-selector-button": "_size-selector-button_gnurh_10"
44
- }, z = d.bind(j), V = ({
45
- size: e,
46
- sizeOptions: n,
47
- perPageText: o,
48
- changeSize: l
49
- }) => {
50
- const [a, r] = h(!1), c = (t) => {
51
- l(t), r(!1);
52
- };
53
- return /* @__PURE__ */ i("div", { className: z("page-size-control"), children: [
54
- /* @__PURE__ */ s(
55
- C,
56
- {
57
- content: /* @__PURE__ */ s(E, { options: n, onClickOption: c, currentSize: e }),
58
- placement: "top",
59
- isOpened: a,
60
- setIsOpened: r,
61
- children: /* @__PURE__ */ s(v, { className: z("size-selector-button"), variant: "text", children: e })
62
- }
63
- ),
64
- ` ${o}`
65
- ] });
66
- }, F = {
67
- "page-selector": "_page-selector_rtho4_1",
68
- "field-wrapper": "_field-wrapper_rtho4_6",
69
- "apply-button": "_apply-button_rtho4_10"
70
- }, b = d.bind(F), M = ({
71
- totalPages: e,
72
- pageText: n,
73
- goActionText: o,
74
- selectPage: l
75
- }) => {
76
- const [a, r] = h(""), [c, t] = h(!0), p = (A) => {
77
- const f = A.target.value.replace(/\D/g, ""), N = Number(f), L = N > 0 && N <= e;
78
- t(L), r(f);
79
- }, _ = () => {
80
- l(Number(a));
81
- };
82
- return /* @__PURE__ */ i("div", { className: b("page-selector"), children: [
83
- /* @__PURE__ */ s("div", { className: b("field-wrapper"), children: /* @__PURE__ */ s(
84
- T,
85
- {
86
- onChange: p,
87
- value: a,
88
- placeholder: n,
89
- error: c ? "" : "Error",
90
- touched: !0,
91
- defaultWidth: !1,
92
- displayError: !1
93
- }
94
- ) }),
95
- /* @__PURE__ */ s(v, { onClick: _, disabled: !a || !c, className: b("apply-button"), children: o })
96
- ] });
97
- }, R = {
98
- "active-page": "_active-page_14j0y_1",
99
- "page-selector": "_page-selector_14j0y_10",
100
- "page-selector-button": "_page-selector-button_14j0y_14"
101
- }, x = d.bind(R), Z = ({
102
- activePage: e,
103
- totalPages: n,
104
- pageText: o,
105
- goToText: l,
106
- goActionText: a,
107
- changePage: r
108
- }) => {
109
- const [c, t] = h(!1), p = (_) => {
110
- r(_), t(!1);
111
- };
112
- return /* @__PURE__ */ i("div", { className: x("active-page"), children: [
113
- `${o} `,
114
- /* @__PURE__ */ s(
115
- C,
116
- {
117
- content: /* @__PURE__ */ s(
118
- M,
119
- {
120
- pageText: o,
121
- goActionText: a,
122
- selectPage: p,
123
- totalPages: n
124
- }
125
- ),
126
- title: l,
127
- placement: "top",
128
- isOpened: c,
129
- setIsOpened: t,
130
- className: x("page-selector"),
131
- children: /* @__PURE__ */ s(v, { className: x("page-selector-button"), variant: "text", children: e })
132
- }
133
- )
134
- ] });
135
- }, G = "_next_1p2t5_18", D = {
136
- "page-navigator": "_page-navigator_1p2t5_1",
137
- "page-buttons": "_page-buttons_1p2t5_6",
138
- "page-button": "_page-button_1p2t5_6",
139
- next: G
140
- }, g = d.bind(D), W = ({
141
- activePage: e,
142
- changePage: n,
143
- totalPages: o
144
- }) => {
145
- const l = () => {
146
- n(1);
147
- }, a = () => {
148
- n(e - 1);
149
- }, r = () => {
150
- n(e + 1);
151
- }, c = () => {
152
- n(o);
153
- };
154
- return /* @__PURE__ */ i("div", { className: g("page-navigator"), children: [
155
- /* @__PURE__ */ i("div", { className: g("page-buttons"), children: [
156
- /* @__PURE__ */ s(
157
- m,
158
- {
159
- className: g("page-button"),
160
- onClick: l,
161
- disabled: e === 1,
162
- children: /* @__PURE__ */ s(y, {})
163
- }
164
- ),
165
- /* @__PURE__ */ s(
166
- m,
167
- {
168
- className: g("page-button"),
169
- onClick: a,
170
- disabled: e === 1,
171
- children: /* @__PURE__ */ s($, {})
172
- }
173
- )
174
- ] }),
175
- /* @__PURE__ */ i("div", { className: g("page-buttons"), children: [
176
- /* @__PURE__ */ s(
177
- m,
178
- {
179
- className: g("page-button", "next"),
180
- onClick: r,
181
- disabled: e === o,
182
- children: /* @__PURE__ */ s($, {})
183
- }
184
- ),
185
- /* @__PURE__ */ s(
186
- m,
187
- {
188
- className: g("page-button", "next"),
189
- onClick: c,
190
- disabled: e === o,
191
- children: /* @__PURE__ */ s(y, {})
192
- }
193
- )
194
- ] })
195
- ] });
196
- }, q = {
197
- "page-controls": "_page-controls_thyf8_1",
198
- "total-pages": "_total-pages_thyf8_8"
199
- }, S = d.bind(q), H = ({
200
- activePage: e,
201
- changePage: n,
202
- captions: o,
203
- totalPages: l
204
- }) => /* @__PURE__ */ i("div", { className: S("page-controls"), children: [
205
- /* @__PURE__ */ s(
206
- Z,
207
- {
208
- activePage: e,
209
- totalPages: l,
210
- changePage: n,
211
- pageText: o.page,
212
- goToText: o.goTo,
213
- goActionText: o.goAction
214
- }
215
- ),
216
- /* @__PURE__ */ s(W, { changePage: n, activePage: e, totalPages: l }),
217
- /* @__PURE__ */ i("span", { className: S("total-pages"), children: [
218
- `${o.of} `,
219
- l
220
- ] })
221
- ] }), J = "_pagination_uykxy_1", K = {
222
- pagination: J
223
- }, Q = d.bind(K), ne = ({
224
- activePage: e,
225
- totalPages: n,
226
- pageSize: o,
227
- totalItems: l,
228
- pageSizeOptions: a,
229
- changePage: r,
230
- changePageSize: c,
231
- captions: t
232
- }) => {
233
- const p = (t == null ? void 0 : t.of) || "of", _ = (t == null ? void 0 : t.page) || "Page";
234
- return /* @__PURE__ */ i("div", { className: Q("pagination"), children: [
235
- /* @__PURE__ */ s(
236
- P,
237
- {
238
- activePage: e,
239
- pageSize: o,
240
- totalItems: l,
241
- ofText: p,
242
- itemsText: (t == null ? void 0 : t.items) || "items"
243
- }
244
- ),
245
- n > 1 && /* @__PURE__ */ s(
246
- H,
247
- {
248
- activePage: e,
249
- totalPages: n,
250
- changePage: r,
251
- captions: {
252
- page: _,
253
- of: p,
254
- goTo: (t == null ? void 0 : t.goTo) || "Go to page",
255
- goAction: (t == null ? void 0 : t.goAction) || "Go"
256
- }
257
- }
258
- ),
259
- /* @__PURE__ */ s(
260
- V,
261
- {
262
- size: o,
263
- sizeOptions: a,
264
- changeSize: c,
265
- perPageText: (t == null ? void 0 : t.perPage) || "per page"
266
- }
267
- )
268
- ] });
269
- };
270
- export {
271
- ne as P,
272
- $ as S,
273
- y as a
274
- };
@@ -1,132 +0,0 @@
1
- import { jsxs as r, jsx as a } from "react/jsx-runtime";
2
- import * as n from "react";
3
- import { useState as w, useMemo as V } from "react";
4
- import { c as q } from "./bind-06a7ff84.js";
5
- import "./baseIconButton-7bc53dec.js";
6
- import { C } from "./checkbox-4143390f.js";
7
- const D = (t) => /* @__PURE__ */ n.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...t }, /* @__PURE__ */ n.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M7.85355 12.8536C7.65829 13.0488 7.34171 13.0488 7.14645 12.8536L4.14645 9.85355C3.95118 9.65829 3.95118 9.34171 4.14645 9.14645C4.34171 8.95118 4.65829 8.95118 4.85355 9.14645L7 11.2929L7 3.5C7 3.22386 7.22386 3 7.5 3C7.77614 3 8 3.22386 8 3.5L8 11.2929L10.1464 9.14645C10.3417 8.95119 10.6583 8.95118 10.8536 9.14645C11.0488 9.34171 11.0488 9.65829 10.8536 9.85355L7.85355 12.8536Z", fill: "#A2AAB5" })), g = (t) => /* @__PURE__ */ n.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...t }, /* @__PURE__ */ n.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M7.14645 3.14645C7.34171 2.95118 7.65829 2.95118 7.85355 3.14645L10.8536 6.14645C11.0488 6.34171 11.0488 6.65829 10.8536 6.85355C10.6583 7.04882 10.3417 7.04882 10.1464 6.85355L8 4.70711V12.5C8 12.7761 7.77614 13 7.5 13C7.22386 13 7 12.7761 7 12.5L7 4.70711L4.85355 6.85355C4.65829 7.04882 4.34171 7.04882 4.14645 6.85355C3.95118 6.65829 3.95118 6.34171 4.14645 6.14645L7.14645 3.14645Z", fill: "#A2AAB5" })), F = "_table_fmu4u_5", G = {
8
- table: F,
9
- "table-header": "_table-header_fmu4u_10",
10
- "table-row": "_table-row_fmu4u_17",
11
- "table-row-content": "_table-row-content_fmu4u_22",
12
- "size-small": "_size-small_fmu4u_31",
13
- "size-large": "_size-large_fmu4u_34",
14
- "table-body": "_table-body_fmu4u_41",
15
- "table-header-cell": "_table-header-cell_fmu4u_48",
16
- "table-cell": "_table-cell_fmu4u_48",
17
- "action-menu-cell": "_action-menu-cell_fmu4u_53",
18
- "checkbox-cell": "_checkbox-cell_fmu4u_63",
19
- "primary-cell": "_primary-cell_fmu4u_71",
20
- "align-right": "_align-right_fmu4u_88",
21
- "align-center": "_align-center_fmu4u_94"
22
- };
23
- var b = /* @__PURE__ */ ((t) => (t.ASC = "asc", t.DESC = "desc", t))(b || {});
24
- const l = q.bind(G), W = ({
25
- data: t,
26
- primaryColumn: i,
27
- fixedColumns: u,
28
- rowActionMenu: d,
29
- className: L = "",
30
- selectable: v = !1,
31
- selectedRowIds: o = [],
32
- sortingDirection: m = b.ASC,
33
- sortingColumn: s = i,
34
- onChangeSorting: N = () => {
35
- },
36
- onToggleRowSelection: x = () => {
37
- },
38
- onToggleAllRowsSelection: A = () => {
39
- }
40
- }) => {
41
- const [S, y] = w(null), [z, f] = w(null), p = V(() => [{ ...i, primary: !0 }, ...u], [i, u]), E = (e) => {
42
- N({ key: e, direction: m });
43
- }, k = (e) => ({
44
- width: e.width,
45
- textAlign: e.align
46
- }), M = (e) => {
47
- y(e);
48
- }, R = () => {
49
- y(null);
50
- }, B = (e) => {
51
- f(e);
52
- }, j = () => {
53
- f(null);
54
- }, H = (e) => {
55
- x(e);
56
- }, T = () => {
57
- A();
58
- }, Z = t.every((e) => o.includes(e.id)), h = t.some((e) => o.includes(e.id)), $ = (e) => {
59
- var c;
60
- return `size-${((c = e.rowConfigs) == null ? void 0 : c.size) ?? "default"}`;
61
- }, U = (e) => (s == null ? void 0 : s.key) === e ? m === b.ASC ? /* @__PURE__ */ a(g, {}) : /* @__PURE__ */ a(D, {}) : /* @__PURE__ */ a(g, {});
62
- return /* @__PURE__ */ r("div", { className: l("table", L), children: [
63
- /* @__PURE__ */ r("div", { className: l("table-header"), children: [
64
- v && /* @__PURE__ */ a("div", { className: l("table-header-cell", "checkbox-cell"), children: h && /* @__PURE__ */ a(
65
- C,
66
- {
67
- value: Z,
68
- partiallyChecked: h,
69
- onChange: T,
70
- className: l("checkbox-cell")
71
- }
72
- ) }),
73
- p.map((e) => /* @__PURE__ */ r(
74
- "button",
75
- {
76
- className: l("table-header-cell", {
77
- [`align-${e.align}`]: "align" in e,
78
- "primary-cell": "primary" in e && e.primary
79
- }),
80
- style: k(e),
81
- onClick: () => E(e.key),
82
- onMouseEnter: () => M(e.key),
83
- onMouseLeave: R,
84
- children: [
85
- /* @__PURE__ */ a("span", { children: e.header }),
86
- (S === e.key || (s == null ? void 0 : s.key) === e.key) && U(e.key)
87
- ]
88
- },
89
- e.key
90
- )),
91
- d && /* @__PURE__ */ a("div", { className: l("table-header-cell", "action-menu-cell") })
92
- ] }),
93
- /* @__PURE__ */ a("div", { className: l("table-body"), children: t.map((e, _) => /* @__PURE__ */ r(
94
- "div",
95
- {
96
- className: l("table-row", $(e)),
97
- onMouseEnter: () => B(_),
98
- onMouseLeave: j,
99
- children: [
100
- v && /* @__PURE__ */ a("div", { className: l("table-cell", "checkbox-cell"), children: (h || z === _) && /* @__PURE__ */ a(
101
- C,
102
- {
103
- value: o.includes(e.id),
104
- onChange: () => H(e.id),
105
- className: l("checkbox-cell")
106
- }
107
- ) }),
108
- /* @__PURE__ */ r("div", { className: l("table-row-content"), children: [
109
- p.map((c) => /* @__PURE__ */ a(
110
- "div",
111
- {
112
- className: l("table-cell", "table-cell", {
113
- "primary-cell": "primary" in c && c.primary
114
- }),
115
- style: k(c),
116
- children: e[c.key].component || e[c.key].content || e[c.key]
117
- },
118
- c.key
119
- )),
120
- d && /* @__PURE__ */ a("div", { className: l("table-cell", "action-menu-cell"), children: d })
121
- ] })
122
- ]
123
- },
124
- e.id
125
- )) })
126
- ] });
127
- };
128
- export {
129
- D as S,
130
- W as T,
131
- g as a
132
- };