@lax-wp/design-system 0.3.42 → 0.3.43
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/components/button/IconButton.d.ts +14 -0
- package/dist/components/forms/currency-input/CurrencyInputField.d.ts +81 -39
- package/dist/components/forms/currency-input/currency.constant.d.ts +3 -2
- package/dist/components/forms/date-time-field/DateTimeField.d.ts +131 -0
- package/dist/components/forms/dynamic-data-input/DynamicDataInputField.d.ts +120 -0
- package/dist/components/forms/percentage-input/PercentageInputField.d.ts +76 -44
- package/dist/index.d.ts +6 -2
- package/dist/index.es.js +31162 -29613
- package/dist/index.umd.js +56 -52
- package/package.json +1 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React, { type ReactNode } from 'react';
|
|
2
|
+
interface IconButtonProps {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
className?: string;
|
|
5
|
+
onClick?(event: React.MouseEvent<HTMLButtonElement>): void;
|
|
6
|
+
variant?: 'default' | 'secondary' | 'native' | 'ghost';
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
tooltip?: string;
|
|
9
|
+
tooltipPlacement?: 'top' | 'bottom' | 'left' | 'right';
|
|
10
|
+
noborder?: boolean;
|
|
11
|
+
id?: string;
|
|
12
|
+
}
|
|
13
|
+
declare const IconButton: React.FC<IconButtonProps>;
|
|
14
|
+
export default IconButton;
|
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import type { LabelType } from "../../data-display/label/Label";
|
|
3
|
+
/**
|
|
4
|
+
* Risk details interface for risk analysis integration
|
|
5
|
+
*/
|
|
6
|
+
export interface RiskDetails {
|
|
7
|
+
color?: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
hexBgColor?: string;
|
|
10
|
+
hexBorderColor?: string;
|
|
11
|
+
[key: string]: any;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Risk details card component props
|
|
15
|
+
*/
|
|
16
|
+
export interface RiskDetailsCardProps {
|
|
17
|
+
riskDetails: RiskDetails;
|
|
18
|
+
maxWidth?: string;
|
|
19
|
+
showAllRisksSuggestions?: boolean;
|
|
20
|
+
}
|
|
1
21
|
/**
|
|
2
22
|
* Props for the CurrencyInputField component
|
|
3
23
|
*/
|
|
@@ -6,56 +26,78 @@ export interface CurrencyInputFieldProps {
|
|
|
6
26
|
id: string;
|
|
7
27
|
/** Label text to display above the input */
|
|
8
28
|
label?: string;
|
|
9
|
-
/** Current value of the input (
|
|
10
|
-
value
|
|
11
|
-
/** Default value for the input */
|
|
12
|
-
defaultValue?: number | null;
|
|
29
|
+
/** Current value of the input (string for compatibility) */
|
|
30
|
+
value: string;
|
|
13
31
|
/** Callback function called when value changes */
|
|
14
|
-
onChange: (
|
|
15
|
-
/**
|
|
16
|
-
|
|
32
|
+
onChange: (data: any, currencyCode?: string) => void;
|
|
33
|
+
/** Error message to display below the input */
|
|
34
|
+
errorMessage?: string;
|
|
35
|
+
/** Default value for the input */
|
|
36
|
+
defaultValue?: string;
|
|
17
37
|
/** Whether the field is required */
|
|
18
38
|
required?: boolean;
|
|
39
|
+
/** Whether the required indicator shows as conditional (yellow instead of red) */
|
|
40
|
+
isRequiredConditional?: boolean;
|
|
41
|
+
/** Tags/labels to display next to the label */
|
|
42
|
+
tags?: (string | LabelType)[];
|
|
43
|
+
/** Additional CSS classes for the wrapper */
|
|
44
|
+
className?: string;
|
|
45
|
+
/** Whether to preserve original case in the label */
|
|
46
|
+
originalCase?: boolean;
|
|
47
|
+
/** Tooltip text for the help icon */
|
|
48
|
+
tooltip?: string;
|
|
49
|
+
/** Whether to use simple mode (inline label style) */
|
|
50
|
+
simpleMode?: boolean;
|
|
51
|
+
/** Additional CSS classes for the input field */
|
|
52
|
+
inputFieldClassName?: string;
|
|
53
|
+
/** Whether the value was AI extracted */
|
|
54
|
+
isAiExtracted?: boolean;
|
|
55
|
+
/** Whether this is a GTN (Global Term Name) field */
|
|
56
|
+
isGTN?: boolean;
|
|
57
|
+
/** GTN field name for document integration */
|
|
58
|
+
gtnName?: any;
|
|
59
|
+
/** Whether to allow multi-currency selection with dropdown */
|
|
60
|
+
allowMultiCurrency?: boolean;
|
|
19
61
|
/** Placeholder text for the input */
|
|
20
62
|
placeholder?: string;
|
|
21
|
-
/**
|
|
22
|
-
|
|
23
|
-
/** Type of message to display */
|
|
24
|
-
messageType?: "success" | "error" | "info" | "default";
|
|
25
|
-
/** Additional CSS classes for the wrapper container */
|
|
26
|
-
wrapperClassName?: string;
|
|
27
|
-
/** Additional CSS classes for the input */
|
|
28
|
-
inputClassName?: string;
|
|
29
|
-
/** Additional CSS classes for the label */
|
|
30
|
-
labelClassName?: string;
|
|
31
|
-
/** Help text to display below the label */
|
|
32
|
-
helpText?: string;
|
|
33
|
-
/** Size variant for the input */
|
|
34
|
-
size?: "small" | "medium" | "large";
|
|
63
|
+
/** Whether the input is disabled */
|
|
64
|
+
disabled?: boolean;
|
|
35
65
|
/** Current currency code */
|
|
36
66
|
currencyCode?: string;
|
|
37
|
-
/** Whether to allow currency selection */
|
|
38
|
-
allowCurrencyChange?: boolean;
|
|
39
|
-
/** Available currency options (defaults to all) */
|
|
40
|
-
availableCurrencies?: string[];
|
|
41
|
-
/** Whether to show currency symbol */
|
|
42
|
-
showSymbol?: boolean;
|
|
43
|
-
/** Whether to format value display */
|
|
44
|
-
formatValue?: boolean;
|
|
45
|
-
/** Minimum value allowed */
|
|
46
|
-
min?: number;
|
|
47
|
-
/** Maximum value allowed */
|
|
48
|
-
max?: number;
|
|
49
|
-
/** Number of decimal places */
|
|
50
|
-
decimalPlaces?: number;
|
|
51
|
-
/** Additional props to pass to the input element */
|
|
52
|
-
inputProps?: React.InputHTMLAttributes<HTMLInputElement>;
|
|
53
67
|
/** Inline styles for the input element */
|
|
54
68
|
inputStyle?: React.CSSProperties;
|
|
69
|
+
/** Additional CSS classes for the label */
|
|
70
|
+
labelClassName?: string;
|
|
71
|
+
/** Whether this is a live field */
|
|
72
|
+
isLiveField?: boolean;
|
|
73
|
+
/** Callback function called when input loses focus */
|
|
74
|
+
onBlur?: () => void;
|
|
75
|
+
/** Whether the input should auto-focus */
|
|
76
|
+
autoFocus?: boolean;
|
|
77
|
+
/** Whether recording is active (for pilot context) */
|
|
78
|
+
isRecording?: boolean;
|
|
79
|
+
/** Whether playback is active (for pilot context) */
|
|
80
|
+
isPlaying?: boolean;
|
|
81
|
+
/** Handler for adding GTN to document */
|
|
82
|
+
onAddGTNToDocument?: (keyValuePair: {
|
|
83
|
+
key: string;
|
|
84
|
+
value: string;
|
|
85
|
+
}) => void;
|
|
86
|
+
/** Risk details data */
|
|
87
|
+
riskDetails?: RiskDetails;
|
|
88
|
+
/** Whether risk analysis is open */
|
|
89
|
+
isRiskAnalysisOpen?: boolean;
|
|
90
|
+
/** Custom risk details card component */
|
|
91
|
+
RiskDetailsCard?: React.ComponentType<RiskDetailsCardProps>;
|
|
92
|
+
/** Translation function */
|
|
93
|
+
t?: (key: string) => string;
|
|
94
|
+
/** Function to get flag component for currency */
|
|
95
|
+
getFlagComponent?: (currencyCode: string) => ReactNode;
|
|
55
96
|
}
|
|
56
97
|
/**
|
|
57
98
|
* A highly customizable currency input component with label, validation, and styling support.
|
|
58
|
-
* Features currency selection, formatting, validation,
|
|
99
|
+
* Features currency selection, formatting, validation, GTN integration, risk analysis support,
|
|
100
|
+
* and comprehensive prop support for various use cases.
|
|
59
101
|
*
|
|
60
102
|
* @example
|
|
61
103
|
* ```tsx
|
|
@@ -65,7 +107,7 @@ export interface CurrencyInputFieldProps {
|
|
|
65
107
|
* value={price}
|
|
66
108
|
* onChange={(value, currency) => setPrice(value)}
|
|
67
109
|
* currencyCode="USD"
|
|
68
|
-
*
|
|
110
|
+
* allowMultiCurrency
|
|
69
111
|
* required
|
|
70
112
|
* />
|
|
71
113
|
* ```
|
|
@@ -4,9 +4,10 @@
|
|
|
4
4
|
export declare const CURRENCIES: {
|
|
5
5
|
value: string;
|
|
6
6
|
label: string;
|
|
7
|
-
symbol: string;
|
|
8
7
|
}[];
|
|
9
8
|
/**
|
|
10
9
|
* Currency symbols mapping for display purposes
|
|
11
10
|
*/
|
|
12
|
-
export declare const CURRENCY_SYMBOLS:
|
|
11
|
+
export declare const CURRENCY_SYMBOLS: {
|
|
12
|
+
[key: string]: string;
|
|
13
|
+
};
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { type DatePickerProps } from "antd";
|
|
2
|
+
import type { LabelType } from "../../data-display/label/Label";
|
|
3
|
+
export declare const UNIVERSAL_DATE_FORMAT = "MM/DD/YYYY";
|
|
4
|
+
export declare const UNIVERSAL_DATETIME_FORMAT = "MM/DD/YYYY - hh:mm A";
|
|
5
|
+
/**
|
|
6
|
+
* Risk details interface
|
|
7
|
+
*/
|
|
8
|
+
export interface RiskDetails {
|
|
9
|
+
color?: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
hexBgColor?: string;
|
|
12
|
+
hexBorderColor?: string;
|
|
13
|
+
[key: string]: any;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Risk details card component props
|
|
17
|
+
*/
|
|
18
|
+
export interface RiskDetailsCardProps {
|
|
19
|
+
riskDetails: RiskDetails;
|
|
20
|
+
maxWidth?: string;
|
|
21
|
+
showAllRisksSuggestions?: boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Props for the DateTimeField component
|
|
25
|
+
*/
|
|
26
|
+
export interface DateTimeFieldProps extends Omit<DatePickerProps, "onChange" | "value"> {
|
|
27
|
+
/** The label text to display above the date picker */
|
|
28
|
+
label?: string;
|
|
29
|
+
/** Current value of the date picker (ISO string or formatted date string) */
|
|
30
|
+
value?: string;
|
|
31
|
+
/** Additional CSS classes for the wrapper */
|
|
32
|
+
className?: string;
|
|
33
|
+
/** Whether the field is required */
|
|
34
|
+
required?: boolean;
|
|
35
|
+
/** Whether the required indicator shows as conditional (yellow instead of red) */
|
|
36
|
+
isRequiredConditional?: boolean;
|
|
37
|
+
/** Error message to display */
|
|
38
|
+
errorMessage?: string;
|
|
39
|
+
/** Whether the date picker is disabled */
|
|
40
|
+
disabled?: boolean;
|
|
41
|
+
/** Callback function called when date changes */
|
|
42
|
+
handleOnChange: (value: string | null) => void;
|
|
43
|
+
/** Whether to use simple mode (minimal styling) */
|
|
44
|
+
simpleMode?: boolean;
|
|
45
|
+
/** Whether to show time picker */
|
|
46
|
+
showTime?: boolean;
|
|
47
|
+
/** Custom date format */
|
|
48
|
+
dateFormat?: string;
|
|
49
|
+
/** Tooltip text for the help icon */
|
|
50
|
+
tooltip?: string;
|
|
51
|
+
/** Tags to display with the label */
|
|
52
|
+
tags?: (string | LabelType)[];
|
|
53
|
+
/** Whether to preserve original case in the label */
|
|
54
|
+
originalCase?: boolean;
|
|
55
|
+
/** Whether the value was AI extracted */
|
|
56
|
+
isAiExtracted?: boolean;
|
|
57
|
+
/** Whether this is a GTN (Global Term Name) field */
|
|
58
|
+
isGTN?: boolean;
|
|
59
|
+
/** GTN name for the field */
|
|
60
|
+
gtnName?: any;
|
|
61
|
+
/** Whether to allow timezone conversion */
|
|
62
|
+
allowTimezoneConversion?: boolean;
|
|
63
|
+
/** Whether to allow copying */
|
|
64
|
+
allowCopy?: boolean;
|
|
65
|
+
/** Unique identifier for the date picker */
|
|
66
|
+
id: string;
|
|
67
|
+
/** Date picker type */
|
|
68
|
+
picker?: "date" | "week" | "month" | "quarter" | "year";
|
|
69
|
+
/** Whether popup should render inside parent element */
|
|
70
|
+
shouldPopOnParent?: boolean;
|
|
71
|
+
/** Custom inline styles for the input */
|
|
72
|
+
inputStyle?: React.CSSProperties;
|
|
73
|
+
/** Additional CSS classes for the label */
|
|
74
|
+
labelClassName?: string;
|
|
75
|
+
/** Whether this is a live field */
|
|
76
|
+
isLiveField?: boolean;
|
|
77
|
+
/** Risk details data */
|
|
78
|
+
riskDetails?: RiskDetails;
|
|
79
|
+
/** Whether risk analysis is open */
|
|
80
|
+
isRiskAnalysisOpen?: boolean;
|
|
81
|
+
/** Custom risk details card component */
|
|
82
|
+
RiskDetailsCard?: React.ComponentType<RiskDetailsCardProps>;
|
|
83
|
+
/** Handler for adding GTN to document */
|
|
84
|
+
onAddGTNToDocument?: (keyValuePair: {
|
|
85
|
+
key: string;
|
|
86
|
+
value: string;
|
|
87
|
+
}) => void;
|
|
88
|
+
/** Translation function */
|
|
89
|
+
t?: (key: string) => string;
|
|
90
|
+
/** Custom format date function for GTN values */
|
|
91
|
+
formatDateForGTN?: (value: string, options: {
|
|
92
|
+
skipTimezone: boolean;
|
|
93
|
+
withTime: boolean;
|
|
94
|
+
}) => string;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* DateTimeField component - A feature-rich date/time picker with support for
|
|
98
|
+
* GTN integration, risk analysis, AI extraction indicators, and more.
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* ```tsx
|
|
102
|
+
* // Basic usage
|
|
103
|
+
* <DateTimeField
|
|
104
|
+
* id="start-date"
|
|
105
|
+
* label="Start Date"
|
|
106
|
+
* value={startDate}
|
|
107
|
+
* handleOnChange={(date) => setStartDate(date)}
|
|
108
|
+
* />
|
|
109
|
+
*
|
|
110
|
+
* // With time picker
|
|
111
|
+
* <DateTimeField
|
|
112
|
+
* id="event-datetime"
|
|
113
|
+
* label="Event Date & Time"
|
|
114
|
+
* value={eventDateTime}
|
|
115
|
+
* handleOnChange={(date) => setEventDateTime(date)}
|
|
116
|
+
* showTime={true}
|
|
117
|
+
* />
|
|
118
|
+
*
|
|
119
|
+
* // With GTN integration
|
|
120
|
+
* <DateTimeField
|
|
121
|
+
* id="contract-date"
|
|
122
|
+
* label="Contract Date"
|
|
123
|
+
* value={contractDate}
|
|
124
|
+
* handleOnChange={(date) => setContractDate(date)}
|
|
125
|
+
* isGTN={true}
|
|
126
|
+
* gtnName="contract_date"
|
|
127
|
+
* onAddGTNToDocument={(kv) => dispatch(setVariableValueToEditor(kv))}
|
|
128
|
+
* />
|
|
129
|
+
* ```
|
|
130
|
+
*/
|
|
131
|
+
export declare const DateTimeField: import("react").ForwardRefExoticComponent<Omit<DateTimeFieldProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,120 @@
|
|
|
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
|
|
14
|
+
*/
|
|
15
|
+
export interface RiskDetailsCardProps {
|
|
16
|
+
riskDetails: RiskDetails;
|
|
17
|
+
maxWidth?: string;
|
|
18
|
+
showAllRisksSuggestions?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Props for the DynamicDataModal component
|
|
22
|
+
*/
|
|
23
|
+
export interface DynamicDataModalProps {
|
|
24
|
+
isVisible: boolean;
|
|
25
|
+
onSelect: (data: string | number | readonly string[] | undefined) => void;
|
|
26
|
+
onClose: () => void;
|
|
27
|
+
dataKey: string;
|
|
28
|
+
dataSource: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Props for the DynamicDataInputField component
|
|
32
|
+
*/
|
|
33
|
+
export interface DynamicDataInputFieldProps {
|
|
34
|
+
/** Unique identifier for the input */
|
|
35
|
+
id: string;
|
|
36
|
+
/** Label text to display above the input */
|
|
37
|
+
label: string;
|
|
38
|
+
/** Placeholder text for the input */
|
|
39
|
+
placeholder?: string;
|
|
40
|
+
/** Color for the input text */
|
|
41
|
+
color?: string;
|
|
42
|
+
/** Current value of the input */
|
|
43
|
+
value: string | number | readonly string[] | undefined;
|
|
44
|
+
/** Whether the field is required */
|
|
45
|
+
required?: boolean;
|
|
46
|
+
/** Whether the required indicator shows as conditional (yellow instead of red) */
|
|
47
|
+
isRequiredConditional?: boolean;
|
|
48
|
+
/** Tags/labels to display next to the label */
|
|
49
|
+
tags?: (string | LabelType)[];
|
|
50
|
+
/** Error message to display below the input */
|
|
51
|
+
errorMessage?: string;
|
|
52
|
+
/** Default value for the input */
|
|
53
|
+
defaultValue?: string | number | readonly string[] | undefined;
|
|
54
|
+
/** Data source for dynamic data */
|
|
55
|
+
dataSource: string;
|
|
56
|
+
/** Data key for dynamic data */
|
|
57
|
+
dataKey: string;
|
|
58
|
+
/** Tooltip text for the help icon */
|
|
59
|
+
tooltip?: string;
|
|
60
|
+
/** Whether this is a GTN (Global Term Name) field */
|
|
61
|
+
isGTN?: boolean;
|
|
62
|
+
/** GTN field name for document integration */
|
|
63
|
+
gtnName?: string;
|
|
64
|
+
/** Whether the value was AI extracted */
|
|
65
|
+
isAiExtracted?: boolean;
|
|
66
|
+
/** Whether the input is disabled */
|
|
67
|
+
disabled?: boolean;
|
|
68
|
+
/** Callback function called when value changes */
|
|
69
|
+
onChange: (value: string | number | readonly string[] | undefined) => void;
|
|
70
|
+
/** Additional CSS classes for the label */
|
|
71
|
+
labelClassName?: string;
|
|
72
|
+
/** Whether this is a live field */
|
|
73
|
+
isLiveField?: boolean;
|
|
74
|
+
/** Whether to preserve original case in the label */
|
|
75
|
+
originalCase?: boolean;
|
|
76
|
+
/** Handler for adding GTN to document */
|
|
77
|
+
onAddGTNToDocument?: (keyValuePair: {
|
|
78
|
+
key: string;
|
|
79
|
+
value: string;
|
|
80
|
+
}) => void;
|
|
81
|
+
/** Risk details data */
|
|
82
|
+
riskDetails?: RiskDetails;
|
|
83
|
+
/** Whether risk analysis is open */
|
|
84
|
+
isRiskAnalysisOpen?: boolean;
|
|
85
|
+
/** Custom risk details card component */
|
|
86
|
+
RiskDetailsCard?: React.ComponentType<RiskDetailsCardProps>;
|
|
87
|
+
/** Primary color shades for styling */
|
|
88
|
+
primaryColorShades?: Record<number, string>;
|
|
89
|
+
/** Translation function */
|
|
90
|
+
t?: (key: string) => string;
|
|
91
|
+
/** Whether recording is active (for pilot context) */
|
|
92
|
+
isRecording?: boolean;
|
|
93
|
+
/** Whether playback is active (for pilot context) */
|
|
94
|
+
isPlaying?: boolean;
|
|
95
|
+
/** Callback to set disable actions state */
|
|
96
|
+
setDisableActions?: (disabled: boolean) => void;
|
|
97
|
+
/** Toast function for deprecated field warning */
|
|
98
|
+
showDeprecatedFieldWarning?: () => void;
|
|
99
|
+
/** Dynamic data modal component */
|
|
100
|
+
DynamicDataModal?: React.ComponentType<DynamicDataModalProps>;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* A highly customizable dynamic data input component with label, validation, and styling support.
|
|
104
|
+
* Features dynamic data modal integration, GTN support, risk analysis support,
|
|
105
|
+
* and comprehensive prop support for various use cases.
|
|
106
|
+
*
|
|
107
|
+
* @example
|
|
108
|
+
* ```tsx
|
|
109
|
+
* <DynamicDataInputField
|
|
110
|
+
* id="dynamic-field"
|
|
111
|
+
* label="Dynamic Field"
|
|
112
|
+
* value={fieldValue}
|
|
113
|
+
* onChange={(value) => setFieldValue(value)}
|
|
114
|
+
* dataSource="sourceTable"
|
|
115
|
+
* dataKey="fieldKey"
|
|
116
|
+
* required
|
|
117
|
+
* />
|
|
118
|
+
* ```
|
|
119
|
+
*/
|
|
120
|
+
export declare const DynamicDataInputField: import("react").ForwardRefExoticComponent<DynamicDataInputFieldProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -1,3 +1,22 @@
|
|
|
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
|
|
14
|
+
*/
|
|
15
|
+
export interface RiskDetailsCardProps {
|
|
16
|
+
riskDetails: RiskDetails;
|
|
17
|
+
maxWidth?: string;
|
|
18
|
+
showAllRisksSuggestions?: boolean;
|
|
19
|
+
}
|
|
1
20
|
/**
|
|
2
21
|
* Props for the PercentageInputField component
|
|
3
22
|
*/
|
|
@@ -6,58 +25,73 @@ export interface PercentageInputFieldProps {
|
|
|
6
25
|
id: string;
|
|
7
26
|
/** Label text to display above the input */
|
|
8
27
|
label?: string;
|
|
9
|
-
/** Current value of the input
|
|
10
|
-
value
|
|
11
|
-
/** Default value for the input */
|
|
12
|
-
defaultValue?: number | null;
|
|
28
|
+
/** Current value of the input */
|
|
29
|
+
value: string;
|
|
13
30
|
/** Callback function called when value changes */
|
|
14
|
-
onChange: (
|
|
31
|
+
onChange: (data: any) => void;
|
|
32
|
+
/** Error message to display below the input */
|
|
33
|
+
errorMessage?: string;
|
|
34
|
+
/** Default value for the input */
|
|
35
|
+
defaultValue?: string;
|
|
15
36
|
/** Whether the input is disabled */
|
|
16
37
|
disabled?: boolean;
|
|
17
|
-
/** Whether the field is required */
|
|
18
|
-
required?: boolean;
|
|
19
|
-
/** Placeholder text for the input */
|
|
20
|
-
placeholder?: string;
|
|
21
|
-
/** Message to display below the input */
|
|
22
|
-
message?: string;
|
|
23
|
-
/** Type of message to display */
|
|
24
|
-
messageType?: "success" | "error" | "info" | "default";
|
|
25
|
-
/** Additional CSS classes for the wrapper container */
|
|
26
|
-
wrapperClassName?: string;
|
|
27
|
-
/** Additional CSS classes for the input */
|
|
28
|
-
inputClassName?: string;
|
|
29
|
-
/** Additional CSS classes for the label */
|
|
30
|
-
labelClassName?: string;
|
|
31
|
-
/** Help text to display below the label */
|
|
32
|
-
helpText?: string;
|
|
33
|
-
/** Size variant for the input */
|
|
34
|
-
size?: "small" | "medium" | "large";
|
|
35
|
-
/** Minimum value allowed */
|
|
36
|
-
min?: number;
|
|
37
38
|
/** Maximum value allowed */
|
|
38
39
|
max?: number;
|
|
39
|
-
/**
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
|
|
43
|
-
/** Whether
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
|
|
40
|
+
/** Minimum value allowed */
|
|
41
|
+
min?: number;
|
|
42
|
+
/** Whether the field is required */
|
|
43
|
+
required?: boolean;
|
|
44
|
+
/** Whether the required indicator shows as conditional (yellow instead of red) */
|
|
45
|
+
isRequiredConditional?: boolean;
|
|
46
|
+
/** Background color class */
|
|
47
|
+
bg?: string;
|
|
48
|
+
/** Tags/labels to display next to the label */
|
|
49
|
+
tags?: (string | LabelType)[];
|
|
50
|
+
/** Text color class */
|
|
51
|
+
color?: string;
|
|
52
|
+
/** Additional CSS classes for the wrapper */
|
|
53
|
+
className?: string;
|
|
54
|
+
/** Whether to preserve original case in the label */
|
|
55
|
+
originalCase?: boolean;
|
|
56
|
+
/** Tooltip text for the help icon */
|
|
57
|
+
tooltip?: string;
|
|
58
|
+
/** Whether to use simple mode (inline label style) */
|
|
59
|
+
simpleMode?: boolean;
|
|
60
|
+
/** Additional CSS classes for the input field */
|
|
61
|
+
inputFieldClassName?: string;
|
|
62
|
+
/** Whether the value was AI extracted */
|
|
63
|
+
isAiExtracted?: boolean;
|
|
64
|
+
/** Whether this is a GTN (Global Term Name) field */
|
|
65
|
+
isGTN?: boolean;
|
|
66
|
+
/** GTN field name for document integration */
|
|
67
|
+
gtnName?: any;
|
|
49
68
|
/** Inline styles for the input element */
|
|
50
69
|
inputStyle?: React.CSSProperties;
|
|
51
|
-
/**
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
|
|
70
|
+
/** Whether to show dollar sign (for simpleMode) */
|
|
71
|
+
withDollarSign?: boolean;
|
|
72
|
+
/** Additional CSS classes for the label */
|
|
73
|
+
labelClassName?: string;
|
|
74
|
+
/** Whether this is a live field */
|
|
75
|
+
isLiveField?: boolean;
|
|
76
|
+
/** Callback function called when input loses focus */
|
|
77
|
+
onBlur?: () => void;
|
|
78
|
+
/** Handler for adding GTN to document */
|
|
79
|
+
onAddGTNToDocument?: (keyValuePair: {
|
|
80
|
+
key: string;
|
|
81
|
+
value: string;
|
|
82
|
+
}) => void;
|
|
83
|
+
/** Risk details data */
|
|
84
|
+
riskDetails?: RiskDetails;
|
|
85
|
+
/** Whether risk analysis is open */
|
|
86
|
+
isRiskAnalysisOpen?: boolean;
|
|
87
|
+
/** Custom risk details card component */
|
|
88
|
+
RiskDetailsCard?: React.ComponentType<RiskDetailsCardProps>;
|
|
89
|
+
/** Translation function */
|
|
90
|
+
t?: (key: string) => string;
|
|
57
91
|
}
|
|
58
92
|
/**
|
|
59
93
|
* A highly customizable percentage input component with label, validation, and styling support.
|
|
60
|
-
* Features
|
|
94
|
+
* Features GTN integration, risk analysis support, AI extraction indicator, and comprehensive prop support.
|
|
61
95
|
*
|
|
62
96
|
* @example
|
|
63
97
|
* ```tsx
|
|
@@ -66,8 +100,6 @@ export interface PercentageInputFieldProps {
|
|
|
66
100
|
* label="Discount Percentage"
|
|
67
101
|
* value={discount}
|
|
68
102
|
* onChange={(value) => setDiscount(value)}
|
|
69
|
-
* min={0}
|
|
70
|
-
* max={100}
|
|
71
103
|
* required
|
|
72
104
|
* />
|
|
73
105
|
* ```
|
package/dist/index.d.ts
CHANGED
|
@@ -18,14 +18,18 @@ export type { CreatableSelectProps, SelectOption, TProps, } from "./components/f
|
|
|
18
18
|
export { CustomizableSelectField } from "./components/forms/customizable-select-field/CustomizableSelectField";
|
|
19
19
|
export type { CustomizableSelectFieldProps, CustomizableSelectOption, OptionConfig, MenuConfig, } from "./components/forms/customizable-select-field/CustomizableSelectField";
|
|
20
20
|
export { CurrencyInputField } from "./components/forms/currency-input/CurrencyInputField";
|
|
21
|
-
export type { CurrencyInputFieldProps } from "./components/forms/currency-input/CurrencyInputField";
|
|
21
|
+
export type { CurrencyInputFieldProps, RiskDetails as CurrencyInputFieldRiskDetails, RiskDetailsCardProps as CurrencyInputFieldRiskDetailsCardProps, } from "./components/forms/currency-input/CurrencyInputField";
|
|
22
22
|
export { CURRENCIES, CURRENCY_SYMBOLS } from "./components/forms/currency-input/currency.constant";
|
|
23
23
|
export { DateRange } from "./components/forms/date-range/DateRange";
|
|
24
24
|
export type { DateRangeProps, DateRangeValue, } from "./components/forms/date-range/DateRange";
|
|
25
|
+
export { DateTimeField, UNIVERSAL_DATE_FORMAT, UNIVERSAL_DATETIME_FORMAT, } from "./components/forms/date-time-field/DateTimeField";
|
|
26
|
+
export type { DateTimeFieldProps, RiskDetails as DateTimeFieldRiskDetails, RiskDetailsCardProps as DateTimeFieldRiskDetailsCardProps, } from "./components/forms/date-time-field/DateTimeField";
|
|
25
27
|
export { DebounceInputField } from "./components/forms/debounce-input/DebounceInputField";
|
|
26
28
|
export type { DebounceInputFieldProps } from "./components/forms/debounce-input/DebounceInputField";
|
|
29
|
+
export { DynamicDataInputField } from "./components/forms/dynamic-data-input/DynamicDataInputField";
|
|
30
|
+
export type { DynamicDataInputFieldProps, DynamicDataModalProps as DynamicDataInputModalProps, RiskDetails as DynamicDataInputFieldRiskDetails, RiskDetailsCardProps as DynamicDataInputFieldRiskDetailsCardProps, } from "./components/forms/dynamic-data-input/DynamicDataInputField";
|
|
27
31
|
export { PercentageInputField } from "./components/forms/percentage-input/PercentageInputField";
|
|
28
|
-
export type { PercentageInputFieldProps } from "./components/forms/percentage-input/PercentageInputField";
|
|
32
|
+
export type { PercentageInputFieldProps, RiskDetails as PercentageInputFieldRiskDetails, RiskDetailsCardProps as PercentageInputFieldRiskDetailsCardProps, } from "./components/forms/percentage-input/PercentageInputField";
|
|
29
33
|
export { Toggle } from "./components/forms/toggle/Toggle";
|
|
30
34
|
export type { ToggleProps } from "./components/forms/toggle/Toggle";
|
|
31
35
|
export { TOGGLE_LABEL_DIRECTION } from "./constants/toggle";
|