@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.
- package/dist/components/table/hooks/useGradientPosition.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/sortable.js +121 -122
- package/dist/style.css +1 -1
- package/dist/{table-65ae1c11.js → table-1aaae76c.js} +331 -330
- package/dist/table.js +1 -1
- package/package.json +1 -1
|
@@ -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,
|
|
24
|
-
export declare const usePinnedGradientPosition: (table: HTMLElement | null, scrollLeft: number, header: HTMLElement | null, scrollContainer: HTMLElement | null, isHeaderPinned: boolean, scrollTop: number, tableScrollWidth: number,
|
|
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-
|
|
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
|
|
4
|
-
import { useDrag as
|
|
5
|
-
import { getEmptyImage as
|
|
6
|
-
import { DROP_POSITIONS as
|
|
7
|
-
import { createPortal as
|
|
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:
|
|
13
|
+
const { x: t, y: o } = e, a = `translate(${t}px, ${o}px)`;
|
|
14
14
|
return {
|
|
15
|
-
transform:
|
|
16
|
-
WebkitTransform:
|
|
15
|
+
transform: a,
|
|
16
|
+
WebkitTransform: a
|
|
17
17
|
};
|
|
18
18
|
}, U = ({
|
|
19
19
|
fromIndex: e,
|
|
20
20
|
targetIndex: t,
|
|
21
|
-
isTopZone:
|
|
22
|
-
}) =>
|
|
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:
|
|
29
|
-
isDisabled:
|
|
30
|
-
isLast:
|
|
31
|
-
onDrop:
|
|
32
|
-
hideDefaultPreview:
|
|
33
|
-
dropDetectionMode:
|
|
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 =
|
|
32
|
+
const i = d === E.HOVER, l = k(null), r = k(null), [g, n] = Z(null), [{ isDragging: _ }, P, T] = F(
|
|
36
33
|
() => ({
|
|
37
|
-
type:
|
|
38
|
-
item: { id: e, index: t, type:
|
|
34
|
+
type: o,
|
|
35
|
+
item: { id: e, index: t, type: o },
|
|
39
36
|
collect: (s) => ({
|
|
40
37
|
isDragging: s.isDragging()
|
|
41
38
|
}),
|
|
42
|
-
canDrag: () => !
|
|
39
|
+
canDrag: () => !a
|
|
43
40
|
}),
|
|
44
|
-
[e, t,
|
|
41
|
+
[e, t, o, a]
|
|
45
42
|
);
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}, [
|
|
49
|
-
const [{ isOver:
|
|
43
|
+
w(() => {
|
|
44
|
+
p && T(V(), { captureDraggingState: !0 });
|
|
45
|
+
}, [p, T]);
|
|
46
|
+
const [{ isOver: v, draggedItemIndex: D }, B] = Y(
|
|
50
47
|
() => ({
|
|
51
|
-
accept:
|
|
48
|
+
accept: o,
|
|
52
49
|
collect: (s) => {
|
|
53
|
-
const f = s.getItem(),
|
|
50
|
+
const f = s.getItem(), O = (f == null ? void 0 : f.id) !== e ? s.isOver() : !1;
|
|
54
51
|
return {
|
|
55
|
-
isOver:
|
|
56
|
-
draggedItemIndex:
|
|
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
|
-
|
|
60
|
+
n(null);
|
|
64
61
|
return;
|
|
65
62
|
}
|
|
66
|
-
const
|
|
67
|
-
if (!
|
|
68
|
-
|
|
63
|
+
const y = l.current;
|
|
64
|
+
if (!y) {
|
|
65
|
+
n(null);
|
|
69
66
|
return;
|
|
70
67
|
}
|
|
71
|
-
const
|
|
72
|
-
if (!
|
|
73
|
-
|
|
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
|
|
77
|
-
C === null ? (
|
|
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 || !
|
|
77
|
+
if (!(s.id === e || !c))
|
|
81
78
|
if (i) {
|
|
82
|
-
const f =
|
|
79
|
+
const f = r.current;
|
|
83
80
|
if (!f)
|
|
84
81
|
return;
|
|
85
|
-
const
|
|
82
|
+
const y = f === u.TOP, O = U({
|
|
86
83
|
fromIndex: s.index,
|
|
87
84
|
targetIndex: t,
|
|
88
|
-
isTopZone:
|
|
85
|
+
isTopZone: y
|
|
89
86
|
});
|
|
90
|
-
|
|
87
|
+
c(s.index, O);
|
|
91
88
|
} else
|
|
92
|
-
|
|
89
|
+
c(s.index, t);
|
|
93
90
|
}
|
|
94
91
|
}),
|
|
95
|
-
[e, t,
|
|
96
|
-
),
|
|
97
|
-
(s) => (
|
|
92
|
+
[e, t, o, c, m, i]
|
|
93
|
+
), h = x(
|
|
94
|
+
(s) => (l.current = s, B(s)),
|
|
98
95
|
[B]
|
|
99
96
|
);
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}, [
|
|
103
|
-
const
|
|
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:
|
|
106
|
-
isOver:
|
|
107
|
-
draggedItemIndex:
|
|
108
|
-
dropPosition:
|
|
102
|
+
isDragging: _,
|
|
103
|
+
isOver: v,
|
|
104
|
+
draggedItemIndex: D,
|
|
105
|
+
dropPosition: b,
|
|
109
106
|
dragRef: P,
|
|
110
|
-
dropRef:
|
|
111
|
-
previewRef:
|
|
107
|
+
dropRef: h,
|
|
108
|
+
previewRef: T
|
|
112
109
|
};
|
|
113
110
|
}, G = {
|
|
114
|
-
"sortable-item": "_sortable-
|
|
115
|
-
"sortable-item--drop-target-top": "_sortable-item--drop-target-
|
|
116
|
-
"sortable-item--drop-target-bottom": "_sortable-item--drop-target-
|
|
117
|
-
"
|
|
118
|
-
"drag-handle
|
|
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:
|
|
123
|
-
isDisabled:
|
|
124
|
-
className:
|
|
125
|
-
draggingClassName:
|
|
126
|
-
dropTargetClassName:
|
|
127
|
-
onDrop:
|
|
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:
|
|
130
|
-
isLast:
|
|
131
|
-
children:
|
|
127
|
+
dropDetectionMode: l = E.INDEX_BASED,
|
|
128
|
+
isLast: r = !1,
|
|
129
|
+
children: g
|
|
132
130
|
}) => {
|
|
133
|
-
const { isDragging:
|
|
131
|
+
const { isDragging: n, dropPosition: _, dragRef: P, dropRef: T, previewRef: v } = q({
|
|
134
132
|
id: e,
|
|
135
133
|
index: t,
|
|
136
|
-
type:
|
|
137
|
-
isDisabled:
|
|
138
|
-
onDrop:
|
|
134
|
+
type: o,
|
|
135
|
+
isDisabled: a,
|
|
136
|
+
onDrop: d,
|
|
139
137
|
hideDefaultPreview: i,
|
|
140
|
-
dropDetectionMode:
|
|
141
|
-
isLast:
|
|
142
|
-
}),
|
|
143
|
-
"sortable-item--dragging":
|
|
144
|
-
"sortable-item--
|
|
145
|
-
"sortable-item--drop-target-
|
|
146
|
-
|
|
147
|
-
[
|
|
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: (
|
|
150
|
-
|
|
151
|
-
}, className:
|
|
152
|
-
isDragging:
|
|
153
|
-
isOver:
|
|
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
|
-
}) :
|
|
154
|
+
}) : g });
|
|
156
155
|
}, ie = ({
|
|
157
156
|
items: e,
|
|
158
157
|
type: t = I,
|
|
159
|
-
isDisabled:
|
|
160
|
-
className:
|
|
161
|
-
itemClassName:
|
|
162
|
-
onReorder:
|
|
163
|
-
renderItem:
|
|
164
|
-
keyExtractor:
|
|
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
|
-
(
|
|
168
|
-
const
|
|
169
|
-
|
|
166
|
+
(l, r) => {
|
|
167
|
+
const g = [...e], [n] = g.splice(l, 1);
|
|
168
|
+
g.splice(r, 0, n), c(g);
|
|
170
169
|
},
|
|
171
|
-
[e,
|
|
170
|
+
[e, c]
|
|
172
171
|
);
|
|
173
|
-
return /* @__PURE__ */ R("div", { className:
|
|
172
|
+
return /* @__PURE__ */ R("div", { className: a, children: e.map((l, r) => /* @__PURE__ */ R(
|
|
174
173
|
K,
|
|
175
174
|
{
|
|
176
|
-
id:
|
|
177
|
-
index:
|
|
175
|
+
id: d(l),
|
|
176
|
+
index: r,
|
|
178
177
|
type: t,
|
|
179
|
-
isDisabled:
|
|
180
|
-
className:
|
|
178
|
+
isDisabled: o,
|
|
179
|
+
className: m,
|
|
181
180
|
onDrop: i,
|
|
182
|
-
isLast:
|
|
183
|
-
children: ({ dragRef:
|
|
181
|
+
isLast: r === e.length - 1,
|
|
182
|
+
children: ({ dragRef: g, isDragging: n }) => p(l, r, g, n)
|
|
184
183
|
},
|
|
185
|
-
|
|
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:
|
|
194
|
-
previewClassName:
|
|
195
|
-
portalTarget:
|
|
192
|
+
className: o,
|
|
193
|
+
previewClassName: a,
|
|
194
|
+
portalTarget: m = document.body
|
|
196
195
|
}) => {
|
|
197
|
-
const { itemType:
|
|
198
|
-
(
|
|
199
|
-
item:
|
|
200
|
-
itemType:
|
|
201
|
-
clientOffset:
|
|
202
|
-
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 (!
|
|
204
|
+
if (!p || c !== e || !d || !m)
|
|
206
205
|
return null;
|
|
207
|
-
const
|
|
208
|
-
return
|
|
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,
|