{"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`\r\n});\r\n"],"names":["defineComponent","name","components","RockFormField","props","modelValue","type","String","required","allowLava","Boolean","default","allowMultiple","rules","rulesPropType","emits","data","internalValue","computed","computedRules","normalizeRules","indexOf","push","computedType","watch","$emit","template"],"mappings":";;;;;;;;;;;;;;AAoBA,8CAAeA,eAAe,CAAC;YAC3BC,EAAAA,IAAI,EAAE,UAAU;YAChBC,EAAAA,UAAU,EAAE;YACRC,IAAAA,aAAAA;eACH;YACDC,EAAAA,KAAK,EAAE;YACHC,IAAAA,UAAU,EAAE;YACRC,MAAAA,IAAI,EAAEC,MAA0B;YAChCC,MAAAA,QAAQ,EAAE,IAAA;iBACb;YACDC,IAAAA,SAAS,EAAE;YACPH,MAAAA,IAAI,EAAEI,OAA4B;YAClCC,MAAAA,OAAO,EAAE,KAAA;iBACZ;YACDC,IAAAA,aAAa,EAAE;YACXN,MAAAA,IAAI,EAAEI,OAA4B;YAClCC,MAAAA,OAAO,EAAE,KAAA;iBACZ;YACDE,IAAAA,KAAK,EAAEC,aAAAA;eACV;cACDC,KAAK,EAAE,CACH,mBAAmB,CACtB;cACDC,IAAI,EAAE,SAAAA,IAAAA,GAAY;gBACd,OAAO;kBACHC,aAAa,EAAE,IAAI,CAACZ,UAAAA;iBACvB,CAAA;eACJ;YACDa,EAAAA,QAAQ,EAAE;YACNC,IAAAA,aAAaA,GAAqB;YAC9B,MAAA,IAAMN,KAAK,GAAGO,cAAc,CAAC,IAAI,CAACP,KAAK,CAAC,CAAA;YAExC,MAAA,IAAIA,KAAK,CAACQ,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,CAACZ,SAAS,IAAI,CAAC,IAAI,CAACG,aAAa,EAAE;YACzEC,QAAAA,KAAK,CAACS,IAAI,CAAC,OAAO,CAAC,CAAA;YACvB,OAAA;YAEA,MAAA,OAAOT,KAAK,CAAA;iBACf;YACDU,IAAAA,YAAYA,GAAW;kBACnB,OAAO,IAAI,CAACd,SAAS,IAAI,IAAI,CAACG,aAAa,GAAG,MAAM,GAAG,OAAO,CAAA;YAClE,KAAA;eACH;YACDY,EAAAA,KAAK,EAAE;YACHP,IAAAA,aAAaA,GAAG;kBACZ,IAAI,CAACQ,KAAK,CAAC,mBAAmB,EAAE,IAAI,CAACR,aAAa,CAAC,CAAA;iBACtD;YACDZ,IAAAA,UAAUA,GAAI;YACV,MAAA,IAAI,CAACY,aAAa,GAAG,IAAI,CAACZ,UAAU,CAAA;YACxC,KAAA;eACH;cACDqB,QAAQ,EAAA,8lBAAA;YAiBZ,CAAC,EAAC;;;;;;;;"}