@lax-wp/design-system 0.13.76 → 0.14.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 +1 @@
1
- {"version":3,"file":"CurrencyInputField.es.js","sources":["../../../../src/components/forms/currency-input/CurrencyInputField.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport cn from \"classnames\";\nimport { forwardRef, useEffect, useState } from \"react\";\nimport { Dropdown, Tooltip as AntTooltip } from \"antd\";\nimport { useTranslation } from 'react-i18next';\nimport { Typography } from \"../../data-display/typography/Typography\";\nimport { Label } from \"../../data-display/label/Label\";\nimport type { LabelType } from \"../../data-display/label/Label\";\nimport { CURRENCIES, CURRENCY_SYMBOLS } from \"./currency.constant\";\nimport { NoteAddOutlined, BoltOutlined } from \"@mui/icons-material\";\nimport { AIExtractedIndicator } from \"../../icons/AIExtractedIndicator\";\nimport { AIStarIcon } from \"../../icons/AIStarIcon\";\nimport { HelpIcon } from \"../../icons/HelpIcon\";\nimport Tooltip from \"../../tooltip/Tooltip\";\nimport {\n getConfidenceScoreBadgeClass,\n getConfidenceScoreBadgeColor,\n getConfidenceScoreBadgeFill,\n getConfidenceScoreBadgeTextColor,\n shouldShowConfidenceScore,\n} from \"../../../utils/confidenceScoreUtils\";\nimport { SearchBar } from \"../search-bar/SearchBar\";\nimport { OptionButton } from \"../../buttons/option-button/OptionButton\";\nimport { getFlagComponent } from \"../../../utils/countryFlags\";\nimport { InputLabel } from \"../shared/InputLabel\";\nimport { formatCurrency as formatCurrencyUtils } from \"../../../utils/formatters\";\n\n/**\n * Confidence score type\n */\nexport type ConfidenceScoreType = \"low\" | \"medium\" | \"high\";\n\nexport type SourceMetaBBox = {\n b: number;\n l: number;\n r: number;\n t: number;\n};\n\nexport type SourceMetaItem = {\n bbox: SourceMetaBBox;\n confidence_score?: number;\n is_primary?: boolean;\n match_score?: number;\n match_type?: string;\n page_height: number;\n page_width: number;\n source_page: number;\n source_text?: string;\n};\n\n/**\n * Risk details interface for risk analysis integration\n */\nexport interface RiskDetails {\n color?: string;\n description?: string;\n hexBgColor?: string;\n hexBorderColor?: string;\n [key: string]: any;\n}\n\n/**\n * Risk details card component props - generic to allow consumer-specific risk types\n */\nexport interface RiskDetailsCardProps<T = any> {\n riskDetails: T;\n maxWidth?: string;\n showAllRisksSuggestions?: boolean;\n}\n\n/**\n * Props for the CurrencyInputField component\n */\nexport interface CurrencyInputFieldProps {\n /** Unique identifier for the currency input */\n id: string;\n /** Label text to display above the input */\n label?: string;\n /** Current value of the input (string for compatibility) */\n value: string;\n /** Callback function called when value changes */\n onChange: (data: any, currencyCode?: string) => void;\n /** Error message to display below the input */\n errorMessage?: string;\n /** Default value for the input */\n defaultValue?: string;\n /** Whether the field is required */\n required?: boolean;\n /** Whether the required indicator shows as conditional (yellow instead of red) */\n isRequiredConditional?: boolean;\n /** Tags/labels to display next to the label */\n tags?: (string | LabelType)[];\n /** Additional CSS classes for the wrapper */\n className?: string;\n /** Whether to preserve original case in the label */\n originalCase?: boolean;\n /** Tooltip text for the help icon */\n tooltip?: string;\n /** Whether to use simple mode (inline label style) */\n simpleMode?: boolean;\n /** Additional CSS classes for the input field */\n inputFieldClassName?: string;\n /** Whether the value was AI extracted */\n isAiExtracted?: boolean;\n /** Confidence percentage shown as a badge */\n confidenceScore?: number;\n /** Confidence classification for badge styling */\n confidenceType?: ConfidenceScoreType;\n /** Optional tooltip content for confidence badge */\n confidenceTooltip?: React.ReactNode;\n /** Source meta for confidence score */\n sourceMeta?: SourceMetaItem[];\n /** Handler fired when confidence score badge is clicked */\n onConfidenceScoreClick?: (sourceMeta: SourceMetaItem[]) => void;\n /** Whether this is a GTN (Global Term Name) field */\n isGTN?: boolean;\n /** GTN field name for document integration */\n gtnName?: any;\n /** Whether to allow multi-currency selection with dropdown */\n allowMultiCurrency?: boolean;\n /** Placeholder text for the input */\n placeholder?: string;\n /** Whether the input is disabled */\n disabled?: boolean;\n /** Current currency code */\n currencyCode?: string;\n /** Inline styles for the input element */\n inputStyle?: React.CSSProperties;\n /** Additional CSS classes for the label */\n labelClassName?: string;\n /** Whether this is a live field */\n isLiveField?: boolean;\n /** Callback function called when input loses focus */\n onBlur?: () => void;\n /** Whether the input should auto-focus */\n autoFocus?: boolean;\n /** Whether recording is active (for pilot context) */\n isRecording?: boolean;\n /** Whether playback is active (for pilot context) */\n isPlaying?: boolean;\n /** Handler for adding GTN to document */\n onAddGTNToDocument?: (keyValuePair: { key: string; value: string }) => void;\n /** Risk details data */\n riskDetails?: RiskDetails;\n /** Whether risk analysis is open */\n isRiskAnalysisOpen?: boolean;\n /** Custom risk details card component */\n RiskDetailsCard?: React.ComponentType<RiskDetailsCardProps<any>>;\n /** Optional extra content in the label row (e.g. actions, badges) */\n labelExtra?: React.ReactNode;\n /** Input surface style: `'modified'` — Warning colors; `'deleted'` — Error colors, text #475467; `'success'` — Success colors, text #101828. */\n inputEmphasis?: \"default\" | \"modified\" | \"deleted\" | \"success\";\n}\n\n/**\n * A highly customizable currency input component with label, validation, and styling support.\n * Features currency selection, formatting, validation, GTN integration, risk analysis support,\n * and comprehensive prop support for various use cases.\n *\n * @example\n * ```tsx\n * <CurrencyInputField\n * id=\"price\"\n * label=\"Price\"\n * value={price}\n * onChange={(value, currency) => setPrice(value)}\n * currencyCode=\"USD\"\n * allowMultiCurrency\n * required\n * />\n * ```\n */\nexport const CurrencyInputField = forwardRef<\n HTMLInputElement,\n CurrencyInputFieldProps\n>(\n (\n {\n id,\n label,\n value,\n onChange,\n errorMessage,\n defaultValue,\n required = false,\n isRequiredConditional = false,\n tags,\n className,\n originalCase = false,\n tooltip,\n simpleMode = false,\n inputFieldClassName = \"\",\n isAiExtracted = false,\n confidenceScore,\n confidenceType = \"high\",\n confidenceTooltip,\n sourceMeta = [],\n onConfidenceScoreClick,\n isGTN = false,\n gtnName = null,\n allowMultiCurrency = false,\n placeholder,\n disabled = false,\n currencyCode = \"USD\",\n inputStyle,\n labelClassName,\n isLiveField = false,\n onBlur: onBlurProp,\n autoFocus = false,\n isRecording = false,\n isPlaying = false,\n onAddGTNToDocument,\n riskDetails,\n isRiskAnalysisOpen = false,\n RiskDetailsCard,\n labelExtra,\n inputEmphasis = \"default\",\n ...props\n },\n ref\n ) => {\n const { t } = useTranslation();\n const emphasisModifiedSkin = inputEmphasis === \"modified\" && !errorMessage && !(isRiskAnalysisOpen && riskDetails?.color);\n const emphasisDeletedSkin = inputEmphasis === \"deleted\" && !errorMessage && !(isRiskAnalysisOpen && riskDetails?.color);\n const emphasisSuccessSkin = inputEmphasis === \"success\" && !errorMessage && !(isRiskAnalysisOpen && riskDetails?.color);\n const [isFocused, setIsFocused] = useState(false);\n const [filteredCurrencyOptions, setFilteredCurrencyOptions] = useState<\n { label: React.ReactNode; key: string }[]\n >([]);\n const [searchKeyForCurrency, setSearchKeyForCurrency] = useState(\"\");\n const [selectedCurrency, setSelectedCurrency] = useState<string>(\n currencyCode ? currencyCode : \"USD\"\n );\n const [isHovered, setIsHovered] = useState(false);\n\n const handleAddGTNToDocument = (_value: string) => {\n if (onAddGTNToDocument) {\n const keyValuePair = {\n key: gtnName,\n value: formatCurrencyUtils(_value, selectedCurrency),\n };\n onAddGTNToDocument(keyValuePair);\n }\n };\n\n const formatCurrency = (targetValue: any): string => {\n if (targetValue === null || targetValue === undefined) return \"\";\n\n const number = Number(targetValue);\n if (isNaN(number)) return targetValue;\n\n return number?.toLocaleString(\"en-US\", {\n minimumFractionDigits: 2,\n maximumFractionDigits: 2,\n });\n };\n\n const handleOnChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const _value = e.target.value;\n const numericValue =\n _value === \"\" || _value === null || _value === undefined\n ? 0\n : Number(_value);\n onChange(numericValue, selectedCurrency);\n const element = document.getElementById(id);\n if (element) {\n element.setAttribute(\n \"data-selected-value\",\n JSON.stringify({\n value: numericValue,\n currency_code: selectedCurrency,\n })\n );\n }\n if (element && (isRecording || isPlaying)) {\n const pilotEvent = new CustomEvent(\"pilot-change\", {\n bubbles: true,\n detail: {\n selector: `#${id}`,\n value: {\n value: numericValue,\n currency_code: selectedCurrency,\n },\n type: \"change\",\n },\n });\n element.dispatchEvent(pilotEvent);\n }\n };\n\n const onFocus = () => {\n setIsFocused(true);\n };\n\n const onBlur = () => {\n setIsFocused(false);\n if (value === null || value === undefined || value === \"\") {\n handleOnChange({\n target: { value: \"0.00\" },\n } as React.ChangeEvent<HTMLInputElement>);\n }\n onBlurProp?.();\n };\n\n const getClassName = (): string => {\n const baseClasses =\n \"pl-11 border h-8 text-sm block w-full p-2.5 font-inter font-medium focus:outline-none focus:ring-0\";\n\n if (errorMessage) {\n return cn(baseClasses, \"rounded-md border-red-300 bg-white dark:bg-black-600\", inputFieldClassName);\n }\n if (isRiskAnalysisOpen && riskDetails?.color) {\n return cn(baseClasses, `rounded-md border-${riskDetails.color}-300 bg-${riskDetails.color}-50`, \"text-neutral-900 dark:text-black-200 disabled:bg-neutral-50 dark:disabled:!bg-black-800\", inputFieldClassName);\n }\n if (emphasisDeletedSkin) {\n return cn(baseClasses, \"rounded-lg border border-solid border-[var(--Error-200,#FECACA)] bg-[var(--Error-50,#FEF2F2)] !text-[#475467] focus:border-[var(--Error-200,#FECACA)] focus:shadow-[0_0_0_2px_rgba(254,202,202,0.45)] dark:border-[var(--Error-200,#FECACA)] dark:bg-[var(--Error-50,#FEF2F2)] dark:!text-[#475467] disabled:!opacity-100 disabled:!bg-[var(--Error-50,#FEF2F2)]\", inputFieldClassName);\n }\n if (emphasisModifiedSkin) {\n return cn(baseClasses, \"rounded-lg border border-solid border-[var(--Warning-200,#FEDF89)] bg-[var(--Warning-50,#FFFAEB)] text-neutral-900 dark:text-black-100 focus:border-[var(--Warning-200,#FEDF89)] focus:shadow-[0_0_0_2px_rgba(254,223,137,0.45)] dark:border-[var(--Warning-200,#FEDF89)] dark:bg-[var(--Warning-50,#FFFAEB)] disabled:!opacity-100 disabled:!bg-[var(--Warning-50,#FFFAEB)]\", inputFieldClassName);\n }\n if (emphasisSuccessSkin) {\n return cn(baseClasses, \"rounded-lg border border-solid border-[var(--Success-200,#BBF7D0)] bg-[var(--Success-50,#F0FDF4)] !text-[#101828] focus:border-[var(--Success-200,#BBF7D0)] focus:shadow-[0_0_0_2px_rgba(187,247,208,0.45)] dark:border-[var(--Success-200,#BBF7D0)] dark:bg-[var(--Success-50,#F0FDF4)] dark:!text-[#101828] disabled:!opacity-100 disabled:!bg-[var(--Success-50,#F0FDF4)]\", inputFieldClassName);\n }\n return cn(baseClasses, \"rounded-lg border-gray-300 dark:border-black-600 bg-white dark:bg-black-600 text-neutral-900 dark:text-black-200 disabled:bg-neutral-50 dark:disabled:!bg-black-800 dark:disabled:placeholder:!text-black-400 focus:border-[var(--color-primary-600)] dark:focus:border-[var(--color-primary-400)] focus:shadow-[0_0_0_1.5px_var(--color-primary-100)] dark:focus:shadow-[0_0_0_1.5px_var(--color-primary-950)]\", inputFieldClassName);\n };\n\n useEffect(() => {\n if (currencyCode) {\n setSelectedCurrency(currencyCode);\n }\n }, [currencyCode]);\n\n useEffect(() => {\n if (selectedCurrency) {\n const numericValue =\n value === \"\" || value === null || value === undefined\n ? 0\n : Number(value);\n if (currencyCode !== selectedCurrency) {\n onChange(numericValue, selectedCurrency);\n }\n const element = document.getElementById(id);\n if (element) {\n element.setAttribute(\n \"data-selected-value\",\n JSON.stringify({\n value: numericValue,\n currency_code: selectedCurrency,\n })\n );\n if (isRecording || isPlaying) {\n const pilotEvent = new CustomEvent(\"pilot-change\", {\n bubbles: true,\n detail: {\n selector: `#${id}`,\n value: {\n value: numericValue,\n currency_code: selectedCurrency,\n },\n type: \"change\",\n },\n });\n element.dispatchEvent(pilotEvent);\n }\n }\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [selectedCurrency]);\n\n useEffect(() => {\n const currencyOptions = CURRENCIES.filter((item) =>\n (item.value + \" - \" + item.label)\n .toLowerCase()\n .includes(searchKeyForCurrency.toLowerCase())\n ).map((item) => ({\n label: (\n <OptionButton\n text={`${item.value} - ${item.label}`}\n icon={getFlagComponent(item.value)}\n showTick={selectedCurrency === item.value}\n onClick={() => setSelectedCurrency(item.value)}\n className=\"text-black-900 dark:text-white\"\n />\n ),\n key: item.value,\n }));\n\n setFilteredCurrencyOptions(currencyOptions);\n }, [searchKeyForCurrency, selectedCurrency]);\n\n useEffect(() => {\n setSearchKeyForCurrency(\"\");\n }, [selectedCurrency]);\n\n // Simple mode rendering\n if (simpleMode) {\n return (\n <label\n id={id}\n className={`mb-1 text-xs font-medium text-gray-600 h-full inline-flex items-center gap-1 ${\n !originalCase ? \"capitalize\" : \"\"\n } ${labelClassName || \"\"}`}\n >\n <span className=\"absolute inset-y-0 left-1 top-0.5 flex items-center pl-3\">\n {\"$\"}\n </span>\n <input\n {...props}\n ref={ref}\n type={isFocused ? \"number\" : \"text\"}\n required={required}\n className={cn(inputFieldClassName, \"pl-8 h-8\")}\n onChange={handleOnChange}\n min={0}\n onFocus={onFocus}\n onBlur={onBlur}\n value={!isFocused ? formatCurrency(value) : value}\n {...(defaultValue && !value\n ? {\n defaultValue: !isFocused\n ? formatCurrency(defaultValue)\n : defaultValue,\n }\n : {})}\n id={id || label}\n autoFocus={autoFocus}\n />\n </label>\n );\n }\n\n // Full mode rendering\n return (\n <div\n className={cn(\n \"flex gap-0.5 relative\",\n isHovered && isGTN\n ? \"border rounded-lg border-primary-100 bg-primary-50 p-1\"\n : \"\"\n )}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n >\n {isGTN && !isHovered ? (\n <div className=\"size-1 bg-primary-600 rounded-full animate-blink mt-1.5\" />\n ) : null}\n <div className={cn(\"w-full flex flex-col\", className)}>\n <label\n htmlFor=\"text\"\n className={`mb-1 text-xs font-medium text-gray-600 inline-flex items-center gap-1 ${\n !originalCase ? \"uppercase\" : \"\"\n } ${labelClassName || \"\"}`}\n >\n <div className=\"grid w-full grid-cols-[minmax(0,1fr)_auto] items-start gap-x-1\">\n <div className=\"inline-flex min-w-0 items-center gap-1 flex-wrap\">\n <InputLabel label={label || \"\"} required={required || false} isRequiredConditional={isRequiredConditional || false} />\n {isLiveField && (\n <BoltOutlined\n sx={{\n fontSize: 16,\n color: \"var(--color-primary-600)\",\n rotate: \"15deg\",\n }}\n />\n )}\n {isAiExtracted && !shouldShowConfidenceScore(confidenceScore) && <AIExtractedIndicator />}\n <Label labels={tags} />\n {tooltip && (\n <Tooltip placement=\"top\" title={tooltip}>\n <div className=\"cursor-pointer\">\n <HelpIcon className=\"w-icon-sm h-icon-sm\" />\n </div>\n </Tooltip>\n )}\n {labelExtra}\n </div>\n <div className=\"flex items-center gap-1 justify-self-end\">\n {(shouldShowConfidenceScore(confidenceScore) && confidenceType) ? (\n <Tooltip\n placement=\"top-end\"\n title={confidenceTooltip ?? \"\"}\n hideTooltip={confidenceTooltip === undefined || confidenceTooltip === null}\n className=\"cursor-pointer\"\n >\n <div\n className={cn(\n \"inline-flex min-w-[50px] items-center gap-1 rounded-md px-1 py-0.5\",\n getConfidenceScoreBadgeClass(confidenceType)\n )}\n onClick={() => onConfidenceScoreClick?.(sourceMeta)}\n >\n <AIStarIcon\n size={12}\n fill={getConfidenceScoreBadgeColor(confidenceType)}\n fillSecondary={getConfidenceScoreBadgeFill(confidenceType)}\n />\n <span className={cn(\"text-xs font-medium leading-4\", getConfidenceScoreBadgeTextColor(confidenceType))}>\n {confidenceScore}%\n </span>\n </div>\n </Tooltip>\n ) : null}\n {isGTN && isHovered && onAddGTNToDocument ? (\n <button\n id=\"btn-currency-input-add-to-document\"\n className=\"cursor-pointer\"\n onClick={() => handleAddGTNToDocument(formatCurrency(value))}\n type=\"button\"\n >\n <AntTooltip placement=\"top\" title={t(\"Add to document\")}>\n <NoteAddOutlined\n className=\"text-primary-600\"\n sx={{\n fontSize: 16\n }}\n />\n </AntTooltip>\n </button>\n ) : null}\n </div>\n </div>\n </label>\n <label className=\"relative block\">\n <span className=\"absolute inset-y-0 left-1 flex items-center pl-3 text-neutral-900 dark:text-white\">\n {CURRENCY_SYMBOLS[selectedCurrency]}\n </span>\n\n <input\n {...props}\n ref={ref}\n placeholder={placeholder}\n type={isFocused ? \"number\" : \"text\"}\n required={required}\n disabled={disabled}\n className={getClassName()}\n onChange={handleOnChange}\n min={0}\n onFocus={onFocus}\n onBlur={onBlur}\n value={!isFocused ? formatCurrency(value) : value}\n defaultValue={\n !isFocused ? formatCurrency(defaultValue) : defaultValue\n }\n id={id || label}\n style={inputStyle}\n autoComplete=\"off\"\n autoFocus={autoFocus}\n />\n <span\n className={`absolute inset-y-0 right-2 flex items-center z-[1000] h-full cursor-pointer dark:text-black-200 ${\n allowMultiCurrency ? \"cursor-pointer\" : \"\"\n }`}\n >\n {allowMultiCurrency ? (\n <Dropdown\n menu={{\n items: [\n ...filteredCurrencyOptions,\n ],\n }}\n trigger={[\"click\"]}\n overlayClassName=\"row-option-cell\"\n placement=\"bottomRight\"\n overlayStyle={{ zIndex: 999 }}\n getPopupContainer={(trigger) =>\n trigger.parentElement as HTMLElement\n }\n popupRender={(menu) => (\n <div\n className=\"[&>*:nth-child(2)]:!shadow-none [&>*:nth-child(2)>*]:!px-2 flex flex-col gap-2 p-2 bg-white dark:bg-black-700 border border-solid border-neutral-200 dark:border-black-600 max-h-[200px] w-[330px] text-ellipsis overflow-y-auto z-[999] rounded-md\"\n >\n <SearchBar\n id={`search-bar-currency-input`}\n value={searchKeyForCurrency}\n onChange={(_value) =>\n setSearchKeyForCurrency(_value)\n }\n className=\"mb-2\"\n />\n {menu}\n </div>\n )}\n >\n <div className=\"pl-4 pr-2 py-1.5 text-sm text-gray-700 dark:text-black-200 flex items-center gap-1\">\n {getFlagComponent(selectedCurrency)} {selectedCurrency}\n </div>\n </Dropdown>\n ) : (\n selectedCurrency\n )}\n </span>\n </label>\n {errorMessage && (\n <Typography\n className=\"text-error-500 mt-1\"\n appearance=\"custom\"\n size=\"extra-small\"\n variant=\"medium\"\n >\n {errorMessage}\n </Typography>\n )}\n </div>\n {isHovered &&\n riskDetails &&\n isRiskAnalysisOpen &&\n RiskDetailsCard && (\n <div\n role=\"tooltip\"\n tabIndex={0}\n className=\"absolute left-0 right-0 top-[95%] mt-1 z-50 bg-white dark:bg-black-600 rounded-xl\"\n onClick={(e) => e.stopPropagation()}\n onMouseDown={(e) => e.preventDefault()}\n onKeyDown={(e) => {\n if (e.key === \"Escape\") {\n setIsHovered(false);\n }\n }}\n >\n <RiskDetailsCard riskDetails={riskDetails} />\n </div>\n )}\n </div>\n );\n }\n);\n\nCurrencyInputField.displayName = \"CurrencyInputField\";\n"],"names":["CurrencyInputField","forwardRef","id","label","value","onChange","errorMessage","defaultValue","required","isRequiredConditional","tags","className","originalCase","tooltip","simpleMode","inputFieldClassName","isAiExtracted","confidenceScore","confidenceType","confidenceTooltip","sourceMeta","onConfidenceScoreClick","isGTN","gtnName","allowMultiCurrency","placeholder","disabled","currencyCode","inputStyle","labelClassName","isLiveField","onBlurProp","autoFocus","isRecording","isPlaying","onAddGTNToDocument","riskDetails","isRiskAnalysisOpen","RiskDetailsCard","labelExtra","inputEmphasis","props","ref","t","useTranslation","emphasisModifiedSkin","emphasisDeletedSkin","emphasisSuccessSkin","isFocused","setIsFocused","useState","filteredCurrencyOptions","setFilteredCurrencyOptions","searchKeyForCurrency","setSearchKeyForCurrency","selectedCurrency","setSelectedCurrency","isHovered","setIsHovered","handleAddGTNToDocument","_value","keyValuePair","formatCurrencyUtils","formatCurrency","targetValue","number","handleOnChange","numericValue","element","pilotEvent","onFocus","onBlur","getClassName","baseClasses","cn","useEffect","currencyOptions","CURRENCIES","item","jsx","OptionButton","getFlagComponent","jsxs","InputLabel","BoltOutlined","shouldShowConfidenceScore","AIExtractedIndicator","Label","Tooltip","HelpIcon","getConfidenceScoreBadgeClass","AIStarIcon","getConfidenceScoreBadgeColor","getConfidenceScoreBadgeFill","getConfidenceScoreBadgeTextColor","AntTooltip","NoteAddOutlined","CURRENCY_SYMBOLS","Dropdown","trigger","menu","SearchBar","Typography"],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AM,EAAE,gBAAA;AAAA,cAClB,aAAa,CAAC,MAAM,EAAE,eAAA;AAAA,cACtB,WAAW,CAAC,MAAM;AAChB,gBAAI,EAAE,QAAQ,YACZrB,EAAa,EAAK;AAAA,cAEtB;AAAA,cAEA,UAAA,gBAAAqB,EAACzC,KAAgB,aAAAF,EAAA,CAA0B;AAAA,YAAA;AAAA,UAAA;AAAA,QAC7C;AAAA,MAAA;AAAA,IAAA;AAAA,EAIV;AACF;AAEApC,GAAmB,cAAc;"}
1
+ {"version":3,"file":"CurrencyInputField.es.js","sources":["../../../../src/components/forms/currency-input/CurrencyInputField.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport cn from \"classnames\";\nimport { forwardRef, useEffect, useState } from \"react\";\nimport { Dropdown, Tooltip as AntTooltip } from \"antd\";\nimport { useTranslation } from 'react-i18next';\nimport { Typography } from \"../../data-display/typography/Typography\";\nimport { Label } from \"../../data-display/label/Label\";\nimport type { LabelType } from \"../../data-display/label/Label\";\nimport { CURRENCIES, CURRENCY_SYMBOLS } from \"./currency.constant\";\nimport { NoteAddOutlined, BoltOutlined } from \"@mui/icons-material\";\nimport { AIExtractedIndicator } from \"../../icons/AIExtractedIndicator\";\nimport { AIStarIcon } from \"../../icons/AIStarIcon\";\nimport { HelpIcon } from \"../../icons/HelpIcon\";\nimport Tooltip from \"../../tooltip/Tooltip\";\nimport {\n getConfidenceScoreBadgeClass,\n getConfidenceScoreBadgeColor,\n getConfidenceScoreBadgeFill,\n getConfidenceScoreBadgeTextColor,\n shouldShowConfidenceScore,\n} from \"../../../utils/confidenceScoreUtils\";\nimport { SearchBar } from \"../search-bar/SearchBar\";\nimport { OptionButton } from \"../../buttons/option-button/OptionButton\";\nimport { getFlagComponent } from \"../../../utils/countryFlags\";\nimport { InputLabel } from \"../shared/InputLabel\";\nimport { formatCurrency as formatCurrencyUtils } from \"../../../utils/formatters\";\n\n/**\n * Confidence score type\n */\nexport type ConfidenceScoreType = \"low\" | \"medium\" | \"high\";\n\nexport type SourceMetaBBox = {\n b: number;\n l: number;\n r: number;\n t: number;\n};\n\nexport type SourceMetaItem = {\n bbox: SourceMetaBBox;\n confidence_score?: number;\n is_primary?: boolean;\n match_score?: number;\n match_type?: string;\n page_height: number;\n page_width: number;\n source_page: number;\n source_text?: string;\n};\n\n/**\n * Risk details interface for risk analysis integration\n */\nexport interface RiskDetails {\n color?: string;\n description?: string;\n hexBgColor?: string;\n hexBorderColor?: string;\n [key: string]: any;\n}\n\n/**\n * Risk details card component props - generic to allow consumer-specific risk types\n */\nexport interface RiskDetailsCardProps<T = any> {\n riskDetails: T;\n maxWidth?: string;\n showAllRisksSuggestions?: boolean;\n}\n\n/**\n * Props for the CurrencyInputField component\n */\nexport interface CurrencyInputFieldProps {\n /** Unique identifier for the currency input */\n id: string;\n /** Label text to display above the input */\n label?: string;\n /** Current value of the input (string for compatibility) */\n value: string;\n /** Callback function called when value changes */\n onChange: (data: any, currencyCode?: string) => void;\n /** Error message to display below the input */\n errorMessage?: string;\n /** Default value for the input */\n defaultValue?: string;\n /** Whether the field is required */\n required?: boolean;\n /** Whether the required indicator shows as conditional (yellow instead of red) */\n isRequiredConditional?: boolean;\n /** Tags/labels to display next to the label */\n tags?: (string | LabelType)[];\n /** Additional CSS classes for the wrapper */\n className?: string;\n /** Whether to preserve original case in the label */\n originalCase?: boolean;\n /** Tooltip text for the help icon */\n tooltip?: string;\n /** Whether to use simple mode (inline label style) */\n simpleMode?: boolean;\n /** Additional CSS classes for the input field */\n inputFieldClassName?: string;\n /** Whether the value was AI extracted */\n isAiExtracted?: boolean;\n /** Confidence percentage shown as a badge */\n confidenceScore?: number;\n /** Confidence classification for badge styling */\n confidenceType?: ConfidenceScoreType;\n /** Optional tooltip content for confidence badge */\n confidenceTooltip?: React.ReactNode;\n /** Source meta for confidence score */\n sourceMeta?: SourceMetaItem[];\n /** Handler fired when confidence score badge is clicked */\n onConfidenceScoreClick?: (sourceMeta: SourceMetaItem[]) => void;\n /** Whether this is a GTN (Global Term Name) field */\n isGTN?: boolean;\n /** GTN field name for document integration */\n gtnName?: any;\n /** Whether to allow multi-currency selection with dropdown */\n allowMultiCurrency?: boolean;\n /** Placeholder text for the input */\n placeholder?: string;\n /** Whether the input is disabled */\n disabled?: boolean;\n /** Current currency code */\n currencyCode?: string;\n /** Inline styles for the input element */\n inputStyle?: React.CSSProperties;\n /** Additional CSS classes for the label */\n labelClassName?: string;\n /** Whether this is a live field */\n isLiveField?: boolean;\n /** Callback function called when input loses focus */\n onBlur?: () => void;\n /** Whether the input should auto-focus */\n autoFocus?: boolean;\n /** Whether recording is active (for pilot context) */\n isRecording?: boolean;\n /** Whether playback is active (for pilot context) */\n isPlaying?: boolean;\n /** Handler for adding GTN to document */\n onAddGTNToDocument?: (keyValuePair: { key: string; value: string }) => void;\n /** Risk details data */\n riskDetails?: RiskDetails;\n /** Whether risk analysis is open */\n isRiskAnalysisOpen?: boolean;\n /** Custom risk details card component */\n RiskDetailsCard?: React.ComponentType<RiskDetailsCardProps<any>>;\n /** Optional extra content in the label row (e.g. actions, badges) */\n labelExtra?: React.ReactNode;\n /** Input surface style: `'modified'` — Warning colors; `'deleted'` — Error colors, text #475467; `'success'` — Success colors, text #101828. */\n inputEmphasis?: \"default\" | \"modified\" | \"deleted\" | \"success\";\n}\n\n/**\n * A highly customizable currency input component with label, validation, and styling support.\n * Features currency selection, formatting, validation, GTN integration, risk analysis support,\n * and comprehensive prop support for various use cases.\n *\n * @example\n * ```tsx\n * <CurrencyInputField\n * id=\"price\"\n * label=\"Price\"\n * value={price}\n * onChange={(value, currency) => setPrice(value)}\n * currencyCode=\"USD\"\n * allowMultiCurrency\n * required\n * />\n * ```\n */\nexport const CurrencyInputField = forwardRef<\n HTMLInputElement,\n CurrencyInputFieldProps\n>(\n (\n {\n id,\n label,\n value,\n onChange,\n errorMessage,\n defaultValue,\n required = false,\n isRequiredConditional = false,\n tags,\n className,\n originalCase = false,\n tooltip,\n simpleMode = false,\n inputFieldClassName = \"\",\n isAiExtracted = false,\n confidenceScore,\n confidenceType = \"high\",\n confidenceTooltip,\n sourceMeta = [],\n onConfidenceScoreClick,\n isGTN = false,\n gtnName = null,\n allowMultiCurrency = false,\n placeholder,\n disabled = false,\n currencyCode = \"USD\",\n inputStyle,\n labelClassName,\n isLiveField = false,\n onBlur: onBlurProp,\n autoFocus = false,\n isRecording = false,\n isPlaying = false,\n onAddGTNToDocument,\n riskDetails,\n isRiskAnalysisOpen = false,\n RiskDetailsCard,\n labelExtra,\n inputEmphasis = \"default\",\n ...props\n },\n ref\n ) => {\n const { t } = useTranslation();\n const emphasisModifiedSkin = inputEmphasis === \"modified\" && !errorMessage && !(isRiskAnalysisOpen && riskDetails?.color);\n const emphasisDeletedSkin = inputEmphasis === \"deleted\" && !errorMessage && !(isRiskAnalysisOpen && riskDetails?.color);\n const emphasisSuccessSkin = inputEmphasis === \"success\" && !errorMessage && !(isRiskAnalysisOpen && riskDetails?.color);\n const [isFocused, setIsFocused] = useState(false);\n const [filteredCurrencyOptions, setFilteredCurrencyOptions] = useState<\n { label: React.ReactNode; key: string }[]\n >([]);\n const [searchKeyForCurrency, setSearchKeyForCurrency] = useState(\"\");\n const [selectedCurrency, setSelectedCurrency] = useState<string>(\n currencyCode ? currencyCode : \"USD\"\n );\n const [isHovered, setIsHovered] = useState(false);\n\n const handleAddGTNToDocument = (_value: string) => {\n if (onAddGTNToDocument) {\n const keyValuePair = {\n key: gtnName,\n value: formatCurrencyUtils(_value, selectedCurrency),\n };\n onAddGTNToDocument(keyValuePair);\n }\n };\n\n const formatCurrency = (targetValue: any): string => {\n if (targetValue === null || targetValue === undefined) return \"\";\n\n const number = Number(targetValue);\n if (isNaN(number)) return targetValue;\n\n return number?.toLocaleString(\"en-US\", {\n minimumFractionDigits: 2,\n maximumFractionDigits: 2,\n });\n };\n\n const handleOnChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const _value = e.target.value;\n const numericValue =\n _value === \"\" || _value === null || _value === undefined\n ? 0\n : Number(_value);\n onChange(numericValue, selectedCurrency);\n const element = document.getElementById(id);\n if (element) {\n element.setAttribute(\n \"data-selected-value\",\n JSON.stringify({\n value: numericValue,\n currency_code: selectedCurrency,\n })\n );\n }\n if (element && (isRecording || isPlaying)) {\n const pilotEvent = new CustomEvent(\"pilot-change\", {\n bubbles: true,\n detail: {\n selector: `#${id}`,\n value: {\n value: numericValue,\n currency_code: selectedCurrency,\n },\n type: \"change\",\n },\n });\n element.dispatchEvent(pilotEvent);\n }\n };\n\n const onFocus = () => {\n setIsFocused(true);\n };\n\n const onBlur = () => {\n setIsFocused(false);\n if (value === null || value === undefined || value === \"\") {\n handleOnChange({\n target: { value: \"0.00\" },\n } as React.ChangeEvent<HTMLInputElement>);\n }\n onBlurProp?.();\n };\n\n const getClassName = (): string => {\n const baseClasses =\n \"pl-11 border h-8 text-sm block w-full p-2.5 font-inter font-medium focus:outline-none focus:ring-0\";\n\n if (errorMessage) {\n return cn(baseClasses, \"rounded-md border-red-300 bg-white dark:bg-black-600\", inputFieldClassName);\n }\n if (isRiskAnalysisOpen && riskDetails?.color) {\n return cn(baseClasses, `rounded-md border-${riskDetails.color}-300 bg-${riskDetails.color}-50`, \"text-neutral-900 dark:text-black-200 disabled:bg-neutral-50 dark:disabled:!bg-black-800\", inputFieldClassName);\n }\n if (emphasisDeletedSkin) {\n return cn(baseClasses, \"rounded-lg border border-solid border-[var(--Error-200,#FECACA)] bg-[var(--Error-50,#FEF2F2)] !text-[#475467] focus:border-[var(--Error-200,#FECACA)] focus:shadow-[0_0_0_2px_rgba(254,202,202,0.45)] dark:border-[var(--Error-200,#FECACA)] dark:bg-[var(--Error-50,#FEF2F2)] dark:!text-[#475467] disabled:!opacity-100 disabled:!bg-[var(--Error-50,#FEF2F2)]\", inputFieldClassName);\n }\n if (emphasisModifiedSkin) {\n return cn(baseClasses, \"rounded-lg border border-solid border-[var(--Warning-200,#FEDF89)] bg-[var(--Warning-50,#FFFAEB)] text-neutral-900 dark:text-black-100 focus:border-[var(--Warning-200,#FEDF89)] focus:shadow-[0_0_0_2px_rgba(254,223,137,0.45)] dark:border-[var(--Warning-200,#FEDF89)] dark:bg-[var(--Warning-50,#FFFAEB)] disabled:!opacity-100 disabled:!bg-[var(--Warning-50,#FFFAEB)]\", inputFieldClassName);\n }\n if (emphasisSuccessSkin) {\n return cn(baseClasses, \"rounded-lg border border-solid border-[var(--Success-200,#BBF7D0)] bg-[var(--Success-50,#F0FDF4)] !text-[#101828] focus:border-[var(--Success-200,#BBF7D0)] focus:shadow-[0_0_0_2px_rgba(187,247,208,0.45)] dark:border-[var(--Success-200,#BBF7D0)] dark:bg-[var(--Success-50,#F0FDF4)] dark:!text-[#101828] disabled:!opacity-100 disabled:!bg-[var(--Success-50,#F0FDF4)]\", inputFieldClassName);\n }\n return cn(baseClasses, \"rounded-lg border-gray-300 dark:border-black-600 bg-white dark:bg-black-600 text-neutral-900 dark:text-black-200 disabled:bg-neutral-50 dark:disabled:!bg-black-800 dark:disabled:placeholder:!text-black-400 focus:border-[var(--color-primary-600)] dark:focus:border-[var(--color-primary-400)] focus:shadow-[0_0_0_1.5px_var(--color-primary-100)] dark:focus:shadow-[0_0_0_1.5px_var(--color-primary-950)]\", inputFieldClassName);\n };\n\n useEffect(() => {\n if (currencyCode) {\n setSelectedCurrency(currencyCode);\n }\n }, [currencyCode]);\n\n useEffect(() => {\n if (selectedCurrency) {\n const numericValue =\n value === \"\" || value === null || value === undefined\n ? 0\n : Number(value);\n if (currencyCode !== selectedCurrency) {\n onChange(numericValue, selectedCurrency);\n }\n const element = document.getElementById(id);\n if (element) {\n element.setAttribute(\n \"data-selected-value\",\n JSON.stringify({\n value: numericValue,\n currency_code: selectedCurrency,\n })\n );\n if (isRecording || isPlaying) {\n const pilotEvent = new CustomEvent(\"pilot-change\", {\n bubbles: true,\n detail: {\n selector: `#${id}`,\n value: {\n value: numericValue,\n currency_code: selectedCurrency,\n },\n type: \"change\",\n },\n });\n element.dispatchEvent(pilotEvent);\n }\n }\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [selectedCurrency]);\n\n useEffect(() => {\n const currencyOptions = CURRENCIES.filter((item) =>\n (item.value + \" - \" + item.label)\n .toLowerCase()\n .includes(searchKeyForCurrency.toLowerCase())\n ).map((item) => ({\n label: (\n <OptionButton\n text={`${item.value} - ${item.label}`}\n icon={getFlagComponent(item.value)}\n showTick={selectedCurrency === item.value}\n onClick={() => setSelectedCurrency(item.value)}\n className=\"text-black-900 dark:text-white\"\n />\n ),\n key: item.value,\n }));\n\n setFilteredCurrencyOptions(currencyOptions);\n }, [searchKeyForCurrency, selectedCurrency]);\n\n useEffect(() => {\n setSearchKeyForCurrency(\"\");\n }, [selectedCurrency]);\n\n // Simple mode rendering\n if (simpleMode) {\n return (\n <label\n id={id}\n className={`mb-1 text-xs font-medium text-gray-600 h-full inline-flex items-center gap-1 ${\n !originalCase ? \"capitalize\" : \"\"\n } ${labelClassName || \"\"}`}\n >\n <span className=\"absolute inset-y-0 left-1 top-0.5 flex items-center pl-3\">\n {\"$\"}\n </span>\n <input\n {...props}\n ref={ref}\n type={isFocused ? \"number\" : \"text\"}\n required={required}\n className={cn(inputFieldClassName, \"pl-8 h-8\")}\n onChange={handleOnChange}\n min={0}\n onFocus={onFocus}\n onBlur={onBlur}\n value={!isFocused ? formatCurrency(value) : value}\n {...(defaultValue && !value\n ? {\n defaultValue: !isFocused\n ? formatCurrency(defaultValue)\n : defaultValue,\n }\n : {})}\n id={id || label}\n autoFocus={autoFocus}\n />\n </label>\n );\n }\n\n // Full mode rendering\n return (\n <div\n className={cn(\n \"flex gap-0.5 relative\",\n isHovered && isGTN\n ? \"border rounded-lg border-primary-100 bg-primary-50 p-1\"\n : \"\"\n )}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n >\n {isGTN && !isHovered ? (\n <div className=\"size-1 bg-primary-600 rounded-full animate-blink mt-1.5\" />\n ) : null}\n <div className={cn(\"w-full flex flex-col\", className)}>\n <label\n htmlFor=\"text\"\n className={`mb-1 text-xs font-medium text-gray-600 inline-flex items-center gap-1 ${\n !originalCase ? \"uppercase\" : \"\"\n } ${labelClassName || \"\"}`}\n >\n <div className=\"grid w-full grid-cols-[minmax(0,1fr)_auto] items-start gap-x-1\">\n <div className=\"inline-flex min-w-0 items-center gap-1 flex-wrap\">\n <InputLabel label={label || \"\"} required={required || false} isRequiredConditional={isRequiredConditional || false} />\n {isLiveField && (\n <BoltOutlined\n sx={{\n fontSize: 16,\n color: \"var(--color-primary-600)\",\n rotate: \"15deg\",\n }}\n />\n )}\n {isAiExtracted && !shouldShowConfidenceScore(confidenceScore) && <AIExtractedIndicator />}\n <Label labels={tags} />\n {tooltip && (\n <Tooltip placement=\"top\" title={tooltip}>\n <div className=\"cursor-pointer\">\n <HelpIcon className=\"w-icon-sm h-icon-sm\" />\n </div>\n </Tooltip>\n )}\n {labelExtra}\n </div>\n <div className=\"flex items-center gap-1 justify-self-end\">\n {(shouldShowConfidenceScore(confidenceScore) && confidenceType) ? (\n <Tooltip\n placement=\"top-end\"\n title={confidenceTooltip ?? \"\"}\n hideTooltip={confidenceTooltip === undefined || confidenceTooltip === null}\n className=\"cursor-pointer\"\n >\n <div\n className={cn(\n \"inline-flex min-w-[50px] items-center gap-1 rounded-md px-1 py-0.5\",\n getConfidenceScoreBadgeClass(confidenceType)\n )}\n onClick={() => onConfidenceScoreClick?.(sourceMeta)}\n >\n <AIStarIcon\n size={12}\n fill={getConfidenceScoreBadgeColor(confidenceType)}\n fillSecondary={getConfidenceScoreBadgeFill(confidenceType)}\n />\n <span className={cn(\"text-xs font-medium leading-4\", getConfidenceScoreBadgeTextColor(confidenceType))}>\n {confidenceScore}%\n </span>\n </div>\n </Tooltip>\n ) : null}\n {isGTN && isHovered && onAddGTNToDocument ? (\n <button\n id=\"btn-currency-input-add-to-document\"\n className=\"cursor-pointer\"\n onClick={() => handleAddGTNToDocument(formatCurrency(value))}\n type=\"button\"\n >\n <AntTooltip placement=\"top\" title={t(\"Add to document\")}>\n <NoteAddOutlined\n className=\"text-primary-600\"\n sx={{\n fontSize: 16\n }}\n />\n </AntTooltip>\n </button>\n ) : null}\n </div>\n </div>\n </label>\n <label className=\"relative block\">\n <span className=\"absolute inset-y-0 left-1 flex items-center pl-3 text-neutral-900 dark:text-white\">\n {CURRENCY_SYMBOLS[selectedCurrency]}\n </span>\n\n <input\n {...props}\n ref={ref}\n placeholder={placeholder}\n type={isFocused ? \"number\" : \"text\"}\n required={required}\n disabled={disabled}\n className={getClassName()}\n onChange={handleOnChange}\n min={0}\n onFocus={onFocus}\n onBlur={onBlur}\n value={!isFocused ? formatCurrency(value) : value}\n defaultValue={\n !isFocused ? formatCurrency(defaultValue) : defaultValue\n }\n id={id || label}\n style={inputStyle}\n autoComplete=\"off\"\n autoFocus={autoFocus}\n />\n <span\n className={`absolute inset-y-0 right-2 flex items-center h-full cursor-pointer dark:text-black-200 ${\n allowMultiCurrency ? \"cursor-pointer\" : \"\"\n }`}\n >\n {allowMultiCurrency ? (\n <Dropdown\n menu={{\n items: [\n ...filteredCurrencyOptions,\n ],\n }}\n trigger={[\"click\"]}\n overlayClassName=\"row-option-cell\"\n placement=\"bottomRight\"\n overlayStyle={{ zIndex: 999 }}\n getPopupContainer={() => document.body}\n popupRender={(menu) => (\n <div\n className=\"[&>*:nth-child(2)]:!shadow-none [&>*:nth-child(2)>*]:!px-2 flex flex-col gap-2 p-2 bg-white dark:bg-black-700 border border-solid border-neutral-200 dark:border-black-600 max-h-[200px] w-[330px] text-ellipsis overflow-y-auto z-[999] rounded-md\"\n >\n <SearchBar\n id={`search-bar-currency-input`}\n value={searchKeyForCurrency}\n onChange={(_value) =>\n setSearchKeyForCurrency(_value)\n }\n className=\"mb-2\"\n />\n {menu}\n </div>\n )}\n >\n <div className=\"pl-4 pr-2 py-1.5 text-sm text-gray-700 dark:text-black-200 flex items-center gap-1\">\n {getFlagComponent(selectedCurrency)} {selectedCurrency}\n </div>\n </Dropdown>\n ) : (\n selectedCurrency\n )}\n </span>\n </label>\n {errorMessage && (\n <Typography\n className=\"text-error-500 mt-1\"\n appearance=\"custom\"\n size=\"extra-small\"\n variant=\"medium\"\n >\n {errorMessage}\n </Typography>\n )}\n </div>\n {isHovered &&\n riskDetails &&\n isRiskAnalysisOpen &&\n RiskDetailsCard && (\n <div\n role=\"tooltip\"\n tabIndex={0}\n className=\"absolute left-0 right-0 top-[95%] mt-1 z-50 bg-white dark:bg-black-600 rounded-xl\"\n onClick={(e) => e.stopPropagation()}\n onMouseDown={(e) => e.preventDefault()}\n onKeyDown={(e) => {\n if (e.key === \"Escape\") {\n setIsHovered(false);\n }\n }}\n >\n <RiskDetailsCard riskDetails={riskDetails} />\n </div>\n )}\n </div>\n );\n }\n);\n\nCurrencyInputField.displayName = \"CurrencyInputField\";\n"],"names":["CurrencyInputField","forwardRef","id","label","value","onChange","errorMessage","defaultValue","required","isRequiredConditional","tags","className","originalCase","tooltip","simpleMode","inputFieldClassName","isAiExtracted","confidenceScore","confidenceType","confidenceTooltip","sourceMeta","onConfidenceScoreClick","isGTN","gtnName","allowMultiCurrency","placeholder","disabled","currencyCode","inputStyle","labelClassName","isLiveField","onBlurProp","autoFocus","isRecording","isPlaying","onAddGTNToDocument","riskDetails","isRiskAnalysisOpen","RiskDetailsCard","labelExtra","inputEmphasis","props","ref","t","useTranslation","emphasisModifiedSkin","emphasisDeletedSkin","emphasisSuccessSkin","isFocused","setIsFocused","useState","filteredCurrencyOptions","setFilteredCurrencyOptions","searchKeyForCurrency","setSearchKeyForCurrency","selectedCurrency","setSelectedCurrency","isHovered","setIsHovered","handleAddGTNToDocument","_value","keyValuePair","formatCurrencyUtils","formatCurrency","targetValue","number","handleOnChange","numericValue","element","pilotEvent","onFocus","onBlur","getClassName","baseClasses","cn","useEffect","currencyOptions","CURRENCIES","item","jsx","OptionButton","getFlagComponent","jsxs","InputLabel","BoltOutlined","shouldShowConfidenceScore","AIExtractedIndicator","Label","Tooltip","HelpIcon","getConfidenceScoreBadgeClass","AIStarIcon","getConfidenceScoreBadgeColor","getConfidenceScoreBadgeFill","getConfidenceScoreBadgeTextColor","AntTooltip","NoteAddOutlined","CURRENCY_SYMBOLS","Dropdown","menu","SearchBar","Typography"],"mappings":";;;;;;;;;;;;;;;;;;;AA6KO,MAAMA,KAAqBC;AAAA,EAIhC,CACE;AAAA,IACE,IAAAC;AAAA,IACA,OAAAC;AAAA,IACA,OAAAC;AAAA,IACA,UAAAC;AAAA,IACA,cAAAC;AAAA,IACA,cAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,uBAAAC,IAAwB;AAAA,IACxB,MAAAC;AAAA,IACA,WAAAC;AAAA,IACA,cAAAC,IAAe;AAAA,IACf,SAAAC;AAAA,IACA,YAAAC,KAAa;AAAA,IACb,qBAAAC,IAAsB;AAAA,IACtB,eAAAC,KAAgB;AAAA,IAChB,iBAAAC;AAAA,IACA,gBAAAC,IAAiB;AAAA,IACjB,mBAAAC;AAAA,IACA,YAAAC,KAAa,CAAA;AAAA,IACb,wBAAAC;AAAA,IACA,OAAAC,IAAQ;AAAA,IACR,SAAAC,KAAU;AAAA,IACV,oBAAAC,IAAqB;AAAA,IACrB,aAAAC;AAAA,IACA,UAAAC,KAAW;AAAA,IACX,cAAAC,IAAe;AAAA,IACf,YAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,aAAAC,KAAc;AAAA,IACd,QAAQC;AAAA,IACR,WAAAC,IAAY;AAAA,IACZ,aAAAC,IAAc;AAAA,IACd,WAAAC,IAAY;AAAA,IACZ,oBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,oBAAAC,IAAqB;AAAA,IACrB,iBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,eAAAC,IAAgB;AAAA,IAChB,GAAGC;AAAA,EAAA,GAELC,MACG;AACH,UAAM,EAAE,GAAAC,GAAA,IAAMC,GAAA,GACRC,KAAuBL,MAAkB,cAAc,CAAClC,KAAgB,EAAE+B,KAAsBD,GAAa,QAC7G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UACCmD,KACCrB,KACAC,KACAC,KACE,gBAAAyC;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,UAAU;AAAA,cACV,WAAU;AAAA,cACV,SAAS,CAAC,MAAM,EAAE,gBAAA;AAAA,cAClB,aAAa,CAAC,MAAM,EAAE,eAAA;AAAA,cACtB,WAAW,CAAC,MAAM;AAChB,gBAAI,EAAE,QAAQ,YACZrB,EAAa,EAAK;AAAA,cAEtB;AAAA,cAEA,UAAA,gBAAAqB,EAACzC,KAAgB,aAAAF,EAAA,CAA0B;AAAA,YAAA;AAAA,UAAA;AAAA,QAC7C;AAAA,MAAA;AAAA,IAAA;AAAA,EAIV;AACF;AAEApC,GAAmB,cAAc;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("../../../_virtual/index.cjs.js"),n=require("react"),Ie=require("antd"),Fe=require("react-i18next"),Ee=require("../../data-display/typography/Typography.cjs.js"),qe=require("../../data-display/label/Label.cjs.js"),q=require("@mui/icons-material"),Ne=require("../../icons/AIExtractedIndicator.cjs.js"),Be=require("../../icons/AIStarIcon.cjs.js"),Ae=require("../../icons/HelpIcon.cjs.js"),N=require("../../tooltip/Tooltip.cjs.js"),D=require("../../button/IconButton.cjs.js"),Re=require("../shared/InputLabel.cjs.js"),x=require("../../../utils/confidenceScoreUtils.cjs.js"),ze=require("../../icon/icons.generated.cjs.js"),T=n.forwardRef(({id:U,label:J,labelExtra:Q,placeholder:X,value:o,onChange:B,errorMessage:s,defaultValue:Y,required:A=!1,isRequiredConditional:Z=!1,masterDataName:g,masterDataColumnName:G,masterDataFormula:i,masterDataFilters:ee,tags:te,index:re,tooltip:R="",originalCase:ne=!1,color:c="",isGTN:k=!1,labelClassName:le,gtnName:z=null,isAiExtracted:se=!1,confidenceScore:v,confidenceType:f="high",confidenceTooltip:j,sourceMeta:ae=[],onConfidenceScoreClick:oe,disabled:V=!1,reference:ie={},isLiveField:ce=!1,onBlur:de,onAddGTNToDocument:S,riskDetails:d,isRiskAnalysisOpen:L=!1,RiskDetailsCard:$,primaryColorShades:ue,setDisableActions:M,showDeprecatedFieldWarning:O,MasterDataModal:W,parseMasterDataFormula:m,inputEmphasis:w="default"},xe)=>{const{t:fe}=Fe.useTranslation(),p=!!(L&&d?.color),be=w==="modified"&&!s&&!p,ge=w==="deleted"&&!s&&!p,me=w==="success"&&!s&&!p,[h,y]=n.useState(!1),[a,b]=n.useState(null),[u,H]=n.useState(!1),[pe,he]=n.useState(""),[C,P]=n.useState(null),[ke,ve]=n.useState(!1),I=n.useRef(null),F=xe||I;n.useEffect(()=>{const t=()=>{const r=F.current||I.current;r&&ve(r.scrollWidth>r.clientWidth)};return t(),window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[a,o]),n.useEffect(()=>{b(o)},[re,o]),n.useEffect(()=>{a!==null&&a!==o&&B(a,C)},[a,C]);const E=()=>{M?.(!u),H(!u)},je=t=>{if(t.keyCode===9||t.key==="Enter"){const r=F.current||I.current;r&&(b(pe),r.blur())}},Se=(t,r)=>{let _=t;i&&m&&(_=m(i,r)),he(""),b(_),E(),P(r)},we=()=>{b(""),P(null)},ye=t=>{S&&z&&S({key:z,value:t})},Ce=()=>{const t="border h-8 text-sm rounded-lg block w-full p-2.5 pr-16 font-inter font-medium",r="placeholder:text-neutral-900 dark:placeholder:text-black-400";return s?l(t,r,"border-red-300 bg-gray-200 dark:border-black-600 dark:bg-black-600",c||"text-neutral-900 dark:text-black-200"):p&&d?.color?l(t,r,`border-${d.color}-300 bg-${d.color}-50`,c||"text-neutral-900 dark:text-black-200"):ge?l(t,r,"border-[var(--Error-200,#FECACA)] bg-[var(--Error-50,#FEF2F2)] !text-[#475467] dark:border-[var(--Error-200,#FECACA)] dark:bg-[var(--Error-50,#FEF2F2)] dark:!text-[#475467]"):be?l(t,r,"border-[var(--Warning-200,#FEDF89)] bg-[var(--Warning-50,#FFFAEB)] text-neutral-900 dark:text-black-100 dark:border-[var(--Warning-200,#FEDF89)] dark:bg-[var(--Warning-50,#FFFAEB)]"):me?l(t,r,"border-[var(--Success-200,#BBF7D0)] bg-[var(--Success-50,#F0FDF4)] !text-[#101828] dark:border-[var(--Success-200,#BBF7D0)] dark:bg-[var(--Success-50,#F0FDF4)] dark:!text-[#101828]"):l(t,r,"border-gray-300 bg-gray-200 dark:border-black-600 dark:bg-black-600",c||"text-neutral-900 dark:text-black-200")},K=()=>a!==null?a:i&&m?m(i,ie):o;return n.useEffect(()=>{u&&!g&&(O?.(),H(!1))},[u,g,O]),e.jsxs("div",{className:l("flex gap-0.5 w-full relative",h&&k?"border rounded-lg border-primary-100 p-1":"",{"error-field":!!s}),onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),children:[k&&!h?e.jsx("div",{className:"w-1 h-1 bg-primary-600 rounded-full animate-blink mt-1.5"}):null,e.jsxs("div",{className:l("flex flex-col w-full"),children:[e.jsx("label",{htmlFor:"text",className:`text-xs font-medium text-gray-600 inline-flex items-center gap-1 ${ne?"":"capitalize"} ${le||""}`,children:e.jsxs("div",{className:"grid w-full grid-cols-[minmax(0,1fr)_auto] items-start gap-x-1",children:[e.jsxs("div",{className:"inline-flex min-w-0 items-center gap-1 flex-wrap",children:[e.jsx(Re.InputLabel,{label:J||"",required:A||!1,isRequiredConditional:Z||!1}),ce&&e.jsx(q.BoltOutlined,{sx:{fontSize:16,color:"var(--color-primary-600)",rotate:"15deg"}}),se&&!x.shouldShowConfidenceScore(v)&&e.jsx(Ne.AIExtractedIndicator,{}),e.jsx(qe.Label,{labels:te}),R&&e.jsx(N,{placement:"top",title:`${R}${i?` | ${i}`:""}`,children:e.jsx("div",{className:"cursor-pointer",children:e.jsx(Ae.HelpIcon,{className:"w-icon-sm h-icon-sm"})})}),Q]}),e.jsxs("div",{className:"flex items-center gap-1 justify-self-end",children:[x.shouldShowConfidenceScore(v)&&f?e.jsx(N,{placement:"top-end",title:j??"",hideTooltip:j==null,className:"cursor-pointer",children:e.jsxs("div",{className:l("inline-flex min-w-[50px] items-center gap-1 rounded-md px-1 py-0.5",x.getConfidenceScoreBadgeClass(f)),onClick:()=>oe?.(ae),children:[e.jsx(Be.AIStarIcon,{size:12,fill:x.getConfidenceScoreBadgeColor(f),fillSecondary:x.getConfidenceScoreBadgeFill(f)}),e.jsxs("span",{className:l("text-xs font-medium leading-4",x.getConfidenceScoreBadgeTextColor(f)),children:[v,"%"]})]})}):null,k&&h&&S?e.jsx("button",{id:"btn-master-data-input-add-to-document",className:"cursor-pointer",onClick:()=>ye(o?.toString()||""),type:"button",children:e.jsx(Ie.Tooltip,{placement:"top",title:fe("Add to document"),children:e.jsx(q.NoteAddOutlined,{sx:{fontSize:16,color:ue?.[600]||"var(--color-primary-600)"}})})}):null]})]})}),e.jsxs("label",{className:"relative block mt-1",children:[e.jsx(N,{title:ke?K():"",children:e.jsx("input",{id:U,ref:F,required:A,placeholder:X,className:Ce(),onChange:t=>{B(t.target.value,C),b(t.target?.value)},onKeyDown:je,value:K(),defaultValue:Y,disabled:!0,autoComplete:"off",onBlur:de})}),e.jsx(D,{id:"btn-dynamic-data-input-rx-cross",onClick:we,className:"absolute inset-y-0 right-1 flex items-center px-2 focus:border-transparent",variant:"ghost",disabled:V,children:e.jsx(ze.CloseIcon,{className:"w-6 h-6 text-neutral-500 dark:text-neutral-400 w-sm h-sm"})}),e.jsx(D,{id:"btn-dynamic-data-input-ai-outline-pic-center",onClick:E,className:"absolute inset-y-0 right-8 flex items-center px-2 focus:border-transparent",variant:"ghost",disabled:V,children:e.jsx(q.TableChartRounded,{className:"text-neutral-500 dark:text-neutral-400 w-sm h-sm"})})]}),s&&e.jsx(Ee.Typography,{className:"text-error-500 mt-1",appearance:"custom",size:"extra-small",variant:"medium",children:s}),u&&W&&e.jsx(W,{isVisible:u,onSelected:Se,onClose:E,masterDataColumnName:G,masterDataFilters:ee,masterDataName:g,masterDataId:g,showFilters:!0})]}),h&&d&&L&&$&&e.jsx("div",{role:"tooltip",tabIndex:0,className:"absolute left-0 right-0 top-[95%] mt-1 z-50 bg-white dark:bg-black-600 rounded-xl",onClick:t=>t.stopPropagation(),onMouseDown:t=>t.preventDefault(),onKeyDown:t=>{t.key==="Escape"&&y(!1)},children:e.jsx($,{riskDetails:d})})]})});T.displayName="MasterDataInputField";exports.MasterDataInputField=T;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("../../../_virtual/index.cjs.js"),r=require("react"),Ie=require("antd"),Fe=require("react-i18next"),Ee=require("../../data-display/typography/Typography.cjs.js"),qe=require("../../data-display/label/Label.cjs.js"),q=require("@mui/icons-material"),Ne=require("../../icons/AIExtractedIndicator.cjs.js"),Be=require("../../icons/AIStarIcon.cjs.js"),Ae=require("../../icons/HelpIcon.cjs.js"),N=require("../../tooltip/Tooltip.cjs.js"),D=require("../../button/IconButton.cjs.js"),Re=require("../shared/InputLabel.cjs.js"),f=require("../../../utils/confidenceScoreUtils.cjs.js"),ze=require("../../icon/icons.generated.cjs.js"),T=r.forwardRef(({id:U,label:J,labelExtra:Q,placeholder:X,value:o,onChange:B,errorMessage:s,defaultValue:Y,required:A=!1,isRequiredConditional:Z=!1,masterDataName:p,masterDataColumnName:G,masterDataFormula:i,masterDataFilters:ee,tags:te,index:re,tooltip:R="",originalCase:le=!1,color:c="",isGTN:k=!1,labelClassName:ne,gtnName:z=null,isAiExtracted:se=!1,confidenceScore:v,confidenceType:x="high",confidenceTooltip:j,sourceMeta:ae=[],onConfidenceScoreClick:oe,disabled:V=!1,reference:ie={},isLiveField:ce=!1,onBlur:de,onAddGTNToDocument:S,riskDetails:d,isRiskAnalysisOpen:L=!1,RiskDetailsCard:$,primaryColorShades:ue,setDisableActions:M,showDeprecatedFieldWarning:O,MasterDataModal:W,parseMasterDataFormula:h,inputEmphasis:C="default"},fe)=>{const{t:xe}=Fe.useTranslation(),g=!!(L&&d?.color),be=C==="modified"&&!s&&!g,pe=C==="deleted"&&!s&&!g,he=C==="success"&&!s&&!g,[m,w]=r.useState(!1),[a,b]=r.useState(null),[u,H]=r.useState(!1),[ge,me]=r.useState(""),[y,P]=r.useState(null),[ke,ve]=r.useState(!1),I=r.useRef(null),F=fe||I;r.useEffect(()=>{const t=()=>{const l=F.current||I.current;l&&ve(l.scrollWidth>l.clientWidth)};return t(),window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[a,o]),r.useEffect(()=>{b(o)},[re,o]),r.useEffect(()=>{a!==null&&a!==o&&B(a,y)},[a,y]);const E=()=>{M?.(!u),H(!u)},je=t=>{if(t.keyCode===9||t.key==="Enter"){const l=F.current||I.current;l&&(b(ge),l.blur())}},Se=(t,l)=>{let _=t;i&&h&&(_=h(i,l)),me(""),b(_),E(),P(l)},Ce=()=>{b(""),P(null)},we=t=>{S&&z&&S({key:z,value:t})},ye=()=>{const t="border h-8 text-sm rounded-lg block w-full p-2.5 pr-16 font-inter font-medium";return s?n(t,"","border-red-300 bg-gray-200 dark:border-black-600 dark:bg-black-600",c||"text-neutral-900 dark:text-black-200"):g&&d?.color?n(t,"",`border-${d.color}-300 bg-${d.color}-50`,c||"text-neutral-900 dark:text-black-200"):pe?n(t,"","border-[var(--Error-200,#FECACA)] bg-[var(--Error-50,#FEF2F2)] !text-[#475467] dark:border-[var(--Error-200,#FECACA)] dark:bg-[var(--Error-50,#FEF2F2)] dark:!text-[#475467]"):be?n(t,"","border-[var(--Warning-200,#FEDF89)] bg-[var(--Warning-50,#FFFAEB)] text-neutral-900 dark:text-black-100 dark:border-[var(--Warning-200,#FEDF89)] dark:bg-[var(--Warning-50,#FFFAEB)]"):he?n(t,"","border-[var(--Success-200,#BBF7D0)] bg-[var(--Success-50,#F0FDF4)] !text-[#101828] dark:border-[var(--Success-200,#BBF7D0)] dark:bg-[var(--Success-50,#F0FDF4)] dark:!text-[#101828]"):n(t,"","border-gray-300 bg-gray-200 dark:border-black-600 dark:bg-black-600",c||"text-neutral-900 dark:text-black-200")},K=()=>a!==null?a:i&&h?h(i,ie):o;return r.useEffect(()=>{u&&!p&&(O?.(),H(!1))},[u,p,O]),e.jsxs("div",{className:n("flex gap-0.5 w-full relative",m&&k?"border rounded-lg border-primary-100 p-1":"",{"error-field":!!s}),onMouseEnter:()=>w(!0),onMouseLeave:()=>w(!1),children:[k&&!m?e.jsx("div",{className:"w-1 h-1 bg-primary-600 rounded-full animate-blink mt-1.5"}):null,e.jsxs("div",{className:n("flex flex-col w-full"),children:[e.jsx("label",{htmlFor:"text",className:`text-xs font-medium text-gray-600 inline-flex items-center gap-1 ${le?"":"capitalize"} ${ne||""}`,children:e.jsxs("div",{className:"grid w-full grid-cols-[minmax(0,1fr)_auto] items-start gap-x-1",children:[e.jsxs("div",{className:"inline-flex min-w-0 items-center gap-1 flex-wrap",children:[e.jsx(Re.InputLabel,{label:J||"",required:A||!1,isRequiredConditional:Z||!1}),ce&&e.jsx(q.BoltOutlined,{sx:{fontSize:16,color:"var(--color-primary-600)",rotate:"15deg"}}),se&&!f.shouldShowConfidenceScore(v)&&e.jsx(Ne.AIExtractedIndicator,{}),e.jsx(qe.Label,{labels:te}),R&&e.jsx(N,{placement:"top",title:`${R}${i?` | ${i}`:""}`,children:e.jsx("div",{className:"cursor-pointer",children:e.jsx(Ae.HelpIcon,{className:"w-icon-sm h-icon-sm"})})}),Q]}),e.jsxs("div",{className:"flex items-center gap-1 justify-self-end",children:[f.shouldShowConfidenceScore(v)&&x?e.jsx(N,{placement:"top-end",title:j??"",hideTooltip:j==null,className:"cursor-pointer",children:e.jsxs("div",{className:n("inline-flex min-w-[50px] items-center gap-1 rounded-md px-1 py-0.5",f.getConfidenceScoreBadgeClass(x)),onClick:()=>oe?.(ae),children:[e.jsx(Be.AIStarIcon,{size:12,fill:f.getConfidenceScoreBadgeColor(x),fillSecondary:f.getConfidenceScoreBadgeFill(x)}),e.jsxs("span",{className:n("text-xs font-medium leading-4",f.getConfidenceScoreBadgeTextColor(x)),children:[v,"%"]})]})}):null,k&&m&&S?e.jsx("button",{id:"btn-master-data-input-add-to-document",className:"cursor-pointer",onClick:()=>we(o?.toString()||""),type:"button",children:e.jsx(Ie.Tooltip,{placement:"top",title:xe("Add to document"),children:e.jsx(q.NoteAddOutlined,{sx:{fontSize:16,color:ue?.[600]||"var(--color-primary-600)"}})})}):null]})]})}),e.jsxs("label",{className:"relative block mt-1",children:[e.jsx(N,{title:ke?K():"",children:e.jsx("input",{id:U,ref:F,required:A,placeholder:X,className:ye(),onChange:t=>{B(t.target.value,y),b(t.target?.value)},onKeyDown:je,value:K(),defaultValue:Y,disabled:!0,autoComplete:"off",onBlur:de})}),e.jsx(D,{id:"btn-dynamic-data-input-rx-cross",onClick:Ce,className:"absolute inset-y-0 right-1 flex items-center px-2 focus:border-transparent",variant:"ghost",disabled:V,children:e.jsx(ze.CloseIcon,{className:"w-6 h-6 text-neutral-500 dark:text-neutral-400 w-sm h-sm"})}),e.jsx(D,{id:"btn-dynamic-data-input-ai-outline-pic-center",onClick:E,className:"absolute inset-y-0 right-8 flex items-center px-2 focus:border-transparent",variant:"ghost",disabled:V,children:e.jsx(q.TableChartRounded,{className:"text-neutral-500 dark:text-neutral-400 w-sm h-sm"})})]}),s&&e.jsx(Ee.Typography,{className:"text-error-500 mt-1",appearance:"custom",size:"extra-small",variant:"medium",children:s}),u&&W&&e.jsx(W,{isVisible:u,onSelected:Se,onClose:E,masterDataColumnName:G,masterDataFilters:ee,masterDataName:p,masterDataId:p,showFilters:!0})]}),m&&d&&L&&$&&e.jsx("div",{role:"tooltip",tabIndex:0,className:"absolute left-0 right-0 top-[95%] mt-1 z-50 bg-white dark:bg-black-600 rounded-xl",onClick:t=>t.stopPropagation(),onMouseDown:t=>t.preventDefault(),onKeyDown:t=>{t.key==="Escape"&&w(!1)},children:e.jsx($,{riskDetails:d})})]})});T.displayName="MasterDataInputField";exports.MasterDataInputField=T;
2
2
  //# sourceMappingURL=MasterDataInputField.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MasterDataInputField.cjs.js","sources":["../../../../src/components/forms/master-data-input/MasterDataInputField.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport cn from \"classnames\";\nimport { forwardRef, useEffect, useRef, useState } from \"react\";\nimport { Tooltip as AntTooltip } from \"antd\";\nimport { useTranslation } from 'react-i18next';\nimport { Typography } from \"../../data-display/typography/Typography\";\nimport { Label } from \"../../data-display/label/Label\";\nimport type { LabelType } from \"../../data-display/label/Label\";\nimport {\n BoltOutlined,\n CloseRounded,\n NoteAddOutlined,\n TableChartRounded,\n} from \"@mui/icons-material\";\nimport { AIExtractedIndicator } from \"../../icons/AIExtractedIndicator\";\nimport { AIStarIcon } from \"../../icons/AIStarIcon\";\nimport { HelpIcon } from \"../../icons/HelpIcon\";\nimport Tooltip from \"../../tooltip/Tooltip\";\nimport IconButton from \"../../button/IconButton\";\nimport { InputLabel } from \"../shared/InputLabel\";\nimport {\n getConfidenceScoreBadgeClass,\n getConfidenceScoreBadgeColor,\n getConfidenceScoreBadgeFill,\n getConfidenceScoreBadgeTextColor,\n shouldShowConfidenceScore,\n} from \"../../../utils/confidenceScoreUtils\";\nimport { CloseIcon, CloseSmallIcon } from \"../../icon\";\n\n/**\n * Confidence score type\n */\nexport type ConfidenceScoreType = \"low\" | \"medium\" | \"high\";\n\nexport type SourceMetaBBox = {\n b: number;\n l: number;\n r: number;\n t: number;\n};\n\nexport type SourceMetaItem = {\n bbox: SourceMetaBBox;\n confidence_score?: number;\n is_primary?: boolean;\n match_score?: number;\n match_type?: string;\n page_height: number;\n page_width: number;\n source_page: number;\n source_text?: string;\n};\n\n/**\n * Risk details interface for risk analysis integration\n */\nexport interface RiskDetails {\n color?: string;\n description?: string;\n hexBgColor?: string;\n hexBorderColor?: string;\n [key: string]: any;\n}\n\n/**\n * Risk details card component props - generic to allow consumer-specific risk types\n */\nexport interface RiskDetailsCardProps<T = any> {\n riskDetails: T;\n maxWidth?: string;\n showAllRisksSuggestions?: boolean;\n}\n\n/** Visual emphasis for the input surface (background + border) */\nexport type MasterDataInputFieldEmphasis =\n | \"default\"\n | \"modified\"\n | \"deleted\"\n | \"success\";\n\n/**\n * Props for the MasterDataModal component\n */\nexport interface MasterDataModalProps {\n isVisible: boolean;\n onSelected?: (masterDataValue: any, masterDataRow?: any) => void;\n onClose: () => void;\n masterDataColumnName?: string;\n masterDataFilters?: any;\n masterDataName?: string;\n masterDataId: string | null;\n showFilters?: boolean;\n}\n\n/**\n * Props for the MasterDataInputField component\n */\nexport interface MasterDataInputFieldProps {\n /** Unique identifier for the input */\n id: string;\n /** Label text to display above the input */\n label: string;\n /** Optional extra content in the label row (e.g. actions, badges) */\n labelExtra?: React.ReactNode;\n /** Placeholder text for the input */\n placeholder?: string;\n /** Current value of the input */\n value: any;\n /** Callback function called when value changes */\n onChange: (value: any, masterDataRowValue?: any) => void;\n /** Error message to display below the input */\n errorMessage?: string;\n /** Callback to set error message */\n setErrorMessage: (message: string) => void;\n /** Callback to remove error message */\n removeErrorMessage: () => void;\n /** Default value for the input */\n defaultValue?: any;\n /** Whether the field is required */\n required?: boolean;\n /** Whether the required indicator shows as conditional (yellow instead of red) */\n isRequiredConditional?: boolean;\n /** Name of the master data source */\n masterDataName: string;\n /** Column name in the master data */\n masterDataColumnName: string;\n /** Formula for computing master data value */\n masterDataFormula?: string;\n /** Filters for master data */\n masterDataFilters?: any;\n /** Tags/labels to display next to the label */\n tags?: (string | LabelType)[];\n /** Index for array fields */\n index?: number;\n /** Tooltip text for the help icon */\n tooltip?: string;\n /** Whether to preserve original case in the label */\n originalCase?: boolean;\n /** Color for the input text */\n color?: string;\n /** Whether this is a GTN (Global Term Name) field */\n isGTN?: boolean;\n /** GTN field name for document integration */\n gtnName?: any;\n /** Whether the value was AI extracted */\n isAiExtracted?: boolean;\n /** Confidence percentage shown as a badge */\n confidenceScore?: number;\n /** Confidence classification for badge styling */\n confidenceType?: ConfidenceScoreType;\n /** Optional tooltip content for confidence badge */\n confidenceTooltip?: React.ReactNode;\n /** Source meta for confidence score */\n sourceMeta?: SourceMetaItem[];\n /** Handler fired when confidence score badge is clicked */\n onConfidenceScoreClick?: (sourceMeta: SourceMetaItem[]) => void;\n /** Reference data for formula computation */\n reference?: any;\n /** Whether the input is disabled */\n disabled?: boolean;\n /** Additional CSS classes for the label */\n labelClassName?: string;\n /** Whether this is a live field */\n isLiveField?: boolean;\n /** Callback function called when input loses focus */\n onBlur?: () => void;\n /** Handler for adding GTN to document */\n onAddGTNToDocument?: (keyValuePair: { key: string; value: string }) => void;\n /** Risk details data */\n riskDetails?: RiskDetails;\n /** Whether risk analysis is open */\n isRiskAnalysisOpen?: boolean;\n /** Custom risk details card component */\n RiskDetailsCard?: React.ComponentType<RiskDetailsCardProps<any>>;\n /** Primary color shades for styling */\n primaryColorShades?: Record<number, string>;\n /** Callback to set disable actions state */\n setDisableActions?: (disabled: boolean) => void;\n /** Toast function for deprecated field warning */\n showDeprecatedFieldWarning?: () => void;\n /** Master data modal component */\n MasterDataModal?: React.ComponentType<MasterDataModalProps>;\n /** Function to parse master data formula */\n parseMasterDataFormula?: (formula: string, row: any) => string;\n /** Input surface style: `'modified'` — `--Warning-50` / `--Warning-200`; `'deleted'` — `--Error-50` / `--Error-200`, text `#475467`; `'success'` — `--Success-50` / `--Success-200`, text `#101828`. */\n inputEmphasis?: MasterDataInputFieldEmphasis;\n}\n\n/**\n * A highly customizable master data input component with label, validation, and styling support.\n * Features master data modal integration, GTN support, risk analysis support,\n * and comprehensive prop support for various use cases.\n *\n * @example\n * ```tsx\n * <MasterDataInputField\n * id=\"master-field\"\n * label=\"Master Field\"\n * value={fieldValue}\n * onChange={(value, rowValue) => setFieldValue(value)}\n * setErrorMessage={(msg) => setError(msg)}\n * removeErrorMessage={() => setError('')}\n * masterDataName=\"customers\"\n * masterDataColumnName=\"name\"\n * required\n * />\n * ```\n */\nexport const MasterDataInputField = forwardRef<\n HTMLInputElement,\n MasterDataInputFieldProps\n>(\n (\n {\n id,\n label,\n labelExtra,\n placeholder,\n value,\n onChange,\n errorMessage,\n defaultValue,\n required = false,\n isRequiredConditional = false,\n masterDataName,\n masterDataColumnName,\n masterDataFormula,\n masterDataFilters,\n tags,\n index,\n tooltip = \"\",\n originalCase = false,\n color = \"\",\n isGTN = false,\n labelClassName,\n gtnName = null,\n isAiExtracted = false,\n confidenceScore,\n confidenceType = \"high\",\n confidenceTooltip,\n sourceMeta = [],\n onConfidenceScoreClick,\n disabled = false,\n reference = {},\n isLiveField = false,\n onBlur,\n onAddGTNToDocument,\n riskDetails,\n isRiskAnalysisOpen = false,\n RiskDetailsCard,\n primaryColorShades,\n setDisableActions,\n showDeprecatedFieldWarning,\n MasterDataModal,\n parseMasterDataFormula,\n inputEmphasis = \"default\",\n },\n ref\n ) => {\n const { t } = useTranslation();\n const showRiskSkin = Boolean(isRiskAnalysisOpen && riskDetails?.color);\n const emphasisModifiedSkin =\n inputEmphasis === \"modified\" && !errorMessage && !showRiskSkin;\n const emphasisDeletedSkin =\n inputEmphasis === \"deleted\" && !errorMessage && !showRiskSkin;\n const emphasisSuccessSkin =\n inputEmphasis === \"success\" && !errorMessage && !showRiskSkin;\n const [isHovered, setIsHovered] = useState(false);\n const [inputValue, setInputValue] = useState<string | null>(null);\n const [showMasterDataModal, setShowMasterDataModal] = useState(false);\n const [suggestion, setSuggestion] = useState(\"\");\n const [masterDataRowValue, setMasterDataRowValue] = useState<any>(null);\n const [isTextOverflowing, setIsTextOverflowing] = useState(false);\n\n const inputRef = useRef<HTMLInputElement>(null);\n\n // Use forwarded ref or internal ref\n const combinedRef = (ref as React.RefObject<HTMLInputElement>) || inputRef;\n\n // Check if text is overflowing\n useEffect(() => {\n const checkOverflow = () => {\n const input = combinedRef.current || inputRef.current;\n if (input) {\n setIsTextOverflowing(input.scrollWidth > input.clientWidth);\n }\n };\n\n checkOverflow();\n // Recheck on window resize\n window.addEventListener('resize', checkOverflow);\n return () => window.removeEventListener('resize', checkOverflow);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [inputValue, value]);\n\n useEffect(() => {\n setInputValue(value);\n }, [index, value]);\n\n useEffect(() => {\n if (inputValue !== null && inputValue !== value) {\n onChange(inputValue, masterDataRowValue);\n }\n }, [inputValue, masterDataRowValue]);\n\n const toggleMasterDataModal = () => {\n if (showMasterDataModal) {\n setDisableActions?.(false);\n } else {\n setDisableActions?.(true);\n }\n setShowMasterDataModal(!showMasterDataModal);\n };\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (event.keyCode === 9 || event.key === \"Enter\") {\n const currentRef = combinedRef.current || inputRef.current;\n if (currentRef) {\n setInputValue(suggestion);\n currentRef.blur();\n }\n }\n };\n\n const handleSetMasterData = (masterDataValue: any, masterDataRow?: any) => {\n let _value = masterDataValue;\n\n if (masterDataFormula && parseMasterDataFormula) {\n _value = parseMasterDataFormula(masterDataFormula, masterDataRow);\n }\n\n setSuggestion(\"\");\n setInputValue(_value);\n toggleMasterDataModal();\n setMasterDataRowValue(masterDataRow);\n };\n\n const handleClear = () => {\n setInputValue(\"\");\n setMasterDataRowValue(null);\n };\n\n const handleAddGTNToDocument = (_value: string) => {\n if (onAddGTNToDocument && gtnName) {\n const keyValuePair = {\n key: gtnName,\n value: _value,\n };\n onAddGTNToDocument(keyValuePair);\n }\n };\n\n const getClassName = (): string => {\n const baseClasses =\n \"border h-8 text-sm rounded-lg block w-full p-2.5 pr-16 font-inter font-medium\";\n const placeholderColor = `placeholder:text-neutral-900 dark:placeholder:text-black-400`;\n\n if (errorMessage) {\n return cn(\n baseClasses,\n placeholderColor,\n \"border-red-300 bg-gray-200 dark:border-black-600 dark:bg-black-600\",\n color ? color : \"text-neutral-900 dark:text-black-200\"\n );\n }\n if (showRiskSkin && riskDetails?.color) {\n return cn(\n baseClasses,\n placeholderColor,\n `border-${riskDetails.color}-300 bg-${riskDetails.color}-50`,\n color ? color : \"text-neutral-900 dark:text-black-200\"\n );\n }\n if (emphasisDeletedSkin) {\n return cn(\n baseClasses,\n placeholderColor,\n \"border-[var(--Error-200,#FECACA)] bg-[var(--Error-50,#FEF2F2)] !text-[#475467] dark:border-[var(--Error-200,#FECACA)] dark:bg-[var(--Error-50,#FEF2F2)] dark:!text-[#475467]\"\n );\n }\n if (emphasisModifiedSkin) {\n return cn(\n baseClasses,\n placeholderColor,\n \"border-[var(--Warning-200,#FEDF89)] bg-[var(--Warning-50,#FFFAEB)] text-neutral-900 dark:text-black-100 dark:border-[var(--Warning-200,#FEDF89)] dark:bg-[var(--Warning-50,#FFFAEB)]\"\n );\n }\n if (emphasisSuccessSkin) {\n return cn(\n baseClasses,\n placeholderColor,\n \"border-[var(--Success-200,#BBF7D0)] bg-[var(--Success-50,#F0FDF4)] !text-[#101828] dark:border-[var(--Success-200,#BBF7D0)] dark:bg-[var(--Success-50,#F0FDF4)] dark:!text-[#101828]\"\n );\n }\n\n return cn(\n baseClasses,\n placeholderColor,\n \"border-gray-300 bg-gray-200 dark:border-black-600 dark:bg-black-600\",\n color ? color : \"text-neutral-900 dark:text-black-200\"\n );\n };\n\n const resolveMasterDataValue = () => {\n if (inputValue !== null) {\n return inputValue;\n }\n if (masterDataFormula && parseMasterDataFormula) {\n return parseMasterDataFormula(masterDataFormula, reference);\n }\n\n return value;\n };\n\n useEffect(() => {\n if (showMasterDataModal && !masterDataName) {\n showDeprecatedFieldWarning?.();\n setShowMasterDataModal(false);\n }\n }, [showMasterDataModal, masterDataName, showDeprecatedFieldWarning]);\n\n return (\n <div\n className={cn(\n `flex gap-0.5 w-full relative`,\n isHovered && isGTN\n ? \"border rounded-lg border-primary-100 p-1\"\n : \"\",\n { \"error-field\": !!errorMessage }\n )}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n >\n {isGTN && !isHovered ? (\n <div className=\"w-1 h-1 bg-primary-600 rounded-full animate-blink mt-1.5\" />\n ) : null}\n\n <div className={cn(`flex flex-col w-full`)}>\n <label\n htmlFor=\"text\"\n className={`text-xs font-medium text-gray-600 inline-flex items-center gap-1 ${\n !originalCase ? \"capitalize\" : \"\"\n } ${labelClassName || \"\"}`}\n >\n <div className=\"grid w-full grid-cols-[minmax(0,1fr)_auto] items-start gap-x-1\">\n <div className=\"inline-flex min-w-0 items-center gap-1 flex-wrap\">\n <InputLabel label={label || \"\"} required={required || false} isRequiredConditional={isRequiredConditional || false} />\n {isLiveField && (\n <BoltOutlined\n sx={{\n fontSize: 16,\n color: \"var(--color-primary-600)\",\n rotate: \"15deg\",\n }}\n />\n )}\n {isAiExtracted && !shouldShowConfidenceScore(confidenceScore) && <AIExtractedIndicator />}\n <Label labels={tags} />\n {tooltip && (\n <Tooltip\n placement=\"top\"\n title={`${tooltip}${masterDataFormula ? ` | ${masterDataFormula}` : \"\"}`}\n >\n <div className=\"cursor-pointer\">\n <HelpIcon className=\"w-icon-sm h-icon-sm\" />\n </div>\n </Tooltip>\n )}\n {labelExtra}\n </div>\n\n <div className=\"flex items-center gap-1 justify-self-end\">\n {(shouldShowConfidenceScore(confidenceScore) && confidenceType) ? (\n <Tooltip\n placement=\"top-end\"\n title={confidenceTooltip ?? \"\"}\n hideTooltip={confidenceTooltip === undefined || confidenceTooltip === null}\n className=\"cursor-pointer\"\n >\n <div\n className={cn(\n \"inline-flex min-w-[50px] items-center gap-1 rounded-md px-1 py-0.5\",\n getConfidenceScoreBadgeClass(confidenceType)\n )}\n onClick={() => onConfidenceScoreClick?.(sourceMeta)}\n >\n <AIStarIcon\n size={12}\n fill={getConfidenceScoreBadgeColor(confidenceType)}\n fillSecondary={getConfidenceScoreBadgeFill(confidenceType)}\n />\n <span className={cn(\"text-xs font-medium leading-4\", getConfidenceScoreBadgeTextColor(confidenceType))}>\n {confidenceScore}%\n </span>\n </div>\n </Tooltip>\n ) : null}\n {isGTN && isHovered && onAddGTNToDocument ? (\n <button\n id=\"btn-master-data-input-add-to-document\"\n className=\"cursor-pointer\"\n onClick={() => handleAddGTNToDocument(value?.toString() || \"\")}\n type=\"button\"\n >\n <AntTooltip placement=\"top\" title={t(\"Add to document\")}>\n <NoteAddOutlined\n sx={{\n fontSize: 16,\n color:\n primaryColorShades?.[600] || \"var(--color-primary-600)\",\n }}\n />\n </AntTooltip>\n </button>\n ) : null}\n </div>\n </div>\n </label>\n <label className=\"relative block mt-1\">\n <Tooltip\n title={isTextOverflowing ? resolveMasterDataValue() : \"\"}\n >\n <input\n id={id}\n ref={combinedRef}\n required={required}\n placeholder={placeholder}\n className={getClassName()}\n onChange={(e) => {\n onChange(e.target.value, masterDataRowValue);\n setInputValue(e.target?.value);\n }}\n onKeyDown={handleKeyDown}\n value={resolveMasterDataValue()}\n defaultValue={defaultValue}\n disabled={true}\n autoComplete=\"off\"\n onBlur={onBlur}\n />\n </Tooltip>\n\n <IconButton\n id={`btn-dynamic-data-input-rx-cross`}\n onClick={handleClear}\n className=\"absolute inset-y-0 right-1 flex items-center px-2 focus:border-transparent\"\n variant=\"ghost\"\n disabled={disabled}\n >\n <CloseIcon className=\"w-6 h-6 text-neutral-500 dark:text-neutral-400 w-sm h-sm\" />\n </IconButton>\n\n <IconButton\n id={`btn-dynamic-data-input-ai-outline-pic-center`}\n onClick={toggleMasterDataModal}\n className=\"absolute inset-y-0 right-8 flex items-center px-2 focus:border-transparent\"\n variant=\"ghost\"\n disabled={disabled}\n >\n <TableChartRounded\n className=\"text-neutral-500 dark:text-neutral-400 w-sm h-sm\"\n />\n </IconButton>\n </label>\n\n {errorMessage && (\n <Typography\n className=\"text-error-500 mt-1\"\n appearance=\"custom\"\n size=\"extra-small\"\n variant=\"medium\"\n >\n {errorMessage}\n </Typography>\n )}\n\n {showMasterDataModal && MasterDataModal && (\n <MasterDataModal\n isVisible={showMasterDataModal}\n onSelected={handleSetMasterData}\n onClose={toggleMasterDataModal}\n masterDataColumnName={masterDataColumnName}\n masterDataFilters={masterDataFilters}\n masterDataName={masterDataName}\n masterDataId={masterDataName}\n showFilters\n />\n )}\n </div>\n\n {isHovered &&\n riskDetails &&\n isRiskAnalysisOpen &&\n RiskDetailsCard && (\n <div\n role=\"tooltip\"\n tabIndex={0}\n className=\"absolute left-0 right-0 top-[95%] mt-1 z-50 bg-white dark:bg-black-600 rounded-xl\"\n onClick={(e) => e.stopPropagation()}\n onMouseDown={(e) => e.preventDefault()}\n onKeyDown={(e) => {\n if (e.key === \"Escape\") {\n setIsHovered(false);\n }\n }}\n >\n <RiskDetailsCard riskDetails={riskDetails} />\n </div>\n )}\n </div>\n );\n }\n);\n\nMasterDataInputField.displayName = \"MasterDataInputField\";\n\n"],"names":["MasterDataInputField","forwardRef","id","label","labelExtra","placeholder","value","onChange","errorMessage","defaultValue","required","isRequiredConditional","masterDataName","masterDataColumnName","masterDataFormula","masterDataFilters","tags","index","tooltip","originalCase","color","isGTN","labelClassName","gtnName","isAiExtracted","confidenceScore","confidenceType","confidenceTooltip","sourceMeta","onConfidenceScoreClick","disabled","reference","isLiveField","onBlur","onAddGTNToDocument","riskDetails","isRiskAnalysisOpen","RiskDetailsCard","primaryColorShades","setDisableActions","showDeprecatedFieldWarning","MasterDataModal","parseMasterDataFormula","inputEmphasis","ref","t","useTranslation","showRiskSkin","emphasisModifiedSkin","emphasisDeletedSkin","emphasisSuccessSkin","isHovered","setIsHovered","useState","inputValue","setInputValue","showMasterDataModal","setShowMasterDataModal","suggestion","setSuggestion","masterDataRowValue","setMasterDataRowValue","isTextOverflowing","setIsTextOverflowing","inputRef","useRef","combinedRef","useEffect","checkOverflow","input","toggleMasterDataModal","handleKeyDown","event","currentRef","handleSetMasterData","masterDataValue","masterDataRow","_value","handleClear","handleAddGTNToDocument","getClassName","baseClasses","placeholderColor","cn","resolveMasterDataValue","jsxs","jsx","InputLabel","BoltOutlined","shouldShowConfidenceScore","AIExtractedIndicator","Label","Tooltip","HelpIcon","getConfidenceScoreBadgeClass","AIStarIcon","getConfidenceScoreBadgeColor","getConfidenceScoreBadgeFill","getConfidenceScoreBadgeTextColor","AntTooltip","NoteAddOutlined","e","IconButton","CloseIcon","TableChartRounded","Typography"],"mappings":"0uBAgNaA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ACT,qBAAAzD,EACA,kBAAAE,GACA,eAAAH,EACA,aAAcA,EACd,YAAW,EAAA,CAAA,CACb,EAEJ,EAECuC,GACChB,GACAC,GACAC,GACEiD,EAAAA,IAAC,MAAA,CACC,KAAK,UACL,SAAU,EACV,UAAU,oFACV,QAAUe,GAAMA,EAAE,gBAAA,EAClB,YAAcA,GAAMA,EAAE,eAAA,EACtB,UAAYA,GAAM,CACZA,EAAE,MAAQ,UACZjD,EAAa,EAAK,CAEtB,EAEA,SAAAkC,EAAAA,IAACjD,GAAgB,YAAAF,CAAA,CAA0B,CAAA,CAAA,CAC7C,CAAA,CAAA,CAIV,CACF,EAEAnC,EAAqB,YAAc"}
1
+ {"version":3,"file":"MasterDataInputField.cjs.js","sources":["../../../../src/components/forms/master-data-input/MasterDataInputField.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport cn from \"classnames\";\nimport { forwardRef, useEffect, useRef, useState } from \"react\";\nimport { Tooltip as AntTooltip } from \"antd\";\nimport { useTranslation } from 'react-i18next';\nimport { Typography } from \"../../data-display/typography/Typography\";\nimport { Label } from \"../../data-display/label/Label\";\nimport type { LabelType } from \"../../data-display/label/Label\";\nimport {\n BoltOutlined,\n CloseRounded,\n NoteAddOutlined,\n TableChartRounded,\n} from \"@mui/icons-material\";\nimport { AIExtractedIndicator } from \"../../icons/AIExtractedIndicator\";\nimport { AIStarIcon } from \"../../icons/AIStarIcon\";\nimport { HelpIcon } from \"../../icons/HelpIcon\";\nimport Tooltip from \"../../tooltip/Tooltip\";\nimport IconButton from \"../../button/IconButton\";\nimport { InputLabel } from \"../shared/InputLabel\";\nimport {\n getConfidenceScoreBadgeClass,\n getConfidenceScoreBadgeColor,\n getConfidenceScoreBadgeFill,\n getConfidenceScoreBadgeTextColor,\n shouldShowConfidenceScore,\n} from \"../../../utils/confidenceScoreUtils\";\nimport { CloseIcon, CloseSmallIcon } from \"../../icon\";\n\n/**\n * Confidence score type\n */\nexport type ConfidenceScoreType = \"low\" | \"medium\" | \"high\";\n\nexport type SourceMetaBBox = {\n b: number;\n l: number;\n r: number;\n t: number;\n};\n\nexport type SourceMetaItem = {\n bbox: SourceMetaBBox;\n confidence_score?: number;\n is_primary?: boolean;\n match_score?: number;\n match_type?: string;\n page_height: number;\n page_width: number;\n source_page: number;\n source_text?: string;\n};\n\n/**\n * Risk details interface for risk analysis integration\n */\nexport interface RiskDetails {\n color?: string;\n description?: string;\n hexBgColor?: string;\n hexBorderColor?: string;\n [key: string]: any;\n}\n\n/**\n * Risk details card component props - generic to allow consumer-specific risk types\n */\nexport interface RiskDetailsCardProps<T = any> {\n riskDetails: T;\n maxWidth?: string;\n showAllRisksSuggestions?: boolean;\n}\n\n/** Visual emphasis for the input surface (background + border) */\nexport type MasterDataInputFieldEmphasis =\n | \"default\"\n | \"modified\"\n | \"deleted\"\n | \"success\";\n\n/**\n * Props for the MasterDataModal component\n */\nexport interface MasterDataModalProps {\n isVisible: boolean;\n onSelected?: (masterDataValue: any, masterDataRow?: any) => void;\n onClose: () => void;\n masterDataColumnName?: string;\n masterDataFilters?: any;\n masterDataName?: string;\n masterDataId: string | null;\n showFilters?: boolean;\n}\n\n/**\n * Props for the MasterDataInputField component\n */\nexport interface MasterDataInputFieldProps {\n /** Unique identifier for the input */\n id: string;\n /** Label text to display above the input */\n label: string;\n /** Optional extra content in the label row (e.g. actions, badges) */\n labelExtra?: React.ReactNode;\n /** Placeholder text for the input */\n placeholder?: string;\n /** Current value of the input */\n value: any;\n /** Callback function called when value changes */\n onChange: (value: any, masterDataRowValue?: any) => void;\n /** Error message to display below the input */\n errorMessage?: string;\n /** Callback to set error message */\n setErrorMessage: (message: string) => void;\n /** Callback to remove error message */\n removeErrorMessage: () => void;\n /** Default value for the input */\n defaultValue?: any;\n /** Whether the field is required */\n required?: boolean;\n /** Whether the required indicator shows as conditional (yellow instead of red) */\n isRequiredConditional?: boolean;\n /** Name of the master data source */\n masterDataName: string;\n /** Column name in the master data */\n masterDataColumnName: string;\n /** Formula for computing master data value */\n masterDataFormula?: string;\n /** Filters for master data */\n masterDataFilters?: any;\n /** Tags/labels to display next to the label */\n tags?: (string | LabelType)[];\n /** Index for array fields */\n index?: number;\n /** Tooltip text for the help icon */\n tooltip?: string;\n /** Whether to preserve original case in the label */\n originalCase?: boolean;\n /** Color for the input text */\n color?: string;\n /** Whether this is a GTN (Global Term Name) field */\n isGTN?: boolean;\n /** GTN field name for document integration */\n gtnName?: any;\n /** Whether the value was AI extracted */\n isAiExtracted?: boolean;\n /** Confidence percentage shown as a badge */\n confidenceScore?: number;\n /** Confidence classification for badge styling */\n confidenceType?: ConfidenceScoreType;\n /** Optional tooltip content for confidence badge */\n confidenceTooltip?: React.ReactNode;\n /** Source meta for confidence score */\n sourceMeta?: SourceMetaItem[];\n /** Handler fired when confidence score badge is clicked */\n onConfidenceScoreClick?: (sourceMeta: SourceMetaItem[]) => void;\n /** Reference data for formula computation */\n reference?: any;\n /** Whether the input is disabled */\n disabled?: boolean;\n /** Additional CSS classes for the label */\n labelClassName?: string;\n /** Whether this is a live field */\n isLiveField?: boolean;\n /** Callback function called when input loses focus */\n onBlur?: () => void;\n /** Handler for adding GTN to document */\n onAddGTNToDocument?: (keyValuePair: { key: string; value: string }) => void;\n /** Risk details data */\n riskDetails?: RiskDetails;\n /** Whether risk analysis is open */\n isRiskAnalysisOpen?: boolean;\n /** Custom risk details card component */\n RiskDetailsCard?: React.ComponentType<RiskDetailsCardProps<any>>;\n /** Primary color shades for styling */\n primaryColorShades?: Record<number, string>;\n /** Callback to set disable actions state */\n setDisableActions?: (disabled: boolean) => void;\n /** Toast function for deprecated field warning */\n showDeprecatedFieldWarning?: () => void;\n /** Master data modal component */\n MasterDataModal?: React.ComponentType<MasterDataModalProps>;\n /** Function to parse master data formula */\n parseMasterDataFormula?: (formula: string, row: any) => string;\n /** Input surface style: `'modified'` — `--Warning-50` / `--Warning-200`; `'deleted'` — `--Error-50` / `--Error-200`, text `#475467`; `'success'` — `--Success-50` / `--Success-200`, text `#101828`. */\n inputEmphasis?: MasterDataInputFieldEmphasis;\n}\n\n/**\n * A highly customizable master data input component with label, validation, and styling support.\n * Features master data modal integration, GTN support, risk analysis support,\n * and comprehensive prop support for various use cases.\n *\n * @example\n * ```tsx\n * <MasterDataInputField\n * id=\"master-field\"\n * label=\"Master Field\"\n * value={fieldValue}\n * onChange={(value, rowValue) => setFieldValue(value)}\n * setErrorMessage={(msg) => setError(msg)}\n * removeErrorMessage={() => setError('')}\n * masterDataName=\"customers\"\n * masterDataColumnName=\"name\"\n * required\n * />\n * ```\n */\nexport const MasterDataInputField = forwardRef<\n HTMLInputElement,\n MasterDataInputFieldProps\n>(\n (\n {\n id,\n label,\n labelExtra,\n placeholder,\n value,\n onChange,\n errorMessage,\n defaultValue,\n required = false,\n isRequiredConditional = false,\n masterDataName,\n masterDataColumnName,\n masterDataFormula,\n masterDataFilters,\n tags,\n index,\n tooltip = \"\",\n originalCase = false,\n color = \"\",\n isGTN = false,\n labelClassName,\n gtnName = null,\n isAiExtracted = false,\n confidenceScore,\n confidenceType = \"high\",\n confidenceTooltip,\n sourceMeta = [],\n onConfidenceScoreClick,\n disabled = false,\n reference = {},\n isLiveField = false,\n onBlur,\n onAddGTNToDocument,\n riskDetails,\n isRiskAnalysisOpen = false,\n RiskDetailsCard,\n primaryColorShades,\n setDisableActions,\n showDeprecatedFieldWarning,\n MasterDataModal,\n parseMasterDataFormula,\n inputEmphasis = \"default\",\n },\n ref\n ) => {\n const { t } = useTranslation();\n const showRiskSkin = Boolean(isRiskAnalysisOpen && riskDetails?.color);\n const emphasisModifiedSkin =\n inputEmphasis === \"modified\" && !errorMessage && !showRiskSkin;\n const emphasisDeletedSkin =\n inputEmphasis === \"deleted\" && !errorMessage && !showRiskSkin;\n const emphasisSuccessSkin =\n inputEmphasis === \"success\" && !errorMessage && !showRiskSkin;\n const [isHovered, setIsHovered] = useState(false);\n const [inputValue, setInputValue] = useState<string | null>(null);\n const [showMasterDataModal, setShowMasterDataModal] = useState(false);\n const [suggestion, setSuggestion] = useState(\"\");\n const [masterDataRowValue, setMasterDataRowValue] = useState<any>(null);\n const [isTextOverflowing, setIsTextOverflowing] = useState(false);\n\n const inputRef = useRef<HTMLInputElement>(null);\n\n // Use forwarded ref or internal ref\n const combinedRef = (ref as React.RefObject<HTMLInputElement>) || inputRef;\n\n // Check if text is overflowing\n useEffect(() => {\n const checkOverflow = () => {\n const input = combinedRef.current || inputRef.current;\n if (input) {\n setIsTextOverflowing(input.scrollWidth > input.clientWidth);\n }\n };\n\n checkOverflow();\n // Recheck on window resize\n window.addEventListener('resize', checkOverflow);\n return () => window.removeEventListener('resize', checkOverflow);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [inputValue, value]);\n\n useEffect(() => {\n setInputValue(value);\n }, [index, value]);\n\n useEffect(() => {\n if (inputValue !== null && inputValue !== value) {\n onChange(inputValue, masterDataRowValue);\n }\n }, [inputValue, masterDataRowValue]);\n\n const toggleMasterDataModal = () => {\n if (showMasterDataModal) {\n setDisableActions?.(false);\n } else {\n setDisableActions?.(true);\n }\n setShowMasterDataModal(!showMasterDataModal);\n };\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (event.keyCode === 9 || event.key === \"Enter\") {\n const currentRef = combinedRef.current || inputRef.current;\n if (currentRef) {\n setInputValue(suggestion);\n currentRef.blur();\n }\n }\n };\n\n const handleSetMasterData = (masterDataValue: any, masterDataRow?: any) => {\n let _value = masterDataValue;\n\n if (masterDataFormula && parseMasterDataFormula) {\n _value = parseMasterDataFormula(masterDataFormula, masterDataRow);\n }\n\n setSuggestion(\"\");\n setInputValue(_value);\n toggleMasterDataModal();\n setMasterDataRowValue(masterDataRow);\n };\n\n const handleClear = () => {\n setInputValue(\"\");\n setMasterDataRowValue(null);\n };\n\n const handleAddGTNToDocument = (_value: string) => {\n if (onAddGTNToDocument && gtnName) {\n const keyValuePair = {\n key: gtnName,\n value: _value,\n };\n onAddGTNToDocument(keyValuePair);\n }\n };\n\n const getClassName = (): string => {\n const baseClasses =\n \"border h-8 text-sm rounded-lg block w-full p-2.5 pr-16 font-inter font-medium\";\n const placeholderColor = ``;\n\n if (errorMessage) {\n return cn(\n baseClasses,\n placeholderColor,\n \"border-red-300 bg-gray-200 dark:border-black-600 dark:bg-black-600\",\n color ? color : \"text-neutral-900 dark:text-black-200\"\n );\n }\n if (showRiskSkin && riskDetails?.color) {\n return cn(\n baseClasses,\n placeholderColor,\n `border-${riskDetails.color}-300 bg-${riskDetails.color}-50`,\n color ? color : \"text-neutral-900 dark:text-black-200\"\n );\n }\n if (emphasisDeletedSkin) {\n return cn(\n baseClasses,\n placeholderColor,\n \"border-[var(--Error-200,#FECACA)] bg-[var(--Error-50,#FEF2F2)] !text-[#475467] dark:border-[var(--Error-200,#FECACA)] dark:bg-[var(--Error-50,#FEF2F2)] dark:!text-[#475467]\"\n );\n }\n if (emphasisModifiedSkin) {\n return cn(\n baseClasses,\n placeholderColor,\n \"border-[var(--Warning-200,#FEDF89)] bg-[var(--Warning-50,#FFFAEB)] text-neutral-900 dark:text-black-100 dark:border-[var(--Warning-200,#FEDF89)] dark:bg-[var(--Warning-50,#FFFAEB)]\"\n );\n }\n if (emphasisSuccessSkin) {\n return cn(\n baseClasses,\n placeholderColor,\n \"border-[var(--Success-200,#BBF7D0)] bg-[var(--Success-50,#F0FDF4)] !text-[#101828] dark:border-[var(--Success-200,#BBF7D0)] dark:bg-[var(--Success-50,#F0FDF4)] dark:!text-[#101828]\"\n );\n }\n\n return cn(\n baseClasses,\n placeholderColor,\n \"border-gray-300 bg-gray-200 dark:border-black-600 dark:bg-black-600\",\n color ? color : \"text-neutral-900 dark:text-black-200\"\n );\n };\n\n const resolveMasterDataValue = () => {\n if (inputValue !== null) {\n return inputValue;\n }\n if (masterDataFormula && parseMasterDataFormula) {\n return parseMasterDataFormula(masterDataFormula, reference);\n }\n\n return value;\n };\n\n useEffect(() => {\n if (showMasterDataModal && !masterDataName) {\n showDeprecatedFieldWarning?.();\n setShowMasterDataModal(false);\n }\n }, [showMasterDataModal, masterDataName, showDeprecatedFieldWarning]);\n\n return (\n <div\n className={cn(\n `flex gap-0.5 w-full relative`,\n isHovered && isGTN\n ? \"border rounded-lg border-primary-100 p-1\"\n : \"\",\n { \"error-field\": !!errorMessage }\n )}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n >\n {isGTN && !isHovered ? (\n <div className=\"w-1 h-1 bg-primary-600 rounded-full animate-blink mt-1.5\" />\n ) : null}\n\n <div className={cn(`flex flex-col w-full`)}>\n <label\n htmlFor=\"text\"\n className={`text-xs font-medium text-gray-600 inline-flex items-center gap-1 ${\n !originalCase ? \"capitalize\" : \"\"\n } ${labelClassName || \"\"}`}\n >\n <div className=\"grid w-full grid-cols-[minmax(0,1fr)_auto] items-start gap-x-1\">\n <div className=\"inline-flex min-w-0 items-center gap-1 flex-wrap\">\n <InputLabel label={label || \"\"} required={required || false} isRequiredConditional={isRequiredConditional || false} />\n {isLiveField && (\n <BoltOutlined\n sx={{\n fontSize: 16,\n color: \"var(--color-primary-600)\",\n rotate: \"15deg\",\n }}\n />\n )}\n {isAiExtracted && !shouldShowConfidenceScore(confidenceScore) && <AIExtractedIndicator />}\n <Label labels={tags} />\n {tooltip && (\n <Tooltip\n placement=\"top\"\n title={`${tooltip}${masterDataFormula ? ` | ${masterDataFormula}` : \"\"}`}\n >\n <div className=\"cursor-pointer\">\n <HelpIcon className=\"w-icon-sm h-icon-sm\" />\n </div>\n </Tooltip>\n )}\n {labelExtra}\n </div>\n\n <div className=\"flex items-center gap-1 justify-self-end\">\n {(shouldShowConfidenceScore(confidenceScore) && confidenceType) ? (\n <Tooltip\n placement=\"top-end\"\n title={confidenceTooltip ?? \"\"}\n hideTooltip={confidenceTooltip === undefined || confidenceTooltip === null}\n className=\"cursor-pointer\"\n >\n <div\n className={cn(\n \"inline-flex min-w-[50px] items-center gap-1 rounded-md px-1 py-0.5\",\n getConfidenceScoreBadgeClass(confidenceType)\n )}\n onClick={() => onConfidenceScoreClick?.(sourceMeta)}\n >\n <AIStarIcon\n size={12}\n fill={getConfidenceScoreBadgeColor(confidenceType)}\n fillSecondary={getConfidenceScoreBadgeFill(confidenceType)}\n />\n <span className={cn(\"text-xs font-medium leading-4\", getConfidenceScoreBadgeTextColor(confidenceType))}>\n {confidenceScore}%\n </span>\n </div>\n </Tooltip>\n ) : null}\n {isGTN && isHovered && onAddGTNToDocument ? (\n <button\n id=\"btn-master-data-input-add-to-document\"\n className=\"cursor-pointer\"\n onClick={() => handleAddGTNToDocument(value?.toString() || \"\")}\n type=\"button\"\n >\n <AntTooltip placement=\"top\" title={t(\"Add to document\")}>\n <NoteAddOutlined\n sx={{\n fontSize: 16,\n color:\n primaryColorShades?.[600] || \"var(--color-primary-600)\",\n }}\n />\n </AntTooltip>\n </button>\n ) : null}\n </div>\n </div>\n </label>\n <label className=\"relative block mt-1\">\n <Tooltip\n title={isTextOverflowing ? resolveMasterDataValue() : \"\"}\n >\n <input\n id={id}\n ref={combinedRef}\n required={required}\n placeholder={placeholder}\n className={getClassName()}\n onChange={(e) => {\n onChange(e.target.value, masterDataRowValue);\n setInputValue(e.target?.value);\n }}\n onKeyDown={handleKeyDown}\n value={resolveMasterDataValue()}\n defaultValue={defaultValue}\n disabled={true}\n autoComplete=\"off\"\n onBlur={onBlur}\n />\n </Tooltip>\n\n <IconButton\n id={`btn-dynamic-data-input-rx-cross`}\n onClick={handleClear}\n className=\"absolute inset-y-0 right-1 flex items-center px-2 focus:border-transparent\"\n variant=\"ghost\"\n disabled={disabled}\n >\n <CloseIcon className=\"w-6 h-6 text-neutral-500 dark:text-neutral-400 w-sm h-sm\" />\n </IconButton>\n\n <IconButton\n id={`btn-dynamic-data-input-ai-outline-pic-center`}\n onClick={toggleMasterDataModal}\n className=\"absolute inset-y-0 right-8 flex items-center px-2 focus:border-transparent\"\n variant=\"ghost\"\n disabled={disabled}\n >\n <TableChartRounded\n className=\"text-neutral-500 dark:text-neutral-400 w-sm h-sm\"\n />\n </IconButton>\n </label>\n\n {errorMessage && (\n <Typography\n className=\"text-error-500 mt-1\"\n appearance=\"custom\"\n size=\"extra-small\"\n variant=\"medium\"\n >\n {errorMessage}\n </Typography>\n )}\n\n {showMasterDataModal && MasterDataModal && (\n <MasterDataModal\n isVisible={showMasterDataModal}\n onSelected={handleSetMasterData}\n onClose={toggleMasterDataModal}\n masterDataColumnName={masterDataColumnName}\n masterDataFilters={masterDataFilters}\n masterDataName={masterDataName}\n masterDataId={masterDataName}\n showFilters\n />\n )}\n </div>\n\n {isHovered &&\n riskDetails &&\n isRiskAnalysisOpen &&\n RiskDetailsCard && (\n <div\n role=\"tooltip\"\n tabIndex={0}\n className=\"absolute left-0 right-0 top-[95%] mt-1 z-50 bg-white dark:bg-black-600 rounded-xl\"\n onClick={(e) => e.stopPropagation()}\n onMouseDown={(e) => e.preventDefault()}\n onKeyDown={(e) => {\n if (e.key === \"Escape\") {\n setIsHovered(false);\n }\n }}\n >\n <RiskDetailsCard riskDetails={riskDetails} />\n </div>\n )}\n </div>\n );\n }\n);\n\nMasterDataInputField.displayName = \"MasterDataInputField\";\n\n"],"names":["MasterDataInputField","forwardRef","id","label","labelExtra","placeholder","value","onChange","errorMessage","defaultValue","required","isRequiredConditional","masterDataName","masterDataColumnName","masterDataFormula","masterDataFilters","tags","index","tooltip","originalCase","color","isGTN","labelClassName","gtnName","isAiExtracted","confidenceScore","confidenceType","confidenceTooltip","sourceMeta","onConfidenceScoreClick","disabled","reference","isLiveField","onBlur","onAddGTNToDocument","riskDetails","isRiskAnalysisOpen","RiskDetailsCard","primaryColorShades","setDisableActions","showDeprecatedFieldWarning","MasterDataModal","parseMasterDataFormula","inputEmphasis","ref","t","useTranslation","showRiskSkin","emphasisModifiedSkin","emphasisDeletedSkin","emphasisSuccessSkin","isHovered","setIsHovered","useState","inputValue","setInputValue","showMasterDataModal","setShowMasterDataModal","suggestion","setSuggestion","masterDataRowValue","setMasterDataRowValue","isTextOverflowing","setIsTextOverflowing","inputRef","useRef","combinedRef","useEffect","checkOverflow","input","toggleMasterDataModal","handleKeyDown","event","currentRef","handleSetMasterData","masterDataValue","masterDataRow","_value","handleClear","handleAddGTNToDocument","getClassName","baseClasses","cn","resolveMasterDataValue","jsxs","jsx","InputLabel","BoltOutlined","shouldShowConfidenceScore","AIExtractedIndicator","Label","Tooltip","HelpIcon","getConfidenceScoreBadgeClass","AIStarIcon","getConfidenceScoreBadgeColor","getConfidenceScoreBadgeFill","getConfidenceScoreBadgeTextColor","AntTooltip","NoteAddOutlined","e","IconButton","CloseIcon","TableChartRounded","Typography"],"mappings":"0uBAgNaA,EAAuBC,EAAAA,WAIlC,CACE,CACE,GAAAC,EACA,MAAAC,EACA,WAAAC,EACA,YAAAC,EACA,MAAAC,EACA,SAAAC,EACA,aAAAC,EACA,aAAAC,EACA,SAAAC,EAAW,GACX,sBAAAC,EAAwB,GACxB,eAAAC,EACA,qBAAAC,EACA,kBAAAC,EACA,kBAAAC,GACA,KAAAC,GAAA,MACAC,GACA,QAAAC,EAAU,GACV,aAAAC,GAAe,GACf,MAAAC,EAAQ,GACR,MAAAC,EAAQ,GACR,eAAAC,GACA,QAAAC,EAAU,KACV,cAAAC,GAAgB,GAChB,gBAAAC,EACA,eAAAC,EAAiB,OACjB,kBAAAC,EACA,WAAAC,GAAa,CAAA,EACb,uBAAAC,GACA,SAAAC,EAAW,GACX,UAAAC,GAAY,CAAA,EACZ,YAAAC,GAAc,GACd,OAAAC,GACA,mBAAAC,EACA,YAAAC,EACA,mBAAAC,EAAqB,GACrB,gBAAAC,EACA,mBAAAC,GACA,kBAAAC,EACA,2BAAAC,EACA,gBAAAC,EACA,uBAAAC,EACA,cAAAC,EAAgB,SAAA,EAElBC,KACG,CACH,KAAM,CAAE,EAAAC,EAAA,EAAMC,kBAAA,EACRC,EAAe,GAAQX,GAAsBD,GAAa,OAC1Da,GACJL,IAAkB,YAAc,CAACnC,GAAgB,CAACuC,EAC9CE,GACJ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