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

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.
@@ -2,12 +2,13 @@ import { jsx as h, jsxs as F, Fragment as zt } from "react/jsx-runtime";
2
2
  import { useMemo as de, useState as B, useCallback as x, useEffect as P, useRef as H, useLayoutEffect as et, forwardRef as xt } from "react";
3
3
  import { Resizable as At } from "react-resizable";
4
4
  import { c as me } from "./bind-06a7ff84.js";
5
- import { c as $t, b as Ye, a as Je, S as Mt } from "./resizeColumn-d4107941.js";
5
+ import { b as $t, a as Ye, S as Mt } from "./resizeColumn-46b5b30f.js";
6
+ import { S as Je } from "./chevronDownDropdown-0260bb66.js";
6
7
  import { C as ie } from "./checkbox-493fdc63.js";
7
8
  import { Tooltip as Ht } from "./tooltip.js";
8
9
  import { createPortal as Wt } from "react-dom";
9
10
  import { i as Pt } from "./isEmpty-ccacb5ff.js";
10
- const tt = (t) => typeof t == "string", Bt = "_table_1rtld_1", Gt = "_resizable_1rtld_67", St = "_selectable_1rtld_84", Ft = "_expanded_1rtld_80", qt = "_label_1rtld_353", Ut = {
11
+ const tt = (t) => typeof t == "string", Bt = "_table_1rtld_1", St = "_resizable_1rtld_67", Gt = "_selectable_1rtld_84", Ft = "_expanded_1rtld_80", qt = "_label_1rtld_353", Ut = {
11
12
  table: Bt,
12
13
  "fixed-header": "_fixed-header_1rtld_10",
13
14
  "external-scroll-container": "_external-scroll-container_1rtld_14",
@@ -16,11 +17,11 @@ const tt = (t) => typeof t == "string", Bt = "_table_1rtld_1", Gt = "_resizable_
16
17
  "sticky-header": "_sticky-header_1rtld_34",
17
18
  "pinned-header": "_pinned-header_1rtld_44",
18
19
  "horizontally-scrollable": "_horizontally-scrollable_1rtld_21",
19
- resizable: Gt,
20
+ resizable: St,
20
21
  "resizable-column": "_resizable-column_1rtld_67",
21
22
  "table-row": "_table-row_1rtld_75",
22
23
  "expanded-cell": "_expanded-cell_1rtld_80",
23
- selectable: St,
24
+ selectable: Gt,
24
25
  "row-content-wrapper": "_row-content-wrapper_1rtld_88",
25
26
  "pinned-column": "_pinned-column_1rtld_96",
26
27
  "has-scroll": "_has-scroll_1rtld_96",
@@ -260,7 +261,7 @@ const tt = (t) => typeof t == "string", Bt = "_table_1rtld_1", Gt = "_resizable_
260
261
  );
261
262
  let k;
262
263
  i && o && _ ? k = _.top - n.top + c : k = c;
263
- const z = n.top + k, G = t.scrollWidth > t.clientWidth ? t.offsetHeight - t.clientHeight : 0, N = v - z - G, q = t.scrollHeight > t.clientHeight ? t.offsetWidth - t.clientWidth : 0, j = n.right - we - q;
264
+ const z = n.top + k, S = t.scrollWidth > t.clientWidth ? t.offsetHeight - t.clientHeight : 0, N = v - z - S, q = t.scrollHeight > t.clientHeight ? t.offsetWidth - t.clientWidth : 0, j = n.right - we - q;
264
265
  return {
265
266
  visible: !0,
266
267
  position: {
@@ -328,12 +329,12 @@ const tt = (t) => typeof t == "string", Bt = "_table_1rtld_1", Gt = "_resizable_
328
329
  position: { top: 0, left: 0 },
329
330
  size: { width: 0, height: 0 }
330
331
  };
331
- const k = v.getBoundingClientRect(), z = t.getBoundingClientRect(), E = (o == null ? void 0 : o.offsetHeight) || 0, G = i == null ? void 0 : i.getBoundingClientRect(), N = k.right, M = Math.min(
332
+ const k = v.getBoundingClientRect(), z = t.getBoundingClientRect(), E = (o == null ? void 0 : o.offsetHeight) || 0, S = i == null ? void 0 : i.getBoundingClientRect(), N = k.right, M = Math.min(
332
333
  z.bottom,
333
- (G == null ? void 0 : G.bottom) || Number.MAX_SAFE_INTEGER
334
+ (S == null ? void 0 : S.bottom) || Number.MAX_SAFE_INTEGER
334
335
  );
335
336
  let q;
336
- d && i && G ? q = G.top - z.top + E : q = E;
337
+ d && i && S ? q = S.top - z.top + E : q = E;
337
338
  const j = z.top + q, Y = t.scrollWidth > t.clientWidth ? t.offsetHeight - t.clientHeight : 0, O = M - j - Y;
338
339
  return {
339
340
  visible: !0,
@@ -434,7 +435,7 @@ const tt = (t) => typeof t == "string", Bt = "_table_1rtld_1", Gt = "_resizable_
434
435
  i(u > d);
435
436
  }
436
437
  }, [t.header]), /* @__PURE__ */ h("span", { ref: l, title: o ? t.header : void 0, children: t.header });
437
- }, _n = ({
438
+ }, gn = ({
438
439
  data: t,
439
440
  primaryColumn: l,
440
441
  fixedColumns: o,
@@ -451,7 +452,7 @@ const tt = (t) => typeof t == "string", Bt = "_table_1rtld_1", Gt = "_resizable_
451
452
  sortableColumns: k,
452
453
  isHeaderFixed: z = !1,
453
454
  isHorizontallyScrollable: E = !1,
454
- pinnedColumnKeys: G = [],
455
+ pinnedColumnKeys: S = [],
455
456
  isRowsExpandable: N = !1,
456
457
  expandedRowIds: M = [],
457
458
  isAllExpandedByDefault: q,
@@ -481,10 +482,10 @@ const tt = (t) => typeof t == "string", Bt = "_table_1rtld_1", Gt = "_resizable_
481
482
  const ee = de(
482
483
  () => Array.isArray(l) ? l : [l],
483
484
  [l]
484
- ), S = v ?? ee[0], te = k ?? jt([...ee, ...o]), { pinnedColumns: U, scrollableColumns: ne } = Rt({
485
+ ), G = v ?? ee[0], te = k ?? jt([...ee, ...o]), { pinnedColumns: U, scrollableColumns: ne } = Rt({
485
486
  primaryColumns: ee,
486
487
  fixedColumns: o,
487
- pinnedColumnKeys: G
488
+ pinnedColumnKeys: S
488
489
  }), {
489
490
  hoveredColumn: Ee,
490
491
  hoveredRow: Te,
@@ -531,7 +532,7 @@ const tt = (t) => typeof t == "string", Bt = "_table_1rtld_1", Gt = "_resizable_
531
532
  return;
532
533
  const g = window.getComputedStyle(r), w = parseFloat(g.paddingTop) || 0, m = parseFloat(g.paddingBottom) || 0, W = e.offsetHeight + w + m;
533
534
  e.style.setProperty("--expand-cell-top", `${w}px`), e.style.setProperty("--expand-cell-height", `${W}px`);
534
- }, []), [He, pe] = B(0), [We, ue] = B(0), [Pe, fe] = B(0), [Be, Ge] = B(0), oe = H(!1), _e = H(/* @__PURE__ */ new Set()), K = H(null), ge = Qt(
535
+ }, []), [He, pe] = B(0), [We, ue] = B(0), [Pe, fe] = B(0), [Be, Se] = B(0), oe = H(!1), _e = H(/* @__PURE__ */ new Set()), K = H(null), ge = Qt(
535
536
  T.current,
536
537
  D.current,
537
538
  (y == null ? void 0 : y.current) instanceof HTMLElement ? y.current : null,
@@ -549,7 +550,7 @@ const tt = (t) => typeof t == "string", Bt = "_table_1rtld_1", Gt = "_resizable_
549
550
  We,
550
551
  Pe,
551
552
  Be
552
- ), Se = (e) => {
553
+ ), Ge = (e) => {
553
554
  te.includes(e) && st({ key: e, direction: _ });
554
555
  }, Fe = (e) => {
555
556
  ot(e);
@@ -557,7 +558,7 @@ const tt = (t) => typeof t == "string", Bt = "_table_1rtld_1", Gt = "_resizable_
557
558
  ct();
558
559
  }, wt = () => {
559
560
  it();
560
- }, Ue = (e) => te.includes(e) ? (S == null ? void 0 : S.key) === e ? Xt(_) ? /* @__PURE__ */ h(Je, {}) : /* @__PURE__ */ h(Mt, {}) : /* @__PURE__ */ h(Je, {}) : null, De = t.every((e) => c.includes(e.id)), Xe = t.some((e) => c.includes(e.id)), be = (c == null ? void 0 : c.length) > 0, mt = !Pt(t), je = J && mt || be, kt = t.every((e) => M.includes(e.id)), Et = q !== void 0 ? q : kt, Tt = Ze(
561
+ }, Ue = (e) => te.includes(e) ? (G == null ? void 0 : G.key) === e ? Xt(_) ? /* @__PURE__ */ h(Ye, {}) : /* @__PURE__ */ h(Mt, {}) : /* @__PURE__ */ h(Ye, {}) : null, De = t.every((e) => c.includes(e.id)), Xe = t.some((e) => c.includes(e.id)), be = (c == null ? void 0 : c.length) > 0, mt = !Pt(t), je = J && mt || be, kt = t.every((e) => M.includes(e.id)), Et = q !== void 0 ? q : kt, Tt = Ze(
561
562
  U,
562
563
  ne,
563
564
  N,
@@ -577,7 +578,7 @@ const tt = (t) => typeof t == "string", Bt = "_table_1rtld_1", Gt = "_resizable_
577
578
  $ ? re : void 0,
578
579
  $,
579
580
  L
580
- ), Ie = /* @__PURE__ */ h("button", { onClick: wt, "aria-label": "Toggle all rows expansion", children: /* @__PURE__ */ h("span", { className: f("expand-icon", { expanded: Et }), children: /* @__PURE__ */ h(Ye, {}) }) });
581
+ ), Ie = /* @__PURE__ */ h("button", { onClick: wt, "aria-label": "Toggle all rows expansion", children: /* @__PURE__ */ h("span", { className: f("expand-icon", { expanded: Et }), children: /* @__PURE__ */ h(Je, {}) }) });
581
582
  P(() => {
582
583
  if (!(y != null && y.current) || !T.current || !D.current)
583
584
  return;
@@ -640,7 +641,7 @@ const tt = (t) => typeof t == "string", Bt = "_table_1rtld_1", Gt = "_resizable_
640
641
  passive: !0
641
642
  });
642
643
  const W = () => {
643
- r(), Ge((X) => X + 1);
644
+ r(), Se((X) => X + 1);
644
645
  };
645
646
  window.addEventListener("resize", W), K.current = r, r();
646
647
  const R = new ResizeObserver(() => {
@@ -683,7 +684,7 @@ const tt = (t) => typeof t == "string", Bt = "_table_1rtld_1", Gt = "_resizable_
683
684
  `[data-base-left="0"][data-row-id="${m}"]`
684
685
  );
685
686
  A && se(A);
686
- }), Ge((m) => m + 1);
687
+ }), Se((m) => m + 1);
687
688
  }, 0);
