@factorialco/f0-react 1.226.0 → 1.227.0

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.
@@ -1348,7 +1348,7 @@ export declare type DataCollectionSourceDefinition<R extends RecordType = Record
1348
1348
  /** Available actions that can be performed on records */
1349
1349
  itemActions?: ItemActions;
1350
1350
  /** Available primary actions that can be performed on the collection */
1351
- primaryActions?: PrimaryActionsDefinition;
1351
+ primaryActions?: PrimaryActionsDefinitionFn;
1352
1352
  /** Available secondary actions that can be performed on the collection */
1353
1353
  secondaryActions?: SecondaryActionsDefinition;
1354
1354
  /** Available summaries fields. If not provided, summaries is not allowed. */
@@ -1358,7 +1358,11 @@ export declare type DataCollectionSourceDefinition<R extends RecordType = Record
1358
1358
  dataAdapter: DataCollectionDataAdapter<R, Filters, NavigationFilters>;
1359
1359
  /** Bulk actions that can be performed on the collection */
1360
1360
  bulkActions?: BulkActionsDefinition<R, Filters>;
1361
- totalItemSummary?: (totalItems: number) => string;
1361
+ /** Total items summary that can be displayed on the collection
1362
+ * If true, the total items summary will be displayed on the collection
1363
+ * If a function is provided, the total items summary will be displayed on the collection
1364
+ */
1365
+ totalItemSummary?: boolean | ((totalItems: number) => string | null);
1362
1366
  /** Item filter that can be used to filter the items before they are displayed */
1363
1367
  itemPreFilter?: (item: R) => boolean;
1364
1368
  /** Lanes configuration */
@@ -2382,6 +2386,11 @@ export declare const getGranularityDefinition: (granularityKey: GranularityDefin
2382
2386
 
2383
2387
  export declare const getGranularitySimpleDefinition: (granularityKey: GranularityDefinitionKey) => GranularityDefinitionSimple;
2384
2388
 
2389
+ /**
2390
+ * Get the primaryActionsItems from the primaryActionsDefinition or the actions property
2391
+ */
2392
+ export declare const getPrimaryActions: (primaryActions: PrimaryActionsDefinitionFn | undefined) => PrimaryActionsDefinition[];
2393
+
2385
2394
  /**
2386
2395
  * Get the secondaryActionsItems from the secondaryActionsDefinition or the actions property
2387
2396
  */
@@ -3725,11 +3734,13 @@ declare interface PrimaryActionButton extends PrimaryAction {
3725
3734
  onClick: () => void;
3726
3735
  }
3727
3736
 
3737
+ export declare type PrimaryActionsDefinition = Pick<DropdownItemObject, "onClick" | "label" | "icon">;
3738
+
3728
3739
  /**
3729
3740
  * Defines the structure and configuration of the primary action that can be performed on a collection.
3730
3741
  * @returns An action
3731
3742
  */
3732
- export declare type PrimaryActionsDefinition = () => Pick<DropdownItemObject, "onClick" | "label" | "icon"> | undefined;
3743
+ export declare type PrimaryActionsDefinitionFn = () => PrimaryActionsDefinition | PrimaryActionsDefinition[] | undefined;
3733
3744
 
3734
3745
  export declare type primaryActionType = {
3735
3746
  action: actionType;