PromoCursed/node_modules/antd/lib/config-provider/context.js

27 lines
1.2 KiB
JavaScript
Raw Normal View History

2024-08-20 23:25:37 +04:00
"use strict";
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.defaultPrefixCls = exports.defaultIconPrefixCls = exports.Variants = exports.ConfigContext = exports.ConfigConsumer = void 0;
var React = _interopRequireWildcard(require("react"));
const defaultPrefixCls = exports.defaultPrefixCls = 'ant';
const defaultIconPrefixCls = exports.defaultIconPrefixCls = 'anticon';
const Variants = exports.Variants = ['outlined', 'borderless', 'filled'];
const defaultGetPrefixCls = (suffixCls, customizePrefixCls) => {
if (customizePrefixCls) {
return customizePrefixCls;
}
return suffixCls ? `${defaultPrefixCls}-${suffixCls}` : defaultPrefixCls;
};
// zombieJ: 🚨 Do not pass `defaultRenderEmpty` here since it will cause circular dependency.
const ConfigContext = exports.ConfigContext = /*#__PURE__*/React.createContext({
// We provide a default function for Context without provider
getPrefixCls: defaultGetPrefixCls,
iconPrefixCls: defaultIconPrefixCls
});
const {
Consumer: ConfigConsumer
} = ConfigContext;
exports.ConfigConsumer = ConfigConsumer;