@pagamio/frontend-commons-lib 0.8.282 → 0.8.283
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.
|
@@ -2,6 +2,6 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useTranslation } from '../../translations';
|
|
3
3
|
const AppPageHeader = ({ title, description }) => {
|
|
4
4
|
const { t } = useTranslation();
|
|
5
|
-
return (_jsxs("div", { className: "mb-
|
|
5
|
+
return (_jsxs("div", { className: "mb-2", children: [_jsx("h1", { className: "text-2xl font-bold", children: t(title) }), description && _jsx("p", { className: "text-1xl text-muted-foreground", children: t(description) })] }));
|
|
6
6
|
};
|
|
7
7
|
export default AppPageHeader;
|
|
@@ -50,7 +50,7 @@ import { DashboardStatCardRow } from './DashboardStatCardRow';
|
|
|
50
50
|
const DashboardHeader = ({ title, subtitle, showDateFilter = false, dateFilterOptions = DEFAULT_DATE_FILTER_OPTIONS, dateFilter, onDateFilterChange, useDateRangePicker = false, dateRange, onDateRangeChange, filters, filterValues, onFilterChange, showRefresh = true, onRefresh, loading = false, actions, className, }) => {
|
|
51
51
|
// Convert DateRangeValue to DateRange for the picker
|
|
52
52
|
const pickerValue = dateRange ? { from: dateRange.from, to: dateRange.to } : undefined;
|
|
53
|
-
return (_jsxs("div", { className: cn('
|
|
53
|
+
return (_jsxs("div", { className: cn('flex flex-wrap items-center justify-between gap-4', className), children: [_jsxs("div", { children: [_jsx("h1", { className: "text-2xl font-bold text-foreground", children: title }), subtitle && _jsx("p", { className: "text-muted-foreground", children: subtitle })] }), _jsxs("div", { className: "flex flex-wrap items-center gap-3", children: [filters?.map((filter) => (_jsxs(Select, { value: filterValues?.[filter.id] || 'all', onValueChange: (value) => onFilterChange?.(filter.id, value === 'all' ? '' : value), children: [_jsx(SelectTrigger, { className: "w-[180px] bg-card border-border", children: _jsx(SelectValue, { placeholder: filter.placeholder ?? `All ${filter.label}` }) }), _jsxs(SelectContent, { children: [_jsx(SelectItem, { value: "all", children: filter.placeholder ?? `All ${filter.label}` }), filter.options.map((option) => (_jsx(SelectItem, { value: option.value, children: option.label }, option.value)))] })] }, filter.id))), useDateRangePicker && (_jsx(DateRangePickerWithPresets, { value: pickerValue, selectedPreset: dateFilter, onChange: (range, preset) => {
|
|
54
54
|
onDateRangeChange?.(range, preset);
|
|
55
55
|
if (preset) {
|
|
56
56
|
onDateFilterChange(preset);
|
|
@@ -104,7 +104,7 @@ const DashboardWrapperV2 = ({ header, sections, userName = 'User', businessUnitI
|
|
|
104
104
|
if (!businessUnitId && emptyState) {
|
|
105
105
|
return (_jsx(DashboardEmptyState, { icon: emptyState.icon, title: emptyState.title, description: emptyState.description, action: emptyState.action }));
|
|
106
106
|
}
|
|
107
|
-
return (_jsxs("div", { className: cn('
|
|
107
|
+
return (_jsxs("div", { className: cn('transition-[margin-left] duration-200 ease-in-out', className), children: [header && (_jsx(DashboardHeader, { title: resolveTitle(), subtitle: header.subtitle, showDateFilter: header.showDateFilter, dateFilterOptions: header.dateFilterOptions || DEFAULT_DATE_FILTER_OPTIONS, dateFilter: dateFilter, onDateFilterChange: handleDateFilterChange, useDateRangePicker: header.useDateRangePicker, dateRange: dateRange, onDateRangeChange: onDateRangeChange, filters: header.filters, filterValues: filterValues, onFilterChange: onFilterChange, showRefresh: header.showRefresh, onRefresh: onRefresh, loading: loading, actions: header.actions, className: header.className })), _jsx("div", { className: contentClassName, children: sections.map((section) => (_jsx(SectionRenderer, { section: section, loading: loading }, section.type === 'stat-cards'
|
|
108
108
|
? section.config.id
|
|
109
109
|
: section.type === 'charts'
|
|
110
110
|
? section.config.id
|
|
@@ -179,6 +179,6 @@ const PagamioTable = ({ columns, data, isLoading = false, rowCount, sorting, pag
|
|
|
179
179
|
});
|
|
180
180
|
// ── Toolbar rendering ──────────────────────────────────────────────
|
|
181
181
|
const showCustomToolbar = toolbarMode === 'custom' && (!!toolbar || !!search || !!filtering);
|
|
182
|
-
return (_jsxs("div", {
|
|
182
|
+
return (_jsxs("div", { children: [showCustomToolbar && (_jsx(CustomToolbar, { filters: toolbar?.filters ?? [], appliedFilters: filtering?.appliedFilters ?? {}, onFilterChange: filtering?.onFilterChange ?? (() => { }), onApply: filtering?.onApply ?? (() => { }), onClearFilters: toolbar?.onClearFilters, showClearFilters: toolbar?.showClearFilters ?? false, showApplyFilterButton: toolbar?.showApplyFilterButton ?? true, searchEnabled: !!search, searchQuery: search?.query ?? '', onSearch: search?.onChange ?? (() => { }), searchPlaceholder: search?.placeholder, exportConfig: toolbar?.export, columns: columns, data: data, addButton: toolbar?.addButton, addText: toolbar?.addText, onAdd: toolbar?.onAdd })), _jsx("div", { className: "border border-border rounded-md overflow-hidden", children: _jsx(MantineReactTable, { table: table }) })] }));
|
|
183
183
|
};
|
|
184
184
|
export default PagamioTable;
|
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.
|
|
4
|
+
"version": "0.8.283",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
7
7
|
"provenance": false
|