@reportportal/ui-kit 0.0.1-alpha.141 → 0.0.1-alpha.143

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.
Files changed (142) hide show
  1. package/dist/adaptiveTagList.js +189 -0
  2. package/dist/attachedFile.js +9 -0
  3. package/dist/autocompletes.js +779 -0
  4. package/dist/baseIconButton-251479f7.js +25 -0
  5. package/dist/baseIconButton.js +7 -0
  6. package/dist/bind-06a7ff84.js +41 -0
  7. package/dist/breadcrumbs-8e5ca8d7.js +183 -0
  8. package/dist/breadcrumbs.js +12 -0
  9. package/dist/bubblesLoader-f3ffa240.js +28 -0
  10. package/dist/bubblesLoader.js +7 -0
  11. package/dist/button-97d9e587.js +66 -0
  12. package/dist/button.js +8 -0
  13. package/dist/calendarArrow-44c7e60e.js +5 -0
  14. package/dist/checkbox-ed6cc375.js +73 -0
  15. package/dist/checkbox.js +9 -0
  16. package/dist/chevronDownDropdown-66f5b1af.js +7 -0
  17. package/dist/clear-53660571.js +5 -0
  18. package/dist/close-4d480ef7.js +5 -0
  19. package/dist/datePicker-f8e0df24.js +194 -0
  20. package/dist/datePicker.js +35 -0
  21. package/dist/dropdown-0260bb66.js +5 -0
  22. package/dist/dropdown-893c692c.js +634 -0
  23. package/dist/dropdown.js +27 -0
  24. package/dist/fieldLabel.js +18 -0
  25. package/dist/fieldNumber-d1b5a7a1.js +140 -0
  26. package/dist/fieldNumber.js +13 -0
  27. package/dist/fieldText-1749da7a.js +167 -0
  28. package/dist/fieldText.js +14 -0
  29. package/dist/fieldTextFlex-2f51c173.js +80 -0
  30. package/dist/fieldTextFlex.js +10 -0
  31. package/dist/fileDropArea.js +325 -0
  32. package/dist/filterOutline-819b4b0d.js +6 -0
  33. package/dist/filtersButton.js +25 -0
  34. package/dist/floatingUi-41f8c7b5.js +29 -0
  35. package/dist/icons.js +85 -0
  36. package/dist/index-1a874a8b.js +110 -0
  37. package/dist/index.js +165 -0
  38. package/dist/isEmpty-ccacb5ff.js +38 -0
  39. package/dist/keyCodes-f63c0e11.js +4 -0
  40. package/dist/maxValueDisplay-9be01a75.js +13 -0
  41. package/dist/maxValueDisplay.js +6 -0
  42. package/dist/minus-2857540f.js +5 -0
  43. package/dist/modal.js +194 -0
  44. package/dist/openEye-950159cb.js +6 -0
  45. package/dist/pagination-a3dee614.js +347 -0
  46. package/dist/pagination.js +22 -0
  47. package/dist/plus-199fb2a8.js +5 -0
  48. package/dist/popover.js +80 -0
  49. package/dist/prevPage-87faf576.js +6 -0
  50. package/dist/radio-62546efa.js +76 -0
  51. package/dist/radio.js +9 -0
  52. package/dist/selection-9124d029.js +38 -0
  53. package/dist/selection.js +10 -0
  54. package/dist/sidePanel.js +88 -0
  55. package/dist/sortable.js +160 -0
  56. package/dist/spinLoader-c4a53718.js +11 -0
  57. package/dist/spinLoader.js +7 -0
  58. package/dist/style.css +1 -1
  59. package/dist/success-8fd8bd2c.js +7 -0
  60. package/dist/systemAlert.js +69 -0
  61. package/dist/systemMessage-924fdaa6.js +30 -0
  62. package/dist/systemMessage.js +7 -0
  63. package/dist/table-c172f35e.js +504 -0
  64. package/dist/table.js +15 -0
  65. package/dist/themeProvider-46c2be7b.js +23 -0
  66. package/dist/themeProvider.js +7 -0
  67. package/dist/toggle-304107fa.js +59 -0
  68. package/dist/toggle.js +9 -0
  69. package/dist/tooltip.js +103 -0
  70. package/dist/tree-c3dd3d45.js +6 -0
  71. package/dist/xls-995781cc.js +11 -0
  72. package/package.json +8 -6
  73. package/dist/adaptiveTagList.cjs +0 -1
  74. package/dist/attachedFile.cjs +0 -1
  75. package/dist/autocompletes.cjs +0 -1
  76. package/dist/baseIconButton-263e74dc.js +0 -1
  77. package/dist/baseIconButton.cjs +0 -1
  78. package/dist/bind-29baac98.js +0 -5
  79. package/dist/breadcrumbs-a11e7e56.js +0 -1
  80. package/dist/breadcrumbs.cjs +0 -1
  81. package/dist/bubblesLoader-98fdf0af.js +0 -1
  82. package/dist/bubblesLoader.cjs +0 -1
  83. package/dist/button-8456d133.js +0 -1
  84. package/dist/button.cjs +0 -1
  85. package/dist/calendarArrow-6c6d9356.js +0 -1
  86. package/dist/checkbox-d4cc648d.js +0 -1
  87. package/dist/checkbox.cjs +0 -1
  88. package/dist/chevronDownDropdown-6196562c.js +0 -1
  89. package/dist/clear-07e1c174.js +0 -1
  90. package/dist/close-82e2e274.js +0 -1
  91. package/dist/datePicker-245e845d.js +0 -1
  92. package/dist/datePicker.cjs +0 -1
  93. package/dist/dropdown-b56964c6.js +0 -1
  94. package/dist/dropdown-fa4cd19c.js +0 -1
  95. package/dist/dropdown.cjs +0 -1
  96. package/dist/fieldLabel.cjs +0 -1
  97. package/dist/fieldNumber-9fe044df.js +0 -1
  98. package/dist/fieldNumber.cjs +0 -1
  99. package/dist/fieldText-2af0d7db.js +0 -1
  100. package/dist/fieldText.cjs +0 -1
  101. package/dist/fieldTextFlex-c26b190d.js +0 -1
  102. package/dist/fieldTextFlex.cjs +0 -1
  103. package/dist/fileDropArea.cjs +0 -1
  104. package/dist/filterOutline-5f3f8591.js +0 -1
  105. package/dist/filtersButton.cjs +0 -1
  106. package/dist/floatingUi-97183bba.js +0 -1
  107. package/dist/icons.cjs +0 -1
  108. package/dist/index-4c0424bf.js +0 -1
  109. package/dist/index.cjs +0 -1
  110. package/dist/isEmpty-fe949e63.js +0 -1
  111. package/dist/keyCodes-b188a920.js +0 -1
  112. package/dist/maxValueDisplay-68f1f114.js +0 -1
  113. package/dist/maxValueDisplay.cjs +0 -1
  114. package/dist/minus-0debd2c6.js +0 -1
  115. package/dist/modal.cjs +0 -1
  116. package/dist/openEye-737c72d6.js +0 -1
  117. package/dist/pagination-fc5189f7.js +0 -1
  118. package/dist/pagination.cjs +0 -1
  119. package/dist/plus-b12abe9f.js +0 -1
  120. package/dist/popover.cjs +0 -1
  121. package/dist/prevPage-063b5d63.js +0 -1
  122. package/dist/radio-aba4677b.js +0 -1
  123. package/dist/radio.cjs +0 -1
  124. package/dist/selection-49b927d0.js +0 -1
  125. package/dist/selection.cjs +0 -1
  126. package/dist/sidePanel.cjs +0 -1
  127. package/dist/sortable.cjs +0 -1
  128. package/dist/spinLoader-9ebd776a.js +0 -1
  129. package/dist/spinLoader.cjs +0 -1
  130. package/dist/success-823e5446.js +0 -1
  131. package/dist/systemAlert.cjs +0 -1
  132. package/dist/systemMessage-1ae2764d.js +0 -1
  133. package/dist/systemMessage.cjs +0 -1
  134. package/dist/table-cd9f0ff3.js +0 -1
  135. package/dist/table.cjs +0 -1
  136. package/dist/themeProvider-4dfafca5.js +0 -1
  137. package/dist/themeProvider.cjs +0 -1
  138. package/dist/toggle-359b70d4.js +0 -1
  139. package/dist/toggle.cjs +0 -1
  140. package/dist/tooltip.cjs +0 -1
  141. package/dist/tree-4610ac42.js +0 -1
  142. package/dist/xls-3ed747b0.js +0 -1
