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,18 +1,32 @@
|
|
|
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
|
-
import { memo,
|
|
4
|
+
import { memo, useMemo, forwardRef, useRef } from 'react';
|
|
7
5
|
import PropTypes from 'prop-types';
|
|
8
6
|
import { jsx, css } from '@emotion/core';
|
|
9
7
|
import { Typography } from '../';
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
8
|
+
import Icon from '../../icons';
|
|
9
|
+
import { alignCenter, backgroundTransparent, borderBox, inlineFlex, justifyCenter } from '../../styles/general';
|
|
10
|
+
import { color as colors } from '../../styles/colors';
|
|
13
11
|
const {
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
system: {
|
|
13
|
+
active,
|
|
14
|
+
rest
|
|
15
|
+
},
|
|
16
|
+
semantic: {
|
|
17
|
+
success,
|
|
18
|
+
warning,
|
|
19
|
+
danger,
|
|
20
|
+
info
|
|
21
|
+
},
|
|
22
|
+
fill: {
|
|
23
|
+
sidebar
|
|
24
|
+
}
|
|
25
|
+
} = colors;
|
|
26
|
+
const colorMap = new Map([['default', rest], ['primary', active], ['success', success], ['warning', warning], ['danger', danger], ['info', info]]);
|
|
27
|
+
const iconSizeMap = new Map([['small', '16px'], ['medium', '20px'], ['large', '24px']]);
|
|
28
|
+
const typographySizeMap = new Map([['small', 'p3'], ['medium', 'p2'], ['large', 'p1']]);
|
|
29
|
+
const filledPaddingSizeMap = new Map([['small', '0px 8px'], ['medium', '0px 12px'], ['large', '0px 16px']]);
|
|
16
30
|
const Status = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
17
31
|
style,
|
|
18
32
|
viewType,
|
|
@@ -27,76 +41,68 @@ const Status = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
27
41
|
ref = useRef(null);
|
|
28
42
|
}
|
|
29
43
|
|
|
44
|
+
const outlinedPaddingSize = filledPaddingSizeMap.get(size);
|
|
45
|
+
|
|
46
|
+
const _color = colorMap.get(color);
|
|
47
|
+
|
|
48
|
+
const iconSize = iconSizeMap.get(size);
|
|
49
|
+
const typographySize = typographySizeMap.get(size);
|
|
30
50
|
const StatusRoot = css`
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
box-sizing: border-box;
|
|
38
|
-
white-space: nowrap;
|
|
51
|
+
${inlineFlex}
|
|
52
|
+
${alignCenter}
|
|
53
|
+
${justifyCenter}
|
|
54
|
+
${backgroundTransparent}
|
|
55
|
+
${borderBox}
|
|
56
|
+
min-height: ${iconSize};
|
|
39
57
|
margin: 0 5px;
|
|
58
|
+
color: ${_color || color || rest};
|
|
40
59
|
&.filled {
|
|
41
|
-
color:
|
|
42
|
-
background-color: ${
|
|
43
|
-
padding: 0 12px;
|
|
60
|
+
color: ${sidebar};
|
|
61
|
+
background-color: ${_color || color || rest};
|
|
44
62
|
border-radius: 12px;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
height: 16px;
|
|
48
|
-
padding: 0 8px;
|
|
49
|
-
svg {
|
|
50
|
-
width: 16px;
|
|
51
|
-
height: 16px;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
&.large {
|
|
55
|
-
height: 24px;
|
|
56
|
-
padding: 0 16px;
|
|
57
|
-
svg {
|
|
58
|
-
width: 24px;
|
|
59
|
-
height: 24px;
|
|
63
|
+
&.${size} {
|
|
64
|
+
padding: ${outlinedPaddingSize}
|
|
60
65
|
}
|
|
61
66
|
}
|
|
62
67
|
`;
|
|
68
|
+
const TextCSS = css`
|
|
69
|
+
white-space: nowrap;
|
|
70
|
+
`;
|
|
63
71
|
const StatusText = useMemo(() => jsx(Typography, {
|
|
64
|
-
|
|
72
|
+
css: TextCSS,
|
|
73
|
+
type: typographySize,
|
|
65
74
|
color: 'inherit'
|
|
66
|
-
}, text), [text]);
|
|
75
|
+
}, text), [text, size]);
|
|
67
76
|
const StatusIcon = useMemo(() => {
|
|
68
|
-
let
|
|
69
|
-
|
|
70
|
-
if (icon) {
|
|
71
|
-
if (typeof icon === 'string') {
|
|
72
|
-
const Icon = Icons[capitalize(icon)];
|
|
77
|
+
let node = icon;
|
|
73
78
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
82
|
-
iconEl = icon;
|
|
83
|
-
}
|
|
79
|
+
if (typeof node === 'string') {
|
|
80
|
+
node = jsx(Icon, {
|
|
81
|
+
name: node,
|
|
82
|
+
width: iconSize,
|
|
83
|
+
height: iconSize,
|
|
84
|
+
color: 'currentColor',
|
|
85
|
+
viewBox: true
|
|
86
|
+
});
|
|
84
87
|
}
|
|
85
88
|
|
|
86
|
-
return
|
|
89
|
+
return node;
|
|
87
90
|
}, [icon]);
|
|
88
|
-
return jsx("div",
|
|
91
|
+
return jsx("div", {
|
|
89
92
|
css: StatusRoot,
|
|
90
93
|
style: style,
|
|
91
|
-
className: [viewType, size, className].join(' '),
|
|
92
|
-
ref: ref
|
|
93
|
-
|
|
94
|
+
className: ['DGN-UI-Status', viewType, size, className].join(' ').trim().replace(/\s+/g, ' '),
|
|
95
|
+
ref: ref,
|
|
96
|
+
...props
|
|
97
|
+
}, StatusIcon, StatusText);
|
|
94
98
|
}));
|
|
95
99
|
Status.defaultProps = {
|
|
96
100
|
viewType: 'default',
|
|
97
101
|
text: '',
|
|
102
|
+
icon: '',
|
|
98
103
|
size: 'medium',
|
|
99
|
-
className: ''
|
|
104
|
+
className: '',
|
|
105
|
+
style: {}
|
|
100
106
|
};
|
|
101
107
|
Status.propTypes = {
|
|
102
108
|
/** type of status, has background or none */
|
|
@@ -1,21 +1,21 @@
|
|
|
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 React, { forwardRef, useState, memo, useEffect } from 'react';
|
|
7
5
|
import { jsx, css } from '@emotion/core';
|
|
8
|
-
import PropTypes
|
|
6
|
+
import PropTypes from 'prop-types';
|
|
9
7
|
import { randomString } from '../../utils';
|
|
10
8
|
import TabContext from './context';
|
|
11
9
|
import { isNumeric } from '../../utils/type';
|
|
12
10
|
import Typography from '../typography';
|
|
11
|
+
import { flexRow, positionRelative } from '../../styles/general';
|
|
13
12
|
const TabContainer = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
14
13
|
children,
|
|
15
14
|
tabIndex,
|
|
16
15
|
width,
|
|
17
16
|
direction,
|
|
18
17
|
level = 'level1',
|
|
18
|
+
className,
|
|
19
19
|
...props
|
|
20
20
|
}, ref) => {
|
|
21
21
|
const {
|
|
@@ -29,27 +29,21 @@ const TabContainer = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
29
29
|
useEffect(() => {
|
|
30
30
|
if (isNumeric(value)) setTabIndexState(value);else setTabIndexState(tabIndex);
|
|
31
31
|
}, [value, tabIndex]);
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
flex-direction: column;
|
|
36
|
-
`;
|
|
37
|
-
const TabButtonContainer = css`
|
|
38
|
-
display: ${direction === 'vertical' ? 'flex' : 'block'};
|
|
32
|
+
const TabContainer = css`
|
|
33
|
+
${flexRow}
|
|
34
|
+
${positionRelative}
|
|
39
35
|
flex-direction: ${direction === 'vertical' ? 'row' : 'column'};
|
|
40
|
-
position: relative;
|
|
41
36
|
width: ${isNaN(width) ? width : width + 'px'};
|
|
42
37
|
`;
|
|
43
38
|
if (level === 'level1') level = 'h3';
|
|
44
39
|
if (level === 'level2') level = 'p1';
|
|
45
40
|
return jsx("div", {
|
|
46
|
-
css:
|
|
47
|
-
|
|
48
|
-
css: TabButtonContainer,
|
|
49
|
-
className: `Tab-Container`,
|
|
41
|
+
css: TabContainer,
|
|
42
|
+
className: ['DGN-UI-Tab-Container', className].join(' ').trim().replace(/\s+/g, ' '),
|
|
50
43
|
id: `DGN-${id}-tab-button-container`,
|
|
51
|
-
ref: ref
|
|
52
|
-
|
|
44
|
+
ref: ref,
|
|
45
|
+
...props
|
|
46
|
+
}, jsx(TabContext.Provider, {
|
|
53
47
|
value: {
|
|
54
48
|
tabIndexState,
|
|
55
49
|
setTabIndexState,
|
|
@@ -57,27 +51,35 @@ const TabContainer = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
57
51
|
}
|
|
58
52
|
}, React.Children.map(children, child => /*#__PURE__*/React.cloneElement(child, {
|
|
59
53
|
level
|
|
60
|
-
}))))
|
|
54
|
+
}))));
|
|
61
55
|
}));
|
|
62
56
|
TabContainer.defaultProps = {
|
|
63
57
|
width: '100%',
|
|
64
58
|
direction: 'horizontal',
|
|
65
59
|
level: 'level1',
|
|
66
|
-
tabIndex: 0
|
|
60
|
+
tabIndex: 0,
|
|
61
|
+
className: '',
|
|
62
|
+
style: {}
|
|
67
63
|
};
|
|
68
64
|
const typesTypography = Typography.propTypes.type;
|
|
69
65
|
TabContainer.propTypes = {
|
|
70
|
-
width: oneOfType([number, string]),
|
|
71
|
-
tabIndex: number,
|
|
72
|
-
children: node,
|
|
66
|
+
width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
67
|
+
tabIndex: PropTypes.number,
|
|
68
|
+
children: PropTypes.node,
|
|
73
69
|
|
|
74
70
|
/** direction change the position of Tabs */
|
|
75
|
-
direction: oneOf(['vertical', 'horizontal']),
|
|
71
|
+
direction: PropTypes.oneOf(['vertical', 'horizontal']),
|
|
76
72
|
|
|
77
73
|
/** direction change the size typography of Tab (typesTypography is types of Typography - exp: h1, h2, h3, p1 .....)*/
|
|
78
74
|
level: PropTypes.oneOfType([PropTypes.oneOf(['level1', 'level2']), typesTypography]),
|
|
79
75
|
|
|
76
|
+
/** class for component */
|
|
77
|
+
className: PropTypes.string,
|
|
78
|
+
|
|
79
|
+
/** style inline of component */
|
|
80
|
+
style: PropTypes.object,
|
|
81
|
+
|
|
80
82
|
/** any props else */
|
|
81
|
-
props: any
|
|
83
|
+
props: PropTypes.any
|
|
82
84
|
};
|
|
83
85
|
export default TabContainer;
|
|
@@ -1,17 +1,22 @@
|
|
|
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 React, { memo, forwardRef, useContext, useRef, useState } from 'react';
|
|
7
5
|
import { jsx, css } from '@emotion/core';
|
|
8
|
-
import
|
|
9
|
-
import { color } from '../../styles/colors';
|
|
6
|
+
import PropTypes from 'prop-types';
|
|
7
|
+
import { color as colors } from '../../styles/colors';
|
|
10
8
|
import TabContext from './context';
|
|
11
9
|
import ButtonIcon from '../button/icon';
|
|
10
|
+
import { borderBox, flexCol, flexRow, overflowHidden, positionRelative } from '../../styles/general';
|
|
11
|
+
const {
|
|
12
|
+
line: {
|
|
13
|
+
tab
|
|
14
|
+
}
|
|
15
|
+
} = colors;
|
|
12
16
|
const TabHeader = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
13
17
|
children,
|
|
14
18
|
style,
|
|
19
|
+
className,
|
|
15
20
|
level,
|
|
16
21
|
scrollButtons,
|
|
17
22
|
...props
|
|
@@ -27,26 +32,24 @@ const TabHeader = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
27
32
|
let showScrollLeftButton = !isVertical && scrollLeft > 0;
|
|
28
33
|
let showScrollRightButton = !isVertical && (ref === null || ref === void 0 ? void 0 : (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.offsetWidth) + scrollLeft < (ref === null || ref === void 0 ? void 0 : (_ref$current2 = ref.current) === null || _ref$current2 === void 0 ? void 0 : _ref$current2.scrollWidth);
|
|
29
34
|
const Container = css`
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
35
|
+
${flexRow}
|
|
36
|
+
${overflowHidden}
|
|
37
|
+
${positionRelative}
|
|
38
|
+
${borderBox}
|
|
34
39
|
height: auto;
|
|
35
40
|
min-height: 2.5rem;
|
|
36
|
-
box-sizing: border-box;
|
|
37
41
|
flex-direction: ${isVertical ? 'column' : 'row'};
|
|
38
42
|
max-width: ${isVertical ? 'max-content' : '100%'};
|
|
39
43
|
width: 100%;
|
|
40
44
|
padding: 0;
|
|
41
|
-
${isVertical ? `border-right: solid 1px ${
|
|
45
|
+
${isVertical ? `border-right: solid 1px ${tab}` : `border-bottom: solid 1px ${tab}`};
|
|
42
46
|
`;
|
|
43
47
|
const TabHeader = isVertical ? css`
|
|
44
|
-
|
|
45
|
-
flex-direction: column;
|
|
48
|
+
${flexCol}
|
|
46
49
|
padding: 0 3px 0 0;
|
|
47
50
|
` : css`
|
|
48
|
-
|
|
49
|
-
|
|
51
|
+
${flexRow}
|
|
52
|
+
${positionRelative}
|
|
50
53
|
white-space: nowrap;
|
|
51
54
|
margin: 0;
|
|
52
55
|
list-style: none;
|
|
@@ -80,21 +83,23 @@ const TabHeader = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
80
83
|
setScrollLeft(scrollValue);
|
|
81
84
|
};
|
|
82
85
|
|
|
83
|
-
return jsx("div",
|
|
86
|
+
return jsx("div", {
|
|
84
87
|
css: Container,
|
|
85
88
|
id: `DGN-control`,
|
|
86
|
-
|
|
87
|
-
|
|
89
|
+
className: ['DGN-UI-Tab-Header-Container', className].join(' ').trim().replace(/\s+/g, ' '),
|
|
90
|
+
style: style,
|
|
91
|
+
...props
|
|
92
|
+
}, scrollButtons && jsx(ButtonIcon, {
|
|
88
93
|
css: scrollButton(true),
|
|
89
94
|
name: isVertical ? 'ArrowUp' : 'ArrowLeft',
|
|
90
95
|
viewType: 'text',
|
|
91
|
-
|
|
92
|
-
height: 24,
|
|
96
|
+
size: 'tiny',
|
|
93
97
|
viewBox: true,
|
|
94
98
|
disabled: !showScrollLeftButton,
|
|
95
99
|
onClick: () => _onClickScrollButton(true)
|
|
96
100
|
}), jsx("div", {
|
|
97
101
|
css: TabHeader,
|
|
102
|
+
className: 'DGN-UI-Tab-Header',
|
|
98
103
|
ref: ref,
|
|
99
104
|
onScroll: e => {
|
|
100
105
|
var _e$target;
|
|
@@ -107,27 +112,31 @@ const TabHeader = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
107
112
|
css: scrollButton(false),
|
|
108
113
|
name: isVertical ? 'ArrowDown' : 'ArrowRight',
|
|
109
114
|
viewType: 'text',
|
|
110
|
-
|
|
111
|
-
height: 24,
|
|
115
|
+
size: 'tiny',
|
|
112
116
|
viewBox: true,
|
|
113
117
|
disabled: !showScrollRightButton,
|
|
114
118
|
onClick: () => _onClickScrollButton(false)
|
|
115
119
|
}));
|
|
116
120
|
}));
|
|
117
121
|
TabHeader.defaultProps = {
|
|
118
|
-
scrollButtons: false
|
|
122
|
+
scrollButtons: false,
|
|
123
|
+
className: '',
|
|
124
|
+
style: {}
|
|
119
125
|
};
|
|
120
126
|
TabHeader.propTypes = {
|
|
121
127
|
/** element to display in Tabs (like text) */
|
|
122
|
-
children: array,
|
|
128
|
+
children: PropTypes.array,
|
|
129
|
+
|
|
130
|
+
/** class for component */
|
|
131
|
+
className: PropTypes.string,
|
|
123
132
|
|
|
124
|
-
/** style inline of
|
|
125
|
-
style: object,
|
|
133
|
+
/** style inline of component */
|
|
134
|
+
style: PropTypes.object,
|
|
126
135
|
|
|
127
136
|
/** show scroll buttons if true */
|
|
128
|
-
scrollButtons: bool,
|
|
137
|
+
scrollButtons: PropTypes.bool,
|
|
129
138
|
|
|
130
139
|
/** any props else */
|
|
131
|
-
props: any
|
|
140
|
+
props: PropTypes.any
|
|
132
141
|
};
|
|
133
142
|
export default TabHeader;
|
|
@@ -1,16 +1,22 @@
|
|
|
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 { memo, forwardRef, useContext } from 'react';
|
|
7
5
|
import { jsx, css } from '@emotion/core';
|
|
8
|
-
import
|
|
9
|
-
import { color } from '../../styles/colors';
|
|
6
|
+
import PropTypes from 'prop-types';
|
|
7
|
+
import { color as colors } from '../../styles/colors';
|
|
10
8
|
import TabContext from './context';
|
|
9
|
+
import { borderBox, positionRelative } from '../../styles/general';
|
|
10
|
+
const {
|
|
11
|
+
text: {
|
|
12
|
+
main
|
|
13
|
+
}
|
|
14
|
+
} = colors;
|
|
11
15
|
const TabPanel = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
12
16
|
children,
|
|
13
17
|
index,
|
|
18
|
+
style,
|
|
19
|
+
className,
|
|
14
20
|
...props
|
|
15
21
|
}, ref) => {
|
|
16
22
|
const {
|
|
@@ -19,33 +25,44 @@ const TabPanel = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
19
25
|
} = useContext(TabContext);
|
|
20
26
|
const isVertical = direction === 'vertical';
|
|
21
27
|
const TabPanel = css`
|
|
22
|
-
box-sizing: border-box;
|
|
23
|
-
color: ${color.text.main};
|
|
24
28
|
display: ${index === tabIndexState ? 'flex' : 'none'};
|
|
29
|
+
${borderBox}
|
|
30
|
+
${positionRelative}
|
|
31
|
+
color: ${main};
|
|
25
32
|
height: ${isVertical ? '300px' : '100%'};
|
|
26
|
-
position: relative;
|
|
27
33
|
padding: 0px ${isVertical ? '12px' : '10'};
|
|
28
34
|
width: 100%;
|
|
29
35
|
flex-direction: column;
|
|
30
36
|
`;
|
|
31
|
-
return jsx("div",
|
|
37
|
+
return jsx("div", {
|
|
32
38
|
css: TabPanel,
|
|
33
39
|
"aria-labelledby": `tab-${index}`,
|
|
34
40
|
id: `tab-panel-${index}`,
|
|
35
|
-
className: '
|
|
41
|
+
className: ['DGN-UI-Tab-Panel', className].join(' ').trim().replace(/\s+/g, ' '),
|
|
42
|
+
style: style,
|
|
36
43
|
role: 'tab-panel',
|
|
37
|
-
ref: ref
|
|
38
|
-
|
|
44
|
+
ref: ref,
|
|
45
|
+
...props
|
|
46
|
+
}, children);
|
|
39
47
|
}));
|
|
40
|
-
TabPanel.defaultProps = {
|
|
48
|
+
TabPanel.defaultProps = {
|
|
49
|
+
className: '',
|
|
50
|
+
style: {}
|
|
51
|
+
};
|
|
41
52
|
TabPanel.propTypes = {
|
|
42
53
|
/** element to display in Tabs (like text) */
|
|
43
|
-
children: node,
|
|
54
|
+
children: PropTypes.node,
|
|
44
55
|
|
|
45
56
|
/** index received in position of TabHeaderButton */
|
|
46
|
-
index: number,
|
|
57
|
+
index: PropTypes.number,
|
|
58
|
+
|
|
59
|
+
/** class for component */
|
|
60
|
+
className: PropTypes.string,
|
|
61
|
+
|
|
62
|
+
/** style inline of component */
|
|
63
|
+
style: PropTypes.object,
|
|
47
64
|
|
|
48
65
|
/** any props else */
|
|
49
|
-
props: any
|
|
66
|
+
props: PropTypes.any
|
|
50
67
|
};
|
|
51
68
|
export default TabPanel;
|