{"version":3,"file":"checkBox.js","sources":["../../../Framework/Controls/checkBox.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\nimport RockFormField from \"./rockFormField\";\r\n\r\nexport default defineComponent({\r\n name: \"CheckBox\",\r\n\r\n components: {\r\n RockFormField\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 rules: {\r\n type: String as PropType,\r\n default: \"\"\r\n },\r\n\r\n text: {\r\n type: String as PropType,\r\n default: \"\"\r\n }\r\n },\r\n\r\n emits: {\r\n \"update:modelValue\": (_value: boolean) => true\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 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","RockFormField","props","modelValue","type","Boolean","required","label","String","rules","default","text","emits","_value","setup","_ref","emit","internalValue","ref","toggle","value","watch","template"],"mappings":";;;;;;;;;;;;;AAmBA,8CAAeA,eAAe,CAAC;YAC3BC,EAAAA,IAAI,EAAE,UAAU;YAEhBC,E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