PromoCursed/node_modules/.cache/babel-loader/c81d7077c637957d4c5ff8d503de4f1ae8df767e2112acb88556e0c5034fadee.json

1 line
10 KiB
JSON
Raw Normal View History

2024-08-20 23:25:37 +04:00
{"ast":null,"code":"/* eslint-disable no-nested-ternary */\nvar PIXEL_PATTERN = /margin|padding|width|height|max|min|offset/;\nvar removePixel = {\n left: true,\n top: true\n};\nvar floatMap = {\n cssFloat: 1,\n styleFloat: 1,\n float: 1\n};\nfunction getComputedStyle(node) {\n return node.nodeType === 1 ? node.ownerDocument.defaultView.getComputedStyle(node, null) : {};\n}\nfunction getStyleValue(node, type, value) {\n type = type.toLowerCase();\n if (value === 'auto') {\n if (type === 'height') {\n return node.offsetHeight;\n }\n if (type === 'width') {\n return node.offsetWidth;\n }\n }\n if (!(type in removePixel)) {\n removePixel[type] = PIXEL_PATTERN.test(type);\n }\n return removePixel[type] ? parseFloat(value) || 0 : value;\n}\nexport function get(node, name) {\n var length = arguments.length;\n var style = getComputedStyle(node);\n name = floatMap[name] ? 'cssFloat' in node.style ? 'cssFloat' : 'styleFloat' : name;\n return length === 1 ? style : getStyleValue(node, name, style[name] || node.style[name]);\n}\nexport function set(node, name, value) {\n var length = arguments.length;\n name = floatMap[name] ? 'cssFloat' in node.style ? 'cssFloat' : 'styleFloat' : name;\n if (length === 3) {\n if (typeof value === 'number' && PIXEL_PATTERN.test(name)) {\n value = \"\".concat(value, \"px\");\n }\n node.style[name] = value; // Number\n return value;\n }\n for (var x in name) {\n if (name.hasOwnProperty(x)) {\n set(node, x, name[x]);\n }\n }\n return getComputedStyle(node);\n}\nexport function getOuterWidth(el) {\n if (el === document.body) {\n return document.documentElement.clientWidth;\n }\n return el.offsetWidth;\n}\nexport function getOuterHeight(el) {\n if (el === document.body) {\n return window.innerHeight || document.documentElement.clientHeight;\n }\n return el.offsetHeight;\n}\nexport function getDocSize() {\n var width = Math.max(document.documentElement.scrollWidth, document.body.scrollWidth);\n var height = Math.max(document.documentElement.scrollHeight, document.body.scrollHeight);\n return {\n width: width,\n height: height\n };\n}\nexport function getClientSize() {\n var width = document.documentElement.clientWidth;\n var height = window.innerHeight || document.documentElement.clientHeight;\n return {\n width: width,\n height: height\n };\n}\nexport function getScroll() {\n return {\n scrollLeft: Math.max(document.documentElement.scrollLeft, document.body.scrollLeft),\n scrollTop: Math.max(document.documentElement.scrollTop, document.body.scrollTop)\n };\n}\nexport function getOffset(node) {\n var box = node.getBoundingClientRect();\n var docElem = document.documentElement;\n\n // < ie8 不支持 win.pageXOffset, 则使用 docElem.scrollLeft\n return {\n left: box.left + (window.pageXOffset || docElem.scrollLeft) - (docElem.clientLeft || document.body.clientLeft || 0),\n top: box.top + (window.pageYOffset || docElem.scrollTop) - (docElem.clientTop || document.body.clientTop || 0)\n };\n}","map":{"version":3,"names":["PIXEL_PATTERN","removePixel","left","top","floatMap","cssFloat","styleFloat","float","getComputedStyle","node","nodeType","ownerDocument","defaultView","getStyleValue","type","value","toLowerCase","offsetHeight","offsetWidth","test","parseFloat","get","name","length","arguments","style","set","concat","x","hasOwnProperty","getOuterWidth","el","document","body","documentElement","clientWidth","getOuterHeight","window","innerHeight","clientHeight","getDocSize","width","Math","max","scrollWidth","height","scrollHeight","getClientSize","getScroll","scrollLeft","scrollTop","getOffset","box","getBoundingClientRect","docElem","pageXOffset","clientLeft","pageYOffset","clientTop"],"sources":["C:/Users/Аришина)/Desktop/promo/node_modules/rc-util/es/Dom/css.js"],"sourcesContent":["/* eslint-disable no-nested-ternary */\nvar PIXEL_PATTERN = /margin|padding|width|height|max|min|offset/;\nvar removePixel = {\n left: true,\n top: true\n};\nvar floatMap = {\n cssFloat: