@opencloud-eu/web-pkg 6.0.0 → 6.2.0
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/TextEditor-CTRIgoeG.js +819 -0
- package/dist/assets/worker-BVTM6bn-.js +1 -0
- package/dist/assets/worker-Bv-mZ-VL.js +25 -0
- package/dist/assets/worker-Dx2ttEp-.js +25 -0
- package/dist/assets/worker-nUcRt7qV.js +25 -0
- package/dist/composables-CAlEpA5b.js +20172 -0
- package/dist/src/apps/types.d.ts +9 -9
- package/dist/src/components/AppBar/AppBar.vue.d.ts +82 -82
- package/dist/src/components/AppLoadingSpinner.vue.d.ts +2 -1
- package/dist/src/components/AppTemplates/AppWrapper.vue.d.ts +29 -33
- package/dist/src/components/AppTemplates/AppWrapperRoute.d.ts +1 -1
- package/dist/src/components/AppTemplates/PartialViews/ErrorScreen.vue.d.ts +5 -4
- package/dist/src/components/AppTemplates/PartialViews/LoadingScreen.vue.d.ts +2 -1
- package/dist/src/components/AppTopBar.vue.d.ts +4 -3
- package/dist/src/components/Avatars/AvatarUpload.vue.d.ts +3 -4
- package/dist/src/components/Avatars/UserAvatar.vue.d.ts +3 -1
- package/dist/src/components/BatchActions.vue.d.ts +16 -15
- package/dist/src/components/ContextActions/ActionMenuDropItem.vue.d.ts +3 -2
- package/dist/src/components/ContextActions/ActionMenuItem.vue.d.ts +9 -8
- package/dist/src/components/ContextActions/ContextActionMenu.vue.d.ts +19 -18
- package/dist/src/components/ContextActions/ContextMenuQuickAction.vue.d.ts +30 -385
- package/dist/src/components/CreateLinkModal.vue.d.ts +7 -5
- package/dist/src/components/CreateShortcutModal.vue.d.ts +36 -139
- package/dist/src/components/CustomComponentTarget.vue.d.ts +2 -1
- package/dist/src/components/FilesList/ContextActions.vue.d.ts +38 -37
- package/dist/src/components/FilesList/ResourceGhostElement.vue.d.ts +12 -11
- package/dist/src/components/FilesList/ResourceIcon.vue.d.ts +2 -1
- package/dist/src/components/FilesList/ResourceLink.vue.d.ts +7 -6
- package/dist/src/components/FilesList/ResourceListItem.vue.d.ts +5 -3
- package/dist/src/components/FilesList/ResourceName.vue.d.ts +4 -1
- package/dist/src/components/FilesList/ResourceSize.vue.d.ts +6 -5
- package/dist/src/components/FilesList/ResourceStatusIndicators.vue.d.ts +2 -1
- package/dist/src/components/FilesList/ResourceTable.vue.d.ts +38 -149
- package/dist/src/components/FilesList/ResourceTile.vue.d.ts +25 -149
- package/dist/src/components/FilesList/ResourceTiles.vue.d.ts +21 -114
- package/dist/src/components/Filters/DateFilter.vue.d.ts +26 -497
- package/dist/src/components/Filters/ItemFilterInline.vue.d.ts +6 -5
- package/dist/src/components/Groupware/Accounts/AccountsSwitch.vue.d.ts +3 -0
- package/dist/src/components/Groupware/Accounts/index.d.ts +1 -0
- package/dist/src/components/Groupware/index.d.ts +1 -0
- package/dist/src/components/ItemFilter.vue.d.ts +10 -203
- package/dist/src/components/ItemFilterToggle.vue.d.ts +6 -5
- package/dist/src/components/LinkRoleDropdown.vue.d.ts +7 -6
- package/dist/src/components/LoadingIndicator.vue.d.ts +5 -4
- package/dist/src/components/Modals/DatePickerModal.vue.d.ts +8 -7
- package/dist/src/components/Modals/EmojiPickerModal.vue.d.ts +6 -5
- package/dist/src/components/Modals/FilePickerModal.vue.d.ts +8 -7
- package/dist/src/components/Modals/ResourceConflictModal.vue.d.ts +9 -8
- package/dist/src/components/Modals/SaveAsModal.vue.d.ts +8 -7
- package/dist/src/components/Modals/SpaceMoveInfoModal.vue.d.ts +5 -4
- package/dist/src/components/Modals/UnsavedChangesModal.vue.d.ts +5 -4
- package/dist/src/components/NoContentMessage.vue.d.ts +9 -12
- package/dist/src/components/Pagination.vue.d.ts +5 -4
- package/dist/src/components/QuotaSelect.vue.d.ts +7 -6
- package/dist/src/components/Search/ResourcePreview.vue.d.ts +2 -41
- package/dist/src/components/SearchBarFilter.vue.d.ts +7 -6
- package/dist/src/components/SideBar/CompareSaveDialog.vue.d.ts +6 -5
- package/dist/src/components/SideBar/FileSideBar.vue.d.ts +2 -76
- package/dist/src/components/SideBar/Files/FileInfo.vue.d.ts +2 -1
- package/dist/src/components/SideBar/SideBar.vue.d.ts +10 -19
- package/dist/src/components/SideBar/SideBarPanels.vue.d.ts +10 -19
- package/dist/src/components/SideBar/Spaces/Details/SpaceDetails.vue.d.ts +2 -1
- package/dist/src/components/SideBar/Spaces/Details/SpaceDetailsMultiple.vue.d.ts +2 -1
- package/dist/src/components/SideBar/Spaces/SpaceInfo.vue.d.ts +6 -1
- package/dist/src/components/SideBar/Spaces/SpaceNoSelection.vue.d.ts +2 -1
- package/dist/src/components/SideBar/WebDavDetails.vue.d.ts +7 -6
- package/dist/src/components/SpaceQuota.vue.d.ts +2 -1
- package/dist/src/components/Spaces/QuotaModal.vue.d.ts +5 -4
- package/dist/src/components/Spaces/SpaceImageModal.vue.d.ts +4 -4
- package/dist/src/components/TextEditor/TextEditor.vue.d.ts +18 -0
- package/dist/src/components/TextEditor/index.d.ts +17 -0
- package/dist/src/components/VersionCheck.vue.d.ts +2 -1
- package/dist/src/components/ViewOptions.vue.d.ts +2 -1
- package/dist/src/components/index.d.ts +1 -1
- package/dist/src/composables/actions/files/useFileActionFallbackToDownload.d.ts +1 -1
- package/dist/src/composables/actions/files/useFileActions.d.ts +2 -2
- package/dist/src/composables/actions/files/useFileActionsCopy.d.ts +1 -1
- package/dist/src/composables/actions/files/useFileActionsCopyPermanentLink.d.ts +1 -1
- package/dist/src/composables/actions/files/useFileActionsCreateLink.d.ts +1 -1
- package/dist/src/composables/actions/files/useFileActionsCreateNewFile.d.ts +1 -1
- package/dist/src/composables/actions/files/useFileActionsCreateNewFolder.d.ts +1 -1
- package/dist/src/composables/actions/files/useFileActionsCreateNewShortcut.d.ts +1 -1
- package/dist/src/composables/actions/files/useFileActionsCreateSpaceFromResource.d.ts +1 -1
- package/dist/src/composables/actions/files/useFileActionsDelete.d.ts +1 -1
- package/dist/src/composables/actions/files/useFileActionsDisableSync.d.ts +1 -1
- package/dist/src/composables/actions/files/useFileActionsDownloadArchive.d.ts +1 -1
- package/dist/src/composables/actions/files/useFileActionsDownloadFile.d.ts +1 -1
- package/dist/src/composables/actions/files/useFileActionsEmptyTrashBin.d.ts +1 -1
- package/dist/src/composables/actions/files/useFileActionsEnableSync.d.ts +1 -1
- package/dist/src/composables/actions/files/useFileActionsFavorite.d.ts +1 -1
- package/dist/src/composables/actions/files/useFileActionsMove.d.ts +1 -1
- package/dist/src/composables/actions/files/useFileActionsNavigate.d.ts +1 -1
- package/dist/src/composables/actions/files/useFileActionsOpenShortcut.d.ts +1 -1
- package/dist/src/composables/actions/files/useFileActionsOpenWithApp.d.ts +1 -1
- package/dist/src/composables/actions/files/useFileActionsOpenWithDefault.d.ts +1 -1
- package/dist/src/composables/actions/files/useFileActionsPaste.d.ts +1 -1
- package/dist/src/composables/actions/files/useFileActionsRename.d.ts +2 -2
- package/dist/src/composables/actions/files/useFileActionsRestore.d.ts +2 -2
- package/dist/src/composables/actions/files/useFileActionsSaveAs.d.ts +1 -1
- package/dist/src/composables/actions/files/useFileActionsSetImage.d.ts +1 -1
- package/dist/src/composables/actions/files/useFileActionsShowActions.d.ts +1 -1
- package/dist/src/composables/actions/files/useFileActionsShowDetails.d.ts +1 -1
- package/dist/src/composables/actions/files/useFileActionsShowShares.d.ts +1 -1
- package/dist/src/composables/actions/files/useFileActionsToggleHideShare.d.ts +1 -1
- package/dist/src/composables/actions/files/useFileActionsUndoDelete.d.ts +2 -2
- package/dist/src/composables/actions/helpers/useIsAppActive.d.ts +1 -1
- package/dist/src/composables/actions/helpers/useIsFilesAppActive.d.ts +1 -1
- package/dist/src/composables/actions/helpers/useIsSearchActive.d.ts +1 -1
- package/dist/src/composables/actions/spaces/useSpaceActionsCreate.d.ts +1 -1
- package/dist/src/composables/actions/spaces/useSpaceActionsDelete.d.ts +1 -1
- package/dist/src/composables/actions/spaces/useSpaceActionsDeleteImage.d.ts +1 -1
- package/dist/src/composables/actions/spaces/useSpaceActionsDisable.d.ts +1 -1
- package/dist/src/composables/actions/spaces/useSpaceActionsDuplicate.d.ts +1 -1
- package/dist/src/composables/actions/spaces/useSpaceActionsEditDescription.d.ts +1 -1
- package/dist/src/composables/actions/spaces/useSpaceActionsEditQuota.d.ts +1 -1
- package/dist/src/composables/actions/spaces/useSpaceActionsEditReadmeContent.d.ts +1 -1
- package/dist/src/composables/actions/spaces/useSpaceActionsNavigateToTrash.d.ts +1 -1
- package/dist/src/composables/actions/spaces/useSpaceActionsRename.d.ts +1 -1
- package/dist/src/composables/actions/spaces/useSpaceActionsRestore.d.ts +1 -1
- package/dist/src/composables/actions/spaces/useSpaceActionsSetIcon.d.ts +1 -1
- package/dist/src/composables/actions/spaces/useSpaceActionsShowMembers.d.ts +1 -1
- package/dist/src/composables/actions/types.d.ts +92 -2
- package/dist/src/composables/actions/useActionsShowDetails.d.ts +1 -1
- package/dist/src/composables/appDefaults/useAppConfig.d.ts +1 -1
- package/dist/src/composables/appDefaults/useAppDocumentTitle.d.ts +2 -1
- package/dist/src/composables/appDefaults/useAppFileHandling.d.ts +4 -2
- package/dist/src/composables/appDefaults/useAppMeta.d.ts +1 -1
- package/dist/src/composables/authContext/useAuthService.d.ts +3 -1
- package/dist/src/composables/authContext/useRequest.d.ts +2 -2
- package/dist/src/composables/driveResolver/useSpacesLoading.d.ts +1 -1
- package/dist/src/composables/embedMode/useEmbedMode.d.ts +8 -8
- package/dist/src/composables/eventBus/useEventBus.d.ts +1 -1
- package/dist/src/composables/filesList/useResourceRouteResolver.d.ts +1 -1
- package/dist/src/composables/folderLink/useFolderLink.d.ts +2 -2
- package/dist/src/composables/isTopBarSticky/useIsTopBarSticky.d.ts +1 -1
- package/dist/src/composables/keyboardActions/useInterceptModifierClick.d.ts +1 -1
- package/dist/src/composables/keyboardActions/useKeyboardActions.d.ts +1 -0
- package/dist/src/composables/links/useLinkTypes.d.ts +1 -1
- package/dist/src/composables/localStorage/useLocalStorage.d.ts +1 -1
- package/dist/src/composables/navItems/useNavItems.d.ts +1 -1
- package/dist/src/composables/piniaStores/apps.d.ts +31 -31
- package/dist/src/composables/piniaStores/auth.d.ts +25 -25
- package/dist/src/composables/piniaStores/avatars.d.ts +9 -9
- package/dist/src/composables/piniaStores/capabilities.d.ts +160 -160
- package/dist/src/composables/piniaStores/clipboard.d.ts +49 -49
- package/dist/src/composables/piniaStores/config/config.d.ts +135 -141
- package/dist/src/composables/piniaStores/config/types.d.ts +6 -20
- package/dist/src/composables/piniaStores/extensionRegistry/extensionPreferences.d.ts +4 -4
- package/dist/src/composables/piniaStores/extensionRegistry/extensionRegistry.d.ts +1 -1
- package/dist/src/composables/piniaStores/groupware/accounts.d.ts +511 -0
- package/dist/src/composables/piniaStores/{groupwareConfig/groupwareConfig.d.ts → groupware/config.d.ts} +107 -80
- package/dist/src/composables/piniaStores/groupware/index.d.ts +3 -0
- package/dist/src/composables/piniaStores/{groupwareConfig → groupware}/types.d.ts +30 -18
- package/dist/src/composables/piniaStores/index.d.ts +1 -1
- package/dist/src/composables/piniaStores/messages.d.ts +34 -616
- package/dist/src/composables/piniaStores/modals.d.ts +197 -209
- package/dist/src/composables/piniaStores/resources.d.ts +11 -11
- package/dist/src/composables/piniaStores/shares/shares.d.ts +1 -1
- package/dist/src/composables/piniaStores/shares/types.d.ts +2 -1
- package/dist/src/composables/piniaStores/sideBar.d.ts +7 -7
- package/dist/src/composables/piniaStores/spaces.d.ts +189 -188
- package/dist/src/composables/piniaStores/theme.d.ts +10 -10
- package/dist/src/composables/piniaStores/updates.d.ts +10 -10
- package/dist/src/composables/piniaStores/user.d.ts +5 -5
- package/dist/src/composables/piniaStores/webWorkers.d.ts +1 -1
- package/dist/src/composables/requestHeaders/useRequestHeaders.d.ts +1 -1
- package/dist/src/composables/resources/useGetResourceContext.d.ts +26 -26
- package/dist/src/composables/resources/useLoadPreview.d.ts +1 -1
- package/dist/src/composables/resources/useResourceContents.d.ts +1 -1
- package/dist/src/composables/resources/useResourceIndicators.d.ts +12 -1
- package/dist/src/composables/resources/useResourceViewDrag.d.ts +13 -13
- package/dist/src/composables/resources/useResourceViewHelpers.d.ts +18 -18
- package/dist/src/composables/resources/useResourceViewSelection.d.ts +2 -2
- package/dist/src/composables/selection/useSelectedResources.d.ts +2 -1
- package/dist/src/composables/spaces/useCreateSpace.d.ts +1 -1
- package/dist/src/composables/spaces/useSpaceHelpers.d.ts +1 -1
- package/dist/src/composables/webWorkers/deleteWorker/useDeleteWorker.d.ts +1 -1
- package/dist/src/composables/webWorkers/pasteWorker/usePasteWorker.d.ts +2 -2
- package/dist/src/composables/webWorkers/restoreWorker/useRestoreWorker.d.ts +1 -1
- package/dist/src/composables/webWorkers/tokenTimerWorker/useTokenTimerWorker.d.ts +3 -1
- package/dist/src/extensionPoints.d.ts +1 -1
- package/dist/src/helpers/resource/conflictHandling/conflictDialog.d.ts +1 -1
- package/dist/src/helpers/resource/conflictHandling/transfer.d.ts +4 -4
- package/dist/src/helpers/resource/conflictHandling/types.d.ts +1 -1
- package/dist/src/helpers/share/driveItem.d.ts +1 -1
- package/dist/src/router/common.d.ts +1 -1
- package/dist/src/router/index.d.ts +2 -1
- package/dist/src/router/public.d.ts +1 -1
- package/dist/src/router/shares.d.ts +1 -1
- package/dist/src/router/spaces.d.ts +1 -1
- package/dist/src/router/trash.d.ts +1 -1
- package/dist/src/services/passwordPolicy/rules.d.ts +63 -0
- package/dist/src/services/preview/types.d.ts +1 -1
- package/dist/src/services/uppy/DropTarget/plugin.d.ts +2 -1
- package/dist/src/services/uppy/uppyService.d.ts +3 -3
- package/dist/web-pkg.js +4181 -352
- package/package.json +37 -38
- package/dist/TextEditor-D-HQDUkm.js +0 -865
- package/dist/assets/worker-BBQqm_-D.js +0 -1
- package/dist/assets/worker-CVwKToFD.js +0 -21
- package/dist/assets/worker-DJbU-qfq.js +0 -21
- package/dist/assets/worker-DyU7W9CZ.js +0 -21
- package/dist/index-OU30YA6H.js +0 -25032
- package/dist/src/components/Navigation/MobileNav.vue.d.ts +0 -2
- package/dist/src/components/Navigation/index.d.ts +0 -1
- package/dist/src/composables/piniaStores/groupwareConfig/index.d.ts +0 -2
- package/dist/web-pkg.umd.cjs +0 -16
package/dist/web-pkg.js
CHANGED
|
@@ -1,353 +1,4182 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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
|
-
|
|
100
|
-
|
|
101
|
-
|
|
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
|
-
|
|
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
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
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
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
1
|
+
import { $ as e, $a as t, $i as n, $n as r, $r as i, $t as a, A as o, Aa as s, Ai as c, An as l, Ao as u, Ar as d, At as f, B as p, Ba as m, Bi as h, Bn as g, Bo as _, Br as v, Bt as y, C as b, Ca as x, Ci as S, Cn as C, Co as ee, Cr as w, Ct as T, D as te, Da as E, Di as D, Dn as O, Do as k, Dr as A, Dt as ne, E as re, Ea as j, Ei as ie, En as ae, Eo as M, Er as N, Et as oe, F as se, Fa as ce, Fi as le, Fn as ue, Fo as de, Fr as fe, Ft as pe, G as me, Ga as he, Gi as ge, Gn as _e, Go as ve, Gr as ye, Gt as be, H as xe, Ha as Se, Hi as Ce, Hn as we, Ho as Te, Hr as Ee, Ht as De, I as Oe, Ia as ke, Ii as Ae, In as je, Io as P, Ir as Me, It as Ne, J as Pe, Ja as Fe, Ji as Ie, Jn as Le, Jr as Re, Jt as ze, K as Be, Ka as Ve, Ki as He, Kn as Ue, Kr as We, Kt as Ge, L as Ke, La as qe, Li as Je, Ln as Ye, Lo as F, Lr as Xe, Lt as Ze, M as Qe, Ma as $e, Mi as et, Mn as tt, Mo as nt, Mr as rt, Mt as it, N as at, Na as ot, Ni as st, Nn as ct, No as lt, Nr as ut, Nt as dt, O as ft, Oa as pt, Oi as mt, On as ht, Oo as I, Or as gt, Ot as _t, P as vt, Pa as yt, Pi as bt, Pn as xt, Po as St, Pr as Ct, Pt as wt, Q as Tt, Qa as Et, Qi as Dt, Qn as Ot, Qr as kt, Qt as At, R as jt, Ra as Mt, Ri as Nt, Rn as Pt, Ro as L, Rr as Ft, Rt as It, S as Lt, Sa as Rt, Si as zt, Sn as Bt, So as Vt, Sr as Ht, St as Ut, T as Wt, Ta as Gt, Ti as Kt, Tn as qt, To as Jt, Tr as Yt, Tt as Xt, U as Zt, Ua as Qt, Ui as $t, Un as en, Uo as R, Ur as tn, Ut as nn, V as rn, Va as an, Vi as on, Vn as sn, Vo as z, Vr as cn, Vt as ln, W as un, Wa as dn, Wi as fn, Wn as pn, Wo as mn, Wr as hn, Wt as gn, X as _n, Xa as B, Xi as vn, Xn as yn, Xr as bn, Xt as xn, Y as Sn, Ya as Cn, Yi as wn, Yn as Tn, Yr as En, Yt as Dn, Z as On, Za as kn, Zi as An, Zn as jn, Zr as Mn, Zt as Nn, _ as Pn, _a as Fn, _i as In, _n as Ln, _o as Rn, _r as zn, _t as Bn, a as Vn, aa as Hn, ai as Un, an as Wn, ao as Gn, ar as Kn, at as qn, b as Jn, ba as Yn, bi as Xn, bn as Zn, bo as V, br as Qn, bt as $n, c as er, ca as tr, ci as nr, cn as rr, co as H, cr as ir, ct as ar, d as or, da as sr, di as cr, dn as lr, do as ur, dr, dt as fr, ea as pr, ei as mr, en as hr, eo as gr, er as _r, et as vr, f as yr, fa as br, fi as xr, fn as Sr, fo as Cr, fr as wr, ft as Tr, g as Er, ga as Dr, gi as Or, gn as kr, go as Ar, gr as jr, gt as Mr, h as Nr, ha as Pr, hi as Fr, hn as Ir, ho as U, hr as Lr, ht as Rr, i as zr, ia as Br, ii as Vr, in as Hr, io as W, ir as Ur, it as Wr, j as Gr, ja as Kr, ji as qr, jn as Jr, jo as G, jr as Yr, jt as Xr, k as Zr, ka as Qr, ki as $r, kn as ei, ko as ti, kr as ni, kt as ri, l as ii, la as ai, li as oi, ln as si, lo as K, lr as ci, lt as li, m as ui, ma as di, mi as fi, mn as pi, mo as mi, mr as hi, mt as gi, n as _i, na as vi, ni as yi, nn as bi, no as xi, nr as Si, nt as Ci, o as wi, oa as Ti, oi as Ei, on as Di, oo as q, or as Oi, ot as ki, p as Ai, pa as ji, pi as Mi, pn as Ni, po as J, pr as Pi, pt as Fi, q as Ii, qa as Li, qi as Ri, qn as zi, qr as Bi, qt as Vi, r as Hi, ra as Ui, ri as Wi, rn as Gi, ro as Ki, rr as qi, rt as Ji, s as Yi, sa as Xi, si as Zi, sn as Qi, so as Y, sr as $i, st as ea, t as ta, ta as na, ti as ra, tn as ia, to as aa, tr as oa, tt as sa, u as ca, ua as la, ui as ua, un as da, uo as X, ur as fa, ut as pa, v as ma, va as ha, vi as ga, vn as _a, vo as va, vr as ya, vt as ba, w as xa, wa as Sa, wi as Ca, wn as wa, wo as Z, wr as Ta, wt as Ea, x as Da, xa as Oa, xi as ka, xn as Aa, xo as ja, xr as Ma, xt as Na, y as Pa, ya as Fa, yi as Ia, yn as La, yo as Ra, yr as za, yt as Ba, z as Va, za as Ha, zi as Ua, zn as Wa, zo as Ga, zr as Ka, zt as qa } from "./composables-CAlEpA5b.js";
|
|
2
|
+
import { HttpError as Ja, ShareTypes as Ya, buildIncomingShareResource as Xa, buildSpaceImageResource as Za, call as Qa, extractDomSelector as $a, getSpaceManagers as eo, isCollaboratorShare as to, isIncomingShareResource as no, isLinkShare as ro, isManager as io, isOutgoingShareResource as ao, isPersonalSpaceResource as oo, isProjectSpaceResource as so, isPublicSpaceResource as co, isShareResource as lo, isShareSpaceResource as uo, isSpaceResource as fo } from "@opencloud-eu/web-client";
|
|
3
|
+
import { useGettext as Q } from "vue3-gettext";
|
|
4
|
+
import po from "fuse.js";
|
|
5
|
+
import { isNil as mo } from "lodash-es";
|
|
6
|
+
import { storeToRefs as $ } from "pinia";
|
|
7
|
+
import ho from "p-queue";
|
|
8
|
+
import { useTask as go } from "vue-concurrency";
|
|
9
|
+
import { DateTime as _o, Duration as vo } from "luxon";
|
|
10
|
+
import { useWindowSize as yo } from "@vueuse/core";
|
|
11
|
+
import bo from "mark.js";
|
|
12
|
+
import xo from "cropperjs";
|
|
13
|
+
import { onBeforeRouteLeave as So, useRouter as Co } from "vue-router";
|
|
14
|
+
//#region src/apps/types.ts
|
|
15
|
+
var wo = (e) => e, To = U({
|
|
16
|
+
name: "ActionMenuItem",
|
|
17
|
+
props: {
|
|
18
|
+
action: {
|
|
19
|
+
type: Object,
|
|
20
|
+
required: !0
|
|
21
|
+
},
|
|
22
|
+
actionOptions: {
|
|
23
|
+
type: Object,
|
|
24
|
+
required: !0
|
|
25
|
+
},
|
|
26
|
+
size: {
|
|
27
|
+
type: String,
|
|
28
|
+
required: !1,
|
|
29
|
+
default: "medium"
|
|
30
|
+
},
|
|
31
|
+
appearance: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: "raw"
|
|
34
|
+
},
|
|
35
|
+
shortcutHint: {
|
|
36
|
+
type: Boolean,
|
|
37
|
+
default: !0,
|
|
38
|
+
required: !1
|
|
39
|
+
},
|
|
40
|
+
showTooltip: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: !1,
|
|
43
|
+
required: !1
|
|
44
|
+
},
|
|
45
|
+
buttonClasses: {
|
|
46
|
+
type: Array,
|
|
47
|
+
default: () => []
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
setup(e) {
|
|
51
|
+
let { options: t } = $(Hn()), n = q(() => Object.hasOwn(e.action, "route") ? "router-link" : Object.hasOwn(e.action, "href") ? "a" : (Object.hasOwn(e.action, "handler") || console.warn("ActionMenuItem: No handler, route or href callback found in action", e.action), "button"));
|
|
52
|
+
return {
|
|
53
|
+
componentType: n,
|
|
54
|
+
componentProps: q(() => ({
|
|
55
|
+
appearance: e.action.appearance || e.appearance,
|
|
56
|
+
...e.action.isDisabled && { disabled: e.action.isDisabled(e.actionOptions) },
|
|
57
|
+
...e.action.id && { id: e.action.id },
|
|
58
|
+
...R(n) === "router-link" && { to: e.action.route(e.actionOptions) },
|
|
59
|
+
...R(n) === "a" && { href: e.action.href(e.actionOptions) },
|
|
60
|
+
...["router-link", "a"].includes(R(n)) && { target: t.value.openFilesInNewTab ? "_blank" : "_self" }
|
|
61
|
+
})),
|
|
62
|
+
actionIcon: q(() => typeof e.action.icon == "function" ? e.action.icon(e.actionOptions) : e.action.icon)
|
|
63
|
+
};
|
|
64
|
+
},
|
|
65
|
+
computed: {
|
|
66
|
+
hasExternalImageIcon() {
|
|
67
|
+
return this.actionIcon && /^https?:\/\//i.test(this.actionIcon);
|
|
68
|
+
},
|
|
69
|
+
componentListeners() {
|
|
70
|
+
if (typeof this.action.handler != "function") return {};
|
|
71
|
+
let e = () => this.action.handler({ ...this.actionOptions });
|
|
72
|
+
return this.action.keepOpen ? { click: (t) => {
|
|
73
|
+
t.stopPropagation(), e();
|
|
74
|
+
} } : { click: e };
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}), Eo = {
|
|
78
|
+
key: 3,
|
|
79
|
+
class: "oc-files-context-action-label flex flex-col",
|
|
80
|
+
"data-testid": "action-label"
|
|
81
|
+
}, Do = ["textContent"], Oo = ["textContent"];
|
|
82
|
+
function ko(e, t, n, r, i, a) {
|
|
83
|
+
let o = I("oc-image"), s = I("oc-icon"), c = I("oc-button"), l = ti("oc-tooltip");
|
|
84
|
+
return L((Z(), X("li", null, [L((Z(), H(c, va({ type: e.componentType }, e.componentProps, {
|
|
85
|
+
class: [
|
|
86
|
+
e.action.class,
|
|
87
|
+
"action-menu-item",
|
|
88
|
+
"align-middle",
|
|
89
|
+
"w-full",
|
|
90
|
+
...e.buttonClasses
|
|
91
|
+
],
|
|
92
|
+
"aria-label": e.componentProps.disabled ? e.action.disabledTooltip?.(e.actionOptions) ?? e.action.label(e.actionOptions) : e.action.label(e.actionOptions),
|
|
93
|
+
"data-testid": "action-handler",
|
|
94
|
+
size: e.size,
|
|
95
|
+
"justify-content": "left"
|
|
96
|
+
}, nt(e.componentListeners)), {
|
|
97
|
+
default: F(() => [
|
|
98
|
+
e.action.img ? (Z(), H(o, {
|
|
99
|
+
key: 0,
|
|
100
|
+
"data-testid": "action-img",
|
|
101
|
+
src: e.action.img,
|
|
102
|
+
alt: "",
|
|
103
|
+
class: "oc-icon oc-icon-m w-[22px]"
|
|
104
|
+
}, null, 8, ["src"])) : e.hasExternalImageIcon ? (Z(), H(o, {
|
|
105
|
+
key: 1,
|
|
106
|
+
"data-testid": "action-img",
|
|
107
|
+
src: e.actionIcon,
|
|
108
|
+
alt: "",
|
|
109
|
+
class: "oc-icon oc-icon-m w-[22px]"
|
|
110
|
+
}, null, 8, ["src"])) : e.actionIcon ? (Z(), H(s, {
|
|
111
|
+
key: 2,
|
|
112
|
+
"data-testid": "action-icon",
|
|
113
|
+
name: e.actionIcon,
|
|
114
|
+
"fill-type": e.action.iconFillType || "line",
|
|
115
|
+
size: e.size
|
|
116
|
+
}, null, 8, [
|
|
117
|
+
"name",
|
|
118
|
+
"fill-type",
|
|
119
|
+
"size"
|
|
120
|
+
])) : K("", !0),
|
|
121
|
+
e.action.hideLabel ? K("", !0) : (Z(), X("span", Eo, [Y("span", {
|
|
122
|
+
class: "text-left",
|
|
123
|
+
textContent: G(e.action.label(e.actionOptions))
|
|
124
|
+
}, null, 8, Do)])),
|
|
125
|
+
e.action.shortcut && e.shortcutHint ? (Z(), X("span", {
|
|
126
|
+
key: 4,
|
|
127
|
+
class: "text-sm flex-row-reverse",
|
|
128
|
+
textContent: G(e.action.shortcut)
|
|
129
|
+
}, null, 8, Oo)) : K("", !0)
|
|
130
|
+
]),
|
|
131
|
+
_: 1
|
|
132
|
+
}, 16, [
|
|
133
|
+
"type",
|
|
134
|
+
"class",
|
|
135
|
+
"aria-label",
|
|
136
|
+
"size"
|
|
137
|
+
])), [[l, e.showTooltip || e.action.hideLabel ? e.action.label(e.actionOptions) : ""]])])), [[l, e.componentProps.disabled ? e.action.disabledTooltip?.(e.actionOptions) : ""]]);
|
|
138
|
+
}
|
|
139
|
+
var Ao = /* @__PURE__ */ B(To, [["render", ko]]), jo = U({
|
|
140
|
+
name: "BatchActions",
|
|
141
|
+
components: { ActionMenuItem: Ao },
|
|
142
|
+
props: {
|
|
143
|
+
actions: {
|
|
144
|
+
type: Array,
|
|
145
|
+
required: !0
|
|
146
|
+
},
|
|
147
|
+
actionOptions: {
|
|
148
|
+
type: Object,
|
|
149
|
+
required: !0
|
|
150
|
+
},
|
|
151
|
+
limitedScreenSpace: {
|
|
152
|
+
type: Boolean,
|
|
153
|
+
default: !1,
|
|
154
|
+
required: !1
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
//#endregion
|
|
159
|
+
//#region src/components/BatchActions.vue
|
|
160
|
+
function Mo(e, t, n, r, i, a) {
|
|
161
|
+
let o = I("action-menu-item"), s = I("oc-list");
|
|
162
|
+
return Z(), X("div", null, [J(s, {
|
|
163
|
+
id: "oc-appbar-batch-actions",
|
|
164
|
+
class: V(["block xl:flex xl:items-center", { "oc-appbar-batch-actions-squashed [&_.oc-files-context-action-label]:hidden": e.limitedScreenSpace }])
|
|
165
|
+
}, {
|
|
166
|
+
default: F(() => [(Z(!0), X(W, null, M(e.actions, (t, n) => (Z(), H(o, {
|
|
167
|
+
key: `action-${n}`,
|
|
168
|
+
action: t,
|
|
169
|
+
"action-options": e.actionOptions,
|
|
170
|
+
appearance: "raw",
|
|
171
|
+
class: "batch-actions mr-2 float-left [&_.action-menu-item]:p-2 [&_.action-menu-item]:gap-1",
|
|
172
|
+
"shortcut-hint": !1,
|
|
173
|
+
"show-tooltip": e.limitedScreenSpace
|
|
174
|
+
}, null, 8, [
|
|
175
|
+
"action",
|
|
176
|
+
"action-options",
|
|
177
|
+
"show-tooltip"
|
|
178
|
+
]))), 128))]),
|
|
179
|
+
_: 1
|
|
180
|
+
}, 8, ["class"])]);
|
|
181
|
+
}
|
|
182
|
+
var No = /* @__PURE__ */ B(jo, [["render", Mo]]), Po = { class: "context-menu px-2" }, Fo = { class: "inline-flex gap-2" }, Io = { class: "flex oc-files-context-action-label" }, Lo = ["textContent"], Ro = /* @__PURE__ */ U({
|
|
183
|
+
__name: "ActionMenuDropItem",
|
|
184
|
+
props: {
|
|
185
|
+
menuSectionDrop: {},
|
|
186
|
+
appearance: {},
|
|
187
|
+
actionOptions: {}
|
|
188
|
+
},
|
|
189
|
+
setup(e) {
|
|
190
|
+
let t = wn(`oc-files-context-actions-${e.menuSectionDrop.name}-drop-`), n = wn(`oc-files-context-actions-${e.menuSectionDrop.name}-toggle-`);
|
|
191
|
+
return (r, i) => {
|
|
192
|
+
let a = I("oc-icon"), o = I("oc-button"), s = I("oc-list");
|
|
193
|
+
return Z(), X("li", Po, [J(o, {
|
|
194
|
+
id: R(n),
|
|
195
|
+
appearance: "raw",
|
|
196
|
+
"justify-content": "space-between",
|
|
197
|
+
"gap-size": "medium",
|
|
198
|
+
class: "w-full flex justify-between",
|
|
199
|
+
"aria-expanded": "false"
|
|
200
|
+
}, {
|
|
201
|
+
default: F(() => [Y("span", Fo, [J(a, {
|
|
202
|
+
name: e.menuSectionDrop.icon,
|
|
203
|
+
size: "medium",
|
|
204
|
+
"fill-type": "line"
|
|
205
|
+
}, null, 8, ["name"]), Y("span", Io, [Y("span", { textContent: G(e.menuSectionDrop.label) }, null, 8, Lo)])]), J(a, {
|
|
206
|
+
name: "arrow-right-s",
|
|
207
|
+
size: "small",
|
|
208
|
+
"fill-type": "line"
|
|
209
|
+
})]),
|
|
210
|
+
_: 1
|
|
211
|
+
}, 8, ["id"]), J(R(si), {
|
|
212
|
+
title: e.menuSectionDrop.label,
|
|
213
|
+
"drop-id": R(t),
|
|
214
|
+
toggle: `#${R(n)}`,
|
|
215
|
+
mode: "hover",
|
|
216
|
+
class: "w-3xs oc-files-context-action-drop",
|
|
217
|
+
"padding-size": "small",
|
|
218
|
+
teleport: "#app-runtime-drop",
|
|
219
|
+
position: "right-start",
|
|
220
|
+
"close-on-click": ""
|
|
221
|
+
}, {
|
|
222
|
+
default: F(() => [e.menuSectionDrop.items.length ? (Z(), H(s, { key: 0 }, {
|
|
223
|
+
default: F(() => [(Z(!0), X(W, null, M(e.menuSectionDrop.items, (t, n) => (Z(), H(Ao, {
|
|
224
|
+
key: `section-${e.menuSectionDrop.label}-action-${n}`,
|
|
225
|
+
action: t,
|
|
226
|
+
appearance: e.appearance,
|
|
227
|
+
"action-options": e.actionOptions
|
|
228
|
+
}, null, 8, [
|
|
229
|
+
"action",
|
|
230
|
+
"appearance",
|
|
231
|
+
"action-options"
|
|
232
|
+
]))), 128))]),
|
|
233
|
+
_: 1
|
|
234
|
+
})) : K("", !0)]),
|
|
235
|
+
_: 1
|
|
236
|
+
}, 8, [
|
|
237
|
+
"title",
|
|
238
|
+
"drop-id",
|
|
239
|
+
"toggle"
|
|
240
|
+
])]);
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
}), zo = U({
|
|
244
|
+
name: "ContextActionMenu",
|
|
245
|
+
components: {
|
|
246
|
+
ActionMenuDropItem: Ro,
|
|
247
|
+
ActionMenuItem: Ao
|
|
248
|
+
},
|
|
249
|
+
props: {
|
|
250
|
+
menuSections: {
|
|
251
|
+
type: Array,
|
|
252
|
+
required: !0
|
|
253
|
+
},
|
|
254
|
+
appearance: {
|
|
255
|
+
type: String,
|
|
256
|
+
default: "raw"
|
|
257
|
+
},
|
|
258
|
+
actionOptions: {
|
|
259
|
+
type: Object,
|
|
260
|
+
required: !0
|
|
261
|
+
}
|
|
262
|
+
},
|
|
263
|
+
methods: { getSectionClasses(e) {
|
|
264
|
+
let t = [];
|
|
265
|
+
return this.menuSections.length ? (e < this.menuSections.length - 1 && t.push("pb-2"), e > 0 && t.push("pt-2"), e < this.menuSections.length - 1 && t.push("border-b"), t) : t;
|
|
266
|
+
} }
|
|
267
|
+
}), Bo = { id: "oc-files-context-menu" };
|
|
268
|
+
function Vo(e, t, n, r, i, a) {
|
|
269
|
+
let o = I("action-menu-item"), s = I("action-menu-drop-item"), c = I("oc-list");
|
|
270
|
+
return Z(), X("div", Bo, [(Z(!0), X(W, null, M(e.menuSections, (t, n) => (Z(), H(c, {
|
|
271
|
+
id: `oc-files-context-actions-${t.name}`,
|
|
272
|
+
key: `section-${t.name}-list`,
|
|
273
|
+
class: V(["[&_li]:px-0", e.getSectionClasses(n)])
|
|
274
|
+
}, {
|
|
275
|
+
default: F(() => [t.items ? (Z(!0), X(W, { key: 0 }, M(t.items, (n, r) => (Z(), H(o, {
|
|
276
|
+
key: `section-${t.name}-action-${r}`,
|
|
277
|
+
action: n,
|
|
278
|
+
appearance: e.appearance,
|
|
279
|
+
"action-options": e.actionOptions,
|
|
280
|
+
class: "context-menu"
|
|
281
|
+
}, null, 8, [
|
|
282
|
+
"action",
|
|
283
|
+
"appearance",
|
|
284
|
+
"action-options"
|
|
285
|
+
]))), 128)) : K("", !0), (Z(!0), X(W, null, M(t.dropItems, (t) => (Z(), X(W, null, [t.items.length ? (Z(), H(s, {
|
|
286
|
+
key: t.name,
|
|
287
|
+
"menu-section-drop": t,
|
|
288
|
+
appearance: e.appearance,
|
|
289
|
+
"action-options": e.actionOptions
|
|
290
|
+
}, null, 8, [
|
|
291
|
+
"menu-section-drop",
|
|
292
|
+
"appearance",
|
|
293
|
+
"action-options"
|
|
294
|
+
])) : K("", !0)], 64))), 256))]),
|
|
295
|
+
_: 2
|
|
296
|
+
}, 1032, ["id", "class"]))), 128))]);
|
|
297
|
+
}
|
|
298
|
+
var Ho = /* @__PURE__ */ B(zo, [["render", Vo]]), Uo = U({
|
|
299
|
+
name: "ContextActions",
|
|
300
|
+
components: { ContextActionMenu: Ho },
|
|
301
|
+
props: { actionOptions: {
|
|
302
|
+
type: Object,
|
|
303
|
+
required: !0
|
|
304
|
+
} },
|
|
305
|
+
setup(e) {
|
|
306
|
+
let { getAllOpenWithActions: t } = La(), { $gettext: n } = Q(), { actions: r } = Ea(), { actions: i } = _t(), { actions: a } = qn(), { actions: o } = _a(), { actions: s } = Sr(), { actions: c } = wt(), { actions: l } = pe(), { actions: u } = it(), { actions: d } = f(), { actions: p } = ne(), { actions: m } = oe(), { actions: h } = Bn(), { actions: g } = Mr(), { actions: _ } = Rr(), { actions: v } = fr(), { actions: y } = li(), { actions: b } = Ne(), { actions: x } = ki(), S = ut(), C = q(() => S.requestExtensions({
|
|
307
|
+
id: "global.files.context-actions",
|
|
308
|
+
extensionType: "action"
|
|
309
|
+
}).map((e) => e.action)), ee = q(() => S.requestExtensions({
|
|
310
|
+
id: "global.files.batch-actions",
|
|
311
|
+
extensionType: "action"
|
|
312
|
+
}).map((e) => e.action)), w = Te(e, "actionOptions"), T = q(() => [
|
|
313
|
+
...R(i),
|
|
314
|
+
...R(c),
|
|
315
|
+
...R(u),
|
|
316
|
+
...R(m),
|
|
317
|
+
...R(o),
|
|
318
|
+
...R(l),
|
|
319
|
+
...R(_),
|
|
320
|
+
...R(b),
|
|
321
|
+
...R(ee).filter((e) => e.category === "actions" || mo(e.category))
|
|
322
|
+
].filter((e) => e.isVisible(R(w)))), te = q(() => [...R(y), ...R(ee).filter((e) => e.category === "sidebar")].filter((e) => e.isVisible(R(w)))), E = q(() => R(r).filter((e) => e.isVisible(R(w))).sort((e, t) => Number(t.hasPriority) - Number(e.hasPriority))), D = q(() => t({
|
|
323
|
+
...R(w),
|
|
324
|
+
omitSystemActions: !0
|
|
325
|
+
}).filter((e) => e.isVisible(R(w))).sort((e, t) => Number(t.hasPriority) - Number(e.hasPriority))), O = q(() => [
|
|
326
|
+
...R(x),
|
|
327
|
+
...R(s),
|
|
328
|
+
...R(C).filter((e) => e.category === "share")
|
|
329
|
+
].filter((e) => e.isVisible(R(w)))), k = q(() => [
|
|
330
|
+
...R(u),
|
|
331
|
+
...R(d),
|
|
332
|
+
...R(l),
|
|
333
|
+
...R(m),
|
|
334
|
+
...R(o),
|
|
335
|
+
...R(h),
|
|
336
|
+
...R(g),
|
|
337
|
+
...R(b),
|
|
338
|
+
...R(_),
|
|
339
|
+
...R(i),
|
|
340
|
+
...R(c),
|
|
341
|
+
...R(a),
|
|
342
|
+
...R(v),
|
|
343
|
+
...R(C).filter((e) => e.category === "actions" || mo(e.category))
|
|
344
|
+
].filter((e) => e.isVisible(R(w)))), A = q(() => [
|
|
345
|
+
...R(p),
|
|
346
|
+
...R(y),
|
|
347
|
+
...R(C).filter((e) => e.category === "sidebar")
|
|
348
|
+
].filter((e) => e.isVisible(R(w))));
|
|
349
|
+
return { menuSections: q(() => {
|
|
350
|
+
let e = [];
|
|
351
|
+
return R(w).resources.length > 1 ? (R(T).length && e.push({
|
|
352
|
+
name: "batch-actions",
|
|
353
|
+
items: [...R(T)]
|
|
354
|
+
}), e.push({
|
|
355
|
+
name: "batch-details",
|
|
356
|
+
items: [...R(te)]
|
|
357
|
+
}), e) : ([...R(E), ...R(D)].length && e.push({
|
|
358
|
+
name: "context",
|
|
359
|
+
items: [...R(E)],
|
|
360
|
+
dropItems: [{
|
|
361
|
+
label: n("Open with..."),
|
|
362
|
+
name: "open-with",
|
|
363
|
+
icon: "apps",
|
|
364
|
+
items: [...R(D)]
|
|
365
|
+
}]
|
|
366
|
+
}), R(O).length && e.push({
|
|
367
|
+
name: "share",
|
|
368
|
+
items: R(O)
|
|
369
|
+
}), R(k).length && e.push({
|
|
370
|
+
name: "actions",
|
|
371
|
+
items: R(k)
|
|
372
|
+
}), R(A).length && e.push({
|
|
373
|
+
name: "sidebar",
|
|
374
|
+
items: R(A)
|
|
375
|
+
}), e);
|
|
376
|
+
}) };
|
|
377
|
+
}
|
|
378
|
+
});
|
|
379
|
+
//#endregion
|
|
380
|
+
//#region src/components/FilesList/ContextActions.vue
|
|
381
|
+
function Wo(e, t, n, r, i, a) {
|
|
382
|
+
let o = I("context-action-menu");
|
|
383
|
+
return Z(), H(o, {
|
|
384
|
+
"menu-sections": e.menuSections,
|
|
385
|
+
"action-options": e.actionOptions
|
|
386
|
+
}, null, 8, ["menu-sections", "action-options"]);
|
|
387
|
+
}
|
|
388
|
+
var Go = /* @__PURE__ */ B(Uo, [["render", Wo]]), Ko = { class: "flex items-center" }, qo = { class: "flex justify-between w-full" }, Jo = { class: "flex items-center gap-2" }, Yo = ["textContent"], Xo = {
|
|
389
|
+
key: 0,
|
|
390
|
+
class: "mt-2 mb-4 last:mb-0 [&>*]:flex [&>*]:justify-between"
|
|
391
|
+
}, Zo = {
|
|
392
|
+
key: 1,
|
|
393
|
+
class: "mt-2 mb-4 last:mb-0 [&>*]:flex [&>*]:justify-between"
|
|
394
|
+
}, Qo = {
|
|
395
|
+
key: 2,
|
|
396
|
+
class: "mt-2 mb-4 last:mb-0 [&>*]:flex [&>*]:justify-between"
|
|
397
|
+
}, $o = {
|
|
398
|
+
key: 3,
|
|
399
|
+
class: "mt-2 mb-4 last:mb-0 [&>*]:flex [&>*]:justify-between"
|
|
400
|
+
}, es = {
|
|
401
|
+
key: 4,
|
|
402
|
+
class: "mt-2 mb-4 last:mb-0 [&>*]:flex [&>*]:justify-between"
|
|
403
|
+
}, ts = {
|
|
404
|
+
key: 5,
|
|
405
|
+
class: "mt-2 mb-4 last:mb-0 flex justify-between items-center [&>*]:flex [&>*]:justify-between"
|
|
406
|
+
}, ns = ["textContent"], rs = ["max"], is = /* @__PURE__ */ B(/* @__PURE__ */ U({
|
|
407
|
+
__name: "ViewOptions",
|
|
408
|
+
props: {
|
|
409
|
+
perPageStoragePrefix: {},
|
|
410
|
+
hasHiddenFiles: {
|
|
411
|
+
type: Boolean,
|
|
412
|
+
default: !0
|
|
413
|
+
},
|
|
414
|
+
hasFileExtensions: {
|
|
415
|
+
type: Boolean,
|
|
416
|
+
default: !0
|
|
417
|
+
},
|
|
418
|
+
hasPagination: {
|
|
419
|
+
type: Boolean,
|
|
420
|
+
default: !0
|
|
421
|
+
},
|
|
422
|
+
paginationOptions: { default: () => Wt.options },
|
|
423
|
+
perPageQueryName: { default: () => Wt.perPageQueryName },
|
|
424
|
+
perPageDefault: { default: () => Wt.perPageDefault },
|
|
425
|
+
viewModeDefault: { default: () => ma.defaultModeName },
|
|
426
|
+
viewModes: { default: () => [] }
|
|
427
|
+
},
|
|
428
|
+
setup(e) {
|
|
429
|
+
let t = ji(), n = br(), { $gettext: i } = Q(), a = dr(), { setAreHiddenFilesShown: o, setAreFileExtensionsShown: s, setAreDisabledSpacesShown: c, setAreEmptyTrashesShown: l } = a, { areHiddenFilesShown: u, areFileExtensionsShown: d, areDisabledSpacesShown: f, areEmptyTrashesShown: p } = $(a), m = z(!1), h = jn(Qr, "files-spaces-projects"), g = jn(ha, "files-trash-overview"), _ = r("page"), v = q(() => R(_) ? parseInt(Le(R(_))) : 1), y = Ot({
|
|
430
|
+
name: e.perPageQueryName,
|
|
431
|
+
defaultValue: e.perPageDefault,
|
|
432
|
+
storagePrefix: e.perPageStoragePrefix
|
|
433
|
+
}), b = Ot({
|
|
434
|
+
name: ma.queryName,
|
|
435
|
+
defaultValue: e.viewModeDefault
|
|
436
|
+
}), x = q(() => e.viewModes.find((e) => e.name === Le(R(b)))), S = Ot({
|
|
437
|
+
name: ma.tilesSizeQueryName,
|
|
438
|
+
defaultValue: ma.tilesSizeDefault.toString()
|
|
439
|
+
}), C = (r) => t.replace({ query: {
|
|
440
|
+
...R(n).query,
|
|
441
|
+
[e.perPageQueryName]: r.toString(),
|
|
442
|
+
...R(v) > 1 && { page: "1" }
|
|
443
|
+
} }), ee = (e) => {
|
|
444
|
+
b.value = e.name;
|
|
445
|
+
};
|
|
446
|
+
P([
|
|
447
|
+
y,
|
|
448
|
+
b,
|
|
449
|
+
S
|
|
450
|
+
], (e) => {
|
|
451
|
+
m.value = e.some((e) => !e);
|
|
452
|
+
}, {
|
|
453
|
+
immediate: !0,
|
|
454
|
+
deep: !0
|
|
455
|
+
});
|
|
456
|
+
let w = Er(), T = q({
|
|
457
|
+
get() {
|
|
458
|
+
return R(u);
|
|
459
|
+
},
|
|
460
|
+
set(e) {
|
|
461
|
+
o(e);
|
|
462
|
+
}
|
|
463
|
+
}), te = q({
|
|
464
|
+
get() {
|
|
465
|
+
return R(d);
|
|
466
|
+
},
|
|
467
|
+
set(e) {
|
|
468
|
+
s(e);
|
|
469
|
+
}
|
|
470
|
+
}), E = q({
|
|
471
|
+
get() {
|
|
472
|
+
return R(f);
|
|
473
|
+
},
|
|
474
|
+
set(e) {
|
|
475
|
+
c(e);
|
|
476
|
+
}
|
|
477
|
+
}), D = q({
|
|
478
|
+
get() {
|
|
479
|
+
return R(p);
|
|
480
|
+
},
|
|
481
|
+
set(e) {
|
|
482
|
+
l(e);
|
|
483
|
+
}
|
|
484
|
+
}), O = (e) => {
|
|
485
|
+
T.value = e;
|
|
486
|
+
}, k = (e) => {
|
|
487
|
+
te.value = e;
|
|
488
|
+
}, A = (e) => {
|
|
489
|
+
E.value = e;
|
|
490
|
+
}, ne = (e) => {
|
|
491
|
+
D.value = e;
|
|
492
|
+
};
|
|
493
|
+
return (t, n) => {
|
|
494
|
+
let r = I("oc-icon"), a = I("oc-button"), o = I("oc-list"), s = I("oc-drop"), c = I("oc-switch"), l = I("oc-page-size"), u = ti("oc-tooltip");
|
|
495
|
+
return Z(), X("div", Ko, [
|
|
496
|
+
e.viewModes.length > 1 ? (Z(), X(W, { key: 0 }, [L((Z(), H(a, {
|
|
497
|
+
id: "viewmode-switch-toggle",
|
|
498
|
+
"aria-label": R(i)("Switch view mode"),
|
|
499
|
+
appearance: "raw",
|
|
500
|
+
class: "my-2 mx-1 p-1 align-middle"
|
|
501
|
+
}, {
|
|
502
|
+
default: F(() => [x.value ? (Z(), H(r, {
|
|
503
|
+
key: 0,
|
|
504
|
+
name: x.value.icon.name,
|
|
505
|
+
"fill-type": x.value.icon.fillType
|
|
506
|
+
}, null, 8, ["name", "fill-type"])) : K("", !0)]),
|
|
507
|
+
_: 1
|
|
508
|
+
}, 8, ["aria-label"])), [[u, R(i)("Switch view mode")]]), J(s, {
|
|
509
|
+
title: R(i)("View mode"),
|
|
510
|
+
"drop-id": "viewmode-switch-drop",
|
|
511
|
+
toggle: "#viewmode-switch-toggle",
|
|
512
|
+
class: "w-auto",
|
|
513
|
+
"padding-size": "small",
|
|
514
|
+
"close-on-click": ""
|
|
515
|
+
}, {
|
|
516
|
+
default: F(() => [J(o, null, {
|
|
517
|
+
default: F(() => [(Z(!0), X(W, null, M(e.viewModes, (e) => (Z(), X("li", { key: e.name }, [J(a, {
|
|
518
|
+
appearance: R(b) === e.name ? "filled" : "raw",
|
|
519
|
+
"color-role": R(b) === e.name ? "secondaryContainer" : "secondary",
|
|
520
|
+
"no-hover": R(b) === e.name,
|
|
521
|
+
class: V([[e.name], "p-2"]),
|
|
522
|
+
"justify-content": "left",
|
|
523
|
+
onClick: (t) => ee(e)
|
|
524
|
+
}, {
|
|
525
|
+
default: F(() => [Y("div", qo, [Y("span", Jo, [J(r, {
|
|
526
|
+
name: e.icon.name,
|
|
527
|
+
"fill-type": e.icon.fillType,
|
|
528
|
+
size: "medium"
|
|
529
|
+
}, null, 8, ["name", "fill-type"]), Y("span", { textContent: G(e.label) }, null, 8, Yo)]), R(b) === e.name ? (Z(), H(r, {
|
|
530
|
+
key: 0,
|
|
531
|
+
name: "check",
|
|
532
|
+
size: "medium",
|
|
533
|
+
class: "ml-1"
|
|
534
|
+
})) : K("", !0)])]),
|
|
535
|
+
_: 2
|
|
536
|
+
}, 1032, [
|
|
537
|
+
"appearance",
|
|
538
|
+
"color-role",
|
|
539
|
+
"no-hover",
|
|
540
|
+
"class",
|
|
541
|
+
"onClick"
|
|
542
|
+
])]))), 128))]),
|
|
543
|
+
_: 1
|
|
544
|
+
})]),
|
|
545
|
+
_: 1
|
|
546
|
+
}, 8, ["title"])], 64)) : K("", !0),
|
|
547
|
+
L((Z(), H(a, {
|
|
548
|
+
id: "files-view-options-btn",
|
|
549
|
+
key: "files-view-options-btn",
|
|
550
|
+
"data-testid": "files-view-options-btn",
|
|
551
|
+
"aria-label": R(i)("Display customization options of the files list"),
|
|
552
|
+
appearance: "raw",
|
|
553
|
+
class: "my-2 mx-1 p-1 align-middle"
|
|
554
|
+
}, {
|
|
555
|
+
default: F(() => [J(r, {
|
|
556
|
+
name: "settings-3",
|
|
557
|
+
"fill-type": "line"
|
|
558
|
+
})]),
|
|
559
|
+
_: 1
|
|
560
|
+
}, 8, ["aria-label"])), [[u, R(i)("Display customization options of the files list")]]),
|
|
561
|
+
J(s, {
|
|
562
|
+
title: R(i)("View options"),
|
|
563
|
+
"drop-id": "files-view-options-drop",
|
|
564
|
+
toggle: "#files-view-options-btn",
|
|
565
|
+
mode: "click",
|
|
566
|
+
class: "w-auto [&.oc-drop]:overflow-visible",
|
|
567
|
+
"padding-size": "medium",
|
|
568
|
+
"is-menu": !1
|
|
569
|
+
}, {
|
|
570
|
+
default: F(() => [J(o, null, {
|
|
571
|
+
default: F(() => [
|
|
572
|
+
e.hasHiddenFiles ? (Z(), X("li", Xo, [J(c, {
|
|
573
|
+
checked: T.value,
|
|
574
|
+
"onUpdate:checked": [n[0] ||= (e) => T.value = e, O],
|
|
575
|
+
"data-testid": "files-switch-hidden-files",
|
|
576
|
+
label: R(i)("Show hidden files")
|
|
577
|
+
}, null, 8, ["checked", "label"])])) : K("", !0),
|
|
578
|
+
e.hasFileExtensions ? (Z(), X("li", Zo, [J(c, {
|
|
579
|
+
checked: te.value,
|
|
580
|
+
"onUpdate:checked": [n[1] ||= (e) => te.value = e, k],
|
|
581
|
+
"data-testid": "files-switch-files-extensions-files",
|
|
582
|
+
label: R(i)("Show file extensions")
|
|
583
|
+
}, null, 8, ["checked", "label"])])) : K("", !0),
|
|
584
|
+
e.hasPagination ? (Z(), X("li", Qo, [m.value ? K("", !0) : (Z(), H(l, {
|
|
585
|
+
key: 0,
|
|
586
|
+
selected: R(Le)(R(y)),
|
|
587
|
+
"data-testid": "files-pagination-size",
|
|
588
|
+
label: R(i)("Items per page"),
|
|
589
|
+
options: e.paginationOptions,
|
|
590
|
+
class: "files-pagination-size",
|
|
591
|
+
onChange: C
|
|
592
|
+
}, null, 8, [
|
|
593
|
+
"selected",
|
|
594
|
+
"label",
|
|
595
|
+
"options"
|
|
596
|
+
]))])) : K("", !0),
|
|
597
|
+
R(h) ? (Z(), X("li", $o, [J(c, {
|
|
598
|
+
checked: E.value,
|
|
599
|
+
"onUpdate:checked": [n[2] ||= (e) => E.value = e, A],
|
|
600
|
+
"data-testid": "files-switch-projects-show-disabled",
|
|
601
|
+
label: R(i)("Show disabled Spaces")
|
|
602
|
+
}, null, 8, ["checked", "label"])])) : K("", !0),
|
|
603
|
+
R(g) ? (Z(), X("li", es, [J(c, {
|
|
604
|
+
checked: D.value,
|
|
605
|
+
"onUpdate:checked": [n[3] ||= (e) => D.value = e, ne],
|
|
606
|
+
"data-testid": "files-switch-projects-show-disabled",
|
|
607
|
+
label: R(i)("Show empty trash bins")
|
|
608
|
+
}, null, 8, ["checked", "label"])])) : K("", !0),
|
|
609
|
+
R(b) === R(ma).name.tiles ? (Z(), X("li", ts, [Y("label", {
|
|
610
|
+
for: "tiles-size-slider",
|
|
611
|
+
textContent: G(R(i)("Tile size"))
|
|
612
|
+
}, null, 8, ns), L(Y("input", {
|
|
613
|
+
id: "tiles-size-slider",
|
|
614
|
+
"onUpdate:modelValue": n[4] ||= (e) => Ga(S) ? S.value = e : null,
|
|
615
|
+
type: "range",
|
|
616
|
+
min: 1,
|
|
617
|
+
max: R(w),
|
|
618
|
+
class: "oc-range bg-role-surface-container-high rounded-sm outline-0 w-full max-w-[50%] h-1.5 hover:opacity-100 appearance-none",
|
|
619
|
+
"data-testid": "files-tiles-size-slider"
|
|
620
|
+
}, null, 8, rs), [[aa, R(S)]])])) : K("", !0)
|
|
621
|
+
]),
|
|
622
|
+
_: 1
|
|
623
|
+
})]),
|
|
624
|
+
_: 1
|
|
625
|
+
}, 8, ["title"])
|
|
626
|
+
]);
|
|
627
|
+
};
|
|
628
|
+
}
|
|
629
|
+
}), [["__scopeId", "data-v-c5e89ed1"]]), as = U({
|
|
630
|
+
name: "AppBar",
|
|
631
|
+
components: {
|
|
632
|
+
BatchActions: No,
|
|
633
|
+
ContextActions: Go,
|
|
634
|
+
ViewOptions: is
|
|
635
|
+
},
|
|
636
|
+
props: {
|
|
637
|
+
viewModeDefault: {
|
|
638
|
+
type: String,
|
|
639
|
+
required: !1,
|
|
640
|
+
default: () => ma.defaultModeName
|
|
641
|
+
},
|
|
642
|
+
breadcrumbs: {
|
|
643
|
+
type: Array,
|
|
644
|
+
default: () => []
|
|
645
|
+
},
|
|
646
|
+
breadcrumbsContextActionsItems: {
|
|
647
|
+
type: Array,
|
|
648
|
+
default: () => []
|
|
649
|
+
},
|
|
650
|
+
viewModes: {
|
|
651
|
+
type: Array,
|
|
652
|
+
default: () => []
|
|
653
|
+
},
|
|
654
|
+
hasBulkActions: {
|
|
655
|
+
type: Boolean,
|
|
656
|
+
default: !1
|
|
657
|
+
},
|
|
658
|
+
hasViewOptions: {
|
|
659
|
+
type: Boolean,
|
|
660
|
+
default: !0
|
|
661
|
+
},
|
|
662
|
+
hasHiddenFiles: {
|
|
663
|
+
type: Boolean,
|
|
664
|
+
default: !0
|
|
665
|
+
},
|
|
666
|
+
hasFileExtensions: {
|
|
667
|
+
type: Boolean,
|
|
668
|
+
default: !0
|
|
669
|
+
},
|
|
670
|
+
hasPagination: {
|
|
671
|
+
type: Boolean,
|
|
672
|
+
default: !0
|
|
673
|
+
},
|
|
674
|
+
showActionsOnSelection: {
|
|
675
|
+
type: Boolean,
|
|
676
|
+
default: !1
|
|
677
|
+
},
|
|
678
|
+
batchActionsLoading: {
|
|
679
|
+
type: Boolean,
|
|
680
|
+
default: !1
|
|
681
|
+
},
|
|
682
|
+
space: {
|
|
683
|
+
type: Object,
|
|
684
|
+
required: !1,
|
|
685
|
+
default: null
|
|
686
|
+
}
|
|
687
|
+
},
|
|
688
|
+
setup(e, { emit: t }) {
|
|
689
|
+
let n = hi(), { $gettext: r } = Q(), { can: i } = gr(), a = ji(), { requestExtensions: o } = ut(), { isSticky: s } = ft(), { isSideBarOpen: c } = $(Oi()), l = dr(), { selectedResources: u } = $(l), d = q(() => e.space), { actions: p } = _t(), { actions: m } = qn(), { actions: h } = _a(), { actions: g } = Sn(), { actions: _ } = wt(), { actions: v } = pe(), { actions: y } = it(), { actions: b } = f(), { actions: x } = oe(), { actions: S } = Rr(), { actions: C } = ne(), { actions: ee } = On(), { actions: w } = _n(), { actions: T } = me(), { actions: te } = rn(), E = z(0), D = jn($e, "files-common-search"), O = q(() => Object.hasOwn(St(), "navigation") && i("create-all", "Share")), k = q(() => {
|
|
690
|
+
let e = [
|
|
691
|
+
...R(m),
|
|
692
|
+
...R(p),
|
|
693
|
+
...R(_),
|
|
694
|
+
...R(y),
|
|
695
|
+
...R(b),
|
|
696
|
+
...R(x),
|
|
697
|
+
...R(h),
|
|
698
|
+
...R(v),
|
|
699
|
+
...R(S),
|
|
700
|
+
...R(C)
|
|
701
|
+
];
|
|
702
|
+
D.value || (e = [
|
|
703
|
+
...e,
|
|
704
|
+
...R(g),
|
|
705
|
+
...R(T),
|
|
706
|
+
...R(te),
|
|
707
|
+
...R(ee),
|
|
708
|
+
...R(w)
|
|
709
|
+
]);
|
|
710
|
+
let t = o({
|
|
711
|
+
id: "global.files.batch-actions",
|
|
712
|
+
extensionType: "action"
|
|
713
|
+
});
|
|
714
|
+
return t.length && (e = [...e, ...t.map((e) => e.action)]), e.filter((e) => e.isVisible({
|
|
715
|
+
space: R(d),
|
|
716
|
+
resources: l.selectedResources
|
|
717
|
+
}));
|
|
718
|
+
}), A = q(() => n.spaces.filter((e) => oo(e) || so(e))), re = jn(ha, "files-trash-generic"), j = q(() => R(re) && R(A).length === 1 ? !1 : e.breadcrumbs.length), ie = q(() => R(re) && R(A).length === 1 ? e.breadcrumbs.length <= 2 : e.breadcrumbs.length <= 1), ae = q(() => R(d) && (so(R(d)) || uo(R(d))) ? 3 : 2), M = (e) => {
|
|
719
|
+
t(vn, e);
|
|
720
|
+
}, N = oa("title");
|
|
721
|
+
return {
|
|
722
|
+
router: a,
|
|
723
|
+
hasSharesNavigation: O,
|
|
724
|
+
batchActions: k,
|
|
725
|
+
showBreadcrumb: j,
|
|
726
|
+
showMobileNav: ie,
|
|
727
|
+
breadcrumbMaxWidth: E,
|
|
728
|
+
breadcrumbTruncationOffset: ae,
|
|
729
|
+
fileDroppedBreadcrumb: M,
|
|
730
|
+
pageTitle: q(() => R(N) ? r(R(N)) : R(d)?.name || ""),
|
|
731
|
+
selectedResources: u,
|
|
732
|
+
isSticky: s,
|
|
733
|
+
isSideBarOpen: c
|
|
734
|
+
};
|
|
735
|
+
},
|
|
736
|
+
data: function() {
|
|
737
|
+
return {
|
|
738
|
+
resizeObserver: new ResizeObserver(this.onResize),
|
|
739
|
+
limitedScreenSpace: !1
|
|
740
|
+
};
|
|
741
|
+
},
|
|
742
|
+
computed: {
|
|
743
|
+
showContextActions() {
|
|
744
|
+
return mn(this.breadcrumbs).allowContextActions;
|
|
745
|
+
},
|
|
746
|
+
showBatchActions() {
|
|
747
|
+
return this.hasBulkActions && (this.selectedResources.length >= 1 || ha(this.router, "files-trash-generic"));
|
|
748
|
+
},
|
|
749
|
+
selectedResourcesAnnouncement() {
|
|
750
|
+
return this.selectedResources.length === 0 ? this.$gettext("No items selected.") : this.$ngettext("%{ amount } item selected. Actions are available above the table.", "%{ amount } items selected. Actions are available above the table.", this.selectedResources.length, { amount: this.selectedResources.length.toString() });
|
|
751
|
+
}
|
|
752
|
+
},
|
|
753
|
+
mounted() {
|
|
754
|
+
this.resizeObserver.observe(this.$refs.filesAppBar), window.addEventListener("resize", this.onResize);
|
|
755
|
+
},
|
|
756
|
+
beforeUnmount() {
|
|
757
|
+
this.resizeObserver.unobserve(this.$refs.filesAppBar), window.removeEventListener("resize", this.onResize);
|
|
758
|
+
},
|
|
759
|
+
methods: { onResize() {
|
|
760
|
+
let e = document.getElementById("web-content-main")?.getBoundingClientRect().width || 0, t = document.getElementById("web-nav-sidebar")?.getBoundingClientRect().width || 0, n = document.getElementById("app-sidebar")?.getBoundingClientRect().width || 0, r = document.getElementById("files-app-bar-controls-right")?.clientWidth;
|
|
761
|
+
this.breadcrumbMaxWidth = e - t - n - r, this.limitedScreenSpace = this.isSideBarOpen ? window.innerWidth <= 1280 : window.innerWidth <= 1e3;
|
|
762
|
+
} }
|
|
763
|
+
}), os = { class: "files-topbar py-1 w-full" }, ss = ["textContent"], cs = {
|
|
764
|
+
key: 1,
|
|
765
|
+
id: "files-app-bar-controls-right",
|
|
766
|
+
class: "flex"
|
|
767
|
+
}, ls = { class: "files-app-bar-actions flex items-center justify-end mt-1 min-h-10 gap-2" }, us = { class: "flex-1 flex justify-start items-center" }, ds = { key: 1 };
|
|
768
|
+
function fs(e, t, n, r, i, a) {
|
|
769
|
+
let o = I("oc-hidden-announcer"), s = I("context-actions"), c = I("oc-breadcrumb"), l = I("view-options"), u = I("batch-actions"), d = I("oc-spinner");
|
|
770
|
+
return Z(), X("div", {
|
|
771
|
+
id: "files-app-bar",
|
|
772
|
+
ref: "filesAppBar",
|
|
773
|
+
class: V(["px-4 bg-role-surface rounded-t-xl [display:inherit] top-0 z-20", {
|
|
774
|
+
"files-app-bar-squashed": e.isSideBarOpen,
|
|
775
|
+
sticky: e.isSticky
|
|
776
|
+
}])
|
|
777
|
+
}, [Y("div", os, [
|
|
778
|
+
Y("h1", {
|
|
779
|
+
class: "sr-only",
|
|
780
|
+
textContent: G(e.pageTitle)
|
|
781
|
+
}, null, 8, ss),
|
|
782
|
+
J(o, {
|
|
783
|
+
announcement: e.selectedResourcesAnnouncement,
|
|
784
|
+
level: "polite"
|
|
785
|
+
}, null, 8, ["announcement"]),
|
|
786
|
+
Y("div", { class: V(["flex items-center files-app-bar-controls min-h-12", {
|
|
787
|
+
"justify-between": e.showBreadcrumb || e.hasSharesNavigation,
|
|
788
|
+
"justify-end": !e.showBreadcrumb && !e.hasSharesNavigation
|
|
789
|
+
}]) }, [e.showBreadcrumb ? (Z(), H(c, {
|
|
790
|
+
key: 0,
|
|
791
|
+
id: "files-breadcrumb",
|
|
792
|
+
"context-menu-padding": "small",
|
|
793
|
+
"show-context-actions": e.showContextActions,
|
|
794
|
+
items: e.breadcrumbs,
|
|
795
|
+
"max-width": e.breadcrumbMaxWidth,
|
|
796
|
+
"truncation-offset": e.breadcrumbTruncationOffset,
|
|
797
|
+
"mobile-breakpoint": e.isSideBarOpen ? "md" : "sm",
|
|
798
|
+
onItemDroppedBreadcrumb: e.fileDroppedBreadcrumb
|
|
799
|
+
}, {
|
|
800
|
+
contextMenu: F(() => [J(s, { "action-options": {
|
|
801
|
+
space: e.space,
|
|
802
|
+
resources: e.breadcrumbsContextActionsItems.filter(Boolean)
|
|
803
|
+
} }, null, 8, ["action-options"])]),
|
|
804
|
+
_: 1
|
|
805
|
+
}, 8, [
|
|
806
|
+
"show-context-actions",
|
|
807
|
+
"items",
|
|
808
|
+
"max-width",
|
|
809
|
+
"truncation-offset",
|
|
810
|
+
"mobile-breakpoint",
|
|
811
|
+
"onItemDroppedBreadcrumb"
|
|
812
|
+
])) : K("", !0), e.hasViewOptions ? (Z(), X("div", cs, [J(l, {
|
|
813
|
+
"view-modes": e.viewModes,
|
|
814
|
+
"has-hidden-files": e.hasHiddenFiles,
|
|
815
|
+
"has-file-extensions": e.hasFileExtensions,
|
|
816
|
+
"has-pagination": e.hasPagination,
|
|
817
|
+
"per-page-storage-prefix": "files",
|
|
818
|
+
"view-mode-default": e.viewModeDefault
|
|
819
|
+
}, null, 8, [
|
|
820
|
+
"view-modes",
|
|
821
|
+
"has-hidden-files",
|
|
822
|
+
"has-file-extensions",
|
|
823
|
+
"has-pagination",
|
|
824
|
+
"view-mode-default"
|
|
825
|
+
])])) : K("", !0)], 2),
|
|
826
|
+
e.hasSharesNavigation ? k(e.$slots, "navigation", { key: 0 }) : K("", !0),
|
|
827
|
+
Y("div", ls, [Y("div", us, [k(e.$slots, "actions", { limitedScreenSpace: e.limitedScreenSpace }), e.showBatchActions && !e.batchActionsLoading ? (Z(), H(u, {
|
|
828
|
+
key: 0,
|
|
829
|
+
actions: e.batchActions,
|
|
830
|
+
"action-options": {
|
|
831
|
+
space: e.space,
|
|
832
|
+
resources: e.selectedResources
|
|
833
|
+
},
|
|
834
|
+
"limited-screen-space": e.limitedScreenSpace
|
|
835
|
+
}, null, 8, [
|
|
836
|
+
"actions",
|
|
837
|
+
"action-options",
|
|
838
|
+
"limited-screen-space"
|
|
839
|
+
])) : e.showBatchActions && e.batchActionsLoading ? (Z(), X("div", ds, [J(d, { "aria-label": e.$gettext("Loading actions") }, null, 8, ["aria-label"])])) : K("", !0)])]),
|
|
840
|
+
k(e.$slots, "content")
|
|
841
|
+
])], 2);
|
|
842
|
+
}
|
|
843
|
+
var ps = /* @__PURE__ */ B(as, [["render", fs]]), ms = { class: "oc-app-top-bar self-center flex col-[1/4] row-2 sm:col-2 sm:row-1 [&_.parent-folder]:text-role-on-chrome" }, hs = { class: "pl-4 pr-1 my-2 mx-auto sm:m-0 inline-flex items-center justify-between bg-role-chrome border border-role-on-chrome rounded-lg h-10 gap-4 w-full sm:w-fit" }, gs = { class: "open-file-bar flex" }, _s = { class: "flex" }, vs = {
|
|
844
|
+
key: 1,
|
|
845
|
+
class: "flex items-center",
|
|
846
|
+
"data-testid": "autosave-indicator"
|
|
847
|
+
}, ys = /* @__PURE__ */ U({
|
|
848
|
+
__name: "AppTopBar",
|
|
849
|
+
props: {
|
|
850
|
+
dropDownMenuSections: { default: () => [] },
|
|
851
|
+
dropDownActionOptions: { default: () => ({
|
|
852
|
+
space: null,
|
|
853
|
+
resources: []
|
|
854
|
+
}) },
|
|
855
|
+
mainActions: { default: () => [] },
|
|
856
|
+
hasAutoSave: {
|
|
857
|
+
type: Boolean,
|
|
858
|
+
default: !0
|
|
859
|
+
},
|
|
860
|
+
isEditor: {
|
|
861
|
+
type: Boolean,
|
|
862
|
+
default: !1
|
|
863
|
+
},
|
|
864
|
+
resource: { default: null },
|
|
865
|
+
isReadOnly: {
|
|
866
|
+
type: Boolean,
|
|
867
|
+
default: !0
|
|
868
|
+
}
|
|
869
|
+
},
|
|
870
|
+
emits: ["close"],
|
|
871
|
+
setup(e) {
|
|
872
|
+
let { $gettext: t, current: n } = Q(), r = dr(), i = Hn(), { getMatchingSpace: a } = O(), { getParentFolderName: o, getPathPrefix: s, getParentFolderLinkIconAdditionalAttributes: c } = Ba(), l = q(() => r.areFileExtensionsShown), u = q(() => t("Show context menu")), d = q(() => e.isEditor && e.hasAutoSave && i.options.editor.autosaveEnabled), f = q(() => t("Autosave (every %{ duration })", { duration: vo.fromObject({ seconds: i.options.editor.autosaveInterval }, { locale: n }).toHuman() })), p = q(() => a(e.resource)), m = q(() => !co(R(p)));
|
|
873
|
+
return (n, r) => {
|
|
874
|
+
let i = I("oc-icon"), a = I("oc-button"), p = I("oc-drop"), h = ti("oc-tooltip");
|
|
875
|
+
return Z(), X("div", ms, [Y("div", hs, [Y("div", gs, [e.resource ? (Z(), H(y, {
|
|
876
|
+
key: 0,
|
|
877
|
+
id: "app-top-bar-resource",
|
|
878
|
+
class: "[&_.oc-resource-name]:max-w-60 xs:[&_.oc-resource-name]:max-w-full sm:[&_.oc-resource-name]:max-w-20 md:[&_.oc-resource-name]:max-w-60 [&_svg]:!fill-role-on-chrome [&_span]:text-role-on-chrome",
|
|
879
|
+
"is-thumbnail-displayed": !1,
|
|
880
|
+
"is-extension-displayed": l.value,
|
|
881
|
+
"path-prefix": R(s)(e.resource),
|
|
882
|
+
resource: e.resource,
|
|
883
|
+
"parent-folder-name": R(o)(e.resource),
|
|
884
|
+
"parent-folder-link-icon-additional-attributes": R(c)(e.resource),
|
|
885
|
+
"is-path-displayed": m.value,
|
|
886
|
+
"is-favorite-displayed": !1,
|
|
887
|
+
"is-resource-clickable": !1
|
|
888
|
+
}, null, 8, [
|
|
889
|
+
"is-extension-displayed",
|
|
890
|
+
"path-prefix",
|
|
891
|
+
"resource",
|
|
892
|
+
"parent-folder-name",
|
|
893
|
+
"parent-folder-link-icon-additional-attributes",
|
|
894
|
+
"is-path-displayed"
|
|
895
|
+
])) : K("", !0)]), Y("div", _s, [
|
|
896
|
+
e.dropDownMenuSections.length ? (Z(), X(W, { key: 0 }, [L((Z(), H(a, {
|
|
897
|
+
id: "oc-openfile-contextmenu-trigger",
|
|
898
|
+
"aria-label": u.value,
|
|
899
|
+
appearance: "raw-inverse",
|
|
900
|
+
"color-role": "chrome",
|
|
901
|
+
class: "p-1"
|
|
902
|
+
}, {
|
|
903
|
+
default: F(() => [J(i, { name: "more-2" })]),
|
|
904
|
+
_: 1
|
|
905
|
+
}, 8, ["aria-label"])), [[h, u.value]]), J(p, {
|
|
906
|
+
"drop-id": "oc-openfile-contextmenu",
|
|
907
|
+
mode: "click",
|
|
908
|
+
"padding-size": "small",
|
|
909
|
+
toggle: "#oc-openfile-contextmenu-trigger",
|
|
910
|
+
"close-on-click": "",
|
|
911
|
+
title: e.resource.name,
|
|
912
|
+
onClick: r[0] ||= Ki(() => {}, ["stop", "prevent"])
|
|
913
|
+
}, {
|
|
914
|
+
default: F(() => [J(Ho, {
|
|
915
|
+
"menu-sections": e.dropDownMenuSections,
|
|
916
|
+
"action-options": e.dropDownActionOptions
|
|
917
|
+
}, null, 8, ["menu-sections", "action-options"])]),
|
|
918
|
+
_: 1
|
|
919
|
+
}, 8, ["title"])], 64)) : K("", !0),
|
|
920
|
+
d.value && !e.isReadOnly ? (Z(), X("span", vs, [L(J(i, {
|
|
921
|
+
"accessible-label": f.value,
|
|
922
|
+
name: "refresh",
|
|
923
|
+
color: "var(--oc-role-on-chrome)",
|
|
924
|
+
class: "ox-p-xs mx-1"
|
|
925
|
+
}, null, 8, ["accessible-label"]), [[h, f.value]])])) : K("", !0),
|
|
926
|
+
e.mainActions.length && e.resource ? (Z(), H(Ho, {
|
|
927
|
+
key: 2,
|
|
928
|
+
"menu-sections": [{
|
|
929
|
+
name: "main-actions",
|
|
930
|
+
items: e.mainActions.filter((e) => e.isVisible()).map((e) => ({
|
|
931
|
+
...e,
|
|
932
|
+
class: "p-1 text-role-on-chrome [&_svg]:!fill-role-on-chrome [&:hover:not(:disabled)_svg]:!fill-role-chrome",
|
|
933
|
+
hideLabel: !0
|
|
934
|
+
}))
|
|
935
|
+
}],
|
|
936
|
+
"action-options": { resources: [e.resource] },
|
|
937
|
+
appearance: "raw-inverse",
|
|
938
|
+
"color-role": "chrome"
|
|
939
|
+
}, null, 8, ["menu-sections", "action-options"])) : K("", !0),
|
|
940
|
+
J(a, {
|
|
941
|
+
id: "app-top-bar-close",
|
|
942
|
+
appearance: "raw-inverse",
|
|
943
|
+
"color-role": "chrome",
|
|
944
|
+
class: "p-1",
|
|
945
|
+
"aria-label": R(t)("Close"),
|
|
946
|
+
onClick: r[1] ||= (e) => n.$emit("close")
|
|
947
|
+
}, {
|
|
948
|
+
default: F(() => [J(i, { name: "close" })]),
|
|
949
|
+
_: 1
|
|
950
|
+
}, 8, ["aria-label"])
|
|
951
|
+
])])]);
|
|
952
|
+
};
|
|
953
|
+
}
|
|
954
|
+
}), bs = U({
|
|
955
|
+
name: "ErrorScreen",
|
|
956
|
+
props: { message: {
|
|
957
|
+
default: "",
|
|
958
|
+
type: String,
|
|
959
|
+
required: !1
|
|
960
|
+
} }
|
|
961
|
+
}), xs = { class: "text-center flex justify-center items-center h-full" }, Ss = {
|
|
962
|
+
key: 0,
|
|
963
|
+
class: "text-xl"
|
|
353
964
|
};
|
|
965
|
+
function Cs(e, t, n, r, i, a) {
|
|
966
|
+
let o = I("oc-icon");
|
|
967
|
+
return Z(), X("div", xs, [J(o, {
|
|
968
|
+
size: "xxlarge",
|
|
969
|
+
name: "error-warning",
|
|
970
|
+
"fill-type": "line"
|
|
971
|
+
}), e.message ? (Z(), X("p", Ss, G(e.message), 1)) : K("", !0)]);
|
|
972
|
+
}
|
|
973
|
+
var ws = /* @__PURE__ */ B(bs, [["render", Cs]]), Ts = U({ name: "LoadingScreen" }), Es = { class: "text-center flex justify-center items-center h-full" }, Ds = ["textContent"];
|
|
974
|
+
function Os(e, t, n, r, i, a) {
|
|
975
|
+
let o = I("oc-spinner");
|
|
976
|
+
return Z(), X("div", Es, [J(o, { size: "xlarge" }), Y("p", {
|
|
977
|
+
class: "sr-only",
|
|
978
|
+
textContent: G(e.$gettext("Loading app"))
|
|
979
|
+
}, null, 8, Ds)]);
|
|
980
|
+
}
|
|
981
|
+
var ks = /* @__PURE__ */ B(Ts, [["render", Os]]), As = [
|
|
982
|
+
"id",
|
|
983
|
+
"data-testid",
|
|
984
|
+
"tabindex",
|
|
985
|
+
"inert"
|
|
986
|
+
], js = {
|
|
987
|
+
key: 0,
|
|
988
|
+
class: "sidebar-panel__header header grid grid-cols-[1fr_auto] items-center pt-2 px-2 pb-2"
|
|
989
|
+
}, Ms = { class: "sidebar-panel__header-info min-w-0" }, Ns = { class: "flex items-center gap-1 shrink-0" }, Ps = {
|
|
990
|
+
key: 0,
|
|
991
|
+
class: "mt-4"
|
|
992
|
+
}, Fs = /* @__PURE__ */ B(/* @__PURE__ */ U({
|
|
993
|
+
__name: "SideBarPanels",
|
|
994
|
+
props: {
|
|
995
|
+
loading: { type: Boolean },
|
|
996
|
+
availablePanels: {},
|
|
997
|
+
panelContext: {},
|
|
998
|
+
activePanel: { default: "" }
|
|
999
|
+
},
|
|
1000
|
+
emits: [
|
|
1001
|
+
"selectPanel",
|
|
1002
|
+
"close",
|
|
1003
|
+
"closePanel"
|
|
1004
|
+
],
|
|
1005
|
+
setup(e, { emit: t }) {
|
|
1006
|
+
let n = t, { $gettext: r } = Q(), i = q(() => e.availablePanels.filter((t) => t.isVisible(e.panelContext) && t.isRoot?.(e.panelContext))), a = q(() => e.availablePanels.filter((t) => t.isVisible(e.panelContext) && !t.isRoot?.(e.panelContext))), o = q(() => R(i).length ? [R(i)[0], ...R(a)] : R(a)), s = q(() => {
|
|
1007
|
+
let t = e.activePanel?.split("#")[0];
|
|
1008
|
+
return !t || !R(a).map((e) => e.name).includes(t) ? null : t;
|
|
1009
|
+
}), c = q(() => R(s) !== null), l = q(() => R(s) === null), d = z(null), f = (e) => {
|
|
1010
|
+
d.value = e;
|
|
1011
|
+
}, p = q(() => R(c) ? R(s) : R(i)[0].name), m = q(() => R(i).length === 1 ? r("Back to %{panel} panel", { panel: R(i)[0].title(e.panelContext) }) : r("Back to main panels")), h = (e) => {
|
|
1012
|
+
n("selectPanel", e);
|
|
1013
|
+
}, g = () => {
|
|
1014
|
+
n("selectPanel", null);
|
|
1015
|
+
}, _ = () => {
|
|
1016
|
+
n("close");
|
|
1017
|
+
}, v = (e) => {
|
|
1018
|
+
f(R(p)), h(e);
|
|
1019
|
+
}, y = () => {
|
|
1020
|
+
f(R(p)), g(), n("closePanel");
|
|
1021
|
+
};
|
|
1022
|
+
return (t, n) => {
|
|
1023
|
+
let f = I("oc-spinner"), h = I("oc-icon"), g = I("oc-button"), b = ti("oc-tooltip");
|
|
1024
|
+
return e.loading ? (Z(), H(f, {
|
|
1025
|
+
key: 0,
|
|
1026
|
+
"aria-label": R(r)("Loading sidebar content")
|
|
1027
|
+
}, null, 8, ["aria-label"])) : (Z(!0), X(W, { key: 1 }, M(o.value, (n) => (Z(), X("div", {
|
|
1028
|
+
id: `sidebar-panel-${n.name}`,
|
|
1029
|
+
key: `panel-${n.name}`,
|
|
1030
|
+
"data-testid": `sidebar-panel-${n.name}`,
|
|
1031
|
+
tabindex: p.value === n.name ? -1 : null,
|
|
1032
|
+
class: V(["sidebar-panel absolute top-0 grid grid-rows-[auto_1fr] bg-role-surface w-full size-full max-w-full max-h-full motion-reduce:transition-none", {
|
|
1033
|
+
"is-root-panel transition-[right] duration-[0.4s,0s]": n.isRoot?.(e.panelContext),
|
|
1034
|
+
"is-active-sub-panel": c.value && s.value === n.name,
|
|
1035
|
+
"is-active-root-panel transition-[right] duration-[0.4s,0s]": l.value && n.isRoot?.(e.panelContext)
|
|
1036
|
+
}]),
|
|
1037
|
+
inert: p.value !== n.name
|
|
1038
|
+
}, [[p.value, d.value].includes(n.name) ? (Z(), X("div", js, [Y("div", Ms, [n.isRoot?.(e.panelContext) ? k(t.$slots, "rootHeader", { key: 0 }, void 0, !0) : k(t.$slots, "subHeader", { key: 1 }, void 0, !0)]), Y("div", Ns, [n.isRoot?.(e.panelContext) ? K("", !0) : L((Z(), H(g, {
|
|
1039
|
+
key: 0,
|
|
1040
|
+
class: "header__back p-1",
|
|
1041
|
+
appearance: "raw",
|
|
1042
|
+
"aria-label": m.value,
|
|
1043
|
+
onClick: y
|
|
1044
|
+
}, {
|
|
1045
|
+
default: F(() => [J(h, {
|
|
1046
|
+
name: "arrow-left-s",
|
|
1047
|
+
"fill-type": "line"
|
|
1048
|
+
})]),
|
|
1049
|
+
_: 1
|
|
1050
|
+
}, 8, ["aria-label"])), [[b, m.value]]), J(g, {
|
|
1051
|
+
appearance: "raw",
|
|
1052
|
+
class: "header__close p-1",
|
|
1053
|
+
"aria-label": R(r)("Close file sidebar"),
|
|
1054
|
+
onClick: _
|
|
1055
|
+
}, {
|
|
1056
|
+
default: F(() => [J(h, { name: "close" })]),
|
|
1057
|
+
_: 1
|
|
1058
|
+
}, 8, ["aria-label"])])])) : K("", !0), Y("div", { class: V(["sidebar-panel__body flex flex-col px-2 pb-2 pt-0 overflow-y-auto overflow-x-hidden", [`sidebar-panel__body-${n.name}`]]) }, [Y("div", { class: V(["sidebar-panel__body-content", { "flex-1 ": !n.isRoot?.(e.panelContext) }]) }, [k(t.$slots, "body", {}, () => [(Z(!0), X(W, null, M(n.isRoot?.(e.panelContext) ? i.value : [n], (t, n) => (Z(), X("div", { key: `sidebar-panel-${t.name}` }, [(l.value ? t.isRoot?.(e.panelContext) : [p.value, d.value].includes(t.name)) ? (Z(), H(u(t.component), va({
|
|
1059
|
+
key: 0,
|
|
1060
|
+
class: [{ "multi-root-panel-separator mt-4 pt-2 border-t": n > 0 }, "rounded-sm"]
|
|
1061
|
+
}, { ref_for: !0 }, t.componentAttrs?.(e.panelContext) || {}), null, 16, ["class"])) : K("", !0)]))), 128))], !0)], 2), n.isRoot?.(e.panelContext) && a.value.length > 0 ? (Z(), X("div", Ps, [(Z(!0), X(W, null, M(a.value, (t) => (Z(), H(g, {
|
|
1062
|
+
id: `sidebar-panel-${t.name}-select`,
|
|
1063
|
+
key: `panel-select-${t.name}`,
|
|
1064
|
+
"data-testid": `sidebar-panel-${t.name}-select`,
|
|
1065
|
+
appearance: "raw-inverse",
|
|
1066
|
+
"color-role": "surface",
|
|
1067
|
+
class: "!grid !grid-cols-[auto_1fr_auto] text-left px-2 w-full h-12",
|
|
1068
|
+
onClick: (e) => v(t.name)
|
|
1069
|
+
}, {
|
|
1070
|
+
default: F(() => [
|
|
1071
|
+
J(h, {
|
|
1072
|
+
name: t.icon,
|
|
1073
|
+
"fill-type": t.iconFillType
|
|
1074
|
+
}, null, 8, ["name", "fill-type"]),
|
|
1075
|
+
Cr(" " + G(t.title(e.panelContext)) + " ", 1),
|
|
1076
|
+
J(h, {
|
|
1077
|
+
name: "arrow-right-s",
|
|
1078
|
+
"fill-type": "line"
|
|
1079
|
+
})
|
|
1080
|
+
]),
|
|
1081
|
+
_: 2
|
|
1082
|
+
}, 1032, [
|
|
1083
|
+
"id",
|
|
1084
|
+
"data-testid",
|
|
1085
|
+
"onClick"
|
|
1086
|
+
]))), 128))])) : K("", !0)], 2)], 10, As))), 128));
|
|
1087
|
+
};
|
|
1088
|
+
}
|
|
1089
|
+
}), [["__scopeId", "data-v-ab6afab6"]]), Is = /* @__PURE__ */ U({
|
|
1090
|
+
inheritAttrs: !1,
|
|
1091
|
+
__name: "SideBar",
|
|
1092
|
+
props: {
|
|
1093
|
+
loading: { type: Boolean },
|
|
1094
|
+
availablePanels: {},
|
|
1095
|
+
panelContext: {}
|
|
1096
|
+
},
|
|
1097
|
+
emits: ["selectPanel", "close"],
|
|
1098
|
+
setup(e, { emit: t }) {
|
|
1099
|
+
let n = t, r = lt(), { isMobile: i } = $i(), a = Oi(), { focusSidebar: o } = a, { sideBarActivePanel: s } = $(a), c = q(() => {
|
|
1100
|
+
if (R(i)) return {
|
|
1101
|
+
...R(r),
|
|
1102
|
+
isFocusTrapActive: !e.loading,
|
|
1103
|
+
hasFullHeight: !0,
|
|
1104
|
+
maxHeight: "max-h-[80vh]",
|
|
1105
|
+
class: "z-100",
|
|
1106
|
+
onClicked: l
|
|
1107
|
+
};
|
|
1108
|
+
let t = [
|
|
1109
|
+
"border-l",
|
|
1110
|
+
"focus:outline-0",
|
|
1111
|
+
"focus-visible:outline-0",
|
|
1112
|
+
"w-[360px]",
|
|
1113
|
+
"min-w-[360px]",
|
|
1114
|
+
"overflow-hidden",
|
|
1115
|
+
"relative",
|
|
1116
|
+
"focus:shadow-none",
|
|
1117
|
+
"focus-visible:shadow-none",
|
|
1118
|
+
...R(r)?.class ? [R(r).class] : []
|
|
1119
|
+
];
|
|
1120
|
+
return e.loading && t.push("flex", "justify-center", "items-center"), {
|
|
1121
|
+
...R(r),
|
|
1122
|
+
class: t
|
|
1123
|
+
};
|
|
1124
|
+
}), l = (e) => {
|
|
1125
|
+
if (!e.target) return;
|
|
1126
|
+
let t = e.target === e.currentTarget, n = e.target instanceof HTMLAnchorElement, r = e.target.closest("ul.sidebar-actions-panel");
|
|
1127
|
+
(t || n || r) && d();
|
|
1128
|
+
}, d = () => {
|
|
1129
|
+
a.closeSideBar(), n("close");
|
|
1130
|
+
}, f = (e) => {
|
|
1131
|
+
a.openSideBarPanel(e), n("selectPanel", e);
|
|
1132
|
+
};
|
|
1133
|
+
return ee(() => {
|
|
1134
|
+
R(i) && d();
|
|
1135
|
+
}), (t, n) => (Z(), H(Gn, {
|
|
1136
|
+
to: "#mobile-right-sidebar",
|
|
1137
|
+
disabled: !R(i)
|
|
1138
|
+
}, [(Z(), H(u(R(i) ? "oc-bottom-drawer" : "div"), va({
|
|
1139
|
+
id: "app-sidebar",
|
|
1140
|
+
tabindex: "-1"
|
|
1141
|
+
}, c.value), {
|
|
1142
|
+
default: F(() => [J(Fs, {
|
|
1143
|
+
loading: e.loading,
|
|
1144
|
+
"available-panels": e.availablePanels,
|
|
1145
|
+
"panel-context": e.panelContext,
|
|
1146
|
+
"active-panel": R(s),
|
|
1147
|
+
onSelectPanel: f,
|
|
1148
|
+
onClose: d,
|
|
1149
|
+
onClosePanel: R(o)
|
|
1150
|
+
}, {
|
|
1151
|
+
body: F(() => [k(t.$slots, "body")]),
|
|
1152
|
+
rootHeader: F(() => [k(t.$slots, "rootHeader")]),
|
|
1153
|
+
subHeader: F(() => [k(t.$slots, "subHeader")]),
|
|
1154
|
+
_: 3
|
|
1155
|
+
}, 8, [
|
|
1156
|
+
"loading",
|
|
1157
|
+
"available-panels",
|
|
1158
|
+
"panel-context",
|
|
1159
|
+
"active-panel",
|
|
1160
|
+
"onClosePanel"
|
|
1161
|
+
])]),
|
|
1162
|
+
_: 3
|
|
1163
|
+
}, 16))], 8, ["disabled"]));
|
|
1164
|
+
}
|
|
1165
|
+
}), Ls = {
|
|
1166
|
+
key: 0,
|
|
1167
|
+
class: "flex items-center min-w-0 ml-2"
|
|
1168
|
+
}, Rs = ["textContent"], zs = /* @__PURE__ */ U({
|
|
1169
|
+
__name: "SpaceInfo",
|
|
1170
|
+
props: { spaceResource: { default: null } },
|
|
1171
|
+
setup(e) {
|
|
1172
|
+
let t = Rn("resource", null), n = Rn("space", null), r = q(() => e.spaceResource || R(t) || R(n));
|
|
1173
|
+
return (e, t) => {
|
|
1174
|
+
let n = I("oc-icon");
|
|
1175
|
+
return r.value ? (Z(), X("div", Ls, [J(n, {
|
|
1176
|
+
name: "layout-grid",
|
|
1177
|
+
size: "small",
|
|
1178
|
+
class: "mr-2 shrink-0"
|
|
1179
|
+
}), Y("h2", {
|
|
1180
|
+
"data-testid": "space-info-name",
|
|
1181
|
+
class: "font-semibold m-0 text-base min-w-0 flex-1 truncate",
|
|
1182
|
+
textContent: G(r.value.name)
|
|
1183
|
+
}, null, 8, Rs)])) : K("", !0);
|
|
1184
|
+
};
|
|
1185
|
+
}
|
|
1186
|
+
}), Bs = {
|
|
1187
|
+
key: 0,
|
|
1188
|
+
class: "flex justify-between min-w-0 ml-2"
|
|
1189
|
+
}, Vs = { class: "flex items-center min-w-0" }, Hs = { class: "min-w-0" }, Us = {
|
|
1190
|
+
"data-testid": "files-info-name",
|
|
1191
|
+
class: "font-semibold m-0 text-base min-w-0"
|
|
1192
|
+
}, Ws = /* @__PURE__ */ U({
|
|
1193
|
+
__name: "FileInfo",
|
|
1194
|
+
props: { isSubPanelActive: { type: Boolean } },
|
|
1195
|
+
setup(e) {
|
|
1196
|
+
let t = dr(), { isPersonalSpaceRoot: n } = O(), r = Rn("resource"), i = Rn("space"), a = q(() => t.areFileExtensionsShown), o = q(() => R(r) ? n(R(r)) && R(i)?.name || R(r).name : "");
|
|
1197
|
+
return (e, t) => R(r) ? (Z(), X("div", Bs, [Y("div", Vs, [J(nn, {
|
|
1198
|
+
resource: R(r),
|
|
1199
|
+
size: "large",
|
|
1200
|
+
class: "mr-2 relative shrink-0"
|
|
1201
|
+
}, null, 8, ["resource"]), Y("div", Hs, [Y("h2", Us, [J(ln, {
|
|
1202
|
+
name: o.value,
|
|
1203
|
+
extension: R(r).extension,
|
|
1204
|
+
type: R(r).type,
|
|
1205
|
+
"full-path": R(r).webDavPath,
|
|
1206
|
+
"is-extension-displayed": a.value,
|
|
1207
|
+
"is-path-displayed": !1,
|
|
1208
|
+
"truncate-name": !0,
|
|
1209
|
+
"is-favorite": R(r).starred,
|
|
1210
|
+
class: "block min-w-0"
|
|
1211
|
+
}, null, 8, [
|
|
1212
|
+
"name",
|
|
1213
|
+
"extension",
|
|
1214
|
+
"type",
|
|
1215
|
+
"full-path",
|
|
1216
|
+
"is-extension-displayed",
|
|
1217
|
+
"is-favorite"
|
|
1218
|
+
])])])])])) : K("", !0);
|
|
1219
|
+
}
|
|
1220
|
+
}), Gs = /* @__PURE__ */ U({
|
|
1221
|
+
__name: "FileSideBar",
|
|
1222
|
+
props: { space: { default: () => void 0 } },
|
|
1223
|
+
setup(e) {
|
|
1224
|
+
let t = ji(), n = en(), r = ut(), i = hi(), a = jr(), o = Hn(), s = Xi(), { canListShares: c } = ar(), { canListVersions: l } = Jn(), u = dr(), { currentFolder: d } = $(u), { isSideBarOpen: f, sideBarActivePanel: p } = $(Oi()), m = z(), h = z([]), g = z([]), v = z([]), { selectedResources: y } = wi(), b = z(!1), x = q(() => R(b)), S = q(() => R(y).length === 0 ? {
|
|
1225
|
+
root: e.space,
|
|
1226
|
+
parent: null,
|
|
1227
|
+
items: R(d)?.id ? [R(d)] : []
|
|
1228
|
+
} : {
|
|
1229
|
+
root: e.space,
|
|
1230
|
+
parent: R(d),
|
|
1231
|
+
items: R(y)
|
|
1232
|
+
}), C = jn(Sa, "files-shares-with-me"), ee = jn(Sa, "files-shares-with-others"), w = jn(Sa, "files-shares-via-link"), T = Qr(t, "files-spaces-projects"), te = jn($e, "files-common-favorites"), E = jn($e, "files-common-search"), D = q(() => R(S).items?.length === 1 && !so(R(S).items[0])), O = q(() => R(S).items?.length === 1 && so(R(S).items[0])), k = q(() => R(C) || R(ee) || R(w)), A = q(() => R(k) || R(E) || R(te)), ne = q(() => r.requestExtensions({
|
|
1233
|
+
id: "global.files.sidebar",
|
|
1234
|
+
extensionType: "sidebarPanel"
|
|
1235
|
+
}).map((e) => e.panel)), re = go(function* (e, t) {
|
|
1236
|
+
h.value = yield n.webdav.listFileVersions(t.id, { signal: e });
|
|
1237
|
+
}), j = go(function* (r, c) {
|
|
1238
|
+
a.setLoading(!0), a.removeOrphanedShares();
|
|
1239
|
+
let { collaboratorShares: l, linkShares: d } = a, f = n.graphAuthenticated.permissions, p = e.space?.id;
|
|
1240
|
+
if (uo(e.space)) {
|
|
1241
|
+
let t = yield i.getMountPointForSpace({
|
|
1242
|
+
graphClient: n.graphAuthenticated,
|
|
1243
|
+
space: e.space,
|
|
1244
|
+
signal: r
|
|
1245
|
+
});
|
|
1246
|
+
t && (p = t.root.remoteItem.rootId);
|
|
1247
|
+
}
|
|
1248
|
+
let { shares: m, allowedRoles: h } = yield* Qa(f.listPermissions(p, c.fileId, a.graphRoles, {}, { signal: r })), _ = m.filter(to), y = m.filter(ro), b = Object.values(a.graphRoles);
|
|
1249
|
+
if (g.value = h?.map((e) => ({
|
|
1250
|
+
...e,
|
|
1251
|
+
icon: b.find((t) => t.id === e.id)?.icon
|
|
1252
|
+
})) || [], s.isAppEnabled("open-cloud-mesh")) {
|
|
1253
|
+
let { allowedRoles: e } = yield* Qa(f.listPermissions(p, c.fileId, a.graphRoles, {
|
|
1254
|
+
filter: "@libre.graph.permissions.roles.allowedValues/rolePermissions/any(p:contains(p/condition, '@Subject.UserType==\"Federated\"'))",
|
|
1255
|
+
select: [Lr.LibreGraphPermissionsRolesAllowedValues]
|
|
1256
|
+
}, { signal: r }));
|
|
1257
|
+
v.value = e?.map((e) => ({
|
|
1258
|
+
...e,
|
|
1259
|
+
icon: b.find((t) => t.id === e.id)?.icon
|
|
1260
|
+
})) || [];
|
|
1261
|
+
}
|
|
1262
|
+
!R(A) && !R(T) && (l.forEach((e) => {
|
|
1263
|
+
_.some((t) => t.id === e.id) || _.push({
|
|
1264
|
+
...e,
|
|
1265
|
+
indirect: !0
|
|
1266
|
+
});
|
|
1267
|
+
}), d.forEach((e) => {
|
|
1268
|
+
y.some((t) => t.id === e.id) || y.push({
|
|
1269
|
+
...e,
|
|
1270
|
+
indirect: !0
|
|
1271
|
+
});
|
|
1272
|
+
})), $e(t, "files-common-search") && (yield u.loadAncestorMetaData({
|
|
1273
|
+
folder: R(c),
|
|
1274
|
+
space: e.space,
|
|
1275
|
+
client: n.webdav,
|
|
1276
|
+
signal: r
|
|
1277
|
+
}));
|
|
1278
|
+
let x = [...l, ...d].map(({ resourceId: e }) => e), S = Object.values(u.ancestorMetaData).filter(({ id: t, path: n }) => t === c.id || x.includes(t) || no(c) ? !1 : oo(e.space) ? n !== "/" : !0).map(({ id: e }) => e);
|
|
1279
|
+
R(A) && so(e.space) && !so(c) && S.push(e.space.id);
|
|
1280
|
+
let C = new ho({ concurrency: o.options.concurrentRequests.shares.list }), ee = [...new Set(S)].map((e) => C.add(() => n.graphAuthenticated.permissions.listPermissions(p, e, a.graphRoles, {}, { signal: r }).then((e) => {
|
|
1281
|
+
let t = e.shares.map((e) => ({
|
|
1282
|
+
...e,
|
|
1283
|
+
indirect: !0
|
|
1284
|
+
}));
|
|
1285
|
+
_.push(...t.filter(to)), y.push(...t.filter(ro));
|
|
1286
|
+
})));
|
|
1287
|
+
yield Promise.allSettled(ee), a.setCollaboratorShares(_), a.setLinkShares(y), a.setLoading(!1);
|
|
1288
|
+
}).restartable(), ie = z();
|
|
1289
|
+
P(() => [...R(S).items, f], async (t, n) => {
|
|
1290
|
+
if (R(S).items?.length !== 1) return;
|
|
1291
|
+
if (!R(f)) {
|
|
1292
|
+
ie.value = void 0, h.value = [];
|
|
1293
|
+
return;
|
|
1294
|
+
}
|
|
1295
|
+
let r = t?.[0], i = n?.[0];
|
|
1296
|
+
if (r?.id === i?.id && r?.mdate === R(ie)) return;
|
|
1297
|
+
let a = R(S).items[0];
|
|
1298
|
+
if (ie.value = a.mdate, re.isRunning && re.cancelAll(), l({
|
|
1299
|
+
space: e.space,
|
|
1300
|
+
resource: a
|
|
1301
|
+
})) try {
|
|
1302
|
+
await re.perform(a);
|
|
1303
|
+
} catch (e) {
|
|
1304
|
+
console.error(e);
|
|
1305
|
+
}
|
|
1306
|
+
}, {
|
|
1307
|
+
immediate: !0,
|
|
1308
|
+
deep: !0
|
|
1309
|
+
});
|
|
1310
|
+
let ae = q(() => R(S).items.map((e) => e.id));
|
|
1311
|
+
return P(() => [ae, f], async () => {
|
|
1312
|
+
if (!R(f) || !R(S).items?.length) {
|
|
1313
|
+
a.pruneShares(), m.value = null;
|
|
1314
|
+
return;
|
|
1315
|
+
}
|
|
1316
|
+
if (R(S).items?.length !== 1) return;
|
|
1317
|
+
let t = R(S).items[0];
|
|
1318
|
+
if (b.value = !0, so(t) && await i.loadGraphPermissions({
|
|
1319
|
+
ids: [t.id],
|
|
1320
|
+
graphClient: n.graphAuthenticated
|
|
1321
|
+
}), c({
|
|
1322
|
+
space: e.space,
|
|
1323
|
+
resource: t
|
|
1324
|
+
})) try {
|
|
1325
|
+
j.isRunning && j.cancelAll(), j.perform(t);
|
|
1326
|
+
} catch (e) {
|
|
1327
|
+
console.error(e);
|
|
1328
|
+
}
|
|
1329
|
+
if (!ao(t) && !no(t)) {
|
|
1330
|
+
m.value = t, b.value = !1;
|
|
1331
|
+
return;
|
|
1332
|
+
}
|
|
1333
|
+
try {
|
|
1334
|
+
let r = await n.webdav.getFileInfo(e.space, { path: t.path });
|
|
1335
|
+
m.value = {
|
|
1336
|
+
...r,
|
|
1337
|
+
...t,
|
|
1338
|
+
tags: r.tags
|
|
1339
|
+
};
|
|
1340
|
+
} catch (e) {
|
|
1341
|
+
m.value = t, console.error(e);
|
|
1342
|
+
}
|
|
1343
|
+
b.value = !1;
|
|
1344
|
+
}, {
|
|
1345
|
+
deep: !0,
|
|
1346
|
+
immediate: !0
|
|
1347
|
+
}), Jt("resource", _(m)), Jt("versions", _(h)), Jt("space", q(() => e.space)), Jt("availableInternalShareRoles", _(g)), Jt("availableExternalShareRoles", _(v)), Jt("versionsLoading", q(() => re.isRunning)), (e, t) => R(f) ? (Z(), H(Is, va({
|
|
1348
|
+
key: 0,
|
|
1349
|
+
ref: "sidebar",
|
|
1350
|
+
class: "files-side-bar z-30",
|
|
1351
|
+
"available-panels": ne.value,
|
|
1352
|
+
"panel-context": S.value,
|
|
1353
|
+
loading: x.value
|
|
1354
|
+
}, e.$attrs, { "data-custom-key-bindings-disabled": "true" }), {
|
|
1355
|
+
rootHeader: F(() => [D.value ? (Z(), H(Ws, {
|
|
1356
|
+
key: 0,
|
|
1357
|
+
"is-sub-panel-active": !1
|
|
1358
|
+
})) : O.value ? (Z(), H(zs, { key: 1 })) : K("", !0)]),
|
|
1359
|
+
subHeader: F(() => [D.value ? (Z(), H(Ws, {
|
|
1360
|
+
key: 0,
|
|
1361
|
+
"is-sub-panel-active": !0
|
|
1362
|
+
})) : O.value ? (Z(), H(zs, { key: 1 })) : K("", !0)]),
|
|
1363
|
+
_: 1
|
|
1364
|
+
}, 16, [
|
|
1365
|
+
"available-panels",
|
|
1366
|
+
"panel-context",
|
|
1367
|
+
"loading"
|
|
1368
|
+
])) : K("", !0);
|
|
1369
|
+
}
|
|
1370
|
+
}), Ks = /* @__PURE__ */ ve(kn(), 1), qs = U({
|
|
1371
|
+
name: "DatePickerModal",
|
|
1372
|
+
props: {
|
|
1373
|
+
modal: {
|
|
1374
|
+
type: Object,
|
|
1375
|
+
required: !0
|
|
1376
|
+
},
|
|
1377
|
+
currentDate: {
|
|
1378
|
+
type: Object,
|
|
1379
|
+
required: !1,
|
|
1380
|
+
default: null
|
|
1381
|
+
},
|
|
1382
|
+
minDate: {
|
|
1383
|
+
type: Object,
|
|
1384
|
+
required: !1,
|
|
1385
|
+
default: null
|
|
1386
|
+
},
|
|
1387
|
+
isClearable: {
|
|
1388
|
+
type: Boolean,
|
|
1389
|
+
default: !0
|
|
1390
|
+
}
|
|
1391
|
+
},
|
|
1392
|
+
emits: ["confirm", "cancel"],
|
|
1393
|
+
setup() {
|
|
1394
|
+
let { currentTheme: e } = $(za()), t = z(), n = z(!0);
|
|
1395
|
+
return {
|
|
1396
|
+
confirmDisabled: n,
|
|
1397
|
+
onDateChanged: ({ date: e, error: r }) => {
|
|
1398
|
+
n.value = r || !e, t.value = e;
|
|
1399
|
+
},
|
|
1400
|
+
currentTheme: e,
|
|
1401
|
+
dateTime: t
|
|
1402
|
+
};
|
|
1403
|
+
}
|
|
1404
|
+
}), Js = { class: "flex justify-end items-center mt-2" };
|
|
1405
|
+
function Ys(e, t, n, r, i, a) {
|
|
1406
|
+
let o = I("oc-datepicker"), s = I("oc-button");
|
|
1407
|
+
return Z(), X(W, null, [J(o, {
|
|
1408
|
+
label: e.$gettext("Expiration date"),
|
|
1409
|
+
type: "date",
|
|
1410
|
+
"min-date": e.minDate,
|
|
1411
|
+
"current-date": e.currentDate,
|
|
1412
|
+
"is-clearable": e.isClearable,
|
|
1413
|
+
"is-dark": e.currentTheme.isDark,
|
|
1414
|
+
"required-mark": "",
|
|
1415
|
+
onDateChanged: e.onDateChanged
|
|
1416
|
+
}, null, 8, [
|
|
1417
|
+
"label",
|
|
1418
|
+
"min-date",
|
|
1419
|
+
"current-date",
|
|
1420
|
+
"is-clearable",
|
|
1421
|
+
"is-dark",
|
|
1422
|
+
"onDateChanged"
|
|
1423
|
+
]), Y("div", Js, [J(s, {
|
|
1424
|
+
disabled: e.confirmDisabled,
|
|
1425
|
+
class: "oc-modal-body-actions-confirm ml-2",
|
|
1426
|
+
appearance: "filled",
|
|
1427
|
+
onClick: t[0] ||= (t) => e.$emit("confirm", e.dateTime)
|
|
1428
|
+
}, {
|
|
1429
|
+
default: F(() => [Cr(G(e.$gettext("Confirm")), 1)]),
|
|
1430
|
+
_: 1
|
|
1431
|
+
}, 8, ["disabled"])])], 64);
|
|
1432
|
+
}
|
|
1433
|
+
var Xs = /* @__PURE__ */ B(qs, [["render", Ys]]), Zs = U({
|
|
1434
|
+
name: "UnsavedChangesModal",
|
|
1435
|
+
props: {
|
|
1436
|
+
modal: {
|
|
1437
|
+
type: Object,
|
|
1438
|
+
required: !0
|
|
1439
|
+
},
|
|
1440
|
+
closeCallback: {
|
|
1441
|
+
type: Function,
|
|
1442
|
+
required: !0
|
|
1443
|
+
}
|
|
1444
|
+
},
|
|
1445
|
+
emits: ["cancel", "confirm"],
|
|
1446
|
+
setup(e) {
|
|
1447
|
+
let { removeModal: t } = Ma();
|
|
1448
|
+
return { onClose: () => {
|
|
1449
|
+
t(e.modal.id), e.closeCallback();
|
|
1450
|
+
} };
|
|
1451
|
+
}
|
|
1452
|
+
}), Qs = ["textContent"], $s = { class: "flex justify-end items-center mt-4" }, ec = { class: "oc-modal-body-actions-grid" };
|
|
1453
|
+
function tc(e, t, n, r, i, a) {
|
|
1454
|
+
let o = I("oc-button");
|
|
1455
|
+
return Z(), X(W, null, [
|
|
1456
|
+
Y("span", {
|
|
1457
|
+
class: "inline-block mb-4",
|
|
1458
|
+
textContent: G(e.$gettext("Your changes were not saved. Do you want to save them?"))
|
|
1459
|
+
}, null, 8, Qs),
|
|
1460
|
+
t[2] ||= Y("div", { class: "my-4" }, null, -1),
|
|
1461
|
+
Y("div", $s, [Y("div", ec, [
|
|
1462
|
+
J(o, {
|
|
1463
|
+
class: "oc-modal-body-actions-cancel ml-2",
|
|
1464
|
+
onClick: t[0] ||= (t) => e.$emit("cancel")
|
|
1465
|
+
}, {
|
|
1466
|
+
default: F(() => [Cr(G(e.$gettext("Cancel")), 1)]),
|
|
1467
|
+
_: 1
|
|
1468
|
+
}),
|
|
1469
|
+
J(o, {
|
|
1470
|
+
class: "oc-modal-body-actions-secondary ml-2",
|
|
1471
|
+
onClick: e.onClose
|
|
1472
|
+
}, {
|
|
1473
|
+
default: F(() => [Cr(G(e.$gettext("Don't Save")), 1)]),
|
|
1474
|
+
_: 1
|
|
1475
|
+
}, 8, ["onClick"]),
|
|
1476
|
+
J(o, {
|
|
1477
|
+
class: "oc-modal-body-actions-confirm ml-2",
|
|
1478
|
+
appearance: "filled",
|
|
1479
|
+
onClick: t[1] ||= (t) => e.$emit("confirm")
|
|
1480
|
+
}, {
|
|
1481
|
+
default: F(() => [Cr(G(e.$gettext("Save")), 1)]),
|
|
1482
|
+
_: 1
|
|
1483
|
+
})
|
|
1484
|
+
])])
|
|
1485
|
+
], 64);
|
|
1486
|
+
}
|
|
1487
|
+
var nc = /* @__PURE__ */ B(Zs, [["render", tc]]), rc = /\s/;
|
|
1488
|
+
function ic(e) {
|
|
1489
|
+
for (var t = e.length; t-- && rc.test(e.charAt(t)););
|
|
1490
|
+
return t;
|
|
1491
|
+
}
|
|
1492
|
+
//#endregion
|
|
1493
|
+
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseTrim.js
|
|
1494
|
+
var ac = /^\s+/;
|
|
1495
|
+
function oc(e) {
|
|
1496
|
+
return e && e.slice(0, ic(e) + 1).replace(ac, "");
|
|
1497
|
+
}
|
|
1498
|
+
//#endregion
|
|
1499
|
+
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/toNumber.js
|
|
1500
|
+
var sc = NaN, cc = /^[-+]0x[0-9a-f]+$/i, lc = /^0b[01]+$/i, uc = /^0o[0-7]+$/i, dc = parseInt;
|
|
1501
|
+
function fc(e) {
|
|
1502
|
+
if (typeof e == "number") return e;
|
|
1503
|
+
if (ie(e)) return sc;
|
|
1504
|
+
if (ce(e)) {
|
|
1505
|
+
var t = typeof e.valueOf == "function" ? e.valueOf() : e;
|
|
1506
|
+
e = ce(t) ? t + "" : t;
|
|
1507
|
+
}
|
|
1508
|
+
if (typeof e != "string") return e === 0 ? e : +e;
|
|
1509
|
+
e = oc(e);
|
|
1510
|
+
var n = lc.test(e);
|
|
1511
|
+
return n || uc.test(e) ? dc(e.slice(2), n ? 2 : 8) : cc.test(e) ? sc : +e;
|
|
1512
|
+
}
|
|
1513
|
+
//#endregion
|
|
1514
|
+
//#region src/components/AppTemplates/AppWrapper.vue?vue&type=script&setup=true&lang.ts
|
|
1515
|
+
var pc = ["id"], mc = ["textContent"], hc = {
|
|
1516
|
+
key: 2,
|
|
1517
|
+
class: "flex size-full"
|
|
1518
|
+
}, gc = "app.app-wrapper.app-top-bar", _c = /* @__PURE__ */ U({
|
|
1519
|
+
__name: "AppWrapper",
|
|
1520
|
+
props: {
|
|
1521
|
+
applicationId: {},
|
|
1522
|
+
urlForResourceOptions: { default: null },
|
|
1523
|
+
fileContentOptions: { default: null },
|
|
1524
|
+
wrappedComponent: { default: null },
|
|
1525
|
+
importResourceWithExtension: {
|
|
1526
|
+
type: Function,
|
|
1527
|
+
default: () => null
|
|
1528
|
+
},
|
|
1529
|
+
disableAutoSave: {
|
|
1530
|
+
type: Boolean,
|
|
1531
|
+
default: !1
|
|
1532
|
+
}
|
|
1533
|
+
},
|
|
1534
|
+
setup(e) {
|
|
1535
|
+
let { $gettext: t, current: n } = Q(), i = Xi(), { showMessage: a, showErrorMessage: o } = Me(), s = Co(), c = br(), l = en(), u = qt(), { getResourceContext: d } = Pa(), { selectedResources: p } = wi(), { dispatchModal: m } = Ma(), h = hi(), g = Hn(), _ = dr(), v = jr(), y = je(), { isMobile: b } = $i(), { isSideBarOpen: x } = $(Oi()), { actions: S } = ba({ appId: e.applicationId }), { actions: C } = Sr(), { actions: ee } = f(), { actions: w } = li(), { actions: T } = ki(), { actions: te } = pe(), E = q(() => !!e.wrappedComponent.emits?.includes("update:resource")), O = z(), A = z(), ne = z(""), re = z(""), j = z(!R(E)), ie = z(), ae = z(!1), M = z(), N = z(), oe = "", se = null, { registerExtensions: ce, unregisterExtensions: le } = ut();
|
|
1536
|
+
ce(q(() => R(j) || R(ie) || !R(O) ? [] : [{
|
|
1537
|
+
id: gc,
|
|
1538
|
+
type: "customComponent",
|
|
1539
|
+
extensionPointIds: ["app.runtime.header.left"],
|
|
1540
|
+
content: ys,
|
|
1541
|
+
componentProps: () => ({
|
|
1542
|
+
resource: R(O),
|
|
1543
|
+
isReadOnly: R(ae),
|
|
1544
|
+
isEditor: R(de),
|
|
1545
|
+
hasAutoSave: !e.disableAutoSave,
|
|
1546
|
+
mainActions: R(nt),
|
|
1547
|
+
dropDownMenuSections: R(tt),
|
|
1548
|
+
dropDownActionOptions: R(Je),
|
|
1549
|
+
onClose: () => {
|
|
1550
|
+
_e();
|
|
1551
|
+
}
|
|
1552
|
+
})
|
|
1553
|
+
}]));
|
|
1554
|
+
let { actions: ue } = Fi({ content: N }), de = q(() => !!e.wrappedComponent.emits?.includes("update:currentContent")), fe = (t) => !!Object.keys(e.wrappedComponent.props).includes(t), me = q(() => R(N) !== R(M)), he = (e) => {
|
|
1555
|
+
e.preventDefault();
|
|
1556
|
+
};
|
|
1557
|
+
P(me, (e) => {
|
|
1558
|
+
e ? window.addEventListener("beforeunload", he) : window.removeEventListener("beforeunload", he);
|
|
1559
|
+
});
|
|
1560
|
+
let { applicationConfig: ge, closeApp: _e, currentFileContext: ve, getFileContents: ye, getFileInfo: be, getUrlForResource: xe, putFileContents: Se, replaceInvalidFileRoute: Ce, revokeUrl: we, activeFiles: Te, loadFolderForFileContext: Ee, isFolderLoading: De } = Jr({ applicationId: e.applicationId }), { applicationMeta: Oe } = Ye({
|
|
1561
|
+
applicationId: e.applicationId,
|
|
1562
|
+
appsStore: i
|
|
1563
|
+
}), ke = q(() => R(Oe).meta?.fileSizeLimit), Ae = q(() => {
|
|
1564
|
+
let { name: e } = R(Oe);
|
|
1565
|
+
return t("%{appName} for %{fileName}", {
|
|
1566
|
+
appName: t(e),
|
|
1567
|
+
fileName: R(R(ve).fileName)
|
|
1568
|
+
});
|
|
1569
|
+
}), Ne = _r("driveAliasAndItem"), Pe = r("fileId"), Fe = q(() => Le(R(Pe))), Ie = async () => {
|
|
1570
|
+
let e = R(Fe), { space: t, path: n } = await d(e), r = t.getDriveAliasAndItem({ path: n });
|
|
1571
|
+
return oo(t) ? s.push({
|
|
1572
|
+
params: {
|
|
1573
|
+
...R(c).params,
|
|
1574
|
+
driveAliasAndItem: r
|
|
1575
|
+
},
|
|
1576
|
+
query: {
|
|
1577
|
+
...R(c).query,
|
|
1578
|
+
fileId: e,
|
|
1579
|
+
contextRouteName: "files-spaces-generic",
|
|
1580
|
+
contextRouteParams: { driveAliasAndItem: (0, Ks.dirname)(r) }
|
|
1581
|
+
}
|
|
1582
|
+
}) : s.push({
|
|
1583
|
+
params: {
|
|
1584
|
+
...R(c).params,
|
|
1585
|
+
driveAliasAndItem: r
|
|
1586
|
+
},
|
|
1587
|
+
query: {
|
|
1588
|
+
...R(c).query,
|
|
1589
|
+
fileId: e,
|
|
1590
|
+
contextRouteName: n === "/" ? "files-shares-with-me" : "files-spaces-generic",
|
|
1591
|
+
...uo(t) && { shareId: t.id },
|
|
1592
|
+
contextRouteParams: { driveAliasAndItem: (0, Ks.dirname)(r) },
|
|
1593
|
+
contextRouteQuery: { ...uo(t) && { shareId: t.id } }
|
|
1594
|
+
}
|
|
1595
|
+
});
|
|
1596
|
+
}, Re = go(function* (e) {
|
|
1597
|
+
try {
|
|
1598
|
+
R(Ne) || (yield Ie()), A.value = R(R(ve).space);
|
|
1599
|
+
let t = yield be(R(ve), { signal: e });
|
|
1600
|
+
if (O.value = t, uo(R(A)) && (R(O).remoteItemId = R(A).id, R(O).id === R(O).remoteItemId)) {
|
|
1601
|
+
let e = yield* Qa(pr({
|
|
1602
|
+
graphClient: l.graphAuthenticated,
|
|
1603
|
+
spacesStore: h,
|
|
1604
|
+
space: R(A)
|
|
1605
|
+
}));
|
|
1606
|
+
e && (O.value = {
|
|
1607
|
+
...t,
|
|
1608
|
+
...Xa({
|
|
1609
|
+
graphRoles: v.graphRoles,
|
|
1610
|
+
driveItem: e,
|
|
1611
|
+
serverUrl: g.serverUrl
|
|
1612
|
+
}),
|
|
1613
|
+
tags: t.tags
|
|
1614
|
+
});
|
|
1615
|
+
}
|
|
1616
|
+
_.initResourceList({
|
|
1617
|
+
currentFolder: null,
|
|
1618
|
+
resources: [R(O)]
|
|
1619
|
+
}), p.value = [R(O)];
|
|
1620
|
+
} catch (e) {
|
|
1621
|
+
console.error(e), ie.value = e, j.value = !1;
|
|
1622
|
+
}
|
|
1623
|
+
}).restartable(), ze = go(function* (n) {
|
|
1624
|
+
try {
|
|
1625
|
+
let r = e.importResourceWithExtension(R(O));
|
|
1626
|
+
if (r) {
|
|
1627
|
+
let e = _o.local().toFormat("yyyyMMddHHmmss"), i = `${R(O).name}_${e}.${r}`;
|
|
1628
|
+
if (!(yield l.webdav.copyFiles(R(A), R(O), R(A), { path: i }, { signal: n }))) throw Error(t("Importing failed"));
|
|
1629
|
+
O.value = { path: i };
|
|
1630
|
+
}
|
|
1631
|
+
if (Ce(ve, R(O))) return;
|
|
1632
|
+
if (ae.value = ![D.Updateable, D.FileUpdateable].some((e) => (R(O).permissions || "").indexOf(e) > -1), R(fe("currentContent"))) {
|
|
1633
|
+
let t = yield* Qa(ye(ve, {
|
|
1634
|
+
...e.fileContentOptions,
|
|
1635
|
+
signal: n
|
|
1636
|
+
}));
|
|
1637
|
+
M.value = N.value = t.body, ne.value = t.headers["OC-ETag"];
|
|
1638
|
+
}
|
|
1639
|
+
R(fe("url")) && (re.value = yield xe(R(A), R(O), {
|
|
1640
|
+
...e.urlForResourceOptions,
|
|
1641
|
+
signal: n
|
|
1642
|
+
}));
|
|
1643
|
+
} catch (e) {
|
|
1644
|
+
console.error(e), ie.value = e;
|
|
1645
|
+
} finally {
|
|
1646
|
+
j.value = !1;
|
|
1647
|
+
}
|
|
1648
|
+
}).restartable();
|
|
1649
|
+
P(ve, async () => {
|
|
1650
|
+
R(E) ? A.value = R(R(ve).space) : (await Re.perform(), R(ke) && fc(R(O).size) > R(ke) ? m({
|
|
1651
|
+
title: t("File exceeds %{threshold}", { threshold: We(R(ke), n) }),
|
|
1652
|
+
message: t("%{resource} exceeds the recommended size of %{threshold} for editing, and may cause performance issues.", {
|
|
1653
|
+
resource: R(O).name,
|
|
1654
|
+
threshold: We(R(ke), n)
|
|
1655
|
+
}),
|
|
1656
|
+
confirmText: t("Continue"),
|
|
1657
|
+
onCancel: () => {
|
|
1658
|
+
_e();
|
|
1659
|
+
},
|
|
1660
|
+
onConfirm: () => {
|
|
1661
|
+
ze.perform();
|
|
1662
|
+
}
|
|
1663
|
+
}) : ze.perform());
|
|
1664
|
+
}, { immediate: !0 });
|
|
1665
|
+
let Be = (e) => {
|
|
1666
|
+
console.error(e), o({
|
|
1667
|
+
title: t("An error occurred"),
|
|
1668
|
+
desc: e.message,
|
|
1669
|
+
errors: [e]
|
|
1670
|
+
});
|
|
1671
|
+
}, Ve = () => {
|
|
1672
|
+
a({ title: t("File autosaved") });
|
|
1673
|
+
}, He = go(function* () {
|
|
1674
|
+
let e = R(N);
|
|
1675
|
+
try {
|
|
1676
|
+
let t = yield Se(ve, {
|
|
1677
|
+
content: e,
|
|
1678
|
+
previousEntityTag: R(ne)
|
|
1679
|
+
});
|
|
1680
|
+
M.value = e, ne.value = t.etag, _.upsertResource(t);
|
|
1681
|
+
} catch (e) {
|
|
1682
|
+
switch (e.statusCode) {
|
|
1683
|
+
case 401:
|
|
1684
|
+
case 403:
|
|
1685
|
+
Be(new Ja(t("You're not authorized to save this file"), e.response));
|
|
1686
|
+
break;
|
|
1687
|
+
case 409:
|
|
1688
|
+
case 412:
|
|
1689
|
+
Be(new Ja(t("This file was updated outside this window. Please copy your changes or save the file under a new name (»Save As...«)."), e.response));
|
|
1690
|
+
break;
|
|
1691
|
+
case 507:
|
|
1692
|
+
let n = h.spaces.find((e) => e.id === R(O).storageId && so(e));
|
|
1693
|
+
if (n) {
|
|
1694
|
+
Be(new Ja(t("Insufficient quota on \"%{spaceName}\" to save this file", { spaceName: n.name }), e.response));
|
|
1695
|
+
break;
|
|
1696
|
+
}
|
|
1697
|
+
Be(new Ja(t("Insufficient quota for saving this file"), e.response));
|
|
1698
|
+
break;
|
|
1699
|
+
default: Be(new Ja("", e.response));
|
|
1700
|
+
}
|
|
1701
|
+
}
|
|
1702
|
+
}).drop(), Ue = async () => {
|
|
1703
|
+
await He.perform();
|
|
1704
|
+
}, Ge = null;
|
|
1705
|
+
Vt(() => {
|
|
1706
|
+
if (oe = y.subscribe("runtime.resource.deleted", Xe), _.ancestorMetaData?.["/"] && R(A) && _.ancestorMetaData["/"].spaceId !== R(A).id && _.setAncestorMetaData({}), !R(de)) return;
|
|
1707
|
+
let t = g.options.editor;
|
|
1708
|
+
t.autosaveEnabled && !e.disableAutoSave && (Ge = setInterval(async () => {
|
|
1709
|
+
me.value && (await Ue(), Ve());
|
|
1710
|
+
}, (t.autosaveInterval || 120) * 1e3));
|
|
1711
|
+
}), ja(() => {
|
|
1712
|
+
y.unsubscribe("runtime.resource.deleted", oe), le([gc]), u.isLoading || window.removeEventListener("beforeunload", he), R(fe("url")) && we(re.value), R(de) && (clearInterval(Ge), Ge = null);
|
|
1713
|
+
});
|
|
1714
|
+
let { bindKeyAction: Ke } = Ln({ skipDisabledKeyBindingsCheck: !0 });
|
|
1715
|
+
Ke({
|
|
1716
|
+
modifier: kr.Ctrl,
|
|
1717
|
+
primary: Ir.S
|
|
1718
|
+
}, () => {
|
|
1719
|
+
R(me) && Ue();
|
|
1720
|
+
});
|
|
1721
|
+
let qe = q(() => [{
|
|
1722
|
+
name: "save-file",
|
|
1723
|
+
disabledTooltip: () => "",
|
|
1724
|
+
isVisible: () => R(de) && !R(ae),
|
|
1725
|
+
isDisabled: () => !R(me),
|
|
1726
|
+
icon: "save",
|
|
1727
|
+
id: "app-save-action",
|
|
1728
|
+
label: () => t("Save"),
|
|
1729
|
+
handler: Ue
|
|
1730
|
+
}]), Je = q(() => ({
|
|
1731
|
+
space: R(A),
|
|
1732
|
+
resources: [R(O)]
|
|
1733
|
+
})), F = async (e, t) => {
|
|
1734
|
+
R(me) && (await Ue(), Ve()), t(e);
|
|
1735
|
+
}, Xe = (e) => {
|
|
1736
|
+
if (e.find((e) => e.id === R(O).id)) {
|
|
1737
|
+
if (se) return se();
|
|
1738
|
+
_e();
|
|
1739
|
+
}
|
|
1740
|
+
}, Ze = q(() => [
|
|
1741
|
+
...R(S),
|
|
1742
|
+
...R(qe),
|
|
1743
|
+
...R(ue).map((e) => ({
|
|
1744
|
+
...e,
|
|
1745
|
+
isVisible: (t) => de.value && e.isVisible(t)
|
|
1746
|
+
}))
|
|
1747
|
+
].filter((e) => e.isVisible(R(Je)))), Qe = q(() => [...R(T), ...R(C)].filter((e) => e.isVisible(R(Je)))), $e = q(() => [...R(ee).map((e) => ({
|
|
1748
|
+
...e,
|
|
1749
|
+
handler: (t) => F(t, e.handler)
|
|
1750
|
+
})), ...R(te)].filter((e) => e.isVisible(R(Je)))), et = q(() => [...R(w)].filter((e) => e.isVisible(R(Je)))), tt = q(() => {
|
|
1751
|
+
let e = [];
|
|
1752
|
+
return R(Ze).length && e.push({
|
|
1753
|
+
name: "context",
|
|
1754
|
+
items: R(Ze)
|
|
1755
|
+
}), R(Qe).length && e.push({
|
|
1756
|
+
name: "share",
|
|
1757
|
+
items: R(Qe)
|
|
1758
|
+
}), R($e).length && e.push({
|
|
1759
|
+
name: "actions",
|
|
1760
|
+
items: R($e)
|
|
1761
|
+
}), R(et).length && e.push({
|
|
1762
|
+
name: "sidebar",
|
|
1763
|
+
items: R(et)
|
|
1764
|
+
}), e;
|
|
1765
|
+
}), nt = q(() => [...R(qe)]);
|
|
1766
|
+
So((e, n, r) => {
|
|
1767
|
+
R(me) ? m({
|
|
1768
|
+
title: t("Unsaved changes"),
|
|
1769
|
+
customComponent: nc,
|
|
1770
|
+
focusTrapInitial: ".oc-modal-body-actions-confirm",
|
|
1771
|
+
hideActions: !0,
|
|
1772
|
+
hideCancelButton: !0,
|
|
1773
|
+
customComponentAttrs: () => ({ closeCallback: () => {
|
|
1774
|
+
le([gc]), r();
|
|
1775
|
+
} }),
|
|
1776
|
+
async onConfirm() {
|
|
1777
|
+
le([gc]), await Ue(), r();
|
|
1778
|
+
}
|
|
1779
|
+
}) : (le([gc]), r());
|
|
1780
|
+
});
|
|
1781
|
+
let rt = q(() => ({
|
|
1782
|
+
url: R(re),
|
|
1783
|
+
space: R(R(ve).space),
|
|
1784
|
+
resource: R(O),
|
|
1785
|
+
activeFiles: R(Te),
|
|
1786
|
+
isDirty: R(me),
|
|
1787
|
+
isReadOnly: R(ae),
|
|
1788
|
+
applicationConfig: R(ge),
|
|
1789
|
+
currentFileContext: R(ve),
|
|
1790
|
+
currentContent: R(N),
|
|
1791
|
+
isFolderLoading: R(De),
|
|
1792
|
+
"onUpdate:resource": (e) => {
|
|
1793
|
+
A.value = R(R(ve).space), O.value = {
|
|
1794
|
+
...e,
|
|
1795
|
+
...uo(R(A)) && { remoteItemId: R(A).id }
|
|
1796
|
+
}, p.value = [R(O)];
|
|
1797
|
+
},
|
|
1798
|
+
"onUpdate:currentContent": (e) => {
|
|
1799
|
+
N.value = e;
|
|
1800
|
+
},
|
|
1801
|
+
"onRegister:onDeleteResourceCallback": (e) => {
|
|
1802
|
+
se = e;
|
|
1803
|
+
},
|
|
1804
|
+
"onDelete:resource": () => {
|
|
1805
|
+
R(te)[0].isVisible({
|
|
1806
|
+
space: R(A),
|
|
1807
|
+
resources: [R(O)]
|
|
1808
|
+
}) && R(te)[0].handler({
|
|
1809
|
+
space: R(A),
|
|
1810
|
+
resources: [R(O)]
|
|
1811
|
+
});
|
|
1812
|
+
},
|
|
1813
|
+
onSave: Ue,
|
|
1814
|
+
onClose: _e,
|
|
1815
|
+
loadFolderForFileContext: Ee,
|
|
1816
|
+
revokeUrl: we,
|
|
1817
|
+
getUrlForResource: xe
|
|
1818
|
+
}));
|
|
1819
|
+
return (t, n) => (Z(), X("main", {
|
|
1820
|
+
id: e.applicationId,
|
|
1821
|
+
class: "app-wrapper h-full border-0",
|
|
1822
|
+
onKeydown: n[0] ||= xi((...e) => R(_e) && R(_e)(...e), ["esc"])
|
|
1823
|
+
}, [Y("h1", {
|
|
1824
|
+
class: "sr-only",
|
|
1825
|
+
textContent: G(Ae.value)
|
|
1826
|
+
}, null, 8, mc), j.value ? (Z(), H(ks, { key: 0 })) : ie.value ? (Z(), H(ws, {
|
|
1827
|
+
key: 1,
|
|
1828
|
+
message: ie.value.message
|
|
1829
|
+
}, null, 8, ["message"])) : (Z(), X("div", hc, [k(t.$slots, "default", va({ class: ["app-wrapper-content size-full", { "w-[calc(100%-360px)]": R(x) && !R(b) }] }, rt.value)), J(Gs, { space: A.value }, null, 8, ["space"])]))], 40, pc));
|
|
1830
|
+
}
|
|
1831
|
+
});
|
|
1832
|
+
//#endregion
|
|
1833
|
+
//#region src/components/AppTemplates/AppWrapperRoute.ts
|
|
1834
|
+
function vc(e, t) {
|
|
1835
|
+
return U({ render() {
|
|
1836
|
+
return Ar(_c, {
|
|
1837
|
+
wrappedComponent: e,
|
|
1838
|
+
...t
|
|
1839
|
+
}, { default: (t) => Ar(e, t) });
|
|
1840
|
+
} });
|
|
1841
|
+
}
|
|
1842
|
+
//#endregion
|
|
1843
|
+
//#region src/components/ContextActions/ContextMenuQuickAction.vue
|
|
1844
|
+
var yc = /* @__PURE__ */ U({
|
|
1845
|
+
__name: "ContextMenuQuickAction",
|
|
1846
|
+
props: {
|
|
1847
|
+
item: {},
|
|
1848
|
+
resourceDomSelector: {
|
|
1849
|
+
type: Function,
|
|
1850
|
+
default: (e) => $a(e.id)
|
|
1851
|
+
},
|
|
1852
|
+
title: { default: "" }
|
|
1853
|
+
},
|
|
1854
|
+
emits: ["quickActionClicked"],
|
|
1855
|
+
setup(e, { expose: t }) {
|
|
1856
|
+
let { $gettext: n } = Q(), r = de("drop");
|
|
1857
|
+
t({ drop: r });
|
|
1858
|
+
let i = q(() => n("Show context menu"));
|
|
1859
|
+
return (t, n) => {
|
|
1860
|
+
let a = I("oc-icon"), o = I("oc-button"), s = ti("oc-tooltip");
|
|
1861
|
+
return Z(), X(W, null, [L((Z(), H(o, {
|
|
1862
|
+
id: `context-menu-trigger-${e.resourceDomSelector(e.item)}`,
|
|
1863
|
+
"data-test-context-menu-resource-name": e.item.name,
|
|
1864
|
+
"aria-label": i.value,
|
|
1865
|
+
appearance: "raw",
|
|
1866
|
+
class: V(["quick-action-button ml-1 p-1", t.$attrs.class]),
|
|
1867
|
+
onClick: n[0] ||= (e) => t.$emit("quickActionClicked", e)
|
|
1868
|
+
}, {
|
|
1869
|
+
default: F(() => [J(a, { name: "more-2" })]),
|
|
1870
|
+
_: 1
|
|
1871
|
+
}, 8, [
|
|
1872
|
+
"id",
|
|
1873
|
+
"data-test-context-menu-resource-name",
|
|
1874
|
+
"aria-label",
|
|
1875
|
+
"class"
|
|
1876
|
+
])), [[s, i.value]]), J(R(si), {
|
|
1877
|
+
ref_key: "drop",
|
|
1878
|
+
ref: r,
|
|
1879
|
+
"drop-id": `context-menu-drop-${e.resourceDomSelector(e.item)}`,
|
|
1880
|
+
toggle: `#context-menu-trigger-${e.resourceDomSelector(e.item)}`,
|
|
1881
|
+
title: e.title,
|
|
1882
|
+
position: "left-start",
|
|
1883
|
+
mode: "manual",
|
|
1884
|
+
"padding-size": "small",
|
|
1885
|
+
"close-on-click": ""
|
|
1886
|
+
}, {
|
|
1887
|
+
default: F(() => [k(t.$slots, "contextMenu", { item: e.item })]),
|
|
1888
|
+
_: 3
|
|
1889
|
+
}, 8, [
|
|
1890
|
+
"drop-id",
|
|
1891
|
+
"toggle",
|
|
1892
|
+
"title"
|
|
1893
|
+
])], 64);
|
|
1894
|
+
};
|
|
1895
|
+
}
|
|
1896
|
+
}), bc = U({
|
|
1897
|
+
name: "ResourceGhostElement",
|
|
1898
|
+
components: { ResourceIcon: nn },
|
|
1899
|
+
props: { previewItems: {
|
|
1900
|
+
type: Array,
|
|
1901
|
+
required: !0
|
|
1902
|
+
} },
|
|
1903
|
+
computed: {
|
|
1904
|
+
layerCount() {
|
|
1905
|
+
return Math.min(this.previewItems.length, 3);
|
|
1906
|
+
},
|
|
1907
|
+
showSecondLayer() {
|
|
1908
|
+
return this.layerCount > 1;
|
|
1909
|
+
},
|
|
1910
|
+
showThirdLayer() {
|
|
1911
|
+
return this.layerCount > 2;
|
|
1912
|
+
},
|
|
1913
|
+
itemCount() {
|
|
1914
|
+
return this.previewItems.length;
|
|
1915
|
+
}
|
|
1916
|
+
}
|
|
1917
|
+
}), xc = {
|
|
1918
|
+
id: "ghost-element",
|
|
1919
|
+
class: "z-[var(--z-index-modal)] absolute pt-1 pl-4 bg-transparent"
|
|
1920
|
+
}, Sc = { class: "relative rounded-sm bg-role-surface-container-high" }, Cc = {
|
|
1921
|
+
key: 0,
|
|
1922
|
+
class: "-z-10 absolute top-[3px] left-[3px] right-[-3px] bottom-[-3px] rounded-sm bg-role-surface-container-high brightness-82"
|
|
1923
|
+
}, wc = {
|
|
1924
|
+
key: 1,
|
|
1925
|
+
class: "-z-20 absolute top-[6px] left-[6px] right-[-6px] bottom-[-6px] rounded-sm bg-role-surface-container-high brightness-72"
|
|
1926
|
+
}, Tc = { class: "badge absolute top-[-2px] right-[-8px] p-1 text-sm text-center leading-2 bg-red-600 text-white rounded-4xl box-content min-w-2 h-2" };
|
|
1927
|
+
function Ec(e, t, n, r, i, a) {
|
|
1928
|
+
let o = I("resource-icon");
|
|
1929
|
+
return Z(), X("div", xc, [Y("div", Sc, [
|
|
1930
|
+
J(o, {
|
|
1931
|
+
class: "p-1",
|
|
1932
|
+
resource: e.previewItems[0]
|
|
1933
|
+
}, null, 8, ["resource"]),
|
|
1934
|
+
e.showSecondLayer ? (Z(), X("div", Cc)) : K("", !0),
|
|
1935
|
+
e.showThirdLayer ? (Z(), X("div", wc)) : K("", !0)
|
|
1936
|
+
]), Y("span", Tc, G(e.itemCount), 1)]);
|
|
1937
|
+
}
|
|
1938
|
+
var Dc = /* @__PURE__ */ B(bc, [["render", Ec]]), Oc = U({
|
|
1939
|
+
name: "ResourceSize",
|
|
1940
|
+
props: { size: {
|
|
1941
|
+
type: [String, Number],
|
|
1942
|
+
required: !0
|
|
1943
|
+
} },
|
|
1944
|
+
setup: (e) => {
|
|
1945
|
+
let { current: t } = Q();
|
|
1946
|
+
return { formattedSize: q(() => We(e.size, t)) };
|
|
1947
|
+
}
|
|
1948
|
+
}), kc = ["textContent"];
|
|
1949
|
+
function Ac(e, t, n, r, i, a) {
|
|
1950
|
+
return Z(), X("span", { textContent: G(e.formattedSize) }, null, 8, kc);
|
|
1951
|
+
}
|
|
1952
|
+
var jc = /* @__PURE__ */ B(Oc, [["render", Ac]]), Mc = /* @__PURE__ */ U({
|
|
1953
|
+
__name: "ResourceStatusIndicators",
|
|
1954
|
+
props: {
|
|
1955
|
+
resource: {},
|
|
1956
|
+
space: { default: () => void 0 },
|
|
1957
|
+
filter: {
|
|
1958
|
+
type: Function,
|
|
1959
|
+
default: void 0
|
|
1960
|
+
}
|
|
1961
|
+
},
|
|
1962
|
+
setup(e) {
|
|
1963
|
+
let t = lt(), { getIndicators: n } = or(), r = q(() => {
|
|
1964
|
+
let t = n({
|
|
1965
|
+
space: e.space,
|
|
1966
|
+
resource: e.resource
|
|
1967
|
+
});
|
|
1968
|
+
return e.filter ? t.filter(e.filter) : t;
|
|
1969
|
+
});
|
|
1970
|
+
return (n, i) => r.value.length > 0 ? (Z(), H(R(Wn), va({ key: 0 }, R(t), {
|
|
1971
|
+
indicators: r.value,
|
|
1972
|
+
resource: e.resource
|
|
1973
|
+
}), null, 16, ["indicators", "resource"])) : K("", !0);
|
|
1974
|
+
}
|
|
1975
|
+
}), Nc = /* @__PURE__ */ U({
|
|
1976
|
+
__name: "UserAvatar",
|
|
1977
|
+
props: {
|
|
1978
|
+
userId: {},
|
|
1979
|
+
userName: {},
|
|
1980
|
+
width: { default: 36 }
|
|
1981
|
+
},
|
|
1982
|
+
setup(e) {
|
|
1983
|
+
let { avatarMap: t } = $(Ui()), { enqueueAvatar: n } = ta(), r = q(() => R(t)[e.userId]);
|
|
1984
|
+
return Vt(() => {
|
|
1985
|
+
n(e.userId);
|
|
1986
|
+
}), (t, n) => {
|
|
1987
|
+
let i = I("oc-avatar");
|
|
1988
|
+
return Z(), H(i, {
|
|
1989
|
+
"user-name": e.userName,
|
|
1990
|
+
src: r.value,
|
|
1991
|
+
width: e.width
|
|
1992
|
+
}, null, 8, [
|
|
1993
|
+
"user-name",
|
|
1994
|
+
"src",
|
|
1995
|
+
"width"
|
|
1996
|
+
]);
|
|
1997
|
+
};
|
|
1998
|
+
}
|
|
1999
|
+
}), Pc = { class: /* @__PURE__ */ V([
|
|
2000
|
+
"[&_.cropper-crop-box]:!outline-1",
|
|
2001
|
+
"[&_.cropper-crop-box]:!outline-role-outline",
|
|
2002
|
+
"[&_.cropper-view-box]:!rounded-[50%]",
|
|
2003
|
+
"[&_.cropper-crop-box]:!rounded-[50%]",
|
|
2004
|
+
"[&_.cropper-line]:!bg-role-outline",
|
|
2005
|
+
"[&_.cropper-point]:!bg-role-outline"
|
|
2006
|
+
]) }, Fc = { class: "flex flex-col items-center" }, Ic = { class: "oc-button-group" }, Lc = { key: 0 }, Rc = ["src"], zc = { class: "text-sm text-role-on-surface-variant flex items-center mt-1" }, Bc = ["textContent"], Vc = /* @__PURE__ */ U({
|
|
2007
|
+
__name: "AvatarUpload",
|
|
2008
|
+
setup(e) {
|
|
2009
|
+
let t = Qn(), n = Ui(), { avatarMap: r } = $(n), { user: i } = $(t), { $gettext: a } = Q(), { showErrorMessage: o, showMessage: s } = Me(), { graphAuthenticated: c } = en(), { setCropperInstance: l } = Ni(), u = z(null), d = z(null), f = z(null), p = z(!1), m = z(!1), h = z(!1), g = z(null), _ = q(() => !!R(r)[R(i).id]), v = (e) => {
|
|
2010
|
+
let t = e.target.files?.[0];
|
|
2011
|
+
if (t) {
|
|
2012
|
+
if (t.size > 10485760) {
|
|
2013
|
+
o({ title: a("File size exceeds the limit of %{size}MB", { size: "10" }) });
|
|
2014
|
+
return;
|
|
2015
|
+
}
|
|
2016
|
+
u.value = URL.createObjectURL(t), m.value = !0;
|
|
2017
|
+
}
|
|
2018
|
+
};
|
|
2019
|
+
P(u, async (e) => {
|
|
2020
|
+
e && (await Ra(), f.value && f.value.destroy(), d.value && (f.value = new xo(d.value, {
|
|
2021
|
+
aspectRatio: 1,
|
|
2022
|
+
viewMode: 1,
|
|
2023
|
+
dragMode: "move",
|
|
2024
|
+
autoCropArea: .8,
|
|
2025
|
+
responsive: !0,
|
|
2026
|
+
background: !1,
|
|
2027
|
+
ready() {
|
|
2028
|
+
p.value = !0;
|
|
2029
|
+
}
|
|
2030
|
+
}), l(f)));
|
|
2031
|
+
});
|
|
2032
|
+
let y = () => f.value.getCroppedCanvas({
|
|
2033
|
+
width: 256,
|
|
2034
|
+
height: 256,
|
|
2035
|
+
imageSmoothingQuality: "high"
|
|
2036
|
+
}), b = async (e) => await new Promise((t) => {
|
|
2037
|
+
e.toBlob((e) => t(e), "image/png");
|
|
2038
|
+
}), x = () => {
|
|
2039
|
+
g.value?.click();
|
|
2040
|
+
}, S = () => {
|
|
2041
|
+
m.value = !1, w();
|
|
2042
|
+
}, C = async () => {
|
|
2043
|
+
let e = await b(y()), t = URL.createObjectURL(e), r = new File([e], "avatar.png", {
|
|
2044
|
+
type: "image/png",
|
|
2045
|
+
lastModified: Date.now()
|
|
2046
|
+
});
|
|
2047
|
+
try {
|
|
2048
|
+
await c.photos.updateOwnUserPhotoPatch(r), n.addAvatar(R(i).id, t), s({ title: a("Profile picture was set successfully") });
|
|
2049
|
+
} catch (e) {
|
|
2050
|
+
o({
|
|
2051
|
+
title: a("Failed to set profile picture"),
|
|
2052
|
+
errors: [e]
|
|
2053
|
+
});
|
|
2054
|
+
}
|
|
2055
|
+
m.value = !1, w();
|
|
2056
|
+
}, ee = async () => {
|
|
2057
|
+
try {
|
|
2058
|
+
await c.photos.deleteOwnUserPhoto(), n.removeAvatar(R(i).id), s({ title: a("Profile picture was removed successfully") });
|
|
2059
|
+
} catch (e) {
|
|
2060
|
+
o({
|
|
2061
|
+
title: a("Failed to remove profile picture"),
|
|
2062
|
+
errors: [e]
|
|
2063
|
+
});
|
|
2064
|
+
}
|
|
2065
|
+
h.value = !1;
|
|
2066
|
+
}, w = () => {
|
|
2067
|
+
f.value?.destroy(), f.value = null, g.value && (g.value.value = ""), u.value = null;
|
|
2068
|
+
};
|
|
2069
|
+
return (e, t) => {
|
|
2070
|
+
let n = I("oc-button"), r = I("oc-icon"), o = I("oc-modal");
|
|
2071
|
+
return Z(), X("div", Pc, [
|
|
2072
|
+
Y("input", {
|
|
2073
|
+
ref_key: "fileInputRef",
|
|
2074
|
+
ref: g,
|
|
2075
|
+
class: "invisible avatar-file-input",
|
|
2076
|
+
type: "file",
|
|
2077
|
+
accept: "image/jpeg, image/png",
|
|
2078
|
+
onChange: v
|
|
2079
|
+
}, null, 544),
|
|
2080
|
+
Y("div", Fc, [J(Nc, {
|
|
2081
|
+
class: "mb-4",
|
|
2082
|
+
width: 128,
|
|
2083
|
+
"user-id": R(i).id,
|
|
2084
|
+
"user-name": R(i).displayName
|
|
2085
|
+
}, null, 8, ["user-id", "user-name"]), Y("div", null, [Y("div", Ic, [J(n, {
|
|
2086
|
+
size: "small",
|
|
2087
|
+
onClick: x
|
|
2088
|
+
}, {
|
|
2089
|
+
default: F(() => [Cr(G(R(a)("Upload")), 1)]),
|
|
2090
|
+
_: 1
|
|
2091
|
+
}), _.value ? (Z(), H(n, {
|
|
2092
|
+
key: 0,
|
|
2093
|
+
class: "avatar-upload-remove-button",
|
|
2094
|
+
size: "small",
|
|
2095
|
+
onClick: t[0] ||= (e) => h.value = !0
|
|
2096
|
+
}, {
|
|
2097
|
+
default: F(() => [Cr(G(R(a)("Remove")), 1)]),
|
|
2098
|
+
_: 1
|
|
2099
|
+
})) : K("", !0)])])]),
|
|
2100
|
+
m.value ? (Z(), H(o, {
|
|
2101
|
+
key: 0,
|
|
2102
|
+
title: R(a)("Crop your new profile picture"),
|
|
2103
|
+
"button-cancel-text": R(a)("Cancel"),
|
|
2104
|
+
"button-confirm-text": R(a)("Set"),
|
|
2105
|
+
"button-confirm-disabled": !p.value,
|
|
2106
|
+
"focus-trap-initial": !1,
|
|
2107
|
+
onCancel: S,
|
|
2108
|
+
onConfirm: C
|
|
2109
|
+
}, {
|
|
2110
|
+
content: F(() => [u.value ? (Z(), X("div", Lc, [Y("img", {
|
|
2111
|
+
ref_key: "imageRef",
|
|
2112
|
+
ref: d,
|
|
2113
|
+
class: "max-h-[400px]",
|
|
2114
|
+
src: u.value
|
|
2115
|
+
}, null, 8, Rc), Y("div", zc, [J(r, {
|
|
2116
|
+
class: "mr-1",
|
|
2117
|
+
name: "information",
|
|
2118
|
+
size: "small",
|
|
2119
|
+
"fill-type": "line"
|
|
2120
|
+
}), Y("span", { textContent: G(R(a)("Zoom via %{ zoomKeys }, pan via %{ panKeys }", {
|
|
2121
|
+
zoomKeys: R(a)("+-"),
|
|
2122
|
+
panKeys: R(a)("↑↓←→")
|
|
2123
|
+
})) }, null, 8, Bc)])])) : K("", !0)]),
|
|
2124
|
+
_: 1
|
|
2125
|
+
}, 8, [
|
|
2126
|
+
"title",
|
|
2127
|
+
"button-cancel-text",
|
|
2128
|
+
"button-confirm-text",
|
|
2129
|
+
"button-confirm-disabled"
|
|
2130
|
+
])) : K("", !0),
|
|
2131
|
+
h.value ? (Z(), H(o, {
|
|
2132
|
+
key: 1,
|
|
2133
|
+
message: R(a)("Are you sure you want to remove your profile picture?"),
|
|
2134
|
+
title: R(a)("Remove profile picture"),
|
|
2135
|
+
"button-cancel-text": R(a)("Cancel"),
|
|
2136
|
+
"button-confirm-text": R(a)("Remove"),
|
|
2137
|
+
onCancel: t[1] ||= (e) => h.value = !1,
|
|
2138
|
+
onConfirm: ee
|
|
2139
|
+
}, null, 8, [
|
|
2140
|
+
"message",
|
|
2141
|
+
"title",
|
|
2142
|
+
"button-cancel-text",
|
|
2143
|
+
"button-confirm-text"
|
|
2144
|
+
])) : K("", !0)
|
|
2145
|
+
]);
|
|
2146
|
+
};
|
|
2147
|
+
}
|
|
2148
|
+
}), Hc = { class: "resource-table-select-all flex justify-center items-center" }, Uc = { class: "truncate" }, Wc = ["textContent"], Gc = ["textContent"], Kc = ["textContent"], qc = {
|
|
2149
|
+
key: 0,
|
|
2150
|
+
class: "flex items-center justify-end flex-row flex-nowrap"
|
|
2151
|
+
}, Jc = 850, Yc = /* @__PURE__ */ U({
|
|
2152
|
+
__name: "ResourceTable",
|
|
2153
|
+
props: {
|
|
2154
|
+
resources: {},
|
|
2155
|
+
resourceDomSelector: {
|
|
2156
|
+
type: Function,
|
|
2157
|
+
default: (e) => $a(e.id)
|
|
2158
|
+
},
|
|
2159
|
+
arePathsDisplayed: {
|
|
2160
|
+
type: Boolean,
|
|
2161
|
+
default: !1
|
|
2162
|
+
},
|
|
2163
|
+
selectedIds: { default: () => [] },
|
|
2164
|
+
hasActions: {
|
|
2165
|
+
type: Boolean,
|
|
2166
|
+
default: !0
|
|
2167
|
+
},
|
|
2168
|
+
showRenameQuickAction: {
|
|
2169
|
+
type: Boolean,
|
|
2170
|
+
default: !0
|
|
2171
|
+
},
|
|
2172
|
+
areResourcesClickable: {
|
|
2173
|
+
type: Boolean,
|
|
2174
|
+
default: !0
|
|
2175
|
+
},
|
|
2176
|
+
headerPosition: { default: 0 },
|
|
2177
|
+
isSelectable: {
|
|
2178
|
+
type: Boolean,
|
|
2179
|
+
default: !0
|
|
2180
|
+
},
|
|
2181
|
+
dragDrop: {
|
|
2182
|
+
type: Boolean,
|
|
2183
|
+
default: !1
|
|
2184
|
+
},
|
|
2185
|
+
viewMode: { default: () => ma.defaultModeName },
|
|
2186
|
+
hover: {
|
|
2187
|
+
type: Boolean,
|
|
2188
|
+
default: !0
|
|
2189
|
+
},
|
|
2190
|
+
sortBy: { default: () => void 0 },
|
|
2191
|
+
fieldsDisplayed: { default: () => void 0 },
|
|
2192
|
+
sortDir: { default: () => void 0 },
|
|
2193
|
+
space: { default: () => void 0 },
|
|
2194
|
+
resourceType: { default: "file" },
|
|
2195
|
+
lazy: {
|
|
2196
|
+
type: Boolean,
|
|
2197
|
+
default: !0
|
|
2198
|
+
}
|
|
2199
|
+
},
|
|
2200
|
+
emits: [
|
|
2201
|
+
"fileClick",
|
|
2202
|
+
"sort",
|
|
2203
|
+
"fileDropped",
|
|
2204
|
+
"update:selectedIds",
|
|
2205
|
+
"update:modelValue"
|
|
2206
|
+
],
|
|
2207
|
+
setup(e, { emit: t }) {
|
|
2208
|
+
let n = t, r = ji(), i = vi(), { getMatchingSpace: a } = O(), { interceptModifierClick: o } = pi(), { getParentFolderLink: s, getParentFolderLinkIconAdditionalAttributes: c, getParentFolderName: l, getPathPrefix: d } = Ba({ space: z(e.space) }), { isSticky: f } = ft(), { $gettext: p, $ngettext: m, current: h } = Q(), { isLocationPicker: g, isFilePicker: _ } = ci(), { selectedResources: v, disabledResources: b, isResourceSelected: x, fileContainerClicked: S, fileNameClicked: C, fileCheckboxClicked: ee, isResourceDisabled: w, isResourceInDeleteQueue: T, isResourceClickable: te, isResourceCut: E, getResourceLink: D, dragItem: A, dragSelection: ne, dragStart: re, fileDropped: j, setDropStyling: ie, shouldShowContextDrop: ae, showContextMenuOnRightClick: N, showContextMenuOnBtnClick: oe, selectAllCheckboxLabel: se, getResourceCheckboxLabel: ce, toggleSelectionAll: le, areAllResourcesSelected: ue } = Yi({
|
|
2209
|
+
space: q(() => e.space),
|
|
2210
|
+
resources: q(() => e.resources),
|
|
2211
|
+
selectedIds: q(() => e.selectedIds),
|
|
2212
|
+
emit: n
|
|
2213
|
+
}), de = Oi(), { isSideBarOpen: fe } = $(de), { userContextReady: pe } = $(Ti()), { areFileExtensionsShown: me, latestSelectedId: he } = $(dr()), { width: ge } = yo(), _e = q(() => i.filesTags && ge.value >= Jc), { actions: ve } = Mr(), { actions: ye } = xe(), be = q(() => R(ve)[0].handler), Se = q(() => R(ye)[0].handler), Ce = z({}), we = (e) => p("Search for tag %{tag}", { tag: e }), Te = q(() => {
|
|
2214
|
+
if (e.resources.length === 0) return [];
|
|
2215
|
+
let t = e.resources[0], n = [];
|
|
2216
|
+
e.isSelectable && n.push({
|
|
2217
|
+
name: "select",
|
|
2218
|
+
title: "",
|
|
2219
|
+
type: "slot",
|
|
2220
|
+
headerType: "slot",
|
|
2221
|
+
width: "shrink"
|
|
2222
|
+
});
|
|
2223
|
+
let r = Ie(t);
|
|
2224
|
+
return n.push(...[
|
|
2225
|
+
{
|
|
2226
|
+
name: "name",
|
|
2227
|
+
title: p("Name"),
|
|
2228
|
+
type: "slot",
|
|
2229
|
+
width: "expand",
|
|
2230
|
+
wrap: "truncate"
|
|
2231
|
+
},
|
|
2232
|
+
{
|
|
2233
|
+
name: "manager",
|
|
2234
|
+
prop: "members",
|
|
2235
|
+
title: p("Manager"),
|
|
2236
|
+
type: "slot"
|
|
2237
|
+
},
|
|
2238
|
+
{
|
|
2239
|
+
name: "members",
|
|
2240
|
+
title: p("Members"),
|
|
2241
|
+
prop: "members",
|
|
2242
|
+
type: "slot"
|
|
2243
|
+
},
|
|
2244
|
+
{
|
|
2245
|
+
name: "totalQuota",
|
|
2246
|
+
prop: "spaceQuota.total",
|
|
2247
|
+
title: p("Total quota"),
|
|
2248
|
+
type: "slot",
|
|
2249
|
+
sortable: !0
|
|
2250
|
+
},
|
|
2251
|
+
{
|
|
2252
|
+
name: "usedQuota",
|
|
2253
|
+
prop: "spaceQuota.used",
|
|
2254
|
+
title: p("Used quota"),
|
|
2255
|
+
type: "slot",
|
|
2256
|
+
sortable: !0
|
|
2257
|
+
},
|
|
2258
|
+
{
|
|
2259
|
+
name: "remainingQuota",
|
|
2260
|
+
prop: "spaceQuota.remaining",
|
|
2261
|
+
title: p("Remaining quota"),
|
|
2262
|
+
type: "slot",
|
|
2263
|
+
sortable: !0
|
|
2264
|
+
},
|
|
2265
|
+
{
|
|
2266
|
+
name: "indicators",
|
|
2267
|
+
title: p("Status"),
|
|
2268
|
+
type: "slot",
|
|
2269
|
+
alignH: "right",
|
|
2270
|
+
wrap: "nowrap",
|
|
2271
|
+
width: "shrink"
|
|
2272
|
+
},
|
|
2273
|
+
{
|
|
2274
|
+
name: "size",
|
|
2275
|
+
title: p("Size"),
|
|
2276
|
+
type: "slot",
|
|
2277
|
+
alignH: "right",
|
|
2278
|
+
wrap: "nowrap",
|
|
2279
|
+
width: "shrink"
|
|
2280
|
+
},
|
|
2281
|
+
{
|
|
2282
|
+
name: "syncEnabled",
|
|
2283
|
+
title: p("Info"),
|
|
2284
|
+
type: "slot",
|
|
2285
|
+
alignH: "right",
|
|
2286
|
+
wrap: "nowrap",
|
|
2287
|
+
width: "shrink"
|
|
2288
|
+
},
|
|
2289
|
+
{
|
|
2290
|
+
name: "tags",
|
|
2291
|
+
title: p("Tags"),
|
|
2292
|
+
type: "slot",
|
|
2293
|
+
alignH: "right",
|
|
2294
|
+
wrap: "nowrap",
|
|
2295
|
+
width: "shrink"
|
|
2296
|
+
},
|
|
2297
|
+
{
|
|
2298
|
+
name: "sharedBy",
|
|
2299
|
+
title: p("Shared by"),
|
|
2300
|
+
type: "slot",
|
|
2301
|
+
alignH: "right",
|
|
2302
|
+
wrap: "nowrap",
|
|
2303
|
+
width: "shrink"
|
|
2304
|
+
},
|
|
2305
|
+
{
|
|
2306
|
+
name: "sharedWith",
|
|
2307
|
+
title: p("Shared with"),
|
|
2308
|
+
type: "slot",
|
|
2309
|
+
alignH: "right",
|
|
2310
|
+
wrap: "nowrap",
|
|
2311
|
+
width: "shrink"
|
|
2312
|
+
},
|
|
2313
|
+
{
|
|
2314
|
+
name: "mdate",
|
|
2315
|
+
title: p("Modified"),
|
|
2316
|
+
type: "slot",
|
|
2317
|
+
alignH: "right",
|
|
2318
|
+
wrap: "nowrap",
|
|
2319
|
+
width: "shrink",
|
|
2320
|
+
accessibleLabelCallback: (e) => P(e.mdate) + " (" + je(e.mdate) + ")"
|
|
2321
|
+
},
|
|
2322
|
+
{
|
|
2323
|
+
name: "sdate",
|
|
2324
|
+
title: p("Shared on"),
|
|
2325
|
+
type: "slot",
|
|
2326
|
+
alignH: "right",
|
|
2327
|
+
wrap: "nowrap",
|
|
2328
|
+
width: "shrink",
|
|
2329
|
+
accessibleLabelCallback: (e) => P(e.sdate) + " (" + je(e.sdate) + ")"
|
|
2330
|
+
},
|
|
2331
|
+
{
|
|
2332
|
+
name: "ddate",
|
|
2333
|
+
title: p("Deleted"),
|
|
2334
|
+
type: "slot",
|
|
2335
|
+
alignH: "right",
|
|
2336
|
+
wrap: "nowrap",
|
|
2337
|
+
width: "shrink",
|
|
2338
|
+
accessibleLabelCallback: (e) => P(e.ddate) + " (" + je(e.ddate) + ")"
|
|
2339
|
+
}
|
|
2340
|
+
].filter((n) => {
|
|
2341
|
+
if (n.name === "tags" && !R(_e)) return !1;
|
|
2342
|
+
if (n.name === "indicators") return !0;
|
|
2343
|
+
let r;
|
|
2344
|
+
return r = n.prop ? Kt(t, n.prop) !== void 0 : Object.prototype.hasOwnProperty.call(t, n.name), e.fieldsDisplayed ? r && e.fieldsDisplayed.includes(n.name) : r;
|
|
2345
|
+
}).map((e) => {
|
|
2346
|
+
let t = r.find((t) => t.name === e.name);
|
|
2347
|
+
return t && Object.assign(e, {
|
|
2348
|
+
sortable: t.sortable,
|
|
2349
|
+
sortDir: t.sortDir
|
|
2350
|
+
}), e;
|
|
2351
|
+
})), e.hasActions && n.push({
|
|
2352
|
+
name: "actions",
|
|
2353
|
+
title: p("Actions"),
|
|
2354
|
+
type: "slot",
|
|
2355
|
+
alignH: "right",
|
|
2356
|
+
wrap: "nowrap",
|
|
2357
|
+
width: "shrink"
|
|
2358
|
+
}), n;
|
|
2359
|
+
}), Ee = (e) => {
|
|
2360
|
+
let t = R(r.currentRoute).query?.term;
|
|
2361
|
+
return Kr("files-common-search", { query: {
|
|
2362
|
+
provider: "files.sdk",
|
|
2363
|
+
q_tags: e,
|
|
2364
|
+
...t && { term: t }
|
|
2365
|
+
} });
|
|
2366
|
+
}, De = (e) => R(pe) ? { to: Ee(e) } : {}, Oe = (e) => e.id === R(he), ke = (t) => e.showRenameQuickAction ? so(t) ? R(ye).filter((e) => e.isVisible({ resources: [t] })).length : R(ve).filter((n) => n.isVisible({
|
|
2367
|
+
space: e.space,
|
|
2368
|
+
resources: [t]
|
|
2369
|
+
})).length : !1, Ae = (e) => {
|
|
2370
|
+
if (so(e)) return R(Se)({ resources: [e] });
|
|
2371
|
+
R(be)({
|
|
2372
|
+
space: a(e),
|
|
2373
|
+
resources: [e]
|
|
2374
|
+
});
|
|
2375
|
+
}, je = (e) => bn(new Date(e), h), P = (e) => ra(new Date(e), h), Me = (e) => {
|
|
2376
|
+
if (!lo(e)) return;
|
|
2377
|
+
let t = e.type === "folder" ? p("folder") : p("file"), n = e.sharedWith.filter(({ shareType: e }) => Ya.authenticated.includes(Ya.getByValue(e))).length;
|
|
2378
|
+
return n ? m("This %{ resourceType } is shared via %{ shareCount } invite", "This %{ resourceType } is shared via %{ shareCount } invites", n, {
|
|
2379
|
+
resourceType: t,
|
|
2380
|
+
shareCount: n.toString()
|
|
2381
|
+
}) : "";
|
|
2382
|
+
}, Ne = (e) => lo(e) ? p("This %{ resourceType } is shared by %{ user }", {
|
|
2383
|
+
resourceType: e.type === "folder" ? p("folder") : p("file"),
|
|
2384
|
+
user: e.sharedBy.map(({ displayName: e }) => e).join(", ")
|
|
2385
|
+
}) : "", Pe = (e) => lo(e) ? e.sharedBy.map((e) => ({
|
|
2386
|
+
displayName: e.displayName,
|
|
2387
|
+
name: e.displayName,
|
|
2388
|
+
avatarType: Ya.user.key,
|
|
2389
|
+
username: e.id,
|
|
2390
|
+
userId: e.id
|
|
2391
|
+
})) : [], Fe = (e) => lo(e) ? e.sharedWith.filter(({ shareType: e }) => Ya.authenticated.includes(Ya.getByValue(e))).map((e) => ({
|
|
2392
|
+
displayName: e.displayName,
|
|
2393
|
+
name: e.displayName,
|
|
2394
|
+
avatarType: Ya.getByValue(e.shareType).key,
|
|
2395
|
+
username: e.id,
|
|
2396
|
+
userId: e.id
|
|
2397
|
+
})) : [];
|
|
2398
|
+
return (t, n) => {
|
|
2399
|
+
let r = I("oc-checkbox"), i = I("oc-icon"), a = I("oc-tag"), m = I("oc-avatars"), h = ti("oc-tooltip");
|
|
2400
|
+
return Z(), X(W, null, [J(R(Hr), va(t.$attrs, {
|
|
2401
|
+
id: "files-space-table",
|
|
2402
|
+
class: [{
|
|
2403
|
+
condensed: e.viewMode === R(ma).name.condensedTable,
|
|
2404
|
+
"files-table": e.resourceType === "file",
|
|
2405
|
+
"files-table-squashed": e.resourceType === "file" && R(fe),
|
|
2406
|
+
"spaces-table": e.resourceType === "space",
|
|
2407
|
+
"spaces-table-squashed": e.resourceType === "space" && R(fe)
|
|
2408
|
+
}],
|
|
2409
|
+
data: e.resources,
|
|
2410
|
+
fields: Te.value,
|
|
2411
|
+
highlighted: e.selectedIds,
|
|
2412
|
+
disabled: R(b),
|
|
2413
|
+
sticky: R(f),
|
|
2414
|
+
"header-position": e.headerPosition,
|
|
2415
|
+
"drag-drop": e.dragDrop,
|
|
2416
|
+
hover: e.hover,
|
|
2417
|
+
"item-dom-selector": e.resourceDomSelector,
|
|
2418
|
+
selection: R(v),
|
|
2419
|
+
"sort-by": e.sortBy,
|
|
2420
|
+
"sort-dir": e.sortDir,
|
|
2421
|
+
lazy: e.lazy,
|
|
2422
|
+
"padding-x": "medium",
|
|
2423
|
+
onHighlight: n[1] ||= (e) => R(S)({
|
|
2424
|
+
resource: e[0],
|
|
2425
|
+
event: e[1]
|
|
2426
|
+
}),
|
|
2427
|
+
onContextmenuClicked: n[2] ||= (e, t, n) => R(N)(t, n, Ce.value[n.id]),
|
|
2428
|
+
onItemDropped: n[3] ||= (e) => R(j)(e[0], e[1]),
|
|
2429
|
+
onItemDragged: n[4] ||= (e) => R(re)(e[0], e[1]),
|
|
2430
|
+
onDropRowStyling: R(ie),
|
|
2431
|
+
onSort: n[5] ||= (e) => t.$emit("sort", e),
|
|
2432
|
+
"onUpdate:modelValue": n[6] ||= (e) => t.$emit("update:modelValue", e)
|
|
2433
|
+
}), ur({
|
|
2434
|
+
name: F(({ item: n }) => [Y("div", { class: V(["resource-table-resource-wrapper flex items-center", [{ "resource-table-resource-wrapper-limit-max-width": ke(n) }]]) }, [
|
|
2435
|
+
k(t.$slots, "image", { resource: n }),
|
|
2436
|
+
(Z(), H(y, {
|
|
2437
|
+
key: `${n.path}-${e.resourceDomSelector(n)}-${n.thumbnail}`,
|
|
2438
|
+
resource: n,
|
|
2439
|
+
"path-prefix": R(d)(n),
|
|
2440
|
+
"is-path-displayed": e.arePathsDisplayed,
|
|
2441
|
+
"parent-folder-name": R(l)(n),
|
|
2442
|
+
"is-icon-displayed": !t.$slots.image,
|
|
2443
|
+
"is-extension-displayed": R(me),
|
|
2444
|
+
"is-resource-clickable": R(te)(n, e.areResourcesClickable),
|
|
2445
|
+
link: R(D)(n),
|
|
2446
|
+
"parent-folder-link": R(s)(n),
|
|
2447
|
+
"parent-folder-link-icon-additional-attributes": R(c)(n),
|
|
2448
|
+
class: V({ "opacity-60": R(E)(n) }),
|
|
2449
|
+
onClick: Ki((e) => R(C)({
|
|
2450
|
+
resource: n,
|
|
2451
|
+
event: e
|
|
2452
|
+
}), ["stop"])
|
|
2453
|
+
}, null, 8, [
|
|
2454
|
+
"resource",
|
|
2455
|
+
"path-prefix",
|
|
2456
|
+
"is-path-displayed",
|
|
2457
|
+
"parent-folder-name",
|
|
2458
|
+
"is-icon-displayed",
|
|
2459
|
+
"is-extension-displayed",
|
|
2460
|
+
"is-resource-clickable",
|
|
2461
|
+
"link",
|
|
2462
|
+
"parent-folder-link",
|
|
2463
|
+
"parent-folder-link-icon-additional-attributes",
|
|
2464
|
+
"class",
|
|
2465
|
+
"onClick"
|
|
2466
|
+
])),
|
|
2467
|
+
ke(n) ? (Z(), H(R(lr), {
|
|
2468
|
+
key: 0,
|
|
2469
|
+
class: "resource-table-edit-name inline-flex raw-hover-surface p-1 ml-1",
|
|
2470
|
+
appearance: "raw",
|
|
2471
|
+
"aria-label": R(p)("Rename file »%{name}«", { name: n.name }),
|
|
2472
|
+
title: R(p)("Rename"),
|
|
2473
|
+
onClick: Ki((e) => {
|
|
2474
|
+
R(o)(e, n) || Ae(n);
|
|
2475
|
+
}, ["stop"])
|
|
2476
|
+
}, {
|
|
2477
|
+
default: F(() => [J(i, {
|
|
2478
|
+
name: "edit-2",
|
|
2479
|
+
"fill-type": "line",
|
|
2480
|
+
size: "small",
|
|
2481
|
+
color: "var(--oc-role-on-surface)"
|
|
2482
|
+
})]),
|
|
2483
|
+
_: 1
|
|
2484
|
+
}, 8, [
|
|
2485
|
+
"aria-label",
|
|
2486
|
+
"title",
|
|
2487
|
+
"onClick"
|
|
2488
|
+
])) : K("", !0)
|
|
2489
|
+
], 2), k(t.$slots, "additionalResourceContent", { resource: n })]),
|
|
2490
|
+
syncEnabled: F(({ item: e }) => [k(t.$slots, "syncEnabled", { resource: e })]),
|
|
2491
|
+
size: F(({ item: e }) => [J(jc, { size: e.size || NaN }, null, 8, ["size"])]),
|
|
2492
|
+
tags: F(({ item: e }) => [(Z(!0), X(W, null, M(e.tags.slice(0, 2), (e) => (Z(), H(u(R(pe) ? "router-link" : "span"), va({ key: e }, { ref_for: !0 }, De(e), { class: "resource-table-tag-wrapper" }), {
|
|
2493
|
+
default: F(() => [L((Z(), H(a, {
|
|
2494
|
+
class: "resource-table-tag ml-1 max-w-20",
|
|
2495
|
+
rounded: !0,
|
|
2496
|
+
size: "small"
|
|
2497
|
+
}, {
|
|
2498
|
+
default: F(() => [J(i, {
|
|
2499
|
+
name: "price-tag-3",
|
|
2500
|
+
size: "small"
|
|
2501
|
+
}), Y("span", Uc, G(e), 1)]),
|
|
2502
|
+
_: 2
|
|
2503
|
+
}, 1024)), [[h, we(e)]])]),
|
|
2504
|
+
_: 2
|
|
2505
|
+
}, 1040))), 128)), e.tags.length > 2 ? (Z(), H(a, {
|
|
2506
|
+
key: 0,
|
|
2507
|
+
size: "small",
|
|
2508
|
+
class: "resource-table-tag-more align-text-bottom cursor-pointer",
|
|
2509
|
+
onClick: n[0] ||= (e) => R(de).openSideBar()
|
|
2510
|
+
}, {
|
|
2511
|
+
default: F(() => [Cr(" + " + G(e.tags.length - 2), 1)]),
|
|
2512
|
+
_: 2
|
|
2513
|
+
}, 1024)) : K("", !0)]),
|
|
2514
|
+
manager: F(({ item: e }) => [k(t.$slots, "manager", { resource: e })]),
|
|
2515
|
+
members: F(({ item: e }) => [k(t.$slots, "members", { resource: e })]),
|
|
2516
|
+
totalQuota: F(({ item: e }) => [k(t.$slots, "totalQuota", { resource: e })]),
|
|
2517
|
+
usedQuota: F(({ item: e }) => [k(t.$slots, "usedQuota", { resource: e })]),
|
|
2518
|
+
remainingQuota: F(({ item: e }) => [k(t.$slots, "remainingQuota", { resource: e })]),
|
|
2519
|
+
mdate: F(({ item: e }) => [L(Y("span", {
|
|
2520
|
+
tabindex: "0",
|
|
2521
|
+
textContent: G(P(e.mdate))
|
|
2522
|
+
}, null, 8, Wc), [[h, je(e.mdate)]])]),
|
|
2523
|
+
indicators: F(({ item: t }) => [J(Mc, {
|
|
2524
|
+
space: e.space,
|
|
2525
|
+
resource: t,
|
|
2526
|
+
"disable-handler": R(w)(t)
|
|
2527
|
+
}, null, 8, [
|
|
2528
|
+
"space",
|
|
2529
|
+
"resource",
|
|
2530
|
+
"disable-handler"
|
|
2531
|
+
])]),
|
|
2532
|
+
sdate: F(({ item: e }) => [L(Y("span", {
|
|
2533
|
+
tabindex: "0",
|
|
2534
|
+
textContent: G(P(e.sdate))
|
|
2535
|
+
}, null, 8, Gc), [[h, je(e.sdate)]])]),
|
|
2536
|
+
ddate: F(({ item: e }) => [L(Y("p", {
|
|
2537
|
+
tabindex: "0",
|
|
2538
|
+
class: "m-0",
|
|
2539
|
+
textContent: G(P(e.ddate))
|
|
2540
|
+
}, null, 8, Kc), [[h, je(e.ddate)]])]),
|
|
2541
|
+
sharedBy: F(({ item: e }) => [J(m, {
|
|
2542
|
+
class: "flex items-center justify-end flex-row flex-nowrap",
|
|
2543
|
+
"is-tooltip-displayed": !0,
|
|
2544
|
+
items: Pe(e),
|
|
2545
|
+
"accessible-description": Ne(e),
|
|
2546
|
+
"hover-effect": ""
|
|
2547
|
+
}, {
|
|
2548
|
+
userAvatars: F(({ avatars: e, width: t }) => [(Z(!0), X(W, null, M(e, (e) => (Z(), H(R(Nc), {
|
|
2549
|
+
key: e.userId,
|
|
2550
|
+
"user-id": e.userId,
|
|
2551
|
+
"user-name": e.displayName,
|
|
2552
|
+
width: t
|
|
2553
|
+
}, null, 8, [
|
|
2554
|
+
"user-id",
|
|
2555
|
+
"user-name",
|
|
2556
|
+
"width"
|
|
2557
|
+
]))), 128))]),
|
|
2558
|
+
_: 1
|
|
2559
|
+
}, 8, ["items", "accessible-description"])]),
|
|
2560
|
+
sharedWith: F(({ item: e }) => [J(m, {
|
|
2561
|
+
class: "flex items-center justify-end flex-row flex-nowrap",
|
|
2562
|
+
"data-testid": "resource-table-shared-with",
|
|
2563
|
+
items: Fe(e),
|
|
2564
|
+
stacked: !0,
|
|
2565
|
+
"max-displayed": 3,
|
|
2566
|
+
"is-tooltip-displayed": !0,
|
|
2567
|
+
"accessible-description": Me(e),
|
|
2568
|
+
"hover-effect": ""
|
|
2569
|
+
}, {
|
|
2570
|
+
userAvatars: F(({ avatars: e, width: t }) => [(Z(!0), X(W, null, M(e, (e) => (Z(), H(R(Nc), {
|
|
2571
|
+
key: e.userId,
|
|
2572
|
+
"user-id": e.userId,
|
|
2573
|
+
"user-name": e.displayName,
|
|
2574
|
+
width: t
|
|
2575
|
+
}, null, 8, [
|
|
2576
|
+
"user-id",
|
|
2577
|
+
"user-name",
|
|
2578
|
+
"width"
|
|
2579
|
+
]))), 128))]),
|
|
2580
|
+
_: 1
|
|
2581
|
+
}, 8, ["items", "accessible-description"])]),
|
|
2582
|
+
actions: F(({ item: n }) => [R(ae)(n) ? (Z(), X("div", qc, [k(t.$slots, "quickActions", { resource: n }), J(yc, {
|
|
2583
|
+
ref: (e) => Ce.value[n.id] = e?.drop,
|
|
2584
|
+
title: n.name,
|
|
2585
|
+
item: n,
|
|
2586
|
+
"resource-dom-selector": e.resourceDomSelector,
|
|
2587
|
+
class: "resource-table-btn-action-dropdown",
|
|
2588
|
+
onQuickActionClicked: (e) => R(oe)(e, n, Ce.value[n.id])
|
|
2589
|
+
}, {
|
|
2590
|
+
contextMenu: F(() => [k(t.$slots, "contextMenu", { resource: n })]),
|
|
2591
|
+
_: 2
|
|
2592
|
+
}, 1032, [
|
|
2593
|
+
"title",
|
|
2594
|
+
"item",
|
|
2595
|
+
"resource-dom-selector",
|
|
2596
|
+
"onQuickActionClicked"
|
|
2597
|
+
])])) : K("", !0)]),
|
|
2598
|
+
_: 2
|
|
2599
|
+
}, [
|
|
2600
|
+
!R(g) && !R(_) ? {
|
|
2601
|
+
name: "selectHeader",
|
|
2602
|
+
fn: F(() => [Y("div", Hc, [L(J(r, {
|
|
2603
|
+
id: "resource-table-select-all",
|
|
2604
|
+
size: "large",
|
|
2605
|
+
label: R(se),
|
|
2606
|
+
disabled: e.resources.length === R(b).length,
|
|
2607
|
+
"label-hidden": !0,
|
|
2608
|
+
"model-value": R(ue),
|
|
2609
|
+
onClick: Ki(R(le), ["stop"])
|
|
2610
|
+
}, null, 8, [
|
|
2611
|
+
"label",
|
|
2612
|
+
"disabled",
|
|
2613
|
+
"model-value",
|
|
2614
|
+
"onClick"
|
|
2615
|
+
]), [[h, R(se)]])])]),
|
|
2616
|
+
key: "0"
|
|
2617
|
+
} : void 0,
|
|
2618
|
+
!R(g) && !R(_) ? {
|
|
2619
|
+
name: "select",
|
|
2620
|
+
fn: F(({ item: t }) => [R(T)(t.id) ? (Z(), H(R(Di), {
|
|
2621
|
+
key: 0,
|
|
2622
|
+
class: "inline-flex ml-1",
|
|
2623
|
+
size: "medium",
|
|
2624
|
+
"aria-label": R(p)("File is being processed")
|
|
2625
|
+
}, null, 8, ["aria-label"])) : (Z(), H(r, {
|
|
2626
|
+
key: 1,
|
|
2627
|
+
id: `resource-table-select-${e.resourceDomSelector(t)}`,
|
|
2628
|
+
label: R(ce)(t),
|
|
2629
|
+
"label-hidden": !0,
|
|
2630
|
+
size: "large",
|
|
2631
|
+
disabled: R(w)(t),
|
|
2632
|
+
"model-value": R(x)(t),
|
|
2633
|
+
outline: Oe(t),
|
|
2634
|
+
"data-test-selection-resource-name": t.name,
|
|
2635
|
+
"data-test-selection-resource-path": t.path,
|
|
2636
|
+
onClick: Ki((e) => R(ee)({
|
|
2637
|
+
resource: t,
|
|
2638
|
+
event: e
|
|
2639
|
+
}), ["stop"])
|
|
2640
|
+
}, null, 8, [
|
|
2641
|
+
"id",
|
|
2642
|
+
"label",
|
|
2643
|
+
"disabled",
|
|
2644
|
+
"model-value",
|
|
2645
|
+
"outline",
|
|
2646
|
+
"data-test-selection-resource-name",
|
|
2647
|
+
"data-test-selection-resource-path",
|
|
2648
|
+
"onClick"
|
|
2649
|
+
]))]),
|
|
2650
|
+
key: "1"
|
|
2651
|
+
} : void 0,
|
|
2652
|
+
t.$slots.footer ? {
|
|
2653
|
+
name: "footer",
|
|
2654
|
+
fn: F(() => [k(t.$slots, "footer")]),
|
|
2655
|
+
key: "2"
|
|
2656
|
+
} : void 0
|
|
2657
|
+
]), 1040, [
|
|
2658
|
+
"class",
|
|
2659
|
+
"data",
|
|
2660
|
+
"fields",
|
|
2661
|
+
"highlighted",
|
|
2662
|
+
"disabled",
|
|
2663
|
+
"sticky",
|
|
2664
|
+
"header-position",
|
|
2665
|
+
"drag-drop",
|
|
2666
|
+
"hover",
|
|
2667
|
+
"item-dom-selector",
|
|
2668
|
+
"selection",
|
|
2669
|
+
"sort-by",
|
|
2670
|
+
"sort-dir",
|
|
2671
|
+
"lazy",
|
|
2672
|
+
"onDropRowStyling"
|
|
2673
|
+
]), R(A) ? (Z(), H(Gn, {
|
|
2674
|
+
key: 0,
|
|
2675
|
+
to: "body"
|
|
2676
|
+
}, [J(Dc, {
|
|
2677
|
+
ref: "ghostElement",
|
|
2678
|
+
"preview-items": [R(A), ...R(ne)]
|
|
2679
|
+
}, null, 8, ["preview-items"])])) : K("", !0)], 64);
|
|
2680
|
+
};
|
|
2681
|
+
}
|
|
2682
|
+
}), Xc = {
|
|
2683
|
+
key: 0,
|
|
2684
|
+
class: "oc-tile-card-lazy-shimmer h-30 overflow-hidden relative after:absolute after:inset-0 after:transform-[translateX(-100%)] opacity-20 after:animate-shimmer"
|
|
2685
|
+
}, Zc = { class: "z-10 absolute top-0 left-0 [&_input]:not-[.oc-checkbox-checked]:bg-role-surface-container" }, Qc = {
|
|
2686
|
+
key: 0,
|
|
2687
|
+
class: "oc-tile-card-loading-spinner z-990 m-2"
|
|
2688
|
+
}, $c = ["textContent"], el = ["aria-label"], tl = { class: "flex justify-between items-center" }, nl = { class: "flex items-center truncate resource-name-wrapper text-role-on-surface overflow-hidden" }, rl = { class: "flex items-center" }, il = {
|
|
2689
|
+
key: 0,
|
|
2690
|
+
class: "text-left my-0 truncate"
|
|
2691
|
+
}, al = ["textContent"], ol = /* @__PURE__ */ U({
|
|
2692
|
+
__name: "ResourceTile",
|
|
2693
|
+
props: {
|
|
2694
|
+
resource: {},
|
|
2695
|
+
resourceRoute: {},
|
|
2696
|
+
space: {},
|
|
2697
|
+
isResourceSelected: {
|
|
2698
|
+
type: Boolean,
|
|
2699
|
+
default: !1
|
|
2700
|
+
},
|
|
2701
|
+
isResourceClickable: {
|
|
2702
|
+
type: Boolean,
|
|
2703
|
+
default: !0
|
|
2704
|
+
},
|
|
2705
|
+
isResourceDisabled: {
|
|
2706
|
+
type: Boolean,
|
|
2707
|
+
default: !1
|
|
2708
|
+
},
|
|
2709
|
+
isExtensionDisplayed: {
|
|
2710
|
+
type: Boolean,
|
|
2711
|
+
default: !0
|
|
2712
|
+
},
|
|
2713
|
+
isPathDisplayed: {
|
|
2714
|
+
type: Boolean,
|
|
2715
|
+
default: !1
|
|
2716
|
+
},
|
|
2717
|
+
resourceIconSize: { default: "xlarge" },
|
|
2718
|
+
lazy: {
|
|
2719
|
+
type: Boolean,
|
|
2720
|
+
default: !1
|
|
2721
|
+
},
|
|
2722
|
+
isLoading: {
|
|
2723
|
+
type: Boolean,
|
|
2724
|
+
default: !1
|
|
2725
|
+
}
|
|
2726
|
+
},
|
|
2727
|
+
emits: [
|
|
2728
|
+
"fileNameClicked",
|
|
2729
|
+
"contextmenu",
|
|
2730
|
+
"itemVisible",
|
|
2731
|
+
"tileClicked"
|
|
2732
|
+
],
|
|
2733
|
+
setup(e, { emit: t }) {
|
|
2734
|
+
let n = t, { $gettext: r } = Q(), { getParentFolderName: i, getParentFolderLink: a } = Ba({ space: z(e.space) }), o = de("observerTarget"), s = q(() => R(o)?.$el), c = q(() => e.resource.locked || e.resource.processing), l = q(() => e.resource.locked ? {
|
|
2735
|
+
name: "lock",
|
|
2736
|
+
fillType: "fill"
|
|
2737
|
+
} : e.resource.processing ? {
|
|
2738
|
+
name: "loop-right",
|
|
2739
|
+
fillType: "line"
|
|
2740
|
+
} : {}), u = q(() => e.resource.locked ? r("This item is locked") : null), d = q(() => fo(e.resource) ? e.resource.description : ""), { isVisible: f } = e.lazy ? ir({
|
|
2741
|
+
target: s,
|
|
2742
|
+
onVisibleCallback: () => n("itemVisible")
|
|
2743
|
+
}) : { isVisible: z(!0) }, p = q(() => !R(f));
|
|
2744
|
+
return e.lazy || n("itemVisible"), (t, n) => {
|
|
2745
|
+
let s = I("oc-spinner"), f = I("oc-tag"), m = I("oc-image"), h = I("oc-icon"), g = ti("oc-tooltip");
|
|
2746
|
+
return Z(), H(R(da), {
|
|
2747
|
+
ref_key: "observerTarget",
|
|
2748
|
+
ref: o,
|
|
2749
|
+
"body-class": "p-0",
|
|
2750
|
+
class: V(["oc-tile-card flex flex-col h-full shadow-none [&.item-accentuated]:bg-role-secondary-container", {
|
|
2751
|
+
"oc-tile-card-selected bg-role-secondary-container outline-2 outline-role-outline": e.isResourceSelected,
|
|
2752
|
+
"bg-role-surface-container hover:bg-role-surface-container-highest outline outline-role-surface-container-highest": !e.isResourceSelected,
|
|
2753
|
+
"oc-tile-card-disabled opacity-70 grayscale-60 pointer-events-none": e.isResourceDisabled,
|
|
2754
|
+
"state-trashed [&_.tile-preview]:opacity-80 [&_.tile-default-image_svg]:opacity-80 [&_.tile-preview]:grayscale [&_.tile-default-image_svg]:grayscale": R(so)(e.resource) && e.resource.disabled
|
|
2755
|
+
}]),
|
|
2756
|
+
"data-item-id": e.resource.id,
|
|
2757
|
+
onContextmenu: n[4] ||= (e) => t.$emit("contextmenu", e)
|
|
2758
|
+
}, {
|
|
2759
|
+
default: F(() => [p.value ? (Z(), X("div", Xc)) : (Z(), X(W, { key: 1 }, [J(De, {
|
|
2760
|
+
class: "oc-card-media-top flex justify-center items-center m-0 w-full relative aspect-[16/9]",
|
|
2761
|
+
resource: e.resource,
|
|
2762
|
+
link: e.resourceRoute,
|
|
2763
|
+
"is-resource-clickable": e.isResourceClickable,
|
|
2764
|
+
tabindex: "-1",
|
|
2765
|
+
onClick: n[1] ||= (e) => t.$emit("fileNameClicked", e)
|
|
2766
|
+
}, {
|
|
2767
|
+
default: F(() => [
|
|
2768
|
+
Y("div", Zc, [e.isLoading ? (Z(), X("div", Qc, [J(s, { "aria-label": R(r)("File is being processed") }, null, 8, ["aria-label"])])) : k(t.$slots, "selection", {
|
|
2769
|
+
key: 1,
|
|
2770
|
+
item: e.resource
|
|
2771
|
+
})]),
|
|
2772
|
+
R(so)(e.resource) && e.resource.disabled ? (Z(), H(f, {
|
|
2773
|
+
key: 0,
|
|
2774
|
+
class: "z-10 absolute text-role-on-surface",
|
|
2775
|
+
type: "span"
|
|
2776
|
+
}, {
|
|
2777
|
+
default: F(() => [Y("span", { textContent: G(R(r)("Disabled")) }, null, 8, $c)]),
|
|
2778
|
+
_: 1
|
|
2779
|
+
})) : K("", !0),
|
|
2780
|
+
L((Z(), X("div", {
|
|
2781
|
+
class: V(["oc-tile-card-preview flex items-center justify-center text-center size-full absolute", {
|
|
2782
|
+
"p-2": e.isResourceSelected,
|
|
2783
|
+
"hover:p-2": !e.isResourceSelected
|
|
2784
|
+
}]),
|
|
2785
|
+
"aria-label": u.value
|
|
2786
|
+
}, [k(t.$slots, "imageField", { item: e.resource }, () => [e.resource.thumbnail ? (Z(), H(m, {
|
|
2787
|
+
key: 0,
|
|
2788
|
+
class: V(["tile-preview rounded-t-sm size-full object-cover aspect-[16/9] pointer-events-none", { "rounded-sm": e.isResourceSelected }]),
|
|
2789
|
+
src: e.resource.thumbnail,
|
|
2790
|
+
"data-test-thumbnail-resource-name": e.resource.name,
|
|
2791
|
+
onClick: n[0] ||= Ki((n) => t.$emit("tileClicked", [e.resource, n]), ["stop"])
|
|
2792
|
+
}, null, 8, [
|
|
2793
|
+
"class",
|
|
2794
|
+
"src",
|
|
2795
|
+
"data-test-thumbnail-resource-name"
|
|
2796
|
+
])) : (Z(), H(nn, {
|
|
2797
|
+
key: 1,
|
|
2798
|
+
resource: e.resource,
|
|
2799
|
+
size: e.resourceIconSize,
|
|
2800
|
+
class: "tile-default-image pt-1 relative"
|
|
2801
|
+
}, ur({ _: 2 }, [c.value ? {
|
|
2802
|
+
name: "status",
|
|
2803
|
+
fn: F(() => [J(h, va(l.value, { size: "xsmall" }), null, 16)]),
|
|
2804
|
+
key: "0"
|
|
2805
|
+
} : void 0]), 1032, ["resource", "size"]))])], 10, el)), [[g, u.value]])
|
|
2806
|
+
]),
|
|
2807
|
+
_: 3
|
|
2808
|
+
}, 8, [
|
|
2809
|
+
"resource",
|
|
2810
|
+
"link",
|
|
2811
|
+
"is-resource-clickable"
|
|
2812
|
+
]), Y("div", {
|
|
2813
|
+
class: "p-2",
|
|
2814
|
+
onClick: n[3] ||= Ki((n) => t.$emit("tileClicked", [e.resource, n]), ["stop"])
|
|
2815
|
+
}, [
|
|
2816
|
+
Y("div", tl, [Y("div", nl, [J(y, {
|
|
2817
|
+
resource: e.resource,
|
|
2818
|
+
"is-icon-displayed": !1,
|
|
2819
|
+
"is-extension-displayed": e.isExtensionDisplayed,
|
|
2820
|
+
"is-resource-clickable": e.isResourceClickable,
|
|
2821
|
+
"is-path-displayed": e.isPathDisplayed,
|
|
2822
|
+
"parent-folder-name": R(i)(e.resource),
|
|
2823
|
+
"parent-folder-link": R(a)(e.resource),
|
|
2824
|
+
link: e.resourceRoute,
|
|
2825
|
+
onClick: n[2] ||= Ki((e) => t.$emit("fileNameClicked", e), ["stop"])
|
|
2826
|
+
}, null, 8, [
|
|
2827
|
+
"resource",
|
|
2828
|
+
"is-extension-displayed",
|
|
2829
|
+
"is-resource-clickable",
|
|
2830
|
+
"is-path-displayed",
|
|
2831
|
+
"parent-folder-name",
|
|
2832
|
+
"parent-folder-link",
|
|
2833
|
+
"link"
|
|
2834
|
+
])]), Y("div", rl, [
|
|
2835
|
+
k(t.$slots, "indicators", {
|
|
2836
|
+
item: e.resource,
|
|
2837
|
+
class: "resource-indicators"
|
|
2838
|
+
}),
|
|
2839
|
+
k(t.$slots, "actions", { item: e.resource }),
|
|
2840
|
+
k(t.$slots, "contextMenu", { item: e.resource })
|
|
2841
|
+
])]),
|
|
2842
|
+
d.value ? (Z(), X("p", il, [Y("span", {
|
|
2843
|
+
class: "text-sm",
|
|
2844
|
+
textContent: G(d.value)
|
|
2845
|
+
}, null, 8, al)])) : K("", !0),
|
|
2846
|
+
k(t.$slots, "additionalResourceContent", { item: e.resource })
|
|
2847
|
+
])], 64))]),
|
|
2848
|
+
_: 3
|
|
2849
|
+
}, 8, ["data-item-id", "class"]);
|
|
2850
|
+
};
|
|
2851
|
+
}
|
|
2852
|
+
}), sl = {
|
|
2853
|
+
id: "tiles-view",
|
|
2854
|
+
class: "px-4 pt-2"
|
|
2855
|
+
}, cl = { class: "flex items-center mb-2 pb-2 oc-tiles-controls" }, ll = {
|
|
2856
|
+
key: 1,
|
|
2857
|
+
class: "oc-tiles-sort"
|
|
2858
|
+
}, ul = {
|
|
2859
|
+
key: 0,
|
|
2860
|
+
class: "flex"
|
|
2861
|
+
}, dl = { class: "p-1 text-sm" }, fl = /* @__PURE__ */ B(/* @__PURE__ */ U({
|
|
2862
|
+
__name: "ResourceTiles",
|
|
2863
|
+
props: {
|
|
2864
|
+
resources: { default: () => [] },
|
|
2865
|
+
selectedIds: { default: () => [] },
|
|
2866
|
+
isSelectable: {
|
|
2867
|
+
type: Boolean,
|
|
2868
|
+
default: !0
|
|
2869
|
+
},
|
|
2870
|
+
space: {},
|
|
2871
|
+
sortFields: { default: () => [] },
|
|
2872
|
+
sortBy: {},
|
|
2873
|
+
sortDir: {},
|
|
2874
|
+
viewSize: { default: () => ma.tilesSizeDefault },
|
|
2875
|
+
dragDrop: {
|
|
2876
|
+
type: Boolean,
|
|
2877
|
+
default: !1
|
|
2878
|
+
},
|
|
2879
|
+
lazy: {
|
|
2880
|
+
type: Boolean,
|
|
2881
|
+
default: !0
|
|
2882
|
+
},
|
|
2883
|
+
areResourcesClickable: {
|
|
2884
|
+
type: Boolean,
|
|
2885
|
+
default: !0
|
|
2886
|
+
},
|
|
2887
|
+
arePathsDisplayed: {
|
|
2888
|
+
type: Boolean,
|
|
2889
|
+
default: !1
|
|
2890
|
+
}
|
|
2891
|
+
},
|
|
2892
|
+
emits: [
|
|
2893
|
+
"fileClick",
|
|
2894
|
+
"fileDropped",
|
|
2895
|
+
"sort",
|
|
2896
|
+
"itemVisible",
|
|
2897
|
+
"update:selectedIds"
|
|
2898
|
+
],
|
|
2899
|
+
setup(e, { emit: t }) {
|
|
2900
|
+
let n = t, { $gettext: r } = Q(), { areFileExtensionsShown: i } = $(dr()), { isLocationPicker: a, isFilePicker: o } = ci(), s = Er(), c = q(() => Math.min(R(s), e.viewSize)), { isSideBarOpen: l } = $(Oi()), { disabledResources: u, isResourceSelected: d, fileContainerClicked: f, fileNameClicked: p, fileCheckboxClicked: m, isResourceDisabled: h, isResourceInDeleteQueue: g, isResourceClickable: _, isResourceCut: v, getResourceLink: y, dragItem: b, dragSelection: x, dragStart: S, fileDropped: C, setDropStyling: ee, shouldShowContextDrop: w, showContextMenuOnRightClick: T, showContextMenuOnBtnClick: te, selectAllCheckboxLabel: E, getResourceCheckboxLabel: D, toggleSelectionAll: O, areAllResourcesSelected: A } = Yi({
|
|
2901
|
+
space: q(() => e.space),
|
|
2902
|
+
resources: q(() => e.resources),
|
|
2903
|
+
selectedIds: q(() => e.selectedIds),
|
|
2904
|
+
emit: n
|
|
2905
|
+
}), ne = z({}), re = window.__E2E__ === !0 ? !1 : e.lazy, j = q(() => e.sortFields.find((t) => t.name === e.sortBy && t.sortDir === e.sortDir) || e.sortFields[0]), ie = (e) => {
|
|
2906
|
+
n("sort", {
|
|
2907
|
+
sortBy: e.name,
|
|
2908
|
+
sortDir: R(e.sortDir)
|
|
2909
|
+
});
|
|
2910
|
+
}, ae = q(() => ({
|
|
2911
|
+
1: "xlarge",
|
|
2912
|
+
2: "xlarge",
|
|
2913
|
+
3: "xxlarge",
|
|
2914
|
+
4: "xxlarge",
|
|
2915
|
+
5: "xxxlarge",
|
|
2916
|
+
6: "xxxlarge"
|
|
2917
|
+
})[R(c)] ?? "xxlarge"), N = z(0), oe = () => {
|
|
2918
|
+
let e = document.getElementById("tiles-view"), t = getComputedStyle(e), n = parseInt(t.getPropertyValue("padding-left"), 10) | 0, r = parseInt(t.getPropertyValue("padding-right"), 10) | 0;
|
|
2919
|
+
N.value = e.clientWidth - n - r;
|
|
2920
|
+
}, se = q(() => parseFloat(getComputedStyle(document.documentElement).fontSize)), { calculateTileSizePixels: ce } = Pn(), le = q(() => {
|
|
2921
|
+
let e = [...Array(ma.tilesSizeMax).keys()].map((e) => e + 1);
|
|
2922
|
+
return [...new Set(e.map((e) => {
|
|
2923
|
+
let t = ce(e);
|
|
2924
|
+
return t ? Math.round(R(N) / (t + R(se))) : 0;
|
|
2925
|
+
}))];
|
|
2926
|
+
}), ue = q(() => {
|
|
2927
|
+
let e = R(le);
|
|
2928
|
+
return e.length < R(c) ? e[e.length - 1] : e[R(c) - 1];
|
|
2929
|
+
}), de = q(() => {
|
|
2930
|
+
let t = R(ue) ? e.resources.length % R(ue) : 0;
|
|
2931
|
+
return t ? R(ue) - t : 0;
|
|
2932
|
+
});
|
|
2933
|
+
return P(q(() => R(N) / R(ue) - R(se)), (e) => {
|
|
2934
|
+
e && !isNaN(e) && document.documentElement.style.setProperty("--oc-size-tiles-actual", `${e}px`);
|
|
2935
|
+
}, { immediate: !0 }), P(le, (e) => {
|
|
2936
|
+
s.value = Math.max(e.length, 1);
|
|
2937
|
+
}), P(l, () => {
|
|
2938
|
+
oe();
|
|
2939
|
+
}), Vt(() => {
|
|
2940
|
+
window.addEventListener("resize", oe), oe();
|
|
2941
|
+
}), ja(() => {
|
|
2942
|
+
window.removeEventListener("resize", oe);
|
|
2943
|
+
}), (t, n) => {
|
|
2944
|
+
let s = I("oc-checkbox"), c = I("oc-icon"), l = I("oc-button"), N = I("oc-list"), oe = I("oc-filter-chip"), se = ti("oc-tooltip");
|
|
2945
|
+
return Z(), X("div", sl, [
|
|
2946
|
+
Y("div", cl, [e.isSelectable && !R(o) ? L((Z(), H(s, {
|
|
2947
|
+
key: 0,
|
|
2948
|
+
id: "tiles-view-select-all",
|
|
2949
|
+
class: "ml-2",
|
|
2950
|
+
size: "large",
|
|
2951
|
+
label: R(E),
|
|
2952
|
+
"label-hidden": !0,
|
|
2953
|
+
disabled: e.resources.length === R(u).length,
|
|
2954
|
+
"model-value": R(A),
|
|
2955
|
+
onClick: Ki(R(O), ["stop"])
|
|
2956
|
+
}, null, 8, [
|
|
2957
|
+
"label",
|
|
2958
|
+
"disabled",
|
|
2959
|
+
"model-value",
|
|
2960
|
+
"onClick"
|
|
2961
|
+
])), [[se, R(E)]]) : K("", !0), e.sortFields.length ? (Z(), X("div", ll, [J(oe, {
|
|
2962
|
+
class: "[&_.oc-filter-chip-label]:text-sm",
|
|
2963
|
+
"filter-label": R(r)("Sort by"),
|
|
2964
|
+
"selected-item-names": [j.value.label],
|
|
2965
|
+
"has-active-state": !1,
|
|
2966
|
+
"close-on-click": "",
|
|
2967
|
+
raw: ""
|
|
2968
|
+
}, {
|
|
2969
|
+
default: F(() => [J(N, null, {
|
|
2970
|
+
default: F(() => [(Z(!0), X(W, null, M(e.sortFields, (e, t) => (Z(), X("li", { key: t }, [J(l, {
|
|
2971
|
+
appearance: j.value === e ? "filled" : "raw-inverse",
|
|
2972
|
+
"color-role": j.value === e ? "secondaryContainer" : "surface",
|
|
2973
|
+
"no-hover": j.value === e,
|
|
2974
|
+
"justify-content": "space-between",
|
|
2975
|
+
class: "oc-tiles-sort-filter-chip-item",
|
|
2976
|
+
onClick: (t) => ie(e)
|
|
2977
|
+
}, {
|
|
2978
|
+
default: F(() => [Y("span", null, G(e.label), 1), e === j.value ? (Z(), X("div", ul, [J(c, { name: "check" })])) : K("", !0)]),
|
|
2979
|
+
_: 2
|
|
2980
|
+
}, 1032, [
|
|
2981
|
+
"appearance",
|
|
2982
|
+
"color-role",
|
|
2983
|
+
"no-hover",
|
|
2984
|
+
"onClick"
|
|
2985
|
+
])]))), 128))]),
|
|
2986
|
+
_: 1
|
|
2987
|
+
})]),
|
|
2988
|
+
_: 1
|
|
2989
|
+
}, 8, ["filter-label", "selected-item-names"])])) : K("", !0)]),
|
|
2990
|
+
J(N, { class: "oc-tiles grid justify-start gap-3" }, {
|
|
2991
|
+
default: F(() => [(Z(!0), X(W, null, M(e.resources, (r) => (Z(), X("li", {
|
|
2992
|
+
key: r.id,
|
|
2993
|
+
class: "oc-tiles-item has-item-context-menu"
|
|
2994
|
+
}, [J(ol, {
|
|
2995
|
+
resource: r,
|
|
2996
|
+
space: e.space,
|
|
2997
|
+
"resource-route": R(y)(r),
|
|
2998
|
+
"is-resource-selected": R(d)(r),
|
|
2999
|
+
"is-resource-clickable": R(_)(r, e.areResourcesClickable),
|
|
3000
|
+
"is-resource-disabled": R(h)(r),
|
|
3001
|
+
"is-extension-displayed": R(i),
|
|
3002
|
+
"is-path-displayed": e.arePathsDisplayed,
|
|
3003
|
+
"resource-icon-size": ae.value,
|
|
3004
|
+
draggable: e.dragDrop,
|
|
3005
|
+
lazy: R(re),
|
|
3006
|
+
"is-loading": R(g)(r.id),
|
|
3007
|
+
class: V({ "opacity-60": R(v)(r) }),
|
|
3008
|
+
onContextmenu: (e) => R(T)(e, r, ne.value[r.id]),
|
|
3009
|
+
onFileNameClicked: Ki((e) => R(p)({
|
|
3010
|
+
resource: r,
|
|
3011
|
+
event: e
|
|
3012
|
+
}), ["stop"]),
|
|
3013
|
+
onDragstart: (e) => R(S)(r, e),
|
|
3014
|
+
onDragenter: Ki((e) => R(ee)(r, !1, e), ["prevent"]),
|
|
3015
|
+
onDragleave: Ki((e) => R(ee)(r, !0, e), ["prevent"]),
|
|
3016
|
+
onDrop: (e) => R(C)(r, e),
|
|
3017
|
+
onDragover: n[0] ||= (e) => e.preventDefault(),
|
|
3018
|
+
onItemVisible: (e) => t.$emit("itemVisible", r),
|
|
3019
|
+
onTileClicked: (e) => R(f)({
|
|
3020
|
+
resource: r,
|
|
3021
|
+
event: e[1]
|
|
3022
|
+
})
|
|
3023
|
+
}, {
|
|
3024
|
+
selection: F(() => [e.isSelectable && !R(a) && !R(o) ? (Z(), H(s, {
|
|
3025
|
+
key: 0,
|
|
3026
|
+
label: R(D)(r),
|
|
3027
|
+
"label-hidden": !0,
|
|
3028
|
+
size: "large",
|
|
3029
|
+
class: "inline-flex p-2.5",
|
|
3030
|
+
disabled: R(h)(r),
|
|
3031
|
+
"model-value": R(d)(r),
|
|
3032
|
+
"data-test-selection-resource-name": r.name,
|
|
3033
|
+
"data-test-selection-resource-path": r.path,
|
|
3034
|
+
onClick: Ki((e) => R(m)({
|
|
3035
|
+
resource: r,
|
|
3036
|
+
event: e
|
|
3037
|
+
}), ["stop"])
|
|
3038
|
+
}, null, 8, [
|
|
3039
|
+
"label",
|
|
3040
|
+
"disabled",
|
|
3041
|
+
"model-value",
|
|
3042
|
+
"data-test-selection-resource-name",
|
|
3043
|
+
"data-test-selection-resource-path",
|
|
3044
|
+
"onClick"
|
|
3045
|
+
])) : K("", !0)]),
|
|
3046
|
+
imageField: F(() => [k(t.$slots, "image", { resource: r }, void 0, !0)]),
|
|
3047
|
+
indicators: F(() => [J(Mc, {
|
|
3048
|
+
space: e.space,
|
|
3049
|
+
class: "ml-2",
|
|
3050
|
+
resource: r,
|
|
3051
|
+
filter: (e) => ["system", "sharing"].includes(e.category),
|
|
3052
|
+
"disable-handler": R(h)(r)
|
|
3053
|
+
}, null, 8, [
|
|
3054
|
+
"space",
|
|
3055
|
+
"resource",
|
|
3056
|
+
"filter",
|
|
3057
|
+
"disable-handler"
|
|
3058
|
+
])]),
|
|
3059
|
+
actions: F(() => [k(t.$slots, "actions", { resource: r }, void 0, !0)]),
|
|
3060
|
+
contextMenu: F(() => [R(w)(r) ? (Z(), H(R(yc), {
|
|
3061
|
+
key: 0,
|
|
3062
|
+
ref_for: !0,
|
|
3063
|
+
ref: (e) => ne.value[r.id] = e?.drop,
|
|
3064
|
+
item: r,
|
|
3065
|
+
title: r.name,
|
|
3066
|
+
class: "resource-tiles-btn-action-dropdown",
|
|
3067
|
+
onQuickActionClicked: (e) => R(te)(e, r, ne.value[r.id])
|
|
3068
|
+
}, {
|
|
3069
|
+
contextMenu: F(() => [k(t.$slots, "contextMenu", { resource: r }, void 0, !0)]),
|
|
3070
|
+
_: 2
|
|
3071
|
+
}, 1032, [
|
|
3072
|
+
"item",
|
|
3073
|
+
"title",
|
|
3074
|
+
"onQuickActionClicked"
|
|
3075
|
+
])) : K("", !0)]),
|
|
3076
|
+
additionalResourceContent: F(() => [k(t.$slots, "additionalResourceContent", { resource: r }, void 0, !0)]),
|
|
3077
|
+
_: 2
|
|
3078
|
+
}, 1032, [
|
|
3079
|
+
"resource",
|
|
3080
|
+
"space",
|
|
3081
|
+
"resource-route",
|
|
3082
|
+
"is-resource-selected",
|
|
3083
|
+
"is-resource-clickable",
|
|
3084
|
+
"is-resource-disabled",
|
|
3085
|
+
"is-extension-displayed",
|
|
3086
|
+
"is-path-displayed",
|
|
3087
|
+
"resource-icon-size",
|
|
3088
|
+
"draggable",
|
|
3089
|
+
"lazy",
|
|
3090
|
+
"is-loading",
|
|
3091
|
+
"class",
|
|
3092
|
+
"onContextmenu",
|
|
3093
|
+
"onFileNameClicked",
|
|
3094
|
+
"onDragstart",
|
|
3095
|
+
"onDragenter",
|
|
3096
|
+
"onDragleave",
|
|
3097
|
+
"onDrop",
|
|
3098
|
+
"onItemVisible",
|
|
3099
|
+
"onTileClicked"
|
|
3100
|
+
])]))), 128)), (Z(!0), X(W, null, M(de.value, (e) => (Z(), X("li", {
|
|
3101
|
+
key: `ghost-tile-${e}`,
|
|
3102
|
+
class: "list-item",
|
|
3103
|
+
"aria-hidden": !0
|
|
3104
|
+
}))), 128))]),
|
|
3105
|
+
_: 3
|
|
3106
|
+
}),
|
|
3107
|
+
R(b) ? (Z(), H(Gn, {
|
|
3108
|
+
key: 0,
|
|
3109
|
+
to: "body"
|
|
3110
|
+
}, [J(Dc, {
|
|
3111
|
+
ref: "ghostElement",
|
|
3112
|
+
"preview-items": [R(b), ...R(x)]
|
|
3113
|
+
}, null, 8, ["preview-items"])])) : K("", !0),
|
|
3114
|
+
Y("div", dl, [k(t.$slots, "footer", {}, void 0, !0)])
|
|
3115
|
+
]);
|
|
3116
|
+
};
|
|
3117
|
+
}
|
|
3118
|
+
}), [["__scopeId", "data-v-15ffc95e"]]), pl = { class: "flex items-center truncate" }, ml = { class: "truncate ml-2" }, hl = { class: "flex" }, gl = { class: "my-1" }, _l = { class: "flex items-center truncate" }, vl = { class: "truncate ml-2" }, yl = ["textContent"], bl = { class: "flex" }, xl = { class: "flex items-center justify-between mb-4" }, Sl = ["textContent"], Cl = { class: "mt-2" }, wl = { class: "date-filter-apply-btn text-end" }, Tl = /* @__PURE__ */ B(/* @__PURE__ */ U({
|
|
3119
|
+
__name: "DateFilter",
|
|
3120
|
+
props: {
|
|
3121
|
+
filterLabel: {},
|
|
3122
|
+
filterName: {},
|
|
3123
|
+
items: {},
|
|
3124
|
+
idAttribute: { default: "id" },
|
|
3125
|
+
displayNameAttribute: { default: "name" }
|
|
3126
|
+
},
|
|
3127
|
+
emits: ["selectionChange"],
|
|
3128
|
+
setup(e, { expose: t, emit: n }) {
|
|
3129
|
+
let i = n, a = ji(), { current: o } = Q(), s = br(), { currentTheme: c } = $(za()), l = z(), u = z(e.items), d = z(), f = z(), p = z(!1), m = z(), h = `q_${e.filterName}`, g = r(h), _ = (t) => t[e.idAttribute], v = () => a.push({ query: {
|
|
3130
|
+
...Zi(R(s).query, [h]),
|
|
3131
|
+
...R(l) && { [h]: _(R(l)) }
|
|
3132
|
+
} }), y = (e) => R(l) && _(R(l)) === _(e), b = () => {
|
|
3133
|
+
d.value = void 0, f.value = void 0;
|
|
3134
|
+
}, x = async (e) => {
|
|
3135
|
+
b(), y(e) ? l.value = void 0 : (l.value = e, R(m).hideDrop()), await v(), i("selectionChange", R(l));
|
|
3136
|
+
}, S = () => {
|
|
3137
|
+
l.value = void 0, p.value = !1, b(), i("selectionChange", R(l)), v();
|
|
3138
|
+
}, C = () => {
|
|
3139
|
+
u.value = e.items;
|
|
3140
|
+
}, ee = () => {
|
|
3141
|
+
p.value = !1;
|
|
3142
|
+
}, w = () => {
|
|
3143
|
+
let t = Le(R(g));
|
|
3144
|
+
if (!t) return;
|
|
3145
|
+
let n = e.items.find((e) => _(e) === t);
|
|
3146
|
+
if (n) {
|
|
3147
|
+
l.value = n;
|
|
3148
|
+
return;
|
|
3149
|
+
}
|
|
3150
|
+
if (R(T)) {
|
|
3151
|
+
let e = t.replace("range:", ""), n = Number(e.split(" - ")[0]), r = Number(e.split(" - ")[1]);
|
|
3152
|
+
d.value = _o.fromMillis(n), f.value = _o.fromMillis(r), l.value = R(E);
|
|
3153
|
+
}
|
|
3154
|
+
}, T = q(() => Le(R(g))?.startsWith("range:")), te = q(() => !R(d) || !R(f) ? !1 : R(d) <= R(f)), E = q(() => {
|
|
3155
|
+
if (!R(d) || !R(f)) return null;
|
|
3156
|
+
let t = Bi(R(d), o, _o.DATE_SHORT), n = Bi(R(f), o, _o.DATE_SHORT), r = R(d).toMillis(), i = R(f).toMillis();
|
|
3157
|
+
return {
|
|
3158
|
+
[e.idAttribute]: `range:${r} - ${i}`,
|
|
3159
|
+
[e.displayNameAttribute]: `${t} - ${n}`
|
|
3160
|
+
};
|
|
3161
|
+
}), D = async () => {
|
|
3162
|
+
l.value = R(E), await v(), R(m).hideDrop(), i("selectionChange", R(l));
|
|
3163
|
+
}, O = ({ date: e, error: t }, n) => {
|
|
3164
|
+
if (t) {
|
|
3165
|
+
console.error("date could not be set");
|
|
3166
|
+
return;
|
|
3167
|
+
}
|
|
3168
|
+
let r = n === "from" ? d : f;
|
|
3169
|
+
if (!e) {
|
|
3170
|
+
r.value = void 0;
|
|
3171
|
+
return;
|
|
3172
|
+
}
|
|
3173
|
+
r.value = n === "from" ? e.startOf("day") : e.endOf("day");
|
|
3174
|
+
};
|
|
3175
|
+
return t({ setSelectedItemsBasedOnQuery: w }), Vt(() => {
|
|
3176
|
+
w();
|
|
3177
|
+
}), (t, n) => {
|
|
3178
|
+
let r = I("oc-icon"), i = I("oc-button"), a = I("oc-list"), o = I("oc-datepicker");
|
|
3179
|
+
return Z(), X("div", { class: V(["date-filter flex overflow-hidden [&_label]:text-sm", `date-filter-${e.filterName}`]) }, [J(R(rr), {
|
|
3180
|
+
ref_key: "filterChip",
|
|
3181
|
+
ref: m,
|
|
3182
|
+
"filter-label": e.filterLabel,
|
|
3183
|
+
"selected-item-names": l.value ? [l.value[e.displayNameAttribute]] : void 0,
|
|
3184
|
+
onClearFilter: S,
|
|
3185
|
+
onShowDrop: C,
|
|
3186
|
+
onHideDrop: ee
|
|
3187
|
+
}, {
|
|
3188
|
+
default: F(() => [J(a, { class: V({ "invisible min-h-[225px] transition-[visibility] duration-[0.4s,0s]": p.value }) }, {
|
|
3189
|
+
default: F(() => [(Z(!0), X(W, null, M(u.value, (n, a) => (Z(), X("li", {
|
|
3190
|
+
key: a,
|
|
3191
|
+
class: "my-1 first:mt-0 last:mb-0"
|
|
3192
|
+
}, [J(i, {
|
|
3193
|
+
class: V(["date-filter-list-item flex justify-between items-center w-full p-1", { "date-filter-list-item-active": y(n) }]),
|
|
3194
|
+
"justify-content": "space-between",
|
|
3195
|
+
appearance: "raw",
|
|
3196
|
+
"data-testid": n[e.displayNameAttribute],
|
|
3197
|
+
onClick: (e) => x(n)
|
|
3198
|
+
}, {
|
|
3199
|
+
default: F(() => [Y("div", pl, [Y("div", ml, [k(t.$slots, "item", { item: n }, void 0, !0)])]), Y("div", hl, [y(n) ? (Z(), H(r, {
|
|
3200
|
+
key: 0,
|
|
3201
|
+
name: "check"
|
|
3202
|
+
})) : K("", !0)])]),
|
|
3203
|
+
_: 2
|
|
3204
|
+
}, 1032, [
|
|
3205
|
+
"class",
|
|
3206
|
+
"data-testid",
|
|
3207
|
+
"onClick"
|
|
3208
|
+
])]))), 128)), Y("li", gl, [J(i, {
|
|
3209
|
+
class: V(["date-filter-list-item flex justify-between items-center w-full p-1", { "date-filter-list-item-active": T.value }]),
|
|
3210
|
+
"justify-content": "space-between",
|
|
3211
|
+
appearance: "raw",
|
|
3212
|
+
"data-testid": "custom-date-range",
|
|
3213
|
+
onClick: n[0] ||= (e) => p.value = !0
|
|
3214
|
+
}, {
|
|
3215
|
+
default: F(() => [Y("div", _l, [Y("div", vl, [Y("span", { textContent: G(t.$gettext("Custom date range")) }, null, 8, yl)])]), Y("div", bl, [T.value ? (Z(), H(r, {
|
|
3216
|
+
key: 0,
|
|
3217
|
+
name: "check"
|
|
3218
|
+
})) : K("", !0)])]),
|
|
3219
|
+
_: 1
|
|
3220
|
+
}, 8, ["class"])])]),
|
|
3221
|
+
_: 3
|
|
3222
|
+
}, 8, ["class"]), Y("div", { class: V(["date-filter-range-panel absolute top-0 p-2 bg-role-surface", {
|
|
3223
|
+
"transform-[translateX(0)] visible": p.value,
|
|
3224
|
+
"transform-[translateX(100%)] invisible": !p.value
|
|
3225
|
+
}]) }, [
|
|
3226
|
+
Y("div", xl, [
|
|
3227
|
+
J(i, {
|
|
3228
|
+
appearance: "raw",
|
|
3229
|
+
class: "date-filter-range-panel-back",
|
|
3230
|
+
"aria-label": t.$gettext("Go back to filter options"),
|
|
3231
|
+
onClick: n[1] ||= (e) => p.value = !1
|
|
3232
|
+
}, {
|
|
3233
|
+
default: F(() => [J(r, {
|
|
3234
|
+
name: "arrow-left-s",
|
|
3235
|
+
"fill-type": "line"
|
|
3236
|
+
})]),
|
|
3237
|
+
_: 1
|
|
3238
|
+
}, 8, ["aria-label"]),
|
|
3239
|
+
Y("span", { textContent: G(t.$gettext("Custom date range")) }, null, 8, Sl),
|
|
3240
|
+
J(i, {
|
|
3241
|
+
appearance: "raw",
|
|
3242
|
+
class: "date-filter-range-panel-close",
|
|
3243
|
+
"aria-label": t.$gettext("Close filter"),
|
|
3244
|
+
onClick: n[2] ||= (e) => m.value.hideDrop()
|
|
3245
|
+
}, {
|
|
3246
|
+
default: F(() => [J(r, { name: "close" })]),
|
|
3247
|
+
_: 1
|
|
3248
|
+
}, 8, ["aria-label"])
|
|
3249
|
+
]),
|
|
3250
|
+
Y("div", Cl, [J(o, {
|
|
3251
|
+
label: t.$gettext("From"),
|
|
3252
|
+
"is-clearable": !0,
|
|
3253
|
+
"current-date": d.value,
|
|
3254
|
+
"is-dark": R(c).isDark,
|
|
3255
|
+
onDateChanged: n[3] ||= (e) => O(e, "from")
|
|
3256
|
+
}, null, 8, [
|
|
3257
|
+
"label",
|
|
3258
|
+
"current-date",
|
|
3259
|
+
"is-dark"
|
|
3260
|
+
]), J(o, {
|
|
3261
|
+
label: t.$gettext("To"),
|
|
3262
|
+
"is-clearable": !0,
|
|
3263
|
+
"current-date": f.value,
|
|
3264
|
+
"min-date": d.value ? d.value : void 0,
|
|
3265
|
+
"is-dark": R(c).isDark,
|
|
3266
|
+
onDateChanged: n[4] ||= (e) => O(e, "to")
|
|
3267
|
+
}, null, 8, [
|
|
3268
|
+
"label",
|
|
3269
|
+
"current-date",
|
|
3270
|
+
"min-date",
|
|
3271
|
+
"is-dark"
|
|
3272
|
+
])]),
|
|
3273
|
+
Y("div", wl, [J(i, {
|
|
3274
|
+
size: "small",
|
|
3275
|
+
disabled: !te.value,
|
|
3276
|
+
onClick: D
|
|
3277
|
+
}, {
|
|
3278
|
+
default: F(() => [Cr(G(t.$gettext("Apply")), 1)]),
|
|
3279
|
+
_: 1
|
|
3280
|
+
}, 8, ["disabled"])])
|
|
3281
|
+
], 2)]),
|
|
3282
|
+
_: 3
|
|
3283
|
+
}, 8, ["filter-label", "selected-item-names"])], 2);
|
|
3284
|
+
};
|
|
3285
|
+
}
|
|
3286
|
+
}), [["__scopeId", "data-v-9c476fec"]]), El = U({
|
|
3287
|
+
name: "ItemFilterInline",
|
|
3288
|
+
props: {
|
|
3289
|
+
filterName: {
|
|
3290
|
+
type: String,
|
|
3291
|
+
required: !0
|
|
3292
|
+
},
|
|
3293
|
+
filterOptions: {
|
|
3294
|
+
type: Array,
|
|
3295
|
+
required: !0
|
|
3296
|
+
}
|
|
3297
|
+
},
|
|
3298
|
+
emits: ["toggleFilter"],
|
|
3299
|
+
setup: function(e, { emit: t }) {
|
|
3300
|
+
let n = ji(), i = br(), a = z(e.filterOptions[0].name), o = `q_${e.filterName}`, s = r(o), c = (e) => n.push({ query: {
|
|
3301
|
+
...Zi(R(i).query, [o]),
|
|
3302
|
+
[o]: e
|
|
3303
|
+
} });
|
|
3304
|
+
return Vt(() => {
|
|
3305
|
+
let n = Le(R(s));
|
|
3306
|
+
n && e.filterOptions.some(({ name: e }) => e === n) && (a.value = n, t("toggleFilter", e.filterOptions.find(({ name: e }) => e === n)));
|
|
3307
|
+
}), {
|
|
3308
|
+
queryParam: o,
|
|
3309
|
+
activeOption: a,
|
|
3310
|
+
toggleFilter: async (e) => {
|
|
3311
|
+
a.value = e.name, await c(e.name), t("toggleFilter", e);
|
|
3312
|
+
}
|
|
3313
|
+
};
|
|
3314
|
+
}
|
|
3315
|
+
}), Dl = ["textContent"];
|
|
3316
|
+
function Ol(e, t, n, r, i, a) {
|
|
3317
|
+
let o = I("oc-button");
|
|
3318
|
+
return Z(), X("div", null, [Y("div", { class: V(["item-inline-filter inline-flex outline outline-offset-[-1px] rounded-md", `item-inline-filter-${e.filterName}`]) }, [(Z(!0), X(W, null, M(e.filterOptions, (t, n) => (Z(), H(o, {
|
|
3319
|
+
id: t.name,
|
|
3320
|
+
key: n,
|
|
3321
|
+
class: V(["item-inline-filter-option py-1 px-2 first:rounded-l-md last:rounded-r-md h-[32px]", { "item-inline-filter-option-selected": e.activeOption === t.name }]),
|
|
3322
|
+
appearance: e.activeOption === t.name ? "filled" : "raw-inverse",
|
|
3323
|
+
"color-role": e.activeOption === t.name ? "secondaryContainer" : "surface",
|
|
3324
|
+
"no-hover": e.activeOption === t.name,
|
|
3325
|
+
onClick: (n) => e.toggleFilter(t)
|
|
3326
|
+
}, {
|
|
3327
|
+
default: F(() => [Y("span", {
|
|
3328
|
+
class: "truncate item-inline-filter-option-label",
|
|
3329
|
+
textContent: G(t.label)
|
|
3330
|
+
}, null, 8, Dl)]),
|
|
3331
|
+
_: 2
|
|
3332
|
+
}, 1032, [
|
|
3333
|
+
"id",
|
|
3334
|
+
"class",
|
|
3335
|
+
"appearance",
|
|
3336
|
+
"color-role",
|
|
3337
|
+
"no-hover",
|
|
3338
|
+
"onClick"
|
|
3339
|
+
]))), 128))], 2)]);
|
|
3340
|
+
}
|
|
3341
|
+
var kl = /* @__PURE__ */ B(El, [["render", Ol]]), Al = {
|
|
3342
|
+
key: 1,
|
|
3343
|
+
class: "flex justify-between items-center w-full"
|
|
3344
|
+
}, jl = { class: "flex items-center truncate" }, Ml = { class: "flex flex-col items-start ml-5 truncate" }, Nl = ["textContent"], Pl = ["textContent"], Fl = { class: "flex justify-between items-center w-full" }, Il = { class: "flex items-center truncate" }, Ll = { class: "flex flex-col items-start ml-5 truncate" }, Rl = ["textContent"], zl = ["textContent"], Bl = /* @__PURE__ */ U({
|
|
3345
|
+
__name: "AccountsSwitch",
|
|
3346
|
+
setup(e) {
|
|
3347
|
+
let t = w(), { accounts: n, currentAccount: r, isLoading: i } = $(t), { setCurrentAccount: a } = t, o = (e) => {
|
|
3348
|
+
a(e);
|
|
3349
|
+
};
|
|
3350
|
+
return (e, t) => {
|
|
3351
|
+
let a = I("oc-spinner"), s = I("oc-avatar"), c = I("oc-icon"), l = I("oc-button"), u = I("oc-list"), d = I("oc-drop");
|
|
3352
|
+
return Z(), X(W, null, [J(l, {
|
|
3353
|
+
id: "account-list-toggle",
|
|
3354
|
+
class: "w-auto m-2",
|
|
3355
|
+
appearance: "filled",
|
|
3356
|
+
"color-role": "surface",
|
|
3357
|
+
"justify-content": "space-between",
|
|
3358
|
+
"no-hover": ""
|
|
3359
|
+
}, {
|
|
3360
|
+
default: F(() => [R(i) ? (Z(), H(a, {
|
|
3361
|
+
key: 0,
|
|
3362
|
+
"aria-label": e.$gettext("Loading accounts")
|
|
3363
|
+
}, null, 8, ["aria-label"])) : (Z(), X("div", Al, [Y("div", jl, [J(s, { "user-name": R(r)?.name || "" }, null, 8, ["user-name"]), Y("div", Ml, [Y("span", {
|
|
3364
|
+
class: "font-bold",
|
|
3365
|
+
textContent: G(R(r)?.name || "")
|
|
3366
|
+
}, null, 8, Nl), R(r)?.identities?.[0]?.email ? (Z(), X("span", {
|
|
3367
|
+
key: 0,
|
|
3368
|
+
class: "max-w-full truncate",
|
|
3369
|
+
textContent: G(R(r).identities[0].email)
|
|
3370
|
+
}, null, 8, Pl)) : K("", !0)])]), J(c, {
|
|
3371
|
+
class: "ml-2",
|
|
3372
|
+
name: "more-2"
|
|
3373
|
+
})]))]),
|
|
3374
|
+
_: 1
|
|
3375
|
+
}), J(d, {
|
|
3376
|
+
title: e.$gettext("Accounts"),
|
|
3377
|
+
class: "w-md",
|
|
3378
|
+
toggle: "#account-list-toggle",
|
|
3379
|
+
"close-on-click": ""
|
|
3380
|
+
}, {
|
|
3381
|
+
default: F(() => [J(u, null, {
|
|
3382
|
+
default: F(() => [(Z(!0), X(W, null, M(R(n), (e) => (Z(), X("li", {
|
|
3383
|
+
key: e.accountId,
|
|
3384
|
+
class: "oc-list"
|
|
3385
|
+
}, [J(l, {
|
|
3386
|
+
class: "p-2",
|
|
3387
|
+
appearance: e.accountId === R(r).accountId ? "filled" : "raw-inverse",
|
|
3388
|
+
"color-role": e.accountId === R(r).accountId ? "secondaryContainer" : "surface",
|
|
3389
|
+
onClick: (t) => o(e)
|
|
3390
|
+
}, {
|
|
3391
|
+
default: F(() => [Y("div", Fl, [Y("div", Il, [J(s, { "user-name": e.name }, null, 8, ["user-name"]), Y("div", Ll, [Y("span", {
|
|
3392
|
+
class: "font-bold",
|
|
3393
|
+
textContent: G(e.name)
|
|
3394
|
+
}, null, 8, Rl), e.identities?.[0]?.email ? (Z(), X("span", {
|
|
3395
|
+
key: 0,
|
|
3396
|
+
textContent: G(e.identities[0].email)
|
|
3397
|
+
}, null, 8, zl)) : K("", !0)])]), e.accountId === R(r).accountId ? (Z(), H(c, {
|
|
3398
|
+
key: 0,
|
|
3399
|
+
class: "ml-2",
|
|
3400
|
+
name: "check"
|
|
3401
|
+
})) : K("", !0)])]),
|
|
3402
|
+
_: 2
|
|
3403
|
+
}, 1032, [
|
|
3404
|
+
"appearance",
|
|
3405
|
+
"color-role",
|
|
3406
|
+
"onClick"
|
|
3407
|
+
])]))), 128))]),
|
|
3408
|
+
_: 1
|
|
3409
|
+
})]),
|
|
3410
|
+
_: 1
|
|
3411
|
+
}, 8, ["title"])], 64);
|
|
3412
|
+
};
|
|
3413
|
+
}
|
|
3414
|
+
}), Vl = { class: "space-quota" }, Hl = ["textContent"], Ul = /* @__PURE__ */ U({
|
|
3415
|
+
__name: "SpaceQuota",
|
|
3416
|
+
props: { spaceQuota: {} },
|
|
3417
|
+
setup(e) {
|
|
3418
|
+
let { $gettext: t, current: n } = Q(), r = q(() => e.spaceQuota.total ? t("%{used} of %{total} used (%{percentage}% used)", {
|
|
3419
|
+
used: R(a),
|
|
3420
|
+
total: R(i),
|
|
3421
|
+
percentage: R(o).toString()
|
|
3422
|
+
}) : t("%{used} used (no restriction)", { used: R(a) })), i = q(() => We(e.spaceQuota.total, n)), a = q(() => We(e.spaceQuota.used, n)), o = q(() => parseFloat((e.spaceQuota.used / e.spaceQuota.total * 100).toFixed(2))), s = q(() => {
|
|
3423
|
+
switch (e.spaceQuota.state) {
|
|
3424
|
+
case "normal": return "var(--oc-role-secondary)";
|
|
3425
|
+
default: return "var(--oc-role-error)";
|
|
3426
|
+
}
|
|
3427
|
+
});
|
|
3428
|
+
return (e, t) => {
|
|
3429
|
+
let n = I("oc-progress");
|
|
3430
|
+
return Z(), X("div", Vl, [Y("p", {
|
|
3431
|
+
class: "mb-2 mt-0",
|
|
3432
|
+
textContent: G(r.value)
|
|
3433
|
+
}, null, 8, Hl), J(n, {
|
|
3434
|
+
value: o.value,
|
|
3435
|
+
max: 100,
|
|
3436
|
+
size: "small",
|
|
3437
|
+
color: s.value,
|
|
3438
|
+
"background-color": "var(--oc-role-surface)"
|
|
3439
|
+
}, null, 8, ["value", "color"])]);
|
|
3440
|
+
};
|
|
3441
|
+
}
|
|
3442
|
+
}), Wl = U({
|
|
3443
|
+
name: "WebDavDetails",
|
|
3444
|
+
props: { space: {
|
|
3445
|
+
type: Object,
|
|
3446
|
+
required: !0
|
|
3447
|
+
} },
|
|
3448
|
+
setup(e) {
|
|
3449
|
+
let t = Rn("resource"), n = "check", r = "file-copy", i = z(r), a = z(r), o = q(() => Nt(R(t).webDavPath)), s = q(() => e.space?.getWebDavUrl({ path: R(t).path }));
|
|
3450
|
+
return {
|
|
3451
|
+
copyWebDAVPathIcon: i,
|
|
3452
|
+
copyWebDAVPathToClipboard: () => {
|
|
3453
|
+
navigator.clipboard.writeText(R(o)), i.value = n, setTimeout(() => i.value = r, 1500);
|
|
3454
|
+
},
|
|
3455
|
+
copyWebDAVUrlIcon: a,
|
|
3456
|
+
copyWebDAVUrlToClipboard: () => {
|
|
3457
|
+
navigator.clipboard.writeText(R(s)), a.value = n, setTimeout(() => a.value = r, 1500);
|
|
3458
|
+
},
|
|
3459
|
+
webDavPath: o,
|
|
3460
|
+
webDavUrl: s
|
|
3461
|
+
};
|
|
3462
|
+
}
|
|
3463
|
+
}), Gl = { class: "flex" }, Kl = ["textContent"], ql = { class: "flex" }, Jl = ["textContent"];
|
|
3464
|
+
function Yl(e, t, n, r, i, a) {
|
|
3465
|
+
let o = I("oc-icon"), s = I("oc-button"), c = ti("oc-tooltip");
|
|
3466
|
+
return Z(), X(W, null, [
|
|
3467
|
+
Y("dt", null, G(e.$gettext("WebDAV path")), 1),
|
|
3468
|
+
Y("dd", Gl, [L(Y("div", {
|
|
3469
|
+
class: "truncate",
|
|
3470
|
+
textContent: G(e.webDavPath)
|
|
3471
|
+
}, null, 8, Kl), [[c, e.webDavPath]]), L((Z(), H(s, {
|
|
3472
|
+
class: "ml-2",
|
|
3473
|
+
appearance: "raw",
|
|
3474
|
+
size: "small",
|
|
3475
|
+
"aria-label": e.$gettext("Copy WebDAV path to clipboard"),
|
|
3476
|
+
"no-hover": "",
|
|
3477
|
+
onClick: e.copyWebDAVPathToClipboard
|
|
3478
|
+
}, {
|
|
3479
|
+
default: F(() => [J(o, { name: e.copyWebDAVPathIcon }, null, 8, ["name"])]),
|
|
3480
|
+
_: 1
|
|
3481
|
+
}, 8, ["aria-label", "onClick"])), [[c, e.$gettext("Copy WebDAV path")]])]),
|
|
3482
|
+
Y("dt", null, G(e.$gettext("WebDAV URL")), 1),
|
|
3483
|
+
Y("dd", ql, [L(Y("div", {
|
|
3484
|
+
class: "truncate",
|
|
3485
|
+
textContent: G(e.webDavUrl)
|
|
3486
|
+
}, null, 8, Jl), [[c, e.webDavUrl]]), L((Z(), H(s, {
|
|
3487
|
+
class: "ml-2",
|
|
3488
|
+
appearance: "raw",
|
|
3489
|
+
size: "small",
|
|
3490
|
+
"aria-label": e.$gettext("Copy WebDAV URL to clipboard"),
|
|
3491
|
+
"no-hover": "",
|
|
3492
|
+
onClick: e.copyWebDAVUrlToClipboard
|
|
3493
|
+
}, {
|
|
3494
|
+
default: F(() => [J(o, { name: e.copyWebDAVUrlIcon }, null, 8, ["name"])]),
|
|
3495
|
+
_: 1
|
|
3496
|
+
}, 8, ["aria-label", "onClick"])), [[c, e.$gettext("Copy WebDAV URL")]])])
|
|
3497
|
+
], 64);
|
|
3498
|
+
}
|
|
3499
|
+
var Xl = /* @__PURE__ */ B(Wl, [["render", Yl]]), Zl = /* @__PURE__ */ U({
|
|
3500
|
+
__name: "CustomComponentTarget",
|
|
3501
|
+
props: { extensionPoint: {} },
|
|
3502
|
+
setup(e) {
|
|
3503
|
+
let t = e, n = ut(), r = Ct(), i = q(() => n.requestExtensions(t.extensionPoint)), a = r.extractDefaultExtensionIds(t.extensionPoint, R(i)), o = q(() => {
|
|
3504
|
+
if (t.extensionPoint.multiple || R(i).length <= 1) return R(i);
|
|
3505
|
+
let e = r.getExtensionPreference(t.extensionPoint.id, a);
|
|
3506
|
+
return e.selectedExtensionIds.length ? [R(i).find((t) => e.selectedExtensionIds.includes(t.id)) || R(i)[0]] : [R(i)[0]];
|
|
3507
|
+
});
|
|
3508
|
+
return (e, t) => (Z(!0), X(W, null, M(o.value, (e) => (Z(), H(u(e.content), va({ key: `custom-component-${e.id}` }, { ref_for: !0 }, e.componentProps ? e.componentProps() : void 0), null, 16))), 128));
|
|
3509
|
+
}
|
|
3510
|
+
}), Ql = {
|
|
3511
|
+
id: "app.files.sidebar.space-details.table",
|
|
3512
|
+
extensionType: "customComponent"
|
|
3513
|
+
}, $l = () => q(() => [Ql]), eu = {
|
|
3514
|
+
id: "oc-space-details-sidebar",
|
|
3515
|
+
class: "p-2"
|
|
3516
|
+
}, tu = {
|
|
3517
|
+
key: 1,
|
|
3518
|
+
class: "bg-role-surface-container rounded-xl flex items-center justify-center p-4 mb-4"
|
|
3519
|
+
}, nu = { key: 0 }, ru = ["src"], iu = { key: 1 }, au = {
|
|
3520
|
+
key: 2,
|
|
3521
|
+
class: "flex items-center oc-space-details-sidebar-members mb-2 text-sm gap-2"
|
|
3522
|
+
}, ou = ["textContent"], su = ["textContent"], cu = ["aria-label"], lu = /* @__PURE__ */ U({
|
|
3523
|
+
__name: "SpaceDetails",
|
|
3524
|
+
props: { showShareIndicators: {
|
|
3525
|
+
type: Boolean,
|
|
3526
|
+
default: !0
|
|
3527
|
+
} },
|
|
3528
|
+
setup(e) {
|
|
3529
|
+
let t = Qn(), n = dr(), { resourceContentsText: r } = yr({ showSizeInformation: !1 }), i = ji(), { $gettext: a, $ngettext: o, current: s } = Q(), { loadPreview: c } = Ai(), { openSideBarPanel: l } = Oi(), u = hi(), { imagesLoading: d } = $(u), f = jr(), p = Rn("resource"), m = z(""), { user: h } = $(t), g = q(() => u.getSpaceMembers(R(p))), _ = q(() => f.linkShares.length), v = q(() => n.areWebDavDetailsShown), y = q(() => !Qr(i, "files-spaces-projects")), b = q(() => `${We(R(p).size, s)}, ${R(r)}`);
|
|
3530
|
+
P(() => R(p).spaceImageData, async () => {
|
|
3531
|
+
m.value = await c({
|
|
3532
|
+
space: R(p),
|
|
3533
|
+
resource: R(p).spaceImageData ? Za(R(p)) : R(p),
|
|
3534
|
+
dimensions: Ge.Tile,
|
|
3535
|
+
processor: xr.enum.fit,
|
|
3536
|
+
cancelRunning: !0,
|
|
3537
|
+
updateStore: !1
|
|
3538
|
+
});
|
|
3539
|
+
}, { immediate: !0 });
|
|
3540
|
+
let x = q(() => R(g).length ? R(g).filter(io).map(({ sharedWith: e }) => e.id === R(h)?.id ? a("%{displayName} (me)", { displayName: e.displayName }) : e.displayName).join(", ") : eo(R(p), f.graphRoles)?.map(({ grantedToV2: e }) => e.user?.id === R(h)?.id ? a("%{displayName} (me)", { displayName: e.user.displayName }) : e.user?.displayName || e.group?.displayName).join(", ")), S = q(() => En(R(p).mdate, s)), C = q(() => R(E) || R(D)), ee = q(() => {
|
|
3541
|
+
if (R(E) && !R(D)) return R(k);
|
|
3542
|
+
if (!R(E) && R(D)) return R(A);
|
|
3543
|
+
switch (R(O)) {
|
|
3544
|
+
case 1: return o("This space has one member and %{linkShareCount} link.", "This space has one member and %{linkShareCount} links.", R(_), { linkShareCount: R(_).toString() });
|
|
3545
|
+
default: return R(_) === 1 ? a("This space has %{memberShareCount} members and one link.", { memberShareCount: R(O).toString() }) : a("This space has %{memberShareCount} members and %{linkShareCount} links.", {
|
|
3546
|
+
memberShareCount: R(O).toString(),
|
|
3547
|
+
linkShareCount: R(_).toString()
|
|
3548
|
+
});
|
|
3549
|
+
}
|
|
3550
|
+
}), w = q(() => a("Open share panel")), T = q(() => a("Open link list in share panel")), te = q(() => a("Open member list in share panel")), E = q(() => R(O) > 0), D = q(() => R(_) > 0), O = q(() => R(g).length), k = q(() => o("This space has %{memberShareCount} member.", "This space has %{memberShareCount} members.", R(O), { memberShareCount: R(O).toString() })), A = q(() => o("%{linkShareCount} link giving access.", "%{linkShareCount} links giving access.", R(_), { linkShareCount: R(_).toString() }));
|
|
3551
|
+
return (t, n) => {
|
|
3552
|
+
let r = I("oc-spinner"), i = I("oc-icon"), o = I("oc-button");
|
|
3553
|
+
return Z(), X("div", eu, [
|
|
3554
|
+
R(d).includes(R(p).id) ? (Z(), H(r, {
|
|
3555
|
+
key: 0,
|
|
3556
|
+
"aria-label": R(a)("Space image is loading")
|
|
3557
|
+
}, null, 8, ["aria-label"])) : (Z(), X("div", tu, [m.value ? (Z(), X("div", nu, [Y("img", {
|
|
3558
|
+
src: m.value,
|
|
3559
|
+
alt: "",
|
|
3560
|
+
class: "h-[160px]"
|
|
3561
|
+
}, null, 8, ru)])) : (Z(), X("div", iu, [J(i, {
|
|
3562
|
+
name: "layout-grid",
|
|
3563
|
+
size: "xxxlarge",
|
|
3564
|
+
class: "space-default-image px-4 py-4"
|
|
3565
|
+
})]))])),
|
|
3566
|
+
e.showShareIndicators && C.value && !R(p).disabled ? (Z(), X("div", au, [
|
|
3567
|
+
E.value ? (Z(), H(o, {
|
|
3568
|
+
key: 0,
|
|
3569
|
+
appearance: "raw",
|
|
3570
|
+
"aria-label": te.value,
|
|
3571
|
+
"no-hover": "",
|
|
3572
|
+
onClick: n[0] ||= (e) => R(l)("space-share")
|
|
3573
|
+
}, {
|
|
3574
|
+
default: F(() => [J(i, {
|
|
3575
|
+
name: "group",
|
|
3576
|
+
size: "small",
|
|
3577
|
+
"fill-type": "line"
|
|
3578
|
+
})]),
|
|
3579
|
+
_: 1
|
|
3580
|
+
}, 8, ["aria-label"])) : K("", !0),
|
|
3581
|
+
D.value ? (Z(), H(o, {
|
|
3582
|
+
key: 1,
|
|
3583
|
+
appearance: "raw",
|
|
3584
|
+
"aria-label": T.value,
|
|
3585
|
+
"no-hover": "",
|
|
3586
|
+
onClick: n[1] ||= (e) => R(l)("space-share")
|
|
3587
|
+
}, {
|
|
3588
|
+
default: F(() => [J(i, {
|
|
3589
|
+
name: "link",
|
|
3590
|
+
size: "small",
|
|
3591
|
+
"fill-type": "line"
|
|
3592
|
+
})]),
|
|
3593
|
+
_: 1
|
|
3594
|
+
}, 8, ["aria-label"])) : K("", !0),
|
|
3595
|
+
Y("p", { textContent: G(ee.value) }, null, 8, ou),
|
|
3596
|
+
J(o, {
|
|
3597
|
+
appearance: "raw",
|
|
3598
|
+
"aria-label": w.value,
|
|
3599
|
+
size: "small",
|
|
3600
|
+
"no-hover": "",
|
|
3601
|
+
onClick: n[2] ||= (e) => R(l)("space-share")
|
|
3602
|
+
}, {
|
|
3603
|
+
default: F(() => [Y("span", {
|
|
3604
|
+
class: "text-sm",
|
|
3605
|
+
textContent: G(R(a)("Show"))
|
|
3606
|
+
}, null, 8, su)]),
|
|
3607
|
+
_: 1
|
|
3608
|
+
}, 8, ["aria-label"])
|
|
3609
|
+
])) : K("", !0),
|
|
3610
|
+
Y("dl", {
|
|
3611
|
+
class: "details-list",
|
|
3612
|
+
"aria-label": R(a)("Overview of the information about the selected space")
|
|
3613
|
+
}, [
|
|
3614
|
+
Y("dt", null, G(R(a)("Last activity")), 1),
|
|
3615
|
+
Y("dd", null, G(S.value), 1),
|
|
3616
|
+
R(p).description ? (Z(), X(W, { key: 0 }, [Y("dt", null, G(R(a)("Subtitle")), 1), Y("dd", null, G(R(p).description), 1)], 64)) : K("", !0),
|
|
3617
|
+
Y("dt", null, G(R(a)("Manager")), 1),
|
|
3618
|
+
Y("dd", null, G(x.value), 1),
|
|
3619
|
+
R(p).disabled ? K("", !0) : (Z(), X(W, { key: 1 }, [Y("dt", null, G(R(a)("Quota")), 1), Y("dd", null, [J(Ul, { "space-quota": R(p).spaceQuota }, null, 8, ["space-quota"])])], 64)),
|
|
3620
|
+
y.value ? (Z(), X(W, { key: 2 }, [Y("dt", null, G(R(a)("Size")), 1), Y("dd", null, G(b.value), 1)], 64)) : K("", !0),
|
|
3621
|
+
v.value ? (Z(), H(Xl, {
|
|
3622
|
+
key: 3,
|
|
3623
|
+
space: R(p)
|
|
3624
|
+
}, null, 8, ["space"])) : K("", !0),
|
|
3625
|
+
J(Zl, { "extension-point": R(Ql) }, null, 8, ["extension-point"])
|
|
3626
|
+
], 8, cu)
|
|
3627
|
+
]);
|
|
3628
|
+
};
|
|
3629
|
+
}
|
|
3630
|
+
}), uu = {
|
|
3631
|
+
id: "oc-spaces-details-multiple-sidebar",
|
|
3632
|
+
class: "p-4 bg-role-surface-container rounded-sm"
|
|
3633
|
+
}, du = { class: "text-center mb-6 rounded-sm" }, fu = ["textContent"], pu = /* @__PURE__ */ U({
|
|
3634
|
+
__name: "SpaceDetailsMultiple",
|
|
3635
|
+
props: { selectedSpaces: {} },
|
|
3636
|
+
setup(e) {
|
|
3637
|
+
let t = Q(), { $gettext: n, $ngettext: r } = t, i = q(() => {
|
|
3638
|
+
let n = 0;
|
|
3639
|
+
return e.selectedSpaces.forEach((e) => {
|
|
3640
|
+
n += e.spaceQuota.total;
|
|
3641
|
+
}), We(n, t.current);
|
|
3642
|
+
}), a = q(() => {
|
|
3643
|
+
let n = 0;
|
|
3644
|
+
return e.selectedSpaces.forEach((e) => {
|
|
3645
|
+
e.disabled || (n += e.spaceQuota.remaining);
|
|
3646
|
+
}), We(n, t.current);
|
|
3647
|
+
}), o = q(() => {
|
|
3648
|
+
let n = 0;
|
|
3649
|
+
return e.selectedSpaces.forEach((e) => {
|
|
3650
|
+
e.disabled || (n += e.spaceQuota.used);
|
|
3651
|
+
}), We(n, t.current);
|
|
3652
|
+
}), s = q(() => e.selectedSpaces.filter((e) => !e.disabled).length), c = q(() => e.selectedSpaces.filter((e) => e.disabled).length), l = q(() => n("Overview of the information about the selected spaces")), u = q(() => r("%{ itemCount } space selected", "%{ itemCount } spaces selected", e.selectedSpaces.length, { itemCount: e.selectedSpaces.length.toString() })), d = q(() => [
|
|
3653
|
+
{
|
|
3654
|
+
term: n("Total quota:"),
|
|
3655
|
+
definition: R(i).toString()
|
|
3656
|
+
},
|
|
3657
|
+
{
|
|
3658
|
+
term: n("Remaining quota:"),
|
|
3659
|
+
definition: R(a).toString()
|
|
3660
|
+
},
|
|
3661
|
+
{
|
|
3662
|
+
term: n("Used quota:"),
|
|
3663
|
+
definition: R(o).toString()
|
|
3664
|
+
},
|
|
3665
|
+
{
|
|
3666
|
+
term: n("Enabled:"),
|
|
3667
|
+
definition: R(s).toString()
|
|
3668
|
+
},
|
|
3669
|
+
{
|
|
3670
|
+
term: n("Disabled:"),
|
|
3671
|
+
definition: R(c).toString()
|
|
3672
|
+
}
|
|
3673
|
+
]);
|
|
3674
|
+
return (e, t) => {
|
|
3675
|
+
let n = I("oc-icon"), r = I("oc-definition-list");
|
|
3676
|
+
return Z(), X("div", uu, [Y("div", du, [Y("div", null, [J(n, {
|
|
3677
|
+
size: "xxlarge",
|
|
3678
|
+
name: "layout-grid"
|
|
3679
|
+
}), Y("p", { textContent: G(u.value) }, null, 8, fu)])]), J(r, {
|
|
3680
|
+
"aria-label": l.value,
|
|
3681
|
+
items: d.value,
|
|
3682
|
+
class: "m-0"
|
|
3683
|
+
}, null, 8, ["aria-label", "items"])]);
|
|
3684
|
+
};
|
|
3685
|
+
}
|
|
3686
|
+
}), mu = U({ name: "SpaceNoSelection" }), hu = { class: "mt-12" }, gu = { class: "flex flex-col items-center space-info text-center" }, _u = ["textContent"];
|
|
3687
|
+
function vu(e, t, n, r, i, a) {
|
|
3688
|
+
let o = I("oc-icon");
|
|
3689
|
+
return Z(), X("div", hu, [Y("div", gu, [J(o, {
|
|
3690
|
+
name: "layout-grid",
|
|
3691
|
+
size: "xxlarge"
|
|
3692
|
+
}), Y("p", { textContent: G(e.$gettext("Select a space to view details")) }, null, 8, _u)])]);
|
|
3693
|
+
}
|
|
3694
|
+
var yu = /* @__PURE__ */ B(mu, [["render", vu]]), bu = U({
|
|
3695
|
+
name: "CompareSaveDialog",
|
|
3696
|
+
props: {
|
|
3697
|
+
originalObject: {
|
|
3698
|
+
type: Object,
|
|
3699
|
+
required: !0
|
|
3700
|
+
},
|
|
3701
|
+
compareObject: {
|
|
3702
|
+
type: Object,
|
|
3703
|
+
required: !0
|
|
3704
|
+
},
|
|
3705
|
+
confirmButtonDisabled: {
|
|
3706
|
+
type: Boolean,
|
|
3707
|
+
default: () => !1
|
|
3708
|
+
}
|
|
3709
|
+
},
|
|
3710
|
+
emits: ["confirm", "revert"],
|
|
3711
|
+
setup() {
|
|
3712
|
+
let e = z(!1), t;
|
|
3713
|
+
return Vt(() => {
|
|
3714
|
+
t = $r.subscribe("sidebar.entity.saved", () => {
|
|
3715
|
+
e.value = !0;
|
|
3716
|
+
});
|
|
3717
|
+
}), ja(() => {
|
|
3718
|
+
$r.unsubscribe("sidebar.entity.saved", t);
|
|
3719
|
+
}), { saved: e };
|
|
3720
|
+
},
|
|
3721
|
+
computed: {
|
|
3722
|
+
unsavedChanges() {
|
|
3723
|
+
return !fi(this.originalObject, this.compareObject);
|
|
3724
|
+
},
|
|
3725
|
+
unsavedChangesText() {
|
|
3726
|
+
return this.unsavedChanges ? this.$gettext("Unsaved changes") : this.$gettext("No changes");
|
|
3727
|
+
}
|
|
3728
|
+
},
|
|
3729
|
+
watch: {
|
|
3730
|
+
unsavedChanges() {
|
|
3731
|
+
this.unsavedChanges && (this.saved = !1);
|
|
3732
|
+
},
|
|
3733
|
+
"originalObject.id": function() {
|
|
3734
|
+
this.saved = !1;
|
|
3735
|
+
}
|
|
3736
|
+
}
|
|
3737
|
+
}), xu = { class: "w-full flex flex-row flex-wrap justify-between items-center" }, Su = {
|
|
3738
|
+
key: 0,
|
|
3739
|
+
class: "flex items-center"
|
|
3740
|
+
}, Cu = ["textContent"], wu = { key: 1 }, Tu = ["textContent"], Eu = ["textContent"];
|
|
3741
|
+
function Du(e, t, n, r, i, a) {
|
|
3742
|
+
let o = I("oc-icon"), s = I("oc-button");
|
|
3743
|
+
return Z(), X("div", xu, [e.saved ? (Z(), X("span", Su, [J(o, { name: "checkbox-circle" }), Y("span", {
|
|
3744
|
+
class: "ml-2",
|
|
3745
|
+
textContent: G(e.$gettext("Changes saved"))
|
|
3746
|
+
}, null, 8, Cu)])) : (Z(), X("span", wu, G(e.unsavedChangesText), 1)), Y("div", null, [J(s, {
|
|
3747
|
+
disabled: !e.unsavedChanges,
|
|
3748
|
+
class: "compare-save-dialog-revert-btn",
|
|
3749
|
+
onClick: t[0] ||= (t) => e.$emit("revert")
|
|
3750
|
+
}, {
|
|
3751
|
+
default: F(() => [Y("span", { textContent: G(e.$gettext("Revert")) }, null, 8, Tu)]),
|
|
3752
|
+
_: 1
|
|
3753
|
+
}, 8, ["disabled"]), J(s, {
|
|
3754
|
+
appearance: "filled",
|
|
3755
|
+
class: "compare-save-dialog-confirm-btn",
|
|
3756
|
+
disabled: !e.unsavedChanges || e.confirmButtonDisabled,
|
|
3757
|
+
onClick: t[1] ||= (t) => e.$emit("confirm")
|
|
3758
|
+
}, {
|
|
3759
|
+
default: F(() => [Y("span", { textContent: G(e.$gettext("Save")) }, null, 8, Eu)]),
|
|
3760
|
+
_: 1
|
|
3761
|
+
}, 8, ["disabled"])])]);
|
|
3762
|
+
}
|
|
3763
|
+
var Ou = /* @__PURE__ */ B(bu, [["render", Du]]), ku = mi(async () => (await import("./TextEditor-CTRIgoeG.js")).default), Au = { class: "flex items-center truncate" }, ju = { class: "truncate" }, Mu = { class: "flex" }, Nu = /* @__PURE__ */ U({
|
|
3764
|
+
__name: "ItemFilter",
|
|
3765
|
+
props: {
|
|
3766
|
+
filterLabel: {},
|
|
3767
|
+
filterName: {},
|
|
3768
|
+
items: {},
|
|
3769
|
+
optionFilterLabel: { default: "" },
|
|
3770
|
+
showOptionFilter: {
|
|
3771
|
+
type: Boolean,
|
|
3772
|
+
default: !1
|
|
3773
|
+
},
|
|
3774
|
+
allowMultiple: {
|
|
3775
|
+
type: Boolean,
|
|
3776
|
+
default: !1
|
|
3777
|
+
},
|
|
3778
|
+
idAttribute: { default: "id" },
|
|
3779
|
+
displayNameAttribute: { default: "name" },
|
|
3780
|
+
filterableAttributes: { default: () => [] },
|
|
3781
|
+
closeOnClick: {
|
|
3782
|
+
type: Boolean,
|
|
3783
|
+
default: !1
|
|
3784
|
+
}
|
|
3785
|
+
},
|
|
3786
|
+
emits: ["selectionChange"],
|
|
3787
|
+
setup(e, { expose: t, emit: n }) {
|
|
3788
|
+
let i = n, a = ji(), o = br(), s = de("filterInputRef"), c = z([]), l = z(e.items), u = de("itemFilterListRef"), d = `q_${e.filterName}`, f = r(d), p = (t) => t[e.idAttribute], m = () => a.push({ query: {
|
|
3789
|
+
...Zi(R(o).query, [d]),
|
|
3790
|
+
...!!R(c).length && { [d]: R(c).reduce((e, t) => (e += `${p(t)}+`, e), "").slice(0, -1) }
|
|
3791
|
+
} }), h = (e) => !!R(c).find((t) => p(t) === p(e)), g = async (t) => {
|
|
3792
|
+
h(t) ? c.value = R(c).filter((e) => p(e) !== p(t)) : (e.allowMultiple || (c.value = []), c.value.push(t)), await m(), i("selectionChange", R(c));
|
|
3793
|
+
}, _ = z(), v = (t, n) => {
|
|
3794
|
+
if (!(n || "").trim()) return t;
|
|
3795
|
+
let r = new po(t, {
|
|
3796
|
+
...an,
|
|
3797
|
+
keys: e.filterableAttributes
|
|
3798
|
+
}).search(n).map((e) => e.item);
|
|
3799
|
+
return t.filter((e) => r.includes(e));
|
|
3800
|
+
}, y = () => {
|
|
3801
|
+
c.value = [], i("selectionChange", R(c)), m();
|
|
3802
|
+
}, b = (e) => {
|
|
3803
|
+
l.value = e;
|
|
3804
|
+
}, x = async () => {
|
|
3805
|
+
b(e.items), await Ra(), R(s)?.focus();
|
|
3806
|
+
}, S;
|
|
3807
|
+
P(_, () => {
|
|
3808
|
+
b(v(e.items, R(_))), R(u) && (S = new bo(R(u)), S.unmark(), S.mark(R(_), {
|
|
3809
|
+
element: "span",
|
|
3810
|
+
className: "mark-highlight"
|
|
3811
|
+
}));
|
|
3812
|
+
});
|
|
3813
|
+
let C = () => {
|
|
3814
|
+
let t = Le(R(f));
|
|
3815
|
+
if (t) {
|
|
3816
|
+
let n = t.split("+");
|
|
3817
|
+
c.value = e.items.filter((e) => n.includes(p(e)));
|
|
3818
|
+
}
|
|
3819
|
+
};
|
|
3820
|
+
return t({ setSelectedItemsBasedOnQuery: C }), Vt(() => {
|
|
3821
|
+
C();
|
|
3822
|
+
}), (t, n) => {
|
|
3823
|
+
let r = I("oc-checkbox"), i = I("oc-icon"), a = I("oc-button"), o = I("oc-list"), d = I("oc-filter-chip");
|
|
3824
|
+
return Z(), X("div", { class: V(["item-filter flex", `item-filter-${e.filterName}`]) }, [J(d, {
|
|
3825
|
+
"filter-label": e.filterLabel,
|
|
3826
|
+
"selected-item-names": c.value.map((t) => t[e.displayNameAttribute]),
|
|
3827
|
+
"close-on-click": e.closeOnClick,
|
|
3828
|
+
onClearFilter: y,
|
|
3829
|
+
onShowDrop: x
|
|
3830
|
+
}, {
|
|
3831
|
+
default: F(() => [e.showOptionFilter && e.filterableAttributes.length ? (Z(), H(R(Qi), {
|
|
3832
|
+
key: 0,
|
|
3833
|
+
ref_key: "filterInputRef",
|
|
3834
|
+
ref: s,
|
|
3835
|
+
modelValue: _.value,
|
|
3836
|
+
"onUpdate:modelValue": n[0] ||= (e) => _.value = e,
|
|
3837
|
+
class: "item-filter-input mb-4 mt-2",
|
|
3838
|
+
autocomplete: "off",
|
|
3839
|
+
label: e.optionFilterLabel === "" ? t.$gettext("Filter list") : e.optionFilterLabel
|
|
3840
|
+
}, null, 8, ["modelValue", "label"])) : K("", !0), Y("div", {
|
|
3841
|
+
ref_key: "itemFilterListRef",
|
|
3842
|
+
ref: u
|
|
3843
|
+
}, [J(o, { class: "item-filter-list" }, {
|
|
3844
|
+
default: F(() => [(Z(!0), X(W, null, M(l.value, (o, s) => (Z(), X("li", {
|
|
3845
|
+
key: s,
|
|
3846
|
+
class: "my-1"
|
|
3847
|
+
}, [J(a, {
|
|
3848
|
+
class: V(["item-filter-list-item flex items-center w-full", {
|
|
3849
|
+
"item-filter-list-item-active": !e.allowMultiple && h(o),
|
|
3850
|
+
"justify-start": e.allowMultiple,
|
|
3851
|
+
"justify-between": !e.allowMultiple
|
|
3852
|
+
}]),
|
|
3853
|
+
"justify-content": "space-between",
|
|
3854
|
+
appearance: "raw",
|
|
3855
|
+
"data-test-value": o[e.displayNameAttribute],
|
|
3856
|
+
onClick: (e) => g(o)
|
|
3857
|
+
}, {
|
|
3858
|
+
default: F(() => [Y("div", Au, [
|
|
3859
|
+
e.allowMultiple ? (Z(), H(r, {
|
|
3860
|
+
key: 0,
|
|
3861
|
+
size: "large",
|
|
3862
|
+
class: "mr-2",
|
|
3863
|
+
label: t.$gettext("Toggle selection"),
|
|
3864
|
+
"model-value": h(o),
|
|
3865
|
+
"label-hidden": !0,
|
|
3866
|
+
"onUpdate:modelValue": (e) => g(o),
|
|
3867
|
+
onClick: n[1] ||= Ki(() => {}, ["stop"])
|
|
3868
|
+
}, null, 8, [
|
|
3869
|
+
"label",
|
|
3870
|
+
"model-value",
|
|
3871
|
+
"onUpdate:modelValue"
|
|
3872
|
+
])) : K("", !0),
|
|
3873
|
+
Y("div", null, [k(t.$slots, "image", { item: o })]),
|
|
3874
|
+
Y("div", ju, [k(t.$slots, "item", { item: o })])
|
|
3875
|
+
]), Y("div", Mu, [!e.allowMultiple && h(o) ? (Z(), H(i, {
|
|
3876
|
+
key: 0,
|
|
3877
|
+
name: "check"
|
|
3878
|
+
})) : K("", !0)])]),
|
|
3879
|
+
_: 2
|
|
3880
|
+
}, 1032, [
|
|
3881
|
+
"class",
|
|
3882
|
+
"data-test-value",
|
|
3883
|
+
"onClick"
|
|
3884
|
+
])]))), 128))]),
|
|
3885
|
+
_: 3
|
|
3886
|
+
})], 512)]),
|
|
3887
|
+
_: 3
|
|
3888
|
+
}, 8, [
|
|
3889
|
+
"filter-label",
|
|
3890
|
+
"selected-item-names",
|
|
3891
|
+
"close-on-click"
|
|
3892
|
+
])], 2);
|
|
3893
|
+
};
|
|
3894
|
+
}
|
|
3895
|
+
}), Pu = U({
|
|
3896
|
+
name: "ItemFilterToggle",
|
|
3897
|
+
props: {
|
|
3898
|
+
filterLabel: {
|
|
3899
|
+
type: String,
|
|
3900
|
+
required: !0
|
|
3901
|
+
},
|
|
3902
|
+
filterName: {
|
|
3903
|
+
type: String,
|
|
3904
|
+
required: !0
|
|
3905
|
+
}
|
|
3906
|
+
},
|
|
3907
|
+
emits: ["toggleFilter"],
|
|
3908
|
+
setup: function(e, { emit: t }) {
|
|
3909
|
+
let n = ji(), i = br(), a = z(!1), o = `q_${e.filterName}`, s = r(o), c = () => n.push({ query: {
|
|
3910
|
+
...Zi(R(i).query, [o]),
|
|
3911
|
+
...R(a) && { [o]: "true" }
|
|
3912
|
+
} });
|
|
3913
|
+
return Vt(() => {
|
|
3914
|
+
Le(R(s)) === "true" && (a.value = !0);
|
|
3915
|
+
}), {
|
|
3916
|
+
queryParam: o,
|
|
3917
|
+
filterActive: a,
|
|
3918
|
+
toggleFilter: async () => {
|
|
3919
|
+
a.value = !R(a), await c(), t("toggleFilter", R(a));
|
|
3920
|
+
}
|
|
3921
|
+
};
|
|
3922
|
+
}
|
|
3923
|
+
});
|
|
3924
|
+
//#endregion
|
|
3925
|
+
//#region src/components/ItemFilterToggle.vue
|
|
3926
|
+
function Fu(e, t, n, r, i, a) {
|
|
3927
|
+
let o = I("oc-filter-chip");
|
|
3928
|
+
return Z(), X("div", { class: V(["item-filter flex", `item-filter-${e.filterName}`]) }, [J(o, {
|
|
3929
|
+
"is-toggle": !0,
|
|
3930
|
+
"filter-label": e.filterLabel,
|
|
3931
|
+
"is-toggle-active": e.filterActive,
|
|
3932
|
+
onToggleFilter: e.toggleFilter,
|
|
3933
|
+
onClearFilter: e.toggleFilter
|
|
3934
|
+
}, null, 8, [
|
|
3935
|
+
"filter-label",
|
|
3936
|
+
"is-toggle-active",
|
|
3937
|
+
"onToggleFilter",
|
|
3938
|
+
"onClearFilter"
|
|
3939
|
+
])], 2);
|
|
3940
|
+
}
|
|
3941
|
+
var Iu = /* @__PURE__ */ B(Pu, [["render", Fu]]), Lu = U({
|
|
3942
|
+
name: "LoadingIndicator",
|
|
3943
|
+
setup() {
|
|
3944
|
+
let e = qt(), t, n, r, i = z(e.isLoading), a = z(e.currentProgress), o = () => {
|
|
3945
|
+
a.value = e.currentProgress, i.value = e.isLoading;
|
|
3946
|
+
}, s = () => {
|
|
3947
|
+
a.value = e.currentProgress;
|
|
3948
|
+
};
|
|
3949
|
+
return Vt(() => {
|
|
3950
|
+
t = $r.subscribe(Fr.add, o), n = $r.subscribe(Fr.remove, o), r = $r.subscribe(Fr.setProgress, s);
|
|
3951
|
+
}), ja(() => {
|
|
3952
|
+
$r.unsubscribe(Fr.add, t), $r.unsubscribe(Fr.remove, n), $r.unsubscribe(Fr.setProgress, r);
|
|
3953
|
+
}), {
|
|
3954
|
+
isLoading: i,
|
|
3955
|
+
currentProgress: a
|
|
3956
|
+
};
|
|
3957
|
+
}
|
|
3958
|
+
}), Ru = {
|
|
3959
|
+
key: 0,
|
|
3960
|
+
id: "oc-loading-indicator",
|
|
3961
|
+
class: "w-full"
|
|
3962
|
+
};
|
|
3963
|
+
function zu(e, t, n, r, i, a) {
|
|
3964
|
+
let o = I("oc-progress");
|
|
3965
|
+
return e.isLoading ? (Z(), X("div", Ru, [J(o, {
|
|
3966
|
+
max: 100,
|
|
3967
|
+
indeterminate: e.currentProgress === null,
|
|
3968
|
+
value: e.currentProgress,
|
|
3969
|
+
size: "xsmall"
|
|
3970
|
+
}, null, 8, ["indeterminate", "value"])])) : K("", !0);
|
|
3971
|
+
}
|
|
3972
|
+
var Bu = /* @__PURE__ */ B(Lu, [["render", zu]]), Vu = { class: "no-content-message flex flex-col justify-center items-center text-center" }, Hu = { class: "text-role-on-surface-variant text-xl" }, Uu = { class: "text-role-on-surface-variant mt-1" }, Wu = /* @__PURE__ */ B(/* @__PURE__ */ U({
|
|
3973
|
+
__name: "NoContentMessage",
|
|
3974
|
+
props: {
|
|
3975
|
+
icon: { default: "" },
|
|
3976
|
+
iconFillType: { default: "fill" },
|
|
3977
|
+
imgSrc: { default: "" }
|
|
3978
|
+
},
|
|
3979
|
+
setup(e) {
|
|
3980
|
+
return (t, n) => {
|
|
3981
|
+
let r = I("oc-image"), i = I("oc-icon");
|
|
3982
|
+
return Z(), X("div", Vu, [
|
|
3983
|
+
e.imgSrc ? (Z(), H(r, {
|
|
3984
|
+
key: 0,
|
|
3985
|
+
width: "120",
|
|
3986
|
+
height: "120",
|
|
3987
|
+
class: "mb-4",
|
|
3988
|
+
src: e.imgSrc,
|
|
3989
|
+
alt: t.$gettext("No content image")
|
|
3990
|
+
}, null, 8, ["src", "alt"])) : K("", !0),
|
|
3991
|
+
e.icon ? (Z(), H(i, {
|
|
3992
|
+
key: 1,
|
|
3993
|
+
name: e.icon,
|
|
3994
|
+
type: "div",
|
|
3995
|
+
size: "xxlarge",
|
|
3996
|
+
"fill-type": e.iconFillType,
|
|
3997
|
+
class: "mb-4"
|
|
3998
|
+
}, null, 8, ["name", "fill-type"])) : K("", !0),
|
|
3999
|
+
Y("div", Hu, [k(t.$slots, "message", {}, void 0, !0)]),
|
|
4000
|
+
Y("div", Uu, [k(t.$slots, "callToAction", {}, void 0, !0)])
|
|
4001
|
+
]);
|
|
4002
|
+
};
|
|
4003
|
+
}
|
|
4004
|
+
}), [["__scopeId", "data-v-02a07e27"]]), Gu = U({
|
|
4005
|
+
props: {
|
|
4006
|
+
pages: {
|
|
4007
|
+
type: Number,
|
|
4008
|
+
required: !0
|
|
4009
|
+
},
|
|
4010
|
+
currentPage: {
|
|
4011
|
+
type: Number,
|
|
4012
|
+
required: !0
|
|
4013
|
+
}
|
|
4014
|
+
},
|
|
4015
|
+
watch: { currentPage: { handler: function() {
|
|
4016
|
+
document.getElementsByClassName("files-view-wrapper")[0]?.scrollTo(0, 0);
|
|
4017
|
+
} } }
|
|
4018
|
+
});
|
|
4019
|
+
//#endregion
|
|
4020
|
+
//#region src/components/Pagination.vue
|
|
4021
|
+
function Ku(e, t, n, r, i, a) {
|
|
4022
|
+
let o = I("oc-pagination");
|
|
4023
|
+
return e.pages > 1 ? (Z(), H(o, {
|
|
4024
|
+
key: 0,
|
|
4025
|
+
pages: e.pages,
|
|
4026
|
+
"current-page": e.currentPage,
|
|
4027
|
+
"max-displayed": 3,
|
|
4028
|
+
"current-route": e.$route,
|
|
4029
|
+
class: "files-pagination flex justify-center my-2"
|
|
4030
|
+
}, null, 8, [
|
|
4031
|
+
"pages",
|
|
4032
|
+
"current-page",
|
|
4033
|
+
"current-route"
|
|
4034
|
+
])) : K("", !0);
|
|
4035
|
+
}
|
|
4036
|
+
var qu = /* @__PURE__ */ B(Gu, [["render", Ku]]), Ju = U({
|
|
4037
|
+
name: "SearchBarFilter",
|
|
4038
|
+
props: { currentFolderAvailable: {
|
|
4039
|
+
type: Boolean,
|
|
4040
|
+
default: !1
|
|
4041
|
+
} },
|
|
4042
|
+
emits: ["update:modelValue"],
|
|
4043
|
+
setup(e, { emit: t }) {
|
|
4044
|
+
let { $gettext: n } = Q(), i = r("useScope"), a = z(), o = z(), s = q(() => n(a.value?.title)), c = q(() => [{
|
|
4045
|
+
id: g.currentFolder,
|
|
4046
|
+
title: n("Current folder"),
|
|
4047
|
+
enabled: e.currentFolderAvailable
|
|
4048
|
+
}, {
|
|
4049
|
+
id: g.allFiles,
|
|
4050
|
+
title: n("All files"),
|
|
4051
|
+
enabled: !0
|
|
4052
|
+
}]);
|
|
4053
|
+
return P(() => e.currentFolderAvailable, () => {
|
|
4054
|
+
if (R(i)) {
|
|
4055
|
+
if (R(i).toString() === "true") {
|
|
4056
|
+
a.value = R(c).find(({ id: e }) => e === g.currentFolder);
|
|
4057
|
+
return;
|
|
4058
|
+
}
|
|
4059
|
+
a.value = R(c).find(({ id: e }) => e === g.allFiles);
|
|
4060
|
+
return;
|
|
4061
|
+
}
|
|
4062
|
+
if (!e.currentFolderAvailable) {
|
|
4063
|
+
a.value = R(c).find(({ id: e }) => e === g.allFiles);
|
|
4064
|
+
return;
|
|
4065
|
+
}
|
|
4066
|
+
if (R(o)) {
|
|
4067
|
+
a.value = R(c).find(({ id: e }) => e === R(o).id);
|
|
4068
|
+
return;
|
|
4069
|
+
}
|
|
4070
|
+
a.value = R(c).find(({ id: e }) => e === g.allFiles);
|
|
4071
|
+
}, { immediate: !0 }), {
|
|
4072
|
+
currentSelection: a,
|
|
4073
|
+
currentSelectionTitle: s,
|
|
4074
|
+
onOptionSelected: (e) => {
|
|
4075
|
+
o.value = e, a.value = e, t("update:modelValue", { value: e });
|
|
4076
|
+
},
|
|
4077
|
+
locationOptions: c
|
|
4078
|
+
};
|
|
4079
|
+
}
|
|
4080
|
+
}), Yu = { key: 0 }, Xu = {
|
|
4081
|
+
key: 0,
|
|
4082
|
+
class: "flex"
|
|
4083
|
+
};
|
|
4084
|
+
function Zu(e, t, n, r, i, a) {
|
|
4085
|
+
let o = I("oc-icon"), s = I("oc-button"), c = I("oc-list"), l = I("oc-filter-chip");
|
|
4086
|
+
return Z(), X("div", {
|
|
4087
|
+
class: "z-[var(--z-index-modal)] absolute top-[50%] transform-[translateY(-50%)] right-0 ml-4 mb-4 mt-0 mr-[34px] float-right",
|
|
4088
|
+
"data-testid": "search-bar-filter",
|
|
4089
|
+
onClick: t[0] ||= Ki(() => {}, ["stop"])
|
|
4090
|
+
}, [e.currentSelection ? (Z(), X("div", Yu, [J(l, {
|
|
4091
|
+
"is-toggle": !1,
|
|
4092
|
+
"is-toggle-active": !1,
|
|
4093
|
+
"filter-label": e.$gettext("Location filter"),
|
|
4094
|
+
"selected-item-names": [e.currentSelectionTitle],
|
|
4095
|
+
class: "oc-search-bar-filter [&_button]:items-center [&_.oc-drop]:w-45",
|
|
4096
|
+
size: "small",
|
|
4097
|
+
"has-active-state": !1,
|
|
4098
|
+
raw: "",
|
|
4099
|
+
"close-on-click": ""
|
|
4100
|
+
}, {
|
|
4101
|
+
default: F(() => [J(c, null, {
|
|
4102
|
+
default: F(() => [(Z(!0), X(W, null, M(e.locationOptions, (t, n) => (Z(), X("li", { key: n }, [J(s, {
|
|
4103
|
+
appearance: t.id === e.currentSelection.id ? "filled" : "raw-inverse",
|
|
4104
|
+
"color-role": t.id === e.currentSelection.id ? "secondaryContainer" : "surface",
|
|
4105
|
+
"no-hover": t.id === e.currentSelection.id,
|
|
4106
|
+
size: "medium",
|
|
4107
|
+
class: "flex items-center w-full py-1 px-2",
|
|
4108
|
+
"justify-content": "space-between",
|
|
4109
|
+
disabled: !t.enabled,
|
|
4110
|
+
"data-test-id": t.id,
|
|
4111
|
+
onClick: (n) => e.onOptionSelected(t)
|
|
4112
|
+
}, {
|
|
4113
|
+
default: F(() => [Y("span", null, G(t.title), 1), t.id === e.currentSelection.id ? (Z(), X("div", Xu, [J(o, { name: "check" })])) : K("", !0)]),
|
|
4114
|
+
_: 2
|
|
4115
|
+
}, 1032, [
|
|
4116
|
+
"appearance",
|
|
4117
|
+
"color-role",
|
|
4118
|
+
"no-hover",
|
|
4119
|
+
"disabled",
|
|
4120
|
+
"data-test-id",
|
|
4121
|
+
"onClick"
|
|
4122
|
+
])]))), 128))]),
|
|
4123
|
+
_: 1
|
|
4124
|
+
})]),
|
|
4125
|
+
_: 1
|
|
4126
|
+
}, 8, ["filter-label", "selected-item-names"])])) : K("", !0)]);
|
|
4127
|
+
}
|
|
4128
|
+
var Qu = /* @__PURE__ */ B(Ju, [["render", Zu]]), $u = { key: 0 }, ed = {
|
|
4129
|
+
key: 0,
|
|
4130
|
+
class: "version-check-loading flex items-center"
|
|
4131
|
+
}, td = ["textContent"], nd = {
|
|
4132
|
+
key: 0,
|
|
4133
|
+
class: "version-check-no-updates flex items-center"
|
|
4134
|
+
}, rd = ["textContent"], id = ["textContent"], ad = /* @__PURE__ */ U({
|
|
4135
|
+
__name: "VersionCheck",
|
|
4136
|
+
setup(e) {
|
|
4137
|
+
let { $gettext: t } = Q(), n = vi(), r = Kn(), { setHasError: i } = r, a = n.capabilities.core["check-for-updates"], { updates: o, isLoading: s, hasError: c } = $(r), l = q(() => a && !R(c)), u = z(!1), d = z(), f = n.status.edition || "rolling", p = n.status.productversion.split("+")[0];
|
|
4138
|
+
return P(() => o, () => {
|
|
4139
|
+
if (R(o)) try {
|
|
4140
|
+
let e = R(o).channels[f].current_version;
|
|
4141
|
+
le(e, p) > 0 && (u.value = !0, d.value = R(o).channels[f]);
|
|
4142
|
+
} catch (e) {
|
|
4143
|
+
console.error(e), i(!0);
|
|
4144
|
+
}
|
|
4145
|
+
}, {
|
|
4146
|
+
immediate: !0,
|
|
4147
|
+
deep: !0
|
|
4148
|
+
}), (e, n) => {
|
|
4149
|
+
let r = I("oc-spinner"), i = I("oc-icon"), a = I("oc-button");
|
|
4150
|
+
return l.value ? (Z(), X("div", $u, [R(s) ? (Z(), X("div", ed, [Y("span", { textContent: G(R(t)("Checking for updates")) }, null, 8, td), J(r, {
|
|
4151
|
+
class: "ml-1",
|
|
4152
|
+
size: "xsmall"
|
|
4153
|
+
})])) : (Z(), X(W, { key: 1 }, [u.value ? (Z(), H(a, {
|
|
4154
|
+
key: 1,
|
|
4155
|
+
class: "version-check-update text-role-on-surface-variant",
|
|
4156
|
+
size: "small",
|
|
4157
|
+
type: "a",
|
|
4158
|
+
href: d.value.url,
|
|
4159
|
+
target: "_blank",
|
|
4160
|
+
"gap-size": "small",
|
|
4161
|
+
appearance: "raw",
|
|
4162
|
+
"no-hover": ""
|
|
4163
|
+
}, {
|
|
4164
|
+
default: F(() => [Y("span", {
|
|
4165
|
+
class: "text-xs",
|
|
4166
|
+
textContent: G(R(t)("Version %{version} available", { version: d.value.current_version }))
|
|
4167
|
+
}, null, 8, id), J(i, {
|
|
4168
|
+
name: "refresh",
|
|
4169
|
+
size: "xsmall",
|
|
4170
|
+
"fill-type": "line"
|
|
4171
|
+
})]),
|
|
4172
|
+
_: 1
|
|
4173
|
+
}, 8, ["href"])) : (Z(), X("div", nd, [Y("span", { textContent: G(R(t)("Up to date")) }, null, 8, rd), J(i, {
|
|
4174
|
+
class: "ml-0.5",
|
|
4175
|
+
name: "checkbox-circle",
|
|
4176
|
+
size: "xsmall",
|
|
4177
|
+
"fill-type": "line"
|
|
4178
|
+
})]))], 64))])) : K("", !0);
|
|
4179
|
+
};
|
|
4180
|
+
}
|
|
4181
|
+
}), od = Ua.dirname;
|
|
4182
|
+
export { be as AVATAR_UPLOAD_MAX_FILE_SIZE_MB, Ta as AccountCapabilitiesSchema, Yt as AccountSchema, N as AccountsSchema, Bl as AccountsSwitch, Ro as ActionMenuDropItem, Ao as ActionMenuItem, on as ApiError, ps as AppBar, Ut as AppLoadingSpinner, $t as AppProviderService, ys as AppTopBar, _c as AppWrapper, vc as AppWrapperRoute, bt as ArchiverService, et as Auth, Vc as AvatarUpload, No as BatchActions, na as Cache, c as ClientService, Vr as ClipboardActions, Ou as CompareSaveDialog, Li as ConflictDialog, Ho as ContextActionMenu, Go as ContextActions, yc as ContextMenuQuickAction, hr as CreateLinkModal, It as CreateShortcutModal, Zl as CustomComponentTarget, Tl as DateFilter, Xs as DatePickerModal, jt as EmojiPickerModal, mt as EventBus, Ws as FileInfo, Na as FilePickerModal, Gs as FileSideBar, S as FolderLoaderFavorites, zt as FolderLoaderSharedViaLink, ka as FolderLoaderSharedWithMe, Xn as FolderLoaderSharedWithOthers, Ca as FolderLoaderSpace, Ia as FolderLoaderTrashbin, In as FolderService, ma as FolderViewModeConstants, qr as HttpClient, A as IdentitySchema, Ge as ImageDimension, Vi as ImageType, Nu as ItemFilter, kl as ItemFilterInline, Iu as ItemFilterToggle, Ir as Key, gt as LimitsSchema, ia as LinkRoleDropdown, Fr as LoadingEventTopics, Bu as LoadingIndicator, Or as LoadingService, ni as MailCapabilitiesSchema, fn as MimeTypesToAppsSchema, kr as Modifier, Wu as NoContentMessage, qu as Pagination, Wt as PaginationConstants, cr as PasswordPolicyService, Mi as PreviewService, d as PrimaryAccountsSchema, xr as ProcessorType, Be as QuotaModal, Ii as QuotaSelect, ze as RESOURCE_MAX_CHARACTER_LENGTH, Dn as RESOURCE_NAME_MAX_BYTES, Br as RawConfigSchema, Yr as RawGroupwareConfigSchema, Qt as ResolveStrategy, Fe as ResourceConflictModal, Dc as ResourceGhostElement, nn as ResourceIcon, De as ResourceLink, y as ResourceListItem, ln as ResourceName, qa as ResourcePreview, jc as ResourceSize, Yc as ResourceTable, ol as ResourceTile, fl as ResourceTiles, Se as ResourceTransfer, Ce as RuntimeError, gi as SaveAsModal, Qu as SearchBarFilter, g as SearchLocationFilterConstants, Is as SideBar, Fs as SideBarPanels, rt as SieveCapabilitiesSchema, Vn as SortConstants, lu as SpaceDetails, pu as SpaceDetailsMultiple, Tr as SpaceImageModal, zs as SpaceInfo, Cn as SpaceMoveInfoModal, yu as SpaceNoSelection, Ul as SpaceQuota, ku as TextEditor, zn as ThemeConfig, dn as TransferType, nc as UnsavedChangesModal, nr as UppyService, Nc as UserAvatar, ad as VersionCheck, is as ViewOptions, gn as VisibilityObserver, Xl as WebDavDetails, ya as WebThemeConfig, la as activeApp, Pr as authContextValues, tn as blobToArrayBuffer, Un as breadcrumbsFromPath, ei as buildRoutes, tr as buildUrl, st as cacheService, hn as canvasToBlob, t as cloneStateObject, le as compareVersions, Ei as concatBreadcrumbs, pn as contextQueryToFileContextProps, _e as contextRouteNameKey, Ue as contextRouteParamsKey, zi as contextRouteQueryKey, oi as convertToMinimalUppyFile, Mt as createDefaultFileIconMapping, ai as createFileRouteOptions, ua as createFolderDummyFile, ot as createLocation, Kr as createLocationCommon, Fa as createLocationPublic, x as createLocationShares, pt as createLocationSpaces, Fn as createLocationTrash, an as defaultFuseOptions, wo as defineWebApplication, Ie as determineResourceTableSortFields, ge as determineResourceTilesSortFields, od as dirname, Nt as encodePath, $r as eventBus, $l as extensionPoints, Ql as fileSideBarSpaceDetailsTableExtensionPoint, m as filterResources, An as focusCheckbox, ga as folderService, Bi as formatDateFromDateTime, Re as formatDateFromHTTP, En as formatDateFromISO, bn as formatDateFromJSDate, Mn as formatDateFromRFC, We as formatFileSize, kt as formatRelativeDateFromDateTime, i as formatRelativeDateFromHTTP, mr as formatRelativeDateFromISO, ra as formatRelativeDateFromJSDate, yi as formatRelativeDateFromRFC, Xe as getBackendVersion, re as getExtensionNavItems, Wi as getLocaleFromLanguage, ye as getParentPaths, n as getSharedAncestorRoute, pr as getSharedDriveItem, wr as getSpacesByType, Ka as getTextByteSize, Ft as getWebVersion, qe as isItemInCurrentFolder, l as isLocationActive, yt as isLocationActiveDirector, $e as isLocationCommonActive, Yn as isLocationPublicActive, Sa as isLocationSharesActive, Qr as isLocationSpacesActive, ha as isLocationTrashActive, Ee as isMacOs, v as isPromiseFulfilled, cn as isPromiseRejected, he as isResourceBeeingMovedToSameLocation, Et as isSameResource, Oa as locationPublicLink, Rt as locationPublicUpload, Gt as locationSharesViaLink, j as locationSharesWithMe, E as locationSharesWithOthers, s as locationSpacesGeneric, Je as objectKeys, Ae as parseVersion, Le as queryItemAsString, ke as renameResource, Ve as resolveFileNameDuplicate, Ha as resourceIconMappingInjectionKey, Tn as routeToContextQuery, Dt as setCurrentUserShareSpacePermissions, He as sortFields, Hi as sortHelper, Pi as sortSpaceMembers, Ri as translateSortFields, h as triggerDownloadWithFilename, gr as useAbility, vt as useActionsShowDetails, sr as useActiveApp, jn as useActiveLocation, Dr as useAppConfig, Jr as useAppDefaults, we as useAppFileHandling, Pt as useAppFolderHandling, Ye as useAppMeta, yn as useAppNavigation, Gr as useAppProviderService, Xi as useAppsStore, dt as useArchiverService, sn as useAuthService, Ti as useAuthStore, Ui as useAvatarsStore, o as useBreadcrumbsFromPath, Da as useCanBeOpenedWithSecureView, ar as useCanListShares, Jn as useCanListVersions, ea as useCanShare, vi as useCapabilityStore, en as useClientService, fe as useClipboardStore, Hn as useConfigStore, Gi as useCopyLink, ae as useCreateSpace, Ni as useCropperKeyboardActions, C as useDeleteWorker, ue as useDocumentTitle, Xr as useDownloadFile, tt as useDriveResolver, ci as useEmbedMode, je as useEventBus, Ct as useExtensionPreferencesStore, ut as useExtensionRegistry, Ji as useFileActionFallbackToDownload, La as useFileActions, _a as useFileActionsCopy, Sr as useFileActionsCopyPermanentLink, a as useFileActionsCreateLink, At as useFileActionsCreateNewFile, xn as useFileActionsCreateNewFolder, Ze as useFileActionsCreateNewShortcut, Ne as useFileActionsCreateSpaceFromResource, pe as useFileActionsDelete, Ci as useFileActionsDeleteResources, wt as useFileActionsDisableSync, it as useFileActionsDownloadArchive, f as useFileActionsDownloadFile, ri as useFileActionsEmptyTrashBin, _t as useFileActionsEnableSync, ne as useFileActionsFavorite, oe as useFileActionsMove, Xt as useFileActionsNavigate, T as useFileActionsOpenShortcut, ba as useFileActionsOpenWithApp, Ea as useFileActionsOpenWithDefault, Bn as useFileActionsPaste, Mr as useFileActionsRename, Rr as useFileActionsRestore, Fi as useFileActionsSaveAs, fr as useFileActionsSetImage, pa as useFileActionsShowActions, li as useFileActionsShowDetails, ki as useFileActionsShowShares, qn as useFileActionsToggleHideShare, Wr as useFileActionsUndoDelete, Zr as useFileListHeaderPosition, qi as useFileRouteReplace, Ba as useFolderLink, O as useGetMatchingSpace, Pa as useGetResourceContext, w as useGroupwareAccountsStore, Ht as useGroupwareConfigStore, pi as useInterceptModifierClick, sa as useIsAppActive, vr as useIsFilesAppActive, e as useIsResourceNameValid, Tt as useIsSearchActive, ft as useIsTopBarSticky, Ln as useKeyboardActions, bi as useLinkTypes, ta as useLoadAvatars, Ai as useLoadPreview, qt as useLoadingService, fa as useLocalStorage, Me as useMessages, Ma as useModals, te as useNavItems, at as useOpenEmptyEditor, un as useOpenWithDefaultApp, xa as usePagination, b as usePasswordPolicyService, Bt as usePasteWorker, Lt as usePreviewService, xt as useRequest, wa as useRequestHeaders, yr as useResourceContents, or as useResourceIndicators, $n as useResourceRouteResolver, ca as useResourceViewContextMenu, ii as useResourceViewDrag, Yi as useResourceViewHelpers, er as useResourceViewSelection, dr as useResourcesStore, Aa as useRestoreWorker, br as useRoute, oa as useRouteMeta, Si as useRouteName, _r as useRouteParam, r as useRouteQuery, Ot as useRouteQueryPersisted, ji as useRouter, Nn as useScrollTo, Wa as useSearch, wi as useSelectedResources, di as useService, jr as useSharesStore, Oi as useSideBar, zr as useSort, se as useSpaceActionsCreate, On as useSpaceActionsDelete, Oe as useSpaceActionsDeleteImage, _n as useSpaceActionsDisable, Sn as useSpaceActionsDuplicate, Pe as useSpaceActionsEditDescription, me as useSpaceActionsEditQuota, Zt as useSpaceActionsEditReadmeContent, Va as useSpaceActionsNavigateToTrash, xe as useSpaceActionsRename, rn as useSpaceActionsRestore, Ke as useSpaceActionsSetIcon, p as useSpaceActionsShowMembers, ht as useSpaceHelpers, ct as useSpacesLoading, hi as useSpacesStore, za as useThemeStore, Pn as useTileSize, Zn as useTokenTimerWorker, Kn as useUpdatesStore, _i as useUpload, Qn as useUserStore, ui as useViewMode, Nr as useViewSize, Er as useViewSizeMax, Ur as useWebWorkersStore, Qe as useWindowOpen };
|