@zohodesk/components 1.0.0-alpha-271 → 1.0.0-alpha-272
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 +4 -0
- package/es/Accordion/Accordion.js +7 -3
- package/es/Accordion/AccordionItem.js +4 -2
- package/es/Animation/Animation.js +3 -3
- package/es/AppContainer/AppContainer.js +13 -5
- package/es/Avatar/Avatar.js +23 -11
- package/es/AvatarTeam/AvatarTeam.js +3 -3
- package/es/Button/Button.js +4 -3
- package/es/Buttongroup/Buttongroup.js +3 -3
- package/es/Card/Card.js +21 -10
- package/es/CheckBox/CheckBox.js +5 -3
- package/es/DateTime/CalendarView.js +32 -20
- package/es/DateTime/DateTime.js +75 -10
- package/es/DateTime/DateTimePopupFooter.js +4 -2
- package/es/DateTime/DateTimePopupHeader.js +8 -2
- package/es/DateTime/DateWidget.js +98 -35
- package/es/DateTime/DaysRow.js +4 -2
- package/es/DateTime/Time.js +10 -2
- package/es/DateTime/YearView.js +28 -4
- package/es/DateTime/__tests__/CalendarView.spec.js +1 -0
- package/es/DateTime/__tests__/DateTime.spec.js +1 -0
- package/es/DateTime/__tests__/DateWidget.spec.js +2 -3
- package/es/DateTime/common.js +3 -0
- package/es/DateTime/constants.js +1 -0
- package/es/DateTime/dateFormatUtils/dateFormat.js +63 -30
- package/es/DateTime/dateFormatUtils/dateFormats.js +0 -1
- package/es/DateTime/dateFormatUtils/dayChange.js +13 -4
- package/es/DateTime/dateFormatUtils/index.js +32 -2
- package/es/DateTime/dateFormatUtils/monthChange.js +8 -0
- package/es/DateTime/dateFormatUtils/timeChange.js +22 -6
- package/es/DateTime/dateFormatUtils/yearChange.js +11 -2
- package/es/DateTime/objectUtils.js +14 -20
- package/es/DateTime/props/defaultProps.js +2 -1
- package/es/DateTime/typeChecker.js +3 -0
- package/es/DateTime/validator.js +58 -6
- package/es/DropBox/DropBox.js +6 -2
- package/es/DropBox/DropBoxElement/DropBoxElement.js +7 -0
- package/es/DropBox/DropBoxElement/css/cssJSLogic.js +5 -3
- package/es/DropBox/DropBoxElement/useDropboxPosCalc.js +3 -0
- package/es/DropBox/props/defaultProps.js +1 -2
- package/es/DropBox/props/propTypes.js +1 -2
- package/es/DropDown/DropDown.js +8 -4
- package/es/DropDown/DropDownHeading.js +4 -5
- package/es/DropDown/DropDownItem.js +6 -0
- package/es/DropDown/DropDownSearch.js +4 -0
- package/es/DropDown/DropDownSeparator.js +1 -0
- package/es/DropDown/__tests__/DropDown.spec.js +1 -2
- package/es/Heading/Heading.js +2 -3
- package/es/Label/Label.js +2 -3
- package/es/Layout/Box.js +13 -0
- package/es/Layout/Container.js +12 -1
- package/es/Layout/index.js +1 -2
- package/es/ListItem/ListContainer.js +8 -3
- package/es/ListItem/ListItem.js +9 -3
- package/es/ListItem/ListItemWithAvatar.js +9 -3
- package/es/ListItem/ListItemWithCheckBox.js +7 -2
- package/es/ListItem/ListItemWithIcon.js +8 -3
- package/es/ListItem/ListItemWithRadio.js +7 -3
- package/es/Modal/Modal.js +28 -11
- package/es/MultiSelect/AdvancedGroupMultiSelect.js +89 -13
- package/es/MultiSelect/AdvancedMultiSelect.js +32 -9
- package/es/MultiSelect/EmptyState.js +2 -0
- package/es/MultiSelect/MultiSelect.js +99 -32
- package/es/MultiSelect/MultiSelectHeader.js +3 -0
- package/es/MultiSelect/MultiSelectWithAvatar.js +12 -6
- package/es/MultiSelect/SelectedOptions.js +6 -3
- package/es/MultiSelect/Suggestions.js +7 -3
- package/es/MultiSelect/__tests__/MultiSelect.spec.js +4 -6
- package/es/MultiSelect/props/propTypes.js +2 -0
- package/es/PopOver/PopOver.js +18 -2
- package/es/PopOver/__tests__/PopOver.spec.js +2 -1
- package/es/Popup/Popup.js +77 -24
- package/es/Popup/__tests__/Popup.spec.js +17 -5
- package/es/Popup/viewPort.js +16 -4
- package/es/Provider/IdProvider.js +10 -5
- package/es/Provider/LibraryContext.js +6 -4
- package/es/Provider/NumberGenerator/NumberGenerator.js +21 -7
- package/es/Provider/ZindexProvider.js +9 -2
- package/es/Radio/Radio.js +4 -2
- package/es/Responsive/CustomResponsive.js +30 -18
- package/es/Responsive/RefWrapper.js +6 -7
- package/es/Responsive/ResizeComponent.js +35 -25
- package/es/Responsive/ResizeObserver.js +26 -6
- package/es/Responsive/Responsive.js +34 -20
- package/es/Responsive/index.js +1 -3
- package/es/Responsive/sizeObservers.js +28 -7
- package/es/Responsive/utils/index.js +7 -5
- package/es/Responsive/utils/shallowCompare.js +7 -2
- package/es/Responsive/windowResizeObserver.js +7 -0
- package/es/ResponsiveDropBox/ResponsiveDropBox.js +4 -0
- package/es/Ribbon/Ribbon.js +3 -2
- package/es/RippleEffect/RippleEffect.js +1 -3
- package/es/Select/GroupSelect.js +58 -14
- package/es/Select/Select.js +79 -33
- package/es/Select/SelectWithAvatar.js +17 -4
- package/es/Select/SelectWithIcon.js +46 -5
- package/es/Select/__tests__/Select.spec.js +6 -8
- package/es/Select/props/propTypes.js +1 -0
- package/es/Stencils/Stencils.js +3 -3
- package/es/Switch/Switch.js +5 -3
- package/es/Tab/Tab.js +4 -4
- package/es/Tab/TabContent.js +1 -0
- package/es/Tab/TabContentWrapper.js +2 -0
- package/es/Tab/TabWrapper.js +5 -2
- package/es/Tab/Tabs.js +54 -7
- package/es/Tab/__tests__/Tab.spec.js +1 -3
- package/es/Tab/__tests__/TabWrapper.spec.js +1 -0
- package/es/Tag/Tag.js +6 -3
- package/es/TextBox/TextBox.js +15 -3
- package/es/TextBox/__tests__/TextBox.spec.js +1 -4
- package/es/TextBoxIcon/TextBoxIcon.js +9 -2
- package/es/TextBoxIcon/__tests__/TextBoxIcon.spec.js +2 -7
- package/es/Textarea/Textarea.js +12 -3
- package/es/Textarea/__tests__/Textarea.spec.js +2 -2
- package/es/Tooltip/Tooltip.js +58 -14
- package/es/Tooltip/__tests__/Tooltip.spec.js +5 -0
- package/es/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +3 -2
- package/es/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +7 -5
- package/es/deprecated/PortalLayer/PortalLayer.js +25 -20
- package/es/semantic/Button/Button.js +3 -2
- package/es/utils/Common.js +54 -9
- package/es/utils/ContextOptimizer.js +4 -5
- package/es/utils/__tests__/debounce.spec.js +2 -2
- package/es/utils/constructFullName.js +2 -0
- package/es/utils/css/compileClassNames.js +5 -0
- package/es/utils/css/mergeStyle.js +7 -6
- package/es/utils/css/utils.js +1 -0
- package/es/utils/datetime/GMTZones.js +48 -0
- package/es/utils/datetime/common.js +31 -7
- package/es/utils/debounce.js +5 -1
- package/es/utils/dropDownUtils.js +68 -11
- package/es/utils/getInitial.js +4 -0
- package/es/utils/shallowEqual.js +6 -0
- package/lib/Accordion/Accordion.js +42 -18
- package/lib/Accordion/AccordionItem.js +40 -18
- package/lib/Accordion/__tests__/Accordion.spec.js +3 -0
- package/lib/Accordion/index.js +3 -0
- package/lib/Accordion/props/propTypes.js +3 -0
- package/lib/Animation/Animation.js +38 -18
- package/lib/Animation/__tests__/Animation.spec.js +11 -7
- package/lib/Animation/props/propTypes.js +3 -0
- package/lib/AppContainer/AppContainer.js +56 -21
- package/lib/AppContainer/props/propTypes.js +3 -0
- package/lib/Avatar/Avatar.js +78 -38
- package/lib/Avatar/__tests__/Avatar.spec.js +44 -0
- package/lib/Avatar/props/propTypes.js +3 -0
- package/lib/AvatarTeam/AvatarTeam.js +52 -30
- package/lib/AvatarTeam/__tests__/AvatarTeam.spec.js +13 -0
- package/lib/AvatarTeam/props/propTypes.js +3 -0
- package/lib/Button/Button.js +31 -20
- package/lib/Button/css/cssJSLogic.js +18 -17
- package/lib/Button/index.js +3 -0
- package/lib/Button/props/defaultProps.js +2 -0
- package/lib/Button/props/propTypes.js +3 -0
- package/lib/Buttongroup/Buttongroup.js +32 -12
- package/lib/Buttongroup/__test__/Buttongroup.spec.js +10 -0
- package/lib/Buttongroup/props/propTypes.js +3 -0
- package/lib/Card/Card.js +102 -46
- package/lib/Card/__tests__/Card.spec.js +10 -1
- package/lib/Card/index.js +4 -0
- package/lib/Card/props/propTypes.js +3 -0
- package/lib/CheckBox/CheckBox.js +71 -47
- package/lib/CheckBox/__tests__/CheckBox.spec.js +3 -0
- package/lib/CheckBox/props/propTypes.js +3 -0
- package/lib/DateTime/CalendarView.js +82 -42
- package/lib/DateTime/DateTime.js +246 -158
- package/lib/DateTime/DateTimePopupFooter.js +31 -8
- package/lib/DateTime/DateTimePopupHeader.js +48 -17
- package/lib/DateTime/DateWidget.js +352 -250
- package/lib/DateTime/DaysRow.js +27 -5
- package/lib/DateTime/Time.js +73 -32
- package/lib/DateTime/YearView.js +77 -28
- package/lib/DateTime/__tests__/CalendarView.spec.js +13 -5
- package/lib/DateTime/__tests__/DateTime.spec.js +51 -37
- package/lib/DateTime/__tests__/DateWidget.spec.js +10 -8
- package/lib/DateTime/common.js +6 -0
- package/lib/DateTime/constants.js +1 -0
- package/lib/DateTime/dateFormatUtils/dateFormat.js +184 -122
- package/lib/DateTime/dateFormatUtils/dateFormats.js +0 -1
- package/lib/DateTime/dateFormatUtils/dayChange.js +14 -7
- package/lib/DateTime/dateFormatUtils/index.js +74 -16
- package/lib/DateTime/dateFormatUtils/monthChange.js +19 -9
- package/lib/DateTime/dateFormatUtils/timeChange.js +54 -22
- package/lib/DateTime/dateFormatUtils/yearChange.js +22 -11
- package/lib/DateTime/index.js +2 -0
- package/lib/DateTime/objectUtils.js +24 -20
- package/lib/DateTime/props/defaultProps.js +2 -1
- package/lib/DateTime/props/propTypes.js +11 -1
- package/lib/DateTime/typeChecker.js +4 -0
- package/lib/DateTime/validator.js +73 -10
- package/lib/DropBox/DropBox.js +34 -10
- package/lib/DropBox/DropBoxElement/DropBoxElement.js +59 -38
- package/lib/DropBox/DropBoxElement/css/cssJSLogic.js +42 -34
- package/lib/DropBox/DropBoxElement/props/propTypes.js +3 -0
- package/lib/DropBox/DropBoxElement/useDropboxPosCalc.js +14 -9
- package/lib/DropBox/__tests__/DropBox.spec.js +6 -2
- package/lib/DropBox/css/cssJSLogic.js +3 -1
- package/lib/DropBox/props/defaultProps.js +8 -4
- package/lib/DropBox/props/propTypes.js +10 -4
- package/lib/DropDown/DropDown.js +52 -8
- package/lib/DropDown/DropDownHeading.js +39 -20
- package/lib/DropDown/DropDownItem.js +42 -20
- package/lib/DropDown/DropDownSearch.js +40 -17
- package/lib/DropDown/DropDownSeparator.js +24 -4
- package/lib/DropDown/__tests__/DropDown.spec.js +15 -9
- package/lib/DropDown/__tests__/DropDownItem.spec.js +9 -4
- package/lib/DropDown/__tests__/DropDownSearch.spec.js +3 -0
- package/lib/DropDown/index.js +9 -0
- package/lib/DropDown/props/propTypes.js +6 -4
- package/lib/Heading/Heading.js +37 -15
- package/lib/Heading/props/propTypes.js +3 -0
- package/lib/Label/Label.js +39 -19
- package/lib/Label/__tests__/Label.spec.js +14 -1
- package/lib/Label/props/propTypes.js +3 -0
- package/lib/Layout/Box.js +31 -11
- package/lib/Layout/Container.js +29 -10
- package/lib/Layout/__tests__/Box.spec.js +65 -49
- package/lib/Layout/__tests__/Container.spec.js +67 -50
- package/lib/Layout/index.js +3 -0
- package/lib/Layout/props/propTypes.js +3 -0
- package/lib/Layout/utils.js +10 -0
- package/lib/ListItem/ListContainer.js +48 -27
- package/lib/ListItem/ListItem.js +69 -45
- package/lib/ListItem/ListItemWithAvatar.js +75 -48
- package/lib/ListItem/ListItemWithCheckBox.js +64 -39
- package/lib/ListItem/ListItemWithIcon.js +68 -44
- package/lib/ListItem/ListItemWithRadio.js +65 -41
- package/lib/ListItem/index.js +7 -0
- package/lib/ListItem/props/propTypes.js +6 -4
- package/lib/Modal/Modal.js +45 -10
- package/lib/Modal/props/propTypes.js +3 -0
- package/lib/MultiSelect/AdvancedGroupMultiSelect.js +294 -166
- package/lib/MultiSelect/AdvancedMultiSelect.js +202 -125
- package/lib/MultiSelect/EmptyState.js +45 -24
- package/lib/MultiSelect/MultiSelect.js +323 -206
- package/lib/MultiSelect/MultiSelectHeader.js +30 -8
- package/lib/MultiSelect/MultiSelectWithAvatar.js +105 -63
- package/lib/MultiSelect/SelectedOptions.js +43 -17
- package/lib/MultiSelect/Suggestions.js +64 -32
- package/lib/MultiSelect/__tests__/MultiSelect.spec.js +86 -75
- package/lib/MultiSelect/index.js +5 -0
- package/lib/MultiSelect/props/defaultProps.js +2 -0
- package/lib/MultiSelect/props/propTypes.js +5 -0
- package/lib/PopOver/PopOver.js +95 -49
- package/lib/PopOver/__tests__/PopOver.spec.js +4 -1
- package/lib/PopOver/index.js +4 -0
- package/lib/PopOver/props/propTypes.js +3 -0
- package/lib/Popup/Popup.js +158 -81
- package/lib/Popup/__tests__/Popup.spec.js +43 -8
- package/lib/Popup/viewPort.js +28 -14
- package/lib/Provider/AvatarSize.js +4 -0
- package/lib/Provider/Config.js +2 -0
- package/lib/Provider/CssProvider.js +4 -0
- package/lib/Provider/IdProvider.js +17 -6
- package/lib/Provider/LibraryContext.js +35 -15
- package/lib/Provider/LibraryContextInit.js +4 -0
- package/lib/Provider/NumberGenerator/NumberGenerator.js +44 -15
- package/lib/Provider/ZindexProvider.js +15 -3
- package/lib/Provider/index.js +5 -0
- package/lib/Radio/Radio.js +61 -38
- package/lib/Radio/__tests__/Radiospec.js +9 -5
- package/lib/Radio/props/propTypes.js +3 -0
- package/lib/Responsive/CustomResponsive.js +73 -29
- package/lib/Responsive/RefWrapper.js +17 -11
- package/lib/Responsive/ResizeComponent.js +62 -36
- package/lib/Responsive/ResizeObserver.js +24 -10
- package/lib/Responsive/Responsive.js +80 -30
- package/lib/Responsive/index.js +4 -0
- package/lib/Responsive/props/propTypes.js +3 -0
- package/lib/Responsive/sizeObservers.js +53 -17
- package/lib/Responsive/utils/index.js +11 -3
- package/lib/Responsive/utils/shallowCompare.js +11 -2
- package/lib/Responsive/windowResizeObserver.js +8 -0
- package/lib/ResponsiveDropBox/ResponsiveDropBox.js +45 -17
- package/lib/ResponsiveDropBox/props/propTypes.js +3 -0
- package/lib/Ribbon/Ribbon.js +33 -13
- package/lib/Ribbon/__tests__/Ribbon.spec.js +22 -0
- package/lib/Ribbon/props/propTypes.js +3 -0
- package/lib/RippleEffect/RippleEffect.js +18 -10
- package/lib/RippleEffect/props/propTypes.js +3 -0
- package/lib/Select/GroupSelect.js +229 -130
- package/lib/Select/Select.js +290 -209
- package/lib/Select/SelectWithAvatar.js +102 -56
- package/lib/Select/SelectWithIcon.js +132 -76
- package/lib/Select/__tests__/Select.spec.js +133 -91
- package/lib/Select/index.js +5 -0
- package/lib/Select/props/defaultProps.js +5 -4
- package/lib/Select/props/propTypes.js +4 -0
- package/lib/Stencils/Stencils.js +29 -10
- package/lib/Stencils/__tests__/Stencils.spec.js +12 -0
- package/lib/Stencils/props/propTypes.js +3 -0
- package/lib/Switch/Switch.js +57 -34
- package/lib/Switch/props/propTypes.js +3 -0
- package/lib/Tab/Tab.js +40 -27
- package/lib/Tab/TabContent.js +12 -5
- package/lib/Tab/TabContentWrapper.js +13 -6
- package/lib/Tab/TabWrapper.js +37 -19
- package/lib/Tab/Tabs.js +171 -91
- package/lib/Tab/__tests__/Tab.spec.js +67 -58
- package/lib/Tab/__tests__/TabContent.spec.js +10 -6
- package/lib/Tab/__tests__/TabContentWrapper.spec.js +28 -20
- package/lib/Tab/__tests__/TabWrapper.spec.js +12 -0
- package/lib/Tab/__tests__/Tabs.spec.js +53 -39
- package/lib/Tab/index.js +6 -0
- package/lib/Tab/props/propTypes.js +3 -0
- package/lib/Tag/Tag.js +72 -43
- package/lib/Tag/__tests__/Tag.spec.js +14 -8
- package/lib/Tag/props/propTypes.js +3 -0
- package/lib/TextBox/TextBox.js +85 -59
- package/lib/TextBox/__tests__/TextBox.spec.js +14 -4
- package/lib/TextBox/props/propTypes.js +6 -4
- package/lib/TextBoxIcon/TextBoxIcon.js +79 -52
- package/lib/TextBoxIcon/__tests__/TextBoxIcon.spec.js +14 -5
- package/lib/TextBoxIcon/props/propTypes.js +3 -0
- package/lib/Textarea/Textarea.js +54 -29
- package/lib/Textarea/__tests__/Textarea.spec.js +14 -2
- package/lib/Textarea/props/propTypes.js +3 -0
- package/lib/Tooltip/Tooltip.js +94 -31
- package/lib/Tooltip/__tests__/Tooltip.spec.js +24 -3
- package/lib/Tooltip/props/propTypes.js +3 -0
- package/lib/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +40 -16
- package/lib/VelocityAnimation/VelocityAnimation/props/propTypes.js +3 -0
- package/lib/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +53 -25
- package/lib/VelocityAnimation/VelocityAnimationGroup/props/propTypes.js +3 -0
- package/lib/VelocityAnimation/index.js +3 -0
- package/lib/css.js +40 -0
- package/lib/deprecated/PortalLayer/PortalLayer.js +46 -23
- package/lib/deprecated/PortalLayer/props/propTypes.js +3 -0
- package/lib/index.js +57 -0
- package/lib/semantic/Button/Button.js +42 -22
- package/lib/semantic/Button/props/propTypes.js +3 -0
- package/lib/semantic/index.js +2 -0
- package/lib/utils/Common.js +110 -18
- package/lib/utils/ContextOptimizer.js +16 -10
- package/lib/utils/__tests__/constructFullName.spec.js +1 -0
- package/lib/utils/__tests__/debounce.spec.js +3 -2
- package/lib/utils/__tests__/getInitial.spec.js +1 -0
- package/lib/utils/constructFullName.js +13 -4
- package/lib/utils/css/compileClassNames.js +6 -0
- package/lib/utils/css/mergeStyle.js +10 -7
- package/lib/utils/css/utils.js +8 -0
- package/lib/utils/datetime/GMTZones.js +55 -0
- package/lib/utils/datetime/common.js +52 -7
- package/lib/utils/debounce.js +6 -1
- package/lib/utils/dropDownUtils.js +175 -59
- package/lib/utils/dummyFunction.js +2 -0
- package/lib/utils/getHTMLFontSize.js +1 -0
- package/lib/utils/getInitial.js +6 -0
- package/lib/utils/index.js +4 -0
- package/lib/utils/scrollTo.js +2 -0
- package/lib/utils/shallowEqual.js +8 -0
- package/package.json +1 -1
|
@@ -1,10 +1,11 @@
|
|
|
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
|
/**** Libraries ****/
|
|
3
4
|
import React from 'react';
|
|
4
5
|
import { MultiSelectWithAvatar_propTypes } from './props/propTypes';
|
|
5
6
|
import { MultiSelectWithAvatar_defaultProps } from './props/defaultProps';
|
|
6
|
-
|
|
7
7
|
/**** Components ****/
|
|
8
|
+
|
|
8
9
|
import { MultiSelectComponent } from './MultiSelect';
|
|
9
10
|
import Popup from '../Popup/Popup';
|
|
10
11
|
import TextBoxIcon from '../TextBoxIcon/TextBoxIcon';
|
|
@@ -19,14 +20,16 @@ import { getUniqueId } from '../Provider/IdProvider';
|
|
|
19
20
|
import ResponsiveDropBox from '../ResponsiveDropBox/ResponsiveDropBox';
|
|
20
21
|
import { ResponsiveReceiver } from '../Responsive/CustomResponsive';
|
|
21
22
|
import Loader from '@zohodesk/svg/lib/Loader/Loader';
|
|
22
|
-
|
|
23
23
|
/**** Icons ****/
|
|
24
|
+
|
|
24
25
|
import { Icon } from '@zohodesk/icons';
|
|
25
26
|
/**** CSS ****/
|
|
26
|
-
import style from './MultiSelect.module.css';
|
|
27
27
|
|
|
28
|
+
import style from './MultiSelect.module.css';
|
|
28
29
|
/*eslint-disable react/sort-prop-types*/
|
|
30
|
+
|
|
29
31
|
/* eslint-disable react/forbid-component-props */
|
|
32
|
+
|
|
30
33
|
/* eslint-disable react/no-unused-prop-types */
|
|
31
34
|
|
|
32
35
|
class MultiSelectWithAvatarComponent extends MultiSelectComponent {
|
|
@@ -35,6 +38,7 @@ class MultiSelectWithAvatarComponent extends MultiSelectComponent {
|
|
|
35
38
|
this.handleFormatOptions = this.handleFormatOptions.bind(this);
|
|
36
39
|
this.getNextAriaId = getUniqueId(this);
|
|
37
40
|
}
|
|
41
|
+
|
|
38
42
|
handleFormatOptions(props) {
|
|
39
43
|
const {
|
|
40
44
|
options,
|
|
@@ -52,6 +56,7 @@ class MultiSelectWithAvatarComponent extends MultiSelectComponent {
|
|
|
52
56
|
disabledOptions
|
|
53
57
|
});
|
|
54
58
|
}
|
|
59
|
+
|
|
55
60
|
responsiveFunc(_ref) {
|
|
56
61
|
let {
|
|
57
62
|
mediaQueryOR
|
|
@@ -62,6 +67,7 @@ class MultiSelectWithAvatarComponent extends MultiSelectComponent {
|
|
|
62
67
|
}])
|
|
63
68
|
};
|
|
64
69
|
}
|
|
70
|
+
|
|
65
71
|
render() {
|
|
66
72
|
let {
|
|
67
73
|
isReadOnly,
|
|
@@ -285,14 +291,14 @@ class MultiSelectWithAvatarComponent extends MultiSelectComponent {
|
|
|
285
291
|
}, /*#__PURE__*/React.createElement(Loader, null))))));
|
|
286
292
|
}) : null);
|
|
287
293
|
}
|
|
294
|
+
|
|
288
295
|
}
|
|
296
|
+
|
|
289
297
|
MultiSelectWithAvatarComponent.propTypes = MultiSelectWithAvatar_propTypes;
|
|
290
298
|
MultiSelectWithAvatarComponent.defaultProps = MultiSelectWithAvatar_defaultProps;
|
|
291
299
|
MultiSelectWithAvatarComponent.displayName = 'MultiSelectWithAvatar';
|
|
292
300
|
const MultiSelectWithAvatar = Popup(MultiSelectWithAvatarComponent);
|
|
293
|
-
MultiSelectWithAvatar.defaultProps = MultiSelectWithAvatarComponent.defaultProps;
|
|
294
|
-
|
|
295
|
-
// if (__DOCS__) {
|
|
301
|
+
MultiSelectWithAvatar.defaultProps = MultiSelectWithAvatarComponent.defaultProps; // if (__DOCS__) {
|
|
296
302
|
// MultiSelectWithAvatarComponent.docs = {
|
|
297
303
|
// componentGroup: 'Form Elements',
|
|
298
304
|
// folderName: 'Style Guide'
|
|
@@ -1,16 +1,16 @@
|
|
|
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
|
/**** Libraries ****/
|
|
3
4
|
import React from 'react';
|
|
4
5
|
import { SelectedOptions_propTypes } from './props/propTypes';
|
|
5
6
|
import { SelectedOptions_defaultProps } from './props/defaultProps';
|
|
6
|
-
|
|
7
7
|
/**** Components ****/
|
|
8
|
+
|
|
8
9
|
import Tag from '../Tag/Tag';
|
|
9
10
|
import { Box } from '../Layout';
|
|
10
|
-
|
|
11
11
|
/**** Style ****/
|
|
12
|
-
import style from './SelectedOptions.module.css';
|
|
13
12
|
|
|
13
|
+
import style from './SelectedOptions.module.css';
|
|
14
14
|
/* eslint-disable react/forbid-component-props */
|
|
15
15
|
|
|
16
16
|
export default class SelectedOptions extends React.PureComponent {
|
|
@@ -47,6 +47,7 @@ export default class SelectedOptions extends React.PureComponent {
|
|
|
47
47
|
id: id,
|
|
48
48
|
isReadOnly: isReadOnly
|
|
49
49
|
};
|
|
50
|
+
|
|
50
51
|
if (optionType === 'avatar') {
|
|
51
52
|
return /*#__PURE__*/React.createElement(Box, {
|
|
52
53
|
className: `${style.tag} ${style[size]}`,
|
|
@@ -66,6 +67,7 @@ export default class SelectedOptions extends React.PureComponent {
|
|
|
66
67
|
iconSize: iconSize
|
|
67
68
|
})));
|
|
68
69
|
}
|
|
70
|
+
|
|
69
71
|
return /*#__PURE__*/React.createElement(Box, {
|
|
70
72
|
className: `${style.tag} ${style[size]}`,
|
|
71
73
|
key: `${id}tag`
|
|
@@ -74,6 +76,7 @@ export default class SelectedOptions extends React.PureComponent {
|
|
|
74
76
|
})));
|
|
75
77
|
}));
|
|
76
78
|
}
|
|
79
|
+
|
|
77
80
|
}
|
|
78
81
|
SelectedOptions.propTypes = SelectedOptions_propTypes;
|
|
79
82
|
SelectedOptions.defaultProps = SelectedOptions_defaultProps;
|
|
@@ -1,10 +1,11 @@
|
|
|
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
|
/**** Libraries ****/
|
|
3
4
|
import React from 'react';
|
|
4
5
|
import { Suggestions_propTypes } from './props/propTypes';
|
|
5
6
|
import { Suggestions_defaultProps } from './props/defaultProps';
|
|
6
|
-
|
|
7
7
|
/**** Components ****/
|
|
8
|
+
|
|
8
9
|
import ListItem from '../ListItem/ListItem';
|
|
9
10
|
import ListItemWithAvatar from '../ListItem/ListItemWithAvatar';
|
|
10
11
|
import ListItemWithIcon from '../ListItem/ListItemWithIcon';
|
|
@@ -65,13 +66,14 @@ export default class Suggestions extends React.PureComponent {
|
|
|
65
66
|
isDisabled,
|
|
66
67
|
...listItemCustomProps
|
|
67
68
|
};
|
|
69
|
+
|
|
68
70
|
if (listItemProps) {
|
|
69
71
|
commonProps.customProps = {
|
|
70
|
-
ListItemProps: {
|
|
71
|
-
...listItemProps
|
|
72
|
+
ListItemProps: { ...listItemProps
|
|
72
73
|
}
|
|
73
74
|
};
|
|
74
75
|
}
|
|
76
|
+
|
|
75
77
|
if (optionType === 'avatar') {
|
|
76
78
|
return /*#__PURE__*/React.createElement(ListItemWithAvatar, _extends({}, commonProps, {
|
|
77
79
|
autoHover: false,
|
|
@@ -114,6 +116,7 @@ export default class Suggestions extends React.PureComponent {
|
|
|
114
116
|
a11y: list_a11y
|
|
115
117
|
}));
|
|
116
118
|
}
|
|
119
|
+
|
|
117
120
|
return /*#__PURE__*/React.createElement(ListItem, _extends({}, commonProps, {
|
|
118
121
|
autoHover: false,
|
|
119
122
|
getRef: getRef,
|
|
@@ -133,6 +136,7 @@ export default class Suggestions extends React.PureComponent {
|
|
|
133
136
|
}));
|
|
134
137
|
})));
|
|
135
138
|
}
|
|
139
|
+
|
|
136
140
|
}
|
|
137
141
|
Suggestions.propTypes = Suggestions_propTypes;
|
|
138
142
|
Suggestions.defaultProps = Suggestions_defaultProps;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/* eslint-disable no-undef */
|
|
2
|
+
|
|
2
3
|
/**** Libraries ****/
|
|
3
4
|
import expect from 'expect';
|
|
4
|
-
|
|
5
5
|
/**** Components ****/
|
|
6
|
+
|
|
6
7
|
import MultiSelect from '../MultiSelect';
|
|
7
8
|
import Tag from '../../Tag/Tag';
|
|
8
9
|
describe('MultiSelect component conditions', () => {
|
|
@@ -30,9 +31,8 @@ describe('MultiSelect component conditions', () => {
|
|
|
30
31
|
target: {
|
|
31
32
|
value: 'value changed'
|
|
32
33
|
}
|
|
33
|
-
});
|
|
34
|
+
}); //
|
|
34
35
|
|
|
35
|
-
//
|
|
36
36
|
setTimeout(() => {
|
|
37
37
|
expect(props.onSearch).toHaveBeenCalled();
|
|
38
38
|
expect(props.onSearch.mock.calls[0][0]).toEqual('value changed');
|
|
@@ -44,10 +44,8 @@ describe('MultiSelect component conditions', () => {
|
|
|
44
44
|
expect(loadingEleArr.length).toBe(0);
|
|
45
45
|
cb();
|
|
46
46
|
});
|
|
47
|
-
}, searchDebounceTime);
|
|
48
|
-
//
|
|
47
|
+
}, searchDebounceTime); //
|
|
49
48
|
});
|
|
50
|
-
|
|
51
49
|
it('Should display searchEmptyMessage', () => {
|
|
52
50
|
let {
|
|
53
51
|
renderedDOM
|
|
@@ -103,6 +103,7 @@ export const AdvancedMultiSelect_propTypes = {
|
|
|
103
103
|
dataIdNoMreOptionMsg: PropTypes.string,
|
|
104
104
|
dataIdSelectAllEle: PropTypes.string,
|
|
105
105
|
isSearchClearOnClose: PropTypes.bool,
|
|
106
|
+
|
|
106
107
|
/**** Popup Props ****/
|
|
107
108
|
isPopupOpen: PropTypes.bool,
|
|
108
109
|
isPopupReady: PropTypes.bool,
|
|
@@ -300,6 +301,7 @@ export const MultiSelectWithAvatar_propTypes = {
|
|
|
300
301
|
SuggestionsProps: PropTypes.object,
|
|
301
302
|
DropBoxProps: PropTypes.object
|
|
302
303
|
}),
|
|
304
|
+
|
|
303
305
|
/**** Popup props ****/
|
|
304
306
|
isPopupOpen: PropTypes.bool,
|
|
305
307
|
isPopupReady: PropTypes.bool,
|
package/es/PopOver/PopOver.js
CHANGED
|
@@ -5,6 +5,7 @@ import Popup from '../Popup/Popup';
|
|
|
5
5
|
import { Box } from '../Layout';
|
|
6
6
|
import ResponsiveDropBox from '../ResponsiveDropBox/ResponsiveDropBox';
|
|
7
7
|
import style from './PopOver.module.css';
|
|
8
|
+
|
|
8
9
|
class PopOver extends React.Component {
|
|
9
10
|
constructor(props) {
|
|
10
11
|
super(props);
|
|
@@ -12,17 +13,20 @@ class PopOver extends React.Component {
|
|
|
12
13
|
this.popOverContainerRef = this.popOverContainerRef.bind(this);
|
|
13
14
|
this.togglePopup = this.togglePopup.bind(this);
|
|
14
15
|
}
|
|
16
|
+
|
|
15
17
|
componentDidUpdate(prevProps) {
|
|
16
18
|
let {
|
|
17
19
|
isPopupOpen,
|
|
18
20
|
onPopupOpen,
|
|
19
21
|
onPopupClose
|
|
20
22
|
} = this.props;
|
|
23
|
+
|
|
21
24
|
if (prevProps.isPopupOpen !== isPopupOpen) {
|
|
22
25
|
isPopupOpen && onPopupOpen && onPopupOpen();
|
|
23
26
|
!isPopupOpen && onPopupClose && onPopupClose();
|
|
24
27
|
}
|
|
25
28
|
}
|
|
29
|
+
|
|
26
30
|
popOverTargetRef(el) {
|
|
27
31
|
this.popOverTarget = el;
|
|
28
32
|
let {
|
|
@@ -30,6 +34,7 @@ class PopOver extends React.Component {
|
|
|
30
34
|
} = this.props;
|
|
31
35
|
getTargetRef(el);
|
|
32
36
|
}
|
|
37
|
+
|
|
33
38
|
popOverContainerRef(el) {
|
|
34
39
|
this.popOverContainer = el;
|
|
35
40
|
let {
|
|
@@ -37,6 +42,7 @@ class PopOver extends React.Component {
|
|
|
37
42
|
} = this.props;
|
|
38
43
|
getContainerRef(el);
|
|
39
44
|
}
|
|
45
|
+
|
|
40
46
|
togglePopup(e) {
|
|
41
47
|
let {
|
|
42
48
|
togglePopup,
|
|
@@ -44,6 +50,7 @@ class PopOver extends React.Component {
|
|
|
44
50
|
} = this.props;
|
|
45
51
|
togglePopup(e, boxPosition);
|
|
46
52
|
}
|
|
53
|
+
|
|
47
54
|
render() {
|
|
48
55
|
let {
|
|
49
56
|
children,
|
|
@@ -98,10 +105,11 @@ class PopOver extends React.Component {
|
|
|
98
105
|
className: style.popup
|
|
99
106
|
}, childrens);
|
|
100
107
|
}
|
|
108
|
+
|
|
101
109
|
}
|
|
110
|
+
|
|
102
111
|
PopOver.defaultProps = PopOver_defaultProps;
|
|
103
|
-
PopOver.propTypes = PopOver_propTypes;
|
|
104
|
-
// if (__DOCS__) {
|
|
112
|
+
PopOver.propTypes = PopOver_propTypes; // if (__DOCS__) {
|
|
105
113
|
// PopOver.docs = {
|
|
106
114
|
// componentGroup: 'Form Elements',
|
|
107
115
|
// folderName: 'Style Guide',
|
|
@@ -109,18 +117,21 @@ PopOver.propTypes = PopOver_propTypes;
|
|
|
109
117
|
// external: true
|
|
110
118
|
// };
|
|
111
119
|
// }
|
|
120
|
+
|
|
112
121
|
export default Popup(PopOver);
|
|
113
122
|
export class PopOverTarget extends React.Component {
|
|
114
123
|
constructor(props) {
|
|
115
124
|
super(props);
|
|
116
125
|
this.getRef = this.getRef.bind(this);
|
|
117
126
|
}
|
|
127
|
+
|
|
118
128
|
getRef(el) {
|
|
119
129
|
let {
|
|
120
130
|
getRef
|
|
121
131
|
} = this.props;
|
|
122
132
|
getRef(el);
|
|
123
133
|
}
|
|
134
|
+
|
|
124
135
|
render() {
|
|
125
136
|
let {
|
|
126
137
|
children,
|
|
@@ -132,6 +143,7 @@ export class PopOverTarget extends React.Component {
|
|
|
132
143
|
ref: this.getRef
|
|
133
144
|
}, children);
|
|
134
145
|
}
|
|
146
|
+
|
|
135
147
|
}
|
|
136
148
|
PopOverTarget.propTypes = PopOverTarget_propTypes;
|
|
137
149
|
export class PopOverContainer extends React.Component {
|
|
@@ -140,12 +152,14 @@ export class PopOverContainer extends React.Component {
|
|
|
140
152
|
this.handleClick = this.handleClick.bind(this);
|
|
141
153
|
this.getRef = this.getRef.bind(this);
|
|
142
154
|
}
|
|
155
|
+
|
|
143
156
|
getRef(el) {
|
|
144
157
|
let {
|
|
145
158
|
getRef
|
|
146
159
|
} = this.props;
|
|
147
160
|
getRef && getRef(el);
|
|
148
161
|
}
|
|
162
|
+
|
|
149
163
|
handleClick(e) {
|
|
150
164
|
let {
|
|
151
165
|
onClick,
|
|
@@ -154,6 +168,7 @@ export class PopOverContainer extends React.Component {
|
|
|
154
168
|
removeClose && removeClose(e);
|
|
155
169
|
onClick && onClick();
|
|
156
170
|
}
|
|
171
|
+
|
|
157
172
|
render() {
|
|
158
173
|
let {
|
|
159
174
|
children,
|
|
@@ -198,6 +213,7 @@ export class PopOverContainer extends React.Component {
|
|
|
198
213
|
scroll: "vertical"
|
|
199
214
|
}, children));
|
|
200
215
|
}
|
|
216
|
+
|
|
201
217
|
}
|
|
202
218
|
PopOverContainer.defaultProps = PopOverContainer_defaultProps;
|
|
203
219
|
PopOverContainer.propTypes = PopOverContainer_propTypes;
|