688
689
  return _e.current = s, () => clearTimeout(w);
689
690
  }, [N, M, se]), P(() => {
@@ -838,12 +839,12 @@ const tt = (t) => typeof t == "string", Bt = "_table_1rtld_1", Gt = "_resizable_
838
839
  "div",
839
840
  {
840
841
  className: f("label"),
841
- onClick: () => Se(e.key),
842
+ onClick: () => Ge(e.key),
842
843
  onMouseEnter: () => Le(e.key),
843
844
  onMouseLeave: Ne,
844
845
  children: [
845
846
  /* @__PURE__ */ h(Oe, { column: e }),
846
- (Ee === e.key || (S == null ? void 0 : S.key) === e.key) && Ue(e.key)
847
+ (Ee === e.key || (G == null ? void 0 : G.key) === e.key) && Ue(e.key)
847
848
  ]
848
849
  }
849
850
  )
@@ -876,12 +877,12 @@ const tt = (t) => typeof t == "string", Bt = "_table_1rtld_1", Gt = "_resizable_
876
877
  "div",
877
878
  {
878
879
  className: f("label"),
879
- onClick: () => Se(e.key),
880
+ onClick: () => Ge(e.key),
880
881
  onMouseEnter: () => Le(e.key),
881
882
  onMouseLeave: Ne,
882
883
  children: [
883
884
  /* @__PURE__ */ h(Oe, { column: e }),
884
- (Ee === e.key || (S == null ? void 0 : S.key) === e.key) && Ue(e.key)
885
+ (Ee === e.key || (G == null ? void 0 : G.key) === e.key) && Ue(e.key)
885
886
  ]
886
887
  }
887
888
  )
