{"version":3,"file":"emailBox.js","sources":["../../../Framework/Controls/emailBox.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 { defineComponent, PropType } from \"vue\";\r\nimport { normalizeRules, rulesPropType, ValidationRule } from \"@Obsidian/ValidationRules\";\r\nimport RockFormField from \"./rockFormField\";\r\n\r\nexport default defineComponent({\r\n name: \"EmailBox\",\r\n components: {\r\n RockFormField\r\n },\r\n props: {\r\n modelValue: {\r\n type: String as PropType,\r\n required: true\r\n },\r\n allowLava: {\r\n type: Boolean as PropType,\r\n default: false\r\n },\r\n allowMultiple: {\r\n type: Boolean as PropType,\r\n default: false\r\n },\r\n rules: rulesPropType\r\n },\r\n emits: [\r\n \"update:modelValue\"\r\n ],\r\n data: function () {\r\n return {\r\n internalValue: this.modelValue\r\n };\r\n },\r\n computed: {\r\n computedRules(): ValidationRule[] {\r\n const rules = normalizeRules(this.rules);\r\n\r\n if (rules.indexOf(\"email\") === -1 && !this.allowLava && !this.allowMultiple) {\r\n rules.push(\"email\");\r\n }\r\n\r\n return rules;\r\n },\r\n computedType(): string {\r\n return this.allowLava || this.allowMultiple ? \"text\" : \"email\";\r\n }\r\n },\r\n watch: {\r\n internalValue() {\r\n this.$emit(\"update:modelValue\", this.internalValue);\r\n },\r\n modelValue () {\r\n this.internalValue = this.modelValue;\r\n }\r\n },\r\n template: `\r\n\r\n \r\n