aldehyde 0.2.279 → 0.2.282

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 (145) hide show
  1. package/lib/controls/tree-select/tree-entity-select.d.ts.map +1 -1
  2. package/lib/controls/tree-select/tree-entity-select.js +23 -13
  3. package/lib/controls/tree-select/tree-entity-select.js.map +1 -1
  4. package/lib/form/dtmpl-form.d.ts.map +1 -1
  5. package/lib/form/dtmpl-form.js +2 -2
  6. package/lib/form/dtmpl-form.js.map +1 -1
  7. package/lib/form/form-Item-group.d.ts +1 -0
  8. package/lib/form/form-Item-group.d.ts.map +1 -1
  9. package/lib/form/form-Item-group.js +13 -10
  10. package/lib/form/form-Item-group.js.map +1 -1
  11. package/lib/lowcode-components/assets/china.json +99420 -0
  12. package/lib/lowcode-components/base-map/index.d.ts +22 -0
  13. package/lib/lowcode-components/base-map/index.d.ts.map +1 -0
  14. package/lib/lowcode-components/base-map/index.js +85 -0
  15. package/lib/lowcode-components/base-map/index.js.map +1 -0
  16. package/lib/lowcode-components/border/border1/index.d.ts +14 -0
  17. package/lib/lowcode-components/border/border1/index.d.ts.map +1 -0
  18. package/lib/lowcode-components/border/border1/index.js +39 -0
  19. package/lib/lowcode-components/border/border1/index.js.map +1 -0
  20. package/lib/lowcode-components/border/border10/index.d.ts +19 -0
  21. package/lib/lowcode-components/border/border10/index.d.ts.map +1 -0
  22. package/lib/lowcode-components/border/border10/index.js +16 -0
  23. package/lib/lowcode-components/border/border10/index.js.map +1 -0
  24. package/lib/lowcode-components/border/border10/index.less +27 -0
  25. package/lib/lowcode-components/border/border11/index.d.ts +25 -0
  26. package/lib/lowcode-components/border/border11/index.d.ts.map +1 -0
  27. package/lib/lowcode-components/border/border11/index.js +95 -0
  28. package/lib/lowcode-components/border/border11/index.js.map +1 -0
  29. package/lib/lowcode-components/border/border11/index.less +18 -0
  30. package/lib/lowcode-components/border/border12/index.d.ts +20 -0
  31. package/lib/lowcode-components/border/border12/index.d.ts.map +1 -0
  32. package/lib/lowcode-components/border/border12/index.js +49 -0
  33. package/lib/lowcode-components/border/border12/index.js.map +1 -0
  34. package/lib/lowcode-components/border/border12/index.less +14 -0
  35. package/lib/lowcode-components/border/border13/index.d.ts +19 -0
  36. package/lib/lowcode-components/border/border13/index.d.ts.map +1 -0
  37. package/lib/lowcode-components/border/border13/index.js +29 -0
  38. package/lib/lowcode-components/border/border13/index.js.map +1 -0
  39. package/lib/lowcode-components/border/border13/index.less +14 -0
  40. package/lib/lowcode-components/border/border2/index.d.ts +19 -0
  41. package/lib/lowcode-components/border/border2/index.d.ts.map +1 -0
  42. package/lib/lowcode-components/border/border2/index.js +27 -0
  43. package/lib/lowcode-components/border/border2/index.js.map +1 -0
  44. package/lib/lowcode-components/border/border2/index.less +18 -0
  45. package/lib/lowcode-components/border/border3/index.d.ts +19 -0
  46. package/lib/lowcode-components/border/border3/index.d.ts.map +1 -0
  47. package/lib/lowcode-components/border/border3/index.js +27 -0
  48. package/lib/lowcode-components/border/border3/index.js.map +1 -0
  49. package/lib/lowcode-components/border/border3/index.less +26 -0
  50. package/lib/lowcode-components/border/border4/index.d.ts +20 -0
  51. package/lib/lowcode-components/border/border4/index.d.ts.map +1 -0
  52. package/lib/lowcode-components/border/border4/index.js +32 -0
  53. package/lib/lowcode-components/border/border4/index.js.map +1 -0
  54. package/lib/lowcode-components/border/border4/index.less +73 -0
  55. package/lib/lowcode-components/border/border5/index.d.ts +20 -0
  56. package/lib/lowcode-components/border/border5/index.d.ts.map +1 -0
  57. package/lib/lowcode-components/border/border5/index.js +28 -0
  58. package/lib/lowcode-components/border/border5/index.js.map +1 -0
  59. package/lib/lowcode-components/border/border5/index.less +36 -0
  60. package/lib/lowcode-components/border/border6/index.d.ts +19 -0
  61. package/lib/lowcode-components/border/border6/index.d.ts.map +1 -0
  62. package/lib/lowcode-components/border/border6/index.js +36 -0
  63. package/lib/lowcode-components/border/border6/index.js.map +1 -0
  64. package/lib/lowcode-components/border/border6/index.less +18 -0
  65. package/lib/lowcode-components/border/border7/index.d.ts +19 -0
  66. package/lib/lowcode-components/border/border7/index.d.ts.map +1 -0
  67. package/lib/lowcode-components/border/border7/index.js +33 -0
  68. package/lib/lowcode-components/border/border7/index.js.map +1 -0
  69. package/lib/lowcode-components/border/border7/index.less +27 -0
  70. package/lib/lowcode-components/border/border8/index.d.ts +21 -0
  71. package/lib/lowcode-components/border/border8/index.d.ts.map +1 -0
  72. package/lib/lowcode-components/border/border8/index.js +43 -0
  73. package/lib/lowcode-components/border/border8/index.js.map +1 -0
  74. package/lib/lowcode-components/border/border8/index.less +14 -0
  75. package/lib/lowcode-components/border/border9/index.d.ts +20 -0
  76. package/lib/lowcode-components/border/border9/index.d.ts.map +1 -0
  77. package/lib/lowcode-components/border/border9/index.js +60 -0
  78. package/lib/lowcode-components/border/border9/index.js.map +1 -0
  79. package/lib/lowcode-components/border/border9/index.less +14 -0
  80. package/lib/lowcode-components/effectScatter-map/index.d.ts +25 -0
  81. package/lib/lowcode-components/effectScatter-map/index.d.ts.map +1 -0
  82. package/lib/lowcode-components/effectScatter-map/index.js +108 -0
  83. package/lib/lowcode-components/effectScatter-map/index.js.map +1 -0
  84. package/lib/lowcode-components/index.d.ts +28 -0
  85. package/lib/lowcode-components/index.d.ts.map +1 -1
  86. package/lib/lowcode-components/index.js +28 -0
  87. package/lib/lowcode-components/index.js.map +1 -1
  88. package/lib/lowcode-components/lowcode-view/component/assets.d.ts.map +1 -1
  89. package/lib/lowcode-components/lowcode-view/component/assets.js +120 -0
  90. package/lib/lowcode-components/lowcode-view/component/assets.js.map +1 -1
  91. package/lib/module/dtmpl-edit-page.d.ts +12 -12
  92. package/lib/module/dtmpl-edit-page.d.ts.map +1 -1
  93. package/lib/module/dtmpl-edit-page.js +4 -2
  94. package/lib/module/dtmpl-edit-page.js.map +1 -1
  95. package/lib/table/act-table.d.ts.map +1 -1
  96. package/lib/table/act-table.js +1 -2
  97. package/lib/table/act-table.js.map +1 -1
  98. package/lib/tmpl/hcservice-v3.d.ts +1 -0
  99. package/lib/tmpl/hcservice-v3.d.ts.map +1 -1
  100. package/lib/tmpl/hcservice-v3.js +8 -0
  101. package/lib/tmpl/hcservice-v3.js.map +1 -1
  102. package/lib/tmpl/interface.d.ts +1 -0
  103. package/lib/tmpl/interface.d.ts.map +1 -1
  104. package/lib/tree/block-menu-auth-tree.d.ts.map +1 -1
  105. package/lib/tree/block-menu-auth-tree.js +5 -5
  106. package/lib/tree/block-menu-auth-tree.js.map +1 -1
  107. package/package.json +1 -1
  108. package/src/aldehyde/controls/tree-select/tree-entity-select.tsx +13 -6
  109. package/src/aldehyde/form/dtmpl-form.tsx +3 -1
  110. package/src/aldehyde/form/form-Item-group.tsx +14 -12
  111. package/src/aldehyde/lowcode-components/assets/china.json +99420 -0
  112. package/src/aldehyde/lowcode-components/base-map/index.tsx +108 -0
  113. package/src/aldehyde/lowcode-components/border/border1/index.tsx +71 -0
  114. package/src/aldehyde/lowcode-components/border/border10/index.less +27 -0
  115. package/src/aldehyde/lowcode-components/border/border10/index.tsx +46 -0
  116. package/src/aldehyde/lowcode-components/border/border11/index.less +18 -0
  117. package/src/aldehyde/lowcode-components/border/border11/index.tsx +232 -0
  118. package/src/aldehyde/lowcode-components/border/border12/index.less +14 -0
  119. package/src/aldehyde/lowcode-components/border/border12/index.tsx +115 -0
  120. package/src/aldehyde/lowcode-components/border/border13/index.less +14 -0
  121. package/src/aldehyde/lowcode-components/border/border13/index.tsx +69 -0
  122. package/src/aldehyde/lowcode-components/border/border2/index.less +18 -0
  123. package/src/aldehyde/lowcode-components/border/border2/index.tsx +51 -0
  124. package/src/aldehyde/lowcode-components/border/border3/index.less +26 -0
  125. package/src/aldehyde/lowcode-components/border/border3/index.tsx +61 -0
  126. package/src/aldehyde/lowcode-components/border/border4/index.less +73 -0
  127. package/src/aldehyde/lowcode-components/border/border4/index.tsx +79 -0
  128. package/src/aldehyde/lowcode-components/border/border5/index.less +36 -0
  129. package/src/aldehyde/lowcode-components/border/border5/index.tsx +75 -0
  130. package/src/aldehyde/lowcode-components/border/border6/index.less +18 -0
  131. package/src/aldehyde/lowcode-components/border/border6/index.tsx +60 -0
  132. package/src/aldehyde/lowcode-components/border/border7/index.less +27 -0
  133. package/src/aldehyde/lowcode-components/border/border7/index.tsx +75 -0
  134. package/src/aldehyde/lowcode-components/border/border8/index.less +14 -0
  135. package/src/aldehyde/lowcode-components/border/border8/index.tsx +84 -0
  136. package/src/aldehyde/lowcode-components/border/border9/index.less +14 -0
  137. package/src/aldehyde/lowcode-components/border/border9/index.tsx +154 -0
  138. package/src/aldehyde/lowcode-components/effectScatter-map/index.tsx +133 -0
  139. package/src/aldehyde/lowcode-components/index.ts +42 -0
  140. package/src/aldehyde/lowcode-components/lowcode-view/component/assets.ts +120 -0
  141. package/src/aldehyde/module/dtmpl-edit-page.tsx +7 -3
  142. package/src/aldehyde/table/act-table.tsx +4 -5
  143. package/src/aldehyde/tmpl/hcservice-v3.tsx +8 -0
  144. package/src/aldehyde/tmpl/interface.tsx +1 -0
  145. package/src/aldehyde/tree/block-menu-auth-tree.tsx +2 -5
