1 line
7.3 KiB
JSON
1 line
7.3 KiB
JSON
{"ast":null,"code":"\"use client\";\n\nimport React from 'react';\nimport { cloneElement, isFragment } from '../_util/reactNode';\nconst rxTwoCNChar = /^[\\u4e00-\\u9fa5]{2}$/;\nexport const isTwoCNChar = rxTwoCNChar.test.bind(rxTwoCNChar);\nexport function convertLegacyProps(type) {\n if (type === 'danger') {\n return {\n danger: true\n };\n }\n return {\n type\n };\n}\nexport function isString(str) {\n return typeof str === 'string';\n}\nexport function isUnBorderedButtonType(type) {\n return type === 'text' || type === 'link';\n}\nfunction splitCNCharsBySpace(child, needInserted) {\n if (child === null || child === undefined) {\n return;\n }\n const SPACE = needInserted ? ' ' : '';\n if (typeof child !== 'string' && typeof child !== 'number' && isString(child.type) && isTwoCNChar(child.props.children)) {\n return cloneElement(child, {\n children: child.props.children.split('').join(SPACE)\n });\n }\n if (isString(child)) {\n return isTwoCNChar(child) ? /*#__PURE__*/React.createElement(\"span\", null, child.split('').join(SPACE)) : /*#__PURE__*/React.createElement(\"span\", null, child);\n }\n if (isFragment(child)) {\n return /*#__PURE__*/React.createElement(\"span\", null, child);\n }\n return child;\n}\nexport function spaceChildren(children, needInserted) {\n let isPrevChildPure = false;\n const childList = [];\n React.Children.forEach(children, child => {\n const type = typeof child;\n const isCurrentChildPure = type === 'string' || type === 'number';\n if (isPrevChildPure && isCurrentChildPure) {\n const lastIndex = childList.length - 1;\n const lastChild = childList[lastIndex];\n childList[lastIndex] = `${lastChild}${child}`;\n } else {\n childList.push(child);\n }\n isPrevChildPure = isCurrentChildPure;\n });\n return React.Children.map(childList, child => splitCNCharsBySpace(child, needInserted));\n}\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst ButtonTypes = ['default', 'primary', 'dashed', 'link', 'text'];\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst ButtonShapes = ['default', 'circle', 'round'];\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst ButtonHTMLTypes = ['submit', 'button', 'reset'];","map":{"version":3,"names":["React","cloneElement","isFragment","rxTwoCNChar","isTwoCNChar","test","bind","convertLegacyProps","type","danger","isString","str","isUnBorderedButtonType","splitCNCharsBySpace","child","needInserted","undefined","SPACE","props","children","split","join","createElement","spaceChildren","isPrevChildPure","childList","Children","forEach","isCurrentChildPure","lastIndex","length","lastChild","push","map","ButtonTypes","ButtonShapes","ButtonHTMLTypes"],"sources":["C:/Users/Аришина)/source/repos/PromoCursed/node_modules/antd/es/button/buttonHelpers.js"],"sourcesContent":["\"use client\";\n\nimport React from 'react';\nimport { cloneElement, isFragment } from '../_util/reactNode';\nconst rxTwoCNChar = /^[\\u4e00-\\u9fa5]{2}$/;\nexport const isTwoCNChar = rxTwoCNChar.test.bind(rxTwoCNChar);\nexport function convertLegacyProps(type) {\n if (type === 'danger') {\n return {\n danger: true\n };\n }\n return {\n type\n };\n}\nexport function isString(str) {\n return typeof str === 'string';\n}\nexport function isUnBorderedButtonType(type) {\n return type === 'text' || type === 'link';\n}\nfunction splitCNCharsBySpace(child, needInserted) {\n if (child === null || child === undefined) {\n return;\n }\n const SPACE = needInserted ? ' ' : '';\n if (typeof child !== 'string' && typeof child !== 'number' && isString(child.type) && isTwoCNChar(child.props.children)) {\n return cloneElement(child, {\n children: child.props.children.split('').join(SPACE)\n });\n }\n if (isString(child)) {\n return isTwoCNChar(child) ? /*#__PURE__*/React.createElement(\"span\", null, child.split('').join(SPACE)) : /*#__PURE__*/React.createElement(\"span\", null, child);\n }\n if (isFragment(child)) {\n return /*#__PURE__*/React.createElement(\"span\", null, child);\n }\n return child;\n}\nexport function spaceChildren(children, needInserted) {\n let isPrevChildPure = false;\n const childList = [];\n React.Children.forEach(children, child => {\n const type = typeof child;\n const isCurrentChildPure = type === 'string' || type === 'number';\n if (isPrevChildPure && isCurrentChildPure) {\n const lastIndex = childList.length - 1;\n const lastChild = childList[lastIndex];\n childList[lastIndex] = `${lastChild}${child}`;\n } else {\n childList.push(child);\n }\n isPrevChildPure = isCurrentChildPure;\n });\n return React.Children.map(childList, child => splitCNCharsBySpace(child, needInserted));\n}\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst ButtonTypes = ['default', 'primary', 'dashed', 'link', 'text'];\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst ButtonShapes = ['default', 'circle', 'round'];\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst ButtonHTMLTypes = ['submit', 'button', 'reset'];"],"mappings":"AAAA,YAAY;;AAEZ,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,YAAY,EAAEC,UAAU,QAAQ,oBAAoB;AAC7D,MAAMC,WAAW,GAAG,sBAAsB;AAC1C,OAAO,MAAMC,WAAW,GAAGD,WAAW,CAACE,IAAI,CAACC,IAAI,CAACH,WAAW,CAAC;AAC7D,OAAO,SAASI,kBAAkBA,CAACC,IAAI,EAAE;EACvC,IAAIA,IAAI,KAAK,QAAQ,EAAE;IACrB,OAAO;MACLC,MAAM,EAAE;IACV,CAAC;EACH;EACA,OAAO;IACLD;EACF,CAAC;AACH;AACA,OAAO,SAASE,QAAQA,CAACC,GAAG,EAAE;EAC5B,OAAO,OAAOA,GAAG,KAAK,QAAQ;AAChC;AACA,OAAO,SAASC,sBAAsBA,CAACJ,IAAI,EAAE;EAC3C,OAAOA,IAAI,KAAK,MAAM,IAAIA,IAAI,KAAK,MAAM;AAC3C;AACA,SAASK,mBAAmBA,CAACC,KAAK,EAAEC,YAAY,EAAE;EAChD,IAAID,KAAK,KAAK,IAAI,IAAIA,KAAK,KAAKE,SAAS,EAAE;IACzC;EACF;EACA,MAAMC,KAAK,GAAGF,YAAY,GAAG,GAAG,GAAG,EAAE;EACrC,IAAI,OAAOD,KAAK,KAAK,QAAQ,IAAI,OAAOA,KAAK,KAAK,QAAQ,IAAIJ,QAAQ,CAACI,KAAK,CAACN,IAAI,CAAC,IAAIJ,WAAW,CAACU,KAAK,CAACI,KAAK,CAACC,QAAQ,CAAC,EAAE;IACvH,OAAOlB,YAAY,CAACa,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