{"version":3,"sources":["webpack:///./src/custom-component/basic/Group.vue?0e71","webpack:///./src/utils/style.js","webpack:///./src/custom-component/basic/Group.vue","webpack:///src/custom-component/basic/Group.vue","webpack:///./src/custom-component/basic/Group.vue?50af","webpack:///./src/custom-component/basic/Group.vue?50d2"],"names":["getStyle","style","filter","arguments","length","undefined","needUnit","result","Object","keys","forEach","key","includes","transform","getComponentRotatedStyle","styles","_objectSpread","rotate","newWidth","width","cos","height","sin","diffX","left","right","newHeight","diffY","top","bottom","render","_vm","this","_c","_self","staticClass","_l","propValue","item","component","id","tag","groupStyle","attrs","staticRenderFns","props","type","Array","default","element","created","_this","parentStyle","toPercent","methods","val"],"mappings":"gHAAA,W,kICEO,SAASA,EAASC,GAAoB,IAAbC,EAAMC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,GAC/BG,EAAW,CAGb,WACA,QACA,SACA,MACA,OACA,cACA,gBACA,gBAGEC,EAAS,GAef,OAdAC,OAAOC,KAAKR,GAAOS,SAAQ,SAAUC,GAC5BT,EAAOU,SAASD,KACL,WAARA,GACAJ,EAAOI,GAAOV,EAAMU,GAEhBL,EAASM,SAASD,KAClBJ,EAAOI,IAAQ,OAGnBJ,EAAOM,UAAYF,EAAM,IAAMV,EAAMU,GAAO,WAKjDJ,EAIJ,SAASO,EAAyBC,GACrC,IAAId,EAAKe,eAAA,GAAQD,GACjB,GAAqB,IAAjBd,EAAMgB,OAAc,CACpB,IAAMC,EAAWjB,EAAMkB,MAAQC,eAAInB,EAAMgB,QAAUhB,EAAMoB,OAASC,eAAIrB,EAAMgB,QACtEM,GAAStB,EAAMkB,MAAQD,GAAY,EACzCjB,EAAMuB,MAAQD,EACdtB,EAAMwB,MAAQxB,EAAMuB,KAAON,EAE3B,IAAMQ,EAAYzB,EAAMoB,OAASD,eAAInB,EAAMgB,QAAUhB,EAAMkB,MAAQG,eAAIrB,EAAMgB,QACvEU,GAASD,EAAYzB,EAAMoB,QAAU,EAC3CpB,E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AA,CACAD,UAAA,SAAAE,GACA,WAAAA,EAAA,OChD8V,I,wBCQ1V,EAAY,eACd,EACAzB,EACAc,GACA,EACA,KACA,WACA,MAIa,e","file":"js/chunk-14bb840a.a0f638fc.js","sourcesContent":["export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Group.vue?vue&type=style&index=0&id=d835d25c&prod&lang=scss&scoped=true&\"","import { sin, cos } from '@/utils/translate';\r\n\r\nexport function getStyle(style, filter = []) {\r\n const needUnit = [\r\n // 可以按需扩展\r\n // 以下字段会加单位 px\r\n 'fontSize',\r\n 'width',\r\n 'height',\r\n 'top',\r\n 'left',\r\n 'borderWidth',\r\n 'letterSpacing',\r\n 'borderRadius',\r\n ];\r\n\r\n const result = {};\r\n Object.keys(style).forEach(function (key) {\r\n if (!filter.includes(key)) {\r\n if (key !== 'rotate') {\r\n result[key] = style[key];\r\n\r\n if (needUnit.includes(key)) {\r\n result[key] += 'px';\r\n }\r\n } else {\r\n result.transform = key + '(' + style[key] + 'deg)';\r\n }\r\n }\r\n });\r\n // console.log(result)\r\n return result;\r\n}\r\n\r\n// 获取一个组件旋转 rotate 后的样式\r\nexport function getComponentRotatedStyle(styles) {\r\n let style = { ...styles };\r\n if (style.rotate !== 0) {\r\n const newWidth = style.width * cos(style.rotate) + style.height * sin(style.rotate);\r\n const diffX = (style.width - newWidth) / 2; // 旋转后范围变小是正值,变大是负值\r\n style.left += diffX;\r\n style.right = style.left + newWidth;\r\n\r\n const newHeight = style.height * cos(style.rotate) + style.width * sin(style.rotate);\r\n const diffY = (newHeight - style.height) / 2; // 始终是正\r\n style.top -= diffY;\r\n style.bottom = style.top + newHeight;\r\n\r\n style.width = newWidth;\r\n style.height = newHeight;\r\n } else {\r\n style.bottom = style.top + style.height;\r\n style.right = style.left + style.width;\r\n }\r\n\r\n return style;\r\n}\r\n","var render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',{staticClass:\"group\"},[_c('div',[_vm._l((_vm.propValue),function(item){return [_c(item.component,{key:item.id,tag:\"component\",staticClass:\"component\",style:(item.groupStyle),attrs:{\"propValue\":item.propValue,\"id\":'component' + item.id,\"element\":item}})]})],2)])\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\n \r\n
\r\n \r\n \r\n \r\n
\r\n
\r\n\r\n\r\n\r\n\r\n\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Group.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Group.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./Group.vue?vue&type=template&id=d835d25c&scoped=true&\"\nimport script from \"./Group.vue?vue&type=script&lang=js&\"\nexport * from \"./Group.vue?vue&type=script&lang=js&\"\nimport style0 from \"./Group.vue?vue&type=style&index=0&id=d835d25c&prod&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"d835d25c\",\n null\n \n)\n\nexport default component.exports"],"sourceRoot":""}