@reportportal/ui-kit 0.0.1-alpha.153 → 0.0.1-alpha.155

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.
@@ -20,5 +20,5 @@ export interface PinnedGradientPosition {
20
20
  height: number;
21
21
  };
22
22
  }
23
- export declare const useRightGradientPosition: (table: HTMLElement | null, header: HTMLElement | null, scrollContainer: HTMLElement | null, isHeaderPinned: boolean, scrollLeft: number, scrollTop: number, tableScrollWidth: number, windowResizeCounter: number) => RightGradientPosition;
24
- export declare const usePinnedGradientPosition: (table: HTMLElement | null, scrollLeft: number, header: HTMLElement | null, scrollContainer: HTMLElement | null, isHeaderPinned: boolean, scrollTop: number, tableScrollWidth: number, windowResizeCounter: number) => PinnedGradientPosition;
23
+ export declare const useRightGradientPosition: (table: HTMLElement | null, header: HTMLElement | null, scrollContainer: HTMLElement | null, isHeaderPinned: boolean, scrollLeft: number, scrollTop: number, tableScrollWidth: number, gradientUpdateCounter: number) => RightGradientPosition;
24
+ export declare const usePinnedGradientPosition: (table: HTMLElement | null, scrollLeft: number, header: HTMLElement | null, scrollContainer: HTMLElement | null, isHeaderPinned: boolean, scrollTop: number, tableScrollWidth: number, gradientUpdateCounter: number) => PinnedGradientPosition;
package/dist/index.js CHANGED
@@ -26,7 +26,7 @@ import { S as uo } from "./spinLoader-c4a53718.js";
26
26
  import { SystemAlert as Co } from "./systemAlert.js";
27
27
  import { S as go } from "./systemMessage-924fdaa6.js";
28
28
  import { DragLayer as Do, SortableItem as bo, SortableList as yo } from "./sortable.js";
29
- import { T as ho } from "./table-65ae1c11.js";
29
+ import { T as ho } from "./table-1aaae76c.js";
30
30
  import { T as Bo } from "./themeProvider-46c2be7b.js";
31
31
  import { T as Mo } from "./toggle-304107fa.js";
32
32
  import { Tooltip as wo } from "./tooltip.js";
package/dist/sortable.js CHANGED
@@ -1,188 +1,187 @@
1
1
  import { jsx as R } from "react/jsx-runtime";
2
2
  import { c as N } from "./bind-06a7ff84.js";
