
        <script setup>
        import { computed } from "vue"
        import { Example, PropsTable, PageTitle } from "@viteplay/vue"
        import { useRoute, useRouter } from "vue-router"
            
        let componentProps = {"CCalendar":[{"name":"modelValue","type":"object","required":false,"desc":""}]}
        let route = useRoute()
        let router = useRouter()
        let focusId = computed(() => route.query.focus && route.hash.slice(1))
        let shouldRender = (slug) => {
          return !route.query.focus || slug === focusId.value
        }
        let hiddenCount = computed(() => {
          return ["basic","no-initial-model"].filter((slug) => !shouldRender(slug)).length
        })

        let showAll = () => {
          router.push({ query: {}, hash: route.hash })
        }

        let openInEditor = (file) => {
           fetch('/__open-in-editor?file=' + encodeURIComponent(file))
        }
        let examples = [
          {
                title: "Basic",
                slug: "basic",
                docs: {"content":"","attrs":{}},
                // encodeURI because the example will contain html tags
                // which will cause this component to be incorrectly parsed
                code: decodeURI("%3Cscript%20setup%3E%0Aimport%20%7B%20ref%20%7D%20from%20'vue'%0Aimport%20CCalendar%20from%20'../CCalendar.vue'%0A%0Aconst%20data%20=%20ref(%7B%0A%20%20year:%20new%20Date().getFullYear(),%0A%20%20month:%20new%20Date().getMonth()%20+%201,%0A%20%20day:%20new%20Date().getDate(),%0A%20%20dayOfWeek:%20new%20Date().getDay(),%0A%7D)%0A%3C/script%3E%0A%0A%3Ctemplate%3E%0A%20%20date:%7B%7B%20data.year%20%7D%7D/%7B%7B%20data.month%20%7D%7D/%7B%7B%20data.day%20%7D%7D(%7B%7B%20data.dayOfWeek%20%7D%7D)%0A%20%20%3CCCalendar%20v-model=%22data%22%20p_Color=%22_primary%22%20/%3E%0A%3C/template%3E%0A%0A%3Cstyle%3E%0A:root%20%7B%0A%20%20--q-primary:%20#5e421d;%0A%7D%0A%3C/style%3E"),
                iframeUrl: "/__iframe/CCalendar-basic.html",
                openInEditor: import.meta.env.DEV 
                  ? () => openInEditor("/Users/nakashimakeiju/ghq/github.com/CodeLic/console/src/components/CCalendar/examples/Basic.vue") 
                  : undefined 
              },{
                title: "No initial model",
                slug: "no-initial-model",
                docs: {"content":"","attrs":{}},
                // encodeURI because the example will contain html tags
                // which will cause this component to be incorrectly parsed
                code: decodeURI("%3Cscript%20setup%3E%0Aimport%20%7B%20ref%20%7D%20from%20'vue'%0Aimport%20CCalendar%20from%20'../CCalendar.vue'%0A%0Aconst%20data%20=%20ref(undefined)%0A%3C/script%3E%0A%0A%3Ctemplate%3E%0A%20%20date:%7B%7B%20data%20%7D%7D%0A%20%20%3CCCalendar%20v-model=%22data%22%20p_Color=%22_primary%22%20/%3E%0A%3C/template%3E%0A%0A%3Cstyle%3E%0A/*%20:root%20%7B%20*/%0A/*%20--q-primary:%20#5e421d;%20*/%0A/*%20%7D%20*/%0A%3C/style%3E"),
                iframeUrl: "/__iframe/CCalendar-no-initial-model.html",
                openInEditor: import.meta.env.DEV 
                  ? () => openInEditor("/Users/nakashimakeiju/ghq/github.com/CodeLic/console/src/components/CCalendar/examples/No initial model.vue") 
                  : undefined 
              }
        ]
        </script>
        <template>
          <PageTitle title="CCalendar" :openInEditor="() => openInEditor('/Users/nakashimakeiju/ghq/github.com/CodeLic/console/src/components/CCalendar/CCalendar.vue')" />
          <div v-if="hiddenCount > 0" class="hidden-examples-info">
            {{ hiddenCount }} example{{ hiddenCount > 1 ? "s" : null }} hidden, <a class="viteplay-link" type="button" @click.prevent="showAll">show all</a>
          </div>
          <PropsTable componentName="CCalendar" :componentProps="componentProps" />
          <template  
            v-for="example in examples" 
            :key="example.slug">
            <Example 
              v-if="shouldRender(example.slug)"
              :example="example" 
              :componentProps="componentProps" />
          </template>
        </template>

<style scoped>
.hidden-examples-info {
  margin: 20px 0;
}
</style>
      