@zohodesk/components 1.0.0-temp-199.5 → 1.0.0-temp-215
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/propValidation_report.html +1 -1
- package/README.md +19 -0
- package/es/CheckBox/CheckBox.js +6 -5
- package/es/CheckBox/CheckBox.module.css +5 -2
- package/es/CheckBox/__tests__/__snapshots__/CheckBox.spec.js.snap +64 -64
- package/es/DateTime/DateTime.js +8 -4
- package/es/DateTime/DateWidget.js +8 -1
- package/es/DateTime/props/propTypes.js +5 -0
- package/es/DropBox/DropBoxElement/DropBoxElement.js +1 -0
- package/es/DropBox/DropBoxElement/css/DropBoxElement.module.css +53 -48
- package/es/DropBox/DropBoxElement/css/cssJSLogic.js +4 -4
- package/es/ListItem/ListItem.js +2 -2
- package/es/ListItem/ListItem.module.css +18 -85
- package/es/ListItem/ListItemWithAvatar.js +3 -3
- package/es/ListItem/ListItemWithIcon.js +2 -2
- package/es/ListItem/__tests__/__snapshots__/ListItemWithCheckBox.spec.js.snap +2 -2
- package/es/ListItem/__tests__/__snapshots__/ListItemWithRadio.spec.js.snap +1 -1
- package/es/MultiSelect/AdvancedGroupMultiSelect.js +4 -7
- package/es/MultiSelect/AdvancedMultiSelect.js +5 -4
- package/es/MultiSelect/MultiSelect.js +6 -9
- package/es/MultiSelect/Suggestions.js +4 -8
- package/es/MultiSelect/props/defaultProps.js +4 -6
- package/es/MultiSelect/props/propTypes.js +7 -7
- package/es/Popup/Popup.js +173 -35
- package/es/Popup/intersectionObserver.js +33 -23
- package/es/Popup/props/propTypes.js +1 -1
- package/es/Radio/Radio.js +9 -7
- package/es/Radio/Radio.module.css +1 -1
- package/es/Radio/__tests__/__snapshots__/Radio.spec.js.snap +77 -77
- package/es/Select/GroupSelect.js +9 -7
- package/es/Select/SelectWithAvatar.js +2 -7
- package/es/Select/SelectWithIcon.js +2 -4
- package/es/Select/props/defaultProps.js +1 -2
- package/es/Select/props/propTypes.js +5 -3
- package/es/Textarea/Textarea.js +4 -2
- package/es/Textarea/Textarea.module.css +1 -1
- package/es/Textarea/__tests__/__snapshots__/Textarea.spec.js.snap +41 -41
- package/es/Textarea/props/propTypes.js +2 -1
- package/es/Typography/Typography.js +38 -0
- package/es/Typography/css/Typography.module.css +489 -0
- package/es/Typography/css/cssJSLogic.js +56 -0
- package/es/Typography/props/defaultProps.js +8 -0
- package/es/Typography/props/propTypes.js +27 -0
- package/es/Typography/utils/index.js +50 -0
- package/es/index.js +1 -1
- package/es/v1/MultiSelect/AdvancedMultiSelect.js +1 -2
- package/es/v1/MultiSelect/MultiSelect.js +2 -7
- package/es/v1/MultiSelect/Suggestions.js +4 -8
- package/es/v1/MultiSelect/props/defaultProps.js +2 -4
- package/es/v1/MultiSelect/props/propTypes.js +2 -6
- package/es/v1/Select/GroupSelect.js +2 -7
- package/es/v1/Select/SelectWithAvatar.js +2 -7
- package/es/v1/Select/props/defaultProps.js +2 -4
- package/es/v1/Select/props/propTypes.js +2 -6
- package/es/v1/Typography/Typography.js +1 -1
- package/lib/CheckBox/CheckBox.js +5 -4
- package/lib/CheckBox/CheckBox.module.css +5 -2
- package/lib/CheckBox/__tests__/__snapshots__/CheckBox.spec.js.snap +64 -64
- package/lib/DateTime/DateTime.js +11 -5
- package/lib/DateTime/DateWidget.js +8 -1
- package/lib/DateTime/props/propTypes.js +5 -0
- package/lib/DropBox/DropBoxElement/DropBoxElement.js +1 -0
- package/lib/DropBox/DropBoxElement/css/DropBoxElement.module.css +53 -48
- package/lib/DropBox/DropBoxElement/css/cssJSLogic.js +2 -2
- package/lib/ListItem/ListItem.js +2 -2
- package/lib/ListItem/ListItem.module.css +18 -85
- package/lib/ListItem/ListItemWithAvatar.js +3 -3
- package/lib/ListItem/ListItemWithIcon.js +2 -2
- package/lib/ListItem/__tests__/__snapshots__/ListItemWithCheckBox.spec.js.snap +2 -2
- package/lib/ListItem/__tests__/__snapshots__/ListItemWithRadio.spec.js.snap +1 -1
- package/lib/MultiSelect/AdvancedGroupMultiSelect.js +5 -7
- package/lib/MultiSelect/AdvancedMultiSelect.js +5 -5
- package/lib/MultiSelect/MultiSelect.js +7 -8
- package/lib/MultiSelect/Suggestions.js +4 -8
- package/lib/MultiSelect/props/defaultProps.js +4 -6
- package/lib/MultiSelect/props/propTypes.js +7 -7
- package/lib/Popup/Popup.js +212 -74
- package/lib/Popup/intersectionObserver.js +35 -25
- package/lib/Popup/props/propTypes.js +1 -1
- package/lib/Radio/Radio.js +10 -7
- package/lib/Radio/Radio.module.css +1 -1
- package/lib/Radio/__tests__/__snapshots__/Radio.spec.js.snap +77 -77
- package/lib/Select/GroupSelect.js +10 -8
- package/lib/Select/SelectWithAvatar.js +3 -8
- package/lib/Select/SelectWithIcon.js +3 -5
- package/lib/Select/props/defaultProps.js +1 -2
- package/lib/Select/props/propTypes.js +5 -3
- package/lib/Textarea/Textarea.js +4 -2
- package/lib/Textarea/Textarea.module.css +1 -1
- package/lib/Textarea/__tests__/__snapshots__/Textarea.spec.js.snap +41 -41
- package/lib/Textarea/props/propTypes.js +2 -1
- package/lib/Typography/Typography.js +56 -0
- package/lib/Typography/css/Typography.module.css +489 -0
- package/lib/Typography/css/cssJSLogic.js +48 -0
- package/lib/Typography/props/defaultProps.js +15 -0
- package/lib/Typography/props/propTypes.js +38 -0
- package/lib/Typography/utils/index.js +59 -0
- package/lib/index.js +1 -1
- package/lib/v1/MultiSelect/AdvancedMultiSelect.js +1 -3
- package/lib/v1/MultiSelect/MultiSelect.js +3 -8
- package/lib/v1/MultiSelect/Suggestions.js +4 -8
- package/lib/v1/MultiSelect/props/defaultProps.js +2 -4
- package/lib/v1/MultiSelect/props/propTypes.js +2 -6
- package/lib/v1/Select/GroupSelect.js +3 -8
- package/lib/v1/Select/SelectWithAvatar.js +3 -8
- package/lib/v1/Select/props/defaultProps.js +2 -4
- package/lib/v1/Select/props/propTypes.js +2 -6
- package/lib/v1/Typography/Typography.js +2 -2
- package/package.json +4 -4
- package/result.json +1 -1
- /package/es/v1/Typography/css/{Typography.module.css → v1_Typography.module.css} +0 -0
- /package/lib/v1/Typography/css/{Typography.module.css → v1_Typography.module.css} +0 -0
|
@@ -22,41 +22,51 @@ var observerCallbacks = null;
|
|
|
22
22
|
var intersectionObserver = null;
|
|
23
23
|
|
|
24
24
|
function handleObserverCallbacks(entries) {
|
|
25
|
-
entries.
|
|
25
|
+
entries.forEach(function (entry) {
|
|
26
26
|
var oldCallbacks = observerCallbacks.get(entry.target);
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
|
|
28
|
+
if (Array.isArray(oldCallbacks) && oldCallbacks.length) {
|
|
29
|
+
oldCallbacks.forEach(function (callback) {
|
|
30
|
+
callback && callback(entry);
|
|
31
|
+
});
|
|
32
|
+
}
|
|
30
33
|
});
|
|
31
34
|
}
|
|
32
35
|
|
|
33
36
|
function addIntersectionObserver(element, callback, options) {
|
|
34
|
-
if (
|
|
35
|
-
intersectionObserver
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
if (!!element && typeof callback == 'function') {
|
|
38
|
+
if (intersectionObserver === null && observerCallbacks === null) {
|
|
39
|
+
intersectionObserver = new IntersectionObserver(function (entries) {
|
|
40
|
+
handleObserverCallbacks(entries);
|
|
41
|
+
}, options);
|
|
42
|
+
observerCallbacks = new Map();
|
|
43
|
+
}
|
|
40
44
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
45
|
+
intersectionObserver.observe(element);
|
|
46
|
+
var oldCallbacks = observerCallbacks.get(element) || [];
|
|
47
|
+
observerCallbacks.set(element, [].concat(_toConsumableArray(oldCallbacks), [callback]));
|
|
48
|
+
}
|
|
44
49
|
}
|
|
45
50
|
|
|
46
51
|
function removeIntersectionObserver(element, callback) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
return handler !== callback;
|
|
50
|
-
});
|
|
52
|
+
if (!!element && typeof callback == 'function') {
|
|
53
|
+
var oldCallbacks = observerCallbacks ? observerCallbacks.get(element) : null;
|
|
51
54
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
55
|
+
if (Array.isArray(oldCallbacks)) {
|
|
56
|
+
var callbacks = oldCallbacks.filter(function (handler) {
|
|
57
|
+
return handler !== callback;
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
if (intersectionObserver && callbacks.length === 0) {
|
|
61
|
+
observerCallbacks["delete"](element);
|
|
62
|
+
intersectionObserver.unobserve(element);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
56
65
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
66
|
+
if (intersectionObserver && observerCallbacks && observerCallbacks.size === 0) {
|
|
67
|
+
intersectionObserver.disconnect();
|
|
68
|
+
intersectionObserver = null;
|
|
69
|
+
observerCallbacks = null;
|
|
70
|
+
}
|
|
61
71
|
}
|
|
62
72
|
}
|
|
@@ -24,7 +24,7 @@ var PopupPropTypes = {
|
|
|
24
24
|
isArrow: _propTypes["default"].bool,
|
|
25
25
|
isPopupOpen: _propTypes["default"].bool,
|
|
26
26
|
closeOnScroll: _propTypes["default"].bool,
|
|
27
|
-
|
|
27
|
+
fixedPopupScrollBehavior: _propTypes["default"].oneOf(['scroll', 'block', 'none']),
|
|
28
28
|
needResizeHandling: _propTypes["default"].bool,
|
|
29
29
|
isAbsolutePositioningNeeded: _propTypes["default"].bool,
|
|
30
30
|
scrollDebounceTime: _propTypes["default"].number,
|
package/lib/Radio/Radio.js
CHANGED
|
@@ -17,6 +17,8 @@ var _Label = _interopRequireDefault(require("../Label/Label"));
|
|
|
17
17
|
|
|
18
18
|
var _Layout = require("../Layout");
|
|
19
19
|
|
|
20
|
+
var _CssProvider = _interopRequireDefault(require("../Provider/CssProvider"));
|
|
21
|
+
|
|
20
22
|
var _RadioModule = _interopRequireDefault(require("./Radio.module.css"));
|
|
21
23
|
|
|
22
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -106,8 +108,9 @@ var Radio = /*#__PURE__*/function (_React$Component) {
|
|
|
106
108
|
customRadio = _customClass$customRa2 === void 0 ? '' : _customClass$customRa2,
|
|
107
109
|
_customClass$customLa = customClass.customLabel,
|
|
108
110
|
customLabel = _customClass$customLa === void 0 ? '' : _customClass$customLa;
|
|
109
|
-
var accessMode = isReadOnly ? _RadioModule["default"].readonly : disabled ?
|
|
111
|
+
var accessMode = isReadOnly ? _RadioModule["default"].readonly : disabled ? (0, _CssProvider["default"])('isDisabled') : _RadioModule["default"].pointer;
|
|
110
112
|
var toolTip = disabled ? disabledTitle : title ? title : null;
|
|
113
|
+
var isEditable = !(isReadOnly || disabled);
|
|
111
114
|
var ariaHidden = a11y.ariaHidden,
|
|
112
115
|
_a11y$role = a11y.role,
|
|
113
116
|
role = _a11y$role === void 0 ? 'radio' : _a11y$role,
|
|
@@ -117,7 +120,7 @@ var Radio = /*#__PURE__*/function (_React$Component) {
|
|
|
117
120
|
ariaLabel = a11y.ariaLabel,
|
|
118
121
|
ariaLabelledby = a11y.ariaLabelledby,
|
|
119
122
|
_a11y$ariaReadonly = a11y.ariaReadonly,
|
|
120
|
-
ariaReadonly = _a11y$ariaReadonly === void 0 ?
|
|
123
|
+
ariaReadonly = _a11y$ariaReadonly === void 0 ? !isEditable ? true : false : _a11y$ariaReadonly;
|
|
121
124
|
var _customProps$Containe = customProps.ContainerProps,
|
|
122
125
|
ContainerProps = _customProps$Containe === void 0 ? {} : _customProps$Containe,
|
|
123
126
|
_customProps$LabelPro = customProps.LabelProps,
|
|
@@ -128,11 +131,11 @@ var Radio = /*#__PURE__*/function (_React$Component) {
|
|
|
128
131
|
isInline: text ? false : true,
|
|
129
132
|
alignBox: "row",
|
|
130
133
|
align: "both",
|
|
131
|
-
className: "".concat(_RadioModule["default"].container, " ").concat(active && !disabled ? _RadioModule["default"].active : '', " ").concat(accessMode, " ").concat(
|
|
134
|
+
className: "".concat(_RadioModule["default"].container, " ").concat(active && !disabled ? _RadioModule["default"].active : '', " ").concat(accessMode, " ").concat(!isEditable ? '' : _RadioModule["default"].hoverEfffect, " ").concat(checked ? _RadioModule["default"].checked : '', " ").concat(customRadioWrap),
|
|
132
135
|
"data-title": toolTip,
|
|
133
136
|
onClick: !isReadOnly && !disabled ? this.onChange : '',
|
|
134
137
|
"aria-checked": ariaChecked,
|
|
135
|
-
tabindex:
|
|
138
|
+
tabindex: !isEditable || ariaHidden ? '-1' : tabIndex || '0',
|
|
136
139
|
eleRef: this.handleGetRef,
|
|
137
140
|
role: role,
|
|
138
141
|
"aria-Hidden": ariaHidden,
|
|
@@ -140,7 +143,7 @@ var Radio = /*#__PURE__*/function (_React$Component) {
|
|
|
140
143
|
"aria-labelledby": ariaLabelledby,
|
|
141
144
|
"aria-readonly": ariaReadonly
|
|
142
145
|
}, ContainerProps), /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
143
|
-
className: "".concat(_RadioModule["default"].radio, " ").concat(checked ? "".concat(_RadioModule["default"]["rdBox".concat(palette)]) : '', " \n ").concat(
|
|
146
|
+
className: "".concat(_RadioModule["default"].radio, " ").concat(checked ? "".concat(_RadioModule["default"]["rdBox".concat(palette)]) : '', " \n ").concat(!isEditable ? '' : "".concat(_RadioModule["default"]["hover".concat(palette)]), " ").concat(_RadioModule["default"][size], " ").concat(isFilled ? _RadioModule["default"].filled : '', " ").concat(_RadioModule["default"]["centerPath".concat(palette)], " ").concat(customRadio, " ").concat(!isEditable ? "".concat(_RadioModule["default"].disabled) : '')
|
|
144
147
|
}, /*#__PURE__*/_react["default"].createElement("input", {
|
|
145
148
|
type: "hidden",
|
|
146
149
|
id: id,
|
|
@@ -163,7 +166,7 @@ var Radio = /*#__PURE__*/function (_React$Component) {
|
|
|
163
166
|
className: "".concat(_RadioModule["default"].centerPath)
|
|
164
167
|
}) : null))), text && /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
165
168
|
flexible: true,
|
|
166
|
-
className: _RadioModule["default"].text
|
|
169
|
+
className: "".concat(_RadioModule["default"].text, " ").concat(disabled ? "".concat(_RadioModule["default"].disabled) : '')
|
|
167
170
|
}, /*#__PURE__*/_react["default"].createElement(_Label["default"], _extends({
|
|
168
171
|
text: text,
|
|
169
172
|
palette: labelPalette,
|
|
@@ -173,7 +176,7 @@ var Radio = /*#__PURE__*/function (_React$Component) {
|
|
|
173
176
|
dataId: "".concat(text, "_label"),
|
|
174
177
|
variant: variant,
|
|
175
178
|
title: toolTip ? toolTip : text,
|
|
176
|
-
customClass: "".concat(checked && active ? "".concat(_RadioModule["default"]["".concat(palette, "checkedActive")]) : '', " \n ").concat(_RadioModule["default"]["".concat(palette, "Label")], " ").concat(
|
|
179
|
+
customClass: "".concat(checked && active ? "".concat(_RadioModule["default"]["".concat(palette, "checkedActive")]) : '', " \n ").concat(_RadioModule["default"]["".concat(palette, "Label")], " ").concat(isEditable ? _RadioModule["default"].pointer : '', " ").concat(isReadOnly ? _RadioModule["default"].readonly : '', " ").concat(customLabel)
|
|
177
180
|
}, LabelProps))), children, renderRightPlaceholderNode ? renderRightPlaceholderNode : null);
|
|
178
181
|
}
|
|
179
182
|
}]);
|