1 line
5.6 KiB
JSON
1 line
5.6 KiB
JSON
|
{"ast":null,"code":"\"use client\";\n\nimport * as React from 'react';\nimport CheckOutlined from \"@ant-design/icons/es/icons/CheckOutlined\";\nimport CopyOutlined from \"@ant-design/icons/es/icons/CopyOutlined\";\nimport LoadingOutlined from \"@ant-design/icons/es/icons/LoadingOutlined\";\nimport classNames from 'classnames';\nimport TransButton from '../../_util/transButton';\nimport Tooltip from '../../tooltip';\nimport { getNode, toList } from './util';\nconst CopyBtn = props => {\n const {\n prefixCls,\n copied,\n locale,\n iconOnly,\n tooltips,\n icon,\n loading: btnLoading,\n tabIndex,\n onCopy\n } = props;\n const tooltipNodes = toList(tooltips);\n const iconNodes = toList(icon);\n const {\n copied: copiedText,\n copy: copyText\n } = locale !== null && locale !== void 0 ? locale : {};\n const copyTitle = copied ? getNode(tooltipNodes[1], copiedText) : getNode(tooltipNodes[0], copyText);\n const systemStr = copied ? copiedText : copyText;\n const ariaLabel = typeof copyTitle === 'string' ? copyTitle : systemStr;\n return /*#__PURE__*/React.createElement(Tooltip, {\n key: \"copy\",\n title: copyTitle\n }, /*#__PURE__*/React.createElement(TransButton, {\n className: classNames(`${prefixCls}-copy`, {\n [`${prefixCls}-copy-success`]: copied,\n [`${prefixCls}-copy-icon-only`]: iconOnly\n }),\n onClick: onCopy,\n \"aria-label\": ariaLabel,\n tabIndex: tabIndex\n }, copied ? getNode(iconNodes[1], /*#__PURE__*/React.createElement(CheckOutlined, null), true) : getNode(iconNodes[0], btnLoading ? /*#__PURE__*/React.createElement(LoadingOutlined, null) : /*#__PURE__*/React.createElement(CopyOutlined, null), true)));\n};\nexport default CopyBtn;","map":{"version":3,"names":["React","CheckOutlined","CopyOutlined","LoadingOutlined","classNames","TransButton","Tooltip","getNode","toList","CopyBtn","props","prefixCls","copied","locale","iconOnly","tooltips","icon","loading","btnLoading","tabIndex","onCopy","tooltipNodes","iconNodes","copiedText","copy","copyText","copyTitle","systemStr","ariaLabel","createElement","key","title","className","onClick"],"sources":["C:/Users/Аришина)/source/repos/PromoCursed/node_modules/antd/es/typography/Base/CopyBtn.js"],"sourcesContent":["\"use client\";\n\nimport * as React from 'react';\nimport CheckOutlined from \"@ant-design/icons/es/icons/CheckOutlined\";\nimport CopyOutlined from \"@ant-design/icons/es/icons/CopyOutlined\";\nimport LoadingOutlined from \"@ant-design/icons/es/icons/LoadingOutlined\";\nimport classNames from 'classnames';\nimport TransButton from '../../_util/transButton';\nimport Tooltip from '../../tooltip';\nimport { getNode, toList } from './util';\nconst CopyBtn = props => {\n const {\n prefixCls,\n copied,\n locale,\n iconOnly,\n tooltips,\n icon,\n loading: btnLoading,\n tabIndex,\n onCopy\n } = props;\n const tooltipNodes = toList(tooltips);\n const iconNodes = toList(icon);\n const {\n copied: copiedText,\n copy: copyText\n } = locale !== null && locale !== void 0 ? locale : {};\n const copyTitle = copied ? getNode(tooltipNodes[1], copiedText) : getNode(tooltipNodes[0], copyText);\n const systemStr = copied ? copiedText : copyText;\n const ariaLabel = typeof copyTitle === 'string' ? copyTitle : systemStr;\n return /*#__PURE__*/React.createElement(Tooltip, {\n key: \"copy\",\n title: copyTitle\n }, /*#__PURE__*/React.createElement(TransButton, {\n className: classNames(`${prefixCls}-copy`, {\n [`${prefixCls}-copy-success`]: copied,\n [`${prefixCls}-copy-icon-only`]: iconOnly\n }),\n onClick: onCopy,\n \"aria-label\": ariaLabel,\n tabIndex: tabIndex\n }, copied ? getNode(iconNodes[1], /*#__PURE__*/React.createElement(CheckOutlined, null), true) : getNode(iconNodes[0], btnLoading ? /*#__PURE__*/React.createElement(LoadingOutlined, null) : /*#__PURE__*/React.createElement(CopyOutlined, null), true)));\n};\nexport default CopyBtn;"],"mappings":"AAAA,YAAY;;AAEZ,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,OAAOC,aAAa,MAAM,0CAA0C;
|