qauMaWeb/node_modules/.cache/babel-loader/6c74308be35cacc8b1d06c27985...

1 line
10 KiB
JSON
Raw Normal View History

2024-10-13 18:02:27 +08:00
{"ast":null,"code":"import \"core-js/modules/es.array.fill.js\";\nimport \"core-js/modules/es.array.join.js\";\nimport { DEFAULT_PATH_STYLE } from '../graphic/Path.js';\nimport ZRImage from '../graphic/Image.js';\nimport { getLineDash } from '../canvas/dashStyle.js';\nimport { map } from '../core/util.js';\nimport { normalizeColor } from './helper.js';\nvar NONE = 'none';\nvar mathRound = Math.round;\n\nfunction pathHasFill(style) {\n var fill = style.fill;\n return fill != null && fill !== NONE;\n}\n\nfunction pathHasStroke(style) {\n var stroke = style.stroke;\n return stroke != null && stroke !== NONE;\n}\n\nvar strokeProps = ['lineCap', 'miterLimit', 'lineJoin'];\nvar svgStrokeProps = map(strokeProps, function (prop) {\n return \"stroke-\" + prop.toLowerCase();\n});\nexport default function mapStyleToAttrs(updateAttr, style, el, forceUpdate) {\n var opacity = style.opacity == null ? 1 : style.opacity;\n\n if (el instanceof ZRImage) {\n updateAttr('opacity', opacity);\n return;\n }\n\n if (pathHasFill(style)) {\n var fill = normalizeColor(style.fill);\n updateAttr('fill', fill.color);\n var fillOpacity = style.fillOpacity != null ? style.fillOpacity * fill.opacity * opacity : fill.opacity * opacity;\n\n if (forceUpdate || fillOpacity < 1) {\n updateAttr('fill-opacity', fillOpacity);\n }\n } else {\n updateAttr('fill', NONE);\n }\n\n if (pathHasStroke(style)) {\n var stroke = normalizeColor(style.stroke);\n updateAttr('stroke', stroke.color);\n var strokeScale = style.strokeNoScale ? el.getLineScale() : 1;\n var strokeWidth = strokeScale ? (style.lineWidth || 0) / strokeScale : 0;\n var strokeOpacity = style.strokeOpacity != null ? style.strokeOpacity * stroke.opacity * opacity : stroke.opacity * opacity;\n var strokeFirst = style.strokeFirst;\n\n if (forceUpdate || strokeWidth !== 1) {\n updateAttr('stroke-width', strokeWidth);\n }\n\n if (forceUpdate || strokeFirst) {\n updateAttr('paint-order', strokeFirst ? 'stroke' : 'fill');\n }\n\n if (forceUpdate || strokeOpacity < 1) {\n updateAttr('stroke-opacity', strokeOpacity);\n }\n\n if (style.lineDash) {\n var _a = getLineDash(el),\n lineDash = _a[0],\n lineDashOffset = _a[1];\n\n if (lineDash) {\n lineDashOffset = mathRound(lineDashOffset || 0);\n updateAttr('stroke-dasharray', lineDash.join(','));\n\n if (lineDashOffset || forceUpdate) {\n updateAttr('stroke-dashoffset', lineDashOffset);\n }\n }\n } else if (forceUpdate) {\n updateAttr('stroke-dasharray', NONE);\n }\n\n for (var i = 0; i < strokeProps.length; i++) {\n var propName = strokeProps[i];\n\n if (forceUpdate || style[propName] !== DEFAULT_PATH_STYLE[propName]) {\n var val = style[propName] || DEFAULT_PATH_STYLE[propName];\n val && updateAttr(svgStrokeProps[i], val);\n }\n }\n } else if (forceUpdate) {\n updateAttr('stroke', NONE);\n }\n}","map":{"version":3,"sources":["D:/Work/WorkSpace/GitWorkSpace/TenShop/resource/ElectronicMall/src/qingge-Market/qingge-vue/node_modules/zrender/lib/svg/mapStyleToAttrs.js"],"names":["DEFAULT_PATH_STYLE","ZRImage","getLineDash","map","normalizeColor","NONE","mathRound","Math","round","pathHasFill","style","fill","pathHasStroke","stroke","strokeProps","svgStrokeProps","prop","toLowerCase","mapStyleToAttrs","updateAttr","el","forceUpdate","opacity","color","fillOpacity","strokeScale","strokeNoScale","getLineScale","strokeWidth","lineWidth","strokeOpacity","strokeFirst","lineDash","_a","lineDashOffset","join","i","length","propName","val"],"mappings":";;AAAA,SAASA,kBAAT,QAAmC,oBAAnC;AACA,OAAOC,OAAP,MAAoB,qBAApB;AACA,SAASC,WAAT,QAA4B,wBAA5B;AACA,SAASC,GAAT,QAAoB,iBAApB;AACA,SAASC,cAAT,QAA+B,aAA/B;AACA,IAAIC,IAAI,GAAG,MAAX;AACA,IAAIC,SAAS,GAAGC,IAAI,CAACC,KAArB;;AACA,SAASC,WAAT,CAAqBC,KAArB,EAA4B;AACxB,MAAIC,IAAI,GAAGD,KAAK,CAACC,IAAjB;AACA,SAAOA,IAAI,IAAI,IAAR,IAAgBA,IAAI,KAAKN,IAAhC;AACH;;AACD,SAASO,aAAT,CAAuBF,KAAvB,EAA8B;AAC1B,MAAIG,MAAM,GAAGH,KAAK,CAACG,MAAnB;AA