@fuentis/phoenix-ui 0.0.9-alpha.511 → 0.0.9-alpha.512

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.
@@ -2553,6 +2553,9 @@ class TableCaptionComponent {
2553
2553
  : [filter.selected]
2554
2554
  : [];
2555
2555
  }
2556
+ else if (filter.type === 'checkbox') {
2557
+ defaultValue = !!filter.selected;
2558
+ }
2556
2559
  else {
2557
2560
  defaultValue = hasSelected ? filter.selected : null;
2558
2561
  }
@@ -2565,6 +2568,15 @@ class TableCaptionComponent {
2565
2568
  this.applyFiltersEvent.emit(sanitized);
2566
2569
  this.storeTableState(sanitized, this.FILTER_KEY);
2567
2570
  });
2571
+ // Emit initial value after form is set up
2572
+ queueMicrotask(() => {
2573
+ const initialRaw = this.filtersForm.getRawValue();
2574
+ const initial = this.sanitizeByOptions(initialRaw, this.filters);
2575
+ this.applyFiltersEvent.emit(initial);
2576
+ if (Object.keys(initial).length > 0) {
2577
+ this.storeTableState(initial, this.FILTER_KEY);
2578
+ }
2579
+ });
2568
2580
  }
2569
2581
  }
2570
2582
  /** Default selected columns = all non-hidden columns */
@@ -2612,6 +2624,11 @@ class TableCaptionComponent {
2612
2624
  const cfg = cfgMap.get(key);
2613
2625
  if (!cfg)
2614
2626
  return;
2627
+ // checkboxes: just ensure boolean
2628
+ if (cfg.type === 'checkbox') {
2629
+ cleaned[key] = !!formValue[key];
2630
+ return;
2631
+ }
2615
2632
  const opts = (cfg.options ?? []).map((o) => o?.key ?? o?.value ?? o?.label ?? o);
2616
2633
  const has = new Set(opts.map((v) => String(v).toLowerCase()));
2617
2634
  const keep = (v) => v !== null &&