@zohodesk/components 1.0.0-temp-189.1 → 1.0.0-temp-190
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/UnValidatedFiles.html +101 -0
- package/README.md +12 -0
- package/es/DateTime/DateWidget.js +13 -4
- package/es/DropBox/DropBox.js +5 -15
- package/es/DropBox/utils/isMobilePopover.js +17 -0
- package/es/MultiSelect/MultiSelect.js +75 -92
- package/es/MultiSelect/MultiSelectWithAvatar.js +73 -90
- package/es/Tag/Tag.js +1 -1
- package/es/v1/AppContainer/AppContainer.js +6 -0
- package/es/v1/DateTime/DateWidget.js +13 -4
- package/es/v1/DropBox/DropBox.js +3 -14
- package/es/v1/DropBox/utils/isMobilePopover.js +17 -0
- package/es/v1/MultiSelect/MultiSelect.js +75 -93
- package/es/v1/MultiSelect/MultiSelectWithAvatar.js +74 -91
- package/es/v1/Select/SelectWithAvatar.js +4 -3
- package/es/v1/Select/props/propTypes.js +2 -1
- package/es/v1/Tag/Tag.js +1 -1
- package/lib/DateTime/DateWidget.js +21 -11
- package/lib/DropBox/DropBox.js +3 -13
- package/lib/DropBox/utils/isMobilePopover.js +25 -0
- package/lib/MultiSelect/MultiSelect.js +74 -91
- package/lib/MultiSelect/MultiSelectWithAvatar.js +72 -89
- package/lib/Tag/Tag.js +1 -1
- package/lib/v1/AppContainer/AppContainer.js +12 -0
- package/lib/v1/DateTime/DateWidget.js +21 -11
- package/lib/v1/DropBox/DropBox.js +3 -13
- package/lib/v1/DropBox/utils/isMobilePopover.js +25 -0
- package/lib/v1/MultiSelect/MultiSelect.js +76 -93
- package/lib/v1/MultiSelect/MultiSelectWithAvatar.js +71 -90
- package/lib/v1/Select/SelectWithAvatar.js +3 -2
- package/lib/v1/Select/props/propTypes.js +2 -1
- package/lib/v1/Tag/Tag.js +1 -1
- package/package.json +6 -6
- package/propValidationArg.json +8 -4
- package/result.json +1 -1
|
@@ -909,7 +909,8 @@ class DateWidgetComponent extends React.Component {
|
|
|
909
909
|
if (isAllowedDateType) {
|
|
910
910
|
// if (focusOrder !== oldFocusOrder) {
|
|
911
911
|
const {
|
|
912
|
-
dateFormatSelection = {}
|
|
912
|
+
dateFormatSelection = {},
|
|
913
|
+
isFocused
|
|
913
914
|
} = this.state;
|
|
914
915
|
const {
|
|
915
916
|
order = []
|
|
@@ -931,9 +932,17 @@ class DateWidgetComponent extends React.Component {
|
|
|
931
932
|
|
|
932
933
|
if (isPopupOpen) {
|
|
933
934
|
if (yearViewTypes.indexOf(focusedType) >= 0 && (!isYearView || isMonthOpen !== oldIsMonthOpen)) {
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
935
|
+
if (!isFocused && isYearView) {
|
|
936
|
+
this.DateTimeYearViewToggle(true, oldIsMonthOpen);
|
|
937
|
+
} else {
|
|
938
|
+
this.DateTimeYearViewToggle(true, isMonthOpen);
|
|
939
|
+
}
|
|
940
|
+
} else if (yearViewTypes.indexOf(focusedType) === -1) {
|
|
941
|
+
if (!isFocused && isYearView) {
|
|
942
|
+
this.DateTimeYearViewToggle(isYearView, oldIsMonthOpen);
|
|
943
|
+
} else {
|
|
944
|
+
this.DateTimeYearViewToggle(false, false);
|
|
945
|
+
}
|
|
937
946
|
}
|
|
938
947
|
} // }
|
|
939
948
|
|
package/es/v1/DropBox/DropBox.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
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
|
-
import React, { useRef,
|
|
3
|
+
import React, { useRef, useContext } from 'react';
|
|
4
4
|
import FocusScope from '@zohodesk/a11y/es/FocusScope/FocusScope';
|
|
5
5
|
import Modal from '../Modal/Modal';
|
|
6
|
-
import { getLibraryConfig } from '../../Provider/Config';
|
|
7
6
|
import LibraryContext from '../../Provider/LibraryContextInit';
|
|
8
7
|
import cssJSLogic from '../../DropBox/css/cssJSLogic';
|
|
9
8
|
import DropBoxElement from './DropBoxElement/DropBoxElement';
|
|
10
9
|
import { DropBoxDefaultProps } from './props/defaultProps';
|
|
11
10
|
import { DropBoxPropTypes } from './props/propTypes';
|
|
12
11
|
import { stopPropagation } from '../../utils/Common';
|
|
12
|
+
import isMobilePopover from './utils/isMobilePopover';
|
|
13
13
|
import style from '../../DropBox/css/DropBox.module.css';
|
|
14
14
|
export default function DropBox(props) {
|
|
15
15
|
const dropBoxRef = useRef(null);
|
|
@@ -37,18 +37,7 @@ export default function DropBox(props) {
|
|
|
37
37
|
const {
|
|
38
38
|
direction
|
|
39
39
|
} = DropBoxContext || {};
|
|
40
|
-
let
|
|
41
|
-
mobileWidth = getLibraryConfig('mobileWidth'),
|
|
42
|
-
isModel = false;
|
|
43
|
-
|
|
44
|
-
if (needResponsive) {
|
|
45
|
-
windowWidth = window.innerWidth;
|
|
46
|
-
|
|
47
|
-
if (windowWidth <= mobileWidth) {
|
|
48
|
-
isModel = true;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
40
|
+
let isModel = isMobilePopover(needResponsive);
|
|
52
41
|
const {
|
|
53
42
|
zIndexStyle
|
|
54
43
|
} = cssJSLogic(props);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { getLibraryConfig } from '../../Provider/Config';
|
|
2
|
+
export default function isMobilePopover(needResponsive) {
|
|
3
|
+
// let { needResponsive } = props;
|
|
4
|
+
let windowWidth,
|
|
5
|
+
mobileWidth = getLibraryConfig('mobileWidth'),
|
|
6
|
+
isModel = false;
|
|
7
|
+
|
|
8
|
+
if (needResponsive) {
|
|
9
|
+
windowWidth = window.innerWidth;
|
|
10
|
+
|
|
11
|
+
if (windowWidth <= mobileWidth) {
|
|
12
|
+
isModel = true;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return isModel ? true : false;
|
|
17
|
+
}
|
|
@@ -17,8 +17,8 @@ import MultiSelectHeader from './MultiSelectHeader';
|
|
|
17
17
|
import CssProvider from '../../Provider/CssProvider';
|
|
18
18
|
import { getUniqueId } from '../../Provider/IdProvider';
|
|
19
19
|
import ResponsiveDropBox from '../ResponsiveDropBox/ResponsiveDropBox';
|
|
20
|
-
import { ResponsiveReceiver } from '../Responsive/CustomResponsive';
|
|
21
20
|
import Loader from '@zohodesk/svg/lib/Loader/Loader';
|
|
21
|
+
import isMobilePopover from '../DropBox/utils/isMobilePopover';
|
|
22
22
|
/**** Icons ****/
|
|
23
23
|
|
|
24
24
|
import { Icon } from '@zohodesk/icons';
|
|
@@ -28,8 +28,8 @@ import style from '../../MultiSelect/MultiSelect.module.css';
|
|
|
28
28
|
/**** Methods ****/
|
|
29
29
|
|
|
30
30
|
import { debounce, scrollTo, bind, getIsEmptyValue, getSearchString, findScrollEnd } from '../../utils/Common.js';
|
|
31
|
-
import { makeFormatOptions, makeGetMultiSelectFilterSuggestions as makeGetFilterSuggestions, makeGetMultiSelectSelectedOptions as makeGetSelectedOptions, makeObjectConcat, filterSelectedOptions, makeGetIsShowClearIcon } from '../../utils/dropDownUtils';
|
|
32
|
-
|
|
31
|
+
import { makeFormatOptions, makeGetMultiSelectFilterSuggestions as makeGetFilterSuggestions, makeGetMultiSelectSelectedOptions as makeGetSelectedOptions, makeObjectConcat, filterSelectedOptions, makeGetIsShowClearIcon } from '../../utils/dropDownUtils'; // import { getLibraryConfig } from '../../Provider/Config';
|
|
32
|
+
|
|
33
33
|
/* eslint-disable react/forbid-component-props */
|
|
34
34
|
|
|
35
35
|
/* eslint-disable react/no-unused-prop-types */
|
|
@@ -840,17 +840,6 @@ export class MultiSelectComponent extends React.Component {
|
|
|
840
840
|
});
|
|
841
841
|
}
|
|
842
842
|
|
|
843
|
-
responsiveFunc(_ref) {
|
|
844
|
-
let {
|
|
845
|
-
mediaQueryOR
|
|
846
|
-
} = _ref;
|
|
847
|
-
return {
|
|
848
|
-
tabletMode: mediaQueryOR([{
|
|
849
|
-
maxWidth: 700
|
|
850
|
-
}])
|
|
851
|
-
};
|
|
852
|
-
}
|
|
853
|
-
|
|
854
843
|
getSelectionUI() {
|
|
855
844
|
let isResponsive = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
856
845
|
let {
|
|
@@ -1023,6 +1012,7 @@ export class MultiSelectComponent extends React.Component {
|
|
|
1023
1012
|
searchEmptyText: i18nKeys.searchEmptyText || searchEmptyMessage,
|
|
1024
1013
|
noMoreText: i18nKeys.noMoreText || noMoreOptionsMessage
|
|
1025
1014
|
});
|
|
1015
|
+
let isModel = isMobilePopover(needResponsive);
|
|
1026
1016
|
return /*#__PURE__*/React.createElement("div", {
|
|
1027
1017
|
className: `${style.wrapper} ${isDisabled ? style.disabled : ''} ${isReadOnly ? style.readOnly : ''} ${disableAction ? CssProvider('isBlock') : ''} ${borderColor === 'transparent' ? style.transparentContainer : ''} ${needEffect && !(isDisabled || isReadOnly) ? style.effect : ''}`,
|
|
1028
1018
|
"data-id": `${isDisabled ? `${dataId}_disabled` : isReadOnly ? `${dataId}_readOnly` : dataId}`,
|
|
@@ -1030,85 +1020,77 @@ export class MultiSelectComponent extends React.Component {
|
|
|
1030
1020
|
"data-title": isDisabled ? title : null,
|
|
1031
1021
|
onClick: this.handleInputFocus,
|
|
1032
1022
|
"data-selector-id": dataSelectorId
|
|
1033
|
-
}, this.getSelectionUI(), !isReadOnly && !isDisabled && !disableAction && isPopupOpen ? /*#__PURE__*/React.createElement(
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
palette: palette,
|
|
1105
|
-
i18nKeys: i18nKeys,
|
|
1106
|
-
htmlId: ariaErrorId
|
|
1107
|
-
}), isFetchingOptions && /*#__PURE__*/React.createElement(Container, {
|
|
1108
|
-
isCover: false,
|
|
1109
|
-
align: "both"
|
|
1110
|
-
}, /*#__PURE__*/React.createElement(Loader, null))), getFooter ? /*#__PURE__*/React.createElement(CardFooter, null, getFooter()) : null)));
|
|
1111
|
-
}) : null);
|
|
1023
|
+
}, this.getSelectionUI(), !isReadOnly && !isDisabled && !disableAction && isPopupOpen ? /*#__PURE__*/React.createElement(ResponsiveDropBox, {
|
|
1024
|
+
animationStyle: animationStyle,
|
|
1025
|
+
boxPosition: position || `${defaultDropBoxPosition}`,
|
|
1026
|
+
getRef: getContainerRef,
|
|
1027
|
+
isActive: isPopupReady,
|
|
1028
|
+
isAnimate: isAnimate,
|
|
1029
|
+
isArrow: false,
|
|
1030
|
+
onClick: removeClose,
|
|
1031
|
+
needResponsive: needResponsive,
|
|
1032
|
+
isPadding: false,
|
|
1033
|
+
isBoxPaddingNeed: isBoxPaddingNeed,
|
|
1034
|
+
palette: palette,
|
|
1035
|
+
htmlId: setAriaId,
|
|
1036
|
+
a11y: {
|
|
1037
|
+
role: 'listbox',
|
|
1038
|
+
ariaMultiselectable: true
|
|
1039
|
+
},
|
|
1040
|
+
size: boxSize,
|
|
1041
|
+
alignBox: "row",
|
|
1042
|
+
isResponsivePadding: getFooter ? false : true
|
|
1043
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
1044
|
+
flexible: true
|
|
1045
|
+
}, /*#__PURE__*/React.createElement(Card, {
|
|
1046
|
+
customClass: `${style.box} ${style[`${palette}Box`]}`,
|
|
1047
|
+
onScroll: this.handleScroll
|
|
1048
|
+
}, isModel && /*#__PURE__*/React.createElement(MobileHeader, {
|
|
1049
|
+
selectedOptions: selectedOptions,
|
|
1050
|
+
i18nKeys: i18nKeys,
|
|
1051
|
+
onClick: this.handlePopupClose
|
|
1052
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
1053
|
+
className: style.effect
|
|
1054
|
+
}, this.getSelectionUI(true))), needSelectAll ? /*#__PURE__*/React.createElement(CardHeader, null, /*#__PURE__*/React.createElement(MultiSelectHeader, {
|
|
1055
|
+
onSelect: this.handleSelectAll,
|
|
1056
|
+
selectAllText: selectAllText,
|
|
1057
|
+
suggestions: suggestions,
|
|
1058
|
+
dataId: dataId
|
|
1059
|
+
})) : null, isLoading ? /*#__PURE__*/React.createElement(Container, {
|
|
1060
|
+
align: "both",
|
|
1061
|
+
className: style.loader
|
|
1062
|
+
}, /*#__PURE__*/React.createElement(Loader, null)) : /*#__PURE__*/React.createElement(CardContent, {
|
|
1063
|
+
shrink: true,
|
|
1064
|
+
customClass: !isModel && dropBoxSize ? style[dropBoxSize] : '',
|
|
1065
|
+
eleRef: this.suggestionContainerRef
|
|
1066
|
+
}, isSearching ? /*#__PURE__*/React.createElement("div", {
|
|
1067
|
+
className: style[palette]
|
|
1068
|
+
}, searchText) : suggestions.length ? /*#__PURE__*/React.createElement(Suggestions, {
|
|
1069
|
+
suggestions: suggestions,
|
|
1070
|
+
getRef: this.suggestionItemRef,
|
|
1071
|
+
hoverOption: hoverOption,
|
|
1072
|
+
onClick: this.handleSelectOption,
|
|
1073
|
+
onMouseEnter: this.handleMouseEnter,
|
|
1074
|
+
needBorder: false,
|
|
1075
|
+
dataId: `${dataId}_Options`,
|
|
1076
|
+
palette: palette,
|
|
1077
|
+
selectedOptions: selectedOptionIds,
|
|
1078
|
+
a11y: {
|
|
1079
|
+
role: 'option'
|
|
1080
|
+
}
|
|
1081
|
+
}) : /*#__PURE__*/React.createElement(EmptyState, {
|
|
1082
|
+
isLoading: isFetchingOptions,
|
|
1083
|
+
options: options,
|
|
1084
|
+
searchString: searchStr,
|
|
1085
|
+
suggestions: suggestions,
|
|
1086
|
+
dataId: dataId,
|
|
1087
|
+
palette: palette,
|
|
1088
|
+
i18nKeys: i18nKeys,
|
|
1089
|
+
htmlId: ariaErrorId
|
|
1090
|
+
}), isFetchingOptions && /*#__PURE__*/React.createElement(Container, {
|
|
1091
|
+
isCover: false,
|
|
1092
|
+
align: "both"
|
|
1093
|
+
}, /*#__PURE__*/React.createElement(Loader, null))), getFooter ? /*#__PURE__*/React.createElement(CardFooter, null, getFooter()) : null))) : null);
|
|
1112
1094
|
}
|
|
1113
1095
|
|
|
1114
1096
|
}
|
|
@@ -17,12 +17,13 @@ import MobileHeader from './MobileHeader/MobileHeader';
|
|
|
17
17
|
import MultiSelectHeader from './MultiSelectHeader';
|
|
18
18
|
import CssProvider from '../../Provider/CssProvider';
|
|
19
19
|
import { getUniqueId } from '../../Provider/IdProvider';
|
|
20
|
-
import ResponsiveDropBox from '../ResponsiveDropBox/ResponsiveDropBox';
|
|
21
|
-
|
|
20
|
+
import ResponsiveDropBox from '../ResponsiveDropBox/ResponsiveDropBox'; // import { ResponsiveReceiver } from '../Responsive/CustomResponsive';
|
|
21
|
+
|
|
22
22
|
import Loader from '@zohodesk/svg/lib/Loader/Loader';
|
|
23
|
+
import isMobilePopover from '../DropBox/utils/isMobilePopover';
|
|
23
24
|
/**** Icons ****/
|
|
25
|
+
// import { Icon } from '@zohodesk/icons';
|
|
24
26
|
|
|
25
|
-
import { Icon } from '@zohodesk/icons';
|
|
26
27
|
/**** CSS ****/
|
|
27
28
|
|
|
28
29
|
import style from '../../MultiSelect/MultiSelect.module.css';
|
|
@@ -57,17 +58,6 @@ class MultiSelectWithAvatarComponent extends MultiSelectComponent {
|
|
|
57
58
|
});
|
|
58
59
|
}
|
|
59
60
|
|
|
60
|
-
responsiveFunc(_ref) {
|
|
61
|
-
let {
|
|
62
|
-
mediaQueryOR
|
|
63
|
-
} = _ref;
|
|
64
|
-
return {
|
|
65
|
-
tabletMode: mediaQueryOR([{
|
|
66
|
-
maxWidth: 700
|
|
67
|
-
}])
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
|
|
71
61
|
render() {
|
|
72
62
|
let {
|
|
73
63
|
isReadOnly,
|
|
@@ -108,6 +98,7 @@ class MultiSelectWithAvatarComponent extends MultiSelectComponent {
|
|
|
108
98
|
searchEmptyText: i18nKeys.searchEmptyText || searchEmptyMessage,
|
|
109
99
|
noMoreText: i18nKeys.noMoreText || noMoreOptionsMessage
|
|
110
100
|
});
|
|
101
|
+
let isModel = isMobilePopover(needResponsive);
|
|
111
102
|
const {
|
|
112
103
|
selectedOptions,
|
|
113
104
|
searchStr,
|
|
@@ -127,83 +118,75 @@ class MultiSelectWithAvatarComponent extends MultiSelectComponent {
|
|
|
127
118
|
"data-title": isDisabled ? title : null,
|
|
128
119
|
onClick: this.handleInputFocus,
|
|
129
120
|
"data-selector-id": dataSelectorId
|
|
130
|
-
}, this.getSelectionUI(), popUpState ? /*#__PURE__*/React.createElement(
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
palette: palette,
|
|
200
|
-
i18nKeys: i18nKeys,
|
|
201
|
-
htmlId: ariaErrorId
|
|
202
|
-
}), isFetchingOptions && /*#__PURE__*/React.createElement(Container, {
|
|
203
|
-
isCover: false,
|
|
204
|
-
align: "both"
|
|
205
|
-
}, /*#__PURE__*/React.createElement(Loader, null))))));
|
|
206
|
-
}) : null);
|
|
121
|
+
}, this.getSelectionUI(), popUpState ? /*#__PURE__*/React.createElement(ResponsiveDropBox, {
|
|
122
|
+
animationStyle: animationStyle,
|
|
123
|
+
boxPosition: position || `${defaultDropBoxPosition}Center`,
|
|
124
|
+
getRef: getContainerRef,
|
|
125
|
+
isActive: isPopupReady,
|
|
126
|
+
isAnimate: isAnimate,
|
|
127
|
+
isArrow: false,
|
|
128
|
+
onClick: removeClose,
|
|
129
|
+
needResponsive: needResponsive,
|
|
130
|
+
isPadding: false,
|
|
131
|
+
isBoxPaddingNeed: isBoxPaddingNeed,
|
|
132
|
+
palette: palette,
|
|
133
|
+
htmlId: setAriaId,
|
|
134
|
+
a11y: {
|
|
135
|
+
ariaMultiselectable: true,
|
|
136
|
+
role: 'listbox'
|
|
137
|
+
},
|
|
138
|
+
isResponsivePadding: true,
|
|
139
|
+
alignBox: "row"
|
|
140
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
141
|
+
flexible: true
|
|
142
|
+
}, /*#__PURE__*/React.createElement(Card, {
|
|
143
|
+
customClass: `${style.box} ${style[`${palette}Box`]}`,
|
|
144
|
+
onScroll: this.handleScroll
|
|
145
|
+
}, isModel && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MobileHeader, {
|
|
146
|
+
selectedOptions: selectedOptions,
|
|
147
|
+
i18nKeys: i18nKeys,
|
|
148
|
+
onClick: this.handlePopupClose
|
|
149
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
150
|
+
className: style.effect
|
|
151
|
+
}, this.getSelectionUI(true)))), needSelectAll ? /*#__PURE__*/React.createElement(CardHeader, null, /*#__PURE__*/React.createElement(MultiSelectHeader, {
|
|
152
|
+
onSelect: this.handleSelectAll,
|
|
153
|
+
selectAllText: selectAllText,
|
|
154
|
+
suggestions: suggestions,
|
|
155
|
+
dataId: dataId
|
|
156
|
+
})) : null, isLoading ? /*#__PURE__*/React.createElement(Container, {
|
|
157
|
+
align: "both",
|
|
158
|
+
className: style.loader
|
|
159
|
+
}, /*#__PURE__*/React.createElement(Loader, null)) : /*#__PURE__*/React.createElement(CardContent, {
|
|
160
|
+
shrink: true,
|
|
161
|
+
customClass: !isModel && dropBoxSize ? style[dropBoxSize] : '',
|
|
162
|
+
eleRef: this.suggestionContainerRef
|
|
163
|
+
}, suggestions.length ? /*#__PURE__*/React.createElement(Suggestions, _extends({
|
|
164
|
+
needTick: keepSelectedOptions,
|
|
165
|
+
suggestions: suggestions,
|
|
166
|
+
getRef: this.suggestionItemRef,
|
|
167
|
+
hoverOption: hoverOption,
|
|
168
|
+
onClick: this.handleSelectOption,
|
|
169
|
+
onMouseEnter: this.handleMouseEnter,
|
|
170
|
+
needBorder: false,
|
|
171
|
+
dataId: `${dataId}_Options`,
|
|
172
|
+
palette: palette,
|
|
173
|
+
selectedOptions: selectedOptionIds,
|
|
174
|
+
a11y: {
|
|
175
|
+
role: 'option'
|
|
176
|
+
}
|
|
177
|
+
}, SuggestionsProps)) : /*#__PURE__*/React.createElement(EmptyState, {
|
|
178
|
+
isLoading: isFetchingOptions,
|
|
179
|
+
options: options,
|
|
180
|
+
searchString: searchStr,
|
|
181
|
+
suggestions: suggestions,
|
|
182
|
+
dataId: dataId,
|
|
183
|
+
palette: palette,
|
|
184
|
+
i18nKeys: i18nKeys,
|
|
185
|
+
htmlId: ariaErrorId
|
|
186
|
+
}), isFetchingOptions && /*#__PURE__*/React.createElement(Container, {
|
|
187
|
+
isCover: false,
|
|
188
|
+
align: "both"
|
|
189
|
+
}, /*#__PURE__*/React.createElement(Loader, null)))))) : null);
|
|
207
190
|
}
|
|
208
191
|
|
|
209
192
|
}
|
|
@@ -10,7 +10,7 @@ import Tag from '../Tag/Tag';
|
|
|
10
10
|
import Textbox from '../TextBox/TextBox';
|
|
11
11
|
import TextBoxIcon from '../TextBoxIcon/TextBoxIcon';
|
|
12
12
|
import { Container, Box } from '../Layout';
|
|
13
|
-
import Card, { CardContent, CardHeader } from '../Card/Card';
|
|
13
|
+
import Card, { CardContent, CardHeader, CardFooter } from '../Card/Card';
|
|
14
14
|
import Suggestions from '../MultiSelect/Suggestions';
|
|
15
15
|
import EmptyState from '../MultiSelect/EmptyState';
|
|
16
16
|
import DropDownHeading from '../DropDown/DropDownHeading';
|
|
@@ -158,7 +158,8 @@ class SelectWithAvatarComponent extends SelectComponent {
|
|
|
158
158
|
htmlId,
|
|
159
159
|
needEffect,
|
|
160
160
|
isLoading,
|
|
161
|
-
dataSelectorId
|
|
161
|
+
dataSelectorId,
|
|
162
|
+
getFooter
|
|
162
163
|
} = this.props;
|
|
163
164
|
i18nKeys = Object.assign({}, i18nKeys, {
|
|
164
165
|
emptyText: i18nKeys.emptyText || emptyMessage,
|
|
@@ -321,7 +322,7 @@ class SelectWithAvatarComponent extends SelectComponent {
|
|
|
321
322
|
}), isFetchingOptions && /*#__PURE__*/React.createElement(Container, {
|
|
322
323
|
isCover: false,
|
|
323
324
|
align: "both"
|
|
324
|
-
}, /*#__PURE__*/React.createElement(Loader, null))))));
|
|
325
|
+
}, /*#__PURE__*/React.createElement(Loader, null))), getFooter ? /*#__PURE__*/React.createElement(CardFooter, null, getFooter()) : null)));
|
|
325
326
|
}) : null);
|
|
326
327
|
}
|
|
327
328
|
|
|
@@ -230,7 +230,8 @@ export const SelectWithAvatar_propTypes = { ...Select_propTypes,
|
|
|
230
230
|
htmlId: PropTypes.string,
|
|
231
231
|
needEffect: PropTypes.bool,
|
|
232
232
|
isLoading: PropTypes.bool,
|
|
233
|
-
dataSelectorId: PropTypes.string
|
|
233
|
+
dataSelectorId: PropTypes.string,
|
|
234
|
+
getFooter: PropTypes.func
|
|
234
235
|
};
|
|
235
236
|
export const SelectWithIcon_propTypes = {
|
|
236
237
|
animationStyle: PropTypes.oneOf(['default', 'bounce']),
|
package/es/v1/Tag/Tag.js
CHANGED
|
@@ -115,7 +115,7 @@ function Tag(props) {
|
|
|
115
115
|
${rounded ? style.lgRadiusClose : style.smRadiusClose} ${isDarkPalette ? style.darkTagClose : ''}
|
|
116
116
|
${customTagClose} ${style[`close${closePalette}`]}`,
|
|
117
117
|
dataId: `${dataId}_RemoveTag`,
|
|
118
|
-
|
|
118
|
+
title: closeTitle,
|
|
119
119
|
onClick: handleRemove,
|
|
120
120
|
a11y: {
|
|
121
121
|
ariaLabel: clearLabel
|
|
@@ -934,8 +934,10 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
934
934
|
|
|
935
935
|
if (isAllowedDateType) {
|
|
936
936
|
// if (focusOrder !== oldFocusOrder) {
|
|
937
|
-
var _this$
|
|
938
|
-
|
|
937
|
+
var _this$state5 = this.state,
|
|
938
|
+
_this$state5$dateForm = _this$state5.dateFormatSelection,
|
|
939
|
+
dateFormatSelection = _this$state5$dateForm === void 0 ? {} : _this$state5$dateForm,
|
|
940
|
+
isFocused = _this$state5.isFocused;
|
|
939
941
|
var _dateFormatSelection$2 = dateFormatSelection.order,
|
|
940
942
|
order = _dateFormatSelection$2 === void 0 ? [] : _dateFormatSelection$2;
|
|
941
943
|
var isPopupOpen = this.props.isPopupOpen; // const { type: oldFocusedType = '' } = order[oldFocusOrder] || {};
|
|
@@ -953,9 +955,17 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
953
955
|
|
|
954
956
|
if (isPopupOpen) {
|
|
955
957
|
if (yearViewTypes.indexOf(focusedType) >= 0 && (!isYearView || isMonthOpen !== oldIsMonthOpen)) {
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
958
|
+
if (!isFocused && isYearView) {
|
|
959
|
+
this.DateTimeYearViewToggle(true, oldIsMonthOpen);
|
|
960
|
+
} else {
|
|
961
|
+
this.DateTimeYearViewToggle(true, isMonthOpen);
|
|
962
|
+
}
|
|
963
|
+
} else if (yearViewTypes.indexOf(focusedType) === -1) {
|
|
964
|
+
if (!isFocused && isYearView) {
|
|
965
|
+
this.DateTimeYearViewToggle(isYearView, oldIsMonthOpen);
|
|
966
|
+
} else {
|
|
967
|
+
this.DateTimeYearViewToggle(false, false);
|
|
968
|
+
}
|
|
959
969
|
}
|
|
960
970
|
} // }
|
|
961
971
|
|
|
@@ -1004,12 +1014,12 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
1004
1014
|
a11y = _this$props11.a11y,
|
|
1005
1015
|
boxSize = _this$props11.boxSize,
|
|
1006
1016
|
onError = _this$props11.onError;
|
|
1007
|
-
var _this$
|
|
1008
|
-
_this$
|
|
1009
|
-
value = _this$
|
|
1010
|
-
isError = _this$
|
|
1011
|
-
isDateEdited = _this$
|
|
1012
|
-
isFocused = _this$
|
|
1017
|
+
var _this$state6 = this.state,
|
|
1018
|
+
_this$state6$selected = _this$state6.selected,
|
|
1019
|
+
value = _this$state6$selected === void 0 ? '' : _this$state6$selected,
|
|
1020
|
+
isError = _this$state6.isError,
|
|
1021
|
+
isDateEdited = _this$state6.isDateEdited,
|
|
1022
|
+
isFocused = _this$state6.isFocused;
|
|
1013
1023
|
var showValue = this.handleGetShowValue();
|
|
1014
1024
|
var isAllowedDateType = this.handleGetAllowedType();
|
|
1015
1025
|
var showClear = !(isDisabled || isReadOnly) && (isDateEdited || value) ? true : false;
|
package/lib/DropBox/DropBox.js
CHANGED
|
@@ -13,8 +13,6 @@ var _FocusScope = _interopRequireDefault(require("@zohodesk/a11y/es/FocusScope/F
|
|
|
13
13
|
|
|
14
14
|
var _Modal = _interopRequireDefault(require("../Modal/Modal"));
|
|
15
15
|
|
|
16
|
-
var _Config = require("../Provider/Config");
|
|
17
|
-
|
|
18
16
|
var _LibraryContextInit = _interopRequireDefault(require("../Provider/LibraryContextInit"));
|
|
19
17
|
|
|
20
18
|
var _cssJSLogic2 = _interopRequireDefault(require("./css/cssJSLogic"));
|
|
@@ -27,6 +25,8 @@ var _propTypes = require("./props/propTypes");
|
|
|
27
25
|
|
|
28
26
|
var _Common = require("./../utils/Common");
|
|
29
27
|
|
|
28
|
+
var _isMobilePopover = _interopRequireDefault(require("./utils/isMobilePopover"));
|
|
29
|
+
|
|
30
30
|
var _DropBoxModule = _interopRequireDefault(require("./css/DropBox.module.css"));
|
|
31
31
|
|
|
32
32
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -64,17 +64,7 @@ function DropBox(props) {
|
|
|
64
64
|
var _ref = DropBoxContext || {},
|
|
65
65
|
direction = _ref.direction;
|
|
66
66
|
|
|
67
|
-
var
|
|
68
|
-
mobileWidth = (0, _Config.getLibraryConfig)('mobileWidth'),
|
|
69
|
-
isModel = false;
|
|
70
|
-
|
|
71
|
-
if (needResponsive) {
|
|
72
|
-
windowWidth = window.innerWidth;
|
|
73
|
-
|
|
74
|
-
if (windowWidth <= mobileWidth) {
|
|
75
|
-
isModel = true;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
67
|
+
var isModel = (0, _isMobilePopover["default"])(needResponsive);
|
|
78
68
|
|
|
79
69
|
var _cssJSLogic = (0, _cssJSLogic2["default"])(props),
|
|
80
70
|
zIndexStyle = _cssJSLogic.zIndexStyle;
|