Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(grid): Fix dividing components | JIRA PT-204 #121

Merged
merged 1 commit into from
Jul 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions src/modules/grid/views/components/EqualWidth.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<template>
<div class="w-full">
<div class="grid grid-cols-6 gap-7 text-center items-center my-3">
<div class="grid-items col-span-3">1 of 2</div>
<div class="grid-items col-span-3">2 of 2</div>

<div class="grid-items col-span-2">1 of 3</div>
<div class="grid-items col-span-2">2 of 3</div>
<div class="grid-items col-span-2">3 of 3</div>
</div>
</div>
</template>

<script lang="ts">
import { defineComponent } from 'vue'

export default defineComponent({
name: 'EqualWidth',
})
</script>

<style scoped>
.grid-items {
@apply p-3 my-1 bg-[#fff] border border-slate-200 rounded drop-shadow-[0_4px_16px_rgba(0,0,0,0.10)] shadow-[0_0_0_1px_rgb(0,0,0,0.10)] text-left text-sm text-[#393f49] border-0 font-normal;
}
</style>
23 changes: 23 additions & 0 deletions src/modules/grid/views/components/GridSystem.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<template>
<div class="w-full">
<div class="grid grid-cols-1 sm:grid-cols-3 gap-7 text-center items-center my-3">
<div class="grid-items">One of three columns</div>
<div class="grid-items">One of three columns</div>
<div class="grid-items">One of three columns</div>
</div>
</div>
</template>

<script lang="ts">
import { defineComponent } from 'vue'

export default defineComponent({
name: 'GridSystem',
})
</script>

<style scoped>
.grid-items {
@apply p-3 my-1 bg-[#fff] border border-slate-200 rounded drop-shadow-[0_4px_16px_rgba(0,0,0,0.10)] shadow-[0_0_0_1px_rgb(0,0,0,0.10)] text-left text-sm text-[#393f49] border-0 font-normal;
}
</style>
29 changes: 29 additions & 0 deletions src/modules/grid/views/components/Mix.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<template>
<div class="w-full">
<div class="grid grid-cols-1 sm:grid-cols-12 gap-6 text-center my-3">
<div class="grid-items col-span-8">.col-6 .col-md-8</div>
<div class="grid-items col-span-4">.col-6 .col-md-4</div>

<div class="grid-items col-span-4">.col-6 .col-md-4</div>
<div class="grid-items col-span-4">.col-6 .col-md-4</div>
<div class="grid-items col-span-4">.col-6 .col-md-4</div>

<div class="grid-items col-span-6">.col-6 .col-md-6</div>
<div class="grid-items col-span-6">.col-6 .col-md-6</div>
</div>
</div>
</template>

<script lang="ts">
import { defineComponent } from 'vue'

export default defineComponent({
name: 'Mix',
})
</script>

<style scoped>
.grid-items {
@apply p-3 my-1 bg-[#fff] border border-slate-200 rounded drop-shadow-[0_4px_16px_rgba(0,0,0,0.10)] shadow-[0_0_0_1px_rgb(0,0,0,0.10)] text-left text-sm text-[#393f49] border-0 font-normal;
}
</style>
26 changes: 26 additions & 0 deletions src/modules/grid/views/components/MultiRow.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<template>
<div class="w-full">
<div class="flex gap-4 text-center mb-6">
<div class="grid-items flex-auto">col</div>
<div class="grid-items flex-auto">col</div>
</div>
<div class="flex gap-4 text-center">
<div class="grid-items flex-auto">col</div>
<div class="grid-items flex-auto">col</div>
</div>
</div>
</template>

<script lang="ts">
import { defineComponent } from 'vue'

export default defineComponent({
name: 'MultiRow',
})
</script>

<style scoped>
.grid-items {
@apply p-3 my-1 bg-[#fff] border border-slate-200 rounded drop-shadow-[0_4px_16px_rgba(0,0,0,0.10)] shadow-[0_0_0_1px_rgb(0,0,0,0.10)] text-left text-sm text-[#393f49] border-0 font-normal;
}
</style>
30 changes: 30 additions & 0 deletions src/modules/grid/views/components/OneColumnWidth.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<template>
<div class="w-full">
<div>
<div class="flex gap-4 text-center mb-6">
<div class="grid-items flex-auto">1 of 3</div>
<div class="grid-items flex-auto w-2/4">2 of 3 (wider)</div>
<div class="grid-items flex-auto">3 of 3</div>
</div>
<div class="flex gap-4 text-center">
<div class="grid-items flex-auto">1 of 3</div>
<div class="grid-items flex-auto w-2/5">2 of 3 (wider)</div>
<div class="grid-items flex-auto">3 of 3</div>
</div>
</div>
</div>
</template>

<script lang="ts">
import { defineComponent } from 'vue'

export default defineComponent({
name: 'OneColumnWidth',
})
</script>

<style scoped>
.grid-items {
@apply p-3 my-1 bg-[#fff] border border-slate-200 rounded drop-shadow-[0_4px_16px_rgba(0,0,0,0.10)] shadow-[0_0_0_1px_rgb(0,0,0,0.10)] text-left text-sm text-[#393f49] border-0 font-normal;
}
</style>
28 changes: 28 additions & 0 deletions src/modules/grid/views/components/VariableWidth.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<template>
<div class="w-full">
<div class="flex gap-4 justify-center mb-6">
<div class="grid-items flex-auto md:flex-initial">1 of 3</div>
<div class="grid-items">Variable width content</div>
<div class="grid-items flex-auto md:flex-initial">3 of 3</div>
</div>
<div class="flex gap-4 justify-center">
<div class="grid-items flex-auto md:w-[60%] md:flex-initial">1 of 3</div>
<div class="grid-items">Variable width content</div>
<div class="grid-items flex-auto md:w-[15%] md:flex-initial">3 of 3</div>
</div>
</div>
</template>

<script lang="ts">
import { defineComponent } from 'vue'

export default defineComponent({
name: 'VariableWidth',
})
</script>

<style scoped>
.grid-items {
@apply p-3 my-1 bg-[#fff] border border-slate-200 rounded drop-shadow-[0_4px_16px_rgba(0,0,0,0.10)] shadow-[0_0_0_1px_rgb(0,0,0,0.10)] text-left text-sm text-[#393f49] border-0 font-normal;
}
</style>
76 changes: 25 additions & 51 deletions src/modules/grid/views/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
<template #header>
<h3 class="cursor-auto mb-0 text-primary">Grid system</h3>
</template>
<div class="grid grid-cols-1 sm:grid-cols-3 gap-7 text-center items-center my-3">
<div class="grid-items">One of three columns</div>
<div class="grid-items">One of three columns</div>
<div class="grid-items">One of three columns</div>
<div>
<GridSystem />
</div>
</el-card>

Expand All @@ -17,13 +15,8 @@
<template #header>
<h3 class="cursor-auto mb-0 text-primary">Equal-width</h3>
</template>
<div class="grid grid-cols-6 gap-7 text-center items-center my-3">
<div class="grid-items col-span-3">1 of 2</div>
<div class="grid-items col-span-3">2 of 2</div>

<div class="grid-items col-span-2">1 of 3</div>
<div class="grid-items col-span-2">2 of 3</div>
<div class="grid-items col-span-2">3 of 3</div>
<div>
<EqualWidth />
</div>
</el-card>

Expand All @@ -33,16 +26,7 @@
<h3 class="cursor-auto mb-0 text-primary">Setting one column width</h3>
</template>
<div class="my-3">
<div class="flex gap-4 text-center mb-6">
<div class="grid-items flex-auto">1 of 3</div>
<div class="grid-items flex-auto w-2/4">2 of 3 (wider)</div>
<div class="grid-items flex-auto">3 of 3</div>
</div>
<div class="flex gap-4 text-center">
<div class="grid-items flex-auto">1 of 3</div>
<div class="grid-items flex-auto w-2/5">2 of 3 (wider)</div>
<div class="grid-items flex-auto">3 of 3</div>
</div>
<OneColumnWidth />
</div>
</el-card>

Expand All @@ -52,16 +36,7 @@
<h3 class="cursor-auto mb-0 text-primary">Variable width content</h3>
</template>
<div class="my-3">
<div class="flex gap-4 justify-center mb-6">
<div class="grid-items flex-auto md:flex-initial">1 of 3</div>
<div class="grid-items">Variable width content</div>
<div class="grid-items flex-auto md:flex-initial">3 of 3</div>
</div>
<div class="flex gap-4 justify-center">
<div class="grid-items flex-auto md:w-[60%] md:flex-initial">1 of 3</div>
<div class="grid-items">Variable width content</div>
<div class="grid-items flex-auto md:w-[15%] md:flex-initial">3 of 3</div>
</div>
<VariableWidth />
</div>
</el-card>

Expand All @@ -71,40 +46,39 @@
<h3 class="cursor-auto mb-0 text-primary">Equal-width multi-row</h3>
</template>
<div class="my-3">
<div class="flex gap-4 text-center mb-6">
<div class="grid-items flex-auto">col</div>
<div class="grid-items flex-auto">col</div>
</div>
<div class="flex gap-4 text-center">
<div class="grid-items flex-auto">col</div>
<div class="grid-items flex-auto">col</div>
</div>
<MultiRow />
</div>
</el-card>

<!-- Grid system -->
<!-- Mix and match -->
<el-card class="mb-7.5 border-none">
<template #header>
<h3 class="cursor-auto mb-0 text-primary">Grid system</h3>
<h3 class="cursor-auto mb-0 text-primary">Mix and match</h3>
</template>
<div class="grid grid-cols-1 sm:grid-cols-12 gap-6 text-center my-3">
<div class="grid-items col-span-8">.col-6 .col-md-8</div>
<div class="grid-items col-span-4">.col-6 .col-md-4</div>

<div class="grid-items col-span-4">.col-6 .col-md-4</div>
<div class="grid-items col-span-4">.col-6 .col-md-4</div>
<div class="grid-items col-span-4">.col-6 .col-md-4</div>

<div class="grid-items col-span-6">.col-6 .col-md-6</div>
<div class="grid-items col-span-6">.col-6 .col-md-6</div>
<div>
<Mix />
</div>
</el-card>
</div>
</template>
<script lang="ts">
import { defineComponent } from 'vue'
import GridSystem from './components/GridSystem.vue'
import EqualWidth from './components/EqualWidth.vue'
import OneColumnWidth from './components/OneColumnWidth.vue'
import VariableWidth from './components/VariableWidth.vue'
import MultiRow from './components/MultiRow.vue'
import Mix from './components/Mix.vue'

export default defineComponent({
components: {
GridSystem,
EqualWidth,
OneColumnWidth,
VariableWidth,
MultiRow,
Mix,
},
name: 'Grid',
setup(_) {
return {}
Expand Down