@reportportal/ui-kit 0.0.1-alpha.169 → 0.0.1-alpha.170
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/common/hooks/index.d.ts +2 -0
- package/dist/common/hooks/useTreeDropValidation.d.ts +5 -0
- package/dist/common/hooks/useTreeSortable.d.ts +3 -0
- package/dist/common/hooks.js +67 -0
- package/dist/common/types/sortableTypes.d.ts +85 -1
- package/dist/common.js +13 -3
- package/dist/components/datePicker/datePicker.d.ts +2 -0
- package/dist/components/datePicker/utils.d.ts +1 -1
- package/dist/components/index.d.ts +2 -1
- package/dist/components/sortable/index.d.ts +2 -0
- package/dist/components/sortable/treeSortableContainer/TreeSortableContext.d.ts +11 -0
- package/dist/components/sortable/treeSortableContainer/index.d.ts +2 -0
- package/dist/components/sortable/treeSortableContainer/treeSortableContainer.d.ts +3 -0
- package/dist/components/sortable/treeSortableItem/index.d.ts +1 -0
- package/dist/components/sortable/treeSortableItem/treeSortableItem.d.ts +3 -0
- package/dist/datePicker-412fb8e8.js +213 -0
- package/dist/datePicker.js +3 -3
- package/dist/index.js +174 -167
- package/dist/modal.js +80 -90
- package/dist/sortable.js +282 -193
- package/dist/style.css +1 -1
- package/dist/useTreeSortable-70a9c8f5.js +179 -0
- package/dist/useWindowResize-a7e1ac92.js +16 -0
- package/package.json +1 -1
- package/dist/datePicker-ad4a758c.js +0 -208
package/dist/sortable.js
CHANGED
|
@@ -1,213 +1,302 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as u, jsxs as q } from "react/jsx-runtime";
|
|
2
2
|
import { c as N } from "./bind-06a7ff84.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
|
31
|
-
}) => {
|
|
32
|
-
const i = d === E.HOVER, l = k(null), r = k(null), [g, n] = Z(null), [{ isDragging: _ }, P, T] = F(
|
|
33
|
-
() => ({
|
|
34
|
-
type: o,
|
|
35
|
-
item: { id: e, index: t, type: o },
|
|
36
|
-
collect: (s) => ({
|
|
37
|
-
isDragging: s.isDragging()
|
|
38
|
-
}),
|
|
39
|
-
canDrag: () => !a
|
|
40
|
-
}),
|
|
41
|
-
[e, t, o, a]
|
|
42
|
-
);
|
|
43
|
-
w(() => {
|
|
44
|
-
p && T(V(), { captureDraggingState: !0 });
|
|
45
|
-
}, [p, T]);
|
|
46
|
-
const [{ isOver: v, draggedItemIndex: D }, B] = Y(
|
|
47
|
-
() => ({
|
|
48
|
-
accept: o,
|
|
49
|
-
collect: (s) => {
|
|
50
|
-
const f = s.getItem(), O = (f == null ? void 0 : f.id) !== e ? s.isOver() : !1;
|
|
51
|
-
return {
|
|
52
|
-
isOver: O,
|
|
53
|
-
draggedItemIndex: O ? (f == null ? void 0 : f.index) ?? null : null
|
|
54
|
-
};
|
|
55
|
-
},
|
|
56
|
-
hover: (s, f) => {
|
|
57
|
-
if (!i)
|
|
58
|
-
return;
|
|
59
|
-
if (s.id === e) {
|
|
60
|
-
n(null);
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
const y = l.current;
|
|
64
|
-
if (!y) {
|
|
65
|
-
n(null);
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
const O = y.getBoundingClientRect(), A = O.bottom - O.top, S = f.getClientOffset();
|
|
69
|
-
if (!S) {
|
|
70
|
-
n(null);
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
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);
|
|
75
|
-
},
|
|
76
|
-
drop: (s) => {
|
|
77
|
-
if (!(s.id === e || !c))
|
|
78
|
-
if (i) {
|
|
79
|
-
const f = r.current;
|
|
80
|
-
if (!f)
|
|
81
|
-
return;
|
|
82
|
-
const y = f === u.TOP, O = U({
|
|
83
|
-
fromIndex: s.index,
|
|
84
|
-
targetIndex: t,
|
|
85
|
-
isTopZone: y
|
|
86
|
-
});
|
|
87
|
-
c(s.index, O);
|
|
88
|
-
} else
|
|
89
|
-
c(s.index, t);
|
|
90
|
-
}
|
|
91
|
-
}),
|
|
92
|
-
[e, t, o, c, m, i]
|
|
93
|
-
), h = x(
|
|
94
|
-
(s) => (l.current = s, B(s)),
|
|
95
|
-
[B]
|
|
96
|
-
);
|
|
97
|
-
w(() => {
|
|
98
|
-
v || n(null);
|
|
99
|
-
}, [v]);
|
|
100
|
-
const b = i ? g : (() => D === null ? null : D > t ? u.TOP : u.BOTTOM)();
|
|
101
|
-
return {
|
|
102
|
-
isDragging: _,
|
|
103
|
-
isOver: v,
|
|
104
|
-
draggedItemIndex: D,
|
|
105
|
-
dropPosition: b,
|
|
106
|
-
dragRef: P,
|
|
107
|
-
dropRef: h,
|
|
108
|
-
previewRef: T
|
|
109
|
-
};
|
|
110
|
-
}, G = {
|
|
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"
|
|
117
|
-
}, J = N.bind(G), K = ({
|
|
118
|
-
id: e,
|
|
119
|
-
index: t,
|
|
120
|
-
type: o = I,
|
|
121
|
-
isDisabled: a = !1,
|
|
122
|
-
className: m,
|
|
123
|
-
draggingClassName: c,
|
|
3
|
+
import { isFunction as j } from "es-toolkit";
|
|
4
|
+
import { useCallback as A, createContext as M, useContext as ee, useState as H, useRef as J } from "react";
|
|
5
|
+
import { u as te, D as F, g as re, a as oe } from "./useTreeSortable-70a9c8f5.js";
|
|
6
|
+
import { useDragLayer as se } from "react-dnd";
|
|
7
|
+
import "react-dnd-html5-backend";
|
|
8
|
+
import { DROP_DETECTION_MODE as X, DROP_POSITIONS as Y, DROP_ACTIONS as _, TREE_DROP_POSITIONS as S } from "./common.js";
|
|
9
|
+
import { createPortal as K } from "react-dom";
|
|
10
|
+
import { u as ie } from "./useOnClickOutside-8f7d68a1.js";
|
|
11
|
+
const ne = {
|
|
12
|
+
"sortable-item": "_sortable-item_b58jz_16",
|
|
13
|
+
"sortable-item--drop-target-top": "_sortable-item--drop-target-top_b58jz_22",
|
|
14
|
+
"sortable-item--drop-target-bottom": "_sortable-item--drop-target-bottom_b58jz_35",
|
|
15
|
+
"sortable-item--hover-mode": "_sortable-item--hover-mode_b58jz_48",
|
|
16
|
+
"drag-handle": "_drag-handle_b58jz_65",
|
|
17
|
+
"drag-handle--disabled": "_drag-handle--disabled_b58jz_72"
|
|
18
|
+
}, ae = N.bind(ne), le = ({
|
|
19
|
+
id: n,
|
|
20
|
+
index: f,
|
|
21
|
+
type: v = F,
|
|
22
|
+
isDisabled: E = !1,
|
|
23
|
+
className: o,
|
|
24
|
+
draggingClassName: a,
|
|
124
25
|
dropTargetClassName: p,
|
|
125
|
-
onDrop:
|
|
126
|
-
hideDefaultPreview:
|
|
127
|
-
dropDetectionMode:
|
|
128
|
-
isLast:
|
|
129
|
-
children:
|
|
26
|
+
onDrop: e,
|
|
27
|
+
hideDefaultPreview: c = !1,
|
|
28
|
+
dropDetectionMode: s = X.INDEX_BASED,
|
|
29
|
+
isLast: t = !1,
|
|
30
|
+
children: i
|
|
130
31
|
}) => {
|
|
131
|
-
const { isDragging:
|
|
132
|
-
id:
|
|
133
|
-
index:
|
|
134
|
-
type:
|
|
135
|
-
isDisabled:
|
|
136
|
-
onDrop:
|
|
137
|
-
hideDefaultPreview:
|
|
138
|
-
dropDetectionMode:
|
|
139
|
-
isLast:
|
|
140
|
-
}),
|
|
141
|
-
"sortable-item--dragging":
|
|
142
|
-
"sortable-item--hover-mode":
|
|
143
|
-
"sortable-item--drop-target-top":
|
|
144
|
-
"sortable-item--drop-target-bottom":
|
|
145
|
-
[
|
|
146
|
-
[p || ""]:
|
|
32
|
+
const { isDragging: l, dropPosition: d, dragRef: R, dropRef: g, previewRef: r } = te({
|
|
33
|
+
id: n,
|
|
34
|
+
index: f,
|
|
35
|
+
type: v,
|
|
36
|
+
isDisabled: E,
|
|
37
|
+
onDrop: e,
|
|
38
|
+
hideDefaultPreview: c,
|
|
39
|
+
dropDetectionMode: s,
|
|
40
|
+
isLast: t
|
|
41
|
+
}), O = j(i), P = s === X.HOVER, T = ae("sortable-item", o, {
|
|
42
|
+
"sortable-item--dragging": l,
|
|
43
|
+
"sortable-item--hover-mode": P,
|
|
44
|
+
"sortable-item--drop-target-top": d === Y.TOP,
|
|
45
|
+
"sortable-item--drop-target-bottom": d === Y.BOTTOM,
|
|
46
|
+
[a || ""]: l && a,
|
|
47
|
+
[p || ""]: d && p
|
|
147
48
|
});
|
|
148
|
-
return /* @__PURE__ */
|
|
149
|
-
|
|
150
|
-
}, className:
|
|
151
|
-
isDragging:
|
|
152
|
-
isOver:
|
|
153
|
-
dragRef:
|
|
154
|
-
}) :
|
|
155
|
-
},
|
|
156
|
-
items:
|
|
157
|
-
type:
|
|
158
|
-
isDisabled:
|
|
159
|
-
className:
|
|
160
|
-
itemClassName:
|
|
161
|
-
onReorder:
|
|
49
|
+
return /* @__PURE__ */ u("div", { ref: (b) => {
|
|
50
|
+
g(b), c || r(b), O || R(b);
|
|
51
|
+
}, className: T, children: O ? i({
|
|
52
|
+
isDragging: l,
|
|
53
|
+
isOver: d !== null,
|
|
54
|
+
dragRef: R
|
|
55
|
+
}) : i });
|
|
56
|
+
}, Re = ({
|
|
57
|
+
items: n,
|
|
58
|
+
type: f = F,
|
|
59
|
+
isDisabled: v = !1,
|
|
60
|
+
className: E,
|
|
61
|
+
itemClassName: o,
|
|
62
|
+
onReorder: a,
|
|
162
63
|
renderItem: p,
|
|
163
|
-
keyExtractor:
|
|
64
|
+
keyExtractor: e = (c) => c.id
|
|
164
65
|
}) => {
|
|
165
|
-
const
|
|
166
|
-
(
|
|
167
|
-
const
|
|
168
|
-
|
|
66
|
+
const c = A(
|
|
67
|
+
(s, t) => {
|
|
68
|
+
const i = [...n], [l] = i.splice(s, 1);
|
|
69
|
+
i.splice(t, 0, l), a(i);
|
|
169
70
|
},
|
|
170
|
-
[
|
|
71
|
+
[n, a]
|
|
171
72
|
);
|
|
172
|
-
return /* @__PURE__ */
|
|
173
|
-
|
|
73
|
+
return /* @__PURE__ */ u("div", { className: E, children: n.map((s, t) => /* @__PURE__ */ u(
|
|
74
|
+
le,
|
|
174
75
|
{
|
|
175
|
-
id:
|
|
176
|
-
index:
|
|
177
|
-
type:
|
|
178
|
-
isDisabled:
|
|
179
|
-
className:
|
|
180
|
-
onDrop:
|
|
181
|
-
isLast:
|
|
182
|
-
children: ({ dragRef:
|
|
76
|
+
id: e(s),
|
|
77
|
+
index: t,
|
|
78
|
+
type: f,
|
|
79
|
+
isDisabled: v,
|
|
80
|
+
className: o,
|
|
81
|
+
onDrop: c,
|
|
82
|
+
isLast: t === n.length - 1,
|
|
83
|
+
children: ({ dragRef: i, isDragging: l }) => p(s, t, i, l)
|
|
183
84
|
},
|
|
184
|
-
|
|
85
|
+
e(s)
|
|
185
86
|
)) });
|
|
186
|
-
},
|
|
87
|
+
}, pe = {
|
|
187
88
|
"drag-layer": "_drag-layer_1izcx_1",
|
|
188
89
|
"drag-preview": "_drag-preview_1izcx_11"
|
|
189
|
-
},
|
|
190
|
-
type:
|
|
191
|
-
renderPreview:
|
|
192
|
-
className:
|
|
193
|
-
previewClassName:
|
|
194
|
-
portalTarget:
|
|
90
|
+
}, G = N.bind(pe), he = ({
|
|
91
|
+
type: n,
|
|
92
|
+
renderPreview: f,
|
|
93
|
+
className: v,
|
|
94
|
+
previewClassName: E,
|
|
95
|
+
portalTarget: o = document.body
|
|
195
96
|
}) => {
|
|
196
|
-
const { itemType:
|
|
197
|
-
(
|
|
198
|
-
item:
|
|
199
|
-
itemType:
|
|
200
|
-
clientOffset:
|
|
201
|
-
isDragging:
|
|
97
|
+
const { itemType: a, isDragging: p, item: e, clientOffset: c } = se(
|
|
98
|
+
(t) => ({
|
|
99
|
+
item: t.getItem(),
|
|
100
|
+
itemType: t.getItemType(),
|
|
101
|
+
clientOffset: t.getClientOffset(),
|
|
102
|
+
isDragging: t.isDragging()
|
|
202
103
|
})
|
|
203
104
|
);
|
|
204
|
-
if (!p ||
|
|
105
|
+
if (!p || a !== n || !e || !o)
|
|
205
106
|
return null;
|
|
206
|
-
const
|
|
207
|
-
return
|
|
107
|
+
const s = /* @__PURE__ */ u("div", { className: G("drag-layer", v), children: /* @__PURE__ */ u("div", { className: G("drag-preview", E), style: re(c), children: f(e) }) });
|
|
108
|
+
return K(s, o);
|
|
109
|
+
}, Q = M(null), ce = () => ee(Q), de = {
|
|
110
|
+
"drop-confirmation-popover": "_drop-confirmation-popover_obz3t_16",
|
|
111
|
+
"drop-confirmation-popover--before": "_drop-confirmation-popover--before_obz3t_31",
|
|
112
|
+
"drop-confirmation-popover--after": "_drop-confirmation-popover--after_obz3t_35",
|
|
113
|
+
"drop-confirmation-popover__button": "_drop-confirmation-popover__button_obz3t_59",
|
|
114
|
+
"drop-confirmation-popover__divider": "_drop-confirmation-popover__divider_obz3t_75"
|
|
115
|
+
}, C = N.bind(de), me = {
|
|
116
|
+
[_.MOVE]: "Move",
|
|
117
|
+
[_.DUPLICATE]: "Duplicate",
|
|
118
|
+
[_.CANCEL]: "Cancel"
|
|
119
|
+
}, Se = ({
|
|
120
|
+
children: n,
|
|
121
|
+
showDropConfirmation: f = !1,
|
|
122
|
+
confirmationLabels: v,
|
|
123
|
+
portalTarget: E,
|
|
124
|
+
onMove: o,
|
|
125
|
+
onDuplicate: a,
|
|
126
|
+
onCancel: p
|
|
127
|
+
}) => {
|
|
128
|
+
const [e, c] = H(null), [s, t] = H(
|
|
129
|
+
null
|
|
130
|
+
), i = J(null), l = { ...me, ...v }, d = A(() => {
|
|
131
|
+
c(null), t(null);
|
|
132
|
+
}, []), R = A(
|
|
133
|
+
(P, T, m, b) => {
|
|
134
|
+
if (!f) {
|
|
135
|
+
o == null || o(P, T, m);
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
const I = b.getBoundingClientRect(), z = I.left + I.width / 2;
|
|
139
|
+
let h;
|
|
140
|
+
m === "before" ? h = I.top : m === "after" ? h = I.top + I.height : h = I.top, t({
|
|
141
|
+
top: h,
|
|
142
|
+
left: z
|
|
143
|
+
}), c({ draggedItem: P, targetId: T, position: m });
|
|
144
|
+
},
|
|
145
|
+
[f, o]
|
|
146
|
+
), g = A(
|
|
147
|
+
(P) => {
|
|
148
|
+
if (!e) {
|
|
149
|
+
d();
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
const { draggedItem: T, targetId: m, position: b } = e;
|
|
153
|
+
switch (P) {
|
|
154
|
+
case _.MOVE:
|
|
155
|
+
o == null || o(T, m, b);
|
|
156
|
+
break;
|
|
157
|
+
case _.DUPLICATE:
|
|
158
|
+
a == null || a(T, m, b);
|
|
159
|
+
break;
|
|
160
|
+
case _.CANCEL:
|
|
161
|
+
p == null || p();
|
|
162
|
+
break;
|
|
163
|
+
}
|
|
164
|
+
d();
|
|
165
|
+
},
|
|
166
|
+
[e, o, a, p, d]
|
|
167
|
+
);
|
|
168
|
+
ie(
|
|
169
|
+
i,
|
|
170
|
+
e && f ? () => g(_.CANCEL) : void 0
|
|
171
|
+
);
|
|
172
|
+
const r = {
|
|
173
|
+
showDropConfirmation: f,
|
|
174
|
+
pendingDraggedItemId: (e == null ? void 0 : e.draggedItem.id) ?? null,
|
|
175
|
+
pendingTargetId: (e == null ? void 0 : e.targetId) ?? null,
|
|
176
|
+
pendingDropPosition: (e == null ? void 0 : e.position) ?? null,
|
|
177
|
+
requestDrop: R
|
|
178
|
+
}, O = E ?? (typeof document < "u" ? document.body : null);
|
|
179
|
+
return /* @__PURE__ */ q(Q.Provider, { value: r, children: [
|
|
180
|
+
n,
|
|
181
|
+
e && s && O && K(
|
|
182
|
+
/* @__PURE__ */ q(
|
|
183
|
+
"div",
|
|
184
|
+
{
|
|
185
|
+
ref: i,
|
|
186
|
+
className: C("drop-confirmation-popover", {
|
|
187
|
+
"drop-confirmation-popover--before": e.position === "before",
|
|
188
|
+
"drop-confirmation-popover--after": e.position === "after"
|
|
189
|
+
}),
|
|
190
|
+
style: {
|
|
191
|
+
top: s.top,
|
|
192
|
+
left: s.left
|
|
193
|
+
},
|
|
194
|
+
children: [
|
|
195
|
+
/* @__PURE__ */ u(
|
|
196
|
+
"button",
|
|
197
|
+
{
|
|
198
|
+
type: "button",
|
|
199
|
+
className: C("drop-confirmation-popover__button"),
|
|
200
|
+
onClick: () => g(_.MOVE),
|
|
201
|
+
children: l[_.MOVE]
|
|
202
|
+
}
|
|
203
|
+
),
|
|
204
|
+
/* @__PURE__ */ u(
|
|
205
|
+
"button",
|
|
206
|
+
{
|
|
207
|
+
type: "button",
|
|
208
|
+
className: C("drop-confirmation-popover__button"),
|
|
209
|
+
onClick: () => g(_.DUPLICATE),
|
|
210
|
+
children: l[_.DUPLICATE]
|
|
211
|
+
}
|
|
212
|
+
),
|
|
213
|
+
/* @__PURE__ */ u("div", { className: C("drop-confirmation-popover__divider") }),
|
|
214
|
+
/* @__PURE__ */ u(
|
|
215
|
+
"button",
|
|
216
|
+
{
|
|
217
|
+
type: "button",
|
|
218
|
+
className: C("drop-confirmation-popover__button"),
|
|
219
|
+
onClick: () => g(_.CANCEL),
|
|
220
|
+
children: l[_.CANCEL]
|
|
221
|
+
}
|
|
222
|
+
)
|
|
223
|
+
]
|
|
224
|
+
}
|
|
225
|
+
),
|
|
226
|
+
O
|
|
227
|
+
)
|
|
228
|
+
] });
|
|
229
|
+
}, be = {
|
|
230
|
+
"tree-sortable-item": "_tree-sortable-item_c3l7m_16",
|
|
231
|
+
"tree-sortable-item--dragging": "_tree-sortable-item--dragging_c3l7m_20",
|
|
232
|
+
"tree-sortable-item--pending": "_tree-sortable-item--pending_c3l7m_23",
|
|
233
|
+
"tree-sortable-item--drop-before": "_tree-sortable-item--drop-before_c3l7m_29",
|
|
234
|
+
"tree-sortable-item--drop-after": "_tree-sortable-item--drop-after_c3l7m_39",
|
|
235
|
+
"tree-sortable-item--drop-inside": "_tree-sortable-item--drop-inside_c3l7m_49"
|
|
236
|
+
}, _e = N.bind(be), ye = ({
|
|
237
|
+
id: n,
|
|
238
|
+
index: f,
|
|
239
|
+
parentId: v,
|
|
240
|
+
type: E = F,
|
|
241
|
+
isDisabled: o = !1,
|
|
242
|
+
acceptDrop: a = !0,
|
|
243
|
+
isLast: p = !1,
|
|
244
|
+
canDropOn: e,
|
|
245
|
+
className: c,
|
|
246
|
+
draggingClassName: s,
|
|
247
|
+
dropBeforeClassName: t,
|
|
248
|
+
dropInsideClassName: i,
|
|
249
|
+
dropAfterClassName: l,
|
|
250
|
+
onDrop: d,
|
|
251
|
+
hideDefaultPreview: R = !1,
|
|
252
|
+
children: g
|
|
253
|
+
}) => {
|
|
254
|
+
const r = ce(), O = J(null), P = A(
|
|
255
|
+
(D, $, x) => {
|
|
256
|
+
r != null && r.showDropConfirmation && O.current ? r.requestDrop(D, $, x, O.current) : d == null || d(D, $, x);
|
|
257
|
+
},
|
|
258
|
+
[r, d]
|
|
259
|
+
), { isDragging: T, isOver: m, dropPosition: b, dragRef: I, dropRef: z, previewRef: h } = oe({
|
|
260
|
+
id: n,
|
|
261
|
+
index: f,
|
|
262
|
+
parentId: v,
|
|
263
|
+
type: E,
|
|
264
|
+
isDisabled: o,
|
|
265
|
+
acceptDrop: a,
|
|
266
|
+
canDropOn: e,
|
|
267
|
+
onDrop: P,
|
|
268
|
+
hideDefaultPreview: R
|
|
269
|
+
}), k = (r == null ? void 0 : r.pendingDraggedItemId) === n, w = T || k, y = (r == null ? void 0 : r.pendingTargetId) === n, L = r == null ? void 0 : r.pendingDropPosition, B = m && b === S.BEFORE || y && L === S.BEFORE, U = m && b === S.INSIDE || y && L === S.INSIDE, V = p && (m && b === S.AFTER || y && L === S.AFTER), W = j(g) ? g({
|
|
270
|
+
isDragging: w,
|
|
271
|
+
isOver: m || y,
|
|
272
|
+
dropPosition: y ? L ?? null : b,
|
|
273
|
+
dragRef: I
|
|
274
|
+
}) : g, Z = _e("tree-sortable-item", c, {
|
|
275
|
+
"tree-sortable-item--dragging": w,
|
|
276
|
+
"tree-sortable-item--pending": k,
|
|
277
|
+
"tree-sortable-item--drop-before": B,
|
|
278
|
+
"tree-sortable-item--drop-inside": U,
|
|
279
|
+
"tree-sortable-item--drop-after": V,
|
|
280
|
+
[s || ""]: w && s,
|
|
281
|
+
[t || ""]: B && t,
|
|
282
|
+
[i || ""]: U && i,
|
|
283
|
+
[l || ""]: V && l
|
|
284
|
+
});
|
|
285
|
+
return /* @__PURE__ */ u(
|
|
286
|
+
"div",
|
|
287
|
+
{
|
|
288
|
+
ref: (D) => {
|
|
289
|
+
O.current = D, z(D), j(g) || (I(D), h(D));
|
|
290
|
+
},
|
|
291
|
+
className: Z,
|
|
292
|
+
children: W
|
|
293
|
+
}
|
|
294
|
+
);
|
|
208
295
|
};
|
|
209
296
|
export {
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
297
|
+
he as DragLayer,
|
|
298
|
+
le as SortableItem,
|
|
299
|
+
Re as SortableList,
|
|
300
|
+
Se as TreeSortableContainer,
|
|
301
|
+
ye as TreeSortableItem
|
|
213
302
|
};
|
package/dist/style.css
CHANGED
|
@@ -12,4 +12,4 @@
|
|
|
12
12
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
|
-
*/._segmented-control_188ud_16{display:inline-flex;gap:4px;border-radius:6px;background-color:var(--rp-ui-color-bg-3);padding:2px}._segmented-control_188ud_16._full-width_188ud_23{width:100%;display:flex}._button_188ud_28{display:inline-flex;flex:1;box-sizing:border-box;gap:8px;padding:8px;border:1px solid transparent;border-radius:4px;background-color:transparent;color:var(--rp-ui-color-text);font-size:13px;line-height:20px;font-family:var(--rp-ui-base-font-family);font-weight:var(--rp-ui-base-fw-regular);white-space:nowrap;align-items:center;justify-content:center;cursor:pointer;outline:none;transition:all .2s ease}._button_188ud_28:hover:not(._disabled_188ud_53):not(._active_188ud_53){background-color:var(--rp-ui-color-field-hover);color:var(--rp-ui-color-text)}._button_188ud_28._active_188ud_53{background-color:var(--rp-ui-color-field-bg);color:var(--rp-ui-color-text);border-radius:4px;box-shadow:0 1px 3px #3743621a}._button_188ud_28:focus-visible:not(._disabled_188ud_53){border-color:var(--rp-ui-color-primary-focused);outline:none;box-shadow:inset 0 0 0 1px var(--rp-ui-color-primary-focused)}._button_188ud_28._disabled_188ud_53{cursor:not-allowed;opacity:.5;color:var(--rp-ui-base-e-300)}._button_188ud_28._disabled_188ud_53:hover{background-color:transparent}._icon_188ud_77{display:flex;align-items:center;justify-content:center;width:16px;height:16px;flex-shrink:0}._side-panel_6bj2z_1{position:fixed;display:flex;flex-direction:column;width:max-content;min-width:320px;max-width:700px;height:100vh;background-color:var(--rp-ui-base-bg-100);box-shadow:var(--rp-ui-base-shadow-secondary);overflow:hidden;transition:transform .3s ease-in-out;pointer-events:none}._side-panel_6bj2z_1._active_6bj2z_15{pointer-events:auto}._side-right_6bj2z_19{right:0;transform:translate(100%)}._side-right_6bj2z_19._active_6bj2z_15{transform:translate(0)}._side-left_6bj2z_27{left:0;transform:translate(-100%)}._side-left_6bj2z_27._active_6bj2z_15{transform:translate(0)}._header-section_6bj2z_35{flex-shrink:0;margin-bottom:16px}._header-section_6bj2z_35._compact_6bj2z_39{margin-bottom:8px}._header_6bj2z_35{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:24px 24px 16px;border-bottom:1px solid var(--rp-ui-base-border-100)}._header_6bj2z_35>:first-child{flex:1}._header-content_6bj2z_55{flex:1}._close-button_6bj2z_59{flex-shrink:0;width:32px;height:32px}._title_6bj2z_65{font-size:20px;line-height:31px;font-family:var(--rp-ui-base-font-family-heading);color:var(--rp-ui-base-almost-black);text-overflow:ellipsis;white-space:nowrap;overflow:hidden;max-width:100%}._description_6bj2z_76{margin:8px 0 0;font-family:var(--rp-ui-base-font-family);font-weight:var(--rp-ui-base-fw-regular);font-size:var(--rp-ui-base-font-size-md);line-height:var(--rp-ui-base-lh-md);color:var(--rp-ui-base-almost-black)}._content_6bj2z_85{flex:1;overflow-y:auto;padding:16px 24px;min-height:0}._footer_6bj2z_92{flex-shrink:0;padding:12px 24px;border-top:1px solid var(--rp-ui-base-border-100)}._divider_6bj2z_98{flex-shrink:0;height:1px;background-color:var(--rp-ui-base-e-100)}._sortable-
|
|
15
|
+
*/._segmented-control_188ud_16{display:inline-flex;gap:4px;border-radius:6px;background-color:var(--rp-ui-color-bg-3);padding:2px}._segmented-control_188ud_16._full-width_188ud_23{width:100%;display:flex}._button_188ud_28{display:inline-flex;flex:1;box-sizing:border-box;gap:8px;padding:8px;border:1px solid transparent;border-radius:4px;background-color:transparent;color:var(--rp-ui-color-text);font-size:13px;line-height:20px;font-family:var(--rp-ui-base-font-family);font-weight:var(--rp-ui-base-fw-regular);white-space:nowrap;align-items:center;justify-content:center;cursor:pointer;outline:none;transition:all .2s ease}._button_188ud_28:hover:not(._disabled_188ud_53):not(._active_188ud_53){background-color:var(--rp-ui-color-field-hover);color:var(--rp-ui-color-text)}._button_188ud_28._active_188ud_53{background-color:var(--rp-ui-color-field-bg);color:var(--rp-ui-color-text);border-radius:4px;box-shadow:0 1px 3px #3743621a}._button_188ud_28:focus-visible:not(._disabled_188ud_53){border-color:var(--rp-ui-color-primary-focused);outline:none;box-shadow:inset 0 0 0 1px var(--rp-ui-color-primary-focused)}._button_188ud_28._disabled_188ud_53{cursor:not-allowed;opacity:.5;color:var(--rp-ui-base-e-300)}._button_188ud_28._disabled_188ud_53:hover{background-color:transparent}._icon_188ud_77{display:flex;align-items:center;justify-content:center;width:16px;height:16px;flex-shrink:0}._side-panel_6bj2z_1{position:fixed;display:flex;flex-direction:column;width:max-content;min-width:320px;max-width:700px;height:100vh;background-color:var(--rp-ui-base-bg-100);box-shadow:var(--rp-ui-base-shadow-secondary);overflow:hidden;transition:transform .3s ease-in-out;pointer-events:none}._side-panel_6bj2z_1._active_6bj2z_15{pointer-events:auto}._side-right_6bj2z_19{right:0;transform:translate(100%)}._side-right_6bj2z_19._active_6bj2z_15{transform:translate(0)}._side-left_6bj2z_27{left:0;transform:translate(-100%)}._side-left_6bj2z_27._active_6bj2z_15{transform:translate(0)}._header-section_6bj2z_35{flex-shrink:0;margin-bottom:16px}._header-section_6bj2z_35._compact_6bj2z_39{margin-bottom:8px}._header_6bj2z_35{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:24px 24px 16px;border-bottom:1px solid var(--rp-ui-base-border-100)}._header_6bj2z_35>:first-child{flex:1}._header-content_6bj2z_55{flex:1}._close-button_6bj2z_59{flex-shrink:0;width:32px;height:32px}._title_6bj2z_65{font-size:20px;line-height:31px;font-family:var(--rp-ui-base-font-family-heading);color:var(--rp-ui-base-almost-black);text-overflow:ellipsis;white-space:nowrap;overflow:hidden;max-width:100%}._description_6bj2z_76{margin:8px 0 0;font-family:var(--rp-ui-base-font-family);font-weight:var(--rp-ui-base-fw-regular);font-size:var(--rp-ui-base-font-size-md);line-height:var(--rp-ui-base-lh-md);color:var(--rp-ui-base-almost-black)}._content_6bj2z_85{flex:1;overflow-y:auto;padding:16px 24px;min-height:0}._footer_6bj2z_92{flex-shrink:0;padding:12px 24px;border-top:1px solid var(--rp-ui-base-border-100)}._divider_6bj2z_98{flex-shrink:0;height:1px;background-color:var(--rp-ui-base-e-100)}._sortable-item_b58jz_16{position:relative;width:100%;transition:opacity .2s ease;--sortable-gap: 8px}._sortable-item--drop-target-top_b58jz_22:before{content:"";position:absolute;top:calc(var(--sortable-gap) / -2);left:0;right:0;height:2px;background-color:var(--rp-ui-color-primary-focused);border-radius:2px;z-index:1;transform:translateY(-50%);pointer-events:none}._sortable-item--drop-target-bottom_b58jz_35:after{content:"";position:absolute;bottom:calc(var(--sortable-gap) / -2);left:0;right:0;height:2px;background-color:var(--rp-ui-color-primary-focused);border-radius:2px;z-index:1;transform:translateY(50%);pointer-events:none}._sortable-item--hover-mode_b58jz_48._sortable-item--drop-target-top_b58jz_22:before{display:block;position:static;top:auto;margin-bottom:var(--sortable-gap);transform:none;z-index:auto}._sortable-item--hover-mode_b58jz_48._sortable-item--drop-target-bottom_b58jz_35:after{display:block;position:static;bottom:auto;margin-top:var(--sortable-gap);transform:none;z-index:auto}._drag-handle_b58jz_65{cursor:grab;touch-action:none}._drag-handle_b58jz_65:active{cursor:grabbing}._drag-handle--disabled_b58jz_72{cursor:not-allowed;opacity:.5}._drag-layer_1izcx_1{position:fixed;pointer-events:none;z-index:100;left:0;top:0;width:100%;height:100%}._drag-preview_1izcx_11{display:flex;align-items:center;justify-content:flex-start;gap:8px;width:376px;height:52px;padding-left:12px;background-color:var(--rp-ui-base-bg-000);border:1px solid var(--rp-ui-color-field-border);border-radius:4px;box-shadow:0 4px 12px #00000026;font-size:13px;font-weight:500;color:var(--rp-ui-base-almost-black);white-space:nowrap}._drag-preview_1izcx_11 svg{width:16px;height:16px}._drag-preview_1izcx_11 svg path{fill:var(--rp-ui-color-field-icon)}._drop-confirmation-popover_obz3t_16{position:fixed;transform:translate(-50%,-100%);margin-bottom:8px;z-index:1000;display:flex;flex-direction:column;width:160px;min-width:120px;max-width:480px;padding:8px 0;background-color:var(--rp-ui-base-bg-000);border-radius:8px;box-shadow:0 8px 20px #00000026}._drop-confirmation-popover--before_obz3t_31{transform:translate(-50%,-110%);margin-bottom:0}._drop-confirmation-popover--after_obz3t_35{transform:translate(-50%);margin-top:8px;margin-bottom:0}._drop-confirmation-popover_obz3t_16:after{content:"";position:absolute;bottom:-8px;left:50%;transform:translate(-50%);width:0;height:0;border-left:8px solid transparent;border-right:8px solid transparent;border-top:8px solid var(--rp-ui-base-bg-000);filter:drop-shadow(0 2px 4px rgba(0,0,0,.1))}._drop-confirmation-popover--after_obz3t_35:after{top:-8px;bottom:auto;border-top:none;border-bottom:8px solid var(--rp-ui-base-bg-000)}._drop-confirmation-popover__button_obz3t_59{display:block;width:100%;padding:8px 16px;border:none;border-radius:3px;background:none;font-size:13px;text-align:left;cursor:pointer;color:var(--rp-ui-base-almost-black);transition:background-color .15s ease}._drop-confirmation-popover__button_obz3t_59:hover{background-color:var(--rp-ui-color-primary-hover)}._drop-confirmation-popover__divider_obz3t_75{display:block;height:1px;margin:5px 16px;background:var(--rp-ui-divider-bg)}._tree-sortable-item_c3l7m_16{position:relative;transition:opacity .2s ease}._tree-sortable-item--dragging_c3l7m_20{opacity:.5}._tree-sortable-item--pending_c3l7m_23{opacity:.5;pointer-events:none;-webkit-user-select:none;user-select:none;cursor:not-allowed}._tree-sortable-item--drop-before_c3l7m_29:before{content:"";position:absolute;left:0;right:0;height:2px;background-color:var(--rp-ui-color-primary-focused);z-index:10;top:0}._tree-sortable-item--drop-after_c3l7m_39:after{content:"";position:absolute;left:0;right:0;height:2px;background-color:var(--rp-ui-color-primary-focused);z-index:10;bottom:0}._tree-sortable-item--drop-inside_c3l7m_49{position:relative}._tree-sortable-item--drop-inside_c3l7m_49:before{content:"";position:absolute;top:0;left:0;right:0;bottom:0;border:2px dashed var(--rp-ui-color-primary-focused);border-radius:4px;pointer-events:none;z-index:1}._tree-sortable-item--drop-inside_c3l7m_49 ._tree-sortable-item_c3l7m_16:before{display:none}._system-alert_jbf1d_1{display:flex;box-sizing:border-box;width:600px;padding:16px;gap:16px;border-radius:16px;justify-content:space-between;box-shadow:var(--rp-ui-base-shadow-secondary)}._system-alert--black_jbf1d_11 svg path{fill:var(--rp-ui-base-almost-black)!important}._system-alert_jbf1d_1._error_jbf1d_14{background-color:var(--rp-ui-base-sm-error)}._system-alert_jbf1d_1._success_jbf1d_17{background-color:var(--rp-ui-base-test-execution-status-passed)}._system-alert_jbf1d_1._info_jbf1d_20{background-color:var(--rp-ui-base-no-defect-bug-group)}._system-alert_jbf1d_1._warning_jbf1d_23{background-color:var(--rp-ui-base-defect-type-AB)}._system-alert_jbf1d_1 ._icon-wrapper_jbf1d_26{width:20px;height:24px;display:grid;place-content:center}._system-alert_jbf1d_1 ._content-wrapper_jbf1d_32{display:flex;gap:16px;flex-direction:column;flex:1}._system-alert_jbf1d_1 ._content-wrapper_jbf1d_32 ._title_jbf1d_38{text-align:start;font-family:var(--rp-ui-base-font-family);font-size:15px;line-height:24px;font-weight:var(--rp-ui-base-fw-semi-bold);display:-webkit-box;max-width:100%;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}._system-alert_jbf1d_1 ._content-wrapper_jbf1d_32 ._title--white_jbf1d_50{color:var(--rp-ui-base-bg-000)}._system-alert_jbf1d_1 ._content-wrapper_jbf1d_32 ._title--black_jbf1d_53{color:var(--rp-ui-base-almost-black)}._system-alert_jbf1d_1 ._close-button_jbf1d_56{background:none;border:none;width:24px;height:24px;cursor:pointer}._system-alert_jbf1d_1 ._close-button_jbf1d_56 svg path{fill:var(--rp-ui-base-bg-000)}._tooltip-wrapper_lwpn2_16{display:block;width:100%;height:fit-content;cursor:pointer}._tooltip-content_lwpn2_23{font-size:11px;line-height:16px;padding:16px;border-radius:8px;background-color:var(--rp-ui-base-tooltip-bg);font-family:var(--rp-ui-base-font-family);font-weight:var(--rp-ui-base-fw-medium);color:var(--rp-ui-base-bg-000);word-wrap:break-word;white-space:pre-wrap;box-sizing:border-box;width:100%}
|