@reportportal/ui-kit 0.0.1-alpha.64 → 0.0.1-alpha.66
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/components/popover/popover.d.ts +1 -0
- package/dist/components/table/constants.d.ts +2 -0
- package/dist/components/table/types.d.ts +4 -6
- package/dist/components/table/utils.d.ts +3 -1
- package/dist/index.js +1 -1
- package/dist/popover.js +60 -56
- package/dist/{table-32fc8c70.js → table-02e40724.js} +32 -34
- package/dist/table.js +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import { ASC, DESC } from './constants';
|
|
2
3
|
|
|
3
4
|
export interface Column {
|
|
4
5
|
key: string;
|
|
@@ -27,13 +28,10 @@ export interface RowData {
|
|
|
27
28
|
rowConfigs?: RowConfigs;
|
|
28
29
|
metaData?: MetaData;
|
|
29
30
|
}
|
|
30
|
-
export
|
|
31
|
-
ASC = "asc",
|
|
32
|
-
DESC = "desc"
|
|
33
|
-
}
|
|
31
|
+
export type SortingDirection = typeof ASC | typeof DESC | Uppercase<typeof ASC | typeof DESC>;
|
|
34
32
|
export interface SortConfig {
|
|
35
33
|
key: string;
|
|
36
|
-
direction:
|
|
34
|
+
direction: SortingDirection;
|
|
37
35
|
}
|
|
38
36
|
export interface TableComponentProps {
|
|
39
37
|
data: RowData[];
|
|
@@ -45,7 +43,7 @@ export interface TableComponentProps {
|
|
|
45
43
|
headerClassName?: string;
|
|
46
44
|
rowClassName?: string;
|
|
47
45
|
selectedRowIds?: (string | number)[];
|
|
48
|
-
sortingDirection?:
|
|
46
|
+
sortingDirection?: SortingDirection;
|
|
49
47
|
sortingColumn?: Column;
|
|
50
48
|
sortableColumns?: string[];
|
|
51
49
|
onChangeSorting?: (sortConfig?: SortConfig) => void;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { Column, RowData, SortConfig } from './types';
|
|
1
|
+
import { Column, RowData, SortConfig, SortingDirection } from './types';
|
|
2
2
|
|
|
3
|
+
export declare const isAsc: (direction: SortingDirection) => boolean;
|
|
3
4
|
export declare const sortTableData: (tableData: RowData[], sortConfig?: SortConfig) => RowData[];
|
|
4
5
|
export declare const getColumnsKeys: (columns: Column[]) => string[];
|
|
6
|
+
export declare const toggleDirection: (direction: SortingDirection) => "desc" | "asc";
|
package/dist/index.js
CHANGED
|
@@ -15,7 +15,7 @@ import { R as q } from "./radio-bccc84f2.js";
|
|
|
15
15
|
import { Tooltip as K } from "./tooltip.js";
|
|
16
16
|
import { Popover as V } from "./popover.js";
|
|
17
17
|
import { P as X } from "./pagination-91729c7d.js";
|
|
18
|
-
import { T as Z } from "./table-
|
|
18
|
+
import { T as Z } from "./table-02e40724.js";
|
|
19
19
|
import { D as $ } from "./datePicker-06e90999.js";
|
|
20
20
|
import "react-datepicker";
|
|
21
21
|
import { SystemAlert as ro } from "./systemAlert.js";
|
package/dist/popover.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { useFloating as
|
|
4
|
-
import { c as
|
|
5
|
-
const
|
|
1
|
+
import { jsxs as f, Fragment as S, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as j, useState as C, useCallback as L } from "react";
|
|
3
|
+
import { useFloating as M, offset as U, flip as W, arrow as q, autoUpdate as z, useClick as B, useDismiss as J, useRole as K, useInteractions as Q, FloatingFocusManager as V, FloatingArrow as X } from "@floating-ui/react";
|
|
4
|
+
import { c as Y } from "./bind-06a7ff84.js";
|
|
5
|
+
const Z = "_popover_16ogt_1", $ = "_title_16ogt_28", O = {
|
|
6
6
|
"popover-wrapper": "_popover-wrapper_16ogt_1",
|
|
7
|
-
popover:
|
|
8
|
-
title:
|
|
9
|
-
},
|
|
7
|
+
popover: Z,
|
|
8
|
+
title: $
|
|
9
|
+
}, r = Y.bind(O), g = 16, d = 8, tt = ["top", "right", "bottom", "left"], et = [
|
|
10
10
|
"right",
|
|
11
11
|
"right-start",
|
|
12
12
|
"right-end",
|
|
13
13
|
"left",
|
|
14
14
|
"left-start",
|
|
15
15
|
"left-end"
|
|
16
|
-
],
|
|
16
|
+
], ot = [
|
|
17
17
|
"top",
|
|
18
18
|
"top-start",
|
|
19
19
|
"top-end",
|
|
@@ -26,70 +26,74 @@ const Q = "_popover_16ogt_1", V = "_title_16ogt_28", X = {
|
|
|
26
26
|
"left",
|
|
27
27
|
"left-start",
|
|
28
28
|
"left-end"
|
|
29
|
-
],
|
|
30
|
-
className:
|
|
31
|
-
content:
|
|
32
|
-
children:
|
|
33
|
-
placement:
|
|
34
|
-
fallbackPlacements:
|
|
35
|
-
title:
|
|
36
|
-
arrowOffset:
|
|
37
|
-
safeZone:
|
|
38
|
-
arrowColor:
|
|
39
|
-
dataAutomationId:
|
|
40
|
-
isOpened:
|
|
41
|
-
setIsOpened:
|
|
29
|
+
], it = ({
|
|
30
|
+
className: h,
|
|
31
|
+
content: u,
|
|
32
|
+
children: v,
|
|
33
|
+
placement: _ = "bottom",
|
|
34
|
+
fallbackPlacements: b = ot,
|
|
35
|
+
title: i,
|
|
36
|
+
arrowOffset: o = 16,
|
|
37
|
+
safeZone: w = 4,
|
|
38
|
+
arrowColor: x = "white",
|
|
39
|
+
dataAutomationId: A,
|
|
40
|
+
isOpened: F,
|
|
41
|
+
setIsOpened: n,
|
|
42
|
+
isCentered: a = !0
|
|
42
43
|
}) => {
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
},
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
const c = j(null), [R, N] = C(!1), p = n ? F : R, P = (t) => {
|
|
45
|
+
n ? n(t) : N(t);
|
|
46
|
+
}, k = L(
|
|
47
|
+
(t, l) => a ? ((et.includes(l) ? t.reference.height : t.reference.width) - g) / 2 - o : -o,
|
|
48
|
+
[o, a]
|
|
49
|
+
), { placement: E, refs: m, floatingStyles: I, context: e } = M({
|
|
50
|
+
open: p,
|
|
51
|
+
onOpenChange: P,
|
|
52
|
+
placement: _,
|
|
49
53
|
middleware: [
|
|
50
|
-
|
|
51
|
-
mainAxis:
|
|
52
|
-
alignmentAxis: (
|
|
54
|
+
U(({ rects: t, placement: l }) => ({
|
|
55
|
+
mainAxis: w + d,
|
|
56
|
+
alignmentAxis: k(t, l)
|
|
53
57
|
})),
|
|
54
|
-
|
|
58
|
+
W({
|
|
55
59
|
fallbackAxisSideDirection: "start",
|
|
56
|
-
fallbackPlacements:
|
|
60
|
+
fallbackPlacements: b
|
|
57
61
|
}),
|
|
58
|
-
|
|
59
|
-
element:
|
|
62
|
+
q({
|
|
63
|
+
element: c
|
|
60
64
|
})
|
|
61
65
|
],
|
|
62
|
-
whileElementsMounted:
|
|
63
|
-
}),
|
|
64
|
-
return /* @__PURE__ */
|
|
65
|
-
/* @__PURE__ */
|
|
66
|
-
|
|
66
|
+
whileElementsMounted: z
|
|
67
|
+
}), T = B(e), y = J(e), D = K(e), { getReferenceProps: G, getFloatingProps: H } = Q([T, y, D]);
|
|
68
|
+
return /* @__PURE__ */ f(S, { children: [
|
|
69
|
+
/* @__PURE__ */ s("div", { ref: m.setReference, ...G(), className: r("popover-wrapper"), children: v }),
|
|
70
|
+
p && /* @__PURE__ */ s(V, { context: e, modal: !1, children: /* @__PURE__ */ f(
|
|
67
71
|
"div",
|
|
68
72
|
{
|
|
69
|
-
className:
|
|
70
|
-
"data-automation-id":
|
|
71
|
-
ref:
|
|
72
|
-
style:
|
|
73
|
-
...
|
|
73
|
+
className: r("popover", h),
|
|
74
|
+
"data-automation-id": A,
|
|
75
|
+
ref: m.setFloating,
|
|
76
|
+
style: I,
|
|
77
|
+
...H,
|
|
74
78
|
children: [
|
|
75
|
-
/* @__PURE__ */
|
|
76
|
-
|
|
79
|
+
/* @__PURE__ */ s(
|
|
80
|
+
X,
|
|
77
81
|
{
|
|
78
|
-
ref:
|
|
79
|
-
context:
|
|
80
|
-
width:
|
|
81
|
-
height:
|
|
82
|
-
fill:
|
|
83
|
-
staticOffset:
|
|
82
|
+
ref: c,
|
|
83
|
+
context: e,
|
|
84
|
+
width: g,
|
|
85
|
+
height: d,
|
|
86
|
+
fill: x,
|
|
87
|
+
staticOffset: tt.includes(E) ? null : o
|
|
84
88
|
}
|
|
85
89
|
),
|
|
86
|
-
|
|
87
|
-
|
|
90
|
+
i && /* @__PURE__ */ s("div", { className: r("title"), children: i }),
|
|
91
|
+
u
|
|
88
92
|
]
|
|
89
93
|
}
|
|
90
94
|
) })
|
|
91
95
|
] });
|
|
92
96
|
};
|
|
93
97
|
export {
|
|
94
|
-
|
|
98
|
+
it as Popover
|
|
95
99
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as n, jsx as l } from "react/jsx-runtime";
|
|
2
|
-
import { useState as
|
|
2
|
+
import { useState as g, useMemo as G } from "react";
|
|
3
3
|
import { c as J } from "./bind-06a7ff84.js";
|
|
4
4
|
import { a as f, S as K } from "./arrowUp-4a5caee7.js";
|
|
5
5
|
import { C as x } from "./checkbox-9a6c7ce1.js";
|
|
@@ -20,82 +20,80 @@ const O = "_table_kha9s_1", P = "_label_kha9s_87", Q = {
|
|
|
20
20
|
"sortable-cell": "_sortable-cell_kha9s_91",
|
|
21
21
|
"align-right": "_align-right_kha9s_94",
|
|
22
22
|
"align-center": "_align-center_kha9s_100"
|
|
23
|
-
}
|
|
24
|
-
var k = /* @__PURE__ */ ((c) => (c.ASC = "asc", c.DESC = "desc", c))(k || {});
|
|
25
|
-
const V = (c) => c.map((t) => t.key), a = J.bind(Q), ee = ({
|
|
23
|
+
}, z = "asc", V = (c) => c.toLowerCase() === z, W = (c) => c.map((t) => t.key), a = J.bind(Q), ae = ({
|
|
26
24
|
data: c,
|
|
27
25
|
primaryColumn: t,
|
|
28
26
|
fixedColumns: h,
|
|
29
27
|
renderRowActions: i,
|
|
30
|
-
className:
|
|
31
|
-
rowClassName:
|
|
28
|
+
className: M = "",
|
|
29
|
+
rowClassName: S = "",
|
|
32
30
|
headerClassName: m = "",
|
|
33
|
-
selectable:
|
|
31
|
+
selectable: k = !1,
|
|
34
32
|
selectedRowIds: d = [],
|
|
35
|
-
sortingDirection:
|
|
33
|
+
sortingDirection: y = z,
|
|
36
34
|
sortingColumn: r = t,
|
|
37
|
-
sortableColumns:
|
|
35
|
+
sortableColumns: o = W([t, ...h]),
|
|
38
36
|
onChangeSorting: u = () => {
|
|
39
37
|
},
|
|
40
38
|
onToggleRowSelection: A = () => {
|
|
41
39
|
},
|
|
42
|
-
onToggleAllRowsSelection:
|
|
40
|
+
onToggleAllRowsSelection: L = () => {
|
|
43
41
|
}
|
|
44
42
|
}) => {
|
|
45
|
-
const [
|
|
46
|
-
|
|
47
|
-
},
|
|
43
|
+
const [E, v] = g(null), [j, p] = g(null), N = G(() => [{ ...t, primary: !0 }, ...h], [t, h]), C = (e) => {
|
|
44
|
+
o.includes(e) && u({ key: e, direction: y });
|
|
45
|
+
}, w = (e) => ({
|
|
48
46
|
width: e.width,
|
|
49
47
|
textAlign: e.align
|
|
50
48
|
}), H = (e) => {
|
|
51
|
-
|
|
49
|
+
v(e);
|
|
52
50
|
}, T = () => {
|
|
53
|
-
|
|
51
|
+
v(null);
|
|
54
52
|
}, $ = (e) => {
|
|
55
|
-
|
|
53
|
+
p(e);
|
|
56
54
|
}, D = () => {
|
|
57
|
-
|
|
55
|
+
p(null);
|
|
58
56
|
}, R = (e) => {
|
|
59
57
|
A(e);
|
|
60
58
|
}, U = () => {
|
|
61
|
-
|
|
62
|
-
}, q = c.every((e) => d.includes(e.id)),
|
|
59
|
+
L();
|
|
60
|
+
}, q = c.every((e) => d.includes(e.id)), _ = c.some((e) => d.includes(e.id)), B = (e) => {
|
|
63
61
|
var s;
|
|
64
62
|
return `size-${((s = e.rowConfigs) == null ? void 0 : s.size) ?? "default"}`;
|
|
65
63
|
}, F = (e) => {
|
|
66
|
-
if (
|
|
67
|
-
return (r == null ? void 0 : r.key) === e ?
|
|
64
|
+
if (o.includes(e))
|
|
65
|
+
return (r == null ? void 0 : r.key) === e ? V(y) ? /* @__PURE__ */ l(f, {}) : /* @__PURE__ */ l(K, {}) : /* @__PURE__ */ l(f, {});
|
|
68
66
|
};
|
|
69
|
-
return /* @__PURE__ */ n("div", { className: a("table",
|
|
67
|
+
return /* @__PURE__ */ n("div", { className: a("table", M), children: [
|
|
70
68
|
/* @__PURE__ */ n("div", { className: a("table-header", m), children: [
|
|
71
|
-
|
|
69
|
+
k && /* @__PURE__ */ l("div", { className: a("table-header-cell", "checkbox-cell"), children: _ && /* @__PURE__ */ l(
|
|
72
70
|
x,
|
|
73
71
|
{
|
|
74
72
|
value: q,
|
|
75
|
-
partiallyChecked:
|
|
73
|
+
partiallyChecked: _,
|
|
76
74
|
onChange: U,
|
|
77
75
|
className: a("checkbox-cell")
|
|
78
76
|
}
|
|
79
77
|
) }),
|
|
80
|
-
|
|
78
|
+
N.map((e) => /* @__PURE__ */ l(
|
|
81
79
|
"button",
|
|
82
80
|
{
|
|
83
81
|
className: a("table-header-cell", {
|
|
84
82
|
[`align-${e.align}`]: "align" in e,
|
|
85
83
|
"primary-cell": "primary" in e && e.primary,
|
|
86
|
-
"sortable-cell":
|
|
84
|
+
"sortable-cell": o.includes(e.key)
|
|
87
85
|
}),
|
|
88
|
-
style:
|
|
86
|
+
style: w(e),
|
|
89
87
|
children: /* @__PURE__ */ n(
|
|
90
88
|
"div",
|
|
91
89
|
{
|
|
92
90
|
className: a("label"),
|
|
93
|
-
onClick: () =>
|
|
91
|
+
onClick: () => C(e.key),
|
|
94
92
|
onMouseEnter: () => H(e.key),
|
|
95
93
|
onMouseLeave: T,
|
|
96
94
|
children: [
|
|
97
95
|
/* @__PURE__ */ l("span", { children: e.header }),
|
|
98
|
-
(
|
|
96
|
+
(E === e.key || (r == null ? void 0 : r.key) === e.key) && F(e.key)
|
|
99
97
|
]
|
|
100
98
|
}
|
|
101
99
|
)
|
|
@@ -107,11 +105,11 @@ const V = (c) => c.map((t) => t.key), a = J.bind(Q), ee = ({
|
|
|
107
105
|
/* @__PURE__ */ l("div", { className: a("table-body"), children: c.map((e, b) => /* @__PURE__ */ n(
|
|
108
106
|
"div",
|
|
109
107
|
{
|
|
110
|
-
className: a("table-row", B(e),
|
|
108
|
+
className: a("table-row", B(e), S),
|
|
111
109
|
onMouseEnter: () => $(b),
|
|
112
110
|
onMouseLeave: D,
|
|
113
111
|
children: [
|
|
114
|
-
|
|
112
|
+
k && /* @__PURE__ */ l("div", { className: a("table-cell", "checkbox-cell"), children: (_ || j === b) && /* @__PURE__ */ l(
|
|
115
113
|
x,
|
|
116
114
|
{
|
|
117
115
|
value: d.includes(e.id),
|
|
@@ -120,13 +118,13 @@ const V = (c) => c.map((t) => t.key), a = J.bind(Q), ee = ({
|
|
|
120
118
|
}
|
|
121
119
|
) }),
|
|
122
120
|
/* @__PURE__ */ n("div", { className: a("table-row-content"), children: [
|
|
123
|
-
|
|
121
|
+
N.map((s) => /* @__PURE__ */ l(
|
|
124
122
|
"div",
|
|
125
123
|
{
|
|
126
124
|
className: a("table-cell", {
|
|
127
125
|
"primary-cell": "primary" in s && s.primary
|
|
128
126
|
}),
|
|
129
|
-
style:
|
|
127
|
+
style: w(s),
|
|
130
128
|
children: e[s.key].component || e[s.key].content || e[s.key]
|
|
131
129
|
},
|
|
132
130
|
s.key
|
|
@@ -140,5 +138,5 @@ const V = (c) => c.map((t) => t.key), a = J.bind(Q), ee = ({
|
|
|
140
138
|
] });
|
|
141
139
|
};
|
|
142
140
|
export {
|
|
143
|
-
|
|
141
|
+
ae as T
|
|
144
142
|
};
|
package/dist/table.js
CHANGED