@golstats/gsc-next-rivals 1.0.1 → 1.0.3
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/gsc-next-rivals.es.js +603 -52
- package/dist/gsc-next-rivals.umd.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +2 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { createElementBlock as u, openBlock as
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
for (const [
|
|
5
|
-
|
|
6
|
-
return
|
|
7
|
-
},
|
|
1
|
+
import { createElementBlock as u, openBlock as s, createElementVNode as n, normalizeStyle as h, toDisplayString as v, ref as y, watch as I, computed as F, onMounted as L, onBeforeMount as G, createVNode as N, renderSlot as R, normalizeClass as T, Transition as H, withCtx as z, withDirectives as W, createCommentVNode as b, Fragment as D, renderList as E, vShow as O, unref as J, useCssVars as Z, pushScopeId as M, popScopeId as j, onUnmounted as X, mergeProps as Y, createBlock as q } from "vue";
|
|
2
|
+
const A = (e, i) => {
|
|
3
|
+
const t = e.__vccOpts || e;
|
|
4
|
+
for (const [r, c] of i)
|
|
5
|
+
t[r] = c;
|
|
6
|
+
return t;
|
|
7
|
+
}, K = ["src", "alt"], Q = { class: "team-card__name" }, tt = {
|
|
8
8
|
__name: "GscTeamCard",
|
|
9
9
|
props: {
|
|
10
10
|
logo: {
|
|
@@ -25,28 +25,485 @@ const p = (e, c) => {
|
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
27
|
emits: ["click-rival"],
|
|
28
|
-
setup(e, { emit:
|
|
29
|
-
const
|
|
30
|
-
function
|
|
31
|
-
|
|
28
|
+
setup(e, { emit: i }) {
|
|
29
|
+
const t = e;
|
|
30
|
+
function r() {
|
|
31
|
+
i("click-rival", t.rival);
|
|
32
32
|
}
|
|
33
|
-
return (
|
|
33
|
+
return (c, l) => (s(), u("div", {
|
|
34
34
|
class: "team-card",
|
|
35
|
-
onClick:
|
|
35
|
+
onClick: r
|
|
36
36
|
}, [
|
|
37
|
-
|
|
37
|
+
n("div", {
|
|
38
38
|
class: "team-card__bg-image",
|
|
39
39
|
style: h({ "background-image": `url(${e.logo})` })
|
|
40
40
|
}, null, 4),
|
|
41
|
-
|
|
41
|
+
n("img", {
|
|
42
42
|
class: "team-card__image",
|
|
43
43
|
src: e.logo,
|
|
44
44
|
alt: e.name
|
|
45
|
-
}, null, 8,
|
|
46
|
-
|
|
45
|
+
}, null, 8, K),
|
|
46
|
+
n("p", Q, v(e.name), 1)
|
|
47
47
|
]));
|
|
48
48
|
}
|
|
49
|
-
},
|
|
49
|
+
}, et = /* @__PURE__ */ A(tt, [["__scopeId", "data-v-8f13b2f7"]]), ot = (e, i) => {
|
|
50
|
+
const t = e.__vccOpts || e;
|
|
51
|
+
for (const [r, c] of i)
|
|
52
|
+
t[r] = c;
|
|
53
|
+
return t;
|
|
54
|
+
}, $ = {
|
|
55
|
+
props: {
|
|
56
|
+
type: { type: Number, default: 0 },
|
|
57
|
+
value: { type: Boolean, default: !1 },
|
|
58
|
+
textValue: String,
|
|
59
|
+
icon: String,
|
|
60
|
+
iconPosition: { type: String, default: "left" },
|
|
61
|
+
iconSize: String,
|
|
62
|
+
fontColor: { type: String, default: "#FFFFFF" },
|
|
63
|
+
textDecoration: String,
|
|
64
|
+
fontSize: { type: String, default: "16px" },
|
|
65
|
+
fontSizeStat: { type: String, default: "16px" },
|
|
66
|
+
fontStyle: String,
|
|
67
|
+
fontFamily: { type: String, default: "Poppins-Regular" },
|
|
68
|
+
height: { type: String, default: "fit-content" },
|
|
69
|
+
width: { type: String, default: "fit-content" },
|
|
70
|
+
borderRadius: { type: String, default: "0px" },
|
|
71
|
+
borderType: { type: String, default: "solid" },
|
|
72
|
+
borderWidth: { type: Number, default: 0 },
|
|
73
|
+
borderWidthBtn: { type: String, default: "2px" },
|
|
74
|
+
borderColor: String,
|
|
75
|
+
backgroundColor: { type: String, default: "none" },
|
|
76
|
+
activeBackgroundColor: { type: String, default: "#000000" },
|
|
77
|
+
activeBorderWidth: { type: Number, default: 2 },
|
|
78
|
+
activeBorderType: { type: String, default: "solid" },
|
|
79
|
+
activeBorderColor: { type: String, default: "#cbee6b" },
|
|
80
|
+
activeColorText: { type: String, default: "#FFFFFF" },
|
|
81
|
+
cursorType: { type: String, default: "default" },
|
|
82
|
+
typeOnOff: { type: Boolean, default: !1 },
|
|
83
|
+
textCategory: String,
|
|
84
|
+
textStat: String,
|
|
85
|
+
marginLeftStat: { type: String, default: "15%" }
|
|
86
|
+
},
|
|
87
|
+
watch: {
|
|
88
|
+
value: {
|
|
89
|
+
deep: !0,
|
|
90
|
+
immediate: !0,
|
|
91
|
+
handler(e) {
|
|
92
|
+
this.status = e;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
data() {
|
|
97
|
+
return { status: !1 };
|
|
98
|
+
},
|
|
99
|
+
computed: {
|
|
100
|
+
customStyle() {
|
|
101
|
+
return {
|
|
102
|
+
height: this.height,
|
|
103
|
+
width: this.width,
|
|
104
|
+
backgroundColor: this.backgroundColor,
|
|
105
|
+
borderRadius: this.borderRadius,
|
|
106
|
+
border: `${this.borderType} ${this.borderWidth}px ${this.borderColor}`,
|
|
107
|
+
color: this.fontColor,
|
|
108
|
+
textDecoration: this.textDecoration,
|
|
109
|
+
cursor: this.cursorType,
|
|
110
|
+
fontSize: this.fontSize,
|
|
111
|
+
fontStyle: this.fontStyle,
|
|
112
|
+
fontFamily: `${this.fontFamily} !important`
|
|
113
|
+
};
|
|
114
|
+
},
|
|
115
|
+
customActive() {
|
|
116
|
+
return {
|
|
117
|
+
backgroundColor: this.activeBackgroundColor,
|
|
118
|
+
color: this.activeColorText,
|
|
119
|
+
border: `${this.activeBorderType} ${this.activeBorderWidth}px ${this.activeBorderColor}`
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
methods: {
|
|
124
|
+
btnClick(e) {
|
|
125
|
+
this.$emit("click", e), this.typeOnOff && (this.status = !this.status, this.$emit("status", this.status));
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}, V = () => {
|
|
129
|
+
Z((e) => ({
|
|
130
|
+
"9d01acb4": e.height,
|
|
131
|
+
"14e95081": e.borderWidthBtn,
|
|
132
|
+
"38fec285": e.borderType,
|
|
133
|
+
34353510: e.borderColor,
|
|
134
|
+
"20d20dc6": e.borderRadius,
|
|
135
|
+
17130967: e.width,
|
|
136
|
+
"4ccb7d36": e.backgroundColor,
|
|
137
|
+
"5d1e86a2": e.cursorType,
|
|
138
|
+
ce65d4a2: e.fontSize,
|
|
139
|
+
fe4ac47a: e.fontStyle,
|
|
140
|
+
f98e44dc: e.fontFamily,
|
|
141
|
+
"93b87770": e.marginLeftStat,
|
|
142
|
+
c7f7beba: e.fontSizeStat
|
|
143
|
+
}));
|
|
144
|
+
}, P = $.setup;
|
|
145
|
+
$.setup = P ? (e, i) => (V(), P(e, i)) : V;
|
|
146
|
+
const it = (e) => (M("data-v-f3ee6b2b"), e = e(), j(), e), rt = ["src"], at = {
|
|
147
|
+
key: 1,
|
|
148
|
+
class: "text"
|
|
149
|
+
}, lt = ["src"], nt = { class: "stats" }, st = /* @__PURE__ */ it(() => /* @__PURE__ */ n("img", {
|
|
150
|
+
class: "iconstats",
|
|
151
|
+
src: "https://golstatsimages.blob.core.windows.net/todoelfut/playdes.png"
|
|
152
|
+
}, null, -1)), dt = { class: "numstats" }, ut = { class: "leyend" };
|
|
153
|
+
function ct(e, i, t, r, c, l) {
|
|
154
|
+
return s(), u("div", null, [
|
|
155
|
+
t.type == 0 ? (s(), u("div", {
|
|
156
|
+
key: 0,
|
|
157
|
+
class: T(["button", c.status && t.typeOnOff && "button-active"]),
|
|
158
|
+
style: h([l.customStyle, c.status && t.typeOnOff && l.customActive]),
|
|
159
|
+
onClick: i[0] || (i[0] = (...d) => l.btnClick && l.btnClick(...d))
|
|
160
|
+
}, [
|
|
161
|
+
t.icon && t.iconPosition.toLowerCase() === "left" ? (s(), u("img", {
|
|
162
|
+
key: 0,
|
|
163
|
+
class: "icon",
|
|
164
|
+
style: h({ width: t.iconSize }),
|
|
165
|
+
src: t.icon
|
|
166
|
+
}, null, 12, rt)) : b("", !0),
|
|
167
|
+
t.textValue ? (s(), u("div", at, v(t.textValue), 1)) : b("", !0),
|
|
168
|
+
t.icon && t.iconPosition.toLowerCase() === "right" ? (s(), u("img", {
|
|
169
|
+
key: 2,
|
|
170
|
+
class: "icon",
|
|
171
|
+
style: h({ width: t.iconSize }),
|
|
172
|
+
src: t.icon
|
|
173
|
+
}, null, 12, lt)) : b("", !0)
|
|
174
|
+
], 6)) : b("", !0),
|
|
175
|
+
t.type == 1 ? (s(), u("div", {
|
|
176
|
+
key: 1,
|
|
177
|
+
class: "button-target",
|
|
178
|
+
onClick: i[1] || (i[1] = (...d) => l.btnClick && l.btnClick(...d))
|
|
179
|
+
}, [
|
|
180
|
+
n("div", nt, [
|
|
181
|
+
st,
|
|
182
|
+
n("div", dt, v(t.textStat), 1)
|
|
183
|
+
]),
|
|
184
|
+
n("div", ut, v(t.textCategory), 1)
|
|
185
|
+
])) : b("", !0)
|
|
186
|
+
]);
|
|
187
|
+
}
|
|
188
|
+
const pt = /* @__PURE__ */ ot($, [["render", ct], ["__scopeId", "data-v-f3ee6b2b"]]), ft = { class: "gsc-dropdown__main-container__item-selected" }, mt = ["height", "width"], gt = ["stroke"], yt = { class: "gsc-dropdown__items-container" }, ht = ["onClick"], vt = {
|
|
189
|
+
key: 0,
|
|
190
|
+
class: "gsc-dropdown__items-footer"
|
|
191
|
+
}, bt = {
|
|
192
|
+
__name: "GSC-Dropdown",
|
|
193
|
+
props: {
|
|
194
|
+
modelValue: {
|
|
195
|
+
type: [Object, Number, String],
|
|
196
|
+
default: () => null
|
|
197
|
+
},
|
|
198
|
+
height: {
|
|
199
|
+
type: String,
|
|
200
|
+
default: "fit-content"
|
|
201
|
+
},
|
|
202
|
+
width: {
|
|
203
|
+
type: String,
|
|
204
|
+
default: "fit-content"
|
|
205
|
+
},
|
|
206
|
+
fontSize: {
|
|
207
|
+
type: String,
|
|
208
|
+
default: "14px"
|
|
209
|
+
},
|
|
210
|
+
borderRadius: {
|
|
211
|
+
type: Number,
|
|
212
|
+
default: 5
|
|
213
|
+
},
|
|
214
|
+
arrowHeight: {
|
|
215
|
+
type: Number,
|
|
216
|
+
default: 24
|
|
217
|
+
},
|
|
218
|
+
arrowWidth: {
|
|
219
|
+
type: Number,
|
|
220
|
+
default: 24
|
|
221
|
+
},
|
|
222
|
+
borderType: {
|
|
223
|
+
type: String,
|
|
224
|
+
default: "solid",
|
|
225
|
+
validator: function(e) {
|
|
226
|
+
return ["solid", "dotted", "dashed"].includes(e);
|
|
227
|
+
}
|
|
228
|
+
},
|
|
229
|
+
borderWidth: {
|
|
230
|
+
type: Number,
|
|
231
|
+
default: 1
|
|
232
|
+
},
|
|
233
|
+
borderColor: {
|
|
234
|
+
type: String,
|
|
235
|
+
default: "black"
|
|
236
|
+
},
|
|
237
|
+
backgroundColor: {
|
|
238
|
+
type: String,
|
|
239
|
+
default: "grey"
|
|
240
|
+
},
|
|
241
|
+
color: {
|
|
242
|
+
type: String,
|
|
243
|
+
default: "black"
|
|
244
|
+
},
|
|
245
|
+
arrowColor: {
|
|
246
|
+
type: String,
|
|
247
|
+
default: "#CBEE6B"
|
|
248
|
+
},
|
|
249
|
+
items: {
|
|
250
|
+
type: Array,
|
|
251
|
+
default: () => []
|
|
252
|
+
},
|
|
253
|
+
defaultItemByIndex: {
|
|
254
|
+
type: Number,
|
|
255
|
+
default: 0
|
|
256
|
+
},
|
|
257
|
+
defaultItemByProp: {
|
|
258
|
+
type: Object,
|
|
259
|
+
default: null,
|
|
260
|
+
validator: (e) => ["propName", "value"].every((i) => i in e)
|
|
261
|
+
},
|
|
262
|
+
listBackgroundColor: {
|
|
263
|
+
type: String,
|
|
264
|
+
default: "white"
|
|
265
|
+
},
|
|
266
|
+
hoverBackgroundColor: {
|
|
267
|
+
type: String,
|
|
268
|
+
default: "#f1f1f1"
|
|
269
|
+
},
|
|
270
|
+
listMarginTop: {
|
|
271
|
+
type: String,
|
|
272
|
+
default: "0"
|
|
273
|
+
},
|
|
274
|
+
listContainerPadding: {
|
|
275
|
+
type: String,
|
|
276
|
+
default: "0"
|
|
277
|
+
},
|
|
278
|
+
listItemPadding: {
|
|
279
|
+
type: String,
|
|
280
|
+
default: "10px 12px"
|
|
281
|
+
},
|
|
282
|
+
listItemMargin: {
|
|
283
|
+
type: String,
|
|
284
|
+
default: "0"
|
|
285
|
+
},
|
|
286
|
+
listHeight: {
|
|
287
|
+
type: String,
|
|
288
|
+
default: "fit-content"
|
|
289
|
+
},
|
|
290
|
+
listItemSelectedColor: {
|
|
291
|
+
type: String,
|
|
292
|
+
default: "white"
|
|
293
|
+
},
|
|
294
|
+
listItemSelectedBackgroundColor: {
|
|
295
|
+
type: String,
|
|
296
|
+
default: "#399cfd"
|
|
297
|
+
},
|
|
298
|
+
listItemColor: {
|
|
299
|
+
type: String,
|
|
300
|
+
default: "black"
|
|
301
|
+
},
|
|
302
|
+
listBorderRadius: {
|
|
303
|
+
type: String,
|
|
304
|
+
default: "0"
|
|
305
|
+
},
|
|
306
|
+
listBorderColor: {
|
|
307
|
+
type: String,
|
|
308
|
+
default: ""
|
|
309
|
+
},
|
|
310
|
+
listBorderWidth: {
|
|
311
|
+
type: Number,
|
|
312
|
+
default: 1
|
|
313
|
+
},
|
|
314
|
+
listItemBorderRadius: {
|
|
315
|
+
type: String,
|
|
316
|
+
default: "0"
|
|
317
|
+
},
|
|
318
|
+
listAlignment: {
|
|
319
|
+
type: String,
|
|
320
|
+
default: "left"
|
|
321
|
+
},
|
|
322
|
+
isListSameWidth: {
|
|
323
|
+
type: Boolean,
|
|
324
|
+
default: !1
|
|
325
|
+
},
|
|
326
|
+
isMultipleOption: {
|
|
327
|
+
type: Boolean,
|
|
328
|
+
default: !1
|
|
329
|
+
},
|
|
330
|
+
footerBorderColor: {
|
|
331
|
+
type: String,
|
|
332
|
+
default: "#626970"
|
|
333
|
+
},
|
|
334
|
+
footerBorderWidth: {
|
|
335
|
+
type: Number,
|
|
336
|
+
default: 1
|
|
337
|
+
},
|
|
338
|
+
isFooterVisible: {
|
|
339
|
+
type: Boolean,
|
|
340
|
+
default: !1
|
|
341
|
+
},
|
|
342
|
+
isDisabled: {
|
|
343
|
+
type: Boolean,
|
|
344
|
+
default: !1
|
|
345
|
+
},
|
|
346
|
+
onlyFirstTime: {
|
|
347
|
+
type: Boolean,
|
|
348
|
+
default: !1
|
|
349
|
+
}
|
|
350
|
+
},
|
|
351
|
+
emits: ["input", "click-ready", "update:modelValue"],
|
|
352
|
+
setup(e, { emit: i }) {
|
|
353
|
+
const t = e, r = y({}), c = y(null), l = y(t.isMultipleOption ? -1 : 0), d = y(!1);
|
|
354
|
+
I(
|
|
355
|
+
() => t.items,
|
|
356
|
+
(a, f) => {
|
|
357
|
+
if (!t.modelValue && (!t.onlyFirstTime || !f || !f.length) && a && a.length) {
|
|
358
|
+
if (t.defaultItemByProp) {
|
|
359
|
+
const o = t.items.findIndex(
|
|
360
|
+
(m) => m[t.defaultItemByProp.propName] === t.defaultItemByProp.value
|
|
361
|
+
);
|
|
362
|
+
o !== -1 ? (l.value = o, r.value = a[o]) : (l.value = 0, r.value = a[0]);
|
|
363
|
+
} else
|
|
364
|
+
r.value = a[t.defaultItemByIndex];
|
|
365
|
+
i("input", r.value);
|
|
366
|
+
}
|
|
367
|
+
},
|
|
368
|
+
{ immediate: !0 }
|
|
369
|
+
), I(
|
|
370
|
+
() => t.modelValue,
|
|
371
|
+
(a) => {
|
|
372
|
+
if (a) {
|
|
373
|
+
const f = t.items.findIndex((o) => typeof a == "object" ? JSON.stringify(o) === JSON.stringify(a) : o === a);
|
|
374
|
+
f !== -1 && (l.value = f, r.value = t.items[f], i("update:modelValue", r.value));
|
|
375
|
+
}
|
|
376
|
+
},
|
|
377
|
+
{ immediate: !0 }
|
|
378
|
+
);
|
|
379
|
+
const g = F(() => ({
|
|
380
|
+
height: t.height,
|
|
381
|
+
width: t.width,
|
|
382
|
+
backgroundColor: t.backgroundColor,
|
|
383
|
+
borderRadius: `${t.borderRadius}px`,
|
|
384
|
+
border: `${t.borderType} ${t.borderWidth}px ${t.borderColor}`,
|
|
385
|
+
color: t.color,
|
|
386
|
+
"--hover-background-color": t.hoverBackgroundColor,
|
|
387
|
+
"--list-container-padding": t.listContainerPadding,
|
|
388
|
+
"--list-item-padding": t.listItemPadding,
|
|
389
|
+
"--list-item-margin": t.listItemMargin,
|
|
390
|
+
"--list-background-color": t.listBackgroundColor,
|
|
391
|
+
"--list-height": t.listHeight,
|
|
392
|
+
"--list-item-border-radius": t.listItemBorderRadius,
|
|
393
|
+
"--list-item-selected-color": t.listItemSelectedColor,
|
|
394
|
+
"--list-item-selected-background-color": t.listItemSelectedBackgroundColor,
|
|
395
|
+
"--list-item-color": t.listItemColor,
|
|
396
|
+
"--list-border-radius": `${t.listBorderRadius}`,
|
|
397
|
+
"--list-border-color": t.listBorderColor,
|
|
398
|
+
"--list-width": t.isListSameWidth ? t.width : "fit-content",
|
|
399
|
+
"--list-border-width": `${t.listBorderWidth}px`,
|
|
400
|
+
"--list-margin-top": t.listMarginTop,
|
|
401
|
+
"--list-left": t.listAlignment === "left" ? "0" : "auto",
|
|
402
|
+
"--list-right": t.listAlignment === "right" ? "0" : "auto",
|
|
403
|
+
"--footer-border": `${t.footerBorderWidth}px solid ${t.footerBorderColor}`,
|
|
404
|
+
"--dropdown-opacity": t.isDisabled ? "0.5" : "1",
|
|
405
|
+
"--dropdown-cursor": t.isDisabled ? "not-allowed" : "pointer",
|
|
406
|
+
"--dropdown-font-size": t.fontSize ? t.fontSize : "14px"
|
|
407
|
+
})), C = F(() => ({
|
|
408
|
+
height: `${t.arrowHeight}px`,
|
|
409
|
+
width: `${t.arrowWidth}px`
|
|
410
|
+
}));
|
|
411
|
+
function w() {
|
|
412
|
+
t.isDisabled || (d.value = !d.value);
|
|
413
|
+
}
|
|
414
|
+
function S(a) {
|
|
415
|
+
c.value && !c.value.contains(a.target) && (d.value = !1);
|
|
416
|
+
}
|
|
417
|
+
function k(a, f) {
|
|
418
|
+
t.isMultipleOption ? l.value = -1 : (l.value = f, d.value = !1), r.value = a, i("input", r.value), i("update:modelValue", r.value);
|
|
419
|
+
}
|
|
420
|
+
function _() {
|
|
421
|
+
d.value = !1, i("click-ready");
|
|
422
|
+
}
|
|
423
|
+
return L(() => {
|
|
424
|
+
document.addEventListener("click", S);
|
|
425
|
+
}), G(() => {
|
|
426
|
+
document.removeEventListener("click", S);
|
|
427
|
+
}), (a, f) => (s(), u("div", {
|
|
428
|
+
ref_key: "dropDown",
|
|
429
|
+
ref: c,
|
|
430
|
+
class: "gsc-dropdown",
|
|
431
|
+
style: h(g.value)
|
|
432
|
+
}, [
|
|
433
|
+
n("div", {
|
|
434
|
+
class: "gsc-dropdown__main-container",
|
|
435
|
+
style: h({ "padding-right": `${e.arrowWidth + 8}px` }),
|
|
436
|
+
onClick: w
|
|
437
|
+
}, [
|
|
438
|
+
n("div", ft, [
|
|
439
|
+
R(a.$slots, "default", { selectedItem: r.value })
|
|
440
|
+
]),
|
|
441
|
+
n("div", {
|
|
442
|
+
class: T(["gsc-dropdown__main-container__icon", { "rotated-180": d.value }]),
|
|
443
|
+
style: h(C.value)
|
|
444
|
+
}, [
|
|
445
|
+
(s(), u("svg", {
|
|
446
|
+
height: e.arrowHeight,
|
|
447
|
+
width: e.arrowWidth,
|
|
448
|
+
viewBox: "0 0 24 24",
|
|
449
|
+
fill: "none",
|
|
450
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
451
|
+
}, [
|
|
452
|
+
n("path", {
|
|
453
|
+
d: "M18.394 9.13501L13.1302 14.3988C12.5086 15.0204 11.4914 15.0204 10.8697 14.3988L5.60596 9.13501",
|
|
454
|
+
stroke: e.arrowColor
|
|
455
|
+
}, null, 8, gt)
|
|
456
|
+
], 8, mt))
|
|
457
|
+
], 6)
|
|
458
|
+
], 4),
|
|
459
|
+
N(H, null, {
|
|
460
|
+
default: z(() => [
|
|
461
|
+
W(n("div", yt, [
|
|
462
|
+
n("div", null, [
|
|
463
|
+
n("div", {
|
|
464
|
+
class: "gsc-dropdown__items",
|
|
465
|
+
style: h({ "margin-top": `${t.borderWidth}px` })
|
|
466
|
+
}, [
|
|
467
|
+
(s(!0), u(D, null, E(e.items, (o, m) => (s(), u("div", null, [
|
|
468
|
+
W((s(), u("div", {
|
|
469
|
+
class: T(["gsc-dropdown__items__item", { selected: m === l.value }]),
|
|
470
|
+
key: m,
|
|
471
|
+
onClick: (p) => k(o, m)
|
|
472
|
+
}, [
|
|
473
|
+
R(a.$slots, "availableItem", { item: o })
|
|
474
|
+
], 10, ht)), [
|
|
475
|
+
[O, !o.isHidden]
|
|
476
|
+
])
|
|
477
|
+
]))), 256))
|
|
478
|
+
], 4),
|
|
479
|
+
e.isFooterVisible ? (s(), u("div", vt, [
|
|
480
|
+
N(J(pt), {
|
|
481
|
+
"text-value": "Listo",
|
|
482
|
+
"border-color": "#cbee6b",
|
|
483
|
+
"font-size": "12px",
|
|
484
|
+
width: "72px",
|
|
485
|
+
height: "22px",
|
|
486
|
+
"border-radius": "62px",
|
|
487
|
+
"border-width": 0.8,
|
|
488
|
+
onClick: _
|
|
489
|
+
})
|
|
490
|
+
])) : b("", !0)
|
|
491
|
+
])
|
|
492
|
+
], 512), [
|
|
493
|
+
[O, d.value]
|
|
494
|
+
])
|
|
495
|
+
]),
|
|
496
|
+
_: 3
|
|
497
|
+
})
|
|
498
|
+
], 4));
|
|
499
|
+
}
|
|
500
|
+
}, St = (e) => (M("data-v-9b8bdeb8"), e = e(), j(), e), Ct = { class: "header" }, wt = /* @__PURE__ */ St(() => /* @__PURE__ */ n("h2", null, "Próximos rivales", -1)), kt = { class: "" }, _t = {
|
|
501
|
+
key: 0,
|
|
502
|
+
class: "rivals-grid"
|
|
503
|
+
}, xt = {
|
|
504
|
+
key: 1,
|
|
505
|
+
class: "no-rivals"
|
|
506
|
+
}, Bt = {
|
|
50
507
|
__name: "NextRivals",
|
|
51
508
|
props: {
|
|
52
509
|
teamId: {
|
|
@@ -56,71 +513,165 @@ const p = (e, c) => {
|
|
|
56
513
|
token: {
|
|
57
514
|
type: String,
|
|
58
515
|
default: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MCwibmFtZSI6IlVzdWFyaW8gRnJlZSIsInVzZXJuYW1lIjoiZnJlZUBnb2xzdGF0cy5jb20iLCJlbWFpbCI6ImZyZWVAZ29sc3RhdHMuY29tIiwiaWF0IjoxNjA2NzU4Nzk1LCJleHAiOjE2MzgyOTQ3OTV9.kPNmP7yDtk38cAXrUyc7OHRh6J25VFqy-XUNzbK-4YE"
|
|
516
|
+
},
|
|
517
|
+
fontFamily: {
|
|
518
|
+
type: String,
|
|
519
|
+
default: "Poppins-Light"
|
|
520
|
+
},
|
|
521
|
+
logosUrl: {
|
|
522
|
+
type: String,
|
|
523
|
+
default: "https://golstatsimages.blob.core.windows.net/todoelfut/"
|
|
524
|
+
},
|
|
525
|
+
logoFileType: {
|
|
526
|
+
type: String,
|
|
527
|
+
default: "png"
|
|
528
|
+
},
|
|
529
|
+
height: {
|
|
530
|
+
type: String,
|
|
531
|
+
default: "40px"
|
|
532
|
+
},
|
|
533
|
+
width: {
|
|
534
|
+
type: String,
|
|
535
|
+
default: "179px"
|
|
536
|
+
},
|
|
537
|
+
borderRadius: {
|
|
538
|
+
type: Number,
|
|
539
|
+
default: 8
|
|
540
|
+
},
|
|
541
|
+
arrowHeight: {
|
|
542
|
+
type: Number,
|
|
543
|
+
default: 24
|
|
544
|
+
},
|
|
545
|
+
arrowWidth: {
|
|
546
|
+
type: Number,
|
|
547
|
+
default: 24
|
|
548
|
+
},
|
|
549
|
+
borderType: {
|
|
550
|
+
type: String,
|
|
551
|
+
default: "solid",
|
|
552
|
+
validator: function(e) {
|
|
553
|
+
return ["solid", "dotted", "dashed"].includes(e);
|
|
554
|
+
}
|
|
555
|
+
},
|
|
556
|
+
borderWidth: {
|
|
557
|
+
type: Number,
|
|
558
|
+
default: 1
|
|
559
|
+
},
|
|
560
|
+
borderColor: {
|
|
561
|
+
type: String,
|
|
562
|
+
default: "rgba(255, 255, 255, 0.2)"
|
|
563
|
+
},
|
|
564
|
+
backgroundColor: {
|
|
565
|
+
type: String,
|
|
566
|
+
default: "#0d1d29"
|
|
567
|
+
},
|
|
568
|
+
color: {
|
|
569
|
+
type: String,
|
|
570
|
+
default: "white"
|
|
571
|
+
},
|
|
572
|
+
arrowColor: {
|
|
573
|
+
type: String,
|
|
574
|
+
default: "#CBEE6B"
|
|
59
575
|
}
|
|
60
576
|
},
|
|
61
577
|
emits: ["click-rival"],
|
|
62
|
-
setup(e, { emit:
|
|
63
|
-
const
|
|
578
|
+
setup(e, { emit: i }) {
|
|
579
|
+
const t = e, r = y(null), c = y("rivals-grid"), l = y([]), d = y([]), g = y({});
|
|
64
580
|
I(
|
|
65
|
-
() =>
|
|
66
|
-
(
|
|
67
|
-
|
|
581
|
+
() => t.teamId,
|
|
582
|
+
(o) => {
|
|
583
|
+
o && C();
|
|
68
584
|
},
|
|
69
585
|
{
|
|
70
586
|
immediate: !0
|
|
71
587
|
}
|
|
72
588
|
);
|
|
73
|
-
async function
|
|
589
|
+
async function C() {
|
|
74
590
|
try {
|
|
75
|
-
|
|
591
|
+
const m = await (await fetch(
|
|
592
|
+
`https://kefloixzy1.execute-api.us-west-2.amazonaws.com/prod/related-teams/${t.teamId}`,
|
|
593
|
+
{
|
|
594
|
+
method: "GET",
|
|
595
|
+
headers: {
|
|
596
|
+
Authorization: t.token
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
)).json();
|
|
600
|
+
d.value = m;
|
|
601
|
+
const p = m.map((B) => w(B.team_id)), x = await Promise.all(p);
|
|
602
|
+
console.log("responses", x), d.value.forEach((B, U) => {
|
|
603
|
+
B.rivals = x[U];
|
|
604
|
+
}), g.value = d.value[0], console.log("relatedTeams.value", d.value);
|
|
76
605
|
} catch (o) {
|
|
77
606
|
console.error(o);
|
|
78
607
|
}
|
|
79
608
|
}
|
|
80
|
-
async function
|
|
609
|
+
async function w(o) {
|
|
81
610
|
try {
|
|
82
611
|
return (await (await fetch(
|
|
83
|
-
`https://ts7thxzaik.execute-api.us-west-2.amazonaws.com/prod/next-rivals/teams/${
|
|
612
|
+
`https://ts7thxzaik.execute-api.us-west-2.amazonaws.com/prod/next-rivals/teams/${o}`,
|
|
84
613
|
{
|
|
85
614
|
method: "GET",
|
|
86
615
|
headers: {
|
|
87
|
-
Authorization:
|
|
616
|
+
Authorization: t.token
|
|
88
617
|
}
|
|
89
618
|
}
|
|
90
619
|
)).json()).rivals || [];
|
|
91
|
-
} catch (
|
|
92
|
-
console.error(
|
|
620
|
+
} catch (m) {
|
|
621
|
+
console.error(m);
|
|
93
622
|
}
|
|
94
623
|
}
|
|
95
|
-
function
|
|
96
|
-
|
|
624
|
+
function S() {
|
|
625
|
+
r.value && (c.value = "rivals-grid");
|
|
626
|
+
}
|
|
627
|
+
function k(o) {
|
|
628
|
+
i("click-rival", o);
|
|
629
|
+
}
|
|
630
|
+
function _(o) {
|
|
631
|
+
console.log("onInputValue", o), g.value = o, l.value = o.rivals;
|
|
97
632
|
}
|
|
98
|
-
function
|
|
99
|
-
|
|
633
|
+
function a(o) {
|
|
634
|
+
console.log("onUpdateValue", o), g.value = o, l.value = o.rivals;
|
|
100
635
|
}
|
|
101
|
-
const
|
|
102
|
-
return
|
|
103
|
-
|
|
104
|
-
}),
|
|
105
|
-
|
|
106
|
-
}), (
|
|
636
|
+
const f = new ResizeObserver(S);
|
|
637
|
+
return L(() => {
|
|
638
|
+
r.value && f.observe(r.value);
|
|
639
|
+
}), X(() => {
|
|
640
|
+
f.disconnect();
|
|
641
|
+
}), (o, m) => (s(), u("div", {
|
|
107
642
|
class: "next-rivals",
|
|
108
643
|
ref_key: "containerRef",
|
|
109
|
-
ref:
|
|
644
|
+
ref: r
|
|
110
645
|
}, [
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
(
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
646
|
+
n("div", Ct, [
|
|
647
|
+
wt,
|
|
648
|
+
N(J(bt), Y(t, {
|
|
649
|
+
"model-value": g.value,
|
|
650
|
+
items: d.value,
|
|
651
|
+
onInput: _,
|
|
652
|
+
"onUpdate:modelValue": a
|
|
653
|
+
}), {
|
|
654
|
+
default: z(({ selectedItem: p }) => [
|
|
655
|
+
n("div", kt, v(p.team_name), 1)
|
|
656
|
+
]),
|
|
657
|
+
availableItem: z(({ item: p }) => [
|
|
658
|
+
n("div", null, v(p.team_name), 1)
|
|
659
|
+
]),
|
|
660
|
+
_: 1
|
|
661
|
+
}, 16, ["model-value", "items"])
|
|
662
|
+
]),
|
|
663
|
+
g.value.rivals && g.value.rivals.length ? (s(), u("div", _t, [
|
|
664
|
+
(s(!0), u(D, null, E(l.value, (p) => (s(), q(et, {
|
|
665
|
+
key: p.team_id,
|
|
666
|
+
logo: `https://golstatsimages.blob.core.windows.net/teams-80/${p.team_id}.png`,
|
|
667
|
+
name: p.team_name,
|
|
668
|
+
rival: p,
|
|
669
|
+
onClickRival: (x) => k(p)
|
|
119
670
|
}, null, 8, ["logo", "name", "rival", "onClickRival"]))), 128))
|
|
120
|
-
])
|
|
671
|
+
])) : (s(), u("h2", xt, v(g.value.team_name) + " no tiene próximos rivales", 1))
|
|
121
672
|
], 512));
|
|
122
673
|
}
|
|
123
|
-
},
|
|
674
|
+
}, Nt = /* @__PURE__ */ A(Bt, [["__scopeId", "data-v-9b8bdeb8"]]);
|
|
124
675
|
export {
|
|
125
|
-
|
|
676
|
+
Nt as GSCNextRivals
|
|
126
677
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(c,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(c=typeof globalThis<"u"?globalThis:c||self,e(c.GSCNextRivals={},c.Vue))})(this,function(c,e){"use strict";const m=(t,s)=>{const o=t.__vccOpts||t;for(const[n,r]of s)o[n]=r;return o},p=["src","alt"],u={class:"team-card__name"},_=m({__name:"GscTeamCard",props:{logo:{type:String,default:""},name:{type:String,default:""},url:{type:String,default:""},rival:{type:Object,default:()=>({})}},emits:["click-rival"],setup(t,{emit:s}){const o=t;function n(){s("click-rival",o.rival)}return(r,d)=>(e.openBlock(),e.createElementBlock("div",{class:"team-card",onClick:n},[e.createElementVNode("div",{class:"team-card__bg-image",style:e.normalizeStyle({"background-image":`url(${t.logo})`})},null,4),e.createElementVNode("img",{class:"team-card__image",src:t.logo,alt:t.name},null,8,p),e.createElementVNode("p",u,e.toDisplayString(t.name),1)]))}},[["__scopeId","data-v-8f13b2f7"]]),y=(t=>(e.pushScopeId("data-v-5a14c63d"),t=t(),e.popScopeId(),t))(()=>e.createElementVNode("h2",null,"Próximos rivales",-1)),k={class:"rivals-grid"},g=m({__name:"NextRivals",props:{teamId:{type:Number,default:392},token:{type:String,default:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MCwibmFtZSI6IlVzdWFyaW8gRnJlZSIsInVzZXJuYW1lIjoiZnJlZUBnb2xzdGF0cy5jb20iLCJlbWFpbCI6ImZyZWVAZ29sc3RhdHMuY29tIiwiaWF0IjoxNjA2NzU4Nzk1LCJleHAiOjE2MzgyOTQ3OTV9.kPNmP7yDtk38cAXrUyc7OHRh6J25VFqy-XUNzbK-4YE"}},emits:["click-rival"],setup(t,{emit:s}){const o=t,n=e.ref(null),r=e.ref("rivals-grid"),d=e.ref([]);e.watch(()=>o.teamId,a=>{a&&h(a)},{immediate:!0});async function h(a){try{d.value=await I(a)}catch(l){console.error(l)}}async function I(a){try{return(await(await fetch(`https://ts7thxzaik.execute-api.us-west-2.amazonaws.com/prod/next-rivals/teams/${a}`,{method:"GET",headers:{Authorization:o.token}})).json()).rivals||[]}catch(l){console.error(l)}}function b(){n.value&&(r.value="rivals-grid")}function C(a){s("click-rival",a)}const f=new ResizeObserver(b);return e.onMounted(()=>{n.value&&f.observe(n.value)}),e.onUnmounted(()=>{f.disconnect()}),(a,l)=>(e.openBlock(),e.createElementBlock("div",{class:"next-rivals",ref_key:"containerRef",ref:n},[y,e.createElementVNode("div",k,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,i=>(e.openBlock(),e.createBlock(_,{key:i.team_id,logo:`https://golstatsimages.blob.core.windows.net/teams-80/${i.team_id}.png`,name:i.team_name,rival:i,onClickRival:S=>C(i)},null,8,["logo","name","rival","onClickRival"]))),128))])],512))}},[["__scopeId","data-v-5a14c63d"]]);c.GSCNextRivals=g,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(u,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(u=typeof globalThis<"u"?globalThis:u||self,t(u.GSCNextRivals={},u.Vue))})(this,function(u,t){"use strict";const B=(o,r)=>{const e=o.__vccOpts||o;for(const[i,s]of r)e[i]=s;return e},N=["src","alt"],I={class:"team-card__name"},V=B({__name:"GscTeamCard",props:{logo:{type:String,default:""},name:{type:String,default:""},url:{type:String,default:""},rival:{type:Object,default:()=>({})}},emits:["click-rival"],setup(o,{emit:r}){const e=o;function i(){r("click-rival",e.rival)}return(s,n)=>(t.openBlock(),t.createElementBlock("div",{class:"team-card",onClick:i},[t.createElementVNode("div",{class:"team-card__bg-image",style:t.normalizeStyle({"background-image":`url(${o.logo})`})},null,4),t.createElementVNode("img",{class:"team-card__image",src:o.logo,alt:o.name},null,8,N),t.createElementVNode("p",I,t.toDisplayString(o.name),1)]))}},[["__scopeId","data-v-8f13b2f7"]]),E=(o,r)=>{const e=o.__vccOpts||o;for(const[i,s]of r)e[i]=s;return e},y={props:{type:{type:Number,default:0},value:{type:Boolean,default:!1},textValue:String,icon:String,iconPosition:{type:String,default:"left"},iconSize:String,fontColor:{type:String,default:"#FFFFFF"},textDecoration:String,fontSize:{type:String,default:"16px"},fontSizeStat:{type:String,default:"16px"},fontStyle:String,fontFamily:{type:String,default:"Poppins-Regular"},height:{type:String,default:"fit-content"},width:{type:String,default:"fit-content"},borderRadius:{type:String,default:"0px"},borderType:{type:String,default:"solid"},borderWidth:{type:Number,default:0},borderWidthBtn:{type:String,default:"2px"},borderColor:String,backgroundColor:{type:String,default:"none"},activeBackgroundColor:{type:String,default:"#000000"},activeBorderWidth:{type:Number,default:2},activeBorderType:{type:String,default:"solid"},activeBorderColor:{type:String,default:"#cbee6b"},activeColorText:{type:String,default:"#FFFFFF"},cursorType:{type:String,default:"default"},typeOnOff:{type:Boolean,default:!1},textCategory:String,textStat:String,marginLeftStat:{type:String,default:"15%"}},watch:{value:{deep:!0,immediate:!0,handler(o){this.status=o}}},data(){return{status:!1}},computed:{customStyle(){return{height:this.height,width:this.width,backgroundColor:this.backgroundColor,borderRadius:this.borderRadius,border:`${this.borderType} ${this.borderWidth}px ${this.borderColor}`,color:this.fontColor,textDecoration:this.textDecoration,cursor:this.cursorType,fontSize:this.fontSize,fontStyle:this.fontStyle,fontFamily:`${this.fontFamily} !important`}},customActive(){return{backgroundColor:this.activeBackgroundColor,color:this.activeColorText,border:`${this.activeBorderType} ${this.activeBorderWidth}px ${this.activeBorderColor}`}}},methods:{btnClick(o){this.$emit("click",o),this.typeOnOff&&(this.status=!this.status,this.$emit("status",this.status))}}},_=()=>{t.useCssVars(o=>({"9d01acb4":o.height,"14e95081":o.borderWidthBtn,"38fec285":o.borderType,34353510:o.borderColor,"20d20dc6":o.borderRadius,17130967:o.width,"4ccb7d36":o.backgroundColor,"5d1e86a2":o.cursorType,ce65d4a2:o.fontSize,fe4ac47a:o.fontStyle,f98e44dc:o.fontFamily,"93b87770":o.marginLeftStat,c7f7beba:o.fontSizeStat}))},x=y.setup;y.setup=x?(o,r)=>(_(),x(o,r)):_;const z=o=>(t.pushScopeId("data-v-f3ee6b2b"),o=o(),t.popScopeId(),o),T=["src"],$={key:1,class:"text"},v=["src"],F={class:"stats"},R=z(()=>t.createElementVNode("img",{class:"iconstats",src:"https://golstatsimages.blob.core.windows.net/todoelfut/playdes.png"},null,-1)),W={class:"numstats"},O={class:"leyend"};function D(o,r,e,i,s,n){return t.openBlock(),t.createElementBlock("div",null,[e.type==0?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["button",s.status&&e.typeOnOff&&"button-active"]),style:t.normalizeStyle([n.customStyle,s.status&&e.typeOnOff&&n.customActive]),onClick:r[0]||(r[0]=(...d)=>n.btnClick&&n.btnClick(...d))},[e.icon&&e.iconPosition.toLowerCase()==="left"?(t.openBlock(),t.createElementBlock("img",{key:0,class:"icon",style:t.normalizeStyle({width:e.iconSize}),src:e.icon},null,12,T)):t.createCommentVNode("",!0),e.textValue?(t.openBlock(),t.createElementBlock("div",$,t.toDisplayString(e.textValue),1)):t.createCommentVNode("",!0),e.icon&&e.iconPosition.toLowerCase()==="right"?(t.openBlock(),t.createElementBlock("img",{key:2,class:"icon",style:t.normalizeStyle({width:e.iconSize}),src:e.icon},null,12,v)):t.createCommentVNode("",!0)],6)):t.createCommentVNode("",!0),e.type==1?(t.openBlock(),t.createElementBlock("div",{key:1,class:"button-target",onClick:r[1]||(r[1]=(...d)=>n.btnClick&&n.btnClick(...d))},[t.createElementVNode("div",F,[R,t.createElementVNode("div",W,t.toDisplayString(e.textStat),1)]),t.createElementVNode("div",O,t.toDisplayString(e.textCategory),1)])):t.createCommentVNode("",!0)])}const P=E(y,[["render",D],["__scopeId","data-v-f3ee6b2b"]]),L={class:"gsc-dropdown__main-container__item-selected"},M=["height","width"],j=["stroke"],J={class:"gsc-dropdown__items-container"},A=["onClick"],G={key:0,class:"gsc-dropdown__items-footer"},U={__name:"GSC-Dropdown",props:{modelValue:{type:[Object,Number,String],default:()=>null},height:{type:String,default:"fit-content"},width:{type:String,default:"fit-content"},fontSize:{type:String,default:"14px"},borderRadius:{type:Number,default:5},arrowHeight:{type:Number,default:24},arrowWidth:{type:Number,default:24},borderType:{type:String,default:"solid",validator:function(o){return["solid","dotted","dashed"].includes(o)}},borderWidth:{type:Number,default:1},borderColor:{type:String,default:"black"},backgroundColor:{type:String,default:"grey"},color:{type:String,default:"black"},arrowColor:{type:String,default:"#CBEE6B"},items:{type:Array,default:()=>[]},defaultItemByIndex:{type:Number,default:0},defaultItemByProp:{type:Object,default:null,validator:o=>["propName","value"].every(r=>r in o)},listBackgroundColor:{type:String,default:"white"},hoverBackgroundColor:{type:String,default:"#f1f1f1"},listMarginTop:{type:String,default:"0"},listContainerPadding:{type:String,default:"0"},listItemPadding:{type:String,default:"10px 12px"},listItemMargin:{type:String,default:"0"},listHeight:{type:String,default:"fit-content"},listItemSelectedColor:{type:String,default:"white"},listItemSelectedBackgroundColor:{type:String,default:"#399cfd"},listItemColor:{type:String,default:"black"},listBorderRadius:{type:String,default:"0"},listBorderColor:{type:String,default:""},listBorderWidth:{type:Number,default:1},listItemBorderRadius:{type:String,default:"0"},listAlignment:{type:String,default:"left"},isListSameWidth:{type:Boolean,default:!1},isMultipleOption:{type:Boolean,default:!1},footerBorderColor:{type:String,default:"#626970"},footerBorderWidth:{type:Number,default:1},isFooterVisible:{type:Boolean,default:!1},isDisabled:{type:Boolean,default:!1},onlyFirstTime:{type:Boolean,default:!1}},emits:["input","click-ready","update:modelValue"],setup(o,{emit:r}){const e=o,i=t.ref({}),s=t.ref(null),n=t.ref(e.isMultipleOption?-1:0),d=t.ref(!1);t.watch(()=>e.items,(a,p)=>{if(!e.modelValue&&(!e.onlyFirstTime||!p||!p.length)&&a&&a.length){if(e.defaultItemByProp){const l=e.items.findIndex(m=>m[e.defaultItemByProp.propName]===e.defaultItemByProp.value);l!==-1?(n.value=l,i.value=a[l]):(n.value=0,i.value=a[0])}else i.value=a[e.defaultItemByIndex];r("input",i.value)}},{immediate:!0}),t.watch(()=>e.modelValue,a=>{if(a){const p=e.items.findIndex(l=>typeof a=="object"?JSON.stringify(l)===JSON.stringify(a):l===a);p!==-1&&(n.value=p,i.value=e.items[p],r("update:modelValue",i.value))}},{immediate:!0});const f=t.computed(()=>({height:e.height,width:e.width,backgroundColor:e.backgroundColor,borderRadius:`${e.borderRadius}px`,border:`${e.borderType} ${e.borderWidth}px ${e.borderColor}`,color:e.color,"--hover-background-color":e.hoverBackgroundColor,"--list-container-padding":e.listContainerPadding,"--list-item-padding":e.listItemPadding,"--list-item-margin":e.listItemMargin,"--list-background-color":e.listBackgroundColor,"--list-height":e.listHeight,"--list-item-border-radius":e.listItemBorderRadius,"--list-item-selected-color":e.listItemSelectedColor,"--list-item-selected-background-color":e.listItemSelectedBackgroundColor,"--list-item-color":e.listItemColor,"--list-border-radius":`${e.listBorderRadius}`,"--list-border-color":e.listBorderColor,"--list-width":e.isListSameWidth?e.width:"fit-content","--list-border-width":`${e.listBorderWidth}px`,"--list-margin-top":e.listMarginTop,"--list-left":e.listAlignment==="left"?"0":"auto","--list-right":e.listAlignment==="right"?"0":"auto","--footer-border":`${e.footerBorderWidth}px solid ${e.footerBorderColor}`,"--dropdown-opacity":e.isDisabled?"0.5":"1","--dropdown-cursor":e.isDisabled?"not-allowed":"pointer","--dropdown-font-size":e.fontSize?e.fontSize:"14px"})),h=t.computed(()=>({height:`${e.arrowHeight}px`,width:`${e.arrowWidth}px`}));function b(){e.isDisabled||(d.value=!d.value)}function g(a){s.value&&!s.value.contains(a.target)&&(d.value=!1)}function S(a,p){e.isMultipleOption?n.value=-1:(n.value=p,d.value=!1),i.value=a,r("input",i.value),r("update:modelValue",i.value)}function k(){d.value=!1,r("click-ready")}return t.onMounted(()=>{document.addEventListener("click",g)}),t.onBeforeMount(()=>{document.removeEventListener("click",g)}),(a,p)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"dropDown",ref:s,class:"gsc-dropdown",style:t.normalizeStyle(f.value)},[t.createElementVNode("div",{class:"gsc-dropdown__main-container",style:t.normalizeStyle({"padding-right":`${o.arrowWidth+8}px`}),onClick:b},[t.createElementVNode("div",L,[t.renderSlot(a.$slots,"default",{selectedItem:i.value})]),t.createElementVNode("div",{class:t.normalizeClass(["gsc-dropdown__main-container__icon",{"rotated-180":d.value}]),style:t.normalizeStyle(h.value)},[(t.openBlock(),t.createElementBlock("svg",{height:o.arrowHeight,width:o.arrowWidth,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{d:"M18.394 9.13501L13.1302 14.3988C12.5086 15.0204 11.4914 15.0204 10.8697 14.3988L5.60596 9.13501",stroke:o.arrowColor},null,8,j)],8,M))],6)],4),t.createVNode(t.Transition,null,{default:t.withCtx(()=>[t.withDirectives(t.createElementVNode("div",J,[t.createElementVNode("div",null,[t.createElementVNode("div",{class:"gsc-dropdown__items",style:t.normalizeStyle({"margin-top":`${e.borderWidth}px`})},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(o.items,(l,m)=>(t.openBlock(),t.createElementBlock("div",null,[t.withDirectives((t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["gsc-dropdown__items__item",{selected:m===n.value}]),key:m,onClick:c=>S(l,m)},[t.renderSlot(a.$slots,"availableItem",{item:l})],10,A)),[[t.vShow,!l.isHidden]])]))),256))],4),o.isFooterVisible?(t.openBlock(),t.createElementBlock("div",G,[t.createVNode(t.unref(P),{"text-value":"Listo","border-color":"#cbee6b","font-size":"12px",width:"72px",height:"22px","border-radius":"62px","border-width":.8,onClick:k})])):t.createCommentVNode("",!0)])],512),[[t.vShow,d.value]])]),_:3})],4))}},H=o=>(t.pushScopeId("data-v-9b8bdeb8"),o=o(),t.popScopeId(),o),Z={class:"header"},X=H(()=>t.createElementVNode("h2",null,"Próximos rivales",-1)),Y={class:""},q={key:0,class:"rivals-grid"},K={key:1,class:"no-rivals"},Q=B({__name:"NextRivals",props:{teamId:{type:Number,default:392},token:{type:String,default:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MCwibmFtZSI6IlVzdWFyaW8gRnJlZSIsInVzZXJuYW1lIjoiZnJlZUBnb2xzdGF0cy5jb20iLCJlbWFpbCI6ImZyZWVAZ29sc3RhdHMuY29tIiwiaWF0IjoxNjA2NzU4Nzk1LCJleHAiOjE2MzgyOTQ3OTV9.kPNmP7yDtk38cAXrUyc7OHRh6J25VFqy-XUNzbK-4YE"},fontFamily:{type:String,default:"Poppins-Light"},logosUrl:{type:String,default:"https://golstatsimages.blob.core.windows.net/todoelfut/"},logoFileType:{type:String,default:"png"},height:{type:String,default:"40px"},width:{type:String,default:"179px"},borderRadius:{type:Number,default:8},arrowHeight:{type:Number,default:24},arrowWidth:{type:Number,default:24},borderType:{type:String,default:"solid",validator:function(o){return["solid","dotted","dashed"].includes(o)}},borderWidth:{type:Number,default:1},borderColor:{type:String,default:"rgba(255, 255, 255, 0.2)"},backgroundColor:{type:String,default:"#0d1d29"},color:{type:String,default:"white"},arrowColor:{type:String,default:"#CBEE6B"}},emits:["click-rival"],setup(o,{emit:r}){const e=o,i=t.ref(null),s=t.ref("rivals-grid"),n=t.ref([]),d=t.ref([]),f=t.ref({});t.watch(()=>e.teamId,l=>{l&&h()},{immediate:!0});async function h(){try{const m=await(await fetch(`https://kefloixzy1.execute-api.us-west-2.amazonaws.com/prod/related-teams/${e.teamId}`,{method:"GET",headers:{Authorization:e.token}})).json();d.value=m;const c=m.map(w=>b(w.team_id)),C=await Promise.all(c);console.log("responses",C),d.value.forEach((w,tt)=>{w.rivals=C[tt]}),f.value=d.value[0],console.log("relatedTeams.value",d.value)}catch(l){console.error(l)}}async function b(l){try{return(await(await fetch(`https://ts7thxzaik.execute-api.us-west-2.amazonaws.com/prod/next-rivals/teams/${l}`,{method:"GET",headers:{Authorization:e.token}})).json()).rivals||[]}catch(m){console.error(m)}}function g(){i.value&&(s.value="rivals-grid")}function S(l){r("click-rival",l)}function k(l){console.log("onInputValue",l),f.value=l,n.value=l.rivals}function a(l){console.log("onUpdateValue",l),f.value=l,n.value=l.rivals}const p=new ResizeObserver(g);return t.onMounted(()=>{i.value&&p.observe(i.value)}),t.onUnmounted(()=>{p.disconnect()}),(l,m)=>(t.openBlock(),t.createElementBlock("div",{class:"next-rivals",ref_key:"containerRef",ref:i},[t.createElementVNode("div",Z,[X,t.createVNode(t.unref(U),t.mergeProps(e,{"model-value":f.value,items:d.value,onInput:k,"onUpdate:modelValue":a}),{default:t.withCtx(({selectedItem:c})=>[t.createElementVNode("div",Y,t.toDisplayString(c.team_name),1)]),availableItem:t.withCtx(({item:c})=>[t.createElementVNode("div",null,t.toDisplayString(c.team_name),1)]),_:1},16,["model-value","items"])]),f.value.rivals&&f.value.rivals.length?(t.openBlock(),t.createElementBlock("div",q,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.value,c=>(t.openBlock(),t.createBlock(V,{key:c.team_id,logo:`https://golstatsimages.blob.core.windows.net/teams-80/${c.team_id}.png`,name:c.team_name,rival:c,onClickRival:C=>S(c)},null,8,["logo","name","rival","onClickRival"]))),128))])):(t.openBlock(),t.createElementBlock("h2",K,t.toDisplayString(f.value.team_name)+" no tiene próximos rivales",1))],512))}},[["__scopeId","data-v-9b8bdeb8"]]);u.GSCNextRivals=Q,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})});
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.team-card[data-v-8f13b2f7]{width:100%;cursor:pointer;height:8.5rem;background:linear-gradient(180deg,#183143,#18314300);background:#193646;font-family:Poppins-Regular;font-style:normal;border-radius:.25rem;display:flex;align-items:center;flex-flow:column;justify-content:center;position:relative;overflow:hidden}.team-card__bg-image[data-v-8f13b2f7]{display:block;position:absolute;left:-50%;top:0;width:100%;height:100%;opacity:.04;background-repeat:no-repeat;background-position:0 50%;background-size:cover}.team-card__name[data-v-8f13b2f7]{color:#fff;text-align:center;font-size:.75rem;margin:0;font-family:inherit;font-weight:400;line-height:.9375rem}.team-card__image[data-v-8f13b2f7]{width:4.75rem;height:76;margin-bottom:1.125rem}.team-card[data-v-8f13b2f7]:hover{opacity:.6}@font-face{font-family:Poppins-Black;src:url(/fonts/Poppins-Black.otf) format("opentype")}@font-face{font-family:Poppins-BlackItalic;src:url(/fonts/Poppins-BlackItalic.otf) format("opentype")}@font-face{font-family:Poppins-Bold;src:url(/fonts/Poppins-Bold.otf) format("opentype")}@font-face{font-family:Poppins-BoldItalic;src:url(/fonts/Poppins-BoldItalic.otf) format("opentype")}@font-face{font-family:Poppins-ExtraBold;src:url(/fonts/Poppins-ExtraBold.otf) format("opentype")}@font-face{font-family:Poppins-ExtraBoldItalic;src:url(/fonts/Poppins-ExtraBoldItalic.otf) format("opentype")}@font-face{font-family:Poppins-ExtraLight;src:url(/fonts/Poppins-ExtraLight.otf) format("opentype")}@font-face{font-family:Poppins-ExtraLightItalic;src:url(/fonts/Poppins-ExtraLightItalic.otf) format("opentype")}@font-face{font-family:Poppins-Italic;src:url(/fonts/Poppins-Italic.otf) format("opentype")}@font-face{font-family:Poppins-Light;src:url(/fonts/Poppins-Light.otf) format("opentype")}@font-face{font-family:Poppins-LightItalic;src:url(/fonts/Poppins-LightItalic.otf) format("opentype")}@font-face{font-family:Poppins-MediumItalic;src:url(/fonts/Poppins-MediumItalic.otf) format("opentype")}@font-face{font-family:Poppins-Medium;src:url(/fonts/Poppins-Medium.otf) format("opentype")}@font-face{font-family:Poppins-Regular;src:url(/fonts/Poppins-Regular.otf) format("opentype")}@font-face{font-family:Poppins-SemiBold;src:url(/fonts/Poppins-SemiBold.otf) format("opentype")}@font-face{font-family:Poppins-SemiBoldItalic;src:url(/fonts/Poppins-SemiBoldItalic.otf) format("opentype")}@font-face{font-family:Poppins-ThinItalic;src:url(/fonts/Poppins-ThinItalic.otf) format("opentype")}@font-face{font-family:Poppins-Thin;src:url(/fonts/Poppins-Thin.otf) format("opentype")}@font-face{font-family:Montserrat-SemiBold;src:url(/fonts/Montserrat-SemiBold.otf) format("opentype")}@font-face{font-family:Oswald-Bold;src:url(/fonts/Oswald-Bold.ttf) format("truetype")}@font-face{font-family:Oswald-Regular;src:url(/fonts/Oswald-Regular.ttf) format("truetype")}@font-face{font-family:Oswald-SemiBold;src:url(/fonts/Oswald-SemiBold.ttf) format("truetype")}@font-face{font-family:Oswald-Medium;src:url(/fonts/Oswald-Medium.ttf) format("truetype")}@font-face{font-family:BebasNeueBold;src:url(/fonts/BebasNeue-Bold.woff2) format("woff2")}@font-face{font-family:BebasNeueBook;src:url(/fonts/BebasNeue-Book.woff2) format("woff2")}@font-face{font-family:BebasNeueLight;src:url(/fonts/BebasNeue-Light.woff2) format("woff2")}@font-face{font-family:BebasNeueRegular;src:url(/fonts/BebasNeue-Regular.woff2) format("woff2")}@font-face{font-family:BebasNeueThin;src:url(/fonts/BebasNeue-Thin.woff2) format("woff2")}.next-rivals[data-v-
|
|
1
|
+
.team-card[data-v-8f13b2f7]{width:100%;cursor:pointer;height:8.5rem;background:linear-gradient(180deg,#183143,#18314300);background:#193646;font-family:Poppins-Regular;font-style:normal;border-radius:.25rem;display:flex;align-items:center;flex-flow:column;justify-content:center;position:relative;overflow:hidden}.team-card__bg-image[data-v-8f13b2f7]{display:block;position:absolute;left:-50%;top:0;width:100%;height:100%;opacity:.04;background-repeat:no-repeat;background-position:0 50%;background-size:cover}.team-card__name[data-v-8f13b2f7]{color:#fff;text-align:center;font-size:.75rem;margin:0;font-family:inherit;font-weight:400;line-height:.9375rem}.team-card__image[data-v-8f13b2f7]{width:4.75rem;height:76;margin-bottom:1.125rem}.team-card[data-v-8f13b2f7]:hover{opacity:.6}.button[data-v-f3ee6b2b],.button-active[data-v-f3ee6b2b]{display:inline-flex;justify-content:center;align-content:center;align-items:center;overflow:none;cursor:pointer!important}.button-target[data-v-f3ee6b2b]{display:inline-block;overflow:hidden;height:var(--9d01acb4);border-width:var(--14e95081)!important;border-style:var(--38fec285)!important;border-color:var(--34353510)!important;border-radius:var(--20d20dc6)!important;width:var(--17130967);background-color:var(--4ccb7d36);justify-content:center;align-content:center;align-items:center;overflow:none;cursor:pointer!important;cursor:var(--5d1e86a2)!important;font-size:var(--ce65d4a2)!important;font-style:var(--fe4ac47a)!important;font-family:var(--f98e44dc)!important}.stats[data-v-f3ee6b2b]{display:inline-flex;width:100%;padding-top:5px;justify-content:left;align-items:center;align-content:center;height:60%}.iconstats[data-v-f3ee6b2b]{width:14px;height:14px;margin-left:var(--93b87770)}.numstats[data-v-f3ee6b2b]{font-family:Poppins-SemiBold;color:#fff;font-size:var(--c7f7beba);margin-left:7px}.leyend[data-v-f3ee6b2b]{display:inline-flex;justify-content:center;align-items:center;align-content:center;font-family:Poppins-Regular;color:#a0a3a5;width:100%;height:15%}.text[data-v-f3ee6b2b],.icon[data-v-f3ee6b2b]{padding:0 4px}.v-enter-active,.v-leave-active{transition:opacity .5s ease}.v-enter-from,.v-leave-to{opacity:0}.rotated-180{transform:rotate(180deg)}.gsc-dropdown{position:relative;display:inline-block;font-size:var(--dropdown-font-size);cursor:var(--dropdown-cursor);opacity:var(--dropdown-opacity)}.gsc-dropdown__main-container{height:100%;width:100%;display:flex;align-items:center}.gsc-dropdown__main-container__icon{position:absolute;right:6px;transition:transform .3s ease}.gsc-dropdown__main-container__item-selected{width:100%;padding:0 .5em}.gsc-dropdown__items-container{background-color:var(--list-background-color);border-radius:var(--list-border-radius);border:var(--list-border-width) solid var(--list-border-color);margin-top:var(--list-margin-top);display:block;position:absolute;left:var(--list-left);right:var(--list-right);width:var(--list-width);padding:var(--list-container-padding);box-shadow:0 8px 16px #0003;z-index:300}.gsc-dropdown__items-container>div{width:100%;height:fit-content;display:flex;flex-direction:column}.gsc-dropdown__items{max-height:var(--list-height);height:fit-content;width:var(--list-width);overflow:auto}.gsc-dropdown__items__item{white-space:nowrap;color:var(--list-item-color);padding:var(--list-item-padding);margin:var(--list-item-margin);border-radius:var(--list-item-border-radius)!important;text-decoration:none;display:block}.gsc-dropdown__items__item.selected{color:var(--list-item-selected-color);background-color:var(--list-item-selected-background-color)}.gsc-dropdown__items__item:not(.selected):hover{cursor:pointer;background-color:var(--hover-background-color)}.gsc-dropdown__items__item:first-child{border-top-left-radius:var(--list-border-radius);border-top-right-radius:var(--list-border-radius)}.gsc-dropdown__items-footer{height:50px;width:100%;display:flex;justify-content:center;align-items:center;border-top:var(--footer-border)}::-webkit-scrollbar{width:3px}::-webkit-scrollbar-track{border-radius:2.5px}::-webkit-scrollbar-thumb{background:#92929d;width:3px}::-webkit-scrollbar-thumb:hover{background:#92929d}@font-face{font-family:Poppins-Black;src:url(/fonts/Poppins-Black.otf) format("opentype")}@font-face{font-family:Poppins-BlackItalic;src:url(/fonts/Poppins-BlackItalic.otf) format("opentype")}@font-face{font-family:Poppins-Bold;src:url(/fonts/Poppins-Bold.otf) format("opentype")}@font-face{font-family:Poppins-BoldItalic;src:url(/fonts/Poppins-BoldItalic.otf) format("opentype")}@font-face{font-family:Poppins-ExtraBold;src:url(/fonts/Poppins-ExtraBold.otf) format("opentype")}@font-face{font-family:Poppins-ExtraBoldItalic;src:url(/fonts/Poppins-ExtraBoldItalic.otf) format("opentype")}@font-face{font-family:Poppins-ExtraLight;src:url(/fonts/Poppins-ExtraLight.otf) format("opentype")}@font-face{font-family:Poppins-ExtraLightItalic;src:url(/fonts/Poppins-ExtraLightItalic.otf) format("opentype")}@font-face{font-family:Poppins-Italic;src:url(/fonts/Poppins-Italic.otf) format("opentype")}@font-face{font-family:Poppins-Light;src:url(/fonts/Poppins-Light.otf) format("opentype")}@font-face{font-family:Poppins-LightItalic;src:url(/fonts/Poppins-LightItalic.otf) format("opentype")}@font-face{font-family:Poppins-MediumItalic;src:url(/fonts/Poppins-MediumItalic.otf) format("opentype")}@font-face{font-family:Poppins-Medium;src:url(/fonts/Poppins-Medium.otf) format("opentype")}@font-face{font-family:Poppins-Regular;src:url(/fonts/Poppins-Regular.otf) format("opentype")}@font-face{font-family:Poppins-SemiBold;src:url(/fonts/Poppins-SemiBold.otf) format("opentype")}@font-face{font-family:Poppins-SemiBoldItalic;src:url(/fonts/Poppins-SemiBoldItalic.otf) format("opentype")}@font-face{font-family:Poppins-ThinItalic;src:url(/fonts/Poppins-ThinItalic.otf) format("opentype")}@font-face{font-family:Poppins-Thin;src:url(/fonts/Poppins-Thin.otf) format("opentype")}@font-face{font-family:Montserrat-SemiBold;src:url(/fonts/Montserrat-SemiBold.otf) format("opentype")}@font-face{font-family:Oswald-Bold;src:url(/fonts/Oswald-Bold.ttf) format("truetype")}@font-face{font-family:Oswald-Regular;src:url(/fonts/Oswald-Regular.ttf) format("truetype")}@font-face{font-family:Oswald-SemiBold;src:url(/fonts/Oswald-SemiBold.ttf) format("truetype")}@font-face{font-family:Oswald-Medium;src:url(/fonts/Oswald-Medium.ttf) format("truetype")}@font-face{font-family:BebasNeueBold;src:url(/fonts/BebasNeue-Bold.woff2) format("woff2")}@font-face{font-family:BebasNeueBook;src:url(/fonts/BebasNeue-Book.woff2) format("woff2")}@font-face{font-family:BebasNeueLight;src:url(/fonts/BebasNeue-Light.woff2) format("woff2")}@font-face{font-family:BebasNeueRegular;src:url(/fonts/BebasNeue-Regular.woff2) format("woff2")}@font-face{font-family:BebasNeueThin;src:url(/fonts/BebasNeue-Thin.woff2) format("woff2")}.next-rivals[data-v-9b8bdeb8]{border-radius:8px;padding:20px;color:#fff}.header[data-v-9b8bdeb8]{display:flex;justify-content:space-between;align-items:center}h2[data-v-9b8bdeb8]{font-family:Poppins-Medium;font-size:22px;font-weight:500;font-stretch:normal;font-style:normal;line-height:normal;letter-spacing:normal;text-align:left;color:#fff}@media (max-width: 600px){h2[data-v-9b8bdeb8]{font-size:19px}}@media (max-width: 389px){h2[data-v-9b8bdeb8]{width:100%}}.rivals-grid[data-v-9b8bdeb8]{margin-top:20px;display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:20px;justify-content:center}.rival-card[data-v-9b8bdeb8]{background-color:#0003;border-radius:8px;padding:20px;display:flex;flex-direction:column;align-items:center;gap:12px;transition:transform .2s;width:100%;min-width:150px;max-width:200px;margin:0 auto}.rival-card[data-v-9b8bdeb8]:hover{transform:translateY(-2px)}.rival-logo[data-v-9b8bdeb8]{width:80px;height:80px;object-fit:contain}.rival-name[data-v-9b8bdeb8]{font-size:1.1rem;font-weight:500}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@golstats/gsc-next-rivals",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
"format": "prettier --write src/"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
+
"@golstats/gsc-dropdown": "^1.0.15",
|
|
25
26
|
"vue": "3.3.4"
|
|
26
27
|
},
|
|
27
28
|
"devDependencies": {
|