@mjsz-vbr-elements/core 2.2.0-beta.0 → 2.2.1

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