{"version":3,"file":"inlineCheckBox.js","sources":["../../../Framework/Controls/inlineCheckBox.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, ref, watch } from \"vue\";\r\n\r\nexport default defineComponent({\r\n name: \"InlineCheckBox\",\r\n\r\n components: {\r\n },\r\n\r\n emits: [\r\n // Explicitly define \"update:modelValue\" event; otherwise v-bind=\"$attrs\" could attach a duplicate event handler to the underlying checkbox input.\r\n \"update:modelValue\"\r\n ],\r\n\r\n props: {\r\n modelValue: {\r\n type: Boolean as PropType,\r\n required: true\r\n },\r\n\r\n label: {\r\n type: String as PropType,\r\n required: true\r\n }\r\n },\r\n\r\n setup(props, { emit }) {\r\n const internalValue = ref(props.modelValue);\r\n\r\n const toggle = (): void => {\r\n internalValue.value = !internalValue.value;\r\n };\r\n\r\n watch(() => props.modelValue, () => {\r\n internalValue.value = props.modelValue;\r\n });\r\n\r\n watch(internalValue, () => {\r\n emit(\"update:modelValue\", internalValue.value);\r\n });\r\n\r\n return {\r\n internalValue,\r\n label: props.label,\r\n toggle\r\n };\r\n },\r\n\r\n template: `\r\n
\r\n \r\n
\r\n`\r\n});\r\n"],"names":["defineComponent","name","components","emits","props","modelValue","type","Boolean","required","label","String","setup","_ref","emit","internalValue","ref","toggle","value","watch","template"],"mappings":";;;;;;;;;;;AAkBA,oDAAeA,eAAe,CAAC;YAC3BC,EAAAA,IAAI,EAAE,gBAAgB;cAEtBC,UAAU,EAAE,EACX;cAEDC,KAAK,EAAE,CAEH,mBAAmB,CACtB;YAEDC,EAAAA,KAAK,EAAE;YACHC,IAAAA,UAAU,EAAE;YACRC,MAAAA,IAAI,EAAEC,OAA4B;YAClCC,MAAAA,QAAQ,EAAE,IAAA;iBACb;YAEDC,IAAAA,KAAK,EAAE;YACHH,MAAAA,IAAI,EAAEI,MAA0B;YAChCF,MAAAA,QAAQ,EAAE,IAAA;YACd,KAAA;eACH;YAEDG,EAAAA,KAAKA,CAACP,KAAK,EAAAQ,IAAA,EAAY;YAAA,IAAA,IAARC,IAAI,GAAAD,IAAA,CAAJC,IAAI,CAAA;YACf,IAAA,IAAMC,aAAa,GAAGC,GAAG,CAACX,KAAK,CAACC,UAAU,CAAC,CAAA;gBAE3C,IAAMW,MAAM,GAAGA,MAAY;YACvBF,MAAAA,aAAa,CAACG,KAAK,GAAG,CAACH,aAAa,CAACG,KAAK,CAAA;iBAC7C,CAAA;YAEDC,IAAAA,KAAK,CAAC,MAAMd,KAAK,CAACC,UAAU,EAAE,MAAM;YAChCS,MAAAA,aAAa,CAACG,KAAK,GAAGb,KAAK,CAACC,UAAU,CAAA;YAC1C,KAAC,CAAC,CAAA;gBAEFa,KAAK,CAACJ,aAAa,EAAE,MAAM;YACvBD,MAAAA,IAAI,CAAC,mBAAmB,EAAEC,aAAa,CAACG,KAAK,CAAC,CAAA;YAClD,KAAC,CAAC,CAAA;gBAEF,OAAO;kBACHH,aAAa;kBACbL,KAAK,EAAEL,KAAK,CAACK,KAAK;YAClBO,MAAAA,MAAAA;iBACH,CAAA;eACJ;cAEDG,QAAQ,EAAA,mNAAA;YAQZ,CAAC,EAAC;;;;;;;;"}