@mjsz-vbr-elements/core 2.1.6 → 2.1.8

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