@factorialco/f0-react 1.249.1 → 1.251.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.
@@ -53,6 +53,8 @@ import { LineChartProps } from '../../../components/Charts/LineChart';
53
53
  import { LongTextCellValue } from './types/longText.tsx';
54
54
  import { NumberCellValue } from './types/number.tsx';
55
55
  import { NumberCellValue as NumberCellValue_2 } from '../../value-display/types/number';
56
+ import { NumberFilterOptions } from './NumberFilter/NumberFilter';
57
+ import { NumberFilterValue } from './NumberFilter/NumberFilter';
56
58
  import { Observable } from 'zen-observable-ts';
57
59
  import { Path } from 'react-hook-form';
58
60
  import { PercentageCellValue } from './types/percentage.tsx';
@@ -1960,6 +1962,11 @@ declare const defaultTranslations: {
1960
1962
  readonly cancel: "Cancel";
1961
1963
  readonly failedToLoadOptions: "Failed to load options";
1962
1964
  readonly retry: "Retry";
1965
+ readonly aboveOrEqual: "Above or equal to";
1966
+ readonly value: "Value";
1967
+ readonly belowOrEqual: "Below or equal to";
1968
+ readonly range_title: "Use range";
1969
+ readonly range: "Between {{min}} and {{max}}";
1963
1970
  };
1964
1971
  readonly toc: {
1965
1972
  readonly search: "Search...";
@@ -2119,6 +2126,11 @@ declare const defaultTranslations: {
2119
2126
  readonly noResults: "No results found";
2120
2127
  readonly loadingMore: "Loading...";
2121
2128
  };
2129
+ readonly numberInput: {
2130
+ readonly between: "Between {{min}} and {{max}}";
2131
+ readonly greaterThan: "Greater than {{min}}";
2132
+ readonly lessThan: "Less than {{max}}";
2133
+ };
2122
2134
  };
2123
2135
 
2124
2136
  export declare const DetailsItem: ForwardRefExoticComponent<DetailsItemType & RefAttributes<HTMLDivElement>>;
@@ -2591,6 +2603,7 @@ declare type FilterDefinitionsByType<T = unknown, R extends RecordType = RecordT
2591
2603
  in: InFilterDefinition<T, R>;
2592
2604
  search: SearchFilterDefinition;
2593
2605
  date: DateFilterDefinition;
2606
+ number: NumberFilterDefinition;
2594
2607
  };
2595
2608
 
2596
2609
  /**
@@ -2630,13 +2643,13 @@ export declare type FiltersState<Definition extends Record<string, FilterDefinit
2630
2643
 
2631
2644
  declare type FilterTypeContext<Options extends object = never> = {
2632
2645
  schema: FilterTypeSchema<Options>;
2633
- i18n: TranslationsType;
2646
+ i18n: I18nContextType;
2634
2647
  };
2635
2648
 
2636
2649
  declare type FilterTypeDefinition<Value = unknown, Options extends object = never, EmptyValue = Value> = {
2637
2650
  /** Check if the value is empty */
2638
2651
  emptyValue: EmptyValue;
2639
- isEmpty: (value: Value, context: FilterTypeContext<Options>) => boolean;
2652
+ isEmpty: (value: Value | undefined, context: FilterTypeContext<Options>) => boolean;
2640
2653
  /** Render the filter form */
