<script setup>

import Select from "primevue/select";
import T from "@/components/ui/T.js";

const props = defineProps({
	items: null,
	optionLabel: "",
	optionValue: ""
})


let optionLabel = props.optionLabel
if (T.isNull(optionLabel)) {
	optionLabel = "name"
}

let optionValue = props.optionValue
if (T.isNull(optionValue)) {
	optionValue = "value"
}

</script>

<template>
	<div ref="rootRef">
		<Select ref="selectRef" :options="items" v-bind="$attrs" :optionLabel="optionLabel"
				:optionValue="optionValue" optionGroupLabel="label" optionGroupChildren="items"></Select>
		<div class="hidden">
			<slot></slot>
		</div>
	</div>
</template>

<style scoped>

</style>