@reportportal/ui-kit 0.0.1-alpha.135 → 0.0.1-alpha.137
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/adaptiveTagList.js +189 -0
- package/dist/common/constants/sortable.d.ts +1 -0
- package/dist/common/hooks/index.d.ts +1 -0
- package/dist/common/hooks/useSortable.d.ts +3 -0
- package/dist/common/types/index.d.ts +2 -0
- package/dist/common/types/sortableTypes.d.ts +69 -0
- package/dist/common/utils/testUtils.d.ts +3 -0
- package/dist/components/adaptiveTagList/adaptiveTagList.d.ts +11 -0
- package/dist/components/adaptiveTagList/constants.d.ts +6 -0
- package/dist/components/adaptiveTagList/index.d.ts +2 -0
- package/dist/components/autocompletes/multipleAutocomplete/selectedItems/selectedItems.d.ts +1 -1
- package/dist/components/dropdown/constants.d.ts +1 -0
- package/dist/components/dropdown/dropdown.d.ts +2 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/sortable/dragLayer/dragLayer.d.ts +3 -0
- package/dist/components/sortable/dragLayer/index.d.ts +1 -0
- package/dist/components/sortable/helpers.d.ts +4 -0
- package/dist/components/sortable/index.d.ts +3 -0
- package/dist/components/sortable/sortableItem/index.d.ts +1 -0
- package/dist/components/sortable/sortableItem/sortableItem.d.ts +3 -0
- package/dist/components/sortable/sortableList/index.d.ts +1 -0
- package/dist/components/sortable/sortableList/sortableList.d.ts +5 -0
- package/dist/{datePicker-926c9cae.js → datePicker-341db7a5.js} +1 -1
- package/dist/datePicker.js +8 -4
- package/dist/dropdown-0a043606.js +586 -0
- package/dist/dropdown.js +7 -3
- package/dist/index.js +148 -140
- package/dist/modal.js +17 -13
- package/dist/sortable.js +160 -0
- package/dist/style.css +1 -1
- package/package.json +3 -1
- package/dist/dropdown-360803d5.js +0 -550
- /package/dist/common/{types.d.ts → types/commonTypes.d.ts} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,49 +1,52 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { B as
|
|
4
|
-
import { B } from "./
|
|
5
|
-
import { B as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import { AdaptiveTagList as C } from "./adaptiveTagList.js";
|
|
2
|
+
import { A as D } from "./index-1a874a8b.js";
|
|
3
|
+
import { B as y } from "./baseIconButton-251479f7.js";
|
|
4
|
+
import { B as A } from "./breadcrumbs-8e5ca8d7.js";
|
|
5
|
+
import { B as h } from "./bubblesLoader-f3ffa240.js";
|
|
6
|
+
import { B as M } from "./button-97d9e587.js";
|
|
7
|
+
import { C as L } from "./checkbox-ed6cc375.js";
|
|
8
|
+
import { D as E } from "./datePicker-341db7a5.js";
|
|
8
9
|
import "react-datepicker";
|
|
9
|
-
import { D as
|
|
10
|
-
import { FieldLabel as
|
|
11
|
-
import { F as
|
|
12
|
-
import { F as
|
|
13
|
-
import { F as
|
|
14
|
-
import { FileDropArea as
|
|
15
|
-
import { FiltersButton as
|
|
16
|
-
import { Modal as
|
|
17
|
-
import { MultipleAutocomplete as
|
|
18
|
-
import { P as
|
|
19
|
-
import { Popover as
|
|
20
|
-
import { R as
|
|
21
|
-
import { S as
|
|
22
|
-
import { S as
|
|
23
|
-
import { SystemAlert as
|
|
24
|
-
import { S as
|
|
25
|
-
import {
|
|
26
|
-
import { T as
|
|
27
|
-
import { T as
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import { S as
|
|
33
|
-
import { S as
|
|
34
|
-
import { S as
|
|
35
|
-
import { S as
|
|
36
|
-
import { S as
|
|
37
|
-
import { S as wr } from "./
|
|
38
|
-
import { S as
|
|
39
|
-
import { S as
|
|
40
|
-
import { S as
|
|
41
|
-
import { S as
|
|
42
|
-
import { S as
|
|
43
|
-
import { S as
|
|
10
|
+
import { D as O } from "./dropdown-0a043606.js";
|
|
11
|
+
import { FieldLabel as H } from "./fieldLabel.js";
|
|
12
|
+
import { F as N } from "./fieldNumber-d1b5a7a1.js";
|
|
13
|
+
import { F as G } from "./fieldText-1749da7a.js";
|
|
14
|
+
import { F as X } from "./fieldTextFlex-2f51c173.js";
|
|
15
|
+
import { FileDropArea as q } from "./fileDropArea.js";
|
|
16
|
+
import { FiltersButton as Q } from "./filtersButton.js";
|
|
17
|
+
import { Modal as Y } from "./modal.js";
|
|
18
|
+
import { MultipleAutocomplete as _, SingleAutocomplete as $ } from "./autocompletes.js";
|
|
19
|
+
import { P as ro } from "./pagination-a3dee614.js";
|
|
20
|
+
import { Popover as to } from "./popover.js";
|
|
21
|
+
import { R as no } from "./radio-62546efa.js";
|
|
22
|
+
import { S as po } from "./selection-9124d029.js";
|
|
23
|
+
import { S as mo } from "./spinLoader-c4a53718.js";
|
|
24
|
+
import { SystemAlert as Io } from "./systemAlert.js";
|
|
25
|
+
import { S as xo } from "./systemMessage-924fdaa6.js";
|
|
26
|
+
import { DragLayer as uo, SortableItem as So, SortableList as Po } from "./sortable.js";
|
|
27
|
+
import { T as Co } from "./table-fc9f095d.js";
|
|
28
|
+
import { T as Do } from "./themeProvider-46c2be7b.js";
|
|
29
|
+
import { T as yo } from "./toggle-304107fa.js";
|
|
30
|
+
import { Tooltip as Ao } from "./tooltip.js";
|
|
31
|
+
import { SidePanel as ho } from "./sidePanel.js";
|
|
32
|
+
import { AddCsvIcon as Mo, AddImageIcon as wo, AddJarIcon as Lo, BreadcrumbsTreeIcon as ko, CalendarIcon as Eo, CheckmarkIcon as Ro, ChevronRightBreadcrumbsIcon as Oo, ConfigurationIcon as Uo, CopyIcon as Ho, CoverageFullIcon as Jo, CoveragePartialIcon as No, CoveredManuallyIcon as zo, DeleteIcon as Go, DragAndDropIcon as Wo, DragNDropIcon as Xo, DurationIcon as jo, EditIcon as qo, ExportIcon as Ko, FlagIcon as Qo, GroupByIcon as Vo, HideIcon as Yo, LaunchTypeIcon as Zo, MaximizeIcon as _o, MoveToFolderIcon as $o, PinFilledIcon as or, PinOutlineIcon as rr, PriorityBlockerIcon as er, PriorityCriticalIcon as tr, PriorityHighIcon as ar, PriorityLowIcon as nr, PriorityMediumIcon as cr, PriorityUnspecifiedIcon as pr, RefreshIcon as ir, RerunIcon as mr, RunManualIcon as sr, SearchIcon as Ir, SortIcon as lr, StatusSuccessIcon as xr, TestPlanIcon as fr, UserIcon as dr, WarningIcon as ur } from "./icons.js";
|
|
33
|
+
import { S as Pr, a as gr, b as Cr } from "./chevronDownDropdown-66f5b1af.js";
|
|
34
|
+
import { S as Dr } from "./calendarArrow-44c7e60e.js";
|
|
35
|
+
import { S as yr } from "./clear-53660571.js";
|
|
36
|
+
import { S as Ar, a as Br } from "./openEye-950159cb.js";
|
|
37
|
+
import { S as vr } from "./close-4d480ef7.js";
|
|
38
|
+
import { S as wr, a as Lr, b as kr, c as Er, d as Rr, e as Or, f as Ur } from "./xls-995781cc.js";
|
|
39
|
+
import { S as Jr } from "./dropdown-0260bb66.js";
|
|
40
|
+
import { S as zr, a as Gr, b as Wr } from "./success-8fd8bd2c.js";
|
|
41
|
+
import { S as jr, a as qr } from "./filterOutline-819b4b0d.js";
|
|
42
|
+
import { S as Qr, a as Vr } from "./tree-c3dd3d45.js";
|
|
43
|
+
import { S as Zr } from "./minus-2857540f.js";
|
|
44
|
+
import { S as $r } from "./plus-199fb2a8.js";
|
|
45
|
+
import { S as re, a as ee } from "./prevPage-87faf576.js";
|
|
44
46
|
import "react/jsx-runtime";
|
|
45
47
|
import "react";
|
|
46
48
|
import "./bind-06a7ff84.js";
|
|
49
|
+
import "./isEmpty-ccacb5ff.js";
|
|
47
50
|
import "./keyCodes-f63c0e11.js";
|
|
48
51
|
import "react-datepicker/dist/es/index.js";
|
|
49
52
|
import "react-dom";
|
|
@@ -51,107 +54,112 @@ import "@floating-ui/react-dom";
|
|
|
51
54
|
import "downshift";
|
|
52
55
|
import "rc-scrollbars";
|
|
53
56
|
import "./maxValueDisplay-9be01a75.js";
|
|
54
|
-
import "./isEmpty-ccacb5ff.js";
|
|
55
57
|
import "react-dropzone";
|
|
56
58
|
import "framer-motion";
|
|
59
|
+
import "react-dnd";
|
|
60
|
+
import "react-dnd-html5-backend";
|
|
57
61
|
import "@floating-ui/react";
|
|
58
62
|
import "./floatingUi-41f8c7b5.js";
|
|
59
63
|
export {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
H as
|
|
100
|
-
N as
|
|
101
|
-
G as
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
mo as
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
64
|
+
C as AdaptiveTagList,
|
|
65
|
+
Mo as AddCsvIcon,
|
|
66
|
+
wo as AddImageIcon,
|
|
67
|
+
Lo as AddJarIcon,
|
|
68
|
+
Pr as ArrowDownIcon,
|
|
69
|
+
gr as ArrowUpIcon,
|
|
70
|
+
D as AttachedFile,
|
|
71
|
+
y as BaseIconButton,
|
|
72
|
+
A as Breadcrumbs,
|
|
73
|
+
ko as BreadcrumbsTreeIcon,
|
|
74
|
+
h as BubblesLoader,
|
|
75
|
+
M as Button,
|
|
76
|
+
Dr as CalendarArrowIcon,
|
|
77
|
+
Eo as CalendarIcon,
|
|
78
|
+
L as Checkbox,
|
|
79
|
+
Ro as CheckmarkIcon,
|
|
80
|
+
Cr as ChevronDownDropdownIcon,
|
|
81
|
+
Oo as ChevronRightBreadcrumbsIcon,
|
|
82
|
+
yr as ClearIcon,
|
|
83
|
+
Ar as CloseEyeIcon,
|
|
84
|
+
vr as CloseIcon,
|
|
85
|
+
Uo as ConfigurationIcon,
|
|
86
|
+
Ho as CopyIcon,
|
|
87
|
+
Jo as CoverageFullIcon,
|
|
88
|
+
No as CoveragePartialIcon,
|
|
89
|
+
zo as CoveredManuallyIcon,
|
|
90
|
+
wr as CsvIcon,
|
|
91
|
+
E as DatePicker,
|
|
92
|
+
Go as DeleteIcon,
|
|
93
|
+
Wo as DragAndDropIcon,
|
|
94
|
+
uo as DragLayer,
|
|
95
|
+
Xo as DragNDropIcon,
|
|
96
|
+
O as Dropdown,
|
|
97
|
+
Jr as DropdownIcon,
|
|
98
|
+
jo as DurationIcon,
|
|
99
|
+
qo as EditIcon,
|
|
100
|
+
zr as ErrorIcon,
|
|
101
|
+
Ko as ExportIcon,
|
|
102
|
+
Lr as ExternalLinkIcon,
|
|
103
|
+
H as FieldLabel,
|
|
104
|
+
N as FieldNumber,
|
|
105
|
+
G as FieldText,
|
|
106
|
+
X as FieldTextFlex,
|
|
107
|
+
q as FileDropArea,
|
|
108
|
+
kr as FileOtherIcon,
|
|
109
|
+
jr as FilterFilledIcon,
|
|
110
|
+
qr as FilterOutlineIcon,
|
|
111
|
+
Q as FiltersButton,
|
|
112
|
+
Qo as FlagIcon,
|
|
113
|
+
Vo as GroupByIcon,
|
|
114
|
+
Yo as HideIcon,
|
|
115
|
+
Er as ImageIcon,
|
|
116
|
+
Gr as InfoIcon,
|
|
117
|
+
Rr as JarIcon,
|
|
118
|
+
Zo as LaunchTypeIcon,
|
|
119
|
+
_o as MaximizeIcon,
|
|
120
|
+
Qr as MeatballMenuIcon,
|
|
121
|
+
Zr as MinusIcon,
|
|
122
|
+
Y as Modal,
|
|
123
|
+
$o as MoveToFolderIcon,
|
|
124
|
+
_ as MultipleAutocomplete,
|
|
125
|
+
Br as OpenEyeIcon,
|
|
126
|
+
ro as Pagination,
|
|
127
|
+
Or as PdfIcon,
|
|
128
|
+
or as PinFilledIcon,
|
|
129
|
+
rr as PinOutlineIcon,
|
|
130
|
+
$r as PlusIcon,
|
|
131
|
+
to as Popover,
|
|
132
|
+
re as PrevChapterIcon,
|
|
133
|
+
ee as PrevPageIcon,
|
|
134
|
+
er as PriorityBlockerIcon,
|
|
135
|
+
tr as PriorityCriticalIcon,
|
|
136
|
+
ar as PriorityHighIcon,
|
|
137
|
+
nr as PriorityLowIcon,
|
|
138
|
+
cr as PriorityMediumIcon,
|
|
139
|
+
pr as PriorityUnspecifiedIcon,
|
|
140
|
+
no as Radio,
|
|
141
|
+
ir as RefreshIcon,
|
|
142
|
+
mr as RerunIcon,
|
|
143
|
+
sr as RunManualIcon,
|
|
144
|
+
Ir as SearchIcon,
|
|
145
|
+
po as Selection,
|
|
146
|
+
ho as SidePanel,
|
|
147
|
+
$ as SingleAutocomplete,
|
|
148
|
+
lr as SortIcon,
|
|
149
|
+
So as SortableItem,
|
|
150
|
+
Po as SortableList,
|
|
151
|
+
mo as SpinLoader,
|
|
152
|
+
xr as StatusSuccessIcon,
|
|
153
|
+
Wr as SuccessIcon,
|
|
154
|
+
Io as SystemAlert,
|
|
155
|
+
xo as SystemMessage,
|
|
156
|
+
Co as Table,
|
|
157
|
+
fr as TestPlanIcon,
|
|
158
|
+
Do as ThemeProvider,
|
|
159
|
+
yo as Toggle,
|
|
160
|
+
Ao as Tooltip,
|
|
161
|
+
Vr as TreeIcon,
|
|
162
|
+
dr as UserIcon,
|
|
163
|
+
ur as WarningIcon,
|
|
164
|
+
Ur as XlsIcon
|
|
157
165
|
};
|
package/dist/modal.js
CHANGED
|
@@ -3,7 +3,9 @@ import { useRef as C, useEffect as w, useState as y, useMemo as G } from "react"
|
|
|
3
3
|
import { Scrollbars as K } from "rc-scrollbars";
|
|
4
4
|
import { AnimatePresence as U, motion as Y } from "framer-motion";
|
|
5
5
|
import { c as x } from "./bind-06a7ff84.js";
|
|
6
|
-
import
|
|
6
|
+
import "react-dnd";
|
|
7
|
+
import "react-dnd-html5-backend";
|
|
8
|
+
import { a as X } from "./dropdown-0a043606.js";
|
|
7
9
|
import { K as J } from "./keyCodes-f63c0e11.js";
|
|
8
10
|
import { B as D } from "./button-97d9e587.js";
|
|
9
11
|
import { Tooltip as Q } from "./tooltip.js";
|
|
@@ -15,6 +17,8 @@ import "downshift";
|
|
|
15
17
|
import "./clear-53660571.js";
|
|
16
18
|
import "./dropdown-0260bb66.js";
|
|
17
19
|
import "./fieldLabel.js";
|
|
20
|
+
import "./adaptiveTagList.js";
|
|
21
|
+
import "./isEmpty-ccacb5ff.js";
|
|
18
22
|
import "./checkbox-ed6cc375.js";
|
|
19
23
|
import "@floating-ui/react";
|
|
20
24
|
import "./floatingUi-41f8c7b5.js";
|
|
@@ -59,7 +63,7 @@ const et = () => {
|
|
|
59
63
|
"modal-footer": "_modal-footer_1mwne_12",
|
|
60
64
|
"with-extra-node": "_with-extra-node_1mwne_19",
|
|
61
65
|
"size-small": "_size-small_1mwne_23"
|
|
62
|
-
},
|
|
66
|
+
}, p = x.bind(st), lt = ({
|
|
63
67
|
footerNode: e,
|
|
64
68
|
closeHandler: o,
|
|
65
69
|
okButton: n,
|
|
@@ -70,10 +74,10 @@ const et = () => {
|
|
|
70
74
|
const l = /* @__PURE__ */ t(D, { adjustWidthOn: s === "small" ? "parent" : "min-width", ...r });
|
|
71
75
|
return a ? /* @__PURE__ */ t(Q, { content: a, placement: "top", width: 270, children: l }) : l;
|
|
72
76
|
};
|
|
73
|
-
return /* @__PURE__ */ u("div", { className:
|
|
77
|
+
return /* @__PURE__ */ u("div", { className: p("modal-footer", { "with-extra-node": e, [`size-${s}`]: s }), children: [
|
|
74
78
|
e && e,
|
|
75
|
-
/* @__PURE__ */ u("div", { className:
|
|
76
|
-
c && /* @__PURE__ */ t("div", { className:
|
|
79
|
+
/* @__PURE__ */ u("div", { className: p("buttons-block"), children: [
|
|
80
|
+
c && /* @__PURE__ */ t("div", { className: p("button-container"), children: /* @__PURE__ */ t(
|
|
77
81
|
D,
|
|
78
82
|
{
|
|
79
83
|
variant: "ghost",
|
|
@@ -82,7 +86,7 @@ const et = () => {
|
|
|
82
86
|
...c
|
|
83
87
|
}
|
|
84
88
|
) }),
|
|
85
|
-
n && /* @__PURE__ */ t("div", { className:
|
|
89
|
+
n && /* @__PURE__ */ t("div", { className: p("button-container"), children: d() })
|
|
86
90
|
] })
|
|
87
91
|
] });
|
|
88
92
|
}, at = {
|
|
@@ -91,9 +95,9 @@ const et = () => {
|
|
|
91
95
|
"modal-header-content": "_modal-header-content_w4aaf_14",
|
|
92
96
|
"modal-title": "_modal-title_w4aaf_20",
|
|
93
97
|
"close-modal-icon": "_close-modal-icon_w4aaf_29"
|
|
94
|
-
},
|
|
95
|
-
/* @__PURE__ */ t("div", { className:
|
|
96
|
-
/* @__PURE__ */ t(V, { className:
|
|
98
|
+
}, f = x.bind(at), rt = ({ title: e, onClose: o, withDescription: n = !1 }) => /* @__PURE__ */ u("div", { className: f("modal-header", { "width-description": n }), children: [
|
|
99
|
+
/* @__PURE__ */ t("div", { className: f("modal-header-content"), children: e && /* @__PURE__ */ t("div", { className: f("modal-title"), children: e }) }),
|
|
100
|
+
/* @__PURE__ */ t(V, { className: f("close-modal-icon"), onClick: o, children: /* @__PURE__ */ t(Z, {}) })
|
|
97
101
|
] }), ct = "_modal_yxql5_1", dt = "_description_yxql5_43", mt = "_scrollable_yxql5_53", _t = {
|
|
98
102
|
modal: ct,
|
|
99
103
|
"overlay-default": "_overlay-default_yxql5_12",
|
|
@@ -105,7 +109,7 @@ const et = () => {
|
|
|
105
109
|
"size-default": "_size-default_yxql5_57",
|
|
106
110
|
"size-small": "_size-small_yxql5_69",
|
|
107
111
|
"size-large": "_size-large_yxql5_81"
|
|
108
|
-
}, g = x.bind(_t), ut = 0.9, ht = 32 + 24, wt = 32 + 8,
|
|
112
|
+
}, g = x.bind(_t), ut = 0.9, ht = 32 + 24, wt = 32 + 8, pt = 36 + 16, ft = 32 * 2, Bt = ({
|
|
109
113
|
title: e,
|
|
110
114
|
children: o,
|
|
111
115
|
footerNode: n,
|
|
@@ -124,8 +128,8 @@ const et = () => {
|
|
|
124
128
|
description: m = null
|
|
125
129
|
}) => {
|
|
126
130
|
const [I, N] = y(!1), [L, R] = y(0), [k, $] = y(!1), _ = C(null), A = et(), T = A.height, q = T * ut, b = (T - L) / 2, W = () => {
|
|
127
|
-
let i = q -
|
|
128
|
-
return O || (i = i -
|
|
131
|
+
let i = q - ft;
|
|
132
|
+
return O || (i = i - pt), m ? i = i - wt : i = i - ht, i;
|
|
129
133
|
}, h = () => {
|
|
130
134
|
N(!1);
|
|
131
135
|
}, z = (i) => {
|
|
@@ -183,7 +187,7 @@ const et = () => {
|
|
|
183
187
|
) }) });
|
|
184
188
|
};
|
|
185
189
|
export {
|
|
186
|
-
|
|
190
|
+
Bt as Modal,
|
|
187
191
|
S as ModalContent,
|
|
188
192
|
lt as ModalFooter,
|
|
189
193
|
rt as ModalHeader
|
package/dist/sortable.js
ADDED
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { c as I } from "./bind-06a7ff84.js";
|
|
3
|
+
import { useEffect as O, useCallback as x } from "react";
|
|
4
|
+
import { useDrag as S, useDrop as T, useDragLayer as h } from "react-dnd";
|
|
5
|
+
import { getEmptyImage as E } from "react-dnd-html5-backend";
|
|
6
|
+
import { createPortal as L } from "react-dom";
|
|
7
|
+
const D = "SORTABLE_ITEM", w = ({
|
|
8
|
+
id: e,
|
|
9
|
+
index: r,
|
|
10
|
+
type: s = D,
|
|
11
|
+
isDisabled: i = !1,
|
|
12
|
+
onDrop: l,
|
|
13
|
+
hideDefaultPreview: c = !1
|
|
14
|
+
}) => {
|
|
15
|
+
const [{ isDragging: d }, g, a] = S(
|
|
16
|
+
() => ({
|
|
17
|
+
type: s,
|
|
18
|
+
item: { id: e, index: r, type: s },
|
|
19
|
+
collect: (p) => ({
|
|
20
|
+
isDragging: p.isDragging()
|
|
21
|
+
}),
|
|
22
|
+
canDrag: () => !i
|
|
23
|
+
}),
|
|
24
|
+
[e, r, s, i]
|
|
25
|
+
);
|
|
26
|
+
O(() => {
|
|
27
|
+
c && a(E(), { captureDraggingState: !0 });
|
|
28
|
+
}, [c, a]);
|
|
29
|
+
const [{ isOver: o, draggedItemIndex: t }, n] = T(
|
|
30
|
+
() => ({
|
|
31
|
+
accept: s,
|
|
32
|
+
collect: (p) => {
|
|
33
|
+
const m = p.getItem(), b = (m == null ? void 0 : m.id) !== e ? p.isOver() : !1;
|
|
34
|
+
return {
|
|
35
|
+
isOver: b,
|
|
36
|
+
draggedItemIndex: b ? (m == null ? void 0 : m.index) ?? null : null
|
|
37
|
+
};
|
|
38
|
+
},
|
|
39
|
+
drop: (p) => {
|
|
40
|
+
p.id !== e && l && l(p.index, r);
|
|
41
|
+
}
|
|
42
|
+
}),
|
|
43
|
+
[e, r, s, l]
|
|
44
|
+
), _ = (() => t === null ? null : t > r ? "top" : "bottom")();
|
|
45
|
+
return {
|
|
46
|
+
isDragging: d,
|
|
47
|
+
isOver: o,
|
|
48
|
+
draggedItemIndex: t,
|
|
49
|
+
dropPosition: _,
|
|
50
|
+
dragRef: g,
|
|
51
|
+
dropRef: n,
|
|
52
|
+
previewRef: a
|
|
53
|
+
};
|
|
54
|
+
}, P = {
|
|
55
|
+
"sortable-item": "_sortable-item_8p4ra_1",
|
|
56
|
+
"sortable-item--drop-target-top": "_sortable-item--drop-target-top_8p4ra_6",
|
|
57
|
+
"sortable-item--drop-target-bottom": "_sortable-item--drop-target-bottom_8p4ra_17",
|
|
58
|
+
"drag-handle": "_drag-handle_8p4ra_29",
|
|
59
|
+
"drag-handle--disabled": "_drag-handle--disabled_8p4ra_36"
|
|
60
|
+
}, C = I.bind(P), N = ({
|
|
61
|
+
id: e,
|
|
62
|
+
index: r,
|
|
63
|
+
type: s = D,
|
|
64
|
+
isDisabled: i = !1,
|
|
65
|
+
className: l,
|
|
66
|
+
draggingClassName: c,
|
|
67
|
+
dropTargetClassName: d,
|
|
68
|
+
onDrop: g,
|
|
69
|
+
hideDefaultPreview: a = !1,
|
|
70
|
+
children: o
|
|
71
|
+
}) => {
|
|
72
|
+
const { isDragging: t, dropPosition: n, dragRef: f, dropRef: _, previewRef: p } = w({
|
|
73
|
+
id: e,
|
|
74
|
+
index: r,
|
|
75
|
+
type: s,
|
|
76
|
+
isDisabled: i,
|
|
77
|
+
onDrop: g,
|
|
78
|
+
hideDefaultPreview: a
|
|
79
|
+
}), m = typeof o == "function", y = C("sortable-item", l, {
|
|
80
|
+
"sortable-item--dragging": t,
|
|
81
|
+
"sortable-item--drop-target-top": n === "top",
|
|
82
|
+
"sortable-item--drop-target-bottom": n === "bottom",
|
|
83
|
+
[c || ""]: t && c,
|
|
84
|
+
[d || ""]: n && d
|
|
85
|
+
});
|
|
86
|
+
return /* @__PURE__ */ u("div", { ref: (v) => {
|
|
87
|
+
_(v), a || p(v), m || f(v);
|
|
88
|
+
}, className: y, children: m ? o({
|
|
89
|
+
isDragging: t,
|
|
90
|
+
isOver: n !== null,
|
|
91
|
+
dragRef: f
|
|
92
|
+
}) : o });
|
|
93
|
+
}, W = ({
|
|
94
|
+
items: e,
|
|
95
|
+
type: r = D,
|
|
96
|
+
isDisabled: s = !1,
|
|
97
|
+
className: i,
|
|
98
|
+
itemClassName: l,
|
|
99
|
+
onReorder: c,
|
|
100
|
+
renderItem: d,
|
|
101
|
+
keyExtractor: g = (a) => a.id
|
|
102
|
+
}) => {
|
|
103
|
+
const a = x(
|
|
104
|
+
(o, t) => {
|
|
105
|
+
const n = [...e], [f] = n.splice(o, 1);
|
|
106
|
+
n.splice(t, 0, f), c(n);
|
|
107
|
+
},
|
|
108
|
+
[e, c]
|
|
109
|
+
);
|
|
110
|
+
return /* @__PURE__ */ u("div", { className: i, children: e.map((o, t) => /* @__PURE__ */ u(
|
|
111
|
+
N,
|
|
112
|
+
{
|
|
113
|
+
id: g(o),
|
|
114
|
+
index: t,
|
|
115
|
+
type: r,
|
|
116
|
+
isDisabled: s,
|
|
117
|
+
className: l,
|
|
118
|
+
onDrop: a,
|
|
119
|
+
children: ({ dragRef: n, isDragging: f }) => d(o, t, n, f)
|
|
120
|
+
},
|
|
121
|
+
g(o)
|
|
122
|
+
)) });
|
|
123
|
+
}, $ = (e) => {
|
|
124
|
+
if (!e)
|
|
125
|
+
return {
|
|
126
|
+
display: "none"
|
|
127
|
+
};
|
|
128
|
+
const { x: r, y: s } = e, i = `translate(${r}px, ${s}px)`;
|
|
129
|
+
return {
|
|
130
|
+
transform: i,
|
|
131
|
+
WebkitTransform: i
|
|
132
|
+
};
|
|
133
|
+
}, A = {
|
|
134
|
+
"drag-layer": "_drag-layer_1izcx_1",
|
|
135
|
+
"drag-preview": "_drag-preview_1izcx_11"
|
|
136
|
+
}, R = I.bind(A), Y = ({
|
|
137
|
+
type: e,
|
|
138
|
+
renderPreview: r,
|
|
139
|
+
className: s,
|
|
140
|
+
previewClassName: i,
|
|
141
|
+
portalTarget: l = document.body
|
|
142
|
+
}) => {
|
|
143
|
+
const { itemType: c, isDragging: d, item: g, clientOffset: a } = h(
|
|
144
|
+
(t) => ({
|
|
145
|
+
item: t.getItem(),
|
|
146
|
+
itemType: t.getItemType(),
|
|
147
|
+
clientOffset: t.getClientOffset(),
|
|
148
|
+
isDragging: t.isDragging()
|
|
149
|
+
})
|
|
150
|
+
);
|
|
151
|
+
if (!d || c !== e || !g || !l)
|
|
152
|
+
return null;
|
|
153
|
+
const o = /* @__PURE__ */ u("div", { className: R("drag-layer", s), children: /* @__PURE__ */ u("div", { className: R("drag-preview", i), style: $(a), children: r(g) }) });
|
|
154
|
+
return L(o, l);
|
|
155
|
+
};
|
|
156
|
+
export {
|
|
157
|
+
Y as DragLayer,
|
|
158
|
+
N as SortableItem,
|
|
159
|
+
W as SortableList
|
|
160
|
+
};
|