{"version":3,"file":"emailBox.obs.js","sources":["../../../Framework/Controls/emailBox.obs"],"sourcesContent":["<!-- Copyright by the Spark Development Network; Licensed under the Rock Community License -->\r\n<template>\r\n <RockFormField\r\n v-model=\"internalValue\"\r\n formGroupClasses=\"rock-text-box\"\r\n name=\"textbox\"\r\n :rules=\"computedRules\">\r\n <template #default=\"{ uniqueId, field }\">\r\n <div class=\"control-wrapper\">\r\n <div class=\"input-group\">\r\n <span class=\"input-group-addon\">\r\n <i class=\"fa fa-envelope\"></i>\r\n </span>\r\n <input v-model=\"internalValue\" :id=\"uniqueId\" class=\"form-control\" v-bind=\"field\" :type=\"computedType\" />\r\n </div>\r\n </div>\r\n </template>\r\n </RockFormField>\r\n</template>\r\n\r\n<script setup lang=\"ts\">\r\n import { computed, PropType } from \"vue\";\r\n import { normalizeRules, rulesPropType, ValidationRule } from \"@Obsidian/ValidationRules\";\r\n import RockFormField from \"./rockFormField.obs\";\r\n import { useVModelPassthrough } from \"@Obsidian/Utility/component\";\r\n\r\n const props = defineProps({\r\n modelValue: {\r\n type: String as PropType<string>,\r\n required: true\r\n },\r\n allowLava: {\r\n type: Boolean as PropType<boolean>,\r\n default: false\r\n },\r\n allowMultiple: {\r\n type: Boolean as PropType<boolean>,\r\n default: false\r\n },\r\n rules: rulesPropType\r\n });\r\n\r\n const emit = defineEmits<{\r\n (e: \"update:modelValue\", value: string): void;\r\n }>();\r\n\r\n const internalValue = useVModelPassthrough(props, \"modelValue\", emit);\r\n\r\n const computedRules = computed((): ValidationRule[] => {\r\n const rules = normalizeRules(props.rules);\r\n\r\n if (rules.indexOf(\"email\") === -1 && !props.allowLava && !props.allowMultiple) {\r\n rules.push(\"email\");\r\n }\r\n\r\n return rules;\r\n });\r\n\r\n const computedType = computed((): string => {\r\n return props.allowLava || props.allowMultiple ? \"text\" : \"email\";\r\n });\r\n</script>\r\n"],"names":["internalValue","useVModelPassthrough","props","emit","computedRules","computed","rules","normalizeRules","indexOf","allowLava","allowMultiple","push","computedType"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA8CI,IAAMA,aAAa,GAAGC,oBAAoB,CAACC,KAAK,EAAE,YAAY,EAAEC,IAAI,CAAC,CAAA;MAErE,IAAA,IAAMC,aAAa,GAAGC,QAAQ,CAAC,MAAwB;MACnD,MAAA,IAAMC,KAAK,GAAGC,cAAc,CAACL,KAAK,CAACI,KAAK,CAAC,CAAA;MAEzC,MAAA,IAAIA,KAAK,CAACE,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,IAAI,CAACN,KAAK,CAACO,SAAS,IAAI,CAACP,KAAK,CAACQ,aAAa,EAAE;MAC3EJ,QAAAA,KAAK,CAACK,IAAI,CAAC,OAAO,CAAC,CAAA;MACvB,OAAA;MAEA,MAAA,OAAOL,KAAK,CAAA;MAChB,KAAC,CAAC,CAAA;MAEF,IAAA,IAAMM,YAAY,GAAGP,QAAQ,CAAC,MAAc;YACxC,OAAOH,KAAK,CAACO,SAAS,IAAIP,KAAK,CAACQ,aAAa,GAAG,MAAM,GAAG,OAAO,CAAA;MACpE,KAAC,CAAC,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}