diginet-core-ui 1.3.24 → 1.3.29

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 (153) hide show
  1. package/assets/fonts/SF-Pro-Display-Bold.otf +0 -0
  2. package/assets/fonts/SF-Pro-Display-Medium.otf +0 -0
  3. package/assets/fonts/SF-Pro-Display-Regular.otf +0 -0
  4. package/assets/images/icons/wifi.svg +3 -0
  5. package/assets/images/menu/dhr/MHRM09N0004.svg +14 -0
  6. package/assets/images/menu/dhr/MHRP09N0028.svg +6 -0
  7. package/assets/images/menu/dhr/MHRP09N0029.svg +14 -0
  8. package/assets/images/menu/dhr/MHRP09N0030.svg +4 -0
  9. package/assets/images/menu/dhr/MHRP09N0031.svg +5 -0
  10. package/assets/images/menu/dhr/MHRP29N0012.svg +7 -0
  11. package/assets/images/menu/dhr/MHRP29N0021.svg +8 -0
  12. package/assets/images/menu/dhr/MHRP29N0022.svg +9 -0
  13. package/assets/images/menu/dhr/MHRP29N0023.svg +22 -0
  14. package/assets/images/menu/dhr/MHRP39N0015.svg +5 -0
  15. package/assets/images/menu/dhr/TASK.svg +9 -0
  16. package/assets/images/menu/erp/D05.svg +8 -0
  17. package/assets/images/menu/erp/D06.svg +4 -0
  18. package/assets/images/menu/erp/D90R.svg +9 -0
  19. package/assets/images/menu/erp/DBC.svg +9 -0
  20. package/assets/images/menu/erp/{W05F0006.svg → W05F0006N0000.svg} +0 -0
  21. package/assets/images/menu/erp/{W05F0008.svg → W05F0008N0000.svg} +0 -0
  22. package/assets/images/menu/erp/{W05F4000.svg → W05F4000N0000.svg} +0 -0
  23. package/assets/images/menu/erp/{W06F0005.svg → W06F0005N0000.svg} +0 -0
  24. package/assets/images/menu/erp/{W06F0006.svg → W06F0006N0000.svg} +0 -0
  25. package/assets/images/menu/erp/{W06F0008.svg → W06F0008N0000.svg} +0 -0
  26. package/assets/images/menu/erp/W94F1000N0000.svg +9 -0
  27. package/assets/images/menu/erp/W94F1000N0001.svg +9 -0
  28. package/components/accordion/css.js +42 -33
  29. package/components/accordion/details.js +29 -17
  30. package/components/accordion/group.js +23 -23
  31. package/components/accordion/index.js +36 -27
  32. package/components/accordion/summary.js +10 -11
  33. package/components/alert/index.js +97 -91
  34. package/components/alert/notify.js +10 -8
  35. package/components/avatar/index.js +19 -17
  36. package/components/badge/index.js +122 -139
  37. package/components/button/icon.js +242 -334
  38. package/components/button/index.js +272 -427
  39. package/components/button/more.js +4 -5
  40. package/components/button/ripple-effect.js +4 -6
  41. package/components/card/body-card.js +4 -6
  42. package/components/card/card.js +4 -8
  43. package/components/card/index.js +4 -5
  44. package/components/chart/Pie/Sector.js +4 -5
  45. package/components/chart/Pie/Sectors.js +5 -5
  46. package/components/chart/Pie/index.js +8 -9
  47. package/components/chart/Pie-v2/Sector.js +4 -5
  48. package/components/chart/Pie-v2/Sectors.js +7 -8
  49. package/components/chart/Pie-v2/index.js +11 -16
  50. package/components/chart/bar/Bar.js +2 -3
  51. package/components/chart/bar/Labels.js +9 -11
  52. package/components/chart/bar/index.js +17 -9
  53. package/components/chart/bar-v2/Bar.js +2 -3
  54. package/components/chart/bar-v2/Labels.js +9 -11
  55. package/components/chart/bar-v2/index.js +17 -9
  56. package/components/chart/line/Labels.js +8 -10
  57. package/components/chart/line/Point.js +2 -3
  58. package/components/chart/line/index.js +17 -9
  59. package/components/chart/line-v2/Labels.js +8 -10
  60. package/components/chart/line-v2/Point.js +2 -3
  61. package/components/chart/line-v2/index.js +17 -9
  62. package/components/chip/attach.js +12 -16
  63. package/components/chip/index.js +8 -11
  64. package/components/collapse/index.js +4 -5
  65. package/components/divider/index.js +27 -14
  66. package/components/form-control/attachment/index.js +143 -87
  67. package/components/form-control/calendar/function.js +24 -23
  68. package/components/form-control/calendar/index.js +2 -4
  69. package/components/form-control/calendar/range.js +3 -4
  70. package/components/form-control/checkbox/index.js +85 -71
  71. package/components/form-control/control/index.js +4 -6
  72. package/components/form-control/date-picker/index-old.js +0 -2
  73. package/components/form-control/date-picker/index.js +39 -43
  74. package/components/form-control/date-range-picker/index.js +26 -28
  75. package/components/form-control/dropdown/index.js +173 -202
  76. package/components/form-control/dropdown-box/index.js +72 -49
  77. package/components/form-control/form-group/index.js +4 -5
  78. package/components/form-control/helper-text/index.js +4 -5
  79. package/components/form-control/input-base/index.js +28 -38
  80. package/components/form-control/label/index.js +23 -13
  81. package/components/form-control/money-input/index.js +6 -6
  82. package/components/form-control/number-input/index.js +12 -14
  83. package/components/form-control/phone-input/index.js +4 -5
  84. package/components/form-control/radio/index.js +7 -15
  85. package/components/form-control/text-input/index.js +14 -24
  86. package/components/form-control/time-picker/index.js +15 -26
  87. package/components/form-control/time-picker/swiper.js +2 -4
  88. package/components/form-control/toggle/index.js +22 -18
  89. package/components/form-view/helper-text.js +4 -5
  90. package/components/form-view/index.js +4 -5
  91. package/components/form-view/input.js +5 -7
  92. package/components/form-view/label.js +2 -6
  93. package/components/list/list-item-action.js +7 -8
  94. package/components/list/list-item-icon.js +4 -5
  95. package/components/list/list-item-text.js +4 -5
  96. package/components/list/list-item.js +4 -5
  97. package/components/list/list.js +4 -5
  98. package/components/list/sub-header.js +4 -5
  99. package/components/modal/body.js +4 -6
  100. package/components/modal/footer.js +4 -6
  101. package/components/modal/header.js +8 -14
  102. package/components/modal/index.js +4 -5
  103. package/components/modal/modal.js +6 -13
  104. package/components/others/extra/index.js +4 -8
  105. package/components/others/option-wrapper/index.js +57 -0
  106. package/components/others/scrollbar/index.js +4 -5
  107. package/components/paging/page-info.js +282 -231
  108. package/components/paging/page-selector.js +4 -7
  109. package/components/popover/index.js +6 -7
  110. package/components/popup/danger_popup.js +8 -18
  111. package/components/popup/index.js +26 -34
  112. package/components/popup/proposals_popup.js +9 -16
  113. package/components/popup/v2/danger-popup.js +4 -6
  114. package/components/popup/v2/index.js +116 -98
  115. package/components/popup/v2/info-popup.js +4 -6
  116. package/components/popup/v2/success-popup.js +4 -6
  117. package/components/popup/v2/warning-popup.js +4 -6
  118. package/components/popup/v2/yes-no-popup.js +4 -6
  119. package/components/progress/circular.js +17 -26
  120. package/components/progress/linear.js +11 -13
  121. package/components/rating/index.js +114 -233
  122. package/components/slider/slider-container.js +15 -10
  123. package/components/slider/slider-item.js +10 -12
  124. package/components/status/index.js +63 -57
  125. package/components/tab/tab-container.js +26 -24
  126. package/components/tab/tab-header.js +36 -27
  127. package/components/tab/tab-panel.js +32 -15
  128. package/components/tab/tab.js +79 -80
  129. package/components/tooltip/index.js +4 -4
  130. package/components/transfer/index.js +10 -11
  131. package/components/tree-view/css.js +2 -0
  132. package/components/tree-view/index.js +14 -13
  133. package/components/typography/index.js +6 -112
  134. package/css/styles.css +1 -1
  135. package/css/styles.css.map +1 -1
  136. package/global/index.js +2 -0
  137. package/icons/basic.js +1648 -959
  138. package/icons/effect.js +45 -103
  139. package/package.json +1 -1
  140. package/readme.md +66 -0
  141. package/styles/color-helper.js +7 -146
  142. package/styles/colors.js +6 -2
  143. package/styles/font.js +9 -0
  144. package/styles/general.js +100 -7
  145. package/styles/typography.js +25 -26
  146. package/theme/settings.js +9 -2
  147. package/theme/theme-provider.js +15 -7
  148. package/theme/with-styles.js +2 -4
  149. package/theme/with-theme.js +2 -4
  150. package/utils/isMobile.js +21 -0
  151. package/utils/renderHTML.js +4 -5
  152. package/utils/renderIcon.js +15 -11
  153. package/utils/updatePosition.js +2 -2
