@bit.rhplus/ui.grid-layout 0.0.4 → 0.0.6

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.
@@ -330,12 +330,16 @@ export const useGridLayoutApi = ({
330
330
  ? userField.Show
331
331
  : !colDef.hide; // Fallback na opak column def hide hodnoty
332
332
 
333
+ // Vypočítáme finální šířku s debug logem
334
+ const finalWidth = userField.width !== undefined && userField.width !== null ? userField.width :
335
+ userField.Width !== undefined && userField.Width !== null ? userField.Width :
336
+ colDef.width !== undefined && colDef.width !== null ? colDef.width : 100;
337
+
333
338
  const result = {
334
339
  colId: colDef.field || colDef.colId,
335
340
  // API používá lowercase názvy polí - správně zachováváme i nulové hodnoty
336
- width: (userField.width != null) ? userField.width :
337
- (userField.Width != null) ? userField.Width :
338
- (colDef.width ?? 100),
341
+ // Priorita: userField.width -> userField.Width -> colDef.width -> 100
342
+ width: finalWidth,
339
343
  hide: !showValue, // Respektujeme přesně hodnotu show z API
340
344
  pinned: colDef.pinned || null, // Pinning z columnDefs, userFields to zatím nepodporuje
341
345
  sort: null, // Sorting není součástí layout managementu
@@ -344,6 +348,11 @@ export const useGridLayoutApi = ({
344
348
  __order: userField.order ?? userField.Order ?? defaultIndex,
345
349
  };
346
350
 
351
+ // Debug log pro sledování šířek při načítání
352
+ if (Math.random() < 0.3) { // 30% šance na log pro omezení výstupu
353
+ console.log(`[GridLayoutApi] Column ${result.colId}: userField.width=${userField.width}, userField.Width=${userField.Width}, colDef.width=${colDef.width}, finalWidth=${finalWidth}`);
354
+ }
355
+
347
356
  // Removed console.log for production
348
357
 
349
358
  return result;