diginet-core-ui 1.3.36 → 1.3.38
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/avatar/default.svg +3 -3
- package/assets/images/icons/wifi.svg +3 -3
- package/assets/images/menu/dhr/ALL.svg +6 -6
- package/assets/images/menu/dhr/D00.svg +12 -12
- package/assets/images/menu/dhr/D09.svg +8 -8
- package/assets/images/menu/dhr/D13.svg +10 -10
- package/assets/images/menu/dhr/D15.svg +10 -10
- package/assets/images/menu/dhr/D21.svg +10 -10
- package/assets/images/menu/dhr/D25.svg +11 -11
- package/assets/images/menu/dhr/D29.svg +11 -11
- package/assets/images/menu/dhr/D38.svg +6 -6
- package/assets/images/menu/dhr/D39.svg +10 -10
- package/assets/images/menu/dhr/D51.svg +12 -12
- package/assets/images/menu/dhr/D52.svg +16 -16
- package/assets/images/menu/dhr/D77.svg +16 -16
- package/assets/images/menu/dhr/D84.svg +12 -12
- package/assets/images/menu/dhr/D89.svg +8 -8
- package/assets/images/menu/dhr/Default.svg +13 -13
- package/assets/images/menu/dhr/MHRM00N0001.svg +14 -14
- package/assets/images/menu/dhr/MHRM09N0002.svg +3 -3
- package/assets/images/menu/dhr/MHRM09N0003.svg +25 -25
- package/assets/images/menu/dhr/MHRM09N0004.svg +14 -14
- package/assets/images/menu/dhr/MHRM09N0005.svg +7 -7
- package/assets/images/menu/dhr/MHRM13N0001.svg +16 -16
- package/assets/images/menu/dhr/MHRM25N0001.svg +26 -26
- package/assets/images/menu/dhr/MHRM29N0001.svg +30 -30
- package/assets/images/menu/dhr/MHRM29N0002.svg +13 -0
- package/assets/images/menu/dhr/MHRM29N0003.svg +17 -0
- package/assets/images/menu/dhr/MHRM29N0015.svg +63 -63
- package/assets/images/menu/dhr/MHRM39N0012.svg +43 -43
- package/assets/images/menu/dhr/MHRM39N0013.svg +24 -24
- package/assets/images/menu/dhr/MHRM39N0014.svg +14 -14
- package/assets/images/menu/dhr/MHRM39N0015.svg +36 -36
- package/assets/images/menu/dhr/MHRM39N0016.svg +23 -23
- package/assets/images/menu/dhr/MHRM77N0001.svg +28 -28
- package/assets/images/menu/dhr/MHRM84N0001.svg +27 -27
- package/assets/images/menu/dhr/MHRM84N0002.svg +24 -24
- package/assets/images/menu/dhr/MHRM89N0001.svg +16 -16
- package/assets/images/menu/dhr/MHRP00N0001.svg +10 -10
- package/assets/images/menu/dhr/MHRP09N0001.svg +22 -22
- package/assets/images/menu/dhr/MHRP09N0002.svg +19 -19
- package/assets/images/menu/dhr/MHRP09N0003.svg +12 -12
- package/assets/images/menu/dhr/MHRP09N0004.svg +6 -6
- package/assets/images/menu/dhr/MHRP09N0005.svg +10 -10
- package/assets/images/menu/dhr/MHRP09N0006.svg +17 -17
- package/assets/images/menu/dhr/MHRP09N0007.svg +15 -15
- package/assets/images/menu/dhr/MHRP09N0008.svg +8 -8
- package/assets/images/menu/dhr/MHRP09N0009.svg +10 -10
- package/assets/images/menu/dhr/MHRP09N0010.svg +12 -12
- package/assets/images/menu/dhr/MHRP09N0011.svg +16 -16
- package/assets/images/menu/dhr/MHRP09N0012.svg +6 -6
- package/assets/images/menu/dhr/MHRP09N0013.svg +8 -8
- package/assets/images/menu/dhr/MHRP09N0014.svg +11 -11
- package/assets/images/menu/dhr/MHRP09N0015.svg +12 -12
- package/assets/images/menu/dhr/MHRP09N0016.svg +18 -18
- package/assets/images/menu/dhr/MHRP09N0017.svg +18 -18
- package/assets/images/menu/dhr/MHRP09N0018.svg +12 -12
- package/assets/images/menu/dhr/MHRP09N0019.svg +13 -13
- package/assets/images/menu/dhr/MHRP09N0020.svg +17 -17
- package/assets/images/menu/dhr/MHRP09N0021.svg +10 -10
- package/assets/images/menu/dhr/MHRP09N0022.svg +16 -16
- package/assets/images/menu/dhr/MHRP09N0023.svg +8 -8
- package/assets/images/menu/dhr/MHRP09N0024.svg +15 -15
- package/assets/images/menu/dhr/MHRP09N0025.svg +16 -16
- package/assets/images/menu/dhr/MHRP09N0026.svg +13 -13
- package/assets/images/menu/dhr/MHRP09N0027.svg +10 -10
- package/assets/images/menu/dhr/MHRP09N0028.svg +6 -6
- package/assets/images/menu/dhr/MHRP09N0029.svg +14 -14
- package/assets/images/menu/dhr/MHRP09N0030.svg +4 -4
- package/assets/images/menu/dhr/MHRP09N0031.svg +5 -5
- package/assets/images/menu/dhr/MHRP09N0032.svg +7 -7
- package/assets/images/menu/dhr/MHRP13N0001.svg +9 -9
- package/assets/images/menu/dhr/MHRP21N0001.svg +12 -12
- package/assets/images/menu/dhr/MHRP21N0002.svg +13 -13
- package/assets/images/menu/dhr/MHRP25N0001.svg +13 -13
- package/assets/images/menu/dhr/MHRP25N0002.svg +16 -16
- package/assets/images/menu/dhr/MHRP25N0003.svg +38 -38
- package/assets/images/menu/dhr/MHRP25N0004.svg +17 -17
- package/assets/images/menu/dhr/MHRP25N0005.svg +20 -20
- package/assets/images/menu/dhr/MHRP29N0001.svg +18 -18
- package/assets/images/menu/dhr/MHRP29N0002.svg +15 -15
- package/assets/images/menu/dhr/MHRP29N0003.svg +20 -20
- package/assets/images/menu/dhr/MHRP29N0004.svg +21 -21
- package/assets/images/menu/dhr/MHRP29N0005.svg +21 -21
- package/assets/images/menu/dhr/MHRP29N0006.svg +14 -14
- package/assets/images/menu/dhr/MHRP29N0007.svg +19 -19
- package/assets/images/menu/dhr/MHRP29N0008.svg +20 -20
- package/assets/images/menu/dhr/MHRP29N0009.svg +11 -11
- package/assets/images/menu/dhr/MHRP29N0010.svg +11 -11
- package/assets/images/menu/dhr/MHRP29N0011.svg +12 -12
- package/assets/images/menu/dhr/MHRP29N0012.svg +7 -7
- package/assets/images/menu/dhr/MHRP29N0013.svg +27 -27
- package/assets/images/menu/dhr/MHRP29N0014.svg +32 -32
- package/assets/images/menu/dhr/MHRP29N0016.svg +54 -54
- package/assets/images/menu/dhr/MHRP29N0017.svg +24 -24
- package/assets/images/menu/dhr/MHRP29N0018.svg +44 -44
- package/assets/images/menu/dhr/MHRP29N0019.svg +17 -17
- package/assets/images/menu/dhr/MHRP29N0020.svg +11 -11
- package/assets/images/menu/dhr/MHRP29N0021.svg +8 -8
- package/assets/images/menu/dhr/MHRP29N0022.svg +9 -9
- package/assets/images/menu/dhr/MHRP29N0023.svg +22 -22
- package/assets/images/menu/dhr/MHRP38N0001.svg +13 -13
- package/assets/images/menu/dhr/MHRP38N0002.svg +14 -14
- package/assets/images/menu/dhr/MHRP39N0001.svg +15 -15
- package/assets/images/menu/dhr/MHRP39N0002.svg +13 -13
- package/assets/images/menu/dhr/MHRP39N0003.svg +16 -16
- package/assets/images/menu/dhr/MHRP39N0004.svg +22 -22
- package/assets/images/menu/dhr/MHRP39N0005.svg +16 -16
- package/assets/images/menu/dhr/MHRP39N0006.svg +17 -17
- package/assets/images/menu/dhr/MHRP39N0007.svg +13 -13
- package/assets/images/menu/dhr/MHRP39N0008.svg +3 -3
- package/assets/images/menu/dhr/MHRP39N0009.svg +3 -3
- package/assets/images/menu/dhr/MHRP39N0010.svg +7 -7
- package/assets/images/menu/dhr/MHRP39N0011.svg +14 -14
- package/assets/images/menu/dhr/MHRP39N0013.svg +10 -10
- package/assets/images/menu/dhr/MHRP39N0014.svg +11 -11
- package/assets/images/menu/dhr/MHRP39N0015.svg +5 -5
- package/assets/images/menu/dhr/MHRP39N0017.svg +11 -11
- package/assets/images/menu/dhr/MHRP39N0018.svg +11 -0
- package/assets/images/menu/dhr/MHRP39N1222.svg +12 -12
- package/assets/images/menu/dhr/MHRP51N0001.svg +9 -9
- package/assets/images/menu/dhr/MHRP51N0002.svg +13 -13
- package/assets/images/menu/dhr/MHRP52N0001.svg +21 -21
- package/assets/images/menu/dhr/MHRP52N0002.svg +21 -21
- package/assets/images/menu/dhr/MHRP52N0003.svg +16 -16
- package/assets/images/menu/dhr/MHRP75N0001.svg +19 -19
- package/assets/images/menu/dhr/MHRP75N0002.svg +25 -25
- package/assets/images/menu/dhr/MHRP75N0003.svg +3 -3
- package/assets/images/menu/dhr/MHRP75N0006.svg +14 -14
- package/assets/images/menu/dhr/MHRP75N0007.svg +19 -19
- package/assets/images/menu/dhr/MHRP75N0008.svg +19 -19
- package/assets/images/menu/dhr/MHRP77N0007.svg +28 -28
- package/assets/images/menu/dhr/MHRP77N0008.svg +17 -17
- package/assets/images/menu/dhr/MHRP77N0009.svg +19 -19
- package/assets/images/menu/dhr/MHRP77N0010.svg +20 -20
- package/assets/images/menu/dhr/MHRP89N1000.svg +6 -6
- package/assets/images/menu/dhr/MHRP89N1001.svg +6 -6
- package/assets/images/menu/dhr/TASK.svg +9 -9
- package/assets/images/menu/dhr/W00F0001.svg +3 -3
- package/assets/images/menu/dhr/W00F0002.svg +3 -3
- package/assets/images/menu/dhr/W00F0003.svg +3 -3
- package/assets/images/menu/dhr/W00F0004.svg +3 -3
- package/assets/images/menu/dhr/W09F2000-WEB5.svg +17 -17
- package/assets/images/menu/dhr/W09F2000.svg +6 -6
- package/assets/images/menu/dhr/W09F2002-WEB5.svg +21 -21
- package/assets/images/menu/dhr/W09F2005-WEB5.svg +13 -13
- package/assets/images/menu/dhr/W09F2020-WEB5.svg +16 -16
- package/assets/images/menu/dhr/W09F2022-WEB5.svg +20 -20
- package/assets/images/menu/dhr/W09F2150-WEB5.svg +16 -16
- package/assets/images/menu/dhr/W09F2152-WEB5.svg +20 -20
- package/assets/images/menu/dhr/W09F2160-WEB5.svg +14 -14
- package/assets/images/menu/dhr/W09F2162-WEB5.svg +18 -18
- package/assets/images/menu/dhr/W29F4006-WEB5.svg +19 -19
- package/assets/images/menu/dhr/W75F2260-WEB5.svg +15 -15
- package/assets/images/menu/dhr/W75F2261-WEB5.svg +19 -19
- package/assets/images/menu/dhr/W75F3005-WEB5.svg +13 -13
- package/assets/images/menu/dhr/W75F4070-WEB5.svg +21 -21
- package/assets/images/menu/dhr/W75F4071-WEB5.svg +17 -17
- package/assets/images/menu/dhr/W75F4100-WEB5.svg +14 -14
- package/assets/images/menu/dhr/W77F1011.svg +19 -19
- package/assets/images/menu/dhr/W77F1013.svg +22 -22
- package/assets/images/menu/erp/D05.svg +8 -8
- package/assets/images/menu/erp/D06.svg +4 -4
- package/assets/images/menu/erp/D90R.svg +9 -9
- package/assets/images/menu/erp/DBC.svg +9 -9
- package/assets/images/menu/erp/W00F0001.svg +3 -3
- package/assets/images/menu/erp/W00F0002.svg +3 -3
- package/assets/images/menu/erp/W00F0003.svg +3 -3
- package/assets/images/menu/erp/W00F0004.svg +3 -3
- package/assets/images/menu/erp/W05F0001.svg +16 -16
- package/assets/images/menu/erp/W05F0001N0000.svg +16 -16
- package/assets/images/menu/erp/W05F0004N0000.svg +6 -6
- package/assets/images/menu/erp/W05F0006N0000.svg +30 -30
- package/assets/images/menu/erp/W05F0007N0000.svg +6 -6
- package/assets/images/menu/erp/W05F0008N0000.svg +14 -14
- package/assets/images/menu/erp/W05F0011N0000.svg +20 -20
- package/assets/images/menu/erp/W05F0013N0000.svg +9 -9
- package/assets/images/menu/erp/W05F4000N0000.svg +9 -9
- package/assets/images/menu/erp/W06F0001.svg +17 -17
- package/assets/images/menu/erp/W06F0001N0000.svg +17 -17
- package/assets/images/menu/erp/W06F0004N0000.svg +22 -22
- package/assets/images/menu/erp/W06F0005N0000.svg +22 -22
- package/assets/images/menu/erp/W06F0006N0000.svg +55 -55
- package/assets/images/menu/erp/W06F0008N0000.svg +17 -17
- package/assets/images/menu/erp/W94F1000N0000.svg +9 -9
- package/assets/images/menu/erp/W94F1000N0001.svg +9 -9
- package/assets/images/menu/erp/WA3F1025.svg +5 -5
- package/assets/images/menu/erp/WA3F2100.svg +10 -10
- package/components/accordion/css.js +42 -35
- package/components/accordion/details.js +48 -42
- package/components/accordion/group.js +88 -82
- package/components/accordion/index.js +54 -48
- package/components/accordion/summary.js +52 -43
- package/components/alert/index.js +115 -103
- package/components/alert/notify.js +16 -18
- package/components/badge/index.js +5 -5
- package/components/button/icon.js +21 -21
- package/components/button/index.js +13 -13
- package/components/chart/Pie/Sector.js +2 -2
- package/components/chart/Pie-v2/Sector.js +2 -2
- package/components/chip/attach.js +5 -5
- package/components/chip/index.js +13 -10
- package/components/divider/index.js +17 -15
- package/components/form-control/attachment/index.js +1 -0
- package/components/form-control/calendar/function.js +295 -289
- package/components/form-control/calendar/index.js +16 -16
- package/components/form-control/checkbox/index.js +5 -5
- package/components/form-control/date-picker/index.js +7 -3
- package/components/form-control/date-range-picker/index.js +12 -8
- package/components/form-control/dropdown/index.js +139 -81
- package/components/form-control/input-base/index.js +32 -27
- package/components/form-control/money-input/index.js +17 -17
- package/components/form-control/number-input/index.js +11 -11
- package/components/form-control/number-input/index2.js +432 -0
- package/components/form-control/phone-input/index.js +7 -7
- package/components/form-control/radio/index.js +98 -146
- package/components/form-control/text-input/index.js +4 -4
- package/components/form-control/time-picker/index.js +305 -300
- package/components/form-control/toggle/index.js +92 -90
- package/components/index.js +1 -1
- package/components/modal/header.js +63 -65
- package/components/modal/modal.js +84 -130
- package/components/paging/page-selector.js +53 -49
- package/components/popup/index.js +5 -1
- package/components/popup/proposals_popup.js +5 -1
- package/components/popup/v2/index.js +12 -8
- package/components/progress/circular.js +12 -12
- package/components/rating/index.js +3 -3
- package/components/slider/slider-item.js +65 -25
- package/components/tab/tab-container.js +2 -2
- package/components/tab/tab-header.js +2 -2
- package/components/tab/tab-panel.js +2 -2
- package/components/tab/tab.js +2 -2
- package/components/transfer/index.js +3 -3
- package/components/tree-view/index.js +38 -38
- package/components/typography/index.js +10 -10
- package/icons/basic.js +75 -408
- package/icons/effect.js +15 -15
- package/package.json +45 -45
- package/readme.md +677 -654
- package/styles/color-helper.js +103 -103
- package/styles/colors.js +7 -7
- package/styles/general.js +40 -12
- package/styles/utils.js +5 -5
- package/theme/set-theme.js +3 -3
- package/theme/settings.js +3 -2
- package/utils/array/array.js +36 -36
- package/utils/date.js +56 -56
- package/utils/error/error.js +2 -2
- package/utils/error/errors.js +99 -99
- package/utils/number.js +6 -6
- package/utils/render-portal.js +5 -1
- package/utils/renderIcon.js +5 -5
- package/utils/useOnClickOutside.js +2 -2
- package/utils/usePortal.js +9 -9
- package/utils/validate.js +33 -33
|
@@ -1,129 +1,65 @@
|
|
|
1
1
|
/** @jsxRuntime classic */
|
|
2
2
|
|
|
3
3
|
/** @jsx jsx */
|
|
4
|
-
import { memo, useState, useRef, forwardRef, useEffect, useMemo } from 'react';
|
|
4
|
+
import { memo, useState, useRef, forwardRef, useEffect, useMemo, useImperativeHandle } from 'react';
|
|
5
5
|
import { createPortal } from 'react-dom';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
|
-
import { jsx, css
|
|
7
|
+
import { jsx, css } from '@emotion/core';
|
|
8
8
|
import ModalContext from './context';
|
|
9
|
+
import { animations } from '../../styles/animation';
|
|
9
10
|
import { typography } from '../../styles/typography';
|
|
11
|
+
import { borderBox, borderRadius4px, flexCol, flexRow, justifyCenter, parseWidth, positionFixed, positionRelative } from '../../styles/general';
|
|
12
|
+
import { color as colors } from '../../styles/colors';
|
|
13
|
+
const {
|
|
14
|
+
paragraph1
|
|
15
|
+
} = typography;
|
|
16
|
+
const {
|
|
17
|
+
system: {
|
|
18
|
+
white
|
|
19
|
+
}
|
|
20
|
+
} = colors;
|
|
21
|
+
const fadeInDown = animations.fadeInDown;
|
|
10
22
|
const Modal = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
11
23
|
open,
|
|
12
|
-
type,
|
|
13
|
-
title,
|
|
14
24
|
moveable,
|
|
15
25
|
dragAnyWhere,
|
|
16
26
|
moveOutScreen,
|
|
17
27
|
style,
|
|
18
|
-
top,
|
|
19
28
|
zIndex,
|
|
20
29
|
pressESCToClose,
|
|
21
30
|
darkTheme,
|
|
22
31
|
autoFocus,
|
|
23
|
-
refs,
|
|
24
32
|
onClose,
|
|
25
|
-
onConfirm,
|
|
26
|
-
onCancel,
|
|
27
33
|
children,
|
|
28
34
|
width,
|
|
29
|
-
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
ref = useRef(null);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
+
alignment
|
|
36
|
+
}, reference) => {
|
|
37
|
+
const ref = useRef(null);
|
|
35
38
|
const modalBoxRef = useRef(null);
|
|
36
39
|
const [openState, setOpenState] = useState(open);
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
height: 100vh;
|
|
42
|
-
background-color: ${darkTheme ? 'rgba(21, 26, 48, 0.5)' : 'transparent'};
|
|
43
|
-
top: 0;
|
|
44
|
-
left: 0;
|
|
45
|
-
justify-content: center;
|
|
46
|
-
align-items: ${top ? 'inherit' : 'center'};
|
|
47
|
-
padding-top: ${top ? isNaN(top) ? top : top + 'px' : 0};
|
|
48
|
-
opacity: 0;
|
|
49
|
-
transition: opacity 0.3s ease;
|
|
50
|
-
z-index: ${zIndex};
|
|
51
|
-
`;
|
|
52
|
-
const fadeInDown = keyframes`
|
|
53
|
-
0% {
|
|
54
|
-
opacity: 0;
|
|
55
|
-
-webkit-transform: translate3d(0, -30px, 0);
|
|
56
|
-
transform: translate3d(0, -30px, 0);
|
|
57
|
-
}
|
|
58
|
-
to {
|
|
59
|
-
opacity: 1;
|
|
60
|
-
-webkit-transform: translateZ(0);
|
|
61
|
-
transform: translateZ(0);
|
|
62
|
-
}
|
|
63
|
-
`;
|
|
64
|
-
const fadeOutUp = keyframes`
|
|
65
|
-
0% {
|
|
66
|
-
opacity: 1;
|
|
67
|
-
}
|
|
68
|
-
to {
|
|
69
|
-
opacity: 0;
|
|
70
|
-
-webkit-transform: translate3d(0, -30px, 0);
|
|
71
|
-
transform: translate3d(0, -30px, 0);
|
|
72
|
-
}
|
|
73
|
-
`;
|
|
74
|
-
const ModalBox = css`
|
|
75
|
-
display: flex;
|
|
76
|
-
flex-direction: column;
|
|
77
|
-
position: relative;
|
|
78
|
-
background-color: white;
|
|
79
|
-
${typography.paragraph1};
|
|
80
|
-
height: max-content;
|
|
81
|
-
max-height: calc(100% - ${isNaN(top) ? top : +top + 'px'});
|
|
82
|
-
min-width: 150px;
|
|
83
|
-
max-width: 90%;
|
|
84
|
-
/* min-height: 152px; */
|
|
85
|
-
margin: 0 auto;
|
|
86
|
-
border-radius: 4px;
|
|
87
|
-
box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
|
|
88
|
-
box-sizing: border-box;
|
|
89
|
-
-webkit-box-orient: vertical;
|
|
90
|
-
-webkit-box-direction: normal;
|
|
91
|
-
width: ${isNaN(width) ? width : width + 'px'};
|
|
92
|
-
animation: ${fadeOutUp} 0.2s ease;
|
|
93
|
-
animation-fill-mode: forwards;
|
|
94
|
-
cursor: ${moveable && dragAnyWhere ? 'move' : 'initial'};
|
|
95
|
-
&.show {
|
|
96
|
-
display: flex !important;
|
|
97
|
-
animation: ${fadeInDown} 0.2s ease;
|
|
98
|
-
}
|
|
99
|
-
`;
|
|
40
|
+
|
|
41
|
+
const _ModalContainerCSS = ModalContainerCSS(zIndex, alignment, darkTheme);
|
|
42
|
+
|
|
43
|
+
const _ModalBoxCSS = ModalBoxCSS(width, moveable, dragAnyWhere);
|
|
100
44
|
|
|
101
45
|
const onShowModal = () => {
|
|
102
46
|
setOpenState(true);
|
|
103
47
|
};
|
|
104
48
|
|
|
105
49
|
const onCloseModal = () => {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
setOpenState(false);
|
|
109
|
-
}, 500);
|
|
110
|
-
}
|
|
50
|
+
onClose && onClose();
|
|
51
|
+
setOpenState(false);
|
|
111
52
|
|
|
112
53
|
if (pressESCToClose) {
|
|
113
54
|
document.removeEventListener('keydown', pressESCHandler);
|
|
114
55
|
}
|
|
115
|
-
|
|
116
|
-
if (ref.current) {
|
|
117
|
-
ref.current.style.opacity = null;
|
|
118
|
-
ref.current.firstChild.classList.remove('show');
|
|
119
|
-
}
|
|
120
56
|
};
|
|
121
57
|
|
|
122
58
|
const pressESCHandler = event => {
|
|
123
59
|
if (event.key === 'Escape') {
|
|
124
60
|
const modals = document.querySelectorAll('.DGN-UI-Portal');
|
|
125
61
|
|
|
126
|
-
if (modals
|
|
62
|
+
if ((modals === null || modals === void 0 ? void 0 : modals.length) > 1 && Array.from(modals)[modals.length - 1] && !Array.from(modals)[modals.length - 1].contains(ref.current)) {
|
|
127
63
|
return;
|
|
128
64
|
}
|
|
129
65
|
|
|
@@ -187,30 +123,11 @@ const Modal = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
187
123
|
};
|
|
188
124
|
|
|
189
125
|
useEffect(() => {
|
|
190
|
-
|
|
191
|
-
setOpenState(open);
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
return () => {
|
|
195
|
-
if (open && ref.current) {
|
|
196
|
-
setTimeout(() => {
|
|
197
|
-
setOpenState(!open);
|
|
198
|
-
}, 500);
|
|
199
|
-
}
|
|
200
|
-
};
|
|
126
|
+
setOpenState(open);
|
|
201
127
|
}, [open]);
|
|
202
|
-
useEffect(() => {
|
|
203
|
-
return () => {
|
|
204
|
-
if (pressESCToClose) {
|
|
205
|
-
document.removeEventListener('keydown', pressESCHandler);
|
|
206
|
-
}
|
|
207
|
-
};
|
|
208
|
-
}, []);
|
|
209
128
|
useEffect(() => {
|
|
210
129
|
if (openState) {
|
|
211
130
|
if (ref.current) {
|
|
212
|
-
ref.current.style.opacity = 1;
|
|
213
|
-
ref.current.firstChild.classList.add('show');
|
|
214
131
|
const modals = document.querySelectorAll('.DGN-UI-Modal');
|
|
215
132
|
|
|
216
133
|
if (!darkTheme && modals && modals.length > 1) {
|
|
@@ -225,18 +142,25 @@ const Modal = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
225
142
|
}
|
|
226
143
|
}
|
|
227
144
|
|
|
228
|
-
document.
|
|
145
|
+
document.documentElement.style.overflow = 'hidden'; // Allow press ESC to close popup
|
|
229
146
|
|
|
230
147
|
if (pressESCToClose) {
|
|
231
148
|
document.addEventListener('keydown', pressESCHandler);
|
|
232
149
|
}
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
document.body.style.overflow = null;
|
|
236
|
-
};
|
|
150
|
+
} else {
|
|
151
|
+
document.documentElement.style.overflow = null;
|
|
237
152
|
}
|
|
238
153
|
}, [openState]);
|
|
239
|
-
|
|
154
|
+
useImperativeHandle(reference, () => {
|
|
155
|
+
const currentRef = ref.current || {};
|
|
156
|
+
const _instance = {}; // methods
|
|
157
|
+
|
|
158
|
+
_instance.__proto__ = {}; // hidden methods
|
|
159
|
+
|
|
160
|
+
currentRef.instance = _instance;
|
|
161
|
+
return currentRef;
|
|
162
|
+
});
|
|
163
|
+
return useMemo(() => {
|
|
240
164
|
if (openState) {
|
|
241
165
|
const node = jsx("div", {
|
|
242
166
|
className: 'DGN-UI-Portal DGN-UI-Modal',
|
|
@@ -246,13 +170,14 @@ const Modal = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
246
170
|
inset: 0
|
|
247
171
|
}
|
|
248
172
|
}, jsx("div", {
|
|
249
|
-
css:
|
|
173
|
+
css: _ModalContainerCSS,
|
|
174
|
+
className: 'DGN-UI-Modal-Container',
|
|
250
175
|
ref: ref
|
|
251
176
|
}, jsx("div", {
|
|
252
|
-
css:
|
|
177
|
+
css: _ModalBoxCSS,
|
|
253
178
|
ref: modalBoxRef,
|
|
254
|
-
...props,
|
|
255
179
|
onMouseDown: moveable && dragAnyWhere ? dragMouseDown : null,
|
|
180
|
+
className: 'DGN-UI-Modal-Box',
|
|
256
181
|
style: style
|
|
257
182
|
}, jsx(ModalContext.Provider, {
|
|
258
183
|
value: {
|
|
@@ -265,9 +190,44 @@ const Modal = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
265
190
|
}
|
|
266
191
|
|
|
267
192
|
return null;
|
|
268
|
-
});
|
|
269
|
-
return ModalView;
|
|
193
|
+
}, [moveable, dragAnyWhere, style, children, openState]);
|
|
270
194
|
}));
|
|
195
|
+
|
|
196
|
+
const ModalContainerCSS = (zIndex, alignment, darkTheme) => css`
|
|
197
|
+
${flexRow};
|
|
198
|
+
${positionFixed};
|
|
199
|
+
${justifyCenter};
|
|
200
|
+
z-index: ${zIndex};
|
|
201
|
+
align-items: ${alignment === 'top' ? 'inherit' : 'center'};
|
|
202
|
+
padding-top: ${alignment === 'top' ? '12px' : 0};
|
|
203
|
+
background-color: ${darkTheme ? 'rgba(21, 26, 48, 0.5)' : 'transparent'};
|
|
204
|
+
width: 100%;
|
|
205
|
+
height: 100vh;
|
|
206
|
+
top: 0;
|
|
207
|
+
left: 0;
|
|
208
|
+
`;
|
|
209
|
+
|
|
210
|
+
const ModalBoxCSS = (width, moveable, dragAnyWhere) => css`
|
|
211
|
+
${paragraph1};
|
|
212
|
+
${flexCol};
|
|
213
|
+
${positionRelative};
|
|
214
|
+
${borderRadius4px}
|
|
215
|
+
${borderBox};
|
|
216
|
+
${parseWidth(width)}
|
|
217
|
+
cursor: ${moveable && dragAnyWhere ? 'move' : 'initial'};
|
|
218
|
+
max-height: calc(100% - 12px);
|
|
219
|
+
height: max-content;
|
|
220
|
+
background-color: ${white};
|
|
221
|
+
min-width: 150px;
|
|
222
|
+
max-width: 90%;
|
|
223
|
+
margin: 0 auto;
|
|
224
|
+
box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
|
|
225
|
+
-webkit-box-orient: vertical;
|
|
226
|
+
-webkit-box-direction: normal;
|
|
227
|
+
animation: ${fadeInDown} 0.2s ease;
|
|
228
|
+
animation-fill-mode: forwards;
|
|
229
|
+
`;
|
|
230
|
+
|
|
271
231
|
Modal.defaultProps = {
|
|
272
232
|
darkTheme: true,
|
|
273
233
|
open: false,
|
|
@@ -276,11 +236,14 @@ Modal.defaultProps = {
|
|
|
276
236
|
dragAnyWhere: false,
|
|
277
237
|
moveOutScreen: false,
|
|
278
238
|
autoFocus: true,
|
|
279
|
-
|
|
239
|
+
alignment: 'top',
|
|
280
240
|
width: '80%',
|
|
281
241
|
zIndex: 9000
|
|
282
242
|
};
|
|
283
243
|
Modal.propTypes = {
|
|
244
|
+
/** Set the position on the component. */
|
|
245
|
+
alignment: PropTypes.oneOf(['top', 'center']),
|
|
246
|
+
|
|
284
247
|
/** park a good colored background under the modal box if true */
|
|
285
248
|
darkTheme: PropTypes.bool,
|
|
286
249
|
|
|
@@ -305,25 +268,16 @@ Modal.propTypes = {
|
|
|
305
268
|
/** z-index style of Modal */
|
|
306
269
|
zIndex: PropTypes.number,
|
|
307
270
|
|
|
308
|
-
/** customize the vertical position of the screen, if not set, the modal will be fixed in the middle of the screen */
|
|
309
|
-
top: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
310
|
-
|
|
311
271
|
/** width of the modal */
|
|
312
272
|
width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
313
273
|
|
|
314
274
|
/** customize style inline */
|
|
315
275
|
style: PropTypes.object,
|
|
316
276
|
|
|
317
|
-
/** get modal ref by function */
|
|
318
|
-
refs: PropTypes.func,
|
|
319
|
-
|
|
320
277
|
/** the function to run when close modal */
|
|
321
278
|
onClose: PropTypes.func,
|
|
322
279
|
|
|
323
280
|
/** child content in body */
|
|
324
|
-
children: PropTypes.node
|
|
325
|
-
|
|
326
|
-
/** any props else */
|
|
327
|
-
props: PropTypes.any
|
|
281
|
+
children: PropTypes.node
|
|
328
282
|
};
|
|
329
283
|
export default Modal;
|
|
@@ -6,6 +6,10 @@ import PropTypes from 'prop-types';
|
|
|
6
6
|
import { jsx, css } from '@emotion/core';
|
|
7
7
|
import theme from '../../theme/settings';
|
|
8
8
|
import { typography } from '../../styles/typography';
|
|
9
|
+
import { useTheme } from '../../theme';
|
|
10
|
+
const {
|
|
11
|
+
zIndex
|
|
12
|
+
} = useTheme();
|
|
9
13
|
const PagingSelector = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
10
14
|
size,
|
|
11
15
|
style,
|
|
@@ -23,57 +27,57 @@ const PagingSelector = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
23
27
|
const [currentPage, setCurrentPage] = useState(currentPageProps);
|
|
24
28
|
const [paging, setPaging] = useState([1]);
|
|
25
29
|
const PageItemNum = css`
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
color: #fff;
|
|
31
|
+
${typography.heading3};
|
|
32
|
+
z-index: ${zIndex(2)};
|
|
33
|
+
`;
|
|
30
34
|
const morePaging = css`
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
35
|
+
position: absolute;
|
|
36
|
+
display: inline-flex;
|
|
37
|
+
opacity: 0;
|
|
38
|
+
transform: scaleX(0);
|
|
39
|
+
transition: all 0.5s;
|
|
40
|
+
z-index: ${zIndex(3)};
|
|
41
|
+
max-width: 176px;
|
|
42
|
+
overflow: scroll hidden;
|
|
43
|
+
padding-bottom: 2px;
|
|
44
|
+
outline: none;
|
|
45
|
+
&.visible {
|
|
46
|
+
opacity: 1;
|
|
47
|
+
transform: scaleX(1);
|
|
48
|
+
}
|
|
49
|
+
&::-webkit-scrollbar {
|
|
50
|
+
height: 4px;
|
|
51
|
+
}
|
|
52
|
+
&::-webkit-scrollbar-thumb {
|
|
53
|
+
border-radius: 10px;
|
|
54
|
+
background-color: #c1c1c1;
|
|
55
|
+
}
|
|
56
|
+
`;
|
|
53
57
|
const PageItem = css`
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
58
|
+
width: ${size === 'small' ? 20 : 24}px;
|
|
59
|
+
height: ${size === 'small' ? 20 : 24}px;
|
|
60
|
+
font-size: ${size === 'small' ? 12 : 14}px;
|
|
61
|
+
background-color: ${theme.colors.border};
|
|
62
|
+
border-radius: 50%;
|
|
63
|
+
text-align: center;
|
|
64
|
+
display: flex;
|
|
65
|
+
justify-content: center;
|
|
66
|
+
align-items: center;
|
|
67
|
+
margin: 0px 4px;
|
|
68
|
+
user-select: none;
|
|
69
|
+
cursor: pointer;
|
|
70
|
+
position: relative;
|
|
71
|
+
&:hover {
|
|
72
|
+
background-color: ${theme.colors.hover};
|
|
73
|
+
&:not(.active) .css-${PageItemNum.name} {
|
|
74
|
+
color: ${theme.colors.primary};
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
&.active {
|
|
78
|
+
background-color: ${theme.colors.brand};
|
|
79
|
+
}
|
|
80
|
+
`;
|
|
77
81
|
|
|
78
82
|
const setPagination = (newCurrentPage = 1) => {
|
|
79
83
|
const newLastPage = Math.ceil(totalItems / itemsPerPage);
|
|
@@ -10,6 +10,10 @@ import { Info, ApprovalFilled, Warning, Failed } from '../../icons';
|
|
|
10
10
|
import theme from '../../theme/settings';
|
|
11
11
|
import { getGlobal } from '../../global';
|
|
12
12
|
import { typography } from '../../styles/typography';
|
|
13
|
+
import { useTheme } from '../../theme';
|
|
14
|
+
const {
|
|
15
|
+
zIndex
|
|
16
|
+
} = useTheme();
|
|
13
17
|
export const icons = {
|
|
14
18
|
info: jsx(Info, {
|
|
15
19
|
viewBox: true
|
|
@@ -72,7 +76,7 @@ const Popup = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
72
76
|
pointer-events: ${!fullScreen ? 'none' : 'auto'};
|
|
73
77
|
opacity: 0;
|
|
74
78
|
transition: opacity 0.3s ease;
|
|
75
|
-
z-index:
|
|
79
|
+
z-index: ${zIndex(1)};
|
|
76
80
|
`;
|
|
77
81
|
const fadeInDown = keyframes`
|
|
78
82
|
from {
|
|
@@ -8,6 +8,10 @@ import theme from '../../theme/settings';
|
|
|
8
8
|
import { Button, ButtonIcon } from '../';
|
|
9
9
|
import { Close, Approval } from '../../icons';
|
|
10
10
|
import TextInput from '../form-control/text-input';
|
|
11
|
+
import { useTheme } from '../../theme';
|
|
12
|
+
const {
|
|
13
|
+
zIndex
|
|
14
|
+
} = useTheme();
|
|
11
15
|
const ProposalsPopup = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
12
16
|
open,
|
|
13
17
|
clearAble,
|
|
@@ -42,7 +46,7 @@ const ProposalsPopup = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
42
46
|
position: fixed;
|
|
43
47
|
width: 80%;
|
|
44
48
|
max-width: 480px;
|
|
45
|
-
z-index:
|
|
49
|
+
z-index: ${zIndex()};
|
|
46
50
|
transform: scale(0);
|
|
47
51
|
transition: transform 0.2s linear;
|
|
48
52
|
&.open {
|
|
@@ -13,6 +13,10 @@ import { capitalize, renderIcon } from '../../../utils';
|
|
|
13
13
|
import { animations } from '../../../styles/animation';
|
|
14
14
|
import { color as colors } from '../../../styles/colors';
|
|
15
15
|
import { alignCenter, border, borderBox, borderRadius4px, cursorPointer, displayBlock, ellipsis, flexCol, flexRow, justifyCenter, justifyEnd, overflowHidden, positionFixed, positionRelative } from '../../../styles/general';
|
|
16
|
+
import { useTheme } from '../../../theme';
|
|
17
|
+
const {
|
|
18
|
+
zIndex
|
|
19
|
+
} = useTheme();
|
|
16
20
|
const {
|
|
17
21
|
system: {
|
|
18
22
|
white
|
|
@@ -102,7 +106,7 @@ const Popup = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
102
106
|
background-color: rgba(21, 26, 48, 0.5);
|
|
103
107
|
opacity: 0;
|
|
104
108
|
transition: opacity 0.3s ease;
|
|
105
|
-
z-index:
|
|
109
|
+
z-index: ${zIndex(2)};
|
|
106
110
|
word-break: break-word;
|
|
107
111
|
.DGN-UI-Popup {
|
|
108
112
|
${flexCol}
|
|
@@ -461,13 +465,13 @@ Popup.propTypes = {
|
|
|
461
465
|
/** the function will run when click on cancel button */
|
|
462
466
|
onCancel: func,
|
|
463
467
|
|
|
464
|
-
/**
|
|
465
|
-
* named ref: get ref of Popup component, insist:<br />
|
|
466
|
-
* * element<br />
|
|
467
|
-
* * show: the method to show Popup (ref.current.show(options, callback))<br />
|
|
468
|
-
* + options: {type, title, icon, yesNo, description, confirmProps, cancelProps, onCancel, onConfirm}<br />
|
|
469
|
-
* + callback: the function will run after click on button (callback(true) with confirm Button and callback(false) with cancel Button). Alternate both onCancel, onConfirm methods of options<br />
|
|
470
|
-
* * close: the method to close Popup<br />
|
|
468
|
+
/**
|
|
469
|
+
* named ref: get ref of Popup component, insist:<br />
|
|
470
|
+
* * element<br />
|
|
471
|
+
* * show: the method to show Popup (ref.current.show(options, callback))<br />
|
|
472
|
+
* + options: {type, title, icon, yesNo, description, confirmProps, cancelProps, onCancel, onConfirm}<br />
|
|
473
|
+
* + callback: the function will run after click on button (callback(true) with confirm Button and callback(false) with cancel Button). Alternate both onCancel, onConfirm methods of options<br />
|
|
474
|
+
* * close: the method to close Popup<br />
|
|
471
475
|
*/
|
|
472
476
|
reference: oneOfType([func, shape({
|
|
473
477
|
current: instanceOf(elementType)
|
|
@@ -63,8 +63,8 @@ const getDimension = size => {
|
|
|
63
63
|
strokeWidth
|
|
64
64
|
};
|
|
65
65
|
};
|
|
66
|
-
/**
|
|
67
|
-
* Determinate circular progress
|
|
66
|
+
/**
|
|
67
|
+
* Determinate circular progress
|
|
68
68
|
*/
|
|
69
69
|
|
|
70
70
|
|
|
@@ -113,8 +113,8 @@ const Determinate = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
113
113
|
|
|
114
114
|
return angle;
|
|
115
115
|
};
|
|
116
|
-
/**
|
|
117
|
-
* style
|
|
116
|
+
/**
|
|
117
|
+
* style
|
|
118
118
|
*/
|
|
119
119
|
|
|
120
120
|
|
|
@@ -216,8 +216,8 @@ Determinate.propTypes = {
|
|
|
216
216
|
width: PropTypes.number
|
|
217
217
|
};
|
|
218
218
|
export const DeterminateCircularProgress = Determinate;
|
|
219
|
-
/**
|
|
220
|
-
* Indeterminate circular progress
|
|
219
|
+
/**
|
|
220
|
+
* Indeterminate circular progress
|
|
221
221
|
*/
|
|
222
222
|
|
|
223
223
|
const Indeterminate = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
@@ -254,8 +254,8 @@ const Indeterminate = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
254
254
|
stroke-dashoffset: -${r * 124 / 200};
|
|
255
255
|
}
|
|
256
256
|
`;
|
|
257
|
-
/**
|
|
258
|
-
* style
|
|
257
|
+
/**
|
|
258
|
+
* style
|
|
259
259
|
*/
|
|
260
260
|
|
|
261
261
|
|
|
@@ -286,8 +286,8 @@ const Indeterminate = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
286
286
|
stroke-linecap: round;
|
|
287
287
|
stroke-width: ${circleStrokeW};
|
|
288
288
|
`;
|
|
289
|
-
/**
|
|
290
|
-
* component
|
|
289
|
+
/**
|
|
290
|
+
* component
|
|
291
291
|
*/
|
|
292
292
|
|
|
293
293
|
const CircleBackgroundMemo = useMemo(() => jsx("circle", {
|
|
@@ -330,8 +330,8 @@ Indeterminate.propTypes = {
|
|
|
330
330
|
width: PropTypes.number
|
|
331
331
|
};
|
|
332
332
|
export const IndeterminateCircularProgress = Indeterminate;
|
|
333
|
-
/**
|
|
334
|
-
* Circular progress
|
|
333
|
+
/**
|
|
334
|
+
* Circular progress
|
|
335
335
|
*/
|
|
336
336
|
|
|
337
337
|
const CircularProgress = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
@@ -264,9 +264,9 @@ Rating.propTypes = {
|
|
|
264
264
|
/** style inline of stars icon */
|
|
265
265
|
starStyle: PropTypes.object,
|
|
266
266
|
|
|
267
|
-
/**
|
|
268
|
-
* the function for rating handler, return e:{value, ...element}<br />
|
|
269
|
-
* value: the quantity of star was selected (insist half)
|
|
267
|
+
/**
|
|
268
|
+
* the function for rating handler, return e:{value, ...element}<br />
|
|
269
|
+
* value: the quantity of star was selected (insist half)
|
|
270
270
|
*/
|
|
271
271
|
onRating: PropTypes.func
|
|
272
272
|
};
|