@bimdata/bcf-components 6.0.0-rc.9 → 6.0.1-rc.1
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 +115 -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 +540 -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 +348 -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 +355 -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,48 @@
|
|
|
1
|
+
.setting-card-item {
|
|
2
|
+
position: relative;
|
|
3
|
+
height: 37px;
|
|
4
|
+
margin-bottom: calc(var(--spacing-unit) / 2);
|
|
5
|
+
padding: 0 var(--spacing-unit);
|
|
6
|
+
background-color: var(--color-silver-light);
|
|
7
|
+
|
|
8
|
+
display: flex;
|
|
9
|
+
justify-content: space-between;
|
|
10
|
+
align-items: center;
|
|
11
|
+
|
|
12
|
+
&__actions {
|
|
13
|
+
display: flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
&__color {
|
|
18
|
+
display: block;
|
|
19
|
+
width: 19px;
|
|
20
|
+
height: 19px;
|
|
21
|
+
margin-left: var(--spacing-unit);
|
|
22
|
+
border-radius: 3px;
|
|
23
|
+
border: 1px solid var(--color-silver);
|
|
24
|
+
cursor: pointer;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&__color-selector {
|
|
28
|
+
position: absolute;
|
|
29
|
+
z-index: 1;
|
|
30
|
+
top: 32px;
|
|
31
|
+
right: calc(var(--spacing-unit) / 2);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&__delete-guard {
|
|
35
|
+
position: absolute;
|
|
36
|
+
right: 0;
|
|
37
|
+
width: 100%;
|
|
38
|
+
height: 100%;
|
|
39
|
+
padding: 0 var(--spacing-unit);
|
|
40
|
+
box-shadow: var(--box-shadow);
|
|
41
|
+
background-color: var(--color-white);
|
|
42
|
+
|
|
43
|
+
display: flex;
|
|
44
|
+
justify-content: space-between;
|
|
45
|
+
align-items: center;
|
|
46
|
+
gap: var(--spacing-unit);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<li class="setting-card-item">
|
|
3
|
+
<span v-if="!editMode">
|
|
4
|
+
{{ extension[getExtensionField(extensionType)] }}
|
|
5
|
+
</span>
|
|
6
|
+
|
|
7
|
+
<BIMDataInput v-else ref="input" v-model="extensionName" @keyup.enter.stop="submitValue" />
|
|
8
|
+
|
|
9
|
+
<div class="setting-card-item__actions">
|
|
10
|
+
<BIMDataButton color="primary" ghost rounded icon @click="editMode = !editMode">
|
|
11
|
+
<BIMDataIcon :name="editMode ? 'close' : 'edit'" size="xxs" />
|
|
12
|
+
</BIMDataButton>
|
|
13
|
+
<BIMDataButton color="high" ghost rounded icon @click="isOpenDeleteGuard = true">
|
|
14
|
+
<BIMDataIconDelete size="xxs" />
|
|
15
|
+
</BIMDataButton>
|
|
16
|
+
|
|
17
|
+
<template v-if="EXTENSION_WITH_COLOR.includes(extensionType)">
|
|
18
|
+
<span
|
|
19
|
+
class="setting-card-item__color"
|
|
20
|
+
:style="{
|
|
21
|
+
'border-color': adjustBorderColor(`${extensionColor}`, -50),
|
|
22
|
+
'background-color': `#${extensionColor}`,
|
|
23
|
+
}"
|
|
24
|
+
@click="isOpenColorSelector = true"
|
|
25
|
+
>
|
|
26
|
+
</span>
|
|
27
|
+
<BIMDataColorSelector
|
|
28
|
+
v-if="isOpenColorSelector"
|
|
29
|
+
class="setting-card-item__color-selector"
|
|
30
|
+
v-click-away="() => (isOpenColorSelector = false)"
|
|
31
|
+
:modelValue="extensionColor"
|
|
32
|
+
@update:modelValue="submitColor"
|
|
33
|
+
/>
|
|
34
|
+
</template>
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
<div v-if="isOpenDeleteGuard" class="setting-card-item__delete-guard">
|
|
38
|
+
<p>
|
|
39
|
+
{{ $t("BcfComponents.SettingCard.deleteExtensionText") }}
|
|
40
|
+
</p>
|
|
41
|
+
<div class="flex items-center">
|
|
42
|
+
<BIMDataButton
|
|
43
|
+
class="m-r-6"
|
|
44
|
+
height="28px"
|
|
45
|
+
color="high"
|
|
46
|
+
fill
|
|
47
|
+
radius
|
|
48
|
+
@click="submitDelete(extension)"
|
|
49
|
+
>
|
|
50
|
+
{{ $t("BcfComponents.SettingCard.deleteButton") }}
|
|
51
|
+
</BIMDataButton>
|
|
52
|
+
<BIMDataButton color="primary" ghost rounded icon @click="isOpenDeleteGuard = false">
|
|
53
|
+
<BIMDataIconClose size="xxxs" />
|
|
54
|
+
</BIMDataButton>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
</li>
|
|
58
|
+
</template>
|
|
59
|
+
|
|
60
|
+
<script>
|
|
61
|
+
import { adjustBorderColor } from "@bimdata/design-system/src/BIMDataComponents/BIMDataColorSelector/colors.js";
|
|
62
|
+
import { ref, watch } from "vue";
|
|
63
|
+
import { EXTENSION_WITH_COLOR } from "../../../config.js";
|
|
64
|
+
import { getExtensionField } from "../../../utils/extensions.js";
|
|
65
|
+
// Components
|
|
66
|
+
import BIMDataButton from "@bimdata/design-system/src/BIMDataComponents/BIMDataButton/BIMDataButton.vue";
|
|
67
|
+
import BIMDataColorSelector from "@bimdata/design-system/src/BIMDataComponents/BIMDataColorSelector/BIMDataColorSelector.vue";
|
|
68
|
+
import {
|
|
69
|
+
BIMDataIconDelete,
|
|
70
|
+
BIMDataIconClose,
|
|
71
|
+
} from "@bimdata/design-system/src/BIMDataComponents/BIMDataIcon/BIMDataIconStandalone/index.js";
|
|
72
|
+
import BIMDataInput from "@bimdata/design-system/src/BIMDataComponents/BIMDataInput/BIMDataInput.vue";
|
|
73
|
+
|
|
74
|
+
export default {
|
|
75
|
+
components: {
|
|
76
|
+
BIMDataButton,
|
|
77
|
+
BIMDataColorSelector,
|
|
78
|
+
BIMDataIconDelete,
|
|
79
|
+
BIMDataIconClose,
|
|
80
|
+
BIMDataInput,
|
|
81
|
+
},
|
|
82
|
+
props: {
|
|
83
|
+
extensionType: {
|
|
84
|
+
type: String,
|
|
85
|
+
},
|
|
86
|
+
extension: {
|
|
87
|
+
type: Object,
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
emits: ["update-extension", "delete-extension"],
|
|
91
|
+
setup(props, { emit }) {
|
|
92
|
+
const editMode = ref(false);
|
|
93
|
+
const isOpenColorSelector = ref(false);
|
|
94
|
+
const isOpenDeleteGuard = ref(false);
|
|
95
|
+
|
|
96
|
+
const extensionName = ref(props.extension[getExtensionField(props.extensionType)]);
|
|
97
|
+
const extensionColor = ref(props.extension.color);
|
|
98
|
+
|
|
99
|
+
const input = ref(null);
|
|
100
|
+
watch(editMode, () => setTimeout(() => editMode.value && input.value.focus(), 50));
|
|
101
|
+
|
|
102
|
+
const submitValue = async () => {
|
|
103
|
+
if (extensionName.value !== props.extension[getExtensionField(props.extensionType)]) {
|
|
104
|
+
emit("update-extension", {
|
|
105
|
+
extensionType: props.extensionType,
|
|
106
|
+
extension: props.extension,
|
|
107
|
+
data: { value: extensionName.value },
|
|
108
|
+
});
|
|
109
|
+
editMode.value = false;
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
const submitColor = async (colorValue) => {
|
|
114
|
+
if (colorValue !== props.extension.color) {
|
|
115
|
+
emit("update-extension", {
|
|
116
|
+
extensionType: props.extensionType,
|
|
117
|
+
extension: props.extension,
|
|
118
|
+
data: { color: colorValue },
|
|
119
|
+
});
|
|
120
|
+
extensionColor.value = colorValue;
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
const submitDelete = async (extension) => {
|
|
125
|
+
emit("delete-extension", {
|
|
126
|
+
extensionType: props.extensionType,
|
|
127
|
+
extension,
|
|
128
|
+
});
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
return {
|
|
132
|
+
// References
|
|
133
|
+
editMode,
|
|
134
|
+
extensionColor,
|
|
135
|
+
extensionName,
|
|
136
|
+
EXTENSION_WITH_COLOR,
|
|
137
|
+
input,
|
|
138
|
+
isOpenColorSelector,
|
|
139
|
+
isOpenDeleteGuard,
|
|
140
|
+
// Methods
|
|
141
|
+
adjustBorderColor,
|
|
142
|
+
getExtensionField,
|
|
143
|
+
submitColor,
|
|
144
|
+
submitDelete,
|
|
145
|
+
submitValue,
|
|
146
|
+
};
|
|
147
|
+
},
|
|
148
|
+
};
|
|
149
|
+
</script>
|
|
150
|
+
|
|
151
|
+
<style scoped lang="scss" src="./SettingCardItem.scss"></style>
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
.bcf-statistics {
|
|
2
|
+
width: 100%;
|
|
3
|
+
|
|
4
|
+
&__content {
|
|
5
|
+
position: relative;
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
|
|
9
|
+
&__chart {
|
|
10
|
+
flex: 1;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
&__legend {
|
|
14
|
+
flex: 1;
|
|
15
|
+
height: 100%;
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
gap: var(--spacing-unit);
|
|
19
|
+
margin-left: var(--spacing-unit);
|
|
20
|
+
font-size: 14px;
|
|
21
|
+
|
|
22
|
+
&__title {
|
|
23
|
+
font-weight: bold;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&__item {
|
|
27
|
+
display: flex;
|
|
28
|
+
align-items: center;
|
|
29
|
+
line-height: 24px;
|
|
30
|
+
|
|
31
|
+
&__mark {
|
|
32
|
+
width: 10px;
|
|
33
|
+
height: 10px;
|
|
34
|
+
border: 3px solid;
|
|
35
|
+
border-radius: 50px;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&__percent {
|
|
39
|
+
margin: 0 calc(var(--spacing-unit) / 2);
|
|
40
|
+
min-width: 30px;
|
|
41
|
+
font-weight: bold;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&__text .count {
|
|
45
|
+
font-size: 13px;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
:deep(.bimdata-paginated-list) {
|
|
50
|
+
ul:first-child {
|
|
51
|
+
min-height: 144px;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="bcf-statistics">
|
|
3
|
+
<div class="bcf-statistics__content">
|
|
4
|
+
<BIMDataSimplePieChart
|
|
5
|
+
class="bcf-statistics__content__chart"
|
|
6
|
+
:barsData="chartData"
|
|
7
|
+
:placeholder="true"
|
|
8
|
+
:placeholderStrokeWidth="10"
|
|
9
|
+
:graphDrawTime="2.5"
|
|
10
|
+
/>
|
|
11
|
+
|
|
12
|
+
<div
|
|
13
|
+
class="bcf-statistics__content__legend"
|
|
14
|
+
>
|
|
15
|
+
<div class="bcf-statistics__content__legend__title">
|
|
16
|
+
{{ $t(`BcfComponents.BcfStatistics.extension.${extensionType}Title`) }}
|
|
17
|
+
</div>
|
|
18
|
+
<BIMDataPaginatedList
|
|
19
|
+
:list="chartData"
|
|
20
|
+
:perPage="6"
|
|
21
|
+
:first="false"
|
|
22
|
+
:last="false"
|
|
23
|
+
:numberDataElements="false"
|
|
24
|
+
:backgroundColor="'transparent'"
|
|
25
|
+
>
|
|
26
|
+
<template #element="{ element: data }">
|
|
27
|
+
<div class="bcf-statistics__content__legend__item">
|
|
28
|
+
<span
|
|
29
|
+
class="bcf-statistics__content__legend__item__mark"
|
|
30
|
+
:style="{ borderColor: data.color }"
|
|
31
|
+
></span>
|
|
32
|
+
<span class="bcf-statistics__content__legend__item__percent">
|
|
33
|
+
{{ data.percentage.toFixed(0) }} %
|
|
34
|
+
</span>
|
|
35
|
+
<span class="bcf-statistics__content__legend__item__text">
|
|
36
|
+
{{
|
|
37
|
+
data.label ||
|
|
38
|
+
$t(`BcfComponents.BcfStatistics.extension.${extensionType}NotDefined`)
|
|
39
|
+
}}
|
|
40
|
+
<span class="count">
|
|
41
|
+
({{ data.count }})
|
|
42
|
+
</span>
|
|
43
|
+
</span>
|
|
44
|
+
</div>
|
|
45
|
+
</template>
|
|
46
|
+
</BIMDataPaginatedList>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
</template>
|
|
51
|
+
|
|
52
|
+
<script>
|
|
53
|
+
import { computed } from "vue";
|
|
54
|
+
import { DEFAULT_PRIORITY_COLOR } from "../../config.js";
|
|
55
|
+
import { getAvailableExtensions, getExtensionField } from "../../utils/extensions.js";
|
|
56
|
+
// Components
|
|
57
|
+
import BIMDataPaginatedList from "@bimdata/design-system/src/BIMDataComponents/BIMDataPaginatedList/BIMDataPaginatedList.vue";
|
|
58
|
+
import BIMDataSimplePieChart from "@bimdata/design-system/src/BIMDataComponents/BIMDataSimplePieChart/BIMDataSimplePieChart.vue";
|
|
59
|
+
|
|
60
|
+
export default {
|
|
61
|
+
components: {
|
|
62
|
+
BIMDataPaginatedList,
|
|
63
|
+
BIMDataSimplePieChart,
|
|
64
|
+
},
|
|
65
|
+
props: {
|
|
66
|
+
detailedExtensions: {
|
|
67
|
+
type: Object,
|
|
68
|
+
required: true
|
|
69
|
+
},
|
|
70
|
+
extensionType: {
|
|
71
|
+
type: String
|
|
72
|
+
},
|
|
73
|
+
topics: {
|
|
74
|
+
type: Array,
|
|
75
|
+
required: true
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
setup(props) {
|
|
79
|
+
const chartData = computed(() => {
|
|
80
|
+
if (props.topics.length === 0) return [];
|
|
81
|
+
|
|
82
|
+
const extField = getExtensionField(props.extensionType);
|
|
83
|
+
const displayedExtensions = getAvailableExtensions(props.extensionType, props.detailedExtensions);
|
|
84
|
+
|
|
85
|
+
// Add an undefined extension value to match topics
|
|
86
|
+
// that have no value for this extension.
|
|
87
|
+
displayedExtensions.push({ [extField]: undefined });
|
|
88
|
+
|
|
89
|
+
return displayedExtensions
|
|
90
|
+
.map(extension => {
|
|
91
|
+
const topicCount = props.topics
|
|
92
|
+
.filter(topic => topic[extField] === extension[extField])
|
|
93
|
+
.length;
|
|
94
|
+
|
|
95
|
+
return {
|
|
96
|
+
label: extension[extField],
|
|
97
|
+
color: `#${extension.color ?? DEFAULT_PRIORITY_COLOR}`,
|
|
98
|
+
count: topicCount,
|
|
99
|
+
percentage: (topicCount * 100) / props.topics.length
|
|
100
|
+
};
|
|
101
|
+
})
|
|
102
|
+
.sort((a, b) => b.percentage - a.percentage);
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
return {
|
|
106
|
+
chartData
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
</script>
|
|
111
|
+
|
|
112
|
+
<style scoped lang="scss" src="./BcfStatistics.scss"></style>
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
.bcf-topic-card {
|
|
2
|
+
position: relative;
|
|
3
|
+
width: 336px;
|
|
4
|
+
height: 308px;
|
|
5
|
+
box-shadow: var(--box-shadow);
|
|
6
|
+
|
|
7
|
+
&.selected{
|
|
8
|
+
outline: 3px solid var(--color-primary);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
&__header {
|
|
12
|
+
height: 32px;
|
|
13
|
+
padding-right: var(--spacing-unit);
|
|
14
|
+
background-color: var(--color-white);
|
|
15
|
+
display: flex;
|
|
16
|
+
gap: var(--spacing-unit);
|
|
17
|
+
|
|
18
|
+
.index {
|
|
19
|
+
padding: 3px;
|
|
20
|
+
min-width: 32px;
|
|
21
|
+
background-color: var(--color-silver);
|
|
22
|
+
color: var(--color-text);
|
|
23
|
+
display: flex;
|
|
24
|
+
justify-content: center;
|
|
25
|
+
align-items: center;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.title {
|
|
29
|
+
width: calc(100% - var(--spacing-unit) * 2 - 44px);
|
|
30
|
+
color: var(--color-primary);
|
|
31
|
+
display: flex;
|
|
32
|
+
align-items: center;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.checkbox {
|
|
36
|
+
display: flex;
|
|
37
|
+
align-items: center;
|
|
38
|
+
|
|
39
|
+
:deep(.bimdata-checkbox__mark) {
|
|
40
|
+
width: 15px;
|
|
41
|
+
height: 15px;
|
|
42
|
+
&::after {
|
|
43
|
+
top: 2px;
|
|
44
|
+
left: 4px;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&__image {
|
|
51
|
+
height: 171px;
|
|
52
|
+
position: relative;
|
|
53
|
+
display: flex;
|
|
54
|
+
justify-content: center;
|
|
55
|
+
align-items: center;
|
|
56
|
+
|
|
57
|
+
img {
|
|
58
|
+
width: 100%;
|
|
59
|
+
height: 100%;
|
|
60
|
+
object-fit: cover;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.img-default {
|
|
64
|
+
width: 120px;
|
|
65
|
+
height: 120px;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.status {
|
|
69
|
+
position: absolute;
|
|
70
|
+
top: 6px;
|
|
71
|
+
left: 6px;
|
|
72
|
+
border-radius: 3px;
|
|
73
|
+
padding: calc(var(--spacing-unit) / 2);
|
|
74
|
+
display: flex;
|
|
75
|
+
align-items: center;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.date {
|
|
79
|
+
position: absolute;
|
|
80
|
+
bottom: 0;
|
|
81
|
+
right: 0;
|
|
82
|
+
padding: calc(var(--spacing-unit) / 2);
|
|
83
|
+
font-size: 11px;
|
|
84
|
+
background-color: var(--color-white);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
&__content {
|
|
89
|
+
height: 105px;
|
|
90
|
+
padding: var(--spacing-unit);
|
|
91
|
+
border-top: 3px solid var(--color-silver-light);
|
|
92
|
+
font-size: 12px;
|
|
93
|
+
background-color: var(--color-white);
|
|
94
|
+
color: var(--color-text);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="bcf-topic-card"
|
|
4
|
+
:class="{ selected }"
|
|
5
|
+
@mouseover="hover = true"
|
|
6
|
+
@mouseleave="hover = false"
|
|
7
|
+
>
|
|
8
|
+
<div class="bcf-topic-card__header">
|
|
9
|
+
<div
|
|
10
|
+
class="index"
|
|
11
|
+
:style="{
|
|
12
|
+
'background-color': `#${priorityColor}`,
|
|
13
|
+
color: adjustTextColor(`#${priorityColor}`, '#FFF', 'var(--color-text)'),
|
|
14
|
+
}"
|
|
15
|
+
>
|
|
16
|
+
{{ topic.index }}
|
|
17
|
+
</div>
|
|
18
|
+
<div class="title">
|
|
19
|
+
<BIMDataTextbox maxWidth="100% - 48px" :text="topic.title" />
|
|
20
|
+
</div>
|
|
21
|
+
<div class="checkbox">
|
|
22
|
+
<BIMDataCheckbox
|
|
23
|
+
v-show="selectable && hover"
|
|
24
|
+
:modelValue="selected"
|
|
25
|
+
@update:modelValue="$emit('update:selected', $event)"
|
|
26
|
+
/>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
<div class="bcf-topic-card__image">
|
|
31
|
+
<div
|
|
32
|
+
v-if="topic.topic_status"
|
|
33
|
+
class="status"
|
|
34
|
+
:style="{
|
|
35
|
+
'background-color': `#${statusColor}`,
|
|
36
|
+
color: adjustTextColor(`#${statusColor}`, '#FFF', 'var(--color-text)'),
|
|
37
|
+
}"
|
|
38
|
+
>
|
|
39
|
+
<BIMDataIconInformation fill color="default" />
|
|
40
|
+
<span class="m-l-6">{{ topic.topic_status }}</span>
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<div class="date">
|
|
44
|
+
{{ $d(topic.creation_date, "short") }}
|
|
45
|
+
</div>
|
|
46
|
+
|
|
47
|
+
<img v-if="topicImage" :src="topicImage" alt="topic viewpoint" loading="lazy" />
|
|
48
|
+
<BcfTopicDefaultImage v-else class="img-default" />
|
|
49
|
+
</div>
|
|
50
|
+
|
|
51
|
+
<div class="bcf-topic-card__content">
|
|
52
|
+
<div>
|
|
53
|
+
<strong>
|
|
54
|
+
{{ $t("BcfComponents.BcfTopicCard.priority") }}
|
|
55
|
+
</strong>
|
|
56
|
+
<span :style="{ color: `#${priorityColor}` }">
|
|
57
|
+
{{ topic.priority || $t("BcfComponents.BcfTopicCard.noPriority") }}
|
|
58
|
+
</span>
|
|
59
|
+
</div>
|
|
60
|
+
<div>
|
|
61
|
+
<strong>
|
|
62
|
+
{{ $t("BcfComponents.BcfTopicCard.assignedTo") }}
|
|
63
|
+
</strong>
|
|
64
|
+
<span>
|
|
65
|
+
{{ topic.assigned_to || $t("BcfComponents.BcfTopicCard.notSpecified") }}
|
|
66
|
+
</span>
|
|
67
|
+
</div>
|
|
68
|
+
<div class="flex justify-around m-t-12">
|
|
69
|
+
<div class="flex items-center">
|
|
70
|
+
<BIMDataIconModel3D fill color="default" size="xs" />
|
|
71
|
+
<span class="m-l-6">
|
|
72
|
+
{{ $t("BcfComponents.BcfTopicCard.elements", { n: topicObjects.length }) }}
|
|
73
|
+
</span>
|
|
74
|
+
</div>
|
|
75
|
+
<BIMDataButton width="48%" color="primary" fill radius @click="$emit('open-topic', topic)">
|
|
76
|
+
{{ $t("BcfComponents.BcfTopicCard.see") }}
|
|
77
|
+
</BIMDataButton>
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
</template>
|
|
82
|
+
|
|
83
|
+
<script>
|
|
84
|
+
import { adjustTextColor } from "@bimdata/design-system/src/BIMDataComponents/BIMDataColorSelector/colors.js";
|
|
85
|
+
import { computed, ref } from "vue";
|
|
86
|
+
import { getPriorityColor, getStatusColor } from "../../utils/topic.js";
|
|
87
|
+
// Components
|
|
88
|
+
import BIMDataButton from "@bimdata/design-system/src/BIMDataComponents/BIMDataButton/BIMDataButton.vue";
|
|
89
|
+
import {
|
|
90
|
+
BIMDataIconInformation,
|
|
91
|
+
BIMDataIconModel3D,
|
|
92
|
+
} from "@bimdata/design-system/src/BIMDataComponents/BIMDataIcon/BIMDataIconStandalone/index.js";
|
|
93
|
+
import BIMDataTextbox from "@bimdata/design-system/src/BIMDataComponents/BIMDataTextbox/BIMDataTextbox.vue";
|
|
94
|
+
import BcfTopicDefaultImage from "./BcfTopicDefaultImage.vue";
|
|
95
|
+
|
|
96
|
+
export default {
|
|
97
|
+
components: {
|
|
98
|
+
BcfTopicDefaultImage,
|
|
99
|
+
BIMDataButton,
|
|
100
|
+
BIMDataIconInformation,
|
|
101
|
+
BIMDataIconModel3D,
|
|
102
|
+
BIMDataTextbox,
|
|
103
|
+
},
|
|
104
|
+
props: {
|
|
105
|
+
detailedExtensions: {
|
|
106
|
+
type: Object,
|
|
107
|
+
required: true,
|
|
108
|
+
},
|
|
109
|
+
topic: {
|
|
110
|
+
type: Object,
|
|
111
|
+
required: true,
|
|
112
|
+
},
|
|
113
|
+
selectable: {
|
|
114
|
+
type: Boolean,
|
|
115
|
+
default: false,
|
|
116
|
+
},
|
|
117
|
+
selected: {
|
|
118
|
+
type: Boolean,
|
|
119
|
+
default: false,
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
emits: ["open-topic", "update:selected"],
|
|
123
|
+
setup(props) {
|
|
124
|
+
const hover = ref(false);
|
|
125
|
+
|
|
126
|
+
const priorityColor = computed(() => getPriorityColor(props.topic, props.detailedExtensions));
|
|
127
|
+
|
|
128
|
+
const statusColor = computed(() => getStatusColor(props.topic, props.detailedExtensions));
|
|
129
|
+
|
|
130
|
+
const topicImage = computed(
|
|
131
|
+
() => props.topic.viewpoints?.filter((v) => v.snapshot)[0]?.snapshot.snapshot_data
|
|
132
|
+
);
|
|
133
|
+
|
|
134
|
+
const topicObjects = computed(() => props.topic.viewpoints?.[0]?.components?.selection ?? []);
|
|
135
|
+
|
|
136
|
+
return {
|
|
137
|
+
// References
|
|
138
|
+
hover,
|
|
139
|
+
priorityColor,
|
|
140
|
+
statusColor,
|
|
141
|
+
topicImage,
|
|
142
|
+
topicObjects,
|
|
143
|
+
// Methods
|
|
144
|
+
adjustTextColor,
|
|
145
|
+
};
|
|
146
|
+
},
|
|
147
|
+
};
|
|
148
|
+
</script>
|
|
149
|
+
|
|
150
|
+
<style scoped lang="scss" src="./BcfTopicCard.scss"></style>
|