@mjsz-vbr-elements/core 2.1.10 → 2.2.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/SeasonSelector-hqWIAEq6.js +2470 -0
- package/dist/columns.js +1 -1
- package/dist/components.js +22 -2462
- package/dist/composables.js +55 -59
- package/dist/constants.js +1 -1
- package/dist/{convert-18c8bb80.js → convert-PMHuZhPy.js} +113 -132
- package/dist/{datetime-2fb02df2.js → datetime-EyEBo0-h.js} +288 -294
- package/dist/index.iife.js +4 -4
- package/dist/index.iife.js.br +0 -0
- package/dist/index.iife.js.gz +0 -0
- package/dist/index.js +113 -108
- package/dist/useSort-WcJ_BIws.js +742 -0
- package/dist/utils.js +4 -4
- package/package.json +6 -7
- package/dist/useSort-f443338c.js +0 -745
package/dist/composables.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* name: @mjsz-vbr-elements/core
|
|
3
|
-
* version: v2.
|
|
3
|
+
* version: v2.2.0 - 04/01/2024, 13:03:06
|
|
4
4
|
* (c) 2024
|
|
5
5
|
* description: Data visualization for MJSZ VBR
|
|
6
6
|
* author: Ákos Stegner <akos.stegner@gmail.com>
|
|
7
7
|
*/
|
|
8
|
-
import { j as S, k as
|
|
9
|
-
import { c as
|
|
10
|
-
import { unref as
|
|
11
|
-
import { VBR_API_BASE_URL as
|
|
12
|
-
import { E as m, H as x, p as y, G as g,
|
|
13
|
-
var
|
|
8
|
+
import { j as S, k as D, n as p, l as E, m as I, p as P } from "./useSort-WcJ_BIws.js";
|
|
9
|
+
import { c as U, i as tt, u as et, b as nt, a as rt, d as it, e as st, f as at, g as ot, v as ut } from "./useSort-WcJ_BIws.js";
|
|
10
|
+
import { unref as c, ref as b, watch as T, nextTick as B } from "vue";
|
|
11
|
+
import { VBR_API_BASE_URL as C } from "./constants.js";
|
|
12
|
+
import { E as m, H as x, p as y, G as g, v as V, z as M, i as v, f as O } from "./datetime-EyEBo0-h.js";
|
|
13
|
+
var R = /* @__PURE__ */ function() {
|
|
14
14
|
function e(t, n) {
|
|
15
15
|
this.xf = n, this.f = t, this.found = !1;
|
|
16
16
|
}
|
|
@@ -20,22 +20,20 @@ var M = /* @__PURE__ */ function() {
|
|
|
20
20
|
return this.f(n) && (this.found = !0, t = x(this.xf["@@transducer/step"](t, n))), t;
|
|
21
21
|
}, e;
|
|
22
22
|
}();
|
|
23
|
-
function
|
|
23
|
+
function A(e) {
|
|
24
24
|
return function(t) {
|
|
25
|
-
return new
|
|
25
|
+
return new R(e, t);
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
-
var
|
|
29
|
-
/* @__PURE__ */ g(["find"],
|
|
28
|
+
var F = /* @__PURE__ */ y(
|
|
29
|
+
/* @__PURE__ */ g(["find"], A, function(t, n) {
|
|
30
30
|
for (var r = 0, i = n.length; r < i; ) {
|
|
31
31
|
if (t(n[r]))
|
|
32
32
|
return n[r];
|
|
33
33
|
r += 1;
|
|
34
34
|
}
|
|
35
35
|
})
|
|
36
|
-
)
|
|
37
|
-
const F = A;
|
|
38
|
-
var G = /* @__PURE__ */ function() {
|
|
36
|
+
), G = /* @__PURE__ */ function() {
|
|
39
37
|
function e(t, n) {
|
|
40
38
|
this.xf = n, this.f = t, this.idx = -1, this.found = !1;
|
|
41
39
|
}
|
|
@@ -59,20 +57,18 @@ var Y = /* @__PURE__ */ y(
|
|
|
59
57
|
}
|
|
60
58
|
return -1;
|
|
61
59
|
})
|
|
62
|
-
)
|
|
63
|
-
|
|
64
|
-
var K = /* @__PURE__ */ C(function(t, n, r) {
|
|
65
|
-
return t(O(n, r));
|
|
60
|
+
), _ = /* @__PURE__ */ V(function(t, n, r) {
|
|
61
|
+
return t(M(n, r));
|
|
66
62
|
});
|
|
67
|
-
const
|
|
68
|
-
const r = `${
|
|
63
|
+
const j = async (e, t, n) => {
|
|
64
|
+
const r = `${C}${c(e)}?${K(n)}`;
|
|
69
65
|
return new Promise((i, o) => {
|
|
70
66
|
fetch(r, {
|
|
71
67
|
method: "GET",
|
|
72
68
|
cache: "no-cache",
|
|
73
69
|
headers: {
|
|
74
70
|
"Content-Type": "application/json",
|
|
75
|
-
"X-API-KEY":
|
|
71
|
+
"X-API-KEY": L(t)
|
|
76
72
|
}
|
|
77
73
|
}).then((s) => s.json()).then((s) => {
|
|
78
74
|
if (s.error)
|
|
@@ -82,15 +78,15 @@ const v = K, L = async (e, t, n) => {
|
|
|
82
78
|
o(s);
|
|
83
79
|
});
|
|
84
80
|
});
|
|
85
|
-
},
|
|
81
|
+
}, K = (e) => Object.keys(e).map((t) => t + "=" + e[t]).join("&"), L = (e) => {
|
|
86
82
|
var t;
|
|
87
|
-
return e || ((t = window.__MJSZ_VBR_WIDGET__) != null && t.apiKey ? window.__MJSZ_VBR_WIDGET__.apiKey :
|
|
88
|
-
},
|
|
89
|
-
const { initial: t = 1, items: n = [], limit: r, auto: i = !1 } = e, o =
|
|
83
|
+
return e || ((t = window.__MJSZ_VBR_WIDGET__) != null && t.apiKey ? window.__MJSZ_VBR_WIDGET__.apiKey : "");
|
|
84
|
+
}, W = (e = {}) => {
|
|
85
|
+
const { initial: t = 1, items: n = [], limit: r, auto: i = !1 } = e, o = b(c(t)), s = (a) => v(a, "day");
|
|
90
86
|
return S(n, () => {
|
|
91
87
|
if (!i)
|
|
92
88
|
return;
|
|
93
|
-
const a =
|
|
89
|
+
const a = Y(_(s, "gameDate"))(c(n));
|
|
94
90
|
o.value = a === -1 ? 1 : Math.floor(a / r) + 1;
|
|
95
91
|
}), {
|
|
96
92
|
page: o,
|
|
@@ -98,15 +94,15 @@ const v = K, L = async (e, t, n) => {
|
|
|
98
94
|
o.value = a;
|
|
99
95
|
}
|
|
100
96
|
};
|
|
101
|
-
},
|
|
102
|
-
const { path: i, apiKey: o, params: s, resetOnExecute:
|
|
97
|
+
}, Z = ({ options: e = {}, transform: t = (i) => i, onError: n = p, onSuccess: r = p }) => {
|
|
98
|
+
const { path: i, apiKey: o, params: s, resetOnExecute: u = !1, immediate: f = !1 } = e, {
|
|
103
99
|
state: a,
|
|
104
100
|
error: h,
|
|
105
101
|
isLoading: l,
|
|
106
102
|
execute: d
|
|
107
|
-
} =
|
|
103
|
+
} = D(() => j(i, o, c(s)).then((w) => t(w)), [], {
|
|
108
104
|
immediate: f,
|
|
109
|
-
resetOnExecute:
|
|
105
|
+
resetOnExecute: u,
|
|
110
106
|
onError: n,
|
|
111
107
|
onSuccess: r
|
|
112
108
|
});
|
|
@@ -117,52 +113,52 @@ const v = K, L = async (e, t, n) => {
|
|
|
117
113
|
execute: d
|
|
118
114
|
};
|
|
119
115
|
};
|
|
120
|
-
function
|
|
121
|
-
const r =
|
|
116
|
+
function q(e = !1, t = p, n = p) {
|
|
117
|
+
const r = E();
|
|
122
118
|
T(r, (i) => {
|
|
123
|
-
if (
|
|
119
|
+
if (c(e)) {
|
|
124
120
|
if (i === "visible")
|
|
125
121
|
return t();
|
|
126
122
|
n();
|
|
127
123
|
}
|
|
128
124
|
});
|
|
129
125
|
}
|
|
130
|
-
const
|
|
131
|
-
const { items: t = [], element: n, offset: r = 0 } = e, i = (
|
|
126
|
+
const H = (e = {}) => {
|
|
127
|
+
const { items: t = [], element: n, offset: r = 0 } = e, i = (u) => v(u, "day"), o = () => {
|
|
132
128
|
var d;
|
|
133
129
|
s();
|
|
134
|
-
const
|
|
135
|
-
if (!
|
|
130
|
+
const u = F(_(i, "gameDate"))(c(t));
|
|
131
|
+
if (!u)
|
|
136
132
|
return;
|
|
137
|
-
const f =
|
|
133
|
+
const f = O(u.gameDate, "YYYY-MM-DD"), a = P(n).querySelector(`div[data-gamedate="${f}"]`);
|
|
138
134
|
if (!a)
|
|
139
135
|
return;
|
|
140
|
-
const h = getComputedStyle(a).getPropertyValue("--vbr-widget-sticky-top-offset") || 0, l = (((d = a.getBoundingClientRect()) == null ? void 0 : d.top) ?? 0) -
|
|
136
|
+
const h = getComputedStyle(a).getPropertyValue("--vbr-widget-sticky-top-offset") || 0, l = (((d = a.getBoundingClientRect()) == null ? void 0 : d.top) ?? 0) - c(r) - parseFloat(h);
|
|
141
137
|
window.scrollTo(0, l);
|
|
142
|
-
}, { stop: s } =
|
|
138
|
+
}, { stop: s } = I(
|
|
143
139
|
() => ({
|
|
144
|
-
items:
|
|
145
|
-
element:
|
|
140
|
+
items: c(t),
|
|
141
|
+
element: c(n)
|
|
146
142
|
}),
|
|
147
|
-
async ({ items:
|
|
148
|
-
|
|
143
|
+
async ({ items: u, element: f }) => {
|
|
144
|
+
u.length === 0 || !f || (await B(), o());
|
|
149
145
|
}
|
|
150
146
|
);
|
|
151
147
|
};
|
|
152
148
|
export {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
149
|
+
U as createI18n,
|
|
150
|
+
j as fetchVBRData,
|
|
151
|
+
tt as i18n,
|
|
152
|
+
et as useColumns,
|
|
153
|
+
nt as useError,
|
|
154
|
+
rt as useErrorProvider,
|
|
155
|
+
it as useI18n,
|
|
156
|
+
st as useLazyLoadingState,
|
|
157
|
+
at as useMainClass,
|
|
158
|
+
W as usePage,
|
|
159
|
+
H as useScrollToGameDate,
|
|
160
|
+
Z as useServices,
|
|
161
|
+
ot as useSort,
|
|
162
|
+
q as useVisibilityChange,
|
|
163
|
+
ut as validateColumnsName
|
|
168
164
|
};
|
package/dist/constants.js
CHANGED