sh-chart 1.2.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/package.json +2 -2
  2. package/packages/components/global-components/mixin/autoResize.js +152 -0
  3. package/packages/components/global-components/sh-border/components/border1.vue +70 -0
  4. package/packages/components/global-components/sh-border/components/border10.vue +54 -0
  5. package/packages/components/global-components/sh-border/components/border11.vue +207 -0
  6. package/packages/components/global-components/sh-border/components/border12.vue +112 -0
  7. package/packages/components/global-components/sh-border/components/border13.vue +50 -0
  8. package/packages/components/global-components/sh-border/components/border2.vue +50 -0
  9. package/packages/components/global-components/sh-border/components/border3.vue +53 -0
  10. package/packages/components/global-components/sh-border/components/border4.vue +95 -0
  11. package/packages/components/global-components/sh-border/components/border5.vue +64 -0
  12. package/packages/components/global-components/sh-border/components/border6.vue +60 -0
  13. package/packages/components/global-components/sh-border/components/border7.vue +57 -0
  14. package/packages/components/global-components/sh-border/components/border8.vue +75 -0
  15. package/packages/components/global-components/sh-border/components/border9.vue +92 -0
  16. package/packages/components/global-components/sh-border/index.vue +73 -0
  17. package/packages/components/global-components/sh-border/mixin/border.js +62 -0
  18. package/packages/components/global-components/sh-charts/config/config.js +58 -0
  19. package/packages/components/global-components/sh-charts/index.vue +169 -0
  20. package/packages/components/global-components/sh-decoration/components/decoration1.vue +81 -0
  21. package/packages/components/global-components/sh-decoration/components/decoration10.vue +80 -0
  22. package/packages/components/global-components/sh-decoration/components/decoration11.vue +63 -0
  23. package/packages/components/global-components/sh-decoration/components/decoration12.vue +171 -0
  24. package/packages/components/global-components/sh-decoration/components/decoration2.vue +78 -0
  25. package/packages/components/global-components/sh-decoration/components/decoration3.vue +65 -0
  26. package/packages/components/global-components/sh-decoration/components/decoration4.vue +72 -0
  27. package/packages/components/global-components/sh-decoration/components/decoration5.vue +96 -0
  28. package/packages/components/global-components/sh-decoration/components/decoration6.vue +84 -0
  29. package/packages/components/global-components/sh-decoration/components/decoration7.vue +31 -0
  30. package/packages/components/global-components/sh-decoration/components/decoration8.vue +32 -0
  31. package/packages/components/global-components/sh-decoration/components/decoration9.vue +63 -0
  32. package/packages/components/global-components/sh-decoration/index.vue +71 -0
  33. package/packages/components/global-components/sh-decoration/mixin/decoration.js +69 -0
  34. package/packages/components/global-components/sh-screen-header/components/header1.vue +228 -0
  35. package/packages/components/global-components/sh-screen-header/components/header2.vue +285 -0
  36. package/packages/components/global-components/sh-screen-header/components/header3.vue +452 -0
  37. package/packages/components/global-components/sh-screen-header/components/header4.vue +544 -0
  38. package/packages/components/global-components/sh-screen-header/components/header5.vue +291 -0
  39. package/packages/components/global-components/sh-screen-header/components/header6.vue +206 -0
  40. package/packages/components/global-components/sh-screen-header/index.vue +50 -0
  41. package/packages/components/global-components/sh-screen-header/mixin/header.js +62 -0
  42. package/packages/components/global-components/sh-spin/index.vue +44 -0
  43. package/packages/components/index.js +24 -0
  44. package/packages/echarts/index.js +94 -0
  45. package/packages/echarts/map/110000.json +1 -0
  46. package/packages/echarts/map/120000.json +1 -0
  47. package/packages/echarts/map/130000.json +1 -0
  48. package/packages/echarts/map/140000.json +1 -0
  49. package/packages/echarts/map/150000.json +1 -0
  50. package/packages/echarts/map/210000.json +1 -0
  51. package/packages/echarts/map/220000.json +1 -0
  52. package/packages/echarts/map/230000.json +1 -0
  53. package/packages/echarts/map/310000.json +1 -0
  54. package/packages/echarts/map/320000.json +1 -0
  55. package/packages/echarts/map/330000.json +1 -0
  56. package/packages/echarts/map/340000.json +1 -0
  57. package/packages/echarts/map/350000.json +1 -0
  58. package/packages/echarts/map/360000.json +1 -0
  59. package/packages/echarts/map/370000.json +1 -0
  60. package/packages/echarts/map/410000.json +1 -0
  61. package/packages/echarts/map/420000.json +1 -0
  62. package/packages/echarts/map/430000.json +1 -0
  63. package/packages/echarts/map/440000.json +1 -0
  64. package/packages/echarts/map/450000.json +1 -0
  65. package/packages/echarts/map/460000.json +1 -0
  66. package/packages/echarts/map/500000.json +1 -0
  67. package/packages/echarts/map/510000.json +1 -0
  68. package/packages/echarts/map/520000.json +1 -0
  69. package/packages/echarts/map/530000.json +1 -0
  70. package/packages/echarts/map/540000.json +1 -0
  71. package/packages/echarts/map/610000.json +1 -0
  72. package/packages/echarts/map/620000.json +1 -0
  73. package/packages/echarts/map/630000.json +1 -0
  74. package/packages/echarts/map/640000.json +1 -0
  75. package/packages/echarts/map/650000.json +1 -0
  76. package/packages/echarts/map/710000.json +1 -0
  77. package/packages/echarts/map/china.json +1 -0
  78. package/packages/echarts/theme/dark.js +128 -0
  79. package/packages/echarts/theme/infographic.js +181 -0
  80. package/packages/echarts/theme/macarons.js +194 -0
  81. package/packages/echarts/theme/roma.js +66 -0
  82. package/packages/echarts/theme/shine.js +136 -0
  83. package/packages/echarts/theme/vintage.js +11 -0
  84. package/packages/index.js +31 -0
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "sh-chart",
3
- "version": "1.2.0",
3
+ "version": "2.1.0",
4
4
  "description": "基于echart、data-view二次封装",