@@ -952,7 +953,7 @@ const tt = (t) => typeof t == "string", Bt = "_table_1rtld_1", Gt = "_resizable_
952
953
  className: f("expand-icon", {
953
954
  expanded: M.includes(e.id)
954
955
  }),
955
- children: /* @__PURE__ */ h(Ye, {})
956
+ children: /* @__PURE__ */ h(Je, {})
956
957
  }
957
958
  )
958
959
  }
@@ -1054,5 +1055,5 @@ const tt = (t) => typeof t == "string", Bt = "_table_1rtld_1", Gt = "_resizable_
1054
1055
  ] }) : Re();
1055
1056
  };
1056
1057
  export {
1057
- _n as T
1058
+ gn as T
1058
1059
  };
package/dist/table.js CHANGED
@@ -1,9 +1,10 @@
1
- import { T as r } from "./table-09b572b3.js";
1
+ import { T as r } from "./table-0adbac16.js";
2
2
  import "react/jsx-runtime";
3
3
  import "react";
4
4
  import "react-resizable";
5
5
  import "./bind-06a7ff84.js";
6
- import "./resizeColumn-d4107941.js";
6
+ import "./resizeColumn-46b5b30f.js";
7
+ import "./chevronDownDropdown-0260bb66.js";
7
8
  import "./checkbox-493fdc63.js";
