@mjsz-vbr-elements/core 2.41.0 → 2.43.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/dist/columns.js +1417 -1010
- package/dist/components-DpAc0iFd.js +2969 -0
- package/dist/components.js +6 -21
- package/dist/composables-DkeAlPNN.js +988 -0
- package/dist/composables.js +4 -183
- package/dist/constants.js +11 -19
- package/dist/datetime-Dr5rQMCL.js +1416 -0
- package/dist/index.iife.js +3 -16
- package/dist/index.iife.js.br +0 -0
- package/dist/index.iife.js.gz +0 -0
- package/dist/index.js +27 -196
- package/dist/props.js +63 -66
- package/dist/utils-BzouF97X.js +725 -0
- package/dist/utils.js +4 -166
- package/package.json +10 -10
- package/dist/TimezoneSelector-Cftyj2uC.js +0 -2488
- package/dist/datetime-B_IKGlWy.js +0 -1400
- package/dist/errors-AyJoolyE.js +0 -723
- package/dist/useSort-CoM4Br_9.js +0 -912
package/dist/composables.js
CHANGED
|
@@ -1,189 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* name: @mjsz-vbr-elements/core
|
|
3
|
-
* version: v2.
|
|
3
|
+
* version: v2.43.0 - 14/03/2026, 12:04:11
|
|
4
4
|
* (c) 2026
|
|
5
5
|
* description: Data visualization for MJSZ VBR
|
|
6
6
|
* author: Ákos Stegner <akos.stegner@gmail.com>
|
|
7
7
|
*/
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
import { VBR_API_BASE_URL as O } from "./constants.js";
|
|
12
|
-
import { V as h, Z as x, G as y, Y as v, _ as R, z as $, u as A, i as g, f as C } from "./datetime-B_IKGlWy.js";
|
|
13
|
-
var G = /* @__PURE__ */ function() {
|
|
14
|
-
function e(t, n) {
|
|
15
|
-
this.xf = n, this.f = t, this.found = !1;
|
|
16
|
-
}
|
|
17
|
-
return e.prototype["@@transducer/init"] = h.init, e.prototype["@@transducer/result"] = function(t) {
|
|
18
|
-
return this.found || (t = this.xf["@@transducer/step"](t, void 0)), this.xf["@@transducer/result"](t);
|
|
19
|
-
}, e.prototype["@@transducer/step"] = function(t, n) {
|
|
20
|
-
return this.f(n) && (this.found = !0, t = x(this.xf["@@transducer/step"](t, n))), t;
|
|
21
|
-
}, e;
|
|
22
|
-
}();
|
|
23
|
-
function M(e) {
|
|
24
|
-
return function(t) {
|
|
25
|
-
return new G(e, t);
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
var Y = /* @__PURE__ */ y(/* @__PURE__ */ v(["find"], M, function(t, n) {
|
|
29
|
-
for (var r = 0, i = n.length; r < i; ) {
|
|
30
|
-
if (t(n[r]))
|
|
31
|
-
return n[r];
|
|
32
|
-
r += 1;
|
|
33
|
-
}
|
|
34
|
-
})), k = /* @__PURE__ */ function() {
|
|
35
|
-
function e(t, n) {
|
|
36
|
-
this.xf = n, this.f = t, this.idx = -1, this.found = !1;
|
|
37
|
-
}
|
|
38
|
-
return e.prototype["@@transducer/init"] = h.init, e.prototype["@@transducer/result"] = function(t) {
|
|
39
|
-
return this.found || (t = this.xf["@@transducer/step"](t, -1)), this.xf["@@transducer/result"](t);
|
|
40
|
-
}, e.prototype["@@transducer/step"] = function(t, n) {
|
|
41
|
-
return this.idx += 1, this.f(n) && (this.found = !0, t = x(this.xf["@@transducer/step"](t, this.idx))), t;
|
|
42
|
-
}, e;
|
|
43
|
-
}();
|
|
44
|
-
function F(e) {
|
|
45
|
-
return function(t) {
|
|
46
|
-
return new k(e, t);
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
var X = /* @__PURE__ */ y(/* @__PURE__ */ v([], F, function(t, n) {
|
|
50
|
-
for (var r = 0, i = n.length; r < i; ) {
|
|
51
|
-
if (t(n[r]))
|
|
52
|
-
return r;
|
|
53
|
-
r += 1;
|
|
54
|
-
}
|
|
55
|
-
return -1;
|
|
56
|
-
})), _ = /* @__PURE__ */ R(function(t, n, r) {
|
|
57
|
-
return t($(n, r));
|
|
58
|
-
});
|
|
59
|
-
async function K(e, t, n) {
|
|
60
|
-
const r = `${O}/vbr${c(e)}${A(n) ? "" : `?${L(n)}`}`;
|
|
61
|
-
return new Promise((i, s) => {
|
|
62
|
-
fetch(r, {
|
|
63
|
-
method: "GET",
|
|
64
|
-
cache: "no-cache",
|
|
65
|
-
headers: {
|
|
66
|
-
"Content-Type": "application/json",
|
|
67
|
-
"X-API-KEY": J(t)
|
|
68
|
-
}
|
|
69
|
-
}).then((a) => a.json()).then((a) => {
|
|
70
|
-
if (a.error)
|
|
71
|
-
return s(a);
|
|
72
|
-
if (a.data.message)
|
|
73
|
-
return s(a.data);
|
|
74
|
-
i(a.data);
|
|
75
|
-
}).catch((a) => {
|
|
76
|
-
s(a);
|
|
77
|
-
});
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
function L(e) {
|
|
81
|
-
return Object.keys(e).map((t) => `${t}=${e[t]}`).join("&");
|
|
82
|
-
}
|
|
83
|
-
function J(e) {
|
|
84
|
-
return e || (window.__MJSZ_VBR_WIDGET__?.apiKey ? window.__MJSZ_VBR_WIDGET__.apiKey : "");
|
|
85
|
-
}
|
|
86
|
-
function q(e, t) {
|
|
87
|
-
const { open: n, close: r } = D(c(e), {
|
|
88
|
-
autoReconnect: {
|
|
89
|
-
retries: 3
|
|
90
|
-
},
|
|
91
|
-
immediate: !1,
|
|
92
|
-
onMessage: (i, s) => {
|
|
93
|
-
const a = s.data, o = JSON.parse(a);
|
|
94
|
-
o.event !== "welcome" && (t.value = o.message);
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
return m(() => c(t).gameStatus, (i) => {
|
|
98
|
-
if (i === 1)
|
|
99
|
-
return n();
|
|
100
|
-
r();
|
|
101
|
-
}, {
|
|
102
|
-
immediate: !0
|
|
103
|
-
}), {
|
|
104
|
-
gameData: t
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
function z(e = {}) {
|
|
108
|
-
const { initial: t = 1, items: n = [], limit: r, auto: i = !1 } = e, s = B(c(t)), a = (u) => g(u, "day");
|
|
109
|
-
return b(n, () => {
|
|
110
|
-
if (!i)
|
|
111
|
-
return;
|
|
112
|
-
const u = X(_(a, "gameDate"))(c(n));
|
|
113
|
-
s.value = u === -1 ? 1 : Math.floor(u / r) + 1;
|
|
114
|
-
}), {
|
|
115
|
-
page: s,
|
|
116
|
-
change: (u) => {
|
|
117
|
-
s.value = u;
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
function Q(e = {}) {
|
|
122
|
-
const { items: t = [], element: n, offset: r = 0, enabled: i = !0 } = e, s = (o) => g(o, "day"), a = () => {
|
|
123
|
-
if (!c(i))
|
|
124
|
-
return;
|
|
125
|
-
const o = Y(_(s, "gameDate"))(c(t));
|
|
126
|
-
if (!o)
|
|
127
|
-
return;
|
|
128
|
-
const f = C(o.gameDate, "YYYY-MM-DD"), u = I(n).querySelector(`div[data-gamedate="${f}"]`);
|
|
129
|
-
if (!u)
|
|
130
|
-
return;
|
|
131
|
-
const l = getComputedStyle(u).getPropertyValue("--mvw-sticky-top-offset") || 0, p = (u.getBoundingClientRect()?.top ?? 0) - c(r) - Number.parseFloat(l);
|
|
132
|
-
window.scrollTo(0, p);
|
|
133
|
-
};
|
|
134
|
-
E(
|
|
135
|
-
() => ({
|
|
136
|
-
items: c(t),
|
|
137
|
-
element: c(n)
|
|
138
|
-
}),
|
|
139
|
-
async ({ items: o, element: f }) => {
|
|
140
|
-
o.length === 0 || !f || (await V(), a());
|
|
141
|
-
}
|
|
142
|
-
);
|
|
143
|
-
}
|
|
144
|
-
function U({ options: e = {}, transform: t = (i) => i, onError: n = d, onSuccess: r = d }) {
|
|
145
|
-
const { path: i, apiKey: s, params: a, resetOnExecute: o = !1, immediate: f = !1 } = e, { state: u, error: l, isLoading: p, execute: S } = P(
|
|
146
|
-
() => K(i, s, c(a)).then((w) => t(w)),
|
|
147
|
-
[],
|
|
148
|
-
{
|
|
149
|
-
immediate: f,
|
|
150
|
-
resetOnExecute: o,
|
|
151
|
-
onError: n,
|
|
152
|
-
onSuccess: r
|
|
153
|
-
}
|
|
154
|
-
);
|
|
155
|
-
return {
|
|
156
|
-
state: u,
|
|
157
|
-
error: l,
|
|
158
|
-
isLoading: p,
|
|
159
|
-
execute: S
|
|
160
|
-
};
|
|
161
|
-
}
|
|
162
|
-
function H(e = !1, t = d, n = d) {
|
|
163
|
-
const r = T();
|
|
164
|
-
m(r, (i) => {
|
|
165
|
-
if (c(e)) {
|
|
166
|
-
if (i === "visible")
|
|
167
|
-
return t();
|
|
168
|
-
n();
|
|
169
|
-
}
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
export {
|
|
173
|
-
nt as createI18n,
|
|
174
|
-
K as fetchVBRData,
|
|
175
|
-
rt as i18n,
|
|
176
|
-
it as useAdditionalText,
|
|
177
|
-
at as useColumns,
|
|
178
|
-
st as useError,
|
|
179
|
-
ot as useErrorProvider,
|
|
180
|
-
q as useGameDataSocket,
|
|
181
|
-
ut as useI18n,
|
|
182
|
-
ct as useLazyLoadingState,
|
|
183
|
-
z as usePage,
|
|
184
|
-
Q as useScrollToGameDate,
|
|
185
|
-
U as useServices,
|
|
186
|
-
ft as useSort,
|
|
187
|
-
H as useVisibilityChange,
|
|
188
|
-
dt as validateColumnsName
|
|
189
|
-
};
|
|
8
|
+
import "./datetime-Dr5rQMCL.js";
|
|
9
|
+
import { _ as e, b as t, c as n, g as r, h as i, i as a, m as o, n as s, o as c, p as l, r as u, s as d, t as f, v as p, x as m, y as h } from "./composables-DkeAlPNN.js";
|
|
10
|
+
export { p as createI18n, l as fetchVBRData, h as i18n, m as useAdditionalText, r as useColumns, o as useError, i as useErrorProvider, n as useGameDataSocket, t as useI18n, d as useLazyLoadingState, c as usePage, a as useScrollToGameDate, u as useServices, s as useSort, f as useVisibilityChange, e as validateColumnsName };
|
package/dist/constants.js
CHANGED
|
@@ -1,25 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* name: @mjsz-vbr-elements/core
|
|
3
|
-
* version: v2.
|
|
3
|
+
* version: v2.43.0 - 14/03/2026, 12:04:11
|
|
4
4
|
* (c) 2026
|
|
5
5
|
* description: Data visualization for MJSZ VBR
|
|
6
6
|
* author: Ákos Stegner <akos.stegner@gmail.com>
|
|
7
7
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
h as LOCALE_FOR_LANG,
|
|
19
|
-
T as REFRESH_DELAY,
|
|
20
|
-
c as SORT_STATE_ASCEND,
|
|
21
|
-
p as SORT_STATE_DESCEND,
|
|
22
|
-
A as SORT_STATE_ORIGINAL,
|
|
23
|
-
e as VBR_API_BASE_URL,
|
|
24
|
-
t as VBR_API_WEBSOCKET_BASE_URL
|
|
25
|
-
};
|
|
8
|
+
//#region src/constants.js
|
|
9
|
+
var e = "https://api.icehockey.hu", t = "wss://api.icehockey.hu/socket/vbr", n = "https://www.jegkorongszovetseg.hu/event/game/{gameId}", r = "https://jegkorongszovetseg.hu/assets/images/player_blank.png", i = "https://www.ersteliga.hu/stats/player/?playerId={player.playerId}&championshipId={championshipId}", a = "https://www.ersteliga.hu/stats/team/?teamId={team.id}&championshipId={championshipId}", o = "https://www.ersteliga.hu/stats?report={id}", s = "https://api.icehockey.hu/static/api/flag", c = "original", l = "descend", u = "ascend", d = (/* @__PURE__ */ new Map()).set("hu", "hu-hu").set("en", "hu-gb"), f = (/* @__PURE__ */ new Map()).set("Europe/Budapest", {
|
|
10
|
+
countryLabelKey: "hungary",
|
|
11
|
+
timezone: "Europe/Budapest"
|
|
12
|
+
}).set("Europe/Bucharest", {
|
|
13
|
+
countryLabelKey: "romania",
|
|
14
|
+
timezone: "Europe/Bucharest"
|
|
15
|
+
}), p = 1e3 * 60 * 5, m = 1e3;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { f as AVAILABLE_TIMEZONES_BY_COUNTRY, n as DEFAULT_EXTERNAL_GAME_URL, i as DEFAULT_EXTERNAL_PLAYER_URL, o as DEFAULT_EXTERNAL_STATISTIC_URL, a as DEFAULT_EXTERNAL_TEAM_URL, r as DEFAULT_PORTRAIT_IMAGE_URL, s as FLAG_BASE_URL, m as LAZY_LOADING_STATE_DELAY, d as LOCALE_FOR_LANG, p as REFRESH_DELAY, u as SORT_STATE_ASCEND, l as SORT_STATE_DESCEND, c as SORT_STATE_ORIGINAL, e as VBR_API_BASE_URL, t as VBR_API_WEBSOCKET_BASE_URL };
|