3
- import { useRef as w, useState as F, useEffect as k, useCallback as x } from "react";
4
- import { useDrag as $, useDrop as H, useDragLayer as Y } from "react-dnd";
5
- import { getEmptyImage as z } from "react-dnd-html5-backend";
6
- import { DROP_POSITIONS as g, DROP_DETECTION_MODE as E } from "./common.js";
7
- import { createPortal as V } from "react-dom";
3
+ import { useRef as k, useState as Z, useEffect as w, useCallback as x } from "react";
4
+ import { useDrag as F, useDrop as Y, useDragLayer as $ } from "react-dnd";
5
+ import { getEmptyImage as V } from "react-dnd-html5-backend";
6
+ import { DROP_POSITIONS as u, DROP_DETECTION_MODE as E } from "./common.js";
7
+ import { createPortal as z } from "react-dom";
8
8
  const I = "SORTABLE_ITEM", X = (e) => {
9
9
  if (!e)
10
10
  return {
11
11
  display: "none"
12
12
  };
13
- const { x: t, y: r } = e, l = `translate(${t}px, ${r}px)`;
13
+ const { x: t, y: o } = e, a = `translate(${t}px, ${o}px)`;
14
14
  return {
15
- transform: l,
16
- WebkitTransform: l
15
+ transform: a,
16
+ WebkitTransform: a
17
17
  };
18
18
  }, U = ({
19
19
  fromIndex: e,
20
20
  targetIndex: t,
21
- isTopZone: r
22
- }) => r ? e < t ? t - 1 : t : e > t ? t + 1 : t, W = (e, t) => {
23
- const r = e / t;
24
- return r < 0.05 || r > 0.95 ? null : r < 0.5 ? g.TOP : g.BOTTOM;
25
- }, q = ({
21
+ isTopZone: o
22
+ }) => o ? e < t ? t - 1 : t : e > t ? t + 1 : t, W = (e, t) => e / t < 0.5 ? u.TOP : u.BOTTOM, q = ({
26
23
  id: e,
27
24
  index: t,
28
- type: r = I,
29
- isDisabled: l = !1,
30
- isLast: p = !1,
31
- onDrop: a,
32
- hideDefaultPreview: d = !1,
33
- dropDetectionMode: m = E.INDEX_BASED
25
+ type: o = I,
26
+ isDisabled: a = !1,
27
+ isLast: m = !1,
28
+ onDrop: c,
29
+ hideDefaultPreview: p = !1,
30
+ dropDetectionMode: d = E.INDEX_BASED
34
31
  }) => {
35
- const i = m === E.HOVER, c = w(null), n = w(null), [u, o] = F(null), [{ isDragging: O }, P, _] = $(
32
+ const i = d === E.HOVER, l = k(null), r = k(null), [g, n] = Z(null), [{ isDragging: _ }, P, T] = F(
36
33
  () => ({
37
- type: r,
38
- item: { id: e, index: t, type: r },
34
+ type: o,
35
+ item: { id: e, index: t, type: o },
39
36
  collect: (s) => ({
40
37
  isDragging: s.isDragging()
41
38
  }),
42
- canDrag: () => !l
39
+ canDrag: () => !a
43
40
  }),
44
- [e, t, r, l]
41
+ [e, t, o, a]
45
42
  );
46
- k(() => {
47
- d && _(z(), { captureDraggingState: !0 });
48
- }, [d, _]);
49
- const [{ isOver: b, draggedItemIndex: T }, B] = H(
43
+ w(() => {
44
+ p && T(V(), { captureDraggingState: !0 });
45
+ }, [p, T]);
46
+ const [{ isOver: v, draggedItemIndex: D }, B] = Y(
50
47
  () => ({
51
- accept: r,
48
+ accept: o,
52
49
  collect: (s) => {
53
- const f = s.getItem(), D = (f == null ? void 0 : f.id) !== e ? s.isOver() : !1;
50
+ const f = s.getItem(), O = (f == null ? void 0 : f.id) !== e ? s.isOver() : !1;
54
51
  return {
55
- isOver: D,
56
- draggedItemIndex: D ? (f == null ? void 0 : f.index) ?? null : null
52
+ isOver: O,
53
+ draggedItemIndex: O ? (f == null ? void 0 : f.index) ?? null : null
57
54
  };
58
55
  },
59
56
  hover: (s, f) => {
60
57
  if (!i)
61
58
  return;
62
59
  if (s.id === e) {
63
- o(null);
60
+ n(null);
64
61
  return;
65
62
  }
66
- const v = c.current;
67
- if (!v) {
68
- o(null);
63
+ const y = l.current;
64
+ if (!y) {
65
+ n(null);
69
66
  return;
70
67
  }
71
- const D = v.getBoundingClientRect(), A = D.bottom - D.top, h = f.getClientOffset();
72
- if (!h) {
73
- o(null);
68
+ const O = y.getBoundingClientRect(), A = O.bottom - O.top, S = f.getClientOffset();
69
+ if (!S) {
70
+ n(null);
74
71
  return;
75
72
  }
76
- const Z = h.y - D.top, C = W(Z, A);
77
- C === null ? (o(null), n.current = null) : C === g.TOP ? (o(g.TOP), n.current = g.TOP) : (o(g.BOTTOM), n.current = g.BOTTOM);
73
+ const H = S.y - O.top, C = W(H, A);
74
+ C === null ? (n(null), r.current = null) : C === u.TOP ? (n(u.TOP), r.current = u.TOP) : (n(u.BOTTOM), r.current = u.BOTTOM);
78
75
  },
79
76
  drop: (s) => {
80
- if (!(s.id === e || !a))
77
+ if (!(s.id === e || !c))
81
78
  if (i) {
82
- const f = n.current;
79
+ const f = r.current;
83
80
  if (!f)
84
81
  return;
85
- const v = f === g.TOP, D = U({
82
+ const y = f === u.TOP, O = U({
86
83
  fromIndex: s.index,
87
84
  targetIndex: t,
88
- isTopZone: v
85
+ isTopZone: y
89
86
  });
90
- a(s.index, D);
87
+ c(s.index, O);
91
88
  } else
92
- a(s.index, t);
89
+ c(s.index, t);
93
90
  }
94
91
  }),
95
- [e, t, r, a, p, i]
96
- ), S = x(
97
- (s) => (c.current = s, B(s)),
92
+ [e, t, o, c, m, i]
93
+ ), h = x(
94
+ (s) => (l.current = s, B(s)),
98
95
  [B]
99
96
  );
100
- k(() => {
101
- b || o(null);
102
- }, [b]);
103
- const L = i ? u : (() => T === null ? null : T > t ? g.TOP : g.BOTTOM)();
97
+ w(() => {
98
+ v || n(null);
99
+ }, [v]);
100
+ const b = i ? g : (() => D === null ? null : D > t ? u.TOP : u.BOTTOM)();
104
101
  return {
105
- isDragging: O,
106
- isOver: b,
107
- draggedItemIndex: T,
108
- dropPosition: L,
102
+ isDragging: _,
103
+ isOver: v,
104
+ draggedItemIndex: D,
105
+ dropPosition: b,
109
106
  dragRef: P,
110
- dropRef: S,
111
- previewRef: _
107
+ dropRef: h,
108
+ previewRef: T
112
109
  };
113
110
  }, G = {
114
- "sortable-item": "_sortable-item_l234k_1",
115
- "sortable-item--drop-target-top": "_sortable-item--drop-target-top_l234k_7",
116
- "sortable-item--drop-target-bottom": "_sortable-item--drop-target-bottom_l234k_20",
117
- "drag-handle": "_drag-handle_l234k_34",
118
- "drag-handle--disabled": "_drag-handle--disabled_l234k_41"
111
+ "sortable-item": "_sortable-item_k6uy6_1",
112
+ "sortable-item--drop-target-top": "_sortable-item--drop-target-top_k6uy6_7",
113
+ "sortable-item--drop-target-bottom": "_sortable-item--drop-target-bottom_k6uy6_20",
114
+ "sortable-item--hover-mode": "_sortable-item--hover-mode_k6uy6_33",
115
+ "drag-handle": "_drag-handle_k6uy6_50",
116
+ "drag-handle--disabled": "_drag-handle--disabled_k6uy6_57"
119
117
  }, J = N.bind(G), K = ({
120
118
  id: e,
121
119
  index: t,
122
- type: r = I,
123
- isDisabled: l = !1,
124
- className: p,
125
- draggingClassName: a,
126
- dropTargetClassName: d,
127
- onDrop: m,
120
+ type: o = I,
121
+ isDisabled: a = !1,
122
+ className: m,
123
+ draggingClassName: c,
124
+ dropTargetClassName: p,
125
+ onDrop: d,
128
126
  hideDefaultPreview: i = !1,
129
- dropDetectionMode: c = E.INDEX_BASED,
130
- isLast: n = !1,
131
- children: u
127
+ dropDetectionMode: l = E.INDEX_BASED,
128
+ isLast: r = !1,
129
+ children: g
132
130
  }) => {
133
- const { isDragging: o, dropPosition: O, dragRef: P, dropRef: _, previewRef: b } = q({
131
+ const { isDragging: n, dropPosition: _, dragRef: P, dropRef: T, previewRef: v } = q({
134
132
  id: e,
135
133
  index: t,
136
- type: r,
137
- isDisabled: l,
138
- onDrop: m,
134
+ type: o,
135
+ isDisabled: a,
136
+ onDrop: d,
139
137
  hideDefaultPreview: i,
140
- dropDetectionMode: c,
141
- isLast: n
142
- }), T = typeof u == "function", B = J("sortable-item", p, {
143
- "sortable-item--dragging": o,
144
- "sortable-item--drop-target-top": O === g.TOP,
145
- "sortable-item--drop-target-bottom": O === g.BOTTOM,
146
- [a || ""]: o && a,
147
- [d || ""]: O && d
138
+ dropDetectionMode: l,
139
+ isLast: r
140
+ }), D = typeof g == "function", B = l === E.HOVER, h = J("sortable-item", m, {
141
+ "sortable-item--dragging": n,
142
+ "sortable-item--hover-mode": B,
143
+ "sortable-item--drop-target-top": _ === u.TOP,
144
+ "sortable-item--drop-target-bottom": _ === u.BOTTOM,
145
+ [c || ""]: n && c,
146
+ [p || ""]: _ && p
148
147
  });
149
- return /* @__PURE__ */ R("div", { ref: (y) => {
150
- _(y), i || b(y), T || P(y);
151
- }, className: B, children: T ? u({
152
- isDragging: o,
153
- isOver: O !== null,
148
+ return /* @__PURE__ */ R("div", { ref: (b) => {
149
+ T(b), i || v(b), D || P(b);
150
+ }, className: h, children: D ? g({
151
+ isDragging: n,
152
+ isOver: _ !== null,
154
153
  dragRef: P
155
- }) : u });
154
+ }) : g });
156
155
  }, ie = ({
157
156
  items: e,
158
157
  type: t = I,
159
- isDisabled: r = !1,
160
- className: l,
161
- itemClassName: p,
162
- onReorder: a,
163
- renderItem: d,
164
- keyExtractor: m = (i) => i.id
158
+ isDisabled: o = !1,
159
+ className: a,
160
+ itemClassName: m,
161
+ onReorder: c,
162
+ renderItem: p,
163
+ keyExtractor: d = (i) => i.id
165
164
  }) => {
166
165
  const i = x(
167
- (c, n) => {
168
- const u = [...e], [o] = u.splice(c, 1);
169
- u.splice(n, 0, o), a(u);
166
+ (l, r) => {
167
+ const g = [...e], [n] = g.splice(l, 1);
168
+ g.splice(r, 0, n), c(g);
170
169
  },
171
- [e, a]
170
+ [e, c]
172
171
  );
173
- return /* @__PURE__ */ R("div", { className: l, children: e.map((c, n) => /* @__PURE__ */ R(
172
+ return /* @__PURE__ */ R("div", { className: a, children: e.map((l, r) => /* @__PURE__ */ R(
174
173
  K,
175
174
  {
176
- id: m(c),
177
- index: n,
175
+ id: d(l),
176
+ index: r,
178
177
  type: t,
179
- isDisabled: r,
180
- className: p,
178
+ isDisabled: o,
179
+ className: m,
181
180
  onDrop: i,
182
- isLast: n === e.length - 1,
183
- children: ({ dragRef: u, isDragging: o }) => d(c, n, u, o)
181
+ isLast: r === e.length - 1,
182
+ children: ({ dragRef: g, isDragging: n }) => p(l, r, g, n)
184
183
  },
185
- m(c)
184
+ d(l)
186
185
  )) });
187
186
  }, Q = {
188
187
  "drag-layer": "_drag-layer_1izcx_1",
@@ -190,22 +189,22 @@ const I = "SORTABLE_ITEM", X = (e) => {
190
189
  }, M = N.bind(Q), le = ({
191
190
  type: e,
192
191
  renderPreview: t,
193
- className: r,
194
- previewClassName: l,
195
- portalTarget: p = document.body
192
+ className: o,
193
+ previewClassName: a,
194
+ portalTarget: m = document.body
196
195
  }) => {
197
- const { itemType: a, isDragging: d, item: m, clientOffset: i } = Y(
198
- (n) => ({
199
- item: n.getItem(),
200
- itemType: n.getItemType(),
201
- clientOffset: n.getClientOffset(),
202
- isDragging: n.isDragging()
196
+ const { itemType: c, isDragging: p, item: d, clientOffset: i } = $(
197
+ (r) => ({
198
+ item: r.getItem(),
199
+ itemType: r.getItemType(),
200
+ clientOffset: r.getClientOffset(),
201
+ isDragging: r.isDragging()
203
202
  })
204
203
  );
205
- if (!d || a !== e || !m || !p)
204
+ if (!p || c !== e || !d || !m)
206
205
  return null;
207
- const c = /* @__PURE__ */ R("div", { className: M("drag-layer", r), children: /* @__PURE__ */ R("div", { className: M("drag-preview", l), style: X(i), children: t(m) }) });
208
- return V(c, p);
206
+ const l = /* @__PURE__ */ R("div", { className: M("drag-layer", o), children: /* @__PURE__ */ R("div", { className: M("drag-preview", a), style: X(i), children: t(d) }) });
207
+ return z(l, m);
209
208
  };
210
209
  export {
211
210
  le as DragLayer,