2641
2654
  render: <Schema extends FilterTypeSchema<Options>>(props: {
2642
2655
  schema: Schema;
@@ -2664,6 +2677,7 @@ declare const filterTypes: {
2664
2677
  readonly in: FilterTypeDefinition<string[], InFilterOptions<string>>;
2665
2678
  readonly search: FilterTypeDefinition<string>;
2666
2679
  readonly date: FilterTypeDefinition<Date | DateRange | undefined, DateFilterOptions>;
2680
+ readonly number: FilterTypeDefinition<NumberFilterValue, NumberFilterOptions>;
2667
2681
  };
2668
2682
 
2669
2683
  declare type FilterTypeSchema<Options extends object = never> = {
@@ -2679,7 +2693,7 @@ declare type FilterTypeSchema<Options extends object = never> = {
2679
2693
  * This type is used to ensure type safety when working with filter values.
2680
2694
  * @template T - The filter definition type
2681
2695
  */
2682
- export declare type FilterValue<T extends FilterDefinition> = T extends InFilterDefinition<infer U> ? U[] : T extends SearchFilterDefinition ? string : T extends DateFilterDefinition ? DateRange | Date | undefined : never;
2696
+ export declare type FilterValue<T extends FilterDefinition> = T extends InFilterDefinition<infer U> ? U[] : T extends SearchFilterDefinition ? string : T extends DateFilterDefinition ? DateRange | Date | undefined : T extends NumberFilterDefinition ? [number | undefined, number | undefined] | undefined : never;
2683
2697
 
2684
2698
  export declare type FlattenedItem = {
2685
2699
  parent: EntitySelectEntity | null;
@@ -2878,6 +2892,10 @@ export declare type HILActionConfirmationProps = {
2878
2892
 
2879
2893
  declare type HTMLString = string;
2880
2894
 
2895
+ declare type I18nContextType = TranslationsType & {
2896
+ t: (key: TranslationKey, args?: Record<string, string | number>) => string;
2897
+ };
2898
+
2881
2899
  declare const iconSizes: {
2882
2900
  readonly xs: "xs";
2883
2901
  readonly sm: "xs";
@@ -3113,6 +3131,8 @@ declare type Items = typeof Item_2 | typeof PersonItem | typeof CompanyItem | ty
3113
3131
 
3114
3132
  export declare function ItemSectionHeader({ item, children, isActive, collapsible, isExpanded, onToggleExpanded, sortable, hideChildrenCounter, }: TOCItemSectionHeaderProps): JSX_2.Element;
3115
3133
 
3134
+ declare type Join<T extends string[], D extends string> = T extends [] ? never : T extends [infer F] ? F : T extends [infer F, ...infer R] ? F extends string ? `${F}${D}${Join<Extract<R, string[]>, D>}` : never : string;
3135
+
3116
3136
  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>>;
3117
3137
 
3118
3138
  declare type KanbanLaneDefinition = {
@@ -3588,6 +3608,16 @@ export declare interface NotesTextEditorSkeletonProps {
3588
3608
  withPadding?: boolean;
3589
3609
  }
3590
3610
 
3611
+ declare type NumberFilterDefinition = BaseFilterDefinition<"number"> & {
3612
+ options?: NumberFilterOptions_2;
3613
+ };
3614
+
3615
+ declare type NumberFilterOptions_2 = {
3616
+ min?: number;
3617
+ max?: number;
3618
+ modes?: ("range" | "single")[];
3619
+ };
3620
+
3591
3621
  export declare const NumberInput: ForwardRefExoticComponent<Omit<NumberInputProps, "ref"> & RefAttributes<HTMLInputElement>>;
3592
3622
 
3593
3623
  export declare type NumberInputProps = Omit<InputProps<string>, "value" | "type" | "onChange"> & {
@@ -4056,6 +4086,10 @@ export declare type PaginationInfo = Omit<PageBasedPaginatedResponse<unknown>, "
4056
4086
  */
4057
4087
  export declare type PaginationType = "pages" | "infinite-scroll" | "no-pagination";
4058
4088
 
4089
+ declare type PathsToStringProps<T> = T extends string ? [] : {
4090
+ [K in Extract<keyof T, string>]: [K, ...PathsToStringProps<T[K]>];
4091
+ }[Extract<keyof T, string>];
4092
+
4059
4093
  declare type PersonAvatarVariant = Extract<AvatarVariant, {
4060
4094
  type: "person";
4061
4095
  }>;
@@ -5200,6 +5234,8 @@ declare interface TranscriptLabels {
5200
5234
  messagesCountSingular: string;
5201
5235
  }
5202
5236
 
5237
+ declare type TranslationKey = Join<PathsToStringProps<typeof defaultTranslations>, ".">;
5238
+
5203
5239
  declare type TranslationShape<T> = {
5204
5240
  [K in keyof T]: T[K] extends string ? string : T[K] extends Record<string, string | Record<string, unknown>> ? TranslationShape<T[K]> : never;
5205
5241
  };