heroes-of-chess-components 0.6.70 → 0.6.72

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.
@@ -130,6 +130,15 @@ var ClientCalendarComponent = function ClientCalendarComponent(_ref2) {
130
130
  var specialChildrenCount = (dataDayForSelectedDay === null || dataDayForSelectedDay === void 0 || (_dataDayForSelectedDa = dataDayForSelectedDay.specialChildren) === null || _dataDayForSelectedDa === void 0 ? void 0 : _dataDayForSelectedDa.length) || 0;
131
131
  var specialChildrenCapacity = (dataDayForSelectedDay === null || dataDayForSelectedDay === void 0 ? void 0 : dataDayForSelectedDay.specialChildrenCapacity) || 3;
132
132
 
133
+ // Verificar límite máximo de 5 para specialChildren
134
+ if (specialChildrenCount >= 5) {
135
+ HPopUp({
136
+ type: "info",
137
+ message: "Non ci sono più posti disponibili per la lezione di prova in questo giorno."
138
+ });
139
+ return;
140
+ }
141
+
133
142
  // Verificar si hay espacio en children como fallback
134
143
  var childrenCount = ((dataDayForSelectedDay === null || dataDayForSelectedDay === void 0 ? void 0 : dataDayForSelectedDay.children) || []).filter(function (child) {
135
144
  return !(child !== null && child !== void 0 && child.changed);
@@ -24,6 +24,9 @@ export function captureCalendarValidations(_ref) {
24
24
  var specialChildrenCapacity = (dataDayForSelectedDay === null || dataDayForSelectedDay === void 0 ? void 0 : dataDayForSelectedDay.specialChildrenCapacity) || 3;
25
25
  var hasSpecialChildrenSpace = specialChildrenCount < specialChildrenCapacity;
26
26
 
27
+ // 🔥 Verificar límite máximo de 5 para specialChildren
28
+ var hasReachedMaxLimit = specialChildrenCount >= 5;
29
+
27
30
  // 🔥 Validar si hay espacio en children como fallback
28
31
  var childrenCount = ((dataDayForSelectedDay === null || dataDayForSelectedDay === void 0 ? void 0 : dataDayForSelectedDay.children) || []).filter(function (child) {
29
32
  return !(child !== null && child !== void 0 && child.changed);
@@ -31,8 +34,8 @@ export function captureCalendarValidations(_ref) {
31
34
  var childrenCapacity = (dataDayForSelectedDay === null || dataDayForSelectedDay === void 0 ? void 0 : dataDayForSelectedDay.childrenCapacity) || 17;
32
35
  var hasChildrenSpaceForFallback = childrenCount < childrenCapacity;
33
36
 
34
- // 🔥 Calcular si hay espacio disponible considerando el fallback
35
- var hasSpaceAvailable = hasSpecialChildrenSpace || hasChildrenSpaceForFallback;
37
+ // 🔥 Calcular si hay espacio disponible considerando el fallback y el límite máximo
38
+ var hasSpaceAvailable = !hasReachedMaxLimit && (hasSpecialChildrenSpace || hasChildrenSpaceForFallback);
36
39
  return {
37
40
  checkDisabled: {
38
41
  allowed: (available === null || available === void 0 ? void 0 : available.allowed) || false,
@@ -77,9 +80,11 @@ export function captureCalendarValidations(_ref) {
77
80
  passed: firstTime ? hasSpaceAvailable : true,
78
81
  currentCount: specialChildrenCount,
79
82
  maxCapacity: specialChildrenCapacity,
83
+ maxAbsoluteLimit: 5,
84
+ hasReachedMaxLimit: hasReachedMaxLimit,
80
85
  hasSpace: hasSpecialChildrenSpace,
81
86
  hasChildrenFallback: hasChildrenSpaceForFallback,
82
- willUseChildrenCapacity: !hasSpecialChildrenSpace && hasChildrenSpaceForFallback,
87
+ willUseChildrenCapacity: !hasSpecialChildrenSpace && hasChildrenSpaceForFallback && !hasReachedMaxLimit,
83
88
  isFirstBooking: !!firstTime
84
89
  }
85
90
  };
@@ -202,7 +202,6 @@ export function useTournament(): UseTournamentReturn {
202
202
  }
203
203
 
204
204
  if (turnType === "aog") return gameArena;
205
- if (turnType === "acg") return coordinateArena;
206
205
  if (turnType === "cc") return tournamentChess;
207
206
  if (turnType === "bh") return bughouse;
208
207
  if (turnType === "acg-co") return coordinate;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "heroes-of-chess-components",
3
- "version": "0.6.70",
3
+ "version": "0.6.72",
4
4
  "description": "Reusable React Components for Heroes of Chess Apps",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",