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

FilePicker: Navigation and filter should be on separate rows on mobile #882

Merged
merged 2 commits into from Aug 10, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions l10n/messages.pot
Expand Up @@ -26,11 +26,11 @@ msgstr ""
msgid "Copy"
msgstr ""

#: lib/components/FilePicker/FilePicker.vue:212
#: lib/components/FilePicker/FilePicker.vue:213
msgid "Could not create the new folder"
msgstr ""

#: lib/components/FilePicker/FilePicker.vue:135
#: lib/components/FilePicker/FilePicker.vue:136
#: lib/components/FilePicker/FilePickerNavigation.vue:65
msgid "Favorites"
msgstr ""
Expand All @@ -51,7 +51,7 @@ msgstr ""
msgid "Name"
msgstr ""

#: lib/components/FilePicker/FilePicker.vue:135
#: lib/components/FilePicker/FilePicker.vue:136
#: lib/components/FilePicker/FilePickerNavigation.vue:61
msgid "Recent"
msgstr ""
Expand Down
18 changes: 17 additions & 1 deletion lib/components/DialogBase.vue
Expand Up @@ -7,7 +7,7 @@
{{ props.name }}
</h2>
<!-- When the navigation is collapsed (too small dialog) it is displayed above the main content, otherwise on the inline start -->
<nav v-if="hasNavigation" class="dialog__navigation">
<nav v-if="hasNavigation" :class="['dialog__navigation', ...navigationClasses]">
<slot name="navigation" :is-collapsed="isNavigationCollapsed" />
</nav>
<!-- Man dialog content -->
Expand Down Expand Up @@ -61,11 +61,27 @@ const props = withDefaults(defineProps<{
* @default []
*/
buttons?: readonly IDialogButton[]
/**
* Optionally pass additionaly classes which will be set on the navigation for custom styling
* @default []
* @example
* ```html
* <DialogBase :navigation-classes="['mydialog-navigation']"><!-- --></DialogBase>
* <!-- ... -->
* <style lang="scss">
* :deep(.mydialog-navigation) {
* flex-direction: row-reverse;
* }
* </style>
* ```
*/
navigationClasses?: string[]
}>(), {
size: 'normal',
container: 'body',
message: '',
buttons: () => [],
navigationClasses: () => [],
})
const emit = defineEmits<{
Expand Down
1 change: 1 addition & 0 deletions lib/components/FilePicker/FilePicker.vue
Expand Up @@ -111,6 +111,7 @@ const dialogProps = computed(() => ({
name: props.name,
buttons: dialogButtons.value,
size: 'large',
navigationClasses: ['file-picker__navigation'],
}))
/**
Expand Down
30 changes: 28 additions & 2 deletions lib/components/FilePicker/FilePickerNavigation.vue
Expand Up @@ -122,9 +122,35 @@ const updateFilterValue = (value: string) => emit('update:filterString', value)
}
}
}
@media (max-width: 512px) {
.file-picker {
&__side {
flex-direction: row;
min-width: unset;
}
&__filter-input {
max-width: unset;
}
}
}
</style>

<style>
.file-picker__navigation .v-select.select {
min-width: 220px;
}
@media (min-width: 513px) and (max-width: 736px) {
.file-picker__navigation {
gap: 11px;
}
}
:deep(.dialog__navigation .v-select.select) {
min-width: 160px;
@media (max-width: 512px) {
.file-picker__navigation {
flex-direction: column-reverse!important;
}
}
</style>