@zohodesk/components 1.0.0-temp-49 → 1.0.0-temp-50
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/README.md +4 -0
- package/es/Avatar/Avatar.js +1 -1
- package/es/Button/Button.js +5 -10
- package/es/ListItem/ListItem.js +58 -37
- package/es/ListItem/ListItem.module.css +11 -0
- package/es/ListItem/ListItemWithAvatar.js +74 -53
- package/es/ListItem/ListItemWithCheckBox.js +54 -33
- package/es/ListItem/ListItemWithIcon.js +66 -45
- package/es/ListItem/ListItemWithRadio.js +55 -34
- package/es/MultiSelect/AdvancedGroupMultiSelect.js +1 -1
- package/es/MultiSelect/AdvancedMultiSelect.js +1 -1
- package/es/MultiSelect/MultiSelect.js +1 -1
- package/es/MultiSelect/MultiSelectWithAvatar.js +1 -1
- package/es/Responsive/sizeObservers.js +8 -1
- package/es/Select/GroupSelect.js +1 -1
- package/es/Select/Select.js +1 -1
- package/es/Select/SelectWithAvatar.js +1 -1
- package/es/Select/SelectWithIcon.js +1 -1
- package/es/TextBoxIcon/TextBoxIcon.js +1 -1
- package/lib/Avatar/Avatar.js +1 -1
- package/lib/Button/Button.js +5 -10
- package/lib/ListItem/ListItem.js +58 -37
- package/lib/ListItem/ListItem.module.css +11 -0
- package/lib/ListItem/ListItemWithAvatar.js +74 -53
- package/lib/ListItem/ListItemWithCheckBox.js +54 -33
- package/lib/ListItem/ListItemWithIcon.js +66 -45
- package/lib/ListItem/ListItemWithRadio.js +55 -34
- package/lib/MultiSelect/AdvancedGroupMultiSelect.js +1 -1
- package/lib/MultiSelect/AdvancedMultiSelect.js +1 -1
- package/lib/MultiSelect/MultiSelect.js +1 -1
- package/lib/MultiSelect/MultiSelectWithAvatar.js +1 -1
- package/lib/Responsive/sizeObservers.js +8 -1
- package/lib/Select/GroupSelect.js +1 -1
- package/lib/Select/Select.js +1 -1
- package/lib/Select/SelectWithAvatar.js +1 -1
- package/lib/Select/SelectWithIcon.js +1 -1
- package/lib/TextBoxIcon/TextBoxIcon.js +1 -1
- package/package.json +1 -1
|
@@ -6,12 +6,14 @@ import Radio from '../Radio/Radio';
|
|
|
6
6
|
import { Box } from '../Layout';
|
|
7
7
|
import ListContainer from './ListContainer';
|
|
8
8
|
import style from './ListItem.module.css';
|
|
9
|
+
import { ResponsiveReceiver } from '../Responsive/CustomResponsive';
|
|
9
10
|
export default class ListItemWithRadio extends React.Component {
|
|
10
11
|
constructor(props) {
|
|
11
12
|
super(props);
|
|
12
13
|
this.onClick = this.onClick.bind(this);
|
|
13
14
|
this.getRef = this.getRef.bind(this);
|
|
14
15
|
this.onHover = this.onHover.bind(this);
|
|
16
|
+
this.responsiveFunc = this.responsiveFunc.bind(this);
|
|
15
17
|
}
|
|
16
18
|
|
|
17
19
|
getRef(ele) {
|
|
@@ -43,6 +45,17 @@ export default class ListItemWithRadio extends React.Component {
|
|
|
43
45
|
onHover && onHover(id, value, index, e);
|
|
44
46
|
}
|
|
45
47
|
|
|
48
|
+
responsiveFunc(_ref) {
|
|
49
|
+
let {
|
|
50
|
+
mediaQueryOR
|
|
51
|
+
} = _ref;
|
|
52
|
+
return {
|
|
53
|
+
mobileToTab: mediaQueryOR([{
|
|
54
|
+
maxWidth: 700
|
|
55
|
+
}])
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
|
|
46
59
|
render() {
|
|
47
60
|
let {
|
|
48
61
|
size,
|
|
@@ -70,40 +83,48 @@ export default class ListItemWithRadio extends React.Component {
|
|
|
70
83
|
customRadio = '',
|
|
71
84
|
customRadioWrap = ''
|
|
72
85
|
} = customClass;
|
|
73
|
-
return /*#__PURE__*/React.createElement(
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
},
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
86
|
+
return /*#__PURE__*/React.createElement(ResponsiveReceiver, {
|
|
87
|
+
query: this.responsiveFunc,
|
|
88
|
+
responsiveId: "Helmet"
|
|
89
|
+
}, _ref2 => {
|
|
90
|
+
let {
|
|
91
|
+
mobileToTab
|
|
92
|
+
} = _ref2;
|
|
93
|
+
return /*#__PURE__*/React.createElement(ListContainer, _extends({
|
|
94
|
+
a11y: a11y,
|
|
95
|
+
size: size,
|
|
96
|
+
palette: palette,
|
|
97
|
+
highlight: highlight,
|
|
98
|
+
isDisabled: isDisabled,
|
|
99
|
+
active: active,
|
|
100
|
+
autoHover: autoHover,
|
|
101
|
+
customClass: `${customListItem} ${mobileToTab && style.responsiveHeight}`,
|
|
102
|
+
dataId: dataId,
|
|
103
|
+
onClick: this.onClick,
|
|
104
|
+
onMouseOver: this.onHover,
|
|
105
|
+
eleRef: this.getRef,
|
|
106
|
+
disableTitle: disableTitle,
|
|
107
|
+
title: null,
|
|
108
|
+
customProps: ListItemProps
|
|
109
|
+
}, ContainerProps), /*#__PURE__*/React.createElement(Box, {
|
|
110
|
+
className: style.iconBox
|
|
111
|
+
}, /*#__PURE__*/React.createElement(Radio, {
|
|
112
|
+
checked: checked,
|
|
113
|
+
id: id,
|
|
114
|
+
a11y: {
|
|
115
|
+
ariaHidden: true
|
|
116
|
+
},
|
|
117
|
+
customClass: {
|
|
118
|
+
customRadio: customRadio,
|
|
119
|
+
customRadioWrap: customRadioWrap
|
|
120
|
+
}
|
|
121
|
+
})), /*#__PURE__*/React.createElement(Box, {
|
|
122
|
+
flexible: true,
|
|
123
|
+
shrink: true,
|
|
124
|
+
"data-title": disableTitle ? null : title,
|
|
125
|
+
className: style.value
|
|
126
|
+
}, value));
|
|
127
|
+
});
|
|
107
128
|
}
|
|
108
129
|
|
|
109
130
|
}
|
|
@@ -887,7 +887,7 @@ class AdvancedGroupMultiSelect extends React.Component {
|
|
|
887
887
|
return /*#__PURE__*/React.createElement("div", {
|
|
888
888
|
className: `${style.wrapper} ${isDisabled ? style.disabled : ''} ${needEffect && !(isDisabled || isReadOnly) ? style.effect : ''}`,
|
|
889
889
|
"data-id": `${isDisabled ? `${dataId}_disabled` : isReadOnly ? `${dataId}_readOnly` : dataId}`,
|
|
890
|
-
"data-title": isDisabled ? title :
|
|
890
|
+
"data-title": isDisabled ? title : null,
|
|
891
891
|
onClick: this.handleInputFocus
|
|
892
892
|
}, children ? /*#__PURE__*/React.createElement(Container, {
|
|
893
893
|
align: "vertical",
|
|
@@ -396,7 +396,7 @@ export class AdvancedMultiSelectComponent extends MultiSelectComponent {
|
|
|
396
396
|
return /*#__PURE__*/React.createElement("div", {
|
|
397
397
|
className: `${style.wrapper} ${isDisabled ? style.disabled : ''} ${borderColor === 'transparent' ? style.transparentContainer : ''} ${needEffect && !(isDisabled || isReadOnly) ? style.effect : ''}`,
|
|
398
398
|
"data-id": dataIdMultiSelectComp,
|
|
399
|
-
"data-title": isDisabled ? title :
|
|
399
|
+
"data-title": isDisabled ? title : null,
|
|
400
400
|
onClick: this.handleInputFocus
|
|
401
401
|
}, /*#__PURE__*/React.createElement(Container, {
|
|
402
402
|
align: "vertical",
|
|
@@ -909,7 +909,7 @@ export class MultiSelectComponent extends React.Component {
|
|
|
909
909
|
return /*#__PURE__*/React.createElement("div", {
|
|
910
910
|
className: `${style.wrapper} ${isDisabled ? style.disabled : ''} ${isReadOnly ? style.readOnly : ''} ${disableAction ? CssProvider('isBlock') : ''} ${borderColor === 'transparent' ? style.transparentContainer : ''} ${needEffect && !(isDisabled || isReadOnly) ? style.effect : ''}`,
|
|
911
911
|
"data-id": `${isDisabled ? `${dataId}_disabled` : isReadOnly ? `${dataId}_readOnly` : dataId}`,
|
|
912
|
-
"data-title": isDisabled ? title :
|
|
912
|
+
"data-title": isDisabled ? title : null,
|
|
913
913
|
onClick: this.handleInputFocus
|
|
914
914
|
}, /*#__PURE__*/React.createElement(Container, {
|
|
915
915
|
align: "vertical",
|
|
@@ -118,7 +118,7 @@ class MultiSelectWithAvatarComponent extends MultiSelectComponent {
|
|
|
118
118
|
return /*#__PURE__*/React.createElement("div", {
|
|
119
119
|
className: ` ${style.wrapper} ${isDisabled ? style.disabled : ''} ${isReadOnly ? style.readOnly : ''} ${disableAction ? CssProvider('isBlock') : ''} ${borderColor === 'transparent' ? style.transparentContainer : ''} ${needEffect && !(isDisabled || isReadOnly) ? style.effect : ''}`,
|
|
120
120
|
"data-id": `${isDisabled ? `${dataId}_disabled` : isReadOnly ? `${dataId}_readOnly` : dataId}`,
|
|
121
|
-
"data-title": isDisabled ? title :
|
|
121
|
+
"data-title": isDisabled ? title : null,
|
|
122
122
|
onClick: this.handleInputFocus
|
|
123
123
|
}, /*#__PURE__*/React.createElement(Container, {
|
|
124
124
|
align: "vertical",
|
|
@@ -25,7 +25,14 @@ function rangeCheck(minValue, maxValue, screenValue) {
|
|
|
25
25
|
return minValue <= screenValue && maxValue >= screenValue;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
function isTouchDeviceFunc() {
|
|
29
|
+
// return window.matchMedia("(pointer: coarse)").matches
|
|
30
|
+
return 'ontouchstart' in window || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0;
|
|
31
|
+
} // export const isTouchDevice =
|
|
32
|
+
// 'ontouchstart' in window && navigator.userAgent.match(/mobi/i) ? true : false;
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
export const isTouchDevice = isTouchDeviceFunc();
|
|
29
36
|
export function isBreackPointMatched(object, screen) {
|
|
30
37
|
if (!isValideBreakPoint(object)) {
|
|
31
38
|
// eslint-disable-next-line no-console
|
package/es/Select/GroupSelect.js
CHANGED
|
@@ -599,7 +599,7 @@ export class GroupSelectComponent extends PureComponent {
|
|
|
599
599
|
return /*#__PURE__*/React.createElement("div", {
|
|
600
600
|
className: `${style.container} ${style[`box_${size}`]} ${isReadOnly ? style.readonly : ''} ${borderColor === 'transparent' ? style.transparentContainer : ''} ${iconOnHover && (isReadOnly || isDisabled) ? style.iconOnHoverReadonly : iconOnHover && !(isReadOnly || isDisabled) ? style.iconOnHoverStyle : ''}`,
|
|
601
601
|
"data-id": dataIdSlctComp,
|
|
602
|
-
"data-title": isDisabled ? title :
|
|
602
|
+
"data-title": isDisabled ? title : null
|
|
603
603
|
}, /*#__PURE__*/React.createElement("div", {
|
|
604
604
|
className: `${className ? className : ''}`,
|
|
605
605
|
onClick: isDisabled || isReadOnly ? null : this.togglePopup,
|
package/es/Select/Select.js
CHANGED
|
@@ -743,7 +743,7 @@ export class SelectComponent extends Component {
|
|
|
743
743
|
} = customProps;
|
|
744
744
|
return /*#__PURE__*/React.createElement("div", {
|
|
745
745
|
className: `${isParentBased || isReadOnly || isDisabled ? style.container : ''} ${style[`box_${size}`]} ${isReadOnly ? style.readonly : ''} ${borderColor === 'transparent' ? style.transparentContainer : ''} ${iconOnHover && (isReadOnly || isDisabled) ? style.iconOnHoverReadonly : iconOnHover && !(isReadOnly || isDisabled) ? style.iconOnHoverStyle : ''}`,
|
|
746
|
-
"data-title": isDisabled ? title :
|
|
746
|
+
"data-title": isDisabled ? title : null
|
|
747
747
|
}, /*#__PURE__*/React.createElement("div", {
|
|
748
748
|
className: `${className ? className : ''}`,
|
|
749
749
|
onClick: isDisabled || isReadOnly ? null : this.togglePopup,
|
|
@@ -167,7 +167,7 @@ class SelectWithAvatarComponent extends SelectComponent {
|
|
|
167
167
|
return /*#__PURE__*/React.createElement("div", {
|
|
168
168
|
className: `${style.wrapper} ${isDisabled ? style.disabled : ''} ${isReadOnly ? style.readOnly : ''} ${needEffect && !(isDisabled || isReadOnly) ? style.effect : ''} ${className ? className : ''}`,
|
|
169
169
|
"data-id": `${isDisabled ? `${dataId}_disabled` : isReadOnly ? `${dataId}_readOnly` : dataId}`,
|
|
170
|
-
"data-title": isDisabled ? title :
|
|
170
|
+
"data-title": isDisabled ? title : null
|
|
171
171
|
}, /*#__PURE__*/React.createElement(Container, {
|
|
172
172
|
align: "vertical",
|
|
173
173
|
alignBox: "row",
|
|
@@ -289,7 +289,7 @@ class SelectWithIcon extends Component {
|
|
|
289
289
|
let ariaErrorId = this.getNextAriaId();
|
|
290
290
|
return /*#__PURE__*/React.createElement("div", {
|
|
291
291
|
className: `${style.container} ${style[`box_${size}`]} ${isReadOnly ? style.readonly : ''} ${borderColor === 'transparent' ? style.transparentContainer : ''}`,
|
|
292
|
-
"data-title": isDisabled ? title :
|
|
292
|
+
"data-title": isDisabled ? title : null
|
|
293
293
|
}, /*#__PURE__*/React.createElement("div", {
|
|
294
294
|
className: `${className ? className : ''}`,
|
|
295
295
|
onClick: isDisabled || isReadOnly ? null : this.togglePopup,
|
|
@@ -101,7 +101,7 @@ export default class TextBoxIcon extends React.Component {
|
|
|
101
101
|
alignBox: "row",
|
|
102
102
|
isCover: false,
|
|
103
103
|
className: `${style.container} ${isDisabled ? style.disabled : isReadOnly ? needEffect ? style.effect : style.readonly : style.effect} ${isActive || isFocus ? style.effectFocused : ''} ${customTBoxWrap} ${iconOnHover && (isReadOnly || isDisabled) ? style.iconOnHoverReadonly : iconOnHover && !(isReadOnly || isDisabled) ? style.iconOnHoverStyle : ''}`,
|
|
104
|
-
"data-title": isDisabled ? title :
|
|
104
|
+
"data-title": isDisabled ? title : null
|
|
105
105
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
106
106
|
flexible: true
|
|
107
107
|
}, /*#__PURE__*/React.createElement(TextBox, _extends({}, this.props, {
|
package/lib/Avatar/Avatar.js
CHANGED
|
@@ -203,7 +203,7 @@ var Avatar = /*#__PURE__*/function (_React$Component) {
|
|
|
203
203
|
borderStyle = showAlternateAvatar ? '' : borderStyle;
|
|
204
204
|
return /*#__PURE__*/_react["default"].createElement("div", _extends({
|
|
205
205
|
className: "".concat(_AvatarModule["default"].avatar, " ").concat(_AvatarModule["default"][size], " ").concat((0, _AvatarSize["default"])(size), " ").concat(_AvatarModule["default"][shapeStyle], " ").concat(_AvatarModule["default"][palette], " ").concat(textStyle, " ").concat(borderStyle, " ").concat(customClass ? customClass : ''),
|
|
206
|
-
"data-title": needTitle ? title ? title : name :
|
|
206
|
+
"data-title": needTitle ? title ? title : name : null,
|
|
207
207
|
"data-id": dataId,
|
|
208
208
|
onClick: onClick
|
|
209
209
|
}, AvatarProps), showInitial && !showAlternateAvatar && /*#__PURE__*/_react["default"].createElement("span", {
|
package/lib/Button/Button.js
CHANGED
|
@@ -17,8 +17,6 @@ var _dummyFunction = require("../utils/dummyFunction");
|
|
|
17
17
|
|
|
18
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
19
|
|
|
20
|
-
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); }
|
|
21
|
-
|
|
22
20
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
23
21
|
|
|
24
22
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
@@ -74,8 +72,7 @@ var Button = /*#__PURE__*/function (_React$Component) {
|
|
|
74
72
|
needAppearance = _this$props.needAppearance,
|
|
75
73
|
getRef = _this$props.getRef,
|
|
76
74
|
title = _this$props.title,
|
|
77
|
-
customClass = _this$props.customClass
|
|
78
|
-
customProps = _this$props.customProps;
|
|
75
|
+
customClass = _this$props.customClass;
|
|
79
76
|
var _customClass$customBu = customClass.customButton,
|
|
80
77
|
customButton = _customClass$customBu === void 0 ? '' : _customClass$customBu,
|
|
81
78
|
_customClass$customSt = customClass.customStatus,
|
|
@@ -85,7 +82,7 @@ var Button = /*#__PURE__*/function (_React$Component) {
|
|
|
85
82
|
var paletteLower = palette.toLowerCase();
|
|
86
83
|
var statusLower = status.toLowerCase();
|
|
87
84
|
var classList = needAppearance ? "".concat(_ButtonModule["default"][paletteLower], " ").concat(rounded ? _ButtonModule["default"].rounded : '', " ").concat(!children ? _ButtonModule["default"][size.toLowerCase()] : "".concat(_ButtonModule["default"]["".concat(size, "Btn")], " \n ").concat(rounded ? _ButtonModule["default"]["".concat(size, "Btn").concat(paletteLower)] : ''), " ").concat(statusLower !== 'none' ? _ButtonModule["default"].loader : '') : "".concat(_ButtonModule["default"]["default"]);
|
|
88
|
-
return /*#__PURE__*/_react["default"].createElement("button",
|
|
85
|
+
return /*#__PURE__*/_react["default"].createElement("button", {
|
|
89
86
|
className: "".concat(customButton, " ").concat(classList, " ").concat(isBold ? _ButtonModule["default"].bold : '', " "),
|
|
90
87
|
"data-id": disabled ? "".concat(dataId, "_disabled") : dataId,
|
|
91
88
|
disabled: disabled || statusLower === 'loading',
|
|
@@ -93,7 +90,7 @@ var Button = /*#__PURE__*/function (_React$Component) {
|
|
|
93
90
|
"data-title": title,
|
|
94
91
|
type: "button",
|
|
95
92
|
ref: getRef
|
|
96
|
-
},
|
|
93
|
+
}, children ? children : text, statusLower !== 'none' && needAppearance && /*#__PURE__*/_react["default"].createElement("div", {
|
|
97
94
|
className: _ButtonModule["default"].overlay
|
|
98
95
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
99
96
|
className: "".concat(customStatusSize, " ").concat(statusLower === 'loading' ? "".concat(_ButtonModule["default"].loading, " ").concat(_ButtonModule["default"]["".concat(size, "loading")] ? _ButtonModule["default"]["".concat(size, "loading")] : '') : _ButtonModule["default"].success)
|
|
@@ -119,8 +116,7 @@ Button.defaultProps = {
|
|
|
119
116
|
size: 'medium',
|
|
120
117
|
status: 'none',
|
|
121
118
|
text: 'Button',
|
|
122
|
-
customClass: {}
|
|
123
|
-
customProps: {}
|
|
119
|
+
customClass: {}
|
|
124
120
|
};
|
|
125
121
|
Button.propTypes = {
|
|
126
122
|
children: _propTypes["default"].node,
|
|
@@ -141,8 +137,7 @@ Button.propTypes = {
|
|
|
141
137
|
customButton: _propTypes["default"].string,
|
|
142
138
|
customStatus: _propTypes["default"].string,
|
|
143
139
|
customStatusSize: _propTypes["default"].string
|
|
144
|
-
})
|
|
145
|
-
customProps: _propTypes["default"].object
|
|
140
|
+
})
|
|
146
141
|
}; // Button.propTypesDescription = {
|
|
147
142
|
// onClick: ' ',
|
|
148
143
|
// text: ' ',
|
package/lib/ListItem/ListItem.js
CHANGED
|
@@ -17,6 +17,8 @@ var _ListContainer = _interopRequireDefault(require("./ListContainer"));
|
|
|
17
17
|
|
|
18
18
|
var _Icon = _interopRequireDefault(require("@zohodesk/icons/lib/Icon"));
|
|
19
19
|
|
|
20
|
+
var _CustomResponsive = require("../Responsive/CustomResponsive");
|
|
21
|
+
|
|
20
22
|
var _ListItemModule = _interopRequireDefault(require("./ListItem.module.css"));
|
|
21
23
|
|
|
22
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -57,6 +59,7 @@ var ListItem = /*#__PURE__*/function (_React$Component) {
|
|
|
57
59
|
_this.handleClick = _this.handleClick.bind(_assertThisInitialized(_this));
|
|
58
60
|
_this.getRef = _this.getRef.bind(_assertThisInitialized(_this));
|
|
59
61
|
_this.handleMouseEnter = _this.handleMouseEnter.bind(_assertThisInitialized(_this));
|
|
62
|
+
_this.responsiveFunc = _this.responsiveFunc.bind(_assertThisInitialized(_this));
|
|
60
63
|
return _this;
|
|
61
64
|
}
|
|
62
65
|
|
|
@@ -90,9 +93,21 @@ var ListItem = /*#__PURE__*/function (_React$Component) {
|
|
|
90
93
|
index = _this$props3.index;
|
|
91
94
|
onMouseEnter && onMouseEnter(id, value, index, e);
|
|
92
95
|
}
|
|
96
|
+
}, {
|
|
97
|
+
key: "responsiveFunc",
|
|
98
|
+
value: function responsiveFunc(_ref) {
|
|
99
|
+
var mediaQueryOR = _ref.mediaQueryOR;
|
|
100
|
+
return {
|
|
101
|
+
mobileToTab: mediaQueryOR([{
|
|
102
|
+
maxWidth: 700
|
|
103
|
+
}])
|
|
104
|
+
};
|
|
105
|
+
}
|
|
93
106
|
}, {
|
|
94
107
|
key: "render",
|
|
95
108
|
value: function render() {
|
|
109
|
+
var _this2 = this;
|
|
110
|
+
|
|
96
111
|
var _this$props4 = this.props,
|
|
97
112
|
size = _this$props4.size,
|
|
98
113
|
active = _this$props4.active,
|
|
@@ -125,43 +140,49 @@ var ListItem = /*#__PURE__*/function (_React$Component) {
|
|
|
125
140
|
ariaHidden = _a11y$ariaHidden === void 0 ? true : _a11y$ariaHidden;
|
|
126
141
|
var tickIconPalette = _ListItemModule["default"]["".concat(palette, "Tick")] ? _ListItemModule["default"]["".concat(palette, "Tick")] : '';
|
|
127
142
|
var dataIdString = dataId ? dataId : value ? String(value).replace("'", '_') : 'listItem';
|
|
128
|
-
return /*#__PURE__*/_react["default"].createElement(
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
143
|
+
return /*#__PURE__*/_react["default"].createElement(_CustomResponsive.ResponsiveReceiver, {
|
|
144
|
+
query: this.responsiveFunc,
|
|
145
|
+
responsiveId: "Helmet"
|
|
146
|
+
}, function (_ref2) {
|
|
147
|
+
var mobileToTab = _ref2.mobileToTab;
|
|
148
|
+
return /*#__PURE__*/_react["default"].createElement(_ListContainer["default"], _extends({
|
|
149
|
+
a11y: a11y,
|
|
150
|
+
size: size,
|
|
151
|
+
palette: palette,
|
|
152
|
+
highlight: highlight,
|
|
153
|
+
isDisabled: isDisabled,
|
|
154
|
+
active: active,
|
|
155
|
+
autoHover: autoHover,
|
|
156
|
+
needTick: needTick,
|
|
157
|
+
needBorder: needBorder,
|
|
158
|
+
customClass: "".concat(customListItem, " ").concat(mobileToTab && _ListItemModule["default"].responsiveHeight),
|
|
159
|
+
dataId: dataIdString,
|
|
160
|
+
isLink: isLink,
|
|
161
|
+
href: href,
|
|
162
|
+
target: target,
|
|
163
|
+
disableTitle: disableTitle,
|
|
164
|
+
title: title,
|
|
165
|
+
onClick: _this2.handleClick,
|
|
166
|
+
onMouseEnter: _this2.handleMouseEnter,
|
|
167
|
+
eleRef: _this2.getRef,
|
|
168
|
+
customProps: ListItemProps
|
|
169
|
+
}, ContainerProps), value ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
170
|
+
shrink: true,
|
|
171
|
+
adjust: true,
|
|
172
|
+
className: _ListItemModule["default"].value
|
|
173
|
+
}, value) : null, children ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
174
|
+
shrink: true,
|
|
175
|
+
adjust: true,
|
|
176
|
+
className: _ListItemModule["default"].children
|
|
177
|
+
}, children) : null, needTick && active ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
178
|
+
className: "".concat(_ListItemModule["default"].tickIcon, " ").concat(tickIconPalette, " ").concat(customTickIcon),
|
|
179
|
+
"aria-hidden": ariaHidden,
|
|
180
|
+
dataId: "".concat(dataIdString, "_tickIcon")
|
|
181
|
+
}, /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
|
|
182
|
+
name: "ZD-ticknew",
|
|
183
|
+
size: "8"
|
|
184
|
+
})) : null);
|
|
185
|
+
});
|
|
165
186
|
}
|
|
166
187
|
}]);
|
|
167
188
|
|
|
@@ -70,6 +70,17 @@
|
|
|
70
70
|
[dir=rtl] .large {
|
|
71
71
|
--listitem_padding: var(--zd_size10) var(--zd_size25) var(--zd_size10) var(--zd_size3);
|
|
72
72
|
}
|
|
73
|
+
.responsiveHeight {
|
|
74
|
+
--listitem_height: var(--zd_size45);
|
|
75
|
+
}
|
|
76
|
+
[dir=ltr] .responsiveHeight {
|
|
77
|
+
--listitem_padding: var(--zd_size10) var(--zd_size3) var(--zd_size10)
|
|
78
|
+
var(--zd_size20)
|
|
79
|
+
/*rtl: var(--zd_size10) var(--zd_size25) var(--zd_size10) var(--zd_size3)*/;
|
|
80
|
+
}
|
|
81
|
+
[dir=rtl] .responsiveHeight {
|
|
82
|
+
--listitem_padding: var(--zd_size10) var(--zd_size25) var(--zd_size10) var(--zd_size3);
|
|
83
|
+
}
|
|
73
84
|
|
|
74
85
|
.value,
|
|
75
86
|
.children {
|
|
@@ -21,6 +21,8 @@ var _AvatarTeam = _interopRequireDefault(require("../AvatarTeam/AvatarTeam"));
|
|
|
21
21
|
|
|
22
22
|
var _Icon = _interopRequireDefault(require("@zohodesk/icons/lib/Icon"));
|
|
23
23
|
|
|
24
|
+
var _CustomResponsive = require("../Responsive/CustomResponsive");
|
|
25
|
+
|
|
24
26
|
var _ListItemModule = _interopRequireDefault(require("./ListItem.module.css"));
|
|
25
27
|
|
|
26
28
|
var _ListItemWithAvatar$p;
|
|
@@ -65,6 +67,7 @@ var ListItemWithAvatar = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
65
67
|
_this.handleClick = _this.handleClick.bind(_assertThisInitialized(_this));
|
|
66
68
|
_this.getRef = _this.getRef.bind(_assertThisInitialized(_this));
|
|
67
69
|
_this.handleMouseEnter = _this.handleMouseEnter.bind(_assertThisInitialized(_this));
|
|
70
|
+
_this.responsiveFunc = _this.responsiveFunc.bind(_assertThisInitialized(_this));
|
|
68
71
|
return _this;
|
|
69
72
|
}
|
|
70
73
|
|
|
@@ -98,9 +101,21 @@ var ListItemWithAvatar = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
98
101
|
index = _this$props3.index;
|
|
99
102
|
onMouseEnter && onMouseEnter(id, value, index, e);
|
|
100
103
|
}
|
|
104
|
+
}, {
|
|
105
|
+
key: "responsiveFunc",
|
|
106
|
+
value: function responsiveFunc(_ref) {
|
|
107
|
+
var mediaQueryOR = _ref.mediaQueryOR;
|
|
108
|
+
return {
|
|
109
|
+
mobileToTab: mediaQueryOR([{
|
|
110
|
+
maxWidth: 700
|
|
111
|
+
}])
|
|
112
|
+
};
|
|
113
|
+
}
|
|
101
114
|
}, {
|
|
102
115
|
key: "render",
|
|
103
116
|
value: function render() {
|
|
117
|
+
var _this2 = this;
|
|
118
|
+
|
|
104
119
|
var _this$props4 = this.props,
|
|
105
120
|
size = _this$props4.size,
|
|
106
121
|
active = _this$props4.active,
|
|
@@ -137,59 +152,65 @@ var ListItemWithAvatar = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
137
152
|
ariaHidden = _a11y$ariaHidden === void 0 ? true : _a11y$ariaHidden;
|
|
138
153
|
var isDarkPalette = palette === 'dark';
|
|
139
154
|
var dataIdString = value ? value : dataId;
|
|
140
|
-
return /*#__PURE__*/_react["default"].createElement(
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
155
|
+
return /*#__PURE__*/_react["default"].createElement(_CustomResponsive.ResponsiveReceiver, {
|
|
156
|
+
query: this.responsiveFunc,
|
|
157
|
+
responsiveId: "Helmet"
|
|
158
|
+
}, function (_ref2) {
|
|
159
|
+
var mobileToTab = _ref2.mobileToTab;
|
|
160
|
+
return /*#__PURE__*/_react["default"].createElement(_ListContainer["default"], _extends({
|
|
161
|
+
a11y: a11y,
|
|
162
|
+
size: size,
|
|
163
|
+
palette: palette,
|
|
164
|
+
highlight: highlight,
|
|
165
|
+
isDisabled: isDisabled,
|
|
166
|
+
active: active,
|
|
167
|
+
autoHover: autoHover,
|
|
168
|
+
needTick: needTick,
|
|
169
|
+
needBorder: needBorder,
|
|
170
|
+
customClass: "".concat(customListItem, " ").concat(mobileToTab && _ListItemModule["default"].responsiveHeight),
|
|
171
|
+
dataId: "".concat(dataIdString, "_ListItemWithAvatar"),
|
|
172
|
+
onClick: _this2.handleClick,
|
|
173
|
+
onMouseEnter: _this2.handleMouseEnter,
|
|
174
|
+
eleRef: _this2.getRef,
|
|
175
|
+
disableTitle: disableTitle,
|
|
176
|
+
title: null,
|
|
177
|
+
customProps: ListItemProps
|
|
178
|
+
}, ContainerProps), name || imgSrc ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
179
|
+
className: _ListItemModule["default"].leftAvatar
|
|
180
|
+
}, isTeam ? /*#__PURE__*/_react["default"].createElement(_AvatarTeam["default"], {
|
|
181
|
+
name: name,
|
|
182
|
+
size: "small",
|
|
183
|
+
src: imgSrc,
|
|
184
|
+
needTitle: needAvatarTitle,
|
|
185
|
+
textPalette: isDarkPalette ? 'white' : '',
|
|
186
|
+
palette: isDarkPalette ? 'info' : avatarPalette,
|
|
187
|
+
customClass: {
|
|
188
|
+
customAvatar: customAvatar,
|
|
189
|
+
customAvatarTeam: customAvatarTeam
|
|
190
|
+
}
|
|
191
|
+
}) : /*#__PURE__*/_react["default"].createElement(_Avatar["default"], {
|
|
192
|
+
name: name,
|
|
193
|
+
size: "small",
|
|
194
|
+
src: imgSrc,
|
|
195
|
+
initial: initial,
|
|
196
|
+
textPalette: isDarkPalette ? 'white' : '',
|
|
197
|
+
needTitle: needAvatarTitle,
|
|
198
|
+
palette: isDarkPalette ? 'info' : avatarPalette,
|
|
199
|
+
customClass: customAvatar
|
|
200
|
+
})) : null, value ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
201
|
+
flexible: true,
|
|
202
|
+
shrink: true,
|
|
203
|
+
"data-title": isDisabled ? null : title,
|
|
204
|
+
className: _ListItemModule["default"].value
|
|
205
|
+
}, value) : null, needTick && active ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
206
|
+
className: _ListItemModule["default"].tickIcon,
|
|
207
|
+
"aria-hidden": ariaHidden,
|
|
208
|
+
dataId: "".concat(dataIdString, "_tickIcon")
|
|
209
|
+
}, /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
|
|
210
|
+
name: "ZD-ticknew",
|
|
211
|
+
size: "8"
|
|
212
|
+
})) : null);
|
|
213
|
+
});
|
|
193
214
|
}
|
|
194
215
|
}]);
|
|
195
216
|
|