@@ -0,0 +1,7 @@
1
+ import * as e from "react";
2
+ const t = (l) => /* @__PURE__ */ e.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 20, height: 20, viewBox: "0 0 20 20", fill: "none", ...l }, /* @__PURE__ */ e.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M11.0449 3.41275C10.5805 2.59573 9.41952 2.59573 8.95513 3.41275L2.16344 15.3617C1.69905 16.1787 2.27954 17.2 3.20832 17.2H16.7917C17.7205 17.2 18.3009 16.1787 17.8366 15.3617L11.0449 3.41275ZM10.9325 6.41163C10.9391 6.18625 10.7582 5.99999 10.5327 5.99999H9.46161C9.236 5.99999 9.05502 6.18647 9.06179 6.41198L9.24768 12.612C9.25416 12.8281 9.43125 13 9.6475 13H10.3523C10.5686 13 10.7458 12.8279 10.7521 12.6116L10.9325 6.41163ZM10 16C10.5523 16 11 15.5523 11 15C11 14.4477 10.5523 14 10 14C9.44771 14 9 14.4477 9 15C9 15.5523 9.44771 16 10 16Z", fill: "white" })), C = (l) => /* @__PURE__ */ e.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...l }, /* @__PURE__ */ e.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M8 1C4.13401 1 1 4.13401 1 8C1 11.866 4.13401 15 8 15C11.866 15 15 11.866 15 8C15 4.13401 11.866 1 8 1ZM0 8C0 3.58172 3.58172 0 8 0C12.4183 0 16 3.58172 16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8Z", fill: "#A2AAB5" }), /* @__PURE__ */ e.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M6.80005 7.30627C6.80005 7.04853 7.00898 6.8396 7.26672 6.8396H8.04449C8.30223 6.8396 8.51116 7.04853 8.51116 7.30627V11.5063H8.82227C9.08 11.5063 9.28894 11.7152 9.28894 11.9729C9.28894 12.2307 9.08 12.4396 8.82227 12.4396H8.04449C7.78676 12.4396 7.57783 12.2307 7.57783 11.9729V7.77293H7.26672C7.00898 7.77293 6.80005 7.564 6.80005 7.30627Z", fill: "#A2AAB5" }), /* @__PURE__ */ e.createElement("path", { d: "M7.99629 5.94444C8.53324 5.94444 8.96852 5.50917 8.96852 4.97222C8.96852 4.43528 8.53324 4 7.99629 4C7.45935 4 7.02407 4.43528 7.02407 4.97222C7.02407 5.50917 7.45935 5.94444 7.99629 5.94444Z", fill: "#A2AAB5" })), n = (l) => /* @__PURE__ */ e.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 20, height: 20, viewBox: "0 0 20 20", fill: "none", ...l }, /* @__PURE__ */ e.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M17.2 9.99999C17.2 13.9764 13.9765 17.2 10 17.2C6.0236 17.2 2.80005 13.9764 2.80005 9.99999C2.80005 6.02354 6.0236 2.79999 10 2.79999C13.9765 2.79999 17.2 6.02354 17.2 9.99999ZM13.8146 8.11216C14.0975 7.77273 14.0516 7.26828 13.7122 6.98543C13.3728 6.70258 12.8683 6.74844 12.5855 7.08786L9.14629 11.2149L7.36573 9.43432C7.05331 9.1219 6.54678 9.1219 6.23436 9.43432C5.92194 9.74674 5.92194 10.2533 6.23436 10.5657L8.63436 12.9657C8.7933 13.1246 9.01176 13.2094 9.2363 13.1992C9.46084 13.189 9.67073 13.0848 9.81463 12.9122L13.8146 8.11216Z", fill: "white" }));
3
+ export {
4
+ t as S,
5
+ C as a,
6
+ n as b
7
+ };
@@ -0,0 +1,69 @@
1
+ import { jsxs as g, jsx as e } from "react/jsx-runtime";
2
+ import { useState as h, useRef as v, useEffect as _ } from "react";
3
+ import { c as E } from "./bind-06a7ff84.js";
4
+ import { S as I } from "./close-4d480ef7.js";
5
+ import { S as p, b as S, a as O } from "./success-8fd8bd2c.js";
6
+ var o = /* @__PURE__ */ ((t) => (t.INFO = "info", t.SUCCESS = "success", t.WARNING = "warning", t.ERROR = "error", t))(o || {}), f = /* @__PURE__ */ ((t) => (t.WHITE = "white", t.BLACK = "black", t))(f || {});
7
+ const k = "_error_jbf1d_14", x = "_success_jbf1d_17", D = "_info_jbf1d_20", H = "_warning_jbf1d_23", T = "_title_jbf1d_38", U = {
8
+ "system-alert": "_system-alert_jbf1d_1",
9
+ "system-alert--black": "_system-alert--black_jbf1d_11",
10
+ error: k,
11
+ success: x,
12
+ info: D,
13
+ warning: H,
14
+ "icon-wrapper": "_icon-wrapper_jbf1d_26",
15
+ "content-wrapper": "_content-wrapper_jbf1d_32",
16
+ title: T,
17
+ "title--white": "_title--white_jbf1d_50",
18
+ "title--black": "_title--black_jbf1d_53",
19
+ "close-button": "_close-button_jbf1d_56"
20
+ }, s = E.bind(U), F = 7e3, W = 4e3, G = ({
21
+ title: t,
22
+ onClose: c,
23
+ icon: u = null,
24
+ type: n = o.INFO,
25
+ typographyColor: i = f.WHITE,
26
+ duration: d = W,
27
+ className: m,
28
+ dataAutomationId: b
29
+ }) => {
30
+ const l = n === o.ERROR ? F : d, [j, w] = h(""), r = v(null);
31
+ _(() => {
32
+ const { offsetHeight: a, scrollHeight: N } = r == null ? void 0 : r.current;
33
+ a < N && w(t);
34
+ }, [t]), _(() => {
35
+ const a = setTimeout(() => {
36
+ c();
37
+ }, l);
38
+ return () => clearTimeout(a);
39
+ }, [l, c]);
40
+ const R = () => {
41
+ switch (n) {
42
+ case "info":
43
+ return /* @__PURE__ */ e(O, {});
44
+ case "success":
45
+ return /* @__PURE__ */ e(S, {});
46
+ case "warning":
47
+ case "error":
48
+ return /* @__PURE__ */ e(p, {});
49
+ default:
50
+ return u;
51
+ }
52
+ };
53
+ return /* @__PURE__ */ g(
54
+ "div",
55
+ {
56
+ className: s("system-alert", n, m, `system-alert--${i}`),
57
+ title: j,
58
+ "data-automation-id": b,
59
+ children: [
60
+ /* @__PURE__ */ e("div", { className: s("icon-wrapper"), children: R() }),
61
+ /* @__PURE__ */ e("div", { className: s("content-wrapper"), children: /* @__PURE__ */ e("h2", { ref: r, className: s("title", `title--${i}`), children: t }) }),
62
+ /* @__PURE__ */ e("button", { className: s("close-button"), onClick: c, "aria-label": "close system alert", children: /* @__PURE__ */ e(I, {}) })
63
+ ]
64
+ }
65
+ );
66
+ };
67
+ export {
68
+ G as SystemAlert
69
+ };
@@ -0,0 +1,30 @@
1
+ import { jsxs as t, jsx as s } from "react/jsx-runtime";
2
+ import { c as _ } from "./bind-06a7ff84.js";
3
+ const c = "_children_vll7q_54", m = {
4
+ "system-message": "_system-message_vll7q_1",
5
+ "stripes-info": "_stripes-info_vll7q_12",
6
+ "stripes-warning": "_stripes-warning_vll7q_17",
7
+ "stripes-error": "_stripes-error_vll7q_22",
8
+ "text-container": "_text-container_vll7q_27",
9
+ "message-header-info": "_message-header-info_vll7q_30",
10
+ "message-header-warning": "_message-header-warning_vll7q_38",
11
+ "message-header-error": "_message-header-error_vll7q_46",
12
+ children: c,
13
+ "content-width": "_content-width_vll7q_70"
14
+ }, e = _.bind(m), h = ({
15
+ header: r,
16
+ caption: a,
17
+ children: i,
18
+ mode: n = "info",
19
+ widthByContent: l = !1
20
+ }) => /* @__PURE__ */ t("div", { className: e("system-message", { "content-width": l }), children: [
21
+ /* @__PURE__ */ s("div", { className: e(`stripes-${n}`) }),
22
+ /* @__PURE__ */ t("div", { className: e("text-container"), children: [
23
+ r && /* @__PURE__ */ s("h1", { className: e(`message-header-${n}`), children: r }),
24
+ /* @__PURE__ */ s("div", { className: e("children"), children: i }),
25
+ a && /* @__PURE__ */ s("p", { children: a })
26
+ ] })
27
+ ] });
28
+ export {
29
+ h as S
30
+ };
@@ -0,0 +1,7 @@
1
+ import { S as e } from "./systemMessage-924fdaa6.js";
2
+ import "react/jsx-runtime";
3
+ import "./bind-06a7ff84.js";
4
+ export {
5
+ e as SystemMessage,
6
+ e as default
7
+ };
@@ -0,0 +1,504 @@
1
+ import { jsx as o, jsxs as x } from "react/jsx-runtime";
2
+ import { useMemo as ee, useState as A, useCallback as C, useEffect as le, useRef as ae } from "react";
3
+ import { c as me } from "./bind-06a7ff84.js";
4
+ import { b as V, a as Z, S as Ne } from "./chevronDownDropdown-66f5b1af.js";
5
+ import { C as R } from "./checkbox-ed6cc375.js";
6
+ import { Tooltip as qe } from "./tooltip.js";
7
+ const P = (l) => typeof l == "string", Ee = "_table_qg65a_1", Me = "_selectable_qg65a_56", $e = "_expanded_qg65a_52", Se = "_label_qg65a_283", Te = {
8
+ table: Ee,
9
+ "fixed-header": "_fixed-header_qg65a_8",
10
+ "horizontally-scrollable-container": "_horizontally-scrollable-container_qg65a_14",
11
+ "table-header": "_table-header_qg65a_19",
12
+ "sticky-header": "_sticky-header_qg65a_26",
13
+ "horizontally-scrollable": "_horizontally-scrollable_qg65a_14",
14
+ "table-row": "_table-row_qg65a_47",
15
+ "expanded-cell": "_expanded-cell_qg65a_52",
16
+ selectable: Me,
17
+ "row-content-wrapper": "_row-content-wrapper_qg65a_60",
18
+ "table-row-content": "_table-row-content_qg65a_68",
19
+ "expand-cell": "_expand-cell_qg65a_82",
20
+ "size-small": "_size-small_qg65a_85",
21
+ "size-large": "_size-large_qg65a_96",
22
+ "table-body": "_table-body_qg65a_108",
23
+ "scrollable-body": "_scrollable-body_qg65a_114",
24
+ "table-header-cell": "_table-header-cell_qg65a_163",
25
+ "table-cell": "_table-cell_qg65a_164",
26
+ "action-menu-cell": "_action-menu-cell_qg65a_170",
27
+ "checkbox-cell": "_checkbox-cell_qg65a_195",
28
+ "expand-all-tooltip-wrapper": "_expand-all-tooltip-wrapper_qg65a_237",
29
+ "expand-all-tooltip-content": "_expand-all-tooltip-content_qg65a_246",
30
+ "expand-icon": "_expand-icon_qg65a_255",
31
+ expanded: $e,
32
+ "primary-cell": "_primary-cell_qg65a_264",
33
+ label: Se,
34
+ "sortable-cell": "_sortable-cell_qg65a_294",
35
+ "align-right": "_align-right_qg65a_297",
36
+ "align-center": "_align-center_qg65a_303",
37
+ "pinned-column": "_pinned-column_qg65a_306"
38
+ }, te = "asc", m = 32, ne = 100, ze = 48, Ae = (l) => l.toLowerCase() === te, Le = (l) => l.map((t) => t.key), w = (l) => "primary" in l && l.primary === !0, We = (l) => {
39
+ var n;
40
+ return `size-${((n = l.rowConfigs) == null ? void 0 : n.size) ?? "default"}`;
41
+ }, Pe = (l, t, n, r, i) => {
42
+ let c = 0;
43
+ r && (c += m), i && (c += m);
44
+ for (let h = 0; h < l; h++) {
45
+ const y = t[h];
46
+ if (w(y)) {
47
+ const a = n.current.get(y.key) || ne;
48
+ c += a;
49
+ } else {
50
+ const a = y, s = P(a.width) ? parseInt(a.width, 10) || 0 : a.width;
51
+ c += s;
52
+ }
53
+ }
54
+ return c;
55
+ }, z = (l, t, n, r, i, c, h) => {
56
+ const y = {};
57
+ if (!w(l)) {
58
+ const a = l;
59
+ y.textAlign = a.align;
60
+ }
61
+ if (t && n !== void 0) {
62
+ const a = Pe(
63
+ n,
64
+ r,
65
+ i,
66
+ c,
67
+ h
68
+ );
69
+ y.left = `${a}px`;
70
+ }
71
+ return y;
72
+ }, F = (l, t, n, r, i, c = !1) => {
73
+ const h = [];
74
+ n && h.push(`${m}px`), c && r && h.push(`${m}px`);
75
+ const y = (a) => {
76
+ if (w(a)) {
77
+ const s = a, p = s.width ? P(s.width) ? s.width : `${s.width}px` : `${ne}px`;
78
+ h.push(`minmax(${p}, 1fr)`);
79
+ } else {
80
+ const s = a, p = P(s.width) ? s.width : `${s.width}px`;
81
+ h.push(p);
82
+ }
83
+ };
84
+ return l.forEach(y), t.forEach(y), i && h.push(`${ze}px`), h.join(" ");
85
+ }, De = ({
86
+ primaryColumns: l,
87
+ fixedColumns: t,
88
+ pinnedColumnKeys: n
89
+ }) => ee(() => {
90
+ const r = [], i = [];
91
+ return l.forEach((c) => {
92
+ const h = { ...c, primary: !0 };
93
+ n.includes(c.key) ? r.push(h) : i.push(h);
94
+ }), t.forEach((c) => {
95
+ n.includes(c.key) ? r.push(c) : i.push(c);
96
+ }), {
97
+ pinnedColumns: r,
98
+ scrollableColumns: i
99
+ };
100
+ }, [l, t, n]), Ue = () => {
101
+ const [l, t] = A(null), [n, r] = A(null), i = C((a) => {
102
+ t(a);
103
+ }, []), c = C(() => {
104
+ t(null);
105
+ }, []), h = C((a) => {
106
+ r(a);
107
+ }, []), y = C(() => {
108
+ r(null);
109
+ }, []);
110
+ return {
111
+ hoveredColumn: l,
112
+ hoveredRow: n,
113
+ handleColumnMouseEnter: i,
114
+ handleColumnMouseLeave: c,
115
+ handleRowMouseEnter: h,
116
+ handleRowMouseLeave: y
117
+ };
118
+ }, Oe = ({
119
+ primaryColumns: l,
120
+ fixedColumns: t,
121
+ expandedRowIds: n,
122
+ onToggleRowExpansion: r
123
+ }) => {
124
+ const [i, c] = A(/* @__PURE__ */ new Set());
125
+ le(() => {
126
+ const a = [
127
+ ...l.map((p) => p.key),
128
+ ...t.map((p) => p.key)
129
+ ], s = /* @__PURE__ */ new Set();
130
+ n.forEach((p) => {
131
+ a.forEach((f) => {
132
+ s.add(`${p}-${f}`);
133
+ });
134
+ }), c((p) => {
135
+ if (p.size === s.size) {
136
+ let f = !0;
137
+ if (p.forEach((u) => {
138
+ s.has(u) || (f = !1);
139
+ }), f)
140
+ return p;
141
+ }
142
+ return s;
143
+ });
144
+ }, [n, l, t]);
145
+ const h = C(
146
+ (a) => {
147
+ const s = new Set(i), p = n.includes(a), f = [
148
+ ...l.map((u) => u.key),
149
+ ...t.map((u) => u.key)
150
+ ];
151
+ p ? f.forEach((u) => {
152
+ const k = `${a}-${u}`;
153
+ s.delete(k);
154
+ }) : f.forEach((u) => {
155
+ const k = `${a}-${u}`;
156
+ s.add(k);
157
+ }), c(s), r(a);
158
+ },
159
+ [i, n, l, t, r]
160
+ ), y = C(
161
+ (a, s) => {
162
+ const p = `${a}-${s}`;
163
+ return i.has(p);
164
+ },
165
+ [i]
166
+ );
167
+ return {
168
+ expandedCells: i,
169
+ handleToggleRowExpansion: h,
170
+ isCellExpanded: y
171
+ };
172
+ }, je = () => {
173
+ const l = ae(/* @__PURE__ */ new Map()), t = C(
174
+ (n) => (r) => {
175
+ if (!r)
176
+ return;
177
+ const i = r.getBoundingClientRect().width;
178
+ i > 0 && l.current.set(n, i);
179
+ },
180
+ []
181
+ );
182
+ return {
183
+ columnWidthsRef: l,
184
+ setCellRef: t
185
+ };
186
+ }, d = me.bind(Te), I = ({ column: l }) => {
187
+ const t = ae(null), [n, r] = A(!1);
188
+ return le(() => {
189
+ if (t.current) {
190
+ const i = t.current.offsetWidth, c = t.current.scrollWidth;
191
+ r(c > i);
192
+ }
193
+ }, [l.header]), /* @__PURE__ */ o("span", { ref: t, title: n ? l.header : void 0, children: l.header });
194
+ }, Je = ({
195
+ data: l,
196
+ primaryColumn: t,
197
+ fixedColumns: n,
198
+ renderRowActions: r,
199
+ className: i = "",
200
+ rowClassName: c = "",
201
+ headerClassName: h = "",
202
+ bodyClassName: y = "",
203
+ selectable: a = !1,
204
+ selectedRowIds: s = [],
205
+ sortingDirection: p = te,
206
+ sortingColumn: f,
207
+ sortableColumns: u,
208
+ isHeaderFixed: k = !1,
209
+ isHorizontallyScrollable: L = !1,
210
+ pinnedColumnKeys: se = [],
211
+ isRowsExpandable: g = !1,
212
+ expandedRowIds: N = [],
213
+ isAllExpandedByDefault: D,
214
+ expandAllTooltip: U,
215
+ onChangeSorting: oe = () => {
216
+ },
217
+ onToggleRowSelection: re = () => {
218
+ },
219
+ onToggleAllRowsSelection: ce = () => {
220
+ },
221
+ onToggleRowExpansion: ie = () => {
222
+ },
223
+ onToggleAllRowsExpansion: de = () => {
224
+ }
225
+ }) => {
226
+ const q = ee(
227
+ () => Array.isArray(t) ? t : [t],
228
+ [t]
229
+ ), b = f ?? q[0], E = u ?? Le([...q, ...n]), { pinnedColumns: v, scrollableColumns: M } = De({
230
+ primaryColumns: q,
231
+ fixedColumns: n,
232
+ pinnedColumnKeys: se
233
+ }), {
234
+ hoveredColumn: O,
235
+ hoveredRow: he,
236
+ handleColumnMouseEnter: j,
237
+ handleColumnMouseLeave: B,
238
+ handleRowMouseEnter: pe,
239
+ handleRowMouseLeave: _e
240
+ } = Ue(), { columnWidthsRef: $, setCellRef: H } = je(), { handleToggleRowExpansion: ye, isCellExpanded: G } = Oe({
241
+ primaryColumns: q,
242
+ fixedColumns: n,
243
+ expandedRowIds: N,
244
+ onToggleRowExpansion: ie
245
+ }), X = (e) => {
246
+ E.includes(e) && oe({ key: e, direction: p });
247
+ }, ue = (e) => {
248
+ re(e);
249
+ }, ge = () => {
250
+ ce();
251
+ }, fe = () => {
252
+ de();
253
+ }, K = (e) => E.includes(e) ? (b == null ? void 0 : b.key) === e ? Ae(p) ? /* @__PURE__ */ o(Z, {}) : /* @__PURE__ */ o(Ne, {}) : /* @__PURE__ */ o(Z, {}) : null, be = l.every((e) => s.includes(e.id)), ke = l.some((e) => s.includes(e.id)), Y = (s == null ? void 0 : s.length) > 0, ve = l.every((e) => N.includes(e.id)), Ce = D !== void 0 ? D : ve, we = F(
254
+ v,
255
+ M,
256
+ g,
257
+ a,
258
+ !!r,
259
+ !1
260
+ ), xe = F(
261
+ v,
262
+ M,
263
+ g,
264
+ a,
265
+ !!r,
266
+ !0
267
+ ), J = /* @__PURE__ */ o("button", { onClick: fe, "aria-label": "Toggle all rows expansion", children: /* @__PURE__ */ o("span", { className: d("expand-icon", { expanded: Ce }), children: /* @__PURE__ */ o(V, {}) }) });
268
+ return /* @__PURE__ */ x(
269
+ "div",
270
+ {
271
+ className: d(
272
+ "table",
273
+ {
274
+ "fixed-header": k,
275
+ "horizontally-scrollable-container": k && L
276
+ },
277
+ i
278
+ ),
279
+ children: [
280
+ /* @__PURE__ */ x(
281
+ "div",
282
+ {
283
+ className: d(
284
+ "table-header",
285
+ {
286
+ "sticky-header": k,
287
+ "horizontally-scrollable": L
288
+ },
289
+ h
290
+ ),
291
+ style: { gridTemplateColumns: xe },
292
+ children: [
293
+ a && /* @__PURE__ */ o(
294
+ "div",
295
+ {
296
+ className: d("table-header-cell", "checkbox-cell"),
297
+ style: { left: g ? `${m}px` : "0" },
298
+ children: Y && /* @__PURE__ */ o(
299
+ R,
300
+ {
301
+ value: be,
302
+ partiallyChecked: ke,
303
+ onChange: ge,
304
+ className: d("checkbox-cell")
305
+ }
306
+ )
307
+ }
308
+ ),
309
+ g && /* @__PURE__ */ o("div", { className: d("table-header-cell", "expand-cell"), style: { left: "0" }, children: U ? /* @__PURE__ */ o(
310
+ qe,
311
+ {
312
+ content: U,
313
+ placement: "top",
314
+ wrapperClassName: d("expand-all-tooltip-wrapper"),
315
+ contentClassName: d("expand-all-tooltip-content"),
316
+ children: J
317
+ }
318
+ ) : J }),
319
+ v.map((e, S) => /* @__PURE__ */ o(
320
+ "button",
321
+ {
322
+ className: d("table-header-cell", "pinned-column", {
323
+ [`align-${e.align}`]: "align" in e,
324
+ "primary-cell": w(e),
325
+ "sortable-cell": E.includes(e.key)
326
+ }),
327
+ style: z(
328
+ e,
329
+ !0,
330
+ S,
331
+ v,
332
+ $,
333
+ g,
334
+ a
335
+ ),
336
+ children: /* @__PURE__ */ x(
337
+ "div",
338
+ {
339
+ className: d("label"),
340
+ onClick: () => X(e.key),
341
+ onMouseEnter: () => j(e.key),
342
+ onMouseLeave: B,
343
+ children: [
344
+ /* @__PURE__ */ o(I, { column: e }),
345
+ (O === e.key || (b == null ? void 0 : b.key) === e.key) && K(e.key)
346
+ ]
347
+ }
348
+ )
349
+ },
350
+ e.key
351
+ )),
352
+ M.map((e) => /* @__PURE__ */ o(
353
+ "button",
354
+ {
355
+ className: d("table-header-cell", {
356
+ [`align-${e.align}`]: "align" in e,
357
+ "primary-cell": w(e),
358
+ "sortable-cell": E.includes(e.key)
359
+ }),
360
+ style: z(
361
+ e,
362
+ !1,
363
+ void 0,
364
+ v,
365
+ $,
366
+ g,
367
+ a
368
+ ),
369
+ children: /* @__PURE__ */ x(
370
+ "div",
371
+ {
372
+ className: d("label"),
373
+ onClick: () => X(e.key),
374
+ onMouseEnter: () => j(e.key),
375
+ onMouseLeave: B,
376
+ children: [
377
+ /* @__PURE__ */ o(I, { column: e }),
378
+ (O === e.key || (b == null ? void 0 : b.key) === e.key) && K(e.key)
379
+ ]
380
+ }
381
+ )
382
+ },
383
+ e.key
384
+ )),
385
+ r && /* @__PURE__ */ o("div", { className: d("table-header-cell", "action-menu-cell") })
386
+ ]
387
+ }
388
+ ),
389
+ /* @__PURE__ */ o(
390
+ "div",
391
+ {
392
+ className: d(
393
+ "table-body",
394
+ {
395
+ "scrollable-body": k,
396
+ "horizontally-scrollable": L
397
+ },
398
+ y
399
+ ),
400
+ children: l.map((e, S) => /* @__PURE__ */ x(
401
+ "div",
402
+ {
403
+ className: d("table-row", We(e), c, {
404
+ selectable: a
405
+ }),
406
+ onMouseEnter: () => pe(S),
407
+ onMouseLeave: _e,
408
+ children: [
409
+ a && /* @__PURE__ */ o(
410
+ "div",
411
+ {
412
+ className: d("table-cell", "checkbox-cell"),
413
+ style: { left: g ? `${m}px` : "0" },
414
+ children: (Y || he === S) && /* @__PURE__ */ o(
415
+ R,
416
+ {
417
+ value: s.includes(e.id),
418
+ onChange: () => ue(e.id),
419
+ className: d("checkbox-cell")
420
+ }
421
+ )
422
+ }
423
+ ),
424
+ /* @__PURE__ */ o("div", { className: d("row-content-wrapper"), children: /* @__PURE__ */ x("div", { className: d("table-row-content"), style: { gridTemplateColumns: we }, children: [
425
+ g && /* @__PURE__ */ o("div", { className: d("table-cell", "expand-cell"), style: { left: "0" }, children: /* @__PURE__ */ o(
426
+ "button",
427
+ {
428
+ onClick: () => ye(e.id),
429
+ "aria-label": N.includes(e.id) ? "Collapse row" : "Expand row",
430
+ "aria-expanded": N.includes(e.id),
431
+ children: /* @__PURE__ */ o(
432
+ "span",
433
+ {
434
+ className: d("expand-icon", {
435
+ expanded: N.includes(e.id)
436
+ }),
437
+ children: /* @__PURE__ */ o(V, {})
438
+ }
439
+ )
440
+ }
441
+ ) }),
442
+ v.map((_, W) => {
443
+ const T = G(e.id, _.key), Q = w(_);
444
+ return /* @__PURE__ */ o(
445
+ "div",
446
+ {
447
+ ref: Q ? H(_.key) : void 0,
448
+ className: d("table-cell", "pinned-column", {
449
+ "primary-cell": Q,
450
+ "expanded-cell": T
451
+ }),
452
+ style: z(
453
+ _,
454
+ !0,
455
+ W,
456
+ v,
457
+ $,
458
+ g,
459
+ a
460
+ ),
461
+ children: e[_.key].component || e[_.key].content || e[_.key]
462
+ },
463
+ _.key
464
+ );
465
+ }),
466
+ M.map((_) => {
467
+ const W = G(e.id, _.key), T = w(_);
468
+ return /* @__PURE__ */ o(
469
+ "div",
470
+ {
471
+ ref: T ? H(_.key) : void 0,
472
+ className: d("table-cell", {
473
+ "primary-cell": T,
474
+ "expanded-cell": W
475
+ }),
476
+ style: z(
477
+ _,
478
+ !1,
479
+ void 0,
480
+ v,
481
+ $,
482
+ g,
483
+ a
484
+ ),
485
+ children: e[_.key].component || e[_.key].content || e[_.key]
486
+ },
487
+ _.key
488
+ );
489
+ }),
490
+ r && /* @__PURE__ */ o("div", { className: d("table-cell", "action-menu-cell"), children: r(e.metaData) })
491
+ ] }) })
492
+ ]
493
+ },
494
+ e.id
495
+ ))
496
+ }
497
+ )
498
+ ]
499
+ }
500
+ );
501
+ };
502
+ export {
503
+ Je as T
504
+ };
package/dist/table.js ADDED
@@ -0,0 +1,15 @@
1
+ import { T as r } from "./table-c172f35e.js";
2
+ import "react/jsx-runtime";
3
+ import "react";
4
+ import "./bind-06a7ff84.js";
5
+ import "./chevronDownDropdown-66f5b1af.js";
6
+ import "./checkbox-ed6cc375.js";
7
+ import "./keyCodes-f63c0e11.js";
8
+ import "./tooltip.js";
9
+ import "react-dom";
10
+ import "@floating-ui/react";
11
+ import "./floatingUi-41f8c7b5.js";
12
+ export {
13
+ r as Table,
14
+ r as default
15
+ };
@@ -0,0 +1,23 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { c as h } from "./bind-06a7ff84.js";
3
+ const n = {
4
+ "theme-provider": "_theme-provider_xipmx_1"
5
+ }, c = h.bind(n), e = {
6
+ light: "rp-ui-kit-theme-light",
7
+ dark: "rp-ui-kit-theme-dark"
8
+ };
9
+ function p({
10
+ children: t,
11
+ theme: i = "light",
12
+ customThemes: r = {},
13
+ className: s
14
+ }) {
15
+ const m = {
16
+ ...e,
17
+ ...r
18
+ }[i] || e.light;
19
+ return /* @__PURE__ */ o("div", { className: c("theme-provider", s, m), children: t });
20
+ }
21
+ export {
22
+ p as T
23
+ };
@@ -0,0 +1,7 @@
1
+ import { T as o } from "./themeProvider-46c2be7b.js";
2
+ import "react/jsx-runtime";
3
+ import "./bind-06a7ff84.js";
4
+ export {
5
+ o as ThemeProvider,
6
+ o as default
7
+ };