aldehyde 0.2.283 → 0.2.285
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.
- package/lib/controls/entity-select/entity-select.d.ts +2 -2
- package/lib/controls/entity-select/entity-select.d.ts.map +1 -1
- package/lib/controls/entity-select/entity-select.js +14 -12
- package/lib/controls/entity-select/entity-select.js.map +1 -1
- package/lib/controls/entry-control.d.ts.map +1 -1
- package/lib/controls/entry-control.js +4 -0
- package/lib/controls/entry-control.js.map +1 -1
- package/lib/controls/select/index.d.ts.map +1 -1
- package/lib/controls/select/index.js +1 -0
- package/lib/controls/select/index.js.map +1 -1
- package/lib/controls/view-control.d.ts.map +1 -1
- package/lib/controls/view-control.js +1 -0
- package/lib/controls/view-control.js.map +1 -1
- package/lib/detail/view/act-dtmpl-view.d.ts.map +1 -1
- package/lib/detail/view/act-dtmpl-view.js +3 -2
- package/lib/detail/view/act-dtmpl-view.js.map +1 -1
- package/lib/detail/view/dtmpl-view.js +1 -1
- package/lib/detail/view/dtmpl-view.js.map +1 -1
- package/lib/form/form-Item-group.d.ts.map +1 -1
- package/lib/form/form-Item-group.js +0 -1
- package/lib/form/form-Item-group.js.map +1 -1
- package/lib/lowcode-components/bar-chart/index.d.ts +10 -6
- package/lib/lowcode-components/bar-chart/index.d.ts.map +1 -1
- package/lib/lowcode-components/bar-chart/index.js +91 -11
- package/lib/lowcode-components/bar-chart/index.js.map +1 -1
- package/lib/lowcode-components/base-map/index.d.ts +10 -6
- package/lib/lowcode-components/base-map/index.d.ts.map +1 -1
- package/lib/lowcode-components/base-map/index.js +86 -7
- package/lib/lowcode-components/base-map/index.js.map +1 -1
- package/lib/lowcode-components/base-table/index.d.ts +53 -0
- package/lib/lowcode-components/base-table/index.d.ts.map +1 -0
- package/lib/lowcode-components/base-table/index.js +158 -0
- package/lib/lowcode-components/base-table/index.js.map +1 -0
- package/lib/lowcode-components/base-table/index.less +59 -0
- package/lib/lowcode-components/capsule-bar-chart/index.d.ts +43 -0
- package/lib/lowcode-components/capsule-bar-chart/index.d.ts.map +1 -0
- package/lib/lowcode-components/capsule-bar-chart/index.js +179 -0
- package/lib/lowcode-components/capsule-bar-chart/index.js.map +1 -0
- package/lib/lowcode-components/circular-progress-chart/index.d.ts +26 -0
- package/lib/lowcode-components/circular-progress-chart/index.d.ts.map +1 -0
- package/lib/lowcode-components/circular-progress-chart/index.js +179 -0
- package/lib/lowcode-components/circular-progress-chart/index.js.map +1 -0
- package/lib/lowcode-components/column-chart/index.d.ts +11 -6
- package/lib/lowcode-components/column-chart/index.d.ts.map +1 -1
- package/lib/lowcode-components/column-chart/index.js +115 -16
- package/lib/lowcode-components/column-chart/index.js.map +1 -1
- package/lib/lowcode-components/data-number/index.d.ts +10 -0
- package/lib/lowcode-components/data-number/index.d.ts.map +1 -1
- package/lib/lowcode-components/data-number/index.js +80 -6
- package/lib/lowcode-components/data-number/index.js.map +1 -1
- package/lib/lowcode-components/decoration/decoration1/index.d.ts +19 -0
- package/lib/lowcode-components/decoration/decoration1/index.d.ts.map +1 -0
- package/lib/lowcode-components/decoration/decoration1/index.js +58 -0
- package/lib/lowcode-components/decoration/decoration1/index.js.map +1 -0
- package/lib/lowcode-components/decoration/decoration1/index.less +8 -0
- package/lib/lowcode-components/decoration/decoration10/index.d.ts +20 -0
- package/lib/lowcode-components/decoration/decoration10/index.d.ts.map +1 -0
- package/lib/lowcode-components/decoration/decoration10/index.js +29 -0
- package/lib/lowcode-components/decoration/decoration10/index.js.map +1 -0
- package/lib/lowcode-components/decoration/decoration10/index.less +6 -0
- package/lib/lowcode-components/decoration/decoration11/index.d.ts +20 -0
- package/lib/lowcode-components/decoration/decoration11/index.d.ts.map +1 -0
- package/lib/lowcode-components/decoration/decoration11/index.js +81 -0
- package/lib/lowcode-components/decoration/decoration11/index.js.map +1 -0
- package/lib/lowcode-components/decoration/decoration11/index.less +6 -0
- package/lib/lowcode-components/decoration/decoration2/index.d.ts +19 -0
- package/lib/lowcode-components/decoration/decoration2/index.d.ts.map +1 -0
- package/lib/lowcode-components/decoration/decoration2/index.js +23 -0
- package/lib/lowcode-components/decoration/decoration2/index.js.map +1 -0
- package/lib/lowcode-components/decoration/decoration2/index.less +7 -0
- package/lib/lowcode-components/decoration/decoration3/index.d.ts +19 -0
- package/lib/lowcode-components/decoration/decoration3/index.d.ts.map +1 -0
- package/lib/lowcode-components/decoration/decoration3/index.js +39 -0
- package/lib/lowcode-components/decoration/decoration3/index.js.map +1 -0
- package/lib/lowcode-components/decoration/decoration3/index.less +8 -0
- package/lib/lowcode-components/decoration/decoration4/index.d.ts +19 -0
- package/lib/lowcode-components/decoration/decoration4/index.d.ts.map +1 -0
- package/lib/lowcode-components/decoration/decoration4/index.js +20 -0
- package/lib/lowcode-components/decoration/decoration4/index.js.map +1 -0
- package/lib/lowcode-components/decoration/decoration4/index.less +30 -0
- package/lib/lowcode-components/decoration/decoration5/index.d.ts +19 -0
- package/lib/lowcode-components/decoration/decoration5/index.d.ts.map +1 -0
- package/lib/lowcode-components/decoration/decoration5/index.js +56 -0
- package/lib/lowcode-components/decoration/decoration5/index.js.map +1 -0
- package/lib/lowcode-components/decoration/decoration5/index.less +4 -0
- package/lib/lowcode-components/decoration/decoration6/index.d.ts +19 -0
- package/lib/lowcode-components/decoration/decoration6/index.d.ts.map +1 -0
- package/lib/lowcode-components/decoration/decoration6/index.js +55 -0
- package/lib/lowcode-components/decoration/decoration6/index.js.map +1 -0
- package/lib/lowcode-components/decoration/decoration6/index.less +8 -0
- package/lib/lowcode-components/decoration/decoration7/index.d.ts +20 -0
- package/lib/lowcode-components/decoration/decoration7/index.d.ts.map +1 -0
- package/lib/lowcode-components/decoration/decoration7/index.js +28 -0
- package/lib/lowcode-components/decoration/decoration7/index.js.map +1 -0
- package/lib/lowcode-components/decoration/decoration7/index.less +5 -0
- package/lib/lowcode-components/decoration/decoration8/index.d.ts +20 -0
- package/lib/lowcode-components/decoration/decoration8/index.d.ts.map +1 -0
- package/lib/lowcode-components/decoration/decoration8/index.js +31 -0
- package/lib/lowcode-components/decoration/decoration8/index.js.map +1 -0
- package/lib/lowcode-components/decoration/decoration8/index.less +15 -0
- package/lib/lowcode-components/decoration/decoration9/index.d.ts +20 -0
- package/lib/lowcode-components/decoration/decoration9/index.d.ts.map +1 -0
- package/lib/lowcode-components/decoration/decoration9/index.js +52 -0
- package/lib/lowcode-components/decoration/decoration9/index.js.map +1 -0
- package/lib/lowcode-components/decoration/decoration9/index.less +5 -0
- package/lib/lowcode-components/effectScatter-map/index.d.ts +10 -6
- package/lib/lowcode-components/effectScatter-map/index.d.ts.map +1 -1
- package/lib/lowcode-components/effectScatter-map/index.js +87 -9
- package/lib/lowcode-components/effectScatter-map/index.js.map +1 -1
- package/lib/lowcode-components/gauge-chart/index.d.ts +10 -6
- package/lib/lowcode-components/gauge-chart/index.d.ts.map +1 -1
- package/lib/lowcode-components/gauge-chart/index.js +65 -8
- package/lib/lowcode-components/gauge-chart/index.js.map +1 -1
- package/lib/lowcode-components/index.d.ts +30 -0
- package/lib/lowcode-components/index.d.ts.map +1 -1
- package/lib/lowcode-components/index.js +25 -28
- package/lib/lowcode-components/index.js.map +1 -1
- package/lib/lowcode-components/line-chart/index.d.ts +10 -6
- package/lib/lowcode-components/line-chart/index.d.ts.map +1 -1
- package/lib/lowcode-components/line-chart/index.js +91 -11
- package/lib/lowcode-components/line-chart/index.js.map +1 -1
- package/lib/lowcode-components/liquid-chart/index.d.ts +10 -6
- package/lib/lowcode-components/liquid-chart/index.d.ts.map +1 -1
- package/lib/lowcode-components/liquid-chart/index.js +64 -7
- package/lib/lowcode-components/liquid-chart/index.js.map +1 -1
- package/lib/lowcode-components/lowcode-view/component/assets.d.ts.map +1 -1
- package/lib/lowcode-components/lowcode-view/component/assets.js +134 -0
- package/lib/lowcode-components/lowcode-view/component/assets.js.map +1 -1
- package/lib/lowcode-components/lowcode-view/component/component-container.d.ts.map +1 -1
- package/lib/lowcode-components/lowcode-view/component/component-container.js +30 -29
- package/lib/lowcode-components/lowcode-view/component/component-container.js.map +1 -1
- package/lib/lowcode-components/pie-chart/index.d.ts +11 -6
- package/lib/lowcode-components/pie-chart/index.d.ts.map +1 -1
- package/lib/lowcode-components/pie-chart/index.js +102 -15
- package/lib/lowcode-components/pie-chart/index.js.map +1 -1
- package/lib/lowcode-components/text-scroller/index.d.ts +23 -0
- package/lib/lowcode-components/text-scroller/index.d.ts.map +1 -0
- package/lib/lowcode-components/text-scroller/index.js +96 -0
- package/lib/lowcode-components/text-scroller/index.js.map +1 -0
- package/lib/lowcode-components/text-scroller/index.less +29 -0
- package/lib/table/act-table.d.ts.map +1 -1
- package/lib/table/act-table.js.map +1 -1
- package/lib/table/query-table.js +5 -5
- package/lib/table/query-table.js.map +1 -1
- package/lib/table/relation-table.d.ts.map +1 -1
- package/lib/table/relation-table.js +0 -2
- package/lib/table/relation-table.js.map +1 -1
- package/lib/tmpl/control-type-supportor.d.ts.map +1 -1
- package/lib/tmpl/control-type-supportor.js +1 -0
- package/lib/tmpl/control-type-supportor.js.map +1 -1
- package/package.json +1 -1
- package/src/aldehyde/controls/entity-select/entity-select.tsx +15 -15
- package/src/aldehyde/controls/entry-control.tsx +12 -0
- package/src/aldehyde/controls/select/index.tsx +1 -0
- package/src/aldehyde/controls/view-control.tsx +1 -0
- package/src/aldehyde/detail/view/act-dtmpl-view.tsx +22 -23
- package/src/aldehyde/detail/view/dtmpl-view.tsx +1 -1
- package/src/aldehyde/form/form-Item-group.tsx +0 -1
- package/src/aldehyde/lowcode-components/bar-chart/index.tsx +100 -19
- package/src/aldehyde/lowcode-components/base-map/index.tsx +94 -15
- package/src/aldehyde/lowcode-components/base-table/index.less +59 -0
- package/src/aldehyde/lowcode-components/base-table/index.tsx +233 -0
- package/src/aldehyde/lowcode-components/capsule-bar-chart/index.tsx +219 -0
- package/src/aldehyde/lowcode-components/circular-progress-chart/index.tsx +201 -0
- package/src/aldehyde/lowcode-components/column-chart/index.tsx +128 -24
- package/src/aldehyde/lowcode-components/data-number/index.tsx +89 -7
- package/src/aldehyde/lowcode-components/data.d.ts +6 -0
- package/src/aldehyde/lowcode-components/decoration/decoration1/index.less +8 -0
- package/src/aldehyde/lowcode-components/decoration/decoration1/index.tsx +153 -0
- package/src/aldehyde/lowcode-components/decoration/decoration10/index.less +6 -0
- package/src/aldehyde/lowcode-components/decoration/decoration10/index.tsx +89 -0
- package/src/aldehyde/lowcode-components/decoration/decoration11/index.less +6 -0
- package/src/aldehyde/lowcode-components/decoration/decoration11/index.tsx +133 -0
- package/src/aldehyde/lowcode-components/decoration/decoration2/index.less +7 -0
- package/src/aldehyde/lowcode-components/decoration/decoration2/index.tsx +61 -0
- package/src/aldehyde/lowcode-components/decoration/decoration3/index.less +8 -0
- package/src/aldehyde/lowcode-components/decoration/decoration3/index.tsx +87 -0
- package/src/aldehyde/lowcode-components/decoration/decoration4/index.less +30 -0
- package/src/aldehyde/lowcode-components/decoration/decoration4/index.tsx +53 -0
- package/src/aldehyde/lowcode-components/decoration/decoration5/index.less +4 -0
- package/src/aldehyde/lowcode-components/decoration/decoration5/index.tsx +116 -0
- package/src/aldehyde/lowcode-components/decoration/decoration6/index.less +8 -0
- package/src/aldehyde/lowcode-components/decoration/decoration6/index.tsx +121 -0
- package/src/aldehyde/lowcode-components/decoration/decoration7/index.less +5 -0
- package/src/aldehyde/lowcode-components/decoration/decoration7/index.tsx +70 -0
- package/src/aldehyde/lowcode-components/decoration/decoration8/index.less +15 -0
- package/src/aldehyde/lowcode-components/decoration/decoration8/index.tsx +122 -0
- package/src/aldehyde/lowcode-components/decoration/decoration9/index.less +5 -0
- package/src/aldehyde/lowcode-components/decoration/decoration9/index.tsx +196 -0
- package/src/aldehyde/lowcode-components/effectScatter-map/index.tsx +93 -19
- package/src/aldehyde/lowcode-components/gauge-chart/index.tsx +73 -16
- package/src/aldehyde/lowcode-components/index.ts +40 -29
- package/src/aldehyde/lowcode-components/line-chart/index.tsx +105 -22
- package/src/aldehyde/lowcode-components/liquid-chart/index.tsx +70 -15
- package/src/aldehyde/lowcode-components/lowcode-view/component/assets.ts +134 -0
- package/src/aldehyde/lowcode-components/lowcode-view/component/component-container.tsx +29 -28
- package/src/aldehyde/lowcode-components/pie-chart/index.tsx +111 -25
- package/src/aldehyde/lowcode-components/text-scroller/index.less +29 -0
- package/src/aldehyde/lowcode-components/text-scroller/index.tsx +122 -0
- package/src/aldehyde/table/act-table.tsx +0 -1
- package/src/aldehyde/table/query-table.tsx +5 -5
- package/src/aldehyde/table/relation-table.tsx +0 -2
- package/src/aldehyde/tmpl/control-type-supportor.tsx +1 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import React, { forwardRef, useImperativeHandle, useState, useMemo } from "react";
|
|
2
|
+
import "./index.less";
|
|
3
|
+
const segment = 30;
|
|
4
|
+
const sectorAngle = Math.PI / 3;
|
|
5
|
+
const ringNum = 3;
|
|
6
|
+
const ringWidth = 1;
|
|
7
|
+
const getCircleRadianPoint = (x, y, radius, radian) => [x + Math.cos(radian) * radius, y + Math.sin(radian) * radius];
|
|
8
|
+
const Index = forwardRef((props, ref) => {
|
|
9
|
+
const gId = `decoration-11-g-${props.base.id}`;
|
|
10
|
+
const gradientId = `decoration-11-gradient-${props.base.id}`;
|
|
11
|
+
const [style, setStyle] = useState(Object.assign({}, props.style));
|
|
12
|
+
const [width, setWidth] = useState(200);
|
|
13
|
+
const [height, setHeight] = useState(200);
|
|
14
|
+
const { mainColor = "#83BFF6", subColor = "#00CED1" } = style || {};
|
|
15
|
+
useImperativeHandle(ref, () => ({
|
|
16
|
+
updateConfig: (newConfig) => {
|
|
17
|
+
setStyle(Object.assign({}, newConfig.style));
|
|
18
|
+
setWidth(newConfig.base.width);
|
|
19
|
+
setHeight(newConfig.base.height);
|
|
20
|
+
},
|
|
21
|
+
}));
|
|
22
|
+
const { x, y } = useMemo(() => ({ x: width / 2, y: height / 2 }), [width, height]);
|
|
23
|
+
const pathD = useMemo(() => {
|
|
24
|
+
const startAngle = -Math.PI / 2;
|
|
25
|
+
const angleGap = sectorAngle / segment;
|
|
26
|
+
const r = width / 4;
|
|
27
|
+
let lastEndPoints = getCircleRadianPoint(x, y, r, startAngle);
|
|
28
|
+
return new Array(segment)
|
|
29
|
+
.fill('')
|
|
30
|
+
.map((_, i) => {
|
|
31
|
+
const endPoints = getCircleRadianPoint(x, y, r, startAngle - (i + 1) * angleGap).map(_ => _.toFixed(5));
|
|
32
|
+
const d = `M${lastEndPoints.join(',')} A${r}, ${r} 0 0 0 ${endPoints.join(',')}`;
|
|
33
|
+
lastEndPoints = endPoints;
|
|
34
|
+
return d;
|
|
35
|
+
});
|
|
36
|
+
}, [x, y]);
|
|
37
|
+
const circleR = useMemo(() => {
|
|
38
|
+
const radiusGap = (width / 2 - ringWidth / 2) / ringNum;
|
|
39
|
+
return new Array(ringNum).fill(0).map((_, i) => radiusGap * (i + 1));
|
|
40
|
+
}, [width]);
|
|
41
|
+
const splitLinePoints = useMemo(() => {
|
|
42
|
+
const angleGap = Math.PI / 6;
|
|
43
|
+
const r = width / 2;
|
|
44
|
+
return new Array(6).fill('').map((_, i) => {
|
|
45
|
+
const startAngle = angleGap * (i + 1);
|
|
46
|
+
const endAngle = startAngle + Math.PI;
|
|
47
|
+
const startPoint = getCircleRadianPoint(x, y, r, startAngle);
|
|
48
|
+
const endPoint = getCircleRadianPoint(x, y, r, endAngle);
|
|
49
|
+
return `${startPoint.join(',')} ${endPoint.join(',')}`;
|
|
50
|
+
});
|
|
51
|
+
}, [x, y]);
|
|
52
|
+
const arcD = useMemo(() => {
|
|
53
|
+
const angleGap = Math.PI / 6;
|
|
54
|
+
const r = width / 2 - 1;
|
|
55
|
+
return new Array(4).fill('').map((_, i) => {
|
|
56
|
+
const startAngle = angleGap * (3 * i + 1);
|
|
57
|
+
const endAngle = startAngle + angleGap;
|
|
58
|
+
const startPoint = getCircleRadianPoint(x, y, r, startAngle);
|
|
59
|
+
const endPoint = getCircleRadianPoint(x, y, r, endAngle);
|
|
60
|
+
return `M${startPoint.join(',')} A${x}, ${y} 0 0 1 ${endPoint.join(',')}`;
|
|
61
|
+
});
|
|
62
|
+
}, [x, y]);
|
|
63
|
+
return React.createElement("div", { className: "decoration-11" },
|
|
64
|
+
React.createElement("svg", { width: width, height: height },
|
|
65
|
+
React.createElement("defs", null,
|
|
66
|
+
React.createElement("g", { id: gId }, pathD.map((d, i) => React.createElement("path", { stroke: mainColor, strokeOpacity: (100 - i * 100 / (segment - 1)) / 100, strokeWidth: width / 2, fill: 'transparent', key: d, d: d }))),
|
|
67
|
+
React.createElement("radialGradient", { id: gradientId, cx: '50%', cy: '50%', r: '50%' },
|
|
68
|
+
React.createElement("stop", { offset: '0%', stopColor: 'transparent', stopOpacity: '1' }),
|
|
69
|
+
React.createElement("stop", { offset: '100%', stopColor: subColor, stopOpacity: 0.3 }))),
|
|
70
|
+
circleR.map(r => React.createElement("circle", { key: r, r: r, cx: x, cy: y, stroke: subColor, strokeWidth: 0.5, fill: 'transparent' })),
|
|
71
|
+
React.createElement("circle", { r: '1', cx: x, cy: y, stroke: 'transparent', fill: `url(#${gradientId})` },
|
|
72
|
+
React.createElement("animate", { attributeName: 'r', values: `1;${width / 2}`, dur: "2s", repeatCount: 'indefinite' }),
|
|
73
|
+
React.createElement("animate", { attributeName: 'opacity', values: '1;0', dur: "2s", repeatCount: 'indefinite' })),
|
|
74
|
+
React.createElement("circle", { r: '2', cx: x, cy: y, fill: subColor }),
|
|
75
|
+
splitLinePoints.map(p => React.createElement("polyline", { key: p, points: p, stroke: subColor, strokeWidth: 0.5, opacity: '0.5' })),
|
|
76
|
+
arcD.map(d => React.createElement("path", { key: d, d: d, stroke: subColor, strokeWidth: '2', fill: 'transparent' })),
|
|
77
|
+
React.createElement("use", { href: `#${gId}` },
|
|
78
|
+
React.createElement("animateTransform", { attributeName: 'transform', type: 'rotate', values: `0, ${x} ${y};360, ${x} ${y}`, dur: "3s", repeatCount: 'indefinite' }))));
|
|
79
|
+
});
|
|
80
|
+
export default Index;
|
|
81
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/aldehyde/lowcode-components/decoration/decoration11/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAgB,UAAU,EAAE,mBAAmB,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChG,OAAO,cAAc,CAAC;AAEtB,MAAM,OAAO,GAAG,EAAE,CAAC;AACnB,MAAM,WAAW,GAAG,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;AAChC,MAAM,OAAO,GAAG,CAAC,CAAC;AAClB,MAAM,SAAS,GAAG,CAAC,CAAC;AAEpB,MAAM,oBAAoB,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,MAAM,EAAE,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC;AAetH,MAAM,KAAK,GAAG,UAAU,CAAC,CAAC,KAAqB,EAAE,GAA+B,EAAE,EAAE;IAChF,MAAM,GAAG,GAAG,mBAAmB,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;IAC/C,MAAM,UAAU,GAAG,0BAA0B,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;IAC7D,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,mBAAsB,KAAK,CAAC,KAAK,EAAG,CAAC;IACvE,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAS,GAAG,CAAC,CAAC;IAChD,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAS,GAAG,CAAC,CAAC;IAClD,MAAM,EAAE,SAAS,GAAG,SAAS,EAAE,QAAQ,GAAG,SAAS,EAAE,GA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AAG,EAAC,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,GAAI;YAC7C,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,kCACtB,GAAG,EAAE,CAAC,EACN,MAAM,EAAE,CAAC,EACT,MAAM,EAAE,QAAQ,EAChB,WAAW,EAAE,GAAG,EAChB,OAAO,EAAC,KAAK,GACf,CAAC;YACF,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,8BACX,GAAG,EAAE,CAAC,EACN,CAAC,EAAE,CAAC,EACJ,MAAM,EAAE,QAAQ,EAChB,WAAW,EAAC,GAAG,EACf,IAAI,EAAC,aAAa,GACpB,CAAC;YACH,6BAAK,IAAI,EAAE,IAAI,GAAG,EAAE;gBAChB,0CACI,aAAa,EAAC,WAAW,EACzB,IAAI,EAAC,QAAQ,EACb,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,EACrC,GAAG,EAAC,IAAI,EACR,WAAW,EAAC,YAAY,GAC1B,CACA,CACJ,CACJ,CAAC;AACX,CAAC,CAAC,CAAC;AAEH,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./index.less";
|
|
3
|
+
interface ComponentStyle {
|
|
4
|
+
mainColor?: string;
|
|
5
|
+
subColor?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface ComponentProps {
|
|
8
|
+
style?: ComponentStyle;
|
|
9
|
+
base?: {
|
|
10
|
+
width?: number;
|
|
11
|
+
height?: number;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export interface ComponentRef {
|
|
15
|
+
updateConfig: (config: ComponentProps) => void;
|
|
16
|
+
}
|
|
17
|
+
declare const Index: React.ForwardRefExoticComponent<ComponentProps & React.RefAttributes<ComponentRef>>;
|
|
18
|
+
export default Index;
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/aldehyde/lowcode-components/decoration/decoration2/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmE,MAAM,OAAO,CAAC;AACxF,OAAO,cAAc,CAAC;AAEtB,UAAU,cAAc;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,cAAc;IAC3B,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,IAAI,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAC7C;AAED,MAAM,WAAW,YAAY;IACzB,YAAY,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,CAAC;CAClD;AACD,QAAA,MAAM,KAAK,qFA0CT,CAAC;AAEH,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React, { forwardRef, useImperativeHandle, useState, } from "react";
|
|
2
|
+
import "./index.less";
|
|
3
|
+
const Index = forwardRef((props, ref) => {
|
|
4
|
+
const [style, setStyle] = useState(Object.assign({}, props.style));
|
|
5
|
+
const [width, setWidth] = useState(300);
|
|
6
|
+
const [height, setHeight] = useState(100);
|
|
7
|
+
const { mainColor = "#83BFF6", subColor = "#00CED1" } = style || {};
|
|
8
|
+
useImperativeHandle(ref, () => ({
|
|
9
|
+
updateConfig: (newConfig) => {
|
|
10
|
+
setStyle(Object.assign({}, newConfig.style));
|
|
11
|
+
setWidth(newConfig.base.width);
|
|
12
|
+
setHeight(newConfig.base.height);
|
|
13
|
+
},
|
|
14
|
+
}));
|
|
15
|
+
return React.createElement("div", { className: "decoration-2" },
|
|
16
|
+
React.createElement("svg", { width: `${width}px`, height: `${height}px` },
|
|
17
|
+
React.createElement("rect", { x: 0, y: height / 2, width: width, height: 1, fill: mainColor },
|
|
18
|
+
React.createElement("animate", { attributeName: "width", from: '0', to: width, dur: "3s", calcMode: 'spline', keyTimes: '0;1', keySplines: '.42,0,.58,1', repeatCount: 'indefinite' })),
|
|
19
|
+
React.createElement("rect", { x: 0, y: height / 2, width: '1', height: '1', fill: subColor },
|
|
20
|
+
React.createElement("animate", { attributeName: 'x', from: '0', to: width, dur: "3s", calcMode: 'spline', keyTimes: '0;1', keySplines: '0.42,0,0.58,1', repeatCount: 'indefinite' }))));
|
|
21
|
+
});
|
|
22
|
+
export default Index;
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/aldehyde/lowcode-components/decoration/decoration2/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAgB,UAAU,EAAE,mBAAmB,EAAE,QAAQ,GAAG,MAAM,OAAO,CAAC;AACxF,OAAO,cAAc,CAAC;AAetB,MAAM,KAAK,GAAG,UAAU,CAAC,CAAC,KAAqB,EAAE,GAA+B,EAAE,EAAE;IAChF,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,mBAAsB,KAAK,CAAC,KAAK,EAAG,CAAC;IACvE,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAS,GAAG,CAAC,CAAC;IAChD,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAS,GAAG,CAAC,CAAC;IAClD,MAAM,EAAE,SAAS,GAAG,SAAS,EAAE,QAAQ,GAAG,SAAS,EAAE,GAAG,KAAK,IAAI,EAAE,CAAC;IAEpE,mBAAmB,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;QAC5B,YAAY,EAAE,CAAC,SAAS,EAAE,EAAE;YACxB,QAAQ,mBAAM,SAAS,CAAC,KAAK,EAAG,CAAC;YACjC,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAC/B,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACrC,CAAC;KACJ,CAAC,CAAC,CAAC;IAEJ,OAAO,6BAAK,SAAS,EAAC,cAAc;QAChC,6BAAK,KAAK,EAAE,GAAG,KAAK,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,IAAI;YAC3C,8BAAM,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS;gBAC/D,iCACI,aAAa,EAAE,OAAO,EACtB,IAAI,EAAC,GAAG,EACR,EAAE,EAAE,KAAK,EACT,GAAG,EAAE,IAAI,EACT,QAAQ,EAAC,QAAQ,EACjB,QAAQ,EAAC,KAAK,EACd,UAAU,EAAC,aAAa,EACxB,WAAW,EAAC,YAAY,GAC1B,CACC;YACP,8BAAM,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,CAAC,EAAE,KAAK,EAAC,GAAG,EAAC,MAAM,EAAC,GAAG,EAAC,IAAI,EAAE,QAAQ;gBAC1D,iCACI,aAAa,EAAE,GAAG,EAClB,IAAI,EAAC,GAAG,EACR,EAAE,EAAE,KAAK,EACT,GAAG,EAAC,IAAI,EACR,QAAQ,EAAC,QAAQ,EACjB,QAAQ,EAAC,KAAK,EACd,UAAU,EAAC,eAAe,EAC1B,WAAW,EAAC,YAAY,GAC1B,CACC,CACL,CACJ,CAAC;AACX,CAAC,CAAC,CAAC;AAEH,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./index.less";
|
|
3
|
+
interface ComponentStyle {
|
|
4
|
+
mainColor?: string;
|
|
5
|
+
subColor?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface ComponentProps {
|
|
8
|
+
style?: ComponentStyle;
|
|
9
|
+
base?: {
|
|
10
|
+
width?: number;
|
|
11
|
+
height?: number;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export interface ComponentRef {
|
|
15
|
+
updateConfig: (config: ComponentProps) => void;
|
|
16
|
+
}
|
|
17
|
+
declare const Index: React.ForwardRefExoticComponent<ComponentProps & React.RefAttributes<ComponentRef>>;
|
|
18
|
+
export default Index;
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/aldehyde/lowcode-components/decoration/decoration3/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2E,MAAM,OAAO,CAAC;AAChG,OAAO,cAAc,CAAC;AAsBtB,UAAU,cAAc;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,cAAc;IAC3B,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,IAAI,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAC7C;AAED,MAAM,WAAW,YAAY;IACzB,YAAY,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,CAAC;CAClD;AACD,QAAA,MAAM,KAAK,qFAgDT,CAAC;AAEH,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React, { forwardRef, useImperativeHandle, useState, useMemo } from "react";
|
|
2
|
+
import "./index.less";
|
|
3
|
+
const pointSideLength = 7;
|
|
4
|
+
const svgWH = [300, 35];
|
|
5
|
+
const rowNum = 2;
|
|
6
|
+
const rowPoints = 25;
|
|
7
|
+
const halfPointSideLength = pointSideLength / 2;
|
|
8
|
+
const getPoints = () => {
|
|
9
|
+
const [w, h] = svgWH;
|
|
10
|
+
const horizontalGap = w / (rowPoints + 1);
|
|
11
|
+
const verticalGap = h / (rowNum + 1);
|
|
12
|
+
let points = new Array(rowNum)
|
|
13
|
+
.fill(0)
|
|
14
|
+
.map((_, i) => new Array(rowPoints)
|
|
15
|
+
.fill(0)
|
|
16
|
+
.map((_, j) => [horizontalGap * (j + 1), verticalGap * (i + 1)]));
|
|
17
|
+
return points.reduce((all, item) => [...all, ...item], []);
|
|
18
|
+
};
|
|
19
|
+
const Index = forwardRef((props, ref) => {
|
|
20
|
+
const [style, setStyle] = useState(Object.assign({}, props.style));
|
|
21
|
+
const [width, setWidth] = useState(300);
|
|
22
|
+
const [height, setHeight] = useState(100);
|
|
23
|
+
const { mainColor = "#83BFF6", subColor = "#00CED1" } = style || {};
|
|
24
|
+
useImperativeHandle(ref, () => ({
|
|
25
|
+
updateConfig: (newConfig) => {
|
|
26
|
+
setStyle(Object.assign({}, newConfig.style));
|
|
27
|
+
setWidth(newConfig.base.width);
|
|
28
|
+
setHeight(newConfig.base.height);
|
|
29
|
+
},
|
|
30
|
+
}));
|
|
31
|
+
const { svgScale, points } = useMemo(() => ({
|
|
32
|
+
points: getPoints(),
|
|
33
|
+
svgScale: [width / svgWH[0], height / svgWH[1]]
|
|
34
|
+
}), [width, height]);
|
|
35
|
+
return React.createElement("div", { className: "decoration-3" },
|
|
36
|
+
React.createElement("svg", { className: "decoration-3-container", width: `${svgWH[0]}px`, height: `${svgWH[1]}px`, style: { transform: `scale(${svgScale[0]},${svgScale[1]})` } }, points.map((point, i) => (React.createElement("rect", { key: i, fill: mainColor, x: point[0] - halfPointSideLength, y: point[1] - halfPointSideLength, width: pointSideLength, height: pointSideLength }, Math.random() > 0.6 && (React.createElement("animate", { attributeName: 'fill', values: `${mainColor};${subColor}`, dur: Math.random() + 1 + 's', begin: Math.random() * 2, repeatCount: 'indefinite' })))))));
|
|
37
|
+
});
|
|
38
|
+
export default Index;
|
|
39
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot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AC,IAAI,QAAQ,CAAC,CAAC,CAAC,GAAG,EAAE,IAE3D,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,CACtB,8BACI,GAAG,EAAE,CAAC,EACN,IAAI,EAAE,SAAS,EACf,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,mBAAmB,EACjC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,mBAAmB,EACjC,KAAK,EAAE,eAAe,EACtB,MAAM,EAAE,eAAe,IAEtB,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,IAAI,CACpB,iCACI,aAAa,EAAC,MAAM,EACpB,MAAM,EAAE,GAAG,SAAS,IAAI,QAAQ,EAAE,EAClC,GAAG,EAAE,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAC5B,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,EACxB,WAAW,EAAC,YAAY,GAC1B,CACL,CACE,CACV,CAAC,CACA,CACJ,CAAC;AACX,CAAC,CAAC,CAAC;AAEH,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./index.less";
|
|
3
|
+
interface ComponentStyle {
|
|
4
|
+
mainColor?: string;
|
|
5
|
+
subColor?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface ComponentProps {
|
|
8
|
+
style?: ComponentStyle;
|
|
9
|
+
base?: {
|
|
10
|
+
width?: number;
|
|
11
|
+
height?: number;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export interface ComponentRef {
|
|
15
|
+
updateConfig: (config: ComponentProps) => void;
|
|
16
|
+
}
|
|
17
|
+
declare const Index: React.ForwardRefExoticComponent<ComponentProps & React.RefAttributes<ComponentRef>>;
|
|
18
|
+
export default Index;
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/aldehyde/lowcode-components/decoration/decoration4/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkE,MAAM,OAAO,CAAC;AACvF,OAAO,cAAc,CAAC;AAEtB,UAAU,cAAc;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,cAAc;IAC3B,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,IAAI,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAC7C;AAED,MAAM,WAAW,YAAY;IACzB,YAAY,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,CAAC;CAClD;AACD,QAAA,MAAM,KAAK,qFAkCT,CAAC;AAEH,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React, { forwardRef, useImperativeHandle, useState } from "react";
|
|
2
|
+
import "./index.less";
|
|
3
|
+
const Index = forwardRef((props, ref) => {
|
|
4
|
+
const [style, setStyle] = useState(Object.assign({}, props.style));
|
|
5
|
+
const [width, setWidth] = useState(300);
|
|
6
|
+
const { mainColor = "#83BFF6", subColor = "#00CED1" } = style || {};
|
|
7
|
+
useImperativeHandle(ref, () => ({
|
|
8
|
+
updateConfig: (newConfig) => {
|
|
9
|
+
setStyle(Object.assign({}, newConfig.style));
|
|
10
|
+
setWidth(newConfig.base.width);
|
|
11
|
+
},
|
|
12
|
+
}));
|
|
13
|
+
return React.createElement("div", { className: "decoration-4" },
|
|
14
|
+
React.createElement("div", { className: "decoration-4-container", style: { width: `${width}px`, height: `5px` } },
|
|
15
|
+
React.createElement("svg", { width: width, height: 5 },
|
|
16
|
+
React.createElement("polyline", { stroke: mainColor, points: `0, 2.5 ${width}, 2.5` }),
|
|
17
|
+
React.createElement("polyline", { className: 'bold-line', stroke: subColor, strokeWidth: '3', strokeDasharray: '20, 80', strokeDashoffset: '-30', points: `0, 2.5 ${width}, 2.5` }))));
|
|
18
|
+
});
|
|
19
|
+
export default Index;
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/aldehyde/lowcode-components/decoration/decoration4/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAgB,UAAU,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACvF,OAAO,cAAc,CAAC;AAetB,MAAM,KAAK,GAAG,UAAU,CAAC,CAAC,KAAqB,EAAE,GAA+B,EAAE,EAAE;IAChF,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,mBAAsB,KAAK,CAAC,KAAK,EAAG,CAAC;IACvE,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAS,GAAG,CAAC,CAAC;IAChD,MAAM,EAAE,SAAS,GAAG,SAAS,EAAE,QAAQ,GAAG,SAAS,EAAE,GAAG,KAAK,IAAI,EAAE,CAAC;IAEpE,mBAAmB,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;QAC5B,YAAY,EAAE,CAAC,SAAS,EAAE,EAAE;YACxB,QAAQ,mBAAM,SAAS,CAAC,KAAK,EAAG,CAAC;YACjC,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACnC,CAAC;KACJ,CAAC,CAAC,CAAC;IAGJ,OAAO,6BAAK,SAAS,EAAC,cAAc;QAChC,6BACI,SAAS,EAAC,wBAAwB,EAClC,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,KAAK,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE;YAE7C,6BAAK,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;gBACxB,kCACI,MAAM,EAAE,SAAS,EACjB,MAAM,EAAE,UAAU,KAAK,OAAO,GAChC;gBACF,kCACI,SAAS,EAAC,WAAW,EACrB,MAAM,EAAE,QAAQ,EAChB,WAAW,EAAC,GAAG,EACf,eAAe,EAAC,QAAQ,EACxB,gBAAgB,EAAC,KAAK,EACtB,MAAM,EAAE,UAAU,KAAK,OAAO,GAChC,CACA,CACJ,CACJ,CAAC;AACX,CAAC,CAAC,CAAC;AAEH,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
.decoration-4 {
|
|
2
|
+
position: relative;
|
|
3
|
+
width: 100%;
|
|
4
|
+
height: 100%;
|
|
5
|
+
|
|
6
|
+
.decoration-4-container {
|
|
7
|
+
display: flex;
|
|
8
|
+
overflow: hidden;
|
|
9
|
+
position: absolute;
|
|
10
|
+
flex: 1;
|
|
11
|
+
animation: ani-width ease-in-out infinite;
|
|
12
|
+
animation-duration: 3s;
|
|
13
|
+
top: 50%;
|
|
14
|
+
margin-top: -2px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@keyframes ani-width {
|
|
18
|
+
0% {
|
|
19
|
+
width: 0%;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
70% {
|
|
23
|
+
width: 100%;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
100% {
|
|
27
|
+
width: 100%;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./index.less";
|
|
3
|
+
interface ComponentStyle {
|
|
4
|
+
mainColor?: string;
|
|
5
|
+
subColor?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface ComponentProps {
|
|
8
|
+
style?: ComponentStyle;
|
|
9
|
+
base?: {
|
|
10
|
+
width?: number;
|
|
11
|
+
height?: number;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export interface ComponentRef {
|
|
15
|
+
updateConfig: (config: ComponentProps) => void;
|
|
16
|
+
}
|
|
17
|
+
declare const Index: React.ForwardRefExoticComponent<ComponentProps & React.RefAttributes<ComponentRef>>;
|
|
18
|
+
export default Index;
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/aldehyde/lowcode-components/decoration/decoration5/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2E,MAAM,OAAO,CAAC;AAChG,OAAO,cAAc,CAAC;AActB,UAAU,cAAc;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,cAAc;IAC3B,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,IAAI,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAC7C;AAED,MAAM,WAAW,YAAY;IACzB,YAAY,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,CAAC;CAClD;AACD,QAAA,MAAM,KAAK,qFAqFT,CAAC;AAEH,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import React, { forwardRef, useImperativeHandle, useState, useMemo } from "react";
|
|
2
|
+
import "./index.less";
|
|
3
|
+
const getTwoPointDistance = (pointOne, pointTwo) => {
|
|
4
|
+
const minusX = Math.abs(pointOne[0] - pointTwo[0]);
|
|
5
|
+
const minusY = Math.abs(pointOne[1] - pointTwo[1]);
|
|
6
|
+
return Math.sqrt(minusX * minusX + minusY * minusY);
|
|
7
|
+
};
|
|
8
|
+
const getPolylineLength = (points) => {
|
|
9
|
+
const lineSegments = new Array(points.length - 1).fill(0).map((_, i) => [points[i], points[i + 1]]);
|
|
10
|
+
const lengths = lineSegments.map((item) => getTwoPointDistance(item[0], item[1]));
|
|
11
|
+
return lengths.reduce((all, num) => all + num, 0);
|
|
12
|
+
};
|
|
13
|
+
const Index = forwardRef((props, ref) => {
|
|
14
|
+
const [style, setStyle] = useState(Object.assign({}, props.style));
|
|
15
|
+
const [width, setWidth] = useState(300);
|
|
16
|
+
const [height, setHeight] = useState(100);
|
|
17
|
+
const { mainColor = "#83BFF6", subColor = "#00CED1" } = style || {};
|
|
18
|
+
useImperativeHandle(ref, () => ({
|
|
19
|
+
updateConfig: (newConfig) => {
|
|
20
|
+
setStyle(Object.assign({}, newConfig.style));
|
|
21
|
+
setWidth(newConfig.base.width);
|
|
22
|
+
setHeight(newConfig.base.height);
|
|
23
|
+
},
|
|
24
|
+
}));
|
|
25
|
+
const calcSVGData = () => {
|
|
26
|
+
let line1Points = [
|
|
27
|
+
[0, height * 0.2],
|
|
28
|
+
[width * 0.18, height * 0.2],
|
|
29
|
+
[width * 0.2, height * 0.4],
|
|
30
|
+
[width * 0.25, height * 0.4],
|
|
31
|
+
[width * 0.27, height * 0.6],
|
|
32
|
+
[width * 0.72, height * 0.6],
|
|
33
|
+
[width * 0.75, height * 0.4],
|
|
34
|
+
[width * 0.8, height * 0.4],
|
|
35
|
+
[width * 0.82, height * 0.2],
|
|
36
|
+
[width, height * 0.2]
|
|
37
|
+
];
|
|
38
|
+
let line2Points = [[width * 0.3, height * 0.8], [width * 0.7, height * 0.8]];
|
|
39
|
+
const line1Length = getPolylineLength(line1Points);
|
|
40
|
+
const line2Length = getPolylineLength(line2Points);
|
|
41
|
+
return {
|
|
42
|
+
line1Points: line1Points.map(point => point.join(',')).join(' '),
|
|
43
|
+
line2Points: line2Points.map(point => point.join(',')).join(' '),
|
|
44
|
+
line1Length, line2Length
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
const { line1Points, line2Points, line1Length, line2Length } = useMemo(calcSVGData, [width, height]);
|
|
48
|
+
return React.createElement("div", { className: "decoration-5" },
|
|
49
|
+
React.createElement("svg", { width: width, height: height },
|
|
50
|
+
React.createElement("polyline", { fill: 'transparent', stroke: mainColor, strokeWidth: '3', points: line1Points },
|
|
51
|
+
React.createElement("animate", { attributeName: 'stroke-dasharray', attributeType: 'XML', from: `0, ${line1Length / 2}, 0, ${line1Length / 2}`, to: `0, 0, ${line1Length}, 0`, dur: "3s", begin: '0s', calcMode: 'spline', keyTimes: '0;1', keySplines: '0.4,1,0.49,0.98', repeatCount: 'indefinite' })),
|
|
52
|
+
React.createElement("polyline", { fill: 'transparent', stroke: subColor, strokeWidth: '2', points: line2Points },
|
|
53
|
+
React.createElement("animate", { attributeName: 'stroke-dasharray', attributeType: 'XML', from: `0, ${line2Length / 2}, 0, ${line2Length / 2}`, to: `0, 0, ${line2Length}, 0`, dur: "3s", begin: '0s', calcMode: 'spline', keyTimes: '0;1', keySplines: '.4,1,.49,.98', repeatCount: 'indefinite' }))));
|
|
54
|
+
});
|
|
55
|
+
export default Index;
|
|
56
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/aldehyde/lowcode-components/decoration/decoration5/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAgB,UAAU,EAAE,mBAAmB,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChG,OAAO,cAAc,CAAC;AAEtB,MAAM,mBAAmB,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,EAAE;IAC/C,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IACnD,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IACnD,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC,CAAC;AACxD,CAAC,CAAA;AAED,MAAM,iBAAiB,GAA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CAAC;AACX,CAAC,CAAC,CAAC;AAEH,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./index.less";
|
|
3
|
+
interface ComponentStyle {
|
|
4
|
+
mainColor?: string;
|
|
5
|
+
subColor?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface ComponentProps {
|
|
8
|
+
style?: ComponentStyle;
|
|
9
|
+
base?: {
|
|
10
|
+
width?: number;
|
|
11
|
+
height?: number;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export interface ComponentRef {
|
|
15
|
+
updateConfig: (config: ComponentProps) => void;
|
|
16
|
+
}
|
|
17
|
+
declare const Index: React.ForwardRefExoticComponent<ComponentProps & React.RefAttributes<ComponentRef>>;
|
|
18
|
+
export default Index;
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/aldehyde/lowcode-components/decoration/decoration6/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2E,MAAM,OAAO,CAAC;AAChG,OAAO,cAAc,CAAC;AAwCtB,UAAU,cAAc;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,cAAc;IAC3B,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,IAAI,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAC7C;AAED,MAAM,WAAW,YAAY;IACzB,YAAY,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,CAAC;CAClD;AACD,QAAA,MAAM,KAAK,qFAgET,CAAC;AAEH,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React, { forwardRef, useImperativeHandle, useState, useMemo } from "react";
|
|
2
|
+
import "./index.less";
|
|
3
|
+
const svgWH = [300, 35];
|
|
4
|
+
const rowNum = 1;
|
|
5
|
+
const rowPoints = 40;
|
|
6
|
+
const rectWidth = 7;
|
|
7
|
+
const halfRectWidth = rectWidth / 2;
|
|
8
|
+
const getPoints = () => {
|
|
9
|
+
const [w, h] = svgWH;
|
|
10
|
+
const horizontalGap = w / (rowPoints + 1);
|
|
11
|
+
const verticalGap = h / (rowNum + 1);
|
|
12
|
+
let points = new Array(rowNum)
|
|
13
|
+
.fill(0)
|
|
14
|
+
.map((_, i) => new Array(rowPoints)
|
|
15
|
+
.fill(0)
|
|
16
|
+
.map((_, j) => [horizontalGap * (j + 1), verticalGap * (i + 1)]));
|
|
17
|
+
return points.reduce((all, item) => [...all, ...item], []);
|
|
18
|
+
};
|
|
19
|
+
const getData = () => {
|
|
20
|
+
const h = svgWH[1];
|
|
21
|
+
const heights = new Array(rowNum * rowPoints)
|
|
22
|
+
.fill(0)
|
|
23
|
+
.map(() => Math.random() > 0.8
|
|
24
|
+
? Math.random() * (h - 0.7 * h + 1) + 0.7 * h
|
|
25
|
+
: Math.random() * (0.5 * h - 0.2 * h + 1) + 0.2 * h);
|
|
26
|
+
const minHeights = new Array(rowNum * rowPoints)
|
|
27
|
+
.fill(0)
|
|
28
|
+
.map((_, i) => heights[i] * Math.random());
|
|
29
|
+
const randoms = new Array(rowNum * rowPoints)
|
|
30
|
+
.fill(0)
|
|
31
|
+
.map(() => Math.random() + 1.5);
|
|
32
|
+
return { heights, minHeights, randoms };
|
|
33
|
+
};
|
|
34
|
+
const Index = forwardRef((props, ref) => {
|
|
35
|
+
const [style, setStyle] = useState(Object.assign({}, props.style));
|
|
36
|
+
const [width, setWidth] = useState(300);
|
|
37
|
+
const [height, setHeight] = useState(100);
|
|
38
|
+
const { mainColor = "#83BFF6", subColor = "#00CED1" } = style || {};
|
|
39
|
+
useImperativeHandle(ref, () => ({
|
|
40
|
+
updateConfig: (newConfig) => {
|
|
41
|
+
setStyle(Object.assign({}, newConfig.style));
|
|
42
|
+
setWidth(newConfig.base.width);
|
|
43
|
+
setHeight(newConfig.base.height);
|
|
44
|
+
},
|
|
45
|
+
}));
|
|
46
|
+
const calcSVGData = () => (Object.assign(Object.assign({}, getData()), { points: getPoints(), svgScale: [width / svgWH[0], height / svgWH[1]] }));
|
|
47
|
+
const { points, heights, minHeights, randoms, svgScale } = useMemo(calcSVGData, [width, height]);
|
|
48
|
+
return React.createElement("div", { className: "decoration-6" },
|
|
49
|
+
React.createElement("svg", { className: "decoration-6-container", width: `${svgWH[0]}px`, height: `${svgWH[1]}px`, style: { transform: `scale(${svgScale[0]},${svgScale[1]})` } }, points.map((point, i) => (React.createElement("rect", { key: i, fill: Math.random() > 0.5 ? mainColor : subColor, x: point[0] - halfRectWidth, y: point[1] - heights[i] / 2, width: rectWidth, height: heights[i] },
|
|
50
|
+
React.createElement("animate", { attributeName: 'y', values: `${point[1] - minHeights[i] / 2};${point[1] -
|
|
51
|
+
heights[i] / 2};${point[1] - minHeights[i] / 2}`, dur: `${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' }),
|
|
52
|
+
React.createElement("animate", { attributeName: 'height', values: `${minHeights[i]};${heights[i]};${minHeights[i]}`, dur: `${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' }))))));
|
|
53
|
+
});
|
|
54
|
+
export default Index;
|
|
55
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/aldehyde/lowcode-components/decoration/decoration6/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAgB,UAAU,EAAE,mBAAmB,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM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,GAAG,aAAa,EAC3B,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,EAC5B,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;YAElB,iCACI,aAAa,EAAC,GAAG,EACjB,MAAM,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC;oBAC/C,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,EACpD,GAAG,EAAE,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,EACrB,QAAQ,EAAC,SAAS,EAClB,QAAQ,EAAC,QAAQ,EACjB,UAAU,EAAC,6BAA6B,EACxC,KAAK,EAAC,IAAI,EACV,WAAW,EAAC,YAAY,GAC1B;YACF,iCACI,aAAa,EAAC,QAAQ,EACtB,MAAM,EAAE,GAAG,UAAU,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,EAAE,EACzD,GAAG,EAAE,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,EACrB,QAAQ,EAAC,SAAS,EAClB,QAAQ,EAAC,QAAQ,EACjB,UAAU,EAAC,6BAA6B,EACxC,KAAK,EAAC,IAAI,EACV,WAAW,EAAC,YAAY,GAC1B,CACC,CACV,CAAC,CACA,CACJ,CAAC;AACX,CAAC,CAAC,CAAC;AAEH,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./index.less";
|
|
3
|
+
interface ComponentStyle {
|
|
4
|
+
mainColor?: string;
|
|
5
|
+
subColor?: string;
|
|
6
|
+
reverse?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface ComponentProps {
|
|
9
|
+
style?: ComponentStyle;
|
|
10
|
+
base?: {
|
|
11
|
+
width?: number;
|
|
12
|
+
height?: number;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export interface ComponentRef {
|
|
16
|
+
updateConfig: (config: ComponentProps) => void;
|
|
17
|
+
}
|
|
18
|
+
declare const Index: React.ForwardRefExoticComponent<ComponentProps & React.RefAttributes<ComponentRef>>;
|
|
19
|
+
export default Index;
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/aldehyde/lowcode-components/decoration/decoration7/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2E,MAAM,OAAO,CAAC;AAChG,OAAO,cAAc,CAAC;AAEtB,UAAU,cAAc;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,cAAc;IAC3B,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,IAAI,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAC7C;AAED,MAAM,WAAW,YAAY;IACzB,YAAY,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,CAAC;CAClD;AACD,QAAA,MAAM,KAAK,qFAkDT,CAAC;AAEH,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React, { forwardRef, useImperativeHandle, useState, useMemo } from "react";
|
|
2
|
+
import "./index.less";
|
|
3
|
+
const Index = forwardRef((props, ref) => {
|
|
4
|
+
const [style, setStyle] = useState(Object.assign({}, props.style));
|
|
5
|
+
const [width, setWidth] = useState(300);
|
|
6
|
+
const [height, setHeight] = useState(100);
|
|
7
|
+
const { mainColor = "#83BFF6", subColor = "#00CED1", reverse } = style || {};
|
|
8
|
+
useImperativeHandle(ref, () => ({
|
|
9
|
+
updateConfig: (newConfig) => {
|
|
10
|
+
setStyle(Object.assign({}, newConfig.style));
|
|
11
|
+
setWidth(newConfig.base.width);
|
|
12
|
+
setHeight(newConfig.base.height);
|
|
13
|
+
},
|
|
14
|
+
}));
|
|
15
|
+
const xPos = pos => (!reverse ? pos : width - pos);
|
|
16
|
+
const [pointsOne, pointsTwo, pointsThree] = useMemo(() => [
|
|
17
|
+
`${xPos(0)}, 0 ${xPos(30)}, ${height / 2}`,
|
|
18
|
+
`${xPos(20)}, 0 ${xPos(50)}, ${height / 2} ${xPos(width)}, ${height / 2}`,
|
|
19
|
+
`${xPos(0)}, ${height - 3}, ${xPos(200)}, ${height - 3}`
|
|
20
|
+
], [reverse, width, height]);
|
|
21
|
+
return React.createElement("div", { className: "decoration-7" },
|
|
22
|
+
React.createElement("svg", { width: width, height: height },
|
|
23
|
+
React.createElement("polyline", { stroke: mainColor, strokeWidth: '2', fill: 'transparent', points: pointsOne }),
|
|
24
|
+
React.createElement("polyline", { stroke: mainColor, strokeWidth: '2', fill: 'transparent', points: pointsTwo }),
|
|
25
|
+
React.createElement("polyline", { stroke: subColor, fill: 'transparent', strokeWidth: '3', points: pointsThree })));
|
|
26
|
+
});
|
|
27
|
+
export default Index;
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/aldehyde/lowcode-components/decoration/decoration7/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAgB,UAAU,EAAE,mBAAmB,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChG,OAAO,cAAc,CAAC;AAgBtB,MAAM,KAAK,GAAG,UAAU,CAAC,CAAC,KAAqB,EAAE,GAA+B,EAAE,EAAE;IAChF,MAAM,CAAC,KAAK,EAAE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,CAAC,EAAE;KAC3D,EACD,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,CAC3B,CAAA;IAGD,OAAO,6BAAK,SAAS,EAAC,cAAc;QAChC,6BAAK,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM;YAC7B,kCACI,MAAM,EAAE,SAAS,EACjB,WAAW,EAAC,GAAG,EACf,IAAI,EAAC,aAAa,EAClB,MAAM,EAAE,SAAS,GACnB;YAEF,kCACI,MAAM,EAAE,SAAS,EACjB,WAAW,EAAC,GAAG,EACf,IAAI,EAAC,aAAa,EAClB,MAAM,EAAE,SAAS,GACnB;YAEF,kCACI,MAAM,EAAE,QAAQ,EAChB,IAAI,EAAC,aAAa,EAClB,WAAW,EAAC,GAAG,EACf,MAAM,EAAE,WAAW,GACrB,CACA,CACJ,CAAC;AACX,CAAC,CAAC,CAAC;AAEH,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./index.less";
|
|
3
|
+
interface ComponentStyle {
|
|
4
|
+
mainColor?: string;
|
|
5
|
+
subColor?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface ComponentProps {
|
|
8
|
+
style?: ComponentStyle;
|
|
9
|
+
base?: {
|
|
10
|
+
width?: number;
|
|
11
|
+
height?: number;
|
|
12
|
+
id: string;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export interface ComponentRef {
|
|
16
|
+
updateConfig: (config: ComponentProps) => void;
|
|
17
|
+
}
|
|
18
|
+
declare const Index: React.ForwardRefExoticComponent<ComponentProps & React.RefAttributes<ComponentRef>>;
|
|
19
|
+
export default Index;
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|