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
@@ -124,20 +124,20 @@ const Button = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
124
124
  const iconMarginSize = iconMarginSizeMap.get(size);
125
125
  const minHeightSize = minHeightSizeMap.get(size);
126
126
  const ButtonIcon = css`
127
- ${flexRow}
128
- ${alignCenter}
127
+ ${flexRow}
128
+ ${alignCenter}
129
129
  ${justifyCenter}
130
130
  ${positionRelative}
131
131
  ${borderBox}
132
- `;
132
+ `;
133
133
  const ButtonText = css`
134
- white-space: nowrap;
135
- color: inherit;
136
- margin: 0 ${loading ? iconMarginSize : 0};
137
- `;
134
+ white-space: nowrap;
135
+ color: inherit;
136
+ margin: 0 ${loading ? iconMarginSize : 0};
137
+ `;
138
138
  const ButtonRoot = css`
139
- ${inlineFlex}
140
- ${alignCenter}
139
+ ${inlineFlex}
140
+ ${alignCenter}
141
141
  ${justifyCenter}
142
142
  ${positionRelative}
143
143
  ${borderRadius4px}
@@ -148,185 +148,185 @@ const Button = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
148
148
  ${outlineNone}
149
149
  ${userSelectNone}
150
150
  height: max-content;
151
- transition: all 0.5s;
152
- &.button--disabled {
153
- cursor: not-allowed !important;
154
- color: ${systemDisabled} !important;
155
- &.outlined {
156
- border-color: ${systemDisabled} !important;
157
- background-color: transparent !important;
158
- }
159
- &.filled {
160
- background-color: ${fillDisabled} !important;
161
- filter: brightness(1) !important;
162
- }
163
- &.text {
164
- background-color: transparent !important;
165
- }
166
- }
167
- /* &:not(:disabled):focus {
151
+ transition: all 0.5s;
152
+ &.button--disabled {
153
+ cursor: not-allowed !important;
154
+ color: ${systemDisabled} !important;
155
+ &.outlined {
156
+ border-color: ${systemDisabled} !important;
157
+ background-color: transparent !important;
158
+ }
159
+ &.filled {
160
+ background-color: ${fillDisabled} !important;
161
+ filter: brightness(1) !important;
162
+ }
163
+ &.text {
164
+ background-color: transparent !important;
165
+ }
166
+ }
167
+ /* &:not(:disabled):focus {
168
168
  box-shadow: ${viewType === 'outlined' ? '0 0 0 2px ' + hexToRGBA(active, 0.13) : 'none'};
169
169
  } */
170
- &.button--loading {
171
- ${pointerEventsNone}
172
- }
173
- &.${size} {
174
- padding: ${paddingSize};
175
- min-height: ${minHeightSize};
176
- min-width: max-content;
177
- &.outlined {
178
- padding: ${outlinedPaddingSize};
179
- }
180
- .css-${ButtonText.name} {
181
- ${typographySize};
182
- }
183
- .css-${ButtonIcon.name} {
184
- margin-right: ${endIcon || label ? iconMarginSize : 0};
185
- &.DGN-UI-Button-End-Icon,
186
- &.DGN-UI-Button-Custom-End-Icon {
187
- margin-right: unset;
188
- margin-left: ${startIcon || label ? iconMarginSize : 0};
189
- }
190
- &.DGN-UI-Button-Start-Icon,
191
- &.DGN-UI-Button-End-Icon {
192
- height: ${iconSize};
193
- width: ${iconSize};
194
- }
195
- }
196
- .no-icon {
197
- ${noMargin}
198
- height: ${iconSize};
199
- min-width: 0;
200
- }
201
- }
202
- &.outlined {
203
- ${backgroundTransparent}
204
- &.default {
205
- border: 1px solid ${rest};
206
- color: ${rest};
207
- &.button--loading,
208
- &:hover,
209
- &:focus,
210
- &:active {
211
- color: ${active};
212
- border-color: ${active};
213
- }
214
170
  &.button--loading {
215
- background-color: ${hexToRGBA(active, alphaLoading)};
171
+ ${pointerEventsNone}
172
+ }
173
+ &.${size} {
174
+ padding: ${paddingSize};
175
+ min-height: ${minHeightSize};
176
+ min-width: max-content;
177
+ &.outlined {
178
+ padding: ${outlinedPaddingSize};
179
+ }
180
+ .css-${ButtonText.name} {
181
+ ${typographySize};
182
+ }
183
+ .css-${ButtonIcon.name} {
184
+ margin-right: ${endIcon || label ? iconMarginSize : 0};
185
+ &.DGN-UI-Button-End-Icon,
186
+ &.DGN-UI-Button-Custom-End-Icon {
187
+ margin-right: unset;
188
+ margin-left: ${startIcon || label ? iconMarginSize : 0};
189
+ }
190
+ &.DGN-UI-Button-Start-Icon,
191
+ &.DGN-UI-Button-End-Icon {
192
+ height: ${iconSize};
193
+ width: ${iconSize};
194
+ }
195
+ }
196
+ .no-icon {
197
+ ${noMargin}
198
+ height: ${iconSize};
199
+ min-width: 0;
200
+ }
216
201
  }
217
- ${Object.keys(alphaArr).map(key => `&:${key} {
202
+ &.outlined {
203
+ ${backgroundTransparent}
204
+ &.default {
205
+ border: 1px solid ${rest};
206
+ color: ${rest};
207
+ &.button--loading,
208
+ &:hover,
209
+ &:focus,
210
+ &:active {
211
+ color: ${active};
212
+ border-color: ${active};
213
+ }
214
+ &.button--loading {
215
+ background-color: ${hexToRGBA(active, alphaLoading)};
216
+ }
217
+ ${Object.keys(alphaArr).map(key => `&:${key} {
218
218
  background-color: ${hexToRGBA(active, alphaArr[key])};
219
219
  }`)}// &:hover | &:focus | &:active
220
- }
221
- &.${color} {
222
- border: 1px solid ${colorMap.get(color)};
223
- color: ${colorMap.get(color)};
224
- &.button--loading {
225
- background-color: ${hexToRGBA(colorMap.get(color), alphaLoading)};
226
- }
227
- ${Object.keys(alphaArr).map(key => `&:${key} {
220
+ }
221
+ &.${color} {
222
+ border: 1px solid ${colorMap.get(color)};
223
+ color: ${colorMap.get(color)};
224
+ &.button--loading {
225
+ background-color: ${hexToRGBA(colorMap.get(color), alphaLoading)};
226
+ }
227
+ ${Object.keys(alphaArr).map(key => `&:${key} {
228
228
  background-color: ${hexToRGBA(colorMap.get(color), alphaArr[key])};
229
229
  }`)}
230
- }
231
- &.custom-color {
232
- border: 1px solid ${color};
233
- color: ${color};
234
- &.button--loading {
235
- background-color: ${hexToRGBA(color, alphaLoading)};
236
- }
237
- ${Object.keys(alphaArr).map(key => `&:${key} {
230
+ }
231
+ &.custom-color {
232
+ border: 1px solid ${color};
233
+ color: ${color};
234
+ &.button--loading {
235
+ background-color: ${hexToRGBA(color, alphaLoading)};
236
+ }
237
+ ${Object.keys(alphaArr).map(key => `&:${key} {
238
238
  background-color: ${hexToRGBA(color, alphaArr[key])};
239
239
  }`)}
240
- }
241
- }
242
- &.filled {
243
- border: none;
244
- color: ${white};
245
- font-weight: bold;
246
- &.button--loading,
247
- &:hover,
248
- &:focus {
249
- filter: brightness(0.85);
250
- }
251
- &:active {
252
- filter: brightness(0.7);
253
- }
254
- &.default {
255
- background-color: ${rest};
256
- &.button--loading {
257
- background-color: ${active};
240
+ }
258
241
  }
259
- &:hover,
260
- &:focus,
261
- &:active {
262
- background-color: ${active};
242
+ &.filled {
243
+ border: none;
244
+ color: ${white};
245
+ font-weight: bold;
246
+ &.button--loading,
247
+ &:hover,
248
+ &:focus {
249
+ filter: brightness(0.85);
250
+ }
251
+ &:active {
252
+ filter: brightness(0.7);
253
+ }
254
+ &.default {
255
+ background-color: ${rest};
256
+ &.button--loading {
257
+ background-color: ${active};
258
+ }
259
+ &:hover,
260
+ &:focus,
261
+ &:active {
262
+ background-color: ${active};
263
+ }
264
+ }
265
+ &.${color} {
266
+ background-color: ${colorMap.get(color)};
267
+ }
268
+ &.custom-color {
269
+ background-color: ${color};
270
+ }
263
271
  }
264
- }
265
- &.${color} {
266
- background-color: ${colorMap.get(color)};
267
- }
268
- &.custom-color {
269
- background-color: ${color};
270
- }
271
- }
272
- &.text {
273
- ${backgroundTransparent}
274
- ${noBorder}
272
+ &.text {
273
+ ${backgroundTransparent}
274
+ ${noBorder}
275
275
  &.default {
276
- color: ${rest};
277
- &:hover,
278
- &:focus,
279
- &:active {
280
- color: ${active};
281
- }
282
- &.button--loading {
283
- color: ${active};
284
- background-color: ${hexToRGBA(active, alphaLoading)};
285
- }
286
- ${Object.keys(alphaArr).map(key => `&:${key} {
276
+ color: ${rest};
277
+ &:hover,
278
+ &:focus,
279
+ &:active {
280
+ color: ${active};
281
+ }
282
+ &.button--loading {
283
+ color: ${active};
284
+ background-color: ${hexToRGBA(active, alphaLoading)};
285
+ }
286
+ ${Object.keys(alphaArr).map(key => `&:${key} {
287
287
  background-color: ${hexToRGBA(active, alphaArr[key])};
288
288
  }`)}
289
- }
290
- &.${color} {
291
- color: ${colorMap.get(color)};
292
- &.button--loading {
293
- background-color: ${hexToRGBA(colorMap.get(color), alphaLoading)};
294
- }
295
- ${Object.keys(alphaArr).map(key => `&:${key} {
289
+ }
290
+ &.${color} {
291
+ color: ${colorMap.get(color)};
292
+ &.button--loading {
293
+ background-color: ${hexToRGBA(colorMap.get(color), alphaLoading)};
294
+ }
295
+ ${Object.keys(alphaArr).map(key => `&:${key} {
296
296
  background-color: ${hexToRGBA(colorMap.get(color), alphaArr[key])};
297
297
  }`)}
298
- }
299
- &.custom-color {
300
- color: ${color};
301
- &.button--loading {
302
- background-color: ${hexToRGBA(color, alphaLoading)};
303
- }
304
- ${Object.keys(alphaArr).map(key => `&:${key} {
298
+ }
299
+ &.custom-color {
300
+ color: ${color};
301
+ &.button--loading {
302
+ background-color: ${hexToRGBA(color, alphaLoading)};
303
+ }
304
+ ${Object.keys(alphaArr).map(key => `&:${key} {
305
305
  background-color: ${hexToRGBA(color, alphaArr[key])};
306
306
  }`)}
307
- }
308
- }
309
- &.link {
310
- ${backgroundTransparent}
311
- ${noBorder}
307
+ }
308
+ }
309
+ &.link {
310
+ ${backgroundTransparent}
311
+ ${noBorder}
312
312
  ${noPadding}
313
313
  color: ${info};
314
- &.button--loading,
315
- &:hover,
316
- &:focus {
317
- filter: brightness(0.85);
318
- }
319
- &:active {
320
- filter: brightness(0.7);
321
- }
322
- &.${color} {
323
- color: ${colorMap.get(color)};
324
- }
325
- &.custom-color {
326
- color: ${color};
327
- }
328
- }
329
- `;
314
+ &.button--loading,
315
+ &:hover,
316
+ &:focus {
317
+ filter: brightness(0.85);
318
+ }
319
+ &:active {
320
+ filter: brightness(0.7);
321
+ }
322
+ &.${color} {
323
+ color: ${colorMap.get(color)};
324
+ }
325
+ &.custom-color {
326
+ color: ${color};
327
+ }
328
+ }
329
+ `;
330
330
  useImperativeHandle(reference, () => {
331
331
  const currentRef = ref.current || {};
332
332
  const _instance = {}; // methods
@@ -484,19 +484,19 @@ Button.propTypes = {
484
484
  /** status loading of button */
485
485
  loading: PropTypes.bool,
486
486
 
487
- /**
488
- * ref methods
489
- *
490
- * * option(): Gets all UI component properties
491
- * * Returns value - object
492
- * * option(optionName): Gets the value of a single property
493
- * * @param {optionName} - string
494
- * * Returns value - any
495
- * * option(optionName, optionValue): Updates the value of a single property
496
- * * @param {optionName} - string
497
- * * @param {optionValue} - any
498
- * * option(options): Updates the values of several properties
499
- * * @param {options} - object
487
+ /**
488
+ * ref methods
489
+ *
490
+ * * option(): Gets all UI component properties
491
+ * * Returns value - object
492
+ * * option(optionName): Gets the value of a single property
493
+ * * @param {optionName} - string
494
+ * * Returns value - any
495
+ * * option(optionName, optionValue): Updates the value of a single property
496
+ * * @param {optionName} - string
497
+ * * @param {optionValue} - any
498
+ * * option(options): Updates the values of several properties
499
+ * * @param {options} - object
500
500
  */
501
501
  reference: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
502
502
  current: PropTypes.instanceOf(Element)
@@ -26,31 +26,31 @@ const Ripple = ({
26
26
  setRippleArray([]);
27
27
  });
28
28
  const RippleContainer = css`
29
- position: absolute;
30
- overflow: hidden;
31
- top: 0;
32
- right: 0;
33
- bottom: 0;
34
- left: 0;
35
- ${circular && 'border-radius: 50%;'}
29
+ position: absolute;
30
+ overflow: hidden;
31
+ top: 0;
32
+ right: 0;
33
+ bottom: 0;
34
+ left: 0;
35
+ ${circular && 'border-radius: 50%;'}
36
36
 
37
- span {
38
- transform: scale(0);
39
- border-radius: 100%;
40
- position: absolute;
41
- opacity: 0.75;
42
- background-color: ${color};
43
- animation-name: ripple;
44
- animation-duration: ${duration}ms;
45
- }
37
+ span {
38
+ transform: scale(0);
39
+ border-radius: 100%;
40
+ position: absolute;
41
+ opacity: 0.75;
42
+ background-color: ${color};
43
+ animation-name: ripple;
44
+ animation-duration: ${duration}ms;
45
+ }
46
46
 
47
- @keyframes ripple {
48
- to {
49
- opacity: 0;
50
- transform: scale(2);
51
- }
52
- }
53
- `;
47
+ @keyframes ripple {
48
+ to {
49
+ opacity: 0;
50
+ transform: scale(2);
51
+ }
52
+ }
53
+ `;
54
54
 
55
55
  const addRipple = event => {
56
56
  const rippleContainer = event.currentTarget.getBoundingClientRect();
@@ -2,14 +2,14 @@
2
2
 
3
3
  /** @jsx jsx */
4
4
  import { useState, useRef, memo, forwardRef } from 'react';
5
- import PropTypes from "prop-types";
5
+ import PropTypes from 'prop-types';
6
6
  import { jsx, css } from '@emotion/core';
7
7
  import Typography from '../../typography';
8
8
  import { randomString } from '../../../utils';
9
- import { typography } from "../../../styles/typography";
10
- import Circle from "./Circle";
11
- import Sectors from "./Sectors";
12
- import Sector from "./Sector";
9
+ import { typography } from '../../../styles/typography';
10
+ import Circle from './Circle';
11
+ import Sectors from './Sectors';
12
+ import Sector from './Sector';
13
13
  const PieChart = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
14
14
  expandOnHover,
15
15
  renderSelectedItem,
@@ -55,7 +55,7 @@ const PieChart = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
55
55
  }
56
56
  } while (colors.indexOf(code) >= 0);
57
57
 
58
- colors.push("#" + ("000000" + code.toString(16)).slice(-6));
58
+ colors.push('#' + ('000000' + code.toString(16)).slice(-6));
59
59
  }
60
60
 
61
61
  for (let i in data) {
@@ -63,8 +63,6 @@ const PieChart = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
63
63
  }
64
64
  }
65
65
 
66
- ;
67
-
68
66
  const ZoomIn = () => {
69
67
  let zoom = 0;
70
68
  zoom = (width + height) / 2;
@@ -72,41 +70,41 @@ const PieChart = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
72
70
  };
73
71
 
74
72
  const svgCSS = css`
75
- position: relative;
76
- display: block;
77
- margin: 0 auto;
78
- overflow:hidden;
79
- -webkit-tap-highlight-color:rgba(0, 0, 0, 0);
80
- user-select: none;
81
- `;
73
+ position: relative;
74
+ display: block;
75
+ margin: 0 auto;
76
+ overflow: hidden;
77
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
78
+ user-select: none;
79
+ `;
82
80
  const Pie = Donut ? css`
83
- position: relative;
84
- display: flex;
85
- margin: 0 auto;
86
- &:before{
87
- content: '';
88
- position: absolute;
89
- display: block;
90
- position: absolute;
91
- display: flex;
92
- top: 50%;
93
- width: 50%;
94
- height: 50%;
95
- left: 50%;
96
- transform: translate(-50%, -50%);
97
- border-radius: 50%;
98
- background-color: #111d5e;
99
- }
100
- ` : css`
101
- position: relative;
102
- display: flex;
103
- margin: 0 auto;
104
- `;
81
+ position: relative;
82
+ display: flex;
83
+ margin: 0 auto;
84
+ &:before {
85
+ content: '';
86
+ position: absolute;
87
+ display: block;
88
+ position: absolute;
89
+ display: flex;
90
+ top: 50%;
91
+ width: 50%;
92
+ height: 50%;
93
+ left: 50%;
94
+ transform: translate(-50%, -50%);
95
+ border-radius: 50%;
96
+ background-color: #111d5e;
97
+ }
98
+ ` : css`
99
+ position: relative;
100
+ display: flex;
101
+ margin: 0 auto;
102
+ `;
105
103
  const dataCSS = css`
106
- fill:rgba(0,0,0,0.54);
107
- ${typography.paragraph1};
108
- cursor:default;
109
- `;
104
+ fill: rgba(0, 0, 0, 0.54);
105
+ ${typography.paragraph1};
106
+ cursor: default;
107
+ `;
110
108
  const padding1 = ZoomIn() / 10;
111
109
  var padding = 0;
112
110
 
@@ -277,7 +275,7 @@ const PieChart = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
277
275
  x: d.x,
278
276
  y: "10",
279
277
  mapping: 'text',
280
- transform: "translate(0,0)",
278
+ transform: 'translate(0,0)',
281
279
  fill: '#51A30'
282
280
  }, d.name));
283
281
  })))) : null) : jsx("svg", {