@mjsz-vbr-elements/core 2.1.7 → 2.1.9
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 +2 -2
- package/dist/components.js +3 -3
- package/dist/composables.js +122 -77
- package/dist/constants.js +2 -2
- package/dist/convert-18c8bb80.js +2 -2
- package/dist/datetime-2fb02df2.js +2 -2
- package/dist/index.iife.js +5 -5
- package/dist/index.iife.js.br +0 -0
- package/dist/index.iife.js.gz +0 -0
- package/dist/index.js +78 -76
- package/dist/useSort-f443338c.js +745 -0
- package/dist/utils.js +40 -37
- package/package.json +2 -2
- package/dist/useSort-cf4549f9.js +0 -667
package/dist/columns.js
CHANGED
package/dist/components.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* name: @mjsz-vbr-elements/core
|
|
3
|
-
* version: v2.1.
|
|
4
|
-
* (c)
|
|
3
|
+
* version: v2.1.9 - 01/01/2024, 23:01:44
|
|
4
|
+
* (c) 2024
|
|
5
5
|
* description: Data visualization for MJSZ VBR
|
|
6
6
|
* author: Ákos Stegner <akos.stegner@gmail.com>
|
|
7
7
|
*/
|
|
8
8
|
import { computed as A, withDirectives as fe, openBlock as y, createElementBlock as b, normalizeClass as $, unref as h, renderSlot as I, vModelSelect as ge, createElementVNode as v, ref as E, watch as Lt, isRef as ye, Fragment as O, normalizeStyle as It, createVNode as C, Transition as ve, withCtx as k, createTextVNode as K, toDisplayString as x, createCommentVNode as S, toRefs as _t, renderList as tt, createBlock as L, withKeys as Vt, withModifiers as at, defineComponent as be, createSlots as we } from "vue";
|
|
9
|
-
import { f as q, o as xe, e as Te, d as lt, a as ke, c as Pe, h as Se, n as $e, i as ze, b as Jt, u as qt, w as _e } from "./useSort-
|
|
9
|
+
import { f as q, o as xe, e as Te, d as lt, a as ke, c as Pe, h as Se, n as $e, i as ze, b as Jt, u as qt, w as _e } from "./useSort-f443338c.js";
|
|
10
10
|
import { LAZY_LOADING_STATE_DELAY as Ae, SORT_STATE_ORIGINAL as Pt, SORT_STATE_DESCEND as Nt, SORT_STATE_ASCEND as Rt, AVAILABLE_TIMEZONES_BY_COUNTRY as Ge, DEFAULT_PORTRAIT_IMAGE_URL as Ce } from "./constants.js";
|
|
11
11
|
import { i as Ee, W as Yt, U as yt } from "./convert-18c8bb80.js";
|
|
12
12
|
import { z as Zt, C as ft, l as Dt, p as Le, o as gt, g as Ie } from "./datetime-2fb02df2.js";
|
package/dist/composables.js
CHANGED
|
@@ -1,120 +1,165 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* name: @mjsz-vbr-elements/core
|
|
3
|
-
* version: v2.1.
|
|
4
|
-
* (c)
|
|
3
|
+
* version: v2.1.9 - 01/01/2024, 23:01:44
|
|
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
|
|
9
|
-
import { c as
|
|
10
|
-
import { unref as
|
|
11
|
-
import { VBR_API_BASE_URL as
|
|
12
|
-
import { E as
|
|
13
|
-
var
|
|
14
|
-
function t
|
|
15
|
-
this.xf = n, this.f =
|
|
8
|
+
import { j as S, k as D, n as p, l as E, m as b, p as I } from "./useSort-f443338c.js";
|
|
9
|
+
import { c as nt, i as rt, u as it, b as st, a as at, d as ot, e as ut, f as ct, g as ft, v as dt } from "./useSort-f443338c.js";
|
|
10
|
+
import { unref as c, ref as P, watch as T, nextTick as B } from "vue";
|
|
11
|
+
import { VBR_API_BASE_URL as V } from "./constants.js";
|
|
12
|
+
import { E as h, H as l, p as m, G as x, z as $, w as C, i as y, f as M } from "./datetime-2fb02df2.js";
|
|
13
|
+
var R = /* @__PURE__ */ function() {
|
|
14
|
+
function e(t, n) {
|
|
15
|
+
this.xf = n, this.f = t, this.found = !1;
|
|
16
16
|
}
|
|
17
|
-
return
|
|
18
|
-
return this.found || (
|
|
19
|
-
},
|
|
20
|
-
return this.
|
|
21
|
-
},
|
|
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 = l(this.xf["@@transducer/step"](t, n))), t;
|
|
21
|
+
}, e;
|
|
22
22
|
}();
|
|
23
|
-
function A(
|
|
24
|
-
return function(
|
|
25
|
-
return new
|
|
23
|
+
function A(e) {
|
|
24
|
+
return function(t) {
|
|
25
|
+
return new R(e, t);
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
-
var
|
|
29
|
-
/* @__PURE__ */
|
|
28
|
+
var G = /* @__PURE__ */ m(
|
|
29
|
+
/* @__PURE__ */ x(["find"], A, function(t, n) {
|
|
30
30
|
for (var r = 0, i = n.length; r < i; ) {
|
|
31
|
-
if (
|
|
31
|
+
if (t(n[r]))
|
|
32
|
+
return n[r];
|
|
33
|
+
r += 1;
|
|
34
|
+
}
|
|
35
|
+
})
|
|
36
|
+
);
|
|
37
|
+
const O = G;
|
|
38
|
+
var X = /* @__PURE__ */ function() {
|
|
39
|
+
function e(t, n) {
|
|
40
|
+
this.xf = n, this.f = t, this.idx = -1, this.found = !1;
|
|
41
|
+
}
|
|
42
|
+
return e.prototype["@@transducer/init"] = h.init, e.prototype["@@transducer/result"] = function(t) {
|
|
43
|
+
return this.found || (t = this.xf["@@transducer/step"](t, -1)), this.xf["@@transducer/result"](t);
|
|
44
|
+
}, e.prototype["@@transducer/step"] = function(t, n) {
|
|
45
|
+
return this.idx += 1, this.f(n) && (this.found = !0, t = l(this.xf["@@transducer/step"](t, this.idx))), t;
|
|
46
|
+
}, e;
|
|
47
|
+
}();
|
|
48
|
+
function Y(e) {
|
|
49
|
+
return function(t) {
|
|
50
|
+
return new X(e, t);
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
var j = /* @__PURE__ */ m(
|
|
54
|
+
/* @__PURE__ */ x([], Y, function(t, n) {
|
|
55
|
+
for (var r = 0, i = n.length; r < i; ) {
|
|
56
|
+
if (t(n[r]))
|
|
32
57
|
return r;
|
|
33
58
|
r += 1;
|
|
34
59
|
}
|
|
35
60
|
return -1;
|
|
36
61
|
})
|
|
37
62
|
);
|
|
38
|
-
const
|
|
39
|
-
var
|
|
40
|
-
return
|
|
63
|
+
const F = j;
|
|
64
|
+
var K = /* @__PURE__ */ $(function(t, n, r) {
|
|
65
|
+
return t(C(n, r));
|
|
41
66
|
});
|
|
42
|
-
const
|
|
43
|
-
const r = `${
|
|
44
|
-
return new Promise((i,
|
|
67
|
+
const _ = K, L = async (e, t, n) => {
|
|
68
|
+
const r = `${V}${c(e)}?${N(n)}`;
|
|
69
|
+
return new Promise((i, o) => {
|
|
45
70
|
fetch(r, {
|
|
46
71
|
method: "GET",
|
|
47
72
|
cache: "no-cache",
|
|
48
73
|
headers: {
|
|
49
74
|
"Content-Type": "application/json",
|
|
50
|
-
"X-API-KEY":
|
|
75
|
+
"X-API-KEY": k(t)
|
|
51
76
|
}
|
|
52
|
-
}).then((
|
|
53
|
-
if (
|
|
54
|
-
return s
|
|
55
|
-
i(
|
|
56
|
-
}).catch((
|
|
57
|
-
s
|
|
77
|
+
}).then((s) => s.json()).then((s) => {
|
|
78
|
+
if (s.error)
|
|
79
|
+
return o(s);
|
|
80
|
+
i(s.data);
|
|
81
|
+
}).catch((s) => {
|
|
82
|
+
o(s);
|
|
58
83
|
});
|
|
59
84
|
});
|
|
60
|
-
},
|
|
61
|
-
var
|
|
62
|
-
return
|
|
63
|
-
},
|
|
64
|
-
const { initial:
|
|
65
|
-
return
|
|
85
|
+
}, N = (e) => Object.keys(e).map((t) => t + "=" + e[t]).join("&"), k = (e) => {
|
|
86
|
+
var t;
|
|
87
|
+
return e || ((t = window.__MJSZ_VBR_WIDGET__) != null && t.apiKey ? window.__MJSZ_VBR_WIDGET__.apiKey : {}.NODE_ENV !== "production" ? "dd8adf5fdb738b3741fa579b5ede5ce69b681f62" : "");
|
|
88
|
+
}, q = (e = {}) => {
|
|
89
|
+
const { initial: t = 1, items: n = [], limit: r, auto: i = !1 } = e, o = P(c(t)), s = (a) => y(a, "day");
|
|
90
|
+
return S(n, () => {
|
|
66
91
|
if (!i)
|
|
67
92
|
return;
|
|
68
|
-
const
|
|
69
|
-
|
|
93
|
+
const a = F(_(s, "gameDate"))(c(n));
|
|
94
|
+
o.value = a === -1 ? 1 : Math.floor(a / r) + 1;
|
|
70
95
|
}), {
|
|
71
|
-
page:
|
|
72
|
-
change: (
|
|
73
|
-
|
|
96
|
+
page: o,
|
|
97
|
+
change: (a) => {
|
|
98
|
+
o.value = a;
|
|
74
99
|
}
|
|
75
100
|
};
|
|
76
|
-
},
|
|
77
|
-
const { path: i, apiKey:
|
|
78
|
-
state:
|
|
79
|
-
error:
|
|
80
|
-
isLoading:
|
|
81
|
-
execute:
|
|
82
|
-
} =
|
|
83
|
-
immediate:
|
|
84
|
-
resetOnExecute:
|
|
101
|
+
}, H = ({ options: e = {}, transform: t = (i) => i, onError: n = p, onSuccess: r = p }) => {
|
|
102
|
+
const { path: i, apiKey: o, params: s, resetOnExecute: u = !1, immediate: f = !1 } = e, {
|
|
103
|
+
state: a,
|
|
104
|
+
error: d,
|
|
105
|
+
isLoading: g,
|
|
106
|
+
execute: v
|
|
107
|
+
} = D(() => L(i, o, c(s)).then((w) => t(w)), [], {
|
|
108
|
+
immediate: f,
|
|
109
|
+
resetOnExecute: u,
|
|
85
110
|
onError: n,
|
|
86
111
|
onSuccess: r
|
|
87
112
|
});
|
|
88
113
|
return {
|
|
89
|
-
state:
|
|
90
|
-
error:
|
|
91
|
-
isLoading:
|
|
92
|
-
execute:
|
|
114
|
+
state: a,
|
|
115
|
+
error: d,
|
|
116
|
+
isLoading: g,
|
|
117
|
+
execute: v
|
|
93
118
|
};
|
|
94
119
|
};
|
|
95
|
-
function
|
|
96
|
-
const r =
|
|
97
|
-
|
|
98
|
-
if (
|
|
120
|
+
function Q(e = !1, t = p, n = p) {
|
|
121
|
+
const r = E();
|
|
122
|
+
T(r, (i) => {
|
|
123
|
+
if (c(e)) {
|
|
99
124
|
if (i === "visible")
|
|
100
|
-
return
|
|
125
|
+
return t();
|
|
101
126
|
n();
|
|
102
127
|
}
|
|
103
128
|
});
|
|
104
129
|
}
|
|
130
|
+
const U = (e = {}) => {
|
|
131
|
+
const { items: t = [], element: n, offset: r = 0 } = e, i = (u) => y(u, "day"), o = () => {
|
|
132
|
+
var d;
|
|
133
|
+
s();
|
|
134
|
+
const u = O(_(i, "gameDate"))(c(t));
|
|
135
|
+
if (!u)
|
|
136
|
+
return;
|
|
137
|
+
const f = M(u.gameDate, "YYYY-MM-DD"), a = I(n).querySelector(`div[data-gamedate="${f}"]`);
|
|
138
|
+
a && window.scrollTo(0, (((d = a.getBoundingClientRect()) == null ? void 0 : d.top) ?? 0) - c(r));
|
|
139
|
+
}, { stop: s } = b(
|
|
140
|
+
() => ({
|
|
141
|
+
items: c(t),
|
|
142
|
+
element: c(n)
|
|
143
|
+
}),
|
|
144
|
+
async ({ items: u, element: f }) => {
|
|
145
|
+
u.length === 0 || !f || (await B(), o());
|
|
146
|
+
}
|
|
147
|
+
);
|
|
148
|
+
};
|
|
105
149
|
export {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
150
|
+
nt as createI18n,
|
|
151
|
+
L as fetchVBRData,
|
|
152
|
+
rt as i18n,
|
|
153
|
+
it as useColumns,
|
|
154
|
+
st as useError,
|
|
155
|
+
at as useErrorProvider,
|
|
156
|
+
ot as useI18n,
|
|
157
|
+
ut as useLazyLoadingState,
|
|
158
|
+
ct as useMainClass,
|
|
159
|
+
q as usePage,
|
|
160
|
+
U as useScrollToGameDate,
|
|
161
|
+
H as useServices,
|
|
162
|
+
ft as useSort,
|
|
163
|
+
Q as useVisibilityChange,
|
|
164
|
+
dt as validateColumnsName
|
|
120
165
|
};
|
package/dist/constants.js
CHANGED
package/dist/convert-18c8bb80.js
CHANGED