diff --git a/CHANGELOG.md b/CHANGELOG.md index 760bf4d..9c87848 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,190 @@ -# 2.4.5-alpha (2019-++-++) +# 2.10.0-alpha (2020-09-09) +### New + +- **decoration12:** New decoration(Radar scan). + +### Optmization + +- **decoration** add `dur` configuration. +- **activeRingChart** add `digitalFlopUnit` configuration. + +# 2.9.9-alpha (2020-08-25) + +### Optmization + +- **borderBox:** Canonical class name. +- **autoResize(mixin):** Add exception prompt. + +# 2.9.8-alpha (2020-08-20) + +### Optmization + +- **scrollRankingBoard:** Add value formatter. + +# 2.9.7-alpha (2020-08-19) + +### Optmization + +- **scrollBoard:** Optimize the update effect of updateRows. + +# 2.9.6-alpha (2020-08-05) + +### Bug Fixes + +- **scrollBoard:** Carousel is abnormal when carousel is page. +- **scrollRankingBoard:** Carousel is abnormal when carousel is page. + +# 2.9.5-alpha (2020-08-05) + +### Optmization + +- **scrollBoard:** Reduce redundant node rendering. +- **scrollRankingBoard:** Reduce redundant node rendering. +- **scrollBoard:** Add api to update row data. + +# 2.9.4-alpha (2020-07-03) + +### Optmization + +- **scrollBoard:** Optimize key value [(#8)](https://github.com/DataV-Team/DataV-React/issues/8). + +# 2.9.3-alpha (2020-07-02) + +### Perfect + +- **uuid:** Optimization of `-` in uuid will cause abnormal svg animation [(#108)](https://github.com/DataV-Team/DataV/issues/108). + +# 2.9.2-alpha (2020-06-16) + +### Bug Fixes + +- **scrollBoard:** reset animationIndex when config upate. + +# 2.9.1-alpha (2020-06-16) + +### Bug Fixes + +- **scrollRankingBoard:** Calculation optimization of negative values [(#101)](https://github.com/DataV-Team/DataV/pull/101). + +### Perfect + +- **digitalFlop:** add number formatter. + +# 2.9.0-alpha (2020-06-10) + +### ScrollBoard + +- **hoverPause:** add `hoverPause` configuration [(#96)](https://github.com/DataV-Team/DataV/pull/96). +- **mouseover:** add `mouseover` event [(#96)](https://github.com/DataV-Team/DataV/pull/96). + +# 2.8.4-alpha (2020-05-25) + +### Perfect + +- **uuid:** Use uuid to produce unique id. + +# 2.8.3-alpha (2020-05-06) + +### Perfect + +- **activeRingChart:** add `showOriginValue` configuration. +- **capsuleChart:** add `showValue` configuration. + +# 2.8.2-alpha (2020-05-06) + +### Perfect + +- **borderBox8:** add `reverse` configuration. + +# 2.8.1-alpha (2020-05-03) + +### Perfect + +- **digitalFlop:** Use `\n` to start a newline. +- **digitalFlop:** `rowGap` configuration. + +# 2.7.4-alpha (2020-04-15) + +### Bug Fixes + +- **capsuleChart:** Calculate exception when min value is less 5 [(#59)](https://github.com/DataV-Team/DataV/pull/59). + +# 2.7.3-alpha (2020-01-16) + +### Bug Fixes + +- **activeRingChart:** `parseInt` precision lost. + +# 2.7.2-alpha (2020-01-10) + +### Perfect + +- **ativeRingChart:** Add digitalFlopToFixed configuration. + +# 2.7.1-alpha (2020-01-08) + +### Bug Fixes + +- **flylineChartEnhanced:** Exception when relative is false. + +# 2.7.0-alpha (2020-01-05) + +### New + +- **flylineChartEnhanced:** Enhanced flylineChart [(#12)](https://github.com/DataV-Team/DataV/issues/12). + +# 2.6.0-alpha (2019-12-25) + +### Perfect + +- **scrollRankingBoard:** Configurable auto-sequencing [(#35)](https://github.com/DataV-Team/DataV/pull/35). +- **scrollRankingBoard:** Render name using `v-html` [(#36)](https://github.com/DataV-Team/DataV/pull/36). + +# 2.5.0-alpha (2019-12-06) + +### Feature + +- **borderBox & decoration:** **Configurable** colors. + ```html + + + + ``` +- **scrollBoard:** Configurable index header [(#33)](https://github.com/DataV-Team/DataV/pull/33). + +### New + +- **borderBox11** +- **borderBox12** +- **borderBox13** +- **decoration11** + +# 2.4.8-alpha (2019-11-12) + +### Bug Fixes + +- **scrollBoard:** After updating props, the carousel speed is abnormal [(#25)](https://github.com/jiaming743/DataV/issues/16),[(#20)](https://github.com/jiaming743/DataV/issues/25). +- **scrollRankingBorad:** After updating props, the carousel speed is abnormal[(#25)](https://github.com/jiaming743/DataV/issues/16),[(#20)](https://github.com/jiaming743/DataV/issues/25). + +# 2.4.7-alpha (2019-10-24) + +### Perfect + +- **charts:** Optimize memory leaks. +- **digitalFlop:** Optimize memory leaks. + +# 2.4.6-alpha (2019-10-24) + +### Bug Fixes + +- **activeRingChart:** Optimize memory leaks [(#16)](https://github.com/jiaming743/DataV/issues/16),[(#20)](https://github.com/jiaming743/DataV/issues/20). + +# 2.4.5-alpha (2019-09-24) + +### Bug Fixes +- **activeRingChart:** Calculation exception due to data value being 0 [(#17)](https://github.com/jiaming743/DataV/issues/17). # 2.4.4-alpha (2019-09-05) diff --git a/LICENSE b/LICENSE index 1a36e9f..0af931d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2019-present, JiaMing +Copyright (c) 2019-present, DataV-Team Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 708d28c..ebff6f6 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,12 @@ [ENGLISH](./README_EN.md) +

+ +

DataV

- - LICENSE + + LICENSE LICENSE @@ -12,7 +15,7 @@ ## DataV是干什么的? -* DataV是一个基于**Vue**的数据可视化组件库 +* DataV是一个基于**Vue**的数据可视化组件库(当然也有[React版本](https://github.com/DataV-Team/DataV-React)) * 提供用于提升页面视觉效果的**SVG**边框和装饰 * 提供常用的**图表**如折线图等 * 飞线图/轮播表等其他组件 @@ -44,27 +47,16 @@ Vue.use(borderBox1) [UMD版使用示例](./umdExample.html) -### React版本 - -React版本已在开发中,敬请期待 - -### 调研 - -关于React版本组件库及反馈请移步[问卷调查](https://www.wjx.cn/jq/45326197.aspx) - -![问卷调查](./questionnaire.jpg) - ### TODO -* **飞线图**添加多中心点及反向飞线功能 -* **边框**及**装饰**添加颜色及其他必要配置项,增强可配置性及灵活性. +* **地图组件** +* **TS**重构组件库底层依赖 ### 致谢 -组件库的开发基于个人学习和兴趣,由于技术水平及经验的限制,组件尚有许多不完善之处,如有BUG可及时提交[issue](https://github.com/jiaming743/DataV/issues/new?template=bug_report.md)或添加反馈群进行反馈,也欢迎提供指正和建议,感谢各位的支持。 +组件库的开发基于个人学习和兴趣,由于技术水平及经验的限制,组件尚有许多不完善之处,如有BUG可及时提交[issue](https://github.com/DataV-Team/DataV/issues/new?template=bug_report.md)或添加反馈群进行反馈,也欢迎提供指正和建议,感谢各位的支持。 ### 反馈 - ![Feedback](./QQGroup.png) ### Demo diff --git a/README_EN.md b/README_EN.md index de6453a..7289581 100644 --- a/README_EN.md +++ b/README_EN.md @@ -1,10 +1,12 @@ [中文](./README.md) +

+ +

DataV

-

- - LICENSE + + LICENSE LICENSE @@ -13,7 +15,7 @@ ## What is DataV? -* DataV is a data **visualization** components library based on **Vue**. +* DataV is a data **visualization** components library based on **Vue**(Of course there are also [React versions](https://github.com/DataV-Team/DataV-React)). * Provide cool **SVG** borders and decorations. * Provide common **charts** such as line chart, etc.. * flying line chart, carousel table and etc. @@ -57,12 +59,12 @@ React version of the component library and feedback[Questionnaire](https://www.w ### TODO -* **flylineChart**Add multi-center point and reverse fly line function. -* Add color and other necessary configuration to the **borderBox** and **decoration** to enhance configurability and flexibility. +* **Map Component** +* Refactor underlying dependencies using **TS**. ### Acknowledgement -The development of the component library is based on personal learning and interest. Due to technical level and experience limitations, there are still many imperfections in the components. If there are errors, you can submit [issue](https://github.com/jiaming743/DataV/issues/new?template=bug_report.md) in time or add feedback groups for feedback. Welcome to provide corrections and suggestions. Thank you for your support. +The development of the component library is based on personal learning and interest. Due to technical level and experience limitations, there are still many imperfections in the components. If there are errors, you can submit [issue](https://github.com/DataV-team/DataV/issues/new?template=bug_report.md) in time or add feedback groups for feedback. Welcome to provide corrections and suggestions. Thank you for your support. ### Feedback diff --git a/build/rollup.terser.config.js b/build/rollup.terser.config.js index 32c8738..bcb5833 100644 --- a/build/rollup.terser.config.js +++ b/build/rollup.terser.config.js @@ -12,13 +12,13 @@ export default { name: 'datav' }, plugins: [ - terser(), resolve(), babel({ exclude: 'node_modules/**' }), commonjs(), vue(), + terser(), ], external: ['Vue'] } \ No newline at end of file diff --git a/dist/datav.map.vue.js b/dist/datav.map.vue.js index 7d428ac..8879b3d 100644 --- a/dist/datav.map.vue.js +++ b/dist/datav.map.vue.js @@ -2,9 +2,9 @@ typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('vue')) : typeof define === 'function' && define.amd ? define(['vue'], factory) : (global = global || self, factory(global.Vue)); -}(this, function (Vue) { 'use strict'; +}(this, (function (Vue) { 'use strict'; - Vue = Vue && Vue.hasOwnProperty('default') ? Vue['default'] : Vue; + Vue = Vue && Object.prototype.hasOwnProperty.call(Vue, 'default') ? Vue['default'] : Vue; function randomExtend(minNum, maxNum) { if (arguments.length === 1) { @@ -38,6 +38,13 @@ const minusY = Math.abs(pointOne[1] - pointTwo[1]); return Math.sqrt(minusX * minusX + minusY * minusY); } + function uuid(hasHyphen) { + return (hasHyphen ? 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx' : 'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx').replace(/[xy]/g, function (c) { + const r = Math.random() * 16 | 0; + const v = c == 'x' ? r : r & 0x3 | 0x8; + return v.toString(16); + }); + } var autoResize = { data() { @@ -72,10 +79,17 @@ onResize } = this; return new Promise(resolve => { - $nextTick(e => { + $nextTick(_ => { const dom = this.dom = $refs[ref]; - this.width = dom.clientWidth; - this.height = dom.clientHeight; + this.width = dom ? dom.clientWidth : 0; + this.height = dom ? dom.clientHeight : 0; + + if (!dom) { + console.warn('DataV: Failed to get dom node, component rendering may be abnormal!'); + } else if (!this.width || !this.height) { + console.warn('DataV: Component width or height is 0px, rendering abnormality may occur!'); + } + if (typeof onResize === 'function' && resize) onResize(); resolve(); }); @@ -103,6 +117,7 @@ domObserver, debounceInitWHFun } = this; + if (!domObserver) return; domObserver.disconnect(); domObserver.takeRecords(); domObserver = null; @@ -185,146 +200,134 @@ } }; - function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier - /* server only */ - , shadowMode, createInjector, createInjectorSSR, createInjectorShadow) { - if (typeof shadowMode !== 'boolean') { - createInjectorSSR = createInjector; - createInjector = shadowMode; - shadowMode = false; - } // Vue.extend constructor export interop. - - - var options = typeof script === 'function' ? script.options : script; // render functions - - if (template && template.render) { - options.render = template.render; - options.staticRenderFns = template.staticRenderFns; - options._compiled = true; // functional template - - if (isFunctionalTemplate) { - options.functional = true; - } - } // scopedId - - - if (scopeId) { - options._scopeId = scopeId; - } - - var hook; - - if (moduleIdentifier) { - // server build - hook = function hook(context) { - // 2.3 injection - context = context || // cached call - this.$vnode && this.$vnode.ssrContext || // stateful - this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext; // functional - // 2.2 with runInNewContext: true - - if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { - context = __VUE_SSR_CONTEXT__; - } // inject component styles - - - if (style) { - style.call(this, createInjectorSSR(context)); - } // register component module identifier for async chunk inference - - - if (context && context._registeredComponents) { - context._registeredComponents.add(moduleIdentifier); - } - }; // used by ssr in case component is cached and beforeCreate - // never gets called - - - options._ssrRegister = hook; - } else if (style) { - hook = shadowMode ? function () { - style.call(this, createInjectorShadow(this.$root.$options.shadowRoot)); - } : function (context) { - style.call(this, createInjector(context)); - }; - } - - if (hook) { - if (options.functional) { - // register for functional component in vue file - var originalRender = options.render; - - options.render = function renderWithStyleInjection(h, context) { - hook.call(context); - return originalRender(h, context); - }; - } else { - // inject component registration as beforeCreate hook - var existing = options.beforeCreate; - options.beforeCreate = existing ? [].concat(existing, hook) : [hook]; - } - } - - return script; + function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier /* server only */, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) { + if (typeof shadowMode !== 'boolean') { + createInjectorSSR = createInjector; + createInjector = shadowMode; + shadowMode = false; + } + // Vue.extend constructor export interop. + const options = typeof script === 'function' ? script.options : script; + // render functions + if (template && template.render) { + options.render = template.render; + options.staticRenderFns = template.staticRenderFns; + options._compiled = true; + // functional template + if (isFunctionalTemplate) { + options.functional = true; + } + } + // scopedId + if (scopeId) { + options._scopeId = scopeId; + } + let hook; + if (moduleIdentifier) { + // server build + hook = function (context) { + // 2.3 injection + context = + context || // cached call + (this.$vnode && this.$vnode.ssrContext) || // stateful + (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext); // functional + // 2.2 with runInNewContext: true + if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { + context = __VUE_SSR_CONTEXT__; + } + // inject component styles + if (style) { + style.call(this, createInjectorSSR(context)); + } + // register component module identifier for async chunk inference + if (context && context._registeredComponents) { + context._registeredComponents.add(moduleIdentifier); + } + }; + // used by ssr in case component is cached and beforeCreate + // never gets called + options._ssrRegister = hook; + } + else if (style) { + hook = shadowMode + ? function (context) { + style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot)); + } + : function (context) { + style.call(this, createInjector(context)); + }; + } + if (hook) { + if (options.functional) { + // register for functional component in vue file + const originalRender = options.render; + options.render = function renderWithStyleInjection(h, context) { + hook.call(context); + return originalRender(h, context); + }; + } + else { + // inject component registration as beforeCreate hook + const existing = options.beforeCreate; + options.beforeCreate = existing ? [].concat(existing, hook) : [hook]; + } + } + return script; + } + + const isOldIE = typeof navigator !== 'undefined' && + /msie [6-9]\\b/.test(navigator.userAgent.toLowerCase()); + function createInjector(context) { + return (id, style) => addStyle(id, style); + } + let HEAD; + const styles = {}; + function addStyle(id, css) { + const group = isOldIE ? css.media || 'default' : id; + const style = styles[group] || (styles[group] = { ids: new Set(), styles: [] }); + if (!style.ids.has(id)) { + style.ids.add(id); + let code = css.source; + if (css.map) { + // https://developer.chrome.com/devtools/docs/javascript-debugging + // this makes source maps inside style tags work properly in Chrome + code += '\n/*# sourceURL=' + css.map.sources[0] + ' */'; + // http://stackoverflow.com/a/26603875 + code += + '\n/*# sourceMappingURL=data:application/json;base64,' + + btoa(unescape(encodeURIComponent(JSON.stringify(css.map)))) + + ' */'; + } + if (!style.element) { + style.element = document.createElement('style'); + style.element.type = 'text/css'; + if (css.media) + style.element.setAttribute('media', css.media); + if (HEAD === undefined) { + HEAD = document.head || document.getElementsByTagName('head')[0]; + } + HEAD.appendChild(style.element); + } + if ('styleSheet' in style.element) { + style.styles.push(code); + style.element.styleSheet.cssText = style.styles + .filter(Boolean) + .join('\n'); + } + else { + const index = style.ids.size - 1; + const textNode = document.createTextNode(code); + const nodes = style.element.childNodes; + if (nodes[index]) + style.element.removeChild(nodes[index]); + if (nodes.length) + style.element.insertBefore(textNode, nodes[index]); + else + style.element.appendChild(textNode); + } + } } - var normalizeComponent_1 = normalizeComponent; - - var isOldIE = typeof navigator !== 'undefined' && /msie [6-9]\\b/.test(navigator.userAgent.toLowerCase()); - function createInjector(context) { - return function (id, style) { - return addStyle(id, style); - }; - } - var HEAD; - var styles = {}; - - function addStyle(id, css) { - var group = isOldIE ? css.media || 'default' : id; - var style = styles[group] || (styles[group] = { - ids: new Set(), - styles: [] - }); - - if (!style.ids.has(id)) { - style.ids.add(id); - var code = css.source; - - if (css.map) { - // https://developer.chrome.com/devtools/docs/javascript-debugging - // this makes source maps inside style tags work properly in Chrome - code += '\n/*# sourceURL=' + css.map.sources[0] + ' */'; // http://stackoverflow.com/a/26603875 - - code += '\n/*# sourceMappingURL=data:application/json;base64,' + btoa(unescape(encodeURIComponent(JSON.stringify(css.map)))) + ' */'; - } - - if (!style.element) { - style.element = document.createElement('style'); - style.element.type = 'text/css'; - if (css.media) style.element.setAttribute('media', css.media); - - if (HEAD === undefined) { - HEAD = document.head || document.getElementsByTagName('head')[0]; - } - - HEAD.appendChild(style.element); - } - - if ('styleSheet' in style.element) { - style.styles.push(code); - style.element.styleSheet.cssText = style.styles.filter(Boolean).join('\n'); - } else { - var index = style.ids.size - 1; - var textNode = document.createTextNode(code); - var nodes = style.element.childNodes; - if (nodes[index]) style.element.removeChild(nodes[index]); - if (nodes.length) style.element.insertBefore(textNode, nodes[index]);else style.element.appendChild(textNode); - } - } - } - - var browser = createInjector; - /* script */ const __vue_script__ = script; @@ -346,7 +349,7 @@ /* style */ const __vue_inject_styles__ = function (inject) { if (!inject) return - inject("data-v-39d8efee_0", { source: "#dv-full-screen-container {\n position: fixed;\n top: 0px;\n left: 0px;\n overflow: hidden;\n transform-origin: left top;\n z-index: 999;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,eAAe;EACf,QAAQ;EACR,SAAS;EACT,gBAAgB;EAChB,0BAA0B;EAC1B,YAAY;AACd","file":"main.vue","sourcesContent":["#dv-full-screen-container {\n position: fixed;\n top: 0px;\n left: 0px;\n overflow: hidden;\n transform-origin: left top;\n z-index: 999;\n}\n"]}, media: undefined }); + inject("data-v-2da16e2c_0", { source: "#dv-full-screen-container {\n position: fixed;\n top: 0px;\n left: 0px;\n overflow: hidden;\n transform-origin: left top;\n z-index: 999;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,eAAe;EACf,QAAQ;EACR,SAAS;EACT,gBAAgB;EAChB,0BAA0B;EAC1B,YAAY;AACd","file":"main.vue","sourcesContent":["#dv-full-screen-container {\n position: fixed;\n top: 0px;\n left: 0px;\n overflow: hidden;\n transform-origin: left top;\n z-index: 999;\n}\n"]}, media: undefined }); }; /* scoped */ @@ -357,21 +360,25 @@ const __vue_is_functional_template__ = false; /* style inject SSR */ + /* style inject shadow dom */ + - var FullScreenContainer = normalizeComponent_1( + const __vue_component__ = /*#__PURE__*/normalizeComponent( { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ }, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, - browser, + false, + createInjector, + undefined, undefined ); function fullScreenContainer (Vue) { - Vue.component(FullScreenContainer.name, FullScreenContainer); + Vue.component(__vue_component__.name, __vue_component__); } // @@ -531,7 +538,7 @@ /* style */ const __vue_inject_styles__$1 = function (inject) { if (!inject) return - inject("data-v-b0e29178_0", { source: ".dv-loading {\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n.dv-loading .loading-tip {\n font-size: 15px;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,WAAW;EACX,YAAY;EACZ,aAAa;EACb,sBAAsB;EACtB,uBAAuB;EACvB,mBAAmB;AACrB;AACA;EACE,eAAe;AACjB","file":"main.vue","sourcesContent":[".dv-loading {\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n.dv-loading .loading-tip {\n font-size: 15px;\n}\n"]}, media: undefined }); + inject("data-v-c8b3d976_0", { source: ".dv-loading {\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n.dv-loading .loading-tip {\n font-size: 15px;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,WAAW;EACX,YAAY;EACZ,aAAa;EACb,sBAAsB;EACtB,uBAAuB;EACvB,mBAAmB;AACrB;AACA;EACE,eAAe;AACjB","file":"main.vue","sourcesContent":[".dv-loading {\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n.dv-loading .loading-tip {\n font-size: 15px;\n}\n"]}, media: undefined }); }; /* scoped */ @@ -542,4586 +549,4689 @@ const __vue_is_functional_template__$1 = false; /* style inject SSR */ + /* style inject shadow dom */ + - var Loading = normalizeComponent_1( + const __vue_component__$1 = /*#__PURE__*/normalizeComponent( { render: __vue_render__$1, staticRenderFns: __vue_staticRenderFns__$1 }, __vue_inject_styles__$1, __vue_script__$1, __vue_scope_id__$1, __vue_is_functional_template__$1, __vue_module_identifier__$1, - browser, + false, + createInjector, + undefined, undefined ); function loading (Vue) { - Vue.component(Loading.name, Loading); + Vue.component(__vue_component__$1.name, __vue_component__$1); } - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - var script$2 = { - name: 'DvBorderBox1', - - data() { - return { - border: ['left-top', 'right-top', 'left-bottom', 'right-bottom'] - }; - } + function unwrapExports (x) { + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; + } - }; + function createCommonjsModule(fn, module) { + return module = { exports: {} }, fn(module, module.exports), module.exports; + } - /* script */ - const __vue_script__$2 = script$2; + var interopRequireDefault = createCommonjsModule(function (module) { + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + "default": obj + }; + } - /* template */ - var __vue_render__$2 = function() { - var _vm = this; - var _h = _vm.$createElement; - var _c = _vm._self._c || _h; - return _c( - "div", - { staticClass: "dv-border-box-1" }, - [ - _vm._l(_vm.border, function(item) { - return _c( - "svg", - { - key: item, - class: item + " border", - attrs: { width: "150px", height: "150px" } - }, - [ - _c( - "polygon", - { - attrs: { - fill: "#4fd2dd", - points: - "6,66 6,18 12,12 18,12 24,6 27,6 30,9 36,9 39,6 84,6 81,9 75,9 73.2,7 40.8,7 37.8,10.2 24,10.2 12,21 12,24 9,27 9,51 7.8,54 7.8,63" - } - }, - [ - _c("animate", { - attrs: { - attributeName: "fill", - values: "#4fd2dd;#235fa7;#4fd2dd", - dur: "0.5s", - begin: "0s", - repeatCount: "indefinite" - } - }) - ] - ), - _vm._v(" "), - _c( - "polygon", - { - attrs: { - fill: "#235fa7", - points: - "27.599999999999998,4.8 38.4,4.8 35.4,7.8 30.599999999999998,7.8" - } - }, - [ - _c("animate", { - attrs: { - attributeName: "fill", - values: "#235fa7;#4fd2dd;#235fa7", - dur: "0.5s", - begin: "0s", - repeatCount: "indefinite" - } - }) - ] - ), - _vm._v(" "), - _c( - "polygon", - { - attrs: { - fill: "#4fd2dd", - points: - "9,54 9,63 7.199999999999999,66 7.199999999999999,75 7.8,78 7.8,110 8.4,110 8.4,66 9.6,66 9.6,54" - } - }, - [ - _c("animate", { - attrs: { - attributeName: "fill", - values: "#4fd2dd;#235fa7;transparent", - dur: "1s", - begin: "0s", - repeatCount: "indefinite" - } - }) - ] - ) - ] - ) - }), - _vm._v(" "), - _c("div", { staticClass: "border-box-content" }, [_vm._t("default")], 2) - ], - 2 - ) - }; - var __vue_staticRenderFns__$2 = []; - __vue_render__$2._withStripped = true; + module.exports = _interopRequireDefault; + }); - /* style */ - const __vue_inject_styles__$2 = function (inject) { - if (!inject) return - inject("data-v-53e01884_0", { source: ".dv-border-box-1 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-1 .border {\n position: absolute;\n display: block;\n}\n.dv-border-box-1 .right-top {\n right: 0px;\n transform: rotateY(180deg);\n}\n.dv-border-box-1 .left-bottom {\n bottom: 0px;\n transform: rotateX(180deg);\n}\n.dv-border-box-1 .right-bottom {\n right: 0px;\n bottom: 0px;\n transform: rotateX(180deg) rotateY(180deg);\n}\n.dv-border-box-1 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd;AACA;EACE,kBAAkB;EAClB,cAAc;AAChB;AACA;EACE,UAAU;EACV,0BAA0B;AAC5B;AACA;EACE,WAAW;EACX,0BAA0B;AAC5B;AACA;EACE,UAAU;EACV,WAAW;EACX,0CAA0C;AAC5C;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd","file":"main.vue","sourcesContent":[".dv-border-box-1 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-1 .border {\n position: absolute;\n display: block;\n}\n.dv-border-box-1 .right-top {\n right: 0px;\n transform: rotateY(180deg);\n}\n.dv-border-box-1 .left-bottom {\n bottom: 0px;\n transform: rotateX(180deg);\n}\n.dv-border-box-1 .right-bottom {\n right: 0px;\n bottom: 0px;\n transform: rotateX(180deg) rotateY(180deg);\n}\n.dv-border-box-1 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n"]}, media: undefined }); + unwrapExports(interopRequireDefault); - }; - /* scoped */ - const __vue_scope_id__$2 = undefined; - /* module identifier */ - const __vue_module_identifier__$2 = undefined; - /* functional template */ - const __vue_is_functional_template__$2 = false; - /* style inject SSR */ - + function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; - - var BorderBox1 = normalizeComponent_1( - { render: __vue_render__$2, staticRenderFns: __vue_staticRenderFns__$2 }, - __vue_inject_styles__$2, - __vue_script__$2, - __vue_scope_id__$2, - __vue_is_functional_template__$2, - __vue_module_identifier__$2, - browser, - undefined - ); + for (var i = 0, arr2 = new Array(len); i < len; i++) { + arr2[i] = arr[i]; + } - function borderBox1 (Vue) { - Vue.component(BorderBox1.name, BorderBox1); + return arr2; } - // - var script$3 = { - name: 'DvBorderBox2', - mixins: [autoResize], + var arrayLikeToArray = _arrayLikeToArray; - data() { - return { - ref: 'border-box-2' - }; - } + function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) return arrayLikeToArray(arr); + } - }; + var arrayWithoutHoles = _arrayWithoutHoles; - /* script */ - const __vue_script__$3 = script$3; + function _iterableToArray(iter) { + if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); + } - /* template */ - var __vue_render__$3 = function() { - var _vm = this; - var _h = _vm.$createElement; - var _c = _vm._self._c || _h; - return _c("div", { ref: _vm.ref, staticClass: "dv-border-box-2" }, [ - _c( - "svg", - { - staticClass: "dv-border-svg-container", - attrs: { width: _vm.width, height: _vm.height } - }, - [ - _c("polyline", { - staticClass: "dv-bb2-line1", - attrs: { - points: - "2, 2 " + - (_vm.width - 2) + - " ,2 " + - (_vm.width - 2) + - ", " + - (_vm.height - 2) + - " 2, " + - (_vm.height - 2) + - " 2, 2" - } - }), - _vm._v(" "), - _c("polyline", { - staticClass: "dv-bb2-line2", - attrs: { - points: - "6, 6 " + - (_vm.width - 6) + - ", 6 " + - (_vm.width - 6) + - ", " + - (_vm.height - 6) + - " 6, " + - (_vm.height - 6) + - " 6, 6" - } - }), - _vm._v(" "), - _c("circle", { attrs: { cx: "11", cy: "11", r: "1" } }), - _vm._v(" "), - _c("circle", { attrs: { cx: _vm.width - 11, cy: "11", r: "1" } }), - _vm._v(" "), - _c("circle", { - attrs: { cx: _vm.width - 11, cy: _vm.height - 11, r: "1" } - }), - _vm._v(" "), - _c("circle", { attrs: { cx: "11", cy: _vm.height - 11, r: "1" } }) - ] - ), - _vm._v(" "), - _c("div", { staticClass: "border-box-content" }, [_vm._t("default")], 2) - ]) - }; - var __vue_staticRenderFns__$3 = []; - __vue_render__$3._withStripped = true; + var iterableToArray = _iterableToArray; - /* style */ - const __vue_inject_styles__$3 = function (inject) { - if (!inject) return - inject("data-v-2c14f4ac_0", { source: ".dv-border-box-2 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-2 .dv-border-svg-container {\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0px;\n left: 0px;\n}\n.dv-border-box-2 .dv-border-svg-container polyline {\n fill: none;\n stroke-width: 1;\n}\n.dv-border-box-2 .dv-border-svg-container circle {\n fill: #fff;\n}\n.dv-border-box-2 .dv-bb2-line1 {\n stroke: #fff;\n}\n.dv-border-box-2 .dv-bb2-line2 {\n stroke: rgba(255, 255, 255, 0.6);\n}\n.dv-border-box-2 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;EACZ,QAAQ;EACR,SAAS;AACX;AACA;EACE,UAAU;EACV,eAAe;AACjB;AACA;EACE,UAAU;AACZ;AACA;EACE,YAAY;AACd;AACA;EACE,gCAAgC;AAClC;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd","file":"main.vue","sourcesContent":[".dv-border-box-2 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-2 .dv-border-svg-container {\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0px;\n left: 0px;\n}\n.dv-border-box-2 .dv-border-svg-container polyline {\n fill: none;\n stroke-width: 1;\n}\n.dv-border-box-2 .dv-border-svg-container circle {\n fill: #fff;\n}\n.dv-border-box-2 .dv-bb2-line1 {\n stroke: #fff;\n}\n.dv-border-box-2 .dv-bb2-line2 {\n stroke: rgba(255, 255, 255, 0.6);\n}\n.dv-border-box-2 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n"]}, media: undefined }); + function _unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen); + } - }; - /* scoped */ - const __vue_scope_id__$3 = undefined; - /* module identifier */ - const __vue_module_identifier__$3 = undefined; - /* functional template */ - const __vue_is_functional_template__$3 = false; - /* style inject SSR */ - + var unsupportedIterableToArray = _unsupportedIterableToArray; - - var BorderBox2 = normalizeComponent_1( - { render: __vue_render__$3, staticRenderFns: __vue_staticRenderFns__$3 }, - __vue_inject_styles__$3, - __vue_script__$3, - __vue_scope_id__$3, - __vue_is_functional_template__$3, - __vue_module_identifier__$3, - browser, - undefined - ); + function _nonIterableSpread() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } - function borderBox2 (Vue) { - Vue.component(BorderBox2.name, BorderBox2); + var nonIterableSpread = _nonIterableSpread; + + function _toConsumableArray(arr) { + return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread(); } - // - var script$4 = { - name: 'DvBorderBox3', - mixins: [autoResize], + var toConsumableArray = _toConsumableArray; - data() { - return { - ref: 'border-box-3' + var _typeof_1 = createCommonjsModule(function (module) { + function _typeof(obj) { + "@babel/helpers - typeof"; + + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + module.exports = _typeof = function _typeof(obj) { + return typeof obj; + }; + } else { + module.exports = _typeof = function _typeof(obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } - }; + return _typeof(obj); + } - /* script */ - const __vue_script__$4 = script$4; + module.exports = _typeof; + }); - /* template */ - var __vue_render__$4 = function() { - var _vm = this; - var _h = _vm.$createElement; - var _c = _vm._self._c || _h; - return _c("div", { ref: _vm.ref, staticClass: "dv-border-box-3" }, [ - _c( - "svg", - { - staticClass: "dv-border-svg-container", - attrs: { width: _vm.width, height: _vm.height } - }, - [ - _c("polyline", { - staticClass: "dv-bb3-line1", - attrs: { - points: - "4, 4 " + - (_vm.width - 22) + - " ,4 " + - (_vm.width - 22) + - ", " + - (_vm.height - 22) + - " 4, " + - (_vm.height - 22) + - " 4, 4" - } - }), - _vm._v(" "), - _c("polyline", { - staticClass: "dv-bb3-line2", - attrs: { - points: - "10, 10 " + - (_vm.width - 16) + - ", 10 " + - (_vm.width - 16) + - ", " + - (_vm.height - 16) + - " 10, " + - (_vm.height - 16) + - " 10, 10" - } - }), - _vm._v(" "), - _c("polyline", { - staticClass: "dv-bb3-line2", - attrs: { - points: - "16, 16 " + - (_vm.width - 10) + - ", 16 " + - (_vm.width - 10) + - ", " + - (_vm.height - 10) + - " 16, " + - (_vm.height - 10) + - " 16, 16" - } - }), - _vm._v(" "), - _c("polyline", { - staticClass: "dv-bb3-line2", - attrs: { - points: - "22, 22 " + - (_vm.width - 4) + - ", 22 " + - (_vm.width - 4) + - ", " + - (_vm.height - 4) + - " 22, " + - (_vm.height - 4) + - " 22, 22" - } - }) - ] - ), - _vm._v(" "), - _c("div", { staticClass: "border-box-content" }, [_vm._t("default")], 2) - ]) - }; - var __vue_staticRenderFns__$4 = []; - __vue_render__$4._withStripped = true; + function _arrayWithHoles(arr) { + if (Array.isArray(arr)) return arr; + } - /* style */ - const __vue_inject_styles__$4 = function (inject) { - if (!inject) return - inject("data-v-f2ff245a_0", { source: ".dv-border-box-3 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-3 .dv-border-svg-container {\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0px;\n left: 0px;\n}\n.dv-border-box-3 .dv-border-svg-container polyline {\n fill: none;\n stroke: #2862b7;\n}\n.dv-border-box-3 .dv-bb3-line1 {\n stroke-width: 3;\n}\n.dv-border-box-3 .dv-bb3-line2 {\n stroke-width: 1;\n}\n.dv-border-box-3 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;EACZ,QAAQ;EACR,SAAS;AACX;AACA;EACE,UAAU;EACV,eAAe;AACjB;AACA;EACE,eAAe;AACjB;AACA;EACE,eAAe;AACjB;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd","file":"main.vue","sourcesContent":[".dv-border-box-3 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-3 .dv-border-svg-container {\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0px;\n left: 0px;\n}\n.dv-border-box-3 .dv-border-svg-container polyline {\n fill: none;\n stroke: #2862b7;\n}\n.dv-border-box-3 .dv-bb3-line1 {\n stroke-width: 3;\n}\n.dv-border-box-3 .dv-bb3-line2 {\n stroke-width: 1;\n}\n.dv-border-box-3 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n"]}, media: undefined }); + var arrayWithHoles = _arrayWithHoles; - }; - /* scoped */ - const __vue_scope_id__$4 = undefined; - /* module identifier */ - const __vue_module_identifier__$4 = undefined; - /* functional template */ - const __vue_is_functional_template__$4 = false; - /* style inject SSR */ - + function _iterableToArrayLimit(arr, i) { + if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; + var _arr = []; + var _n = true; + var _d = false; + var _e = undefined; - - var BorderBox3 = normalizeComponent_1( - { render: __vue_render__$4, staticRenderFns: __vue_staticRenderFns__$4 }, - __vue_inject_styles__$4, - __vue_script__$4, - __vue_scope_id__$4, - __vue_is_functional_template__$4, - __vue_module_identifier__$4, - browser, - undefined - ); + try { + for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { + _arr.push(_s.value); - function borderBox3 (Vue) { - Vue.component(BorderBox3.name, BorderBox3); + if (i && _arr.length === i) break; + } + } catch (err) { + _d = true; + _e = err; + } finally { + try { + if (!_n && _i["return"] != null) _i["return"](); + } finally { + if (_d) throw _e; + } + } + + return _arr; } - // - var script$5 = { - name: 'DvBorderBox4', - mixins: [autoResize], + var iterableToArrayLimit = _iterableToArrayLimit; - data() { - return { - ref: 'border-box-4' - }; - }, + function _nonIterableRest() { + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } - props: { - reverse: { - type: Boolean, - default: false + var nonIterableRest = _nonIterableRest; + + function _slicedToArray(arr, i) { + return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest(); + } + + var slicedToArray = _slicedToArray; + + var util = createCommonjsModule(function (module, exports) { + + + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.deepClone = deepClone; + exports.eliminateBlur = eliminateBlur; + exports.checkPointIsInCircle = checkPointIsInCircle; + exports.getTwoPointDistance = getTwoPointDistance; + exports.checkPointIsInPolygon = checkPointIsInPolygon; + exports.checkPointIsInSector = checkPointIsInSector; + exports.checkPointIsNearPolyline = checkPointIsNearPolyline; + exports.checkPointIsInRect = checkPointIsInRect; + exports.getRotatePointPos = getRotatePointPos; + exports.getScalePointPos = getScalePointPos; + exports.getTranslatePointPos = getTranslatePointPos; + exports.getDistanceBetweenPointAndLine = getDistanceBetweenPointAndLine; + exports.getCircleRadianPoint = getCircleRadianPoint; + exports.getRegularPolygonPoints = getRegularPolygonPoints; + exports["default"] = void 0; + + var _toConsumableArray2 = interopRequireDefault(toConsumableArray); + + var _slicedToArray2 = interopRequireDefault(slicedToArray); + + var _typeof2 = interopRequireDefault(_typeof_1); + + var abs = Math.abs, + sqrt = Math.sqrt, + sin = Math.sin, + cos = Math.cos, + max = Math.max, + min = Math.min, + PI = Math.PI; + /** + * @description Clone an object or array + * @param {Object|Array} object Cloned object + * @param {Boolean} recursion Whether to use recursive cloning + * @return {Object|Array} Clone object + */ + + function deepClone(object) { + var recursion = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + if (!object) return object; + var parse = JSON.parse, + stringify = JSON.stringify; + if (!recursion) return parse(stringify(object)); + var clonedObj = object instanceof Array ? [] : {}; + + if (object && (0, _typeof2["default"])(object) === 'object') { + for (var key in object) { + if (object.hasOwnProperty(key)) { + if (object[key] && (0, _typeof2["default"])(object[key]) === 'object') { + clonedObj[key] = deepClone(object[key], true); + } else { + clonedObj[key] = object[key]; + } + } } } - }; - /* script */ - const __vue_script__$5 = script$5; + return clonedObj; + } + /** + * @description Eliminate line blur due to 1px line width + * @param {Array} points Line points + * @return {Array} Line points after processed + */ - /* template */ - var __vue_render__$5 = function() { - var _vm = this; - var _h = _vm.$createElement; - var _c = _vm._self._c || _h; - return _c("div", { ref: _vm.ref, staticClass: "dv-border-box-4" }, [ - _c( - "svg", - { - class: "dv-border-svg-container " + (_vm.reverse && "dv-reverse"), - attrs: { width: _vm.width, height: _vm.height } - }, - [ - _c("polyline", { - staticClass: "dv-bb4-line-1", - attrs: { - points: - "145, " + - (_vm.height - 5) + - " 40, " + - (_vm.height - 5) + - " 10, " + - (_vm.height - 35) + - "\n 10, 40 40, 5 150, 5 170, 20 " + - (_vm.width - 15) + - ", 20" - } - }), - _vm._v(" "), - _c("polyline", { - staticClass: "dv-bb4-line-2", - attrs: { - points: - "245, " + - (_vm.height - 1) + - " 36, " + - (_vm.height - 1) + - " 14, " + - (_vm.height - 23) + - "\n 14, " + - (_vm.height - 100) - } - }), - _vm._v(" "), - _c("polyline", { - staticClass: "dv-bb4-line-3", - attrs: { - points: "7, " + (_vm.height - 40) + " 7, " + (_vm.height - 75) - } - }), - _vm._v(" "), - _c("polyline", { - staticClass: "dv-bb4-line-4", - attrs: { points: "28, 24 13, 41 13, 64" } - }), - _vm._v(" "), - _c("polyline", { - staticClass: "dv-bb4-line-5", - attrs: { points: "5, 45 5, 140" } - }), - _vm._v(" "), - _c("polyline", { - staticClass: "dv-bb4-line-6", - attrs: { points: "14, 75 14, 180" } - }), - _vm._v(" "), - _c("polyline", { - staticClass: "dv-bb4-line-7", - attrs: { points: "55, 11 147, 11 167, 26 250, 26" } - }), - _vm._v(" "), - _c("polyline", { - staticClass: "dv-bb4-line-8", - attrs: { points: "158, 5 173, 16" } - }), - _vm._v(" "), - _c("polyline", { - staticClass: "dv-bb4-line-9", - attrs: { points: "200, 17 " + (_vm.width - 10) + ", 17" } - }), - _vm._v(" "), - _c("polyline", { - staticClass: "dv-bb4-line-10", - attrs: { points: "385, 17 " + (_vm.width - 10) + ", 17" } - }) - ] - ), - _vm._v(" "), - _c("div", { staticClass: "border-box-content" }, [_vm._t("default")], 2) - ]) - }; - var __vue_staticRenderFns__$5 = []; - __vue_render__$5._withStripped = true; - /* style */ - const __vue_inject_styles__$5 = function (inject) { - if (!inject) return - inject("data-v-3e5643ee_0", { source: ".dv-border-box-4 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-4 .dv-reverse {\n transform: rotate(180deg);\n}\n.dv-border-box-4 .dv-border-svg-container {\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0px;\n left: 0px;\n}\n.dv-border-box-4 .dv-border-svg-container polyline {\n fill: none;\n}\n.dv-border-box-4 .sred {\n stroke: red;\n}\n.dv-border-box-4 .sblue {\n stroke: rgba(0, 0, 255, 0.8);\n}\n.dv-border-box-4 .sw1 {\n stroke-width: 1;\n}\n.dv-border-box-4 .sw3 {\n stroke-width: 3px;\n stroke-linecap: round;\n}\n.dv-border-box-4 .dv-bb4-line-1 {\n stroke: red;\n stroke-width: 1;\n}\n.dv-border-box-4 .dv-bb4-line-2 {\n stroke: rgba(0, 0, 255, 0.8);\n stroke-width: 1;\n}\n.dv-border-box-4 .dv-bb4-line-3 {\n stroke: red;\n stroke-width: 3px;\n stroke-linecap: round;\n}\n.dv-border-box-4 .dv-bb4-line-4 {\n stroke: red;\n stroke-width: 3px;\n stroke-linecap: round;\n}\n.dv-border-box-4 .dv-bb4-line-5 {\n stroke: red;\n stroke-width: 1;\n}\n.dv-border-box-4 .dv-bb4-line-6 {\n stroke: rgba(0, 0, 255, 0.8);\n stroke-width: 1;\n}\n.dv-border-box-4 .dv-bb4-line-7 {\n stroke: rgba(0, 0, 255, 0.8);\n stroke-width: 1;\n}\n.dv-border-box-4 .dv-bb4-line-8 {\n stroke: rgba(0, 0, 255, 0.8);\n stroke-width: 3px;\n stroke-linecap: round;\n}\n.dv-border-box-4 .dv-bb4-line-9 {\n stroke: red;\n stroke-width: 3px;\n stroke-linecap: round;\n stroke-dasharray: 100 250;\n}\n.dv-border-box-4 .dv-bb4-line-10 {\n stroke: rgba(0, 0, 255, 0.8);\n stroke-width: 1;\n stroke-dasharray: 80 270;\n}\n.dv-border-box-4 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n", map: {"version":3,"sources":["main.vue","E:\\Project\\A_MIT_LICENSE\\DataV\\src\\components\\borderBox4\\src\\main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd;AACA;EACE,yBAAyB;AAC3B;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;EACZ,QAAQ;EACR,SAAS;AACX;AACA;EACE,UAAU;AACZ;AACA;EACE,WAAW;AACb;AACA;EACE,4BAA4B;AAC9B;AACA;EACE,eAAe;AACjB;AACA;EACE,iBAAiB;EACjB,qBAAqB;AACvB;AACA;EACE,WAAW;EACX,eAAe;AACjB;AACA;EACE,4BAA4B;EAC5B,eAAe;AACjB;AACA;EACE,WAAW;EACX,iBAAiB;EACjB,qBAAqB;AACvB;ACCA;EACA,WAAA;EACA,iBAAA;EACA,qBAAA;ADCA;ACCA;EACA,WAAA;EACA,eAAA;ADCA;ACCA;EACA,4BAAA;EACA,eAAA;AACA;AACA;EACA,4BAAA;EDCE,eAAe;ACCjB;AACA;EACA,4BAAA;EACA,iBAAA;EDCE,qBAAqB;ACCvB;AACA;EACA,WAAA;EDCE,iBAAiB;ECCnB,qBAAA;EACA,yBAAA;AACA;ADCA;ECCA,4BAAA;EACA,eAAA;EACA,wBAAA;ADCA;ACCA;EACA,kBAAA;EACA,WAAA;EACA,YAAA;ADCA","file":"main.vue","sourcesContent":[".dv-border-box-4 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-4 .dv-reverse {\n transform: rotate(180deg);\n}\n.dv-border-box-4 .dv-border-svg-container {\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0px;\n left: 0px;\n}\n.dv-border-box-4 .dv-border-svg-container polyline {\n fill: none;\n}\n.dv-border-box-4 .sred {\n stroke: red;\n}\n.dv-border-box-4 .sblue {\n stroke: rgba(0, 0, 255, 0.8);\n}\n.dv-border-box-4 .sw1 {\n stroke-width: 1;\n}\n.dv-border-box-4 .sw3 {\n stroke-width: 3px;\n stroke-linecap: round;\n}\n.dv-border-box-4 .dv-bb4-line-1 {\n stroke: red;\n stroke-width: 1;\n}\n.dv-border-box-4 .dv-bb4-line-2 {\n stroke: rgba(0, 0, 255, 0.8);\n stroke-width: 1;\n}\n.dv-border-box-4 .dv-bb4-line-3 {\n stroke: red;\n stroke-width: 3px;\n stroke-linecap: round;\n}\n.dv-border-box-4 .dv-bb4-line-4 {\n stroke: red;\n stroke-width: 3px;\n stroke-linecap: round;\n}\n.dv-border-box-4 .dv-bb4-line-5 {\n stroke: red;\n stroke-width: 1;\n}\n.dv-border-box-4 .dv-bb4-line-6 {\n stroke: rgba(0, 0, 255, 0.8);\n stroke-width: 1;\n}\n.dv-border-box-4 .dv-bb4-line-7 {\n stroke: rgba(0, 0, 255, 0.8);\n stroke-width: 1;\n}\n.dv-border-box-4 .dv-bb4-line-8 {\n stroke: rgba(0, 0, 255, 0.8);\n stroke-width: 3px;\n stroke-linecap: round;\n}\n.dv-border-box-4 .dv-bb4-line-9 {\n stroke: red;\n stroke-width: 3px;\n stroke-linecap: round;\n stroke-dasharray: 100 250;\n}\n.dv-border-box-4 .dv-bb4-line-10 {\n stroke: rgba(0, 0, 255, 0.8);\n stroke-width: 1;\n stroke-dasharray: 80 270;\n}\n.dv-border-box-4 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n","\r\n\r\n\r\n\r\n\r\n"]}, media: undefined }); + function eliminateBlur(points) { + return points.map(function (_ref) { + var _ref2 = (0, _slicedToArray2["default"])(_ref, 2), + x = _ref2[0], + y = _ref2[1]; - }; - /* scoped */ - const __vue_scope_id__$5 = undefined; - /* module identifier */ - const __vue_module_identifier__$5 = undefined; - /* functional template */ - const __vue_is_functional_template__$5 = false; - /* style inject SSR */ - + return [parseInt(x) + 0.5, parseInt(y) + 0.5]; + }); + } + /** + * @description Check if the point is inside the circle + * @param {Array} point Postion of point + * @param {Number} rx Circle x coordinate + * @param {Number} ry Circle y coordinate + * @param {Number} r Circle radius + * @return {Boolean} Result of check + */ - - var BorderBox4 = normalizeComponent_1( - { render: __vue_render__$5, staticRenderFns: __vue_staticRenderFns__$5 }, - __vue_inject_styles__$5, - __vue_script__$5, - __vue_scope_id__$5, - __vue_is_functional_template__$5, - __vue_module_identifier__$5, - browser, - undefined - ); - function borderBox4 (Vue) { - Vue.component(BorderBox4.name, BorderBox4); + function checkPointIsInCircle(point, rx, ry, r) { + return getTwoPointDistance(point, [rx, ry]) <= r; } + /** + * @description Get the distance between two points + * @param {Array} point1 point1 + * @param {Array} point2 point2 + * @return {Number} Distance between two points + */ - // - var script$6 = { - name: 'DvBorderBox5', - mixins: [autoResize], - data() { - return { - ref: 'border-box-5' - }; - }, + function getTwoPointDistance(_ref3, _ref4) { + var _ref5 = (0, _slicedToArray2["default"])(_ref3, 2), + xa = _ref5[0], + ya = _ref5[1]; - props: { - reverse: { - type: Boolean, - default: false + var _ref6 = (0, _slicedToArray2["default"])(_ref4, 2), + xb = _ref6[0], + yb = _ref6[1]; + + var minusX = abs(xa - xb); + var minusY = abs(ya - yb); + return sqrt(minusX * minusX + minusY * minusY); + } + /** + * @description Check if the point is inside the polygon + * @param {Array} point Postion of point + * @param {Array} points The points that makes up a polyline + * @return {Boolean} Result of check + */ + + + function checkPointIsInPolygon(point, polygon) { + var counter = 0; + + var _point = (0, _slicedToArray2["default"])(point, 2), + x = _point[0], + y = _point[1]; + + var pointNum = polygon.length; + + for (var i = 1, p1 = polygon[0]; i <= pointNum; i++) { + var p2 = polygon[i % pointNum]; + + if (x > min(p1[0], p2[0]) && x <= max(p1[0], p2[0])) { + if (y <= max(p1[1], p2[1])) { + if (p1[0] !== p2[0]) { + var xinters = (x - p1[0]) * (p2[1] - p1[1]) / (p2[0] - p1[0]) + p1[1]; + + if (p1[1] === p2[1] || y <= xinters) { + counter++; + } + } + } } + + p1 = p2; } - }; - /* script */ - const __vue_script__$6 = script$6; + return counter % 2 === 1; + } + /** + * @description Check if the point is inside the sector + * @param {Array} point Postion of point + * @param {Number} rx Sector x coordinate + * @param {Number} ry Sector y coordinate + * @param {Number} r Sector radius + * @param {Number} startAngle Sector start angle + * @param {Number} endAngle Sector end angle + * @param {Boolean} clockWise Whether the sector angle is clockwise + * @return {Boolean} Result of check + */ - /* template */ - var __vue_render__$6 = function() { - var _vm = this; - var _h = _vm.$createElement; - var _c = _vm._self._c || _h; - return _c("div", { ref: _vm.ref, staticClass: "dv-border-box-5" }, [ - _c( - "svg", - { - class: "dv-svg-container " + (_vm.reverse && "dv-reverse"), - attrs: { width: _vm.width, height: _vm.height } - }, - [ - _c("polyline", { - staticClass: "dv-bb5-line-1", - attrs: { - points: - "8, 5 " + - (_vm.width - 5) + - ", 5 " + - (_vm.width - 5) + - ", " + - (_vm.height - 100) + - "\n " + - (_vm.width - 100) + - ", " + - (_vm.height - 5) + - " 8, " + - (_vm.height - 5) + - " 8, 5" - } - }), - _vm._v(" "), - _c("polyline", { - staticClass: "dv-bb5-line-2", - attrs: { - points: - "3, 5 " + - (_vm.width - 20) + - ", 5 " + - (_vm.width - 20) + - ", " + - (_vm.height - 60) + - "\n " + - (_vm.width - 74) + - ", " + - (_vm.height - 5) + - " 3, " + - (_vm.height - 5) + - " 3, 5" - } - }), - _vm._v(" "), - _c("polyline", { - staticClass: "dv-bb5-line-3", - attrs: { points: "50, 13 " + (_vm.width - 35) + ", 13" } - }), - _vm._v(" "), - _c("polyline", { - staticClass: "dv-bb5-line-4", - attrs: { points: "15, 20 " + (_vm.width - 35) + ", 20" } - }), - _vm._v(" "), - _c("polyline", { - staticClass: "dv-bb5-line-5", - attrs: { - points: - "15, " + - (_vm.height - 20) + - " " + - (_vm.width - 110) + - ", " + - (_vm.height - 20) - } - }), - _vm._v(" "), - _c("polyline", { - staticClass: "dv-bb5-line-6", - attrs: { - points: - "15, " + - (_vm.height - 13) + - " " + - (_vm.width - 110) + - ", " + - (_vm.height - 13) - } - }) - ] - ), - _vm._v(" "), - _c("div", { staticClass: "border-box-content" }, [_vm._t("default")], 2) - ]) - }; - var __vue_staticRenderFns__$6 = []; - __vue_render__$6._withStripped = true; - /* style */ - const __vue_inject_styles__$6 = function (inject) { - if (!inject) return - inject("data-v-775fac1b_0", { source: ".dv-border-box-5 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-5 .dv-reverse {\n transform: rotate(180deg);\n}\n.dv-border-box-5 .dv-svg-container {\n position: absolute;\n top: 0px;\n left: 0px;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-5 .dv-svg-container polyline {\n fill: none;\n}\n.dv-border-box-5 .dv-bb5-line-1 {\n stroke-width: 1;\n stroke: rgba(255, 255, 255, 0.35);\n}\n.dv-border-box-5 .dv-bb5-line-2 {\n stroke: rgba(255, 255, 255, 0.2);\n}\n.dv-border-box-5 .dv-bb5-line-3,\n.dv-border-box-5 .dv-bb5-line-6 {\n stroke-width: 5;\n stroke: rgba(255, 255, 255, 0.15);\n}\n.dv-border-box-5 .dv-bb5-line-4,\n.dv-border-box-5 .dv-bb5-line-5 {\n stroke-width: 2;\n stroke: rgba(255, 255, 255, 0.15);\n}\n.dv-border-box-5 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd;AACA;EACE,yBAAyB;AAC3B;AACA;EACE,kBAAkB;EAClB,QAAQ;EACR,SAAS;EACT,WAAW;EACX,YAAY;AACd;AACA;EACE,UAAU;AACZ;AACA;EACE,eAAe;EACf,iCAAiC;AACnC;AACA;EACE,gCAAgC;AAClC;AACA;;EAEE,eAAe;EACf,iCAAiC;AACnC;AACA;;EAEE,eAAe;EACf,iCAAiC;AACnC;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd","file":"main.vue","sourcesContent":[".dv-border-box-5 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-5 .dv-reverse {\n transform: rotate(180deg);\n}\n.dv-border-box-5 .dv-svg-container {\n position: absolute;\n top: 0px;\n left: 0px;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-5 .dv-svg-container polyline {\n fill: none;\n}\n.dv-border-box-5 .dv-bb5-line-1 {\n stroke-width: 1;\n stroke: rgba(255, 255, 255, 0.35);\n}\n.dv-border-box-5 .dv-bb5-line-2 {\n stroke: rgba(255, 255, 255, 0.2);\n}\n.dv-border-box-5 .dv-bb5-line-3,\n.dv-border-box-5 .dv-bb5-line-6 {\n stroke-width: 5;\n stroke: rgba(255, 255, 255, 0.15);\n}\n.dv-border-box-5 .dv-bb5-line-4,\n.dv-border-box-5 .dv-bb5-line-5 {\n stroke-width: 2;\n stroke: rgba(255, 255, 255, 0.15);\n}\n.dv-border-box-5 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n"]}, media: undefined }); + function checkPointIsInSector(point, rx, ry, r, startAngle, endAngle, clockWise) { + if (!point) return false; + if (getTwoPointDistance(point, [rx, ry]) > r) return false; - }; - /* scoped */ - const __vue_scope_id__$6 = undefined; - /* module identifier */ - const __vue_module_identifier__$6 = undefined; - /* functional template */ - const __vue_is_functional_template__$6 = false; - /* style inject SSR */ - + if (!clockWise) { + var _deepClone = deepClone([endAngle, startAngle]); - - var BorderBox5 = normalizeComponent_1( - { render: __vue_render__$6, staticRenderFns: __vue_staticRenderFns__$6 }, - __vue_inject_styles__$6, - __vue_script__$6, - __vue_scope_id__$6, - __vue_is_functional_template__$6, - __vue_module_identifier__$6, - browser, - undefined - ); + var _deepClone2 = (0, _slicedToArray2["default"])(_deepClone, 2); - function borderBox5 (Vue) { - Vue.component(BorderBox5.name, BorderBox5); - } + startAngle = _deepClone2[0]; + endAngle = _deepClone2[1]; + } - // - var script$7 = { - name: 'DvBorderBox6', - mixins: [autoResize], + var reverseBE = startAngle > endAngle; - data() { - return { - ref: 'border-box-6' - }; + if (reverseBE) { + var _ref7 = [endAngle, startAngle]; + startAngle = _ref7[0]; + endAngle = _ref7[1]; } - }; + var minus = endAngle - startAngle; + if (minus >= PI * 2) return true; - /* script */ - const __vue_script__$7 = script$7; + var _point2 = (0, _slicedToArray2["default"])(point, 2), + x = _point2[0], + y = _point2[1]; - /* template */ - var __vue_render__$7 = function() { - var _vm = this; - var _h = _vm.$createElement; - var _c = _vm._self._c || _h; - return _c("div", { ref: _vm.ref, staticClass: "dv-border-box-6" }, [ - _c( - "svg", - { - staticClass: "dv-svg-container", - attrs: { width: _vm.width, height: _vm.height } - }, - [ - _c("circle", { attrs: { cx: "5", cy: "5", r: "2" } }), - _vm._v(" "), - _c("circle", { attrs: { cx: _vm.width - 5, cy: "5", r: "2" } }), - _vm._v(" "), - _c("circle", { - attrs: { cx: _vm.width - 5, cy: _vm.height - 5, r: "2" } - }), - _vm._v(" "), - _c("circle", { attrs: { cx: "5", cy: _vm.height - 5, r: "2" } }), - _vm._v(" "), - _c("polyline", { - attrs: { points: "10, 4 " + (_vm.width - 10) + ", 4" } - }), - _vm._v(" "), - _c("polyline", { - attrs: { - points: - "10, " + - (_vm.height - 4) + - " " + - (_vm.width - 10) + - ", " + - (_vm.height - 4) - } - }), - _vm._v(" "), - _c("polyline", { attrs: { points: "5, 70 5, " + (_vm.height - 70) } }), - _vm._v(" "), - _c("polyline", { - attrs: { - points: - _vm.width - - 5 + - ", 70 " + - (_vm.width - 5) + - ", " + - (_vm.height - 70) - } - }), - _vm._v(" "), - _c("polyline", { attrs: { points: "3, 10, 3, 50" } }), - _vm._v(" "), - _c("polyline", { attrs: { points: "7, 30 7, 80" } }), - _vm._v(" "), - _c("polyline", { - attrs: { points: _vm.width - 3 + ", 10 " + (_vm.width - 3) + ", 50" } - }), - _vm._v(" "), - _c("polyline", { - attrs: { points: _vm.width - 7 + ", 30 " + (_vm.width - 7) + ", 80" } - }), - _vm._v(" "), - _c("polyline", { - attrs: { - points: "3, " + (_vm.height - 10) + " 3, " + (_vm.height - 50) - } - }), - _vm._v(" "), - _c("polyline", { - attrs: { - points: "7, " + (_vm.height - 30) + " 7, " + (_vm.height - 80) - } - }), - _vm._v(" "), - _c("polyline", { - attrs: { - points: - _vm.width - - 3 + - ", " + - (_vm.height - 10) + - " " + - (_vm.width - 3) + - ", " + - (_vm.height - 50) - } - }), - _vm._v(" "), - _c("polyline", { - attrs: { - points: - _vm.width - - 7 + - ", " + - (_vm.height - 30) + - " " + - (_vm.width - 7) + - ", " + - (_vm.height - 80) - } - }) - ] - ), - _vm._v(" "), - _c("div", { staticClass: "border-box-content" }, [_vm._t("default")], 2) - ]) - }; - var __vue_staticRenderFns__$7 = []; - __vue_render__$7._withStripped = true; + var _getCircleRadianPoint = getCircleRadianPoint(rx, ry, r, startAngle), + _getCircleRadianPoint2 = (0, _slicedToArray2["default"])(_getCircleRadianPoint, 2), + bx = _getCircleRadianPoint2[0], + by = _getCircleRadianPoint2[1]; - /* style */ - const __vue_inject_styles__$7 = function (inject) { - if (!inject) return - inject("data-v-a61b75b4_0", { source: ".dv-border-box-6 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-6 .dv-svg-container {\n position: absolute;\n top: 0px;\n left: 0px;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-6 .dv-svg-container circle {\n fill: gray;\n}\n.dv-border-box-6 .dv-svg-container polyline {\n fill: none;\n stroke-width: 1;\n stroke: rgba(255, 255, 255, 0.35);\n}\n.dv-border-box-6 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd;AACA;EACE,kBAAkB;EAClB,QAAQ;EACR,SAAS;EACT,WAAW;EACX,YAAY;AACd;AACA;EACE,UAAU;AACZ;AACA;EACE,UAAU;EACV,eAAe;EACf,iCAAiC;AACnC;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd","file":"main.vue","sourcesContent":[".dv-border-box-6 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-6 .dv-svg-container {\n position: absolute;\n top: 0px;\n left: 0px;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-6 .dv-svg-container circle {\n fill: gray;\n}\n.dv-border-box-6 .dv-svg-container polyline {\n fill: none;\n stroke-width: 1;\n stroke: rgba(255, 255, 255, 0.35);\n}\n.dv-border-box-6 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n"]}, media: undefined }); + var _getCircleRadianPoint3 = getCircleRadianPoint(rx, ry, r, endAngle), + _getCircleRadianPoint4 = (0, _slicedToArray2["default"])(_getCircleRadianPoint3, 2), + ex = _getCircleRadianPoint4[0], + ey = _getCircleRadianPoint4[1]; - }; - /* scoped */ - const __vue_scope_id__$7 = undefined; - /* module identifier */ - const __vue_module_identifier__$7 = undefined; - /* functional template */ - const __vue_is_functional_template__$7 = false; - /* style inject SSR */ - + var vPoint = [x - rx, y - ry]; + var vBArm = [bx - rx, by - ry]; + var vEArm = [ex - rx, ey - ry]; + var reverse = minus > PI; - - var BorderBox6 = normalizeComponent_1( - { render: __vue_render__$7, staticRenderFns: __vue_staticRenderFns__$7 }, - __vue_inject_styles__$7, - __vue_script__$7, - __vue_scope_id__$7, - __vue_is_functional_template__$7, - __vue_module_identifier__$7, - browser, - undefined - ); + if (reverse) { + var _deepClone3 = deepClone([vEArm, vBArm]); - function borderBox6 (Vue) { - Vue.component(BorderBox6.name, BorderBox6); + var _deepClone4 = (0, _slicedToArray2["default"])(_deepClone3, 2); + + vBArm = _deepClone4[0]; + vEArm = _deepClone4[1]; + } + + var inSector = isClockWise(vBArm, vPoint) && !isClockWise(vEArm, vPoint); + if (reverse) inSector = !inSector; + if (reverseBE) inSector = !inSector; + return inSector; } + /** + * @description Determine if the point is in the clockwise direction of the vector + * @param {Array} vArm Vector + * @param {Array} vPoint Point + * @return {Boolean} Result of check + */ - // - var script$8 = { - name: 'DvBorderBox7', - mixins: [autoResize], - data() { - return { - ref: 'border-box-7' - }; - } + function isClockWise(vArm, vPoint) { + var _vArm = (0, _slicedToArray2["default"])(vArm, 2), + ax = _vArm[0], + ay = _vArm[1]; - }; + var _vPoint = (0, _slicedToArray2["default"])(vPoint, 2), + px = _vPoint[0], + py = _vPoint[1]; - /* script */ - const __vue_script__$8 = script$8; + return -ay * px + ax * py > 0; + } + /** + * @description Check if the point is inside the polyline + * @param {Array} point Postion of point + * @param {Array} polyline The points that makes up a polyline + * @param {Number} lineWidth Polyline linewidth + * @return {Boolean} Result of check + */ - /* template */ - var __vue_render__$8 = function() { - var _vm = this; - var _h = _vm.$createElement; - var _c = _vm._self._c || _h; - return _c("div", { ref: _vm.ref, staticClass: "dv-border-box-7" }, [ - _c( - "svg", - { - staticClass: "dv-svg-container", - attrs: { width: _vm.width, height: _vm.height } - }, - [ - _c("polyline", { - staticClass: "dv-bb7-line-width-2", - attrs: { points: "0, 25 0, 0 25, 0" } - }), - _vm._v(" "), - _c("polyline", { - staticClass: "dv-bb7-line-width-2", - attrs: { - points: - _vm.width - 25 + ", 0 " + _vm.width + ", 0 " + _vm.width + ", 25" - } - }), - _vm._v(" "), - _c("polyline", { - staticClass: "dv-bb7-line-width-2", - attrs: { - points: - _vm.width - - 25 + - ", " + - _vm.height + - " " + - _vm.width + - ", " + - _vm.height + - " " + - _vm.width + - ", " + - (_vm.height - 25) - } - }), - _vm._v(" "), - _c("polyline", { - staticClass: "dv-bb7-line-width-2", - attrs: { - points: - "0, " + - (_vm.height - 25) + - " 0, " + - _vm.height + - " 25, " + - _vm.height - } - }), - _vm._v(" "), - _c("polyline", { - staticClass: "dv-bb7-line-width-5", - attrs: { points: "0, 10 0, 0 10, 0" } - }), - _vm._v(" "), - _c("polyline", { - staticClass: "dv-bb7-line-width-5", - attrs: { - points: - _vm.width - 10 + ", 0 " + _vm.width + ", 0 " + _vm.width + ", 10" - } - }), - _vm._v(" "), - _c("polyline", { - staticClass: "dv-bb7-line-width-5", - attrs: { - points: - _vm.width - - 10 + - ", " + - _vm.height + - " " + - _vm.width + - ", " + - _vm.height + - " " + - _vm.width + - ", " + - (_vm.height - 10) - } - }), - _vm._v(" "), - _c("polyline", { - staticClass: "dv-bb7-line-width-5", - attrs: { - points: - "0, " + - (_vm.height - 10) + - " 0, " + - _vm.height + - " 10, " + - _vm.height - } - }) - ] - ), - _vm._v(" "), - _c("div", { staticClass: "border-box-content" }, [_vm._t("default")], 2) - ]) - }; - var __vue_staticRenderFns__$8 = []; - __vue_render__$8._withStripped = true; - /* style */ - const __vue_inject_styles__$8 = function (inject) { - if (!inject) return - inject("data-v-4407270e_0", { source: ".dv-border-box-7 {\n position: relative;\n width: 100%;\n height: 100%;\n box-shadow: inset 0 0 40px rgba(128, 128, 128, 0.3);\n border: 1px solid rgba(128, 128, 128, 0.3);\n}\n.dv-border-box-7 .dv-svg-container {\n position: absolute;\n top: 0px;\n left: 0px;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-7 .dv-svg-container polyline {\n fill: none;\n stroke-linecap: round;\n}\n.dv-border-box-7 .dv-bb7-line-width-2 {\n stroke: rgba(128, 128, 128, 0.3);\n stroke-width: 2;\n}\n.dv-border-box-7 .dv-bb7-line-width-5 {\n stroke: rgba(128, 128, 128, 0.5);\n stroke-width: 5;\n}\n.dv-border-box-7 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;EACZ,mDAAmD;EACnD,0CAA0C;AAC5C;AACA;EACE,kBAAkB;EAClB,QAAQ;EACR,SAAS;EACT,WAAW;EACX,YAAY;AACd;AACA;EACE,UAAU;EACV,qBAAqB;AACvB;AACA;EACE,gCAAgC;EAChC,eAAe;AACjB;AACA;EACE,gCAAgC;EAChC,eAAe;AACjB;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd","file":"main.vue","sourcesContent":[".dv-border-box-7 {\n position: relative;\n width: 100%;\n height: 100%;\n box-shadow: inset 0 0 40px rgba(128, 128, 128, 0.3);\n border: 1px solid rgba(128, 128, 128, 0.3);\n}\n.dv-border-box-7 .dv-svg-container {\n position: absolute;\n top: 0px;\n left: 0px;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-7 .dv-svg-container polyline {\n fill: none;\n stroke-linecap: round;\n}\n.dv-border-box-7 .dv-bb7-line-width-2 {\n stroke: rgba(128, 128, 128, 0.3);\n stroke-width: 2;\n}\n.dv-border-box-7 .dv-bb7-line-width-5 {\n stroke: rgba(128, 128, 128, 0.5);\n stroke-width: 5;\n}\n.dv-border-box-7 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n"]}, media: undefined }); + function checkPointIsNearPolyline(point, polyline, lineWidth) { + var halfLineWidth = lineWidth / 2; + var moveUpPolyline = polyline.map(function (_ref8) { + var _ref9 = (0, _slicedToArray2["default"])(_ref8, 2), + x = _ref9[0], + y = _ref9[1]; - }; - /* scoped */ - const __vue_scope_id__$8 = undefined; - /* module identifier */ - const __vue_module_identifier__$8 = undefined; - /* functional template */ - const __vue_is_functional_template__$8 = false; - /* style inject SSR */ - + return [x, y - halfLineWidth]; + }); + var moveDownPolyline = polyline.map(function (_ref10) { + var _ref11 = (0, _slicedToArray2["default"])(_ref10, 2), + x = _ref11[0], + y = _ref11[1]; - - var BorderBox7 = normalizeComponent_1( - { render: __vue_render__$8, staticRenderFns: __vue_staticRenderFns__$8 }, - __vue_inject_styles__$8, - __vue_script__$8, - __vue_scope_id__$8, - __vue_is_functional_template__$8, - __vue_module_identifier__$8, - browser, - undefined - ); + return [x, y + halfLineWidth]; + }); + var polygon = [].concat((0, _toConsumableArray2["default"])(moveUpPolyline), (0, _toConsumableArray2["default"])(moveDownPolyline.reverse())); + return checkPointIsInPolygon(point, polygon); + } + /** + * @description Check if the point is inside the rect + * @param {Array} point Postion of point + * @param {Number} x Rect start x coordinate + * @param {Number} y Rect start y coordinate + * @param {Number} width Rect width + * @param {Number} height Rect height + * @return {Boolean} Result of check + */ - function borderBox7 (Vue) { - Vue.component(BorderBox7.name, BorderBox7); + + function checkPointIsInRect(_ref12, x, y, width, height) { + var _ref13 = (0, _slicedToArray2["default"])(_ref12, 2), + px = _ref13[0], + py = _ref13[1]; + + if (px < x) return false; + if (py < y) return false; + if (px > x + width) return false; + if (py > y + height) return false; + return true; } + /** + * @description Get the coordinates of the rotated point + * @param {Number} rotate Degree of rotation + * @param {Array} point Postion of point + * @param {Array} origin Rotation center + * @param {Array} origin Rotation center + * @return {Number} Coordinates after rotation + */ - // - var script$9 = { - name: 'DvBorderBox8', - mixins: [autoResize], - data() { - const timestamp = Date.now(); - return { - ref: 'border-box-8', - path: `border-box-8-path-${timestamp}`, - gradient: `border-box-8-gradient-${timestamp}`, - mask: `border-box-8-mask-${timestamp}` - }; - }, + function getRotatePointPos() { + var rotate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var point = arguments.length > 1 ? arguments[1] : undefined; + var origin = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [0, 0]; + if (!point) return false; + if (rotate % 360 === 0) return point; - computed: { - length() { - const { - width, - height - } = this; - return (width + height - 5) * 2; - } + var _point3 = (0, _slicedToArray2["default"])(point, 2), + x = _point3[0], + y = _point3[1]; - } - }; + var _origin = (0, _slicedToArray2["default"])(origin, 2), + ox = _origin[0], + oy = _origin[1]; - /* script */ - const __vue_script__$9 = script$9; + rotate *= PI / 180; + return [(x - ox) * cos(rotate) - (y - oy) * sin(rotate) + ox, (x - ox) * sin(rotate) + (y - oy) * cos(rotate) + oy]; + } + /** + * @description Get the coordinates of the scaled point + * @param {Array} scale Scale factor + * @param {Array} point Postion of point + * @param {Array} origin Scale center + * @return {Number} Coordinates after scale + */ - /* template */ - var __vue_render__$9 = function() { - var _vm = this; - var _h = _vm.$createElement; - var _c = _vm._self._c || _h; - return _c("div", { ref: _vm.ref, staticClass: "dv-border-box-8" }, [ - _c( - "svg", - { - staticClass: "dv-svg-container", - attrs: { width: _vm.width, height: _vm.height } - }, - [ - _c( - "defs", - [ - _c("path", { - attrs: { - id: _vm.path, - d: - "M2.5, 2.5 L" + - (_vm.width - 2.5) + - ", 2.5 L" + - (_vm.width - 2.5) + - ", " + - (_vm.height - 2.5) + - " L2.5, " + - (_vm.height - 2.5) + - " L2.5, 2.5", - fill: "transparent" - } - }), - _vm._v(" "), - _c( - "radialGradient", - { attrs: { id: _vm.gradient, cx: "50%", cy: "50%", r: "50%" } }, - [ - _c("stop", { - attrs: { - offset: "0%", - "stop-color": "#fff", - "stop-opacity": "1" - } - }), - _vm._v(" "), - _c("stop", { - attrs: { - offset: "100%", - "stop-color": "#fff", - "stop-opacity": "0" - } - }) - ], - 1 - ), - _vm._v(" "), - _c("mask", { attrs: { id: _vm.mask } }, [ - _c( - "circle", - { - attrs: { - cx: "0", - cy: "0", - r: "150", - fill: "url(#" + _vm.gradient + ")" - } - }, - [ - _c("animateMotion", { - attrs: { - dur: "3s", - path: - "M2.5, 2.5 L" + - (_vm.width - 2.5) + - ", 2.5 L" + - (_vm.width - 2.5) + - ", " + - (_vm.height - 2.5) + - " L2.5, " + - (_vm.height - 2.5) + - " L2.5, 2.5", - rotate: "auto", - repeatCount: "indefinite" - } - }) - ], - 1 - ) - ]) - ], - 1 - ), - _vm._v(" "), - _c("use", { - attrs: { - stroke: "#235fa7", - "stroke-width": "1", - "xlink:href": "#" + _vm.path - } - }), - _vm._v(" "), - _c( - "use", - { - attrs: { - stroke: "#4fd2dd", - "stroke-width": "3", - "xlink:href": "#" + _vm.path, - mask: "url(#" + _vm.mask + ")" - } - }, - [ - _c("animate", { - attrs: { - attributeName: "stroke-dasharray", - from: "0, " + _vm.length, - to: _vm.length + ", 0", - dur: "3s", - repeatCount: "indefinite" - } - }) - ] - ) - ] - ), - _vm._v(" "), - _c("div", { staticClass: "border-box-content" }, [_vm._t("default")], 2) - ]) + + function getScalePointPos() { + var scale = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [1, 1]; + var point = arguments.length > 1 ? arguments[1] : undefined; + var origin = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [0, 0]; + if (!point) return false; + if (scale === 1) return point; + + var _point4 = (0, _slicedToArray2["default"])(point, 2), + x = _point4[0], + y = _point4[1]; + + var _origin2 = (0, _slicedToArray2["default"])(origin, 2), + ox = _origin2[0], + oy = _origin2[1]; + + var _scale = (0, _slicedToArray2["default"])(scale, 2), + xs = _scale[0], + ys = _scale[1]; + + var relativePosX = x - ox; + var relativePosY = y - oy; + return [relativePosX * xs + ox, relativePosY * ys + oy]; + } + /** + * @description Get the coordinates of the scaled point + * @param {Array} translate Translation distance + * @param {Array} point Postion of point + * @return {Number} Coordinates after translation + */ + + + function getTranslatePointPos(translate, point) { + if (!translate || !point) return false; + + var _point5 = (0, _slicedToArray2["default"])(point, 2), + x = _point5[0], + y = _point5[1]; + + var _translate = (0, _slicedToArray2["default"])(translate, 2), + tx = _translate[0], + ty = _translate[1]; + + return [x + tx, y + ty]; + } + /** + * @description Get the distance from the point to the line + * @param {Array} point Postion of point + * @param {Array} lineBegin Line start position + * @param {Array} lineEnd Line end position + * @return {Number} Distance between point and line + */ + + + function getDistanceBetweenPointAndLine(point, lineBegin, lineEnd) { + if (!point || !lineBegin || !lineEnd) return false; + + var _point6 = (0, _slicedToArray2["default"])(point, 2), + x = _point6[0], + y = _point6[1]; + + var _lineBegin = (0, _slicedToArray2["default"])(lineBegin, 2), + x1 = _lineBegin[0], + y1 = _lineBegin[1]; + + var _lineEnd = (0, _slicedToArray2["default"])(lineEnd, 2), + x2 = _lineEnd[0], + y2 = _lineEnd[1]; + + var a = y2 - y1; + var b = x1 - x2; + var c = y1 * (x2 - x1) - x1 * (y2 - y1); + var molecule = abs(a * x + b * y + c); + var denominator = sqrt(a * a + b * b); + return molecule / denominator; + } + /** + * @description Get the coordinates of the specified radian on the circle + * @param {Number} x Circle x coordinate + * @param {Number} y Circle y coordinate + * @param {Number} radius Circle radius + * @param {Number} radian Specfied radian + * @return {Array} Postion of point + */ + + + function getCircleRadianPoint(x, y, radius, radian) { + return [x + cos(radian) * radius, y + sin(radian) * radius]; + } + /** + * @description Get the points that make up a regular polygon + * @param {Number} x X coordinate of the polygon inscribed circle + * @param {Number} y Y coordinate of the polygon inscribed circle + * @param {Number} r Radius of the polygon inscribed circle + * @param {Number} side Side number + * @param {Number} minus Radian offset + * @return {Array} Points that make up a regular polygon + */ + + + function getRegularPolygonPoints(rx, ry, r, side) { + var minus = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : PI * -0.5; + var radianGap = PI * 2 / side; + var radians = new Array(side).fill('').map(function (t, i) { + return i * radianGap + minus; + }); + return radians.map(function (radian) { + return getCircleRadianPoint(rx, ry, r, radian); + }); + } + + var _default = { + deepClone: deepClone, + eliminateBlur: eliminateBlur, + checkPointIsInCircle: checkPointIsInCircle, + checkPointIsInPolygon: checkPointIsInPolygon, + checkPointIsInSector: checkPointIsInSector, + checkPointIsNearPolyline: checkPointIsNearPolyline, + getTwoPointDistance: getTwoPointDistance, + getRotatePointPos: getRotatePointPos, + getScalePointPos: getScalePointPos, + getTranslatePointPos: getTranslatePointPos, + getCircleRadianPoint: getCircleRadianPoint, + getRegularPolygonPoints: getRegularPolygonPoints, + getDistanceBetweenPointAndLine: getDistanceBetweenPointAndLine }; - var __vue_staticRenderFns__$9 = []; - __vue_render__$9._withStripped = true; + exports["default"] = _default; + }); - /* style */ - const __vue_inject_styles__$9 = function (inject) { - if (!inject) return - inject("data-v-700cf158_0", { source: ".dv-border-box-8 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-8 svg {\n position: absolute;\n width: 100%;\n height: 100%;\n left: 0px;\n top: 0px;\n}\n.dv-border-box-8 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;EACZ,SAAS;EACT,QAAQ;AACV;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd","file":"main.vue","sourcesContent":[".dv-border-box-8 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-8 svg {\n position: absolute;\n width: 100%;\n height: 100%;\n left: 0px;\n top: 0px;\n}\n.dv-border-box-8 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n"]}, media: undefined }); + unwrapExports(util); + var util_1 = util.deepClone; + var util_2 = util.eliminateBlur; + var util_3 = util.checkPointIsInCircle; + var util_4 = util.getTwoPointDistance; + var util_5 = util.checkPointIsInPolygon; + var util_6 = util.checkPointIsInSector; + var util_7 = util.checkPointIsNearPolyline; + var util_8 = util.checkPointIsInRect; + var util_9 = util.getRotatePointPos; + var util_10 = util.getScalePointPos; + var util_11 = util.getTranslatePointPos; + var util_12 = util.getDistanceBetweenPointAndLine; + var util_13 = util.getCircleRadianPoint; + var util_14 = util.getRegularPolygonPoints; - }; - /* scoped */ - const __vue_scope_id__$9 = undefined; - /* module identifier */ - const __vue_module_identifier__$9 = undefined; - /* functional template */ - const __vue_is_functional_template__$9 = false; - /* style inject SSR */ - + var util$1 = createCommonjsModule(function (module, exports) { - - var BorderBox8 = normalizeComponent_1( - { render: __vue_render__$9, staticRenderFns: __vue_staticRenderFns__$9 }, - __vue_inject_styles__$9, - __vue_script__$9, - __vue_scope_id__$9, - __vue_is_functional_template__$9, - __vue_module_identifier__$9, - browser, - undefined - ); - function borderBox8 (Vue) { - Vue.component(BorderBox8.name, BorderBox8); + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.filterNonNumber = filterNonNumber; + exports.deepMerge = deepMerge; + exports.mulAdd = mulAdd; + exports.mergeSameStackData = mergeSameStackData; + exports.getTwoPointDistance = getTwoPointDistance; + exports.getLinearGradientColor = getLinearGradientColor; + exports.getPolylineLength = getPolylineLength; + exports.getPointToLineDistance = getPointToLineDistance; + exports.initNeedSeries = initNeedSeries; + exports.radianToAngle = radianToAngle; + + var _toConsumableArray2 = interopRequireDefault(toConsumableArray); + + var _typeof2 = interopRequireDefault(_typeof_1); + + + + function filterNonNumber(array) { + return array.filter(function (n) { + return typeof n === 'number'; + }); } - // - var script$a = { - name: 'DvBorderBox9', - mixins: [autoResize], + function deepMerge(target, merged) { + for (var key in merged) { + if (target[key] && (0, _typeof2["default"])(target[key]) === 'object') { + deepMerge(target[key], merged[key]); + continue; + } - data() { - const timestamp = Date.now(); - return { - ref: 'border-box-9', - gradientId: `border-box-9-gradient-${timestamp}`, - maskId: `border-box-9-mask-${timestamp}` - }; + if ((0, _typeof2["default"])(merged[key]) === 'object') { + target[key] = (0, util.deepClone)(merged[key], true); + continue; + } + + target[key] = merged[key]; } - }; + return target; + } - /* script */ - const __vue_script__$a = script$a; + function mulAdd(nums) { + nums = filterNonNumber(nums); + return nums.reduce(function (all, num) { + return all + num; + }, 0); + } - /* template */ - var __vue_render__$a = function() { - var _vm = this; - var _h = _vm.$createElement; - var _c = _vm._self._c || _h; - return _c("div", { ref: _vm.ref, staticClass: "dv-border-box-9" }, [ - _c( - "svg", - { - staticClass: "dv-svg-container", - attrs: { width: _vm.width, height: _vm.height } - }, - [ - _c( - "defs", - [ - _c( - "linearGradient", - { - attrs: { - id: _vm.gradientId, - x1: "0%", - y1: "0%", - x2: "100%", - y2: "100%" - } - }, - [ - _c("stop", { - attrs: { offset: "0%", "stop-color": "#11eefd" } - }), - _vm._v(" "), - _c("stop", { - attrs: { offset: "100%", "stop-color": "#0078d2" } - }) - ], - 1 - ), - _vm._v(" "), - _c("mask", { attrs: { id: _vm.maskId } }, [ - _c("polyline", { - attrs: { - stroke: "#fff", - "stroke-width": "3", - fill: "transparent", - points: - "8, " + - _vm.height * 0.4 + - " 8, 3, " + - (_vm.width * 0.4 + 7) + - ", 3" - } - }), - _vm._v(" "), - _c("polyline", { + function mergeSameStackData(item, series) { + var stack = item.stack; + if (!stack) return (0, _toConsumableArray2["default"])(item.data); + var stacks = series.filter(function (_ref) { + var s = _ref.stack; + return s === stack; + }); + var index = stacks.findIndex(function (_ref2) { + var d = _ref2.data; + return d === item.data; + }); + var datas = stacks.splice(0, index + 1).map(function (_ref3) { + var data = _ref3.data; + return data; + }); + var dataLength = datas[0].length; + return new Array(dataLength).fill(0).map(function (foo, i) { + return mulAdd(datas.map(function (d) { + return d[i]; + })); + }); + } + + function getTwoPointDistance(pointOne, pointTwo) { + var minusX = Math.abs(pointOne[0] - pointTwo[0]); + var minusY = Math.abs(pointOne[1] - pointTwo[1]); + return Math.sqrt(minusX * minusX + minusY * minusY); + } + + function getLinearGradientColor(ctx, begin, end, color) { + if (!ctx || !begin || !end || !color.length) return; + var colors = color; + typeof colors === 'string' && (colors = [color, color]); + var linearGradientColor = ctx.createLinearGradient.apply(ctx, (0, _toConsumableArray2["default"])(begin).concat((0, _toConsumableArray2["default"])(end))); + var colorGap = 1 / (colors.length - 1); + colors.forEach(function (c, i) { + return linearGradientColor.addColorStop(colorGap * i, c); + }); + return linearGradientColor; + } + + function getPolylineLength(points) { + var lineSegments = new Array(points.length - 1).fill(0).map(function (foo, i) { + return [points[i], points[i + 1]]; + }); + var lengths = lineSegments.map(function (item) { + return getTwoPointDistance.apply(void 0, (0, _toConsumableArray2["default"])(item)); + }); + return mulAdd(lengths); + } + + function getPointToLineDistance(point, linePointOne, linePointTwo) { + var a = getTwoPointDistance(point, linePointOne); + var b = getTwoPointDistance(point, linePointTwo); + var c = getTwoPointDistance(linePointOne, linePointTwo); + return 0.5 * Math.sqrt((a + b + c) * (a + b - c) * (a + c - b) * (b + c - a)) / c; + } + + function initNeedSeries(series, config, type) { + series = series.filter(function (_ref4) { + var st = _ref4.type; + return st === type; + }); + series = series.map(function (item) { + return deepMerge((0, util.deepClone)(config, true), item); + }); + return series.filter(function (_ref5) { + var show = _ref5.show; + return show; + }); + } + + function radianToAngle(radian) { + return radian / Math.PI * 180; + } + }); + + unwrapExports(util$1); + var util_1$1 = util$1.filterNonNumber; + var util_2$1 = util$1.deepMerge; + var util_3$1 = util$1.mulAdd; + var util_4$1 = util$1.mergeSameStackData; + var util_5$1 = util$1.getTwoPointDistance; + var util_6$1 = util$1.getLinearGradientColor; + var util_7$1 = util$1.getPolylineLength; + var util_8$1 = util$1.getPointToLineDistance; + var util_9$1 = util$1.initNeedSeries; + var util_10$1 = util$1.radianToAngle; + + // + var script$2 = { + name: 'DvBorderBox1', + mixins: [autoResize], + props: { + color: { + type: Array, + default: () => [] + }, + backgroundColor: { + type: String, + default: 'transparent' + } + }, + + data() { + return { + ref: 'border-box-1', + border: ['left-top', 'right-top', 'left-bottom', 'right-bottom'], + defaultColor: ['#4fd2dd', '#235fa7'], + mergedColor: [] + }; + }, + + watch: { + color() { + const { + mergeColor + } = this; + mergeColor(); + } + + }, + methods: { + mergeColor() { + const { + color, + defaultColor + } = this; + this.mergedColor = util_2$1(util_1(defaultColor, true), color || []); + } + + }, + + mounted() { + const { + mergeColor + } = this; + mergeColor(); + } + + }; + + /* script */ + const __vue_script__$2 = script$2; + + /* template */ + var __vue_render__$2 = function() { + var _vm = this; + var _h = _vm.$createElement; + var _c = _vm._self._c || _h; + return _c( + "div", + { ref: _vm.ref, staticClass: "dv-border-box-1" }, + [ + _c( + "svg", + { + staticClass: "border", + attrs: { width: _vm.width, height: _vm.height } + }, + [ + _c("polygon", { + attrs: { + fill: _vm.backgroundColor, + points: + "10, 27 10, " + + (_vm.height - 27) + + " 13, " + + (_vm.height - 24) + + " 13, " + + (_vm.height - 21) + + " 24, " + + (_vm.height - 11) + + "\n 38, " + + (_vm.height - 11) + + " 41, " + + (_vm.height - 8) + + " 73, " + + (_vm.height - 8) + + " 75, " + + (_vm.height - 10) + + " 81, " + + (_vm.height - 10) + + "\n 85, " + + (_vm.height - 6) + + " " + + (_vm.width - 85) + + ", " + + (_vm.height - 6) + + " " + + (_vm.width - 81) + + ", " + + (_vm.height - 10) + + " " + + (_vm.width - 75) + + ", " + + (_vm.height - 10) + + "\n " + + (_vm.width - 73) + + ", " + + (_vm.height - 8) + + " " + + (_vm.width - 41) + + ", " + + (_vm.height - 8) + + " " + + (_vm.width - 38) + + ", " + + (_vm.height - 11) + + "\n " + + (_vm.width - 24) + + ", " + + (_vm.height - 11) + + " " + + (_vm.width - 13) + + ", " + + (_vm.height - 21) + + " " + + (_vm.width - 13) + + ", " + + (_vm.height - 24) + + "\n " + + (_vm.width - 10) + + ", " + + (_vm.height - 27) + + " " + + (_vm.width - 10) + + ", 27 " + + (_vm.width - 13) + + ", 25 " + + (_vm.width - 13) + + ", 21\n " + + (_vm.width - 24) + + ", 11 " + + (_vm.width - 38) + + ", 11 " + + (_vm.width - 41) + + ", 8 " + + (_vm.width - 73) + + ", 8 " + + (_vm.width - 75) + + ", 10\n " + + (_vm.width - 81) + + ", 10 " + + (_vm.width - 85) + + ", 6 85, 6 81, 10 75, 10 73, 8 41, 8 38, 11 24, 11 13, 21 13, 24" + } + }) + ] + ), + _vm._v(" "), + _vm._l(_vm.border, function(item) { + return _c( + "svg", + { + key: item, + class: item + " border", + attrs: { width: "150px", height: "150px" } + }, + [ + _c( + "polygon", + { attrs: { - fill: "#fff", + fill: _vm.mergedColor[0], points: - "8, " + - _vm.height * 0.15 + - " 8, 3, " + - (_vm.width * 0.1 + 7) + - ", 3\n " + - _vm.width * 0.1 + - ", 8 14, 8 14, " + - (_vm.height * 0.15 - 7) + - "\n " + "6,66 6,18 12,12 18,12 24,6 27,6 30,9 36,9 39,6 84,6 81,9 75,9 73.2,7 40.8,7 37.8,10.2 24,10.2 12,21 12,24 9,27 9,51 7.8,54 7.8,63" } - }), - _vm._v(" "), - _c("polyline", { + }, + [ + _c("animate", { + attrs: { + attributeName: "fill", + values: + _vm.mergedColor[0] + + ";" + + _vm.mergedColor[1] + + ";" + + _vm.mergedColor[0], + dur: "0.5s", + begin: "0s", + repeatCount: "indefinite" + } + }) + ] + ), + _vm._v(" "), + _c( + "polygon", + { attrs: { - stroke: "#fff", - "stroke-width": "3", - fill: "transparent", + fill: _vm.mergedColor[1], points: - _vm.width * 0.5 + - ", 3 " + - (_vm.width - 3) + - ", 3, " + - (_vm.width - 3) + - ", " + - _vm.height * 0.25 + "27.599999999999998,4.8 38.4,4.8 35.4,7.8 30.599999999999998,7.8" } - }), - _vm._v(" "), - _c("polyline", { + }, + [ + _c("animate", { + attrs: { + attributeName: "fill", + values: + _vm.mergedColor[1] + + ";" + + _vm.mergedColor[0] + + ";" + + _vm.mergedColor[1], + dur: "0.5s", + begin: "0s", + repeatCount: "indefinite" + } + }) + ] + ), + _vm._v(" "), + _c( + "polygon", + { attrs: { - fill: "#fff", + fill: _vm.mergedColor[0], points: - "\n " + - _vm.width * 0.52 + - ", 3 " + - _vm.width * 0.58 + - ", 3\n " + - (_vm.width * 0.58 - 7) + - ", 9 " + - (_vm.width * 0.52 + 7) + - ", 9\n " + "9,54 9,63 7.199999999999999,66 7.199999999999999,75 7.8,78 7.8,110 8.4,110 8.4,66 9.6,66 9.6,54" } - }), - _vm._v(" "), - _c("polyline", { - attrs: { - fill: "#fff", - points: - "\n " + - _vm.width * 0.9 + - ", 3 " + - (_vm.width - 3) + - ", 3 " + - (_vm.width - 3) + - ", " + - _vm.height * 0.1 + - "\n " + - (_vm.width - 9) + - ", " + - (_vm.height * 0.1 - 7) + - " " + - (_vm.width - 9) + - ", 9 " + - (_vm.width * 0.9 + 7) + - ", 9\n " - } - }), - _vm._v(" "), - _c("polyline", { - attrs: { - stroke: "#fff", - "stroke-width": "3", - fill: "transparent", - points: - "8, " + - _vm.height * 0.5 + - " 8, " + - (_vm.height - 3) + - " " + - (_vm.width * 0.3 + 7) + - ", " + - (_vm.height - 3) - } - }), - _vm._v(" "), - _c("polyline", { - attrs: { - fill: "#fff", - points: - "\n 8, " + - _vm.height * 0.55 + - " 8, " + - _vm.height * 0.7 + - "\n 2, " + - (_vm.height * 0.7 - 7) + - " 2, " + - (_vm.height * 0.55 + 7) + - "\n " - } - }), - _vm._v(" "), - _c("polyline", { - attrs: { - stroke: "#fff", - "stroke-width": "3", - fill: "transparent", - points: - _vm.width * 0.35 + - ", " + - (_vm.height - 3) + - " " + - (_vm.width - 3) + - ", " + - (_vm.height - 3) + - " " + - (_vm.width - 3) + - ", " + - _vm.height * 0.35 - } - }), - _vm._v(" "), - _c("polyline", { - attrs: { - fill: "#fff", - points: - "\n " + - _vm.width * 0.92 + - ", " + - (_vm.height - 3) + - " " + - (_vm.width - 3) + - ", " + - (_vm.height - 3) + - " " + - (_vm.width - 3) + - ", " + - _vm.height * 0.8 + - "\n " + - (_vm.width - 9) + - ", " + - (_vm.height * 0.8 + 7) + - " " + - (_vm.width - 9) + - ", " + - (_vm.height - 9) + - " " + - (_vm.width * 0.92 + 7) + - ", " + - (_vm.height - 9) + - "\n " - } - }) - ]) - ], - 1 - ), - _vm._v(" "), - _c("rect", { - attrs: { - x: "0", - y: "0", - width: _vm.width, - height: _vm.height, - fill: "url(#" + _vm.gradientId + ")", - mask: "url(#" + _vm.maskId + ")" - } - }) - ] - ), - _vm._v(" "), - _c("div", { staticClass: "border-box-content" }, [_vm._t("default")], 2) - ]) + }, + [ + _c("animate", { + attrs: { + attributeName: "fill", + values: + _vm.mergedColor[0] + + ";" + + _vm.mergedColor[1] + + ";transparent", + dur: "1s", + begin: "0s", + repeatCount: "indefinite" + } + }) + ] + ) + ] + ) + }), + _vm._v(" "), + _c("div", { staticClass: "border-box-content" }, [_vm._t("default")], 2) + ], + 2 + ) }; - var __vue_staticRenderFns__$a = []; - __vue_render__$a._withStripped = true; + var __vue_staticRenderFns__$2 = []; + __vue_render__$2._withStripped = true; /* style */ - const __vue_inject_styles__$a = function (inject) { + const __vue_inject_styles__$2 = function (inject) { if (!inject) return - inject("data-v-3e8002dc_0", { source: ".dv-border-box-9 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-9 svg {\n position: absolute;\n width: 100%;\n height: 100%;\n left: 0px;\n top: 0px;\n}\n.dv-border-box-9 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;EACZ,SAAS;EACT,QAAQ;AACV;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd","file":"main.vue","sourcesContent":[".dv-border-box-9 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-9 svg {\n position: absolute;\n width: 100%;\n height: 100%;\n left: 0px;\n top: 0px;\n}\n.dv-border-box-9 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n"]}, media: undefined }); + inject("data-v-5d85361d_0", { source: ".dv-border-box-1 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-1 .border {\n position: absolute;\n display: block;\n}\n.dv-border-box-1 .right-top {\n right: 0px;\n transform: rotateY(180deg);\n}\n.dv-border-box-1 .left-bottom {\n bottom: 0px;\n transform: rotateX(180deg);\n}\n.dv-border-box-1 .right-bottom {\n right: 0px;\n bottom: 0px;\n transform: rotateX(180deg) rotateY(180deg);\n}\n.dv-border-box-1 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd;AACA;EACE,kBAAkB;EAClB,cAAc;AAChB;AACA;EACE,UAAU;EACV,0BAA0B;AAC5B;AACA;EACE,WAAW;EACX,0BAA0B;AAC5B;AACA;EACE,UAAU;EACV,WAAW;EACX,0CAA0C;AAC5C;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd","file":"main.vue","sourcesContent":[".dv-border-box-1 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-1 .border {\n position: absolute;\n display: block;\n}\n.dv-border-box-1 .right-top {\n right: 0px;\n transform: rotateY(180deg);\n}\n.dv-border-box-1 .left-bottom {\n bottom: 0px;\n transform: rotateX(180deg);\n}\n.dv-border-box-1 .right-bottom {\n right: 0px;\n bottom: 0px;\n transform: rotateX(180deg) rotateY(180deg);\n}\n.dv-border-box-1 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n"]}, media: undefined }); }; /* scoped */ - const __vue_scope_id__$a = undefined; + const __vue_scope_id__$2 = undefined; /* module identifier */ - const __vue_module_identifier__$a = undefined; + const __vue_module_identifier__$2 = undefined; /* functional template */ - const __vue_is_functional_template__$a = false; + const __vue_is_functional_template__$2 = false; /* style inject SSR */ + /* style inject shadow dom */ + - var BorderBox9 = normalizeComponent_1( - { render: __vue_render__$a, staticRenderFns: __vue_staticRenderFns__$a }, - __vue_inject_styles__$a, - __vue_script__$a, - __vue_scope_id__$a, - __vue_is_functional_template__$a, - __vue_module_identifier__$a, - browser, + const __vue_component__$2 = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$2, staticRenderFns: __vue_staticRenderFns__$2 }, + __vue_inject_styles__$2, + __vue_script__$2, + __vue_scope_id__$2, + __vue_is_functional_template__$2, + __vue_module_identifier__$2, + false, + createInjector, + undefined, undefined ); - function borderBox9 (Vue) { - Vue.component(BorderBox9.name, BorderBox9); + function borderBox1 (Vue) { + Vue.component(__vue_component__$2.name, __vue_component__$2); } // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - var script$b = { - name: 'DvBorderBox10', + var script$3 = { + name: 'DvBorderBox2', + mixins: [autoResize], + props: { + color: { + type: Array, + default: () => [] + }, + backgroundColor: { + type: String, + default: 'transparent' + } + }, data() { return { - border: ['left-top', 'right-top', 'left-bottom', 'right-bottom'] + ref: 'border-box-2', + defaultColor: ['#fff', 'rgba(255, 255, 255, 0.6)'], + mergedColor: [] }; + }, + + watch: { + color() { + const { + mergeColor + } = this; + mergeColor(); + } + + }, + methods: { + mergeColor() { + const { + color, + defaultColor + } = this; + this.mergedColor = util_2$1(util_1(defaultColor, true), color || []); + } + + }, + + mounted() { + const { + mergeColor + } = this; + mergeColor(); } }; /* script */ - const __vue_script__$b = script$b; + const __vue_script__$3 = script$3; /* template */ - var __vue_render__$b = function() { + var __vue_render__$3 = function() { var _vm = this; var _h = _vm.$createElement; var _c = _vm._self._c || _h; - return _c( - "div", - { staticClass: "dv-border-box-10" }, - [ - _vm._l(_vm.border, function(item) { - return _c( - "svg", - { - key: item, - class: item + " border", - attrs: { width: "150px", height: "150px" } - }, - [ - _c("polygon", { - attrs: { - fill: "#d3e1f8", - points: "40, 0 5, 0 0, 5 0, 16 3, 19 3, 7 7, 3 35, 3" - } - }) - ] - ) - }), - _vm._v(" "), - _c("div", { staticClass: "border-box-content" }, [_vm._t("default")], 2) - ], - 2 - ) - }; - var __vue_staticRenderFns__$b = []; - __vue_render__$b._withStripped = true; - - /* style */ - const __vue_inject_styles__$b = function (inject) { - if (!inject) return - inject("data-v-4ca6df50_0", { source: ".dv-border-box-10 {\n position: relative;\n width: 100%;\n height: 100%;\n box-shadow: inset 0 0 25px 3px #1d48c4;\n border-radius: 6px;\n}\n.dv-border-box-10 .border {\n position: absolute;\n display: block;\n}\n.dv-border-box-10 .right-top {\n right: 0px;\n transform: rotateY(180deg);\n}\n.dv-border-box-10 .left-bottom {\n bottom: 0px;\n transform: rotateX(180deg);\n}\n.dv-border-box-10 .right-bottom {\n right: 0px;\n bottom: 0px;\n transform: rotateX(180deg) rotateY(180deg);\n}\n.dv-border-box-10 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;EACZ,sCAAsC;EACtC,kBAAkB;AACpB;AACA;EACE,kBAAkB;EAClB,cAAc;AAChB;AACA;EACE,UAAU;EACV,0BAA0B;AAC5B;AACA;EACE,WAAW;EACX,0BAA0B;AAC5B;AACA;EACE,UAAU;EACV,WAAW;EACX,0CAA0C;AAC5C;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd","file":"main.vue","sourcesContent":[".dv-border-box-10 {\n position: relative;\n width: 100%;\n height: 100%;\n box-shadow: inset 0 0 25px 3px #1d48c4;\n border-radius: 6px;\n}\n.dv-border-box-10 .border {\n position: absolute;\n display: block;\n}\n.dv-border-box-10 .right-top {\n right: 0px;\n transform: rotateY(180deg);\n}\n.dv-border-box-10 .left-bottom {\n bottom: 0px;\n transform: rotateX(180deg);\n}\n.dv-border-box-10 .right-bottom {\n right: 0px;\n bottom: 0px;\n transform: rotateX(180deg) rotateY(180deg);\n}\n.dv-border-box-10 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n"]}, media: undefined }); - - }; - /* scoped */ - const __vue_scope_id__$b = undefined; + return _c("div", { ref: _vm.ref, staticClass: "dv-border-box-2" }, [ + _c( + "svg", + { + staticClass: "dv-border-svg-container", + attrs: { width: _vm.width, height: _vm.height } + }, + [ + _c("polygon", { + attrs: { + fill: _vm.backgroundColor, + points: + "\n 7, 7 " + + (_vm.width - 7) + + ", 7 " + + (_vm.width - 7) + + ", " + + (_vm.height - 7) + + " 7, " + + (_vm.height - 7) + + "\n " + } + }), + _vm._v(" "), + _c("polyline", { + attrs: { + stroke: _vm.mergedColor[0], + points: + "2, 2 " + + (_vm.width - 2) + + " ,2 " + + (_vm.width - 2) + + ", " + + (_vm.height - 2) + + " 2, " + + (_vm.height - 2) + + " 2, 2" + } + }), + _vm._v(" "), + _c("polyline", { + attrs: { + stroke: _vm.mergedColor[1], + points: + "6, 6 " + + (_vm.width - 6) + + ", 6 " + + (_vm.width - 6) + + ", " + + (_vm.height - 6) + + " 6, " + + (_vm.height - 6) + + " 6, 6" + } + }), + _vm._v(" "), + _c("circle", { + attrs: { fill: _vm.mergedColor[0], cx: "11", cy: "11", r: "1" } + }), + _vm._v(" "), + _c("circle", { + attrs: { + fill: _vm.mergedColor[0], + cx: _vm.width - 11, + cy: "11", + r: "1" + } + }), + _vm._v(" "), + _c("circle", { + attrs: { + fill: _vm.mergedColor[0], + cx: _vm.width - 11, + cy: _vm.height - 11, + r: "1" + } + }), + _vm._v(" "), + _c("circle", { + attrs: { + fill: _vm.mergedColor[0], + cx: "11", + cy: _vm.height - 11, + r: "1" + } + }) + ] + ), + _vm._v(" "), + _c("div", { staticClass: "border-box-content" }, [_vm._t("default")], 2) + ]) + }; + var __vue_staticRenderFns__$3 = []; + __vue_render__$3._withStripped = true; + + /* style */ + const __vue_inject_styles__$3 = function (inject) { + if (!inject) return + inject("data-v-d5c64680_0", { source: ".dv-border-box-2 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-2 .dv-border-svg-container {\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0px;\n left: 0px;\n}\n.dv-border-box-2 .dv-border-svg-container > polyline {\n fill: none;\n stroke-width: 1;\n}\n.dv-border-box-2 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;EACZ,QAAQ;EACR,SAAS;AACX;AACA;EACE,UAAU;EACV,eAAe;AACjB;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd","file":"main.vue","sourcesContent":[".dv-border-box-2 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-2 .dv-border-svg-container {\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0px;\n left: 0px;\n}\n.dv-border-box-2 .dv-border-svg-container > polyline {\n fill: none;\n stroke-width: 1;\n}\n.dv-border-box-2 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n"]}, media: undefined }); + + }; + /* scoped */ + const __vue_scope_id__$3 = undefined; /* module identifier */ - const __vue_module_identifier__$b = undefined; + const __vue_module_identifier__$3 = undefined; /* functional template */ - const __vue_is_functional_template__$b = false; + const __vue_is_functional_template__$3 = false; /* style inject SSR */ + /* style inject shadow dom */ + - var BorderBox10 = normalizeComponent_1( - { render: __vue_render__$b, staticRenderFns: __vue_staticRenderFns__$b }, - __vue_inject_styles__$b, - __vue_script__$b, - __vue_scope_id__$b, - __vue_is_functional_template__$b, - __vue_module_identifier__$b, - browser, + const __vue_component__$3 = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$3, staticRenderFns: __vue_staticRenderFns__$3 }, + __vue_inject_styles__$3, + __vue_script__$3, + __vue_scope_id__$3, + __vue_is_functional_template__$3, + __vue_module_identifier__$3, + false, + createInjector, + undefined, undefined ); - function borderBox10 (Vue) { - Vue.component(BorderBox10.name, BorderBox10); + function borderBox2 (Vue) { + Vue.component(__vue_component__$3.name, __vue_component__$3); } // - var script$c = { - name: 'DvDecoration1', + var script$4 = { + name: 'DvBorderBox3', mixins: [autoResize], + props: { + color: { + type: Array, + default: () => [] + }, + backgroundColor: { + type: String, + default: 'transparent' + } + }, data() { - const pointSideLength = 2.5; return { - ref: 'decoration-1', - svgWH: [200, 50], - svgScale: [1, 1], - rowNum: 4, - rowPoints: 20, - pointSideLength, - halfPointSideLength: pointSideLength / 2, - points: [], - rects: [] + ref: 'border-box-3', + defaultColor: ['#2862b7', '#2862b7'], + mergedColor: [] }; }, - methods: { - afterAutoResizeMixinInit() { - const { - calcSVGData - } = this; - calcSVGData(); - }, - - calcSVGData() { - const { - calcPointsPosition, - calcRectsPosition, - calcScale - } = this; - calcPointsPosition(); - calcRectsPosition(); - calcScale(); - }, - - calcPointsPosition() { - const { - svgWH, - rowNum, - rowPoints - } = this; - const [w, h] = svgWH; - const horizontalGap = w / (rowPoints + 1); - const verticalGap = h / (rowNum + 1); - let points = new Array(rowNum).fill(0).map((foo, i) => new Array(rowPoints).fill(0).map((foo, j) => [horizontalGap * (j + 1), verticalGap * (i + 1)])); - this.points = points.reduce((all, item) => [...all, ...item], []); - }, - - calcRectsPosition() { - const { - points, - rowPoints - } = this; - const rect1 = points[rowPoints * 2 - 1]; - const rect2 = points[rowPoints * 2 - 3]; - this.rects = [rect1, rect2]; - }, - - calcScale() { + watch: { + color() { const { - width, - height, - svgWH + mergeColor } = this; - const [w, h] = svgWH; - this.svgScale = [width / w, height / h]; - }, + mergeColor(); + } - onResize() { + }, + methods: { + mergeColor() { const { - calcSVGData + color, + defaultColor } = this; - calcSVGData(); + this.mergedColor = util_2$1(util_1(defaultColor, true), color || []); } + }, + + mounted() { + const { + mergeColor + } = this; + mergeColor(); } + }; /* script */ - const __vue_script__$c = script$c; + const __vue_script__$4 = script$4; /* template */ - var __vue_render__$c = function() { + var __vue_render__$4 = function() { var _vm = this; var _h = _vm.$createElement; var _c = _vm._self._c || _h; - return _c("div", { ref: _vm.ref, staticClass: "dv-decoration-1" }, [ + return _c("div", { ref: _vm.ref, staticClass: "dv-border-box-3" }, [ _c( "svg", { - style: - "transform:scale(" + _vm.svgScale[0] + "," + _vm.svgScale[1] + ");", - attrs: { width: _vm.svgWH[0] + "px", height: _vm.svgWH[1] + "px" } + staticClass: "dv-border-svg-container", + attrs: { width: _vm.width, height: _vm.height } }, [ - _vm._l(_vm.points, function(point, i) { - return [ - Math.random() > 0.6 - ? _c( - "rect", - { - key: i, - attrs: { - fill: "#fff", - x: point[0] - _vm.halfPointSideLength, - y: point[1] - _vm.halfPointSideLength, - width: _vm.pointSideLength, - height: _vm.pointSideLength - } - }, - [ - Math.random() > 0.6 - ? _c("animate", { - attrs: { - attributeName: "fill", - values: "#fff;transparent", - dur: "1s", - begin: Math.random() * 2, - repeatCount: "indefinite" - } - }) - : _vm._e() - ] - ) - : _vm._e() - ] + _c("polygon", { + attrs: { + fill: _vm.backgroundColor, + points: + "\n 23, 23 " + + (_vm.width - 24) + + ", 23 " + + (_vm.width - 24) + + ", " + + (_vm.height - 24) + + " 23, " + + (_vm.height - 24) + + "\n " + } }), _vm._v(" "), - _vm.rects[0] - ? _c( - "rect", - { - attrs: { - fill: "#0de7c2", - x: _vm.rects[0][0] - _vm.pointSideLength, - y: _vm.rects[0][1] - _vm.pointSideLength, - width: _vm.pointSideLength * 2, - height: _vm.pointSideLength * 2 - } - }, - [ - _c("animate", { - attrs: { - attributeName: "width", - values: "0;" + _vm.pointSideLength * 2, - dur: "2s", - repeatCount: "indefinite" - } - }), - _vm._v(" "), - _c("animate", { - attrs: { - attributeName: "height", - values: "0;" + _vm.pointSideLength * 2, - dur: "2s", - repeatCount: "indefinite" - } - }), - _vm._v(" "), - _c("animate", { - attrs: { - attributeName: "x", - values: - _vm.rects[0][0] + - ";" + - (_vm.rects[0][0] - _vm.pointSideLength), - dur: "2s", - repeatCount: "indefinite" - } - }), - _vm._v(" "), - _c("animate", { - attrs: { - attributeName: "y", - values: - _vm.rects[0][1] + - ";" + - (_vm.rects[0][1] - _vm.pointSideLength), - dur: "2s", - repeatCount: "indefinite" - } - }) - ] - ) - : _vm._e(), + _c("polyline", { + staticClass: "dv-bb3-line1", + attrs: { + stroke: _vm.mergedColor[0], + points: + "4, 4 " + + (_vm.width - 22) + + " ,4 " + + (_vm.width - 22) + + ", " + + (_vm.height - 22) + + " 4, " + + (_vm.height - 22) + + " 4, 4" + } + }), _vm._v(" "), - _vm.rects[1] - ? _c( - "rect", - { - attrs: { - fill: "#0de7c2", - x: _vm.rects[1][0] - 40, - y: _vm.rects[1][1] - _vm.pointSideLength, - width: 40, - height: _vm.pointSideLength * 2 - } - }, - [ - _c("animate", { - attrs: { - attributeName: "width", - values: "0;40;0", - dur: "2s", - repeatCount: "indefinite" - } - }), - _vm._v(" "), - _c("animate", { - attrs: { - attributeName: "x", - values: - _vm.rects[1][0] + - ";" + - (_vm.rects[1][0] - 40) + - ";" + - _vm.rects[1][0], - dur: "2s", - repeatCount: "indefinite" - } - }) - ] - ) - : _vm._e() - ], - 2 - ) + _c("polyline", { + staticClass: "dv-bb3-line2", + attrs: { + stroke: _vm.mergedColor[1], + points: + "10, 10 " + + (_vm.width - 16) + + ", 10 " + + (_vm.width - 16) + + ", " + + (_vm.height - 16) + + " 10, " + + (_vm.height - 16) + + " 10, 10" + } + }), + _vm._v(" "), + _c("polyline", { + staticClass: "dv-bb3-line2", + attrs: { + stroke: _vm.mergedColor[1], + points: + "16, 16 " + + (_vm.width - 10) + + ", 16 " + + (_vm.width - 10) + + ", " + + (_vm.height - 10) + + " 16, " + + (_vm.height - 10) + + " 16, 16" + } + }), + _vm._v(" "), + _c("polyline", { + staticClass: "dv-bb3-line2", + attrs: { + stroke: _vm.mergedColor[1], + points: + "22, 22 " + + (_vm.width - 4) + + ", 22 " + + (_vm.width - 4) + + ", " + + (_vm.height - 4) + + " 22, " + + (_vm.height - 4) + + " 22, 22" + } + }) + ] + ), + _vm._v(" "), + _c("div", { staticClass: "border-box-content" }, [_vm._t("default")], 2) ]) }; - var __vue_staticRenderFns__$c = []; - __vue_render__$c._withStripped = true; + var __vue_staticRenderFns__$4 = []; + __vue_render__$4._withStripped = true; /* style */ - const __vue_inject_styles__$c = function (inject) { + const __vue_inject_styles__$4 = function (inject) { if (!inject) return - inject("data-v-37b4d8de_0", { source: ".dv-decoration-1 {\n width: 100%;\n height: 100%;\n}\n.dv-decoration-1 svg {\n transform-origin: left top;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,WAAW;EACX,YAAY;AACd;AACA;EACE,0BAA0B;AAC5B","file":"main.vue","sourcesContent":[".dv-decoration-1 {\n width: 100%;\n height: 100%;\n}\n.dv-decoration-1 svg {\n transform-origin: left top;\n}\n"]}, media: undefined }); + inject("data-v-8dbfb74c_0", { source: ".dv-border-box-3 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-3 .dv-border-svg-container {\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0px;\n left: 0px;\n}\n.dv-border-box-3 .dv-border-svg-container > polyline {\n fill: none;\n}\n.dv-border-box-3 .dv-bb3-line1 {\n stroke-width: 3;\n}\n.dv-border-box-3 .dv-bb3-line2 {\n stroke-width: 1;\n}\n.dv-border-box-3 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;EACZ,QAAQ;EACR,SAAS;AACX;AACA;EACE,UAAU;AACZ;AACA;EACE,eAAe;AACjB;AACA;EACE,eAAe;AACjB;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd","file":"main.vue","sourcesContent":[".dv-border-box-3 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-3 .dv-border-svg-container {\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0px;\n left: 0px;\n}\n.dv-border-box-3 .dv-border-svg-container > polyline {\n fill: none;\n}\n.dv-border-box-3 .dv-bb3-line1 {\n stroke-width: 3;\n}\n.dv-border-box-3 .dv-bb3-line2 {\n stroke-width: 1;\n}\n.dv-border-box-3 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n"]}, media: undefined }); }; /* scoped */ - const __vue_scope_id__$c = undefined; + const __vue_scope_id__$4 = undefined; /* module identifier */ - const __vue_module_identifier__$c = undefined; + const __vue_module_identifier__$4 = undefined; /* functional template */ - const __vue_is_functional_template__$c = false; + const __vue_is_functional_template__$4 = false; /* style inject SSR */ + /* style inject shadow dom */ + - var Decoration1 = normalizeComponent_1( - { render: __vue_render__$c, staticRenderFns: __vue_staticRenderFns__$c }, - __vue_inject_styles__$c, - __vue_script__$c, - __vue_scope_id__$c, - __vue_is_functional_template__$c, - __vue_module_identifier__$c, - browser, + const __vue_component__$4 = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$4, staticRenderFns: __vue_staticRenderFns__$4 }, + __vue_inject_styles__$4, + __vue_script__$4, + __vue_scope_id__$4, + __vue_is_functional_template__$4, + __vue_module_identifier__$4, + false, + createInjector, + undefined, undefined ); - function decoration1 (Vue) { - Vue.component(Decoration1.name, Decoration1); + function borderBox3 (Vue) { + Vue.component(__vue_component__$4.name, __vue_component__$4); } // - var script$d = { - name: 'DvDecoration2', + var script$5 = { + name: 'DvBorderBox4', mixins: [autoResize], props: { + color: { + type: Array, + default: () => [] + }, reverse: { type: Boolean, default: false + }, + backgroundColor: { + type: String, + default: 'transparent' } }, data() { return { - ref: 'decoration-2', - x: 0, - y: 0, - w: 0, - h: 0 + ref: 'border-box-4', + defaultColor: ['red', 'rgba(0,0,255,0.8)'], + mergedColor: [] }; }, watch: { - reverse() { + color() { const { - calcSVGData + mergeColor } = this; - calcSVGData(); + mergeColor(); } }, methods: { - afterAutoResizeMixinInit() { - const { - calcSVGData - } = this; - calcSVGData(); - }, - - calcSVGData() { - const { - reverse, - width, - height - } = this; - - if (reverse) { - this.w = 1; - this.h = height; - this.x = width / 2; - this.y = 0; - } else { - this.w = width; - this.h = 1; - this.x = 0; - this.y = height / 2; - } - }, - - onResize() { + mergeColor() { const { - calcSVGData + color, + defaultColor } = this; - calcSVGData(); + this.mergedColor = util_2$1(util_1(defaultColor, true), color || []); } + }, + + mounted() { + const { + mergeColor + } = this; + mergeColor(); } + }; /* script */ - const __vue_script__$d = script$d; + const __vue_script__$5 = script$5; /* template */ - var __vue_render__$d = function() { + var __vue_render__$5 = function() { var _vm = this; var _h = _vm.$createElement; var _c = _vm._self._c || _h; - return _c("div", { ref: _vm.ref, staticClass: "dv-decoration-2" }, [ + return _c("div", { ref: _vm.ref, staticClass: "dv-border-box-4" }, [ _c( "svg", - { attrs: { width: _vm.width + "px", height: _vm.height + "px" } }, + { + class: "dv-border-svg-container " + (_vm.reverse && "dv-reverse"), + attrs: { width: _vm.width, height: _vm.height } + }, [ - _c( - "rect", - { - attrs: { - x: _vm.x, - y: _vm.y, - width: _vm.w, - height: _vm.h, - fill: "#3faacb" - } - }, - [ - _c("animate", { - attrs: { - attributeName: _vm.reverse ? "height" : "width", - from: "0", - to: _vm.reverse ? _vm.height : _vm.width, - dur: "6s", - calcMode: "spline", - keyTimes: "0;1", - keySplines: ".42,0,.58,1", - repeatCount: "indefinite" - } - }) - ] - ), + _c("polygon", { + attrs: { + fill: _vm.backgroundColor, + points: + "\n " + + (_vm.width - 15) + + ", 22 170, 22 150, 7 40, 7 28, 21 32, 24\n 16, 42 16, " + + (_vm.height - 32) + + " 41, " + + (_vm.height - 7) + + " " + + (_vm.width - 15) + + ", " + + (_vm.height - 7) + + "\n " + } + }), _vm._v(" "), - _c( - "rect", - { - attrs: { x: _vm.x, y: _vm.y, width: "1", height: "1", fill: "#fff" } - }, - [ - _c("animate", { - attrs: { - attributeName: _vm.reverse ? "y" : "x", - from: "0", - to: _vm.reverse ? _vm.height : _vm.width, - dur: "6s", - calcMode: "spline", - keyTimes: "0;1", - keySplines: "0.42,0,0.58,1", - repeatCount: "indefinite" - } - }) - ] - ) + _c("polyline", { + staticClass: "dv-bb4-line-1", + attrs: { + stroke: _vm.mergedColor[0], + points: + "145, " + + (_vm.height - 5) + + " 40, " + + (_vm.height - 5) + + " 10, " + + (_vm.height - 35) + + "\n 10, 40 40, 5 150, 5 170, 20 " + + (_vm.width - 15) + + ", 20" + } + }), + _vm._v(" "), + _c("polyline", { + staticClass: "dv-bb4-line-2", + attrs: { + stroke: _vm.mergedColor[1], + points: + "245, " + + (_vm.height - 1) + + " 36, " + + (_vm.height - 1) + + " 14, " + + (_vm.height - 23) + + "\n 14, " + + (_vm.height - 100) + } + }), + _vm._v(" "), + _c("polyline", { + staticClass: "dv-bb4-line-3", + attrs: { + stroke: _vm.mergedColor[0], + points: "7, " + (_vm.height - 40) + " 7, " + (_vm.height - 75) + } + }), + _vm._v(" "), + _c("polyline", { + staticClass: "dv-bb4-line-4", + attrs: { stroke: _vm.mergedColor[0], points: "28, 24 13, 41 13, 64" } + }), + _vm._v(" "), + _c("polyline", { + staticClass: "dv-bb4-line-5", + attrs: { stroke: _vm.mergedColor[0], points: "5, 45 5, 140" } + }), + _vm._v(" "), + _c("polyline", { + staticClass: "dv-bb4-line-6", + attrs: { stroke: _vm.mergedColor[1], points: "14, 75 14, 180" } + }), + _vm._v(" "), + _c("polyline", { + staticClass: "dv-bb4-line-7", + attrs: { + stroke: _vm.mergedColor[1], + points: "55, 11 147, 11 167, 26 250, 26" + } + }), + _vm._v(" "), + _c("polyline", { + staticClass: "dv-bb4-line-8", + attrs: { stroke: _vm.mergedColor[1], points: "158, 5 173, 16" } + }), + _vm._v(" "), + _c("polyline", { + staticClass: "dv-bb4-line-9", + attrs: { + stroke: _vm.mergedColor[0], + points: "200, 17 " + (_vm.width - 10) + ", 17" + } + }), + _vm._v(" "), + _c("polyline", { + staticClass: "dv-bb4-line-10", + attrs: { + stroke: _vm.mergedColor[1], + points: "385, 17 " + (_vm.width - 10) + ", 17" + } + }) ] - ) + ), + _vm._v(" "), + _c("div", { staticClass: "border-box-content" }, [_vm._t("default")], 2) ]) }; - var __vue_staticRenderFns__$d = []; - __vue_render__$d._withStripped = true; + var __vue_staticRenderFns__$5 = []; + __vue_render__$5._withStripped = true; /* style */ - const __vue_inject_styles__$d = function (inject) { + const __vue_inject_styles__$5 = function (inject) { if (!inject) return - inject("data-v-830db22e_0", { source: ".dv-decoration-2 {\n display: flex;\n width: 100%;\n height: 100%;\n justify-content: center;\n align-items: center;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,aAAa;EACb,WAAW;EACX,YAAY;EACZ,uBAAuB;EACvB,mBAAmB;AACrB","file":"main.vue","sourcesContent":[".dv-decoration-2 {\n display: flex;\n width: 100%;\n height: 100%;\n justify-content: center;\n align-items: center;\n}\n"]}, media: undefined }); + inject("data-v-229480d1_0", { source: ".dv-border-box-4 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-4 .dv-reverse {\n transform: rotate(180deg);\n}\n.dv-border-box-4 .dv-border-svg-container {\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0px;\n left: 0px;\n}\n.dv-border-box-4 .dv-border-svg-container > polyline {\n fill: none;\n}\n.dv-border-box-4 .sw1 {\n stroke-width: 1;\n}\n.dv-border-box-4 .sw3 {\n stroke-width: 3px;\n stroke-linecap: round;\n}\n.dv-border-box-4 .dv-bb4-line-1 {\n stroke-width: 1;\n}\n.dv-border-box-4 .dv-bb4-line-2 {\n stroke-width: 1;\n}\n.dv-border-box-4 .dv-bb4-line-3 {\n stroke-width: 3px;\n stroke-linecap: round;\n}\n.dv-border-box-4 .dv-bb4-line-4 {\n stroke-width: 3px;\n stroke-linecap: round;\n}\n.dv-border-box-4 .dv-bb4-line-5 {\n stroke-width: 1;\n}\n.dv-border-box-4 .dv-bb4-line-6 {\n stroke-width: 1;\n}\n.dv-border-box-4 .dv-bb4-line-7 {\n stroke-width: 1;\n}\n.dv-border-box-4 .dv-bb4-line-8 {\n stroke-width: 3px;\n stroke-linecap: round;\n}\n.dv-border-box-4 .dv-bb4-line-9 {\n stroke-width: 3px;\n stroke-linecap: round;\n stroke-dasharray: 100 250;\n}\n.dv-border-box-4 .dv-bb4-line-10 {\n stroke-width: 1;\n stroke-dasharray: 80 270;\n}\n.dv-border-box-4 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd;AACA;EACE,yBAAyB;AAC3B;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;EACZ,QAAQ;EACR,SAAS;AACX;AACA;EACE,UAAU;AACZ;AACA;EACE,eAAe;AACjB;AACA;EACE,iBAAiB;EACjB,qBAAqB;AACvB;AACA;EACE,eAAe;AACjB;AACA;EACE,eAAe;AACjB;AACA;EACE,iBAAiB;EACjB,qBAAqB;AACvB;AACA;EACE,iBAAiB;EACjB,qBAAqB;AACvB;AACA;EACE,eAAe;AACjB;AACA;EACE,eAAe;AACjB;AACA;EACE,eAAe;AACjB;AACA;EACE,iBAAiB;EACjB,qBAAqB;AACvB;AACA;EACE,iBAAiB;EACjB,qBAAqB;EACrB,yBAAyB;AAC3B;AACA;EACE,eAAe;EACf,wBAAwB;AAC1B;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd","file":"main.vue","sourcesContent":[".dv-border-box-4 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-4 .dv-reverse {\n transform: rotate(180deg);\n}\n.dv-border-box-4 .dv-border-svg-container {\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0px;\n left: 0px;\n}\n.dv-border-box-4 .dv-border-svg-container > polyline {\n fill: none;\n}\n.dv-border-box-4 .sw1 {\n stroke-width: 1;\n}\n.dv-border-box-4 .sw3 {\n stroke-width: 3px;\n stroke-linecap: round;\n}\n.dv-border-box-4 .dv-bb4-line-1 {\n stroke-width: 1;\n}\n.dv-border-box-4 .dv-bb4-line-2 {\n stroke-width: 1;\n}\n.dv-border-box-4 .dv-bb4-line-3 {\n stroke-width: 3px;\n stroke-linecap: round;\n}\n.dv-border-box-4 .dv-bb4-line-4 {\n stroke-width: 3px;\n stroke-linecap: round;\n}\n.dv-border-box-4 .dv-bb4-line-5 {\n stroke-width: 1;\n}\n.dv-border-box-4 .dv-bb4-line-6 {\n stroke-width: 1;\n}\n.dv-border-box-4 .dv-bb4-line-7 {\n stroke-width: 1;\n}\n.dv-border-box-4 .dv-bb4-line-8 {\n stroke-width: 3px;\n stroke-linecap: round;\n}\n.dv-border-box-4 .dv-bb4-line-9 {\n stroke-width: 3px;\n stroke-linecap: round;\n stroke-dasharray: 100 250;\n}\n.dv-border-box-4 .dv-bb4-line-10 {\n stroke-width: 1;\n stroke-dasharray: 80 270;\n}\n.dv-border-box-4 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n"]}, media: undefined }); }; /* scoped */ - const __vue_scope_id__$d = undefined; + const __vue_scope_id__$5 = undefined; /* module identifier */ - const __vue_module_identifier__$d = undefined; + const __vue_module_identifier__$5 = undefined; /* functional template */ - const __vue_is_functional_template__$d = false; + const __vue_is_functional_template__$5 = false; /* style inject SSR */ + /* style inject shadow dom */ + - var Decoration2 = normalizeComponent_1( - { render: __vue_render__$d, staticRenderFns: __vue_staticRenderFns__$d }, - __vue_inject_styles__$d, - __vue_script__$d, - __vue_scope_id__$d, - __vue_is_functional_template__$d, - __vue_module_identifier__$d, - browser, + const __vue_component__$5 = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$5, staticRenderFns: __vue_staticRenderFns__$5 }, + __vue_inject_styles__$5, + __vue_script__$5, + __vue_scope_id__$5, + __vue_is_functional_template__$5, + __vue_module_identifier__$5, + false, + createInjector, + undefined, undefined ); - function decoration2 (Vue) { - Vue.component(Decoration2.name, Decoration2); + function borderBox4 (Vue) { + Vue.component(__vue_component__$5.name, __vue_component__$5); } // - var script$e = { - name: 'DvDecoration3', + var script$6 = { + name: 'DvBorderBox5', mixins: [autoResize], + props: { + color: { + type: Array, + default: () => [] + }, + reverse: { + type: Boolean, + default: false + }, + backgroundColor: { + type: String, + default: 'transparent' + } + }, data() { - const pointSideLength = 7; return { - ref: 'decoration-3', - svgWH: [300, 35], - svgScale: [1, 1], - rowNum: 2, - rowPoints: 25, - pointSideLength, - halfPointSideLength: pointSideLength / 2, - points: [] + ref: 'border-box-5', + defaultColor: ['rgba(255, 255, 255, 0.35)', 'rgba(255, 255, 255, 0.20)'], + mergedColor: [] }; }, - methods: { - afterAutoResizeMixinInit() { - const { - calcSVGData - } = this; - calcSVGData(); - }, - - calcSVGData() { - const { - calcPointsPosition, - calcScale - } = this; - calcPointsPosition(); - calcScale(); - }, - - calcPointsPosition() { - const { - svgWH, - rowNum, - rowPoints - } = this; - const [w, h] = svgWH; - const horizontalGap = w / (rowPoints + 1); - const verticalGap = h / (rowNum + 1); - let points = new Array(rowNum).fill(0).map((foo, i) => new Array(rowPoints).fill(0).map((foo, j) => [horizontalGap * (j + 1), verticalGap * (i + 1)])); - this.points = points.reduce((all, item) => [...all, ...item], []); - }, - - calcScale() { + watch: { + color() { const { - width, - height, - svgWH + mergeColor } = this; - const [w, h] = svgWH; - this.svgScale = [width / w, height / h]; - }, + mergeColor(); + } - onResize() { + }, + methods: { + mergeColor() { const { - calcSVGData + color, + defaultColor } = this; - calcSVGData(); + this.mergedColor = util_2$1(util_1(defaultColor, true), color || []); } + }, + + mounted() { + const { + mergeColor + } = this; + mergeColor(); } + }; /* script */ - const __vue_script__$e = script$e; + const __vue_script__$6 = script$6; /* template */ - var __vue_render__$e = function() { + var __vue_render__$6 = function() { var _vm = this; var _h = _vm.$createElement; var _c = _vm._self._c || _h; - return _c("div", { ref: _vm.ref, staticClass: "dv-decoration-3" }, [ + return _c("div", { ref: _vm.ref, staticClass: "dv-border-box-5" }, [ _c( "svg", { - style: - "transform:scale(" + _vm.svgScale[0] + "," + _vm.svgScale[1] + ");", - attrs: { width: _vm.svgWH[0] + "px", height: _vm.svgWH[1] + "px" } + class: "dv-border-svg-container " + (_vm.reverse && "dv-reverse"), + attrs: { width: _vm.width, height: _vm.height } }, [ - _vm._l(_vm.points, function(point, i) { - return [ - _c( - "rect", - { - key: i, - attrs: { - fill: "#7acaec", - x: point[0] - _vm.halfPointSideLength, - y: point[1] - _vm.halfPointSideLength, - width: _vm.pointSideLength, - height: _vm.pointSideLength - } - }, - [ - Math.random() > 0.6 - ? _c("animate", { - attrs: { - attributeName: "fill", - values: "#7acaec;transparent", - dur: Math.random() + 1 + "s", - begin: Math.random() * 2, - repeatCount: "indefinite" - } - }) - : _vm._e() - ] - ) - ] - }) - ], - 2 - ) - ]) - }; - var __vue_staticRenderFns__$e = []; - __vue_render__$e._withStripped = true; - - /* style */ - const __vue_inject_styles__$e = function (inject) { - if (!inject) return - inject("data-v-557fdf18_0", { source: ".dv-decoration-3 {\n width: 100%;\n height: 100%;\n}\n.dv-decoration-3 svg {\n transform-origin: left top;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,WAAW;EACX,YAAY;AACd;AACA;EACE,0BAA0B;AAC5B","file":"main.vue","sourcesContent":[".dv-decoration-3 {\n width: 100%;\n height: 100%;\n}\n.dv-decoration-3 svg {\n transform-origin: left top;\n}\n"]}, media: undefined }); - - }; - /* scoped */ - const __vue_scope_id__$e = undefined; - /* module identifier */ - const __vue_module_identifier__$e = undefined; - /* functional template */ - const __vue_is_functional_template__$e = false; - /* style inject SSR */ - - - - var Decoration3 = normalizeComponent_1( - { render: __vue_render__$e, staticRenderFns: __vue_staticRenderFns__$e }, - __vue_inject_styles__$e, - __vue_script__$e, - __vue_scope_id__$e, - __vue_is_functional_template__$e, - __vue_module_identifier__$e, - browser, - undefined - ); - - function decoration3 (Vue) { - Vue.component(Decoration3.name, Decoration3); - } - - // - var script$f = { - name: 'DvDecoration4', - mixins: [autoResize], - props: ['reverse'], - - data() { - return { - ref: 'decoration-4' - }; - } - - }; - - /* script */ - const __vue_script__$f = script$f; - - /* template */ - var __vue_render__$f = function() { - var _vm = this; - var _h = _vm.$createElement; - var _c = _vm._self._c || _h; - return _c("div", { ref: _vm.ref, staticClass: "dv-decoration-4" }, [ - _c( - "div", - { - class: "container " + (_vm.reverse ? "reverse" : "normal"), - style: _vm.reverse - ? "width:" + _vm.width + "px;height:5px" - : "width:5px;height:" + _vm.height + "px;" - }, - [ - _c( - "svg", - { - attrs: { - width: _vm.reverse ? _vm.width : 5, - height: _vm.reverse ? 5 : _vm.height - } - }, - [ - _c("polyline", { - attrs: { - stroke: "rgba(255, 255, 255, 0.3)", - points: _vm.reverse - ? "0, 2.5 " + _vm.width + ", 2.5" - : "2.5, 0 2.5, " + _vm.height - } - }), - _vm._v(" "), - _c("polyline", { - staticClass: "bold-line", - attrs: { - stroke: "rgba(255, 255, 255, 0.3)", - "stroke-width": "3", - "stroke-dasharray": "20, 80", - "stroke-dashoffset": "-30", - points: _vm.reverse - ? "0, 2.5 " + _vm.width + ", 2.5" - : "2.5, 0 2.5, " + _vm.height - } - }) - ] - ) + _c("polygon", { + attrs: { + fill: _vm.backgroundColor, + points: + "\n 10, 22 " + + (_vm.width - 22) + + ", 22 " + + (_vm.width - 22) + + ", " + + (_vm.height - 86) + + " " + + (_vm.width - 84) + + ", " + + (_vm.height - 24) + + " 10, " + + (_vm.height - 24) + + "\n " + } + }), + _vm._v(" "), + _c("polyline", { + staticClass: "dv-bb5-line-1", + attrs: { + stroke: _vm.mergedColor[0], + points: + "8, 5 " + + (_vm.width - 5) + + ", 5 " + + (_vm.width - 5) + + ", " + + (_vm.height - 100) + + "\n " + + (_vm.width - 100) + + ", " + + (_vm.height - 5) + + " 8, " + + (_vm.height - 5) + + " 8, 5" + } + }), + _vm._v(" "), + _c("polyline", { + staticClass: "dv-bb5-line-2", + attrs: { + stroke: _vm.mergedColor[1], + points: + "3, 5 " + + (_vm.width - 20) + + ", 5 " + + (_vm.width - 20) + + ", " + + (_vm.height - 60) + + "\n " + + (_vm.width - 74) + + ", " + + (_vm.height - 5) + + " 3, " + + (_vm.height - 5) + + " 3, 5" + } + }), + _vm._v(" "), + _c("polyline", { + staticClass: "dv-bb5-line-3", + attrs: { + stroke: _vm.mergedColor[1], + points: "50, 13 " + (_vm.width - 35) + ", 13" + } + }), + _vm._v(" "), + _c("polyline", { + staticClass: "dv-bb5-line-4", + attrs: { + stroke: _vm.mergedColor[1], + points: "15, 20 " + (_vm.width - 35) + ", 20" + } + }), + _vm._v(" "), + _c("polyline", { + staticClass: "dv-bb5-line-5", + attrs: { + stroke: _vm.mergedColor[1], + points: + "15, " + + (_vm.height - 20) + + " " + + (_vm.width - 110) + + ", " + + (_vm.height - 20) + } + }), + _vm._v(" "), + _c("polyline", { + staticClass: "dv-bb5-line-6", + attrs: { + stroke: _vm.mergedColor[1], + points: + "15, " + + (_vm.height - 13) + + " " + + (_vm.width - 110) + + ", " + + (_vm.height - 13) + } + }) ] - ) + ), + _vm._v(" "), + _c("div", { staticClass: "border-box-content" }, [_vm._t("default")], 2) ]) }; - var __vue_staticRenderFns__$f = []; - __vue_render__$f._withStripped = true; + var __vue_staticRenderFns__$6 = []; + __vue_render__$6._withStripped = true; /* style */ - const __vue_inject_styles__$f = function (inject) { + const __vue_inject_styles__$6 = function (inject) { if (!inject) return - inject("data-v-15cdd0b4_0", { source: ".dv-decoration-4 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-decoration-4 .container {\n display: flex;\n overflow: hidden;\n position: absolute;\n}\n.dv-decoration-4 .normal {\n height: 0% !important;\n animation: ani-height 3s ease-in-out infinite;\n left: 50%;\n margin-left: -2px;\n}\n.dv-decoration-4 .reverse {\n width: 0% !important;\n animation: ani-width 3s ease-in-out infinite;\n top: 50%;\n margin-top: -2px;\n}\n@keyframes ani-height {\n70% {\n height: 100%;\n}\n100% {\n height: 100%;\n}\n}\n@keyframes ani-width {\n70% {\n width: 100%;\n}\n100% {\n width: 100%;\n}\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd;AACA;EACE,aAAa;EACb,gBAAgB;EAChB,kBAAkB;AACpB;AACA;EACE,qBAAqB;EACrB,6CAA6C;EAC7C,SAAS;EACT,iBAAiB;AACnB;AACA;EACE,oBAAoB;EACpB,4CAA4C;EAC5C,QAAQ;EACR,gBAAgB;AAClB;AACA;AACE;IACE,YAAY;AACd;AACA;IACE,YAAY;AACd;AACF;AACA;AACE;IACE,WAAW;AACb;AACA;IACE,WAAW;AACb;AACF","file":"main.vue","sourcesContent":[".dv-decoration-4 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-decoration-4 .container {\n display: flex;\n overflow: hidden;\n position: absolute;\n}\n.dv-decoration-4 .normal {\n height: 0% !important;\n animation: ani-height 3s ease-in-out infinite;\n left: 50%;\n margin-left: -2px;\n}\n.dv-decoration-4 .reverse {\n width: 0% !important;\n animation: ani-width 3s ease-in-out infinite;\n top: 50%;\n margin-top: -2px;\n}\n@keyframes ani-height {\n 70% {\n height: 100%;\n }\n 100% {\n height: 100%;\n }\n}\n@keyframes ani-width {\n 70% {\n width: 100%;\n }\n 100% {\n width: 100%;\n }\n}\n"]}, media: undefined }); + inject("data-v-5e711d00_0", { source: ".dv-border-box-5 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-5 .dv-reverse {\n transform: rotate(180deg);\n}\n.dv-border-box-5 .dv-border-svg-container {\n position: absolute;\n top: 0px;\n left: 0px;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-5 .dv-border-svg-container > polyline {\n fill: none;\n}\n.dv-border-box-5 .dv-bb5-line-1,\n.dv-border-box-5 .dv-bb5-line-2 {\n stroke-width: 1;\n}\n.dv-border-box-5 .dv-bb5-line-3,\n.dv-border-box-5 .dv-bb5-line-6 {\n stroke-width: 5;\n}\n.dv-border-box-5 .dv-bb5-line-4,\n.dv-border-box-5 .dv-bb5-line-5 {\n stroke-width: 2;\n}\n.dv-border-box-5 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd;AACA;EACE,yBAAyB;AAC3B;AACA;EACE,kBAAkB;EAClB,QAAQ;EACR,SAAS;EACT,WAAW;EACX,YAAY;AACd;AACA;EACE,UAAU;AACZ;AACA;;EAEE,eAAe;AACjB;AACA;;EAEE,eAAe;AACjB;AACA;;EAEE,eAAe;AACjB;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd","file":"main.vue","sourcesContent":[".dv-border-box-5 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-5 .dv-reverse {\n transform: rotate(180deg);\n}\n.dv-border-box-5 .dv-border-svg-container {\n position: absolute;\n top: 0px;\n left: 0px;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-5 .dv-border-svg-container > polyline {\n fill: none;\n}\n.dv-border-box-5 .dv-bb5-line-1,\n.dv-border-box-5 .dv-bb5-line-2 {\n stroke-width: 1;\n}\n.dv-border-box-5 .dv-bb5-line-3,\n.dv-border-box-5 .dv-bb5-line-6 {\n stroke-width: 5;\n}\n.dv-border-box-5 .dv-bb5-line-4,\n.dv-border-box-5 .dv-bb5-line-5 {\n stroke-width: 2;\n}\n.dv-border-box-5 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n"]}, media: undefined }); }; /* scoped */ - const __vue_scope_id__$f = undefined; + const __vue_scope_id__$6 = undefined; /* module identifier */ - const __vue_module_identifier__$f = undefined; + const __vue_module_identifier__$6 = undefined; /* functional template */ - const __vue_is_functional_template__$f = false; + const __vue_is_functional_template__$6 = false; /* style inject SSR */ + /* style inject shadow dom */ + - var Decoration4 = normalizeComponent_1( - { render: __vue_render__$f, staticRenderFns: __vue_staticRenderFns__$f }, - __vue_inject_styles__$f, - __vue_script__$f, - __vue_scope_id__$f, - __vue_is_functional_template__$f, - __vue_module_identifier__$f, - browser, + const __vue_component__$6 = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$6, staticRenderFns: __vue_staticRenderFns__$6 }, + __vue_inject_styles__$6, + __vue_script__$6, + __vue_scope_id__$6, + __vue_is_functional_template__$6, + __vue_module_identifier__$6, + false, + createInjector, + undefined, undefined ); - function decoration4 (Vue) { - Vue.component(Decoration4.name, Decoration4); - } - - function unwrapExports (x) { - return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; - } - - function createCommonjsModule(fn, module) { - return module = { exports: {} }, fn(module, module.exports), module.exports; + function borderBox5 (Vue) { + Vue.component(__vue_component__$6.name, __vue_component__$6); } - var _global = createCommonjsModule(function (module) { - // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 - var global = module.exports = typeof window != 'undefined' && window.Math == Math - ? window : typeof self != 'undefined' && self.Math == Math ? self - // eslint-disable-next-line no-new-func - : Function('return this')(); - if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef - }); - - var _core = createCommonjsModule(function (module) { - var core = module.exports = { version: '2.6.9' }; - if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef - }); - var _core_1 = _core.version; - - var _isObject = function (it) { - return typeof it === 'object' ? it !== null : typeof it === 'function'; - }; - - var _anObject = function (it) { - if (!_isObject(it)) throw TypeError(it + ' is not an object!'); - return it; - }; - - var _fails = function (exec) { - try { - return !!exec(); - } catch (e) { - return true; - } - }; - - // Thank's IE8 for his funny defineProperty - var _descriptors = !_fails(function () { - return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; - }); - - var document$1 = _global.document; - // typeof document.createElement is 'object' in old IE - var is = _isObject(document$1) && _isObject(document$1.createElement); - var _domCreate = function (it) { - return is ? document$1.createElement(it) : {}; - }; - - var _ie8DomDefine = !_descriptors && !_fails(function () { - return Object.defineProperty(_domCreate('div'), 'a', { get: function () { return 7; } }).a != 7; - }); - - // 7.1.1 ToPrimitive(input [, PreferredType]) - - // instead of the ES6 spec version, we didn't implement @@toPrimitive case - // and the second argument - flag - preferred type is a string - var _toPrimitive = function (it, S) { - if (!_isObject(it)) return it; - var fn, val; - if (S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) return val; - if (typeof (fn = it.valueOf) == 'function' && !_isObject(val = fn.call(it))) return val; - if (!S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) return val; - throw TypeError("Can't convert object to primitive value"); - }; - - var dP = Object.defineProperty; - - var f = _descriptors ? Object.defineProperty : function defineProperty(O, P, Attributes) { - _anObject(O); - P = _toPrimitive(P, true); - _anObject(Attributes); - if (_ie8DomDefine) try { - return dP(O, P, Attributes); - } catch (e) { /* empty */ } - if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!'); - if ('value' in Attributes) O[P] = Attributes.value; - return O; - }; - - var _objectDp = { - f: f - }; - - var _propertyDesc = function (bitmap, value) { - return { - enumerable: !(bitmap & 1), - configurable: !(bitmap & 2), - writable: !(bitmap & 4), - value: value - }; - }; - - var _hide = _descriptors ? function (object, key, value) { - return _objectDp.f(object, key, _propertyDesc(1, value)); - } : function (object, key, value) { - object[key] = value; - return object; - }; - - var hasOwnProperty = {}.hasOwnProperty; - var _has = function (it, key) { - return hasOwnProperty.call(it, key); - }; - - var id = 0; - var px = Math.random(); - var _uid = function (key) { - return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); - }; - - var _library = false; - - var _shared = createCommonjsModule(function (module) { - var SHARED = '__core-js_shared__'; - var store = _global[SHARED] || (_global[SHARED] = {}); - - (module.exports = function (key, value) { - return store[key] || (store[key] = value !== undefined ? value : {}); - })('versions', []).push({ - version: _core.version, - mode: 'global', - copyright: '© 2019 Denis Pushkarev (zloirock.ru)' - }); - }); + // + var script$7 = { + name: 'DvBorderBox6', + mixins: [autoResize], + props: { + color: { + type: Array, + default: () => [] + }, + backgroundColor: { + type: String, + default: 'transparent' + } + }, - var _functionToString = _shared('native-function-to-string', Function.toString); + data() { + return { + ref: 'border-box-6', + defaultColor: ['rgba(255, 255, 255, 0.35)', 'gray'], + mergedColor: [] + }; + }, - var _redefine = createCommonjsModule(function (module) { - var SRC = _uid('src'); + watch: { + color() { + const { + mergeColor + } = this; + mergeColor(); + } - var TO_STRING = 'toString'; - var TPL = ('' + _functionToString).split(TO_STRING); + }, + methods: { + mergeColor() { + const { + color, + defaultColor + } = this; + this.mergedColor = util_2$1(util_1(defaultColor, true), color || []); + } - _core.inspectSource = function (it) { - return _functionToString.call(it); - }; + }, - (module.exports = function (O, key, val, safe) { - var isFunction = typeof val == 'function'; - if (isFunction) _has(val, 'name') || _hide(val, 'name', key); - if (O[key] === val) return; - if (isFunction) _has(val, SRC) || _hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key))); - if (O === _global) { - O[key] = val; - } else if (!safe) { - delete O[key]; - _hide(O, key, val); - } else if (O[key]) { - O[key] = val; - } else { - _hide(O, key, val); + mounted() { + const { + mergeColor + } = this; + mergeColor(); } - // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative - })(Function.prototype, TO_STRING, function toString() { - return typeof this == 'function' && this[SRC] || _functionToString.call(this); - }); - }); - var _aFunction = function (it) { - if (typeof it != 'function') throw TypeError(it + ' is not a function!'); - return it; }; - // optional / simple context binding + /* script */ + const __vue_script__$7 = script$7; - var _ctx = function (fn, that, length) { - _aFunction(fn); - if (that === undefined) return fn; - switch (length) { - case 1: return function (a) { - return fn.call(that, a); - }; - case 2: return function (a, b) { - return fn.call(that, a, b); - }; - case 3: return function (a, b, c) { - return fn.call(that, a, b, c); - }; - } - return function (/* ...args */) { - return fn.apply(that, arguments); - }; - }; - - var PROTOTYPE = 'prototype'; - - var $export = function (type, name, source) { - var IS_FORCED = type & $export.F; - var IS_GLOBAL = type & $export.G; - var IS_STATIC = type & $export.S; - var IS_PROTO = type & $export.P; - var IS_BIND = type & $export.B; - var target = IS_GLOBAL ? _global : IS_STATIC ? _global[name] || (_global[name] = {}) : (_global[name] || {})[PROTOTYPE]; - var exports = IS_GLOBAL ? _core : _core[name] || (_core[name] = {}); - var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {}); - var key, own, out, exp; - if (IS_GLOBAL) source = name; - for (key in source) { - // contains in native - own = !IS_FORCED && target && target[key] !== undefined; - // export native or passed - out = (own ? target : source)[key]; - // bind timers to global for call from export context - exp = IS_BIND && own ? _ctx(out, _global) : IS_PROTO && typeof out == 'function' ? _ctx(Function.call, out) : out; - // extend global - if (target) _redefine(target, key, out, type & $export.U); - // export - if (exports[key] != out) _hide(exports, key, exp); - if (IS_PROTO && expProto[key] != out) expProto[key] = out; - } - }; - _global.core = _core; - // type bitmap - $export.F = 1; // forced - $export.G = 2; // global - $export.S = 4; // static - $export.P = 8; // proto - $export.B = 16; // bind - $export.W = 32; // wrap - $export.U = 64; // safe - $export.R = 128; // real proto method for `library` - var _export = $export; - - // 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes) - _export(_export.S + _export.F * !_descriptors, 'Object', { defineProperty: _objectDp.f }); - - // 7.1.4 ToInteger - var ceil = Math.ceil; - var floor = Math.floor; - var _toInteger = function (it) { - return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); + /* template */ + var __vue_render__$7 = function() { + var _vm = this; + var _h = _vm.$createElement; + var _c = _vm._self._c || _h; + return _c("div", { ref: _vm.ref, staticClass: "dv-border-box-6" }, [ + _c( + "svg", + { + staticClass: "dv-border-svg-container", + attrs: { width: _vm.width, height: _vm.height } + }, + [ + _c("polygon", { + attrs: { + fill: _vm.backgroundColor, + points: + "\n 9, 7 " + + (_vm.width - 9) + + ", 7 " + + (_vm.width - 9) + + ", " + + (_vm.height - 7) + + " 9, " + + (_vm.height - 7) + + "\n " + } + }), + _vm._v(" "), + _c("circle", { + attrs: { fill: _vm.mergedColor[1], cx: "5", cy: "5", r: "2" } + }), + _vm._v(" "), + _c("circle", { + attrs: { + fill: _vm.mergedColor[1], + cx: _vm.width - 5, + cy: "5", + r: "2" + } + }), + _vm._v(" "), + _c("circle", { + attrs: { + fill: _vm.mergedColor[1], + cx: _vm.width - 5, + cy: _vm.height - 5, + r: "2" + } + }), + _vm._v(" "), + _c("circle", { + attrs: { + fill: _vm.mergedColor[1], + cx: "5", + cy: _vm.height - 5, + r: "2" + } + }), + _vm._v(" "), + _c("polyline", { + attrs: { + stroke: _vm.mergedColor[0], + points: "10, 4 " + (_vm.width - 10) + ", 4" + } + }), + _vm._v(" "), + _c("polyline", { + attrs: { + stroke: _vm.mergedColor[0], + points: + "10, " + + (_vm.height - 4) + + " " + + (_vm.width - 10) + + ", " + + (_vm.height - 4) + } + }), + _vm._v(" "), + _c("polyline", { + attrs: { + stroke: _vm.mergedColor[0], + points: "5, 70 5, " + (_vm.height - 70) + } + }), + _vm._v(" "), + _c("polyline", { + attrs: { + stroke: _vm.mergedColor[0], + points: + _vm.width - + 5 + + ", 70 " + + (_vm.width - 5) + + ", " + + (_vm.height - 70) + } + }), + _vm._v(" "), + _c("polyline", { + attrs: { stroke: _vm.mergedColor[0], points: "3, 10, 3, 50" } + }), + _vm._v(" "), + _c("polyline", { + attrs: { stroke: _vm.mergedColor[0], points: "7, 30 7, 80" } + }), + _vm._v(" "), + _c("polyline", { + attrs: { + stroke: _vm.mergedColor[0], + points: _vm.width - 3 + ", 10 " + (_vm.width - 3) + ", 50" + } + }), + _vm._v(" "), + _c("polyline", { + attrs: { + stroke: _vm.mergedColor[0], + points: _vm.width - 7 + ", 30 " + (_vm.width - 7) + ", 80" + } + }), + _vm._v(" "), + _c("polyline", { + attrs: { + stroke: _vm.mergedColor[0], + points: "3, " + (_vm.height - 10) + " 3, " + (_vm.height - 50) + } + }), + _vm._v(" "), + _c("polyline", { + attrs: { + stroke: _vm.mergedColor[0], + points: "7, " + (_vm.height - 30) + " 7, " + (_vm.height - 80) + } + }), + _vm._v(" "), + _c("polyline", { + attrs: { + stroke: _vm.mergedColor[0], + points: + _vm.width - + 3 + + ", " + + (_vm.height - 10) + + " " + + (_vm.width - 3) + + ", " + + (_vm.height - 50) + } + }), + _vm._v(" "), + _c("polyline", { + attrs: { + stroke: _vm.mergedColor[0], + points: + _vm.width - + 7 + + ", " + + (_vm.height - 30) + + " " + + (_vm.width - 7) + + ", " + + (_vm.height - 80) + } + }) + ] + ), + _vm._v(" "), + _c("div", { staticClass: "border-box-content" }, [_vm._t("default")], 2) + ]) }; + var __vue_staticRenderFns__$7 = []; + __vue_render__$7._withStripped = true; - // 7.2.1 RequireObjectCoercible(argument) - var _defined = function (it) { - if (it == undefined) throw TypeError("Can't call method on " + it); - return it; - }; + /* style */ + const __vue_inject_styles__$7 = function (inject) { + if (!inject) return + inject("data-v-715598fc_0", { source: ".dv-border-box-6 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-6 .dv-border-svg-container {\n position: absolute;\n top: 0px;\n left: 0px;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-6 .dv-border-svg-container > polyline {\n fill: none;\n stroke-width: 1;\n}\n.dv-border-box-6 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd;AACA;EACE,kBAAkB;EAClB,QAAQ;EACR,SAAS;EACT,WAAW;EACX,YAAY;AACd;AACA;EACE,UAAU;EACV,eAAe;AACjB;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd","file":"main.vue","sourcesContent":[".dv-border-box-6 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-6 .dv-border-svg-container {\n position: absolute;\n top: 0px;\n left: 0px;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-6 .dv-border-svg-container > polyline {\n fill: none;\n stroke-width: 1;\n}\n.dv-border-box-6 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n"]}, media: undefined }); - // true -> String#at - // false -> String#codePointAt - var _stringAt = function (TO_STRING) { - return function (that, pos) { - var s = String(_defined(that)); - var i = _toInteger(pos); - var l = s.length; - var a, b; - if (i < 0 || i >= l) return TO_STRING ? '' : undefined; - a = s.charCodeAt(i); - return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff - ? TO_STRING ? s.charAt(i) : a - : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; }; - }; - - var _iterators = {}; - - var toString = {}.toString; - - var _cof = function (it) { - return toString.call(it).slice(8, -1); - }; + /* scoped */ + const __vue_scope_id__$7 = undefined; + /* module identifier */ + const __vue_module_identifier__$7 = undefined; + /* functional template */ + const __vue_is_functional_template__$7 = false; + /* style inject SSR */ + + /* style inject shadow dom */ + - // fallback for non-array-like ES3 and non-enumerable old V8 strings + + const __vue_component__$7 = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$7, staticRenderFns: __vue_staticRenderFns__$7 }, + __vue_inject_styles__$7, + __vue_script__$7, + __vue_scope_id__$7, + __vue_is_functional_template__$7, + __vue_module_identifier__$7, + false, + createInjector, + undefined, + undefined + ); - // eslint-disable-next-line no-prototype-builtins - var _iobject = Object('z').propertyIsEnumerable(0) ? Object : function (it) { - return _cof(it) == 'String' ? it.split('') : Object(it); - }; + function borderBox6 (Vue) { + Vue.component(__vue_component__$7.name, __vue_component__$7); + } - // to indexed object, toObject with fallback for non-array-like ES3 strings + // + var script$8 = { + name: 'DvBorderBox7', + mixins: [autoResize], + props: { + color: { + type: Array, + default: () => [] + }, + backgroundColor: { + type: String, + default: 'transparent' + } + }, + data() { + return { + ref: 'border-box-7', + defaultColor: ['rgba(128,128,128,0.3)', 'rgba(128,128,128,0.5)'], + mergedColor: [] + }; + }, - var _toIobject = function (it) { - return _iobject(_defined(it)); - }; + watch: { + color() { + const { + mergeColor + } = this; + mergeColor(); + } - // 7.1.15 ToLength + }, + methods: { + mergeColor() { + const { + color, + defaultColor + } = this; + this.mergedColor = util_2$1(util_1(defaultColor, true), color || []); + } - var min = Math.min; - var _toLength = function (it) { - return it > 0 ? min(_toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 - }; + }, - var max = Math.max; - var min$1 = Math.min; - var _toAbsoluteIndex = function (index, length) { - index = _toInteger(index); - return index < 0 ? max(index + length, 0) : min$1(index, length); - }; + mounted() { + const { + mergeColor + } = this; + mergeColor(); + } - // false -> Array#indexOf - // true -> Array#includes - - - - var _arrayIncludes = function (IS_INCLUDES) { - return function ($this, el, fromIndex) { - var O = _toIobject($this); - var length = _toLength(O.length); - var index = _toAbsoluteIndex(fromIndex, length); - var value; - // Array#includes uses SameValueZero equality algorithm - // eslint-disable-next-line no-self-compare - if (IS_INCLUDES && el != el) while (length > index) { - value = O[index++]; - // eslint-disable-next-line no-self-compare - if (value != value) return true; - // Array#indexOf ignores holes, Array#includes - not - } else for (;length > index; index++) if (IS_INCLUDES || index in O) { - if (O[index] === el) return IS_INCLUDES || index || 0; - } return !IS_INCLUDES && -1; - }; }; - var shared = _shared('keys'); + /* script */ + const __vue_script__$8 = script$8; - var _sharedKey = function (key) { - return shared[key] || (shared[key] = _uid(key)); + /* template */ + var __vue_render__$8 = function() { + var _vm = this; + var _h = _vm.$createElement; + var _c = _vm._self._c || _h; + return _c( + "div", + { + ref: _vm.ref, + staticClass: "dv-border-box-7", + style: + "box-shadow: inset 0 0 40px " + + _vm.mergedColor[0] + + "; border: 1px solid " + + _vm.mergedColor[0] + + "; background-color: " + + _vm.backgroundColor + }, + [ + _c( + "svg", + { + staticClass: "dv-border-svg-container", + attrs: { width: _vm.width, height: _vm.height } + }, + [ + _c("polyline", { + staticClass: "dv-bb7-line-width-2", + attrs: { stroke: _vm.mergedColor[0], points: "0, 25 0, 0 25, 0" } + }), + _vm._v(" "), + _c("polyline", { + staticClass: "dv-bb7-line-width-2", + attrs: { + stroke: _vm.mergedColor[0], + points: + _vm.width - + 25 + + ", 0 " + + _vm.width + + ", 0 " + + _vm.width + + ", 25" + } + }), + _vm._v(" "), + _c("polyline", { + staticClass: "dv-bb7-line-width-2", + attrs: { + stroke: _vm.mergedColor[0], + points: + _vm.width - + 25 + + ", " + + _vm.height + + " " + + _vm.width + + ", " + + _vm.height + + " " + + _vm.width + + ", " + + (_vm.height - 25) + } + }), + _vm._v(" "), + _c("polyline", { + staticClass: "dv-bb7-line-width-2", + attrs: { + stroke: _vm.mergedColor[0], + points: + "0, " + + (_vm.height - 25) + + " 0, " + + _vm.height + + " 25, " + + _vm.height + } + }), + _vm._v(" "), + _c("polyline", { + staticClass: "dv-bb7-line-width-5", + attrs: { stroke: _vm.mergedColor[1], points: "0, 10 0, 0 10, 0" } + }), + _vm._v(" "), + _c("polyline", { + staticClass: "dv-bb7-line-width-5", + attrs: { + stroke: _vm.mergedColor[1], + points: + _vm.width - + 10 + + ", 0 " + + _vm.width + + ", 0 " + + _vm.width + + ", 10" + } + }), + _vm._v(" "), + _c("polyline", { + staticClass: "dv-bb7-line-width-5", + attrs: { + stroke: _vm.mergedColor[1], + points: + _vm.width - + 10 + + ", " + + _vm.height + + " " + + _vm.width + + ", " + + _vm.height + + " " + + _vm.width + + ", " + + (_vm.height - 10) + } + }), + _vm._v(" "), + _c("polyline", { + staticClass: "dv-bb7-line-width-5", + attrs: { + stroke: _vm.mergedColor[1], + points: + "0, " + + (_vm.height - 10) + + " 0, " + + _vm.height + + " 10, " + + _vm.height + } + }) + ] + ), + _vm._v(" "), + _c("div", { staticClass: "border-box-content" }, [_vm._t("default")], 2) + ] + ) }; + var __vue_staticRenderFns__$8 = []; + __vue_render__$8._withStripped = true; - var arrayIndexOf = _arrayIncludes(false); - var IE_PROTO = _sharedKey('IE_PROTO'); - - var _objectKeysInternal = function (object, names) { - var O = _toIobject(object); - var i = 0; - var result = []; - var key; - for (key in O) if (key != IE_PROTO) _has(O, key) && result.push(key); - // Don't enum bug & hidden keys - while (names.length > i) if (_has(O, key = names[i++])) { - ~arrayIndexOf(result, key) || result.push(key); - } - return result; - }; - - // IE 8- don't enum bug keys - var _enumBugKeys = ( - 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' - ).split(','); - - // 19.1.2.14 / 15.2.3.14 Object.keys(O) - + /* style */ + const __vue_inject_styles__$8 = function (inject) { + if (!inject) return + inject("data-v-21156cd2_0", { source: ".dv-border-box-7 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-7 .dv-border-svg-container {\n position: absolute;\n top: 0px;\n left: 0px;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-7 .dv-border-svg-container > polyline {\n fill: none;\n stroke-linecap: round;\n}\n.dv-border-box-7 .dv-bb7-line-width-2 {\n stroke-width: 2;\n}\n.dv-border-box-7 .dv-bb7-line-width-5 {\n stroke-width: 5;\n}\n.dv-border-box-7 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd;AACA;EACE,kBAAkB;EAClB,QAAQ;EACR,SAAS;EACT,WAAW;EACX,YAAY;AACd;AACA;EACE,UAAU;EACV,qBAAqB;AACvB;AACA;EACE,eAAe;AACjB;AACA;EACE,eAAe;AACjB;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd","file":"main.vue","sourcesContent":[".dv-border-box-7 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-7 .dv-border-svg-container {\n position: absolute;\n top: 0px;\n left: 0px;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-7 .dv-border-svg-container > polyline {\n fill: none;\n stroke-linecap: round;\n}\n.dv-border-box-7 .dv-bb7-line-width-2 {\n stroke-width: 2;\n}\n.dv-border-box-7 .dv-bb7-line-width-5 {\n stroke-width: 5;\n}\n.dv-border-box-7 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n"]}, media: undefined }); + }; + /* scoped */ + const __vue_scope_id__$8 = undefined; + /* module identifier */ + const __vue_module_identifier__$8 = undefined; + /* functional template */ + const __vue_is_functional_template__$8 = false; + /* style inject SSR */ + + /* style inject shadow dom */ + - var _objectKeys = Object.keys || function keys(O) { - return _objectKeysInternal(O, _enumBugKeys); - }; + + const __vue_component__$8 = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$8, staticRenderFns: __vue_staticRenderFns__$8 }, + __vue_inject_styles__$8, + __vue_script__$8, + __vue_scope_id__$8, + __vue_is_functional_template__$8, + __vue_module_identifier__$8, + false, + createInjector, + undefined, + undefined + ); - var _objectDps = _descriptors ? Object.defineProperties : function defineProperties(O, Properties) { - _anObject(O); - var keys = _objectKeys(Properties); - var length = keys.length; - var i = 0; - var P; - while (length > i) _objectDp.f(O, P = keys[i++], Properties[P]); - return O; - }; + function borderBox7 (Vue) { + Vue.component(__vue_component__$8.name, __vue_component__$8); + } - var document$2 = _global.document; - var _html = document$2 && document$2.documentElement; - - // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) - - - - var IE_PROTO$1 = _sharedKey('IE_PROTO'); - var Empty = function () { /* empty */ }; - var PROTOTYPE$1 = 'prototype'; - - // Create object with fake `null` prototype: use iframe Object with cleared prototype - var createDict = function () { - // Thrash, waste and sodomy: IE GC bug - var iframe = _domCreate('iframe'); - var i = _enumBugKeys.length; - var lt = '<'; - var gt = '>'; - var iframeDocument; - iframe.style.display = 'none'; - _html.appendChild(iframe); - iframe.src = 'javascript:'; // eslint-disable-line no-script-url - // createDict = iframe.contentWindow.Object; - // html.removeChild(iframe); - iframeDocument = iframe.contentWindow.document; - iframeDocument.open(); - iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt); - iframeDocument.close(); - createDict = iframeDocument.F; - while (i--) delete createDict[PROTOTYPE$1][_enumBugKeys[i]]; - return createDict(); - }; + // + var script$9 = { + name: 'DvBorderBox8', + mixins: [autoResize], + props: { + color: { + type: Array, + default: () => [] + }, + dur: { + type: Number, + default: 3 + }, + backgroundColor: { + type: String, + default: 'transparent' + }, + reverse: { + type: Boolean, + default: false + } + }, - var _objectCreate = Object.create || function create(O, Properties) { - var result; - if (O !== null) { - Empty[PROTOTYPE$1] = _anObject(O); - result = new Empty(); - Empty[PROTOTYPE$1] = null; - // add "__proto__" for Object.getPrototypeOf polyfill - result[IE_PROTO$1] = O; - } else result = createDict(); - return Properties === undefined ? result : _objectDps(result, Properties); - }; + data() { + const id = uuid(); + return { + ref: 'border-box-8', + path: `border-box-8-path-${id}`, + gradient: `border-box-8-gradient-${id}`, + mask: `border-box-8-mask-${id}`, + defaultColor: ['#235fa7', '#4fd2dd'], + mergedColor: [] + }; + }, - var _wks = createCommonjsModule(function (module) { - var store = _shared('wks'); + computed: { + length() { + const { + width, + height + } = this; + return (width + height - 5) * 2; + }, - var Symbol = _global.Symbol; - var USE_SYMBOL = typeof Symbol == 'function'; + pathD() { + const { + reverse, + width, + height + } = this; + if (reverse) return `M 2.5, 2.5 L 2.5, ${height - 2.5} L ${width - 2.5}, ${height - 2.5} L ${width - 2.5}, 2.5 L 2.5, 2.5`; + return `M2.5, 2.5 L${width - 2.5}, 2.5 L${width - 2.5}, ${height - 2.5} L2.5, ${height - 2.5} L2.5, 2.5`; + } - var $exports = module.exports = function (name) { - return store[name] || (store[name] = - USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : _uid)('Symbol.' + name)); - }; + }, + watch: { + color() { + const { + mergeColor + } = this; + mergeColor(); + } - $exports.store = store; - }); + }, + methods: { + mergeColor() { + const { + color, + defaultColor + } = this; + this.mergedColor = util_2$1(util_1(defaultColor, true), color || []); + } - var def = _objectDp.f; + }, - var TAG = _wks('toStringTag'); + mounted() { + const { + mergeColor + } = this; + mergeColor(); + } - var _setToStringTag = function (it, tag, stat) { - if (it && !_has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag }); }; - var IteratorPrototype = {}; - - // 25.1.2.1.1 %IteratorPrototype%[@@iterator]() - _hide(IteratorPrototype, _wks('iterator'), function () { return this; }); + /* script */ + const __vue_script__$9 = script$9; - var _iterCreate = function (Constructor, NAME, next) { - Constructor.prototype = _objectCreate(IteratorPrototype, { next: _propertyDesc(1, next) }); - _setToStringTag(Constructor, NAME + ' Iterator'); + /* template */ + var __vue_render__$9 = function() { + var _vm = this; + var _h = _vm.$createElement; + var _c = _vm._self._c || _h; + return _c("div", { ref: _vm.ref, staticClass: "dv-border-box-8" }, [ + _c( + "svg", + { + staticClass: "dv-border-svg-container", + attrs: { width: _vm.width, height: _vm.height } + }, + [ + _c( + "defs", + [ + _c("path", { + attrs: { id: _vm.path, d: _vm.pathD, fill: "transparent" } + }), + _vm._v(" "), + _c( + "radialGradient", + { attrs: { id: _vm.gradient, cx: "50%", cy: "50%", r: "50%" } }, + [ + _c("stop", { + attrs: { + offset: "0%", + "stop-color": "#fff", + "stop-opacity": "1" + } + }), + _vm._v(" "), + _c("stop", { + attrs: { + offset: "100%", + "stop-color": "#fff", + "stop-opacity": "0" + } + }) + ], + 1 + ), + _vm._v(" "), + _c("mask", { attrs: { id: _vm.mask } }, [ + _c( + "circle", + { + attrs: { + cx: "0", + cy: "0", + r: "150", + fill: "url(#" + _vm.gradient + ")" + } + }, + [ + _c("animateMotion", { + attrs: { + dur: _vm.dur + "s", + path: _vm.pathD, + rotate: "auto", + repeatCount: "indefinite" + } + }) + ], + 1 + ) + ]) + ], + 1 + ), + _vm._v(" "), + _c("polygon", { + attrs: { + fill: _vm.backgroundColor, + points: + "5, 5 " + + (_vm.width - 5) + + ", 5 " + + (_vm.width - 5) + + " " + + (_vm.height - 5) + + " 5, " + + (_vm.height - 5) + } + }), + _vm._v(" "), + _c("use", { + attrs: { + stroke: _vm.mergedColor[0], + "stroke-width": "1", + "xlink:href": "#" + _vm.path + } + }), + _vm._v(" "), + _c( + "use", + { + attrs: { + stroke: _vm.mergedColor[1], + "stroke-width": "3", + "xlink:href": "#" + _vm.path, + mask: "url(#" + _vm.mask + ")" + } + }, + [ + _c("animate", { + attrs: { + attributeName: "stroke-dasharray", + from: "0, " + _vm.length, + to: _vm.length + ", 0", + dur: _vm.dur + "s", + repeatCount: "indefinite" + } + }) + ] + ) + ] + ), + _vm._v(" "), + _c("div", { staticClass: "border-box-content" }, [_vm._t("default")], 2) + ]) }; + var __vue_staticRenderFns__$9 = []; + __vue_render__$9._withStripped = true; - // 7.1.13 ToObject(argument) + /* style */ + const __vue_inject_styles__$9 = function (inject) { + if (!inject) return + inject("data-v-681e49b5_0", { source: ".dv-border-box-8 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-8 .dv-border-svg-container {\n position: absolute;\n width: 100%;\n height: 100%;\n left: 0px;\n top: 0px;\n}\n.dv-border-box-8 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;EACZ,SAAS;EACT,QAAQ;AACV;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd","file":"main.vue","sourcesContent":[".dv-border-box-8 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-8 .dv-border-svg-container {\n position: absolute;\n width: 100%;\n height: 100%;\n left: 0px;\n top: 0px;\n}\n.dv-border-box-8 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n"]}, media: undefined }); - var _toObject = function (it) { - return Object(_defined(it)); - }; + }; + /* scoped */ + const __vue_scope_id__$9 = undefined; + /* module identifier */ + const __vue_module_identifier__$9 = undefined; + /* functional template */ + const __vue_is_functional_template__$9 = false; + /* style inject SSR */ + + /* style inject shadow dom */ + - // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) + + const __vue_component__$9 = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$9, staticRenderFns: __vue_staticRenderFns__$9 }, + __vue_inject_styles__$9, + __vue_script__$9, + __vue_scope_id__$9, + __vue_is_functional_template__$9, + __vue_module_identifier__$9, + false, + createInjector, + undefined, + undefined + ); + function borderBox8 (Vue) { + Vue.component(__vue_component__$9.name, __vue_component__$9); + } - var IE_PROTO$2 = _sharedKey('IE_PROTO'); - var ObjectProto = Object.prototype; + // + var script$a = { + name: 'DvBorderBox9', + mixins: [autoResize], + props: { + color: { + type: Array, + default: () => [] + }, + backgroundColor: { + type: String, + default: 'transparent' + } + }, - var _objectGpo = Object.getPrototypeOf || function (O) { - O = _toObject(O); - if (_has(O, IE_PROTO$2)) return O[IE_PROTO$2]; - if (typeof O.constructor == 'function' && O instanceof O.constructor) { - return O.constructor.prototype; - } return O instanceof Object ? ObjectProto : null; - }; + data() { + const id = uuid(); + return { + ref: 'border-box-9', + gradientId: `border-box-9-gradient-${id}`, + maskId: `border-box-9-mask-${id}`, + defaultColor: ['#11eefd', '#0078d2'], + mergedColor: [] + }; + }, - var ITERATOR = _wks('iterator'); - var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next` - var FF_ITERATOR = '@@iterator'; - var KEYS = 'keys'; - var VALUES = 'values'; - - var returnThis = function () { return this; }; - - var _iterDefine = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) { - _iterCreate(Constructor, NAME, next); - var getMethod = function (kind) { - if (!BUGGY && kind in proto) return proto[kind]; - switch (kind) { - case KEYS: return function keys() { return new Constructor(this, kind); }; - case VALUES: return function values() { return new Constructor(this, kind); }; - } return function entries() { return new Constructor(this, kind); }; - }; - var TAG = NAME + ' Iterator'; - var DEF_VALUES = DEFAULT == VALUES; - var VALUES_BUG = false; - var proto = Base.prototype; - var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT]; - var $default = $native || getMethod(DEFAULT); - var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined; - var $anyNative = NAME == 'Array' ? proto.entries || $native : $native; - var methods, key, IteratorPrototype; - // Fix native - if ($anyNative) { - IteratorPrototype = _objectGpo($anyNative.call(new Base())); - if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) { - // Set @@toStringTag to native iterators - _setToStringTag(IteratorPrototype, TAG, true); - // fix for some old engines - if ( typeof IteratorPrototype[ITERATOR] != 'function') _hide(IteratorPrototype, ITERATOR, returnThis); + watch: { + color() { + const { + mergeColor + } = this; + mergeColor(); } - } - // fix Array#{values, @@iterator}.name in V8 / FF - if (DEF_VALUES && $native && $native.name !== VALUES) { - VALUES_BUG = true; - $default = function values() { return $native.call(this); }; - } - // Define iterator - if ( (BUGGY || VALUES_BUG || !proto[ITERATOR])) { - _hide(proto, ITERATOR, $default); - } - // Plug for library - _iterators[NAME] = $default; - _iterators[TAG] = returnThis; - if (DEFAULT) { - methods = { - values: DEF_VALUES ? $default : getMethod(VALUES), - keys: IS_SET ? $default : getMethod(KEYS), - entries: $entries - }; - if (FORCED) for (key in methods) { - if (!(key in proto)) _redefine(proto, key, methods[key]); - } else _export(_export.P + _export.F * (BUGGY || VALUES_BUG), NAME, methods); - } - return methods; - }; - var $at = _stringAt(true); - - // 21.1.3.27 String.prototype[@@iterator]() - _iterDefine(String, 'String', function (iterated) { - this._t = String(iterated); // target - this._i = 0; // next index - // 21.1.5.2.1 %StringIteratorPrototype%.next() - }, function () { - var O = this._t; - var index = this._i; - var point; - if (index >= O.length) return { value: undefined, done: true }; - point = $at(O, index); - this._i += point.length; - return { value: point, done: false }; - }); + }, + methods: { + mergeColor() { + const { + color, + defaultColor + } = this; + this.mergedColor = util_2$1(util_1(defaultColor, true), color || []); + } - // call something on iterator step with safe closing on error + }, - var _iterCall = function (iterator, fn, value, entries) { - try { - return entries ? fn(_anObject(value)[0], value[1]) : fn(value); - // 7.4.6 IteratorClose(iterator, completion) - } catch (e) { - var ret = iterator['return']; - if (ret !== undefined) _anObject(ret.call(iterator)); - throw e; + mounted() { + const { + mergeColor + } = this; + mergeColor(); } - }; - - // check on default Array iterator - var ITERATOR$1 = _wks('iterator'); - var ArrayProto = Array.prototype; - - var _isArrayIter = function (it) { - return it !== undefined && (_iterators.Array === it || ArrayProto[ITERATOR$1] === it); }; - var _createProperty = function (object, index, value) { - if (index in object) _objectDp.f(object, index, _propertyDesc(0, value)); - else object[index] = value; - }; - - // getting tag from 19.1.3.6 Object.prototype.toString() - - var TAG$1 = _wks('toStringTag'); - // ES3 wrong here - var ARG = _cof(function () { return arguments; }()) == 'Arguments'; - - // fallback for IE11 Script Access Denied error - var tryGet = function (it, key) { - try { - return it[key]; - } catch (e) { /* empty */ } - }; - - var _classof = function (it) { - var O, T, B; - return it === undefined ? 'Undefined' : it === null ? 'Null' - // @@toStringTag case - : typeof (T = tryGet(O = Object(it), TAG$1)) == 'string' ? T - // builtinTag case - : ARG ? _cof(O) - // ES3 arguments fallback - : (B = _cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B; - }; - - var ITERATOR$2 = _wks('iterator'); - - var core_getIteratorMethod = _core.getIteratorMethod = function (it) { - if (it != undefined) return it[ITERATOR$2] - || it['@@iterator'] - || _iterators[_classof(it)]; - }; - - var ITERATOR$3 = _wks('iterator'); - var SAFE_CLOSING = false; - - try { - var riter = [7][ITERATOR$3](); - riter['return'] = function () { SAFE_CLOSING = true; }; - // eslint-disable-next-line no-throw-literal - Array.from(riter, function () { throw 2; }); - } catch (e) { /* empty */ } - - var _iterDetect = function (exec, skipClosing) { - if (!skipClosing && !SAFE_CLOSING) return false; - var safe = false; - try { - var arr = [7]; - var iter = arr[ITERATOR$3](); - iter.next = function () { return { done: safe = true }; }; - arr[ITERATOR$3] = function () { return iter; }; - exec(arr); - } catch (e) { /* empty */ } - return safe; - }; - - _export(_export.S + _export.F * !_iterDetect(function (iter) { Array.from(iter); }), 'Array', { - // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined) - from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) { - var O = _toObject(arrayLike); - var C = typeof this == 'function' ? this : Array; - var aLen = arguments.length; - var mapfn = aLen > 1 ? arguments[1] : undefined; - var mapping = mapfn !== undefined; - var index = 0; - var iterFn = core_getIteratorMethod(O); - var length, result, step, iterator; - if (mapping) mapfn = _ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2); - // if object isn't iterable or it's array with default iterator - use simple case - if (iterFn != undefined && !(C == Array && _isArrayIter(iterFn))) { - for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) { - _createProperty(result, index, mapping ? _iterCall(iterator, mapfn, [step.value, index], true) : step.value); - } - } else { - length = _toLength(O.length); - for (result = new C(length); length > index; index++) { - _createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]); - } - } - result.length = index; - return result; - } - }); - - var f$1 = _wks; - - var _wksExt = { - f: f$1 - }; - - var defineProperty = _objectDp.f; - var _wksDefine = function (name) { - var $Symbol = _core.Symbol || (_core.Symbol = _global.Symbol || {}); - if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: _wksExt.f(name) }); - }; - - _wksDefine('asyncIterator'); - - var _meta = createCommonjsModule(function (module) { - var META = _uid('meta'); - - - var setDesc = _objectDp.f; - var id = 0; - var isExtensible = Object.isExtensible || function () { - return true; - }; - var FREEZE = !_fails(function () { - return isExtensible(Object.preventExtensions({})); - }); - var setMeta = function (it) { - setDesc(it, META, { value: { - i: 'O' + ++id, // object ID - w: {} // weak collections IDs - } }); - }; - var fastKey = function (it, create) { - // return primitive with prefix - if (!_isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; - if (!_has(it, META)) { - // can't set metadata to uncaught frozen object - if (!isExtensible(it)) return 'F'; - // not necessary to add metadata - if (!create) return 'E'; - // add missing metadata - setMeta(it); - // return object ID - } return it[META].i; - }; - var getWeak = function (it, create) { - if (!_has(it, META)) { - // can't set metadata to uncaught frozen object - if (!isExtensible(it)) return true; - // not necessary to add metadata - if (!create) return false; - // add missing metadata - setMeta(it); - // return hash weak collections IDs - } return it[META].w; - }; - // add metadata on freeze-family methods calling - var onFreeze = function (it) { - if (FREEZE && meta.NEED && isExtensible(it) && !_has(it, META)) setMeta(it); - return it; - }; - var meta = module.exports = { - KEY: META, - NEED: false, - fastKey: fastKey, - getWeak: getWeak, - onFreeze: onFreeze - }; - }); - var _meta_1 = _meta.KEY; - var _meta_2 = _meta.NEED; - var _meta_3 = _meta.fastKey; - var _meta_4 = _meta.getWeak; - var _meta_5 = _meta.onFreeze; - - var f$2 = Object.getOwnPropertySymbols; - - var _objectGops = { - f: f$2 - }; - - var f$3 = {}.propertyIsEnumerable; - - var _objectPie = { - f: f$3 - }; - - // all enumerable object keys, includes symbols - - - - var _enumKeys = function (it) { - var result = _objectKeys(it); - var getSymbols = _objectGops.f; - if (getSymbols) { - var symbols = getSymbols(it); - var isEnum = _objectPie.f; - var i = 0; - var key; - while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key); - } return result; - }; - - // 7.2.2 IsArray(argument) - - var _isArray = Array.isArray || function isArray(arg) { - return _cof(arg) == 'Array'; - }; - - // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) - - var hiddenKeys = _enumBugKeys.concat('length', 'prototype'); - - var f$4 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { - return _objectKeysInternal(O, hiddenKeys); - }; - - var _objectGopn = { - f: f$4 - }; - - // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window - - var gOPN = _objectGopn.f; - var toString$1 = {}.toString; - - var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames - ? Object.getOwnPropertyNames(window) : []; - - var getWindowNames = function (it) { - try { - return gOPN(it); - } catch (e) { - return windowNames.slice(); - } - }; - - var f$5 = function getOwnPropertyNames(it) { - return windowNames && toString$1.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(_toIobject(it)); - }; - - var _objectGopnExt = { - f: f$5 - }; - - var gOPD = Object.getOwnPropertyDescriptor; - - var f$6 = _descriptors ? gOPD : function getOwnPropertyDescriptor(O, P) { - O = _toIobject(O); - P = _toPrimitive(P, true); - if (_ie8DomDefine) try { - return gOPD(O, P); - } catch (e) { /* empty */ } - if (_has(O, P)) return _propertyDesc(!_objectPie.f.call(O, P), O[P]); - }; - - var _objectGopd = { - f: f$6 - }; - - // ECMAScript 6 symbols shim - - - - - - var META = _meta.KEY; - - - - - - - - - - - - - - - - - - - - - - var gOPD$1 = _objectGopd.f; - var dP$1 = _objectDp.f; - var gOPN$1 = _objectGopnExt.f; - var $Symbol = _global.Symbol; - var $JSON = _global.JSON; - var _stringify = $JSON && $JSON.stringify; - var PROTOTYPE$2 = 'prototype'; - var HIDDEN = _wks('_hidden'); - var TO_PRIMITIVE = _wks('toPrimitive'); - var isEnum = {}.propertyIsEnumerable; - var SymbolRegistry = _shared('symbol-registry'); - var AllSymbols = _shared('symbols'); - var OPSymbols = _shared('op-symbols'); - var ObjectProto$1 = Object[PROTOTYPE$2]; - var USE_NATIVE = typeof $Symbol == 'function' && !!_objectGops.f; - var QObject = _global.QObject; - // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173 - var setter = !QObject || !QObject[PROTOTYPE$2] || !QObject[PROTOTYPE$2].findChild; - - // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687 - var setSymbolDesc = _descriptors && _fails(function () { - return _objectCreate(dP$1({}, 'a', { - get: function () { return dP$1(this, 'a', { value: 7 }).a; } - })).a != 7; - }) ? function (it, key, D) { - var protoDesc = gOPD$1(ObjectProto$1, key); - if (protoDesc) delete ObjectProto$1[key]; - dP$1(it, key, D); - if (protoDesc && it !== ObjectProto$1) dP$1(ObjectProto$1, key, protoDesc); - } : dP$1; - - var wrap = function (tag) { - var sym = AllSymbols[tag] = _objectCreate($Symbol[PROTOTYPE$2]); - sym._k = tag; - return sym; - }; - - var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) { - return typeof it == 'symbol'; - } : function (it) { - return it instanceof $Symbol; - }; + /* script */ + const __vue_script__$a = script$a; - var $defineProperty = function defineProperty(it, key, D) { - if (it === ObjectProto$1) $defineProperty(OPSymbols, key, D); - _anObject(it); - key = _toPrimitive(key, true); - _anObject(D); - if (_has(AllSymbols, key)) { - if (!D.enumerable) { - if (!_has(it, HIDDEN)) dP$1(it, HIDDEN, _propertyDesc(1, {})); - it[HIDDEN][key] = true; - } else { - if (_has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false; - D = _objectCreate(D, { enumerable: _propertyDesc(0, false) }); - } return setSymbolDesc(it, key, D); - } return dP$1(it, key, D); - }; - var $defineProperties = function defineProperties(it, P) { - _anObject(it); - var keys = _enumKeys(P = _toIobject(P)); - var i = 0; - var l = keys.length; - var key; - while (l > i) $defineProperty(it, key = keys[i++], P[key]); - return it; - }; - var $create = function create(it, P) { - return P === undefined ? _objectCreate(it) : $defineProperties(_objectCreate(it), P); - }; - var $propertyIsEnumerable = function propertyIsEnumerable(key) { - var E = isEnum.call(this, key = _toPrimitive(key, true)); - if (this === ObjectProto$1 && _has(AllSymbols, key) && !_has(OPSymbols, key)) return false; - return E || !_has(this, key) || !_has(AllSymbols, key) || _has(this, HIDDEN) && this[HIDDEN][key] ? E : true; - }; - var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) { - it = _toIobject(it); - key = _toPrimitive(key, true); - if (it === ObjectProto$1 && _has(AllSymbols, key) && !_has(OPSymbols, key)) return; - var D = gOPD$1(it, key); - if (D && _has(AllSymbols, key) && !(_has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true; - return D; - }; - var $getOwnPropertyNames = function getOwnPropertyNames(it) { - var names = gOPN$1(_toIobject(it)); - var result = []; - var i = 0; - var key; - while (names.length > i) { - if (!_has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key); - } return result; - }; - var $getOwnPropertySymbols = function getOwnPropertySymbols(it) { - var IS_OP = it === ObjectProto$1; - var names = gOPN$1(IS_OP ? OPSymbols : _toIobject(it)); - var result = []; - var i = 0; - var key; - while (names.length > i) { - if (_has(AllSymbols, key = names[i++]) && (IS_OP ? _has(ObjectProto$1, key) : true)) result.push(AllSymbols[key]); - } return result; + /* template */ + var __vue_render__$a = function() { + var _vm = this; + var _h = _vm.$createElement; + var _c = _vm._self._c || _h; + return _c("div", { ref: _vm.ref, staticClass: "dv-border-box-9" }, [ + _c( + "svg", + { + staticClass: "dv-border-svg-container", + attrs: { width: _vm.width, height: _vm.height } + }, + [ + _c( + "defs", + [ + _c( + "linearGradient", + { + attrs: { + id: _vm.gradientId, + x1: "0%", + y1: "0%", + x2: "100%", + y2: "100%" + } + }, + [ + _c("animate", { + attrs: { + attributeName: "x1", + values: "0%;100%;0%", + dur: "10s", + begin: "0s", + repeatCount: "indefinite" + } + }), + _vm._v(" "), + _c("animate", { + attrs: { + attributeName: "x2", + values: "100%;0%;100%", + dur: "10s", + begin: "0s", + repeatCount: "indefinite" + } + }), + _vm._v(" "), + _c( + "stop", + { attrs: { offset: "0%", "stop-color": _vm.mergedColor[0] } }, + [ + _c("animate", { + attrs: { + attributeName: "stop-color", + values: + _vm.mergedColor[0] + + ";" + + _vm.mergedColor[1] + + ";" + + _vm.mergedColor[0], + dur: "10s", + begin: "0s", + repeatCount: "indefinite" + } + }) + ] + ), + _vm._v(" "), + _c( + "stop", + { + attrs: { offset: "100%", "stop-color": _vm.mergedColor[1] } + }, + [ + _c("animate", { + attrs: { + attributeName: "stop-color", + values: + _vm.mergedColor[1] + + ";" + + _vm.mergedColor[0] + + ";" + + _vm.mergedColor[1], + dur: "10s", + begin: "0s", + repeatCount: "indefinite" + } + }) + ] + ) + ], + 1 + ), + _vm._v(" "), + _c("mask", { attrs: { id: _vm.maskId } }, [ + _c("polyline", { + attrs: { + stroke: "#fff", + "stroke-width": "3", + fill: "transparent", + points: + "8, " + + _vm.height * 0.4 + + " 8, 3, " + + (_vm.width * 0.4 + 7) + + ", 3" + } + }), + _vm._v(" "), + _c("polyline", { + attrs: { + fill: "#fff", + points: + "8, " + + _vm.height * 0.15 + + " 8, 3, " + + (_vm.width * 0.1 + 7) + + ", 3\n " + + _vm.width * 0.1 + + ", 8 14, 8 14, " + + (_vm.height * 0.15 - 7) + + "\n " + } + }), + _vm._v(" "), + _c("polyline", { + attrs: { + stroke: "#fff", + "stroke-width": "3", + fill: "transparent", + points: + _vm.width * 0.5 + + ", 3 " + + (_vm.width - 3) + + ", 3, " + + (_vm.width - 3) + + ", " + + _vm.height * 0.25 + } + }), + _vm._v(" "), + _c("polyline", { + attrs: { + fill: "#fff", + points: + "\n " + + _vm.width * 0.52 + + ", 3 " + + _vm.width * 0.58 + + ", 3\n " + + (_vm.width * 0.58 - 7) + + ", 9 " + + (_vm.width * 0.52 + 7) + + ", 9\n " + } + }), + _vm._v(" "), + _c("polyline", { + attrs: { + fill: "#fff", + points: + "\n " + + _vm.width * 0.9 + + ", 3 " + + (_vm.width - 3) + + ", 3 " + + (_vm.width - 3) + + ", " + + _vm.height * 0.1 + + "\n " + + (_vm.width - 9) + + ", " + + (_vm.height * 0.1 - 7) + + " " + + (_vm.width - 9) + + ", 9 " + + (_vm.width * 0.9 + 7) + + ", 9\n " + } + }), + _vm._v(" "), + _c("polyline", { + attrs: { + stroke: "#fff", + "stroke-width": "3", + fill: "transparent", + points: + "8, " + + _vm.height * 0.5 + + " 8, " + + (_vm.height - 3) + + " " + + (_vm.width * 0.3 + 7) + + ", " + + (_vm.height - 3) + } + }), + _vm._v(" "), + _c("polyline", { + attrs: { + fill: "#fff", + points: + "\n 8, " + + _vm.height * 0.55 + + " 8, " + + _vm.height * 0.7 + + "\n 2, " + + (_vm.height * 0.7 - 7) + + " 2, " + + (_vm.height * 0.55 + 7) + + "\n " + } + }), + _vm._v(" "), + _c("polyline", { + attrs: { + stroke: "#fff", + "stroke-width": "3", + fill: "transparent", + points: + _vm.width * 0.35 + + ", " + + (_vm.height - 3) + + " " + + (_vm.width - 3) + + ", " + + (_vm.height - 3) + + " " + + (_vm.width - 3) + + ", " + + _vm.height * 0.35 + } + }), + _vm._v(" "), + _c("polyline", { + attrs: { + fill: "#fff", + points: + "\n " + + _vm.width * 0.92 + + ", " + + (_vm.height - 3) + + " " + + (_vm.width - 3) + + ", " + + (_vm.height - 3) + + " " + + (_vm.width - 3) + + ", " + + _vm.height * 0.8 + + "\n " + + (_vm.width - 9) + + ", " + + (_vm.height * 0.8 + 7) + + " " + + (_vm.width - 9) + + ", " + + (_vm.height - 9) + + " " + + (_vm.width * 0.92 + 7) + + ", " + + (_vm.height - 9) + + "\n " + } + }) + ]) + ], + 1 + ), + _vm._v(" "), + _c("polygon", { + attrs: { + fill: _vm.backgroundColor, + points: + "\n 15, 9 " + + (_vm.width * 0.1 + 1) + + ", 9 " + + (_vm.width * 0.1 + 4) + + ", 6 " + + (_vm.width * 0.52 + 2) + + ", 6\n " + + (_vm.width * 0.52 + 6) + + ", 10 " + + (_vm.width * 0.58 - 7) + + ", 10 " + + (_vm.width * 0.58 - 2) + + ", 6\n " + + (_vm.width * 0.9 + 2) + + ", 6 " + + (_vm.width * 0.9 + 6) + + ", 10 " + + (_vm.width - 10) + + ", 10 " + + (_vm.width - 10) + + ", " + + (_vm.height * 0.1 - 6) + + "\n " + + (_vm.width - 6) + + ", " + + (_vm.height * 0.1 - 1) + + " " + + (_vm.width - 6) + + ", " + + (_vm.height * 0.8 + 1) + + " " + + (_vm.width - 10) + + ", " + + (_vm.height * 0.8 + 6) + + "\n " + + (_vm.width - 10) + + ", " + + (_vm.height - 10) + + " " + + (_vm.width * 0.92 + 7) + + ", " + + (_vm.height - 10) + + " " + + (_vm.width * 0.92 + 2) + + ", " + + (_vm.height - 6) + + "\n 11, " + + (_vm.height - 6) + + " 11, " + + (_vm.height * 0.15 - 2) + + " 15, " + + (_vm.height * 0.15 - 7) + + "\n " + } + }), + _vm._v(" "), + _c("rect", { + attrs: { + x: "0", + y: "0", + width: _vm.width, + height: _vm.height, + fill: "url(#" + _vm.gradientId + ")", + mask: "url(#" + _vm.maskId + ")" + } + }) + ] + ), + _vm._v(" "), + _c("div", { staticClass: "border-box-content" }, [_vm._t("default")], 2) + ]) }; + var __vue_staticRenderFns__$a = []; + __vue_render__$a._withStripped = true; - // 19.4.1.1 Symbol([description]) - if (!USE_NATIVE) { - $Symbol = function Symbol() { - if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!'); - var tag = _uid(arguments.length > 0 ? arguments[0] : undefined); - var $set = function (value) { - if (this === ObjectProto$1) $set.call(OPSymbols, value); - if (_has(this, HIDDEN) && _has(this[HIDDEN], tag)) this[HIDDEN][tag] = false; - setSymbolDesc(this, tag, _propertyDesc(1, value)); - }; - if (_descriptors && setter) setSymbolDesc(ObjectProto$1, tag, { configurable: true, set: $set }); - return wrap(tag); - }; - _redefine($Symbol[PROTOTYPE$2], 'toString', function toString() { - return this._k; - }); - - _objectGopd.f = $getOwnPropertyDescriptor; - _objectDp.f = $defineProperty; - _objectGopn.f = _objectGopnExt.f = $getOwnPropertyNames; - _objectPie.f = $propertyIsEnumerable; - _objectGops.f = $getOwnPropertySymbols; - - if (_descriptors && !_library) { - _redefine(ObjectProto$1, 'propertyIsEnumerable', $propertyIsEnumerable, true); - } + /* style */ + const __vue_inject_styles__$a = function (inject) { + if (!inject) return + inject("data-v-db539808_0", { source: ".dv-border-box-9 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-9 .dv-border-svg-container {\n position: absolute;\n width: 100%;\n height: 100%;\n left: 0px;\n top: 0px;\n}\n.dv-border-box-9 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;EACZ,SAAS;EACT,QAAQ;AACV;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd","file":"main.vue","sourcesContent":[".dv-border-box-9 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-9 .dv-border-svg-container {\n position: absolute;\n width: 100%;\n height: 100%;\n left: 0px;\n top: 0px;\n}\n.dv-border-box-9 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n"]}, media: undefined }); - _wksExt.f = function (name) { - return wrap(_wks(name)); }; - } - - _export(_export.G + _export.W + _export.F * !USE_NATIVE, { Symbol: $Symbol }); - - for (var es6Symbols = ( - // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14 - 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables' - ).split(','), j = 0; es6Symbols.length > j;)_wks(es6Symbols[j++]); - - for (var wellKnownSymbols = _objectKeys(_wks.store), k = 0; wellKnownSymbols.length > k;) _wksDefine(wellKnownSymbols[k++]); - - _export(_export.S + _export.F * !USE_NATIVE, 'Symbol', { - // 19.4.2.1 Symbol.for(key) - 'for': function (key) { - return _has(SymbolRegistry, key += '') - ? SymbolRegistry[key] - : SymbolRegistry[key] = $Symbol(key); - }, - // 19.4.2.5 Symbol.keyFor(sym) - keyFor: function keyFor(sym) { - if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!'); - for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key; - }, - useSetter: function () { setter = true; }, - useSimple: function () { setter = false; } - }); - - _export(_export.S + _export.F * !USE_NATIVE, 'Object', { - // 19.1.2.2 Object.create(O [, Properties]) - create: $create, - // 19.1.2.4 Object.defineProperty(O, P, Attributes) - defineProperty: $defineProperty, - // 19.1.2.3 Object.defineProperties(O, Properties) - defineProperties: $defineProperties, - // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) - getOwnPropertyDescriptor: $getOwnPropertyDescriptor, - // 19.1.2.7 Object.getOwnPropertyNames(O) - getOwnPropertyNames: $getOwnPropertyNames, - // 19.1.2.8 Object.getOwnPropertySymbols(O) - getOwnPropertySymbols: $getOwnPropertySymbols - }); - - // Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives - // https://bugs.chromium.org/p/v8/issues/detail?id=3443 - var FAILS_ON_PRIMITIVES = _fails(function () { _objectGops.f(1); }); - - _export(_export.S + _export.F * FAILS_ON_PRIMITIVES, 'Object', { - getOwnPropertySymbols: function getOwnPropertySymbols(it) { - return _objectGops.f(_toObject(it)); - } - }); - - // 24.3.2 JSON.stringify(value [, replacer [, space]]) - $JSON && _export(_export.S + _export.F * (!USE_NATIVE || _fails(function () { - var S = $Symbol(); - // MS Edge converts symbol values to JSON as {} - // WebKit converts symbol values to JSON as null - // V8 throws on boxed symbols - return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}'; - })), 'JSON', { - stringify: function stringify(it) { - var args = [it]; - var i = 1; - var replacer, $replacer; - while (arguments.length > i) args.push(arguments[i++]); - $replacer = replacer = args[1]; - if (!_isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined - if (!_isArray(replacer)) replacer = function (key, value) { - if (typeof $replacer == 'function') value = $replacer.call(this, key, value); - if (!isSymbol(value)) return value; - }; - args[1] = replacer; - return _stringify.apply($JSON, args); - } - }); - - // 19.4.3.4 Symbol.prototype[@@toPrimitive](hint) - $Symbol[PROTOTYPE$2][TO_PRIMITIVE] || _hide($Symbol[PROTOTYPE$2], TO_PRIMITIVE, $Symbol[PROTOTYPE$2].valueOf); - // 19.4.3.5 Symbol.prototype[@@toStringTag] - _setToStringTag($Symbol, 'Symbol'); - // 20.2.1.9 Math[@@toStringTag] - _setToStringTag(Math, 'Math', true); - // 24.3.3 JSON[@@toStringTag] - _setToStringTag(_global.JSON, 'JSON', true); - - // 22.1.3.31 Array.prototype[@@unscopables] - var UNSCOPABLES = _wks('unscopables'); - var ArrayProto$1 = Array.prototype; - if (ArrayProto$1[UNSCOPABLES] == undefined) _hide(ArrayProto$1, UNSCOPABLES, {}); - var _addToUnscopables = function (key) { - ArrayProto$1[UNSCOPABLES][key] = true; - }; - - var _iterStep = function (done, value) { - return { value: value, done: !!done }; - }; + /* scoped */ + const __vue_scope_id__$a = undefined; + /* module identifier */ + const __vue_module_identifier__$a = undefined; + /* functional template */ + const __vue_is_functional_template__$a = false; + /* style inject SSR */ + + /* style inject shadow dom */ + - // 22.1.3.4 Array.prototype.entries() - // 22.1.3.13 Array.prototype.keys() - // 22.1.3.29 Array.prototype.values() - // 22.1.3.30 Array.prototype[@@iterator]() - var es6_array_iterator = _iterDefine(Array, 'Array', function (iterated, kind) { - this._t = _toIobject(iterated); // target - this._i = 0; // next index - this._k = kind; // kind - // 22.1.5.2.1 %ArrayIteratorPrototype%.next() - }, function () { - var O = this._t; - var kind = this._k; - var index = this._i++; - if (!O || index >= O.length) { - this._t = undefined; - return _iterStep(1); - } - if (kind == 'keys') return _iterStep(0, index); - if (kind == 'values') return _iterStep(0, O[index]); - return _iterStep(0, [index, O[index]]); - }, 'values'); - - // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7) - _iterators.Arguments = _iterators.Array; - - _addToUnscopables('keys'); - _addToUnscopables('values'); - _addToUnscopables('entries'); - - var ITERATOR$4 = _wks('iterator'); - var TO_STRING_TAG = _wks('toStringTag'); - var ArrayValues = _iterators.Array; - - var DOMIterables = { - CSSRuleList: true, // TODO: Not spec compliant, should be false. - CSSStyleDeclaration: false, - CSSValueList: false, - ClientRectList: false, - DOMRectList: false, - DOMStringList: false, - DOMTokenList: true, - DataTransferItemList: false, - FileList: false, - HTMLAllCollection: false, - HTMLCollection: false, - HTMLFormElement: false, - HTMLSelectElement: false, - MediaList: true, // TODO: Not spec compliant, should be false. - MimeTypeArray: false, - NamedNodeMap: false, - NodeList: true, - PaintRequestList: false, - Plugin: false, - PluginArray: false, - SVGLengthList: false, - SVGNumberList: false, - SVGPathSegList: false, - SVGPointList: false, - SVGStringList: false, - SVGTransformList: false, - SourceBufferList: false, - StyleSheetList: true, // TODO: Not spec compliant, should be false. - TextTrackCueList: false, - TextTrackList: false, - TouchList: false - }; + + const __vue_component__$a = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$a, staticRenderFns: __vue_staticRenderFns__$a }, + __vue_inject_styles__$a, + __vue_script__$a, + __vue_scope_id__$a, + __vue_is_functional_template__$a, + __vue_module_identifier__$a, + false, + createInjector, + undefined, + undefined + ); - for (var collections = _objectKeys(DOMIterables), i = 0; i < collections.length; i++) { - var NAME = collections[i]; - var explicit = DOMIterables[NAME]; - var Collection = _global[NAME]; - var proto = Collection && Collection.prototype; - var key; - if (proto) { - if (!proto[ITERATOR$4]) _hide(proto, ITERATOR$4, ArrayValues); - if (!proto[TO_STRING_TAG]) _hide(proto, TO_STRING_TAG, NAME); - _iterators[NAME] = ArrayValues; - if (explicit) for (key in es6_array_iterator) if (!proto[key]) _redefine(proto, key, es6_array_iterator[key], true); - } + function borderBox9 (Vue) { + Vue.component(__vue_component__$a.name, __vue_component__$a); } - // 22.1.2.2 / 15.4.3.2 Array.isArray(arg) - - - _export(_export.S, 'Array', { isArray: _isArray }); - - var SPECIES = _wks('species'); - - var _arraySpeciesConstructor = function (original) { - var C; - if (_isArray(original)) { - C = original.constructor; - // cross-realm fallback - if (typeof C == 'function' && (C === Array || _isArray(C.prototype))) C = undefined; - if (_isObject(C)) { - C = C[SPECIES]; - if (C === null) C = undefined; - } - } return C === undefined ? Array : C; - }; - - // 9.4.2.3 ArraySpeciesCreate(originalArray, length) - - - var _arraySpeciesCreate = function (original, length) { - return new (_arraySpeciesConstructor(original))(length); - }; - - // 0 -> Array#forEach - // 1 -> Array#map - // 2 -> Array#filter - // 3 -> Array#some - // 4 -> Array#every - // 5 -> Array#find - // 6 -> Array#findIndex - - - - - - var _arrayMethods = function (TYPE, $create) { - var IS_MAP = TYPE == 1; - var IS_FILTER = TYPE == 2; - var IS_SOME = TYPE == 3; - var IS_EVERY = TYPE == 4; - var IS_FIND_INDEX = TYPE == 6; - var NO_HOLES = TYPE == 5 || IS_FIND_INDEX; - var create = $create || _arraySpeciesCreate; - return function ($this, callbackfn, that) { - var O = _toObject($this); - var self = _iobject(O); - var f = _ctx(callbackfn, that, 3); - var length = _toLength(self.length); - var index = 0; - var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined; - var val, res; - for (;length > index; index++) if (NO_HOLES || index in self) { - val = self[index]; - res = f(val, index, O); - if (TYPE) { - if (IS_MAP) result[index] = res; // map - else if (res) switch (TYPE) { - case 3: return true; // some - case 5: return val; // find - case 6: return index; // findIndex - case 2: result.push(val); // filter - } else if (IS_EVERY) return false; // every - } - } - return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result; - }; - }; - - var _strictMethod = function (method, arg) { - return !!method && _fails(function () { - // eslint-disable-next-line no-useless-call - arg ? method.call(null, function () { /* empty */ }, 1) : method.call(null); - }); - }; - - var $forEach = _arrayMethods(0); - var STRICT = _strictMethod([].forEach, true); - - _export(_export.P + _export.F * !STRICT, 'Array', { - // 22.1.3.10 / 15.4.4.18 Array.prototype.forEach(callbackfn [, thisArg]) - forEach: function forEach(callbackfn /* , thisArg */) { - return $forEach(this, callbackfn, arguments[1]); - } - }); - - var _arrayFill = function fill(value /* , start = 0, end = @length */) { - var O = _toObject(this); - var length = _toLength(O.length); - var aLen = arguments.length; - var index = _toAbsoluteIndex(aLen > 1 ? arguments[1] : undefined, length); - var end = aLen > 2 ? arguments[2] : undefined; - var endPos = end === undefined ? length : _toAbsoluteIndex(end, length); - while (endPos > index) O[index++] = value; - return O; - }; - - // 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) - - - _export(_export.P, 'Array', { fill: _arrayFill }); - - _addToUnscopables('fill'); - - var $map = _arrayMethods(1); - - _export(_export.P + _export.F * !_strictMethod([].map, true), 'Array', { - // 22.1.3.15 / 15.4.4.19 Array.prototype.map(callbackfn [, thisArg]) - map: function map(callbackfn /* , thisArg */) { - return $map(this, callbackfn, arguments[1]); - } - }); - - // 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined) - - var $find = _arrayMethods(6); - var KEY = 'findIndex'; - var forced = true; - // Shouldn't skip holes - if (KEY in []) Array(1)[KEY](function () { forced = false; }); - _export(_export.P + _export.F * forced, 'Array', { - findIndex: function findIndex(callbackfn /* , that = undefined */) { - return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); - } - }); - _addToUnscopables(KEY); - - var _arrayReduce = function (that, callbackfn, aLen, memo, isRight) { - _aFunction(callbackfn); - var O = _toObject(that); - var self = _iobject(O); - var length = _toLength(O.length); - var index = isRight ? length - 1 : 0; - var i = isRight ? -1 : 1; - if (aLen < 2) for (;;) { - if (index in self) { - memo = self[index]; - index += i; - break; - } - index += i; - if (isRight ? index < 0 : length <= index) { - throw TypeError('Reduce of empty array with no initial value'); + // + var script$b = { + name: 'DvBorderBox10', + mixins: [autoResize], + props: { + color: { + type: Array, + default: () => [] + }, + backgroundColor: { + type: String, + default: 'transparent' } - } - for (;isRight ? index >= 0 : length > index; index += i) if (index in self) { - memo = callbackfn(memo, self[index], index, O); - } - return memo; - }; - - _export(_export.P + _export.F * !_strictMethod([].reduce, true), 'Array', { - // 22.1.3.18 / 15.4.4.21 Array.prototype.reduce(callbackfn [, initialValue]) - reduce: function reduce(callbackfn /* , initialValue */) { - return _arrayReduce(this, callbackfn, arguments.length, arguments[1], false); - } - }); - - // 21.2.5.3 get RegExp.prototype.flags - - var _flags = function () { - var that = _anObject(this); - var result = ''; - if (that.global) result += 'g'; - if (that.ignoreCase) result += 'i'; - if (that.multiline) result += 'm'; - if (that.unicode) result += 'u'; - if (that.sticky) result += 'y'; - return result; - }; - - // 21.2.5.3 get RegExp.prototype.flags() - if (_descriptors && /./g.flags != 'g') _objectDp.f(RegExp.prototype, 'flags', { - configurable: true, - get: _flags - }); - - var TO_STRING = 'toString'; - var $toString = /./[TO_STRING]; - - var define = function (fn) { - _redefine(RegExp.prototype, TO_STRING, fn, true); - }; - - // 21.2.5.14 RegExp.prototype.toString() - if (_fails(function () { return $toString.call({ source: 'a', flags: 'b' }) != '/a/b'; })) { - define(function toString() { - var R = _anObject(this); - return '/'.concat(R.source, '/', - 'flags' in R ? R.flags : !_descriptors && R instanceof RegExp ? _flags.call(R) : undefined); - }); - // FF44- RegExp#toString has a wrong name - } else if ($toString.name != TO_STRING) { - define(function toString() { - return $toString.call(this); - }); - } - - var DateProto = Date.prototype; - var INVALID_DATE = 'Invalid Date'; - var TO_STRING$1 = 'toString'; - var $toString$1 = DateProto[TO_STRING$1]; - var getTime = DateProto.getTime; - if (new Date(NaN) + '' != INVALID_DATE) { - _redefine(DateProto, TO_STRING$1, function toString() { - var value = getTime.call(this); - // eslint-disable-next-line no-self-compare - return value === value ? $toString$1.call(this) : INVALID_DATE; - }); - } - - // 19.1.3.6 Object.prototype.toString() - - var test = {}; - test[_wks('toStringTag')] = 'z'; - if (test + '' != '[object z]') { - _redefine(Object.prototype, 'toString', function toString() { - return '[object ' + _classof(this) + ']'; - }, true); - } - - var $filter = _arrayMethods(2); - - _export(_export.P + _export.F * !_strictMethod([].filter, true), 'Array', { - // 22.1.3.7 / 15.4.4.20 Array.prototype.filter(callbackfn [, thisArg]) - filter: function filter(callbackfn /* , thisArg */) { - return $filter(this, callbackfn, arguments[1]); - } - }); - - var util = createCommonjsModule(function (module, exports) { - - - - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.deepClone = deepClone; - exports.eliminateBlur = eliminateBlur; - exports.checkPointIsInCircle = checkPointIsInCircle; - exports.getTwoPointDistance = getTwoPointDistance; - exports.checkPointIsInPolygon = checkPointIsInPolygon; - exports.checkPointIsInSector = checkPointIsInSector; - exports.checkPointIsNearPolyline = checkPointIsNearPolyline; - exports.checkPointIsInRect = checkPointIsInRect; - exports.getRotatePointPos = getRotatePointPos; - exports.getScalePointPos = getScalePointPos; - exports.getTranslatePointPos = getTranslatePointPos; - exports.getDistanceBetweenPointAndLine = getDistanceBetweenPointAndLine; - exports.getCircleRadianPoint = getCircleRadianPoint; - exports.getRegularPolygonPoints = getRegularPolygonPoints; - exports.filterNull = filterNull; - exports["default"] = void 0; - - - - - - - - - - + }, + data() { + return { + ref: 'border-box-10', + border: ['left-top', 'right-top', 'left-bottom', 'right-bottom'], + defaultColor: ['#1d48c4', '#d3e1f8'], + mergedColor: [] + }; + }, + watch: { + color() { + const { + mergeColor + } = this; + mergeColor(); + } + }, + methods: { + mergeColor() { + const { + color, + defaultColor + } = this; + this.mergedColor = util_2$1(util_1(defaultColor, true), color || []); + } + }, + mounted() { + const { + mergeColor + } = this; + mergeColor(); + } + }; + /* script */ + const __vue_script__$b = script$b; + /* template */ + var __vue_render__$b = function() { + var _vm = this; + var _h = _vm.$createElement; + var _c = _vm._self._c || _h; + return _c( + "div", + { + ref: _vm.ref, + staticClass: "dv-border-box-10", + style: "box-shadow: inset 0 0 25px 3px " + _vm.mergedColor[0] + }, + [ + _c( + "svg", + { + staticClass: "dv-border-svg-container", + attrs: { width: _vm.width, height: _vm.height } + }, + [ + _c("polygon", { + attrs: { + fill: _vm.backgroundColor, + points: + "\n 4, 0 " + + (_vm.width - 4) + + ", 0 " + + _vm.width + + ", 4 " + + _vm.width + + ", " + + (_vm.height - 4) + + " " + + (_vm.width - 4) + + ", " + + _vm.height + + "\n 4, " + + _vm.height + + " 0, " + + (_vm.height - 4) + + " 0, 4\n " + } + }) + ] + ), + _vm._v(" "), + _vm._l(_vm.border, function(item) { + return _c( + "svg", + { + key: item, + class: item + " dv-border-svg-container", + attrs: { width: "150px", height: "150px" } + }, + [ + _c("polygon", { + attrs: { + fill: _vm.mergedColor[1], + points: "40, 0 5, 0 0, 5 0, 16 3, 19 3, 7 7, 3 35, 3" + } + }) + ] + ) + }), + _vm._v(" "), + _c("div", { staticClass: "border-box-content" }, [_vm._t("default")], 2) + ], + 2 + ) + }; + var __vue_staticRenderFns__$b = []; + __vue_render__$b._withStripped = true; + /* style */ + const __vue_inject_styles__$b = function (inject) { + if (!inject) return + inject("data-v-746a9ff1_0", { source: ".dv-border-box-10 {\n position: relative;\n width: 100%;\n height: 100%;\n border-radius: 6px;\n}\n.dv-border-box-10 .dv-border-svg-container {\n position: absolute;\n display: block;\n}\n.dv-border-box-10 .right-top {\n right: 0px;\n transform: rotateY(180deg);\n}\n.dv-border-box-10 .left-bottom {\n bottom: 0px;\n transform: rotateX(180deg);\n}\n.dv-border-box-10 .right-bottom {\n right: 0px;\n bottom: 0px;\n transform: rotateX(180deg) rotateY(180deg);\n}\n.dv-border-box-10 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;EACZ,kBAAkB;AACpB;AACA;EACE,kBAAkB;EAClB,cAAc;AAChB;AACA;EACE,UAAU;EACV,0BAA0B;AAC5B;AACA;EACE,WAAW;EACX,0BAA0B;AAC5B;AACA;EACE,UAAU;EACV,WAAW;EACX,0CAA0C;AAC5C;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd","file":"main.vue","sourcesContent":[".dv-border-box-10 {\n position: relative;\n width: 100%;\n height: 100%;\n border-radius: 6px;\n}\n.dv-border-box-10 .dv-border-svg-container {\n position: absolute;\n display: block;\n}\n.dv-border-box-10 .right-top {\n right: 0px;\n transform: rotateY(180deg);\n}\n.dv-border-box-10 .left-bottom {\n bottom: 0px;\n transform: rotateX(180deg);\n}\n.dv-border-box-10 .right-bottom {\n right: 0px;\n bottom: 0px;\n transform: rotateX(180deg) rotateY(180deg);\n}\n.dv-border-box-10 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n"]}, media: undefined }); + }; + /* scoped */ + const __vue_scope_id__$b = undefined; + /* module identifier */ + const __vue_module_identifier__$b = undefined; + /* functional template */ + const __vue_is_functional_template__$b = false; + /* style inject SSR */ + + /* style inject shadow dom */ + + + const __vue_component__$b = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$b, staticRenderFns: __vue_staticRenderFns__$b }, + __vue_inject_styles__$b, + __vue_script__$b, + __vue_scope_id__$b, + __vue_is_functional_template__$b, + __vue_module_identifier__$b, + false, + createInjector, + undefined, + undefined + ); + function borderBox10 (Vue) { + Vue.component(__vue_component__$b.name, __vue_component__$b); + } + var keywords = createCommonjsModule(function (module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports["default"] = void 0; - function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } + var _default = new Map([['transparent', 'rgba(0,0,0,0)'], ['black', '#000000'], ['silver', '#C0C0C0'], ['gray', '#808080'], ['white', '#FFFFFF'], ['maroon', '#800000'], ['red', '#FF0000'], ['purple', '#800080'], ['fuchsia', '#FF00FF'], ['green', '#008000'], ['lime', '#00FF00'], ['olive', '#808000'], ['yellow', '#FFFF00'], ['navy', '#000080'], ['blue', '#0000FF'], ['teal', '#008080'], ['aqua', '#00FFFF'], ['aliceblue', '#f0f8ff'], ['antiquewhite', '#faebd7'], ['aquamarine', '#7fffd4'], ['azure', '#f0ffff'], ['beige', '#f5f5dc'], ['bisque', '#ffe4c4'], ['blanchedalmond', '#ffebcd'], ['blueviolet', '#8a2be2'], ['brown', '#a52a2a'], ['burlywood', '#deb887'], ['cadetblue', '#5f9ea0'], ['chartreuse', '#7fff00'], ['chocolate', '#d2691e'], ['coral', '#ff7f50'], ['cornflowerblue', '#6495ed'], ['cornsilk', '#fff8dc'], ['crimson', '#dc143c'], ['cyan', '#00ffff'], ['darkblue', '#00008b'], ['darkcyan', '#008b8b'], ['darkgoldenrod', '#b8860b'], ['darkgray', '#a9a9a9'], ['darkgreen', '#006400'], ['darkgrey', '#a9a9a9'], ['darkkhaki', '#bdb76b'], ['darkmagenta', '#8b008b'], ['darkolivegreen', '#556b2f'], ['darkorange', '#ff8c00'], ['darkorchid', '#9932cc'], ['darkred', '#8b0000'], ['darksalmon', '#e9967a'], ['darkseagreen', '#8fbc8f'], ['darkslateblue', '#483d8b'], ['darkslategray', '#2f4f4f'], ['darkslategrey', '#2f4f4f'], ['darkturquoise', '#00ced1'], ['darkviolet', '#9400d3'], ['deeppink', '#ff1493'], ['deepskyblue', '#00bfff'], ['dimgray', '#696969'], ['dimgrey', '#696969'], ['dodgerblue', '#1e90ff'], ['firebrick', '#b22222'], ['floralwhite', '#fffaf0'], ['forestgreen', '#228b22'], ['gainsboro', '#dcdcdc'], ['ghostwhite', '#f8f8ff'], ['gold', '#ffd700'], ['goldenrod', '#daa520'], ['greenyellow', '#adff2f'], ['grey', '#808080'], ['honeydew', '#f0fff0'], ['hotpink', '#ff69b4'], ['indianred', '#cd5c5c'], ['indigo', '#4b0082'], ['ivory', '#fffff0'], ['khaki', '#f0e68c'], ['lavender', '#e6e6fa'], ['lavenderblush', '#fff0f5'], ['lawngreen', '#7cfc00'], ['lemonchiffon', '#fffacd'], ['lightblue', '#add8e6'], ['lightcoral', '#f08080'], ['lightcyan', '#e0ffff'], ['lightgoldenrodyellow', '#fafad2'], ['lightgray', '#d3d3d3'], ['lightgreen', '#90ee90'], ['lightgrey', '#d3d3d3'], ['lightpink', '#ffb6c1'], ['lightsalmon', '#ffa07a'], ['lightseagreen', '#20b2aa'], ['lightskyblue', '#87cefa'], ['lightslategray', '#778899'], ['lightslategrey', '#778899'], ['lightsteelblue', '#b0c4de'], ['lightyellow', '#ffffe0'], ['limegreen', '#32cd32'], ['linen', '#faf0e6'], ['magenta', '#ff00ff'], ['mediumaquamarine', '#66cdaa'], ['mediumblue', '#0000cd'], ['mediumorchid', '#ba55d3'], ['mediumpurple', '#9370db'], ['mediumseagreen', '#3cb371'], ['mediumslateblue', '#7b68ee'], ['mediumspringgreen', '#00fa9a'], ['mediumturquoise', '#48d1cc'], ['mediumvioletred', '#c71585'], ['midnightblue', '#191970'], ['mintcream', '#f5fffa'], ['mistyrose', '#ffe4e1'], ['moccasin', '#ffe4b5'], ['navajowhite', '#ffdead'], ['oldlace', '#fdf5e6'], ['olivedrab', '#6b8e23'], ['orange', '#ffa500'], ['orangered', '#ff4500'], ['orchid', '#da70d6'], ['palegoldenrod', '#eee8aa'], ['palegreen', '#98fb98'], ['paleturquoise', '#afeeee'], ['palevioletred', '#db7093'], ['papayawhip', '#ffefd5'], ['peachpuff', '#ffdab9'], ['peru', '#cd853f'], ['pink', '#ffc0cb'], ['plum', '#dda0dd'], ['powderblue', '#b0e0e6'], ['rosybrown', '#bc8f8f'], ['royalblue', '#4169e1'], ['saddlebrown', '#8b4513'], ['salmon', '#fa8072'], ['sandybrown', '#f4a460'], ['seagreen', '#2e8b57'], ['seashell', '#fff5ee'], ['sienna', '#a0522d'], ['skyblue', '#87ceeb'], ['slateblue', '#6a5acd'], ['slategray', '#708090'], ['slategrey', '#708090'], ['snow', '#fffafa'], ['springgreen', '#00ff7f'], ['steelblue', '#4682b4'], ['tan', '#d2b48c'], ['thistle', '#d8bfd8'], ['tomato', '#ff6347'], ['turquoise', '#40e0d0'], ['violet', '#ee82ee'], ['wheat', '#f5deb3'], ['whitesmoke', '#f5f5f5'], ['yellowgreen', '#9acd32']]); - function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } + exports["default"] = _default; + }); - function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } + unwrapExports(keywords); - function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } + var lib = createCommonjsModule(function (module, exports) { - function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } - function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } - function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.getRgbValue = getRgbValue; + exports.getRgbaValue = getRgbaValue; + exports.getOpacity = getOpacity; + exports.toRgb = toRgb; + exports.toHex = toHex; + exports.getColorFromRgbValue = getColorFromRgbValue; + exports.darken = darken; + exports.lighten = lighten; + exports.fade = fade; + exports["default"] = void 0; - function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + var _toConsumableArray2 = interopRequireDefault(toConsumableArray); - function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + var _keywords = interopRequireDefault(keywords); - var abs = Math.abs, - sqrt = Math.sqrt, - sin = Math.sin, - cos = Math.cos, - max = Math.max, - min = Math.min, - PI = Math.PI; - /** - * @description Clone an object or array - * @param {Object|Array} object Cloned object - * @param {Boolean} recursion Whether to use recursive cloning - * @return {Object|Array} Clone object + var hexReg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/; + var rgbReg = /^(rgb|rgba|RGB|RGBA)/; + var rgbaReg = /^(rgba|RGBA)/; + /** + * @description Color validator + * @param {String} color Hex|Rgb|Rgba color or color keyword + * @return {String|Boolean} Valid color Or false */ - function deepClone(object) { - var recursion = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - var parse = JSON.parse, - stringify = JSON.stringify; - if (!recursion) return parse(stringify(object)); - var clonedObj = object instanceof Array ? [] : {}; + function validator(color) { + var isHex = hexReg.test(color); + var isRgb = rgbReg.test(color); + if (isHex || isRgb) return color; + color = getColorByKeyword(color); - if (object && _typeof(object) === 'object') { - for (var key in object) { - if (object.hasOwnProperty(key)) { - if (object[key] && _typeof(object[key]) === 'object') { - clonedObj[key] = deepClone(object[key], true); - } else { - clonedObj[key] = object[key]; - } - } - } + if (!color) { + console.error('Color: Invalid color!'); + return false; } - return clonedObj; - } - /** - * @description Eliminate line blur due to 1px line width - * @param {Array} points Line points - * @return {Array} Line points after processed - */ - - - function eliminateBlur(points) { - return points.map(function (_ref) { - var _ref2 = _slicedToArray(_ref, 2), - x = _ref2[0], - y = _ref2[1]; - - return [parseInt(x) + 0.5, parseInt(y) + 0.5]; - }); - } - /** - * @description Check if the point is inside the circle - * @param {Array} point Postion of point - * @param {Number} rx Circle x coordinate - * @param {Number} ry Circle y coordinate - * @param {Number} r Circle radius - * @return {Boolean} Result of check - */ - - - function checkPointIsInCircle(point, rx, ry, r) { - return getTwoPointDistance(point, [rx, ry]) <= r; - } - /** - * @description Get the distance between two points - * @param {Array} point1 point1 - * @param {Array} point2 point2 - * @return {Number} Distance between two points - */ - - - function getTwoPointDistance(_ref3, _ref4) { - var _ref5 = _slicedToArray(_ref3, 2), - xa = _ref5[0], - ya = _ref5[1]; - - var _ref6 = _slicedToArray(_ref4, 2), - xb = _ref6[0], - yb = _ref6[1]; - - var minusX = abs(xa - xb); - var minusY = abs(ya - yb); - return sqrt(minusX * minusX + minusY * minusY); + return color; } - /** - * @description Check if the point is inside the polygon - * @param {Array} point Postion of point - * @param {Array} points The points that makes up a polyline - * @return {Boolean} Result of check + /** + * @description Get color by keyword + * @param {String} keyword Color keyword like red, green and etc. + * @return {String|Boolean} Hex or rgba color (Invalid keyword will return false) */ - function checkPointIsInPolygon(point, polygon) { - var counter = 0; - - var _point = _slicedToArray(point, 2), - x = _point[0], - y = _point[1]; - - var pointNum = polygon.length; - - for (var i = 1, p1 = polygon[0]; i <= pointNum; i++) { - var p2 = polygon[i % pointNum]; - - if (x > min(p1[0], p2[0]) && x <= max(p1[0], p2[0])) { - if (y <= max(p1[1], p2[1])) { - if (p1[0] !== p2[0]) { - var xinters = (x - p1[0]) * (p2[1] - p1[1]) / (p2[0] - p1[0]) + p1[1]; - - if (p1[1] === p2[1] || y <= xinters) { - counter++; - } - } - } - } - - p1 = p2; + function getColorByKeyword(keyword) { + if (!keyword) { + console.error('getColorByKeywords: Missing parameters!'); + return false; } - return counter % 2 === 1; + if (!_keywords["default"].has(keyword)) return false; + return _keywords["default"].get(keyword); } - /** - * @description Check if the point is inside the sector - * @param {Array} point Postion of point - * @param {Number} rx Sector x coordinate - * @param {Number} ry Sector y coordinate - * @param {Number} r Sector radius - * @param {Number} startAngle Sector start angle - * @param {Number} endAngle Sector end angle - * @param {Boolean} clockWise Whether the sector angle is clockwise - * @return {Boolean} Result of check + /** + * @description Get the Rgb value of the color + * @param {String} color Hex|Rgb|Rgba color or color keyword + * @return {Array|Boolean} Rgb value of the color (Invalid input will return false) */ - function checkPointIsInSector(point, rx, ry, r, startAngle, endAngle, clockWise) { - if (!point) return false; - if (getTwoPointDistance(point, [rx, ry]) > r) return false; - - if (!clockWise) { - var _deepClone = deepClone([endAngle, startAngle]); - - var _deepClone2 = _slicedToArray(_deepClone, 2); - - startAngle = _deepClone2[0]; - endAngle = _deepClone2[1]; - } - - var reverseBE = startAngle > endAngle; - - if (reverseBE) { - var _ref7 = [endAngle, startAngle]; - startAngle = _ref7[0]; - endAngle = _ref7[1]; + function getRgbValue(color) { + if (!color) { + console.error('getRgbValue: Missing parameters!'); + return false; } - var minus = endAngle - startAngle; - if (minus >= PI * 2) return true; - - var _point2 = _slicedToArray(point, 2), - x = _point2[0], - y = _point2[1]; - - var _getCircleRadianPoint = getCircleRadianPoint(rx, ry, r, startAngle), - _getCircleRadianPoint2 = _slicedToArray(_getCircleRadianPoint, 2), - bx = _getCircleRadianPoint2[0], - by = _getCircleRadianPoint2[1]; + color = validator(color); + if (!color) return false; + var isHex = hexReg.test(color); + var isRgb = rgbReg.test(color); + var lowerColor = color.toLowerCase(); + if (isHex) return getRgbValueFromHex(lowerColor); + if (isRgb) return getRgbValueFromRgb(lowerColor); + } + /** + * @description Get the rgb value of the hex color + * @param {String} color Hex color + * @return {Array} Rgb value of the color + */ - var _getCircleRadianPoint3 = getCircleRadianPoint(rx, ry, r, endAngle), - _getCircleRadianPoint4 = _slicedToArray(_getCircleRadianPoint3, 2), - ex = _getCircleRadianPoint4[0], - ey = _getCircleRadianPoint4[1]; - var vPoint = [x - rx, y - ry]; - var vBArm = [bx - rx, by - ry]; - var vEArm = [ex - rx, ey - ry]; - var reverse = minus > PI; + function getRgbValueFromHex(color) { + color = color.replace('#', ''); + if (color.length === 3) color = Array.from(color).map(function (hexNum) { + return hexNum + hexNum; + }).join(''); + color = color.split(''); + return new Array(3).fill(0).map(function (t, i) { + return parseInt("0x".concat(color[i * 2]).concat(color[i * 2 + 1])); + }); + } + /** + * @description Get the rgb value of the rgb/rgba color + * @param {String} color Hex color + * @return {Array} Rgb value of the color + */ - if (reverse) { - var _deepClone3 = deepClone([vEArm, vBArm]); - var _deepClone4 = _slicedToArray(_deepClone3, 2); + function getRgbValueFromRgb(color) { + return color.replace(/rgb\(|rgba\(|\)/g, '').split(',').slice(0, 3).map(function (n) { + return parseInt(n); + }); + } + /** + * @description Get the Rgba value of the color + * @param {String} color Hex|Rgb|Rgba color or color keyword + * @return {Array|Boolean} Rgba value of the color (Invalid input will return false) + */ + - vBArm = _deepClone4[0]; - vEArm = _deepClone4[1]; + function getRgbaValue(color) { + if (!color) { + console.error('getRgbaValue: Missing parameters!'); + return false; } - var inSector = isClockWise(vBArm, vPoint) && !isClockWise(vEArm, vPoint); - if (reverse) inSector = !inSector; - if (reverseBE) inSector = !inSector; - return inSector; + var colorValue = getRgbValue(color); + if (!colorValue) return false; + colorValue.push(getOpacity(color)); + return colorValue; } - /** - * @description Determine if the point is in the clockwise direction of the vector - * @param {Array} vArm Vector - * @param {Array} vPoint Point - * @return {Boolean} Result of check + /** + * @description Get the opacity of color + * @param {String} color Hex|Rgb|Rgba color or color keyword + * @return {Number|Boolean} Color opacity (Invalid input will return false) */ - function isClockWise(vArm, vPoint) { - var _vArm = _slicedToArray(vArm, 2), - ax = _vArm[0], - ay = _vArm[1]; - - var _vPoint = _slicedToArray(vPoint, 2), - px = _vPoint[0], - py = _vPoint[1]; + function getOpacity(color) { + if (!color) { + console.error('getOpacity: Missing parameters!'); + return false; + } - return -ay * px + ax * py > 0; + color = validator(color); + if (!color) return false; + var isRgba = rgbaReg.test(color); + if (!isRgba) return 1; + color = color.toLowerCase(); + return Number(color.split(',').slice(-1)[0].replace(/[)|\s]/g, '')); } - /** - * @description Check if the point is inside the polyline - * @param {Array} point Postion of point - * @param {Array} polyline The points that makes up a polyline - * @param {Number} lineWidth Polyline linewidth - * @return {Boolean} Result of check + /** + * @description Convert color to Rgb|Rgba color + * @param {String} color Hex|Rgb|Rgba color or color keyword + * @param {Number} opacity The opacity of color + * @return {String|Boolean} Rgb|Rgba color (Invalid input will return false) */ - function checkPointIsNearPolyline(point, polyline, lineWidth) { - var halfLineWidth = lineWidth / 2; - var moveUpPolyline = polyline.map(function (_ref8) { - var _ref9 = _slicedToArray(_ref8, 2), - x = _ref9[0], - y = _ref9[1]; - - return [x, y - halfLineWidth]; - }); - var moveDownPolyline = polyline.map(function (_ref10) { - var _ref11 = _slicedToArray(_ref10, 2), - x = _ref11[0], - y = _ref11[1]; + function toRgb(color, opacity) { + if (!color) { + console.error('toRgb: Missing parameters!'); + return false; + } - return [x, y + halfLineWidth]; - }); - var polygon = [].concat(_toConsumableArray(moveUpPolyline), _toConsumableArray(moveDownPolyline.reverse())); - return checkPointIsInPolygon(point, polygon); + var rgbValue = getRgbValue(color); + if (!rgbValue) return false; + var addOpacity = typeof opacity === 'number'; + if (addOpacity) return 'rgba(' + rgbValue.join(',') + ",".concat(opacity, ")"); + return 'rgb(' + rgbValue.join(',') + ')'; } - /** - * @description Check if the point is inside the rect - * @param {Array} point Postion of point - * @param {Number} x Rect start x coordinate - * @param {Number} y Rect start y coordinate - * @param {Number} width Rect width - * @param {Number} height Rect height - * @return {Boolean} Result of check + /** + * @description Convert color to Hex color + * @param {String} color Hex|Rgb|Rgba color or color keyword + * @return {String|Boolean} Hex color (Invalid input will return false) */ - function checkPointIsInRect(_ref12, x, y, width, height) { - var _ref13 = _slicedToArray(_ref12, 2), - px = _ref13[0], - py = _ref13[1]; + function toHex(color) { + if (!color) { + console.error('toHex: Missing parameters!'); + return false; + } - if (px < x) return false; - if (py < y) return false; - if (px > x + width) return false; - if (py > y + height) return false; - return true; + if (hexReg.test(color)) return color; + color = getRgbValue(color); + if (!color) return false; + return '#' + color.map(function (n) { + return Number(n).toString(16); + }).map(function (n) { + return n === '0' ? '00' : n; + }).join(''); } - /** - * @description Get the coordinates of the rotated point - * @param {Number} rotate Degree of rotation - * @param {Array} point Postion of point - * @param {Array} origin Rotation center - * @param {Array} origin Rotation center - * @return {Number} Coordinates after rotation + /** + * @description Get Color from Rgb|Rgba value + * @param {Array} value Rgb|Rgba color value + * @return {String|Boolean} Rgb|Rgba color (Invalid input will return false) */ - function getRotatePointPos() { - var rotate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; - var point = arguments.length > 1 ? arguments[1] : undefined; - var origin = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [0, 0]; - if (!point) return false; - if (rotate % 360 === 0) return point; + function getColorFromRgbValue(value) { + if (!value) { + console.error('getColorFromRgbValue: Missing parameters!'); + return false; + } - var _point3 = _slicedToArray(point, 2), - x = _point3[0], - y = _point3[1]; + var valueLength = value.length; - var _origin = _slicedToArray(origin, 2), - ox = _origin[0], - oy = _origin[1]; + if (valueLength !== 3 && valueLength !== 4) { + console.error('getColorFromRgbValue: Value is illegal!'); + return false; + } - rotate *= PI / 180; - return [(x - ox) * cos(rotate) - (y - oy) * sin(rotate) + ox, (x - ox) * sin(rotate) + (y - oy) * cos(rotate) + oy]; + var color = valueLength === 3 ? 'rgb(' : 'rgba('; + color += value.join(',') + ')'; + return color; } - /** - * @description Get the coordinates of the scaled point - * @param {Array} scale Scale factor - * @param {Array} point Postion of point - * @param {Array} origin Scale center - * @return {Number} Coordinates after scale + /** + * @description Deepen color + * @param {String} color Hex|Rgb|Rgba color or color keyword + * @return {Number} Percent of Deepen (1-100) + * @return {String|Boolean} Rgba color (Invalid input will return false) */ - function getScalePointPos() { - var scale = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [1, 1]; - var point = arguments.length > 1 ? arguments[1] : undefined; - var origin = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [0, 0]; - if (!point) return false; - if (scale === 1) return point; - - var _point4 = _slicedToArray(point, 2), - x = _point4[0], - y = _point4[1]; - - var _origin2 = _slicedToArray(origin, 2), - ox = _origin2[0], - oy = _origin2[1]; + function darken(color) { + var percent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - var _scale = _slicedToArray(scale, 2), - xs = _scale[0], - ys = _scale[1]; + if (!color) { + console.error('darken: Missing parameters!'); + return false; + } - var relativePosX = x - ox; - var relativePosY = y - oy; - return [relativePosX * xs + ox, relativePosY * ys + oy]; + var rgbaValue = getRgbaValue(color); + if (!rgbaValue) return false; + rgbaValue = rgbaValue.map(function (v, i) { + return i === 3 ? v : v - Math.ceil(2.55 * percent); + }).map(function (v) { + return v < 0 ? 0 : v; + }); + return getColorFromRgbValue(rgbaValue); } - /** - * @description Get the coordinates of the scaled point - * @param {Array} translate Translation distance - * @param {Array} point Postion of point - * @return {Number} Coordinates after translation + /** + * @description Brighten color + * @param {String} color Hex|Rgb|Rgba color or color keyword + * @return {Number} Percent of brighten (1-100) + * @return {String|Boolean} Rgba color (Invalid input will return false) */ - function getTranslatePointPos(translate, point) { - if (!translate || !point) return false; - - var _point5 = _slicedToArray(point, 2), - x = _point5[0], - y = _point5[1]; + function lighten(color) { + var percent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - var _translate = _slicedToArray(translate, 2), - tx = _translate[0], - ty = _translate[1]; + if (!color) { + console.error('lighten: Missing parameters!'); + return false; + } - return [x + tx, y + ty]; + var rgbaValue = getRgbaValue(color); + if (!rgbaValue) return false; + rgbaValue = rgbaValue.map(function (v, i) { + return i === 3 ? v : v + Math.ceil(2.55 * percent); + }).map(function (v) { + return v > 255 ? 255 : v; + }); + return getColorFromRgbValue(rgbaValue); } - /** - * @description Get the distance from the point to the line - * @param {Array} point Postion of point - * @param {Array} lineBegin Line start position - * @param {Array} lineEnd Line end position - * @return {Number} Distance between point and line + /** + * @description Adjust color opacity + * @param {String} color Hex|Rgb|Rgba color or color keyword + * @param {Number} Percent of opacity + * @return {String|Boolean} Rgba color (Invalid input will return false) */ - function getDistanceBetweenPointAndLine(point, lineBegin, lineEnd) { - if (!point || !lineBegin || !lineEnd) return false; + function fade(color) { + var percent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 100; - var _point6 = _slicedToArray(point, 2), - x = _point6[0], - y = _point6[1]; + if (!color) { + console.error('fade: Missing parameters!'); + return false; + } - var _lineBegin = _slicedToArray(lineBegin, 2), - x1 = _lineBegin[0], - y1 = _lineBegin[1]; + var rgbValue = getRgbValue(color); + if (!rgbValue) return false; + var rgbaValue = [].concat((0, _toConsumableArray2["default"])(rgbValue), [percent / 100]); + return getColorFromRgbValue(rgbaValue); + } - var _lineEnd = _slicedToArray(lineEnd, 2), - x2 = _lineEnd[0], - y2 = _lineEnd[1]; + var _default = { + fade: fade, + toHex: toHex, + toRgb: toRgb, + darken: darken, + lighten: lighten, + getOpacity: getOpacity, + getRgbValue: getRgbValue, + getRgbaValue: getRgbaValue, + getColorFromRgbValue: getColorFromRgbValue + }; + exports["default"] = _default; + }); - var a = y2 - y1; - var b = x1 - x2; - var c = y1 * (x2 - x1) - x1 * (y2 - y1); - var molecule = abs(a * x + b * y + c); - var denominator = sqrt(a * a + b * b); - return molecule / denominator; - } - /** - * @description Get the coordinates of the specified radian on the circle - * @param {Number} x Circle x coordinate - * @param {Number} y Circle y coordinate - * @param {Number} radius Circle radius - * @param {Number} radian Specfied radian - * @return {Array} Postion of point - */ + unwrapExports(lib); + var lib_1 = lib.getRgbValue; + var lib_2 = lib.getRgbaValue; + var lib_3 = lib.getOpacity; + var lib_4 = lib.toRgb; + var lib_5 = lib.toHex; + var lib_6 = lib.getColorFromRgbValue; + var lib_7 = lib.darken; + var lib_8 = lib.lighten; + var lib_9 = lib.fade; + + // + var script$c = { + name: 'DvBorderBox11', + mixins: [autoResize], + props: { + color: { + type: Array, + default: () => [] + }, + titleWidth: { + type: Number, + default: 250 + }, + title: { + type: String, + default: '' + }, + backgroundColor: { + type: String, + default: 'transparent' + } + }, + + data() { + const id = uuid(); + return { + ref: 'border-box-11', + filterId: `border-box-11-filterId-${id}`, + defaultColor: ['#8aaafb', '#1f33a2'], + mergedColor: [] + }; + }, + watch: { + color() { + const { + mergeColor + } = this; + mergeColor(); + } - function getCircleRadianPoint(x, y, radius, radian) { - return [x + cos(radian) * radius, y + sin(radian) * radius]; - } - /** - * @description Get the points that make up a regular polygon - * @param {Number} x X coordinate of the polygon inscribed circle - * @param {Number} y Y coordinate of the polygon inscribed circle - * @param {Number} r Radius of the polygon inscribed circle - * @param {Number} side Side number - * @param {Number} minus Radian offset - * @return {Array} Points that make up a regular polygon - */ + }, + methods: { + mergeColor() { + const { + color, + defaultColor + } = this; + this.mergedColor = util_2$1(util_1(defaultColor, true), color || []); + }, + fade: lib_9 + }, - function getRegularPolygonPoints(rx, ry, r, side) { - var minus = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : PI * -0.5; - var radianGap = PI * 2 / side; - var radians = new Array(side).fill('').map(function (t, i) { - return i * radianGap + minus; - }); - return radians.map(function (radian) { - return getCircleRadianPoint(rx, ry, r, radian); - }); - } - /** - * @description Filter array nulls (''|false|null|undefined) - * @param {Array} arr The array to be filtered - * @return {Array} Filtered array - */ + mounted() { + const { + mergeColor + } = this; + mergeColor(); + } + }; - function filterNull(arr) { - return arr.filter(function (v) { - return v || v === 0; - }); - } + /* script */ + const __vue_script__$c = script$c; - var _default = { - deepClone: deepClone, - eliminateBlur: eliminateBlur, - checkPointIsInCircle: checkPointIsInCircle, - checkPointIsInPolygon: checkPointIsInPolygon, - checkPointIsInSector: checkPointIsInSector, - checkPointIsNearPolyline: checkPointIsNearPolyline, - getTwoPointDistance: getTwoPointDistance, - getRotatePointPos: getRotatePointPos, - getScalePointPos: getScalePointPos, - getTranslatePointPos: getTranslatePointPos, - getCircleRadianPoint: getCircleRadianPoint, - getRegularPolygonPoints: getRegularPolygonPoints, - getDistanceBetweenPointAndLine: getDistanceBetweenPointAndLine + /* template */ + var __vue_render__$c = function() { + var _vm = this; + var _h = _vm.$createElement; + var _c = _vm._self._c || _h; + return _c("div", { ref: _vm.ref, staticClass: "dv-border-box-11" }, [ + _c( + "svg", + { + staticClass: "dv-border-svg-container", + attrs: { width: _vm.width, height: _vm.height } + }, + [ + _c("defs", [ + _c( + "filter", + { + attrs: { + id: _vm.filterId, + height: "150%", + width: "150%", + x: "-25%", + y: "-25%" + } + }, + [ + _c("feMorphology", { + attrs: { + operator: "dilate", + radius: "2", + in: "SourceAlpha", + result: "thicken" + } + }), + _vm._v(" "), + _c("feGaussianBlur", { + attrs: { in: "thicken", stdDeviation: "3", result: "blurred" } + }), + _vm._v(" "), + _c("feFlood", { + attrs: { + "flood-color": _vm.mergedColor[1], + result: "glowColor" + } + }), + _vm._v(" "), + _c("feComposite", { + attrs: { + in: "glowColor", + in2: "blurred", + operator: "in", + result: "softGlowColored" + } + }), + _vm._v(" "), + _c( + "feMerge", + [ + _c("feMergeNode", { attrs: { in: "softGlowColored" } }), + _vm._v(" "), + _c("feMergeNode", { attrs: { in: "SourceGraphic" } }) + ], + 1 + ) + ], + 1 + ) + ]), + _vm._v(" "), + _c("polygon", { + attrs: { + fill: _vm.backgroundColor, + points: + "\n 20, 32 " + + (_vm.width * 0.5 - _vm.titleWidth / 2) + + ", 32 " + + (_vm.width * 0.5 - _vm.titleWidth / 2 + 20) + + ", 53\n " + + (_vm.width * 0.5 + _vm.titleWidth / 2 - 20) + + ", 53 " + + (_vm.width * 0.5 + _vm.titleWidth / 2) + + ", 32\n " + + (_vm.width - 20) + + ", 32 " + + (_vm.width - 8) + + ", 48 " + + (_vm.width - 8) + + ", " + + (_vm.height - 25) + + " " + + (_vm.width - 20) + + ", " + + (_vm.height - 8) + + "\n 20, " + + (_vm.height - 8) + + " 8, " + + (_vm.height - 25) + + " 8, 50\n " + } + }), + _vm._v(" "), + _c("polyline", { + attrs: { + stroke: _vm.mergedColor[0], + filter: "url(#" + _vm.filterId + ")", + points: + "\n " + + (_vm.width - _vm.titleWidth) / 2 + + ", 30\n 20, 30 7, 50 7, " + + (50 + (_vm.height - 167) / 2) + + "\n 13, " + + (55 + (_vm.height - 167) / 2) + + " 13, " + + (135 + (_vm.height - 167) / 2) + + "\n 7, " + + (140 + (_vm.height - 167) / 2) + + " 7, " + + (_vm.height - 27) + + "\n 20, " + + (_vm.height - 7) + + " " + + (_vm.width - 20) + + ", " + + (_vm.height - 7) + + " " + + (_vm.width - 7) + + ", " + + (_vm.height - 27) + + "\n " + + (_vm.width - 7) + + ", " + + (140 + (_vm.height - 167) / 2) + + " " + + (_vm.width - 13) + + ", " + + (135 + (_vm.height - 167) / 2) + + "\n " + + (_vm.width - 13) + + ", " + + (55 + (_vm.height - 167) / 2) + + " " + + (_vm.width - 7) + + ", " + + (50 + (_vm.height - 167) / 2) + + "\n " + + (_vm.width - 7) + + ", 50 " + + (_vm.width - 20) + + ", 30 " + + (_vm.width + _vm.titleWidth) / 2 + + ", 30\n " + + ((_vm.width + _vm.titleWidth) / 2 - 20) + + ", 7 " + + ((_vm.width - _vm.titleWidth) / 2 + 20) + + ", 7\n " + + (_vm.width - _vm.titleWidth) / 2 + + ", 30 " + + ((_vm.width - _vm.titleWidth) / 2 + 20) + + ", 52\n " + + ((_vm.width + _vm.titleWidth) / 2 - 20) + + ", 52 " + + (_vm.width + _vm.titleWidth) / 2 + + ", 30\n " + } + }), + _vm._v(" "), + _c("polygon", { + attrs: { + stroke: _vm.mergedColor[0], + fill: "transparent", + points: + "\n " + + ((_vm.width + _vm.titleWidth) / 2 - 5) + + ", 30 " + + ((_vm.width + _vm.titleWidth) / 2 - 21) + + ", 11\n " + + ((_vm.width + _vm.titleWidth) / 2 - 27) + + ", 11 " + + ((_vm.width + _vm.titleWidth) / 2 - 8) + + ", 34\n " + } + }), + _vm._v(" "), + _c("polygon", { + attrs: { + stroke: _vm.mergedColor[0], + fill: "transparent", + points: + "\n " + + ((_vm.width - _vm.titleWidth) / 2 + 5) + + ", 30 " + + ((_vm.width - _vm.titleWidth) / 2 + 22) + + ", 49\n " + + ((_vm.width - _vm.titleWidth) / 2 + 28) + + ", 49 " + + ((_vm.width - _vm.titleWidth) / 2 + 8) + + ", 26\n " + } + }), + _vm._v(" "), + _c("polygon", { + attrs: { + stroke: _vm.mergedColor[0], + fill: _vm.fade(_vm.mergedColor[1] || _vm.defaultColor[1], 30), + filter: "url(#" + _vm.filterId + ")", + points: + "\n " + + ((_vm.width + _vm.titleWidth) / 2 - 11) + + ", 37 " + + ((_vm.width + _vm.titleWidth) / 2 - 32) + + ", 11\n " + + ((_vm.width - _vm.titleWidth) / 2 + 23) + + ", 11 " + + ((_vm.width - _vm.titleWidth) / 2 + 11) + + ", 23\n " + + ((_vm.width - _vm.titleWidth) / 2 + 33) + + ", 49 " + + ((_vm.width + _vm.titleWidth) / 2 - 22) + + ", 49\n " + } + }), + _vm._v(" "), + _c( + "polygon", + { + attrs: { + filter: "url(#" + _vm.filterId + ")", + fill: _vm.mergedColor[0], + opacity: "1", + points: + "\n " + + ((_vm.width - _vm.titleWidth) / 2 - 10) + + ", 37 " + + ((_vm.width - _vm.titleWidth) / 2 - 31) + + ", 37\n " + + ((_vm.width - _vm.titleWidth) / 2 - 25) + + ", 46 " + + ((_vm.width - _vm.titleWidth) / 2 - 4) + + ", 46\n " + } + }, + [ + _c("animate", { + attrs: { + attributeName: "opacity", + values: "1;0.7;1", + dur: "2s", + begin: "0s", + repeatCount: "indefinite" + } + }) + ] + ), + _vm._v(" "), + _c( + "polygon", + { + attrs: { + filter: "url(#" + _vm.filterId + ")", + fill: _vm.mergedColor[0], + opacity: "0.7", + points: + "\n " + + ((_vm.width - _vm.titleWidth) / 2 - 40) + + ", 37 " + + ((_vm.width - _vm.titleWidth) / 2 - 61) + + ", 37\n " + + ((_vm.width - _vm.titleWidth) / 2 - 55) + + ", 46 " + + ((_vm.width - _vm.titleWidth) / 2 - 34) + + ", 46\n " + } + }, + [ + _c("animate", { + attrs: { + attributeName: "opacity", + values: "0.7;0.4;0.7", + dur: "2s", + begin: "0s", + repeatCount: "indefinite" + } + }) + ] + ), + _vm._v(" "), + _c( + "polygon", + { + attrs: { + filter: "url(#" + _vm.filterId + ")", + fill: _vm.mergedColor[0], + opacity: "0.5", + points: + "\n " + + ((_vm.width - _vm.titleWidth) / 2 - 70) + + ", 37 " + + ((_vm.width - _vm.titleWidth) / 2 - 91) + + ", 37\n " + + ((_vm.width - _vm.titleWidth) / 2 - 85) + + ", 46 " + + ((_vm.width - _vm.titleWidth) / 2 - 64) + + ", 46\n " + } + }, + [ + _c("animate", { + attrs: { + attributeName: "opacity", + values: "0.5;0.2;0.5", + dur: "2s", + begin: "0s", + repeatCount: "indefinite" + } + }) + ] + ), + _vm._v(" "), + _c( + "polygon", + { + attrs: { + filter: "url(#" + _vm.filterId + ")", + fill: _vm.mergedColor[0], + opacity: "1", + points: + "\n " + + ((_vm.width + _vm.titleWidth) / 2 + 30) + + ", 37 " + + ((_vm.width + _vm.titleWidth) / 2 + 9) + + ", 37\n " + + ((_vm.width + _vm.titleWidth) / 2 + 3) + + ", 46 " + + ((_vm.width + _vm.titleWidth) / 2 + 24) + + ", 46\n " + } + }, + [ + _c("animate", { + attrs: { + attributeName: "opacity", + values: "1;0.7;1", + dur: "2s", + begin: "0s", + repeatCount: "indefinite" + } + }) + ] + ), + _vm._v(" "), + _c( + "polygon", + { + attrs: { + filter: "url(#" + _vm.filterId + ")", + fill: _vm.mergedColor[0], + opacity: "0.7", + points: + "\n " + + ((_vm.width + _vm.titleWidth) / 2 + 60) + + ", 37 " + + ((_vm.width + _vm.titleWidth) / 2 + 39) + + ", 37\n " + + ((_vm.width + _vm.titleWidth) / 2 + 33) + + ", 46 " + + ((_vm.width + _vm.titleWidth) / 2 + 54) + + ", 46\n " + } + }, + [ + _c("animate", { + attrs: { + attributeName: "opacity", + values: "0.7;0.4;0.7", + dur: "2s", + begin: "0s", + repeatCount: "indefinite" + } + }) + ] + ), + _vm._v(" "), + _c( + "polygon", + { + attrs: { + filter: "url(#" + _vm.filterId + ")", + fill: _vm.mergedColor[0], + opacity: "0.5", + points: + "\n " + + ((_vm.width + _vm.titleWidth) / 2 + 90) + + ", 37 " + + ((_vm.width + _vm.titleWidth) / 2 + 69) + + ", 37\n " + + ((_vm.width + _vm.titleWidth) / 2 + 63) + + ", 46 " + + ((_vm.width + _vm.titleWidth) / 2 + 84) + + ", 46\n " + } + }, + [ + _c("animate", { + attrs: { + attributeName: "opacity", + values: "0.5;0.2;0.5", + dur: "2s", + begin: "0s", + repeatCount: "indefinite" + } + }) + ] + ), + _vm._v(" "), + _c( + "text", + { + staticClass: "dv-border-box-11-title", + attrs: { + x: "" + _vm.width / 2, + y: "32", + fill: "#fff", + "font-size": "18", + "text-anchor": "middle", + "dominant-baseline": "middle" + } + }, + [_vm._v("\n " + _vm._s(_vm.title) + "\n ")] + ), + _vm._v(" "), + _c("polygon", { + attrs: { + fill: _vm.mergedColor[0], + filter: "url(#" + _vm.filterId + ")", + points: + "\n 7, " + + (53 + (_vm.height - 167) / 2) + + " 11, " + + (57 + (_vm.height - 167) / 2) + + "\n 11, " + + (133 + (_vm.height - 167) / 2) + + " 7, " + + (137 + (_vm.height - 167) / 2) + + "\n " + } + }), + _vm._v(" "), + _c("polygon", { + attrs: { + fill: _vm.mergedColor[0], + filter: "url(#" + _vm.filterId + ")", + points: + "\n " + + (_vm.width - 7) + + ", " + + (53 + (_vm.height - 167) / 2) + + " " + + (_vm.width - 11) + + ", " + + (57 + (_vm.height - 167) / 2) + + "\n " + + (_vm.width - 11) + + ", " + + (133 + (_vm.height - 167) / 2) + + " " + + (_vm.width - 7) + + ", " + + (137 + (_vm.height - 167) / 2) + + "\n " + } + }) + ] + ), + _vm._v(" "), + _c("div", { staticClass: "border-box-content" }, [_vm._t("default")], 2) + ]) }; - exports["default"] = _default; - }); - - unwrapExports(util); - var util_1 = util.deepClone; - var util_2 = util.eliminateBlur; - var util_3 = util.checkPointIsInCircle; - var util_4 = util.getTwoPointDistance; - var util_5 = util.checkPointIsInPolygon; - var util_6 = util.checkPointIsInSector; - var util_7 = util.checkPointIsNearPolyline; - var util_8 = util.checkPointIsInRect; - var util_9 = util.getRotatePointPos; - var util_10 = util.getScalePointPos; - var util_11 = util.getTranslatePointPos; - var util_12 = util.getDistanceBetweenPointAndLine; - var util_13 = util.getCircleRadianPoint; - var util_14 = util.getRegularPolygonPoints; - var util_15 = util.filterNull; - - var util$1 = createCommonjsModule(function (module, exports) { - - - - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.filterNonNumber = filterNonNumber; - exports.deepMerge = deepMerge; - exports.mulAdd = mulAdd; - exports.mergeSameStackData = mergeSameStackData; - exports.getTwoPointDistance = getTwoPointDistance; - exports.getLinearGradientColor = getLinearGradientColor; - exports.getPolylineLength = getPolylineLength; - exports.getPointToLineDistance = getPointToLineDistance; - exports.initNeedSeries = initNeedSeries; - exports.radianToAngle = radianToAngle; - - - - - - - - - - - - - - - - - - - - - - - - - - - - + var __vue_staticRenderFns__$c = []; + __vue_render__$c._withStripped = true; + /* style */ + const __vue_inject_styles__$c = function (inject) { + if (!inject) return + inject("data-v-10f995ec_0", { source: ".dv-border-box-11 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-11 .dv-border-svg-container {\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0px;\n left: 0px;\n}\n.dv-border-box-11 .dv-border-svg-container > polyline {\n fill: none;\n stroke-width: 1;\n}\n.dv-border-box-11 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;EACZ,QAAQ;EACR,SAAS;AACX;AACA;EACE,UAAU;EACV,eAAe;AACjB;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd","file":"main.vue","sourcesContent":[".dv-border-box-11 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-11 .dv-border-svg-container {\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0px;\n left: 0px;\n}\n.dv-border-box-11 .dv-border-svg-container > polyline {\n fill: none;\n stroke-width: 1;\n}\n.dv-border-box-11 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n"]}, media: undefined }); + }; + /* scoped */ + const __vue_scope_id__$c = undefined; + /* module identifier */ + const __vue_module_identifier__$c = undefined; + /* functional template */ + const __vue_is_functional_template__$c = false; + /* style inject SSR */ + + /* style inject shadow dom */ + + + const __vue_component__$c = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$c, staticRenderFns: __vue_staticRenderFns__$c }, + __vue_inject_styles__$c, + __vue_script__$c, + __vue_scope_id__$c, + __vue_is_functional_template__$c, + __vue_module_identifier__$c, + false, + createInjector, + undefined, + undefined + ); + function borderBox11 (Vue) { + Vue.component(__vue_component__$c.name, __vue_component__$c); + } - function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } + // + var script$d = { + name: 'DvBorderBox12', + mixins: [autoResize], + props: { + color: { + type: Array, + default: () => [] + }, + backgroundColor: { + type: String, + default: 'transparent' + } + }, - function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } + data() { + const id = uuid(); + return { + ref: 'border-box-12', + filterId: `borderr-box-12-filterId-${id}`, + defaultColor: ['#2e6099', '#7ce7fd'], + mergedColor: [] + }; + }, - function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } + watch: { + color() { + const { + mergeColor + } = this; + mergeColor(); + } - function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } + }, + methods: { + mergeColor() { + const { + color, + defaultColor + } = this; + this.mergedColor = util_2$1(util_1(defaultColor, true), color || []); + }, - function filterNonNumber(array) { - return array.filter(function (n) { - return typeof n === 'number'; - }); - } + fade: lib_9 + }, - function deepMerge(target, merged) { - for (var key in merged) { - target[key] = target[key] && target[key].toString() === "[object Object]" ? deepMerge(target[key], merged[key]) : target[key] = merged[key]; + mounted() { + const { + mergeColor + } = this; + mergeColor(); } - return target; - } - - function mulAdd(nums) { - nums = filterNonNumber(nums); - return nums.reduce(function (all, num) { - return all + num; - }, 0); - } - - function mergeSameStackData(item, series) { - var stack = item.stack; - if (!stack) return _toConsumableArray(item.data); - var stacks = series.filter(function (_ref) { - var s = _ref.stack; - return s === stack; - }); - var index = stacks.findIndex(function (_ref2) { - var d = _ref2.data; - return d === item.data; - }); - var datas = stacks.splice(0, index + 1).map(function (_ref3) { - var data = _ref3.data; - return data; - }); - var dataLength = datas[0].length; - return new Array(dataLength).fill(0).map(function (foo, i) { - return mulAdd(datas.map(function (d) { - return d[i]; - })); - }); - } + }; - function getTwoPointDistance(pointOne, pointTwo) { - var minusX = Math.abs(pointOne[0] - pointTwo[0]); - var minusY = Math.abs(pointOne[1] - pointTwo[1]); - return Math.sqrt(minusX * minusX + minusY * minusY); - } + /* script */ + const __vue_script__$d = script$d; - function getLinearGradientColor(ctx, begin, end, color) { - if (!ctx || !begin || !end || !color.length) return; - var colors = color; - typeof colors === 'string' && (colors = [color, color]); - var linearGradientColor = ctx.createLinearGradient.apply(ctx, _toConsumableArray(begin).concat(_toConsumableArray(end))); - var colorGap = 1 / (colors.length - 1); - colors.forEach(function (c, i) { - return linearGradientColor.addColorStop(colorGap * i, c); - }); - return linearGradientColor; - } + /* template */ + var __vue_render__$d = function() { + var _vm = this; + var _h = _vm.$createElement; + var _c = _vm._self._c || _h; + return _c("div", { ref: _vm.ref, staticClass: "dv-border-box-12" }, [ + _c( + "svg", + { + staticClass: "dv-border-svg-container", + attrs: { width: _vm.width, height: _vm.height } + }, + [ + _c("defs", [ + _c( + "filter", + { + attrs: { + id: _vm.filterId, + height: "150%", + width: "150%", + x: "-25%", + y: "-25%" + } + }, + [ + _c("feMorphology", { + attrs: { + operator: "dilate", + radius: "1", + in: "SourceAlpha", + result: "thicken" + } + }), + _vm._v(" "), + _c("feGaussianBlur", { + attrs: { in: "thicken", stdDeviation: "2", result: "blurred" } + }), + _vm._v(" "), + _c( + "feFlood", + { + attrs: { + "flood-color": _vm.fade( + _vm.mergedColor[1] || _vm.defaultColor[1], + 70 + ), + result: "glowColor" + } + }, + [ + _c("animate", { + attrs: { + attributeName: "flood-color", + values: + "\n " + + _vm.fade( + _vm.mergedColor[1] || _vm.defaultColor[1], + 70 + ) + + ";\n " + + _vm.fade( + _vm.mergedColor[1] || _vm.defaultColor[1], + 30 + ) + + ";\n " + + _vm.fade( + _vm.mergedColor[1] || _vm.defaultColor[1], + 70 + ) + + ";\n ", + dur: "3s", + begin: "0s", + repeatCount: "indefinite" + } + }) + ] + ), + _vm._v(" "), + _c("feComposite", { + attrs: { + in: "glowColor", + in2: "blurred", + operator: "in", + result: "softGlowColored" + } + }), + _vm._v(" "), + _c( + "feMerge", + [ + _c("feMergeNode", { attrs: { in: "softGlowColored" } }), + _vm._v(" "), + _c("feMergeNode", { attrs: { in: "SourceGraphic" } }) + ], + 1 + ) + ], + 1 + ) + ]), + _vm._v(" "), + _vm.width && _vm.height + ? _c("path", { + attrs: { + fill: _vm.backgroundColor, + "stroke-width": "2", + stroke: _vm.mergedColor[0], + d: + "\n M15 5 L " + + (_vm.width - 15) + + " 5 Q " + + (_vm.width - 5) + + " 5, " + + (_vm.width - 5) + + " 15\n L " + + (_vm.width - 5) + + " " + + (_vm.height - 15) + + " Q " + + (_vm.width - 5) + + " " + + (_vm.height - 5) + + ", " + + (_vm.width - 15) + + " " + + (_vm.height - 5) + + "\n L 15, " + + (_vm.height - 5) + + " Q 5 " + + (_vm.height - 5) + + " 5 " + + (_vm.height - 15) + + " L 5 15\n Q 5 5 15 5\n " + } + }) + : _vm._e(), + _vm._v(" "), + _c("path", { + attrs: { + "stroke-width": "2", + fill: "transparent", + "stroke-linecap": "round", + filter: "url(#" + _vm.filterId + ")", + stroke: _vm.mergedColor[1], + d: "M 20 5 L 15 5 Q 5 5 5 15 L 5 20" + } + }), + _vm._v(" "), + _c("path", { + attrs: { + "stroke-width": "2", + fill: "transparent", + "stroke-linecap": "round", + filter: "url(#" + _vm.filterId + ")", + stroke: _vm.mergedColor[1], + d: + "M " + + (_vm.width - 20) + + " 5 L " + + (_vm.width - 15) + + " 5 Q " + + (_vm.width - 5) + + " 5 " + + (_vm.width - 5) + + " 15 L " + + (_vm.width - 5) + + " 20" + } + }), + _vm._v(" "), + _c("path", { + attrs: { + "stroke-width": "2", + fill: "transparent", + "stroke-linecap": "round", + filter: "url(#" + _vm.filterId + ")", + stroke: _vm.mergedColor[1], + d: + "\n M " + + (_vm.width - 20) + + " " + + (_vm.height - 5) + + " L " + + (_vm.width - 15) + + " " + + (_vm.height - 5) + + "\n Q " + + (_vm.width - 5) + + " " + + (_vm.height - 5) + + " " + + (_vm.width - 5) + + " " + + (_vm.height - 15) + + "\n L " + + (_vm.width - 5) + + " " + + (_vm.height - 20) + + "\n " + } + }), + _vm._v(" "), + _c("path", { + attrs: { + "stroke-width": "2", + fill: "transparent", + "stroke-linecap": "round", + filter: "url(#" + _vm.filterId + ")", + stroke: _vm.mergedColor[1], + d: + "\n M 20 " + + (_vm.height - 5) + + " L 15 " + + (_vm.height - 5) + + "\n Q 5 " + + (_vm.height - 5) + + " 5 " + + (_vm.height - 15) + + "\n L 5 " + + (_vm.height - 20) + + "\n " + } + }) + ] + ), + _vm._v(" "), + _c("div", { staticClass: "border-box-content" }, [_vm._t("default")], 2) + ]) + }; + var __vue_staticRenderFns__$d = []; + __vue_render__$d._withStripped = true; - function getPolylineLength(points) { - var lineSegments = new Array(points.length - 1).fill(0).map(function (foo, i) { - return [points[i], points[i + 1]]; - }); - var lengths = lineSegments.map(function (item) { - return getTwoPointDistance.apply(void 0, _toConsumableArray(item)); - }); - return mulAdd(lengths); - } + /* style */ + const __vue_inject_styles__$d = function (inject) { + if (!inject) return + inject("data-v-40c58fd4_0", { source: ".dv-border-box-12 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-12 .dv-border-svg-container {\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0px;\n left: 0px;\n}\n.dv-border-box-12 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;EACZ,QAAQ;EACR,SAAS;AACX;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd","file":"main.vue","sourcesContent":[".dv-border-box-12 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-12 .dv-border-svg-container {\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0px;\n left: 0px;\n}\n.dv-border-box-12 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n"]}, media: undefined }); - function getPointToLineDistance(point, linePointOne, linePointTwo) { - var a = getTwoPointDistance(point, linePointOne); - var b = getTwoPointDistance(point, linePointTwo); - var c = getTwoPointDistance(linePointOne, linePointTwo); - return 0.5 * Math.sqrt((a + b + c) * (a + b - c) * (a + c - b) * (b + c - a)) / c; - } + }; + /* scoped */ + const __vue_scope_id__$d = undefined; + /* module identifier */ + const __vue_module_identifier__$d = undefined; + /* functional template */ + const __vue_is_functional_template__$d = false; + /* style inject SSR */ + + /* style inject shadow dom */ + - function initNeedSeries(series, config, type) { - series = series.filter(function (_ref4) { - var st = _ref4.type; - return st === type; - }); - series = series.map(function (item) { - return deepMerge((0, util.deepClone)(config, true), item); - }); - return series.filter(function (_ref5) { - var show = _ref5.show; - return show; - }); - } + + const __vue_component__$d = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$d, staticRenderFns: __vue_staticRenderFns__$d }, + __vue_inject_styles__$d, + __vue_script__$d, + __vue_scope_id__$d, + __vue_is_functional_template__$d, + __vue_module_identifier__$d, + false, + createInjector, + undefined, + undefined + ); - function radianToAngle(radian) { - return radian / Math.PI * 180; + function borderBox12 (Vue) { + Vue.component(__vue_component__$d.name, __vue_component__$d); } - }); - - unwrapExports(util$1); - var util_1$1 = util$1.filterNonNumber; - var util_2$1 = util$1.deepMerge; - var util_3$1 = util$1.mulAdd; - var util_4$1 = util$1.mergeSameStackData; - var util_5$1 = util$1.getTwoPointDistance; - var util_6$1 = util$1.getLinearGradientColor; - var util_7$1 = util$1.getPolylineLength; - var util_8$1 = util$1.getPointToLineDistance; - var util_9$1 = util$1.initNeedSeries; - var util_10$1 = util$1.radianToAngle; // - var script$g = { - name: 'DvDecoration5', + var script$e = { + name: 'DvBorderBox13', mixins: [autoResize], + props: { + color: { + type: Array, + default: () => [] + }, + backgroundColor: { + type: String, + default: 'transparent' + } + }, data() { return { - ref: 'decoration-5', - line1Points: '', - line2Points: '', - line1Length: 0, - line2Length: 0 + ref: 'border-box-13', + defaultColor: ['#6586ec', '#2cf7fe'], + mergedColor: [] }; }, - methods: { - afterAutoResizeMixinInit() { - const { - calcSVGData - } = this; - calcSVGData(); - }, - - calcSVGData() { + watch: { + color() { const { - width, - height + mergeColor } = this; - let line1Points = [[0, height * 0.2], [width * 0.18, height * 0.2], [width * 0.2, height * 0.4], [width * 0.25, height * 0.4], [width * 0.27, height * 0.6], [width * 0.72, height * 0.6], [width * 0.75, height * 0.4], [width * 0.8, height * 0.4], [width * 0.82, height * 0.2], [width, height * 0.2]]; - let line2Points = [[width * 0.3, height * 0.8], [width * 0.7, height * 0.8]]; - const line1Length = util_7$1(line1Points); - const line2Length = util_7$1(line2Points); - line1Points = line1Points.map(point => point.join(',')).join(' '); - line2Points = line2Points.map(point => point.join(',')).join(' '); - this.line1Points = line1Points; - this.line2Points = line2Points; - this.line1Length = line1Length; - this.line2Length = line2Length; - }, + mergeColor(); + } - onResize() { + }, + methods: { + mergeColor() { const { - calcSVGData + color, + defaultColor } = this; - calcSVGData(); + this.mergedColor = util_2$1(util_1(defaultColor, true), color || []); } + }, + + mounted() { + const { + mergeColor + } = this; + mergeColor(); } + }; /* script */ - const __vue_script__$g = script$g; + const __vue_script__$e = script$e; /* template */ - var __vue_render__$g = function() { + var __vue_render__$e = function() { var _vm = this; var _h = _vm.$createElement; var _c = _vm._self._c || _h; - return _c("div", { ref: _vm.ref, staticClass: "dv-decoration-5" }, [ - _c("svg", { attrs: { width: _vm.width, height: _vm.height } }, [ - _c( - "polyline", - { + return _c("div", { ref: _vm.ref, staticClass: "dv-border-box-13" }, [ + _c( + "svg", + { + staticClass: "dv-border-svg-container", + attrs: { width: _vm.width, height: _vm.height } + }, + [ + _c("path", { + attrs: { + fill: _vm.backgroundColor, + stroke: _vm.mergedColor[0], + d: + "\n M 5 20 L 5 10 L 12 3 L 60 3 L 68 10\n L " + + (_vm.width - 20) + + " 10 L " + + (_vm.width - 5) + + " 25\n L " + + (_vm.width - 5) + + " " + + (_vm.height - 5) + + " L 20 " + + (_vm.height - 5) + + "\n L 5 " + + (_vm.height - 20) + + " L 5 20\n " + } + }), + _vm._v(" "), + _c("path", { attrs: { fill: "transparent", - stroke: "#3f96a5", "stroke-width": "3", - points: _vm.line1Points + "stroke-linecap": "round", + "stroke-dasharray": "10, 5", + stroke: _vm.mergedColor[0], + d: "M 16 9 L 61 9" } - }, - [ - _c("animate", { - attrs: { - attributeName: "stroke-dasharray", - attributeType: "XML", - from: "0, " + _vm.line1Length / 2 + ", 0, " + _vm.line1Length / 2, - to: "0, 0, " + _vm.line1Length + ", 0", - dur: "1.2s", - begin: "0s", - calcMode: "spline", - keyTimes: "0;1", - keySplines: "0.4,1,0.49,0.98", - repeatCount: "indefinite" - } - }) - ] - ), - _vm._v(" "), - _c( - "polyline", - { + }), + _vm._v(" "), + _c("path", { attrs: { fill: "transparent", - stroke: "#3f96a5", - "stroke-width": "2", - points: _vm.line2Points + stroke: _vm.mergedColor[1], + d: "M 5 20 L 5 10 L 12 3 L 60 3 L 68 10" } - }, - [ - _c("animate", { - attrs: { - attributeName: "stroke-dasharray", - attributeType: "XML", - from: "0, " + _vm.line2Length / 2 + ", 0, " + _vm.line2Length / 2, - to: "0, 0, " + _vm.line2Length + ", 0", - dur: "1.2s", - begin: "0s", - calcMode: "spline", - keyTimes: "0;1", - keySplines: ".4,1,.49,.98", - repeatCount: "indefinite" - } - }) - ] - ) - ]) + }), + _vm._v(" "), + _c("path", { + attrs: { + fill: "transparent", + stroke: _vm.mergedColor[1], + d: + "M " + + (_vm.width - 5) + + " " + + (_vm.height - 30) + + " L " + + (_vm.width - 5) + + " " + + (_vm.height - 5) + + " L " + + (_vm.width - 30) + + " " + + (_vm.height - 5) + } + }) + ] + ), + _vm._v(" "), + _c("div", { staticClass: "border-box-content" }, [_vm._t("default")], 2) ]) }; - var __vue_staticRenderFns__$g = []; - __vue_render__$g._withStripped = true; + var __vue_staticRenderFns__$e = []; + __vue_render__$e._withStripped = true; /* style */ - const __vue_inject_styles__$g = function (inject) { + const __vue_inject_styles__$e = function (inject) { if (!inject) return - inject("data-v-77cc82b8_0", { source: ".dv-decoration-5 {\n width: 100%;\n height: 100%;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,WAAW;EACX,YAAY;AACd","file":"main.vue","sourcesContent":[".dv-decoration-5 {\n width: 100%;\n height: 100%;\n}\n"]}, media: undefined }); + inject("data-v-6c30a53b_0", { source: ".dv-border-box-13 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-13 .dv-border-svg-container {\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0px;\n left: 0px;\n}\n.dv-border-box-13 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;EACZ,QAAQ;EACR,SAAS;AACX;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd","file":"main.vue","sourcesContent":[".dv-border-box-13 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-13 .dv-border-svg-container {\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0px;\n left: 0px;\n}\n.dv-border-box-13 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n"]}, media: undefined }); }; /* scoped */ - const __vue_scope_id__$g = undefined; + const __vue_scope_id__$e = undefined; /* module identifier */ - const __vue_module_identifier__$g = undefined; + const __vue_module_identifier__$e = undefined; /* functional template */ - const __vue_is_functional_template__$g = false; + const __vue_is_functional_template__$e = false; /* style inject SSR */ + /* style inject shadow dom */ + - var Decoration5 = normalizeComponent_1( - { render: __vue_render__$g, staticRenderFns: __vue_staticRenderFns__$g }, - __vue_inject_styles__$g, - __vue_script__$g, - __vue_scope_id__$g, - __vue_is_functional_template__$g, - __vue_module_identifier__$g, - browser, + const __vue_component__$e = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$e, staticRenderFns: __vue_staticRenderFns__$e }, + __vue_inject_styles__$e, + __vue_script__$e, + __vue_scope_id__$e, + __vue_is_functional_template__$e, + __vue_module_identifier__$e, + false, + createInjector, + undefined, undefined ); - function decoration5 (Vue) { - Vue.component(Decoration5.name, Decoration5); + function borderBox13 (Vue) { + Vue.component(__vue_component__$e.name, __vue_component__$e); } // - var script$h = { - name: 'DvDecoration6', + var script$f = { + name: 'DvDecoration1', mixins: [autoResize], + props: { + color: { + type: Array, + default: () => [] + } + }, data() { - const rectWidth = 7; + const pointSideLength = 2.5; return { - ref: 'decoration-6', - svgWH: [300, 35], + ref: 'decoration-1', + svgWH: [200, 50], svgScale: [1, 1], - rowNum: 1, - rowPoints: 40, - rectWidth, - halfRectWidth: rectWidth / 2, + rowNum: 4, + rowPoints: 20, + pointSideLength, + halfPointSideLength: pointSideLength / 2, points: [], - heights: [], - minHeights: [], - randoms: [] + rects: [], + defaultColor: ['#fff', '#0de7c2'], + mergedColor: [] }; }, + watch: { + color() { + const { + mergeColor + } = this; + mergeColor(); + } + + }, methods: { afterAutoResizeMixinInit() { const { @@ -5133,9 +5243,11 @@ calcSVGData() { const { calcPointsPosition, + calcRectsPosition, calcScale } = this; calcPointsPosition(); + calcRectsPosition(); calcScale(); }, @@ -5150,9 +5262,16 @@ const verticalGap = h / (rowNum + 1); let points = new Array(rowNum).fill(0).map((foo, i) => new Array(rowPoints).fill(0).map((foo, j) => [horizontalGap * (j + 1), verticalGap * (i + 1)])); this.points = points.reduce((all, item) => [...all, ...item], []); - const heights = this.heights = new Array(rowNum * rowPoints).fill(0).map(foo => Math.random() > 0.8 ? randomExtend(0.7 * h, h) : randomExtend(0.2 * h, 0.5 * h)); - this.minHeights = new Array(rowNum * rowPoints).fill(0).map((foo, i) => heights[i] * Math.random()); - this.randoms = new Array(rowNum * rowPoints).fill(0).map(foo => Math.random() + 1.5); + }, + + calcRectsPosition() { + const { + points, + rowPoints + } = this; + const rect1 = points[rowPoints * 2 - 1]; + const rect2 = points[rowPoints * 2 - 3]; + this.rects = [rect1, rect2]; }, calcScale() { @@ -5170,20 +5289,36 @@ calcSVGData } = this; calcSVGData(); + }, + + mergeColor() { + const { + color, + defaultColor + } = this; + this.mergedColor = util_2$1(util_1(defaultColor, true), color || []); } + }, + + mounted() { + const { + mergeColor + } = this; + mergeColor(); } + }; /* script */ - const __vue_script__$h = script$h; + const __vue_script__$f = script$f; /* template */ - var __vue_render__$h = function() { + var __vue_render__$f = function() { var _vm = this; var _h = _vm.$createElement; var _c = _vm._self._c || _h; - return _c("div", { ref: _vm.ref, staticClass: "dv-decoration-6" }, [ + return _c("div", { ref: _vm.ref, staticClass: "dv-decoration-1" }, [ _c( "svg", { @@ -5194,34 +5329,55 @@ [ _vm._l(_vm.points, function(point, i) { return [ - _c( + Math.random() > 0.6 + ? _c( + "rect", + { + key: i, + attrs: { + fill: _vm.mergedColor[0], + x: point[0] - _vm.halfPointSideLength, + y: point[1] - _vm.halfPointSideLength, + width: _vm.pointSideLength, + height: _vm.pointSideLength + } + }, + [ + Math.random() > 0.6 + ? _c("animate", { + attrs: { + attributeName: "fill", + values: _vm.mergedColor[0] + ";transparent", + dur: "1s", + begin: Math.random() * 2, + repeatCount: "indefinite" + } + }) + : _vm._e() + ] + ) + : _vm._e() + ] + }), + _vm._v(" "), + _vm.rects[0] + ? _c( "rect", { - key: i, attrs: { - fill: "#7acaec", - x: point[0] - _vm.halfRectWidth, - y: point[1] - _vm.heights[i] / 2, - width: _vm.rectWidth, - height: _vm.heights[i] + fill: _vm.mergedColor[1], + x: _vm.rects[0][0] - _vm.pointSideLength, + y: _vm.rects[0][1] - _vm.pointSideLength, + width: _vm.pointSideLength * 2, + height: _vm.pointSideLength * 2 } }, [ _c("animate", { attrs: { - attributeName: "y", - values: - point[1] - - _vm.minHeights[i] / 2 + - ";" + - (point[1] - _vm.heights[i] / 2) + - ";" + - (point[1] - _vm.minHeights[i] / 2), - dur: _vm.randoms[i] + "s", - keyTimes: "0;0.5;1", - calcMode: "spline", - keySplines: "0.42,0,0.58,1;0.42,0,0.58,1", - begin: "0s", + attributeName: "width", + values: "0;" + _vm.pointSideLength * 2, + dur: "2s", repeatCount: "indefinite" } }), @@ -5229,334 +5385,395 @@ _c("animate", { attrs: { attributeName: "height", + values: "0;" + _vm.pointSideLength * 2, + dur: "2s", + repeatCount: "indefinite" + } + }), + _vm._v(" "), + _c("animate", { + attrs: { + attributeName: "x", values: - _vm.minHeights[i] + - ";" + - _vm.heights[i] + + _vm.rects[0][0] + ";" + - _vm.minHeights[i], - dur: _vm.randoms[i] + "s", - keyTimes: "0;0.5;1", - calcMode: "spline", - keySplines: "0.42,0,0.58,1;0.42,0,0.58,1", - begin: "0s", + (_vm.rects[0][0] - _vm.pointSideLength), + dur: "2s", repeatCount: "indefinite" } - }) - ] - ) - ] - }) - ], - 2 - ) - ]) - }; - var __vue_staticRenderFns__$h = []; - __vue_render__$h._withStripped = true; - - /* style */ - const __vue_inject_styles__$h = function (inject) { - if (!inject) return - inject("data-v-0c456aa4_0", { source: ".dv-decoration-6 {\n width: 100%;\n height: 100%;\n}\n.dv-decoration-6 svg {\n transform-origin: left top;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,WAAW;EACX,YAAY;AACd;AACA;EACE,0BAA0B;AAC5B","file":"main.vue","sourcesContent":[".dv-decoration-6 {\n width: 100%;\n height: 100%;\n}\n.dv-decoration-6 svg {\n transform-origin: left top;\n}\n"]}, media: undefined }); - - }; - /* scoped */ - const __vue_scope_id__$h = undefined; - /* module identifier */ - const __vue_module_identifier__$h = undefined; - /* functional template */ - const __vue_is_functional_template__$h = false; - /* style inject SSR */ - - - - var Decoration6 = normalizeComponent_1( - { render: __vue_render__$h, staticRenderFns: __vue_staticRenderFns__$h }, - __vue_inject_styles__$h, - __vue_script__$h, - __vue_scope_id__$h, - __vue_is_functional_template__$h, - __vue_module_identifier__$h, - browser, - undefined - ); - - function decoration6 (Vue) { - Vue.component(Decoration6.name, Decoration6); - } - - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - var script$i = { - name: 'DvDecoration7' - }; - - /* script */ - const __vue_script__$i = script$i; - - /* template */ - var __vue_render__$i = function() { - var _vm = this; - var _h = _vm.$createElement; - var _c = _vm._self._c || _h; - return _c( - "div", - { staticClass: "dv-decoration-7" }, - [ - _c("svg", { attrs: { width: "21px", height: "20px" } }, [ - _c("polyline", { - attrs: { - "stroke-width": "4", - fill: "transparent", - stroke: "#1dc1f5", - points: "10, 0 19, 10 10, 20" - } - }), - _vm._v(" "), - _c("polyline", { - attrs: { - "stroke-width": "2", - fill: "transparent", - stroke: "#1dc1f5", - points: "2, 0 11, 10 2, 20" - } - }) - ]), - _vm._v(" "), - _vm._t("default"), - _vm._v(" "), - _c("svg", { attrs: { width: "21px", height: "20px" } }, [ - _c("polyline", { - attrs: { - "stroke-width": "4", - fill: "transparent", - stroke: "#1dc1f5", - points: "11, 0 2, 10 11, 20" - } - }), + }), + _vm._v(" "), + _c("animate", { + attrs: { + attributeName: "y", + values: + _vm.rects[0][1] + + ";" + + (_vm.rects[0][1] - _vm.pointSideLength), + dur: "2s", + repeatCount: "indefinite" + } + }) + ] + ) + : _vm._e(), _vm._v(" "), - _c("polyline", { - attrs: { - "stroke-width": "2", - fill: "transparent", - stroke: "#1dc1f5", - points: "19, 0 10, 10 19, 20" - } - }) - ]) - ], - 2 - ) + _vm.rects[1] + ? _c( + "rect", + { + attrs: { + fill: _vm.mergedColor[1], + x: _vm.rects[1][0] - 40, + y: _vm.rects[1][1] - _vm.pointSideLength, + width: 40, + height: _vm.pointSideLength * 2 + } + }, + [ + _c("animate", { + attrs: { + attributeName: "width", + values: "0;40;0", + dur: "2s", + repeatCount: "indefinite" + } + }), + _vm._v(" "), + _c("animate", { + attrs: { + attributeName: "x", + values: + _vm.rects[1][0] + + ";" + + (_vm.rects[1][0] - 40) + + ";" + + _vm.rects[1][0], + dur: "2s", + repeatCount: "indefinite" + } + }) + ] + ) + : _vm._e() + ], + 2 + ) + ]) }; - var __vue_staticRenderFns__$i = []; - __vue_render__$i._withStripped = true; + var __vue_staticRenderFns__$f = []; + __vue_render__$f._withStripped = true; /* style */ - const __vue_inject_styles__$i = function (inject) { + const __vue_inject_styles__$f = function (inject) { if (!inject) return - inject("data-v-284b76c6_0", { source: ".dv-decoration-7 {\n display: flex;\n width: 100%;\n height: 100%;\n justify-content: center;\n align-items: center;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,aAAa;EACb,WAAW;EACX,YAAY;EACZ,uBAAuB;EACvB,mBAAmB;AACrB","file":"main.vue","sourcesContent":[".dv-decoration-7 {\n display: flex;\n width: 100%;\n height: 100%;\n justify-content: center;\n align-items: center;\n}\n"]}, media: undefined }); + inject("data-v-69241e60_0", { source: ".dv-decoration-1 {\n width: 100%;\n height: 100%;\n}\n.dv-decoration-1 svg {\n transform-origin: left top;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,WAAW;EACX,YAAY;AACd;AACA;EACE,0BAA0B;AAC5B","file":"main.vue","sourcesContent":[".dv-decoration-1 {\n width: 100%;\n height: 100%;\n}\n.dv-decoration-1 svg {\n transform-origin: left top;\n}\n"]}, media: undefined }); }; /* scoped */ - const __vue_scope_id__$i = undefined; + const __vue_scope_id__$f = undefined; /* module identifier */ - const __vue_module_identifier__$i = undefined; + const __vue_module_identifier__$f = undefined; /* functional template */ - const __vue_is_functional_template__$i = false; + const __vue_is_functional_template__$f = false; /* style inject SSR */ + /* style inject shadow dom */ + - var Decoration7 = normalizeComponent_1( - { render: __vue_render__$i, staticRenderFns: __vue_staticRenderFns__$i }, - __vue_inject_styles__$i, - __vue_script__$i, - __vue_scope_id__$i, - __vue_is_functional_template__$i, - __vue_module_identifier__$i, - browser, + const __vue_component__$f = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$f, staticRenderFns: __vue_staticRenderFns__$f }, + __vue_inject_styles__$f, + __vue_script__$f, + __vue_scope_id__$f, + __vue_is_functional_template__$f, + __vue_module_identifier__$f, + false, + createInjector, + undefined, undefined ); - function decoration7 (Vue) { - Vue.component(Decoration7.name, Decoration7); + function decoration1 (Vue) { + Vue.component(__vue_component__$f.name, __vue_component__$f); } // - var script$j = { - name: 'DvDecoration8', + var script$g = { + name: 'DvDecoration2', mixins: [autoResize], props: { + color: { + type: Array, + default: () => [] + }, reverse: { type: Boolean, default: false + }, + dur: { + type: Number, + default: 6 } }, data() { return { - ref: 'decoration-8' + ref: 'decoration-2', + x: 0, + y: 0, + w: 0, + h: 0, + defaultColor: ['#3faacb', '#fff'], + mergedColor: [] }; }, + watch: { + color() { + const { + mergeColor + } = this; + mergeColor(); + }, + + reverse() { + const { + calcSVGData + } = this; + calcSVGData(); + } + + }, methods: { - xPos(pos) { + afterAutoResizeMixinInit() { + const { + calcSVGData + } = this; + calcSVGData(); + }, + + calcSVGData() { const { reverse, - width + width, + height } = this; - if (!reverse) return pos; - return width - pos; + + if (reverse) { + this.w = 1; + this.h = height; + this.x = width / 2; + this.y = 0; + } else { + this.w = width; + this.h = 1; + this.x = 0; + this.y = height / 2; + } + }, + + onResize() { + const { + calcSVGData + } = this; + calcSVGData(); + }, + + mergeColor() { + const { + color, + defaultColor + } = this; + this.mergedColor = util_2$1(util_1(defaultColor, true), color || []); } + }, + + mounted() { + const { + mergeColor + } = this; + mergeColor(); } + }; /* script */ - const __vue_script__$j = script$j; + const __vue_script__$g = script$g; /* template */ - var __vue_render__$j = function() { + var __vue_render__$g = function() { var _vm = this; var _h = _vm.$createElement; var _c = _vm._self._c || _h; - return _c("div", { ref: _vm.ref, staticClass: "dv-decoration-8" }, [ - _c("svg", { attrs: { width: _vm.width, height: _vm.height } }, [ - _c("polyline", { - attrs: { - stroke: "#3f96a5", - "stroke-width": "2", - fill: "transparent", - points: _vm.xPos(0) + ", 0 " + _vm.xPos(30) + ", " + _vm.height / 2 - } - }), - _vm._v(" "), - _c("polyline", { - attrs: { - stroke: "#3f96a5", - "stroke-width": "2", - fill: "transparent", - points: - _vm.xPos(20) + - ", 0 " + - _vm.xPos(50) + - ", " + - _vm.height / 2 + - " " + - _vm.xPos(_vm.width) + - ", " + - _vm.height / 2 - } - }), - _vm._v(" "), - _c("polyline", { - attrs: { - stroke: "#3f96a5", - fill: "transparent", - "stroke-width": "3", - points: - _vm.xPos(0) + - ", " + - (_vm.height - 3) + - ", " + - _vm.xPos(200) + - ", " + - (_vm.height - 3) - } - }) - ]) + return _c("div", { ref: _vm.ref, staticClass: "dv-decoration-2" }, [ + _c( + "svg", + { attrs: { width: _vm.width + "px", height: _vm.height + "px" } }, + [ + _c( + "rect", + { + attrs: { + x: _vm.x, + y: _vm.y, + width: _vm.w, + height: _vm.h, + fill: _vm.mergedColor[0] + } + }, + [ + _c("animate", { + attrs: { + attributeName: _vm.reverse ? "height" : "width", + from: "0", + to: _vm.reverse ? _vm.height : _vm.width, + dur: _vm.dur + "s", + calcMode: "spline", + keyTimes: "0;1", + keySplines: ".42,0,.58,1", + repeatCount: "indefinite" + } + }) + ] + ), + _vm._v(" "), + _c( + "rect", + { + attrs: { + x: _vm.x, + y: _vm.y, + width: "1", + height: "1", + fill: _vm.mergedColor[1] + } + }, + [ + _c("animate", { + attrs: { + attributeName: _vm.reverse ? "y" : "x", + from: "0", + to: _vm.reverse ? _vm.height : _vm.width, + dur: _vm.dur + "s", + calcMode: "spline", + keyTimes: "0;1", + keySplines: "0.42,0,0.58,1", + repeatCount: "indefinite" + } + }) + ] + ) + ] + ) ]) }; - var __vue_staticRenderFns__$j = []; - __vue_render__$j._withStripped = true; + var __vue_staticRenderFns__$g = []; + __vue_render__$g._withStripped = true; /* style */ - const __vue_inject_styles__$j = function (inject) { + const __vue_inject_styles__$g = function (inject) { if (!inject) return - inject("data-v-75375dbc_0", { source: ".dv-decoration-8 {\n display: flex;\n width: 100%;\n height: 100%;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,aAAa;EACb,WAAW;EACX,YAAY;AACd","file":"main.vue","sourcesContent":[".dv-decoration-8 {\n display: flex;\n width: 100%;\n height: 100%;\n}\n"]}, media: undefined }); + inject("data-v-355e4674_0", { source: ".dv-decoration-2 {\n display: flex;\n width: 100%;\n height: 100%;\n justify-content: center;\n align-items: center;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,aAAa;EACb,WAAW;EACX,YAAY;EACZ,uBAAuB;EACvB,mBAAmB;AACrB","file":"main.vue","sourcesContent":[".dv-decoration-2 {\n display: flex;\n width: 100%;\n height: 100%;\n justify-content: center;\n align-items: center;\n}\n"]}, media: undefined }); }; /* scoped */ - const __vue_scope_id__$j = undefined; + const __vue_scope_id__$g = undefined; /* module identifier */ - const __vue_module_identifier__$j = undefined; + const __vue_module_identifier__$g = undefined; /* functional template */ - const __vue_is_functional_template__$j = false; + const __vue_is_functional_template__$g = false; /* style inject SSR */ + /* style inject shadow dom */ + - var Decoration8 = normalizeComponent_1( - { render: __vue_render__$j, staticRenderFns: __vue_staticRenderFns__$j }, - __vue_inject_styles__$j, - __vue_script__$j, - __vue_scope_id__$j, - __vue_is_functional_template__$j, - __vue_module_identifier__$j, - browser, + const __vue_component__$g = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$g, staticRenderFns: __vue_staticRenderFns__$g }, + __vue_inject_styles__$g, + __vue_script__$g, + __vue_scope_id__$g, + __vue_is_functional_template__$g, + __vue_module_identifier__$g, + false, + createInjector, + undefined, undefined ); - function decoration8 (Vue) { - Vue.component(Decoration8.name, Decoration8); + function decoration2 (Vue) { + Vue.component(__vue_component__$g.name, __vue_component__$g); } // - var script$k = { - name: 'DvDecoration9', + var script$h = { + name: 'DvDecoration3', mixins: [autoResize], + props: { + color: { + type: Array, + default: () => [] + } + }, data() { - const timestamp = Date.now(); + const pointSideLength = 7; return { - ref: 'decoration-9', - polygonId: `decoration-9-polygon-${timestamp}`, - svgWH: [100, 100], - svgScale: [1, 1] + ref: 'decoration-3', + svgWH: [300, 35], + svgScale: [1, 1], + rowNum: 2, + rowPoints: 25, + pointSideLength, + halfPointSideLength: pointSideLength / 2, + points: [], + defaultColor: ['#7acaec', 'transparent'], + mergedColor: [] }; }, + watch: { + color() { + const { + mergeColor + } = this; + mergeColor(); + } + + }, methods: { afterAutoResizeMixinInit() { const { + calcSVGData + } = this; + calcSVGData(); + }, + + calcSVGData() { + const { + calcPointsPosition, calcScale } = this; + calcPointsPosition(); calcScale(); }, + calcPointsPosition() { + const { + svgWH, + rowNum, + rowPoints + } = this; + const [w, h] = svgWH; + const horizontalGap = w / (rowPoints + 1); + const verticalGap = h / (rowNum + 1); + let points = new Array(rowNum).fill(0).map((foo, i) => new Array(rowPoints).fill(0).map((foo, j) => [horizontalGap * (j + 1), verticalGap * (i + 1)])); + this.points = points.reduce((all, item) => [...all, ...item], []); + }, + calcScale() { const { width, @@ -5569,311 +5786,396 @@ onResize() { const { - calcScale + calcSVGData } = this; - calcScale(); + calcSVGData(); + }, + + mergeColor() { + const { + color, + defaultColor + } = this; + this.mergedColor = util_2$1(util_1(defaultColor, true), color || []); } + }, + + mounted() { + const { + mergeColor + } = this; + mergeColor(); } + }; /* script */ - const __vue_script__$k = script$k; + const __vue_script__$h = script$h; /* template */ - var __vue_render__$k = function() { + var __vue_render__$h = function() { var _vm = this; var _h = _vm.$createElement; var _c = _vm._self._c || _h; - return _c( - "div", - { ref: _vm.ref, staticClass: "dv-decoration-9" }, - [ - _c( - "svg", - { - style: - "transform:scale(" + _vm.svgScale[0] + "," + _vm.svgScale[1] + ");", - attrs: { width: _vm.svgWH[0] + "px", height: _vm.svgWH[1] + "px" } - }, - [ - _c("defs", [ - _c("polygon", { - attrs: { - id: _vm.polygonId, - points: "15, 46.5, 21, 47.5, 21, 52.5, 15, 53.5" - } - }) - ]), - _vm._v(" "), - _c( - "circle", - { - attrs: { - cx: "50", - cy: "50", - r: "45", - fill: "transparent", - stroke: "rgba(3, 166, 224, 0.5)", - "stroke-width": "10", - "stroke-dasharray": "80, 100, 30, 100" + return _c("div", { ref: _vm.ref, staticClass: "dv-decoration-3" }, [ + _c( + "svg", + { + style: + "transform:scale(" + _vm.svgScale[0] + "," + _vm.svgScale[1] + ");", + attrs: { width: _vm.svgWH[0] + "px", height: _vm.svgWH[1] + "px" } + }, + [ + _vm._l(_vm.points, function(point, i) { + return [ + _c( + "rect", + { + key: i, + attrs: { + fill: _vm.mergedColor[0], + x: point[0] - _vm.halfPointSideLength, + y: point[1] - _vm.halfPointSideLength, + width: _vm.pointSideLength, + height: _vm.pointSideLength + } + }, + [ + Math.random() > 0.6 + ? _c("animate", { + attrs: { + attributeName: "fill", + values: "" + _vm.mergedColor.join(";"), + dur: Math.random() + 1 + "s", + begin: Math.random() * 2, + repeatCount: "indefinite" + } + }) + : _vm._e() + ] + ) + ] + }) + ], + 2 + ) + ]) + }; + var __vue_staticRenderFns__$h = []; + __vue_render__$h._withStripped = true; + + /* style */ + const __vue_inject_styles__$h = function (inject) { + if (!inject) return + inject("data-v-2cd3ac93_0", { source: ".dv-decoration-3 {\n width: 100%;\n height: 100%;\n}\n.dv-decoration-3 svg {\n transform-origin: left top;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,WAAW;EACX,YAAY;AACd;AACA;EACE,0BAA0B;AAC5B","file":"main.vue","sourcesContent":[".dv-decoration-3 {\n width: 100%;\n height: 100%;\n}\n.dv-decoration-3 svg {\n transform-origin: left top;\n}\n"]}, media: undefined }); + + }; + /* scoped */ + const __vue_scope_id__$h = undefined; + /* module identifier */ + const __vue_module_identifier__$h = undefined; + /* functional template */ + const __vue_is_functional_template__$h = false; + /* style inject SSR */ + + /* style inject shadow dom */ + + + + const __vue_component__$h = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$h, staticRenderFns: __vue_staticRenderFns__$h }, + __vue_inject_styles__$h, + __vue_script__$h, + __vue_scope_id__$h, + __vue_is_functional_template__$h, + __vue_module_identifier__$h, + false, + createInjector, + undefined, + undefined + ); + + function decoration3 (Vue) { + Vue.component(__vue_component__$h.name, __vue_component__$h); + } + + // + var script$i = { + name: 'DvDecoration4', + mixins: [autoResize], + props: { + color: { + type: Array, + default: () => [] + }, + reverse: { + type: Boolean, + default: false + }, + dur: { + type: Number, + default: 3 + } + }, + + data() { + return { + ref: 'decoration-4', + defaultColor: ['rgba(255, 255, 255, 0.3)', 'rgba(255, 255, 255, 0.3)'], + mergedColor: [] + }; + }, + + watch: { + color() { + const { + mergeColor + } = this; + mergeColor(); + } + + }, + methods: { + mergeColor() { + const { + color, + defaultColor + } = this; + this.mergedColor = util_2$1(util_1(defaultColor, true), color || []); + } + + }, + + mounted() { + const { + mergeColor + } = this; + mergeColor(); + } + + }; + + /* script */ + const __vue_script__$i = script$i; + + /* template */ + var __vue_render__$i = function() { + var _vm = this; + var _h = _vm.$createElement; + var _c = _vm._self._c || _h; + return _c("div", { ref: _vm.ref, staticClass: "dv-decoration-4" }, [ + _c( + "div", + { + class: "container " + (_vm.reverse ? "reverse" : "normal"), + style: _vm.reverse + ? "width:" + + _vm.width + + "px;height:5px;animation-duration:" + + _vm.dur + + "s" + : "width:5px;height:" + + _vm.height + + "px;animation-duration:" + + _vm.dur + + "s" + }, + [ + _c( + "svg", + { + attrs: { + width: _vm.reverse ? _vm.width : 5, + height: _vm.reverse ? 5 : _vm.height + } + }, + [ + _c("polyline", { + attrs: { + stroke: _vm.mergedColor[0], + points: _vm.reverse + ? "0, 2.5 " + _vm.width + ", 2.5" + : "2.5, 0 2.5, " + _vm.height } - }, - [ - _c("animateTransform", { - attrs: { - attributeName: "transform", - type: "rotate", - values: "0 50 50;360 50 50", - dur: "3s", - repeatCount: "indefinite" - } - }) - ], - 1 - ), - _vm._v(" "), - _c( - "circle", - { + }), + _vm._v(" "), + _c("polyline", { + staticClass: "bold-line", attrs: { - cx: "50", - cy: "50", - r: "45", - fill: "transparent", - stroke: "rgba(3, 166, 224, 0.8)", - "stroke-width": "6", - "stroke-dasharray": "50, 66, 100, 66" + stroke: _vm.mergedColor[1], + "stroke-width": "3", + "stroke-dasharray": "20, 80", + "stroke-dashoffset": "-30", + points: _vm.reverse + ? "0, 2.5 " + _vm.width + ", 2.5" + : "2.5, 0 2.5, " + _vm.height } - }, - [ - _c("animateTransform", { - attrs: { - attributeName: "transform", - type: "rotate", - values: "0 50 50;-360 50 50", - dur: "3s", - repeatCount: "indefinite" - } - }) - ], - 1 - ), - _vm._v(" "), - _c("circle", { - attrs: { - cx: "50", - cy: "50", - r: "38", - fill: "transparent", - stroke: "rgba(3, 166, 224, 0.2)", - "stroke-width": "1", - "stroke-dasharray": "5, 1" - } - }), - _vm._v(" "), - _vm._l(new Array(20).fill(0), function(foo, i) { - return _c( - "use", - { - key: i, - attrs: { - "xlink:href": "#" + _vm.polygonId, - stroke: "rgba(3, 166, 224, 0.6)", - fill: - Math.random() > 0.4 - ? "transparent" - : "rgba(3, 166, 224, 0.8)" - } - }, - [ - _c("animateTransform", { - attrs: { - attributeName: "transform", - type: "rotate", - values: "0 50 50;360 50 50", - dur: "3s", - begin: i * 0.15 + "s", - repeatCount: "indefinite" - } - }) - ], - 1 - ) - }), - _vm._v(" "), - _c("circle", { - attrs: { - cx: "50", - cy: "50", - r: "26", - fill: "transparent", - stroke: "rgba(3, 166, 224, 0.2)", - "stroke-width": "1", - "stroke-dasharray": "5, 1" - } - }) - ], - 2 - ), - _vm._v(" "), - _vm._t("default") - ], - 2 - ) + }) + ] + ) + ] + ) + ]) }; - var __vue_staticRenderFns__$k = []; - __vue_render__$k._withStripped = true; + var __vue_staticRenderFns__$i = []; + __vue_render__$i._withStripped = true; /* style */ - const __vue_inject_styles__$k = function (inject) { + const __vue_inject_styles__$i = function (inject) { if (!inject) return - inject("data-v-e62968ea_0", { source: ".dv-decoration-9 {\n position: relative;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.dv-decoration-9 svg {\n position: absolute;\n left: 0px;\n top: 0px;\n transform-origin: left top;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;EACZ,aAAa;EACb,mBAAmB;EACnB,uBAAuB;AACzB;AACA;EACE,kBAAkB;EAClB,SAAS;EACT,QAAQ;EACR,0BAA0B;AAC5B","file":"main.vue","sourcesContent":[".dv-decoration-9 {\n position: relative;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.dv-decoration-9 svg {\n position: absolute;\n left: 0px;\n top: 0px;\n transform-origin: left top;\n}\n"]}, media: undefined }); + inject("data-v-506ac984_0", { source: ".dv-decoration-4 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-decoration-4 .container {\n display: flex;\n overflow: hidden;\n position: absolute;\n flex: 1;\n}\n.dv-decoration-4 .normal {\n animation: ani-height ease-in-out infinite;\n left: 50%;\n margin-left: -2px;\n}\n.dv-decoration-4 .reverse {\n animation: ani-width ease-in-out infinite;\n top: 50%;\n margin-top: -2px;\n}\n@keyframes ani-height {\n0% {\n height: 0%;\n}\n70% {\n height: 100%;\n}\n100% {\n height: 100%;\n}\n}\n@keyframes ani-width {\n0% {\n width: 0%;\n}\n70% {\n width: 100%;\n}\n100% {\n width: 100%;\n}\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd;AACA;EACE,aAAa;EACb,gBAAgB;EAChB,kBAAkB;EAClB,OAAO;AACT;AACA;EACE,0CAA0C;EAC1C,SAAS;EACT,iBAAiB;AACnB;AACA;EACE,yCAAyC;EACzC,QAAQ;EACR,gBAAgB;AAClB;AACA;AACE;IACE,UAAU;AACZ;AACA;IACE,YAAY;AACd;AACA;IACE,YAAY;AACd;AACF;AACA;AACE;IACE,SAAS;AACX;AACA;IACE,WAAW;AACb;AACA;IACE,WAAW;AACb;AACF","file":"main.vue","sourcesContent":[".dv-decoration-4 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-decoration-4 .container {\n display: flex;\n overflow: hidden;\n position: absolute;\n flex: 1;\n}\n.dv-decoration-4 .normal {\n animation: ani-height ease-in-out infinite;\n left: 50%;\n margin-left: -2px;\n}\n.dv-decoration-4 .reverse {\n animation: ani-width ease-in-out infinite;\n top: 50%;\n margin-top: -2px;\n}\n@keyframes ani-height {\n 0% {\n height: 0%;\n }\n 70% {\n height: 100%;\n }\n 100% {\n height: 100%;\n }\n}\n@keyframes ani-width {\n 0% {\n width: 0%;\n }\n 70% {\n width: 100%;\n }\n 100% {\n width: 100%;\n }\n}\n"]}, media: undefined }); }; /* scoped */ - const __vue_scope_id__$k = undefined; + const __vue_scope_id__$i = undefined; /* module identifier */ - const __vue_module_identifier__$k = undefined; + const __vue_module_identifier__$i = undefined; /* functional template */ - const __vue_is_functional_template__$k = false; + const __vue_is_functional_template__$i = false; /* style inject SSR */ + /* style inject shadow dom */ + - var Decoration9 = normalizeComponent_1( - { render: __vue_render__$k, staticRenderFns: __vue_staticRenderFns__$k }, - __vue_inject_styles__$k, - __vue_script__$k, - __vue_scope_id__$k, - __vue_is_functional_template__$k, - __vue_module_identifier__$k, - browser, + const __vue_component__$i = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$i, staticRenderFns: __vue_staticRenderFns__$i }, + __vue_inject_styles__$i, + __vue_script__$i, + __vue_scope_id__$i, + __vue_is_functional_template__$i, + __vue_module_identifier__$i, + false, + createInjector, + undefined, undefined ); - function decoration9 (Vue) { - Vue.component(Decoration9.name, Decoration9); + function decoration4 (Vue) { + Vue.component(__vue_component__$i.name, __vue_component__$i); } // - var script$l = { - name: 'DvDecoration10', + var script$j = { + name: 'DvDecoration5', mixins: [autoResize], + props: { + color: { + type: Array, + default: () => [] + }, + dur: { + type: Number, + default: 1.2 + } + }, data() { - const timestamp = Date.now(); return { - ref: 'decoration-10', - animationId1: `d10ani1${timestamp}`, - animationId2: `d10ani2${timestamp}`, - animationId3: `d10ani3${timestamp}`, - animationId4: `d10ani4${timestamp}`, - animationId5: `d10ani5${timestamp}`, - animationId6: `d10ani6${timestamp}`, - animationId7: `d10ani7${timestamp}` + ref: 'decoration-5', + line1Points: '', + line2Points: '', + line1Length: 0, + line2Length: 0, + defaultColor: ['#3f96a5', '#3f96a5'], + mergedColor: [] }; + }, + + watch: { + color() { + const { + mergeColor + } = this; + mergeColor(); + } + + }, + methods: { + afterAutoResizeMixinInit() { + const { + calcSVGData + } = this; + calcSVGData(); + }, + + calcSVGData() { + const { + width, + height + } = this; + let line1Points = [[0, height * 0.2], [width * 0.18, height * 0.2], [width * 0.2, height * 0.4], [width * 0.25, height * 0.4], [width * 0.27, height * 0.6], [width * 0.72, height * 0.6], [width * 0.75, height * 0.4], [width * 0.8, height * 0.4], [width * 0.82, height * 0.2], [width, height * 0.2]]; + let line2Points = [[width * 0.3, height * 0.8], [width * 0.7, height * 0.8]]; + const line1Length = util_7$1(line1Points); + const line2Length = util_7$1(line2Points); + line1Points = line1Points.map(point => point.join(',')).join(' '); + line2Points = line2Points.map(point => point.join(',')).join(' '); + this.line1Points = line1Points; + this.line2Points = line2Points; + this.line1Length = line1Length; + this.line2Length = line2Length; + }, + + onResize() { + const { + calcSVGData + } = this; + calcSVGData(); + }, + + mergeColor() { + const { + color, + defaultColor + } = this; + this.mergedColor = util_2$1(util_1(defaultColor, true), color || []); + } + + }, + + mounted() { + const { + mergeColor + } = this; + mergeColor(); } }; /* script */ - const __vue_script__$l = script$l; + const __vue_script__$j = script$j; /* template */ - var __vue_render__$l = function() { + var __vue_render__$j = function() { var _vm = this; var _h = _vm.$createElement; - var _c = _vm._self._c || _h; - return _c("div", { ref: _vm.ref, staticClass: "dv-decoration-10" }, [ - _c("svg", { attrs: { width: _vm.width, height: _vm.height } }, [ - _c("polyline", { - attrs: { - stroke: "rgba(0, 194, 255, 0.3)", - "stroke-width": "2", - points: - "0, " + _vm.height / 2 + " " + _vm.width + ", " + _vm.height / 2 - } - }), - _vm._v(" "), - _c( - "polyline", - { - attrs: { - stroke: "rgba(0, 194, 255, 1)", - "stroke-width": "2", - points: - "5, " + - _vm.height / 2 + - " " + - (_vm.width * 0.2 - 3) + - ", " + - _vm.height / 2, - "stroke-dasharray": "0, " + _vm.width * 0.2, - fill: "freeze" - } - }, - [ - _c("animate", { - attrs: { - id: _vm.animationId2, - attributeName: "stroke-dasharray", - values: "0, " + _vm.width * 0.2 + ";" + _vm.width * 0.2 + ", 0;", - dur: "3s", - begin: _vm.animationId1 + ".end", - fill: "freeze" - } - }), - _vm._v(" "), - _c("animate", { - attrs: { - attributeName: "stroke-dasharray", - values: _vm.width * 0.2 + ", 0;0, " + _vm.width * 0.2, - dur: "0.01s", - begin: _vm.animationId7 + ".end", - fill: "freeze" - } - }) - ] - ), - _vm._v(" "), + var _c = _vm._self._c || _h; + return _c("div", { ref: _vm.ref, staticClass: "dv-decoration-5" }, [ + _c("svg", { attrs: { width: _vm.width, height: _vm.height } }, [ _c( "polyline", { attrs: { - stroke: "rgba(0, 194, 255, 1)", - "stroke-width": "2", - points: - _vm.width * 0.2 + - 3 + - ", " + - _vm.height / 2 + - " " + - (_vm.width * 0.8 - 3) + - ", " + - _vm.height / 2, - "stroke-dasharray": "0, " + _vm.width * 0.6 + fill: "transparent", + stroke: _vm.mergedColor[0], + "stroke-width": "3", + points: _vm.line1Points } }, [ - _c("animate", { - attrs: { - id: _vm.animationId4, - attributeName: "stroke-dasharray", - values: "0, " + _vm.width * 0.6 + ";" + _vm.width * 0.6 + ", 0", - dur: "3s", - begin: _vm.animationId3 + ".end + 1s", - fill: "freeze" - } - }), - _vm._v(" "), _c("animate", { attrs: { attributeName: "stroke-dasharray", - values: _vm.width * 0.6 + ", 0;0, " + _vm.width * 0.6, - dur: "0.01s", - begin: _vm.animationId7 + ".end", - fill: "freeze" + attributeType: "XML", + from: "0, " + _vm.line1Length / 2 + ", 0, " + _vm.line1Length / 2, + to: "0, 0, " + _vm.line1Length + ", 0", + dur: _vm.dur + "s", + begin: "0s", + calcMode: "spline", + keyTimes: "0;1", + keySplines: "0.4,1,0.49,0.98", + repeatCount: "indefinite" } }) ] @@ -5883,158 +6185,25 @@ "polyline", { attrs: { - stroke: "rgba(0, 194, 255, 1)", + fill: "transparent", + stroke: _vm.mergedColor[1], "stroke-width": "2", - points: - _vm.width * 0.8 + - 3 + - ", " + - _vm.height / 2 + - " " + - (_vm.width - 5) + - ", " + - _vm.height / 2, - "stroke-dasharray": "0, " + _vm.width * 0.2 + points: _vm.line2Points } }, [ - _c("animate", { - attrs: { - id: _vm.animationId6, - attributeName: "stroke-dasharray", - values: "0, " + _vm.width * 0.2 + ";" + _vm.width * 0.2 + ", 0", - dur: "3s", - begin: _vm.animationId5 + ".end + 1s", - fill: "freeze" - } - }), - _vm._v(" "), _c("animate", { attrs: { attributeName: "stroke-dasharray", - values: _vm.width * 0.2 + ", 0;0, " + _vm.width * 0.3, - dur: "0.01s", - begin: _vm.animationId7 + ".end", - fill: "freeze" - } - }) - ] - ), - _vm._v(" "), - _c( - "circle", - { attrs: { cx: "2", cy: _vm.height / 2, r: "2", fill: "#03709f" } }, - [ - _c("animate", { - attrs: { - id: _vm.animationId1, - attributeName: "fill", - values: "#03709f;#00c2ff", - begin: "0s;" + _vm.animationId7 + ".end", - dur: "0.3s", - fill: "freeze" - } - }) - ] - ), - _vm._v(" "), - _c( - "circle", - { - attrs: { - cx: _vm.width * 0.2, - cy: _vm.height / 2, - r: "2", - fill: "#03709f" - } - }, - [ - _c("animate", { - attrs: { - id: _vm.animationId3, - attributeName: "fill", - values: "#03709f;#00c2ff", - begin: _vm.animationId2 + ".end", - dur: "0.3s", - fill: "freeze" - } - }), - _vm._v(" "), - _c("animate", { - attrs: { - attributeName: "fill", - values: "#03709f;#03709f", - dur: "0.01s", - begin: _vm.animationId7 + ".end", - fill: "freeze" - } - }) - ] - ), - _vm._v(" "), - _c( - "circle", - { - attrs: { - cx: _vm.width * 0.8, - cy: _vm.height / 2, - r: "2", - fill: "#03709f" - } - }, - [ - _c("animate", { - attrs: { - id: _vm.animationId5, - attributeName: "fill", - values: "#03709f;#00c2ff", - begin: _vm.animationId4 + ".end", - dur: "0.3s", - fill: "freeze" - } - }), - _vm._v(" "), - _c("animate", { - attrs: { - attributeName: "fill", - values: "#03709f;#03709f", - dur: "0.01s", - begin: _vm.animationId7 + ".end", - fill: "freeze" - } - }) - ] - ), - _vm._v(" "), - _c( - "circle", - { - attrs: { - cx: _vm.width - 2, - cy: _vm.height / 2, - r: "2", - fill: "#03709f" - } - }, - [ - _c("animate", { - attrs: { - id: _vm.animationId7, - attributeName: "fill", - values: "#03709f;#00c2ff", - begin: _vm.animationId6 + ".end", - dur: "0.3s", - fill: "freeze" - } - }), - _vm._v(" "), - _c("animate", { - attrs: { - attributeName: "fill", - values: "#03709f;#03709f", - dur: "0.01s", - begin: _vm.animationId7 + ".end", - fill: "freeze" + attributeType: "XML", + from: "0, " + _vm.line2Length / 2 + ", 0, " + _vm.line2Length / 2, + to: "0, 0, " + _vm.line2Length + ", 0", + dur: _vm.dur + "s", + begin: "0s", + calcMode: "spline", + keyTimes: "0;1", + keySplines: ".4,1,.49,.98", + repeatCount: "indefinite" } }) ] @@ -6042,1448 +6211,1816 @@ ]) ]) }; - var __vue_staticRenderFns__$l = []; - __vue_render__$l._withStripped = true; + var __vue_staticRenderFns__$j = []; + __vue_render__$j._withStripped = true; /* style */ - const __vue_inject_styles__$l = function (inject) { + const __vue_inject_styles__$j = function (inject) { if (!inject) return - inject("data-v-1045dca3_0", { source: ".dv-decoration-10 {\n width: 100%;\n height: 100%;\n display: flex;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,WAAW;EACX,YAAY;EACZ,aAAa;AACf","file":"main.vue","sourcesContent":[".dv-decoration-10 {\n width: 100%;\n height: 100%;\n display: flex;\n}\n"]}, media: undefined }); + inject("data-v-183f85bc_0", { source: ".dv-decoration-5 {\n width: 100%;\n height: 100%;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,WAAW;EACX,YAAY;AACd","file":"main.vue","sourcesContent":[".dv-decoration-5 {\n width: 100%;\n height: 100%;\n}\n"]}, media: undefined }); }; /* scoped */ - const __vue_scope_id__$l = undefined; + const __vue_scope_id__$j = undefined; /* module identifier */ - const __vue_module_identifier__$l = undefined; + const __vue_module_identifier__$j = undefined; /* functional template */ - const __vue_is_functional_template__$l = false; + const __vue_is_functional_template__$j = false; /* style inject SSR */ + /* style inject shadow dom */ + - var Decoration10 = normalizeComponent_1( - { render: __vue_render__$l, staticRenderFns: __vue_staticRenderFns__$l }, - __vue_inject_styles__$l, - __vue_script__$l, - __vue_scope_id__$l, - __vue_is_functional_template__$l, - __vue_module_identifier__$l, - browser, + const __vue_component__$j = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$j, staticRenderFns: __vue_staticRenderFns__$j }, + __vue_inject_styles__$j, + __vue_script__$j, + __vue_scope_id__$j, + __vue_is_functional_template__$j, + __vue_module_identifier__$j, + false, + createInjector, + undefined, undefined - ); - - function decoration10 (Vue) { - Vue.component(Decoration10.name, Decoration10); - } - - // 19.1.2.1 Object.assign(target, source, ...) - - - - - - - var $assign = Object.assign; - - // should work with symbols and should have deterministic property order (V8 bug) - var _objectAssign = !$assign || _fails(function () { - var A = {}; - var B = {}; - // eslint-disable-next-line no-undef - var S = Symbol(); - var K = 'abcdefghijklmnopqrst'; - A[S] = 7; - K.split('').forEach(function (k) { B[k] = k; }); - return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K; - }) ? function assign(target, source) { // eslint-disable-line no-unused-vars - var T = _toObject(target); - var aLen = arguments.length; - var index = 1; - var getSymbols = _objectGops.f; - var isEnum = _objectPie.f; - while (aLen > index) { - var S = _iobject(arguments[index++]); - var keys = getSymbols ? _objectKeys(S).concat(getSymbols(S)) : _objectKeys(S); - var length = keys.length; - var j = 0; - var key; - while (length > j) { - key = keys[j++]; - if (!_descriptors || isEnum.call(S, key)) T[key] = S[key]; - } - } return T; - } : $assign; - - // 19.1.3.1 Object.assign(target, source) - - - _export(_export.S + _export.F, 'Object', { assign: _objectAssign }); - - // 7.2.8 IsRegExp(argument) - - - var MATCH = _wks('match'); - var _isRegexp = function (it) { - var isRegExp; - return _isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : _cof(it) == 'RegExp'); - }; - - // 7.3.20 SpeciesConstructor(O, defaultConstructor) - - - var SPECIES$1 = _wks('species'); - var _speciesConstructor = function (O, D) { - var C = _anObject(O).constructor; - var S; - return C === undefined || (S = _anObject(C)[SPECIES$1]) == undefined ? D : _aFunction(S); - }; - - var at = _stringAt(true); - - // `AdvanceStringIndex` abstract operation - // https://tc39.github.io/ecma262/#sec-advancestringindex - var _advanceStringIndex = function (S, index, unicode) { - return index + (unicode ? at(S, index).length : 1); - }; - - var builtinExec = RegExp.prototype.exec; - - // `RegExpExec` abstract operation - // https://tc39.github.io/ecma262/#sec-regexpexec - var _regexpExecAbstract = function (R, S) { - var exec = R.exec; - if (typeof exec === 'function') { - var result = exec.call(R, S); - if (typeof result !== 'object') { - throw new TypeError('RegExp exec method returned something other than an Object or null'); - } - return result; - } - if (_classof(R) !== 'RegExp') { - throw new TypeError('RegExp#exec called on incompatible receiver'); - } - return builtinExec.call(R, S); - }; - - var nativeExec = RegExp.prototype.exec; - // This always refers to the native implementation, because the - // String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js, - // which loads this file before patching the method. - var nativeReplace = String.prototype.replace; - - var patchedExec = nativeExec; - - var LAST_INDEX = 'lastIndex'; - - var UPDATES_LAST_INDEX_WRONG = (function () { - var re1 = /a/, - re2 = /b*/g; - nativeExec.call(re1, 'a'); - nativeExec.call(re2, 'a'); - return re1[LAST_INDEX] !== 0 || re2[LAST_INDEX] !== 0; - })(); - - // nonparticipating capturing group, copied from es5-shim's String#split patch. - var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined; - - var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED; - - if (PATCH) { - patchedExec = function exec(str) { - var re = this; - var lastIndex, reCopy, match, i; - - if (NPCG_INCLUDED) { - reCopy = new RegExp('^' + re.source + '$(?!\\s)', _flags.call(re)); - } - if (UPDATES_LAST_INDEX_WRONG) lastIndex = re[LAST_INDEX]; - - match = nativeExec.call(re, str); - - if (UPDATES_LAST_INDEX_WRONG && match) { - re[LAST_INDEX] = re.global ? match.index + match[0].length : lastIndex; - } - if (NPCG_INCLUDED && match && match.length > 1) { - // Fix browsers whose `exec` methods don't consistently return `undefined` - // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/ - // eslint-disable-next-line no-loop-func - nativeReplace.call(match[0], reCopy, function () { - for (i = 1; i < arguments.length - 2; i++) { - if (arguments[i] === undefined) match[i] = undefined; - } - }); - } + ); - return match; - }; + function decoration5 (Vue) { + Vue.component(__vue_component__$j.name, __vue_component__$j); } - var _regexpExec = patchedExec; - - _export({ - target: 'RegExp', - proto: true, - forced: _regexpExec !== /./.exec - }, { - exec: _regexpExec - }); - - var SPECIES$2 = _wks('species'); - - var REPLACE_SUPPORTS_NAMED_GROUPS = !_fails(function () { - // #replace needs built-in support for named groups. - // #match works fine because it just return the exec results, even if it has - // a "grops" property. - var re = /./; - re.exec = function () { - var result = []; - result.groups = { a: '7' }; - return result; - }; - return ''.replace(re, '$') !== '7'; - }); - - var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = (function () { - // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec - var re = /(?:)/; - var originalExec = re.exec; - re.exec = function () { return originalExec.apply(this, arguments); }; - var result = 'ab'.split(re); - return result.length === 2 && result[0] === 'a' && result[1] === 'b'; - })(); - - var _fixReWks = function (KEY, length, exec) { - var SYMBOL = _wks(KEY); - - var DELEGATES_TO_SYMBOL = !_fails(function () { - // String methods call symbol-named RegEp methods - var O = {}; - O[SYMBOL] = function () { return 7; }; - return ''[KEY](O) != 7; - }); - - var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL ? !_fails(function () { - // Symbol-named RegExp methods call .exec - var execCalled = false; - var re = /a/; - re.exec = function () { execCalled = true; return null; }; - if (KEY === 'split') { - // RegExp[@@split] doesn't call the regex's exec method, but first creates - // a new one. We need to return the patched regex when creating the new one. - re.constructor = {}; - re.constructor[SPECIES$2] = function () { return re; }; + // + var script$k = { + name: 'DvDecoration6', + mixins: [autoResize], + props: { + color: { + type: Array, + default: () => [] } - re[SYMBOL](''); - return !execCalled; - }) : undefined; - - if ( - !DELEGATES_TO_SYMBOL || - !DELEGATES_TO_EXEC || - (KEY === 'replace' && !REPLACE_SUPPORTS_NAMED_GROUPS) || - (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC) - ) { - var nativeRegExpMethod = /./[SYMBOL]; - var fns = exec( - _defined, - SYMBOL, - ''[KEY], - function maybeCallNative(nativeMethod, regexp, str, arg2, forceStringMethod) { - if (regexp.exec === _regexpExec) { - if (DELEGATES_TO_SYMBOL && !forceStringMethod) { - // The native String method already delegates to @@method (this - // polyfilled function), leasing to infinite recursion. - // We avoid it by directly calling the native @@method method. - return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) }; - } - return { done: true, value: nativeMethod.call(str, regexp, arg2) }; - } - return { done: false }; - } - ); - var strfn = fns[0]; - var rxfn = fns[1]; - - _redefine(String.prototype, KEY, strfn); - _hide(RegExp.prototype, SYMBOL, length == 2 - // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue) - // 21.2.5.11 RegExp.prototype[@@split](string, limit) - ? function (string, arg) { return rxfn.call(string, this, arg); } - // 21.2.5.6 RegExp.prototype[@@match](string) - // 21.2.5.9 RegExp.prototype[@@search](string) - : function (string) { return rxfn.call(string, this); } - ); - } - }; + }, - var $min = Math.min; - var $push = [].push; - var $SPLIT = 'split'; - var LENGTH = 'length'; - var LAST_INDEX$1 = 'lastIndex'; - var MAX_UINT32 = 0xffffffff; - - // babel-minify transpiles RegExp('x', 'y') -> /x/y and it causes SyntaxError - var SUPPORTS_Y = !_fails(function () { RegExp(MAX_UINT32, 'y'); }); - - // @@split logic - _fixReWks('split', 2, function (defined, SPLIT, $split, maybeCallNative) { - var internalSplit; - if ( - 'abbc'[$SPLIT](/(b)*/)[1] == 'c' || - 'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 || - 'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 || - '.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 || - '.'[$SPLIT](/()()/)[LENGTH] > 1 || - ''[$SPLIT](/.?/)[LENGTH] - ) { - // based on es5-shim implementation, need to rework it - internalSplit = function (separator, limit) { - var string = String(this); - if (separator === undefined && limit === 0) return []; - // If `separator` is not a regex, use native split - if (!_isRegexp(separator)) return $split.call(string, separator, limit); - var output = []; - var flags = (separator.ignoreCase ? 'i' : '') + - (separator.multiline ? 'm' : '') + - (separator.unicode ? 'u' : '') + - (separator.sticky ? 'y' : ''); - var lastLastIndex = 0; - var splitLimit = limit === undefined ? MAX_UINT32 : limit >>> 0; - // Make `global` and avoid `lastIndex` issues by working with a copy - var separatorCopy = new RegExp(separator.source, flags + 'g'); - var match, lastIndex, lastLength; - while (match = _regexpExec.call(separatorCopy, string)) { - lastIndex = separatorCopy[LAST_INDEX$1]; - if (lastIndex > lastLastIndex) { - output.push(string.slice(lastLastIndex, match.index)); - if (match[LENGTH] > 1 && match.index < string[LENGTH]) $push.apply(output, match.slice(1)); - lastLength = match[0][LENGTH]; - lastLastIndex = lastIndex; - if (output[LENGTH] >= splitLimit) break; - } - if (separatorCopy[LAST_INDEX$1] === match.index) separatorCopy[LAST_INDEX$1]++; // Avoid an infinite loop - } - if (lastLastIndex === string[LENGTH]) { - if (lastLength || !separatorCopy.test('')) output.push(''); - } else output.push(string.slice(lastLastIndex)); - return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output; - }; - // Chakra, V8 - } else if ('0'[$SPLIT](undefined, 0)[LENGTH]) { - internalSplit = function (separator, limit) { - return separator === undefined && limit === 0 ? [] : $split.call(this, separator, limit); + data() { + const rectWidth = 7; + return { + ref: 'decoration-6', + svgWH: [300, 35], + svgScale: [1, 1], + rowNum: 1, + rowPoints: 40, + rectWidth, + halfRectWidth: rectWidth / 2, + points: [], + heights: [], + minHeights: [], + randoms: [], + defaultColor: ['#7acaec', '#7acaec'], + mergedColor: [] }; - } else { - internalSplit = $split; - } + }, - return [ - // `String.prototype.split` method - // https://tc39.github.io/ecma262/#sec-string.prototype.split - function split(separator, limit) { - var O = defined(this); - var splitter = separator == undefined ? undefined : separator[SPLIT]; - return splitter !== undefined - ? splitter.call(separator, O, limit) - : internalSplit.call(String(O), separator, limit); - }, - // `RegExp.prototype[@@split]` method - // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@split - // - // NOTE: This cannot be properly polyfilled in engines that don't support - // the 'y' flag. - function (regexp, limit) { - var res = maybeCallNative(internalSplit, regexp, this, limit, internalSplit !== $split); - if (res.done) return res.value; - - var rx = _anObject(regexp); - var S = String(this); - var C = _speciesConstructor(rx, RegExp); - - var unicodeMatching = rx.unicode; - var flags = (rx.ignoreCase ? 'i' : '') + - (rx.multiline ? 'm' : '') + - (rx.unicode ? 'u' : '') + - (SUPPORTS_Y ? 'y' : 'g'); - - // ^(? + rx + ) is needed, in combination with some S slicing, to - // simulate the 'y' flag. - var splitter = new C(SUPPORTS_Y ? rx : '^(?:' + rx.source + ')', flags); - var lim = limit === undefined ? MAX_UINT32 : limit >>> 0; - if (lim === 0) return []; - if (S.length === 0) return _regexpExecAbstract(splitter, S) === null ? [S] : []; - var p = 0; - var q = 0; - var A = []; - while (q < S.length) { - splitter.lastIndex = SUPPORTS_Y ? q : 0; - var z = _regexpExecAbstract(splitter, SUPPORTS_Y ? S : S.slice(q)); - var e; - if ( - z === null || - (e = $min(_toLength(splitter.lastIndex + (SUPPORTS_Y ? 0 : q)), S.length)) === p - ) { - q = _advanceStringIndex(S, q, unicodeMatching); - } else { - A.push(S.slice(p, q)); - if (A.length === lim) return A; - for (var i = 1; i <= z.length - 1; i++) { - A.push(z[i]); - if (A.length === lim) return A; - } - q = p = e; - } - } - A.push(S.slice(p)); - return A; + watch: { + color() { + const { + mergeColor + } = this; + mergeColor(); } - ]; - }); - - // 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined) - - var $find$1 = _arrayMethods(5); - var KEY$1 = 'find'; - var forced$1 = true; - // Shouldn't skip holes - if (KEY$1 in []) Array(1)[KEY$1](function () { forced$1 = false; }); - _export(_export.P + _export.F * forced$1, 'Array', { - find: function find(callbackfn /* , that = undefined */) { - return $find$1(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); - } - }); - _addToUnscopables(KEY$1); - - // most Object methods by ES6 should accept primitives - + }, + methods: { + afterAutoResizeMixinInit() { + const { + calcSVGData + } = this; + calcSVGData(); + }, - var _objectSap = function (KEY, exec) { - var fn = (_core.Object || {})[KEY] || Object[KEY]; - var exp = {}; - exp[KEY] = exec(fn); - _export(_export.S + _export.F * _fails(function () { fn(1); }), 'Object', exp); - }; - - // 19.1.2.14 Object.keys(O) + calcSVGData() { + const { + calcPointsPosition, + calcScale + } = this; + calcPointsPosition(); + calcScale(); + }, + calcPointsPosition() { + const { + svgWH, + rowNum, + rowPoints + } = this; + const [w, h] = svgWH; + const horizontalGap = w / (rowPoints + 1); + const verticalGap = h / (rowNum + 1); + let points = new Array(rowNum).fill(0).map((foo, i) => new Array(rowPoints).fill(0).map((foo, j) => [horizontalGap * (j + 1), verticalGap * (i + 1)])); + this.points = points.reduce((all, item) => [...all, ...item], []); + const heights = this.heights = new Array(rowNum * rowPoints).fill(0).map(foo => Math.random() > 0.8 ? randomExtend(0.7 * h, h) : randomExtend(0.2 * h, 0.5 * h)); + this.minHeights = new Array(rowNum * rowPoints).fill(0).map((foo, i) => heights[i] * Math.random()); + this.randoms = new Array(rowNum * rowPoints).fill(0).map(foo => Math.random() + 1.5); + }, + calcScale() { + const { + width, + height, + svgWH + } = this; + const [w, h] = svgWH; + this.svgScale = [width / w, height / h]; + }, - _objectSap('keys', function () { - return function keys(it) { - return _objectKeys(_toObject(it)); - }; - }); + onResize() { + const { + calcSVGData + } = this; + calcSVGData(); + }, - // 20.3.3.1 / 15.9.4.4 Date.now() + mergeColor() { + const { + color, + defaultColor + } = this; + this.mergedColor = util_2$1(util_1(defaultColor, true), color || []); + } + }, - _export(_export.S, 'Date', { now: function () { return new Date().getTime(); } }); + mounted() { + const { + mergeColor + } = this; + mergeColor(); + } - var _anInstance = function (it, Constructor, name, forbiddenField) { - if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) { - throw TypeError(name + ': incorrect invocation!'); - } return it; }; - var _forOf = createCommonjsModule(function (module) { - var BREAK = {}; - var RETURN = {}; - var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) { - var iterFn = ITERATOR ? function () { return iterable; } : core_getIteratorMethod(iterable); - var f = _ctx(fn, that, entries ? 2 : 1); - var index = 0; - var length, step, iterator, result; - if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!'); - // fast case for arrays with default iterator - if (_isArrayIter(iterFn)) for (length = _toLength(iterable.length); length > index; index++) { - result = entries ? f(_anObject(step = iterable[index])[0], step[1]) : f(iterable[index]); - if (result === BREAK || result === RETURN) return result; - } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) { - result = _iterCall(iterator, f, step.value, entries); - if (result === BREAK || result === RETURN) return result; - } - }; - exports.BREAK = BREAK; - exports.RETURN = RETURN; - }); + /* script */ + const __vue_script__$k = script$k; - // fast apply, http://jsperf.lnkit.com/fast-apply/5 - var _invoke = function (fn, args, that) { - var un = that === undefined; - switch (args.length) { - case 0: return un ? fn() - : fn.call(that); - case 1: return un ? fn(args[0]) - : fn.call(that, args[0]); - case 2: return un ? fn(args[0], args[1]) - : fn.call(that, args[0], args[1]); - case 3: return un ? fn(args[0], args[1], args[2]) - : fn.call(that, args[0], args[1], args[2]); - case 4: return un ? fn(args[0], args[1], args[2], args[3]) - : fn.call(that, args[0], args[1], args[2], args[3]); - } return fn.apply(that, args); + /* template */ + var __vue_render__$k = function() { + var _vm = this; + var _h = _vm.$createElement; + var _c = _vm._self._c || _h; + return _c("div", { ref: _vm.ref, staticClass: "dv-decoration-6" }, [ + _c( + "svg", + { + style: + "transform:scale(" + _vm.svgScale[0] + "," + _vm.svgScale[1] + ");", + attrs: { width: _vm.svgWH[0] + "px", height: _vm.svgWH[1] + "px" } + }, + [ + _vm._l(_vm.points, function(point, i) { + return [ + _c( + "rect", + { + key: i, + attrs: { + fill: _vm.mergedColor[Math.random() > 0.5 ? 0 : 1], + x: point[0] - _vm.halfRectWidth, + y: point[1] - _vm.heights[i] / 2, + width: _vm.rectWidth, + height: _vm.heights[i] + } + }, + [ + _c("animate", { + attrs: { + attributeName: "y", + values: + point[1] - + _vm.minHeights[i] / 2 + + ";" + + (point[1] - _vm.heights[i] / 2) + + ";" + + (point[1] - _vm.minHeights[i] / 2), + dur: _vm.randoms[i] + "s", + keyTimes: "0;0.5;1", + calcMode: "spline", + keySplines: "0.42,0,0.58,1;0.42,0,0.58,1", + begin: "0s", + repeatCount: "indefinite" + } + }), + _vm._v(" "), + _c("animate", { + attrs: { + attributeName: "height", + values: + _vm.minHeights[i] + + ";" + + _vm.heights[i] + + ";" + + _vm.minHeights[i], + dur: _vm.randoms[i] + "s", + keyTimes: "0;0.5;1", + calcMode: "spline", + keySplines: "0.42,0,0.58,1;0.42,0,0.58,1", + begin: "0s", + repeatCount: "indefinite" + } + }) + ] + ) + ] + }) + ], + 2 + ) + ]) }; + var __vue_staticRenderFns__$k = []; + __vue_render__$k._withStripped = true; - var process = _global.process; - var setTask = _global.setImmediate; - var clearTask = _global.clearImmediate; - var MessageChannel = _global.MessageChannel; - var Dispatch = _global.Dispatch; - var counter = 0; - var queue = {}; - var ONREADYSTATECHANGE = 'onreadystatechange'; - var defer, channel, port; - var run = function () { - var id = +this; - // eslint-disable-next-line no-prototype-builtins - if (queue.hasOwnProperty(id)) { - var fn = queue[id]; - delete queue[id]; - fn(); - } - }; - var listener = function (event) { - run.call(event.data); - }; - // Node.js 0.9+ & IE10+ has setImmediate, otherwise: - if (!setTask || !clearTask) { - setTask = function setImmediate(fn) { - var args = []; - var i = 1; - while (arguments.length > i) args.push(arguments[i++]); - queue[++counter] = function () { - // eslint-disable-next-line no-new-func - _invoke(typeof fn == 'function' ? fn : Function(fn), args); - }; - defer(counter); - return counter; - }; - clearTask = function clearImmediate(id) { - delete queue[id]; - }; - // Node.js 0.8- - if (_cof(process) == 'process') { - defer = function (id) { - process.nextTick(_ctx(run, id, 1)); - }; - // Sphere (JS game engine) Dispatch API - } else if (Dispatch && Dispatch.now) { - defer = function (id) { - Dispatch.now(_ctx(run, id, 1)); - }; - // Browsers with MessageChannel, includes WebWorkers - } else if (MessageChannel) { - channel = new MessageChannel(); - port = channel.port2; - channel.port1.onmessage = listener; - defer = _ctx(port.postMessage, port, 1); - // Browsers with postMessage, skip WebWorkers - // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' - } else if (_global.addEventListener && typeof postMessage == 'function' && !_global.importScripts) { - defer = function (id) { - _global.postMessage(id + '', '*'); - }; - _global.addEventListener('message', listener, false); - // IE8- - } else if (ONREADYSTATECHANGE in _domCreate('script')) { - defer = function (id) { - _html.appendChild(_domCreate('script'))[ONREADYSTATECHANGE] = function () { - _html.removeChild(this); - run.call(id); - }; - }; - // Rest old browsers - } else { - defer = function (id) { - setTimeout(_ctx(run, id, 1), 0); - }; - } - } - var _task = { - set: setTask, - clear: clearTask - }; + /* style */ + const __vue_inject_styles__$k = function (inject) { + if (!inject) return + inject("data-v-a29c4fc2_0", { source: ".dv-decoration-6 {\n width: 100%;\n height: 100%;\n}\n.dv-decoration-6 svg {\n transform-origin: left top;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,WAAW;EACX,YAAY;AACd;AACA;EACE,0BAA0B;AAC5B","file":"main.vue","sourcesContent":[".dv-decoration-6 {\n width: 100%;\n height: 100%;\n}\n.dv-decoration-6 svg {\n transform-origin: left top;\n}\n"]}, media: undefined }); - var macrotask = _task.set; - var Observer = _global.MutationObserver || _global.WebKitMutationObserver; - var process$1 = _global.process; - var Promise$1 = _global.Promise; - var isNode = _cof(process$1) == 'process'; - - var _microtask = function () { - var head, last, notify; - - var flush = function () { - var parent, fn; - if (isNode && (parent = process$1.domain)) parent.exit(); - while (head) { - fn = head.fn; - head = head.next; - try { - fn(); - } catch (e) { - if (head) notify(); - else last = undefined; - throw e; - } - } last = undefined; - if (parent) parent.enter(); }; + /* scoped */ + const __vue_scope_id__$k = undefined; + /* module identifier */ + const __vue_module_identifier__$k = undefined; + /* functional template */ + const __vue_is_functional_template__$k = false; + /* style inject SSR */ + + /* style inject shadow dom */ + - // Node.js - if (isNode) { - notify = function () { - process$1.nextTick(flush); - }; - // browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339 - } else if (Observer && !(_global.navigator && _global.navigator.standalone)) { - var toggle = true; - var node = document.createTextNode(''); - new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new - notify = function () { - node.data = toggle = !toggle; - }; - // environments with maybe non-completely correct, but existent Promise - } else if (Promise$1 && Promise$1.resolve) { - // Promise.resolve without an argument throws an error in LG WebOS 2 - var promise = Promise$1.resolve(undefined); - notify = function () { - promise.then(flush); - }; - // for other environments - macrotask based on: - // - setImmediate - // - MessageChannel - // - window.postMessag - // - onreadystatechange - // - setTimeout - } else { - notify = function () { - // strange IE + webpack dev server bug - use .call(global) - macrotask.call(_global, flush); - }; - } + + const __vue_component__$k = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$k, staticRenderFns: __vue_staticRenderFns__$k }, + __vue_inject_styles__$k, + __vue_script__$k, + __vue_scope_id__$k, + __vue_is_functional_template__$k, + __vue_module_identifier__$k, + false, + createInjector, + undefined, + undefined + ); - return function (fn) { - var task = { fn: fn, next: undefined }; - if (last) last.next = task; - if (!head) { - head = task; - notify(); - } last = task; - }; - }; + function decoration6 (Vue) { + Vue.component(__vue_component__$k.name, __vue_component__$k); + } - // 25.4.1.5 NewPromiseCapability(C) + // + var script$l = { + name: 'DvDecoration7', + props: { + color: { + type: Array, + default: () => [] + } + }, + data() { + return { + defaultColor: ['#1dc1f5', '#1dc1f5'], + mergedColor: [] + }; + }, - function PromiseCapability(C) { - var resolve, reject; - this.promise = new C(function ($$resolve, $$reject) { - if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor'); - resolve = $$resolve; - reject = $$reject; - }); - this.resolve = _aFunction(resolve); - this.reject = _aFunction(reject); - } + watch: { + color() { + const { + mergeColor + } = this; + mergeColor(); + } - var f$7 = function (C) { - return new PromiseCapability(C); - }; + }, + methods: { + mergeColor() { + const { + color, + defaultColor + } = this; + this.mergedColor = util_2$1(util_1(defaultColor, true), color || []); + } - var _newPromiseCapability = { - f: f$7 - }; + }, - var _perform = function (exec) { - try { - return { e: false, v: exec() }; - } catch (e) { - return { e: true, v: e }; + mounted() { + const { + mergeColor + } = this; + mergeColor(); } - }; - - var navigator$1 = _global.navigator; - - var _userAgent = navigator$1 && navigator$1.userAgent || ''; - - var _promiseResolve = function (C, x) { - _anObject(C); - if (_isObject(x) && x.constructor === C) return x; - var promiseCapability = _newPromiseCapability.f(C); - var resolve = promiseCapability.resolve; - resolve(x); - return promiseCapability.promise; - }; - var _redefineAll = function (target, src, safe) { - for (var key in src) _redefine(target, key, src[key], safe); - return target; }; - var SPECIES$3 = _wks('species'); + /* script */ + const __vue_script__$l = script$l; - var _setSpecies = function (KEY) { - var C = _global[KEY]; - if (_descriptors && C && !C[SPECIES$3]) _objectDp.f(C, SPECIES$3, { - configurable: true, - get: function () { return this; } - }); + /* template */ + var __vue_render__$l = function() { + var _vm = this; + var _h = _vm.$createElement; + var _c = _vm._self._c || _h; + return _c( + "div", + { staticClass: "dv-decoration-7" }, + [ + _c("svg", { attrs: { width: "21px", height: "20px" } }, [ + _c("polyline", { + attrs: { + "stroke-width": "4", + fill: "transparent", + stroke: _vm.mergedColor[0], + points: "10, 0 19, 10 10, 20" + } + }), + _vm._v(" "), + _c("polyline", { + attrs: { + "stroke-width": "2", + fill: "transparent", + stroke: _vm.mergedColor[1], + points: "2, 0 11, 10 2, 20" + } + }) + ]), + _vm._v(" "), + _vm._t("default"), + _vm._v(" "), + _c("svg", { attrs: { width: "21px", height: "20px" } }, [ + _c("polyline", { + attrs: { + "stroke-width": "4", + fill: "transparent", + stroke: _vm.mergedColor[0], + points: "11, 0 2, 10 11, 20" + } + }), + _vm._v(" "), + _c("polyline", { + attrs: { + "stroke-width": "2", + fill: "transparent", + stroke: _vm.mergedColor[1], + points: "19, 0 10, 10 19, 20" + } + }) + ]) + ], + 2 + ) }; + var __vue_staticRenderFns__$l = []; + __vue_render__$l._withStripped = true; - var task = _task.set; - var microtask = _microtask(); + /* style */ + const __vue_inject_styles__$l = function (inject) { + if (!inject) return + inject("data-v-b84d1f12_0", { source: ".dv-decoration-7 {\n display: flex;\n width: 100%;\n height: 100%;\n justify-content: center;\n align-items: center;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,aAAa;EACb,WAAW;EACX,YAAY;EACZ,uBAAuB;EACvB,mBAAmB;AACrB","file":"main.vue","sourcesContent":[".dv-decoration-7 {\n display: flex;\n width: 100%;\n height: 100%;\n justify-content: center;\n align-items: center;\n}\n"]}, media: undefined }); + }; + /* scoped */ + const __vue_scope_id__$l = undefined; + /* module identifier */ + const __vue_module_identifier__$l = undefined; + /* functional template */ + const __vue_is_functional_template__$l = false; + /* style inject SSR */ + + /* style inject shadow dom */ + + + const __vue_component__$l = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$l, staticRenderFns: __vue_staticRenderFns__$l }, + __vue_inject_styles__$l, + __vue_script__$l, + __vue_scope_id__$l, + __vue_is_functional_template__$l, + __vue_module_identifier__$l, + false, + createInjector, + undefined, + undefined + ); + function decoration7 (Vue) { + Vue.component(__vue_component__$l.name, __vue_component__$l); + } - var PROMISE = 'Promise'; - var TypeError$1 = _global.TypeError; - var process$2 = _global.process; - var versions = process$2 && process$2.versions; - var v8 = versions && versions.v8 || ''; - var $Promise = _global[PROMISE]; - var isNode$1 = _classof(process$2) == 'process'; - var empty = function () { /* empty */ }; - var Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper; - var newPromiseCapability = newGenericPromiseCapability = _newPromiseCapability.f; + // + var script$m = { + name: 'DvDecoration8', + mixins: [autoResize], + props: { + color: { + type: Array, + default: () => [] + }, + reverse: { + type: Boolean, + default: false + } + }, - var USE_NATIVE$1 = !!function () { - try { - // correct subclassing with @@species support - var promise = $Promise.resolve(1); - var FakePromise = (promise.constructor = {})[_wks('species')] = function (exec) { - exec(empty, empty); + data() { + return { + ref: 'decoration-8', + defaultColor: ['#3f96a5', '#3f96a5'], + mergedColor: [] }; - // unhandled rejections tracking support, NodeJS Promise without it fails @@species test - return (isNode$1 || typeof PromiseRejectionEvent == 'function') - && promise.then(empty) instanceof FakePromise - // v8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables - // https://bugs.chromium.org/p/chromium/issues/detail?id=830565 - // we can't detect it synchronously, so just check versions - && v8.indexOf('6.6') !== 0 - && _userAgent.indexOf('Chrome/66') === -1; - } catch (e) { /* empty */ } - }(); + }, - // helpers - var isThenable = function (it) { - var then; - return _isObject(it) && typeof (then = it.then) == 'function' ? then : false; - }; - var notify = function (promise, isReject) { - if (promise._n) return; - promise._n = true; - var chain = promise._c; - microtask(function () { - var value = promise._v; - var ok = promise._s == 1; - var i = 0; - var run = function (reaction) { - var handler = ok ? reaction.ok : reaction.fail; - var resolve = reaction.resolve; - var reject = reaction.reject; - var domain = reaction.domain; - var result, then, exited; - try { - if (handler) { - if (!ok) { - if (promise._h == 2) onHandleUnhandled(promise); - promise._h = 1; - } - if (handler === true) result = value; - else { - if (domain) domain.enter(); - result = handler(value); // may throw - if (domain) { - domain.exit(); - exited = true; - } - } - if (result === reaction.promise) { - reject(TypeError$1('Promise-chain cycle')); - } else if (then = isThenable(result)) { - then.call(result, resolve, reject); - } else resolve(result); - } else reject(value); - } catch (e) { - if (domain && !exited) domain.exit(); - reject(e); - } - }; - while (chain.length > i) run(chain[i++]); // variable length - can't use forEach - promise._c = []; - promise._n = false; - if (isReject && !promise._h) onUnhandled(promise); - }); - }; - var onUnhandled = function (promise) { - task.call(_global, function () { - var value = promise._v; - var unhandled = isUnhandled(promise); - var result, handler, console; - if (unhandled) { - result = _perform(function () { - if (isNode$1) { - process$2.emit('unhandledRejection', value, promise); - } else if (handler = _global.onunhandledrejection) { - handler({ promise: promise, reason: value }); - } else if ((console = _global.console) && console.error) { - console.error('Unhandled promise rejection', value); - } - }); - // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should - promise._h = isNode$1 || isUnhandled(promise) ? 2 : 1; - } promise._a = undefined; - if (unhandled && result.e) throw result.v; - }); - }; - var isUnhandled = function (promise) { - return promise._h !== 1 && (promise._a || promise._c).length === 0; - }; - var onHandleUnhandled = function (promise) { - task.call(_global, function () { - var handler; - if (isNode$1) { - process$2.emit('rejectionHandled', promise); - } else if (handler = _global.onrejectionhandled) { - handler({ promise: promise, reason: promise._v }); - } - }); - }; - var $reject = function (value) { - var promise = this; - if (promise._d) return; - promise._d = true; - promise = promise._w || promise; // unwrap - promise._v = value; - promise._s = 2; - if (!promise._a) promise._a = promise._c.slice(); - notify(promise, true); - }; - var $resolve = function (value) { - var promise = this; - var then; - if (promise._d) return; - promise._d = true; - promise = promise._w || promise; // unwrap - try { - if (promise === value) throw TypeError$1("Promise can't be resolved itself"); - if (then = isThenable(value)) { - microtask(function () { - var wrapper = { _w: promise, _d: false }; // wrap - try { - then.call(value, _ctx($resolve, wrapper, 1), _ctx($reject, wrapper, 1)); - } catch (e) { - $reject.call(wrapper, e); - } - }); - } else { - promise._v = value; - promise._s = 1; - notify(promise, false); + watch: { + color() { + const { + mergeColor + } = this; + mergeColor(); } - } catch (e) { - $reject.call({ _w: promise, _d: false }, e); // wrap - } - }; - // constructor polyfill - if (!USE_NATIVE$1) { - // 25.4.3.1 Promise(executor) - $Promise = function Promise(executor) { - _anInstance(this, $Promise, PROMISE, '_h'); - _aFunction(executor); - Internal.call(this); - try { - executor(_ctx($resolve, this, 1), _ctx($reject, this, 1)); - } catch (err) { - $reject.call(this, err); - } - }; - // eslint-disable-next-line no-unused-vars - Internal = function Promise(executor) { - this._c = []; // <- awaiting reactions - this._a = undefined; // <- checked in isUnhandled reactions - this._s = 0; // <- state - this._d = false; // <- done - this._v = undefined; // <- value - this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled - this._n = false; // <- notify - }; - Internal.prototype = _redefineAll($Promise.prototype, { - // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected) - then: function then(onFulfilled, onRejected) { - var reaction = newPromiseCapability(_speciesConstructor(this, $Promise)); - reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true; - reaction.fail = typeof onRejected == 'function' && onRejected; - reaction.domain = isNode$1 ? process$2.domain : undefined; - this._c.push(reaction); - if (this._a) this._a.push(reaction); - if (this._s) notify(this, false); - return reaction.promise; + }, + methods: { + xPos(pos) { + const { + reverse, + width + } = this; + if (!reverse) return pos; + return width - pos; }, - // 25.4.5.1 Promise.prototype.catch(onRejected) - 'catch': function (onRejected) { - return this.then(undefined, onRejected); - } - }); - OwnPromiseCapability = function () { - var promise = new Internal(); - this.promise = promise; - this.resolve = _ctx($resolve, promise, 1); - this.reject = _ctx($reject, promise, 1); - }; - _newPromiseCapability.f = newPromiseCapability = function (C) { - return C === $Promise || C === Wrapper - ? new OwnPromiseCapability(C) - : newGenericPromiseCapability(C); - }; - } - _export(_export.G + _export.W + _export.F * !USE_NATIVE$1, { Promise: $Promise }); - _setToStringTag($Promise, PROMISE); - _setSpecies(PROMISE); - Wrapper = _core[PROMISE]; + mergeColor() { + const { + color, + defaultColor + } = this; + this.mergedColor = util_2$1(util_1(defaultColor, true), color || []); + } - // statics - _export(_export.S + _export.F * !USE_NATIVE$1, PROMISE, { - // 25.4.4.5 Promise.reject(r) - reject: function reject(r) { - var capability = newPromiseCapability(this); - var $$reject = capability.reject; - $$reject(r); - return capability.promise; - } - }); - _export(_export.S + _export.F * ( !USE_NATIVE$1), PROMISE, { - // 25.4.4.6 Promise.resolve(x) - resolve: function resolve(x) { - return _promiseResolve( this, x); - } - }); - _export(_export.S + _export.F * !(USE_NATIVE$1 && _iterDetect(function (iter) { - $Promise.all(iter)['catch'](empty); - })), PROMISE, { - // 25.4.4.1 Promise.all(iterable) - all: function all(iterable) { - var C = this; - var capability = newPromiseCapability(C); - var resolve = capability.resolve; - var reject = capability.reject; - var result = _perform(function () { - var values = []; - var index = 0; - var remaining = 1; - _forOf(iterable, false, function (promise) { - var $index = index++; - var alreadyCalled = false; - values.push(undefined); - remaining++; - C.resolve(promise).then(function (value) { - if (alreadyCalled) return; - alreadyCalled = true; - values[$index] = value; - --remaining || resolve(values); - }, reject); - }); - --remaining || resolve(values); - }); - if (result.e) reject(result.v); - return capability.promise; }, - // 25.4.4.4 Promise.race(iterable) - race: function race(iterable) { - var C = this; - var capability = newPromiseCapability(C); - var reject = capability.reject; - var result = _perform(function () { - _forOf(iterable, false, function (promise) { - C.resolve(promise).then(capability.resolve, reject); - }); - }); - if (result.e) reject(result.v); - return capability.promise; - } - }); - - var $sort = [].sort; - var test$1 = [1, 2, 3]; - - _export(_export.P + _export.F * (_fails(function () { - // IE8- - test$1.sort(undefined); - }) || !_fails(function () { - // V8 bug - test$1.sort(null); - // Old WebKit - }) || !_strictMethod($sort)), 'Array', { - // 22.1.3.25 Array.prototype.sort(comparefn) - sort: function sort(comparefn) { - return comparefn === undefined - ? $sort.call(_toObject(this)) - : $sort.call(_toObject(this), _aFunction(comparefn)); - } - }); - - var dP$2 = _objectDp.f; - var FProto = Function.prototype; - var nameRE = /^\s*function ([^ (]*)/; - var NAME$1 = 'name'; - // 19.2.4.2 name - NAME$1 in FProto || _descriptors && dP$2(FProto, NAME$1, { - configurable: true, - get: function () { - try { - return ('' + this).match(nameRE)[1]; - } catch (e) { - return ''; - } + mounted() { + const { + mergeColor + } = this; + mergeColor(); } - }); - var arraySlice = [].slice; - var factories = {}; - - var construct = function (F, len, args) { - if (!(len in factories)) { - for (var n = [], i = 0; i < len; i++) n[i] = 'a[' + i + ']'; - // eslint-disable-next-line no-new-func - factories[len] = Function('F,a', 'return new F(' + n.join(',') + ')'); - } return factories[len](F, args); - }; - - var _bind = Function.bind || function bind(that /* , ...args */) { - var fn = _aFunction(this); - var partArgs = arraySlice.call(arguments, 1); - var bound = function (/* args... */) { - var args = partArgs.concat(arraySlice.call(arguments)); - return this instanceof bound ? construct(fn, args.length, args) : _invoke(fn, args, that); - }; - if (_isObject(fn.prototype)) bound.prototype = fn.prototype; - return bound; }; - // 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...) + /* script */ + const __vue_script__$m = script$m; + /* template */ + var __vue_render__$m = function() { + var _vm = this; + var _h = _vm.$createElement; + var _c = _vm._self._c || _h; + return _c("div", { ref: _vm.ref, staticClass: "dv-decoration-8" }, [ + _c("svg", { attrs: { width: _vm.width, height: _vm.height } }, [ + _c("polyline", { + attrs: { + stroke: _vm.mergedColor[0], + "stroke-width": "2", + fill: "transparent", + points: _vm.xPos(0) + ", 0 " + _vm.xPos(30) + ", " + _vm.height / 2 + } + }), + _vm._v(" "), + _c("polyline", { + attrs: { + stroke: _vm.mergedColor[0], + "stroke-width": "2", + fill: "transparent", + points: + _vm.xPos(20) + + ", 0 " + + _vm.xPos(50) + + ", " + + _vm.height / 2 + + " " + + _vm.xPos(_vm.width) + + ", " + + _vm.height / 2 + } + }), + _vm._v(" "), + _c("polyline", { + attrs: { + stroke: _vm.mergedColor[1], + fill: "transparent", + "stroke-width": "3", + points: + _vm.xPos(0) + + ", " + + (_vm.height - 3) + + ", " + + _vm.xPos(200) + + ", " + + (_vm.height - 3) + } + }) + ]) + ]) + }; + var __vue_staticRenderFns__$m = []; + __vue_render__$m._withStripped = true; - _export(_export.P, 'Function', { bind: _bind }); + /* style */ + const __vue_inject_styles__$m = function (inject) { + if (!inject) return + inject("data-v-53cf43a5_0", { source: ".dv-decoration-8 {\n display: flex;\n width: 100%;\n height: 100%;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,aAAa;EACb,WAAW;EACX,YAAY;AACd","file":"main.vue","sourcesContent":[".dv-decoration-8 {\n display: flex;\n width: 100%;\n height: 100%;\n}\n"]}, media: undefined }); - var interopRequireDefault = createCommonjsModule(function (module) { - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - "default": obj }; - } - - module.exports = _interopRequireDefault; - }); - - unwrapExports(interopRequireDefault); - - function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) { - for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { - arr2[i] = arr[i]; - } - - return arr2; - } - } + /* scoped */ + const __vue_scope_id__$m = undefined; + /* module identifier */ + const __vue_module_identifier__$m = undefined; + /* functional template */ + const __vue_is_functional_template__$m = false; + /* style inject SSR */ + + /* style inject shadow dom */ + - var arrayWithoutHoles = _arrayWithoutHoles; + + const __vue_component__$m = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$m, staticRenderFns: __vue_staticRenderFns__$m }, + __vue_inject_styles__$m, + __vue_script__$m, + __vue_scope_id__$m, + __vue_is_functional_template__$m, + __vue_module_identifier__$m, + false, + createInjector, + undefined, + undefined + ); - function _iterableToArray(iter) { - if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); + function decoration8 (Vue) { + Vue.component(__vue_component__$m.name, __vue_component__$m); } - var iterableToArray = _iterableToArray; + // + var script$n = { + name: 'DvDecoration9', + mixins: [autoResize], + props: { + color: { + type: Array, + default: () => [] + }, + dur: { + type: Number, + default: 3 + } + }, - function _nonIterableSpread() { - throw new TypeError("Invalid attempt to spread non-iterable instance"); - } + data() { + const id = uuid(); + return { + ref: 'decoration-9', + polygonId: `decoration-9-polygon-${id}`, + svgWH: [100, 100], + svgScale: [1, 1], + defaultColor: ['rgba(3, 166, 224, 0.8)', 'rgba(3, 166, 224, 0.5)'], + mergedColor: [] + }; + }, - var nonIterableSpread = _nonIterableSpread; + watch: { + color() { + const { + mergeColor + } = this; + mergeColor(); + } - function _toConsumableArray(arr) { - return arrayWithoutHoles(arr) || iterableToArray(arr) || nonIterableSpread(); - } + }, + methods: { + afterAutoResizeMixinInit() { + const { + calcScale + } = this; + calcScale(); + }, - var toConsumableArray = _toConsumableArray; + calcScale() { + const { + width, + height, + svgWH + } = this; + const [w, h] = svgWH; + this.svgScale = [width / w, height / h]; + }, - var keywords = createCommonjsModule(function (module, exports) { + onResize() { + const { + calcScale + } = this; + calcScale(); + }, - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports["default"] = void 0; + mergeColor() { + const { + color, + defaultColor + } = this; + this.mergedColor = util_2$1(util_1(defaultColor, true), color || []); + }, - var _default = new Map([['transparent', 'rgba(0,0,0,0)'], ['black', '#000000'], ['silver', '#C0C0C0'], ['gray', '#808080'], ['white', '#FFFFFF'], ['maroon', '#800000'], ['red', '#FF0000'], ['purple', '#800080'], ['fuchsia', '#FF00FF'], ['green', '#008000'], ['lime', '#00FF00'], ['olive', '#808000'], ['yellow', '#FFFF00'], ['navy', '#000080'], ['blue', '#0000FF'], ['teal', '#008080'], ['aqua', '#00FFFF'], ['aliceblue', '#f0f8ff'], ['antiquewhite', '#faebd7'], ['aquamarine', '#7fffd4'], ['azure', '#f0ffff'], ['beige', '#f5f5dc'], ['bisque', '#ffe4c4'], ['blanchedalmond', '#ffebcd'], ['blueviolet', '#8a2be2'], ['brown', '#a52a2a'], ['burlywood', '#deb887'], ['cadetblue', '#5f9ea0'], ['chartreuse', '#7fff00'], ['chocolate', '#d2691e'], ['coral', '#ff7f50'], ['cornflowerblue', '#6495ed'], ['cornsilk', '#fff8dc'], ['crimson', '#dc143c'], ['cyan', '#00ffff'], ['darkblue', '#00008b'], ['darkcyan', '#008b8b'], ['darkgoldenrod', '#b8860b'], ['darkgray', '#a9a9a9'], ['darkgreen', '#006400'], ['darkgrey', '#a9a9a9'], ['darkkhaki', '#bdb76b'], ['darkmagenta', '#8b008b'], ['darkolivegreen', '#556b2f'], ['darkorange', '#ff8c00'], ['darkorchid', '#9932cc'], ['darkred', '#8b0000'], ['darksalmon', '#e9967a'], ['darkseagreen', '#8fbc8f'], ['darkslateblue', '#483d8b'], ['darkslategray', '#2f4f4f'], ['darkslategrey', '#2f4f4f'], ['darkturquoise', '#00ced1'], ['darkviolet', '#9400d3'], ['deeppink', '#ff1493'], ['deepskyblue', '#00bfff'], ['dimgray', '#696969'], ['dimgrey', '#696969'], ['dodgerblue', '#1e90ff'], ['firebrick', '#b22222'], ['floralwhite', '#fffaf0'], ['forestgreen', '#228b22'], ['gainsboro', '#dcdcdc'], ['ghostwhite', '#f8f8ff'], ['gold', '#ffd700'], ['goldenrod', '#daa520'], ['greenyellow', '#adff2f'], ['grey', '#808080'], ['honeydew', '#f0fff0'], ['hotpink', '#ff69b4'], ['indianred', '#cd5c5c'], ['indigo', '#4b0082'], ['ivory', '#fffff0'], ['khaki', '#f0e68c'], ['lavender', '#e6e6fa'], ['lavenderblush', '#fff0f5'], ['lawngreen', '#7cfc00'], ['lemonchiffon', '#fffacd'], ['lightblue', '#add8e6'], ['lightcoral', '#f08080'], ['lightcyan', '#e0ffff'], ['lightgoldenrodyellow', '#fafad2'], ['lightgray', '#d3d3d3'], ['lightgreen', '#90ee90'], ['lightgrey', '#d3d3d3'], ['lightpink', '#ffb6c1'], ['lightsalmon', '#ffa07a'], ['lightseagreen', '#20b2aa'], ['lightskyblue', '#87cefa'], ['lightslategray', '#778899'], ['lightslategrey', '#778899'], ['lightsteelblue', '#b0c4de'], ['lightyellow', '#ffffe0'], ['limegreen', '#32cd32'], ['linen', '#faf0e6'], ['magenta', '#ff00ff'], ['mediumaquamarine', '#66cdaa'], ['mediumblue', '#0000cd'], ['mediumorchid', '#ba55d3'], ['mediumpurple', '#9370db'], ['mediumseagreen', '#3cb371'], ['mediumslateblue', '#7b68ee'], ['mediumspringgreen', '#00fa9a'], ['mediumturquoise', '#48d1cc'], ['mediumvioletred', '#c71585'], ['midnightblue', '#191970'], ['mintcream', '#f5fffa'], ['mistyrose', '#ffe4e1'], ['moccasin', '#ffe4b5'], ['navajowhite', '#ffdead'], ['oldlace', '#fdf5e6'], ['olivedrab', '#6b8e23'], ['orange', '#ffa500'], ['orangered', '#ff4500'], ['orchid', '#da70d6'], ['palegoldenrod', '#eee8aa'], ['palegreen', '#98fb98'], ['paleturquoise', '#afeeee'], ['palevioletred', '#db7093'], ['papayawhip', '#ffefd5'], ['peachpuff', '#ffdab9'], ['peru', '#cd853f'], ['pink', '#ffc0cb'], ['plum', '#dda0dd'], ['powderblue', '#b0e0e6'], ['rosybrown', '#bc8f8f'], ['royalblue', '#4169e1'], ['saddlebrown', '#8b4513'], ['salmon', '#fa8072'], ['sandybrown', '#f4a460'], ['seagreen', '#2e8b57'], ['seashell', '#fff5ee'], ['sienna', '#a0522d'], ['skyblue', '#87ceeb'], ['slateblue', '#6a5acd'], ['slategray', '#708090'], ['slategrey', '#708090'], ['snow', '#fffafa'], ['springgreen', '#00ff7f'], ['steelblue', '#4682b4'], ['tan', '#d2b48c'], ['thistle', '#d8bfd8'], ['tomato', '#ff6347'], ['turquoise', '#40e0d0'], ['violet', '#ee82ee'], ['wheat', '#f5deb3'], ['whitesmoke', '#f5f5f5'], ['yellowgreen', '#9acd32']]); + fade: lib_9 + }, - exports["default"] = _default; - }); + mounted() { + const { + mergeColor + } = this; + mergeColor(); + } - unwrapExports(keywords); + }; - var lib = createCommonjsModule(function (module, exports) { + /* script */ + const __vue_script__$n = script$n; + /* template */ + var __vue_render__$n = function() { + var _vm = this; + var _h = _vm.$createElement; + var _c = _vm._self._c || _h; + return _c( + "div", + { ref: _vm.ref, staticClass: "dv-decoration-9" }, + [ + _c( + "svg", + { + style: + "transform:scale(" + _vm.svgScale[0] + "," + _vm.svgScale[1] + ");", + attrs: { width: _vm.svgWH[0] + "px", height: _vm.svgWH[1] + "px" } + }, + [ + _c("defs", [ + _c("polygon", { + attrs: { + id: _vm.polygonId, + points: "15, 46.5, 21, 47.5, 21, 52.5, 15, 53.5" + } + }) + ]), + _vm._v(" "), + _c( + "circle", + { + attrs: { + cx: "50", + cy: "50", + r: "45", + fill: "transparent", + stroke: _vm.mergedColor[1], + "stroke-width": "10", + "stroke-dasharray": "80, 100, 30, 100" + } + }, + [ + _c("animateTransform", { + attrs: { + attributeName: "transform", + type: "rotate", + values: "0 50 50;360 50 50", + dur: _vm.dur + "s", + repeatCount: "indefinite" + } + }) + ], + 1 + ), + _vm._v(" "), + _c( + "circle", + { + attrs: { + cx: "50", + cy: "50", + r: "45", + fill: "transparent", + stroke: _vm.mergedColor[0], + "stroke-width": "6", + "stroke-dasharray": "50, 66, 100, 66" + } + }, + [ + _c("animateTransform", { + attrs: { + attributeName: "transform", + type: "rotate", + values: "0 50 50;-360 50 50", + dur: _vm.dur + "s", + repeatCount: "indefinite" + } + }) + ], + 1 + ), + _vm._v(" "), + _c("circle", { + attrs: { + cx: "50", + cy: "50", + r: "38", + fill: "transparent", + stroke: _vm.fade(_vm.mergedColor[1] || _vm.defaultColor[1], 30), + "stroke-width": "1", + "stroke-dasharray": "5, 1" + } + }), + _vm._v(" "), + _vm._l(new Array(20).fill(0), function(foo, i) { + return _c( + "use", + { + key: i, + attrs: { + "xlink:href": "#" + _vm.polygonId, + stroke: _vm.mergedColor[1], + fill: Math.random() > 0.4 ? "transparent" : _vm.mergedColor[0] + } + }, + [ + _c("animateTransform", { + attrs: { + attributeName: "transform", + type: "rotate", + values: "0 50 50;360 50 50", + dur: _vm.dur + "s", + begin: (i * _vm.dur) / 20 + "s", + repeatCount: "indefinite" + } + }) + ], + 1 + ) + }), + _vm._v(" "), + _c("circle", { + attrs: { + cx: "50", + cy: "50", + r: "26", + fill: "transparent", + stroke: _vm.fade(_vm.mergedColor[1] || _vm.defaultColor[1], 30), + "stroke-width": "1", + "stroke-dasharray": "5, 1" + } + }) + ], + 2 + ), + _vm._v(" "), + _vm._t("default") + ], + 2 + ) + }; + var __vue_staticRenderFns__$n = []; + __vue_render__$n._withStripped = true; + /* style */ + const __vue_inject_styles__$n = function (inject) { + if (!inject) return + inject("data-v-b47f91a8_0", { source: ".dv-decoration-9 {\n position: relative;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.dv-decoration-9 svg {\n position: absolute;\n left: 0px;\n top: 0px;\n transform-origin: left top;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;EACZ,aAAa;EACb,mBAAmB;EACnB,uBAAuB;AACzB;AACA;EACE,kBAAkB;EAClB,SAAS;EACT,QAAQ;EACR,0BAA0B;AAC5B","file":"main.vue","sourcesContent":[".dv-decoration-9 {\n position: relative;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.dv-decoration-9 svg {\n position: absolute;\n left: 0px;\n top: 0px;\n transform-origin: left top;\n}\n"]}, media: undefined }); - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.getRgbValue = getRgbValue; - exports.getRgbaValue = getRgbaValue; - exports.getOpacity = getOpacity; - exports.toRgb = toRgb; - exports.toHex = toHex; - exports.getColorFromRgbValue = getColorFromRgbValue; - exports.darken = darken; - exports.lighten = lighten; - exports.fade = fade; - exports["default"] = void 0; + }; + /* scoped */ + const __vue_scope_id__$n = undefined; + /* module identifier */ + const __vue_module_identifier__$n = undefined; + /* functional template */ + const __vue_is_functional_template__$n = false; + /* style inject SSR */ + + /* style inject shadow dom */ + - var _toConsumableArray2 = interopRequireDefault(toConsumableArray); + + const __vue_component__$n = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$n, staticRenderFns: __vue_staticRenderFns__$n }, + __vue_inject_styles__$n, + __vue_script__$n, + __vue_scope_id__$n, + __vue_is_functional_template__$n, + __vue_module_identifier__$n, + false, + createInjector, + undefined, + undefined + ); - var _keywords = interopRequireDefault(keywords); + function decoration9 (Vue) { + Vue.component(__vue_component__$n.name, __vue_component__$n); + } - var hexReg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/; - var rgbReg = /^(rgb|rgba|RGB|RGBA)/; - var rgbaReg = /^(rgba|RGBA)/; - /** - * @description Color validator - * @param {String} color Hex|Rgb|Rgba color or color keyword - * @return {String|Boolean} Valid color Or false - */ + // + var script$o = { + name: 'DvDecoration10', + mixins: [autoResize], + props: { + color: { + type: Array, + default: () => [] + } + }, - function validator(color) { - var isHex = hexReg.test(color); - var isRgb = rgbReg.test(color); - if (isHex || isRgb) return color; - color = getColorByKeyword(color); + data() { + const id = uuid(); + return { + ref: 'decoration-10', + animationId1: `d10ani1${id}`, + animationId2: `d10ani2${id}`, + animationId3: `d10ani3${id}`, + animationId4: `d10ani4${id}`, + animationId5: `d10ani5${id}`, + animationId6: `d10ani6${id}`, + animationId7: `d10ani7${id}`, + defaultColor: ['#00c2ff', 'rgba(0, 194, 255, 0.3)'], + mergedColor: [] + }; + }, - if (!color) { - console.error('Color: Invalid color!'); - return false; - } + watch: { + color() { + const { + mergeColor + } = this; + mergeColor(); + } - return color; - } - /** - * @description Get color by keyword - * @param {String} keyword Color keyword like red, green and etc. - * @return {String|Boolean} Hex or rgba color (Invalid keyword will return false) - */ + }, + methods: { + mergeColor() { + const { + color, + defaultColor + } = this; + this.mergedColor = util_2$1(util_1(defaultColor, true), color || []); + } + }, - function getColorByKeyword(keyword) { - if (!keyword) { - console.error('getColorByKeywords: Missing parameters!'); - return false; + mounted() { + const { + mergeColor + } = this; + mergeColor(); } - if (!_keywords["default"].has(keyword)) return false; - return _keywords["default"].get(keyword); - } - /** - * @description Get the Rgb value of the color - * @param {String} color Hex|Rgb|Rgba color or color keyword - * @return {Array|Boolean} Rgb value of the color (Invalid input will return false) - */ + }; + + /* script */ + const __vue_script__$o = script$o; + /* template */ + var __vue_render__$o = function() { + var _vm = this; + var _h = _vm.$createElement; + var _c = _vm._self._c || _h; + return _c("div", { ref: _vm.ref, staticClass: "dv-decoration-10" }, [ + _c("svg", { attrs: { width: _vm.width, height: _vm.height } }, [ + _c("polyline", { + attrs: { + stroke: _vm.mergedColor[1], + "stroke-width": "2", + points: + "0, " + _vm.height / 2 + " " + _vm.width + ", " + _vm.height / 2 + } + }), + _vm._v(" "), + _c( + "polyline", + { + attrs: { + stroke: _vm.mergedColor[0], + "stroke-width": "2", + points: + "5, " + + _vm.height / 2 + + " " + + (_vm.width * 0.2 - 3) + + ", " + + _vm.height / 2, + "stroke-dasharray": "0, " + _vm.width * 0.2, + fill: "freeze" + } + }, + [ + _c("animate", { + attrs: { + id: _vm.animationId2, + attributeName: "stroke-dasharray", + values: "0, " + _vm.width * 0.2 + ";" + _vm.width * 0.2 + ", 0;", + dur: "3s", + begin: _vm.animationId1 + ".end", + fill: "freeze" + } + }), + _vm._v(" "), + _c("animate", { + attrs: { + attributeName: "stroke-dasharray", + values: _vm.width * 0.2 + ", 0;0, " + _vm.width * 0.2, + dur: "0.01s", + begin: _vm.animationId7 + ".end", + fill: "freeze" + } + }) + ] + ), + _vm._v(" "), + _c( + "polyline", + { + attrs: { + stroke: _vm.mergedColor[0], + "stroke-width": "2", + points: + _vm.width * 0.2 + + 3 + + ", " + + _vm.height / 2 + + " " + + (_vm.width * 0.8 - 3) + + ", " + + _vm.height / 2, + "stroke-dasharray": "0, " + _vm.width * 0.6 + } + }, + [ + _c("animate", { + attrs: { + id: _vm.animationId4, + attributeName: "stroke-dasharray", + values: "0, " + _vm.width * 0.6 + ";" + _vm.width * 0.6 + ", 0", + dur: "3s", + begin: _vm.animationId3 + ".end + 1s", + fill: "freeze" + } + }), + _vm._v(" "), + _c("animate", { + attrs: { + attributeName: "stroke-dasharray", + values: _vm.width * 0.6 + ", 0;0, " + _vm.width * 0.6, + dur: "0.01s", + begin: _vm.animationId7 + ".end", + fill: "freeze" + } + }) + ] + ), + _vm._v(" "), + _c( + "polyline", + { + attrs: { + stroke: _vm.mergedColor[0], + "stroke-width": "2", + points: + _vm.width * 0.8 + + 3 + + ", " + + _vm.height / 2 + + " " + + (_vm.width - 5) + + ", " + + _vm.height / 2, + "stroke-dasharray": "0, " + _vm.width * 0.2 + } + }, + [ + _c("animate", { + attrs: { + id: _vm.animationId6, + attributeName: "stroke-dasharray", + values: "0, " + _vm.width * 0.2 + ";" + _vm.width * 0.2 + ", 0", + dur: "3s", + begin: _vm.animationId5 + ".end + 1s", + fill: "freeze" + } + }), + _vm._v(" "), + _c("animate", { + attrs: { + attributeName: "stroke-dasharray", + values: _vm.width * 0.2 + ", 0;0, " + _vm.width * 0.3, + dur: "0.01s", + begin: _vm.animationId7 + ".end", + fill: "freeze" + } + }) + ] + ), + _vm._v(" "), + _c( + "circle", + { + attrs: { + cx: "2", + cy: _vm.height / 2, + r: "2", + fill: _vm.mergedColor[1] + } + }, + [ + _c("animate", { + attrs: { + id: _vm.animationId1, + attributeName: "fill", + values: _vm.mergedColor[1] + ";" + _vm.mergedColor[0], + begin: "0s;" + _vm.animationId7 + ".end", + dur: "0.3s", + fill: "freeze" + } + }) + ] + ), + _vm._v(" "), + _c( + "circle", + { + attrs: { + cx: _vm.width * 0.2, + cy: _vm.height / 2, + r: "2", + fill: _vm.mergedColor[1] + } + }, + [ + _c("animate", { + attrs: { + id: _vm.animationId3, + attributeName: "fill", + values: _vm.mergedColor[1] + ";" + _vm.mergedColor[0], + begin: _vm.animationId2 + ".end", + dur: "0.3s", + fill: "freeze" + } + }), + _vm._v(" "), + _c("animate", { + attrs: { + attributeName: "fill", + values: _vm.mergedColor[1] + ";" + _vm.mergedColor[1], + dur: "0.01s", + begin: _vm.animationId7 + ".end", + fill: "freeze" + } + }) + ] + ), + _vm._v(" "), + _c( + "circle", + { + attrs: { + cx: _vm.width * 0.8, + cy: _vm.height / 2, + r: "2", + fill: _vm.mergedColor[1] + } + }, + [ + _c("animate", { + attrs: { + id: _vm.animationId5, + attributeName: "fill", + values: _vm.mergedColor[1] + ";" + _vm.mergedColor[0], + begin: _vm.animationId4 + ".end", + dur: "0.3s", + fill: "freeze" + } + }), + _vm._v(" "), + _c("animate", { + attrs: { + attributeName: "fill", + values: _vm.mergedColor[1] + ";" + _vm.mergedColor[1], + dur: "0.01s", + begin: _vm.animationId7 + ".end", + fill: "freeze" + } + }) + ] + ), + _vm._v(" "), + _c( + "circle", + { + attrs: { + cx: _vm.width - 2, + cy: _vm.height / 2, + r: "2", + fill: _vm.mergedColor[1] + } + }, + [ + _c("animate", { + attrs: { + id: _vm.animationId7, + attributeName: "fill", + values: _vm.mergedColor[1] + ";" + _vm.mergedColor[0], + begin: _vm.animationId6 + ".end", + dur: "0.3s", + fill: "freeze" + } + }), + _vm._v(" "), + _c("animate", { + attrs: { + attributeName: "fill", + values: _vm.mergedColor[1] + ";" + _vm.mergedColor[1], + dur: "0.01s", + begin: _vm.animationId7 + ".end", + fill: "freeze" + } + }) + ] + ) + ]) + ]) + }; + var __vue_staticRenderFns__$o = []; + __vue_render__$o._withStripped = true; - function getRgbValue(color) { - if (!color) { - console.error('getRgbValue: Missing parameters!'); - return false; - } + /* style */ + const __vue_inject_styles__$o = function (inject) { + if (!inject) return + inject("data-v-23172a05_0", { source: ".dv-decoration-10 {\n width: 100%;\n height: 100%;\n display: flex;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,WAAW;EACX,YAAY;EACZ,aAAa;AACf","file":"main.vue","sourcesContent":[".dv-decoration-10 {\n width: 100%;\n height: 100%;\n display: flex;\n}\n"]}, media: undefined }); - color = validator(color); - if (!color) return false; - var isHex = hexReg.test(color); - var isRgb = rgbReg.test(color); - var lowerColor = color.toLowerCase(); - if (isHex) return getRgbValueFromHex(lowerColor); - if (isRgb) return getRgbValueFromRgb(lowerColor); - } - /** - * @description Get the rgb value of the hex color - * @param {String} color Hex color - * @return {Array} Rgb value of the color - */ + }; + /* scoped */ + const __vue_scope_id__$o = undefined; + /* module identifier */ + const __vue_module_identifier__$o = undefined; + /* functional template */ + const __vue_is_functional_template__$o = false; + /* style inject SSR */ + + /* style inject shadow dom */ + + + const __vue_component__$o = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$o, staticRenderFns: __vue_staticRenderFns__$o }, + __vue_inject_styles__$o, + __vue_script__$o, + __vue_scope_id__$o, + __vue_is_functional_template__$o, + __vue_module_identifier__$o, + false, + createInjector, + undefined, + undefined + ); - function getRgbValueFromHex(color) { - color = color.replace('#', ''); - if (color.length === 3) color = Array.from(color).map(function (hexNum) { - return hexNum + hexNum; - }).join(''); - color = color.split(''); - return new Array(3).fill(0).map(function (t, i) { - return parseInt("0x".concat(color[i * 2]).concat(color[i * 2 + 1])); - }); + function decoration10 (Vue) { + Vue.component(__vue_component__$o.name, __vue_component__$o); } - /** - * @description Get the rgb value of the rgb/rgba color - * @param {String} color Hex color - * @return {Array} Rgb value of the color - */ - - function getRgbValueFromRgb(color) { - return color.replace(/rgb\(|rgba\(|\)/g, '').split(',').slice(0, 3).map(function (n) { - return parseInt(n); - }); - } - /** - * @description Get the Rgba value of the color - * @param {String} color Hex|Rgb|Rgba color or color keyword - * @return {Array|Boolean} Rgba value of the color (Invalid input will return false) - */ + // + var script$p = { + name: 'DvDecoration11', + mixins: [autoResize], + props: { + color: { + type: Array, + default: () => [] + } + }, + data() { + return { + ref: 'decoration-11', + defaultColor: ['#1a98fc', '#2cf7fe'], + mergedColor: [] + }; + }, - function getRgbaValue(color) { - if (!color) { - console.error('getRgbaValue: Missing parameters!'); - return false; - } + watch: { + color() { + const { + mergeColor + } = this; + mergeColor(); + } - var colorValue = getRgbValue(color); - if (!colorValue) return false; - colorValue.push(getOpacity(color)); - return colorValue; - } - /** - * @description Get the opacity of color - * @param {String} color Hex|Rgb|Rgba color or color keyword - * @return {Number|Boolean} Color opacity (Invalid input will return false) - */ + }, + methods: { + mergeColor() { + const { + color, + defaultColor + } = this; + this.mergedColor = util_2$1(util_1(defaultColor, true), color || []); + }, + fade: lib_9 + }, - function getOpacity(color) { - if (!color) { - console.error('getOpacity: Missing parameters!'); - return false; + mounted() { + const { + mergeColor + } = this; + mergeColor(); } - color = validator(color); - if (!color) return false; - var isRgba = rgbaReg.test(color); - if (!isRgba) return 1; - color = color.toLowerCase(); - return Number(color.split(',').slice(-1)[0].replace(/[)|\s]/g, '')); - } - /** - * @description Convert color to Rgb|Rgba color - * @param {String} color Hex|Rgb|Rgba color or color keyword - * @param {Number} opacity The opacity of color - * @return {String|Boolean} Rgb|Rgba color (Invalid input will return false) - */ + }; + /* script */ + const __vue_script__$p = script$p; - function toRgb(color, opacity) { - if (!color) { - console.error('toRgb: Missing parameters!'); - return false; - } + /* template */ + var __vue_render__$p = function() { + var _vm = this; + var _h = _vm.$createElement; + var _c = _vm._self._c || _h; + return _c("div", { ref: _vm.ref, staticClass: "dv-decoration-11" }, [ + _c("svg", { attrs: { width: _vm.width, height: _vm.height } }, [ + _c("polygon", { + attrs: { + fill: _vm.fade(_vm.mergedColor[1] || _vm.defaultColor[1], 10), + stroke: _vm.mergedColor[1], + points: "20 10, 25 4, 55 4 60 10" + } + }), + _vm._v(" "), + _c("polygon", { + attrs: { + fill: _vm.fade(_vm.mergedColor[1] || _vm.defaultColor[1], 10), + stroke: _vm.mergedColor[1], + points: + "20 " + + (_vm.height - 10) + + ", 25 " + + (_vm.height - 4) + + ", 55 " + + (_vm.height - 4) + + " 60 " + + (_vm.height - 10) + } + }), + _vm._v(" "), + _c("polygon", { + attrs: { + fill: _vm.fade(_vm.mergedColor[1] || _vm.defaultColor[1], 10), + stroke: _vm.mergedColor[1], + points: + _vm.width - + 20 + + " 10, " + + (_vm.width - 25) + + " 4, " + + (_vm.width - 55) + + " 4 " + + (_vm.width - 60) + + " 10" + } + }), + _vm._v(" "), + _c("polygon", { + attrs: { + fill: _vm.fade(_vm.mergedColor[1] || _vm.defaultColor[1], 10), + stroke: _vm.mergedColor[1], + points: + _vm.width - + 20 + + " " + + (_vm.height - 10) + + ", " + + (_vm.width - 25) + + " " + + (_vm.height - 4) + + ", " + + (_vm.width - 55) + + " " + + (_vm.height - 4) + + " " + + (_vm.width - 60) + + " " + + (_vm.height - 10) + } + }), + _vm._v(" "), + _c("polygon", { + attrs: { + fill: _vm.fade(_vm.mergedColor[0] || _vm.defaultColor[0], 20), + stroke: _vm.mergedColor[0], + points: + "\n 20 10, 5 " + + _vm.height / 2 + + " 20 " + + (_vm.height - 10) + + "\n " + + (_vm.width - 20) + + " " + + (_vm.height - 10) + + " " + + (_vm.width - 5) + + " " + + _vm.height / 2 + + " " + + (_vm.width - 20) + + " 10\n " + } + }), + _vm._v(" "), + _c("polyline", { + attrs: { + fill: "transparent", + stroke: _vm.fade(_vm.mergedColor[0] || _vm.defaultColor[0], 70), + points: "25 18, 15 " + _vm.height / 2 + " 25 " + (_vm.height - 18) + } + }), + _vm._v(" "), + _c("polyline", { + attrs: { + fill: "transparent", + stroke: _vm.fade(_vm.mergedColor[0] || _vm.defaultColor[0], 70), + points: + _vm.width - + 25 + + " 18, " + + (_vm.width - 15) + + " " + + _vm.height / 2 + + " " + + (_vm.width - 25) + + " " + + (_vm.height - 18) + } + }) + ]), + _vm._v(" "), + _c("div", { staticClass: "decoration-content" }, [_vm._t("default")], 2) + ]) + }; + var __vue_staticRenderFns__$p = []; + __vue_render__$p._withStripped = true; - var rgbValue = getRgbValue(color); - if (!rgbValue) return false; - var addOpacity = typeof opacity === 'number'; - if (addOpacity) return 'rgba(' + rgbValue.join(',') + ",".concat(opacity, ")"); - return 'rgb(' + rgbValue.join(',') + ')'; - } - /** - * @description Convert color to Hex color - * @param {String} color Hex|Rgb|Rgba color or color keyword - * @return {String|Boolean} Hex color (Invalid input will return false) - */ + /* style */ + const __vue_inject_styles__$p = function (inject) { + if (!inject) return + inject("data-v-53895fd4_0", { source: ".dv-decoration-11 {\n position: relative;\n width: 100%;\n height: 100%;\n display: flex;\n}\n.dv-decoration-11 .decoration-content {\n position: absolute;\n top: 0px;\n left: 0px;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;EACZ,aAAa;AACf;AACA;EACE,kBAAkB;EAClB,QAAQ;EACR,SAAS;EACT,WAAW;EACX,YAAY;EACZ,aAAa;EACb,mBAAmB;EACnB,uBAAuB;AACzB","file":"main.vue","sourcesContent":[".dv-decoration-11 {\n position: relative;\n width: 100%;\n height: 100%;\n display: flex;\n}\n.dv-decoration-11 .decoration-content {\n position: absolute;\n top: 0px;\n left: 0px;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n"]}, media: undefined }); + }; + /* scoped */ + const __vue_scope_id__$p = undefined; + /* module identifier */ + const __vue_module_identifier__$p = undefined; + /* functional template */ + const __vue_is_functional_template__$p = false; + /* style inject SSR */ + + /* style inject shadow dom */ + - function toHex(color) { - if (!color) { - console.error('toHex: Missing parameters!'); - return false; - } + + const __vue_component__$p = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$p, staticRenderFns: __vue_staticRenderFns__$p }, + __vue_inject_styles__$p, + __vue_script__$p, + __vue_scope_id__$p, + __vue_is_functional_template__$p, + __vue_module_identifier__$p, + false, + createInjector, + undefined, + undefined + ); - if (hexReg.test(color)) return color; - color = getRgbValue(color); - if (!color) return false; - return '#' + color.map(function (n) { - return Number(n).toString(16); - }).map(function (n) { - return n === '0' ? '00' : n; - }).join(''); + function decoration11 (Vue) { + Vue.component(__vue_component__$p.name, __vue_component__$p); } - /** - * @description Get Color from Rgb|Rgba value - * @param {Array} value Rgb|Rgba color value - * @return {String|Boolean} Rgb|Rgba color (Invalid input will return false) - */ + // + var script$q = { + name: 'DvDecoration12', + mixins: [autoResize], + props: { + color: { + type: Array, + default: () => [] + }, - function getColorFromRgbValue(value) { - if (!value) { - console.error('getColorFromRgbValue: Missing parameters!'); - return false; - } + /** + * @description Scan animation dur + */ + scanDur: { + type: Number, + default: 3 + }, - var valueLength = value.length; + /** + * @description Halo animation dur + */ + haloDur: { + type: Number, + default: 2 + } + }, - if (valueLength !== 3 && valueLength !== 4) { - console.error('getColorFromRgbValue: Value is illegal!'); - return false; - } + data() { + const id = uuid(); + return { + ref: 'decoration-12', + gId: `decoration-12-g-${id}`, + gradientId: `decoration-12-gradient-${id}`, + defaultColor: ['#2783ce', '#2cf7fe'], + mergedColor: [], + pathD: [], + pathColor: [], + circleR: [], + splitLinePoints: [], + arcD: [], + segment: 30, + sectorAngle: Math.PI / 3, + ringNum: 3, + ringWidth: 1, + showSplitLine: true + }; + }, - var color = valueLength === 3 ? 'rgb(' : 'rgba('; - color += value.join(',') + ')'; - return color; - } - /** - * @description Deepen color - * @param {String} color Hex|Rgb|Rgba color or color keyword - * @return {Number} Percent of Deepen (1-100) - * @return {String|Boolean} Rgba color (Invalid input will return false) - */ + watch: { + color() { + const { + mergeColor + } = this; + mergeColor(); + } + }, + computed: { + x() { + const { + width + } = this; + return width / 2; + }, - function darken(color) { - var percent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + y() { + const { + height + } = this; + return height / 2; + } - if (!color) { - console.error('darken: Missing parameters!'); - return false; - } + }, + methods: { + init() { + const { + mergeColor, + calcPathD, + calcPathColor, + calcCircleR, + calcSplitLinePoints, + calcArcD + } = this; + mergeColor(); + calcPathD(); + calcPathColor(); + calcCircleR(); + calcSplitLinePoints(); + calcArcD(); + }, - var rgbaValue = getRgbaValue(color); - if (!rgbaValue) return false; - rgbaValue = rgbaValue.map(function (v, i) { - return i === 3 ? v : v - Math.ceil(2.55 * percent); - }).map(function (v) { - return v < 0 ? 0 : v; - }); - return getColorFromRgbValue(rgbaValue); - } - /** - * @description Brighten color - * @param {String} color Hex|Rgb|Rgba color or color keyword - * @return {Number} Percent of brighten (1-100) - * @return {String|Boolean} Rgba color (Invalid input will return false) - */ + mergeColor() { + const { + color, + defaultColor + } = this; + this.mergedColor = util_2$1(util_1(defaultColor, true), color || []); + }, + calcPathD() { + const { + x, + y, + width, + segment, + sectorAngle + } = this; + const startAngle = -Math.PI / 2; + const angleGap = sectorAngle / segment; + const r = width / 4; + let lastEndPoints = util_13(x, y, r, startAngle); + this.pathD = new Array(segment).fill('').map((_, i) => { + const endPoints = util_13(x, y, r, startAngle - (i + 1) * angleGap).map(_ => _.toFixed(5)); + const d = `M${lastEndPoints.join(',')} A${r}, ${r} 0 0 0 ${endPoints.join(',')}`; + lastEndPoints = endPoints; + return d; + }); + }, - function lighten(color) { - var percent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + calcPathColor() { + const { + mergedColor: [color], + segment + } = this; + const colorGap = 100 / (segment - 1); + this.pathColor = new Array(segment).fill(color).map((_, i) => lib_9(color, 100 - i * colorGap)); + }, - if (!color) { - console.error('lighten: Missing parameters!'); - return false; - } + calcCircleR() { + const { + segment, + ringNum, + width, + ringWidth + } = this; + const radiusGap = (width / 2 - ringWidth / 2) / ringNum; + this.circleR = new Array(ringNum).fill(0).map((_, i) => radiusGap * (i + 1)); + }, - var rgbaValue = getRgbaValue(color); - if (!rgbaValue) return false; - rgbaValue = rgbaValue.map(function (v, i) { - return i === 3 ? v : v + Math.ceil(2.55 * percent); - }).map(function (v) { - return v > 255 ? 255 : v; - }); - return getColorFromRgbValue(rgbaValue); - } - /** - * @description Adjust color opacity - * @param {String} color Hex|Rgb|Rgba color or color keyword - * @param {Number} Percent of opacity - * @return {String|Boolean} Rgba color (Invalid input will return false) - */ + calcSplitLinePoints() { + const { + x, + y, + width + } = this; + const angleGap = Math.PI / 6; + const r = width / 2; + this.splitLinePoints = new Array(6).fill('').map((_, i) => { + const startAngle = angleGap * (i + 1); + const endAngle = startAngle + Math.PI; + const startPoint = util_13(x, y, r, startAngle); + const endPoint = util_13(x, y, r, endAngle); + return `${startPoint.join(',')} ${endPoint.join(',')}`; + }); + }, + calcArcD() { + const { + x, + y, + width + } = this; + const angleGap = Math.PI / 6; + const r = width / 2 - 1; + this.arcD = new Array(4).fill('').map((_, i) => { + const startAngle = angleGap * (3 * i + 1); + const endAngle = startAngle + angleGap; + const startPoint = util_13(x, y, r, startAngle); + const endPoint = util_13(x, y, r, endAngle); + return `M${startPoint.join(',')} A${x}, ${y} 0 0 1 ${endPoint.join(',')}`; + }); + }, - function fade(color) { - var percent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 100; + afterAutoResizeMixinInit() { + const { + init + } = this; + init(); + }, - if (!color) { - console.error('fade: Missing parameters!'); - return false; + fade: lib_9 } + }; - var rgbValue = getRgbValue(color); - if (!rgbValue) return false; - var rgbaValue = [].concat((0, _toConsumableArray2["default"])(rgbValue), [percent / 100]); - return getColorFromRgbValue(rgbaValue); - } + /* script */ + const __vue_script__$q = script$q; - var _default = { - fade: fade, - toHex: toHex, - toRgb: toRgb, - darken: darken, - lighten: lighten, - getOpacity: getOpacity, - getRgbValue: getRgbValue, - getRgbaValue: getRgbaValue, - getColorFromRgbValue: getColorFromRgbValue + /* template */ + var __vue_render__$q = function() { + var _vm = this; + var _h = _vm.$createElement; + var _c = _vm._self._c || _h; + return _c("div", { ref: _vm.ref, staticClass: "dv-decoration-12" }, [ + _c( + "svg", + { attrs: { width: _vm.width, height: _vm.height } }, + [ + _c( + "defs", + [ + _c( + "g", + { attrs: { id: _vm.gId } }, + _vm._l(_vm.pathD, function(d, i) { + return _c("path", { + key: d, + attrs: { + stroke: _vm.pathColor[i], + "stroke-width": _vm.width / 2, + fill: "transparent", + d: d + } + }) + }), + 0 + ), + _vm._v(" "), + _c( + "radialGradient", + { attrs: { id: _vm.gradientId, cx: "50%", cy: "50%", r: "50%" } }, + [ + _c("stop", { + attrs: { + offset: "0%", + "stop-color": "transparent", + "stop-opacity": "1" + } + }), + _vm._v(" "), + _c("stop", { + attrs: { + offset: "100%", + "stop-color": _vm.fade( + _vm.mergedColor[1] || _vm.defaultColor[1], + 30 + ), + "stop-opacity": "1" + } + }) + ], + 1 + ) + ], + 1 + ), + _vm._v(" "), + _vm._l(_vm.circleR, function(r) { + return _c("circle", { + key: r, + attrs: { + r: r, + cx: _vm.x, + cy: _vm.y, + stroke: _vm.mergedColor[1], + "stroke-width": 0.5, + fill: "transparent" + } + }) + }), + _vm._v(" "), + _c( + "circle", + { + attrs: { + r: "1", + cx: _vm.x, + cy: _vm.y, + stroke: "transparent", + fill: "url(#" + _vm.gradientId + ")" + } + }, + [ + _c("animate", { + attrs: { + attributeName: "r", + values: "1;" + _vm.width / 2, + dur: _vm.haloDur + "s", + repeatCount: "indefinite" + } + }), + _vm._v(" "), + _c("animate", { + attrs: { + attributeName: "opacity", + values: "1;0", + dur: _vm.haloDur + "s", + repeatCount: "indefinite" + } + }) + ] + ), + _vm._v(" "), + _c("circle", { + attrs: { r: "2", cx: _vm.x, cy: _vm.y, fill: _vm.mergedColor[1] } + }), + _vm._v(" "), + _vm.showSplitLine + ? _c( + "g", + _vm._l(_vm.splitLinePoints, function(p) { + return _c("polyline", { + key: p, + attrs: { + points: p, + stroke: _vm.mergedColor[1], + "stroke-width": 0.5, + opacity: "0.5" + } + }) + }), + 0 + ) + : _vm._e(), + _vm._v(" "), + _vm._l(_vm.arcD, function(d) { + return _c("path", { + key: d, + attrs: { + d: d, + stroke: _vm.mergedColor[1], + "stroke-width": "2", + fill: "transparent" + } + }) + }), + _vm._v(" "), + _c( + "use", + { attrs: { "xlink:href": "#" + _vm.gId } }, + [ + _c("animateTransform", { + attrs: { + attributeName: "transform", + type: "rotate", + values: + "0, " + _vm.x + " " + _vm.y + ";360, " + _vm.x + " " + _vm.y, + dur: _vm.scanDur + "s", + repeatCount: "indefinite" + } + }) + ], + 1 + ) + ], + 2 + ), + _vm._v(" "), + _c("div", { staticClass: "decoration-content" }, [_vm._t("default")], 2) + ]) }; - exports["default"] = _default; - }); - - unwrapExports(lib); - var lib_1 = lib.getRgbValue; - var lib_2 = lib.getRgbaValue; - var lib_3 = lib.getOpacity; - var lib_4 = lib.toRgb; - var lib_5 = lib.toHex; - var lib_6 = lib.getColorFromRgbValue; - var lib_7 = lib.darken; - var lib_8 = lib.lighten; - var lib_9 = lib.fade; + var __vue_staticRenderFns__$q = []; + __vue_render__$q._withStripped = true; - function _arrayWithHoles(arr) { - if (Array.isArray(arr)) return arr; - } + /* style */ + const __vue_inject_styles__$q = function (inject) { + if (!inject) return + inject("data-v-70099a0c_0", { source: ".dv-decoration-12 {\n position: relative;\n width: 100%;\n height: 100%;\n display: flex;\n}\n.dv-decoration-12 .decoration-content {\n position: absolute;\n top: 0px;\n left: 0px;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;EACZ,aAAa;AACf;AACA;EACE,kBAAkB;EAClB,QAAQ;EACR,SAAS;EACT,WAAW;EACX,YAAY;EACZ,aAAa;EACb,mBAAmB;EACnB,uBAAuB;AACzB","file":"main.vue","sourcesContent":[".dv-decoration-12 {\n position: relative;\n width: 100%;\n height: 100%;\n display: flex;\n}\n.dv-decoration-12 .decoration-content {\n position: absolute;\n top: 0px;\n left: 0px;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n"]}, media: undefined }); - var arrayWithHoles = _arrayWithHoles; + }; + /* scoped */ + const __vue_scope_id__$q = undefined; + /* module identifier */ + const __vue_module_identifier__$q = undefined; + /* functional template */ + const __vue_is_functional_template__$q = false; + /* style inject SSR */ + + /* style inject shadow dom */ + - function _iterableToArrayLimit(arr, i) { - var _arr = []; - var _n = true; - var _d = false; - var _e = undefined; + + const __vue_component__$q = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$q, staticRenderFns: __vue_staticRenderFns__$q }, + __vue_inject_styles__$q, + __vue_script__$q, + __vue_scope_id__$q, + __vue_is_functional_template__$q, + __vue_module_identifier__$q, + false, + createInjector, + undefined, + undefined + ); - try { - for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { - _arr.push(_s.value); + function decoration12 (Vue) { + Vue.component(__vue_component__$q.name, __vue_component__$q); + } - if (i && _arr.length === i) break; - } - } catch (err) { - _d = true; - _e = err; - } finally { - try { - if (!_n && _i["return"] != null) _i["return"](); - } finally { - if (_d) throw _e; - } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); } - - return _arr; } - var iterableToArrayLimit = _iterableToArrayLimit; - - function _nonIterableRest() { - throw new TypeError("Invalid attempt to destructure non-iterable instance"); - } + var classCallCheck = _classCallCheck; - var nonIterableRest = _nonIterableRest; + function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } - function _slicedToArray(arr, i) { - return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || nonIterableRest(); + return obj; } - var slicedToArray = _slicedToArray; + var defineProperty = _defineProperty; var bezierCurveToPolyline_1 = createCommonjsModule(function (module, exports) { @@ -7506,27 +8043,27 @@ abs = Math.abs; // Initialize the number of points per curve var defaultSegmentPointsNum = 50; - /** - * @example data structure of bezierCurve - * bezierCurve = [ - * // Starting point of the curve - * [10, 10], - * // BezierCurve segment data (controlPoint1, controlPoint2, endPoint) - * [ - * [20, 20], [40, 20], [50, 10] - * ], - * ... - * ] + /** + * @example data structure of bezierCurve + * bezierCurve = [ + * // Starting point of the curve + * [10, 10], + * // BezierCurve segment data (controlPoint1, controlPoint2, endPoint) + * [ + * [20, 20], [40, 20], [50, 10] + * ], + * ... + * ] */ - /** - * @description Abstract the curve as a polyline consisting of N points - * @param {Array} bezierCurve bezierCurve data - * @param {Number} precision calculation accuracy. Recommended for 1-20. Default = 5 - * @return {Object} Calculation results and related data - * @return {Array} Option.segmentPoints Point data that constitutes a polyline after calculation - * @return {Number} Option.cycles Number of iterations - * @return {Number} Option.rounds The number of recursions for the last iteration + /** + * @description Abstract the curve as a polyline consisting of N points + * @param {Array} bezierCurve bezierCurve data + * @param {Number} precision calculation accuracy. Recommended for 1-20. Default = 5 + * @return {Object} Calculation results and related data + * @return {Array} Option.segmentPoints Point data that constitutes a polyline after calculation + * @return {Number} Option.cycles Number of iterations + * @return {Number} Option.rounds The number of recursions for the last iteration */ function abstractBezierCurveToPolyline(bezierCurve) { @@ -7547,13 +8084,13 @@ result.segmentPoints.push(endPoint); return result; } - /** - * @description Generate a method for obtaining corresponding point by t according to curve data - * @param {Array} beginPoint BezierCurve begin point. [x, y] - * @param {Array} controlPoint1 BezierCurve controlPoint1. [x, y] - * @param {Array} controlPoint2 BezierCurve controlPoint2. [x, y] - * @param {Array} endPoint BezierCurve end point. [x, y] - * @return {Function} Expected function + /** + * @description Generate a method for obtaining corresponding point by t according to curve data + * @param {Array} beginPoint BezierCurve begin point. [x, y] + * @param {Array} controlPoint1 BezierCurve controlPoint1. [x, y] + * @param {Array} controlPoint2 BezierCurve controlPoint2. [x, y] + * @param {Array} endPoint BezierCurve end point. [x, y] + * @return {Function} Expected function */ @@ -7567,11 +8104,11 @@ return [beginPoint[0] * tSubed1Pow3 + 3 * controlPoint1[0] * t * tSubed1Pow2 + 3 * controlPoint2[0] * tPow2 * tSubed1 + endPoint[0] * tPow3, beginPoint[1] * tSubed1Pow3 + 3 * controlPoint1[1] * t * tSubed1Pow2 + 3 * controlPoint2[1] * tPow2 * tSubed1 + endPoint[1] * tPow3]; }; } - /** - * @description Get the distance between two points - * @param {Array} point1 BezierCurve begin point. [x, y] - * @param {Array} point2 BezierCurve controlPoint1. [x, y] - * @return {Number} Expected distance + /** + * @description Get the distance between two points + * @param {Array} point1 BezierCurve begin point. [x, y] + * @param {Array} point2 BezierCurve controlPoint1. [x, y] + * @return {Number} Expected distance */ @@ -7586,10 +8123,10 @@ return sqrt(pow(ax - bx, 2) + pow(ay - by, 2)); } - /** - * @description Get the sum of the array of numbers - * @param {Array} nums An array of numbers - * @return {Number} Expected sum + /** + * @description Get the sum of the array of numbers + * @param {Array} nums An array of numbers + * @return {Number} Expected sum */ @@ -7598,10 +8135,10 @@ return sum + num; }, 0); } - /** - * @description Get the distance of multiple sets of points - * @param {Array} segmentPoints Multiple sets of point data - * @return {Array} Distance of multiple sets of point data + /** + * @description Get the distance of multiple sets of points + * @param {Array} segmentPoints Multiple sets of point data + * @return {Array} Distance of multiple sets of point data */ @@ -7612,10 +8149,10 @@ }); }); } - /** - * @description Get the distance of multiple sets of points - * @param {Array} segmentPoints Multiple sets of point data - * @return {Array} Distance of multiple sets of point data + /** + * @description Get the distance of multiple sets of points + * @param {Array} segmentPoints Multiple sets of point data + * @return {Array} Distance of multiple sets of point data */ @@ -7627,11 +8164,11 @@ }); }); } - /** - * @description Get the sum of deviations between line segment and the average length - * @param {Array} segmentPointsDistance Segment length of polyline - * @param {Number} avgLength Average length of the line segment - * @return {Number} Deviations + /** + * @description Get the sum of deviations between line segment and the average length + * @param {Array} segmentPointsDistance Segment length of polyline + * @param {Number} avgLength Average length of the line segment + * @return {Number} Deviations */ @@ -7646,16 +8183,16 @@ return total + v; }, 0); } - /** - * @description Calculate uniformly distributed points by iteratively - * @param {Array} segmentPoints Multiple setd of points that make up a polyline - * @param {Array} getSegmentTPointFuns Functions of get a point on the curve with t - * @param {Array} segments BezierCurve data - * @param {Number} precision Calculation accuracy - * @return {Object} Calculation results and related data - * @return {Array} Option.segmentPoints Point data that constitutes a polyline after calculation - * @return {Number} Option.cycles Number of iterations - * @return {Number} Option.rounds The number of recursions for the last iteration + /** + * @description Calculate uniformly distributed points by iteratively + * @param {Array} segmentPoints Multiple setd of points that make up a polyline + * @param {Array} getSegmentTPointFuns Functions of get a point on the curve with t + * @param {Array} segments BezierCurve data + * @param {Number} precision Calculation accuracy + * @return {Object} Calculation results and related data + * @return {Array} Option.segmentPoints Point data that constitutes a polyline after calculation + * @return {Number} Option.cycles Number of iterations + * @return {Number} Option.rounds The number of recursions for the last iteration */ @@ -7752,11 +8289,11 @@ rounds: rounds }; } - /** - * @description Get the polyline corresponding to the Bezier curve - * @param {Array} bezierCurve BezierCurve data - * @param {Number} precision Calculation accuracy. Recommended for 1-20. Default = 5 - * @return {Array|Boolean} Point data that constitutes a polyline after calculation (Invalid input will return false) + /** + * @description Get the polyline corresponding to the Bezier curve + * @param {Array} bezierCurve BezierCurve data + * @param {Number} precision Calculation accuracy. Recommended for 1-20. Default = 5 + * @return {Array|Boolean} Point data that constitutes a polyline after calculation (Invalid input will return false) */ @@ -7783,11 +8320,11 @@ return segmentPoints; } - /** - * @description Get the bezier curve length - * @param {Array} bezierCurve bezierCurve data - * @param {Number} precision calculation accuracy. Recommended for 5-10. Default = 5 - * @return {Number|Boolean} BezierCurve length (Invalid input will return false) + /** + * @description Get the bezier curve length + * @param {Array} bezierCurve bezierCurve data + * @param {Number} precision calculation accuracy. Recommended for 5-10. Default = 5 + * @return {Number|Boolean} BezierCurve length (Invalid input will return false) */ @@ -7839,13 +8376,13 @@ var _toConsumableArray2 = interopRequireDefault(toConsumableArray); - /** - * @description Abstract the polyline formed by N points into a set of bezier curve - * @param {Array} polyline A set of points that make up a polyline - * @param {Boolean} close Closed curve - * @param {Number} offsetA Smoothness - * @param {Number} offsetB Smoothness - * @return {Array|Boolean} A set of bezier curve (Invalid input will return false) + /** + * @description Abstract the polyline formed by N points into a set of bezier curve + * @param {Array} polyline A set of points that make up a polyline + * @param {Boolean} close Closed curve + * @param {Number} offsetA Smoothness + * @param {Number} offsetB Smoothness + * @return {Array|Boolean} A set of bezier curve (Invalid input will return false) */ function polylineToBezierCurve(polyline) { var close = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; @@ -7871,14 +8408,14 @@ bezierCurvePoints.unshift(polyline[0]); return bezierCurvePoints; } - /** - * @description Get the control points of the Bezier curve - * @param {Array} polyline A set of points that make up a polyline - * @param {Number} index The index of which get controls points's point in polyline - * @param {Boolean} close Closed curve - * @param {Number} offsetA Smoothness - * @param {Number} offsetB Smoothness - * @return {Array} Control points + /** + * @description Get the control points of the Bezier curve + * @param {Array} polyline A set of points that make up a polyline + * @param {Number} index The index of which get controls points's point in polyline + * @param {Boolean} close Closed curve + * @param {Number} offsetA Smoothness + * @param {Number} offsetB Smoothness + * @return {Array} Control points */ @@ -7900,11 +8437,11 @@ var pointAfterNext = polyline[afterNextPointIndex]; return [[pointMiddle[0] + offsetA * (pointAfter[0] - pointBefore[0]), pointMiddle[1] + offsetA * (pointAfter[1] - pointBefore[1])], [pointAfter[0] - offsetB * (pointAfterNext[0] - pointMiddle[0]), pointAfter[1] - offsetB * (pointAfterNext[1] - pointMiddle[1])]]; } - /** - * @description Get the last curve of the closure - * @param {Array} bezierCurve A set of sub-curve - * @param {Array} startPoint Start point - * @return {Array} The last curve for closure + /** + * @description Get the last curve of the closure + * @param {Array} bezierCurve A set of sub-curve + * @param {Array} startPoint Start point + * @return {Array} The last curve for closure */ @@ -7914,505 +8451,95 @@ bezierCurve.push([getSymmetryPoint(lastSubCurve[1], lastSubCurve[2]), getSymmetryPoint(firstSubCurve[0], startPoint), startPoint]); return bezierCurve; } - /** - * @description Get the symmetry point - * @param {Array} point Symmetric point - * @param {Array} centerPoint Symmetric center - * @return {Array} Symmetric point - */ - - - function getSymmetryPoint(point, centerPoint) { - var _point = (0, _slicedToArray2["default"])(point, 2), - px = _point[0], - py = _point[1]; - - var _centerPoint = (0, _slicedToArray2["default"])(centerPoint, 2), - cx = _centerPoint[0], - cy = _centerPoint[1]; - - var minusX = cx - px; - var minusY = cy - py; - return [cx + minusX, cy + minusY]; - } - - var _default = polylineToBezierCurve; - exports["default"] = _default; - }); - - unwrapExports(polylineToBezierCurve_1); - - var lib$1 = createCommonjsModule(function (module, exports) { - - - - Object.defineProperty(exports, "__esModule", { - value: true - }); - Object.defineProperty(exports, "bezierCurveToPolyline", { - enumerable: true, - get: function get() { - return bezierCurveToPolyline_1.bezierCurveToPolyline; - } - }); - Object.defineProperty(exports, "getBezierCurveLength", { - enumerable: true, - get: function get() { - return bezierCurveToPolyline_1.getBezierCurveLength; - } - }); - Object.defineProperty(exports, "polylineToBezierCurve", { - enumerable: true, - get: function get() { - return _polylineToBezierCurve["default"]; - } - }); - exports["default"] = void 0; - - - - var _polylineToBezierCurve = interopRequireDefault(polylineToBezierCurve_1); - - var _default = { - bezierCurveToPolyline: bezierCurveToPolyline_1.bezierCurveToPolyline, - getBezierCurveLength: bezierCurveToPolyline_1.getBezierCurveLength, - polylineToBezierCurve: _polylineToBezierCurve["default"] - }; - exports["default"] = _default; - }); - - unwrapExports(lib$1); - - var _validateCollection = function (it, TYPE) { - if (!_isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!'); - return it; - }; - - var dP$3 = _objectDp.f; - - - - - - - - - - var fastKey = _meta.fastKey; - - var SIZE = _descriptors ? '_s' : 'size'; - - var getEntry = function (that, key) { - // fast case - var index = fastKey(key); - var entry; - if (index !== 'F') return that._i[index]; - // frozen object case - for (entry = that._f; entry; entry = entry.n) { - if (entry.k == key) return entry; - } - }; - - var _collectionStrong = { - getConstructor: function (wrapper, NAME, IS_MAP, ADDER) { - var C = wrapper(function (that, iterable) { - _anInstance(that, C, NAME, '_i'); - that._t = NAME; // collection type - that._i = _objectCreate(null); // index - that._f = undefined; // first entry - that._l = undefined; // last entry - that[SIZE] = 0; // size - if (iterable != undefined) _forOf(iterable, IS_MAP, that[ADDER], that); - }); - _redefineAll(C.prototype, { - // 23.1.3.1 Map.prototype.clear() - // 23.2.3.2 Set.prototype.clear() - clear: function clear() { - for (var that = _validateCollection(this, NAME), data = that._i, entry = that._f; entry; entry = entry.n) { - entry.r = true; - if (entry.p) entry.p = entry.p.n = undefined; - delete data[entry.i]; - } - that._f = that._l = undefined; - that[SIZE] = 0; - }, - // 23.1.3.3 Map.prototype.delete(key) - // 23.2.3.4 Set.prototype.delete(value) - 'delete': function (key) { - var that = _validateCollection(this, NAME); - var entry = getEntry(that, key); - if (entry) { - var next = entry.n; - var prev = entry.p; - delete that._i[entry.i]; - entry.r = true; - if (prev) prev.n = next; - if (next) next.p = prev; - if (that._f == entry) that._f = next; - if (that._l == entry) that._l = prev; - that[SIZE]--; - } return !!entry; - }, - // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined) - // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined) - forEach: function forEach(callbackfn /* , that = undefined */) { - _validateCollection(this, NAME); - var f = _ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); - var entry; - while (entry = entry ? entry.n : this._f) { - f(entry.v, entry.k, this); - // revert to the last existing entry - while (entry && entry.r) entry = entry.p; - } - }, - // 23.1.3.7 Map.prototype.has(key) - // 23.2.3.7 Set.prototype.has(value) - has: function has(key) { - return !!getEntry(_validateCollection(this, NAME), key); - } - }); - if (_descriptors) dP$3(C.prototype, 'size', { - get: function () { - return _validateCollection(this, NAME)[SIZE]; - } - }); - return C; - }, - def: function (that, key, value) { - var entry = getEntry(that, key); - var prev, index; - // change existing entry - if (entry) { - entry.v = value; - // create new entry - } else { - that._l = entry = { - i: index = fastKey(key, true), // <- index - k: key, // <- key - v: value, // <- value - p: prev = that._l, // <- previous entry - n: undefined, // <- next entry - r: false // <- removed - }; - if (!that._f) that._f = entry; - if (prev) prev.n = entry; - that[SIZE]++; - // add to index - if (index !== 'F') that._i[index] = entry; - } return that; - }, - getEntry: getEntry, - setStrong: function (C, NAME, IS_MAP) { - // add .keys, .values, .entries, [@@iterator] - // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11 - _iterDefine(C, NAME, function (iterated, kind) { - this._t = _validateCollection(iterated, NAME); // target - this._k = kind; // kind - this._l = undefined; // previous - }, function () { - var that = this; - var kind = that._k; - var entry = that._l; - // revert to the last existing entry - while (entry && entry.r) entry = entry.p; - // get next entry - if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) { - // or finish the iteration - that._t = undefined; - return _iterStep(1); - } - // return step by kind - if (kind == 'keys') return _iterStep(0, entry.k); - if (kind == 'values') return _iterStep(0, entry.v); - return _iterStep(0, [entry.k, entry.v]); - }, IS_MAP ? 'entries' : 'values', !IS_MAP, true); - - // add [@@species], 23.1.2.2, 23.2.2.2 - _setSpecies(NAME); - } - }; - - // Works with __proto__ only. Old v8 can't work with null proto objects. - /* eslint-disable no-proto */ - - - var check = function (O, proto) { - _anObject(O); - if (!_isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!"); - }; - var _setProto = { - set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line - function (test, buggy, set) { - try { - set = _ctx(Function.call, _objectGopd.f(Object.prototype, '__proto__').set, 2); - set(test, []); - buggy = !(test instanceof Array); - } catch (e) { buggy = true; } - return function setPrototypeOf(O, proto) { - check(O, proto); - if (buggy) O.__proto__ = proto; - else set(O, proto); - return O; - }; - }({}, false) : undefined), - check: check - }; - - var setPrototypeOf = _setProto.set; - var _inheritIfRequired = function (that, target, C) { - var S = target.constructor; - var P; - if (S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && _isObject(P) && setPrototypeOf) { - setPrototypeOf(that, P); - } return that; - }; - - var _collection = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) { - var Base = _global[NAME]; - var C = Base; - var ADDER = IS_MAP ? 'set' : 'add'; - var proto = C && C.prototype; - var O = {}; - var fixMethod = function (KEY) { - var fn = proto[KEY]; - _redefine(proto, KEY, - KEY == 'delete' ? function (a) { - return IS_WEAK && !_isObject(a) ? false : fn.call(this, a === 0 ? 0 : a); - } : KEY == 'has' ? function has(a) { - return IS_WEAK && !_isObject(a) ? false : fn.call(this, a === 0 ? 0 : a); - } : KEY == 'get' ? function get(a) { - return IS_WEAK && !_isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a); - } : KEY == 'add' ? function add(a) { fn.call(this, a === 0 ? 0 : a); return this; } - : function set(a, b) { fn.call(this, a === 0 ? 0 : a, b); return this; } - ); - }; - if (typeof C != 'function' || !(IS_WEAK || proto.forEach && !_fails(function () { - new C().entries().next(); - }))) { - // create collection constructor - C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER); - _redefineAll(C.prototype, methods); - _meta.NEED = true; - } else { - var instance = new C(); - // early implementations not supports chaining - var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance; - // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false - var THROWS_ON_PRIMITIVES = _fails(function () { instance.has(1); }); - // most early implementations doesn't supports iterables, most modern - not close it correctly - var ACCEPT_ITERABLES = _iterDetect(function (iter) { new C(iter); }); // eslint-disable-line no-new - // for early implementations -0 and +0 not the same - var BUGGY_ZERO = !IS_WEAK && _fails(function () { - // V8 ~ Chromium 42- fails only with 5+ elements - var $instance = new C(); - var index = 5; - while (index--) $instance[ADDER](index, index); - return !$instance.has(-0); - }); - if (!ACCEPT_ITERABLES) { - C = wrapper(function (target, iterable) { - _anInstance(target, C, NAME); - var that = _inheritIfRequired(new Base(), target, C); - if (iterable != undefined) _forOf(iterable, IS_MAP, that[ADDER], that); - return that; - }); - C.prototype = proto; - proto.constructor = C; - } - if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) { - fixMethod('delete'); - fixMethod('has'); - IS_MAP && fixMethod('get'); - } - if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER); - // weak collections should not contains .clear method - if (IS_WEAK && proto.clear) delete proto.clear; - } - - _setToStringTag(C, NAME); - - O[NAME] = C; - _export(_export.G + _export.W + _export.F * (C != Base), O); - - if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP); - - return C; - }; - - var MAP = 'Map'; - - // 23.1 Map Objects - var es6_map = _collection(MAP, function (get) { - return function Map() { return get(this, arguments.length > 0 ? arguments[0] : undefined); }; - }, { - // 23.1.3.6 Map.prototype.get(key) - get: function get(key) { - var entry = _collectionStrong.getEntry(_validateCollection(this, MAP), key); - return entry && entry.v; - }, - // 23.1.3.9 Map.prototype.set(key, value) - set: function set(key, value) { - return _collectionStrong.def(_validateCollection(this, MAP), key === 0 ? 0 : key, value); - } - }, _collectionStrong, true); - - var max$1 = Math.max; - var min$2 = Math.min; - var floor$1 = Math.floor; - var SUBSTITUTION_SYMBOLS = /\$([$&`']|\d\d?|<[^>]*>)/g; - var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&`']|\d\d?)/g; - - var maybeToString = function (it) { - return it === undefined ? it : String(it); - }; - - // @@replace logic - _fixReWks('replace', 2, function (defined, REPLACE, $replace, maybeCallNative) { - return [ - // `String.prototype.replace` method - // https://tc39.github.io/ecma262/#sec-string.prototype.replace - function replace(searchValue, replaceValue) { - var O = defined(this); - var fn = searchValue == undefined ? undefined : searchValue[REPLACE]; - return fn !== undefined - ? fn.call(searchValue, O, replaceValue) - : $replace.call(String(O), searchValue, replaceValue); - }, - // `RegExp.prototype[@@replace]` method - // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace - function (regexp, replaceValue) { - var res = maybeCallNative($replace, regexp, this, replaceValue); - if (res.done) return res.value; - - var rx = _anObject(regexp); - var S = String(this); - var functionalReplace = typeof replaceValue === 'function'; - if (!functionalReplace) replaceValue = String(replaceValue); - var global = rx.global; - if (global) { - var fullUnicode = rx.unicode; - rx.lastIndex = 0; - } - var results = []; - while (true) { - var result = _regexpExecAbstract(rx, S); - if (result === null) break; - results.push(result); - if (!global) break; - var matchStr = String(result[0]); - if (matchStr === '') rx.lastIndex = _advanceStringIndex(S, _toLength(rx.lastIndex), fullUnicode); - } - var accumulatedResult = ''; - var nextSourcePosition = 0; - for (var i = 0; i < results.length; i++) { - result = results[i]; - var matched = String(result[0]); - var position = max$1(min$2(_toInteger(result.index), S.length), 0); - var captures = []; - // NOTE: This is equivalent to - // captures = result.slice(1).map(maybeToString) - // but for some reason `nativeSlice.call(result, 1, result.length)` (called in - // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and - // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it. - for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j])); - var namedCaptures = result.groups; - if (functionalReplace) { - var replacerArgs = [matched].concat(captures, position, S); - if (namedCaptures !== undefined) replacerArgs.push(namedCaptures); - var replacement = String(replaceValue.apply(undefined, replacerArgs)); - } else { - replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue); - } - if (position >= nextSourcePosition) { - accumulatedResult += S.slice(nextSourcePosition, position) + replacement; - nextSourcePosition = position + matched.length; - } - } - return accumulatedResult + S.slice(nextSourcePosition); - } - ]; - - // https://tc39.github.io/ecma262/#sec-getsubstitution - function getSubstitution(matched, str, position, captures, namedCaptures, replacement) { - var tailPos = position + matched.length; - var m = captures.length; - var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED; - if (namedCaptures !== undefined) { - namedCaptures = _toObject(namedCaptures); - symbols = SUBSTITUTION_SYMBOLS; - } - return $replace.call(replacement, symbols, function (match, ch) { - var capture; - switch (ch.charAt(0)) { - case '$': return '$'; - case '&': return matched; - case '`': return str.slice(0, position); - case "'": return str.slice(tailPos); - case '<': - capture = namedCaptures[ch.slice(1, -1)]; - break; - default: // \d\d? - var n = +ch; - if (n === 0) return match; - if (n > m) { - var f = floor$1(n / 10); - if (f === 0) return match; - if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1); - return match; - } - capture = captures[n - 1]; - } - return capture === undefined ? '' : capture; - }); - } - }); - - var canvas = createCommonjsModule(function (module, exports) { - - - - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.drawPolylinePath = drawPolylinePath; - exports.drawBezierCurvePath = drawBezierCurvePath; - exports["default"] = void 0; - - - - + /** + * @description Get the symmetry point + * @param {Array} point Symmetric point + * @param {Array} centerPoint Symmetric center + * @return {Array} Symmetric point + */ + function getSymmetryPoint(point, centerPoint) { + var _point = (0, _slicedToArray2["default"])(point, 2), + px = _point[0], + py = _point[1]; + var _centerPoint = (0, _slicedToArray2["default"])(centerPoint, 2), + cx = _centerPoint[0], + cy = _centerPoint[1]; + var minusX = cx - px; + var minusY = cy - py; + return [cx + minusX, cy + minusY]; + } + var _default = polylineToBezierCurve; + exports["default"] = _default; + }); + unwrapExports(polylineToBezierCurve_1); + var lib$1 = createCommonjsModule(function (module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.defineProperty(exports, "bezierCurveToPolyline", { + enumerable: true, + get: function get() { + return bezierCurveToPolyline_1.bezierCurveToPolyline; + } + }); + Object.defineProperty(exports, "getBezierCurveLength", { + enumerable: true, + get: function get() { + return bezierCurveToPolyline_1.getBezierCurveLength; + } + }); + Object.defineProperty(exports, "polylineToBezierCurve", { + enumerable: true, + get: function get() { + return _polylineToBezierCurve["default"]; + } + }); + exports["default"] = void 0; + var _polylineToBezierCurve = interopRequireDefault(polylineToBezierCurve_1); + var _default = { + bezierCurveToPolyline: bezierCurveToPolyline_1.bezierCurveToPolyline, + getBezierCurveLength: bezierCurveToPolyline_1.getBezierCurveLength, + polylineToBezierCurve: _polylineToBezierCurve["default"] + }; + exports["default"] = _default; + }); + unwrapExports(lib$1); + var canvas = createCommonjsModule(function (module, exports) { - function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } - function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } - function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.drawPolylinePath = drawPolylinePath; + exports.drawBezierCurvePath = drawBezierCurvePath; + exports["default"] = void 0; - function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } + var _toConsumableArray2 = interopRequireDefault(toConsumableArray); - /** - * @description Draw a polyline path - * @param {Object} ctx Canvas 2d context - * @param {Array} points The points that makes up a polyline - * @param {Boolean} beginPath Whether to execute beginPath - * @param {Boolean} closePath Whether to execute closePath - * @return {Undefined} Void + /** + * @description Draw a polyline path + * @param {Object} ctx Canvas 2d context + * @param {Array} points The points that makes up a polyline + * @param {Boolean} beginPath Whether to execute beginPath + * @param {Boolean} closePath Whether to execute closePath + * @return {Undefined} Void */ function drawPolylinePath(ctx, points) { var beginPath = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; @@ -8420,18 +8547,18 @@ if (!ctx || points.length < 2) return false; if (beginPath) ctx.beginPath(); points.forEach(function (point, i) { - return point && (i === 0 ? ctx.moveTo.apply(ctx, _toConsumableArray(point)) : ctx.lineTo.apply(ctx, _toConsumableArray(point))); + return point && (i === 0 ? ctx.moveTo.apply(ctx, (0, _toConsumableArray2["default"])(point)) : ctx.lineTo.apply(ctx, (0, _toConsumableArray2["default"])(point))); }); if (closePath) ctx.closePath(); } - /** - * @description Draw a bezier curve path - * @param {Object} ctx Canvas 2d context - * @param {Array} points The points that makes up a bezier curve - * @param {Array} moveTo The point need to excute moveTo - * @param {Boolean} beginPath Whether to execute beginPath - * @param {Boolean} closePath Whether to execute closePath - * @return {Undefined} Void + /** + * @description Draw a bezier curve path + * @param {Object} ctx Canvas 2d context + * @param {Array} points The points that makes up a bezier curve + * @param {Array} moveTo The point need to excute moveTo + * @param {Boolean} beginPath Whether to execute beginPath + * @param {Boolean} closePath Whether to execute closePath + * @return {Undefined} Void */ @@ -8441,9 +8568,9 @@ var closePath = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; if (!ctx || !points) return false; if (beginPath) ctx.beginPath(); - if (moveTo) ctx.moveTo.apply(ctx, _toConsumableArray(moveTo)); + if (moveTo) ctx.moveTo.apply(ctx, (0, _toConsumableArray2["default"])(moveTo)); points.forEach(function (item) { - return item && ctx.bezierCurveTo.apply(ctx, _toConsumableArray(item[0]).concat(_toConsumableArray(item[1]), _toConsumableArray(item[2]))); + return item && ctx.bezierCurveTo.apply(ctx, (0, _toConsumableArray2["default"])(item[0]).concat((0, _toConsumableArray2["default"])(item[1]), (0, _toConsumableArray2["default"])(item[2]))); }); if (closePath) ctx.closePath(); } @@ -8469,66 +8596,16 @@ exports.extendNewGraph = extendNewGraph; exports["default"] = exports.text = exports.bezierCurve = exports.smoothline = exports.polyline = exports.regPolygon = exports.sector = exports.arc = exports.ring = exports.rect = exports.ellipse = exports.circle = void 0; + var _toConsumableArray2 = interopRequireDefault(toConsumableArray); + var _slicedToArray2 = interopRequireDefault(slicedToArray); + var _bezierCurve2 = interopRequireDefault(lib$1); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - var _bezierCurve2 = _interopRequireDefault(lib$1); - - - - - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - - function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } - - function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } - - function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } - - function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } - - function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } - - function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } - - function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } - - function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } - var polylineToBezierCurve = _bezierCurve2["default"].polylineToBezierCurve, bezierCurveToPolyline = _bezierCurve2["default"].bezierCurveToPolyline; var circle = { @@ -8993,7 +9070,7 @@ ry: ry + movementY }); cache.points = cache.points.map(function (_ref50) { - var _ref51 = _slicedToArray(_ref50, 2), + var _ref51 = (0, _slicedToArray2["default"])(_ref50, 2), x = _ref51[0], y = _ref51[1]; @@ -9061,7 +9138,7 @@ var shape = _ref58.shape; var points = shape.points; var moveAfterPoints = points.map(function (_ref59) { - var _ref60 = _slicedToArray(_ref59, 2), + var _ref60 = (0, _slicedToArray2["default"])(_ref59, 2), x = _ref60[0], y = _ref60[1]; @@ -9146,7 +9223,7 @@ cache = _ref67.cache; var points = shape.points; var moveAfterPoints = points.map(function (_ref68) { - var _ref69 = _slicedToArray(_ref68, 2), + var _ref69 = (0, _slicedToArray2["default"])(_ref68, 2), x = _ref69[0], y = _ref69[1]; @@ -9154,14 +9231,14 @@ }); cache.points = moveAfterPoints; - var _cache$bezierCurve$ = _slicedToArray(cache.bezierCurve[0], 2), + var _cache$bezierCurve$ = (0, _slicedToArray2["default"])(cache.bezierCurve[0], 2), fx = _cache$bezierCurve$[0], fy = _cache$bezierCurve$[1]; var curves = cache.bezierCurve.slice(1); - cache.bezierCurve = [[fx + movementX, fy + movementY]].concat(_toConsumableArray(curves.map(function (curve) { + cache.bezierCurve = [[fx + movementX, fy + movementY]].concat((0, _toConsumableArray2["default"])(curves.map(function (curve) { return curve.map(function (_ref70) { - var _ref71 = _slicedToArray(_ref70, 2), + var _ref71 = (0, _slicedToArray2["default"])(_ref70, 2), x = _ref71[0], y = _ref71[1]; @@ -9169,7 +9246,7 @@ }); }))); cache.hoverPoints = cache.hoverPoints.map(function (_ref72) { - var _ref73 = _slicedToArray(_ref72, 2), + var _ref73 = (0, _slicedToArray2["default"])(_ref72, 2), x = _ref73[0], y = _ref73[1]; @@ -9250,14 +9327,14 @@ cache = _ref80.cache; var points = shape.points; - var _points$ = _slicedToArray(points[0], 2), + var _points$ = (0, _slicedToArray2["default"])(points[0], 2), fx = _points$[0], fy = _points$[1]; var curves = points.slice(1); - var bezierCurve = [[fx + movementX, fy + movementY]].concat(_toConsumableArray(curves.map(function (curve) { + var bezierCurve = [[fx + movementX, fy + movementY]].concat((0, _toConsumableArray2["default"])(curves.map(function (curve) { return curve.map(function (_ref81) { - var _ref82 = _slicedToArray(_ref81, 2), + var _ref82 = (0, _slicedToArray2["default"])(_ref81, 2), x = _ref82[0], y = _ref82[1]; @@ -9266,7 +9343,7 @@ }))); cache.points = bezierCurve; cache.hoverPoints = cache.hoverPoints.map(function (_ref83) { - var _ref84 = _slicedToArray(_ref83, 2), + var _ref84 = (0, _slicedToArray2["default"])(_ref83, 2), x = _ref84[0], y = _ref84[1]; @@ -9320,7 +9397,7 @@ var fontSize = parseInt(font.replace(/\D/g, '')); var _position = position, - _position2 = _slicedToArray(_position, 2), + _position2 = (0, _slicedToArray2["default"])(_position, 2), x = _position2[0], y = _position2[1]; @@ -9345,8 +9422,8 @@ }); ctx.beginPath(); content.forEach(function (text, i) { - ctx.fillText.apply(ctx, [text].concat(_toConsumableArray(position[i]), [maxWidth])); - ctx.strokeText.apply(ctx, [text].concat(_toConsumableArray(position[i]), [maxWidth])); + ctx.fillText.apply(ctx, [text].concat((0, _toConsumableArray2["default"])(position[i]), [maxWidth])); + ctx.strokeText.apply(ctx, [text].concat((0, _toConsumableArray2["default"])(position[i]), [maxWidth])); }); ctx.closePath(); }, @@ -9359,14 +9436,14 @@ var shape = _ref89.shape, style = _ref89.style; var position = shape.position; - style.graphCenter = _toConsumableArray(position); + style.graphCenter = (0, _toConsumableArray2["default"])(position); }, move: function move(_ref90, _ref91) { var movementX = _ref90.movementX, movementY = _ref90.movementY; var shape = _ref91.shape; - var _shape$position = _slicedToArray(shape.position, 2), + var _shape$position = (0, _slicedToArray2["default"])(shape.position, 2), x = _shape$position[0], y = _shape$position[1]; @@ -9378,11 +9455,11 @@ exports.text = text; var graphs = new Map([['circle', circle], ['ellipse', ellipse], ['rect', rect], ['ring', ring], ['arc', arc], ['sector', sector], ['regPolygon', regPolygon], ['polyline', polyline], ['smoothline', smoothline], ['bezierCurve', bezierCurve], ['text', text]]); var _default = graphs; - /** - * @description Extend new graph - * @param {String} name Name of Graph - * @param {Object} config Configuration of Graph - * @return {Undefined} Void + /** + * @description Extend new graph + * @param {String} name Name of Graph + * @param {Object} config Configuration of Graph + * @return {Undefined} Void */ exports["default"] = _default; @@ -9558,7 +9635,7 @@ return { __await: arg }; }; - function AsyncIterator(generator) { + function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if (record.type === "throw") { @@ -9569,14 +9646,14 @@ if (value && typeof value === "object" && hasOwn.call(value, "__await")) { - return Promise.resolve(value.__await).then(function(value) { + return PromiseImpl.resolve(value.__await).then(function(value) { invoke("next", value, resolve, reject); }, function(err) { invoke("throw", err, resolve, reject); }); } - return Promise.resolve(value).then(function(unwrapped) { + return PromiseImpl.resolve(value).then(function(unwrapped) { // When a yielded Promise is resolved, its final value becomes // the .value of the Promise<{value,done}> result for the // current iteration. @@ -9594,7 +9671,7 @@ function enqueue(method, arg) { function callInvokeWithMethodAndArg() { - return new Promise(function(resolve, reject) { + return new PromiseImpl(function(resolve, reject) { invoke(method, arg, resolve, reject); }); } @@ -9634,9 +9711,12 @@ // Note that simple async functions are implemented on top of // AsyncIterator objects; they just return a Promise for the value of // the final result produced by the iterator. - exports.async = function(innerFn, outerFn, self, tryLocsList) { + exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) { + if (PromiseImpl === void 0) PromiseImpl = Promise; + var iter = new AsyncIterator( - wrap(innerFn, outerFn, self, tryLocsList) + wrap(innerFn, outerFn, self, tryLocsList), + PromiseImpl ); return exports.isGeneratorFunction(outerFn) @@ -10154,319 +10234,311 @@ } }); - var style_class = createCommonjsModule(function (module, exports) { - - - - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports["default"] = void 0; - - - - - - - - - - - - - - - - - - - - - - - - - - + var regenerator = runtime_1; + function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { + try { + var info = gen[key](arg); + var value = info.value; + } catch (error) { + reject(error); + return; + } + if (info.done) { + resolve(value); + } else { + Promise.resolve(value).then(_next, _throw); + } + } + function _asyncToGenerator(fn) { + return function () { + var self = this, + args = arguments; + return new Promise(function (resolve, reject) { + var gen = fn.apply(self, args); + function _next(value) { + asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); + } + function _throw(err) { + asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); + } + _next(undefined); + }); + }; + } + var asyncToGenerator = _asyncToGenerator; + var style_class = createCommonjsModule(function (module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports["default"] = void 0; + var _toConsumableArray2 = interopRequireDefault(toConsumableArray); - function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } + var _classCallCheck2 = interopRequireDefault(classCallCheck); - function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } - function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } - function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - /** - * @description Class Style - * @param {Object} style Style configuration - * @return {Style} Instance of Style + /** + * @description Class Style + * @param {Object} style Style configuration + * @return {Style} Instance of Style */ var Style = function Style(style) { - _classCallCheck(this, Style); - + (0, _classCallCheck2["default"])(this, Style); this.colorProcessor(style); var defaultStyle = { - /** - * @description Rgba value of graph fill color - * @type {Array} - * @default fill = [0, 0, 0, 1] + /** + * @description Rgba value of graph fill color + * @type {Array} + * @default fill = [0, 0, 0, 1] */ fill: [0, 0, 0, 1], - /** - * @description Rgba value of graph stroke color - * @type {Array} - * @default stroke = [0, 0, 0, 1] + /** + * @description Rgba value of graph stroke color + * @type {Array} + * @default stroke = [0, 0, 0, 1] */ stroke: [0, 0, 0, 0], - /** - * @description Opacity of graph - * @type {Number} - * @default opacity = 1 + /** + * @description Opacity of graph + * @type {Number} + * @default opacity = 1 */ opacity: 1, - /** - * @description LineCap of Ctx - * @type {String} - * @default lineCap = null - * @example lineCap = 'butt'|'round'|'square' + /** + * @description LineCap of Ctx + * @type {String} + * @default lineCap = null + * @example lineCap = 'butt'|'round'|'square' */ lineCap: null, - /** - * @description Linejoin of Ctx - * @type {String} - * @default lineJoin = null - * @example lineJoin = 'round'|'bevel'|'miter' + /** + * @description Linejoin of Ctx + * @type {String} + * @default lineJoin = null + * @example lineJoin = 'round'|'bevel'|'miter' */ lineJoin: null, - /** - * @description LineDash of Ctx - * @type {Array} - * @default lineDash = null - * @example lineDash = [10, 10] + /** + * @description LineDash of Ctx + * @type {Array} + * @default lineDash = null + * @example lineDash = [10, 10] */ lineDash: null, - /** - * @description LineDashOffset of Ctx - * @type {Number} - * @default lineDashOffset = null - * @example lineDashOffset = 10 + /** + * @description LineDashOffset of Ctx + * @type {Number} + * @default lineDashOffset = null + * @example lineDashOffset = 10 */ lineDashOffset: null, - /** - * @description ShadowBlur of Ctx - * @type {Number} - * @default shadowBlur = 0 + /** + * @description ShadowBlur of Ctx + * @type {Number} + * @default shadowBlur = 0 */ shadowBlur: 0, - /** - * @description Rgba value of graph shadow color - * @type {Array} - * @default shadowColor = [0, 0, 0, 0] + /** + * @description Rgba value of graph shadow color + * @type {Array} + * @default shadowColor = [0, 0, 0, 0] */ shadowColor: [0, 0, 0, 0], - /** - * @description ShadowOffsetX of Ctx - * @type {Number} - * @default shadowOffsetX = 0 + /** + * @description ShadowOffsetX of Ctx + * @type {Number} + * @default shadowOffsetX = 0 */ shadowOffsetX: 0, - /** - * @description ShadowOffsetY of Ctx - * @type {Number} - * @default shadowOffsetY = 0 + /** + * @description ShadowOffsetY of Ctx + * @type {Number} + * @default shadowOffsetY = 0 */ shadowOffsetY: 0, - /** - * @description LineWidth of Ctx - * @type {Number} - * @default lineWidth = 0 + /** + * @description LineWidth of Ctx + * @type {Number} + * @default lineWidth = 0 */ lineWidth: 0, - /** - * @description Stroke width is not scaled - * @type {Boolean} - * @default strokeNoScale = false - */ - strokeNoScale: false, - - /** - * @description Center point of the graph - * @type {Array} - * @default graphCenter = null - * @example graphCenter = [10, 10] + /** + * @description Center point of the graph + * @type {Array} + * @default graphCenter = null + * @example graphCenter = [10, 10] */ graphCenter: null, - /** - * @description Graph scale - * @type {Array} - * @default scale = null - * @example scale = [1.5, 1.5] + /** + * @description Graph scale + * @type {Array} + * @default scale = null + * @example scale = [1.5, 1.5] */ scale: null, - /** - * @description Graph rotation degree - * @type {Number} - * @default rotate = null - * @example rotate = 10 + /** + * @description Graph rotation degree + * @type {Number} + * @default rotate = null + * @example rotate = 10 */ rotate: null, - /** - * @description Graph translate distance - * @type {Array} - * @default translate = null - * @example translate = [10, 10] + /** + * @description Graph translate distance + * @type {Array} + * @default translate = null + * @example translate = [10, 10] */ translate: null, - /** - * @description Cursor status when hover - * @type {String} - * @default hoverCursor = 'pointer' - * @example hoverCursor = 'default'|'pointer'|'auto'|'crosshair'|'move'|'wait'|... + /** + * @description Cursor status when hover + * @type {String} + * @default hoverCursor = 'pointer' + * @example hoverCursor = 'default'|'pointer'|'auto'|'crosshair'|'move'|'wait'|... */ hoverCursor: 'pointer', - /** - * @description Font style of Ctx - * @type {String} - * @default fontStyle = 'normal' - * @example fontStyle = 'normal'|'italic'|'oblique' + /** + * @description Font style of Ctx + * @type {String} + * @default fontStyle = 'normal' + * @example fontStyle = 'normal'|'italic'|'oblique' */ fontStyle: 'normal', - /** - * @description Font varient of Ctx - * @type {String} - * @default fontVarient = 'normal' - * @example fontVarient = 'normal'|'small-caps' + /** + * @description Font varient of Ctx + * @type {String} + * @default fontVarient = 'normal' + * @example fontVarient = 'normal'|'small-caps' */ fontVarient: 'normal', - /** - * @description Font weight of Ctx - * @type {String|Number} - * @default fontWeight = 'normal' - * @example fontWeight = 'normal'|'bold'|'bolder'|'lighter'|Number + /** + * @description Font weight of Ctx + * @type {String|Number} + * @default fontWeight = 'normal' + * @example fontWeight = 'normal'|'bold'|'bolder'|'lighter'|Number */ fontWeight: 'normal', - /** - * @description Font size of Ctx - * @type {Number} - * @default fontSize = 10 + /** + * @description Font size of Ctx + * @type {Number} + * @default fontSize = 10 */ fontSize: 10, - /** - * @description Font family of Ctx - * @type {String} - * @default fontFamily = 'Arial' + /** + * @description Font family of Ctx + * @type {String} + * @default fontFamily = 'Arial' */ fontFamily: 'Arial', - /** - * @description TextAlign of Ctx - * @type {String} - * @default textAlign = 'center' - * @example textAlign = 'start'|'end'|'left'|'right'|'center' + /** + * @description TextAlign of Ctx + * @type {String} + * @default textAlign = 'center' + * @example textAlign = 'start'|'end'|'left'|'right'|'center' */ textAlign: 'center', - /** - * @description TextBaseline of Ctx - * @type {String} - * @default textBaseline = 'middle' - * @example textBaseline = 'top'|'bottom'|'middle'|'alphabetic'|'hanging' + /** + * @description TextBaseline of Ctx + * @type {String} + * @default textBaseline = 'middle' + * @example textBaseline = 'top'|'bottom'|'middle'|'alphabetic'|'hanging' */ textBaseline: 'middle', - /** - * @description The color used to create the gradient - * @type {Array} - * @default gradientColor = null - * @example gradientColor = ['#000', '#111', '#222'] + /** + * @description The color used to create the gradient + * @type {Array} + * @default gradientColor = null + * @example gradientColor = ['#000', '#111', '#222'] */ gradientColor: null, - /** - * @description Gradient type - * @type {String} - * @default gradientType = 'linear' - * @example gradientType = 'linear' | 'radial' + /** + * @description Gradient type + * @type {String} + * @default gradientType = 'linear' + * @example gradientType = 'linear' | 'radial' */ gradientType: 'linear', - /** - * @description Gradient params - * @type {Array} - * @default gradientParams = null - * @example gradientParams = [x0, y0, x1, y1] (Linear Gradient) - * @example gradientParams = [x0, y0, r0, x1, y1, r1] (Radial Gradient) + /** + * @description Gradient params + * @type {Array} + * @default gradientParams = null + * @example gradientParams = [x0, y0, x1, y1] (Linear Gradient) + * @example gradientParams = [x0, y0, r0, x1, y1, r1] (Radial Gradient) */ gradientParams: null, - /** - * @description When to use gradients - * @type {String} - * @default gradientWith = 'stroke' - * @example gradientWith = 'stroke' | 'fill' + /** + * @description When to use gradients + * @type {String} + * @default gradientWith = 'stroke' + * @example gradientWith = 'stroke' | 'fill' */ gradientWith: 'stroke', - /** - * @description Gradient color stops - * @type {String} - * @default gradientStops = 'auto' - * @example gradientStops = 'auto' | [0, .2, .3, 1] + /** + * @description Gradient color stops + * @type {String} + * @default gradientStops = 'auto' + * @example gradientStops = 'auto' | [0, .2, .3, 1] */ gradientStops: 'auto', - /** - * @description Extended color that supports animation transition - * @type {Array|Object} - * @default colors = null - * @example colors = ['#000', '#111', '#222'] - * @example colors = { a: '#000', b: '#111' } + /** + * @description Extended color that supports animation transition + * @type {Array|Object} + * @default colors = null + * @example colors = ['#000', '#111', '#222', 'red' ] + * @example colors = { a: '#000', b: '#111' } */ colors: null }; Object.assign(this, defaultStyle, style); }; - /** - * @description Set colors to rgba value - * @param {Object} style style config - * @param {Boolean} reverse Whether to perform reverse operation - * @return {Undefined} Void + /** + * @description Set colors to rgba value + * @param {Object} style style config + * @param {Boolean} reverse Whether to perform reverse operation + * @return {Undefined} Void */ @@ -10498,10 +10570,10 @@ }); } }; - /** - * @description Init graph style - * @param {Object} ctx Context of canvas - * @return {Undefined} Void + /** + * @description Init graph style + * @param {Object} ctx Context of canvas + * @return {Undefined} Void */ @@ -10510,11 +10582,11 @@ initGraphStyle(ctx, this); initGradient(ctx, this); }; - /** - * @description Init canvas transform - * @param {Object} ctx Context of canvas - * @param {Style} style Instance of Style - * @return {Undefined} Void + /** + * @description Init canvas transform + * @param {Object} ctx Context of canvas + * @param {Style} style Instance of Style + * @return {Undefined} Void */ @@ -10525,19 +10597,19 @@ scale = style.scale, translate = style.translate; if (!(graphCenter instanceof Array)) return; - ctx.translate.apply(ctx, _toConsumableArray(graphCenter)); + ctx.translate.apply(ctx, (0, _toConsumableArray2["default"])(graphCenter)); if (rotate) ctx.rotate(rotate * Math.PI / 180); - if (scale instanceof Array) ctx.scale.apply(ctx, _toConsumableArray(scale)); - if (translate) ctx.translate.apply(ctx, _toConsumableArray(translate)); + if (scale instanceof Array) ctx.scale.apply(ctx, (0, _toConsumableArray2["default"])(scale)); + if (translate) ctx.translate.apply(ctx, (0, _toConsumableArray2["default"])(translate)); ctx.translate(-graphCenter[0], -graphCenter[1]); } var autoSetStyleKeys = ['lineCap', 'lineJoin', 'lineDashOffset', 'shadowOffsetX', 'shadowOffsetY', 'lineWidth', 'textAlign', 'textBaseline']; - /** - * @description Set the style of canvas ctx - * @param {Object} ctx Context of canvas - * @param {Style} style Instance of Style - * @return {Undefined} Void + /** + * @description Set the style of canvas ctx + * @param {Object} ctx Context of canvas + * @param {Style} style Instance of Style + * @return {Undefined} Void */ function initGraphStyle(ctx, style) { @@ -10548,9 +10620,9 @@ autoSetStyleKeys.forEach(function (key) { if (key || typeof key === 'number') ctx[key] = style[key]; }); - fill = _toConsumableArray(fill); - stroke = _toConsumableArray(stroke); - shadowColor = _toConsumableArray(shadowColor); + fill = (0, _toConsumableArray2["default"])(fill); + stroke = (0, _toConsumableArray2["default"])(stroke); + shadowColor = (0, _toConsumableArray2["default"])(shadowColor); fill[3] *= opacity; stroke[3] *= opacity; shadowColor[3] *= opacity; @@ -10575,11 +10647,11 @@ fontFamily = style.fontFamily; ctx.font = fontStyle + ' ' + fontVarient + ' ' + fontWeight + ' ' + fontSize + 'px' + ' ' + fontFamily; } - /** - * @description Set the gradient color of canvas ctx - * @param {Object} ctx Context of canvas - * @param {Style} style Instance of Style - * @return {Undefined} Void + /** + * @description Set the gradient color of canvas ctx + * @param {Object} ctx Context of canvas + * @param {Style} style Instance of Style + * @return {Undefined} Void */ @@ -10593,9 +10665,7 @@ opacity = style.opacity; gradientColor = gradientColor.map(function (color) { var colorOpacity = color[3] * opacity; - - var clonedColor = _toConsumableArray(color); - + var clonedColor = (0, _toConsumableArray2["default"])(color); clonedColor[3] = colorOpacity; return clonedColor; }); @@ -10603,16 +10673,16 @@ return (0, lib.getColorFromRgbValue)(c); }); if (gradientStops === 'auto') gradientStops = getAutoColorStops(gradientColor); - var gradient = ctx["create".concat(gradientType.slice(0, 1).toUpperCase() + gradientType.slice(1), "Gradient")].apply(ctx, _toConsumableArray(gradientParams)); + var gradient = ctx["create".concat(gradientType.slice(0, 1).toUpperCase() + gradientType.slice(1), "Gradient")].apply(ctx, (0, _toConsumableArray2["default"])(gradientParams)); gradientStops.forEach(function (stop, i) { return gradient.addColorStop(stop, gradientColor[i]); }); ctx["".concat(gradientWith, "Style")] = gradient; } - /** - * @description Check if the gradient configuration is legal - * @param {Style} style Instance of Style - * @return {Boolean} Check Result + /** + * @description Check if the gradient configuration is legal + * @param {Style} style Instance of Style + * @return {Boolean} Check Result */ @@ -10653,10 +10723,10 @@ return true; } - /** - * @description Get a uniform gradient color stop - * @param {Array} color Gradient color - * @return {Array} Gradient color stop + /** + * @description Get a uniform gradient color stop + * @param {Array} color Gradient color + * @return {Array} Gradient color stop */ @@ -10666,20 +10736,20 @@ return stopGap * i; }); } - /** - * @description Restore canvas ctx transform - * @param {Object} ctx Context of canvas - * @return {Undefined} Void + /** + * @description Restore canvas ctx transform + * @param {Object} ctx Context of canvas + * @return {Undefined} Void */ Style.prototype.restoreTransform = function (ctx) { ctx.restore(); }; - /** - * @description Update style data - * @param {Object} change Changed data - * @return {Undefined} Void + /** + * @description Update style data + * @param {Object} change Changed data + * @return {Undefined} Void */ @@ -10687,41 +10757,21 @@ this.colorProcessor(change); Object.assign(this, change); }; - /** - * @description Get the current style configuration - * @return {Object} Style configuration + /** + * @description Get the current style configuration + * @return {Object} Style configuration */ - Style.prototype.getStyle = function () { - var clonedStyle = (0, util.deepClone)(this, true); - this.colorProcessor(clonedStyle, true); - return clonedStyle; - }; - }); - - unwrapExports(style_class); - - var _typeof_1 = createCommonjsModule(function (module) { - function _typeof2(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof2(obj); } - - function _typeof(obj) { - if (typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol") { - module.exports = _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - module.exports = _typeof = function _typeof(obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : _typeof2(obj); - }; - } - - return _typeof(obj); - } - - module.exports = _typeof; + Style.prototype.getStyle = function () { + var clonedStyle = (0, util.deepClone)(this, true); + this.colorProcessor(clonedStyle, true); + return clonedStyle; + }; }); + unwrapExports(style_class); + var curves = createCommonjsModule(function (module, exports) { Object.defineProperty(exports, "__esModule", { @@ -10729,8 +10779,8 @@ }); exports["default"] = exports.easeInOutBounce = exports.easeOutBounce = exports.easeInBounce = exports.easeInOutElastic = exports.easeOutElastic = exports.easeInElastic = exports.easeInOutBack = exports.easeOutBack = exports.easeInBack = exports.easeInOutQuint = exports.easeOutQuint = exports.easeInQuint = exports.easeInOutQuart = exports.easeOutQuart = exports.easeInQuart = exports.easeInOutCubic = exports.easeOutCubic = exports.easeInCubic = exports.easeInOutQuad = exports.easeOutQuad = exports.easeInQuad = exports.easeInOutSine = exports.easeOutSine = exports.easeInSine = exports.linear = void 0; var linear = [[[0, 1], '', [0.33, 0.67]], [[1, 0], [0.67, 0.33]]]; - /** - * @description Sine + /** + * @description Sine */ exports.linear = linear; @@ -10739,8 +10789,8 @@ var easeOutSine = [[[0, 1]], [[0.444, 0.448], [0.169, 0.736], [0.718, 0.16]], [[1, 0]]]; exports.easeOutSine = easeOutSine; var easeInOutSine = [[[0, 1]], [[0.5, 0.5], [0.2, 1], [0.8, 0]], [[1, 0]]]; - /** - * @description Quad + /** + * @description Quad */ exports.easeInOutSine = easeInOutSine; @@ -10749,8 +10799,8 @@ var easeOutQuad = [[[0, 1]], [[0.413, 0.428], [0.065, 0.816], [0.760, 0.04]], [[1, 0]]]; exports.easeOutQuad = easeOutQuad; var easeInOutQuad = [[[0, 1]], [[0.5, 0.5], [0.3, 0.9], [0.7, 0.1]], [[1, 0]]]; - /** - * @description Cubic + /** + * @description Cubic */ exports.easeInOutQuad = easeInOutQuad; @@ -10759,8 +10809,8 @@ var easeOutCubic = [[[0, 1]], [[0.321, 0.312], [0.008, 0.616], [0.634, 0.008]], [[1, 0]]]; exports.easeOutCubic = easeOutCubic; var easeInOutCubic = [[[0, 1]], [[0.5, 0.5], [0.3, 1], [0.7, 0]], [[1, 0]]]; - /** - * @description Quart + /** + * @description Quart */ exports.easeInOutCubic = easeInOutCubic; @@ -10769,8 +10819,8 @@ var easeOutQuart = [[[0, 1]], [[0.152, 0.244], [0.001, 0.448], [0.285, -0.02]], [[1, 0]]]; exports.easeOutQuart = easeOutQuart; var easeInOutQuart = [[[0, 1]], [[0.5, 0.5], [0.4, 1], [0.6, 0]], [[1, 0]]]; - /** - * @description Quint + /** + * @description Quint */ exports.easeInOutQuart = easeInOutQuart; @@ -10779,8 +10829,8 @@ var easeOutQuint = [[[0, 1]], [[0.108, 0.2], [0.001, 0.4], [0.214, -0.012]], [[1, 0]]]; exports.easeOutQuint = easeOutQuint; var easeInOutQuint = [[[0, 1]], [[0.5, 0.5], [0.5, 1], [0.5, 0]], [[1, 0]]]; - /** - * @description Back + /** + * @description Back */ exports.easeInOutQuint = easeInOutQuint; @@ -10789,8 +10839,8 @@ var easeOutBack = [[[0, 1]], [[0.335, 0.028], [0.061, 0.22], [0.631, -0.18]], [[1, 0]]]; exports.easeOutBack = easeOutBack; var easeInOutBack = [[[0, 1]], [[0.5, 0.5], [0.4, 1.4], [0.6, -0.4]], [[1, 0]]]; - /** - * @description Elastic + /** + * @description Elastic */ exports.easeInOutBack = easeInOutBack; @@ -10799,8 +10849,8 @@ var easeOutElastic = [[[0, 1]], [[0.073, -0.32], [0.034, -0.328], [0.104, -0.344]], [[0.191, 0.092], [0.110, 0.06], [0.256, 0.08]], [[0.310, -0.076], [0.260, -0.068], [0.357, -0.076]], [[0.432, 0.032], [0.362, 0.028], [0.683, -0.004]], [[1, 0]]]; exports.easeOutElastic = easeOutElastic; var easeInOutElastic = [[[0, 1]], [[0.210, 0.94], [0.167, 0.884], [0.252, 0.98]], [[0.299, 1.104], [0.256, 1.092], [0.347, 1.108]], [[0.5, 0.496], [0.451, 0.672], [0.548, 0.324]], [[0.696, -0.108], [0.652, -0.112], [0.741, -0.124]], [[0.805, 0.064], [0.756, 0.012], [0.866, 0.096]], [[1, 0]]]; - /** - * @description Bounce + /** + * @description Bounce */ exports.easeInOutElastic = easeInOutElastic; @@ -10861,15 +10911,15 @@ var _curves = interopRequireDefault(curves); var defaultTransitionBC = 'linear'; - /** - * @description Get the N-frame animation state by the start and end state - * of the animation and the easing curve - * @param {String|Array} tBC Easing curve name or data - * @param {Number|Array|Object} startState Animation start state - * @param {Number|Array|Object} endState Animation end state - * @param {Number} frameNum Number of Animation frames - * @param {Boolean} deep Whether to use recursive mode - * @return {Array|Boolean} State of each frame of the animation (Invalid input will return false) + /** + * @description Get the N-frame animation state by the start and end state + * of the animation and the easing curve + * @param {String|Array} tBC Easing curve name or data + * @param {Number|Array|Object} startState Animation start state + * @param {Number|Array|Object} endState Animation end state + * @param {Number} frameNum Number of Animation frames + * @param {Boolean} deep Whether to use recursive mode + * @return {Array|Boolean} State of each frame of the animation (Invalid input will return false) */ function transition(tBC) { @@ -10892,13 +10942,13 @@ return [endState]; } } - /** - * @description Check if the parameters are legal - * @param {String} tBC Name of transition bezier curve - * @param {Any} startState Transition start state - * @param {Any} endState Transition end state - * @param {Number} frameNum Number of transition frames - * @return {Boolean} Is the parameter legal + /** + * @description Check if the parameters are legal + * @param {String} tBC Name of transition bezier curve + * @param {Any} startState Transition start state + * @param {Any} endState Transition end state + * @param {Number} frameNum Number of transition frames + * @return {Boolean} Is the parameter legal */ @@ -10930,10 +10980,10 @@ return true; } - /** - * @description Get the transition bezier curve - * @param {String} tBC Name of transition bezier curve - * @return {Array} Bezier curve data + /** + * @description Get the transition bezier curve + * @param {String} tBC Name of transition bezier curve + * @return {Array} Bezier curve data */ @@ -10950,11 +11000,11 @@ return bezierCurve; } - /** - * @description Get the progress of each frame state - * @param {Array} bezierCurve Transition bezier curve - * @param {Number} frameNum Number of transition frames - * @return {Array} Progress of each frame state + /** + * @description Get the progress of each frame state + * @param {Array} bezierCurve Transition bezier curve + * @param {Number} frameNum Number of transition frames + * @return {Array} Progress of each frame state */ @@ -10968,11 +11018,11 @@ }); return frameState; } - /** - * @description Get the progress of the corresponding frame according to t - * @param {Array} bezierCurve Transition bezier curve - * @param {Number} t Current frame t - * @return {Number} Progress of current frame + /** + * @description Get the progress of the corresponding frame according to t + * @param {Array} bezierCurve Transition bezier curve + * @param {Number} t Current frame t + * @return {Number} Progress of current frame */ @@ -10981,11 +11031,11 @@ var bezierCurvePointT = getBezierCurvePointTFromReT(tBezierCurvePoint, t); return getBezierCurveTState(tBezierCurvePoint, bezierCurvePointT); } - /** - * @description Get the corresponding sub-curve according to t - * @param {Array} bezierCurve Transition bezier curve - * @param {Number} t Current frame t - * @return {Array} Sub-curve of t + /** + * @description Get the corresponding sub-curve according to t + * @param {Array} bezierCurve Transition bezier curve + * @param {Number} t Current frame t + * @return {Array} Sub-curve of t */ @@ -11007,11 +11057,11 @@ var p3 = end[0]; return [p0, p1, p2, p3]; } - /** - * @description Get local t based on t and sub-curve - * @param {Array} bezierCurve Sub-curve - * @param {Number} t Current frame t - * @return {Number} local t of sub-curve + /** + * @description Get local t based on t and sub-curve + * @param {Array} bezierCurve Sub-curve + * @param {Number} t Current frame t + * @return {Number} local t of sub-curve */ @@ -11022,11 +11072,11 @@ var tMinus = t - reBeginX; return tMinus / xMinus; } - /** - * @description Get the curve progress of t - * @param {Array} bezierCurve Sub-curve - * @param {Number} t Current frame t - * @return {Number} Progress of current frame + /** + * @description Get the curve progress of t + * @param {Array} bezierCurve Sub-curve + * @param {Number} t Current frame t + * @return {Number} Progress of current frame */ @@ -11049,12 +11099,12 @@ var result4 = p3 * pow(t, 3); return 1 - (result1 + result2 + result3 + result4); } - /** - * @description Get transition state according to frame progress - * @param {Any} startState Transition start state - * @param {Any} endState Transition end state - * @param {Array} frameState Frame state progress - * @return {Array} Transition frame state + /** + * @description Get transition state according to frame progress + * @param {Any} startState Transition start state + * @param {Any} endState Transition end state + * @param {Array} frameState Frame state progress + * @return {Array} Transition frame state */ @@ -11069,12 +11119,12 @@ return end; }); } - /** - * @description Get the transition data of the number type - * @param {Number} startState Transition start state - * @param {Number} endState Transition end state - * @param {Array} frameState Frame state progress - * @return {Array} Transition frame state + /** + * @description Get the transition data of the number type + * @param {Number} startState Transition start state + * @param {Number} endState Transition end state + * @param {Array} frameState Frame state progress + * @return {Array} Transition frame state */ @@ -11084,12 +11134,12 @@ return begin + minus * s; }); } - /** - * @description Get the transition data of the array type - * @param {Array} startState Transition start state - * @param {Array} endState Transition end state - * @param {Array} frameState Frame state progress - * @return {Array} Transition frame state + /** + * @description Get the transition data of the array type + * @param {Array} startState Transition start state + * @param {Array} endState Transition end state + * @param {Array} frameState Frame state progress + * @return {Array} Transition frame state */ @@ -11105,12 +11155,12 @@ }); }); } - /** - * @description Get the transition data of the object type - * @param {Object} startState Transition start state - * @param {Object} endState Transition end state - * @param {Array} frameState Frame state progress - * @return {Array} Transition frame state + /** + * @description Get the transition data of the object type + * @param {Object} startState Transition start state + * @param {Object} endState Transition end state + * @param {Array} frameState Frame state progress + * @return {Array} Transition frame state */ @@ -11131,12 +11181,12 @@ return frameData; }); } - /** - * @description Get the transition state data by recursion - * @param {Array|Object} startState Transition start state - * @param {Array|Object} endState Transition end state - * @param {Array} frameState Frame state progress - * @return {Array} Transition frame state + /** + * @description Get the transition state data by recursion + * @param {Array|Object} startState Transition start state + * @param {Array|Object} endState Transition end state + * @param {Array} frameState Frame state progress + * @return {Array} Transition frame state */ @@ -11161,11 +11211,11 @@ return state; } - /** - * @description Inject new curve into curves as config - * @param {Any} key The key of curve - * @param {Array} curve Bezier curve data - * @return {Undefined} No return + /** + * @description Inject new curve into curves as config + * @param {Any} key The key of curve + * @param {Array} curve Bezier curve data + * @return {Undefined} No return */ @@ -11195,164 +11245,117 @@ }); exports["default"] = void 0; + var _regenerator = interopRequireDefault(regenerator); + var _asyncToGenerator2 = interopRequireDefault(asyncToGenerator); + var _typeof2 = interopRequireDefault(_typeof_1); + var _toConsumableArray2 = interopRequireDefault(toConsumableArray); + var _classCallCheck2 = interopRequireDefault(classCallCheck); + var _style = interopRequireDefault(style_class); + var _transition = interopRequireDefault(lib$2); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - var _style = _interopRequireDefault(style_class); - - var _transition = _interopRequireDefault(lib$2); - - - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - - function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } - - function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } - - function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - - function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } - - function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } - - function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } - - function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - /** - * @description Class Graph - * @param {Object} graph Graph default configuration - * @param {Object} config Graph config - * @return {Graph} Instance of Graph + /** + * @description Class Graph + * @param {Object} graph Graph default configuration + * @param {Object} config Graph config + * @return {Graph} Instance of Graph */ var Graph = function Graph(graph, config) { - _classCallCheck(this, Graph); - + (0, _classCallCheck2["default"])(this, Graph); config = (0, util.deepClone)(config, true); var defaultConfig = { - /** - * @description Weather to render graph - * @type {Boolean} - * @default visible = true + /** + * @description Weather to render graph + * @type {Boolean} + * @default visible = true */ visible: true, - /** - * @description Whether to enable drag - * @type {Boolean} - * @default drag = false + /** + * @description Whether to enable drag + * @type {Boolean} + * @default drag = false */ drag: false, - /** - * @description Whether to enable hover - * @type {Boolean} - * @default hover = false + /** + * @description Whether to enable hover + * @type {Boolean} + * @default hover = false */ hover: false, - /** - * @description Graph rendering index - * Give priority to index high graph in rendering - * @type {Number} - * @example index = 1 + /** + * @description Graph rendering index + * Give priority to index high graph in rendering + * @type {Number} + * @example index = 1 */ index: 1, - /** - * @description Animation delay time(ms) - * @type {Number} - * @default animationDelay = 0 + /** + * @description Animation delay time(ms) + * @type {Number} + * @default animationDelay = 0 */ animationDelay: 0, - /** - * @description Number of animation frames - * @type {Number} - * @default animationFrame = 30 + /** + * @description Number of animation frames + * @type {Number} + * @default animationFrame = 30 */ animationFrame: 30, - /** - * @description Animation dynamic curve (Supported by transition) - * @type {String} - * @default animationCurve = 'linear' - * @link https://github.com/jiaming743/Transition + /** + * @description Animation dynamic curve (Supported by transition) + * @type {String} + * @default animationCurve = 'linear' + * @link https://github.com/jiaming743/Transition */ animationCurve: 'linear', - /** - * @description Weather to pause graph animation - * @type {Boolean} - * @default animationPause = false + /** + * @description Weather to pause graph animation + * @type {Boolean} + * @default animationPause = false */ animationPause: false, - /** - * @description Rectangular hover detection zone - * Use this method for hover detection first - * @type {Null|Array} - * @default hoverRect = null - * @example hoverRect = [0, 0, 100, 100] // [Rect start x, y, Rect width, height] + /** + * @description Rectangular hover detection zone + * Use this method for hover detection first + * @type {Null|Array} + * @default hoverRect = null + * @example hoverRect = [0, 0, 100, 100] // [Rect start x, y, Rect width, height] */ hoverRect: null, - /** - * @description Mouse enter event handler - * @type {Function|Null} - * @default mouseEnter = null + /** + * @description Mouse enter event handler + * @type {Function|Null} + * @default mouseEnter = null */ mouseEnter: null, - /** - * @description Mouse outer event handler - * @type {Function|Null} - * @default mouseOuter = null + /** + * @description Mouse outer event handler + * @type {Function|Null} + * @default mouseOuter = null */ mouseOuter: null, - /** - * @description Mouse click event handler - * @type {Function|Null} - * @default click = null + /** + * @description Mouse click event handler + * @type {Function|Null} + * @default click = null */ click: null }; @@ -11372,9 +11375,9 @@ this.style = new _style["default"](config.style); this.addedProcessor(); }; - /** - * @description Processor of added - * @return {Undefined} Void + /** + * @description Processor of added + * @return {Undefined} Void */ @@ -11385,11 +11388,11 @@ if (typeof this.added === 'function') this.added(this); }; - /** - * @description Processor of draw - * @param {CRender} render Instance of CRender - * @param {Graph} graph Instance of Graph - * @return {Undefined} Void + /** + * @description Processor of draw + * @param {CRender} render Instance of CRender + * @param {Graph} graph Instance of Graph + * @return {Undefined} Void */ @@ -11401,11 +11404,11 @@ if (typeof this.drawed === 'function') this.drawed(this, render); graph.style.restoreTransform(ctx); }; - /** - * @description Processor of hover check - * @param {Array} position Mouse Position - * @param {Graph} graph Instance of Graph - * @return {Boolean} Result of hover check + /** + * @description Processor of hover check + * @param {Array} position Mouse Position + * @param {Graph} graph Instance of Graph + * @return {Boolean} Result of hover check */ @@ -11428,13 +11431,13 @@ }), position); } - if (hoverRect) return util.checkPointIsInRect.apply(void 0, [position].concat(_toConsumableArray(hoverRect))); + if (hoverRect) return util.checkPointIsInRect.apply(void 0, [position].concat((0, _toConsumableArray2["default"])(hoverRect))); return hoverCheck(position, this); }; - /** - * @description Processor of move - * @param {Event} e Mouse movement event - * @return {Undefined} Void + /** + * @description Processor of move + * @param {Event} e Mouse movement event + * @return {Undefined} Void */ @@ -11444,18 +11447,18 @@ if (typeof this.setGraphCenter === 'function') this.setGraphCenter(e, this); if (typeof this.moved === 'function') this.moved(e, this); }; - /** - * @description Update graph state - * @param {String} attrName Updated attribute name - * @param {Any} change Updated value - * @return {Undefined} Void + /** + * @description Update graph state + * @param {String} attrName Updated attribute name + * @param {Any} change Updated value + * @return {Undefined} Void */ Graph.prototype.attr = function (attrName) { var change = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; if (!attrName || change === undefined) return false; - var isObject = _typeof(this[attrName]) === 'object'; + var isObject = (0, _typeof2["default"])(this[attrName]) === 'object'; if (isObject) change = (0, util.deepClone)(change, true); var render = this.render; @@ -11470,23 +11473,23 @@ if (attrName === 'index') render.sortGraphsByIndex(); render.drawAllGraph(); }; - /** - * @description Update graphics state (with animation) - * Only shape and style attributes are supported - * @param {String} attrName Updated attribute name - * @param {Any} change Updated value - * @param {Boolean} wait Whether to store the animation waiting - * for the next animation request - * @return {Promise} Animation Promise + /** + * @description Update graphics state (with animation) + * Only shape and style attributes are supported + * @param {String} attrName Updated attribute name + * @param {Any} change Updated value + * @param {Boolean} wait Whether to store the animation waiting + * for the next animation request + * @return {Promise} Animation Promise */ Graph.prototype.animation = /*#__PURE__*/ function () { - var _ref2 = _asyncToGenerator( + var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/ - regeneratorRuntime.mark(function _callee2(attrName, change) { + _regenerator["default"].mark(function _callee2(attrName, change) { var wait, changeRoot, changeKeys, @@ -11497,7 +11500,7 @@ animationFrameState, render, _args2 = arguments; - return regeneratorRuntime.wrap(function _callee2$(_context2) { + return _regenerator["default"].wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: @@ -11547,10 +11550,10 @@ return _context2.abrupt("return", new Promise( /*#__PURE__*/ function () { - var _ref3 = _asyncToGenerator( + var _ref3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/ - regeneratorRuntime.mark(function _callee(resolve) { - return regeneratorRuntime.wrap(function _callee$(_context) { + _regenerator["default"].mark(function _callee(resolve) { + return _regenerator["default"].wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: @@ -11585,10 +11588,10 @@ return _ref2.apply(this, arguments); }; }(); - /** - * @description Extract the next frame of data from the animation queue - * and update the graph state - * @return {Undefined} Void + /** + * @description Extract the next frame of data from the animation queue + * and update the graph state + * @return {Undefined} Void */ @@ -11621,9 +11624,9 @@ return keys; }); }; - /** - * @description Skip to the last frame of animation - * @return {Undefined} Void + /** + * @description Skip to the last frame of animation + * @return {Undefined} Void */ @@ -11644,18 +11647,18 @@ this.animationRoot = []; return render.drawAllGraph(); }; - /** - * @description Pause animation behavior - * @return {Undefined} Void + /** + * @description Pause animation behavior + * @return {Undefined} Void */ Graph.prototype.pauseAnimation = function () { this.attr('animationPause', true); }; - /** - * @description Try animation behavior - * @return {Undefined} Void + /** + * @description Try animation behavior + * @return {Undefined} Void */ @@ -11665,10 +11668,10 @@ return new Promise( /*#__PURE__*/ function () { - var _ref4 = _asyncToGenerator( + var _ref4 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/ - regeneratorRuntime.mark(function _callee3(resolve) { - return regeneratorRuntime.wrap(function _callee3$(_context3) { + _regenerator["default"].mark(function _callee3(resolve) { + return _regenerator["default"].wrap(function _callee3$(_context3) { while (1) { switch (_context3.prev = _context3.next) { case 0: @@ -11691,10 +11694,10 @@ }; }()); }; - /** - * @description Processor of delete - * @param {CRender} render Instance of CRender - * @return {Undefined} Void + /** + * @description Processor of delete + * @param {CRender} render Instance of CRender + * @return {Undefined} Void */ @@ -11710,10 +11713,10 @@ graphs.splice(index, 1, null); if (typeof this.deleted === 'function') this.deleted(this); }; - /** - * @description Return a timed release Promise - * @param {Number} time Release time - * @return {Promise} A timed release Promise + /** + * @description Return a timed release Promise + * @param {Number} time Release time + * @return {Promise} A timed release Promise */ @@ -11735,77 +11738,33 @@ }); exports["default"] = void 0; + var _defineProperty2 = interopRequireDefault(defineProperty); + var _toConsumableArray2 = interopRequireDefault(toConsumableArray); + var _classCallCheck2 = interopRequireDefault(classCallCheck); + var _color = interopRequireDefault(lib); + var _bezierCurve = interopRequireDefault(lib$1); + var _graphs = interopRequireDefault(graphs_1); + var _graph = interopRequireDefault(graph_class); + function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } - - - - - - - - - - - - - - - - - - - - - - - - - - - - var _color = _interopRequireDefault(lib); - - var _bezierCurve = _interopRequireDefault(lib$1); - - - - var _graphs = _interopRequireDefault(graphs_1); - - var _graph = _interopRequireDefault(graph_class); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - - function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } - - function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - - function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } - - function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } - - function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } - - function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - /** - * @description Class of CRender - * @param {Object} canvas Canvas DOM - * @return {CRender} Instance of CRender + /** + * @description Class of CRender + * @param {Object} canvas Canvas DOM + * @return {CRender} Instance of CRender */ var CRender = function CRender(canvas) { - _classCallCheck(this, CRender); + (0, _classCallCheck2["default"])(this, CRender); if (!canvas) { console.error('CRender Missing parameters!'); @@ -11818,45 +11777,45 @@ var area = [clientWidth, clientHeight]; canvas.setAttribute('width', clientWidth); canvas.setAttribute('height', clientHeight); - /** - * @description Context of the canvas - * @type {Object} - * @example ctx = canvas.getContext('2d') + /** + * @description Context of the canvas + * @type {Object} + * @example ctx = canvas.getContext('2d') */ this.ctx = ctx; - /** - * @description Width and height of the canvas - * @type {Array} - * @example area = [300,100] + /** + * @description Width and height of the canvas + * @type {Array} + * @example area = [300,100] */ this.area = area; - /** - * @description Whether render is in animation rendering - * @type {Boolean} - * @example animationStatus = true|false + /** + * @description Whether render is in animation rendering + * @type {Boolean} + * @example animationStatus = true|false */ this.animationStatus = false; - /** - * @description Added graph - * @type {[Graph]} - * @example graphs = [Graph, Graph, ...] + /** + * @description Added graph + * @type {[Graph]} + * @example graphs = [Graph, Graph, ...] */ this.graphs = []; - /** - * @description Color plugin - * @type {Object} - * @link https://github.com/jiaming743/color + /** + * @description Color plugin + * @type {Object} + * @link https://github.com/jiaming743/color */ this.color = _color["default"]; - /** - * @description Bezier Curve plugin - * @type {Object} - * @link https://github.com/jiaming743/BezierCurve + /** + * @description Bezier Curve plugin + * @type {Object} + * @link https://github.com/jiaming743/BezierCurve */ this.bezierCurve = _bezierCurve["default"]; // bind event handler @@ -11865,9 +11824,9 @@ canvas.addEventListener('mousemove', mouseMove.bind(this)); canvas.addEventListener('mouseup', mouseUp.bind(this)); }; - /** - * @description Clear canvas drawing area - * @return {Undefined} Void + /** + * @description Clear canvas drawing area + * @return {Undefined} Void */ @@ -11878,12 +11837,12 @@ var area = this.area; - (_this$ctx = this.ctx).clearRect.apply(_this$ctx, [0, 0].concat(_toConsumableArray(area))); + (_this$ctx = this.ctx).clearRect.apply(_this$ctx, [0, 0].concat((0, _toConsumableArray2["default"])(area))); }; - /** - * @description Add graph to render - * @param {Object} config Graph configuration - * @return {Graph} Graph instance + /** + * @description Add graph to render + * @param {Object} config Graph configuration + * @return {Graph} Graph instance */ @@ -11911,9 +11870,9 @@ this.drawAllGraph(); return graph; }; - /** - * @description Sort the graph by index - * @return {Undefined} Void + /** + * @description Sort the graph by index + * @return {Undefined} Void */ @@ -11925,10 +11884,10 @@ if (a.index < b.index) return -1; }); }; - /** - * @description Delete graph in render - * @param {Graph} graph The graph to be deleted - * @return {Undefined} Void + /** + * @description Delete graph in render + * @param {Graph} graph The graph to be deleted + * @return {Undefined} Void */ @@ -11940,9 +11899,9 @@ }); this.drawAllGraph(); }; - /** - * @description Delete all graph in render - * @return {Undefined} Void + /** + * @description Delete all graph in render + * @return {Undefined} Void */ @@ -11957,9 +11916,9 @@ }); this.drawAllGraph(); }; - /** - * @description Draw all the graphs in the render - * @return {Undefined} Void + /** + * @description Draw all the graphs in the render + * @return {Undefined} Void */ @@ -11973,10 +11932,10 @@ return graph.drawProcessor(_this2, graph); }); }; - /** - * @description Animate the graph whose animation queue is not empty - * and the animationPause is equal to false - * @return {Promise} Animation Promise + /** + * @description Animate the graph whose animation queue is not empty + * and the animationPause is equal to false + * @return {Promise} Animation Promise */ @@ -11993,11 +11952,11 @@ }, Date.now()); }); }; - /** - * @description Try to animate every graph - * @param {Function} callback Callback in animation end - * @param {Number} timeStamp Time stamp of animation start - * @return {Undefined} Void + /** + * @description Try to animate every graph + * @param {Function} callback Callback in animation end + * @param {Number} timeStamp Time stamp of animation start + * @return {Undefined} Void */ @@ -12015,10 +11974,10 @@ this.drawAllGraph(); requestAnimationFrame(animation.bind(this, callback, timeStamp)); } - /** - * @description Find if there are graph that can be animated - * @param {[Graph]} graphs - * @return {Boolean} + /** + * @description Find if there are graph that can be animated + * @param {[Graph]} graphs + * @return {Boolean} */ @@ -12027,9 +11986,9 @@ return !graph.animationPause && graph.animationFrameState.length; }); } - /** - * @description Handler of CRender mousedown event - * @return {Undefined} Void + /** + * @description Handler of CRender mousedown event + * @return {Undefined} Void */ @@ -12041,9 +12000,9 @@ if (!hoverGraph) return; hoverGraph.status = 'active'; } - /** - * @description Handler of CRender mousemove event - * @return {Undefined} Void + /** + * @description Handler of CRender mousemove event + * @return {Undefined} Void */ @@ -12112,9 +12071,9 @@ hoveredGraph.status = 'hover'; } } - /** - * @description Handler of CRender mouseup event - * @return {Undefined} Void + /** + * @description Handler of CRender mouseup event + * @return {Undefined} Void */ @@ -12133,10 +12092,10 @@ if (activeGraph) activeGraph.status = 'hover'; if (dragGraph) dragGraph.status = 'hover'; } - /** - * @description Clone Graph - * @param {Graph} graph The target to be cloned - * @return {Graph} Cloned graph + /** + * @description Clone Graph + * @param {Graph} graph The target to be cloned + * @return {Graph} Cloned graph */ @@ -12162,41 +12121,47 @@ Object.defineProperty(exports, "__esModule", { value: true }); - Object.defineProperty(exports, "extendNewGraph", { + Object.defineProperty(exports, "CRender", { enumerable: true, get: function get() { - return graphs_1.extendNewGraph; + return _crender["default"]; } }); - Object.defineProperty(exports, "injectNewCurve", { + Object.defineProperty(exports, "extendNewGraph", { enumerable: true, get: function get() { - return lib$2.injectNewCurve; + return graphs_1.extendNewGraph; } }); exports["default"] = void 0; - var _crender = _interopRequireDefault(crender_class); + var _crender = interopRequireDefault(crender_class); - - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - var _default = _crender["default"]; exports["default"] = _default; }); var CRender = unwrapExports(lib$3); - function _toConsumableArray$1(arr) { return _arrayWithoutHoles$1(arr) || _iterableToArray$1(arr) || _nonIterableSpread$1(); } + var _defineProperty2 = interopRequireDefault(defineProperty); + + var _toConsumableArray2 = interopRequireDefault(toConsumableArray); + + + + + + + - function _nonIterableSpread$1() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } - function _iterableToArray$1(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } - function _arrayWithoutHoles$1(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } + + function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + + function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } var pie = { shape: { @@ -12241,9 +12206,9 @@ var connectPoint2 = (0, util.getCircleRadianPoint)(rx, ry, ir, startAngle).map(function (p) { return parseInt(p) + 0.5; }); - ctx.lineTo.apply(ctx, _toConsumableArray$1(connectPoint1)); + ctx.lineTo.apply(ctx, (0, _toConsumableArray2["default"])(connectPoint1)); ctx.arc(rx, ry, or > 0 ? or : 0, endAngle, startAngle, clockWise); - ctx.lineTo.apply(ctx, _toConsumableArray$1(connectPoint2)); + ctx.lineTo.apply(ctx, (0, _toConsumableArray2["default"])(connectPoint2)); ctx.closePath(); ctx.stroke(); ctx.fill(); @@ -12324,7 +12289,9 @@ number: [], content: '', position: [0, 0], - toFixed: 0 + toFixed: 0, + rowGap: 0, + formatter: null }, validator: function validator(_ref7) { var shape = _ref7.shape; @@ -12342,23 +12309,32 @@ draw: function draw(_ref8, _ref9) { var ctx = _ref8.ctx; var shape = _ref9.shape; - ctx.beginPath(); var number = shape.number, content = shape.content, - position = shape.position, - toFixed = shape.toFixed; + toFixed = shape.toFixed, + rowGap = shape.rowGap, + formatter = shape.formatter; var textSegments = content.split('{nt}'); - var lastSegmentIndex = textSegments.length - 1; var textString = ''; textSegments.forEach(function (t, i) { - var currentNumber = number[i]; - if (i === lastSegmentIndex) currentNumber = ''; - if (typeof currentNumber === 'number') currentNumber = currentNumber.toFixed(toFixed); + var currentNumber = number[i] || ''; + + if (typeof currentNumber === 'number') { + currentNumber = currentNumber.toFixed(toFixed); + if (typeof formatter === 'function') currentNumber = formatter(currentNumber); + } + textString += t + (currentNumber || ''); }); - ctx.closePath(); - ctx.strokeText.apply(ctx, [textString].concat(_toConsumableArray$1(position))); - ctx.fillText.apply(ctx, [textString].concat(_toConsumableArray$1(position))); + + graphs_1.text.draw({ + ctx: ctx + }, { + shape: _objectSpread({}, shape, { + content: textString, + rowGap: rowGap + }) + }); } }; var lineIcon = { @@ -12430,8 +12406,6 @@ var color = createCommonjsModule(function (module, exports) { - - Object.defineProperty(exports, "__esModule", { value: true }); @@ -12445,8 +12419,6 @@ var grid = createCommonjsModule(function (module, exports) { - - Object.defineProperty(exports, "__esModule", { value: true }); @@ -12523,8 +12495,6 @@ var axis = createCommonjsModule(function (module, exports) { - - Object.defineProperty(exports, "__esModule", { value: true }); @@ -12993,8 +12963,6 @@ var title = createCommonjsModule(function (module, exports) { - - Object.defineProperty(exports, "__esModule", { value: true }); @@ -13064,8 +13032,6 @@ var line = createCommonjsModule(function (module, exports) { - - Object.defineProperty(exports, "__esModule", { value: true }); @@ -13085,6 +13051,15 @@ */ name: '', + /** + * @description Data stacking + * The data value of the series element of the same stack + * will be superimposed (the latter value will be superimposed on the previous value) + * @type {String} + * @default stack = '' + */ + stack: '', + /** * @description Smooth line * @type {Boolean} @@ -13260,8 +13235,6 @@ var bar = createCommonjsModule(function (module, exports) { - - Object.defineProperty(exports, "__esModule", { value: true }); @@ -13281,6 +13254,15 @@ */ name: '', + /** + * @description Data stacking + * The data value of the series element of the same stack + * will be superimposed (the latter value will be superimposed on the previous value) + * @type {String} + * @default stack = '' + */ + stack: '', + /** * @description Bar shape type * @type {String} @@ -13456,6 +13438,25 @@ */ barStyle: {}, + /** + * @description Independent color mode + * When set to true, independent color mode is enabled + * @type {Boolean} + * @default independentColor = false + */ + independentColor: false, + + /** + * @description Independent colors + * Only effective when independent color mode is enabled + * Default value is the same as the color in the root configuration + * Two-dimensional color array can produce gradient colors + * @type {Array} + * @example independentColor = ['#fff', '#000'] + * @example independentColor = [['#fff', '#000'], '#000'] + */ + independentColors: [], + /** * @description Bar chart render level * Priority rendering high level @@ -13486,8 +13487,6 @@ var pie$1 = createCommonjsModule(function (module, exports) { - - Object.defineProperty(exports, "__esModule", { value: true }); @@ -13707,8 +13706,6 @@ var radarAxis = createCommonjsModule(function (module, exports) { - - Object.defineProperty(exports, "__esModule", { value: true }); @@ -13912,8 +13909,6 @@ var radar = createCommonjsModule(function (module, exports) { - - Object.defineProperty(exports, "__esModule", { value: true }); @@ -14054,8 +14049,6 @@ var gauge = createCommonjsModule(function (module, exports) { - - Object.defineProperty(exports, "__esModule", { value: true }); @@ -14362,8 +14355,6 @@ var legend = createCommonjsModule(function (module, exports) { - - Object.defineProperty(exports, "__esModule", { value: true }); @@ -14510,22 +14501,14 @@ * @default animationFrame = 50 */ animationFrame: 50 - }; - exports.legendConfig = legendConfig; - }); - - unwrapExports(legend); - var legend_1 = legend.legendConfig; - - var config = createCommonjsModule(function (module, exports) { - - - - - - + }; + exports.legendConfig = legendConfig; + }); + unwrapExports(legend); + var legend_1 = legend.legendConfig; + var config = createCommonjsModule(function (module, exports) { Object.defineProperty(exports, "__esModule", { value: true @@ -14670,8 +14653,6 @@ var mergeColor_1 = createCommonjsModule(function (module, exports) { - - Object.defineProperty(exports, "__esModule", { value: true }); @@ -14683,10 +14664,6 @@ - - - - function mergeColor(chart) { var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var defaultColor = (0, util.deepClone)(config.colorConfig, true); @@ -14719,6 +14696,15 @@ return di.color = color[i % colorNum]; }); }); + var barWithIndependentColor = series.filter(function (_ref3) { + var type = _ref3.type, + independentColor = _ref3.independentColor; + return type === 'bar' && independentColor; + }); + barWithIndependentColor.forEach(function (bar) { + if (bar.independentColors) return; + bar.independentColors = color; + }); } }); @@ -14735,51 +14721,14 @@ exports.doUpdate = doUpdate; exports.Updater = void 0; + var _toConsumableArray2 = interopRequireDefault(toConsumableArray); + var _typeof2 = interopRequireDefault(_typeof_1); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } - - function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } - - function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } - - function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } - - function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + var _classCallCheck2 = interopRequireDefault(classCallCheck); var Updater = function Updater(config, series) { - _classCallCheck(this, Updater); - + (0, _classCallCheck2["default"])(this, Updater); var chart = config.chart, key = config.key, getGraphConfig = config.getGraphConfig; @@ -14803,9 +14752,7 @@ beforeUpdate = this.beforeUpdate; delRedundanceGraph(this, series); if (!series.length) return; - - var beforeUpdateType = _typeof(beforeUpdate); - + var beforeUpdateType = (0, _typeof2["default"])(beforeUpdate); series.forEach(function (seriesItem, i) { if (beforeUpdateType === 'function') beforeUpdate(graphs, seriesItem, i, _this); var cache = graphs[i]; @@ -14857,7 +14804,7 @@ var needAddGraphs = new Array(needAddGraphNum).fill(0).map(function (foo) { return render.clone(lastCacheGraph); }); - graphs.push.apply(graphs, _toConsumableArray(needAddGraphs)); + graphs.push.apply(graphs, (0, _toConsumableArray2["default"])(needAddGraphs)); } else if (needGraphNum < cacheGraphNum) { var needDelCache = graphs.splice(needGraphNum); needDelCache.forEach(function (g) { @@ -14945,6 +14892,7 @@ }); exports.title = title; + var _slicedToArray2 = interopRequireDefault(slicedToArray); @@ -14954,21 +14902,6 @@ - - - - - - - - function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } - - function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } - - function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } - - function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } - function title(chart) { var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var title = []; @@ -15010,7 +14943,7 @@ y = _updater$chart$gridAr.y, w = _updater$chart$gridAr.w; - var _offset = _slicedToArray(offset, 2), + var _offset = (0, _slicedToArray2["default"])(offset, 2), ox = _offset[0], oy = _offset[1]; @@ -15031,12 +14964,16 @@ var grid_1$1 = createCommonjsModule(function (module, exports) { + + Object.defineProperty(exports, "__esModule", { value: true }); exports.grid = grid; + var _slicedToArray2 = interopRequireDefault(slicedToArray); + var _defineProperty2 = interopRequireDefault(defineProperty); @@ -15046,35 +14983,9 @@ + function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } - - - - - - - - - - - - - - - - - - function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } - - function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } - - function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } - - function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } - - function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } - - function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function grid(chart) { var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; @@ -15106,7 +15017,7 @@ } function getGridShape(gridItem, updater) { - var _updater$chart$render = _slicedToArray(updater.chart.render.area, 2), + var _updater$chart$render = (0, _slicedToArray2["default"])(updater.chart.render.area, 2), w = _updater$chart$render[0], h = _updater$chart$render[1]; @@ -15139,30 +15050,22 @@ unwrapExports(grid_1$1); var grid_2 = grid_1$1.grid; - var $indexOf = _arrayIncludes(false); - var $native = [].indexOf; - var NEGATIVE_ZERO = !!$native && 1 / [1].indexOf(1, -0) < 0; - - _export(_export.P + _export.F * (NEGATIVE_ZERO || !_strictMethod($native)), 'Array', { - // 22.1.3.11 / 15.4.4.14 Array.prototype.indexOf(searchElement [, fromIndex]) - indexOf: function indexOf(searchElement /* , fromIndex = 0 */) { - return NEGATIVE_ZERO - // convert -0 to +0 - ? $native.apply(this, arguments) || 0 - : $indexOf(this, searchElement, arguments[1]); - } - }); - var axis_1$1 = createCommonjsModule(function (module, exports) { + + Object.defineProperty(exports, "__esModule", { value: true }); exports.axis = axis; + var _typeof2 = interopRequireDefault(_typeof_1); + var _slicedToArray2 = interopRequireDefault(slicedToArray); + var _defineProperty2 = interopRequireDefault(defineProperty); + var _toConsumableArray2 = interopRequireDefault(toConsumableArray); @@ -15172,69 +15075,15 @@ + function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - - function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } - - function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } - - function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } - - function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } - - function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } - - function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - - function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } - - function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } - - function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } - - function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } + function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } var axisConfig = { xAxisConfig: config.xAxisConfig, yAxisConfig: config.yAxisConfig }; - var min = Math.min, - max = Math.max, - abs = Math.abs, + var abs = Math.abs, pow = Math.pow; function axis(chart) { @@ -15300,7 +15149,7 @@ if (xAxis instanceof Array) { var _allXAxis; - (_allXAxis = allXAxis).push.apply(_allXAxis, _toConsumableArray(xAxis)); + (_allXAxis = allXAxis).push.apply(_allXAxis, (0, _toConsumableArray2["default"])(xAxis)); } else { allXAxis.push(xAxis); } @@ -15308,7 +15157,7 @@ if (yAxis instanceof Array) { var _allYAxis; - (_allYAxis = allYAxis).push.apply(_allYAxis, _toConsumableArray(yAxis)); + (_allYAxis = allYAxis).push.apply(_allYAxis, (0, _toConsumableArray2["default"])(yAxis)); } else { allYAxis.push(yAxis); } @@ -15327,7 +15176,7 @@ axis: 'y' }); }); - return [].concat(_toConsumableArray(allXAxis), _toConsumableArray(allYAxis)); + return [].concat((0, _toConsumableArray2["default"])(allXAxis), (0, _toConsumableArray2["default"])(allYAxis)); } function mergeDefaultAxisConfig(allAxis) { @@ -15345,7 +15194,7 @@ yAxis = yAxis.map(function (axis) { return (0, util$1.deepMerge)((0, util.deepClone)(config.yAxisConfig), axis); }); - return [].concat(_toConsumableArray(xAxis), _toConsumableArray(yAxis)); + return [].concat((0, _toConsumableArray2["default"])(xAxis), (0, _toConsumableArray2["default"])(yAxis)); } function mergeDefaultBoundaryGap(allAxis) { @@ -15365,7 +15214,7 @@ if (typeof axis.boundaryGap === 'boolean') return; axis.boundaryGap = true; }); - return [].concat(_toConsumableArray(valueAxis), _toConsumableArray(labelAxis)); + return [].concat((0, _toConsumableArray2["default"])(valueAxis), (0, _toConsumableArray2["default"])(labelAxis)); } function calcAxisLabelData(allAxis, series) { @@ -15379,7 +15228,7 @@ }); valueAxis = calcValueAxisLabelData(valueAxis, series); labelAxis = calcLabelAxisLabelData(labelAxis); - return [].concat(_toConsumableArray(valueAxis), _toConsumableArray(labelAxis)); + return [].concat((0, _toConsumableArray2["default"])(valueAxis), (0, _toConsumableArray2["default"])(labelAxis)); } function calcValueAxisLabelData(valueAxis, series) { @@ -15387,7 +15236,7 @@ var minMaxValue = getValueAxisMaxMinValue(axis, series); var _getTrueMinMax = getTrueMinMax(axis, minMaxValue), - _getTrueMinMax2 = _slicedToArray(_getTrueMinMax, 2), + _getTrueMinMax2 = (0, _slicedToArray2["default"])(_getTrueMinMax, 2), min = _getTrueMinMax2[0], max = _getTrueMinMax2[1]; @@ -15395,9 +15244,7 @@ var formatter = axis.axisLabel.formatter; var label = []; - if (minMaxValue[0] === minMaxValue[1]) { - label = minMaxValue; - } else if (min < 0 && max > 0) { + if (min < 0 && max > 0) { label = getValueAxisLabelFromZero(min, max, interval); } else { label = getValueAxisLabelFromMin(min, max, interval); @@ -15436,13 +15283,13 @@ function getSeriesMinMaxValue(series) { if (!series) return; - var minValue = min.apply(void 0, _toConsumableArray(series.map(function (_ref9) { + var minValue = Math.min.apply(Math, (0, _toConsumableArray2["default"])(series.map(function (_ref9) { var data = _ref9.data; - return min.apply(void 0, _toConsumableArray((0, util$1.filterNonNumber)(data))); + return Math.min.apply(Math, (0, _toConsumableArray2["default"])((0, util$1.filterNonNumber)(data))); }))); - var maxValue = max.apply(void 0, _toConsumableArray(series.map(function (_ref10) { + var maxValue = Math.max.apply(Math, (0, _toConsumableArray2["default"])(series.map(function (_ref10) { var data = _ref10.data; - return max.apply(void 0, _toConsumableArray((0, util$1.filterNonNumber)(data))); + return Math.max.apply(Math, (0, _toConsumableArray2["default"])((0, util$1.filterNonNumber)(data))); }))); return [minValue, maxValue]; } @@ -15461,12 +15308,12 @@ max = _ref11.max, axis = _ref11.axis; - var _ref13 = _slicedToArray(_ref12, 2), + var _ref13 = (0, _slicedToArray2["default"])(_ref12, 2), minValue = _ref13[0], maxValue = _ref13[1]; - var minType = _typeof(min), - maxType = _typeof(max); + var minType = (0, _typeof2["default"])(min), + maxType = (0, _typeof2["default"])(max); if (!testMinMaxType(min)) { min = axisConfig[axis + 'AxisConfig'].min; @@ -15505,8 +15352,7 @@ } function testMinMaxType(val) { - var valType = _typeof(val); - + var valType = (0, _typeof2["default"])(val); var isValidString = valType === 'string' && /^\d+%$/.test(val); var isValidNumber = valType === 'number'; return isValidString || isValidNumber; @@ -15526,7 +15372,7 @@ positive.push(currentPositive += interval); } while (currentPositive < max); - return [].concat(_toConsumableArray(negative.reverse()), [0], _toConsumableArray(positive)); + return [].concat((0, _toConsumableArray2["default"])(negative.reverse()), [0], (0, _toConsumableArray2["default"])(positive)); } function getValueAxisLabelFromMin(min, max, interval) { @@ -15605,7 +15451,7 @@ yAxis[1].position = yAxis[0].position === 'left' ? 'right' : 'left'; } - return [].concat(_toConsumableArray(xAxis), _toConsumableArray(yAxis)); + return [].concat((0, _toConsumableArray2["default"])(xAxis), (0, _toConsumableArray2["default"])(yAxis)); } function calcAxisLinePosition(allAxis, chart) { @@ -15645,11 +15491,11 @@ if (typeof boundaryGap !== 'boolean') boundaryGap = axisConfig[axis + 'AxisConfig'].boundaryGap; var labelNum = label.length; - var _linePosition = _slicedToArray(linePosition, 2), - _linePosition$ = _slicedToArray(_linePosition[0], 2), + var _linePosition = (0, _slicedToArray2["default"])(linePosition, 2), + _linePosition$ = (0, _slicedToArray2["default"])(_linePosition[0], 2), startX = _linePosition$[0], startY = _linePosition$[1], - _linePosition$2 = _slicedToArray(_linePosition[1], 2), + _linePosition$2 = (0, _slicedToArray2["default"])(_linePosition[1], 2), endX = _linePosition$2[0], endY = _linePosition$2[1]; @@ -15685,7 +15531,7 @@ index = axisType === 'x' ? 0 : 1; plus = gap / 2; tickLinePosition.forEach(function (_ref16) { - var _ref17 = _slicedToArray(_ref16, 2), + var _ref17 = (0, _slicedToArray2["default"])(_ref16, 2), lineStart = _ref17[0], lineEnd = _ref17[1]; @@ -15702,13 +15548,12 @@ position = axisItem.position, linePosition = axisItem.linePosition; - var _linePosition2 = _slicedToArray(linePosition, 2), + var _linePosition2 = (0, _slicedToArray2["default"])(linePosition, 2), lineStart = _linePosition2[0], lineEnd = _linePosition2[1]; - var namePosition = _toConsumableArray(lineStart); - - if (nameLocation === 'end') namePosition = _toConsumableArray(lineEnd); + var namePosition = (0, _toConsumableArray2["default"])(lineStart); + if (nameLocation === 'end') namePosition = (0, _toConsumableArray2["default"])(lineEnd); if (nameLocation === 'center') { namePosition[0] = (lineStart[0] + lineEnd[0]) / 2; @@ -15746,13 +15591,12 @@ if (position === 'top' || position === 'bottom') plus = h; if (position === 'right' || position === 'bottom') plus *= -1; var splitLinePosition = tickLinePosition.map(function (_ref18) { - var _ref19 = _slicedToArray(_ref18, 1), + var _ref19 = (0, _slicedToArray2["default"])(_ref18, 1), startPoint = _ref19[0]; - var endPoint = _toConsumableArray(startPoint); - + var endPoint = (0, _toConsumableArray2["default"])(startPoint); endPoint[index] += plus; - return [_toConsumableArray(startPoint), endPoint]; + return [(0, _toConsumableArray2["default"])(startPoint), endPoint]; }); if (!boundaryGap) splitLinePosition.shift(); return _objectSpread({}, axisItem, { @@ -15984,82 +15828,32 @@ var line_1$1 = createCommonjsModule(function (module, exports) { + + Object.defineProperty(exports, "__esModule", { value: true }); exports.line = line; + var _typeof2 = interopRequireDefault(_typeof_1); + var _slicedToArray2 = interopRequireDefault(slicedToArray); + var _toConsumableArray2 = interopRequireDefault(toConsumableArray); + var _defineProperty2 = interopRequireDefault(defineProperty); + var _bezierCurve = interopRequireDefault(lib$1); + function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - var _bezierCurve = _interopRequireDefault(lib$1); - - - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - - function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - - function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } - - function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } - - function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } - - function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } - - function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } - - function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } - - function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } - - function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } - - function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } - - function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } var polylineToBezierCurve = _bezierCurve["default"].polylineToBezierCurve, getBezierCurveLength = _bezierCurve["default"].getBezierCurveLength; @@ -16262,8 +16056,8 @@ var mainPos = linePosition.map(function (p) { return p[changeIndex]; }); - var maxPos = Math.max.apply(Math, _toConsumableArray(mainPos)); - var minPos = Math.min.apply(Math, _toConsumableArray(mainPos)); + var maxPos = Math.max.apply(Math, (0, _toConsumableArray2["default"])(mainPos)); + var minPos = Math.min.apply(Math, (0, _toConsumableArray2["default"])(mainPos)); var beginPos = maxPos; if (changeIndex === 1) beginPos = minPos; @@ -16281,15 +16075,12 @@ var points = shape.points; var changeIndex = lineFillBottomPos.changeIndex, changeValue = lineFillBottomPos.changeValue; - - var linePoint1 = _toConsumableArray(points[points.length - 1]); - - var linePoint2 = _toConsumableArray(points[0]); - + var linePoint1 = (0, _toConsumableArray2["default"])(points[points.length - 1]); + var linePoint2 = (0, _toConsumableArray2["default"])(points[0]); linePoint1[changeIndex] = changeValue; linePoint2[changeIndex] = changeValue; - ctx.lineTo.apply(ctx, _toConsumableArray(linePoint1)); - ctx.lineTo.apply(ctx, _toConsumableArray(linePoint2)); + ctx.lineTo.apply(ctx, (0, _toConsumableArray2["default"])(linePoint1)); + ctx.lineTo.apply(ctx, (0, _toConsumableArray2["default"])(linePoint2)); ctx.closePath(); ctx.fill(); } @@ -16327,9 +16118,9 @@ if (pointsNum > graphPointsNum) { var lastPoint = graphPoints.slice(-1)[0]; var newAddPoints = new Array(pointsNum - graphPointsNum).fill(0).map(function (foo) { - return _toConsumableArray(lastPoint); + return (0, _toConsumableArray2["default"])(lastPoint); }); - graphPoints.push.apply(graphPoints, _toConsumableArray(newAddPoints)); + graphPoints.push.apply(graphPoints, (0, _toConsumableArray2["default"])(newAddPoints)); } else if (pointsNum < graphPointsNum) { graphPoints.splice(pointsNum); } @@ -16381,7 +16172,7 @@ if (lineDash) { realLineDash = [0, 0]; } else { - realLineDash = _toConsumableArray(realLineDash).reverse(); + realLineDash = (0, _toConsumableArray2["default"])(realLineDash).reverse(); } config.style.lineDash = realLineDash; @@ -16411,7 +16202,7 @@ var linePosition = lineItem.linePosition, radius = lineItem.linePoint.radius; return linePosition.map(function (_ref7) { - var _ref8 = _slicedToArray(_ref7, 2), + var _ref8 = (0, _slicedToArray2["default"])(_ref7, 2), rx = _ref8[0], ry = _ref8[1]; @@ -16479,13 +16270,12 @@ changeValue = lineFillBottomPos.changeValue; return linePosition.map(function (pos) { if (position === 'bottom') { - pos = _toConsumableArray(pos); + pos = (0, _toConsumableArray2["default"])(pos); pos[changeIndex] = changeValue; } if (position === 'center') { - var bottom = _toConsumableArray(pos); - + var bottom = (0, _toConsumableArray2["default"])(pos); bottom[changeIndex] = changeValue; pos = getCenterLabelPoint(pos, bottom); } @@ -16495,11 +16285,11 @@ } function getOffsetedPoint(_ref9, _ref10) { - var _ref11 = _slicedToArray(_ref9, 2), + var _ref11 = (0, _slicedToArray2["default"])(_ref9, 2), x = _ref11[0], y = _ref11[1]; - var _ref12 = _slicedToArray(_ref10, 2), + var _ref12 = (0, _slicedToArray2["default"])(_ref10, 2), ox = _ref12[0], oy = _ref12[1]; @@ -16507,11 +16297,11 @@ } function getCenterLabelPoint(_ref13, _ref14) { - var _ref15 = _slicedToArray(_ref13, 2), + var _ref15 = (0, _slicedToArray2["default"])(_ref13, 2), ax = _ref15[0], ay = _ref15[1]; - var _ref16 = _slicedToArray(_ref14, 2), + var _ref16 = (0, _slicedToArray2["default"])(_ref14, 2), bx = _ref16[0], by = _ref16[1]; @@ -16527,9 +16317,7 @@ return d.toString(); }); if (!formatter) return data; - - var type = _typeof(formatter); - + var type = (0, _typeof2["default"])(formatter); if (type === 'string') return data.map(function (d) { return formatter.replace('{value}', d); }); @@ -16552,98 +16340,36 @@ }); unwrapExports(line_1$1); - var line_2 = line_1$1.line; - - var SET = 'Set'; - - // 23.2 Set Objects - var es6_set = _collection(SET, function (get) { - return function Set() { return get(this, arguments.length > 0 ? arguments[0] : undefined); }; - }, { - // 23.2.3.1 Set.prototype.add(value) - add: function add(value) { - return _collectionStrong.def(_validateCollection(this, SET), value = value === 0 ? 0 : value, value); - } - }, _collectionStrong); - - var bar_1$1 = createCommonjsModule(function (module, exports) { - - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.bar = bar; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + var line_2 = line_1$1.line; + var bar_1$1 = createCommonjsModule(function (module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.bar = bar; + var _typeof2 = interopRequireDefault(_typeof_1); + var _defineProperty2 = interopRequireDefault(defineProperty); + var _slicedToArray2 = interopRequireDefault(slicedToArray); - function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + var _toConsumableArray2 = interopRequireDefault(toConsumableArray); - function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } - function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } - function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } - function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } - function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } - function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } - function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } - function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } + function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } - function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } + function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function bar(chart) { var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; @@ -16760,7 +16486,7 @@ index = _ref5$labelAxis.index; return axis + index; }); - labelAxis = _toConsumableArray(new Set(labelAxis)); + labelAxis = (0, _toConsumableArray2["default"])(new Set(labelAxis)); return labelAxis.map(function (axisIndex) { return bars.filter(function (_ref6) { var _ref6$labelAxis = _ref6.labelAxis, @@ -16777,15 +16503,14 @@ var stack = _ref7.stack; if (stack) stacks.push(stack); }); - return _toConsumableArray(new Set(stacks)); + return (0, _toConsumableArray2["default"])(new Set(stacks)); } function setBarNum(bars) { - var barNum = _toConsumableArray(new Set(bars.map(function (_ref8) { + var barNum = (0, _toConsumableArray2["default"])(new Set(bars.map(function (_ref8) { var barIndex = _ref8.barIndex; return barIndex; }))).length; - bars.forEach(function (bar) { return bar.barNum = barNum; }); @@ -16823,7 +16548,7 @@ } var _widthAndGap = widthAndGap, - _widthAndGap2 = _slicedToArray(_widthAndGap, 2), + _widthAndGap2 = (0, _slicedToArray2["default"])(_widthAndGap, 2), width = _widthAndGap2[0], gap = _widthAndGap2[1]; @@ -17101,7 +16826,7 @@ barWidth = barItem.barWidth, echelonOffset = barItem.echelonOffset; - var _barValueAxisPos$i = _slicedToArray(barValueAxisPos[i], 2), + var _barValueAxisPos$i = (0, _slicedToArray2["default"])(barValueAxisPos[i], 2), start = _barValueAxisPos$i[0], end = _barValueAxisPos$i[1]; @@ -17136,7 +16861,7 @@ barWidth = barItem.barWidth, echelonOffset = barItem.echelonOffset; - var _barValueAxisPos$i2 = _slicedToArray(barValueAxisPos[i], 2), + var _barValueAxisPos$i2 = (0, _slicedToArray2["default"])(barValueAxisPos[i], 2), start = _barValueAxisPos$i2[0], end = _barValueAxisPos$i2[1]; @@ -17170,7 +16895,7 @@ barLabelAxisPos = barItem.barLabelAxisPos, barWidth = barItem.barWidth; - var _barValueAxisPos$i3 = _slicedToArray(barValueAxisPos[i], 2), + var _barValueAxisPos$i3 = (0, _slicedToArray2["default"])(barValueAxisPos[i], 2), start = _barValueAxisPos$i3[0], end = _barValueAxisPos$i3[1]; @@ -17196,9 +16921,17 @@ function getBarStyle(barItem, i) { var barStyle = barItem.barStyle, gradient = barItem.gradient, - color = barItem.color; + color = barItem.color, + independentColor = barItem.independentColor, + independentColors = barItem.independentColors; var fillColor = [barStyle.fill || color]; var gradientColor = (0, util$1.deepMerge)(fillColor, gradient.color); + + if (independentColor) { + var idtColor = independentColors[i % independentColors.length]; + gradientColor = idtColor instanceof Array ? idtColor : [idtColor]; + } + if (gradientColor.length === 1) gradientColor.push(gradientColor[0]); var gradientParams = getGradientParams(barItem, i); return (0, util$1.deepMerge)({ @@ -17217,14 +16950,14 @@ linePosition = _barItem$valueAxis.linePosition, axis = _barItem$valueAxis.axis; - var _barValueAxisPos$i4 = _slicedToArray(barValueAxisPos[i], 2), + var _barValueAxisPos$i4 = (0, _slicedToArray2["default"])(barValueAxisPos[i], 2), start = _barValueAxisPos$i4[0], end = _barValueAxisPos$i4[1]; var labelAxisPos = barLabelAxisPos[i]; var value = data[i]; - var _linePosition = _slicedToArray(linePosition, 2), + var _linePosition = (0, _slicedToArray2["default"])(linePosition, 2), lineStart = _linePosition[0], lineEnd = _linePosition[1]; @@ -17361,9 +17094,7 @@ return d.toString(); }); if (!formatter) return data; - - var type = _typeof(formatter); - + var type = (0, _typeof2["default"])(formatter); if (type === 'string') return data.map(function (d) { return formatter.replace('{value}', d); }); @@ -17384,7 +17115,7 @@ offset = label.offset; var axis = barItem.valueAxis.axis; return barValueAxisPos.map(function (_ref10, i) { - var _ref11 = _slicedToArray(_ref10, 2), + var _ref11 = (0, _slicedToArray2["default"])(_ref10, 2), start = _ref11[0], end = _ref11[1]; @@ -17405,11 +17136,11 @@ } function getOffsetedPoint(_ref12, _ref13) { - var _ref14 = _slicedToArray(_ref12, 2), + var _ref14 = (0, _slicedToArray2["default"])(_ref12, 2), x = _ref14[0], y = _ref14[1]; - var _ref15 = _slicedToArray(_ref13, 2), + var _ref15 = (0, _slicedToArray2["default"])(_ref13, 2), ox = _ref15[0], oy = _ref15[1]; @@ -17433,14 +17164,20 @@ var pie_1$1 = createCommonjsModule(function (module, exports) { + + Object.defineProperty(exports, "__esModule", { value: true }); exports.pie = pie; + var _defineProperty2 = interopRequireDefault(defineProperty); + var _typeof2 = interopRequireDefault(_typeof_1); + var _slicedToArray2 = interopRequireDefault(slicedToArray); + var _toConsumableArray2 = interopRequireDefault(toConsumableArray); @@ -17450,61 +17187,9 @@ + function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } - - function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - - function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - - function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } - - function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } - - function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } - - function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } - - function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } - - function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } - - function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } - - function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } + function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function pie(chart) { var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; @@ -17563,7 +17248,7 @@ } function calcPiesRadius(pies, chart) { - var maxRadius = Math.min.apply(Math, _toConsumableArray(chart.render.area)) / 2; + var maxRadius = Math.min.apply(Math, (0, _toConsumableArray2["default"])(chart.render.area)) / 2; pies.forEach(function (pie) { var radius = pie.radius, data = pie.data; @@ -17598,9 +17283,7 @@ data = pie.data, roseSort = pie.roseSort; var roseIncrement = getRoseIncrement(pie); - - var dataCopy = _toConsumableArray(data); - + var dataCopy = (0, _toConsumableArray2["default"])(data); data = sortData(data); data.forEach(function (item, i) { item.radius[1] = radius[1] - roseIncrement * i; @@ -17636,10 +17319,10 @@ var data = pie.data; var allRadius = data.reduce(function (all, _ref4) { var radius = _ref4.radius; - return [].concat(_toConsumableArray(all), _toConsumableArray(radius)); + return [].concat((0, _toConsumableArray2["default"])(all), (0, _toConsumableArray2["default"])(radius)); }, []); - var minRadius = Math.min.apply(Math, _toConsumableArray(allRadius)); - var maxRadius = Math.max.apply(Math, _toConsumableArray(allRadius)); + var minRadius = Math.min.apply(Math, (0, _toConsumableArray2["default"])(allRadius)); + var maxRadius = Math.max.apply(Math, (0, _toConsumableArray2["default"])(allRadius)); return (maxRadius - minRadius) * 0.6 / (data.length - 1 || 1); } @@ -17653,17 +17336,29 @@ var sum = getDataSum(data); data.forEach(function (item) { var value = item.value; - item.percent = parseFloat((value / sum * 100).toFixed(percentToFixed)); + item.percent = value / sum * 100; + item.percentForLabel = toFixedNoCeil(value / sum * 100, percentToFixed); }); var percentSumNoLast = (0, util$1.mulAdd)(data.slice(0, -1).map(function (_ref5) { var percent = _ref5.percent; return percent; })); data.slice(-1)[0].percent = 100 - percentSumNoLast; + data.slice(-1)[0].percentForLabel = toFixedNoCeil(100 - percentSumNoLast, percentToFixed); }); return pies; } + function toFixedNoCeil(number) { + var toFixed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + var stringNumber = number.toString(); + var splitedNumber = stringNumber.split('.'); + var decimal = splitedNumber[1] || '0'; + var fixedDecimal = decimal.slice(0, toFixed); + splitedNumber[1] = fixedDecimal; + return parseFloat(splitedNumber.join('.')); + } + function getDataSum(data) { return (0, util$1.mulAdd)(data.map(function (_ref6) { var value = _ref6.value; @@ -17677,7 +17372,7 @@ data = pie.data; data.forEach(function (item, i) { var _getDataAngle = getDataAngle(data, i), - _getDataAngle2 = _slicedToArray(_getDataAngle, 2), + _getDataAngle2 = (0, _slicedToArray2["default"])(_getDataAngle, 2), startAngle = _getDataAngle2[0], endAngle = _getDataAngle2[1]; @@ -17715,13 +17410,13 @@ var startAngle = dataItem.startAngle, endAngle = dataItem.endAngle, - _dataItem$radius = _slicedToArray(dataItem.radius, 2), + _dataItem$radius = (0, _slicedToArray2["default"])(dataItem.radius, 2), ir = _dataItem$radius[0], or = _dataItem$radius[1]; var radius = (ir + or) / 2; var angle = (startAngle + endAngle) / 2; - return util.getCircleRadianPoint.apply(void 0, _toConsumableArray(center).concat([radius, angle])); + return util.getCircleRadianPoint.apply(void 0, (0, _toConsumableArray2["default"])(center).concat([radius, angle])); } function calcPiesEdgeCenterPos(pies) { @@ -17734,7 +17429,7 @@ radius = item.radius; var centerAngle = (startAngle + endAngle) / 2; - var pos = util.getCircleRadianPoint.apply(void 0, _toConsumableArray(center).concat([radius[1], centerAngle])); + var pos = util.getCircleRadianPoint.apply(void 0, (0, _toConsumableArray2["default"])(center).concat([radius[1], centerAngle])); item.edgeCenterPos = pos; }); @@ -17768,13 +17463,13 @@ function getPieMaxRadius(pieItem) { var data = pieItem.data; var radius = data.map(function (_ref8) { - var _ref8$radius = _slicedToArray(_ref8.radius, 2), + var _ref8$radius = (0, _slicedToArray2["default"])(_ref8.radius, 2), foo = _ref8$radius[0], r = _ref8$radius[1]; return r; }); - return Math.max.apply(Math, _toConsumableArray(radius)); + return Math.max.apply(Math, (0, _toConsumableArray2["default"])(radius)); } function getLeftOrRightPieDataItems(pieItem) { @@ -17792,11 +17487,11 @@ function sortPiesFromTopToBottom(dataItem) { dataItem.sort(function (_ref10, _ref11) { - var _ref10$edgeCenterPos = _slicedToArray(_ref10.edgeCenterPos, 2), + var _ref10$edgeCenterPos = (0, _slicedToArray2["default"])(_ref10.edgeCenterPos, 2), t = _ref10$edgeCenterPos[0], ay = _ref10$edgeCenterPos[1]; - var _ref11$edgeCenterPos = _slicedToArray(_ref11.edgeCenterPos, 2), + var _ref11$edgeCenterPos = (0, _slicedToArray2["default"])(_ref11.edgeCenterPos, 2), tt = _ref11$edgeCenterPos[0], by = _ref11$edgeCenterPos[1]; @@ -17819,10 +17514,9 @@ var labelLineEndLength = outsideLabel.labelLineEndLength; var angle = (startAngle + endAngle) / 2; - var bendPoint = util.getCircleRadianPoint.apply(void 0, _toConsumableArray(center).concat([radius, angle])); - - var endPoint = _toConsumableArray(bendPoint); + var bendPoint = util.getCircleRadianPoint.apply(void 0, (0, _toConsumableArray2["default"])(center).concat([radius, angle])); + var endPoint = (0, _toConsumableArray2["default"])(bendPoint); endPoint[0] += labelLineEndLength * (left ? -1 : 1); item.labelLine = [edgeCenterPos, bendPoint, endPoint]; item.labelLineLength = (0, util$1.getPolylineLength)(item.labelLine); @@ -17917,14 +17611,12 @@ data = pieItem.data; var formatter = insideLabel.formatter; var dataItem = data[i]; - - var formatterType = _typeof(formatter); - + var formatterType = (0, _typeof2["default"])(formatter); var label = ''; if (formatterType === 'string') { label = formatter.replace('{name}', dataItem.name); - label = label.replace('{percent}', dataItem.percent); + label = label.replace('{percent}', dataItem.percentForLabel); label = label.replace('{value}', dataItem.value); } @@ -18023,16 +17715,14 @@ var _data$i = data[i], labelLine = _data$i.labelLine, name = _data$i.name, - percent = _data$i.percent, + percentForLabel = _data$i.percentForLabel, value = _data$i.value; - - var formatterType = _typeof(formatter); - + var formatterType = (0, _typeof2["default"])(formatter); var label = ''; if (formatterType === 'string') { label = formatter.replace('{name}', name); - label = label.replace('{percent}', percent); + label = label.replace('{percent}', percentForLabel); label = label.replace('{value}', value); } @@ -18064,13 +17754,18 @@ var radarAxis_1$1 = createCommonjsModule(function (module, exports) { + + Object.defineProperty(exports, "__esModule", { value: true }); exports.radarAxis = radarAxis; + var _slicedToArray2 = interopRequireDefault(slicedToArray); + var _defineProperty2 = interopRequireDefault(defineProperty); + var _toConsumableArray2 = interopRequireDefault(toConsumableArray); @@ -18080,56 +17775,9 @@ + function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } - - function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } - - function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } - - function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } - - function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } - - function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - - function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } - - function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } - - function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } - - function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } + function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function radarAxis(chart) { var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; @@ -18197,7 +17845,7 @@ var area = chart.render.area; var splitNum = radarAxis.splitNum, radius = radarAxis.radius; - var maxRadius = Math.min.apply(Math, _toConsumableArray(area)) / 2; + var maxRadius = Math.min.apply(Math, (0, _toConsumableArray2["default"])(area)) / 2; if (typeof radius !== 'number') radius = parseInt(radius) / 100 * maxRadius; var splitGap = radius / splitNum; radarAxis.ringRadius = new Array(splitNum).fill(0).map(function (foo, i) { @@ -18220,7 +17868,7 @@ }); radarAxis.axisLineAngles = angles; radarAxis.axisLinePosition = angles.map(function (g) { - return util.getCircleRadianPoint.apply(void 0, _toConsumableArray(centerPos).concat([radius, g])); + return util.getCircleRadianPoint.apply(void 0, (0, _toConsumableArray2["default"])(centerPos).concat([radius, g])); }); return radarAxis; } @@ -18241,7 +17889,7 @@ axisLabel = radarAxis.axisLabel; radius += axisLabel.labelGap; radarAxis.axisLabelPosition = axisLineAngles.map(function (angle) { - return util.getCircleRadianPoint.apply(void 0, _toConsumableArray(centerPos).concat([radius, angle])); + return util.getCircleRadianPoint.apply(void 0, (0, _toConsumableArray2["default"])(centerPos).concat([radius, angle])); }); return radarAxis; } @@ -18295,9 +17943,9 @@ var lineWidth = ringRadius[0] - 0; if (polygon) { - var point1 = util.getCircleRadianPoint.apply(void 0, _toConsumableArray(centerPos).concat([ringRadius[0], axisLineAngles[0]])); + var point1 = util.getCircleRadianPoint.apply(void 0, (0, _toConsumableArray2["default"])(centerPos).concat([ringRadius[0], axisLineAngles[0]])); - var point2 = util.getCircleRadianPoint.apply(void 0, _toConsumableArray(centerPos).concat([ringRadius[0], axisLineAngles[1]])); + var point2 = util.getCircleRadianPoint.apply(void 0, (0, _toConsumableArray2["default"])(centerPos).concat([ringRadius[0], axisLineAngles[1]])); lineWidth = (0, util$1.getPointToLineDistance)(centerPos, point1, point2); } @@ -18470,7 +18118,7 @@ function getAxisLableStyle(radarAxis, i) { var axisLabel = radarAxis.axisLabel, - _radarAxis$centerPos = _slicedToArray(radarAxis.centerPos, 2), + _radarAxis$centerPos = (0, _slicedToArray2["default"])(radarAxis.centerPos, 2), x = _radarAxis$centerPos[0], y = _radarAxis$centerPos[1], axisLabelPosition = radarAxis.axisLabelPosition; @@ -18478,7 +18126,7 @@ var color = axisLabel.color, style = axisLabel.style; - var _axisLabelPosition$i = _slicedToArray(axisLabelPosition[i], 2), + var _axisLabelPosition$i = (0, _slicedToArray2["default"])(axisLabelPosition[i], 2), labelXpos = _axisLabelPosition$i[0], labelYPos = _axisLabelPosition$i[1]; @@ -18501,14 +18149,20 @@ var radar_1$1 = createCommonjsModule(function (module, exports) { + + Object.defineProperty(exports, "__esModule", { value: true }); exports.radar = radar; + var _defineProperty2 = interopRequireDefault(defineProperty); + var _typeof2 = interopRequireDefault(_typeof_1); + var _slicedToArray2 = interopRequireDefault(slicedToArray); + var _toConsumableArray2 = interopRequireDefault(toConsumableArray); @@ -18520,57 +18174,9 @@ + function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } - - function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - - function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - - function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } - - function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } - - function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } - - function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } - - function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } - - function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } - - function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } - - function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } + function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function radar(chart) { var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; @@ -18622,7 +18228,7 @@ if (typeof v !== 'number') v = min; var dataRadius = (v - min) / (max - min) * radius; radarItem.dataRadius[i] = dataRadius; - return util.getCircleRadianPoint.apply(void 0, _toConsumableArray(centerPos).concat([dataRadius, axisLineAngles[i]])); + return util.getCircleRadianPoint.apply(void 0, (0, _toConsumableArray2["default"])(centerPos).concat([dataRadius, axisLineAngles[i]])); }); }); return radars; @@ -18638,7 +18244,7 @@ label = radarItem.label; var labelGap = label.labelGap; radarItem.labelPosition = dataRadius.map(function (r, i) { - return util.getCircleRadianPoint.apply(void 0, _toConsumableArray(centerPos).concat([r + labelGap, axisLineAngles[i]])); + return util.getCircleRadianPoint.apply(void 0, (0, _toConsumableArray2["default"])(centerPos).concat([r + labelGap, axisLineAngles[i]])); }); }); return radars; @@ -18648,14 +18254,14 @@ var radarAxis = chart.radarAxis; if (!radarAxis) return []; - var _radarAxis$centerPos = _slicedToArray(radarAxis.centerPos, 2), + var _radarAxis$centerPos = (0, _slicedToArray2["default"])(radarAxis.centerPos, 2), x = _radarAxis$centerPos[0], y = _radarAxis$centerPos[1]; radars.forEach(function (radarItem) { var labelPosition = radarItem.labelPosition; var labelAlign = labelPosition.map(function (_ref2) { - var _ref3 = _slicedToArray(_ref2, 2), + var _ref3 = (0, _slicedToArray2["default"])(_ref2, 2), lx = _ref3[0], ly = _ref3[1]; @@ -18690,7 +18296,7 @@ var config = getRadarConfig(radarItem)[0]; var pointNum = config.shape.points.length; var points = new Array(pointNum).fill(0).map(function (foo) { - return _toConsumableArray(centerPos); + return (0, _toConsumableArray2["default"])(centerPos); }); config.shape.points = points; return [config]; @@ -18725,9 +18331,9 @@ if (pointsNum > graphPointsNum) { var lastPoint = graphPoints.slice(-1)[0]; var newAddPoints = new Array(pointsNum - graphPointsNum).fill(0).map(function (foo) { - return _toConsumableArray(lastPoint); + return (0, _toConsumableArray2["default"])(lastPoint); }); - graphPoints.push.apply(graphPoints, _toConsumableArray(newAddPoints)); + graphPoints.push.apply(graphPoints, (0, _toConsumableArray2["default"])(newAddPoints)); } else if (pointsNum < graphPointsNum) { graphPoints.splice(pointsNum); } @@ -18806,9 +18412,7 @@ formatter = label.formatter; var position = mergePointOffset(labelPosition[i], offset); var labelText = data[i] ? data[i].toString() : '0'; - - var formatterType = _typeof(formatter); - + var formatterType = (0, _typeof2["default"])(formatter); if (formatterType === 'string') labelText = formatter.replace('{value}', labelText); if (formatterType === 'function') labelText = formatter(labelText); return { @@ -18818,11 +18422,11 @@ } function mergePointOffset(_ref5, _ref6) { - var _ref7 = _slicedToArray(_ref5, 2), + var _ref7 = (0, _slicedToArray2["default"])(_ref5, 2), x = _ref7[0], y = _ref7[1]; - var _ref8 = _slicedToArray(_ref6, 2), + var _ref8 = (0, _slicedToArray2["default"])(_ref6, 2), ox = _ref8[0], oy = _ref8[1]; @@ -18848,14 +18452,20 @@ var gauge_1$1 = createCommonjsModule(function (module, exports) { + + Object.defineProperty(exports, "__esModule", { value: true }); exports.gauge = gauge$1; + var _defineProperty2 = interopRequireDefault(defineProperty); + var _typeof2 = interopRequireDefault(_typeof_1); + var _slicedToArray2 = interopRequireDefault(slicedToArray); + var _toConsumableArray2 = interopRequireDefault(toConsumableArray); @@ -18867,59 +18477,9 @@ + function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } - - function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - - function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - - function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } - - function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } - - function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } - - function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } - - function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } - - function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } - - function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } - - function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } + function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function gauge$1(chart) { var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; @@ -18993,7 +18553,7 @@ function calcGaugesRadius(gauges, chart) { var area = chart.render.area; - var maxRadius = Math.min.apply(Math, _toConsumableArray(area)) / 2; + var maxRadius = Math.min.apply(Math, (0, _toConsumableArray2["default"])(area)) / 2; gauges.forEach(function (gaugeItem) { var radius = gaugeItem.radius; @@ -19008,7 +18568,7 @@ function calcGaugesDataRadiusAndLineWidth(gauges, chart) { var area = chart.render.area; - var maxRadius = Math.min.apply(Math, _toConsumableArray(area)) / 2; + var maxRadius = Math.min.apply(Math, (0, _toConsumableArray2["default"])(area)) / 2; gauges.forEach(function (gaugeItem) { var radius = gaugeItem.radius, data = gaugeItem.data, @@ -19084,7 +18644,7 @@ if (i === splitNum - 1) angle -= offset; gaugeItem.tickAngles[i] = angle; gaugeItem.tickInnerRadius[i] = innerRadius; - return [util.getCircleRadianPoint.apply(void 0, _toConsumableArray(center).concat([outerRadius, angle])), util.getCircleRadianPoint.apply(void 0, _toConsumableArray(center).concat([innerRadius, angle]))]; + return [util.getCircleRadianPoint.apply(void 0, (0, _toConsumableArray2["default"])(center).concat([outerRadius, angle])), util.getCircleRadianPoint.apply(void 0, (0, _toConsumableArray2["default"])(center).concat([innerRadius, angle]))]; }); }); return gauges; @@ -19097,10 +18657,10 @@ tickAngles = gaugeItem.tickAngles, labelGap = gaugeItem.axisLabel.labelGap; var position = tickAngles.map(function (angle, i) { - return util.getCircleRadianPoint.apply(void 0, _toConsumableArray(center).concat([tickInnerRadius[i] - labelGap, tickAngles[i]])); + return util.getCircleRadianPoint.apply(void 0, (0, _toConsumableArray2["default"])(center).concat([tickInnerRadius[i] - labelGap, tickAngles[i]])); }); var align = position.map(function (_ref) { - var _ref2 = _slicedToArray(_ref, 2), + var _ref2 = (0, _slicedToArray2["default"])(_ref, 2), x = _ref2[0], y = _ref2[1]; @@ -19127,9 +18687,7 @@ var value = new Array(splitNum).fill(0).map(function (foo, i) { return parseInt(min + valueGap * i); }); - - var formatterType = _typeof(formatter); - + var formatterType = (0, _typeof2["default"])(formatter); data = (0, util$1.deepMerge)(value, data).map(function (v, i) { var label = v; @@ -19167,9 +18725,9 @@ if (position === 'center') { point = center; } else if (position === 'start') { - point = util.getCircleRadianPoint.apply(void 0, _toConsumableArray(center).concat([radius, startAngle])); + point = util.getCircleRadianPoint.apply(void 0, (0, _toConsumableArray2["default"])(center).concat([radius, startAngle])); } else if (position === 'end') { - point = util.getCircleRadianPoint.apply(void 0, _toConsumableArray(center).concat([radius, endAngle])); + point = util.getCircleRadianPoint.apply(void 0, (0, _toConsumableArray2["default"])(center).concat([radius, endAngle])); } return getOffsetedPoint(point, offset); @@ -19184,9 +18742,7 @@ var data = gaugeItem.data, details = gaugeItem.details; var formatter = details.formatter; - - var formatterType = _typeof(formatter); - + var formatterType = (0, _typeof2["default"])(formatter); var contents = data.map(function (dataItem) { var content = dataItem.value; @@ -19204,11 +18760,11 @@ } function getOffsetedPoint(_ref4, _ref5) { - var _ref6 = _slicedToArray(_ref4, 2), + var _ref6 = (0, _slicedToArray2["default"])(_ref4, 2), x = _ref6[0], y = _ref6[1]; - var _ref7 = _slicedToArray(_ref5, 2), + var _ref7 = (0, _slicedToArray2["default"])(_ref5, 2), ox = _ref7[0], oy = _ref7[1]; @@ -19399,8 +18955,8 @@ graphGradient.splice(needNum); } else { var last = graphGradient.slice(-1)[0]; - graphGradient.push.apply(graphGradient, _toConsumableArray(new Array(needNum - cacheNum).fill(0).map(function (foo) { - return _toConsumableArray(last); + graphGradient.push.apply(graphGradient, (0, _toConsumableArray2["default"])(new Array(needNum - cacheNum).fill(0).map(function (foo) { + return (0, _toConsumableArray2["default"])(last); }))); } } @@ -19452,7 +19008,7 @@ } function getPointerPoints(_ref8) { - var _ref9 = _slicedToArray(_ref8, 2), + var _ref9 = (0, _slicedToArray2["default"])(_ref8, 2), x = _ref9[0], y = _ref9[1]; @@ -19522,13 +19078,18 @@ var legend_1$1 = createCommonjsModule(function (module, exports) { + + Object.defineProperty(exports, "__esModule", { value: true }); exports.legend = legend; + var _defineProperty2 = interopRequireDefault(defineProperty); + var _slicedToArray2 = interopRequireDefault(slicedToArray); + var _typeof2 = interopRequireDefault(_typeof_1); @@ -19538,39 +19099,6 @@ - - - - - - - - - - - - - - - - - - - - - - function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - - function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } - - function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } - - function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } - - function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } - - function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - function legend(chart) { var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var legend = option.legend; @@ -19603,7 +19131,7 @@ function initLegendData(legend) { var data = legend.data; legend.data = data.map(function (item) { - var itemType = _typeof(item); + var itemType = (0, _typeof2["default"])(item); if (itemType === 'string') { return { @@ -19789,11 +19317,11 @@ } function mergeOffset(_ref4, _ref5) { - var _ref6 = _slicedToArray(_ref4, 2), + var _ref6 = (0, _slicedToArray2["default"])(_ref4, 2), x = _ref6[0], y = _ref6[1]; - var _ref7 = _slicedToArray(_ref5, 2), + var _ref7 = (0, _slicedToArray2["default"])(_ref5, 2), ox = _ref7[0], oy = _ref7[1]; @@ -19802,7 +19330,7 @@ function calcVerticalPosition(legend, chart) { var _getVerticalXOffset = getVerticalXOffset(legend, chart), - _getVerticalXOffset2 = _slicedToArray(_getVerticalXOffset, 2), + _getVerticalXOffset2 = (0, _slicedToArray2["default"])(_getVerticalXOffset, 2), isRight = _getVerticalXOffset2[0], xOffset = _getVerticalXOffset2[1]; @@ -19884,7 +19412,7 @@ animationFrame = legendItem.animationFrame, rLevel = legendItem.rLevel; return data.map(function (item, i) { - return _defineProperty({ + return (0, _defineProperty2["default"])({ name: item.icon === 'line' ? 'lineIcon' : 'rect', index: rLevel, visible: legendItem.show, @@ -19903,7 +19431,7 @@ iconWidth = legendItem.iconWidth, iconHeight = legendItem.iconHeight; - var _data$i$iconPosition = _slicedToArray(data[i].iconPosition, 2), + var _data$i$iconPosition = (0, _slicedToArray2["default"])(data[i].iconPosition, 2), x = _data$i$iconPosition[0], y = _data$i$iconPosition[1]; @@ -19977,7 +19505,7 @@ var _legendItem$data$i3 = legendItem.data[i], status = _legendItem$data$i3.status, - _legendItem$data$i3$t = _slicedToArray(_legendItem$data$i3.textPosition, 2), + _legendItem$data$i3$t = (0, _slicedToArray2["default"])(_legendItem$data$i3.textPosition, 2), x = _legendItem$data$i3$t[0], y = _legendItem$data$i3$t[1], textWidth = _legendItem$data$i3.textWidth; @@ -20010,8 +19538,6 @@ var core = createCommonjsModule(function (module, exports) { - - Object.defineProperty(exports, "__esModule", { value: true }); @@ -20089,33 +19615,25 @@ - - - - Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = void 0; + var _typeof2 = interopRequireDefault(_typeof_1); + var _classCallCheck2 = interopRequireDefault(classCallCheck); - var _cRender = _interopRequireDefault(lib$3); - - - + var _cRender = interopRequireDefault(lib$3); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var Charts = function Charts(dom) { - _classCallCheck(this, Charts); + (0, _classCallCheck2["default"])(this, Charts); if (!dom) { console.error('Charts Missing parameters!'); @@ -20139,6 +19657,7 @@ /** * @description Set chart option * @param {Object} option Chart option + * @param {Boolean} animationEnd Execute animationEnd * @return {Undefined} No return */ @@ -20146,11 +19665,16 @@ exports["default"] = Charts; Charts.prototype.setOption = function (option) { - if (!option || _typeof(option) !== 'object') { + var animationEnd = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + + if (!option || (0, _typeof2["default"])(option) !== 'object') { console.error('setOption Missing parameters!'); return false; } + if (animationEnd) this.render.graphs.forEach(function (graph) { + return graph.animationEnd(); + }); var optionCloned = (0, util.deepClone)(option, true); (0, core.mergeColor)(this, optionCloned); (0, core.grid)(this, optionCloned); @@ -20203,12 +19727,10 @@ }); exports["default"] = void 0; - var _charts = _interopRequireDefault(charts_class); + var _charts = interopRequireDefault(charts_class); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - var _default = _charts["default"]; exports["default"] = _default; }); @@ -20216,7 +19738,7 @@ var Charts = unwrapExports(lib$4); // - var script$m = { + var script$r = { name: 'DvCharts', mixins: [autoResize], props: { @@ -20227,10 +19749,10 @@ }, data() { - const timestamp = Date.now(); + const id = uuid(); return { - ref: `charts-container-${timestamp}`, - chartRef: `chart-${timestamp}`, + ref: `charts-container-${id}`, + chartRef: `chart-${id}`, chart: null }; }, @@ -20243,7 +19765,7 @@ } = this; if (!chart) return; if (!option) option = {}; - chart.setOption(option); + chart.setOption(option, true); } }, @@ -20278,10 +19800,10 @@ }; /* script */ - const __vue_script__$m = script$m; + const __vue_script__$r = script$r; /* template */ - var __vue_render__$m = function() { + var __vue_render__$r = function() { var _vm = this; var _h = _vm.$createElement; var _c = _vm._self._c || _h; @@ -20289,42 +19811,46 @@ _c("div", { ref: _vm.chartRef, staticClass: "charts-canvas-container" }) ]) }; - var __vue_staticRenderFns__$m = []; - __vue_render__$m._withStripped = true; + var __vue_staticRenderFns__$r = []; + __vue_render__$r._withStripped = true; /* style */ - const __vue_inject_styles__$m = function (inject) { + const __vue_inject_styles__$r = function (inject) { if (!inject) return - inject("data-v-8faf9d84_0", { source: ".dv-charts-container {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-charts-container .charts-canvas-container {\n width: 100%;\n height: 100%;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd;AACA;EACE,WAAW;EACX,YAAY;AACd","file":"main.vue","sourcesContent":[".dv-charts-container {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-charts-container .charts-canvas-container {\n width: 100%;\n height: 100%;\n}\n"]}, media: undefined }); + inject("data-v-1f446fe6_0", { source: ".dv-charts-container {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-charts-container .charts-canvas-container {\n width: 100%;\n height: 100%;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd;AACA;EACE,WAAW;EACX,YAAY;AACd","file":"main.vue","sourcesContent":[".dv-charts-container {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-charts-container .charts-canvas-container {\n width: 100%;\n height: 100%;\n}\n"]}, media: undefined }); }; /* scoped */ - const __vue_scope_id__$m = undefined; + const __vue_scope_id__$r = undefined; /* module identifier */ - const __vue_module_identifier__$m = undefined; + const __vue_module_identifier__$r = undefined; /* functional template */ - const __vue_is_functional_template__$m = false; + const __vue_is_functional_template__$r = false; /* style inject SSR */ + /* style inject shadow dom */ + - var Charts$1 = normalizeComponent_1( - { render: __vue_render__$m, staticRenderFns: __vue_staticRenderFns__$m }, - __vue_inject_styles__$m, - __vue_script__$m, - __vue_scope_id__$m, - __vue_is_functional_template__$m, - __vue_module_identifier__$m, - browser, + const __vue_component__$r = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$r, staticRenderFns: __vue_staticRenderFns__$r }, + __vue_inject_styles__$r, + __vue_script__$r, + __vue_scope_id__$r, + __vue_is_functional_template__$r, + __vue_module_identifier__$r, + false, + createInjector, + undefined, undefined ); function charts (Vue) { - Vue.component(Charts$1.name, Charts$1); + Vue.component(__vue_component__$r.name, __vue_component__$r); } // - var script$n = { + var script$s = { name: 'DvDigitalFlop', props: { config: { @@ -20368,6 +19894,13 @@ */ textAlign: 'center', + /** + * @description rowGap + * @type {Number} + @default rowGap = 0 + */ + rowGap: 0, + /** * @description Text style configuration * @type {Object} {CRender Class Style} @@ -20377,6 +19910,12 @@ fill: '#3de7c9' }, + /** + * @description Number formatter + * @type {Null|Function} + */ + formatter: undefined, + /** * @description CRender animationCurve * @type {String} @@ -20459,7 +19998,9 @@ number, content, toFixed, - textAlign + textAlign, + rowGap, + formatter } = this.mergedConfig; const [w, h] = this.renderer.area; const position = [w / 2, h / 2]; @@ -20469,7 +20010,9 @@ number, content, toFixed, - position + position, + rowGap, + formatter }; }, @@ -20493,6 +20036,7 @@ graph, mergedConfig } = this; + graph.animationEnd(); mergeConfig(); if (!graph) return; const { @@ -20526,10 +20070,10 @@ }; /* script */ - const __vue_script__$n = script$n; + const __vue_script__$s = script$s; /* template */ - var __vue_render__$n = function() { + var __vue_render__$s = function() { var _vm = this; var _h = _vm.$createElement; var _c = _vm._self._c || _h; @@ -20537,41 +20081,45 @@ _c("canvas", { ref: "digital-flop" }) ]) }; - var __vue_staticRenderFns__$n = []; - __vue_render__$n._withStripped = true; + var __vue_staticRenderFns__$s = []; + __vue_render__$s._withStripped = true; /* style */ - const __vue_inject_styles__$n = function (inject) { + const __vue_inject_styles__$s = function (inject) { if (!inject) return - inject("data-v-ba7262c4_0", { source: ".dv-digital-flop canvas {\n width: 100%;\n height: 100%;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,WAAW;EACX,YAAY;AACd","file":"main.vue","sourcesContent":[".dv-digital-flop canvas {\n width: 100%;\n height: 100%;\n}\n"]}, media: undefined }); + inject("data-v-113591fb_0", { source: ".dv-digital-flop canvas {\n width: 100%;\n height: 100%;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,WAAW;EACX,YAAY;AACd","file":"main.vue","sourcesContent":[".dv-digital-flop canvas {\n width: 100%;\n height: 100%;\n}\n"]}, media: undefined }); }; /* scoped */ - const __vue_scope_id__$n = undefined; + const __vue_scope_id__$s = undefined; /* module identifier */ - const __vue_module_identifier__$n = undefined; + const __vue_module_identifier__$s = undefined; /* functional template */ - const __vue_is_functional_template__$n = false; + const __vue_is_functional_template__$s = false; /* style inject SSR */ + /* style inject shadow dom */ + - var DigitalFlop = normalizeComponent_1( - { render: __vue_render__$n, staticRenderFns: __vue_staticRenderFns__$n }, - __vue_inject_styles__$n, - __vue_script__$n, - __vue_scope_id__$n, - __vue_is_functional_template__$n, - __vue_module_identifier__$n, - browser, + const __vue_component__$s = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$s, staticRenderFns: __vue_staticRenderFns__$s }, + __vue_inject_styles__$s, + __vue_script__$s, + __vue_scope_id__$s, + __vue_is_functional_template__$s, + __vue_module_identifier__$s, + false, + createInjector, + undefined, undefined ); // - var script$o = { + var script$t = { name: 'DvActiveRingChart', components: { - dvDigitalFlop: DigitalFlop + dvDigitalFlop: __vue_component__$s }, props: { config: { @@ -20640,6 +20188,18 @@ fill: '#fff' }, + /** + * @description Digital flop toFixed + * @type {Number} + */ + digitalFlopToFixed: 0, + + /** + * @description Digital flop unit + * @type {String} + */ + digitalFlopUnit: '', + /** * @description CRender animationCurve * @type {String} @@ -20652,7 +20212,14 @@ * @type {String} * @default animationFrame = 50 */ - animationFrame: 50 + animationFrame: 50, + + /** + * @description showOriginValue + * @type {Boolean} + * @default showOriginValue = false + */ + showOriginValue: false }, mergedConfig: null, chart: null, @@ -20670,17 +20237,29 @@ if (!mergedConfig) return {}; const { digitalFlopStyle, - data + digitalFlopToFixed, + data, + showOriginValue, + digitalFlopUnit } = mergedConfig; const value = data.map(({ value }) => value); - const sum = value.reduce((all, v) => all + v, 0); - const percent = parseInt(value[activeIndex] / sum * 100); + let displayValue; + + if (showOriginValue) { + displayValue = value[activeIndex]; + } else { + const sum = value.reduce((all, v) => all + v, 0); + const percent = parseFloat(value[activeIndex] / sum * 100) || 0; + displayValue = percent; + } + return { - content: '{nt}%', - number: [percent], - style: digitalFlopStyle + content: showOriginValue ? `{nt}${digitalFlopUnit}` : `{nt}${digitalFlopUnit || '%'}`, + number: [displayValue], + style: digitalFlopStyle, + toFixed: digitalFlopToFixed }; }, @@ -20750,7 +20329,7 @@ ringAnimation } = this; const option = getRingOption(); - chart.setOption(option); + chart.setOption(option, true); ringAnimation(); }, @@ -20794,380 +20373,848 @@ return [insideRadius, outSideRadius]; }, - ringAnimation() { + ringAnimation() { + let { + activeIndex, + getRingOption, + chart, + getRealRadius + } = this; + const radius = getRealRadius(); + const active = getRealRadius(true); + const option = getRingOption(); + const { + data + } = option.series[0]; + data.forEach((dataItem, i) => { + if (i === activeIndex) { + dataItem.radius = active; + } else { + dataItem.radius = radius; + } + }); + chart.setOption(option, true); + const { + activeTimeGap + } = option.series[0]; + this.animationHandler = setTimeout(foo => { + activeIndex += 1; + if (activeIndex >= data.length) activeIndex = 0; + this.activeIndex = activeIndex; + this.ringAnimation(); + }, activeTimeGap); + } + + }, + + mounted() { + const { + init + } = this; + init(); + }, + + beforeDestroy() { + const { + animationHandler + } = this; + clearTimeout(animationHandler); + } + + }; + + /* script */ + const __vue_script__$t = script$t; + + /* template */ + var __vue_render__$t = function() { + var _vm = this; + var _h = _vm.$createElement; + var _c = _vm._self._c || _h; + return _c("div", { staticClass: "dv-active-ring-chart" }, [ + _c("div", { + ref: "active-ring-chart", + staticClass: "active-ring-chart-container" + }), + _vm._v(" "), + _c( + "div", + { staticClass: "active-ring-info" }, + [ + _c("dv-digital-flop", { attrs: { config: _vm.digitalFlop } }), + _vm._v(" "), + _c("div", { staticClass: "active-ring-name", style: _vm.fontSize }, [ + _vm._v(_vm._s(_vm.ringName)) + ]) + ], + 1 + ) + ]) + }; + var __vue_staticRenderFns__$t = []; + __vue_render__$t._withStripped = true; + + /* style */ + const __vue_inject_styles__$t = function (inject) { + if (!inject) return + inject("data-v-ca8abc0a_0", { source: ".dv-active-ring-chart {\n position: relative;\n}\n.dv-active-ring-chart .active-ring-chart-container {\n width: 100%;\n height: 100%;\n}\n.dv-active-ring-chart .active-ring-info {\n position: absolute;\n width: 100%;\n height: 100%;\n left: 0px;\n top: 0px;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n.dv-active-ring-chart .active-ring-info .dv-digital-flop {\n width: 100px;\n height: 30px;\n}\n.dv-active-ring-chart .active-ring-info .active-ring-name {\n width: 100px;\n height: 30px;\n color: #fff;\n text-align: center;\n vertical-align: middle;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;AACpB;AACA;EACE,WAAW;EACX,YAAY;AACd;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;EACZ,SAAS;EACT,QAAQ;EACR,aAAa;EACb,sBAAsB;EACtB,uBAAuB;EACvB,mBAAmB;AACrB;AACA;EACE,YAAY;EACZ,YAAY;AACd;AACA;EACE,YAAY;EACZ,YAAY;EACZ,WAAW;EACX,kBAAkB;EAClB,sBAAsB;EACtB,uBAAuB;EACvB,gBAAgB;EAChB,mBAAmB;AACrB","file":"main.vue","sourcesContent":[".dv-active-ring-chart {\n position: relative;\n}\n.dv-active-ring-chart .active-ring-chart-container {\n width: 100%;\n height: 100%;\n}\n.dv-active-ring-chart .active-ring-info {\n position: absolute;\n width: 100%;\n height: 100%;\n left: 0px;\n top: 0px;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n.dv-active-ring-chart .active-ring-info .dv-digital-flop {\n width: 100px;\n height: 30px;\n}\n.dv-active-ring-chart .active-ring-info .active-ring-name {\n width: 100px;\n height: 30px;\n color: #fff;\n text-align: center;\n vertical-align: middle;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n}\n"]}, media: undefined }); + + }; + /* scoped */ + const __vue_scope_id__$t = undefined; + /* module identifier */ + const __vue_module_identifier__$t = undefined; + /* functional template */ + const __vue_is_functional_template__$t = false; + /* style inject SSR */ + + /* style inject shadow dom */ + + + + const __vue_component__$t = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$t, staticRenderFns: __vue_staticRenderFns__$t }, + __vue_inject_styles__$t, + __vue_script__$t, + __vue_scope_id__$t, + __vue_is_functional_template__$t, + __vue_module_identifier__$t, + false, + createInjector, + undefined, + undefined + ); + + function activeRingChart (Vue) { + Vue.component(__vue_component__$t.name, __vue_component__$t); + } + + // + var script$u = { + name: 'DvCapsuleChart', + props: { + config: { + type: Object, + default: () => ({}) + } + }, + + data() { + return { + defaultConfig: { + /** + * @description Capsule chart data + * @type {Array} + * @default data = [] + * @example data = [{ name: 'foo1', value: 100 }, { name: 'foo2', value: 100 }] + */ + data: [], + + /** + * @description Colors (hex|rgb|rgba|color keywords) + * @type {Array} + * @default color = ['#37a2da', '#32c5e9', '#67e0e3', '#9fe6b8', '#ffdb5c', '#ff9f7f', '#fb7293'] + * @example color = ['#000', 'rgb(0, 0, 0)', 'rgba(0, 0, 0, 1)', 'red'] + */ + colors: ['#37a2da', '#32c5e9', '#67e0e3', '#9fe6b8', '#ffdb5c', '#ff9f7f', '#fb7293'], + + /** + * @description Chart unit + * @type {String} + * @default unit = '' + */ + unit: '', + + /** + * @description Show item value + * @type {Boolean} + * @default showValue = false + */ + showValue: false + }, + mergedConfig: null, + capsuleLength: [], + capsuleValue: [], + labelData: [], + labelDataLength: [] + }; + }, + + watch: { + config() { + const { + calcData + } = this; + calcData(); + } + + }, + methods: { + calcData() { + const { + mergeConfig, + calcCapsuleLengthAndLabelData + } = this; + mergeConfig(); + calcCapsuleLengthAndLabelData(); + }, + + mergeConfig() { let { - activeIndex, - getRingOption, - chart, - getRealRadius + config, + defaultConfig } = this; - const radius = getRealRadius(); - const active = getRealRadius(true); - const option = getRingOption(); + this.mergedConfig = util_2$1(util_1(defaultConfig, true), config || {}); + }, + + calcCapsuleLengthAndLabelData() { const { data - } = option.series[0]; - data.forEach((dataItem, i) => { - if (i === activeIndex) { - dataItem.radius = active; - } else { - dataItem.radius = radius; - } - }); - chart.setOption(option); - const { - activeTimeGap - } = option.series[0]; - this.animationHandler = setTimeout(foo => { - activeIndex += 1; - if (activeIndex >= data.length) activeIndex = 0; - this.activeIndex = activeIndex; - this.ringAnimation(); - }, activeTimeGap); + } = this.mergedConfig; + if (!data.length) return; + const capsuleValue = data.map(({ + value + }) => value); + const maxValue = Math.max(...capsuleValue); + this.capsuleValue = capsuleValue; + this.capsuleLength = capsuleValue.map(v => maxValue ? v / maxValue : 0); + const oneFifth = maxValue / 5; + const labelData = Array.from(new Set(new Array(6).fill(0).map((v, i) => Math.ceil(i * oneFifth)))); + this.labelData = labelData; + this.labelDataLength = Array.from(labelData).map(v => maxValue ? v / maxValue : 0); } }, mounted() { const { - init - } = this; - init(); - }, - - beforeDestroy() { - const { - animationHandler + calcData } = this; - clearTimeout(animationHandler); + calcData(); } }; /* script */ - const __vue_script__$o = script$o; + const __vue_script__$u = script$u; /* template */ - var __vue_render__$o = function() { + var __vue_render__$u = function() { var _vm = this; var _h = _vm.$createElement; var _c = _vm._self._c || _h; - return _c("div", { staticClass: "dv-active-ring-chart" }, [ - _c("div", { - ref: "active-ring-chart", - staticClass: "active-ring-chart-container" - }), - _vm._v(" "), - _c( - "div", - { staticClass: "active-ring-info" }, - [ - _c("dv-digital-flop", { attrs: { config: _vm.digitalFlop } }), - _vm._v(" "), - _c("div", { staticClass: "active-ring-name", style: _vm.fontSize }, [ - _vm._v(_vm._s(_vm.ringName)) - ]) - ], - 1 - ) - ]) + return _c( + "div", + { staticClass: "dv-capsule-chart" }, + [ + _vm.mergedConfig + ? [ + _c( + "div", + { staticClass: "label-column" }, + [ + _vm._l(_vm.mergedConfig.data, function(item) { + return _c("div", { key: item.name }, [ + _vm._v(_vm._s(item.name)) + ]) + }), + _vm._v(" "), + _c("div", [_vm._v(" ")]) + ], + 2 + ), + _vm._v(" "), + _c( + "div", + { staticClass: "capsule-container" }, + [ + _vm._l(_vm.capsuleLength, function(capsule, index) { + return _c( + "div", + { key: index, staticClass: "capsule-item" }, + [ + _c( + "div", + { + staticClass: "capsule-item-column", + style: + "width: " + + capsule * 100 + + "%; background-color: " + + _vm.mergedConfig.colors[ + index % _vm.mergedConfig.colors.length + ] + + ";" + }, + [ + _vm.mergedConfig.showValue + ? _c("div", { staticClass: "capsule-item-value" }, [ + _vm._v(_vm._s(_vm.capsuleValue[index])) + ]) + : _vm._e() + ] + ) + ] + ) + }), + _vm._v(" "), + _c( + "div", + { staticClass: "unit-label" }, + _vm._l(_vm.labelData, function(label, index) { + return _c("div", { key: label + index }, [ + _vm._v(_vm._s(label)) + ]) + }), + 0 + ) + ], + 2 + ), + _vm._v(" "), + _vm.mergedConfig.unit + ? _c("div", { staticClass: "unit-text" }, [ + _vm._v(_vm._s(_vm.mergedConfig.unit)) + ]) + : _vm._e() + ] + : _vm._e() + ], + 2 + ) }; - var __vue_staticRenderFns__$o = []; - __vue_render__$o._withStripped = true; + var __vue_staticRenderFns__$u = []; + __vue_render__$u._withStripped = true; /* style */ - const __vue_inject_styles__$o = function (inject) { + const __vue_inject_styles__$u = function (inject) { if (!inject) return - inject("data-v-fce58c90_0", { source: ".dv-active-ring-chart {\n position: relative;\n}\n.dv-active-ring-chart .active-ring-chart-container {\n width: 100%;\n height: 100%;\n}\n.dv-active-ring-chart .active-ring-info {\n position: absolute;\n width: 100%;\n height: 100%;\n left: 0px;\n top: 0px;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n.dv-active-ring-chart .active-ring-info .dv-digital-flop {\n width: 100px;\n height: 30px;\n}\n.dv-active-ring-chart .active-ring-info .active-ring-name {\n width: 100px;\n height: 30px;\n color: #fff;\n text-align: center;\n vertical-align: middle;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;AACpB;AACA;EACE,WAAW;EACX,YAAY;AACd;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;EACZ,SAAS;EACT,QAAQ;EACR,aAAa;EACb,sBAAsB;EACtB,uBAAuB;EACvB,mBAAmB;AACrB;AACA;EACE,YAAY;EACZ,YAAY;AACd;AACA;EACE,YAAY;EACZ,YAAY;EACZ,WAAW;EACX,kBAAkB;EAClB,sBAAsB;EACtB,uBAAuB;EACvB,gBAAgB;EAChB,mBAAmB;AACrB","file":"main.vue","sourcesContent":[".dv-active-ring-chart {\n position: relative;\n}\n.dv-active-ring-chart .active-ring-chart-container {\n width: 100%;\n height: 100%;\n}\n.dv-active-ring-chart .active-ring-info {\n position: absolute;\n width: 100%;\n height: 100%;\n left: 0px;\n top: 0px;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n.dv-active-ring-chart .active-ring-info .dv-digital-flop {\n width: 100px;\n height: 30px;\n}\n.dv-active-ring-chart .active-ring-info .active-ring-name {\n width: 100px;\n height: 30px;\n color: #fff;\n text-align: center;\n vertical-align: middle;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n}\n"]}, media: undefined }); + inject("data-v-6f678c1a_0", { source: ".dv-capsule-chart {\n position: relative;\n display: flex;\n flex-direction: row;\n box-sizing: border-box;\n padding: 10px;\n color: #fff;\n}\n.dv-capsule-chart .label-column {\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n box-sizing: border-box;\n padding-right: 10px;\n text-align: right;\n font-size: 12px;\n}\n.dv-capsule-chart .label-column div {\n height: 20px;\n line-height: 20px;\n}\n.dv-capsule-chart .capsule-container {\n flex: 1;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n}\n.dv-capsule-chart .capsule-item {\n box-shadow: 0 0 3px #999;\n height: 10px;\n margin: 5px 0px;\n border-radius: 5px;\n}\n.dv-capsule-chart .capsule-item .capsule-item-column {\n position: relative;\n height: 8px;\n margin-top: 1px;\n border-radius: 5px;\n transition: all 0.3s;\n display: flex;\n justify-content: flex-end;\n align-items: center;\n}\n.dv-capsule-chart .capsule-item .capsule-item-column .capsule-item-value {\n font-size: 12px;\n transform: translateX(100%);\n}\n.dv-capsule-chart .unit-label {\n height: 20px;\n font-size: 12px;\n position: relative;\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n.dv-capsule-chart .unit-text {\n text-align: right;\n display: flex;\n align-items: flex-end;\n font-size: 12px;\n line-height: 20px;\n margin-left: 10px;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,aAAa;EACb,mBAAmB;EACnB,sBAAsB;EACtB,aAAa;EACb,WAAW;AACb;AACA;EACE,aAAa;EACb,sBAAsB;EACtB,8BAA8B;EAC9B,sBAAsB;EACtB,mBAAmB;EACnB,iBAAiB;EACjB,eAAe;AACjB;AACA;EACE,YAAY;EACZ,iBAAiB;AACnB;AACA;EACE,OAAO;EACP,aAAa;EACb,sBAAsB;EACtB,8BAA8B;AAChC;AACA;EACE,wBAAwB;EACxB,YAAY;EACZ,eAAe;EACf,kBAAkB;AACpB;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,eAAe;EACf,kBAAkB;EAClB,oBAAoB;EACpB,aAAa;EACb,yBAAyB;EACzB,mBAAmB;AACrB;AACA;EACE,eAAe;EACf,2BAA2B;AAC7B;AACA;EACE,YAAY;EACZ,eAAe;EACf,kBAAkB;EAClB,aAAa;EACb,8BAA8B;EAC9B,mBAAmB;AACrB;AACA;EACE,iBAAiB;EACjB,aAAa;EACb,qBAAqB;EACrB,eAAe;EACf,iBAAiB;EACjB,iBAAiB;AACnB","file":"main.vue","sourcesContent":[".dv-capsule-chart {\n position: relative;\n display: flex;\n flex-direction: row;\n box-sizing: border-box;\n padding: 10px;\n color: #fff;\n}\n.dv-capsule-chart .label-column {\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n box-sizing: border-box;\n padding-right: 10px;\n text-align: right;\n font-size: 12px;\n}\n.dv-capsule-chart .label-column div {\n height: 20px;\n line-height: 20px;\n}\n.dv-capsule-chart .capsule-container {\n flex: 1;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n}\n.dv-capsule-chart .capsule-item {\n box-shadow: 0 0 3px #999;\n height: 10px;\n margin: 5px 0px;\n border-radius: 5px;\n}\n.dv-capsule-chart .capsule-item .capsule-item-column {\n position: relative;\n height: 8px;\n margin-top: 1px;\n border-radius: 5px;\n transition: all 0.3s;\n display: flex;\n justify-content: flex-end;\n align-items: center;\n}\n.dv-capsule-chart .capsule-item .capsule-item-column .capsule-item-value {\n font-size: 12px;\n transform: translateX(100%);\n}\n.dv-capsule-chart .unit-label {\n height: 20px;\n font-size: 12px;\n position: relative;\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n.dv-capsule-chart .unit-text {\n text-align: right;\n display: flex;\n align-items: flex-end;\n font-size: 12px;\n line-height: 20px;\n margin-left: 10px;\n}\n"]}, media: undefined }); }; /* scoped */ - const __vue_scope_id__$o = undefined; + const __vue_scope_id__$u = undefined; /* module identifier */ - const __vue_module_identifier__$o = undefined; + const __vue_module_identifier__$u = undefined; /* functional template */ - const __vue_is_functional_template__$o = false; + const __vue_is_functional_template__$u = false; /* style inject SSR */ + /* style inject shadow dom */ + - var ActiveRingChart = normalizeComponent_1( - { render: __vue_render__$o, staticRenderFns: __vue_staticRenderFns__$o }, - __vue_inject_styles__$o, - __vue_script__$o, - __vue_scope_id__$o, - __vue_is_functional_template__$o, - __vue_module_identifier__$o, - browser, + const __vue_component__$u = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$u, staticRenderFns: __vue_staticRenderFns__$u }, + __vue_inject_styles__$u, + __vue_script__$u, + __vue_scope_id__$u, + __vue_is_functional_template__$u, + __vue_module_identifier__$u, + false, + createInjector, + undefined, undefined ); - function activeRingChart (Vue) { - Vue.component(ActiveRingChart.name, ActiveRingChart); + function capsuleChart (Vue) { + Vue.component(__vue_component__$u.name, __vue_component__$u); } // - var script$p = { - name: 'DvCapsuleChart', + var script$v = { + name: 'DvWaterLevelPond', props: { - config: { - type: Object, - default: () => ({}) - } + config: Object, + default: () => ({}) }, data() { + const id = uuid(); return { + gradientId: `water-level-pond-${id}`, defaultConfig: { /** - * @description Capsule chart data - * @type {Array} + * @description Data + * @type {Array} * @default data = [] - * @example data = [{ name: 'foo1', value: 100 }, { name: 'foo2', value: 100 }] + * @example data = [60, 40] */ data: [], + /** + * @description Shape of wanter level pond + * @type {String} + * @default shape = 'rect' + * @example shape = 'rect' | 'roundRect' | 'round' + */ + shape: 'rect', + + /** + * @description Water wave number + * @type {Number} + * @default waveNum = 3 + */ + waveNum: 3, + + /** + * @description Water wave height (px) + * @type {Number} + * @default waveHeight = 40 + */ + waveHeight: 40, + + /** + * @description Wave opacity + * @type {Number} + * @default waveOpacity = 0.4 + */ + waveOpacity: 0.4, + /** * @description Colors (hex|rgb|rgba|color keywords) * @type {Array} - * @default color = ['#37a2da', '#32c5e9', '#67e0e3', '#9fe6b8', '#ffdb5c', '#ff9f7f', '#fb7293'] - * @example color = ['#000', 'rgb(0, 0, 0)', 'rgba(0, 0, 0, 1)', 'red'] + * @default colors = ['#00BAFF', '#3DE7C9'] + * @example colors = ['#000', 'rgb(0, 0, 0)', 'rgba(0, 0, 0, 1)', 'red'] */ - colors: ['#37a2da', '#32c5e9', '#67e0e3', '#9fe6b8', '#ffdb5c', '#ff9f7f', '#fb7293'], + colors: ['#3DE7C9', '#00BAFF'], + + /** + * @description Formatter + * @type {String} + * @default formatter = '{value}%' + */ + formatter: '{value}%' + }, + mergedConfig: {}, + renderer: null, + svgBorderGradient: [], + details: '', + waves: [], + animation: false + }; + }, + + computed: { + radius() { + const { + shape + } = this.mergedConfig; + if (shape === 'round') return '50%'; + if (shape === 'rect') return '0'; + if (shape === 'roundRect') return '10px'; + return '0'; + }, - /** - * @description Chart unit - * @type {String} - * @default unit = '' - */ - unit: '' - }, - mergedConfig: null, - capsuleLength: [], - labelData: [] - }; - }, + shape() { + const { + shape + } = this.mergedConfig; + if (!shape) return 'rect'; + return shape; + } + }, watch: { config() { const { - calcData + calcData, + renderer } = this; - calcData(); + renderer.delAllGraph(); + this.waves = []; + setTimeout(calcData, 0); } }, methods: { + init() { + const { + initRender, + config, + calcData + } = this; + initRender(); + if (!config) return; + calcData(); + }, + + initRender() { + const { + $refs + } = this; + this.renderer = new CRender($refs['water-pond-level']); + }, + calcData() { const { mergeConfig, - calcCapsuleLengthAndLabelData + calcSvgBorderGradient, + calcDetails } = this; mergeConfig(); - calcCapsuleLengthAndLabelData(); + calcSvgBorderGradient(); + calcDetails(); + const { + addWave, + animationWave + } = this; + addWave(); + animationWave(); }, mergeConfig() { - let { + const { config, defaultConfig } = this; - this.mergedConfig = util_2$1(util_1(defaultConfig, true), config || {}); + this.mergedConfig = util_2$1(util_1(defaultConfig, true), config); }, - calcCapsuleLengthAndLabelData() { + calcSvgBorderGradient() { const { - data + colors } = this.mergedConfig; - if (!data.length) return; - const capsuleValue = data.map(({ - value - }) => value); - const maxValue = Math.max(...capsuleValue); - this.capsuleLength = capsuleValue.map(v => maxValue ? v / maxValue : 0); - const oneFifth = maxValue / 5; - this.labelData = new Array(6).fill(0).map((v, i) => Math.ceil(i * oneFifth)); + const colorNum = colors.length; + const colorOffsetGap = 100 / (colorNum - 1); + this.svgBorderGradient = colors.map((c, i) => [colorOffsetGap * i, c]); + }, + + calcDetails() { + const { + data, + formatter + } = this.mergedConfig; + + if (!data.length) { + this.details = ''; + return; + } + + const maxValue = Math.max(...data); + this.details = formatter.replace('{value}', maxValue); + }, + + addWave() { + const { + renderer, + getWaveShapes, + getWaveStyle, + drawed + } = this; + const shapes = getWaveShapes(); + const style = getWaveStyle(); + this.waves = shapes.map(shape => renderer.add({ + name: 'smoothline', + animationFrame: 300, + shape, + style, + drawed + })); + }, + + getWaveShapes() { + const { + mergedConfig, + renderer, + mergeOffset + } = this; + const { + waveNum, + waveHeight, + data + } = mergedConfig; + const [w, h] = renderer.area; + const pointsNum = waveNum * 4 + 4; + const pointXGap = w / waveNum / 2; + return data.map(v => { + let points = new Array(pointsNum).fill(0).map((foo, j) => { + const x = w - pointXGap * j; + const startY = (1 - v / 100) * h; + const y = j % 2 === 0 ? startY : startY - waveHeight; + return [x, y]; + }); + points = points.map(p => mergeOffset(p, [pointXGap * 2, 0])); + return { + points + }; + }); + }, + + mergeOffset([x, y], [ox, oy]) { + return [x + ox, y + oy]; + }, + + getWaveStyle() { + const { + renderer, + mergedConfig + } = this; + const h = renderer.area[1]; + return { + gradientColor: mergedConfig.colors, + gradientType: 'linear', + gradientParams: [0, 0, 0, h], + gradientWith: 'fill', + opacity: mergedConfig.waveOpacity, + translate: [0, 0] + }; + }, + + drawed({ + shape: { + points + } + }, { + ctx, + area + }) { + const firstPoint = points[0]; + const lastPoint = points.slice(-1)[0]; + const h = area[1]; + ctx.lineTo(lastPoint[0], h); + ctx.lineTo(firstPoint[0], h); + ctx.closePath(); + ctx.fill(); + }, + + async animationWave(repeat = 1) { + const { + waves, + renderer, + animation + } = this; + if (animation) return; + this.animation = true; + const w = renderer.area[0]; + waves.forEach(graph => { + graph.attr('style', { + translate: [0, 0] + }); + graph.animation('style', { + translate: [w, 0] + }, true); + }); + await renderer.launchAnimation(); + this.animation = false; + if (!renderer.graphs.length) return; + this.animationWave(repeat + 1); } }, mounted() { const { - calcData + init } = this; - calcData(); + init(); + }, + + beforeDestroy() { + const { + renderer + } = this; + renderer.delAllGraph(); + this.waves = []; } }; /* script */ - const __vue_script__$p = script$p; + const __vue_script__$v = script$v; /* template */ - var __vue_render__$p = function() { + var __vue_render__$v = function() { var _vm = this; var _h = _vm.$createElement; var _c = _vm._self._c || _h; - return _c( - "div", - { staticClass: "dv-capsule-chart" }, - [ - _vm.mergedConfig - ? [ - _c( - "div", - { staticClass: "label-column" }, - [ - _vm._l(_vm.mergedConfig.data, function(item) { - return _c("div", { key: item.name }, [ - _vm._v(_vm._s(item.name)) - ]) - }), - _vm._v(" "), - _c("div", [_vm._v(" ")]) - ], - 2 - ), - _vm._v(" "), - _c( - "div", - { staticClass: "capsule-container" }, - [ - _vm._l(_vm.capsuleLength, function(capsule, index) { - return _c( - "div", - { key: index, staticClass: "capsule-item" }, - [ - _c("div", { - style: - "width: " + - capsule * 100 + - "%; background-color: " + - _vm.mergedConfig.colors[ - index % _vm.mergedConfig.colors.length - ] + - ";" - }) - ] - ) + return _c("div", { staticClass: "dv-water-pond-level" }, [ + _vm.renderer + ? _c("svg", [ + _c( + "defs", + [ + _c( + "linearGradient", + { + attrs: { + id: _vm.gradientId, + x1: "0%", + y1: "0%", + x2: "0%", + y2: "100%" + } + }, + _vm._l(_vm.svgBorderGradient, function(lc) { + return _c("stop", { + key: lc[0], + attrs: { offset: lc[0], "stop-color": lc[1] } + }) }), - _vm._v(" "), - _c( - "div", - { staticClass: "unit-label" }, - _vm._l(_vm.labelData, function(label, index) { - return _c("div", { key: label + index }, [ - _vm._v(_vm._s(label)) - ]) - }), - 0 - ) - ], - 2 - ), - _vm._v(" "), - _vm.mergedConfig.unit - ? _c("div", { staticClass: "unit-text" }, [ - _vm._v(_vm._s(_vm.mergedConfig.unit)) - ]) - : _vm._e() - ] - : _vm._e() - ], - 2 - ) + 1 + ) + ], + 1 + ), + _vm._v(" "), + _vm.renderer + ? _c( + "text", + { + attrs: { + stroke: "url(#" + _vm.gradientId + ")", + fill: "url(#" + _vm.gradientId + ")", + x: _vm.renderer.area[0] / 2 + 8, + y: _vm.renderer.area[1] / 2 + 8 + } + }, + [_vm._v("\n " + _vm._s(_vm.details) + "\n ")] + ) + : _vm._e(), + _vm._v(" "), + !_vm.shape || _vm.shape === "round" + ? _c("ellipse", { + attrs: { + cx: _vm.renderer.area[0] / 2 + 8, + cy: _vm.renderer.area[1] / 2 + 8, + rx: _vm.renderer.area[0] / 2 + 5, + ry: _vm.renderer.area[1] / 2 + 5, + stroke: "url(#" + _vm.gradientId + ")" + } + }) + : _c("rect", { + attrs: { + x: "2", + y: "2", + rx: _vm.shape === "roundRect" ? 10 : 0, + ry: _vm.shape === "roundRect" ? 10 : 0, + width: _vm.renderer.area[0] + 12, + height: _vm.renderer.area[1] + 12, + stroke: "url(#" + _vm.gradientId + ")" + } + }) + ]) + : _vm._e(), + _vm._v(" "), + _c("canvas", { + ref: "water-pond-level", + style: "border-radius: " + _vm.radius + ";" + }) + ]) }; - var __vue_staticRenderFns__$p = []; - __vue_render__$p._withStripped = true; + var __vue_staticRenderFns__$v = []; + __vue_render__$v._withStripped = true; /* style */ - const __vue_inject_styles__$p = function (inject) { + const __vue_inject_styles__$v = function (inject) { if (!inject) return - inject("data-v-7421b956_0", { source: ".dv-capsule-chart {\n position: relative;\n display: flex;\n flex-direction: row;\n box-sizing: border-box;\n padding: 10px;\n color: #fff;\n}\n.dv-capsule-chart .label-column {\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n box-sizing: border-box;\n padding-right: 10px;\n text-align: right;\n font-size: 12px;\n}\n.dv-capsule-chart .label-column div {\n height: 20px;\n line-height: 20px;\n}\n.dv-capsule-chart .capsule-container {\n flex: 1;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n}\n.dv-capsule-chart .capsule-item {\n box-shadow: 0 0 3px #999;\n height: 10px;\n margin: 5px 0px;\n border-radius: 5px;\n}\n.dv-capsule-chart .capsule-item div {\n height: 8px;\n margin-top: 1px;\n border-radius: 5px;\n transition: all 0.3s;\n}\n.dv-capsule-chart .unit-label {\n height: 20px;\n font-size: 12px;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n}\n.dv-capsule-chart .unit-text {\n text-align: right;\n display: flex;\n align-items: flex-end;\n font-size: 12px;\n line-height: 20px;\n margin-left: 10px;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,aAAa;EACb,mBAAmB;EACnB,sBAAsB;EACtB,aAAa;EACb,WAAW;AACb;AACA;EACE,aAAa;EACb,sBAAsB;EACtB,8BAA8B;EAC9B,sBAAsB;EACtB,mBAAmB;EACnB,iBAAiB;EACjB,eAAe;AACjB;AACA;EACE,YAAY;EACZ,iBAAiB;AACnB;AACA;EACE,OAAO;EACP,aAAa;EACb,sBAAsB;EACtB,8BAA8B;AAChC;AACA;EACE,wBAAwB;EACxB,YAAY;EACZ,eAAe;EACf,kBAAkB;AACpB;AACA;EACE,WAAW;EACX,eAAe;EACf,kBAAkB;EAClB,oBAAoB;AACtB;AACA;EACE,YAAY;EACZ,eAAe;EACf,aAAa;EACb,mBAAmB;EACnB,mBAAmB;EACnB,8BAA8B;AAChC;AACA;EACE,iBAAiB;EACjB,aAAa;EACb,qBAAqB;EACrB,eAAe;EACf,iBAAiB;EACjB,iBAAiB;AACnB","file":"main.vue","sourcesContent":[".dv-capsule-chart {\n position: relative;\n display: flex;\n flex-direction: row;\n box-sizing: border-box;\n padding: 10px;\n color: #fff;\n}\n.dv-capsule-chart .label-column {\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n box-sizing: border-box;\n padding-right: 10px;\n text-align: right;\n font-size: 12px;\n}\n.dv-capsule-chart .label-column div {\n height: 20px;\n line-height: 20px;\n}\n.dv-capsule-chart .capsule-container {\n flex: 1;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n}\n.dv-capsule-chart .capsule-item {\n box-shadow: 0 0 3px #999;\n height: 10px;\n margin: 5px 0px;\n border-radius: 5px;\n}\n.dv-capsule-chart .capsule-item div {\n height: 8px;\n margin-top: 1px;\n border-radius: 5px;\n transition: all 0.3s;\n}\n.dv-capsule-chart .unit-label {\n height: 20px;\n font-size: 12px;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n}\n.dv-capsule-chart .unit-text {\n text-align: right;\n display: flex;\n align-items: flex-end;\n font-size: 12px;\n line-height: 20px;\n margin-left: 10px;\n}\n"]}, media: undefined }); + inject("data-v-be672a2c_0", { source: ".dv-water-pond-level {\n position: relative;\n}\n.dv-water-pond-level svg {\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0px;\n left: 0px;\n}\n.dv-water-pond-level text {\n font-size: 25px;\n font-weight: bold;\n text-anchor: middle;\n dominant-baseline: middle;\n}\n.dv-water-pond-level ellipse,\n.dv-water-pond-level rect {\n fill: none;\n stroke-width: 3;\n}\n.dv-water-pond-level canvas {\n margin-top: 8px;\n margin-left: 8px;\n width: calc(100% - 16px);\n height: calc(100% - 16px);\n box-sizing: border-box;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;AACpB;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;EACZ,QAAQ;EACR,SAAS;AACX;AACA;EACE,eAAe;EACf,iBAAiB;EACjB,mBAAmB;EACnB,yBAAyB;AAC3B;AACA;;EAEE,UAAU;EACV,eAAe;AACjB;AACA;EACE,eAAe;EACf,gBAAgB;EAChB,wBAAwB;EACxB,yBAAyB;EACzB,sBAAsB;AACxB","file":"main.vue","sourcesContent":[".dv-water-pond-level {\n position: relative;\n}\n.dv-water-pond-level svg {\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0px;\n left: 0px;\n}\n.dv-water-pond-level text {\n font-size: 25px;\n font-weight: bold;\n text-anchor: middle;\n dominant-baseline: middle;\n}\n.dv-water-pond-level ellipse,\n.dv-water-pond-level rect {\n fill: none;\n stroke-width: 3;\n}\n.dv-water-pond-level canvas {\n margin-top: 8px;\n margin-left: 8px;\n width: calc(100% - 16px);\n height: calc(100% - 16px);\n box-sizing: border-box;\n}\n"]}, media: undefined }); }; /* scoped */ - const __vue_scope_id__$p = undefined; + const __vue_scope_id__$v = undefined; /* module identifier */ - const __vue_module_identifier__$p = undefined; + const __vue_module_identifier__$v = undefined; /* functional template */ - const __vue_is_functional_template__$p = false; + const __vue_is_functional_template__$v = false; /* style inject SSR */ + /* style inject shadow dom */ + - var CapsuleChart = normalizeComponent_1( - { render: __vue_render__$p, staticRenderFns: __vue_staticRenderFns__$p }, - __vue_inject_styles__$p, - __vue_script__$p, - __vue_scope_id__$p, - __vue_is_functional_template__$p, - __vue_module_identifier__$p, - browser, + const __vue_component__$v = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$v, staticRenderFns: __vue_staticRenderFns__$v }, + __vue_inject_styles__$v, + __vue_script__$v, + __vue_scope_id__$v, + __vue_is_functional_template__$v, + __vue_module_identifier__$v, + false, + createInjector, + undefined, undefined ); - function capsuleChart (Vue) { - Vue.component(CapsuleChart.name, CapsuleChart); + function waterLevelPond (Vue) { + Vue.component(__vue_component__$v.name, __vue_component__$v); } // - var script$q = { - name: 'DvWaterLevelPond', + var script$w = { + name: 'DvPercentPond', props: { - config: Object, - default: () => ({}) + config: { + type: Object, + default: () => ({}) + } }, data() { - const timestamp = Date.now(); + const id = uuid(); return { - gradientId: `water-level-pond-${timestamp}`, + gradientId1: `percent-pond-gradientId1-${id}`, + gradientId2: `percent-pond-gradientId2-${id}`, + width: 0, + height: 0, defaultConfig: { /** - * @description Data - * @type {Array} - * @default data = [] - * @example data = [60, 40] + * @description Value + * @type {Number} + * @default value = 0 */ - data: [], + value: 0, /** - * @description Shape of wanter level pond - * @type {String} - * @default shape = 'rect' - * @example shape = 'rect' | 'roundRect' | 'round' + * @description Colors (hex|rgb|rgba|color keywords) + * @type {Array} + * @default colors = ['#00BAFF', '#3DE7C9'] + * @example colors = ['#000', 'rgb(0, 0, 0)', 'rgba(0, 0, 0, 1)', 'red'] */ - shape: 'rect', + colors: ['#3DE7C9', '#00BAFF'], /** - * @description Water wave number + * @description Border width * @type {Number} - * @default waveNum = 3 + * @default borderWidth = 3 */ - waveNum: 3, + borderWidth: 3, /** - * @description Water wave height (px) + * @description Gap between border and pond * @type {Number} - * @default waveHeight = 40 + * @default borderGap = 3 */ - waveHeight: 40, + borderGap: 3, /** - * @description Wave opacity + * @description Line dash + * @type {Array} + * @default lineDash = [5, 1] + */ + lineDash: [5, 1], + + /** + * @description Text color + * @type {String} + * @default textColor = '#fff' + */ + textColor: '#fff', + + /** + * @description Border radius * @type {Number} - * @default waveOpacity = 0.4 + * @default borderRadius = 5 */ - waveOpacity: 0.4, + borderRadius: 5, /** - * @description Colors (hex|rgb|rgba|color keywords) - * @type {Array} - * @default colors = ['#00BAFF', '#3DE7C9'] - * @example colors = ['#000', 'rgb(0, 0, 0)', 'rgba(0, 0, 0, 1)', 'red'] + * @description Local Gradient + * @type {Boolean} + * @default localGradient = false + * @example localGradient = false | true */ - colors: ['#3DE7C9', '#00BAFF'], + localGradient: false, /** * @description Formatter @@ -21176,219 +21223,157 @@ */ formatter: '{value}%' }, - mergedConfig: {}, - renderer: null, - svgBorderGradient: [], - details: '', - waves: [], - animation: false + mergedConfig: null }; }, computed: { - radius() { + rectWidth() { const { - shape - } = this.mergedConfig; - if (shape === 'round') return '50%'; - if (shape === 'rect') return '0'; - if (shape === 'roundRect') return '10px'; - return '0'; - }, - - shape() { + mergedConfig, + width + } = this; + if (!mergedConfig) return 0; const { - shape - } = this.mergedConfig; - if (!shape) return 'rect'; - return shape; - } + borderWidth + } = mergedConfig; + return width - borderWidth; + }, - }, - watch: { - config() { + rectHeight() { const { - calcData, - renderer + mergedConfig, + height } = this; - renderer.delAllGraph(); - this.waves = []; - setTimeout(calcData, 0); - } - - }, - methods: { - init() { + if (!mergedConfig) return 0; const { - initRender, - config, - calcData - } = this; - initRender(); - if (!config) return; - calcData(); + borderWidth + } = mergedConfig; + return height - borderWidth; }, - initRender() { + points() { const { - $refs + mergedConfig, + width, + height } = this; - this.renderer = new CRender($refs['water-pond-level']); + const halfHeight = height / 2; + if (!mergedConfig) return `0, ${halfHeight} 0, ${halfHeight}`; + const { + borderWidth, + borderGap, + value + } = mergedConfig; + const polylineLength = (width - (borderWidth + borderGap) * 2) / 100 * value; + return ` + ${borderWidth + borderGap}, ${halfHeight} + ${borderWidth + borderGap + polylineLength}, ${halfHeight + 0.001} + `; }, - calcData() { + polylineWidth() { const { - mergeConfig, - calcSvgBorderGradient, - calcDetails + mergedConfig, + height } = this; - mergeConfig(); - calcSvgBorderGradient(); - calcDetails(); + if (!mergedConfig) return 0; const { - addWave, - animationWave - } = this; - addWave(); - animationWave(); + borderWidth, + borderGap + } = mergedConfig; + return height - (borderWidth + borderGap) * 2; }, - mergeConfig() { + linearGradient() { const { - config, - defaultConfig + mergedConfig } = this; - this.mergedConfig = util_2$1(util_1(defaultConfig, true), config); - }, - - calcSvgBorderGradient() { + if (!mergedConfig) return []; const { colors - } = this.mergedConfig; + } = mergedConfig; const colorNum = colors.length; const colorOffsetGap = 100 / (colorNum - 1); - this.svgBorderGradient = colors.map((c, i) => [colorOffsetGap * i, c]); + return colors.map((c, i) => [colorOffsetGap * i, c]); }, - calcDetails() { + polylineGradient() { const { - data, - formatter - } = this.mergedConfig; - - if (!data.length) { - this.details = ''; - return; - } - - const maxValue = Math.max(...data); - this.details = formatter.replace('{value}', maxValue); + gradientId1, + gradientId2, + mergedConfig + } = this; + if (!mergedConfig) return gradientId2; + if (mergedConfig.localGradient) return gradientId1; + return gradientId2; }, - addWave() { + gradient2XPos() { const { - renderer, - getWaveShapes, - getWaveStyle, - drawed + mergedConfig } = this; - const shapes = getWaveShapes(); - const style = getWaveStyle(); - this.waves = shapes.map(shape => renderer.add({ - name: 'smoothline', - animationFrame: 300, - shape, - style, - drawed - })); + if (!mergedConfig) return '100%'; + const { + value + } = mergedConfig; + return `${200 - value}%`; }, - getWaveShapes() { + details() { const { - mergedConfig, - renderer, - mergeOffset + mergedConfig } = this; + if (!mergedConfig) return ''; const { - waveNum, - waveHeight, - data + value, + formatter } = mergedConfig; - const [w, h] = renderer.area; - const pointsNum = waveNum * 4 + 4; - const pointXGap = w / waveNum / 2; - return data.map(v => { - let points = new Array(pointsNum).fill(0).map((foo, j) => { - const x = w - pointXGap * j; - const startY = (1 - v / 100) * h; - const y = j % 2 === 0 ? startY : startY - waveHeight; - return [x, y]; - }); - points = points.map(p => mergeOffset(p, [pointXGap * 2, 0])); - return { - points - }; - }); - }, + return formatter.replace('{value}', value); + } - mergeOffset([x, y], [ox, oy]) { - return [x + ox, y + oy]; - }, + }, + watch: { + config() { + const { + mergeConfig + } = this; + mergeConfig(); + } - getWaveStyle() { + }, + methods: { + async init() { const { - renderer, - mergedConfig + initWH, + config, + mergeConfig } = this; - const h = renderer.area[1]; - return { - gradientColor: mergedConfig.colors, - gradientType: 'linear', - gradientParams: [0, 0, 0, h], - gradientWith: 'fill', - opacity: mergedConfig.waveOpacity, - translate: [0, 0] - }; + await initWH(); + if (!config) return; + mergeConfig(); }, - drawed({ - shape: { - points - } - }, { - ctx, - area - }) { - const firstPoint = points[0]; - const lastPoint = points.slice(-1)[0]; - const h = area[1]; - ctx.lineTo(lastPoint[0], h); - ctx.lineTo(firstPoint[0], h); - ctx.closePath(); - ctx.fill(); + async initWH() { + const { + $nextTick, + $refs + } = this; + await $nextTick(); + const { + clientWidth, + clientHeight + } = $refs['percent-pond']; + this.width = clientWidth; + this.height = clientHeight; }, - async animationWave(repeat = 1) { + mergeConfig() { const { - waves, - renderer, - animation + config, + defaultConfig } = this; - if (animation) return; - this.animation = true; - const w = renderer.area[0]; - waves.forEach(graph => { - graph.attr('style', { - translate: [0, 0] - }); - graph.animation('style', { - translate: [w, 0] - }, true); - }); - await renderer.launchAnimation(); - this.animation = false; - if (!renderer.graphs.length) return; - this.animationWave(repeat + 1); + this.mergedConfig = util_2$1(util_1(defaultConfig, true), config || {}); } }, @@ -21398,511 +21383,868 @@ init } = this; init(); - }, - - beforeDestroy() { - const { - renderer - } = this; - renderer.delAllGraph(); - this.waves = []; } }; /* script */ - const __vue_script__$q = script$q; + const __vue_script__$w = script$w; /* template */ - var __vue_render__$q = function() { + var __vue_render__$w = function() { var _vm = this; var _h = _vm.$createElement; var _c = _vm._self._c || _h; - return _c("div", { staticClass: "dv-water-pond-level" }, [ - _vm.renderer - ? _c("svg", [ + return _c("div", { ref: "percent-pond", staticClass: "dv-percent-pond" }, [ + _c("svg", [ + _c( + "defs", + [ _c( - "defs", - [ - _c( - "linearGradient", - { - attrs: { - id: _vm.gradientId, - x1: "0%", - y1: "0%", - x2: "0%", - y2: "100%" - } - }, - _vm._l(_vm.svgBorderGradient, function(lc) { - return _c("stop", { - key: lc[0], - attrs: { offset: lc[0], "stop-color": lc[1] } - }) - }), - 1 - ) - ], - 1 - ), - _vm._v(" "), - _vm.renderer - ? _c( - "text", - { - attrs: { - stroke: "url(#" + _vm.gradientId + ")", - fill: "url(#" + _vm.gradientId + ")", - x: _vm.renderer.area[0] / 2 + 8, - y: _vm.renderer.area[1] / 2 + 8 - } - }, - [_vm._v("\n " + _vm._s(_vm.details) + "\n ")] - ) - : _vm._e(), - _vm._v(" "), - !_vm.shape || _vm.shape === "round" - ? _c("ellipse", { - attrs: { - cx: _vm.renderer.area[0] / 2 + 8, - cy: _vm.renderer.area[1] / 2 + 8, - rx: _vm.renderer.area[0] / 2 + 5, - ry: _vm.renderer.area[1] / 2 + 5, - stroke: "url(#" + _vm.gradientId + ")" - } + "linearGradient", + { + attrs: { + id: _vm.gradientId1, + x1: "0%", + y1: "0%", + x2: "100%", + y2: "0%" + } + }, + _vm._l(_vm.linearGradient, function(lc) { + return _c("stop", { + key: lc[0], + attrs: { offset: lc[0] + "%", "stop-color": lc[1] } }) - : _c("rect", { - attrs: { - x: "2", - y: "2", - rx: _vm.shape === "roundRect" ? 10 : 0, - ry: _vm.shape === "roundRect" ? 10 : 0, - width: _vm.renderer.area[0] + 12, - height: _vm.renderer.area[1] + 12, - stroke: "url(#" + _vm.gradientId + ")" - } + }), + 1 + ), + _vm._v(" "), + _c( + "linearGradient", + { + attrs: { + id: _vm.gradientId2, + x1: "0%", + y1: "0%", + x2: _vm.gradient2XPos, + y2: "0%" + } + }, + _vm._l(_vm.linearGradient, function(lc) { + return _c("stop", { + key: lc[0], + attrs: { offset: lc[0] + "%", "stop-color": lc[1] } }) - ]) - : _vm._e(), - _vm._v(" "), - _c("canvas", { - ref: "water-pond-level", - style: "border-radius: " + _vm.radius + ";" - }) + }), + 1 + ) + ], + 1 + ), + _vm._v(" "), + _c("rect", { + attrs: { + x: _vm.mergedConfig ? _vm.mergedConfig.borderWidth / 2 : "0", + y: _vm.mergedConfig ? _vm.mergedConfig.borderWidth / 2 : "0", + rx: _vm.mergedConfig ? _vm.mergedConfig.borderRadius : "0", + ry: _vm.mergedConfig ? _vm.mergedConfig.borderRadius : "0", + fill: "transparent", + "stroke-width": _vm.mergedConfig ? _vm.mergedConfig.borderWidth : "0", + stroke: "url(#" + _vm.gradientId1 + ")", + width: _vm.rectWidth > 0 ? _vm.rectWidth : 0, + height: _vm.rectHeight > 0 ? _vm.rectHeight : 0 + } + }), + _vm._v(" "), + _c("polyline", { + attrs: { + "stroke-width": _vm.polylineWidth, + "stroke-dasharray": _vm.mergedConfig + ? _vm.mergedConfig.lineDash.join(",") + : "0", + stroke: "url(#" + _vm.polylineGradient + ")", + points: _vm.points + } + }), + _vm._v(" "), + _c( + "text", + { + attrs: { + stroke: _vm.mergedConfig ? _vm.mergedConfig.textColor : "#fff", + fill: _vm.mergedConfig ? _vm.mergedConfig.textColor : "#fff", + x: _vm.width / 2, + y: _vm.height / 2 + } + }, + [_vm._v("\n " + _vm._s(_vm.details) + "\n ")] + ) + ]) ]) }; - var __vue_staticRenderFns__$q = []; - __vue_render__$q._withStripped = true; + var __vue_staticRenderFns__$w = []; + __vue_render__$w._withStripped = true; /* style */ - const __vue_inject_styles__$q = function (inject) { + const __vue_inject_styles__$w = function (inject) { if (!inject) return - inject("data-v-ee6aec2c_0", { source: ".dv-water-pond-level {\n position: relative;\n}\n.dv-water-pond-level svg {\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0px;\n left: 0px;\n}\n.dv-water-pond-level text {\n font-size: 25px;\n font-weight: bold;\n text-anchor: middle;\n dominant-baseline: middle;\n}\n.dv-water-pond-level ellipse,\n.dv-water-pond-level rect {\n fill: none;\n stroke-width: 3;\n}\n.dv-water-pond-level canvas {\n margin-top: 8px;\n margin-left: 8px;\n width: calc(100% - 16px);\n height: calc(100% - 16px);\n box-sizing: border-box;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;AACpB;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;EACZ,QAAQ;EACR,SAAS;AACX;AACA;EACE,eAAe;EACf,iBAAiB;EACjB,mBAAmB;EACnB,yBAAyB;AAC3B;AACA;;EAEE,UAAU;EACV,eAAe;AACjB;AACA;EACE,eAAe;EACf,gBAAgB;EAChB,wBAAwB;EACxB,yBAAyB;EACzB,sBAAsB;AACxB","file":"main.vue","sourcesContent":[".dv-water-pond-level {\n position: relative;\n}\n.dv-water-pond-level svg {\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0px;\n left: 0px;\n}\n.dv-water-pond-level text {\n font-size: 25px;\n font-weight: bold;\n text-anchor: middle;\n dominant-baseline: middle;\n}\n.dv-water-pond-level ellipse,\n.dv-water-pond-level rect {\n fill: none;\n stroke-width: 3;\n}\n.dv-water-pond-level canvas {\n margin-top: 8px;\n margin-left: 8px;\n width: calc(100% - 16px);\n height: calc(100% - 16px);\n box-sizing: border-box;\n}\n"]}, media: undefined }); + inject("data-v-05a0166f_0", { source: ".dv-percent-pond {\n position: relative;\n display: flex;\n flex-direction: column;\n}\n.dv-percent-pond svg {\n position: absolute;\n left: 0px;\n top: 0px;\n width: 100%;\n height: 100%;\n}\n.dv-percent-pond polyline {\n transition: all 0.3s;\n}\n.dv-percent-pond text {\n font-size: 25px;\n font-weight: bold;\n text-anchor: middle;\n dominant-baseline: middle;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,aAAa;EACb,sBAAsB;AACxB;AACA;EACE,kBAAkB;EAClB,SAAS;EACT,QAAQ;EACR,WAAW;EACX,YAAY;AACd;AACA;EACE,oBAAoB;AACtB;AACA;EACE,eAAe;EACf,iBAAiB;EACjB,mBAAmB;EACnB,yBAAyB;AAC3B","file":"main.vue","sourcesContent":[".dv-percent-pond {\n position: relative;\n display: flex;\n flex-direction: column;\n}\n.dv-percent-pond svg {\n position: absolute;\n left: 0px;\n top: 0px;\n width: 100%;\n height: 100%;\n}\n.dv-percent-pond polyline {\n transition: all 0.3s;\n}\n.dv-percent-pond text {\n font-size: 25px;\n font-weight: bold;\n text-anchor: middle;\n dominant-baseline: middle;\n}\n"]}, media: undefined }); }; /* scoped */ - const __vue_scope_id__$q = undefined; + const __vue_scope_id__$w = undefined; /* module identifier */ - const __vue_module_identifier__$q = undefined; + const __vue_module_identifier__$w = undefined; /* functional template */ - const __vue_is_functional_template__$q = false; + const __vue_is_functional_template__$w = false; /* style inject SSR */ + /* style inject shadow dom */ + - var WaterLevelPond = normalizeComponent_1( - { render: __vue_render__$q, staticRenderFns: __vue_staticRenderFns__$q }, - __vue_inject_styles__$q, - __vue_script__$q, - __vue_scope_id__$q, - __vue_is_functional_template__$q, - __vue_module_identifier__$q, - browser, + const __vue_component__$w = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$w, staticRenderFns: __vue_staticRenderFns__$w }, + __vue_inject_styles__$w, + __vue_script__$w, + __vue_scope_id__$w, + __vue_is_functional_template__$w, + __vue_module_identifier__$w, + false, + createInjector, + undefined, undefined ); - function waterLevelPond (Vue) { - Vue.component(WaterLevelPond.name, WaterLevelPond); + function percentPond (Vue) { + Vue.component(__vue_component__$w.name, __vue_component__$w); } // - var script$r = { - name: 'DvPercentPond', + var script$x = { + name: 'DvFlylineChart', + mixins: [autoResize], props: { config: { type: Object, default: () => ({}) + }, + dev: { + type: Boolean, + default: false } }, data() { - const timestamp = Date.now(); + const id = uuid(); return { - gradientId1: `percent-pond-gradientId1-${timestamp}`, - gradientId2: `percent-pond-gradientId2-${timestamp}`, - width: 0, - height: 0, + ref: 'dv-flyline-chart', + unique: Math.random(), + maskId: `flyline-mask-id-${id}`, + maskCircleId: `mask-circle-id-${id}`, + gradientId: `gradient-id-${id}`, + gradient2Id: `gradient2-id-${id}`, defaultConfig: { /** - * @description Value + * @description Flyline chart center point + * @type {Array} + * @default centerPoint = [0, 0] + */ + centerPoint: [0, 0], + + /** + * @description Flyline start points + * @type {Array>} + * @default points = [] + * @example points = [[10, 10], [100, 100]] + */ + points: [], + + /** + * @description Flyline width * @type {Number} - * @default value = 0 + * @default lineWidth = 1 */ - value: 0, + lineWidth: 1, /** - * @description Colors (hex|rgb|rgba|color keywords) - * @type {Array} - * @default colors = ['#00BAFF', '#3DE7C9'] - * @example colors = ['#000', 'rgb(0, 0, 0)', 'rgba(0, 0, 0, 1)', 'red'] + * @description Orbit color + * @type {String} + * @default orbitColor = 'rgba(103, 224, 227, .2)' */ - colors: ['#3DE7C9', '#00BAFF'], + orbitColor: 'rgba(103, 224, 227, .2)', /** - * @description Border width + * @description Flyline color + * @type {String} + * @default orbitColor = '#ffde93' + */ + flylineColor: '#ffde93', + + /** + * @description K value * @type {Number} - * @default borderWidth = 3 + * @default k = -0.5 + * @example k = -1 ~ 1 */ - borderWidth: 3, + k: -0.5, + + /** + * @description Flyline curvature + * @type {Number} + * @default curvature = 5 + */ + curvature: 5, + + /** + * @description Flyline radius + * @type {Number} + * @default flylineRadius = 100 + */ + flylineRadius: 100, + + /** + * @description Flyline animation duration + * @type {Array} + * @default duration = [20, 30] + */ + duration: [20, 30], + + /** + * @description Relative points position + * @type {Boolean} + * @default relative = true + */ + relative: true, + + /** + * @description Back ground image url + * @type {String} + * @default bgImgUrl = '' + * @example bgImgUrl = './img/bg.jpg' + */ + bgImgUrl: '', + + /** + * @description Text configuration + * @type {Object} + */ + text: { + /** + * @description Text offset + * @type {Array} + * @default offset = [0, 15] + */ + offset: [0, 15], + + /** + * @description Text color + * @type {String} + * @default color = '#ffdb5c' + */ + color: '#ffdb5c', + + /** + * @description Text font size + * @type {Number} + * @default fontSize = 12 + */ + fontSize: 12 + }, + + /** + * @description Halo configuration + * @type {Object} + */ + halo: { + /** + * @description Weather to show halo + * @type {Boolean} + * @default show = true + * @example show = true | false + */ + show: true, + + /** + * @description Halo animation duration (10 = 1s) + * @type {Number} + * @default duration = 30 + */ + duration: 30, + + /** + * @description Halo color + * @type {String} + * @default color = '#fb7293' + */ + color: '#fb7293', + + /** + * @description Halo max radius + * @type {Number} + * @default radius = 120 + */ + radius: 120 + }, /** - * @description Gap between border and pond - * @type {Number} - * @default borderGap = 3 + * @description Center point img configuration + * @type {Object} */ - borderGap: 3, + centerPointImg: { + /** + * @description Center point img width + * @type {Number} + * @default width = 40 + */ + width: 40, - /** - * @description Line dash - * @type {Array} - * @default lineDash = [5, 1] - */ - lineDash: [5, 1], + /** + * @description Center point img height + * @type {Number} + * @default height = 40 + */ + height: 40, - /** - * @description Text color - * @type {String} - * @default textColor = '#fff' - */ - textColor: '#fff', + /** + * @description Center point img url + * @type {String} + * @default url = '' + */ + url: '' + }, /** - * @description Border radius - * @type {Number} - * @default borderRadius = 5 + * @description Points img configuration + * @type {Object} + * @default radius = 120 */ - borderRadius: 5, + pointsImg: { + /** + * @description Points img width + * @type {Number} + * @default width = 15 + */ + width: 15, - /** - * @description Local Gradient - * @type {Boolean} - * @default localGradient = false - * @example localGradient = false | true - */ - localGradient: false, + /** + * @description Points img height + * @type {Number} + * @default height = 15 + */ + height: 15, - /** - * @description Formatter - * @type {String} - * @default formatter = '{value}%' - */ - formatter: '{value}%' + /** + * @description Points img url + * @type {String} + * @default url = '' + */ + url: '' + } }, - mergedConfig: null + mergedConfig: null, + paths: [], + lengths: [], + times: [], + texts: [] }; }, - computed: { - rectWidth() { + watch: { + config() { const { - mergedConfig, - width + calcData } = this; - if (!mergedConfig) return 0; - const { - borderWidth - } = mergedConfig; - return width - borderWidth; - }, + calcData(); + } - rectHeight() { + }, + methods: { + afterAutoResizeMixinInit() { const { - mergedConfig, - height + calcData } = this; - if (!mergedConfig) return 0; - const { - borderWidth - } = mergedConfig; - return height - borderWidth; + calcData(); }, - points() { + onResize() { const { - mergedConfig, - width, - height + calcData } = this; - const halfHeight = height / 2; - if (!mergedConfig) return `0, ${halfHeight} 0, ${halfHeight}`; - const { - borderWidth, - borderGap, - value - } = mergedConfig; - const polylineLength = (width - (borderWidth + borderGap) * 2) / 100 * value; - return ` - ${borderWidth + borderGap}, ${halfHeight} - ${borderWidth + borderGap + polylineLength}, ${halfHeight + 0.001} - `; + calcData(); }, - polylineWidth() { + async calcData() { const { - mergedConfig, - height + mergeConfig, + createFlylinePaths, + calcLineLengths } = this; - if (!mergedConfig) return 0; + mergeConfig(); + createFlylinePaths(); + await calcLineLengths(); const { - borderWidth, - borderGap - } = mergedConfig; - return height - (borderWidth + borderGap) * 2; + calcTimes, + calcTexts + } = this; + calcTimes(); + calcTexts(); }, - linearGradient() { - const { - mergedConfig + mergeConfig() { + let { + config, + defaultConfig } = this; - if (!mergedConfig) return []; + const mergedConfig = util_2$1(util_1(defaultConfig, true), config || {}); const { - colors + points } = mergedConfig; - const colorNum = colors.length; - const colorOffsetGap = 100 / (colorNum - 1); - return colors.map((c, i) => [colorOffsetGap * i, c]); + mergedConfig.points = points.map(item => { + if (item instanceof Array) { + return { + position: item, + text: '' + }; + } + + return item; + }); + this.mergedConfig = mergedConfig; }, - polylineGradient() { + createFlylinePaths() { const { - gradientId1, - gradientId2, - mergedConfig + getPath, + mergedConfig, + width, + height } = this; - if (!mergedConfig) return gradientId2; - if (mergedConfig.localGradient) return gradientId1; - return gradientId2; + let { + centerPoint, + points, + relative + } = mergedConfig; + points = points.map(({ + position + }) => position); + + if (relative) { + centerPoint = [width * centerPoint[0], height * centerPoint[1]]; + points = points.map(([x, y]) => [width * x, height * y]); + } + + this.paths = points.map(point => getPath(centerPoint, point)); }, - gradient2XPos() { + getPath(center, point) { const { - mergedConfig + getControlPoint } = this; - if (!mergedConfig) return '100%'; - const { - value - } = mergedConfig; - return `${200 - value}%`; + const controlPoint = getControlPoint(center, point); + return [point, controlPoint, center]; }, - details() { + getControlPoint([sx, sy], [ex, ey]) { const { + getKLinePointByx, mergedConfig } = this; - if (!mergedConfig) return ''; const { - value, - formatter + curvature, + k } = mergedConfig; - return formatter.replace('{value}', value); - } - - }, - watch: { - config() { - const { - mergeConfig - } = this; - mergeConfig(); - } - - }, - methods: { - async init() { - const { - initWH, - config, - mergeConfig - } = this; - await initWH(); - if (!config) return; - mergeConfig(); + const [mx, my] = [(sx + ex) / 2, (sy + ey) / 2]; + const distance = getPointDistance([sx, sy], [ex, ey]); + const targetLength = distance / curvature; + const disDived = targetLength / 2; + let [dx, dy] = [mx, my]; + + do { + dx += disDived; + dy = getKLinePointByx(k, [mx, my], dx)[1]; + } while (getPointDistance([mx, my], [dx, dy]) < targetLength); + + return [dx, dy]; }, - async initWH() { + getKLinePointByx(k, [lx, ly], x) { + const y = ly - k * lx + k * x; + return [x, y]; + }, + + async calcLineLengths() { const { $nextTick, + paths, $refs } = this; await $nextTick(); - const dom = $refs['percent-pond']; - this.width = dom.clientWidth; - this.height = dom.clientHeight; + this.lengths = paths.map((foo, i) => $refs[`path${i}`][0].getTotalLength()); }, - mergeConfig() { + calcTimes() { const { - config, - defaultConfig + duration, + points + } = this.mergedConfig; + this.times = points.map(foo => randomExtend(...duration) / 10); + }, + + calcTexts() { + const { + points + } = this.mergedConfig; + this.texts = points.map(({ + text + }) => text); + }, + + consoleClickPos({ + offsetX, + offsetY + }) { + const { + width, + height, + dev } = this; - this.mergedConfig = util_2$1(util_1(defaultConfig, true), config || {}); + if (!dev) return; + const relativeX = (offsetX / width).toFixed(2); + const relativeY = (offsetY / height).toFixed(2); + console.warn(`dv-flyline-chart DEV: \n Click Position is [${offsetX}, ${offsetY}] \n Relative Position is [${relativeX}, ${relativeY}]`); } - }, - - mounted() { - const { - init - } = this; - init(); } - }; /* script */ - const __vue_script__$r = script$r; + const __vue_script__$x = script$x; /* template */ - var __vue_render__$r = function() { + var __vue_render__$x = function() { var _vm = this; var _h = _vm.$createElement; var _c = _vm._self._c || _h; - return _c("div", { ref: "percent-pond", staticClass: "dv-percent-pond" }, [ - _c("svg", [ - _c( - "defs", - [ - _c( - "linearGradient", - { - attrs: { - id: _vm.gradientId1, - x1: "0%", - y1: "0%", - x2: "100%", - y2: "0%" - } - }, - _vm._l(_vm.linearGradient, function(lc) { - return _c("stop", { - key: lc[0], - attrs: { offset: lc[0] + "%", "stop-color": lc[1] } - }) - }), - 1 - ), - _vm._v(" "), - _c( - "linearGradient", - { - attrs: { - id: _vm.gradientId2, - x1: "0%", - y1: "0%", - x2: _vm.gradient2XPos, - y2: "0%" - } - }, - _vm._l(_vm.linearGradient, function(lc) { - return _c("stop", { - key: lc[0], - attrs: { offset: lc[0] + "%", "stop-color": lc[1] } + return _c( + "div", + { + ref: "dv-flyline-chart", + staticClass: "dv-flyline-chart", + style: + "background-image: url(" + + (_vm.mergedConfig ? _vm.mergedConfig.bgImgUrl : "") + + ")", + on: { click: _vm.consoleClickPos } + }, + [ + _vm.mergedConfig + ? _c( + "svg", + { attrs: { width: _vm.width, height: _vm.height } }, + [ + _c( + "defs", + [ + _c( + "radialGradient", + { + attrs: { + id: _vm.gradientId, + cx: "50%", + cy: "50%", + r: "50%" + } + }, + [ + _c("stop", { + attrs: { + offset: "0%", + "stop-color": "#fff", + "stop-opacity": "1" + } + }), + _vm._v(" "), + _c("stop", { + attrs: { + offset: "100%", + "stop-color": "#fff", + "stop-opacity": "0" + } + }) + ], + 1 + ), + _vm._v(" "), + _c( + "radialGradient", + { + attrs: { + id: _vm.gradient2Id, + cx: "50%", + cy: "50%", + r: "50%" + } + }, + [ + _c("stop", { + attrs: { + offset: "0%", + "stop-color": "#fff", + "stop-opacity": "0" + } + }), + _vm._v(" "), + _c("stop", { + attrs: { + offset: "100%", + "stop-color": "#fff", + "stop-opacity": "1" + } + }) + ], + 1 + ), + _vm._v(" "), + _vm.paths[0] + ? _c( + "circle", + { + attrs: { + id: "circle" + _vm.paths[0].toString(), + cx: _vm.paths[0][2][0], + cy: _vm.paths[0][2][1] + } + }, + [ + _c("animate", { + attrs: { + attributeName: "r", + values: "1;" + _vm.mergedConfig.halo.radius, + dur: _vm.mergedConfig.halo.duration / 10 + "s", + repeatCount: "indefinite" + } + }), + _vm._v(" "), + _c("animate", { + attrs: { + attributeName: "opacity", + values: "1;0", + dur: _vm.mergedConfig.halo.duration / 10 + "s", + repeatCount: "indefinite" + } + }) + ] + ) + : _vm._e() + ], + 1 + ), + _vm._v(" "), + _vm.paths[0] + ? _c("image", { + attrs: { + "xlink:href": _vm.mergedConfig.centerPointImg.url, + width: _vm.mergedConfig.centerPointImg.width, + height: _vm.mergedConfig.centerPointImg.height, + x: + _vm.paths[0][2][0] - + _vm.mergedConfig.centerPointImg.width / 2, + y: + _vm.paths[0][2][1] - + _vm.mergedConfig.centerPointImg.height / 2 + } + }) + : _vm._e(), + _vm._v(" "), + _c( + "mask", + { attrs: { id: "maskhalo" + _vm.paths[0].toString() } }, + [ + _vm.paths[0] + ? _c("use", { + attrs: { + "xlink:href": "#circle" + _vm.paths[0].toString(), + fill: "url(#" + _vm.gradient2Id + ")" + } + }) + : _vm._e() + ] + ), + _vm._v(" "), + _vm.paths[0] && _vm.mergedConfig.halo.show + ? _c("use", { + attrs: { + "xlink:href": "#circle" + _vm.paths[0].toString(), + fill: _vm.mergedConfig.halo.color, + mask: "url(#maskhalo" + _vm.paths[0].toString() + ")" + } + }) + : _vm._e(), + _vm._v(" "), + _vm._l(_vm.paths, function(path, i) { + return _c("g", { key: i }, [ + _c("defs", [ + _c("path", { + ref: "path" + i, + refInFor: true, + attrs: { + id: "path" + path.toString(), + d: + "M" + + path[0].toString() + + " Q" + + path[1].toString() + + " " + + path[2].toString(), + fill: "transparent" + } + }) + ]), + _vm._v(" "), + _c("use", { + attrs: { + "xlink:href": "#path" + path.toString(), + "stroke-width": _vm.mergedConfig.lineWidth, + stroke: _vm.mergedConfig.orbitColor + } + }), + _vm._v(" "), + _vm.lengths[i] + ? _c( + "use", + { + attrs: { + "xlink:href": "#path" + path.toString(), + "stroke-width": _vm.mergedConfig.lineWidth, + stroke: _vm.mergedConfig.flylineColor, + mask: + "url(#mask" + _vm.unique + path.toString() + ")" + } + }, + [ + _c("animate", { + attrs: { + attributeName: "stroke-dasharray", + from: "0, " + _vm.lengths[i], + to: _vm.lengths[i] + ", 0", + dur: _vm.times[i] || 0, + repeatCount: "indefinite" + } + }) + ] + ) + : _vm._e(), + _vm._v(" "), + _c( + "mask", + { attrs: { id: "mask" + _vm.unique + path.toString() } }, + [ + _c( + "circle", + { + attrs: { + cx: "0", + cy: "0", + r: _vm.mergedConfig.flylineRadius, + fill: "url(#" + _vm.gradientId + ")" + } + }, + [ + _c("animateMotion", { + attrs: { + dur: _vm.times[i] || 0, + path: + "M" + + path[0].toString() + + " Q" + + path[1].toString() + + " " + + path[2].toString(), + rotate: "auto", + repeatCount: "indefinite" + } + }) + ], + 1 + ) + ] + ), + _vm._v(" "), + _c("image", { + attrs: { + "xlink:href": _vm.mergedConfig.pointsImg.url, + width: _vm.mergedConfig.pointsImg.width, + height: _vm.mergedConfig.pointsImg.height, + x: path[0][0] - _vm.mergedConfig.pointsImg.width / 2, + y: path[0][1] - _vm.mergedConfig.pointsImg.height / 2 + } + }), + _vm._v(" "), + _c( + "text", + { + style: + "fontSize:" + _vm.mergedConfig.text.fontSize + "px;", + attrs: { + fill: _vm.mergedConfig.text.color, + x: path[0][0] + _vm.mergedConfig.text.offset[0], + y: path[0][1] + _vm.mergedConfig.text.offset[1] + } + }, + [_vm._v("\n " + _vm._s(_vm.texts[i]) + "\n ")] + ) + ]) }) - }), - 1 + ], + 2 ) - ], - 1 - ), - _vm._v(" "), - _c("rect", { - attrs: { - x: _vm.mergedConfig ? _vm.mergedConfig.borderWidth / 2 : "0", - y: _vm.mergedConfig ? _vm.mergedConfig.borderWidth / 2 : "0", - rx: _vm.mergedConfig ? _vm.mergedConfig.borderRadius : "0", - ry: _vm.mergedConfig ? _vm.mergedConfig.borderRadius : "0", - fill: "transparent", - "stroke-width": _vm.mergedConfig ? _vm.mergedConfig.borderWidth : "0", - stroke: "url(#" + _vm.gradientId1 + ")", - width: _vm.rectWidth > 0 ? _vm.rectWidth : 0, - height: _vm.rectHeight > 0 ? _vm.rectHeight : 0 - } - }), - _vm._v(" "), - _c("polyline", { - attrs: { - "stroke-width": _vm.polylineWidth, - "stroke-dasharray": _vm.mergedConfig - ? _vm.mergedConfig.lineDash.join(",") - : "0", - stroke: "url(#" + _vm.polylineGradient + ")", - points: _vm.points - } - }), - _vm._v(" "), - _c( - "text", - { - attrs: { - stroke: _vm.mergedConfig ? _vm.mergedConfig.textColor : "#fff", - fill: _vm.mergedConfig ? _vm.mergedConfig.textColor : "#fff", - x: _vm.width / 2, - y: _vm.height / 2 - } - }, - [_vm._v("\n " + _vm._s(_vm.details) + "\n ")] - ) - ]) - ]) + : _vm._e() + ] + ) }; - var __vue_staticRenderFns__$r = []; - __vue_render__$r._withStripped = true; + var __vue_staticRenderFns__$x = []; + __vue_render__$x._withStripped = true; /* style */ - const __vue_inject_styles__$r = function (inject) { + const __vue_inject_styles__$x = function (inject) { if (!inject) return - inject("data-v-ccc0d132_0", { source: ".dv-percent-pond {\n position: relative;\n display: flex;\n flex-direction: column;\n}\n.dv-percent-pond svg {\n position: absolute;\n left: 0px;\n top: 0px;\n width: 100%;\n height: 100%;\n}\n.dv-percent-pond polyline {\n transition: all 0.3s;\n}\n.dv-percent-pond text {\n font-size: 25px;\n font-weight: bold;\n text-anchor: middle;\n dominant-baseline: middle;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,aAAa;EACb,sBAAsB;AACxB;AACA;EACE,kBAAkB;EAClB,SAAS;EACT,QAAQ;EACR,WAAW;EACX,YAAY;AACd;AACA;EACE,oBAAoB;AACtB;AACA;EACE,eAAe;EACf,iBAAiB;EACjB,mBAAmB;EACnB,yBAAyB;AAC3B","file":"main.vue","sourcesContent":[".dv-percent-pond {\n position: relative;\n display: flex;\n flex-direction: column;\n}\n.dv-percent-pond svg {\n position: absolute;\n left: 0px;\n top: 0px;\n width: 100%;\n height: 100%;\n}\n.dv-percent-pond polyline {\n transition: all 0.3s;\n}\n.dv-percent-pond text {\n font-size: 25px;\n font-weight: bold;\n text-anchor: middle;\n dominant-baseline: middle;\n}\n"]}, media: undefined }); + inject("data-v-1edfcf29_0", { source: ".dv-flyline-chart {\n display: flex;\n flex-direction: column;\n background-size: 100% 100%;\n}\n.dv-flyline-chart polyline {\n transition: all 0.3s;\n}\n.dv-flyline-chart text {\n text-anchor: middle;\n dominant-baseline: middle;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,aAAa;EACb,sBAAsB;EACtB,0BAA0B;AAC5B;AACA;EACE,oBAAoB;AACtB;AACA;EACE,mBAAmB;EACnB,yBAAyB;AAC3B","file":"main.vue","sourcesContent":[".dv-flyline-chart {\n display: flex;\n flex-direction: column;\n background-size: 100% 100%;\n}\n.dv-flyline-chart polyline {\n transition: all 0.3s;\n}\n.dv-flyline-chart text {\n text-anchor: middle;\n dominant-baseline: middle;\n}\n"]}, media: undefined }); }; /* scoped */ - const __vue_scope_id__$r = undefined; + const __vue_scope_id__$x = undefined; /* module identifier */ - const __vue_module_identifier__$r = undefined; + const __vue_module_identifier__$x = undefined; /* functional template */ - const __vue_is_functional_template__$r = false; + const __vue_is_functional_template__$x = false; /* style inject SSR */ + /* style inject shadow dom */ + - var PercentPond = normalizeComponent_1( - { render: __vue_render__$r, staticRenderFns: __vue_staticRenderFns__$r }, - __vue_inject_styles__$r, - __vue_script__$r, - __vue_scope_id__$r, - __vue_is_functional_template__$r, - __vue_module_identifier__$r, - browser, + const __vue_component__$x = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$x, staticRenderFns: __vue_staticRenderFns__$x }, + __vue_inject_styles__$x, + __vue_script__$x, + __vue_scope_id__$x, + __vue_is_functional_template__$x, + __vue_module_identifier__$x, + false, + createInjector, + undefined, undefined ); - function percentPond (Vue) { - Vue.component(PercentPond.name, PercentPond); + function flylineChart (Vue) { + Vue.component(__vue_component__$x.name, __vue_component__$x); } // - var script$s = { - name: 'DvFlylineChart', + var script$y = { + name: 'DvFlylineChartEnhanced', mixins: [autoResize], props: { config: { @@ -21916,103 +22258,127 @@ }, data() { - const timestamp = Date.now(); + const id = uuid(); return { - ref: 'dv-flyline-chart', + ref: 'dv-flyline-chart-enhanced', unique: Math.random(), - maskId: `flyline-mask-id-${timestamp}`, - maskCircleId: `mask-circle-id-${timestamp}`, - gradientId: `gradient-id-${timestamp}`, - gradient2Id: `gradient2-id-${timestamp}`, + flylineGradientId: `flyline-gradient-id-${id}`, + haloGradientId: `halo-gradient-id-${id}`, + + /** + * @description Type Declaration + * + * interface Halo { + * show?: boolean + * duration?: [number, number] + * color?: string + * radius?: number + * } + * + * interface Text { + * show?: boolean + * offset?: [number, number] + * color?: string + * fontSize?: number + * } + * + * interface Icon { + * show?: boolean + * src?: string + * width?: number + * height?: number + * } + * + * interface Point { + * name: string + * coordinate: [number, number] + * halo?: Halo + * text?: Text + * icon?: Icon + * } + * + * interface Line { + * width?: number + * color?: string + * orbitColor?: string + * duration?: [number, number] + * radius?: string + * } + * + * interface Flyline extends Line { + * source: string + * target: string + * } + * + * interface FlylineWithPath extends Flyline { + * d: string + * path: [[number, number], [number, number], [number, number]] + * key: string + * } + */ defaultConfig: { /** - * @description Flyline chart center point - * @type {Array} - * @default centerPoint = [0, 0] - */ - centerPoint: [0, 0], - - /** - * @description Flyline start points - * @type {Array>} + * @description Flyline chart points + * @type {Point[]} * @default points = [] - * @example points = [[10, 10], [100, 100]] */ points: [], /** - * @description Flyline width - * @type {Number} - * @default lineWidth = 1 - */ - lineWidth: 1, - - /** - * @description Orbit color - * @type {String} - * @default orbitColor = 'rgba(103, 224, 227, .2)' - */ - orbitColor: 'rgba(103, 224, 227, .2)', - - /** - * @description Flyline color - * @type {String} - * @default orbitColor = '#ffde93' - */ - flylineColor: '#ffde93', - - /** - * @description K value - * @type {Number} - * @default k = -0.5 - * @example k = -1 ~ 1 - */ - k: -0.5, - - /** - * @description Flyline curvature - * @type {Number} - * @default curvature = 5 - */ - curvature: 5, - - /** - * @description Flyline radius - * @type {Number} - * @default flylineRadius = 100 + * @description Lines + * @type {Flyline[]} + * @default lines = [] */ - flylineRadius: 100, + lines: [], /** - * @description Flyline animation duration - * @type {Array} - * @default duration = [20, 30] + * @description Global halo configuration + * @type {Halo} */ - duration: [20, 30], + halo: { + /** + * @description Whether to show halo + * @type {Boolean} + * @default show = false + */ + show: false, - /** - * @description Relative points position - * @type {Boolean} - * @default relative = true - */ - relative: true, + /** + * @description Halo animation duration (1s = 10) + * @type {[number, number]} + */ + duration: [20, 30], - /** - * @description Back ground image url - * @type {String} - * @default bgImgUrl = '' - * @example bgImgUrl = './img/bg.jpg' - */ - bgImgUrl: '', + /** + * @description Halo color + * @type {String} + * @default color = '#fb7293' + */ + color: '#fb7293', + + /** + * @description Halo radius + * @type {Number} + * @default radius = 120 + */ + radius: 120 + }, /** - * @description Text configuration - * @type {Object} + * @description Global text configuration + * @type {Text} */ text: { + /** + * @description Whether to show text + * @type {Boolean} + * @default show = false + */ + show: false, + /** * @description Text offset - * @type {Array} + * @type {[number, number]} * @default offset = [0, 15] */ offset: [0, 15], @@ -22033,100 +22399,130 @@ }, /** - * @description Halo configuration - * @type {Object} + * @description Global icon configuration + * @type {Icon} */ - halo: { + icon: { /** - * @description Weather to show halo + * @description Whether to show icon * @type {Boolean} - * @default show = true - * @example show = true | false + * @default show = false */ - show: true, + show: false, /** - * @description Halo animation duration (10 = 1s) - * @type {Number} - * @default duration = 30 + * @description Icon src + * @type {String} + * @default src = '' */ - duration: 30, + src: '', /** - * @description Halo color - * @type {String} - * @default color = '#fb7293' + * @description Icon width + * @type {Number} + * @default width = 15 */ - color: '#fb7293', + width: 15, /** - * @description Halo max radius + * @description Icon height * @type {Number} - * @default radius = 120 + * @default width = 15 */ - radius: 120 + height: 15 }, /** - * @description Center point img configuration - * @type {Object} + * @description Global line configuration + * @type {Line} */ - centerPointImg: { + line: { /** - * @description Center point img width + * @description Line width * @type {Number} - * @default width = 40 + * @default width = 1 */ - width: 40, + width: 1, /** - * @description Center point img height - * @type {Number} - * @default height = 40 + * @description Flyline color + * @type {String} + * @default color = '#ffde93' */ - height: 40, + color: '#ffde93', /** - * @description Center point img url + * @description Orbit color * @type {String} - * @default url = '' + * @default orbitColor = 'rgba(103, 224, 227, .2)' */ - url: '' - }, + orbitColor: 'rgba(103, 224, 227, .2)', - /** - * @description Points img configuration - * @type {Object} - * @default radius = 120 - */ - pointsImg: { /** - * @description Points img width - * @type {Number} - * @default width = 15 + * @description Flyline animation duration + * @type {[number, number]} + * @default duration = [20, 30] */ - width: 15, + duration: [20, 30], /** - * @description Points img height + * @description Flyline radius * @type {Number} - * @default height = 15 + * @default radius = 100 */ - height: 15, + radius: 100 + }, - /** - * @description Points img url - * @type {String} - * @default url = '' - */ - url: '' - } + /** + * @description Back ground image url + * @type {String} + * @default bgImgSrc = '' + */ + bgImgSrc: '', + + /** + * @description K value + * @type {Number} + * @default k = -0.5 + * @example k = -1 ~ 1 + */ + k: -0.5, + + /** + * @description Flyline curvature + * @type {Number} + * @default curvature = 5 + */ + curvature: 5, + + /** + * @description Relative points position + * @type {Boolean} + * @default relative = true + */ + relative: true }, - mergedConfig: null, - paths: [], - lengths: [], - times: [], - texts: [] + + /** + * @description Fly line data + * @type {FlylineWithPath[]} + * @default flylines = [] + */ + flylines: [], + + /** + * @description Fly line lengths + * @type {Number[]} + * @default flylineLengths = [] + */ + flylineLengths: [], + + /** + * @description Fly line points + * @default flylinePoints = [] + */ + flylinePoints: [], + mergedConfig: null }; }, @@ -22157,18 +22553,16 @@ async calcData() { const { mergeConfig, - createFlylinePaths, - calcLineLengths + calcflylinePoints, + calcLinePaths } = this; mergeConfig(); - createFlylinePaths(); - await calcLineLengths(); + calcflylinePoints(); + calcLinePaths(); const { - calcTimes, - calcTexts + calcLineLengths } = this; - calcTimes(); - calcTexts(); + await calcLineLengths(); }, mergeConfig() { @@ -22178,51 +22572,98 @@ } = this; const mergedConfig = util_2$1(util_1(defaultConfig, true), config || {}); const { - points + points, + lines, + halo, + text, + icon, + line } = mergedConfig; mergedConfig.points = points.map(item => { - if (item instanceof Array) { - return { - position: item, - text: '' - }; - } - + item.halo = util_2$1(util_1(halo, true), item.halo || {}); + item.text = util_2$1(util_1(text, true), item.text || {}); + item.icon = util_2$1(util_1(icon, true), item.icon || {}); return item; }); + mergedConfig.lines = lines.map(item => { + return util_2$1(util_1(line, true), item); + }); this.mergedConfig = mergedConfig; }, - createFlylinePaths() { + calcflylinePoints() { const { - getPath, mergedConfig, width, height } = this; - let { - centerPoint, - points, - relative + const { + relative, + points } = mergedConfig; - points = points.map(({ - position - }) => position); - - if (relative) { - centerPoint = [width * centerPoint[0], height * centerPoint[1]]; - points = points.map(([x, y]) => [width * x, height * y]); - } + this.flylinePoints = points.map((item, i) => { + const { + coordinate: [x, y], + halo, + icon, + text + } = item; + if (relative) item.coordinate = [x * width, y * height]; + item.halo.time = randomExtend(...halo.duration) / 10; + const { + width: iw, + height: ih + } = icon; + item.icon.x = item.coordinate[0] - iw / 2; + item.icon.y = item.coordinate[1] - ih / 2; + const [ox, oy] = text.offset; + item.text.x = item.coordinate[0] + ox; + item.text.y = item.coordinate[1] + oy; + item.key = `${item.coordinate.toString()}${i}`; + return item; + }); + }, - this.paths = points.map(point => getPath(centerPoint, point)); + calcLinePaths() { + const { + getPath, + mergedConfig + } = this; + const { + points, + lines + } = mergedConfig; + this.flylines = lines.map(item => { + const { + source, + target, + duration + } = item; + const sourcePoint = points.find(({ + name + }) => name === source).coordinate; + const targetPoint = points.find(({ + name + }) => name === target).coordinate; + const path = getPath(sourcePoint, targetPoint).map(item => item.map(v => parseFloat(v.toFixed(10)))); + const d = `M${path[0].toString()} Q${path[1].toString()} ${path[2].toString()}`; + const key = `path${path.toString()}`; + const time = randomExtend(...duration) / 10; + return { ...item, + path, + key, + d, + time + }; + }); }, - getPath(center, point) { + getPath(start, end) { const { getControlPoint } = this; - const controlPoint = getControlPoint(center, point); - return [point, controlPoint, center]; + const controlPoint = getControlPoint(start, end); + return [start, controlPoint, end]; }, getControlPoint([sx, sy], [ex, ey]) { @@ -22256,28 +22697,13 @@ async calcLineLengths() { const { $nextTick, - paths, + flylines, $refs } = this; await $nextTick(); - this.lengths = paths.map((foo, i) => $refs[`path${i}`][0].getTotalLength()); - }, - - calcTimes() { - const { - duration, - points - } = this.mergedConfig; - this.times = points.map(foo => randomExtend(...duration) / 10); - }, - - calcTexts() { - const { - points - } = this.mergedConfig; - this.texts = points.map(({ - text - }) => text); + this.flylineLengths = flylines.map(({ + key + }) => $refs[key][0].getTotalLength()); }, consoleClickPos({ @@ -22292,33 +22718,33 @@ if (!dev) return; const relativeX = (offsetX / width).toFixed(2); const relativeY = (offsetY / height).toFixed(2); - console.warn(`dv-flyline-chart DEV: \n Click Position is [${offsetX}, ${offsetY}] \n Relative Position is [${relativeX}, ${relativeY}]`); + console.warn(`dv-flyline-chart-enhanced DEV: \n Click Position is [${offsetX}, ${offsetY}] \n Relative Position is [${relativeX}, ${relativeY}]`); } } }; /* script */ - const __vue_script__$s = script$s; + const __vue_script__$y = script$y; /* template */ - var __vue_render__$s = function() { + var __vue_render__$y = function() { var _vm = this; var _h = _vm.$createElement; var _c = _vm._self._c || _h; return _c( "div", { - ref: "dv-flyline-chart", - staticClass: "dv-flyline-chart", + ref: _vm.ref, + staticClass: "dv-flyline-chart-enhanced", style: "background-image: url(" + - (_vm.mergedConfig ? _vm.mergedConfig.bgImgUrl : "") + + (_vm.mergedConfig ? _vm.mergedConfig.bgImgSrc : "") + ")", on: { click: _vm.consoleClickPos } }, [ - _vm.mergedConfig + _vm.flylines.length ? _c( "svg", { attrs: { width: _vm.width, height: _vm.height } }, @@ -22330,7 +22756,7 @@ "radialGradient", { attrs: { - id: _vm.gradientId, + id: _vm.flylineGradientId, cx: "50%", cy: "50%", r: "50%" @@ -22360,7 +22786,7 @@ "radialGradient", { attrs: { - id: _vm.gradient2Id, + id: _vm.haloGradientId, cx: "50%", cy: "50%", r: "50%" @@ -22384,141 +22810,126 @@ }) ], 1 - ), - _vm._v(" "), - _vm.paths[0] - ? _c( - "circle", - { - attrs: { - id: "circle" + _vm.paths[0].toString(), - cx: _vm.paths[0][2][0], - cy: _vm.paths[0][2][1] - } - }, - [ - _c("animate", { - attrs: { - attributeName: "r", - values: "1;" + _vm.mergedConfig.halo.radius, - dur: _vm.mergedConfig.halo.duration / 10 + "s", - repeatCount: "indefinite" - } - }), - _vm._v(" "), - _c("animate", { - attrs: { - attributeName: "opacity", - values: "1;0", - dur: _vm.mergedConfig.halo.duration / 10 + "s", - repeatCount: "indefinite" - } - }) - ] - ) - : _vm._e() + ) ], 1 ), _vm._v(" "), - _vm.paths[0] - ? _c("image", { - attrs: { - "xlink:href": _vm.mergedConfig.centerPointImg.url, - width: _vm.mergedConfig.centerPointImg.width, - height: _vm.mergedConfig.centerPointImg.height, - x: - _vm.paths[0][2][0] - - _vm.mergedConfig.centerPointImg.width / 2, - y: - _vm.paths[0][2][1] - - _vm.mergedConfig.centerPointImg.height / 2 - } - }) - : _vm._e(), - _vm._v(" "), - _c( - "mask", - { attrs: { id: "maskhalo" + _vm.paths[0].toString() } }, - [ - _vm.paths[0] + _vm._l(_vm.flylinePoints, function(point) { + return _c("g", { key: point.key + Math.random() }, [ + _c("defs", [ + point.halo.show + ? _c( + "circle", + { + attrs: { + id: "halo" + _vm.unique + point.key, + cx: point.coordinate[0], + cy: point.coordinate[1] + } + }, + [ + _c("animate", { + attrs: { + attributeName: "r", + values: "1;" + point.halo.radius, + dur: point.halo.time + "s", + repeatCount: "indefinite" + } + }), + _vm._v(" "), + _c("animate", { + attrs: { + attributeName: "opacity", + values: "1;0", + dur: point.halo.time + "s", + repeatCount: "indefinite" + } + }) + ] + ) + : _vm._e() + ]), + _vm._v(" "), + _c( + "mask", + { attrs: { id: "mask" + _vm.unique + point.key } }, + [ + point.halo.show + ? _c("use", { + attrs: { + "xlink:href": "#halo" + _vm.unique + point.key, + fill: "url(#" + _vm.haloGradientId + ")" + } + }) + : _vm._e() + ] + ), + _vm._v(" "), + point.halo.show ? _c("use", { attrs: { - "xlink:href": "#circle" + _vm.paths[0].toString(), - fill: "url(#" + _vm.gradient2Id + ")" + "xlink:href": "#halo" + _vm.unique + point.key, + fill: point.halo.color, + mask: "url(#mask" + _vm.unique + point.key + ")" + } + }) + : _vm._e(), + _vm._v(" "), + point.icon.show + ? _c("image", { + attrs: { + "xlink:href": point.icon.src, + width: point.icon.width, + height: point.icon.height, + x: point.icon.x, + y: point.icon.y } }) + : _vm._e(), + _vm._v(" "), + point.text.show + ? _c( + "text", + { + style: + "fontSize:" + + point.text.fontSize + + "px;color:" + + point.text.color, + attrs: { + fill: point.text.color, + x: point.text.x, + y: point.text.y + } + }, + [_vm._v("\n " + _vm._s(point.name) + "\n ")] + ) : _vm._e() - ] - ), - _vm._v(" "), - _vm.paths[0] && _vm.mergedConfig.halo.show - ? _c("use", { - attrs: { - "xlink:href": "#circle" + _vm.paths[0].toString(), - fill: _vm.mergedConfig.halo.color, - mask: "url(#maskhalo" + _vm.paths[0].toString() + ")" - } - }) - : _vm._e(), + ]) + }), _vm._v(" "), - _vm._l(_vm.paths, function(path, i) { - return _c("g", { key: i }, [ + _vm._l(_vm.flylines, function(line, i) { + return _c("g", { key: line.key + Math.random() }, [ _c("defs", [ _c("path", { - ref: "path" + i, + ref: line.key, refInFor: true, - attrs: { - id: "path" + path.toString(), - d: - "M" + - path[0].toString() + - " Q" + - path[1].toString() + - " " + - path[2].toString(), - fill: "transparent" - } + attrs: { id: line.key, d: line.d, fill: "transparent" } }) ]), _vm._v(" "), _c("use", { attrs: { - "xlink:href": "#path" + path.toString(), - "stroke-width": _vm.mergedConfig.lineWidth, - stroke: _vm.mergedConfig.orbitColor + "xlink:href": "#" + line.key, + "stroke-width": line.width, + stroke: line.orbitColor } }), _vm._v(" "), - _vm.lengths[i] - ? _c( - "use", - { - attrs: { - "xlink:href": "#path" + path.toString(), - "stroke-width": _vm.mergedConfig.lineWidth, - stroke: _vm.mergedConfig.flylineColor, - mask: - "url(#mask" + _vm.unique + path.toString() + ")" - } - }, - [ - _c("animate", { - attrs: { - attributeName: "stroke-dasharray", - from: "0, " + _vm.lengths[i], - to: _vm.lengths[i] + ", 0", - dur: _vm.times[i] || 0, - repeatCount: "indefinite" - } - }) - ] - ) - : _vm._e(), - _vm._v(" "), _c( "mask", - { attrs: { id: "mask" + _vm.unique + path.toString() } }, + { attrs: { id: "mask" + _vm.unique + line.key } }, [ _c( "circle", @@ -22526,21 +22937,15 @@ attrs: { cx: "0", cy: "0", - r: _vm.mergedConfig.flylineRadius, - fill: "url(#" + _vm.gradientId + ")" + r: line.radius, + fill: "url(#" + _vm.flylineGradientId + ")" } }, [ _c("animateMotion", { attrs: { - dur: _vm.times[i] || 0, - path: - "M" + - path[0].toString() + - " Q" + - path[1].toString() + - " " + - path[2].toString(), + dur: line.time, + path: line.d, rotate: "auto", repeatCount: "indefinite" } @@ -22551,29 +22956,30 @@ ] ), _vm._v(" "), - _c("image", { - attrs: { - "xlink:href": _vm.mergedConfig.pointsImg.url, - width: _vm.mergedConfig.pointsImg.width, - height: _vm.mergedConfig.pointsImg.height, - x: path[0][0] - _vm.mergedConfig.pointsImg.width / 2, - y: path[0][1] - _vm.mergedConfig.pointsImg.height / 2 - } - }), - _vm._v(" "), - _c( - "text", - { - style: - "fontSize:" + _vm.mergedConfig.text.fontSize + "px;", - attrs: { - fill: _vm.mergedConfig.text.color, - x: path[0][0] + _vm.mergedConfig.text.offset[0], - y: path[0][1] + _vm.mergedConfig.text.offset[1] - } - }, - [_vm._v("\n " + _vm._s(_vm.texts[i]) + "\n ")] - ) + _vm.flylineLengths[i] + ? _c( + "use", + { + attrs: { + "xlink:href": "#" + line.key, + "stroke-width": line.width, + stroke: line.color, + mask: "url(#mask" + _vm.unique + line.key + ")" + } + }, + [ + _c("animate", { + attrs: { + attributeName: "stroke-dasharray", + from: "0, " + _vm.flylineLengths[i], + to: _vm.flylineLengths[i] + ", 0", + dur: line.time, + repeatCount: "indefinite" + } + }) + ] + ) + : _vm._e() ]) }) ], @@ -22583,42 +22989,46 @@ ] ) }; - var __vue_staticRenderFns__$s = []; - __vue_render__$s._withStripped = true; + var __vue_staticRenderFns__$y = []; + __vue_render__$y._withStripped = true; /* style */ - const __vue_inject_styles__$s = function (inject) { + const __vue_inject_styles__$y = function (inject) { if (!inject) return - inject("data-v-767fc190_0", { source: ".dv-flyline-chart {\n display: flex;\n flex-direction: column;\n background-size: 100% 100%;\n}\n.dv-flyline-chart polyline {\n transition: all 0.3s;\n}\n.dv-flyline-chart text {\n text-anchor: middle;\n dominant-baseline: middle;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,aAAa;EACb,sBAAsB;EACtB,0BAA0B;AAC5B;AACA;EACE,oBAAoB;AACtB;AACA;EACE,mBAAmB;EACnB,yBAAyB;AAC3B","file":"main.vue","sourcesContent":[".dv-flyline-chart {\n display: flex;\n flex-direction: column;\n background-size: 100% 100%;\n}\n.dv-flyline-chart polyline {\n transition: all 0.3s;\n}\n.dv-flyline-chart text {\n text-anchor: middle;\n dominant-baseline: middle;\n}\n"]}, media: undefined }); + inject("data-v-a7b8c35c_0", { source: ".dv-flyline-chart-enhanced {\n display: flex;\n flex-direction: column;\n background-size: 100% 100%;\n}\n.dv-flyline-chart-enhanced text {\n text-anchor: middle;\n dominant-baseline: middle;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,aAAa;EACb,sBAAsB;EACtB,0BAA0B;AAC5B;AACA;EACE,mBAAmB;EACnB,yBAAyB;AAC3B","file":"main.vue","sourcesContent":[".dv-flyline-chart-enhanced {\n display: flex;\n flex-direction: column;\n background-size: 100% 100%;\n}\n.dv-flyline-chart-enhanced text {\n text-anchor: middle;\n dominant-baseline: middle;\n}\n"]}, media: undefined }); }; /* scoped */ - const __vue_scope_id__$s = undefined; + const __vue_scope_id__$y = undefined; /* module identifier */ - const __vue_module_identifier__$s = undefined; + const __vue_module_identifier__$y = undefined; /* functional template */ - const __vue_is_functional_template__$s = false; + const __vue_is_functional_template__$y = false; /* style inject SSR */ + /* style inject shadow dom */ + - var FlylineChart = normalizeComponent_1( - { render: __vue_render__$s, staticRenderFns: __vue_staticRenderFns__$s }, - __vue_inject_styles__$s, - __vue_script__$s, - __vue_scope_id__$s, - __vue_is_functional_template__$s, - __vue_module_identifier__$s, - browser, + const __vue_component__$y = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$y, staticRenderFns: __vue_staticRenderFns__$y }, + __vue_inject_styles__$y, + __vue_script__$y, + __vue_scope_id__$y, + __vue_is_functional_template__$y, + __vue_module_identifier__$y, + false, + createInjector, + undefined, undefined ); - function flylineChart (Vue) { - Vue.component(FlylineChart.name, FlylineChart); + function flylineChartEnhanced (Vue) { + Vue.component(__vue_component__$y.name, __vue_component__$y); } // - var script$t = { + var script$z = { name: 'DvConicalColumnChart', mixins: [autoResize], props: { @@ -22799,10 +23209,10 @@ }; /* script */ - const __vue_script__$t = script$t; + const __vue_script__$z = script$z; /* template */ - var __vue_render__$t = function() { + var __vue_render__$z = function() { var _vm = this; var _h = _vm.$createElement; var _c = _vm._self._c || _h; @@ -22862,46 +23272,50 @@ ) ]) }; - var __vue_staticRenderFns__$t = []; - __vue_render__$t._withStripped = true; + var __vue_staticRenderFns__$z = []; + __vue_render__$z._withStripped = true; /* style */ - const __vue_inject_styles__$t = function (inject) { + const __vue_inject_styles__$z = function (inject) { if (!inject) return - inject("data-v-774de7d0_0", { source: ".dv-conical-column-chart {\n width: 100%;\n height: 100%;\n}\n.dv-conical-column-chart text {\n text-anchor: middle;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,WAAW;EACX,YAAY;AACd;AACA;EACE,mBAAmB;AACrB","file":"main.vue","sourcesContent":[".dv-conical-column-chart {\n width: 100%;\n height: 100%;\n}\n.dv-conical-column-chart text {\n text-anchor: middle;\n}\n"]}, media: undefined }); + inject("data-v-382f06c7_0", { source: ".dv-conical-column-chart {\n width: 100%;\n height: 100%;\n}\n.dv-conical-column-chart text {\n text-anchor: middle;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,WAAW;EACX,YAAY;AACd;AACA;EACE,mBAAmB;AACrB","file":"main.vue","sourcesContent":[".dv-conical-column-chart {\n width: 100%;\n height: 100%;\n}\n.dv-conical-column-chart text {\n text-anchor: middle;\n}\n"]}, media: undefined }); }; /* scoped */ - const __vue_scope_id__$t = undefined; + const __vue_scope_id__$z = undefined; /* module identifier */ - const __vue_module_identifier__$t = undefined; + const __vue_module_identifier__$z = undefined; /* functional template */ - const __vue_is_functional_template__$t = false; + const __vue_is_functional_template__$z = false; /* style inject SSR */ + /* style inject shadow dom */ + - var ConicalColumnChart = normalizeComponent_1( - { render: __vue_render__$t, staticRenderFns: __vue_staticRenderFns__$t }, - __vue_inject_styles__$t, - __vue_script__$t, - __vue_scope_id__$t, - __vue_is_functional_template__$t, - __vue_module_identifier__$t, - browser, + const __vue_component__$z = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$z, staticRenderFns: __vue_staticRenderFns__$z }, + __vue_inject_styles__$z, + __vue_script__$z, + __vue_scope_id__$z, + __vue_is_functional_template__$z, + __vue_module_identifier__$z, + false, + createInjector, + undefined, undefined ); function conicalColumnChart (Vue) { - Vue.component(ConicalColumnChart.name, ConicalColumnChart); + Vue.component(__vue_component__$z.name, __vue_component__$z); } function digitalFlop (Vue) { - Vue.component(DigitalFlop.name, DigitalFlop); + Vue.component(__vue_component__$s.name, __vue_component__$s); } // - var script$u = { + var script$A = { name: 'DvScrollBoard', mixins: [autoResize], props: { @@ -22994,13 +23408,28 @@ */ index: false, + /** + * @description index Header + * @type {String} + * @default indexHeader = '#' + */ + indexHeader: '#', + /** * @description Carousel type * @type {String} * @default carousel = 'single' * @example carousel = 'single' | 'page' */ - carousel: 'single' + carousel: 'single', + + /** + * @description Pause scroll when mouse hovered + * @type {Boolean} + * @default hoverPause = true + * @example hoverPause = true | false + */ + hoverPause: true }, mergedConfig: null, header: [], @@ -23011,7 +23440,9 @@ avgHeight: 0, aligns: [], animationIndex: 0, - animationHandler: '' + animationHandler: '', + updater: 0, + needCalc: false }; }, @@ -23022,11 +23453,29 @@ calcData } = this; stopAnimation(); + this.animationIndex = 0; calcData(); } }, methods: { + handleHover(enter, ri, ci, row, ceil) { + const { + mergedConfig, + emitEvent, + stopAnimation, + animation + } = this; + if (enter) emitEvent('mouseover', ri, ci, row, ceil); + if (!mergedConfig.hoverPause) return; + + if (enter) { + stopAnimation(); + } else { + animation(true); + } + }, + afterAutoResizeMixinInit() { const { calcData @@ -23079,7 +23528,8 @@ calcHeaderData() { let { header, - index + index, + indexHeader } = this.mergedConfig; if (!header.length) { @@ -23088,7 +23538,7 @@ } header = [...header]; - if (index) header.unshift('#'); + if (index) header.unshift(indexHeader); this.header = header; }, @@ -23103,7 +23553,7 @@ if (index) { data = data.map((row, i) => { row = [...row]; - const indexTag = `${i + 1}`; + const indexTag = `${i + 1}`; row.unshift(indexTag); return row; }); @@ -23182,12 +23632,25 @@ }, async animation(start = false) { + const { + needCalc, + calcHeights, + calcRowsData + } = this; + + if (needCalc) { + calcRowsData(); + calcHeights(); + this.needCalc = false; + } + let { avgHeight, animationIndex, mergedConfig, rowsData, - animation + animation, + updater } = this; const { waitTime, @@ -23196,13 +23659,19 @@ } = mergedConfig; const rowLength = rowsData.length; if (rowNum >= rowLength) return; - if (start) await new Promise(resolve => setTimeout(resolve, waitTime)); + + if (start) { + await new Promise(resolve => setTimeout(resolve, waitTime)); + if (updater !== this.updater) return; + } + const animationNum = carousel === 'single' ? 1 : rowNum; let rows = rowsData.slice(animationIndex); rows.push(...rowsData.slice(0, animationIndex)); - this.rows = rows; + this.rows = rows.slice(0, carousel === 'page' ? rowNum * 2 : rowNum + 1); this.heights = new Array(rowLength).fill(avgHeight); await new Promise(resolve => setTimeout(resolve, 300)); + if (updater !== this.updater) return; this.heights.splice(0, animationNum, ...new Array(animationNum).fill(0)); animationIndex += animationNum; const back = animationIndex - rowLength; @@ -23213,23 +23682,39 @@ stopAnimation() { const { - animationHandler + animationHandler, + updater } = this; + this.updater = (updater + 1) % 999999; if (!animationHandler) return; clearTimeout(animationHandler); }, - emitEvent(ri, ci, row, ceil) { + emitEvent(type, ri, ci, row, ceil) { const { ceils, rowIndex } = row; - this.$emit('click', { + this.$emit(type, { row: ceils, ceil, rowIndex, columnIndex: ci }); + }, + + updateRows(rows, animationIndex) { + const { + mergedConfig, + animationHandler, + animation + } = this; + this.mergedConfig = { ...mergedConfig, + data: [...rows] + }; + this.needCalc = true; + if (typeof animationIndex === 'number') this.animationIndex = animationIndex; + if (!animationHandler) animation(true); } }, @@ -23244,10 +23729,10 @@ }; /* script */ - const __vue_script__$u = script$u; + const __vue_script__$A = script$A; /* template */ - var __vue_render__$u = function() { + var __vue_render__$A = function() { var _vm = this; var _h = _vm.$createElement; var _c = _vm._self._c || _h; @@ -23261,7 +23746,7 @@ }, _vm._l(_vm.header, function(headerItem, i) { return _c("div", { - key: headerItem + i, + key: "" + headerItem + i, staticClass: "header-item", style: "\n height: " + @@ -23294,7 +23779,7 @@ return _c( "div", { - key: row.toString() + row.scroll, + key: "" + row.toString() + row.scroll, staticClass: "row-item", style: "\n height: " + @@ -23309,14 +23794,20 @@ }, _vm._l(row.ceils, function(ceil, ci) { return _c("div", { - key: ceil + ri + ci, + key: "" + ceil + ri + ci, staticClass: "ceil", style: "width: " + _vm.widths[ci] + "px;", attrs: { align: _vm.aligns[ci] }, domProps: { innerHTML: _vm._s(ceil) }, on: { click: function($event) { - return _vm.emitEvent(ri, ci, row, ceil) + return _vm.emitEvent("click", ri, ci, row, ceil) + }, + mouseenter: function($event) { + return _vm.handleHover(true, ri, ci, row, ceil) + }, + mouseleave: function($event) { + return _vm.handleHover(false) } } }) @@ -23329,42 +23820,46 @@ : _vm._e() ]) }; - var __vue_staticRenderFns__$u = []; - __vue_render__$u._withStripped = true; + var __vue_staticRenderFns__$A = []; + __vue_render__$A._withStripped = true; /* style */ - const __vue_inject_styles__$u = function (inject) { + const __vue_inject_styles__$A = function (inject) { if (!inject) return - inject("data-v-309bd8aa_0", { source: ".dv-scroll-board {\n position: relative;\n width: 100%;\n height: 100%;\n color: #fff;\n}\n.dv-scroll-board .text {\n padding: 0 10px;\n box-sizing: border-box;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.dv-scroll-board .header {\n display: flex;\n flex-direction: row;\n font-size: 15px;\n}\n.dv-scroll-board .header .header-item {\n padding: 0 10px;\n box-sizing: border-box;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n transition: all 0.3s;\n}\n.dv-scroll-board .rows {\n overflow: hidden;\n}\n.dv-scroll-board .rows .row-item {\n display: flex;\n font-size: 14px;\n transition: all 0.3s;\n}\n.dv-scroll-board .rows .ceil {\n padding: 0 10px;\n box-sizing: border-box;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.dv-scroll-board .rows .index {\n border-radius: 3px;\n padding: 0px 3px;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;EACZ,WAAW;AACb;AACA;EACE,eAAe;EACf,sBAAsB;EACtB,mBAAmB;EACnB,gBAAgB;EAChB,uBAAuB;AACzB;AACA;EACE,aAAa;EACb,mBAAmB;EACnB,eAAe;AACjB;AACA;EACE,eAAe;EACf,sBAAsB;EACtB,mBAAmB;EACnB,gBAAgB;EAChB,uBAAuB;EACvB,oBAAoB;AACtB;AACA;EACE,gBAAgB;AAClB;AACA;EACE,aAAa;EACb,eAAe;EACf,oBAAoB;AACtB;AACA;EACE,eAAe;EACf,sBAAsB;EACtB,mBAAmB;EACnB,gBAAgB;EAChB,uBAAuB;AACzB;AACA;EACE,kBAAkB;EAClB,gBAAgB;AAClB","file":"main.vue","sourcesContent":[".dv-scroll-board {\n position: relative;\n width: 100%;\n height: 100%;\n color: #fff;\n}\n.dv-scroll-board .text {\n padding: 0 10px;\n box-sizing: border-box;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.dv-scroll-board .header {\n display: flex;\n flex-direction: row;\n font-size: 15px;\n}\n.dv-scroll-board .header .header-item {\n padding: 0 10px;\n box-sizing: border-box;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n transition: all 0.3s;\n}\n.dv-scroll-board .rows {\n overflow: hidden;\n}\n.dv-scroll-board .rows .row-item {\n display: flex;\n font-size: 14px;\n transition: all 0.3s;\n}\n.dv-scroll-board .rows .ceil {\n padding: 0 10px;\n box-sizing: border-box;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.dv-scroll-board .rows .index {\n border-radius: 3px;\n padding: 0px 3px;\n}\n"]}, media: undefined }); + inject("data-v-26e19f4c_0", { source: ".dv-scroll-board {\n position: relative;\n width: 100%;\n height: 100%;\n color: #fff;\n}\n.dv-scroll-board .text {\n padding: 0 10px;\n box-sizing: border-box;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.dv-scroll-board .header {\n display: flex;\n flex-direction: row;\n font-size: 15px;\n}\n.dv-scroll-board .header .header-item {\n padding: 0 10px;\n box-sizing: border-box;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n transition: all 0.3s;\n}\n.dv-scroll-board .rows {\n overflow: hidden;\n}\n.dv-scroll-board .rows .row-item {\n display: flex;\n font-size: 14px;\n transition: all 0.3s;\n}\n.dv-scroll-board .rows .ceil {\n padding: 0 10px;\n box-sizing: border-box;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.dv-scroll-board .rows .index {\n border-radius: 3px;\n padding: 0px 3px;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;EACZ,WAAW;AACb;AACA;EACE,eAAe;EACf,sBAAsB;EACtB,mBAAmB;EACnB,gBAAgB;EAChB,uBAAuB;AACzB;AACA;EACE,aAAa;EACb,mBAAmB;EACnB,eAAe;AACjB;AACA;EACE,eAAe;EACf,sBAAsB;EACtB,mBAAmB;EACnB,gBAAgB;EAChB,uBAAuB;EACvB,oBAAoB;AACtB;AACA;EACE,gBAAgB;AAClB;AACA;EACE,aAAa;EACb,eAAe;EACf,oBAAoB;AACtB;AACA;EACE,eAAe;EACf,sBAAsB;EACtB,mBAAmB;EACnB,gBAAgB;EAChB,uBAAuB;AACzB;AACA;EACE,kBAAkB;EAClB,gBAAgB;AAClB","file":"main.vue","sourcesContent":[".dv-scroll-board {\n position: relative;\n width: 100%;\n height: 100%;\n color: #fff;\n}\n.dv-scroll-board .text {\n padding: 0 10px;\n box-sizing: border-box;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.dv-scroll-board .header {\n display: flex;\n flex-direction: row;\n font-size: 15px;\n}\n.dv-scroll-board .header .header-item {\n padding: 0 10px;\n box-sizing: border-box;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n transition: all 0.3s;\n}\n.dv-scroll-board .rows {\n overflow: hidden;\n}\n.dv-scroll-board .rows .row-item {\n display: flex;\n font-size: 14px;\n transition: all 0.3s;\n}\n.dv-scroll-board .rows .ceil {\n padding: 0 10px;\n box-sizing: border-box;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.dv-scroll-board .rows .index {\n border-radius: 3px;\n padding: 0px 3px;\n}\n"]}, media: undefined }); }; /* scoped */ - const __vue_scope_id__$u = undefined; + const __vue_scope_id__$A = undefined; /* module identifier */ - const __vue_module_identifier__$u = undefined; + const __vue_module_identifier__$A = undefined; /* functional template */ - const __vue_is_functional_template__$u = false; + const __vue_is_functional_template__$A = false; /* style inject SSR */ + /* style inject shadow dom */ + - var ScrollBoard = normalizeComponent_1( - { render: __vue_render__$u, staticRenderFns: __vue_staticRenderFns__$u }, - __vue_inject_styles__$u, - __vue_script__$u, - __vue_scope_id__$u, - __vue_is_functional_template__$u, - __vue_module_identifier__$u, - browser, + const __vue_component__$A = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$A, staticRenderFns: __vue_staticRenderFns__$A }, + __vue_inject_styles__$A, + __vue_script__$A, + __vue_scope_id__$A, + __vue_is_functional_template__$A, + __vue_module_identifier__$A, + false, + createInjector, + undefined, undefined ); function scrollBoard (Vue) { - Vue.component(ScrollBoard.name, ScrollBoard); + Vue.component(__vue_component__$A.name, __vue_component__$A); } // - var script$v = { + var script$B = { name: 'DvScrollRankingBoard', mixins: [autoResize], props: { @@ -23413,14 +23908,29 @@ * @default unit = '' * @example unit = 'ton' */ - unit: '' + unit: '', + + /** + * @description Auto sort by value + * @type {Boolean} + * @default sort = true + */ + sort: true, + + /** + * @description Value formatter + * @type {Function} + * @default valueFormatter = null + */ + valueFormatter: null }, mergedConfig: null, rowsData: [], rows: [], heights: [], animationIndex: 0, - animationHandler: '' + animationHandler: '', + updater: 0 }; }, @@ -23480,9 +23990,10 @@ calcRowsData() { let { data, - rowNum + rowNum, + sort } = this.mergedConfig; - data.sort(({ + sort && data.sort(({ value: a }, { value: b @@ -23494,10 +24005,14 @@ const value = data.map(({ value }) => value); - const max = Math.max(...value) || 0; + const min = Math.min(...value) || 0; // abs of min + + const minAbs = Math.abs(min); + const max = Math.max(...value) || 0; // abs of max + const total = max + minAbs; data = data.map((row, i) => ({ ...row, ranking: i + 1, - percent: row.value / max * 100 + percent: (row.value + minAbs) / total * 100 })); const rowLength = data.length; @@ -23532,7 +24047,8 @@ animationIndex, mergedConfig, rowsData, - animation + animation, + updater } = this; const { waitTime, @@ -23541,13 +24057,19 @@ } = mergedConfig; const rowLength = rowsData.length; if (rowNum >= rowLength) return; - if (start) await new Promise(resolve => setTimeout(resolve, waitTime)); + + if (start) { + await new Promise(resolve => setTimeout(resolve, waitTime)); + if (updater !== this.updater) return; + } + const animationNum = carousel === 'single' ? 1 : rowNum; let rows = rowsData.slice(animationIndex); rows.push(...rowsData.slice(0, animationIndex)); - this.rows = rows; + this.rows = rows.slice(0, rowNum + 1); this.heights = new Array(rowLength).fill(avgHeight); await new Promise(resolve => setTimeout(resolve, 300)); + if (updater !== this.updater) return; this.heights.splice(0, animationNum, ...new Array(animationNum).fill(0)); animationIndex += animationNum; const back = animationIndex - rowLength; @@ -23558,8 +24080,10 @@ stopAnimation() { const { - animationHandler + animationHandler, + updater } = this; + this.updater = (updater + 1) % 999999; if (!animationHandler) return; clearTimeout(animationHandler); } @@ -23576,10 +24100,10 @@ }; /* script */ - const __vue_script__$v = script$v; + const __vue_script__$B = script$B; /* template */ - var __vue_render__$v = function() { + var __vue_render__$B = function() { var _vm = this; var _h = _vm.$createElement; var _c = _vm._self._c || _h; @@ -23600,12 +24124,19 @@ _vm._v("No." + _vm._s(item.ranking)) ]), _vm._v(" "), - _c("div", { staticClass: "info-name" }, [ - _vm._v(_vm._s(item.name)) - ]), + _c("div", { + staticClass: "info-name", + domProps: { innerHTML: _vm._s(item.name) } + }), _vm._v(" "), _c("div", { staticClass: "ranking-value" }, [ - _vm._v(_vm._s(item.value + _vm.mergedConfig.unit)) + _vm._v( + _vm._s( + _vm.mergedConfig.valueFormatter + ? _vm.mergedConfig.valueFormatter(item) + : item.value + _vm.mergedConfig.unit + ) + ) ]) ]), _vm._v(" "), @@ -23625,38 +24156,42 @@ 0 ) }; - var __vue_staticRenderFns__$v = []; - __vue_render__$v._withStripped = true; + var __vue_staticRenderFns__$B = []; + __vue_render__$B._withStripped = true; /* style */ - const __vue_inject_styles__$v = function (inject) { + const __vue_inject_styles__$B = function (inject) { if (!inject) return - inject("data-v-e8124c14_0", { source: ".dv-scroll-ranking-board {\n width: 100%;\n height: 100%;\n color: #fff;\n overflow: hidden;\n}\n.dv-scroll-ranking-board .row-item {\n transition: all 0.3s;\n display: flex;\n flex-direction: column;\n justify-content: center;\n overflow: hidden;\n}\n.dv-scroll-ranking-board .ranking-info {\n display: flex;\n width: 100%;\n font-size: 13px;\n}\n.dv-scroll-ranking-board .ranking-info .rank {\n width: 40px;\n color: #1370fb;\n}\n.dv-scroll-ranking-board .ranking-info .info-name {\n flex: 1;\n}\n.dv-scroll-ranking-board .ranking-column {\n border-bottom: 2px solid rgba(19, 112, 251, 0.5);\n margin-top: 5px;\n}\n.dv-scroll-ranking-board .ranking-column .inside-column {\n position: relative;\n height: 6px;\n background-color: #1370fb;\n margin-bottom: 2px;\n border-radius: 1px;\n overflow: hidden;\n}\n.dv-scroll-ranking-board .ranking-column .shine {\n position: absolute;\n left: 0%;\n top: 2px;\n height: 2px;\n width: 50px;\n transform: translateX(-100%);\n background: radial-gradient(#28f8ff 5%, transparent 80%);\n animation: shine 3s ease-in-out infinite alternate;\n}\n@keyframes shine {\n80% {\n left: 0%;\n transform: translateX(-100%);\n}\n100% {\n left: 100%;\n transform: translateX(0%);\n}\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,WAAW;EACX,YAAY;EACZ,WAAW;EACX,gBAAgB;AAClB;AACA;EACE,oBAAoB;EACpB,aAAa;EACb,sBAAsB;EACtB,uBAAuB;EACvB,gBAAgB;AAClB;AACA;EACE,aAAa;EACb,WAAW;EACX,eAAe;AACjB;AACA;EACE,WAAW;EACX,cAAc;AAChB;AACA;EACE,OAAO;AACT;AACA;EACE,gDAAgD;EAChD,eAAe;AACjB;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,yBAAyB;EACzB,kBAAkB;EAClB,kBAAkB;EAClB,gBAAgB;AAClB;AACA;EACE,kBAAkB;EAClB,QAAQ;EACR,QAAQ;EACR,WAAW;EACX,WAAW;EACX,4BAA4B;EAC5B,wDAAwD;EACxD,kDAAkD;AACpD;AACA;AACE;IACE,QAAQ;IACR,4BAA4B;AAC9B;AACA;IACE,UAAU;IACV,yBAAyB;AAC3B;AACF","file":"main.vue","sourcesContent":[".dv-scroll-ranking-board {\n width: 100%;\n height: 100%;\n color: #fff;\n overflow: hidden;\n}\n.dv-scroll-ranking-board .row-item {\n transition: all 0.3s;\n display: flex;\n flex-direction: column;\n justify-content: center;\n overflow: hidden;\n}\n.dv-scroll-ranking-board .ranking-info {\n display: flex;\n width: 100%;\n font-size: 13px;\n}\n.dv-scroll-ranking-board .ranking-info .rank {\n width: 40px;\n color: #1370fb;\n}\n.dv-scroll-ranking-board .ranking-info .info-name {\n flex: 1;\n}\n.dv-scroll-ranking-board .ranking-column {\n border-bottom: 2px solid rgba(19, 112, 251, 0.5);\n margin-top: 5px;\n}\n.dv-scroll-ranking-board .ranking-column .inside-column {\n position: relative;\n height: 6px;\n background-color: #1370fb;\n margin-bottom: 2px;\n border-radius: 1px;\n overflow: hidden;\n}\n.dv-scroll-ranking-board .ranking-column .shine {\n position: absolute;\n left: 0%;\n top: 2px;\n height: 2px;\n width: 50px;\n transform: translateX(-100%);\n background: radial-gradient(#28f8ff 5%, transparent 80%);\n animation: shine 3s ease-in-out infinite alternate;\n}\n@keyframes shine {\n 80% {\n left: 0%;\n transform: translateX(-100%);\n }\n 100% {\n left: 100%;\n transform: translateX(0%);\n }\n}\n"]}, media: undefined }); + inject("data-v-f297519a_0", { source: ".dv-scroll-ranking-board {\n width: 100%;\n height: 100%;\n color: #fff;\n overflow: hidden;\n}\n.dv-scroll-ranking-board .row-item {\n transition: all 0.3s;\n display: flex;\n flex-direction: column;\n justify-content: center;\n overflow: hidden;\n}\n.dv-scroll-ranking-board .ranking-info {\n display: flex;\n width: 100%;\n font-size: 13px;\n}\n.dv-scroll-ranking-board .ranking-info .rank {\n width: 40px;\n color: #1370fb;\n}\n.dv-scroll-ranking-board .ranking-info .info-name {\n flex: 1;\n}\n.dv-scroll-ranking-board .ranking-column {\n border-bottom: 2px solid rgba(19, 112, 251, 0.5);\n margin-top: 5px;\n}\n.dv-scroll-ranking-board .ranking-column .inside-column {\n position: relative;\n height: 6px;\n background-color: #1370fb;\n margin-bottom: 2px;\n border-radius: 1px;\n overflow: hidden;\n}\n.dv-scroll-ranking-board .ranking-column .shine {\n position: absolute;\n left: 0%;\n top: 2px;\n height: 2px;\n width: 50px;\n transform: translateX(-100%);\n background: radial-gradient(#28f8ff 5%, transparent 80%);\n animation: shine 3s ease-in-out infinite alternate;\n}\n@keyframes shine {\n80% {\n left: 0%;\n transform: translateX(-100%);\n}\n100% {\n left: 100%;\n transform: translateX(0%);\n}\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,WAAW;EACX,YAAY;EACZ,WAAW;EACX,gBAAgB;AAClB;AACA;EACE,oBAAoB;EACpB,aAAa;EACb,sBAAsB;EACtB,uBAAuB;EACvB,gBAAgB;AAClB;AACA;EACE,aAAa;EACb,WAAW;EACX,eAAe;AACjB;AACA;EACE,WAAW;EACX,cAAc;AAChB;AACA;EACE,OAAO;AACT;AACA;EACE,gDAAgD;EAChD,eAAe;AACjB;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,yBAAyB;EACzB,kBAAkB;EAClB,kBAAkB;EAClB,gBAAgB;AAClB;AACA;EACE,kBAAkB;EAClB,QAAQ;EACR,QAAQ;EACR,WAAW;EACX,WAAW;EACX,4BAA4B;EAC5B,wDAAwD;EACxD,kDAAkD;AACpD;AACA;AACE;IACE,QAAQ;IACR,4BAA4B;AAC9B;AACA;IACE,UAAU;IACV,yBAAyB;AAC3B;AACF","file":"main.vue","sourcesContent":[".dv-scroll-ranking-board {\n width: 100%;\n height: 100%;\n color: #fff;\n overflow: hidden;\n}\n.dv-scroll-ranking-board .row-item {\n transition: all 0.3s;\n display: flex;\n flex-direction: column;\n justify-content: center;\n overflow: hidden;\n}\n.dv-scroll-ranking-board .ranking-info {\n display: flex;\n width: 100%;\n font-size: 13px;\n}\n.dv-scroll-ranking-board .ranking-info .rank {\n width: 40px;\n color: #1370fb;\n}\n.dv-scroll-ranking-board .ranking-info .info-name {\n flex: 1;\n}\n.dv-scroll-ranking-board .ranking-column {\n border-bottom: 2px solid rgba(19, 112, 251, 0.5);\n margin-top: 5px;\n}\n.dv-scroll-ranking-board .ranking-column .inside-column {\n position: relative;\n height: 6px;\n background-color: #1370fb;\n margin-bottom: 2px;\n border-radius: 1px;\n overflow: hidden;\n}\n.dv-scroll-ranking-board .ranking-column .shine {\n position: absolute;\n left: 0%;\n top: 2px;\n height: 2px;\n width: 50px;\n transform: translateX(-100%);\n background: radial-gradient(#28f8ff 5%, transparent 80%);\n animation: shine 3s ease-in-out infinite alternate;\n}\n@keyframes shine {\n 80% {\n left: 0%;\n transform: translateX(-100%);\n }\n 100% {\n left: 100%;\n transform: translateX(0%);\n }\n}\n"]}, media: undefined }); }; /* scoped */ - const __vue_scope_id__$v = undefined; + const __vue_scope_id__$B = undefined; /* module identifier */ - const __vue_module_identifier__$v = undefined; + const __vue_module_identifier__$B = undefined; /* functional template */ - const __vue_is_functional_template__$v = false; + const __vue_is_functional_template__$B = false; /* style inject SSR */ + /* style inject shadow dom */ + - var ScrollRankingBoard = normalizeComponent_1( - { render: __vue_render__$v, staticRenderFns: __vue_staticRenderFns__$v }, - __vue_inject_styles__$v, - __vue_script__$v, - __vue_scope_id__$v, - __vue_is_functional_template__$v, - __vue_module_identifier__$v, - browser, + const __vue_component__$B = /*#__PURE__*/normalizeComponent( + { render: __vue_render__$B, staticRenderFns: __vue_staticRenderFns__$B }, + __vue_inject_styles__$B, + __vue_script__$B, + __vue_scope_id__$B, + __vue_is_functional_template__$B, + __vue_module_identifier__$B, + false, + createInjector, + undefined, undefined ); function scrollRankingBoard (Vue) { - Vue.component(ScrollRankingBoard.name, ScrollRankingBoard); + Vue.component(__vue_component__$B.name, __vue_component__$B); } /** @@ -23679,7 +24214,10 @@ Vue.use(borderBox7); Vue.use(borderBox8); Vue.use(borderBox9); - Vue.use(borderBox10); // decoration + Vue.use(borderBox10); + Vue.use(borderBox11); + Vue.use(borderBox12); + Vue.use(borderBox13); // decoration Vue.use(decoration1); Vue.use(decoration2); @@ -23690,7 +24228,9 @@ Vue.use(decoration7); Vue.use(decoration8); Vue.use(decoration9); - Vue.use(decoration10); // charts + Vue.use(decoration10); + Vue.use(decoration11); + Vue.use(decoration12); // charts Vue.use(charts); Vue.use(activeRingChart); @@ -23698,6 +24238,7 @@ Vue.use(waterLevelPond); Vue.use(percentPond); Vue.use(flylineChart); + Vue.use(flylineChartEnhanced); Vue.use(conicalColumnChart); Vue.use(digitalFlop); Vue.use(scrollBoard); @@ -23706,4 +24247,4 @@ Vue.use(datav); -})); +}))); diff --git a/dist/datav.min.vue.js b/dist/datav.min.vue.js index 413d951..cebd47f 100644 --- a/dist/datav.min.vue.js +++ b/dist/datav.min.vue.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("vue")):"function"==typeof define&&define.amd?define(["vue"],t):t((e=e||self).Vue)}(this,(function(e){"use strict";function t(e,t){return 1===arguments.length?parseInt(Math.random()*e+1,10):parseInt(Math.random()*(t-e+1)+e,10)}function n(e,t){const n=Math.abs(e[0]-t[0]),r=Math.abs(e[1]-t[1]);return Math.sqrt(n*n+r*r)}e=e&&e.hasOwnProperty("default")?e.default:e;var r={data:()=>({dom:"",width:0,height:0,debounceInitWHFun:"",domObserver:""}),methods:{async autoResizeMixinInit(){const{initWH:e,getDebounceInitWHFun:t,bindDomResizeCallback:n,afterAutoResizeMixinInit:r}=this;await e(!1),t(),n(),"function"==typeof r&&r()},initWH(e=!0){const{$nextTick:t,$refs:n,ref:r,onResize:i}=this;return new Promise(o=>{t(t=>{const a=this.dom=n[r];this.width=a.clientWidth,this.height=a.clientHeight,"function"==typeof i&&e&&i(),o()})})},getDebounceInitWHFun(){const{initWH:e}=this;this.debounceInitWHFun=function(e,t){let n;return function(){clearTimeout(n);const[r,i]=[this,arguments];n=setTimeout(()=>{t.apply(r,i)},e)}}(100,e)},bindDomResizeCallback(){const{dom:e,debounceInitWHFun:t}=this;this.domObserver=function(e,t){const n=new(window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver)(t);return n.observe(e,{attributes:!0,attributeFilter:["style"],attributeOldValue:!0}),n}(e,t),window.addEventListener("resize",t)},unbindDomResizeCallback(){let{domObserver:e,debounceInitWHFun:t}=this;e.disconnect(),e.takeRecords(),e=null,window.removeEventListener("resize",t)}},mounted(){const{autoResizeMixinInit:e}=this;e()},beforeDestroy(){const{unbindDomResizeCallback:e}=this;e()}},i={name:"DvFullScreenContainer",mixins:[r],data:()=>({ref:"full-screen-container",allWidth:0,scale:0,datavRoot:"",ready:!1}),methods:{afterAutoResizeMixinInit(){const{initConfig:e,setAppScale:t}=this;e(),t(),this.ready=!0},initConfig(){const{dom:e}=this,{width:t,height:n}=screen;this.allWidth=t,e.style.width=`${t}px`,e.style.height=`${n}px`},setAppScale(){const{allWidth:e,dom:t}=this,n=document.body.clientWidth;t.style.transform=`scale(${n/e})`},onResize(){const{setAppScale:e}=this;e()}}};var o,a=function(e,t,n,r,i,o,a,s,l,c){"boolean"!=typeof a&&(l=s,s=a,a=!1);var u,d="function"==typeof n?n.options:n;if(e&&e.render&&(d.render=e.render,d.staticRenderFns=e.staticRenderFns,d._compiled=!0,i&&(d.functional=!0)),r&&(d._scopeId=r),o?(u=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,l(e)),e&&e._registeredComponents&&e._registeredComponents.add(o)},d._ssrRegister=u):t&&(u=a?function(){t.call(this,c(this.$root.$options.shadowRoot))}:function(e){t.call(this,s(e))}),u)if(d.functional){var f=d.render;d.render=function(e,t){return u.call(t),f(e,t)}}else{var h=d.beforeCreate;d.beforeCreate=h?[].concat(h,u):[u]}return n},s="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());var l={};var c=function(e){return function(e,t){return function(e,t){var n=s?t.media||"default":e,r=l[n]||(l[n]={ids:new Set,styles:[]});if(!r.ids.has(e)){r.ids.add(e);var i=t.source;if(t.map&&(i+="\n/*# sourceURL="+t.map.sources[0]+" */",i+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(t.map))))+" */"),r.element||(r.element=document.createElement("style"),r.element.type="text/css",t.media&&r.element.setAttribute("media",t.media),void 0===o&&(o=document.head||document.getElementsByTagName("head")[0]),o.appendChild(r.element)),"styleSheet"in r.element)r.styles.push(i),r.element.styleSheet.cssText=r.styles.filter(Boolean).join("\n");else{var a=r.ids.size-1,c=document.createTextNode(i),u=r.element.childNodes;u[a]&&r.element.removeChild(u[a]),u.length?r.element.insertBefore(c,u[a]):r.element.appendChild(c)}}}(e,t)}};const u=i;var d=function(){var e=this.$createElement;return(this._self._c||e)("div",{ref:this.ref,attrs:{id:"dv-full-screen-container"}},[this.ready?[this._t("default")]:this._e()],2)};d._withStripped=!0;var f=a({render:d,staticRenderFns:[]},(function(e){e&&e("data-v-39d8efee_0",{source:"#dv-full-screen-container {\n position: fixed;\n top: 0px;\n left: 0px;\n overflow: hidden;\n transform-origin: left top;\n z-index: 999;\n}\n",map:{version:3,sources:["main.vue"],names:[],mappings:"AAAA;EACE,eAAe;EACf,QAAQ;EACR,SAAS;EACT,gBAAgB;EAChB,0BAA0B;EAC1B,YAAY;AACd",file:"main.vue",sourcesContent:["#dv-full-screen-container {\n position: fixed;\n top: 0px;\n left: 0px;\n overflow: hidden;\n transform-origin: left top;\n z-index: 999;\n}\n"]},media:void 0})}),u,void 0,!1,void 0,c,void 0);function h(e){e.component(f.name,f)}const p={name:"DvLoading"};var v=function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"dv-loading"},[t("svg",{attrs:{width:"50px",height:"50px"}},[t("circle",{attrs:{cx:"25",cy:"25",r:"20",fill:"transparent","stroke-width":"3","stroke-dasharray":"31.415, 31.415",stroke:"#02bcfe","stroke-linecap":"round"}},[t("animateTransform",{attrs:{attributeName:"transform",type:"rotate",values:"0, 25 25;360, 25 25",dur:"1.5s",repeatCount:"indefinite"}}),this._v(" "),t("animate",{attrs:{attributeName:"stroke",values:"#02bcfe;#3be6cb;#02bcfe",dur:"3s",repeatCount:"indefinite"}})],1),this._v(" "),t("circle",{attrs:{cx:"25",cy:"25",r:"10",fill:"transparent","stroke-width":"3","stroke-dasharray":"15.7, 15.7",stroke:"#3be6cb","stroke-linecap":"round"}},[t("animateTransform",{attrs:{attributeName:"transform",type:"rotate",values:"360, 25 25;0, 25 25",dur:"1.5s",repeatCount:"indefinite"}}),this._v(" "),t("animate",{attrs:{attributeName:"stroke",values:"#3be6cb;#02bcfe;#3be6cb",dur:"3s",repeatCount:"indefinite"}})],1)]),this._v(" "),t("div",{staticClass:"loading-tip"},[this._t("default")],2)])};v._withStripped=!0;var g=a({render:v,staticRenderFns:[]},(function(e){e&&e("data-v-b0e29178_0",{source:".dv-loading {\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n.dv-loading .loading-tip {\n font-size: 15px;\n}\n",map:{version:3,sources:["main.vue"],names:[],mappings:"AAAA;EACE,WAAW;EACX,YAAY;EACZ,aAAa;EACb,sBAAsB;EACtB,uBAAuB;EACvB,mBAAmB;AACrB;AACA;EACE,eAAe;AACjB",file:"main.vue",sourcesContent:[".dv-loading {\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n.dv-loading .loading-tip {\n font-size: 15px;\n}\n"]},media:void 0})}),p,void 0,!1,void 0,c,void 0);function m(e){e.component(g.name,g)}const A={name:"DvBorderBox1",data:()=>({border:["left-top","right-top","left-bottom","right-bottom"]})};var b=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"dv-border-box-1"},[e._l(e.border,(function(t){return n("svg",{key:t,class:t+" border",attrs:{width:"150px",height:"150px"}},[n("polygon",{attrs:{fill:"#4fd2dd",points:"6,66 6,18 12,12 18,12 24,6 27,6 30,9 36,9 39,6 84,6 81,9 75,9 73.2,7 40.8,7 37.8,10.2 24,10.2 12,21 12,24 9,27 9,51 7.8,54 7.8,63"}},[n("animate",{attrs:{attributeName:"fill",values:"#4fd2dd;#235fa7;#4fd2dd",dur:"0.5s",begin:"0s",repeatCount:"indefinite"}})]),e._v(" "),n("polygon",{attrs:{fill:"#235fa7",points:"27.599999999999998,4.8 38.4,4.8 35.4,7.8 30.599999999999998,7.8"}},[n("animate",{attrs:{attributeName:"fill",values:"#235fa7;#4fd2dd;#235fa7",dur:"0.5s",begin:"0s",repeatCount:"indefinite"}})]),e._v(" "),n("polygon",{attrs:{fill:"#4fd2dd",points:"9,54 9,63 7.199999999999999,66 7.199999999999999,75 7.8,78 7.8,110 8.4,110 8.4,66 9.6,66 9.6,54"}},[n("animate",{attrs:{attributeName:"fill",values:"#4fd2dd;#235fa7;transparent",dur:"1s",begin:"0s",repeatCount:"indefinite"}})])])})),e._v(" "),n("div",{staticClass:"border-box-content"},[e._t("default")],2)],2)};b._withStripped=!0;var y=a({render:b,staticRenderFns:[]},(function(e){e&&e("data-v-53e01884_0",{source:".dv-border-box-1 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-1 .border {\n position: absolute;\n display: block;\n}\n.dv-border-box-1 .right-top {\n right: 0px;\n transform: rotateY(180deg);\n}\n.dv-border-box-1 .left-bottom {\n bottom: 0px;\n transform: rotateX(180deg);\n}\n.dv-border-box-1 .right-bottom {\n right: 0px;\n bottom: 0px;\n transform: rotateX(180deg) rotateY(180deg);\n}\n.dv-border-box-1 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n",map:{version:3,sources:["main.vue"],names:[],mappings:"AAAA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd;AACA;EACE,kBAAkB;EAClB,cAAc;AAChB;AACA;EACE,UAAU;EACV,0BAA0B;AAC5B;AACA;EACE,WAAW;EACX,0BAA0B;AAC5B;AACA;EACE,UAAU;EACV,WAAW;EACX,0CAA0C;AAC5C;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd",file:"main.vue",sourcesContent:[".dv-border-box-1 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-1 .border {\n position: absolute;\n display: block;\n}\n.dv-border-box-1 .right-top {\n right: 0px;\n transform: rotateY(180deg);\n}\n.dv-border-box-1 .left-bottom {\n bottom: 0px;\n transform: rotateX(180deg);\n}\n.dv-border-box-1 .right-bottom {\n right: 0px;\n bottom: 0px;\n transform: rotateX(180deg) rotateY(180deg);\n}\n.dv-border-box-1 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n"]},media:void 0})}),A,void 0,!1,void 0,c,void 0);function C(e){e.component(y.name,y)}const x={name:"DvBorderBox2",mixins:[r],data:()=>({ref:"border-box-2"})};var w=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{ref:e.ref,staticClass:"dv-border-box-2"},[n("svg",{staticClass:"dv-border-svg-container",attrs:{width:e.width,height:e.height}},[n("polyline",{staticClass:"dv-bb2-line1",attrs:{points:"2, 2 "+(e.width-2)+" ,2 "+(e.width-2)+", "+(e.height-2)+" 2, "+(e.height-2)+" 2, 2"}}),e._v(" "),n("polyline",{staticClass:"dv-bb2-line2",attrs:{points:"6, 6 "+(e.width-6)+", 6 "+(e.width-6)+", "+(e.height-6)+" 6, "+(e.height-6)+" 6, 6"}}),e._v(" "),n("circle",{attrs:{cx:"11",cy:"11",r:"1"}}),e._v(" "),n("circle",{attrs:{cx:e.width-11,cy:"11",r:"1"}}),e._v(" "),n("circle",{attrs:{cx:e.width-11,cy:e.height-11,r:"1"}}),e._v(" "),n("circle",{attrs:{cx:"11",cy:e.height-11,r:"1"}})]),e._v(" "),n("div",{staticClass:"border-box-content"},[e._t("default")],2)])};w._withStripped=!0;var E=a({render:w,staticRenderFns:[]},(function(e){e&&e("data-v-2c14f4ac_0",{source:".dv-border-box-2 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-2 .dv-border-svg-container {\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0px;\n left: 0px;\n}\n.dv-border-box-2 .dv-border-svg-container polyline {\n fill: none;\n stroke-width: 1;\n}\n.dv-border-box-2 .dv-border-svg-container circle {\n fill: #fff;\n}\n.dv-border-box-2 .dv-bb2-line1 {\n stroke: #fff;\n}\n.dv-border-box-2 .dv-bb2-line2 {\n stroke: rgba(255, 255, 255, 0.6);\n}\n.dv-border-box-2 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n",map:{version:3,sources:["main.vue"],names:[],mappings:"AAAA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;EACZ,QAAQ;EACR,SAAS;AACX;AACA;EACE,UAAU;EACV,eAAe;AACjB;AACA;EACE,UAAU;AACZ;AACA;EACE,YAAY;AACd;AACA;EACE,gCAAgC;AAClC;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd",file:"main.vue",sourcesContent:[".dv-border-box-2 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-2 .dv-border-svg-container {\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0px;\n left: 0px;\n}\n.dv-border-box-2 .dv-border-svg-container polyline {\n fill: none;\n stroke-width: 1;\n}\n.dv-border-box-2 .dv-border-svg-container circle {\n fill: #fff;\n}\n.dv-border-box-2 .dv-bb2-line1 {\n stroke: #fff;\n}\n.dv-border-box-2 .dv-bb2-line2 {\n stroke: rgba(255, 255, 255, 0.6);\n}\n.dv-border-box-2 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n"]},media:void 0})}),x,void 0,!1,void 0,c,void 0);function k(e){e.component(E.name,E)}const B={name:"DvBorderBox3",mixins:[r],data:()=>({ref:"border-box-3"})};var P=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{ref:e.ref,staticClass:"dv-border-box-3"},[n("svg",{staticClass:"dv-border-svg-container",attrs:{width:e.width,height:e.height}},[n("polyline",{staticClass:"dv-bb3-line1",attrs:{points:"4, 4 "+(e.width-22)+" ,4 "+(e.width-22)+", "+(e.height-22)+" 4, "+(e.height-22)+" 4, 4"}}),e._v(" "),n("polyline",{staticClass:"dv-bb3-line2",attrs:{points:"10, 10 "+(e.width-16)+", 10 "+(e.width-16)+", "+(e.height-16)+" 10, "+(e.height-16)+" 10, 10"}}),e._v(" "),n("polyline",{staticClass:"dv-bb3-line2",attrs:{points:"16, 16 "+(e.width-10)+", 16 "+(e.width-10)+", "+(e.height-10)+" 16, "+(e.height-10)+" 16, 16"}}),e._v(" "),n("polyline",{staticClass:"dv-bb3-line2",attrs:{points:"22, 22 "+(e.width-4)+", 22 "+(e.width-4)+", "+(e.height-4)+" 22, "+(e.height-4)+" 22, 22"}})]),e._v(" "),n("div",{staticClass:"border-box-content"},[e._t("default")],2)])};P._withStripped=!0;var _=a({render:P,staticRenderFns:[]},(function(e){e&&e("data-v-f2ff245a_0",{source:".dv-border-box-3 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-3 .dv-border-svg-container {\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0px;\n left: 0px;\n}\n.dv-border-box-3 .dv-border-svg-container polyline {\n fill: none;\n stroke: #2862b7;\n}\n.dv-border-box-3 .dv-bb3-line1 {\n stroke-width: 3;\n}\n.dv-border-box-3 .dv-bb3-line2 {\n stroke-width: 1;\n}\n.dv-border-box-3 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n",map:{version:3,sources:["main.vue"],names:[],mappings:"AAAA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;EACZ,QAAQ;EACR,SAAS;AACX;AACA;EACE,UAAU;EACV,eAAe;AACjB;AACA;EACE,eAAe;AACjB;AACA;EACE,eAAe;AACjB;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd",file:"main.vue",sourcesContent:[".dv-border-box-3 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-3 .dv-border-svg-container {\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0px;\n left: 0px;\n}\n.dv-border-box-3 .dv-border-svg-container polyline {\n fill: none;\n stroke: #2862b7;\n}\n.dv-border-box-3 .dv-bb3-line1 {\n stroke-width: 3;\n}\n.dv-border-box-3 .dv-bb3-line2 {\n stroke-width: 1;\n}\n.dv-border-box-3 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n"]},media:void 0})}),B,void 0,!1,void 0,c,void 0);function S(e){e.component(_.name,_)}const O={name:"DvBorderBox4",mixins:[r],data:()=>({ref:"border-box-4"}),props:{reverse:{type:Boolean,default:!1}}};var I=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{ref:e.ref,staticClass:"dv-border-box-4"},[n("svg",{class:"dv-border-svg-container "+(e.reverse&&"dv-reverse"),attrs:{width:e.width,height:e.height}},[n("polyline",{staticClass:"dv-bb4-line-1",attrs:{points:"145, "+(e.height-5)+" 40, "+(e.height-5)+" 10, "+(e.height-35)+"\n 10, 40 40, 5 150, 5 170, 20 "+(e.width-15)+", 20"}}),e._v(" "),n("polyline",{staticClass:"dv-bb4-line-2",attrs:{points:"245, "+(e.height-1)+" 36, "+(e.height-1)+" 14, "+(e.height-23)+"\n 14, "+(e.height-100)}}),e._v(" "),n("polyline",{staticClass:"dv-bb4-line-3",attrs:{points:"7, "+(e.height-40)+" 7, "+(e.height-75)}}),e._v(" "),n("polyline",{staticClass:"dv-bb4-line-4",attrs:{points:"28, 24 13, 41 13, 64"}}),e._v(" "),n("polyline",{staticClass:"dv-bb4-line-5",attrs:{points:"5, 45 5, 140"}}),e._v(" "),n("polyline",{staticClass:"dv-bb4-line-6",attrs:{points:"14, 75 14, 180"}}),e._v(" "),n("polyline",{staticClass:"dv-bb4-line-7",attrs:{points:"55, 11 147, 11 167, 26 250, 26"}}),e._v(" "),n("polyline",{staticClass:"dv-bb4-line-8",attrs:{points:"158, 5 173, 16"}}),e._v(" "),n("polyline",{staticClass:"dv-bb4-line-9",attrs:{points:"200, 17 "+(e.width-10)+", 17"}}),e._v(" "),n("polyline",{staticClass:"dv-bb4-line-10",attrs:{points:"385, 17 "+(e.width-10)+", 17"}})]),e._v(" "),n("div",{staticClass:"border-box-content"},[e._t("default")],2)])};I._withStripped=!0;var j=a({render:I,staticRenderFns:[]},(function(e){e&&e("data-v-3e5643ee_0",{source:".dv-border-box-4 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-4 .dv-reverse {\n transform: rotate(180deg);\n}\n.dv-border-box-4 .dv-border-svg-container {\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0px;\n left: 0px;\n}\n.dv-border-box-4 .dv-border-svg-container polyline {\n fill: none;\n}\n.dv-border-box-4 .sred {\n stroke: red;\n}\n.dv-border-box-4 .sblue {\n stroke: rgba(0, 0, 255, 0.8);\n}\n.dv-border-box-4 .sw1 {\n stroke-width: 1;\n}\n.dv-border-box-4 .sw3 {\n stroke-width: 3px;\n stroke-linecap: round;\n}\n.dv-border-box-4 .dv-bb4-line-1 {\n stroke: red;\n stroke-width: 1;\n}\n.dv-border-box-4 .dv-bb4-line-2 {\n stroke: rgba(0, 0, 255, 0.8);\n stroke-width: 1;\n}\n.dv-border-box-4 .dv-bb4-line-3 {\n stroke: red;\n stroke-width: 3px;\n stroke-linecap: round;\n}\n.dv-border-box-4 .dv-bb4-line-4 {\n stroke: red;\n stroke-width: 3px;\n stroke-linecap: round;\n}\n.dv-border-box-4 .dv-bb4-line-5 {\n stroke: red;\n stroke-width: 1;\n}\n.dv-border-box-4 .dv-bb4-line-6 {\n stroke: rgba(0, 0, 255, 0.8);\n stroke-width: 1;\n}\n.dv-border-box-4 .dv-bb4-line-7 {\n stroke: rgba(0, 0, 255, 0.8);\n stroke-width: 1;\n}\n.dv-border-box-4 .dv-bb4-line-8 {\n stroke: rgba(0, 0, 255, 0.8);\n stroke-width: 3px;\n stroke-linecap: round;\n}\n.dv-border-box-4 .dv-bb4-line-9 {\n stroke: red;\n stroke-width: 3px;\n stroke-linecap: round;\n stroke-dasharray: 100 250;\n}\n.dv-border-box-4 .dv-bb4-line-10 {\n stroke: rgba(0, 0, 255, 0.8);\n stroke-width: 1;\n stroke-dasharray: 80 270;\n}\n.dv-border-box-4 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n",map:{version:3,sources:["main.vue","E:\\Project\\A_MIT_LICENSE\\DataV\\src\\components\\borderBox4\\src\\main.vue"],names:[],mappings:"AAAA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd;AACA;EACE,yBAAyB;AAC3B;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;EACZ,QAAQ;EACR,SAAS;AACX;AACA;EACE,UAAU;AACZ;AACA;EACE,WAAW;AACb;AACA;EACE,4BAA4B;AAC9B;AACA;EACE,eAAe;AACjB;AACA;EACE,iBAAiB;EACjB,qBAAqB;AACvB;AACA;EACE,WAAW;EACX,eAAe;AACjB;AACA;EACE,4BAA4B;EAC5B,eAAe;AACjB;AACA;EACE,WAAW;EACX,iBAAiB;EACjB,qBAAqB;AACvB;ACCA;EACA,WAAA;EACA,iBAAA;EACA,qBAAA;ADCA;ACCA;EACA,WAAA;EACA,eAAA;ADCA;ACCA;EACA,4BAAA;EACA,eAAA;AACA;AACA;EACA,4BAAA;EDCE,eAAe;ACCjB;AACA;EACA,4BAAA;EACA,iBAAA;EDCE,qBAAqB;ACCvB;AACA;EACA,WAAA;EDCE,iBAAiB;ECCnB,qBAAA;EACA,yBAAA;AACA;ADCA;ECCA,4BAAA;EACA,eAAA;EACA,wBAAA;ADCA;ACCA;EACA,kBAAA;EACA,WAAA;EACA,YAAA;ADCA",file:"main.vue",sourcesContent:[".dv-border-box-4 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-4 .dv-reverse {\n transform: rotate(180deg);\n}\n.dv-border-box-4 .dv-border-svg-container {\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0px;\n left: 0px;\n}\n.dv-border-box-4 .dv-border-svg-container polyline {\n fill: none;\n}\n.dv-border-box-4 .sred {\n stroke: red;\n}\n.dv-border-box-4 .sblue {\n stroke: rgba(0, 0, 255, 0.8);\n}\n.dv-border-box-4 .sw1 {\n stroke-width: 1;\n}\n.dv-border-box-4 .sw3 {\n stroke-width: 3px;\n stroke-linecap: round;\n}\n.dv-border-box-4 .dv-bb4-line-1 {\n stroke: red;\n stroke-width: 1;\n}\n.dv-border-box-4 .dv-bb4-line-2 {\n stroke: rgba(0, 0, 255, 0.8);\n stroke-width: 1;\n}\n.dv-border-box-4 .dv-bb4-line-3 {\n stroke: red;\n stroke-width: 3px;\n stroke-linecap: round;\n}\n.dv-border-box-4 .dv-bb4-line-4 {\n stroke: red;\n stroke-width: 3px;\n stroke-linecap: round;\n}\n.dv-border-box-4 .dv-bb4-line-5 {\n stroke: red;\n stroke-width: 1;\n}\n.dv-border-box-4 .dv-bb4-line-6 {\n stroke: rgba(0, 0, 255, 0.8);\n stroke-width: 1;\n}\n.dv-border-box-4 .dv-bb4-line-7 {\n stroke: rgba(0, 0, 255, 0.8);\n stroke-width: 1;\n}\n.dv-border-box-4 .dv-bb4-line-8 {\n stroke: rgba(0, 0, 255, 0.8);\n stroke-width: 3px;\n stroke-linecap: round;\n}\n.dv-border-box-4 .dv-bb4-line-9 {\n stroke: red;\n stroke-width: 3px;\n stroke-linecap: round;\n stroke-dasharray: 100 250;\n}\n.dv-border-box-4 .dv-bb4-line-10 {\n stroke: rgba(0, 0, 255, 0.8);\n stroke-width: 1;\n stroke-dasharray: 80 270;\n}\n.dv-border-box-4 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n",'\r\n\r\n \ No newline at end of file diff --git a/lib/components/borderBox10/src/main.css b/lib/components/borderBox10/src/main.css index a017865..e623d7e 100644 --- a/lib/components/borderBox10/src/main.css +++ b/lib/components/borderBox10/src/main.css @@ -2,10 +2,9 @@ position: relative; width: 100%; height: 100%; - box-shadow: inset 0 0 25px 3px #1d48c4; border-radius: 6px; } -.dv-border-box-10 .border { +.dv-border-box-10 .dv-border-svg-container { position: absolute; display: block; } diff --git a/lib/components/borderBox10/src/main.vue b/lib/components/borderBox10/src/main.vue index f2125c6..0be021f 100644 --- a/lib/components/borderBox10/src/main.vue +++ b/lib/components/borderBox10/src/main.vue @@ -1,14 +1,21 @@ \ No newline at end of file diff --git a/lib/components/borderBox11/index.js b/lib/components/borderBox11/index.js new file mode 100644 index 0000000..5288875 --- /dev/null +++ b/lib/components/borderBox11/index.js @@ -0,0 +1,6 @@ +import './src/main.css' +import BorderBox11 from './src/main.vue' + +export default function (Vue) { + Vue.component(BorderBox11.name, BorderBox11) +} diff --git a/lib/components/borderBox11/src/main.css b/lib/components/borderBox11/src/main.css new file mode 100644 index 0000000..83a0c75 --- /dev/null +++ b/lib/components/borderBox11/src/main.css @@ -0,0 +1,21 @@ +.dv-border-box-11 { + position: relative; + width: 100%; + height: 100%; +} +.dv-border-box-11 .dv-border-svg-container { + position: absolute; + width: 100%; + height: 100%; + top: 0px; + left: 0px; +} +.dv-border-box-11 .dv-border-svg-container > polyline { + fill: none; + stroke-width: 1; +} +.dv-border-box-11 .border-box-content { + position: relative; + width: 100%; + height: 100%; +} diff --git a/lib/components/borderBox11/src/main.vue b/lib/components/borderBox11/src/main.vue new file mode 100644 index 0000000..b7bea15 --- /dev/null +++ b/lib/components/borderBox11/src/main.vue @@ -0,0 +1,280 @@ + + + \ No newline at end of file diff --git a/lib/components/borderBox12/index.js b/lib/components/borderBox12/index.js new file mode 100644 index 0000000..f542acf --- /dev/null +++ b/lib/components/borderBox12/index.js @@ -0,0 +1,6 @@ +import './src/main.css' +import BorderBox12 from './src/main.vue' + +export default function (Vue) { + Vue.component(BorderBox12.name, BorderBox12) +} diff --git a/lib/components/borderBox12/src/main.css b/lib/components/borderBox12/src/main.css new file mode 100644 index 0000000..c58cc9f --- /dev/null +++ b/lib/components/borderBox12/src/main.css @@ -0,0 +1,17 @@ +.dv-border-box-12 { + position: relative; + width: 100%; + height: 100%; +} +.dv-border-box-12 .dv-border-svg-container { + position: absolute; + width: 100%; + height: 100%; + top: 0px; + left: 0px; +} +.dv-border-box-12 .border-box-content { + position: relative; + width: 100%; + height: 100%; +} diff --git a/lib/components/borderBox12/src/main.vue b/lib/components/borderBox12/src/main.vue new file mode 100644 index 0000000..d31525d --- /dev/null +++ b/lib/components/borderBox12/src/main.vue @@ -0,0 +1,148 @@ + + + \ No newline at end of file diff --git a/lib/components/borderBox13/index.js b/lib/components/borderBox13/index.js new file mode 100644 index 0000000..427705e --- /dev/null +++ b/lib/components/borderBox13/index.js @@ -0,0 +1,6 @@ +import './src/main.css' +import BorderBox13 from './src/main.vue' + +export default function (Vue) { + Vue.component(BorderBox13.name, BorderBox13) +} diff --git a/lib/components/borderBox13/src/main.css b/lib/components/borderBox13/src/main.css new file mode 100644 index 0000000..e86caa1 --- /dev/null +++ b/lib/components/borderBox13/src/main.css @@ -0,0 +1,17 @@ +.dv-border-box-13 { + position: relative; + width: 100%; + height: 100%; +} +.dv-border-box-13 .dv-border-svg-container { + position: absolute; + width: 100%; + height: 100%; + top: 0px; + left: 0px; +} +.dv-border-box-13 .border-box-content { + position: relative; + width: 100%; + height: 100%; +} diff --git a/lib/components/borderBox13/src/main.vue b/lib/components/borderBox13/src/main.vue new file mode 100644 index 0000000..b2fbdc1 --- /dev/null +++ b/lib/components/borderBox13/src/main.vue @@ -0,0 +1,92 @@ + + + \ No newline at end of file diff --git a/lib/components/borderBox2/src/main.css b/lib/components/borderBox2/src/main.css index 933f9de..5200b5f 100644 --- a/lib/components/borderBox2/src/main.css +++ b/lib/components/borderBox2/src/main.css @@ -10,19 +10,10 @@ top: 0px; left: 0px; } -.dv-border-box-2 .dv-border-svg-container polyline { +.dv-border-box-2 .dv-border-svg-container > polyline { fill: none; stroke-width: 1; } -.dv-border-box-2 .dv-border-svg-container circle { - fill: #fff; -} -.dv-border-box-2 .dv-bb2-line1 { - stroke: #fff; -} -.dv-border-box-2 .dv-bb2-line2 { - stroke: rgba(255, 255, 255, 0.6); -} .dv-border-box-2 .border-box-content { position: relative; width: 100%; diff --git a/lib/components/borderBox2/src/main.vue b/lib/components/borderBox2/src/main.vue index ae89d0b..5fce950 100644 --- a/lib/components/borderBox2/src/main.vue +++ b/lib/components/borderBox2/src/main.vue @@ -1,14 +1,22 @@