@zohodesk/components 1.0.0-temp-47 → 1.0.0-temp-50
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 +24 -0
- package/assets/Appearance/dark/mode/darkMode.module.css +2 -0
- package/assets/Appearance/default/mode/defaultMode.module.css +2 -0
- package/es/Animation/Animation.js +7 -8
- package/es/Avatar/Avatar.js +13 -12
- package/es/Avatar/__tests__/Avatar.spec.js +0 -1
- package/es/AvatarTeam/__tests__/AvatarTeam.spec.js +0 -1
- package/es/Button/Button.js +15 -16
- package/es/Button/Button.module.css +6 -2
- package/es/Button/__tests__/Button.spec.js +0 -1
- package/es/Buttongroup/__test__/Buttongroup.spec.js +0 -1
- package/es/Card/Card.js +4 -5
- package/es/DateTime/DateTime.js +6 -3
- package/es/DateTime/DateWidget.js +5 -2
- package/es/DateTime/YearView.js +6 -5
- package/es/DateTime/common.js +9 -2
- package/es/DateTime/dateFormatUtils/dateFormat.js +76 -57
- package/es/DateTime/dateFormatUtils/index.js +12 -7
- package/es/DateTime/dateFormatUtils/timeChange.js +4 -3
- package/es/DateTime/dateFormatUtils/yearChange.js +4 -3
- package/es/DateTime/validator.js +0 -1
- package/es/DropBox/DropBox.js +2 -2
- package/es/Label/__tests__/Label.spec.js +0 -2
- package/es/Layout/utils.js +2 -1
- package/es/ListItem/ListContainer.js +3 -8
- package/es/ListItem/ListItem.js +58 -39
- package/es/ListItem/ListItem.module.css +11 -0
- package/es/ListItem/ListItemWithAvatar.js +74 -53
- package/es/ListItem/ListItemWithCheckBox.js +54 -33
- package/es/ListItem/ListItemWithIcon.js +66 -47
- package/es/ListItem/ListItemWithRadio.js +55 -34
- package/es/MultiSelect/AdvancedGroupMultiSelect.js +12 -4
- package/es/MultiSelect/AdvancedMultiSelect.js +20 -7
- package/es/MultiSelect/MultiSelect.js +24 -8
- package/es/MultiSelect/MultiSelectWithAvatar.js +1 -1
- package/es/PopOver/PopOver.js +19 -20
- package/es/Popup/Popup.js +15 -9
- package/es/Popup/viewPort.js +14 -9
- package/es/Provider/IdProvider.js +5 -4
- package/es/Provider/LibraryContext.js +6 -5
- package/es/Provider/NumberGenerator/NumberGenerator.js +17 -15
- package/es/Provider/ZindexProvider.js +5 -4
- package/es/Responsive/CustomResponsive.js +11 -8
- package/es/Responsive/ResizeComponent.js +3 -1
- package/es/Responsive/Responsive.js +12 -9
- package/es/Responsive/sizeObservers.js +13 -2
- package/es/Ribbon/Ribbon.js +8 -8
- package/es/Ribbon/__tests__/Ribbon.spec.js +0 -1
- package/es/Select/GroupSelect.js +3 -2
- package/es/Select/Select.js +3 -2
- package/es/Select/SelectWithAvatar.js +1 -1
- package/es/Select/SelectWithIcon.js +1 -1
- package/es/Stencils/Stencils.js +5 -6
- package/es/Stencils/__tests__/Stencils.spec.js +0 -1
- package/es/Tab/Tab.js +27 -26
- package/es/Tab/TabContent.js +17 -14
- package/es/Tab/TabContentWrapper.js +17 -14
- package/es/Tab/TabWrapper.js +15 -14
- package/es/Tab/Tabs.js +2 -1
- package/es/TextBox/__tests__/TextBox.spec.js +0 -1
- package/es/TextBoxIcon/TextBoxIcon.js +1 -1
- package/es/TextBoxIcon/__tests__/TextBoxIcon.spec.js +0 -1
- package/es/Textarea/__tests__/Textarea.spec.js +0 -1
- package/es/Tooltip/Tooltip.js +0 -1
- package/es/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +1 -1
- package/es/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +1 -1
- package/es/a11y/FocusScope/FocusScope.js +10 -4
- package/es/beta/FocusRing/FocusRing.js +4 -1
- package/es/utils/Common.js +31 -11
- package/es/utils/datetime/common.js +6 -3
- package/es/utils/dropDownUtils.js +45 -6
- package/es/utils/getInitial.js +3 -1
- package/lib/Accordion/Accordion.js +3 -3
- package/lib/Accordion/AccordionItem.js +3 -3
- package/lib/Animation/Animation.js +10 -11
- package/lib/AppContainer/AppContainer.js +3 -3
- package/lib/Avatar/Avatar.js +14 -14
- package/lib/AvatarTeam/AvatarTeam.js +3 -3
- package/lib/Button/Button.js +18 -19
- package/lib/Button/Button.module.css +6 -2
- package/lib/Buttongroup/Buttongroup.js +3 -3
- package/lib/Card/Card.js +8 -9
- package/lib/Card/__tests__/Card.spec.js +1 -1
- package/lib/Card/index.js +7 -7
- package/lib/CheckBox/CheckBox.js +3 -3
- package/lib/DateTime/CalendarView.js +4 -4
- package/lib/DateTime/DateTime.js +3 -3
- package/lib/DateTime/DateTimePopupFooter.js +3 -3
- package/lib/DateTime/DateTimePopupHeader.js +3 -3
- package/lib/DateTime/DateWidget.js +3 -3
- package/lib/DateTime/DaysRow.js +3 -3
- package/lib/DateTime/Time.js +3 -3
- package/lib/DateTime/YearView.js +3 -3
- package/lib/DateTime/__tests__/CalendarView.spec.js +1 -1
- package/lib/DateTime/__tests__/DateTime.spec.js +1 -1
- package/lib/DateTime/constants.js +1 -1
- package/lib/DateTime/dateFormatUtils/dateFormat.js +2 -2
- package/lib/DateTime/dateFormatUtils/index.js +13 -13
- package/lib/DateTime/objectUtils.js +2 -2
- package/lib/DropBox/DropBox.js +9 -5
- package/lib/DropDown/DropDown.js +4 -4
- package/lib/DropDown/DropDownHeading.js +3 -3
- package/lib/DropDown/DropDownItem.js +3 -3
- package/lib/DropDown/DropDownSearch.js +3 -3
- package/lib/DropDown/DropDownSeparator.js +3 -3
- package/lib/Label/Label.js +3 -3
- package/lib/Layout/Box.js +1 -1
- package/lib/Layout/Container.js +1 -1
- package/lib/Layout/index.js +4 -4
- package/lib/Layout/utils.js +2 -2
- package/lib/ListItem/ListContainer.js +3 -8
- package/lib/ListItem/ListItem.js +61 -40
- package/lib/ListItem/ListItem.module.css +11 -0
- package/lib/ListItem/ListItemWithAvatar.js +77 -56
- package/lib/ListItem/ListItemWithCheckBox.js +57 -36
- package/lib/ListItem/ListItemWithIcon.js +69 -48
- package/lib/ListItem/ListItemWithRadio.js +58 -37
- package/lib/Modal/Modal.js +3 -3
- package/lib/Modal/__docs__/Modal__default.docs.js +3 -3
- package/lib/MultiSelect/AdvancedGroupMultiSelect.js +4 -4
- package/lib/MultiSelect/AdvancedMultiSelect.js +20 -8
- package/lib/MultiSelect/EmptyState.js +3 -3
- package/lib/MultiSelect/MultiSelect.js +16 -7
- package/lib/MultiSelect/MultiSelectHeader.js +3 -3
- package/lib/MultiSelect/MultiSelectWithAvatar.js +4 -4
- package/lib/MultiSelect/SelectedOptions.js +3 -3
- package/lib/MultiSelect/Suggestions.js +5 -5
- package/lib/PopOver/PopOver.js +23 -24
- package/lib/Popup/Popup.js +35 -32
- package/lib/Popup/__tests__/Popup.spec.js +3 -3
- package/lib/Provider/IdProvider.js +3 -3
- package/lib/Provider/LibraryContext.js +3 -3
- package/lib/Provider/NumberGenerator/NumberGenerator.js +2 -2
- package/lib/Provider/ZindexProvider.js +1 -1
- package/lib/Provider.js +3 -3
- package/lib/Radio/Radio.js +3 -3
- package/lib/Responsive/CustomResponsive.js +4 -4
- package/lib/Responsive/RefWrapper.js +1 -1
- package/lib/Responsive/ResizeComponent.js +3 -3
- package/lib/Responsive/ResizeObserver.js +1 -1
- package/lib/Responsive/Responsive.js +6 -5
- package/lib/Responsive/sizeObservers.js +14 -6
- package/lib/Responsive/utils/index.js +3 -2
- package/lib/Responsive/utils/shallowCompare.js +1 -1
- package/lib/Ribbon/Ribbon.js +11 -11
- package/lib/Select/GroupSelect.js +4 -4
- package/lib/Select/Select.js +4 -4
- package/lib/Select/SelectWithAvatar.js +4 -4
- package/lib/Select/SelectWithIcon.js +4 -4
- package/lib/Stencils/Stencils.js +8 -9
- package/lib/Switch/Switch.js +3 -3
- package/lib/Tab/Tab.js +1 -1
- package/lib/Tab/TabWrapper.js +1 -1
- package/lib/Tab/Tabs.js +3 -3
- package/lib/Tab/index.js +10 -10
- package/lib/Tag/Tag.js +3 -3
- package/lib/TextBox/TextBox.js +3 -3
- package/lib/TextBoxIcon/TextBoxIcon.js +4 -4
- package/lib/Textarea/Textarea.js +3 -3
- package/lib/Tooltip/Tooltip.js +3 -3
- package/lib/Tooltip/__tests__/Tooltip.spec.js +3 -3
- package/lib/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +8 -6
- package/lib/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +8 -6
- package/lib/a11y/FocusScope/FocusScope.js +2 -2
- package/lib/beta/FocusRing/FocusRing.js +3 -3
- package/lib/deprecated/PortalLayer/PortalLayer.js +3 -3
- package/lib/index.js +310 -310
- package/lib/semantic/Button/Button.js +3 -3
- package/lib/utils/Common.js +20 -16
- package/lib/utils/datetime/common.js +10 -10
- package/lib/utils/dropDownUtils.js +46 -3
- package/lib/utils/shallowEqual.js +1 -1
- package/package.json +4 -4
|
@@ -6,12 +6,14 @@ import Radio from '../Radio/Radio';
|
|
|
6
6
|
import { Box } from '../Layout';
|
|
7
7
|
import ListContainer from './ListContainer';
|
|
8
8
|
import style from './ListItem.module.css';
|
|
9
|
+
import { ResponsiveReceiver } from '../Responsive/CustomResponsive';
|
|
9
10
|
export default class ListItemWithRadio extends React.Component {
|
|
10
11
|
constructor(props) {
|
|
11
12
|
super(props);
|
|
12
13
|
this.onClick = this.onClick.bind(this);
|
|
13
14
|
this.getRef = this.getRef.bind(this);
|
|
14
15
|
this.onHover = this.onHover.bind(this);
|
|
16
|
+
this.responsiveFunc = this.responsiveFunc.bind(this);
|
|
15
17
|
}
|
|
16
18
|
|
|
17
19
|
getRef(ele) {
|
|
@@ -43,6 +45,17 @@ export default class ListItemWithRadio extends React.Component {
|
|
|
43
45
|
onHover && onHover(id, value, index, e);
|
|
44
46
|
}
|
|
45
47
|
|
|
48
|
+
responsiveFunc(_ref) {
|
|
49
|
+
let {
|
|
50
|
+
mediaQueryOR
|
|
51
|
+
} = _ref;
|
|
52
|
+
return {
|
|
53
|
+
mobileToTab: mediaQueryOR([{
|
|
54
|
+
maxWidth: 700
|
|
55
|
+
}])
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
|
|
46
59
|
render() {
|
|
47
60
|
let {
|
|
48
61
|
size,
|
|
@@ -70,40 +83,48 @@ export default class ListItemWithRadio extends React.Component {
|
|
|
70
83
|
customRadio = '',
|
|
71
84
|
customRadioWrap = ''
|
|
72
85
|
} = customClass;
|
|
73
|
-
return /*#__PURE__*/React.createElement(
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
},
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
86
|
+
return /*#__PURE__*/React.createElement(ResponsiveReceiver, {
|
|
87
|
+
query: this.responsiveFunc,
|
|
88
|
+
responsiveId: "Helmet"
|
|
89
|
+
}, _ref2 => {
|
|
90
|
+
let {
|
|
91
|
+
mobileToTab
|
|
92
|
+
} = _ref2;
|
|
93
|
+
return /*#__PURE__*/React.createElement(ListContainer, _extends({
|
|
94
|
+
a11y: a11y,
|
|
95
|
+
size: size,
|
|
96
|
+
palette: palette,
|
|
97
|
+
highlight: highlight,
|
|
98
|
+
isDisabled: isDisabled,
|
|
99
|
+
active: active,
|
|
100
|
+
autoHover: autoHover,
|
|
101
|
+
customClass: `${customListItem} ${mobileToTab && style.responsiveHeight}`,
|
|
102
|
+
dataId: dataId,
|
|
103
|
+
onClick: this.onClick,
|
|
104
|
+
onMouseOver: this.onHover,
|
|
105
|
+
eleRef: this.getRef,
|
|
106
|
+
disableTitle: disableTitle,
|
|
107
|
+
title: null,
|
|
108
|
+
customProps: ListItemProps
|
|
109
|
+
}, ContainerProps), /*#__PURE__*/React.createElement(Box, {
|
|
110
|
+
className: style.iconBox
|
|
111
|
+
}, /*#__PURE__*/React.createElement(Radio, {
|
|
112
|
+
checked: checked,
|
|
113
|
+
id: id,
|
|
114
|
+
a11y: {
|
|
115
|
+
ariaHidden: true
|
|
116
|
+
},
|
|
117
|
+
customClass: {
|
|
118
|
+
customRadio: customRadio,
|
|
119
|
+
customRadioWrap: customRadioWrap
|
|
120
|
+
}
|
|
121
|
+
})), /*#__PURE__*/React.createElement(Box, {
|
|
122
|
+
flexible: true,
|
|
123
|
+
shrink: true,
|
|
124
|
+
"data-title": disableTitle ? null : title,
|
|
125
|
+
className: style.value
|
|
126
|
+
}, value));
|
|
127
|
+
});
|
|
107
128
|
}
|
|
108
129
|
|
|
109
130
|
}
|
|
@@ -254,7 +254,9 @@ class AdvancedGroupMultiSelect extends React.Component {
|
|
|
254
254
|
}) : this.togglePopup(e);
|
|
255
255
|
}
|
|
256
256
|
|
|
257
|
-
handleClickSelectedOption(
|
|
257
|
+
handleClickSelectedOption() {
|
|
258
|
+
let id = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
259
|
+
let e = arguments.length > 1 ? arguments[1] : undefined;
|
|
258
260
|
let {
|
|
259
261
|
selectedOptionIds
|
|
260
262
|
} = this.state;
|
|
@@ -525,7 +527,11 @@ class AdvancedGroupMultiSelect extends React.Component {
|
|
|
525
527
|
});
|
|
526
528
|
}
|
|
527
529
|
|
|
528
|
-
handleFetchOptions(
|
|
530
|
+
handleFetchOptions() {
|
|
531
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
532
|
+
args[_key] = arguments[_key];
|
|
533
|
+
}
|
|
534
|
+
|
|
529
535
|
let [APICall, searchStr] = args;
|
|
530
536
|
let {
|
|
531
537
|
isFetchingOptions
|
|
@@ -638,7 +644,9 @@ class AdvancedGroupMultiSelect extends React.Component {
|
|
|
638
644
|
this.handleChange([]);
|
|
639
645
|
}
|
|
640
646
|
|
|
641
|
-
handleChange(
|
|
647
|
+
handleChange() {
|
|
648
|
+
let selectedOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
649
|
+
let e = arguments.length > 1 ? arguments[1] : undefined;
|
|
642
650
|
let {
|
|
643
651
|
onChange,
|
|
644
652
|
needToCloseOnSelect,
|
|
@@ -879,7 +887,7 @@ class AdvancedGroupMultiSelect extends React.Component {
|
|
|
879
887
|
return /*#__PURE__*/React.createElement("div", {
|
|
880
888
|
className: `${style.wrapper} ${isDisabled ? style.disabled : ''} ${needEffect && !(isDisabled || isReadOnly) ? style.effect : ''}`,
|
|
881
889
|
"data-id": `${isDisabled ? `${dataId}_disabled` : isReadOnly ? `${dataId}_readOnly` : dataId}`,
|
|
882
|
-
"data-title": isDisabled ? title :
|
|
890
|
+
"data-title": isDisabled ? title : null,
|
|
883
891
|
onClick: this.handleInputFocus
|
|
884
892
|
}, children ? /*#__PURE__*/React.createElement(Container, {
|
|
885
893
|
align: "vertical",
|
|
@@ -23,7 +23,7 @@ import style from './AdvancedMultiSelect.module.css';
|
|
|
23
23
|
/**** Methods ****/
|
|
24
24
|
|
|
25
25
|
import { getIsEmptyValue, getSearchString } from '../utils/Common.js';
|
|
26
|
-
import { filterSelectedOptions } from '../utils/dropDownUtils';
|
|
26
|
+
import { filterSelectedOptions, makeGetIsShowClearIcon } from '../utils/dropDownUtils';
|
|
27
27
|
/* eslint-disable react/sort-prop-types */
|
|
28
28
|
|
|
29
29
|
/* eslint-disable react/no-unused-prop-types */
|
|
@@ -45,6 +45,7 @@ export class AdvancedMultiSelectComponent extends MultiSelectComponent {
|
|
|
45
45
|
this.state = Object.assign({}, oldState, {
|
|
46
46
|
showedSelectedOptionsCount: !getIsEmptyValue(selectedOptionsLimit) && selectedOptionsLen > selectedOptionsLimit ? selectedOptionsLimit : selectedOptionsLen
|
|
47
47
|
});
|
|
48
|
+
this.getIsShowClearIcon = makeGetIsShowClearIcon();
|
|
48
49
|
this.handleFilterSuggestions = this.handleFilterSuggestions.bind(this);
|
|
49
50
|
this.handleChange = this.handleChange.bind(this);
|
|
50
51
|
this.handleSelectOption = this.handleSelectOption.bind(this);
|
|
@@ -76,7 +77,9 @@ export class AdvancedMultiSelectComponent extends MultiSelectComponent {
|
|
|
76
77
|
return suggestions;
|
|
77
78
|
}
|
|
78
79
|
|
|
79
|
-
handleChange(
|
|
80
|
+
handleChange() {
|
|
81
|
+
let selectedOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
82
|
+
let e = arguments.length > 1 ? arguments[1] : undefined;
|
|
80
83
|
const {
|
|
81
84
|
optionsNormalize,
|
|
82
85
|
searchStr
|
|
@@ -189,7 +192,8 @@ export class AdvancedMultiSelectComponent extends MultiSelectComponent {
|
|
|
189
192
|
imageField,
|
|
190
193
|
optionType,
|
|
191
194
|
iconName,
|
|
192
|
-
iconSize
|
|
195
|
+
iconSize,
|
|
196
|
+
disabledOptions
|
|
193
197
|
} = props;
|
|
194
198
|
return this.formatSelectedOptions({
|
|
195
199
|
options: selectedOptionDetails,
|
|
@@ -198,7 +202,8 @@ export class AdvancedMultiSelectComponent extends MultiSelectComponent {
|
|
|
198
202
|
imageField,
|
|
199
203
|
optionType,
|
|
200
204
|
iconName,
|
|
201
|
-
iconSize
|
|
205
|
+
iconSize,
|
|
206
|
+
disabledOptions
|
|
202
207
|
});
|
|
203
208
|
}
|
|
204
209
|
|
|
@@ -348,7 +353,8 @@ export class AdvancedMultiSelectComponent extends MultiSelectComponent {
|
|
|
348
353
|
isBoxPaddingNeed,
|
|
349
354
|
getFooter,
|
|
350
355
|
customProps,
|
|
351
|
-
needEffect
|
|
356
|
+
needEffect,
|
|
357
|
+
disabledOptions
|
|
352
358
|
} = this.props;
|
|
353
359
|
let {
|
|
354
360
|
SuggestionsProps = {},
|
|
@@ -380,10 +386,17 @@ export class AdvancedMultiSelectComponent extends MultiSelectComponent {
|
|
|
380
386
|
const moreCount = allselectedOptionIdsLen - showedSelectedOptionsCount;
|
|
381
387
|
const setAriaId = this.getNextAriaId();
|
|
382
388
|
const ariaErrorId = this.getNextAriaId();
|
|
389
|
+
let {
|
|
390
|
+
isShowClearIcon: isShowClear
|
|
391
|
+
} = this.getIsShowClearIcon({
|
|
392
|
+
selectedOptions,
|
|
393
|
+
disabledOptions
|
|
394
|
+
});
|
|
395
|
+
let isShowClearIcon = !isReadOnly && !isDisabled && isShowClear;
|
|
383
396
|
return /*#__PURE__*/React.createElement("div", {
|
|
384
397
|
className: `${style.wrapper} ${isDisabled ? style.disabled : ''} ${borderColor === 'transparent' ? style.transparentContainer : ''} ${needEffect && !(isDisabled || isReadOnly) ? style.effect : ''}`,
|
|
385
398
|
"data-id": dataIdMultiSelectComp,
|
|
386
|
-
"data-title": isDisabled ? title :
|
|
399
|
+
"data-title": isDisabled ? title : null,
|
|
387
400
|
onClick: this.handleInputFocus
|
|
388
401
|
}, /*#__PURE__*/React.createElement(Container, {
|
|
389
402
|
align: "vertical",
|
|
@@ -429,7 +442,7 @@ export class AdvancedMultiSelectComponent extends MultiSelectComponent {
|
|
|
429
442
|
ariaDescribedby: ariaErrorId
|
|
430
443
|
},
|
|
431
444
|
autoComplete: false
|
|
432
|
-
})),
|
|
445
|
+
})), isShowClearIcon ? /*#__PURE__*/React.createElement(Box, {
|
|
433
446
|
className: style.delete,
|
|
434
447
|
dataId: dataIdClearIcon,
|
|
435
448
|
"data-title": clearText,
|
|
@@ -23,7 +23,7 @@ import style from './MultiSelect.module.css';
|
|
|
23
23
|
/**** Methods ****/
|
|
24
24
|
|
|
25
25
|
import { debounce, scrollTo, bind, getIsEmptyValue, getSearchString } from '../utils/Common.js';
|
|
26
|
-
import { makeFormatOptions, makeGetMultiSelectFilterSuggestions as makeGetFilterSuggestions, makeGetMultiSelectSelectedOptions as makeGetSelectedOptions, makeObjectConcat, filterSelectedOptions } from '../utils/dropDownUtils';
|
|
26
|
+
import { makeFormatOptions, makeGetMultiSelectFilterSuggestions as makeGetFilterSuggestions, makeGetMultiSelectSelectedOptions as makeGetSelectedOptions, makeObjectConcat, filterSelectedOptions, makeGetIsShowClearIcon } from '../utils/dropDownUtils';
|
|
27
27
|
/* eslint-disable react/forbid-component-props */
|
|
28
28
|
|
|
29
29
|
/* eslint-disable react/no-unused-prop-types */
|
|
@@ -35,7 +35,8 @@ export class MultiSelectComponent extends React.Component {
|
|
|
35
35
|
this.getNextAriaId = getUniqueId(this);
|
|
36
36
|
this.getFilterSuggestions = makeGetFilterSuggestions();
|
|
37
37
|
this.formatOptions = makeFormatOptions();
|
|
38
|
-
this.getSelectedOptions = makeGetSelectedOptions();
|
|
38
|
+
this.getSelectedOptions = makeGetSelectedOptions();
|
|
39
|
+
this.getIsShowClearIcon = makeGetIsShowClearIcon(); //Use in AdvancedMultiSelect component
|
|
39
40
|
|
|
40
41
|
this.objectConcat = makeObjectConcat();
|
|
41
42
|
this.formatSelectedOptions = makeFormatOptions();
|
|
@@ -542,7 +543,11 @@ export class MultiSelectComponent extends React.Component {
|
|
|
542
543
|
}
|
|
543
544
|
}
|
|
544
545
|
|
|
545
|
-
handleFetchOptions(
|
|
546
|
+
handleFetchOptions() {
|
|
547
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
548
|
+
args[_key] = arguments[_key];
|
|
549
|
+
}
|
|
550
|
+
|
|
546
551
|
const [APICall, searchStr] = args;
|
|
547
552
|
const {
|
|
548
553
|
isFetchingOptions
|
|
@@ -608,7 +613,9 @@ export class MultiSelectComponent extends React.Component {
|
|
|
608
613
|
});
|
|
609
614
|
}
|
|
610
615
|
|
|
611
|
-
handleClickSelectedOption(
|
|
616
|
+
handleClickSelectedOption() {
|
|
617
|
+
let id = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
618
|
+
let e = arguments.length > 1 ? arguments[1] : undefined;
|
|
612
619
|
const {
|
|
613
620
|
selectedOptions
|
|
614
621
|
} = this.props;
|
|
@@ -689,7 +696,9 @@ export class MultiSelectComponent extends React.Component {
|
|
|
689
696
|
getNextOptions && getNextOptions(searchStr);
|
|
690
697
|
}
|
|
691
698
|
|
|
692
|
-
handleChange(
|
|
699
|
+
handleChange() {
|
|
700
|
+
let selectedOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
701
|
+
let e = arguments.length > 1 ? arguments[1] : undefined;
|
|
693
702
|
const {
|
|
694
703
|
optionsNormalize
|
|
695
704
|
} = this.state;
|
|
@@ -863,7 +872,8 @@ export class MultiSelectComponent extends React.Component {
|
|
|
863
872
|
children,
|
|
864
873
|
customChildrenClass,
|
|
865
874
|
getFooter,
|
|
866
|
-
needEffect
|
|
875
|
+
needEffect,
|
|
876
|
+
disabledOptions
|
|
867
877
|
} = this.props;
|
|
868
878
|
const {
|
|
869
879
|
clearText = 'Clear all',
|
|
@@ -889,11 +899,17 @@ export class MultiSelectComponent extends React.Component {
|
|
|
889
899
|
const suggestions = this.handleFilterSuggestions();
|
|
890
900
|
const setAriaId = this.getNextAriaId();
|
|
891
901
|
const ariaErrorId = this.getNextAriaId();
|
|
892
|
-
|
|
902
|
+
let {
|
|
903
|
+
isShowClearIcon: isShowClear
|
|
904
|
+
} = this.getIsShowClearIcon({
|
|
905
|
+
selectedOptions,
|
|
906
|
+
disabledOptions
|
|
907
|
+
});
|
|
908
|
+
const isShowClearIcon = !isReadOnly && !isDisabled && !disableAction && isShowClear;
|
|
893
909
|
return /*#__PURE__*/React.createElement("div", {
|
|
894
910
|
className: `${style.wrapper} ${isDisabled ? style.disabled : ''} ${isReadOnly ? style.readOnly : ''} ${disableAction ? CssProvider('isBlock') : ''} ${borderColor === 'transparent' ? style.transparentContainer : ''} ${needEffect && !(isDisabled || isReadOnly) ? style.effect : ''}`,
|
|
895
911
|
"data-id": `${isDisabled ? `${dataId}_disabled` : isReadOnly ? `${dataId}_readOnly` : dataId}`,
|
|
896
|
-
"data-title": isDisabled ? title :
|
|
912
|
+
"data-title": isDisabled ? title : null,
|
|
897
913
|
onClick: this.handleInputFocus
|
|
898
914
|
}, /*#__PURE__*/React.createElement(Container, {
|
|
899
915
|
align: "vertical",
|
|
@@ -118,7 +118,7 @@ class MultiSelectWithAvatarComponent extends MultiSelectComponent {
|
|
|
118
118
|
return /*#__PURE__*/React.createElement("div", {
|
|
119
119
|
className: ` ${style.wrapper} ${isDisabled ? style.disabled : ''} ${isReadOnly ? style.readOnly : ''} ${disableAction ? CssProvider('isBlock') : ''} ${borderColor === 'transparent' ? style.transparentContainer : ''} ${needEffect && !(isDisabled || isReadOnly) ? style.effect : ''}`,
|
|
120
120
|
"data-id": `${isDisabled ? `${dataId}_disabled` : isReadOnly ? `${dataId}_readOnly` : dataId}`,
|
|
121
|
-
"data-title": isDisabled ? title :
|
|
121
|
+
"data-title": isDisabled ? title : null,
|
|
122
122
|
onClick: this.handleInputFocus
|
|
123
123
|
}, /*#__PURE__*/React.createElement(Container, {
|
|
124
124
|
align: "vertical",
|
package/es/PopOver/PopOver.js
CHANGED
|
@@ -135,26 +135,25 @@ PopOver.propTypes = {
|
|
|
135
135
|
size: PropTypes.string,
|
|
136
136
|
togglePopup: PropTypes.func,
|
|
137
137
|
top: PropTypes.string
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
};
|
|
138
|
+
}; // PopOver.propTypesDescription = {
|
|
139
|
+
// right: ' ',
|
|
140
|
+
// left: ' ',
|
|
141
|
+
// top: ' ',
|
|
142
|
+
// bottom: ' ',
|
|
143
|
+
// arrowRight: ' ',
|
|
144
|
+
// arrowLeft: ' ',
|
|
145
|
+
// arrowTop: ' ',
|
|
146
|
+
// arrowBottom: ' ',
|
|
147
|
+
// arrowPosition: ' ',
|
|
148
|
+
// boxPosition: ' ',
|
|
149
|
+
// size: ' ',
|
|
150
|
+
// children: ' ',
|
|
151
|
+
// onPopupOpen: ' ',
|
|
152
|
+
// isPopupOpen: ' ',
|
|
153
|
+
// onPopupClose: ' ',
|
|
154
|
+
// getTargetRef: ' ',
|
|
155
|
+
// getContainerRef: ' '
|
|
156
|
+
// };
|
|
158
157
|
|
|
159
158
|
if (false) {
|
|
160
159
|
PopOver.docs = {
|
package/es/Popup/Popup.js
CHANGED
|
@@ -40,13 +40,17 @@ const defaultState = {
|
|
|
40
40
|
|
|
41
41
|
/* eslint-disable react/prop-types */
|
|
42
42
|
|
|
43
|
-
const Popup = function (Component
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
43
|
+
const Popup = function (Component) {
|
|
44
|
+
let group = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'global';
|
|
45
|
+
let needResizeHandling = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
46
|
+
let {
|
|
47
|
+
isAbsolutePositioningNeeded: isAbsolutePopup = true,
|
|
48
|
+
isArrow: needPopupArrow = false,
|
|
49
|
+
customOrder: customPositionOrder = [],
|
|
50
|
+
scrollDebounceTime: popupScrollDebounceTime = 0,
|
|
51
|
+
closeOnScroll: closeOnScrollPopup = false
|
|
52
|
+
} = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
53
|
+
|
|
50
54
|
class Popup extends React.Component {
|
|
51
55
|
constructor(props) {
|
|
52
56
|
super(props);
|
|
@@ -412,11 +416,13 @@ const Popup = function (Component, group = 'global', needResizeHandling = true,
|
|
|
412
416
|
e && e.nativeEvent && e.nativeEvent.stopImmediatePropagation && e.nativeEvent.stopImmediatePropagation();
|
|
413
417
|
}
|
|
414
418
|
|
|
415
|
-
handlePopupPosition(
|
|
419
|
+
handlePopupPosition() {
|
|
420
|
+
let defaultPosition = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'bottomCenter';
|
|
421
|
+
let isResizeHandling = arguments.length > 1 ? arguments[1] : undefined;
|
|
416
422
|
// isResizeHandling --->>> Window resize and dropBox resize
|
|
417
423
|
const {
|
|
418
424
|
direction
|
|
419
|
-
} = this.context;
|
|
425
|
+
} = this.context || {};
|
|
420
426
|
const {
|
|
421
427
|
placeHolderElement,
|
|
422
428
|
dropElement
|
package/es/Popup/viewPort.js
CHANGED
|
@@ -77,10 +77,12 @@ let viewPort = {
|
|
|
77
77
|
getViewPortEle: el => {
|
|
78
78
|
return el.closest('[data-viewport-container=true]') ? el.closest('[data-viewport-container=true]') : document.documentElement;
|
|
79
79
|
},
|
|
80
|
-
possibilities: (el, relativeBox, customFrame
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
80
|
+
possibilities: function (el, relativeBox, customFrame) {
|
|
81
|
+
let {
|
|
82
|
+
needArrow,
|
|
83
|
+
isAbsolute
|
|
84
|
+
} = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
85
|
+
|
|
84
86
|
if (!el) {
|
|
85
87
|
return;
|
|
86
88
|
}
|
|
@@ -301,11 +303,14 @@ let viewPort = {
|
|
|
301
303
|
bottom: relativeBoxGap.center.bottom - rectGap.bottom
|
|
302
304
|
};
|
|
303
305
|
},
|
|
304
|
-
betterView: (popup, relativeBox
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
306
|
+
betterView: function (popup, relativeBox) {
|
|
307
|
+
let defaultView = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
308
|
+
let customFrame = arguments.length > 3 ? arguments[3] : undefined;
|
|
309
|
+
let {
|
|
310
|
+
needArrow,
|
|
311
|
+
isAbsolute,
|
|
312
|
+
customOrder = []
|
|
313
|
+
} = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
|
|
309
314
|
let customScrollFrame = isAbsolute ? customFrame : '';
|
|
310
315
|
let viewPortPossibilities = viewPort.possibilities(popup, relativeBox, customScrollFrame, {
|
|
311
316
|
needArrow,
|
|
@@ -30,10 +30,11 @@ function getDeletedIndexes() {
|
|
|
30
30
|
return deletedIndexes;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
function callback({
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
function callback(_ref) {
|
|
34
|
+
let {
|
|
35
|
+
globalId,
|
|
36
|
+
deletedIndexes
|
|
37
|
+
} = _ref;
|
|
37
38
|
setGlobalId(globalId);
|
|
38
39
|
setDeletedIndexes(deletedIndexes);
|
|
39
40
|
}
|
|
@@ -3,11 +3,12 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import LibraryContextInit from './LibraryContextInit';
|
|
4
4
|
import { getLibraryConfig } from './Config';
|
|
5
5
|
|
|
6
|
-
const LibraryContextProvider =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
const LibraryContextProvider = _ref => {
|
|
7
|
+
let {
|
|
8
|
+
isReducedMotion = getLibraryConfig('isReducedMotion'),
|
|
9
|
+
direction = getLibraryConfig('direction'),
|
|
10
|
+
children
|
|
11
|
+
} = _ref;
|
|
11
12
|
const [value, setValue] = useState({
|
|
12
13
|
isReducedMotion,
|
|
13
14
|
direction
|
|
@@ -50,13 +50,14 @@ export function decreaseGlobalIds(numbers, deletedIndexes, globalId) {
|
|
|
50
50
|
deletedIndexes
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
|
-
export function useNumberGenerator({
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
53
|
+
export function useNumberGenerator(_ref) {
|
|
54
|
+
let {
|
|
55
|
+
getGlobalId,
|
|
56
|
+
prefix,
|
|
57
|
+
getGlobalPrefix,
|
|
58
|
+
getDeletedIndexes,
|
|
59
|
+
callback
|
|
60
|
+
} = _ref;
|
|
60
61
|
let presentValues = useRef([]),
|
|
61
62
|
presentIndex = useRef(0);
|
|
62
63
|
prefix = typeof prefix === 'undefined' ? '' : `${prefix}_`;
|
|
@@ -83,14 +84,15 @@ export function useNumberGenerator({
|
|
|
83
84
|
presentIndex.current = -1;
|
|
84
85
|
return getNextId;
|
|
85
86
|
}
|
|
86
|
-
export function getNumberGenerators({
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
87
|
+
export function getNumberGenerators(_ref2) {
|
|
88
|
+
let {
|
|
89
|
+
Component,
|
|
90
|
+
prefix,
|
|
91
|
+
getGlobalPrefix,
|
|
92
|
+
getGlobalId,
|
|
93
|
+
getDeletedIndexes,
|
|
94
|
+
callback
|
|
95
|
+
} = _ref2;
|
|
94
96
|
let presentIndex = 0,
|
|
95
97
|
presentValues = [],
|
|
96
98
|
{
|
|
@@ -27,10 +27,11 @@ function getDeletedIndexes() {
|
|
|
27
27
|
return deletedIndexes;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
function callback({
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
function callback(_ref) {
|
|
31
|
+
let {
|
|
32
|
+
globalId,
|
|
33
|
+
deletedIndexes
|
|
34
|
+
} = _ref;
|
|
34
35
|
setInitialZIndex(globalId);
|
|
35
36
|
setDeletedIndexes(deletedIndexes);
|
|
36
37
|
}
|
|
@@ -98,7 +98,9 @@ ResponsiveSender.propTypes = {
|
|
|
98
98
|
domRefKey: PropTypes.string,
|
|
99
99
|
responsiveId: PropTypes.string
|
|
100
100
|
};
|
|
101
|
-
export function useResponsiveReceiver(
|
|
101
|
+
export function useResponsiveReceiver() {
|
|
102
|
+
let responsiveId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultResponsiveId;
|
|
103
|
+
let query = arguments.length > 1 ? arguments[1] : undefined;
|
|
102
104
|
const [, forceUpdate] = useState();
|
|
103
105
|
const totalContextData = useContext(ResponsiveContext);
|
|
104
106
|
const validSizeContextData = totalContextData[validSizeResponsiveId];
|
|
@@ -170,13 +172,14 @@ export function useResponsiveReceiver(responsiveId = defaultResponsiveId, query)
|
|
|
170
172
|
updateLatestData();
|
|
171
173
|
return data.current;
|
|
172
174
|
}
|
|
173
|
-
export function ResponsiveReceiver({
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
175
|
+
export function ResponsiveReceiver(_ref) {
|
|
176
|
+
let {
|
|
177
|
+
children,
|
|
178
|
+
responsiveId,
|
|
179
|
+
query,
|
|
180
|
+
eleRef,
|
|
181
|
+
domRefKey
|
|
182
|
+
} = _ref;
|
|
180
183
|
const data = useResponsiveReceiver(responsiveId, query);
|
|
181
184
|
const child = children(data);
|
|
182
185
|
return eleRef ? /*#__PURE__*/React.createElement(DOMRefWrapper, {
|
|
@@ -163,7 +163,9 @@ export default class ResizeComponent extends React.Component {
|
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
165
|
|
|
166
|
-
constructChildren(
|
|
166
|
+
constructChildren() {
|
|
167
|
+
let dataCount = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
168
|
+
let responsive = arguments.length > 1 ? arguments[1] : undefined;
|
|
167
169
|
const {
|
|
168
170
|
childrenList,
|
|
169
171
|
getData
|
|
@@ -102,7 +102,8 @@ ResponsiveSender.propTypes = {
|
|
|
102
102
|
responsiveId: PropTypes.string // matcher: PropTypes.func
|
|
103
103
|
|
|
104
104
|
};
|
|
105
|
-
export function useResponsiveReceiver(
|
|
105
|
+
export function useResponsiveReceiver() {
|
|
106
|
+
let responsiveId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultResponsiveId;
|
|
106
107
|
const [_, forceUpdate] = useState();
|
|
107
108
|
let totalContextData = useContext(ResponsiveContext);
|
|
108
109
|
let contextData = totalContextData[responsiveId] || totalContextData[defaultResponsiveId]; // NOTE: this for fallback of if responsive receiver id wrong
|
|
@@ -149,7 +150,8 @@ export function useResponsiveReceiver(responsiveId = defaultResponsiveId) {
|
|
|
149
150
|
return value1 <= width && value2 >= width || breakPoint1 === breakPoint || breakPoint2 === breakPoint;
|
|
150
151
|
},
|
|
151
152
|
|
|
152
|
-
deviceOnly(
|
|
153
|
+
deviceOnly() {
|
|
154
|
+
let breakPoints = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
153
155
|
return breakPoints.includes(breakPoint);
|
|
154
156
|
},
|
|
155
157
|
|
|
@@ -174,13 +176,14 @@ export function useResponsiveReceiver(responsiveId = defaultResponsiveId) {
|
|
|
174
176
|
// ) : null;
|
|
175
177
|
// }
|
|
176
178
|
|
|
177
|
-
export function ResponsiveReceiver({
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
179
|
+
export function ResponsiveReceiver(_ref) {
|
|
180
|
+
let {
|
|
181
|
+
children,
|
|
182
|
+
responsiveId,
|
|
183
|
+
hiddenSizes,
|
|
184
|
+
eleRef,
|
|
185
|
+
domRefKey
|
|
186
|
+
} = _ref;
|
|
184
187
|
const data = useResponsiveReceiver(responsiveId);
|
|
185
188
|
const {
|
|
186
189
|
breakPoint
|