@tap-payments/os-micro-frontend-shared 0.1.261-test.4 → 0.1.261-test.5

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.
@@ -35,10 +35,11 @@ function StatusBar({ isFilteredIdsShown, availableStatuses, status, onStatusChan
35
35
  }
36
36
  }, buttonSx: buttonSx })));
37
37
  }
38
- const statusItems = s.status;
39
- if (!statusItems)
38
+ if (!s.status)
40
39
  return null;
41
- const formattedStatuses = statusItems.filter(Boolean).map((item) => (typeof item === 'string' ? { value: item } : item)) || [];
40
+ const statusItems = s.status;
41
+ const formattedStatuses = (statusItems.filter(Boolean).map((item) => (typeof item === 'string' ? { value: item } : item)) ||
42
+ []);
42
43
  const hasMatchingDropdownStatus = !!status && formattedStatuses.some((item) => (item === null || item === void 0 ? void 0 : item.value) === status);
43
44
  const variant = hasMatchingDropdownStatus ? 'active' : 'inActive';
44
45
  const selectedStatus = hasMatchingDropdownStatus ? status : (_b = formattedStatuses[0]) === null || _b === void 0 ? void 0 : _b.value;
@@ -6,7 +6,7 @@ export type DetailedStatusItem<T> = {
6
6
  icon?: React.ReactNode;
7
7
  };
8
8
  export type AvailableStatus<T extends TableHeaderStatus | TableHeaderStatus[] = undefined> = StatusButtonProps & {
9
- status?: T | DetailedStatusItem<T>[];
9
+ status?: T | T[] | DetailedStatusItem<T>[];
10
10
  render?: <IStatus extends T>(controls: {
11
11
  status: IStatus;
12
12
  onChange: (selected?: T) => void;
@@ -20,7 +20,7 @@ export interface TableHeaderProps<IStatus extends TableHeaderStatus | TableHeade
20
20
  showMaximizedView?: boolean;
21
21
  title?: string | null;
22
22
  calendarMode?: CalenderMode;
23
- onStatusChange?: (status?: IStatus) => void;
23
+ onStatusChange?: <T extends IStatus>(status?: T) => void;
24
24
  onSearch?: (search: string) => void;
25
25
  onViewChange?: () => void;
26
26
  onDateChange?: (date: Date | [Date, Date]) => void;
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@tap-payments/os-micro-frontend-shared",
3
3
  "description": "Shared components and utilities for Tap Payments micro frontends",
4
- "version": "0.1.261-test.4",
5
- "testVersion": 4,
4
+ "version": "0.1.261-test.5",
5
+ "testVersion": 5,
6
6
  "type": "module",
7
7
  "main": "build/index.js",
8
8
  "module": "build/index.js",