1 line
6.7 KiB
JSON
1 line
6.7 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};\n/**\n * Wrap of sub component which need use as Button capacity (like Icon component).\n *\n * This helps accessibility reader to tread as a interactive button to operation.\n */\nimport * as React from 'react';\nimport KeyCode from \"rc-util/es/KeyCode\";\nconst inlineStyle = {\n border: 0,\n background: 'transparent',\n padding: 0,\n lineHeight: 'inherit',\n display: 'inline-flex'\n};\nconst TransButton = /*#__PURE__*/React.forwardRef((props, ref) => {\n const onKeyDown = event => {\n const {\n keyCode\n } = event;\n if (keyCode === KeyCode.ENTER) {\n event.preventDefault();\n }\n };\n const onKeyUp = event => {\n const {\n keyCode\n } = event;\n const {\n onClick\n } = props;\n if (keyCode === KeyCode.ENTER && onClick) {\n onClick();\n }\n };\n const {\n style,\n noStyle,\n disabled,\n tabIndex = 0\n } = props,\n restProps = __rest(props, [\"style\", \"noStyle\", \"disabled\", \"tabIndex\"]);\n let mergedStyle = {};\n if (!noStyle) {\n mergedStyle = Object.assign({}, inlineStyle);\n }\n if (disabled) {\n mergedStyle.pointerEvents = 'none';\n }\n mergedStyle = Object.assign(Object.assign({}, mergedStyle), style);\n return /*#__PURE__*/React.createElement(\"div\", Object.assign({\n role: \"button\",\n tabIndex: tabIndex,\n ref: ref\n }, restProps, {\n onKeyDown: onKeyDown,\n onKeyUp: onKeyUp,\n style: mergedStyle\n }));\n});\nexport default TransButton;","map":{"version":3,"names":["__rest","s","e","t","p","Object","prototype","hasOwnProperty","call","indexOf","getOwnPropertySymbols","i","length","propertyIsEnumerable","React","KeyCode","inlineStyle","border","background","padding","lineHeight","display","TransButton","forwardRef","props","ref","onKeyDown","event","keyCode","ENTER","preventDefault","onKeyUp","onClick","style","noStyle","disabled","tabIndex","restProps","mergedStyle","assign","pointerEvents","createElement","role"],"sources":["C:/Users/Аришина)/source/repos/PromoCursed/node_modules/antd/es/_util/transButton.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};\n/**\n * Wrap of sub component which need use as Button capacity (like Icon component).\n *\n * This helps accessibility reader to tread as a interactive button to operation.\n */\nimport * as React from 'react';\nimport KeyCode from \"rc-util/es/KeyCode\";\nconst inlineStyle = {\n border: 0,\n background: 'transparent',\n padding: 0,\n lineHeight: 'inherit',\n display: 'inline-flex'\n};\nconst TransButton = /*#__PURE__*/React.forwardRef((props, ref) => {\n const onKeyDown = event => {\n const {\n keyCode\n } = event;\n if (keyCode === KeyCode.ENTER) {\n event.preventDefault();\n }\n };\n const onKeyUp = event => {\n const {\n keyCode\n } = event;\n const {\n onClick\n } = props;\n if (keyCode === KeyCode.ENTER && onClick) {\n onClick();\n }\n };\n const {\n style,\n noStyle,\n disabled,\n tabIndex = 0\n } = props,\n restProps = __rest(props, [\"style\", \"noStyle\", \"disabled\", \"tabIndex\"]);\n let mergedStyle = {};\n if (!n
|