@@ -1,14 +1,14 @@
1
1
  import { css } from '@emotion/core';
2
2
  import { parseToPixel } from "./utils";
3
- export const fontFamily = `"SF Pro Display Regular", sans-serif`;
4
- export const fontFamilyLink = 'https://core.diginet.com.vn/theme/default/fonts/SF-Pro-Display/SF-Pro-Display-Regular.otf';
5
- export const fontFamilyMedium = `"SF Pro Display Medium", sans-serif`;
6
- export const fontFamilyMediumLink = 'https://core.diginet.com.vn/theme/default/fonts/SF-Pro-Display/SF-Pro-Display-Medium.otf';
7
- export const fontFamilyBold = `"SF Pro Display Bold", sans-serif`;
8
- export const fontFamilyBoldLink = 'https://core.diginet.com.vn/theme/default/fonts/SF-Pro-Display/SF-Pro-Display-Bold.otf';
9
- export const fontSize = '16px';
3
+ import { font } from "./font";
4
+ export const {
5
+ fontFamily,
6
+ fontSize
7
+ } = font; //export to use general
8
+
10
9
  const fontNormal = css`
11
10
  font-style: normal;
11
+ font-family: ${fontFamily};
12
12
  `;
13
13
  const fontWeightBold = css`
14
14
  font-weight: 700;
@@ -18,7 +18,7 @@ const fontWeightRegular = css`
18
18
  `;
19
19
  const fontWeightNormal = css`
