{"version":3,"file":"genderDropDownList.obs.js","sources":["../../../Framework/Controls/genderDropDownList.obs"],"sourcesContent":["<!-- Copyright by the Spark Development Network; Licensed under the Rock Community License -->\r\n<template>\r\n    <DropDownList v-model=\"internalValue\" label=\"Gender\" :items=\"options\" :showBlankItem=\"false\" :rules=\"computedRules\" />\r\n</template>\r\n\r\n<script setup lang=\"ts\">\r\n    import { PropType, computed } from \"vue\";\r\n    import { normalizeRules, rulesPropType } from \"@Obsidian/ValidationRules\";\r\n    import { ListItemBag } from \"@Obsidian/ViewModels/Utility/listItemBag\";\r\n    import DropDownList from \"./dropDownList.obs\";\r\n    import { Gender } from \"@Obsidian/Enums/Crm/gender\";\r\n    import { useVModelPassthrough } from \"@Obsidian/Utility/component\";\r\n\r\n    const props = defineProps({\r\n        modelValue: {\r\n            type: Object as PropType<string | string[]>,\r\n            required: true\r\n        },\r\n\r\n        rules: rulesPropType\r\n    });\r\n\r\n    const emit = defineEmits<{\r\n        (e: \"update:modelValue\", value: string | string[]): void;\r\n    }>();\r\n\r\n    const internalValue = useVModelPassthrough(props, \"modelValue\", emit);\r\n\r\n    const options: ListItemBag[] = [\r\n        { text: \" \", value: Gender.Unknown.toString() },\r\n        { text: \"Male\", value: Gender.Male.toString() },\r\n        { text: \"Female\", value: Gender.Female.toString() }\r\n    ];\r\n\r\n    const computedRules = computed(() => {\r\n        const rules = normalizeRules(props.rules);\r\n        const notEqualRule = `notequal:${Gender.Unknown}`;\r\n\r\n        if (rules.includes(\"required\") && !rules.includes(notEqualRule)) {\r\n            rules.push(notEqualRule);\r\n        }\r\n\r\n        return rules;\r\n    });\r\n</script>\r\n"],"names":["internalValue","useVModelPassthrough","props","emit","options","text","value","Gender","Unknown","toString","Male","Female","computedRules","computed","rules","normalizeRules","notEqualRule","concat","includes","push"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA0BI,IAAMA,aAAa,GAAGC,oBAAoB,CAACC,KAAK,EAAE,YAAY,EAAEC,IAAI,CAAC,CAAA;UAErE,IAAMC,OAAsB,GAAG,CAC3B;MAAEC,MAAAA,IAAI,EAAE,GAAG;MAAEC,MAAAA,KAAK,EAAEC,MAAM,CAACC,OAAO,CAACC,QAAQ,EAAA;MAAG,KAAC,EAC/C;MAAEJ,MAAAA,IAAI,EAAE,MAAM;MAAEC,MAAAA,KAAK,EAAEC,MAAM,CAACG,IAAI,CAACD,QAAQ,EAAA;MAAG,KAAC,EAC/C;MAAEJ,MAAAA,IAAI,EAAE,QAAQ;MAAEC,MAAAA,KAAK,EAAEC,MAAM,CAACI,MAAM,CAACF,QAAQ,EAAA;MAAG,KAAC,CACtD,CAAA;MAED,IAAA,IAAMG,aAAa,GAAGC,QAAQ,CAAC,MAAM;MACjC,MAAA,IAAMC,KAAK,GAAGC,cAAc,CAACb,KAAK,CAACY,KAAK,CAAC,CAAA;MACzC,MAAA,IAAME,YAAY,GAAAC,WAAAA,CAAAA,MAAA,CAAeV,MAAM,CAACC,OAAO,CAAE,CAAA;MAEjD,MAAA,IAAIM,KAAK,CAACI,QAAQ,CAAC,UAAU,CAAC,IAAI,CAACJ,KAAK,CAACI,QAAQ,CAACF,YAAY,CAAC,EAAE;MAC7DF,QAAAA,KAAK,CAACK,IAAI,CAACH,YAAY,CAAC,CAAA;MAC5B,OAAA;MAEA,MAAA,OAAOF,KAAK,CAAA;MAChB,KAAC,CAAC,CAAA;;;;;;;;;;;;;;;;;;;;;;"}