diginet-core-ui 1.3.36 → 1.3.37
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/images/menu/dhr/MHRM29N0002.svg +13 -0
- package/assets/images/menu/dhr/MHRP39N0018.svg +11 -0
- package/components/alert/index.js +115 -103
- package/components/alert/notify.js +0 -2
- package/components/avatar/index.js +19 -19
- package/components/chip/index.js +13 -10
- package/components/form-control/attachment/index.js +21 -20
- package/components/form-control/dropdown/index.js +132 -78
- package/components/modal/header.js +63 -65
- package/components/modal/modal.js +84 -130
- package/components/popover/index.js +21 -21
- package/components/slider/slider-item.js +65 -25
- package/icons/basic.js +75 -408
- package/package.json +1 -1
- package/readme.md +14 -0
- package/styles/general.js +33 -5
- package/theme/settings.js +3 -2
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<svg width="39" height="39" viewBox="0 0 39 39" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M34.66 9.48L25.43 0.34C25.22 0.12 24.92 0 24.62 0H8.46C6.55 0 5 1.54 5 3.43V35.57C5 37.46 6.55 39 8.46 39H31.53C33.44 39 34.99 37.46 34.99 35.57V10.28C35 9.97 34.87 9.68 34.66 9.48ZM25.77 3.9L31.06 9.14H26.92C26.28 9.14 25.77 8.63 25.77 8V3.9ZM32.69 35.58C32.69 36.21 32.17 36.72 31.54 36.72H8.46C7.82 36.72 7.31 36.21 7.31 35.58V3.43C7.31 2.8 7.83 2.29 8.46 2.29H23.46V8C23.46 9.89 25.01 11.43 26.92 11.43H31.04C31.05 11.43 31.06 11.43 31.07 11.43H32.69V35.58Z" fill="#2680EB"/>
|
|
3
|
+
<path d="M17.4799 14.0699C16.8399 14.6399 15.9299 14.8699 15.0599 14.5899C13.7399 14.1899 13.0099 12.7699 13.4099 11.4499C13.5199 11.0999 13.6999 10.7899 13.9399 10.5299L10.9799 7.56995L10.2999 8.18995C10.1799 8.29995 10.1599 8.48995 10.2499 8.61995L11.2699 10.0999C11.1699 10.2899 11.0899 10.4999 11.0299 10.6999C10.9599 10.9199 10.9199 11.1399 10.8899 11.3399L9.20995 11.9699C9.04995 12.0099 8.96995 12.1799 9.00995 12.3399L9.58995 14.9499C9.61995 15.1199 9.76995 15.2199 9.93995 15.2099L11.7299 15.0799C11.9799 15.4399 12.2599 15.7599 12.5999 16.0399L12.3099 17.7999C12.2799 17.9799 12.3699 18.1199 12.5299 18.1799L15.0699 18.9799C15.2299 19.0399 15.3999 18.9599 15.4799 18.8099L16.2399 17.1999C16.6899 17.1599 17.0999 17.0699 17.5199 16.9099L18.9099 18.0599C19.0299 18.1499 19.2099 18.1599 19.3399 18.0299L20.4299 17.0299L17.4799 14.0699Z" fill="#2680EB"/>
|
|
4
|
+
<path d="M30.79 28.13C30.79 27.5 30.27 26.99 29.64 26.99H19.23C18.59 26.99 18.08 27.5 18.08 28.13C18.08 28.76 18.6 29.27 19.23 29.27H29.64C30.27 29.27 30.79 28.76 30.79 28.13Z" fill="#FF8C00"/>
|
|
5
|
+
<path d="M29.64 22.41H19.23C18.59 22.41 18.08 22.92 18.08 23.55C18.08 24.18 18.6 24.69 19.23 24.69H29.64C30.28 24.69 30.79 24.18 30.79 23.55C30.79 22.92 30.27 22.41 29.64 22.41Z" fill="#FF8C00"/>
|
|
6
|
+
<path d="M19.23 31.56C18.59 31.56 18.08 32.07 18.08 32.7C18.08 33.33 18.6 33.84 19.23 33.84H25.02C25.66 33.84 26.17 33.33 26.17 32.7C26.17 32.07 25.65 31.56 25.02 31.56H19.23Z" fill="#FF8C00"/>
|
|
7
|
+
<path d="M10 25.8101H11.14V23.5701H10.18V22.8501C10.8 22.7501 11.11 22.6401 11.46 22.4301H12.33V25.8201H13.27V26.7601H10V25.8101Z" fill="#FF8C00"/>
|
|
8
|
+
<path d="M14.82 25.9401C14.82 25.4501 15.18 25.0501 15.72 25.0501C16.26 25.0501 16.62 25.4501 16.62 25.9401C16.62 26.4301 16.26 26.8301 15.72 26.8301C15.18 26.8301 14.82 26.4301 14.82 25.9401Z" fill="#FF8C00"/>
|
|
9
|
+
<path d="M10.06 33.17C11.23 32.23 12.08 31.5 12.08 30.91C12.08 30.52 11.83 30.34 11.44 30.34C11.12 30.34 10.86 30.55 10.63 30.75L10 30.12C10.48 29.64 10.92 29.42 11.61 29.42C12.55 29.42 13.2 29.98 13.2 30.84C13.2 31.54 12.47 32.3 11.75 32.9C11.99 32.87 12.32 32.85 12.54 32.85H13.42V33.83H10.06V33.17Z" fill="#FF8C00"/>
|
|
10
|
+
<path d="M15.02 33.03C15.02 32.54 15.38 32.14 15.92 32.14C16.46 32.14 16.82 32.54 16.82 33.03C16.82 33.52 16.46 33.92 15.92 33.92C15.38 33.92 15.02 33.53 15.02 33.03Z" fill="#FF8C00"/>
|
|
11
|
+
<path d="M16.02 6C14.51 6 13.06 6.57 11.96 7.6L12.72 8.36C13.59 7.56 14.75 7.08 16.02 7.07C18.73 7.07 20.93 9.27 20.93 11.98C20.93 13.25 20.44 14.41 19.64 15.28L20.4 16.04C21.39 14.98 21.99 13.55 22 11.98C22 8.68 19.32 6 16.02 6Z" fill="#FF8C00"/>
|
|
12
|
+
<path d="M19.73 12.3C19.73 12.59 19.49 12.83 19.19 12.83H17.2L15.48 11.11V8.86997C15.48 8.57997 15.72 8.33997 16.02 8.33997C16.31 8.33997 16.55 8.57997 16.56 8.86997V11.77H19.2C19.49 11.77 19.72 12.01 19.73 12.3Z" fill="#FF8C00"/>
|
|
13
|
+
</svg>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<svg width="39" height="39" viewBox="0 0 39 39" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M14.09 11.85L12.34 10.98C12.18 10.9 12.07 10.73 12.07 10.55V9.92C12.11 9.87 12.16 9.81 12.2 9.75C12.43 9.42 12.61 9.07 12.74 8.69C13 8.57 13.17 8.31 13.17 8.03V7.3C13.17 7.12 13.1 6.95 12.99 6.82V5.84C13.03 5.41 12.89 4.98 12.61 4.65C12.23 4.22 11.62 4 10.79 4C9.95996 4 9.34996 4.22 8.97996 4.65C8.69996 4.98 8.55996 5.41 8.58996 5.84V6.81C8.46996 6.94 8.40996 7.11 8.40996 7.29V8.02C8.40996 8.24 8.50996 8.45 8.67996 8.59C8.80996 9.07 9.01996 9.52 9.31996 9.91V10.52C9.31996 10.7 9.21996 10.86 9.06996 10.94L7.43996 11.83C6.90996 12.12 6.57996 12.68 6.57996 13.28V14.06H15V13.32C15 12.7 14.65 12.13 14.09 11.85Z" fill="#111D5E"/>
|
|
3
|
+
<path d="M23.86 17H15.43C14.8 17 14.29 17.51 14.29 18.14C14.29 18.77 14.8 19.28 15.43 19.28H23.86C24.49 19.28 25 18.77 25 18.14C25 17.51 24.49 17 23.86 17Z" fill="#2680EB"/>
|
|
4
|
+
<path d="M15.43 21.57H18.65C18.64 21.57 18.63 21.58 18.62 21.58C18.24 21.73 18 22.1 18 22.5V23.86H15.43C14.8 23.86 14.29 23.35 14.29 22.71C14.29 22.08 14.8 21.57 15.43 21.57Z" fill="#2680EB"/>
|
|
5
|
+
<path d="M15.43 26.14H18V28.43H15.43C14.8 28.43 14.29 27.92 14.29 27.29C14.29 26.65 14.8 26.14 15.43 26.14Z" fill="#2680EB"/>
|
|
6
|
+
<path d="M15.43 30.71H18V33H15.43C14.8 33 14.29 32.49 14.29 31.86C14.29 31.22 14.8 30.71 15.43 30.71Z" fill="#2680EB"/>
|
|
7
|
+
<path d="M11.8 21.14C11.78 21.13 11.75 21.12 11.73 21.12C11.68 21.12 11.64 21.14 11.61 21.17L11.27 21.51C11.24 21.54 11.22 21.58 11.22 21.63V23C11.22 23.23 11.14 23.44 10.97 23.61C10.8 23.78 10.59 23.86 10.36 23.86H5.86004C5.62004 23.86 5.42004 23.78 5.25004 23.61C5.07004 23.44 4.99004 23.23 4.99004 23V18.55C4.99004 18.32 5.07004 18.11 5.24004 17.94C5.41004 17.77 5.62004 17.69 5.85004 17.69H10.35C10.43 17.69 10.51 17.7 10.59 17.72C10.61 17.73 10.63 17.73 10.64 17.73C10.69 17.73 10.73 17.71 10.76 17.68L11.03 17.42C11.08 17.37 11.09 17.32 11.08 17.26C11.07 17.2 11.03 17.16 10.98 17.14C10.79 17.05 10.58 17 10.35 17H5.85004C5.42004 17 5.05004 17.15 4.75004 17.45C4.44004 17.75 4.29004 18.12 4.29004 18.54V22.99C4.29004 23.41 4.44004 23.78 4.75004 24.08C5.06004 24.38 5.42004 24.53 5.85004 24.53H10.35C10.78 24.53 11.15 24.38 11.45 24.08C11.76 23.78 11.91 23.41 11.91 22.99V21.29C11.91 21.21 11.87 21.16 11.8 21.14ZM13.16 18.07L12.56 17.48C12.48 17.4 12.37 17.35 12.25 17.35C12.13 17.35 12.03 17.4 11.94 17.48L8.44004 20.94L7.02004 19.53C6.94004 19.45 6.83004 19.4 6.71004 19.4C6.59004 19.4 6.49004 19.45 6.40004 19.53L5.80004 20.12C5.72004 20.2 5.67004 20.31 5.67004 20.42C5.67004 20.54 5.72004 20.64 5.80004 20.72L8.13004 23.02C8.21004 23.1 8.32004 23.15 8.44004 23.15C8.56004 23.15 8.66004 23.1 8.75004 23.02L13.15 18.67C13.23 18.59 13.28 18.48 13.28 18.37C13.29 18.26 13.25 18.15 13.16 18.07Z" fill="#2680EB"/>
|
|
8
|
+
<path d="M11.84 29.6C11.82 29.59 11.79 29.58 11.77 29.58C11.72 29.58 11.68 29.6 11.65 29.63L11.31 29.97C11.28 30 11.26 30.04 11.26 30.09V31.45C11.26 31.68 11.18 31.89 11.01 32.06C10.84 32.23 10.63 32.31 10.4 32.31H5.88996C5.64996 32.31 5.44996 32.23 5.27996 32.06C5.09996 31.9 5.01996 31.7 5.01996 31.46V27.01C5.01996 26.78 5.09996 26.57 5.26996 26.4C5.43996 26.23 5.64996 26.15 5.87996 26.15H10.38C10.46 26.15 10.54 26.16 10.62 26.18C10.64 26.19 10.66 26.19 10.67 26.19C10.72 26.19 10.76 26.17 10.79 26.14L11.06 25.88C11.11 25.83 11.12 25.78 11.11 25.72C11.1 25.66 11.06 25.62 11.01 25.6C10.82 25.51 10.6 25.46 10.37 25.46H5.88996C5.45996 25.46 5.08996 25.61 4.78996 25.91C4.47996 26.21 4.32996 26.58 4.32996 27V31.45C4.32996 31.87 4.47996 32.24 4.78996 32.54C5.08996 32.85 5.45996 33 5.88996 33H10.39C10.82 33 11.19 32.85 11.49 32.55C11.8 32.25 11.95 31.88 11.95 31.46V29.76C11.95 29.69 11.91 29.63 11.84 29.6ZM13.2 26.53L12.6 25.94C12.52 25.86 12.41 25.81 12.29 25.81C12.17 25.81 12.07 25.86 11.98 25.94L8.47996 29.4L7.05996 27.99C6.97996 27.91 6.86996 27.86 6.74996 27.86C6.62996 27.86 6.52996 27.91 6.43996 27.99L5.83996 28.58C5.75996 28.66 5.70996 28.77 5.70996 28.88C5.70996 28.99 5.75996 29.1 5.83996 29.18L8.16996 31.48C8.24996 31.56 8.35996 31.61 8.47996 31.61C8.59996 31.61 8.69996 31.56 8.78996 31.48L13.19 27.13C13.27 27.05 13.32 26.94 13.32 26.83C13.33 26.72 13.29 26.62 13.2 26.53Z" fill="#2680EB"/>
|
|
9
|
+
<path d="M21.86 36.71H3.43C2.8 36.71 2.29 36.2 2.29 35.57V3.43C2.29 2.8 2.8 2.29 3.43 2.29H18.28V8C18.28 9.89 19.82 11.43 21.71 11.43H25.79C25.8 11.43 25.81 11.43 25.82 11.43H27.43V19.23C28.1 19.09 28.79 19 29.5 19C29.57 19 29.64 19.01 29.71 19.01V10.29C29.71 9.98 29.58 9.69 29.38 9.48L20.24 0.34C20.02 0.12 19.73 0 19.42 0H3.42C1.54 0 0 1.54 0 3.43V35.57C0 37.46 1.54 39 3.43 39H25.04C23.85 38.44 22.76 37.67 21.86 36.71ZM20.57 3.9L25.81 9.14H21.71C21.08 9.14 20.57 8.63 20.57 8V3.9Z" fill="#2680EB"/>
|
|
10
|
+
<path d="M29.5 20C26 20 22.9 21.9 21.3 24.8L19 22.5V29H25.5L22.7 26.2C24 23.7 26.5 22 29.5 22C33.6 22 37 25.4 37 29.5C37 33.6 33.6 37 29.5 37C26.2 37 23.5 34.9 22.4 32H20.3C21.4 36 25.1 39 29.5 39C34.8 39 39 34.7 39 29.5C39 24.3 34.7 20 29.5 20ZM28 25V30.1L32.7 32.9L33.5 31.6L29.5 29.2V25H28Z" fill="#FF8C00"/>
|
|
11
|
+
</svg>
|
|
@@ -7,10 +7,10 @@ import { jsx, css } from '@emotion/core';
|
|
|
7
7
|
import LinearProgress from '../progress/linear';
|
|
8
8
|
import { color as colors } from '../../styles/colors';
|
|
9
9
|
import ButtonIcon from '../button/icon';
|
|
10
|
-
import
|
|
11
|
-
import { capitalize } from '../../utils';
|
|
10
|
+
import Icon from '../../icons';
|
|
12
11
|
import { hexToRGBA } from '../../styles/color-helper';
|
|
13
12
|
import { typography } from '../../styles/typography';
|
|
13
|
+
import { alignCenter, border, borderBox, borderRadius4px, breakWord, displayBlock, flexRow, justifyStart, positionRelative, userSelectNone } from '../../styles/general';
|
|
14
14
|
const {
|
|
15
15
|
heading3,
|
|
16
16
|
heading4,
|
|
@@ -21,16 +21,10 @@ const {
|
|
|
21
21
|
} = typography;
|
|
22
22
|
const {
|
|
23
23
|
system: {
|
|
24
|
-
rest
|
|
25
|
-
|
|
26
|
-
semantic: {
|
|
27
|
-
success,
|
|
28
|
-
warning,
|
|
29
|
-
danger,
|
|
30
|
-
info
|
|
24
|
+
rest,
|
|
25
|
+
white
|
|
31
26
|
}
|
|
32
27
|
} = colors;
|
|
33
|
-
const colorMap = new Map([['info', info], ['success', success], ['warning', warning], ['danger', danger]]);
|
|
34
28
|
const iconMap = new Map([['info', 'Info'], ['success', 'ApprovalFilled'], ['warning', 'Warning'], ['danger', 'CancelFilled']]);
|
|
35
29
|
const maxWidthMap = new Map([['tiny', 320], ['small', 400], ['medium', 480]]);
|
|
36
30
|
const primaryTypoMap = new Map([['tiny', heading5], ['small', heading4], ['medium', heading3]]);
|
|
@@ -46,76 +40,25 @@ const Alert = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
46
40
|
autoDisappear,
|
|
47
41
|
duration,
|
|
48
42
|
clearAble,
|
|
49
|
-
refs,
|
|
50
43
|
onClose,
|
|
51
|
-
|
|
52
|
-
children,
|
|
53
|
-
...props
|
|
44
|
+
children
|
|
54
45
|
}, ref) => {
|
|
55
46
|
const clearIconRef = useRef(null);
|
|
56
47
|
const [percentState, setPercentState] = useState(100);
|
|
57
|
-
const mainColor =
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
min-width: 320px;
|
|
72
|
-
border: 1px solid ${mainColor};
|
|
73
|
-
color: ${mainColor};
|
|
74
|
-
background-color: ${hexToRGBA(mainColor, 0.15)};
|
|
75
|
-
box-sizing: border-box;
|
|
76
|
-
border-radius: 4px;
|
|
77
|
-
padding: 0 4px 0 16px;
|
|
78
|
-
opacity: 1;
|
|
79
|
-
word-break: break-word;
|
|
80
|
-
`;
|
|
81
|
-
const AlertIcon = css`
|
|
82
|
-
display: inherit;
|
|
83
|
-
margin-right: 10px;
|
|
84
|
-
padding: 8px 0;
|
|
85
|
-
`;
|
|
86
|
-
const AlertText = css`
|
|
87
|
-
display: block;
|
|
88
|
-
margin-right: ${clearAble ? '10px' : 0};
|
|
89
|
-
padding: 8px 0;
|
|
90
|
-
`;
|
|
91
|
-
const AlertPrimary = css`
|
|
92
|
-
display: flex;
|
|
93
|
-
position: relative;
|
|
94
|
-
align-items: center;
|
|
95
|
-
justify-content: flex-start;
|
|
96
|
-
user-select: none;
|
|
97
|
-
${secondary ? primaryTypoMap.get(size) : paragraph1}
|
|
98
|
-
`;
|
|
99
|
-
const AlertSecondary = css`
|
|
100
|
-
display: block;
|
|
101
|
-
user-select: none;
|
|
102
|
-
${size === 'tiny' ? paragraph3 : paragraph2}
|
|
103
|
-
`;
|
|
104
|
-
const AlertClearIcon = css`
|
|
105
|
-
margin-left: auto;
|
|
106
|
-
`;
|
|
107
|
-
const linearProgressStyle = css`
|
|
108
|
-
display: block;
|
|
109
|
-
position: relative;
|
|
110
|
-
margin-top: ${size === 'medium' ? '4px' : '2px'};
|
|
111
|
-
padding: 0 5px;
|
|
112
|
-
`;
|
|
113
|
-
const NotFoundIcon = css`
|
|
114
|
-
display: block;
|
|
115
|
-
width: 70%;
|
|
116
|
-
height: 70%;
|
|
117
|
-
border: 1px dashed ${rest};
|
|
118
|
-
`;
|
|
48
|
+
const mainColor = colors[color];
|
|
49
|
+
const opacityColor = hexToRGBA(mainColor, 0.15);
|
|
50
|
+
|
|
51
|
+
const _AlertContainerCSS = AlertContainerCSS(size, progressing, duration);
|
|
52
|
+
|
|
53
|
+
const _AlertInfoCSS = AlertInfoCSS(mainColor, opacityColor);
|
|
54
|
+
|
|
55
|
+
const _AlertTextCSS = AlertTextCSS(clearAble);
|
|
56
|
+
|
|
57
|
+
const _AlertPrimaryCSS = AlertPrimaryCSS(secondary, size);
|
|
58
|
+
|
|
59
|
+
const _AlertSecondaryCSS = AlertSecondaryCSS(size);
|
|
60
|
+
|
|
61
|
+
const _linearProgressCSS = linearProgressCSS(size);
|
|
119
62
|
|
|
120
63
|
const onClearAlert = (el, urgency) => {
|
|
121
64
|
var _el$parentNode;
|
|
@@ -144,10 +87,11 @@ const Alert = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
144
87
|
let node = children;
|
|
145
88
|
|
|
146
89
|
if (!node) {
|
|
147
|
-
const
|
|
90
|
+
const iconName = iconMap.get(color);
|
|
148
91
|
|
|
149
|
-
if (
|
|
150
|
-
node = jsx(
|
|
92
|
+
if (iconName) {
|
|
93
|
+
node = jsx(Icon, {
|
|
94
|
+
name: iconName,
|
|
151
95
|
width: iconSizeMap.get(size),
|
|
152
96
|
height: iconSizeMap.get(size),
|
|
153
97
|
color: 'currentColor',
|
|
@@ -155,27 +99,31 @@ const Alert = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
155
99
|
});
|
|
156
100
|
} else {
|
|
157
101
|
node = jsx("span", {
|
|
158
|
-
css:
|
|
102
|
+
css: NotFoundIconCSS
|
|
159
103
|
});
|
|
160
104
|
}
|
|
161
105
|
}
|
|
162
106
|
|
|
163
107
|
return jsx("div", {
|
|
164
|
-
css:
|
|
165
|
-
className: ['DGN-UI-Alert', className].join(' ').trim(),
|
|
166
|
-
...props
|
|
108
|
+
css: _AlertInfoCSS,
|
|
109
|
+
className: ['DGN-UI-Alert', className].join(' ').trim().replace(/\s+/g, ' ')
|
|
167
110
|
}, jsx("span", {
|
|
168
|
-
css:
|
|
111
|
+
css: AlertIconCSS,
|
|
112
|
+
className: 'DGN-UI-Alert-Icon'
|
|
169
113
|
}, node), jsx("span", {
|
|
170
|
-
css:
|
|
114
|
+
css: _AlertTextCSS,
|
|
115
|
+
className: 'DGN-UI-Alert-Content'
|
|
171
116
|
}, jsx("span", {
|
|
172
|
-
css:
|
|
117
|
+
css: _AlertPrimaryCSS,
|
|
118
|
+
className: 'DGN-UI-Alert-Content-Primary'
|
|
173
119
|
}, children ? typeof children === 'string' ? children : jsx("children", null) : text), secondary && jsx("span", {
|
|
174
|
-
css:
|
|
120
|
+
css: _AlertSecondaryCSS,
|
|
121
|
+
className: 'DGN-UI-Alert-Content-Secondary'
|
|
175
122
|
}, secondary)), jsx("span", {
|
|
176
|
-
css:
|
|
123
|
+
css: AlertClearIconCSS,
|
|
177
124
|
onClick: e => onClearAlert(e.currentTarget, true),
|
|
178
|
-
ref: clearIconRef
|
|
125
|
+
ref: clearIconRef,
|
|
126
|
+
className: 'DGN-UI-Alert-Clear'
|
|
179
127
|
}, clearAble ? jsx(ButtonIcon, {
|
|
180
128
|
circular: true,
|
|
181
129
|
viewType: 'text',
|
|
@@ -183,10 +131,11 @@ const Alert = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
183
131
|
color: color,
|
|
184
132
|
name: 'Close'
|
|
185
133
|
}) : null));
|
|
186
|
-
}, [color, text, clearAble, secondary, size]);
|
|
134
|
+
}, [color, text, clearAble, secondary, size, children, className]);
|
|
187
135
|
const LinearView = useMemo(() => {
|
|
188
136
|
return progressing ? jsx("span", {
|
|
189
|
-
css:
|
|
137
|
+
css: _linearProgressCSS,
|
|
138
|
+
className: 'DGN-UI-Progress'
|
|
190
139
|
}, jsx(LinearProgress, {
|
|
191
140
|
determinate: true,
|
|
192
141
|
background: 'transparent',
|
|
@@ -198,10 +147,8 @@ const Alert = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
198
147
|
boxShadow: 'none'
|
|
199
148
|
}
|
|
200
149
|
})) : null;
|
|
201
|
-
}, [percentState]);
|
|
150
|
+
}, [progressing, size, percentState]);
|
|
202
151
|
useEffect(() => {
|
|
203
|
-
if (refs) refs(ref);
|
|
204
|
-
|
|
205
152
|
if (progressing) {
|
|
206
153
|
setTimeout(() => {
|
|
207
154
|
setPercentState(0);
|
|
@@ -213,17 +160,88 @@ const Alert = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
213
160
|
}
|
|
214
161
|
}, []);
|
|
215
162
|
return jsx("div", {
|
|
216
|
-
css:
|
|
163
|
+
css: _AlertContainerCSS,
|
|
164
|
+
className: 'DGN-UI-Container-Alert',
|
|
217
165
|
ref: ref
|
|
218
166
|
}, AlertView, LinearView);
|
|
219
167
|
}));
|
|
168
|
+
|
|
169
|
+
const AlertContainerCSS = (size, progressing, duration) => css`
|
|
170
|
+
${positionRelative};
|
|
171
|
+
${displayBlock};
|
|
172
|
+
max-width: ${maxWidthMap.get(size)}px;
|
|
173
|
+
transition: opacity ${progressing ? duration / 2 + 1 : duration * 1}s ease ${progressing ? duration / 2 : 0}s;
|
|
174
|
+
margin-bottom: 1rem;
|
|
175
|
+
pointer-events: auto;
|
|
176
|
+
z-index: 9001;
|
|
177
|
+
`;
|
|
178
|
+
|
|
179
|
+
const AlertInfoCSS = (mainColor, opacityColor) => css`
|
|
180
|
+
${flexRow};
|
|
181
|
+
${positionRelative};
|
|
182
|
+
${borderBox};
|
|
183
|
+
${borderRadius4px};
|
|
184
|
+
${breakWord};
|
|
185
|
+
${border(1, mainColor)};
|
|
186
|
+
color: ${mainColor};
|
|
187
|
+
background-image: linear-gradient(${opacityColor}, ${opacityColor});
|
|
188
|
+
background-color: ${white};
|
|
189
|
+
width: 100%;
|
|
190
|
+
min-width: 320px;
|
|
191
|
+
padding: 0 4px 0 16px;
|
|
192
|
+
opacity: 1;
|
|
193
|
+
`;
|
|
194
|
+
|
|
195
|
+
const AlertIconCSS = css`
|
|
196
|
+
display: inherit;
|
|
197
|
+
margin-right: 10px;
|
|
198
|
+
padding: 8px 0;
|
|
199
|
+
`;
|
|
200
|
+
|
|
201
|
+
const AlertTextCSS = clearAble => css`
|
|
202
|
+
${displayBlock};
|
|
203
|
+
margin-right: ${clearAble ? '10px' : 0};
|
|
204
|
+
padding: 8px 0;
|
|
205
|
+
`;
|
|
206
|
+
|
|
207
|
+
const AlertPrimaryCSS = (secondary, size) => css`
|
|
208
|
+
${flexRow};
|
|
209
|
+
${positionRelative};
|
|
210
|
+
${alignCenter};
|
|
211
|
+
${justifyStart};
|
|
212
|
+
${userSelectNone};
|
|
213
|
+
${secondary ? primaryTypoMap.get(size) : paragraph1}
|
|
214
|
+
`;
|
|
215
|
+
|
|
216
|
+
const AlertSecondaryCSS = size => css`
|
|
217
|
+
${displayBlock};
|
|
218
|
+
${userSelectNone};
|
|
219
|
+
${size === 'tiny' ? paragraph3 : paragraph2}
|
|
220
|
+
`;
|
|
221
|
+
|
|
222
|
+
const AlertClearIconCSS = css`
|
|
223
|
+
margin-left: auto;
|
|
224
|
+
`;
|
|
225
|
+
|
|
226
|
+
const linearProgressCSS = size => css`
|
|
227
|
+
${displayBlock};
|
|
228
|
+
${positionRelative};
|
|
229
|
+
margin-top: ${size === 'medium' ? '4px' : '2px'};
|
|
230
|
+
padding: 0 5px;
|
|
231
|
+
`;
|
|
232
|
+
|
|
233
|
+
const NotFoundIconCSS = css`
|
|
234
|
+
${displayBlock};
|
|
235
|
+
width: 70%;
|
|
236
|
+
height: 70%;
|
|
237
|
+
border: 1px dashed ${rest};
|
|
238
|
+
`;
|
|
220
239
|
Alert.defaultProps = {
|
|
221
240
|
color: 'info',
|
|
222
241
|
size: 'medium',
|
|
223
242
|
className: '',
|
|
224
243
|
clearAble: true,
|
|
225
244
|
progressing: false,
|
|
226
|
-
usedByNotify: false,
|
|
227
245
|
autoDisappear: false,
|
|
228
246
|
duration: 5
|
|
229
247
|
};
|
|
@@ -255,16 +273,10 @@ Alert.propTypes = {
|
|
|
255
273
|
/** The amount of time the alert is displayed. The unit is the second */
|
|
256
274
|
duration: PropTypes.number,
|
|
257
275
|
|
|
258
|
-
/** refs is a function, use to get ref of Alert component */
|
|
259
|
-
refs: PropTypes.func,
|
|
260
|
-
|
|
261
276
|
/** The function will run after remove an Alert component */
|
|
262
277
|
onClose: PropTypes.func,
|
|
263
278
|
|
|
264
279
|
/** The element to display in alert like text props (priority) */
|
|
265
|
-
children: PropTypes.node
|
|
266
|
-
|
|
267
|
-
/** any props else */
|
|
268
|
-
props: PropTypes.any
|
|
280
|
+
children: PropTypes.node
|
|
269
281
|
};
|
|
270
282
|
export default Alert;
|
|
@@ -119,14 +119,12 @@ const AlertNotify = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
119
119
|
|
|
120
120
|
ReactDOM.render( /*#__PURE__*/React.createElement(Alert, {
|
|
121
121
|
onClose: e => onClose(e, position),
|
|
122
|
-
usedByNotify: true,
|
|
123
122
|
...props,
|
|
124
123
|
...options
|
|
125
124
|
}, message), document.querySelector(`div[class^="Notify-Alert-${position.vertical}-${position.horizontal}"]`).appendChild(el));
|
|
126
125
|
} else {
|
|
127
126
|
ReactDOM.render( /*#__PURE__*/React.createElement(Alert, {
|
|
128
127
|
onClose: onClose,
|
|
129
|
-
usedByNotify: true,
|
|
130
128
|
...props,
|
|
131
129
|
...options
|
|
132
130
|
}, message), document.querySelector(`div[class^="Notify-Alert-"]`).appendChild(el));
|
|
@@ -498,18 +498,18 @@ Avatar.propTypes = {
|
|
|
498
498
|
/** source of file (http:// or https://) */
|
|
499
499
|
src: PropTypes.string,
|
|
500
500
|
|
|
501
|
-
/**
|
|
502
|
-
* it is used to display the default if there is no src<br />
|
|
503
|
-
* if undefined, will display icons available in the icons store
|
|
501
|
+
/**
|
|
502
|
+
* it is used to display the default if there is no src<br />
|
|
503
|
+
* if undefined, will display icons available in the icons store
|
|
504
504
|
*/
|
|
505
505
|
defaultSrc: PropTypes.string,
|
|
506
506
|
|
|
507
507
|
/** the direction to display more info */
|
|
508
508
|
direction: PropTypes.oneOf(['top', 'down', 'left', 'right']),
|
|
509
509
|
|
|
510
|
-
/**
|
|
511
|
-
* data to display when hoverAble is true<br />
|
|
512
|
-
* data is an object or function return a jsx element
|
|
510
|
+
/**
|
|
511
|
+
* data to display when hoverAble is true<br />
|
|
512
|
+
* data is an object or function return a jsx element
|
|
513
513
|
*/
|
|
514
514
|
data: PropTypes.oneOfType([PropTypes.object, PropTypes.func]),
|
|
515
515
|
|
|
@@ -525,19 +525,19 @@ Avatar.propTypes = {
|
|
|
525
525
|
/** any props else */
|
|
526
526
|
props: PropTypes.any,
|
|
527
527
|
|
|
528
|
-
/**
|
|
529
|
-
* ref methods
|
|
530
|
-
*
|
|
531
|
-
* * option(): Gets all UI component properties
|
|
532
|
-
* * Returns value - object
|
|
533
|
-
* * option(optionName): Gets the value of a single property
|
|
534
|
-
* * @param {optionName} - string
|
|
535
|
-
* * Returns value - any
|
|
536
|
-
* * option(optionName, optionValue): Updates the value of a single property
|
|
537
|
-
* * @param {optionName} - string
|
|
538
|
-
* * @param {optionValue} - any
|
|
539
|
-
* * option(options): Updates the values of several properties
|
|
540
|
-
* * @param {options} - object
|
|
528
|
+
/**
|
|
529
|
+
* ref methods
|
|
530
|
+
*
|
|
531
|
+
* * option(): Gets all UI component properties
|
|
532
|
+
* * Returns value - object
|
|
533
|
+
* * option(optionName): Gets the value of a single property
|
|
534
|
+
* * @param {optionName} - string
|
|
535
|
+
* * Returns value - any
|
|
536
|
+
* * option(optionName, optionValue): Updates the value of a single property
|
|
537
|
+
* * @param {optionName} - string
|
|
538
|
+
* * @param {optionValue} - any
|
|
539
|
+
* * option(options): Updates the values of several properties
|
|
540
|
+
* * @param {options} - object
|
|
541
541
|
*/
|
|
542
542
|
reference: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
543
543
|
current: PropTypes.instanceOf(Element)
|
package/components/chip/index.js
CHANGED
|
@@ -48,7 +48,7 @@ const Chip = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
48
48
|
disabled,
|
|
49
49
|
readOnly,
|
|
50
50
|
children,
|
|
51
|
-
|
|
51
|
+
style
|
|
52
52
|
}, reference) => {
|
|
53
53
|
const ref = useRef(null);
|
|
54
54
|
const IconRef = useRef(null);
|
|
@@ -103,7 +103,7 @@ const Chip = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
103
103
|
});
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
-
return jsx("div", {
|
|
106
|
+
return startIcon && jsx("div", {
|
|
107
107
|
css: ChipIconCSS,
|
|
108
108
|
className: size
|
|
109
109
|
}, node);
|
|
@@ -114,7 +114,8 @@ const Chip = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
114
114
|
className: size
|
|
115
115
|
}, jsx(Typography, {
|
|
116
116
|
type: size === 'small' ? 'p2' : 'p1',
|
|
117
|
-
color: 'inherit'
|
|
117
|
+
color: 'inherit',
|
|
118
|
+
lineClamp: 1
|
|
118
119
|
}, renderLabel()));
|
|
119
120
|
}, [label, size, startIcon, endIcon, clearAble]);
|
|
120
121
|
const endIconView = useMemo(() => {
|
|
@@ -138,20 +139,21 @@ const Chip = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
138
139
|
viewType: 'ghost',
|
|
139
140
|
name: 'Close',
|
|
140
141
|
color: viewType === 'outlined' && color ? 'inherit' : undefined,
|
|
142
|
+
disabled: disabled,
|
|
141
143
|
onClick: onRemoveHandler
|
|
142
144
|
})) : endIcon && jsx("div", {
|
|
143
145
|
css: ChipIconCSS,
|
|
144
146
|
className: 'end-icon ' + size,
|
|
145
147
|
ref: IconRef
|
|
146
148
|
}, node);
|
|
147
|
-
}, [clearAble, viewType, color, endIcon, size]);
|
|
149
|
+
}, [clearAble, viewType, color, endIcon, size, disabled]);
|
|
148
150
|
return jsx("div", {
|
|
149
151
|
css: ChipRootCSS(onClick, onDbClick, color),
|
|
150
152
|
ref: ref,
|
|
151
153
|
className: ['DGN-UI-Chip', size, className, color && color !== 'default' && color, color && color !== 'default' && viewType, disabled && 'chip--disabled', readOnly && 'chip--readOnly'].join(' ').trim().replace(/\s+/g, ' '),
|
|
154
|
+
style: style,
|
|
152
155
|
onClick: _onClick,
|
|
153
|
-
onDoubleClick: _onDbClick
|
|
154
|
-
...props
|
|
156
|
+
onDoubleClick: _onDbClick
|
|
155
157
|
}, startIconView, labelView, endIconView, children);
|
|
156
158
|
}));
|
|
157
159
|
const ChipIconCSS = css`
|
|
@@ -272,6 +274,7 @@ const ChipRootCSS = (onClick, onDbClick, color) => css`
|
|
|
272
274
|
Chip.defaultProps = {
|
|
273
275
|
label: '',
|
|
274
276
|
className: '',
|
|
277
|
+
style: {},
|
|
275
278
|
viewType: 'outlined',
|
|
276
279
|
size: 'small',
|
|
277
280
|
clearAble: false
|
|
@@ -284,6 +287,9 @@ Chip.propTypes = {
|
|
|
284
287
|
className: PropTypes.string,
|
|
285
288
|
|
|
286
289
|
/** max length content to display was allowed */
|
|
290
|
+
|
|
291
|
+
/** style inline of component */
|
|
292
|
+
style: PropTypes.object,
|
|
287
293
|
maxLength: PropTypes.number,
|
|
288
294
|
|
|
289
295
|
/** the icon display at head of Chip */
|
|
@@ -326,9 +332,6 @@ Chip.propTypes = {
|
|
|
326
332
|
onDoubleClick: PropTypes.func,
|
|
327
333
|
|
|
328
334
|
/** content to display on Chip (the same to label) */
|
|
329
|
-
children: PropTypes.node
|
|
330
|
-
|
|
331
|
-
/** any props else */
|
|
332
|
-
props: PropTypes.any
|
|
335
|
+
children: PropTypes.node
|
|
333
336
|
};
|
|
334
337
|
export default Chip;
|
|
@@ -1856,6 +1856,7 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
1856
1856
|
ref.current.allNewAttached = allNewAttached;
|
|
1857
1857
|
ref.current.attached = attached;
|
|
1858
1858
|
ref.current.clear = clearAllAttached;
|
|
1859
|
+
ref.current.openFileDialog = triggerClickInput;
|
|
1859
1860
|
return ref.current;
|
|
1860
1861
|
});
|
|
1861
1862
|
return jsx("div", { ...props,
|
|
@@ -1880,17 +1881,17 @@ Attachment.defaultProps = {
|
|
|
1880
1881
|
uploadErrorInfo: {}
|
|
1881
1882
|
};
|
|
1882
1883
|
Attachment.propTypes = {
|
|
1883
|
-
/** List attachment:<br />
|
|
1884
|
-
* [{<br />
|
|
1885
|
-
* "AttachmentID": "ATT2U8O7YPTF1KSNCW3X",<br />
|
|
1886
|
-
* "URL": "https://apricot.diginet.com.vn/cdn-dev/file/8a07bee1eeff17a14eee.jpg?path=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmaWxlUGF0aCI6Ii8yMDIwLzA4LzQ0YjNhYjQ4LTMwNGQtNDQ3NC05ZDk0LWNkNGVlMDQwOGNlMy5qcGciLCJmaWxlTmFtZSI6IjhhMDdiZWUxZWVmZjE3YTE0ZWVlLmpwZyIsImZpbGVTaXplIjoyNDg4MzcsImZpbGVUeXBlIjoiaW1hZ2UvanBlZyIsImlhdCI6MTU5ODI0NDMwMiwiZXhwIjo4Nzk5ODI0NDMwMn0.fow6O5fp2z3vieA9gom5RRwQ7xxwBx9_7X2Fe8T2YI0",<br />
|
|
1887
|
-
* "FileName": "8a07bee1eeff17a14eee.jpg",<br />
|
|
1888
|
-
* "FileSize": 248837,<br />
|
|
1889
|
-
* "KeyID": "W39OAD3YGLCWAQKV1D6PGEKNW4RLGVTZTUWLYEVFQ2QG8AOCXW",<br />
|
|
1890
|
-
* "CreateUserID": "LEMONADMIN",<br />
|
|
1891
|
-
* "CreateDate": "2020-08-24T11:54:04.307Z",<br />
|
|
1892
|
-
* "UserName": "Quản trị hệ thống"<br />
|
|
1893
|
-
* }, ...]
|
|
1884
|
+
/** List attachment:<br />
|
|
1885
|
+
* [{<br />
|
|
1886
|
+
* "AttachmentID": "ATT2U8O7YPTF1KSNCW3X",<br />
|
|
1887
|
+
* "URL": "https://apricot.diginet.com.vn/cdn-dev/file/8a07bee1eeff17a14eee.jpg?path=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmaWxlUGF0aCI6Ii8yMDIwLzA4LzQ0YjNhYjQ4LTMwNGQtNDQ3NC05ZDk0LWNkNGVlMDQwOGNlMy5qcGciLCJmaWxlTmFtZSI6IjhhMDdiZWUxZWVmZjE3YTE0ZWVlLmpwZyIsImZpbGVTaXplIjoyNDg4MzcsImZpbGVUeXBlIjoiaW1hZ2UvanBlZyIsImlhdCI6MTU5ODI0NDMwMiwiZXhwIjo4Nzk5ODI0NDMwMn0.fow6O5fp2z3vieA9gom5RRwQ7xxwBx9_7X2Fe8T2YI0",<br />
|
|
1888
|
+
* "FileName": "8a07bee1eeff17a14eee.jpg",<br />
|
|
1889
|
+
* "FileSize": 248837,<br />
|
|
1890
|
+
* "KeyID": "W39OAD3YGLCWAQKV1D6PGEKNW4RLGVTZTUWLYEVFQ2QG8AOCXW",<br />
|
|
1891
|
+
* "CreateUserID": "LEMONADMIN",<br />
|
|
1892
|
+
* "CreateDate": "2020-08-24T11:54:04.307Z",<br />
|
|
1893
|
+
* "UserName": "Quản trị hệ thống"<br />
|
|
1894
|
+
* }, ...]
|
|
1894
1895
|
*/
|
|
1895
1896
|
data: PropTypes.array,
|
|
1896
1897
|
|
|
@@ -1963,15 +1964,15 @@ Attachment.propTypes = {
|
|
|
1963
1964
|
/** event when uploading file failed */
|
|
1964
1965
|
onUploadError: PropTypes.func,
|
|
1965
1966
|
|
|
1966
|
-
/**
|
|
1967
|
-
* event when removed file(s)<br/>
|
|
1968
|
-
* return data: {<br/>
|
|
1969
|
-
* attached: [Files] (insist old and all new files )<br/>
|
|
1970
|
-
* allNewAttached: [Files]<br/>
|
|
1971
|
-
* oldAttached: [Files]<br/>
|
|
1972
|
-
* removedAttached: [Files]<br/>
|
|
1973
|
-
* element: [NodeList (just removed)]<br/>
|
|
1974
|
-
* }
|
|
1967
|
+
/**
|
|
1968
|
+
* event when removed file(s)<br/>
|
|
1969
|
+
* return data: {<br/>
|
|
1970
|
+
* attached: [Files] (insist old and all new files )<br/>
|
|
1971
|
+
* allNewAttached: [Files]<br/>
|
|
1972
|
+
* oldAttached: [Files]<br/>
|
|
1973
|
+
* removedAttached: [Files]<br/>
|
|
1974
|
+
* element: [NodeList (just removed)]<br/>
|
|
1975
|
+
* }
|
|
1975
1976
|
*/
|
|
1976
1977
|
onRemove: PropTypes.func,
|
|
1977
1978
|
|