20
20
  font-weight: normal;
21
- `;
21
+ `; // follow rules line-height = fontsize + 4
22
22
 
23
23
  const getFontSize = size => css`
24
24
  font-size: ${parseToPixel(size)};
@@ -28,78 +28,77 @@ const getFontSize = size => css`
28
28
  const title1 = css`
29
29
  ${fontNormal};
30
30
  ${fontWeightBold};
31
- ${getFontSize(32)};
31
+ ${getFontSize(parseInt(fontSize) + 16)}; //32
32
32
  `;
33
33
  const title2 = css`
34
34
  ${fontNormal};
35
35
  ${fontWeightBold};
36
- ${getFontSize(26)};
36
+ ${getFontSize(parseInt(fontSize) + 10)}; //26
37
37
  `;
38
38
  const title3 = css`
39
39
  ${fontNormal};
40
40
  ${fontWeightBold};
41
- ${getFontSize(24)};
41
+ ${getFontSize(parseInt(fontSize) + 8)}; //24
42
42
  `;
43
43
  const title4 = css`
44
44
  ${fontNormal};
45
45
  ${fontWeightBold};
46
- ${getFontSize(22)};
46
+ ${getFontSize(parseInt(fontSize) + 6)}; //22
47
47
  `;
48
48
  const heading1 = css`
49
49
  ${fontNormal};
50
50
  ${fontWeightBold};
51
- ${getFontSize(20)};
51
+ ${getFontSize(parseInt(fontSize) + 4)}; //20
52
52
  `;
