diginet-core-ui 1.3.65 → 1.3.66
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/components/button/index.js +13 -14
- package/components/button/more.js +16 -16
- package/components/button/ripple-effect.js +2 -0
- package/components/card/card.js +30 -28
- package/components/card/index.js +1 -0
- package/components/chart/Pie/Circle.js +2 -1
- package/components/chart/Pie-v2/Circle.js +4 -5
- package/components/chart/Pie-v2/Sector.js +21 -27
- package/components/chart/Pie-v2/Sectors.js +16 -15
- package/components/chart/Pie-v2/index.js +141 -16
- package/components/chart/bar/Bar.js +20 -18
- package/components/chart/bar/Labels.js +20 -18
- package/components/chart/bar/index.js +3 -2
- package/components/chart/bar-v2/Bar.js +23 -21
- package/components/chart/bar-v2/Labels.js +21 -19
- package/components/chart/bar-v2/index.js +3 -2
- package/components/chart/line/Labels.js +21 -18
- package/components/chart/line/Path.js +7 -6
- package/components/chart/line/Point.js +2 -0
- package/components/chart/line/Title.js +1 -2
- package/components/chart/line/index.js +22 -1
- package/components/chart/line-v2/Labels.js +21 -18
- package/components/chart/line-v2/Path.js +15 -14
- package/components/chart/line-v2/Point.js +4 -2
- package/components/chart/line-v2/Title.js +1 -2
- package/components/chart/line-v2/index.js +8 -7
- package/components/check-text/index.js +22 -21
- package/components/chip/attach.js +8 -8
- package/components/form-control/calendar/index.js +17 -17
- package/components/form-control/calendar/range.js +33 -33
- package/components/form-control/dropdown/index.js +2 -1
- package/components/form-control/form/index.js +1 -0
- package/components/form-control/input-base/index.js +39 -30
- package/components/form-control/label/index.js +67 -43
- package/components/form-control/number-input/index.js +16 -29
- package/components/form-control/phone-input/index.js +20 -34
- package/components/form-control/text-input/index.js +9 -6
- package/components/form-control/time-picker/index.js +2 -1
- package/components/form-control/time-picker/swiper.js +80 -76
- package/components/form-view/helper-text.js +1 -0
- package/components/grid/Col.js +1 -1
- package/components/index.js +4 -1
- package/components/modal/index.js +1 -0
- package/components/others/extra/index.js +2 -0
- package/components/others/scrollbar/index.js +25 -26
- package/components/popover/body.js +74 -0
- package/components/popover/footer.js +76 -0
- package/components/popover/header.js +79 -0
- package/components/popover/index.js +119 -86
- package/components/popup/danger_popup.js +3 -1
- package/components/popup/index.js +2 -2
- package/components/popup/proposals_popup.js +1 -0
- package/components/progress/circular.js +14 -12
- package/components/status/index.js +92 -89
- package/components/tooltip/index.js +8 -3
- package/components/transfer/index.js +86 -94
- package/icons/effect.js +32 -34
- package/icons/general/clock/clock.js +1 -0
- package/icons/general/color-handler/background.js +1 -0
- package/icons/general/color-handler/text.js +1 -0
- package/icons/general/emoji/emoji.js +1 -0
- package/icons/general/font-properties/bold.js +1 -0
- package/icons/general/font-properties/font-family.js +1 -0
- package/icons/general/font-properties/font-size.js +1 -0
- package/icons/general/font-properties/italic.js +1 -0
- package/icons/general/font-properties/underline.js +1 -0
- package/icons/general/hyperlink/hyperlink.js +1 -0
- package/icons/general/indent/decrease.js +1 -0
- package/icons/general/indent/increase.js +1 -0
- package/icons/general/list/bullets.js +1 -0
- package/icons/general/list/numbering.js +1 -0
- package/icons/general/picture/picture.js +1 -0
- package/icons/general/steps/redo.js +1 -0
- package/icons/general/steps/undo.js +1 -0
- package/icons/general/text-align/center.js +1 -0
- package/icons/general/text-align/justify.js +1 -0
- package/icons/general/text-align/left.js +1 -0
- package/icons/general/text-align/right.js +1 -0
- package/icons/menu/dhr.js +2 -1
- package/icons/menu/erp.js +1 -0
- package/package.json +1 -1
- package/readme.md +15 -0
- package/styles/animation.js +2 -1
- package/styles/color-helper.js +108 -106
- package/styles/font.js +5 -4
- package/theme/index.js +1 -3
- package/theme/make-styles.js +25 -105
- package/theme/theme-provider.js +0 -9
- package/utils/console.js +0 -1
- package/utils/error/error.js +2 -3
- package/utils/index.js +0 -1
- package/utils/promisify.js +2 -1
- package/utils/renderIcon.js +13 -11
- package/styles/media-queries.js +0 -10
- package/theme/with-styles.js +0 -15
- package/theme/with-theme.js +0 -9
- package/utils/number.js +0 -63
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
/* eslint-disable react/prop-types */
|
|
2
|
+
|
|
1
3
|
/** @jsxRuntime classic */
|
|
2
4
|
|
|
3
5
|
/** @jsx jsx */
|
|
4
|
-
import PropTypes from
|
|
6
|
+
import PropTypes from 'prop-types';
|
|
5
7
|
import { jsx, css } from '@emotion/core';
|
|
6
8
|
import theme from '../../../theme/settings';
|
|
7
9
|
import { typography } from '../../../styles/typography';
|
|
@@ -33,23 +35,23 @@ const Labels = ({
|
|
|
33
35
|
text-align: center;
|
|
34
36
|
`;
|
|
35
37
|
const LabelCSS = labelStyle === 'italic' ? css`
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
38
|
+
fill: ${theme.colors.secondary};
|
|
39
|
+
text-anchor: start;
|
|
40
|
+
${typography.paragraph3};
|
|
41
|
+
text-transform: capitalize;
|
|
42
|
+
cursor: pointer;
|
|
43
|
+
display: inline-block;
|
|
44
|
+
transform-box: fill-box;
|
|
45
|
+
transform: rotateZ(45deg);
|
|
46
|
+
` : css`
|
|
47
|
+
color: ${theme.colors.secondary};
|
|
48
|
+
text-anchor: middle;
|
|
49
|
+
${typography.paragraph3};
|
|
50
|
+
text-transform: capitalize;
|
|
51
|
+
cursor: pointer;
|
|
52
|
+
display: inline-block;
|
|
53
|
+
word-break: break-word;
|
|
54
|
+
`;
|
|
53
55
|
const TextCSS = css`
|
|
54
56
|
${typography.paragraph3};
|
|
55
57
|
fill: ${theme.colors.secondary};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/** @jsxRuntime classic */
|
|
2
2
|
|
|
3
3
|
/** @jsx jsx */
|
|
4
|
-
import PropTypes from
|
|
5
|
-
import { memo, forwardRef } from
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
5
|
+
import { memo, forwardRef } from 'react';
|
|
6
6
|
import { jsx } from '@emotion/core';
|
|
7
7
|
import Axis from './Axis';
|
|
8
8
|
import Points from './Points';
|
|
@@ -89,6 +89,7 @@ const BarChart = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
89
89
|
};
|
|
90
90
|
return jsx("svg", {
|
|
91
91
|
id: id,
|
|
92
|
+
ref: ref,
|
|
92
93
|
viewBox: `0 0 ${Math.abs(viewBoxWidth)} ${Math.abs(viewBoxHeight)}`,
|
|
93
94
|
style: {
|
|
94
95
|
display: 'block',
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
/** @jsx jsx */
|
|
4
4
|
import { memo, useRef, forwardRef, useState } from 'react';
|
|
5
5
|
import { css, jsx } from '@emotion/core';
|
|
6
|
-
import PropTypes from
|
|
7
|
-
import Labels from
|
|
6
|
+
import PropTypes from 'prop-types';
|
|
7
|
+
import Labels from './Labels';
|
|
8
8
|
import { randomString } from '../../../utils';
|
|
9
|
-
import { typography } from
|
|
9
|
+
import { typography } from '../../../styles/typography';
|
|
10
10
|
const Bars = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
11
|
-
barsOpacity,
|
|
11
|
+
// barsOpacity,
|
|
12
12
|
barsMargin,
|
|
13
13
|
barsColor,
|
|
14
14
|
hoverTooltip,
|
|
@@ -21,8 +21,8 @@ const Bars = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
21
21
|
minX,
|
|
22
22
|
minY,
|
|
23
23
|
unitWidth,
|
|
24
|
-
onClick
|
|
25
|
-
|
|
24
|
+
onClick // ...props
|
|
25
|
+
|
|
26
26
|
}, ref) => {
|
|
27
27
|
const [id] = useState(randomString(6, {
|
|
28
28
|
allowNumber: false,
|
|
@@ -30,20 +30,20 @@ const Bars = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
30
30
|
})); // Start create css in Component
|
|
31
31
|
|
|
32
32
|
const barChartCSS = css`
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
33
|
+
position: relative;
|
|
34
|
+
opacity: 0.7;
|
|
35
|
+
filter: alpha(opacity=70); /* sử dụng cho IE8 trở về trước */
|
|
36
|
+
&:hover {
|
|
37
|
+
cursor: pointer;
|
|
38
|
+
filter: drop-shadow(0 -2px 4px rgba(21, 26, 48, 0.25));
|
|
39
|
+
opacity: 1;
|
|
40
|
+
filter: alpha(opacity=100); /* sử dụng cho IE8 trở về trước */
|
|
41
|
+
}
|
|
42
|
+
`;
|
|
43
43
|
const textChartCSS = css`
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
text-anchor: middle;
|
|
45
|
+
${typography.paragraph3};
|
|
46
|
+
`; // End create css in Component
|
|
47
47
|
// Create variable to calculate
|
|
48
48
|
|
|
49
49
|
const round = n => {
|
|
@@ -283,7 +283,8 @@ const Bars = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
283
283
|
};
|
|
284
284
|
|
|
285
285
|
return hoverTooltip ? jsx("g", {
|
|
286
|
-
className: 'DGN-CUI-Bar'
|
|
286
|
+
className: 'DGN-CUI-Bar',
|
|
287
|
+
ref: ref
|
|
287
288
|
}, data.map((point, i) => {
|
|
288
289
|
return jsx("g", {
|
|
289
290
|
key: i,
|
|
@@ -304,7 +305,8 @@ const Bars = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
304
305
|
onClick: handleChange
|
|
305
306
|
}), getPlacement(point, i));
|
|
306
307
|
})) : jsx("g", {
|
|
307
|
-
className: 'DGN-CUI-Bar'
|
|
308
|
+
className: 'DGN-CUI-Bar',
|
|
309
|
+
ref: ref
|
|
308
310
|
}, data.map((point, i) => {
|
|
309
311
|
return jsx("g", {
|
|
310
312
|
key: i,
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
/* eslint-disable react/prop-types */
|
|
2
|
+
|
|
1
3
|
/** @jsxRuntime classic */
|
|
2
4
|
|
|
3
5
|
/** @jsx jsx */
|
|
4
|
-
import PropTypes from
|
|
6
|
+
import PropTypes from 'prop-types';
|
|
5
7
|
import { jsx, css } from '@emotion/core';
|
|
6
8
|
import theme from '../../../theme/settings';
|
|
7
|
-
import { typography } from
|
|
9
|
+
import { typography } from '../../../styles/typography';
|
|
8
10
|
|
|
9
11
|
const Labels = ({
|
|
10
12
|
getX,
|
|
@@ -33,23 +35,23 @@ const Labels = ({
|
|
|
33
35
|
text-align: center;
|
|
34
36
|
`;
|
|
35
37
|
const LabelCSS = labelStyle === 'italic' ? css`
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
38
|
+
fill: ${theme.colors.secondary};
|
|
39
|
+
text-anchor: start;
|
|
40
|
+
${typography.paragraph3};
|
|
41
|
+
text-transform: capitalize;
|
|
42
|
+
cursor: pointer;
|
|
43
|
+
display: inline-block;
|
|
44
|
+
transform-box: fill-box;
|
|
45
|
+
transform: rotateZ(45deg);
|
|
46
|
+
` : css`
|
|
47
|
+
color: ${theme.colors.secondary};
|
|
48
|
+
text-anchor: middle;
|
|
49
|
+
${typography.paragraph3};
|
|
50
|
+
text-transform: capitalize;
|
|
51
|
+
cursor: pointer;
|
|
52
|
+
display: inline-block;
|
|
53
|
+
word-break: break-word;
|
|
54
|
+
`;
|
|
53
55
|
const TextCSS = css`
|
|
54
56
|
${typography.paragraph3};
|
|
55
57
|
fill: ${theme.colors.secondary};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/** @jsxRuntime classic */
|
|
2
2
|
|
|
3
3
|
/** @jsx jsx */
|
|
4
|
-
import PropTypes from
|
|
5
|
-
import { memo, forwardRef } from
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
5
|
+
import { memo, forwardRef } from 'react';
|
|
6
6
|
import { jsx } from '@emotion/core';
|
|
7
7
|
import Axis from './Axis';
|
|
8
8
|
import Points from './Points';
|
|
@@ -89,6 +89,7 @@ const BarChart = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
89
89
|
};
|
|
90
90
|
return jsx("svg", {
|
|
91
91
|
id: id,
|
|
92
|
+
ref: ref,
|
|
92
93
|
viewBox: `0 0 ${Math.abs(viewBoxWidth)} ${Math.abs(viewBoxHeight)}`,
|
|
93
94
|
style: {
|
|
94
95
|
display: 'block',
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
/* eslint-disable react/prop-types */
|
|
2
|
+
|
|
1
3
|
/** @jsxRuntime classic */
|
|
2
4
|
|
|
3
5
|
/** @jsx jsx */
|
|
4
|
-
import PropTypes from
|
|
6
|
+
import PropTypes from 'prop-types';
|
|
5
7
|
import { jsx, css } from '@emotion/core';
|
|
6
8
|
import theme from '../../../theme/settings';
|
|
7
|
-
import { typography } from
|
|
9
|
+
import { typography } from '../../../styles/typography';
|
|
8
10
|
|
|
9
11
|
const Labels = ({
|
|
10
12
|
getX,
|
|
@@ -32,22 +34,22 @@ const Labels = ({
|
|
|
32
34
|
text-align: center;
|
|
33
35
|
`;
|
|
34
36
|
const LabelCSS = labelStyle === 'italic' ? css`
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
37
|
+
fill: ${theme.colors.secondary};
|
|
38
|
+
text-anchor: start;
|
|
39
|
+
${typography.paragraph3};
|
|
40
|
+
text-transform: capitalize;
|
|
41
|
+
cursor: pointer;
|
|
42
|
+
display: inline-block;
|
|
43
|
+
transform-box: fill-box;
|
|
44
|
+
transform: rotateZ(45deg);
|
|
45
|
+
` : css`
|
|
46
|
+
color: ${theme.colors.secondary};
|
|
47
|
+
text-anchor: middle;
|
|
48
|
+
${typography.paragraph3};
|
|
49
|
+
text-transform: capitalize;
|
|
50
|
+
display: inline-block;
|
|
51
|
+
word-break: break-word;
|
|
52
|
+
`;
|
|
51
53
|
const TextCSS = css`
|
|
52
54
|
${typography.paragraph3};
|
|
53
55
|
fill: ${theme.colors.secondary};
|
|
@@ -60,6 +62,7 @@ const Labels = ({
|
|
|
60
62
|
let tile2 = 9;
|
|
61
63
|
|
|
62
64
|
const TiLe = () => {
|
|
65
|
+
// eslint-disable-next-line no-undef
|
|
63
66
|
if (viewBoxWidth >= 800) {
|
|
64
67
|
return tile;
|
|
65
68
|
} else {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/* eslint-disable react/prop-types */
|
|
2
|
+
|
|
1
3
|
/** @jsxRuntime classic */
|
|
2
4
|
|
|
3
5
|
/** @jsx jsx */
|
|
@@ -11,7 +13,6 @@ const Path = ({
|
|
|
11
13
|
getY,
|
|
12
14
|
Smooth,
|
|
13
15
|
PathVisible,
|
|
14
|
-
viewBoxWidth,
|
|
15
16
|
STROKE,
|
|
16
17
|
STROKEHover,
|
|
17
18
|
pathColor,
|
|
@@ -21,11 +22,11 @@ const Path = ({
|
|
|
21
22
|
const x = getX(element.x + unitWidth / 1.5);
|
|
22
23
|
const y = getY(element.quantity);
|
|
23
24
|
return [x, y];
|
|
24
|
-
});
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
}); // const Colors = data.map(element => {
|
|
26
|
+
// const colors = element.color;
|
|
27
|
+
// return colors;
|
|
28
|
+
// });
|
|
29
|
+
|
|
29
30
|
const PathCSS = css`
|
|
30
31
|
stroke: ${colors[pathColor] || pathColor};
|
|
31
32
|
stroke-width: ${STROKE};
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
/** @jsxRuntime classic */
|
|
2
2
|
|
|
3
3
|
/** @jsx jsx */
|
|
4
|
-
import PropTypes from
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
5
5
|
import { jsx } from '@emotion/core';
|
|
6
6
|
import Typography from '../../typography';
|
|
7
7
|
|
|
8
8
|
const Title = ({
|
|
9
|
-
position,
|
|
10
9
|
data
|
|
11
10
|
}) => {
|
|
12
11
|
return jsx("g", {
|
|
@@ -26,7 +26,28 @@ const LineChart = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
26
26
|
className,
|
|
27
27
|
...props
|
|
28
28
|
}, ref) => {
|
|
29
|
-
const colors = [
|
|
29
|
+
// const colors = [
|
|
30
|
+
// '#FFD600',
|
|
31
|
+
// '#FFA800',
|
|
32
|
+
// '#FF7A00',
|
|
33
|
+
// '#FF0000',
|
|
34
|
+
// '#B61414',
|
|
35
|
+
// '#8FFF00',
|
|
36
|
+
// '#629000',
|
|
37
|
+
// '#019A5A',
|
|
38
|
+
// '#00C875',
|
|
39
|
+
// '#00FFD1',
|
|
40
|
+
// '#4200FF',
|
|
41
|
+
// '#0075FF',
|
|
42
|
+
// '#0095FF',
|
|
43
|
+
// '#00C2FF',
|
|
44
|
+
// '#00E0FF',
|
|
45
|
+
// '#8F00FF',
|
|
46
|
+
// '#BD00FF',
|
|
47
|
+
// '#FA00FF',
|
|
48
|
+
// '#FF00B8',
|
|
49
|
+
// '#FF3D71',
|
|
50
|
+
// ];
|
|
30
51
|
const dataSource = data.map((item, i) => ({ ...item,
|
|
31
52
|
x: i
|
|
32
53
|
})); // console.log(dataSource);
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
/* eslint-disable react/prop-types */
|
|
2
|
+
|
|
1
3
|
/** @jsxRuntime classic */
|
|
2
4
|
|
|
3
5
|
/** @jsx jsx */
|
|
4
|
-
import PropTypes from
|
|
6
|
+
import PropTypes from 'prop-types';
|
|
5
7
|
import { jsx, css } from '@emotion/core';
|
|
6
8
|
import theme from '../../../theme/settings';
|
|
7
|
-
import { typography } from
|
|
9
|
+
import { typography } from '../../../styles/typography';
|
|
8
10
|
|
|
9
11
|
const Labels = ({
|
|
10
12
|
getX,
|
|
@@ -32,22 +34,22 @@ const Labels = ({
|
|
|
32
34
|
text-align: center;
|
|
33
35
|
`;
|
|
34
36
|
const LabelCSS = labelStyle === 'italic' ? css`
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
37
|
+
fill: ${theme.colors.secondary};
|
|
38
|
+
text-anchor: start;
|
|
39
|
+
${typography.paragraph3};
|
|
40
|
+
text-transform: capitalize;
|
|
41
|
+
cursor: pointer;
|
|
42
|
+
display: inline-block;
|
|
43
|
+
transform-box: fill-box;
|
|
44
|
+
transform: rotateZ(45deg);
|
|
45
|
+
` : css`
|
|
46
|
+
color: ${theme.colors.secondary};
|
|
47
|
+
text-anchor: middle;
|
|
48
|
+
${typography.paragraph3};
|
|
49
|
+
text-transform: capitalize;
|
|
50
|
+
display: inline-block;
|
|
51
|
+
word-break: break-word;
|
|
52
|
+
`;
|
|
51
53
|
const TextCSS = css`
|
|
52
54
|
${typography.paragraph3};
|
|
53
55
|
fill: ${theme.colors.secondary};
|
|
@@ -60,6 +62,7 @@ const Labels = ({
|
|
|
60
62
|
let tile2 = 9;
|
|
61
63
|
|
|
62
64
|
const TiLe = () => {
|
|
65
|
+
// eslint-disable-next-line no-undef
|
|
63
66
|
if (viewBoxWidth >= 800) {
|
|
64
67
|
return tile;
|
|
65
68
|
} else {
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
/* eslint-disable react/prop-types */
|
|
2
|
+
|
|
1
3
|
/** @jsxRuntime classic */
|
|
2
4
|
|
|
3
5
|
/** @jsx jsx */
|
|
4
|
-
import PropTypes from
|
|
6
|
+
import PropTypes from 'prop-types';
|
|
5
7
|
import { jsx, css } from '@emotion/core';
|
|
6
8
|
|
|
7
9
|
const Path = ({
|
|
@@ -10,7 +12,6 @@ const Path = ({
|
|
|
10
12
|
getY,
|
|
11
13
|
Smooth,
|
|
12
14
|
PathVisible,
|
|
13
|
-
viewBoxWidth,
|
|
14
15
|
STROKE,
|
|
15
16
|
STROKEHover,
|
|
16
17
|
pathColor,
|
|
@@ -20,11 +21,11 @@ const Path = ({
|
|
|
20
21
|
const x = getX(element.x + unitWidth / 1.5);
|
|
21
22
|
const y = getY(element.quantity);
|
|
22
23
|
return [x, y];
|
|
23
|
-
});
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
}); // const Colors = data.map(element => {
|
|
25
|
+
// const colors = element.color;
|
|
26
|
+
// return colors;
|
|
27
|
+
// });
|
|
28
|
+
|
|
28
29
|
const PathCSS = css`
|
|
29
30
|
stroke: ${pathColor};
|
|
30
31
|
stroke-width: ${STROKE};
|
|
@@ -37,7 +38,7 @@ const Path = ({
|
|
|
37
38
|
stroke-linejoin: round;
|
|
38
39
|
stroke-width: ${STROKEHover};
|
|
39
40
|
} */
|
|
40
|
-
`; // Properties of a line
|
|
41
|
+
`; // Properties of a line
|
|
41
42
|
// I: - pointA (array) [x,y]: coordinates
|
|
42
43
|
// - pointB (array) [x,y]: coordinates
|
|
43
44
|
// O: - (object) { length: l, angle: a }: properties of the line
|
|
@@ -62,7 +63,7 @@ const Path = ({
|
|
|
62
63
|
length: Math.sqrt(Math.pow(lengthX, 2) + Math.pow(lengthY, 2)),
|
|
63
64
|
angle
|
|
64
65
|
};
|
|
65
|
-
}; // Position of a control point
|
|
66
|
+
}; // Position of a control point
|
|
66
67
|
// I: - current (array) [x, y]: current point coordinates
|
|
67
68
|
// - previous (array) [x, y]: previous point coordinates
|
|
68
69
|
// - next (array) [x, y]: next point coordinates
|
|
@@ -102,7 +103,7 @@ const Path = ({
|
|
|
102
103
|
return jsx("path", {
|
|
103
104
|
d: d,
|
|
104
105
|
css: PathCSS,
|
|
105
|
-
fill:
|
|
106
|
+
fill: 'none'
|
|
106
107
|
});
|
|
107
108
|
};
|
|
108
109
|
|
|
@@ -110,13 +111,13 @@ const Path = ({
|
|
|
110
111
|
|
|
111
112
|
const svgPath = points => {
|
|
112
113
|
// build the d attributes by looping over the points
|
|
113
|
-
const d = points.reduce((acc, point, i, a) => i === 0 // if first point
|
|
114
|
-
|
|
115
|
-
|
|
114
|
+
const d = points.reduce((acc, point, i, a) => i === 0 ? // if first point
|
|
115
|
+
`M ${point[0]},${point[1]}` : // else
|
|
116
|
+
`${acc} ${command(point, i, a)}`, '');
|
|
116
117
|
return jsx("path", {
|
|
117
118
|
d: d,
|
|
118
119
|
css: PathCSS,
|
|
119
|
-
fill:
|
|
120
|
+
fill: 'none'
|
|
120
121
|
});
|
|
121
122
|
};
|
|
122
123
|
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
/* eslint-disable react/prop-types */
|
|
2
|
+
|
|
1
3
|
/** @jsxRuntime classic */
|
|
2
4
|
|
|
3
5
|
/** @jsx jsx */
|
|
4
6
|
import { useState } from 'react';
|
|
5
|
-
import PropTypes from
|
|
7
|
+
import PropTypes from 'prop-types';
|
|
6
8
|
import { jsx, css } from '@emotion/core';
|
|
7
9
|
import { randomString } from '../../../utils';
|
|
8
|
-
import { typography } from
|
|
10
|
+
import { typography } from '../../../styles/typography';
|
|
9
11
|
|
|
10
12
|
const Points = ({
|
|
11
13
|
data,
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
/** @jsxRuntime classic */
|
|
2
2
|
|
|
3
3
|
/** @jsx jsx */
|
|
4
|
-
import PropTypes from
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
5
5
|
import { jsx } from '@emotion/core';
|
|
6
6
|
import Typography from '../../typography';
|
|
7
7
|
|
|
8
8
|
const Title = ({
|
|
9
|
-
position,
|
|
10
9
|
data
|
|
11
10
|
}) => {
|
|
12
11
|
return jsx("g", {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/** @jsxRuntime classic */
|
|
2
2
|
|
|
3
3
|
/** @jsx jsx */
|
|
4
|
-
import PropTypes from
|
|
5
|
-
import { memo, forwardRef } from
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
5
|
+
import { memo, forwardRef } from 'react';
|
|
6
6
|
import { jsx } from '@emotion/core';
|
|
7
7
|
import Axis from './Axis';
|
|
8
8
|
import Labels from './Labels';
|
|
9
9
|
import Grid from './Grid';
|
|
10
|
-
import Points from './Point';
|
|
11
|
-
|
|
10
|
+
import Points from './Point'; // import Title from './Title';
|
|
11
|
+
|
|
12
12
|
import Path from './Path';
|
|
13
13
|
import { randomString } from '../../../utils';
|
|
14
14
|
const BarChart = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
@@ -21,11 +21,11 @@ const BarChart = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
21
21
|
viewBoxWidth,
|
|
22
22
|
labelsOffsetX,
|
|
23
23
|
labelsHeightX,
|
|
24
|
-
unitWidth,
|
|
25
|
-
style,
|
|
24
|
+
// unitWidth,
|
|
25
|
+
// style,
|
|
26
26
|
...props
|
|
27
27
|
}, ref) => {
|
|
28
|
-
const colors = ['#FFD600', '#FFA800', '#FF7A00', '#FF0000', '#B61414', '#8FFF00', '#629000', '#019A5A', '#00C875', '#00FFD1', '#4200FF', '#0075FF', '#0095FF', '#00C2FF', '#00E0FF', '#8F00FF', '#BD00FF', '#FA00FF', '#FF00B8', '#FF3D71'];
|
|
28
|
+
// const colors = ['#FFD600', '#FFA800', '#FF7A00', '#FF0000', '#B61414', '#8FFF00', '#629000', '#019A5A', '#00C875', '#00FFD1', '#4200FF', '#0075FF', '#0095FF', '#00C2FF', '#00E0FF', '#8F00FF', '#BD00FF', '#FA00FF', '#FF00B8', '#FF3D71'];
|
|
29
29
|
const dataSource = data.map((item, i) => ({ ...item,
|
|
30
30
|
x: i
|
|
31
31
|
})); // console.log(dataSource);
|
|
@@ -94,6 +94,7 @@ const BarChart = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
94
94
|
};
|
|
95
95
|
return jsx("svg", {
|
|
96
96
|
id: id,
|
|
97
|
+
ref: ref,
|
|
97
98
|
className: 'DGN-CUI-LineChart',
|
|
98
99
|
viewBox: `0 0 ${Math.abs(viewBoxWidth)} ${Math.abs(viewBoxHeight)}`,
|
|
99
100
|
style: {
|
|
@@ -26,28 +26,28 @@ const InterviewStatus = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
const checkText = css`
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
29
|
+
display: inline-flex;
|
|
30
|
+
color: ${disabled ? theme.colors.disabled : theme.colors.border};
|
|
31
|
+
div:nth-of-type(1):hover {
|
|
32
|
+
color: ${color[0]};
|
|
33
|
+
}
|
|
34
|
+
div:nth-of-type(2):hover {
|
|
35
|
+
color: ${color[1]};
|
|
36
|
+
}
|
|
37
|
+
div:nth-of-type(3):hover {
|
|
38
|
+
color: ${color[2]};
|
|
39
|
+
}
|
|
40
|
+
`;
|
|
41
41
|
const checkTextItemText = css`
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
margin-left: 10px;
|
|
43
|
+
`;
|
|
44
44
|
const checkTextDivider = css`
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
45
|
+
margin: 2px 19px;
|
|
46
|
+
width: 2px;
|
|
47
|
+
height: 16px;
|
|
48
|
+
background: ${theme.colors.border};
|
|
49
|
+
border-radius: 1px;
|
|
50
|
+
`;
|
|
51
51
|
|
|
52
52
|
const onClickItem = (e, index) => {
|
|
53
53
|
const clickedItem = ref.current.querySelectorAll('div');
|
|
@@ -76,7 +76,8 @@ const InterviewStatus = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
76
76
|
}
|
|
77
77
|
});
|
|
78
78
|
}, [chosen]);
|
|
79
|
-
const ItemName = option.map(index => jsx("span", {
|
|
79
|
+
const ItemName = option.map((index, idx) => jsx("span", {
|
|
80
|
+
key: idx,
|
|
80
81
|
css: checkTextItemText
|
|
81
82
|
}, index));
|
|
82
83
|
return jsx("div", {
|