diginet-core-ui 1.3.70 → 1.3.71

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/global/index.js CHANGED
@@ -31,7 +31,7 @@ const globalObject = {
31
31
  // Transfer
32
32
  choices: 'lựa chọn',
33
33
  chosen: 'được chọn',
34
- selected: 'được chọn',
34
+ selected: 'Đã chọn',
35
35
  // Date Picker
36
36
  helperInvalid: 'Sai định dạng',
37
37
  helperValid: 'Phù hợp',
@@ -64,8 +64,8 @@ const globalObject = {
64
64
  min: 'Chưa đạt giá trị tối thiểu cho phép',
65
65
  required: 'Trường này bắt buộc nhập'
66
66
  },
67
- inputPlaceholder: "Nhập",
68
- dropdownPlaceholder: "Chọn"
67
+ inputPlaceholder: 'Nhập',
68
+ dropdownPlaceholder: 'Chọn'
69
69
  },
70
70
  en: {
71
71
  agree: 'Agree',
@@ -130,8 +130,8 @@ const globalObject = {
130
130
  min: 'The minimum allowed value has not been reached',
131
131
  required: 'This field is required'
132
132
  },
133
- inputPlaceholder: "Type something",
134
- dropdownPlaceholder: "Select"
133
+ inputPlaceholder: 'Type something',
134
+ dropdownPlaceholder: 'Select'
135
135
  },
136
136
  delayOnInput: 500
137
137
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "diginet-core-ui",
3
- "version": "1.3.70",
3
+ "version": "1.3.71",
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,16 @@ npm test
38
38
  ```
39
39
 
40
40
  ## Changelog
41
+ ## 1.3.71
42
+ - \[Changed\]: Tooltip – Add prop disableInteractive
43
+ - \[Changed\]: Card – Update storybook Card
44
+ - \[Changed\]: Dropdown – Add prop maximumSelectionLength
45
+ - \[Fixed\]: TextInput – Fix bug cannot set status
46
+ - \[Fixed\]: Button – Fix height of viewType outlined
47
+ - \[Fixed\]: Grid – Fix topSpacing, leftSpacing not receive value 0
48
+ - \[Fixed\]: Avatar – Fix bug change avatar when disabled; Add prop style
49
+ - \[Fixed\]: Dropdown – Fix bug big image when use iconExpr
50
+
41
51
  ## 1.3.70
42
52
  - \[Changed\]: Checkbox – Add prop required
43
53
  - \[Changed\]: Radio – Add prop required
package/utils/index.js CHANGED
@@ -21,4 +21,6 @@ export * from './validate';
21
21
  export { default as onValidate } from './validate';
22
22
  export { default as classNames } from './classNames';
23
23
  export { default as refType } from './refType';
24
+ export * from './sb-template';
25
+ export { default as SbTemplate } from './sb-template';
24
26
  export default utils;
@@ -1,21 +1,23 @@
1
1
  import React from 'react';
2
- import { css, js } from '@emotion/core';
2
+ import { css } from '@emotion/core';
3
3
  import { Col, Row, Tooltip, Typography } from '../components/index';
4
4
  import { useTheme } from '../theme';
5
- import { flexWrap, flexRow, alignCenter } from '../styles/general';
6
- import { ImportComp } from '../components/others/import/index.stories';
5
+ import { flexWrap, flexRow, alignCenter, flexCol, alignStart, alignEnd } from '../styles/general';
6
+ import ImportComp from '../components/others/import';
7
7
  import PropTypes from 'prop-types';
8
8
  const {
9
9
  spacing
10
10
  } = useTheme();
11
+ const alignMap = new Map([['start', alignStart], ['center', alignCenter], ['end', alignEnd]]);
11
12
  export const Template = ({
12
13
  title,
13
14
  args,
14
15
  propsCustom,
15
16
  disabledTooltip,
16
17
  component: Component,
17
- horizontal
18
- } = props) => {
18
+ horizontal,
19
+ align
20
+ }) => {
19
21
  return /*#__PURE__*/React.createElement(Row, {
20
22
  style: {
21
23
  padding: spacing(2)
@@ -33,9 +35,9 @@ export const Template = ({
33
35
  gap: spacing(2)
34
36
  },
35
37
  css: css`
36
- ${horizontal ? flexRow : ''};
38
+ ${horizontal ? flexRow : flexCol};
37
39
  ${flexWrap};
38
- ${alignCenter}
40
+ ${alignMap.get(align)};
39
41
  `
40
42
  }, [{}, ...propsCustom].map((itemProps, indexProps) => {
41
43
  const argsTemp = { ...args,
@@ -57,7 +59,7 @@ const StoryBookTemplate = ({
57
59
  propsCustom,
58
60
  listItem,
59
61
  componentName
60
- } = props) => {
62
+ }) => {
61
63
  return /*#__PURE__*/React.createElement(Row, null, /*#__PURE__*/React.createElement(Col, {
62
64
  xs: 12
63
65
  }, /*#__PURE__*/React.createElement(ImportComp, {
@@ -69,7 +71,9 @@ const StoryBookTemplate = ({
69
71
  horizontal,
70
72
  title,
71
73
  argsExtra,
72
- propsCustom: itemPropsCustom
74
+ propsCustom: itemPropsCustom,
75
+ disabledTooltip,
76
+ align
73
77
  } = propsItem;
74
78
  return /*#__PURE__*/React.createElement(Template, {
75
79
  key: idx,
@@ -79,21 +83,25 @@ const StoryBookTemplate = ({
79
83
  ...argsExtra
80
84
  },
81
85
  component: component,
82
- propsCustom: [...(propsCustom || []), ...(itemPropsCustom || [])]
86
+ propsCustom: [...(propsCustom || []), ...(itemPropsCustom || [])],
87
+ disabledTooltip: disabledTooltip,
88
+ align: align
83
89
  });
84
90
  })));
85
91
  };
86
92
 
87
93
  Template.defaultProps = {
88
94
  propsCustom: [],
89
- disabledTooltip: false
95
+ disabledTooltip: false,
96
+ align: 'start'
90
97
  };
91
98
  Template.propTypes = {
92
99
  title: PropTypes.string.isRequired,
93
100
  args: PropTypes.object,
94
101
  propsCustom: PropTypes.array,
95
102
  disabledTooltip: PropTypes.bool,
96
- horizontal: PropTypes.bool
103
+ horizontal: PropTypes.bool,
104
+ align: PropTypes.oneOf(['start', 'center', 'end'])
97
105
  };
98
106
  StoryBookTemplate.propTypes = {
99
107
  componentName: PropTypes.string.isRequired,