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