@reportportal/ui-kit 0.0.1-alpha.31 → 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