1 line
14 KiB
JSON
1 line
14 KiB
JSON
{"ast":null,"code":"/*\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 zrUtil from 'zrender/lib/core/util.js';\nimport * as graphic from '../util/graphic.js';\nvar PI = Math.PI;\n/**\r\n * @param {module:echarts/ExtensionAPI} api\r\n * @param {Object} [opts]\r\n * @param {string} [opts.text]\r\n * @param {string} [opts.color]\r\n * @param {string} [opts.textColor]\r\n * @return {module:zrender/Element}\r\n */\n\nexport default function defaultLoading(api, opts) {\n opts = opts || {};\n zrUtil.defaults(opts, {\n text: 'loading',\n textColor: '#000',\n fontSize: 12,\n fontWeight: 'normal',\n fontStyle: 'normal',\n fontFamily: 'sans-serif',\n maskColor: 'rgba(255, 255, 255, 0.8)',\n showSpinner: true,\n color: '#5470c6',\n spinnerRadius: 10,\n lineWidth: 5,\n zlevel: 0\n });\n var group = new graphic.Group();\n var mask = new graphic.Rect({\n style: {\n fill: opts.maskColor\n },\n zlevel: opts.zlevel,\n z: 10000\n });\n group.add(mask);\n var textContent = new graphic.Text({\n style: {\n text: opts.text,\n fill: opts.textColor,\n fontSize: opts.fontSize,\n fontWeight: opts.fontWeight,\n fontStyle: opts.fontStyle,\n fontFamily: opts.fontFamily\n },\n zlevel: opts.zlevel,\n z: 10001\n });\n var labelRect = new graphic.Rect({\n style: {\n fill: 'none'\n },\n textContent: textContent,\n textConfig: {\n position: 'right',\n distance: 10\n },\n zlevel: opts.zlevel,\n z: 10001\n });\n group.add(labelRect);\n var arc;\n\n if (opts.showSpinner) {\n arc = new graphic.Arc({\n shape: {\n startAngle: -PI / 2,\n endAngle: -PI / 2 + 0.1,\n r: opts.spinnerRadius\n },\n style: {\n stroke: opts.color,\n lineCap: 'round',\n lineWidth: opts.lineWidth\n },\n zlevel: opts.zlevel,\n z: 10001\n });\n arc.animateShape(true).when(1000, {\n endAngle: PI * 3 / 2\n }).start('circularInOut');\n arc.animateShape(true).when(1000, {\n startAngle: PI * 3 / 2\n }).delay(300).start('circularInOut');\n group.add(arc);\n } // Inject resize\n\n\n group.resize = function () {\n var textWidth = textContent.getBoundingRect().width;\n var r = opts.showSpinner ? opts.spinnerRadius : 0; // cx = (containerWidth - arcDiameter - textDistance - textWidth) / 2\n // textDistance needs to be calculated when both animation and text exist\n\n var cx = (api.getWidth() - r * 2 - (opts.showSpinner && textWidth ? 10 : 0) - textWidth) / 2 - (opts.showSpinner && textWidth ? 0 : 5 + textWidth / 2) // only show the text\n + (opts.showSpinner ? 0 : textWidth / 2) // only show the spinner\n + (textWidth ? 0 : r);\n var cy = api.getHeight() / 2;\n opts.showSpinner && arc.setShape({\n cx: cx,\n cy: cy\n });\n labelRect.setShape({\n x: cx - r,\n y: cy - r,\n width: r * 2,\n height: r * 2\n });\n mask.setShape({\n x: 0,\n y: 0,\n width: api.getWidth(),\n height: api.getHeight()\n });\n };\n\n group.resize();\n return group;\n}","map":{"version":3,"sources":["D:/Work/WorkSpace/GitWorkSpace/TenShop/resource/ElectronicMall/src/qingge-Market/qingge-vue/node_modules/echarts/lib/loading/default.js"],"names":["zrUtil","graphic","PI","Math","defaultLoading","api","opts","defaults","text","textColor","fontSize","fontWeight","fontStyle","fontFamily","maskColor","showSpinner","color","spinnerRadius","lineWidth","zlevel","group","Group","mask","Rect","style","fill","z","add","textContent","Text","labelRect","textConfig","position","distance","arc","Arc","shape","startAngle","endAngle","r","stroke","lineCap","animateShape","when","start","delay","resize","textWidth","getBoundingRect","width","cx","getWidth","cy","getHeight","setShape","x","y","height"],"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,MAAZ,MAAwB,0BAAxB;AACA,OAAO,KAAKC,OAAZ,MAAyB,oBAAzB;AACA,IAAIC,EAAE,GAAGC,IAAI,CAACD,EAAd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,eAAe,SAASE,cAAT,CAAwBC,GAAxB,EAA6BC,IAA7B,EAAmC;AAChDA,EAAAA,IAAI,GAAGA,IAAI,IAAI,EAAf;AACAN,EAAAA,MAAM,CAACO,QAAP,CAAgBD,IAAhB,EAAsB;AACpBE,IAAAA,IAAI,EAAE,SADc;AAEpBC,IAAAA,SAAS,EAAE,MAFS;AAGpBC,IAAAA,QAAQ,EAAE,EAHU;AAIpBC,IAAAA,UAAU,EAAE,QAJQ;AAKpBC,IAAAA,SAAS,EAAE,QALS;AAMpBC,IAAAA,UAAU,EAA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K;AAIZM,MAAAA,MAAM,EAAEpD,GAAG,CAACgD,SAAJ;AAJI,KAAd;AAMD,GAzBD;;AA2BAjC,EAAAA,KAAK,CAAC0B,MAAN;AACA,SAAO1B,KAAP;AACD","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 zrUtil from 'zrender/lib/core/util.js';\r\nimport * as graphic from '../util/graphic.js';\r\nvar PI = Math.PI;\r\n/**\r\n * @param {module:echarts/ExtensionAPI} api\r\n * @param {Object} [opts]\r\n * @param {string} [opts.text]\r\n * @param {string} [opts.color]\r\n * @param {string} [opts.textColor]\r\n * @return {module:zrender/Element}\r\n */\r\n\r\nexport default function defaultLoading(api, opts) {\r\n opts = opts || {};\r\n zrUtil.defaults(opts, {\r\n text: 'loading',\r\n textColor: '#000',\r\n fontSize: 12,\r\n fontWeight: 'normal',\r\n fontStyle: 'normal',\r\n fontFamily: 'sans-serif',\r\n maskColor: 'rgba(255, 255, 255, 0.8)',\r\n showSpinner: true,\r\n color: '#5470c6',\r\n spinnerRadius: 10,\r\n lineWidth: 5,\r\n zlevel: 0\r\n });\r\n var group = new graphic.Group();\r\n var mask = new graphic.Rect({\r\n style: {\r\n fill: opts.maskColor\r\n },\r\n zlevel: opts.zlevel,\r\n z: 10000\r\n });\r\n group.add(mask);\r\n var textContent = new graphic.Text({\r\n style: {\r\n text: opts.text,\r\n fill: opts.textColor,\r\n fontSize: opts.fontSize,\r\n fontWeight: opts.fontWeight,\r\n fontStyle: opts.fontStyle,\r\n fontFamily: opts.fontFamily\r\n },\r\n zlevel: opts.zlevel,\r\n z: 10001\r\n });\r\n var labelRect = new graphic.Rect({\r\n style: {\r\n fill: 'none'\r\n },\r\n textContent: textContent,\r\n textConfig: {\r\n position: 'right',\r\n distance: 10\r\n },\r\n zlevel: opts.zlevel,\r\n z: 10001\r\n });\r\n group.add(labelRect);\r\n var arc;\r\n\r\n if (opts.showSpinner) {\r\n arc = new graphic.Arc({\r\n shape: {\r\n startAngle: -PI / 2,\r\n endAngle: -PI / 2 + 0.1,\r\n r: opts.spinnerRadius\r\n },\r\n style: {\r\n stroke: opts.color,\r\n lineCap: 'round',\r\n lineWidth: opts.lineWidth\r\n },\r\n zlevel: opts.zlevel,\r\n z: 10001\r\n });\r\n arc.animateShape(true).when(1000, {\r\n endAngle: PI * 3 / 2\r\n }).start('circularInOut');\r\n arc.animateShape(true).when(1000, {\r\n startAngle: PI * 3 / 2\r\n }).delay(300).start('circularInOut');\r\n group.add(arc);\r\n } // Inject resize\r\n\r\n\r\n group.resize = function () {\r\n var textWidth = textContent.getBoundingRect().width;\r\n var r = opts.showSpinner ? opts.spinnerRadius : 0; // cx = (containerWidth - arcDiameter - textDistance - textWidth) / 2\r\n // textDistance needs to be calculated when both animation and text exist\r\n\r\n var cx = (api.getWidth() - r * 2 - (opts.showSpinner && textWidth ? 10 : 0) - textWidth) / 2 - (opts.showSpinner && textWidth ? 0 : 5 + textWidth / 2) // only show the text\r\n + (opts.showSpinner ? 0 : textWidth / 2) // only show the spinner\r\n + (textWidth ? 0 : r);\r\n var cy = api.getHeight() / 2;\r\n opts.showSpinner && arc.setShape({\r\n cx: cx,\r\n cy: cy\r\n });\r\n labelRect.setShape({\r\n x: cx - r,\r\n y: cy - r,\r\n width: r * 2,\r\n height: r * 2\r\n });\r\n mask.setShape({\r\n x: 0,\r\n y: 0,\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n });\r\n };\r\n\r\n group.resize();\r\n return group;\r\n}"]},"metadata":{},"sourceType":"module"} |