@reportportal/ui-kit 0.0.1-alpha.135 → 0.0.1-alpha.136
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/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/autocompletes/multipleAutocomplete/selectedItems/selectedItems.d.ts +1 -1
- package/dist/components/index.d.ts +1 -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/index.js +145 -139
- package/dist/modal.js +4 -2
- package/dist/sortable.js +160 -0
- package/dist/style.css +1 -1
- package/package.json +3 -1
- /package/dist/common/{types.d.ts → types/commonTypes.d.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const DEFAULT_SORTABLE_TYPE = "SORTABLE_ITEM";
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { ReactNode, Ref } from 'react';
|
|
2
|
+
import { XYCoord, ConnectDragSource, ConnectDropTarget, ConnectDragPreview } from 'react-dnd';
|
|
3
|
+
|
|
4
|
+
export interface SortableItemData {
|
|
5
|
+
id: string | number;
|
|
6
|
+
index: number;
|
|
7
|
+
}
|
|
8
|
+
export interface DragItem extends SortableItemData {
|
|
9
|
+
type: string;
|
|
10
|
+
}
|
|
11
|
+
export interface UseSortableOptions {
|
|
12
|
+
id: string | number;
|
|
13
|
+
index: number;
|
|
14
|
+
type?: string;
|
|
15
|
+
isDisabled?: boolean;
|
|
16
|
+
onDrop?: (fromIndex: number, toIndex: number) => void;
|
|
17
|
+
hideDefaultPreview?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface UseSortableReturn {
|
|
20
|
+
isDragging: boolean;
|
|
21
|
+
isOver: boolean;
|
|
22
|
+
draggedItemIndex: number | null;
|
|
23
|
+
dropPosition: 'top' | 'bottom' | null;
|
|
24
|
+
dragRef: ConnectDragSource;
|
|
25
|
+
dropRef: ConnectDropTarget;
|
|
26
|
+
previewRef: ConnectDragPreview;
|
|
27
|
+
}
|
|
28
|
+
export interface SortableItemRenderProps {
|
|
29
|
+
isDragging: boolean;
|
|
30
|
+
isOver: boolean;
|
|
31
|
+
dragRef: Ref<HTMLElement>;
|
|
32
|
+
}
|
|
33
|
+
export interface SortableItemProps {
|
|
34
|
+
id: string | number;
|
|
35
|
+
index: number;
|
|
36
|
+
type?: string;
|
|
37
|
+
isDisabled?: boolean;
|
|
38
|
+
className?: string;
|
|
39
|
+
draggingClassName?: string;
|
|
40
|
+
dropTargetClassName?: string;
|
|
41
|
+
onDrop?: (fromIndex: number, toIndex: number) => void;
|
|
42
|
+
hideDefaultPreview?: boolean;
|
|
43
|
+
children: ReactNode | ((props: SortableItemRenderProps) => ReactNode);
|
|
44
|
+
}
|
|
45
|
+
export interface SortableListProps<T extends {
|
|
46
|
+
id: string | number;
|
|
47
|
+
}> {
|
|
48
|
+
items: T[];
|
|
49
|
+
type?: string;
|
|
50
|
+
isDisabled?: boolean;
|
|
51
|
+
className?: string;
|
|
52
|
+
itemClassName?: string;
|
|
53
|
+
onReorder: (reorderedItems: T[]) => void;
|
|
54
|
+
renderItem: (item: T, index: number, dragRef: Ref<HTMLElement>, isDragging: boolean) => ReactNode;
|
|
55
|
+
keyExtractor?: (item: T) => string | number;
|
|
56
|
+
}
|
|
57
|
+
export interface DragLayerProps {
|
|
58
|
+
type: string;
|
|
59
|
+
renderPreview: (item: DragItem) => ReactNode;
|
|
60
|
+
className?: string;
|
|
61
|
+
previewClassName?: string;
|
|
62
|
+
portalTarget?: Element | null;
|
|
63
|
+
}
|
|
64
|
+
export interface DragLayerCollectedProps {
|
|
65
|
+
item: DragItem | null;
|
|
66
|
+
itemType: string | symbol | null;
|
|
67
|
+
clientOffset: XYCoord | null;
|
|
68
|
+
isDragging: boolean;
|
|
69
|
+
}
|
|
@@ -37,5 +37,5 @@ type SelectedItemsProps<T> = Omit<SelectedItemProps<T>, 'item' | 'editItem'> & {
|
|
|
37
37
|
selectedItemClassName?: string;
|
|
38
38
|
selectedItemTextClassName?: string;
|
|
39
39
|
};
|
|
40
|
-
export declare const SelectedItems: <T>({ items, parseValueToString, getItemValidationErrorType, storedItemsMap, highlightUnStoredItem, renderCustomSelectedItem, selectedItemSingleLine, selectedItemClassName, selectedItemTextClassName, ...props }: SelectedItemsProps<T>) => (string | number | boolean | import("react/jsx-runtime").JSX.Element |
|
|
40
|
+
export declare const SelectedItems: <T>({ items, parseValueToString, getItemValidationErrorType, storedItemsMap, highlightUnStoredItem, renderCustomSelectedItem, selectedItemSingleLine, selectedItemClassName, selectedItemTextClassName, ...props }: SelectedItemsProps<T>) => (string | number | boolean | Iterable<ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined)[];
|
|
41
41
|
export {};
|
|
@@ -22,6 +22,7 @@ export { SpinLoader } from './spinLoader';
|
|
|
22
22
|
export { SystemAlert } from './systemAlert';
|
|
23
23
|
export { SystemMessage } from './systemMessage';
|
|
24
24
|
export { SingleAutocomplete } from './autocompletes/singleAutocomplete';
|
|
25
|
+
export { SortableItem, SortableList, DragLayer } from './sortable';
|
|
25
26
|
export { Table } from './table';
|
|
26
27
|
export { ThemeProvider } from './themeProvider';
|
|
27
28
|
export { Toggle } from './toggle';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DragLayer } from './dragLayer';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SortableItem } from './sortableItem';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { SortableItemProps } from '../../../common/types';
|
|
2
|
+
|
|
3
|
+
export declare const SortableItem: ({ id, index, type, isDisabled, className, draggingClassName, dropTargetClassName, onDrop, hideDefaultPreview, children, }: SortableItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SortableList } from './sortableList';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { SortableListProps } from '../../../common/types';
|
|
2
|
+
|
|
3
|
+
export declare const SortableList: <T extends {
|
|
4
|
+
id: string | number;
|
|
5
|
+
}>({ items, type, isDisabled, className, itemClassName, onReorder, renderItem, keyExtractor, }: SortableListProps<T>) => import("react/jsx-runtime").JSX.Element;
|
package/dist/index.js
CHANGED
|
@@ -1,46 +1,47 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { B as
|
|
3
|
-
import { B as
|
|
4
|
-
import { B } from "./bubblesLoader-f3ffa240.js";
|
|
5
|
-
import { B as
|
|
6
|
-
import { C as
|
|
7
|
-
import { D as
|
|
1
|
+
import { A as F } from "./index-1a874a8b.js";
|
|
2
|
+
import { B as D } from "./baseIconButton-251479f7.js";
|
|
3
|
+
import { B as y } from "./breadcrumbs-8e5ca8d7.js";
|
|
4
|
+
import { B as T } from "./bubblesLoader-f3ffa240.js";
|
|
5
|
+
import { B as A } from "./button-97d9e587.js";
|
|
6
|
+
import { C as M } from "./checkbox-ed6cc375.js";
|
|
7
|
+
import { D as L } from "./datePicker-926c9cae.js";
|
|
8
8
|
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
|
|
9
|
+
import { D as E } from "./dropdown-360803d5.js";
|
|
10
|
+
import { FieldLabel as O } from "./fieldLabel.js";
|
|
11
|
+
import { F as H } from "./fieldNumber-d1b5a7a1.js";
|
|
12
|
+
import { F as N } from "./fieldText-1749da7a.js";
|
|
13
|
+
import { F as G } from "./fieldTextFlex-2f51c173.js";
|
|
14
|
+
import { FileDropArea as X } from "./fileDropArea.js";
|
|
15
|
+
import { FiltersButton as q } from "./filtersButton.js";
|
|
16
|
+
import { Modal as Q } from "./modal.js";
|
|
17
|
+
import { MultipleAutocomplete as Y, SingleAutocomplete as Z } from "./autocompletes.js";
|
|
18
|
+
import { P as $ } from "./pagination-a3dee614.js";
|
|
19
|
+
import { Popover as ro } from "./popover.js";
|
|
20
|
+
import { R as to } from "./radio-62546efa.js";
|
|
21
|
+
import { S as ao } from "./selection-9124d029.js";
|
|
22
|
+
import { S as po } from "./spinLoader-c4a53718.js";
|
|
23
|
+
import { SystemAlert as mo } from "./systemAlert.js";
|
|
24
|
+
import { S as Io } from "./systemMessage-924fdaa6.js";
|
|
25
|
+
import { DragLayer as xo, SortableItem as fo, SortableList as uo } from "./sortable.js";
|
|
26
|
+
import { T as Po } from "./table-fc9f095d.js";
|
|
27
|
+
import { T as Fo } from "./themeProvider-46c2be7b.js";
|
|
28
|
+
import { T as Do } from "./toggle-304107fa.js";
|
|
29
|
+
import { Tooltip as yo } from "./tooltip.js";
|
|
30
|
+
import { SidePanel as To } from "./sidePanel.js";
|
|
31
|
+
import { AddCsvIcon as Ao, AddImageIcon as vo, AddJarIcon as Mo, BreadcrumbsTreeIcon as wo, CalendarIcon as Lo, CheckmarkIcon as ko, ChevronRightBreadcrumbsIcon as Eo, ConfigurationIcon as Ro, CopyIcon as Oo, CoverageFullIcon as Uo, CoveragePartialIcon as Ho, CoveredManuallyIcon as Jo, DeleteIcon as No, DragAndDropIcon as zo, DragNDropIcon as Go, DurationIcon as Wo, EditIcon as Xo, ExportIcon as jo, FlagIcon as qo, GroupByIcon as Ko, HideIcon as Qo, LaunchTypeIcon as Vo, MaximizeIcon as Yo, MoveToFolderIcon as Zo, PinFilledIcon as _o, PinOutlineIcon as $o, PriorityBlockerIcon as or, PriorityCriticalIcon as rr, PriorityHighIcon as er, PriorityLowIcon as tr, PriorityMediumIcon as nr, PriorityUnspecifiedIcon as ar, RefreshIcon as cr, RerunIcon as pr, RunManualIcon as ir, SearchIcon as mr, SortIcon as sr, StatusSuccessIcon as Ir, TestPlanIcon as lr, UserIcon as xr, WarningIcon as fr } from "./icons.js";
|
|
32
|
+
import { S as ur, a as Sr, b as Pr } from "./chevronDownDropdown-66f5b1af.js";
|
|
33
|
+
import { S as Fr } from "./calendarArrow-44c7e60e.js";
|
|
34
|
+
import { S as Dr } from "./clear-53660571.js";
|
|
35
|
+
import { S as yr, a as Br } from "./openEye-950159cb.js";
|
|
36
|
+
import { S as hr } from "./close-4d480ef7.js";
|
|
37
|
+
import { S as vr, a as Mr, b as wr, c as Lr, d as kr, e as Er, f as Rr } from "./xls-995781cc.js";
|
|
38
|
+
import { S as Ur } from "./dropdown-0260bb66.js";
|
|
39
|
+
import { S as Jr, a as Nr, b as zr } from "./success-8fd8bd2c.js";
|
|
40
|
+
import { S as Wr, a as Xr } from "./filterOutline-819b4b0d.js";
|
|
41
|
+
import { S as qr, a as Kr } from "./tree-c3dd3d45.js";
|
|
42
|
+
import { S as Vr } from "./minus-2857540f.js";
|
|
43
|
+
import { S as Zr } from "./plus-199fb2a8.js";
|
|
44
|
+
import { S as $r, a as oe } from "./prevPage-87faf576.js";
|
|
44
45
|
import "react/jsx-runtime";
|
|
45
46
|
import "react";
|
|
46
47
|
import "./bind-06a7ff84.js";
|
|
@@ -54,104 +55,109 @@ import "./maxValueDisplay-9be01a75.js";
|
|
|
54
55
|
import "./isEmpty-ccacb5ff.js";
|
|
55
56
|
import "react-dropzone";
|
|
56
57
|
import "framer-motion";
|
|
58
|
+
import "react-dnd";
|
|
59
|
+
import "react-dnd-html5-backend";
|
|
57
60
|
import "@floating-ui/react";
|
|
58
61
|
import "./floatingUi-41f8c7b5.js";
|
|
59
62
|
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
|
-
O as
|
|
99
|
-
H as
|
|
100
|
-
N as
|
|
101
|
-
G as
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
Lr as
|
|
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
|
-
po as
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
63
|
+
Ao as AddCsvIcon,
|
|
64
|
+
vo as AddImageIcon,
|
|
65
|
+
Mo as AddJarIcon,
|
|
66
|
+
ur as ArrowDownIcon,
|
|
67
|
+
Sr as ArrowUpIcon,
|
|
68
|
+
F as AttachedFile,
|
|
69
|
+
D as BaseIconButton,
|
|
70
|
+
y as Breadcrumbs,
|
|
71
|
+
wo as BreadcrumbsTreeIcon,
|
|
72
|
+
T as BubblesLoader,
|
|
73
|
+
A as Button,
|
|
74
|
+
Fr as CalendarArrowIcon,
|
|
75
|
+
Lo as CalendarIcon,
|
|
76
|
+
M as Checkbox,
|
|
77
|
+
ko as CheckmarkIcon,
|
|
78
|
+
Pr as ChevronDownDropdownIcon,
|
|
79
|
+
Eo as ChevronRightBreadcrumbsIcon,
|
|
80
|
+
Dr as ClearIcon,
|
|
81
|
+
yr as CloseEyeIcon,
|
|
82
|
+
hr as CloseIcon,
|
|
83
|
+
Ro as ConfigurationIcon,
|
|
84
|
+
Oo as CopyIcon,
|
|
85
|
+
Uo as CoverageFullIcon,
|
|
86
|
+
Ho as CoveragePartialIcon,
|
|
87
|
+
Jo as CoveredManuallyIcon,
|
|
88
|
+
vr as CsvIcon,
|
|
89
|
+
L as DatePicker,
|
|
90
|
+
No as DeleteIcon,
|
|
91
|
+
zo as DragAndDropIcon,
|
|
92
|
+
xo as DragLayer,
|
|
93
|
+
Go as DragNDropIcon,
|
|
94
|
+
E as Dropdown,
|
|
95
|
+
Ur as DropdownIcon,
|
|
96
|
+
Wo as DurationIcon,
|
|
97
|
+
Xo as EditIcon,
|
|
98
|
+
Jr as ErrorIcon,
|
|
99
|
+
jo as ExportIcon,
|
|
100
|
+
Mr as ExternalLinkIcon,
|
|
101
|
+
O as FieldLabel,
|
|
102
|
+
H as FieldNumber,
|
|
103
|
+
N as FieldText,
|
|
104
|
+
G as FieldTextFlex,
|
|
105
|
+
X as FileDropArea,
|
|
106
|
+
wr as FileOtherIcon,
|
|
107
|
+
Wr as FilterFilledIcon,
|
|
108
|
+
Xr as FilterOutlineIcon,
|
|
109
|
+
q as FiltersButton,
|
|
110
|
+
qo as FlagIcon,
|
|
111
|
+
Ko as GroupByIcon,
|
|
112
|
+
Qo as HideIcon,
|
|
113
|
+
Lr as ImageIcon,
|
|
114
|
+
Nr as InfoIcon,
|
|
115
|
+
kr as JarIcon,
|
|
116
|
+
Vo as LaunchTypeIcon,
|
|
117
|
+
Yo as MaximizeIcon,
|
|
118
|
+
qr as MeatballMenuIcon,
|
|
119
|
+
Vr as MinusIcon,
|
|
120
|
+
Q as Modal,
|
|
121
|
+
Zo as MoveToFolderIcon,
|
|
122
|
+
Y as MultipleAutocomplete,
|
|
123
|
+
Br as OpenEyeIcon,
|
|
124
|
+
$ as Pagination,
|
|
125
|
+
Er as PdfIcon,
|
|
126
|
+
_o as PinFilledIcon,
|
|
127
|
+
$o as PinOutlineIcon,
|
|
128
|
+
Zr as PlusIcon,
|
|
129
|
+
ro as Popover,
|
|
130
|
+
$r as PrevChapterIcon,
|
|
131
|
+
oe as PrevPageIcon,
|
|
132
|
+
or as PriorityBlockerIcon,
|
|
133
|
+
rr as PriorityCriticalIcon,
|
|
134
|
+
er as PriorityHighIcon,
|
|
135
|
+
tr as PriorityLowIcon,
|
|
136
|
+
nr as PriorityMediumIcon,
|
|
137
|
+
ar as PriorityUnspecifiedIcon,
|
|
138
|
+
to as Radio,
|
|
139
|
+
cr as RefreshIcon,
|
|
140
|
+
pr as RerunIcon,
|
|
141
|
+
ir as RunManualIcon,
|
|
142
|
+
mr as SearchIcon,
|
|
143
|
+
ao as Selection,
|
|
144
|
+
To as SidePanel,
|
|
145
|
+
Z as SingleAutocomplete,
|
|
146
|
+
sr as SortIcon,
|
|
147
|
+
fo as SortableItem,
|
|
148
|
+
uo as SortableList,
|
|
149
|
+
po as SpinLoader,
|
|
150
|
+
Ir as StatusSuccessIcon,
|
|
151
|
+
zr as SuccessIcon,
|
|
152
|
+
mo as SystemAlert,
|
|
153
|
+
Io as SystemMessage,
|
|
154
|
+
Po as Table,
|
|
155
|
+
lr as TestPlanIcon,
|
|
156
|
+
Fo as ThemeProvider,
|
|
157
|
+
Do as Toggle,
|
|
158
|
+
yo as Tooltip,
|
|
159
|
+
Kr as TreeIcon,
|
|
160
|
+
xr as UserIcon,
|
|
161
|
+
fr as WarningIcon,
|
|
162
|
+
Rr as XlsIcon
|
|
157
163
|
};
|
package/dist/modal.js
CHANGED
|
@@ -3,6 +3,8 @@ 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 "react-dnd";
|
|
7
|
+
import "react-dnd-html5-backend";
|
|
6
8
|
import { a as X } from "./dropdown-360803d5.js";
|
|
7
9
|
import { K as J } from "./keyCodes-f63c0e11.js";
|
|
8
10
|
import { B as D } from "./button-97d9e587.js";
|
|
@@ -105,7 +107,7 @@ const et = () => {
|
|
|
105
107
|
"size-default": "_size-default_yxql5_57",
|
|
106
108
|
"size-small": "_size-small_yxql5_69",
|
|
107
109
|
"size-large": "_size-large_yxql5_81"
|
|
108
|
-
}, g = x.bind(_t), ut = 0.9, ht = 32 + 24, wt = 32 + 8, ft = 36 + 16, pt = 32 * 2,
|
|
110
|
+
}, g = x.bind(_t), ut = 0.9, ht = 32 + 24, wt = 32 + 8, ft = 36 + 16, pt = 32 * 2, Wt = ({
|
|
109
111
|
title: e,
|
|
110
112
|
children: o,
|
|
111
113
|
footerNode: n,
|
|
@@ -183,7 +185,7 @@ const et = () => {
|
|
|
183
185
|
) }) });
|
|
184
186
|
};
|
|
185
187
|
export {
|
|
186
|
-
|
|
188
|
+
Wt as Modal,
|
|
187
189
|
S as ModalContent,
|
|
188
190
|
lt as ModalFooter,
|
|
189
191
|
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
|
+
};
|