@bimdata/bcf-components 6.0.0-rc.9 → 6.0.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/README.md +0 -6
- package/package.json +15 -20
- package/src/components/bcf-filters/BcfFilters.scss +67 -0
- package/src/components/bcf-filters/BcfFilters.vue +228 -0
- package/src/components/bcf-settings/BcfSettings.scss +28 -0
- package/src/components/bcf-settings/BcfSettings.vue +117 -0
- package/src/components/bcf-settings/setting-card/SettingCard.scss +59 -0
- package/src/components/bcf-settings/setting-card/SettingCard.vue +140 -0
- package/src/components/bcf-settings/setting-card/SettingCardItem.scss +48 -0
- package/src/components/bcf-settings/setting-card/SettingCardItem.vue +151 -0
- package/src/components/bcf-statistics/BcfStatistics.scss +56 -0
- package/src/components/bcf-statistics/BcfStatistics.vue +112 -0
- package/src/components/bcf-topic-card/BcfTopicCard.scss +96 -0
- package/src/components/bcf-topic-card/BcfTopicCard.vue +150 -0
- package/src/components/bcf-topic-card/BcfTopicDefaultImage.vue +90 -0
- package/src/components/bcf-topic-creation-card/BcfTopicCreationCard.scss +15 -0
- package/src/components/bcf-topic-creation-card/BcfTopicCreationCard.vue +37 -0
- package/src/components/bcf-topic-creation-card/BcfTopicCreationCardImage.vue +55 -0
- package/src/components/bcf-topic-form/BcfTopicForm.scss +124 -0
- package/src/components/bcf-topic-form/BcfTopicForm.vue +541 -0
- package/src/components/bcf-topic-form/bcf-topic-images/BcfTopicImages.scss +88 -0
- package/src/components/bcf-topic-form/bcf-topic-images/BcfTopicImages.vue +101 -0
- package/src/components/bcf-topic-form/bcf-topic-snapshots/BcfTopicSnapshots.scss +50 -0
- package/src/components/bcf-topic-form/bcf-topic-snapshots/BcfTopicSnapshots.vue +71 -0
- package/src/components/bcf-topic-form/bcf-topic-snapshots-actions/BcfTopicSnapshotsActions.scss +9 -0
- package/src/components/bcf-topic-form/bcf-topic-snapshots-actions/BcfTopicSnapshotsActions.vue +69 -0
- package/src/components/bcf-topic-overview/BcfTopicOverview.scss +94 -0
- package/src/components/bcf-topic-overview/BcfTopicOverview.vue +350 -0
- package/src/components/bcf-topic-overview/bcf-topic-comments/BcfTopicComments.scss +39 -0
- package/src/components/bcf-topic-overview/bcf-topic-comments/BcfTopicComments.vue +268 -0
- package/src/components/bcf-topic-overview/bcf-topic-comments/topic-comment/TopicComment.scss +79 -0
- package/src/components/bcf-topic-overview/bcf-topic-comments/topic-comment/TopicComment.vue +357 -0
- package/src/components/bcf-topic-overview/bcf-topic-viewpoints/BcfTopicViewpoints.scss +73 -0
- package/src/components/bcf-topic-overview/bcf-topic-viewpoints/BcfTopicViewpoints.vue +84 -0
- package/src/components/bcf-topics-table/BcfTopicsTable.vue +148 -0
- package/src/components/bcf-topics-table/bcf-topic-actions-cell/BcfTopicActionsCell.vue +43 -0
- package/src/components/bcf-topics-table/bcf-topic-index-cell/BcfTopicIndexCell.vue +55 -0
- package/src/components/bcf-topics-table/bcf-topic-priority-cell/BcfTopicPriorityCell.vue +47 -0
- package/src/components/bcf-topics-table/bcf-topic-status-cell/BcfTopicStatusCell.vue +52 -0
- package/src/components/bcf-topics-table/columns.js +38 -0
- package/src/components/user-avatar/UserAvatar.scss +30 -0
- package/src/components/user-avatar/UserAvatar.vue +66 -0
- package/src/composables/filter.js +58 -0
- package/src/composables/search.js +42 -0
- package/src/composables/sort.js +64 -0
- package/src/config.js +87 -0
- package/{dist → src}/i18n/lang/en.json +3 -1
- package/{dist → src}/i18n/lang/fr.json +5 -1
- package/src/index.js +59 -0
- package/src/service.js +206 -0
- package/src/utils/browser.js +12 -0
- package/src/utils/download.js +15 -0
- package/src/utils/extensions.js +14 -0
- package/src/utils/topic.js +23 -0
- package/src/utils/viewer.js +21 -0
- package/src/utils/viewpoints.js +28 -0
- package/vue3-plugin.js +4 -5
- package/dist/bcf-components.mjs +0 -10311
- package/dist/style.css +0 -1
- /package/{dist → src}/i18n/index.js +0 -0
- /package/{dist → src}/i18n/lang/de.json +0 -0
- /package/{dist → src}/i18n/lang/es.json +0 -0
- /package/{dist → src}/i18n/lang/it.json +0 -0
- /package/{dist → src}/i18n/lang/nl.json +0 -0
- /package/{dist → src}/i18n/lang/no.json +0 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
.topic-comment {
|
|
2
|
+
&:not(:last-child) {
|
|
3
|
+
margin-bottom: 36px;
|
|
4
|
+
}
|
|
5
|
+
&__header {
|
|
6
|
+
position: relative;
|
|
7
|
+
font-weight: bold;
|
|
8
|
+
|
|
9
|
+
&__left {
|
|
10
|
+
&__user {
|
|
11
|
+
width: 32px;
|
|
12
|
+
height: 32px;
|
|
13
|
+
border-radius: 50px;
|
|
14
|
+
background-color: var(--color-silver-light);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&__right {
|
|
19
|
+
&__actions {
|
|
20
|
+
position: absolute;
|
|
21
|
+
top: 0;
|
|
22
|
+
right: 0;
|
|
23
|
+
background-color: var(--color-white);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&__delete {
|
|
27
|
+
position: absolute;
|
|
28
|
+
top: 0;
|
|
29
|
+
right: 2%;
|
|
30
|
+
width: 96%;
|
|
31
|
+
height: 40px;
|
|
32
|
+
display: flex;
|
|
33
|
+
justify-content: space-between;
|
|
34
|
+
align-items: center;
|
|
35
|
+
background-color: var(--color-white);
|
|
36
|
+
box-shadow: var(--box-shadow);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&__content {
|
|
42
|
+
:deep(.bimdata-textarea) {
|
|
43
|
+
margin-bottom: calc(var(--spacing-unit) / 2);
|
|
44
|
+
|
|
45
|
+
textarea {
|
|
46
|
+
color: var(--color-granite);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&:not(.editing) .bar {
|
|
50
|
+
display: none;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&__camera {
|
|
55
|
+
cursor: pointer;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&__snapshot {
|
|
59
|
+
width: 120px;
|
|
60
|
+
height: 82px;
|
|
61
|
+
border: 1px solid var(--color-silver);
|
|
62
|
+
background-color: var(--color-silver-light);
|
|
63
|
+
position: relative;
|
|
64
|
+
img {
|
|
65
|
+
width: 100%;
|
|
66
|
+
height: 100%;
|
|
67
|
+
object-fit: cover;
|
|
68
|
+
&:hover {
|
|
69
|
+
cursor: pointer;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
button {
|
|
73
|
+
position: absolute;
|
|
74
|
+
top: calc((82px / 2) - 16px);
|
|
75
|
+
left: calc((120px / 2) - 16px);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="topic-comment m-t-18">
|
|
3
|
+
<div class="topic-comment__header flex items-center justify-between">
|
|
4
|
+
<div class="topic-comment__header__left flex items-center">
|
|
5
|
+
<UserAvatar
|
|
6
|
+
v-if="comment.user"
|
|
7
|
+
class="m-r-12"
|
|
8
|
+
style="box-shadow: var(--box-shadow)"
|
|
9
|
+
:user="comment.user"
|
|
10
|
+
size="27"
|
|
11
|
+
initialsSize="14"
|
|
12
|
+
color="silver-light"
|
|
13
|
+
/>
|
|
14
|
+
<span
|
|
15
|
+
v-else
|
|
16
|
+
class="topic-comment__header__left__user flex items-center justify-center m-r-12"
|
|
17
|
+
>
|
|
18
|
+
<BIMDataIconUser size="xxs" fill color="granite" />
|
|
19
|
+
</span>
|
|
20
|
+
|
|
21
|
+
<BIMDataTextbox width="auto" maxWidth="150px" cutPosition="end" :text="comment.author" />
|
|
22
|
+
<span class="color-granite m-x-6"> • </span>
|
|
23
|
+
<span class="color-granite">
|
|
24
|
+
{{ $d(comment.date, "long") }}
|
|
25
|
+
</span>
|
|
26
|
+
</div>
|
|
27
|
+
|
|
28
|
+
<div class="topic-comment__header__right">
|
|
29
|
+
<template v-if="currentUserEmail === comment.author">
|
|
30
|
+
<div class="topic-comment__header__right__actions flex">
|
|
31
|
+
<template v-if="showMenu">
|
|
32
|
+
<BIMDataButton ghost rounded icon @click="onOpenEdit">
|
|
33
|
+
<BIMDataIconEdit size="xxs" fill color="granite-light" />
|
|
34
|
+
</BIMDataButton>
|
|
35
|
+
<BIMDataButton ghost rounded icon @click="onOpenDelete">
|
|
36
|
+
<BIMDataIconDelete size="xxs" fill color="granite-light" />
|
|
37
|
+
</BIMDataButton>
|
|
38
|
+
<BIMDataButton ghost rounded icon @click="toggleMenu">
|
|
39
|
+
<BIMDataIconClose size="xxs" fill color="granite-light" />
|
|
40
|
+
</BIMDataButton>
|
|
41
|
+
</template>
|
|
42
|
+
<template v-if="isEditing">
|
|
43
|
+
<BIMDataButton ghost rounded icon @click="cancelUpdate">
|
|
44
|
+
<BIMDataIconUndo size="xxs" fill color="granite-light" />
|
|
45
|
+
</BIMDataButton>
|
|
46
|
+
<BIMDataButton ghost rounded icon @click="submitUpdate">
|
|
47
|
+
<BIMDataIconValidate size="xxs" fill color="granite-light" />
|
|
48
|
+
</BIMDataButton>
|
|
49
|
+
</template>
|
|
50
|
+
</div>
|
|
51
|
+
<div v-if="isDeleting" class="topic-comment__header__right__delete p-x-12">
|
|
52
|
+
<span>
|
|
53
|
+
{{ $t("BcfComponents.BcfTopicComments.deleteCommentText") }}
|
|
54
|
+
</span>
|
|
55
|
+
<div class="flex items-center">
|
|
56
|
+
<BIMDataButton class="m-r-6" color="high" fill radius @click="submitDelete">
|
|
57
|
+
{{ $t("BcfComponents.BcfTopicComments.deleteButton") }}
|
|
58
|
+
</BIMDataButton>
|
|
59
|
+
<BIMDataButton ghost rounded icon @click="isDeleting = false">
|
|
60
|
+
<BIMDataIconClose size="xxs" fill color="primary" />
|
|
61
|
+
</BIMDataButton>
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
<BIMDataButton
|
|
65
|
+
v-if="!showMenu && !isDeleting && !isEditing"
|
|
66
|
+
class="topic-comment__header__right__btn"
|
|
67
|
+
rounded
|
|
68
|
+
icon
|
|
69
|
+
@click="toggleMenu"
|
|
70
|
+
>
|
|
71
|
+
<BIMDataIconEllipsis size="l" fill color="granite-light" />
|
|
72
|
+
</BIMDataButton>
|
|
73
|
+
</template>
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
|
|
77
|
+
<div class="topic-comment__content">
|
|
78
|
+
<BIMDataTextarea
|
|
79
|
+
:class="{ editing: isEditing }"
|
|
80
|
+
width="100%"
|
|
81
|
+
rows="1"
|
|
82
|
+
v-model="text"
|
|
83
|
+
fitContent
|
|
84
|
+
autofocus
|
|
85
|
+
:resizable="false"
|
|
86
|
+
:readonly="!isEditing"
|
|
87
|
+
/>
|
|
88
|
+
<div v-if="isViewer && isEditing && !viewpoint" class="flex">
|
|
89
|
+
<div
|
|
90
|
+
class="topic-comment__content__camera m-r-12"
|
|
91
|
+
@click="setCommentViewpoint"
|
|
92
|
+
v-if="!viewerSelectVisible"
|
|
93
|
+
>
|
|
94
|
+
<BIMDataIconCamera fill color="default" />
|
|
95
|
+
</div>
|
|
96
|
+
<BIMDataDropdownList
|
|
97
|
+
v-if="viewerSelectVisible"
|
|
98
|
+
:list="viewerSelectOptions"
|
|
99
|
+
elementKey="key"
|
|
100
|
+
@element-click="createViewpoint"
|
|
101
|
+
width="180px"
|
|
102
|
+
>
|
|
103
|
+
<template #header>{{ $t("BcfComponents.BcfTopicComments.takeSnapshot") }}</template>
|
|
104
|
+
<template #element="{ element }">
|
|
105
|
+
<div
|
|
106
|
+
style="width: 100%"
|
|
107
|
+
@mouseenter="highlightViewer(element.viewer)"
|
|
108
|
+
@mouseleave="unhighlightViewer(element.viewer)"
|
|
109
|
+
>
|
|
110
|
+
{{ `${element.id} (${element.index})` }}
|
|
111
|
+
</div>
|
|
112
|
+
</template>
|
|
113
|
+
</BIMDataDropdownList>
|
|
114
|
+
</div>
|
|
115
|
+
<div class="topic-comment__content__snapshot" v-if="viewpoint && viewpoint.snapshot">
|
|
116
|
+
<img
|
|
117
|
+
:src="viewpoint.snapshot.snapshot_data"
|
|
118
|
+
@click="$emit('view-comment-snapshot', viewpoint)"
|
|
119
|
+
/>
|
|
120
|
+
<BIMDataButton
|
|
121
|
+
v-if="isEditing"
|
|
122
|
+
class="btn-delete"
|
|
123
|
+
fill
|
|
124
|
+
rounded
|
|
125
|
+
icon
|
|
126
|
+
@click="deleteViewpoint"
|
|
127
|
+
>
|
|
128
|
+
<BIMDataIconDelete size="xs" fill color="high" />
|
|
129
|
+
</BIMDataButton>
|
|
130
|
+
</div>
|
|
131
|
+
</div>
|
|
132
|
+
|
|
133
|
+
<template v-if="loading">
|
|
134
|
+
<BIMDataLoading />
|
|
135
|
+
</template>
|
|
136
|
+
</div>
|
|
137
|
+
</template>
|
|
138
|
+
|
|
139
|
+
<script>
|
|
140
|
+
import { inject, onMounted, ref, onBeforeUnmount } from "vue";
|
|
141
|
+
import { useService } from "../../../../service.js";
|
|
142
|
+
import { getViewerOptions, highlightViewer, unhighlightViewer } from "../../../../utils/viewer.js";
|
|
143
|
+
|
|
144
|
+
// Components
|
|
145
|
+
import BIMDataButton from "@bimdata/design-system/src/BIMDataComponents/BIMDataButton/BIMDataButton.vue";
|
|
146
|
+
import {
|
|
147
|
+
BIMDataIconCamera,
|
|
148
|
+
BIMDataIconClose,
|
|
149
|
+
BIMDataIconDelete,
|
|
150
|
+
BIMDataIconEdit,
|
|
151
|
+
BIMDataIconEllipsis,
|
|
152
|
+
BIMDataIconUndo,
|
|
153
|
+
BIMDataIconUser,
|
|
154
|
+
BIMDataIconValidate,
|
|
155
|
+
} from "@bimdata/design-system/src/BIMDataComponents/BIMDataIcon/BIMDataIconStandalone/index.js";
|
|
156
|
+
import BIMDataLoading from "@bimdata/design-system/src/BIMDataComponents/BIMDataLoading/BIMDataLoading.vue";
|
|
157
|
+
import BIMDataTextarea from "@bimdata/design-system/src/BIMDataComponents/BIMDataTextarea/BIMDataTextarea.vue";
|
|
158
|
+
import BIMDataTextbox from "@bimdata/design-system/src/BIMDataComponents/BIMDataTextbox/BIMDataTextbox.vue";
|
|
159
|
+
|
|
160
|
+
// TODO: should be imported from DS
|
|
161
|
+
import UserAvatar from "../../../user-avatar/UserAvatar.vue";
|
|
162
|
+
|
|
163
|
+
export default {
|
|
164
|
+
components: {
|
|
165
|
+
BIMDataButton,
|
|
166
|
+
BIMDataIconCamera,
|
|
167
|
+
BIMDataIconClose,
|
|
168
|
+
BIMDataIconDelete,
|
|
169
|
+
BIMDataIconEdit,
|
|
170
|
+
BIMDataIconEllipsis,
|
|
171
|
+
BIMDataIconUndo,
|
|
172
|
+
BIMDataIconUser,
|
|
173
|
+
BIMDataIconValidate,
|
|
174
|
+
BIMDataLoading,
|
|
175
|
+
BIMDataTextarea,
|
|
176
|
+
BIMDataTextbox,
|
|
177
|
+
UserAvatar,
|
|
178
|
+
},
|
|
179
|
+
props: {
|
|
180
|
+
project: {
|
|
181
|
+
type: Object,
|
|
182
|
+
required: true,
|
|
183
|
+
},
|
|
184
|
+
topic: {
|
|
185
|
+
type: Object,
|
|
186
|
+
required: true,
|
|
187
|
+
},
|
|
188
|
+
comment: {
|
|
189
|
+
type: Object,
|
|
190
|
+
required: true,
|
|
191
|
+
},
|
|
192
|
+
currentUserEmail: {
|
|
193
|
+
type: String,
|
|
194
|
+
required: true,
|
|
195
|
+
},
|
|
196
|
+
getViewers: {
|
|
197
|
+
type: Function,
|
|
198
|
+
required: true,
|
|
199
|
+
},
|
|
200
|
+
},
|
|
201
|
+
emits: ["comment-updated", "comment-deleted", "view-comment-snapshot"],
|
|
202
|
+
setup(props, { emit }) {
|
|
203
|
+
let pluginCreatedSub, pluginDestroyedSub;
|
|
204
|
+
|
|
205
|
+
const service = useService();
|
|
206
|
+
const $viewer = inject("$viewer", null);
|
|
207
|
+
|
|
208
|
+
const loading = ref(false);
|
|
209
|
+
const isEditing = ref(false);
|
|
210
|
+
const isDeleting = ref(false);
|
|
211
|
+
const text = ref(props.comment.comment);
|
|
212
|
+
const viewpoint = ref(null);
|
|
213
|
+
const viewerSelectVisible = ref(false);
|
|
214
|
+
const viewerSelectOptions = ref([]);
|
|
215
|
+
|
|
216
|
+
const showMenu = ref(false);
|
|
217
|
+
const closeMenu = () => (showMenu.value = false);
|
|
218
|
+
const toggleMenu = () => (showMenu.value = !showMenu.value);
|
|
219
|
+
|
|
220
|
+
const loadViewpoint = async () => {
|
|
221
|
+
viewpoint.value = await service.fetchTopicCommentViewpoint(
|
|
222
|
+
props.project,
|
|
223
|
+
props.topic,
|
|
224
|
+
props.comment
|
|
225
|
+
);
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
const onOpenEdit = () => {
|
|
229
|
+
isEditing.value = true;
|
|
230
|
+
closeMenu();
|
|
231
|
+
};
|
|
232
|
+
const cancelUpdate = () => {
|
|
233
|
+
isEditing.value = false;
|
|
234
|
+
text.value = props.comment.comment;
|
|
235
|
+
};
|
|
236
|
+
const deleteViewpoint = async () => {
|
|
237
|
+
if (viewpoint.value.guid) {
|
|
238
|
+
await service.deleteViewpoint(props.project, props.topic, viewpoint.value);
|
|
239
|
+
}
|
|
240
|
+
viewpoint.value = null;
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
const setCommentViewpoint = async () => {
|
|
244
|
+
if (viewerSelectOptions.value.length === 1) {
|
|
245
|
+
await createViewpoint(viewerSelectOptions.value[0]);
|
|
246
|
+
} else if (viewerSelectOptions.value.length > 1) {
|
|
247
|
+
viewerSelectVisible.value = true;
|
|
248
|
+
}
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
const createViewpoint = async ({ viewer }) => {
|
|
252
|
+
unhighlightViewer(viewer);
|
|
253
|
+
viewerSelectVisible.value = false;
|
|
254
|
+
viewpoint.value = await viewer.getViewpoint();
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
const submitUpdate = async () => {
|
|
258
|
+
try {
|
|
259
|
+
if (props.comment.comment === text.value && !viewpoint.value) {
|
|
260
|
+
isEditing.value = false;
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
if (viewpoint.value && !viewpoint.value.guid) {
|
|
264
|
+
viewpoint.value = await service.createViewpoint(
|
|
265
|
+
props.project,
|
|
266
|
+
props.topic,
|
|
267
|
+
viewpoint.value
|
|
268
|
+
);
|
|
269
|
+
}
|
|
270
|
+
if (
|
|
271
|
+
props.comment.comment !== text.value ||
|
|
272
|
+
props.comment.viewpoint_guid !== viewpoint.value.guid
|
|
273
|
+
) {
|
|
274
|
+
loading.value = true;
|
|
275
|
+
|
|
276
|
+
const newComment = await service.updateComment(
|
|
277
|
+
props.project,
|
|
278
|
+
props.topic,
|
|
279
|
+
props.comment,
|
|
280
|
+
{ comment: text.value, viewpoint_guid: viewpoint.value?.guid }
|
|
281
|
+
);
|
|
282
|
+
emit("comment-updated", newComment);
|
|
283
|
+
}
|
|
284
|
+
isEditing.value = false;
|
|
285
|
+
} finally {
|
|
286
|
+
loading.value = false;
|
|
287
|
+
}
|
|
288
|
+
};
|
|
289
|
+
|
|
290
|
+
const onOpenDelete = () => {
|
|
291
|
+
isDeleting.value = true;
|
|
292
|
+
closeMenu();
|
|
293
|
+
};
|
|
294
|
+
const submitDelete = async () => {
|
|
295
|
+
try {
|
|
296
|
+
loading.value = true;
|
|
297
|
+
await service.deleteComment(props.project, props.topic, props.comment);
|
|
298
|
+
emit("comment-deleted", props.comment);
|
|
299
|
+
isDeleting.value = false;
|
|
300
|
+
} finally {
|
|
301
|
+
loading.value = false;
|
|
302
|
+
}
|
|
303
|
+
};
|
|
304
|
+
|
|
305
|
+
onMounted(async () => {
|
|
306
|
+
if (props.comment.viewpoint_guid) {
|
|
307
|
+
await loadViewpoint();
|
|
308
|
+
}
|
|
309
|
+
if ($viewer) {
|
|
310
|
+
viewerSelectOptions.value = getViewerOptions(props.getViewers());
|
|
311
|
+
pluginCreatedSub = $viewer.globalContext.hub.on("plugin-created", () => {
|
|
312
|
+
viewerSelectOptions.value = getViewerOptions(props.getViewers());
|
|
313
|
+
});
|
|
314
|
+
pluginDestroyedSub = $viewer.globalContext.hub.on("plugin-destroyed", () => {
|
|
315
|
+
viewerSelectOptions.value = getViewerOptions(props.getViewers());
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
});
|
|
319
|
+
|
|
320
|
+
onBeforeUnmount(() => {
|
|
321
|
+
if ($viewer) {
|
|
322
|
+
$viewer.globalContext.hub.off(pluginCreatedSub);
|
|
323
|
+
$viewer.globalContext.hub.off(pluginDestroyedSub);
|
|
324
|
+
}
|
|
325
|
+
});
|
|
326
|
+
|
|
327
|
+
return {
|
|
328
|
+
// References
|
|
329
|
+
isDeleting,
|
|
330
|
+
isEditing,
|
|
331
|
+
isViewer: Boolean($viewer),
|
|
332
|
+
loading,
|
|
333
|
+
showMenu,
|
|
334
|
+
text,
|
|
335
|
+
viewerSelectOptions,
|
|
336
|
+
viewerSelectVisible,
|
|
337
|
+
viewpoint,
|
|
338
|
+
// Methods
|
|
339
|
+
cancelUpdate,
|
|
340
|
+
closeMenu,
|
|
341
|
+
createViewpoint,
|
|
342
|
+
deleteViewpoint,
|
|
343
|
+
highlightViewer,
|
|
344
|
+
onOpenDelete,
|
|
345
|
+
onOpenEdit,
|
|
346
|
+
setCommentViewpoint,
|
|
347
|
+
submitDelete,
|
|
348
|
+
submitUpdate,
|
|
349
|
+
toggleMenu,
|
|
350
|
+
loadViewpoint,
|
|
351
|
+
unhighlightViewer,
|
|
352
|
+
};
|
|
353
|
+
},
|
|
354
|
+
};
|
|
355
|
+
</script>
|
|
356
|
+
|
|
357
|
+
<style scoped lang="scss" src="./TopicComment.scss"></style>
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
.bcf-topic-viewpoints {
|
|
2
|
+
position: relative;
|
|
3
|
+
height: 262px;
|
|
4
|
+
min-height: 262px;
|
|
5
|
+
text-align: center;
|
|
6
|
+
background-color: var(--color-silver-light);
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
|
|
9
|
+
&.empty {
|
|
10
|
+
display: flex;
|
|
11
|
+
justify-content: center;
|
|
12
|
+
align-items: center;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.status-badge {
|
|
16
|
+
position: absolute;
|
|
17
|
+
z-index: 1;
|
|
18
|
+
top: calc(var(--spacing-unit) / 2);
|
|
19
|
+
left: calc(var(--spacing-unit) / 2);
|
|
20
|
+
padding: calc(var(--spacing-unit) / 2);
|
|
21
|
+
border-radius: 3px;
|
|
22
|
+
|
|
23
|
+
display: flex;
|
|
24
|
+
gap: calc(var(--spacing-unit) / 2);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
:deep(.bimdata-carousel) {
|
|
28
|
+
height: 100%;
|
|
29
|
+
|
|
30
|
+
.bimdata-carousel__container {
|
|
31
|
+
height: 100%;
|
|
32
|
+
margin: 0;
|
|
33
|
+
padding: 0;
|
|
34
|
+
overflow: hidden;
|
|
35
|
+
|
|
36
|
+
&__slider {
|
|
37
|
+
height: 100% !important;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.bimdata-carousel__btn-prev {
|
|
42
|
+
left: calc(var(--spacing-unit) / 2);
|
|
43
|
+
}
|
|
44
|
+
.bimdata-carousel__btn-next {
|
|
45
|
+
right: calc(var(--spacing-unit) / 2);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.snapshot-preview {
|
|
50
|
+
position: relative;
|
|
51
|
+
width: 100%;
|
|
52
|
+
height: 100%;
|
|
53
|
+
|
|
54
|
+
img {
|
|
55
|
+
width: 100%;
|
|
56
|
+
height: 100%;
|
|
57
|
+
object-fit: cover;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.icon {
|
|
61
|
+
position: absolute;
|
|
62
|
+
z-index: 1;
|
|
63
|
+
bottom: calc(var(--spacing-unit) / 2);
|
|
64
|
+
right: calc(var(--spacing-unit) / 2);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.default-image {
|
|
69
|
+
width: 170px;
|
|
70
|
+
height: 170px;
|
|
71
|
+
padding: 12px;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="bcf-topic-viewpoints" :class="{ empty: viewpoints.length === 0 }">
|
|
3
|
+
<div
|
|
4
|
+
v-if="topic.topic_status"
|
|
5
|
+
class="status-badge"
|
|
6
|
+
:style="{
|
|
7
|
+
backgroundColor: `#${statusColor}`,
|
|
8
|
+
color: adjustTextColor(`#${statusColor}`, '#FFF', '#2F374A'),
|
|
9
|
+
}"
|
|
10
|
+
>
|
|
11
|
+
<BIMDataIconInformation fill color="default" />
|
|
12
|
+
<span>{{ topic.topic_status }}</span>
|
|
13
|
+
</div>
|
|
14
|
+
<template v-if="viewpoints.length > 0">
|
|
15
|
+
<BIMDataCarousel :sliderPadding="0">
|
|
16
|
+
<div class="snapshot-preview" v-for="viewpoint in viewpoints" :key="viewpoint.guid">
|
|
17
|
+
<img
|
|
18
|
+
v-if="viewpoint.snapshot.snapshot_data"
|
|
19
|
+
:src="viewpoint.snapshot.snapshot_data"
|
|
20
|
+
@click="$emit('view-topic-viewpoint', viewpoint)"
|
|
21
|
+
/>
|
|
22
|
+
<BIMDataIcon v-if="viewpoint.icon" class="icon" :name="viewpoint.icon" size="xl" />
|
|
23
|
+
</div>
|
|
24
|
+
</BIMDataCarousel>
|
|
25
|
+
</template>
|
|
26
|
+
<template v-else>
|
|
27
|
+
<BcfTopicDefaultImage class="default-image" />
|
|
28
|
+
</template>
|
|
29
|
+
</div>
|
|
30
|
+
</template>
|
|
31
|
+
|
|
32
|
+
<script>
|
|
33
|
+
import { adjustTextColor } from "@bimdata/design-system/src/BIMDataComponents/BIMDataColorSelector/colors.js";
|
|
34
|
+
import { computed } from "vue";
|
|
35
|
+
import { getStatusColor } from "../../../utils/topic.js";
|
|
36
|
+
import { getViewpointConfig } from "../../../utils/viewpoints.js";
|
|
37
|
+
// Components
|
|
38
|
+
import BIMDataCarousel from "@bimdata/design-system/src/BIMDataComponents/BIMDataCarousel/BIMDataCarousel.vue";
|
|
39
|
+
import BIMDataIconInformation from "@bimdata/design-system/src/BIMDataComponents/BIMDataIcon/BIMDataIconStandalone/BIMDataIconInformation.vue";
|
|
40
|
+
import BIMDataIcon from "@bimdata/design-system/src/BIMDataComponents/BIMDataIcon/BIMDataIcon.vue";
|
|
41
|
+
import BcfTopicDefaultImage from "../../bcf-topic-card/BcfTopicDefaultImage.vue";
|
|
42
|
+
|
|
43
|
+
export default {
|
|
44
|
+
components: {
|
|
45
|
+
BcfTopicDefaultImage,
|
|
46
|
+
BIMDataCarousel,
|
|
47
|
+
BIMDataIcon,
|
|
48
|
+
BIMDataIconInformation,
|
|
49
|
+
},
|
|
50
|
+
props: {
|
|
51
|
+
detailedExtensions: {
|
|
52
|
+
type: Object,
|
|
53
|
+
required: true,
|
|
54
|
+
},
|
|
55
|
+
topic: {
|
|
56
|
+
type: Object,
|
|
57
|
+
required: true,
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
emits: ["view-topic-viewpoint"],
|
|
61
|
+
setup(props) {
|
|
62
|
+
const viewpoints = computed(() =>
|
|
63
|
+
(props.topic.viewpoints ?? [])
|
|
64
|
+
.filter((v) => v.snapshot)
|
|
65
|
+
.map((viewpoint) => ({
|
|
66
|
+
...viewpoint,
|
|
67
|
+
icon: getViewpointConfig(viewpoint)?.icon,
|
|
68
|
+
}))
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
const statusColor = computed(() => getStatusColor(props.topic, props.detailedExtensions));
|
|
72
|
+
|
|
73
|
+
return {
|
|
74
|
+
// References
|
|
75
|
+
statusColor,
|
|
76
|
+
viewpoints,
|
|
77
|
+
// Methods
|
|
78
|
+
adjustTextColor,
|
|
79
|
+
};
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
</script>
|
|
83
|
+
|
|
84
|
+
<style scoped lang="scss" src="./BcfTopicViewpoints.scss"></style>
|