53
53
  const heading2 = css`
54
54
  ${fontNormal};
55
55
  ${fontWeightBold};
56
- ${getFontSize(18)};
56
+ ${getFontSize(parseInt(fontSize) + 2)}; //18
57
57
  `;
58
58
  const heading3 = css`
59
59
  ${fontNormal};
60
60
  ${fontWeightBold};
61
- font-size: 16px;
62
- line-height: 20px;
61
+ ${getFontSize(parseInt(fontSize))}; //16
63
62
  `;
64
63
  const heading4 = css`
65
64
  ${fontNormal};
66
65
  ${fontWeightBold};
67
- ${getFontSize(14)};
66
+ ${getFontSize(parseInt(fontSize) - 2)}; //14
68
67
  `;
69
68
  const heading5 = css`
70
69
  ${fontNormal};
71
70
  ${fontWeightBold};
72
- ${getFontSize(12)};
71
+ ${getFontSize(parseInt(fontSize) - 4)}; //12
73
72
  `;
74
73
  const heading6 = css`
75
74
  ${fontNormal};
76
75
  ${fontWeightRegular}
77
- ${getFontSize(12)};
76
+ ${getFontSize(parseInt(fontSize) - 4)}; //12
78
77
  `;
79
78
  const paragraph1 = css`
80
79
  ${fontNormal};
81
80
  ${fontWeightNormal};
82
- ${getFontSize(16)};
81
+ ${getFontSize(parseInt(fontSize))}; //16
83
82
  `;
84
83
  const paragraph2 = css`
85
84
  ${fontNormal};
86
85
  ${fontWeightNormal};
87
- ${getFontSize(14)};
86
+ ${getFontSize(parseInt(fontSize) - 2)}; //14
88
87
  `;
89
88
  const paragraph3 = css`
90
89
  ${fontNormal};
91
90
  ${fontWeightNormal};
92
- ${getFontSize(12)};
91
+ ${getFontSize(parseInt(fontSize) - 4)}; //12
93
92
  `;
94
93
  const uppercase = css`
95
- textTransform: uppercase
94
+ text-transform: uppercase
96
95
  `;
97
96
  const label = css`
98
- font-size: 12px;
99
- ${fontWeightBold};
97
+ font-size: ${parseInt(fontSize) - 4}px; //12
98
+ ${fontWeightBold}
100
99
  `;
101
100
  const helperText = css`
102
- font-size: 12px;
101
+ font-size: ${parseInt(fontSize) - 4}px; //12
103
102
  ${fontWeightNormal}
104
103
  `;
