mobigrid-module 1.1.35 → 1.1.36

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.
package/README.md CHANGED
@@ -177,6 +177,29 @@ Defines the table columns.
177
177
  - `"ACTIONS_BUTTONS"`: Special column for action buttons.
178
178
  - **`scroll`**: If true, limits height and adds scrollbar for long content.
179
179
 
180
+ ### Extra Metrics Configuration (`extra`)
181
+
182
+ Aggregates the API returns alongside the rows, under an `EXTRA` array in the
183
+ response (`{ "DATA": [...], "EXTRA": [{ "sumamounts": 50502 }], "PAGESNUM": 2379 }`).
184
+ The first `EXTRA` object is read; each configured metric is displayed as a badge
185
+ next to the row count in the page header.
186
+
187
+ ```json
188
+ "extra": [
189
+ {
190
+ "title": "Volume",
191
+ "key": "sumamounts",
192
+ "type": "money",
193
+ "currency": "DH"
194
+ }
195
+ ]
196
+ ```
197
+
198
+ - **`key`**: The key in the `EXTRA` object. Keys missing from the response are skipped.
199
+ - **`title`**: (Optional) Shown as the badge tooltip.
200
+ - **`type`**: `"money"` and `"number"` are grouped by thousands (`50502` -> `50 502`);
201
+ `"money"` appends `currency`. Anything else is displayed as-is.
202
+
180
203
  ### Actions Configuration
181
204
 
182
205
  For columns with `key: "ACTIONS_BUTTONS"`, you can define an `actions` array.
@@ -6,10 +6,17 @@ interface PageHeaderProps {
6
6
  setFilters: (filters: any) => void;
7
7
  onSearch: () => void;
8
8
  count: number;
9
+ extra?: Record<string, any> | null;
10
+ extraConfig?: Array<{
11
+ title?: string;
12
+ key: string;
13
+ type?: string;
14
+ currency?: string;
15
+ }>;
9
16
  isLoading: boolean;
10
17
  setCurrentPage: (page: number) => void;
11
18
  handleOptionsSearch: (filter: any, search: string) => void;
12
19
  optionsLoading: boolean;
13
20
  }
14
- export declare function PageHeader({ title, filters, setFilters, configFilters, onSearch, count, isLoading, setCurrentPage, handleOptionsSearch, optionsLoading, }: PageHeaderProps): React.JSX.Element;
21
+ export declare function PageHeader({ title, filters, setFilters, configFilters, onSearch, count, extra, extraConfig, isLoading, setCurrentPage, handleOptionsSearch, optionsLoading, }: PageHeaderProps): React.JSX.Element;
15
22
  export {};