qauMaWeb/node_modules/.cache/babel-loader/28fb96d86a5daa87d71ae22e688...

1 line
42 KiB
JSON
Raw Normal View History

2024-10-13 18:02:27 +08:00
{"ast":null,"code":"import _typeof from \"D:/Work/WorkSpace/GitWorkSpace/TenShop/resource/ElectronicMall/src/ElectronicMallVue/node_modules/@babel/runtime/helpers/esm/typeof.js\";\nimport \"core-js/modules/es.array.concat.js\";\nimport \"core-js/modules/es.array.fill.js\";\nimport { __extends } from \"tslib\";\nimport Displayable, { DEFAULT_COMMON_STYLE, DEFAULT_COMMON_ANIMATION_PROPS } from './Displayable.js';\nimport PathProxy from '../core/PathProxy.js';\nimport * as pathContain from '../contain/path.js';\nimport { defaults, keys, extend, clone, isString, createObject } from '../core/util.js';\nimport { lum } from '../tool/color.js';\nimport { DARK_LABEL_COLOR, LIGHT_LABEL_COLOR, DARK_MODE_THRESHOLD, LIGHTER_LABEL_COLOR } from '../config.js';\nimport { REDRAW_BIT, SHAPE_CHANGED_BIT, STYLE_CHANGED_BIT } from './constants.js';\nimport { TRANSFORMABLE_PROPS } from '../core/Transformable.js';\nexport var DEFAULT_PATH_STYLE = defaults({\n fill: '#000',\n stroke: null,\n strokePercent: 1,\n fillOpacity: 1,\n strokeOpacity: 1,\n lineDashOffset: 0,\n lineWidth: 1,\n lineCap: 'butt',\n miterLimit: 10,\n strokeNoScale: false,\n strokeFirst: false\n}, DEFAULT_COMMON_STYLE);\nexport var DEFAULT_PATH_ANIMATION_PROPS = {\n style: defaults({\n fill: true,\n stroke: true,\n strokePercent: true,\n fillOpacity: true,\n strokeOpacity: true,\n lineDashOffset: true,\n lineWidth: true,\n miterLimit: true\n }, DEFAULT_COMMON_ANIMATION_PROPS.style)\n};\nvar pathCopyParams = TRANSFORMABLE_PROPS.concat(['invisible', 'culling', 'z', 'z2', 'zlevel', 'parent']);\n\nvar Path = function (_super) {\n __extends(Path, _super);\n\n function Path(opts) {\n return _super.call(this, opts) || this;\n }\n\n Path.prototype.update = function () {\n var _this = this;\n\n _super.prototype.update.call(this);\n\n var style = this.style;\n\n if (style.decal) {\n var decalEl = this._decalEl = this._decalEl || new Path();\n\n if (decalEl.buildPath === Path.prototype.buildPath) {\n decalEl.buildPath = function (ctx) {\n _this.buildPath(ctx, _this.shape);\n };\n }\n\n decalEl.silent = true;\n var decalElStyle = decalEl.style;\n\n for (var key in style) {\n if (decalElStyle[key] !== style[key]) {\n decalElStyle[key] = style[key];\n }\n }\n\n decalElStyle.fill = style.fill ? style.decal : null;\n decalElStyle.decal = null;\n decalElStyle.shadowColor = null;\n style.strokeFirst && (decalElStyle.stroke = null);\n\n for (var i = 0; i < pathCopyParams.length; ++i) {\n decalEl[pathCopyParams[i]] = this[pathCopyParams[i]];\n }\n\n decalEl.__dirty |= REDRAW_BIT;\n } else if (this._decalEl) {\n this._decalEl = null;\n }\n };\n\n Path.prototype.getDecalElement = function () {\n return this._decalEl;\n };\n\n Path.prototype._init = function (props) {\n var keysArr = keys(props);\n this.shape = this.getDefaultShape();\n var defaultStyle = this.getDefaultStyle();\n\n if (defaultStyle) {\n this.useStyle(defaultStyle);\n }\n\n for (var i = 0; i < keysArr.length; i++) {\n var key = keysArr[i];\n var value = props[key];\n\n if (key === 'style') {\n if (!this.style) {\n this.useStyle(value);\n } else {\n extend(this.style, value);\n }\n } else if (key === 'shape') {\n extend(this.shape, value);\n } else {\n _super.prototype.attrKV.call(this, key, value);\n }\n }\n\n if (!this.style) {\n this.useStyle({});\n }\n };\n\n Path.prototype.getDefaultStyle = function () {\n return null;\n };\n\n Path.prototype.getDefaultShape = function () {\n return {};\n };\n\n Path.prototype.canBeInsideText = function () {\n return this.hasFill();\n };\n\n Path.prototype.getInsideTextFill = function () {\n var pathFill = this.style.fill;\n\n if (pathFill !== 'none') {\n if (isString(pathFill)) {\n var fillLum = lum(pathFill, 0);\n\n if (fillLum > 0.5) {\n