qauMaWeb/node_modules/.cache/babel-loader/27fd8dca4876c87cff284cd33a2...

1 line
21 KiB
JSON

{"ast":null,"code":"import \"core-js/modules/es.array.splice.js\";\nimport \"core-js/modules/es.function.name.js\";\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n\n/**\r\n * AUTO-GENERATED FILE. DO NOT MODIFY.\r\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as graphic from '../../util/graphic.js';\nimport { getECData } from '../../util/innerStore.js';\nimport * as layout from '../../util/layout.js';\nimport { wrapTreePathInfo } from '../helper/treeHelper.js';\nimport { curry, defaults } from 'zrender/lib/core/util.js';\nimport { convertOptionIdName } from '../../util/model.js';\nimport { Z2_EMPHASIS_LIFT } from '../../util/states.js';\nvar TEXT_PADDING = 8;\nvar ITEM_GAP = 8;\nvar ARRAY_LENGTH = 5;\n\nvar Breadcrumb =\n/** @class */\nfunction () {\n function Breadcrumb(containerGroup) {\n this.group = new graphic.Group();\n containerGroup.add(this.group);\n }\n\n Breadcrumb.prototype.render = function (seriesModel, api, targetNode, onSelect) {\n var model = seriesModel.getModel('breadcrumb');\n var thisGroup = this.group;\n thisGroup.removeAll();\n\n if (!model.get('show') || !targetNode) {\n return;\n }\n\n var normalStyleModel = model.getModel('itemStyle'); // let emphasisStyleModel = model.getModel('emphasis.itemStyle');\n\n var textStyleModel = normalStyleModel.getModel('textStyle');\n var layoutParam = {\n pos: {\n left: model.get('left'),\n right: model.get('right'),\n top: model.get('top'),\n bottom: model.get('bottom')\n },\n box: {\n width: api.getWidth(),\n height: api.getHeight()\n },\n emptyItemWidth: model.get('emptyItemWidth'),\n totalWidth: 0,\n renderList: []\n };\n\n this._prepare(targetNode, layoutParam, textStyleModel);\n\n this._renderContent(seriesModel, layoutParam, normalStyleModel, textStyleModel, onSelect);\n\n layout.positionElement(thisGroup, layoutParam.pos, layoutParam.box);\n };\n /**\r\n * Prepare render list and total width\r\n * @private\r\n */\n\n\n Breadcrumb.prototype._prepare = function (targetNode, layoutParam, textStyleModel) {\n for (var node = targetNode; node; node = node.parentNode) {\n var text = convertOptionIdName(node.getModel().get('name'), '');\n var textRect = textStyleModel.getTextRect(text);\n var itemWidth = Math.max(textRect.width + TEXT_PADDING * 2, layoutParam.emptyItemWidth);\n layoutParam.totalWidth += itemWidth + ITEM_GAP;\n layoutParam.renderList.push({\n node: node,\n text: text,\n width: itemWidth\n });\n }\n };\n /**\r\n * @private\r\n */\n\n\n Breadcrumb.prototype._renderContent = function (seriesModel, layoutParam, normalStyleModel, textStyleModel, onSelect) {\n // Start rendering.\n var lastX = 0;\n var emptyItemWidth = layoutParam.emptyItemWidth;\n var height = seriesModel.get(['breadcrumb', 'height']);\n var availableSize = layout.getAvailableSize(layoutParam.pos, layoutParam.box);\n var totalWidth = layoutParam.totalWidth;\n var renderList = layoutParam.renderList;\n\n for (var i = renderList.length - 1; i >= 0; i--) {\n var item = renderList[i];\n var itemNode = item.node;\n var itemWidth = item.width;\n var text = item.text; // Hdie text and shorten width if necessary.\n\n if (totalWidth > availableSize.width) {\n totalWidth -= itemWidth - emptyItemWidth;\n itemWidth = emptyItemWidth;\n text = null;\n }\n\n var el = new graphic.Polygon({\n shape: {\n points: makeItemPoints(lastX, 0, itemWidth, height, i === renderList.length - 1, i === 0)\n },\n style: defaults(normalStyleModel.getItemStyle(), {\n lineJoin: 'bevel'\n }),\n textContent: new graphic.Text({\n style: {\n text: text,\n fill: textStyleModel.getTextColor(),\n font: textStyleModel.getFont()\n }\n }),\n textConfig: {\n position: 'inside'\n },\n z2: Z2_EMPHASIS_LIFT * 1e4,\n onclick: curry(onSelect, itemNode)\n });\n el.disableLabelAnimation = true;\n this.group.add(el);\n packEventData(el, seriesModel, itemNode);\n lastX += itemWidth + ITEM_GAP;\n }\n };\n\n Breadcrumb.prototype.remove = function () {\n this.group.removeAll();\n };\n\n return Breadcrumb;\n}();\n\nfunction makeItemPoints(x, y, itemWidth, itemHeight, head, tail) {\n var points = [[head ? x : x - ARRAY_LENGTH, y], [x + itemWidth, y], [x + itemWidth, y + itemHeight], [head ? x : x - ARRAY_LENGTH, y + itemHeight]];\n !tail && points.splice(2, 0, [x + itemWidth + ARRAY_LENGTH, y + itemHeight / 2]);\n !head && points.push([x, y + itemHeight / 2]);\n return points;\n} // Package custom mouse event.\n\n\nfunction packEventData(el, seriesModel, itemNode) {\n getECData(el).eventData = {\n componentType: 'series',\n componentSubType: 'treemap',\n componentIndex: seriesModel.componentIndex,\n seriesIndex: seriesModel.seriesIndex,\n seriesName: seriesModel.name,\n seriesType: 'treemap',\n selfType: 'breadcrumb',\n nodeData: {\n dataIndex: itemNode && itemNode.dataIndex,\n name: itemNode && itemNode.name\n },\n treePathInfo: itemNode && wrapTreePathInfo(itemNode, seriesModel)\n };\n}\n\nexport default Breadcrumb;","map":{"version":3,"sources":["D:/Work/WorkSpace/GitWorkSpace/TenShop/resource/ElectronicMall/src/qingge-Market/qingge-vue/node_modules/echarts/lib/chart/treemap/Breadcrumb.js"],"names":["graphic","getECData","layout","wrapTreePathInfo","curry","defaults","convertOptionIdName","Z2_EMPHASIS_LIFT","TEXT_PADDING","ITEM_GAP","ARRAY_LENGTH","Breadcrumb","containerGroup","group","Group","add","prototype","render","seriesModel","api","targetNode","onSelect","model","getModel","thisGroup","removeAll","get","normalStyleModel","textStyleModel","layoutParam","pos","left","right","top","bottom","box","width","getWidth","height","getHeight","emptyItemWidth","totalWidth","renderList","_prepare","_renderContent","positionElement","node","parentNode","text","textRect","getTextRect","itemWidth","Math","max","push","lastX","availableSize","getAvailableSize","i","length","item","itemNode","el","Polygon","shape","points","makeItemPoints","style","getItemStyle","lineJoin","textContent","Text","fill","getTextColor","font","getFont","textConfig","position","z2","onclick","disableLabelAnimation","packEventData","remove","x","y","itemHeight","head","tail","splice","eventData","componentType","componentSubType","componentIndex","seriesIndex","seriesName","name","seriesType","selfType","nodeData","dataIndex","treePathInfo"],"mappings":";;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,KAAKA,OAAZ,MAAyB,uBAAzB;AACA,SAASC,SAAT,QAA0B,0BAA1B;AACA,OAAO,KAAKC,MAAZ,MAAwB,sBAAxB;AACA,SAASC,gBAAT,QAAiC,yBAAjC;AACA,SAASC,KAAT,EAAgBC,QAAhB,QAAgC,0BAAhC;AACA,SAASC,mBAAT,QAAoC,qBAApC;AACA,SAASC,gBAAT,QAAiC,sBAAjC;AACA,IAAIC,YAAY,GAAG,CAAnB;AACA,IAAIC,QAAQ,GAAG,CAAf;AACA,IAAIC,YAAY,GAAG,CAAnB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eAAeP,UAAf","sourcesContent":["\r\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n\r\n/**\r\n * AUTO-GENERATED FILE. DO NOT MODIFY.\r\n */\r\n\r\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\nimport * as graphic from '../../util/graphic.js';\r\nimport { getECData } from '../../util/innerStore.js';\r\nimport * as layout from '../../util/layout.js';\r\nimport { wrapTreePathInfo } from '../helper/treeHelper.js';\r\nimport { curry, defaults } from 'zrender/lib/core/util.js';\r\nimport { convertOptionIdName } from '../../util/model.js';\r\nimport { Z2_EMPHASIS_LIFT } from '../../util/states.js';\r\nvar TEXT_PADDING = 8;\r\nvar ITEM_GAP = 8;\r\nvar ARRAY_LENGTH = 5;\r\n\r\nvar Breadcrumb =\r\n/** @class */\r\nfunction () {\r\n function Breadcrumb(containerGroup) {\r\n this.group = new graphic.Group();\r\n containerGroup.add(this.group);\r\n }\r\n\r\n Breadcrumb.prototype.render = function (seriesModel, api, targetNode, onSelect) {\r\n var model = seriesModel.getModel('breadcrumb');\r\n var thisGroup = this.group;\r\n thisGroup.removeAll();\r\n\r\n if (!model.get('show') || !targetNode) {\r\n return;\r\n }\r\n\r\n var normalStyleModel = model.getModel('itemStyle'); // let emphasisStyleModel = model.getModel('emphasis.itemStyle');\r\n\r\n var textStyleModel = normalStyleModel.getModel('textStyle');\r\n var layoutParam = {\r\n pos: {\r\n left: model.get('left'),\r\n right: model.get('right'),\r\n top: model.get('top'),\r\n bottom: model.get('bottom')\r\n },\r\n box: {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n },\r\n emptyItemWidth: model.get('emptyItemWidth'),\r\n totalWidth: 0,\r\n renderList: []\r\n };\r\n\r\n this._prepare(targetNode, layoutParam, textStyleModel);\r\n\r\n this._renderContent(seriesModel, layoutParam, normalStyleModel, textStyleModel, onSelect);\r\n\r\n layout.positionElement(thisGroup, layoutParam.pos, layoutParam.box);\r\n };\r\n /**\r\n * Prepare render list and total width\r\n * @private\r\n */\r\n\r\n\r\n Breadcrumb.prototype._prepare = function (targetNode, layoutParam, textStyleModel) {\r\n for (var node = targetNode; node; node = node.parentNode) {\r\n var text = convertOptionIdName(node.getModel().get('name'), '');\r\n var textRect = textStyleModel.getTextRect(text);\r\n var itemWidth = Math.max(textRect.width + TEXT_PADDING * 2, layoutParam.emptyItemWidth);\r\n layoutParam.totalWidth += itemWidth + ITEM_GAP;\r\n layoutParam.renderList.push({\r\n node: node,\r\n text: text,\r\n width: itemWidth\r\n });\r\n }\r\n };\r\n /**\r\n * @private\r\n */\r\n\r\n\r\n Breadcrumb.prototype._renderContent = function (seriesModel, layoutParam, normalStyleModel, textStyleModel, onSelect) {\r\n // Start rendering.\r\n var lastX = 0;\r\n var emptyItemWidth = layoutParam.emptyItemWidth;\r\n var height = seriesModel.get(['breadcrumb', 'height']);\r\n var availableSize = layout.getAvailableSize(layoutParam.pos, layoutParam.box);\r\n var totalWidth = layoutParam.totalWidth;\r\n var renderList = layoutParam.renderList;\r\n\r\n for (var i = renderList.length - 1; i >= 0; i--) {\r\n var item = renderList[i];\r\n var itemNode = item.node;\r\n var itemWidth = item.width;\r\n var text = item.text; // Hdie text and shorten width if necessary.\r\n\r\n if (totalWidth > availableSize.width) {\r\n totalWidth -= itemWidth - emptyItemWidth;\r\n itemWidth = emptyItemWidth;\r\n text = null;\r\n }\r\n\r\n var el = new graphic.Polygon({\r\n shape: {\r\n points: makeItemPoints(lastX, 0, itemWidth, height, i === renderList.length - 1, i === 0)\r\n },\r\n style: defaults(normalStyleModel.getItemStyle(), {\r\n lineJoin: 'bevel'\r\n }),\r\n textContent: new graphic.Text({\r\n style: {\r\n text: text,\r\n fill: textStyleModel.getTextColor(),\r\n font: textStyleModel.getFont()\r\n }\r\n }),\r\n textConfig: {\r\n position: 'inside'\r\n },\r\n z2: Z2_EMPHASIS_LIFT * 1e4,\r\n onclick: curry(onSelect, itemNode)\r\n });\r\n el.disableLabelAnimation = true;\r\n this.group.add(el);\r\n packEventData(el, seriesModel, itemNode);\r\n lastX += itemWidth + ITEM_GAP;\r\n }\r\n };\r\n\r\n Breadcrumb.prototype.remove = function () {\r\n this.group.removeAll();\r\n };\r\n\r\n return Breadcrumb;\r\n}();\r\n\r\nfunction makeItemPoints(x, y, itemWidth, itemHeight, head, tail) {\r\n var points = [[head ? x : x - ARRAY_LENGTH, y], [x + itemWidth, y], [x + itemWidth, y + itemHeight], [head ? x : x - ARRAY_LENGTH, y + itemHeight]];\r\n !tail && points.splice(2, 0, [x + itemWidth + ARRAY_LENGTH, y + itemHeight / 2]);\r\n !head && points.push([x, y + itemHeight / 2]);\r\n return points;\r\n} // Package custom mouse event.\r\n\r\n\r\nfunction packEventData(el, seriesModel, itemNode) {\r\n getECData(el).eventData = {\r\n componentType: 'series',\r\n componentSubType: 'treemap',\r\n componentIndex: seriesModel.componentIndex,\r\n seriesIndex: seriesModel.seriesIndex,\r\n seriesName: seriesModel.name,\r\n seriesType: 'treemap',\r\n selfType: 'breadcrumb',\r\n nodeData: {\r\n dataIndex: itemNode && itemNode.dataIndex,\r\n name: itemNode && itemNode.name\r\n },\r\n treePathInfo: itemNode && wrapTreePathInfo(itemNode, seriesModel)\r\n };\r\n}\r\n\r\nexport default Breadcrumb;"]},"metadata":{},"sourceType":"module"}