diginet-core-ui 1.3.34 → 1.3.35
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/MHRP09N0032.svg +7 -0
- package/components/avatar/index.js +19 -19
- package/components/badge/index.js +61 -64
- package/components/button/icon.js +21 -21
- package/components/button/index.js +180 -180
- package/components/button/ripple-effect.js +23 -23
- package/components/chart/Pie-v2/index.js +40 -42
- package/components/chip/index.js +129 -134
- package/components/form-control/attachment/index.js +431 -435
- package/components/form-control/calendar/function.js +69 -46
- package/components/form-control/calendar/index.js +12 -3
- package/components/form-control/control/index.js +35 -23
- package/components/form-control/date-picker/index.js +36 -36
- package/components/form-control/date-range-picker/index.js +84 -86
- package/components/form-control/dropdown/index.js +462 -431
- package/components/form-control/dropdown-box/index.js +53 -53
- package/components/form-control/label/index.js +16 -15
- package/components/form-control/money-input/index.js +106 -7
- package/components/form-control/radio/index.js +129 -132
- package/components/form-control/text-input/index.js +25 -28
- package/components/form-control/toggle/index.js +106 -107
- package/components/modal/modal.js +43 -46
- package/components/popover/index.js +27 -29
- package/components/popup/index.js +73 -77
- package/components/popup/proposals_popup.js +46 -48
- package/components/popup/v2/index.js +108 -110
- package/components/progress/circular.js +65 -66
- package/components/tab/tab-container.js +32 -14
- package/components/tab/tab-header.js +81 -56
- package/components/tab/tab-panel.js +46 -17
- package/components/tab/tab.js +105 -87
- package/components/tooltip/index.js +24 -26
- package/components/typography/index.js +10 -10
- package/icons/basic.js +148 -27
- package/icons/effect.js +26 -26
- package/package.json +1 -1
- package/readme.md +17 -0
- package/theme/settings.js +7 -5
- package/utils/number.js +11 -12
|
@@ -60,20 +60,20 @@ const Popup = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
60
60
|
const [openState, setOpenState] = useState(open);
|
|
61
61
|
const [custom, setCustom] = useState(null);
|
|
62
62
|
const PopupContainer = css`
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
63
|
+
position: fixed;
|
|
64
|
+
display: none;
|
|
65
|
+
width: 100%;
|
|
66
|
+
height: 100vh;
|
|
67
|
+
background-color: ${!fullScreen ? 'transparent' : 'rgba(21, 26, 48, 0.5)'};
|
|
68
|
+
top: 0;
|
|
69
|
+
left: 0;
|
|
70
|
+
justify-content: center;
|
|
71
|
+
padding-top: ${isNaN(top) ? top : top + 'px'};
|
|
72
|
+
pointer-events: ${!fullScreen ? 'none' : 'auto'};
|
|
73
|
+
opacity: 0;
|
|
74
|
+
transition: opacity 0.3s ease;
|
|
75
|
+
z-index: 9001;
|
|
76
|
+
`;
|
|
77
77
|
const fadeInDown = keyframes`
|
|
78
78
|
from {
|
|
79
79
|
opacity: 0;
|
|
@@ -94,69 +94,69 @@ const Popup = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
94
94
|
}
|
|
95
95
|
`;
|
|
96
96
|
const PopupFrame = css`
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
97
|
+
display: flex;
|
|
98
|
+
position: relative;
|
|
99
|
+
color: ${theme.colors.default};
|
|
100
|
+
background-color: white;
|
|
101
|
+
width: ${width};
|
|
102
|
+
height: max-content;
|
|
103
|
+
min-width: 150px;
|
|
104
|
+
max-width: 480px;
|
|
105
|
+
min-height: 68px;
|
|
106
|
+
border-radius: 4px;
|
|
107
|
+
box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
|
|
108
|
+
box-sizing: border-box;
|
|
109
|
+
pointer-events: auto;
|
|
110
|
+
animation: ${fadeOutUp} 0.2s ease;
|
|
111
|
+
animation-fill-mode: forwards;
|
|
112
|
+
&.animate_fadeInDown {
|
|
113
|
+
animation: ${fadeInDown} 0.2s ease;
|
|
114
|
+
}
|
|
115
|
+
`;
|
|
116
116
|
const PopupContent = css`
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
117
|
+
display: block;
|
|
118
|
+
position: relative;
|
|
119
|
+
color: inherit;
|
|
120
|
+
width: 100%;
|
|
121
|
+
margin: 24px 48px;
|
|
122
|
+
`;
|
|
123
123
|
const PopupInfo = css`
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
124
|
+
/* width: max-content; */
|
|
125
|
+
display: flex;
|
|
126
|
+
color: inherit;
|
|
127
|
+
justify-content: center;
|
|
128
|
+
.popup-icon {
|
|
129
|
+
display: inline-flex;
|
|
130
|
+
margin-top: 2px;
|
|
131
|
+
width: auto;
|
|
132
|
+
height: auto;
|
|
133
|
+
}
|
|
134
|
+
.popup-title {
|
|
135
|
+
/* width: 100%; */
|
|
136
|
+
display: inline-flex;
|
|
137
|
+
margin-left: 8px;
|
|
138
|
+
margin-right: 8px;
|
|
139
|
+
color: inherit;
|
|
140
|
+
text-align: center;
|
|
141
|
+
align-items: center;
|
|
142
|
+
${typography.paragraph1};
|
|
143
|
+
}
|
|
144
|
+
`;
|
|
145
145
|
const PopupYesNo = css`
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
146
|
+
display: flex;
|
|
147
|
+
justify-content: center;
|
|
148
|
+
margin-top: 21px;
|
|
149
|
+
`;
|
|
150
150
|
const PopupClearIcon = css`
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
151
|
+
display: block;
|
|
152
|
+
position: absolute;
|
|
153
|
+
width: 24px;
|
|
154
|
+
height: 24px;
|
|
155
|
+
top: 16px;
|
|
156
|
+
right: 16px;
|
|
157
|
+
color: ${theme.colors.secondary};
|
|
158
|
+
cursor: pointer;
|
|
159
|
+
`;
|
|
160
160
|
|
|
161
161
|
const onShowPopup = (message, options = {}, cb, autoClose = true) => {
|
|
162
162
|
if (!message && (!options || JSON.stringify(options) === '{}') && !cb) {
|
|
@@ -239,8 +239,6 @@ const Popup = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
239
239
|
}
|
|
240
240
|
}
|
|
241
241
|
}
|
|
242
|
-
|
|
243
|
-
;
|
|
244
242
|
};
|
|
245
243
|
|
|
246
244
|
const onConfirmHandler = () => {
|
|
@@ -256,8 +254,6 @@ const Popup = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
256
254
|
onClosePopup(custom === null);
|
|
257
255
|
document.removeEventListener('keydown', pressESCHandler);
|
|
258
256
|
}
|
|
259
|
-
|
|
260
|
-
;
|
|
261
257
|
};
|
|
262
258
|
|
|
263
259
|
useEffect(() => {
|
|
@@ -38,57 +38,57 @@ const ProposalsPopup = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
const PopupContainer = css`
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
41
|
+
display: flex;
|
|
42
|
+
position: fixed;
|
|
43
|
+
width: 80%;
|
|
44
|
+
max-width: 480px;
|
|
45
|
+
z-index: 1000;
|
|
46
|
+
transform: scale(0);
|
|
47
|
+
transition: transform 0.2s linear;
|
|
48
|
+
&.open {
|
|
49
|
+
transform: scale(1);
|
|
50
|
+
}
|
|
51
|
+
`;
|
|
52
52
|
const PopupFrame = css`
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
53
|
+
display: block;
|
|
54
|
+
align-items: baseline;
|
|
55
|
+
position: relative;
|
|
56
|
+
background: #ffffff;
|
|
57
|
+
width: 100%;
|
|
58
|
+
box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
|
|
59
|
+
border-radius: 4px;
|
|
60
|
+
padding: 24px 16px;
|
|
61
|
+
`;
|
|
62
62
|
const PopupContent = css`
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
63
|
+
width: 100%;
|
|
64
|
+
height: 100%;
|
|
65
|
+
display: flex;
|
|
66
|
+
flex-direction: column;
|
|
67
|
+
justify-content: space-between;
|
|
68
|
+
padding: 0 24px;
|
|
69
|
+
box-sizing: border-box;
|
|
70
|
+
`;
|
|
71
71
|
const PopupInput = css`
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
display: block;
|
|
73
|
+
width: 100%;
|
|
74
|
+
`;
|
|
75
75
|
const PopupAction = css`
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
display: block;
|
|
77
|
+
margin-left: auto;
|
|
78
|
+
`;
|
|
79
79
|
const PopupClearIcon = css`
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
80
|
+
display: block;
|
|
81
|
+
position: absolute;
|
|
82
|
+
width: 24px;
|
|
83
|
+
height: 24px;
|
|
84
|
+
top: 16px;
|
|
85
|
+
right: 24px;
|
|
86
|
+
color: ${theme.colors.secondary};
|
|
87
|
+
cursor: pointer;
|
|
88
|
+
&:hover {
|
|
89
|
+
color: '#404456' !important;
|
|
90
|
+
}
|
|
91
|
+
`;
|
|
92
92
|
|
|
93
93
|
const onClosePopup = () => {
|
|
94
94
|
if (onClose) onClose();
|
|
@@ -106,8 +106,6 @@ const ProposalsPopup = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
106
106
|
if (event.key === 'Escape') {
|
|
107
107
|
onClosePopup();
|
|
108
108
|
}
|
|
109
|
-
|
|
110
|
-
;
|
|
111
109
|
};
|
|
112
110
|
|
|
113
111
|
const calPosition = (position, originBounding) => {
|
|
@@ -91,121 +91,121 @@ const Popup = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
91
91
|
const [showMoreDescription, setShowMoreDescription] = useState(false);
|
|
92
92
|
const [descriptionLines, setDescriptionLines] = useState(0);
|
|
93
93
|
const PopupRoot = css`
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
${flexRow}
|
|
95
|
+
${positionFixed}
|
|
96
96
|
${justifyCenter}
|
|
97
97
|
width: 100%;
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
98
|
+
height: 100%;
|
|
99
|
+
top: 0;
|
|
100
|
+
left: 0;
|
|
101
|
+
inset: 0;
|
|
102
|
+
background-color: rgba(21, 26, 48, 0.5);
|
|
103
|
+
opacity: 0;
|
|
104
|
+
transition: opacity 0.3s ease;
|
|
105
|
+
z-index: 9002;
|
|
106
|
+
word-break: break-word;
|
|
107
|
+
.DGN-UI-Popup {
|
|
108
|
+
${flexCol}
|
|
109
|
+
${borderRadius4px}
|
|
110
110
|
${borderBox}
|
|
111
111
|
width: ${isNaN(width) ? width : width + 'px'};
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
112
|
+
height: fit-content;
|
|
113
|
+
max-width: 80%;
|
|
114
|
+
max-height: 80%;
|
|
115
|
+
margin: ${isNaN(top) ? top : top + 'px'} auto auto;
|
|
116
|
+
background-color: ${white};
|
|
117
|
+
box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.25);
|
|
118
|
+
animation: ${fadeOutUp} 0.2s ease;
|
|
119
|
+
animation-fill-mode: forwards;
|
|
120
|
+
&.DGN-Show {
|
|
121
|
+
animation-name: ${fadeInDown};
|
|
122
|
+
}
|
|
123
|
+
.DGN-UI-Popup-Header {
|
|
124
|
+
${flexRow}
|
|
125
|
+
${alignCenter}
|
|
126
126
|
min-height: 40px;
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
127
|
+
padding: 0 8px 0 16px;
|
|
128
|
+
border-radius: 4px 4px 0px 0px;
|
|
129
|
+
.DGN-UI-Popup-Header-Title {
|
|
130
|
+
${flexRow}
|
|
131
|
+
${ellipsis}
|
|
132
132
|
width: calc(100% - 24px);
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
133
|
+
}
|
|
134
|
+
color: ${colorMap.get(type)};
|
|
135
|
+
background-color: ${hexToRGBA(colorMap.get(type), 0.15)};
|
|
136
|
+
}
|
|
137
|
+
.DGN-UI-Popup-Body {
|
|
138
|
+
${flexRow}
|
|
139
|
+
${positionRelative}
|
|
140
140
|
flex: 1 1 auto;
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
141
|
+
padding: 16px;
|
|
142
|
+
overflow: auto;
|
|
143
|
+
&::-webkit-scrollbar {
|
|
144
|
+
${borderRadius4px}
|
|
145
|
+
width: 24px;
|
|
146
|
+
background-color: #fff !important;
|
|
147
|
+
}
|
|
148
|
+
&::-webkit-scrollbar-thumb {
|
|
149
|
+
${border(8, 'transparent')}
|
|
150
|
+
border-radius: 24px;
|
|
151
|
+
mix-blend-mode: normal;
|
|
152
|
+
background-color: ${scrollbar} !important;
|
|
153
|
+
background-clip: content-box;
|
|
154
|
+
}
|
|
155
|
+
&::-webkit-scrollbar-thumb:hover {
|
|
156
|
+
${border(8, 'transparent')}
|
|
157
|
+
border-radius: 24px;
|
|
158
|
+
mix-blend-mode: normal;
|
|
159
|
+
background-color: ${hover} !important;
|
|
160
|
+
background-clip: content-box;
|
|
161
|
+
}
|
|
162
|
+
.DGN-UI-Popup-Body-Icon {
|
|
163
|
+
${displayBlock}
|
|
164
|
+
width: 40px;
|
|
165
|
+
margin-right: 16px;
|
|
166
|
+
border-radius: 50%;
|
|
167
|
+
}
|
|
168
|
+
.DGN-UI-Popup-Body-Description {
|
|
169
|
+
${flexRow}
|
|
170
|
+
${positionRelative}
|
|
171
171
|
${alignCenter}
|
|
172
172
|
min-height: 40px;
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
173
|
+
height: max-content;
|
|
174
|
+
.DGN-UI-Popup-Body-Subtitle {
|
|
175
|
+
margin-bottom: ${(description === null || description === void 0 ? void 0 : description.length) > 0 ? '8px' : '0px'};
|
|
176
|
+
}
|
|
177
|
+
.DGN-UI-Popup-Body-Detail {
|
|
178
|
+
${overflowHidden}
|
|
179
|
+
text-overflow: ellipsis;
|
|
180
|
+
display: -webkit-box;
|
|
181
|
+
-webkit-line-clamp: ${showMoreDescription ? 'none' : subtitle && descriptionLines > 1 ? 1 : descriptionLines > 3 ? 3 : 'none'};
|
|
182
|
+
-webkit-box-orient: vertical;
|
|
183
|
+
}
|
|
184
|
+
.DGN-More-Action {
|
|
185
|
+
${displayBlock}
|
|
186
|
+
${cursorPointer}
|
|
187
187
|
width: fit-content;
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
188
|
+
margin-top: 16px;
|
|
189
|
+
margin-bottom: ${type === 'yesno' ? '0px' : '8px'};
|
|
190
|
+
text-decoration: underline;
|
|
191
|
+
color: ${info};
|
|
192
|
+
}
|
|
193
|
+
}
|
|
192
194
|
}
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
${flexRow}
|
|
197
|
-
${justifyEnd}
|
|
195
|
+
.DGN-UI-Popup-Action {
|
|
196
|
+
${flexRow}
|
|
197
|
+
${justifyEnd}
|
|
198
198
|
padding: 8px 16px 16px 16px;
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
199
|
+
.DGN-UI-Button {
|
|
200
|
+
margin: 0;
|
|
201
|
+
min-width: 80px;
|
|
202
|
+
&.filled {
|
|
203
|
+
margin-right: 8px;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
204
206
|
}
|
|
205
207
|
}
|
|
206
|
-
|
|
207
|
-
}
|
|
208
|
-
`;
|
|
208
|
+
`;
|
|
209
209
|
|
|
210
210
|
const getTitle = (tit, typ = type) => {
|
|
211
211
|
if (tit !== null && tit !== undefined) {
|
|
@@ -226,8 +226,6 @@ const Popup = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
226
226
|
onClosePopup(custom === null);
|
|
227
227
|
document.removeEventListener('keydown', pressESCHandler);
|
|
228
228
|
}
|
|
229
|
-
|
|
230
|
-
;
|
|
231
229
|
};
|
|
232
230
|
|
|
233
231
|
const onShowPopup = (options, cb) => {
|
|
@@ -463,13 +461,13 @@ Popup.propTypes = {
|
|
|
463
461
|
/** the function will run when click on cancel button */
|
|
464
462
|
onCancel: func,
|
|
465
463
|
|
|
466
|
-
/**
|
|
467
|
-
* named ref: get ref of Popup component, insist:<br />
|
|
468
|
-
* * element<br />
|
|
469
|
-
* * show: the method to show Popup (ref.current.show(options, callback))<br />
|
|
470
|
-
* + options: {type, title, icon, yesNo, description, confirmProps, cancelProps, onCancel, onConfirm}<br />
|
|
471
|
-
* + 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 />
|
|
472
|
-
* * close: the method to close Popup<br />
|
|
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 />
|
|
473
471
|
*/
|
|
474
472
|
reference: oneOfType([func, shape({
|
|
475
473
|
current: instanceOf(elementType)
|