{"version":3,"file":"tabbedContent.js","sources":["../../../Framework/Controls/tabbedContent.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: \"TabbedContent\",\r\n\r\n props: {\r\n tabList: {\r\n type: Array as PropType, // eslint-disable-line @typescript-eslint/no-explicit-any\r\n required: true\r\n }\r\n },\r\n\r\n setup(props) {\r\n const active = ref(0);\r\n const classes = ref([]);\r\n let timeout: NodeJS.Timeout;\r\n\r\n watch(() => props.tabList, () => {\r\n active.value = 0;\r\n\r\n classes.value = props.tabList.map((item, i) => {\r\n let list = \"tab-pane fade\";\r\n\r\n if (i == active.value) {\r\n list += \" active in\";\r\n }\r\n\r\n return list;\r\n });\r\n }, {immediate: true});\r\n\r\n watch(active, (current, previous) => {\r\n classes.value[previous] = \"tab-pane fade active\";\r\n\r\n clearTimeout(timeout);\r\n timeout = setTimeout(() => {\r\n classes.value[previous] = \"tab-pane fade\";\r\n classes.value[current] = \"tab-pane fade active in\";\r\n }, 150);\r\n });\r\n\r\n return {\r\n active,\r\n classes\r\n };\r\n },\r\n\r\n template: `\r\n
\r\n \r\n\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n`\r\n});\r\n"],"names":["defineComponent","name","props","tabList","type","Array","required","setup","active","ref","classes","timeout","watch","value","map","item","i","list","immediate","current","previous","clearTimeout","setTimeout","template"],"mappings":";;;;;;;;;;;AAkBA,mDAAeA,eAAe,CAAC;YAC3BC,EAAAA,IAAI,EA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