1 line
5.0 KiB
JSON
1 line
5.0 KiB
JSON
|
{"ast":null,"code":"import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport { getClientSize } from \"rc-util/es/Dom/css\";\nfunction fixPoint(key, start, width, clientWidth) {\n var startAddWidth = start + width;\n var offsetStart = (width - clientWidth) / 2;\n if (width > clientWidth) {\n if (start > 0) {\n return _defineProperty({}, key, offsetStart);\n }\n if (start < 0 && startAddWidth < clientWidth) {\n return _defineProperty({}, key, -offsetStart);\n }\n } else if (start < 0 || startAddWidth > clientWidth) {\n return _defineProperty({}, key, start < 0 ? offsetStart : -offsetStart);\n }\n return {};\n}\n\n/**\n * Fix positon x,y point when\n *\n * Ele width && height < client\n * - Back origin\n *\n * - Ele width | height > clientWidth | clientHeight\n * - left | top > 0 -> Back 0\n * - left | top + width | height < clientWidth | clientHeight -> Back left | top + width | height === clientWidth | clientHeight\n *\n * Regardless of other\n */\nexport default function getFixScaleEleTransPosition(width, height, left, top) {\n var _getClientSize = getClientSize(),\n clientWidth = _getClientSize.width,\n clientHeight = _getClientSize.height;\n var fixPos = null;\n if (width <= clientWidth && height <= clientHeight) {\n fixPos = {\n x: 0,\n y: 0\n };\n } else if (width > clientWidth || height > clientHeight) {\n fixPos = _objectSpread(_objectSpread({}, fixPoint('x', left, width, clientWidth)), fixPoint('y', top, height, clientHeight));\n }\n return fixPos;\n}","map":{"version":3,"names":["_objectSpread","_defineProperty","getClientSize","fixPoint","key","start","width","clientWidth","startAddWidth","offsetStart","getFixScaleEleTransPosition","height","left","top","_getClientSize","clientHeight","fixPos","x","y"],"sources":["C:/Users/Аришина)/Desktop/promo/node_modules/rc-image/es/getFixScaleEleTransPosition.js"],"sourcesContent":["import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport { getClientSize } from \"rc-util/es/Dom/css\";\nfunction fixPoint(key, start, width, clientWidth) {\n var startAddWidth = start + width;\n var offsetStart = (width - clientWidth) / 2;\n if (width > clientWidth) {\n if (start > 0) {\n return _defineProperty({}, key, offsetStart);\n }\n if (start < 0 && startAddWidth < clientWidth) {\n return _defineProperty({}, key, -offsetStart);\n }\n } else if (start < 0 || startAddWidth > clientWidth) {\n return _defineProperty({}, key, start < 0 ? offsetStart : -offsetStart);\n }\n return {};\n}\n\n/**\n * Fix positon x,y point when\n *\n * Ele width && height < client\n * - Back origin\n *\n * - Ele width | height > clientWidth | clientHeight\n * - left | top > 0 -> Back 0\n * - left | top + width | height < clientWidth | clientHeight -> Back left | top + width | height === clientWidth | clientHeight\n *\n * Regardless of other\n */\nexport default function getFixScaleEleTransPosition(width, height, left, top) {\n var _getClientSize = getClientSize(),\n clientWidth = _getClientSize.width,\n clientHeight = _getClientSize.height;\n var fixPos = null;\n if (width <= clientWidth && height <= clientHeight) {\n fixPos = {\n x: 0,\n y: 0\n };\n } else if (width > clientWidth || height > clientHeight) {\n fixPos = _objectSpread(_objectSpread({}, fixPoint('x', left, width, clientWidth)), fixPoint('y', top, height, clientHeight));\n }\n return fixPos;\n}"],"mappings":"AAAA,OAAOA,aAAa,MAAM,0CAA0C;AACpE,OAAOC,eAAe,MAAM,2CAA2C;AACvE,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,QAAQA,CAACC,GAAG,EAAEC,KAAK,EAAEC,KAAK,EAAEC,WAAW,EAAE;EAChD,IAAIC,aAAa,GAAGH,KAAK,GAAGC,KAAK;EACjC,IAAIG,WAAW,GAAG,CAACH,KAAK,GAAGC,WAAW,IAAI,CAAC;EAC3C,IAAID,KAAK,GAAGC,WAAW,EAAE;IACvB,IAAIF,KAAK,GAAG,CAAC,EAAE;MACb,OAAOJ,eAAe,CAAC,CAAC,CAAC,EAAEG,GAAG,EAAEK,WAAW,CAAC;IAC9C;IACA,IAAIJ,KAAK,GAAG,CAAC,IAAIG,aAAa,GAAGD,WAAW,EAAE
|