@reportportal/ui-kit 0.0.1-alpha.174 → 0.0.1-alpha.175
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/useTreeSortable.d.ts +1 -1
- package/dist/common/hooks.js +1 -1
- package/dist/common/types/sortableTypes.d.ts +3 -2
- package/dist/components/sortable/treeSortableItem/treeSortableItem.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/segmentedControl.js +28 -28
- package/dist/sortable.js +166 -163
- package/dist/style.css +2 -2
- package/dist/useTreeSortable-694cfbbc.js +184 -0
- package/package.json +1 -1
- package/dist/useTreeSortable-70a9c8f5.js +0 -179
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { UseTreeSortableOptions, UseTreeSortableReturn } from '../types';
|
|
2
2
|
|
|
3
|
-
export declare const useTreeSortable: ({ id, index, parentId, type, isDisabled, acceptDrop, canDropOn, onDrop, hideDefaultPreview, }: UseTreeSortableOptions) => UseTreeSortableReturn;
|
|
3
|
+
export declare const useTreeSortable: ({ id, index, parentId, type, isDisabled, acceptDrop, isLast, canDropOn, onDrop, hideDefaultPreview, }: UseTreeSortableOptions) => UseTreeSortableReturn;
|
package/dist/common/hooks.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { u as E } from "../useOnClickOutside-8f7d68a1.js";
|
|
2
|
-
import { u as A, a as R } from "../useTreeSortable-
|
|
2
|
+
import { u as A, a as R } from "../useTreeSortable-694cfbbc.js";
|
|
3
3
|
import { useCallback as D } from "react";
|
|
4
4
|
import { i as x } from "../isEmpty-ccacb5ff.js";
|
|
5
5
|
import { u as W } from "../useWindowResize-a7e1ac92.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode, Ref } from 'react';
|
|
1
|
+
import { ReactNode, Ref, CSSProperties } from 'react';
|
|
2
2
|
import { XYCoord, ConnectDragSource, ConnectDropTarget, ConnectDragPreview } from 'react-dnd';
|
|
3
3
|
|
|
4
4
|
export interface SortableItemData {
|
|
@@ -101,6 +101,7 @@ export interface UseTreeSortableOptions {
|
|
|
101
101
|
type?: string;
|
|
102
102
|
isDisabled?: boolean;
|
|
103
103
|
acceptDrop?: boolean;
|
|
104
|
+
isLast?: boolean;
|
|
104
105
|
canDropOn?: (draggedItem: TreeDragItem, targetId: string | number) => boolean;
|
|
105
106
|
onDrop?: TreeDropHandler;
|
|
106
107
|
hideDefaultPreview?: boolean;
|
|
@@ -126,8 +127,8 @@ export interface TreeSortableItemProps {
|
|
|
126
127
|
acceptDrop?: boolean;
|
|
127
128
|
isLast?: boolean;
|
|
128
129
|
canDropOn?: (draggedItem: TreeDragItem, targetId: string | number) => boolean;
|
|
129
|
-
depth?: number;
|
|
130
130
|
className?: string;
|
|
131
|
+
style?: CSSProperties;
|
|
131
132
|
draggingClassName?: string;
|
|
132
133
|
dropBeforeClassName?: string;
|
|
133
134
|
dropInsideClassName?: string;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { TreeSortableItemProps } from '../../../common/types';
|
|
2
2
|
|
|
3
|
-
export declare const TreeSortableItem: ({ id, index, parentId, type, isDisabled, acceptDrop, isLast, canDropOn, className, draggingClassName, dropBeforeClassName, dropInsideClassName, dropAfterClassName, onDrop, hideDefaultPreview, children, }: TreeSortableItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare const TreeSortableItem: ({ id, index, parentId, type, isDisabled, acceptDrop, isLast, canDropOn, className, style, draggingClassName, dropBeforeClassName, dropInsideClassName, dropAfterClassName, onDrop, hideDefaultPreview, children, }: TreeSortableItemProps) => import("react/jsx-runtime").JSX.Element;
|
package/dist/index.js
CHANGED
|
@@ -75,7 +75,7 @@ import "./useWindowResize-a7e1ac92.js";
|
|
|
75
75
|
import "@floating-ui/react";
|
|
76
76
|
import "./floatingUi-41f8c7b5.js";
|
|
77
77
|
import "es-toolkit";
|
|
78
|
-
import "./useTreeSortable-
|
|
78
|
+
import "./useTreeSortable-694cfbbc.js";
|
|
79
79
|
import "./common.js";
|
|
80
80
|
import "react-resizable";
|
|
81
81
|
export {
|
package/dist/segmentedControl.js
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as o, useEffect as
|
|
3
|
-
import { c as
|
|
4
|
-
const
|
|
5
|
-
"segmented-control": "_segmented-
|
|
6
|
-
"full-width": "_full-
|
|
7
|
-
button:
|
|
8
|
-
disabled:
|
|
9
|
-
active:
|
|
10
|
-
icon:
|
|
11
|
-
}, c =
|
|
1
|
+
import { jsx as r, jsxs as u } from "react/jsx-runtime";
|
|
2
|
+
import { useState as o, useEffect as v } from "react";
|
|
3
|
+
import { c as z } from "./bind-06a7ff84.js";
|
|
4
|
+
const f = "_button_8evzz_29", N = "_disabled_8evzz_50", w = "_active_8evzz_50", x = "_icon_8evzz_74", h = {
|
|
5
|
+
"segmented-control": "_segmented-control_8evzz_16",
|
|
6
|
+
"full-width": "_full-width_8evzz_24",
|
|
7
|
+
button: f,
|
|
8
|
+
disabled: N,
|
|
9
|
+
active: w,
|
|
10
|
+
icon: x
|
|
11
|
+
}, c = z.bind(h), S = ({
|
|
12
12
|
options: s,
|
|
13
13
|
onChange: l,
|
|
14
|
-
className:
|
|
15
|
-
fullWidth:
|
|
16
|
-
ariaLabel:
|
|
14
|
+
className: n,
|
|
15
|
+
fullWidth: i = !1,
|
|
16
|
+
ariaLabel: _
|
|
17
17
|
}) => {
|
|
18
|
-
const [
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
const [t, d] = o(s);
|
|
19
|
+
v(() => {
|
|
20
|
+
d(s);
|
|
21
21
|
}, [s]);
|
|
22
|
-
const
|
|
22
|
+
const b = (e) => {
|
|
23
23
|
if (!e.disabled && !e.selected) {
|
|
24
|
-
const
|
|
24
|
+
const m = t.map((a) => ({
|
|
25
25
|
...a,
|
|
26
26
|
selected: a.value === e.value
|
|
27
27
|
}));
|
|
28
|
-
|
|
28
|
+
d(m), l == null || l(e.value);
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
|
-
return /* @__PURE__ */
|
|
31
|
+
return /* @__PURE__ */ r(
|
|
32
32
|
"div",
|
|
33
33
|
{
|
|
34
|
-
className: c("segmented-control",
|
|
35
|
-
"full-width":
|
|
34
|
+
className: c("segmented-control", n, {
|
|
35
|
+
"full-width": i
|
|
36
36
|
}),
|
|
37
37
|
role: "group",
|
|
38
|
-
"aria-label":
|
|
39
|
-
children:
|
|
38
|
+
"aria-label": _,
|
|
39
|
+
children: t.map((e) => /* @__PURE__ */ u(
|
|
40
40
|
"button",
|
|
41
41
|
{
|
|
42
42
|
type: "button",
|
|
@@ -44,11 +44,11 @@ const N = "_button_188ud_28", w = "_disabled_188ud_53", x = "_active_188ud_53",
|
|
|
44
44
|
active: e.selected,
|
|
45
45
|
disabled: e.disabled
|
|
46
46
|
}),
|
|
47
|
-
onClick: () =>
|
|
47
|
+
onClick: () => b(e),
|
|
48
48
|
disabled: e.disabled,
|
|
49
49
|
"aria-pressed": e.selected,
|
|
50
50
|
children: [
|
|
51
|
-
e.icon && /* @__PURE__ */
|
|
51
|
+
e.icon && /* @__PURE__ */ r("span", { className: c("icon"), children: e.icon }),
|
|
52
52
|
e.label
|
|
53
53
|
]
|
|
54
54
|
},
|
|
@@ -58,5 +58,5 @@ const N = "_button_188ud_28", w = "_disabled_188ud_53", x = "_active_188ud_53",
|
|
|
58
58
|
);
|
|
59
59
|
};
|
|
60
60
|
export {
|
|
61
|
-
|
|
61
|
+
S as SegmentedControl
|
|
62
62
|
};
|
package/dist/sortable.js
CHANGED
|
@@ -1,184 +1,184 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { c as
|
|
1
|
+
import { jsx as v, jsxs as q } from "react/jsx-runtime";
|
|
2
|
+
import { c as z } from "./bind-06a7ff84.js";
|
|
3
3
|
import { isFunction as j } from "es-toolkit";
|
|
4
|
-
import { useCallback as A, createContext as
|
|
5
|
-
import { u as
|
|
6
|
-
import { useDragLayer as
|
|
4
|
+
import { useCallback as A, createContext as ee, useContext as te, useState as H, useRef as J } from "react";
|
|
5
|
+
import { u as re, D as F, g as oe, a as se } from "./useTreeSortable-694cfbbc.js";
|
|
6
|
+
import { useDragLayer as ie } from "react-dnd";
|
|
7
7
|
import "react-dnd-html5-backend";
|
|
8
|
-
import { DROP_DETECTION_MODE as X, DROP_POSITIONS as Y, DROP_ACTIONS as
|
|
8
|
+
import { DROP_DETECTION_MODE as X, DROP_POSITIONS as Y, DROP_ACTIONS as m, TREE_DROP_POSITIONS as h } from "./common.js";
|
|
9
9
|
import { createPortal as K } from "react-dom";
|
|
10
|
-
import { u as
|
|
11
|
-
const
|
|
10
|
+
import { u as ne } from "./useOnClickOutside-8f7d68a1.js";
|
|
11
|
+
const ae = {
|
|
12
12
|
"sortable-item": "_sortable-item_b58jz_16",
|
|
13
13
|
"sortable-item--drop-target-top": "_sortable-item--drop-target-top_b58jz_22",
|
|
14
14
|
"sortable-item--drop-target-bottom": "_sortable-item--drop-target-bottom_b58jz_35",
|
|
15
15
|
"sortable-item--hover-mode": "_sortable-item--hover-mode_b58jz_48",
|
|
16
16
|
"drag-handle": "_drag-handle_b58jz_65",
|
|
17
17
|
"drag-handle--disabled": "_drag-handle--disabled_b58jz_72"
|
|
18
|
-
},
|
|
18
|
+
}, le = z.bind(ae), pe = ({
|
|
19
19
|
id: n,
|
|
20
|
-
index:
|
|
21
|
-
type:
|
|
22
|
-
isDisabled:
|
|
20
|
+
index: b,
|
|
21
|
+
type: E = F,
|
|
22
|
+
isDisabled: O = !1,
|
|
23
23
|
className: o,
|
|
24
24
|
draggingClassName: a,
|
|
25
|
-
dropTargetClassName:
|
|
25
|
+
dropTargetClassName: l,
|
|
26
26
|
onDrop: e,
|
|
27
|
-
hideDefaultPreview:
|
|
27
|
+
hideDefaultPreview: d = !1,
|
|
28
28
|
dropDetectionMode: s = X.INDEX_BASED,
|
|
29
|
-
isLast:
|
|
29
|
+
isLast: r = !1,
|
|
30
30
|
children: i
|
|
31
31
|
}) => {
|
|
32
|
-
const { isDragging:
|
|
32
|
+
const { isDragging: p, dropPosition: _, dragRef: T, dropRef: y, previewRef: P } = re({
|
|
33
33
|
id: n,
|
|
34
|
-
index:
|
|
35
|
-
type:
|
|
36
|
-
isDisabled:
|
|
34
|
+
index: b,
|
|
35
|
+
type: E,
|
|
36
|
+
isDisabled: O,
|
|
37
37
|
onDrop: e,
|
|
38
|
-
hideDefaultPreview:
|
|
38
|
+
hideDefaultPreview: d,
|
|
39
39
|
dropDetectionMode: s,
|
|
40
|
-
isLast:
|
|
41
|
-
}),
|
|
42
|
-
"sortable-item--dragging":
|
|
43
|
-
"sortable-item--hover-mode":
|
|
44
|
-
"sortable-item--drop-target-top":
|
|
45
|
-
"sortable-item--drop-target-bottom":
|
|
46
|
-
[a || ""]:
|
|
47
|
-
[
|
|
40
|
+
isLast: r
|
|
41
|
+
}), t = j(i), g = s === X.HOVER, I = le("sortable-item", o, {
|
|
42
|
+
"sortable-item--dragging": p,
|
|
43
|
+
"sortable-item--hover-mode": g,
|
|
44
|
+
"sortable-item--drop-target-top": _ === Y.TOP,
|
|
45
|
+
"sortable-item--drop-target-bottom": _ === Y.BOTTOM,
|
|
46
|
+
[a || ""]: p && a,
|
|
47
|
+
[l || ""]: _ && l
|
|
48
48
|
});
|
|
49
|
-
return /* @__PURE__ */
|
|
50
|
-
|
|
51
|
-
}, className:
|
|
52
|
-
isDragging:
|
|
53
|
-
isOver:
|
|
54
|
-
dragRef:
|
|
49
|
+
return /* @__PURE__ */ v("div", { ref: (c) => {
|
|
50
|
+
y(c), d || P(c), t || T(c);
|
|
51
|
+
}, className: I, children: t ? i({
|
|
52
|
+
isDragging: p,
|
|
53
|
+
isOver: _ !== null,
|
|
54
|
+
dragRef: T
|
|
55
55
|
}) : i });
|
|
56
56
|
}, Re = ({
|
|
57
57
|
items: n,
|
|
58
|
-
type:
|
|
59
|
-
isDisabled:
|
|
60
|
-
className:
|
|
58
|
+
type: b = F,
|
|
59
|
+
isDisabled: E = !1,
|
|
60
|
+
className: O,
|
|
61
61
|
itemClassName: o,
|
|
62
62
|
onReorder: a,
|
|
63
|
-
renderItem:
|
|
64
|
-
keyExtractor: e = (
|
|
63
|
+
renderItem: l,
|
|
64
|
+
keyExtractor: e = (d) => d.id
|
|
65
65
|
}) => {
|
|
66
|
-
const
|
|
67
|
-
(s,
|
|
68
|
-
const i = [...n], [
|
|
69
|
-
i.splice(
|
|
66
|
+
const d = A(
|
|
67
|
+
(s, r) => {
|
|
68
|
+
const i = [...n], [p] = i.splice(s, 1);
|
|
69
|
+
i.splice(r, 0, p), a(i);
|
|
70
70
|
},
|
|
71
71
|
[n, a]
|
|
72
72
|
);
|
|
73
|
-
return /* @__PURE__ */
|
|
74
|
-
|
|
73
|
+
return /* @__PURE__ */ v("div", { className: O, children: n.map((s, r) => /* @__PURE__ */ v(
|
|
74
|
+
pe,
|
|
75
75
|
{
|
|
76
76
|
id: e(s),
|
|
77
|
-
index:
|
|
78
|
-
type:
|
|
79
|
-
isDisabled:
|
|
77
|
+
index: r,
|
|
78
|
+
type: b,
|
|
79
|
+
isDisabled: E,
|
|
80
80
|
className: o,
|
|
81
|
-
onDrop:
|
|
82
|
-
isLast:
|
|
83
|
-
children: ({ dragRef: i, isDragging:
|
|
81
|
+
onDrop: d,
|
|
82
|
+
isLast: r === n.length - 1,
|
|
83
|
+
children: ({ dragRef: i, isDragging: p }) => l(s, r, i, p)
|
|
84
84
|
},
|
|
85
85
|
e(s)
|
|
86
86
|
)) });
|
|
87
|
-
},
|
|
87
|
+
}, de = {
|
|
88
88
|
"drag-layer": "_drag-layer_1izcx_1",
|
|
89
89
|
"drag-preview": "_drag-preview_1izcx_11"
|
|
90
|
-
}, G =
|
|
90
|
+
}, G = z.bind(de), he = ({
|
|
91
91
|
type: n,
|
|
92
|
-
renderPreview:
|
|
93
|
-
className:
|
|
94
|
-
previewClassName:
|
|
92
|
+
renderPreview: b,
|
|
93
|
+
className: E,
|
|
94
|
+
previewClassName: O,
|
|
95
95
|
portalTarget: o = document.body
|
|
96
96
|
}) => {
|
|
97
|
-
const { itemType: a, isDragging:
|
|
98
|
-
(
|
|
99
|
-
item:
|
|
100
|
-
itemType:
|
|
101
|
-
clientOffset:
|
|
102
|
-
isDragging:
|
|
97
|
+
const { itemType: a, isDragging: l, item: e, clientOffset: d } = ie(
|
|
98
|
+
(r) => ({
|
|
99
|
+
item: r.getItem(),
|
|
100
|
+
itemType: r.getItemType(),
|
|
101
|
+
clientOffset: r.getClientOffset(),
|
|
102
|
+
isDragging: r.isDragging()
|
|
103
103
|
})
|
|
104
104
|
);
|
|
105
|
-
if (!
|
|
105
|
+
if (!l || a !== n || !e || !o)
|
|
106
106
|
return null;
|
|
107
|
-
const s = /* @__PURE__ */
|
|
107
|
+
const s = /* @__PURE__ */ v("div", { className: G("drag-layer", E), children: /* @__PURE__ */ v("div", { className: G("drag-preview", O), style: oe(d), children: b(e) }) });
|
|
108
108
|
return K(s, o);
|
|
109
|
-
}, Q =
|
|
109
|
+
}, Q = ee(null), ce = () => te(Q), me = {
|
|
110
110
|
"drop-confirmation-popover": "_drop-confirmation-popover_obz3t_16",
|
|
111
111
|
"drop-confirmation-popover--before": "_drop-confirmation-popover--before_obz3t_31",
|
|
112
112
|
"drop-confirmation-popover--after": "_drop-confirmation-popover--after_obz3t_35",
|
|
113
113
|
"drop-confirmation-popover__button": "_drop-confirmation-popover__button_obz3t_59",
|
|
114
114
|
"drop-confirmation-popover__divider": "_drop-confirmation-popover__divider_obz3t_75"
|
|
115
|
-
}, C =
|
|
116
|
-
[
|
|
117
|
-
[
|
|
118
|
-
[
|
|
115
|
+
}, C = z.bind(me), be = {
|
|
116
|
+
[m.MOVE]: "Move",
|
|
117
|
+
[m.DUPLICATE]: "Duplicate",
|
|
118
|
+
[m.CANCEL]: "Cancel"
|
|
119
119
|
}, Se = ({
|
|
120
120
|
children: n,
|
|
121
|
-
showDropConfirmation:
|
|
122
|
-
confirmationLabels:
|
|
123
|
-
portalTarget:
|
|
121
|
+
showDropConfirmation: b = !1,
|
|
122
|
+
confirmationLabels: E,
|
|
123
|
+
portalTarget: O,
|
|
124
124
|
onMove: o,
|
|
125
125
|
onDuplicate: a,
|
|
126
|
-
onCancel:
|
|
126
|
+
onCancel: l
|
|
127
127
|
}) => {
|
|
128
|
-
const [e,
|
|
128
|
+
const [e, d] = H(null), [s, r] = H(
|
|
129
129
|
null
|
|
130
|
-
), i = J(null),
|
|
131
|
-
|
|
132
|
-
}, []),
|
|
133
|
-
(
|
|
134
|
-
if (!
|
|
135
|
-
o == null || o(
|
|
130
|
+
), i = J(null), p = { ...be, ...E }, _ = A(() => {
|
|
131
|
+
d(null), r(null);
|
|
132
|
+
}, []), T = A(
|
|
133
|
+
(g, I, u, c) => {
|
|
134
|
+
if (!b) {
|
|
135
|
+
o == null || o(g, I, u);
|
|
136
136
|
return;
|
|
137
137
|
}
|
|
138
|
-
const
|
|
139
|
-
let
|
|
140
|
-
|
|
141
|
-
top:
|
|
142
|
-
left:
|
|
143
|
-
}),
|
|
138
|
+
const f = c.getBoundingClientRect(), N = f.left + f.width / 2;
|
|
139
|
+
let R;
|
|
140
|
+
u === "before" ? R = f.top : u === "after" ? R = f.top + f.height : R = f.top, r({
|
|
141
|
+
top: R,
|
|
142
|
+
left: N
|
|
143
|
+
}), d({ draggedItem: g, targetId: I, position: u });
|
|
144
144
|
},
|
|
145
|
-
[
|
|
146
|
-
),
|
|
147
|
-
(
|
|
145
|
+
[b, o]
|
|
146
|
+
), y = A(
|
|
147
|
+
(g) => {
|
|
148
148
|
if (!e) {
|
|
149
|
-
|
|
149
|
+
_();
|
|
150
150
|
return;
|
|
151
151
|
}
|
|
152
|
-
const { draggedItem:
|
|
153
|
-
switch (
|
|
154
|
-
case
|
|
155
|
-
o == null || o(
|
|
152
|
+
const { draggedItem: I, targetId: u, position: c } = e;
|
|
153
|
+
switch (g) {
|
|
154
|
+
case m.MOVE:
|
|
155
|
+
o == null || o(I, u, c);
|
|
156
156
|
break;
|
|
157
|
-
case
|
|
158
|
-
a == null || a(
|
|
157
|
+
case m.DUPLICATE:
|
|
158
|
+
a == null || a(I, u, c);
|
|
159
159
|
break;
|
|
160
|
-
case
|
|
161
|
-
|
|
160
|
+
case m.CANCEL:
|
|
161
|
+
l == null || l();
|
|
162
162
|
break;
|
|
163
163
|
}
|
|
164
|
-
|
|
164
|
+
_();
|
|
165
165
|
},
|
|
166
|
-
[e, o, a,
|
|
166
|
+
[e, o, a, l, _]
|
|
167
167
|
);
|
|
168
|
-
|
|
168
|
+
ne(
|
|
169
169
|
i,
|
|
170
|
-
e &&
|
|
170
|
+
e && b ? () => y(m.CANCEL) : void 0
|
|
171
171
|
);
|
|
172
|
-
const
|
|
173
|
-
showDropConfirmation:
|
|
172
|
+
const P = {
|
|
173
|
+
showDropConfirmation: b,
|
|
174
174
|
pendingDraggedItemId: (e == null ? void 0 : e.draggedItem.id) ?? null,
|
|
175
175
|
pendingTargetId: (e == null ? void 0 : e.targetId) ?? null,
|
|
176
176
|
pendingDropPosition: (e == null ? void 0 : e.position) ?? null,
|
|
177
|
-
requestDrop:
|
|
178
|
-
},
|
|
179
|
-
return /* @__PURE__ */ q(Q.Provider, { value:
|
|
177
|
+
requestDrop: T
|
|
178
|
+
}, t = O ?? (typeof document < "u" ? document.body : null);
|
|
179
|
+
return /* @__PURE__ */ q(Q.Provider, { value: P, children: [
|
|
180
180
|
n,
|
|
181
|
-
e && s &&
|
|
181
|
+
e && s && t && K(
|
|
182
182
|
/* @__PURE__ */ q(
|
|
183
183
|
"div",
|
|
184
184
|
{
|
|
@@ -192,111 +192,114 @@ const ne = {
|
|
|
192
192
|
left: s.left
|
|
193
193
|
},
|
|
194
194
|
children: [
|
|
195
|
-
/* @__PURE__ */
|
|
195
|
+
/* @__PURE__ */ v(
|
|
196
196
|
"button",
|
|
197
197
|
{
|
|
198
198
|
type: "button",
|
|
199
199
|
className: C("drop-confirmation-popover__button"),
|
|
200
|
-
onClick: () =>
|
|
201
|
-
children:
|
|
200
|
+
onClick: () => y(m.MOVE),
|
|
201
|
+
children: p[m.MOVE]
|
|
202
202
|
}
|
|
203
203
|
),
|
|
204
|
-
/* @__PURE__ */
|
|
204
|
+
/* @__PURE__ */ v(
|
|
205
205
|
"button",
|
|
206
206
|
{
|
|
207
207
|
type: "button",
|
|
208
208
|
className: C("drop-confirmation-popover__button"),
|
|
209
|
-
onClick: () =>
|
|
210
|
-
children:
|
|
209
|
+
onClick: () => y(m.DUPLICATE),
|
|
210
|
+
children: p[m.DUPLICATE]
|
|
211
211
|
}
|
|
212
212
|
),
|
|
213
|
-
/* @__PURE__ */
|
|
214
|
-
/* @__PURE__ */
|
|
213
|
+
/* @__PURE__ */ v("div", { className: C("drop-confirmation-popover__divider") }),
|
|
214
|
+
/* @__PURE__ */ v(
|
|
215
215
|
"button",
|
|
216
216
|
{
|
|
217
217
|
type: "button",
|
|
218
218
|
className: C("drop-confirmation-popover__button"),
|
|
219
|
-
onClick: () =>
|
|
220
|
-
children:
|
|
219
|
+
onClick: () => y(m.CANCEL),
|
|
220
|
+
children: p[m.CANCEL]
|
|
221
221
|
}
|
|
222
222
|
)
|
|
223
223
|
]
|
|
224
224
|
}
|
|
225
225
|
),
|
|
226
|
-
|
|
226
|
+
t
|
|
227
227
|
)
|
|
228
228
|
] });
|
|
229
|
-
},
|
|
230
|
-
"tree-sortable-item": "_tree-sortable-
|
|
231
|
-
"tree-sortable-item--dragging": "_tree-sortable-item--
|
|
232
|
-
"tree-sortable-item--pending": "_tree-sortable-item--
|
|
233
|
-
"tree-sortable-item--drop-before": "_tree-sortable-item--drop-
|
|
234
|
-
"tree-sortable-item--drop-after": "_tree-sortable-item--drop-
|
|
235
|
-
"tree-sortable-item--drop-inside": "_tree-sortable-item--drop-
|
|
236
|
-
},
|
|
229
|
+
}, _e = {
|
|
230
|
+
"tree-sortable-item": "_tree-sortable-item_13y35_16",
|
|
231
|
+
"tree-sortable-item--dragging": "_tree-sortable-item--dragging_13y35_20",
|
|
232
|
+
"tree-sortable-item--pending": "_tree-sortable-item--pending_13y35_23",
|
|
233
|
+
"tree-sortable-item--drop-before": "_tree-sortable-item--drop-before_13y35_29",
|
|
234
|
+
"tree-sortable-item--drop-after": "_tree-sortable-item--drop-after_13y35_40",
|
|
235
|
+
"tree-sortable-item--drop-inside": "_tree-sortable-item--drop-inside_13y35_51"
|
|
236
|
+
}, fe = z.bind(_e), Ce = ({
|
|
237
237
|
id: n,
|
|
238
|
-
index:
|
|
239
|
-
parentId:
|
|
240
|
-
type:
|
|
238
|
+
index: b,
|
|
239
|
+
parentId: E,
|
|
240
|
+
type: O = F,
|
|
241
241
|
isDisabled: o = !1,
|
|
242
242
|
acceptDrop: a = !0,
|
|
243
|
-
isLast:
|
|
243
|
+
isLast: l = !1,
|
|
244
244
|
canDropOn: e,
|
|
245
|
-
className:
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
245
|
+
className: d,
|
|
246
|
+
style: s,
|
|
247
|
+
draggingClassName: r,
|
|
248
|
+
dropBeforeClassName: i,
|
|
249
|
+
dropInsideClassName: p,
|
|
250
|
+
dropAfterClassName: _,
|
|
251
|
+
onDrop: T,
|
|
252
|
+
hideDefaultPreview: y = !1,
|
|
253
|
+
children: P
|
|
253
254
|
}) => {
|
|
254
|
-
const
|
|
255
|
+
const t = ce(), g = J(null), I = A(
|
|
255
256
|
(D, $, x) => {
|
|
256
|
-
|
|
257
|
+
t != null && t.showDropConfirmation && g.current ? t.requestDrop(D, $, x, g.current) : T == null || T(D, $, x);
|
|
257
258
|
},
|
|
258
|
-
[
|
|
259
|
-
), { isDragging:
|
|
259
|
+
[t, T]
|
|
260
|
+
), { isDragging: u, isOver: c, dropPosition: f, dragRef: N, dropRef: R, previewRef: W } = se({
|
|
260
261
|
id: n,
|
|
261
|
-
index:
|
|
262
|
-
parentId:
|
|
263
|
-
type:
|
|
262
|
+
index: b,
|
|
263
|
+
parentId: E,
|
|
264
|
+
type: O,
|
|
264
265
|
isDisabled: o,
|
|
265
266
|
acceptDrop: a,
|
|
267
|
+
isLast: l,
|
|
266
268
|
canDropOn: e,
|
|
267
|
-
onDrop:
|
|
268
|
-
hideDefaultPreview:
|
|
269
|
-
}), k = (
|
|
269
|
+
onDrop: I,
|
|
270
|
+
hideDefaultPreview: y
|
|
271
|
+
}), k = (t == null ? void 0 : t.pendingDraggedItemId) === n, w = u || k, S = (t == null ? void 0 : t.pendingTargetId) === n, L = t == null ? void 0 : t.pendingDropPosition, B = c && f === h.BEFORE || S && L === h.BEFORE, U = c && f === h.INSIDE || S && L === h.INSIDE, V = l && (c && f === h.AFTER || S && L === h.AFTER), Z = j(P) ? P({
|
|
270
272
|
isDragging: w,
|
|
271
|
-
isOver:
|
|
272
|
-
dropPosition:
|
|
273
|
-
dragRef:
|
|
274
|
-
}) :
|
|
273
|
+
isOver: c || S,
|
|
274
|
+
dropPosition: S ? L ?? null : f,
|
|
275
|
+
dragRef: N
|
|
276
|
+
}) : P, M = fe("tree-sortable-item", d, {
|
|
275
277
|
"tree-sortable-item--dragging": w,
|
|
276
278
|
"tree-sortable-item--pending": k,
|
|
277
279
|
"tree-sortable-item--drop-before": B,
|
|
278
280
|
"tree-sortable-item--drop-inside": U,
|
|
279
281
|
"tree-sortable-item--drop-after": V,
|
|
280
|
-
[
|
|
281
|
-
[
|
|
282
|
-
[
|
|
283
|
-
[
|
|
282
|
+
[r || ""]: w && r,
|
|
283
|
+
[i || ""]: B && i,
|
|
284
|
+
[p || ""]: U && p,
|
|
285
|
+
[_ || ""]: V && _
|
|
284
286
|
});
|
|
285
|
-
return /* @__PURE__ */
|
|
287
|
+
return /* @__PURE__ */ v(
|
|
286
288
|
"div",
|
|
287
289
|
{
|
|
288
290
|
ref: (D) => {
|
|
289
|
-
|
|
291
|
+
g.current = D, R(D), j(P) || (N(D), W(D));
|
|
290
292
|
},
|
|
291
|
-
className:
|
|
292
|
-
|
|
293
|
+
className: M,
|
|
294
|
+
style: s,
|
|
295
|
+
children: Z
|
|
293
296
|
}
|
|
294
297
|
);
|
|
295
298
|
};
|
|
296
299
|
export {
|
|
297
300
|
he as DragLayer,
|
|
298
|
-
|
|
301
|
+
pe as SortableItem,
|
|
299
302
|
Re as SortableList,
|
|
300
303
|
Se as TreeSortableContainer,
|
|
301
|
-
|
|
304
|
+
Ce as TreeSortableItem
|
|
302
305
|
};
|