@golstats/gsc-top-player 1.1.2 → 1.1.4
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/dist/{FilterConditions-33ce2100-BdE1vYE7.js → FilterConditions-33ce2100-DWmn0gLJ.js} +1 -1
- package/dist/{FilterField-0f3013eb-DwYb-xkF.js → FilterField-0f3013eb-DAR1Qtvx.js} +1 -1
- package/dist/{FilterSubcategories-4c69ac5b-B8IgttLN.js → FilterSubcategories-4c69ac5b-DrBntaSu.js} +1 -1
- package/dist/gsc-top-player.css +1 -1
- package/dist/gsc-top-player.es.js +1 -1
- package/dist/gsc-top-player.umd.js +11 -11
- package/dist/{index-DnoB2hRC.js → index-DOAxTpI0.js} +1464 -1439
- package/package.json +1 -2
- package/src/components/comparative/gsc-top.vue +23 -11
- package/src/components/comparative/gsc-tops-full.vue +6 -4
- package/src/utils/imageUrl.js +30 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@golstats/gsc-top-player",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.4",
|
|
4
4
|
"main": "dist/gsc-top-player.umd.js",
|
|
5
5
|
"module": "dist/gsc-top-player.es.js",
|
|
6
6
|
"exports": {
|
|
@@ -54,7 +54,6 @@
|
|
|
54
54
|
"@golstats/gsc-label": "^1.0.5",
|
|
55
55
|
"@golstats/gsc-season-select": "^1.0.10",
|
|
56
56
|
"@golstats/gsc-switch-component": "^1.0.14",
|
|
57
|
-
"@golstats/gsc-tournament-select": "^1.0.23",
|
|
58
57
|
"axios": "^1.10.0"
|
|
59
58
|
},
|
|
60
59
|
"devDependencies": {
|
|
@@ -29,9 +29,12 @@
|
|
|
29
29
|
logo:
|
|
30
30
|
player.img && player.img.includes('player-shadow')
|
|
31
31
|
? 'https://golstatsimages.blob.core.windows.net/images-library/logo-team@2x.png'
|
|
32
|
-
:
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
: getImageUrl(
|
|
33
|
+
'https://golstatsimages.blob.core.windows.net/teams-80/' +
|
|
34
|
+
player.teamid +
|
|
35
|
+
'.png',
|
|
36
|
+
provider,
|
|
37
|
+
),
|
|
35
38
|
name: player.name,
|
|
36
39
|
player_short: player.name_short,
|
|
37
40
|
player_id: player.id,
|
|
@@ -87,9 +90,12 @@
|
|
|
87
90
|
team_logo:
|
|
88
91
|
player.img && player.img.includes('player-shadow')
|
|
89
92
|
? 'https://golstatsimages.blob.core.windows.net/images-library/logo-team@2x.png'
|
|
90
|
-
:
|
|
91
|
-
|
|
92
|
-
|
|
93
|
+
: getImageUrl(
|
|
94
|
+
'https://golstatsimages.blob.core.windows.net/teams-80/' +
|
|
95
|
+
player.teamid +
|
|
96
|
+
'.png',
|
|
97
|
+
provider,
|
|
98
|
+
),
|
|
93
99
|
player_position: player.position,
|
|
94
100
|
player_country_flag:
|
|
95
101
|
'https://golstatsimages.blob.core.windows.net/flags/' +
|
|
@@ -210,10 +216,12 @@
|
|
|
210
216
|
id: player.id,
|
|
211
217
|
player_age: player.age,
|
|
212
218
|
team_abrev: player.team,
|
|
213
|
-
team_logo:
|
|
219
|
+
team_logo: getImageUrl(
|
|
214
220
|
'https://golstatsimages.blob.core.windows.net/teams-80/' +
|
|
215
|
-
|
|
216
|
-
|
|
221
|
+
player.teamid +
|
|
222
|
+
'.png',
|
|
223
|
+
provider,
|
|
224
|
+
),
|
|
217
225
|
player_position: player.position,
|
|
218
226
|
player_country_flag:
|
|
219
227
|
'https://golstatsimages.blob.core.windows.net/flags/' +
|
|
@@ -292,6 +300,7 @@
|
|
|
292
300
|
<script>
|
|
293
301
|
import axios from 'axios'
|
|
294
302
|
import { getApiUrl } from '@/utils/apiUrl.js'
|
|
303
|
+
import { getImageUrl } from '@/utils/imageUrl.js'
|
|
295
304
|
import { ref } from 'vue'
|
|
296
305
|
import useElementSize from './useElementSize'
|
|
297
306
|
import GSCLeaders from './gsc-header-tops.vue'
|
|
@@ -487,8 +496,10 @@ export default {
|
|
|
487
496
|
topTeam[play.team_id]['total'] = play.total
|
|
488
497
|
topTeam[play.team_id]['id'] = this.teamInfo[play.team_id].id
|
|
489
498
|
topTeam[play.team_id]['name'] = this.teamInfo[play.team_id].name.replace(' Femenil', '')
|
|
490
|
-
topTeam[play.team_id]['img'] =
|
|
491
|
-
'https://golstatsimages.blob.core.windows.net/teams-80/' + play.team_id + '.png'
|
|
499
|
+
topTeam[play.team_id]['img'] = getImageUrl(
|
|
500
|
+
'https://golstatsimages.blob.core.windows.net/teams-80/' + play.team_id + '.png',
|
|
501
|
+
this.provider,
|
|
502
|
+
)
|
|
492
503
|
topTeam[play.team_id]['effectiveness'] = this.teamInfo[play.team_id].effectiveness
|
|
493
504
|
topTeam[play.team_id]['frecuency'] = this.teamInfo[play.team_id].frecuency
|
|
494
505
|
topTeam[play.team_id]['game_avg'] = this.teamInfo[play.team_id].game_avg
|
|
@@ -782,6 +793,7 @@ export default {
|
|
|
782
793
|
],
|
|
783
794
|
}),
|
|
784
795
|
methods: {
|
|
796
|
+
getImageUrl,
|
|
785
797
|
getButtonFontSize() {
|
|
786
798
|
// Ajustar el tamaño de la fuente según el ancho del componente
|
|
787
799
|
if (this.elementSize.width > 500) {
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
<script>
|
|
37
37
|
import axios from 'axios'
|
|
38
38
|
import { getApiUrl } from '@/utils/apiUrl.js'
|
|
39
|
+
import { getImageUrl } from '@/utils/imageUrl.js'
|
|
39
40
|
import computedProperties from './computedProperties.js'
|
|
40
41
|
import useElementSize from './useElementSize'
|
|
41
42
|
import GSCTopCategory from '@/components/comparative/gsc-top.vue'
|
|
@@ -44,7 +45,6 @@ import { filtersTypes, personalDataSubFiltersTypes } from '@golstats/gsc-filters
|
|
|
44
45
|
|
|
45
46
|
import '@@/@golstats/gsc-switch-component/dist/style.css'
|
|
46
47
|
import '@@/@golstats/gsc-season-select/dist/style.css'
|
|
47
|
-
import '@@/@golstats/gsc-tournament-select/dist/style.css'
|
|
48
48
|
import '@@/@golstats/gsc-dropdown/dist/style.css'
|
|
49
49
|
import '@@/@golstats/gsc-filters/dist/style.css'
|
|
50
50
|
import '@@/@golstats/gsc-label/dist/style.css'
|
|
@@ -878,10 +878,12 @@ export default {
|
|
|
878
878
|
player_age: this.calcularEdad(data[index].dob),
|
|
879
879
|
team_abrev: data[index].teams[0].acronym,
|
|
880
880
|
team_name: data[index].teams[0].team_name,
|
|
881
|
-
team_logo:
|
|
881
|
+
team_logo: getImageUrl(
|
|
882
882
|
'https://golstatsimages.blob.core.windows.net/teams-80/' +
|
|
883
|
-
|
|
884
|
-
|
|
883
|
+
data[index].teams[0].team_id +
|
|
884
|
+
'.png',
|
|
885
|
+
this.provider,
|
|
886
|
+
),
|
|
885
887
|
player_position: data[index].position_id,
|
|
886
888
|
player_country_flag:
|
|
887
889
|
'https://golstatsimages.blob.core.windows.net/flags/' +
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inserta el proveedor activo en una URL de imágenes de GolStats
|
|
3
|
+
* (dominio `golstatsimages.blob.core.windows.net`, escudos `teams-*`, etc.).
|
|
4
|
+
*
|
|
5
|
+
* Regla A: provider es 1, 0 o null/undefined → URL sin cambios.
|
|
6
|
+
* Regla B: provider >= 2 → se inserta `/<provider>` después del contenedor.
|
|
7
|
+
*
|
|
8
|
+
* https://host/teams-80/16906.png → https://host/teams-80/2/16906.png
|
|
9
|
+
*
|
|
10
|
+
* El proveedor no puede ir justo después del host: Azure exige que el primer
|
|
11
|
+
* segmento sea un nombre de contenedor válido (mínimo 3 caracteres) y responde
|
|
12
|
+
* 400 ante `/2/teams-80/16906.png`.
|
|
13
|
+
*
|
|
14
|
+
* @param {string} originalUrl URL original (con el id ya interpolado)
|
|
15
|
+
* @param {number|null} provider ID del proveedor
|
|
16
|
+
* @returns {string} URL final
|
|
17
|
+
*/
|
|
18
|
+
export function getImageUrl(originalUrl, provider) {
|
|
19
|
+
if (!provider || provider <= 1) {
|
|
20
|
+
return originalUrl
|
|
21
|
+
}
|
|
22
|
+
const parsed = new URL(originalUrl)
|
|
23
|
+
const segments = parsed.pathname.split('/').filter((s) => s !== '')
|
|
24
|
+
if (segments.length === 0) {
|
|
25
|
+
return originalUrl
|
|
26
|
+
}
|
|
27
|
+
const [container, ...rest] = segments
|
|
28
|
+
const path = [container, provider, ...rest].join('/')
|
|
29
|
+
return `${parsed.origin}/${path}${parsed.search}`
|
|
30
|
+
}
|