mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 13:28:11 +00:00
chore: switched drivers filter from text to select input (TrainsView); updated inputs clear buttons
This commit is contained in:
@@ -22,11 +22,6 @@
|
|||||||
|
|
||||||
<link rel="icon" href="favicon.ico" />
|
<link rel="icon" href="favicon.ico" />
|
||||||
|
|
||||||
<link rel="stylesheet" href="fa/css/fontawesome.css" />
|
|
||||||
<link rel="stylesheet" href="fa/css/brands.css" />
|
|
||||||
<link rel="stylesheet" href="fa/css/regular.css" />
|
|
||||||
<link rel="stylesheet" href="fa/css/solid.css" />
|
|
||||||
|
|
||||||
<!-- Static OpenGraph meta -->
|
<!-- Static OpenGraph meta -->
|
||||||
<meta name="description" content="Pomocnik maszynisty i dyżurnego symulatora Train Driver 2" />
|
<meta name="description" content="Pomocnik maszynisty i dyżurnego symulatora Train Driver 2" />
|
||||||
<meta property="og:url" content="https://stacjownik-td2.web.app/" />
|
<meta property="og:url" content="https://stacjownik-td2.web.app/" />
|
||||||
|
|||||||
@@ -51,7 +51,7 @@
|
|||||||
:list="propName.toString()"
|
:list="propName.toString()"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<button class="search-exit" v-if="!propName.toString().startsWith('search-date')">
|
<button class="btn btn--action search-exit" v-if="!propName.toString().startsWith('search-date')">
|
||||||
<img
|
<img
|
||||||
src="/images/icon-exit.svg"
|
src="/images/icon-exit.svg"
|
||||||
alt="exit-icon"
|
alt="exit-icon"
|
||||||
|
|||||||
@@ -24,31 +24,26 @@
|
|||||||
@blur="preventKeyDown = false"
|
@blur="preventKeyDown = false"
|
||||||
:placeholder="$t(`options.search-train`)"
|
:placeholder="$t(`options.search-train`)"
|
||||||
/>
|
/>
|
||||||
<button class="search-exit">
|
<button class="btn btn--action search-exit" @click="onInputClear('train')">
|
||||||
<img
|
<img src="/images/icon-exit.svg" alt="Trains search clear icon" />
|
||||||
src="/images/icon-exit.svg"
|
|
||||||
alt="Trains search clear icon"
|
|
||||||
@click="onInputClear('train')"
|
|
||||||
/>
|
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="search-box">
|
<div class="search-box">
|
||||||
<input
|
<select
|
||||||
v-model="searchedDriver"
|
|
||||||
class="search-input"
|
class="search-input"
|
||||||
id="driver-search"
|
name="active-trains"
|
||||||
name="driver-search"
|
id="active-trains"
|
||||||
@focus="preventKeyDown = true"
|
v-model="searchedDriver"
|
||||||
@blur="preventKeyDown = false"
|
>
|
||||||
:placeholder="$t(`options.search-driver`)"
|
<option value="">{{ $t('options.search-driver') }}</option>
|
||||||
/>
|
<option v-for="driverName in activeDriverNames" :value="driverName">
|
||||||
<button class="search-exit">
|
{{ driverName }}
|
||||||
<img
|
</option>
|
||||||
src="/images/icon-exit.svg"
|
</select>
|
||||||
alt="Driver search clear icon"
|
|
||||||
@click="onInputClear('driver')"
|
<button class="btn btn--action search-exit" @click="onInputClear('driver')">
|
||||||
/>
|
<img src="/images/icon-exit.svg" alt="Trains search clear icon" />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -101,6 +96,7 @@
|
|||||||
import { defineComponent, inject, PropType } from 'vue';
|
import { defineComponent, inject, PropType } from 'vue';
|
||||||
import keyMixin from '../../mixins/keyMixin';
|
import keyMixin from '../../mixins/keyMixin';
|
||||||
import { TrainFilter, TrainFilterSection } from './typings';
|
import { TrainFilter, TrainFilterSection } from './typings';
|
||||||
|
import { useMainStore } from '../../store/mainStore';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
mixins: [keyMixin],
|
mixins: [keyMixin],
|
||||||
@@ -120,6 +116,7 @@ export default defineComponent({
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
showOptions: false,
|
showOptions: false,
|
||||||
|
store: useMainStore(),
|
||||||
lastSelectedFilter: null as TrainFilter | null,
|
lastSelectedFilter: null as TrainFilter | null,
|
||||||
TrainFilterSection
|
TrainFilterSection
|
||||||
};
|
};
|
||||||
@@ -141,6 +138,16 @@ export default defineComponent({
|
|||||||
id,
|
id,
|
||||||
value: this.$t(`options.sort-${id}`)
|
value: this.$t(`options.sort-${id}`)
|
||||||
}));
|
}));
|
||||||
|
},
|
||||||
|
|
||||||
|
activeDriverNames() {
|
||||||
|
const driverNameSet = new Set<string>();
|
||||||
|
|
||||||
|
this.store.trainList.forEach((train) => {
|
||||||
|
driverNameSet.add(train.driverName);
|
||||||
|
});
|
||||||
|
|
||||||
|
return [...driverNameSet].sort((a, b) => a.localeCompare(b));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
+2
-3
@@ -157,9 +157,8 @@
|
|||||||
"sort-title": "SORT BY:",
|
"sort-title": "SORT BY:",
|
||||||
"filter-title": "FILTER BY:",
|
"filter-title": "FILTER BY:",
|
||||||
"search-title": "SEARCH:",
|
"search-title": "SEARCH:",
|
||||||
"search-train-no": "Train no. / #",
|
"search-train": "Train no. / #",
|
||||||
"search-train": "Train no.",
|
"search-driver": "Choose a driver...",
|
||||||
"search-driver": "Driver name",
|
|
||||||
"search-dispatcher": "Dispatcher name",
|
"search-dispatcher": "Dispatcher name",
|
||||||
"search-station": "Scenery name / #",
|
"search-station": "Scenery name / #",
|
||||||
"search-author": "Timetable author name",
|
"search-author": "Timetable author name",
|
||||||
|
|||||||
+1
-2
@@ -154,9 +154,8 @@
|
|||||||
"sort-title": "SORTUJ WG:",
|
"sort-title": "SORTUJ WG:",
|
||||||
"filter-title": "FILTRUJ WG:",
|
"filter-title": "FILTRUJ WG:",
|
||||||
"search-title": "SZUKAJ:",
|
"search-title": "SZUKAJ:",
|
||||||
"search-train-no": "Nr pociągu",
|
|
||||||
"search-train": "Nr pociągu / #",
|
"search-train": "Nr pociągu / #",
|
||||||
"search-driver": "Nick maszynisty",
|
"search-driver": "Wybierz maszynistę...",
|
||||||
"search-dispatcher": "Nick dyżurnego",
|
"search-dispatcher": "Nick dyżurnego",
|
||||||
"search-station": "Nazwa scenerii / #",
|
"search-station": "Nazwa scenerii / #",
|
||||||
"search-author": "Nick autora rozkładu jazdy",
|
"search-author": "Nick autora rozkładu jazdy",
|
||||||
|
|||||||
@@ -72,15 +72,6 @@ h1.option-title {
|
|||||||
.search {
|
.search {
|
||||||
margin: 0.5em auto;
|
margin: 0.5em auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-box {
|
|
||||||
.search-exit {
|
|
||||||
position: absolute;
|
|
||||||
transform: translateY(-50%);
|
|
||||||
top: 50%;
|
|
||||||
right: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.options_actions {
|
.options_actions {
|
||||||
|
|||||||
@@ -11,8 +11,9 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
display: flex;
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 0.25em;
|
||||||
|
|
||||||
border-radius: 0.5em;
|
|
||||||
min-width: 200px;
|
min-width: 200px;
|
||||||
margin-right: 0.25em;
|
margin-right: 0.25em;
|
||||||
}
|
}
|
||||||
@@ -20,6 +21,8 @@
|
|||||||
&-input {
|
&-input {
|
||||||
border: none;
|
border: none;
|
||||||
background-color: #424242;
|
background-color: #424242;
|
||||||
|
color: white;
|
||||||
|
border-radius: 0.5em;
|
||||||
|
|
||||||
padding: 0.35em 0.5em;
|
padding: 0.35em 0.5em;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@@ -27,6 +30,7 @@
|
|||||||
|
|
||||||
&-exit {
|
&-exit {
|
||||||
background-color: #424242;
|
background-color: #424242;
|
||||||
|
border-radius: 0.5em;
|
||||||
|
|
||||||
img {
|
img {
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
@@ -39,7 +43,7 @@
|
|||||||
max-width: 300px;
|
max-width: 300px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@include responsive.smallScreen{
|
@include responsive.smallScreen {
|
||||||
&-box,
|
&-box,
|
||||||
&-button {
|
&-button {
|
||||||
margin: 0.5em 0 0 0;
|
margin: 0.5em 0 0 0;
|
||||||
@@ -50,3 +54,15 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.search-box > i {
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
top: 50%;
|
||||||
|
transform: translateY(-50%);
|
||||||
|
padding-right: 0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
select.search-input {
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user