1 line
6.8 KiB
JSON
1 line
6.8 KiB
JSON
|
{"ast":null,"code":"\"use client\";\n\nvar __rest = this && this.__rest || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { devUseWarning } from '../_util/warning';\nimport { ConfigContext } from '../config-provider';\nimport { useToken } from '../theme/internal';\nexport const GroupSizeContext = /*#__PURE__*/React.createContext(undefined);\nconst ButtonGroup = props => {\n const {\n getPrefixCls,\n direction\n } = React.useContext(ConfigContext);\n const {\n prefixCls: customizePrefixCls,\n size,\n className\n } = props,\n others = __rest(props, [\"prefixCls\", \"size\", \"className\"]);\n const prefixCls = getPrefixCls('btn-group', customizePrefixCls);\n const [,, hashId] = useToken();\n let sizeCls = '';\n switch (size) {\n case 'large':\n sizeCls = 'lg';\n break;\n case 'small':\n sizeCls = 'sm';\n break;\n default:\n // Do nothing\n }\n if (process.env.NODE_ENV !== 'production') {\n const warning = devUseWarning('Button.Group');\n process.env.NODE_ENV !== \"production\" ? warning(!size || ['large', 'small', 'middle'].includes(size), 'usage', 'Invalid prop `size`.') : void 0;\n }\n const classes = classNames(prefixCls, {\n [`${prefixCls}-${sizeCls}`]: sizeCls,\n [`${prefixCls}-rtl`]: direction === 'rtl'\n }, className, hashId);\n return /*#__PURE__*/React.createElement(GroupSizeContext.Provider, {\n value: size\n }, /*#__PURE__*/React.createElement(\"div\", Object.assign({}, others, {\n className: classes\n })));\n};\nexport default ButtonGroup;","map":{"version":3,"names":["__rest","s","e","t","p","Object","prototype","hasOwnProperty","call","indexOf","getOwnPropertySymbols","i","length","propertyIsEnumerable","React","classNames","devUseWarning","ConfigContext","useToken","GroupSizeContext","createContext","undefined","ButtonGroup","props","getPrefixCls","direction","useContext","prefixCls","customizePrefixCls","size","className","others","hashId","sizeCls","process","env","NODE_ENV","warning","includes","classes","createElement","Provider","value","assign"],"sources":["C:/Users/Аришина)/Desktop/promo/node_modules/antd/es/button/button-group.js"],"sourcesContent":["\"use client\";\n\nvar __rest = this && this.__rest || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { devUseWarning } from '../_util/warning';\nimport { ConfigContext } from '../config-provider';\nimport { useToken } from '../theme/internal';\nexport const GroupSizeContext = /*#__PURE__*/React.createContext(undefined);\nconst ButtonGroup = props => {\n const {\n getPrefixCls,\n direction\n } = React.useContext(ConfigContext);\n const {\n prefixCls: customizePrefixCls,\n size,\n className\n } = props,\n others = __rest(props, [\"prefixCls\", \"size\", \"className\"]);\n const prefixCls = getPrefixCls('btn-group', customizePrefixCls);\n const [,, hashId] = useToken();\n let sizeCls = '';\n switch (size) {\n case 'large':\n sizeCls = 'lg';\n break;\n case 'small':\n sizeCls = 'sm';\n break;\n default:\n // Do nothing\n }\n if (process.env.NODE_ENV !== 'production') {\n const warning = devUseWarning('Button.Group');\n proc
|