@zohodesk/components 1.2.63 → 1.3.0
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/.cli/config/variables/variableMapping.json +7 -0
- package/.cli/propValidation_report.html +1 -1
- package/README.md +8 -0
- package/assets/Appearance/dark/mode/Component_DarkMode.module.css +1 -0
- package/assets/Appearance/light/mode/Component_LightMode.module.css +1 -0
- package/assets/Appearance/pureDark/mode/Component_PureDarkMode.module.css +1 -0
- package/es/ListItem/ListContainer.js +3 -2
- package/es/ListItem/ListItem.module.css +52 -6
- package/es/ListItem/ListItemWithAvatar.js +17 -6
- package/es/ListItem/ListItemWithCheckBox.js +18 -6
- package/es/ListItem/ListItemWithIcon.js +20 -7
- package/es/ListItem/ListItemWithRadio.js +19 -6
- package/es/ListItem/__tests__/ListContainer.spec.js +8 -0
- package/es/ListItem/__tests__/ListItemWithAvatar.spec.js +35 -0
- package/es/ListItem/__tests__/ListItemWithCheckBox.spec.js +35 -0
- package/es/ListItem/__tests__/ListItemWithIcon.spec.js +35 -0
- package/es/ListItem/__tests__/ListItemWithRadio.spec.js +35 -0
- package/es/ListItem/__tests__/__snapshots__/ListContainer.spec.js.snap +13 -0
- package/es/ListItem/__tests__/__snapshots__/ListItemWithAvatar.spec.js.snap +200 -2
- package/es/ListItem/__tests__/__snapshots__/ListItemWithCheckBox.spec.js.snap +451 -30
- package/es/ListItem/__tests__/__snapshots__/ListItemWithIcon.spec.js.snap +202 -4
- package/es/ListItem/__tests__/__snapshots__/ListItemWithRadio.spec.js.snap +447 -30
- package/es/ListItem/props/defaultProps.js +13 -5
- package/es/ListItem/props/propTypes.js +13 -1
- package/es/MultiSelect/AdvancedMultiSelect.js +10 -4
- package/es/MultiSelect/MultiSelect.js +8 -4
- package/es/MultiSelect/MultiSelect.module.css +9 -1
- package/es/MultiSelect/MultiSelectWithAvatar.js +6 -2
- package/es/MultiSelect/Suggestions.js +5 -2
- package/es/MultiSelect/__tests__/__snapshots__/MultiSelectHeader.spec.js.snap +34 -13
- package/es/MultiSelect/props/propTypes.js +3 -0
- package/es/Radio/props/propTypes.js +1 -1
- package/es/common/common.module.css +10 -0
- package/es/utils/dropDownUtils.js +33 -8
- package/es/v1/Radio/props/propTypes.js +1 -1
- package/lib/ListItem/ListContainer.js +3 -2
- package/lib/ListItem/ListItem.module.css +52 -6
- package/lib/ListItem/ListItemWithAvatar.js +16 -5
- package/lib/ListItem/ListItemWithCheckBox.js +17 -5
- package/lib/ListItem/ListItemWithIcon.js +19 -6
- package/lib/ListItem/ListItemWithRadio.js +18 -5
- package/lib/ListItem/__tests__/ListContainer.spec.js +8 -0
- package/lib/ListItem/__tests__/ListItemWithAvatar.spec.js +35 -0
- package/lib/ListItem/__tests__/ListItemWithCheckBox.spec.js +35 -0
- package/lib/ListItem/__tests__/ListItemWithIcon.spec.js +35 -0
- package/lib/ListItem/__tests__/ListItemWithRadio.spec.js +35 -0
- package/lib/ListItem/__tests__/__snapshots__/ListContainer.spec.js.snap +13 -0
- package/lib/ListItem/__tests__/__snapshots__/ListItemWithAvatar.spec.js.snap +200 -2
- package/lib/ListItem/__tests__/__snapshots__/ListItemWithCheckBox.spec.js.snap +451 -30
- package/lib/ListItem/__tests__/__snapshots__/ListItemWithIcon.spec.js.snap +202 -4
- package/lib/ListItem/__tests__/__snapshots__/ListItemWithRadio.spec.js.snap +447 -30
- package/lib/ListItem/props/defaultProps.js +13 -5
- package/lib/ListItem/props/propTypes.js +12 -2
- package/lib/MultiSelect/AdvancedMultiSelect.js +76 -69
- package/lib/MultiSelect/MultiSelect.js +8 -4
- package/lib/MultiSelect/MultiSelect.module.css +9 -1
- package/lib/MultiSelect/MultiSelectWithAvatar.js +6 -2
- package/lib/MultiSelect/Suggestions.js +5 -2
- package/lib/MultiSelect/__tests__/__snapshots__/MultiSelectHeader.spec.js.snap +34 -13
- package/lib/MultiSelect/props/propTypes.js +4 -1
- package/lib/Radio/props/propTypes.js +1 -1
- package/lib/common/common.module.css +10 -0
- package/lib/utils/dropDownUtils.js +41 -11
- package/lib/v1/Radio/props/propTypes.js +1 -1
- package/package.json +6 -6
- package/result.json +1 -1
package/README.md
CHANGED
|
@@ -32,6 +32,14 @@ In this Package, we Provide Some Basic Components to Build Web App
|
|
|
32
32
|
- TextBoxIcon
|
|
33
33
|
- Tooltip
|
|
34
34
|
|
|
35
|
+
# 1.2.64
|
|
36
|
+
|
|
37
|
+
- **AdvancedMultiSelect, MultiSelect, MultiSelectWithAvatar** - searchFields prop supported
|
|
38
|
+
- **AdvancedMultiSelect, MultiSelectWithAvatar** - secondaryField prop supported
|
|
39
|
+
- **ListContainer** - align prop supported
|
|
40
|
+
- **ListItemWithAvatar** - secondaryValue, lhsAlignContent prop supported
|
|
41
|
+
- **ListItemWithCheckBox, ListItemWithIcon, ListItemWithRadio** - secondaryValue, lhsAlignContent, lhsJustifyContent prop supported
|
|
42
|
+
|
|
35
43
|
# 1.2.63
|
|
36
44
|
|
|
37
45
|
- **AdvancedGroupMultiSelect, AdvancedMultiSelect, MultiSelect, MultiSelectWithAvatar, GroupSelect, Select, SelectWithAvatar** - `allowValueFallback` prop supported.
|
|
@@ -165,6 +165,7 @@
|
|
|
165
165
|
|
|
166
166
|
/* listitem */
|
|
167
167
|
--zdt_listitem_default_text: hsla(210, 7.41%, calc(89.41% + var(--zdc_default_inverse)), calc(1 + var(--zdc_alpha_high)));
|
|
168
|
+
--zdt_listitem_secondaryfield_text: hsla(217, 7.76%, calc(54.51% + var(--zdc_default_inverse)), calc(1 + var(--zdc_alpha_high)));
|
|
168
169
|
--zdt_listitem_default_border: var(--dot_mirror);
|
|
169
170
|
--zdt_listitem_default_bg: var(--dot_mirror);
|
|
170
171
|
--zdt_listitem_default_tickicon: var(--zdt_cta_primary_text);
|
|
@@ -165,6 +165,7 @@
|
|
|
165
165
|
|
|
166
166
|
/* listitem */
|
|
167
167
|
--zdt_listitem_default_text: hsla(0, 0.00%, calc(0.00% + var(--zdc_default_inverse)), calc(1 + var(--zdc_alpha_high)));
|
|
168
|
+
--zdt_listitem_secondaryfield_text: hsla(218, 9.76%, calc(51.76% + var(--zdc_default_inverse)), calc(1 + var(--zdc_alpha_high)));
|
|
168
169
|
--zdt_listitem_default_border: var(--dot_mirror);
|
|
169
170
|
--zdt_listitem_default_bg: var(--dot_mirror);
|
|
170
171
|
--zdt_listitem_default_tickicon: var(--zdt_cta_primary_text);
|
|
@@ -165,6 +165,7 @@
|
|
|
165
165
|
|
|
166
166
|
/* listitem */
|
|
167
167
|
--zdt_listitem_default_text: hsla(210, 7.41%, calc(89.41% + var(--zdc_default_inverse)), calc(1 + var(--zdc_alpha_high)));
|
|
168
|
+
--zdt_listitem_secondaryfield_text: hsla(217, 7.76%, calc(54.51% + var(--zdc_default_inverse)), calc(1 + var(--zdc_alpha_high)));
|
|
168
169
|
--zdt_listitem_default_border: var(--dot_mirror);
|
|
169
170
|
--zdt_listitem_default_bg: var(--dot_mirror);
|
|
170
171
|
--zdt_listitem_default_tickicon: var(--zdt_cta_primary_text);
|
|
@@ -31,7 +31,8 @@ const ListContainer = props => {
|
|
|
31
31
|
onClick,
|
|
32
32
|
onMouseEnter,
|
|
33
33
|
onMouseOver,
|
|
34
|
-
eleRef
|
|
34
|
+
eleRef,
|
|
35
|
+
align
|
|
35
36
|
} = props;
|
|
36
37
|
const responsiveFunc = useCallback(_ref => {
|
|
37
38
|
let {
|
|
@@ -77,7 +78,7 @@ const ListContainer = props => {
|
|
|
77
78
|
"aria-selected": ariaSelected,
|
|
78
79
|
"aria-label": ariaLabel,
|
|
79
80
|
isCover: false,
|
|
80
|
-
align:
|
|
81
|
+
align: align,
|
|
81
82
|
alignBox: "row",
|
|
82
83
|
className: `${style.list} ${style[size]} ${mobileToTab && isTouchDevice ? style.responsiveHeight : ''} ${style[palette]} ${active ? style[`active${palette}`] : highlight && !isDisabled ? style[`${palette}Hover`] : ''} ${autoHover && !isDisabled ? style[`${palette}Effect`] : ''} ${needTick ? style[`${size}withTick`] : ''} ${isDisabled ? CssProvider('isDisable') : ''} ${needBorder ? active ? style.activewithBorder : style.withBorder : ''} ${customClass}`,
|
|
83
84
|
dataId: dataId,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
.varClass {
|
|
2
2
|
/* listitem default variables */
|
|
3
|
+
--listitem_font_size: var(--zd_font_size13);
|
|
3
4
|
--listitem_text_color: var(--zdt_listitem_default_text);
|
|
4
5
|
--listitem_padding: var(--zd_size9) var(--zd_size20);
|
|
5
6
|
--listitem_border_width: 0;
|
|
@@ -24,7 +25,7 @@
|
|
|
24
25
|
position: relative;
|
|
25
26
|
list-style: none;
|
|
26
27
|
color: var(--listitem_text_color);
|
|
27
|
-
font-size: var(--
|
|
28
|
+
font-size: var(--listitem_font_size);
|
|
28
29
|
height: var(--listitem_height);
|
|
29
30
|
min-height: var(--listitem_min_height);
|
|
30
31
|
text-decoration: none;
|
|
@@ -57,7 +58,7 @@
|
|
|
57
58
|
--listitem_min_height: var(--zd_size35);
|
|
58
59
|
}
|
|
59
60
|
.large {
|
|
60
|
-
--
|
|
61
|
+
--listitem_min_height: var(--zd_size48);
|
|
61
62
|
}
|
|
62
63
|
[dir=ltr] .large {
|
|
63
64
|
--listitem_padding: var(--zd_size10) var(--zd_size3) var(--zd_size10) var(--zd_size25);
|
|
@@ -72,9 +73,8 @@
|
|
|
72
73
|
.value, .multiLineValue {
|
|
73
74
|
line-height: 1.5385;
|
|
74
75
|
}
|
|
75
|
-
.multiLineValue{
|
|
76
|
-
|
|
77
|
-
composes: clamp from '../common/common.module.css'
|
|
76
|
+
.multiLineValue,.multiLine{
|
|
77
|
+
composes: lineClamp from '../common/common.module.css';
|
|
78
78
|
}
|
|
79
79
|
.iconBox {
|
|
80
80
|
width: var(--zd_size20) ;
|
|
@@ -94,6 +94,42 @@
|
|
|
94
94
|
margin: var(--listitem_avatar_margin);
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
+
.lhsJustifyContent_start,
|
|
98
|
+
.lhsJustifyContent_center,
|
|
99
|
+
.lhsJustifyContent_end {
|
|
100
|
+
composes: dflex alignVertical from '../common/common.module.css';
|
|
101
|
+
}
|
|
102
|
+
.lhsJustifyContent_start {
|
|
103
|
+
composes: justifyFstart from '../common/common.module.css';
|
|
104
|
+
}
|
|
105
|
+
.lhsJustifyContent_center {
|
|
106
|
+
composes: alignHorizontal from '../common/common.module.css';
|
|
107
|
+
}
|
|
108
|
+
.lhsJustifyContent_end {
|
|
109
|
+
composes: justifyFend from '../common/common.module.css';
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.lhsBox {
|
|
113
|
+
composes: dflex from '../common/common.module.css';
|
|
114
|
+
align-self: stretch;
|
|
115
|
+
}
|
|
116
|
+
.lhsBox_small,
|
|
117
|
+
.lhsBox_medium,
|
|
118
|
+
.lhsBox_large{
|
|
119
|
+
composes: varClass;
|
|
120
|
+
--listitem_doubleline_content_height: calc(var(--listitem_font_size) * 2 );
|
|
121
|
+
height: 100% ;
|
|
122
|
+
composes: dflex alignVertical from '../common/common.module.css';
|
|
123
|
+
}
|
|
124
|
+
.lhsBox_small {
|
|
125
|
+
max-height: calc(var(--listitem_doubleline_content_height) + var(--zd_size7)); /* 7px = listitem min-height - (top + bottom padding) - doubleLine content height */
|
|
126
|
+
}
|
|
127
|
+
.lhsBox_medium {
|
|
128
|
+
max-height: calc(var(--listitem_doubleline_content_height) + var(--zd_size8)); /* 8px = listitem min-height - (top + bottom padding) - doubleLine content height */
|
|
129
|
+
}
|
|
130
|
+
.lhsBox_large {
|
|
131
|
+
max-height: calc(var(--listitem_doubleline_content_height) + var(--zd_size15)); /* 15px = listitem min-height - (top + bottom padding) - doubleLine content height */
|
|
132
|
+
}
|
|
97
133
|
.defaultHover, .primaryHover, .secondaryHover, .darkHover {
|
|
98
134
|
background-color: var(--listitem_highlight_bg_color);
|
|
99
135
|
}
|
|
@@ -155,12 +191,22 @@
|
|
|
155
191
|
.activedark {
|
|
156
192
|
--listitem_active_bg_color: var(--zdt_listitem_dark_active_bg);
|
|
157
193
|
}
|
|
194
|
+
.secondaryField{
|
|
195
|
+
color:var(--zdt_listitem_secondaryfield_text);
|
|
196
|
+
font-size: var(--zd_font_size12) ;
|
|
197
|
+
line-height: 1.25;
|
|
198
|
+
}
|
|
158
199
|
|
|
159
200
|
.tickIcon,
|
|
160
201
|
.defaultTick,
|
|
161
202
|
.darkTick {
|
|
162
203
|
position: absolute;
|
|
163
204
|
color: var(--listitem_tickicon_color);
|
|
205
|
+
top:50% ;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.tickIcon, .defaultTick, .darkTick {
|
|
209
|
+
transform: translateY(-50%);
|
|
164
210
|
}
|
|
165
211
|
|
|
166
212
|
[dir=ltr] .tickIcon, [dir=ltr] .defaultTick, [dir=ltr] .darkTick {
|
|
@@ -199,7 +245,7 @@
|
|
|
199
245
|
}
|
|
200
246
|
.responsiveHeight {
|
|
201
247
|
--listitem_min_height: var(--zd_size45);
|
|
202
|
-
|
|
248
|
+
--listitem_font_size: var(--zd_font_size15);
|
|
203
249
|
padding-top: var(--zd_size10) ;
|
|
204
250
|
padding-bottom: var(--zd_size10) ;
|
|
205
251
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**** Libraries ****/
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { Box } from "../Layout";
|
|
3
|
+
import { Box, Container } from "../Layout";
|
|
4
4
|
import ListContainer from "./ListContainer";
|
|
5
5
|
import { ListItemWithAvatarDefaultProps } from "./props/defaultProps";
|
|
6
6
|
import { ListItemWithAvatar_Props } from "./props/propTypes";
|
|
@@ -74,7 +74,9 @@ export default class ListItemWithAvatar extends React.PureComponent {
|
|
|
74
74
|
a11y,
|
|
75
75
|
customClass,
|
|
76
76
|
customProps,
|
|
77
|
-
needMultiLineText
|
|
77
|
+
needMultiLineText,
|
|
78
|
+
secondaryValue,
|
|
79
|
+
lhsAlignContent
|
|
78
80
|
} = this.props;
|
|
79
81
|
let {
|
|
80
82
|
ListItemProps = {},
|
|
@@ -118,7 +120,10 @@ export default class ListItemWithAvatar extends React.PureComponent {
|
|
|
118
120
|
customProps: ListItemProps,
|
|
119
121
|
...ContainerProps
|
|
120
122
|
}, name || imgSrc ? /*#__PURE__*/React.createElement(Box, {
|
|
121
|
-
className: style.leftAvatar
|
|
123
|
+
className: `${style.leftAvatar} ${lhsAlignContent !== 'center' ? `${style.lhsBox}` : ''}`
|
|
124
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
125
|
+
align: lhsAlignContent,
|
|
126
|
+
className: style[`lhsBox_${size}`]
|
|
122
127
|
}, isTeam ? /*#__PURE__*/React.createElement(AvatarTeam, {
|
|
123
128
|
name: name,
|
|
124
129
|
size: "small",
|
|
@@ -141,12 +146,18 @@ export default class ListItemWithAvatar extends React.PureComponent {
|
|
|
141
146
|
palette: isDarkPalette ? 'info' : avatarPalette,
|
|
142
147
|
customClass: customAvatar,
|
|
143
148
|
...AvatarProps
|
|
144
|
-
})) : null,
|
|
149
|
+
}))) : null, /*#__PURE__*/React.createElement(Box, {
|
|
145
150
|
flexible: true,
|
|
146
|
-
shrink: true
|
|
151
|
+
shrink: true
|
|
152
|
+
}, /*#__PURE__*/React.createElement(Container, {
|
|
153
|
+
alignBox: "column"
|
|
154
|
+
}, value ? /*#__PURE__*/React.createElement(Box, {
|
|
147
155
|
"data-title": isDisabled ? null : title,
|
|
148
156
|
className: needMultiLineText ? style.multiLineValue : style.value
|
|
149
|
-
}, value) : null,
|
|
157
|
+
}, value) : null, secondaryValue ? /*#__PURE__*/React.createElement(Box, {
|
|
158
|
+
"data-title": isDisabled ? null : secondaryValue,
|
|
159
|
+
className: `${style.secondaryField} ${needMultiLineText ? style.multiLine : ''}`
|
|
160
|
+
}, secondaryValue) : null)), needTick && active ? /*#__PURE__*/React.createElement(Box, {
|
|
150
161
|
className: style.tickIcon,
|
|
151
162
|
"aria-hidden": ariaHidden,
|
|
152
163
|
dataId: `${dataIdString}_tickIcon`,
|
|
@@ -3,7 +3,7 @@ import ListContainer from "./ListContainer";
|
|
|
3
3
|
import { ListItemWithCheckBoxDefaultProps } from "./props/defaultProps";
|
|
4
4
|
import { ListItemWithCheckBox_Props } from "./props/propTypes";
|
|
5
5
|
import CheckBox from "../CheckBox/CheckBox";
|
|
6
|
-
import { Box } from "../Layout";
|
|
6
|
+
import { Box, Container } from "../Layout";
|
|
7
7
|
import style from "./ListItem.module.css";
|
|
8
8
|
export default class ListItemWithCheckBox extends React.Component {
|
|
9
9
|
constructor(props) {
|
|
@@ -59,7 +59,10 @@ export default class ListItemWithCheckBox extends React.Component {
|
|
|
59
59
|
a11y,
|
|
60
60
|
customClass,
|
|
61
61
|
customProps,
|
|
62
|
-
needMultiLineText
|
|
62
|
+
needMultiLineText,
|
|
63
|
+
secondaryValue,
|
|
64
|
+
lhsAlignContent,
|
|
65
|
+
lhsJustifyContent
|
|
63
66
|
} = this.props;
|
|
64
67
|
const listA11y = {
|
|
65
68
|
role: 'option',
|
|
@@ -93,8 +96,11 @@ export default class ListItemWithCheckBox extends React.Component {
|
|
|
93
96
|
customProps: ListItemProps,
|
|
94
97
|
...ContainerProps
|
|
95
98
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
96
|
-
className: style.iconBox
|
|
99
|
+
className: `${style.iconBox} ${style.lhsBox} ${style[`lhsJustifyContent_${lhsJustifyContent}`]}`,
|
|
97
100
|
dataId: `${dataId ? dataId : value}_checkBox`
|
|
101
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
102
|
+
align: lhsAlignContent,
|
|
103
|
+
className: lhsAlignContent !== 'center' ? style[`lhsBox_${size}`] : ''
|
|
98
104
|
}, /*#__PURE__*/React.createElement(CheckBox, {
|
|
99
105
|
checked: checked,
|
|
100
106
|
a11y: {
|
|
@@ -104,12 +110,18 @@ export default class ListItemWithCheckBox extends React.Component {
|
|
|
104
110
|
customCheckBox: customCheckBox,
|
|
105
111
|
customLabel: customLabel
|
|
106
112
|
}
|
|
107
|
-
})), /*#__PURE__*/React.createElement(Box, {
|
|
113
|
+
}))), /*#__PURE__*/React.createElement(Box, {
|
|
108
114
|
flexible: true,
|
|
109
|
-
shrink: true
|
|
115
|
+
shrink: true
|
|
116
|
+
}, /*#__PURE__*/React.createElement(Container, {
|
|
117
|
+
alignBox: "column"
|
|
118
|
+
}, value ? /*#__PURE__*/React.createElement(Box, {
|
|
110
119
|
"data-title": isDisabled ? null : title,
|
|
111
120
|
className: needMultiLineText ? style.multiLineValue : style.value
|
|
112
|
-
}, value)
|
|
121
|
+
}, value) : null, secondaryValue ? /*#__PURE__*/React.createElement(Box, {
|
|
122
|
+
"data-title": isDisabled ? null : secondaryValue,
|
|
123
|
+
className: `${style.secondaryField} ${needMultiLineText ? style.multiLine : ''}`
|
|
124
|
+
}, secondaryValue) : null)));
|
|
113
125
|
}
|
|
114
126
|
|
|
115
127
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**** Libraries ****/
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { Box } from "../Layout";
|
|
3
|
+
import { Box, Container } from "../Layout";
|
|
4
4
|
import { Icon } from '@zohodesk/icons';
|
|
5
5
|
import ListContainer from "./ListContainer";
|
|
6
6
|
import { ListItemWithIconDefaultProps } from "./props/defaultProps";
|
|
@@ -70,7 +70,10 @@ export default class ListItemWithIcon extends React.Component {
|
|
|
70
70
|
a11y,
|
|
71
71
|
customClass,
|
|
72
72
|
customProps,
|
|
73
|
-
needMultiLineText
|
|
73
|
+
needMultiLineText,
|
|
74
|
+
secondaryValue,
|
|
75
|
+
lhsAlignContent,
|
|
76
|
+
lhsJustifyContent
|
|
74
77
|
} = this.props;
|
|
75
78
|
let {
|
|
76
79
|
ListItemProps = {},
|
|
@@ -110,21 +113,31 @@ export default class ListItemWithIcon extends React.Component {
|
|
|
110
113
|
...ContainerProps
|
|
111
114
|
}, iconName && /*#__PURE__*/React.createElement(Box, {
|
|
112
115
|
"aria-hidden": true,
|
|
113
|
-
|
|
116
|
+
align: lhsAlignContent,
|
|
117
|
+
className: `${style.iconBox} ${style.lhsBox} ${style[`lhsJustifyContent_${lhsJustifyContent}`]}`,
|
|
114
118
|
dataId: dataId ? `${dataId}_Icon` : `${value.toLowerCase().replace("'", '_')}_Icon`
|
|
119
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
120
|
+
align: lhsAlignContent,
|
|
121
|
+
className: lhsAlignContent !== 'center' ? style[`lhsBox_${size}`] : ''
|
|
115
122
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
116
123
|
iconClass: iconClass,
|
|
117
124
|
name: iconName,
|
|
118
125
|
size: iconSize
|
|
119
|
-
})), iconClass && !iconName ? /*#__PURE__*/React.createElement("span", {
|
|
126
|
+
}))), iconClass && !iconName ? /*#__PURE__*/React.createElement("span", {
|
|
120
127
|
className: iconClass
|
|
121
|
-
}) : null,
|
|
128
|
+
}) : null, /*#__PURE__*/React.createElement(Box, {
|
|
122
129
|
flexible: true,
|
|
123
|
-
shrink: true
|
|
130
|
+
shrink: true
|
|
131
|
+
}, /*#__PURE__*/React.createElement(Container, {
|
|
132
|
+
alignBox: "column"
|
|
133
|
+
}, value ? /*#__PURE__*/React.createElement(Box, {
|
|
124
134
|
className: needMultiLineText ? style.multiLineValue : style.value,
|
|
125
135
|
"data-title": isDisabled ? null : title,
|
|
126
136
|
dataId: `${dataIdString}_Text`
|
|
127
|
-
}, value)
|
|
137
|
+
}, value) : null, secondaryValue ? /*#__PURE__*/React.createElement(Box, {
|
|
138
|
+
"data-title": isDisabled ? null : secondaryValue,
|
|
139
|
+
className: `${style.secondaryField} ${needMultiLineText ? style.multiLine : ''}`
|
|
140
|
+
}, secondaryValue) : null)), needTick && active ? /*#__PURE__*/React.createElement(Box, {
|
|
128
141
|
className: style.tickIcon,
|
|
129
142
|
"aria-hidden": ariaHidden,
|
|
130
143
|
dataId: `${dataIdString}_tickIcon`,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import Radio from "../Radio/Radio";
|
|
3
|
-
import { Box } from "../Layout";
|
|
3
|
+
import { Box, Container } from "../Layout";
|
|
4
4
|
import ListContainer from "./ListContainer";
|
|
5
5
|
import { ListItemWithRadioDefaultProps } from "./props/defaultProps";
|
|
6
6
|
import { ListItemWithRadio_Props } from "./props/propTypes";
|
|
@@ -60,7 +60,10 @@ export default class ListItemWithRadio extends React.Component {
|
|
|
60
60
|
a11y,
|
|
61
61
|
customClass,
|
|
62
62
|
customProps,
|
|
63
|
-
needMultiLineText
|
|
63
|
+
needMultiLineText,
|
|
64
|
+
secondaryValue,
|
|
65
|
+
lhsAlignContent,
|
|
66
|
+
lhsJustifyContent
|
|
64
67
|
} = this.props;
|
|
65
68
|
let {
|
|
66
69
|
ListItemProps = {},
|
|
@@ -94,8 +97,12 @@ export default class ListItemWithRadio extends React.Component {
|
|
|
94
97
|
customProps: ListItemProps,
|
|
95
98
|
...ContainerProps
|
|
96
99
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
97
|
-
|
|
100
|
+
align: lhsAlignContent,
|
|
101
|
+
className: `${style.iconBox} ${style.lhsBox} ${style[`lhsJustifyContent_${lhsJustifyContent}`]}`,
|
|
98
102
|
dataId: `${dataId}_radio`
|
|
103
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
104
|
+
align: lhsAlignContent,
|
|
105
|
+
className: lhsAlignContent !== 'center' ? style[`lhsBox_${size}`] : ''
|
|
99
106
|
}, /*#__PURE__*/React.createElement(Radio, {
|
|
100
107
|
checked: checked,
|
|
101
108
|
id: id,
|
|
@@ -106,12 +113,18 @@ export default class ListItemWithRadio extends React.Component {
|
|
|
106
113
|
customRadio: customRadio,
|
|
107
114
|
customRadioWrap: customRadioWrap
|
|
108
115
|
}
|
|
109
|
-
})), /*#__PURE__*/React.createElement(Box, {
|
|
116
|
+
}))), /*#__PURE__*/React.createElement(Box, {
|
|
110
117
|
flexible: true,
|
|
111
|
-
shrink: true
|
|
118
|
+
shrink: true
|
|
119
|
+
}, /*#__PURE__*/React.createElement(Container, {
|
|
120
|
+
alignBox: "column"
|
|
121
|
+
}, value ? /*#__PURE__*/React.createElement(Box, {
|
|
112
122
|
"data-title": disableTitle ? null : title,
|
|
113
123
|
className: needMultiLineText ? style.multiLineValue : style.value
|
|
114
|
-
}, value)
|
|
124
|
+
}, value) : null, secondaryValue ? /*#__PURE__*/React.createElement(Box, {
|
|
125
|
+
"data-title": isDisabled ? null : secondaryValue,
|
|
126
|
+
className: `${style.secondaryField} ${needMultiLineText ? style.multiLine : ''}`
|
|
127
|
+
}, secondaryValue) : null)));
|
|
115
128
|
}
|
|
116
129
|
|
|
117
130
|
}
|
|
@@ -8,4 +8,12 @@ describe('ListContainer', () => {
|
|
|
8
8
|
} = render( /*#__PURE__*/React.createElement(ListContainer, null));
|
|
9
9
|
expect(asFragment()).toMatchSnapshot();
|
|
10
10
|
});
|
|
11
|
+
test('ListContainer with Align Base Line', () => {
|
|
12
|
+
const {
|
|
13
|
+
asFragment
|
|
14
|
+
} = render( /*#__PURE__*/React.createElement(ListContainer, {
|
|
15
|
+
align: 'baseline'
|
|
16
|
+
}));
|
|
17
|
+
expect(asFragment()).toMatchSnapshot();
|
|
18
|
+
});
|
|
11
19
|
});
|
|
@@ -8,4 +8,39 @@ describe('ListItemWithAvatar', () => {
|
|
|
8
8
|
} = render( /*#__PURE__*/React.createElement(ListItemWithAvatar, null));
|
|
9
9
|
expect(asFragment()).toMatchSnapshot();
|
|
10
10
|
});
|
|
11
|
+
test('ListItemWithAvatar with secondaryValue', () => {
|
|
12
|
+
const {
|
|
13
|
+
asFragment
|
|
14
|
+
} = render( /*#__PURE__*/React.createElement(ListItemWithAvatar, {
|
|
15
|
+
secondaryValue: "secondaryValue"
|
|
16
|
+
}));
|
|
17
|
+
expect(asFragment()).toMatchSnapshot();
|
|
18
|
+
});
|
|
19
|
+
test('ListItemWithAvatar with secondaryValue text and LHS align start', () => {
|
|
20
|
+
const {
|
|
21
|
+
asFragment
|
|
22
|
+
} = render( /*#__PURE__*/React.createElement(ListItemWithAvatar, {
|
|
23
|
+
secondaryValue: "secondaryValue",
|
|
24
|
+
lhsAlignContent: "start"
|
|
25
|
+
}));
|
|
26
|
+
expect(asFragment()).toMatchSnapshot();
|
|
27
|
+
});
|
|
28
|
+
test('ListItemWithAvatar with secondaryValue text and LHS align center', () => {
|
|
29
|
+
const {
|
|
30
|
+
asFragment
|
|
31
|
+
} = render( /*#__PURE__*/React.createElement(ListItemWithAvatar, {
|
|
32
|
+
secondaryValue: "secondaryValue",
|
|
33
|
+
lhsAlignContent: "center"
|
|
34
|
+
}));
|
|
35
|
+
expect(asFragment()).toMatchSnapshot();
|
|
36
|
+
});
|
|
37
|
+
test('ListItemWithAvatar with secondaryValue text and LHS align end', () => {
|
|
38
|
+
const {
|
|
39
|
+
asFragment
|
|
40
|
+
} = render( /*#__PURE__*/React.createElement(ListItemWithAvatar, {
|
|
41
|
+
secondaryValue: "secondaryValue",
|
|
42
|
+
lhsAlignContent: "end"
|
|
43
|
+
}));
|
|
44
|
+
expect(asFragment()).toMatchSnapshot();
|
|
45
|
+
});
|
|
11
46
|
});
|
|
@@ -8,4 +8,39 @@ describe('ListItemWithCheckBox', () => {
|
|
|
8
8
|
} = render( /*#__PURE__*/React.createElement(ListItemWithCheckBox, null));
|
|
9
9
|
expect(asFragment()).toMatchSnapshot();
|
|
10
10
|
});
|
|
11
|
+
test('ListItemWithCheckBox with secondaryValue', () => {
|
|
12
|
+
const {
|
|
13
|
+
asFragment
|
|
14
|
+
} = render( /*#__PURE__*/React.createElement(ListItemWithCheckBox, {
|
|
15
|
+
secondaryValue: "secondaryValue"
|
|
16
|
+
}));
|
|
17
|
+
expect(asFragment()).toMatchSnapshot();
|
|
18
|
+
});
|
|
19
|
+
test('ListItemWithCheckBox with secondaryValue text and LHS align start', () => {
|
|
20
|
+
const {
|
|
21
|
+
asFragment
|
|
22
|
+
} = render( /*#__PURE__*/React.createElement(ListItemWithCheckBox, {
|
|
23
|
+
secondaryValue: "secondaryValue",
|
|
24
|
+
lhsAlignContent: "start"
|
|
25
|
+
}));
|
|
26
|
+
expect(asFragment()).toMatchSnapshot();
|
|
27
|
+
});
|
|
28
|
+
test('ListItemWithCheckBox with secondaryValue text and LHS align center', () => {
|
|
29
|
+
const {
|
|
30
|
+
asFragment
|
|
31
|
+
} = render( /*#__PURE__*/React.createElement(ListItemWithCheckBox, {
|
|
32
|
+
secondaryValue: "secondaryValue",
|
|
33
|
+
lhsAlignContent: "center"
|
|
34
|
+
}));
|
|
35
|
+
expect(asFragment()).toMatchSnapshot();
|
|
36
|
+
});
|
|
37
|
+
test('ListItemWithCheckBox with secondaryValue text and LHS align end', () => {
|
|
38
|
+
const {
|
|
39
|
+
asFragment
|
|
40
|
+
} = render( /*#__PURE__*/React.createElement(ListItemWithCheckBox, {
|
|
41
|
+
secondaryValue: "secondaryValue",
|
|
42
|
+
lhsAlignContent: "end"
|
|
43
|
+
}));
|
|
44
|
+
expect(asFragment()).toMatchSnapshot();
|
|
45
|
+
});
|
|
11
46
|
});
|
|
@@ -8,4 +8,39 @@ describe('ListItemWithIcon', () => {
|
|
|
8
8
|
} = render( /*#__PURE__*/React.createElement(ListItemWithIcon, null));
|
|
9
9
|
expect(asFragment()).toMatchSnapshot();
|
|
10
10
|
});
|
|
11
|
+
test('ListItemWithIcon with secondaryValue', () => {
|
|
12
|
+
const {
|
|
13
|
+
asFragment
|
|
14
|
+
} = render( /*#__PURE__*/React.createElement(ListItemWithIcon, {
|
|
15
|
+
secondaryValue: "secondaryValue"
|
|
16
|
+
}));
|
|
17
|
+
expect(asFragment()).toMatchSnapshot();
|
|
18
|
+
});
|
|
19
|
+
test('ListItemWithIcon with secondaryValue text and LHS align start', () => {
|
|
20
|
+
const {
|
|
21
|
+
asFragment
|
|
22
|
+
} = render( /*#__PURE__*/React.createElement(ListItemWithIcon, {
|
|
23
|
+
secondaryValue: "secondaryValue",
|
|
24
|
+
lhsAlignContent: "start"
|
|
25
|
+
}));
|
|
26
|
+
expect(asFragment()).toMatchSnapshot();
|
|
27
|
+
});
|
|
28
|
+
test('ListItemWithIcon with secondaryValue text and LHS align center', () => {
|
|
29
|
+
const {
|
|
30
|
+
asFragment
|
|
31
|
+
} = render( /*#__PURE__*/React.createElement(ListItemWithIcon, {
|
|
32
|
+
secondaryValue: "secondaryValue",
|
|
33
|
+
lhsAlignContent: "center"
|
|
34
|
+
}));
|
|
35
|
+
expect(asFragment()).toMatchSnapshot();
|
|
36
|
+
});
|
|
37
|
+
test('ListItemWithIcon with secondaryValue text and LHS align end', () => {
|
|
38
|
+
const {
|
|
39
|
+
asFragment
|
|
40
|
+
} = render( /*#__PURE__*/React.createElement(ListItemWithIcon, {
|
|
41
|
+
secondaryValue: "secondaryValue",
|
|
42
|
+
lhsAlignContent: "end"
|
|
43
|
+
}));
|
|
44
|
+
expect(asFragment()).toMatchSnapshot();
|
|
45
|
+
});
|
|
11
46
|
});
|
|
@@ -8,4 +8,39 @@ describe('ListItemWithRadio', () => {
|
|
|
8
8
|
} = render( /*#__PURE__*/React.createElement(ListItemWithRadio, null));
|
|
9
9
|
expect(asFragment()).toMatchSnapshot();
|
|
10
10
|
});
|
|
11
|
+
test('ListItemWithRadio with secondaryValue', () => {
|
|
12
|
+
const {
|
|
13
|
+
asFragment
|
|
14
|
+
} = render( /*#__PURE__*/React.createElement(ListItemWithRadio, {
|
|
15
|
+
secondaryValue: "secondaryValue"
|
|
16
|
+
}));
|
|
17
|
+
expect(asFragment()).toMatchSnapshot();
|
|
18
|
+
});
|
|
19
|
+
test('ListItemWithRadio with secondaryValue text and LHS align start', () => {
|
|
20
|
+
const {
|
|
21
|
+
asFragment
|
|
22
|
+
} = render( /*#__PURE__*/React.createElement(ListItemWithRadio, {
|
|
23
|
+
secondaryValue: "secondaryValue",
|
|
24
|
+
lhsAlignContent: "start"
|
|
25
|
+
}));
|
|
26
|
+
expect(asFragment()).toMatchSnapshot();
|
|
27
|
+
});
|
|
28
|
+
test('ListItemWithRadio with secondaryValue text and LHS align center', () => {
|
|
29
|
+
const {
|
|
30
|
+
asFragment
|
|
31
|
+
} = render( /*#__PURE__*/React.createElement(ListItemWithRadio, {
|
|
32
|
+
secondaryValue: "secondaryValue",
|
|
33
|
+
lhsAlignContent: "center"
|
|
34
|
+
}));
|
|
35
|
+
expect(asFragment()).toMatchSnapshot();
|
|
36
|
+
});
|
|
37
|
+
test('ListItemWithRadio with secondaryValue text and LHS align end', () => {
|
|
38
|
+
const {
|
|
39
|
+
asFragment
|
|
40
|
+
} = render( /*#__PURE__*/React.createElement(ListItemWithRadio, {
|
|
41
|
+
secondaryValue: "secondaryValue",
|
|
42
|
+
lhsAlignContent: "end"
|
|
43
|
+
}));
|
|
44
|
+
expect(asFragment()).toMatchSnapshot();
|
|
45
|
+
});
|
|
11
46
|
});
|
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
+
exports[`ListContainer ListContainer with Align Base Line 1`] = `
|
|
4
|
+
<DocumentFragment>
|
|
5
|
+
<li
|
|
6
|
+
class="list medium default withBorder flex rowdir baseline"
|
|
7
|
+
data-a11y-inset-focus="true"
|
|
8
|
+
data-id="containerComponent"
|
|
9
|
+
data-selector-id="listContainer"
|
|
10
|
+
data-test-id="containerComponent"
|
|
11
|
+
tabindex="0"
|
|
12
|
+
/>
|
|
13
|
+
</DocumentFragment>
|
|
14
|
+
`;
|
|
15
|
+
|
|
3
16
|
exports[`ListContainer rendering the defult props 1`] = `
|
|
4
17
|
<DocumentFragment>
|
|
5
18
|
<li
|