heroes-of-chess-components 0.6.64 → 0.6.68

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.
@@ -81,6 +81,9 @@ function HocComponentsPlayground() {
81
81
  }, {
82
82
  header: "CO",
83
83
  accessorKey: "tournamentScore.acg-co"
84
+ }, {
85
+ header: "ST",
86
+ accessorKey: "tournamentScore.acg-st"
84
87
  }];
85
88
  var custtt = [{
86
89
  _id: "68b6f53475ad990eaa8cd3e0",
@@ -93,6 +96,7 @@ function HocComponentsPlayground() {
93
96
  cc: 9,
94
97
  bh: 0,
95
98
  "acg-co": 3,
99
+ "acg-st": 0,
96
100
  "aog-ch": 0,
97
101
  "aog-da": 0,
98
102
  "aog-ot": 0,
@@ -72,7 +72,8 @@ var ClientCalendarComponent = function ClientCalendarComponent(_ref2) {
72
72
  dataChangeClass = _ref2.dataChangeClass,
73
73
  masterKey = _ref2.masterKey,
74
74
  masterConsole = _ref2.masterConsole,
75
- setCalendarValidations = _ref2.setCalendarValidations;
75
+ setCalendarValidations = _ref2.setCalendarValidations,
76
+ firstTime = _ref2.firstTime;
76
77
  var _useBooking = useBooking(),
77
78
  getParticipantsCount = _useBooking.getParticipantsCount,
78
79
  checkDisabled = _useBooking.checkDisabled,
@@ -120,6 +121,22 @@ var ClientCalendarComponent = function ClientCalendarComponent(_ref2) {
120
121
  });
121
122
  return;
122
123
  }
124
+ // 🔥 Validar disponibilidad de specialChildren para clases de test (firstTime)
125
+ if (!masterConsole && firstTime) {
126
+ var _groupInfo$dataDays, _dataDayForSelectedDa;
127
+ var dataDayForSelectedDay = groupInfo === null || groupInfo === void 0 || (_groupInfo$dataDays = groupInfo.dataDays) === null || _groupInfo$dataDays === void 0 ? void 0 : _groupInfo$dataDays.find(function (d) {
128
+ return d.dayNumber === dayOfMonth;
129
+ });
130
+ var specialChildrenCount = (dataDayForSelectedDay === null || dataDayForSelectedDay === void 0 || (_dataDayForSelectedDa = dataDayForSelectedDay.specialChildren) === null || _dataDayForSelectedDa === void 0 ? void 0 : _dataDayForSelectedDa.length) || 0;
131
+ var specialChildrenCapacity = (dataDayForSelectedDay === null || dataDayForSelectedDay === void 0 ? void 0 : dataDayForSelectedDay.specialChildrenCapacity) || 3;
132
+ if (specialChildrenCount >= specialChildrenCapacity) {
133
+ HPopUp({
134
+ type: "info",
135
+ message: "Non ci sono più posti disponibili per la lezione di prova in questo giorno."
136
+ });
137
+ return;
138
+ }
139
+ }
123
140
  if (available !== null && available !== void 0 && available.alertMessage) {
124
141
  HPopUp({
125
142
  type: "info",
@@ -144,7 +161,8 @@ var ClientCalendarComponent = function ClientCalendarComponent(_ref2) {
144
161
  groupInfo: groupInfo,
145
162
  participantsCount: participantsCount,
146
163
  dayOfMonth: dayOfMonth,
147
- timezone: TIMEZONE
164
+ timezone: TIMEZONE,
165
+ firstTime: firstTime
148
166
  });
149
167
  setCalendarValidations(validations);
150
168
  }
@@ -6,7 +6,7 @@
6
6
  * @returns {Object} - Objeto con las validaciones capturadas
7
7
  */
8
8
  export function captureCalendarValidations(_ref) {
9
- var _groupInfo$specialChi, _groupInfo$changedChi;
9
+ var _groupInfo$dataDays, _dataDayForSelectedDa, _groupInfo$specialChi, _groupInfo$changedChi;
10
10
  var available = _ref.available,
11
11
  isPast = _ref.isPast,
12
12
  festive = _ref.festive,
@@ -14,7 +14,15 @@ export function captureCalendarValidations(_ref) {
14
14
  groupInfo = _ref.groupInfo,
15
15
  participantsCount = _ref.participantsCount,
16
16
  dayOfMonth = _ref.dayOfMonth,
17
- timezone = _ref.timezone;
17
+ timezone = _ref.timezone,
18
+ firstTime = _ref.firstTime;
19
+ // 🔥 Validar disponibilidad de specialChildren para clases de test
20
+ var dataDayForSelectedDay = groupInfo === null || groupInfo === void 0 || (_groupInfo$dataDays = groupInfo.dataDays) === null || _groupInfo$dataDays === void 0 ? void 0 : _groupInfo$dataDays.find(function (d) {
21
+ return d.dayNumber === dayOfMonth;
22
+ });
23
+ var specialChildrenCount = (dataDayForSelectedDay === null || dataDayForSelectedDay === void 0 || (_dataDayForSelectedDa = dataDayForSelectedDay.specialChildren) === null || _dataDayForSelectedDa === void 0 ? void 0 : _dataDayForSelectedDa.length) || 0;
24
+ var specialChildrenCapacity = (dataDayForSelectedDay === null || dataDayForSelectedDay === void 0 ? void 0 : dataDayForSelectedDay.specialChildrenCapacity) || 3;
25
+ var hasSpecialChildrenSpace = specialChildrenCount < specialChildrenCapacity;
18
26
  return {
19
27
  checkDisabled: {
20
28
  allowed: (available === null || available === void 0 ? void 0 : available.allowed) || false,
@@ -53,6 +61,14 @@ export function captureCalendarValidations(_ref) {
53
61
  });
54
62
  })) === null || _groupInfo$changedChi === void 0 ? void 0 : _groupInfo$changedChi.length) || 0,
55
63
  isFull: participantsCount >= ((groupInfo === null || groupInfo === void 0 ? void 0 : groupInfo.childrenCapacity) || 0)
64
+ },
65
+ // 🔥 Nueva validación para specialChildren (clases de test)
66
+ specialChildrenAvailability: {
67
+ passed: firstTime ? hasSpecialChildrenSpace : true,
68
+ currentCount: specialChildrenCount,
69
+ maxCapacity: specialChildrenCapacity,
70
+ hasSpace: hasSpecialChildrenSpace,
71
+ isTestClass: !!firstTime
56
72
  }
57
73
  };
58
74
  }
@@ -5,6 +5,7 @@ import tournamentChess from "../../assets/tournament/chess.png";
5
5
  import bughouse from "../../assets/tournament/bughouse.svg";
6
6
  import coordinate from "../../assets/tournament/coordinate.svg";
7
7
  import frameTable from "../../assets/tournament/frameTable.png";
8
+ import storm from "../../assets/groupRanking/stormIcon.svg";
8
9
  import timerTournament from "../../assets/tournament/timerTournament.png";
9
10
  import type {
10
11
  Player,
@@ -205,6 +206,7 @@ export function useTournament(): UseTournamentReturn {
205
206
  if (turnType === "cc") return tournamentChess;
206
207
  if (turnType === "bh") return bughouse;
207
208
  if (turnType === "acg-co") return coordinate;
209
+ if (turnType === "acg-st") return storm;
208
210
  if (turnType.startsWith("aog")) {
209
211
  const gameCode = turnType.replace("aog-", "");
210
212
  return AllPhysicGames.find((g) => g.tournament === gameCode)?.img || null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "heroes-of-chess-components",
3
- "version": "0.6.64",
3
+ "version": "0.6.68",
4
4
  "description": "Reusable React Components for Heroes of Chess Apps",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",