Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions src/BIMDataComponents/BIMDataAvatar/BIMDataAvatar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@ import { computed } from "vue";
import BIMDataIconUser from "../BIMDataIcon/BIMDataIconStandalone/BIMDataIconUser.vue";

export default {
inject: {
darkThemeRef: {
from: "BIMDATA_DESIGN_SYSTEM_DARK_THEME",
default: () => ({ value: false }),
},
},
props: {
user: {
type: Object,
Expand All @@ -39,23 +33,24 @@ export default {
size: {
type: [Number, String],
default: 32,
validate: (value) => value >= 32,
validate: value => value >= 32,
},
initialsSize: {
type: [Number, String],
},
color: {
type: String,
default: "primary",
validate: (value) => ["primary", "secondary", "silver-light"].includes(value),
validate: value =>
["primary", "secondary", "silver-light"].includes(value),
},
},
setup(props) {
const initials = computed(() =>
(
`${props.user.firstname?.[0] ?? ""}` +
`${props.user.lastname?.[0] ?? ""}`
).toUpperCase()
).toUpperCase(),
);

return {
Expand Down
12 changes: 3 additions & 9 deletions src/BIMDataComponents/BIMDataCheckbox/BIMDataCheckbox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,12 @@
</template>

<script>
import darkThemeMixin from "../mixins/darkTheme.js";

export default {
name: "BIMDataCheckbox",
inheritAttrs: false,
inject: {
darkThemeRef: {
from: "BIMDATA_DESIGN_SYSTEM_DARK_THEME",
default: () => ({ value: false }),
},
},
mixins: [darkThemeMixin],
props: {
text: {
type: String,
Expand Down Expand Up @@ -76,9 +73,6 @@ export default {
height: `clamp(14px, calc(${size} * 1.1), 20px)`,
};
},
isDark() {
return this.darkThemeRef;
},
},
methods: {
onClick() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<script>
import { colors } from "./colors.js";
import BIMDataCard from "../BIMDataCard/BIMDataCard.vue";
import darkThemeMixin from "../mixins/darkTheme.js";

const colorLines = Object.entries(colors).reduce((acc, cur, i) => {
if (i % 5 === 0) {
Expand All @@ -37,12 +38,7 @@ export default {
components: {
BIMDataCard,
},
inject: {
darkThemeRef: {
from: "BIMDATA_DESIGN_SYSTEM_DARK_THEME",
default: () => ({ value: false }),
},
},
mixins: [darkThemeMixin],
props: {
modelValue: {
type: String,
Expand All @@ -56,11 +52,6 @@ export default {
colorLines,
};
},
computed: {
isDark() {
return this.darkThemeRef;
},
}
};
</script>

Expand Down
12 changes: 2 additions & 10 deletions src/BIMDataComponents/BIMDataDatePicker/BIMDataDatePicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ import DisabledDate from "./utils/DisabledDate.js";
import inputProps from "./mixins/inputProps.vue";
import makeDateUtils from "./utils/DateUtils.js";
import navMixin from "./mixins/navMixin.vue";
import darkThemeMixin from "../mixins/darkTheme.js";
import PickerDay from "./components/PickerDay.vue";
import PickerMonth from "./components/PickerMonth.vue";
import PickerYear from "./components/PickerYear.vue";
Expand All @@ -210,17 +211,11 @@ export default {
PickerMonth,
PickerYear,
},
mixins: [inputProps, navMixin],
mixins: [inputProps, navMixin, darkThemeMixin],
model: {
prop: "modelValue",
event: "update:modelValue",
},
inject: {
darkThemeRef: {
from: "BIMDATA_DESIGN_SYSTEM_DARK_THEME",
default: () => ({ value: false }),
},
},
props: {
autoCloseRange: {
type: Boolean,
Expand Down Expand Up @@ -444,9 +439,6 @@ export default {
translation() {
return this.language;
},
isDark() {
return this.darkThemeRef;
},
},
watch: {
disabledDates: {
Expand Down
14 changes: 3 additions & 11 deletions src/BIMDataComponents/BIMDataDatePicker/components/DateInput.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div :class="{ 'not-empty': formattedValue, 'dark': isDark }">
<div :class="{ 'not-empty': formattedValue, dark: isDark }">
<slot name="beforeDateInput" />
<!-- Calendar Button -->
<button
Expand Down Expand Up @@ -76,17 +76,12 @@ import BIMDataButton from "../../BIMDataButton/BIMDataButton.vue";

import makeDateUtils from "../utils/DateUtils.js";
import inputProps from "../mixins/inputProps.vue";
import darkThemeMixin from "../../mixins/darkTheme.js";

export default {
name: "DateInput",
components: { BIMDataIconDelete, BIMDataButton },
mixins: [inputProps],
inject: {
darkThemeRef: {
from: "BIMDATA_DESIGN_SYSTEM_DARK_THEME",
default: () => ({ value: false }),
},
},
mixins: [inputProps, darkThemeMixin],
props: {
isOpen: {
type: Boolean,
Expand Down Expand Up @@ -128,9 +123,6 @@ export default {

return this.formatDate(this.selectedDate);
},
isDark() {
return this.darkThemeRef;
},
},
watch: {
showCalendarOnFocus: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ import clickaway from "../../BIMDataDirectives/click-away.js";
import BIMDataIconChevron from "../BIMDataIcon/BIMDataIconStandalone/BIMDataIconChevron.vue";
import BIMDataPaginatedList from "../BIMDataPaginatedList/BIMDataPaginatedList.vue";
import BIMDataButton from "../BIMDataButton/BIMDataButton.vue";
import darkThemeMixin from "../mixins/darkTheme.js";

export default {
components: {
Expand All @@ -82,12 +83,7 @@ export default {
BIMDataButton,
},
directives: { clickaway },
inject: {
darkThemeRef: {
from: "BIMDATA_DESIGN_SYSTEM_DARK_THEME",
default: () => ({ value: false }),
},
},
mixins: [darkThemeMixin],
props: {
list: {
type: Array,
Expand Down Expand Up @@ -186,9 +182,6 @@ export default {
);
}
},
isDark() {
return this.darkThemeRef;
},
},
methods: {
onHeaderClick() {
Expand Down
17 changes: 7 additions & 10 deletions src/BIMDataComponents/BIMDataDropdownMenu/BIMDataDropdownMenu.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<template>
<div class="bimdata-dropdown" v-clickaway="away" :class="{dark: isDark, border}">
<div
class="bimdata-dropdown"
v-clickaway="away"
:class="{ dark: isDark, border }"
>
<div
class="bimdata-dropdown__content"
:class="{ active: displayed, disabled }"
Expand Down Expand Up @@ -75,16 +79,12 @@
import clickaway from "../../BIMDataDirectives/click-away.js";
import BIMDataIconChevron from "../BIMDataIcon/BIMDataIconStandalone/BIMDataIconChevron.vue";
import BIMDataTextbox from "../../BIMDataComponents/BIMDataTextbox/BIMDataTextbox.vue";
import darkThemeMixin from "../mixins/darkTheme.js";

export default {
directives: { clickaway },
components: { BIMDataIconChevron, BIMDataTextbox },
inject: {
darkThemeRef: {
from: "BIMDATA_DESIGN_SYSTEM_DARK_THEME",
default: () => ({ value: false }),
},
},
mixins: [darkThemeMixin],
props: {
disabled: {
type: Boolean,
Expand Down Expand Up @@ -142,9 +142,6 @@ export default {
visibility: this.menuHeader ? "visible" : "hidden",
};
},
isDark() {
return this.darkThemeRef;
},
},
watch: {
header: {
Expand Down
13 changes: 3 additions & 10 deletions src/BIMDataComponents/BIMDataIcon/BIMDataIcon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

<script>
import iconsColors from "../../assets/iconsColors.js";
import darkThemeMixin from "../mixins/darkTheme.js";

const sizeToPixel = {
xxxs: 10,
Expand All @@ -26,12 +27,7 @@ const sizeToPixel = {

export default {
name: "BIMDataIcon",
inject: {
darkThemeRef: {
from: "BIMDATA_DESIGN_SYSTEM_DARK_THEME",
default: () => ({ value: false }),
},
},
mixins: [darkThemeMixin],
props: {
name: {
type: String,
Expand Down Expand Up @@ -81,7 +77,7 @@ export default {
"icon-stroke": this.stroke,
[`icon-fill--${this.color}`]: this.fill && this.color,
[`icon-stroke--${this.color}`]: this.stroke && this.color,
"dark": this.isDark
dark: this.isDark,
};
},
style() {
Expand All @@ -96,9 +92,6 @@ export default {
};
return style;
},
isDark() {
return this.darkThemeRef;
},
},
methods: {
getPixelSize() {
Expand Down
13 changes: 3 additions & 10 deletions src/BIMDataComponents/BIMDataIcon/Icon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

<script>
import iconsColors from "../../assets/iconsColors.js";
import darkThemeMixin from "../mixins/darkTheme.js";

const sizeToPixel = {
xxxs: 10,
Expand All @@ -30,12 +31,7 @@ const sizeToPixel = {

export default {
name: "BIMDataIcon",
inject: {
darkThemeRef: {
from: "BIMDATA_DESIGN_SYSTEM_DARK_THEME",
default: () => ({ value: false }),
},
},
mixins: [darkThemeMixin],
props: {
color: {
type: String,
Expand Down Expand Up @@ -81,7 +77,7 @@ export default {
"icon-stroke": this.stroke,
[`icon-fill--${this.color}`]: this.fill && this.color,
[`icon-stroke--${this.color}`]: this.stroke && this.color,
"dark": this.isDark
dark: this.isDark,
};
},
style() {
Expand All @@ -96,9 +92,6 @@ export default {
};
return style;
},
isDark() {
return this.darkThemeRef;
},
},
methods: {
getPixelSize() {
Expand Down
12 changes: 6 additions & 6 deletions src/BIMDataComponents/BIMDataInfobox/BIMDataInfobox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@
</template>

<script setup>
import { inject, computed } from "vue";
defineProps({
import { useDarkTheme, darkProp } from "../mixins/useDarkTheme.js";

const props = defineProps({
text: {
type: String,
default: "",
Expand All @@ -40,11 +41,10 @@ defineProps({
].includes(v),
default: "neutral",
},
dark: darkProp,
});
const darkThemeRef = inject("BIMDATA_DESIGN_SYSTEM_DARK_THEME", {
value: false,
});
const isDark = computed(() => darkThemeRef?.value);

const isDark = useDarkTheme(props);
</script>

<style scoped>
Expand Down
12 changes: 3 additions & 9 deletions src/BIMDataComponents/BIMDataInput/BIMDataInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,16 @@
</template>

<script>
import darkThemeMixin from "../mixins/darkTheme.js";

let uuid = 0;

export default {
mixins: [darkThemeMixin],
model: {
prop: "modelValue",
event: "update:modelValue",
},
inject: {
darkThemeRef: {
from: "BIMDATA_DESIGN_SYSTEM_DARK_THEME",
default: () => ({ value: false }),
},
},
props: {
autocomplete: {
type: Boolean,
Expand Down Expand Up @@ -164,9 +161,6 @@ export default {
// Si `label` est vide, utilise la valeur de `placeholder`
return this.label || this.placeholder;
},
isDark() {
return this.darkThemeRef;
},
computedBackgroundColor() {
return this.isDark ? this.backgroundColorDark : this.backgroundColor;
},
Expand Down
Loading