@lax-wp/design-system 0.13.34 → 0.13.36

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.
Files changed (41) hide show
  1. package/dist/components/data-display/infinite-table/body/cell/CheckboxCell.cjs.js +1 -1
  2. package/dist/components/data-display/infinite-table/body/cell/CheckboxCell.cjs.js.map +1 -1
  3. package/dist/components/data-display/infinite-table/body/cell/CheckboxCell.es.js +23 -23
  4. package/dist/components/data-display/infinite-table/body/cell/CheckboxCell.es.js.map +1 -1
  5. package/dist/components/data-display/infinite-table/head/CheckAll.cjs.js +1 -1
  6. package/dist/components/data-display/infinite-table/head/CheckAll.cjs.js.map +1 -1
  7. package/dist/components/data-display/infinite-table/head/CheckAll.es.js +4 -4
  8. package/dist/components/data-display/infinite-table/head/CheckAll.es.js.map +1 -1
  9. package/dist/components/data-display/infinite-table/head/index.cjs.js +1 -1
  10. package/dist/components/data-display/infinite-table/head/index.cjs.js.map +1 -1
  11. package/dist/components/data-display/infinite-table/head/index.es.js +5 -5
  12. package/dist/components/data-display/infinite-table/head/index.es.js.map +1 -1
  13. package/dist/components/forms/date-time-field/DateTimeField.cjs.js +1 -1
  14. package/dist/components/forms/date-time-field/DateTimeField.cjs.js.map +1 -1
  15. package/dist/components/forms/date-time-field/DateTimeField.es.js +97 -92
  16. package/dist/components/forms/date-time-field/DateTimeField.es.js.map +1 -1
  17. package/dist/components/forms/dynamic-data-input/DynamicDataInputField.cjs.js +1 -1
  18. package/dist/components/forms/dynamic-data-input/DynamicDataInputField.cjs.js.map +1 -1
  19. package/dist/components/forms/dynamic-data-input/DynamicDataInputField.d.ts +6 -0
  20. package/dist/components/forms/dynamic-data-input/DynamicDataInputField.es.js +172 -142
  21. package/dist/components/forms/dynamic-data-input/DynamicDataInputField.es.js.map +1 -1
  22. package/dist/components/forms/link-input/LinkInputField.cjs.js +2 -0
  23. package/dist/components/forms/link-input/LinkInputField.cjs.js.map +1 -0
  24. package/dist/components/forms/link-input/LinkInputField.d.ts +59 -0
  25. package/dist/components/forms/link-input/LinkInputField.es.js +102 -0
  26. package/dist/components/forms/link-input/LinkInputField.es.js.map +1 -0
  27. package/dist/components/forms/master-data-input/MasterDataInputField.cjs.js +1 -1
  28. package/dist/components/forms/master-data-input/MasterDataInputField.cjs.js.map +1 -1
  29. package/dist/components/forms/master-data-input/MasterDataInputField.d.ts +6 -0
  30. package/dist/components/forms/master-data-input/MasterDataInputField.es.js +199 -169
  31. package/dist/components/forms/master-data-input/MasterDataInputField.es.js.map +1 -1
  32. package/dist/components/forms/percentage-input/PercentageInputField.cjs.js +1 -5
  33. package/dist/components/forms/percentage-input/PercentageInputField.cjs.js.map +1 -1
  34. package/dist/components/forms/percentage-input/PercentageInputField.d.ts +6 -0
  35. package/dist/components/forms/percentage-input/PercentageInputField.es.js +141 -134
  36. package/dist/components/forms/percentage-input/PercentageInputField.es.js.map +1 -1
  37. package/dist/index.cjs.js +1 -1
  38. package/dist/index.d.ts +5 -3
  39. package/dist/index.es.js +407 -405
  40. package/dist/index.es.js.map +1 -1
  41. package/package.json +1 -1
