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
|
@@ -111,7 +111,6 @@ const Button = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
111
111
|
startIcon,
|
|
112
112
|
endIcon,
|
|
113
113
|
children,
|
|
114
|
-
refs,
|
|
115
114
|
loading,
|
|
116
115
|
...props
|
|
117
116
|
}, reference) => {
|
|
@@ -484,19 +483,19 @@ Button.propTypes = {
|
|
|
484
483
|
/** status loading of button */
|
|
485
484
|
loading: PropTypes.bool,
|
|
486
485
|
|
|
487
|
-
/**
|
|
488
|
-
* ref methods
|
|
489
|
-
*
|
|
490
|
-
* * option(): Gets all UI component properties
|
|
491
|
-
* * Returns value - object
|
|
492
|
-
* * option(optionName): Gets the value of a single property
|
|
493
|
-
* * @param {optionName} - string
|
|
494
|
-
* * Returns value - any
|
|
495
|
-
* * option(optionName, optionValue): Updates the value of a single property
|
|
496
|
-
* * @param {optionName} - string
|
|
497
|
-
* * @param {optionValue} - any
|
|
498
|
-
* * option(options): Updates the values of several properties
|
|
499
|
-
* * @param {options} - object
|
|
486
|
+
/**
|
|
487
|
+
* ref methods
|
|
488
|
+
*
|
|
489
|
+
* * option(): Gets all UI component properties
|
|
490
|
+
* * Returns value - object
|
|
491
|
+
* * option(optionName): Gets the value of a single property
|
|
492
|
+
* * @param {optionName} - string
|
|
493
|
+
* * Returns value - any
|
|
494
|
+
* * option(optionName, optionValue): Updates the value of a single property
|
|
495
|
+
* * @param {optionName} - string
|
|
496
|
+
* * @param {optionValue} - any
|
|
497
|
+
* * option(options): Updates the values of several properties
|
|
498
|
+
* * @param {options} - object
|
|
500
499
|
*/
|
|
501
500
|
reference: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
502
501
|
current: PropTypes.instanceOf(Element)
|
|
@@ -23,25 +23,25 @@ const ButtonMore = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
23
23
|
|
|
24
24
|
const [open, setOpen] = useState(false);
|
|
25
25
|
const ButtonMoreStyle = css`
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
display: inline-flex;
|
|
27
|
+
button {
|
|
28
|
+
:first-of-type {
|
|
29
|
+
border-top-right-radius: 0;
|
|
30
|
+
border-bottom-right-radius: 0;
|
|
31
|
+
margin-right: 1px;
|
|
32
|
+
}
|
|
33
|
+
:last-of-type {
|
|
34
|
+
border-top-left-radius: 0;
|
|
35
|
+
border-bottom-left-radius: 0;
|
|
36
|
+
margin-left: 0;
|
|
37
|
+
}
|
|
32
38
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
border-bottom-left-radius: 0;
|
|
36
|
-
margin-left: 0;
|
|
39
|
+
.more-icon-close {
|
|
40
|
+
display: none;
|
|
37
41
|
}
|
|
38
|
-
|
|
39
|
-
.more-icon-close {
|
|
40
|
-
display: none;
|
|
41
|
-
}
|
|
42
|
-
`;
|
|
42
|
+
`;
|
|
43
43
|
|
|
44
|
-
const showMoreOption =
|
|
44
|
+
const showMoreOption = () => {
|
|
45
45
|
if (!open) {
|
|
46
46
|
setOpen(true);
|
|
47
47
|
}
|
package/components/card/card.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/* eslint-disable no-undef */
|
|
2
|
+
|
|
1
3
|
/** @jsxRuntime classic */
|
|
2
4
|
|
|
3
5
|
/** @jsx jsx */
|
|
@@ -7,18 +9,18 @@ import PropTypes from 'prop-types';
|
|
|
7
9
|
import { jsx, css } from '@emotion/core';
|
|
8
10
|
import CardContext from './context';
|
|
9
11
|
const Card = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
10
|
-
open,
|
|
11
|
-
type,
|
|
12
|
-
title,
|
|
12
|
+
// open,
|
|
13
|
+
// type,
|
|
14
|
+
// title,
|
|
13
15
|
style,
|
|
14
16
|
top,
|
|
15
|
-
pressESCToClose,
|
|
16
|
-
darkTheme,
|
|
17
|
-
autoFocus,
|
|
18
|
-
refs,
|
|
17
|
+
// pressESCToClose,
|
|
18
|
+
// darkTheme,
|
|
19
|
+
// autoFocus,
|
|
20
|
+
// refs,
|
|
19
21
|
onClose,
|
|
20
|
-
onConfirm,
|
|
21
|
-
onCancel,
|
|
22
|
+
// onConfirm,
|
|
23
|
+
// onCancel,
|
|
22
24
|
children,
|
|
23
25
|
width,
|
|
24
26
|
...props
|
|
@@ -29,25 +31,25 @@ const Card = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
29
31
|
|
|
30
32
|
const cardBoxRef = useRef(null);
|
|
31
33
|
const CardBox = css`
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
34
|
+
background-color: white;
|
|
35
|
+
border-radius: 4px;
|
|
36
|
+
box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
|
|
37
|
+
box-sizing: border-box;
|
|
38
|
+
border-radius: 10px;
|
|
39
|
+
display: flex;
|
|
40
|
+
position: relative;
|
|
41
|
+
max-height: calc(100% - ${isNaN(top) ? top : +top + 'px'});
|
|
42
|
+
min-width: 150px;
|
|
43
|
+
max-width: 90%;
|
|
44
|
+
margin: 0 auto;
|
|
45
|
+
height: max-content;
|
|
46
|
+
width: ${isNaN(width) ? width : width + 'px'};
|
|
47
|
+
flex-direction: column;
|
|
48
|
+
-webkit-box-orient: vertical;
|
|
49
|
+
-webkit-box-direction: normal;
|
|
50
|
+
/* min-height: 152px; */
|
|
51
|
+
cursor: 'initial';
|
|
52
|
+
`;
|
|
51
53
|
|
|
52
54
|
const onShowCard = () => {
|
|
53
55
|
setOpenState(true);
|
package/components/card/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** @jsxRuntime classic */
|
|
2
2
|
|
|
3
3
|
/** @jsx jsx */
|
|
4
|
-
import PropTypes from
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
5
5
|
import { memo, forwardRef } from 'react';
|
|
6
6
|
import { jsx } from '@emotion/core';
|
|
7
7
|
const Circle = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
@@ -19,6 +19,7 @@ const Circle = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
19
19
|
quantity
|
|
20
20
|
}, ref) => {
|
|
21
21
|
return jsx("ellipse", {
|
|
22
|
+
ref: ref,
|
|
22
23
|
cx: center,
|
|
23
24
|
cy: center,
|
|
24
25
|
fill: color,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** @jsxRuntime classic */
|
|
2
2
|
|
|
3
3
|
/** @jsx jsx */
|
|
4
|
-
import PropTypes from
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
5
5
|
import { memo, forwardRef } from 'react';
|
|
6
6
|
import { jsx } from '@emotion/core';
|
|
7
7
|
const Circle = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
@@ -15,10 +15,10 @@ const Circle = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
15
15
|
radius,
|
|
16
16
|
strokeColor,
|
|
17
17
|
strokeWidth,
|
|
18
|
-
name
|
|
19
|
-
quantity
|
|
18
|
+
name
|
|
20
19
|
}, ref) => {
|
|
21
20
|
return jsx("ellipse", {
|
|
21
|
+
ref: ref,
|
|
22
22
|
cx: center,
|
|
23
23
|
cy: center,
|
|
24
24
|
fill: color,
|
|
@@ -44,7 +44,6 @@ Circle.propTypes = {
|
|
|
44
44
|
radius: PropTypes.number.isRequired,
|
|
45
45
|
strokeColor: PropTypes.string,
|
|
46
46
|
strokeWidth: PropTypes.number,
|
|
47
|
-
name: PropTypes.string
|
|
48
|
-
quantity: PropTypes.number
|
|
47
|
+
name: PropTypes.string
|
|
49
48
|
};
|
|
50
49
|
export default Circle;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
/** @jsx jsx */
|
|
4
4
|
import { useRef, memo, forwardRef } from 'react';
|
|
5
|
-
import PropTypes from
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
6
|
import { jsx, css } from '@emotion/core';
|
|
7
7
|
const Sector = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
8
8
|
fill,
|
|
@@ -18,8 +18,6 @@ const Sector = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
18
18
|
renderSelectedItem,
|
|
19
19
|
className,
|
|
20
20
|
path,
|
|
21
|
-
name,
|
|
22
|
-
quantity,
|
|
23
21
|
href,
|
|
24
22
|
transitionDuration,
|
|
25
23
|
transitionTimingFunction,
|
|
@@ -34,20 +32,20 @@ const Sector = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
34
32
|
|
|
35
33
|
const pathRef = useRef(null);
|
|
36
34
|
const SectorCSS = expandOnHover || expandedIndex >= 0 ? css`
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
35
|
+
transition-property: ${transitionProperty};
|
|
36
|
+
cursor: pointer;
|
|
37
|
+
transition-timing-function: ${transitionTimingFunction};
|
|
38
|
+
transition-duration: ${transitionDuration};
|
|
39
|
+
&:hover {
|
|
40
|
+
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.5), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
|
|
41
|
+
filter: drop-shadow(0.05rem 0.05rem 0.1rem rgba(0, 0, 0, 0.5));
|
|
42
|
+
}
|
|
43
|
+
` : css`
|
|
44
|
+
transition-property: all;
|
|
45
|
+
cursor: pointer;
|
|
46
|
+
transition-timing-function: ${transitionTimingFunction};
|
|
47
|
+
transition-duration: ${transitionDuration};
|
|
48
|
+
`;
|
|
51
49
|
const content = jsx("path", {
|
|
52
50
|
d: path,
|
|
53
51
|
fill: fill,
|
|
@@ -75,14 +73,13 @@ const Sector = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
75
73
|
return result;
|
|
76
74
|
}));
|
|
77
75
|
Sector.defaultProps = {
|
|
78
|
-
strokeColor:
|
|
76
|
+
strokeColor: '#fff',
|
|
79
77
|
strokeWidth: 0,
|
|
80
|
-
strokeLinejoin:
|
|
81
|
-
name: null,
|
|
78
|
+
strokeLinejoin: 'round',
|
|
82
79
|
quantity: null,
|
|
83
80
|
href: null,
|
|
84
|
-
transitionDuration:
|
|
85
|
-
transitionTimingFunction:
|
|
81
|
+
transitionDuration: '0.5s',
|
|
82
|
+
transitionTimingFunction: 'ease-in',
|
|
86
83
|
transitionProperty: 'd'
|
|
87
84
|
};
|
|
88
85
|
Sector.propTypes = {
|
|
@@ -97,8 +94,8 @@ Sector.propTypes = {
|
|
|
97
94
|
onTouchEnd: PropTypes.func,
|
|
98
95
|
onTouchStart: PropTypes.func,
|
|
99
96
|
|
|
100
|
-
/** function displays selected items by custom, example:<br/>
|
|
101
|
-
* renderItem={(data, index) => index + ' - ' + data.name}<br/>
|
|
97
|
+
/** function displays selected items by custom, example:<br/>
|
|
98
|
+
* renderItem={(data, index) => index + ' - ' + data.name}<br/>
|
|
102
99
|
*/
|
|
103
100
|
renderSelectedItem: PropTypes.func,
|
|
104
101
|
path: PropTypes.string.isRequired,
|
|
@@ -111,9 +108,6 @@ Sector.propTypes = {
|
|
|
111
108
|
|
|
112
109
|
/** The strokeWidth attribute is a presentation attribute defining the width of the stroke to be applied to the shape */
|
|
113
110
|
strokeWidth: PropTypes.number,
|
|
114
|
-
|
|
115
|
-
/** The title is add from the data */
|
|
116
|
-
name: PropTypes.string,
|
|
117
111
|
quantity: PropTypes.number,
|
|
118
112
|
href: PropTypes.string,
|
|
119
113
|
|
|
@@ -1,13 +1,14 @@
|
|
|
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
|
|
6
|
-
import Sector from
|
|
7
|
-
import ReactDOMServer from 'react-dom/server';
|
|
7
|
+
import PropTypes from 'prop-types';
|
|
8
|
+
import Sector from './Sector';
|
|
8
9
|
import { jsx, css } from '@emotion/core';
|
|
9
|
-
import { randomString
|
|
10
|
-
import { typography } from
|
|
10
|
+
import { randomString } from '../../../utils';
|
|
11
|
+
import { typography } from '../../../styles/typography';
|
|
11
12
|
|
|
12
13
|
const Sectors = ({
|
|
13
14
|
center,
|
|
@@ -37,7 +38,7 @@ const Sectors = ({
|
|
|
37
38
|
let angleStart = startAngle;
|
|
38
39
|
let angleEnd = startAngle;
|
|
39
40
|
|
|
40
|
-
const getPath = (d, i
|
|
41
|
+
const getPath = (d, i) => {
|
|
41
42
|
const anglePosition = (angleStart + angleEnd) / 2;
|
|
42
43
|
var rotateX = 0;
|
|
43
44
|
var rotateY = 0;
|
|
@@ -77,10 +78,10 @@ const Sectors = ({
|
|
|
77
78
|
${typography.paragraph1};
|
|
78
79
|
stroke-dasharray: 1000;
|
|
79
80
|
stroke-dashoffset: 1000;
|
|
80
|
-
|
|
81
|
+
animation: draw 8s ease-in-out forwards;
|
|
81
82
|
@keyframes draw {
|
|
82
|
-
|
|
83
|
-
|
|
83
|
+
to {
|
|
84
|
+
stroke-dashoffset: 0;
|
|
84
85
|
}
|
|
85
86
|
}
|
|
86
87
|
`;
|
|
@@ -94,7 +95,7 @@ const Sectors = ({
|
|
|
94
95
|
animation: dash 1s linear forwards;
|
|
95
96
|
&:hover {
|
|
96
97
|
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
|
|
97
|
-
filter: drop-shadow(
|
|
98
|
+
filter: drop-shadow(0.05rem 0.05rem 0.1rem rgba(0, 0, 0, 0.2));
|
|
98
99
|
}
|
|
99
100
|
@keyframes dash {
|
|
100
101
|
to {
|
|
@@ -103,7 +104,7 @@ const Sectors = ({
|
|
|
103
104
|
}
|
|
104
105
|
`;
|
|
105
106
|
return jsx("g", {
|
|
106
|
-
key:
|
|
107
|
+
key: 'Path' + i
|
|
107
108
|
}, jsx("path", {
|
|
108
109
|
d: path1,
|
|
109
110
|
stroke: d.color,
|
|
@@ -164,9 +165,9 @@ const Sectors = ({
|
|
|
164
165
|
|
|
165
166
|
return jsx("g", {
|
|
166
167
|
key: i,
|
|
167
|
-
id:
|
|
168
|
+
id: 'sector' + i
|
|
168
169
|
}, jsx(Sector, {
|
|
169
|
-
key:
|
|
170
|
+
key: 'sector' + i,
|
|
170
171
|
fill: d.color,
|
|
171
172
|
path: path,
|
|
172
173
|
href: d.href,
|
|
@@ -188,8 +189,8 @@ const Sectors = ({
|
|
|
188
189
|
Sectors.defaultProps = {
|
|
189
190
|
expandSize: 10,
|
|
190
191
|
strokeWidthTooltip: 2,
|
|
191
|
-
transitionTimingFunction:
|
|
192
|
-
strokeLinejoin:
|
|
192
|
+
transitionTimingFunction: 'ease-out',
|
|
193
|
+
strokeLinejoin: 'round',
|
|
193
194
|
transitionProperty: 'd'
|
|
194
195
|
};
|
|
195
196
|
Sectors.propTypes = {
|
|
@@ -13,14 +13,13 @@ import Sector from './Sector';
|
|
|
13
13
|
const PieChart = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
14
14
|
expandOnHover,
|
|
15
15
|
renderSelectedItem,
|
|
16
|
-
type,
|
|
16
|
+
// type,
|
|
17
17
|
viewData,
|
|
18
18
|
onSectorHover,
|
|
19
19
|
expandSize,
|
|
20
20
|
data,
|
|
21
21
|
title,
|
|
22
22
|
Donut,
|
|
23
|
-
viewBoxSize,
|
|
24
23
|
width,
|
|
25
24
|
height,
|
|
26
25
|
...props
|
|
@@ -119,19 +118,148 @@ const PieChart = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
119
118
|
const center = ZoomIn() / 4;
|
|
120
119
|
const dataWithValue = data.filter(d => d.quantity > 0);
|
|
121
120
|
const [isExpanded, setExpanded] = useState('false');
|
|
122
|
-
const expandedIndex = useRef(null);
|
|
123
|
-
|
|
124
|
-
x: i * position
|
|
125
|
-
}));
|
|
121
|
+
const expandedIndex = useRef(null); // const dataSource = data.map((item, i) => ({ ...item, x: i * position }));
|
|
122
|
+
|
|
126
123
|
const DataTitle = data.map((item, i) => ({ ...item,
|
|
127
124
|
x: position + i * 10
|
|
128
|
-
}));
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
125
|
+
})); // const measureText = (str, fontSize = 16) => {
|
|
126
|
+
// const widths = [
|
|
127
|
+
// 0,
|
|
128
|
+
// 0,
|
|
129
|
+
// 0,
|
|
130
|
+
// 0,
|
|
131
|
+
// 0,
|
|
132
|
+
// 0,
|
|
133
|
+
// 0,
|
|
134
|
+
// 0,
|
|
135
|
+
// 0,
|
|
136
|
+
// 0,
|
|
137
|
+
// 0,
|
|
138
|
+
// 0,
|
|
139
|
+
// 0,
|
|
140
|
+
// 0,
|
|
141
|
+
// 0,
|
|
142
|
+
// 0,
|
|
143
|
+
// 0,
|
|
144
|
+
// 0,
|
|
145
|
+
// 0,
|
|
146
|
+
// 0,
|
|
147
|
+
// 0,
|
|
148
|
+
// 0,
|
|
149
|
+
// 0,
|
|
150
|
+
// 0,
|
|
151
|
+
// 0,
|
|
152
|
+
// 0,
|
|
153
|
+
// 0,
|
|
154
|
+
// 0,
|
|
155
|
+
// 0,
|
|
156
|
+
// 0,
|
|
157
|
+
// 0,
|
|
158
|
+
// 0,
|
|
159
|
+
// 0.2796875,
|
|
160
|
+
// 0.2765625,
|
|
161
|
+
// 0.3546875,
|
|
162
|
+
// 0.5546875,
|
|
163
|
+
// 0.5546875,
|
|
164
|
+
// 0.8890625,
|
|
165
|
+
// 0.665625,
|
|
166
|
+
// 0.190625,
|
|
167
|
+
// 0.3328125,
|
|
168
|
+
// 0.3328125,
|
|
169
|
+
// 0.3890625,
|
|
170
|
+
// 0.5828125,
|
|
171
|
+
// 0.2765625,
|
|
172
|
+
// 0.3328125,
|
|
173
|
+
// 0.2765625,
|
|
174
|
+
// 0.3015625,
|
|
175
|
+
// 0.5546875,
|
|
176
|
+
// 0.5546875,
|
|
177
|
+
// 0.5546875,
|
|
178
|
+
// 0.5546875,
|
|
179
|
+
// 0.5546875,
|
|
180
|
+
// 0.5546875,
|
|
181
|
+
// 0.5546875,
|
|
182
|
+
// 0.5546875,
|
|
183
|
+
// 0.5546875,
|
|
184
|
+
// 0.5546875,
|
|
185
|
+
// 0.2765625,
|
|
186
|
+
// 0.2765625,
|
|
187
|
+
// 0.584375,
|
|
188
|
+
// 0.5828125,
|
|
189
|
+
// 0.584375,
|
|
190
|
+
// 0.5546875,
|
|
191
|
+
// 1.0140625,
|
|
192
|
+
// 0.665625,
|
|
193
|
+
// 0.665625,
|
|
194
|
+
// 0.721875,
|
|
195
|
+
// 0.721875,
|
|
196
|
+
// 0.665625,
|
|
197
|
+
// 0.609375,
|
|
198
|
+
// 0.7765625,
|
|
199
|
+
// 0.721875,
|
|
200
|
+
// 0.2765625,
|
|
201
|
+
// 0.5,
|
|
202
|
+
// 0.665625,
|
|
203
|
+
// 0.5546875,
|
|
204
|
+
// 0.8328125,
|
|
205
|
+
// 0.721875,
|
|
206
|
+
// 0.7765625,
|
|
207
|
+
// 0.665625,
|
|
208
|
+
// 0.7765625,
|
|
209
|
+
// 0.721875,
|
|
210
|
+
// 0.665625,
|
|
211
|
+
// 0.609375,
|
|
212
|
+
// 0.721875,
|
|
213
|
+
// 0.665625,
|
|
214
|
+
// 0.94375,
|
|
215
|
+
// 0.665625,
|
|
216
|
+
// 0.665625,
|
|
217
|
+
// 0.609375,
|
|
218
|
+
// 0.2765625,
|
|
219
|
+
// 0.3546875,
|
|
220
|
+
// 0.2765625,
|
|
221
|
+
// 0.4765625,
|
|
222
|
+
// 0.5546875,
|
|
223
|
+
// 0.3328125,
|
|
224
|
+
// 0.5546875,
|
|
225
|
+
// 0.5546875,
|
|
226
|
+
// 0.5,
|
|
227
|
+
// 0.5546875,
|
|
228
|
+
// 0.5546875,
|
|
229
|
+
// 0.2765625,
|
|
230
|
+
// 0.5546875,
|
|
231
|
+
// 0.5546875,
|
|
232
|
+
// 0.221875,
|
|
233
|
+
// 0.240625,
|
|
234
|
+
// 0.5,
|
|
235
|
+
// 0.221875,
|
|
236
|
+
// 0.8328125,
|
|
237
|
+
// 0.5546875,
|
|
238
|
+
// 0.5546875,
|
|
239
|
+
// 0.5546875,
|
|
240
|
+
// 0.5546875,
|
|
241
|
+
// 0.3328125,
|
|
242
|
+
// 0.5,
|
|
243
|
+
// 0.2765625,
|
|
244
|
+
// 0.5546875,
|
|
245
|
+
// 0.5,
|
|
246
|
+
// 0.721875,
|
|
247
|
+
// 0.5,
|
|
248
|
+
// 0.5,
|
|
249
|
+
// 0.5,
|
|
250
|
+
// 0.3546875,
|
|
251
|
+
// 0.259375,
|
|
252
|
+
// 0.353125,
|
|
253
|
+
// 0.5890625,
|
|
254
|
+
// ];
|
|
255
|
+
// const avg = 0.5279276315789471;
|
|
256
|
+
// return (
|
|
257
|
+
// str
|
|
258
|
+
// .split('')
|
|
259
|
+
// .map(c => (c.charCodeAt(0) < widths.length ? widths[c.charCodeAt(0)] : avg))
|
|
260
|
+
// .reduce((cur, acc) => acc + cur) * fontSize
|
|
261
|
+
// );
|
|
262
|
+
// };
|
|
135
263
|
|
|
136
264
|
const handleSectorHover = (data, index, e) => {
|
|
137
265
|
if (expandOnHover) {
|
|
@@ -375,9 +503,6 @@ PieChart.propTypes = {
|
|
|
375
503
|
/** */
|
|
376
504
|
angleMargin: PropTypes.number,
|
|
377
505
|
|
|
378
|
-
/** The viewBox attribute defines the position and dimension, in user space, of an SVG viewport */
|
|
379
|
-
viewBoxSize: PropTypes.number,
|
|
380
|
-
|
|
381
506
|
/** The transition-duration CSS property sets the length of time a transition animation should take to complete. Default 0.3s */
|
|
382
507
|
transitionDuration: Sector.propTypes.transitionDuration,
|
|
383
508
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/** @jsxRuntime classic */
|
|
2
2
|
|
|
3
3
|
/** @jsx jsx */
|
|
4
|
-
import { memo, useRef, forwardRef
|
|
4
|
+
import { memo, useRef, forwardRef } from 'react';
|
|
5
5
|
import { css, jsx } from '@emotion/core';
|
|
6
|
-
import PropTypes from
|
|
7
|
-
import Labels from
|
|
8
|
-
import { typography } from
|
|
6
|
+
import PropTypes from 'prop-types';
|
|
7
|
+
import Labels from './Labels';
|
|
8
|
+
import { typography } from '../../../styles/typography';
|
|
9
9
|
const Bars = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
10
|
-
barsOpacity,
|
|
10
|
+
// barsOpacity,
|
|
11
11
|
barsMargin,
|
|
12
12
|
barsColor,
|
|
13
13
|
hoverTooltip,
|
|
@@ -20,21 +20,21 @@ const Bars = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
20
20
|
minX,
|
|
21
21
|
minY,
|
|
22
22
|
unitWidth,
|
|
23
|
-
onClick
|
|
24
|
-
|
|
23
|
+
onClick // ...props
|
|
24
|
+
|
|
25
25
|
}, ref) => {
|
|
26
26
|
// Start create css in Component
|
|
27
27
|
const barChartCSS = css`
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
28
|
+
position: relative;
|
|
29
|
+
&:hover {
|
|
30
|
+
cursor: pointer;
|
|
31
|
+
filter: drop-shadow(0 -2px 4px rgba(21, 26, 48, 0.25));
|
|
32
|
+
}
|
|
33
|
+
`;
|
|
34
34
|
const textChartCSS = css`
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
text-anchor: middle;
|
|
36
|
+
${typography.paragraph3};
|
|
37
|
+
`; // End create css in Component
|
|
38
38
|
// Create variable to calculate
|
|
39
39
|
|
|
40
40
|
const round = n => {
|
|
@@ -274,7 +274,8 @@ const Bars = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
274
274
|
};
|
|
275
275
|
|
|
276
276
|
return hoverTooltip ? jsx("g", {
|
|
277
|
-
className: 'DGN-CUI-Bar'
|
|
277
|
+
className: 'DGN-CUI-Bar',
|
|
278
|
+
ref: ref
|
|
278
279
|
}, data.map((point, i) => {
|
|
279
280
|
return jsx("g", {
|
|
280
281
|
key: i,
|
|
@@ -295,7 +296,8 @@ const Bars = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
295
296
|
onClick: handleChange
|
|
296
297
|
}), getPlacement(point, i));
|
|
297
298
|
})) : jsx("g", {
|
|
298
|
-
className: 'DGN-CUI-Bar'
|
|
299
|
+
className: 'DGN-CUI-Bar',
|
|
300
|
+
ref: ref
|
|
299
301
|
}, data.map((point, i) => {
|
|
300
302
|
return jsx("g", {
|
|
301
303
|
key: i,
|