@factorialco/f0-react 1.381.0 → 1.383.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/{DataCollectionStorageProvider-DBnav5cC.js → DataCollectionStorageProvider-BBLgXK15.js} +1 -1
- package/dist/{F0AiChat-DvWln9wK.js → F0AiChat-CXEcOhNF.js} +323 -321
- package/dist/{F0HILActionConfirmation-DRfQGPsn.js → F0HILActionConfirmation-D_4woM1M.js} +1 -1
- package/dist/ai.d.ts +18 -0
- package/dist/ai.js +2 -2
- package/dist/experimental.d.ts +18 -0
- package/dist/experimental.js +5 -5
- package/dist/f0.d.ts +398 -10
- package/dist/f0.js +6092 -4904
- package/dist/i18n-provider-defaults.d.ts +18 -0
- package/dist/i18n-provider-defaults.js +18 -0
- package/dist/styles.css +1 -1
- package/package.json +2 -2
package/dist/f0.d.ts
CHANGED
|
@@ -49,6 +49,8 @@ import { F0AvatarListProps as F0AvatarListProps_2 } from './types';
|
|
|
49
49
|
import { F0AvatarPersonProps as F0AvatarPersonProps_2 } from './types';
|
|
50
50
|
import { F0AvatarTeamProps as F0AvatarTeamProps_2 } from './F0AvatarTeam';
|
|
51
51
|
import { F0DialogInternalProps } from './internal-types';
|
|
52
|
+
import { F0FormDefinitionPerSection as F0FormDefinitionPerSection_2 } from '../F0WizardForm/types';
|
|
53
|
+
import { F0FormDefinitionSingleSchema as F0FormDefinitionSingleSchema_2 } from '../F0WizardForm/types';
|
|
52
54
|
import { F0GridStackProps as F0GridStackProps_2 } from './F0GridStack';
|
|
53
55
|
import { F0TagBalanceProps } from './types';
|
|
54
56
|
import { F0TagCompanyProps } from './types';
|
|
@@ -2584,6 +2586,18 @@ export declare const defaultTranslations: {
|
|
|
2584
2586
|
readonly other: "{{count}} issues";
|
|
2585
2587
|
};
|
|
2586
2588
|
};
|
|
2589
|
+
readonly file: {
|
|
2590
|
+
readonly dropzone: "Drag and drop a file, or click to select";
|
|
2591
|
+
readonly dropzoneActive: "Drop the file here";
|
|
2592
|
+
readonly dropzoneMultiple: "Drag and drop files, or click to select";
|
|
2593
|
+
readonly acceptedTypes: "Accepted formats: {{types}}";
|
|
2594
|
+
readonly remove: "Remove";
|
|
2595
|
+
readonly uploading: "Uploading…";
|
|
2596
|
+
readonly processing: "Processing…";
|
|
2597
|
+
readonly uploadFailed: "Upload failed";
|
|
2598
|
+
readonly fileTooLarge: "File exceeds {{maxSize}} MB limit";
|
|
2599
|
+
readonly invalidFileType: "File type not accepted. Accepted formats: {{types}}";
|
|
2600
|
+
};
|
|
2587
2601
|
readonly validation: {
|
|
2588
2602
|
readonly required: "This field is required";
|
|
2589
2603
|
readonly invalidType: "Invalid value";
|
|
@@ -2614,6 +2628,12 @@ export declare const defaultTranslations: {
|
|
|
2614
2628
|
};
|
|
2615
2629
|
};
|
|
2616
2630
|
};
|
|
2631
|
+
readonly wizard: {
|
|
2632
|
+
readonly previous: "Previous";
|
|
2633
|
+
readonly next: "Continue";
|
|
2634
|
+
readonly submit: "Submit";
|
|
2635
|
+
readonly stepOf: "Step {{current}} of {{total}}";
|
|
2636
|
+
};
|
|
2617
2637
|
};
|
|
2618
2638
|
|
|
2619
2639
|
export declare type DialogPosition = (typeof dialogPositions)[number];
|
|
@@ -2881,11 +2901,26 @@ export declare interface F0AlertProps {
|
|
|
2881
2901
|
}
|
|
2882
2902
|
|
|
2883
2903
|
/**
|
|
2884
|
-
* Config for array fields (multi-select)
|
|
2904
|
+
* Config for array fields (multi-select or multi-file)
|
|
2885
2905
|
* @typeParam T - The value type (string or number)
|
|
2886
2906
|
* @typeParam R - Record type for data source (when using source instead of options)
|
|
2887
2907
|
*/
|
|
2888
|
-
export declare type F0ArrayConfig<T extends string | number = string, R extends Record<string, unknown> = Record<string, unknown>> =
|
|
2908
|
+
export declare type F0ArrayConfig<T extends string | number = string, R extends Record<string, unknown> = Record<string, unknown>> = F0ArraySelectConfig<T, R> | F0ArrayFileConfig;
|
|
2909
|
+
|
|
2910
|
+
/**
|
|
2911
|
+
* Config for file fields (multiple file upload, form value is string[])
|
|
2912
|
+
*/
|
|
2913
|
+
declare type F0ArrayFileConfig = F0BaseConfig & F0FileConfig & {
|
|
2914
|
+
fieldType: "file";
|
|
2915
|
+
multiple: true;
|
|
2916
|
+
};
|
|
2917
|
+
|
|
2918
|
+
/**
|
|
2919
|
+
* Config for array fields with select (multi-select)
|
|
2920
|
+
* @typeParam T - The value type (string or number)
|
|
2921
|
+
* @typeParam R - Record type for data source (when using source instead of options)
|
|
2922
|
+
*/
|
|
2923
|
+
declare type F0ArraySelectConfig<T extends string | number = string, R extends Record<string, unknown> = Record<string, unknown>> = F0BaseConfig & F0SelectConfig<T, R> & {
|
|
2889
2924
|
fieldType?: "select";
|
|
2890
2925
|
};
|
|
2891
2926
|
|
|
@@ -3741,19 +3776,66 @@ export declare function F0EventCatcherProvider({ children, onEvent, enabled, cat
|
|
|
3741
3776
|
/**
|
|
3742
3777
|
* Union of all F0 field types used for rendering
|
|
3743
3778
|
*/
|
|
3744
|
-
export declare type F0Field = F0TextField | F0NumberField | F0TextareaField | F0SelectField | F0CheckboxField | F0SwitchField | F0DateField | F0TimeField | F0DateTimeField | F0DateRangeField | F0RichTextField | F0CustomField;
|
|
3779
|
+
export declare type F0Field = F0TextField | F0NumberField | F0TextareaField | F0SelectField | F0CheckboxField | F0SwitchField | F0DateField | F0TimeField | F0DateTimeField | F0DateRangeField | F0RichTextField | F0FileField | F0CustomField;
|
|
3745
3780
|
|
|
3746
3781
|
/**
|
|
3747
3782
|
* Complete F0 field configuration (union of all possible configs)
|
|
3748
3783
|
* @typeParam T - The value type for select fields (string or number)
|
|
3749
3784
|
* @typeParam R - Record type for data source (when using source instead of options)
|
|
3750
3785
|
*/
|
|
3751
|
-
export declare type F0FieldConfig<T extends string | number = string | number, R extends Record<string, unknown> = Record<string, unknown>> = F0StringConfig<string, undefined, R> | F0NumberFieldConfig<R> | F0BooleanConfig | F0DateFieldConfig | F0TimeFieldConfig | F0DateTimeFieldConfig | F0ArrayConfig<T, R> | F0ObjectConfig;
|
|
3786
|
+
export declare type F0FieldConfig<T extends string | number = string | number, R extends Record<string, unknown> = Record<string, unknown>> = F0StringConfig<string, undefined, R> | F0NumberFieldConfig<R> | F0BooleanConfig | F0DateFieldConfig | F0TimeFieldConfig | F0DateTimeFieldConfig | F0ArrayConfig<T, R> | F0FileFieldConfig | F0ObjectConfig;
|
|
3752
3787
|
|
|
3753
3788
|
/**
|
|
3754
3789
|
* Field types for rendering
|
|
3755
3790
|
*/
|
|
3756
|
-
export declare type F0FieldType = "text" | "number" | "textarea" | "select" | "checkbox" | "switch" | "date" | "time" | "datetime" | "daterange" | "richtext" | "custom";
|
|
3791
|
+
export declare type F0FieldType = "text" | "number" | "textarea" | "select" | "checkbox" | "switch" | "date" | "time" | "datetime" | "daterange" | "richtext" | "file" | "custom";
|
|
3792
|
+
|
|
3793
|
+
/**
|
|
3794
|
+
* F0 config options specific to file fields
|
|
3795
|
+
*/
|
|
3796
|
+
export declare interface F0FileConfig {
|
|
3797
|
+
/**
|
|
3798
|
+
* Accepted MIME types.
|
|
3799
|
+
*
|
|
3800
|
+
* @example
|
|
3801
|
+
* accept: ["image"] // all image types
|
|
3802
|
+
* accept: ["image/png", "image/jpeg"] // specific types
|
|
3803
|
+
* accept: ["image", "application/pdf"] // mix of category and specific
|
|
3804
|
+
*/
|
|
3805
|
+
accept?: MimeType_2[];
|
|
3806
|
+
/** Maximum file size in megabytes (per file) */
|
|
3807
|
+
maxSizeMB?: number;
|
|
3808
|
+
/** Allow multiple file uploads (form value becomes `string[]`) */
|
|
3809
|
+
multiple?: boolean;
|
|
3810
|
+
/** Helper text shown in the dropzone area */
|
|
3811
|
+
description?: string;
|
|
3812
|
+
/** Consumer-provided hook that returns upload capabilities */
|
|
3813
|
+
useUpload: UseFileUpload;
|
|
3814
|
+
}
|
|
3815
|
+
|
|
3816
|
+
/**
|
|
3817
|
+
* File field with all properties for rendering (runtime type)
|
|
3818
|
+
*/
|
|
3819
|
+
export declare type F0FileField = F0BaseField & {
|
|
3820
|
+
type: "file";
|
|
3821
|
+
/** Accepted MIME types */
|
|
3822
|
+
accept?: MimeType_2[];
|
|
3823
|
+
/** Maximum file size in megabytes */
|
|
3824
|
+
maxSizeMB?: number;
|
|
3825
|
+
/** Allow multiple files */
|
|
3826
|
+
multiple?: boolean;
|
|
3827
|
+
/** Dropzone description text */
|
|
3828
|
+
description?: string;
|
|
3829
|
+
/** Consumer-provided upload hook */
|
|
3830
|
+
useUpload: UseFileUpload;
|
|
3831
|
+
/** Conditional rendering */
|
|
3832
|
+
renderIf?: FileFieldRenderIf;
|
|
3833
|
+
};
|
|
3834
|
+
|
|
3835
|
+
/**
|
|
3836
|
+
* Union of all file field configs
|
|
3837
|
+
*/
|
|
3838
|
+
export declare type F0FileFieldConfig = F0StringFileConfig | F0ArrayFileConfig;
|
|
3757
3839
|
|
|
3758
3840
|
export declare const F0FilterPickerContent: F0FilterPickerContentGeneric;
|
|
3759
3841
|
|
|
@@ -3789,6 +3871,8 @@ export declare type F0FilterPickerContentPublicProps<Filters extends FiltersDefi
|
|
|
3789
3871
|
export declare const F0Form: {
|
|
3790
3872
|
<TSchema extends F0FormSchema>(props: F0FormPropsWithSingleSchema<TSchema>): React.ReactElement;
|
|
3791
3873
|
<T extends F0PerSectionSchema>(props: F0FormPropsWithPerSectionSchema<T>): React.ReactElement;
|
|
3874
|
+
<TSchema extends F0FormSchema>(props: F0FormPropsWithSingleSchemaDefinition<TSchema>): React.ReactElement;
|
|
3875
|
+
<T extends F0PerSectionSchema>(props: F0FormPropsWithPerSectionDefinition<T>): React.ReactElement;
|
|
3792
3876
|
};
|
|
3793
3877
|
|
|
3794
3878
|
/**
|
|
@@ -3829,6 +3913,38 @@ declare interface F0FormDefaultSubmitConfig extends F0FormSubmitConfigBase {
|
|
|
3829
3913
|
* @default false
|
|
3830
3914
|
*/
|
|
3831
3915
|
hideSubmitButton?: boolean;
|
|
3916
|
+
/**
|
|
3917
|
+
* When true, hides the internal action bar (loading/success feedback).
|
|
3918
|
+
* Useful when the parent component provides its own action bar.
|
|
3919
|
+
* @default false
|
|
3920
|
+
*/
|
|
3921
|
+
hideActionBar?: boolean;
|
|
3922
|
+
}
|
|
3923
|
+
|
|
3924
|
+
export declare type F0FormDefinition<T extends F0FormSchema_2 | F0PerSectionSchema_2 = F0FormSchema_2 | F0PerSectionSchema_2> = T extends F0FormSchema_2 ? F0FormDefinitionSingleSchema<T> : T extends F0PerSectionSchema_2 ? F0FormDefinitionPerSection<T> : never;
|
|
3925
|
+
|
|
3926
|
+
export declare interface F0FormDefinitionPerSection<T extends F0PerSectionSchema_2> {
|
|
3927
|
+
/* Excluded from this release type: _brand */
|
|
3928
|
+
name: string;
|
|
3929
|
+
schema: T;
|
|
3930
|
+
sections?: Record<string, F0PerSectionSectionConfig>;
|
|
3931
|
+
defaultValues?: {
|
|
3932
|
+
[K in keyof T]?: Partial<z.infer<T[K]>>;
|
|
3933
|
+
};
|
|
3934
|
+
onSubmit: (arg: F0WizardFormPerSectionSubmitArg<T>) => Promise<F0FormSubmitResult> | F0FormSubmitResult;
|
|
3935
|
+
submitConfig?: F0PerSectionSubmitConfig;
|
|
3936
|
+
errorTriggerMode?: F0FormErrorTriggerMode;
|
|
3937
|
+
}
|
|
3938
|
+
|
|
3939
|
+
export declare interface F0FormDefinitionSingleSchema<TSchema extends F0FormSchema_2> {
|
|
3940
|
+
/* Excluded from this release type: _brand */
|
|
3941
|
+
name: string;
|
|
3942
|
+
schema: TSchema;
|
|
3943
|
+
sections?: Record<string, F0SectionConfig>;
|
|
3944
|
+
defaultValues?: Partial<z.infer<TSchema>>;
|
|
3945
|
+
onSubmit: (arg: F0WizardFormSingleSubmitArg<TSchema>) => Promise<F0FormSubmitResult> | F0FormSubmitResult;
|
|
3946
|
+
submitConfig?: F0FormSubmitConfig;
|
|
3947
|
+
errorTriggerMode?: F0FormErrorTriggerMode;
|
|
3832
3948
|
}
|
|
3833
3949
|
|
|
3834
3950
|
/**
|
|
@@ -3930,11 +4046,24 @@ export declare function f0FormField<T extends ZodTypeAny, TConfig = undefined>(s
|
|
|
3930
4046
|
export declare function f0FormField<T extends ZodTypeAny, V extends string | number = string | number, R extends Record<string, unknown> = Record<string, unknown>>(schema: T, config: F0FieldConfig<V, R>): T & F0ZodType<T>;
|
|
3931
4047
|
|
|
3932
4048
|
/**
|
|
3933
|
-
* Union of
|
|
4049
|
+
* Union of all F0Form prop variants.
|
|
3934
4050
|
* The component detects the mode based on whether `schema` is a single Zod schema
|
|
3935
|
-
* or a record of schemas keyed by section ID.
|
|
4051
|
+
* or a record of schemas keyed by section ID, or whether a `formDefinition` is provided.
|
|
3936
4052
|
*/
|
|
3937
|
-
export declare type F0FormProps<TSchema extends F0FormSchema | F0PerSectionSchema = F0FormSchema | F0PerSectionSchema> = TSchema extends F0FormSchema ? F0FormPropsWithSingleSchema<TSchema> : TSchema extends F0PerSectionSchema ? F0FormPropsWithPerSectionSchema<TSchema> : never;
|
|
4053
|
+
export declare type F0FormProps<TSchema extends F0FormSchema | F0PerSectionSchema = F0FormSchema | F0PerSectionSchema> = TSchema extends F0FormSchema ? F0FormPropsWithSingleSchema<TSchema> | F0FormPropsWithSingleSchemaDefinition<TSchema> : TSchema extends F0PerSectionSchema ? F0FormPropsWithPerSectionSchema<TSchema> | F0FormPropsWithPerSectionDefinition<TSchema> : never;
|
|
4054
|
+
|
|
4055
|
+
/**
|
|
4056
|
+
* Props for F0Form using a formDefinition (per-section schema mode).
|
|
4057
|
+
* Form-related props are extracted from the definition; only rendering/integration
|
|
4058
|
+
* props are passed directly.
|
|
4059
|
+
*/
|
|
4060
|
+
export declare interface F0FormPropsWithPerSectionDefinition<T extends F0PerSectionSchema> {
|
|
4061
|
+
formDefinition: F0FormDefinitionPerSection_2<T>;
|
|
4062
|
+
className?: string;
|
|
4063
|
+
styling?: F0FormStylingConfig;
|
|
4064
|
+
formRef?: React.MutableRefObject<F0FormRef | null>;
|
|
4065
|
+
initialFiles?: InitialFile[];
|
|
4066
|
+
}
|
|
3938
4067
|
|
|
3939
4068
|
/**
|
|
3940
4069
|
* Props for the F0Form component (per-section schema mode).
|
|
@@ -3971,6 +4100,12 @@ export declare interface F0FormPropsWithPerSectionSchema<T extends F0PerSectionS
|
|
|
3971
4100
|
* Ref to control the form programmatically from outside.
|
|
3972
4101
|
*/
|
|
3973
4102
|
formRef?: React.MutableRefObject<F0FormRef | null>;
|
|
4103
|
+
/**
|
|
4104
|
+
* Pre-existing file metadata shared across all file fields.
|
|
4105
|
+
* Each file field automatically resolves its entries by matching
|
|
4106
|
+
* `defaultValues` against `InitialFile.value`.
|
|
4107
|
+
*/
|
|
4108
|
+
initialFiles?: InitialFile[];
|
|
3974
4109
|
}
|
|
3975
4110
|
|
|
3976
4111
|
/**
|
|
@@ -4009,6 +4144,25 @@ export declare interface F0FormPropsWithSingleSchema<TSchema extends F0FormSchem
|
|
|
4009
4144
|
* Use with the `useF0Form` hook to get a ref and submit/reset functions.
|
|
4010
4145
|
*/
|
|
4011
4146
|
formRef?: React.MutableRefObject<F0FormRef | null>;
|
|
4147
|
+
/**
|
|
4148
|
+
* Pre-existing file metadata shared across all file fields.
|
|
4149
|
+
* Each file field automatically resolves its entries by matching
|
|
4150
|
+
* `defaultValues` against `InitialFile.value`.
|
|
4151
|
+
*/
|
|
4152
|
+
initialFiles?: InitialFile[];
|
|
4153
|
+
}
|
|
4154
|
+
|
|
4155
|
+
/**
|
|
4156
|
+
* Props for F0Form using a formDefinition (single schema mode).
|
|
4157
|
+
* Form-related props are extracted from the definition; only rendering/integration
|
|
4158
|
+
* props are passed directly.
|
|
4159
|
+
*/
|
|
4160
|
+
export declare interface F0FormPropsWithSingleSchemaDefinition<TSchema extends F0FormSchema> {
|
|
4161
|
+
formDefinition: F0FormDefinitionSingleSchema_2<TSchema>;
|
|
4162
|
+
className?: string;
|
|
4163
|
+
styling?: F0FormStylingConfig;
|
|
4164
|
+
formRef?: React.MutableRefObject<F0FormRef | null>;
|
|
4165
|
+
initialFiles?: InitialFile[];
|
|
4012
4166
|
}
|
|
4013
4167
|
|
|
4014
4168
|
/**
|
|
@@ -4029,6 +4183,10 @@ export declare interface F0FormRef {
|
|
|
4029
4183
|
* Check if the form has unsaved changes
|
|
4030
4184
|
*/
|
|
4031
4185
|
isDirty: () => boolean;
|
|
4186
|
+
/**
|
|
4187
|
+
* Get the current form values (including unsaved changes)
|
|
4188
|
+
*/
|
|
4189
|
+
getValues: () => Record<string, unknown>;
|
|
4032
4190
|
/* Excluded from this release type: _setStateCallback */
|
|
4033
4191
|
}
|
|
4034
4192
|
|
|
@@ -4037,6 +4195,8 @@ export declare interface F0FormRef {
|
|
|
4037
4195
|
*/
|
|
4038
4196
|
export declare type F0FormSchema<T extends ZodRawShape = ZodRawShape> = z.ZodObject<T> | ZodEffects<z.ZodObject<T>>;
|
|
4039
4197
|
|
|
4198
|
+
declare type F0FormSchema_2<T extends ZodRawShape = ZodRawShape> = z.ZodObject<T> | ZodEffects<z.ZodObject<T>>;
|
|
4199
|
+
|
|
4040
4200
|
/**
|
|
4041
4201
|
* Callback to update form state in the hook
|
|
4042
4202
|
*/
|
|
@@ -4279,6 +4439,8 @@ export declare type F0OneSwitchProps = React.ComponentPropsWithoutRef<typeof Swi
|
|
|
4279
4439
|
*/
|
|
4280
4440
|
export declare type F0PerSectionSchema = Record<string, F0FormSchema>;
|
|
4281
4441
|
|
|
4442
|
+
declare type F0PerSectionSchema_2 = Record<string, F0FormSchema_2>;
|
|
4443
|
+
|
|
4282
4444
|
/**
|
|
4283
4445
|
* Section configuration for per-section schema mode.
|
|
4284
4446
|
* Extends F0SectionConfig with per-section submit and default values.
|
|
@@ -4307,6 +4469,12 @@ export declare interface F0PerSectionSubmitConfig {
|
|
|
4307
4469
|
* @default false
|
|
4308
4470
|
*/
|
|
4309
4471
|
showSubmitWhenDirty?: boolean;
|
|
4472
|
+
/**
|
|
4473
|
+
* When true, hides the submit button.
|
|
4474
|
+
* Useful when submission is controlled externally (e.g. inside F0WizardForm).
|
|
4475
|
+
* @default false
|
|
4476
|
+
*/
|
|
4477
|
+
hideSubmitButton?: boolean;
|
|
4310
4478
|
}
|
|
4311
4479
|
|
|
4312
4480
|
export declare const F0Provider: React.FC<{
|
|
@@ -4595,7 +4763,15 @@ export declare type F0Source = {
|
|
|
4595
4763
|
* @typeParam TConfig - Type of the fieldConfig object (for custom fields)
|
|
4596
4764
|
* @typeParam R - Record type for data source (when using source instead of options)
|
|
4597
4765
|
*/
|
|
4598
|
-
export declare type F0StringConfig<TValue = string, TConfig = undefined, R extends Record<string, unknown> = Record<string, unknown>> = F0StringTextConfig | F0StringTextareaConfig | F0StringSelectConfig<R> | F0CustomFieldConfig<TValue, TConfig>;
|
|
4766
|
+
export declare type F0StringConfig<TValue = string, TConfig = undefined, R extends Record<string, unknown> = Record<string, unknown>> = F0StringTextConfig | F0StringTextareaConfig | F0StringSelectConfig<R> | F0StringFileConfig | F0CustomFieldConfig<TValue, TConfig>;
|
|
4767
|
+
|
|
4768
|
+
/**
|
|
4769
|
+
* Config for file fields (single file upload, form value is a string identifier)
|
|
4770
|
+
*/
|
|
4771
|
+
declare type F0StringFileConfig = F0BaseConfig & F0FileConfig & {
|
|
4772
|
+
fieldType: "file";
|
|
4773
|
+
multiple?: false;
|
|
4774
|
+
};
|
|
4599
4775
|
|
|
4600
4776
|
/**
|
|
4601
4777
|
* Config for string fields with select options
|
|
@@ -4810,6 +4986,104 @@ declare type F0TimeFieldConfig = F0BaseConfig & F0TimeConfig & {
|
|
|
4810
4986
|
fieldType: "time";
|
|
4811
4987
|
};
|
|
4812
4988
|
|
|
4989
|
+
export declare const F0WizardForm: {
|
|
4990
|
+
<TSchema extends F0FormSchema_2>(props: F0WizardFormSingleSchemaProps<TSchema>): default_2.ReactElement;
|
|
4991
|
+
<T extends F0PerSectionSchema_2>(props: F0WizardFormPerSectionProps<T>): default_2.ReactElement;
|
|
4992
|
+
};
|
|
4993
|
+
|
|
4994
|
+
declare interface F0WizardFormBaseProps {
|
|
4995
|
+
isOpen: boolean;
|
|
4996
|
+
onClose?: () => void;
|
|
4997
|
+
title?: string;
|
|
4998
|
+
width?: DialogWidth;
|
|
4999
|
+
defaultStepIndex?: number;
|
|
5000
|
+
nextLabel?: string;
|
|
5001
|
+
previousLabel?: string;
|
|
5002
|
+
onStepChanged?: (stepIndex: number) => void;
|
|
5003
|
+
steps?: F0WizardFormStep[];
|
|
5004
|
+
/**
|
|
5005
|
+
* When true, users can click on any step that is not explicitly marked
|
|
5006
|
+
* as incomplete (i.e. its `isCompleted` callback does not return `false`)
|
|
5007
|
+
* to jump to it.
|
|
5008
|
+
* When false (default), users must navigate sequentially using Next/Previous.
|
|
5009
|
+
* @default false
|
|
5010
|
+
*/
|
|
5011
|
+
allowStepSkipping?: boolean;
|
|
5012
|
+
/**
|
|
5013
|
+
* When true, the wizard automatically closes after the last step's
|
|
5014
|
+
* onSubmit returns `{ success: true }`.
|
|
5015
|
+
* Also implied when `linkAfterLastStepSubmit` is provided.
|
|
5016
|
+
* @default false
|
|
5017
|
+
*/
|
|
5018
|
+
autoCloseOnLastStepSubmit?: boolean;
|
|
5019
|
+
/**
|
|
5020
|
+
* When true, the wizard automatically skips to the first non-completed step
|
|
5021
|
+
* on open. A step is completed when all required fields have values, or when
|
|
5022
|
+
* the step's custom `isCompleted` function returns true.
|
|
5023
|
+
* Only applies on initial render; users can still navigate back freely.
|
|
5024
|
+
* @default false
|
|
5025
|
+
*/
|
|
5026
|
+
autoSkipCompletedSteps?: boolean;
|
|
5027
|
+
}
|
|
5028
|
+
|
|
5029
|
+
export declare interface F0WizardFormPerSectionProps<T extends F0PerSectionSchema_2> extends F0WizardFormBaseProps {
|
|
5030
|
+
formDefinition: F0FormDefinitionPerSection<T>;
|
|
5031
|
+
/**
|
|
5032
|
+
* Function that receives the submitted data and returns a URL to navigate to
|
|
5033
|
+
* after the last step's onSubmit returns `{ success: true }`.
|
|
5034
|
+
* When provided, the wizard auto-closes and navigates to the returned URL.
|
|
5035
|
+
*/
|
|
5036
|
+
linkAfterLastStepSubmit?: (arg: {
|
|
5037
|
+
fullData: InferPerSectionValues_2<T>;
|
|
5038
|
+
}) => string;
|
|
5039
|
+
}
|
|
5040
|
+
|
|
5041
|
+
/**
|
|
5042
|
+
* Per-section submit argument: discriminated union where sectionId narrows data.
|
|
5043
|
+
* fullData always contains all sections' latest values.
|
|
5044
|
+
*/
|
|
5045
|
+
export declare type F0WizardFormPerSectionSubmitArg<T extends F0PerSectionSchema_2> = {
|
|
5046
|
+
[K in keyof T & string]: {
|
|
5047
|
+
sectionId: K;
|
|
5048
|
+
data: z.infer<T[K]>;
|
|
5049
|
+
fullData: InferPerSectionValues_2<T>;
|
|
5050
|
+
};
|
|
5051
|
+
}[keyof T & string];
|
|
5052
|
+
|
|
5053
|
+
export declare interface F0WizardFormSingleSchemaProps<TSchema extends F0FormSchema_2> extends F0WizardFormBaseProps {
|
|
5054
|
+
formDefinition: F0FormDefinitionSingleSchema<TSchema>;
|
|
5055
|
+
/**
|
|
5056
|
+
* Function that receives the submitted data and returns a URL to navigate to
|
|
5057
|
+
* after the last step's onSubmit returns `{ success: true }`.
|
|
5058
|
+
* When provided, the wizard auto-closes and navigates to the returned URL.
|
|
5059
|
+
*/
|
|
5060
|
+
linkAfterLastStepSubmit?: (arg: {
|
|
5061
|
+
fullData: z.infer<TSchema>;
|
|
5062
|
+
}) => string;
|
|
5063
|
+
}
|
|
5064
|
+
|
|
5065
|
+
/**
|
|
5066
|
+
* Single-schema submit argument: data is the full form.
|
|
5067
|
+
*/
|
|
5068
|
+
export declare interface F0WizardFormSingleSubmitArg<TSchema extends F0FormSchema_2> {
|
|
5069
|
+
data: z.infer<TSchema>;
|
|
5070
|
+
}
|
|
5071
|
+
|
|
5072
|
+
export declare interface F0WizardFormStep {
|
|
5073
|
+
title: string;
|
|
5074
|
+
sectionIds: string[];
|
|
5075
|
+
nextLabel?: string;
|
|
5076
|
+
previousLabel?: string;
|
|
5077
|
+
/**
|
|
5078
|
+
* Custom function to determine if this step is considered completed.
|
|
5079
|
+
* Receives the step's current data. When provided, takes precedence
|
|
5080
|
+
* over the default "all required fields filled" check.
|
|
5081
|
+
*/
|
|
5082
|
+
isCompleted?: (arg: {
|
|
5083
|
+
data: Record<string, unknown>;
|
|
5084
|
+
}) => boolean;
|
|
5085
|
+
}
|
|
5086
|
+
|
|
4813
5087
|
/**
|
|
4814
5088
|
* Extended Zod type with F0 metadata
|
|
4815
5089
|
*/
|
|
@@ -4823,7 +5097,7 @@ export declare interface F0ZodType<T extends ZodTypeAny = ZodTypeAny> {
|
|
|
4823
5097
|
/**
|
|
4824
5098
|
* Field types for rendering
|
|
4825
5099
|
*/
|
|
4826
|
-
export declare type FieldType = "text" | "number" | "textarea" | "select" | "checkbox" | "switch" | "date" | "time" | "datetime" | "daterange" | "richtext" | "custom";
|
|
5100
|
+
export declare type FieldType = "text" | "number" | "textarea" | "select" | "checkbox" | "switch" | "date" | "time" | "datetime" | "daterange" | "richtext" | "file" | "custom";
|
|
4827
5101
|
|
|
4828
5102
|
export declare type FileAvatarVariant = Extract<AvatarVariant, {
|
|
4829
5103
|
type: "file";
|
|
@@ -4834,6 +5108,41 @@ declare type FileDef = {
|
|
|
4834
5108
|
type: string;
|
|
4835
5109
|
};
|
|
4836
5110
|
|
|
5111
|
+
/**
|
|
5112
|
+
* All valid renderIf conditions for file fields
|
|
5113
|
+
*/
|
|
5114
|
+
declare type FileFieldRenderIf = CommonRenderIfCondition | F0BaseFieldRenderIfFunction;
|
|
5115
|
+
|
|
5116
|
+
/**
|
|
5117
|
+
* Return type of the consumer-provided upload hook
|
|
5118
|
+
*/
|
|
5119
|
+
export declare interface FileUploadHookReturn {
|
|
5120
|
+
/** Uploads a file and returns the result */
|
|
5121
|
+
upload: (file: File) => Promise<FileUploadResult>;
|
|
5122
|
+
/** Cancels the in-flight upload */
|
|
5123
|
+
cancelUpload?: () => void;
|
|
5124
|
+
/** Upload progress from 0 to 1 */
|
|
5125
|
+
progress: number;
|
|
5126
|
+
/** Current upload status */
|
|
5127
|
+
status: FileUploadStatus;
|
|
5128
|
+
}
|
|
5129
|
+
|
|
5130
|
+
/**
|
|
5131
|
+
* Result of a file upload operation.
|
|
5132
|
+
* `value` is the identifier stored as the form value (e.g. a signedId, URL, or any string).
|
|
5133
|
+
*/
|
|
5134
|
+
export declare type FileUploadResult = {
|
|
5135
|
+
type: "success";
|
|
5136
|
+
value: string;
|
|
5137
|
+
} | {
|
|
5138
|
+
type: "aborted";
|
|
5139
|
+
};
|
|
5140
|
+
|
|
5141
|
+
/**
|
|
5142
|
+
* Upload status states
|
|
5143
|
+
*/
|
|
5144
|
+
export declare type FileUploadStatus = "idle" | "processing" | "uploading" | "success";
|
|
5145
|
+
|
|
4837
5146
|
/**
|
|
4838
5147
|
* Union of all available filter types.
|
|
4839
5148
|
* Used to define possible filter configurations in a collection.
|
|
@@ -5317,6 +5626,10 @@ export declare type InferPerSectionValues<T extends F0PerSectionSchema> = {
|
|
|
5317
5626
|
[K in keyof T]: z.infer<T[K]>;
|
|
5318
5627
|
};
|
|
5319
5628
|
|
|
5629
|
+
declare type InferPerSectionValues_2<T extends F0PerSectionSchema_2> = {
|
|
5630
|
+
[K in keyof T]: z.infer<T[K]>;
|
|
5631
|
+
};
|
|
5632
|
+
|
|
5320
5633
|
export declare type InFilterDefinition<T = string | number, R extends RecordType = RecordType> = BaseFilterDefinition<"in"> & {
|
|
5321
5634
|
options: InFilterOptions_2<T, R>;
|
|
5322
5635
|
};
|
|
@@ -5392,6 +5705,21 @@ export declare type InfiniteScrollPaginatedResponse<TRecord> = BasePaginatedResp
|
|
|
5392
5705
|
hasMore: boolean;
|
|
5393
5706
|
};
|
|
5394
5707
|
|
|
5708
|
+
/**
|
|
5709
|
+
* Metadata for a file that already exists (e.g. from a previous upload).
|
|
5710
|
+
* Passed via `initialFiles` so the field can display it without re-uploading.
|
|
5711
|
+
*/
|
|
5712
|
+
export declare interface InitialFile {
|
|
5713
|
+
/** The identifier that matches the form's default value (signedId, URL, etc.) */
|
|
5714
|
+
value: string;
|
|
5715
|
+
/** Display name (e.g. "report.pdf") */
|
|
5716
|
+
name: string;
|
|
5717
|
+
/** MIME type for icon display (e.g. "application/pdf") */
|
|
5718
|
+
type?: string;
|
|
5719
|
+
/** File size in bytes */
|
|
5720
|
+
size?: number;
|
|
5721
|
+
}
|
|
5722
|
+
|
|
5395
5723
|
declare const INPUTFIELD_SIZES: readonly ["sm", "md"];
|
|
5396
5724
|
|
|
5397
5725
|
declare type InputFieldInheritedProps = (typeof inputFieldInheritedProps)[number];
|
|
@@ -5656,6 +5984,20 @@ declare type MentionsConfig = {
|
|
|
5656
5984
|
users: MentionedUser[];
|
|
5657
5985
|
};
|
|
5658
5986
|
|
|
5987
|
+
/**
|
|
5988
|
+
* Known MIME types for the file field `accept` prop.
|
|
5989
|
+
*
|
|
5990
|
+
* Supports three formats:
|
|
5991
|
+
* - Specific types: `"image/png"`, `"application/pdf"`
|
|
5992
|
+
* - Wildcard categories: `"image/*"`, `"video/*"`
|
|
5993
|
+
* - Bare categories (shorthand for wildcard): `"image"`, `"video"`
|
|
5994
|
+
*
|
|
5995
|
+
* The `string & {}` escape hatch allows unlisted MIME types while
|
|
5996
|
+
* still providing autocomplete for known ones.
|
|
5997
|
+
*/
|
|
5998
|
+
declare type MimeType_2 = "image" | "video" | "audio" | "text" | "application" | "image/*" | "video/*" | "audio/*" | "text/*" | "application/*" | "image/jpeg" | "image/png" | "image/gif" | "image/webp" | "image/svg+xml" | "image/heic" | "image/bmp" | "image/tiff" | "image/avif" | "video/mp4" | "video/webm" | "video/quicktime" | "audio/mpeg" | "audio/ogg" | "audio/wav" | "application/pdf" | "application/msword" | "application/vnd.openxmlformats-officedocument.wordprocessingml.document" | "application/vnd.ms-excel" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | "application/vnd.ms-powerpoint" | "application/vnd.openxmlformats-officedocument.presentationml.presentation" | "application/zip" | "application/json" | "text/plain" | "text/csv" | "text/html" | "text/markdown";
|
|
5999
|
+
export { MimeType_2 as MimeType }
|
|
6000
|
+
|
|
5659
6001
|
declare const moduleAvatarVariants: (props?: ({
|
|
5660
6002
|
size?: "lg" | "md" | "sm" | "xs" | "xxs" | undefined;
|
|
5661
6003
|
} & ({
|
|
@@ -7566,6 +7908,32 @@ export declare const useF0Dialog: () => F0DialogContextType;
|
|
|
7566
7908
|
*/
|
|
7567
7909
|
export declare function useF0Form(): UseF0FormReturn;
|
|
7568
7910
|
|
|
7911
|
+
export declare function useF0FormDefinition<TSchema extends F0FormSchema_2>(input: UseF0FormDefinitionSingleSchemaInput<TSchema>): F0FormDefinitionSingleSchema<TSchema>;
|
|
7912
|
+
|
|
7913
|
+
export declare function useF0FormDefinition<T extends F0PerSectionSchema_2>(input: UseF0FormDefinitionPerSectionInput<T>): F0FormDefinitionPerSection<T>;
|
|
7914
|
+
|
|
7915
|
+
declare interface UseF0FormDefinitionPerSectionInput<T extends F0PerSectionSchema_2> {
|
|
7916
|
+
name: string;
|
|
7917
|
+
schema: T;
|
|
7918
|
+
sections?: Record<string, F0PerSectionSectionConfig>;
|
|
7919
|
+
defaultValues?: {
|
|
7920
|
+
[K in keyof T]?: Partial<z.infer<T[K]>>;
|
|
7921
|
+
};
|
|
7922
|
+
onSubmit: (arg: F0WizardFormPerSectionSubmitArg<T>) => Promise<F0FormSubmitResult> | F0FormSubmitResult;
|
|
7923
|
+
submitConfig?: F0PerSectionSubmitConfig;
|
|
7924
|
+
errorTriggerMode?: F0FormErrorTriggerMode;
|
|
7925
|
+
}
|
|
7926
|
+
|
|
7927
|
+
declare interface UseF0FormDefinitionSingleSchemaInput<TSchema extends F0FormSchema_2> {
|
|
7928
|
+
name: string;
|
|
7929
|
+
schema: TSchema;
|
|
7930
|
+
sections?: Record<string, F0SectionConfig>;
|
|
7931
|
+
defaultValues?: Partial<z.infer<TSchema>>;
|
|
7932
|
+
onSubmit: (arg: F0WizardFormSingleSubmitArg<TSchema>) => Promise<F0FormSubmitResult> | F0FormSubmitResult;
|
|
7933
|
+
submitConfig?: F0FormSubmitConfig;
|
|
7934
|
+
errorTriggerMode?: F0FormErrorTriggerMode;
|
|
7935
|
+
}
|
|
7936
|
+
|
|
7569
7937
|
/**
|
|
7570
7938
|
* Return type for the useF0Form hook
|
|
7571
7939
|
*/
|
|
@@ -7588,6 +7956,10 @@ export declare interface UseF0FormReturn {
|
|
|
7588
7956
|
* Check if the form has unsaved changes
|
|
7589
7957
|
*/
|
|
7590
7958
|
isDirty: () => boolean;
|
|
7959
|
+
/**
|
|
7960
|
+
* Get the current form values (including unsaved changes)
|
|
7961
|
+
*/
|
|
7962
|
+
getValues: () => Record<string, unknown>;
|
|
7591
7963
|
/**
|
|
7592
7964
|
* Whether the form is currently submitting
|
|
7593
7965
|
*/
|
|
@@ -7598,6 +7970,22 @@ export declare interface UseF0FormReturn {
|
|
|
7598
7970
|
hasErrors: boolean;
|
|
7599
7971
|
}
|
|
7600
7972
|
|
|
7973
|
+
/**
|
|
7974
|
+
* A hook that returns upload capabilities for a single file.
|
|
7975
|
+
* Each call creates an independent upload instance with its own state.
|
|
7976
|
+
*
|
|
7977
|
+
* @example
|
|
7978
|
+
* ```tsx
|
|
7979
|
+
* const useMyUpload: UseFileUpload = () => {
|
|
7980
|
+
* const { upload, progress, status, cancelUpload } = useDirectUpload({
|
|
7981
|
+
* resourceType: "MyModule::Document",
|
|
7982
|
+
* })
|
|
7983
|
+
* return { upload, progress, status, cancelUpload }
|
|
7984
|
+
* }
|
|
7985
|
+
* ```
|
|
7986
|
+
*/
|
|
7987
|
+
export declare type UseFileUpload = () => FileUploadHookReturn;
|
|
7988
|
+
|
|
7601
7989
|
export declare const useGroups: <R extends RecordType>(groups: GroupRecord<R>[], defaultOpenGroups?: boolean | GroupRecord<R>["key"][]) => {
|
|
7602
7990
|
openGroups: Record<string, boolean>;
|
|
7603
7991
|
setGroupOpen: (key: string, open: boolean) => void;
|