@@ -0,0 +1,59 @@
1
+ import { type FC, type ReactNode } from "react";
2
+ export interface LinkInputFieldProps {
3
+ /** Unique identifier for the URL input */
4
+ urlId?: string;
5
+ /** Current URL value */
6
+ urlValue: string;
7
+ /** Callback fired when the URL value changes */
8
+ onUrlChange: (value: string) => void;
9
+ /** Placeholder text for the URL input */
10
+ urlPlaceholder?: string | null;
11
+ /** Error message for the URL input */
12
+ urlError?: string;
13
+ /** Additional CSS classes for the URL input wrapper */
14
+ urlClassName?: string;
15
+ /** Callback fired when the URL input loses focus */
16
+ onUrlBlur?: () => void;
17
+ /** Unique identifier for the alias input */
18
+ aliasId?: string;
19
+ /** Current alias value */
20
+ aliasValue: string;
21
+ /** Callback fired when the alias value changes */
22
+ onAliasChange: (value: string) => void;
23
+ /** Placeholder text for the alias input */
24
+ aliasPlaceholder?: string | null;
25
+ /** Error message for the alias input */
26
+ aliasError?: string;
27
+ /** Additional CSS classes for the alias input wrapper */
28
+ aliasClassName?: string;
29
+ /** Tailwind width class for the alias column e.g. `'w-[140px]'`. Omit for natural width. */
30
+ aliasFixedWidth?: string;
31
+ /** Whether both inputs are disabled */
32
+ disabled?: boolean;
33
+ /** Optional label rendered above the input row */
34
+ label?: ReactNode;
35
+ /** Wrap the edit row in a bordered container (useful for standalone field usage) */
36
+ withBorder?: boolean;
37
+ /**
38
+ * Render a read-only link view instead of inputs.
39
+ * Use when the field is disabled and anchor links are preferred over inputs.
40
+ */
41
+ readOnly?: boolean;
42
+ }
43
+ /**
44
+ * A combined URL + alias input field rendered as a single bordered row.
45
+ * Supports a read-only anchor-link view, optional label, error messages per sub-field,
46
+ * and a fixed-width alias column.
47
+ *
48
+ * @example
49
+ * ```tsx
50
+ * <LinkInputField
51
+ * urlValue={url}
52
+ * onUrlChange={setUrl}
53
+ * aliasValue={alias}
54
+ * onAliasChange={setAlias}
55
+ * withBorder
56
+ * />
57
+ * ```
58
+ */
59
+ export declare const LinkInputField: FC<LinkInputFieldProps>;
@@ -0,0 +1,102 @@
1
+ import { jsxs as n, jsx as e, Fragment as x } from "react/jsx-runtime";
2
+ import l from "../../../_virtual/index.es.js";
3
+ import "react";
4
+ import { useTranslation as M } from "react-i18next";
5
+ import { BaseInputField as k } from "../base-input-field/BaseInputField.es.js";
6
+ import { KeychainIcon as u, MentionIcon as g } from "../../icon/icons.generated.es.js";
7
+ const f = "[&_input]:!border-0 [&_input]:!shadow-none [&_input]:!rounded-none [&_input]:!bg-transparent [&_input]:!h-8 [&_input]:!pl-1", j = ({
8
+ urlId: N,
9
+ urlValue: r,
10
+ onUrlChange: b,
11
+ urlPlaceholder: c,
12
+ urlError: s,
13
+ urlClassName: v,
14
+ onUrlBlur: w,
15
+ aliasId: y,
16
+ aliasValue: t,
17
+ onAliasChange: _,
18
+ aliasPlaceholder: o,
19
+ aliasError: a,
20
+ aliasClassName: I,
21
+ aliasFixedWidth: C,
22
+ disabled: d = !1,
23
+ label: m,
24
+ withBorder: i = !1,
25
+ readOnly: F = !1
26
+ }) => {
27
+ const { t: h } = M(), A = c === void 0 ? h("Enter URL") : c, L = o === void 0 ? h("Enter Alias") : o, p = !!s || !!a;
28
+ return F ? /* @__PURE__ */ n("div", { className: "w-full", children: [
29
+ m,
30
+ /* @__PURE__ */ n("div", { className: "flex items-center gap-2 min-h-9", children: [
31
+ /* @__PURE__ */ e(u, { className: "text-black-300 shrink-0 w-icon h-icon" }),
32
+ r ? /* @__PURE__ */ n(x, { children: [
33
+ /* @__PURE__ */ e(
34
+ "a",
35
+ {
36
+ href: r,
37
+ target: "_blank",
38
+ rel: "noopener noreferrer",
39
+ className: "text-primary-600 dark:text-primary-400 hover:underline text-sm truncate",
40
+ children: t || r
41
+ }
42
+ ),
43
+ t ? /* @__PURE__ */ n(x, { children: [
44
+ /* @__PURE__ */ e("div", { className: "h-4 w-px bg-neutral-300 dark:bg-grey-800 shrink-0" }),
45
+ /* @__PURE__ */ e(g, { className: "text-black-300 shrink-0 w-icon h-icon" }),
46
+ /* @__PURE__ */ e("span", { className: "text-neutral-500 dark:text-neutral-400 text-sm shrink-0", children: t })
47
+ ] }) : null
48
+ ] }) : /* @__PURE__ */ e("span", { className: "text-neutral-400 dark:text-neutral-600 text-sm", children: "—" })
49
+ ] })
50
+ ] }) : /* @__PURE__ */ n("div", { className: "w-full", children: [
51
+ m,
52
+ /* @__PURE__ */ n(
53
+ "div",
54
+ {
55
+ className: l("flex items-center h-9 overflow-hidden", {
56
+ "border rounded-lg bg-white dark:bg-black-700": i,
57
+ "border-error-500": i && p,
58
+ "border-gray-300 dark:border-black-500": i && !p
59
+ }),
60
+ children: [
61
+ /* @__PURE__ */ e(u, { className: "ml-2 text-black-300 shrink-0 w-icon h-icon" }),
62
+ /* @__PURE__ */ e("div", { className: l("min-w-0 flex-1", f, v), children: /* @__PURE__ */ e(
63
+ k,
64
+ {
65
+ id: N,
66
+ originalCase: !0,
67
+ type: "url",
68
+ value: r,
69
+ onChange: b,
70
+ placeholder: A ?? "",
71
+ disabled: d,
72
+ onBlur: w,
73
+ errorMessage: ""
74
+ }
75
+ ) }),
76
+ /* @__PURE__ */ e("div", { className: "h-full w-px bg-neutral-300 dark:bg-grey-800 shrink-0" }),
77
+ /* @__PURE__ */ e(g, { className: "ml-2 text-black-300 shrink-0 w-icon h-icon" }),
78
+ /* @__PURE__ */ e("div", { className: l("shrink-0", f, C, I), children: /* @__PURE__ */ e(
79
+ k,
80
+ {
81
+ id: y,
82
+ originalCase: !0,
83
+ type: "text",
84
+ value: t,
85
+ onChange: _,
86
+ placeholder: L ?? "",
87
+ disabled: d,
88
+ errorMessage: ""
89
+ }
90
+ ) })
91
+ ]
92
+ }
93
+ ),
94
+ s ? /* @__PURE__ */ e("p", { className: "text-error-500 text-xs mt-1", children: s }) : null,
95
+ a ? /* @__PURE__ */ e("p", { className: "text-error-500 text-xs mt-1", children: a }) : null
96
+ ] });
97
+ };
98
+ j.displayName = "LinkInputField";
99
+ export {
100
+ j as LinkInputField
101
+ };
102
+ //# sourceMappingURL=LinkInputField.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LinkInputField.es.js","sources":["../../../../src/components/forms/link-input/LinkInputField.tsx"],"sourcesContent":["import cn from \"classnames\";\nimport { type FC, type ReactNode } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { BaseInputField } from \"../base-input-field/BaseInputField\";\nimport { KeychainIcon, MentionIcon } from \"../../icon\";\n\nexport interface LinkInputFieldProps {\n /** Unique identifier for the URL input */\n urlId?: string;\n /** Current URL value */\n urlValue: string;\n /** Callback fired when the URL value changes */\n onUrlChange: (value: string) => void;\n /** Placeholder text for the URL input */\n urlPlaceholder?: string | null;\n /** Error message for the URL input */\n urlError?: string;\n /** Additional CSS classes for the URL input wrapper */\n urlClassName?: string;\n /** Callback fired when the URL input loses focus */\n onUrlBlur?: () => void;\n\n /** Unique identifier for the alias input */\n aliasId?: string;\n /** Current alias value */\n aliasValue: string;\n /** Callback fired when the alias value changes */\n onAliasChange: (value: string) => void;\n /** Placeholder text for the alias input */\n aliasPlaceholder?: string | null;\n /** Error message for the alias input */\n aliasError?: string;\n /** Additional CSS classes for the alias input wrapper */\n aliasClassName?: string;\n /** Tailwind width class for the alias column e.g. `'w-[140px]'`. Omit for natural width. */\n aliasFixedWidth?: string;\n\n /** Whether both inputs are disabled */\n disabled?: boolean;\n /** Optional label rendered above the input row */\n label?: ReactNode;\n /** Wrap the edit row in a bordered container (useful for standalone field usage) */\n withBorder?: boolean;\n /**\n * Render a read-only link view instead of inputs.\n * Use when the field is disabled and anchor links are preferred over inputs.\n */\n readOnly?: boolean;\n}\n\nconst inputOverrides =\n \"[&_input]:!border-0 [&_input]:!shadow-none [&_input]:!rounded-none [&_input]:!bg-transparent [&_input]:!h-8 [&_input]:!pl-1\";\n\n/**\n * A combined URL + alias input field rendered as a single bordered row.\n * Supports a read-only anchor-link view, optional label, error messages per sub-field,\n * and a fixed-width alias column.\n *\n * @example\n * ```tsx\n * <LinkInputField\n * urlValue={url}\n * onUrlChange={setUrl}\n * aliasValue={alias}\n * onAliasChange={setAlias}\n * withBorder\n * />\n * ```\n */\nexport const LinkInputField: FC<LinkInputFieldProps> = ({\n urlId,\n urlValue,\n onUrlChange,\n urlPlaceholder,\n urlError,\n urlClassName,\n onUrlBlur,\n aliasId,\n aliasValue,\n onAliasChange,\n aliasPlaceholder,\n aliasError,\n aliasClassName,\n aliasFixedWidth,\n disabled = false,\n label,\n withBorder = false,\n readOnly = false,\n}) => {\n const { t } = useTranslation();\n\n const resolvedUrlPlaceholder =\n urlPlaceholder === undefined ? t(\"Enter URL\") : urlPlaceholder;\n const resolvedAliasPlaceholder =\n aliasPlaceholder === undefined ? t(\"Enter Alias\") : aliasPlaceholder;\n const hasAnyError = !!urlError || !!aliasError;\n\n if (readOnly) {\n return (\n <div className=\"w-full\">\n {label}\n <div className=\"flex items-center gap-2 min-h-9\">\n <KeychainIcon className=\"text-black-300 shrink-0 w-icon h-icon\" />\n {urlValue ? (\n <>\n <a\n href={urlValue}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"text-primary-600 dark:text-primary-400 hover:underline text-sm truncate\"\n >\n {aliasValue || urlValue}\n </a>\n {aliasValue ? (\n <>\n <div className=\"h-4 w-px bg-neutral-300 dark:bg-grey-800 shrink-0\" />\n <MentionIcon className=\"text-black-300 shrink-0 w-icon h-icon\" />\n <span className=\"text-neutral-500 dark:text-neutral-400 text-sm shrink-0\">\n {aliasValue}\n </span>\n </>\n ) : null}\n </>\n ) : (\n <span className=\"text-neutral-400 dark:text-neutral-600 text-sm\">\n —\n </span>\n )}\n </div>\n </div>\n );\n }\n\n return (\n <div className=\"w-full\">\n {label}\n <div\n className={cn(\"flex items-center h-9 overflow-hidden\", {\n \"border rounded-lg bg-white dark:bg-black-700\": withBorder,\n \"border-error-500\": withBorder && hasAnyError,\n \"border-gray-300 dark:border-black-500\": withBorder && !hasAnyError,\n })}\n >\n <KeychainIcon className=\"ml-2 text-black-300 shrink-0 w-icon h-icon\" />\n <div className={cn(\"min-w-0 flex-1\", inputOverrides, urlClassName)}>\n <BaseInputField\n id={urlId}\n originalCase\n type=\"url\"\n value={urlValue}\n onChange={onUrlChange}\n placeholder={resolvedUrlPlaceholder ?? \"\"}\n disabled={disabled}\n onBlur={onUrlBlur}\n errorMessage=\"\"\n />\n </div>\n <div className=\"h-full w-px bg-neutral-300 dark:bg-grey-800 shrink-0\" />\n <MentionIcon className=\"ml-2 text-black-300 shrink-0 w-icon h-icon\" />\n <div className={cn(\"shrink-0\", inputOverrides, aliasFixedWidth, aliasClassName)}>\n <BaseInputField\n id={aliasId}\n originalCase\n type=\"text\"\n value={aliasValue}\n onChange={onAliasChange}\n placeholder={resolvedAliasPlaceholder ?? \"\"}\n disabled={disabled}\n errorMessage=\"\"\n />\n </div>\n </div>\n {urlError ? (\n <p className=\"text-error-500 text-xs mt-1\">{urlError}</p>\n ) : null}\n {aliasError ? (\n <p className=\"text-error-500 text-xs mt-1\">{aliasError}</p>\n ) : null}\n </div>\n );\n};\n\nLinkInputField.displayName = \"LinkInputField\";\n"],"names":["inputOverrides","LinkInputField","urlId","urlValue","onUrlChange","urlPlaceholder","urlError","urlClassName","onUrlBlur","aliasId","aliasValue","onAliasChange","aliasPlaceholder","aliasError","aliasClassName","aliasFixedWidth","disabled","label","withBorder","readOnly","t","useTranslation","resolvedUrlPlaceholder","resolvedAliasPlaceholder","hasAnyError","jsxs","jsx","KeychainIcon","Fragment","MentionIcon","cn","BaseInputField"],"mappings":";;;;;;AAkDA,MAAMA,IACJ,+HAkBWC,IAA0C,CAAC;AAAA,EACtD,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,aAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,UAAAC;AAAA,EACA,cAAAC;AAAA,EACA,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,YAAAC;AAAA,EACA,eAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,YAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,OAAAC;AAAA,EACA,YAAAC,IAAa;AAAA,EACb,UAAAC,IAAW;AACb,MAAM;AACJ,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAA,GAERC,IACJjB,MAAmB,SAAYe,EAAE,WAAW,IAAIf,GAC5CkB,IACJX,MAAqB,SAAYQ,EAAE,aAAa,IAAIR,GAChDY,IAAc,CAAC,CAAClB,KAAY,CAAC,CAACO;AAEpC,SAAIM,IAEA,gBAAAM,EAAC,OAAA,EAAI,WAAU,UACZ,UAAA;AAAA,IAAAR;AAAA,IACD,gBAAAQ,EAAC,OAAA,EAAI,WAAU,mCACb,UAAA;AAAA,MAAA,gBAAAC,EAACC,GAAA,EAAa,WAAU,wCAAA,CAAwC;AAAA,MAC/DxB,IACC,gBAAAsB,EAAAG,GAAA,EACE,UAAA;AAAA,QAAA,gBAAAF;AAAA,UAAC;AAAA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gBAAAA,EAACG,GAAA,EAAY,WAAU,6CAAA,CAA6C;AAAA,UACpE,gBAAAH,EAAC,SAAI,WAAWI,EAAG,YAAY9B,GAAgBe,GAAiBD,CAAc,GAC5E,UAAA,gBAAAY;AAAA,YAACK;AAAA,YAAA;AAAA,cACC,IAAItB;AAAA,cACJ,cAAY;AAAA,cACZ,MAAK;AAAA,cACL,OAAOC;AAAA,cACP,UAAUC;AAAA,cACV,aAAaY,KAA4B;AAAA,cACzC,UAAAP;AAAA,cACA,cAAa;AAAA,YAAA;AAAA,UAAA,EACf,CACF;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,IAEDV,IACC,gBAAAoB,EAAC,KAAA,EAAE,WAAU,+BAA+B,aAAS,IACnD;AAAA,IACHb,IACC,gBAAAa,EAAC,KAAA,EAAE,WAAU,+BAA+B,aAAW,IACrD;AAAA,EAAA,GACN;AAEJ;AAEAzB,EAAe,cAAc;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),b=require("../../../_virtual/index.cjs.js"),n=require("react"),ve=require("antd"),Ce=require("react-i18next"),Se=require("../../data-display/typography/Typography.cjs.js"),ye=require("../../data-display/label/Label.cjs.js"),N=require("@mui/icons-material"),Ie=require("../../icons/AIExtractedIndicator.cjs.js"),ke=require("../../icons/AIStarIcon.cjs.js"),qe=require("../../icons/HelpIcon.cjs.js"),$=require("../../tooltip/Tooltip.cjs.js"),T=require("../../button/IconButton.cjs.js"),Ne=require("../shared/InputLabel.cjs.js"),c=require("../../../utils/confidenceScoreUtils.cjs.js"),$e=require("../../icon/icons.generated.cjs.js"),U=n.forwardRef(({id:W,label:J,placeholder:Q,value:s,onChange:E,errorMessage:f,defaultValue:X,required:z=!1,isRequiredConditional:Y=!1,masterDataName:x,masterDataColumnName:Z,masterDataFormula:o,masterDataFilters:F,tags:G,index:D,tooltip:M="",originalCase:ee=!1,color:V="",isGTN:g=!1,labelClassName:te,gtnName:L=null,isAiExtracted:le=!1,confidenceScore:j,confidenceType:d="high",confidenceTooltip:w,sourceMeta:ne=[],onConfidenceScoreClick:re,disabled:R=!1,reference:se={},isLiveField:oe=!1,onBlur:ae,onAddGTNToDocument:v,riskDetails:a,isRiskAnalysisOpen:C=!1,RiskDetailsCard:B,primaryColorShades:ie,setDisableActions:H,showDeprecatedFieldWarning:O,MasterDataModal:P,parseMasterDataFormula:p},ce)=>{const{t:de}=Ce.useTranslation(),[m,S]=n.useState(!1),[r,u]=n.useState(null),[i,A]=n.useState(!1),[ue,fe]=n.useState(""),[y,K]=n.useState(null),[xe,pe]=n.useState(!1),I=n.useRef(null),k=ce||I;n.useEffect(()=>{const t=()=>{const l=k.current||I.current;l&&pe(l.scrollWidth>l.clientWidth)};return t(),window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[r,s]),n.useEffect(()=>{u(s)},[D,s]),n.useEffect(()=>{r!==null&&r!==s&&E(r,y)},[r,y]);const q=()=>{H?.(!i),A(!i)},me=t=>{if(t.keyCode===9||t.key==="Enter"){const l=k.current||I.current;l&&(u(ue),l.blur())}},he=(t,l)=>{let h=t;o&&p&&(h=p(o,l)),fe(""),u(h),q(),K(l)},be=()=>{u(""),K(null)},ge=t=>{v&&L&&v({key:L,value:t})},je=()=>{const t="border h-8 text-sm rounded-lg block w-full p-2.5 pr-16 font-inter font-medium",l=f?"border-red-300":C&&a?.color?`border-${a?.color}-300`:"border-gray-300 dark:border-black-600",h="placeholder:text-neutral-900 dark:placeholder:text-black-400",we=`${C&&a?.color?`bg-${a?.color}-50`:"dark:bg-black-600 "} ${V||"text-neutral-900 dark:text-black-200"}`;return`${t} ${l} ${we} ${h}`},_=()=>r!==null?r:o&&p?p(o,se):s;return n.useEffect(()=>{i&&!x&&(O?.(),A(!1))},[i,x,O]),e.jsxs("div",{className:b("flex gap-0.5 w-full relative",m&&g?"border rounded-lg border-primary-100 p-1":"",{"error-field":!!f}),onMouseEnter:()=>S(!0),onMouseLeave:()=>S(!1),children:[g&&!m?e.jsx("div",{className:"w-1 h-1 bg-primary-600 rounded-full animate-blink mt-1.5"}):null,e.jsxs("div",{className:b("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 ${ee?"":"capitalize"} ${te||""}`,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(Ne.InputLabel,{label:J||"",required:z||!1,isRequiredConditional:Y||!1}),oe&&e.jsx(N.BoltOutlined,{sx:{fontSize:16,color:"var(--color-primary-600)",rotate:"15deg"}}),le&&!c.shouldShowConfidenceScore(j)&&e.jsx(Ie.AIExtractedIndicator,{}),e.jsx(ye.Label,{labels:G}),M&&e.jsx($,{placement:"top",title:`${M}${o?` | ${o}`:""}`,children:e.jsx("div",{className:"cursor-pointer",children:e.jsx(qe.HelpIcon,{className:"w-icon-sm h-icon-sm"})})})]}),e.jsxs("div",{className:"flex items-center gap-1 justify-self-end",children:[c.shouldShowConfidenceScore(j)&&d?e.jsx($,{placement:"top-end",title:w??"",hideTooltip:w==null,className:"cursor-pointer",children:e.jsxs("div",{className:b("inline-flex min-w-[50px] items-center gap-1 rounded-md px-1 py-0.5",c.getConfidenceScoreBadgeClass(d)),onClick:()=>re?.(ne),children:[e.jsx(ke.AIStarIcon,{size:12,fill:c.getConfidenceScoreBadgeColor(d),fillSecondary:c.getConfidenceScoreBadgeFill(d)}),e.jsxs("span",{className:b("text-xs font-medium leading-4",c.getConfidenceScoreBadgeTextColor(d)),children:[j,"%"]})]})}):null,g&&m&&v?e.jsx("button",{id:"btn-master-data-input-add-to-document",className:"cursor-pointer",onClick:()=>ge(s?.toString()||""),type:"button",children:e.jsx(ve.Tooltip,{placement:"top",title:de("Add to document"),children:e.jsx(N.NoteAddOutlined,{sx:{fontSize:16,color:ie?.[600]||"var(--color-primary-600)"}})})}):null]})]})}),e.jsxs("label",{className:"relative block mt-1",children:[e.jsx($,{title:xe?_():"",children:e.jsx("input",{id:W,ref:k,required:z,placeholder:Q,className:je(),onChange:t=>{E(t.target.value,y),u(t.target?.value)},onKeyDown:me,value:_(),defaultValue:X,disabled:!0,autoComplete:"off",onBlur:ae})}),e.jsx(T,{id:"btn-dynamic-data-input-rx-cross",onClick:be,className:"absolute inset-y-0 right-1 flex items-center px-2 focus:border-transparent",variant:"ghost",disabled:R,children:e.jsx($e.CloseIcon,{className:"w-6 h-6 text-neutral-500 dark:text-neutral-400 w-sm h-sm"})}),e.jsx(T,{id:"btn-dynamic-data-input-ai-outline-pic-center",onClick:q,className:"absolute inset-y-0 right-8 flex items-center px-2 focus:border-transparent",variant:"ghost",disabled:R,children:e.jsx(N.TableChartRounded,{className:"text-neutral-500 dark:text-neutral-400 w-sm h-sm"})})]}),f&&e.jsx(Se.Typography,{className:"text-error-500 mt-1",appearance:"custom",size:"extra-small",variant:"medium",children:f}),i&&P&&e.jsx(P,{isVisible:i,onSelected:he,onClose:q,masterDataColumnName:Z,masterDataFilters:F,masterDataName:x,masterDataId:x,showFilters:!0})]}),m&&a&&C&&B&&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"&&S(!1)},children:e.jsx(B,{riskDetails:a})})]})});U.displayName="MasterDataInputField";exports.MasterDataInputField=U;
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;
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/**\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 /** 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}\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 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 },\n ref\n ) => {\n const { t } = useTranslation();\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 borderColor = errorMessage\n ? \"border-red-300\"\n : isRiskAnalysisOpen && riskDetails?.color\n ? `border-${riskDetails?.color}-300`\n : \"border-gray-300 dark:border-black-600\";\n const placeholderColor = `placeholder:text-neutral-900 dark:placeholder:text-black-400`;\n const backgroundColor = `${\n isRiskAnalysisOpen && riskDetails?.color\n ? `bg-${riskDetails?.color}-50`\n : \"dark:bg-black-600 \"\n } ${color ? color : \"text-neutral-900 dark:text-black-200\"}`;\n\n return `${baseClasses} ${borderColor} ${backgroundColor} ${placeholderColor}`;\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 </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","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","ref","t","useTranslation","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","borderColor","placeholderColor","backgroundColor","resolveMasterDataValue","jsxs","cn","jsx","InputLabel","BoltOutlined","shouldShowConfidenceScore","AIExtractedIndicator","Label","Tooltip","HelpIcon","getConfidenceScoreBadgeClass","AIStarIcon","getConfidenceScoreBadgeColor","getConfidenceScoreBadgeFill","getConfidenceScoreBadgeTextColor","AntTooltip","NoteAddOutlined","e","IconButton","CloseIcon","TableChartRounded","Typography"],"mappings":"0uBAqMaA,EAAuBC,EAAAA,WAIlC,CACE,CACE,GAAAC,EACA,MAAAC,EACA,YAAAC,EACA,MAAAC,EACA,SAAAC,EACA,aAAAC,EACA,aAAAC,EACA,SAAAC,EAAW,GACX,sBAAAC,EAAwB,GACxB,eAAAC,EACA,qBAAAC,EACA,kBAAAC,EACA,kBAAAC,EACA,KAAAC,EAAA,MACAC,EACA,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,CAA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UAAA,CAAU,UAAU,0DAAA,CAA2D,CAAA,CAAA,EAGlFjB,EAAAA,IAACgB,EAAA,CACC,GAAI,+CACJ,QAASlC,EACT,UAAU,6EACV,QAAQ,QACR,SAAAnC,EAEA,SAAAqD,EAAAA,IAACkB,EAAAA,kBAAA,CACC,UAAU,kDAAA,CAAA,CACZ,CAAA,CACF,EACF,EAEC7F,GACC2E,EAAAA,IAACmB,GAAAA,WAAA,CACC,UAAU,sBACV,WAAW,SACX,KAAK,cACL,QAAQ,SAEP,SAAA9F,CAAA,CAAA,EAIJ2C,GAAuBV,GACtB0C,EAAAA,IAAC1C,EAAA,CACC,UAAWU,EACX,WAAYkB,GACZ,QAASJ,EACT,qBAAApD,EACA,kBAAAE,EACA,eAAAH,EACA,aAAcA,EACd,YAAW,EAAA,CAAA,CACb,EAEJ,EAECkC,GACCX,GACAC,GACAC,GACE8C,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,UACZnD,EAAa,EAAK,CAEtB,EAEA,SAAAoC,EAAAA,IAAC9C,GAAgB,YAAAF,CAAA,CAA0B,CAAA,CAAA,CAC7C,CAAA,CAAA,CAIV,CACF,EAEAlC,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 = `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,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,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CAAA,CAAA,CAC7C,CAAA,CAAA,CAIV,CACF,EAEAnC,EAAqB,YAAc"}
@@ -38,6 +38,8 @@ export interface RiskDetailsCardProps<T = any> {
38
38
  maxWidth?: string;
39
39
  showAllRisksSuggestions?: boolean;
40
40
  }
41
+ /** Visual emphasis for the input surface (background + border) */
42
+ export type MasterDataInputFieldEmphasis = "default" | "modified" | "deleted" | "success";
41
43
  /**
42
44
  * Props for the MasterDataModal component
43
45
  */
@@ -59,6 +61,8 @@ export interface MasterDataInputFieldProps {
59
61
  id: string;
60
62
  /** Label text to display above the input */
61
63
  label: string;
64
+ /** Optional extra content in the label row (e.g. actions, badges) */
65
+ labelExtra?: React.ReactNode;
62
66
  /** Placeholder text for the input */
63
67
  placeholder?: string;
64
68
  /** Current value of the input */
@@ -142,6 +146,8 @@ export interface MasterDataInputFieldProps {
142
146
  MasterDataModal?: React.ComponentType<MasterDataModalProps>;
143
147
  /** Function to parse master data formula */
144
148
  parseMasterDataFormula?: (formula: string, row: any) => string;
149
+ /** Input surface style: `'modified'` — `--Warning-50` / `--Warning-200`; `'deleted'` — `--Error-50` / `--Error-200`, text `#475467`; `'success'` — `--Success-50` / `--Success-200`, text `#101828`. */
150
+ inputEmphasis?: MasterDataInputFieldEmphasis;
145
151
  }
146
152
  /**
147
153
  * A highly customizable master data input component with label, validation, and styling support.