@pagamio/frontend-commons-lib 0.8.354 → 0.8.355

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.
@@ -66,9 +66,12 @@ const FilterComponent = ({ filters, selectedFilters, showApplyFilterButton = tru
66
66
  if (type === 'multi-select') {
67
67
  return (_jsx(MultiSelect, { options: Array.isArray(options) ? options : [], placeholder: filter.placeholder ?? `Select ${name}`, value: value || [], onChange: (val) => handleFilterChange(name, val), className: "w-full" }));
68
68
  }
69
- // Default: select
70
- const currentValue = value || '';
71
- return (_jsxs(Select, { value: currentValue || undefined, onValueChange: (val) => handleFilterChange(name, val === '__clear__' ? '' : val), children: [_jsx(SelectTrigger, { className: "h-9 w-full border-border bg-background text-sm text-foreground", "aria-label": filter.placeholder ?? name, children: _jsx(SelectValue, { placeholder: filter.placeholder ?? `Select ${name}` }) }), _jsxs(SelectContent, { children: [currentValue && (_jsx(SelectItem, { value: "__clear__", className: "text-muted-foreground", children: filter.placeholder ?? 'All' })), (Array.isArray(options) ? options : []).map((opt) => (_jsx(SelectItem, { value: opt.value, children: opt.label }, opt.value)))] })] }));
69
+ // Default: select — always keep controlled via sentinel to avoid
70
+ // Radix switching to uncontrolled mode when value is cleared.
71
+ const SENTINEL = '__all__';
72
+ const currentValue = value ?? '';
73
+ const selectValue = currentValue !== '' ? currentValue : SENTINEL;
74
+ return (_jsxs(Select, { value: selectValue, onValueChange: (val) => handleFilterChange(name, val === SENTINEL ? '' : val), children: [_jsx(SelectTrigger, { className: "h-9 w-full border-border bg-background text-sm text-foreground", "aria-label": filter.placeholder ?? name, children: _jsx(SelectValue, {}) }), _jsxs(SelectContent, { children: [_jsx(SelectItem, { value: SENTINEL, className: "text-muted-foreground", children: filter.placeholder ?? 'All' }), (Array.isArray(options) ? options : []).map((opt) => (_jsx(SelectItem, { value: opt.value, children: opt.label }, opt.value)))] })] }));
72
75
  };
73
76
  return (
74
77
  // Fluid width: full width on mobile, fluid 180–260px on wider
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pagamio/frontend-commons-lib",
3
3
  "description": "Pagamio library for Frontend reusable components like the form engine and table container",
4
- "version": "0.8.354",
4
+ "version": "0.8.355",
5
5
  "publishConfig": {
6
6
  "access": "public",
7
7
  "provenance": false