@bimdata/design-system 2.0.0-rc.20 → 2.0.0-rc.22

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.
Files changed (26) hide show
  1. package/package.json +1 -2
  2. package/src/BIMDataComponents/index.js +0 -3
  3. package/src/assets/css/elements/_submenu.css +8 -6
  4. package/vue3-plugin.js +0 -11
  5. package/src/BIMDataComponents/BIMDataModelPreview/BIMDataModelPreview.vue +0 -58
  6. package/src/BIMDataComponents/BIMDataModelPreview/Preview2D.vue +0 -116
  7. package/src/BIMDataComponents/BIMDataModelPreview/Preview3D.vue +0 -75
  8. package/src/BIMDataComponents/BIMDataPDFViewer/BIMDataPDFViewer.vue +0 -115
  9. package/src/BIMDataComponents/BIMDataSafeZoneModal/BIMDataSafeZoneModal.vue +0 -37
  10. package/src/BIMDataComponents/BIMDataSafeZoneModal/_BIMDataSafeZoneModal.scss +0 -39
  11. package/src/BIMDataSmartComponents/BIMDataFileManager/BIMDataFileManager.scss +0 -123
  12. package/src/BIMDataSmartComponents/BIMDataFileManager/BIMDataFileManager.vue +0 -636
  13. package/src/BIMDataSmartComponents/BIMDataFileManager/components/FileCard.vue +0 -433
  14. package/src/BIMDataSmartComponents/BIMDataFileManager/components/MultiLineTextBox/MultiLineTextBox.vue +0 -151
  15. package/src/BIMDataSmartComponents/BIMDataFileManager/components/MultiLineTextBox/Tooltip.vue +0 -46
  16. package/src/BIMDataSmartComponents/BIMDataFileManager/components/PdfPageSelector.vue +0 -161
  17. package/src/BIMDataSmartComponents/BIMDataFileManager/components/PieProgressSpinner.vue +0 -73
  18. package/src/BIMDataSmartComponents/BIMDataFileManager/components/UploadFileButton.vue +0 -72
  19. package/src/BIMDataSmartComponents/BIMDataFileManager/components/modals/DeleteModal.vue +0 -184
  20. package/src/BIMDataSmartComponents/BIMDataFileManager/components/modals/RenameModal.vue +0 -186
  21. package/src/BIMDataSmartComponents/BIMDataFileManager/components/newFolder/NewFolderButton.vue +0 -117
  22. package/src/BIMDataSmartComponents/BIMDataFileManager/components/newFolder/NewFolderForm.vue +0 -165
  23. package/src/BIMDataSmartComponents/BIMDataFileManager/i18n.js +0 -141
  24. package/src/BIMDataSmartComponents/BIMDataFileManager/utils/files.js +0 -89
  25. package/src/BIMDataSmartComponents/BIMDataFileManager/utils/flattenTree.js +0 -16
  26. package/src/BIMDataSmartComponents/index.js +0 -10
