-
Notifications
You must be signed in to change notification settings - Fork 340
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
Feat/layout #3382
Merged
Merged
Feat/layout #3382
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
ac4e360
raw: layout
m0ksem 0a4b1ff
raw: template grid areas
m0ksem 133fbf3
Merge branch 'develop' into feat/layout
m0ksem 38577f8
feat(layout): area order
m0ksem 9909193
Merge branch 'develop' into pr/m0ksem/3382
m0ksem fad92d7
feat: layout with animations
m0ksem 7f50c6d
feat: layout with absolute drawers
m0ksem d4496c9
feat(layout): use better prop config
m0ksem 386483b
chore(layout): improve demo
m0ksem 06df80a
fix(layout): improve docs
m0ksem 4dbf6d3
feat(layout): improve docs demo
m0ksem File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
packages/docs/page-config/ui-elements/layout/examples/Absolute.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<script setup lang="ts"> | ||
const showSidebar = ref(true) | ||
</script> | ||
|
||
<template> | ||
<VaLayout | ||
style="height: 500px" | ||
:left="{ absolute: true}" | ||
> | ||
<template #top> | ||
<VaNavbar color="primary" class="py-2"> | ||
<template #left> | ||
<VaButton @click="showSidebar = !showSidebar" :icon="showSidebar ? 'menu_open' : 'menu'" /> | ||
</template> | ||
<h4>LOGO</h4> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
</VaNavbar> | ||
</template> | ||
|
||
<template #left> | ||
<VaSidebar v-model="showSidebar"> | ||
<VaSidebarItem> | ||
<VaSidebarItemContent> | ||
<VaIcon name="home" /> | ||
<VaSidebarItemTitle> | ||
Home | ||
</VaSidebarItemTitle> | ||
</VaSidebarItemContent> | ||
</VaSidebarItem> | ||
<VaSidebarItem> | ||
<VaSidebarItemContent> | ||
<VaIcon name="phone" /> | ||
<VaSidebarItemTitle> | ||
About | ||
</VaSidebarItemTitle> | ||
</VaSidebarItemContent> | ||
</VaSidebarItem> | ||
</VaSidebar> | ||
</template> | ||
|
||
<template #content> | ||
<main class="p-4"> | ||
<h3>Page content</h3> | ||
<p>Page content must be wrapped in main tag. You must do it manually. Here you can place any blocks you need in your application.</p> | ||
|
||
<p>For example, you can place here your router view, add sidebar with navigation in #left slot.</p> | ||
<p>If you're using VaSidebar for page navigation don't forget to wrap it in nav tag.</p> | ||
</main> | ||
</template> | ||
</VaLayout> | ||
</template> |
94 changes: 94 additions & 0 deletions
94
packages/docs/page-config/ui-elements/layout/examples/AllSlots.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
<script setup lang="ts"> | ||
const showLeftSidebar = ref(true) | ||
const showRightSidebar = ref(true) | ||
</script> | ||
|
||
<template> | ||
<VaLayout style="height: 500px"> | ||
<template #top> | ||
<VaNavbar color="primary" class="py-2"> | ||
<template #left> | ||
<VaButton @click="showLeftSidebar = !showLeftSidebar" :icon="showLeftSidebar ? 'menu_open' : 'menu'" /> | ||
</template> | ||
<h4>LOGO</h4> | ||
<template #right> | ||
<VaButton @click="showRightSidebar = !showRightSidebar" :icon="showRightSidebar ? 'menu_open' : 'menu'" /> | ||
</template> | ||
</VaNavbar> | ||
</template> | ||
|
||
<template #left> | ||
<VaSidebar v-model="showLeftSidebar"> | ||
<VaSidebarItem> | ||
<VaSidebarItemContent> | ||
<VaIcon name="home" /> | ||
<VaSidebarItemTitle> | ||
Home | ||
</VaSidebarItemTitle> | ||
</VaSidebarItemContent> | ||
</VaSidebarItem> | ||
<VaSidebarItem> | ||
<VaSidebarItemContent> | ||
<VaIcon name="phone" /> | ||
<VaSidebarItemTitle> | ||
About | ||
</VaSidebarItemTitle> | ||
</VaSidebarItemContent> | ||
</VaSidebarItem> | ||
<VaSidebarItem> | ||
<VaSidebarItemContent> | ||
<VaIcon name="bolt" /> | ||
<VaSidebarItemTitle> | ||
Features | ||
</VaSidebarItemTitle> | ||
</VaSidebarItemContent> | ||
</VaSidebarItem> | ||
<VaSidebarItem> | ||
<VaSidebarItemContent> | ||
<VaIcon name="arrow_upward" /> | ||
<VaSidebarItemTitle> | ||
Scroll back | ||
</VaSidebarItemTitle> | ||
</VaSidebarItemContent> | ||
</VaSidebarItem> | ||
</VaSidebar> | ||
</template> | ||
|
||
<template #content> | ||
<main class="p-4"> | ||
<h3>Page content</h3> | ||
<p>Page content must be wrapped in main tag. You must do it manually. Here you can place any blocks you need in your application.</p> | ||
|
||
<p>For example, you can place here your router view, add sidebar with navigation in #left slot.</p> | ||
<p>If you're using VaSidebar for page navigation don't forget to wrap it in nav tag.</p> | ||
</main> | ||
</template> | ||
|
||
<template #right> | ||
<VaSidebar v-model="showRightSidebar"> | ||
<VaSidebarItem> | ||
<VaSidebarItemContent> | ||
<VaIcon name="favorite" /> | ||
<VaSidebarItemTitle> | ||
Favorite components | ||
</VaSidebarItemTitle> | ||
</VaSidebarItemContent> | ||
</VaSidebarItem> | ||
<VaSidebarItem> | ||
<VaSidebarItemContent> | ||
<VaIcon name="grade" /> | ||
<VaSidebarItemTitle> | ||
Best practices | ||
</VaSidebarItemTitle> | ||
</VaSidebarItemContent> | ||
</VaSidebarItem> | ||
</VaSidebar> | ||
</template> | ||
|
||
<template #bottom> | ||
<footer class="p-4 border-[var(--va-background-border)] border-t-2 text-right"> | ||
Footer | ||
</footer> | ||
</template> | ||
</VaLayout> | ||
</template> |
47 changes: 47 additions & 0 deletions
47
packages/docs/page-config/ui-elements/layout/examples/Default.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<script setup lang="ts"> | ||
const showSidebar = ref(false) | ||
</script> | ||
|
||
<template> | ||
<VaLayout style="height: 500px"> | ||
<template #top> | ||
<VaNavbar color="primary" class="py-2"> | ||
<template #left> | ||
<VaButton @click="showSidebar = !showSidebar" :icon="showSidebar ? 'menu_open' : 'menu'" /> | ||
</template> | ||
<h4>LOGO</h4> | ||
</VaNavbar> | ||
</template> | ||
|
||
<template #left> | ||
<VaSidebar v-model="showSidebar"> | ||
<VaSidebarItem> | ||
<VaSidebarItemContent> | ||
<VaIcon name="home" /> | ||
<VaSidebarItemTitle> | ||
Home | ||
</VaSidebarItemTitle> | ||
</VaSidebarItemContent> | ||
</VaSidebarItem> | ||
<VaSidebarItem> | ||
<VaSidebarItemContent> | ||
<VaIcon name="phone" /> | ||
<VaSidebarItemTitle> | ||
About | ||
</VaSidebarItemTitle> | ||
</VaSidebarItemContent> | ||
</VaSidebarItem> | ||
</VaSidebar> | ||
</template> | ||
|
||
<template #content> | ||
<main class="p-4"> | ||
<h3>Page content</h3> | ||
<p>Page content must be wrapped in main tag. You must do it manually. Here you can place any blocks you need in your application.</p> | ||
|
||
<p>For example, you can place here your router view, add sidebar with navigation in #left slot.</p> | ||
<p>If you're using VaSidebar for page navigation don't forget to wrap it in nav tag.</p> | ||
</main> | ||
</template> | ||
</VaLayout> | ||
</template> |
52 changes: 52 additions & 0 deletions
52
packages/docs/page-config/ui-elements/layout/examples/MobileFriendly.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<script setup lang="ts"> | ||
const showSidebar = ref(true) | ||
|
||
const breakpoints = useBreakpoint() | ||
</script> | ||
|
||
<template> | ||
<VaLayout | ||
style="height: 500px" | ||
:left="{ absolute: breakpoints.smDown }" | ||
> | ||
<template #top> | ||
<VaNavbar color="primary" class="py-2"> | ||
<template #left> | ||
<VaButton @click="showSidebar = !showSidebar" :icon="showSidebar ? 'menu_open' : 'menu'" /> | ||
</template> | ||
<h4>LOGO</h4> | ||
</VaNavbar> | ||
</template> | ||
|
||
<template #left> | ||
<VaSidebar v-model="showSidebar"> | ||
<VaSidebarItem> | ||
<VaSidebarItemContent> | ||
<VaIcon name="home" /> | ||
<VaSidebarItemTitle> | ||
Home | ||
</VaSidebarItemTitle> | ||
</VaSidebarItemContent> | ||
</VaSidebarItem> | ||
<VaSidebarItem> | ||
<VaSidebarItemContent> | ||
<VaIcon name="phone" /> | ||
<VaSidebarItemTitle> | ||
About | ||
</VaSidebarItemTitle> | ||
</VaSidebarItemContent> | ||
</VaSidebarItem> | ||
</VaSidebar> | ||
</template> | ||
|
||
<template #content> | ||
<main class="p-4"> | ||
<h3>Page content</h3> | ||
<p>Page content must be wrapped in main tag. You must do it manually. Here you can place any blocks you need in your application.</p> | ||
|
||
<p>For example, you can place here your router view, add sidebar with navigation in #left slot.</p> | ||
<p>If you're using VaSidebar for page navigation don't forget to wrap it in nav tag.</p> | ||
</main> | ||
</template> | ||
</VaLayout> | ||
</template> |
92 changes: 92 additions & 0 deletions
92
packages/docs/page-config/ui-elements/layout/examples/Order.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
<script setup lang="ts"> | ||
const showLeftSidebar = ref(true) | ||
const showRightSidebar = ref(true) | ||
|
||
const orders = reactive({ | ||
left: 2, | ||
top: 1, | ||
right: 2, | ||
bottom: 1, | ||
}) | ||
</script> | ||
|
||
<template> | ||
<div class="mb-4 flex gap-2 justify-between flex-wrap"> | ||
<VaCounter v-model="orders.top" label="top" /> | ||
<VaCounter v-model="orders.left" label="left" /> | ||
<VaCounter v-model="orders.right" label="right" /> | ||
<VaCounter v-model="orders.bottom" label="bottom" /> | ||
</div> | ||
|
||
<VaLayout | ||
:left="{ order: orders.left }" | ||
:top="{ order: orders.top }" | ||
:right="{ order: orders.right }" | ||
:bottom="{ order: orders.bottom }" | ||
style="height: 500px" | ||
> | ||
<template #top> | ||
<VaNavbar color="primary" class="py-2"> | ||
<template #left> | ||
<VaButton @click="showLeftSidebar = !showLeftSidebar" :icon="showLeftSidebar ? 'menu_open' : 'menu'" /> | ||
</template> | ||
<h4>LOGO</h4> | ||
<template #right> | ||
<VaButton @click="showRightSidebar = !showRightSidebar" :icon="showRightSidebar ? 'menu_open' : 'menu'" /> | ||
</template> | ||
</VaNavbar> | ||
</template> | ||
|
||
<template #left> | ||
<VaSidebar v-model="showLeftSidebar"> | ||
<VaSidebarItem> | ||
<VaSidebarItemContent> | ||
<VaIcon name="home" /> | ||
<VaSidebarItemTitle> | ||
Home | ||
</VaSidebarItemTitle> | ||
</VaSidebarItemContent> | ||
</VaSidebarItem> | ||
<VaSidebarItem> | ||
<VaSidebarItemContent> | ||
<VaIcon name="phone" /> | ||
<VaSidebarItemTitle> | ||
About | ||
</VaSidebarItemTitle> | ||
</VaSidebarItemContent> | ||
</VaSidebarItem> | ||
</VaSidebar> | ||
</template> | ||
|
||
<template #content> | ||
<main class="p-4"> | ||
<h3>Page content</h3> | ||
<p>Page content must be wrapped in main tag. You must do it manually. Here you can place any blocks you need in your application.</p> | ||
|
||
<p>For example, you can place here your router view, add sidebar with navigation in #left slot.</p> | ||
<p>If you're using VaSidebar for page navigation don't forget to wrap it in nav tag.</p> | ||
</main> | ||
</template> | ||
|
||
<template #right> | ||
<VaSidebar v-model="showRightSidebar"> | ||
<VaSidebarItem> | ||
<VaSidebarItemContent> | ||
<VaIcon name="home" /> Home | ||
</VaSidebarItemContent> | ||
</VaSidebarItem> | ||
<VaSidebarItem> | ||
<VaSidebarItemContent> | ||
<VaIcon name="phone" /> About | ||
</VaSidebarItemContent> | ||
</VaSidebarItem> | ||
</VaSidebar> | ||
</template> | ||
|
||
<template #bottom> | ||
<footer class="p-4 border-[var(--va-background-border)] border-t-2 text-right"> | ||
Footer | ||
</footer> | ||
</template> | ||
</VaLayout> | ||
</template> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We agreed to add a couple of examples at the beginning, similarly to https://www.naiveui.com/en-US/os-theme/components/layout
It seems to me that ready layout is something the user would hope to bring back from docs.