@factorialco/f0-react 1.352.0 → 1.353.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-C4xNeWzA.js +52168 -0
- package/dist/DataCollectionStorageProvider.css +1 -0
- package/dist/{F0AiChat-RkM5La7N.js → F0AiChat-CV7nDRrI.js} +1198 -1191
- package/dist/{F0HILActionConfirmation-caKPHcY6.js → F0HILActionConfirmation-DFgT-7fx.js} +1 -1
- package/dist/ai.d.ts +44 -5
- package/dist/ai.js +2 -2
- package/dist/experimental.css +1 -1
- package/dist/experimental.d.ts +88 -13
- package/dist/experimental.js +23500 -48076
- package/dist/f0.d.ts +1233 -7
- package/dist/f0.js +4795 -3517
- package/dist/i18n-provider-defaults.d.ts +44 -5
- package/dist/i18n-provider-defaults.js +39 -0
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/dist/DataCollectionStorageProvider-59f_r22e.js +0 -27477
package/dist/f0.d.ts
CHANGED
|
@@ -104,6 +104,9 @@ import { TextCellValue as TextCellValue_2 } from './types/text';
|
|
|
104
104
|
import { TrackReferenceOrPlaceholder } from '@livekit/components-react';
|
|
105
105
|
import { ValueDisplayRendererContext } from '../../value-display';
|
|
106
106
|
import { VariantProps } from 'cva';
|
|
107
|
+
import { z } from 'zod';
|
|
108
|
+
import { ZodRawShape } from 'zod';
|
|
109
|
+
import { ZodTypeAny } from 'zod';
|
|
107
110
|
|
|
108
111
|
export declare function A({ children, ...props }: React.AnchorHTMLAttributes<HTMLAnchorElement>): JSX_2.Element;
|
|
109
112
|
|
|
@@ -770,6 +773,24 @@ export declare type BigNumberProps = {
|
|
|
770
773
|
|
|
771
774
|
export declare function Blockquote({ children, ...props }: React.HTMLAttributes<HTMLQuoteElement>): JSX_2.Element;
|
|
772
775
|
|
|
776
|
+
/**
|
|
777
|
+
* Base for boolean-specific conditions
|
|
778
|
+
*/
|
|
779
|
+
declare interface BooleanRenderIfBase {
|
|
780
|
+
fieldId: string;
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
/**
|
|
784
|
+
* RenderIf conditions specific to boolean fields
|
|
785
|
+
*/
|
|
786
|
+
export declare type BooleanRenderIfCondition = BooleanRenderIfBase & ({
|
|
787
|
+
equalsTo: boolean;
|
|
788
|
+
} | {
|
|
789
|
+
notEqualsTo: boolean;
|
|
790
|
+
} | {
|
|
791
|
+
isEmpty: boolean;
|
|
792
|
+
});
|
|
793
|
+
|
|
773
794
|
export declare const buildTranslations: (translations: TranslationsType) => TranslationsType;
|
|
774
795
|
|
|
775
796
|
/**
|
|
@@ -1154,6 +1175,11 @@ export declare const CategoryBarChart: ForwardRefExoticComponent<Omit<CategoryBa
|
|
|
1154
1175
|
|
|
1155
1176
|
export declare const ChatSpinner: ForwardRefExoticComponent<Omit<SVGProps<SVGSVGElement>, "ref"> & RefAttributes<SVGSVGElement>>;
|
|
1156
1177
|
|
|
1178
|
+
/**
|
|
1179
|
+
* All valid renderIf conditions for checkbox fields
|
|
1180
|
+
*/
|
|
1181
|
+
declare type CheckboxFieldRenderIf = BooleanRenderIfCondition | CommonRenderIfCondition;
|
|
1182
|
+
|
|
1157
1183
|
declare interface CheckboxProps extends DataAttributes_2 {
|
|
1158
1184
|
/**
|
|
1159
1185
|
* The title of the checkbox
|
|
@@ -1205,6 +1231,11 @@ declare interface CheckboxProps extends DataAttributes_2 {
|
|
|
1205
1231
|
* The name of the checkbox
|
|
1206
1232
|
*/
|
|
1207
1233
|
name?: string;
|
|
1234
|
+
/**
|
|
1235
|
+
* Whether the checkbox is required
|
|
1236
|
+
* @default false
|
|
1237
|
+
*/
|
|
1238
|
+
required?: boolean;
|
|
1208
1239
|
}
|
|
1209
1240
|
|
|
1210
1241
|
declare type ChildrenPaginationInfo = {
|
|
@@ -1334,6 +1365,14 @@ values: {
|
|
|
1334
1365
|
}) => void) | undefined;
|
|
1335
1366
|
} & RefAttributes<HTMLDivElement>, "ref"> & RefAttributes<HTMLElement | SVGElement>>;
|
|
1336
1367
|
|
|
1368
|
+
/**
|
|
1369
|
+
* Common condition available for all field types
|
|
1370
|
+
*/
|
|
1371
|
+
export declare type CommonRenderIfCondition = RenderIfBase & {
|
|
1372
|
+
/** Check if the field value is empty (null, undefined, empty string, empty array) */
|
|
1373
|
+
isEmpty: boolean;
|
|
1374
|
+
};
|
|
1375
|
+
|
|
1337
1376
|
export declare type CompanyAvatarVariant = Extract<AvatarVariant, {
|
|
1338
1377
|
type: "company";
|
|
1339
1378
|
}>;
|
|
@@ -1384,6 +1423,64 @@ export declare type CurrentFilters<F extends FilterOptions<string>> = F extends
|
|
|
1384
1423
|
[Key in K]?: FilterValue<F["fields"][Key]>;
|
|
1385
1424
|
} : Record<string, never>;
|
|
1386
1425
|
|
|
1426
|
+
/**
|
|
1427
|
+
* All valid renderIf conditions for custom fields
|
|
1428
|
+
*/
|
|
1429
|
+
declare type CustomFieldRenderIf = CommonRenderIfCondition;
|
|
1430
|
+
|
|
1431
|
+
/**
|
|
1432
|
+
* Props passed to the custom field render function
|
|
1433
|
+
*
|
|
1434
|
+
* @typeParam TValue - Type of the field value (inferred from Zod schema)
|
|
1435
|
+
* @typeParam TConfig - Type of the custom configuration object
|
|
1436
|
+
*/
|
|
1437
|
+
export declare interface CustomFieldRenderProps<TValue = unknown, TConfig = undefined> {
|
|
1438
|
+
/** Field id */
|
|
1439
|
+
id: string;
|
|
1440
|
+
/** Field label */
|
|
1441
|
+
label: string;
|
|
1442
|
+
/** Placeholder text */
|
|
1443
|
+
placeholder?: string;
|
|
1444
|
+
/** Current field value */
|
|
1445
|
+
value: TValue;
|
|
1446
|
+
/** Callback to update the value */
|
|
1447
|
+
onChange: (value: TValue) => void;
|
|
1448
|
+
/** Callback for blur events */
|
|
1449
|
+
onBlur: () => void;
|
|
1450
|
+
/** Error message if validation failed */
|
|
1451
|
+
error?: string;
|
|
1452
|
+
/** Whether async validation is in progress */
|
|
1453
|
+
isValidating: boolean;
|
|
1454
|
+
/** Whether the field is disabled */
|
|
1455
|
+
disabled?: boolean;
|
|
1456
|
+
/** Custom configuration passed via fieldConfig */
|
|
1457
|
+
config: TConfig;
|
|
1458
|
+
}
|
|
1459
|
+
|
|
1460
|
+
/**
|
|
1461
|
+
* Base props passed to all custom field render functions (runtime type)
|
|
1462
|
+
*/
|
|
1463
|
+
declare interface CustomFieldRenderPropsBase {
|
|
1464
|
+
/** Field id */
|
|
1465
|
+
id: string;
|
|
1466
|
+
/** Field label */
|
|
1467
|
+
label: string;
|
|
1468
|
+
/** Placeholder text */
|
|
1469
|
+
placeholder?: string;
|
|
1470
|
+
/** Current field value */
|
|
1471
|
+
value: unknown;
|
|
1472
|
+
/** Callback to update the value */
|
|
1473
|
+
onChange: (value: unknown) => void;
|
|
1474
|
+
/** Callback for blur events */
|
|
1475
|
+
onBlur: () => void;
|
|
1476
|
+
/** Error message if validation failed */
|
|
1477
|
+
error?: string;
|
|
1478
|
+
/** Whether async validation is in progress */
|
|
1479
|
+
isValidating: boolean;
|
|
1480
|
+
/** Whether the field is disabled */
|
|
1481
|
+
disabled?: boolean;
|
|
1482
|
+
}
|
|
1483
|
+
|
|
1387
1484
|
export declare const Dashboard: ComponentType<DashboardProps_2> & PageLayoutGroupComponent_2;
|
|
1388
1485
|
|
|
1389
1486
|
export declare type DashboardProps = GroupGridProps<DashboardWidget>;
|
|
@@ -1632,6 +1729,11 @@ export declare type DataSourceDefinition<R extends RecordType = RecordType, Filt
|
|
|
1632
1729
|
}) => number | undefined;
|
|
1633
1730
|
};
|
|
1634
1731
|
|
|
1732
|
+
/**
|
|
1733
|
+
* All valid renderIf conditions for date fields
|
|
1734
|
+
*/
|
|
1735
|
+
declare type DateFieldRenderIf = DateRenderIfCondition | CommonRenderIfCondition;
|
|
1736
|
+
|
|
1635
1737
|
export declare type DateFilterDefinition = BaseFilterDefinition<"date"> & {
|
|
1636
1738
|
options?: DateFilterOptions_2;
|
|
1637
1739
|
};
|
|
@@ -1644,6 +1746,11 @@ declare type DateFilterOptions_2 = {
|
|
|
1644
1746
|
view?: CalendarView;
|
|
1645
1747
|
};
|
|
1646
1748
|
|
|
1749
|
+
/**
|
|
1750
|
+
* Valid granularity keys for date pickers
|
|
1751
|
+
*/
|
|
1752
|
+
export declare type DateGranularity = "day" | "week" | "month" | "quarter" | "halfyear" | "year" | "range";
|
|
1753
|
+
|
|
1647
1754
|
declare type DateNavigationOptions = {
|
|
1648
1755
|
min?: Date;
|
|
1649
1756
|
max?: Date;
|
|
@@ -1707,11 +1814,64 @@ declare type DateRange = {
|
|
|
1707
1814
|
|
|
1708
1815
|
declare type DateRangeComplete = Required<DateRange>;
|
|
1709
1816
|
|
|
1817
|
+
/**
|
|
1818
|
+
* All valid renderIf conditions for date range fields
|
|
1819
|
+
*/
|
|
1820
|
+
declare type DateRangeFieldRenderIf = DateRangeRenderIfCondition | CommonRenderIfCondition;
|
|
1821
|
+
|
|
1822
|
+
/**
|
|
1823
|
+
* Base for date range-specific conditions
|
|
1824
|
+
*/
|
|
1825
|
+
declare interface DateRangeRenderIfBase {
|
|
1826
|
+
fieldId: string;
|
|
1827
|
+
}
|
|
1828
|
+
|
|
1829
|
+
/**
|
|
1830
|
+
* RenderIf conditions specific to date range fields
|
|
1831
|
+
*/
|
|
1832
|
+
export declare type DateRangeRenderIfCondition = DateRangeRenderIfBase & {
|
|
1833
|
+
isEmpty: boolean;
|
|
1834
|
+
};
|
|
1835
|
+
|
|
1710
1836
|
declare type DateRangeString = {
|
|
1711
1837
|
from: string;
|
|
1712
1838
|
to?: string;
|
|
1713
1839
|
};
|
|
1714
1840
|
|
|
1841
|
+
/**
|
|
1842
|
+
* The value type for a date range field
|
|
1843
|
+
*/
|
|
1844
|
+
export declare interface DateRangeValue {
|
|
1845
|
+
from: Date;
|
|
1846
|
+
to: Date;
|
|
1847
|
+
}
|
|
1848
|
+
|
|
1849
|
+
/**
|
|
1850
|
+
* Base for date-specific conditions
|
|
1851
|
+
*/
|
|
1852
|
+
declare interface DateRenderIfBase {
|
|
1853
|
+
fieldId: string;
|
|
1854
|
+
}
|
|
1855
|
+
|
|
1856
|
+
/**
|
|
1857
|
+
* RenderIf conditions specific to date fields
|
|
1858
|
+
*/
|
|
1859
|
+
export declare type DateRenderIfCondition = DateRenderIfBase & ({
|
|
1860
|
+
equalsTo: Date;
|
|
1861
|
+
} | {
|
|
1862
|
+
notEqualsTo: Date;
|
|
1863
|
+
} | {
|
|
1864
|
+
greaterThan: Date;
|
|
1865
|
+
} | {
|
|
1866
|
+
greaterThanOrEqual: Date;
|
|
1867
|
+
} | {
|
|
1868
|
+
lowerThan: Date;
|
|
1869
|
+
} | {
|
|
1870
|
+
lowerThanOrEqual: Date;
|
|
1871
|
+
} | {
|
|
1872
|
+
isEmpty: boolean;
|
|
1873
|
+
});
|
|
1874
|
+
|
|
1715
1875
|
declare type DateStringFormat = "default" | "long";
|
|
1716
1876
|
|
|
1717
1877
|
declare type DateValue = {
|
|
@@ -2215,6 +2375,45 @@ export declare const defaultTranslations: {
|
|
|
2215
2375
|
readonly customPromptPlaceholder: "What do you want to do?";
|
|
2216
2376
|
};
|
|
2217
2377
|
};
|
|
2378
|
+
readonly forms: {
|
|
2379
|
+
readonly actionBar: {
|
|
2380
|
+
readonly unsavedChanges: "You have changes pending to be saved";
|
|
2381
|
+
readonly discard: "Discard";
|
|
2382
|
+
readonly issues: {
|
|
2383
|
+
readonly one: "{{count}} issue";
|
|
2384
|
+
readonly other: "{{count}} issues";
|
|
2385
|
+
};
|
|
2386
|
+
};
|
|
2387
|
+
readonly validation: {
|
|
2388
|
+
readonly required: "This field is required";
|
|
2389
|
+
readonly invalidType: "Invalid value";
|
|
2390
|
+
readonly string: {
|
|
2391
|
+
readonly email: "Enter a valid email address";
|
|
2392
|
+
readonly url: "Enter a valid URL";
|
|
2393
|
+
readonly min: "Must be at least {{min}} characters";
|
|
2394
|
+
readonly max: "Must be at most {{max}} characters";
|
|
2395
|
+
};
|
|
2396
|
+
readonly number: {
|
|
2397
|
+
readonly min: "Must be at least {{min}}";
|
|
2398
|
+
readonly max: "Must be at most {{max}}";
|
|
2399
|
+
readonly positive: "Must be a positive number";
|
|
2400
|
+
readonly negative: "Must be a negative number";
|
|
2401
|
+
readonly integer: "Must be a whole number";
|
|
2402
|
+
};
|
|
2403
|
+
readonly date: {
|
|
2404
|
+
readonly min: "Date must be after {{min}}";
|
|
2405
|
+
readonly max: "Date must be before {{max}}";
|
|
2406
|
+
readonly invalid: "Enter a valid date";
|
|
2407
|
+
};
|
|
2408
|
+
readonly array: {
|
|
2409
|
+
readonly min: "Select at least {{min}} option";
|
|
2410
|
+
readonly max: "Select at most {{max}} options";
|
|
2411
|
+
};
|
|
2412
|
+
readonly checkbox: {
|
|
2413
|
+
readonly mustBeChecked: "This option must be selected";
|
|
2414
|
+
};
|
|
2415
|
+
};
|
|
2416
|
+
};
|
|
2218
2417
|
};
|
|
2219
2418
|
|
|
2220
2419
|
export declare type DialogPosition = (typeof dialogPositions)[number];
|
|
@@ -2335,6 +2534,11 @@ export declare interface ErrorMessageProps {
|
|
|
2335
2534
|
description: string;
|
|
2336
2535
|
}
|
|
2337
2536
|
|
|
2537
|
+
/**
|
|
2538
|
+
* Evaluate a renderIf condition against the current form values
|
|
2539
|
+
*/
|
|
2540
|
+
export declare function evaluateRenderIf(condition: RenderIfCondition, values: Record<string, unknown>): boolean;
|
|
2541
|
+
|
|
2338
2542
|
declare type EventCatcherFunction = (eventName: EventName, params: EventParams) => void;
|
|
2339
2543
|
|
|
2340
2544
|
declare interface EventCatcherProviderProps {
|
|
@@ -2470,6 +2674,15 @@ export declare interface F0AlertProps {
|
|
|
2470
2674
|
variant: AlertVariant;
|
|
2471
2675
|
}
|
|
2472
2676
|
|
|
2677
|
+
/**
|
|
2678
|
+
* Config for array fields (multi-select)
|
|
2679
|
+
* @typeParam T - The value type (string or number)
|
|
2680
|
+
* @typeParam R - Record type for data source (when using source instead of options)
|
|
2681
|
+
*/
|
|
2682
|
+
export declare type F0ArrayConfig<T extends string | number = string, R extends Record<string, unknown> = Record<string, unknown>> = F0BaseConfig & F0SelectConfig<T, R> & {
|
|
2683
|
+
fieldType?: "select";
|
|
2684
|
+
};
|
|
2685
|
+
|
|
2473
2686
|
export declare function F0AuraVoiceAnimation({ size, state, color, colorShift, audioTrack, themeMode, className, ref, ...props }: F0AuraVoiceAnimationProps & ComponentProps<"div"> & VariantProps<typeof F0AuraVoiceAnimationVariants>): JSX_2.Element;
|
|
2474
2687
|
|
|
2475
2688
|
export declare interface F0AuraVoiceAnimationProps {
|
|
@@ -2675,6 +2888,45 @@ export declare type F0AvatarTeamProps = {
|
|
|
2675
2888
|
badge?: AvatarBadge;
|
|
2676
2889
|
} & Pick<BaseAvatarProps, "aria-label" | "aria-labelledby">;
|
|
2677
2890
|
|
|
2891
|
+
/**
|
|
2892
|
+
* Base configuration shared across all field types.
|
|
2893
|
+
* Position is automatically derived from field declaration order in the schema.
|
|
2894
|
+
*/
|
|
2895
|
+
export declare interface F0BaseConfig {
|
|
2896
|
+
/** Label displayed above the field */
|
|
2897
|
+
label: string;
|
|
2898
|
+
/** Section ID to group field under (null = root level) */
|
|
2899
|
+
section?: string;
|
|
2900
|
+
/** Placeholder text for the input */
|
|
2901
|
+
placeholder?: string;
|
|
2902
|
+
/** Helper text displayed below the field */
|
|
2903
|
+
helpText?: string;
|
|
2904
|
+
/** Whether the field is disabled */
|
|
2905
|
+
disabled?: boolean;
|
|
2906
|
+
/** Row ID for horizontal grouping with other fields */
|
|
2907
|
+
row?: string;
|
|
2908
|
+
/** Conditional rendering based on another field's value */
|
|
2909
|
+
renderIf?: RenderIfCondition;
|
|
2910
|
+
}
|
|
2911
|
+
|
|
2912
|
+
/**
|
|
2913
|
+
* Base properties shared across all F0 field types
|
|
2914
|
+
*/
|
|
2915
|
+
export declare interface F0BaseField {
|
|
2916
|
+
/** Unique identifier for the field, used as the form field name */
|
|
2917
|
+
id: string;
|
|
2918
|
+
/** Label displayed above the field */
|
|
2919
|
+
label: string;
|
|
2920
|
+
/** Zod validation schema for the field */
|
|
2921
|
+
validation?: ZodTypeAny;
|
|
2922
|
+
/** Helper text displayed below the field */
|
|
2923
|
+
helpText?: string;
|
|
2924
|
+
/** Placeholder text for the input */
|
|
2925
|
+
placeholder?: string;
|
|
2926
|
+
/** Whether the field is disabled */
|
|
2927
|
+
disabled?: boolean;
|
|
2928
|
+
}
|
|
2929
|
+
|
|
2678
2930
|
export declare const F0BigNumber: {
|
|
2679
2931
|
({ label, ...props }: BigNumberProps_2): JSX_2.Element;
|
|
2680
2932
|
displayName: string;
|
|
@@ -2682,6 +2934,25 @@ export declare const F0BigNumber: {
|
|
|
2682
2934
|
Skeleton: () => JSX_2.Element;
|
|
2683
2935
|
};
|
|
2684
2936
|
|
|
2937
|
+
/**
|
|
2938
|
+
* Config for boolean fields - checkbox
|
|
2939
|
+
*/
|
|
2940
|
+
declare type F0BooleanCheckboxConfig = F0BaseConfig & F0CheckboxConfig & {
|
|
2941
|
+
fieldType: "checkbox";
|
|
2942
|
+
};
|
|
2943
|
+
|
|
2944
|
+
/**
|
|
2945
|
+
* Union of all boolean field configs
|
|
2946
|
+
*/
|
|
2947
|
+
export declare type F0BooleanConfig = F0BooleanCheckboxConfig | F0BooleanSwitchConfig;
|
|
2948
|
+
|
|
2949
|
+
/**
|
|
2950
|
+
* Config for boolean fields - switch (default for z.boolean())
|
|
2951
|
+
*/
|
|
2952
|
+
declare type F0BooleanSwitchConfig = F0BaseConfig & F0SwitchConfig & {
|
|
2953
|
+
fieldType?: "switch";
|
|
2954
|
+
};
|
|
2955
|
+
|
|
2685
2956
|
export declare const F0Button: ForwardRefExoticComponent<Omit<ButtonInternalProps, "style" | "className" | "variant" | "pressed" | "append" | "compact" | "noAutoTooltip" | "noTitle"> & {
|
|
2686
2957
|
variant?: Exclude<ButtonInternalProps["variant"], "ai">;
|
|
2687
2958
|
} & RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
|
|
@@ -2791,7 +3062,23 @@ export declare type F0CardProps = Omit<CardInternalProps, (typeof privateProps_3
|
|
|
2791
3062
|
*/
|
|
2792
3063
|
export declare const F0Checkbox: typeof _F0Checkbox;
|
|
2793
3064
|
|
|
2794
|
-
declare function _F0Checkbox({ title, onCheckedChange, id, disabled, indeterminate, checked, value, hideLabel, presentational, stopPropagation, name, ...rest }: CheckboxProps): JSX_2.Element;
|
|
3065
|
+
declare function _F0Checkbox({ title, onCheckedChange, id, disabled, indeterminate, checked, value, hideLabel, presentational, stopPropagation, name, required, ...rest }: CheckboxProps): JSX_2.Element;
|
|
3066
|
+
|
|
3067
|
+
/**
|
|
3068
|
+
* F0 config options specific to checkbox fields
|
|
3069
|
+
* (checkbox has no additional options beyond base config)
|
|
3070
|
+
*/
|
|
3071
|
+
export declare interface F0CheckboxConfig {
|
|
3072
|
+
}
|
|
3073
|
+
|
|
3074
|
+
/**
|
|
3075
|
+
* Checkbox field with all properties for rendering
|
|
3076
|
+
*/
|
|
3077
|
+
export declare type F0CheckboxField = F0BaseField & {
|
|
3078
|
+
type: "checkbox";
|
|
3079
|
+
/** Conditional rendering based on another field's value */
|
|
3080
|
+
renderIf?: CheckboxFieldRenderIf;
|
|
3081
|
+
};
|
|
2795
3082
|
|
|
2796
3083
|
/**
|
|
2797
3084
|
* @experimental This is an experimental component use it at your own risk
|
|
@@ -2801,6 +3088,153 @@ export declare const F0ChipList: {
|
|
|
2801
3088
|
displayName: string;
|
|
2802
3089
|
};
|
|
2803
3090
|
|
|
3091
|
+
/**
|
|
3092
|
+
* F0 config options specific to custom fields
|
|
3093
|
+
*
|
|
3094
|
+
* @typeParam TValue - Type of the field value (inferred from Zod schema)
|
|
3095
|
+
* @typeParam TConfig - Type of the custom configuration object
|
|
3096
|
+
*
|
|
3097
|
+
* @example Without fieldConfig:
|
|
3098
|
+
* ```tsx
|
|
3099
|
+
* f0FormField(z.string(), {
|
|
3100
|
+
* label: "Employee",
|
|
3101
|
+
* fieldType: "custom",
|
|
3102
|
+
* render: ({ value, onChange }) => (
|
|
3103
|
+
* // value is typed as string
|
|
3104
|
+
* <EmployeeSelector value={value} onChange={onChange} />
|
|
3105
|
+
* ),
|
|
3106
|
+
* })
|
|
3107
|
+
* ```
|
|
3108
|
+
*
|
|
3109
|
+
* @example With fieldConfig:
|
|
3110
|
+
* ```tsx
|
|
3111
|
+
* f0FormField(z.array(z.number()), {
|
|
3112
|
+
* label: "Select employees",
|
|
3113
|
+
* fieldType: "custom",
|
|
3114
|
+
* fieldConfig: {
|
|
3115
|
+
* multiple: true,
|
|
3116
|
+
* excludeCurrentEmployee: true,
|
|
3117
|
+
* },
|
|
3118
|
+
* render: ({ value, onChange, config }) => {
|
|
3119
|
+
* // value is typed as number[]
|
|
3120
|
+
* // config is typed as { multiple: boolean, excludeCurrentEmployee: boolean }
|
|
3121
|
+
* return (
|
|
3122
|
+
* <EmployeeSelector
|
|
3123
|
+
* multiple={config.multiple}
|
|
3124
|
+
* excludeCurrent={config.excludeCurrentEmployee}
|
|
3125
|
+
* value={value}
|
|
3126
|
+
* onChange={onChange}
|
|
3127
|
+
* />
|
|
3128
|
+
* )
|
|
3129
|
+
* },
|
|
3130
|
+
* })
|
|
3131
|
+
* ```
|
|
3132
|
+
*/
|
|
3133
|
+
export declare type F0CustomConfig<TValue = unknown, TConfig = undefined> = TConfig extends undefined ? F0CustomConfigBase<TValue> : F0CustomConfigWithFieldConfig<TValue, TConfig>;
|
|
3134
|
+
|
|
3135
|
+
/**
|
|
3136
|
+
* Custom config without fieldConfig (render receives config: undefined)
|
|
3137
|
+
*
|
|
3138
|
+
* @typeParam TValue - Type of the field value
|
|
3139
|
+
*/
|
|
3140
|
+
declare interface F0CustomConfigBase<TValue = unknown> {
|
|
3141
|
+
/** Render function for the custom component */
|
|
3142
|
+
render: (props: CustomFieldRenderProps<TValue, undefined>) => ReactNode;
|
|
3143
|
+
}
|
|
3144
|
+
|
|
3145
|
+
/**
|
|
3146
|
+
* Custom config with fieldConfig (render receives typed config)
|
|
3147
|
+
*
|
|
3148
|
+
* @typeParam TValue - Type of the field value
|
|
3149
|
+
* @typeParam TConfig - Type of the fieldConfig object
|
|
3150
|
+
*/
|
|
3151
|
+
declare interface F0CustomConfigWithFieldConfig<TValue = unknown, TConfig = unknown> {
|
|
3152
|
+
/** Custom configuration to pass to the render function */
|
|
3153
|
+
fieldConfig: TConfig;
|
|
3154
|
+
/** Render function for the custom component */
|
|
3155
|
+
render: (props: CustomFieldRenderProps<TValue, TConfig>) => ReactNode;
|
|
3156
|
+
}
|
|
3157
|
+
|
|
3158
|
+
/**
|
|
3159
|
+
* Custom field with all properties for rendering (runtime type)
|
|
3160
|
+
*/
|
|
3161
|
+
export declare type F0CustomField = F0BaseField & {
|
|
3162
|
+
type: "custom";
|
|
3163
|
+
/** Render function for the custom component */
|
|
3164
|
+
render: (props: CustomFieldRenderPropsBase & {
|
|
3165
|
+
config: unknown;
|
|
3166
|
+
}) => ReactNode;
|
|
3167
|
+
/** Custom configuration (if provided) */
|
|
3168
|
+
fieldConfig?: unknown;
|
|
3169
|
+
/** Conditional rendering based on another field's value */
|
|
3170
|
+
renderIf?: CustomFieldRenderIf;
|
|
3171
|
+
};
|
|
3172
|
+
|
|
3173
|
+
/**
|
|
3174
|
+
* Union of custom field configs (with or without fieldConfig)
|
|
3175
|
+
*
|
|
3176
|
+
* @typeParam TValue - Type of the field value (inferred from Zod schema)
|
|
3177
|
+
* @typeParam TConfig - Type of the fieldConfig object
|
|
3178
|
+
*/
|
|
3179
|
+
export declare type F0CustomFieldConfig<TValue = unknown, TConfig = undefined> = TConfig extends undefined ? F0CustomFieldConfigBase<TValue> : F0CustomFieldConfigWithConfig<TValue, TConfig>;
|
|
3180
|
+
|
|
3181
|
+
/**
|
|
3182
|
+
* Config for custom fields without fieldConfig
|
|
3183
|
+
*
|
|
3184
|
+
* @typeParam TValue - Type of the field value (inferred from Zod schema)
|
|
3185
|
+
*/
|
|
3186
|
+
declare type F0CustomFieldConfigBase<TValue = unknown> = F0BaseConfig & F0CustomConfig<TValue, undefined> & {
|
|
3187
|
+
fieldType: "custom";
|
|
3188
|
+
};
|
|
3189
|
+
|
|
3190
|
+
/**
|
|
3191
|
+
* Config for custom fields with fieldConfig
|
|
3192
|
+
*
|
|
3193
|
+
* @typeParam TValue - Type of the field value (inferred from Zod schema)
|
|
3194
|
+
* @typeParam TConfig - Type of the custom configuration object passed to render
|
|
3195
|
+
*/
|
|
3196
|
+
declare type F0CustomFieldConfigWithConfig<TValue = unknown, TConfig = unknown> = F0BaseConfig & F0CustomConfig<TValue, TConfig> & {
|
|
3197
|
+
fieldType: "custom";
|
|
3198
|
+
};
|
|
3199
|
+
|
|
3200
|
+
/**
|
|
3201
|
+
* F0 config options specific to date fields
|
|
3202
|
+
*
|
|
3203
|
+
* Note: `minDate`, `maxDate`, and `clearable` are derived from the Zod schema:
|
|
3204
|
+
* - `z.date().min(date)` → minDate
|
|
3205
|
+
* - `z.date().max(date)` → maxDate
|
|
3206
|
+
* - `z.date().optional()` or `z.date().nullable()` → clearable
|
|
3207
|
+
*/
|
|
3208
|
+
export declare interface F0DateConfig {
|
|
3209
|
+
/** Available granularities for the date picker */
|
|
3210
|
+
granularities?: DateGranularity[];
|
|
3211
|
+
/** Preset date options to display */
|
|
3212
|
+
presets?: DatePreset[];
|
|
3213
|
+
}
|
|
3214
|
+
|
|
3215
|
+
/**
|
|
3216
|
+
* Date field with all properties for rendering
|
|
3217
|
+
* Includes properties derived from Zod schema
|
|
3218
|
+
*/
|
|
3219
|
+
export declare type F0DateField = F0BaseField & F0DateConfig & {
|
|
3220
|
+
type: "date";
|
|
3221
|
+
/** Minimum selectable date (derived from z.date().min()) */
|
|
3222
|
+
minDate?: Date;
|
|
3223
|
+
/** Maximum selectable date (derived from z.date().max()) */
|
|
3224
|
+
maxDate?: Date;
|
|
3225
|
+
/** Whether the date can be cleared (derived from optional/nullable) */
|
|
3226
|
+
clearable?: boolean;
|
|
3227
|
+
/** Conditional rendering based on another field's value */
|
|
3228
|
+
renderIf?: DateFieldRenderIf;
|
|
3229
|
+
};
|
|
3230
|
+
|
|
3231
|
+
/**
|
|
3232
|
+
* Config for date fields
|
|
3233
|
+
*/
|
|
3234
|
+
export declare type F0DateFieldConfig = F0BaseConfig & F0DateConfig & {
|
|
3235
|
+
fieldType?: "date";
|
|
3236
|
+
};
|
|
3237
|
+
|
|
2804
3238
|
/**
|
|
2805
3239
|
* @experimental This is an experimental component use it at your own risk
|
|
2806
3240
|
*/
|
|
@@ -2813,6 +3247,45 @@ export declare type F0DatePickerProps = Pick<DatePickerPopupProps, "granularitie
|
|
|
2813
3247
|
value?: DatePickerValue;
|
|
2814
3248
|
} & Pick<InputFieldProps<string>, InputFieldInheritedProps>;
|
|
2815
3249
|
|
|
3250
|
+
/**
|
|
3251
|
+
* F0 config options specific to date range fields
|
|
3252
|
+
*
|
|
3253
|
+
* Note: `minDate`, `maxDate`, and `clearable` are derived from the Zod schema
|
|
3254
|
+
*/
|
|
3255
|
+
export declare interface F0DateRangeConfig {
|
|
3256
|
+
/** Label for the "from" date input */
|
|
3257
|
+
fromLabel?: string;
|
|
3258
|
+
/** Label for the "to" date input */
|
|
3259
|
+
toLabel?: string;
|
|
3260
|
+
/** Available granularities for the date picker */
|
|
3261
|
+
granularities?: DateGranularity[];
|
|
3262
|
+
/** Preset date options to display */
|
|
3263
|
+
presets?: DatePreset[];
|
|
3264
|
+
}
|
|
3265
|
+
|
|
3266
|
+
/**
|
|
3267
|
+
* Date range field with all properties for rendering
|
|
3268
|
+
* Includes properties derived from Zod schema
|
|
3269
|
+
*/
|
|
3270
|
+
export declare type F0DateRangeField = F0BaseField & F0DateRangeConfig & {
|
|
3271
|
+
type: "daterange";
|
|
3272
|
+
/** Minimum selectable date (derived from z.date().min() on the from field) */
|
|
3273
|
+
minDate?: Date;
|
|
3274
|
+
/** Maximum selectable date (derived from z.date().max() on the to field) */
|
|
3275
|
+
maxDate?: Date;
|
|
3276
|
+
/** Whether the date range can be cleared (derived from optional/nullable) */
|
|
3277
|
+
clearable?: boolean;
|
|
3278
|
+
/** Conditional rendering based on another field's value */
|
|
3279
|
+
renderIf?: DateRangeFieldRenderIf;
|
|
3280
|
+
};
|
|
3281
|
+
|
|
3282
|
+
/**
|
|
3283
|
+
* Config for date range fields
|
|
3284
|
+
*/
|
|
3285
|
+
export declare type F0DateRangeFieldConfig = F0BaseConfig & F0DateRangeConfig & {
|
|
3286
|
+
fieldType: "daterange";
|
|
3287
|
+
};
|
|
3288
|
+
|
|
2816
3289
|
/**
|
|
2817
3290
|
* @experimental This is an experimental component use it at your own risk
|
|
2818
3291
|
*/
|
|
@@ -2886,6 +3359,23 @@ export declare type F0DropdownButtonProps<T = string> = {
|
|
|
2886
3359
|
|
|
2887
3360
|
export declare function F0EventCatcherProvider({ children, onEvent, enabled, catchEvents, }: EventCatcherProviderProps): JSX.Element;
|
|
2888
3361
|
|
|
3362
|
+
/**
|
|
3363
|
+
* Union of all F0 field types used for rendering
|
|
3364
|
+
*/
|
|
3365
|
+
export declare type F0Field = F0TextField | F0NumberField | F0TextareaField | F0SelectField | F0CheckboxField | F0SwitchField | F0DateField | F0DateRangeField | F0RichTextField | F0CustomField;
|
|
3366
|
+
|
|
3367
|
+
/**
|
|
3368
|
+
* Complete F0 field configuration (union of all possible configs)
|
|
3369
|
+
* @typeParam T - The value type for select fields (string or number)
|
|
3370
|
+
* @typeParam R - Record type for data source (when using source instead of options)
|
|
3371
|
+
*/
|
|
3372
|
+
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 | F0ArrayConfig<T, R> | F0ObjectConfig;
|
|
3373
|
+
|
|
3374
|
+
/**
|
|
3375
|
+
* Field types for rendering
|
|
3376
|
+
*/
|
|
3377
|
+
export declare type F0FieldType = "text" | "number" | "textarea" | "select" | "checkbox" | "switch" | "date" | "daterange" | "richtext" | "custom";
|
|
3378
|
+
|
|
2889
3379
|
/**
|
|
2890
3380
|
* A standalone dual-pane filter picker content component.
|
|
2891
3381
|
*
|
|
@@ -2956,6 +3446,239 @@ export declare interface F0FilterPickerContentProps<Filters extends FiltersDefin
|
|
|
2956
3446
|
width?: number;
|
|
2957
3447
|
}
|
|
2958
3448
|
|
|
3449
|
+
/**
|
|
3450
|
+
* @experimental This is an experimental component, use it at your own risk
|
|
3451
|
+
*/
|
|
3452
|
+
export declare const F0Form: <TSchema extends z.ZodObject<ZodRawShape>>(props: F0FormProps<TSchema>) => React.ReactElement;
|
|
3453
|
+
|
|
3454
|
+
/**
|
|
3455
|
+
* Submit configuration for action bar type
|
|
3456
|
+
*/
|
|
3457
|
+
declare interface F0FormActionBarSubmitConfig extends F0FormSubmitConfigBase {
|
|
3458
|
+
/** Type of submit UI (floating action bar) */
|
|
3459
|
+
type: "action-bar";
|
|
3460
|
+
/** Whether to show a Discard button to reset form changes */
|
|
3461
|
+
discardable?: boolean;
|
|
3462
|
+
/**
|
|
3463
|
+
* Configuration for the discard button (label and icon)
|
|
3464
|
+
* @default { label: "Discard", icon: Delete }
|
|
3465
|
+
*/
|
|
3466
|
+
discardConfig?: F0FormDiscardConfig;
|
|
3467
|
+
/** Label shown in the action bar (defaults to i18n "forms.actionBar.unsavedChanges") */
|
|
3468
|
+
actionBarLabel?: string;
|
|
3469
|
+
/**
|
|
3470
|
+
* When true, centers the action bar relative to the ApplicationFrame content area
|
|
3471
|
+
* (accounting for the sidebar width) instead of the full viewport.
|
|
3472
|
+
* @default false
|
|
3473
|
+
*/
|
|
3474
|
+
centerActionBarInFrameContent?: boolean;
|
|
3475
|
+
}
|
|
3476
|
+
|
|
3477
|
+
/**
|
|
3478
|
+
* Submit configuration for default button type
|
|
3479
|
+
*/
|
|
3480
|
+
declare interface F0FormDefaultSubmitConfig extends F0FormSubmitConfigBase {
|
|
3481
|
+
/**
|
|
3482
|
+
* Type of submit UI
|
|
3483
|
+
* @default "default"
|
|
3484
|
+
*/
|
|
3485
|
+
type?: "default";
|
|
3486
|
+
}
|
|
3487
|
+
|
|
3488
|
+
/**
|
|
3489
|
+
* Configuration for the discard button (action bar only)
|
|
3490
|
+
*/
|
|
3491
|
+
export declare interface F0FormDiscardConfig {
|
|
3492
|
+
/** Custom label for the discard button */
|
|
3493
|
+
label?: string;
|
|
3494
|
+
/**
|
|
3495
|
+
* Custom icon for the discard button
|
|
3496
|
+
* - undefined: uses default Delete icon
|
|
3497
|
+
* - null: no icon shown
|
|
3498
|
+
* - IconType: custom icon
|
|
3499
|
+
*/
|
|
3500
|
+
icon?: IconType | null;
|
|
3501
|
+
}
|
|
3502
|
+
|
|
3503
|
+
/**
|
|
3504
|
+
* When to trigger and display validation errors
|
|
3505
|
+
* - "on-blur": Errors appear when the user leaves a field (default)
|
|
3506
|
+
* - "on-change": Errors appear as the user types (real-time validation)
|
|
3507
|
+
* - "on-submit": Errors only appear after attempting to submit the form
|
|
3508
|
+
*/
|
|
3509
|
+
export declare type F0FormErrorTriggerMode = "on-blur" | "on-change" | "on-submit";
|
|
3510
|
+
|
|
3511
|
+
/**
|
|
3512
|
+
* String field - text input, textarea, select, or custom
|
|
3513
|
+
* @typeParam R - Record type for data source (when using source instead of options)
|
|
3514
|
+
*/
|
|
3515
|
+
export declare function f0FormField<T extends z.ZodString, TConfig = undefined, R extends Record<string, unknown> = Record<string, unknown>>(schema: T, config: F0StringConfig<z.infer<T>, TConfig, R>): T & F0ZodType<T>;
|
|
3516
|
+
|
|
3517
|
+
/**
|
|
3518
|
+
* Number field - number input or select
|
|
3519
|
+
* @typeParam R - Record type for data source (when using source instead of options)
|
|
3520
|
+
*/
|
|
3521
|
+
export declare function f0FormField<T extends z.ZodNumber, R extends Record<string, unknown> = Record<string, unknown>>(schema: T, config: F0NumberFieldConfig<R>): T & F0ZodType<T>;
|
|
3522
|
+
|
|
3523
|
+
/**
|
|
3524
|
+
* Boolean field - checkbox or switch
|
|
3525
|
+
*/
|
|
3526
|
+
export declare function f0FormField<T extends z.ZodBoolean>(schema: T, config: F0BooleanConfig): T & F0ZodType<T>;
|
|
3527
|
+
|
|
3528
|
+
/**
|
|
3529
|
+
* Date field
|
|
3530
|
+
*/
|
|
3531
|
+
export declare function f0FormField<T extends z.ZodDate>(schema: T, config: F0DateFieldConfig): T & F0ZodType<T>;
|
|
3532
|
+
|
|
3533
|
+
/**
|
|
3534
|
+
* Enum field - select
|
|
3535
|
+
* @typeParam R - Record type for data source (when using source instead of options)
|
|
3536
|
+
*/
|
|
3537
|
+
export declare function f0FormField<T extends z.ZodEnum<[string, ...string[]]>, R extends Record<string, unknown> = Record<string, unknown>>(schema: T, config: F0StringSelectConfig<R>): T & F0ZodType<T>;
|
|
3538
|
+
|
|
3539
|
+
/**
|
|
3540
|
+
* Array field - multi-select
|
|
3541
|
+
* @typeParam V - The element value type (string or number)
|
|
3542
|
+
* @typeParam R - Record type for data source (when using source instead of options)
|
|
3543
|
+
*/
|
|
3544
|
+
export declare function f0FormField<T extends z.ZodArray<ZodTypeAny>, V extends string | number = string, R extends Record<string, unknown> = Record<string, unknown>>(schema: T, config: F0ArrayConfig<V, R>): T & F0ZodType<T>;
|
|
3545
|
+
|
|
3546
|
+
/**
|
|
3547
|
+
* Object field - richtext or custom
|
|
3548
|
+
*/
|
|
3549
|
+
export declare function f0FormField<T extends z.ZodObject<z.ZodRawShape>, TConfig = undefined>(schema: T, config: F0ObjectConfig<z.infer<T>, TConfig>): T & F0ZodType<T>;
|
|
3550
|
+
|
|
3551
|
+
/**
|
|
3552
|
+
* Optional wrapper - inherits inner type's config
|
|
3553
|
+
* @typeParam V - The value type for select fields (string or number)
|
|
3554
|
+
* @typeParam R - Record type for data source (when using source instead of options)
|
|
3555
|
+
*/
|
|
3556
|
+
export declare function f0FormField<T extends z.ZodOptional<ZodTypeAny>, V extends string | number = string | number, R extends Record<string, unknown> = Record<string, unknown>>(schema: T, config: F0FieldConfig<V, R>): T & F0ZodType<T>;
|
|
3557
|
+
|
|
3558
|
+
/**
|
|
3559
|
+
* Nullable wrapper - inherits inner type's config
|
|
3560
|
+
* @typeParam V - The value type for select fields (string or number)
|
|
3561
|
+
* @typeParam R - Record type for data source (when using source instead of options)
|
|
3562
|
+
*/
|
|
3563
|
+
export declare function f0FormField<T extends z.ZodNullable<ZodTypeAny>, V extends string | number = string | number, R extends Record<string, unknown> = Record<string, unknown>>(schema: T, config: F0FieldConfig<V, R>): T & F0ZodType<T>;
|
|
3564
|
+
|
|
3565
|
+
/**
|
|
3566
|
+
* Default wrapper - inherits inner type's config
|
|
3567
|
+
* @typeParam V - The value type for select fields (string or number)
|
|
3568
|
+
* @typeParam R - Record type for data source (when using source instead of options)
|
|
3569
|
+
*/
|
|
3570
|
+
export declare function f0FormField<T extends z.ZodDefault<ZodTypeAny>, V extends string | number = string | number, R extends Record<string, unknown> = Record<string, unknown>>(schema: T, config: F0FieldConfig<V, R>): T & F0ZodType<T>;
|
|
3571
|
+
|
|
3572
|
+
/**
|
|
3573
|
+
* Custom field - works with any schema type
|
|
3574
|
+
* Place before fallback to ensure proper type inference for fieldConfig
|
|
3575
|
+
* TValue is inferred from the Zod schema to provide typed value and onChange
|
|
3576
|
+
*/
|
|
3577
|
+
export declare function f0FormField<T extends ZodTypeAny, TConfig = undefined>(schema: T, config: F0CustomFieldConfig<z.infer<T>, TConfig>): T & F0ZodType<T>;
|
|
3578
|
+
|
|
3579
|
+
/**
|
|
3580
|
+
* Fallback for any other schema type
|
|
3581
|
+
* @typeParam V - The value type for select fields (string or number)
|
|
3582
|
+
* @typeParam R - Record type for data source (when using source instead of options)
|
|
3583
|
+
*/
|
|
3584
|
+
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>;
|
|
3585
|
+
|
|
3586
|
+
/**
|
|
3587
|
+
* Props for the F0Form component
|
|
3588
|
+
*
|
|
3589
|
+
* @typeParam TSchema - The Zod object schema type. The form data type is inferred from this.
|
|
3590
|
+
*
|
|
3591
|
+
* @example
|
|
3592
|
+
* ```tsx
|
|
3593
|
+
* const schema = z.object({
|
|
3594
|
+
* name: f0FormField(z.string(), { label: "Name" }),
|
|
3595
|
+
* age: f0FormField(z.number(), { label: "Age" }),
|
|
3596
|
+
* })
|
|
3597
|
+
*
|
|
3598
|
+
* // Default submit button
|
|
3599
|
+
* <F0Form
|
|
3600
|
+
* name="my-form"
|
|
3601
|
+
* schema={schema}
|
|
3602
|
+
* defaultValues={{ name: "" }}
|
|
3603
|
+
* onSubmit={(data) => ({ success: true })}
|
|
3604
|
+
* />
|
|
3605
|
+
*
|
|
3606
|
+
* // Action bar with discard button
|
|
3607
|
+
* <F0Form
|
|
3608
|
+
* name="my-form"
|
|
3609
|
+
* schema={schema}
|
|
3610
|
+
* submitConfig={{
|
|
3611
|
+
* type: "action-bar",
|
|
3612
|
+
* discardable: true,
|
|
3613
|
+
* }}
|
|
3614
|
+
* defaultValues={{ name: "" }}
|
|
3615
|
+
* onSubmit={(data) => ({ success: true })}
|
|
3616
|
+
* />
|
|
3617
|
+
* ```
|
|
3618
|
+
*/
|
|
3619
|
+
export declare interface F0FormProps<TSchema extends z.ZodObject<ZodRawShape>> {
|
|
3620
|
+
/** Unique name for the form, used for generating anchor links (e.g., #forms.[name].[sectionId].[fieldId]) */
|
|
3621
|
+
name: string;
|
|
3622
|
+
/** Zod object schema with F0 field configurations */
|
|
3623
|
+
schema: TSchema;
|
|
3624
|
+
/** Section configurations keyed by section ID */
|
|
3625
|
+
sections?: Record<string, F0SectionConfig>;
|
|
3626
|
+
/** Default values for the form fields (partial of the schema type) */
|
|
3627
|
+
defaultValues?: Partial<z.infer<TSchema>>;
|
|
3628
|
+
/** Callback when the form is submitted with valid data */
|
|
3629
|
+
onSubmit: (data: z.infer<TSchema>) => Promise<F0FormSubmitResult> | F0FormSubmitResult;
|
|
3630
|
+
/**
|
|
3631
|
+
* Configuration for form submission behavior and appearance
|
|
3632
|
+
* @default { type: "default", label: "Submit", icon: Save }
|
|
3633
|
+
*/
|
|
3634
|
+
submitConfig?: F0FormSubmitConfig;
|
|
3635
|
+
/** Additional class name for the form */
|
|
3636
|
+
className?: string;
|
|
3637
|
+
/**
|
|
3638
|
+
* When to trigger and display validation errors
|
|
3639
|
+
* @default "on-blur"
|
|
3640
|
+
*/
|
|
3641
|
+
errorTriggerMode?: F0FormErrorTriggerMode;
|
|
3642
|
+
}
|
|
3643
|
+
|
|
3644
|
+
/**
|
|
3645
|
+
* Type helper for creating a form schema with F0 fields
|
|
3646
|
+
*/
|
|
3647
|
+
export declare type F0FormSchema<T extends Record<string, ZodTypeAny>> = z.ZodObject<T>;
|
|
3648
|
+
|
|
3649
|
+
/**
|
|
3650
|
+
* Configuration for form submission behavior and appearance
|
|
3651
|
+
*/
|
|
3652
|
+
export declare type F0FormSubmitConfig = F0FormDefaultSubmitConfig | F0FormActionBarSubmitConfig;
|
|
3653
|
+
|
|
3654
|
+
/**
|
|
3655
|
+
* Base configuration shared by all submit types
|
|
3656
|
+
*/
|
|
3657
|
+
declare interface F0FormSubmitConfigBase {
|
|
3658
|
+
/** Custom label for the submit button */
|
|
3659
|
+
label?: string;
|
|
3660
|
+
/**
|
|
3661
|
+
* Custom icon for the submit button
|
|
3662
|
+
* - undefined: uses default Save icon
|
|
3663
|
+
* - null: no icon shown
|
|
3664
|
+
* - IconType: custom icon
|
|
3665
|
+
*/
|
|
3666
|
+
icon?: IconType | null;
|
|
3667
|
+
}
|
|
3668
|
+
|
|
3669
|
+
/**
|
|
3670
|
+
* Result of form submission
|
|
3671
|
+
*/
|
|
3672
|
+
export declare type F0FormSubmitResult = {
|
|
3673
|
+
success: true;
|
|
3674
|
+
} | {
|
|
3675
|
+
success: false;
|
|
3676
|
+
/** Root error message displayed at the top of the form */
|
|
3677
|
+
rootMessage?: string;
|
|
3678
|
+
/** Field-specific error messages */
|
|
3679
|
+
errors?: Record<string, string>;
|
|
3680
|
+
};
|
|
3681
|
+
|
|
2959
3682
|
export declare const F0GridStack: {
|
|
2960
3683
|
({ options, widgets, onChange, className, }: F0GridStackProps_2): JSX_2.Element;
|
|
2961
3684
|
displayName: string;
|
|
@@ -3038,6 +3761,63 @@ export declare type F0MessageSourcesProps = {
|
|
|
3038
3761
|
sources: F0Source[];
|
|
3039
3762
|
};
|
|
3040
3763
|
|
|
3764
|
+
/**
|
|
3765
|
+
* F0 config options specific to number fields
|
|
3766
|
+
*
|
|
3767
|
+
* Note: `min` and `max` are derived from the Zod schema:
|
|
3768
|
+
* - `z.number().min(n)` → min
|
|
3769
|
+
* - `z.number().max(n)` → max
|
|
3770
|
+
*/
|
|
3771
|
+
export declare interface F0NumberConfig {
|
|
3772
|
+
/** Step value for the number input */
|
|
3773
|
+
step?: number;
|
|
3774
|
+
/** Locale for number formatting */
|
|
3775
|
+
locale?: string;
|
|
3776
|
+
}
|
|
3777
|
+
|
|
3778
|
+
/**
|
|
3779
|
+
* Number field with all properties for rendering
|
|
3780
|
+
* Includes properties derived from Zod schema
|
|
3781
|
+
*/
|
|
3782
|
+
export declare type F0NumberField = F0BaseField & F0NumberConfig & {
|
|
3783
|
+
type: "number";
|
|
3784
|
+
/** Minimum value (derived from z.number().min()) */
|
|
3785
|
+
min?: number;
|
|
3786
|
+
/** Maximum value (derived from z.number().max()) */
|
|
3787
|
+
max?: number;
|
|
3788
|
+
/** Conditional rendering based on another field's value */
|
|
3789
|
+
renderIf?: NumberFieldRenderIf;
|
|
3790
|
+
};
|
|
3791
|
+
|
|
3792
|
+
/**
|
|
3793
|
+
* Config for number fields
|
|
3794
|
+
* @typeParam R - Record type for data source (when using source instead of options)
|
|
3795
|
+
*/
|
|
3796
|
+
export declare type F0NumberFieldConfig<R extends Record<string, unknown> = Record<string, unknown>> = F0NumberInputConfig | F0NumberSelectConfig<R>;
|
|
3797
|
+
|
|
3798
|
+
/**
|
|
3799
|
+
* Config for number fields - number input
|
|
3800
|
+
*/
|
|
3801
|
+
declare type F0NumberInputConfig = F0BaseConfig & F0NumberConfig & {
|
|
3802
|
+
fieldType?: "number";
|
|
3803
|
+
};
|
|
3804
|
+
|
|
3805
|
+
/**
|
|
3806
|
+
* Config for number fields - select (for selecting numeric values)
|
|
3807
|
+
* @typeParam R - Record type for data source (when using source instead of options)
|
|
3808
|
+
*/
|
|
3809
|
+
declare type F0NumberSelectConfig<R extends Record<string, unknown> = Record<string, unknown>> = F0BaseConfig & F0SelectConfig<number, R> & {
|
|
3810
|
+
fieldType: "select";
|
|
3811
|
+
};
|
|
3812
|
+
|
|
3813
|
+
/**
|
|
3814
|
+
* Config for object fields (richtext, daterange, or custom)
|
|
3815
|
+
*
|
|
3816
|
+
* @typeParam TValue - Type of the field value (for custom fields)
|
|
3817
|
+
* @typeParam TConfig - Type of the custom configuration object (for custom fields)
|
|
3818
|
+
*/
|
|
3819
|
+
declare type F0ObjectConfig<TValue = unknown, TConfig = undefined> = F0RichTextFieldConfig | F0DateRangeFieldConfig | F0CustomFieldConfig<TValue, TConfig>;
|
|
3820
|
+
|
|
3041
3821
|
export declare const F0OneIcon: ForwardRefExoticComponent<Omit<F0OneIconProps, "ref"> & RefAttributes<SVGSVGElement>>;
|
|
3042
3822
|
|
|
3043
3823
|
/**
|
|
@@ -3082,6 +3862,49 @@ export declare const F0Provider: React.FC<{
|
|
|
3082
3862
|
dataCollectionStorageHandler?: DataCollectionStorageHandler;
|
|
3083
3863
|
}>;
|
|
3084
3864
|
|
|
3865
|
+
/**
|
|
3866
|
+
* F0 config options specific to rich text fields
|
|
3867
|
+
*/
|
|
3868
|
+
export declare interface F0RichTextConfig {
|
|
3869
|
+
/** Maximum number of characters allowed */
|
|
3870
|
+
maxCharacters?: number;
|
|
3871
|
+
/** Configuration for user mentions */
|
|
3872
|
+
mentionsConfig?: MentionsConfig;
|
|
3873
|
+
/** Height configuration for the editor */
|
|
3874
|
+
height?: heightType;
|
|
3875
|
+
/** Whether to use plain HTML mode */
|
|
3876
|
+
plainHtmlMode?: boolean;
|
|
3877
|
+
}
|
|
3878
|
+
|
|
3879
|
+
/**
|
|
3880
|
+
* Rich text field with all properties for rendering
|
|
3881
|
+
*/
|
|
3882
|
+
export declare type F0RichTextField = F0BaseField & F0RichTextConfig & {
|
|
3883
|
+
type: "richtext";
|
|
3884
|
+
/** Conditional rendering based on another field's value */
|
|
3885
|
+
renderIf?: RichTextFieldRenderIf;
|
|
3886
|
+
};
|
|
3887
|
+
|
|
3888
|
+
/**
|
|
3889
|
+
* Config for richtext fields
|
|
3890
|
+
*/
|
|
3891
|
+
export declare type F0RichTextFieldConfig = F0BaseConfig & F0RichTextConfig & {
|
|
3892
|
+
fieldType: "richtext";
|
|
3893
|
+
};
|
|
3894
|
+
|
|
3895
|
+
/**
|
|
3896
|
+
* Configuration for a form section.
|
|
3897
|
+
* Section order is determined by declaration order in the sections object.
|
|
3898
|
+
*/
|
|
3899
|
+
export declare interface F0SectionConfig {
|
|
3900
|
+
/** Section title */
|
|
3901
|
+
title: string;
|
|
3902
|
+
/** Section description */
|
|
3903
|
+
description?: string;
|
|
3904
|
+
/** Conditional rendering for the entire section */
|
|
3905
|
+
renderIf?: SectionRenderIf;
|
|
3906
|
+
}
|
|
3907
|
+
|
|
3085
3908
|
/**
|
|
3086
3909
|
* @experimental This is an experimental component use it at your own risk
|
|
3087
3910
|
*/
|
|
@@ -3114,6 +3937,69 @@ declare type F0SelectBaseProps<T extends string, R = unknown> = {
|
|
|
3114
3937
|
asList?: boolean;
|
|
3115
3938
|
};
|
|
3116
3939
|
|
|
3940
|
+
/**
|
|
3941
|
+
* F0 config options specific to select fields
|
|
3942
|
+
*
|
|
3943
|
+
* Supports either:
|
|
3944
|
+
* - Static `options` array
|
|
3945
|
+
* - Dynamic `source` with `mapOptions` function
|
|
3946
|
+
*
|
|
3947
|
+
* @typeParam T - The value type (string or number)
|
|
3948
|
+
* @typeParam R - Record type from the data source
|
|
3949
|
+
*
|
|
3950
|
+
* Note: `clearable` is derived from the Zod schema:
|
|
3951
|
+
* - `z.string().optional()` or `z.string().nullable()` → clearable
|
|
3952
|
+
*/
|
|
3953
|
+
export declare type F0SelectConfig<T extends SelectValueType = string, R extends RecordType = RecordType> = F0SelectConfigWithOptions<T> | F0SelectConfigWithSource<T, R>;
|
|
3954
|
+
|
|
3955
|
+
/**
|
|
3956
|
+
* Base config options shared by all select field variants
|
|
3957
|
+
*/
|
|
3958
|
+
declare interface F0SelectConfigBase {
|
|
3959
|
+
/** Whether multiple selection is allowed */
|
|
3960
|
+
multiple?: boolean;
|
|
3961
|
+
/** Whether to show the search box */
|
|
3962
|
+
showSearchBox?: boolean;
|
|
3963
|
+
/** Placeholder for the search box */
|
|
3964
|
+
searchBoxPlaceholder?: string;
|
|
3965
|
+
}
|
|
3966
|
+
|
|
3967
|
+
/**
|
|
3968
|
+
* Config for select fields with static options
|
|
3969
|
+
* @typeParam T - The value type (string or number)
|
|
3970
|
+
*/
|
|
3971
|
+
declare interface F0SelectConfigWithOptions<T extends SelectValueType = string> extends F0SelectConfigBase {
|
|
3972
|
+
/** Options for the select dropdown */
|
|
3973
|
+
options: F0SelectItemProps<T, unknown>[];
|
|
3974
|
+
source?: never;
|
|
3975
|
+
mapOptions?: never;
|
|
3976
|
+
}
|
|
3977
|
+
|
|
3978
|
+
/**
|
|
3979
|
+
* Config for select fields with a data source
|
|
3980
|
+
* @typeParam T - The value type (string or number)
|
|
3981
|
+
* @typeParam R - Record type from the data source
|
|
3982
|
+
*/
|
|
3983
|
+
declare interface F0SelectConfigWithSource<T extends SelectValueType = string, R extends RecordType = RecordType> extends F0SelectConfigBase {
|
|
3984
|
+
/** Data source for fetching options dynamically */
|
|
3985
|
+
source: DataSourceDefinition<R, FiltersDefinition, SortingsDefinition, GroupingDefinition<R>>;
|
|
3986
|
+
/** Function to map data source items to select options */
|
|
3987
|
+
mapOptions: (item: R) => F0SelectItemProps<T, R>;
|
|
3988
|
+
options?: never;
|
|
3989
|
+
}
|
|
3990
|
+
|
|
3991
|
+
/**
|
|
3992
|
+
* Select field with all properties for rendering
|
|
3993
|
+
* Includes properties derived from Zod schema
|
|
3994
|
+
*/
|
|
3995
|
+
export declare type F0SelectField = F0BaseField & F0SelectConfig & {
|
|
3996
|
+
type: "select";
|
|
3997
|
+
/** Whether the select can be cleared (derived from optional/nullable) */
|
|
3998
|
+
clearable?: boolean;
|
|
3999
|
+
/** Conditional rendering based on another field's value */
|
|
4000
|
+
renderIf?: SelectFieldRenderIf;
|
|
4001
|
+
};
|
|
4002
|
+
|
|
3117
4003
|
export declare type F0SelectItemObject<T, R = unknown> = {
|
|
3118
4004
|
type?: "item";
|
|
3119
4005
|
value: T;
|
|
@@ -3208,6 +4094,53 @@ export declare type F0Source = {
|
|
|
3208
4094
|
targetBlank?: boolean;
|
|
3209
4095
|
};
|
|
3210
4096
|
|
|
4097
|
+
/**
|
|
4098
|
+
* Union of all string field configs
|
|
4099
|
+
*
|
|
4100
|
+
* @typeParam TValue - Type of the field value (for custom fields)
|
|
4101
|
+
* @typeParam TConfig - Type of the fieldConfig object (for custom fields)
|
|
4102
|
+
* @typeParam R - Record type for data source (when using source instead of options)
|
|
4103
|
+
*/
|
|
4104
|
+
export declare type F0StringConfig<TValue = string, TConfig = undefined, R extends Record<string, unknown> = Record<string, unknown>> = F0StringTextConfig | F0StringTextareaConfig | F0StringSelectConfig<R> | F0CustomFieldConfig<TValue, TConfig>;
|
|
4105
|
+
|
|
4106
|
+
/**
|
|
4107
|
+
* Config for string fields with select options
|
|
4108
|
+
* @typeParam R - Record type for data source (when using source instead of options)
|
|
4109
|
+
*/
|
|
4110
|
+
declare type F0StringSelectConfig<R extends Record<string, unknown> = Record<string, unknown>> = F0BaseConfig & F0SelectConfig<string, R> & {
|
|
4111
|
+
fieldType?: "select";
|
|
4112
|
+
};
|
|
4113
|
+
|
|
4114
|
+
/**
|
|
4115
|
+
* Config for string fields - textarea
|
|
4116
|
+
*/
|
|
4117
|
+
declare type F0StringTextareaConfig = F0BaseConfig & F0TextareaConfig & {
|
|
4118
|
+
fieldType: "textarea";
|
|
4119
|
+
};
|
|
4120
|
+
|
|
4121
|
+
/**
|
|
4122
|
+
* Config for string fields - text input (default for z.string())
|
|
4123
|
+
*/
|
|
4124
|
+
declare type F0StringTextConfig = F0BaseConfig & F0TextConfig & {
|
|
4125
|
+
fieldType?: "text";
|
|
4126
|
+
};
|
|
4127
|
+
|
|
4128
|
+
/**
|
|
4129
|
+
* F0 config options specific to switch fields
|
|
4130
|
+
* (switch has no additional options beyond base config)
|
|
4131
|
+
*/
|
|
4132
|
+
export declare interface F0SwitchConfig {
|
|
4133
|
+
}
|
|
4134
|
+
|
|
4135
|
+
/**
|
|
4136
|
+
* Switch field with all properties for rendering
|
|
4137
|
+
*/
|
|
4138
|
+
export declare type F0SwitchField = F0BaseField & {
|
|
4139
|
+
type: "switch";
|
|
4140
|
+
/** Conditional rendering based on another field's value */
|
|
4141
|
+
renderIf?: SwitchFieldRenderIf;
|
|
4142
|
+
};
|
|
4143
|
+
|
|
3211
4144
|
/**
|
|
3212
4145
|
* @experimental This is an experimental component use it at your own risk
|
|
3213
4146
|
*/
|
|
@@ -3263,6 +4196,46 @@ export declare const F0TagTeam: ForwardRefExoticComponent<TagTeamProps & RefAttr
|
|
|
3263
4196
|
|
|
3264
4197
|
export declare const F0Text: ForwardRefExoticComponent<Omit<F0TextProps, "ref"> & RefAttributes<HTMLElement>>;
|
|
3265
4198
|
|
|
4199
|
+
/**
|
|
4200
|
+
* F0 config options specific to textarea fields
|
|
4201
|
+
*
|
|
4202
|
+
* Note: `maxLength` is derived from the Zod schema:
|
|
4203
|
+
* - `z.string().max(n)` → maxLength
|
|
4204
|
+
*/
|
|
4205
|
+
export declare interface F0TextareaConfig {
|
|
4206
|
+
/** Number of rows for the textarea */
|
|
4207
|
+
rows?: number;
|
|
4208
|
+
}
|
|
4209
|
+
|
|
4210
|
+
/**
|
|
4211
|
+
* Textarea field with all properties for rendering
|
|
4212
|
+
* Includes properties derived from Zod schema
|
|
4213
|
+
*/
|
|
4214
|
+
export declare type F0TextareaField = F0BaseField & F0TextareaConfig & {
|
|
4215
|
+
type: "textarea";
|
|
4216
|
+
/** Maximum character length (derived from z.string().max()) */
|
|
4217
|
+
maxLength?: number;
|
|
4218
|
+
/** Conditional rendering based on another field's value */
|
|
4219
|
+
renderIf?: TextareaFieldRenderIf;
|
|
4220
|
+
};
|
|
4221
|
+
|
|
4222
|
+
/**
|
|
4223
|
+
* F0 config options specific to text fields
|
|
4224
|
+
*/
|
|
4225
|
+
export declare interface F0TextConfig {
|
|
4226
|
+
/** HTML input type (text, email, password, etc.) */
|
|
4227
|
+
inputType?: "text" | "email" | "password" | "tel" | "url";
|
|
4228
|
+
}
|
|
4229
|
+
|
|
4230
|
+
/**
|
|
4231
|
+
* Text field with all properties for rendering
|
|
4232
|
+
*/
|
|
4233
|
+
export declare type F0TextField = F0BaseField & F0TextConfig & {
|
|
4234
|
+
type: "text";
|
|
4235
|
+
/** Conditional rendering based on another field's value */
|
|
4236
|
+
renderIf?: TextFieldRenderIf;
|
|
4237
|
+
};
|
|
4238
|
+
|
|
3266
4239
|
export declare type F0TextProps = Omit<TextProps, "className" | "variant" | "as"> & {
|
|
3267
4240
|
variant?: (typeof _allowedVariants_2)[number];
|
|
3268
4241
|
as?: TextTags;
|
|
@@ -3301,6 +4274,21 @@ export declare type F0ThinkingProps = {
|
|
|
3301
4274
|
title?: string;
|
|
3302
4275
|
};
|
|
3303
4276
|
|
|
4277
|
+
/**
|
|
4278
|
+
* Extended Zod type with F0 metadata
|
|
4279
|
+
*/
|
|
4280
|
+
export declare interface F0ZodType<T extends ZodTypeAny = ZodTypeAny> {
|
|
4281
|
+
_f0Config?: F0FieldConfig;
|
|
4282
|
+
_innerSchema: T;
|
|
4283
|
+
}
|
|
4284
|
+
|
|
4285
|
+
/* Excluded from this release type: FieldItem */
|
|
4286
|
+
|
|
4287
|
+
/**
|
|
4288
|
+
* Field types for rendering
|
|
4289
|
+
*/
|
|
4290
|
+
export declare type FieldType = "text" | "number" | "textarea" | "select" | "checkbox" | "switch" | "date" | "daterange" | "richtext" | "custom";
|
|
4291
|
+
|
|
3304
4292
|
export declare type FileAvatarVariant = Extract<AvatarVariant, {
|
|
3305
4293
|
type: "file";
|
|
3306
4294
|
}>;
|
|
@@ -3467,6 +4455,8 @@ declare type FontSize = (typeof fontSizes)[number];
|
|
|
3467
4455
|
|
|
3468
4456
|
declare const fontSizes: readonly ["sm", "md", "lg"];
|
|
3469
4457
|
|
|
4458
|
+
/* Excluded from this release type: FormDefinitionItem */
|
|
4459
|
+
|
|
3470
4460
|
export declare const FullscreenChatContext: Context<FullscreenChatContextType>;
|
|
3471
4461
|
|
|
3472
4462
|
/**
|
|
@@ -3477,6 +4467,12 @@ declare type FullscreenChatContextType = {
|
|
|
3477
4467
|
setInProgress: (value: boolean) => void;
|
|
3478
4468
|
};
|
|
3479
4469
|
|
|
4470
|
+
/**
|
|
4471
|
+
* Generates an anchor ID for a form element
|
|
4472
|
+
* Format: forms.[formName].[sectionId].[fieldId]
|
|
4473
|
+
*/
|
|
4474
|
+
export declare function generateAnchorId(formName: string, sectionId?: string, fieldId?: string): string;
|
|
4475
|
+
|
|
3480
4476
|
export declare const getAnimationVariants: (options?: AnimationVariantsOptions) => {
|
|
3481
4477
|
hidden: {
|
|
3482
4478
|
opacity: number;
|
|
@@ -3506,6 +4502,21 @@ export declare const getDataSourcePaginationType: <D extends {
|
|
|
3506
4502
|
|
|
3507
4503
|
export declare function getEmojiLabel(emoji: string): string;
|
|
3508
4504
|
|
|
4505
|
+
/**
|
|
4506
|
+
* Get F0 config from a schema
|
|
4507
|
+
*/
|
|
4508
|
+
export declare function getF0Config(schema: ZodTypeAny): F0FieldConfig | undefined;
|
|
4509
|
+
|
|
4510
|
+
/**
|
|
4511
|
+
* Non-hook version for extracting definition outside of React components.
|
|
4512
|
+
* Useful for server-side rendering or testing.
|
|
4513
|
+
*
|
|
4514
|
+
* @param schema - Zod object schema with F0 field configurations
|
|
4515
|
+
* @param sections - Optional section configurations keyed by section ID
|
|
4516
|
+
* @returns Array of form definition items
|
|
4517
|
+
*/
|
|
4518
|
+
export declare function getSchemaDefinition(schema: z.ZodObject<ZodRawShape>, sections?: Record<string, F0SectionConfig>): FormDefinitionItem[];
|
|
4519
|
+
|
|
3509
4520
|
declare interface GranularityDefinition {
|
|
3510
4521
|
calendarMode?: CalendarMode;
|
|
3511
4522
|
calendarView: CalendarView;
|
|
@@ -3654,10 +4665,17 @@ export declare function H2({ children, ...props }: React.HTMLAttributes<HTMLHead
|
|
|
3654
4665
|
|
|
3655
4666
|
export declare function H3({ children, ...props }: React.HTMLAttributes<HTMLHeadingElement>): JSX_2.Element;
|
|
3656
4667
|
|
|
4668
|
+
/**
|
|
4669
|
+
* Check if a schema has F0 config
|
|
4670
|
+
*/
|
|
4671
|
+
export declare function hasF0Config(schema: ZodTypeAny): boolean;
|
|
4672
|
+
|
|
3657
4673
|
declare type HeadingTags = (typeof headingTags)[number];
|
|
3658
4674
|
|
|
3659
4675
|
declare const headingTags: readonly ["h1", "h2", "h3", "h4", "h5", "h6"];
|
|
3660
4676
|
|
|
4677
|
+
declare type heightType = "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "full" | "auto";
|
|
4678
|
+
|
|
3661
4679
|
export declare const HomeLayout: ForwardRefExoticComponent<Omit<{
|
|
3662
4680
|
widgets?: ReactNode[];
|
|
3663
4681
|
children?: ReactNode;
|
|
@@ -3713,6 +4731,16 @@ declare type ImageContextValue = {
|
|
|
3713
4731
|
|
|
3714
4732
|
declare type ImageProps = ImgHTMLAttributes<HTMLImageElement>;
|
|
3715
4733
|
|
|
4734
|
+
/**
|
|
4735
|
+
* Extract the inferred type from an F0 form schema
|
|
4736
|
+
*/
|
|
4737
|
+
export declare type InferF0FormValues<T extends z.ZodObject<z.ZodRawShape>> = z.infer<T>;
|
|
4738
|
+
|
|
4739
|
+
/**
|
|
4740
|
+
* Infer field type from Zod schema when not explicitly specified
|
|
4741
|
+
*/
|
|
4742
|
+
export declare function inferFieldType(schema: ZodTypeAny, config: F0FieldConfig): F0FieldType;
|
|
4743
|
+
|
|
3716
4744
|
export declare type InFilterDefinition<T = string | number, R extends RecordType = RecordType> = BaseFilterDefinition<"in"> & {
|
|
3717
4745
|
options: InFilterOptions_2<T, R>;
|
|
3718
4746
|
};
|
|
@@ -3782,7 +4810,7 @@ declare const INPUTFIELD_SIZES: readonly ["sm", "md"];
|
|
|
3782
4810
|
|
|
3783
4811
|
declare type InputFieldInheritedProps = (typeof inputFieldInheritedProps)[number];
|
|
3784
4812
|
|
|
3785
|
-
declare const inputFieldInheritedProps: readonly ["label", "placeholder", "hideLabel", "size", "error", "disabled", "readonly", "required", "clearable", "labelIcon", "status", "hint"];
|
|
4813
|
+
declare const inputFieldInheritedProps: readonly ["label", "placeholder", "hideLabel", "size", "error", "disabled", "readonly", "required", "clearable", "labelIcon", "status", "hint", "loading"];
|
|
3786
4814
|
|
|
3787
4815
|
declare type InputFieldProps<T> = {
|
|
3788
4816
|
autoFocus?: boolean;
|
|
@@ -3885,6 +4913,12 @@ export declare function isInfiniteScrollPagination<R extends RecordType>(paginat
|
|
|
3885
4913
|
|
|
3886
4914
|
export declare function isPageBasedPagination<R extends RecordType>(pagination: PaginationInfo | null): pagination is PageBasedPaginatedResponse<R>;
|
|
3887
4915
|
|
|
4916
|
+
/**
|
|
4917
|
+
* Check if a schema is of a specific Zod type using _def.typeName
|
|
4918
|
+
* This is more reliable than instanceof across module boundaries
|
|
4919
|
+
*/
|
|
4920
|
+
export declare function isZodType(schema: ZodTypeAny, typeName: ZodTypeName): boolean;
|
|
4921
|
+
|
|
3888
4922
|
declare type ItemActionsDefinition<T extends RecordType> = (item: T) => ActionDefinition[] | undefined;
|
|
3889
4923
|
|
|
3890
4924
|
declare type ItemDefinition = {
|
|
@@ -4018,6 +5052,18 @@ export declare interface LoadingStateProps {
|
|
|
4018
5052
|
|
|
4019
5053
|
declare const MAX_EXPANDED_ACTIONS = 2;
|
|
4020
5054
|
|
|
5055
|
+
declare type MentionedUser = {
|
|
5056
|
+
id: number;
|
|
5057
|
+
label: string;
|
|
5058
|
+
image_url?: string;
|
|
5059
|
+
href?: string;
|
|
5060
|
+
};
|
|
5061
|
+
|
|
5062
|
+
declare type MentionsConfig = {
|
|
5063
|
+
onMentionQueryStringChanged?: (queryString: string) => Promise<MentionedUser[]> | undefined;
|
|
5064
|
+
users: MentionedUser[];
|
|
5065
|
+
};
|
|
5066
|
+
|
|
4021
5067
|
declare const moduleAvatarVariants: (props?: ({
|
|
4022
5068
|
size?: "lg" | "md" | "sm" | "xs" | "xxs" | undefined;
|
|
4023
5069
|
} & ({
|
|
@@ -4162,6 +5208,11 @@ export declare interface NextStepsProps {
|
|
|
4162
5208
|
items: StepItemProps[];
|
|
4163
5209
|
}
|
|
4164
5210
|
|
|
5211
|
+
/**
|
|
5212
|
+
* All valid renderIf conditions for number fields
|
|
5213
|
+
*/
|
|
5214
|
+
declare type NumberFieldRenderIf = NumberRenderIfCondition | CommonRenderIfCondition;
|
|
5215
|
+
|
|
4165
5216
|
export declare type NumberFilterDefinition = BaseFilterDefinition<"number"> & {
|
|
4166
5217
|
options?: NumberFilterOptions_2;
|
|
4167
5218
|
};
|
|
@@ -4188,6 +5239,32 @@ declare type NumberFilterValue = {
|
|
|
4188
5239
|
};
|
|
4189
5240
|
} | undefined;
|
|
4190
5241
|
|
|
5242
|
+
/**
|
|
5243
|
+
* Base for number-specific conditions
|
|
5244
|
+
*/
|
|
5245
|
+
declare interface NumberRenderIfBase {
|
|
5246
|
+
fieldId: string;
|
|
5247
|
+
}
|
|
5248
|
+
|
|
5249
|
+
/**
|
|
5250
|
+
* RenderIf conditions specific to number fields
|
|
5251
|
+
*/
|
|
5252
|
+
export declare type NumberRenderIfCondition = NumberRenderIfBase & ({
|
|
5253
|
+
equalsTo: number;
|
|
5254
|
+
} | {
|
|
5255
|
+
notEqualsTo: number;
|
|
5256
|
+
} | {
|
|
5257
|
+
greaterThan: number;
|
|
5258
|
+
} | {
|
|
5259
|
+
greaterThanOrEqual: number;
|
|
5260
|
+
} | {
|
|
5261
|
+
lowerThan: number;
|
|
5262
|
+
} | {
|
|
5263
|
+
lowerThanOrEqual: number;
|
|
5264
|
+
} | {
|
|
5265
|
+
isEmpty: boolean;
|
|
5266
|
+
});
|
|
5267
|
+
|
|
4191
5268
|
export declare type NumberWithFormatter = NumericWithFormatter & {
|
|
4192
5269
|
animated?: boolean;
|
|
4193
5270
|
};
|
|
@@ -4748,8 +5825,38 @@ declare type RelaxedNumericWithFormatter = Omit<NumericWithFormatter, "numericVa
|
|
|
4748
5825
|
|
|
4749
5826
|
declare type RendererDefinition = ValueDisplayRendererDefinition;
|
|
4750
5827
|
|
|
5828
|
+
/**
|
|
5829
|
+
* Base condition that all renderIf conditions must have
|
|
5830
|
+
*/
|
|
5831
|
+
declare interface RenderIfBase {
|
|
5832
|
+
/** ID of the field to check the condition against */
|
|
5833
|
+
fieldId: string;
|
|
5834
|
+
}
|
|
5835
|
+
|
|
5836
|
+
/**
|
|
5837
|
+
* Union of all possible RenderIf conditions (used internally for evaluation)
|
|
5838
|
+
*/
|
|
5839
|
+
export declare type RenderIfCondition = CommonRenderIfCondition | TextRenderIfCondition | NumberRenderIfCondition | BooleanRenderIfCondition | SelectRenderIfCondition | DateRenderIfCondition | DateRangeRenderIfCondition;
|
|
5840
|
+
|
|
4751
5841
|
export declare type ResolvedRecordType<R> = R extends RecordType ? R : RecordType;
|
|
4752
5842
|
|
|
5843
|
+
/**
|
|
5844
|
+
* All valid renderIf conditions for richtext fields
|
|
5845
|
+
*/
|
|
5846
|
+
declare type RichTextFieldRenderIf = CommonRenderIfCondition;
|
|
5847
|
+
|
|
5848
|
+
/**
|
|
5849
|
+
* Rich text editor result value type
|
|
5850
|
+
*/
|
|
5851
|
+
export declare interface RichTextValue {
|
|
5852
|
+
/** HTML content of the editor */
|
|
5853
|
+
value: string | null;
|
|
5854
|
+
/** IDs of mentioned users */
|
|
5855
|
+
mentionIds?: number[];
|
|
5856
|
+
}
|
|
5857
|
+
|
|
5858
|
+
/* Excluded from this release type: RowDefinition */
|
|
5859
|
+
|
|
4753
5860
|
export declare type SearchFilterDefinition = BaseFilterDefinition<"search">;
|
|
4754
5861
|
|
|
4755
5862
|
declare type SearchOptions = {
|
|
@@ -4785,6 +5892,13 @@ declare type SecondaryActionsDefinition = {
|
|
|
4785
5892
|
|
|
4786
5893
|
declare type SecondaryActionsItems = SecondaryActionItem[] | SecondaryActionItem[][] | SecondaryActionGroup[];
|
|
4787
5894
|
|
|
5895
|
+
/* Excluded from this release type: SectionDefinition */
|
|
5896
|
+
|
|
5897
|
+
/**
|
|
5898
|
+
* Conditional rendering for sections - can be a condition object or a function
|
|
5899
|
+
*/
|
|
5900
|
+
export declare type SectionRenderIf = RenderIfCondition | ((values: Record<string, unknown>) => boolean);
|
|
5901
|
+
|
|
4788
5902
|
/**
|
|
4789
5903
|
* Represents a collection of selected items.
|
|
4790
5904
|
* @template T - The type of items in the collection
|
|
@@ -4823,6 +5937,11 @@ export declare type SelectedState = {
|
|
|
4823
5937
|
checked: boolean;
|
|
4824
5938
|
};
|
|
4825
5939
|
|
|
5940
|
+
/**
|
|
5941
|
+
* All valid renderIf conditions for select fields
|
|
5942
|
+
*/
|
|
5943
|
+
declare type SelectFieldRenderIf = SelectRenderIfCondition | CommonRenderIfCondition;
|
|
5944
|
+
|
|
4826
5945
|
export declare type SelectionId = number | string;
|
|
4827
5946
|
|
|
4828
5947
|
export declare type SelectionMeta<R extends RecordType> = {
|
|
@@ -4849,8 +5968,35 @@ export declare type SelectionStatus<R extends RecordType, Filters extends Filter
|
|
|
4849
5968
|
totalKnownItemsCount: number;
|
|
4850
5969
|
};
|
|
4851
5970
|
|
|
5971
|
+
/**
|
|
5972
|
+
* Base for select-specific conditions
|
|
5973
|
+
*/
|
|
5974
|
+
declare interface SelectRenderIfBase {
|
|
5975
|
+
fieldId: string;
|
|
5976
|
+
}
|
|
5977
|
+
|
|
5978
|
+
/**
|
|
5979
|
+
* RenderIf conditions specific to select fields
|
|
5980
|
+
*/
|
|
5981
|
+
export declare type SelectRenderIfCondition = SelectRenderIfBase & ({
|
|
5982
|
+
equalsTo: string;
|
|
5983
|
+
} | {
|
|
5984
|
+
notEqualsTo: string;
|
|
5985
|
+
} | {
|
|
5986
|
+
includes: string;
|
|
5987
|
+
} | {
|
|
5988
|
+
notIncludes: string;
|
|
5989
|
+
} | {
|
|
5990
|
+
isEmpty: boolean;
|
|
5991
|
+
});
|
|
5992
|
+
|
|
4852
5993
|
export declare const selectSizes: readonly ["sm", "md"];
|
|
4853
5994
|
|
|
5995
|
+
/**
|
|
5996
|
+
* Value types supported by select fields
|
|
5997
|
+
*/
|
|
5998
|
+
declare type SelectValueType = string | number;
|
|
5999
|
+
|
|
4854
6000
|
/**
|
|
4855
6001
|
* Response structure for non-paginated data
|
|
4856
6002
|
*/
|
|
@@ -4921,6 +6067,11 @@ declare type SummaryKey<Definition extends SummariesDefinition> = Definition ext
|
|
|
4921
6067
|
|
|
4922
6068
|
declare type SummaryType = "sum";
|
|
4923
6069
|
|
|
6070
|
+
/**
|
|
6071
|
+
* All valid renderIf conditions for switch fields
|
|
6072
|
+
*/
|
|
6073
|
+
declare type SwitchFieldRenderIf = BooleanRenderIfCondition | CommonRenderIfCondition;
|
|
6074
|
+
|
|
4924
6075
|
export declare function Table({ children, ...props }: React.HTMLAttributes<HTMLTableElement>): JSX_2.Element;
|
|
4925
6076
|
|
|
4926
6077
|
declare type TableCollectionProps<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, TableVisualizationOptions<R, Filters, Sortings, Summaries>>;
|
|
@@ -5190,6 +6341,16 @@ export declare type TeamAvatarVariant = Extract<AvatarVariant, {
|
|
|
5190
6341
|
|
|
5191
6342
|
declare type TeamTagProps = ComponentProps<typeof F0TagTeam>;
|
|
5192
6343
|
|
|
6344
|
+
/**
|
|
6345
|
+
* All valid renderIf conditions for textarea fields
|
|
6346
|
+
*/
|
|
6347
|
+
declare type TextareaFieldRenderIf = TextRenderIfCondition | CommonRenderIfCondition;
|
|
6348
|
+
|
|
6349
|
+
/**
|
|
6350
|
+
* All valid renderIf conditions for text fields
|
|
6351
|
+
*/
|
|
6352
|
+
declare type TextFieldRenderIf = TextRenderIfCondition | CommonRenderIfCondition;
|
|
6353
|
+
|
|
5193
6354
|
declare interface TextProps extends Omit<default_2.HTMLAttributes<HTMLElement>, "className">, default_2.RefAttributes<HTMLElement> {
|
|
5194
6355
|
/**
|
|
5195
6356
|
* Content to be rendered
|
|
@@ -5235,6 +6396,26 @@ declare interface TextProps extends Omit<default_2.HTMLAttributes<HTMLElement>,
|
|
|
5235
6396
|
markdown?: boolean;
|
|
5236
6397
|
}
|
|
5237
6398
|
|
|
6399
|
+
/**
|
|
6400
|
+
* Base for text-specific conditions
|
|
6401
|
+
*/
|
|
6402
|
+
declare interface TextRenderIfBase {
|
|
6403
|
+
fieldId: string;
|
|
6404
|
+
}
|
|
6405
|
+
|
|
6406
|
+
/**
|
|
6407
|
+
* RenderIf conditions specific to text fields
|
|
6408
|
+
*/
|
|
6409
|
+
export declare type TextRenderIfCondition = TextRenderIfBase & ({
|
|
6410
|
+
equalsTo: string;
|
|
6411
|
+
} | {
|
|
6412
|
+
notEqualsTo: string;
|
|
6413
|
+
} | {
|
|
6414
|
+
matches: RegExp;
|
|
6415
|
+
} | {
|
|
6416
|
+
isEmpty: boolean;
|
|
6417
|
+
});
|
|
6418
|
+
|
|
5238
6419
|
declare type TextTags = (typeof textTags)[number];
|
|
5239
6420
|
|
|
5240
6421
|
declare const textTags: readonly ["p", "span", "div", "label", "code"];
|
|
@@ -5315,6 +6496,12 @@ export declare interface TwoColumnLayoutProps {
|
|
|
5315
6496
|
|
|
5316
6497
|
export declare function Ul({ children, ...props }: React.HTMLAttributes<HTMLUListElement>): JSX_2.Element;
|
|
5317
6498
|
|
|
6499
|
+
/**
|
|
6500
|
+
* Unwrap optional, nullable, default wrappers to get the inner schema
|
|
6501
|
+
* Uses _def.typeName for reliable type checking across module boundaries
|
|
6502
|
+
*/
|
|
6503
|
+
export declare function unwrapZodSchema(schema: ZodTypeAny): ZodTypeAny;
|
|
6504
|
+
|
|
5318
6505
|
declare type UpsellAction = BaseAction & {
|
|
5319
6506
|
type: "upsell";
|
|
5320
6507
|
variant: "promote" | "outlinePromote";
|
|
@@ -5631,6 +6818,39 @@ export declare const usePrivacyMode: () => {
|
|
|
5631
6818
|
|
|
5632
6819
|
export declare const useReducedMotion: () => boolean;
|
|
5633
6820
|
|
|
6821
|
+
/**
|
|
6822
|
+
* Hook to convert a Zod schema with F0 configurations into a FormDefinitionItem array.
|
|
6823
|
+
*
|
|
6824
|
+
* This parses the schema shape, extracts F0 configs, groups fields by section,
|
|
6825
|
+
* sorts by position, and groups row fields together.
|
|
6826
|
+
*
|
|
6827
|
+
* Automatic derivations from the Zod schema:
|
|
6828
|
+
* - **Position**: Derived from field declaration order (can be overridden with `position`)
|
|
6829
|
+
* - **Number min/max**: `z.number().min(n).max(m)` → min/max constraints
|
|
6830
|
+
* - **Date min/max**: `z.date().min(d).max(d)` → minDate/maxDate constraints
|
|
6831
|
+
* - **String maxLength**: `z.string().max(n)` → maxLength for textarea
|
|
6832
|
+
* - **Clearable**: `z.optional()` or `z.nullable()` → clearable for select/date fields
|
|
6833
|
+
*
|
|
6834
|
+
* @param schema - Zod object schema with F0 field configurations
|
|
6835
|
+
* @param sections - Optional section configurations keyed by section ID
|
|
6836
|
+
* @returns Array of form definition items compatible with existing renderers
|
|
6837
|
+
*
|
|
6838
|
+
* @example
|
|
6839
|
+
* ```tsx
|
|
6840
|
+
* const formSchema = z.object({
|
|
6841
|
+
* // Fields are ordered by declaration - no need to specify position
|
|
6842
|
+
* firstName: f0FormField(z.string().min(1), { label: "First Name" }),
|
|
6843
|
+
* lastName: f0FormField(z.string().min(1), { label: "Last Name" }),
|
|
6844
|
+
* // Constraints derived from Zod, clearable because optional
|
|
6845
|
+
* birthDate: f0FormField(z.date().min(new Date("1900-01-01")).optional(), {
|
|
6846
|
+
* label: "Birth Date"
|
|
6847
|
+
* }),
|
|
6848
|
+
* age: f0FormField(z.number().min(0).max(120), { label: "Age" })
|
|
6849
|
+
* })
|
|
6850
|
+
* ```
|
|
6851
|
+
*/
|
|
6852
|
+
export declare function useSchemaDefinition(schema: z.ZodObject<ZodRawShape>, sections?: Record<string, F0SectionConfig>): FormDefinitionItem[];
|
|
6853
|
+
|
|
5634
6854
|
/**
|
|
5635
6855
|
* Custom hook to manage selection state for items and groups in a data table
|
|
5636
6856
|
* Supports single/multi selection, grouped data, pagination, and filtering
|
|
@@ -5815,6 +7035,12 @@ declare interface WithTooltipDescription {
|
|
|
5815
7035
|
description?: string;
|
|
5816
7036
|
}
|
|
5817
7037
|
|
|
7038
|
+
/**
|
|
7039
|
+
* Zod type names for type checking without instanceof
|
|
7040
|
+
* Using _def.typeName is more reliable across module boundaries than instanceof
|
|
7041
|
+
*/
|
|
7042
|
+
declare type ZodTypeName = "ZodString" | "ZodNumber" | "ZodBoolean" | "ZodDate" | "ZodEnum" | "ZodArray" | "ZodObject" | "ZodOptional" | "ZodNullable" | "ZodDefault" | "ZodLiteral";
|
|
7043
|
+
|
|
5818
7044
|
export { }
|
|
5819
7045
|
|
|
5820
7046
|
|
|
@@ -5855,11 +7081,6 @@ declare module "gridstack" {
|
|
|
5855
7081
|
}
|
|
5856
7082
|
|
|
5857
7083
|
|
|
5858
|
-
declare namespace Calendar {
|
|
5859
|
-
var displayName: string;
|
|
5860
|
-
}
|
|
5861
|
-
|
|
5862
|
-
|
|
5863
7084
|
declare module "@tiptap/core" {
|
|
5864
7085
|
interface Commands<ReturnType> {
|
|
5865
7086
|
aiBlock: {
|
|
@@ -5896,3 +7117,8 @@ declare module "@tiptap/core" {
|
|
|
5896
7117
|
};
|
|
5897
7118
|
}
|
|
5898
7119
|
}
|
|
7120
|
+
|
|
7121
|
+
|
|
7122
|
+
declare namespace Calendar {
|
|
7123
|
+
var displayName: string;
|
|
7124
|
+
}
|