diff --git a/src/BIMDataComponents/BIMDataDropdownList/BIMDataDropdownList.vue b/src/BIMDataComponents/BIMDataDropdownList/BIMDataDropdownList.vue
index cf92312b..d0d1db76 100644
--- a/src/BIMDataComponents/BIMDataDropdownList/BIMDataDropdownList.vue
+++ b/src/BIMDataComponents/BIMDataDropdownList/BIMDataDropdownList.vue
@@ -26,24 +26,40 @@
-
-
-
-
-
+
@@ -105,11 +121,20 @@ export default {
type: String,
default: "36px",
},
+ search: {
+ type: Boolean,
+ default: false,
+ },
+ searchPlaceholder: {
+ type: String,
+ default: "Search",
+ },
},
emits: ["element-click"],
data() {
return {
displayed: false,
+ searchText: "",
};
},
computed: {
@@ -122,6 +147,16 @@ export default {
iconRotation() {
return this.displayed ? (this.directionClass === "up" ? -90 : 90) : 0;
},
+ filteredList() {
+ if (this.searchText === "") {
+ return this.list;
+ } else {
+ const lowerCaseSearchText = this.searchText.toLowerCase();
+ return this.list.filter(element => {
+ return element.toLowerCase().includes(lowerCaseSearchText);
+ });
+ }
+ },
},
methods: {
onHeaderClick() {
diff --git a/src/web/views/Components/DropdownList/DropdownList.vue b/src/web/views/Components/DropdownList/DropdownList.vue
index 45e8687d..284cb2a7 100644
--- a/src/web/views/Components/DropdownList/DropdownList.vue
+++ b/src/web/views/Components/DropdownList/DropdownList.vue
@@ -17,11 +17,15 @@
:loading="checkboxLoadingChecked"
:closeOnElementClick="checkboxCloseOnElementClickChecked"
@element-click="onItemClick"
+ :search="checkboxSearchChecked"
>
{{ item }}
dropdown list example
+
+ No result
+
hi
@@ -46,23 +50,29 @@
>
+
+
@@ -113,10 +124,18 @@
:list="list"
:perPage="{{ numberInput }}"
elementKey="dropdown"
- :disabled="{{ checkboxDisabledChecked }}"
- :closeOnElementClick="{{ checkboxCloseOnElementClickChecked }}"
+ {{ checkboxLoadingChecked ? ':loading="true"' : "" }}
+ {{ checkboxDisabledChecked ? ':disabled="true"' : "" }}
+ {{
+ checkboxCloseOnElementClickChecked
+ ? ':closeOnElementClick="true"'
+ : ""
+ }}
+ {{ checkboxSearchChecked ? ':search="true"' : "" }}
>
- {{ getHeader() }} {{ getContentAfterBtn() }} {{ getElement() }}
+ {{ getHeader() }} {{ getContentAfterBtn() }} {{ getElement() }} {{
+ getEmpty()
+ }}
</BIMDataDropdownList>
@@ -161,9 +180,11 @@ export default {
checkboxDisabledChecked: false,
checkboxLoadingChecked: false,
checkboxCloseOnElementClickChecked: false,
+ checkboxSearchChecked: false,
checkboxHeaderChecked: true,
checkboxAfterBtnChecked: false,
checkboxElementChecked: false,
+ checkboxEmptyChecked: false,
customListCheckbox: false,
dropdownOptions: {
transition: ["up", "down"],
@@ -291,6 +312,11 @@ export default {
`;
}
},
+ getEmpty() {
+ if (this.checkboxEmptyChecked) {
+ return "No result";
+ }
+ },
},
};