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