@reportportal/ui-kit 0.0.1-alpha.44 → 0.0.1-alpha.45

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/index.js CHANGED
@@ -13,7 +13,7 @@ import { F as L1 } from "./fieldTextFlex-5bddf46a.js";
13
13
  import { R as u1 } from "./radio-bccc84f2.js";
14
14
  import { Tooltip as M1 } from "./tooltip.js";
15
15
  import { Popover as I1 } from "./popover.js";
16
- import { P as S1, a as _1, S as Z1 } from "./pagination-8e40591a.js";
16
+ import { P as S1, a as _1, S as Z1 } from "./pagination-4ae395bd.js";
17
17
  import { S as F1, a as A1, T as H1 } from "./table-9bf4ddab.js";
18
18
  import { D as b1 } from "./datePicker-543e9043.js";
19
19
  import { D as N1 } from "./datePicker-0d4910b6.js";
@@ -1,38 +1,38 @@
1
- import { jsxs as p, jsx as t } from "react/jsx-runtime";
1
+ import { jsxs as p, jsx as o } from "react/jsx-runtime";
2
2
  import { c as m } from "./bind-06a7ff84.js";
3
- import * as b from "react";
4
- import { useState as x } from "react";
5
- import { Popover as B } from "./popover.js";
6
- import { B as w } from "./button-33c88abf.js";
7
- import { F as I } from "./fieldText-65e4c614.js";
8
- import { B as f } from "./baseIconButton-b6adc843.js";
9
- import { Tooltip as E } from "./tooltip.js";
10
- const y = (e) => /* @__PURE__ */ b.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "#A2AAB5", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ b.createElement("path", { d: "M12 13L4 8L12 3L12 13Z" })), T = (e) => /* @__PURE__ */ b.createElement("svg", { width: 13, height: 12, viewBox: "0 0 13 12", fill: "#A2AAB5", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ b.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M0 12L2 12L2 2.38498e-08L1.90798e-07 0L0 12ZM13 1L5 6L13 11L13 1Z" })), k = {
3
+ import * as f from "react";
4
+ import { useState as b } from "react";
5
+ import { Popover as I } from "./popover.js";
6
+ import { B as v } from "./button-33c88abf.js";
7
+ import { F as O } from "./fieldText-65e4c614.js";
8
+ import { B as u } from "./baseIconButton-b6adc843.js";
9
+ import { Tooltip as k } from "./tooltip.js";
10
+ const y = (t) => /* @__PURE__ */ f.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "#A2AAB5", xmlns: "http://www.w3.org/2000/svg", ...t }, /* @__PURE__ */ f.createElement("path", { d: "M12 13L4 8L12 3L12 13Z" })), T = (t) => /* @__PURE__ */ f.createElement("svg", { width: 13, height: 12, viewBox: "0 0 13 12", fill: "#A2AAB5", xmlns: "http://www.w3.org/2000/svg", ...t }, /* @__PURE__ */ f.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M0 12L2 12L2 2.38498e-08L1.90798e-07 0L0 12ZM13 1L5 6L13 11L13 1Z" })), E = {
11
11
  "item-counter": "_item-counter_4g6do_1"
12
- }, M = m.bind(k), P = ({
13
- activePage: e,
12
+ }, M = m.bind(E), P = ({
13
+ activePage: t,
14
14
  pageSize: n,
15
15
  totalItems: s,
16
16
  ofText: r,
17
- itemsText: c
17
+ itemsText: a
18
18
  }) => {
19
- const a = e * n, i = a - n;
19
+ const c = t * n, i = c - n;
20
20
  return /* @__PURE__ */ p("div", { className: M("item-counter"), children: [
21
- `${i + 1} - ${a < s ? a : s}`,
22
- ` ${r} ${s} ${c}`
21
+ `${i + 1} - ${c < s ? c : s}`,
22
+ ` ${r} ${s} ${a}`
23
23
  ] });
24
24
  }, R = "_selected_183l8_32", V = {
25
25
  "size-selector": "_size-selector_183l8_1",
26
26
  "size-option": "_size-option_183l8_6",
27
27
  selected: R
28
28
  }, C = m.bind(V), W = ({
29
- currentSize: e,
29
+ currentSize: t,
30
30
  options: n,
31
31
  onClickOption: s
32
- }) => /* @__PURE__ */ t("div", { className: C("size-selector"), children: n.map((r) => /* @__PURE__ */ t(
32
+ }) => /* @__PURE__ */ o("div", { className: C("size-selector"), children: n.map((r) => /* @__PURE__ */ o(
33
33
  "button",
34
34
  {
35
- className: C("size-option", { selected: r === e }),
35
+ className: C("size-option", { selected: r === t }),
36
36
  onClick: () => {
37
37
  s(r);
38
38
  },
@@ -43,23 +43,23 @@ const y = (e) => /* @__PURE__ */ b.createElement("svg", { width: 16, height: 16,
43
43
  "page-size-control": "_page-size-control_1y4na_1",
44
44
  "size-selector-button": "_size-selector-button_1y4na_10"
45
45
  }, S = m.bind(D), F = ({
46
- size: e,
46
+ size: t,
47
47
  sizeOptions: n,
48
48
  perPageText: s,
49
49
  changeSize: r
50
50
  }) => {
51
- const [c, a] = x(!1), i = (o) => {
52
- r(o), a(!1);
51
+ const [a, c] = b(!1), i = (e) => {
52
+ r(e), c(!1);
53
53
  };
54
54
  return /* @__PURE__ */ p("div", { className: S("page-size-control"), children: [
55
- /* @__PURE__ */ t(
56
- B,
55
+ /* @__PURE__ */ o(
56
+ I,
57
57
  {
58
- content: /* @__PURE__ */ t(W, { options: n, onClickOption: i, currentSize: e }),
58
+ content: /* @__PURE__ */ o(W, { options: n, onClickOption: i, currentSize: t }),
59
59
  placement: "top",
60
- isOpened: c,
61
- setIsOpened: a,
62
- children: /* @__PURE__ */ t(w, { className: S("size-selector-button"), variant: "text", children: e })
60
+ isOpened: a,
61
+ setIsOpened: c,
62
+ children: /* @__PURE__ */ o(v, { className: S("size-selector-button"), variant: "text", children: t })
63
63
  }
64
64
  ),
65
65
  ` ${s}`
@@ -69,23 +69,23 @@ const y = (e) => /* @__PURE__ */ b.createElement("svg", { width: 16, height: 16,
69
69
  "field-wrapper": "_field-wrapper_rtho4_6",
70
70
  "apply-button": "_apply-button_rtho4_10"
71
71
  }, N = m.bind(Z), j = ({
72
- totalPages: e,
72
+ totalPages: t,
73
73
  pageText: n,
74
74
  goActionText: s,
75
75
  selectPage: r
76
76
  }) => {
77
- const [c, a] = x(""), [i, o] = x(!0), d = (h) => {
78
- const u = h.target.value.replace(/\D/g, ""), $ = Number(u), O = $ > 0 && $ <= e;
79
- o(O), a(u);
77
+ const [a, c] = b(""), [i, e] = b(!0), d = (h) => {
78
+ const w = h.target.value.replace(/\D/g, ""), $ = Number(w), L = $ > 0 && $ <= t;
79
+ e(L), c(w);
80
80
  }, l = () => {
81
- r(Number(c));
81
+ r(Number(a));
82
82
  };
83
83
  return /* @__PURE__ */ p("div", { className: N("page-selector"), children: [
84
- /* @__PURE__ */ t("div", { className: N("field-wrapper"), children: /* @__PURE__ */ t(
85
- I,
84
+ /* @__PURE__ */ o("div", { className: N("field-wrapper"), children: /* @__PURE__ */ o(
85
+ O,
86
86
  {
87
87
  onChange: d,
88
- value: c,
88
+ value: a,
89
89
  placeholder: n,
90
90
  error: i ? "" : "Error",
91
91
  touched: !0,
@@ -93,33 +93,33 @@ const y = (e) => /* @__PURE__ */ b.createElement("svg", { width: 16, height: 16,
93
93
  displayError: !1
94
94
  }
95
95
  ) }),
96
- /* @__PURE__ */ t(w, { onClick: l, disabled: !c || !i, className: N("apply-button"), children: s })
96
+ /* @__PURE__ */ o(v, { onClick: l, disabled: !a || !i, className: N("apply-button"), children: s })
97
97
  ] });
98
98
  }, G = {
99
99
  "active-page": "_active-page_rmw5h_1",
100
100
  "page-selector": "_page-selector_rmw5h_10",
101
101
  "page-selector-button": "_page-selector-button_rmw5h_14"
102
- }, v = m.bind(G), H = ({
103
- activePage: e,
102
+ }, x = m.bind(G), H = ({
103
+ activePage: t,
104
104
  totalPages: n,
105
105
  pageText: s,
106
106
  goToText: r,
107
- goActionText: c,
108
- changePage: a
107
+ goActionText: a,
108
+ changePage: c
109
109
  }) => {
110
- const [i, o] = x(!1), d = (l) => {
111
- a(l), o(!1);
110
+ const [i, e] = b(!1), d = (l) => {
111
+ c(l), e(!1);
112
112
  };
113
- return /* @__PURE__ */ p("div", { className: v("active-page"), children: [
113
+ return /* @__PURE__ */ p("div", { className: x("active-page"), children: [
114
114
  `${s} `,
115
- /* @__PURE__ */ t(
116
- B,
115
+ /* @__PURE__ */ o(
116
+ I,
117
117
  {
118
- content: /* @__PURE__ */ t(
118
+ content: /* @__PURE__ */ o(
119
119
  j,
120
120
  {
121
121
  pageText: s,
122
- goActionText: c,
122
+ goActionText: a,
123
123
  selectPage: d,
124
124
  totalPages: n
125
125
  }
@@ -127,9 +127,9 @@ const y = (e) => /* @__PURE__ */ b.createElement("svg", { width: 16, height: 16,
127
127
  title: r,
128
128
  placement: "top",
129
129
  isOpened: i,
130
- setIsOpened: o,
131
- className: v("page-selector"),
132
- children: /* @__PURE__ */ t(w, { className: v("page-selector-button"), variant: "text", children: e })
130
+ setIsOpened: e,
131
+ className: x("page-selector"),
132
+ children: /* @__PURE__ */ o(v, { className: x("page-selector-button"), variant: "text", children: t })
133
133
  }
134
134
  )
135
135
  ] });
@@ -143,37 +143,38 @@ const y = (e) => /* @__PURE__ */ b.createElement("svg", { width: 16, height: 16,
143
143
  "tooltip-text": "_tooltip-text_dfnmf_48",
144
144
  "page-number": "_page-number_dfnmf_52"
145
145
  }, g = m.bind(U), z = 13, A = 260, X = ({
146
- totalPages: e,
146
+ totalPages: t,
147
147
  activePage: n,
148
148
  changePage: s,
149
149
  captions: r
150
150
  }) => {
151
- const c = A / e, a = Math.min(Math.ceil(A / z), e), i = Math.max(z, c), o = [];
152
- for (let l = 1; l <= e; l++)
153
- o.push({
154
- end: l * c,
151
+ const a = A / t, c = Math.min(Math.ceil(A / z), t), i = Math.max(z, a), e = [];
152
+ for (let l = 1; l <= t; l++)
153
+ e.push({
154
+ end: l * a,
155
155
  pageNumber: l
156
156
  });
157
- const d = Array.from({ length: a }, () => ({ pages: { from: void 0, to: void 0 } }));
158
- return o.forEach((l, h) => {
159
- const u = d[h].pages;
160
- u.from || (u.from = l.pageNumber), u.to = l.pageNumber;
161
- }), /* @__PURE__ */ t("div", { className: g("bar"), children: d.map((l, h) => /* @__PURE__ */ t(
157
+ const d = Array.from({ length: c }, () => ({ pages: { from: void 0, to: void 0 } }));
158
+ return d.forEach((l, h) => {
159
+ for (l.pages.from = e[0].pageNumber; i * (h + 1) > e[0].end; )
160
+ e.shift();
161
+ l.pages.to = e[0].pageNumber, e.shift();
162
+ }), /* @__PURE__ */ o("div", { className: g("bar"), children: d.map((l, h) => /* @__PURE__ */ o(
162
163
  "div",
163
164
  {
164
165
  className: g("section-with-tooltip"),
165
166
  style: { width: i },
166
167
  onClick: () => l.pages.from && s(l.pages.from),
167
- children: /* @__PURE__ */ t(
168
- E,
168
+ children: /* @__PURE__ */ o(
169
+ k,
169
170
  {
170
171
  content: /* @__PURE__ */ p("div", { className: g("tooltip"), children: [
171
- /* @__PURE__ */ t("div", { className: g("tooltip-text"), children: r.goTo }),
172
- /* @__PURE__ */ t("div", { className: g("page-number"), children: l.pages.from })
172
+ /* @__PURE__ */ o("div", { className: g("tooltip-text"), children: r.goTo }),
173
+ /* @__PURE__ */ o("div", { className: g("page-number"), children: l.pages.from })
173
174
  ] }),
174
175
  wrapperClassName: g("tooltip-wrapper"),
175
176
  placement: "top",
176
- children: /* @__PURE__ */ t(
177
+ children: /* @__PURE__ */ o(
177
178
  "div",
178
179
  {
179
180
  className: g("section", {
@@ -192,67 +193,67 @@ const y = (e) => /* @__PURE__ */ b.createElement("svg", { width: 16, height: 16,
192
193
  "page-button": "_page-button_1p2t5_6",
193
194
  next: Y
194
195
  }, _ = m.bind(ee), te = ({
195
- activePage: e,
196
+ activePage: t,
196
197
  changePage: n,
197
198
  totalPages: s,
198
199
  captions: r
199
200
  }) => {
200
- const c = () => {
201
+ const a = () => {
201
202
  n(1);
202
- }, a = () => {
203
- n(e - 1);
203
+ }, c = () => {
204
+ n(t - 1);
204
205
  }, i = () => {
205
- n(e + 1);
206
- }, o = () => {
206
+ n(t + 1);
207
+ }, e = () => {
207
208
  n(s);
208
209
  };
209
210
  return /* @__PURE__ */ p("div", { className: _("page-navigator"), children: [
210
211
  /* @__PURE__ */ p("div", { className: _("page-buttons"), children: [
211
- /* @__PURE__ */ t(
212
- f,
212
+ /* @__PURE__ */ o(
213
+ u,
213
214
  {
214
215
  className: _("page-button"),
215
- onClick: c,
216
- disabled: e === 1,
217
- children: /* @__PURE__ */ t(T, {})
216
+ onClick: a,
217
+ disabled: t === 1,
218
+ children: /* @__PURE__ */ o(T, {})
218
219
  }
219
220
  ),
220
- /* @__PURE__ */ t(
221
- f,
221
+ /* @__PURE__ */ o(
222
+ u,
222
223
  {
223
224
  className: _("page-button"),
224
- onClick: a,
225
- disabled: e === 1,
226
- children: /* @__PURE__ */ t(y, {})
225
+ onClick: c,
226
+ disabled: t === 1,
227
+ children: /* @__PURE__ */ o(y, {})
227
228
  }
228
229
  )
229
230
  ] }),
230
- /* @__PURE__ */ t(
231
+ /* @__PURE__ */ o(
231
232
  X,
232
233
  {
233
234
  totalPages: s,
234
- activePage: e,
235
+ activePage: t,
235
236
  changePage: n,
236
237
  captions: r
237
238
  }
238
239
  ),
239
240
  /* @__PURE__ */ p("div", { className: _("page-buttons"), children: [
240
- /* @__PURE__ */ t(
241
- f,
241
+ /* @__PURE__ */ o(
242
+ u,
242
243
  {
243
244
  className: _("page-button", "next"),
244
245
  onClick: i,
245
- disabled: e === s,
246
- children: /* @__PURE__ */ t(y, {})
246
+ disabled: t === s,
247
+ children: /* @__PURE__ */ o(y, {})
247
248
  }
248
249
  ),
249
- /* @__PURE__ */ t(
250
- f,
250
+ /* @__PURE__ */ o(
251
+ u,
251
252
  {
252
253
  className: _("page-button", "next"),
253
- onClick: o,
254
- disabled: e === s,
255
- children: /* @__PURE__ */ t(T, {})
254
+ onClick: e,
255
+ disabled: t === s,
256
+ children: /* @__PURE__ */ o(T, {})
256
257
  }
257
258
  )
258
259
  ] })
@@ -260,16 +261,16 @@ const y = (e) => /* @__PURE__ */ b.createElement("svg", { width: 16, height: 16,
260
261
  }, oe = {
261
262
  "page-controls": "_page-controls_thyf8_1",
262
263
  "total-pages": "_total-pages_thyf8_8"
263
- }, L = m.bind(oe), se = ({
264
- activePage: e,
264
+ }, B = m.bind(oe), se = ({
265
+ activePage: t,
265
266
  changePage: n,
266
267
  captions: s,
267
268
  totalPages: r
268
- }) => /* @__PURE__ */ p("div", { className: L("page-controls"), children: [
269
- /* @__PURE__ */ t(
269
+ }) => /* @__PURE__ */ p("div", { className: B("page-controls"), children: [
270
+ /* @__PURE__ */ o(
270
271
  H,
271
272
  {
272
- activePage: e,
273
+ activePage: t,
273
274
  totalPages: r,
274
275
  changePage: n,
275
276
  pageText: s.page,
@@ -277,70 +278,70 @@ const y = (e) => /* @__PURE__ */ b.createElement("svg", { width: 16, height: 16,
277
278
  goActionText: s.goAction
278
279
  }
279
280
  ),
280
- /* @__PURE__ */ t(
281
+ /* @__PURE__ */ o(
281
282
  te,
282
283
  {
283
284
  changePage: n,
284
- activePage: e,
285
+ activePage: t,
285
286
  totalPages: r,
286
287
  captions: { goTo: s.goTo }
287
288
  }
288
289
  ),
289
- /* @__PURE__ */ p("span", { className: L("total-pages"), children: [
290
+ /* @__PURE__ */ p("span", { className: B("total-pages"), children: [
290
291
  `${s.of} `,
291
292
  r
292
293
  ] })
293
294
  ] }), ne = "_pagination_wi26a_1", re = {
294
295
  pagination: ne
295
- }, le = m.bind(re), ue = ({
296
- activePage: e,
296
+ }, le = m.bind(re), he = ({
297
+ activePage: t,
297
298
  totalPages: n,
298
299
  pageSize: s,
299
300
  totalItems: r,
300
- pageSizeOptions: c,
301
- changePage: a,
301
+ pageSizeOptions: a,
302
+ changePage: c,
302
303
  changePageSize: i,
303
- captions: o
304
+ captions: e
304
305
  }) => {
305
- const d = (o == null ? void 0 : o.of) || "of", l = (o == null ? void 0 : o.page) || "Page";
306
+ const d = (e == null ? void 0 : e.of) || "of", l = (e == null ? void 0 : e.page) || "Page";
306
307
  return /* @__PURE__ */ p("div", { className: le("pagination"), children: [
307
- /* @__PURE__ */ t(
308
+ /* @__PURE__ */ o(
308
309
  P,
309
310
  {
310
- activePage: e,
311
+ activePage: t,
311
312
  pageSize: s,
312
313
  totalItems: r,
313
314
  ofText: d,
314
- itemsText: (o == null ? void 0 : o.items) || "items"
315
+ itemsText: (e == null ? void 0 : e.items) || "items"
315
316
  }
316
317
  ),
317
- n > 1 && /* @__PURE__ */ t(
318
+ n > 1 && /* @__PURE__ */ o(
318
319
  se,
319
320
  {
320
- activePage: e,
321
+ activePage: t,
321
322
  totalPages: n,
322
- changePage: a,
323
+ changePage: c,
323
324
  captions: {
324
325
  page: l,
325
326
  of: d,
326
- goTo: (o == null ? void 0 : o.goTo) || "Go to page",
327
- goAction: (o == null ? void 0 : o.goAction) || "Go"
327
+ goTo: (e == null ? void 0 : e.goTo) || "Go to page",
328
+ goAction: (e == null ? void 0 : e.goAction) || "Go"
328
329
  }
329
330
  }
330
331
  ),
331
- /* @__PURE__ */ t(
332
+ /* @__PURE__ */ o(
332
333
  F,
333
334
  {
334
335
  size: s,
335
- sizeOptions: c,
336
+ sizeOptions: a,
336
337
  changeSize: i,
337
- perPageText: (o == null ? void 0 : o.perPage) || "per page"
338
+ perPageText: (e == null ? void 0 : e.perPage) || "per page"
338
339
  }
339
340
  )
340
341
  ] });
341
342
  };
342
343
  export {
343
- ue as P,
344
+ he as P,
344
345
  y as S,
345
346
  T as a
346
347
  };
@@ -1,4 +1,4 @@
1
- import { P as t } from "./pagination-8e40591a.js";
1
+ import { P as t } from "./pagination-4ae395bd.js";
2
2
  import "react/jsx-runtime";
3
3
  import "./bind-06a7ff84.js";
4
4
  import "react";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reportportal/ui-kit",
3
- "version": "0.0.1-alpha.44",
3
+ "version": "0.0.1-alpha.45",
4
4
  "description": "The UI-kit library for ReportPortal Design System.",
5
5
  "type": "module",
6
6
  "scripts": {