Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/drop down menu improvement #286

Merged
merged 2 commits into from
Apr 5, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
@click="onHeaderClick"
:style="style"
>
<slot name="header"></slot>
<slot name="contentAfterHeader"></slot>
<slot name="header" :isOpen="displayed" />
</div>

<transition :name="`slide-fade-${transitionName}`">
Expand Down
41 changes: 18 additions & 23 deletions src/web/views/Components/DropdownMenu/DropdownMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@
:menuItems="checkboxTwoLevelChecked ? multiLevelList : []"
:header="checkboxDisabledHeader"
>
<template #header v-if="checkboxHeaderChecked">
<template #header="{ isOpen }" v-if="checkboxHeaderChecked">
<span>dropdown menu example</span>
</template>
<template #contentAfterHeader v-if="checkboxAfterHeaderChecked">
hi
<BIMDataIcon
name="chevron"
:rotate="isOpen ? 90 : 0"
size="xxs"
/>
</template>
<template #element v-if="checkboxElementSlotChecked">
<ul class="bimdata-list">
Expand Down Expand Up @@ -81,11 +83,6 @@
>
<BIMDataCheckbox text="header" v-model="checkboxHeaderChecked">
</BIMDataCheckbox>
<BIMDataCheckbox
text="contentAfterHeader"
v-model="checkboxAfterHeaderChecked"
>
</BIMDataCheckbox>
<BIMDataCheckbox text="element" v-model="checkboxElementSlotChecked">
</BIMDataCheckbox>
</template>
Expand All @@ -102,7 +99,7 @@
:header="{{ getHeaderProp() }}"
{{ getMenuItems() }}
&gt;
{{ getHeader() }} {{ getContentAfterBtn() }} {{ getElement() }}
{{ getHeader() }} {{ getElement() }}
&lt;/BIMDataDropdownMenu&gt;
</pre>
</template>
Expand Down Expand Up @@ -132,6 +129,7 @@ import BIMDataCheckbox from "../../../../../src/BIMDataComponents/BIMDataCheckbo
import BIMDataRadio from "../../../../../src/BIMDataComponents/BIMDataRadio/BIMDataRadio.vue";
import BIMDataTable from "../../../../../src/BIMDataComponents/BIMDataTable/BIMDataTable.vue";
import BIMDataText from "../../../../../src/BIMDataComponents/BIMDataText/BIMDataText.vue";
import BIMDataIcon from "../../../../../src/BIMDataComponents/BIMDataIcon/BIMDataIcon.vue";

import BIMDataDropdownMenu from "../../../../../src/BIMDataComponents/BIMDataDropdownMenu/BIMDataDropdownMenu.vue";
export default {
Expand All @@ -142,6 +140,7 @@ export default {
BIMDataTable,
BIMDataText,
BIMDataDropdownMenu,
BIMDataIcon,
},
data() {
return {
Expand Down Expand Up @@ -236,10 +235,9 @@ export default {
],
slotData: [
["Slot name", "Description"],
["header", "Use this slot for add content "],
[
"contentAfterHeader",
"Use this slot for add content after the header slot",
"header",
"Use this slot to add title content. Available slot props : isOpen (true when the menu is open)",
],
[
"element",
Expand All @@ -251,16 +249,13 @@ export default {
methods: {
getHeader() {
if (this.checkboxHeaderChecked) {
return `<template #header>
dropdown menu example
</template>
`;
}
},
getContentAfterBtn() {
if (this.checkboxAfterHeaderChecked) {
return `<template #contentAfterHeader>
hi
return `<template #header="{ isOpen }">
<span>dropdown menu example</span>
<BIMDataIcon
name="chevron"
:rotate="isOpen ? 90 : 0"
size="xxs"
/>
</template>
`;
}
Expand Down