框架源码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2128 lines
67 KiB

4 years ago
  1. module.exports =
  2. /******/ (function(modules) { // webpackBootstrap
  3. /******/ // The module cache
  4. /******/ var installedModules = {};
  5. /******/
  6. /******/ // The require function
  7. /******/ function __webpack_require__(moduleId) {
  8. /******/
  9. /******/ // Check if module is in cache
  10. /******/ if(installedModules[moduleId]) {
  11. /******/ return installedModules[moduleId].exports;
  12. /******/ }
  13. /******/ // Create a new module (and put it into the cache)
  14. /******/ var module = installedModules[moduleId] = {
  15. /******/ i: moduleId,
  16. /******/ l: false,
  17. /******/ exports: {}
  18. /******/ };
  19. /******/
  20. /******/ // Execute the module function
  21. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  22. /******/
  23. /******/ // Flag the module as loaded
  24. /******/ module.l = true;
  25. /******/
  26. /******/ // Return the exports of the module
  27. /******/ return module.exports;
  28. /******/ }
  29. /******/
  30. /******/
  31. /******/ // expose the modules object (__webpack_modules__)
  32. /******/ __webpack_require__.m = modules;
  33. /******/
  34. /******/ // expose the module cache
  35. /******/ __webpack_require__.c = installedModules;
  36. /******/
  37. /******/ // define getter function for harmony exports
  38. /******/ __webpack_require__.d = function(exports, name, getter) {
  39. /******/ if(!__webpack_require__.o(exports, name)) {
  40. /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
  41. /******/ }
  42. /******/ };
  43. /******/
  44. /******/ // define __esModule on exports
  45. /******/ __webpack_require__.r = function(exports) {
  46. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  47. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  48. /******/ }
  49. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  50. /******/ };
  51. /******/
  52. /******/ // create a fake namespace object
  53. /******/ // mode & 1: value is a module id, require it
  54. /******/ // mode & 2: merge all properties of value into the ns
  55. /******/ // mode & 4: return value when already ns object
  56. /******/ // mode & 8|1: behave like require
  57. /******/ __webpack_require__.t = function(value, mode) {
  58. /******/ if(mode & 1) value = __webpack_require__(value);
  59. /******/ if(mode & 8) return value;
  60. /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  61. /******/ var ns = Object.create(null);
  62. /******/ __webpack_require__.r(ns);
  63. /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  64. /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  65. /******/ return ns;
  66. /******/ };
  67. /******/
  68. /******/ // getDefaultExport function for compatibility with non-harmony modules
  69. /******/ __webpack_require__.n = function(module) {
  70. /******/ var getter = module && module.__esModule ?
  71. /******/ function getDefault() { return module['default']; } :
  72. /******/ function getModuleExports() { return module; };
  73. /******/ __webpack_require__.d(getter, 'a', getter);
  74. /******/ return getter;
  75. /******/ };
  76. /******/
  77. /******/ // Object.prototype.hasOwnProperty.call
  78. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  79. /******/
  80. /******/ // __webpack_public_path__
  81. /******/ __webpack_require__.p = "/dist/";
  82. /******/
  83. /******/
  84. /******/ // Load entry module and return exports
  85. /******/ return __webpack_require__(__webpack_require__.s = 248);
  86. /******/ })
  87. /************************************************************************/
  88. /******/ ({
  89. /***/ 109:
  90. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91. "use strict";
  92. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return bar; });
  93. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return histogram; });
  94. /* harmony import */ var main_utils_charts_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15);
  95. /* harmony import */ var main_utils_charts_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(32);
  96. /* harmony import */ var utils_lite__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3);
  97. /* harmony import */ var utils_lite__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(utils_lite__WEBPACK_IMPORTED_MODULE_2__);
  98. // default opacity of bar while dim-axis type is 'value'
  99. var VALUE_AXIS_OPACITY = 0.5;
  100. function getBarDimAxis(args) {
  101. var innerRows = args.innerRows,
  102. dimAxisName = args.dimAxisName,
  103. dimension = args.dimension,
  104. axisVisible = args.axisVisible,
  105. dimAxisType = args.dimAxisType,
  106. dims = args.dims;
  107. return dimension.map(function (item) {
  108. return {
  109. type: 'category',
  110. name: dimAxisName,
  111. nameLocation: 'middle',
  112. nameGap: 22,
  113. data: dimAxisType === 'value' ? getValueAxisData(dims) : innerRows.map(function (row) {
  114. return row[item];
  115. }),
  116. axisLabel: {
  117. formatter: function formatter(v) {
  118. return String(v);
  119. }
  120. },
  121. show: axisVisible,
  122. axisLine: {
  123. lineStyle: {
  124. color: '#FFF'
  125. }
  126. }
  127. };
  128. });
  129. }
  130. function getValueAxisData(dims) {
  131. var max = Math.max.apply(null, dims);
  132. var min = Math.min.apply(null, dims);
  133. var result = [];
  134. for (var i = min; i <= max; i++) {
  135. result.push(i);
  136. }
  137. return result;
  138. }
  139. function getBarMeaAxis(args) {
  140. var meaAxisName = args.meaAxisName,
  141. meaAxisType = args.meaAxisType,
  142. axisVisible = args.axisVisible,
  143. digit = args.digit,
  144. scale = args.scale,
  145. min = args.min,
  146. max = args.max;
  147. var meaAxisBase = {
  148. type: 'value',
  149. axisTick: {
  150. show: false
  151. },
  152. show: axisVisible,
  153. axisLine: {
  154. lineStyle: {
  155. color: '#FFF'
  156. }
  157. }
  158. };
  159. var meaAxis = [];
  160. var _loop = function _loop(i) {
  161. if (meaAxisType[i]) {
  162. meaAxis[i] = Object.assign({}, meaAxisBase, {
  163. axisLabel: {
  164. formatter: function formatter(val) {
  165. return Object(main_utils_charts_utils__WEBPACK_IMPORTED_MODULE_1__[/* getFormated */ "c"])(val, meaAxisType[i], digit);
  166. }
  167. }
  168. });
  169. } else {
  170. meaAxis[i] = Object.assign({}, meaAxisBase);
  171. }
  172. meaAxis[i].name = meaAxisName[i] || '';
  173. meaAxis[i].scale = scale[i] || false;
  174. meaAxis[i].min = min[i] || null;
  175. meaAxis[i].max = max[i] || null;
  176. };
  177. for (var i = 0; i < 2; i++) {
  178. _loop(i);
  179. }
  180. return meaAxis;
  181. }
  182. function getBarTooltip(args) {
  183. var axisSite = args.axisSite,
  184. isHistogram = args.isHistogram,
  185. meaAxisType = args.meaAxisType,
  186. digit = args.digit,
  187. labelMap = args.labelMap;
  188. var secondAxis = isHistogram ? axisSite.right || [] : axisSite.top || [];
  189. if (labelMap) {
  190. secondAxis = secondAxis.map(function (item) {
  191. return labelMap[item] === undefined ? item : labelMap[item];
  192. });
  193. }
  194. return {
  195. trigger: 'axis',
  196. formatter: function formatter(items) {
  197. var tpl = [];
  198. tpl.push(items[0].name + '<br>');
  199. items.forEach(function (item) {
  200. var seriesName = item.seriesName;
  201. var type = ~secondAxis.indexOf(seriesName) ? meaAxisType[1] : meaAxisType[0];
  202. tpl.push(Object(main_utils_charts_constants__WEBPACK_IMPORTED_MODULE_0__[/* itemPoint */ "g"])(item.color));
  203. tpl.push(seriesName + ': ');
  204. tpl.push(Object(main_utils_charts_utils__WEBPACK_IMPORTED_MODULE_1__[/* getFormated */ "c"])(item.value, type, digit));
  205. tpl.push('<br>');
  206. });
  207. return tpl.join('');
  208. }
  209. };
  210. }
  211. function getValueData(seriesTemp, dims) {
  212. var max = Math.max.apply(null, dims);
  213. var min = Math.min.apply(null, dims);
  214. var result = [];
  215. for (var i = min; i <= max; i++) {
  216. var index = dims.indexOf(i);
  217. if (~index) {
  218. result.push(seriesTemp[index]);
  219. } else {
  220. result.push(null);
  221. }
  222. }
  223. return result;
  224. }
  225. function getBarSeries(args) {
  226. var innerRows = args.innerRows,
  227. metrics = args.metrics,
  228. stack = args.stack,
  229. axisSite = args.axisSite,
  230. isHistogram = args.isHistogram,
  231. labelMap = args.labelMap,
  232. itemStyle = args.itemStyle,
  233. label = args.label,
  234. _args$showLine = args.showLine,
  235. showLine = _args$showLine === undefined ? [] : _args$showLine,
  236. dimAxisType = args.dimAxisType,
  237. barGap = args.barGap,
  238. opacity = args.opacity,
  239. dims = args.dims;
  240. var series = [];
  241. var seriesTemp = {};
  242. var secondAxis = isHistogram ? axisSite.right || [] : axisSite.top || [];
  243. var secondDimAxisIndex = isHistogram ? 'yAxisIndex' : 'xAxisIndex';
  244. var stackMap = stack && Object(main_utils_charts_utils__WEBPACK_IMPORTED_MODULE_1__[/* getStackMap */ "e"])(stack);
  245. metrics.forEach(function (item) {
  246. seriesTemp[item] = [];
  247. });
  248. innerRows.forEach(function (row) {
  249. metrics.forEach(function (item) {
  250. seriesTemp[item].push(row[item]);
  251. });
  252. });
  253. series = Object.keys(seriesTemp).map(function (item, index) {
  254. var _seriesItem;
  255. var data = dimAxisType === 'value' ? getValueData(seriesTemp[item], dims) : seriesTemp[item];
  256. var seriesItem = (_seriesItem = {
  257. name: labelMap[item] != null ? labelMap[item] : item,
  258. type: ~showLine.indexOf(item) ? 'line' : 'bar',
  259. data: data
  260. }, _seriesItem[secondDimAxisIndex] = ~secondAxis.indexOf(item) ? '1' : '0', _seriesItem);
  261. if (stack && stackMap[item]) seriesItem.stack = stackMap[item];
  262. if (label) seriesItem.label = label;
  263. if (itemStyle) seriesItem.itemStyle = itemStyle;
  264. var itemOpacity = opacity || Object(utils_lite__WEBPACK_IMPORTED_MODULE_2__["get"])(seriesItem, 'itemStyle.normal.opacity');
  265. if (dimAxisType === 'value') {
  266. seriesItem.barGap = barGap;
  267. seriesItem.barCategoryGap = '1%';
  268. if (itemOpacity == null) itemOpacity = VALUE_AXIS_OPACITY;
  269. }
  270. if (itemOpacity != null) {
  271. Object(utils_lite__WEBPACK_IMPORTED_MODULE_2__["set"])(seriesItem, 'itemStyle.normal.opacity', itemOpacity);
  272. }
  273. return seriesItem;
  274. });
  275. return series.length ? series : false;
  276. }
  277. function getLegend(args) {
  278. var metrics = args.metrics,
  279. labelMap = args.labelMap,
  280. legendName = args.legendName;
  281. if (!legendName && !labelMap) return { data: metrics };
  282. var data = labelMap ? metrics.map(function (item) {
  283. return labelMap[item] == null ? item : labelMap[item];
  284. }) : metrics;
  285. return {
  286. data: data,
  287. formatter: function formatter(name) {
  288. return legendName[name] != null ? legendName[name] : name;
  289. }
  290. };
  291. }
  292. function getDims(rows, dimension) {
  293. return rows.map(function (row) {
  294. return row[dimension[0]];
  295. });
  296. }
  297. var bar = function bar(columns, rows, settings, extra) {
  298. var innerRows = Object(utils_lite__WEBPACK_IMPORTED_MODULE_2__["cloneDeep"])(rows);
  299. var _settings$axisSite = settings.axisSite,
  300. axisSite = _settings$axisSite === undefined ? {} : _settings$axisSite,
  301. _settings$dimension = settings.dimension,
  302. dimension = _settings$dimension === undefined ? [columns[0]] : _settings$dimension,
  303. _settings$stack = settings.stack,
  304. stack = _settings$stack === undefined ? {} : _settings$stack,
  305. _settings$axisVisible = settings.axisVisible,
  306. axisVisible = _settings$axisVisible === undefined ? true : _settings$axisVisible,
  307. _settings$digit = settings.digit,
  308. digit = _settings$digit === undefined ? 2 : _settings$digit,
  309. _settings$dataOrder = settings.dataOrder,
  310. dataOrder = _settings$dataOrder === undefined ? false : _settings$dataOrder,
  311. _settings$scale = settings.scale,
  312. scale = _settings$scale === undefined ? [false, false] : _settings$scale,
  313. _settings$min = settings.min,
  314. min = _settings$min === undefined ? [null, null] : _settings$min,
  315. _settings$max = settings.max,
  316. max = _settings$max === undefined ? [null, null] : _settings$max,
  317. _settings$legendName = settings.legendName,
  318. legendName = _settings$legendName === undefined ? {} : _settings$legendName,
  319. _settings$labelMap = settings.labelMap,
  320. labelMap = _settings$labelMap === undefined ? {} : _settings$labelMap,
  321. label = settings.label,
  322. itemStyle = settings.itemStyle,
  323. showLine = settings.showLine,
  324. _settings$barGap = settings.barGap,
  325. barGap = _settings$barGap === undefined ? '-100%' : _settings$barGap,
  326. opacity = settings.opacity;
  327. var tooltipVisible = extra.tooltipVisible,
  328. legendVisible = extra.legendVisible;
  329. var metrics = columns.slice();
  330. if (axisSite.top && axisSite.bottom) {
  331. metrics = axisSite.top.concat(axisSite.bottom);
  332. } else if (axisSite.bottom && !axisSite.right) {
  333. metrics = axisSite.bottom;
  334. } else if (settings.metrics) {
  335. metrics = settings.metrics;
  336. } else {
  337. metrics.splice(columns.indexOf(dimension[0]), 1);
  338. }
  339. var meaAxisType = settings.xAxisType || ['normal', 'normal'];
  340. var dimAxisType = settings.yAxisType || 'category';
  341. var meaAxisName = settings.xAxisName || [];
  342. var dimAxisName = settings.yAxisName || '';
  343. var isHistogram = false;
  344. if (dataOrder) {
  345. var _label = dataOrder.label,
  346. order = dataOrder.order;
  347. if (!_label || !order) {
  348. console.warn('Need to provide name and order parameters');
  349. } else {
  350. innerRows.sort(function (a, b) {
  351. if (order === 'desc') {
  352. return a[_label] - b[_label];
  353. } else {
  354. return b[_label] - a[_label];
  355. }
  356. });
  357. }
  358. }
  359. var dims = getDims(innerRows, dimension);
  360. var legend = legendVisible && getLegend({ metrics: metrics, labelMap: labelMap, legendName: legendName });
  361. var yAxis = getBarDimAxis({
  362. innerRows: innerRows,
  363. dimAxisName: dimAxisName,
  364. dimension: dimension,
  365. axisVisible: axisVisible,
  366. dimAxisType: dimAxisType,
  367. dims: dims
  368. });
  369. var xAxis = getBarMeaAxis({
  370. meaAxisName: meaAxisName,
  371. meaAxisType: meaAxisType,
  372. axisVisible: axisVisible,
  373. digit: digit,
  374. scale: scale,
  375. min: min,
  376. max: max
  377. });
  378. var series = getBarSeries({
  379. innerRows: innerRows,
  380. metrics: metrics,
  381. stack: stack,
  382. axisSite: axisSite,
  383. isHistogram: isHistogram,
  384. labelMap: labelMap,
  385. itemStyle: itemStyle,
  386. label: label,
  387. showLine: showLine,
  388. dimAxisType: dimAxisType,
  389. dimension: dimension,
  390. barGap: barGap,
  391. opacity: opacity,
  392. dims: dims
  393. });
  394. var tooltipParams = { axisSite: axisSite, isHistogram: isHistogram, meaAxisType: meaAxisType, digit: digit, labelMap: labelMap };
  395. var tooltip = tooltipVisible && getBarTooltip(tooltipParams);
  396. var options = { legend: legend, yAxis: yAxis, series: series, xAxis: xAxis, tooltip: tooltip };
  397. return options;
  398. };
  399. var histogram = function histogram(columns, rows, settings, status) {
  400. var innerRows = Object(utils_lite__WEBPACK_IMPORTED_MODULE_2__["cloneDeep"])(rows);
  401. var _settings$axisSite2 = settings.axisSite,
  402. axisSite = _settings$axisSite2 === undefined ? {} : _settings$axisSite2,
  403. _settings$dimension2 = settings.dimension,
  404. dimension = _settings$dimension2 === undefined ? [columns[0]] : _settings$dimension2,
  405. _settings$stack2 = settings.stack,
  406. stack = _settings$stack2 === undefined ? {} : _settings$stack2,
  407. _settings$axisVisible2 = settings.axisVisible,
  408. axisVisible = _settings$axisVisible2 === undefined ? true : _settings$axisVisible2,
  409. _settings$digit2 = settings.digit,
  410. digit = _settings$digit2 === undefined ? 2 : _settings$digit2,
  411. _settings$dataOrder2 = settings.dataOrder,
  412. dataOrder = _settings$dataOrder2 === undefined ? false : _settings$dataOrder2,
  413. _settings$scale2 = settings.scale,
  414. scale = _settings$scale2 === undefined ? [false, false] : _settings$scale2,
  415. _settings$min2 = settings.min,
  416. min = _settings$min2 === undefined ? [null, null] : _settings$min2,
  417. _settings$max2 = settings.max,
  418. max = _settings$max2 === undefined ? [null, null] : _settings$max2,
  419. _settings$labelMap2 = settings.labelMap,
  420. labelMap = _settings$labelMap2 === undefined ? {} : _settings$labelMap2,
  421. _settings$legendName2 = settings.legendName,
  422. legendName = _settings$legendName2 === undefined ? {} : _settings$legendName2,
  423. label = settings.label,
  424. itemStyle = settings.itemStyle,
  425. showLine = settings.showLine,
  426. _settings$barGap2 = settings.barGap,
  427. barGap = _settings$barGap2 === undefined ? '-100%' : _settings$barGap2,
  428. opacity = settings.opacity;
  429. if (dataOrder) {
  430. var _label2 = dataOrder.label,
  431. order = dataOrder.order;
  432. if (!_label2 || !order) {
  433. console.warn('Need to provide name and order parameters');
  434. } else {
  435. innerRows.sort(function (a, b) {
  436. if (order === 'desc') {
  437. return a[_label2] - b[_label2];
  438. } else {
  439. return b[_label2] - a[_label2];
  440. }
  441. });
  442. }
  443. }
  444. var tooltipVisible = status.tooltipVisible,
  445. legendVisible = status.legendVisible;
  446. var metrics = columns.slice();
  447. if (axisSite.left && axisSite.right) {
  448. metrics = axisSite.left.concat(axisSite.right);
  449. } else if (axisSite.left && !axisSite.right) {
  450. metrics = axisSite.left;
  451. } else if (settings.metrics) {
  452. metrics = settings.metrics;
  453. } else {
  454. metrics.splice(columns.indexOf(dimension[0]), 1);
  455. }
  456. var meaAxisType = settings.yAxisType || ['normal', 'normal'];
  457. var dimAxisType = settings.xAxisType || 'category';
  458. var meaAxisName = settings.yAxisName || [];
  459. var dimAxisName = settings.xAxisName || '';
  460. var isHistogram = true;
  461. var dims = getDims(innerRows, dimension);
  462. var legend = legendVisible && getLegend({ metrics: metrics, labelMap: labelMap, legendName: legendName });
  463. var xAxis = getBarDimAxis({
  464. innerRows: innerRows,
  465. dimAxisName: dimAxisName,
  466. dimension: dimension,
  467. axisVisible: axisVisible,
  468. dimAxisType: dimAxisType,
  469. dims: dims
  470. });
  471. var yAxis = getBarMeaAxis({
  472. meaAxisName: meaAxisName,
  473. meaAxisType: meaAxisType,
  474. axisVisible: axisVisible,
  475. digit: digit,
  476. scale: scale,
  477. min: min,
  478. max: max
  479. });
  480. var series = getBarSeries({
  481. innerRows: innerRows,
  482. metrics: metrics,
  483. stack: stack,
  484. axisSite: axisSite,
  485. isHistogram: isHistogram,
  486. labelMap: labelMap,
  487. itemStyle: itemStyle,
  488. label: label,
  489. showLine: showLine,
  490. dimAxisType: dimAxisType,
  491. dimension: dimension,
  492. barGap: barGap,
  493. opacity: opacity,
  494. dims: dims
  495. });
  496. var tooltipParams = { axisSite: axisSite, isHistogram: isHistogram, meaAxisType: meaAxisType, digit: digit, labelMap: labelMap };
  497. var tooltip = tooltipVisible && getBarTooltip(tooltipParams);
  498. var options = { legend: legend, yAxis: yAxis, series: series, xAxis: xAxis, tooltip: tooltip };
  499. return options;
  500. };
  501. /***/ }),
  502. /***/ 114:
  503. /***/ (function(module, exports) {
  504. module.exports = require("echarts/lib/chart/bar");
  505. /***/ }),
  506. /***/ 12:
  507. /***/ (function(module, exports) {
  508. /**
  509. * When source maps are enabled, `style-loader` uses a link element with a data-uri to
  510. * embed the css on the page. This breaks all relative urls because now they are relative to a
  511. * bundle instead of the current page.
  512. *
  513. * One solution is to only use full urls, but that may be impossible.
  514. *
  515. * Instead, this function "fixes" the relative urls to be absolute according to the current page location.
  516. *
  517. * A rudimentary test suite is located at `test/fixUrls.js` and can be run via the `npm test` command.
  518. *
  519. */
  520. module.exports = function (css) {
  521. // get current location
  522. var location = typeof window !== "undefined" && window.location;
  523. if (!location) {
  524. throw new Error("fixUrls requires window.location");
  525. }
  526. // blank or null?
  527. if (!css || typeof css !== "string") {
  528. return css;
  529. }
  530. var baseUrl = location.protocol + "//" + location.host;
  531. var currentDir = baseUrl + location.pathname.replace(/\/[^\/]*$/, "/");
  532. // convert each url(...)
  533. /*
  534. This regular expression is just a way to recursively match brackets within
  535. a string.
  536. /url\s*\( = Match on the word "url" with any whitespace after it and then a parens
  537. ( = Start a capturing group
  538. (?: = Start a non-capturing group
  539. [^)(] = Match anything that isn't a parentheses
  540. | = OR
  541. \( = Match a start parentheses
  542. (?: = Start another non-capturing groups
  543. [^)(]+ = Match anything that isn't a parentheses
  544. | = OR
  545. \( = Match a start parentheses
  546. [^)(]* = Match anything that isn't a parentheses
  547. \) = Match a end parentheses
  548. ) = End Group
  549. *\) = Match anything and then a close parens
  550. ) = Close non-capturing group
  551. * = Match anything
  552. ) = Close capturing group
  553. \) = Match a close parens
  554. /gi = Get all matches, not the first. Be case insensitive.
  555. */
  556. var fixedCss = css.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi, function(fullMatch, origUrl) {
  557. // strip quotes (if they exist)
  558. var unquotedOrigUrl = origUrl
  559. .trim()
  560. .replace(/^"(.*)"$/, function(o, $1){ return $1; })
  561. .replace(/^'(.*)'$/, function(o, $1){ return $1; });
  562. // already a full url? no change
  563. if (/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(unquotedOrigUrl)) {
  564. return fullMatch;
  565. }
  566. // convert the url to a full url
  567. var newUrl;
  568. if (unquotedOrigUrl.indexOf("//") === 0) {
  569. //TODO: should we add protocol?
  570. newUrl = unquotedOrigUrl;
  571. } else if (unquotedOrigUrl.indexOf("/") === 0) {
  572. // path should be relative to the base url
  573. newUrl = baseUrl + unquotedOrigUrl; // already starts with '/'
  574. } else {
  575. // path should be relative to current directory
  576. newUrl = currentDir + unquotedOrigUrl.replace(/^\.\//, ""); // Strip leading './'
  577. }
  578. // send back the fixed url(...)
  579. return "url(" + JSON.stringify(newUrl) + ")";
  580. });
  581. // send back the fixed css
  582. return fixedCss;
  583. };
  584. /***/ }),
  585. /***/ 15:
  586. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  587. "use strict";
  588. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return DEFAULT_THEME; });
  589. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DEFAULT_COLORS; });
  590. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return HEAT_MAP_COLOR; });
  591. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return HEAT_BMAP_COLOR; });
  592. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return itemPoint; });
  593. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return STATIC_PROPS; });
  594. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return ECHARTS_SETTINGS; });
  595. var DEFAULT_THEME = {
  596. categoryAxis: {
  597. axisLine: { show: false },
  598. axisTick: { show: false },
  599. splitLine: { show: false }
  600. },
  601. valueAxis: {
  602. axisLine: { show: false }
  603. },
  604. line: {
  605. smooth: true
  606. },
  607. grid: {
  608. containLabel: true,
  609. left: 10,
  610. right: 10
  611. }
  612. };
  613. var DEFAULT_COLORS = ['#19d4ae', '#5ab1ef', '#fa6e86', '#ffb980', '#0067a6', '#c4b4e4', '#d87a80', '#9cbbff', '#d9d0c7', '#87a997', '#d49ea2', '#5b4947', '#7ba3a8'];
  614. var HEAT_MAP_COLOR = ['#313695', '#4575b4', '#74add1', '#abd9e9', '#e0f3f8', '#ffffbf', '#fee090', '#fdae61', '#f46d43', '#d73027', '#a50026'];
  615. var HEAT_BMAP_COLOR = ['blue', 'blue', 'green', 'yellow', 'red'];
  616. var itemPoint = function itemPoint(color) {
  617. return ['<span style="', 'background-color:' + color + ';', 'display: inline-block;', 'width: 10px;', 'height: 10px;', 'border-radius: 50%;', 'margin-right:2px;', '"></span>'].join('');
  618. };
  619. var STATIC_PROPS = ['initOptions', 'loading', 'dataEmpty', 'judgeWidth', 'widthChangeDelay'];
  620. var ECHARTS_SETTINGS = ['grid', 'dataZoom', 'visualMap', 'toolbox', 'title', 'legend', 'xAxis', 'yAxis', 'radar', 'tooltip', 'axisPointer', 'brush', 'geo', 'timeline', 'graphic', 'series', 'backgroundColor', 'textStyle'];
  621. /***/ }),
  622. /***/ 17:
  623. /***/ (function(module, exports) {
  624. module.exports = require("echarts/lib/echarts");
  625. /***/ }),
  626. /***/ 2:
  627. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  628. "use strict";
  629. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
  630. /* globals __VUE_SSR_CONTEXT__ */
  631. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  632. // This module is a runtime utility for cleaner component module output and will
  633. // be included in the final webpack user bundle.
  634. function normalizeComponent (
  635. scriptExports,
  636. render,
  637. staticRenderFns,
  638. functionalTemplate,
  639. injectStyles,
  640. scopeId,
  641. moduleIdentifier, /* server only */
  642. shadowMode /* vue-cli only */
  643. ) {
  644. // Vue.extend constructor export interop
  645. var options = typeof scriptExports === 'function'
  646. ? scriptExports.options
  647. : scriptExports
  648. // render functions
  649. if (render) {
  650. options.render = render
  651. options.staticRenderFns = staticRenderFns
  652. options._compiled = true
  653. }
  654. // functional template
  655. if (functionalTemplate) {
  656. options.functional = true
  657. }
  658. // scopedId
  659. if (scopeId) {
  660. options._scopeId = 'data-v-' + scopeId
  661. }
  662. var hook
  663. if (moduleIdentifier) { // server build
  664. hook = function (context) {
  665. // 2.3 injection
  666. context =
  667. context || // cached call
  668. (this.$vnode && this.$vnode.ssrContext) || // stateful
  669. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  670. // 2.2 with runInNewContext: true
  671. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  672. context = __VUE_SSR_CONTEXT__
  673. }
  674. // inject component styles
  675. if (injectStyles) {
  676. injectStyles.call(this, context)
  677. }
  678. // register component module identifier for async chunk inferrence
  679. if (context && context._registeredComponents) {
  680. context._registeredComponents.add(moduleIdentifier)
  681. }
  682. }
  683. // used by ssr in case component is cached and beforeCreate
  684. // never gets called
  685. options._ssrRegister = hook
  686. } else if (injectStyles) {
  687. hook = shadowMode
  688. ? function () {
  689. injectStyles.call(
  690. this,
  691. (options.functional ? this.parent : this).$root.$options.shadowRoot
  692. )
  693. }
  694. : injectStyles
  695. }
  696. if (hook) {
  697. if (options.functional) {
  698. // for template-only hot-reload because in that case the render fn doesn't
  699. // go through the normalizer
  700. options._injectStyles = hook
  701. // register for functional component in vue file
  702. var originalRender = options.render
  703. options.render = function renderWithStyleInjection (h, context) {
  704. hook.call(context)
  705. return originalRender(h, context)
  706. }
  707. } else {
  708. // inject component registration as beforeCreate hook
  709. var existing = options.beforeCreate
  710. options.beforeCreate = existing
  711. ? [].concat(existing, hook)
  712. : [hook]
  713. }
  714. }
  715. return {
  716. exports: scriptExports,
  717. options: options
  718. }
  719. }
  720. /***/ }),
  721. /***/ 248:
  722. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  723. "use strict";
  724. __webpack_require__.r(__webpack_exports__);
  725. /* harmony import */ var echarts_lib_chart_bar__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(114);
  726. /* harmony import */ var echarts_lib_chart_bar__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(echarts_lib_chart_bar__WEBPACK_IMPORTED_MODULE_0__);
  727. /* harmony import */ var _main__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(109);
  728. /* harmony import */ var main_utils_charts_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(43);
  729. /* harmony default export */ __webpack_exports__["default"] = (Object.assign({}, main_utils_charts_core__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"], {
  730. name: 'VeBar',
  731. data: function data() {
  732. this.chartHandler = _main__WEBPACK_IMPORTED_MODULE_1__[/* bar */ "a"];
  733. return {};
  734. }
  735. }));
  736. /***/ }),
  737. /***/ 3:
  738. /***/ (function(module, exports) {
  739. module.exports = require("utils-lite");
  740. /***/ }),
  741. /***/ 31:
  742. /***/ (function(module, exports) {
  743. module.exports = require("numerify");
  744. /***/ }),
  745. /***/ 32:
  746. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  747. "use strict";
  748. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return getFormated; });
  749. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return getStackMap; });
  750. /* unused harmony export $get */
  751. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return getMapJSON; });
  752. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getBmap; });
  753. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getAmap; });
  754. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return setArrayValue; });
  755. /* harmony import */ var numerify__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(31);
  756. /* harmony import */ var numerify__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(numerify__WEBPACK_IMPORTED_MODULE_0__);
  757. /* harmony import */ var utils_lite__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3);
  758. /* harmony import */ var utils_lite__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(utils_lite__WEBPACK_IMPORTED_MODULE_1__);
  759. var getFormated = function getFormated(val, type, digit) {
  760. var defaultVal = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '-';
  761. if (isNaN(val)) return defaultVal;
  762. if (!type) return val;
  763. if (Object(utils_lite__WEBPACK_IMPORTED_MODULE_1__["isFunction"])(type)) return type(val, numerify__WEBPACK_IMPORTED_MODULE_0___default.a);
  764. digit = isNaN(digit) ? 0 : ++digit;
  765. var digitStr = '.[' + new Array(digit).join(0) + ']';
  766. var formatter = type;
  767. switch (type) {
  768. case 'KMB':
  769. formatter = digit ? '0,0' + digitStr + 'a' : '0,0a';
  770. break;
  771. case 'normal':
  772. formatter = digit ? '0,0' + digitStr : '0,0';
  773. break;
  774. case 'percent':
  775. formatter = digit ? '0,0' + digitStr + '%' : '0,0.[00]%';
  776. break;
  777. }
  778. return numerify__WEBPACK_IMPORTED_MODULE_0___default()(val, formatter);
  779. };
  780. var getStackMap = function getStackMap(stack) {
  781. var stackMap = {};
  782. Object.keys(stack).forEach(function (item) {
  783. stack[item].forEach(function (name) {
  784. stackMap[name] = item;
  785. });
  786. });
  787. return stackMap;
  788. };
  789. var $get = function $get(url) {
  790. /* eslint-disable */
  791. return new Promise(function (resolve, reject) {
  792. var xhr = new XMLHttpRequest();
  793. xhr.open('GET', url);
  794. xhr.send(null);
  795. xhr.onload = function () {
  796. resolve(JSON.parse(xhr.responseText));
  797. };
  798. xhr.onerror = function () {
  799. reject(JSON.parse(xhr.responseText));
  800. };
  801. });
  802. };
  803. var mapPromise = {};
  804. var getMapJSON = function getMapJSON(_ref) {
  805. var position = _ref.position,
  806. positionJsonLink = _ref.positionJsonLink,
  807. beforeRegisterMapOnce = _ref.beforeRegisterMapOnce,
  808. mapURLProfix = _ref.mapURLProfix;
  809. var link = positionJsonLink || '' + mapURLProfix + position + '.json';
  810. if (!mapPromise[link]) {
  811. mapPromise[link] = $get(link).then(function (res) {
  812. if (beforeRegisterMapOnce) res = beforeRegisterMapOnce(res);
  813. return res;
  814. });
  815. }
  816. return mapPromise[link];
  817. };
  818. var bmapPromise = null;
  819. var amapPromise = null;
  820. var getBmap = function getBmap(key, v) {
  821. if (!bmapPromise) {
  822. bmapPromise = new Promise(function (resolve, reject) {
  823. var callbackName = 'bmap' + Date.now();
  824. window[callbackName] = resolve;
  825. var script = document.createElement('script');
  826. script.src = ['https://api.map.baidu.com/api?v=' + (v || '2.0'), 'ak=' + key, 'callback=' + callbackName].join('&');
  827. document.body.appendChild(script);
  828. });
  829. }
  830. return bmapPromise;
  831. };
  832. var getAmap = function getAmap(key, v) {
  833. if (!amapPromise) {
  834. amapPromise = new Promise(function (resolve, reject) {
  835. var callbackName = 'amap' + Date.now();
  836. window[callbackName] = resolve;
  837. var script = document.createElement('script');
  838. script.src = ['https://webapi.amap.com/maps?v=' + (v || '1.4.3'), 'key=' + key, 'callback=' + callbackName].join('&');
  839. document.body.appendChild(script);
  840. });
  841. }
  842. return amapPromise;
  843. };
  844. function setArrayValue(arr, index, value) {
  845. if (arr[index] !== undefined) {
  846. arr[index].push(value);
  847. } else {
  848. arr[index] = [value];
  849. }
  850. }
  851. /***/ }),
  852. /***/ 39:
  853. /***/ (function(module, exports, __webpack_require__) {
  854. var content = __webpack_require__(57);
  855. if(typeof content === 'string') content = [[module.i, content, '']];
  856. var transform;
  857. var insertInto;
  858. var options = {"hmr":true}
  859. options.transform = transform
  860. options.insertInto = undefined;
  861. var update = __webpack_require__(6)(content, options);
  862. if(content.locals) module.exports = content.locals;
  863. if(false) {}
  864. /***/ }),
  865. /***/ 40:
  866. /***/ (function(module, exports, __webpack_require__) {
  867. var content = __webpack_require__(59);
  868. if(typeof content === 'string') content = [[module.i, content, '']];
  869. var transform;
  870. var insertInto;
  871. var options = {"hmr":true}
  872. options.transform = transform
  873. options.insertInto = undefined;
  874. var update = __webpack_require__(6)(content, options);
  875. if(content.locals) module.exports = content.locals;
  876. if(false) {}
  877. /***/ }),
  878. /***/ 43:
  879. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  880. "use strict";
  881. // EXTERNAL MODULE: external "echarts/lib/echarts"
  882. var echarts_ = __webpack_require__(17);
  883. var echarts_default = /*#__PURE__*/__webpack_require__.n(echarts_);
  884. // EXTERNAL MODULE: external "echarts/lib/component/tooltip"
  885. var tooltip_ = __webpack_require__(54);
  886. // EXTERNAL MODULE: external "echarts/lib/component/legend"
  887. var legend_ = __webpack_require__(55);
  888. // EXTERNAL MODULE: external "numerify"
  889. var external_numerify_ = __webpack_require__(31);
  890. var external_numerify_default = /*#__PURE__*/__webpack_require__.n(external_numerify_);
  891. // EXTERNAL MODULE: external "utils-lite"
  892. var external_utils_lite_ = __webpack_require__(3);
  893. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./src/utils/charts/components/loading.vue?vue&type=template&id=6d18fb16&
  894. var loadingvue_type_template_id_6d18fb16_render = function() {
  895. var _vm = this
  896. var _h = _vm.$createElement
  897. var _c = _vm._self._c || _h
  898. return _c("div", { staticClass: "v-charts-component-loading" }, [
  899. _c("div", { staticClass: "loader" }, [
  900. _c("div", { staticClass: "loading-spinner" }, [
  901. _c(
  902. "svg",
  903. { staticClass: "circular", attrs: { viewBox: "25 25 50 50" } },
  904. [
  905. _c("circle", {
  906. staticClass: "path",
  907. attrs: { cx: "50", cy: "50", r: "20", fill: "none" }
  908. })
  909. ]
  910. )
  911. ])
  912. ])
  913. ])
  914. }
  915. var staticRenderFns = []
  916. loadingvue_type_template_id_6d18fb16_render._withStripped = true
  917. // CONCATENATED MODULE: ./src/utils/charts/components/loading.vue?vue&type=template&id=6d18fb16&
  918. // EXTERNAL MODULE: ./src/utils/charts/components/loading.vue?vue&type=style&index=0&lang=css&
  919. var loadingvue_type_style_index_0_lang_css_ = __webpack_require__(56);
  920. // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
  921. var componentNormalizer = __webpack_require__(2);
  922. // CONCATENATED MODULE: ./src/utils/charts/components/loading.vue
  923. var script = {}
  924. /* normalize component */
  925. var component = Object(componentNormalizer["a" /* default */])(
  926. script,
  927. loadingvue_type_template_id_6d18fb16_render,
  928. staticRenderFns,
  929. false,
  930. null,
  931. null,
  932. null
  933. )
  934. /* hot reload */
  935. if (false) { var api; }
  936. component.options.__file = "src/utils/charts/components/loading.vue"
  937. /* harmony default export */ var loading = (component.exports);
  938. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./src/utils/charts/components/data-empty.vue?vue&type=template&id=1f2f0a80&
  939. var data_emptyvue_type_template_id_1f2f0a80_render = function() {
  940. var _vm = this
  941. var _h = _vm.$createElement
  942. var _c = _vm._self._c || _h
  943. return _c("div", { staticClass: "v-charts-data-empty" }, [
  944. _vm._v("\n 暂无数据\n")
  945. ])
  946. }
  947. var data_emptyvue_type_template_id_1f2f0a80_staticRenderFns = []
  948. data_emptyvue_type_template_id_1f2f0a80_render._withStripped = true
  949. // CONCATENATED MODULE: ./src/utils/charts/components/data-empty.vue?vue&type=template&id=1f2f0a80&
  950. // EXTERNAL MODULE: ./src/utils/charts/components/data-empty.vue?vue&type=style&index=0&lang=css&
  951. var data_emptyvue_type_style_index_0_lang_css_ = __webpack_require__(58);
  952. // CONCATENATED MODULE: ./src/utils/charts/components/data-empty.vue
  953. var data_empty_script = {}
  954. /* normalize component */
  955. var data_empty_component = Object(componentNormalizer["a" /* default */])(
  956. data_empty_script,
  957. data_emptyvue_type_template_id_1f2f0a80_render,
  958. data_emptyvue_type_template_id_1f2f0a80_staticRenderFns,
  959. false,
  960. null,
  961. null,
  962. null
  963. )
  964. /* hot reload */
  965. if (false) { var data_empty_api; }
  966. data_empty_component.options.__file = "src/utils/charts/components/data-empty.vue"
  967. /* harmony default export */ var data_empty = (data_empty_component.exports);
  968. // EXTERNAL MODULE: ./src/utils/charts/constants.js
  969. var constants = __webpack_require__(15);
  970. // CONCATENATED MODULE: ./src/utils/charts/modules/extend.js
  971. /* harmony default export */ var modules_extend = (function (options, extend) {
  972. Object.keys(extend).forEach(function (attr) {
  973. var value = extend[attr];
  974. if (~attr.indexOf('.')) {
  975. // eg: a.b.c a.1.b
  976. Object(external_utils_lite_["set"])(options, attr, value);
  977. } else if (typeof value === 'function') {
  978. // get callback value
  979. options[attr] = value(options[attr]);
  980. } else {
  981. // mixin extend value
  982. if (Object(external_utils_lite_["isArray"])(options[attr]) && Object(external_utils_lite_["isObject"])(options[attr][0])) {
  983. // eg: [{ xx: 1 }, { xx: 2 }]
  984. options[attr].forEach(function (option, index) {
  985. options[attr][index] = Object.assign({}, option, value);
  986. });
  987. } else if (Object(external_utils_lite_["isObject"])(options[attr])) {
  988. // eg: { xx: 1, yy: 2 }
  989. options[attr] = Object.assign({}, options[attr], value);
  990. } else {
  991. options[attr] = value;
  992. }
  993. }
  994. });
  995. });
  996. // CONCATENATED MODULE: ./src/utils/charts/modules/mark.js
  997. /* harmony default export */ var mark = (function (seriesItem, marks) {
  998. Object.keys(marks).forEach(function (key) {
  999. if (marks[key]) seriesItem[key] = marks[key];
  1000. });
  1001. });
  1002. // CONCATENATED MODULE: ./src/utils/charts/modules/animation.js
  1003. /* harmony default export */ var animation = (function (options, animation) {
  1004. Object.keys(animation).forEach(function (key) {
  1005. options[key] = animation[key];
  1006. });
  1007. });
  1008. // CONCATENATED MODULE: ./src/utils/charts/core.js
  1009. /* harmony default export */ var core = __webpack_exports__["a"] = ({
  1010. render: function render(h) {
  1011. return h('div', {
  1012. class: [Object(external_utils_lite_["camelToKebab"])(this.$options.name || this.$options._componentTag)],
  1013. style: this.canvasStyle
  1014. }, [h('div', {
  1015. style: this.canvasStyle,
  1016. class: { 'v-charts-mask-status': this.dataEmpty || this.loading },
  1017. ref: 'canvas'
  1018. }), h(data_empty, {
  1019. style: { display: this.dataEmpty ? '' : 'none' }
  1020. }), h(loading, {
  1021. style: { display: this.loading ? '' : 'none' }
  1022. }), this.$slots.default]);
  1023. },
  1024. props: {
  1025. data: { type: [Object, Array], default: function _default() {
  1026. return {};
  1027. }
  1028. },
  1029. settings: { type: Object, default: function _default() {
  1030. return {};
  1031. }
  1032. },
  1033. width: { type: String, default: 'auto' },
  1034. height: { type: String, default: '400px' },
  1035. beforeConfig: { type: Function },
  1036. afterConfig: { type: Function },
  1037. afterSetOption: { type: Function },
  1038. afterSetOptionOnce: { type: Function },
  1039. events: { type: Object },
  1040. grid: { type: [Object, Array] },
  1041. colors: { type: Array },
  1042. tooltipVisible: { type: Boolean, default: true },
  1043. legendVisible: { type: Boolean, default: true },
  1044. legendPosition: { type: String },
  1045. markLine: { type: Object },
  1046. markArea: { type: Object },
  1047. markPoint: { type: Object },
  1048. visualMap: { type: [Object, Array] },
  1049. dataZoom: { type: [Object, Array] },
  1050. toolbox: { type: [Object, Array] },
  1051. initOptions: { type: Object, default: function _default() {
  1052. return {};
  1053. }
  1054. },
  1055. title: [Object, Array],
  1056. legend: [Object, Array],
  1057. xAxis: [Object, Array],
  1058. yAxis: [Object, Array],
  1059. radar: Object,
  1060. tooltip: Object,
  1061. axisPointer: [Object, Array],
  1062. brush: [Object, Array],
  1063. geo: [Object, Array],
  1064. timeline: [Object, Array],
  1065. graphic: [Object, Array],
  1066. series: [Object, Array],
  1067. backgroundColor: [Object, String],
  1068. textStyle: [Object, Array],
  1069. animation: Object,
  1070. theme: Object,
  1071. themeName: String,
  1072. loading: Boolean,
  1073. dataEmpty: Boolean,
  1074. extend: Object,
  1075. judgeWidth: { type: Boolean, default: false },
  1076. widthChangeDelay: { type: Number, default: 300 },
  1077. tooltipFormatter: { type: Function },
  1078. resizeable: { type: Boolean, default: true },
  1079. resizeDelay: { type: Number, default: 200 },
  1080. changeDelay: { type: Number, default: 0 },
  1081. setOptionOpts: { type: [Boolean, Object], default: true },
  1082. cancelResizeCheck: Boolean,
  1083. notSetUnchange: Array,
  1084. log: Boolean
  1085. },
  1086. watch: {
  1087. data: {
  1088. deep: true,
  1089. handler: function handler(v) {
  1090. if (v) {
  1091. this.changeHandler();
  1092. }
  1093. }
  1094. },
  1095. settings: {
  1096. deep: true,
  1097. handler: function handler(v) {
  1098. if (v.type && this.chartLib) this.chartHandler = this.chartLib[v.type];
  1099. this.changeHandler();
  1100. }
  1101. },
  1102. width: 'nextTickResize',
  1103. height: 'nextTickResize',
  1104. events: {
  1105. deep: true,
  1106. handler: 'createEventProxy'
  1107. },
  1108. theme: {
  1109. deep: true,
  1110. handler: 'themeChange'
  1111. },
  1112. themeName: 'themeChange',
  1113. resizeable: 'resizeableHandler'
  1114. },
  1115. computed: {
  1116. canvasStyle: function canvasStyle() {
  1117. return {
  1118. width: this.width,
  1119. height: this.height,
  1120. position: 'relative'
  1121. };
  1122. },
  1123. chartColor: function chartColor() {
  1124. return this.colors || this.theme && this.theme.color || constants["a" /* DEFAULT_COLORS */];
  1125. }
  1126. },
  1127. methods: {
  1128. dataHandler: function dataHandler() {
  1129. if (!this.chartHandler) return;
  1130. var data = this.data;
  1131. var _data = data,
  1132. _data$columns = _data.columns,
  1133. columns = _data$columns === undefined ? [] : _data$columns,
  1134. _data$rows = _data.rows,
  1135. rows = _data$rows === undefined ? [] : _data$rows;
  1136. var extra = {
  1137. tooltipVisible: this.tooltipVisible,
  1138. legendVisible: this.legendVisible,
  1139. echarts: this.echarts,
  1140. color: this.chartColor,
  1141. tooltipFormatter: this.tooltipFormatter,
  1142. _once: this._once
  1143. };
  1144. if (this.beforeConfig) data = this.beforeConfig(data);
  1145. var options = this.chartHandler(columns, rows, this.settings, extra);
  1146. if (options) {
  1147. if (typeof options.then === 'function') {
  1148. options.then(this.optionsHandler);
  1149. } else {
  1150. this.optionsHandler(options);
  1151. }
  1152. }
  1153. },
  1154. nextTickResize: function nextTickResize() {
  1155. this.$nextTick(this.resize);
  1156. },
  1157. resize: function resize() {
  1158. if (!this.cancelResizeCheck) {
  1159. if (this.$el && this.$el.clientWidth && this.$el.clientHeight) {
  1160. this.echartsResize();
  1161. }
  1162. } else {
  1163. this.echartsResize();
  1164. }
  1165. },
  1166. echartsResize: function echartsResize() {
  1167. this.echarts && this.echarts.resize();
  1168. },
  1169. optionsHandler: function optionsHandler(options) {
  1170. var _this = this;
  1171. // legend
  1172. if (this.legendPosition && options.legend) {
  1173. options.legend[this.legendPosition] = 10;
  1174. if (~['left', 'right'].indexOf(this.legendPosition)) {
  1175. options.legend.top = 'middle';
  1176. options.legend.orient = 'vertical';
  1177. }
  1178. }
  1179. // color
  1180. options.color = this.chartColor;
  1181. // echarts self settings
  1182. constants["c" /* ECHARTS_SETTINGS */].forEach(function (setting) {
  1183. if (_this[setting]) options[setting] = _this[setting];
  1184. });
  1185. // animation
  1186. if (this.animation) animation(options, this.animation);
  1187. // marks
  1188. if (this.markArea || this.markLine || this.markPoint) {
  1189. var marks = {
  1190. markArea: this.markArea,
  1191. markLine: this.markLine,
  1192. markPoint: this.markPoint
  1193. };
  1194. var series = options.series;
  1195. if (Object(external_utils_lite_["isArray"])(series)) {
  1196. series.forEach(function (item) {
  1197. mark(item, marks);
  1198. });
  1199. } else if (Object(external_utils_lite_["isObject"])(series)) {
  1200. mark(series, marks);
  1201. }
  1202. }
  1203. // change inited echarts settings
  1204. if (this.extend) modules_extend(options, this.extend);
  1205. if (this.afterConfig) options = this.afterConfig(options);
  1206. var setOptionOpts = this.setOptionOpts;
  1207. // map chart not merge
  1208. if ((this.settings.bmap || this.settings.amap) && !Object(external_utils_lite_["isObject"])(setOptionOpts)) {
  1209. setOptionOpts = false;
  1210. }
  1211. // exclude unchange options
  1212. if (this.notSetUnchange && this.notSetUnchange.length) {
  1213. this.notSetUnchange.forEach(function (item) {
  1214. var value = options[item];
  1215. if (value) {
  1216. if (Object(external_utils_lite_["isEqual"])(value, _this._store[item])) {
  1217. options[item] = undefined;
  1218. } else {
  1219. _this._store[item] = Object(external_utils_lite_["cloneDeep"])(value);
  1220. }
  1221. }
  1222. });
  1223. if (Object(external_utils_lite_["isObject"])(setOptionOpts)) {
  1224. setOptionOpts.notMerge = false;
  1225. } else {
  1226. setOptionOpts = false;
  1227. }
  1228. }
  1229. if (this._isDestroyed) return;
  1230. if (this.log) console.log(options);
  1231. console.log('options------->', options);
  1232. console.log('setOptions----->', setOptionOpts);
  1233. // 设置一些基本参数
  1234. options.legend.textStyle = {
  1235. color: '#FFF'
  1236. };
  1237. this.echarts.setOption(options, setOptionOpts);
  1238. this.$emit('ready', this.echarts, options, echarts_default.a);
  1239. if (!this._once['ready-once']) {
  1240. this._once['ready-once'] = true;
  1241. this.$emit('ready-once', this.echarts, options, echarts_default.a);
  1242. }
  1243. if (this.judgeWidth) this.judgeWidthHandler(options);
  1244. if (this.afterSetOption) this.afterSetOption(this.echarts, options, echarts_default.a);
  1245. if (this.afterSetOptionOnce && !this._once['afterSetOptionOnce']) {
  1246. this._once['afterSetOptionOnce'] = true;
  1247. this.afterSetOptionOnce(this.echarts, options, echarts_default.a);
  1248. }
  1249. },
  1250. judgeWidthHandler: function judgeWidthHandler(options) {
  1251. var _this2 = this;
  1252. var widthChangeDelay = this.widthChangeDelay,
  1253. resize = this.resize;
  1254. if (this.$el.clientWidth || this.$el.clientHeight) {
  1255. resize();
  1256. } else {
  1257. this.$nextTick(function (_) {
  1258. if (_this2.$el.clientWidth || _this2.$el.clientHeight) {
  1259. resize();
  1260. } else {
  1261. setTimeout(function (_) {
  1262. resize();
  1263. if (!_this2.$el.clientWidth || !_this2.$el.clientHeight) {
  1264. console.warn(' Can\'t get dom width or height ');
  1265. }
  1266. }, widthChangeDelay);
  1267. }
  1268. });
  1269. }
  1270. },
  1271. resizeableHandler: function resizeableHandler(resizeable) {
  1272. if (resizeable && !this._once.onresize) this.addResizeListener();
  1273. if (!resizeable && this._once.onresize) this.removeResizeListener();
  1274. },
  1275. init: function init() {
  1276. if (this.echarts) return;
  1277. var themeName = this.themeName || this.theme || constants["b" /* DEFAULT_THEME */];
  1278. this.echarts = echarts_default.a.init(this.$refs.canvas, themeName, this.initOptions);
  1279. if (this.data) this.changeHandler();
  1280. this.createEventProxy();
  1281. if (this.resizeable) this.addResizeListener();
  1282. },
  1283. addResizeListener: function addResizeListener() {
  1284. window.addEventListener('resize', this.resizeHandler);
  1285. this._once.onresize = true;
  1286. },
  1287. removeResizeListener: function removeResizeListener() {
  1288. window.removeEventListener('resize', this.resizeHandler);
  1289. this._once.onresize = false;
  1290. },
  1291. addWatchToProps: function addWatchToProps() {
  1292. var _this3 = this;
  1293. var watchedVariable = this._watchers.map(function (watcher) {
  1294. return watcher.expression;
  1295. });
  1296. Object.keys(this.$props).forEach(function (prop) {
  1297. if (!~watchedVariable.indexOf(prop) && !~constants["f" /* STATIC_PROPS */].indexOf(prop)) {
  1298. var opts = {};
  1299. if (~['[object Object]', '[object Array]'].indexOf(Object(external_utils_lite_["getType"])(_this3.$props[prop]))) {
  1300. opts.deep = true;
  1301. }
  1302. _this3.$watch(prop, function () {
  1303. _this3.changeHandler();
  1304. }, opts);
  1305. }
  1306. });
  1307. },
  1308. createEventProxy: function createEventProxy() {
  1309. var _this4 = this;
  1310. // 只要用户使用 on 方法绑定的事件都做一层代理,
  1311. // 是否真正执行相应的事件方法取决于该方法是否仍然存在 events 中
  1312. // 实现 events 的动态响应
  1313. var self = this;
  1314. var keys = Object.keys(this.events || {});
  1315. keys.length && keys.forEach(function (ev) {
  1316. if (_this4.registeredEvents.indexOf(ev) === -1) {
  1317. _this4.registeredEvents.push(ev);
  1318. _this4.echarts.on(ev, function (ev) {
  1319. return function () {
  1320. if (ev in self.events) {
  1321. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  1322. args[_key] = arguments[_key];
  1323. }
  1324. self.events[ev].apply(null, args);
  1325. }
  1326. };
  1327. }(ev));
  1328. }
  1329. });
  1330. },
  1331. themeChange: function themeChange(theme) {
  1332. this.clean();
  1333. this.echarts = null;
  1334. this.init();
  1335. },
  1336. clean: function clean() {
  1337. if (this.resizeable) this.removeResizeListener();
  1338. this.echarts.dispose();
  1339. }
  1340. },
  1341. created: function created() {
  1342. this.echarts = null;
  1343. this.registeredEvents = [];
  1344. this._once = {};
  1345. this._store = {};
  1346. this.resizeHandler = Object(external_utils_lite_["debounce"])(this.resize, this.resizeDelay);
  1347. this.changeHandler = Object(external_utils_lite_["debounce"])(this.dataHandler, this.changeDelay);
  1348. this.addWatchToProps();
  1349. },
  1350. mounted: function mounted() {
  1351. this.init();
  1352. },
  1353. beforeDestroy: function beforeDestroy() {
  1354. this.clean();
  1355. },
  1356. _numerify: external_numerify_default.a
  1357. });
  1358. /***/ }),
  1359. /***/ 5:
  1360. /***/ (function(module, exports, __webpack_require__) {
  1361. "use strict";
  1362. /*
  1363. MIT License http://www.opensource.org/licenses/mit-license.php
  1364. Author Tobias Koppers @sokra
  1365. */
  1366. // css base code, injected by the css-loader
  1367. module.exports = function (useSourceMap) {
  1368. var list = []; // return the list of modules as css string
  1369. list.toString = function toString() {
  1370. return this.map(function (item) {
  1371. var content = cssWithMappingToString(item, useSourceMap);
  1372. if (item[2]) {
  1373. return '@media ' + item[2] + '{' + content + '}';
  1374. } else {
  1375. return content;
  1376. }
  1377. }).join('');
  1378. }; // import a list of modules into the list
  1379. list.i = function (modules, mediaQuery) {
  1380. if (typeof modules === 'string') {
  1381. modules = [[null, modules, '']];
  1382. }
  1383. var alreadyImportedModules = {};
  1384. for (var i = 0; i < this.length; i++) {
  1385. var id = this[i][0];
  1386. if (id != null) {
  1387. alreadyImportedModules[id] = true;
  1388. }
  1389. }
  1390. for (i = 0; i < modules.length; i++) {
  1391. var item = modules[i]; // skip already imported module
  1392. // this implementation is not 100% perfect for weird media query combinations
  1393. // when a module is imported multiple times with different media queries.
  1394. // I hope this will never occur (Hey this way we have smaller bundles)
  1395. if (item[0] == null || !alreadyImportedModules[item[0]]) {
  1396. if (mediaQuery && !item[2]) {
  1397. item[2] = mediaQuery;
  1398. } else if (mediaQuery) {
  1399. item[2] = '(' + item[2] + ') and (' + mediaQuery + ')';
  1400. }
  1401. list.push(item);
  1402. }
  1403. }
  1404. };
  1405. return list;
  1406. };
  1407. function cssWithMappingToString(item, useSourceMap) {
  1408. var content = item[1] || '';
  1409. var cssMapping = item[3];
  1410. if (!cssMapping) {
  1411. return content;
  1412. }
  1413. if (useSourceMap && typeof btoa === 'function') {
  1414. var sourceMapping = toComment(cssMapping);
  1415. var sourceURLs = cssMapping.sources.map(function (source) {
  1416. return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */';
  1417. });
  1418. return [content].concat(sourceURLs).concat([sourceMapping]).join('\n');
  1419. }
  1420. return [content].join('\n');
  1421. } // Adapted from convert-source-map (MIT)
  1422. function toComment(sourceMap) {
  1423. // eslint-disable-next-line no-undef
  1424. var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));
  1425. var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;
  1426. return '/*# ' + data + ' */';
  1427. }
  1428. /***/ }),
  1429. /***/ 54:
  1430. /***/ (function(module, exports) {
  1431. module.exports = require("echarts/lib/component/tooltip");
  1432. /***/ }),
  1433. /***/ 55:
  1434. /***/ (function(module, exports) {
  1435. module.exports = require("echarts/lib/component/legend");
  1436. /***/ }),
  1437. /***/ 56:
  1438. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1439. "use strict";
  1440. /* harmony import */ var _node_modules_style_loader_index_js_node_modules_css_loader_dist_cjs_js_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_vue_loader_lib_index_js_vue_loader_options_loading_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(39);
  1441. /* harmony import */ var _node_modules_style_loader_index_js_node_modules_css_loader_dist_cjs_js_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_vue_loader_lib_index_js_vue_loader_options_loading_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_index_js_node_modules_css_loader_dist_cjs_js_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_vue_loader_lib_index_js_vue_loader_options_loading_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__);
  1442. /* unused harmony reexport * */
  1443. /***/ }),
  1444. /***/ 57:
  1445. /***/ (function(module, exports, __webpack_require__) {
  1446. exports = module.exports = __webpack_require__(5)(false);
  1447. // Module
  1448. exports.push([module.i, "\n.v-charts-component-loading {\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n background-color: rgba(255, 255, 255, .9);\n}\n.v-charts-mask-status {\n filter: blur(1px);\n}\n.v-charts-component-loading .circular {\n width: 42px;\n height: 42px;\n animation: loading-rotate 2s linear infinite;\n}\n.v-charts-component-loading .path {\n animation: loading-dash 1.5s ease-in-out infinite;\n stroke-dasharray: 90,150;\n stroke-dashoffset: 0;\n stroke-width: 2;\n stroke: #20a0ff;\n stroke-linecap: round;\n}\n@keyframes loading-rotate {\n100% {\n transform: rotate(360deg);\n}\n}\n@keyframes loading-dash {\n0% {\n stroke-dasharray: 1, 200;\n stroke-dashoffset: 0;\n}\n50% {\n stroke-dasharray: 90, 150;\n stroke-dashoffset: -40px;\n}\n100% {\n stroke-dasharray: 90, 150;\n stroke-dashoffset: -120px;\n}\n}\n", ""]);
  1449. /***/ }),
  1450. /***/ 58:
  1451. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1452. "use strict";
  1453. /* harmony import */ var _node_modules_style_loader_index_js_node_modules_css_loader_dist_cjs_js_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_vue_loader_lib_index_js_vue_loader_options_data_empty_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(40);
  1454. /* harmony import */ var _node_modules_style_loader_index_js_node_modules_css_loader_dist_cjs_js_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_vue_loader_lib_index_js_vue_loader_options_data_empty_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_index_js_node_modules_css_loader_dist_cjs_js_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_vue_loader_lib_index_js_vue_loader_options_data_empty_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__);
  1455. /* unused harmony reexport * */
  1456. /***/ }),
  1457. /***/ 59:
  1458. /***/ (function(module, exports, __webpack_require__) {
  1459. exports = module.exports = __webpack_require__(5)(false);
  1460. // Module
  1461. exports.push([module.i, "\n.v-charts-data-empty {\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n background-color: rgba(255, 255, 255, .9);\n color: #888;\n font-size: 14px;\n}\n", ""]);
  1462. /***/ }),
  1463. /***/ 6:
  1464. /***/ (function(module, exports, __webpack_require__) {
  1465. /*
  1466. MIT License http://www.opensource.org/licenses/mit-license.php
  1467. Author Tobias Koppers @sokra
  1468. */
  1469. var stylesInDom = {};
  1470. var memoize = function (fn) {
  1471. var memo;
  1472. return function () {
  1473. if (typeof memo === "undefined") memo = fn.apply(this, arguments);
  1474. return memo;
  1475. };
  1476. };
  1477. var isOldIE = memoize(function () {
  1478. // Test for IE <= 9 as proposed by Browserhacks
  1479. // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805
  1480. // Tests for existence of standard globals is to allow style-loader
  1481. // to operate correctly into non-standard environments
  1482. // @see https://github.com/webpack-contrib/style-loader/issues/177
  1483. return window && document && document.all && !window.atob;
  1484. });
  1485. var getTarget = function (target, parent) {
  1486. if (parent){
  1487. return parent.querySelector(target);
  1488. }
  1489. return document.querySelector(target);
  1490. };
  1491. var getElement = (function (fn) {
  1492. var memo = {};
  1493. return function(target, parent) {
  1494. // If passing function in options, then use it for resolve "head" element.
  1495. // Useful for Shadow Root style i.e
  1496. // {
  1497. // insertInto: function () { return document.querySelector("#foo").shadowRoot }
  1498. // }
  1499. if (typeof target === 'function') {
  1500. return target();
  1501. }
  1502. if (typeof memo[target] === "undefined") {
  1503. var styleTarget = getTarget.call(this, target, parent);
  1504. // Special case to return head of iframe instead of iframe itself
  1505. if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
  1506. try {
  1507. // This will throw an exception if access to iframe is blocked
  1508. // due to cross-origin restrictions
  1509. styleTarget = styleTarget.contentDocument.head;
  1510. } catch(e) {
  1511. styleTarget = null;
  1512. }
  1513. }
  1514. memo[target] = styleTarget;
  1515. }
  1516. return memo[target]
  1517. };
  1518. })();
  1519. var singleton = null;
  1520. var singletonCounter = 0;
  1521. var stylesInsertedAtTop = [];
  1522. var fixUrls = __webpack_require__(12);
  1523. module.exports = function(list, options) {
  1524. if (typeof DEBUG !== "undefined" && DEBUG) {
  1525. if (typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment");
  1526. }
  1527. options = options || {};
  1528. options.attrs = typeof options.attrs === "object" ? options.attrs : {};
  1529. // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
  1530. // tags it will allow on a page
  1531. if (!options.singleton && typeof options.singleton !== "boolean") options.singleton = isOldIE();
  1532. // By default, add <style> tags to the <head> element
  1533. if (!options.insertInto) options.insertInto = "head";
  1534. // By default, add <style> tags to the bottom of the target
  1535. if (!options.insertAt) options.insertAt = "bottom";
  1536. var styles = listToStyles(list, options);
  1537. addStylesToDom(styles, options);
  1538. return function update (newList) {
  1539. var mayRemove = [];
  1540. for (var i = 0; i < styles.length; i++) {
  1541. var item = styles[i];
  1542. var domStyle = stylesInDom[item.id];
  1543. domStyle.refs--;
  1544. mayRemove.push(domStyle);
  1545. }
  1546. if(newList) {
  1547. var newStyles = listToStyles(newList, options);
  1548. addStylesToDom(newStyles, options);
  1549. }
  1550. for (var i = 0; i < mayRemove.length; i++) {
  1551. var domStyle = mayRemove[i];
  1552. if(domStyle.refs === 0) {
  1553. for (var j = 0; j < domStyle.parts.length; j++) domStyle.parts[j]();
  1554. delete stylesInDom[domStyle.id];
  1555. }
  1556. }
  1557. };
  1558. };
  1559. function addStylesToDom (styles, options) {
  1560. for (var i = 0; i < styles.length; i++) {
  1561. var item = styles[i];
  1562. var domStyle = stylesInDom[item.id];
  1563. if(domStyle) {
  1564. domStyle.refs++;
  1565. for(var j = 0; j < domStyle.parts.length; j++) {
  1566. domStyle.parts[j](item.parts[j]);
  1567. }
  1568. for(; j < item.parts.length; j++) {
  1569. domStyle.parts.push(addStyle(item.parts[j], options));
  1570. }
  1571. } else {
  1572. var parts = [];
  1573. for(var j = 0; j < item.parts.length; j++) {
  1574. parts.push(addStyle(item.parts[j], options));
  1575. }
  1576. stylesInDom[item.id] = {id: item.id, refs: 1, parts: parts};
  1577. }
  1578. }
  1579. }
  1580. function listToStyles (list, options) {
  1581. var styles = [];
  1582. var newStyles = {};
  1583. for (var i = 0; i < list.length; i++) {
  1584. var item = list[i];
  1585. var id = options.base ? item[0] + options.base : item[0];
  1586. var css = item[1];
  1587. var media = item[2];
  1588. var sourceMap = item[3];
  1589. var part = {css: css, media: media, sourceMap: sourceMap};
  1590. if(!newStyles[id]) styles.push(newStyles[id] = {id: id, parts: [part]});
  1591. else newStyles[id].parts.push(part);
  1592. }
  1593. return styles;
  1594. }
  1595. function insertStyleElement (options, style) {
  1596. var target = getElement(options.insertInto)
  1597. if (!target) {
  1598. throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");
  1599. }
  1600. var lastStyleElementInsertedAtTop = stylesInsertedAtTop[stylesInsertedAtTop.length - 1];
  1601. if (options.insertAt === "top") {
  1602. if (!lastStyleElementInsertedAtTop) {
  1603. target.insertBefore(style, target.firstChild);
  1604. } else if (lastStyleElementInsertedAtTop.nextSibling) {
  1605. target.insertBefore(style, lastStyleElementInsertedAtTop.nextSibling);
  1606. } else {
  1607. target.appendChild(style);
  1608. }
  1609. stylesInsertedAtTop.push(style);
  1610. } else if (options.insertAt === "bottom") {
  1611. target.appendChild(style);
  1612. } else if (typeof options.insertAt === "object" && options.insertAt.before) {
  1613. var nextSibling = getElement(options.insertAt.before, target);
  1614. target.insertBefore(style, nextSibling);
  1615. } else {
  1616. throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");
  1617. }
  1618. }
  1619. function removeStyleElement (style) {
  1620. if (style.parentNode === null) return false;
  1621. style.parentNode.removeChild(style);
  1622. var idx = stylesInsertedAtTop.indexOf(style);
  1623. if(idx >= 0) {
  1624. stylesInsertedAtTop.splice(idx, 1);
  1625. }
  1626. }
  1627. function createStyleElement (options) {
  1628. var style = document.createElement("style");
  1629. if(options.attrs.type === undefined) {
  1630. options.attrs.type = "text/css";
  1631. }
  1632. if(options.attrs.nonce === undefined) {
  1633. var nonce = getNonce();
  1634. if (nonce) {
  1635. options.attrs.nonce = nonce;
  1636. }
  1637. }
  1638. addAttrs(style, options.attrs);
  1639. insertStyleElement(options, style);
  1640. return style;
  1641. }
  1642. function createLinkElement (options) {
  1643. var link = document.createElement("link");
  1644. if(options.attrs.type === undefined) {
  1645. options.attrs.type = "text/css";
  1646. }
  1647. options.attrs.rel = "stylesheet";
  1648. addAttrs(link, options.attrs);
  1649. insertStyleElement(options, link);
  1650. return link;
  1651. }
  1652. function addAttrs (el, attrs) {
  1653. Object.keys(attrs).forEach(function (key) {
  1654. el.setAttribute(key, attrs[key]);
  1655. });
  1656. }
  1657. function getNonce() {
  1658. if (false) {}
  1659. return __webpack_require__.nc;
  1660. }
  1661. function addStyle (obj, options) {
  1662. var style, update, remove, result;
  1663. // If a transform function was defined, run it on the css
  1664. if (options.transform && obj.css) {
  1665. result = typeof options.transform === 'function'
  1666. ? options.transform(obj.css)
  1667. : options.transform.default(obj.css);
  1668. if (result) {
  1669. // If transform returns a value, use that instead of the original css.
  1670. // This allows running runtime transformations on the css.
  1671. obj.css = result;
  1672. } else {
  1673. // If the transform function returns a falsy value, don't add this css.
  1674. // This allows conditional loading of css
  1675. return function() {
  1676. // noop
  1677. };
  1678. }
  1679. }
  1680. if (options.singleton) {
  1681. var styleIndex = singletonCounter++;
  1682. style = singleton || (singleton = createStyleElement(options));
  1683. update = applyToSingletonTag.bind(null, style, styleIndex, false);
  1684. remove = applyToSingletonTag.bind(null, style, styleIndex, true);
  1685. } else if (
  1686. obj.sourceMap &&
  1687. typeof URL === "function" &&
  1688. typeof URL.createObjectURL === "function" &&
  1689. typeof URL.revokeObjectURL === "function" &&
  1690. typeof Blob === "function" &&
  1691. typeof btoa === "function"
  1692. ) {
  1693. style = createLinkElement(options);
  1694. update = updateLink.bind(null, style, options);
  1695. remove = function () {
  1696. removeStyleElement(style);
  1697. if(style.href) URL.revokeObjectURL(style.href);
  1698. };
  1699. } else {
  1700. style = createStyleElement(options);
  1701. update = applyToTag.bind(null, style);
  1702. remove = function () {
  1703. removeStyleElement(style);
  1704. };
  1705. }
  1706. update(obj);
  1707. return function updateStyle (newObj) {
  1708. if (newObj) {
  1709. if (
  1710. newObj.css === obj.css &&
  1711. newObj.media === obj.media &&
  1712. newObj.sourceMap === obj.sourceMap
  1713. ) {
  1714. return;
  1715. }
  1716. update(obj = newObj);
  1717. } else {
  1718. remove();
  1719. }
  1720. };
  1721. }
  1722. var replaceText = (function () {
  1723. var textStore = [];
  1724. return function (index, replacement) {
  1725. textStore[index] = replacement;
  1726. return textStore.filter(Boolean).join('\n');
  1727. };
  1728. })();
  1729. function applyToSingletonTag (style, index, remove, obj) {
  1730. var css = remove ? "" : obj.css;
  1731. if (style.styleSheet) {
  1732. style.styleSheet.cssText = replaceText(index, css);
  1733. } else {
  1734. var cssNode = document.createTextNode(css);
  1735. var childNodes = style.childNodes;
  1736. if (childNodes[index]) style.removeChild(childNodes[index]);
  1737. if (childNodes.length) {
  1738. style.insertBefore(cssNode, childNodes[index]);
  1739. } else {
  1740. style.appendChild(cssNode);
  1741. }
  1742. }
  1743. }
  1744. function applyToTag (style, obj) {
  1745. var css = obj.css;
  1746. var media = obj.media;
  1747. if(media) {
  1748. style.setAttribute("media", media)
  1749. }
  1750. if(style.styleSheet) {
  1751. style.styleSheet.cssText = css;
  1752. } else {
  1753. while(style.firstChild) {
  1754. style.removeChild(style.firstChild);
  1755. }
  1756. style.appendChild(document.createTextNode(css));
  1757. }
  1758. }
  1759. function updateLink (link, options, obj) {
  1760. var css = obj.css;
  1761. var sourceMap = obj.sourceMap;
  1762. /*
  1763. If convertToAbsoluteUrls isn't defined, but sourcemaps are enabled
  1764. and there is no publicPath defined then lets turn convertToAbsoluteUrls
  1765. on by default. Otherwise default to the convertToAbsoluteUrls option
  1766. directly
  1767. */
  1768. var autoFixUrls = options.convertToAbsoluteUrls === undefined && sourceMap;
  1769. if (options.convertToAbsoluteUrls || autoFixUrls) {
  1770. css = fixUrls(css);
  1771. }
  1772. if (sourceMap) {
  1773. // http://stackoverflow.com/a/26603875
  1774. css += "\n/*# sourceMappingURL=data:application/json;base64," + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + " */";
  1775. }
  1776. var blob = new Blob([css], { type: "text/css" });
  1777. var oldSrc = link.href;
  1778. link.href = URL.createObjectURL(blob);
  1779. if(oldSrc) URL.revokeObjectURL(oldSrc);
  1780. }
  1781. /***/ })
  1782. /******/ });