@zohodesk/components 1.0.0-temp-179 → 1.0.0-temp-181
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/PropLessFiles.html +1 -1
- package/.cli/PropUnificationExcludeFilesArray.js +231 -0
- package/.cli/PropValidationExcludeFilesArray.js +1 -1
- package/.cli/propValidation_report.html +24 -2
- package/PropValidationExcludeFilesArray.js +1 -0
- package/README.md +1363 -1357
- package/css_error.log +1 -1
- package/es/AppContainer/AppContainer.module.css +18 -18
- package/es/Avatar/Avatar.js +9 -9
- package/es/Avatar/Avatar.module.css +187 -187
- package/es/Avatar/__tests__/__snapshots__/Avatar.spec.js.snap +591 -591
- package/es/AvatarTeam/AvatarTeam.js +7 -7
- package/es/AvatarTeam/AvatarTeam.module.css +191 -191
- package/es/AvatarTeam/__tests__/__snapshots__/AvatarTeam.spec.js.snap +704 -704
- package/es/Button/Button.js +4 -4
- package/es/Button/__tests__/__snapshots__/Button.spec.js.snap +440 -440
- package/es/Button/css/Button.module.css +533 -533
- package/es/Buttongroup/Buttongroup.js +1 -1
- package/es/Buttongroup/Buttongroup.module.css +107 -107
- package/es/Buttongroup/__tests__/__snapshots__/Buttongroup.spec.js.snap +191 -191
- package/es/Card/Card.js +4 -4
- package/es/Card/Card.module.css +20 -20
- package/es/CheckBox/CheckBox.js +0 -0
- package/es/CheckBox/CheckBox.module.css +159 -159
- package/es/DateTime/CalendarView.js +0 -0
- package/es/DateTime/DateTime.js +0 -0
- package/es/DateTime/DateTime.module.css +249 -249
- package/es/DateTime/DateWidget.js +0 -0
- package/es/DateTime/DateWidget.module.css +38 -38
- package/es/DateTime/YearView.js +0 -0
- package/es/DateTime/YearView.module.css +98 -98
- package/es/DateTime/common.js +0 -0
- package/es/DateTime/dateFormatUtils/dateFormat.js +6 -1
- package/es/DateTime/index.js +0 -0
- package/es/DateTime/objectUtils.js +0 -0
- package/es/DateTime/typeChecker.js +0 -0
- package/es/DateTime/validator.js +0 -0
- package/es/DropBox/DropBox.js +0 -0
- package/es/DropBox/DropBoxElement/css/DropBoxElement.module.css +441 -441
- package/es/DropBox/DropBoxPositionMapping.json +144 -144
- package/es/DropBox/css/DropBox.module.css +59 -59
- package/es/DropDown/DropDown.js +0 -0
- package/es/DropDown/DropDown.module.css +5 -5
- package/es/DropDown/DropDownHeading.js +0 -0
- package/es/DropDown/DropDownHeading.module.css +59 -59
- package/es/DropDown/DropDownItem.js +0 -0
- package/es/DropDown/DropDownItem.module.css +97 -97
- package/es/DropDown/DropDownSearch.js +0 -0
- package/es/DropDown/DropDownSearch.module.css +14 -14
- package/es/DropDown/DropDownSeparator.js +0 -0
- package/es/DropDown/DropDownSeparator.module.css +7 -7
- package/es/Heading/Heading.module.css +4 -4
- package/es/Label/Label.js +2 -2
- package/es/Label/Label.module.css +53 -53
- package/es/Label/LabelColors.module.css +20 -20
- package/es/Label/__tests__/__snapshots__/Label.spec.js.snap +312 -312
- package/es/Layout/Box.js +0 -0
- package/es/Layout/Container.js +0 -0
- package/es/Layout/Layout.module.css +335 -335
- package/es/Layout/utils.js +0 -0
- package/es/ListItem/ListItem.js +0 -0
- package/es/ListItem/ListItem.module.css +237 -237
- package/es/MultiSelect/AdvancedGroupMultiSelect.js +5 -5
- package/es/MultiSelect/MobileHeader/MobileHeader.module.css +16 -16
- package/es/MultiSelect/MultiSelect.js +5 -5
- package/es/MultiSelect/MultiSelect.module.css +204 -204
- package/es/MultiSelect/MultiSelectWithAvatar.js +0 -0
- package/es/MultiSelect/SelectedOptions.module.css +15 -15
- package/es/PopOver/PopOver.module.css +9 -9
- package/es/Popup/Popup.js +0 -0
- package/es/Popup/PositionMapping.json +73 -73
- package/es/Radio/Radio.js +0 -0
- package/es/Radio/Radio.module.css +113 -113
- package/es/Radio/__tests__/__snapshots__/Radio.spec.js.snap +1837 -1837
- package/es/Responsive/CustomResponsive.js +0 -0
- package/es/ResponsiveDropBox/ResponsiveDropBox.module.css +6 -6
- package/es/Ribbon/Ribbon.js +0 -0
- package/es/Ribbon/Ribbon.module.css +458 -458
- package/es/Ribbon/__tests__/__snapshots__/Ribbon.spec.js.snap +374 -374
- package/es/RippleEffect/RippleEffect.module.css +92 -92
- package/es/RippleEffect/__tests__/__snapshots__/RippleEffect.spec.js.snap +171 -171
- package/es/Select/GroupSelect.js +0 -0
- package/es/Select/Select.js +0 -0
- package/es/Select/Select.module.css +108 -108
- package/es/Select/SelectWithAvatar.js +0 -0
- package/es/Select/SelectWithIcon.js +0 -0
- package/es/Stencils/Stencils.js +0 -0
- package/es/Stencils/Stencils.module.css +96 -96
- package/es/Stencils/__tests__/__snapshots__/Stencils.spec.js.snap +89 -89
- package/es/Switch/Switch.js +0 -0
- package/es/Switch/Switch.module.css +129 -129
- package/es/Switch/__tests__/__snapshots__/Switch.spec.js.snap +831 -831
- package/es/Tab/Tab.module.css +100 -100
- package/es/Tab/TabContent.module.css +4 -4
- package/es/Tab/Tabs.js +17 -17
- package/es/Tab/Tabs.module.css +136 -136
- package/es/Tag/Tag.js +8 -8
- package/es/Tag/Tag.module.css +260 -260
- package/es/TextBox/TextBox.js +0 -0
- package/es/TextBox/TextBox.module.css +178 -178
- package/es/TextBoxIcon/TextBoxIcon.js +0 -0
- package/es/TextBoxIcon/TextBoxIcon.module.css +84 -84
- package/es/Textarea/Textarea.js +0 -0
- package/es/Textarea/Textarea.module.css +145 -145
- package/es/Tooltip/Tooltip.module.css +144 -144
- package/es/common/a11y.module.css +3 -3
- package/es/common/animation.module.css +624 -624
- package/es/common/avatarsizes.module.css +48 -48
- package/es/common/basic.module.css +33 -33
- package/es/common/basicReset.module.css +40 -40
- package/es/common/boxShadow.module.css +33 -33
- package/es/common/common.module.css +524 -524
- package/es/common/customscroll.module.css +128 -128
- package/es/common/reset.module.css +13 -13
- package/es/common/transition.module.css +146 -146
- package/es/semantic/Button/semanticButton.module.css +9 -9
- package/es/utils/Common.js +0 -0
- package/es/utils/dropDownUtils.js +0 -0
- package/es/v1/Avatar/Avatar.js +5 -5
- package/es/v1/AvatarTeam/AvatarTeam.js +4 -4
- package/es/v1/Button/Button.js +4 -4
- package/es/v1/Card/Card.js +4 -4
- package/es/v1/CheckBox/CheckBox.js +0 -0
- package/es/v1/DateTime/DateTime.js +0 -0
- package/es/v1/DateTime/DateWidget.js +0 -0
- package/es/v1/DateTime/YearView.js +0 -0
- package/es/v1/DateTime/index.js +0 -0
- package/es/v1/DropBox/DropBox.js +0 -0
- package/es/v1/DropDown/DropDown.js +0 -0
- package/es/v1/DropDown/DropDownHeading.js +0 -0
- package/es/v1/DropDown/DropDownItem.js +0 -0
- package/es/v1/DropDown/DropDownSearch.js +0 -0
- package/es/v1/DropDown/DropDownSeparator.js +0 -0
- package/es/v1/Layout/Box.js +0 -0
- package/es/v1/Layout/Container.js +0 -0
- package/es/v1/ListItem/ListItem.js +0 -0
- package/es/v1/Modal/Modal.js +86 -114
- package/es/v1/MultiSelect/AdvancedGroupMultiSelect.js +5 -5
- package/es/v1/MultiSelect/MultiSelect.js +5 -5
- package/es/v1/MultiSelect/MultiSelectWithAvatar.js +0 -0
- package/es/v1/Radio/Radio.js +0 -0
- package/es/v1/Responsive/CustomResponsive.js +0 -0
- package/es/v1/Select/GroupSelect.js +0 -0
- package/es/v1/Select/Select.js +0 -0
- package/es/v1/Select/SelectWithAvatar.js +0 -0
- package/es/v1/Select/SelectWithIcon.js +0 -0
- package/es/v1/Switch/Switch.js +0 -0
- package/es/v1/Tab/Tabs.js +17 -17
- package/es/v1/Tag/Tag.js +8 -8
- package/es/v1/TextBox/TextBox.js +0 -0
- package/es/v1/Typography/css/Typography.module.css +380 -409
- package/es/v1/Typography/css/cssJSLogic.js +6 -2
- package/es/v1/Typography/props/propTypes.js +2 -2
- package/es/v1/Typography/utils/index.js +50 -0
- package/install.md +10 -10
- package/lib/AppContainer/AppContainer.module.css +18 -18
- package/lib/Avatar/Avatar.js +9 -9
- package/lib/Avatar/Avatar.module.css +187 -187
- package/lib/Avatar/__tests__/__snapshots__/Avatar.spec.js.snap +591 -591
- package/lib/AvatarTeam/AvatarTeam.js +7 -7
- package/lib/AvatarTeam/AvatarTeam.module.css +191 -191
- package/lib/AvatarTeam/__tests__/__snapshots__/AvatarTeam.spec.js.snap +704 -704
- package/lib/Button/Button.js +4 -4
- package/lib/Button/__tests__/__snapshots__/Button.spec.js.snap +440 -440
- package/lib/Button/css/Button.module.css +533 -533
- package/lib/Buttongroup/Buttongroup.js +1 -1
- package/lib/Buttongroup/Buttongroup.module.css +107 -107
- package/lib/Buttongroup/__tests__/__snapshots__/Buttongroup.spec.js.snap +191 -191
- package/lib/Card/Card.js +4 -4
- package/lib/Card/Card.module.css +20 -20
- package/lib/CheckBox/CheckBox.js +0 -0
- package/lib/CheckBox/CheckBox.module.css +159 -159
- package/lib/DateTime/CalendarView.js +0 -0
- package/lib/DateTime/DateTime.js +0 -0
- package/lib/DateTime/DateTime.module.css +249 -249
- package/lib/DateTime/DateWidget.js +0 -0
- package/lib/DateTime/DateWidget.module.css +38 -38
- package/lib/DateTime/YearView.js +0 -0
- package/lib/DateTime/YearView.module.css +98 -98
- package/lib/DateTime/common.js +0 -0
- package/lib/DateTime/dateFormatUtils/dateFormat.js +6 -1
- package/lib/DateTime/index.js +0 -0
- package/lib/DateTime/objectUtils.js +0 -0
- package/lib/DateTime/typeChecker.js +0 -0
- package/lib/DateTime/validator.js +0 -0
- package/lib/DropBox/DropBox.js +0 -0
- package/lib/DropBox/DropBoxElement/css/DropBoxElement.module.css +441 -441
- package/lib/DropBox/DropBoxPositionMapping.json +144 -144
- package/lib/DropBox/css/DropBox.module.css +59 -59
- package/lib/DropDown/DropDown.js +0 -0
- package/lib/DropDown/DropDown.module.css +5 -5
- package/lib/DropDown/DropDownHeading.js +0 -0
- package/lib/DropDown/DropDownHeading.module.css +59 -59
- package/lib/DropDown/DropDownItem.js +0 -0
- package/lib/DropDown/DropDownItem.module.css +97 -97
- package/lib/DropDown/DropDownSearch.js +0 -0
- package/lib/DropDown/DropDownSearch.module.css +14 -14
- package/lib/DropDown/DropDownSeparator.js +0 -0
- package/lib/DropDown/DropDownSeparator.module.css +7 -7
- package/lib/Heading/Heading.module.css +4 -4
- package/lib/Label/Label.js +0 -0
- package/lib/Label/Label.module.css +53 -53
- package/lib/Label/LabelColors.module.css +20 -20
- package/lib/Label/__tests__/__snapshots__/Label.spec.js.snap +312 -312
- package/lib/Layout/Box.js +0 -0
- package/lib/Layout/Container.js +0 -0
- package/lib/Layout/Layout.module.css +335 -335
- package/lib/Layout/utils.js +0 -0
- package/lib/ListItem/ListItem.js +0 -0
- package/lib/ListItem/ListItem.module.css +237 -237
- package/lib/MultiSelect/AdvancedGroupMultiSelect.js +5 -5
- package/lib/MultiSelect/MobileHeader/MobileHeader.module.css +16 -16
- package/lib/MultiSelect/MultiSelect.js +5 -5
- package/lib/MultiSelect/MultiSelect.module.css +204 -204
- package/lib/MultiSelect/MultiSelectWithAvatar.js +0 -0
- package/lib/MultiSelect/SelectedOptions.module.css +15 -15
- package/lib/PopOver/PopOver.module.css +9 -9
- package/lib/Popup/Popup.js +0 -0
- package/lib/Popup/PositionMapping.json +73 -73
- package/lib/Radio/Radio.js +0 -0
- package/lib/Radio/Radio.module.css +113 -113
- package/lib/Radio/__tests__/__snapshots__/Radio.spec.js.snap +1837 -1837
- package/lib/Responsive/CustomResponsive.js +0 -0
- package/lib/ResponsiveDropBox/ResponsiveDropBox.module.css +6 -6
- package/lib/Ribbon/Ribbon.js +0 -0
- package/lib/Ribbon/Ribbon.module.css +458 -458
- package/lib/Ribbon/__tests__/__snapshots__/Ribbon.spec.js.snap +374 -374
- package/lib/RippleEffect/RippleEffect.module.css +92 -92
- package/lib/RippleEffect/__tests__/__snapshots__/RippleEffect.spec.js.snap +171 -171
- package/lib/Select/GroupSelect.js +0 -0
- package/lib/Select/Select.js +0 -0
- package/lib/Select/Select.module.css +108 -108
- package/lib/Select/SelectWithAvatar.js +0 -0
- package/lib/Select/SelectWithIcon.js +0 -0
- package/lib/Stencils/Stencils.js +0 -0
- package/lib/Stencils/Stencils.module.css +96 -96
- package/lib/Stencils/__tests__/__snapshots__/Stencils.spec.js.snap +89 -89
- package/lib/Switch/Switch.js +0 -0
- package/lib/Switch/Switch.module.css +129 -129
- package/lib/Switch/__tests__/__snapshots__/Switch.spec.js.snap +831 -831
- package/lib/Tab/Tab.module.css +100 -100
- package/lib/Tab/TabContent.module.css +4 -4
- package/lib/Tab/Tabs.js +11 -11
- package/lib/Tab/Tabs.module.css +136 -136
- package/lib/Tag/Tag.js +8 -8
- package/lib/Tag/Tag.module.css +260 -260
- package/lib/TextBox/TextBox.js +0 -0
- package/lib/TextBox/TextBox.module.css +178 -178
- package/lib/TextBoxIcon/TextBoxIcon.js +0 -0
- package/lib/TextBoxIcon/TextBoxIcon.module.css +84 -84
- package/lib/Textarea/Textarea.js +0 -0
- package/lib/Textarea/Textarea.module.css +145 -145
- package/lib/Tooltip/Tooltip.module.css +144 -144
- package/lib/common/a11y.module.css +3 -3
- package/lib/common/animation.module.css +624 -624
- package/lib/common/avatarsizes.module.css +48 -48
- package/lib/common/basic.module.css +33 -33
- package/lib/common/basicReset.module.css +40 -40
- package/lib/common/boxShadow.module.css +33 -33
- package/lib/common/common.module.css +524 -524
- package/lib/common/customscroll.module.css +128 -128
- package/lib/common/reset.module.css +13 -13
- package/lib/common/transition.module.css +146 -146
- package/lib/semantic/Button/semanticButton.module.css +9 -9
- package/lib/utils/Common.js +0 -0
- package/lib/utils/dropDownUtils.js +0 -0
- package/lib/v1/Avatar/Avatar.js +5 -5
- package/lib/v1/AvatarTeam/AvatarTeam.js +4 -4
- package/lib/v1/Button/Button.js +4 -4
- package/lib/v1/Card/Card.js +4 -4
- package/lib/v1/CheckBox/CheckBox.js +0 -0
- package/lib/v1/DateTime/DateTime.js +0 -0
- package/lib/v1/DateTime/DateWidget.js +0 -0
- package/lib/v1/DateTime/YearView.js +0 -0
- package/lib/v1/DateTime/index.js +0 -0
- package/lib/v1/DropBox/DropBox.js +0 -0
- package/lib/v1/DropDown/DropDown.js +0 -0
- package/lib/v1/DropDown/DropDownHeading.js +0 -0
- package/lib/v1/DropDown/DropDownItem.js +0 -0
- package/lib/v1/DropDown/DropDownSearch.js +0 -0
- package/lib/v1/DropDown/DropDownSeparator.js +0 -0
- package/lib/v1/Layout/Box.js +0 -0
- package/lib/v1/Layout/Container.js +0 -0
- package/lib/v1/ListItem/ListItem.js +0 -0
- package/lib/v1/Modal/Modal.js +118 -164
- package/lib/v1/MultiSelect/AdvancedGroupMultiSelect.js +5 -5
- package/lib/v1/MultiSelect/MultiSelect.js +5 -5
- package/lib/v1/MultiSelect/MultiSelectWithAvatar.js +0 -0
- package/lib/v1/Radio/Radio.js +0 -0
- package/lib/v1/Responsive/CustomResponsive.js +0 -0
- package/lib/v1/Select/GroupSelect.js +0 -0
- package/lib/v1/Select/Select.js +0 -0
- package/lib/v1/Select/SelectWithAvatar.js +0 -0
- package/lib/v1/Select/SelectWithIcon.js +0 -0
- package/lib/v1/Switch/Switch.js +0 -0
- package/lib/v1/Tab/Tabs.js +11 -11
- package/lib/v1/Tag/Tag.js +8 -8
- package/lib/v1/TextBox/TextBox.js +0 -0
- package/lib/v1/Typography/css/Typography.module.css +380 -409
- package/lib/v1/Typography/css/cssJSLogic.js +7 -3
- package/lib/v1/Typography/props/propTypes.js +2 -2
- package/lib/v1/Typography/utils/index.js +59 -0
- package/package.json +95 -95
- package/postPublish.js +8 -8
- package/prePublish.js +70 -70
- package/propValidationArg.json +8 -0
- package/react-cli.config.js +23 -23
- package/result.json +1 -1
- package/es/v1/Typography/css/letterSpacingMap.js +0 -12
- package/lib/v1/Typography/css/letterSpacingMap.js +0 -20
package/es/v1/DateTime/index.js
CHANGED
|
File without changes
|
package/es/v1/DropBox/DropBox.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/es/v1/Layout/Box.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/es/v1/Modal/Modal.js
CHANGED
|
@@ -1,154 +1,126 @@
|
|
|
1
1
|
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); }
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
import React from 'react';
|
|
3
|
+
import React, { useState, useRef, useEffect, useCallback } from 'react';
|
|
5
4
|
import ReactDOM from 'react-dom';
|
|
5
|
+
import useEffectCallOnlyAfterState from '@zohodesk/hooks/es/utils/useEffectCallOnlyAfterState';
|
|
6
6
|
import { defaultProps } from '../../Modal/props/defaultProps';
|
|
7
7
|
import { propTypes } from '../../Modal/props/propTypes';
|
|
8
8
|
import style from '../../AppContainer/AppContainer.module.css';
|
|
9
9
|
let createdPortalIds = [];
|
|
10
10
|
let newPortalPrefix = 'CPortal';
|
|
11
11
|
let portalChildrenTopIndexValues;
|
|
12
|
-
export default
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
12
|
+
export default function Modal(props) {
|
|
13
|
+
let {
|
|
14
|
+
children,
|
|
15
|
+
isActive,
|
|
16
|
+
autoZIndexNeeded,
|
|
17
|
+
portalId: propPortalId
|
|
18
|
+
} = props;
|
|
19
|
+
const [isMounted, setMounted] = useState(false);
|
|
20
|
+
const portalId = useRef(propPortalId);
|
|
21
|
+
const ref = useRef(null);
|
|
22
|
+
const isZIndexAppendNeeded = useRef();
|
|
23
|
+
const zIndex = useRef();
|
|
24
|
+
const modalRoot = useRef();
|
|
25
|
+
const newModalRoot = useRef();
|
|
26
|
+
const containerDiv = useRef();
|
|
27
|
+
const portalDiv = useRef(); // document.createDocumentFragment()
|
|
28
|
+
|
|
29
|
+
const isCustomPortalId = useRef();
|
|
30
|
+
const setRef = useCallback(ele => {
|
|
31
|
+
ref.current = ele;
|
|
32
|
+
|
|
33
|
+
if (isZIndexAppendNeeded.current) {
|
|
34
|
+
ref.current.style.zIndex = zIndex.current;
|
|
35
|
+
isZIndexAppendNeeded.current = false;
|
|
33
36
|
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
getPortalDiv() {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
if (!
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
37
|
+
}, []);
|
|
38
|
+
|
|
39
|
+
function getPortalDiv() {
|
|
40
|
+
modalRoot.current = propPortalId ? document.querySelector(`[data-portal=${propPortalId}]`) : "";
|
|
41
|
+
|
|
42
|
+
if (!modalRoot.current) {
|
|
43
|
+
portalId.current = handleAddPortalId();
|
|
44
|
+
newModalRoot.current = document.createElement('div');
|
|
45
|
+
newModalRoot.current.className = style.container;
|
|
46
|
+
newModalRoot.current.setAttribute('data-portal', portalId.current);
|
|
47
|
+
containerDiv.current && containerDiv.current.appendChild(newModalRoot.current);
|
|
48
|
+
modalRoot.current = newModalRoot.current;
|
|
46
49
|
}
|
|
47
50
|
|
|
48
|
-
return
|
|
51
|
+
return modalRoot.current;
|
|
49
52
|
}
|
|
50
53
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
this.handleInsertPortalDiv();
|
|
54
|
+
useEffect(() => {
|
|
55
|
+
containerDiv.current = document.getElementsByTagName("desk")[0] ? document.getElementsByTagName('desk')[0] : document.getElementsByTagName('body')[0];
|
|
56
|
+
portalDiv.current = getPortalDiv();
|
|
57
|
+
setMounted(true);
|
|
58
|
+
setTimeout(() => {
|
|
59
|
+
handleInsertPortalDiv();
|
|
58
60
|
});
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
this.handleRemovePortalId();
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
if (this.zIndex && portalChildrenTopIndexValues === this.zIndex) {
|
|
69
|
-
portalChildrenTopIndexValues -= 1;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
61
|
+
return () => {
|
|
62
|
+
// modalRoot.current && modalRoot.current.removeChild(portalDiv.current);
|
|
63
|
+
if (newModalRoot.current) {
|
|
64
|
+
containerDiv.current && containerDiv.current.removeChild(newModalRoot.current);
|
|
65
|
+
handleRemovePortalId();
|
|
66
|
+
}
|
|
72
67
|
|
|
73
|
-
|
|
74
|
-
if (prevProps.isActive != this.props.isActive) {
|
|
75
|
-
if (this.props.isActive) {
|
|
76
|
-
this.handleInsertPortalDiv();
|
|
77
|
-
} else if (this.zIndex && portalChildrenTopIndexValues === this.zIndex) {
|
|
68
|
+
if (zIndex.current && portalChildrenTopIndexValues === zIndex.current) {
|
|
78
69
|
portalChildrenTopIndexValues -= 1;
|
|
79
70
|
}
|
|
71
|
+
};
|
|
72
|
+
}, []);
|
|
73
|
+
useEffectCallOnlyAfterState(() => {
|
|
74
|
+
if (isActive) {
|
|
75
|
+
handleInsertPortalDiv();
|
|
76
|
+
} else if (zIndex.current && portalChildrenTopIndexValues === zIndex.current) {
|
|
77
|
+
portalChildrenTopIndexValues -= 1;
|
|
80
78
|
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
handleInsertPortalDiv() {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
if (isActive) {
|
|
94
|
-
let newHighValue = Number(portalChildrenTopIndexValues || 10) + 1;
|
|
95
|
-
portalChildrenTopIndexValues = newHighValue;
|
|
96
|
-
this.zIndex = newHighValue;
|
|
97
|
-
|
|
98
|
-
if (this.ref) {
|
|
99
|
-
this.ref.style.zIndex = newHighValue;
|
|
100
|
-
} else {
|
|
101
|
-
this.isZIndexAppendNeeded = true;
|
|
102
|
-
}
|
|
79
|
+
}, [isActive]);
|
|
80
|
+
|
|
81
|
+
function handleInsertPortalDiv() {
|
|
82
|
+
if (autoZIndexNeeded && isActive) {
|
|
83
|
+
let newHighValue = Number(portalChildrenTopIndexValues || 10) + 1;
|
|
84
|
+
portalChildrenTopIndexValues = newHighValue;
|
|
85
|
+
zIndex.current = newHighValue;
|
|
86
|
+
|
|
87
|
+
if (ref.current) {
|
|
88
|
+
ref.current.style.zIndex = newHighValue;
|
|
89
|
+
} else {
|
|
90
|
+
isZIndexAppendNeeded.current = true;
|
|
103
91
|
}
|
|
104
92
|
}
|
|
105
93
|
}
|
|
106
94
|
|
|
107
|
-
handleAddPortalId() {
|
|
95
|
+
function handleAddPortalId() {
|
|
108
96
|
let createdPortalIdsLen = createdPortalIds.length;
|
|
109
97
|
let newPortalId = createdPortalIdsLen ? createdPortalIds[createdPortalIdsLen - 1] + 1 : 1;
|
|
110
98
|
createdPortalIds.push(newPortalId);
|
|
111
|
-
|
|
112
|
-
|
|
99
|
+
portalId.current = newPortalId;
|
|
100
|
+
isCustomPortalId.current = true;
|
|
113
101
|
return `${newPortalPrefix}${newPortalId}`;
|
|
114
102
|
}
|
|
115
103
|
|
|
116
|
-
handleRemovePortalId() {
|
|
117
|
-
if (
|
|
118
|
-
createdPortalIds = createdPortalIds.filter(id => id !==
|
|
104
|
+
function handleRemovePortalId() {
|
|
105
|
+
if (isCustomPortalId.current) {
|
|
106
|
+
createdPortalIds = createdPortalIds.filter(id => id !== portalId.current);
|
|
119
107
|
}
|
|
120
108
|
}
|
|
121
109
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
children
|
|
125
|
-
} = this.props,
|
|
126
|
-
{
|
|
127
|
-
isMounted
|
|
128
|
-
} = this.state;
|
|
129
|
-
let Element = children.type,
|
|
130
|
-
elementProps = children.props;
|
|
131
|
-
|
|
132
|
-
if (isMounted) {
|
|
133
|
-
if (Element) {
|
|
134
|
-
return /*#__PURE__*/ReactDOM.createPortal( /*#__PURE__*/React.createElement(Element, _extends({
|
|
135
|
-
ref: this.setRef
|
|
136
|
-
}, elementProps)), this.portalDiv);
|
|
137
|
-
}
|
|
110
|
+
let Element = children.type,
|
|
111
|
+
elementProps = children.props;
|
|
138
112
|
|
|
139
|
-
|
|
113
|
+
if (isMounted) {
|
|
114
|
+
if (Element) {
|
|
115
|
+
return /*#__PURE__*/ReactDOM.createPortal( /*#__PURE__*/React.createElement(Element, _extends({
|
|
116
|
+
ref: setRef
|
|
117
|
+
}, elementProps)), portalDiv.current);
|
|
140
118
|
}
|
|
141
119
|
|
|
142
120
|
return null;
|
|
143
121
|
}
|
|
144
122
|
|
|
123
|
+
return null;
|
|
145
124
|
}
|
|
146
125
|
Modal.defaultProps = defaultProps;
|
|
147
|
-
Modal.propTypes = propTypes;
|
|
148
|
-
// Modal.docs = {
|
|
149
|
-
// componentGroup: 'Atom',
|
|
150
|
-
// folderName: 'Style Guide',
|
|
151
|
-
// external: false,
|
|
152
|
-
// description: ' '
|
|
153
|
-
// };
|
|
154
|
-
// }
|
|
126
|
+
Modal.propTypes = propTypes;
|
|
@@ -409,8 +409,8 @@ class AdvancedGroupMultiSelect extends React.Component {
|
|
|
409
409
|
if (suggestionsLen && isPopupOpen && keyCode === 38) {
|
|
410
410
|
//up arrow
|
|
411
411
|
|
|
412
|
-
/*if (hoverOption === 0) { //disable first to last option higlight
|
|
413
|
-
!isNextOptions && this.setState({ hoverOption: suggestionsLen - 1 });
|
|
412
|
+
/*if (hoverOption === 0) { //disable first to last option higlight
|
|
413
|
+
!isNextOptions && this.setState({ hoverOption: suggestionsLen - 1 });
|
|
414
414
|
}*/
|
|
415
415
|
if (hoverIndex) {
|
|
416
416
|
this.setState({
|
|
@@ -420,9 +420,9 @@ class AdvancedGroupMultiSelect extends React.Component {
|
|
|
420
420
|
} else if (suggestionsLen && isPopupOpen && keyCode === 40) {
|
|
421
421
|
//down arrow
|
|
422
422
|
|
|
423
|
-
/*else if (hoverOption === suggestionsLen - 1 || hoverOption === null) {
|
|
424
|
-
//disable last to first option higlight
|
|
425
|
-
!isNextOptions && this.setState({ hoverOption: 0 });
|
|
423
|
+
/*else if (hoverOption === suggestionsLen - 1 || hoverOption === null) {
|
|
424
|
+
//disable last to first option higlight
|
|
425
|
+
!isNextOptions && this.setState({ hoverOption: 0 });
|
|
426
426
|
}*/
|
|
427
427
|
if (isNextOptions && suggestionsLen >= 5 && hoverIndex === suggestionsLen - 3) {
|
|
428
428
|
getNextOptions && this.handleFetchOptions(getNextOptions, searchStr);
|
|
@@ -321,8 +321,8 @@ export class MultiSelectComponent extends React.Component {
|
|
|
321
321
|
if (suggestionsLen && isPopupOpen && keyCode === 38) {
|
|
322
322
|
//up arrow
|
|
323
323
|
|
|
324
|
-
/*if (hoverOption === 0) { //disable first to last option higlight
|
|
325
|
-
!isNextOptions && this.setState({ hoverOption: suggestionsLen - 1 });
|
|
324
|
+
/*if (hoverOption === 0) { //disable first to last option higlight
|
|
325
|
+
!isNextOptions && this.setState({ hoverOption: suggestionsLen - 1 });
|
|
326
326
|
}*/
|
|
327
327
|
if (hoverOption) {
|
|
328
328
|
this.setState({
|
|
@@ -332,9 +332,9 @@ export class MultiSelectComponent extends React.Component {
|
|
|
332
332
|
} else if (suggestionsLen && isPopupOpen && keyCode === 40) {
|
|
333
333
|
//down arrow
|
|
334
334
|
|
|
335
|
-
/*else if (hoverOption === suggestionsLen - 1 || hoverOption === null) {
|
|
336
|
-
//disable last to first option higlight
|
|
337
|
-
!isNextOptions && this.setState({ hoverOption: 0 });
|
|
335
|
+
/*else if (hoverOption === suggestionsLen - 1 || hoverOption === null) {
|
|
336
|
+
//disable last to first option higlight
|
|
337
|
+
!isNextOptions && this.setState({ hoverOption: 0 });
|
|
338
338
|
}*/
|
|
339
339
|
if (isNextOptions && suggestionsLen >= 5 && hoverOption === suggestionsLen - 3) {
|
|
340
340
|
getNextOptions && this.handleFetchOptions(getNextOptions, searchStr);
|
|
File without changes
|
package/es/v1/Radio/Radio.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/es/v1/Select/Select.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/es/v1/Switch/Switch.js
CHANGED
|
File without changes
|
package/es/v1/Tab/Tabs.js
CHANGED
|
@@ -2,12 +2,12 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
2
2
|
|
|
3
3
|
/* eslint-disable react/forbid-component-props */
|
|
4
4
|
|
|
5
|
-
/* eslint css-modules/no-unused-class: [2, {
|
|
6
|
-
markAsUsed: [
|
|
7
|
-
'hidden','alpha','gamma','beta','delta','special','text','maxWidth','widgetList','menuContainer','border','tabText','block','tabAlpha','alphaActive','gammaActive','betaActive','deltaActive','tabGamma','tabBeta','tabDelta','specialActive','tabSpecial',
|
|
8
|
-
'alpha_padding','alpha_border','gamma_padding','gamma_border','beta_padding','beta_border','delta_padding','delta_border','textContainer','disabled','alphaActive_border','gammaActive_border','betaActive_border','deltaActive_border'
|
|
9
|
-
]
|
|
10
|
-
}]
|
|
5
|
+
/* eslint css-modules/no-unused-class: [2, {
|
|
6
|
+
markAsUsed: [
|
|
7
|
+
'hidden','alpha','gamma','beta','delta','special','text','maxWidth','widgetList','menuContainer','border','tabText','block','tabAlpha','alphaActive','gammaActive','betaActive','deltaActive','tabGamma','tabBeta','tabDelta','specialActive','tabSpecial',
|
|
8
|
+
'alpha_padding','alpha_border','gamma_padding','gamma_border','beta_padding','beta_border','delta_padding','delta_border','textContainer','disabled','alphaActive_border','gammaActive_border','betaActive_border','deltaActive_border'
|
|
9
|
+
]
|
|
10
|
+
}]
|
|
11
11
|
*/
|
|
12
12
|
import React from 'react';
|
|
13
13
|
import Tab from './Tab';
|
|
@@ -141,9 +141,9 @@ class Tabs extends React.Component {
|
|
|
141
141
|
} = this.state;
|
|
142
142
|
|
|
143
143
|
if (prevProps.children && children) {
|
|
144
|
-
/**
|
|
145
|
-
* To recalculate the dimensions of tabs we are checking the children length.
|
|
146
|
-
* and also checking the tab id and their order.
|
|
144
|
+
/**
|
|
145
|
+
* To recalculate the dimensions of tabs we are checking the children length.
|
|
146
|
+
* and also checking the tab id and their order.
|
|
147
147
|
*/
|
|
148
148
|
let newTabKeys = [];
|
|
149
149
|
React.Children.toArray(children).forEach(child => {
|
|
@@ -316,14 +316,14 @@ class Tabs extends React.Component {
|
|
|
316
316
|
});
|
|
317
317
|
|
|
318
318
|
if (selectedTabDimension > totalDimension) {
|
|
319
|
-
/* let { align } = this.props;
|
|
320
|
-
let newDim = `${remConvert(totalDimension)}rem`;
|
|
321
|
-
let newTabs;
|
|
322
|
-
if (align === 'vertical') {
|
|
323
|
-
newTabs = mainTabs.map(tab => React.cloneElement(tab, { style: { maxWidth: newDim } }));
|
|
324
|
-
} else {
|
|
325
|
-
newTabs = mainTabs.map(tab => React.cloneElement(tab, { style: { maxHeight: newDim } }));
|
|
326
|
-
}
|
|
319
|
+
/* let { align } = this.props;
|
|
320
|
+
let newDim = `${remConvert(totalDimension)}rem`;
|
|
321
|
+
let newTabs;
|
|
322
|
+
if (align === 'vertical') {
|
|
323
|
+
newTabs = mainTabs.map(tab => React.cloneElement(tab, { style: { maxWidth: newDim } }));
|
|
324
|
+
} else {
|
|
325
|
+
newTabs = mainTabs.map(tab => React.cloneElement(tab, { style: { maxHeight: newDim } }));
|
|
326
|
+
}
|
|
327
327
|
mainTabs = newTabs; */
|
|
328
328
|
this.setMaxDim(totalDimension);
|
|
329
329
|
}
|
package/es/v1/Tag/Tag.js
CHANGED
|
@@ -7,16 +7,16 @@ import { Container } from '../Layout';
|
|
|
7
7
|
import Button from '../semantic/Button/Button';
|
|
8
8
|
import { useUniqueId } from '../../Provider/IdProvider';
|
|
9
9
|
import style from '../../Tag/Tag.module.css';
|
|
10
|
-
/*
|
|
11
|
-
* eslint css-modules/no-unused-class: [2, { markAsUsed: ['small', 'medium',
|
|
12
|
-
* 'closedanger', 'closeprimary', 'default', 'danger', 'secondary',
|
|
13
|
-
* 'pureDotted', 'primaryDotted'] }]
|
|
10
|
+
/*
|
|
11
|
+
* eslint css-modules/no-unused-class: [2, { markAsUsed: ['small', 'medium',
|
|
12
|
+
* 'closedanger', 'closeprimary', 'default', 'danger', 'secondary',
|
|
13
|
+
* 'pureDotted', 'primaryDotted'] }]
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
/*
|
|
17
|
-
* eslint css-modules/no-unused-class: [2, { markAsUsed: ['small', 'medium',
|
|
18
|
-
* 'closedanger', 'closeprimary', 'default', 'danger', 'secondary',
|
|
19
|
-
* 'pureDotted', 'primaryDotted'] }]
|
|
16
|
+
/*
|
|
17
|
+
* eslint css-modules/no-unused-class: [2, { markAsUsed: ['small', 'medium',
|
|
18
|
+
* 'closedanger', 'closeprimary', 'default', 'danger', 'secondary',
|
|
19
|
+
* 'pureDotted', 'primaryDotted'] }]
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
22
|
function Tag(props) {
|
package/es/v1/TextBox/TextBox.js
CHANGED
|
File without changes
|