@lax-wp/design-system 0.3.45 → 0.3.47

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,4 +1,3 @@
1
- import { type ReactNode } from "react";
2
1
  import type { LabelType } from "../../data-display/label/Label";
3
2
  /**
4
3
  * Risk details interface for risk analysis integration
@@ -11,10 +10,10 @@ export interface RiskDetails {
11
10
  [key: string]: any;
12
11
  }
13
12
  /**
14
- * Risk details card component props
13
+ * Risk details card component props - generic to allow consumer-specific risk types
15
14
  */
16
15
  export interface RiskDetailsCardProps<T = any> {
17
- riskDetails: RiskDetails;
16
+ riskDetails: T;
18
17
  maxWidth?: string;
19
18
  showAllRisksSuggestions?: boolean;
20
19
  }
@@ -91,8 +90,6 @@ export interface CurrencyInputFieldProps {
91
90
  RiskDetailsCard?: React.ComponentType<RiskDetailsCardProps<any>>;
92
91
  /** Translation function */
93
92
  t?: (key: string) => string;
94
- /** Function to get flag component for currency */
95
- getFlagComponent?: (currencyCode: string) => ReactNode;
96
93
  }
97
94
  /**
98
95
  * A highly customizable currency input component with label, validation, and styling support.
@@ -10,10 +10,10 @@ export interface RiskDetails {
10
10
  [key: string]: any;
11
11
  }
12
12
  /**
13
- * Risk details card component props
13
+ * Risk details card component props - generic to allow consumer-specific risk types
14
14
  */
15
15
  export interface RiskDetailsCardProps<T = any> {
16
- riskDetails: RiskDetails;
16
+ riskDetails: T;
17
17
  maxWidth?: string;
18
18
  showAllRisksSuggestions?: boolean;
19
19
  }
