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.
Files changed (39) hide show
  1. package/assets/images/menu/dhr/MHRP09N0032.svg +7 -0
  2. package/components/avatar/index.js +19 -19
  3. package/components/badge/index.js +61 -64
  4. package/components/button/icon.js +21 -21
  5. package/components/button/index.js +180 -180
  6. package/components/button/ripple-effect.js +23 -23
  7. package/components/chart/Pie-v2/index.js +40 -42
  8. package/components/chip/index.js +129 -134
  9. package/components/form-control/attachment/index.js +431 -435
  10. package/components/form-control/calendar/function.js +69 -46
  11. package/components/form-control/calendar/index.js +12 -3
  12. package/components/form-control/control/index.js +35 -23
  13. package/components/form-control/date-picker/index.js +36 -36
  14. package/components/form-control/date-range-picker/index.js +84 -86
  15. package/components/form-control/dropdown/index.js +462 -431
  16. package/components/form-control/dropdown-box/index.js +53 -53
  17. package/components/form-control/label/index.js +16 -15
  18. package/components/form-control/money-input/index.js +106 -7
  19. package/components/form-control/radio/index.js +129 -132
  20. package/components/form-control/text-input/index.js +25 -28
  21. package/components/form-control/toggle/index.js +106 -107
  22. package/components/modal/modal.js +43 -46
  23. package/components/popover/index.js +27 -29
  24. package/components/popup/index.js +73 -77
  25. package/components/popup/proposals_popup.js +46 -48
  26. package/components/popup/v2/index.js +108 -110
  27. package/components/progress/circular.js +65 -66
  28. package/components/tab/tab-container.js +32 -14
  29. package/components/tab/tab-header.js +81 -56
  30. package/components/tab/tab-panel.js +46 -17
  31. package/components/tab/tab.js +105 -87
  32. package/components/tooltip/index.js +24 -26
  33. package/components/typography/index.js +10 -10
  34. package/icons/basic.js +148 -27
  35. package/icons/effect.js +26 -26
  36. package/package.json +1 -1
  37. package/readme.md +17 -0
  38. package/theme/settings.js +7 -5
  39. 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
- 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
- `;
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
- 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
- `;
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
- display: block;
118
- position: relative;
119
- color: inherit;
120
- width: 100%;
121
- margin: 24px 48px;
122
- `;
117
+ display: block;
118
+ position: relative;
119
+ color: inherit;
120
+ width: 100%;
121
+ margin: 24px 48px;
122
+ `;
123
123
  const PopupInfo = css`
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
- `;
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
- display: flex;
147
- justify-content: center;
148
- margin-top: 21px;
149
- `;
146
+ display: flex;
147
+ justify-content: center;
148
+ margin-top: 21px;
149
+ `;
150
150
  const PopupClearIcon = css`
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
- `;
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
- 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
- `;
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
- 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
- `;
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
- 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
- `;
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
- display: block;
73
- width: 100%;
74
- `;
72
+ display: block;
73
+ width: 100%;
74
+ `;
75
75
  const PopupAction = css`
76
- display: block;
77
- margin-left: auto;
78
- `;
76
+ display: block;
77
+ margin-left: auto;
78
+ `;
79
79
  const PopupClearIcon = css`
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
- `;
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
- ${flexRow}
95
- ${positionFixed}
94
+ ${flexRow}
95
+ ${positionFixed}
96
96
  ${justifyCenter}
97
97
  width: 100%;
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}
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
- 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}
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
- padding: 0 8px 0 16px;
128
- border-radius: 4px 4px 0px 0px;
129
- .DGN-UI-Popup-Header-Title {
130
- ${flexRow}
131
- ${ellipsis}
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
- color: ${colorMap.get(type)};
135
- background-color: ${hexToRGBA(colorMap.get(type), 0.15)};
136
- }
137
- .DGN-UI-Popup-Body {
138
- ${flexRow}
139
- ${positionRelative}
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
- 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}
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
- 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}
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
- margin-top: 16px;
189
- margin-bottom: ${type === 'yesno' ? '0px' : '8px'};
190
- text-decoration: underline;
191
- color: ${info};
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
- .DGN-UI-Popup-Action {
196
- ${flexRow}
197
- ${justifyEnd}
195
+ .DGN-UI-Popup-Action {
196
+ ${flexRow}
197
+ ${justifyEnd}
198
198
  padding: 8px 16px 16px 16px;
199
- .DGN-UI-Button {
200
- margin: 0;
201
- min-width: 80px;
202
- &.filled {
203
- margin-right: 8px;
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
- * &nbsp;&nbsp; + options: {type, title, icon, yesNo, description, confirmProps, cancelProps, onCancel, onConfirm}<br />
471
- * &nbsp;&nbsp; + 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
+ * &nbsp;&nbsp; + options: {type, title, icon, yesNo, description, confirmProps, cancelProps, onCancel, onConfirm}<br />
469
+ * &nbsp;&nbsp; + 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)