@factorialco/f0-react 1.422.3 → 1.424.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
@@ -3304,6 +3304,7 @@ export declare const defaultTranslations: {
3304
3304
  readonly link: "Link";
3305
3305
  readonly date: "Date";
3306
3306
  readonly dropdownSingle: "Dropdown";
3307
+ readonly file: "File upload";
3307
3308
  };
3308
3309
  readonly selectQuestion: {
3309
3310
  readonly addOption: "Add option";
@@ -3313,6 +3314,9 @@ export declare const defaultTranslations: {
3313
3314
  readonly correct: "Correct";
3314
3315
  readonly optionPlaceholder: "Type anything you want here...";
3315
3316
  };
3317
+ readonly fileQuestion: {
3318
+ readonly uploadButton: "Upload file";
3319
+ };
3316
3320
  readonly answer: {
3317
3321
  readonly label: "Answer";
3318
3322
  readonly dropdownPlaceholder: "Pick an option";
@@ -3624,7 +3628,7 @@ export declare type DurationUnit = (typeof durationUnits)[number];
3624
3628
  export declare const durationUnits: readonly ["days", "hours", "minutes", "seconds"];
3625
3629
 
3626
3630
  /** The edit mode for a column cell in the editable table. */
3627
- declare type EditableTableCellEditType = "text" | "date" | "select" | "multiselect" | "display-only" | "disabled";
3631
+ declare type EditableTableCellEditType = "text" | "number" | "date" | "select" | "multiselect" | "display-only" | "disabled";
3628
3632
 
3629
3633
  declare type EditableTableCollectionProps<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, EditableTableVisualizationOptions<R, Filters, Sortings, Summaries>>;
3630
3634
 
@@ -3656,6 +3660,12 @@ declare type EditableTableColumnDefinition<R extends RecordType, Sortings extend
3656
3660
  * function whose return value isn't statically known.
3657
3661
  */
3658
3662
  selectConfig?: SelectCellConfig<R>;
3663
+ /**
3664
+ * Configuration for `"number"` cells. Accepts constraints (`min`, `max`),
3665
+ * stepping (`step`), formatting (`maxDecimals`, `locale`), and units.
3666
+ * Falls back to sensible defaults when omitted.
3667
+ */
3668
+ numberConfig?: NumberCellConfig;
3659
3669
  };
3660
3670
 
3661
3671
  declare type EditableTableVisualizationOptions<R extends RecordType, _Filters extends FiltersDefinition, Sortings extends SortingsDefinition, Summaries extends SummariesDefinition> = Omit<TableVisualizationOptions<R, _Filters, Sortings, Summaries>, "columns"> & {
@@ -6739,6 +6749,14 @@ declare type FileDef = {
6739
6749
  */
6740
6750
  declare type FileFieldRenderIf = CommonRenderIfCondition | F0BaseFieldRenderIfFunction;
6741
6751
 
6752
+ declare type FileQuestionProps = BaseQuestionPropsForOtherQuestionComponents & {
6753
+ type: "file";
6754
+ value?: string[] | null;
6755
+ useUpload?: UseFileUpload;
6756
+ accept?: MimeType_2[];
6757
+ maxSizeMB?: number;
6758
+ };
6759
+
6742
6760
  /**
6743
6761
  * Return type of the consumer-provided upload hook
6744
6762
  */
@@ -8099,6 +8117,15 @@ export declare interface NextStepsProps {
8099
8117
  items: StepItemProps[];
8100
8118
  }
8101
8119
 
8120
+ declare type NumberCellConfig = {
8121
+ min?: number;
8122
+ max?: number;
8123
+ step?: number;
8124
+ maxDecimals?: number;
8125
+ locale?: string;
8126
+ units?: string;
8127
+ };
8128
+
8102
8129
  /**
8103
8130
  * All valid renderIf conditions for number fields
8104
8131
  */
@@ -8330,6 +8357,9 @@ declare type OnChangeQuestionParams = BaseQuestionOnChangeParams & ({
8330
8357
  } | {
8331
8358
  type: "date";
8332
8359
  value?: Date | null;
8360
+ } | {
8361
+ type: "file";
8362
+ value?: string[] | null;
8333
8363
  });
8334
8364
 
8335
8365
  export declare type OnChangeSectionParams = {
@@ -8835,11 +8865,13 @@ export declare type QuestionElement = Omit<TextQuestionProps, QuestionPropsToOmi
8835
8865
  type: "link";
8836
8866
  }, QuestionPropsToOmit> | Omit<DateQuestionProps & {
8837
8867
  type: "date";
8868
+ }, QuestionPropsToOmit> | Omit<FileQuestionProps & {
8869
+ type: "file";
8838
8870
  }, QuestionPropsToOmit>;
8839
8871
 
8840
8872
  declare type QuestionPropsToOmit = "onAction" | "onChange" | "onAddNewElement";
8841
8873
 
8842
- export declare type QuestionType = "rating" | "select" | "multi-select" | "dropdown-single" | "text" | "longText" | "numeric" | "link" | "date";
8874
+ export declare type QuestionType = "rating" | "select" | "multi-select" | "dropdown-single" | "text" | "longText" | "numeric" | "link" | "date" | "file";
8843
8875
 
8844
8876
  export declare interface RadarChartConfig {
8845
8877
  type: "radar";
@@ -9359,7 +9391,7 @@ declare type SummaryKey<Definition extends SummariesDefinition> = Definition ext
9359
9391
 
9360
9392
  declare type SummaryType = "sum";
9361
9393
 
9362
- export declare function SurveyAnsweringForm({ elements, onSubmit: onSubmitProp, mode, title, description, resourceHeader, isOpen, onClose, position: positionProp, module, allowToChangeFullscreen, defaultValues, errorTriggerMode, loading, labels, preview, }: SurveyAnsweringFormProps): JSX_2.Element;
9394
+ export declare function SurveyAnsweringForm({ elements, onSubmit: onSubmitProp, mode, title, description, resourceHeader, isOpen, onClose, position: positionProp, module, allowToChangeFullscreen, defaultValues, errorTriggerMode, loading, labels, preview, useUpload, }: SurveyAnsweringFormProps): JSX_2.Element;
9363
9395
 
9364
9396
  declare interface SurveyAnsweringFormBaseProps {
9365
9397
  elements: SurveyFormBuilderElement[];
@@ -9375,6 +9407,7 @@ declare interface SurveyAnsweringFormBaseProps {
9375
9407
  defaultValues?: Partial<SurveyAnswers>;
9376
9408
  errorTriggerMode?: F0FormErrorTriggerMode;
9377
9409
  loading?: boolean;
9410
+ useUpload?: UseFileUpload;
9378
9411
  labels?: {
9379
9412
  empty?: {
9380
9413
  title?: string;
@@ -9430,9 +9463,12 @@ export declare type SurveyAnswerValue = {
9430
9463
  } | {
9431
9464
  type: "date";
9432
9465
  value: Date | null;
9466
+ } | {
9467
+ type: "file";
9468
+ value: string[] | null;
9433
9469
  };
9434
9470
 
9435
- export declare const SurveyFormBuilder: WithDataTestIdReturnType_7<({ elements: elementsProp, disabled, onChange, disallowOptionalQuestions, allowedQuestionTypes, applyingChanges, }: SurveyFormBuilderProps) => JSX_2.Element>;
9471
+ export declare const SurveyFormBuilder: WithDataTestIdReturnType_7<({ elements: elementsProp, disabled, onChange, disallowOptionalQuestions, allowedQuestionTypes, applyingChanges, useUpload, }: SurveyFormBuilderProps) => JSX_2.Element>;
9436
9472
 
9437
9473
  export declare type SurveyFormBuilderCallbacks = {
9438
9474
  onQuestionChange?: (params: OnChangeQuestionParams) => void;
@@ -9456,6 +9492,7 @@ export declare type SurveyFormBuilderProps = {
9456
9492
  disallowOptionalQuestions?: boolean;
9457
9493
  allowedQuestionTypes?: QuestionType[];
9458
9494
  applyingChanges?: boolean;
9495
+ useUpload?: UseFileUpload;
9459
9496
  };
9460
9497
 
9461
9498
  export declare type SurveyFormSubmitResult = {
@@ -10821,10 +10858,8 @@ declare module "@tiptap/core" {
10821
10858
 
10822
10859
  declare module "@tiptap/core" {
10823
10860
  interface Commands<ReturnType> {
10824
- videoEmbed: {
10825
- setVideoEmbed: (options: {
10826
- src: string;
10827
- }) => ReturnType;
10861
+ transcript: {
10862
+ insertTranscript: (data: TranscriptData) => ReturnType;
10828
10863
  };
10829
10864
  }
10830
10865
  }
@@ -10832,8 +10867,10 @@ declare module "@tiptap/core" {
10832
10867
 
10833
10868
  declare module "@tiptap/core" {
10834
10869
  interface Commands<ReturnType> {
10835
- transcript: {
10836
- insertTranscript: (data: TranscriptData) => ReturnType;
10870
+ videoEmbed: {
10871
+ setVideoEmbed: (options: {
10872
+ src: string;
10873
+ }) => ReturnType;
10837
10874
  };
10838
10875
  }
10839
10876
  }