@zohodesk/components 1.0.0-temp-220.9 → 1.0.0-temp-227
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 +4 -9
- package/es/AppContainer/AppContainer.js +5 -4
- package/es/DropBox/DropBox.js +3 -3
- package/es/Modal/Modal.js +14 -35
- package/es/MultiSelect/MultiSelect.js +15 -2
- package/es/MultiSelect/props/propTypes.js +3 -1
- package/es/Popup/viewPort.js +16 -15
- package/es/Provider/Config.js +1 -4
- package/es/Select/Select.js +15 -6
- package/es/Select/props/propTypes.js +3 -1
- package/es/TextBoxIcon/TextBoxIcon.js +6 -2
- package/es/TextBoxIcon/props/propTypes.js +2 -1
- package/lib/AppContainer/AppContainer.js +7 -6
- package/lib/DropBox/DropBox.js +3 -3
- package/lib/Modal/Modal.js +16 -40
- package/lib/MultiSelect/MultiSelect.js +16 -3
- package/lib/MultiSelect/props/propTypes.js +3 -1
- package/lib/Popup/viewPort.js +16 -15
- package/lib/Provider/Config.js +1 -4
- package/lib/Select/Select.js +16 -7
- package/lib/Select/props/propTypes.js +3 -1
- package/lib/TextBoxIcon/TextBoxIcon.js +6 -2
- package/lib/TextBoxIcon/props/propTypes.js +2 -1
- package/package.json +2 -2
- package/es/Modal/Portal/Portal.js +0 -31
- package/es/Modal/Portal/props/defaultProps.js +0 -3
- package/es/Modal/Portal/props/propTypes.js +0 -5
- package/lib/Modal/Portal/Portal.js +0 -44
- package/lib/Modal/Portal/props/defaultProps.js +0 -10
- package/lib/Modal/Portal/props/propTypes.js +0 -16
- package/result.json +0 -1
package/lib/Select/Select.js
CHANGED
|
@@ -776,7 +776,9 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
|
|
|
776
776
|
positionsOffset = _this$props11.positionsOffset,
|
|
777
777
|
targetOffset = _this$props11.targetOffset,
|
|
778
778
|
isRestrictScroll = _this$props11.isRestrictScroll,
|
|
779
|
-
dropBoxPortalId = _this$props11.dropBoxPortalId
|
|
779
|
+
dropBoxPortalId = _this$props11.dropBoxPortalId,
|
|
780
|
+
renderCustomToggleIndicator = _this$props11.renderCustomToggleIndicator,
|
|
781
|
+
renderCustomSearchClearComponent = _this$props11.renderCustomSearchClearComponent;
|
|
780
782
|
var _i18nKeys = i18nKeys,
|
|
781
783
|
TextBoxIcon_i18n = _i18nKeys.TextBoxIcon_i18n,
|
|
782
784
|
_i18nKeys$TextBox_all = _i18nKeys.TextBox_ally_label,
|
|
@@ -854,14 +856,20 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
|
|
|
854
856
|
TextBoxProps: _objectSpread({
|
|
855
857
|
'data-title': title || selected
|
|
856
858
|
}, TextBoxProps)
|
|
857
|
-
}
|
|
858
|
-
|
|
859
|
+
},
|
|
860
|
+
renderRightPlaceholderNode: typeof renderCustomToggleIndicator == 'function' ? renderCustomToggleIndicator({
|
|
861
|
+
togglePopup: this.togglePopup,
|
|
862
|
+
isPopupOpened: isPopupReady,
|
|
863
|
+
isReadOnly: isReadOnly,
|
|
864
|
+
isDisabled: isDisabled
|
|
865
|
+
}) : renderCustomToggleIndicator
|
|
866
|
+
}, TextBoxIconProps), !renderCustomToggleIndicator || children ? /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
859
867
|
isInline: true,
|
|
860
868
|
isCover: false,
|
|
861
869
|
alignBox: "row",
|
|
862
870
|
align: "both",
|
|
863
871
|
className: _SelectModule["default"].rightPlaceholder
|
|
864
|
-
}, /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
872
|
+
}, !renderCustomToggleIndicator ? /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
865
873
|
align: "both",
|
|
866
874
|
dataId: "".concat(dataId, "_downIcon"),
|
|
867
875
|
"aria-hidden": true,
|
|
@@ -869,10 +877,10 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
|
|
|
869
877
|
}, /*#__PURE__*/_react["default"].createElement(_icons.Icon, {
|
|
870
878
|
name: "ZD-down",
|
|
871
879
|
size: "7"
|
|
872
|
-
})), children ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
880
|
+
})) : null, children ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
873
881
|
className: isPopupOpen ? _SelectModule["default"].rotate : '',
|
|
874
882
|
dataId: "".concat(dataId, "_children")
|
|
875
|
-
}, children) : null)) : /*#__PURE__*/_react["default"].createElement(_TextBox["default"], {
|
|
883
|
+
}, children) : null) : null) : /*#__PURE__*/_react["default"].createElement(_TextBox["default"], {
|
|
876
884
|
a11y: {
|
|
877
885
|
role: 'Menuitem',
|
|
878
886
|
ariaLabel: TextBox_ally_label,
|
|
@@ -960,7 +968,8 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
|
|
|
960
968
|
autoComplete: autoComplete,
|
|
961
969
|
customProps: {
|
|
962
970
|
TextBoxProps: DropdownSearchTextBoxProps
|
|
963
|
-
}
|
|
971
|
+
},
|
|
972
|
+
renderCustomClearComponent: renderCustomSearchClearComponent
|
|
964
973
|
}))) : null, /*#__PURE__*/_react["default"].createElement(_Card.CardContent, {
|
|
965
974
|
shrink: true,
|
|
966
975
|
customClass: !tabletMode && dropBoxSize ? _SelectModule["default"][dropBoxSize] : '',
|
|
@@ -110,7 +110,9 @@ var Select_propTypes = {
|
|
|
110
110
|
targetOffset: _propTypes["default"].object,
|
|
111
111
|
isRestrictScroll: _propTypes["default"].bool,
|
|
112
112
|
dropBoxPortalId: _propTypes["default"].string,
|
|
113
|
-
allowValueFallback: _propTypes["default"].bool
|
|
113
|
+
allowValueFallback: _propTypes["default"].bool,
|
|
114
|
+
renderCustomToggleIndicator: _propTypes["default"].oneOfType([_propTypes["default"].func, _propTypes["default"].node]),
|
|
115
|
+
renderCustomSearchClearComponent: _propTypes["default"].func
|
|
114
116
|
};
|
|
115
117
|
exports.Select_propTypes = Select_propTypes;
|
|
116
118
|
var GroupSelect_propTypes = {
|
|
@@ -158,7 +158,8 @@ var TextBoxIcon = /*#__PURE__*/function (_React$Component) {
|
|
|
158
158
|
isScrollPrevent = _this$props2.isScrollPrevent,
|
|
159
159
|
customProps = _this$props2.customProps,
|
|
160
160
|
needInputFocusOnWrapperClick = _this$props2.needInputFocusOnWrapperClick,
|
|
161
|
-
renderRightPlaceholderNode = _this$props2.renderRightPlaceholderNode
|
|
161
|
+
renderRightPlaceholderNode = _this$props2.renderRightPlaceholderNode,
|
|
162
|
+
renderCustomClearComponent = _this$props2.renderCustomClearComponent;
|
|
162
163
|
var isActive = this.state.isActive;
|
|
163
164
|
var _customClass$customTB = customClass.customTBoxWrap,
|
|
164
165
|
customTBoxWrap = _customClass$customTB === void 0 ? '' : _customClass$customTB,
|
|
@@ -213,7 +214,10 @@ var TextBoxIcon = /*#__PURE__*/function (_React$Component) {
|
|
|
213
214
|
className: "".concat(_TextBoxIconModule["default"].iconContainer, " ").concat(customTBoxIcon)
|
|
214
215
|
}, /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
215
216
|
alignBox: "row"
|
|
216
|
-
}, value && onClear && value.length > 1 && !isDisabled && !isReadOnly || showClearIcon ?
|
|
217
|
+
}, value && onClear && value.length > 1 && !isDisabled && !isReadOnly || showClearIcon ? typeof renderCustomClearComponent == 'function' ? renderCustomClearComponent({
|
|
218
|
+
clearText: clearText,
|
|
219
|
+
handleClear: this.handleClear
|
|
220
|
+
}) : /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
217
221
|
className: "".concat(_semanticButtonModule["default"].buttonReset, " ").concat(_TextBoxIconModule["default"].icon),
|
|
218
222
|
onClick: this.handleClear,
|
|
219
223
|
dataId: "".concat(dataId, "_ClearIcon"),
|
|
@@ -67,7 +67,8 @@ var propTypes = _objectSpread(_objectSpread({}, _propTypes2.propTypes), {}, {
|
|
|
67
67
|
customProps: _propTypes["default"].shape({
|
|
68
68
|
TextBoxProps: _propTypes["default"].object
|
|
69
69
|
}),
|
|
70
|
-
renderRightPlaceholderNode: _propTypes["default"].node
|
|
70
|
+
renderRightPlaceholderNode: _propTypes["default"].node,
|
|
71
|
+
renderCustomClearComponent: _propTypes["default"].func
|
|
71
72
|
});
|
|
72
73
|
|
|
73
74
|
exports.propTypes = propTypes;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zohodesk/components",
|
|
3
|
-
"version": "1.0.0-temp-
|
|
3
|
+
"version": "1.0.0-temp-227",
|
|
4
4
|
"main": "es/index.js",
|
|
5
5
|
"module": "es/index.js",
|
|
6
6
|
"private": false,
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"build:css:umd": "npm run clean && npm run init && react-cli build:css:umd",
|
|
39
39
|
"coverage": "react-cli coverage",
|
|
40
40
|
"prepare": "npm run init && npm run build && npm run rtl && npm run cssVariableConvert ",
|
|
41
|
-
"prepublishOnly": "node prePublish.js && npm run css:review && npm run review:props ",
|
|
41
|
+
"prepublishOnly": "node prePublish.js && npm run test-clean && npm run download && npm run css:review && npm run review:props ",
|
|
42
42
|
"postpublish": "node postPublish.js",
|
|
43
43
|
"report": "react-cli publish:report",
|
|
44
44
|
"test": "react-cli test",
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import ReactDOM from 'react-dom';
|
|
3
|
-
import { getLibraryConfig } from "../../Provider/Config";
|
|
4
|
-
import { defaultProps } from "./props/defaultProps";
|
|
5
|
-
import { propTypes } from "./props/propTypes";
|
|
6
|
-
export default function Portal(_ref) {
|
|
7
|
-
let {
|
|
8
|
-
children,
|
|
9
|
-
portalId
|
|
10
|
-
} = _ref;
|
|
11
|
-
const portalPrefix = getLibraryConfig("portalPrefix");
|
|
12
|
-
|
|
13
|
-
const getPortalContainerElement = () => {
|
|
14
|
-
const getPortalContainer = getLibraryConfig('getPortalContainer');
|
|
15
|
-
|
|
16
|
-
if (getPortalContainer && typeof getPortalContainer === 'function') {
|
|
17
|
-
const portal = getPortalContainer();
|
|
18
|
-
|
|
19
|
-
if (portal) {
|
|
20
|
-
return portal;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
return null;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
const portalDiv = document.querySelector(`[data-portal="${portalPrefix ? `${portalPrefix}` : ''}${portalId}"]`) || getPortalContainerElement() || document.body;
|
|
28
|
-
return /*#__PURE__*/ReactDOM.createPortal(children, portalDiv);
|
|
29
|
-
}
|
|
30
|
-
Portal.propTypes = propTypes;
|
|
31
|
-
Portal.defaultProps = defaultProps;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = Portal;
|
|
7
|
-
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
|
-
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
11
|
-
|
|
12
|
-
var _Config = require("../../Provider/Config");
|
|
13
|
-
|
|
14
|
-
var _defaultProps = require("./props/defaultProps");
|
|
15
|
-
|
|
16
|
-
var _propTypes = require("./props/propTypes");
|
|
17
|
-
|
|
18
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
|
-
|
|
20
|
-
function Portal(_ref) {
|
|
21
|
-
var children = _ref.children,
|
|
22
|
-
portalId = _ref.portalId;
|
|
23
|
-
var portalPrefix = (0, _Config.getLibraryConfig)("portalPrefix");
|
|
24
|
-
|
|
25
|
-
var getPortalContainerElement = function getPortalContainerElement() {
|
|
26
|
-
var getPortalContainer = (0, _Config.getLibraryConfig)('getPortalContainer');
|
|
27
|
-
|
|
28
|
-
if (getPortalContainer && typeof getPortalContainer === 'function') {
|
|
29
|
-
var portal = getPortalContainer();
|
|
30
|
-
|
|
31
|
-
if (portal) {
|
|
32
|
-
return portal;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
return null;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
var portalDiv = document.querySelector("[data-portal=\"".concat(portalPrefix ? "".concat(portalPrefix) : '').concat(portalId, "\"]")) || getPortalContainerElement() || document.body;
|
|
40
|
-
return /*#__PURE__*/_reactDom["default"].createPortal(children, portalDiv);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
Portal.propTypes = _propTypes.propTypes;
|
|
44
|
-
Portal.defaultProps = _defaultProps.defaultProps;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.propTypes = void 0;
|
|
7
|
-
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
|
|
10
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
-
|
|
12
|
-
var propTypes = {
|
|
13
|
-
children: _propTypes["default"].node,
|
|
14
|
-
portalId: _propTypes["default"].string
|
|
15
|
-
};
|
|
16
|
-
exports.propTypes = propTypes;
|