Poprawki responsywności selectboxów

This commit is contained in:
2022-09-06 00:26:49 +02:00
parent 0821fd708e
commit 76b8534d63
6 changed files with 282 additions and 314 deletions
+1
View File
@@ -131,6 +131,7 @@ export default defineComponent({
.select-box { .select-box {
position: relative; position: relative;
width: auto;
} }
.arrow { .arrow {
+6 -48
View File
@@ -20,7 +20,9 @@
@keydown.enter="onInputSearch" @keydown.enter="onInputSearch"
/> />
<img class="search-exit" :src="getIcon('exit')" alt="exit-icon" @click="onInputClear(propName)" /> <button class="search-exit">
<img :src="getIcon('exit')" alt="exit-icon" @click="onInputClear(propName)" />
</button>
</div> </div>
<!-- <div class="search-box"> <!-- <div class="search-box">
<input <input
@@ -88,10 +90,9 @@ export default defineComponent({
}, },
}, },
setup() { setup() {
return { return {
searchersValues: inject('searchersValues') as {[key: string]: string}, searchersValues: inject('searchersValues') as { [key: string]: string },
sorterActive: inject('sorterActive') as { id: string | number; dir: number }, sorterActive: inject('sorterActive') as { id: string | number; dir: number },
journalFilterActive: inject('journalFilterActive') as JournalFilter, journalFilterActive: inject('journalFilterActive') as JournalFilter,
}; };
@@ -134,6 +135,7 @@ export default defineComponent({
<style lang="scss" scoped> <style lang="scss" scoped>
@import '../../styles/responsive'; @import '../../styles/responsive';
@import '../../styles/option.scss'; @import '../../styles/option.scss';
@import '../../styles/search_box.scss';
.options { .options {
&_wrapper { &_wrapper {
@@ -178,39 +180,11 @@ export default defineComponent({
} }
} }
.search {
&-box {
position: relative;
background: #333;
border-radius: 0.5em;
min-width: 200px;
margin-right: 0.25em;
}
&-input {
border: none;
min-width: 100%;
padding: 0.35em 0.5em;
}
&-exit {
position: absolute;
cursor: pointer;
top: 50%;
right: 10px;
transform: translateY(-50%);
width: 1em;
}
}
@include smallScreen() { @include smallScreen() {
.journal-options { .journal-options {
width: 100%; width: 100%;
} }
.options { .options {
&_wrapper { &_wrapper {
justify-content: center; justify-content: center;
@@ -240,21 +214,5 @@ export default defineComponent({
} }
} }
} }
.search {
&-box,
&-button {
margin: 0.5em 0 0 0;
}
&-box {
width: 100%;
}
&-button {
width: 80%;
max-width: 300px;
}
}
} }
</style> </style>
+11 -48
View File
@@ -15,13 +15,17 @@
<div class="search-box"> <div class="search-box">
<input class="search-input" v-model="searchedTrain" :placeholder="$t('trains.search-train')" /> <input class="search-input" v-model="searchedTrain" :placeholder="$t('trains.search-train')" />
<img class="search-exit" :src="getIcon('exit')" alt="exit-icon" @click="() => (searchedTrain = '')" /> <button class="search-exit">
<img :src="getIcon('exit')" alt="exit-icon" @click="() => (searchedTrain = '')" />
</button>
</div> </div>
<div class="search-box"> <div class="search-box">
<input class="search-input" v-model="searchedDriver" :placeholder="$t('trains.search-driver')" /> <input class="search-input" v-model="searchedDriver" :placeholder="$t('trains.search-driver')" />
<img class="search-exit" :src="getIcon('exit')" alt="exit-icon" @click="() => (searchedDriver = '')" /> <button class="search-exit">
<img :src="getIcon('exit')" alt="exit-icon" @click="() => (searchedDriver = '')" />
</button>
</div> </div>
</div> </div>
</div> </div>
@@ -130,8 +134,8 @@ export default defineComponent({
resetFilters() { resetFilters() {
this.filterList.forEach((f) => (f.isActive = true)); this.filterList.forEach((f) => (f.isActive = true));
this.searchedDriver = ""; this.searchedDriver = '';
this.searchedTrain = ""; this.searchedTrain = '';
}, },
}, },
}); });
@@ -139,10 +143,12 @@ export default defineComponent({
<style lang="scss" scoped> <style lang="scss" scoped>
@import '../../styles/responsive'; @import '../../styles/responsive';
@import '../../styles/search_box.scss';
.train-options { .train-options {
@include smallScreen() { @include smallScreen() {
width: 100%; width: 100%;
font-size: 1.25em;
} }
} }
@@ -166,34 +172,6 @@ export default defineComponent({
} }
} }
.search {
&-box {
position: relative;
background: #333;
border-radius: 0.5em;
min-width: 200px;
margin-right: 0.25em;
}
&-input {
border: none;
min-width: 100%;
padding: 0.35em 0.5em;
}
&-exit {
position: absolute;
cursor: pointer;
top: 50%;
right: 10px;
transform: translateY(-50%);
width: 1em;
}
}
.filters { .filters {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
@@ -227,6 +205,7 @@ export default defineComponent({
.journal-options { .journal-options {
width: 100%; width: 100%;
} }
.options { .options {
&_wrapper { &_wrapper {
justify-content: center; justify-content: center;
@@ -247,21 +226,5 @@ export default defineComponent({
} }
} }
} }
.search {
&-box,
&-button {
margin: 0.5em 0 0 0;
}
&-box {
width: 100%;
}
&-button {
width: 80%;
max-width: 300px;
}
}
} }
</style> </style>
+1 -1
View File
@@ -60,7 +60,7 @@
} }
@include smallScreen() { @include smallScreen() {
.journal-wrapper { .journal_wrapper {
font-size: 1.25em; font-size: 1.25em;
} }
+51
View File
@@ -0,0 +1,51 @@
@import 'responsive.scss';
.search {
&-box {
position: relative;
display: flex;
border-radius: 0.5em;
min-width: 200px;
margin-right: 0.25em;
background-color: #333;
}
&-input {
border: none;
border-radius: 0.5em 0 0 0.5em;
background-color: #333;
padding: 0.35em 0.5em;
margin-right: 0.2em;
width: 100%;
}
&-exit {
background-color: #333;
padding: 0 0.5em;
border-radius: 0 0.5em 0.5em 0;
img {
vertical-align: middle;
height: 1.3em;
}
}
@include smallScreen {
&-box,
&-button {
margin: 0.5em 0 0 0;
}
&-box {
width: 100%;
}
&-button {
width: 80%;
max-width: 300px;
}
}
}
-5
View File
@@ -103,9 +103,4 @@ export default defineComponent({
max-width: 1350px; max-width: 1350px;
} }
@include smallScreen {
.options-bar {
font-size: 1.25em;
}
}
</style> </style>