@factorialco/f0-react 1.397.0 → 1.398.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/{F0AiChat-RQc7dXda.js → F0AiChat-CiwHSzAS.js} +286 -281
- package/dist/{F0HILActionConfirmation-CEBQZ4xR.js → F0HILActionConfirmation-Ba7uFrN1.js} +1 -1
- package/dist/ai.d.ts +16 -2
- package/dist/ai.js +2 -2
- package/dist/experimental.d.ts +26 -235
- package/dist/experimental.js +6051 -8390
- package/dist/f0.d.ts +381 -3
- package/dist/f0.js +22312 -18938
- package/dist/i18n-provider-defaults.d.ts +16 -2
- package/dist/i18n-provider-defaults.js +16 -2
- package/dist/styles.css +1 -1
- package/dist/{useDataCollectionSource-Drr0ytr2.js → useDataCollectionSource-DmcT_gl5.js} +9698 -10006
- package/package.json +1 -1
package/dist/f0.d.ts
CHANGED
|
@@ -135,6 +135,7 @@ import { WithDataTestIdReturnType as WithDataTestIdReturnType_3 } from './f0';
|
|
|
135
135
|
import { WithDataTestIdReturnType as WithDataTestIdReturnType_4 } from './f0';
|
|
136
136
|
import { WithDataTestIdReturnType as WithDataTestIdReturnType_5 } from './f0';
|
|
137
137
|
import { WithDataTestIdReturnType as WithDataTestIdReturnType_6 } from './f0';
|
|
138
|
+
import { WithDataTestIdReturnType as WithDataTestIdReturnType_7 } from './f0';
|
|
138
139
|
import { z } from 'zod';
|
|
139
140
|
import { ZodEffects } from 'zod';
|
|
140
141
|
import { ZodRawShape } from 'zod';
|
|
@@ -290,6 +291,8 @@ declare type ActionSize = (typeof actionSizes)[number];
|
|
|
290
291
|
|
|
291
292
|
declare const actionSizes: readonly ["sm", "md", "lg"];
|
|
292
293
|
|
|
294
|
+
export declare type ActionType = "duplicate" | "delete";
|
|
295
|
+
|
|
293
296
|
declare type ActionVariant = (typeof actionVariants)[number];
|
|
294
297
|
|
|
295
298
|
declare const actionVariants: readonly ["default", "outline", "critical", "neutral", "ghost", "promote", "outlinePromote", "ai", "link", "unstyled", "mention"];
|
|
@@ -871,6 +874,25 @@ export declare type BasePaginatedResponse<R> = BaseResponse<R> & {
|
|
|
871
874
|
perPage: number;
|
|
872
875
|
};
|
|
873
876
|
|
|
877
|
+
export declare type BaseQuestionOnChangeParams = {
|
|
878
|
+
id: string;
|
|
879
|
+
title?: string;
|
|
880
|
+
description?: string;
|
|
881
|
+
required?: boolean;
|
|
882
|
+
};
|
|
883
|
+
|
|
884
|
+
declare type BaseQuestionProps = {
|
|
885
|
+
id: string;
|
|
886
|
+
title: string;
|
|
887
|
+
description?: string;
|
|
888
|
+
type: QuestionType;
|
|
889
|
+
children: React.ReactNode;
|
|
890
|
+
required?: boolean;
|
|
891
|
+
locked?: boolean;
|
|
892
|
+
};
|
|
893
|
+
|
|
894
|
+
declare type BaseQuestionPropsForOtherQuestionComponents = Omit<BaseQuestionProps, "children" | "onChange">;
|
|
895
|
+
|
|
874
896
|
/**
|
|
875
897
|
* Base response type for collection data
|
|
876
898
|
* @template R - The type of records in the collection
|
|
@@ -1642,6 +1664,8 @@ declare type ComponentTypes = (typeof componentTypes)[number];
|
|
|
1642
1664
|
|
|
1643
1665
|
declare const componentTypes: readonly ["layout", "info", "action", "form"];
|
|
1644
1666
|
|
|
1667
|
+
export declare function computeSectionEndIds(elements: SurveyFormBuilderElement[]): Set<string>;
|
|
1668
|
+
|
|
1645
1669
|
declare type CountryCode = keyof TranslationsType["countries"];
|
|
1646
1670
|
|
|
1647
1671
|
export declare function createAtlaskitDriver(instanceId: symbol): DndDriver;
|
|
@@ -2214,6 +2238,10 @@ export declare interface DatePreset {
|
|
|
2214
2238
|
value: DateRange | (() => DateRange);
|
|
2215
2239
|
}
|
|
2216
2240
|
|
|
2241
|
+
declare type DateQuestionProps = BaseQuestionPropsForOtherQuestionComponents & {
|
|
2242
|
+
value?: Date | null;
|
|
2243
|
+
};
|
|
2244
|
+
|
|
2217
2245
|
declare type DateRange = {
|
|
2218
2246
|
from: Date;
|
|
2219
2247
|
to?: Date;
|
|
@@ -2724,7 +2752,7 @@ export declare const defaultTranslations: {
|
|
|
2724
2752
|
readonly dismiss: "Dismiss";
|
|
2725
2753
|
};
|
|
2726
2754
|
};
|
|
2727
|
-
readonly
|
|
2755
|
+
readonly surveyFormBuilder: {
|
|
2728
2756
|
readonly actions: {
|
|
2729
2757
|
readonly actions: "Actions";
|
|
2730
2758
|
readonly duplicateQuestion: "Duplicate question";
|
|
@@ -2756,7 +2784,11 @@ export declare const defaultTranslations: {
|
|
|
2756
2784
|
};
|
|
2757
2785
|
readonly answer: {
|
|
2758
2786
|
readonly label: "Answer";
|
|
2759
|
-
readonly
|
|
2787
|
+
readonly dropdownPlaceholder: "Pick an option";
|
|
2788
|
+
readonly textPlaceholder: "Type your answer";
|
|
2789
|
+
readonly numericPlaceholder: "Enter a number";
|
|
2790
|
+
readonly linkPlaceholder: "https://example.com";
|
|
2791
|
+
readonly invalidUrl: "Enter a valid URL";
|
|
2760
2792
|
};
|
|
2761
2793
|
readonly labels: {
|
|
2762
2794
|
readonly applyingChanges: "Applying changes";
|
|
@@ -2775,6 +2807,16 @@ export declare const defaultTranslations: {
|
|
|
2775
2807
|
readonly lastQuestionDialogDescription: "Moving this question will leave the section empty and it will be removed. Do you want to continue?";
|
|
2776
2808
|
};
|
|
2777
2809
|
};
|
|
2810
|
+
readonly surveyAnsweringForm: {
|
|
2811
|
+
readonly actions: {
|
|
2812
|
+
readonly submit: "Submit survey";
|
|
2813
|
+
readonly cancel: "Cancel";
|
|
2814
|
+
readonly next: "Next";
|
|
2815
|
+
readonly previous: "Previous";
|
|
2816
|
+
readonly expand: "Expand";
|
|
2817
|
+
readonly collapse: "Collapse";
|
|
2818
|
+
};
|
|
2819
|
+
};
|
|
2778
2820
|
readonly richTextEditor: {
|
|
2779
2821
|
readonly bold: "Bold";
|
|
2780
2822
|
readonly italic: "Italic";
|
|
@@ -2961,6 +3003,12 @@ declare type DropdownItemSeparator = {
|
|
|
2961
3003
|
type: "separator";
|
|
2962
3004
|
};
|
|
2963
3005
|
|
|
3006
|
+
declare type DropdownSingleQuestionProps = BaseQuestionPropsForOtherQuestionComponents & {
|
|
3007
|
+
type: "dropdown-single";
|
|
3008
|
+
options: SelectQuestionOption[];
|
|
3009
|
+
value?: string | null;
|
|
3010
|
+
};
|
|
3011
|
+
|
|
2964
3012
|
export declare type DropIntent = {
|
|
2965
3013
|
type: "reorder";
|
|
2966
3014
|
containerId: string;
|
|
@@ -3027,6 +3075,8 @@ declare type EditableTableVisualizationOptions<R extends RecordType, _Filters ex
|
|
|
3027
3075
|
|
|
3028
3076
|
declare type EditableTableVisualizationSettings = TableVisualizationSettings;
|
|
3029
3077
|
|
|
3078
|
+
export declare type ElementType = QuestionType | "section";
|
|
3079
|
+
|
|
3030
3080
|
export declare function Em({ children, ...props }: React.HTMLAttributes<HTMLSpanElement>): JSX_2.Element;
|
|
3031
3081
|
|
|
3032
3082
|
export declare function EmojiImage({ emoji, size, alt }: EmojiImageProps): JSX_2.Element;
|
|
@@ -4609,6 +4659,20 @@ export declare interface F0FormDiscardConfig {
|
|
|
4609
4659
|
*/
|
|
4610
4660
|
export declare type F0FormErrorTriggerMode = "on-blur" | "on-change" | "on-submit";
|
|
4611
4661
|
|
|
4662
|
+
/**
|
|
4663
|
+
* Standalone form field component that renders the appropriate F0Form input
|
|
4664
|
+
* without requiring a react-hook-form context.
|
|
4665
|
+
*
|
|
4666
|
+
* Supports all field types that F0Form supports: text, number, textarea,
|
|
4667
|
+
* select, checkbox, switch, date, time, datetime, daterange, richtext, custom,
|
|
4668
|
+
* and file.
|
|
4669
|
+
*/
|
|
4670
|
+
export declare function F0FormField({ field, value, onChange, onBlur, error, errorMessage, loading, required, disabled, hideLabel: hideLabelProp, initialFiles, }: F0FormFieldProps): JSX_2.Element;
|
|
4671
|
+
|
|
4672
|
+
export declare namespace F0FormField {
|
|
4673
|
+
var displayName: string;
|
|
4674
|
+
}
|
|
4675
|
+
|
|
4612
4676
|
/**
|
|
4613
4677
|
* String field - text input, textarea, select, or custom
|
|
4614
4678
|
* @typeParam R - Record type for data source (when using source instead of options)
|
|
@@ -4684,6 +4748,44 @@ export declare function f0FormField<T extends ZodTypeAny, TConfig = undefined>(s
|
|
|
4684
4748
|
*/
|
|
4685
4749
|
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>;
|
|
4686
4750
|
|
|
4751
|
+
declare interface F0FormFieldCommonProps {
|
|
4752
|
+
/** Field definition (type, label, placeholder, etc.) */
|
|
4753
|
+
/** Current field value */
|
|
4754
|
+
value: unknown;
|
|
4755
|
+
/** Called when the field value changes */
|
|
4756
|
+
onChange: (value: unknown) => void;
|
|
4757
|
+
/** Called when the field loses focus */
|
|
4758
|
+
onBlur?: () => void;
|
|
4759
|
+
/** Whether the field has an error */
|
|
4760
|
+
error?: boolean;
|
|
4761
|
+
/** Error message to display */
|
|
4762
|
+
errorMessage?: string;
|
|
4763
|
+
/** Whether the field is in a loading/validating state */
|
|
4764
|
+
loading?: boolean;
|
|
4765
|
+
/** Whether the field is required */
|
|
4766
|
+
required?: boolean;
|
|
4767
|
+
/** Whether the field is disabled (overrides field.disabled) */
|
|
4768
|
+
disabled?: boolean;
|
|
4769
|
+
/** Whether to hide the label (useful when label is rendered externally) */
|
|
4770
|
+
hideLabel?: boolean;
|
|
4771
|
+
}
|
|
4772
|
+
|
|
4773
|
+
declare interface F0FormFieldFileProps extends F0FormFieldCommonProps {
|
|
4774
|
+
/** File field definition */
|
|
4775
|
+
field: F0FileField;
|
|
4776
|
+
/** Shared pool of pre-existing file metadata for standalone file fields */
|
|
4777
|
+
initialFiles?: InitialFile[];
|
|
4778
|
+
}
|
|
4779
|
+
|
|
4780
|
+
declare interface F0FormFieldNonFileProps extends F0FormFieldCommonProps {
|
|
4781
|
+
/** Non-file field definition */
|
|
4782
|
+
field: Exclude<F0Field, F0FileField>;
|
|
4783
|
+
/** Only supported for file fields */
|
|
4784
|
+
initialFiles?: never;
|
|
4785
|
+
}
|
|
4786
|
+
|
|
4787
|
+
export declare type F0FormFieldProps = F0FormFieldFileProps | F0FormFieldNonFileProps;
|
|
4788
|
+
|
|
4687
4789
|
/**
|
|
4688
4790
|
* Union of all F0Form prop variants.
|
|
4689
4791
|
* The component detects the mode based on whether `schema` is a single Zod schema
|
|
@@ -4875,6 +4977,12 @@ declare interface F0FormSubmitConfigBase {
|
|
|
4875
4977
|
icon?: IconType | null;
|
|
4876
4978
|
/** Label shown in the action bar while submitting (defaults to i18n "forms.actionBar.saving") */
|
|
4877
4979
|
savingMessage?: string;
|
|
4980
|
+
/**
|
|
4981
|
+
* Duration in ms before the success message auto-clears.
|
|
4982
|
+
* - number: auto-clear after this many ms (default: 3000)
|
|
4983
|
+
* - null: never auto-clear (caller is responsible for unmounting)
|
|
4984
|
+
*/
|
|
4985
|
+
successMessageDuration?: number | null;
|
|
4878
4986
|
}
|
|
4879
4987
|
|
|
4880
4988
|
/**
|
|
@@ -5468,7 +5576,7 @@ export declare const F0TableOfContentPopover: WithDataTestIdReturnType_3<typeof
|
|
|
5468
5576
|
* Internal implementation of the TableOfContentPopover component.
|
|
5469
5577
|
* This component includes all props including private ones.
|
|
5470
5578
|
*/
|
|
5471
|
-
declare function F0TableOfContentPopover_2({ title, items, className, activeItem, collapsible, sortable, onReorder, showChildrenCounter, barsAlign, size, variant, }: F0TableOfContentPopoverProps): JSX_2.Element;
|
|
5579
|
+
declare function F0TableOfContentPopover_2({ title, items, className, activeItem, collapsible, sortable, onReorder, showChildrenCounter, barsAlign, size, variant, portalContainer, }: F0TableOfContentPopoverProps): JSX_2.Element;
|
|
5472
5580
|
|
|
5473
5581
|
declare interface F0TableOfContentPopoverProps extends Omit<TOCProps, "showSearchBox" | "title" | "hideChildrenCounter"> {
|
|
5474
5582
|
/** Optional title displayed at the top of the menu popup */
|
|
@@ -5483,6 +5591,8 @@ declare interface F0TableOfContentPopoverProps extends Omit<TOCProps, "showSearc
|
|
|
5483
5591
|
size?: PopupSize;
|
|
5484
5592
|
/** Visual variant: "dark" for light backgrounds (default), "light" for dark backgrounds */
|
|
5485
5593
|
variant?: TableOfContentPopoverVariant;
|
|
5594
|
+
/** Container element for the portal. When inside a modal, pass the modal's container to prevent focus/click issues */
|
|
5595
|
+
portalContainer?: HTMLElement | null;
|
|
5486
5596
|
}
|
|
5487
5597
|
|
|
5488
5598
|
export declare const F0TagAlert: WithDataTestIdReturnType_4<ForwardRefExoticComponent<Props_2 & RefAttributes<HTMLDivElement>>>;
|
|
@@ -5948,6 +6058,30 @@ export declare type FlagAvatarVariant = Extract<AvatarVariant, {
|
|
|
5948
6058
|
type: "flag";
|
|
5949
6059
|
}>;
|
|
5950
6060
|
|
|
6061
|
+
export declare type FlatFormItem = {
|
|
6062
|
+
type: "section-header";
|
|
6063
|
+
id: string;
|
|
6064
|
+
section: SectionElement;
|
|
6065
|
+
} | {
|
|
6066
|
+
type: "question";
|
|
6067
|
+
id: string;
|
|
6068
|
+
question: QuestionElement;
|
|
6069
|
+
} | {
|
|
6070
|
+
type: "section-end";
|
|
6071
|
+
id: string;
|
|
6072
|
+
sectionId: string;
|
|
6073
|
+
};
|
|
6074
|
+
|
|
6075
|
+
export declare type FlatQuestion = {
|
|
6076
|
+
id: string;
|
|
6077
|
+
type: string;
|
|
6078
|
+
required?: boolean;
|
|
6079
|
+
sectionTitle?: string;
|
|
6080
|
+
sectionDescription?: string;
|
|
6081
|
+
};
|
|
6082
|
+
|
|
6083
|
+
export declare function flattenElements(elements: SurveyFormBuilderElement[]): FlatFormItem[];
|
|
6084
|
+
|
|
5951
6085
|
/** Flex direction */
|
|
5952
6086
|
export declare type FlexDirectionToken = "row" | "column" | "row-reverse" | "column-reverse";
|
|
5953
6087
|
|
|
@@ -5960,6 +6094,23 @@ declare const fontSizes: readonly ["sm", "md", "lg"];
|
|
|
5960
6094
|
|
|
5961
6095
|
/* Excluded from this release type: FormDefinitionItem */
|
|
5962
6096
|
|
|
6097
|
+
/**
|
|
6098
|
+
* Standalone form field props — decoupled from react-hook-form.
|
|
6099
|
+
* This is the minimal contract that field renderers need to operate.
|
|
6100
|
+
*/
|
|
6101
|
+
export declare interface FormFieldProps {
|
|
6102
|
+
/** Current field value */
|
|
6103
|
+
value: unknown;
|
|
6104
|
+
/** Called when the field value changes */
|
|
6105
|
+
onChange: (value: unknown) => void;
|
|
6106
|
+
/** Called when the field loses focus (used for validation triggers) */
|
|
6107
|
+
onBlur: () => void;
|
|
6108
|
+
/** Field name (defaults to field.id if not provided) */
|
|
6109
|
+
name?: string;
|
|
6110
|
+
/** Ref callback for the underlying input element */
|
|
6111
|
+
ref?: React.RefCallback<HTMLElement>;
|
|
6112
|
+
}
|
|
6113
|
+
|
|
5963
6114
|
/** Fraction tokens for proportional widths */
|
|
5964
6115
|
export declare type FractionToken = "1/2" | "1/3" | "2/3" | "1/4" | "2/4" | "3/4" | "1/5" | "2/5" | "3/5" | "4/5" | "1/6" | "5/6";
|
|
5965
6116
|
|
|
@@ -6418,6 +6569,21 @@ export declare interface InitialFile {
|
|
|
6418
6569
|
size?: number;
|
|
6419
6570
|
}
|
|
6420
6571
|
|
|
6572
|
+
/**
|
|
6573
|
+
* Re-inject section-end markers into a flat list that has none.
|
|
6574
|
+
*
|
|
6575
|
+
* Uses `inSectionQuestionIds` (the set of question IDs that originally
|
|
6576
|
+
* belonged to *any* section) to determine where each section ends:
|
|
6577
|
+
* - Questions in the set stay inside the current section.
|
|
6578
|
+
* - Original standalone questions (NOT in the set) cause the section to close
|
|
6579
|
+
* before them so they remain standalone.
|
|
6580
|
+
*
|
|
6581
|
+
* This allows cross-section moves (a question from section B placed after
|
|
6582
|
+
* section A's header joins section A) while keeping standalone questions
|
|
6583
|
+
* outside sections unless the user explicitly drags them between section items.
|
|
6584
|
+
*/
|
|
6585
|
+
export declare function injectSectionEnds(items: FlatFormItem[], inSectionQuestionIds: Set<string>): FlatFormItem[];
|
|
6586
|
+
|
|
6421
6587
|
declare const INPUTFIELD_SIZES: readonly ["sm", "md"];
|
|
6422
6588
|
|
|
6423
6589
|
declare type InputFieldInheritedProps = (typeof inputFieldInheritedProps)[number];
|
|
@@ -6658,6 +6824,10 @@ declare type LinkProps = AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
|
6658
6824
|
disabled?: boolean;
|
|
6659
6825
|
};
|
|
6660
6826
|
|
|
6827
|
+
declare type LinkQuestionProps = BaseQuestionPropsForOtherQuestionComponents & {
|
|
6828
|
+
value?: string | null;
|
|
6829
|
+
};
|
|
6830
|
+
|
|
6661
6831
|
export declare const linkVariants: readonly ["link", "unstyled", "mention"];
|
|
6662
6832
|
|
|
6663
6833
|
/**
|
|
@@ -7043,6 +7213,10 @@ declare type NumericFormatterOptions = {
|
|
|
7043
7213
|
useGrouping?: boolean;
|
|
7044
7214
|
};
|
|
7045
7215
|
|
|
7216
|
+
declare type NumericQuestionProps = BaseQuestionPropsForOtherQuestionComponents & {
|
|
7217
|
+
value?: number | null;
|
|
7218
|
+
};
|
|
7219
|
+
|
|
7046
7220
|
/**
|
|
7047
7221
|
* Numeric size scale matching core spacing (relativeSpacing).
|
|
7048
7222
|
* Maps 1:1 to Tailwind classes like w-0, w-4, w-8, w-16, etc.
|
|
@@ -7111,11 +7285,61 @@ declare type NumericWithFormatter = {
|
|
|
7111
7285
|
|
|
7112
7286
|
export declare function Ol({ children, ...props }: React.HTMLAttributes<HTMLOListElement>): JSX_2.Element;
|
|
7113
7287
|
|
|
7288
|
+
export declare type OnAddNewElementParams = {
|
|
7289
|
+
type: ElementType;
|
|
7290
|
+
afterId?: string;
|
|
7291
|
+
};
|
|
7292
|
+
|
|
7114
7293
|
declare type OnBulkActionCallback<Record extends RecordType, Filters extends FiltersDefinition> = (...args: [
|
|
7115
7294
|
action: BulkAction,
|
|
7116
7295
|
...Parameters<OnSelectItemsCallback<Record, Filters>>
|
|
7117
7296
|
]) => void;
|
|
7118
7297
|
|
|
7298
|
+
declare type OnChangeQuestionParams = BaseQuestionOnChangeParams & ({
|
|
7299
|
+
type: "text" | "longText";
|
|
7300
|
+
value?: string | null;
|
|
7301
|
+
} | {
|
|
7302
|
+
type: "rating";
|
|
7303
|
+
value: number;
|
|
7304
|
+
options?: {
|
|
7305
|
+
value: number;
|
|
7306
|
+
label: string;
|
|
7307
|
+
}[];
|
|
7308
|
+
} | {
|
|
7309
|
+
type: "select";
|
|
7310
|
+
value?: string | null;
|
|
7311
|
+
options: SelectQuestionOption[];
|
|
7312
|
+
} | {
|
|
7313
|
+
type: "multi-select";
|
|
7314
|
+
value?: string[] | null;
|
|
7315
|
+
options: SelectQuestionOption[];
|
|
7316
|
+
} | {
|
|
7317
|
+
type: "dropdown-single";
|
|
7318
|
+
value?: string | null;
|
|
7319
|
+
options?: SelectQuestionOption[];
|
|
7320
|
+
} | {
|
|
7321
|
+
type: "numeric";
|
|
7322
|
+
value?: number | null;
|
|
7323
|
+
} | {
|
|
7324
|
+
type: "link";
|
|
7325
|
+
value?: string | null;
|
|
7326
|
+
} | {
|
|
7327
|
+
type: "date";
|
|
7328
|
+
value?: Date | null;
|
|
7329
|
+
});
|
|
7330
|
+
|
|
7331
|
+
export declare type OnChangeSectionParams = {
|
|
7332
|
+
id: string;
|
|
7333
|
+
title: string;
|
|
7334
|
+
description?: string;
|
|
7335
|
+
questions?: QuestionElement[];
|
|
7336
|
+
};
|
|
7337
|
+
|
|
7338
|
+
export declare type OnDuplicateElementParams = {
|
|
7339
|
+
elementId: string;
|
|
7340
|
+
type: ElementType;
|
|
7341
|
+
};
|
|
7342
|
+
|
|
7119
7343
|
export declare const OneFilterPicker: <Definition extends FiltersDefinition>(props: OneFilterPickerRootProps<Definition> & {
|
|
7120
7344
|
dataTestId?: string;
|
|
7121
7345
|
}) => ReactElement | null;
|
|
@@ -7562,6 +7786,30 @@ declare type Props_3 = {
|
|
|
7562
7786
|
list?: TagCounterItem[];
|
|
7563
7787
|
};
|
|
7564
7788
|
|
|
7789
|
+
export declare type QuestionActionParams = {
|
|
7790
|
+
questionId: string;
|
|
7791
|
+
type: ActionType;
|
|
7792
|
+
index: number;
|
|
7793
|
+
};
|
|
7794
|
+
|
|
7795
|
+
export declare type QuestionElement = Omit<TextQuestionProps, QuestionPropsToOmit> | Omit<RatingQuestionProps & {
|
|
7796
|
+
type: "rating";
|
|
7797
|
+
}, QuestionPropsToOmit> | Omit<SelectQuestionProps & {
|
|
7798
|
+
type: "select" | "multi-select";
|
|
7799
|
+
}, QuestionPropsToOmit> | Omit<DropdownSingleQuestionProps & {
|
|
7800
|
+
type: "dropdown-single";
|
|
7801
|
+
}, QuestionPropsToOmit> | Omit<NumericQuestionProps & {
|
|
7802
|
+
type: "numeric";
|
|
7803
|
+
}, QuestionPropsToOmit> | Omit<LinkQuestionProps & {
|
|
7804
|
+
type: "link";
|
|
7805
|
+
}, QuestionPropsToOmit> | Omit<DateQuestionProps & {
|
|
7806
|
+
type: "date";
|
|
7807
|
+
}, QuestionPropsToOmit>;
|
|
7808
|
+
|
|
7809
|
+
declare type QuestionPropsToOmit = "onAction" | "onChange" | "onAddNewElement";
|
|
7810
|
+
|
|
7811
|
+
export declare type QuestionType = "rating" | "select" | "multi-select" | "dropdown-single" | "text" | "longText" | "numeric" | "link" | "date";
|
|
7812
|
+
|
|
7565
7813
|
export declare interface RadarChartConfig {
|
|
7566
7814
|
type: "radar";
|
|
7567
7815
|
/** Fill the radar area. @default true */
|
|
@@ -7574,6 +7822,17 @@ export declare interface RadarChartConfig {
|
|
|
7574
7822
|
valueFormatter?: (value: number) => string;
|
|
7575
7823
|
}
|
|
7576
7824
|
|
|
7825
|
+
declare type RatingQuestionProps = BaseQuestionPropsForOtherQuestionComponents & {
|
|
7826
|
+
value?: number;
|
|
7827
|
+
} & {
|
|
7828
|
+
options: {
|
|
7829
|
+
value: number;
|
|
7830
|
+
label: string;
|
|
7831
|
+
}[];
|
|
7832
|
+
};
|
|
7833
|
+
|
|
7834
|
+
export declare function reconstructElements(flatItems: FlatFormItem[]): SurveyFormBuilderElement[];
|
|
7835
|
+
|
|
7577
7836
|
/**
|
|
7578
7837
|
* Utility type to get all possible paths through an object using dot notation
|
|
7579
7838
|
* @template T - The object type to traverse
|
|
@@ -7741,8 +8000,24 @@ declare type SecondaryActionsDefinition = {
|
|
|
7741
8000
|
|
|
7742
8001
|
declare type SecondaryActionsItems = SecondaryActionItem[] | SecondaryActionItem[][] | SecondaryActionGroup[];
|
|
7743
8002
|
|
|
8003
|
+
export declare type SectionActionParams = {
|
|
8004
|
+
sectionId: string;
|
|
8005
|
+
type: ActionType;
|
|
8006
|
+
index: number;
|
|
8007
|
+
};
|
|
8008
|
+
|
|
7744
8009
|
/* Excluded from this release type: SectionDefinition */
|
|
7745
8010
|
|
|
8011
|
+
export declare type SectionElement = Omit<SectionProps, "onAction" | "onChange">;
|
|
8012
|
+
|
|
8013
|
+
declare type SectionProps = {
|
|
8014
|
+
id: string;
|
|
8015
|
+
title: string;
|
|
8016
|
+
description?: string;
|
|
8017
|
+
locked?: boolean;
|
|
8018
|
+
questions?: QuestionElement[];
|
|
8019
|
+
};
|
|
8020
|
+
|
|
7746
8021
|
/**
|
|
7747
8022
|
* Conditional rendering for sections - can be a condition object or a function
|
|
7748
8023
|
*/
|
|
@@ -7817,6 +8092,23 @@ export declare type SelectionStatus<R extends RecordType, Filters extends Filter
|
|
|
7817
8092
|
totalKnownItemsCount: number;
|
|
7818
8093
|
};
|
|
7819
8094
|
|
|
8095
|
+
export declare type SelectQuestionOption = {
|
|
8096
|
+
id?: string;
|
|
8097
|
+
value: string;
|
|
8098
|
+
label: string;
|
|
8099
|
+
correct?: boolean;
|
|
8100
|
+
};
|
|
8101
|
+
|
|
8102
|
+
declare type SelectQuestionProps = BaseQuestionPropsForOtherQuestionComponents & {
|
|
8103
|
+
options: SelectQuestionOption[];
|
|
8104
|
+
} & ({
|
|
8105
|
+
type: "select";
|
|
8106
|
+
value?: string | null;
|
|
8107
|
+
} | {
|
|
8108
|
+
type: "multi-select";
|
|
8109
|
+
value?: string[] | null;
|
|
8110
|
+
});
|
|
8111
|
+
|
|
7820
8112
|
/**
|
|
7821
8113
|
* Base for select-specific conditions
|
|
7822
8114
|
*/
|
|
@@ -7942,6 +8234,87 @@ declare type SummaryKey<Definition extends SummariesDefinition> = Definition ext
|
|
|
7942
8234
|
|
|
7943
8235
|
declare type SummaryType = "sum";
|
|
7944
8236
|
|
|
8237
|
+
export declare function SurveyAnsweringForm({ elements, onSubmit, mode, title, isOpen, onClose, fullscreen: fullscreenProp, allowToChangeFullscreen, defaultValues, errorTriggerMode, }: SurveyAnsweringFormProps): JSX_2.Element;
|
|
8238
|
+
|
|
8239
|
+
export declare type SurveyAnsweringFormMode = "stepped" | "all-questions";
|
|
8240
|
+
|
|
8241
|
+
export declare interface SurveyAnsweringFormProps {
|
|
8242
|
+
elements: SurveyFormBuilderElement[];
|
|
8243
|
+
onSubmit: (answers: SurveySubmitAnswers) => Promise<SurveyFormSubmitResult> | SurveyFormSubmitResult;
|
|
8244
|
+
mode: SurveyAnsweringFormMode;
|
|
8245
|
+
title: string;
|
|
8246
|
+
isOpen: boolean;
|
|
8247
|
+
onClose: () => void;
|
|
8248
|
+
fullscreen?: boolean;
|
|
8249
|
+
allowToChangeFullscreen?: boolean;
|
|
8250
|
+
defaultValues?: Partial<SurveyAnswers>;
|
|
8251
|
+
errorTriggerMode?: F0FormErrorTriggerMode;
|
|
8252
|
+
}
|
|
8253
|
+
|
|
8254
|
+
export declare type SurveyAnswers = Record<string, SurveyAnswerValue>;
|
|
8255
|
+
|
|
8256
|
+
export declare type SurveyAnswerValue = {
|
|
8257
|
+
type: "text" | "longText";
|
|
8258
|
+
value: string | null;
|
|
8259
|
+
} | {
|
|
8260
|
+
type: "rating";
|
|
8261
|
+
value: number | null;
|
|
8262
|
+
} | {
|
|
8263
|
+
type: "select";
|
|
8264
|
+
value: string | null;
|
|
8265
|
+
} | {
|
|
8266
|
+
type: "multi-select";
|
|
8267
|
+
value: string[] | null;
|
|
8268
|
+
} | {
|
|
8269
|
+
type: "dropdown-single";
|
|
8270
|
+
value: string | null;
|
|
8271
|
+
} | {
|
|
8272
|
+
type: "numeric";
|
|
8273
|
+
value: number | null;
|
|
8274
|
+
} | {
|
|
8275
|
+
type: "link";
|
|
8276
|
+
value: string | null;
|
|
8277
|
+
} | {
|
|
8278
|
+
type: "date";
|
|
8279
|
+
value: Date | null;
|
|
8280
|
+
};
|
|
8281
|
+
|
|
8282
|
+
export declare const SurveyFormBuilder: WithDataTestIdReturnType_7<({ elements: elementsProp, disabled, onChange, disallowOptionalQuestions, allowedQuestionTypes, applyingChanges, }: SurveyFormBuilderProps) => JSX_2.Element>;
|
|
8283
|
+
|
|
8284
|
+
export declare type SurveyFormBuilderCallbacks = {
|
|
8285
|
+
onQuestionChange?: (params: OnChangeQuestionParams) => void;
|
|
8286
|
+
onSectionChange?: (params: OnChangeSectionParams) => void;
|
|
8287
|
+
onAddNewElement?: (params: OnAddNewElementParams) => void;
|
|
8288
|
+
onDuplicateElement?: (params: OnDuplicateElementParams) => void;
|
|
8289
|
+
};
|
|
8290
|
+
|
|
8291
|
+
export declare type SurveyFormBuilderElement = {
|
|
8292
|
+
type: "section";
|
|
8293
|
+
section: SectionElement;
|
|
8294
|
+
} | {
|
|
8295
|
+
type: "question";
|
|
8296
|
+
question: QuestionElement;
|
|
8297
|
+
};
|
|
8298
|
+
|
|
8299
|
+
export declare type SurveyFormBuilderProps = {
|
|
8300
|
+
elements: SurveyFormBuilderElement[];
|
|
8301
|
+
onChange: (elements: SurveyFormBuilderElement[]) => void;
|
|
8302
|
+
disabled?: boolean;
|
|
8303
|
+
disallowOptionalQuestions?: boolean;
|
|
8304
|
+
allowedQuestionTypes?: QuestionType[];
|
|
8305
|
+
applyingChanges?: boolean;
|
|
8306
|
+
};
|
|
8307
|
+
|
|
8308
|
+
export declare type SurveyFormSubmitResult = {
|
|
8309
|
+
success: true;
|
|
8310
|
+
message?: string;
|
|
8311
|
+
} | {
|
|
8312
|
+
success: false;
|
|
8313
|
+
errors?: Record<string, string>;
|
|
8314
|
+
};
|
|
8315
|
+
|
|
8316
|
+
export declare type SurveySubmitAnswers = Record<string, string | number | string[] | Date | null>;
|
|
8317
|
+
|
|
7945
8318
|
/**
|
|
7946
8319
|
* All valid renderIf conditions for switch fields
|
|
7947
8320
|
*/
|
|
@@ -8300,6 +8673,11 @@ declare interface TextProps extends Omit<default_2.HTMLAttributes<HTMLElement>,
|
|
|
8300
8673
|
required?: boolean;
|
|
8301
8674
|
}
|
|
8302
8675
|
|
|
8676
|
+
declare type TextQuestionProps = BaseQuestionPropsForOtherQuestionComponents & {
|
|
8677
|
+
type: "text" | "longText";
|
|
8678
|
+
value?: string | null;
|
|
8679
|
+
};
|
|
8680
|
+
|
|
8303
8681
|
/**
|
|
8304
8682
|
* Base for text-specific conditions
|
|
8305
8683
|
*/
|