105
104
  export const typography = {
package/theme/settings.js CHANGED
@@ -1,5 +1,12 @@
1
- import { fontSize, fontFamily, fontFamilyMedium, fontFamilyBold } from '../styles/typography';
2
1
  import * as colors from '../styles/colors';
2
+ import { font } from '../styles/font';
3
+ const {
4
+ fontSize,
5
+ fontFamily,
6
+ fontFamilyBold,
7
+ fontFamilyMedium
8
+ } = font;
9
+ import { color } from '../styles/colors';
3
10
  const settings = {
4
11
  border: {
5
12
  radius: '4px',
@@ -9,7 +16,7 @@ const settings = {
9
16
  large: '0 4px 4px 0 rgba(0, 0, 0, 0.25)',
10
17
  small: '0 2px 2px 0 rgba(0, 0, 0, 0.25)'
11
18
  },
12
- colors: {
19
+ colors: { ...color,
13
20
  bgDisabled: colors.dark12,
14
21
  bgProgress: colors.brand12,
15
22
  border: colors.dark6,
@@ -5,33 +5,41 @@ import { memo, useEffect } from 'react';
5
5
  import { jsx, css } from '@emotion/core';
6
6
  import { setTheme } from './set-theme';
7
7
  import { makeStylesEls } from './make-styles';
8
- import { fontFamilyLink, fontFamilyMediumLink, fontFamilyBoldLink } from '../styles/typography';
9
8
  import { string, object, node } from 'prop-types';
9
+ import { font } from '../styles/font';
10
+ const {
11
+ fontFamily,
12
+ fontFamilyBold,
13
+ fontFamilyMedium,
14
+ fontFamilyLink,
15
+ fontFamilyBoldLink,
16
+ fontFamilyMediumLink
17
+ } = font;
10
18
  const ThemeProviderRoot = css`
11
19
  @font-face {
12
- font-family: 'SF Pro Display Bold';
20
+ font-family: ${fontFamilyBold};
13
21
  src: url('${fontFamilyBoldLink}') format('opentype');
14
22
  }
15
23
  @font-face {
16
- font-family: 'SF Pro Display Medium';
24
+ font-family: ${fontFamilyMedium};
17
25
  src: url('${fontFamilyMediumLink}') format('opentype');
18
26
  }
19
27
  @font-face {
20
- font-family: 'SF Pro Display Regular';
28
+ font-family: ${fontFamily};
21
29
  src: url('${fontFamilyLink}') format('opentype');
22
30
  }
23
31
  @font-face {
24
- font-family: 'SF Pro Display';
32
+ font-family: ${fontFamily};
25
33
  font-weight: 400;
26
34
  src: url('${fontFamilyLink}') format('opentype');
27
35
  }
28
36
  @font-face {
29
- font-family: 'SF Pro Display';
37
+ font-family: ${fontFamily};
30
38
  font-weight: 500;
31
39
  src: url('${fontFamilyMediumLink}') format('opentype');
32
40
  }
33
41
  @font-face {
34
- font-family: 'SF Pro Display';
42
+ font-family: ${fontFamily};
35
43
  font-weight: 700;
36
44
  src: url('${fontFamilyBoldLink}') format('opentype');
37
45
  }
@@ -1,5 +1,3 @@
1
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
3
1
  /** @jsxRuntime classic */
4
2
 
5
3
  /** @jsx jsx */
@@ -9,9 +7,9 @@ import makeStyles from './make-styles';
9
7
  const WithStyles = styles => Component => props => {
10
8
  const useStyle = makeStyles(styles);
11
9
  const classes = useStyle();
12
- return jsx(Component, _extends({}, props, {
10
+ return jsx(Component, { ...props,
13
11
  classes: classes
14
- }));
12
+ });
15
13
  };
16
14
 
17
15
  export default WithStyles;
@@ -1,11 +1,9 @@
1
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
3
1
  import settings from './settings';
4
2
 
5
3
  const withTheme = Component => props => {
6
- return /*#__PURE__*/React.createElement(Component, _extends({}, props, {
4
+ return /*#__PURE__*/React.createElement(Component, { ...props,
7
5
  theme: settings
8
- }));
6
+ });
9
7
  };
10
8
 
11
9
  export default withTheme;
@@ -0,0 +1,21 @@
1
+ const isMobile = {
2
+ iOS: function () {
3
+ return navigator.userAgent.match(/iPhone|iPad|iPod/i);
4
+ },
5
+ Android: function () {
6
+ return navigator.userAgent.match(/Android/i);
7
+ },
8
+ BlackBerry: function () {
9
+ return navigator.userAgent.match(/BlackBerry/i);
10
+ },
11
+ Opera: function () {
12
+ return navigator.userAgent.match(/Opera Mini/i);
13
+ },
14
+ Windows: function () {
15
+ return navigator.userAgent.match(/IEMobile/i) || navigator.userAgent.match(/WPDesktop/i);
16
+ },
17
+ any: function () {
18
+ return isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows();
19
+ }
20
+ };
21
+ export default isMobile;
@@ -1,5 +1,3 @@
1
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
3
1
  /** @jsxRuntime classic */
4
2
 
5
3
  /** @jsx jsx */
@@ -8,14 +6,15 @@ import parseTextToHTML from './parseHTML';
8
6
 
9
7
  const renderHTML = (text = null, TagName = 'div', options = {}) => {
10
8
  if (text && (text.$$typeof && String(text.$$typeof) === 'Symbol(react.element)' || Array.isArray(text) && text.some(node => node && String(node.$$typeof) === 'Symbol(react.element)'))) {
11
- return jsx(TagName, options, text);
9
+ return jsx(TagName, { ...options
10
+ }, text);
12
11
  }
13
12
 
14
- return jsx(TagName, _extends({}, options, {
13
+ return jsx(TagName, { ...options,
15
14
  dangerouslySetInnerHTML: {
16
15
  __html: parseTextToHTML(String(text))
17
16
  }
18
- }));
17
+ });
19
18
  };
20
19
 
21
20
  export default renderHTML;
@@ -1,10 +1,9 @@
1
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
3
1
  /** @jsxRuntime classic */
4
2
 
5
3
  /** @jsx jsx */
6
4
  import { jsx } from '@emotion/core';
7
- import Icon, * as Icons from '../icons';
5
+ import { ButtonIcon } from '../components';
6
+ import * as Icons from '../icons';
8
7
  import { parseTextToHTML, capitalize } from './';
9
8
  /**
10
9
  * render icon form source (dynamic type)
@@ -20,28 +19,33 @@ const renderIcon = (source, type, options = {}) => {
20
19
  let IconComp = Icons[capitalize(source)];
21
20
 
22
21
  if (IconComp) {
23
- return jsx(IconComp, options);
22
+ return jsx(IconComp, { ...options
23
+ });
24
24
  }
25
25
 
26
26
  return null;
27
27
 
28
28
  case 'effect':
29
- return jsx(Icon, _extends({
30
- name: source
31
- }, options));
29
+ return jsx(ButtonIcon, {
30
+ viewType: 'ghost',
31
+ name: source,
32
+ ...options
33
+ });
32
34
 
33
35
  case 'link':
34
36
  case 'imgLink':
35
- return jsx("img", _extends({
36
- src: source
37
- }, options));
37
+ return jsx("img", {
38
+ src: source,
39
+ ...options
40
+ });
38
41
 
39
42
  default:
40
43
  if (source.length < 20) {
41
44
  const IconComp = Icons[capitalize(source)];
42
45
 
43
46
  if (IconComp) {
44
- return jsx(IconComp, options);
47
+ return jsx(IconComp, { ...options
48
+ });
45
49
  }
46
50
 
47
51
  return null;
@@ -14,7 +14,7 @@ const updatePosition = (anchorEl, transformEl, cb) => {
14
14
  } = transformEl.getBoundingClientRect(); // Vertical
15
15
 
16
16
  if (bottom < 0 || top > innerHeight) {
17
- cb();
17
+ cb === null || cb === void 0 ? void 0 : cb();
18
18
  } else if (bottom + 4 + nodeHeight > innerHeight) {
19
19
  if (top - (nodeHeight + 4) > 0) {
20
20
  transformEl.style.top = top - (nodeHeight + 4) + 'px';
@@ -27,7 +27,7 @@ const updatePosition = (anchorEl, transformEl, cb) => {
27
27
 
28
28
 
29
29
  if (left < 0 || right > innerWidth) {
30
- cb();
30
+ cb === null || cb === void 0 ? void 0 : cb();
31
31
  } else {
32
32
  transformEl.style.left = left + 'px';
33
33
  }