
        <script setup>
        import { computed } from "vue"
        import { Example, PropsTable, PageTitle } from "@viteplay/vue"
        import { useRoute, useRouter } from "vue-router"
            
        let componentProps = {"CPager":[{"name":"p_TableLength","type":"number","required":false,"desc":"テーブルデータの総数\n@example p_TableLength: 100"},{"name":"showDataNum","type":"number","required":false,"desc":"現在の表示件数\n@example 表示件数: 10"}]}
        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"].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":"<p>合計のページ数はCAdminTableに計算されて、パスされるので、こちらにて更新しても、ページ数は変わらない</p>\n","attrs":{}},
                // encodeURI because the example will contain html tags
                // which will cause this component to be incorrectly parsed
                code: decodeURI("%3Cscript%20lang=%22ts%22%20setup%3E%0Aimport%20%7B%20ref,%20computed%20%7D%20from%20'vue'%0Aimport%20CPager%20from%20'../CPager.vue'%0A%0Aconst%20pageNrA%20=%20ref(1)%0Aconst%20ShowNrA%20=%20ref(10)%0Aconst%20pageNrB%20=%20ref(1)%0Aconst%20ShowNrB%20=%20ref(10)%0Aconst%20pageNrC%20=%20ref(1)%0Aconst%20ShowNrC%20=%20ref(10)%0Aconst%20p_TableLengthA%20=%20ref(1001)%0Aconst%20p_TableLengthB%20=%20ref(50)%0Aconst%20p_TableLengthC%20=%20ref(1000)%0Aconst%20compNumA%20=%20computed(()%20=%3E%20Math.ceil(p_TableLengthA.value%20/%20ShowNrA.value))%0Aconst%20compNumB%20=%20computed(()%20=%3E%20Math.ceil(p_TableLengthB.value%20/%20ShowNrB.value))%0Aconst%20compNumC%20=%20computed(()%20=%3E%20Math.ceil(p_TableLengthC.value%20/%20ShowNrC.value))%0A%3C/script%3E%0A%0A%0A%0A%3Ctemplate%3E%0A%20%20%3CCPager%0A%20%20%20%20v-model=%22pageNrA%22%0A%20%20%20%20v-model:showDataNum=%22ShowNrA%22%0A%20%20%20%20:p_TableLength=%22p_TableLengthA%22%0A%20%20%20%20:pageCount=%22compNumA%22%0A%20%20/%3E%0A%20%20%3Cdiv%20style=%22padding:%201rem%22%3E%0A%20%20%20%20modelValue:%20%3Ccode%3E%7B%7B%20pageNrA%20%7D%7D%3C/code%3E%0A%20%20%3C/div%3E%0A%0A%20%20%3CCPager%0A%20%20%20%20v-model=%22pageNrB%22%0A%20%20%20%20v-model:showDataNum=%22ShowNrB%22%0A%20%20%20%20:p_TableLength=%22p_TableLengthB%22%0A%20%20%20%20:pageCount=%22compNumB%22%0A%20%20/%3E%0A%20%20%3Cdiv%20style=%22padding:%201rem%22%3E%0A%20%20%20%20modelValue:%20%3Ccode%3E%7B%7B%20pageNrB%20%7D%7D%3C/code%3E%0A%20%20%3C/div%3E%0A%0A%20%20%3CCPager%0A%20%20%20%20v-model=%22pageNrC%22%0A%20%20%20%20v-model:showDataNum=%22ShowNrC%22%0A%20%20%20%20:p_TableLength=%22p_TableLengthC%22%0A%20%20%20%20:pageCount=%22compNumC%22%0A%20%20/%3E%0A%20%20%3Cdiv%20style=%22padding:%201rem%22%3E%0A%20%20%20%20modelValue:%20%3Ccode%3E%7B%7B%20pageNrC%20%7D%7D%3C/code%3E%0A%20%20%3C/div%3E%0A%3C/template%3E"),
                iframeUrl: "/__iframe/CPager-basic.html",
                openInEditor: import.meta.env.DEV 
                  ? () => openInEditor("/Users/nakashimakeiju/ghq/github.com/CodeLic/console/src/components/CPager/examples/Basic.vue") 
                  : undefined 
              }
        ]
        </script>
        <template>
          <PageTitle title="CPager" :openInEditor="() => openInEditor('/Users/nakashimakeiju/ghq/github.com/CodeLic/console/src/components/CPager/CPager.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="CPager" :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>
      