@@ -0,0 +1,137 @@
1
+ import type { LabelType } from "../../data-display/label/Label";
2
+ /**
3
+ * Risk details interface for risk analysis integration
4
+ */
5
+ export interface RiskDetails {
6
+ color?: string;
7
+ description?: string;
8
+ hexBgColor?: string;
9
+ hexBorderColor?: string;
10
+ [key: string]: any;
11
+ }
12
+ /**
13
+ * Risk details card component props - generic to allow consumer-specific risk types
14
+ */
15
+ export interface RiskDetailsCardProps<T = any> {
16
+ riskDetails: T;
17
+ maxWidth?: string;
18
+ showAllRisksSuggestions?: boolean;
19
+ }
20
+ /**
21
+ * Props for the MasterDataModal component
22
+ */
23
+ export interface MasterDataModalProps {
24
+ isVisible: boolean;
25
+ onSelected: (masterDataValue: any, masterDataRow?: any) => void;
26
+ onClose: () => void;
27
+ masterDataColumnName: string;
28
+ masterDataFilters?: any;
29
+ masterDataName: string;
30
+ masterDataId: string;
31
+ showFilters?: boolean;
32
+ }
33
+ /**
34
+ * Props for the MasterDataInputField component
35
+ */
36
+ export interface MasterDataInputFieldProps {
37
+ /** Unique identifier for the input */
38
+ id: string;
39
+ /** Label text to display above the input */
40
+ label: string;
41
+ /** Placeholder text for the input */
42
+ placeholder?: string;
43
+ /** Current value of the input */
44
+ value: any;
45
+ /** Callback function called when value changes */
46
+ onChange: (value: any, masterDataRowValue?: any) => void;
47
+ /** Error message to display below the input */
48
+ errorMessage?: string;
49
+ /** Callback to set error message */
50
+ setErrorMessage: (message: string) => void;
51
+ /** Callback to remove error message */
52
+ removeErrorMessage: () => void;
53
+ /** Default value for the input */
54
+ defaultValue?: any;
55
+ /** Whether the field is required */
56
+ required?: boolean;
57
+ /** Whether the required indicator shows as conditional (yellow instead of red) */
58
+ isRequiredConditional?: boolean;
59
+ /** Name of the master data source */
60
+ masterDataName: string;
61
+ /** Column name in the master data */
62
+ masterDataColumnName: string;
63
+ /** Formula for computing master data value */
64
+ masterDataFormula?: string;
65
+ /** Filters for master data */
66
+ masterDataFilters?: any;
67
+ /** Tags/labels to display next to the label */
68
+ tags?: (string | LabelType)[];
69
+ /** Index for array fields */
70
+ index?: number;
71
+ /** Tooltip text for the help icon */
72
+ tooltip?: string;
73
+ /** Whether to preserve original case in the label */
74
+ originalCase?: boolean;
75
+ /** Color for the input text */
76
+ color?: string;
77
+ /** Whether this is a GTN (Global Term Name) field */
78
+ isGTN?: boolean;
79
+ /** GTN field name for document integration */
80
+ gtnName?: any;
81
+ /** Whether the value was AI extracted */
82
+ isAiExtracted?: boolean;
83
+ /** Reference data for formula computation */
84
+ reference?: any;
85
+ /** Whether the input is disabled */
86
+ disabled?: boolean;
87
+ /** Additional CSS classes for the label */
88
+ labelClassName?: string;
89
+ /** Whether this is a live field */
90
+ isLiveField?: boolean;
91
+ /** Callback function called when input loses focus */
92
+ onBlur?: () => void;
93
+ /** Handler for adding GTN to document */
94
+ onAddGTNToDocument?: (keyValuePair: {
95
+ key: string;
96
+ value: string;
97
+ }) => void;
98
+ /** Risk details data */
99
+ riskDetails?: RiskDetails;
100
+ /** Whether risk analysis is open */
101
+ isRiskAnalysisOpen?: boolean;
102
+ /** Custom risk details card component */
103
+ RiskDetailsCard?: React.ComponentType<RiskDetailsCardProps<any>>;
104
+ /** Primary color shades for styling */
105
+ primaryColorShades?: Record<number, string>;
106
+ /** Translation function */
107
+ t?: (key: string) => string;
108
+ /** Callback to set disable actions state */
109
+ setDisableActions?: (disabled: boolean) => void;
110
+ /** Toast function for deprecated field warning */
111
+ showDeprecatedFieldWarning?: () => void;
112
+ /** Master data modal component */
113
+ MasterDataModal?: React.ComponentType<MasterDataModalProps>;
114
+ /** Function to parse master data formula */
115
+ parseMasterDataFormula?: (formula: string, row: any) => string;
116
+ }
117
+ /**
118
+ * A highly customizable master data input component with label, validation, and styling support.
119
+ * Features master data modal integration, GTN support, risk analysis support,
120
+ * and comprehensive prop support for various use cases.
121
+ *
122
+ * @example
123
+ * ```tsx
124
+ * <MasterDataInputField
125
+ * id="master-field"
126
+ * label="Master Field"
127
+ * value={fieldValue}
128
+ * onChange={(value, rowValue) => setFieldValue(value)}
129
+ * setErrorMessage={(msg) => setError(msg)}
130
+ * removeErrorMessage={() => setError('')}
131
+ * masterDataName="customers"
132
+ * masterDataColumnName="name"
133
+ * required
134
+ * />
135
+ * ```
136
+ */
137
+ export declare const MasterDataInputField: import("react").ForwardRefExoticComponent<MasterDataInputFieldProps & import("react").RefAttributes<HTMLInputElement>>;
@@ -10,10 +10,10 @@ export interface RiskDetails {
10
10
  [key: string]: any;
11
11
  }
12
12
  /**
13
- * Risk details card component props
13
+ * Risk details card component props - generic to allow consumer-specific risk types
14
14
  */
15
15
  export interface RiskDetailsCardProps<T = any> {
16
- riskDetails: RiskDetails;
16
+ riskDetails: T;
17
17
  maxWidth?: string;
18
18
  showAllRisksSuggestions?: boolean;
19
19
  }
package/dist/index.d.ts CHANGED
@@ -7,6 +7,8 @@ export { TextField } from "./components/forms/text-field/TextField";
7
7
  export type { TextFieldProps } from "./components/forms/text-field/TextField";
8
8
  export { TextAreaField } from "./components/forms/text-area-field/TextAreaField";
9
9
  export type { TextAreaFieldProps, RiskDetails as TextAreaFieldRiskDetails, RiskDetailsCardProps as TextAreaFieldRiskDetailsCardProps, } from "./components/forms/text-area-field/TextAreaField";
10
+ export { MasterDataInputField } from "./components/forms/master-data-input/MasterDataInputField";
11
+ export type { MasterDataInputFieldProps, RiskDetails as MasterDataInputFieldRiskDetails, RiskDetailsCardProps as MasterDataInputFieldRiskDetailsCardProps, } from "./components/forms/master-data-input/MasterDataInputField";
10
12
  export { SelectField } from "./components/forms/select-field/SelectField";
11
13
  export type { SelectFieldProps, SelectOption as SelectFieldOption, TLabelValue, } from "./components/forms/select-field/SelectField";
12
14
  export { Checkbox } from "./components/forms/checkbox/Checkbox";