@@ -0,0 +1,108 @@
1
+ import * as echarts from 'echarts';
2
+ import React, { useEffect, useRef, useState, ForwardedRef, forwardRef, useImperativeHandle } from 'react';
3
+ import _ from 'lodash';
4
+ import chinaJson from "../assets/china.json";
5
+
6
+ const defOption = {
7
+ tooltip: {
8
+ trigger: 'item',
9
+ },
10
+ geo: {
11
+ show: true,
12
+ map: 'china',
13
+ roam: true,
14
+ zoom: 1,
15
+ label: {
16
+ normal: { show: false },
17
+ emphasis: { show: false }
18
+ },
19
+ itemStyle: {
20
+ normal: {
21
+ areaColor: '#031525',
22
+ borderColor: '#076ba1'
23
+ },
24
+ emphasis: {
25
+ areaColor: '#2B91B7'
26
+ }
27
+ },
28
+ select: {}
29
+ },
30
+ series: [
31
+ {
32
+ type: 'map',
33
+ coordinateSystem: 'geo',
34
+ map: 'china',
35
+ geoIndex: 0,
36
+ aspectScale: 0.75, //长宽比
37
+ data: []
38
+ }
39
+ ]
40
+ };
41
+
42
+
43
+ export interface ChartComponentStyle {
44
+ tooltip?: { show: boolean };
45
+ geo?: { [key: string]: any };
46
+ }
47
+
48
+ export interface ChartComponentProps {
49
+ style?: ChartComponentStyle;
50
+ base: { width: number, height: number }
51
+ }
52
+
53
+ export interface BaseTextComponentRef {
54
+ updateConfig: (newConfig: ChartComponentProps) => void;
55
+ }
56
+
57
+ const Index = forwardRef((props: ChartComponentProps, ref: ForwardedRef<BaseTextComponentRef>) => {
58
+ const [config, setConfig] = useState<ChartComponentStyle>(props.style || {});
59
+ const [size, setSize] = useState<{ width: number, height: number }>()
60
+ const chartRef = useRef<HTMLDivElement>(null);
61
+ const chart = useRef<any>(null);
62
+
63
+ useImperativeHandle(ref, () => ({
64
+ updateConfig: (newConfig) => {
65
+ const { base, style } = newConfig;
66
+ setConfig({ ...(style || {}) });
67
+ setSize({ width: base.width, height: base.height });
68
+ },
69
+ }));
70
+
71
+ // 窗口大小变化时重新调整图表大小
72
+ const handleResize = () => {
73
+ chart.current.resize({ animation: { duration: 500 } });
74
+ };
75
+
76
+ useEffect(() => {
77
+ echarts.registerMap('china', chinaJson as any);
78
+ chart.current = echarts.init(chartRef.current, null, { renderer: 'svg' });
79
+ window.addEventListener('resize', handleResize);
80
+ return () => {
81
+ window.removeEventListener('resize', handleResize);
82
+ chart.current.dispose();
83
+ }
84
+ }, []);
85
+
86
+ const renderChart = () => {
87
+ const { tooltip, geo } = config
88
+ const option = _.cloneDeep(defOption);
89
+ option.tooltip = { trigger: "item", ...tooltip };
90
+ option.geo = { ...option.geo, ...geo, ...geo.normal };
91
+ chart.current.setOption(option, true);
92
+ }
93
+ useEffect(() => {
94
+ if (config) {
95
+ renderChart();
96
+ }
97
+ }, [config]);
98
+
99
+ useEffect(() => {
100
+ if (size) {
101
+ handleResize();
102
+ }
103
+ }, [size]);
104
+
105
+ return <div ref={chartRef} style={{ width: '100%', height: '100%' }} />;
106
+ });
107
+
108
+ export default Index;
@@ -0,0 +1,71 @@
1
+ import React, { ForwardedRef, forwardRef, useImperativeHandle, useState } from "react";
2
+
3
+ interface ComponentStyle {
4
+ mainColor?: string;
5
+ subColor?: string;
6
+ }
7
+
8
+ export interface ComponentProps {
9
+ style?: ComponentStyle;
10
+ }
11
+
12
+ export interface ComponentRef {
13
+ updateConfig: (config: ComponentProps) => void;
14
+ }
15
+ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>) => {
16
+ const [style, setStyle] = useState<ComponentStyle>({ ...props.style });
17
+ const { mainColor = "#83BFF6", subColor = "#00CED1" } = style || {};
18
+
19
+ useImperativeHandle(ref, () => ({
20
+ updateConfig: (newConfig) => setStyle({ ...newConfig.style }),
21
+ }));
22
+
23
+ return <div style={{ position: "relative", width: "100%", height: "100%" }}>
24
+ <svg width="150px" height="150px" style={{ position: "absolute", top: 0, left: 0, display: "block" }}>
25
+ <polygon fill={`${mainColor}`} 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">
26
+ <animate attributeName="fill" values={`${mainColor};${subColor};${mainColor}`} dur="0.5s" begin="0s" repeatCount="indefinite"></animate>
27
+ </polygon>
28
+ <polygon fill={`${subColor}`} points="27.599999999999998,4.8 38.4,4.8 35.4,7.8 30.599999999999998,7.8">
29
+ <animate attributeName="fill" values={`${subColor};${mainColor};${subColor}`} dur="0.5s" begin="0s" repeatCount="indefinite"></animate>
30
+ </polygon>
31
+ <polygon fill={`${mainColor}`} 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">
32
+ <animate attributeName="fill" values={`${mainColor};${subColor};transparent`} dur="1s" begin="0s" repeatCount="indefinite"></animate>
33
+ </polygon>
34
+ </svg>
35
+ <svg width="150px" height="150px" style={{ position: "absolute", top: 0, right: 0, display: "block", transform: "rotateY(180deg)" }}>
36
+ <polygon fill={`${mainColor}`} 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">
37
+ <animate attributeName="fill" values={`${mainColor};${subColor};${mainColor}`} dur="0.5s" begin="0s" repeatCount="indefinite"></animate>
38
+ </polygon>
39
+ <polygon fill={`${subColor}`} points="27.599999999999998,4.8 38.4,4.8 35.4,7.8 30.599999999999998,7.8">
40
+ <animate attributeName="fill" values={`${subColor};${mainColor};${subColor}`} dur="0.5s" begin="0s" repeatCount="indefinite"></animate>
41
+ </polygon>
42
+ <polygon fill={`${mainColor}`} 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">
43
+ <animate attributeName="fill" values={`${mainColor};${subColor};transparent`} dur="1s" begin="0s" repeatCount="indefinite"></animate>
44
+ </polygon>
45
+ </svg>
46
+ <svg width="150px" height="150px" style={{ position: "absolute", bottom: 0, left: 0, display: "block", transform: "rotateX(180deg)" }}>
47
+ <polygon fill={`${mainColor}`} 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">
48
+ <animate attributeName="fill" values={`${mainColor};${subColor};${mainColor}`} dur="0.5s" begin="0s" repeatCount="indefinite"></animate>
49
+ </polygon>
50
+ <polygon fill={`${subColor}`} points="27.599999999999998,4.8 38.4,4.8 35.4,7.8 30.599999999999998,7.8">
51
+ <animate attributeName="fill" values={`${subColor};${mainColor};${subColor}`} dur="0.5s" begin="0s" repeatCount="indefinite"></animate>
52
+ </polygon>
53
+ <polygon fill={`${mainColor}`} 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">
54
+ <animate attributeName="fill" values={`${mainColor};${subColor};transparent`} dur="1s" begin="0s" repeatCount="indefinite"></animate>
55
+ </polygon>
56
+ </svg>
57
+ <svg width="150px" height="150px" style={{ position: "absolute", bottom: 0, right: 0, display: "block", transform: "rotateX(180deg) rotateY(180deg)" }}>
58
+ <polygon fill={`${mainColor}`} 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">
59
+ <animate attributeName="fill" values={`${mainColor};${subColor};${mainColor}`} dur="0.5s" begin="0s" repeatCount="indefinite"></animate>
60
+ </polygon>
61
+ <polygon fill={`${subColor}`} points="27.599999999999998,4.8 38.4,4.8 35.4,7.8 30.599999999999998,7.8">
62
+ <animate attributeName="fill" values={`${subColor};${mainColor};${subColor}`} dur="0.5s" begin="0s" repeatCount="indefinite"></animate>
63
+ </polygon>
64
+ <polygon fill={`${mainColor}`} 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">
65
+ <animate attributeName="fill" values={`${mainColor};${subColor};transparent`} dur="1s" begin="0s" repeatCount="indefinite"></animate>
66
+ </polygon>
67
+ </svg>
68
+ </div>;
69
+ });
70
+
71
+ export default Index;
@@ -0,0 +1,27 @@
1
+ .border-box-10 {
2
+ position: relative;
3
+ width: 100%;
4
+ height: 100%;
5
+ border-radius: 6px;
6
+
7
+ .right-top {
8
+ right: 0px;
9
+ transform: rotateY(180deg);
10
+ position: absolute;
11
+ }
12
+
13
+ .left-bottom {
14
+ bottom: 0px;
15
+ left: 0px;
16
+ transform: rotateX(180deg);
17
+ position: absolute;
18
+ }
19
+
20
+ .right-bottom {
21
+ right: 0px;
22
+ bottom: 0px;
23
+ transform: rotateX(180deg) rotateY(180deg);
24
+ position: absolute;
25
+ }
26
+
27
+ }
@@ -0,0 +1,46 @@
1
+ import React, { ForwardedRef, forwardRef, useImperativeHandle, useState } from "react";
2
+ import "./index.less";
3
+
4
+ const border = ['left-top', 'right-top', 'left-bottom', 'right-bottom'];
5
+
6
+ interface ComponentStyle {
7
+ mainColor?: string;
8
+ subColor?: string;
9
+ }
10
+
11
+ export interface ComponentProps {
12
+ style?: ComponentStyle;
13
+ base?: { width?: number, height?: number }
14
+ }
15
+
16
+ export interface ComponentRef {
17
+ updateConfig: (config: ComponentProps) => void;
18
+ }
19
+ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>) => {
20
+ const [style, setStyle] = useState<ComponentStyle>({ ...props.style });
21
+ const { mainColor = "#83BFF6", subColor = "#00CED1" } = style || {};
22
+
23
+ useImperativeHandle(ref, () => ({
24
+ updateConfig: (newConfig) => {
25
+ setStyle({ ...newConfig.style });
26
+ },
27
+ }));
28
+
29
+ return <div className="border-box-10" style={{ boxShadow: `inset 0 0 25px 3px ${mainColor}` }} >
30
+ {border.map(borderName => (
31
+ <svg
32
+ width='150px'
33
+ height='150px'
34
+ key={borderName}
35
+ className={`${borderName} border-svg-container`}
36
+ >
37
+ <polygon
38
+ fill={subColor}
39
+ points='40, 0 5, 0 0, 5 0, 16 3, 19 3, 7 7, 3 35, 3'
40
+ />
41
+ </svg>
42
+ ))}
43
+ </div>;
44
+ });
45
+
46
+ export default Index;
@@ -0,0 +1,18 @@
1
+ .border-box-11 {
2
+ position: relative;
3
+ width: 100%;
4
+ height: 100%;
5
+
6
+ polyline {
7
+ fill: none;
8
+ stroke-width: 1;
9
+ }
10
+
11
+ .border-svg-container {
12
+ position: absolute;
13
+ width: 100%;
14
+ height: 100%;
15
+ top: 0px;
16
+ left: 0px;
17
+ }
18
+ }
@@ -0,0 +1,232 @@
1
+ import React, { ForwardedRef, forwardRef, useImperativeHandle, useState } from "react";
2
+ import "./index.less";
3
+
4
+ interface ComponentStyle {
5
+ mainColor?: string;
6
+ subColor?: string;
7
+ title?: { text: string, fontSize?: number, color?: string };
8
+ }
9
+
10
+ export interface ComponentProps {
11
+ style?: ComponentStyle;
12
+ base?: { width?: number, height?: number, id: string }
13
+ }
14
+
15
+ export interface ComponentRef {
16
+ updateConfig: (config: ComponentProps) => void;
17
+ }
18
+ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>) => {
19
+ const [style, setStyle] = useState<ComponentStyle>({ ...props.style });
20
+ const [width, setWidth] = useState<number>(480);
21
+ const [height, setHeight] = useState<number>(320);
22
+ const { mainColor = "#83BFF6", subColor = "#00CED1", title } = style || {};
23
+ const filterId = `border-box-11${props.base.id}`;
24
+
25
+ useImperativeHandle(ref, () => ({
26
+ updateConfig: (newConfig) => {
27
+ const { width, height } = newConfig.base;
28
+ setStyle({ ...newConfig.style });
29
+ setWidth(width);
30
+ setHeight(height);
31
+ },
32
+ }));
33
+
34
+ return <div className="border-box-6" >
35
+ <svg className='border-svg-container' width={width} height={height}>
36
+ <defs>
37
+ <filter id={filterId} height='150%' width='150%' x='-25%' y='-25%'>
38
+ <feMorphology operator='dilate' radius='2' in='SourceAlpha' result='thicken' />
39
+ <feGaussianBlur in='thicken' stdDeviation='3' result='blurred' />
40
+ <feFlood floodColor={subColor} result='glowColor' />
41
+ <feComposite in='glowColor' in2='blurred' operator='in' result='softGlowColored' />
42
+ <feMerge>
43
+ <feMergeNode in='softGlowColored' />
44
+ <feMergeNode in='SourceGraphic' />
45
+ </feMerge>
46
+ </filter>
47
+ </defs>
48
+ <polyline
49
+ stroke={mainColor}
50
+ filter={`url(#${filterId})`}
51
+ points={`
52
+ ${(width - (width / 2)) / 2}, 30
53
+ 20, 30 7, 50 7, ${50 + (height - 167) / 2}
54
+ 13, ${55 + (height - 167) / 2} 13, ${135 + (height - 167) / 2}
55
+ 7, ${140 + (height - 167) / 2} 7, ${height - 27}
56
+ 20, ${height - 7} ${width - 20}, ${height - 7} ${width - 7}, ${height - 27}
57
+ ${width - 7}, ${140 + (height - 167) / 2} ${width - 13}, ${135 + (height - 167) / 2}
58
+ ${width - 13}, ${55 + (height - 167) / 2} ${width - 7}, ${50 + (height - 167) / 2}
59
+ ${width - 7}, 50 ${width - 20}, 30 ${(width + (width / 2)) / 2}, 30
60
+ ${(width + (width / 2)) / 2 - 20}, 7 ${(width - (width / 2)) / 2 + 20}, 7
61
+ ${(width - (width / 2)) / 2}, 30 ${(width - (width / 2)) / 2 + 20}, 52
62
+ ${(width + (width / 2)) / 2 - 20}, 52 ${(width + (width / 2)) / 2}, 30
63
+ `}
64
+ />
65
+ <polygon
66
+ stroke={mainColor}
67
+ fill='none'
68
+ points={`
69
+ ${(width + (width / 2)) / 2 - 5}, 30 ${(width + (width / 2)) / 2 - 21}, 11
70
+ ${(width + (width / 2)) / 2 - 27}, 11 ${(width + (width / 2)) / 2 - 8}, 34
71
+ `}
72
+ />
73
+ <polygon
74
+ stroke={mainColor}
75
+ fill='none'
76
+ points={`
77
+ ${(width - (width / 2)) / 2 + 5}, 30 ${(width - (width / 2)) / 2 + 22}, 49
78
+ ${(width - (width / 2)) / 2 + 28}, 49 ${(width - (width / 2)) / 2 + 8}, 26
79
+ `}
80
+ />
81
+ <polygon
82
+ stroke={mainColor}
83
+ fill={subColor}
84
+ filter={`url(#${filterId})`}
85
+ points={`
86
+ ${(width + (width / 2)) / 2 - 11}, 37 ${(width + (width / 2)) / 2 - 32}, 11
87
+ ${(width - (width / 2)) / 2 + 23}, 11 ${(width - (width / 2)) / 2 + 11}, 23
88
+ ${(width - (width / 2)) / 2 + 33}, 49 ${(width + (width / 2)) / 2 - 22}, 49
89
+ `}
90
+ />
91
+
92
+ <polygon
93
+ filter={`url(#${filterId})`}
94
+ fill={mainColor}
95
+ opacity='1'
96
+ points={`
97
+ ${(width - (width / 2)) / 2 - 10}, 37 ${(width - (width / 2)) / 2 - 31}, 37
98
+ ${(width - (width / 2)) / 2 - 25}, 46 ${(width - (width / 2)) / 2 - 4}, 46
99
+ `}
100
+ >
101
+ <animate
102
+ attributeName='opacity'
103
+ values='1;0.7;1'
104
+ dur='2s'
105
+ begin='0s'
106
+ repeatCount='indefinite'
107
+ />
108
+ </polygon>
109
+ <polygon
110
+ filter={`url(#${filterId})`}
111
+ fill={mainColor}
112
+ opacity='0.7'
113
+ points={`
114
+ ${(width - (width / 2)) / 2 - 40}, 37 ${(width - (width / 2)) / 2 - 61}, 37
115
+ ${(width - (width / 2)) / 2 - 55}, 46 ${(width - (width / 2)) / 2 - 34}, 46
116
+ `}
117
+ >
118
+ <animate
119
+ attributeName='opacity'
120
+ values='0.7;0.4;0.7'
121
+ dur='2s'
122
+ begin='0s'
123
+ repeatCount='indefinite'
124
+ />
125
+ </polygon>
126
+
127
+ <polygon
128
+ filter={`url(#${filterId})`}
129
+ fill={mainColor}
130
+ opacity='0.5'
131
+ points={`
132
+ ${(width - (width / 2)) / 2 - 70}, 37 ${(width - (width / 2)) / 2 - 91}, 37
133
+ ${(width - (width / 2)) / 2 - 85}, 46 ${(width - (width / 2)) / 2 - 64}, 46
134
+ `}
135
+ >
136
+ <animate
137
+ attributeName='opacity'
138
+ values='0.5;0.2;0.5'
139
+ dur='2s'
140
+ begin='0s'
141
+ repeatCount='indefinite'
142
+ />
143
+ </polygon>
144
+
145
+ <polygon
146
+ filter={`url(#${filterId})`}
147
+ fill={mainColor}
148
+ opacity='1'
149
+ points={`
150
+ ${(width + (width / 2)) / 2 + 30}, 37 ${(width + (width / 2)) / 2 + 9}, 37
151
+ ${(width + (width / 2)) / 2 + 3}, 46 ${(width + (width / 2)) / 2 + 24}, 46
152
+ `}
153
+ >
154
+ <animate
155
+ attributeName='opacity'
156
+ values='1;0.7;1'
157
+ dur='2s'
158
+ begin='0s'
159
+ repeatCount='indefinite'
160
+ />
161
+ </polygon>
162
+
163
+ <polygon
164
+ filter={`url(#${filterId})`}
165
+ fill={mainColor}
166
+ opacity='0.7'
167
+ points={`
168
+ ${(width + (width / 2)) / 2 + 60}, 37 ${(width + (width / 2)) / 2 + 39}, 37
169
+ ${(width + (width / 2)) / 2 + 33}, 46 ${(width + (width / 2)) / 2 + 54}, 46
170
+ `}
171
+ >
172
+ <animate
173
+ attributeName='opacity'
174
+ values='0.7;0.4;0.7'
175
+ dur='2s'
176
+ begin='0s'
177
+ repeatCount='indefinite'
178
+ />
179
+ </polygon>
180
+
181
+ <polygon
182
+ filter={`url(#${filterId})`}
183
+ fill={mainColor}
184
+ opacity='0.5'
185
+ points={`
186
+ ${(width + (width / 2)) / 2 + 90}, 37 ${(width + (width / 2)) / 2 + 69}, 37
187
+ ${(width + (width / 2)) / 2 + 63}, 46 ${(width + (width / 2)) / 2 + 84}, 46
188
+ `}
189
+ >
190
+ <animate
191
+ attributeName='opacity'
192
+ values='0.5;0.2;0.5'
193
+ dur='2s'
194
+ begin='0s'
195
+ repeatCount='indefinite'
196
+ />
197
+ </polygon>
198
+
199
+ <text
200
+ className='border-box-11-title'
201
+ x={`${width / 2}`}
202
+ y='32'
203
+ fill={title?.color || "#fff"}
204
+ fontSize={title?.fontSize || 18}
205
+ textAnchor='middle'
206
+ dominantBaseline='middle'
207
+ >
208
+ {title?.text}
209
+ </text>
210
+
211
+ <polygon
212
+ fill={mainColor}
213
+ filter={`url(#${filterId})`}
214
+ points={`
215
+ 7, ${53 + (height - 167) / 2} 11, ${57 + (height - 167) / 2}
216
+ 11, ${133 + (height - 167) / 2} 7, ${137 + (height - 167) / 2}
217
+ `}
218
+ />
219
+
220
+ <polygon
221
+ fill={mainColor}
222
+ filter={`url(#${filterId})`}
223
+ points={`
224
+ ${width - 7}, ${53 + (height - 167) / 2} ${width - 11}, ${57 + (height - 167) / 2}
225
+ ${width - 11}, ${133 + (height - 167) / 2} ${width - 7}, ${137 + (height - 167) / 2}
226
+ `}
227
+ />
228
+ </svg>
229
+ </div>;
230
+ });
231
+
232
+ export default Index;
@@ -0,0 +1,14 @@
1
+ .border-box-12 {
2
+ position: relative;
3
+ width: 100%;
4
+ height: 100%;
5
+
6
+ .border-svg-container {
7
+ position: absolute;
8
+ width: 100%;
9
+ height: 100%;
10
+ top: 0px;
11
+ left: 0px;
12
+ }
13
+
14
+ }
@@ -0,0 +1,115 @@
1
+ import React, { ForwardedRef, forwardRef, useImperativeHandle, useState } from "react";
2
+ import "./index.less";
3
+
4
+ interface ComponentStyle {
5
+ mainColor?: string;
6
+ subColor?: string;
7
+ }
8
+
9
+ export interface ComponentProps {
10
+ style?: ComponentStyle;
11
+ base?: { width?: number, height?: number, id: string }
12
+ }
13
+
14
+ export interface ComponentRef {
15
+ updateConfig: (config: ComponentProps) => void;
16
+ }
17
+ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>) => {
18
+ const [style, setStyle] = useState<ComponentStyle>({ ...props.style });
19
+ const [width, setWidth] = useState<number>(320);
20
+ const [height, setHeight] = useState<number>(200);
21
+ const { mainColor = "#83BFF6", subColor = "#00CED1" } = style || {};
22
+ const filterId = `border-box-12${props.base.id}`;
23
+
24
+ useImperativeHandle(ref, () => ({
25
+ updateConfig: (newConfig) => {
26
+ const { width, height } = newConfig.base;
27
+ setStyle({ ...newConfig.style });
28
+ setWidth(width);
29
+ setHeight(height);
30
+ },
31
+ }));
32
+
33
+ return <div className="border-box-12" >
34
+ <svg className='dv-border-svg-container' width={width} height={height}>
35
+ <defs>
36
+ <filter id={filterId} height='150%' width='150%' x='-25%' y='-25%'>
37
+ <feMorphology operator='dilate' radius='1' in='SourceAlpha' result='thicken' />
38
+ <feGaussianBlur in='thicken' stdDeviation='2' result='blurred' />
39
+ <feFlood floodColor={mainColor} result='glowColor'>
40
+ <animate
41
+ attributeName='flood-color'
42
+ values={`${mainColor};${subColor};${mainColor};`}
43
+ dur='3s'
44
+ begin='0s'
45
+ repeatCount='indefinite'
46
+ />
47
+ </feFlood>
48
+ <feComposite in='glowColor' in2='blurred' operator='in' result='softGlowColored' />
49
+ <feMerge>
50
+ <feMergeNode in='softGlowColored' />
51
+ <feMergeNode in='SourceGraphic' />
52
+ </feMerge>
53
+ </filter>
54
+ </defs>
55
+
56
+ <path
57
+ fill="none"
58
+ strokeWidth='2'
59
+ stroke={mainColor}
60
+ d={`
61
+ M15 5 L ${width - 15} 5 Q ${width - 5} 5, ${width - 5} 15
62
+ L ${width - 5} ${height - 15} Q ${width - 5} ${height - 5}, ${width - 15} ${height - 5}
63
+ L 15, ${height - 5} Q 5 ${height - 5} 5 ${height - 15} L 5 15
64
+ Q 5 5 15 5
65
+ `}
66
+ />
67
+
68
+ <path
69
+ strokeWidth='2'
70
+ fill='transparent'
71
+ strokeLinecap='round'
72
+ filter={`url(#${filterId})`}
73
+ stroke={subColor}
74
+ d={`M 20 5 L 15 5 Q 5 5 5 15 L 5 20`}
75
+ />
76
+
77
+ <path
78
+ strokeWidth='2'
79
+ fill='transparent'
80
+ strokeLinecap='round'
81
+ filter={`url(#${filterId})`}
82
+ stroke={subColor}
83
+ d={`M ${width - 20} 5 L ${width - 15} 5 Q ${width - 5} 5 ${width - 5} 15 L ${width - 5} 20`}
84
+ />
85
+
86
+ <path
87
+ strokeWidth='2'
88
+ fill='transparent'
89
+ strokeLinecap='round'
90
+ filter={`url(#${filterId})`}
91
+ stroke={subColor}
92
+ d={`
93
+ M ${width - 20} ${height - 5} L ${width - 15} ${height - 5}
94
+ Q ${width - 5} ${height - 5} ${width - 5} ${height - 15}
95
+ L ${width - 5} ${height - 20}
96
+ `}
97
+ />
98
+
99
+ <path
100
+ strokeWidth='2'
101
+ fill='transparent'
102
+ strokeLinecap='round'
103
+ filter={`url(#${filterId})`}
104
+ stroke={subColor}
105
+ d={`
106
+ M 20 ${height - 5} L 15 ${height - 5}
107
+ Q 5 ${height - 5} 5 ${height - 15}
108
+ L 5 ${height - 20}
109
+ `}
110
+ />
111
+ </svg>
112
+ </div>;
113
+ });
114
+
115
+ export default Index;
@@ -0,0 +1,14 @@
1
+ .border-box-13 {
2
+ position: relative;
3
+ width: 100%;
4
+ height: 100%;
5
+
6
+ .border-svg-container {
7
+ position: absolute;
8
+ width: 100%;
9
+ height: 100%;
10
+ top: 0px;
11
+ left: 0px;
12
+ }
13
+
14
+ }