@zohodesk/components 1.2.37 → 1.2.38
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 +14 -0
- package/es/CheckBox/CheckBox.js +3 -2
- package/es/CheckBox/props/propTypes.js +2 -1
- package/es/DateTime/DateWidget.js +8 -3
- package/es/DateTime/DateWidget.module.css +1 -0
- package/es/DateTime/__tests__/__snapshots__/DateTime.spec.js.snap +3 -3
- package/es/DateTime/__tests__/__snapshots__/DateWidget.spec.js.snap +1 -1
- package/es/DateTime/__tests__/__snapshots__/Time.spec.js.snap +3 -3
- package/es/DropBox/DropBoxElement/DropBoxElement.js +1 -1
- package/es/DropBox/DropBoxPositionMapping.js +142 -0
- package/es/MultiSelect/MultiSelect.js +11 -3
- package/es/MultiSelect/MultiSelect.module.css +4 -0
- package/es/MultiSelect/__tests__/__snapshots__/MultiSelect.spec.js.snap +1 -1
- package/es/MultiSelect/__tests__/__snapshots__/MultiSelectWithAvatar.spec.js.snap +1 -1
- package/es/MultiSelect/props/defaultProps.js +2 -1
- package/es/MultiSelect/props/propTypes.js +4 -1
- package/es/Popup/Popup.js +1 -1
- package/es/Popup/PositionMapping.js +72 -0
- package/es/Select/Select.js +13 -8
- package/es/Select/Select.module.css +3 -0
- package/es/Select/SelectWithIcon.js +24 -4
- package/es/Select/__tests__/__snapshots__/Select.spec.js.snap +1 -1
- package/es/Select/__tests__/__snapshots__/SelectWithIcon.spec.js.snap +1 -1
- package/es/Select/props/defaultProps.js +2 -1
- package/es/Select/props/propTypes.js +6 -1
- package/es/TextBoxIcon/TextBoxIcon.js +3 -2
- package/es/TextBoxIcon/props/propTypes.js +2 -1
- package/es/v1/DropBox/DropBoxElement/DropBoxElement.js +1 -1
- package/es/v1/Popup/Popup.js +1 -1
- package/lib/CheckBox/CheckBox.js +3 -2
- package/lib/CheckBox/props/propTypes.js +2 -1
- package/lib/DateTime/DateWidget.js +11 -4
- package/lib/DateTime/DateWidget.module.css +1 -0
- package/lib/DateTime/__tests__/__snapshots__/DateTime.spec.js.snap +3 -3
- package/lib/DateTime/__tests__/__snapshots__/DateWidget.spec.js.snap +1 -1
- package/lib/DateTime/__tests__/__snapshots__/Time.spec.js.snap +3 -3
- package/lib/DropBox/DropBoxElement/DropBoxElement.js +1 -1
- package/lib/DropBox/DropBoxPositionMapping.js +149 -0
- package/lib/MultiSelect/MultiSelect.js +12 -4
- package/lib/MultiSelect/MultiSelect.module.css +4 -0
- package/lib/MultiSelect/__tests__/__snapshots__/MultiSelect.spec.js.snap +1 -1
- package/lib/MultiSelect/__tests__/__snapshots__/MultiSelectWithAvatar.spec.js.snap +1 -1
- package/lib/MultiSelect/props/defaultProps.js +2 -1
- package/lib/MultiSelect/props/propTypes.js +4 -1
- package/lib/Popup/Popup.js +1 -1
- package/lib/Popup/PositionMapping.js +81 -0
- package/lib/Select/Select.js +14 -9
- package/lib/Select/Select.module.css +3 -0
- package/lib/Select/SelectWithIcon.js +33 -6
- package/lib/Select/__tests__/__snapshots__/Select.spec.js.snap +1 -1
- package/lib/Select/__tests__/__snapshots__/SelectWithIcon.spec.js.snap +1 -1
- package/lib/Select/props/defaultProps.js +1 -1
- package/lib/Select/props/propTypes.js +6 -1
- package/lib/TextBoxIcon/TextBoxIcon.js +3 -2
- package/lib/TextBoxIcon/props/propTypes.js +2 -1
- package/lib/v1/DropBox/DropBoxElement/DropBoxElement.js +1 -1
- package/lib/v1/Popup/Popup.js +1 -1
- package/package.json +1 -1
- package/result.json +1 -1
- package/es/DropBox/DropBoxPositionMapping.json +0 -145
- package/es/Popup/PositionMapping.json +0 -74
- package/lib/DropBox/DropBoxPositionMapping.json +0 -145
- package/lib/Popup/PositionMapping.json +0 -74
|
@@ -45,6 +45,14 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
45
45
|
|
|
46
46
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
47
47
|
|
|
48
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
49
|
+
|
|
50
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
51
|
+
|
|
52
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
53
|
+
|
|
54
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
55
|
+
|
|
48
56
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
49
57
|
|
|
50
58
|
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); } }
|
|
@@ -410,7 +418,8 @@ var SelectWithIcon = /*#__PURE__*/function (_Component) {
|
|
|
410
418
|
i18nKeys = _this$props7.i18nKeys,
|
|
411
419
|
htmlId = _this$props7.htmlId,
|
|
412
420
|
isLoading = _this$props7.isLoading,
|
|
413
|
-
dataSelectorId = _this$props7.dataSelectorId
|
|
421
|
+
dataSelectorId = _this$props7.dataSelectorId,
|
|
422
|
+
customProps = _this$props7.customProps;
|
|
414
423
|
i18nKeys = Object.assign({}, i18nKeys, {
|
|
415
424
|
emptyText: i18nKeys.emptyText || emptyMessage,
|
|
416
425
|
searchEmptyText: i18nKeys.searchEmptyText || searchEmptyMessage
|
|
@@ -422,6 +431,12 @@ var SelectWithIcon = /*#__PURE__*/function (_Component) {
|
|
|
422
431
|
isFetchingOptions = _this$state3.isFetchingOptions;
|
|
423
432
|
var setAriaId = this.getNextAriaId();
|
|
424
433
|
var ariaErrorId = this.getNextAriaId();
|
|
434
|
+
var _customProps$TextBoxP = customProps.TextBoxProps,
|
|
435
|
+
TextBoxProps = _customProps$TextBoxP === void 0 ? {} : _customProps$TextBoxP,
|
|
436
|
+
_customProps$Dropdown = customProps.DropdownSearchTextBoxProps,
|
|
437
|
+
DropdownSearchTextBoxProps = _customProps$Dropdown === void 0 ? {} : _customProps$Dropdown,
|
|
438
|
+
_customProps$TextBoxI = customProps.TextBoxIconProps,
|
|
439
|
+
TextBoxIconProps = _customProps$TextBoxI === void 0 ? {} : _customProps$TextBoxI;
|
|
425
440
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
426
441
|
className: "".concat(_SelectModule["default"].container, " ").concat(_SelectModule["default"]["box_".concat(size)], " ").concat(isReadOnly ? _SelectModule["default"].readonly : '', " ").concat(borderColor === 'transparent' ? _SelectModule["default"].transparentContainer : ''),
|
|
427
442
|
"data-title": isDisabled ? title : null,
|
|
@@ -444,7 +459,7 @@ var SelectWithIcon = /*#__PURE__*/function (_Component) {
|
|
|
444
459
|
dataId: "".concat(dataId, "_icon")
|
|
445
460
|
})) : null, /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
446
461
|
flexible: true
|
|
447
|
-
}, /*#__PURE__*/_react["default"].createElement(_TextBoxIcon["default"], {
|
|
462
|
+
}, /*#__PURE__*/_react["default"].createElement(_TextBoxIcon["default"], _extends({
|
|
448
463
|
a11y: {
|
|
449
464
|
role: 'combobox',
|
|
450
465
|
ariaLabel: 'click to select options',
|
|
@@ -476,10 +491,19 @@ var SelectWithIcon = /*#__PURE__*/function (_Component) {
|
|
|
476
491
|
needEffect: isReadOnly || isDisabled ? false : true,
|
|
477
492
|
borderColor: borderColor,
|
|
478
493
|
autoComplete: false,
|
|
479
|
-
isFocus: isPopupReady
|
|
480
|
-
|
|
494
|
+
isFocus: isPopupReady,
|
|
495
|
+
customProps: {
|
|
496
|
+
TextBoxProps: _objectSpread({
|
|
497
|
+
'data-title': title || selectedValue
|
|
498
|
+
}, TextBoxProps)
|
|
499
|
+
}
|
|
500
|
+
}, TextBoxIconProps), /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
501
|
+
isInline: true,
|
|
502
|
+
isCover: false,
|
|
481
503
|
align: "both",
|
|
482
|
-
dataId: "".concat(dataId, "_downIcon")
|
|
504
|
+
dataId: "".concat(dataId, "_downIcon"),
|
|
505
|
+
alignBox: "both",
|
|
506
|
+
className: _SelectModule["default"].rightPlaceholder
|
|
483
507
|
}, /*#__PURE__*/_react["default"].createElement(_icons.Icon, {
|
|
484
508
|
name: "ZD-down",
|
|
485
509
|
size: "7"
|
|
@@ -528,7 +552,10 @@ var SelectWithIcon = /*#__PURE__*/function (_Component) {
|
|
|
528
552
|
a11y: {
|
|
529
553
|
ariaDescribedby: ariaErrorId
|
|
530
554
|
},
|
|
531
|
-
autoComplete: false
|
|
555
|
+
autoComplete: false,
|
|
556
|
+
customProps: {
|
|
557
|
+
TextBoxProps: DropdownSearchTextBoxProps
|
|
558
|
+
}
|
|
532
559
|
}))) : null, /*#__PURE__*/_react["default"].createElement(_Card.CardContent, {
|
|
533
560
|
customClass: "".concat(tabletMode ? _SelectModule["default"].responsivedropBoxList : _SelectModule["default"].dropBoxList, " ").concat(!tabletMode && dropBoxSize ? _SelectModule["default"][dropBoxSize] : ''),
|
|
534
561
|
shrink: true,
|
|
@@ -62,7 +62,7 @@ exports[`Select rendering the defult props 1`] = `
|
|
|
62
62
|
data-test-id="boxComponent"
|
|
63
63
|
>
|
|
64
64
|
<div
|
|
65
|
-
class="
|
|
65
|
+
class="rightPlaceholder inflex rowdir both"
|
|
66
66
|
data-id="containerComponent"
|
|
67
67
|
data-selector-id="container"
|
|
68
68
|
data-test-id="containerComponent"
|
|
@@ -79,7 +79,7 @@ exports[`SelectWithIcon rendering the defult props 1`] = `
|
|
|
79
79
|
data-test-id="boxComponent"
|
|
80
80
|
>
|
|
81
81
|
<div
|
|
82
|
-
class="
|
|
82
|
+
class="rightPlaceholder inflex both"
|
|
83
83
|
data-id="selectWithIcon_downIcon"
|
|
84
84
|
data-selector-id="container"
|
|
85
85
|
data-test-id="selectWithIcon_downIcon"
|
|
@@ -117,5 +117,5 @@ var SelectWithIcon_defaultProps = (_SelectWithIcon_defau = {
|
|
|
117
117
|
needListBorder: false,
|
|
118
118
|
needSearch: false,
|
|
119
119
|
boxSize: 'default'
|
|
120
|
-
}, _defineProperty(_SelectWithIcon_defau, "needListBorder", false), _defineProperty(_SelectWithIcon_defau, "needCloseOnSelect", true), _defineProperty(_SelectWithIcon_defau, "borderColor", 'default'), _defineProperty(_SelectWithIcon_defau, "needTick", true), _defineProperty(_SelectWithIcon_defau, "searchBoxSize", 'small'), _defineProperty(_SelectWithIcon_defau, "size", 'medium'), _defineProperty(_SelectWithIcon_defau, "textBoxSize", 'medium'), _defineProperty(_SelectWithIcon_defau, "textBoxVariant", 'default'), _defineProperty(_SelectWithIcon_defau, "dataId", 'selectWithIcon'), _defineProperty(_SelectWithIcon_defau, "dataSelectorId", 'selectWithIcon'), _defineProperty(_SelectWithIcon_defau, "dropBoxSize", 'small'), _defineProperty(_SelectWithIcon_defau, "needIcon", true), _defineProperty(_SelectWithIcon_defau, "iconSize", '14'), _defineProperty(_SelectWithIcon_defau, "i18nKeys", {}), _defineProperty(_SelectWithIcon_defau, "isLoading", false), _SelectWithIcon_defau);
|
|
120
|
+
}, _defineProperty(_SelectWithIcon_defau, "needListBorder", false), _defineProperty(_SelectWithIcon_defau, "needCloseOnSelect", true), _defineProperty(_SelectWithIcon_defau, "borderColor", 'default'), _defineProperty(_SelectWithIcon_defau, "needTick", true), _defineProperty(_SelectWithIcon_defau, "searchBoxSize", 'small'), _defineProperty(_SelectWithIcon_defau, "size", 'medium'), _defineProperty(_SelectWithIcon_defau, "textBoxSize", 'medium'), _defineProperty(_SelectWithIcon_defau, "textBoxVariant", 'default'), _defineProperty(_SelectWithIcon_defau, "dataId", 'selectWithIcon'), _defineProperty(_SelectWithIcon_defau, "dataSelectorId", 'selectWithIcon'), _defineProperty(_SelectWithIcon_defau, "dropBoxSize", 'small'), _defineProperty(_SelectWithIcon_defau, "needIcon", true), _defineProperty(_SelectWithIcon_defau, "iconSize", '14'), _defineProperty(_SelectWithIcon_defau, "i18nKeys", {}), _defineProperty(_SelectWithIcon_defau, "isLoading", false), _defineProperty(_SelectWithIcon_defau, "customProps", {}), _SelectWithIcon_defau);
|
|
121
121
|
exports.SelectWithIcon_defaultProps = SelectWithIcon_defaultProps;
|
|
@@ -305,6 +305,11 @@ var SelectWithIcon_propTypes = {
|
|
|
305
305
|
searchBoxSize: _propTypes["default"].string,
|
|
306
306
|
needResponsive: _propTypes["default"].bool,
|
|
307
307
|
boxSize: _propTypes["default"].string,
|
|
308
|
-
emptyMessage: _propTypes["default"].string
|
|
308
|
+
emptyMessage: _propTypes["default"].string,
|
|
309
|
+
customProps: _propTypes["default"].shape({
|
|
310
|
+
TextBoxProps: _propTypes["default"].object,
|
|
311
|
+
DropdownSearchTextBoxProps: _propTypes["default"].object,
|
|
312
|
+
TextBoxIconProps: _propTypes["default"].object
|
|
313
|
+
})
|
|
309
314
|
};
|
|
310
315
|
exports.SelectWithIcon_propTypes = SelectWithIcon_propTypes;
|
|
@@ -148,7 +148,8 @@ var TextBoxIcon = /*#__PURE__*/function (_React$Component) {
|
|
|
148
148
|
isFocus = _this$props2.isFocus,
|
|
149
149
|
onClearMouseDown = _this$props2.onClearMouseDown,
|
|
150
150
|
isScrollPrevent = _this$props2.isScrollPrevent,
|
|
151
|
-
customProps = _this$props2.customProps
|
|
151
|
+
customProps = _this$props2.customProps,
|
|
152
|
+
renderRightPlaceholderNode = _this$props2.renderRightPlaceholderNode;
|
|
152
153
|
var isActive = this.state.isActive;
|
|
153
154
|
var _customClass$customTB = customClass.customTBoxWrap,
|
|
154
155
|
customTBoxWrap = _customClass$customTB === void 0 ? '' : _customClass$customTB,
|
|
@@ -217,7 +218,7 @@ var TextBoxIcon = /*#__PURE__*/function (_React$Component) {
|
|
|
217
218
|
size: "14"
|
|
218
219
|
}))) : null, children ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
219
220
|
className: "".concat(_TextBoxIconModule["default"].icon, " ").concat(iconRotated ? _TextBoxIconModule["default"].rotated : '')
|
|
220
|
-
}, children) : null)), needBorder && /*#__PURE__*/_react["default"].createElement("div", {
|
|
221
|
+
}, children) : null, renderRightPlaceholderNode ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, null, renderRightPlaceholderNode) : null)), needBorder && /*#__PURE__*/_react["default"].createElement("div", {
|
|
221
222
|
className: "".concat(_TextBoxIconModule["default"].line, " ").concat(_TextBoxIconModule["default"]["borderColor_".concat(borderColor)], " ").concat(customTBoxLine)
|
|
222
223
|
}));
|
|
223
224
|
}
|
|
@@ -65,7 +65,8 @@ var propTypes = _objectSpread(_objectSpread({}, _propTypes2.propTypes), {}, {
|
|
|
65
65
|
isScrollPrevent: _propTypes["default"].bool,
|
|
66
66
|
customProps: _propTypes["default"].shape({
|
|
67
67
|
TextBoxProps: _propTypes["default"].object
|
|
68
|
-
})
|
|
68
|
+
}),
|
|
69
|
+
renderRightPlaceholderNode: _propTypes["default"].node
|
|
69
70
|
});
|
|
70
71
|
|
|
71
72
|
exports.propTypes = propTypes;
|
|
@@ -11,7 +11,7 @@ var _useDropboxPosCalc2 = _interopRequireDefault(require("../../../DropBox/DropB
|
|
|
11
11
|
|
|
12
12
|
var _cssJSLogic2 = _interopRequireDefault(require("../../../DropBox/DropBoxElement/css/cssJSLogic"));
|
|
13
13
|
|
|
14
|
-
var _DropBoxPositionMapping = require("../../../DropBox/DropBoxPositionMapping.
|
|
14
|
+
var _DropBoxPositionMapping = require("../../../DropBox/DropBoxPositionMapping.js");
|
|
15
15
|
|
|
16
16
|
var _defaultProps = require("./props/defaultProps");
|
|
17
17
|
|
package/lib/v1/Popup/Popup.js
CHANGED
|
@@ -17,7 +17,7 @@ var _Common = require("../../utils/Common.js");
|
|
|
17
17
|
|
|
18
18
|
var _viewPort = _interopRequireDefault(require("../../Popup/viewPort"));
|
|
19
19
|
|
|
20
|
-
var _PositionMapping = require("../../Popup/PositionMapping.
|
|
20
|
+
var _PositionMapping = require("../../Popup/PositionMapping.js");
|
|
21
21
|
|
|
22
22
|
var _ResizeObserver = _interopRequireDefault(require("@zohodesk/virtualizer/lib/commons/ResizeObserver.js"));
|
|
23
23
|
|