@golstats/gsc-lineups-reports 1.0.9 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/css/fonts.css +91 -91
- package/dist/gsc-lineups-reports.css +1 -1
- package/dist/gsc-lineups-reports.es.js +2946 -2675
- package/dist/gsc-lineups-reports.umd.js +10 -7
- package/dist/images/canchaRPH.svg +30 -30
- package/dist/images/events/atajada.svg +56 -56
- package/dist/images/events/fin-del-partido.svg +43 -43
- package/dist/images/events/fuera-de-lugar.svg +57 -57
- package/dist/images/events/gol.svg +48 -48
- package/dist/images/events/icn-cambio.svg +6 -6
- package/dist/images/events/icn-falta.svg +4 -4
- package/dist/images/events/icn-play.svg +3 -3
- package/dist/images/events/icn-tarjeta-amarilla.svg +3 -3
- package/dist/images/events/icn-tarjeta-roja.svg +3 -3
- package/dist/images/events/icn-tiro-a-porteria.svg +36 -36
- package/dist/images/events/icn-tiros-de-esquina.svg +18 -18
- package/dist/images/events/inicia-el-partido.svg +45 -45
- package/dist/images/events/jugada-peligrosa.svg +90 -90
- package/dist/images/events/penal-fallado.svg +194 -194
- package/dist/images/events/penal-marcado.svg +189 -189
- package/dist/images/events/tiempo-agregado.svg +74 -74
- package/dist/images/events/tiro-a-porteria.svg +80 -80
- package/dist/images/events/var.svg +30 -30
- package/package.json +7 -3
- package/src/components/Lineup2D/CheckBox.vue +42 -42
- package/src/components/Lineup2D/FilterEmpty.vue +48 -48
- package/src/components/Lineup2D/Icons.vue +29 -29
- package/src/components/Lineup2D/LineupField.vue +274 -274
- package/src/components/Lineup2D/LineupFilter.vue +285 -285
- package/src/components/Lineup2D/LineupMainHeader.vue +222 -222
- package/src/components/Lineup2D/LineupRecentItem.vue +110 -110
- package/src/components/Lineup2D/MatchDetails.vue +66 -66
- package/src/components/gsc-filter.vue +286 -286
- package/src/components/gsc-header-historico-lineup.vue +1064 -1064
- package/src/components/gsc-header-postmatch-lineup.vue +1017 -1017
- package/src/components/gsc-header-probables-lineup.vue +1044 -1044
- package/src/components/gsc-header-recientes-lineup.vue +2337 -2337
- package/src/components/gsc-lineup-dosd.vue +3777 -3752
- package/src/components/gsc-lineup-main.vue +81 -65
- package/src/components/gsc-lineups-reports.vue +10 -0
- package/src/components/gsc-lineups.vue +46 -12
- package/src/components/gsc-player-card.vue +166 -166
- package/src/index.js +4 -4
- package/src/main-test.js +42 -0
- package/src/types.d.ts +45 -45
- package/src/utils/apiUrl.js +33 -0
- package/src/utils/socketConnection.js +29 -29
|
@@ -1,287 +1,287 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="filter-modal" :style="{ zIndex }">
|
|
3
|
-
<div v-if="showButton" class="filter-modal__input" @click="openSelect">
|
|
4
|
-
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
5
|
-
<g id="vuesax/outline/sort">
|
|
6
|
-
<g id="sort">
|
|
7
|
-
<path id="Vector" opacity="0.7" d="M15.75 5.8125H2.25C1.9425 5.8125 1.6875 5.5575 1.6875 5.25C1.6875 4.9425 1.9425 4.6875 2.25 4.6875H15.75C16.0575 4.6875 16.3125 4.9425 16.3125 5.25C16.3125 5.5575 16.0575 5.8125 15.75 5.8125Z" fill="white"/>
|
|
8
|
-
<path id="Vector_2" opacity="0.7" d="M13.5 9.5625H4.5C4.1925 9.5625 3.9375 9.3075 3.9375 9C3.9375 8.6925 4.1925 8.4375 4.5 8.4375H13.5C13.8075 8.4375 14.0625 8.6925 14.0625 9C14.0625 9.3075 13.8075 9.5625 13.5 9.5625Z" fill="white"/>
|
|
9
|
-
<path id="Vector_3" opacity="0.7" d="M10.5 13.3125H7.5C7.1925 13.3125 6.9375 13.0575 6.9375 12.75C6.9375 12.4425 7.1925 12.1875 7.5 12.1875H10.5C10.8075 12.1875 11.0625 12.4425 11.0625 12.75C11.0625 13.0575 10.8075 13.3125 10.5 13.3125Z" fill="white"/>
|
|
10
|
-
</g>
|
|
11
|
-
</g>
|
|
12
|
-
</svg>
|
|
13
|
-
<input type="text" :value="name" readonly>
|
|
14
|
-
<svg width="8" height="4" viewBox="0 0 8 4" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
15
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M4 2.62045L6.86193 0.167368C7.12228 -0.0557892 7.54439 -0.0557892 7.80474 0.167368C8.06509 0.390524 8.06509 0.752333 7.80474 0.97549L4.4714 3.83263C4.21105 4.05579 3.78895 4.05579 3.5286 3.83263L0.195262 0.97549C-0.0650874 0.752333 -0.0650874 0.390524 0.195262 0.167368C0.455612 -0.0557892 0.877722 -0.0557892 1.13807 0.167368L4 2.62045Z" fill="#92929D"/>
|
|
16
|
-
</svg>
|
|
17
|
-
</div>
|
|
18
|
-
<div class="filter-modal__content" tabindex="0" ref="filterElement" @focusout="isOpen = false; goBack()" :class="isOpen ? 'open' : 'close'">
|
|
19
|
-
<div class="filter-modal__padding">
|
|
20
|
-
<div class="filter-modal__content-header">
|
|
21
|
-
<h3>Jugando como:</h3>
|
|
22
|
-
<CheckBox v-model="selectedAllTeams" label="Todos" @update:model-value="(value)=> ( value && (selectedFilterTeam = ['local', 'visit']))" />
|
|
23
|
-
</div>
|
|
24
|
-
<ul class="filter-modal__content-options">
|
|
25
|
-
<li v-for="item in teamOtp" @click="onSelect(item.id, 'team')" :class="{ active: selectedFilterTeam.includes(item.id)}" >{{ item.name }}</li>
|
|
26
|
-
</ul>
|
|
27
|
-
<div class="filter-modal__content-header">
|
|
28
|
-
<h3>Resultados:</h3>
|
|
29
|
-
<CheckBox v-model="selectedAllResults" label="Todos" @update:model-value="(value)=> ( value && (selectedFilterResults = ['win','lose','draw']))" />
|
|
30
|
-
</div>
|
|
31
|
-
<ul class="filter-modal__content-options">
|
|
32
|
-
<li v-for="item in resultOtp" @click="onSelect(item.id, 'player')" :class="{ active: selectedFilterResults.includes(item.id)}" >{{ item.name }}</li>
|
|
33
|
-
</ul>
|
|
34
|
-
</div>
|
|
35
|
-
<hr style="border-color: #FFFFFF33;">
|
|
36
|
-
<div class="filter-modal__buttons">
|
|
37
|
-
<div class="button filter-modal__text-btn" @click="removeFilter">Quitar filtros</div>
|
|
38
|
-
<div class="button filter-modal__outline-btn" @click="emitChanges">Listo</div>
|
|
39
|
-
</div>
|
|
40
|
-
</div>
|
|
41
|
-
</div>
|
|
42
|
-
</template>
|
|
43
|
-
<script setup>
|
|
44
|
-
import { ref, watch } from 'vue';
|
|
45
|
-
import CheckBox from '@/components/Lineup2D/CheckBox.vue'
|
|
46
|
-
const props = defineProps({
|
|
47
|
-
name: {
|
|
48
|
-
type: String,
|
|
49
|
-
default: '',
|
|
50
|
-
},
|
|
51
|
-
zIndex: {
|
|
52
|
-
type: Number,
|
|
53
|
-
default: 1
|
|
54
|
-
},
|
|
55
|
-
showButton: {
|
|
56
|
-
type: Boolean,
|
|
57
|
-
default: false
|
|
58
|
-
},
|
|
59
|
-
marginModal: {
|
|
60
|
-
type: String,
|
|
61
|
-
default: '0px'
|
|
62
|
-
},
|
|
63
|
-
isOpen: {
|
|
64
|
-
type: Boolean,
|
|
65
|
-
default: false
|
|
66
|
-
},
|
|
67
|
-
reset: {
|
|
68
|
-
type: Boolean,
|
|
69
|
-
default: false,
|
|
70
|
-
},
|
|
71
|
-
itemSelect: {
|
|
72
|
-
type: Object,
|
|
73
|
-
default: () => {}
|
|
74
|
-
},
|
|
75
|
-
componentWidth: {
|
|
76
|
-
type: Number,
|
|
77
|
-
default: 768,
|
|
78
|
-
validator(value) {
|
|
79
|
-
return value > 0
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
})
|
|
83
|
-
const teamOtp = [{ id: "local", name: 'Local' }, { id: "visit", name: 'Visitante'}]
|
|
84
|
-
const resultOtp = [{ id: "win", name: 'Ganado' }, { id: "draw", name: 'Empatados' }, { id: "lose", name: 'Perdidos' }]
|
|
85
|
-
|
|
86
|
-
const filterElement = ref(null)
|
|
87
|
-
const emit = defineEmits(['update:model-value', 'change'])
|
|
88
|
-
const backUpFilterTeam = ref(["local", "visit"])
|
|
89
|
-
const backUpFilterResults = ref(["win","draw", "lose" ])
|
|
90
|
-
const backUpAllTeams = ref(true)
|
|
91
|
-
const backUpAllResults = ref(true)
|
|
92
|
-
const selectedAllTeams = ref(true)
|
|
93
|
-
const selectedAllResults = ref(true)
|
|
94
|
-
const selectedFilterTeam = ref(["local", "visit"])
|
|
95
|
-
const selectedFilterResults = ref(["win","draw", "lose" ])
|
|
96
|
-
|
|
97
|
-
const openSelect = () => {
|
|
98
|
-
filterElement.value.focus()
|
|
99
|
-
backUpFilterTeam.value = JSON.parse(JSON.stringify(selectedFilterTeam.value))
|
|
100
|
-
backUpFilterResults.value = JSON.parse(JSON.stringify(selectedFilterResults.value))
|
|
101
|
-
backUpAllTeams.value = selectedAllTeams.value
|
|
102
|
-
backUpAllResults.value = selectedAllResults.value
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
watch(() => props.itemSelect, (newValue) => {
|
|
106
|
-
if (newValue) {
|
|
107
|
-
selectedFilterTeam.value = newValue.selectedFilterTeam
|
|
108
|
-
selectedFilterResults.value = newValue.selectedFilterResults
|
|
109
|
-
}
|
|
110
|
-
})
|
|
111
|
-
|
|
112
|
-
watch(() => props.reset, (newValue) => {
|
|
113
|
-
if (newValue) {
|
|
114
|
-
removeFilter();
|
|
115
|
-
}
|
|
116
|
-
})
|
|
117
|
-
|
|
118
|
-
const onSelect = (filter, type) => {
|
|
119
|
-
let filterArr
|
|
120
|
-
if(type === "team") {
|
|
121
|
-
filterArr = selectedFilterTeam.value
|
|
122
|
-
} else {
|
|
123
|
-
filterArr = selectedFilterResults.value
|
|
124
|
-
}
|
|
125
|
-
const foundInd = filterArr.findIndex(item => item === filter)
|
|
126
|
-
if(foundInd == -1) {
|
|
127
|
-
filterArr.push(filter)
|
|
128
|
-
} else {
|
|
129
|
-
if(type == 'team' && selectedFilterTeam.value.length == 2){
|
|
130
|
-
filterArr.splice(foundInd,1)
|
|
131
|
-
}else{
|
|
132
|
-
if(type == 'team'){
|
|
133
|
-
filterArr.push(filter);
|
|
134
|
-
}
|
|
135
|
-
if(selectedFilterResults.value.length > 1){
|
|
136
|
-
filterArr.splice(foundInd,1)
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
}
|
|
141
|
-
selectedAllTeams.value = selectedFilterTeam.value.length == 2 ? true : false
|
|
142
|
-
selectedAllResults.value = selectedFilterResults.value.length == 3 ? true : false
|
|
143
|
-
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
const removeFilter = ()=> {
|
|
147
|
-
selectedFilterTeam.value = ["local", "visit"]
|
|
148
|
-
selectedFilterResults.value = ["win","draw", "lose" ]
|
|
149
|
-
selectedAllTeams.value = true
|
|
150
|
-
selectedAllResults.value = true
|
|
151
|
-
emit('change', { selectedFilterTeam: selectedFilterTeam.value, selectedFilterResults: selectedFilterResults.value })
|
|
152
|
-
}
|
|
153
|
-
const emitChanges = () => {
|
|
154
|
-
emit('change', { selectedFilterTeam: selectedFilterTeam.value, selectedFilterResults: selectedFilterResults.value })
|
|
155
|
-
|
|
156
|
-
}
|
|
157
|
-
const goBack = () => {
|
|
158
|
-
|
|
159
|
-
emit('change', { selectedFilterTeam: selectedFilterTeam.value, selectedFilterResults: selectedFilterResults.value })
|
|
160
|
-
}
|
|
161
|
-
</script>
|
|
162
|
-
<style lang="scss" scoped>
|
|
163
|
-
.filter-modal {
|
|
164
|
-
width: auto;
|
|
165
|
-
border-radius: 8px;
|
|
166
|
-
border: 1px solid rgba(255, 255, 255, 0.20);
|
|
167
|
-
background: #25333E;
|
|
168
|
-
position: relative;
|
|
169
|
-
height: min-content;
|
|
170
|
-
cursor: pointer;
|
|
171
|
-
&__input {
|
|
172
|
-
display: flex;
|
|
173
|
-
align-items: center;
|
|
174
|
-
padding: 0 8px 0 12px;
|
|
175
|
-
}
|
|
176
|
-
input {
|
|
177
|
-
padding: 8px;
|
|
178
|
-
cursor: pointer;
|
|
179
|
-
width: 100%;
|
|
180
|
-
border: none;
|
|
181
|
-
background: transparent;
|
|
182
|
-
outline: none;
|
|
183
|
-
color: #FFF;
|
|
184
|
-
font-family: Poppins, sans-serif;
|
|
185
|
-
font-size: .875rem;
|
|
186
|
-
font-weight: 400;
|
|
187
|
-
line-height: 1.5rem;
|
|
188
|
-
}
|
|
189
|
-
&__content {
|
|
190
|
-
position: absolute;
|
|
191
|
-
top: calc(100% + 30px);
|
|
192
|
-
left: v-bind(marginModal) !important;
|
|
193
|
-
font-size: 12px;
|
|
194
|
-
min-width: 100%;
|
|
195
|
-
z-index: 10;
|
|
196
|
-
padding: 0;
|
|
197
|
-
border-radius: 12px;
|
|
198
|
-
background: #2E3B46;
|
|
199
|
-
width: 305px;
|
|
200
|
-
font-family: Poppins, sans-serif;
|
|
201
|
-
color: #FFF;
|
|
202
|
-
overflow: hidden;
|
|
203
|
-
// overflow-y: auto;
|
|
204
|
-
&.close {
|
|
205
|
-
max-height: 0;
|
|
206
|
-
}
|
|
207
|
-
&.open {
|
|
208
|
-
max-height: 600px;
|
|
209
|
-
// max-height: 400px;
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
&__padding {
|
|
213
|
-
padding: 20px 16.5px;
|
|
214
|
-
}
|
|
215
|
-
&__content-header {
|
|
216
|
-
display: flex;
|
|
217
|
-
width: 100%;
|
|
218
|
-
justify-content: space-between;
|
|
219
|
-
align-items: center;
|
|
220
|
-
margin-bottom: 17px;
|
|
221
|
-
h3 {
|
|
222
|
-
margin: 0;
|
|
223
|
-
color: #FFF;
|
|
224
|
-
font-family: Poppins, sans-serif;
|
|
225
|
-
font-size: 14px;
|
|
226
|
-
font-style: normal;
|
|
227
|
-
font-weight: 500;
|
|
228
|
-
line-height: 150%; /* 21px */
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
&__content-options {
|
|
232
|
-
list-style: none;
|
|
233
|
-
margin: 0;
|
|
234
|
-
padding: 0;
|
|
235
|
-
display: flex;
|
|
236
|
-
margin-bottom: 27px;
|
|
237
|
-
li:first-child {
|
|
238
|
-
border-radius: 4px 0 0 4px;
|
|
239
|
-
}
|
|
240
|
-
li:last-child {
|
|
241
|
-
border-radius: 0 4px 4px 0;
|
|
242
|
-
}
|
|
243
|
-
li.active {
|
|
244
|
-
border-color: #CBEE6B;
|
|
245
|
-
}
|
|
246
|
-
li {
|
|
247
|
-
border: 0.8px solid #8EA2AB;
|
|
248
|
-
height: 38px;
|
|
249
|
-
line-height: 38px;
|
|
250
|
-
text-align: center;
|
|
251
|
-
flex: 1 1 0%;
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
&__buttons {
|
|
255
|
-
height: 60px;
|
|
256
|
-
border-radius: 0 0 12px 12px;
|
|
257
|
-
display: flex;
|
|
258
|
-
justify-content: center;
|
|
259
|
-
align-items: center;
|
|
260
|
-
}
|
|
261
|
-
.button {
|
|
262
|
-
outline: none;
|
|
263
|
-
background: transparent;
|
|
264
|
-
color: #FFF;
|
|
265
|
-
text-align: center;
|
|
266
|
-
font-family: Poppins, sans-serif;
|
|
267
|
-
font-size: 12px;
|
|
268
|
-
font-style: normal;
|
|
269
|
-
font-weight: 500;
|
|
270
|
-
line-height: 120%; /* 14.4px */
|
|
271
|
-
letter-spacing: -0.36px;
|
|
272
|
-
cursor: pointer;
|
|
273
|
-
}
|
|
274
|
-
&__text-btn {
|
|
275
|
-
border: none;
|
|
276
|
-
color: rgba(255, 255, 255, 0.75);
|
|
277
|
-
margin-right: 16px;
|
|
278
|
-
text-decoration-line: underline;
|
|
279
|
-
}
|
|
280
|
-
&__outline-btn {
|
|
281
|
-
color: #FFF;
|
|
282
|
-
border-radius: 64px;
|
|
283
|
-
border: 0.8px solid #CBEE6B;
|
|
284
|
-
padding: 6px 24px;
|
|
285
|
-
}
|
|
286
|
-
}
|
|
1
|
+
<template>
|
|
2
|
+
<div class="filter-modal" :style="{ zIndex }">
|
|
3
|
+
<div v-if="showButton" class="filter-modal__input" @click="openSelect">
|
|
4
|
+
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
5
|
+
<g id="vuesax/outline/sort">
|
|
6
|
+
<g id="sort">
|
|
7
|
+
<path id="Vector" opacity="0.7" d="M15.75 5.8125H2.25C1.9425 5.8125 1.6875 5.5575 1.6875 5.25C1.6875 4.9425 1.9425 4.6875 2.25 4.6875H15.75C16.0575 4.6875 16.3125 4.9425 16.3125 5.25C16.3125 5.5575 16.0575 5.8125 15.75 5.8125Z" fill="white"/>
|
|
8
|
+
<path id="Vector_2" opacity="0.7" d="M13.5 9.5625H4.5C4.1925 9.5625 3.9375 9.3075 3.9375 9C3.9375 8.6925 4.1925 8.4375 4.5 8.4375H13.5C13.8075 8.4375 14.0625 8.6925 14.0625 9C14.0625 9.3075 13.8075 9.5625 13.5 9.5625Z" fill="white"/>
|
|
9
|
+
<path id="Vector_3" opacity="0.7" d="M10.5 13.3125H7.5C7.1925 13.3125 6.9375 13.0575 6.9375 12.75C6.9375 12.4425 7.1925 12.1875 7.5 12.1875H10.5C10.8075 12.1875 11.0625 12.4425 11.0625 12.75C11.0625 13.0575 10.8075 13.3125 10.5 13.3125Z" fill="white"/>
|
|
10
|
+
</g>
|
|
11
|
+
</g>
|
|
12
|
+
</svg>
|
|
13
|
+
<input type="text" :value="name" readonly>
|
|
14
|
+
<svg width="8" height="4" viewBox="0 0 8 4" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
15
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M4 2.62045L6.86193 0.167368C7.12228 -0.0557892 7.54439 -0.0557892 7.80474 0.167368C8.06509 0.390524 8.06509 0.752333 7.80474 0.97549L4.4714 3.83263C4.21105 4.05579 3.78895 4.05579 3.5286 3.83263L0.195262 0.97549C-0.0650874 0.752333 -0.0650874 0.390524 0.195262 0.167368C0.455612 -0.0557892 0.877722 -0.0557892 1.13807 0.167368L4 2.62045Z" fill="#92929D"/>
|
|
16
|
+
</svg>
|
|
17
|
+
</div>
|
|
18
|
+
<div class="filter-modal__content" tabindex="0" ref="filterElement" @focusout="isOpen = false; goBack()" :class="isOpen ? 'open' : 'close'">
|
|
19
|
+
<div class="filter-modal__padding">
|
|
20
|
+
<div class="filter-modal__content-header">
|
|
21
|
+
<h3>Jugando como:</h3>
|
|
22
|
+
<CheckBox v-model="selectedAllTeams" label="Todos" @update:model-value="(value)=> ( value && (selectedFilterTeam = ['local', 'visit']))" />
|
|
23
|
+
</div>
|
|
24
|
+
<ul class="filter-modal__content-options">
|
|
25
|
+
<li v-for="item in teamOtp" @click="onSelect(item.id, 'team')" :class="{ active: selectedFilterTeam.includes(item.id)}" >{{ item.name }}</li>
|
|
26
|
+
</ul>
|
|
27
|
+
<div class="filter-modal__content-header">
|
|
28
|
+
<h3>Resultados:</h3>
|
|
29
|
+
<CheckBox v-model="selectedAllResults" label="Todos" @update:model-value="(value)=> ( value && (selectedFilterResults = ['win','lose','draw']))" />
|
|
30
|
+
</div>
|
|
31
|
+
<ul class="filter-modal__content-options">
|
|
32
|
+
<li v-for="item in resultOtp" @click="onSelect(item.id, 'player')" :class="{ active: selectedFilterResults.includes(item.id)}" >{{ item.name }}</li>
|
|
33
|
+
</ul>
|
|
34
|
+
</div>
|
|
35
|
+
<hr style="border-color: #FFFFFF33;">
|
|
36
|
+
<div class="filter-modal__buttons">
|
|
37
|
+
<div class="button filter-modal__text-btn" @click="removeFilter">Quitar filtros</div>
|
|
38
|
+
<div class="button filter-modal__outline-btn" @click="emitChanges">Listo</div>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
</template>
|
|
43
|
+
<script setup>
|
|
44
|
+
import { ref, watch } from 'vue';
|
|
45
|
+
import CheckBox from '@/components/Lineup2D/CheckBox.vue'
|
|
46
|
+
const props = defineProps({
|
|
47
|
+
name: {
|
|
48
|
+
type: String,
|
|
49
|
+
default: '',
|
|
50
|
+
},
|
|
51
|
+
zIndex: {
|
|
52
|
+
type: Number,
|
|
53
|
+
default: 1
|
|
54
|
+
},
|
|
55
|
+
showButton: {
|
|
56
|
+
type: Boolean,
|
|
57
|
+
default: false
|
|
58
|
+
},
|
|
59
|
+
marginModal: {
|
|
60
|
+
type: String,
|
|
61
|
+
default: '0px'
|
|
62
|
+
},
|
|
63
|
+
isOpen: {
|
|
64
|
+
type: Boolean,
|
|
65
|
+
default: false
|
|
66
|
+
},
|
|
67
|
+
reset: {
|
|
68
|
+
type: Boolean,
|
|
69
|
+
default: false,
|
|
70
|
+
},
|
|
71
|
+
itemSelect: {
|
|
72
|
+
type: Object,
|
|
73
|
+
default: () => {}
|
|
74
|
+
},
|
|
75
|
+
componentWidth: {
|
|
76
|
+
type: Number,
|
|
77
|
+
default: 768,
|
|
78
|
+
validator(value) {
|
|
79
|
+
return value > 0
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
})
|
|
83
|
+
const teamOtp = [{ id: "local", name: 'Local' }, { id: "visit", name: 'Visitante'}]
|
|
84
|
+
const resultOtp = [{ id: "win", name: 'Ganado' }, { id: "draw", name: 'Empatados' }, { id: "lose", name: 'Perdidos' }]
|
|
85
|
+
|
|
86
|
+
const filterElement = ref(null)
|
|
87
|
+
const emit = defineEmits(['update:model-value', 'change'])
|
|
88
|
+
const backUpFilterTeam = ref(["local", "visit"])
|
|
89
|
+
const backUpFilterResults = ref(["win","draw", "lose" ])
|
|
90
|
+
const backUpAllTeams = ref(true)
|
|
91
|
+
const backUpAllResults = ref(true)
|
|
92
|
+
const selectedAllTeams = ref(true)
|
|
93
|
+
const selectedAllResults = ref(true)
|
|
94
|
+
const selectedFilterTeam = ref(["local", "visit"])
|
|
95
|
+
const selectedFilterResults = ref(["win","draw", "lose" ])
|
|
96
|
+
|
|
97
|
+
const openSelect = () => {
|
|
98
|
+
filterElement.value.focus()
|
|
99
|
+
backUpFilterTeam.value = JSON.parse(JSON.stringify(selectedFilterTeam.value))
|
|
100
|
+
backUpFilterResults.value = JSON.parse(JSON.stringify(selectedFilterResults.value))
|
|
101
|
+
backUpAllTeams.value = selectedAllTeams.value
|
|
102
|
+
backUpAllResults.value = selectedAllResults.value
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
watch(() => props.itemSelect, (newValue) => {
|
|
106
|
+
if (newValue) {
|
|
107
|
+
selectedFilterTeam.value = newValue.selectedFilterTeam
|
|
108
|
+
selectedFilterResults.value = newValue.selectedFilterResults
|
|
109
|
+
}
|
|
110
|
+
})
|
|
111
|
+
|
|
112
|
+
watch(() => props.reset, (newValue) => {
|
|
113
|
+
if (newValue) {
|
|
114
|
+
removeFilter();
|
|
115
|
+
}
|
|
116
|
+
})
|
|
117
|
+
|
|
118
|
+
const onSelect = (filter, type) => {
|
|
119
|
+
let filterArr
|
|
120
|
+
if(type === "team") {
|
|
121
|
+
filterArr = selectedFilterTeam.value
|
|
122
|
+
} else {
|
|
123
|
+
filterArr = selectedFilterResults.value
|
|
124
|
+
}
|
|
125
|
+
const foundInd = filterArr.findIndex(item => item === filter)
|
|
126
|
+
if(foundInd == -1) {
|
|
127
|
+
filterArr.push(filter)
|
|
128
|
+
} else {
|
|
129
|
+
if(type == 'team' && selectedFilterTeam.value.length == 2){
|
|
130
|
+
filterArr.splice(foundInd,1)
|
|
131
|
+
}else{
|
|
132
|
+
if(type == 'team'){
|
|
133
|
+
filterArr.push(filter);
|
|
134
|
+
}
|
|
135
|
+
if(selectedFilterResults.value.length > 1){
|
|
136
|
+
filterArr.splice(foundInd,1)
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
}
|
|
141
|
+
selectedAllTeams.value = selectedFilterTeam.value.length == 2 ? true : false
|
|
142
|
+
selectedAllResults.value = selectedFilterResults.value.length == 3 ? true : false
|
|
143
|
+
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
const removeFilter = ()=> {
|
|
147
|
+
selectedFilterTeam.value = ["local", "visit"]
|
|
148
|
+
selectedFilterResults.value = ["win","draw", "lose" ]
|
|
149
|
+
selectedAllTeams.value = true
|
|
150
|
+
selectedAllResults.value = true
|
|
151
|
+
emit('change', { selectedFilterTeam: selectedFilterTeam.value, selectedFilterResults: selectedFilterResults.value })
|
|
152
|
+
}
|
|
153
|
+
const emitChanges = () => {
|
|
154
|
+
emit('change', { selectedFilterTeam: selectedFilterTeam.value, selectedFilterResults: selectedFilterResults.value })
|
|
155
|
+
|
|
156
|
+
}
|
|
157
|
+
const goBack = () => {
|
|
158
|
+
|
|
159
|
+
emit('change', { selectedFilterTeam: selectedFilterTeam.value, selectedFilterResults: selectedFilterResults.value })
|
|
160
|
+
}
|
|
161
|
+
</script>
|
|
162
|
+
<style lang="scss" scoped>
|
|
163
|
+
.filter-modal {
|
|
164
|
+
width: auto;
|
|
165
|
+
border-radius: 8px;
|
|
166
|
+
border: 1px solid rgba(255, 255, 255, 0.20);
|
|
167
|
+
background: #25333E;
|
|
168
|
+
position: relative;
|
|
169
|
+
height: min-content;
|
|
170
|
+
cursor: pointer;
|
|
171
|
+
&__input {
|
|
172
|
+
display: flex;
|
|
173
|
+
align-items: center;
|
|
174
|
+
padding: 0 8px 0 12px;
|
|
175
|
+
}
|
|
176
|
+
input {
|
|
177
|
+
padding: 8px;
|
|
178
|
+
cursor: pointer;
|
|
179
|
+
width: 100%;
|
|
180
|
+
border: none;
|
|
181
|
+
background: transparent;
|
|
182
|
+
outline: none;
|
|
183
|
+
color: #FFF;
|
|
184
|
+
font-family: Poppins, sans-serif;
|
|
185
|
+
font-size: .875rem;
|
|
186
|
+
font-weight: 400;
|
|
187
|
+
line-height: 1.5rem;
|
|
188
|
+
}
|
|
189
|
+
&__content {
|
|
190
|
+
position: absolute;
|
|
191
|
+
top: calc(100% + 30px);
|
|
192
|
+
left: v-bind(marginModal) !important;
|
|
193
|
+
font-size: 12px;
|
|
194
|
+
min-width: 100%;
|
|
195
|
+
z-index: 10;
|
|
196
|
+
padding: 0;
|
|
197
|
+
border-radius: 12px;
|
|
198
|
+
background: #2E3B46;
|
|
199
|
+
width: 305px;
|
|
200
|
+
font-family: Poppins, sans-serif;
|
|
201
|
+
color: #FFF;
|
|
202
|
+
overflow: hidden;
|
|
203
|
+
// overflow-y: auto;
|
|
204
|
+
&.close {
|
|
205
|
+
max-height: 0;
|
|
206
|
+
}
|
|
207
|
+
&.open {
|
|
208
|
+
max-height: 600px;
|
|
209
|
+
// max-height: 400px;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
&__padding {
|
|
213
|
+
padding: 20px 16.5px;
|
|
214
|
+
}
|
|
215
|
+
&__content-header {
|
|
216
|
+
display: flex;
|
|
217
|
+
width: 100%;
|
|
218
|
+
justify-content: space-between;
|
|
219
|
+
align-items: center;
|
|
220
|
+
margin-bottom: 17px;
|
|
221
|
+
h3 {
|
|
222
|
+
margin: 0;
|
|
223
|
+
color: #FFF;
|
|
224
|
+
font-family: Poppins, sans-serif;
|
|
225
|
+
font-size: 14px;
|
|
226
|
+
font-style: normal;
|
|
227
|
+
font-weight: 500;
|
|
228
|
+
line-height: 150%; /* 21px */
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
&__content-options {
|
|
232
|
+
list-style: none;
|
|
233
|
+
margin: 0;
|
|
234
|
+
padding: 0;
|
|
235
|
+
display: flex;
|
|
236
|
+
margin-bottom: 27px;
|
|
237
|
+
li:first-child {
|
|
238
|
+
border-radius: 4px 0 0 4px;
|
|
239
|
+
}
|
|
240
|
+
li:last-child {
|
|
241
|
+
border-radius: 0 4px 4px 0;
|
|
242
|
+
}
|
|
243
|
+
li.active {
|
|
244
|
+
border-color: #CBEE6B;
|
|
245
|
+
}
|
|
246
|
+
li {
|
|
247
|
+
border: 0.8px solid #8EA2AB;
|
|
248
|
+
height: 38px;
|
|
249
|
+
line-height: 38px;
|
|
250
|
+
text-align: center;
|
|
251
|
+
flex: 1 1 0%;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
&__buttons {
|
|
255
|
+
height: 60px;
|
|
256
|
+
border-radius: 0 0 12px 12px;
|
|
257
|
+
display: flex;
|
|
258
|
+
justify-content: center;
|
|
259
|
+
align-items: center;
|
|
260
|
+
}
|
|
261
|
+
.button {
|
|
262
|
+
outline: none;
|
|
263
|
+
background: transparent;
|
|
264
|
+
color: #FFF;
|
|
265
|
+
text-align: center;
|
|
266
|
+
font-family: Poppins, sans-serif;
|
|
267
|
+
font-size: 12px;
|
|
268
|
+
font-style: normal;
|
|
269
|
+
font-weight: 500;
|
|
270
|
+
line-height: 120%; /* 14.4px */
|
|
271
|
+
letter-spacing: -0.36px;
|
|
272
|
+
cursor: pointer;
|
|
273
|
+
}
|
|
274
|
+
&__text-btn {
|
|
275
|
+
border: none;
|
|
276
|
+
color: rgba(255, 255, 255, 0.75);
|
|
277
|
+
margin-right: 16px;
|
|
278
|
+
text-decoration-line: underline;
|
|
279
|
+
}
|
|
280
|
+
&__outline-btn {
|
|
281
|
+
color: #FFF;
|
|
282
|
+
border-radius: 64px;
|
|
283
|
+
border: 0.8px solid #CBEE6B;
|
|
284
|
+
padding: 6px 24px;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
287
|
</style>
|