@antcde/component-library 0.1.12 → 0.1.14-rc.0cf856e
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/index.js +18737 -17167
- package/dist/types/components/BaseAntCard.vue.d.ts +14 -6
- package/dist/types/components/BaseAntInput.vue.d.ts +13 -5
- package/dist/types/components/BaseAppCard.vue.d.ts +18 -1
- package/dist/types/components/BaseClickableIcon.vue.d.ts +1 -1
- package/dist/types/components/BaseConfirmDialog.vue.d.ts +16 -7
- package/dist/types/components/BaseDeleteDialog.vue.d.ts +17 -9
- package/dist/types/components/BaseDialog.vue.d.ts +12 -4
- package/dist/types/components/BaseLimitedButton.vue.d.ts +45 -0
- package/dist/types/components/BaseResizePanel.vue.d.ts +12 -12
- package/dist/types/components/BulkLabelsMenu.vue.d.ts +33 -0
- package/dist/types/components/StackedLabels/_LabelsMenuCard.vue.d.ts +15 -0
- package/dist/types/components/StackedLabels/index.vue.d.ts +26 -0
- package/dist/types/components/TasksFlow/components/_dropzoneBackground.vue.d.ts +11 -3
- package/dist/types/components/TasksFlow/composables/useTaskFlow.d.ts +7 -7
- package/dist/types/components/TasksFlow/composables/useTaskFlowDragDrop.d.ts +3 -3
- package/dist/types/index.d.ts +5 -1
- package/package.json +47 -58
- package/dist/component-library.css +0 -1
- package/lib/DocumentManager/DocumentDrop.vue +0 -74
- package/lib/DocumentManager/DocumentManager.vue +0 -571
- package/lib/DocumentManager/hooks/useDms.ts +0 -172
- package/lib/DocumentManager/index.ts +0 -3
- package/lib/DocumentManager/lang/translations/de.json +0 -36
- package/lib/DocumentManager/lang/translations/en.json +0 -38
- package/lib/DocumentManager/lang/translations/nl.json +0 -36
- package/lib/DocumentManager/utils.ts +0 -16
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
import type { DmsFile, FileData, UploadFinishPayload } from '@antcde/connect-ts'
|
|
2
|
-
import type { UseCommsClient } from '@antcde/vue-utils'
|
|
3
|
-
import axios from 'axios'
|
|
4
|
-
import { computed, ref } from 'vue'
|
|
5
|
-
|
|
6
|
-
export function useDms(client: UseCommsClient) {
|
|
7
|
-
const data = ref<FileData | null>(null)
|
|
8
|
-
const isFetching = ref(false)
|
|
9
|
-
const isCreating = ref(false)
|
|
10
|
-
const isUploading = ref(false)
|
|
11
|
-
const isDeleting = ref(false)
|
|
12
|
-
|
|
13
|
-
const connect = client?.connect
|
|
14
|
-
const project = computed(() => client?.context?.value?.project?.id)
|
|
15
|
-
|
|
16
|
-
async function getFileUrl(token: string) {
|
|
17
|
-
if (!project.value || !connect) {
|
|
18
|
-
return
|
|
19
|
-
}
|
|
20
|
-
return await connect.dms.getFileUrl(token, project.value)
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
async function fetchData(token?: string) {
|
|
24
|
-
if (!project?.value || !connect) {
|
|
25
|
-
return
|
|
26
|
-
}
|
|
27
|
-
const fetch = () => token
|
|
28
|
-
? connect.dms.getFilesByToken(token, project.value!)
|
|
29
|
-
: connect.dms.getProjectFiles(project.value!)
|
|
30
|
-
|
|
31
|
-
try {
|
|
32
|
-
isFetching.value = true
|
|
33
|
-
data.value = await fetch()
|
|
34
|
-
}
|
|
35
|
-
finally {
|
|
36
|
-
isFetching.value = false
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function updateFiles(payload: DmsFile | DmsFile[]) {
|
|
41
|
-
const { children = [], file, breadcrumbs = [] } = data.value || {}
|
|
42
|
-
const newItems = Array.isArray(payload) ? payload : [payload]
|
|
43
|
-
data.value = {
|
|
44
|
-
...{ file, breadcrumbs },
|
|
45
|
-
children: children.concat(newItems),
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
async function createFolder({ name, parentId }: { name: string, parentId?: string }) {
|
|
50
|
-
if (!project.value || !connect) {
|
|
51
|
-
return
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
const createFolder = () =>
|
|
55
|
-
parentId
|
|
56
|
-
? connect.dms.createNestedFolder(parentId, project.value!, { name })
|
|
57
|
-
: connect.dms.createFolderForLicence(project.value!, { name })
|
|
58
|
-
|
|
59
|
-
try {
|
|
60
|
-
isCreating.value = true
|
|
61
|
-
const result = await createFolder()
|
|
62
|
-
if (result) {
|
|
63
|
-
updateFiles(result)
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
finally {
|
|
67
|
-
isCreating.value = false
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
async function uploadFile({ token, data }: { token?: string, data: FormData }) {
|
|
72
|
-
if (!project.value || !connect) {
|
|
73
|
-
return
|
|
74
|
-
}
|
|
75
|
-
const uploadFiles = () => connect.dms.uploadFilesToFolder(token, project.value!, data)
|
|
76
|
-
|
|
77
|
-
try {
|
|
78
|
-
isUploading.value = true
|
|
79
|
-
const result = await uploadFiles()
|
|
80
|
-
if (result) {
|
|
81
|
-
updateFiles(result)
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
finally {
|
|
85
|
-
isUploading.value = false
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
async function uploadFileS3({ token, files }: { token?: string, files: FileList }) {
|
|
90
|
-
if (!project.value || !connect) {
|
|
91
|
-
return
|
|
92
|
-
}
|
|
93
|
-
const getUploadUrl = (fileName: string) => connect.dms.getUploadUrl(project.value!, fileName)
|
|
94
|
-
const uploadFilesFinish = (files: UploadFinishPayload[]) => connect.dms.uploadFilesFinish(token, project.value!, files)
|
|
95
|
-
|
|
96
|
-
try {
|
|
97
|
-
isUploading.value = true
|
|
98
|
-
|
|
99
|
-
const filesToMove = (await Promise.all(Array.from(files).map(async (file) => {
|
|
100
|
-
try {
|
|
101
|
-
const response = await getUploadUrl(file.name)
|
|
102
|
-
console.log({ response }, response.config.url, response.key)
|
|
103
|
-
|
|
104
|
-
const uploadS3Res = await axios.put(response.config.url, file, {
|
|
105
|
-
headers: {
|
|
106
|
-
'Content-Type': file.type, // Ensure the Content-Type matches
|
|
107
|
-
},
|
|
108
|
-
})
|
|
109
|
-
|
|
110
|
-
if (uploadS3Res.status === 200) {
|
|
111
|
-
return {
|
|
112
|
-
key: response.key,
|
|
113
|
-
filename: file.name,
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
else {
|
|
117
|
-
// show notification with error on file upload
|
|
118
|
-
console.error(`Error on file upload: ${file.name}`, uploadS3Res)
|
|
119
|
-
}
|
|
120
|
-
return null
|
|
121
|
-
}
|
|
122
|
-
catch (e: any) {
|
|
123
|
-
console.error(`Error on file upload`, e)
|
|
124
|
-
return null
|
|
125
|
-
}
|
|
126
|
-
}))).filter(Boolean) as {
|
|
127
|
-
key: string
|
|
128
|
-
filename: string
|
|
129
|
-
}[]
|
|
130
|
-
|
|
131
|
-
if (filesToMove.length) {
|
|
132
|
-
const result = await uploadFilesFinish(filesToMove)
|
|
133
|
-
if (result) {
|
|
134
|
-
updateFiles(result)
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
finally {
|
|
139
|
-
isUploading.value = false
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
async function deleteFile(token?: string) {
|
|
144
|
-
if (!project.value || !token || !connect) {
|
|
145
|
-
return
|
|
146
|
-
}
|
|
147
|
-
try {
|
|
148
|
-
isDeleting.value = true
|
|
149
|
-
const res = await connect.dms.deleteFile(token, project.value)
|
|
150
|
-
if (res && data?.value?.children) {
|
|
151
|
-
data.value.children = data.value.children.filter(c => c.token !== token)
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
finally {
|
|
155
|
-
isDeleting.value = false
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
return {
|
|
159
|
-
data,
|
|
160
|
-
isFetching,
|
|
161
|
-
isCreating,
|
|
162
|
-
isUploading,
|
|
163
|
-
isDeleting,
|
|
164
|
-
// API
|
|
165
|
-
createFolder,
|
|
166
|
-
deleteFile,
|
|
167
|
-
getFileUrl,
|
|
168
|
-
fetchData,
|
|
169
|
-
uploadFile,
|
|
170
|
-
uploadFileS3,
|
|
171
|
-
}
|
|
172
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"dms": {
|
|
3
|
-
"fileName": "Dateiname",
|
|
4
|
-
"owner": "Eigentümer",
|
|
5
|
-
"lastUpdate": "Letztes Update",
|
|
6
|
-
"root": "Root",
|
|
7
|
-
"createFolder": "Ordner Erstellen",
|
|
8
|
-
"uploadFiles": "Dateien Hochladen",
|
|
9
|
-
"deleteFolder": "Ordner Löschen",
|
|
10
|
-
"hideInfo": "Info Ausblenden",
|
|
11
|
-
"showInfo": "Info Anzeigen",
|
|
12
|
-
"deleteConfirmationTitle": "Löschbestätigung",
|
|
13
|
-
"selectProjectToViewFiles": "Wählen Sie ein Projekt aus, um Dateien anzuzeigen",
|
|
14
|
-
"preview": "Vorschau",
|
|
15
|
-
"download": "Herunterladen",
|
|
16
|
-
"delete": "Löschen",
|
|
17
|
-
"info": "Info",
|
|
18
|
-
"information": "Information",
|
|
19
|
-
"infoLabel": "Info:",
|
|
20
|
-
"ownerLabel": "Eigentümer:",
|
|
21
|
-
"createdLabel": "Erstellt:",
|
|
22
|
-
"updatedLabel": "Aktualisiert:",
|
|
23
|
-
"versionsLabel": "Versionen:",
|
|
24
|
-
"version1": "Version 1",
|
|
25
|
-
"version2": "Version 2",
|
|
26
|
-
"createNewFolder": "Neuen Ordner erstellen",
|
|
27
|
-
"folderName": "Ordnername",
|
|
28
|
-
"system": {
|
|
29
|
-
"actions": "Aktionen",
|
|
30
|
-
"buttons": {
|
|
31
|
-
"cancel": "Abbrechen",
|
|
32
|
-
"save": "Speichern"
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"dms": {
|
|
3
|
-
"fileName": "File Name",
|
|
4
|
-
"owner": "Owner",
|
|
5
|
-
"lastUpdate": "Last Update",
|
|
6
|
-
"root": "Root",
|
|
7
|
-
"createFolder": "Create Folder",
|
|
8
|
-
"uploadFiles": "Upload Files",
|
|
9
|
-
"deleteFolder": "Delete Folder",
|
|
10
|
-
"hideInfo": "Hide Info",
|
|
11
|
-
"showInfo": "Show Info",
|
|
12
|
-
"deleteConfirmationTitle": "Delete Confirmation",
|
|
13
|
-
"selectProjectToViewFiles": "Select a project to view files",
|
|
14
|
-
"preview": "Preview",
|
|
15
|
-
"download": "Download",
|
|
16
|
-
"delete": "Delete",
|
|
17
|
-
"info": "Info",
|
|
18
|
-
"information": "Information",
|
|
19
|
-
"infoLabel": "Info:",
|
|
20
|
-
"ownerLabel": "Owner:",
|
|
21
|
-
"createdLabel": "Created:",
|
|
22
|
-
"updatedLabel": "Updated:",
|
|
23
|
-
"versionsLabel": "Versions:",
|
|
24
|
-
"version1": "Version 1",
|
|
25
|
-
"version2": "Version 2",
|
|
26
|
-
"createNewFolder": "Create new folder",
|
|
27
|
-
"folderName": "Folder name",
|
|
28
|
-
"dragUploadFiles": "Drag here to upload files",
|
|
29
|
-
"loadingFiles": "Uploading files...",
|
|
30
|
-
"system": {
|
|
31
|
-
"actions": "Actions",
|
|
32
|
-
"buttons": {
|
|
33
|
-
"cancel": "Cancel",
|
|
34
|
-
"save": "Save"
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"dms": {
|
|
3
|
-
"fileName": "Bestandsnaam",
|
|
4
|
-
"owner": "Eigenaar",
|
|
5
|
-
"lastUpdate": "Laatste Update",
|
|
6
|
-
"root": "Root",
|
|
7
|
-
"createFolder": "Map Maken",
|
|
8
|
-
"uploadFiles": "Bestanden Uploaden",
|
|
9
|
-
"deleteFolder": "Map Verwijderen",
|
|
10
|
-
"hideInfo": "Info Verbergen",
|
|
11
|
-
"showInfo": "Info Tonen",
|
|
12
|
-
"deleteConfirmationTitle": "Bevestiging Verwijdering",
|
|
13
|
-
"selectProjectToViewFiles": "Selecteer een project om bestanden te bekijken",
|
|
14
|
-
"preview": "Voorbeeld",
|
|
15
|
-
"download": "Downloaden",
|
|
16
|
-
"delete": "Verwijderen",
|
|
17
|
-
"info": "Info",
|
|
18
|
-
"information": "Informatie",
|
|
19
|
-
"infoLabel": "Info:",
|
|
20
|
-
"ownerLabel": "Eigenaar:",
|
|
21
|
-
"createdLabel": "Gemaakt:",
|
|
22
|
-
"updatedLabel": "Bijgewerkt:",
|
|
23
|
-
"versionsLabel": "Versies:",
|
|
24
|
-
"version1": "Versie 1",
|
|
25
|
-
"version2": "Versie 2",
|
|
26
|
-
"createNewFolder": "Nieuwe map maken",
|
|
27
|
-
"folderName": "Mapnaam",
|
|
28
|
-
"system": {
|
|
29
|
-
"actions": "Acties",
|
|
30
|
-
"buttons": {
|
|
31
|
-
"cancel": "Annuleren",
|
|
32
|
-
"save": "Opslaan"
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|