@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.
- package/package.json +1 -2
- package/src/BIMDataComponents/index.js +0 -3
- package/src/assets/css/elements/_submenu.css +8 -6
- package/vue3-plugin.js +0 -11
- package/src/BIMDataComponents/BIMDataModelPreview/BIMDataModelPreview.vue +0 -58
- package/src/BIMDataComponents/BIMDataModelPreview/Preview2D.vue +0 -116
- package/src/BIMDataComponents/BIMDataModelPreview/Preview3D.vue +0 -75
- package/src/BIMDataComponents/BIMDataPDFViewer/BIMDataPDFViewer.vue +0 -115
- package/src/BIMDataComponents/BIMDataSafeZoneModal/BIMDataSafeZoneModal.vue +0 -37
- package/src/BIMDataComponents/BIMDataSafeZoneModal/_BIMDataSafeZoneModal.scss +0 -39
- package/src/BIMDataSmartComponents/BIMDataFileManager/BIMDataFileManager.scss +0 -123
- package/src/BIMDataSmartComponents/BIMDataFileManager/BIMDataFileManager.vue +0 -636
- package/src/BIMDataSmartComponents/BIMDataFileManager/components/FileCard.vue +0 -433
- package/src/BIMDataSmartComponents/BIMDataFileManager/components/MultiLineTextBox/MultiLineTextBox.vue +0 -151
- package/src/BIMDataSmartComponents/BIMDataFileManager/components/MultiLineTextBox/Tooltip.vue +0 -46
- package/src/BIMDataSmartComponents/BIMDataFileManager/components/PdfPageSelector.vue +0 -161
- package/src/BIMDataSmartComponents/BIMDataFileManager/components/PieProgressSpinner.vue +0 -73
- package/src/BIMDataSmartComponents/BIMDataFileManager/components/UploadFileButton.vue +0 -72
- package/src/BIMDataSmartComponents/BIMDataFileManager/components/modals/DeleteModal.vue +0 -184
- package/src/BIMDataSmartComponents/BIMDataFileManager/components/modals/RenameModal.vue +0 -186
- package/src/BIMDataSmartComponents/BIMDataFileManager/components/newFolder/NewFolderButton.vue +0 -117
- package/src/BIMDataSmartComponents/BIMDataFileManager/components/newFolder/NewFolderForm.vue +0 -165
- package/src/BIMDataSmartComponents/BIMDataFileManager/i18n.js +0 -141
- package/src/BIMDataSmartComponents/BIMDataFileManager/utils/files.js +0 -89
- package/src/BIMDataSmartComponents/BIMDataFileManager/utils/flattenTree.js +0 -16
- package/src/BIMDataSmartComponents/index.js +0 -10
|
@@ -1,433 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="file-card" @click="onClick">
|
|
3
|
-
<div
|
|
4
|
-
class="file-card__content"
|
|
5
|
-
:class="{
|
|
6
|
-
'file-card__content--selected': selected,
|
|
7
|
-
'file-card__content--disabled': disabled,
|
|
8
|
-
'file-card__content--hover':
|
|
9
|
-
(select && !success && !disabled) || isFolder,
|
|
10
|
-
}"
|
|
11
|
-
>
|
|
12
|
-
<div class="file-card__content__header">
|
|
13
|
-
<div class="file-card__content__header__btn-menu">
|
|
14
|
-
<BIMDataIcon
|
|
15
|
-
v-if="success"
|
|
16
|
-
name="success"
|
|
17
|
-
size="s"
|
|
18
|
-
fill
|
|
19
|
-
color="success"
|
|
20
|
-
class="file-card__content__header__btn-menu__success"
|
|
21
|
-
/>
|
|
22
|
-
<PieProgressSpinner
|
|
23
|
-
v-else-if="loading && !success"
|
|
24
|
-
:progress="percentCompleted"
|
|
25
|
-
class="file-card__content__header__btn-menu__spinner"
|
|
26
|
-
/>
|
|
27
|
-
<BIMDataButton
|
|
28
|
-
ghost
|
|
29
|
-
rounded
|
|
30
|
-
icon
|
|
31
|
-
v-else-if="edit"
|
|
32
|
-
@click.stop="toggleMenu"
|
|
33
|
-
class="file-card__content__header__btn-menu__edit"
|
|
34
|
-
:disabled="success"
|
|
35
|
-
>
|
|
36
|
-
<BIMDataIcon name="ellipsis" size="l" fill color="granite-light" />
|
|
37
|
-
</BIMDataButton>
|
|
38
|
-
<div v-else-if="!isFolder">
|
|
39
|
-
<template v-if="pdfModelLoading">
|
|
40
|
-
<BIMDataSpinner style="margin: 10px" />
|
|
41
|
-
</template>
|
|
42
|
-
<template v-else>
|
|
43
|
-
<BIMDataCheckbox
|
|
44
|
-
:disabled="disabled"
|
|
45
|
-
v-if="multiSelect"
|
|
46
|
-
:modelValue="selected"
|
|
47
|
-
class="file-card__content__header__btn-menu__checkbox"
|
|
48
|
-
/>
|
|
49
|
-
<BIMDataRadio
|
|
50
|
-
:disabled="disabled"
|
|
51
|
-
v-else
|
|
52
|
-
big
|
|
53
|
-
:modelValue="selected"
|
|
54
|
-
name="BIMDataFileCardRadio"
|
|
55
|
-
/>
|
|
56
|
-
</template>
|
|
57
|
-
</div>
|
|
58
|
-
</div>
|
|
59
|
-
<template v-if="file.nature === 'Folder'">
|
|
60
|
-
<BIMDataIcon name="folder" size="xl" fill color="primary" />
|
|
61
|
-
</template>
|
|
62
|
-
<template v-else>
|
|
63
|
-
<BIMDataFileIcon :fileName="file.file_name" :size="25" />
|
|
64
|
-
</template>
|
|
65
|
-
</div>
|
|
66
|
-
<div
|
|
67
|
-
class="file-card__content__menu"
|
|
68
|
-
v-if="menuDisplayed"
|
|
69
|
-
v-clickaway="away"
|
|
70
|
-
>
|
|
71
|
-
<BIMDataButton
|
|
72
|
-
v-if="viewPdf && file.model_type === 'PDF'"
|
|
73
|
-
color="default"
|
|
74
|
-
ghost
|
|
75
|
-
radius
|
|
76
|
-
width="100%"
|
|
77
|
-
@click.stop="onViewClick"
|
|
78
|
-
>
|
|
79
|
-
{{ $translate("view") }}
|
|
80
|
-
</BIMDataButton>
|
|
81
|
-
<BIMDataButton
|
|
82
|
-
color="default"
|
|
83
|
-
ghost
|
|
84
|
-
radius
|
|
85
|
-
width="100%"
|
|
86
|
-
@click.stop="onRenameClick"
|
|
87
|
-
>
|
|
88
|
-
{{ $translate("rename") }}
|
|
89
|
-
</BIMDataButton>
|
|
90
|
-
<BIMDataButton
|
|
91
|
-
color="default"
|
|
92
|
-
ghost
|
|
93
|
-
radius
|
|
94
|
-
width="100%"
|
|
95
|
-
@click.stop="onDownloadClick"
|
|
96
|
-
>
|
|
97
|
-
{{ $translate("download") }}
|
|
98
|
-
</BIMDataButton>
|
|
99
|
-
<BIMDataButton
|
|
100
|
-
v-if="writeAccess"
|
|
101
|
-
color="high"
|
|
102
|
-
ghost
|
|
103
|
-
radius
|
|
104
|
-
width="100%"
|
|
105
|
-
@click.stop="onDeleteClick"
|
|
106
|
-
>
|
|
107
|
-
{{ $translate("delete") }}
|
|
108
|
-
</BIMDataButton>
|
|
109
|
-
</div>
|
|
110
|
-
<div class="file-card__content__footer">
|
|
111
|
-
<MultiLineTextBox
|
|
112
|
-
class="file-card__content__footer__name"
|
|
113
|
-
:text="file.name"
|
|
114
|
-
/>
|
|
115
|
-
<div class="file-card__content__footer__date">
|
|
116
|
-
{{ file.updated_at.toLocaleDateString() }}
|
|
117
|
-
</div>
|
|
118
|
-
<template v-if="initials">
|
|
119
|
-
<div class="file-card__content__footer__initials">
|
|
120
|
-
{{ initials }}
|
|
121
|
-
</div>
|
|
122
|
-
</template>
|
|
123
|
-
</div>
|
|
124
|
-
</div>
|
|
125
|
-
</div>
|
|
126
|
-
</template>
|
|
127
|
-
|
|
128
|
-
<script>
|
|
129
|
-
import BIMDataButton from "../../../BIMDataComponents/BIMDataButton/BIMDataButton.vue";
|
|
130
|
-
import BIMDataIcon from "../../../BIMDataComponents/BIMDataIcon/BIMDataIcon.vue";
|
|
131
|
-
import BIMDataRadio from "../../../BIMDataComponents/BIMDataRadio/BIMDataRadio.vue";
|
|
132
|
-
import BIMDataCheckbox from "../../../BIMDataComponents/BIMDataCheckbox/BIMDataCheckbox.vue";
|
|
133
|
-
import BIMDataFileIcon from "../../../BIMDataComponents/BIMDataFileIcon/BIMDataFileIcon.vue";
|
|
134
|
-
import BIMDataSpinner from "../../../BIMDataComponents/BIMDataSpinner/BIMDataSpinner.vue";
|
|
135
|
-
import clickaway from "../../../BIMDataDirectives/click-away.js";
|
|
136
|
-
|
|
137
|
-
import PieProgressSpinner from "./PieProgressSpinner.vue";
|
|
138
|
-
import MultiLineTextBox from "./MultiLineTextBox/MultiLineTextBox.vue";
|
|
139
|
-
|
|
140
|
-
export default {
|
|
141
|
-
components: {
|
|
142
|
-
BIMDataButton,
|
|
143
|
-
BIMDataIcon,
|
|
144
|
-
BIMDataRadio,
|
|
145
|
-
BIMDataCheckbox,
|
|
146
|
-
BIMDataFileIcon,
|
|
147
|
-
BIMDataSpinner,
|
|
148
|
-
PieProgressSpinner,
|
|
149
|
-
MultiLineTextBox,
|
|
150
|
-
},
|
|
151
|
-
directives: { clickaway },
|
|
152
|
-
inject: ["$translate"],
|
|
153
|
-
props: {
|
|
154
|
-
disabled: {
|
|
155
|
-
type: Boolean,
|
|
156
|
-
default: false,
|
|
157
|
-
},
|
|
158
|
-
writeAccess: {
|
|
159
|
-
type: Boolean,
|
|
160
|
-
default: false,
|
|
161
|
-
},
|
|
162
|
-
width: {
|
|
163
|
-
type: String,
|
|
164
|
-
default: "140px",
|
|
165
|
-
},
|
|
166
|
-
file: {
|
|
167
|
-
type: Object,
|
|
168
|
-
required: true,
|
|
169
|
-
},
|
|
170
|
-
projectId: {
|
|
171
|
-
type: Number,
|
|
172
|
-
required: true,
|
|
173
|
-
},
|
|
174
|
-
spaceId: {
|
|
175
|
-
type: Number,
|
|
176
|
-
required: true,
|
|
177
|
-
},
|
|
178
|
-
apiUrl: {
|
|
179
|
-
type: String,
|
|
180
|
-
required: true,
|
|
181
|
-
},
|
|
182
|
-
accessToken: {
|
|
183
|
-
type: String,
|
|
184
|
-
required: true,
|
|
185
|
-
},
|
|
186
|
-
select: {
|
|
187
|
-
type: Boolean,
|
|
188
|
-
default: false,
|
|
189
|
-
},
|
|
190
|
-
selected: {
|
|
191
|
-
type: Boolean,
|
|
192
|
-
default: false,
|
|
193
|
-
},
|
|
194
|
-
multi: {
|
|
195
|
-
type: Boolean,
|
|
196
|
-
default: false,
|
|
197
|
-
},
|
|
198
|
-
success: {
|
|
199
|
-
type: Boolean,
|
|
200
|
-
default: false,
|
|
201
|
-
},
|
|
202
|
-
viewPdf: {
|
|
203
|
-
type: Boolean,
|
|
204
|
-
default: false,
|
|
205
|
-
},
|
|
206
|
-
pdfModelLoading: {
|
|
207
|
-
type: Boolean,
|
|
208
|
-
default: false,
|
|
209
|
-
},
|
|
210
|
-
},
|
|
211
|
-
emits: [
|
|
212
|
-
"rename",
|
|
213
|
-
"download",
|
|
214
|
-
"edit",
|
|
215
|
-
"view",
|
|
216
|
-
"open-folder",
|
|
217
|
-
"toggle-select",
|
|
218
|
-
"loaded",
|
|
219
|
-
"load-error",
|
|
220
|
-
],
|
|
221
|
-
data() {
|
|
222
|
-
return {
|
|
223
|
-
menuDisplayed: false,
|
|
224
|
-
percentCompleted: 0,
|
|
225
|
-
};
|
|
226
|
-
},
|
|
227
|
-
computed: {
|
|
228
|
-
multiSelect() {
|
|
229
|
-
return this.select && this.multi;
|
|
230
|
-
},
|
|
231
|
-
edit() {
|
|
232
|
-
return !this.loading && !this.select;
|
|
233
|
-
},
|
|
234
|
-
isFolder() {
|
|
235
|
-
return this.file.nature === "Folder";
|
|
236
|
-
},
|
|
237
|
-
loading() {
|
|
238
|
-
return this.file.fileToLoad;
|
|
239
|
-
},
|
|
240
|
-
initials() {
|
|
241
|
-
return (
|
|
242
|
-
this.file.created_by &&
|
|
243
|
-
(
|
|
244
|
-
`${this.file.created_by.firstname[0] || ""}` +
|
|
245
|
-
`${this.file.created_by.lastname[0] || ""}`
|
|
246
|
-
).toUpperCase()
|
|
247
|
-
);
|
|
248
|
-
},
|
|
249
|
-
},
|
|
250
|
-
async created() {
|
|
251
|
-
document.addEventListener("keydown", this.onKeyDown);
|
|
252
|
-
|
|
253
|
-
if (this.file.fileToLoad) {
|
|
254
|
-
const formData = new FormData();
|
|
255
|
-
formData.append("file", this.file.fileToLoad);
|
|
256
|
-
formData.append("name", this.file.fileToLoad.name);
|
|
257
|
-
formData.append("parent_id", this.file.folder.id);
|
|
258
|
-
|
|
259
|
-
const request = new XMLHttpRequest();
|
|
260
|
-
request.open(
|
|
261
|
-
"POST",
|
|
262
|
-
`${this.apiUrl}/cloud/${this.spaceId}/project/${this.projectId}/document`
|
|
263
|
-
);
|
|
264
|
-
request.setRequestHeader("authorization", `Bearer ${this.accessToken}`);
|
|
265
|
-
|
|
266
|
-
request.addEventListener("progress", e => {
|
|
267
|
-
this.percentCompleted = (e.loaded / e.total) * 100;
|
|
268
|
-
});
|
|
269
|
-
|
|
270
|
-
request.addEventListener("load", () => {
|
|
271
|
-
if (request.status === 201) {
|
|
272
|
-
const file = JSON.parse(request.response);
|
|
273
|
-
file.updated_at = new Date(file.updated_at);
|
|
274
|
-
this.$emit("loaded", file);
|
|
275
|
-
} else {
|
|
276
|
-
this.$emit("load-error", request.statusText);
|
|
277
|
-
}
|
|
278
|
-
});
|
|
279
|
-
|
|
280
|
-
request.send(formData);
|
|
281
|
-
}
|
|
282
|
-
},
|
|
283
|
-
destroyed() {
|
|
284
|
-
document.removeEventListener("keydown", this.onKeyDown);
|
|
285
|
-
},
|
|
286
|
-
methods: {
|
|
287
|
-
onKeyDown(e) {
|
|
288
|
-
if (e.key === "Escape") {
|
|
289
|
-
this.menuDisplayed = false;
|
|
290
|
-
}
|
|
291
|
-
},
|
|
292
|
-
onRenameClick() {
|
|
293
|
-
this.menuDisplayed = false;
|
|
294
|
-
this.$emit("rename");
|
|
295
|
-
},
|
|
296
|
-
onDownloadClick() {
|
|
297
|
-
this.menuDisplayed = false;
|
|
298
|
-
this.$emit("dowload");
|
|
299
|
-
},
|
|
300
|
-
onDeleteClick() {
|
|
301
|
-
this.menuDisplayed = false;
|
|
302
|
-
this.$emit("delete");
|
|
303
|
-
},
|
|
304
|
-
onViewClick() {
|
|
305
|
-
this.menuDisplayed = false;
|
|
306
|
-
this.$emit("view");
|
|
307
|
-
},
|
|
308
|
-
onClick() {
|
|
309
|
-
if (this.isFolder) {
|
|
310
|
-
this.$emit("open-folder");
|
|
311
|
-
} else if (!this.success && !this.disabled && this.select) {
|
|
312
|
-
this.$emit("toggle-select", this.file);
|
|
313
|
-
}
|
|
314
|
-
},
|
|
315
|
-
toggleMenu() {
|
|
316
|
-
this.menuDisplayed = !this.menuDisplayed;
|
|
317
|
-
},
|
|
318
|
-
away() {
|
|
319
|
-
setTimeout(() => {
|
|
320
|
-
this.menuDisplayed = false;
|
|
321
|
-
});
|
|
322
|
-
},
|
|
323
|
-
},
|
|
324
|
-
};
|
|
325
|
-
</script>
|
|
326
|
-
|
|
327
|
-
<style scoped lang="scss">
|
|
328
|
-
.file-card {
|
|
329
|
-
height: 192px;
|
|
330
|
-
display: flex;
|
|
331
|
-
align-items: center;
|
|
332
|
-
justify-content: center;
|
|
333
|
-
box-sizing: border-box;
|
|
334
|
-
|
|
335
|
-
&__content {
|
|
336
|
-
box-sizing: border-box;
|
|
337
|
-
height: calc(100% - 24px);
|
|
338
|
-
width: calc(100% - 24px);
|
|
339
|
-
background-color: var(--color-white);
|
|
340
|
-
box-shadow: var(--box-shadow);
|
|
341
|
-
position: relative;
|
|
342
|
-
|
|
343
|
-
&__menu {
|
|
344
|
-
position: absolute;
|
|
345
|
-
background-color: var(--color-white);
|
|
346
|
-
z-index: 1;
|
|
347
|
-
left: calc(var(--spacing-unit) / 3);
|
|
348
|
-
right: calc(var(--spacing-unit) / 3);
|
|
349
|
-
top: calc(var(--spacing-unit) * 3);
|
|
350
|
-
box-shadow: var(--box-shadow);
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
&--selected {
|
|
354
|
-
border: solid var(--color-primary) 3px;
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
&--disabled {
|
|
358
|
-
.file-card__content__header {
|
|
359
|
-
filter: grayscale(100%);
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
&:not(.file-card__content--selected) {
|
|
364
|
-
padding: 3px;
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
&--hover {
|
|
368
|
-
cursor: pointer;
|
|
369
|
-
&:hover {
|
|
370
|
-
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.3);
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
&__header {
|
|
375
|
-
box-sizing: border-box;
|
|
376
|
-
height: 65px;
|
|
377
|
-
display: flex;
|
|
378
|
-
align-items: center;
|
|
379
|
-
justify-content: center;
|
|
380
|
-
position: relative;
|
|
381
|
-
border-bottom: solid 1px var(--color-silver-light);
|
|
382
|
-
|
|
383
|
-
&__btn-menu {
|
|
384
|
-
position: absolute;
|
|
385
|
-
top: 0px;
|
|
386
|
-
right: 0px;
|
|
387
|
-
|
|
388
|
-
&__checkbox {
|
|
389
|
-
top: 6px;
|
|
390
|
-
right: 6px;
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
&__footer {
|
|
396
|
-
height: calc(100% - 65px);
|
|
397
|
-
display: flex;
|
|
398
|
-
flex-direction: column;
|
|
399
|
-
justify-content: space-between;
|
|
400
|
-
position: relative;
|
|
401
|
-
box-sizing: border-box;
|
|
402
|
-
font-size: 12px;
|
|
403
|
-
|
|
404
|
-
padding: var(--spacing-unit);
|
|
405
|
-
|
|
406
|
-
&__name {
|
|
407
|
-
font-weight: bold;
|
|
408
|
-
color: var(--color-granite);
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
&__date {
|
|
412
|
-
color: var(--color-granite-light);
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
&__initials {
|
|
416
|
-
position: absolute;
|
|
417
|
-
display: flex;
|
|
418
|
-
justify-content: center;
|
|
419
|
-
align-items: center;
|
|
420
|
-
background-color: var(--color-primary);
|
|
421
|
-
font-size: calc(var(--spacing-unit) / 1.1);
|
|
422
|
-
color: var(--color-silver-light);
|
|
423
|
-
line-height: 2px;
|
|
424
|
-
border-radius: 50%;
|
|
425
|
-
height: 20px;
|
|
426
|
-
width: 20px;
|
|
427
|
-
bottom: 9px;
|
|
428
|
-
right: 18px;
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
}
|
|
432
|
-
}
|
|
433
|
-
</style>
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
class="multi-line-text-box"
|
|
4
|
-
:style="style"
|
|
5
|
-
@mouseover="hover = true"
|
|
6
|
-
@mouseleave="hover = false"
|
|
7
|
-
>
|
|
8
|
-
<div class="multi-line-text-box__content">
|
|
9
|
-
<template v-if="needEllipsis">
|
|
10
|
-
<div class="multi-line-text-box__content__head">
|
|
11
|
-
<span>
|
|
12
|
-
{{ text }}
|
|
13
|
-
</span>
|
|
14
|
-
</div>
|
|
15
|
-
<div
|
|
16
|
-
class="multi-line-text-box__content__tail"
|
|
17
|
-
:style="`height:${lineHeight * (lines - 1)}px`"
|
|
18
|
-
>
|
|
19
|
-
<div class="multi-line-text-box__content__tail__text">
|
|
20
|
-
<span>{{ text }} </span>
|
|
21
|
-
</div>
|
|
22
|
-
<div class="multi-line-text-box__content__tail__ellipsis">...</div>
|
|
23
|
-
</div>
|
|
24
|
-
</template>
|
|
25
|
-
<span class="multi-line-text-box__content__full" v-else>
|
|
26
|
-
{{ text }}
|
|
27
|
-
</span>
|
|
28
|
-
<span class="multi-line-text-box__ghost" ref="ghost">
|
|
29
|
-
{{ text }}
|
|
30
|
-
</span>
|
|
31
|
-
</div>
|
|
32
|
-
<Tooltip
|
|
33
|
-
@click.native.stop
|
|
34
|
-
v-if="tooltipDisplayed"
|
|
35
|
-
:text="text"
|
|
36
|
-
class="multi-line-text-box__tooltip"
|
|
37
|
-
/>
|
|
38
|
-
</div>
|
|
39
|
-
</template>
|
|
40
|
-
|
|
41
|
-
<script>
|
|
42
|
-
import Tooltip from "./Tooltip.vue";
|
|
43
|
-
|
|
44
|
-
export default {
|
|
45
|
-
components: {
|
|
46
|
-
Tooltip,
|
|
47
|
-
},
|
|
48
|
-
props: {
|
|
49
|
-
text: {
|
|
50
|
-
type: String,
|
|
51
|
-
default: "",
|
|
52
|
-
},
|
|
53
|
-
lines: {
|
|
54
|
-
type: Number,
|
|
55
|
-
default: 3,
|
|
56
|
-
},
|
|
57
|
-
lineHeight: {
|
|
58
|
-
type: Number,
|
|
59
|
-
default: 14,
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
data() {
|
|
63
|
-
return {
|
|
64
|
-
needEllipsis: false,
|
|
65
|
-
hover: false,
|
|
66
|
-
};
|
|
67
|
-
},
|
|
68
|
-
computed: {
|
|
69
|
-
style() {
|
|
70
|
-
return {
|
|
71
|
-
"--textbox-line-height": `${this.lineHeight}px`,
|
|
72
|
-
"--textbox-lines": this.lines,
|
|
73
|
-
};
|
|
74
|
-
},
|
|
75
|
-
tooltipDisplayed() {
|
|
76
|
-
return this.needEllipsis && this.hover;
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
mounted() {
|
|
80
|
-
this.resizeObserver = new ResizeObserver(this.onResize);
|
|
81
|
-
this.resizeObserver.observe(this.$el);
|
|
82
|
-
},
|
|
83
|
-
destroyed() {
|
|
84
|
-
this.resizeObserver && this.resizeObserver.disconnect();
|
|
85
|
-
},
|
|
86
|
-
methods: {
|
|
87
|
-
onResize() {
|
|
88
|
-
if (!this.$refs.ghost) return;
|
|
89
|
-
|
|
90
|
-
const height = this.lines * this.lineHeight;
|
|
91
|
-
const { height: neededHeight } = this.$refs.ghost.getBoundingClientRect();
|
|
92
|
-
|
|
93
|
-
this.needEllipsis = neededHeight > height;
|
|
94
|
-
},
|
|
95
|
-
},
|
|
96
|
-
};
|
|
97
|
-
</script>
|
|
98
|
-
|
|
99
|
-
<style scoped lang="scss">
|
|
100
|
-
.multi-line-text-box {
|
|
101
|
-
position: relative;
|
|
102
|
-
line-height: var(--textbox-line-height, 14px);
|
|
103
|
-
|
|
104
|
-
&__tooltip {
|
|
105
|
-
position: absolute;
|
|
106
|
-
top: calc(
|
|
107
|
-
calc(var(--textbox-line-height, 14px) * var(--textbox-lines, 3)) + 10px
|
|
108
|
-
);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
&__ghost {
|
|
112
|
-
word-break: break-all;
|
|
113
|
-
top: 0;
|
|
114
|
-
right: 0;
|
|
115
|
-
left: 0;
|
|
116
|
-
position: absolute;
|
|
117
|
-
visibility: hidden;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
&__content {
|
|
121
|
-
position: relative;
|
|
122
|
-
overflow: hidden;
|
|
123
|
-
|
|
124
|
-
height: calc(var(--textbox-line-height, 14px) * var(--textbox-lines, 3));
|
|
125
|
-
|
|
126
|
-
&__tail {
|
|
127
|
-
word-break: break-all;
|
|
128
|
-
position: absolute;
|
|
129
|
-
bottom: 0px;
|
|
130
|
-
left: 0px;
|
|
131
|
-
right: 0px;
|
|
132
|
-
background-color: var(--color-white);
|
|
133
|
-
overflow: hidden;
|
|
134
|
-
&__ellipsis {
|
|
135
|
-
position: absolute;
|
|
136
|
-
top: 0px;
|
|
137
|
-
left: 0px;
|
|
138
|
-
background-color: var(--color-white);
|
|
139
|
-
}
|
|
140
|
-
&__text {
|
|
141
|
-
position: absolute;
|
|
142
|
-
bottom: 0px;
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
&__full {
|
|
147
|
-
word-break: break-all;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
</style>
|
package/src/BIMDataSmartComponents/BIMDataFileManager/components/MultiLineTextBox/Tooltip.vue
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="multi-line-textbox-tooltip">
|
|
3
|
-
<div class="multi-line-textbox-tooltip__content">
|
|
4
|
-
{{ text }}
|
|
5
|
-
</div>
|
|
6
|
-
</div>
|
|
7
|
-
</template>
|
|
8
|
-
|
|
9
|
-
<script>
|
|
10
|
-
export default {
|
|
11
|
-
props: {
|
|
12
|
-
text: {
|
|
13
|
-
type: String,
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
};
|
|
17
|
-
</script>
|
|
18
|
-
|
|
19
|
-
<style scoped lang="scss">
|
|
20
|
-
.multi-line-textbox-tooltip {
|
|
21
|
-
width: 100%;
|
|
22
|
-
&__content {
|
|
23
|
-
color: var(--color-white);
|
|
24
|
-
background-color: var(--color-primary);
|
|
25
|
-
padding: calc(var(--spacing-unit) / 2);
|
|
26
|
-
border-radius: 6px;
|
|
27
|
-
|
|
28
|
-
text-align: center;
|
|
29
|
-
word-break: break-all;
|
|
30
|
-
|
|
31
|
-
position: absolute;
|
|
32
|
-
left: 0px;
|
|
33
|
-
right: 0px;
|
|
34
|
-
z-index: 1;
|
|
35
|
-
}
|
|
36
|
-
&::before {
|
|
37
|
-
content: "";
|
|
38
|
-
display: block;
|
|
39
|
-
position: absolute;
|
|
40
|
-
top: -8px;
|
|
41
|
-
border: var(--color-primary) solid 8px;
|
|
42
|
-
transform: rotate(45deg);
|
|
43
|
-
left: calc(50% - 8px);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
</style>
|