@reportportal/ui-kit 0.0.1-alpha.160 → 0.0.1-alpha.162

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,4 +1,4 @@
1
- import { FC } from 'react';
1
+ import { ReactElement, ReactNode } from 'react';
2
2
 
3
3
  export interface ItemCounterProps {
4
4
  activePage: number;
@@ -6,5 +6,7 @@ export interface ItemCounterProps {
6
6
  totalItems: number;
7
7
  ofText: string;
8
8
  itemsText: string;
9
+ limitExceeded?: boolean;
10
+ warningContent?: ReactNode;
9
11
  }
10
- export declare const ItemCounter: FC<ItemCounterProps>;
12
+ export declare const ItemCounter: ({ activePage, pageSize, totalItems, ofText, itemsText, limitExceeded, warningContent, }: ItemCounterProps) => ReactElement;
@@ -1,4 +1,4 @@
1
- import { FC } from 'react';
1
+ import { ReactElement, ReactNode } from 'react';
2
2
  import { ChangePageSize, ChangePage } from './types';
3
3
 
4
4
  type PaginationCaptions = {
@@ -19,6 +19,8 @@ export interface PaginationProps {
19
19
  changePageSize: ChangePageSize;
20
20
  captions?: PaginationCaptions;
21
21
  className?: string;
22
+ warningContent?: ReactNode;
23
+ limitExceeded?: boolean;
22
24
  }
23
- export declare const Pagination: FC<PaginationProps>;
25
+ export declare const Pagination: ({ activePage, totalPages, pageSize, totalItems, pageSizeOptions, changePage, changePageSize, captions, className, warningContent, limitExceeded, }: PaginationProps) => ReactElement;
24
26
  export {};
@@ -1,10 +1,12 @@
1
1
  import { MutableRefObject } from 'react';
2
2
  import { ResizeCallbackData } from 'react-resizable';
3
+ import { PrimaryColumn, FixedColumn } from '../types';
3
4
 
4
5
  interface UseColumnResizeProps {
5
6
  enabled?: boolean;
6
7
  minWidth?: number;
7
8
  maxWidth?: number;
9
+ columns?: (PrimaryColumn | FixedColumn)[];
8
10
  columnWidthsRef?: MutableRefObject<Map<string, number>>;
9
11
  onColumnResize?: (columnKey: string, width: number) => void;
10
12
  }
@@ -14,5 +16,5 @@ interface UseColumnResizeReturn {
14
16
  handleResizeStop: (columnKey: string) => () => void;
15
17
  handleResizeStart: () => void;
16
18
  }
17
- export declare const useColumnResize: ({ enabled, minWidth, maxWidth, columnWidthsRef, onColumnResize, }: UseColumnResizeProps) => UseColumnResizeReturn;
19
+ export declare const useColumnResize: ({ enabled, minWidth, maxWidth, columns, columnWidthsRef, onColumnResize, }: UseColumnResizeProps) => UseColumnResizeReturn;
18
20
  export {};
@@ -8,10 +8,14 @@ export interface Column {
8
8
  export interface PrimaryColumn extends Column {
9
9
  primary: boolean;
10
10
  width?: string | number;
11
+ minWidth?: number;
12
+ maxWidth?: number;
11
13
  }
12
14
  export interface FixedColumn extends Column {
13
15
  width: string | number;
14
16
  align?: 'left' | 'center' | 'right';
17
+ minWidth?: number;
18
+ maxWidth?: number;
15
19
  }
16
20
  export interface PinnedColumn extends FixedColumn {
17
21
  pinned: boolean;
@@ -1,25 +1,25 @@
1
- import { jsxs as a, jsx as n } from "react/jsx-runtime";
2
- import { forwardRef as p } from "react";
1
+ import { jsxs as p, jsx as e } from "react/jsx-runtime";
2
+ import { forwardRef as f } from "react";
3
3
  import { c as _ } from "./bind-06a7ff84.js";
4
4
  import { S as d, a as m } from "./filterOutline-819b4b0d.js";
5
- const u = "_opened_1f7nf_22", h = {
6
- "filters-icon-container": "_filters-icon-container_1f7nf_1",
7
- "filter-icon": "_filter-icon_1f7nf_19",
5
+ const u = "_opened_c1qju_22", h = {
6
+ "filters-icon-container": "_filters-icon-container_c1qju_1",
7
+ "filter-icon": "_filter-icon_c1qju_19",
8
8
  opened: u,
9
- "with-applied": "_with-applied_1f7nf_28",
10
- "filters-count": "_filters-count_1f7nf_37"
11
- }, t = _.bind(h), b = p(
12
- ({ appliedFiltersCount: i = 0, isOpen: s = !1, className: o, type: r = "button", ...l }, c) => {
13
- const e = i > 0, f = t("filters-icon-container", o, {
14
- "with-applied": e,
9
+ "with-applied": "_with-applied_c1qju_28",
10
+ "filters-count": "_filters-count_c1qju_37"
11
+ }, i = _.bind(h), x = f(
12
+ ({ appliedFiltersCount: n = 0, isOpen: s = !1, className: o, type: c = "button", ...r }, l) => {
13
+ const t = n > 0, a = i("filters-icon-container", o, {
14
+ "with-applied": t,
15
15
  opened: s
16
16
  });
17
- return /* @__PURE__ */ a("button", { type: r, className: f, ref: c, ...l, children: [
18
- /* @__PURE__ */ n("span", { className: t("filter-icon"), children: e ? /* @__PURE__ */ n(d, {}) : /* @__PURE__ */ n(m, {}) }),
19
- e ? /* @__PURE__ */ n("span", { className: t("filters-count"), children: i }) : null
17
+ return /* @__PURE__ */ p("button", { type: c, className: a, ref: l, ...r, children: [
18
+ /* @__PURE__ */ e("span", { className: i("filter-icon"), children: t ? /* @__PURE__ */ e(d, {}) : /* @__PURE__ */ e(m, {}) }),
19
+ t ? /* @__PURE__ */ e("span", { className: i("filters-count"), children: n }) : null
20
20
  ] });
21
21
  }
22
22
  );
23
23
  export {
24
- b as FiltersButton
24
+ x as FiltersButton
25
25
  };
package/dist/index.js CHANGED
@@ -19,7 +19,7 @@ import { FiltersButton as ro } from "./filtersButton.js";
19
19
  import { IssueList as to } from "./issueList.js";
20
20
  import { Modal as no } from "./modal.js";
21
21
  import { MultipleAutocomplete as co, SingleAutocomplete as mo } from "./autocompletes.js";
22
- import { P as so } from "./pagination-8d397dfd.js";
22
+ import { P as so } from "./pagination-4ded0ec6.js";
23
23
  import { Popover as lo } from "./popover.js";
24
24
  import { R as fo } from "./radio-62546efa.js";
25
25
  import { S as So } from "./selection-9124d029.js";
@@ -27,7 +27,7 @@ import { S as Co } from "./spinLoader-c4a53718.js";
27
27
  import { SystemAlert as Fo } from "./systemAlert.js";
28
28
  import { S as bo } from "./systemMessage-924fdaa6.js";
29
29
  import { DragLayer as Bo, SortableItem as To, SortableList as ho } from "./sortable.js";
30
- import { T as vo } from "./table-0adbac16.js";
30
+ import { T as vo } from "./table-5267699a.js";
31
31
  import { T as Lo } from "./themeProvider-46c2be7b.js";
32
32
  import { T as ko } from "./toggle-304107fa.js";
33
33
  import { Tooltip as Eo } from "./tooltip.js";
@@ -1,31 +1,34 @@
1
1
  import { jsxs as p, jsx as t } from "react/jsx-runtime";
2
- import { c as d } from "./bind-06a7ff84.js";
3
- import { useState as b } from "react";
2
+ import { c as _ } from "./bind-06a7ff84.js";
3
+ import { useState as f } from "react";
4
4
  import { Popover as I } from "./popover.js";
5
- import { B as x } from "./button-97d9e587.js";
5
+ import { B as $ } from "./button-97d9e587.js";
6
6
  import { F as j } from "./fieldText-1749da7a.js";
7
- import { B as h } from "./baseIconButton-251479f7.js";
8
- import { S as z, a as T } from "./prevPage-87faf576.js";
7
+ import { B as y } from "./baseIconButton-251479f7.js";
8
+ import { S as T, a as z } from "./prevPage-87faf576.js";
9
9
  import { Tooltip as A } from "./tooltip.js";
10
10
  const B = {
11
- "item-counter": "_item-counter_4g6do_1"
12
- }, W = d.bind(B), P = ({
11
+ "item-counter": "_item-counter_1qk4p_1"
12
+ }, W = _.bind(B), P = ({
13
13
  activePage: o,
14
14
  pageSize: n,
15
15
  totalItems: s,
16
16
  ofText: r,
17
- itemsText: a
17
+ itemsText: a,
18
+ limitExceeded: i = !1,
19
+ warningContent: c = null
18
20
  }) => {
19
- const c = o * n, i = c - n;
21
+ const e = o * n, d = e - n;
20
22
  return /* @__PURE__ */ p("div", { className: W("item-counter"), children: [
21
- `${i + 1} - ${c < s ? c : s}`,
22
- ` ${r} ${s} ${a}`
23
+ `${d + 1} - ${e < s ? e : s}`,
24
+ ` ${r} ${s}${i ? "+" : ""} ${a}`,
25
+ c
23
26
  ] });
24
27
  }, E = "_selected_cjnvy_23", M = {
25
28
  "size-selector": "_size-selector_cjnvy_1",
26
29
  "size-option": "_size-option_cjnvy_6",
27
30
  selected: E
28
- }, C = d.bind(M), V = ({
31
+ }, C = _.bind(M), V = ({
29
32
  currentSize: o,
30
33
  options: n,
31
34
  onClickOption: s
@@ -40,28 +43,28 @@ const B = {
40
43
  },
41
44
  r
42
45
  )) }), D = {
43
- "page-size-control": "_page-size-control_suy7z_1",
44
- "page-size-options": "_page-size-options_suy7z_9",
45
- "size-selector-button": "_size-selector-button_suy7z_13"
46
- }, y = d.bind(D), F = ({
46
+ "page-size-control": "_page-size-control_8rb7p_1",
47
+ "page-size-options": "_page-size-options_8rb7p_8",
48
+ "size-selector-button": "_size-selector-button_8rb7p_12"
49
+ }, N = _.bind(D), F = ({
47
50
  size: o,
48
51
  sizeOptions: n,
49
52
  perPageText: s,
50
53
  changeSize: r
51
54
  }) => {
52
- const [a, c] = b(!1), i = (e) => {
53
- r(e), c(!1);
55
+ const [a, i] = f(!1), c = (e) => {
56
+ r(e), i(!1);
54
57
  };
55
- return /* @__PURE__ */ p("div", { className: y("page-size-control"), children: [
58
+ return /* @__PURE__ */ p("div", { className: N("page-size-control"), children: [
56
59
  /* @__PURE__ */ t(
57
60
  I,
58
61
  {
59
- content: /* @__PURE__ */ t(V, { options: n, onClickOption: i, currentSize: o }),
62
+ content: /* @__PURE__ */ t(V, { options: n, onClickOption: c, currentSize: o }),
60
63
  placement: "top",
61
64
  isOpened: a,
62
- setIsOpened: c,
63
- className: y("page-size-options"),
64
- children: /* @__PURE__ */ t(x, { className: y("size-selector-button"), variant: "text", adjustWidthOn: "content", children: o })
65
+ setIsOpened: i,
66
+ className: N("page-size-options"),
67
+ children: /* @__PURE__ */ t($, { className: N("size-selector-button"), variant: "text", adjustWidthOn: "content", children: o })
65
68
  }
66
69
  ),
67
70
  ` ${s}`
@@ -70,49 +73,49 @@ const B = {
70
73
  "page-selector": "_page-selector_rtho4_1",
71
74
  "field-wrapper": "_field-wrapper_rtho4_6",
72
75
  "apply-button": "_apply-button_rtho4_10"
73
- }, N = d.bind(G), H = ({
76
+ }, x = _.bind(G), H = ({
74
77
  totalPages: o,
75
78
  pageText: n,
76
79
  goActionText: s,
77
80
  selectPage: r
78
81
  }) => {
79
- const [a, c] = b(""), [i, e] = b(!0), _ = (g) => {
80
- const v = g.target.value.replace(/\D/g, ""), $ = Number(v), k = $ > 0 && $ <= o;
81
- e(k), c(v);
82
+ const [a, i] = f(""), [c, e] = f(!0), d = (g) => {
83
+ const h = g.target.value.replace(/\D/g, ""), b = Number(h), k = b > 0 && b <= o;
84
+ e(k), i(h);
82
85
  }, l = () => {
83
86
  r(Number(a));
84
87
  };
85
- return /* @__PURE__ */ p("div", { className: N("page-selector"), children: [
86
- /* @__PURE__ */ t("div", { className: N("field-wrapper"), children: /* @__PURE__ */ t(
88
+ return /* @__PURE__ */ p("div", { className: x("page-selector"), children: [
89
+ /* @__PURE__ */ t("div", { className: x("field-wrapper"), children: /* @__PURE__ */ t(
87
90
  j,
88
91
  {
89
- onChange: _,
92
+ onChange: d,
90
93
  value: a,
91
94
  placeholder: n,
92
- error: i ? "" : "Error",
95
+ error: c ? "" : "Error",
93
96
  touched: !0,
94
97
  defaultWidth: !1,
95
98
  displayError: !1
96
99
  }
97
100
  ) }),
98
- /* @__PURE__ */ t(x, { onClick: l, disabled: !a || !i, className: N("apply-button"), children: s })
101
+ /* @__PURE__ */ t($, { onClick: l, disabled: !a || !c, className: x("apply-button"), children: s })
99
102
  ] });
100
- }, L = {
103
+ }, q = {
101
104
  "active-page": "_active-page_1gl9o_1",
102
105
  "page-selector": "_page-selector_1gl9o_10",
103
106
  "page-selector-button": "_page-selector-button_1gl9o_14"
104
- }, f = d.bind(L), R = ({
107
+ }, v = _.bind(q), L = ({
105
108
  activePage: o,
106
109
  totalPages: n,
107
110
  pageText: s,
108
111
  goToText: r,
109
112
  goActionText: a,
110
- changePage: c
113
+ changePage: i
111
114
  }) => {
112
- const [i, e] = b(!1), _ = (l) => {
113
- c(l), e(!1);
115
+ const [c, e] = f(!1), d = (l) => {
116
+ i(l), e(!1);
114
117
  };
115
- return /* @__PURE__ */ p("div", { className: f("active-page"), children: [
118
+ return /* @__PURE__ */ p("div", { className: v("active-page"), children: [
116
119
  `${s} `,
117
120
  /* @__PURE__ */ t(
118
121
  I,
@@ -122,21 +125,21 @@ const B = {
122
125
  {
123
126
  pageText: s,
124
127
  goActionText: a,
125
- selectPage: _,
128
+ selectPage: d,
126
129
  totalPages: n
127
130
  }
128
131
  ),
129
132
  title: r,
130
133
  placement: "top",
131
- isOpened: i,
134
+ isOpened: c,
132
135
  setIsOpened: e,
133
- className: f("page-selector"),
134
- children: /* @__PURE__ */ t(x, { className: f("page-selector-button"), variant: "text", adjustWidthOn: "content", children: o })
136
+ className: v("page-selector"),
137
+ children: /* @__PURE__ */ t($, { className: v("page-selector-button"), variant: "text", adjustWidthOn: "content", children: o })
135
138
  }
136
139
  )
137
140
  ] });
138
- }, q = "_bar_y74hy_1", J = "_section_y74hy_9", K = "_selected_y74hy_33", Q = "_tooltip_y74hy_37", U = {
139
- bar: q,
141
+ }, R = "_bar_y74hy_1", J = "_section_y74hy_9", K = "_selected_y74hy_33", Q = "_tooltip_y74hy_37", U = {
142
+ bar: R,
140
143
  "section-with-tooltip": "_section-with-tooltip_y74hy_9",
141
144
  section: J,
142
145
  selected: K,
@@ -144,28 +147,28 @@ const B = {
144
147
  tooltip: Q,
145
148
  "tooltip-text": "_tooltip-text_y74hy_48",
146
149
  "page-number": "_page-number_y74hy_52"
147
- }, m = d.bind(U), S = 13, w = 260, X = ({
150
+ }, m = _.bind(U), S = 13, w = 260, X = ({
148
151
  totalPages: o,
149
152
  activePage: n,
150
153
  changePage: s,
151
154
  captions: r
152
155
  }) => {
153
- const a = w / o, c = Math.min(Math.ceil(w / S), o), i = Math.max(S, a), e = [];
156
+ const a = w / o, i = Math.min(Math.ceil(w / S), o), c = Math.max(S, a), e = [];
154
157
  for (let l = 1; l <= o; l++)
155
158
  e.push({
156
159
  end: l * a,
157
160
  pageNumber: l
158
161
  });
159
- const _ = Array.from({ length: c }, () => ({ pages: { from: void 0, to: void 0 } }));
160
- return _.forEach((l, g) => {
161
- for (l.pages.from = e[0].pageNumber; i * (g + 1) > e[0].end; )
162
+ const d = Array.from({ length: i }, () => ({ pages: { from: void 0, to: void 0 } }));
163
+ return d.forEach((l, g) => {
164
+ for (l.pages.from = e[0].pageNumber; c * (g + 1) > e[0].end; )
162
165
  e.shift();
163
166
  l.pages.to = e[0].pageNumber, e.shift();
164
- }), /* @__PURE__ */ t("div", { className: m("bar"), children: _.map((l, g) => /* @__PURE__ */ t(
167
+ }), /* @__PURE__ */ t("div", { className: m("bar"), children: d.map((l, g) => /* @__PURE__ */ t(
165
168
  "div",
166
169
  {
167
170
  className: m("section-with-tooltip"),
168
- style: { width: i },
171
+ style: { width: c },
169
172
  onClick: () => l.pages.from && s(l.pages.from),
170
173
  children: /* @__PURE__ */ t(
171
174
  A,
@@ -194,7 +197,7 @@ const B = {
194
197
  "page-buttons": "_page-buttons_pyt8p_7",
195
198
  "page-button": "_page-button_pyt8p_7",
196
199
  next: Y
197
- }, u = d.bind(Z), ee = ({
200
+ }, u = _.bind(Z), ee = ({
198
201
  activePage: o,
199
202
  changePage: n,
200
203
  totalPages: s,
@@ -202,9 +205,9 @@ const B = {
202
205
  }) => {
203
206
  const a = () => {
204
207
  n(1);
205
- }, c = () => {
206
- n(o - 1);
207
208
  }, i = () => {
209
+ n(o - 1);
210
+ }, c = () => {
208
211
  n(o + 1);
209
212
  }, e = () => {
210
213
  n(s);
@@ -212,21 +215,21 @@ const B = {
212
215
  return /* @__PURE__ */ p("div", { className: u("page-navigator"), children: [
213
216
  /* @__PURE__ */ p("div", { className: u("page-buttons"), children: [
214
217
  /* @__PURE__ */ t(
215
- h,
218
+ y,
216
219
  {
217
220
  className: u("page-button"),
218
221
  onClick: a,
219
222
  disabled: o === 1,
220
- children: /* @__PURE__ */ t(z, {})
223
+ children: /* @__PURE__ */ t(T, {})
221
224
  }
222
225
  ),
223
226
  /* @__PURE__ */ t(
224
- h,
227
+ y,
225
228
  {
226
229
  className: u("page-button"),
227
- onClick: c,
230
+ onClick: i,
228
231
  disabled: o === 1,
229
- children: /* @__PURE__ */ t(T, {})
232
+ children: /* @__PURE__ */ t(z, {})
230
233
  }
231
234
  )
232
235
  ] }),
@@ -241,21 +244,21 @@ const B = {
241
244
  ),
242
245
  /* @__PURE__ */ p("div", { className: u("page-buttons"), children: [
243
246
  /* @__PURE__ */ t(
244
- h,
247
+ y,
245
248
  {
246
249
  className: u("page-button", "next"),
247
- onClick: i,
250
+ onClick: c,
248
251
  disabled: o === s,
249
- children: /* @__PURE__ */ t(T, {})
252
+ children: /* @__PURE__ */ t(z, {})
250
253
  }
251
254
  ),
252
255
  /* @__PURE__ */ t(
253
- h,
256
+ y,
254
257
  {
255
258
  className: u("page-button", "next"),
256
259
  onClick: e,
257
260
  disabled: o === s,
258
- children: /* @__PURE__ */ t(z, {})
261
+ children: /* @__PURE__ */ t(T, {})
259
262
  }
260
263
  )
261
264
  ] })
@@ -263,14 +266,14 @@ const B = {
263
266
  }, te = {
264
267
  "page-controls": "_page-controls_thyf8_1",
265
268
  "total-pages": "_total-pages_thyf8_8"
266
- }, O = d.bind(te), oe = ({
269
+ }, O = _.bind(te), oe = ({
267
270
  activePage: o,
268
271
  changePage: n,
269
272
  captions: s,
270
273
  totalPages: r
271
274
  }) => /* @__PURE__ */ p("div", { className: O("page-controls"), children: [
272
275
  /* @__PURE__ */ t(
273
- R,
276
+ L,
274
277
  {
275
278
  activePage: o,
276
279
  totalPages: r,
@@ -295,27 +298,31 @@ const B = {
295
298
  ] })
296
299
  ] }), se = "_pagination_w2r3n_1", ne = {
297
300
  pagination: se
298
- }, re = d.bind(ne), ue = ({
301
+ }, re = _.bind(ne), ue = ({
299
302
  activePage: o,
300
303
  totalPages: n,
301
304
  pageSize: s,
302
305
  totalItems: r,
303
306
  pageSizeOptions: a,
304
- changePage: c,
305
- changePageSize: i,
307
+ changePage: i,
308
+ changePageSize: c,
306
309
  captions: e,
307
- className: _
310
+ className: d,
311
+ warningContent: l,
312
+ limitExceeded: g = !1
308
313
  }) => {
309
- const l = (e == null ? void 0 : e.of) || "of", g = (e == null ? void 0 : e.page) || "Page";
310
- return /* @__PURE__ */ p("div", { className: re("pagination", _), children: [
314
+ const h = (e == null ? void 0 : e.of) || "of", b = (e == null ? void 0 : e.page) || "Page";
315
+ return /* @__PURE__ */ p("div", { className: re("pagination", d), children: [
311
316
  /* @__PURE__ */ t(
312
317
  P,
313
318
  {
314
319
  activePage: o,
315
320
  pageSize: s,
316
321
  totalItems: r,
317
- ofText: l,
318
- itemsText: (e == null ? void 0 : e.items) || "items"
322
+ ofText: h,
323
+ itemsText: (e == null ? void 0 : e.items) || "items",
324
+ limitExceeded: g,
325
+ warningContent: l
319
326
  }
320
327
  ),
321
328
  n > 1 && /* @__PURE__ */ t(
@@ -323,10 +330,10 @@ const B = {
323
330
  {
324
331
  activePage: o,
325
332
  totalPages: n,
326
- changePage: c,
333
+ changePage: i,
327
334
  captions: {
328
- page: g,
329
- of: l,
335
+ page: b,
336
+ of: h,
330
337
  goTo: (e == null ? void 0 : e.goTo) || "Go to page",
331
338
  goAction: (e == null ? void 0 : e.goAction) || "Go"
332
339
  }
@@ -337,7 +344,7 @@ const B = {
337
344
  {
338
345
  size: s,
339
346
  sizeOptions: a,
340
- changeSize: i,
347
+ changeSize: c,
341
348
  perPageText: (e == null ? void 0 : e.perPage) || "per page"
342
349
  }
343
350
  )
@@ -1,4 +1,4 @@
1
- import { P as t } from "./pagination-8d397dfd.js";
1
+ import { P as t } from "./pagination-4ded0ec6.js";
2
2
  import "react/jsx-runtime";
3
3
  import "./bind-06a7ff84.js";
4
4
  import "react";