<template>
  <d2-container>
    <article class="layout-demo">
      <header>
        <ai-link
          :underline="false"
          :href="`${aiVueUrl}layout`"
          target="_blank"
        >
          <h3>layout</h3>
        </ai-link>
      </header>

      <ai-row>
        <ai-col :span="24">
          <div class="grid-content bg-purple-dark"></div>
        </ai-col>
      </ai-row>
      <ai-row>
        <ai-col :span="12">
          <div class="grid-content bg-purple"></div>
        </ai-col>
        <ai-col :span="12">
          <div class="grid-content bg-purple-light"></div>
        </ai-col>
      </ai-row>
      <ai-row>
        <ai-col :span="8">
          <div class="grid-content bg-purple"></div>
        </ai-col>
        <ai-col :span="8">
          <div class="grid-content bg-purple-light"></div>
        </ai-col>
        <ai-col :span="8">
          <div class="grid-content bg-purple"></div>
        </ai-col>
      </ai-row>
      <ai-row>
        <ai-col :span="6">
          <div class="grid-content bg-purple"></div>
        </ai-col>
        <ai-col :span="6">
          <div class="grid-content bg-purple-light"></div>
        </ai-col>
        <ai-col :span="6">
          <div class="grid-content bg-purple"></div>
        </ai-col>
        <ai-col :span="6">
          <div class="grid-content bg-purple-light"></div>
        </ai-col>
      </ai-row>
      <ai-row>
        <ai-col :span="4">
          <div class="grid-content bg-purple"></div>
        </ai-col>
        <ai-col :span="4">
          <div class="grid-content bg-purple-light"></div>
        </ai-col>
        <ai-col :span="4">
          <div class="grid-content bg-purple"></div>
        </ai-col>
        <ai-col :span="4">
          <div class="grid-content bg-purple-light"></div>
        </ai-col>
        <ai-col :span="4">
          <div class="grid-content bg-purple"></div>
        </ai-col>
        <ai-col :span="4">
          <div class="grid-content bg-purple-light"></div>
        </ai-col>
      </ai-row>
    </article>

    <article class="container-demo">
      <header>
        <ai-link
          :underline="false"
          :href="`${aiVueUrl}container`"
          target="_blank"
        >
          <h3>Container 布局容器</h3>
        </ai-link>
      </header>

      <ai-container>
        <ai-aside width="200px">Aside</ai-aside>
        <ai-container>
          <ai-header>Header</ai-header>
          <ai-main>Main</ai-main>
          <ai-footer>Footer</ai-footer>
        </ai-container>
      </ai-container>
    </article>

    <article>
      <header>
        <ai-link
          :underline="false"
          :href="`${aiVueUrl}icon`"
          target="_blank"
        >
          <h3>Icon 图标</h3>
        </ai-link>
      </header>

      <div class="container-item">
        <i class="ai-icon-edit"></i>
        <i class="ai-icon-share"></i>
        <i class="ai-icon-delete"></i>
      </div>
    </article>

    <article>
      <header>
        <ai-link
          :underline="false"
          :href="`${aiVueUrl}button`"
          target="_blank"
        >
          <h3>Button 按钮</h3>
        </ai-link>
      </header>

      <ai-row>
        <ai-button type="primary">默认按钮</ai-button>
        <ai-button
          type="primary"
          plain
        >朴素按钮</ai-button>
        <ai-button
          type="primary"
          round
        >圆角按钮</ai-button>
        <ai-button
          type="primary"
          disabled
        >禁用按钮</ai-button>
        <ai-button type="text">文字按钮</ai-button>
        <ai-button
          type="primary"
          icon="ai-icon-search"
        >图标按钮</ai-button>
        <ai-button
          type="primary"
          icon="ai-icon-edit"
          circle
        ></ai-button>
      </ai-row>
    </article>

    <article class="link-demo">
      <header>
        <ai-link
          :underline="false"
          :href="`${aiVueUrl}link`"
          target="_blank"
        >
          <h3>Link 文字链接</h3>
        </ai-link>
      </header>

      <div class="container-item">
        <ai-link type="primary">主要链接</ai-link>
        <ai-link
          type="primary"
          disabled
        >禁用链接</ai-link>
        <ai-link :underline="false">无下划线</ai-link>
        <ai-link>有下划线</ai-link>
        <ai-link icon="ai-icon-edit">图标左连接</ai-link>
        <ai-link>图标右连接<i class="ai-icon-view ai-icon--right"></i> </ai-link>
      </div>
    </article>
  </d2-container>
</template>

<script>
export default {
  name: "Basic",
  components: {},
  data() {
    return {
      aiVueUrl:
        process.env.VUE_APP_AIVUE_URL + process.env.VUE_APP_AIVUE_PATH
    };
  },
  mounted() {}
};
</script>

<style lang="less" scoped>
.container-item {
  display: flex;
  align-items: center;
  i,
  a {
    margin-right: 10px;
  }
}
.layout-demo {
  .ai-row {
    margin-bottom: 20px;
    &:last-child {
      margin-bottom: 0;
    }
  }
  .ai-col {
    border-radius: 4px;
  }
  .bg-purple-dark {
    background: #99a9bf;
  }
  .bg-purple {
    background: #d3dce6;
  }
  .bg-purple-light {
    background: #e5e9f2;
  }
  .grid-content {
    border-radius: 4px;
    min-height: 36px;
  }
  .row-bg {
    padding: 10px 0;
    background-color: #f9fafc;
  }
}

.container-demo {
  .ai-header,
  .ai-footer {
    background-color: #b3c0d1;
    color: #333;
    text-align: center;
    line-height: 60px;
  }

  .ai-aside {
    background-color: #d3dce6;
    color: #333;
    text-align: center;
    line-height: 200px;
  }

  .ai-main {
    background-color: #e9eef3;
    color: #333;
    text-align: center;
    line-height: 160px;
  }

  body > .ai-container {
    margin-bottom: 40px;
  }

  .ai-container:nth-child(5) .ai-aside,
  .ai-container:nth-child(6) .ai-aside {
    line-height: 260px;
  }

  .ai-container:nth-child(7) .ai-aside {
    line-height: 320px;
  }
}

.link-demo {
  div :nth-child {
    margin-right: 10px;
  }
}
</style>