5
- "main": "lib/sh-chart.common.js",
5
+ "main": "packages/index.js",
6
6
  "scripts": {
7
7
  "lib": "vue-cli-service build --target lib packages/index.js --name sh-chart --dest lib"
8
8
  },
@@ -0,0 +1,152 @@
1
+ let _interopRequireDefault = require('@babel/runtime/helpers/interopRequireDefault')
2
+ let _toConsumableArray2 = _interopRequireDefault(require('@babel/runtime/helpers/toConsumableArray'))
3
+ var _typeof2 = _interopRequireDefault(require('@babel/runtime/helpers/typeof'))
4
+
5
+ function debounce(delay, callback) {
6
+ let lastTime
7
+ return function () {
8
+ clearTimeout(lastTime)
9
+ const [that, args] = [this, arguments]
10
+ lastTime = setTimeout(() => {
11
+ callback.apply(that, args)
12
+ }, delay)
13
+ }
14
+ }
15
+
16
+ function observerDomResize(dom, callback) {
17
+ const MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver
18
+ const observer = new MutationObserver(callback)
19
+ observer.observe(dom, { attributes: true, attributeFilter: ['style'], attributeOldValue: true })
20
+ return observer
21
+ }
22
+
23
+ export default {
24
+ data() {
25
+ return {
26
+ dom: '',
27
+
28
+ width: 0,
29
+ height: 0,
30
+
31
+ debounceInitWHFun: '',
32
+
33
+ domObserver: ''
34
+ }
35
+ },
36
+ methods: {
37
+ uuid(hasHyphen) {
38
+ return (hasHyphen ? 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx' : 'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx').replace(/[xy]/g, function (c) {
39
+ const r = (Math.random() * 16) | 0
40
+ const v = c === 'x' ? r : (r & 0x3) | 0x8
41
+ return v.toString(16)
42
+ })
43
+ },
44
+ fade(color, percent) {
45
+ return this.$vUtils.fade(color, percent)
46
+ },
47
+ randomExtend(minNum, maxNum) {
48
+ if (arguments.length === 1) {
49
+ return parseInt(Math.random() * minNum + 1, 10)
50
+ } else {
51
+ return parseInt(Math.random() * (maxNum - minNum + 1) + minNum, 10)
52
+ }
53
+ },
54
+ deepMerge(target, merged) {
55
+ for (var key in merged) {
56
+ if (target[key] && (0, _typeof2['default'])(target[key]) === 'object') {
57
+ this.deepMerge(target[key], merged[key])
58
+ continue
59
+ }
60
+ if ((0, _typeof2['default'])(merged[key]) === 'object') {
61
+ target[key] = (0, _util.deepClone)(merged[key], true)
62
+ continue
63
+ }
64
+ target[key] = merged[key]
65
+ }
66
+ return target
67
+ },
68
+ getCircleRadianPoint(x, y, radius, radian) {
69
+ return [x + cos(radian) * radius, y + sin(radian) * radius]
70
+ },
71
+ getTwoPointDistance(pointOne, pointTwo) {
72
+ let minusX = Math.abs(pointOne[0] - pointTwo[0])
73
+ let minusY = Math.abs(pointOne[1] - pointTwo[1])
74
+ return Math.sqrt(minusX * minusX + minusY * minusY)
75
+ },
76
+ getPolylineLength(points) {
77
+ let lineSegments = new Array(points.length - 1).fill(0).map(function (foo, i) {
78
+ return [points[i], points[i + 1]]
79
+ })
80
+ let lengths = lineSegments.map(function (item) {
81
+ return this.getTwoPointDistance.apply(void 0, (0, _toConsumableArray2['default'])(item))
82
+ })
83
+ return this.$vUtils.sum(lengths)
84
+ },
85
+ async autoResizeMixinInit() {
86
+ const { initWH, getDebounceInitWHFun, bindDomResizeCallback, afterAutoResizeMixinInit } = this
87
+
88
+ await initWH(false)
89
+
90
+ getDebounceInitWHFun()
91
+
92
+ bindDomResizeCallback()
93
+
94
+ if (typeof afterAutoResizeMixinInit === 'function') afterAutoResizeMixinInit()
95
+ },
96
+ initWH(resize = true) {
97
+ const { $nextTick, $refs, ref, onResize } = this
98
+
99
+ return new Promise(resolve => {
100
+ $nextTick(_ => {
101
+ const dom = (this.dom = $refs[ref])
102
+
103
+ this.width = dom ? dom.clientWidth : 0
104
+ this.height = dom ? dom.clientHeight : 0
105
+
106
+ if (!dom) {
107
+ console.warn('DataV: Failed to get dom node, component rendering may be abnormal!')
108
+ } else if (!this.width || !this.height) {
109
+ console.warn('DataV: Component width or height is 0px, rendering abnormality may occur!')
110
+ }
111
+
112
+ if (typeof onResize === 'function' && resize) onResize()
113
+
114
+ resolve()
115
+ })
116
+ })
117
+ },
118
+ getDebounceInitWHFun() {
119
+ const { initWH } = this
120
+
121
+ this.debounceInitWHFun = debounce(100, initWH)
122
+ },
123
+ bindDomResizeCallback() {
124
+ const { dom, debounceInitWHFun } = this
125
+
126
+ this.domObserver = observerDomResize(dom, debounceInitWHFun)
127
+
128
+ window.addEventListener('resize', debounceInitWHFun)
129
+ },
130
+ unbindDomResizeCallback() {
131
+ let { domObserver, debounceInitWHFun } = this
132
+
133
+ if (!domObserver) return
134
+
135
+ domObserver.disconnect()
136
+ domObserver.takeRecords()
137
+ domObserver = null
138
+
139
+ window.removeEventListener('resize', debounceInitWHFun)
140
+ }
141
+ },
142
+ mounted() {
143
+ const { autoResizeMixinInit } = this
144
+
145
+ autoResizeMixinInit()
146
+ },
147
+ beforeDestroy() {
148
+ const { unbindDomResizeCallback } = this
149
+
150
+ unbindDomResizeCallback()
151
+ }
152
+ }
@@ -0,0 +1,70 @@
1
+ <template>
2
+ <div :ref="ref" class="sh-border-box-1">
3
+ <svg class="border" :width="width" :height="height">
4
+ <polygon
5
+ :fill="backgroundColor"
6
+ :points="`10, 27 10, ${height - 27} 13, ${height - 24} 13, ${height - 21} 24, ${height - 11}
7
+ 38, ${height - 11} 41, ${height - 8} 73, ${height - 8} 75, ${height - 10} 81, ${height - 10}
8
+ 85, ${height - 6} ${width - 85}, ${height - 6} ${width - 81}, ${height - 10} ${width - 75}, ${height - 10}
9
+ ${width - 73}, ${height - 8} ${width - 41}, ${height - 8} ${width - 38}, ${height - 11}
10
+ ${width - 24}, ${height - 11} ${width - 13}, ${height - 21} ${width - 13}, ${height - 24}
11
+ ${width - 10}, ${height - 27} ${width - 10}, 27 ${width - 13}, 25 ${width - 13}, 21
12
+ ${width - 24}, 11 ${width - 38}, 11 ${width - 41}, 8 ${width - 73}, 8 ${width - 75}, 10
13
+ ${width - 81}, 10 ${width - 85}, 6 85, 6 81, 10 75, 10 73, 8 41, 8 38, 11 24, 11 13, 21 13, 24`" />
14
+ </svg>
15
+
16
+ <svg v-for="item in border" :key="item" width="150px" height="150px" :class="`${item} border`">
17
+ <polygon :fill="mergedColor[0]" 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">
18
+ <animate attributeName="fill" :values="`${mergedColor[0]};${mergedColor[1]};${mergedColor[0]}`" dur="0.5s" begin="0s" repeatCount="indefinite" />
19
+ </polygon>
20
+ <polygon :fill="mergedColor[1]" points="27.599999999999998,4.8 38.4,4.8 35.4,7.8 30.599999999999998,7.8">
21
+ <animate attributeName="fill" :values="`${mergedColor[1]};${mergedColor[0]};${mergedColor[1]}`" dur="0.5s" begin="0s" repeatCount="indefinite" />
22
+ </polygon>
23
+ <polygon :fill="mergedColor[0]" 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">
24
+ <animate attributeName="fill" :values="`${mergedColor[0]};${mergedColor[1]};transparent`" dur="1s" begin="0s" repeatCount="indefinite" />
25
+ </polygon>
26
+ </svg>
27
+
28
+ <div class="border-box-content">
29
+ <slot></slot>
30
+ </div>
31
+ </div>
32
+ </template>
33
+
34
+ <script>
35
+ import mixin from '../mixin/border'
36
+ export default {
37
+ name: 'ShBorder1',
38
+ mixins: [mixin]
39
+ }
40
+ </script>
41
+
42
+ <style scoped lang="scss">
43
+ .sh-border-box-1 {
44
+ position: relative;
45
+ width: 100%;
46
+ height: 100%;
47
+ .border {
48
+ position: absolute;
49
+ display: block;
50
+ &.right-top {
51
+ right: 0;
52
+ transform: rotateY(180deg);
53
+ }
54
+ &.left-bottom {
55
+ bottom: 0;
56
+ transform: rotateX(180deg);
57
+ }
58
+ &.right-bottom {
59
+ right: 0;
60
+ bottom: 0;
61
+ transform: rotateX(180deg) rotateY(180deg);
62
+ }
63
+ }
64
+ .border-box-content {
65
+ position: relative;
66
+ width: 100%;
67
+ height: 100%;
68
+ }
69
+ }
70
+ </style>
@@ -0,0 +1,54 @@
1
+ <template>
2
+ <div :ref="ref" class="sh-border-box-10">
3
+ <svg class="border-svg-container" :width="width" :height="height">
4
+ <polygon :fill="backgroundColor" :points="`4, 0 ${width - 4}, 0 ${width}, 4 ${width}, ${height - 4} ${width - 4}, ${height} 4, ${height} 0, ${height - 4} 0, 4`" />
5
+ </svg>
6
+
7
+ <svg v-for="item in border" :key="item" width="150px" height="150px" :class="`${item} border-svg-container`">
8
+ <polygon :fill="mergedColor[1]" points="40, 0 5, 0 0, 5 0, 16 3, 19 3, 7 7, 3 35, 3" />
9
+ </svg>
10
+
11
+ <div class="border-box-content">
12
+ <slot></slot>
13
+ </div>
14
+ </div>
15
+ </template>
16
+
17
+ <script>
18
+ import mixin from '../mixin/border'
19
+ export default {
20
+ name: 'ShBorder10',
21
+ mixins: [mixin]
22
+ }
23
+ </script>
24
+
25
+ <style scoped lang="scss">
26
+ .sh-border-box-10 {
27
+ position: relative;
28
+ width: 100%;
29
+ height: 100%;
30
+ border-radius: 6px;
31
+ .border-svg-container {
32
+ position: absolute;
33
+ display: block;
34
+ }
35
+ .right-top {
36
+ right: 0;
37
+ transform: rotateY(180deg);
38
+ }
39
+ .left-bottom {
40
+ bottom: 0;
41
+ transform: rotateX(180deg);
42
+ }
43
+ .right-bottom {
44
+ right: 0;
45
+ bottom: 0;
46
+ transform: rotateX(180deg) rotateY(180deg);
47
+ }
48
+ .border-box-content {
49
+ position: relative;
50
+ width: 100%;
51
+ height: 100%;
52
+ }
53
+ }
54
+ </style>
@@ -0,0 +1,207 @@
1
+ <template>
2
+ <div :ref="ref" class="sh-border-box-11">
3
+ <svg class="border-svg-container" :width="width" :height="height">
4
+ <defs>
5
+ <filter :id="filterId" height="150%" width="150%" x="-25%" y="-25%">
6
+ <feMorphology operator="dilate" radius="2" in="SourceAlpha" result="thicken" />
7
+ <feGaussianBlur in="thicken" stdDeviation="3" result="blurred" />
8
+ <feFlood :flood-color="mergedColor[1]" result="glowColor" />
9
+ <feComposite in="glowColor" in2="blurred" operator="in" result="softGlowColored" />
10
+ <feMerge>
11
+ <feMergeNode in="softGlowColored" />
12
+ <feMergeNode in="SourceGraphic" />
13
+ </feMerge>
14
+ </filter>
15
+ </defs>
16
+
17
+ <polygon
18
+ :fill="backgroundColor"
19
+ :points="`
20
+ 20, 32 ${width * 0.5 - titleWidth / 2}, 32 ${width * 0.5 - titleWidth / 2 + 20}, 53
21
+ ${width * 0.5 + titleWidth / 2 - 20}, 53 ${width * 0.5 + titleWidth / 2}, 32
22
+ ${width - 20}, 32 ${width - 8}, 48 ${width - 8}, ${height - 25} ${width - 20}, ${height - 8}
23
+ 20, ${height - 8} 8, ${height - 25} 8, 50
24
+ `" />
25
+
26
+ <polyline
27
+ :stroke="mergedColor[0]"
28
+ :filter="`url(#${filterId})`"
29
+ :points="`
30
+ ${(width - titleWidth) / 2}, 30
31
+ 20, 30 7, 50 7, ${50 + (height - 167) / 2}
32
+ 13, ${55 + (height - 167) / 2} 13, ${135 + (height - 167) / 2}
33
+ 7, ${140 + (height - 167) / 2} 7, ${height - 27}
34
+ 20, ${height - 7} ${width - 20}, ${height - 7} ${width - 7}, ${height - 27}
35
+ ${width - 7}, ${140 + (height - 167) / 2} ${width - 13}, ${135 + (height - 167) / 2}
36
+ ${width - 13}, ${55 + (height - 167) / 2} ${width - 7}, ${50 + (height - 167) / 2}
37
+ ${width - 7}, 50 ${width - 20}, 30 ${(width + titleWidth) / 2}, 30
38
+ ${(width + titleWidth) / 2 - 20}, 7 ${(width - titleWidth) / 2 + 20}, 7
39
+ ${(width - titleWidth) / 2}, 30 ${(width - titleWidth) / 2 + 20}, 52
40
+ ${(width + titleWidth) / 2 - 20}, 52 ${(width + titleWidth) / 2}, 30
41
+ `" />
42
+
43
+ <polygon
44
+ :stroke="mergedColor[0]"
45
+ fill="transparent"
46
+ :points="`
47
+ ${(width + titleWidth) / 2 - 5}, 30 ${(width + titleWidth) / 2 - 21}, 11
48
+ ${(width + titleWidth) / 2 - 27}, 11 ${(width + titleWidth) / 2 - 8}, 34
49
+ `" />
50
+
51
+ <polygon
52
+ :stroke="mergedColor[0]"
53
+ fill="transparent"
54
+ :points="`
55
+ ${(width - titleWidth) / 2 + 5}, 30 ${(width - titleWidth) / 2 + 22}, 49
56
+ ${(width - titleWidth) / 2 + 28}, 49 ${(width - titleWidth) / 2 + 8}, 26
57
+ `" />
58
+
59
+ <polygon
60
+ :stroke="mergedColor[0]"
61
+ :fill="fade(mergedColor[1] || defaultColor[1], 30)"
62
+ :filter="`url(#${filterId})`"
63
+ :points="`
64
+ ${(width + titleWidth) / 2 - 11}, 37 ${(width + titleWidth) / 2 - 32}, 11
65
+ ${(width - titleWidth) / 2 + 23}, 11 ${(width - titleWidth) / 2 + 11}, 23
66
+ ${(width - titleWidth) / 2 + 33}, 49 ${(width + titleWidth) / 2 - 22}, 49
67
+ `" />
68
+
69
+ <polygon
70
+ :filter="`url(#${filterId})`"
71
+ :fill="mergedColor[0]"
72
+ opacity="1"
73
+ :points="`
74
+ ${(width - titleWidth) / 2 - 10}, 37 ${(width - titleWidth) / 2 - 31}, 37
75
+ ${(width - titleWidth) / 2 - 25}, 46 ${(width - titleWidth) / 2 - 4}, 46
76
+ `">
77
+ <animate attributeName="opacity" values="1;0.7;1" dur="2s" begin="0s" repeatCount="indefinite" />
78
+ </polygon>
79
+
80
+ <polygon
81
+ :filter="`url(#${filterId})`"
82
+ :fill="mergedColor[0]"
83
+ opacity="0.7"
84
+ :points="`
85
+ ${(width - titleWidth) / 2 - 40}, 37 ${(width - titleWidth) / 2 - 61}, 37
86
+ ${(width - titleWidth) / 2 - 55}, 46 ${(width - titleWidth) / 2 - 34}, 46
87
+ `">
88
+ <animate attributeName="opacity" values="0.7;0.4;0.7" dur="2s" begin="0s" repeatCount="indefinite" />
89
+ </polygon>
90
+
91
+ <polygon
92
+ :filter="`url(#${filterId})`"
93
+ :fill="mergedColor[0]"
94
+ opacity="0.5"
95
+ :points="`
96
+ ${(width - titleWidth) / 2 - 70}, 37 ${(width - titleWidth) / 2 - 91}, 37
97
+ ${(width - titleWidth) / 2 - 85}, 46 ${(width - titleWidth) / 2 - 64}, 46
98
+ `">
99
+ <animate attributeName="opacity" values="0.5;0.2;0.5" dur="2s" begin="0s" repeatCount="indefinite" />
100
+ </polygon>
101
+
102
+ <polygon
103
+ :filter="`url(#${filterId})`"
104
+ :fill="mergedColor[0]"
105
+ opacity="1"
106
+ :points="`
107
+ ${(width + titleWidth) / 2 + 30}, 37 ${(width + titleWidth) / 2 + 9}, 37
108
+ ${(width + titleWidth) / 2 + 3}, 46 ${(width + titleWidth) / 2 + 24}, 46
109
+ `">
110
+ <animate attributeName="opacity" values="1;0.7;1" dur="2s" begin="0s" repeatCount="indefinite" />
111
+ </polygon>
112
+
113
+ <polygon
114
+ :filter="`url(#${filterId})`"
115
+ :fill="mergedColor[0]"
116
+ opacity="0.7"
117
+ :points="`
118
+ ${(width + titleWidth) / 2 + 60}, 37 ${(width + titleWidth) / 2 + 39}, 37
119
+ ${(width + titleWidth) / 2 + 33}, 46 ${(width + titleWidth) / 2 + 54}, 46
120
+ `">
121
+ <animate attributeName="opacity" values="0.7;0.4;0.7" dur="2s" begin="0s" repeatCount="indefinite" />
122
+ </polygon>
123
+
124
+ <polygon
125
+ :filter="`url(#${filterId})`"
126
+ :fill="mergedColor[0]"
127
+ opacity="0.5"
128
+ :points="`
129
+ ${(width + titleWidth) / 2 + 90}, 37 ${(width + titleWidth) / 2 + 69}, 37
130
+ ${(width + titleWidth) / 2 + 63}, 46 ${(width + titleWidth) / 2 + 84}, 46
131
+ `">
132
+ <animate attributeName="opacity" values="0.5;0.2;0.5" dur="2s" begin="0s" repeatCount="indefinite" />
133
+ </polygon>
134
+
135
+ <text class="border-box-11-title" :x="`${width / 2}`" y="32" fill="#fff" font-size="18" text-anchor="middle" dominant-baseline="middle">
136
+ {{ title }}
137
+ </text>
138
+
139
+ <polygon
140
+ :fill="mergedColor[0]"
141
+ :filter="`url(#${filterId})`"
142
+ :points="`
143
+ 7, ${53 + (height - 167) / 2} 11, ${57 + (height - 167) / 2}
144
+ 11, ${133 + (height - 167) / 2} 7, ${137 + (height - 167) / 2}
145
+ `" />
146
+
147
+ <polygon
148
+ :fill="mergedColor[0]"
149
+ :filter="`url(#${filterId})`"
150
+ :points="`
151
+ ${width - 7}, ${53 + (height - 167) / 2} ${width - 11}, ${57 + (height - 167) / 2}
152
+ ${width - 11}, ${133 + (height - 167) / 2} ${width - 7}, ${137 + (height - 167) / 2}
153
+ `" />
154
+ </svg>
155
+
156
+ <div class="border-box-content">
157
+ <slot></slot>
158
+ </div>
159
+ </div>
160
+ </template>
161
+
162
+ <script>
163
+ import mixin from '../mixin/border'
164
+ export default {
165
+ name: 'ShBorder11',
166
+ mixins: [mixin],
167
+ props: {
168
+ titleWidth: {
169
+ type: Number,
170
+ default: 250
171
+ },
172
+ title: {
173
+ type: String,
174
+ default: ''
175
+ }
176
+ },
177
+ computed: {
178
+ filterId() {
179
+ return `border-box-11-filterId-${this.borderId}`
180
+ }
181
+ }
182
+ }
183
+ </script>
184
+
185
+ <style scoped lang="scss">
186
+ .sh-border-box-11 {
187
+ position: relative;
188
+ width: 100%;
189
+ height: 100%;
190
+ .border-svg-container {
191
+ position: absolute;
192
+ width: 100%;
193
+ height: 100%;
194
+ top: 0;
195
+ left: 0;
196
+ & > polyline {
197
+ fill: none;
198
+ stroke-width: 1;
199
+ }
200
+ }
201
+ .border-box-content {
202
+ position: relative;
203
+ width: 100%;
204
+ height: 100%;
205
+ }
206
+ }
207
+ </style>
@@ -0,0 +1,112 @@
1
+ <template>
2
+ <div :ref="ref" class="sh-border-box-12">
3
+ <svg class="border-svg-container" :width="width" :height="height">
4
+ <defs>
5
+ <filter :id="filterId" height="150%" width="150%" x="-25%" y="-25%">
6
+ <feMorphology operator="dilate" radius="1" in="SourceAlpha" result="thicken" />
7
+ <feGaussianBlur in="thicken" stdDeviation="2" result="blurred" />
8
+ <feFlood :flood-color="fade(mergedColor[1] || defaultColor[1], 70)" result="glowColor">
9
+ <animate
10
+ attributeName="flood-color"
11
+ :values="`
12
+ ${fade(mergedColor[1] || defaultColor[1], 70)};
13
+ ${fade(mergedColor[1] || defaultColor[1], 30)};
14
+ ${fade(mergedColor[1] || defaultColor[1], 70)};
15
+ `"
16
+ dur="3s"
17
+ begin="0s"
18
+ repeatCount="indefinite" />
19
+ </feFlood>
20
+ <feComposite in="glowColor" in2="blurred" operator="in" result="softGlowColored" />
21
+ <feMerge>
22
+ <feMergeNode in="softGlowColored" />
23
+ <feMergeNode in="SourceGraphic" />
24
+ </feMerge>
25
+ </filter>
26
+ </defs>
27
+
28
+ <path
29
+ v-if="width && height"
30
+ :fill="backgroundColor"
31
+ stroke-width="2"
32
+ :stroke="mergedColor[0]"
33
+ :d="`
34
+ M15 5 L ${width - 15} 5 Q ${width - 5} 5, ${width - 5} 15
35
+ L ${width - 5} ${height - 15} Q ${width - 5} ${height - 5}, ${width - 15} ${height - 5}
36
+ L 15, ${height - 5} Q 5 ${height - 5} 5 ${height - 15} L 5 15
37
+ Q 5 5 15 5
38
+ `" />
39
+
40
+ <path stroke-width="2" fill="transparent" stroke-linecap="round" :filter="`url(#${filterId})`" :stroke="mergedColor[1]" :d="`M 20 5 L 15 5 Q 5 5 5 15 L 5 20`" />
41
+
42
+ <path
43
+ stroke-width="2"
44
+ fill="transparent"
45
+ stroke-linecap="round"
46
+ :filter="`url(#${filterId})`"
47
+ :stroke="mergedColor[1]"
48
+ :d="`M ${width - 20} 5 L ${width - 15} 5 Q ${width - 5} 5 ${width - 5} 15 L ${width - 5} 20`" />
49
+
50
+ <path
51
+ stroke-width="2"
52
+ fill="transparent"
53
+ stroke-linecap="round"
54
+ :filter="`url(#${filterId})`"
55
+ :stroke="mergedColor[1]"
56
+ :d="`
57
+ M ${width - 20} ${height - 5} L ${width - 15} ${height - 5}
58
+ Q ${width - 5} ${height - 5} ${width - 5} ${height - 15}
59
+ L ${width - 5} ${height - 20}
60
+ `" />
61
+
62
+ <path
63
+ stroke-width="2"
64
+ fill="transparent"
65
+ stroke-linecap="round"
66
+ :filter="`url(#${filterId})`"
67
+ :stroke="mergedColor[1]"
68
+ :d="`
69
+ M 20 ${height - 5} L 15 ${height - 5}
70
+ Q 5 ${height - 5} 5 ${height - 15}
71
+ L 5 ${height - 20}
72
+ `" />
73
+ </svg>
74
+
75
+ <div class="border-box-content">
76
+ <slot></slot>
77
+ </div>
78
+ </div>
79
+ </template>
80
+
81
+ <script>
82
+ import mixin from '../mixin/border'
83
+ export default {
84
+ name: 'ShBorder12',
85
+ mixins: [mixin],
86
+ computed: {
87
+ filterId() {
88
+ return `border-box-11-filterId-${this.borderId}`
89
+ }
90
+ }
91
+ }
92
+ </script>
93
+
94
+ <style scoped lang="scss">
95
+ .sh-border-box-12 {
96
+ position: relative;
97
+ width: 100%;
98
+ height: 100%;
99
+ .border-svg-container {
100
+ position: absolute;
101
+ width: 100%;
102
+ height: 100%;
103
+ top: 0;
104
+ left: 0;
105
+ }
106
+ .border-box-content {
107
+ position: relative;
108
+ width: 100%;
109
+ height: 100%;
110
+ }
111
+ }
112
+ </style>
@@ -0,0 +1,50 @@
1
+ <template>
2
+ <div :ref="ref" class="sh-border-box-13">
3
+ <svg class="border-svg-container" :width="width" :height="height">
4
+ <path
5
+ :fill="backgroundColor"
6
+ :stroke="mergedColor[0]"
7
+ :d="`
8
+ M 5 20 L 5 10 L 12 3 L 60 3 L 68 10
9
+ L ${width - 20} 10 L ${width - 5} 25
10
+ L ${width - 5} ${height - 5} L 20 ${height - 5}
11
+ L 5 ${height - 20} L 5 20
12
+ `" />
13
+ <path fill="transparent" stroke-width="3" stroke-linecap="round" stroke-dasharray="10, 5" :stroke="mergedColor[0]" :d="`M 16 9 L 61 9`" />
14
+ <path fill="transparent" :stroke="mergedColor[1]" :d="`M 5 20 L 5 10 L 12 3 L 60 3 L 68 10`" />
15
+ <path fill="transparent" :stroke="mergedColor[1]" :d="`M ${width - 5} ${height - 30} L ${width - 5} ${height - 5} L ${width - 30} ${height - 5}`" />
16
+ </svg>
17
+
18
+ <div class="border-box-content">
19
+ <slot></slot>
20
+ </div>
21
+ </div>
22
+ </template>
23
+
24
+ <script>
25
+ import mixin from '../mixin/border'
26
+ export default {
27
+ name: 'ShBorder13',
28
+ mixins: [mixin]
29
+ }
30
+ </script>
31
+
32
+ <style scoped lang="scss">
33
+ .sh-border-box-13 {
34
+ position: relative;
35
+ width: 100%;
36
+ height: 100%;
37
+ .border-svg-container {
38
+ position: absolute;
39
+ width: 100%;
40
+ height: 100%;
41
+ top: 0;
42
+ left: 0;
43
+ }
44
+ .border-box-content {
45
+ position: relative;
46
+ width: 100%;
47
+ height: 100%;
48
+ }
49
+ }
50
+ </style>