@factorialco/f0-react 1.372.0 → 1.373.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.
package/dist/f0.d.ts CHANGED
@@ -2195,6 +2195,7 @@ export declare const defaultTranslations: {
2195
2195
  readonly selectAllItems: "Select all {{total}} items";
2196
2196
  readonly allItemsSelected: "All {{total}} items selected";
2197
2197
  };
2198
+ readonly noItemsSelected: "No items selected";
2198
2199
  };
2199
2200
  readonly filters: {
2200
2201
  readonly searchPlaceholder: "Search filters...";
@@ -2542,6 +2543,8 @@ export declare const defaultTranslations: {
2542
2543
  readonly forms: {
2543
2544
  readonly actionBar: {
2544
2545
  readonly unsavedChanges: "You have changes pending to be saved";
2546
+ readonly saving: "Saving...";
2547
+ readonly saved: "Your changes have been saved";
2545
2548
  readonly discard: "Discard";
2546
2549
  readonly issues: {
2547
2550
  readonly one: "{{count}} issue";
@@ -4071,6 +4074,8 @@ declare interface F0FormSubmitConfigBase {
4071
4074
  * - IconType: custom icon
4072
4075
  */
4073
4076
  icon?: IconType | null;
4077
+ /** Label shown in the action bar while submitting (defaults to i18n "forms.actionBar.saving") */
4078
+ savingMessage?: string;
4074
4079
  }
4075
4080
 
4076
4081
  /**
@@ -4078,6 +4083,8 @@ declare interface F0FormSubmitConfigBase {
4078
4083
  */
4079
4084
  export declare type F0FormSubmitResult = {
4080
4085
  success: true;
4086
+ /** Optional message shown in the action bar after successful submission */
4087
+ message?: string;
4081
4088
  } | {
4082
4089
  success: false;
4083
4090
  /** Root error message displayed at the top of the form */
@@ -4361,6 +4368,12 @@ declare type F0SelectBaseProps<T extends string, R = unknown> = {
4361
4368
  * Only displays the dropdown content with max height, border and scroll.
4362
4369
  */
4363
4370
  asList?: boolean;
4371
+ /**
4372
+ * When true, shows a selection preview panel on the right side of the dropdown
4373
+ * for multi-select mode. When false and filters are present, filters use compact mode.
4374
+ * @default false
4375
+ */
4376
+ showPreview?: boolean;
4364
4377
  };
4365
4378
 
4366
4379
  /**
@@ -4822,7 +4835,7 @@ declare interface FilterPickerBaseProps<Filters extends FiltersDefinition> {
4822
4835
  */
4823
4836
  export declare type FiltersDefinition<Keys extends string = string> = Record<Keys, FilterDefinition>;
4824
4837
 
4825
- export declare type FiltersMode = "default" | "compact" | "simple";
4838
+ export declare type FiltersMode = "default" | "compact" | "simple" | "inline";
4826
4839
 
4827
4840
  /**
4828
4841
  * Current state of all filters in a collection.
@@ -4837,6 +4850,8 @@ export declare type FiltersState<Definition extends Record<string, FilterDefinit
4837
4850
  declare type FilterTypeContext<Options extends object = never> = {
4838
4851
  schema: FilterTypeSchema<Options>;
4839
4852
  i18n: I18nContextType;
4853
+ /** The key of this filter in the FiltersDefinition (passed to chipLabel for nested label lookups) */
4854
+ filterKey?: string;
4840
4855
  };
4841
4856
 
4842
4857
  declare type FilterTypeDefinition<Value = unknown, Options extends object = never, EmptyValue = Value, OptionalOptions extends boolean = false> = {
@@ -4849,6 +4864,8 @@ declare type FilterTypeDefinition<Value = unknown, Options extends object = neve
4849
4864
  value: Value;
4850
4865
  onChange: (value: Value) => void;
4851
4866
  isCompactMode?: boolean;
4867
+ onFilterChange?: (key: string, value: unknown) => void;
4868
+ allFiltersValue?: Record<string, unknown>;
4852
4869
  }) => React.ReactNode;
4853
4870
  /**
4854
4871
  * The value label to display in the filter chips
@@ -5257,6 +5274,16 @@ declare type InFilterOptionItem<T = unknown> = {
5257
5274
  value: T;
5258
5275
  /** Human-readable label for the option */
5259
5276
  label: string;
5277
+ /**
5278
+ * Nested children that belong to a different filter key.
5279
+ * Enables hierarchical filtering (e.g., office -> space -> desk).
5280
+ */
5281
+ children?: {
5282
+ /** The filter key where child selections are stored in FiltersState */
5283
+ filterKey: string;
5284
+ /** Child options, which can themselves have children for infinite nesting */
5285
+ options: Array<InFilterOptionItem<T>>;
5286
+ };
5260
5287
  };
5261
5288
 
5262
5289
  /**
@@ -7537,7 +7564,7 @@ export declare function useSchemaDefinition(schema: F0FormSchema, sections?: Rec
7537
7564
  * Custom hook to manage selection state for items and groups in a data table
7538
7565
  * Supports single/multi selection, grouped data, pagination, and filtering
7539
7566
  */
7540
- export declare function useSelectable<R extends RecordType, Filters extends FiltersDefinition, Sortings extends SortingsDefinition, Grouping extends GroupingDefinition<R>>({ data, paginationInfo, source, selectionMode, selectedState, onSelectItems, disableSelectAll, isSearchActive, allPagesSelection, }: UseSelectableProps<R, Filters, Sortings, Grouping>): UseSelectableReturn<R, Filters>;
7567
+ export declare function useSelectable<R extends RecordType, Filters extends FiltersDefinition, Sortings extends SortingsDefinition, Grouping extends GroupingDefinition<R>>({ data, paginationInfo, source, selectionMode, selectedState, onSelectItems, disableSelectAll, isSearchActive, allPagesSelection, resetOnPageChange, }: UseSelectableProps<R, Filters, Sortings, Grouping>): UseSelectableReturn<R, Filters>;
7541
7568
 
7542
7569
  export declare type UseSelectableProps<R extends RecordType, Filters extends FiltersDefinition, Sortings extends SortingsDefinition, Grouping extends GroupingDefinition<R>> = {
7543
7570
  data: Data<R>;
@@ -7567,6 +7594,12 @@ export declare type UseSelectableProps<R extends RecordType, Filters extends Fil
7567
7594
  * - itemStatus only includes items from the current page
7568
7595
  */
7569
7596
  allPagesSelection?: boolean;
7597
+ /**
7598
+ * When true (default), clears selection when the page changes
7599
+ * (unless all items are selected). Set to false to persist
7600
+ * selections across page changes unconditionally.
7601
+ */
7602
+ resetOnPageChange?: boolean;
7570
7603
  };
7571
7604
 
7572
7605
  export declare type UseSelectableReturn<R extends RecordType, Filters extends FiltersDefinition> = {
@@ -7596,9 +7629,14 @@ export declare type UseSelectableReturn<R extends RecordType, Filters extends Fi
7596
7629
  */
7597
7630
  handleSelectItemChange: (itemOrId: R | SelectionId | readonly SelectionId[], checked: boolean) => void;
7598
7631
  /**
7599
- * Handles the change of the selected all items
7632
+ * Handles "select all" for the current page only
7600
7633
  */
7601
7634
  handleSelectAll: (checked: boolean) => void;
7635
+ /**
7636
+ * Handles "select all items" across all pages (full dataset).
7637
+ * Only meaningful when allPagesSelection is enabled.
7638
+ */
7639
+ handleSelectAllItems: (checked: boolean) => void;
7602
7640
  /**
7603
7641
  * Handles the change of the selected group.
7604
7642
  * Accepts either SelectionId(s) or a GroupRecord.
@@ -7777,6 +7815,11 @@ declare module "gridstack" {
7777
7815
  }
7778
7816
 
7779
7817
 
7818
+ declare namespace Calendar {
7819
+ var displayName: string;
7820
+ }
7821
+
7822
+
7780
7823
  declare module "@tiptap/core" {
7781
7824
  interface Commands<ReturnType> {
7782
7825
  aiBlock: {
@@ -7824,8 +7867,3 @@ declare module "@tiptap/core" {
7824
7867
  };
7825
7868
  }
7826
7869
  }
7827
-
7828
-
7829
- declare namespace Calendar {
7830
- var displayName: string;
7831
- }