diginet-core-ui 1.3.24 → 1.3.29
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/assets/fonts/SF-Pro-Display-Bold.otf +0 -0
- package/assets/fonts/SF-Pro-Display-Medium.otf +0 -0
- package/assets/fonts/SF-Pro-Display-Regular.otf +0 -0
- package/assets/images/icons/wifi.svg +3 -0
- package/assets/images/menu/dhr/MHRM09N0004.svg +14 -0
- package/assets/images/menu/dhr/MHRP09N0028.svg +6 -0
- package/assets/images/menu/dhr/MHRP09N0029.svg +14 -0
- package/assets/images/menu/dhr/MHRP09N0030.svg +4 -0
- package/assets/images/menu/dhr/MHRP09N0031.svg +5 -0
- package/assets/images/menu/dhr/MHRP29N0012.svg +7 -0
- package/assets/images/menu/dhr/MHRP29N0021.svg +8 -0
- package/assets/images/menu/dhr/MHRP29N0022.svg +9 -0
- package/assets/images/menu/dhr/MHRP29N0023.svg +22 -0
- package/assets/images/menu/dhr/MHRP39N0015.svg +5 -0
- package/assets/images/menu/dhr/TASK.svg +9 -0
- package/assets/images/menu/erp/D05.svg +8 -0
- package/assets/images/menu/erp/D06.svg +4 -0
- package/assets/images/menu/erp/D90R.svg +9 -0
- package/assets/images/menu/erp/DBC.svg +9 -0
- package/assets/images/menu/erp/{W05F0006.svg → W05F0006N0000.svg} +0 -0
- package/assets/images/menu/erp/{W05F0008.svg → W05F0008N0000.svg} +0 -0
- package/assets/images/menu/erp/{W05F4000.svg → W05F4000N0000.svg} +0 -0
- package/assets/images/menu/erp/{W06F0005.svg → W06F0005N0000.svg} +0 -0
- package/assets/images/menu/erp/{W06F0006.svg → W06F0006N0000.svg} +0 -0
- package/assets/images/menu/erp/{W06F0008.svg → W06F0008N0000.svg} +0 -0
- package/assets/images/menu/erp/W94F1000N0000.svg +9 -0
- package/assets/images/menu/erp/W94F1000N0001.svg +9 -0
- package/components/accordion/css.js +42 -33
- package/components/accordion/details.js +29 -17
- package/components/accordion/group.js +23 -23
- package/components/accordion/index.js +36 -27
- package/components/accordion/summary.js +10 -11
- package/components/alert/index.js +97 -91
- package/components/alert/notify.js +10 -8
- package/components/avatar/index.js +19 -17
- package/components/badge/index.js +122 -139
- package/components/button/icon.js +242 -334
- package/components/button/index.js +272 -427
- package/components/button/more.js +4 -5
- package/components/button/ripple-effect.js +4 -6
- package/components/card/body-card.js +4 -6
- package/components/card/card.js +4 -8
- package/components/card/index.js +4 -5
- package/components/chart/Pie/Sector.js +4 -5
- package/components/chart/Pie/Sectors.js +5 -5
- package/components/chart/Pie/index.js +8 -9
- package/components/chart/Pie-v2/Sector.js +4 -5
- package/components/chart/Pie-v2/Sectors.js +7 -8
- package/components/chart/Pie-v2/index.js +11 -16
- package/components/chart/bar/Bar.js +2 -3
- package/components/chart/bar/Labels.js +9 -11
- package/components/chart/bar/index.js +17 -9
- package/components/chart/bar-v2/Bar.js +2 -3
- package/components/chart/bar-v2/Labels.js +9 -11
- package/components/chart/bar-v2/index.js +17 -9
- package/components/chart/line/Labels.js +8 -10
- package/components/chart/line/Point.js +2 -3
- package/components/chart/line/index.js +17 -9
- package/components/chart/line-v2/Labels.js +8 -10
- package/components/chart/line-v2/Point.js +2 -3
- package/components/chart/line-v2/index.js +17 -9
- package/components/chip/attach.js +12 -16
- package/components/chip/index.js +8 -11
- package/components/collapse/index.js +4 -5
- package/components/divider/index.js +27 -14
- package/components/form-control/attachment/index.js +143 -87
- package/components/form-control/calendar/function.js +24 -23
- package/components/form-control/calendar/index.js +2 -4
- package/components/form-control/calendar/range.js +3 -4
- package/components/form-control/checkbox/index.js +85 -71
- package/components/form-control/control/index.js +4 -6
- package/components/form-control/date-picker/index-old.js +0 -2
- package/components/form-control/date-picker/index.js +39 -43
- package/components/form-control/date-range-picker/index.js +26 -28
- package/components/form-control/dropdown/index.js +173 -202
- package/components/form-control/dropdown-box/index.js +72 -49
- package/components/form-control/form-group/index.js +4 -5
- package/components/form-control/helper-text/index.js +4 -5
- package/components/form-control/input-base/index.js +28 -38
- package/components/form-control/label/index.js +23 -13
- package/components/form-control/money-input/index.js +6 -6
- package/components/form-control/number-input/index.js +12 -14
- package/components/form-control/phone-input/index.js +4 -5
- package/components/form-control/radio/index.js +7 -15
- package/components/form-control/text-input/index.js +14 -24
- package/components/form-control/time-picker/index.js +15 -26
- package/components/form-control/time-picker/swiper.js +2 -4
- package/components/form-control/toggle/index.js +22 -18
- package/components/form-view/helper-text.js +4 -5
- package/components/form-view/index.js +4 -5
- package/components/form-view/input.js +5 -7
- package/components/form-view/label.js +2 -6
- package/components/list/list-item-action.js +7 -8
- package/components/list/list-item-icon.js +4 -5
- package/components/list/list-item-text.js +4 -5
- package/components/list/list-item.js +4 -5
- package/components/list/list.js +4 -5
- package/components/list/sub-header.js +4 -5
- package/components/modal/body.js +4 -6
- package/components/modal/footer.js +4 -6
- package/components/modal/header.js +8 -14
- package/components/modal/index.js +4 -5
- package/components/modal/modal.js +6 -13
- package/components/others/extra/index.js +4 -8
- package/components/others/option-wrapper/index.js +57 -0
- package/components/others/scrollbar/index.js +4 -5
- package/components/paging/page-info.js +282 -231
- package/components/paging/page-selector.js +4 -7
- package/components/popover/index.js +6 -7
- package/components/popup/danger_popup.js +8 -18
- package/components/popup/index.js +26 -34
- package/components/popup/proposals_popup.js +9 -16
- package/components/popup/v2/danger-popup.js +4 -6
- package/components/popup/v2/index.js +116 -98
- package/components/popup/v2/info-popup.js +4 -6
- package/components/popup/v2/success-popup.js +4 -6
- package/components/popup/v2/warning-popup.js +4 -6
- package/components/popup/v2/yes-no-popup.js +4 -6
- package/components/progress/circular.js +17 -26
- package/components/progress/linear.js +11 -13
- package/components/rating/index.js +114 -233
- package/components/slider/slider-container.js +15 -10
- package/components/slider/slider-item.js +10 -12
- package/components/status/index.js +63 -57
- package/components/tab/tab-container.js +26 -24
- package/components/tab/tab-header.js +36 -27
- package/components/tab/tab-panel.js +32 -15
- package/components/tab/tab.js +79 -80
- package/components/tooltip/index.js +4 -4
- package/components/transfer/index.js +10 -11
- package/components/tree-view/css.js +2 -0
- package/components/tree-view/index.js +14 -13
- package/components/typography/index.js +6 -112
- package/css/styles.css +1 -1
- package/css/styles.css.map +1 -1
- package/global/index.js +2 -0
- package/icons/basic.js +1648 -959
- package/icons/effect.js +45 -103
- package/package.json +1 -1
- package/readme.md +66 -0
- package/styles/color-helper.js +7 -146
- package/styles/colors.js +6 -2
- package/styles/font.js +9 -0
- package/styles/general.js +100 -7
- package/styles/typography.js +25 -26
- package/theme/settings.js +9 -2
- package/theme/theme-provider.js +15 -7
- package/theme/with-styles.js +2 -4
- package/theme/with-theme.js +2 -4
- package/utils/isMobile.js +21 -0
- package/utils/renderHTML.js +4 -5
- package/utils/renderIcon.js +15 -11
- package/utils/updatePosition.js +2 -2
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
|
|
3
1
|
/** @jsxRuntime classic */
|
|
4
2
|
|
|
5
3
|
/** @jsx jsx */
|
|
@@ -68,13 +66,14 @@ const ButtonMore = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
68
66
|
return jsx("div", {
|
|
69
67
|
css: ButtonMoreStyle,
|
|
70
68
|
ref: ref
|
|
71
|
-
}, jsx(Button,
|
|
69
|
+
}, jsx(Button, {
|
|
72
70
|
viewType: viewType,
|
|
73
71
|
color: color,
|
|
74
72
|
size: size,
|
|
75
73
|
disabled: disabled,
|
|
76
|
-
loading: loading
|
|
77
|
-
|
|
74
|
+
loading: loading,
|
|
75
|
+
...props
|
|
76
|
+
}), jsx(Icon, {
|
|
78
77
|
viewType: viewType,
|
|
79
78
|
color: color,
|
|
80
79
|
size: size,
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
|
|
3
1
|
/** @jsxRuntime classic */
|
|
4
2
|
|
|
5
3
|
/** @jsx jsx */
|
|
@@ -65,11 +63,11 @@ const Ripple = ({
|
|
|
65
63
|
setRippleArray(prevState => [...prevState, newRippleArray]);
|
|
66
64
|
};
|
|
67
65
|
|
|
68
|
-
return jsx("span",
|
|
69
|
-
css: RippleContainer
|
|
70
|
-
|
|
66
|
+
return jsx("span", {
|
|
67
|
+
css: RippleContainer,
|
|
68
|
+
...props,
|
|
71
69
|
onMouseDown: addRipple
|
|
72
|
-
}
|
|
70
|
+
}, rippleArray.length > 0 && rippleArray.map((ripple, index) => {
|
|
73
71
|
return jsx("span", {
|
|
74
72
|
key: 'ripple_' + index,
|
|
75
73
|
style: {
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
|
|
3
1
|
/** @jsxRuntime classic */
|
|
4
2
|
|
|
5
3
|
/** @jsx jsx */
|
|
@@ -46,12 +44,12 @@ const CardBody = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
46
44
|
useEffect(() => {
|
|
47
45
|
!!refs && refs(ref);
|
|
48
46
|
}, []);
|
|
49
|
-
const Body = useMemo(() => jsx("div",
|
|
50
|
-
css: CardBodyBox
|
|
51
|
-
|
|
47
|
+
const Body = useMemo(() => jsx("div", {
|
|
48
|
+
css: CardBodyBox,
|
|
49
|
+
...props,
|
|
52
50
|
style: style,
|
|
53
51
|
ref: ref
|
|
54
|
-
}
|
|
52
|
+
}, children), [children, style]);
|
|
55
53
|
return Body;
|
|
56
54
|
}));
|
|
57
55
|
CardBody.propTypes = {
|
package/components/card/card.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
|
|
3
1
|
/** @jsxRuntime classic */
|
|
4
2
|
|
|
5
3
|
/** @jsx jsx */
|
|
@@ -8,7 +6,6 @@ import { createPortal } from 'react-dom';
|
|
|
8
6
|
import PropTypes from 'prop-types';
|
|
9
7
|
import { jsx, css } from '@emotion/core';
|
|
10
8
|
import CardContext from './context';
|
|
11
|
-
import theme from '../../theme/settings';
|
|
12
9
|
const Card = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
13
10
|
open,
|
|
14
11
|
type,
|
|
@@ -46,7 +43,6 @@ const Card = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
46
43
|
height: max-content;
|
|
47
44
|
width: ${isNaN(width) ? width : width + 'px'};
|
|
48
45
|
flex-direction: column;
|
|
49
|
-
font-family: ${theme.typography.fontFamily};
|
|
50
46
|
-webkit-box-orient: vertical;
|
|
51
47
|
-webkit-box-direction: normal;
|
|
52
48
|
/* min-height: 152px; */
|
|
@@ -73,12 +69,12 @@ const Card = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
73
69
|
const CardView = useMemo(() => {
|
|
74
70
|
const node = jsx("div", {
|
|
75
71
|
className: 'DGN-UI-Card'
|
|
76
|
-
}, jsx("div",
|
|
72
|
+
}, jsx("div", {
|
|
77
73
|
css: CardBox,
|
|
78
|
-
ref: cardBoxRef
|
|
79
|
-
|
|
74
|
+
ref: cardBoxRef,
|
|
75
|
+
...props,
|
|
80
76
|
style: style
|
|
81
|
-
}
|
|
77
|
+
}, jsx(CardContext.Provider, {
|
|
82
78
|
value: {
|
|
83
79
|
show: onShowCard,
|
|
84
80
|
close: onCloseCard
|
package/components/card/index.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
|
|
3
1
|
import React, { memo, useEffect, useRef, forwardRef } from 'react';
|
|
4
2
|
import PropTypes from 'prop-types';
|
|
5
3
|
import Card from './card';
|
|
@@ -18,10 +16,11 @@ const Popup = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
18
16
|
useEffect(() => {
|
|
19
17
|
if (refs) refs(ref);
|
|
20
18
|
}, []);
|
|
21
|
-
return /*#__PURE__*/React.createElement(Card,
|
|
19
|
+
return /*#__PURE__*/React.createElement(Card, {
|
|
22
20
|
ref: ref,
|
|
23
|
-
style: style
|
|
24
|
-
|
|
21
|
+
style: style,
|
|
22
|
+
...props
|
|
23
|
+
}, /*#__PURE__*/React.createElement(BodyCard, {
|
|
25
24
|
style: bodyStyle
|
|
26
25
|
}, children));
|
|
27
26
|
}));
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
|
|
3
1
|
/** @jsxRuntime classic */
|
|
4
2
|
|
|
5
3
|
/** @jsx jsx */
|
|
@@ -66,7 +64,7 @@ const Sector = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
66
64
|
|
|
67
65
|
const content = jsx("g", {
|
|
68
66
|
css: SectorCSS
|
|
69
|
-
}, jsx("path",
|
|
67
|
+
}, jsx("path", {
|
|
70
68
|
d: path,
|
|
71
69
|
fill: fill,
|
|
72
70
|
ref: pathRef,
|
|
@@ -77,8 +75,9 @@ const Sector = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
77
75
|
onTouchStart: onTouchStart,
|
|
78
76
|
onTouchEnd: onTouchEnd,
|
|
79
77
|
onMouseEnter: onMouseEnter,
|
|
80
|
-
onMouseLeave: onMouseLeave
|
|
81
|
-
|
|
78
|
+
onMouseLeave: onMouseLeave,
|
|
79
|
+
...props
|
|
80
|
+
}, renderSelectedItem ? Data() : name && jsx("title", null, name, ": ", quantity)));
|
|
82
81
|
|
|
83
82
|
if (href) {
|
|
84
83
|
result = jsx("a", {
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
|
|
3
1
|
/** @jsxRuntime classic */
|
|
4
2
|
|
|
5
3
|
/** @jsx jsx */
|
|
@@ -41,7 +39,7 @@ const Sectors = ({
|
|
|
41
39
|
z
|
|
42
40
|
`;
|
|
43
41
|
angleEnd += angleMargin;
|
|
44
|
-
return jsx(Sector,
|
|
42
|
+
return jsx(Sector, {
|
|
45
43
|
key: "sector" + i,
|
|
46
44
|
fill: d.color,
|
|
47
45
|
path: path,
|
|
@@ -52,8 +50,10 @@ const Sectors = ({
|
|
|
52
50
|
onMouseEnter: e => onSectorHover(d, i, e),
|
|
53
51
|
onMouseLeave: e => onSectorHover(null, null, e),
|
|
54
52
|
onTouchEnd: e => onSectorHover(null, null, e),
|
|
55
|
-
onTouchStart: e => onSectorHover(d, i, e)
|
|
56
|
-
|
|
53
|
+
onTouchStart: e => onSectorHover(d, i, e),
|
|
54
|
+
...props,
|
|
55
|
+
...d
|
|
56
|
+
});
|
|
57
57
|
})) : null;
|
|
58
58
|
};
|
|
59
59
|
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
|
|
3
1
|
/** @jsxRuntime classic */
|
|
4
2
|
|
|
5
3
|
/** @jsx jsx */
|
|
@@ -118,31 +116,32 @@ const PieChart = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
118
116
|
};
|
|
119
117
|
|
|
120
118
|
const renderSingleData = (d, center) => {
|
|
121
|
-
return jsx(Circle,
|
|
119
|
+
return jsx(Circle, {
|
|
122
120
|
center: center,
|
|
123
121
|
radius: center + (d.expanded || expandOnHover && expandedIndex === 0 ? expandSize : 0),
|
|
124
122
|
color: d.color,
|
|
125
123
|
onMouseEnter: e => handleSectorHover(d, 0, e),
|
|
126
124
|
onMouseLeave: e => handleSectorHover(null, null, e),
|
|
127
125
|
onTouchEnd: e => handleSectorHover(null, null, e),
|
|
128
|
-
onTouchStart: e => handleSectorHover(d, 0, e)
|
|
129
|
-
|
|
126
|
+
onTouchStart: e => handleSectorHover(d, 0, e),
|
|
127
|
+
...d
|
|
128
|
+
});
|
|
130
129
|
};
|
|
131
130
|
|
|
132
131
|
const renderMultipleData = center => {
|
|
133
|
-
return jsx(Sectors,
|
|
132
|
+
return jsx(Sectors, {
|
|
134
133
|
center: center,
|
|
135
134
|
data: expandOnHover ? data.map((d, i) => ({ ...d,
|
|
136
135
|
expanded: `${isExpanded ? i === expandedIndex.current : i === props.expandedIndex}`
|
|
137
136
|
})) : data.map((d, i) => ({ ...d,
|
|
138
137
|
expanded: `${i === props.expandedIndex}`
|
|
139
|
-
}))
|
|
140
|
-
|
|
138
|
+
})),
|
|
139
|
+
...props,
|
|
141
140
|
expandSize: expandSize,
|
|
142
141
|
expandOnHover: expandOnHover,
|
|
143
142
|
renderSelectedItem: renderSelectedItem,
|
|
144
143
|
onSectorHover: handleSectorHover
|
|
145
|
-
})
|
|
144
|
+
});
|
|
146
145
|
};
|
|
147
146
|
|
|
148
147
|
useEffect(() => {
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
|
|
3
1
|
/** @jsxRuntime classic */
|
|
4
2
|
|
|
5
3
|
/** @jsx jsx */
|
|
@@ -50,7 +48,7 @@ const Sector = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
50
48
|
transition-timing-function: ${transitionTimingFunction};
|
|
51
49
|
transition-duration: ${transitionDuration};
|
|
52
50
|
`;
|
|
53
|
-
const content = jsx("path",
|
|
51
|
+
const content = jsx("path", {
|
|
54
52
|
d: path,
|
|
55
53
|
fill: fill,
|
|
56
54
|
ref: pathRef,
|
|
@@ -62,8 +60,9 @@ const Sector = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
62
60
|
onTouchStart: onTouchStart,
|
|
63
61
|
onTouchEnd: onTouchEnd,
|
|
64
62
|
onMouseEnter: onMouseEnter,
|
|
65
|
-
onMouseLeave: onMouseLeave
|
|
66
|
-
|
|
63
|
+
onMouseLeave: onMouseLeave,
|
|
64
|
+
...props
|
|
65
|
+
}, renderSelectedItem);
|
|
67
66
|
|
|
68
67
|
if (href) {
|
|
69
68
|
result = jsx("a", {
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
|
|
3
1
|
/** @jsxRuntime classic */
|
|
4
2
|
|
|
5
3
|
/** @jsx jsx */
|
|
@@ -8,8 +6,8 @@ import PropTypes from "prop-types";
|
|
|
8
6
|
import Sector from "./Sector";
|
|
9
7
|
import ReactDOMServer from 'react-dom/server';
|
|
10
8
|
import { jsx, css } from '@emotion/core';
|
|
11
|
-
import theme from '../../../theme/settings';
|
|
12
9
|
import { randomString, parseTextToHTML } from '../../../utils';
|
|
10
|
+
import { typography } from "../../../styles/typography";
|
|
13
11
|
|
|
14
12
|
const Sectors = ({
|
|
15
13
|
center,
|
|
@@ -76,8 +74,7 @@ const Sectors = ({
|
|
|
76
74
|
`;
|
|
77
75
|
const textChartCSS = css`
|
|
78
76
|
text-anchor: middle;
|
|
79
|
-
|
|
80
|
-
font-family: ${theme.typography.fontFamily};
|
|
77
|
+
${typography.paragraph1};
|
|
81
78
|
stroke-dasharray: 1000;
|
|
82
79
|
stroke-dashoffset: 1000;
|
|
83
80
|
animation: draw 8s ease-in-out forwards;
|
|
@@ -168,7 +165,7 @@ const Sectors = ({
|
|
|
168
165
|
return jsx("g", {
|
|
169
166
|
key: i,
|
|
170
167
|
id: "sector" + i
|
|
171
|
-
}, jsx(Sector,
|
|
168
|
+
}, jsx(Sector, {
|
|
172
169
|
key: "sector" + i,
|
|
173
170
|
fill: d.color,
|
|
174
171
|
path: path,
|
|
@@ -181,8 +178,10 @@ const Sectors = ({
|
|
|
181
178
|
onTouchEnd: e => onSectorHover(null, null, e),
|
|
182
179
|
onTouchStart: e => onSectorHover(d, i, e),
|
|
183
180
|
x: x + 15,
|
|
184
|
-
y: y + 16
|
|
185
|
-
|
|
181
|
+
y: y + 16,
|
|
182
|
+
...props,
|
|
183
|
+
...d
|
|
184
|
+
}), getPath(d, i));
|
|
186
185
|
})) : null;
|
|
187
186
|
};
|
|
188
187
|
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
|
|
3
1
|
/** @jsxRuntime classic */
|
|
4
2
|
|
|
5
3
|
/** @jsx jsx */
|
|
6
4
|
import { useState, useRef, memo, forwardRef } from 'react';
|
|
7
5
|
import PropTypes from "prop-types";
|
|
8
|
-
import theme from '../../../theme/settings';
|
|
9
6
|
import { jsx, css } from '@emotion/core';
|
|
10
7
|
import Typography from '../../typography';
|
|
11
8
|
import { randomString } from '../../../utils';
|
|
9
|
+
import { typography } from "../../../styles/typography";
|
|
12
10
|
import Circle from "./Circle";
|
|
13
11
|
import Sectors from "./Sectors";
|
|
14
12
|
import Sector from "./Sector";
|
|
@@ -78,11 +76,8 @@ const PieChart = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
78
76
|
display: block;
|
|
79
77
|
margin: 0 auto;
|
|
80
78
|
overflow:hidden;
|
|
81
|
-
line-height:normal;
|
|
82
79
|
-webkit-tap-highlight-color:rgba(0, 0, 0, 0);
|
|
83
|
-
|
|
84
|
-
-moz-user-select:none;
|
|
85
|
-
-webkit-user-select:none;
|
|
80
|
+
user-select: none;
|
|
86
81
|
`;
|
|
87
82
|
const Pie = Donut ? css`
|
|
88
83
|
position: relative;
|
|
@@ -109,8 +104,7 @@ const PieChart = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
109
104
|
`;
|
|
110
105
|
const dataCSS = css`
|
|
111
106
|
fill:rgba(0,0,0,0.54);
|
|
112
|
-
|
|
113
|
-
font-family: ${theme.typography.fontFamily};
|
|
107
|
+
${typography.paragraph1};
|
|
114
108
|
cursor:default;
|
|
115
109
|
`;
|
|
116
110
|
const padding1 = ZoomIn() / 10;
|
|
@@ -155,31 +149,32 @@ const PieChart = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
155
149
|
};
|
|
156
150
|
|
|
157
151
|
const renderSingleData = (d, center) => {
|
|
158
|
-
return jsx(Circle,
|
|
152
|
+
return jsx(Circle, {
|
|
159
153
|
center: center,
|
|
160
154
|
radius: center + (d.expanded || expandOnHover && expandedIndex === 0 ? expandSize : 0),
|
|
161
155
|
color: d.color,
|
|
162
156
|
onMouseEnter: e => handleSectorHover(d, 0, e),
|
|
163
157
|
onMouseLeave: e => handleSectorHover(null, null, e),
|
|
164
158
|
onTouchEnd: e => handleSectorHover(null, null, e),
|
|
165
|
-
onTouchStart: e => handleSectorHover(d, 0, e)
|
|
166
|
-
|
|
159
|
+
onTouchStart: e => handleSectorHover(d, 0, e),
|
|
160
|
+
...d
|
|
161
|
+
});
|
|
167
162
|
};
|
|
168
163
|
|
|
169
164
|
const renderMultipleData = center => {
|
|
170
|
-
return jsx(Sectors,
|
|
165
|
+
return jsx(Sectors, {
|
|
171
166
|
center: center,
|
|
172
167
|
data: expandOnHover ? data.map((d, i) => ({ ...d,
|
|
173
168
|
expanded: `${isExpanded ? i === expandedIndex.current : i === props.expandedIndex}`
|
|
174
169
|
})) : data.map((d, i) => ({ ...d,
|
|
175
170
|
expanded: `${i === props.expandedIndex}`
|
|
176
|
-
}))
|
|
177
|
-
|
|
171
|
+
})),
|
|
172
|
+
...props,
|
|
178
173
|
expandSize: expandSize,
|
|
179
174
|
expandOnHover: expandOnHover,
|
|
180
175
|
renderSelectedItem: renderSelectedItem,
|
|
181
176
|
onSectorHover: handleSectorHover
|
|
182
|
-
})
|
|
177
|
+
});
|
|
183
178
|
};
|
|
184
179
|
|
|
185
180
|
return jsx("div", {
|
|
@@ -5,7 +5,7 @@ import { memo, useRef, forwardRef, useEffect } from 'react';
|
|
|
5
5
|
import { css, jsx } from '@emotion/core';
|
|
6
6
|
import PropTypes from "prop-types";
|
|
7
7
|
import Labels from "./Labels";
|
|
8
|
-
import
|
|
8
|
+
import { typography } from "../../../styles/typography";
|
|
9
9
|
const Bars = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
10
10
|
barsOpacity,
|
|
11
11
|
barsMargin,
|
|
@@ -33,8 +33,7 @@ const Bars = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
33
33
|
`;
|
|
34
34
|
const textChartCSS = css`
|
|
35
35
|
text-anchor: middle;
|
|
36
|
-
|
|
37
|
-
font-family: ${theme.typography.fontFamily};
|
|
36
|
+
${typography.paragraph3};
|
|
38
37
|
`; // End create css in Component
|
|
39
38
|
// Create variable to calculate
|
|
40
39
|
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import PropTypes from "prop-types";
|
|
5
5
|
import { jsx, css } from '@emotion/core';
|
|
6
6
|
import theme from '../../../theme/settings';
|
|
7
|
+
import { typography } from '../../../styles/typography';
|
|
7
8
|
|
|
8
9
|
const Labels = ({
|
|
9
10
|
getX,
|
|
@@ -23,7 +24,6 @@ const Labels = ({
|
|
|
23
24
|
minX,
|
|
24
25
|
unitWidth
|
|
25
26
|
}) => {
|
|
26
|
-
const FONT_SIZE = 12;
|
|
27
27
|
const labelContainerCSS = css`
|
|
28
28
|
transform: translate(0, ${labelsOffsetX}px);
|
|
29
29
|
`;
|
|
@@ -35,8 +35,7 @@ const Labels = ({
|
|
|
35
35
|
const LabelCSS = labelStyle === 'italic' ? css`
|
|
36
36
|
fill: ${theme.colors.secondary};
|
|
37
37
|
text-anchor: start;
|
|
38
|
-
|
|
39
|
-
font-family: ${theme.typography.fontFamily};
|
|
38
|
+
${typography.paragraph3};
|
|
40
39
|
text-transform: capitalize;
|
|
41
40
|
cursor: pointer;
|
|
42
41
|
display: inline-block;
|
|
@@ -45,13 +44,17 @@ const Labels = ({
|
|
|
45
44
|
` : css`
|
|
46
45
|
color: ${theme.colors.secondary};
|
|
47
46
|
text-anchor: middle;
|
|
48
|
-
|
|
49
|
-
font-family: ${theme.typography.fontFamily};
|
|
47
|
+
${typography.paragraph3};
|
|
50
48
|
text-transform: capitalize;
|
|
51
49
|
cursor: pointer;
|
|
52
50
|
display: inline-block;
|
|
53
51
|
word-break: break-word;
|
|
54
52
|
`;
|
|
53
|
+
const TextCSS = css`
|
|
54
|
+
${typography.paragraph3};
|
|
55
|
+
fill: ${theme.colors.secondary};
|
|
56
|
+
cursor: 'pointer';
|
|
57
|
+
`;
|
|
55
58
|
|
|
56
59
|
if (labelsVisible) {
|
|
57
60
|
let xLabels;
|
|
@@ -98,12 +101,7 @@ const Labels = ({
|
|
|
98
101
|
y: getY(quantity) + labelsHeightX / 3,
|
|
99
102
|
transform: `translate(-${labelsOffsetY}, 0)`,
|
|
100
103
|
textAnchor: "end",
|
|
101
|
-
|
|
102
|
-
fill: theme.colors.secondary,
|
|
103
|
-
fontSize: FONT_SIZE,
|
|
104
|
-
cursor: 'pointer',
|
|
105
|
-
fontFamily: theme.typography.fontFamily
|
|
106
|
-
}
|
|
104
|
+
css: TextCSS
|
|
107
105
|
}, labelsFormatY(quantity)));
|
|
108
106
|
return jsx("g", {
|
|
109
107
|
className: 'DGN-Labels-BarChart'
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
|
|
3
1
|
/** @jsxRuntime classic */
|
|
4
2
|
|
|
5
3
|
/** @jsx jsx */
|
|
@@ -97,15 +95,25 @@ const BarChart = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
97
95
|
overflow: 'visible',
|
|
98
96
|
margin: `${getLabelsYWidth() * 2}`
|
|
99
97
|
}
|
|
100
|
-
}, jsx(Axis,
|
|
98
|
+
}, jsx(Axis, { ...props,
|
|
99
|
+
...commonProps
|
|
100
|
+
}), jsx(Grid, { ...props,
|
|
101
|
+
...commonProps
|
|
102
|
+
}), jsx(Bars, {
|
|
103
|
+
data: dataSource,
|
|
104
|
+
viewBoxWidth: viewBoxWidth,
|
|
105
|
+
...props,
|
|
106
|
+
...commonProps
|
|
107
|
+
}), jsx(Labels, {
|
|
101
108
|
data: dataSource,
|
|
102
|
-
viewBoxWidth: viewBoxWidth
|
|
103
|
-
|
|
109
|
+
viewBoxWidth: viewBoxWidth,
|
|
110
|
+
...props,
|
|
111
|
+
...commonProps
|
|
112
|
+
}), jsx(Points, {
|
|
104
113
|
data: dataSource,
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}, props, commonProps)));
|
|
114
|
+
...props,
|
|
115
|
+
...commonProps
|
|
116
|
+
}));
|
|
109
117
|
}));
|
|
110
118
|
BarChart.defaultProps = {
|
|
111
119
|
data: [],
|
|
@@ -5,8 +5,8 @@ import { memo, useRef, forwardRef, useState } from 'react';
|
|
|
5
5
|
import { css, jsx } from '@emotion/core';
|
|
6
6
|
import PropTypes from "prop-types";
|
|
7
7
|
import Labels from "./Labels";
|
|
8
|
-
import theme from '../../../theme/settings';
|
|
9
8
|
import { randomString } from '../../../utils';
|
|
9
|
+
import { typography } from "../../../styles/typography";
|
|
10
10
|
const Bars = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
11
11
|
barsOpacity,
|
|
12
12
|
barsMargin,
|
|
@@ -42,8 +42,7 @@ const Bars = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
42
42
|
`;
|
|
43
43
|
const textChartCSS = css`
|
|
44
44
|
text-anchor: middle;
|
|
45
|
-
|
|
46
|
-
font-family: ${theme.typography.fontFamily};
|
|
45
|
+
${typography.paragraph3};
|
|
47
46
|
`; // End create css in Component
|
|
48
47
|
// Create variable to calculate
|
|
49
48
|
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import PropTypes from "prop-types";
|
|
5
5
|
import { jsx, css } from '@emotion/core';
|
|
6
6
|
import theme from '../../../theme/settings';
|
|
7
|
+
import { typography } from "../../../styles/typography";
|
|
7
8
|
|
|
8
9
|
const Labels = ({
|
|
9
10
|
getX,
|
|
@@ -23,7 +24,6 @@ const Labels = ({
|
|
|
23
24
|
minX,
|
|
24
25
|
unitWidth
|
|
25
26
|
}) => {
|
|
26
|
-
const FONT_SIZE = 12;
|
|
27
27
|
const labelContainerCSS = css`
|
|
28
28
|
transform: translate(0, ${labelsOffsetX}px);
|
|
29
29
|
`;
|
|
@@ -35,8 +35,7 @@ const Labels = ({
|
|
|
35
35
|
const LabelCSS = labelStyle === 'italic' ? css`
|
|
36
36
|
fill: ${theme.colors.secondary};
|
|
37
37
|
text-anchor: start;
|
|
38
|
-
|
|
39
|
-
font-family: ${theme.typography.fontFamily};
|
|
38
|
+
${typography.paragraph3};
|
|
40
39
|
text-transform: capitalize;
|
|
41
40
|
cursor: pointer;
|
|
42
41
|
display: inline-block;
|
|
@@ -45,13 +44,17 @@ const Labels = ({
|
|
|
45
44
|
` : css`
|
|
46
45
|
color: ${theme.colors.secondary};
|
|
47
46
|
text-anchor: middle;
|
|
48
|
-
|
|
49
|
-
font-family: ${theme.typography.fontFamily};
|
|
47
|
+
${typography.paragraph3};
|
|
50
48
|
text-transform: capitalize;
|
|
51
49
|
cursor: pointer;
|
|
52
50
|
display: inline-block;
|
|
53
51
|
word-break: break-word;
|
|
54
52
|
`;
|
|
53
|
+
const TextCSS = css`
|
|
54
|
+
${typography.paragraph3};
|
|
55
|
+
fill: ${theme.colors.secondary};
|
|
56
|
+
cursor: 'pointer';
|
|
57
|
+
`;
|
|
55
58
|
|
|
56
59
|
if (labelsVisible) {
|
|
57
60
|
let xLabels;
|
|
@@ -98,12 +101,7 @@ const Labels = ({
|
|
|
98
101
|
y: getY(quantity) + labelsHeightX / 3,
|
|
99
102
|
transform: `translate(-${labelsOffsetY}, 0)`,
|
|
100
103
|
textAnchor: "end",
|
|
101
|
-
|
|
102
|
-
fill: theme.colors.secondary,
|
|
103
|
-
fontSize: FONT_SIZE,
|
|
104
|
-
cursor: 'pointer',
|
|
105
|
-
fontFamily: theme.typography.fontFamily
|
|
106
|
-
}
|
|
104
|
+
css: TextCSS
|
|
107
105
|
}, labelsFormatY(quantity)));
|
|
108
106
|
return jsx("g", {
|
|
109
107
|
className: 'DGN-Labels-BarChart'
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
|
|
3
1
|
/** @jsxRuntime classic */
|
|
4
2
|
|
|
5
3
|
/** @jsx jsx */
|
|
@@ -97,15 +95,25 @@ const BarChart = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
97
95
|
overflow: 'visible',
|
|
98
96
|
margin: `${getLabelsYWidth() * 2}`
|
|
99
97
|
}
|
|
100
|
-
}, jsx(Axis,
|
|
98
|
+
}, jsx(Axis, { ...props,
|
|
99
|
+
...commonProps
|
|
100
|
+
}), jsx(Grid, { ...props,
|
|
101
|
+
...commonProps
|
|
102
|
+
}), jsx(Bars, {
|
|
103
|
+
data: dataSource,
|
|
104
|
+
viewBoxWidth: viewBoxWidth,
|
|
105
|
+
...props,
|
|
106
|
+
...commonProps
|
|
107
|
+
}), jsx(Labels, {
|
|
101
108
|
data: dataSource,
|
|
102
|
-
viewBoxWidth: viewBoxWidth
|
|
103
|
-
|
|
109
|
+
viewBoxWidth: viewBoxWidth,
|
|
110
|
+
...props,
|
|
111
|
+
...commonProps
|
|
112
|
+
}), jsx(Points, {
|
|
104
113
|
data: dataSource,
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}, props, commonProps)));
|
|
114
|
+
...props,
|
|
115
|
+
...commonProps
|
|
116
|
+
}));
|
|
109
117
|
}));
|
|
110
118
|
BarChart.defaultProps = {
|
|
111
119
|
data: [],
|