@reportportal/ui-kit 0.0.1-alpha.30 → 0.0.1-alpha.32
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.
|
@@ -17,10 +17,14 @@ export interface DetailedCellData {
|
|
|
17
17
|
content: string | number;
|
|
18
18
|
component: ReactNode;
|
|
19
19
|
}
|
|
20
|
+
export interface MetaData {
|
|
21
|
+
[key: string]: any;
|
|
22
|
+
}
|
|
20
23
|
export interface RowData {
|
|
21
24
|
id: string | number;
|
|
22
25
|
[key: string]: DetailedCellData | RowConfigs | string | number | any;
|
|
23
26
|
rowConfigs?: RowConfigs;
|
|
27
|
+
metaData?: MetaData;
|
|
24
28
|
}
|
|
25
29
|
export declare enum SortDirection {
|
|
26
30
|
ASC = "asc",
|
|
@@ -34,7 +38,7 @@ export interface TableComponentProps {
|
|
|
34
38
|
data: RowData[];
|
|
35
39
|
primaryColumn: Column;
|
|
36
40
|
fixedColumns: FixedColumn[];
|
|
37
|
-
|
|
41
|
+
renderRowActions?: (metaData?: MetaData) => ReactNode;
|
|
38
42
|
selectable?: boolean;
|
|
39
43
|
className?: string;
|
|
40
44
|
headerClassName?: string;
|
package/dist/index.js
CHANGED
|
@@ -15,7 +15,7 @@ import { R as q1 } from "./radio-bccc84f2.js";
|
|
|
15
15
|
import { Tooltip as J1 } from "./tooltip.js";
|
|
16
16
|
import { Popover as Q1 } from "./popover.js";
|
|
17
17
|
import { P as ee, a as te, S as oe } from "./pagination-ac3ea7c4.js";
|
|
18
|
-
import { S as ne, a as ae, T as le } from "./table-
|
|
18
|
+
import { S as ne, a as ae, T as le } from "./table-9bf4ddab.js";
|
|
19
19
|
import { jsxs as S, Fragment as D, jsx as n } from "react/jsx-runtime";
|
|
20
20
|
import V from "react-datepicker";
|
|
21
21
|
import { c as P } from "./bind-06a7ff84.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsxs as n, jsx as s } from "react/jsx-runtime";
|
|
2
|
-
import * as
|
|
2
|
+
import * as h from "react";
|
|
3
3
|
import { useState as f, useMemo as F } from "react";
|
|
4
4
|
import { c as G } from "./bind-06a7ff84.js";
|
|
5
5
|
import "./baseIconButton-b6adc843.js";
|
|
6
6
|
import { C as L } from "./checkbox-9a6c7ce1.js";
|
|
7
|
-
const J = (a) => /* @__PURE__ */
|
|
7
|
+
const J = (a) => /* @__PURE__ */ h.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...a }, /* @__PURE__ */ h.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" })), m = (a) => /* @__PURE__ */ h.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...a }, /* @__PURE__ */ h.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" })), K = "_table_kha9s_1", O = "_label_kha9s_87", P = {
|
|
8
8
|
table: K,
|
|
9
9
|
"table-header": "_table-header_kha9s_9",
|
|
10
10
|
"table-row": "_table-row_kha9s_16",
|
|
@@ -26,25 +26,25 @@ var v = /* @__PURE__ */ ((a) => (a.ASC = "asc", a.DESC = "desc", a))(v || {});
|
|
|
26
26
|
const Q = (a) => a.map((c) => c.key), l = G.bind(P), le = ({
|
|
27
27
|
data: a,
|
|
28
28
|
primaryColumn: c,
|
|
29
|
-
fixedColumns:
|
|
30
|
-
|
|
29
|
+
fixedColumns: i,
|
|
30
|
+
renderRowActions: d,
|
|
31
31
|
className: x = "",
|
|
32
32
|
rowClassName: A = "",
|
|
33
|
-
headerClassName:
|
|
33
|
+
headerClassName: u = "",
|
|
34
34
|
selectable: y = !1,
|
|
35
35
|
selectedRowIds: o = [],
|
|
36
36
|
sortingDirection: p = v.ASC,
|
|
37
37
|
sortingColumn: r = c,
|
|
38
|
-
sortableColumns: _ = Q([c, ...
|
|
39
|
-
onChangeSorting:
|
|
38
|
+
sortableColumns: _ = Q([c, ...i]),
|
|
39
|
+
onChangeSorting: M = () => {
|
|
40
40
|
},
|
|
41
|
-
onToggleRowSelection:
|
|
41
|
+
onToggleRowSelection: S = () => {
|
|
42
42
|
},
|
|
43
|
-
onToggleAllRowsSelection:
|
|
43
|
+
onToggleAllRowsSelection: z = () => {
|
|
44
44
|
}
|
|
45
45
|
}) => {
|
|
46
|
-
const [
|
|
47
|
-
_.includes(e) &&
|
|
46
|
+
const [E, w] = f(null), [R, g] = f(null), C = F(() => [{ ...c, primary: !0 }, ...i], [c, i]), B = (e) => {
|
|
47
|
+
_.includes(e) && M({ key: e, direction: p });
|
|
48
48
|
}, N = (e) => ({
|
|
49
49
|
width: e.width,
|
|
50
50
|
textAlign: e.align
|
|
@@ -57,24 +57,24 @@ const Q = (a) => a.map((c) => c.key), l = G.bind(P), le = ({
|
|
|
57
57
|
}, Z = () => {
|
|
58
58
|
g(null);
|
|
59
59
|
}, $ = (e) => {
|
|
60
|
-
|
|
61
|
-
},
|
|
62
|
-
|
|
63
|
-
},
|
|
60
|
+
S(e);
|
|
61
|
+
}, D = () => {
|
|
62
|
+
z();
|
|
63
|
+
}, U = a.every((e) => o.includes(e.id)), b = a.some((e) => o.includes(e.id)), V = (e) => {
|
|
64
64
|
var t;
|
|
65
65
|
return `size-${((t = e.rowConfigs) == null ? void 0 : t.size) ?? "default"}`;
|
|
66
|
-
},
|
|
66
|
+
}, q = (e) => {
|
|
67
67
|
if (_.includes(e))
|
|
68
68
|
return (r == null ? void 0 : r.key) === e ? p === v.ASC ? /* @__PURE__ */ s(m, {}) : /* @__PURE__ */ s(J, {}) : /* @__PURE__ */ s(m, {});
|
|
69
69
|
};
|
|
70
70
|
return /* @__PURE__ */ n("div", { className: l("table", x), children: [
|
|
71
|
-
/* @__PURE__ */ n("div", { className: l("table-header",
|
|
71
|
+
/* @__PURE__ */ n("div", { className: l("table-header", u), children: [
|
|
72
72
|
y && /* @__PURE__ */ s("div", { className: l("table-header-cell", "checkbox-cell"), children: b && /* @__PURE__ */ s(
|
|
73
73
|
L,
|
|
74
74
|
{
|
|
75
|
-
value:
|
|
75
|
+
value: U,
|
|
76
76
|
partiallyChecked: b,
|
|
77
|
-
onChange:
|
|
77
|
+
onChange: D,
|
|
78
78
|
className: l("checkbox-cell")
|
|
79
79
|
}
|
|
80
80
|
) }),
|
|
@@ -96,7 +96,7 @@ const Q = (a) => a.map((c) => c.key), l = G.bind(P), le = ({
|
|
|
96
96
|
onMouseLeave: H,
|
|
97
97
|
children: [
|
|
98
98
|
/* @__PURE__ */ s("span", { children: e.header }),
|
|
99
|
-
(
|
|
99
|
+
(E === e.key || (r == null ? void 0 : r.key) === e.key) && q(e.key)
|
|
100
100
|
]
|
|
101
101
|
}
|
|
102
102
|
)
|
|
@@ -108,7 +108,7 @@ const Q = (a) => a.map((c) => c.key), l = G.bind(P), le = ({
|
|
|
108
108
|
/* @__PURE__ */ s("div", { className: l("table-body"), children: a.map((e, k) => /* @__PURE__ */ n(
|
|
109
109
|
"div",
|
|
110
110
|
{
|
|
111
|
-
className: l("table-row",
|
|
111
|
+
className: l("table-row", V(e), A),
|
|
112
112
|
onMouseEnter: () => T(k),
|
|
113
113
|
onMouseLeave: Z,
|
|
114
114
|
children: [
|
|
@@ -132,7 +132,7 @@ const Q = (a) => a.map((c) => c.key), l = G.bind(P), le = ({
|
|
|
132
132
|
},
|
|
133
133
|
t.key
|
|
134
134
|
)),
|
|
135
|
-
d && /* @__PURE__ */ s("div", { className: l("table-cell", "action-menu-cell"), children: d })
|
|
135
|
+
d && /* @__PURE__ */ s("div", { className: l("table-cell", "action-menu-cell"), children: d(e.metaData) })
|
|
136
136
|
] })
|
|
137
137
|
]
|
|
138
138
|
},
|
package/dist/table.js
CHANGED
package/dist/tooltip.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsxs as c, Fragment as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { c as
|
|
4
|
-
import { useFloating as
|
|
5
|
-
const
|
|
1
|
+
import { jsxs as c, Fragment as L, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useState as M, useRef as a } from "react";
|
|
3
|
+
import { c as O } from "./bind-06a7ff84.js";
|
|
4
|
+
import { useFloating as R, offset as v, flip as D, arrow as H, autoUpdate as G, FloatingArrow as j } from "@floating-ui/react";
|
|
5
|
+
const k = {
|
|
6
6
|
"tooltip-wrapper": "_tooltip-wrapper_18ppz_16",
|
|
7
7
|
"tooltip-content": "_tooltip-content_18ppz_23"
|
|
8
|
-
}, p =
|
|
8
|
+
}, p = O.bind(k), z = 300, P = 100, $ = 16, d = 8, U = ["top", "right", "bottom", "left"], C = ({
|
|
9
9
|
content: m,
|
|
10
10
|
wrapperClassName: f,
|
|
11
11
|
contentClassName: u,
|
|
@@ -17,39 +17,41 @@ const j = {
|
|
|
17
17
|
placement: E = "bottom",
|
|
18
18
|
arrowColor: g = "rgba(34, 34, 34, 0.91)",
|
|
19
19
|
dataAutomationId: A,
|
|
20
|
-
|
|
20
|
+
mainAxis: b = !0,
|
|
21
|
+
children: I
|
|
21
22
|
}) => {
|
|
22
|
-
const [n, s] =
|
|
23
|
+
const [n, s] = M(!1), i = a(null), t = a(), { refs: l, floatingStyles: N, context: S } = R({
|
|
23
24
|
open: n,
|
|
24
25
|
placement: E,
|
|
25
26
|
middleware: [
|
|
26
|
-
|
|
27
|
+
v({
|
|
27
28
|
mainAxis: T + d
|
|
28
29
|
}),
|
|
29
|
-
|
|
30
|
+
D({
|
|
31
|
+
mainAxis: b,
|
|
30
32
|
fallbackAxisSideDirection: "start",
|
|
31
|
-
fallbackPlacements:
|
|
33
|
+
fallbackPlacements: U
|
|
32
34
|
}),
|
|
33
|
-
|
|
35
|
+
H({
|
|
34
36
|
element: i
|
|
35
37
|
})
|
|
36
38
|
],
|
|
37
|
-
whileElementsMounted:
|
|
38
|
-
}), e = h ? null : { width: `${w}px` },
|
|
39
|
+
whileElementsMounted: G
|
|
40
|
+
}), e = h ? null : { width: `${w}px` }, W = document.documentElement.clientWidth, y = e || W - P, r = () => {
|
|
39
41
|
t.current && clearTimeout(t.current), s(!1);
|
|
40
|
-
},
|
|
41
|
-
t.current = setTimeout(() => s(!0),
|
|
42
|
+
}, F = () => {
|
|
43
|
+
t.current = setTimeout(() => s(!0), z);
|
|
42
44
|
};
|
|
43
|
-
return /* @__PURE__ */ c(
|
|
45
|
+
return /* @__PURE__ */ c(L, { children: [
|
|
44
46
|
/* @__PURE__ */ o(
|
|
45
47
|
"div",
|
|
46
48
|
{
|
|
47
49
|
ref: l.setReference,
|
|
48
50
|
className: p("tooltip-wrapper", f),
|
|
49
51
|
onMouseDown: r,
|
|
50
|
-
onMouseEnter:
|
|
52
|
+
onMouseEnter: F,
|
|
51
53
|
onMouseLeave: r,
|
|
52
|
-
children:
|
|
54
|
+
children: I
|
|
53
55
|
}
|
|
54
56
|
),
|
|
55
57
|
n && /* @__PURE__ */ c(
|
|
@@ -57,7 +59,7 @@ const j = {
|
|
|
57
59
|
{
|
|
58
60
|
ref: l.setFloating,
|
|
59
61
|
style: {
|
|
60
|
-
...
|
|
62
|
+
...N,
|
|
61
63
|
...e,
|
|
62
64
|
minWidth: x,
|
|
63
65
|
zIndex: _
|
|
@@ -65,11 +67,11 @@ const j = {
|
|
|
65
67
|
"data-automation-id": A,
|
|
66
68
|
children: [
|
|
67
69
|
/* @__PURE__ */ o(
|
|
68
|
-
|
|
70
|
+
j,
|
|
69
71
|
{
|
|
70
72
|
ref: i,
|
|
71
|
-
context:
|
|
72
|
-
width:
|
|
73
|
+
context: S,
|
|
74
|
+
width: $,
|
|
73
75
|
height: d,
|
|
74
76
|
fill: g
|
|
75
77
|
}
|
|
@@ -79,7 +81,7 @@ const j = {
|
|
|
79
81
|
{
|
|
80
82
|
className: p("tooltip-content", u),
|
|
81
83
|
style: {
|
|
82
|
-
maxWidth: `${
|
|
84
|
+
maxWidth: `${y}px`
|
|
83
85
|
},
|
|
84
86
|
children: m
|
|
85
87
|
}
|
|
@@ -90,5 +92,5 @@ const j = {
|
|
|
90
92
|
] });
|
|
91
93
|
};
|
|
92
94
|
export {
|
|
93
|
-
|
|
95
|
+
C as Tooltip
|
|
94
96
|
};
|