@payloadcms/ui 3.42.0 → 3.43.0-internal.c5bbc84
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/elements/CopyLocaleData/index.d.ts.map +1 -1
- package/dist/elements/CopyLocaleData/index.js +6 -1
- package/dist/elements/CopyLocaleData/index.js.map +1 -1
- package/dist/elements/FolderView/CollectionTypePill/index.d.ts.map +1 -1
- package/dist/elements/FolderView/CollectionTypePill/index.js +13 -10
- package/dist/elements/FolderView/CollectionTypePill/index.js.map +1 -1
- package/dist/elements/FolderView/CurrentFolderActions/index.d.ts.map +1 -1
- package/dist/elements/FolderView/CurrentFolderActions/index.js +17 -11
- package/dist/elements/FolderView/CurrentFolderActions/index.js.map +1 -1
- package/dist/elements/FolderView/Drawers/EditFolderAction/index.d.ts +1 -3
- package/dist/elements/FolderView/Drawers/EditFolderAction/index.d.ts.map +1 -1
- package/dist/elements/FolderView/Drawers/EditFolderAction/index.js +7 -4
- package/dist/elements/FolderView/Drawers/EditFolderAction/index.js.map +1 -1
- package/dist/elements/FolderView/Drawers/MoveToFolder/index.d.ts +1 -0
- package/dist/elements/FolderView/Drawers/MoveToFolder/index.d.ts.map +1 -1
- package/dist/elements/FolderView/Drawers/MoveToFolder/index.js +230 -201
- package/dist/elements/FolderView/Drawers/MoveToFolder/index.js.map +1 -1
- package/dist/elements/FolderView/FolderFileCard/index.d.ts +8 -0
- package/dist/elements/FolderView/FolderFileCard/index.d.ts.map +1 -1
- package/dist/elements/FolderView/FolderFileCard/index.js +82 -0
- package/dist/elements/FolderView/FolderFileCard/index.js.map +1 -1
- package/dist/elements/FolderView/FolderFileTable/index.d.ts +1 -22
- package/dist/elements/FolderView/FolderFileTable/index.d.ts.map +1 -1
- package/dist/elements/FolderView/FolderFileTable/index.js +245 -163
- package/dist/elements/FolderView/FolderFileTable/index.js.map +1 -1
- package/dist/elements/FolderView/ItemCardGrid/index.d.ts +2 -8
- package/dist/elements/FolderView/ItemCardGrid/index.d.ts.map +1 -1
- package/dist/elements/FolderView/ItemCardGrid/index.js +24 -90
- package/dist/elements/FolderView/ItemCardGrid/index.js.map +1 -1
- package/dist/elements/FolderView/SortByPill/index.d.ts.map +1 -1
- package/dist/elements/FolderView/SortByPill/index.js +17 -15
- package/dist/elements/FolderView/SortByPill/index.js.map +1 -1
- package/dist/elements/ListHeader/TitleActions/ListCreateNewDocInFolderButton.d.ts.map +1 -1
- package/dist/elements/ListHeader/TitleActions/ListCreateNewDocInFolderButton.js +8 -10
- package/dist/elements/ListHeader/TitleActions/ListCreateNewDocInFolderButton.js.map +1 -1
- package/dist/exports/client/index.js +22 -22
- package/dist/exports/client/index.js.map +4 -4
- package/dist/exports/rsc/index.d.ts +1 -0
- package/dist/exports/rsc/index.d.ts.map +1 -1
- package/dist/exports/rsc/index.js +1 -0
- package/dist/exports/rsc/index.js.map +1 -1
- package/dist/fields/Relationship/Input.d.ts.map +1 -1
- package/dist/fields/Relationship/Input.js +1 -0
- package/dist/fields/Relationship/Input.js.map +1 -1
- package/dist/providers/Folders/index.d.ts +59 -46
- package/dist/providers/Folders/index.d.ts.map +1 -1
- package/dist/providers/Folders/index.js +163 -572
- package/dist/providers/Folders/index.js.map +1 -1
- package/dist/providers/ServerFunctions/index.d.ts +6 -1
- package/dist/providers/ServerFunctions/index.d.ts.map +1 -1
- package/dist/providers/ServerFunctions/index.js +19 -0
- package/dist/providers/ServerFunctions/index.js.map +1 -1
- package/dist/providers/TableColumns/index.js +1 -0
- package/dist/providers/TableColumns/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/utilities/getFolderResultsComponentAndData.d.ts +29 -0
- package/dist/utilities/getFolderResultsComponentAndData.d.ts.map +1 -0
- package/dist/utilities/getFolderResultsComponentAndData.js +128 -0
- package/dist/utilities/getFolderResultsComponentAndData.js.map +1 -0
- package/dist/views/BrowseByFolder/index.d.ts +1 -4
- package/dist/views/BrowseByFolder/index.d.ts.map +1 -1
- package/dist/views/BrowseByFolder/index.js +219 -158
- package/dist/views/BrowseByFolder/index.js.map +1 -1
- package/dist/views/CollectionFolder/ListSelection/index.d.ts.map +1 -1
- package/dist/views/CollectionFolder/ListSelection/index.js +25 -50
- package/dist/views/CollectionFolder/ListSelection/index.js.map +1 -1
- package/dist/views/CollectionFolder/index.d.ts +1 -1
- package/dist/views/CollectionFolder/index.d.ts.map +1 -1
- package/dist/views/CollectionFolder/index.js +186 -153
- package/dist/views/CollectionFolder/index.js.map +1 -1
- package/package.json +5 -5
|
@@ -4,10 +4,12 @@ import { c as _c } from "react/compiler-runtime";
|
|
|
4
4
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
5
5
|
import { useModal } from '@faceless-ui/modal';
|
|
6
6
|
import { getTranslation } from '@payloadcms/translations';
|
|
7
|
-
import {
|
|
7
|
+
import { extractID } from 'payload/shared';
|
|
8
8
|
import React from 'react';
|
|
9
|
-
import {
|
|
9
|
+
import { useAuth } from '../../../../providers/Auth/index.js';
|
|
10
10
|
import { FolderProvider, useFolder } from '../../../../providers/Folders/index.js';
|
|
11
|
+
import { useRouteCache } from '../../../../providers/RouteCache/index.js';
|
|
12
|
+
import { useServerFunctions } from '../../../../providers/ServerFunctions/index.js';
|
|
11
13
|
import { useTranslation } from '../../../../providers/Translation/index.js';
|
|
12
14
|
import { Button } from '../../../Button/index.js';
|
|
13
15
|
import { ConfirmationModal } from '../../../ConfirmationModal/index.js';
|
|
@@ -21,7 +23,6 @@ import { NoListResults } from '../../../NoListResults/index.js';
|
|
|
21
23
|
import { Translation } from '../../../Translation/index.js';
|
|
22
24
|
import { FolderBreadcrumbs } from '../../Breadcrumbs/index.js';
|
|
23
25
|
import { ColoredFolderIcon } from '../../ColoredFolderIcon/index.js';
|
|
24
|
-
import { ItemCardGrid } from '../../ItemCardGrid/index.js';
|
|
25
26
|
import './index.scss';
|
|
26
27
|
const baseClass = 'move-folder-drawer';
|
|
27
28
|
const baseModalSlug = 'move-folder-drawer';
|
|
@@ -38,141 +39,156 @@ export function MoveItemsToFolderDrawer(props) {
|
|
|
38
39
|
}
|
|
39
40
|
function LoadFolderData(props) {
|
|
40
41
|
const {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
serverURL
|
|
44
|
-
}
|
|
45
|
-
} = useConfig();
|
|
42
|
+
permissions
|
|
43
|
+
} = useAuth();
|
|
46
44
|
const [subfolders, setSubfolders] = React.useState([]);
|
|
47
45
|
const [documents, setDocuments] = React.useState([]);
|
|
48
46
|
const [breadcrumbs, setBreadcrumbs] = React.useState([]);
|
|
47
|
+
const [FolderResultsComponent, setFolderResultsComponent] = React.useState(null);
|
|
49
48
|
const [hasLoaded, setHasLoaded] = React.useState(false);
|
|
50
|
-
React.
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
} catch (e) {
|
|
71
|
-
// eslint-disable-next-line no-console
|
|
72
|
-
console.error(e);
|
|
73
|
-
}
|
|
49
|
+
const [folderID, setFolderID] = React.useState(props.fromFolderID || null);
|
|
50
|
+
const hasLoadedRef = React.useRef(false);
|
|
51
|
+
const {
|
|
52
|
+
getFolderResultsComponentAndData
|
|
53
|
+
} = useServerFunctions();
|
|
54
|
+
const populateMoveToFolderDrawer = React.useCallback(async folderIDToPopulate => {
|
|
55
|
+
try {
|
|
56
|
+
const result = await getFolderResultsComponentAndData({
|
|
57
|
+
activeCollectionSlugs: [props.folderCollectionSlug],
|
|
58
|
+
browseByFolder: false,
|
|
59
|
+
displayAs: 'grid',
|
|
60
|
+
folderID: folderIDToPopulate,
|
|
61
|
+
sort: '_folderOrDocumentTitle'
|
|
62
|
+
});
|
|
63
|
+
setBreadcrumbs(result.breadcrumbs || []);
|
|
64
|
+
setSubfolders(result?.subfolders || []);
|
|
65
|
+
setDocuments(result?.documents || []);
|
|
66
|
+
setFolderResultsComponent(result.FolderResultsComponent || null);
|
|
67
|
+
setFolderID(folderIDToPopulate);
|
|
74
68
|
setHasLoaded(true);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
|
|
69
|
+
} catch (e) {
|
|
70
|
+
setBreadcrumbs([]);
|
|
71
|
+
setSubfolders([]);
|
|
72
|
+
setDocuments([]);
|
|
73
|
+
}
|
|
74
|
+
hasLoadedRef.current = true;
|
|
75
|
+
}, [getFolderResultsComponentAndData, props.folderCollectionSlug]);
|
|
76
|
+
React.useEffect(() => {
|
|
77
|
+
if (!hasLoadedRef.current) {
|
|
78
|
+
void populateMoveToFolderDrawer(props.fromFolderID);
|
|
78
79
|
}
|
|
79
|
-
}, [
|
|
80
|
+
}, [populateMoveToFolderDrawer, props.fromFolderID]);
|
|
80
81
|
if (!hasLoaded) {
|
|
81
82
|
return /*#__PURE__*/_jsx(LoadingOverlay, {});
|
|
82
83
|
}
|
|
83
84
|
return /*#__PURE__*/_jsx(FolderProvider, {
|
|
85
|
+
allCollectionFolderSlugs: [props.folderCollectionSlug],
|
|
86
|
+
allowCreateCollectionSlugs: permissions.collections[props.folderCollectionSlug]?.create ? [props.folderCollectionSlug] : [],
|
|
84
87
|
allowMultiSelection: false,
|
|
85
88
|
breadcrumbs: breadcrumbs,
|
|
86
89
|
documents: documents,
|
|
87
|
-
folderCollectionSlugs: [],
|
|
88
90
|
folderFieldName: props.folderFieldName,
|
|
89
|
-
folderID:
|
|
91
|
+
folderID: folderID,
|
|
92
|
+
FolderResultsComponent: FolderResultsComponent,
|
|
93
|
+
onItemClick: async item => {
|
|
94
|
+
await populateMoveToFolderDrawer(item.value.id);
|
|
95
|
+
},
|
|
90
96
|
subfolders: subfolders,
|
|
91
97
|
children: /*#__PURE__*/_jsx(Content, {
|
|
92
|
-
...props
|
|
98
|
+
...props,
|
|
99
|
+
populateMoveToFolderDrawer: populateMoveToFolderDrawer
|
|
93
100
|
})
|
|
94
|
-
});
|
|
101
|
+
}, folderID);
|
|
95
102
|
}
|
|
96
103
|
function Content(t0) {
|
|
97
|
-
const $ = _c(
|
|
104
|
+
const $ = _c(76);
|
|
98
105
|
let drawerSlug;
|
|
106
|
+
let fromFolderID;
|
|
99
107
|
let fromFolderName;
|
|
100
108
|
let itemsToMove;
|
|
101
109
|
let onConfirm;
|
|
110
|
+
let populateMoveToFolderDrawer;
|
|
102
111
|
let props;
|
|
103
112
|
let skipConfirmModal;
|
|
104
113
|
if ($[0] !== t0) {
|
|
105
114
|
({
|
|
106
115
|
drawerSlug,
|
|
116
|
+
fromFolderID,
|
|
107
117
|
fromFolderName,
|
|
108
118
|
itemsToMove,
|
|
109
119
|
onConfirm,
|
|
120
|
+
populateMoveToFolderDrawer,
|
|
110
121
|
skipConfirmModal,
|
|
111
122
|
...props
|
|
112
123
|
} = t0);
|
|
113
124
|
$[0] = t0;
|
|
114
125
|
$[1] = drawerSlug;
|
|
115
|
-
$[2] =
|
|
116
|
-
$[3] =
|
|
117
|
-
$[4] =
|
|
118
|
-
$[5] =
|
|
119
|
-
$[6] =
|
|
126
|
+
$[2] = fromFolderID;
|
|
127
|
+
$[3] = fromFolderName;
|
|
128
|
+
$[4] = itemsToMove;
|
|
129
|
+
$[5] = onConfirm;
|
|
130
|
+
$[6] = populateMoveToFolderDrawer;
|
|
131
|
+
$[7] = props;
|
|
132
|
+
$[8] = skipConfirmModal;
|
|
120
133
|
} else {
|
|
121
134
|
drawerSlug = $[1];
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
135
|
+
fromFolderID = $[2];
|
|
136
|
+
fromFolderName = $[3];
|
|
137
|
+
itemsToMove = $[4];
|
|
138
|
+
onConfirm = $[5];
|
|
139
|
+
populateMoveToFolderDrawer = $[6];
|
|
140
|
+
props = $[7];
|
|
141
|
+
skipConfirmModal = $[8];
|
|
127
142
|
}
|
|
143
|
+
const {
|
|
144
|
+
clearRouteCache
|
|
145
|
+
} = useRouteCache();
|
|
128
146
|
const {
|
|
129
147
|
closeModal,
|
|
148
|
+
isModalOpen,
|
|
130
149
|
openModal
|
|
131
150
|
} = useModal();
|
|
132
151
|
let t1;
|
|
133
|
-
if ($[
|
|
152
|
+
if ($[9] !== itemsToMove) {
|
|
134
153
|
t1 = () => itemsToMove.length;
|
|
135
|
-
$[
|
|
136
|
-
$[
|
|
154
|
+
$[9] = itemsToMove;
|
|
155
|
+
$[10] = t1;
|
|
137
156
|
} else {
|
|
138
|
-
t1 = $[
|
|
157
|
+
t1 = $[10];
|
|
139
158
|
}
|
|
140
159
|
const [count] = React.useState(t1);
|
|
160
|
+
const [folderAddedToUnderlyingFolder, setFolderAddedToUnderlyingFolder] = React.useState(false);
|
|
141
161
|
const {
|
|
142
162
|
i18n,
|
|
143
163
|
t
|
|
144
164
|
} = useTranslation();
|
|
145
165
|
const {
|
|
146
|
-
addItems,
|
|
147
166
|
breadcrumbs,
|
|
148
167
|
folderCollectionConfig,
|
|
149
168
|
folderCollectionSlug,
|
|
150
169
|
folderFieldName,
|
|
151
170
|
folderID,
|
|
171
|
+
FolderResultsComponent,
|
|
152
172
|
getSelectedItems,
|
|
153
|
-
setFolderID,
|
|
154
173
|
subfolders
|
|
155
174
|
} = useFolder();
|
|
156
175
|
let t2;
|
|
157
|
-
if ($[
|
|
176
|
+
if ($[11] !== folderCollectionSlug) {
|
|
158
177
|
t2 = {
|
|
159
178
|
collectionSlug: folderCollectionSlug
|
|
160
179
|
};
|
|
161
|
-
$[
|
|
162
|
-
$[
|
|
180
|
+
$[11] = folderCollectionSlug;
|
|
181
|
+
$[12] = t2;
|
|
163
182
|
} else {
|
|
164
|
-
t2 = $[
|
|
183
|
+
t2 = $[12];
|
|
165
184
|
}
|
|
166
185
|
const [FolderDocumentDrawer,, t3] = useDocumentDrawer(t2);
|
|
167
186
|
const {
|
|
168
187
|
closeDrawer: closeFolderDrawer,
|
|
169
188
|
openDrawer: openFolderDrawer
|
|
170
189
|
} = t3;
|
|
171
|
-
const {
|
|
172
|
-
getEntityConfig
|
|
173
|
-
} = useConfig();
|
|
174
190
|
let t4;
|
|
175
|
-
if ($[
|
|
191
|
+
if ($[13] !== breadcrumbs || $[14] !== getSelectedItems) {
|
|
176
192
|
t4 = () => {
|
|
177
193
|
const selected = getSelectedItems();
|
|
178
194
|
if (selected.length === 0) {
|
|
@@ -188,121 +204,159 @@ function Content(t0) {
|
|
|
188
204
|
};
|
|
189
205
|
}
|
|
190
206
|
};
|
|
191
|
-
$[
|
|
192
|
-
$[
|
|
193
|
-
$[
|
|
207
|
+
$[13] = breadcrumbs;
|
|
208
|
+
$[14] = getSelectedItems;
|
|
209
|
+
$[15] = t4;
|
|
194
210
|
} else {
|
|
195
|
-
t4 = $[
|
|
211
|
+
t4 = $[15];
|
|
196
212
|
}
|
|
197
213
|
const getSelectedFolder = t4;
|
|
198
214
|
let t5;
|
|
199
|
-
if ($[
|
|
200
|
-
t5 = t6 => {
|
|
215
|
+
if ($[16] !== folderCollectionSlug || $[17] !== folderID || $[18] !== fromFolderID || $[19] !== populateMoveToFolderDrawer) {
|
|
216
|
+
t5 = async t6 => {
|
|
201
217
|
const {
|
|
202
218
|
collectionSlug,
|
|
203
219
|
doc
|
|
204
220
|
} = t6;
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
folderFieldName,
|
|
210
|
-
isUpload: Boolean(collectionConfig?.upload),
|
|
211
|
-
relationTo: collectionSlug,
|
|
212
|
-
useAsTitle: collectionConfig.admin.useAsTitle,
|
|
213
|
-
value: doc
|
|
214
|
-
})]);
|
|
221
|
+
await populateMoveToFolderDrawer(folderID);
|
|
222
|
+
if (collectionSlug === folderCollectionSlug && (doc?.folder && fromFolderID === extractID(doc?.folder) || !fromFolderID && !doc?.folder)) {
|
|
223
|
+
setFolderAddedToUnderlyingFolder(true);
|
|
224
|
+
}
|
|
215
225
|
};
|
|
216
|
-
$[
|
|
217
|
-
$[
|
|
218
|
-
$[
|
|
219
|
-
$[
|
|
226
|
+
$[16] = folderCollectionSlug;
|
|
227
|
+
$[17] = folderID;
|
|
228
|
+
$[18] = fromFolderID;
|
|
229
|
+
$[19] = populateMoveToFolderDrawer;
|
|
230
|
+
$[20] = t5;
|
|
220
231
|
} else {
|
|
221
|
-
t5 = $[
|
|
232
|
+
t5 = $[20];
|
|
222
233
|
}
|
|
223
234
|
const onCreateSuccess = t5;
|
|
224
235
|
let t6;
|
|
225
|
-
if ($[
|
|
236
|
+
if ($[21] !== getSelectedFolder || $[22] !== onConfirm) {
|
|
226
237
|
t6 = () => {
|
|
227
238
|
if (typeof onConfirm === "function") {
|
|
228
239
|
onConfirm(getSelectedFolder());
|
|
229
240
|
}
|
|
230
241
|
};
|
|
231
|
-
$[
|
|
232
|
-
$[
|
|
233
|
-
$[
|
|
242
|
+
$[21] = getSelectedFolder;
|
|
243
|
+
$[22] = onConfirm;
|
|
244
|
+
$[23] = t6;
|
|
234
245
|
} else {
|
|
235
|
-
t6 = $[
|
|
246
|
+
t6 = $[23];
|
|
236
247
|
}
|
|
237
248
|
const onConfirmMove = t6;
|
|
238
249
|
let t7;
|
|
239
|
-
|
|
250
|
+
let t8;
|
|
251
|
+
if ($[24] !== clearRouteCache || $[25] !== drawerSlug || $[26] !== folderAddedToUnderlyingFolder || $[27] !== isModalOpen) {
|
|
240
252
|
t7 = () => {
|
|
253
|
+
if (!isModalOpen(drawerSlug) && folderAddedToUnderlyingFolder) {
|
|
254
|
+
setFolderAddedToUnderlyingFolder(false);
|
|
255
|
+
clearRouteCache();
|
|
256
|
+
}
|
|
257
|
+
};
|
|
258
|
+
t8 = [drawerSlug, isModalOpen, clearRouteCache, folderAddedToUnderlyingFolder];
|
|
259
|
+
$[24] = clearRouteCache;
|
|
260
|
+
$[25] = drawerSlug;
|
|
261
|
+
$[26] = folderAddedToUnderlyingFolder;
|
|
262
|
+
$[27] = isModalOpen;
|
|
263
|
+
$[28] = t7;
|
|
264
|
+
$[29] = t8;
|
|
265
|
+
} else {
|
|
266
|
+
t7 = $[28];
|
|
267
|
+
t8 = $[29];
|
|
268
|
+
}
|
|
269
|
+
React.useEffect(t7, t8);
|
|
270
|
+
let t9;
|
|
271
|
+
if ($[30] !== closeModal || $[31] !== drawerSlug) {
|
|
272
|
+
t9 = () => {
|
|
241
273
|
closeModal(drawerSlug);
|
|
242
274
|
};
|
|
243
|
-
$[
|
|
244
|
-
$[
|
|
245
|
-
$[
|
|
275
|
+
$[30] = closeModal;
|
|
276
|
+
$[31] = drawerSlug;
|
|
277
|
+
$[32] = t9;
|
|
246
278
|
} else {
|
|
247
|
-
|
|
279
|
+
t9 = $[32];
|
|
248
280
|
}
|
|
249
|
-
let
|
|
250
|
-
if ($[
|
|
251
|
-
|
|
281
|
+
let t10;
|
|
282
|
+
if ($[33] !== onConfirmMove || $[34] !== openModal || $[35] !== skipConfirmModal) {
|
|
283
|
+
t10 = () => {
|
|
252
284
|
if (skipConfirmModal) {
|
|
253
285
|
onConfirmMove();
|
|
254
286
|
} else {
|
|
255
287
|
openModal(confirmModalSlug);
|
|
256
288
|
}
|
|
257
289
|
};
|
|
258
|
-
$[
|
|
259
|
-
$[
|
|
260
|
-
$[
|
|
261
|
-
$[
|
|
290
|
+
$[33] = onConfirmMove;
|
|
291
|
+
$[34] = openModal;
|
|
292
|
+
$[35] = skipConfirmModal;
|
|
293
|
+
$[36] = t10;
|
|
262
294
|
} else {
|
|
263
|
-
|
|
295
|
+
t10 = $[36];
|
|
264
296
|
}
|
|
265
|
-
let
|
|
266
|
-
if ($[
|
|
267
|
-
let
|
|
268
|
-
if ($[
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
folderID: null
|
|
272
|
-
});
|
|
297
|
+
let t11;
|
|
298
|
+
if ($[37] !== FolderDocumentDrawer || $[38] !== FolderResultsComponent || $[39] !== breadcrumbs || $[40] !== closeFolderDrawer || $[41] !== count || $[42] !== folderCollectionConfig || $[43] !== folderCollectionSlug || $[44] !== folderFieldName || $[45] !== folderID || $[46] !== fromFolderID || $[47] !== fromFolderName || $[48] !== getSelectedFolder || $[49] !== i18n || $[50] !== onConfirmMove || $[51] !== onCreateSuccess || $[52] !== openFolderDrawer || $[53] !== populateMoveToFolderDrawer || $[54] !== props.action || $[55] !== props.title || $[56] !== skipConfirmModal || $[57] !== subfolders.length || $[58] !== t || $[59] !== t10 || $[60] !== t9) {
|
|
299
|
+
let t12;
|
|
300
|
+
if ($[62] !== breadcrumbs.length || $[63] !== populateMoveToFolderDrawer) {
|
|
301
|
+
t12 = breadcrumbs.length ? () => {
|
|
302
|
+
populateMoveToFolderDrawer(null);
|
|
273
303
|
} : undefined;
|
|
274
|
-
$[
|
|
275
|
-
$[
|
|
276
|
-
$[
|
|
304
|
+
$[62] = breadcrumbs.length;
|
|
305
|
+
$[63] = populateMoveToFolderDrawer;
|
|
306
|
+
$[64] = t12;
|
|
277
307
|
} else {
|
|
278
|
-
|
|
308
|
+
t12 = $[64];
|
|
279
309
|
}
|
|
280
|
-
let
|
|
281
|
-
if ($[
|
|
282
|
-
|
|
310
|
+
let t13;
|
|
311
|
+
if ($[65] !== breadcrumbs.length || $[66] !== populateMoveToFolderDrawer) {
|
|
312
|
+
t13 = (crumb, index) => ({
|
|
283
313
|
id: crumb.id,
|
|
284
314
|
name: crumb.name,
|
|
285
315
|
onClick: index !== breadcrumbs.length - 1 ? () => {
|
|
286
|
-
|
|
287
|
-
folderID: crumb.id
|
|
288
|
-
});
|
|
316
|
+
populateMoveToFolderDrawer(crumb.id);
|
|
289
317
|
} : undefined
|
|
290
318
|
});
|
|
291
|
-
$[
|
|
292
|
-
$[
|
|
293
|
-
$[
|
|
319
|
+
$[65] = breadcrumbs.length;
|
|
320
|
+
$[66] = populateMoveToFolderDrawer;
|
|
321
|
+
$[67] = t13;
|
|
294
322
|
} else {
|
|
295
|
-
|
|
323
|
+
t13 = $[67];
|
|
296
324
|
}
|
|
297
|
-
|
|
325
|
+
let t14;
|
|
326
|
+
if ($[68] !== FolderResultsComponent || $[69] !== folderCollectionConfig || $[70] !== folderCollectionSlug || $[71] !== i18n || $[72] !== onCreateSuccess || $[73] !== subfolders.length || $[74] !== t) {
|
|
327
|
+
t14 = subfolders.length > 0 ? FolderResultsComponent : _jsx(NoListResults, {
|
|
328
|
+
Actions: [_jsx(ListCreateNewDocInFolderButton, {
|
|
329
|
+
buttonLabel: `${t("general:create")} ${getTranslation(folderCollectionConfig.labels?.singular, i18n).toLowerCase()}`,
|
|
330
|
+
collectionSlugs: [folderCollectionSlug],
|
|
331
|
+
onCreateSuccess,
|
|
332
|
+
slugPrefix: "create-new-folder-from-drawer--no-results"
|
|
333
|
+
}, "create-folder")],
|
|
334
|
+
Message: _jsx("p", {
|
|
335
|
+
children: i18n.t("general:noResults", {
|
|
336
|
+
label: `${getTranslation(folderCollectionConfig.labels?.plural, i18n)}`
|
|
337
|
+
})
|
|
338
|
+
})
|
|
339
|
+
});
|
|
340
|
+
$[68] = FolderResultsComponent;
|
|
341
|
+
$[69] = folderCollectionConfig;
|
|
342
|
+
$[70] = folderCollectionSlug;
|
|
343
|
+
$[71] = i18n;
|
|
344
|
+
$[72] = onCreateSuccess;
|
|
345
|
+
$[73] = subfolders.length;
|
|
346
|
+
$[74] = t;
|
|
347
|
+
$[75] = t14;
|
|
348
|
+
} else {
|
|
349
|
+
t14 = $[75];
|
|
350
|
+
}
|
|
351
|
+
t11 = _jsxs(_Fragment, {
|
|
298
352
|
children: [_jsx(DrawerActionHeader, {
|
|
299
|
-
onCancel:
|
|
300
|
-
onSave:
|
|
353
|
+
onCancel: t9,
|
|
354
|
+
onSave: t10,
|
|
301
355
|
saveLabel: t("general:select"),
|
|
302
356
|
title: _jsx(DrawerHeading, {
|
|
303
357
|
action: props.action,
|
|
304
358
|
count,
|
|
305
|
-
fromFolderName:
|
|
359
|
+
fromFolderName: fromFolderID ? fromFolderName : undefined,
|
|
306
360
|
title: props.action === "moveItemToFolder" ? props.title : undefined
|
|
307
361
|
})
|
|
308
362
|
}), _jsxs("div", {
|
|
@@ -314,8 +368,8 @@ function Content(t0) {
|
|
|
314
368
|
className: `${baseClass}__folder-breadcrumbs-root`,
|
|
315
369
|
children: [_jsx(ColoredFolderIcon, {}), t("folder:folders")]
|
|
316
370
|
}),
|
|
317
|
-
onClick:
|
|
318
|
-
}, ...breadcrumbs.map(
|
|
371
|
+
onClick: t12
|
|
372
|
+
}, ...breadcrumbs.map(t13)]
|
|
319
373
|
}), subfolders.length > 0 && _jsxs(_Fragment, {
|
|
320
374
|
children: [_jsx(Button, {
|
|
321
375
|
buttonStyle: "pill",
|
|
@@ -332,12 +386,10 @@ function Content(t0) {
|
|
|
332
386
|
[folderFieldName]: folderID
|
|
333
387
|
},
|
|
334
388
|
onSave: result => {
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
});
|
|
340
|
-
}
|
|
389
|
+
onCreateSuccess({
|
|
390
|
+
collectionSlug: folderCollectionConfig.slug,
|
|
391
|
+
doc: result.doc
|
|
392
|
+
});
|
|
341
393
|
closeFolderDrawer();
|
|
342
394
|
},
|
|
343
395
|
redirectAfterCreate: false
|
|
@@ -345,24 +397,7 @@ function Content(t0) {
|
|
|
345
397
|
})]
|
|
346
398
|
}), _jsx(DrawerContentContainer, {
|
|
347
399
|
className: `${baseClass}__body-section`,
|
|
348
|
-
children:
|
|
349
|
-
disabledItemKeys: new Set(itemsToMove.map(_temp)),
|
|
350
|
-
items: subfolders,
|
|
351
|
-
selectedItemKeys: new Set([`${folderCollectionSlug}-${getSelectedFolder().id}`]),
|
|
352
|
-
type: "folder"
|
|
353
|
-
}) : _jsx(NoListResults, {
|
|
354
|
-
Actions: [_jsx(ListCreateNewDocInFolderButton, {
|
|
355
|
-
buttonLabel: `${t("general:create")} ${getTranslation(folderCollectionConfig.labels?.singular, i18n).toLowerCase()}`,
|
|
356
|
-
collectionSlugs: [folderCollectionSlug],
|
|
357
|
-
onCreateSuccess,
|
|
358
|
-
slugPrefix: "create-new-folder-from-drawer--no-results"
|
|
359
|
-
}, "create-folder")],
|
|
360
|
-
Message: _jsx("p", {
|
|
361
|
-
children: i18n.t("general:noResults", {
|
|
362
|
-
label: `${getTranslation(folderCollectionConfig.labels?.plural, i18n)}`
|
|
363
|
-
})
|
|
364
|
-
})
|
|
365
|
-
})
|
|
400
|
+
children: t14
|
|
366
401
|
}), !skipConfirmModal && _jsx(ConfirmationModal, {
|
|
367
402
|
body: _jsx(ConfirmationMessage, {
|
|
368
403
|
action: props.action,
|
|
@@ -378,41 +413,35 @@ function Content(t0) {
|
|
|
378
413
|
onConfirm: onConfirmMove
|
|
379
414
|
})]
|
|
380
415
|
});
|
|
381
|
-
$[
|
|
382
|
-
$[
|
|
383
|
-
$[
|
|
384
|
-
$[
|
|
385
|
-
$[
|
|
386
|
-
$[
|
|
387
|
-
$[
|
|
388
|
-
$[
|
|
389
|
-
$[
|
|
390
|
-
$[
|
|
391
|
-
$[
|
|
392
|
-
$[
|
|
393
|
-
$[
|
|
394
|
-
$[
|
|
395
|
-
$[
|
|
396
|
-
$[
|
|
397
|
-
$[
|
|
398
|
-
$[
|
|
399
|
-
$[
|
|
400
|
-
$[
|
|
401
|
-
$[
|
|
402
|
-
$[
|
|
403
|
-
$[
|
|
404
|
-
$[
|
|
405
|
-
$[
|
|
416
|
+
$[37] = FolderDocumentDrawer;
|
|
417
|
+
$[38] = FolderResultsComponent;
|
|
418
|
+
$[39] = breadcrumbs;
|
|
419
|
+
$[40] = closeFolderDrawer;
|
|
420
|
+
$[41] = count;
|
|
421
|
+
$[42] = folderCollectionConfig;
|
|
422
|
+
$[43] = folderCollectionSlug;
|
|
423
|
+
$[44] = folderFieldName;
|
|
424
|
+
$[45] = folderID;
|
|
425
|
+
$[46] = fromFolderID;
|
|
426
|
+
$[47] = fromFolderName;
|
|
427
|
+
$[48] = getSelectedFolder;
|
|
428
|
+
$[49] = i18n;
|
|
429
|
+
$[50] = onConfirmMove;
|
|
430
|
+
$[51] = onCreateSuccess;
|
|
431
|
+
$[52] = openFolderDrawer;
|
|
432
|
+
$[53] = populateMoveToFolderDrawer;
|
|
433
|
+
$[54] = props.action;
|
|
434
|
+
$[55] = props.title;
|
|
435
|
+
$[56] = skipConfirmModal;
|
|
436
|
+
$[57] = subfolders.length;
|
|
437
|
+
$[58] = t;
|
|
438
|
+
$[59] = t10;
|
|
439
|
+
$[60] = t9;
|
|
440
|
+
$[61] = t11;
|
|
406
441
|
} else {
|
|
407
|
-
|
|
442
|
+
t11 = $[61];
|
|
408
443
|
}
|
|
409
|
-
return
|
|
410
|
-
}
|
|
411
|
-
function _temp(t0) {
|
|
412
|
-
const {
|
|
413
|
-
itemKey
|
|
414
|
-
} = t0;
|
|
415
|
-
return itemKey;
|
|
444
|
+
return t11;
|
|
416
445
|
}
|
|
417
446
|
function DrawerHeading(props) {
|
|
418
447
|
const $ = _c(14);
|
|
@@ -501,8 +530,8 @@ function ConfirmationMessage(props) {
|
|
|
501
530
|
if ($[0] !== props.title || $[1] !== props.toFolderName || $[2] !== t) {
|
|
502
531
|
t0 = _jsx(Translation, {
|
|
503
532
|
elements: {
|
|
504
|
-
1:
|
|
505
|
-
2:
|
|
533
|
+
1: _temp,
|
|
534
|
+
2: _temp2
|
|
506
535
|
},
|
|
507
536
|
i18nKey: "folder:moveItemToFolderConfirmation",
|
|
508
537
|
t,
|
|
@@ -524,7 +553,7 @@ function ConfirmationMessage(props) {
|
|
|
524
553
|
if ($[4] !== props.title || $[5] !== t) {
|
|
525
554
|
t0 = _jsx(Translation, {
|
|
526
555
|
elements: {
|
|
527
|
-
1:
|
|
556
|
+
1: _temp3
|
|
528
557
|
},
|
|
529
558
|
i18nKey: "folder:moveItemToRootConfirmation",
|
|
530
559
|
t,
|
|
@@ -548,8 +577,8 @@ function ConfirmationMessage(props) {
|
|
|
548
577
|
if ($[7] !== props.count || $[8] !== props.toFolderName || $[9] !== t) {
|
|
549
578
|
t0 = _jsx(Translation, {
|
|
550
579
|
elements: {
|
|
551
|
-
1:
|
|
552
|
-
2:
|
|
580
|
+
1: _temp4,
|
|
581
|
+
2: _temp5
|
|
553
582
|
},
|
|
554
583
|
i18nKey: "folder:moveItemsToFolderConfirmation",
|
|
555
584
|
t,
|
|
@@ -572,7 +601,7 @@ function ConfirmationMessage(props) {
|
|
|
572
601
|
if ($[11] !== props.count || $[12] !== t) {
|
|
573
602
|
t0 = _jsx(Translation, {
|
|
574
603
|
elements: {
|
|
575
|
-
1:
|
|
604
|
+
1: _temp6
|
|
576
605
|
},
|
|
577
606
|
i18nKey: "folder:moveItemsToRootConfirmation",
|
|
578
607
|
t,
|
|
@@ -592,7 +621,7 @@ function ConfirmationMessage(props) {
|
|
|
592
621
|
}
|
|
593
622
|
}
|
|
594
623
|
}
|
|
595
|
-
function
|
|
624
|
+
function _temp6(t0) {
|
|
596
625
|
const {
|
|
597
626
|
children: children_1
|
|
598
627
|
} = t0;
|
|
@@ -600,7 +629,7 @@ function _temp7(t0) {
|
|
|
600
629
|
children: children_1
|
|
601
630
|
});
|
|
602
631
|
}
|
|
603
|
-
function
|
|
632
|
+
function _temp5(t0) {
|
|
604
633
|
const {
|
|
605
634
|
children: children_0
|
|
606
635
|
} = t0;
|
|
@@ -608,7 +637,7 @@ function _temp6(t0) {
|
|
|
608
637
|
children: children_0
|
|
609
638
|
});
|
|
610
639
|
}
|
|
611
|
-
function
|
|
640
|
+
function _temp4(t0) {
|
|
612
641
|
const {
|
|
613
642
|
children
|
|
614
643
|
} = t0;
|
|
@@ -616,7 +645,7 @@ function _temp5(t0) {
|
|
|
616
645
|
children
|
|
617
646
|
});
|
|
618
647
|
}
|
|
619
|
-
function
|
|
648
|
+
function _temp3(t0) {
|
|
620
649
|
const {
|
|
621
650
|
children: children_4
|
|
622
651
|
} = t0;
|
|
@@ -624,7 +653,7 @@ function _temp4(t0) {
|
|
|
624
653
|
children: children_4
|
|
625
654
|
});
|
|
626
655
|
}
|
|
627
|
-
function
|
|
656
|
+
function _temp2(t0) {
|
|
628
657
|
const {
|
|
629
658
|
children: children_3
|
|
630
659
|
} = t0;
|
|
@@ -632,7 +661,7 @@ function _temp3(t0) {
|
|
|
632
661
|
children: children_3
|
|
633
662
|
});
|
|
634
663
|
}
|
|
635
|
-
function
|
|
664
|
+
function _temp(t0) {
|
|
636
665
|
const {
|
|
637
666
|
children: children_2
|
|
638
667
|
} = t0;
|