
        <script setup>
        import { computed } from "vue"
        import { Example, PropsTable, PageTitle } from "@viteplay/vue"
        import { useRoute, useRouter } from "vue-router"
            
        let componentProps = {"CButtonIcon":[{"name":"p_ButtonIconName","type":"string","required":true,"desc":"アイコンの指定\nmaterial iconsのアイコンを指定できる\n@example p_ButtonIconName: close"}]}
        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","drop-down"].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%20onMounted%20%7D%20from%20'vue'%0Aimport%20CButtonIcon%20from%20'../CButtonIcon.vue'%0Aconst%20clickEvent%20=%20()%20=%3E%20alert('foo')%0AonMounted(()%20=%3E%20%7B%0A%20%20document.querySelector('.c_button_icon').parentNode.style.backgroundColor%20=%20'#0000a0'%0A%7D)%0A%3C/script%3E%0A%0A%3Ctemplate%3E%0A%20%20%3CCButtonIcon%20p_ButtonIconName=%22close%22%20class=%22testClass%22%20@click=%22clickEvent%22%20/%3E%0A%3C/template%3E%0A%3Cstyle%3E%0A.testClass%20%7B%0A%20%20color:%20#ffffff;%0A%20%20font-size:%2060px;%0A%7D%0A%3C/style%3E"),
                iframeUrl: "/__iframe/CButtonIcon-basic.html",
                openInEditor: import.meta.env.DEV 
                  ? () => openInEditor("/Users/nakashimakeiju/ghq/github.com/CodeLic/console/src/components/CButtonIcon/examples/Basic.vue") 
                  : undefined 
              },{
                title: "DropDown",
                slug: "drop-down",
                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%20onMounted%20%7D%20from%20'vue'%0Aimport%20CButtonIcon%20from%20'../CButtonIcon.vue'%0Aconst%20clickEvent%20=%20()%20=%3E%20alert('expand_more')%0AonMounted(()%20=%3E%20%7B%0A%20%20document.querySelectorAll('.c_button_icon')%5B1%5D.parentNode.style.backgroundColor%20=%20'#aaaa0a'%0A%7D)%0A%3C/script%3E%0A%0A%3Ctemplate%3E%0A%20%20%3CCButtonIcon%20p_ButtonIconName=%22expand_more%22%20class=%22testClassSecond%22%20@click=%22clickEvent%22%20/%3E%0A%3C/template%3E%0A%0A%3Cstyle%3E%0A.testClassSecond%20%7B%0A%20%20color:%20green;%0A%20%20font-size:%2020px;%0A%7D%0A%3C/style%3E"),
                iframeUrl: "/__iframe/CButtonIcon-drop-down.html",
                openInEditor: import.meta.env.DEV 
                  ? () => openInEditor("/Users/nakashimakeiju/ghq/github.com/CodeLic/console/src/components/CButtonIcon/examples/DropDown.vue") 
                  : undefined 
              }
        ]
        </script>
        <template>
          <PageTitle title="CButtonIcon" :openInEditor="() => openInEditor('/Users/nakashimakeiju/ghq/github.com/CodeLic/console/src/components/CButtonIcon/CButtonIcon.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="CButtonIcon" :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>
      