@dcodegroup-au/page-builder 0.3.2 → 0.3.3
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/package.json
CHANGED
|
@@ -69,16 +69,25 @@ export default {
|
|
|
69
69
|
</script>
|
|
70
70
|
|
|
71
71
|
<script setup>
|
|
72
|
-
import {ref, watch, onMounted} from "vue";
|
|
72
|
+
import {ref, watch, onMounted, defineEmits} from "vue";
|
|
73
73
|
import PlusIcon from "@/assets/img/icons/plus.svg";
|
|
74
74
|
import IconComponent from "./Icon.vue";
|
|
75
75
|
import iconsData from "@/assets/icons.json";
|
|
76
|
+
const props = defineProps({
|
|
77
|
+
modelValue: {
|
|
78
|
+
type: String,
|
|
79
|
+
default: null,
|
|
80
|
+
},
|
|
81
|
+
});
|
|
76
82
|
|
|
77
|
-
const model = ref(
|
|
83
|
+
const model = ref(props.modelValue);
|
|
78
84
|
const search = ref("");
|
|
79
85
|
const icons = ref([]);
|
|
80
86
|
const isDropdownOpen = ref(false);
|
|
81
87
|
|
|
88
|
+
const emit = defineEmits(["update:modelValue"]);
|
|
89
|
+
|
|
90
|
+
|
|
82
91
|
function toggleDropdown() {
|
|
83
92
|
isDropdownOpen.value = !isDropdownOpen.value;
|
|
84
93
|
}
|
|
@@ -91,6 +100,7 @@ watch(search, (value) => {
|
|
|
91
100
|
|
|
92
101
|
function update(event) {
|
|
93
102
|
model.value = event;
|
|
103
|
+
emit('update:modelValue', model.value);
|
|
94
104
|
isDropdownOpen.value = false; // Close dropdown after selection
|
|
95
105
|
}
|
|
96
106
|
|