@praxisui/table 4.0.0-beta.0 → 6.0.0-beta.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.
@@ -591,6 +591,20 @@ Columns Analysis:
591
591
  'behavior.expansion.detail.source.inlineSchema',
592
592
  'behavior.expansion.detail.source.resourcePath.paramsMap',
593
593
  ]);
594
+ const jsonLogicObjectPaths = new Set([
595
+ 'columns[].computed.expression',
596
+ 'columns[].conditionalStyles[].condition',
597
+ 'columns[].conditionalRenderers[].condition',
598
+ 'rowConditionalStyles[].condition',
599
+ 'toolbar.actions[].visibleWhen',
600
+ 'toolbar.actions[].children[].visibleWhen',
601
+ 'actions.row.actions[].visibleWhen',
602
+ 'actions.row.actions[].disabledWhen',
603
+ 'columns[].renderer.button.disabledCondition',
604
+ 'columns[].renderer.toggle.disabledCondition',
605
+ 'columns[].conditionalRenderers[].renderer.button.disabledCondition',
606
+ 'columns[].conditionalRenderers[].renderer.toggle.disabledCondition',
607
+ ]);
594
608
  const recurse = (obj, currentPath) => {
595
609
  if (typeof obj !== 'object' || obj === null)
596
610
  return obj;
@@ -613,30 +627,26 @@ Columns Analysis:
613
627
  const prefixMatch = Array.from(allowedPaths).some(p => p.startsWith(newPath + '.') || p.startsWith(newPath + '['));
614
628
  if (exactMatch || prefixMatch) {
615
629
  if (exactMatch
616
- && passthroughObjectPaths.has(newPath)
630
+ && (passthroughObjectPaths.has(newPath) || jsonLogicObjectPaths.has(newPath))
617
631
  && typeof obj[key] === 'object'
618
- && obj[key] !== null) {
632
+ && obj[key] !== null
633
+ && !Array.isArray(obj[key])) {
619
634
  cleanObj[key] = obj[key];
620
635
  continue;
621
636
  }
622
- const val = recurse(obj[key], newPath);
623
637
  if (newPath === 'columns[].computed.expression') {
624
- if (typeof val !== 'string') {
625
- warnings.push(`Computed expression inválida: ${newPath} (não é string)`);
638
+ if (!obj[key] || typeof obj[key] !== 'object' || Array.isArray(obj[key])) {
639
+ warnings.push(`Computed expression inválida: ${newPath} (deve ser Json Logic)`);
626
640
  continue;
627
641
  }
628
- const trimmed = val.trim();
629
- if (!trimmed) {
642
+ if (Object.keys(obj[key]).length === 0) {
630
643
  warnings.push(`Computed expression vazia: ${newPath}`);
631
644
  continue;
632
645
  }
633
- if (trimmed.length > 200) {
634
- warnings.push(`Computed expression muito longa: ${newPath}`);
635
- continue;
636
- }
637
- cleanObj[key] = trimmed;
646
+ cleanObj[key] = obj[key];
638
647
  continue;
639
648
  }
649
+ const val = recurse(obj[key], newPath);
640
650
  // Se for objeto vazio após limpeza, não inclui (salvo se for intenção explicita de limpar config, mas patch geralmente é aditivo)
641
651
  if (typeof val === 'object' && val !== null && !Array.isArray(val) && Object.keys(val).length === 0) {
642
652
  // ignora