@zohodesk/components 1.2.1 → 1.2.3
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/PropValidationExcludeFilesArray.js +1 -2
- package/.cli/propValidation_report.html +1 -1
- package/README.md +12 -0
- package/assets/Appearance/dark/mode/Component_DarkMode.module.css +1 -0
- package/assets/Appearance/light/mode/Component_LightMode.module.css +1 -0
- package/assets/Appearance/pureDark/mode/Component_PureDarkMode.module.css +1 -0
- package/coverage/Button/Button.js.html +15 -3
- package/coverage/Button/css/Button.module.css.html +1 -1
- package/coverage/Button/css/cssJSLogic.js.html +1 -1
- package/coverage/Button/css/index.html +1 -1
- package/coverage/Button/index.html +1 -1
- package/coverage/Button/props/defaultProps.js.html +6 -3
- package/coverage/Button/props/index.html +1 -1
- package/coverage/Button/props/propTypes.js.html +9 -3
- package/coverage/Buttongroup/Buttongroup.js.html +1 -1
- package/coverage/Buttongroup/Buttongroup.module.css.html +1 -1
- package/coverage/Buttongroup/index.html +1 -1
- package/coverage/Buttongroup/props/defaultProps.js.html +1 -1
- package/coverage/Buttongroup/props/index.html +1 -1
- package/coverage/Buttongroup/props/propTypes.js.html +1 -1
- package/coverage/coverage-final.json +3 -3
- package/coverage/index.html +1 -1
- package/coverage/utils/dummyFunction.js.html +1 -1
- package/coverage/utils/index.html +1 -1
- package/es/Button/Button.js +6 -2
- package/es/Button/props/defaultProps.js +2 -1
- package/es/Button/props/propTypes.js +3 -1
- package/es/Heading/Heading.module.css +1 -1
- package/es/Label/Label.js +7 -2
- package/es/Label/props/propTypes.js +3 -0
- package/es/MultiSelect/AdvancedGroupMultiSelect.js +2 -3
- package/es/MultiSelect/AdvancedMultiSelect.js +2 -3
- package/es/MultiSelect/MobileHeader/MobileHeader.js +50 -0
- package/es/MultiSelect/MobileHeader/MobileHeader.module.css +16 -0
- package/es/MultiSelect/MobileHeader/props/defaultProps.js +7 -0
- package/es/MultiSelect/MobileHeader/props/propTypes.js +7 -0
- package/es/MultiSelect/MultiSelect.js +112 -91
- package/es/MultiSelect/MultiSelect.module.css +2 -5
- package/es/MultiSelect/MultiSelectHeader.js +1 -2
- package/es/MultiSelect/MultiSelectWithAvatar.js +14 -112
- package/es/MultiSelect/props/defaultProps.js +3 -1
- package/es/MultiSelect/props/propTypes.js +9 -57
- package/es/TextBox/TextBox.js +3 -3
- package/es/deprecated/PortalLayer/props/propTypes.js +3 -1
- package/lib/Button/Button.js +6 -2
- package/lib/Button/props/defaultProps.js +2 -1
- package/lib/Button/props/propTypes.js +3 -1
- package/lib/Heading/Heading.module.css +1 -1
- package/lib/Label/Label.js +6 -2
- package/lib/Label/props/propTypes.js +3 -0
- package/lib/MultiSelect/AdvancedGroupMultiSelect.js +2 -3
- package/lib/MultiSelect/AdvancedMultiSelect.js +2 -3
- package/lib/MultiSelect/MobileHeader/MobileHeader.js +62 -0
- package/lib/MultiSelect/MobileHeader/MobileHeader.module.css +16 -0
- package/lib/MultiSelect/MobileHeader/props/defaultProps.js +14 -0
- package/lib/MultiSelect/MobileHeader/props/propTypes.js +18 -0
- package/lib/MultiSelect/MultiSelect.js +116 -96
- package/lib/MultiSelect/MultiSelect.module.css +2 -5
- package/lib/MultiSelect/MultiSelectHeader.js +1 -2
- package/lib/MultiSelect/MultiSelectWithAvatar.js +17 -113
- package/lib/MultiSelect/props/defaultProps.js +3 -1
- package/lib/MultiSelect/props/propTypes.js +19 -60
- package/lib/TextBox/TextBox.js +10 -10
- package/lib/deprecated/PortalLayer/props/propTypes.js +3 -1
- package/package.json +8 -8
- package/result.json +1 -1
|
@@ -192,10 +192,7 @@
|
|
|
192
192
|
[dir=rtl] .clearIconSpace {
|
|
193
193
|
padding-left: var(--zd_size37)
|
|
194
194
|
}
|
|
195
|
-
|
|
196
|
-
/* Variable:Ignore */
|
|
197
|
-
padding: 0px 20px;
|
|
198
|
-
}
|
|
195
|
+
|
|
199
196
|
.more {
|
|
200
197
|
font-size: var(--zd_font_size14) ;
|
|
201
198
|
color: var(--zdt_multiselect_more_text);
|
|
@@ -204,4 +201,4 @@
|
|
|
204
201
|
margin-top: var(--zd_size5) ;
|
|
205
202
|
background-color: var(--zdt_multiselect_delete_bg);
|
|
206
203
|
border: 0;
|
|
207
|
-
}
|
|
204
|
+
}
|
|
@@ -12,12 +12,11 @@ export default class MultiSelectHeader extends React.PureComponent {
|
|
|
12
12
|
render() {
|
|
13
13
|
let {
|
|
14
14
|
dataId,
|
|
15
|
-
needSelectAll,
|
|
16
15
|
onSelect,
|
|
17
16
|
selectAllText,
|
|
18
17
|
suggestions
|
|
19
18
|
} = this.props;
|
|
20
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, suggestions.length > 1
|
|
19
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, suggestions.length > 1 ? /*#__PURE__*/React.createElement(ListItemWithIcon, {
|
|
21
20
|
autoHover: false,
|
|
22
21
|
value: selectAllText,
|
|
23
22
|
iconName: "ZD-androidd",
|
|
@@ -4,28 +4,25 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { MultiSelectWithAvatar_propTypes } from './props/propTypes';
|
|
6
6
|
import { MultiSelectWithAvatar_defaultProps } from './props/defaultProps';
|
|
7
|
+
import { defaultProps as MobileHeader_defaultProps } from './MobileHeader/props/defaultProps';
|
|
7
8
|
/**** Components ****/
|
|
8
9
|
|
|
9
10
|
import { MultiSelectComponent } from './MultiSelect';
|
|
10
11
|
import Popup from '../Popup/Popup';
|
|
11
|
-
import TextBoxIcon from '../TextBoxIcon/TextBoxIcon';
|
|
12
12
|
import { Container, Box } from '../Layout';
|
|
13
13
|
import Card, { CardContent, CardHeader } from '../Card/Card';
|
|
14
|
-
import SelectedOptions from './SelectedOptions';
|
|
15
14
|
import Suggestions from './Suggestions';
|
|
16
15
|
import EmptyState from './EmptyState';
|
|
17
|
-
import MultiSelectHeader from './MultiSelectHeader';
|
|
18
16
|
import CssProvider from '../Provider/CssProvider';
|
|
19
17
|
import { getUniqueId } from '../Provider/IdProvider';
|
|
20
18
|
import ResponsiveDropBox from '../ResponsiveDropBox/ResponsiveDropBox';
|
|
21
19
|
import { ResponsiveReceiver } from '../Responsive/CustomResponsive';
|
|
22
20
|
import Loader from '@zohodesk/svg/lib/Loader/Loader';
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
import { Icon } from '@zohodesk/icons';
|
|
21
|
+
import MultiSelectHeader from './MultiSelectHeader';
|
|
26
22
|
/**** CSS ****/
|
|
27
23
|
|
|
28
24
|
import style from './MultiSelect.module.css';
|
|
25
|
+
import MobileHeader from './MobileHeader/MobileHeader';
|
|
29
26
|
/*eslint-disable react/sort-prop-types*/
|
|
30
27
|
|
|
31
28
|
/* eslint-disable react/forbid-component-props */
|
|
@@ -76,7 +73,6 @@ class MultiSelectWithAvatarComponent extends MultiSelectComponent {
|
|
|
76
73
|
emptyMessage,
|
|
77
74
|
noMoreOptionsMessage,
|
|
78
75
|
dropBoxSize,
|
|
79
|
-
placeHolder,
|
|
80
76
|
isPopupOpen,
|
|
81
77
|
isPopupReady,
|
|
82
78
|
position,
|
|
@@ -86,24 +82,15 @@ class MultiSelectWithAvatarComponent extends MultiSelectComponent {
|
|
|
86
82
|
removeClose,
|
|
87
83
|
isAnimate,
|
|
88
84
|
animationStyle,
|
|
89
|
-
textBoxSize,
|
|
90
|
-
variant,
|
|
91
|
-
size,
|
|
92
85
|
isDisabled,
|
|
93
86
|
title,
|
|
94
87
|
dataId,
|
|
95
88
|
dataSelectorId,
|
|
96
89
|
needResponsive,
|
|
97
90
|
borderColor,
|
|
98
|
-
textBoxClass,
|
|
99
|
-
needBorder,
|
|
100
91
|
disableAction,
|
|
101
92
|
palette,
|
|
102
|
-
htmlId,
|
|
103
93
|
i18nKeys,
|
|
104
|
-
a11y,
|
|
105
|
-
children,
|
|
106
|
-
customChildrenClass,
|
|
107
94
|
isBoxPaddingNeed,
|
|
108
95
|
needEffect,
|
|
109
96
|
isLoading,
|
|
@@ -111,16 +98,9 @@ class MultiSelectWithAvatarComponent extends MultiSelectComponent {
|
|
|
111
98
|
customProps
|
|
112
99
|
} = this.props;
|
|
113
100
|
let {
|
|
114
|
-
TextBoxProps = {},
|
|
115
101
|
SuggestionsProps = {}
|
|
116
102
|
} = customProps;
|
|
117
|
-
|
|
118
|
-
clearText = 'Clear all'
|
|
119
|
-
} = i18nKeys;
|
|
120
|
-
const {
|
|
121
|
-
clearLabel = 'Clear all'
|
|
122
|
-
} = a11y;
|
|
123
|
-
i18nKeys = Object.assign({}, i18nKeys, {
|
|
103
|
+
i18nKeys = Object.assign({}, MobileHeader_defaultProps.i18nKeys, i18nKeys, {
|
|
124
104
|
emptyText: i18nKeys.emptyText || emptyMessage,
|
|
125
105
|
searchEmptyText: i18nKeys.searchEmptyText || searchEmptyMessage,
|
|
126
106
|
noMoreText: i18nKeys.noMoreText || noMoreOptionsMessage
|
|
@@ -129,17 +109,14 @@ class MultiSelectWithAvatarComponent extends MultiSelectComponent {
|
|
|
129
109
|
selectedOptions,
|
|
130
110
|
searchStr,
|
|
131
111
|
hoverOption,
|
|
132
|
-
highLightedSelectOptions,
|
|
133
112
|
options,
|
|
134
113
|
isFetchingOptions,
|
|
135
|
-
isActive,
|
|
136
114
|
selectedOptionIds
|
|
137
115
|
} = this.state;
|
|
138
116
|
const suggestions = this.handleFilterSuggestions();
|
|
139
117
|
const setAriaId = this.getNextAriaId();
|
|
140
118
|
const ariaErrorId = this.getNextAriaId();
|
|
141
119
|
const popUpState = !isReadOnly && !isDisabled && !disableAction && isPopupOpen;
|
|
142
|
-
const isShowClearIcon = !isReadOnly && !isDisabled && !disableAction && selectedOptions.length > 1;
|
|
143
120
|
return /*#__PURE__*/React.createElement("div", {
|
|
144
121
|
className: ` ${style.wrapper} ${isDisabled ? style.disabled : ''} ${isReadOnly ? style.readOnly : ''} ${disableAction ? CssProvider('isBlock') : ''} ${borderColor === 'transparent' ? style.transparentContainer : ''} ${needEffect && !(isDisabled || isReadOnly) ? style.effect : ''}`,
|
|
145
122
|
"data-id": `${isDisabled ? `${dataId}_disabled` : isReadOnly ? `${dataId}_readOnly` : dataId}`,
|
|
@@ -147,79 +124,7 @@ class MultiSelectWithAvatarComponent extends MultiSelectComponent {
|
|
|
147
124
|
"data-title": isDisabled ? title : null,
|
|
148
125
|
onClick: this.handleInputFocus,
|
|
149
126
|
"data-selector-id": dataSelectorId
|
|
150
|
-
}, /*#__PURE__*/React.createElement(
|
|
151
|
-
align: "vertical",
|
|
152
|
-
alignBox: "row",
|
|
153
|
-
className: `${style.container} ${style[size]} ${needBorder ? style[`borderColor_${borderColor}`] : ''} ${isActive && needBorder ? style.active : ''} ${textBoxClass ? textBoxClass : ''} ${needBorder ? style.hasBorder : ''}`,
|
|
154
|
-
eleRef: this.selectedOptionContainerRef,
|
|
155
|
-
wrap: "wrap"
|
|
156
|
-
}, /*#__PURE__*/React.createElement(SelectedOptions, {
|
|
157
|
-
selectedOptions: selectedOptions,
|
|
158
|
-
highLightedSelectOptions: highLightedSelectOptions,
|
|
159
|
-
isReadOnly: isReadOnly,
|
|
160
|
-
getRef: this.selectedOptionRef,
|
|
161
|
-
onRemove: this.handleRemoveOption,
|
|
162
|
-
onSelect: this.handleClickSelectedOption,
|
|
163
|
-
size: size,
|
|
164
|
-
palette: palette
|
|
165
|
-
}), /*#__PURE__*/React.createElement(Box, {
|
|
166
|
-
flexible: true,
|
|
167
|
-
className: style.wrapper,
|
|
168
|
-
adjust: true,
|
|
169
|
-
shrink: true
|
|
170
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
171
|
-
className: ` ${style.custmSpan} ${textBoxSize === 'xmedium' ? style.custmSpanXmedium : style.custmSpanMedium} ${isShowClearIcon ? style.clearIconSpace : ''}
|
|
172
|
-
${customChildrenClass ? customChildrenClass : ''}`
|
|
173
|
-
}, searchStr), /*#__PURE__*/React.createElement(TextBoxIcon, {
|
|
174
|
-
isDisabled: isDisabled,
|
|
175
|
-
inputRef: this.searchInputRef,
|
|
176
|
-
needBorder: false,
|
|
177
|
-
onBlur: this.handleInactive,
|
|
178
|
-
onChange: this.handleSearch,
|
|
179
|
-
onClick: this.handleInputCick,
|
|
180
|
-
onFocus: this.handleActive,
|
|
181
|
-
onKeyDown: this.handleKeyDown,
|
|
182
|
-
placeHolder: selectedOptions.length >= 1 ? '' : placeHolder,
|
|
183
|
-
size: textBoxSize,
|
|
184
|
-
value: searchStr,
|
|
185
|
-
variant: variant,
|
|
186
|
-
dataId: `${dataId}_textBox`,
|
|
187
|
-
isReadOnly: isReadOnly,
|
|
188
|
-
tabindex: isDisabled && '-1',
|
|
189
|
-
htmlId: htmlId,
|
|
190
|
-
a11y: {
|
|
191
|
-
ariaExpanded: popUpState ? true : false,
|
|
192
|
-
ariaHaspopup: true,
|
|
193
|
-
role: 'combobox',
|
|
194
|
-
ariaControls: setAriaId,
|
|
195
|
-
ariaOwns: setAriaId,
|
|
196
|
-
ariaDescribedby: ariaErrorId
|
|
197
|
-
},
|
|
198
|
-
customClass: {
|
|
199
|
-
customTBoxWrap: style.custmInputWrapper
|
|
200
|
-
},
|
|
201
|
-
autoComplete: false,
|
|
202
|
-
customProps: {
|
|
203
|
-
TextBoxProps: TextBoxProps
|
|
204
|
-
}
|
|
205
|
-
}, /*#__PURE__*/React.createElement(Container, {
|
|
206
|
-
isCover: false,
|
|
207
|
-
alignBox: "row",
|
|
208
|
-
align: "vertical",
|
|
209
|
-
className: style.iconContainer
|
|
210
|
-
}, children ? /*#__PURE__*/React.createElement(Box, {
|
|
211
|
-
dataId: `${dataId}_children`
|
|
212
|
-
}, children) : null, isShowClearIcon ? /*#__PURE__*/React.createElement(Box, {
|
|
213
|
-
className: `${style.delete} ${style[`${palette}Delete`]}`,
|
|
214
|
-
dataId: `${dataId}_clearIcon`,
|
|
215
|
-
"data-title": clearText,
|
|
216
|
-
onClick: this.handleDeselectAll,
|
|
217
|
-
tagName: "button",
|
|
218
|
-
"aria-label": clearLabel
|
|
219
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
220
|
-
name: "ZD-delete",
|
|
221
|
-
size: "15"
|
|
222
|
-
})) : null)))), popUpState ? /*#__PURE__*/React.createElement(ResponsiveReceiver, {
|
|
127
|
+
}, this.getSelectionUI(), popUpState ? /*#__PURE__*/React.createElement(ResponsiveReceiver, {
|
|
223
128
|
query: this.responsiveFunc,
|
|
224
129
|
responsiveId: "Helmet"
|
|
225
130
|
}, _ref2 => {
|
|
@@ -250,13 +155,18 @@ class MultiSelectWithAvatarComponent extends MultiSelectComponent {
|
|
|
250
155
|
}, /*#__PURE__*/React.createElement(Card, {
|
|
251
156
|
customClass: `${style.box} ${style[`${palette}Box`]}`,
|
|
252
157
|
onScroll: this.handleScroll
|
|
253
|
-
}, /*#__PURE__*/React.createElement(
|
|
254
|
-
|
|
158
|
+
}, tabletMode && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MobileHeader, {
|
|
159
|
+
selectedOptions: selectedOptions,
|
|
160
|
+
i18nKeys: i18nKeys,
|
|
161
|
+
onClick: this.handlePopupClose
|
|
162
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
163
|
+
className: style.effect
|
|
164
|
+
}, this.getSelectionUI(true)))), needSelectAll ? /*#__PURE__*/React.createElement(CardHeader, null, /*#__PURE__*/React.createElement(MultiSelectHeader, {
|
|
255
165
|
onSelect: this.handleSelectAll,
|
|
256
166
|
selectAllText: selectAllText,
|
|
257
167
|
suggestions: suggestions,
|
|
258
168
|
dataId: dataId
|
|
259
|
-
})), isLoading ? /*#__PURE__*/React.createElement(Container, {
|
|
169
|
+
})) : null, isLoading ? /*#__PURE__*/React.createElement(Container, {
|
|
260
170
|
align: "both",
|
|
261
171
|
className: style.loader
|
|
262
172
|
}, /*#__PURE__*/React.createElement(Loader, null)) : /*#__PURE__*/React.createElement(CardContent, {
|
|
@@ -300,13 +210,5 @@ MultiSelectWithAvatarComponent.defaultProps = MultiSelectWithAvatar_defaultProps
|
|
|
300
210
|
MultiSelectWithAvatarComponent.displayName = 'MultiSelectWithAvatar';
|
|
301
211
|
const MultiSelectWithAvatar = Popup(MultiSelectWithAvatarComponent);
|
|
302
212
|
MultiSelectWithAvatar.defaultProps = MultiSelectWithAvatarComponent.defaultProps;
|
|
303
|
-
MultiSelectWithAvatar.propTypes = MultiSelectWithAvatarComponent.propTypes;
|
|
304
|
-
// MultiSelectWithAvatarComponent.docs = {
|
|
305
|
-
// componentGroup: 'Form Elements',
|
|
306
|
-
// folderName: 'Style Guide'
|
|
307
|
-
// };
|
|
308
|
-
// // eslint-disable-next-line react/forbid-foreign-prop-types
|
|
309
|
-
// MultiSelectWithAvatar.propTypes = MultiSelectWithAvatarComponent.propTypes;
|
|
310
|
-
// }
|
|
311
|
-
|
|
213
|
+
MultiSelectWithAvatar.propTypes = MultiSelectWithAvatarComponent.propTypes;
|
|
312
214
|
export default MultiSelectWithAvatar;
|
|
@@ -107,7 +107,9 @@ export const MultiSelect_defaultProps = {
|
|
|
107
107
|
boxSize: 'default',
|
|
108
108
|
isLoading: false,
|
|
109
109
|
dataSelectorId: 'multiSelect',
|
|
110
|
-
keepSelectedOptions: false
|
|
110
|
+
keepSelectedOptions: false,
|
|
111
|
+
selectedOptionsCount: 0,
|
|
112
|
+
cardHeaderName: ''
|
|
111
113
|
};
|
|
112
114
|
export const MultiSelectHeader_defaultProps = {
|
|
113
115
|
dataId: 'MultiSelectHeader'
|
|
@@ -62,7 +62,8 @@ export const AdvancedGroupMultiSelect_propTypes = {
|
|
|
62
62
|
onChange: PropTypes.func,
|
|
63
63
|
needToCloseOnSelect: PropTypes.func,
|
|
64
64
|
searchStr: PropTypes.string,
|
|
65
|
-
children: PropTypes.node
|
|
65
|
+
children: PropTypes.node,
|
|
66
|
+
dataSelectorId: PropTypes.string
|
|
66
67
|
};
|
|
67
68
|
export const AdvancedMultiSelect_propTypes = {
|
|
68
69
|
id: PropTypes.string.isRequired,
|
|
@@ -164,7 +165,7 @@ export const MultiSelect_propTypes = {
|
|
|
164
165
|
borderColor: PropTypes.oneOf(['transparent', 'default', 'dark']),
|
|
165
166
|
closePopupOnly: PropTypes.func,
|
|
166
167
|
dataId: PropTypes.string,
|
|
167
|
-
defaultDropBoxPosition: PropTypes.
|
|
168
|
+
defaultDropBoxPosition: PropTypes.oneOf(['bottom', 'top', 'left', 'right']),
|
|
168
169
|
disableAction: PropTypes.bool,
|
|
169
170
|
dropBoxSize: PropTypes.oneOf(['small', 'medium', 'large']),
|
|
170
171
|
emptyMessage: PropTypes.string.isRequired,
|
|
@@ -197,7 +198,6 @@ export const MultiSelect_propTypes = {
|
|
|
197
198
|
needBorder: PropTypes.bool,
|
|
198
199
|
needLocalSearch: PropTypes.bool,
|
|
199
200
|
needResponsive: PropTypes.bool,
|
|
200
|
-
needSelectAll: PropTypes.bool,
|
|
201
201
|
needToCloseOnSelect: PropTypes.bool,
|
|
202
202
|
//For Group multiSelect
|
|
203
203
|
noMoreOptionsMessage: PropTypes.string,
|
|
@@ -219,7 +219,6 @@ export const MultiSelect_propTypes = {
|
|
|
219
219
|
removeClose: PropTypes.func,
|
|
220
220
|
searchDebounceTime: PropTypes.number,
|
|
221
221
|
searchEmptyMessage: PropTypes.string,
|
|
222
|
-
selectAllText: PropTypes.string,
|
|
223
222
|
selectedOptions: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])).isRequired,
|
|
224
223
|
size: PropTypes.oneOf(['medium', 'xmedium']),
|
|
225
224
|
textBoxClass: PropTypes.string,
|
|
@@ -239,77 +238,30 @@ export const MultiSelect_propTypes = {
|
|
|
239
238
|
boxSize: PropTypes.string,
|
|
240
239
|
isLoading: PropTypes.bool,
|
|
241
240
|
dataSelectorId: PropTypes.string,
|
|
242
|
-
keepSelectedOptions: PropTypes.bool
|
|
241
|
+
keepSelectedOptions: PropTypes.bool,
|
|
242
|
+
needSelectAll: PropTypes.bool,
|
|
243
|
+
selectAllText: PropTypes.string,
|
|
244
|
+
setAriaId: PropTypes.string,
|
|
245
|
+
ariaErrorId: PropTypes.string
|
|
243
246
|
};
|
|
244
247
|
export const MultiSelectHeader_propTypes = {
|
|
245
248
|
dataId: PropTypes.string,
|
|
246
|
-
needSelectAll: PropTypes.bool,
|
|
247
249
|
onSelect: PropTypes.func,
|
|
248
250
|
selectAllText: PropTypes.string,
|
|
249
251
|
suggestions: PropTypes.array
|
|
250
252
|
};
|
|
251
253
|
export const MultiSelectWithAvatar_propTypes = {
|
|
252
|
-
dropBoxSize: PropTypes.oneOf(['small', 'medium', 'large']),
|
|
253
254
|
options: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])), PropTypes.arrayOf(PropTypes.shape({
|
|
254
255
|
id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
255
256
|
text: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
256
257
|
photoURL: PropTypes.string
|
|
257
258
|
}))]).isRequired,
|
|
258
|
-
placeHolder: PropTypes.string,
|
|
259
|
-
emptyMessage: PropTypes.string.isRequired,
|
|
260
|
-
valueField: PropTypes.string,
|
|
261
|
-
textField: PropTypes.string,
|
|
262
259
|
imageField: PropTypes.string,
|
|
263
|
-
isReadOnly: PropTypes.bool,
|
|
264
|
-
needSelectAll: PropTypes.bool,
|
|
265
|
-
selectAllText: PropTypes.string,
|
|
266
|
-
defaultDropBoxPosition: PropTypes.oneOf(['bottom', 'top', 'left', 'right']),
|
|
267
|
-
searchEmptyMessage: PropTypes.string,
|
|
268
|
-
noMoreOptionsMessage: PropTypes.string,
|
|
269
|
-
isAnimate: PropTypes.bool,
|
|
270
|
-
animationStyle: PropTypes.string,
|
|
271
|
-
size: PropTypes.oneOf(['medium', 'xmedium']),
|
|
272
|
-
textBoxSize: PropTypes.oneOf(['small', 'medium', 'xmedium']),
|
|
273
|
-
variant: PropTypes.string,
|
|
274
|
-
isDisabled: PropTypes.bool,
|
|
275
|
-
title: PropTypes.string,
|
|
276
|
-
needResponsive: PropTypes.bool,
|
|
277
|
-
dataId: PropTypes.string,
|
|
278
|
-
borderColor: PropTypes.oneOf(['transparent', 'default']),
|
|
279
|
-
textBoxClass: PropTypes.string,
|
|
280
|
-
needBorder: PropTypes.bool,
|
|
281
|
-
disableAction: PropTypes.bool,
|
|
282
|
-
palette: PropTypes.oneOf(['default', 'dark']),
|
|
283
|
-
htmlId: PropTypes.string,
|
|
284
|
-
isBoxPaddingNeed: PropTypes.bool,
|
|
285
|
-
needEffect: PropTypes.bool,
|
|
286
|
-
keepSelectedOptions: PropTypes.bool,
|
|
287
260
|
customProps: PropTypes.shape({
|
|
288
261
|
SuggestionsProps: PropTypes.object,
|
|
289
262
|
DropBoxProps: PropTypes.object
|
|
290
263
|
}),
|
|
291
|
-
|
|
292
|
-
/**** Popup props ****/
|
|
293
|
-
isPopupOpen: PropTypes.bool,
|
|
294
|
-
isPopupReady: PropTypes.bool,
|
|
295
|
-
removeClose: PropTypes.func,
|
|
296
|
-
position: PropTypes.string,
|
|
297
|
-
getContainerRef: PropTypes.func,
|
|
298
|
-
i18nKeys: PropTypes.shape({
|
|
299
|
-
clearText: PropTypes.string,
|
|
300
|
-
loadingText: PropTypes.string,
|
|
301
|
-
emptyText: PropTypes.string,
|
|
302
|
-
noMoreText: PropTypes.string,
|
|
303
|
-
searchEmptyText: PropTypes.string
|
|
304
|
-
}),
|
|
305
|
-
a11y: PropTypes.shape({
|
|
306
|
-
clearLabel: PropTypes.string
|
|
307
|
-
}),
|
|
308
|
-
children: PropTypes.node,
|
|
309
|
-
customChildrenClass: PropTypes.string,
|
|
310
|
-
disabledOptions: PropTypes.arrayOf(PropTypes.string),
|
|
311
|
-
isLoading: PropTypes.bool,
|
|
312
|
-
dataSelectorId: PropTypes.string
|
|
264
|
+
...MultiSelect_propTypes
|
|
313
265
|
};
|
|
314
266
|
export const SelectedOptions_propTypes = {
|
|
315
267
|
getRef: PropTypes.func,
|
package/es/TextBox/TextBox.js
CHANGED
|
@@ -6,7 +6,7 @@ import { propTypes } from './props/propTypes';
|
|
|
6
6
|
/* eslint css-modules/no-unused-class: [2, { markAsUsed: ['xmedium', 'medium', 'small', 'default', 'primary', 'secondary'] }] */
|
|
7
7
|
|
|
8
8
|
import style from './TextBox.module.css';
|
|
9
|
-
export default class
|
|
9
|
+
export default class TextBox extends React.PureComponent {
|
|
10
10
|
constructor(props) {
|
|
11
11
|
super(props);
|
|
12
12
|
this.onChange = this.onChange.bind(this);
|
|
@@ -171,8 +171,8 @@ export default class Textbox extends React.PureComponent {
|
|
|
171
171
|
}
|
|
172
172
|
|
|
173
173
|
}
|
|
174
|
-
|
|
175
|
-
|
|
174
|
+
TextBox.defaultProps = defaultProps;
|
|
175
|
+
TextBox.propTypes = propTypes; // if (__DOCS__) {
|
|
176
176
|
// Textbox.docs = {
|
|
177
177
|
// componentGroup: 'Form Elements',
|
|
178
178
|
// folderName: 'Style Guide',
|
|
@@ -7,7 +7,9 @@ export const propTypes = {
|
|
|
7
7
|
portalId: PropTypes.string,
|
|
8
8
|
renderChildren: PropTypes.func,
|
|
9
9
|
saveGetFunction: PropTypes.func,
|
|
10
|
-
saveUpdateFunction: PropTypes.func
|
|
10
|
+
saveUpdateFunction: PropTypes.func,
|
|
11
|
+
isActive: PropTypes.bool,
|
|
12
|
+
name: PropTypes.string
|
|
11
13
|
};
|
|
12
14
|
export const RefElement_propTypes = {
|
|
13
15
|
Element: PropTypes.node,
|
package/lib/Button/Button.js
CHANGED
|
@@ -40,7 +40,9 @@ function Button(props) {
|
|
|
40
40
|
title = props.title,
|
|
41
41
|
dataSelectorId = props.dataSelectorId,
|
|
42
42
|
customProps = props.customProps,
|
|
43
|
-
customStyle = props.customStyle
|
|
43
|
+
customStyle = props.customStyle,
|
|
44
|
+
a11y = props.a11y,
|
|
45
|
+
id = props.id;
|
|
44
46
|
var finalStyle = (0, _utils.mergeStyle)(_ButtonModule["default"], customStyle);
|
|
45
47
|
|
|
46
48
|
var _cssJSLogic = (0, _cssJSLogic2["default"])({
|
|
@@ -62,7 +64,9 @@ function Button(props) {
|
|
|
62
64
|
type: "button",
|
|
63
65
|
ref: getRef,
|
|
64
66
|
"data-selector-id": dataSelectorId
|
|
65
|
-
}, customProps
|
|
67
|
+
}, customProps, a11y, {
|
|
68
|
+
id: id
|
|
69
|
+
}), children ? children : text, statusLower !== 'none' && needAppearance && /*#__PURE__*/_react["default"].createElement("div", {
|
|
66
70
|
className: finalStyle.overlay
|
|
67
71
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
68
72
|
className: loaderParentClass
|
|
@@ -30,7 +30,9 @@ var propTypes = {
|
|
|
30
30
|
customStatusSize: _propTypes["default"].string
|
|
31
31
|
}),
|
|
32
32
|
customStyle: _propTypes["default"].object,
|
|
33
|
-
customProps: _propTypes["default"].object
|
|
33
|
+
customProps: _propTypes["default"].object,
|
|
34
|
+
id: _propTypes["default"].string,
|
|
35
|
+
a11y: _propTypes["default"].object
|
|
34
36
|
};
|
|
35
37
|
exports.propTypes = propTypes;
|
|
36
38
|
var _default = propTypes;
|
package/lib/Label/Label.js
CHANGED
|
@@ -66,7 +66,10 @@ var Label = /*#__PURE__*/function (_React$Component) {
|
|
|
66
66
|
dataSelectorId = _this$props.dataSelectorId,
|
|
67
67
|
variant = _this$props.variant,
|
|
68
68
|
customClass = _this$props.customClass,
|
|
69
|
-
id = _this$props.id
|
|
69
|
+
id = _this$props.id,
|
|
70
|
+
_this$props$a11y = _this$props.a11y,
|
|
71
|
+
a11y = _this$props$a11y === void 0 ? {} : _this$props$a11y;
|
|
72
|
+
var tabIndex = a11y.tabIndex;
|
|
70
73
|
return /*#__PURE__*/_react["default"].createElement("label", {
|
|
71
74
|
className: "".concat(_LabelModule["default"].label, " ").concat(_LabelModule["default"][type], " ").concat(_LabelModule["default"][size], " ").concat(_LabelColorsModule["default"][palette], " ").concat(_LabelModule["default"]["font_".concat(variant)], "\n ").concat(clipped ? _LabelModule["default"].dotted : '', " ").concat(onClick ? _LabelModule["default"].pointer : _LabelModule["default"].cursor, " ").concat(customClass, " "),
|
|
72
75
|
htmlFor: htmlFor,
|
|
@@ -75,7 +78,8 @@ var Label = /*#__PURE__*/function (_React$Component) {
|
|
|
75
78
|
"data-test-id": dataId,
|
|
76
79
|
"data-selector-id": dataSelectorId,
|
|
77
80
|
onClick: onClick,
|
|
78
|
-
id: id
|
|
81
|
+
id: id,
|
|
82
|
+
tabIndex: tabIndex
|
|
79
83
|
}, text);
|
|
80
84
|
}
|
|
81
85
|
}]);
|
|
@@ -22,6 +22,9 @@ var propTypes = {
|
|
|
22
22
|
type: _propTypes["default"].oneOf(['title', 'subtitle']),
|
|
23
23
|
variant: _propTypes["default"].oneOf(['primary', 'default']),
|
|
24
24
|
customClass: _propTypes["default"].string,
|
|
25
|
+
a11y: _propTypes["default"].shape({
|
|
26
|
+
tabIndex: _propTypes["default"].string
|
|
27
|
+
}),
|
|
25
28
|
id: _propTypes["default"].string
|
|
26
29
|
};
|
|
27
30
|
exports.propTypes = propTypes;
|
|
@@ -1090,13 +1090,12 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
1090
1090
|
}, /*#__PURE__*/_react["default"].createElement(_Card["default"], {
|
|
1091
1091
|
customClass: "".concat(_MultiSelectModule["default"].box, " ").concat(_MultiSelectModule["default"]["".concat(palette, "Box")]),
|
|
1092
1092
|
onScroll: _this5.handleScroll
|
|
1093
|
-
}, /*#__PURE__*/_react["default"].createElement(_Card.CardHeader, null, /*#__PURE__*/_react["default"].createElement(_MultiSelectHeader["default"], {
|
|
1094
|
-
needSelectAll: needSelectAll,
|
|
1093
|
+
}, needSelectAll ? /*#__PURE__*/_react["default"].createElement(_Card.CardHeader, null, /*#__PURE__*/_react["default"].createElement(_MultiSelectHeader["default"], {
|
|
1095
1094
|
onSelect: _this5.handleSelectAll,
|
|
1096
1095
|
selectAllText: selectAllText,
|
|
1097
1096
|
suggestions: suggestionOptionIds,
|
|
1098
1097
|
dataId: dataId
|
|
1099
|
-
})), isDataLoaded ? /*#__PURE__*/_react["default"].createElement(_Card.CardContent, {
|
|
1098
|
+
})) : null, isDataLoaded ? /*#__PURE__*/_react["default"].createElement(_Card.CardContent, {
|
|
1100
1099
|
shrink: true,
|
|
1101
1100
|
customClass: !tabletMode && dropBoxSize ? _MultiSelectModule["default"][dropBoxSize] : '',
|
|
1102
1101
|
eleRef: _this5.suggestionContainerRef
|
|
@@ -575,13 +575,12 @@ var AdvancedMultiSelectComponent = /*#__PURE__*/function (_MultiSelectComponent)
|
|
|
575
575
|
}, /*#__PURE__*/_react["default"].createElement(_Card["default"], {
|
|
576
576
|
customClass: _MultiSelectModule["default"].box,
|
|
577
577
|
onScroll: _this4.handleScroll
|
|
578
|
-
}, /*#__PURE__*/_react["default"].createElement(_Card.CardHeader, null, /*#__PURE__*/_react["default"].createElement(_MultiSelectHeader["default"], {
|
|
579
|
-
needSelectAll: needSelectAll,
|
|
578
|
+
}, needSelectAll ? /*#__PURE__*/_react["default"].createElement(_Card.CardHeader, null, /*#__PURE__*/_react["default"].createElement(_MultiSelectHeader["default"], {
|
|
580
579
|
onSelect: _this4.handleSelectAll,
|
|
581
580
|
selectAllText: selectAllText,
|
|
582
581
|
suggestions: suggestions,
|
|
583
582
|
dataId: dataIdSelectAllEle
|
|
584
|
-
})), /*#__PURE__*/_react["default"].createElement(_Card.CardContent, {
|
|
583
|
+
})) : null, /*#__PURE__*/_react["default"].createElement(_Card.CardContent, {
|
|
585
584
|
shrink: true,
|
|
586
585
|
customClass: !tabletMode && dropBoxSize ? _MultiSelectModule["default"][dropBoxSize] : '',
|
|
587
586
|
eleRef: _this4.suggestionContainerRef
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = MobileHeader;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _Button = _interopRequireDefault(require("../../Button/Button"));
|
|
11
|
+
|
|
12
|
+
var _Layout = require("../../Layout");
|
|
13
|
+
|
|
14
|
+
var _defaultProps = require("./props/defaultProps");
|
|
15
|
+
|
|
16
|
+
var _propTypes = require("./props/propTypes");
|
|
17
|
+
|
|
18
|
+
var _MobileHeaderModule = _interopRequireDefault(require("./MobileHeader.module.css"));
|
|
19
|
+
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
21
|
+
|
|
22
|
+
function MobileHeader(props) {
|
|
23
|
+
var i18nKeys = props.i18nKeys,
|
|
24
|
+
onClick = props.onClick,
|
|
25
|
+
selectedOptions = props.selectedOptions,
|
|
26
|
+
children = props.children;
|
|
27
|
+
var i18nText = Object.assign({}, i18nKeys, {
|
|
28
|
+
mobileHeaderText: i18nKeys.mobileHeaderText ? "".concat(i18nKeys.mobileHeaderText) : "".concat(selectedOptions.length, " Selected")
|
|
29
|
+
});
|
|
30
|
+
var mobilePrimaryButtonText = i18nText.mobilePrimaryButtonText,
|
|
31
|
+
mobileSecondaryButtonText = i18nText.mobileSecondaryButtonText,
|
|
32
|
+
mobileHeaderText = i18nText.mobileHeaderText;
|
|
33
|
+
var showMobileHeader = i18nKeys.mobileHeaderText || !i18nKeys.mobileHeaderText && selectedOptions.length >= 1;
|
|
34
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
35
|
+
className: _MobileHeaderModule["default"].container
|
|
36
|
+
}, /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
37
|
+
isCover: false,
|
|
38
|
+
align: "vertical",
|
|
39
|
+
alignContent: "between",
|
|
40
|
+
alignBox: "row",
|
|
41
|
+
className: _MobileHeaderModule["default"].header
|
|
42
|
+
}, /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
43
|
+
className: _MobileHeaderModule["default"].cardHeading,
|
|
44
|
+
"data-title": showMobileHeader ? mobileHeaderText : null,
|
|
45
|
+
flexible: true
|
|
46
|
+
}, showMobileHeader && mobileHeaderText), /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
47
|
+
shrink: true
|
|
48
|
+
}, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
49
|
+
onClick: onClick,
|
|
50
|
+
isBold: true,
|
|
51
|
+
size: "medium",
|
|
52
|
+
text: selectedOptions.length >= 1 ? mobilePrimaryButtonText : mobileSecondaryButtonText,
|
|
53
|
+
palette: "plainPrimary",
|
|
54
|
+
customClass: {
|
|
55
|
+
customButton: _MobileHeaderModule["default"].buttonText
|
|
56
|
+
},
|
|
57
|
+
"data-title": mobilePrimaryButtonText
|
|
58
|
+
}))), children);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
MobileHeader.defaultProps = _defaultProps.defaultProps;
|
|
62
|
+
MobileHeader.propTypes = _propTypes.propTypes;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
.container{
|
|
2
|
+
padding: 0 var(--zd_size20) var(--zd_size12) var(--zd_size20) ;
|
|
3
|
+
}
|
|
4
|
+
.header{
|
|
5
|
+
padding-bottom: var(--zd_size4) ;
|
|
6
|
+
}
|
|
7
|
+
.cardHeading{
|
|
8
|
+
font-size: var(--zd_font_size16) ;
|
|
9
|
+
color: var(--zdt_multiselect_res_title_text);
|
|
10
|
+
composes: bold dotted from '../../common/common.module.css'
|
|
11
|
+
}
|
|
12
|
+
.buttonText{
|
|
13
|
+
font-size: var(--zd_font_size15) ;
|
|
14
|
+
composes: dotted from '../../common/common.module.css';
|
|
15
|
+
padding: 0
|
|
16
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.defaultProps = void 0;
|
|
7
|
+
var defaultProps = {
|
|
8
|
+
selectedOptions: [],
|
|
9
|
+
i18nKeys: {
|
|
10
|
+
mobilePrimaryButtonText: 'Done',
|
|
11
|
+
mobileSecondaryButtonText: 'Close'
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
exports.defaultProps = defaultProps;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.propTypes = void 0;
|
|
7
|
+
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
+
|
|
12
|
+
var propTypes = {
|
|
13
|
+
i18nKeys: _propTypes["default"].object,
|
|
14
|
+
onClick: _propTypes["default"].func,
|
|
15
|
+
selectedOptions: _propTypes["default"].array,
|
|
16
|
+
children: _propTypes["default"].node
|
|
17
|
+
};
|
|
18
|
+
exports.propTypes = propTypes;
|