
        <script setup>
        import { computed } from "vue"
        import { Example, PropsTable, PageTitle } from "@viteplay/vue"
        import { useRoute, useRouter } from "vue-router"
            
        let componentProps = {"CTextarea":[{"name":"modelValue","type":"string","required":false,"desc":"値\n@example modelValue: ''"},{"name":"p_Title","type":"string","required":false,"desc":"タイトル\n@example p_Title: '備考'"},{"name":"disabled","type":"boolean","required":false,"desc":"制御\n@example disabled: true"},{"name":"p_Error","type":"boolean","required":false,"desc":"エラー\n@example p_Error: true"},{"name":"maxlength","type":"number","required":false,"desc":"入力最大値\n@example p_MaxLength: 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","disable","error","max-length","title"].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%20CTextarea%20from%20'../CTextarea.vue'%0A%0Aconst%20text%20=%20ref('')%0A%3C/script%3E%0A%0A%3Ctemplate%3E%0A%20%20%3CCTextarea%20class=%22test%22%20v-model=%22text%22%20/%3E%0A%20%20model:%20%7B%7B%20text%20%7D%7D%0A%3C/template%3E%0A%0A%3Cstyle%3E%0A.test%20%7B%0A%20%20height:%20200px;%0A%7D%0A%3C/style%3E"),
                iframeUrl: "/__iframe/CTextarea-basic.html",
                openInEditor: import.meta.env.DEV 
                  ? () => openInEditor("/Users/nakashimakeiju/ghq/github.com/CodeLic/console/src/components/CTextarea/examples/Basic.vue") 
                  : undefined 
              },{
                title: "Disable",
                slug: "disable",
                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%20CTextarea%20from%20'../CTextarea.vue'%0A%0Aconst%20text%20=%20ref('')%0A%3C/script%3E%0A%0A%3Ctemplate%3E%0A%20%20%3CCTextarea%20v-model=%22text%22%20:disabled=%22true%22%20/%3E%0A%20%20model:%20%7B%7B%20text%20%7D%7D%0A%3C/template%3E%0A%0A//%20!style%E3%81%8C%E8%A8%AD%E5%AE%9A%E3%81%A7%E3%81%8D%E3%81%AA%E3%81%84"),
                iframeUrl: "/__iframe/CTextarea-disable.html",
                openInEditor: import.meta.env.DEV 
                  ? () => openInEditor("/Users/nakashimakeiju/ghq/github.com/CodeLic/console/src/components/CTextarea/examples/Disable.vue") 
                  : undefined 
              },{
                title: "Error",
                slug: "error",
                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%20CTextarea%20from%20'../CTextarea.vue'%0A%0Aconst%20text%20=%20ref('')%0A%3C/script%3E%0A%0A%3Ctemplate%3E%0A%20%20%3CCTextarea%20v-model=%22text%22%20:p_Error=%22true%22%20/%3E%0A%20%20model:%20%7B%7B%20text%20%7D%7D%0A%3C/template%3E%0A%0A//%20!style%E3%81%8C%E8%A8%AD%E5%AE%9A%E3%81%A7%E3%81%8D%E3%81%AA%E3%81%84"),
                iframeUrl: "/__iframe/CTextarea-error.html",
                openInEditor: import.meta.env.DEV 
                  ? () => openInEditor("/Users/nakashimakeiju/ghq/github.com/CodeLic/console/src/components/CTextarea/examples/Error.vue") 
                  : undefined 
              },{
                title: "MaxLength",
                slug: "max-length",
                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%20CTextarea%20from%20'../CTextarea.vue'%0A%0Aconst%20text%20=%20ref('')%0A%3C/script%3E%0A%0A%3Ctemplate%3E%0A%20%20%3CCTextarea%20class=%22test%22%20v-model=%22text%22%20:maxlength=%2210%22%20/%3E%0A%20%20model:%20%7B%7B%20text%20%7D%7D%0A%3C/template%3E%0A%0A%3Cstyle%3E%0A.test%20%7B%0A%20%20height:%20200px;%0A%7D%0A%3C/style%3E"),
                iframeUrl: "/__iframe/CTextarea-max-length.html",
                openInEditor: import.meta.env.DEV 
                  ? () => openInEditor("/Users/nakashimakeiju/ghq/github.com/CodeLic/console/src/components/CTextarea/examples/MaxLength.vue") 
                  : undefined 
              },{
                title: "Title",
                slug: "title",
                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%20CTextarea%20from%20'../CTextarea.vue'%0A%0Aconst%20text%20=%20ref('')%0A%3C/script%3E%0A%0A%3Ctemplate%3E%0A%20%20%3CCTextarea%20v-model=%22text%22%20p_Title=%22%E3%83%86%E3%82%AD%E3%82%B9%E3%83%88%E3%82%A8%E3%83%AA%E3%82%A2%E3%82%BF%E3%82%A4%E3%83%88%E3%83%AB%22%20/%3E%0A%20%20model:%20%7B%7B%20text%20%7D%7D%0A%3C/template%3E%0A%0A//%20!style%E3%81%8C%E8%A8%AD%E5%AE%9A%E3%81%A7%E3%81%8D%E3%81%AA%E3%81%84"),
                iframeUrl: "/__iframe/CTextarea-title.html",
                openInEditor: import.meta.env.DEV 
                  ? () => openInEditor("/Users/nakashimakeiju/ghq/github.com/CodeLic/console/src/components/CTextarea/examples/Title.vue") 
                  : undefined 
              }
        ]
        </script>
        <template>
          <PageTitle title="CTextarea" :openInEditor="() => openInEditor('/Users/nakashimakeiju/ghq/github.com/CodeLic/console/src/components/CTextarea/CTextarea.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="CTextarea" :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>
      