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.

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