{"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