app模板、应用模板、组件模板、widget模板
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.

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