finform-react-builder 1.14.0 → 1.15.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.
@@ -1,12 +1,36 @@
1
1
  import { default as React } from 'react';
2
- import { TextFieldProps } from '@mui/material';
3
- export type FinDateFieldProps = TextFieldProps & {
2
+ export declare const DEFAULT_DATE_FORMAT = "DD-MM-YYYY";
3
+ /** Map dayjs format tokens to a human placeholder (DD/MM/YYYY, etc.). */
4
+ export declare function dateFormatToPlaceholder(format: string): string;
5
+ export type FinDateFieldProps = {
6
+ value?: string | null;
7
+ onChange?: (value: string) => void;
8
+ onBlur?: () => void;
9
+ name?: string;
10
+ /** Dayjs format for typed input + display (e.g. DD-MM-YYYY). */
11
+ dateFormat?: string;
12
+ minDate?: string;
13
+ maxDate?: string;
4
14
  label?: React.ReactNode;
5
15
  labelPosition?: 'inner' | 'top' | 'none';
6
16
  labelVariant?: 'caption' | 'body2' | 'subtitle2' | 'h6';
17
+ disabled?: boolean;
18
+ error?: boolean;
19
+ helperText?: React.ReactNode;
20
+ fullWidth?: boolean;
21
+ size?: 'small' | 'medium';
22
+ placeholder?: string;
23
+ sx?: any;
7
24
  inputTestId?: string;
8
25
  labelTestId?: string;
9
26
  errorTestId?: string;
10
- [key: string]: any;
27
+ /** @deprecated Use minDate / maxDate props. Kept for FieldRenderer backward compat. */
28
+ inputProps?: {
29
+ min?: string;
30
+ max?: string;
31
+ [key: string]: unknown;
32
+ };
33
+ id?: string;
34
+ required?: boolean;
11
35
  };
12
36
  export declare const FinDateField: React.FC<FinDateFieldProps>;
@@ -45,6 +45,8 @@ export type GridColumn = {
45
45
  };
46
46
  sx?: any;
47
47
  cellSx?: any;
48
+ /** Per-column dayjs format override for date columns. */
49
+ dateFormat?: string;
48
50
  };
49
51
  export interface FinEditableGridProps {
50
52
  name: string;
@@ -68,6 +70,8 @@ export interface FinEditableGridProps {
68
70
  setValue?: (name: string, value: any, options?: any) => void;
69
71
  rowSelectionMode?: "single" | "multi";
70
72
  rowSelectionKey?: string;
73
+ /** Form-level dayjs date format for date columns. */
74
+ dateFormat?: string;
71
75
  }
72
76
  export declare const FinEditableGrid: React.FC<FinEditableGridProps>;
73
77
  export default FinEditableGrid;
@@ -153,6 +153,8 @@ export interface DateField extends BaseField {
153
153
  type: 'date';
154
154
  minDate?: string;
155
155
  maxDate?: string;
156
+ /** Per-field dayjs format override (e.g. DD-MM-YYYY). Falls back to FinForm dateFormat. */
157
+ dateFormat?: string;
156
158
  }
157
159
  export interface ImageField extends BaseField {
158
160
  type: 'image';
@@ -422,6 +424,11 @@ export interface FinFormProps {
422
424
  };
423
425
  /** Prefix for stable data-testid attributes on generated form controls (e.g. "client-profile"). */
424
426
  testIdPrefix?: string;
427
+ /**
428
+ * Dayjs format for all date fields (e.g. DD-MM-YYYY, MM-DD-YYYY, YYYY-MM-DD).
429
+ * Host app should map company regional settings to this value.
430
+ */
431
+ dateFormat?: string;
425
432
  }
426
433
  export interface FieldRendererProps {
427
434
  field: FieldConfig;
@@ -432,6 +439,8 @@ export interface FieldRendererProps {
432
439
  formData?: Record<string, any>;
433
440
  setValue?: (name: string, value: any, options?: any) => void;
434
441
  testIdPrefix?: string;
442
+ /** Form-level dayjs date format inherited by date fields. */
443
+ dateFormat?: string;
435
444
  }
436
445
  export interface FinInputTestIdProps {
437
446
  inputTestId?: string;