@dcrackel/hematournamentui 1.0.4 → 1.0.5

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,10 +1,10 @@
1
- import { withDirectives as I, openBlock as s, createElementBlock as c, vModelText as Q, reactive as p, computed as y, normalizeClass as h, toDisplayString as k, resolveComponent as g, createCommentVNode as w, createVNode as d, createElementVNode as i, normalizeStyle as D, Fragment as B, renderList as x, createBlock as f, resolveDynamicComponent as E } from "vue";
2
- const A = (e, t) => {
1
+ import { withDirectives as D, openBlock as i, createElementBlock as u, vModelText as S, reactive as b, computed as h, normalizeClass as B, toDisplayString as k, resolveComponent as m, createCommentVNode as _, createVNode as d, createElementVNode as c, normalizeStyle as E, Fragment as x, renderList as p, createBlock as f, resolveDynamicComponent as v } from "vue";
2
+ const g = (e, t) => {
3
3
  const r = e.__vccOpts || e;
4
- for (const [o, u] of t)
5
- r[o] = u;
4
+ for (const [l, o] of t)
5
+ r[l] = o;
6
6
  return r;
7
- }, S = {
7
+ }, Y = {
8
8
  name: "BaseInput",
9
9
  props: {
10
10
  placeholder: {
@@ -34,18 +34,18 @@ const A = (e, t) => {
34
34
  }, 300);
35
35
  }
36
36
  }
37
- }, Y = ["placeholder"];
38
- function v(e, t, r, o, u, n) {
39
- return I((s(), c("input", {
37
+ }, M = ["placeholder"];
38
+ function G(e, t, r, l, o, a) {
39
+ return D((i(), u("input", {
40
40
  class: "appearance-none focus:outline-none w-full text-sm",
41
41
  placeholder: r.placeholder,
42
- "onUpdate:modelValue": t[0] || (t[0] = (a) => u.internalValue = a),
43
- onInput: t[1] || (t[1] = (...a) => n.onInput && n.onInput(...a))
44
- }, null, 40, Y)), [
45
- [Q, u.internalValue]
42
+ "onUpdate:modelValue": t[0] || (t[0] = (n) => o.internalValue = n),
43
+ onInput: t[1] || (t[1] = (...n) => a.onInput && a.onInput(...n))
44
+ }, null, 40, M)), [
45
+ [S, o.internalValue]
46
46
  ]);
47
47
  }
48
- const M = /* @__PURE__ */ A(S, [["render", v]]), G = {
48
+ const I = /* @__PURE__ */ g(Y, [["render", G]]), U = {
49
49
  name: "BaseText",
50
50
  props: {
51
51
  text: {
@@ -91,8 +91,8 @@ const M = /* @__PURE__ */ A(S, [["render", v]]), G = {
91
91
  }
92
92
  },
93
93
  setup(e) {
94
- return e = p(e), {
95
- classes: y(() => {
94
+ return e = b(e), {
95
+ classes: h(() => {
96
96
  let t = "inline-block font-sans";
97
97
  switch (e.color) {
98
98
  case "neutral":
@@ -191,14 +191,14 @@ const M = /* @__PURE__ */ A(S, [["render", v]]), G = {
191
191
  };
192
192
  }
193
193
  };
194
- function q(e, t, r, o, u, n) {
195
- return s(), c("div", {
196
- class: h(o.classes)
194
+ function q(e, t, r, l, o, a) {
195
+ return i(), u("div", {
196
+ class: B(l.classes)
197
197
  }, k(r.text), 3);
198
198
  }
199
- const b = /* @__PURE__ */ A(G, [["render", q]]), U = {
199
+ const y = /* @__PURE__ */ g(U, [["render", q]]), T = {
200
200
  name: "base-button",
201
- components: { BaseText: b },
201
+ components: { BaseText: y },
202
202
  props: {
203
203
  label: {
204
204
  type: String,
@@ -229,8 +229,8 @@ const b = /* @__PURE__ */ A(G, [["render", q]]), U = {
229
229
  },
230
230
  emits: ["click"],
231
231
  setup(e, { emit: t }) {
232
- return e = p(e), {
233
- textColor: y(() => {
232
+ return e = b(e), {
233
+ textColor: h(() => {
234
234
  switch (e.type) {
235
235
  case "primary":
236
236
  return "primary";
@@ -246,7 +246,7 @@ const b = /* @__PURE__ */ A(G, [["render", q]]), U = {
246
246
  return "neutral";
247
247
  }
248
248
  }),
249
- classes: y(() => {
249
+ classes: h(() => {
250
250
  let r = "px-2.5 mx-1 inline-flex ";
251
251
  switch (e.type) {
252
252
  case "primary":
@@ -288,33 +288,33 @@ const b = /* @__PURE__ */ A(G, [["render", q]]), U = {
288
288
  return r;
289
289
  }),
290
290
  onClick() {
291
- console.log("Click!"), t("click");
291
+ t("click");
292
292
  }
293
293
  };
294
294
  }
295
295
  };
296
- function V(e, t, r, o, u, n) {
297
- const a = g("BaseText");
298
- return s(), c("button", {
296
+ function $(e, t, r, l, o, a) {
297
+ const n = m("BaseText");
298
+ return i(), u("button", {
299
299
  "data-testid": "base-button",
300
- class: h(o.classes),
300
+ class: B(l.classes),
301
301
  type: "button",
302
- onClick: t[0] || (t[0] = (...l) => o.onClick && o.onClick(...l))
302
+ onClick: t[0] || (t[0] = (...s) => l.onClick && l.onClick(...s))
303
303
  }, [
304
- r.iconClass ? (s(), c("i", {
304
+ r.iconClass ? (i(), u("i", {
305
305
  key: 0,
306
- class: h([r.iconClass, "mr-2 hover:text-highlightedClass"])
307
- }, null, 2)) : w("", !0),
308
- d(a, {
306
+ class: B([r.iconClass, "mr-2 hover:text-highlightedClass"])
307
+ }, null, 2)) : _("", !0),
308
+ d(n, {
309
309
  "data-testid": "base-text",
310
- color: o.textColor,
310
+ color: l.textColor,
311
311
  size: r.size,
312
312
  text: r.label,
313
313
  weight: "normal"
314
314
  }, null, 8, ["color", "size", "text"])
315
315
  ], 2);
316
316
  }
317
- const _ = /* @__PURE__ */ A(U, [["render", V]]), $ = {
317
+ const C = /* @__PURE__ */ g(T, [["render", $]]), V = {
318
318
  name: "base-tag",
319
319
  props: {
320
320
  label: {
@@ -329,8 +329,8 @@ const _ = /* @__PURE__ */ A(U, [["render", V]]), $ = {
329
329
  }
330
330
  },
331
331
  setup(e) {
332
- return e = p(e), {
333
- classes: y(() => {
332
+ return e = b(e), {
333
+ classes: h(() => {
334
334
  let t = "cursor-pointer inline-block py-1 px-3 my-2 ml-3 text-xs font-normal rounded-full text-neutral";
335
335
  switch (e.backgroundColor) {
336
336
  case "primary":
@@ -357,12 +357,12 @@ const _ = /* @__PURE__ */ A(U, [["render", V]]), $ = {
357
357
  };
358
358
  }
359
359
  };
360
- function T(e, t, r, o, u, n) {
361
- return s(), c("div", {
362
- class: h(o.classes)
360
+ function F(e, t, r, l, o, a) {
361
+ return i(), u("div", {
362
+ class: B(l.classes)
363
363
  }, k(r.label), 3);
364
364
  }
365
- const W = /* @__PURE__ */ A($, [["render", T]]), C = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAADICAYAAABS39xVAAAAAXNSR0IArs4c6QAABdlJREFUeF7t1AEJACAQBEGNaiOzWkDBFgvzCY655+ba5w5HgACBgMA0WIGWRCRA4AsYLI9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACB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9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBB4p/0F3nyMcxwAAAABJRU5ErkJggg==", K = {
366
366
  name: "tournament-card-header",
367
367
  components: {
368
368
  BaseTag: W
@@ -371,7 +371,7 @@ const W = /* @__PURE__ */ A($, [["render", T]]), C = "data:image/png;base64,iVBO
371
371
  artwork: {
372
372
  type: String,
373
373
  required: !0,
374
- default: C
374
+ default: w
375
375
  },
376
376
  tags: {
377
377
  type: Array,
@@ -380,31 +380,31 @@ const W = /* @__PURE__ */ A($, [["render", T]]), C = "data:image/png;base64,iVBO
380
380
  },
381
381
  computed: {
382
382
  backgroundStyle() {
383
- return `background-image: url('${this.artwork || C}');`;
383
+ return `background-image: url('${this.artwork || w}');`;
384
384
  }
385
385
  }
386
- }, H = { class: "rounded-t-xl w-full" }, J = { class: "flex flex-row" };
387
- function j(e, t, r, o, u, n) {
388
- const a = g("BaseTag");
389
- return s(), c("div", H, [
390
- i("div", {
391
- style: D(n.backgroundStyle),
386
+ }, H = { class: "rounded-t-xl w-full" }, P = { class: "flex flex-row" };
387
+ function j(e, t, r, l, o, a) {
388
+ const n = m("BaseTag");
389
+ return i(), u("div", H, [
390
+ c("div", {
391
+ style: E(a.backgroundStyle),
392
392
  class: "h-36 w-full flex flex-col justify-end rounded-t-xl bg-cover bg-no-repeat bg-center"
393
393
  }, [
394
- i("div", J, [
395
- (s(!0), c(B, null, x(r.tags, (l) => (s(), f(a, {
396
- key: l,
397
- label: l
394
+ c("div", P, [
395
+ (i(!0), u(x, null, p(r.tags, (s) => (i(), f(n, {
396
+ key: s,
397
+ label: s
398
398
  }, null, 8, ["label"]))), 128))
399
399
  ])
400
400
  ], 4)
401
401
  ]);
402
402
  }
403
- const F = /* @__PURE__ */ A(K, [["render", j]]), O = {
403
+ const J = /* @__PURE__ */ g(K, [["render", j]]), z = {
404
404
  name: "tournament-card-details",
405
405
  components: {
406
- BaseButton: _,
407
- BaseText: b
406
+ BaseButton: C,
407
+ BaseText: y
408
408
  },
409
409
  props: {
410
410
  detail: {
@@ -418,38 +418,38 @@ const F = /* @__PURE__ */ A(K, [["render", j]]), O = {
418
418
  })
419
419
  }
420
420
  }
421
- }, P = { class: "flex flex-col w-full pt-4 pb-3 px-3" }, z = { class: "mt-4 flex flex-col" }, L = { class: "flex flex-row w-full justify-end" };
422
- function N(e, t, r, o, u, n) {
423
- const a = g("BaseText"), l = g("BaseButton");
424
- return s(), c("div", P, [
425
- d(a, {
421
+ }, O = { class: "flex flex-col w-full pt-4 pb-3 px-3" }, L = { class: "mt-4 flex flex-col" }, N = { class: "flex flex-row w-full justify-end" };
422
+ function Z(e, t, r, l, o, a) {
423
+ const n = m("BaseText"), s = m("BaseButton");
424
+ return i(), u("div", O, [
425
+ d(n, {
426
426
  text: r.detail.name,
427
427
  color: "primary",
428
428
  size: "xl",
429
429
  weight: "semi-bold"
430
430
  }, null, 8, ["text"]),
431
- d(a, {
431
+ d(n, {
432
432
  text: r.detail.location,
433
433
  color: "primary",
434
434
  size: "sm",
435
435
  weight: "normal"
436
436
  }, null, 8, ["text"]),
437
- i("div", z, [
438
- d(a, {
437
+ c("div", L, [
438
+ d(n, {
439
439
  text: `${r.detail.date}`,
440
440
  color: "primaryHighlight",
441
441
  size: "sm",
442
442
  weight: "light"
443
443
  }, null, 8, ["text"]),
444
- d(a, {
444
+ d(n, {
445
445
  text: `${r.detail.closes}`,
446
446
  color: "primaryHighlight",
447
447
  size: "sm",
448
448
  weight: "light"
449
449
  }, null, 8, ["text"])
450
450
  ]),
451
- i("div", L, [
452
- d(l, {
451
+ c("div", N, [
452
+ d(s, {
453
453
  label: "Edit",
454
454
  class: "mt-2",
455
455
  primary: ""
@@ -457,11 +457,11 @@ function N(e, t, r, o, u, n) {
457
457
  ])
458
458
  ]);
459
459
  }
460
- const Z = /* @__PURE__ */ A(O, [["render", N]]), R = {
460
+ const R = /* @__PURE__ */ g(z, [["render", Z]]), X = {
461
461
  name: "TournamentCard",
462
462
  components: {
463
- TournamentHeader: F,
464
- TournamentDetail: Z
463
+ TournamentHeader: J,
464
+ TournamentDetail: R
465
465
  },
466
466
  props: {
467
467
  detail: {
@@ -478,20 +478,20 @@ const Z = /* @__PURE__ */ A(O, [["render", N]]), R = {
478
478
  })
479
479
  }
480
480
  }
481
- }, X = { class: "rounded-xl w-72 shadow" };
482
- function ee(e, t, r, o, u, n) {
483
- const a = g("TournamentHeader"), l = g("TournamentDetail");
484
- return s(), c("div", X, [
485
- d(a, {
481
+ }, ee = { class: "rounded-xl w-72 shadow" };
482
+ function te(e, t, r, l, o, a) {
483
+ const n = m("TournamentHeader"), s = m("TournamentDetail");
484
+ return i(), u("div", ee, [
485
+ d(n, {
486
486
  artwork: r.detail.artwork,
487
487
  tags: r.detail.tags
488
488
  }, null, 8, ["artwork", "tags"]),
489
- d(l, { detail: r.detail }, null, 8, ["detail"])
489
+ d(s, { detail: r.detail }, null, 8, ["detail"])
490
490
  ]);
491
491
  }
492
- const te = /* @__PURE__ */ A(R, [["render", ee]]), re = {
492
+ const re = /* @__PURE__ */ g(X, [["render", te]]), ae = {
493
493
  name: "DropDownMenu",
494
- components: { BaseText: b },
494
+ components: { BaseText: y },
495
495
  props: {
496
496
  label: {
497
497
  type: String
@@ -517,54 +517,54 @@ const te = /* @__PURE__ */ A(R, [["render", ee]]), re = {
517
517
  this.isDropDownOpen = !this.isDropDownOpen;
518
518
  }
519
519
  }
520
- }, ae = { class: "flex flex-row" }, ne = /* @__PURE__ */ i("i", { class: "fa-solid fa-chevron-down text-xs" }, null, -1), le = {
520
+ }, ne = { class: "flex flex-row" }, le = /* @__PURE__ */ c("i", { class: "fa-solid fa-chevron-down text-xs" }, null, -1), se = {
521
521
  key: 0,
522
522
  class: "flex flex-col w-32 shadow mt-2 z-10 rounded-xl py-1 absolute bg-neutral"
523
- }, se = ["onClick"];
524
- function oe(e, t, r, o, u, n) {
525
- const a = g("BaseText");
526
- return s(), c("div", ae, [
527
- i("span", null, [
528
- i("div", {
523
+ }, oe = ["onClick"];
524
+ function ie(e, t, r, l, o, a) {
525
+ const n = m("BaseText");
526
+ return i(), u("div", ne, [
527
+ c("span", null, [
528
+ c("div", {
529
529
  class: "z-10 rounded-lg shadow px-2 py-2 w-32 flex flex-row justify-between",
530
- onClick: t[0] || (t[0] = (l) => n.handleDropDown())
530
+ onClick: t[0] || (t[0] = (s) => a.handleDropDown())
531
531
  }, [
532
- d(a, {
532
+ d(n, {
533
533
  text: r.label,
534
534
  color: "quaternary",
535
535
  size: "sm",
536
536
  weight: "normal"
537
537
  }, null, 8, ["text"]),
538
- d(a, {
538
+ d(n, {
539
539
  text: r.selectedItem.text,
540
540
  color: "secondary",
541
541
  size: "sm",
542
542
  weight: "normal"
543
543
  }, null, 8, ["text"]),
544
- ne
544
+ le
545
545
  ]),
546
- e.isDropDownOpen ? (s(), c("div", le, [
547
- (s(!0), c(B, null, x(r.items, (l) => (s(), c("a", {
548
- key: l.id,
549
- onClick: (m) => n.handleClick(l),
546
+ e.isDropDownOpen ? (i(), u("div", se, [
547
+ (i(!0), u(x, null, p(r.items, (s) => (i(), u("a", {
548
+ key: s.id,
549
+ onClick: (A) => a.handleClick(s),
550
550
  class: "hover:bg-dropdownSelect py-1 px-2 border-b border-dropdownSelect last:border-0"
551
551
  }, [
552
- d(a, {
553
- text: l.text,
552
+ d(n, {
553
+ text: s.text,
554
554
  color: "primary",
555
555
  size: "xs",
556
556
  weight: "normal"
557
557
  }, null, 8, ["text"])
558
- ], 8, se))), 128))
559
- ])) : w("", !0)
558
+ ], 8, oe))), 128))
559
+ ])) : _("", !0)
560
560
  ])
561
561
  ]);
562
562
  }
563
- const ie = /* @__PURE__ */ A(re, [["render", oe]]), ce = {
563
+ const Q = /* @__PURE__ */ g(ae, [["render", ie]]), ce = {
564
564
  name: "FilterAndSortBar",
565
565
  components: {
566
- DropDownMenu: ie,
567
- BaseInput: M
566
+ DropDownMenu: Q,
567
+ BaseInput: I
568
568
  },
569
569
  data() {
570
570
  return {
@@ -589,35 +589,97 @@ const ie = /* @__PURE__ */ A(re, [["render", oe]]), ce = {
589
589
  this.$emit("sort", e), console.log("handleSelectedItem", e);
590
590
  }
591
591
  }
592
- }, de = { class: "flex flex-row w-full justify-between" }, ue = { class: "rounded-lg shadow px-2 py-1 w-full flex flex-row mt-0.5 mr-4" }, ge = /* @__PURE__ */ i("i", { class: "fa-solid fa-magnifying-glass text-primaryHighlight w-6 mt-1" }, null, -1);
593
- function Ae(e, t, r, o, u, n) {
594
- const a = g("BaseInput"), l = g("DropDownMenu");
595
- return s(), c("section", de, [
596
- i("div", ue, [
597
- ge,
598
- d(a, {
592
+ }, de = { class: "flex flex-row w-full justify-between" }, ue = { class: "rounded-lg shadow px-2 py-1 w-full flex flex-row mt-0.5 mr-4" }, me = /* @__PURE__ */ c("i", { class: "fa-solid fa-magnifying-glass text-primaryHighlight w-6 mt-1" }, null, -1);
593
+ function ge(e, t, r, l, o, a) {
594
+ const n = m("BaseInput"), s = m("DropDownMenu");
595
+ return i(), u("section", de, [
596
+ c("div", ue, [
597
+ me,
598
+ d(n, {
599
599
  placeholder: "Search on Name, Location, or Date",
600
600
  class: "text-quaternary",
601
- value: u.filterText,
602
- "onUpdate:value": n.handleFilter
601
+ value: o.filterText,
602
+ "onUpdate:value": a.handleFilter
603
603
  }, null, 8, ["value", "onUpdate:value"])
604
604
  ]),
605
- i("div", null, [
606
- d(l, {
605
+ c("div", null, [
606
+ d(s, {
607
607
  label: r.label,
608
608
  items: r.items,
609
609
  selectedItem: r.selectedItem,
610
- "onUpdate:selectedItem": n.handleSelectedItem
610
+ "onUpdate:selectedItem": a.handleSelectedItem
611
611
  }, null, 8, ["label", "items", "selectedItem", "onUpdate:selectedItem"])
612
612
  ])
613
613
  ]);
614
614
  }
615
- const me = /* @__PURE__ */ A(ce, [["render", Ae]]), ye = {
615
+ const Ae = /* @__PURE__ */ g(ce, [["render", ge]]), ye = {
616
+ name: "FilterUpcomingPast",
617
+ components: {
618
+ BaseText: y,
619
+ BaseButton: C,
620
+ DropDownMenu: Q,
621
+ BaseInput: I
622
+ },
623
+ props: {
624
+ selected: {
625
+ type: String,
626
+ default: "All"
627
+ }
628
+ },
629
+ data() {
630
+ return {
631
+ localSelected: this.selected
632
+ };
633
+ },
634
+ methods: {
635
+ handleTimeFrame(e) {
636
+ this.$emit("timeFrame", e), this.localSelected = e;
637
+ }
638
+ }
639
+ }, he = { class: "flex flex-row w-full justify-between" }, Be = { class: "rounded-lg w-3/4" }, xe = { class: "flex flex-row h-8 w-1/4 justify-end" };
640
+ function pe(e, t, r, l, o, a) {
641
+ const n = m("BaseText"), s = m("BaseButton");
642
+ return i(), u("section", he, [
643
+ c("div", Be, [
644
+ d(n, {
645
+ text: "Tournament",
646
+ color: "primary",
647
+ size: "2xl",
648
+ weight: "normal"
649
+ })
650
+ ]),
651
+ c("div", xe, [
652
+ d(s, {
653
+ label: "All",
654
+ color: "primary",
655
+ size: "sm",
656
+ selected: o.localSelected === "All",
657
+ onClick: t[0] || (t[0] = (A) => a.handleTimeFrame("ALL"))
658
+ }, null, 8, ["selected"]),
659
+ d(s, {
660
+ label: "Upcoming",
661
+ color: "primary",
662
+ size: "sm",
663
+ selected: o.localSelected === "Upcoming",
664
+ onClick: t[1] || (t[1] = (A) => a.handleTimeFrame("Upcoming"))
665
+ }, null, 8, ["selected"]),
666
+ d(s, {
667
+ label: "Past",
668
+ color: "primary",
669
+ size: "sm",
670
+ selected: o.localSelected === "Past",
671
+ onClick: t[2] || (t[2] = (A) => a.handleTimeFrame("Past"))
672
+ }, null, 8, ["selected"])
673
+ ])
674
+ ]);
675
+ }
676
+ const be = /* @__PURE__ */ g(ye, [["render", pe]]), fe = {
616
677
  name: "GridContainer",
617
678
  components: {
618
- FilterAndSortBar: me,
619
- BaseText: b,
620
- TournamentCard: te
679
+ FilterAndSortBar: Ae,
680
+ BaseText: y,
681
+ TournamentCard: re,
682
+ FilterUpcomingPast: be
621
683
  },
622
684
  props: {
623
685
  items: {
@@ -640,29 +702,39 @@ const me = /* @__PURE__ */ A(ce, [["render", Ae]]), ye = {
640
702
  data() {
641
703
  return {
642
704
  filterOn: "",
643
- sortCriteria: "Date"
705
+ sortCriteria: "Date",
706
+ selectedTimeFrame: "All"
644
707
  };
645
708
  },
646
709
  computed: {
647
710
  filteredItems() {
648
711
  let e = this.items;
649
712
  if (this.filterOn.trim()) {
650
- const t = this.filterOn.toLowerCase();
713
+ const r = this.filterOn.toLowerCase();
651
714
  e = e.filter(
652
- (r) => Object.values(r).some(
653
- (o) => typeof o == "string" && o.toLowerCase().includes(t)
715
+ (l) => Object.values(l).some(
716
+ (o) => typeof o == "string" && o.toLowerCase().includes(r)
654
717
  )
655
718
  );
656
719
  }
720
+ const t = /* @__PURE__ */ new Date();
721
+ switch (t.setHours(0, 0, 0, 0), this.selectedTimeFrame) {
722
+ case "Upcoming":
723
+ e = e.filter((r) => new Date(r.date) >= t);
724
+ break;
725
+ case "Past":
726
+ e = e.filter((r) => new Date(r.date) < t);
727
+ break;
728
+ }
657
729
  switch (this.sortCriteria) {
658
730
  case "Date":
659
- e = [...e].sort((t, r) => new Date(t.date) - new Date(r.date));
731
+ e = [...e].sort((r, l) => new Date(r.date) - new Date(l.date));
660
732
  break;
661
733
  case "Name":
662
- e = [...e].sort((t, r) => t.name.localeCompare(r.name));
734
+ e = [...e].sort((r, l) => r.name.localeCompare(l.name));
663
735
  break;
664
736
  case "Location":
665
- e = [...e].sort((t, r) => t.location.localeCompare(r.location));
737
+ e = [...e].sort((r, l) => r.location.localeCompare(l.location));
666
738
  break;
667
739
  }
668
740
  return e;
@@ -674,41 +746,42 @@ const me = /* @__PURE__ */ A(ce, [["render", Ae]]), ye = {
674
746
  },
675
747
  handleSort(e) {
676
748
  this.sortCriteria = e.text;
749
+ },
750
+ handleTimeFrameChange(e) {
751
+ this.selectedTimeFrame = e;
677
752
  }
678
753
  }
679
- }, he = { class: "border border-dropdownSelect rounded-lg p-9 bg-neutral" }, Be = { class: "w-full text-center mb-9" }, xe = { class: "my-4" }, be = { class: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 3xl:grid-cols-4 gap-6 w-full" };
680
- function pe(e, t, r, o, u, n) {
681
- const a = g("BaseText"), l = g("FilterAndSortBar");
682
- return s(), c("div", he, [
683
- i("h1", Be, [
684
- d(a, {
685
- color: "primaryHighlight",
686
- size: "2xl",
687
- text: "Upcoming Tournaments",
688
- weight: "normal"
689
- })
754
+ }, Ce = { class: "border border-dropdownSelect rounded-lg p-9 bg-neutral" }, we = { class: "my-4" }, ke = { class: "my-4" }, _e = { class: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 3xl:grid-cols-4 gap-6 w-full" };
755
+ function Ie(e, t, r, l, o, a) {
756
+ const n = m("FilterUpcomingPast"), s = m("FilterAndSortBar");
757
+ return i(), u("div", Ce, [
758
+ c("div", we, [
759
+ d(n, {
760
+ selected: o.selectedTimeFrame,
761
+ onTimeFrame: a.handleTimeFrameChange
762
+ }, null, 8, ["selected", "onTimeFrame"])
690
763
  ]),
691
- i("div", xe, [
692
- d(l, {
764
+ c("div", ke, [
765
+ d(s, {
693
766
  items: r.dropdownItems,
694
767
  label: r.label,
695
768
  selectedItem: r.selectedItem,
696
- onFilterbar: n.handleFilter,
697
- onSort: n.handleSort
769
+ onFilterbar: a.handleFilter,
770
+ onSort: a.handleSort
698
771
  }, null, 8, ["items", "label", "selectedItem", "onFilterbar", "onSort"])
699
772
  ]),
700
- i("div", be, [
701
- (s(!0), c(B, null, x(n.filteredItems, (m) => (s(), c("div", {
702
- key: m.id
773
+ c("div", _e, [
774
+ (i(!0), u(x, null, p(a.filteredItems, (A) => (i(), u("div", {
775
+ key: A.id
703
776
  }, [
704
- (s(), f(E(r.component), { detail: m }, null, 8, ["detail"]))
777
+ (i(), f(v(r.component), { detail: A }, null, 8, ["detail"]))
705
778
  ]))), 128))
706
779
  ])
707
780
  ]);
708
781
  }
709
- const Ee = /* @__PURE__ */ A(ye, [["render", pe]]), fe = {
782
+ const Ue = /* @__PURE__ */ g(fe, [["render", Ie]]), Qe = {
710
783
  name: "AdminLeftMenu",
711
- components: { BaseButton: _ },
784
+ components: { BaseButton: C },
712
785
  props: {
713
786
  buttons: {
714
787
  type: Array,
@@ -720,59 +793,59 @@ const Ee = /* @__PURE__ */ A(ye, [["render", pe]]), fe = {
720
793
  this.$emit("button-click", e);
721
794
  }
722
795
  }
723
- }, Ce = { class: "bg-secondary w-64 h-screen flex flex-col justify-between" }, ke = /* @__PURE__ */ i("section", { class: "h-28 border-b border-neutral" }, [
724
- /* @__PURE__ */ i("div", { class: "flex flex-col justify-center h-28" }, [
725
- /* @__PURE__ */ i("div", { class: "ml-8" }, [
726
- /* @__PURE__ */ i("img", {
796
+ }, De = { class: "bg-secondary w-64 h-screen flex flex-col justify-between" }, Se = /* @__PURE__ */ c("section", { class: "h-28 border-b border-neutral" }, [
797
+ /* @__PURE__ */ c("div", { class: "flex flex-col justify-center h-28" }, [
798
+ /* @__PURE__ */ c("div", { class: "ml-8" }, [
799
+ /* @__PURE__ */ c("img", {
727
800
  class: "w-32",
728
801
  src: "https://ferrotas.com/assets/ferrotas-white-small-720502db.png",
729
802
  alt: "logo"
730
803
  })
731
804
  ])
732
805
  ])
733
- ], -1), we = { class: "flex flex-col p-2 h-full" }, _e = { class: "flex flex-col justify-end p-2 flex-grow" }, Ie = { class: "border-t border-neutral pt-2" };
734
- function Qe(e, t, r, o, u, n) {
735
- const a = g("BaseButton");
736
- return s(), c("div", Ce, [
737
- ke,
738
- i("section", we, [
739
- (s(!0), c(B, null, x(r.buttons, (l) => (s(), f(a, {
740
- label: l.label,
806
+ ], -1), Ee = { class: "flex flex-col p-2 h-full" }, ve = { class: "flex flex-col justify-end p-2 flex-grow" }, Ye = { class: "border-t border-neutral pt-2" };
807
+ function Me(e, t, r, l, o, a) {
808
+ const n = m("BaseButton");
809
+ return i(), u("div", De, [
810
+ Se,
811
+ c("section", Ee, [
812
+ (i(!0), u(x, null, p(r.buttons, (s) => (i(), f(n, {
813
+ label: s.label,
741
814
  iconClass: "fa-solid fa-trophy text-white",
742
815
  type: "admin",
743
816
  hover: "admin",
744
- onClick: (m) => n.handleButtonClick(l)
817
+ onClick: (A) => a.handleButtonClick(s)
745
818
  }, null, 8, ["label", "onClick"]))), 256))
746
819
  ]),
747
- i("section", _e, [
748
- i("div", Ie, [
749
- d(a, {
820
+ c("section", ve, [
821
+ c("div", Ye, [
822
+ d(n, {
750
823
  iconClass: "fa-solid fa-circle-user text-textSecondary",
751
824
  label: "Account",
752
825
  type: "adminSecondary",
753
- onClick: t[0] || (t[0] = (l) => n.handleButtonClick(e.button))
826
+ onClick: t[0] || (t[0] = (s) => a.handleButtonClick(e.button))
754
827
  }),
755
- d(a, {
828
+ d(n, {
756
829
  iconClass: "fa-solid fa-right-to-bracket fa-rotate-180 text-textSecondary",
757
830
  label: "Log Out",
758
831
  type: "adminSecondary",
759
- onClick: t[1] || (t[1] = (l) => n.handleButtonClick(e.button))
832
+ onClick: t[1] || (t[1] = (s) => a.handleButtonClick(e.button))
760
833
  })
761
834
  ])
762
835
  ])
763
836
  ]);
764
837
  }
765
- const Se = /* @__PURE__ */ A(fe, [["render", Qe]]);
838
+ const qe = /* @__PURE__ */ g(Qe, [["render", Me]]);
766
839
  export {
767
- Se as AdminLeftMenu,
768
- _ as BaseButton,
769
- M as BaseInput,
840
+ qe as AdminLeftMenu,
841
+ C as BaseButton,
842
+ I as BaseInput,
770
843
  W as BaseTag,
771
- b as BaseText,
772
- ie as DropDownMenu,
773
- me as FilterAndSortBar,
774
- Ee as GridContainer,
775
- te as TournamentCard,
776
- Z as TournamentCardDetails,
777
- F as TournamentCardHeader
844
+ y as BaseText,
845
+ Q as DropDownMenu,
846
+ Ae as FilterAndSortBar,
847
+ Ue as GridContainer,
848
+ re as TournamentCard,
849
+ R as TournamentCardDetails,
850
+ J as TournamentCardHeader
778
851
  };
@@ -1 +1 @@
1
- (function(c,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(c=typeof globalThis<"u"?globalThis:c||self,e(c.HemaTournamentUI={},c.Vue))})(this,function(c,e){"use strict";const d=(t,r)=>{const a=t.__vccOpts||t;for(const[s,i]of r)a[s]=i;return a},k={name:"BaseInput",props:{placeholder:{type:String,default:""},value:{type:String,default:""}},data(){return{internalValue:this.value,timeout:null}},watch:{value(t){this.internalValue=t}},methods:{onInput(){clearTimeout(this.timeout),this.timeout=setTimeout(()=>{console.log("this.internalValue",this.internalValue),this.$emit("update:value",this.internalValue)},300)}}},C=["placeholder"];function w(t,r,a,s,i,l){return e.withDirectives((e.openBlock(),e.createElementBlock("input",{class:"appearance-none focus:outline-none w-full text-sm",placeholder:a.placeholder,"onUpdate:modelValue":r[0]||(r[0]=n=>i.internalValue=n),onInput:r[1]||(r[1]=(...n)=>l.onInput&&l.onInput(...n))},null,40,C)),[[e.vModelText,i.internalValue]])}const B=d(k,[["render",w]]),_={name:"BaseText",props:{text:{type:String,required:!0,default:""},weight:{type:String,default:"normal",validator:function(t){return["light","normal","medium","semi-bold","bold","extra-bold"].indexOf(t)!==-1}},size:{type:String,default:"small",validator:function(t){return["xs","sm","md","lg","xl","2xl","3xl"].indexOf(t)!==-1}},color:{type:String,default:"primary",validator:function(t){return["neutral","quaternary","tertiary","secondary","primary","bright","primaryHighlight"].indexOf(t)!==-1}},hoverColor:{type:String,default:"none",validator:function(t){return["primary","secondary","tertiary","quaternary","neutral","bright","none"].indexOf(t)!==-1}}},setup(t){return t=e.reactive(t),{classes:e.computed(()=>{let r="inline-block font-sans";switch(t.color){case"neutral":r+=" text-neutral";break;case"tertiary":r+=" text-tertiary";break;case"secondary":r+=" text-secondary";break;case"quaternary":r+=" text-quaternary";break;case"primary":r+=" text-primary";break;case"primaryHighlight":r+=" text-primaryHighlight";break;case"bright":r+=" text-bright";break}switch(t.hoverColor){case"neutral":r+=" hover:text-neutral";break;case"tertiary":r+=" hover:text-tertiary";break;case"secondary":r+=" hover:text-secondary";break;case"quaternary":r+=" hover:text-quaternary";break;case"primary":r+=" hover:text-primary";break;case"bright":r+=" hover:text-bright";break;case"none":r+="";break}switch(t.weight){case"light":r+=" font-light";break;case"normal":r+=" font-normal";break;case"medium":r+=" font-medium";break;case"semi-bold":r+=" font-semibold";break;case"bold":r+=" font-bold";break;case"extra-bold":r+=" font-extrabold";break}switch(t.size){case"xs":r+=" text-xs";break;case"sm":r+=" text-sm";break;case"md":r+=" text-md";break;case"lg":r+=" text-lg";break;case"xl":r+=" text-xl";break;case"2xl":r+=" text-2xl";break;case"3xl":r+=" text-3xl";break;default:r+=" text-sm";break}return r})}}};function I(t,r,a,s,i,l){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(s.classes)},e.toDisplayString(a.text),3)}const m=d(_,[["render",I]]),E={name:"base-button",components:{BaseText:m},props:{label:{type:String,required:!0},iconClass:{type:String,default:null},size:{type:String,validator:function(t){return["xs","sm","md","lg","xl"].indexOf(t)!==-1},default:"sm"},type:{type:String,default:"primary",validator:function(t){return["primary","secondary","tertiary","bright","admin","adminSecondary"].indexOf(t)!==-1}},selected:{type:Boolean,default:!1}},emits:["click"],setup(t,{emit:r}){return t=e.reactive(t),{textColor:e.computed(()=>{switch(t.type){case"primary":return"primary";case"secondary":return"secondary";case"tertiary":return"tertiary";case"bright":return"bright";case"admin":return"neutral";case"adminSecondary":return"neutral"}}),classes:e.computed(()=>{let a="px-2.5 mx-1 inline-flex ";switch(t.type){case"primary":a+=" py-0.5 items-center gap-2.5 rounded-md text-center shadow border border-dropdownSelect justify-center hover:bg-tertiary",t.selected?a+=" bg-dropdownSelect":a+=" bg-neutral";break;case"secondary":a+=" py-0.5 items-center gap-2.5 rounded-md text-center shadow justify-center hover:bg-primary text-neutral",t.selected?a+=" bg-dropdownSelect":a+=" bg-secondary";break;case"tertiary":a+=" py-0.5 items-center gap-2.5 rounded-md text-center justify-center hover:bg-primary text-primary",t.selected?a+=" bg-primary":a+=" bg-tertiary";break;case"bright":a+=" py-0.5 items-center gap-2.5 rounded-md text-center justify-center hover:bg-primary text-neutral",t.selected?a+=" bg-primary":a+=" bg-bright";break;case"admin":a+=" py-2 items-center rounded-md gap-2.5 text-center hover:bg-primary my-1 text-neutral hover:bg-primaryHighlight",t.selected,a+=" bg-primary";break;case"adminSecondary":a+=" py-0.5 items-center gap-2.5 text-center my-1 pb-0.5 border-b border-secondary hover:border-b hover:border-neutral w-11/12 text-neutral",t.selected?a+=" bg-primary":a+=" bg-tertiary";break}switch(t.size){case"xs":a+=" text-xs";break;case"sm":a+=" text-sm";break;case"md":a+=" text-md";break;case"lg":a+=" text-lg";break;case"xl":a+=" text-xl";break}return a}),onClick(){console.log("Click!"),r("click")}}}};function Q(t,r,a,s,i,l){const n=e.resolveComponent("BaseText");return e.openBlock(),e.createElementBlock("button",{"data-testid":"base-button",class:e.normalizeClass(s.classes),type:"button",onClick:r[0]||(r[0]=(...o)=>s.onClick&&s.onClick(...o))},[a.iconClass?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass([a.iconClass,"mr-2 hover:text-highlightedClass"])},null,2)):e.createCommentVNode("",!0),e.createVNode(n,{"data-testid":"base-text",color:s.textColor,size:a.size,text:a.label,weight:"normal"},null,8,["color","size","text"])],2)}const A=d(E,[["render",Q]]),D={name:"base-tag",props:{label:{type:String,required:!0},backgroundColor:{type:String,validator:function(t){return["primary","secondary","tertiary","neutral","bright"].indexOf(t)!==-1}}},setup(t){return t=e.reactive(t),{classes:e.computed(()=>{let r="cursor-pointer inline-block py-1 px-3 my-2 ml-3 text-xs font-normal rounded-full text-neutral";switch(t.backgroundColor){case"primary":r+=" bg-primary";break;case"secondary":r+=" bg-secondary";break;case"tertiary":r+=" bg-tertiary";break;case"neutral":r+=" bg-neutral";break;case"bright":r+=" bg-bright";break;default:r+=" bg-primary";break}return r})}}};function V(t,r,a,s,i,l){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(s.classes)},e.toDisplayString(a.label),3)}const y=d(D,[["render",V]]),h="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAADICAYAAABS39xVAAAAAXNSR0IArs4c6QAABdlJREFUeF7t1AEJACAQBEGNaiOzWkDBFgvzCY655+ba5w5HgACBgMA0WIGWRCRA4AsYLI9AgEBGwGBlqhKU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GD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBB4p/0F3nyMcxwAAAABJRU5ErkJggg==",S={name:"tournament-card-header",components:{BaseTag:y},props:{artwork:{type:String,required:!0,default:h},tags:{type:Array,default:()=>[]}},computed:{backgroundStyle(){return`background-image: url('${this.artwork||h}');`}}},Y={class:"rounded-t-xl w-full"},M={class:"flex flex-row"};function G(t,r,a,s,i,l){const n=e.resolveComponent("BaseTag");return e.openBlock(),e.createElementBlock("div",Y,[e.createElementVNode("div",{style:e.normalizeStyle(l.backgroundStyle),class:"h-36 w-full flex flex-col justify-end rounded-t-xl bg-cover bg-no-repeat bg-center"},[e.createElementVNode("div",M,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tags,o=>(e.openBlock(),e.createBlock(n,{key:o,label:o},null,8,["label"]))),128))])],4)])}const p=d(S,[["render",G]]),q={name:"tournament-card-details",components:{BaseButton:A,BaseText:m},props:{detail:{type:Object,required:!0,default:()=>({name:"",date:"",closes:"",location:""})}}},U={class:"flex flex-col w-full pt-4 pb-3 px-3"},N={class:"mt-4 flex flex-col"},T={class:"flex flex-row w-full justify-end"};function $(t,r,a,s,i,l){const n=e.resolveComponent("BaseText"),o=e.resolveComponent("BaseButton");return e.openBlock(),e.createElementBlock("div",U,[e.createVNode(n,{text:a.detail.name,color:"primary",size:"xl",weight:"semi-bold"},null,8,["text"]),e.createVNode(n,{text:a.detail.location,color:"primary",size:"sm",weight:"normal"},null,8,["text"]),e.createElementVNode("div",N,[e.createVNode(n,{text:`${a.detail.date}`,color:"primaryHighlight",size:"sm",weight:"light"},null,8,["text"]),e.createVNode(n,{text:`${a.detail.closes}`,color:"primaryHighlight",size:"sm",weight:"light"},null,8,["text"])]),e.createElementVNode("div",T,[e.createVNode(o,{label:"Edit",class:"mt-2",primary:""})])])}const u=d(q,[["render",$]]),W={name:"TournamentCard",components:{TournamentHeader:p,TournamentDetail:u},props:{detail:{type:Object,required:!0,default:()=>({artwork:"",tags:[],name:"",description:"",date:"",closes:"",location:""})}}},K={class:"rounded-xl w-72 shadow"};function H(t,r,a,s,i,l){const n=e.resolveComponent("TournamentHeader"),o=e.resolveComponent("TournamentDetail");return e.openBlock(),e.createElementBlock("div",K,[e.createVNode(n,{artwork:a.detail.artwork,tags:a.detail.tags},null,8,["artwork","tags"]),e.createVNode(o,{detail:a.detail},null,8,["detail"])])}const b=d(W,[["render",H]]),F={name:"DropDownMenu",components:{BaseText:m},props:{label:{type:String},items:{type:Array,validator:t=>t.every(r=>typeof r.text=="string")},selectedItem:{type:Object,default:()=>({text:""}),validator:t=>typeof t.text=="string"}},data:()=>({isDropDownOpen:!1}),methods:{handleClick(t){this.isDropDownOpen=!1,this.$emit("update:selectedItem",t)},handleDropDown(){this.isDropDownOpen=!this.isDropDownOpen}}},j={class:"flex flex-row"},J=e.createElementVNode("i",{class:"fa-solid fa-chevron-down text-xs"},null,-1),L={key:0,class:"flex flex-col w-32 shadow mt-2 z-10 rounded-xl py-1 absolute bg-neutral"},O=["onClick"];function P(t,r,a,s,i,l){const n=e.resolveComponent("BaseText");return e.openBlock(),e.createElementBlock("div",j,[e.createElementVNode("span",null,[e.createElementVNode("div",{class:"z-10 rounded-lg shadow px-2 py-2 w-32 flex flex-row justify-between",onClick:r[0]||(r[0]=o=>l.handleDropDown())},[e.createVNode(n,{text:a.label,color:"quaternary",size:"sm",weight:"normal"},null,8,["text"]),e.createVNode(n,{text:a.selectedItem.text,color:"secondary",size:"sm",weight:"normal"},null,8,["text"]),J]),t.isDropDownOpen?(e.openBlock(),e.createElementBlock("div",L,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.items,o=>(e.openBlock(),e.createElementBlock("a",{key:o.id,onClick:g=>l.handleClick(o),class:"hover:bg-dropdownSelect py-1 px-2 border-b border-dropdownSelect last:border-0"},[e.createVNode(n,{text:o.text,color:"primary",size:"xs",weight:"normal"},null,8,["text"])],8,O))),128))])):e.createCommentVNode("",!0)])])}const x=d(F,[["render",P]]),z={name:"FilterAndSortBar",components:{DropDownMenu:x,BaseInput:B},data(){return{filterText:""}},props:{label:{type:String},items:{type:Array,default:()=>[]},selectedItem:null},methods:{handleFilter(t){this.$emit("filterbar",t)},handleSelectedItem(t){this.$emit("sort",t),console.log("handleSelectedItem",t)}}},Z={class:"flex flex-row w-full justify-between"},R={class:"rounded-lg shadow px-2 py-1 w-full flex flex-row mt-0.5 mr-4"},X=e.createElementVNode("i",{class:"fa-solid fa-magnifying-glass text-primaryHighlight w-6 mt-1"},null,-1);function v(t,r,a,s,i,l){const n=e.resolveComponent("BaseInput"),o=e.resolveComponent("DropDownMenu");return e.openBlock(),e.createElementBlock("section",Z,[e.createElementVNode("div",R,[X,e.createVNode(n,{placeholder:"Search on Name, Location, or Date",class:"text-quaternary",value:i.filterText,"onUpdate:value":l.handleFilter},null,8,["value","onUpdate:value"])]),e.createElementVNode("div",null,[e.createVNode(o,{label:a.label,items:a.items,selectedItem:a.selectedItem,"onUpdate:selectedItem":l.handleSelectedItem},null,8,["label","items","selectedItem","onUpdate:selectedItem"])])])}const f=d(z,[["render",v]]),ee={name:"GridContainer",components:{FilterAndSortBar:f,BaseText:m,TournamentCard:b},props:{items:{type:Array,default:()=>[]},component:{type:String,required:!0},label:{type:String},dropdownItems:{type:Array,default:()=>[]},selectedItem:null},data(){return{filterOn:"",sortCriteria:"Date"}},computed:{filteredItems(){let t=this.items;if(this.filterOn.trim()){const r=this.filterOn.toLowerCase();t=t.filter(a=>Object.values(a).some(s=>typeof s=="string"&&s.toLowerCase().includes(r)))}switch(this.sortCriteria){case"Date":t=[...t].sort((r,a)=>new Date(r.date)-new Date(a.date));break;case"Name":t=[...t].sort((r,a)=>r.name.localeCompare(a.name));break;case"Location":t=[...t].sort((r,a)=>r.location.localeCompare(a.location));break}return t}},methods:{handleFilter(t){this.filterOn=t},handleSort(t){this.sortCriteria=t.text}}},te={class:"border border-dropdownSelect rounded-lg p-9 bg-neutral"},re={class:"w-full text-center mb-9"},ae={class:"my-4"},ne={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 3xl:grid-cols-4 gap-6 w-full"};function le(t,r,a,s,i,l){const n=e.resolveComponent("BaseText"),o=e.resolveComponent("FilterAndSortBar");return e.openBlock(),e.createElementBlock("div",te,[e.createElementVNode("h1",re,[e.createVNode(n,{color:"primaryHighlight",size:"2xl",text:"Upcoming Tournaments",weight:"normal"})]),e.createElementVNode("div",ae,[e.createVNode(o,{items:a.dropdownItems,label:a.label,selectedItem:a.selectedItem,onFilterbar:l.handleFilter,onSort:l.handleSort},null,8,["items","label","selectedItem","onFilterbar","onSort"])]),e.createElementVNode("div",ne,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.filteredItems,g=>(e.openBlock(),e.createElementBlock("div",{key:g.id},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a.component),{detail:g},null,8,["detail"]))]))),128))])])}const oe=d(ee,[["render",le]]),se={name:"AdminLeftMenu",components:{BaseButton:A},props:{buttons:{type:Array,default:()=>[]}},methods:{handleButtonClick(t){this.$emit("button-click",t)}}},ce={class:"bg-secondary w-64 h-screen flex flex-col justify-between"},ie=e.createElementVNode("section",{class:"h-28 border-b border-neutral"},[e.createElementVNode("div",{class:"flex flex-col justify-center h-28"},[e.createElementVNode("div",{class:"ml-8"},[e.createElementVNode("img",{class:"w-32",src:"https://ferrotas.com/assets/ferrotas-white-small-720502db.png",alt:"logo"})])])],-1),de={class:"flex flex-col p-2 h-full"},me={class:"flex flex-col justify-end p-2 flex-grow"},ge={class:"border-t border-neutral pt-2"};function Ae(t,r,a,s,i,l){const n=e.resolveComponent("BaseButton");return e.openBlock(),e.createElementBlock("div",ce,[ie,e.createElementVNode("section",de,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.buttons,o=>(e.openBlock(),e.createBlock(n,{label:o.label,iconClass:"fa-solid fa-trophy text-white",type:"admin",hover:"admin",onClick:g=>l.handleButtonClick(o)},null,8,["label","onClick"]))),256))]),e.createElementVNode("section",me,[e.createElementVNode("div",ge,[e.createVNode(n,{iconClass:"fa-solid fa-circle-user text-textSecondary",label:"Account",type:"adminSecondary",onClick:r[0]||(r[0]=o=>l.handleButtonClick(t.button))}),e.createVNode(n,{iconClass:"fa-solid fa-right-to-bracket fa-rotate-180 text-textSecondary",label:"Log Out",type:"adminSecondary",onClick:r[1]||(r[1]=o=>l.handleButtonClick(t.button))})])])])}const Be=d(se,[["render",Ae]]);c.AdminLeftMenu=Be,c.BaseButton=A,c.BaseInput=B,c.BaseTag=y,c.BaseText=m,c.DropDownMenu=x,c.FilterAndSortBar=f,c.GridContainer=oe,c.TournamentCard=b,c.TournamentCardDetails=u,c.TournamentCardHeader=p,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
1
+ (function(i,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(i=typeof globalThis<"u"?globalThis:i||self,e(i.HemaTournamentUI={},i.Vue))})(this,function(i,e){"use strict";const d=(t,r)=>{const n=t.__vccOpts||t;for(const[o,c]of r)n[o]=c;return n},k={name:"BaseInput",props:{placeholder:{type:String,default:""},value:{type:String,default:""}},data(){return{internalValue:this.value,timeout:null}},watch:{value(t){this.internalValue=t}},methods:{onInput(){clearTimeout(this.timeout),this.timeout=setTimeout(()=>{console.log("this.internalValue",this.internalValue),this.$emit("update:value",this.internalValue)},300)}}},C=["placeholder"];function w(t,r,n,o,c,a){return e.withDirectives((e.openBlock(),e.createElementBlock("input",{class:"appearance-none focus:outline-none w-full text-sm",placeholder:n.placeholder,"onUpdate:modelValue":r[0]||(r[0]=l=>c.internalValue=l),onInput:r[1]||(r[1]=(...l)=>a.onInput&&a.onInput(...l))},null,40,C)),[[e.vModelText,c.internalValue]])}const B=d(k,[["render",w]]),_={name:"BaseText",props:{text:{type:String,required:!0,default:""},weight:{type:String,default:"normal",validator:function(t){return["light","normal","medium","semi-bold","bold","extra-bold"].indexOf(t)!==-1}},size:{type:String,default:"small",validator:function(t){return["xs","sm","md","lg","xl","2xl","3xl"].indexOf(t)!==-1}},color:{type:String,default:"primary",validator:function(t){return["neutral","quaternary","tertiary","secondary","primary","bright","primaryHighlight"].indexOf(t)!==-1}},hoverColor:{type:String,default:"none",validator:function(t){return["primary","secondary","tertiary","quaternary","neutral","bright","none"].indexOf(t)!==-1}}},setup(t){return t=e.reactive(t),{classes:e.computed(()=>{let r="inline-block font-sans";switch(t.color){case"neutral":r+=" text-neutral";break;case"tertiary":r+=" text-tertiary";break;case"secondary":r+=" text-secondary";break;case"quaternary":r+=" text-quaternary";break;case"primary":r+=" text-primary";break;case"primaryHighlight":r+=" text-primaryHighlight";break;case"bright":r+=" text-bright";break}switch(t.hoverColor){case"neutral":r+=" hover:text-neutral";break;case"tertiary":r+=" hover:text-tertiary";break;case"secondary":r+=" hover:text-secondary";break;case"quaternary":r+=" hover:text-quaternary";break;case"primary":r+=" hover:text-primary";break;case"bright":r+=" hover:text-bright";break;case"none":r+="";break}switch(t.weight){case"light":r+=" font-light";break;case"normal":r+=" font-normal";break;case"medium":r+=" font-medium";break;case"semi-bold":r+=" font-semibold";break;case"bold":r+=" font-bold";break;case"extra-bold":r+=" font-extrabold";break}switch(t.size){case"xs":r+=" text-xs";break;case"sm":r+=" text-sm";break;case"md":r+=" text-md";break;case"lg":r+=" text-lg";break;case"xl":r+=" text-xl";break;case"2xl":r+=" text-2xl";break;case"3xl":r+=" text-3xl";break;default:r+=" text-sm";break}return r})}}};function E(t,r,n,o,c,a){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(o.classes)},e.toDisplayString(n.text),3)}const g=d(_,[["render",E]]),I={name:"base-button",components:{BaseText:g},props:{label:{type:String,required:!0},iconClass:{type:String,default:null},size:{type:String,validator:function(t){return["xs","sm","md","lg","xl"].indexOf(t)!==-1},default:"sm"},type:{type:String,default:"primary",validator:function(t){return["primary","secondary","tertiary","bright","admin","adminSecondary"].indexOf(t)!==-1}},selected:{type:Boolean,default:!1}},emits:["click"],setup(t,{emit:r}){return t=e.reactive(t),{textColor:e.computed(()=>{switch(t.type){case"primary":return"primary";case"secondary":return"secondary";case"tertiary":return"tertiary";case"bright":return"bright";case"admin":return"neutral";case"adminSecondary":return"neutral"}}),classes:e.computed(()=>{let n="px-2.5 mx-1 inline-flex ";switch(t.type){case"primary":n+=" py-0.5 items-center gap-2.5 rounded-md text-center shadow border border-dropdownSelect justify-center hover:bg-tertiary",t.selected?n+=" bg-dropdownSelect":n+=" bg-neutral";break;case"secondary":n+=" py-0.5 items-center gap-2.5 rounded-md text-center shadow justify-center hover:bg-primary text-neutral",t.selected?n+=" bg-dropdownSelect":n+=" bg-secondary";break;case"tertiary":n+=" py-0.5 items-center gap-2.5 rounded-md text-center justify-center hover:bg-primary text-primary",t.selected?n+=" bg-primary":n+=" bg-tertiary";break;case"bright":n+=" py-0.5 items-center gap-2.5 rounded-md text-center justify-center hover:bg-primary text-neutral",t.selected?n+=" bg-primary":n+=" bg-bright";break;case"admin":n+=" py-2 items-center rounded-md gap-2.5 text-center hover:bg-primary my-1 text-neutral hover:bg-primaryHighlight",t.selected,n+=" bg-primary";break;case"adminSecondary":n+=" py-0.5 items-center gap-2.5 text-center my-1 pb-0.5 border-b border-secondary hover:border-b hover:border-neutral w-11/12 text-neutral",t.selected?n+=" bg-primary":n+=" bg-tertiary";break}switch(t.size){case"xs":n+=" text-xs";break;case"sm":n+=" text-sm";break;case"md":n+=" text-md";break;case"lg":n+=" text-lg";break;case"xl":n+=" text-xl";break}return n}),onClick(){r("click")}}}};function Q(t,r,n,o,c,a){const l=e.resolveComponent("BaseText");return e.openBlock(),e.createElementBlock("button",{"data-testid":"base-button",class:e.normalizeClass(o.classes),type:"button",onClick:r[0]||(r[0]=(...s)=>o.onClick&&o.onClick(...s))},[n.iconClass?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass([n.iconClass,"mr-2 hover:text-highlightedClass"])},null,2)):e.createCommentVNode("",!0),e.createVNode(l,{"data-testid":"base-text",color:o.textColor,size:n.size,text:n.label,weight:"normal"},null,8,["color","size","text"])],2)}const A=d(I,[["render",Q]]),D={name:"base-tag",props:{label:{type:String,required:!0},backgroundColor:{type:String,validator:function(t){return["primary","secondary","tertiary","neutral","bright"].indexOf(t)!==-1}}},setup(t){return t=e.reactive(t),{classes:e.computed(()=>{let r="cursor-pointer inline-block py-1 px-3 my-2 ml-3 text-xs font-normal rounded-full text-neutral";switch(t.backgroundColor){case"primary":r+=" bg-primary";break;case"secondary":r+=" bg-secondary";break;case"tertiary":r+=" bg-tertiary";break;case"neutral":r+=" bg-neutral";break;case"bright":r+=" bg-bright";break;default:r+=" bg-primary";break}return r})}}};function V(t,r,n,o,c,a){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(o.classes)},e.toDisplayString(n.label),3)}const p=d(D,[["render",V]]),h="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAADICAYAAABS39xVAAAAAXNSR0IArs4c6QAABdlJREFUeF7t1AEJACAQBEGNaiOzWkDBFgvzCY655+ba5w5HgACBgMA0WIGWRCRA4AsYLI9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5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IEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBB4p/0F3nyMcxwAAAABJRU5ErkJggg==",S={name:"tournament-card-header",components:{BaseTag:p},props:{artwork:{type:String,required:!0,default:h},tags:{type:Array,default:()=>[]}},computed:{backgroundStyle(){return`background-image: url('${this.artwork||h}');`}}},Y={class:"rounded-t-xl w-full"},M={class:"flex flex-row"};function G(t,r,n,o,c,a){const l=e.resolveComponent("BaseTag");return e.openBlock(),e.createElementBlock("div",Y,[e.createElementVNode("div",{style:e.normalizeStyle(a.backgroundStyle),class:"h-36 w-full flex flex-col justify-end rounded-t-xl bg-cover bg-no-repeat bg-center"},[e.createElementVNode("div",M,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.tags,s=>(e.openBlock(),e.createBlock(l,{key:s,label:s},null,8,["label"]))),128))])],4)])}const u=d(S,[["render",G]]),U={name:"tournament-card-details",components:{BaseButton:A,BaseText:g},props:{detail:{type:Object,required:!0,default:()=>({name:"",date:"",closes:"",location:""})}}},q={class:"flex flex-col w-full pt-4 pb-3 px-3"},T={class:"mt-4 flex flex-col"},N={class:"flex flex-row w-full justify-end"};function $(t,r,n,o,c,a){const l=e.resolveComponent("BaseText"),s=e.resolveComponent("BaseButton");return e.openBlock(),e.createElementBlock("div",q,[e.createVNode(l,{text:n.detail.name,color:"primary",size:"xl",weight:"semi-bold"},null,8,["text"]),e.createVNode(l,{text:n.detail.location,color:"primary",size:"sm",weight:"normal"},null,8,["text"]),e.createElementVNode("div",T,[e.createVNode(l,{text:`${n.detail.date}`,color:"primaryHighlight",size:"sm",weight:"light"},null,8,["text"]),e.createVNode(l,{text:`${n.detail.closes}`,color:"primaryHighlight",size:"sm",weight:"light"},null,8,["text"])]),e.createElementVNode("div",N,[e.createVNode(s,{label:"Edit",class:"mt-2",primary:""})])])}const b=d(U,[["render",$]]),F={name:"TournamentCard",components:{TournamentHeader:u,TournamentDetail:b},props:{detail:{type:Object,required:!0,default:()=>({artwork:"",tags:[],name:"",description:"",date:"",closes:"",location:""})}}},W={class:"rounded-xl w-72 shadow"};function K(t,r,n,o,c,a){const l=e.resolveComponent("TournamentHeader"),s=e.resolveComponent("TournamentDetail");return e.openBlock(),e.createElementBlock("div",W,[e.createVNode(l,{artwork:n.detail.artwork,tags:n.detail.tags},null,8,["artwork","tags"]),e.createVNode(s,{detail:n.detail},null,8,["detail"])])}const f=d(F,[["render",K]]),H={name:"DropDownMenu",components:{BaseText:g},props:{label:{type:String},items:{type:Array,validator:t=>t.every(r=>typeof r.text=="string")},selectedItem:{type:Object,default:()=>({text:""}),validator:t=>typeof t.text=="string"}},data:()=>({isDropDownOpen:!1}),methods:{handleClick(t){this.isDropDownOpen=!1,this.$emit("update:selectedItem",t)},handleDropDown(){this.isDropDownOpen=!this.isDropDownOpen}}},P={class:"flex flex-row"},j=e.createElementVNode("i",{class:"fa-solid fa-chevron-down text-xs"},null,-1),J={key:0,class:"flex flex-col w-32 shadow mt-2 z-10 rounded-xl py-1 absolute bg-neutral"},z=["onClick"];function L(t,r,n,o,c,a){const l=e.resolveComponent("BaseText");return e.openBlock(),e.createElementBlock("div",P,[e.createElementVNode("span",null,[e.createElementVNode("div",{class:"z-10 rounded-lg shadow px-2 py-2 w-32 flex flex-row justify-between",onClick:r[0]||(r[0]=s=>a.handleDropDown())},[e.createVNode(l,{text:n.label,color:"quaternary",size:"sm",weight:"normal"},null,8,["text"]),e.createVNode(l,{text:n.selectedItem.text,color:"secondary",size:"sm",weight:"normal"},null,8,["text"]),j]),t.isDropDownOpen?(e.openBlock(),e.createElementBlock("div",J,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.items,s=>(e.openBlock(),e.createElementBlock("a",{key:s.id,onClick:m=>a.handleClick(s),class:"hover:bg-dropdownSelect py-1 px-2 border-b border-dropdownSelect last:border-0"},[e.createVNode(l,{text:s.text,color:"primary",size:"xs",weight:"normal"},null,8,["text"])],8,z))),128))])):e.createCommentVNode("",!0)])])}const y=d(H,[["render",L]]),O={name:"FilterAndSortBar",components:{DropDownMenu:y,BaseInput:B},data(){return{filterText:""}},props:{label:{type:String},items:{type:Array,default:()=>[]},selectedItem:null},methods:{handleFilter(t){this.$emit("filterbar",t)},handleSelectedItem(t){this.$emit("sort",t),console.log("handleSelectedItem",t)}}},Z={class:"flex flex-row w-full justify-between"},R={class:"rounded-lg shadow px-2 py-1 w-full flex flex-row mt-0.5 mr-4"},X=e.createElementVNode("i",{class:"fa-solid fa-magnifying-glass text-primaryHighlight w-6 mt-1"},null,-1);function v(t,r,n,o,c,a){const l=e.resolveComponent("BaseInput"),s=e.resolveComponent("DropDownMenu");return e.openBlock(),e.createElementBlock("section",Z,[e.createElementVNode("div",R,[X,e.createVNode(l,{placeholder:"Search on Name, Location, or Date",class:"text-quaternary",value:c.filterText,"onUpdate:value":a.handleFilter},null,8,["value","onUpdate:value"])]),e.createElementVNode("div",null,[e.createVNode(s,{label:n.label,items:n.items,selectedItem:n.selectedItem,"onUpdate:selectedItem":a.handleSelectedItem},null,8,["label","items","selectedItem","onUpdate:selectedItem"])])])}const x=d(O,[["render",v]]),ee={name:"FilterUpcomingPast",components:{BaseText:g,BaseButton:A,DropDownMenu:y,BaseInput:B},props:{selected:{type:String,default:"All"}},data(){return{localSelected:this.selected}},methods:{handleTimeFrame(t){this.$emit("timeFrame",t),this.localSelected=t}}},te={class:"flex flex-row w-full justify-between"},re={class:"rounded-lg w-3/4"},ne={class:"flex flex-row h-8 w-1/4 justify-end"};function ae(t,r,n,o,c,a){const l=e.resolveComponent("BaseText"),s=e.resolveComponent("BaseButton");return e.openBlock(),e.createElementBlock("section",te,[e.createElementVNode("div",re,[e.createVNode(l,{text:"Tournament",color:"primary",size:"2xl",weight:"normal"})]),e.createElementVNode("div",ne,[e.createVNode(s,{label:"All",color:"primary",size:"sm",selected:c.localSelected==="All",onClick:r[0]||(r[0]=m=>a.handleTimeFrame("ALL"))},null,8,["selected"]),e.createVNode(s,{label:"Upcoming",color:"primary",size:"sm",selected:c.localSelected==="Upcoming",onClick:r[1]||(r[1]=m=>a.handleTimeFrame("Upcoming"))},null,8,["selected"]),e.createVNode(s,{label:"Past",color:"primary",size:"sm",selected:c.localSelected==="Past",onClick:r[2]||(r[2]=m=>a.handleTimeFrame("Past"))},null,8,["selected"])])])}const le={name:"GridContainer",components:{FilterAndSortBar:x,BaseText:g,TournamentCard:f,FilterUpcomingPast:d(ee,[["render",ae]])},props:{items:{type:Array,default:()=>[]},component:{type:String,required:!0},label:{type:String},dropdownItems:{type:Array,default:()=>[]},selectedItem:null},data(){return{filterOn:"",sortCriteria:"Date",selectedTimeFrame:"All"}},computed:{filteredItems(){let t=this.items;if(this.filterOn.trim()){const n=this.filterOn.toLowerCase();t=t.filter(o=>Object.values(o).some(c=>typeof c=="string"&&c.toLowerCase().includes(n)))}const r=new Date;switch(r.setHours(0,0,0,0),this.selectedTimeFrame){case"Upcoming":t=t.filter(n=>new Date(n.date)>=r);break;case"Past":t=t.filter(n=>new Date(n.date)<r);break}switch(this.sortCriteria){case"Date":t=[...t].sort((n,o)=>new Date(n.date)-new Date(o.date));break;case"Name":t=[...t].sort((n,o)=>n.name.localeCompare(o.name));break;case"Location":t=[...t].sort((n,o)=>n.location.localeCompare(o.location));break}return t}},methods:{handleFilter(t){this.filterOn=t},handleSort(t){this.sortCriteria=t.text},handleTimeFrameChange(t){this.selectedTimeFrame=t}}},oe={class:"border border-dropdownSelect rounded-lg p-9 bg-neutral"},se={class:"my-4"},ce={class:"my-4"},ie={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 3xl:grid-cols-4 gap-6 w-full"};function de(t,r,n,o,c,a){const l=e.resolveComponent("FilterUpcomingPast"),s=e.resolveComponent("FilterAndSortBar");return e.openBlock(),e.createElementBlock("div",oe,[e.createElementVNode("div",se,[e.createVNode(l,{selected:c.selectedTimeFrame,onTimeFrame:a.handleTimeFrameChange},null,8,["selected","onTimeFrame"])]),e.createElementVNode("div",ce,[e.createVNode(s,{items:n.dropdownItems,label:n.label,selectedItem:n.selectedItem,onFilterbar:a.handleFilter,onSort:a.handleSort},null,8,["items","label","selectedItem","onFilterbar","onSort"])]),e.createElementVNode("div",ie,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.filteredItems,m=>(e.openBlock(),e.createElementBlock("div",{key:m.id},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.component),{detail:m},null,8,["detail"]))]))),128))])])}const me=d(le,[["render",de]]),ge={name:"AdminLeftMenu",components:{BaseButton:A},props:{buttons:{type:Array,default:()=>[]}},methods:{handleButtonClick(t){this.$emit("button-click",t)}}},Ae={class:"bg-secondary w-64 h-screen flex flex-col justify-between"},Be=e.createElementVNode("section",{class:"h-28 border-b border-neutral"},[e.createElementVNode("div",{class:"flex flex-col justify-center h-28"},[e.createElementVNode("div",{class:"ml-8"},[e.createElementVNode("img",{class:"w-32",src:"https://ferrotas.com/assets/ferrotas-white-small-720502db.png",alt:"logo"})])])],-1),ye={class:"flex flex-col p-2 h-full"},pe={class:"flex flex-col justify-end p-2 flex-grow"},he={class:"border-t border-neutral pt-2"};function ue(t,r,n,o,c,a){const l=e.resolveComponent("BaseButton");return e.openBlock(),e.createElementBlock("div",Ae,[Be,e.createElementVNode("section",ye,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.buttons,s=>(e.openBlock(),e.createBlock(l,{label:s.label,iconClass:"fa-solid fa-trophy text-white",type:"admin",hover:"admin",onClick:m=>a.handleButtonClick(s)},null,8,["label","onClick"]))),256))]),e.createElementVNode("section",pe,[e.createElementVNode("div",he,[e.createVNode(l,{iconClass:"fa-solid fa-circle-user text-textSecondary",label:"Account",type:"adminSecondary",onClick:r[0]||(r[0]=s=>a.handleButtonClick(t.button))}),e.createVNode(l,{iconClass:"fa-solid fa-right-to-bracket fa-rotate-180 text-textSecondary",label:"Log Out",type:"adminSecondary",onClick:r[1]||(r[1]=s=>a.handleButtonClick(t.button))})])])])}const be=d(ge,[["render",ue]]);i.AdminLeftMenu=be,i.BaseButton=A,i.BaseInput=B,i.BaseTag=p,i.BaseText=g,i.DropDownMenu=y,i.FilterAndSortBar=x,i.GridContainer=me,i.TournamentCard=f,i.TournamentCardDetails=b,i.TournamentCardHeader=u,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@dcrackel/hematournamentui",
3
3
  "private": false,
4
- "version": "1.0.4",
4
+ "version": "1.0.5",
5
5
  "type": "module",
6
6
  "main": "dist/my-library.umd.js",
7
7
  "module": "dist/my-library.es.js",
8
8
  "scripts": {
9
9
  "dev": "vite",
10
- "build": "vite build",
10
+ "build": "npm version patch && vite build",
11
11
  "publish:package": "npm publish",
12
12
  "preview": "vite preview",
13
13
  "build-storybook": "npm run build:tailwind && storybook build",
@@ -118,7 +118,6 @@ export default {
118
118
  return baseClasses;
119
119
  }),
120
120
  onClick() {
121
- console.log('Click!');
122
121
  emit('click');
123
122
  }
124
123
  };
@@ -1,8 +1,8 @@
1
1
  <template>
2
2
  <div class="border border-dropdownSelect rounded-lg p-9 bg-neutral">
3
- <h1 class="w-full text-center mb-9">
4
- <BaseText color="primaryHighlight" size="2xl" text="Upcoming Tournaments" weight="normal" />
5
- </h1>
3
+ <div class="my-4">
4
+ <FilterUpcomingPast :selected="selectedTimeFrame" @timeFrame="handleTimeFrameChange"/>
5
+ </div>
6
6
  <div class="my-4">
7
7
  <FilterAndSortBar :items="dropdownItems" :label="label" :selectedItem="selectedItem" @filterbar="handleFilter" @sort="handleSort"/>
8
8
  </div>
@@ -20,13 +20,15 @@
20
20
  import BaseText from "../../Base/Text/BaseText.vue";
21
21
  import TournamentCard from "../../Cards/TournamentCard/TournamentCard.vue";
22
22
  import FilterAndSortBar from "../../Filters/FilterAndSortBar/FilterAndSortBar.vue";
23
+ import FilterUpcomingPast from "../../Filters/FilterUpcomingPast/FilterUpcomingPast.vue";
23
24
 
24
25
  export default {
25
26
  name: 'GridContainer',
26
27
  components: {
27
28
  FilterAndSortBar,
28
29
  BaseText,
29
- TournamentCard
30
+ TournamentCard,
31
+ FilterUpcomingPast
30
32
  },
31
33
  props: {
32
34
  items: {
@@ -49,7 +51,8 @@ export default {
49
51
  data() {
50
52
  return {
51
53
  filterOn: '',
52
- sortCriteria: 'Date'
54
+ sortCriteria: 'Date',
55
+ selectedTimeFrame: 'All'
53
56
  };
54
57
  },
55
58
  computed: {
@@ -65,6 +68,17 @@ export default {
65
68
  );
66
69
  }
67
70
 
71
+ const currentDate = new Date();
72
+ currentDate.setHours(0, 0, 0, 0);
73
+ switch (this.selectedTimeFrame) {
74
+ case 'Upcoming':
75
+ result = result.filter(item => new Date(item.date) >= currentDate);
76
+ break;
77
+ case 'Past':
78
+ result = result.filter(item => new Date(item.date) < currentDate);
79
+ break;
80
+ }
81
+
68
82
  switch(this.sortCriteria) {
69
83
  case 'Date':
70
84
  result = [...result].sort((a, b) => new Date(a.date) - new Date(b.date));
@@ -85,6 +99,9 @@ export default {
85
99
  },
86
100
  handleSort(criteria) {
87
101
  this.sortCriteria = criteria.text;
102
+ },
103
+ handleTimeFrameChange(timeFrame) {
104
+ this.selectedTimeFrame = timeFrame;
88
105
  }
89
106
  }
90
107
  };
@@ -4,9 +4,9 @@
4
4
  <BaseText text="Tournament" color="primary" size="2xl" weight="normal" />
5
5
  </div>
6
6
  <div class="flex flex-row h-8 w-1/4 justify-end">
7
- <BaseButton label="All" color="primary" size="sm" :selected="selected === 'All'" @click="handleTimeFrame('ALL')" />
8
- <BaseButton label="Upcoming" color="primary" size="sm" :selected="selected === 'Upcoming'" @click="handleTimeFrame('Upcoming')" />
9
- <BaseButton label="Past" color="primary" size="sm" :selected="selected === 'Past'" @click="handleTimeFrame('Past')" />
7
+ <BaseButton label="All" color="primary" size="sm" :selected="localSelected === 'All'" @click="handleTimeFrame('ALL')" />
8
+ <BaseButton label="Upcoming" color="primary" size="sm" :selected="localSelected === 'Upcoming'" @click="handleTimeFrame('Upcoming')" />
9
+ <BaseButton label="Past" color="primary" size="sm" :selected="localSelected === 'Past'" @click="handleTimeFrame('Past')" />
10
10
  </div>
11
11
  </section>
12
12
  </template>
@@ -31,9 +31,15 @@ export default {
31
31
  default: 'All'
32
32
  }
33
33
  },
34
+ data() {
35
+ return {
36
+ localSelected: this.selected
37
+ };
38
+ },
34
39
  methods: {
35
40
  handleTimeFrame(timeFrame) {
36
41
  this.$emit('timeFrame', timeFrame)
42
+ this.localSelected = timeFrame
37
43
  }
38
44
  }
39
45
  };