{"version":3,"file":"genderDropDownList.js","sources":["../../../Framework/Controls/genderDropDownList.ts"],"sourcesContent":["// \r\n// Copyright by the Spark Development Network\r\n//\r\n// Licensed under the Rock Community License (the \"License\");\r\n// you may not use this file except in compliance with the License.\r\n// You may obtain a copy of the License at\r\n//\r\n// http://www.rockrms.com/license\r\n//\r\n// Unless required by applicable law or agreed to in writing, software\r\n// distributed under the License is distributed on an \"AS IS\" BASIS,\r\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n// See the License for the specific language governing permissions and\r\n// limitations under the License.\r\n// \r\n//\r\nimport { computed, defineComponent } from \"vue\";\r\nimport { normalizeRules, rulesPropType } from \"@Obsidian/ValidationRules\";\r\nimport { ListItemBag } from \"@Obsidian/ViewModels/Utility/listItemBag\";\r\nimport DropDownList from \"./dropDownList\";\r\nimport { Gender } from \"@Obsidian/Enums/Crm/gender\";\r\n\r\nexport default defineComponent({\r\n name: \"GenderDropDownList\",\r\n\r\n components: {\r\n DropDownList\r\n },\r\n\r\n props: {\r\n rules: rulesPropType\r\n },\r\n\r\n setup(props) {\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\r\n return {\r\n computedRules,\r\n options\r\n };\r\n },\r\n\r\n template: `\r\n\r\n`\r\n});\r\n"],"names":["defineComponent","name","components","DropDownList","props","rules","rulesPropType","setup","options","text","value","Gender","Unknown","toString","Male","Female","computedRules","computed","normalizeRules","notEqualRule","concat","includes","push","template"],"mappings":";;;;;;;;;;;;;;;;;AAsBA,wDAAeA,eAAe,CAAC;YAC3BC,EAA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