@@ -1,117 +0,0 @@
1
- <template>
2
- <div class="folder-creation-button" v-clickaway="close">
3
- <BIMDataButton
4
- width="100%"
5
- :height="height"
6
- color="primary"
7
- fill
8
- radius
9
- :disabled="disabled"
10
- @click="toggle"
11
- >
12
- <BIMDataIcon name="addFolder" size="xs" margin="0 6px 0 0" />
13
- <span>{{ $translate("buttonText") }}</span>
14
- </BIMDataButton>
15
- <transition name="fade">
16
- <NewFolderForm
17
- v-if="showCreationForm"
18
- class="folder-creation-button__form"
19
- :projectId="projectId"
20
- :spaceId="spaceId"
21
- :apiClient="apiClient"
22
- :folder="folder"
23
- @click.native.stop
24
- @close="close"
25
- @success="
26
- close();
27
- $emit(`success`, $event);
28
- "
29
- @error="$emit('error', $event)"
30
- />
31
- </transition>
32
- </div>
33
- </template>
34
-
35
- <script>
36
- import BIMDataIcon from "../../../../BIMDataComponents/BIMDataIcon/BIMDataIcon.vue";
37
- import BIMDataButton from "../../../../BIMDataComponents/BIMDataButton/BIMDataButton.vue";
38
-
39
- import NewFolderForm from "./NewFolderForm.vue";
40
-
41
- import clickaway from "../../../../BIMDataDirectives/click-away.js";
42
-
43
- export default {
44
- components: {
45
- BIMDataIcon,
46
- BIMDataButton,
47
- NewFolderForm,
48
- },
49
- directives: { clickaway },
50
- inject: ["$translate"],
51
- props: {
52
- projectId: {
53
- type: Number,
54
- required: true,
55
- },
56
- spaceId: {
57
- type: Number,
58
- required: true,
59
- },
60
- apiClient: {
61
- type: Object,
62
- required: true,
63
- },
64
- height: {
65
- type: String,
66
- default: "32px",
67
- },
68
- folder: {
69
- type: Object,
70
- },
71
- disabled: {
72
- type: Boolean,
73
- default: false,
74
- },
75
- },
76
- data() {
77
- return {
78
- showCreationForm: false,
79
- };
80
- },
81
- created() {
82
- document.addEventListener("keydown", this.onKeyDown);
83
- },
84
- destroyed() {
85
- document.removeEventListener("keydown", this.onKeyDown);
86
- },
87
- methods: {
88
- onKeyDown(e) {
89
- if (e.key === "Escape") {
90
- this.close();
91
- }
92
- },
93
- toggle() {
94
- this.showCreationForm = !this.showCreationForm;
95
- },
96
- close() {
97
- this.showCreationForm = false;
98
- },
99
- },
100
- };
101
- </script>
102
-
103
- <style scoped lang="scss">
104
- .folder-creation-button {
105
- position: relative;
106
- min-width: 25%;
107
-
108
- &__form {
109
- position: absolute;
110
- top: calc(100% + var(--spacing-unit));
111
- left: 0px;
112
- width: 260px;
113
- box-shadow: var(--box-shadow);
114
- z-index: 1;
115
- }
116
- }
117
- </style>
@@ -1,165 +0,0 @@
1
- <template>
2
- <div class="folder-creation-form">
3
- <div class="folder-creation-form__title">
4
- <BIMDataIcon name="addFolder" size="xs" />
5
- <span>{{ $translate("creationFormTitle") }}</span>
6
- </div>
7
- <BIMDataInput
8
- ref="nameInput"
9
- class="folder-creation-form__input"
10
- :placeholder="$translate('nameInputPlaceholder')"
11
- v-model="name"
12
- :error="hasError"
13
- :errorMessage="$translate('nameInputErrorMessage')"
14
- @keyup.esc.stop="close"
15
- @keyup.enter.stop="submit"
16
- margin="24px 0px"
17
- :loading="loading"
18
- />
19
- <BIMDataButton
20
- class="folder-creation-form__btn-cancel"
21
- width="80px"
22
- ghost
23
- radius
24
- @click.stop="close"
25
- >
26
- {{ $translate("cancel") }}
27
- </BIMDataButton>
28
- <BIMDataButton
29
- class="folder-creation-form__btn-submit"
30
- width="80px"
31
- color="primary"
32
- fill
33
- radius
34
- @click.stop="submit"
35
- >
36
- {{ $translate("submit") }}
37
- </BIMDataButton>
38
- </div>
39
- </template>
40
-
41
- <script>
42
- import BIMDataIcon from "../../../../BIMDataComponents/BIMDataIcon/BIMDataIcon.vue";
43
- import BIMDataInput from "../../../../BIMDataComponents/BIMDataInput/BIMDataInput.vue";
44
- import BIMDataButton from "../../../../BIMDataComponents/BIMDataButton/BIMDataButton.vue";
45
-
46
- export default {
47
- components: {
48
- BIMDataIcon,
49
- BIMDataInput,
50
- BIMDataButton,
51
- },
52
- inject: ["$translate"],
53
- props: {
54
- projectId: {
55
- type: Number,
56
- required: true,
57
- },
58
- spaceId: {
59
- type: Number,
60
- required: true,
61
- },
62
- apiClient: {
63
- type: Object,
64
- required: true,
65
- },
66
- folder: {
67
- type: Object,
68
- required: true,
69
- },
70
- },
71
- data() {
72
- return {
73
- name: "",
74
- hasError: false,
75
- loading: false,
76
- };
77
- },
78
- created() {
79
- document.addEventListener("keydown", this.onKeyDown);
80
- },
81
- mounted() {
82
- this.timeoutId = setTimeout(() => this.$refs.nameInput.focus(), 200);
83
- },
84
- destroyed() {
85
- document.removeEventListener("keydown", this.onKeyDown);
86
- clearTimeout(this.timeoutId);
87
- },
88
- methods: {
89
- onKeyDown(e) {
90
- if (e.key === "Enter") {
91
- this.submit();
92
- }
93
- },
94
- reset() {
95
- this.name = "";
96
- this.hasError = false;
97
- },
98
- close() {
99
- this.reset();
100
- this.$emit("close");
101
- },
102
- async submit() {
103
- if (this.name) {
104
- this.loading = true;
105
- try {
106
- const folderData = {
107
- parent_id: this.folder.id,
108
- name: this.name,
109
- };
110
- const folder = await this.apiClient.collaborationApi.createFolder(
111
- this.spaceId,
112
- this.projectId,
113
- folderData
114
- );
115
- this.$emit("success", folder);
116
- } catch (error) {
117
- this.$emit("error", error);
118
- } finally {
119
- this.reset();
120
- this.loading = false;
121
- }
122
- } else {
123
- this.$refs.nameInput.focus();
124
- this.hasError = true;
125
- }
126
- },
127
- },
128
- };
129
- </script>
130
-
131
- <style scoped lang="scss">
132
- .folder-creation-form {
133
- padding: var(--spacing-unit);
134
- background-color: var(--color-white);
135
-
136
- display: flex;
137
- flex-wrap: wrap;
138
-
139
- &__title {
140
- width: 100%;
141
- display: flex;
142
- align-items: flex-end;
143
- gap: calc(var(--spacing-unit)) / 2;
144
- color: var(--color-primary);
145
-
146
- span {
147
- font-size: small;
148
- margin-left: var(--spacing-unit) / 2;
149
- }
150
- }
151
-
152
- &__input {
153
- width: 100%;
154
- font-size: 1rem;
155
- }
156
-
157
- &__btn-cancel {
158
- margin-left: auto;
159
- }
160
-
161
- &__btn-submit {
162
- margin-left: var(--spacing-unit);
163
- }
164
- }
165
- </style>
@@ -1,141 +0,0 @@
1
- const en = {
2
- creationFormTitle: "Create folder",
3
- renameFormPlaceholder: "Folder/File name",
4
- nameInputPlaceholder: "Folder name",
5
- emptyFolder: "This folder is empty",
6
- newFolderSuccess: "New folder created",
7
- renameFolderSuccess: "Folder renamed",
8
- deleteFolderSuccess: "Folder deleted",
9
- newFileSuccess: "File added",
10
- renameFileSuccess: "File renamed",
11
- deleteFileSuccess: "File deleted",
12
- nameInputErrorMessage: "Invalid name",
13
- cancel: "Cancel",
14
- submit: "Submit",
15
- buttonText: "New folder",
16
- addFileButtonText: "Upload a file",
17
- rename: "Rename",
18
- view: "View",
19
- download: "Download",
20
- delete: "Delete",
21
- deleteTitle: "Deleting Files",
22
- deleteDetail:
23
- "You are about to permanently delete the following files / folders",
24
- dmsRoot: "Root of the project's DMS",
25
- validate: "Validate",
26
- back: "Back",
27
- pdfPageSelectorTitle: "Select a page",
28
- };
29
-
30
- const fr = {
31
- creationFormTitle: "Créer un dossier",
32
- renameFormPlaceholder: "Nom du fichier/dosier",
33
- nameInputPlaceholder: "Nom du dossier",
34
- emptyFolder: "Ce dossier est vide",
35
- newFolderSuccess: "Nouveau dossier créé",
36
- renameFolderSuccess: "Dossier renommé",
37
- deleteFolderSuccess: "Dossier supprimé",
38
- newFileSuccess: "Fichier ajouté",
39
- renameFileSuccess: "Fichier renommé",
40
- deleteFileSuccess: "Fichier supprimé",
41
- nameInputErrorMessage: "Nom invalide",
42
- cancel: "Annuler",
43
- submit: "Valider",
44
- buttonText: "Nouveau dossier",
45
- addFileButtonText: "Charger un fichier",
46
- rename: "Renommer",
47
- view: "Voir",
48
- download: "Télécharger",
49
- delete: "Supprimer",
50
- deleteTitle: "Supression de fichiers",
51
- deleteDetail:
52
- "Vous êtes sur le point de supprimer définitivement les fichiers/dossiers suivants",
53
- dmsRoot: "Racine de la GED du projet",
54
- validate: "Valider",
55
- back: "Retour",
56
- pdfPageSelectorTitle: "Sélectionner une page",
57
- };
58
-
59
- const es = {
60
- creationFormTitle: "Crear un archivo",
61
- renameFormPlaceholder: "Nombre de archivo / carpeta",
62
- nameInputPlaceholder: "Nombre de la carpeta",
63
- emptyFolder: "Esta carpeta está vacía",
64
- newFolderSuccess: "Nueva carpeta creada",
65
- renameFolderSuccess: "Carpeta renombrada",
66
- deleteFolderSuccess: "Carpeta eliminada",
67
- newFileSuccess: "Archivo agregado",
68
- renameFileSuccess: "Archivo renombrado",
69
- deleteFileSuccess: "Archivo eliminado",
70
- nameInputErrorMessage: "Nombre inválida",
71
- cancel: "Cancelar",
72
- submit: "Validar",
73
- buttonText: "Carpeta nueva",
74
- addFileButtonText: "Cargar un archivo",
75
- rename: "Renombrar",
76
- view: "Ver",
77
- download: "Descargar",
78
- delete: "Borrar",
79
- deleteTitle: "Eliminar archivos",
80
- deleteDetail:
81
- "Está a punto de eliminar permanentemente los siguientes archivos / carpetas",
82
- };
83
-
84
- const de = {
85
- creationFormTitle: "Ordner erstellen",
86
- renameFormPlaceholder: "Datei- / Ordnernam",
87
- nameInputPlaceholder: "Ordnername",
88
- emptyFolder: "Dieser Ordner ist leer",
89
- newFolderSuccess: "Neuer Ordner erstellt",
90
- renameFolderSuccess: "Umbenannter Ordner",
91
- deleteFolderSuccess: "Ordner gelöscht",
92
- newFileSuccess: "Datei hinzugefügt",
93
- renameFileSuccess: "Umbenannte Datei",
94
- deleteFileSuccess: "Datei gelöscht",
95
- nameInputErrorMessage: "Ungültiger name",
96
- cancel: "Abbrechen",
97
- submit: "Bestätigen",
98
- buttonText: "Neuer Ordner",
99
- addFileButtonText: "Datei laden",
100
- rename: "Umbenennen",
101
- view: "Sehen",
102
- download: "Herunterladen",
103
- delete: "Löschen",
104
- deleteTitle: "Dateien löschen",
105
- deleteDetail:
106
- "Sie sind im Begriff, die folgenden Dateien / Ordner endgültig zu löschen",
107
- };
108
-
109
- const it = {
110
- creationFormTitle: "Crea una cartella",
111
- renameFormPlaceholder: "Nome file/cartella",
112
- nameInputPlaceholder: "Nome della cartella",
113
- emptyFolder: "Questa cartella è vuota",
114
- newFolderSuccess: "Nuova cartella creata",
115
- renameFolderSuccess: "Cartella rinominata",
116
- deleteFolderSuccess: "Cartella eliminata",
117
- newFileSuccess: "File aggiunto",
118
- renameFileSuccess: "File rinominato",
119
- deleteFileSuccess: "File cancellato",
120
- nameInputErrorMessage: "Nome non valido",
121
- cancel: "Annulla",
122
- submit: "Invia",
123
- buttonText: "Nuova cartella",
124
- addFileButtonText: "Carica un file",
125
- rename: "Rinominare",
126
- view: "Vedere",
127
- download: "Scaricare",
128
- delete: "Cancellare",
129
- deleteTitle: "Eliminazione di file",
130
- deleteDetail: "Stai per eliminare definitivamente i seguenti file/cartelle",
131
- };
132
-
133
- const trads = {
134
- en,
135
- fr,
136
- es,
137
- de,
138
- it,
139
- };
140
-
141
- export default trads;
@@ -1,89 +0,0 @@
1
- const FOLDER_TYPE = "Folder";
2
-
3
- function delay(ms) {
4
- return new Promise(resolve => setTimeout(resolve, ms));
5
- }
6
-
7
- async function download({ name, url }) {
8
- const link = document.createElement("a");
9
- link.style.display = "none";
10
- link.download = name;
11
- link.href = url;
12
- document.body.append(link);
13
- link.click();
14
- await delay(100);
15
- link.remove();
16
- await delay(500);
17
- }
18
-
19
- function segregate(files) {
20
- const folders = [];
21
- const documents = [];
22
- for (const file of files) {
23
- if (file.nature === FOLDER_TYPE) {
24
- folders.push(file);
25
- } else {
26
- documents.push(file);
27
- }
28
- }
29
- return {
30
- folders,
31
- documents,
32
- };
33
- }
34
-
35
- function getArchiveUrl(files, apiInfos) {
36
- const {
37
- projectId,
38
- spaceId,
39
- accessToken,
40
- apiUrl = "https://api.bimdata.io",
41
- } = apiInfos;
42
-
43
- const baseURL = getUrlFromAPIUrl(apiUrl);
44
-
45
- const { folders, documents } = segregate(files);
46
- let url = "";
47
- if (folders.length > 0 || documents.length > 0) {
48
- url += `${baseURL}/cloud/${spaceId}/project/${projectId}?`;
49
- url += `accessToken=${accessToken}&`;
50
- url += folders.map(f => `folderId[]=${f.id}`).join("&");
51
- url += folders.length > 0 && documents.length > 0 ? "&" : "";
52
- url += documents.map(f => `documentId[]=${f.id}`).join("&");
53
- }
54
- return url;
55
- }
56
-
57
- function getUrlFromAPIUrl(apiUrl) {
58
- const url = new URL(apiUrl);
59
- const hostname = url.hostname;
60
- let env = "";
61
- const [apiEnv, ...domainPath] = hostname.split(".");
62
- const domain = domainPath.join(".");
63
- if (apiEnv.includes("-staging")) {
64
- env = "-staging";
65
- } else if (apiEnv.includes("-next")) {
66
- env = "-next";
67
- }
68
- return url.protocol + "//archive" + env + "." + domain;
69
- }
70
-
71
- async function downloadFiles(files, apiInfos = {}) {
72
- try {
73
- if (files.length === 0) {
74
- return;
75
- }
76
- let downloadUrl = null;
77
- const downloadName = files[0].name;
78
- if (files.length === 1 && files[0].nature !== FOLDER_TYPE) {
79
- downloadUrl = files[0].file;
80
- } else {
81
- downloadUrl = getArchiveUrl(files, apiInfos);
82
- }
83
- return await download({ name: downloadName, url: downloadUrl });
84
- } catch (error) {
85
- throw new Error(error);
86
- }
87
- }
88
-
89
- export { downloadFiles };
@@ -1,16 +0,0 @@
1
- function getFlattenTree(entity) {
2
- return [entity, ...getDescendants(entity)];
3
- }
4
-
5
- function getDescendants(entity) {
6
- if (entity.children && entity.children.length > 0) {
7
- return [
8
- ...entity.children,
9
- ...entity.children.flatMap(child => getDescendants(child)),
10
- ];
11
- } else {
12
- return [];
13
- }
14
- }
15
-
16
- export default getFlattenTree;
@@ -1,10 +0,0 @@
1
- import "../assets/css/variables.css";
2
-
3
- import "../assets/css/utilities/_colors.css";
4
- import "../assets/css/utilities/_flex.css";
5
- import "../assets/css/utilities/_grid.css";
6
- import "../assets/css/utilities/_list.css";
7
- import "../assets/css/utilities/_spacing.css";
8
- import "../assets/css/utilities/_text.css";
9
-
10
- export { default as BIMDataFileManager } from "./BIMDataFileManager/BIMDataFileManager.vue";