@factorialco/f0-react 2.8.2 → 2.14.1
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/{F0AiProposalCard-D47slp4X.js → F0AiProposalCard-DVi59d66.js} +4258 -4259
- package/dist/ai.d.ts +10 -0
- package/dist/ai.js +2 -2
- package/dist/experimental.d.ts +135 -9
- package/dist/experimental.js +1422 -1360
- package/dist/f0.d.ts +93 -13
- package/dist/f0.js +2994 -2934
- package/dist/i18n-provider-defaults.d.ts +4 -0
- package/dist/i18n-provider-defaults.js +5 -1
- package/dist/{index-M54ent8Q.js → index-Dxso15qf.js} +27 -25
- package/dist/styles.css +1 -1
- package/dist/{useDataCollectionSource-sTX19XjT.js → useDataCollectionSource-DMvvZ8sK.js} +31957 -31756
- package/package.json +2 -2
- package/tailwind.config.ts +6 -1
package/dist/f0.d.ts
CHANGED
|
@@ -1531,6 +1531,7 @@ declare type BaseQuestionProps = {
|
|
|
1531
1531
|
children: React.ReactNode;
|
|
1532
1532
|
required?: boolean;
|
|
1533
1533
|
locked?: boolean;
|
|
1534
|
+
hiddenActions?: HiddenActions;
|
|
1534
1535
|
};
|
|
1535
1536
|
|
|
1536
1537
|
declare type BaseQuestionPropsForOtherQuestionComponents = Omit<BaseQuestionProps, "children" | "onChange">;
|
|
@@ -2001,6 +2002,48 @@ export declare type CanvasEntityDefinition<T extends CanvasContentBase = CanvasC
|
|
|
2001
2002
|
overflowHidden?: boolean;
|
|
2002
2003
|
};
|
|
2003
2004
|
|
|
2005
|
+
declare interface CardAlertBase {
|
|
2006
|
+
/**
|
|
2007
|
+
* The visual variant of the alert, which determines the color scheme and default icon.
|
|
2008
|
+
*/
|
|
2009
|
+
variant: CardAlertVariant;
|
|
2010
|
+
/**
|
|
2011
|
+
* The title text displayed in the alert banner.
|
|
2012
|
+
*/
|
|
2013
|
+
title: string;
|
|
2014
|
+
/**
|
|
2015
|
+
* Optional custom icon. When omitted, defaults to the icon that best represents the variant.
|
|
2016
|
+
*/
|
|
2017
|
+
icon?: IconType;
|
|
2018
|
+
/**
|
|
2019
|
+
* Controls whether the alert is visible. Defaults to true.
|
|
2020
|
+
* Use this together with onDismiss for controlled dismiss behaviour:
|
|
2021
|
+
* alert={{ ..., visible, dismissible: true, onDismiss: () => setVisible(false) }}
|
|
2022
|
+
*/
|
|
2023
|
+
visible?: boolean;
|
|
2024
|
+
}
|
|
2025
|
+
|
|
2026
|
+
declare type CardAlertDismissible = CardAlertBase & {
|
|
2027
|
+
/** Renders a dismiss (×) button. Requires onDismiss. */
|
|
2028
|
+
dismissible: true;
|
|
2029
|
+
/**
|
|
2030
|
+
* Called when the dismiss (×) button is clicked.
|
|
2031
|
+
* The consumer is responsible for hiding the alert (e.g. by setting visible: false).
|
|
2032
|
+
*/
|
|
2033
|
+
onDismiss: () => void;
|
|
2034
|
+
};
|
|
2035
|
+
|
|
2036
|
+
declare type CardAlertNonDismissible = CardAlertBase & {
|
|
2037
|
+
dismissible?: false;
|
|
2038
|
+
onDismiss?: never;
|
|
2039
|
+
};
|
|
2040
|
+
|
|
2041
|
+
export declare type CardAlertProps = CardAlertDismissible | CardAlertNonDismissible;
|
|
2042
|
+
|
|
2043
|
+
export declare type CardAlertVariant = (typeof cardAlertVariants)[number];
|
|
2044
|
+
|
|
2045
|
+
export declare const cardAlertVariants: readonly ["info", "warning", "critical", "positive"];
|
|
2046
|
+
|
|
2004
2047
|
declare type CardAvatarVariant = AvatarVariant | {
|
|
2005
2048
|
type: "emoji";
|
|
2006
2049
|
emoji: string;
|
|
@@ -2125,6 +2168,12 @@ declare interface CardInternalProps {
|
|
|
2125
2168
|
* can manage drag-and-drop while still allowing click navigation via onClick
|
|
2126
2169
|
*/
|
|
2127
2170
|
disableOverlayLink?: boolean;
|
|
2171
|
+
/**
|
|
2172
|
+
* Alert banner displayed above the card with a coloured header strip and matching border.
|
|
2173
|
+
* Supports info, warning, critical, and positive variants with a default icon per variant.
|
|
2174
|
+
* Use `visible` + `onDismiss` for controlled dismiss behaviour.
|
|
2175
|
+
*/
|
|
2176
|
+
alert?: CardAlertProps;
|
|
2128
2177
|
}
|
|
2129
2178
|
|
|
2130
2179
|
declare type CardInternalProps_2 = F0AiInsightCardProps & {
|
|
@@ -2445,6 +2494,12 @@ declare interface ChatDashboardColumn {
|
|
|
2445
2494
|
label: string;
|
|
2446
2495
|
/** Optional fixed width in pixels */
|
|
2447
2496
|
width?: number;
|
|
2497
|
+
/**
|
|
2498
|
+
* Optional header tooltip explaining what the column represents — formula
|
|
2499
|
+
* or aggregation if derived, source if direct. Forwarded to the underlying
|
|
2500
|
+
* table column's `info` prop. Omit when the label is self-explanatory.
|
|
2501
|
+
*/
|
|
2502
|
+
info?: string;
|
|
2448
2503
|
}
|
|
2449
2504
|
|
|
2450
2505
|
/**
|
|
@@ -4582,6 +4637,9 @@ export declare const defaultTranslations: {
|
|
|
4582
4637
|
readonly noResults: "No results found";
|
|
4583
4638
|
readonly loadingMore: "Loading...";
|
|
4584
4639
|
readonly applySelection: "Apply selection";
|
|
4640
|
+
readonly create: "Create";
|
|
4641
|
+
readonly createWithValue: "Create \"{{value}}\"";
|
|
4642
|
+
readonly createEmptyMessage: "Try another search or create a new item";
|
|
4585
4643
|
};
|
|
4586
4644
|
readonly numberInput: {
|
|
4587
4645
|
readonly between: "It should be between {{min}} and {{max}}";
|
|
@@ -4657,6 +4715,7 @@ export declare const defaultTranslations: {
|
|
|
4657
4715
|
readonly sectionDescriptionPlaceholder: "Describe the section in a few words";
|
|
4658
4716
|
readonly required: "Required";
|
|
4659
4717
|
readonly allowMultiSelection: "Allow multi-selection";
|
|
4718
|
+
readonly allowCreate: "Allow creation";
|
|
4660
4719
|
readonly singleSelection: "Single selection";
|
|
4661
4720
|
readonly multiSelection: "Multi selection";
|
|
4662
4721
|
readonly questionType: "Question type";
|
|
@@ -4962,6 +5021,7 @@ declare type DropdownSingleQuestionProps = BaseQuestionPropsForOtherQuestionComp
|
|
|
4962
5021
|
value?: string | null;
|
|
4963
5022
|
showSearchBox?: boolean;
|
|
4964
5023
|
searchBoxPlaceholder?: string;
|
|
5024
|
+
allowCreate?: boolean;
|
|
4965
5025
|
};
|
|
4966
5026
|
|
|
4967
5027
|
export declare type DropIntent = {
|
|
@@ -7488,9 +7548,9 @@ export declare interface F0FormDiscardConfig {
|
|
|
7488
7548
|
|
|
7489
7549
|
/**
|
|
7490
7550
|
* When to trigger and display validation errors (does not apply with autosubmit)
|
|
7491
|
-
* - "on-blur": Errors appear when the user leaves a field
|
|
7551
|
+
* - "on-blur": Errors appear when the user leaves a field
|
|
7492
7552
|
* - "on-change": Errors appear as the user types (real-time validation)
|
|
7493
|
-
* - "on-submit": Errors only appear after attempting to submit the form
|
|
7553
|
+
* - "on-submit": Errors only appear after attempting to submit the form (default)
|
|
7494
7554
|
*/
|
|
7495
7555
|
export declare type F0FormErrorTriggerMode = "on-blur" | "on-change" | "on-submit";
|
|
7496
7556
|
|
|
@@ -8138,12 +8198,10 @@ declare interface F0FormSubmitConfigBase {
|
|
|
8138
8198
|
/** Custom label for the submit button */
|
|
8139
8199
|
label?: string;
|
|
8140
8200
|
/**
|
|
8141
|
-
* Custom icon for the submit button
|
|
8142
|
-
*
|
|
8143
|
-
* - null: no icon shown
|
|
8144
|
-
* - IconType: custom icon
|
|
8201
|
+
* Custom icon for the submit button.
|
|
8202
|
+
* No icon is shown by default.
|
|
8145
8203
|
*/
|
|
8146
|
-
icon?: IconType
|
|
8204
|
+
icon?: IconType;
|
|
8147
8205
|
/** Label shown in the action bar while submitting (defaults to i18n "forms.actionBar.saving") */
|
|
8148
8206
|
savingMessage?: string;
|
|
8149
8207
|
/**
|
|
@@ -8510,12 +8568,10 @@ export declare interface F0PerSectionSubmitConfig {
|
|
|
8510
8568
|
/** Custom label for the submit button (per section) */
|
|
8511
8569
|
label?: string;
|
|
8512
8570
|
/**
|
|
8513
|
-
* Custom icon for the submit button
|
|
8514
|
-
*
|
|
8515
|
-
* - null: no icon shown
|
|
8516
|
-
* - IconType: custom icon
|
|
8571
|
+
* Custom icon for the submit button.
|
|
8572
|
+
* No icon is shown by default.
|
|
8517
8573
|
*/
|
|
8518
|
-
icon?: IconType
|
|
8574
|
+
icon?: IconType;
|
|
8519
8575
|
/**
|
|
8520
8576
|
* When true, the submit button is only visible once the section has unsaved changes.
|
|
8521
8577
|
* @default false
|
|
@@ -8731,6 +8787,7 @@ export declare const F0Select: <T extends string = string, R = unknown>(props: F
|
|
|
8731
8787
|
* Base props shared across all F0Select variants
|
|
8732
8788
|
*/
|
|
8733
8789
|
declare type F0SelectBaseProps<T extends string, R = unknown> = {
|
|
8790
|
+
onApply?: () => void;
|
|
8734
8791
|
onChangeSelectedOption?: (option: F0SelectItemObject<T, ResolvedRecordType<R>> | undefined, checked: boolean) => void;
|
|
8735
8792
|
children?: React.ReactNode;
|
|
8736
8793
|
open?: boolean;
|
|
@@ -8742,6 +8799,8 @@ declare type F0SelectBaseProps<T extends string, R = unknown> = {
|
|
|
8742
8799
|
searchEmptyMessage?: string;
|
|
8743
8800
|
className?: string;
|
|
8744
8801
|
actions?: Action_2[];
|
|
8802
|
+
/** Callback to create a new item from the current search text. When provided, a "+ Create" button is shown in the empty state of the dropdown. */
|
|
8803
|
+
onCreate?: (value: string) => Promise<void> | void;
|
|
8745
8804
|
/** Container element to render the portal content into */
|
|
8746
8805
|
portalContainer?: HTMLElement | null;
|
|
8747
8806
|
/**
|
|
@@ -8793,6 +8852,8 @@ declare interface F0SelectConfigBase {
|
|
|
8793
8852
|
searchBoxPlaceholder?: string;
|
|
8794
8853
|
/** Icon displayed on the left side of the select input */
|
|
8795
8854
|
icon?: IconType;
|
|
8855
|
+
/** Callback to create a new item from the search text. Shows a "+ Create" button in the empty state of the dropdown. */
|
|
8856
|
+
onCreate?: (value: string) => Promise<void> | void;
|
|
8796
8857
|
}
|
|
8797
8858
|
|
|
8798
8859
|
/**
|
|
@@ -8923,6 +8984,10 @@ export declare type F0SelectTagProp = string | {
|
|
|
8923
8984
|
type: "person";
|
|
8924
8985
|
name: string;
|
|
8925
8986
|
src?: string;
|
|
8987
|
+
} | {
|
|
8988
|
+
type: "icon";
|
|
8989
|
+
text: string;
|
|
8990
|
+
icon: IconType;
|
|
8926
8991
|
};
|
|
8927
8992
|
|
|
8928
8993
|
/**
|
|
@@ -10157,6 +10222,19 @@ declare interface HeatmapComputation {
|
|
|
10157
10222
|
|
|
10158
10223
|
export declare type heightType = "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "full" | "auto";
|
|
10159
10224
|
|
|
10225
|
+
/**
|
|
10226
|
+
* Per-question control to hide individual entries from the question
|
|
10227
|
+
* actions menu (the "⋯" dropdown). Useful when a consumer wants to
|
|
10228
|
+
* lock down a subset of question editing without disabling the whole
|
|
10229
|
+
* question.
|
|
10230
|
+
*
|
|
10231
|
+
* When every available action is hidden, the actions menu trigger is
|
|
10232
|
+
* not rendered at all.
|
|
10233
|
+
*/
|
|
10234
|
+
export declare type HiddenAction = "required" | "multiSelect" | "allowCreate" | "questionType" | "duplicate" | "delete";
|
|
10235
|
+
|
|
10236
|
+
export declare type HiddenActions = ReadonlyArray<HiddenAction>;
|
|
10237
|
+
|
|
10160
10238
|
export declare const HomeLayout: WithDataTestIdReturnType_2<ForwardRefExoticComponent<Omit<{
|
|
10161
10239
|
widgets?: ReactNode[];
|
|
10162
10240
|
children?: ReactNode;
|
|
@@ -11371,6 +11449,7 @@ declare type OnChangeQuestionParams = BaseQuestionOnChangeParams & ({
|
|
|
11371
11449
|
datasetKey?: string;
|
|
11372
11450
|
showSearchBox?: boolean;
|
|
11373
11451
|
searchBoxPlaceholder?: string;
|
|
11452
|
+
allowCreate?: boolean;
|
|
11374
11453
|
} | {
|
|
11375
11454
|
type: "dropdown-multi";
|
|
11376
11455
|
value?: string[] | null;
|
|
@@ -12898,7 +12977,8 @@ export declare type SurveyDataset = {
|
|
|
12898
12977
|
icon?: IconType;
|
|
12899
12978
|
placeholder?: string;
|
|
12900
12979
|
dataSource: DataSourceDefinition;
|
|
12901
|
-
mapOptions: (item: RecordType) =>
|
|
12980
|
+
mapOptions: (item: RecordType) => F0SelectItemObject<string, RecordType>;
|
|
12981
|
+
onCreate?: (value: string) => Promise<RecordType>;
|
|
12902
12982
|
};
|
|
12903
12983
|
|
|
12904
12984
|
export declare type SurveyDatasets = Record<string, SurveyDataset>;
|