PromoCursed/node_modules/.cache/babel-loader/680d9ddd19e76d2ce02f55415cca7c6f301bdd858d100ceb63fd8853b40a0a5c.json
2024-08-20 23:25:37 +04:00

1 line
4.0 KiB
JSON

{"ast":null,"code":"import { useContext } from 'react';\nimport { VariantContext } from '../context';\nimport { ConfigContext, Variants } from '../../config-provider';\n/**\n * Compatible for legacy `bordered` prop.\n */\nconst useVariant = function (component, variant) {\n let legacyBordered = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;\n var _a, _b;\n const {\n variant: configVariant,\n [component]: componentConfig\n } = useContext(ConfigContext);\n const ctxVariant = useContext(VariantContext);\n const configComponentVariant = componentConfig === null || componentConfig === void 0 ? void 0 : componentConfig.variant;\n let mergedVariant;\n if (typeof variant !== 'undefined') {\n mergedVariant = variant;\n } else if (legacyBordered === false) {\n mergedVariant = 'borderless';\n } else {\n // form variant > component global variant > global variant\n mergedVariant = (_b = (_a = ctxVariant !== null && ctxVariant !== void 0 ? ctxVariant : configComponentVariant) !== null && _a !== void 0 ? _a : configVariant) !== null && _b !== void 0 ? _b : 'outlined';\n }\n const enableVariantCls = Variants.includes(mergedVariant);\n return [mergedVariant, enableVariantCls];\n};\nexport default useVariant;","map":{"version":3,"names":["useContext","VariantContext","ConfigContext","Variants","useVariant","component","variant","legacyBordered","arguments","length","undefined","_a","_b","configVariant","componentConfig","ctxVariant","configComponentVariant","mergedVariant","enableVariantCls","includes"],"sources":["C:/Users/Аришина)/Desktop/promo/node_modules/antd/es/form/hooks/useVariants.js"],"sourcesContent":["import { useContext } from 'react';\nimport { VariantContext } from '../context';\nimport { ConfigContext, Variants } from '../../config-provider';\n/**\n * Compatible for legacy `bordered` prop.\n */\nconst useVariant = function (component, variant) {\n let legacyBordered = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;\n var _a, _b;\n const {\n variant: configVariant,\n [component]: componentConfig\n } = useContext(ConfigContext);\n const ctxVariant = useContext(VariantContext);\n const configComponentVariant = componentConfig === null || componentConfig === void 0 ? void 0 : componentConfig.variant;\n let mergedVariant;\n if (typeof variant !== 'undefined') {\n mergedVariant = variant;\n } else if (legacyBordered === false) {\n mergedVariant = 'borderless';\n } else {\n // form variant > component global variant > global variant\n mergedVariant = (_b = (_a = ctxVariant !== null && ctxVariant !== void 0 ? ctxVariant : configComponentVariant) !== null && _a !== void 0 ? _a : configVariant) !== null && _b !== void 0 ? _b : 'outlined';\n }\n const enableVariantCls = Variants.includes(mergedVariant);\n return [mergedVariant, enableVariantCls];\n};\nexport default useVariant;"],"mappings":"AAAA,SAASA,UAAU,QAAQ,OAAO;AAClC,SAASC,cAAc,QAAQ,YAAY;AAC3C,SAASC,aAAa,EAAEC,QAAQ,QAAQ,uBAAuB;AAC/D;AACA;AACA;AACA,MAAMC,UAAU,GAAG,SAAAA,CAAUC,SAAS,EAAEC,OAAO,EAAE;EAC/C,IAAIC,cAAc,GAAGC,SAAS,CAACC,MAAM,GAAG,CAAC,IAAID,SAAS,CAAC,CAAC,CAAC,KAAKE,SAAS,GAAGF,SAAS,CAAC,CAAC,CAAC,GAAGE,SAAS;EAClG,IAAIC,EAAE,EAAEC,EAAE;EACV,MAAM;IACJN,OAAO,EAAEO,aAAa;IACtB,CAACR,SAAS,GAAGS;EACf,CAAC,GAAGd,UAAU,CAACE,aAAa,CAAC;EAC7B,MAAMa,UAAU,GAAGf,UAAU,CAACC,cAAc,CAAC;EAC7C,MAAMe,sBAAsB,GAAGF,eAAe,KAAK,IAAI,IAAIA,eAAe,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,eAAe,CAACR,OAAO;EACxH,IAAIW,aAAa;EACjB,IAAI,OAAOX,OAAO,KAAK,WAAW,EAAE;IAClCW,aAAa,GAAGX,OAAO;EACzB,CAAC,MAAM,IAAIC,cAAc,KAAK,KAAK,EAAE;IACnCU,aAAa,GAAG,YAAY;EAC9B,CAAC,MAAM;IACL;IACAA,aAAa,GAAG,CAACL,EAAE,GAAG,CAACD,EAAE,GAAGI,UAAU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