@ynput/ayon-frontend-shared 0.6.0 → 0.6.1
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/ContextMenu.es.js +34 -16
- package/dist/DetailsPanel.es.js +292 -298
- package/dist/Feed.es.js +179 -50
- package/dist/ListTable.es.js +32 -35
- package/dist/NewEntity.es.js +1256 -11
- package/dist/ProjectTreeTable.es.js +4451 -2965
- package/dist/SimpleTable.es.js +8 -7
- package/dist/Slicer.es.js +451 -147
- package/dist/Views.es.js +918 -310
- package/dist/chunks/Actions.es.js +9 -4
- package/dist/chunks/ColumnDropIndicator.es.js +174 -328
- package/dist/chunks/ColumnDropIndicator.styled.es.js +281 -0
- package/dist/chunks/ColumnHeaderMenuUI.es.js +52 -0
- package/dist/chunks/ContextMenuContextInstance.es.js +12 -0
- package/dist/chunks/DeleteEntitiesConfirmDialog.es.js +229 -0
- package/dist/chunks/DeleteEntitiesContextInstance.es.js +827 -0
- package/dist/chunks/EmptyPlaceholder.es.js +4 -4
- package/dist/chunks/EntityPath.es.js +58 -53
- package/dist/chunks/EntityPickerDialog.es.js +24 -20
- package/dist/chunks/EntityTooltip.es.js +20 -13
- package/dist/chunks/EntityUpdatesContext.es.js +38 -96
- package/dist/chunks/Feed.es.js +1495 -1439
- package/dist/chunks/FilterErrorActions.es.js +25 -229
- package/dist/chunks/Menu.es.js +21 -17
- package/dist/chunks/MenuContext.es.js +14 -65
- package/dist/chunks/MenuItem.es.js +34 -24
- package/dist/chunks/MetaWidget.es.js +2835 -4301
- package/dist/chunks/NewEntityContextInstance.es.js +11 -0
- package/dist/chunks/PlayableIcon.es.js +1532 -1594
- package/dist/chunks/ProjectContext.es.js +102 -66
- package/dist/chunks/RepresentationsList.es.js +1 -1
- package/dist/chunks/ReviewablesSelector.es.js +457 -458
- package/dist/chunks/SimpleForm.es.js +9 -9
- package/dist/chunks/SimpleTable.es.js +15 -13
- package/dist/chunks/Slicer.es.js +163 -154
- package/dist/chunks/TableSettingsFallback.es.js +25 -13
- package/dist/chunks/ThumbnailSimple.es.js +150 -261
- package/dist/chunks/VersionUploadContextInstance.es.js +12 -0
- package/dist/chunks/VideoPlayer.es.js +24 -28
- package/dist/chunks/Watchers.es.js +384 -389
- package/dist/chunks/entityDefinitions.es.js +2 -350
- package/dist/chunks/extractVersionFromFilename.es.js +28 -0
- package/dist/chunks/getBundleMode.es.js +61 -16
- package/dist/chunks/getUris.es.js +737 -712
- package/dist/chunks/searchTerms.es.js +57 -56
- package/dist/chunks/useAttributeEnums.es.js +4 -4
- package/dist/chunks/useCreateContextMenu.es.js +66 -90
- package/dist/chunks/useHierarchySelection.es.js +24 -0
- package/dist/chunks/useLoadModule.es.js +74 -0
- package/dist/chunks/useQueryArgumentChangeLoading.es.js +11 -0
- package/dist/chunks/versionUploadHelpers.es.js +16 -42
- package/dist/chunks/viewUpdateHelper.es.js +67 -50
- package/dist/components.es.js +1425 -999
- package/dist/context.es.js +791 -80
- package/dist/hooks.es.js +115 -120
- package/dist/index.es.js +19 -23
- package/dist/types/Actions.d.ts +7 -7
- package/dist/types/ContextMenu.d.ts +11 -8
- package/dist/types/DetailsPanel.d.ts +102 -9
- package/dist/types/EntityPickerDialog.d.ts +7 -7
- package/dist/types/Feed.d.ts +11 -8
- package/dist/types/ListTable.d.ts +7 -7
- package/dist/types/NewEntity.d.ts +16 -10
- package/dist/types/ProjectTreeTable.d.ts +22 -115
- package/dist/types/RepresentationsList.d.ts +7 -7
- package/dist/types/SimpleTable.d.ts +11 -8
- package/dist/types/Slicer.d.ts +10 -7
- package/dist/types/Views.d.ts +10 -7
- package/dist/types/api.d.ts +132 -120
- package/dist/types/components.d.ts +13 -8
- package/dist/types/context.d.ts +56 -16
- package/dist/types/hooks.d.ts +7 -7
- package/dist/types/index.d.ts +7 -7
- package/dist/types/util.d.ts +12 -7
- package/dist/util.es.js +72 -71
- package/package.json +1 -1
- package/dist/chunks/DeleteEntitiesContext.es.js +0 -748
- package/dist/chunks/DetailsPanelContext.es.js +0 -155
- package/dist/chunks/GlobalContext.es.js +0 -52
- package/dist/chunks/NewEntityContext.es.js +0 -1242
- package/dist/chunks/ProjectFoldersContext.es.js +0 -134
- package/dist/chunks/ProjectFoldersContextInstance.es.js +0 -7
- package/dist/chunks/VersionUploadContext.es.js +0 -232
- package/dist/chunks/ViewsContext.es.js +0 -878
- package/dist/chunks/uriUtils.es.js +0 -48
- package/dist/chunks/useColumnDragRestriction.es.js +0 -158
- package/dist/chunks/useLocalStorage.es.js +0 -355
- package/dist/chunks/useSessionStorage.es.js +0 -61
- /package/dist/{useCreateContextMenu.css → ContextMenuContextInstance.css} +0 -0
|
@@ -4,14 +4,19 @@ import x, { keyframes as ge } from "styled-components";
|
|
|
4
4
|
import { useRef as fe, useMemo as f, useState as $, useEffect as me } from "react";
|
|
5
5
|
import B from "clsx";
|
|
6
6
|
import { toast as w } from "react-toastify";
|
|
7
|
-
import {
|
|
7
|
+
import { bi as he } from "./searchTerms.es.js";
|
|
8
8
|
import { d0 as be, bb as ve, cP as ye, bc as xe, b7 as Ae } from "./getUris.es.js";
|
|
9
9
|
import "primereact/confirmdialog";
|
|
10
10
|
import { upperFirst as Q } from "lodash";
|
|
11
11
|
import { u as we } from "./useActionTriggers.es.js";
|
|
12
12
|
import { S as R } from "./SimpleFormDialog.es.js";
|
|
13
13
|
import "uuid";
|
|
14
|
-
import
|
|
14
|
+
import "@module-federation/enhanced/runtime";
|
|
15
|
+
import { d as Ce } from "./DeleteEntitiesContextInstance.es.js";
|
|
16
|
+
import "semver";
|
|
17
|
+
import "./ContextMenuContextInstance.es.js";
|
|
18
|
+
import "react-dom";
|
|
19
|
+
import "react-redux";
|
|
15
20
|
const Se = x.div`
|
|
16
21
|
position: relative;
|
|
17
22
|
width: fit-content;
|
|
@@ -246,7 +251,7 @@ const Se = x.div`
|
|
|
246
251
|
isPlaceholder: !0,
|
|
247
252
|
icon: { type: "material-symbols", name: "sync" },
|
|
248
253
|
groupLabel: ""
|
|
249
|
-
},
|
|
254
|
+
}, oo = ({
|
|
250
255
|
entities: o,
|
|
251
256
|
entityType: s,
|
|
252
257
|
entitySubTypes: a,
|
|
@@ -438,5 +443,5 @@ const Se = x.div`
|
|
|
438
443
|
] });
|
|
439
444
|
};
|
|
440
445
|
export {
|
|
441
|
-
|
|
446
|
+
oo as A
|
|
442
447
|
};
|
|
@@ -1,344 +1,190 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { Button as v, Icon as D } from "@ynput/ayon-react-components";
|
|
4
|
-
import h from "clsx";
|
|
5
|
-
import c from "styled-components";
|
|
6
|
-
import { u as O } from "./MenuContext.es.js";
|
|
7
|
-
import { M as P, a as z } from "./Menu.es.js";
|
|
8
|
-
import "./MenuItem.es.js";
|
|
9
|
-
import "./useLocalStorage.es.js";
|
|
10
|
-
import "@module-federation/enhanced/runtime";
|
|
11
|
-
import "semver";
|
|
12
|
-
import { R as C, D as w } from "./realtimeUpdatesUtils.es.js";
|
|
1
|
+
import { useMemo as A, useRef as x, useCallback as h, useState as v, useEffect as T } from "react";
|
|
2
|
+
import "react-toastify";
|
|
13
3
|
import "lodash";
|
|
14
4
|
import "primereact/confirmdialog";
|
|
15
|
-
import "
|
|
16
|
-
import {
|
|
5
|
+
import { g as p } from "./parseHtmlToPlainTextWithLinks.es.js";
|
|
6
|
+
import { bj as E } from "./searchTerms.es.js";
|
|
17
7
|
import "uuid";
|
|
18
|
-
import "
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
fill: "white",
|
|
54
|
-
stroke: "#1C2026",
|
|
55
|
-
strokeWidth: "1.5"
|
|
56
|
-
}
|
|
57
|
-
),
|
|
58
|
-
/* @__PURE__ */ i(
|
|
59
|
-
"path",
|
|
60
|
-
{
|
|
61
|
-
d: "M20.1373 12.6133C19.942 15.1992 17.8037 17.2074 15.2107 17.2402L14.7621 17.2459",
|
|
62
|
-
stroke: "#232323",
|
|
63
|
-
strokeWidth: "1.5",
|
|
64
|
-
strokeLinecap: "round"
|
|
65
|
-
}
|
|
66
|
-
)
|
|
67
|
-
]
|
|
68
|
-
}
|
|
69
|
-
)), T = c(v)`
|
|
70
|
-
width: 24px;
|
|
71
|
-
height: 24px;
|
|
72
|
-
padding: 2px;
|
|
73
|
-
|
|
74
|
-
&.action {
|
|
75
|
-
padding: 0px;
|
|
76
|
-
display: flex;
|
|
77
|
-
background-color: unset;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
&:hover {
|
|
81
|
-
background-color: var(--md-sys-color-surface-container-hover) !important;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
&.pin-button .material-symbols-outlined.icon {
|
|
85
|
-
font-variation-settings: 'FILL' 1, 'wght' 200, 'GRAD' 200, 'opsz' 10;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
&.selected {
|
|
89
|
-
display: flex !important;
|
|
90
|
-
}
|
|
91
|
-
`, xt = ({ selected: t, style: o, ...n }) => /* @__PURE__ */ i(
|
|
92
|
-
T,
|
|
93
|
-
{
|
|
94
|
-
...n,
|
|
95
|
-
selected: t,
|
|
96
|
-
className: h(n.className, "action", { selected: t }),
|
|
97
|
-
variant: "text",
|
|
98
|
-
style: { ...o }
|
|
99
|
-
}
|
|
100
|
-
), H = c(v)`
|
|
101
|
-
background-color: unset !important;
|
|
102
|
-
z-index: 110;
|
|
103
|
-
position: relative;
|
|
104
|
-
padding: 2px;
|
|
105
|
-
width: 24px;
|
|
106
|
-
height: 24px;
|
|
107
|
-
|
|
108
|
-
&.hasIcon {
|
|
109
|
-
padding: 2px;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
&:hover,
|
|
113
|
-
&.active {
|
|
114
|
-
background-color: var(--md-sys-color-surface-container-hover) !important;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
${({ $isOpen: t }) => t && `
|
|
118
|
-
background-color: var(--md-sys-color-surface-container-hover) !important;
|
|
119
|
-
`}
|
|
120
|
-
`, Ct = ({ menuItems: t, menuId: o, className: n }) => {
|
|
121
|
-
const { toggleMenuOpen: r, menuOpen: d } = O(), a = _(null), p = d === o;
|
|
122
|
-
return t.length === 0 ? null : /* @__PURE__ */ g(y, { children: [
|
|
123
|
-
/* @__PURE__ */ i(
|
|
124
|
-
H,
|
|
8
|
+
import { jsx as L } from "react/jsx-runtime";
|
|
9
|
+
import "clsx";
|
|
10
|
+
import "./PlayableIcon.es.js";
|
|
11
|
+
import "@ynput/ayon-react-components";
|
|
12
|
+
import "lexical";
|
|
13
|
+
import "@lexical/markdown";
|
|
14
|
+
import "@lexical/react/LexicalBlockWithAlignableContents";
|
|
15
|
+
import "@lexical/react/LexicalDecoratorBlockNode";
|
|
16
|
+
import "match-sorter";
|
|
17
|
+
import "date-fns";
|
|
18
|
+
import "@lexical/code";
|
|
19
|
+
import "@lexical/list";
|
|
20
|
+
import "@lexical/rich-text";
|
|
21
|
+
import "@lexical/selection";
|
|
22
|
+
import "@lexical/utils";
|
|
23
|
+
import "./getUris.es.js";
|
|
24
|
+
import "react-router-dom";
|
|
25
|
+
import { a as S, b as k } from "./MetaWidget.es.js";
|
|
26
|
+
import "@module-federation/enhanced/runtime";
|
|
27
|
+
import "./DeleteEntitiesContextInstance.es.js";
|
|
28
|
+
import "semver";
|
|
29
|
+
import "./ContextMenuContextInstance.es.js";
|
|
30
|
+
import { createPortal as R } from "react-dom";
|
|
31
|
+
import "react-redux";
|
|
32
|
+
import "@tanstack/react-table";
|
|
33
|
+
import { useDndContext as D } from "@dnd-kit/core";
|
|
34
|
+
import { a as I } from "./ColumnDropIndicator.styled.es.js";
|
|
35
|
+
const O = ["string", "integer", "float"], B = (o, s, t, n) => (t || O).includes(o.data.type || "") && (!s || o.scope?.includes(s)) ? n ? E(o.data) : !0 : !1, ht = ({
|
|
36
|
+
allowedTypes: o,
|
|
37
|
+
enumOnly: s,
|
|
38
|
+
scope: t
|
|
39
|
+
}) => {
|
|
40
|
+
const { columnOrder: n } = S(), { attribFields: a } = k();
|
|
41
|
+
return A(
|
|
42
|
+
() => [
|
|
125
43
|
{
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
onPointerDown: (s) => s.stopPropagation(),
|
|
132
|
-
icon: "more_horiz",
|
|
133
|
-
$isOpen: p
|
|
134
|
-
}
|
|
135
|
-
),
|
|
136
|
-
/* @__PURE__ */ i(
|
|
137
|
-
P,
|
|
44
|
+
value: "folderType",
|
|
45
|
+
label: "Folder type",
|
|
46
|
+
icon: p("folder"),
|
|
47
|
+
scopes: ["folder", "task"]
|
|
48
|
+
},
|
|
138
49
|
{
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
},
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
white-space: nowrap;
|
|
195
|
-
font-size: 14px;
|
|
196
|
-
color: var(--md-sys-color-on-surface-variant);
|
|
197
|
-
|
|
198
|
-
.label {
|
|
199
|
-
color: var(--md-sys-color-outline);
|
|
200
|
-
}
|
|
201
|
-
.value {
|
|
202
|
-
font-weight: 600;
|
|
203
|
-
color: var(--md-sys-color-on-surface);
|
|
204
|
-
}
|
|
205
|
-
`, b = c.div`
|
|
206
|
-
width: calc(100% - 1px);
|
|
207
|
-
height: calc(100% - 3px);
|
|
208
|
-
margin-left: 1px;
|
|
209
|
-
|
|
210
|
-
&.selection {
|
|
211
|
-
width: calc(100% - 3px);
|
|
212
|
-
margin-left: 1px;
|
|
213
|
-
}
|
|
214
|
-
`, j = c(b)`
|
|
215
|
-
position: absolute;
|
|
216
|
-
inset: 1px 0 2px 1px;
|
|
217
|
-
width: auto;
|
|
218
|
-
height: auto;
|
|
219
|
-
margin: 0;
|
|
220
|
-
pointer-events: none;
|
|
221
|
-
`, vt = ({
|
|
222
|
-
columnVirtualizer: t,
|
|
223
|
-
table: o,
|
|
224
|
-
virtualPaddingLeft: n,
|
|
225
|
-
virtualPaddingRight: r,
|
|
226
|
-
renderCellContent: d,
|
|
227
|
-
onClick: a,
|
|
228
|
-
isLoading: p,
|
|
229
|
-
statsLoading: s,
|
|
230
|
-
error: l
|
|
50
|
+
value: "taskType",
|
|
51
|
+
label: "Task type",
|
|
52
|
+
icon: p("task"),
|
|
53
|
+
scopes: ["task", "version"]
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
value: "productType",
|
|
57
|
+
label: "Product type",
|
|
58
|
+
icon: p("product"),
|
|
59
|
+
scopes: ["product", "version"]
|
|
60
|
+
},
|
|
61
|
+
// {
|
|
62
|
+
// value: 'version',
|
|
63
|
+
// label: 'Version',
|
|
64
|
+
// icon: getAttributeIcon('version'),
|
|
65
|
+
// scopes: ['version'],
|
|
66
|
+
// },
|
|
67
|
+
// {
|
|
68
|
+
// value: 'author',
|
|
69
|
+
// label: 'Author',
|
|
70
|
+
// icon: getAttributeIcon('author'),
|
|
71
|
+
// scopes: ['version'],
|
|
72
|
+
// },
|
|
73
|
+
{
|
|
74
|
+
value: "assignees",
|
|
75
|
+
label: "Assignee",
|
|
76
|
+
icon: p("assignees"),
|
|
77
|
+
scopes: ["task"]
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
value: "status",
|
|
81
|
+
label: "Status",
|
|
82
|
+
icon: p("status"),
|
|
83
|
+
scopes: ["task", "version", "folder", "product"]
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
value: "tags",
|
|
87
|
+
label: "Tags",
|
|
88
|
+
icon: p("tags"),
|
|
89
|
+
scopes: ["task", "version", "folder", "product"]
|
|
90
|
+
},
|
|
91
|
+
...a.filter((r) => B(r, t, o, s)).map((r) => ({
|
|
92
|
+
value: "attrib." + r.name,
|
|
93
|
+
label: r.data.title || r.name,
|
|
94
|
+
icon: p(r.name)
|
|
95
|
+
}))
|
|
96
|
+
].filter((r) => !t || ("scopes" in r ? r.scopes.includes(t) : !0)).sort((r, m) => {
|
|
97
|
+
const u = n.indexOf(r.value), c = n.indexOf(m.value);
|
|
98
|
+
return u === -1 && c === -1 ? 0 : u === -1 ? 1 : c === -1 ? -1 : u - c;
|
|
99
|
+
}),
|
|
100
|
+
[a, n, o, s, t]
|
|
101
|
+
);
|
|
102
|
+
}, P = "data-column-dnd-container", y = 100, Ct = ({
|
|
103
|
+
columnPinning: o,
|
|
104
|
+
columnSizing: s
|
|
231
105
|
}) => {
|
|
232
|
-
const
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
{
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
style: { padding: 2 },
|
|
280
|
-
variant: "text"
|
|
281
|
-
}
|
|
282
|
-
)
|
|
283
|
-
] }) : null : !k && /* @__PURE__ */ g(y, { children: [
|
|
284
|
-
d?.(e.id),
|
|
285
|
-
s && /* @__PURE__ */ i(j, { className: h("loading", "shimmer-dark") })
|
|
286
|
-
] })
|
|
287
|
-
},
|
|
288
|
-
e.id
|
|
289
|
-
);
|
|
290
|
-
}),
|
|
291
|
-
r ? /* @__PURE__ */ i("td", { style: { display: "flex", width: r } }) : null
|
|
292
|
-
]
|
|
293
|
-
}
|
|
294
|
-
) });
|
|
295
|
-
}, q = "th[data-column-id]", G = c.div`
|
|
296
|
-
position: fixed;
|
|
297
|
-
z-index: 2000;
|
|
298
|
-
pointer-events: none;
|
|
299
|
-
width: 2px;
|
|
300
|
-
background-color: var(--md-sys-color-primary);
|
|
301
|
-
`, Z = (t, o) => {
|
|
302
|
-
const n = t.getBoundingClientRect(), r = t.closest("table")?.getBoundingClientRect() ?? n;
|
|
106
|
+
const t = x(null), n = x(null), a = h(() => {
|
|
107
|
+
const e = o.left || [];
|
|
108
|
+
let l = 24;
|
|
109
|
+
return e.forEach((g) => {
|
|
110
|
+
l += s[g] || 150;
|
|
111
|
+
}), l;
|
|
112
|
+
}, [o.left, s]), r = h(
|
|
113
|
+
({ transform: e, activeNodeRect: l, draggingNodeRect: g, active: d }) => {
|
|
114
|
+
if (t.current === null || !l || d?.data.current?.type && d.data.current.type !== "column") return e;
|
|
115
|
+
let i = n.current;
|
|
116
|
+
i === null && (i = (document.querySelector(`[${P}]`)?.getBoundingClientRect().left ?? 0) + a());
|
|
117
|
+
const C = g?.left ?? l.left;
|
|
118
|
+
if (t.current) {
|
|
119
|
+
const b = C + l.width + e.x, f = i + y;
|
|
120
|
+
if (b > f)
|
|
121
|
+
return { ...e, x: f - C - l.width };
|
|
122
|
+
} else {
|
|
123
|
+
const b = C + e.x, f = i - y;
|
|
124
|
+
if (b < f)
|
|
125
|
+
return { ...e, x: f - C };
|
|
126
|
+
}
|
|
127
|
+
return e;
|
|
128
|
+
},
|
|
129
|
+
[a]
|
|
130
|
+
), m = h(
|
|
131
|
+
(e) => {
|
|
132
|
+
if (e === null) {
|
|
133
|
+
t.current = null;
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
t.current = o.left?.includes(e) || !1;
|
|
137
|
+
},
|
|
138
|
+
[o.left]
|
|
139
|
+
), u = h(() => {
|
|
140
|
+
t.current = null, n.current = null;
|
|
141
|
+
}, []), c = h((e) => {
|
|
142
|
+
n.current = e;
|
|
143
|
+
}, []);
|
|
144
|
+
return {
|
|
145
|
+
restrictToSection: r,
|
|
146
|
+
setDragPinnedState: m,
|
|
147
|
+
clearDragPinnedState: u,
|
|
148
|
+
activePinnedState: t,
|
|
149
|
+
setCachedBoundary: c
|
|
150
|
+
};
|
|
151
|
+
}, F = (o, s) => {
|
|
152
|
+
const t = o.getBoundingClientRect(), n = o.closest("table")?.getBoundingClientRect() ?? t;
|
|
303
153
|
return {
|
|
304
|
-
left:
|
|
305
|
-
top:
|
|
306
|
-
height:
|
|
154
|
+
left: s === "left" ? t.left - 1 : t.right - 1,
|
|
155
|
+
top: n.top,
|
|
156
|
+
height: n.height
|
|
307
157
|
};
|
|
308
|
-
},
|
|
309
|
-
const { active:
|
|
310
|
-
return
|
|
311
|
-
if (!
|
|
312
|
-
|
|
158
|
+
}, _ = "th[data-column-id]", bt = () => {
|
|
159
|
+
const { active: o, over: s } = D(), t = o?.data?.current?.type === "column" ? String(o.id) : null, n = s ? String(s.id) : null, [a, r] = v(null);
|
|
160
|
+
return T(() => {
|
|
161
|
+
if (!t || !n || t === n) {
|
|
162
|
+
r(null);
|
|
313
163
|
return;
|
|
314
164
|
}
|
|
315
|
-
let
|
|
316
|
-
const
|
|
317
|
-
const
|
|
318
|
-
document.querySelectorAll(
|
|
319
|
-
),
|
|
320
|
-
if (
|
|
321
|
-
const
|
|
322
|
-
|
|
323
|
-
(
|
|
165
|
+
let m = 0;
|
|
166
|
+
const u = () => {
|
|
167
|
+
const c = Array.from(
|
|
168
|
+
document.querySelectorAll(_)
|
|
169
|
+
), e = c.find((l) => l.dataset.columnId === n);
|
|
170
|
+
if (e) {
|
|
171
|
+
const l = c.findIndex((i) => i.dataset.columnId === t), g = c.indexOf(e), d = F(e, l < g ? "right" : "left");
|
|
172
|
+
r(
|
|
173
|
+
(i) => i && i.left === d.left && i.top === d.top && i.height === d.height ? i : d
|
|
324
174
|
);
|
|
325
175
|
}
|
|
326
|
-
|
|
176
|
+
m = requestAnimationFrame(u);
|
|
327
177
|
};
|
|
328
|
-
return
|
|
329
|
-
}, [
|
|
178
|
+
return u(), () => cancelAnimationFrame(m);
|
|
179
|
+
}, [t, n]), a ? R(/* @__PURE__ */ L(I, { style: a }), document.body) : null;
|
|
330
180
|
};
|
|
331
181
|
export {
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
G as d,
|
|
341
|
-
q as e,
|
|
342
|
-
Z as f,
|
|
343
|
-
B as g
|
|
182
|
+
_ as C,
|
|
183
|
+
bt as T,
|
|
184
|
+
P as a,
|
|
185
|
+
O as b,
|
|
186
|
+
ht as c,
|
|
187
|
+
F as g,
|
|
188
|
+
B as i,
|
|
189
|
+
Ct as u
|
|
344
190
|
};
|