{"version":3,"file":"inputGroupDropDown.obs.js","sources":["../../../Framework/Controls/inputGroupDropDown.obs"],"sourcesContent":["<!-- Copyright by the Spark Development Network; Licensed under the Rock Community License -->\r\n<template>\r\n    <div class=\"input-group-btn\" :class=\"{ open: expanded }\">\r\n        <button class=\"btn btn-default dropdown-toggle\" type=\"button\" @click.prevent=\"expanded = !expanded\">{{ selectedText }}&nbsp;<span class=\"caret\"></span></button>\r\n        <TransitionVerticalCollapse>\r\n            <ul class=\"dropdown-menu\" v-show=\"expanded\">\r\n                <li v-for=\"(item, index) in items\" :key=\"item?.value ?? index\"><a href=\"#\" @click.prevent=\"select(item.value ?? '')\">{{ item.text }}</a></li>\r\n            </ul>\r\n        </TransitionVerticalCollapse>\r\n    </div>\r\n</template>\r\n\r\n<script lang=\"ts\" setup>\r\n    import { computed, PropType, ref } from \"vue\";\r\n    import { useVModelPassthrough } from \"@Obsidian/Utility/component\";\r\n    import { ListItemBag } from \"@Obsidian/ViewModels/Utility/listItemBag\";\r\n    import TransitionVerticalCollapse from \"./transitionVerticalCollapse\";\r\n\r\n    const props = defineProps({\r\n        modelValue: {\r\n            type: String as PropType<string>,\r\n            default: \"\"\r\n        },\r\n\r\n        items: {\r\n            type: Object as PropType<ListItemBag[]>,\r\n            default: []\r\n        }\r\n    });\r\n\r\n\r\n    const emit = defineEmits<{\r\n        (e: \"update:modelValue\", value: string): void\r\n    }>();\r\n\r\n\r\n    const internalValue = useVModelPassthrough(props, \"modelValue\", emit);\r\n    const expanded = ref(false);\r\n\r\n    const selectedText = computed((): string => {\r\n        return props.items?.find((i: ListItemBag) => i.value === internalValue.value)?.text || \"\";\r\n    });\r\n\r\n    function select(value: string): void {\r\n        internalValue.value = value;\r\n        expanded.value = false;\r\n    }\r\n\r\n</script>"],"names":["internalValue","useVModelPassthrough","props","emit","expanded","ref","selectedText","computed","_props$items","_props$items$find","items","find","i","value","text","select"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAoCI,IAAMA,aAAa,GAAGC,oBAAoB,CAACC,KAAK,EAAE,YAAY,EAAEC,IAAI,CAAC,CAAA;MACrE,IAAA,IAAMC,QAAQ,GAAGC,GAAG,CAAC,KAAK,CAAC,CAAA;MAE3B,IAAA,IAAMC,YAAY,GAAGC,QAAQ,CAAC,MAAc;YAAA,IAAAC,YAAA,EAAAC,iBAAA,CAAA;MACxC,MAAA,OAAO,CAAAD,CAAAA,YAAA,GAAAN,KAAK,CAACQ,KAAK,MAAA,IAAA,IAAAF,YAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,CAAAC,iBAAA,GAAXD,YAAA,CAAaG,IAAI,CAAEC,CAAc,IAAKA,CAAC,CAACC,KAAK,KAAKb,aAAa,CAACa,KAAK,CAAC,MAAAJ,IAAAA,IAAAA,iBAAA,KAAtEA,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,iBAAA,CAAwEK,IAAI,KAAI,EAAE,CAAA;MAC7F,KAAC,CAAC,CAAA;UAEF,SAASC,MAAMA,CAACF,KAAa,EAAQ;YACjCb,aAAa,CAACa,KAAK,GAAGA,KAAK,CAAA;YAC3BT,QAAQ,CAACS,KAAK,GAAG,KAAK,CAAA;MAC1B,KAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}