{"ast":null,"code":"import * as React from 'react';\nimport { composeRef } from \"rc-util/es/ref\";\nimport { FormContext } from '../context';\nexport default function useItemRef() {\n const {\n itemRef\n } = React.useContext(FormContext);\n const cacheRef = React.useRef({});\n function getRef(name, children) {\n const childrenRef = children && typeof children === 'object' && children.ref;\n const nameStr = name.join('_');\n if (cacheRef.current.name !== nameStr || cacheRef.current.originRef !== childrenRef) {\n cacheRef.current.name = nameStr;\n cacheRef.current.originRef = childrenRef;\n cacheRef.current.ref = composeRef(itemRef(name), childrenRef);\n }\n return cacheRef.current.ref;\n }\n return getRef;\n}","map":{"version":3,"names":["React","composeRef","FormContext","useItemRef","itemRef","useContext","cacheRef","useRef","getRef","name","children","childrenRef","ref","nameStr","join","current","originRef"],"sources":["C:/Users/Аришина)/Desktop/promo/node_modules/antd/es/form/hooks/useItemRef.js"],"sourcesContent":["import * as React from 'react';\nimport { composeRef } from \"rc-util/es/ref\";\nimport { FormContext } from '../context';\nexport default function useItemRef() {\n const {\n itemRef\n } = React.useContext(FormContext);\n const cacheRef = React.useRef({});\n function getRef(name, children) {\n const childrenRef = children && typeof children === 'object' && children.ref;\n const nameStr = name.join('_');\n if (cacheRef.current.name !== nameStr || cacheRef.current.originRef !== childrenRef) {\n cacheRef.current.name = nameStr;\n cacheRef.current.originRef = childrenRef;\n cacheRef.current.ref = composeRef(itemRef(name), childrenRef);\n }\n return cacheRef.current.ref;\n }\n return getRef;\n}"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,UAAU,QAAQ,gBAAgB;AAC3C,SAASC,WAAW,QAAQ,YAAY;AACxC,eAAe,SAASC,UAAUA,CAAA,EAAG;EACnC,MAAM;IACJC;EACF,CAAC,GAAGJ,KAAK,CAACK,UAAU,CAACH,WAAW,CAAC;EACjC,MAAMI,QAAQ,GAAGN,KAAK,CAACO,MAAM,CAAC,CAAC,CAAC,CAAC;EACjC,SAASC,MAAMA,CAACC,IAAI,EAAEC,QAAQ,EAAE;IAC9B,MAAMC,WAAW,GAAGD,QAAQ,IAAI,OAAOA,QAAQ,KAAK,QAAQ,IAAIA,QAAQ,CAACE,GAAG;IAC5E,MAAMC,OAAO,GAAGJ,IAAI,CAACK,IAAI,CAAC,GAAG,CAAC;IAC9B,IAAIR,QAAQ,CAACS,OAAO,CAACN,IAAI,KAAKI,OAAO,IAAIP,QAAQ,CAACS,OAAO,CAACC,SAAS,KAAKL,WAAW,EAAE;MACnFL,QAAQ,CAACS,OAAO,CAACN,IAAI,GAAGI,OAAO;MAC/BP,QAAQ,CAACS,OAAO,CAACC,SAAS,GAAGL,WAAW;MACxCL,QAAQ,CAACS,OAAO,CAACH,GAAG,GAAGX,UAAU,CAACG,OAAO,CAACK,IAAI,CAAC,EAAEE,WAAW,CAAC;IAC/D;IACA,OAAOL,QAAQ,CAACS,OAAO,CAACH,GAAG;EAC7B;EACA,OAAOJ,MAAM;AACf","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}