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
package/icons/effect.js CHANGED
@@ -29,24 +29,24 @@ const Icon = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
29
29
  }, reference) => {
30
30
  const ref = useRef(null);
31
31
  const IconCss = css`
32
- ${flexRow}
33
- ${justifyCenter}
32
+ ${flexRow}
33
+ ${justifyCenter}
34
34
  ${alignCenter}
35
35
  ${borderBox}
36
36
  ${outlineNone}
37
37
  ${userSelectNone}
38
38
  width: max-content;
39
- height: max-content;
40
- min-width: ${width ? isNaN(width) ? width : width + 'px' : '24px'};
41
- min-height: ${width ? isNaN(height) ? height : height + 'px' : '24px'};
42
- `;
39
+ height: max-content;
40
+ min-width: ${width ? isNaN(width) ? width : width + 'px' : '24px'};
41
+ min-height: ${width ? isNaN(height) ? height : height + 'px' : '24px'};
42
+ `;
43
43
  const NotFoundIcon = css`
44
- ${flexRow}
45
- ${borderBox}
44
+ ${flexRow}
45
+ ${borderBox}
46
46
  width: ${width ? isNaN(width) ? width : width + 'px' : '24px'};
47
- height: ${width ? isNaN(width) ? width : width + 'px' : '24px'};
48
- border: 1px dashed ${rest};
49
- `;
47
+ height: ${width ? isNaN(width) ? width : width + 'px' : '24px'};
48
+ border: 1px dashed ${rest};
49
+ `;
50
50
  useImperativeHandle(reference, () => {
51
51
  const currentRef = ref.current || {};
52
52
  const _instance = {}; // methods
@@ -96,8 +96,8 @@ Icon.propTypes = {
96
96
  /** name of icon in icons store */
97
97
  name: PropTypes.string.isRequired,
98
98
 
99
- /** color of icon<br />
100
- * default: #7F828E
99
+ /** color of icon<br />
100
+ * default: #7F828E
101
101
  */
102
102
  color: PropTypes.string,
103
103
 
@@ -119,19 +119,19 @@ Icon.propTypes = {
119
119
  /** have view box if true */
120
120
  onClick: PropTypes.func,
121
121
 
122
- /**
123
- * ref methods
124
- *
125
- * * option(): Gets all UI component properties
126
- * * Returns value - object
127
- * * option(optionName): Gets the value of a single property
128
- * * @param {optionName} - string
129
- * * Returns value - any
130
- * * option(optionName, optionValue): Updates the value of a single property
131
- * * @param {optionName} - string
132
- * * @param {optionValue} - any
133
- * * option(options): Updates the values of several properties
134
- * * @param {options} - object
122
+ /**
123
+ * ref methods
124
+ *
125
+ * * option(): Gets all UI component properties
126
+ * * Returns value - object
127
+ * * option(optionName): Gets the value of a single property
128
+ * * @param {optionName} - string
129
+ * * Returns value - any
130
+ * * option(optionName, optionValue): Updates the value of a single property
131
+ * * @param {optionName} - string
132
+ * * @param {optionValue} - any
133
+ * * option(options): Updates the values of several properties
134
+ * * @param {options} - object
135
135
  */
136
136
  reference: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
137
137
  current: PropTypes.instanceOf(Element)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "diginet-core-ui",
3
- "version": "1.3.34",
3
+ "version": "1.3.35",
4
4
  "description": "The DigiNet core ui",
5
5
  "homepage": "https://diginet.com.vn",
6
6
  "main": "index.js",
package/readme.md CHANGED
@@ -38,6 +38,23 @@ npm test
38
38
  ```
39
39
 
40
40
  ## Changelog
41
+ ## 1.3.35
42
+ - \[Added\]: Icon - AssignmentTurnedIn, DGNProducts
43
+ - \[Added\]: MenuIcon - MHRP09N0032
44
+ - \[Changed\]: Icon – Guide, Locate
45
+ - \[Changed\]: Tab - Return callback onclick event, value; Add prop centered in TabHeader
46
+ - \[Changed\]: MoneyInput - Add props convertToWords
47
+ - \[Changed\]: Calendar - Allow select day of previous or next month
48
+ - \[Changed\]: Tab - Change logic of TabPanel; Add lazyLoading; Apply general css
49
+ - \[Fixed\]: Tab - Fix bug React.cloneElement when pass null in TabContainer, TabHeader
50
+ - \[Fixed\]: Dropdown - Remove min-width
51
+ - \[Fixed\]: SYSTEM - Format source code with prettier
52
+ - \[Fixed\]: Label - Fix pixel perfect
53
+ - \[Fixed\]: Dropdown - Fix bug not show last search value
54
+ - \[Fixed\]: Dropdown - Fix bug render icon; Show valueExpr when not have displayExpr
55
+ - \[Fixed\]: Chip - Remove unused variable
56
+ - \[Fixed\]: Badge - Fix iconProps not in useMemo dependency
57
+
41
58
  ## 1.3.34
42
59
  - \[Added\]: Icon - ArrowSwapHoriz, PaperZoom
43
60
  - \[Added\]: MenuIcon - ALL, D00, D09, D13, D15, D21, D25, D29, D38, D39, D51, D52, D77, D84, D89
package/theme/settings.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as colors from '../styles/colors';
2
2
  import { font } from '../styles/font';
3
3
  import { color } from '../styles/colors';
4
- import { rootSpacing } from "../styles/general";
4
+ import { rootSpacing } from '../styles/general';
5
5
  const {
6
6
  fontSize,
7
7
  fontFamily,
@@ -43,12 +43,14 @@ const settings = {
43
43
  label: {
44
44
  fontSize: 12,
45
45
  fontFamily,
46
- fontWeight: 'bold'
46
+ fontWeight: '500',
47
+ lineHeight: '16px'
47
48
  },
48
49
  helperText: {
49
50
  fontSize: 12,
50
51
  fontFamily,
51
- fontWeight: 'normal'
52
+ fontWeight: 'normal',
53
+ lineHeight: '16px'
52
54
  }
53
55
  },
54
56
  breakpoints: {
@@ -82,7 +84,7 @@ const getMedia = (value, type, value2 = '') => {
82
84
  px2 = '';
83
85
 
84
86
  if (typeof value === 'number') {
85
- px1 = value + 'px';
87
+ px1 = value + 'px'; // eslint-disable-next-line no-constant-condition
86
88
  } else if (/^xs|sm|md|lg|xl$/) {
87
89
  px1 = values[value] - (type === 'max' ? 0.05 : 0) + 'px';
88
90
  }
@@ -95,7 +97,7 @@ const getMedia = (value, type, value2 = '') => {
95
97
  value2 = values[keys[keys.indexOf(value) + 1]] - 0.05 + 'px';
96
98
  } else {
97
99
  if (typeof value2 === 'number') {
98
- value2 += 'px';
100
+ value2 += 'px'; // eslint-disable-next-line no-constant-condition
99
101
  } else if (/^xs|sm|md|lg|xl$/) {
100
102
  value2 = values[keys[keys.indexOf(value2) + 1]] - 0.05 + 'px';
101
103
  }
package/utils/number.js CHANGED
@@ -1,8 +1,8 @@
1
- /**
2
- *
3
- * @param {String} value
4
- * @param {String} format
5
- */
1
+ /**
2
+ *
3
+ * @param {String} value
4
+ * @param {String} format
5
+ */
6
6
  export default function numberFormat(value, format) {
7
7
  let hashCount = 0;
8
8
  let a = '';
@@ -19,11 +19,11 @@ export default function numberFormat(value, format) {
19
19
 
20
20
  switch (hashCount) {
21
21
  case 3:
22
- a = value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
22
+ a = value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
23
23
  break;
24
24
 
25
25
  case 2:
26
- a = value.toString().replace(/\B(?=(\d{2})+(?!\d))/g, ",");
26
+ a = value.toString().replace(/\B(?=(\d{2})+(?!\d))/g, ',');
27
27
  break;
28
28
 
29
29
  default:
@@ -44,8 +44,8 @@ export default function numberFormat(value, format) {
44
44
  //For case like +1 (911) 911 91 91 having pattern +1 (###) ### ## ##
45
45
 
46
46
  const index = i === ln ? value.length : value.indexOf(part, start);
47
- /* in any case if we don't find the pattern part in the value assume the val as numeric string
48
- This will be also in case if user has started typing, in any other case it will not be -1
47
+ /* in any case if we don't find the pattern part in the value assume the val as numeric string
48
+ This will be also in case if user has started typing, in any other case it will not be -1
49
49
  unless wrong prop value is provided */
50
50
 
51
51
  if (index === -1) {
@@ -57,8 +57,7 @@ export default function numberFormat(value, format) {
57
57
  }
58
58
  }
59
59
 
60
- return (numStr.toString() || []).replace(/\B(?=(\d{4})+(?!\d))/g, " ");
60
+ return (numStr.toString() || []).replace(/\B(?=(\d{4})+(?!\d))/g, ' ');
61
61
  }
62
62
  }
63
- }
64
- ;
63
+ }