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
@@ -0,0 +1,50 @@
1
+ <template>
2
+ <div :ref="ref" class="sh-border-box-2">
3
+ <svg class="border-svg-container" :width="width" :height="height">
4
+ <polygon :fill="backgroundColor" :points="`7, 7 ${width - 7}, 7 ${width - 7}, ${height - 7} 7, ${height - 7}`" />
5
+
6
+ <polyline :stroke="mergedColor[0]" :points="`2, 2 ${width - 2} ,2 ${width - 2}, ${height - 2} 2, ${height - 2} 2, 2`" />
7
+ <polyline :stroke="mergedColor[1]" :points="`6, 6 ${width - 6}, 6 ${width - 6}, ${height - 6} 6, ${height - 6} 6, 6`" />
8
+ <circle :fill="mergedColor[0]" cx="11" cy="11" r="1" />
9
+ <circle :fill="mergedColor[0]" :cx="width - 11" cy="11" r="1" />
10
+ <circle :fill="mergedColor[0]" :cx="width - 11" :cy="height - 11" r="1" />
11
+ <circle :fill="mergedColor[0]" cx="11" :cy="height - 11" r="1" />
12
+ </svg>
13
+
14
+ <div class="border-box-content">
15
+ <slot></slot>
16
+ </div>
17
+ </div>
18
+ </template>
19
+
20
+ <script>
21
+ import mixin from '../mixin/border'
22
+ export default {
23
+ name: 'ShBorder2',
24
+ mixins: [mixin]
25
+ }
26
+ </script>
27
+
28
+ <style scoped lang="scss">
29
+ .sh-border-box-2 {
30
+ position: relative;
31
+ width: 100%;
32
+ height: 100%;
33
+ .border-svg-container {
34
+ position: absolute;
35
+ width: 100%;
36
+ height: 100%;
37
+ top: 0;
38
+ left: 0;
39
+ & > polyline {
40
+ fill: none;
41
+ stroke-width: 1;
42
+ }
43
+ }
44
+ .border-box-content {
45
+ position: relative;
46
+ width: 100%;
47
+ height: 100%;
48
+ }
49
+ }
50
+ </style>
@@ -0,0 +1,53 @@
1
+ <template>
2
+ <div :ref="ref" class="sh-border-box-3">
3
+ <svg class="border-svg-container" :width="width" :height="height">
4
+ <polygon :fill="backgroundColor" :points="`23, 23 ${width - 24}, 23 ${width - 24}, ${height - 24} 23, ${height - 24}`" />
5
+
6
+ <polyline class="bb3-line1" :stroke="mergedColor[0]" :points="`4, 4 ${width - 22} ,4 ${width - 22}, ${height - 22} 4, ${height - 22} 4, 4`" />
7
+ <polyline class="bb3-line2" :stroke="mergedColor[1]" :points="`10, 10 ${width - 16}, 10 ${width - 16}, ${height - 16} 10, ${height - 16} 10, 10`" />
8
+ <polyline class="bb3-line2" :stroke="mergedColor[1]" :points="`16, 16 ${width - 10}, 16 ${width - 10}, ${height - 10} 16, ${height - 10} 16, 16`" />
9
+ <polyline class="bb3-line2" :stroke="mergedColor[1]" :points="`22, 22 ${width - 4}, 22 ${width - 4}, ${height - 4} 22, ${height - 4} 22, 22`" />
10
+ </svg>
11
+
12
+ <div class="border-box-content">
13
+ <slot></slot>
14
+ </div>
15
+ </div>
16
+ </template>
17
+
18
+ <script>
19
+ import mixin from '../mixin/border'
20
+ export default {
21
+ name: 'ShBorder3',
22
+ mixins: [mixin]
23
+ }
24
+ </script>
25
+
26
+ <style scoped lang="scss">
27
+ .sh-border-box-3 {
28
+ position: relative;
29
+ width: 100%;
30
+ height: 100%;
31
+ .border-svg-container {
32
+ position: absolute;
33
+ width: 100%;
34
+ height: 100%;
35
+ top: 0;
36
+ left: 0;
37
+ & > polyline {
38
+ fill: none;
39
+ }
40
+ }
41
+ .bb3-line1 {
42
+ stroke-width: 3;
43
+ }
44
+ .bb3-line2 {
45
+ stroke-width: 1;
46
+ }
47
+ .border-box-content {
48
+ position: relative;
49
+ width: 100%;
50
+ height: 100%;
51
+ }
52
+ }
53
+ </style>
@@ -0,0 +1,95 @@
1
+ <template>
2
+ <div :ref="ref" class="sh-border-box-4">
3
+ <svg :class="`border-svg-container ${reverse && 'reverse'}`" :width="width" :height="height">
4
+ <polygon :fill="backgroundColor" :points="`${width - 15}, 22 170, 22 150, 7 40, 7 28, 21 32, 24 16, 42 16, ${height - 32} 41, ${height - 7} ${width - 15}, ${height - 7}`" />
5
+ <polyline class="bb4-line-1" :stroke="mergedColor[0]" :points="`145, ${height - 5} 40, ${height - 5} 10, ${height - 35} 10, 40 40, 5 150, 5 170, 20 ${width - 15}, 20`" />
6
+ <polyline :stroke="mergedColor[1]" class="bb4-line-2" :points="`245, ${height - 1} 36, ${height - 1} 14, ${height - 23} 14, ${height - 100}`" />
7
+
8
+ <polyline class="bb4-line-3" :stroke="mergedColor[0]" :points="`7, ${height - 40} 7, ${height - 75}`" />
9
+ <polyline class="bb4-line-4" :stroke="mergedColor[0]" :points="`28, 24 13, 41 13, 64`" />
10
+ <polyline class="bb4-line-5" :stroke="mergedColor[0]" :points="`5, 45 5, 140`" />
11
+ <polyline class="bb4-line-6" :stroke="mergedColor[1]" :points="`14, 75 14, 180`" />
12
+ <polyline class="bb4-line-7" :stroke="mergedColor[1]" :points="`55, 11 147, 11 167, 26 250, 26`" />
13
+ <polyline class="bb4-line-8" :stroke="mergedColor[1]" :points="`158, 5 173, 16`" />
14
+ <polyline class="bb4-line-9" :stroke="mergedColor[0]" :points="`200, 17 ${width - 10}, 17`" />
15
+ <polyline class="bb4-line-10" :stroke="mergedColor[1]" :points="`385, 17 ${width - 10}, 17`" />
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: 'ShBorder4',
28
+ mixins: [mixin]
29
+ }
30
+ </script>
31
+
32
+ <style scoped lang="scss">
33
+ @mixin sw1 {
34
+ stroke-width: 1;
35
+ }
36
+ @mixin sw3 {
37
+ stroke-width: 3px;
38
+ stroke-linecap: round;
39
+ }
40
+ .sh-border-box-4 {
41
+ position: relative;
42
+ width: 100%;
43
+ height: 100%;
44
+ .reverse {
45
+ transform: rotate(180deg);
46
+ }
47
+ .border-svg-container {
48
+ position: absolute;
49
+ width: 100%;
50
+ height: 100%;
51
+ top: 0;
52
+ left: 0;
53
+ & > polyline {
54
+ fill: none;
55
+ }
56
+ }
57
+ .bb4-line-1 {
58
+ @include sw1;
59
+ }
60
+ .bb4-line-2 {
61
+ @include sw1;
62
+ }
63
+ .bb4-line-3 {
64
+ @include sw3;
65
+ }
66
+ .bb4-line-4 {
67
+ @include sw3;
68
+ }
69
+ .bb4-line-5 {
70
+ @include sw1;
71
+ }
72
+ .bb4-line-6 {
73
+ @include sw1;
74
+ }
75
+ .bb4-line-7 {
76
+ @include sw1;
77
+ }
78
+ .bb4-line-8 {
79
+ @include sw3;
80
+ }
81
+ .bb4-line-9 {
82
+ @include sw3;
83
+ stroke-dasharray: 100 250;
84
+ }
85
+ .bb4-line-10 {
86
+ @include sw1;
87
+ stroke-dasharray: 80 270;
88
+ }
89
+ .border-box-content {
90
+ position: relative;
91
+ width: 100%;
92
+ height: 100%;
93
+ }
94
+ }
95
+ </style>
@@ -0,0 +1,64 @@
1
+ <template>
2
+ <div :ref="ref" class="sh-border-box-5">
3
+ <svg :class="`border-svg-container ${reverse && 'reverse'}`" :width="width" :height="height">
4
+ <polygon :fill="backgroundColor" :points="`10, 22 ${width - 22}, 22 ${width - 22}, ${height - 86} ${width - 84}, ${height - 24} 10, ${height - 24}`" />
5
+
6
+ <polyline class="bb5-line-1" :stroke="mergedColor[0]" :points="`8, 5 ${width - 5}, 5 ${width - 5}, ${height - 100} ${width - 100}, ${height - 5} 8, ${height - 5} 8, 5`" />
7
+ <polyline class="bb5-line-2" :stroke="mergedColor[1]" :points="`3, 5 ${width - 20}, 5 ${width - 20}, ${height - 60} ${width - 74}, ${height - 5} 3, ${height - 5} 3, 5`" />
8
+ <polyline class="bb5-line-3" :stroke="mergedColor[1]" :points="`50, 13 ${width - 35}, 13`" />
9
+ <polyline class="bb5-line-4" :stroke="mergedColor[1]" :points="`15, 20 ${width - 35}, 20`" />
10
+ <polyline class="bb5-line-5" :stroke="mergedColor[1]" :points="`15, ${height - 20} ${width - 110}, ${height - 20}`" />
11
+ <polyline class="bb5-line-6" :stroke="mergedColor[1]" :points="`15, ${height - 13} ${width - 110}, ${height - 13}`" />
12
+ </svg>
13
+
14
+ <div class="border-box-content">
15
+ <slot></slot>
16
+ </div>
17
+ </div>
18
+ </template>
19
+
20
+ <script>
21
+ import mixin from '../mixin/border'
22
+ export default {
23
+ name: 'ShBorder5',
24
+ mixins: [mixin]
25
+ }
26
+ </script>
27
+
28
+ <style scoped lang="scss">
29
+ .sh-border-box-5 {
30
+ position: relative;
31
+ width: 100%;
32
+ height: 100%;
33
+ .reverse {
34
+ transform: rotate(180deg);
35
+ }
36
+ .border-svg-container {
37
+ position: absolute;
38
+ top: 0;
39
+ left: 0;
40
+ width: 100%;
41
+ height: 100%;
42
+ & > polyline {
43
+ fill: none;
44
+ }
45
+ }
46
+ .bb5-line-1,
47
+ .bb5-line-2 {
48
+ stroke-width: 1;
49
+ }
50
+ .bb5-line-3,
51
+ .bb5-line-6 {
52
+ stroke-width: 5;
53
+ }
54
+ .bb5-line-4,
55
+ .bb5-line-5 {
56
+ stroke-width: 2;
57
+ }
58
+ .border-box-content {
59
+ position: relative;
60
+ width: 100%;
61
+ height: 100%;
62
+ }
63
+ }
64
+ </style>
@@ -0,0 +1,60 @@
1
+ <template>
2
+ <div :ref="ref" class="sh-border-box-6">
3
+ <svg class="border-svg-container" :width="width" :height="height">
4
+ <polygon :fill="backgroundColor" :points="`9, 7 ${width - 9}, 7 ${width - 9}, ${height - 7} 9, ${height - 7}`" />
5
+
6
+ <circle :fill="mergedColor[1]" cx="5" cy="5" r="2" />
7
+ <circle :fill="mergedColor[1]" :cx="width - 5" cy="5" r="2" />
8
+ <circle :fill="mergedColor[1]" :cx="width - 5" :cy="height - 5" r="2" />
9
+ <circle :fill="mergedColor[1]" cx="5" :cy="height - 5" r="2" />
10
+ <polyline :stroke="mergedColor[0]" :points="`10, 4 ${width - 10}, 4`" />
11
+ <polyline :stroke="mergedColor[0]" :points="`10, ${height - 4} ${width - 10}, ${height - 4}`" />
12
+ <polyline :stroke="mergedColor[0]" :points="`5, 70 5, ${height - 70}`" />
13
+ <polyline :stroke="mergedColor[0]" :points="`${width - 5}, 70 ${width - 5}, ${height - 70}`" />
14
+ <polyline :stroke="mergedColor[0]" :points="`3, 10, 3, 50`" />
15
+ <polyline :stroke="mergedColor[0]" :points="`7, 30 7, 80`" />
16
+ <polyline :stroke="mergedColor[0]" :points="`${width - 3}, 10 ${width - 3}, 50`" />
17
+ <polyline :stroke="mergedColor[0]" :points="`${width - 7}, 30 ${width - 7}, 80`" />
18
+ <polyline :stroke="mergedColor[0]" :points="`3, ${height - 10} 3, ${height - 50}`" />
19
+ <polyline :stroke="mergedColor[0]" :points="`7, ${height - 30} 7, ${height - 80}`" />
20
+ <polyline :stroke="mergedColor[0]" :points="`${width - 3}, ${height - 10} ${width - 3}, ${height - 50}`" />
21
+ <polyline :stroke="mergedColor[0]" :points="`${width - 7}, ${height - 30} ${width - 7}, ${height - 80}`" />
22
+ </svg>
23
+
24
+ <div class="border-box-content">
25
+ <slot></slot>
26
+ </div>
27
+ </div>
28
+ </template>
29
+
30
+ <script>
31
+ import mixin from '../mixin/border'
32
+ export default {
33
+ name: 'ShBorder6',
34
+ mixins: [mixin]
35
+ }
36
+ </script>
37
+
38
+ <style scoped lang="scss">
39
+ .sh-border-box-6 {
40
+ position: relative;
41
+ width: 100%;
42
+ height: 100%;
43
+ .border-svg-container {
44
+ position: absolute;
45
+ top: 0;
46
+ left: 0;
47
+ width: 100%;
48
+ height: 100%;
49
+ & > polyline {
50
+ fill: none;
51
+ stroke-width: 1;
52
+ }
53
+ }
54
+ .border-box-content {
55
+ position: relative;
56
+ width: 100%;
57
+ height: 100%;
58
+ }
59
+ }
60
+ </style>
@@ -0,0 +1,57 @@
1
+ <template>
2
+ <div :ref="ref" class="sh-border-box-7" :style="`box-shadow: inset 0 0 40px ${mergedColor[0]}; border: 1px solid ${mergedColor[0]}; background-color: ${backgroundColor}`">
3
+ <svg class="border-svg-container" :width="width" :height="height">
4
+ <polyline class="bb7-line-width-2" :stroke="mergedColor[0]" :points="`0, 25 0, 0 25, 0`" />
5
+ <polyline class="bb7-line-width-2" :stroke="mergedColor[0]" :points="`${width - 25}, 0 ${width}, 0 ${width}, 25`" />
6
+ <polyline class="bb7-line-width-2" :stroke="mergedColor[0]" :points="`${width - 25}, ${height} ${width}, ${height} ${width}, ${height - 25}`" />
7
+ <polyline class="bb7-line-width-2" :stroke="mergedColor[0]" :points="`0, ${height - 25} 0, ${height} 25, ${height}`" />
8
+
9
+ <polyline class="bb7-line-width-5" :stroke="mergedColor[1]" :points="`0, 10 0, 0 10, 0`" />
10
+ <polyline class="bb7-line-width-5" :stroke="mergedColor[1]" :points="`${width - 10}, 0 ${width}, 0 ${width}, 10`" />
11
+ <polyline class="bb7-line-width-5" :stroke="mergedColor[1]" :points="`${width - 10}, ${height} ${width}, ${height} ${width}, ${height - 10}`" />
12
+ <polyline class="bb7-line-width-5" :stroke="mergedColor[1]" :points="`0, ${height - 10} 0, ${height} 10, ${height}`" />
13
+ </svg>
14
+
15
+ <div class="border-box-content">
16
+ <slot></slot>
17
+ </div>
18
+ </div>
19
+ </template>
20
+
21
+ <script>
22
+ import mixin from '../mixin/border'
23
+ export default {
24
+ name: 'ShBorder7',
25
+ mixins: [mixin]
26
+ }
27
+ </script>
28
+
29
+ <style scoped lang="scss">
30
+ .sh-border-box-7 {
31
+ position: relative;
32
+ width: 100%;
33
+ height: 100%;
34
+ .border-svg-container {
35
+ position: absolute;
36
+ top: 0;
37
+ left: 0;
38
+ width: 100%;
39
+ height: 100%;
40
+ & > polyline {
41
+ fill: none;
42
+ stroke-linecap: round;
43
+ }
44
+ }
45
+ .bb7-line-width-2 {
46
+ stroke-width: 2;
47
+ }
48
+ .bb7-line-width-5 {
49
+ stroke-width: 5;
50
+ }
51
+ .border-box-content {
52
+ position: relative;
53
+ width: 100%;
54
+ height: 100%;
55
+ }
56
+ }
57
+ </style>
@@ -0,0 +1,75 @@
1
+ <template>
2
+ <div :ref="ref" class="sh-border-box-8">
3
+ <svg class="border-svg-container" :width="width" :height="height">
4
+ <defs>
5
+ <path :id="path" :d="pathD" fill="transparent" />
6
+ <radialGradient :id="gradient" cx="50%" cy="50%" r="50%">
7
+ <stop offset="0%" stop-color="#fff" stop-opacity="1" />
8
+ <stop offset="100%" stop-color="#fff" stop-opacity="0" />
9
+ </radialGradient>
10
+ <mask :id="mask">
11
+ <circle cx="0" cy="0" r="150" :fill="`url(#${gradient})`">
12
+ <animateMotion :dur="`${dur}s`" :path="pathD" rotate="auto" repeatCount="indefinite" />
13
+ </circle>
14
+ </mask>
15
+ </defs>
16
+ <polygon :fill="backgroundColor" :points="`5, 5 ${width - 5}, 5 ${width - 5} ${height - 5} 5, ${height - 5}`" />
17
+ <use :stroke="mergedColor[0]" stroke-width="1" :xlink:href="`#${path}`" />
18
+ <use :stroke="mergedColor[1]" stroke-width="3" :xlink:href="`#${path}`" :mask="`url(#${mask})`">
19
+ <animate attributeName="stroke-dasharray" :from="`0, ${length}`" :to="`${length}, 0`" :dur="`${dur}s`" repeatCount="indefinite" />
20
+ </use>
21
+ </svg>
22
+
23
+ <div class="border-box-content">
24
+ <slot></slot>
25
+ </div>
26
+ </div>
27
+ </template>
28
+
29
+ <script>
30
+ import mixin from '../mixin/border'
31
+ export default {
32
+ name: 'ShBorder8',
33
+ mixins: [mixin],
34
+ computed: {
35
+ path() {
36
+ return `border-box-8-path-${this.borderId}`
37
+ },
38
+ gradient() {
39
+ return `border-box-8-gradient-${this.borderId}`
40
+ },
41
+ mask() {
42
+ return `border-box-8-mask-${this.borderId}`
43
+ },
44
+ length() {
45
+ const { width, height } = this
46
+ return (width + height - 5) * 2
47
+ },
48
+ pathD() {
49
+ const { reverse, width, height } = this
50
+ 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`
51
+ 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`
52
+ }
53
+ }
54
+ }
55
+ </script>
56
+
57
+ <style scoped lang="scss">
58
+ .sh-border-box-8 {
59
+ position: relative;
60
+ width: 100%;
61
+ height: 100%;
62
+ .border-svg-container {
63
+ position: absolute;
64
+ width: 100%;
65
+ height: 100%;
66
+ left: 0;
67
+ top: 0;
68
+ }
69
+ .border-box-content {
70
+ position: relative;
71
+ width: 100%;
72
+ height: 100%;
73
+ }
74
+ }
75
+ </style>
@@ -0,0 +1,92 @@
1
+ <template>
2
+ <div :ref="ref" class="sh-border-box-9">
3
+ <svg class="border-svg-container" :width="width" :height="height">
4
+ <defs>
5
+ <linearGradient :id="gradientId" x1="0%" y1="0%" x2="100%" y2="100%">
6
+ <animate attributeName="x1" values="0%;100%;0%" dur="10s" begin="0s" repeatCount="indefinite" />
7
+
8
+ <animate attributeName="x2" values="100%;0%;100%" dur="10s" begin="0s" repeatCount="indefinite" />
9
+
10
+ <stop offset="0%" :stop-color="mergedColor[0]">
11
+ <animate attributeName="stop-color" :values="`${mergedColor[0]};${mergedColor[1]};${mergedColor[0]}`" dur="10s" begin="0s" repeatCount="indefinite" />
12
+ </stop>
13
+ <stop offset="100%" :stop-color="mergedColor[1]">
14
+ <animate attributeName="stop-color" :values="`${mergedColor[1]};${mergedColor[0]};${mergedColor[1]}`" dur="10s" begin="0s" repeatCount="indefinite" />
15
+ </stop>
16
+ </linearGradient>
17
+
18
+ <mask :id="maskId">
19
+ <polyline stroke="#fff" stroke-width="3" fill="transparent" :points="`8, ${height * 0.4} 8, 3, ${width * 0.4 + 7}, 3`" />
20
+ <polyline fill="#fff" :points="`8, ${height * 0.15} 8, 3, ${width * 0.1 + 7}, 3 ${width * 0.1}, 8 14, 8 14, ${height * 0.15 - 7}`" />
21
+
22
+ <polyline stroke="#fff" stroke-width="3" fill="transparent" :points="`${width * 0.5}, 3 ${width - 3}, 3, ${width - 3}, ${height * 0.25}`" />
23
+ <polyline fill="#fff" :points="`${width * 0.52}, 3 ${width * 0.58}, 3 ${width * 0.58 - 7}, 9 ${width * 0.52 + 7}, 9`" />
24
+ <polyline fill="#fff" :points="`${width * 0.9}, 3 ${width - 3}, 3 ${width - 3}, ${height * 0.1} ${width - 9}, ${height * 0.1 - 7} ${width - 9}, 9 ${width * 0.9 + 7}, 9`" />
25
+
26
+ <polyline stroke="#fff" stroke-width="3" fill="transparent" :points="`8, ${height * 0.5} 8, ${height - 3} ${width * 0.3 + 7}, ${height - 3}`" />
27
+ <polyline fill="#fff" :points="`8, ${height * 0.55} 8, ${height * 0.7} 2, ${height * 0.7 - 7} 2, ${height * 0.55 + 7}`" />
28
+
29
+ <polyline stroke="#fff" stroke-width="3" fill="transparent" :points="`${width * 0.35}, ${height - 3} ${width - 3}, ${height - 3} ${width - 3}, ${height * 0.35}`" />
30
+ <polyline
31
+ fill="#fff"
32
+ :points="`${width * 0.92}, ${height - 3} ${width - 3}, ${height - 3} ${width - 3}, ${height * 0.8} ${width - 9}, ${height * 0.8 + 7} ${width - 9}, ${height - 9} ${
33
+ width * 0.92 + 7
34
+ }, ${height - 9}`" />
35
+ </mask>
36
+ </defs>
37
+
38
+ <polygon
39
+ :fill="backgroundColor"
40
+ :points="`
41
+ 15, 9 ${width * 0.1 + 1}, 9 ${width * 0.1 + 4}, 6 ${width * 0.52 + 2}, 6
42
+ ${width * 0.52 + 6}, 10 ${width * 0.58 - 7}, 10 ${width * 0.58 - 2}, 6
43
+ ${width * 0.9 + 2}, 6 ${width * 0.9 + 6}, 10 ${width - 10}, 10 ${width - 10}, ${height * 0.1 - 6}
44
+ ${width - 6}, ${height * 0.1 - 1} ${width - 6}, ${height * 0.8 + 1} ${width - 10}, ${height * 0.8 + 6}
45
+ ${width - 10}, ${height - 10} ${width * 0.92 + 7}, ${height - 10} ${width * 0.92 + 2}, ${height - 6}
46
+ 11, ${height - 6} 11, ${height * 0.15 - 2} 15, ${height * 0.15 - 7}
47
+ `" />
48
+
49
+ <rect x="0" y="0" :width="width" :height="height" :fill="`url(#${gradientId})`" :mask="`url(#${maskId})`" />
50
+ </svg>
51
+
52
+ <div class="border-box-content">
53
+ <slot></slot>
54
+ </div>
55
+ </div>
56
+ </template>
57
+
58
+ <script>
59
+ import mixin from '../mixin/border'
60
+ export default {
61
+ name: 'ShBorder9',
62
+ mixins: [mixin],
63
+ computed: {
64
+ gradientId() {
65
+ return `border-box-9-gradient-${this.borderId}`
66
+ },
67
+ maskId() {
68
+ return `border-box-9-mask-${this.borderId}`
69
+ }
70
+ }
71
+ }
72
+ </script>
73
+
74
+ <style scoped lang="scss">
75
+ .sh-border-box-9 {
76
+ position: relative;
77
+ width: 100%;
78
+ height: 100%;
79
+ .border-svg-container {
80
+ position: absolute;
81
+ width: 100%;
82
+ height: 100%;
83
+ left: 0;
84
+ top: 0;
85
+ }
86
+ .border-box-content {
87
+ position: relative;
88
+ width: 100%;
89
+ height: 100%;
90
+ }
91
+ }
92
+ </style>
@@ -0,0 +1,73 @@
1
+ <template>
2
+ <component :is="borderName" class="sh-border-box" v-bind="$props">
3
+ <slot></slot>
4
+ </component>
5
+ </template>
6
+
7
+ <script>
8
+ import border1 from './components/border1'
9
+ import border2 from './components/border2'
10
+ import border3 from './components/border3'
11
+ import border4 from './components/border4'
12
+ import border5 from './components/border5'
13
+ import border6 from './components/border6'
14
+ import border7 from './components/border7'
15
+ import border8 from './components/border8'
16
+ import border9 from './components/border9'
17
+ import border10 from './components/border10'
18
+ import border11 from './components/border11'
19
+ import border12 from './components/border12'
20
+ import border13 from './components/border13'
21
+ export default {
22
+ name: 'ShBorder',
23
+ components: {
24
+ border1,
25
+ border2,
26
+ border3,
27
+ border4,
28
+ border5,
29
+ border6,
30
+ border7,
31
+ border8,
32
+ border9,
33
+ border10,
34
+ border11,
35
+ border12,
36
+ border13
37
+ },
38
+ props: {
39
+ type: {
40
+ type: [String, Number],
41
+ default: '1'
42
+ },
43
+ color: {
44
+ type: Array,
45
+ default() {
46
+ return []
47
+ }
48
+ },
49
+ backgroundColor: {
50
+ type: String,
51
+ default: 'transparent'
52
+ },
53
+ dur: {
54
+ type: Number,
55
+ default: 3
56
+ },
57
+ reverse: {
58
+ type: Boolean,
59
+ default: false
60
+ }
61
+ },
62
+ computed: {
63
+ borderType() {
64
+ return +this.type > 0 && +this.type < 14 ? this.type : 1
65
+ },
66
+ borderName() {
67
+ return `border${this.borderType}`
68
+ }
69
+ }
70
+ }
71
+ </script>
72
+
73
+ <style lang="scss" scoped></style>
@@ -0,0 +1,62 @@
1
+ import autoResize from '../../mixin/autoResize'
2
+ export default {
3
+ mixins: [autoResize],
4
+ props: {
5
+ type: {
6
+ type: [String, Number],
7
+ default: '1'
8
+ },
9
+ color: {
10
+ type: Array,
11
+ default() {
12
+ return []
13
+ }
14
+ },
15
+ backgroundColor: {
16
+ type: String,
17
+ default: 'transparent'
18
+ },
19
+ dur: {
20
+ type: Number,
21
+ default: 3
22
+ },
23
+ reverse: {
24
+ type: Boolean,
25
+ default: false
26
+ }
27
+ },
28
+ data() {
29
+ return {
30
+ border: ['left-top', 'right-top', 'left-bottom', 'right-bottom'],
31
+ defaultColors: [
32
+ ['#4fd2dd', '#235fa7'],
33
+ ['#fff', 'rgba(255, 255, 255, 0.6)'],
34
+ ['#2862b7', '#2862b7'],
35
+ ['red', 'rgba(0,0,255,0.8)'],
36
+ ['rgba(255, 255, 255, 0.35)', 'rgba(255, 255, 255, 0.20)'],
37
+ ['rgba(255, 255, 255, 0.35)', 'gray'],
38
+ ['rgba(128,128,128,0.3)', 'rgba(128,128,128,0.5)'],
39
+ ['#235fa7', '#4fd2dd'],
40
+ ['#11eefd', '#0078d2'],
41
+ ['#1d48c4', '#d3e1f8'],
42
+ ['#8aaafb', '#1f33a2'],
43
+ ['#2e6099', '#7ce7fd'],
44
+ ['#6586ec', '#2cf7fe']
45
+ ]
46
+ }
47
+ },
48
+ computed: {
49
+ ref() {
50
+ return `sh-border-box-${this.type}`
51
+ },
52
+ borderId() {
53
+ return this.uuid()
54
+ },
55
+ mergedColor() {
56
+ let defaultColor = this.defaultColors[this.type - 1]
57
+ return this.deepMerge(defaultColor, this.color)
58
+ }
59
+ },
60
+ methods: {},
61
+ mounted() {}
62
+ }