8
9
  import "./keyCodes-f63c0e11.js";
9
10
  import "./tooltip.js";
@@ -0,0 +1,25 @@
1
+ import { useRef as m, useEffect as d } from "react";
2
+ function p(e, t, n) {
3
+ const s = m(n);
4
+ d(() => {
5
+ s.current = n;
6
+ }, [n]), d(() => {
7
+ if (!t)
8
+ return;
9
+ const c = (o) => {
10
+ var u, i;
11
+ if (e && e.current && !e.current.contains(o.target)) {
12
+ const r = o.target;
13
+ ((i = (u = s.current) == null ? void 0 : u.ignoreSelectors) == null ? void 0 : i.some(
14
+ (f) => r == null ? void 0 : r.closest(f)
15
+ )) || t(o);
16
+ }
17
+ };
18
+ return document.addEventListener("pointerdown", c), () => {
19
+ document.removeEventListener("pointerdown", c);
20
+ };
21
+ }, [e, t]);
22
+ }
23
+ export {
24
+ p as u
25
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reportportal/ui-kit",
3
- "version": "0.0.1-alpha.159",
3
+ "version": "0.0.1-alpha.160",
4
4
  "description": "The UI-kit library for ReportPortal Design System.",
5
5
  "type": "module",
6
6
  "scripts": {