@zohodesk/components 1.0.0-temp-47 → 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 +24 -0
- package/assets/Appearance/dark/mode/darkMode.module.css +2 -0
- package/assets/Appearance/default/mode/defaultMode.module.css +2 -0
- package/es/Animation/Animation.js +7 -8
- package/es/Avatar/Avatar.js +13 -12
- package/es/Avatar/__tests__/Avatar.spec.js +0 -1
- package/es/AvatarTeam/__tests__/AvatarTeam.spec.js +0 -1
- package/es/Button/Button.js +15 -16
- package/es/Button/Button.module.css +6 -2
- package/es/Button/__tests__/Button.spec.js +0 -1
- package/es/Buttongroup/__test__/Buttongroup.spec.js +0 -1
- package/es/Card/Card.js +4 -5
- package/es/DateTime/DateTime.js +6 -3
- package/es/DateTime/DateWidget.js +5 -2
- package/es/DateTime/YearView.js +6 -5
- package/es/DateTime/common.js +9 -2
- package/es/DateTime/dateFormatUtils/dateFormat.js +76 -57
- package/es/DateTime/dateFormatUtils/index.js +12 -7
- package/es/DateTime/dateFormatUtils/timeChange.js +4 -3
- package/es/DateTime/dateFormatUtils/yearChange.js +4 -3
- package/es/DateTime/validator.js +0 -1
- package/es/DropBox/DropBox.js +2 -2
- package/es/Label/__tests__/Label.spec.js +0 -2
- package/es/Layout/utils.js +2 -1
- package/es/ListItem/ListContainer.js +3 -8
- package/es/ListItem/ListItem.js +58 -39
- 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 -47
- package/es/ListItem/ListItemWithRadio.js +55 -34
- package/es/MultiSelect/AdvancedGroupMultiSelect.js +12 -4
- package/es/MultiSelect/AdvancedMultiSelect.js +20 -7
- package/es/MultiSelect/MultiSelect.js +24 -8
- package/es/MultiSelect/MultiSelectWithAvatar.js +1 -1
- package/es/PopOver/PopOver.js +19 -20
- package/es/Popup/Popup.js +15 -9
- package/es/Popup/viewPort.js +14 -9
- package/es/Provider/IdProvider.js +5 -4
- package/es/Provider/LibraryContext.js +6 -5
- package/es/Provider/NumberGenerator/NumberGenerator.js +17 -15
- package/es/Provider/ZindexProvider.js +5 -4
- package/es/Responsive/CustomResponsive.js +11 -8
- package/es/Responsive/ResizeComponent.js +3 -1
- package/es/Responsive/Responsive.js +12 -9
- package/es/Responsive/sizeObservers.js +13 -2
- package/es/Ribbon/Ribbon.js +8 -8
- package/es/Ribbon/__tests__/Ribbon.spec.js +0 -1
- package/es/Select/GroupSelect.js +3 -2
- package/es/Select/Select.js +3 -2
- package/es/Select/SelectWithAvatar.js +1 -1
- package/es/Select/SelectWithIcon.js +1 -1
- package/es/Stencils/Stencils.js +5 -6
- package/es/Stencils/__tests__/Stencils.spec.js +0 -1
- package/es/Tab/Tab.js +27 -26
- package/es/Tab/TabContent.js +17 -14
- package/es/Tab/TabContentWrapper.js +17 -14
- package/es/Tab/TabWrapper.js +15 -14
- package/es/Tab/Tabs.js +2 -1
- package/es/TextBox/__tests__/TextBox.spec.js +0 -1
- package/es/TextBoxIcon/TextBoxIcon.js +1 -1
- package/es/TextBoxIcon/__tests__/TextBoxIcon.spec.js +0 -1
- package/es/Textarea/__tests__/Textarea.spec.js +0 -1
- package/es/Tooltip/Tooltip.js +0 -1
- package/es/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +1 -1
- package/es/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +1 -1
- package/es/a11y/FocusScope/FocusScope.js +10 -4
- package/es/beta/FocusRing/FocusRing.js +4 -1
- package/es/utils/Common.js +31 -11
- package/es/utils/datetime/common.js +6 -3
- package/es/utils/dropDownUtils.js +45 -6
- package/es/utils/getInitial.js +3 -1
- package/lib/Accordion/Accordion.js +3 -3
- package/lib/Accordion/AccordionItem.js +3 -3
- package/lib/Animation/Animation.js +10 -11
- package/lib/AppContainer/AppContainer.js +3 -3
- package/lib/Avatar/Avatar.js +14 -14
- package/lib/AvatarTeam/AvatarTeam.js +3 -3
- package/lib/Button/Button.js +18 -19
- package/lib/Button/Button.module.css +6 -2
- package/lib/Buttongroup/Buttongroup.js +3 -3
- package/lib/Card/Card.js +8 -9
- package/lib/Card/__tests__/Card.spec.js +1 -1
- package/lib/Card/index.js +7 -7
- package/lib/CheckBox/CheckBox.js +3 -3
- package/lib/DateTime/CalendarView.js +4 -4
- package/lib/DateTime/DateTime.js +3 -3
- package/lib/DateTime/DateTimePopupFooter.js +3 -3
- package/lib/DateTime/DateTimePopupHeader.js +3 -3
- package/lib/DateTime/DateWidget.js +3 -3
- package/lib/DateTime/DaysRow.js +3 -3
- package/lib/DateTime/Time.js +3 -3
- package/lib/DateTime/YearView.js +3 -3
- package/lib/DateTime/__tests__/CalendarView.spec.js +1 -1
- package/lib/DateTime/__tests__/DateTime.spec.js +1 -1
- package/lib/DateTime/constants.js +1 -1
- package/lib/DateTime/dateFormatUtils/dateFormat.js +2 -2
- package/lib/DateTime/dateFormatUtils/index.js +13 -13
- package/lib/DateTime/objectUtils.js +2 -2
- package/lib/DropBox/DropBox.js +9 -5
- package/lib/DropDown/DropDown.js +4 -4
- package/lib/DropDown/DropDownHeading.js +3 -3
- package/lib/DropDown/DropDownItem.js +3 -3
- package/lib/DropDown/DropDownSearch.js +3 -3
- package/lib/DropDown/DropDownSeparator.js +3 -3
- package/lib/Label/Label.js +3 -3
- package/lib/Layout/Box.js +1 -1
- package/lib/Layout/Container.js +1 -1
- package/lib/Layout/index.js +4 -4
- package/lib/Layout/utils.js +2 -2
- package/lib/ListItem/ListContainer.js +3 -8
- package/lib/ListItem/ListItem.js +61 -40
- package/lib/ListItem/ListItem.module.css +11 -0
- package/lib/ListItem/ListItemWithAvatar.js +77 -56
- package/lib/ListItem/ListItemWithCheckBox.js +57 -36
- package/lib/ListItem/ListItemWithIcon.js +69 -48
- package/lib/ListItem/ListItemWithRadio.js +58 -37
- package/lib/Modal/Modal.js +3 -3
- package/lib/Modal/__docs__/Modal__default.docs.js +3 -3
- package/lib/MultiSelect/AdvancedGroupMultiSelect.js +4 -4
- package/lib/MultiSelect/AdvancedMultiSelect.js +20 -8
- package/lib/MultiSelect/EmptyState.js +3 -3
- package/lib/MultiSelect/MultiSelect.js +16 -7
- package/lib/MultiSelect/MultiSelectHeader.js +3 -3
- package/lib/MultiSelect/MultiSelectWithAvatar.js +4 -4
- package/lib/MultiSelect/SelectedOptions.js +3 -3
- package/lib/MultiSelect/Suggestions.js +5 -5
- package/lib/PopOver/PopOver.js +23 -24
- package/lib/Popup/Popup.js +35 -32
- package/lib/Popup/__tests__/Popup.spec.js +3 -3
- package/lib/Provider/IdProvider.js +3 -3
- package/lib/Provider/LibraryContext.js +3 -3
- package/lib/Provider/NumberGenerator/NumberGenerator.js +2 -2
- package/lib/Provider/ZindexProvider.js +1 -1
- package/lib/Provider.js +3 -3
- package/lib/Radio/Radio.js +3 -3
- package/lib/Responsive/CustomResponsive.js +4 -4
- package/lib/Responsive/RefWrapper.js +1 -1
- package/lib/Responsive/ResizeComponent.js +3 -3
- package/lib/Responsive/ResizeObserver.js +1 -1
- package/lib/Responsive/Responsive.js +6 -5
- package/lib/Responsive/sizeObservers.js +14 -6
- package/lib/Responsive/utils/index.js +3 -2
- package/lib/Responsive/utils/shallowCompare.js +1 -1
- package/lib/Ribbon/Ribbon.js +11 -11
- package/lib/Select/GroupSelect.js +4 -4
- package/lib/Select/Select.js +4 -4
- package/lib/Select/SelectWithAvatar.js +4 -4
- package/lib/Select/SelectWithIcon.js +4 -4
- package/lib/Stencils/Stencils.js +8 -9
- package/lib/Switch/Switch.js +3 -3
- package/lib/Tab/Tab.js +1 -1
- package/lib/Tab/TabWrapper.js +1 -1
- package/lib/Tab/Tabs.js +3 -3
- package/lib/Tab/index.js +10 -10
- package/lib/Tag/Tag.js +3 -3
- package/lib/TextBox/TextBox.js +3 -3
- package/lib/TextBoxIcon/TextBoxIcon.js +4 -4
- package/lib/Textarea/Textarea.js +3 -3
- package/lib/Tooltip/Tooltip.js +3 -3
- package/lib/Tooltip/__tests__/Tooltip.spec.js +3 -3
- package/lib/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +8 -6
- package/lib/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +8 -6
- package/lib/a11y/FocusScope/FocusScope.js +2 -2
- package/lib/beta/FocusRing/FocusRing.js +3 -3
- package/lib/deprecated/PortalLayer/PortalLayer.js +3 -3
- package/lib/index.js +310 -310
- package/lib/semantic/Button/Button.js +3 -3
- package/lib/utils/Common.js +20 -16
- package/lib/utils/datetime/common.js +10 -10
- package/lib/utils/dropDownUtils.js +46 -3
- package/lib/utils/shallowEqual.js +1 -1
- package/package.json +4 -4
|
@@ -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 {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
@@ -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;
|
|
@@ -35,9 +37,9 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
35
37
|
|
|
36
38
|
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); } }
|
|
37
39
|
|
|
38
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
40
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
39
41
|
|
|
40
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
42
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
41
43
|
|
|
42
44
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
43
45
|
|
|
@@ -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
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
@@ -19,6 +19,8 @@ var _Layout = require("../Layout");
|
|
|
19
19
|
|
|
20
20
|
var _ListItemModule = _interopRequireDefault(require("./ListItem.module.css"));
|
|
21
21
|
|
|
22
|
+
var _CustomResponsive = require("../Responsive/CustomResponsive");
|
|
23
|
+
|
|
22
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
23
25
|
|
|
24
26
|
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); }
|
|
@@ -27,9 +29,9 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
27
29
|
|
|
28
30
|
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); } }
|
|
29
31
|
|
|
30
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
32
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
31
33
|
|
|
32
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
34
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
33
35
|
|
|
34
36
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
35
37
|
|
|
@@ -57,6 +59,7 @@ var ListItemWithCheckBox = /*#__PURE__*/function (_React$Component) {
|
|
|
57
59
|
_this.onClick = _this.onClick.bind(_assertThisInitialized(_this));
|
|
58
60
|
_this.getRef = _this.getRef.bind(_assertThisInitialized(_this));
|
|
59
61
|
_this.onHover = _this.onHover.bind(_assertThisInitialized(_this));
|
|
62
|
+
_this.responsiveFunc = _this.responsiveFunc.bind(_assertThisInitialized(_this));
|
|
60
63
|
return _this;
|
|
61
64
|
}
|
|
62
65
|
|
|
@@ -89,9 +92,21 @@ var ListItemWithCheckBox = /*#__PURE__*/function (_React$Component) {
|
|
|
89
92
|
index = _this$props3.index;
|
|
90
93
|
onHover && onHover(id, value, index, e);
|
|
91
94
|
}
|
|
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
|
+
}
|
|
92
105
|
}, {
|
|
93
106
|
key: "render",
|
|
94
107
|
value: function render() {
|
|
108
|
+
var _this2 = this;
|
|
109
|
+
|
|
95
110
|
var _this$props4 = this.props,
|
|
96
111
|
size = _this$props4.size,
|
|
97
112
|
active = _this$props4.active,
|
|
@@ -117,39 +132,45 @@ var ListItemWithCheckBox = /*#__PURE__*/function (_React$Component) {
|
|
|
117
132
|
customCheckBox = _customClass$customCh === void 0 ? '' : _customClass$customCh,
|
|
118
133
|
_customClass$customLa = customClass.customLabel,
|
|
119
134
|
customLabel = _customClass$customLa === void 0 ? '' : _customClass$customLa;
|
|
120
|
-
return /*#__PURE__*/_react["default"].createElement(
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
135
|
+
return /*#__PURE__*/_react["default"].createElement(_CustomResponsive.ResponsiveReceiver, {
|
|
136
|
+
query: this.responsiveFunc,
|
|
137
|
+
responsiveId: "Helmet"
|
|
138
|
+
}, function (_ref2) {
|
|
139
|
+
var mobileToTab = _ref2.mobileToTab;
|
|
140
|
+
return /*#__PURE__*/_react["default"].createElement(_ListContainer["default"], _extends({
|
|
141
|
+
a11y: a11y,
|
|
142
|
+
size: size,
|
|
143
|
+
palette: palette,
|
|
144
|
+
highlight: highlight,
|
|
145
|
+
isDisabled: isDisabled,
|
|
146
|
+
active: active,
|
|
147
|
+
autoHover: autoHover,
|
|
148
|
+
customClass: "".concat(customListItem, " ").concat(mobileToTab && _ListItemModule["default"].responsiveHeight),
|
|
149
|
+
dataId: "".concat(dataId ? dataId : value, "_ListItemWithCheckBox"),
|
|
150
|
+
onClick: _this2.onClick,
|
|
151
|
+
onMouseOver: _this2.onHover,
|
|
152
|
+
eleRef: _this2.getRef,
|
|
153
|
+
disableTitle: disableTitle,
|
|
154
|
+
title: null,
|
|
155
|
+
customProps: ListItemProps
|
|
156
|
+
}, ContainerProps), /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
157
|
+
className: _ListItemModule["default"].iconBox
|
|
158
|
+
}, /*#__PURE__*/_react["default"].createElement(_CheckBox["default"], {
|
|
159
|
+
checked: checked,
|
|
160
|
+
a11y: {
|
|
161
|
+
ariaHidden: true
|
|
162
|
+
},
|
|
163
|
+
customClass: {
|
|
164
|
+
customCheckBox: customCheckBox,
|
|
165
|
+
customLabel: customLabel
|
|
166
|
+
}
|
|
167
|
+
})), /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
168
|
+
flexible: true,
|
|
169
|
+
shrink: true,
|
|
170
|
+
"data-title": isDisabled ? null : title,
|
|
171
|
+
className: _ListItemModule["default"].value
|
|
172
|
+
}, value));
|
|
173
|
+
});
|
|
153
174
|
}
|
|
154
175
|
}]);
|
|
155
176
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
@@ -17,6 +17,8 @@ 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
|
+
|
|
20
22
|
var _ListItemModule = _interopRequireDefault(require("./ListItem.module.css"));
|
|
21
23
|
|
|
22
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -27,9 +29,9 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
27
29
|
|
|
28
30
|
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); } }
|
|
29
31
|
|
|
30
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
32
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
31
33
|
|
|
32
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
34
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
33
35
|
|
|
34
36
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
35
37
|
|
|
@@ -57,6 +59,7 @@ var ListItemWithIcon = /*#__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 ListItemWithIcon = /*#__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,
|
|
@@ -122,51 +137,57 @@ var ListItemWithIcon = /*#__PURE__*/function (_React$Component) {
|
|
|
122
137
|
var _a11y$ariaHidden = a11y.ariaHidden,
|
|
123
138
|
ariaHidden = _a11y$ariaHidden === void 0 ? true : _a11y$ariaHidden;
|
|
124
139
|
var dataIdString = dataId ? "".concat(dataId.replace("'", '_')) : value.toLowerCase().replace("'", '_');
|
|
125
|
-
return /*#__PURE__*/_react["default"].createElement(
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
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
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
140
|
+
return /*#__PURE__*/_react["default"].createElement(_CustomResponsive.ResponsiveReceiver, {
|
|
141
|
+
query: this.responsiveFunc,
|
|
142
|
+
responsiveId: "Helmet"
|
|
143
|
+
}, function (_ref2) {
|
|
144
|
+
var mobileToTab = _ref2.mobileToTab;
|
|
145
|
+
return /*#__PURE__*/_react["default"].createElement(_ListContainer["default"], _extends({
|
|
146
|
+
a11y: a11y,
|
|
147
|
+
size: size,
|
|
148
|
+
palette: palette,
|
|
149
|
+
highlight: highlight,
|
|
150
|
+
isDisabled: isDisabled,
|
|
151
|
+
active: active,
|
|
152
|
+
autoHover: autoHover,
|
|
153
|
+
needTick: needTick,
|
|
154
|
+
needBorder: needBorder,
|
|
155
|
+
customClass: "".concat(customListItem, " ").concat(mobileToTab && _ListItemModule["default"].responsiveHeight),
|
|
156
|
+
dataId: dataIdString,
|
|
157
|
+
isLink: isLink,
|
|
158
|
+
href: href,
|
|
159
|
+
target: target,
|
|
160
|
+
onClick: _this2.handleClick,
|
|
161
|
+
onMouseOver: _this2.handleMouseEnter,
|
|
162
|
+
eleRef: _this2.getRef,
|
|
163
|
+
disableTitle: disableTitle,
|
|
164
|
+
title: null,
|
|
165
|
+
customProps: ListItemProps
|
|
166
|
+
}, ContainerProps), iconName && /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
167
|
+
"aria-hidden": true,
|
|
168
|
+
className: _ListItemModule["default"].iconBox,
|
|
169
|
+
dataId: dataId ? "".concat(dataId, "_Icon") : "".concat(value.toLowerCase().replace("'", '_'), "_Icon")
|
|
170
|
+
}, /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
|
|
171
|
+
iconClass: iconClass,
|
|
172
|
+
name: iconName,
|
|
173
|
+
size: iconSize
|
|
174
|
+
})), iconClass && !iconName ? /*#__PURE__*/_react["default"].createElement("span", {
|
|
175
|
+
className: iconClass
|
|
176
|
+
}) : null, value && /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
177
|
+
flexible: true,
|
|
178
|
+
shrink: true,
|
|
179
|
+
className: _ListItemModule["default"].value,
|
|
180
|
+
"data-title": isDisabled ? null : title,
|
|
181
|
+
dataId: "".concat(dataIdString, "_Text")
|
|
182
|
+
}, value), needTick && active ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
183
|
+
className: _ListItemModule["default"].tickIcon,
|
|
184
|
+
"aria-hidden": ariaHidden,
|
|
185
|
+
dataId: "".concat(dataIdString, "_tickIcon")
|
|
186
|
+
}, /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
|
|
187
|
+
name: "ZD-ticknew",
|
|
188
|
+
size: "8"
|
|
189
|
+
})) : null);
|
|
190
|
+
});
|
|
170
191
|
}
|
|
171
192
|
}]);
|
|
172
193
|
|