@mjsz-vbr-elements/core 2.8.0 → 2.9.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.
@@ -1,12 +1,12 @@
1
1
  /**
2
2
  * name: @mjsz-vbr-elements/core
3
- * version: v2.8.0 - 11/12/2024, 21:34:58
4
- * (c) 2024
3
+ * version: v2.9.0 - 09/01/2025, 14:35:52
4
+ * (c) 2025
5
5
  * description: Data visualization for MJSZ VBR
6
6
  * author: Ákos Stegner <akos.stegner@gmail.com>
7
7
  */
8
- import { SORT_STATE_ORIGINAL as j, SORT_STATE_ASCEND as F } from "./constants.js";
9
- import { C as p, L as S, D as v, I as h, _ as f, w as g, x as R, M as O, J as c, N, O as $, K as T, P as U, Q as G, R as k, S as H, T as X, U as q, V as K, B as A, F as Y, H as J, f as m, c as M, b as Q, a as V } from "./datetime-BzdN4htO.js";
8
+ import { SORT_STATE_ORIGINAL as F, SORT_STATE_ASCEND as U } from "./constants.js";
9
+ import { C as p, L as S, D as v, I as m, _ as f, w as g, x as R, M as b, J as c, N, O as M, K as T, P as j, Q as G, R as k, S as H, T as X, U as q, V as Y, B as I, F as K, H as J, f as h, c as $, b as Q, a as V } from "./datetime-BzdN4htO.js";
10
10
  var Z = /* @__PURE__ */ p(function(e, r) {
11
11
  if (e === r)
12
12
  return r;
@@ -23,7 +23,7 @@ var Z = /* @__PURE__ */ p(function(e, r) {
23
23
  var s = S(e), i = n(s, S(r));
24
24
  return i !== void 0 && i === s ? e : r;
25
25
  }), z = /* @__PURE__ */ p(function(e, r) {
26
- return v(h(e), r);
26
+ return v(m(e), r);
27
27
  }), w = /* @__PURE__ */ f(function(e) {
28
28
  return g(e) ? !0 : !e || typeof e != "object" || R(e) ? !1 : e.length === 0 ? !0 : e.length > 0 ? e.hasOwnProperty(0) && e.hasOwnProperty(e.length - 1) : !1;
29
29
  }), D = typeof Symbol < "u" ? Symbol.iterator : "@@iterator";
@@ -55,7 +55,7 @@ function te(t, e, r) {
55
55
  return t["@@transducer/result"](e);
56
56
  }
57
57
  var re = /* @__PURE__ */ p(function(e, r) {
58
- return O(e.length, function() {
58
+ return b(e.length, function() {
59
59
  return e.apply(r, arguments);
60
60
  });
61
61
  });
@@ -84,17 +84,17 @@ var C = /* @__PURE__ */ ee(te, ae, ne), se = /* @__PURE__ */ function() {
84
84
  return this.f(e, r);
85
85
  }, t;
86
86
  }();
87
- function x(t) {
87
+ function E(t) {
88
88
  return new se(t);
89
89
  }
90
- var E = /* @__PURE__ */ c(function(t, e, r) {
91
- return C(typeof t == "function" ? x(t) : t, e, r);
92
- }), I = /* @__PURE__ */ f(function(e) {
90
+ var P = /* @__PURE__ */ c(function(t, e, r) {
91
+ return C(typeof t == "function" ? E(t) : t, e, r);
92
+ }), O = /* @__PURE__ */ f(function(e) {
93
93
  return function() {
94
94
  return e;
95
95
  };
96
96
  }), ue = /* @__PURE__ */ f(function(e) {
97
- return N(E(Z, 0, z("length", e)), function() {
97
+ return N(P(Z, 0, z("length", e)), function() {
98
98
  for (var r = 0, n = e.length; r < n; ) {
99
99
  if (e[r].apply(this, arguments))
100
100
  return !0;
@@ -109,7 +109,7 @@ var E = /* @__PURE__ */ c(function(t, e, r) {
109
109
  return N(e.length, e);
110
110
  });
111
111
  function ce(t, e, r) {
112
- if ($(t) && g(r)) {
112
+ if (M(t) && g(r)) {
113
113
  var n = [].concat(r);
114
114
  return n[t] = e, n;
115
115
  }
@@ -125,7 +125,7 @@ var oe = /* @__PURE__ */ f(function(e) {
125
125
  return r;
126
126
  var a = e[0];
127
127
  if (e.length > 1) {
128
- var u = !oe(n) && T(a, n) && typeof n[a] == "object" ? n[a] : $(e[1]) ? [] : {};
128
+ var u = !oe(n) && T(a, n) && typeof n[a] == "object" ? n[a] : M(e[1]) ? [] : {};
129
129
  r = t(Array.prototype.slice.call(e, 1), r, u);
130
130
  }
131
131
  return ce(a, r, n);
@@ -135,8 +135,8 @@ var oe = /* @__PURE__ */ f(function(e) {
135
135
  function fe(t) {
136
136
  return new RegExp(t.source, t.flags ? t.flags : (t.global ? "g" : "") + (t.ignoreCase ? "i" : "") + (t.multiline ? "m" : "") + (t.sticky ? "y" : "") + (t.unicode ? "u" : "") + (t.dotAll ? "s" : ""));
137
137
  }
138
- function B(t, e, r) {
139
- if (r || (r = new me()), he(t))
138
+ function L(t, e, r) {
139
+ if (r || (r = new he()), me(t))
140
140
  return t;
141
141
  var n = function(u) {
142
142
  var s = r.get(t);
@@ -147,7 +147,7 @@ function B(t, e, r) {
147
147
  Object.prototype.hasOwnProperty.call(t, i) && (u[i] = t[i]);
148
148
  return u;
149
149
  };
150
- switch (U(t)) {
150
+ switch (j(t)) {
151
151
  case "Object":
152
152
  return n(Object.create(Object.getPrototypeOf(t)));
153
153
  case "Array":
@@ -172,11 +172,11 @@ function B(t, e, r) {
172
172
  return t;
173
173
  }
174
174
  }
175
- function he(t) {
175
+ function me(t) {
176
176
  var e = typeof t;
177
177
  return t == null || e != "object" && e != "function";
178
178
  }
179
- var me = /* @__PURE__ */ function() {
179
+ var he = /* @__PURE__ */ function() {
180
180
  function t() {
181
181
  this.map = {}, this.length = 0;
182
182
  }
@@ -227,12 +227,12 @@ var ye = /* @__PURE__ */ c(/* @__PURE__ */ _("slice", function(e, r, n) {
227
227
  function d() {
228
228
  if (arguments.length === 0)
229
229
  throw new Error("pipe requires at least one argument");
230
- return O(arguments[0].length, E(de, arguments[0], ve(arguments)));
230
+ return b(arguments[0].length, P(de, arguments[0], ve(arguments)));
231
231
  }
232
232
  var ge = /* @__PURE__ */ f(function(e) {
233
233
  return R(e) ? e.split("").reverse().join("") : Array.prototype.slice.call(e, 0).reverse();
234
234
  });
235
- function L() {
235
+ function x() {
236
236
  if (arguments.length === 0)
237
237
  throw new Error("compose requires at least one argument");
238
238
  return d.apply(this, ge(arguments));
@@ -251,7 +251,7 @@ var Ne = /* @__PURE__ */ function() {
251
251
  return this.inputs = null, this.xf["@@transducer/result"](e);
252
252
  }, t.prototype["@@transducer/step"] = function(e, r) {
253
253
  var n = this.keyFn(r);
254
- return this.inputs[n] = this.inputs[n] || [n, B(this.valueAcc)], this.inputs[n][1] = this.valueFn(this.inputs[n][1], r), e;
254
+ return this.inputs[n] = this.inputs[n] || [n, L(this.valueAcc)], this.inputs[n][1] = this.valueFn(this.inputs[n][1], r), e;
255
255
  }, t;
256
256
  }();
257
257
  function Te(t, e, r) {
@@ -260,21 +260,21 @@ function Te(t, e, r) {
260
260
  };
261
261
  }
262
262
  var _e = /* @__PURE__ */ k(4, [], /* @__PURE__ */ H([], Te, function(e, r, n, a) {
263
- var u = x(function(s, i) {
264
- var o = n(i), l = e(T(o, s) ? s[o] : B(r), i);
263
+ var u = E(function(s, i) {
264
+ var o = n(i), l = e(T(o, s) ? s[o] : L(r), i);
265
265
  return l && l["@@transducer/reduced"] ? X(s) : (s[o] = l, s);
266
266
  });
267
267
  return C(u, {}, a);
268
268
  })), Se = /* @__PURE__ */ c(function(e, r, n) {
269
269
  var a = e(r), u = e(n);
270
270
  return a > u ? -1 : a < u ? 1 : 0;
271
- }), Ae = /* @__PURE__ */ p(/* @__PURE__ */ _("groupBy", /* @__PURE__ */ _e(function(t, e) {
271
+ }), Ie = /* @__PURE__ */ p(/* @__PURE__ */ _("groupBy", /* @__PURE__ */ _e(function(t, e) {
272
272
  return t.push(e), t;
273
273
  }, []))), De = /* @__PURE__ */ c(function(e, r, n) {
274
274
  return N(Math.max(e.length, r.length, n.length), function() {
275
275
  return e.apply(this, arguments) ? r.apply(this, arguments) : n.apply(this, arguments);
276
276
  });
277
- }), Ie = /* @__PURE__ */ p(q), be = /* @__PURE__ */ p(function(e, r) {
277
+ }), Oe = /* @__PURE__ */ p(q), Ae = /* @__PURE__ */ p(function(e, r) {
278
278
  return function(n) {
279
279
  return function(a) {
280
280
  return v(function(u) {
@@ -283,21 +283,21 @@ var _e = /* @__PURE__ */ k(4, [], /* @__PURE__ */ H([], Te, function(e, r, n, a)
283
283
  };
284
284
  };
285
285
  }), Re = /* @__PURE__ */ f(function(e) {
286
- return be(h(e), pe(e));
287
- }), P = function(t) {
286
+ return Ae(m(e), pe(e));
287
+ }), B = function(t) {
288
288
  return {
289
289
  value: t,
290
290
  map: function(e) {
291
- return P(e(t));
291
+ return B(e(t));
292
292
  }
293
293
  };
294
- }, Oe = /* @__PURE__ */ c(function(e, r, n) {
294
+ }, be = /* @__PURE__ */ c(function(e, r, n) {
295
295
  return e(function(a) {
296
- return P(r(a));
296
+ return B(r(a));
297
297
  })(n).value;
298
- }), $e = /* @__PURE__ */ c(function(e, r, n) {
298
+ }), Me = /* @__PURE__ */ c(function(e, r, n) {
299
299
  return n.replace(e, r);
300
- }), Me = /* @__PURE__ */ p(function(e, r) {
300
+ }), $e = /* @__PURE__ */ p(function(e, r) {
301
301
  return Array.prototype.slice.call(r, 0).sort(e);
302
302
  }), W = /* @__PURE__ */ p(function(e, r) {
303
303
  return Array.prototype.slice.call(r, 0).sort(function(n, a) {
@@ -305,8 +305,8 @@ var _e = /* @__PURE__ */ k(4, [], /* @__PURE__ */ H([], Te, function(e, r, n, a)
305
305
  u = e[s](n, a), s += 1;
306
306
  return u;
307
307
  });
308
- }), b = /* @__PURE__ */ K(0, "toLowerCase");
309
- const je = (t, e = "body") => {
308
+ }), A = /* @__PURE__ */ Y(0, "toLowerCase");
309
+ const Fe = (t, e = "body") => {
310
310
  if (!t) return;
311
311
  if (typeof e != "string") {
312
312
  e == null || e.append(t);
@@ -315,25 +315,33 @@ const je = (t, e = "body") => {
315
315
  const r = document.querySelector(e);
316
316
  r == null || r.append(t);
317
317
  };
318
- class Fe extends Error {
318
+ function Ue(t, e = () => ({})) {
319
+ return t.slice().sort((r, n) => {
320
+ let a = e(r), u = e(n);
321
+ if (a === null || u === null) return 0;
322
+ let s = a.compareDocumentPosition(u);
323
+ return s & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : s & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0;
324
+ });
325
+ }
326
+ class je extends Error {
319
327
  constructor(e, r = {}) {
320
328
  const { key: n, cause: a } = r;
321
329
  super(e), this.name = "WidgetError", this.key = n, this.cause = a;
322
330
  }
323
331
  }
324
- const Ue = {
332
+ const Ge = {
325
333
  message: "Undefined Column name Message",
326
334
  options: {
327
335
  key: "undefined-column",
328
336
  cause: {}
329
337
  }
330
- }, Ge = {
338
+ }, ke = {
331
339
  message: "Invalid season name",
332
340
  options: {
333
341
  key: "invalid-season-name",
334
342
  cause: {}
335
343
  }
336
- }, ke = (t = []) => ({
344
+ }, He = (t = []) => ({
337
345
  result: [...t],
338
346
  filteredRowsLength: 0,
339
347
  isFiltered: !1,
@@ -347,17 +355,17 @@ const Ue = {
347
355
  filter(e, r = [], n = !1) {
348
356
  if (e) {
349
357
  const a = r.map(
350
- (i) => n ? d(Y(i), A(e)) : d(h(i), b, Ie(b(e)))
351
- ), u = ie((i) => i.name ? Oe(Re("name"), $e(",", ""), i) : i), s = J(d(u, ue([...a])), this.result);
358
+ (i) => n ? d(K(i), I(e)) : d(m(i), A, Oe(A(e)))
359
+ ), u = ie((i) => i.name ? be(Re("name"), Me(",", ""), i) : i), s = J(d(u, ue([...a])), this.result);
352
360
  this.isFiltered = !0, this.filteredRowsLength = s.length, this.result = s;
353
361
  }
354
362
  return this;
355
363
  },
356
364
  sorted(e) {
357
365
  if (!e.sortTarget) return this;
358
- if (e.orders[0].direction === j) return this;
359
- const r = De(A(F), I(y), I(Se));
360
- return this.result = W(e.orders.map((n) => L(r(n.direction), h)(n.target)))(this.result), this;
366
+ if (e.orders[0].direction === F) return this;
367
+ const r = De(I(U), O(y), O(Se));
368
+ return this.result = W(e.orders.map((n) => x(r(n.direction), m)(n.target)))(this.result), this;
361
369
  },
362
370
  addIndex(e = null) {
363
371
  return this.result.reduce((r, n, a) => {
@@ -396,20 +404,20 @@ const Ue = {
396
404
  return this.result = this.result.map((n) => ({
397
405
  ...n,
398
406
  gameResult: `${n.homeTeamScore}-${n.awayTeamScore}`,
399
- gameDateDate: m(n.gameDate, "L dddd", e, r),
400
- gameDateTime: m(n.gameDate, "HH:mm", e, r)
407
+ gameDateDate: h(n.gameDate, "L dddd", e, r),
408
+ gameDateTime: h(n.gameDate, "HH:mm", e, r)
401
409
  })), this;
402
410
  },
403
411
  gameDateFilter(e) {
404
412
  return e === null ? this : (this.result = this.result.filter((r) => new Date(r.gameDate).getMonth() == e), this);
405
413
  },
406
414
  convertTimes(e = []) {
407
- return this.result = this.result.map((r) => (e.map((n) => r[n] ? r[`${n}Sec`] = M(r[n]) : r), r)), this;
415
+ return this.result = this.result.map((r) => (e.map((n) => r[n] ? r[`${n}Sec`] = $(r[n]) : r), r)), this;
408
416
  },
409
417
  groupByDays() {
410
- return this.currentItems = this.result.length, this.result = Ae((e) => m(e.gameDate, "YYYY-MM-DD"))(this.result), this;
418
+ return this.currentItems = this.result.length, this.result = Ie((e) => h(e.gameDate, "YYYY-MM-DD"))(this.result), this;
411
419
  }
412
- }), He = (t, ...e) => v(L(...e))(t), Xe = (t) => {
420
+ }), Xe = (t, ...e) => v(x(...e))(t), qe = (t) => {
413
421
  var e, r, n, a;
414
422
  return {
415
423
  ...t,
@@ -423,7 +431,7 @@ const Ue = {
423
431
  name: t.nationality.includes("hu") ? `${t.lastName} ${t.firstName}` : `${t.lastName}, ${t.firstName}`
424
432
  }
425
433
  };
426
- }, qe = (t) => {
434
+ }, Ye = (t) => {
427
435
  var e;
428
436
  return {
429
437
  ...t,
@@ -431,46 +439,46 @@ const Ue = {
431
439
  };
432
440
  }, Ke = (t = "", e = "hu") => (r) => ({
433
441
  ...r,
434
- gameDateDate: m(r.gameDate, "L dddd", t, e),
435
- gameDateTime: m(r.gameDate, "HH:mm", t, e)
436
- }), Ye = (t) => (e) => ({
442
+ gameDateDate: h(r.gameDate, "L dddd", t, e),
443
+ gameDateTime: h(r.gameDate, "HH:mm", t, e)
444
+ }), Je = (t) => (e) => ({
437
445
  ...e,
438
- gameResult: Be(e)
439
- }), Je = (t) => ({
440
- ...t,
441
- opponent: Ee(t)
446
+ gameResult: Le(e)
442
447
  }), Qe = (t) => ({
443
448
  ...t,
444
- resultType: Le(t)
449
+ opponent: Pe(t)
445
450
  }), Ve = (t) => ({
451
+ ...t,
452
+ resultType: xe(t)
453
+ }), Ze = (t) => ({
446
454
  ...t,
447
455
  rowClasses: t.optional ? "is-optional" : ""
448
- }), Ze = (t = []) => (e) => {
456
+ }), ze = (t = []) => (e) => {
449
457
  var r;
450
458
  return {
451
459
  ...e,
452
460
  [t]: (r = e[t]) == null ? void 0 : r.toUpperCase()
453
461
  };
454
- }, ze = (t = []) => (e) => (t.map((r) => e[r] ? e[`${r}Sec`] = M(e[r]) : e), e), we = (t = []) => (e) => (t.map((r) => e[r] ? e[`${r}Min`] = Q(e[r]) : e), e), et = (t = []) => (e) => (t.map((r) => e[`${r}Min`] = V(e[r])), e), tt = (t) => {
462
+ }, we = (t = []) => (e) => (t.map((r) => e[r] ? e[`${r}Sec`] = $(e[r]) : e), e), et = (t = []) => (e) => (t.map((r) => e[r] ? e[`${r}Min`] = Q(e[r]) : e), e), tt = (t = []) => (e) => (t.map((r) => e[`${r}Min`] = V(e[r])), e), rt = (t) => {
455
463
  var e, r;
456
464
  return {
457
465
  ...t,
458
466
  periodResults: ((r = (e = t.result) == null ? void 0 : e.match(/\(.*?\)/)) == null ? void 0 : r[0]) ?? ""
459
467
  };
460
- }, Ce = (t, e) => new Date(t.gameDate).getTime() - new Date(e.gameDate).getTime(), rt = W([Ce, y(h("id")), y(h("gameId"))]), xe = (t) => (e, r) => e[t].localeCompare(r[t], "hu"), nt = Me(xe("name"));
461
- function Ee(t) {
468
+ }, Ce = (t, e) => new Date(t.gameDate).getTime() - new Date(e.gameDate).getTime(), nt = W([Ce, y(m("id")), y(m("gameId"))]), Ee = (t) => (e, r) => e[t].localeCompare(r[t], "hu"), at = $e(Ee("name"));
469
+ function Pe(t) {
462
470
  var e;
463
471
  return [t.isHomeGame ? null : "@", (e = t.opponent) == null ? void 0 : e.shortName].join(" ");
464
472
  }
465
- function Be(t, e) {
473
+ function Le(t, e) {
466
474
  let r = t == null ? void 0 : t.homeTeamScore, n = t == null ? void 0 : t.awayTeamScore;
467
475
  return t.isHomeGame || (r = t == null ? void 0 : t.awayTeamScore, n = t == null ? void 0 : t.homeTeamScore), [r, n].join(":");
468
476
  }
469
- function Le(t) {
477
+ function xe(t) {
470
478
  const e = t.gameResult.split(":"), r = e[0] > e[1], n = e[0] < e[1];
471
479
  return r && t.isOvertime ? "OTW" : r && t.isShootout ? "SOW" : r ? "W" : n && t.isOvertime ? "OTL" : n && t.isShootout ? "SOL" : n ? "L" : "D";
472
480
  }
473
- const at = (t) => t.map((e) => {
481
+ const st = (t) => t.map((e) => {
474
482
  var r, n;
475
483
  return {
476
484
  phaseId: e.phaseId,
@@ -484,25 +492,26 @@ const at = (t) => t.map((e) => {
484
492
  };
485
493
  });
486
494
  export {
487
- Ge as I,
488
- Ue as U,
489
- Fe as W,
490
- Ye as a,
491
- Je as b,
492
- ke as c,
493
- Qe as d,
494
- ze as e,
495
- we as f,
495
+ ke as I,
496
+ Ge as U,
497
+ je as W,
498
+ Je as a,
499
+ Qe as b,
500
+ He as c,
501
+ Ve as d,
502
+ we as e,
503
+ et as f,
496
504
  Ke as g,
497
- et as h,
498
- tt as i,
499
- rt as j,
500
- at as k,
501
- nt as l,
502
- je as m,
503
- Xe as p,
504
- He as r,
505
- Ve as s,
506
- qe as t,
507
- Ze as u
505
+ tt as h,
506
+ rt as i,
507
+ nt as j,
508
+ st as k,
509
+ at as l,
510
+ Fe as m,
511
+ Ue as n,
512
+ qe as p,
513
+ Xe as r,
514
+ Ze as s,
515
+ Ye as t,
516
+ ze as u
508
517
  };
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * name: @mjsz-vbr-elements/core
3
- * version: v2.8.0 - 11/12/2024, 21:34:58
4
- * (c) 2024
3
+ * version: v2.9.0 - 09/01/2025, 14:35:52
4
+ * (c) 2025
5
5
  * description: Data visualization for MJSZ VBR
6
6
  * author: Ákos Stegner <akos.stegner@gmail.com>
7
7
  */