@factorialco/f0-react 1.201.6 → 1.201.7
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/dist/experimental.d.ts +152 -2
- package/dist/experimental.js +10508 -10034
- package/dist/f0.d.ts +577 -12
- package/dist/f0.js +198 -190
- package/dist/{hooks-DmNAjFCl.js → hooks-Bg3-9LHc.js} +9491 -9474
- package/dist/styles.css +1 -1
- package/package.json +2 -1
package/dist/experimental.d.ts
CHANGED
|
@@ -841,6 +841,11 @@ declare type CardAvatarVariant = AvatarVariant | {
|
|
|
841
841
|
icon: IconType;
|
|
842
842
|
};
|
|
843
843
|
|
|
844
|
+
/**
|
|
845
|
+
* Group Cards: Renders
|
|
846
|
+
*/
|
|
847
|
+
declare type CardCollectionProps<Record extends RecordType, Filters extends FiltersDefinition, Sortings extends SortingsDefinition, Summaries extends SummariesDefinition, ItemActions extends ItemActionsDefinition<Record>, NavigationFilters extends NavigationFiltersDefinition, Grouping extends GroupingDefinition<Record>> = CollectionProps<Record, Filters, Sortings, Summaries, ItemActions, NavigationFilters, Grouping, CardVisualizationOptions<Record, Filters, Sortings>>;
|
|
848
|
+
|
|
844
849
|
/**
|
|
845
850
|
* Card metadata property renderers.
|
|
846
851
|
* Each metadata item consists of an icon and a property with its data.
|
|
@@ -1046,6 +1051,8 @@ declare interface ClockInGraphProps {
|
|
|
1046
1051
|
|
|
1047
1052
|
declare type ClockInStatus = "clocked-in" | "break" | "clocked-out";
|
|
1048
1053
|
|
|
1054
|
+
declare type ColId = string;
|
|
1055
|
+
|
|
1049
1056
|
/**
|
|
1050
1057
|
* Props for the Collection component.
|
|
1051
1058
|
* @template Record - The type of records in the collection
|
|
@@ -1063,6 +1070,15 @@ export declare type CollectionProps<Record extends RecordType, Filters extends F
|
|
|
1063
1070
|
onLoadError: OnLoadErrorCallback;
|
|
1064
1071
|
} & VisualizationOptions;
|
|
1065
1072
|
|
|
1073
|
+
declare type CollectionVisualizations<Record extends RecordType, Filters extends FiltersDefinition, Sortings extends SortingsDefinition, Summaries extends SummariesDefinition, ItemActions extends ItemActionsDefinition<Record>, NavigationFilters extends NavigationFiltersDefinition, Grouping extends GroupingDefinition<Record>> = {
|
|
1074
|
+
table: VisualizacionTypeDefinition<TableCollectionProps<Record, Filters, Sortings, Summaries, ItemActions, NavigationFilters, Grouping>, TableVisualizationSettings>;
|
|
1075
|
+
list: VisualizacionTypeDefinition<ListCollectionProps<Record, Filters, Sortings, Summaries, ItemActions, NavigationFilters, Grouping>>;
|
|
1076
|
+
card: VisualizacionTypeDefinition<CardCollectionProps<Record, Filters, Sortings, Summaries, ItemActions, NavigationFilters, Grouping>>;
|
|
1077
|
+
kanban: VisualizacionTypeDefinition<KanbanCollectionProps<Record, Filters, Sortings, Summaries, ItemActions, NavigationFilters, Grouping>>;
|
|
1078
|
+
};
|
|
1079
|
+
|
|
1080
|
+
declare const collectionVisualizations: CollectionVisualizations<RecordType, FiltersDefinition, SortingsDefinition, SummariesDefinition, ItemActionsDefinition<RecordType>, NavigationFiltersDefinition, GroupingDefinition<RecordType>>;
|
|
1081
|
+
|
|
1066
1082
|
declare type ColumnNumber = 1 | 2 | 3 | 4 | 6;
|
|
1067
1083
|
|
|
1068
1084
|
declare type ColumnWidth = keyof typeof columnWidths | number;
|
|
@@ -1251,6 +1267,10 @@ declare type DataCollectionExtendFetchOptions<NavigationFilters extends Navigati
|
|
|
1251
1267
|
*/
|
|
1252
1268
|
export declare type DataCollectionPaginatedFetchOptions<Filters extends FiltersDefinition, NavigationFilters extends NavigationFiltersDefinition> = PaginatedFetchOptions<Filters> & DataCollectionExtendFetchOptions<NavigationFilters>;
|
|
1253
1269
|
|
|
1270
|
+
declare type DataCollectionSettings = {
|
|
1271
|
+
visualization: VisualizationSettings;
|
|
1272
|
+
};
|
|
1273
|
+
|
|
1254
1274
|
/**
|
|
1255
1275
|
* Data collection source
|
|
1256
1276
|
* Extends the base data source with data collection specific elements / features
|
|
@@ -1296,6 +1316,31 @@ export declare type DataCollectionSourceDefinition<R extends RecordType = Record
|
|
|
1296
1316
|
lanes?: ReadonlyArray<Lane<Filters>>;
|
|
1297
1317
|
};
|
|
1298
1318
|
|
|
1319
|
+
/**
|
|
1320
|
+
* The status of the data collection
|
|
1321
|
+
*/
|
|
1322
|
+
declare type DataCollectionStatus = {
|
|
1323
|
+
grouping?: GroupingState<RecordType, GroupingDefinition<RecordType>>;
|
|
1324
|
+
sortings?: SortingsState<SortingsDefinition>;
|
|
1325
|
+
filters?: FiltersState<FiltersDefinition>;
|
|
1326
|
+
search?: string | undefined;
|
|
1327
|
+
navigationFilters?: NavigationFiltersState<NavigationFiltersDefinition>;
|
|
1328
|
+
visualization?: number;
|
|
1329
|
+
};
|
|
1330
|
+
|
|
1331
|
+
declare type DataCollectionStatusComplete = DataCollectionStatus & {
|
|
1332
|
+
settings?: DataCollectionSettings;
|
|
1333
|
+
};
|
|
1334
|
+
|
|
1335
|
+
declare type DataCollectionStorageFeature = (typeof dataCollectionStorageFeatures)[number];
|
|
1336
|
+
|
|
1337
|
+
/**
|
|
1338
|
+
* The available features of the data collection status storage
|
|
1339
|
+
*/
|
|
1340
|
+
declare const dataCollectionStorageFeatures: readonly ["filters", "navigationFilters", "sortings", "grouping", "visualization", "search"];
|
|
1341
|
+
|
|
1342
|
+
declare type DataCollectionStorageFeaturesDefinition = ("*" | `all` | `!${DataCollectionStorageFeature}` | `${DataCollectionStorageFeature}`)[];
|
|
1343
|
+
|
|
1299
1344
|
/**
|
|
1300
1345
|
* Represents an error that occurred during data fetching
|
|
1301
1346
|
*/
|
|
@@ -1561,6 +1606,7 @@ declare const defaultTranslations: {
|
|
|
1561
1606
|
readonly pagination: {
|
|
1562
1607
|
readonly of: "of";
|
|
1563
1608
|
};
|
|
1609
|
+
readonly settings: "{%visualizationName} settings";
|
|
1564
1610
|
};
|
|
1565
1611
|
readonly itemsCount: "items";
|
|
1566
1612
|
readonly emptyStates: {
|
|
@@ -1919,6 +1965,10 @@ declare interface ErrorMessageProps {
|
|
|
1919
1965
|
*/
|
|
1920
1966
|
export declare type ExtractPropertyKeys<RecordType> = keyof RecordType;
|
|
1921
1967
|
|
|
1968
|
+
declare type ExtractVisualizationSettings<T> = T extends {
|
|
1969
|
+
settings: infer S;
|
|
1970
|
+
} ? S : never;
|
|
1971
|
+
|
|
1922
1972
|
export declare const F0AiBanner: ForwardRefExoticComponent<AiBannerInternalProps & RefAttributes<HTMLDivElement>> & {
|
|
1923
1973
|
Skeleton: ({ compact }: AiBannerSkeletonProps) => JSX_2.Element;
|
|
1924
1974
|
};
|
|
@@ -2580,6 +2630,8 @@ declare type Items = typeof Item_2 | typeof PersonItem | typeof CompanyItem | ty
|
|
|
2580
2630
|
|
|
2581
2631
|
export declare function ItemSectionHeader({ item, children, isActive, collapsible, isExpanded, onToggleExpanded, sortable, }: TOCItemSectionHeaderProps): JSX_2.Element;
|
|
2582
2632
|
|
|
2633
|
+
declare type KanbanCollectionProps<Record extends RecordType, Filters extends FiltersDefinition, Sortings extends SortingsDefinition, Summaries extends SummariesDefinition, ItemActions extends ItemActionsDefinition<Record>, NavigationFilters extends NavigationFiltersDefinition, Grouping extends GroupingDefinition<Record>> = CollectionProps<Record, Filters, Sortings, Summaries, ItemActions, NavigationFilters, Grouping, KanbanVisualizationOptions<Record, Filters, Sortings>>;
|
|
2634
|
+
|
|
2583
2635
|
declare type KanbanLaneDefinition = {
|
|
2584
2636
|
id: string;
|
|
2585
2637
|
title: string;
|
|
@@ -2628,6 +2680,11 @@ declare type LinkProps = AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
|
2628
2680
|
disabled?: boolean;
|
|
2629
2681
|
};
|
|
2630
2682
|
|
|
2683
|
+
/**
|
|
2684
|
+
* Group List: Renders the list for a group
|
|
2685
|
+
*/
|
|
2686
|
+
declare type ListCollectionProps<Record extends RecordType, Filters extends FiltersDefinition, Sortings extends SortingsDefinition, Summaries extends SummariesDefinition, ItemActions extends ItemActionsDefinition<Record>, NavigationFilters extends NavigationFiltersDefinition, Grouping extends GroupingDefinition<Record>> = CollectionProps<Record, Filters, Sortings, Summaries, ItemActions, NavigationFilters, Grouping, ListVisualizationOptions<Record, Filters, Sortings>>;
|
|
2687
|
+
|
|
2631
2688
|
declare type ListPropertyDefinition<R, Sortings extends SortingsDefinition> = WithOptionalSorting_2<R, Sortings> & PropertyDefinition_2<R>;
|
|
2632
2689
|
|
|
2633
2690
|
declare type ListVisualizationOptions<R extends RecordType, _Filters extends FiltersDefinition, Sortings extends SortingsDefinition> = {
|
|
@@ -3082,7 +3139,31 @@ export declare interface OneCalendarProps {
|
|
|
3082
3139
|
/**
|
|
3083
3140
|
* @experimental This is an experimental component use it at your own risk
|
|
3084
3141
|
*/
|
|
3085
|
-
export declare const OneDataCollection: <R extends RecordType, Filters extends FiltersDefinition, Sortings extends SortingsDefinition, Summaries extends SummariesDefinition, ItemActions extends ItemActionsDefinition<R>, NavigationFilters extends NavigationFiltersDefinition, Grouping extends GroupingDefinition<R>>(
|
|
3142
|
+
export declare const OneDataCollection: <R extends RecordType, Filters extends FiltersDefinition, Sortings extends SortingsDefinition, Summaries extends SummariesDefinition, ItemActions extends ItemActionsDefinition<R>, NavigationFilters extends NavigationFiltersDefinition, Grouping extends GroupingDefinition<R>>(props: OneDataCollectionProps<R, Filters, Sortings, Summaries, ItemActions, NavigationFilters, Grouping>) => JSX_2.Element;
|
|
3143
|
+
|
|
3144
|
+
/**
|
|
3145
|
+
* A component that renders a collection of data with filtering and visualization capabilities.
|
|
3146
|
+
* It consumes a data source (created by useDataCollectionSource) and displays it through one or more visualizations.
|
|
3147
|
+
*
|
|
3148
|
+
* DataCollection is separated from useDataCollectionSource to:
|
|
3149
|
+
* 1. Support the composition pattern - data sources can be created and managed independently
|
|
3150
|
+
* 2. Allow a single data source to be visualized in multiple ways simultaneously
|
|
3151
|
+
* 3. Enable reuse of the same data source in different parts of the application
|
|
3152
|
+
* 4. Provide a clean separation of concerns between data management and UI rendering
|
|
3153
|
+
*
|
|
3154
|
+
* @template Record - The type of records in the collection
|
|
3155
|
+
* @template Filters - The definition of available filters for the collection
|
|
3156
|
+
* @template ItemActions - The definition of available item actions
|
|
3157
|
+
*
|
|
3158
|
+
* @param source - The data source containing filters, data, and state management
|
|
3159
|
+
* @param visualizations - Array of available visualization options (e.g., table, card view)
|
|
3160
|
+
*
|
|
3161
|
+
* @returns A JSX element containing:
|
|
3162
|
+
* - Filter controls (if filters are defined)
|
|
3163
|
+
* - Visualization selector (if multiple visualizations are available)
|
|
3164
|
+
* - The selected visualization of the data
|
|
3165
|
+
*/
|
|
3166
|
+
declare type OneDataCollectionProps<R extends RecordType, Filters extends FiltersDefinition, Sortings extends SortingsDefinition, Summaries extends SummariesDefinition, ItemActions extends ItemActionsDefinition<R>, NavigationFilters extends NavigationFiltersDefinition, Grouping extends GroupingDefinition<R>> = {
|
|
3086
3167
|
source: DataCollectionSource<R, Filters, Sortings, Summaries, ItemActions, NavigationFilters, Grouping>;
|
|
3087
3168
|
visualizations: ReadonlyArray<Visualization<R, Filters, Sortings, Summaries, ItemActions, NavigationFilters, Grouping>>;
|
|
3088
3169
|
onSelectItems?: OnSelectItemsCallback<R, Filters>;
|
|
@@ -3090,7 +3171,27 @@ export declare const OneDataCollection: <R extends RecordType, Filters extends F
|
|
|
3090
3171
|
emptyStates?: CustomEmptyStates;
|
|
3091
3172
|
onTotalItemsChange?: (totalItems: number) => void;
|
|
3092
3173
|
fullHeight?: boolean;
|
|
3093
|
-
|
|
3174
|
+
/** Function to handle state change */
|
|
3175
|
+
onStateChange?: (state: DataCollectionStatusComplete) => void;
|
|
3176
|
+
/** Key for the data collection settings and state, must be unique for each data collection and contain the version e.g. "employees/v1"
|
|
3177
|
+
*/
|
|
3178
|
+
id?: string;
|
|
3179
|
+
/** Storage for the data collection settings and state */
|
|
3180
|
+
storage?: {
|
|
3181
|
+
/** Features for the data collection storage , for example you can disable the storage for the data collection filters state
|
|
3182
|
+
* You can use "*" for all features and ! to disable a feature
|
|
3183
|
+
*
|
|
3184
|
+
* For example:
|
|
3185
|
+
* - "*" - will use all storage features (empty "" means all)
|
|
3186
|
+
* - "filters" - will use only the storage for the data collection filters state
|
|
3187
|
+
* - "filters, sortings" - will use the storage for the data collection filters and sortings state
|
|
3188
|
+
* - "*, !filters" - will not use the storage for the data collection filters state
|
|
3189
|
+
* - "!filters, sortings" - will not use the storage for the data collection filters and sortings state
|
|
3190
|
+
*
|
|
3191
|
+
*/
|
|
3192
|
+
features?: DataCollectionStorageFeaturesDefinition;
|
|
3193
|
+
};
|
|
3194
|
+
};
|
|
3094
3195
|
|
|
3095
3196
|
export declare function OneDateNavigator({ onSelect, defaultValue, presets, granularities, hideNavigation, hideGoToCurrent, compareTo, defaultCompareTo, onCompareToChange, ...props }: OneDatePickerProps): JSX_2.Element;
|
|
3096
3197
|
|
|
@@ -4261,12 +4362,30 @@ export declare type TabItem = {
|
|
|
4261
4362
|
id: string;
|
|
4262
4363
|
});
|
|
4263
4364
|
|
|
4365
|
+
declare type TableCollectionProps<R extends RecordType, Filters extends FiltersDefinition, Sortings extends SortingsDefinition, Summaries extends SummariesDefinition, ItemActions extends ItemActionsDefinition<R>, NavigationFilters extends NavigationFiltersDefinition, Grouping extends GroupingDefinition<R>> = CollectionProps<R, Filters, Sortings, Summaries, ItemActions, NavigationFilters, Grouping, TableVisualizationOptions<R, Filters, Sortings, Summaries>>;
|
|
4366
|
+
|
|
4264
4367
|
declare type TableColumnDefinition<R extends RecordType, Sortings extends SortingsDefinition, Summaries extends SummariesDefinition> = WithOptionalSorting<R, Sortings> & Pick<ComponentProps<typeof TableHead>, "hidden" | "info" | "infoIcon" | "sticky" | "width"> & {
|
|
4265
4368
|
/**
|
|
4266
4369
|
* Optional summary configuration for this column
|
|
4267
4370
|
* References a key in the Summaries definition, similar to how sorting works
|
|
4268
4371
|
*/
|
|
4269
4372
|
summary?: SummaryKey<Summaries>;
|
|
4373
|
+
/**
|
|
4374
|
+
* The id of the column (if not provided, the id will be the label of the column)
|
|
4375
|
+
*/
|
|
4376
|
+
id?: ColId;
|
|
4377
|
+
/**
|
|
4378
|
+
* The initial order of the column
|
|
4379
|
+
*/
|
|
4380
|
+
order?: number;
|
|
4381
|
+
/**
|
|
4382
|
+
* The initial state of the hidden (only applies if allowColumnHiding is true)
|
|
4383
|
+
*/
|
|
4384
|
+
hidden?: boolean;
|
|
4385
|
+
/**
|
|
4386
|
+
* Avoid hiding the column by the user
|
|
4387
|
+
*/
|
|
4388
|
+
noHiding?: boolean;
|
|
4270
4389
|
};
|
|
4271
4390
|
|
|
4272
4391
|
declare function TableHead({ children, width, sortState, onSortClick, info, infoIcon, sticky, hidden, align, className, }: TableHeadProps): JSX_2.Element;
|
|
@@ -4327,8 +4446,27 @@ declare interface TableHeadProps {
|
|
|
4327
4446
|
}
|
|
4328
4447
|
|
|
4329
4448
|
declare type TableVisualizationOptions<R extends RecordType, _Filters extends FiltersDefinition, Sortings extends SortingsDefinition, Summaries extends SummariesDefinition> = {
|
|
4449
|
+
/**
|
|
4450
|
+
* The columns to display
|
|
4451
|
+
*/
|
|
4330
4452
|
columns: ReadonlyArray<TableColumnDefinition<R, Sortings, Summaries>>;
|
|
4453
|
+
/**
|
|
4454
|
+
* The number of columns to freeze on the left
|
|
4455
|
+
*/
|
|
4331
4456
|
frozenColumns?: 0 | 1 | 2;
|
|
4457
|
+
/**
|
|
4458
|
+
* Allow users to reorder columns (you can only reorder columns that are not frozen) (check cols props to define the order)
|
|
4459
|
+
*/
|
|
4460
|
+
allowColumnReordering?: boolean;
|
|
4461
|
+
/**
|
|
4462
|
+
* Allow users to hide columns (you can define especifcally non hiddable columns in col props, also frozen columns are not hiddable)
|
|
4463
|
+
*/
|
|
4464
|
+
allowColumnHiding?: boolean;
|
|
4465
|
+
};
|
|
4466
|
+
|
|
4467
|
+
declare type TableVisualizationSettings = {
|
|
4468
|
+
order: ColId[];
|
|
4469
|
+
hidden: ColId[];
|
|
4332
4470
|
};
|
|
4333
4471
|
|
|
4334
4472
|
export declare const Tabs: FC<TabsProps> & {
|
|
@@ -4672,6 +4810,14 @@ declare const VerticalOverflowList: {
|
|
|
4672
4810
|
displayName: string;
|
|
4673
4811
|
};
|
|
4674
4812
|
|
|
4813
|
+
declare type VisualizacionTypeDefinition<Props, Settings = Record<string, never>> = {
|
|
4814
|
+
render: (props: Props) => JSX.Element;
|
|
4815
|
+
renderSettings?: (props: Props) => JSX.Element | null;
|
|
4816
|
+
name: string;
|
|
4817
|
+
icon: IconType;
|
|
4818
|
+
settings: Settings;
|
|
4819
|
+
};
|
|
4820
|
+
|
|
4675
4821
|
/**
|
|
4676
4822
|
* Represents a visualization configuration for displaying collection data.
|
|
4677
4823
|
* Supports different visualization types (card, table, or custom) with their respective options.
|
|
@@ -4716,6 +4862,10 @@ declare type Visualization<R extends RecordType, Filters extends FiltersDefiniti
|
|
|
4716
4862
|
}) => JSX.Element;
|
|
4717
4863
|
};
|
|
4718
4864
|
|
|
4865
|
+
declare type VisualizationSettings = {
|
|
4866
|
+
[K in keyof typeof collectionVisualizations]: ExtractVisualizationSettings<(typeof collectionVisualizations)[K]>;
|
|
4867
|
+
};
|
|
4868
|
+
|
|
4719
4869
|
export declare const Weekdays: ForwardRefExoticComponent<WeekdaysProps & RefAttributes<HTMLDivElement>>;
|
|
4720
4870
|
|
|
4721
4871
|
declare interface WeekdaysProps {
|