@zohodesk/components 1.0.0-temp-50 → 1.0.0-temp-51
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/es/ListItem/ListItem.js +37 -58
- package/es/ListItem/ListItem.module.css +0 -12
- package/es/ListItem/ListItemWithAvatar.js +53 -74
- package/es/ListItem/ListItemWithCheckBox.js +33 -54
- package/es/ListItem/ListItemWithIcon.js +45 -66
- package/es/ListItem/ListItemWithRadio.js +34 -55
- package/lib/ListItem/ListItem.js +37 -58
- package/lib/ListItem/ListItem.module.css +0 -12
- package/lib/ListItem/ListItemWithAvatar.js +53 -74
- package/lib/ListItem/ListItemWithCheckBox.js +33 -54
- package/lib/ListItem/ListItemWithIcon.js +45 -66
- package/lib/ListItem/ListItemWithRadio.js +34 -55
- package/package.json +1 -1
|
@@ -17,8 +17,6 @@ var _Icon = _interopRequireDefault(require("@zohodesk/icons/lib/Icon"));
|
|
|
17
17
|
|
|
18
18
|
var _ListContainer = _interopRequireDefault(require("./ListContainer"));
|
|
19
19
|
|
|
20
|
-
var _CustomResponsive = require("../Responsive/CustomResponsive");
|
|
21
|
-
|
|
22
20
|
var _ListItemModule = _interopRequireDefault(require("./ListItem.module.css"));
|
|
23
21
|
|
|
24
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -59,7 +57,6 @@ var ListItemWithIcon = /*#__PURE__*/function (_React$Component) {
|
|
|
59
57
|
_this.handleClick = _this.handleClick.bind(_assertThisInitialized(_this));
|
|
60
58
|
_this.getRef = _this.getRef.bind(_assertThisInitialized(_this));
|
|
61
59
|
_this.handleMouseEnter = _this.handleMouseEnter.bind(_assertThisInitialized(_this));
|
|
62
|
-
_this.responsiveFunc = _this.responsiveFunc.bind(_assertThisInitialized(_this));
|
|
63
60
|
return _this;
|
|
64
61
|
}
|
|
65
62
|
|
|
@@ -93,21 +90,9 @@ var ListItemWithIcon = /*#__PURE__*/function (_React$Component) {
|
|
|
93
90
|
index = _this$props3.index;
|
|
94
91
|
onMouseEnter && onMouseEnter(id, value, index, e);
|
|
95
92
|
}
|
|
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
|
-
}
|
|
106
93
|
}, {
|
|
107
94
|
key: "render",
|
|
108
95
|
value: function render() {
|
|
109
|
-
var _this2 = this;
|
|
110
|
-
|
|
111
96
|
var _this$props4 = this.props,
|
|
112
97
|
size = _this$props4.size,
|
|
113
98
|
active = _this$props4.active,
|
|
@@ -137,57 +122,51 @@ var ListItemWithIcon = /*#__PURE__*/function (_React$Component) {
|
|
|
137
122
|
var _a11y$ariaHidden = a11y.ariaHidden,
|
|
138
123
|
ariaHidden = _a11y$ariaHidden === void 0 ? true : _a11y$ariaHidden;
|
|
139
124
|
var dataIdString = dataId ? "".concat(dataId.replace("'", '_')) : value.toLowerCase().replace("'", '_');
|
|
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
|
-
dataId: "".concat(dataIdString, "_tickIcon")
|
|
186
|
-
}, /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
|
|
187
|
-
name: "ZD-ticknew",
|
|
188
|
-
size: "8"
|
|
189
|
-
})) : null);
|
|
190
|
-
});
|
|
125
|
+
return /*#__PURE__*/_react["default"].createElement(_ListContainer["default"], _extends({
|
|
126
|
+
a11y: a11y,
|
|
127
|
+
size: size,
|
|
128
|
+
palette: palette,
|
|
129
|
+
highlight: highlight,
|
|
130
|
+
isDisabled: isDisabled,
|
|
131
|
+
active: active,
|
|
132
|
+
autoHover: autoHover,
|
|
133
|
+
needTick: needTick,
|
|
134
|
+
needBorder: needBorder,
|
|
135
|
+
customClass: customClass,
|
|
136
|
+
dataId: dataIdString,
|
|
137
|
+
isLink: isLink,
|
|
138
|
+
href: href,
|
|
139
|
+
target: target,
|
|
140
|
+
onClick: this.handleClick,
|
|
141
|
+
onMouseOver: this.handleMouseEnter,
|
|
142
|
+
eleRef: this.getRef,
|
|
143
|
+
disableTitle: disableTitle,
|
|
144
|
+
title: null,
|
|
145
|
+
customProps: ListItemProps
|
|
146
|
+
}, ContainerProps), iconName && /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
147
|
+
"aria-hidden": true,
|
|
148
|
+
className: _ListItemModule["default"].iconBox,
|
|
149
|
+
dataId: dataId ? "".concat(dataId, "_Icon") : "".concat(value.toLowerCase().replace("'", '_'), "_Icon")
|
|
150
|
+
}, /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
|
|
151
|
+
iconClass: iconClass,
|
|
152
|
+
name: iconName,
|
|
153
|
+
size: iconSize
|
|
154
|
+
})), iconClass && !iconName ? /*#__PURE__*/_react["default"].createElement("span", {
|
|
155
|
+
className: iconClass
|
|
156
|
+
}) : null, value && /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
157
|
+
flexible: true,
|
|
158
|
+
shrink: true,
|
|
159
|
+
className: _ListItemModule["default"].value,
|
|
160
|
+
"data-title": isDisabled ? null : title,
|
|
161
|
+
dataId: "".concat(dataIdString, "_Text")
|
|
162
|
+
}, value), needTick && active ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
163
|
+
className: _ListItemModule["default"].tickIcon,
|
|
164
|
+
"aria-hidden": ariaHidden,
|
|
165
|
+
dataId: "".concat(dataIdString, "_tickIcon")
|
|
166
|
+
}, /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
|
|
167
|
+
name: "ZD-ticknew",
|
|
168
|
+
size: "8"
|
|
169
|
+
})) : null);
|
|
191
170
|
}
|
|
192
171
|
}]);
|
|
193
172
|
|
|
@@ -19,8 +19,6 @@ var _ListContainer = _interopRequireDefault(require("./ListContainer"));
|
|
|
19
19
|
|
|
20
20
|
var _ListItemModule = _interopRequireDefault(require("./ListItem.module.css"));
|
|
21
21
|
|
|
22
|
-
var _CustomResponsive = require("../Responsive/CustomResponsive");
|
|
23
|
-
|
|
24
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
25
23
|
|
|
26
24
|
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); }
|
|
@@ -59,7 +57,6 @@ var ListItemWithRadio = /*#__PURE__*/function (_React$Component) {
|
|
|
59
57
|
_this.onClick = _this.onClick.bind(_assertThisInitialized(_this));
|
|
60
58
|
_this.getRef = _this.getRef.bind(_assertThisInitialized(_this));
|
|
61
59
|
_this.onHover = _this.onHover.bind(_assertThisInitialized(_this));
|
|
62
|
-
_this.responsiveFunc = _this.responsiveFunc.bind(_assertThisInitialized(_this));
|
|
63
60
|
return _this;
|
|
64
61
|
}
|
|
65
62
|
|
|
@@ -92,21 +89,9 @@ var ListItemWithRadio = /*#__PURE__*/function (_React$Component) {
|
|
|
92
89
|
index = _this$props3.index;
|
|
93
90
|
onHover && onHover(id, value, index, e);
|
|
94
91
|
}
|
|
95
|
-
}, {
|
|
96
|
-
key: "responsiveFunc",
|
|
97
|
-
value: function responsiveFunc(_ref) {
|
|
98
|
-
var mediaQueryOR = _ref.mediaQueryOR;
|
|
99
|
-
return {
|
|
100
|
-
mobileToTab: mediaQueryOR([{
|
|
101
|
-
maxWidth: 700
|
|
102
|
-
}])
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
92
|
}, {
|
|
106
93
|
key: "render",
|
|
107
94
|
value: function render() {
|
|
108
|
-
var _this2 = this;
|
|
109
|
-
|
|
110
95
|
var _this$props4 = this.props,
|
|
111
96
|
size = _this$props4.size,
|
|
112
97
|
active = _this$props4.active,
|
|
@@ -133,46 +118,40 @@ var ListItemWithRadio = /*#__PURE__*/function (_React$Component) {
|
|
|
133
118
|
customRadio = _customClass$customRa === void 0 ? '' : _customClass$customRa,
|
|
134
119
|
_customClass$customRa2 = customClass.customRadioWrap,
|
|
135
120
|
customRadioWrap = _customClass$customRa2 === void 0 ? '' : _customClass$customRa2;
|
|
136
|
-
return /*#__PURE__*/_react["default"].createElement(
|
|
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
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
flexible: true,
|
|
171
|
-
shrink: true,
|
|
172
|
-
"data-title": disableTitle ? null : title,
|
|
173
|
-
className: _ListItemModule["default"].value
|
|
174
|
-
}, value));
|
|
175
|
-
});
|
|
121
|
+
return /*#__PURE__*/_react["default"].createElement(_ListContainer["default"], _extends({
|
|
122
|
+
a11y: a11y,
|
|
123
|
+
size: size,
|
|
124
|
+
palette: palette,
|
|
125
|
+
highlight: highlight,
|
|
126
|
+
isDisabled: isDisabled,
|
|
127
|
+
active: active,
|
|
128
|
+
autoHover: autoHover,
|
|
129
|
+
customClass: customListItem,
|
|
130
|
+
dataId: dataId,
|
|
131
|
+
onClick: this.onClick,
|
|
132
|
+
onMouseOver: this.onHover,
|
|
133
|
+
eleRef: this.getRef,
|
|
134
|
+
disableTitle: disableTitle,
|
|
135
|
+
title: null,
|
|
136
|
+
customProps: ListItemProps
|
|
137
|
+
}, ContainerProps), /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
138
|
+
className: _ListItemModule["default"].iconBox
|
|
139
|
+
}, /*#__PURE__*/_react["default"].createElement(_Radio["default"], {
|
|
140
|
+
checked: checked,
|
|
141
|
+
id: id,
|
|
142
|
+
a11y: {
|
|
143
|
+
ariaHidden: true
|
|
144
|
+
},
|
|
145
|
+
customClass: {
|
|
146
|
+
customRadio: customRadio,
|
|
147
|
+
customRadioWrap: customRadioWrap
|
|
148
|
+
}
|
|
149
|
+
})), /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
150
|
+
flexible: true,
|
|
151
|
+
shrink: true,
|
|
152
|
+
"data-title": disableTitle ? null : title,
|
|
153
|
+
className: _ListItemModule["default"].value
|
|
154
|
+
}, value));
|
|
176
155
|
}
|
|
177
156
|
}]);
|
|
178
157
|
|