@zohodesk/components 1.0.0-alpha-215 → 1.0.0-alpha-216
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 +11 -2
- package/es/ListItem/ListItemWithAvatar.js +11 -3
- package/es/ListItem/ListItemWithIcon.js +12 -4
- package/es/MultiSelect/AdvancedMultiSelect.js +19 -7
- package/es/MultiSelect/Suggestions.js +11 -2
- package/es/MultiSelect/docs/AdvancedMultiSelect__default.docs.js +18 -3
- package/es/Select/Select.js +37 -10
- package/es/Select/docs/Select__default.docs.js +79 -0
- package/es/TextBox/TextBox.js +7 -4
- package/es/TextBoxIcon/TextBoxIcon.js +13 -4
- package/es/utils/dropDownUtils.js +9 -2
- package/lib/ListItem/ListItemWithAvatar.js +9 -3
- package/lib/ListItem/ListItemWithIcon.js +11 -4
- package/lib/MultiSelect/AdvancedMultiSelect.js +19 -7
- package/lib/MultiSelect/Suggestions.js +16 -2
- package/lib/MultiSelect/docs/AdvancedMultiSelect__default.docs.js +18 -3
- package/lib/Select/Select.js +37 -10
- package/lib/Select/docs/Select__default.docs.js +79 -0
- package/lib/TextBox/TextBox.js +6 -4
- package/lib/TextBoxIcon/TextBoxIcon.js +12 -4
- package/lib/utils/dropDownUtils.js +11 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -32,9 +32,17 @@ In this Package we Provide Some Basic Components to Build Web App
|
|
|
32
32
|
- TextBoxIcon
|
|
33
33
|
- Tooltip
|
|
34
34
|
|
|
35
|
+
# 1.0.0-alpha-216
|
|
36
|
+
|
|
37
|
+
- Select component -> customProps added -> TextBoxProps ,DropdownSearchTextBoxProps, listItemProps added
|
|
38
|
+
- Suggestions component -> customProps added -> listItemProps
|
|
39
|
+
- TextBox component -> customProps added
|
|
40
|
+
- TextBoxIcon component -> customProps added -> TextBoxProps
|
|
41
|
+
|
|
35
42
|
# 1.0.0-alpha-215
|
|
36
43
|
|
|
37
|
-
- Select Search Regex
|
|
44
|
+
- Select Search Regex Changed to Lowercase
|
|
45
|
+
|
|
38
46
|
# 1.0.0-alpha-214
|
|
39
47
|
|
|
40
48
|
- Avatar, Label, Tag, Dropdown, ListItem, Multiselect missing dark palette variables moved under Themes folder files
|
|
@@ -42,9 +50,10 @@ In this Package we Provide Some Basic Components to Build Web App
|
|
|
42
50
|
# 1.0.0-alpha-213
|
|
43
51
|
|
|
44
52
|
- AnimationVariable File import removed
|
|
53
|
+
|
|
45
54
|
# 1.0.0-alpha-212
|
|
46
55
|
|
|
47
|
-
- Stencils =>
|
|
56
|
+
- Stencils => Converted to Pure Component
|
|
48
57
|
|
|
49
58
|
# 1.0.0-alpha-211
|
|
50
59
|
|
|
@@ -72,8 +72,12 @@ export default class ListItemWithAvatar extends React.PureComponent {
|
|
|
72
72
|
needAvatarTitle,
|
|
73
73
|
avatarPalette,
|
|
74
74
|
a11y,
|
|
75
|
-
customClass
|
|
75
|
+
customClass,
|
|
76
|
+
customProps
|
|
76
77
|
} = this.props;
|
|
78
|
+
let {
|
|
79
|
+
ListItemProps = {}
|
|
80
|
+
} = customProps;
|
|
77
81
|
let {
|
|
78
82
|
customListItem = '',
|
|
79
83
|
customAvatar = '',
|
|
@@ -109,7 +113,7 @@ export default class ListItemWithAvatar extends React.PureComponent {
|
|
|
109
113
|
tagName: "li",
|
|
110
114
|
dataId: `${dataIdString}_ListItemWithAvatar`,
|
|
111
115
|
"data-title": isDisabled ? disableTitle : null
|
|
112
|
-
}, options), name || imgSrc ? /*#__PURE__*/React.createElement(Box, {
|
|
116
|
+
}, options, ListItemProps), name || imgSrc ? /*#__PURE__*/React.createElement(Box, {
|
|
113
117
|
className: style.leftAvatar
|
|
114
118
|
}, isTeam ? /*#__PURE__*/React.createElement(AvatarTeam, {
|
|
115
119
|
name: name,
|
|
@@ -160,7 +164,8 @@ ListItemWithAvatar.defaultProps = {
|
|
|
160
164
|
needBorder: true,
|
|
161
165
|
needAvatarTitle: true,
|
|
162
166
|
a11y: {},
|
|
163
|
-
customClass: {}
|
|
167
|
+
customClass: {},
|
|
168
|
+
customProps: {}
|
|
164
169
|
};
|
|
165
170
|
ListItemWithAvatar.propTypes = {
|
|
166
171
|
active: PropTypes.bool,
|
|
@@ -196,6 +201,9 @@ ListItemWithAvatar.propTypes = {
|
|
|
196
201
|
customListItem: PropTypes.string,
|
|
197
202
|
customAvatar: PropTypes.string,
|
|
198
203
|
customAvatarTeam: PropTypes.string
|
|
204
|
+
}),
|
|
205
|
+
customProps: PropTypes.shape({
|
|
206
|
+
ListItemProps: PropTypes.object
|
|
199
207
|
})
|
|
200
208
|
};
|
|
201
209
|
|
|
@@ -65,8 +65,12 @@ export default class ListItemWithIcon extends React.Component {
|
|
|
65
65
|
isDisabled,
|
|
66
66
|
disableTitle,
|
|
67
67
|
a11y,
|
|
68
|
-
customClass
|
|
68
|
+
customClass,
|
|
69
|
+
customProps
|
|
69
70
|
} = this.props;
|
|
71
|
+
let {
|
|
72
|
+
ListItemProps = {}
|
|
73
|
+
} = customProps;
|
|
70
74
|
let {
|
|
71
75
|
role,
|
|
72
76
|
ariaSelected,
|
|
@@ -96,7 +100,7 @@ export default class ListItemWithIcon extends React.Component {
|
|
|
96
100
|
eleRef: this.getRef,
|
|
97
101
|
tagName: "li",
|
|
98
102
|
"data-title": isDisabled ? disableTitle : null
|
|
99
|
-
}, options), iconName && /*#__PURE__*/React.createElement(Box, {
|
|
103
|
+
}, options, ListItemProps), iconName && /*#__PURE__*/React.createElement(Box, {
|
|
100
104
|
"aria-hidden": true,
|
|
101
105
|
className: style.iconBox,
|
|
102
106
|
dataId: dataId ? `${dataId}_Icon` : `${value.toLowerCase().replace("'", '_')}_Icon`
|
|
@@ -135,7 +139,8 @@ ListItemWithIcon.defaultProps = {
|
|
|
135
139
|
value: 'List',
|
|
136
140
|
needBorder: true,
|
|
137
141
|
a11y: {},
|
|
138
|
-
customClass: ''
|
|
142
|
+
customClass: '',
|
|
143
|
+
customProps: {}
|
|
139
144
|
};
|
|
140
145
|
ListItemWithIcon.propTypes = {
|
|
141
146
|
active: PropTypes.bool,
|
|
@@ -163,7 +168,10 @@ ListItemWithIcon.propTypes = {
|
|
|
163
168
|
ariaSelected: PropTypes.bool,
|
|
164
169
|
ariaHidden: PropTypes.bool
|
|
165
170
|
}),
|
|
166
|
-
customClass: PropTypes.string
|
|
171
|
+
customClass: PropTypes.string,
|
|
172
|
+
customProps: PropTypes.shape({
|
|
173
|
+
ListItemProps: PropTypes.object
|
|
174
|
+
})
|
|
167
175
|
};
|
|
168
176
|
|
|
169
177
|
if (false) {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign || 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
|
+
|
|
1
3
|
/**** Libraries ****/
|
|
2
4
|
import React from 'react';
|
|
3
5
|
import PropTypes from 'prop-types';
|
|
@@ -346,8 +348,13 @@ export class AdvancedMultiSelectComponent extends MultiSelectComponent {
|
|
|
346
348
|
a11y,
|
|
347
349
|
borderColor,
|
|
348
350
|
isBoxPaddingNeed,
|
|
349
|
-
getFooter
|
|
351
|
+
getFooter,
|
|
352
|
+
customProps
|
|
350
353
|
} = this.props;
|
|
354
|
+
let {
|
|
355
|
+
SuggestionsProps = {},
|
|
356
|
+
DropBoxProps = {}
|
|
357
|
+
} = customProps;
|
|
351
358
|
const {
|
|
352
359
|
clearText = 'Clear all'
|
|
353
360
|
} = i18nKeys;
|
|
@@ -433,7 +440,7 @@ export class AdvancedMultiSelectComponent extends MultiSelectComponent {
|
|
|
433
440
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
434
441
|
name: "ZD-delete",
|
|
435
442
|
size: "15"
|
|
436
|
-
})) : null), !isReadOnly && !isDisabled && isPopupOpen ? /*#__PURE__*/React.createElement(DropBox, {
|
|
443
|
+
})) : null), !isReadOnly && !isDisabled && isPopupOpen ? /*#__PURE__*/React.createElement(DropBox, _extends({
|
|
437
444
|
animationStyle: animationStyle,
|
|
438
445
|
boxPosition: position || `${defaultDropBoxPosition}Center`,
|
|
439
446
|
getRef: getContainerRef,
|
|
@@ -448,7 +455,7 @@ export class AdvancedMultiSelectComponent extends MultiSelectComponent {
|
|
|
448
455
|
role: 'listbox',
|
|
449
456
|
ariaMultiselectable: true
|
|
450
457
|
}
|
|
451
|
-
}, /*#__PURE__*/React.createElement(Card, {
|
|
458
|
+
}, DropBoxProps), /*#__PURE__*/React.createElement(Card, {
|
|
452
459
|
customClass: style.box,
|
|
453
460
|
onScroll: this.handleScroll
|
|
454
461
|
}, /*#__PURE__*/React.createElement(CardHeader, null, /*#__PURE__*/React.createElement(MultiSelectHeader, {
|
|
@@ -460,7 +467,7 @@ export class AdvancedMultiSelectComponent extends MultiSelectComponent {
|
|
|
460
467
|
})), /*#__PURE__*/React.createElement(CardContent, {
|
|
461
468
|
customClass: dropBoxSize ? style[dropBoxSize] : '',
|
|
462
469
|
eleRef: this.suggestionContainerRef
|
|
463
|
-
}, suggestions.length ? /*#__PURE__*/React.createElement(Suggestions, {
|
|
470
|
+
}, suggestions.length ? /*#__PURE__*/React.createElement(Suggestions, _extends({
|
|
464
471
|
suggestions: suggestions,
|
|
465
472
|
selectedOptions: allselectedOptionIds,
|
|
466
473
|
getRef: this.suggestionItemRef,
|
|
@@ -472,7 +479,7 @@ export class AdvancedMultiSelectComponent extends MultiSelectComponent {
|
|
|
472
479
|
a11y: {
|
|
473
480
|
role: 'option'
|
|
474
481
|
}
|
|
475
|
-
}) : /*#__PURE__*/React.createElement(EmptyState, {
|
|
482
|
+
}, SuggestionsProps)) : /*#__PURE__*/React.createElement(EmptyState, {
|
|
476
483
|
isLoading: isFetchingOptions,
|
|
477
484
|
options: options,
|
|
478
485
|
searchString: searchStr,
|
|
@@ -560,7 +567,11 @@ AdvancedMultiSelectComponent.propTypes = {
|
|
|
560
567
|
isBoxPaddingNeed: PropTypes.bool,
|
|
561
568
|
isSearchClearOnSelect: PropTypes.bool,
|
|
562
569
|
disabledOptions: PropTypes.arrayOf(PropTypes.string),
|
|
563
|
-
getFooter: PropTypes.func
|
|
570
|
+
getFooter: PropTypes.func,
|
|
571
|
+
customProps: PropTypes.shape({
|
|
572
|
+
SuggestionsProps: PropTypes.object,
|
|
573
|
+
DropBoxProps: PropTypes.object
|
|
574
|
+
})
|
|
564
575
|
};
|
|
565
576
|
AdvancedMultiSelectComponent.defaultProps = {
|
|
566
577
|
animationStyle: 'bounce',
|
|
@@ -587,7 +598,8 @@ AdvancedMultiSelectComponent.defaultProps = {
|
|
|
587
598
|
a11y: {},
|
|
588
599
|
borderColor: 'default',
|
|
589
600
|
isBoxPaddingNeed: true,
|
|
590
|
-
isSearchClearOnSelect: true
|
|
601
|
+
isSearchClearOnSelect: true,
|
|
602
|
+
customProps: {}
|
|
591
603
|
};
|
|
592
604
|
AdvancedMultiSelectComponent.displayName = 'AdvancedMultiSelect';
|
|
593
605
|
const AdvancedMultiSelect = Popup(AdvancedMultiSelectComponent);
|
|
@@ -51,7 +51,8 @@ export default class Suggestions extends React.PureComponent {
|
|
|
51
51
|
icon,
|
|
52
52
|
optionType,
|
|
53
53
|
iconSize,
|
|
54
|
-
isDisabled
|
|
54
|
+
isDisabled,
|
|
55
|
+
listItemProps
|
|
55
56
|
} = suggestion;
|
|
56
57
|
const isActive = activeId === id || selectedOptions.indexOf(id) >= 0;
|
|
57
58
|
const isHighlight = hoverOption === index || id === hoverId ? true : false;
|
|
@@ -62,6 +63,13 @@ export default class Suggestions extends React.PureComponent {
|
|
|
62
63
|
isDisabled
|
|
63
64
|
};
|
|
64
65
|
|
|
66
|
+
if (listItemProps) {
|
|
67
|
+
commonProps.customProps = {
|
|
68
|
+
'ListItemProps': { ...listItemProps
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
|
|
65
73
|
if (optionType === 'avatar') {
|
|
66
74
|
return /*#__PURE__*/React.createElement(ListItemWithAvatar, _extends({}, commonProps, {
|
|
67
75
|
autoHover: false,
|
|
@@ -151,7 +159,8 @@ Suggestions.propTypes = {
|
|
|
151
159
|
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
152
160
|
photoURL: PropTypes.string,
|
|
153
161
|
logo: PropTypes.string,
|
|
154
|
-
optionType: PropTypes.string
|
|
162
|
+
optionType: PropTypes.string,
|
|
163
|
+
listItemProps: PropTypes.object
|
|
155
164
|
}))
|
|
156
165
|
};
|
|
157
166
|
Suggestions.defaultProps = {
|
|
@@ -9,10 +9,20 @@ export default class AdvancedMultiSelect__default extends Component {
|
|
|
9
9
|
this.state = {
|
|
10
10
|
options: [{
|
|
11
11
|
id: 2,
|
|
12
|
-
text: 'text2'
|
|
12
|
+
text: 'text2',
|
|
13
|
+
listItemProps: {
|
|
14
|
+
style: {
|
|
15
|
+
color: 'red'
|
|
16
|
+
}
|
|
17
|
+
}
|
|
13
18
|
}, {
|
|
14
19
|
id: 3,
|
|
15
|
-
text: 'text3'
|
|
20
|
+
text: 'text3',
|
|
21
|
+
listItemProps: {
|
|
22
|
+
style: {
|
|
23
|
+
color: 'blue'
|
|
24
|
+
}
|
|
25
|
+
}
|
|
16
26
|
}, {
|
|
17
27
|
id: 4,
|
|
18
28
|
text: 'text4'
|
|
@@ -85,7 +95,12 @@ export default class AdvancedMultiSelect__default extends Component {
|
|
|
85
95
|
noMoreText: 'No More Options .',
|
|
86
96
|
searchEmptyText: 'No Matches Found .'
|
|
87
97
|
},
|
|
88
|
-
getFooter: this.getFooter
|
|
98
|
+
getFooter: this.getFooter,
|
|
99
|
+
customProps: {
|
|
100
|
+
SuggestionsProps: {
|
|
101
|
+
needBorder: false
|
|
102
|
+
}
|
|
103
|
+
}
|
|
89
104
|
});
|
|
90
105
|
}
|
|
91
106
|
|
package/es/Select/Select.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign || 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
|
+
|
|
1
3
|
/**** Libraries ****/
|
|
2
4
|
import React, { Component } from 'react';
|
|
3
5
|
import PropTypes from 'prop-types';
|
|
@@ -246,12 +248,17 @@ export class SelectComponent extends Component {
|
|
|
246
248
|
let {
|
|
247
249
|
options,
|
|
248
250
|
valueField,
|
|
249
|
-
textField
|
|
251
|
+
textField,
|
|
252
|
+
customProps
|
|
250
253
|
} = props;
|
|
254
|
+
let {
|
|
255
|
+
listItemProps = {}
|
|
256
|
+
} = customProps;
|
|
251
257
|
return this.formatOptions({
|
|
252
258
|
options,
|
|
253
259
|
valueField,
|
|
254
|
-
textField
|
|
260
|
+
textField,
|
|
261
|
+
listItemProps
|
|
255
262
|
});
|
|
256
263
|
}
|
|
257
264
|
|
|
@@ -693,7 +700,8 @@ export class SelectComponent extends Component {
|
|
|
693
700
|
i18nKeys,
|
|
694
701
|
htmlId,
|
|
695
702
|
children,
|
|
696
|
-
iconOnHover
|
|
703
|
+
iconOnHover,
|
|
704
|
+
customProps
|
|
697
705
|
} = this.props;
|
|
698
706
|
let {
|
|
699
707
|
TextBoxIcon_i18n,
|
|
@@ -714,6 +722,11 @@ export class SelectComponent extends Component {
|
|
|
714
722
|
let suggestions = this.handleFilterSuggestions();
|
|
715
723
|
let setAriaId = this.getNextAriaId();
|
|
716
724
|
let ariaErrorId = this.getNextAriaId();
|
|
725
|
+
let {
|
|
726
|
+
TextBoxProps = {},
|
|
727
|
+
DropdownSearchTextBoxProps = {},
|
|
728
|
+
SuggestionsProps = {}
|
|
729
|
+
} = customProps;
|
|
717
730
|
return /*#__PURE__*/React.createElement("div", {
|
|
718
731
|
className: `${isParentBased || isReadOnly || isDisabled ? style.container : ''} ${style[`box_${size}`]} ${isReadOnly ? style.readonly : ''} ${borderColor === 'transparent' ? style.transparentContainer : ''} ${iconOnHover && (isReadOnly || isDisabled) ? style.iconOnHoverReadonly : iconOnHover && !(isReadOnly || isDisabled) ? style.iconOnHoverStyle : ''}`,
|
|
719
732
|
"data-title": isDisabled ? title : ''
|
|
@@ -756,7 +769,10 @@ export class SelectComponent extends Component {
|
|
|
756
769
|
borderColor: borderColor,
|
|
757
770
|
htmlId: htmlId,
|
|
758
771
|
isFocus: isPopupReady,
|
|
759
|
-
autoComplete: false
|
|
772
|
+
autoComplete: false,
|
|
773
|
+
customProps: {
|
|
774
|
+
TextBoxProps: TextBoxProps
|
|
775
|
+
}
|
|
760
776
|
}, /*#__PURE__*/React.createElement(Container, {
|
|
761
777
|
alignBox: "row",
|
|
762
778
|
align: "both"
|
|
@@ -801,7 +817,8 @@ export class SelectComponent extends Component {
|
|
|
801
817
|
borderColor: borderColor,
|
|
802
818
|
htmlId: htmlId,
|
|
803
819
|
autoComplete: false,
|
|
804
|
-
isFocus: isPopupReady
|
|
820
|
+
isFocus: isPopupReady,
|
|
821
|
+
customProps: TextBoxProps
|
|
805
822
|
})), !isReadOnly && !isDisabled && isPopupOpen ? /*#__PURE__*/React.createElement(DropBox, {
|
|
806
823
|
animationStyle: animationStyle,
|
|
807
824
|
boxPosition: position || `${defaultDropBoxPosition}Center`,
|
|
@@ -834,11 +851,14 @@ export class SelectComponent extends Component {
|
|
|
834
851
|
onClear: this.handleClearSearch,
|
|
835
852
|
dataId: `${dataId}_search`,
|
|
836
853
|
i18nKeys: TextBoxIcon_i18n,
|
|
837
|
-
autoComplete: false
|
|
854
|
+
autoComplete: false,
|
|
855
|
+
customProps: {
|
|
856
|
+
TextBoxProps: DropdownSearchTextBoxProps
|
|
857
|
+
}
|
|
838
858
|
}))) : null, /*#__PURE__*/React.createElement(CardContent, {
|
|
839
859
|
customClass: dropBoxSize ? style[dropBoxSize] : '',
|
|
840
860
|
eleRef: this.suggestionContainerRef
|
|
841
|
-
}, suggestions.length ? /*#__PURE__*/React.createElement(Suggestions, {
|
|
861
|
+
}, suggestions.length ? /*#__PURE__*/React.createElement(Suggestions, _extends({
|
|
842
862
|
activeId: selectedId,
|
|
843
863
|
suggestions: suggestions,
|
|
844
864
|
getRef: this.suggestionItemRef,
|
|
@@ -856,7 +876,7 @@ export class SelectComponent extends Component {
|
|
|
856
876
|
ariaParentRole: 'listbox',
|
|
857
877
|
role: 'option'
|
|
858
878
|
}
|
|
859
|
-
}) : /*#__PURE__*/React.createElement(EmptyState, {
|
|
879
|
+
}, SuggestionsProps)) : /*#__PURE__*/React.createElement(EmptyState, {
|
|
860
880
|
isLoading: isFetchingOptions,
|
|
861
881
|
options: options,
|
|
862
882
|
searchString: searchStr,
|
|
@@ -946,7 +966,13 @@ SelectComponent.propTypes = {
|
|
|
946
966
|
htmlId: PropTypes.string,
|
|
947
967
|
children: PropTypes.node,
|
|
948
968
|
onFocus: PropTypes.func,
|
|
949
|
-
iconOnHover: PropTypes.bool
|
|
969
|
+
iconOnHover: PropTypes.bool,
|
|
970
|
+
customProps: PropTypes.shape({
|
|
971
|
+
TextBoxProps: PropTypes.object,
|
|
972
|
+
DropdownSearchTextBoxProps: PropTypes.object,
|
|
973
|
+
listItemProps: PropTypes.object,
|
|
974
|
+
SuggestionsProps: PropTypes.object
|
|
975
|
+
})
|
|
950
976
|
};
|
|
951
977
|
SelectComponent.defaultProps = {
|
|
952
978
|
animationStyle: 'bounce',
|
|
@@ -978,7 +1004,8 @@ SelectComponent.defaultProps = {
|
|
|
978
1004
|
isParentBased: true,
|
|
979
1005
|
isSearchClearOnClose: true,
|
|
980
1006
|
i18nKeys: {},
|
|
981
|
-
iconOnHover: false
|
|
1007
|
+
iconOnHover: false,
|
|
1008
|
+
customProps: {}
|
|
982
1009
|
};
|
|
983
1010
|
SelectComponent.displayName = 'Select';
|
|
984
1011
|
let Select = Popup(SelectComponent);
|
|
@@ -37,6 +37,40 @@ let option = [{
|
|
|
37
37
|
text: 'Pineapple',
|
|
38
38
|
id: '10'
|
|
39
39
|
}];
|
|
40
|
+
let customOption = [{
|
|
41
|
+
text: 'Apple',
|
|
42
|
+
id: 0,
|
|
43
|
+
listItemProps: {
|
|
44
|
+
style: {
|
|
45
|
+
'color': 'red'
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}, {
|
|
49
|
+
text: 'Banana',
|
|
50
|
+
id: '1',
|
|
51
|
+
listItemProps: {
|
|
52
|
+
style: {
|
|
53
|
+
'color': 'orange'
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}, {
|
|
57
|
+
text: 'Blackberries',
|
|
58
|
+
id: '2',
|
|
59
|
+
listItemProps: {
|
|
60
|
+
style: {
|
|
61
|
+
'color': 'blue'
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}, {
|
|
65
|
+
text: 'Guava',
|
|
66
|
+
id: '3'
|
|
67
|
+
}, {
|
|
68
|
+
text: 'Grapes',
|
|
69
|
+
id: '4'
|
|
70
|
+
}, {
|
|
71
|
+
text: 'Jackfruit',
|
|
72
|
+
id: '5'
|
|
73
|
+
}];
|
|
40
74
|
export default class Select__default extends React.Component {
|
|
41
75
|
constructor(props) {
|
|
42
76
|
super(props);
|
|
@@ -94,6 +128,51 @@ export default class Select__default extends React.Component {
|
|
|
94
128
|
searchBoxPlaceHolder: "Search",
|
|
95
129
|
isDefaultSelectValue: false,
|
|
96
130
|
isDisabled: true
|
|
131
|
+
}), /*#__PURE__*/React.createElement("div", null, "Custom Props"), /*#__PURE__*/React.createElement(Select, {
|
|
132
|
+
options: customOption,
|
|
133
|
+
onChange: this.handleChange,
|
|
134
|
+
selectedValue: value,
|
|
135
|
+
needSearch: true,
|
|
136
|
+
emptyMessage: "No matches found",
|
|
137
|
+
placeHolder: "PlaceHolder",
|
|
138
|
+
searchBoxPlaceHolder: "Search",
|
|
139
|
+
isDefaultSelectValue: false,
|
|
140
|
+
i18nKeys: {
|
|
141
|
+
loadingText: 'Loading',
|
|
142
|
+
emptyText: 'emptyText',
|
|
143
|
+
noMoreText: 'noMoreText',
|
|
144
|
+
searchEmptyText: 'searchEmptyText',
|
|
145
|
+
TextBoxIcon_i18n: {
|
|
146
|
+
clearText: 'Clear Data'
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
customProps: {
|
|
150
|
+
listItemProps: {
|
|
151
|
+
style: {
|
|
152
|
+
'color': 'green'
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
TextBoxProps: {
|
|
156
|
+
style: {
|
|
157
|
+
'color': 'brown'
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
DropdownSearchTextBoxProps: {
|
|
161
|
+
style: {
|
|
162
|
+
'color': 'purple'
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}), /*#__PURE__*/React.createElement("div", null, "Disabled"), /*#__PURE__*/React.createElement(Select, {
|
|
167
|
+
options: option,
|
|
168
|
+
onChange: this.handleChange,
|
|
169
|
+
selectedValue: value,
|
|
170
|
+
needSearch: true,
|
|
171
|
+
emptyMessage: "No matches found",
|
|
172
|
+
placeHolder: "isDisabled",
|
|
173
|
+
searchBoxPlaceHolder: "Search",
|
|
174
|
+
isDefaultSelectValue: false,
|
|
175
|
+
isDisabled: true
|
|
97
176
|
}), /*#__PURE__*/React.createElement("div", null, "Readonly"), /*#__PURE__*/React.createElement(Select, {
|
|
98
177
|
options: option,
|
|
99
178
|
onChange: this.handleChange,
|
package/es/TextBox/TextBox.js
CHANGED
|
@@ -92,7 +92,8 @@ export default class Textbox extends React.PureComponent {
|
|
|
92
92
|
htmlId,
|
|
93
93
|
a11y,
|
|
94
94
|
customClass,
|
|
95
|
-
isFocus
|
|
95
|
+
isFocus,
|
|
96
|
+
customProps
|
|
96
97
|
} = this.props;
|
|
97
98
|
let {
|
|
98
99
|
ariaLabel,
|
|
@@ -162,7 +163,7 @@ export default class Textbox extends React.PureComponent {
|
|
|
162
163
|
value: value,
|
|
163
164
|
onKeyPress: onKeyPress,
|
|
164
165
|
onMouseDown: onMouseDown
|
|
165
|
-
}, options));
|
|
166
|
+
}, options, customProps));
|
|
166
167
|
}
|
|
167
168
|
|
|
168
169
|
}
|
|
@@ -182,7 +183,8 @@ Textbox.defaultProps = {
|
|
|
182
183
|
autoComplete: true,
|
|
183
184
|
borderColor: 'default',
|
|
184
185
|
a11y: {},
|
|
185
|
-
isFocus: false
|
|
186
|
+
isFocus: false,
|
|
187
|
+
customProps: {}
|
|
186
188
|
};
|
|
187
189
|
Textbox.propTypes = {
|
|
188
190
|
autofocus: PropTypes.bool,
|
|
@@ -233,7 +235,8 @@ Textbox.propTypes = {
|
|
|
233
235
|
ariaReadonly: PropTypes.bool,
|
|
234
236
|
ariaMultiselectable: PropTypes.bool
|
|
235
237
|
}),
|
|
236
|
-
isFocus: PropTypes.bool
|
|
238
|
+
isFocus: PropTypes.bool,
|
|
239
|
+
customProps: PropTypes.object
|
|
237
240
|
};
|
|
238
241
|
|
|
239
242
|
if (false) {
|
|
@@ -79,7 +79,8 @@ export default class TextBoxIcon extends React.Component {
|
|
|
79
79
|
customClass,
|
|
80
80
|
iconOnHover,
|
|
81
81
|
isFocus,
|
|
82
|
-
onClearMouseDown
|
|
82
|
+
onClearMouseDown,
|
|
83
|
+
customProps
|
|
83
84
|
} = this.props;
|
|
84
85
|
const {
|
|
85
86
|
isActive
|
|
@@ -93,6 +94,9 @@ export default class TextBoxIcon extends React.Component {
|
|
|
93
94
|
const {
|
|
94
95
|
clearText = 'Clear'
|
|
95
96
|
} = i18nKeys;
|
|
97
|
+
let {
|
|
98
|
+
TextBoxProps = {}
|
|
99
|
+
} = customProps;
|
|
96
100
|
return /*#__PURE__*/React.createElement(Container, {
|
|
97
101
|
alignBox: "row",
|
|
98
102
|
isCover: false,
|
|
@@ -125,7 +129,8 @@ export default class TextBoxIcon extends React.Component {
|
|
|
125
129
|
onKeyPress: onKeyPress,
|
|
126
130
|
onMouseDown: onMouseDown,
|
|
127
131
|
needBorder: false,
|
|
128
|
-
customClass: customTextBox
|
|
132
|
+
customClass: customTextBox,
|
|
133
|
+
customProps: TextBoxProps
|
|
129
134
|
}))), /*#__PURE__*/React.createElement(Box, {
|
|
130
135
|
className: `${style.iconContainer} ${customTBoxIcon}`
|
|
131
136
|
}, /*#__PURE__*/React.createElement(Container, {
|
|
@@ -169,7 +174,8 @@ TextBoxIcon.defaultProps = {
|
|
|
169
174
|
i18nKeys: {},
|
|
170
175
|
customClass: {},
|
|
171
176
|
iconOnHover: false,
|
|
172
|
-
isFocus: false
|
|
177
|
+
isFocus: false,
|
|
178
|
+
customProps: {}
|
|
173
179
|
};
|
|
174
180
|
TextBoxIcon.propTypes = {
|
|
175
181
|
borderColor: PropTypes.oneOf(['transparent', 'default', 'error']),
|
|
@@ -214,7 +220,10 @@ TextBoxIcon.propTypes = {
|
|
|
214
220
|
}),
|
|
215
221
|
iconOnHover: PropTypes.bool,
|
|
216
222
|
isFocus: PropTypes.bool,
|
|
217
|
-
onClearMouseDown: PropTypes.func
|
|
223
|
+
onClearMouseDown: PropTypes.func,
|
|
224
|
+
customProps: PropTypes.shape({
|
|
225
|
+
TextBoxProps: PropTypes.object
|
|
226
|
+
})
|
|
218
227
|
};
|
|
219
228
|
|
|
220
229
|
if (false) {
|
|
@@ -36,6 +36,8 @@ const getIsStartWithSearch = props => props.isStartsWithSearch;
|
|
|
36
36
|
|
|
37
37
|
const getDisabledOptions = props => props.disabledOptions || dummyArray;
|
|
38
38
|
|
|
39
|
+
const getListItemProps = props => props.listItemProps || '';
|
|
40
|
+
|
|
39
41
|
export const makeGetMultiSelectFilterSuggestions = () => createSelector([getOptions, getSelectedOptionsSel, getSearchStr, getNeedSearch, getIsStartWithSearch], (options, selectedOptions, searchStr, needSearch, isStartsWithSearch) => {
|
|
40
42
|
const suggestions = [];
|
|
41
43
|
const suggestionIds = [];
|
|
@@ -100,7 +102,7 @@ export const extractOptionId = id => {
|
|
|
100
102
|
};
|
|
101
103
|
}
|
|
102
104
|
};
|
|
103
|
-
export const makeFormatOptions = () => createSelector([getOptions, getValueField, getTextField, getImageField, getPrefixText, getIconName, getIconSize, getOptionType, getDisabledOptions], (options, valueField, textField, imageField, prefixText, iconName, iconSize, optionType, disabledOptions) => {
|
|
105
|
+
export const makeFormatOptions = () => createSelector([getOptions, getValueField, getTextField, getImageField, getPrefixText, getIconName, getIconSize, getOptionType, getDisabledOptions, getListItemProps], (options, valueField, textField, imageField, prefixText, iconName, iconSize, optionType, disabledOptions, listItemProps) => {
|
|
104
106
|
const revampOptions = [];
|
|
105
107
|
const remvampOptionIds = [];
|
|
106
108
|
const normalizedAllOptions = {};
|
|
@@ -114,7 +116,8 @@ export const makeFormatOptions = () => createSelector([getOptions, getValueField
|
|
|
114
116
|
imageField: impImageField,
|
|
115
117
|
optionType: impOptionType,
|
|
116
118
|
iconName: impIconName,
|
|
117
|
-
iconSize: impIconSize
|
|
119
|
+
iconSize: impIconSize,
|
|
120
|
+
listItemProps: listStyle
|
|
118
121
|
} = option;
|
|
119
122
|
let id = typeof option === 'object' ? option[impValueField || valueField] : option;
|
|
120
123
|
const value = typeof option === 'object' ? option[impTextField || textField] : option;
|
|
@@ -146,6 +149,10 @@ export const makeFormatOptions = () => createSelector([getOptions, getValueField
|
|
|
146
149
|
optionDetails.isDisabled = disabledOptions.indexOf(id) >= 0;
|
|
147
150
|
}
|
|
148
151
|
|
|
152
|
+
if (listStyle || listItemProps) {
|
|
153
|
+
optionDetails.listItemProps = listStyle || listItemProps;
|
|
154
|
+
}
|
|
155
|
+
|
|
149
156
|
normalizedFormatOptions[id] = optionDetails;
|
|
150
157
|
normalizedAllOptions[id] = option;
|
|
151
158
|
revampOptions.push(optionDetails);
|
|
@@ -121,7 +121,10 @@ var ListItemWithAvatar = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
121
121
|
needAvatarTitle = _this$props4.needAvatarTitle,
|
|
122
122
|
avatarPalette = _this$props4.avatarPalette,
|
|
123
123
|
a11y = _this$props4.a11y,
|
|
124
|
-
customClass = _this$props4.customClass
|
|
124
|
+
customClass = _this$props4.customClass,
|
|
125
|
+
customProps = _this$props4.customProps;
|
|
126
|
+
var _customProps$ListItem = customProps.ListItemProps,
|
|
127
|
+
ListItemProps = _customProps$ListItem === void 0 ? {} : _customProps$ListItem;
|
|
125
128
|
var _customClass$customLi = customClass.customListItem,
|
|
126
129
|
customListItem = _customClass$customLi === void 0 ? '' : _customClass$customLi,
|
|
127
130
|
_customClass$customAv = customClass.customAvatar,
|
|
@@ -157,7 +160,7 @@ var ListItemWithAvatar = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
157
160
|
tagName: "li",
|
|
158
161
|
dataId: "".concat(dataIdString, "_ListItemWithAvatar"),
|
|
159
162
|
"data-title": isDisabled ? disableTitle : null
|
|
160
|
-
}, options), name || imgSrc ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
163
|
+
}, options, ListItemProps), name || imgSrc ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
161
164
|
className: _ListItemModule["default"].leftAvatar
|
|
162
165
|
}, isTeam ? /*#__PURE__*/_react["default"].createElement(_AvatarTeam["default"], {
|
|
163
166
|
name: name,
|
|
@@ -212,7 +215,8 @@ ListItemWithAvatar.defaultProps = {
|
|
|
212
215
|
needBorder: true,
|
|
213
216
|
needAvatarTitle: true,
|
|
214
217
|
a11y: {},
|
|
215
|
-
customClass: {}
|
|
218
|
+
customClass: {},
|
|
219
|
+
customProps: {}
|
|
216
220
|
};
|
|
217
221
|
ListItemWithAvatar.propTypes = (_ListItemWithAvatar$p = {
|
|
218
222
|
active: _propTypes["default"].bool,
|
|
@@ -226,6 +230,8 @@ ListItemWithAvatar.propTypes = (_ListItemWithAvatar$p = {
|
|
|
226
230
|
customListItem: _propTypes["default"].string,
|
|
227
231
|
customAvatar: _propTypes["default"].string,
|
|
228
232
|
customAvatarTeam: _propTypes["default"].string
|
|
233
|
+
})), _defineProperty(_ListItemWithAvatar$p, "customProps", _propTypes["default"].shape({
|
|
234
|
+
ListItemProps: _propTypes["default"].object
|
|
229
235
|
})), _ListItemWithAvatar$p);
|
|
230
236
|
|
|
231
237
|
if (false) {
|
|
@@ -110,7 +110,10 @@ var ListItemWithIcon = /*#__PURE__*/function (_React$Component) {
|
|
|
110
110
|
isDisabled = _this$props4.isDisabled,
|
|
111
111
|
disableTitle = _this$props4.disableTitle,
|
|
112
112
|
a11y = _this$props4.a11y,
|
|
113
|
-
customClass = _this$props4.customClass
|
|
113
|
+
customClass = _this$props4.customClass,
|
|
114
|
+
customProps = _this$props4.customProps;
|
|
115
|
+
var _customProps$ListItem = customProps.ListItemProps,
|
|
116
|
+
ListItemProps = _customProps$ListItem === void 0 ? {} : _customProps$ListItem;
|
|
114
117
|
var role = a11y.role,
|
|
115
118
|
ariaSelected = a11y.ariaSelected,
|
|
116
119
|
_a11y$ariaHidden = a11y.ariaHidden,
|
|
@@ -139,7 +142,7 @@ var ListItemWithIcon = /*#__PURE__*/function (_React$Component) {
|
|
|
139
142
|
eleRef: this.getRef,
|
|
140
143
|
tagName: "li",
|
|
141
144
|
"data-title": isDisabled ? disableTitle : null
|
|
142
|
-
}, options), iconName && /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
145
|
+
}, options, ListItemProps), iconName && /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
143
146
|
"aria-hidden": true,
|
|
144
147
|
className: _ListItemModule["default"].iconBox,
|
|
145
148
|
dataId: dataId ? "".concat(dataId, "_Icon") : "".concat(value.toLowerCase().replace("'", '_'), "_Icon")
|
|
@@ -182,7 +185,8 @@ ListItemWithIcon.defaultProps = {
|
|
|
182
185
|
value: 'List',
|
|
183
186
|
needBorder: true,
|
|
184
187
|
a11y: {},
|
|
185
|
-
customClass: ''
|
|
188
|
+
customClass: '',
|
|
189
|
+
customProps: {}
|
|
186
190
|
};
|
|
187
191
|
ListItemWithIcon.propTypes = {
|
|
188
192
|
active: _propTypes["default"].bool,
|
|
@@ -210,7 +214,10 @@ ListItemWithIcon.propTypes = {
|
|
|
210
214
|
ariaSelected: _propTypes["default"].bool,
|
|
211
215
|
ariaHidden: _propTypes["default"].bool
|
|
212
216
|
}),
|
|
213
|
-
customClass: _propTypes["default"].string
|
|
217
|
+
customClass: _propTypes["default"].string,
|
|
218
|
+
customProps: _propTypes["default"].shape({
|
|
219
|
+
ListItemProps: _propTypes["default"].object
|
|
220
|
+
})
|
|
214
221
|
};
|
|
215
222
|
|
|
216
223
|
if (false) {
|
|
@@ -47,6 +47,8 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
47
47
|
|
|
48
48
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
49
49
|
|
|
50
|
+
function _extends() { _extends = Object.assign || 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); }
|
|
51
|
+
|
|
50
52
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
51
53
|
|
|
52
54
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -408,7 +410,12 @@ var AdvancedMultiSelectComponent = /*#__PURE__*/function (_MultiSelectComponent)
|
|
|
408
410
|
a11y = _this$props5.a11y,
|
|
409
411
|
borderColor = _this$props5.borderColor,
|
|
410
412
|
isBoxPaddingNeed = _this$props5.isBoxPaddingNeed,
|
|
411
|
-
getFooter = _this$props5.getFooter
|
|
413
|
+
getFooter = _this$props5.getFooter,
|
|
414
|
+
customProps = _this$props5.customProps;
|
|
415
|
+
var _customProps$Suggesti = customProps.SuggestionsProps,
|
|
416
|
+
SuggestionsProps = _customProps$Suggesti === void 0 ? {} : _customProps$Suggesti,
|
|
417
|
+
_customProps$DropBoxP = customProps.DropBoxProps,
|
|
418
|
+
DropBoxProps = _customProps$DropBoxP === void 0 ? {} : _customProps$DropBoxP;
|
|
412
419
|
var _i18nKeys = i18nKeys,
|
|
413
420
|
_i18nKeys$clearText = _i18nKeys.clearText,
|
|
414
421
|
clearText = _i18nKeys$clearText === void 0 ? 'Clear all' : _i18nKeys$clearText;
|
|
@@ -492,7 +499,7 @@ var AdvancedMultiSelectComponent = /*#__PURE__*/function (_MultiSelectComponent)
|
|
|
492
499
|
}, /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
|
|
493
500
|
name: "ZD-delete",
|
|
494
501
|
size: "15"
|
|
495
|
-
})) : null), !isReadOnly && !isDisabled && isPopupOpen ? /*#__PURE__*/_react["default"].createElement(_DropBox["default"], {
|
|
502
|
+
})) : null), !isReadOnly && !isDisabled && isPopupOpen ? /*#__PURE__*/_react["default"].createElement(_DropBox["default"], _extends({
|
|
496
503
|
animationStyle: animationStyle,
|
|
497
504
|
boxPosition: position || "".concat(defaultDropBoxPosition, "Center"),
|
|
498
505
|
getRef: getContainerRef,
|
|
@@ -507,7 +514,7 @@ var AdvancedMultiSelectComponent = /*#__PURE__*/function (_MultiSelectComponent)
|
|
|
507
514
|
role: 'listbox',
|
|
508
515
|
ariaMultiselectable: true
|
|
509
516
|
}
|
|
510
|
-
}, /*#__PURE__*/_react["default"].createElement(_Card["default"], {
|
|
517
|
+
}, DropBoxProps), /*#__PURE__*/_react["default"].createElement(_Card["default"], {
|
|
511
518
|
customClass: _AdvancedMultiSelectModule["default"].box,
|
|
512
519
|
onScroll: this.handleScroll
|
|
513
520
|
}, /*#__PURE__*/_react["default"].createElement(_Card.CardHeader, null, /*#__PURE__*/_react["default"].createElement(_MultiSelectHeader["default"], {
|
|
@@ -519,7 +526,7 @@ var AdvancedMultiSelectComponent = /*#__PURE__*/function (_MultiSelectComponent)
|
|
|
519
526
|
})), /*#__PURE__*/_react["default"].createElement(_Card.CardContent, {
|
|
520
527
|
customClass: dropBoxSize ? _AdvancedMultiSelectModule["default"][dropBoxSize] : '',
|
|
521
528
|
eleRef: this.suggestionContainerRef
|
|
522
|
-
}, suggestions.length ? /*#__PURE__*/_react["default"].createElement(_Suggestions["default"], {
|
|
529
|
+
}, suggestions.length ? /*#__PURE__*/_react["default"].createElement(_Suggestions["default"], _extends({
|
|
523
530
|
suggestions: suggestions,
|
|
524
531
|
selectedOptions: allselectedOptionIds,
|
|
525
532
|
getRef: this.suggestionItemRef,
|
|
@@ -531,7 +538,7 @@ var AdvancedMultiSelectComponent = /*#__PURE__*/function (_MultiSelectComponent)
|
|
|
531
538
|
a11y: {
|
|
532
539
|
role: 'option'
|
|
533
540
|
}
|
|
534
|
-
}) : /*#__PURE__*/_react["default"].createElement(_EmptyState["default"], {
|
|
541
|
+
}, SuggestionsProps)) : /*#__PURE__*/_react["default"].createElement(_EmptyState["default"], {
|
|
535
542
|
isLoading: isFetchingOptions,
|
|
536
543
|
options: options,
|
|
537
544
|
searchString: searchStr,
|
|
@@ -623,7 +630,11 @@ AdvancedMultiSelectComponent.propTypes = {
|
|
|
623
630
|
isBoxPaddingNeed: _propTypes["default"].bool,
|
|
624
631
|
isSearchClearOnSelect: _propTypes["default"].bool,
|
|
625
632
|
disabledOptions: _propTypes["default"].arrayOf(_propTypes["default"].string),
|
|
626
|
-
getFooter: _propTypes["default"].func
|
|
633
|
+
getFooter: _propTypes["default"].func,
|
|
634
|
+
customProps: _propTypes["default"].shape({
|
|
635
|
+
SuggestionsProps: _propTypes["default"].object,
|
|
636
|
+
DropBoxProps: _propTypes["default"].object
|
|
637
|
+
})
|
|
627
638
|
};
|
|
628
639
|
AdvancedMultiSelectComponent.defaultProps = {
|
|
629
640
|
animationStyle: 'bounce',
|
|
@@ -650,7 +661,8 @@ AdvancedMultiSelectComponent.defaultProps = {
|
|
|
650
661
|
a11y: {},
|
|
651
662
|
borderColor: 'default',
|
|
652
663
|
isBoxPaddingNeed: true,
|
|
653
|
-
isSearchClearOnSelect: true
|
|
664
|
+
isSearchClearOnSelect: true,
|
|
665
|
+
customProps: {}
|
|
654
666
|
};
|
|
655
667
|
AdvancedMultiSelectComponent.displayName = 'AdvancedMultiSelect';
|
|
656
668
|
var AdvancedMultiSelect = (0, _Popup["default"])(AdvancedMultiSelectComponent);
|
|
@@ -23,6 +23,12 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
|
|
|
23
23
|
|
|
24
24
|
function _extends() { _extends = Object.assign || 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); }
|
|
25
25
|
|
|
26
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
27
|
+
|
|
28
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
29
|
+
|
|
30
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
31
|
+
|
|
26
32
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
27
33
|
|
|
28
34
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
@@ -94,7 +100,8 @@ var Suggestions = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
94
100
|
icon = suggestion.icon,
|
|
95
101
|
optionType = suggestion.optionType,
|
|
96
102
|
iconSize = suggestion.iconSize,
|
|
97
|
-
isDisabled = suggestion.isDisabled
|
|
103
|
+
isDisabled = suggestion.isDisabled,
|
|
104
|
+
listItemProps = suggestion.listItemProps;
|
|
98
105
|
var isActive = activeId === id || selectedOptions.indexOf(id) >= 0;
|
|
99
106
|
var isHighlight = hoverOption === index || id === hoverId ? true : false;
|
|
100
107
|
var list_a11y = Object.assign({}, a11y, {
|
|
@@ -104,6 +111,12 @@ var Suggestions = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
104
111
|
isDisabled: isDisabled
|
|
105
112
|
};
|
|
106
113
|
|
|
114
|
+
if (listItemProps) {
|
|
115
|
+
commonProps.customProps = {
|
|
116
|
+
'ListItemProps': _objectSpread({}, listItemProps)
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
|
|
107
120
|
if (optionType === 'avatar') {
|
|
108
121
|
return /*#__PURE__*/_react["default"].createElement(_ListItemWithAvatar["default"], _extends({}, commonProps, {
|
|
109
122
|
autoHover: false,
|
|
@@ -197,7 +210,8 @@ Suggestions.propTypes = {
|
|
|
197
210
|
value: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number]),
|
|
198
211
|
photoURL: _propTypes["default"].string,
|
|
199
212
|
logo: _propTypes["default"].string,
|
|
200
|
-
optionType: _propTypes["default"].string
|
|
213
|
+
optionType: _propTypes["default"].string,
|
|
214
|
+
listItemProps: _propTypes["default"].object
|
|
201
215
|
}))
|
|
202
216
|
};
|
|
203
217
|
Suggestions.defaultProps = {
|
|
@@ -51,10 +51,20 @@ var AdvancedMultiSelect__default = /*#__PURE__*/function (_Component) {
|
|
|
51
51
|
_this.state = {
|
|
52
52
|
options: [{
|
|
53
53
|
id: 2,
|
|
54
|
-
text: 'text2'
|
|
54
|
+
text: 'text2',
|
|
55
|
+
listItemProps: {
|
|
56
|
+
style: {
|
|
57
|
+
color: 'red'
|
|
58
|
+
}
|
|
59
|
+
}
|
|
55
60
|
}, {
|
|
56
61
|
id: 3,
|
|
57
|
-
text: 'text3'
|
|
62
|
+
text: 'text3',
|
|
63
|
+
listItemProps: {
|
|
64
|
+
style: {
|
|
65
|
+
color: 'blue'
|
|
66
|
+
}
|
|
67
|
+
}
|
|
58
68
|
}, {
|
|
59
69
|
id: 4,
|
|
60
70
|
text: 'text4'
|
|
@@ -132,7 +142,12 @@ var AdvancedMultiSelect__default = /*#__PURE__*/function (_Component) {
|
|
|
132
142
|
noMoreText: 'No More Options .',
|
|
133
143
|
searchEmptyText: 'No Matches Found .'
|
|
134
144
|
},
|
|
135
|
-
getFooter: this.getFooter
|
|
145
|
+
getFooter: this.getFooter,
|
|
146
|
+
customProps: {
|
|
147
|
+
SuggestionsProps: {
|
|
148
|
+
needBorder: false
|
|
149
|
+
}
|
|
150
|
+
}
|
|
136
151
|
});
|
|
137
152
|
}
|
|
138
153
|
}]);
|
package/lib/Select/Select.js
CHANGED
|
@@ -43,6 +43,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
43
43
|
|
|
44
44
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
45
45
|
|
|
46
|
+
function _extends() { _extends = Object.assign || 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); }
|
|
47
|
+
|
|
46
48
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
47
49
|
|
|
48
50
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
@@ -292,11 +294,15 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
|
|
|
292
294
|
value: function handleFormatOptions(props) {
|
|
293
295
|
var options = props.options,
|
|
294
296
|
valueField = props.valueField,
|
|
295
|
-
textField = props.textField
|
|
297
|
+
textField = props.textField,
|
|
298
|
+
customProps = props.customProps;
|
|
299
|
+
var _customProps$listItem = customProps.listItemProps,
|
|
300
|
+
listItemProps = _customProps$listItem === void 0 ? {} : _customProps$listItem;
|
|
296
301
|
return this.formatOptions({
|
|
297
302
|
options: options,
|
|
298
303
|
valueField: valueField,
|
|
299
|
-
textField: textField
|
|
304
|
+
textField: textField,
|
|
305
|
+
listItemProps: listItemProps
|
|
300
306
|
});
|
|
301
307
|
}
|
|
302
308
|
}, {
|
|
@@ -729,7 +735,8 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
|
|
|
729
735
|
i18nKeys = _this$props11.i18nKeys,
|
|
730
736
|
htmlId = _this$props11.htmlId,
|
|
731
737
|
children = _this$props11.children,
|
|
732
|
-
iconOnHover = _this$props11.iconOnHover
|
|
738
|
+
iconOnHover = _this$props11.iconOnHover,
|
|
739
|
+
customProps = _this$props11.customProps;
|
|
733
740
|
var _i18nKeys = i18nKeys,
|
|
734
741
|
TextBoxIcon_i18n = _i18nKeys.TextBoxIcon_i18n,
|
|
735
742
|
_i18nKeys$TextBox_all = _i18nKeys.TextBox_ally_label,
|
|
@@ -748,6 +755,12 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
|
|
|
748
755
|
var suggestions = this.handleFilterSuggestions();
|
|
749
756
|
var setAriaId = this.getNextAriaId();
|
|
750
757
|
var ariaErrorId = this.getNextAriaId();
|
|
758
|
+
var _customProps$TextBoxP = customProps.TextBoxProps,
|
|
759
|
+
TextBoxProps = _customProps$TextBoxP === void 0 ? {} : _customProps$TextBoxP,
|
|
760
|
+
_customProps$Dropdown = customProps.DropdownSearchTextBoxProps,
|
|
761
|
+
DropdownSearchTextBoxProps = _customProps$Dropdown === void 0 ? {} : _customProps$Dropdown,
|
|
762
|
+
_customProps$Suggesti = customProps.SuggestionsProps,
|
|
763
|
+
SuggestionsProps = _customProps$Suggesti === void 0 ? {} : _customProps$Suggesti;
|
|
751
764
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
752
765
|
className: "".concat(isParentBased || isReadOnly || isDisabled ? _SelectModule["default"].container : '', " ").concat(_SelectModule["default"]["box_".concat(size)], " ").concat(isReadOnly ? _SelectModule["default"].readonly : '', " ").concat(borderColor === 'transparent' ? _SelectModule["default"].transparentContainer : '', " ").concat(iconOnHover && (isReadOnly || isDisabled) ? _SelectModule["default"].iconOnHoverReadonly : iconOnHover && !(isReadOnly || isDisabled) ? _SelectModule["default"].iconOnHoverStyle : ''),
|
|
753
766
|
"data-title": isDisabled ? title : ''
|
|
@@ -790,7 +803,10 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
|
|
|
790
803
|
borderColor: borderColor,
|
|
791
804
|
htmlId: htmlId,
|
|
792
805
|
isFocus: isPopupReady,
|
|
793
|
-
autoComplete: false
|
|
806
|
+
autoComplete: false,
|
|
807
|
+
customProps: {
|
|
808
|
+
TextBoxProps: TextBoxProps
|
|
809
|
+
}
|
|
794
810
|
}, /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
795
811
|
alignBox: "row",
|
|
796
812
|
align: "both"
|
|
@@ -835,7 +851,8 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
|
|
|
835
851
|
borderColor: borderColor,
|
|
836
852
|
htmlId: htmlId,
|
|
837
853
|
autoComplete: false,
|
|
838
|
-
isFocus: isPopupReady
|
|
854
|
+
isFocus: isPopupReady,
|
|
855
|
+
customProps: TextBoxProps
|
|
839
856
|
})), !isReadOnly && !isDisabled && isPopupOpen ? /*#__PURE__*/_react["default"].createElement(_DropBox["default"], {
|
|
840
857
|
animationStyle: animationStyle,
|
|
841
858
|
boxPosition: position || "".concat(defaultDropBoxPosition, "Center"),
|
|
@@ -868,11 +885,14 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
|
|
|
868
885
|
onClear: this.handleClearSearch,
|
|
869
886
|
dataId: "".concat(dataId, "_search"),
|
|
870
887
|
i18nKeys: TextBoxIcon_i18n,
|
|
871
|
-
autoComplete: false
|
|
888
|
+
autoComplete: false,
|
|
889
|
+
customProps: {
|
|
890
|
+
TextBoxProps: DropdownSearchTextBoxProps
|
|
891
|
+
}
|
|
872
892
|
}))) : null, /*#__PURE__*/_react["default"].createElement(_Card.CardContent, {
|
|
873
893
|
customClass: dropBoxSize ? _SelectModule["default"][dropBoxSize] : '',
|
|
874
894
|
eleRef: this.suggestionContainerRef
|
|
875
|
-
}, suggestions.length ? /*#__PURE__*/_react["default"].createElement(_Suggestions["default"], {
|
|
895
|
+
}, suggestions.length ? /*#__PURE__*/_react["default"].createElement(_Suggestions["default"], _extends({
|
|
876
896
|
activeId: selectedId,
|
|
877
897
|
suggestions: suggestions,
|
|
878
898
|
getRef: this.suggestionItemRef,
|
|
@@ -890,7 +910,7 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
|
|
|
890
910
|
ariaParentRole: 'listbox',
|
|
891
911
|
role: 'option'
|
|
892
912
|
}
|
|
893
|
-
}) : /*#__PURE__*/_react["default"].createElement(_EmptyState["default"], {
|
|
913
|
+
}, SuggestionsProps)) : /*#__PURE__*/_react["default"].createElement(_EmptyState["default"], {
|
|
894
914
|
isLoading: isFetchingOptions,
|
|
895
915
|
options: options,
|
|
896
916
|
searchString: searchStr,
|
|
@@ -984,7 +1004,13 @@ SelectComponent.propTypes = {
|
|
|
984
1004
|
htmlId: _propTypes["default"].string,
|
|
985
1005
|
children: _propTypes["default"].node,
|
|
986
1006
|
onFocus: _propTypes["default"].func,
|
|
987
|
-
iconOnHover: _propTypes["default"].bool
|
|
1007
|
+
iconOnHover: _propTypes["default"].bool,
|
|
1008
|
+
customProps: _propTypes["default"].shape({
|
|
1009
|
+
TextBoxProps: _propTypes["default"].object,
|
|
1010
|
+
DropdownSearchTextBoxProps: _propTypes["default"].object,
|
|
1011
|
+
listItemProps: _propTypes["default"].object,
|
|
1012
|
+
SuggestionsProps: _propTypes["default"].object
|
|
1013
|
+
})
|
|
988
1014
|
};
|
|
989
1015
|
SelectComponent.defaultProps = {
|
|
990
1016
|
animationStyle: 'bounce',
|
|
@@ -1016,7 +1042,8 @@ SelectComponent.defaultProps = {
|
|
|
1016
1042
|
isParentBased: true,
|
|
1017
1043
|
isSearchClearOnClose: true,
|
|
1018
1044
|
i18nKeys: {},
|
|
1019
|
-
iconOnHover: false
|
|
1045
|
+
iconOnHover: false,
|
|
1046
|
+
customProps: {}
|
|
1020
1047
|
};
|
|
1021
1048
|
SelectComponent.displayName = 'Select';
|
|
1022
1049
|
var Select = (0, _Popup["default"])(SelectComponent);
|
|
@@ -73,6 +73,40 @@ var option = [{
|
|
|
73
73
|
text: 'Pineapple',
|
|
74
74
|
id: '10'
|
|
75
75
|
}];
|
|
76
|
+
var customOption = [{
|
|
77
|
+
text: 'Apple',
|
|
78
|
+
id: 0,
|
|
79
|
+
listItemProps: {
|
|
80
|
+
style: {
|
|
81
|
+
'color': 'red'
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}, {
|
|
85
|
+
text: 'Banana',
|
|
86
|
+
id: '1',
|
|
87
|
+
listItemProps: {
|
|
88
|
+
style: {
|
|
89
|
+
'color': 'orange'
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}, {
|
|
93
|
+
text: 'Blackberries',
|
|
94
|
+
id: '2',
|
|
95
|
+
listItemProps: {
|
|
96
|
+
style: {
|
|
97
|
+
'color': 'blue'
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}, {
|
|
101
|
+
text: 'Guava',
|
|
102
|
+
id: '3'
|
|
103
|
+
}, {
|
|
104
|
+
text: 'Grapes',
|
|
105
|
+
id: '4'
|
|
106
|
+
}, {
|
|
107
|
+
text: 'Jackfruit',
|
|
108
|
+
id: '5'
|
|
109
|
+
}];
|
|
76
110
|
|
|
77
111
|
var Select__default = /*#__PURE__*/function (_React$Component) {
|
|
78
112
|
_inherits(Select__default, _React$Component);
|
|
@@ -142,6 +176,51 @@ var Select__default = /*#__PURE__*/function (_React$Component) {
|
|
|
142
176
|
searchBoxPlaceHolder: "Search",
|
|
143
177
|
isDefaultSelectValue: false,
|
|
144
178
|
isDisabled: true
|
|
179
|
+
}), /*#__PURE__*/_react["default"].createElement("div", null, "Custom Props"), /*#__PURE__*/_react["default"].createElement(_Select["default"], {
|
|
180
|
+
options: customOption,
|
|
181
|
+
onChange: this.handleChange,
|
|
182
|
+
selectedValue: value,
|
|
183
|
+
needSearch: true,
|
|
184
|
+
emptyMessage: "No matches found",
|
|
185
|
+
placeHolder: "PlaceHolder",
|
|
186
|
+
searchBoxPlaceHolder: "Search",
|
|
187
|
+
isDefaultSelectValue: false,
|
|
188
|
+
i18nKeys: {
|
|
189
|
+
loadingText: 'Loading',
|
|
190
|
+
emptyText: 'emptyText',
|
|
191
|
+
noMoreText: 'noMoreText',
|
|
192
|
+
searchEmptyText: 'searchEmptyText',
|
|
193
|
+
TextBoxIcon_i18n: {
|
|
194
|
+
clearText: 'Clear Data'
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
customProps: {
|
|
198
|
+
listItemProps: {
|
|
199
|
+
style: {
|
|
200
|
+
'color': 'green'
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
TextBoxProps: {
|
|
204
|
+
style: {
|
|
205
|
+
'color': 'brown'
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
DropdownSearchTextBoxProps: {
|
|
209
|
+
style: {
|
|
210
|
+
'color': 'purple'
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}), /*#__PURE__*/_react["default"].createElement("div", null, "Disabled"), /*#__PURE__*/_react["default"].createElement(_Select["default"], {
|
|
215
|
+
options: option,
|
|
216
|
+
onChange: this.handleChange,
|
|
217
|
+
selectedValue: value,
|
|
218
|
+
needSearch: true,
|
|
219
|
+
emptyMessage: "No matches found",
|
|
220
|
+
placeHolder: "isDisabled",
|
|
221
|
+
searchBoxPlaceHolder: "Search",
|
|
222
|
+
isDefaultSelectValue: false,
|
|
223
|
+
isDisabled: true
|
|
145
224
|
}), /*#__PURE__*/_react["default"].createElement("div", null, "Readonly"), /*#__PURE__*/_react["default"].createElement(_Select["default"], {
|
|
146
225
|
options: option,
|
|
147
226
|
onChange: this.handleChange,
|
package/lib/TextBox/TextBox.js
CHANGED
|
@@ -137,7 +137,8 @@ var Textbox = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
137
137
|
htmlId = _this$props4.htmlId,
|
|
138
138
|
a11y = _this$props4.a11y,
|
|
139
139
|
customClass = _this$props4.customClass,
|
|
140
|
-
isFocus = _this$props4.isFocus
|
|
140
|
+
isFocus = _this$props4.isFocus,
|
|
141
|
+
customProps = _this$props4.customProps;
|
|
141
142
|
var ariaLabel = a11y.ariaLabel,
|
|
142
143
|
ariaAutocomplete = a11y.ariaAutocomplete,
|
|
143
144
|
ariaControls = a11y.ariaControls,
|
|
@@ -204,7 +205,7 @@ var Textbox = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
204
205
|
value: value,
|
|
205
206
|
onKeyPress: onKeyPress,
|
|
206
207
|
onMouseDown: onMouseDown
|
|
207
|
-
}, options));
|
|
208
|
+
}, options, customProps));
|
|
208
209
|
}
|
|
209
210
|
}]);
|
|
210
211
|
|
|
@@ -228,7 +229,8 @@ Textbox.defaultProps = {
|
|
|
228
229
|
autoComplete: true,
|
|
229
230
|
borderColor: 'default',
|
|
230
231
|
a11y: {},
|
|
231
|
-
isFocus: false
|
|
232
|
+
isFocus: false,
|
|
233
|
+
customProps: {}
|
|
232
234
|
};
|
|
233
235
|
Textbox.propTypes = (_Textbox$propTypes = {
|
|
234
236
|
autofocus: _propTypes["default"].bool,
|
|
@@ -275,7 +277,7 @@ Textbox.propTypes = (_Textbox$propTypes = {
|
|
|
275
277
|
ariaActivedescendant: _propTypes["default"].string,
|
|
276
278
|
ariaReadonly: _propTypes["default"].bool,
|
|
277
279
|
ariaMultiselectable: _propTypes["default"].bool
|
|
278
|
-
})), _defineProperty(_Textbox$propTypes, "isFocus", _propTypes["default"].bool), _Textbox$propTypes);
|
|
280
|
+
})), _defineProperty(_Textbox$propTypes, "isFocus", _propTypes["default"].bool), _defineProperty(_Textbox$propTypes, "customProps", _propTypes["default"].object), _Textbox$propTypes);
|
|
279
281
|
|
|
280
282
|
if (false) {
|
|
281
283
|
Textbox.docs = {
|
|
@@ -126,7 +126,8 @@ var TextBoxIcon = /*#__PURE__*/function (_React$Component) {
|
|
|
126
126
|
customClass = _this$props2.customClass,
|
|
127
127
|
iconOnHover = _this$props2.iconOnHover,
|
|
128
128
|
isFocus = _this$props2.isFocus,
|
|
129
|
-
onClearMouseDown = _this$props2.onClearMouseDown
|
|
129
|
+
onClearMouseDown = _this$props2.onClearMouseDown,
|
|
130
|
+
customProps = _this$props2.customProps;
|
|
130
131
|
var isActive = this.state.isActive;
|
|
131
132
|
var _customClass$customTB = customClass.customTBoxWrap,
|
|
132
133
|
customTBoxWrap = _customClass$customTB === void 0 ? '' : _customClass$customTB,
|
|
@@ -138,6 +139,8 @@ var TextBoxIcon = /*#__PURE__*/function (_React$Component) {
|
|
|
138
139
|
customTBoxLine = _customClass$customTB3 === void 0 ? '' : _customClass$customTB3;
|
|
139
140
|
var _i18nKeys$clearText = i18nKeys.clearText,
|
|
140
141
|
clearText = _i18nKeys$clearText === void 0 ? 'Clear' : _i18nKeys$clearText;
|
|
142
|
+
var _customProps$TextBoxP = customProps.TextBoxProps,
|
|
143
|
+
TextBoxProps = _customProps$TextBoxP === void 0 ? {} : _customProps$TextBoxP;
|
|
141
144
|
return /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
142
145
|
alignBox: "row",
|
|
143
146
|
isCover: false,
|
|
@@ -170,7 +173,8 @@ var TextBoxIcon = /*#__PURE__*/function (_React$Component) {
|
|
|
170
173
|
onKeyPress: onKeyPress,
|
|
171
174
|
onMouseDown: onMouseDown,
|
|
172
175
|
needBorder: false,
|
|
173
|
-
customClass: customTextBox
|
|
176
|
+
customClass: customTextBox,
|
|
177
|
+
customProps: TextBoxProps
|
|
174
178
|
}))), /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
175
179
|
className: "".concat(_TextBoxIconModule["default"].iconContainer, " ").concat(customTBoxIcon)
|
|
176
180
|
}, /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
@@ -218,7 +222,8 @@ TextBoxIcon.defaultProps = {
|
|
|
218
222
|
i18nKeys: {},
|
|
219
223
|
customClass: {},
|
|
220
224
|
iconOnHover: false,
|
|
221
|
-
isFocus: false
|
|
225
|
+
isFocus: false,
|
|
226
|
+
customProps: {}
|
|
222
227
|
};
|
|
223
228
|
TextBoxIcon.propTypes = {
|
|
224
229
|
borderColor: _propTypes["default"].oneOf(['transparent', 'default', 'error']),
|
|
@@ -263,7 +268,10 @@ TextBoxIcon.propTypes = {
|
|
|
263
268
|
}),
|
|
264
269
|
iconOnHover: _propTypes["default"].bool,
|
|
265
270
|
isFocus: _propTypes["default"].bool,
|
|
266
|
-
onClearMouseDown: _propTypes["default"].func
|
|
271
|
+
onClearMouseDown: _propTypes["default"].func,
|
|
272
|
+
customProps: _propTypes["default"].shape({
|
|
273
|
+
TextBoxProps: _propTypes["default"].object
|
|
274
|
+
})
|
|
267
275
|
};
|
|
268
276
|
|
|
269
277
|
if (false) {
|
|
@@ -130,6 +130,10 @@ var getDisabledOptions = function getDisabledOptions(props) {
|
|
|
130
130
|
return props.disabledOptions || dummyArray;
|
|
131
131
|
};
|
|
132
132
|
|
|
133
|
+
var getListItemProps = function getListItemProps(props) {
|
|
134
|
+
return props.listItemProps || '';
|
|
135
|
+
};
|
|
136
|
+
|
|
133
137
|
var makeGetMultiSelectFilterSuggestions = function makeGetMultiSelectFilterSuggestions() {
|
|
134
138
|
return (0, _reselect.createSelector)([getOptions, getSelectedOptionsSel, getSearchStr, getNeedSearch, getIsStartWithSearch], function (options, selectedOptions, searchStr, needSearch, isStartsWithSearch) {
|
|
135
139
|
var suggestions = [];
|
|
@@ -210,7 +214,7 @@ var extractOptionId = function extractOptionId(id) {
|
|
|
210
214
|
exports.extractOptionId = extractOptionId;
|
|
211
215
|
|
|
212
216
|
var makeFormatOptions = function makeFormatOptions() {
|
|
213
|
-
return (0, _reselect.createSelector)([getOptions, getValueField, getTextField, getImageField, getPrefixText, getIconName, getIconSize, getOptionType, getDisabledOptions], function (options, valueField, textField, imageField, prefixText, iconName, iconSize, optionType, disabledOptions) {
|
|
217
|
+
return (0, _reselect.createSelector)([getOptions, getValueField, getTextField, getImageField, getPrefixText, getIconName, getIconSize, getOptionType, getDisabledOptions, getListItemProps], function (options, valueField, textField, imageField, prefixText, iconName, iconSize, optionType, disabledOptions, listItemProps) {
|
|
214
218
|
var revampOptions = [];
|
|
215
219
|
var remvampOptionIds = [];
|
|
216
220
|
var normalizedAllOptions = {};
|
|
@@ -223,7 +227,8 @@ var makeFormatOptions = function makeFormatOptions() {
|
|
|
223
227
|
impImageField = option.imageField,
|
|
224
228
|
impOptionType = option.optionType,
|
|
225
229
|
impIconName = option.iconName,
|
|
226
|
-
impIconSize = option.iconSize
|
|
230
|
+
impIconSize = option.iconSize,
|
|
231
|
+
listStyle = option.listItemProps;
|
|
227
232
|
var id = _typeof(option) === 'object' ? option[impValueField || valueField] : option;
|
|
228
233
|
var value = _typeof(option) === 'object' ? option[impTextField || textField] : option;
|
|
229
234
|
var photoURL = _typeof(option) === 'object' ? option[impImageField || imageField] : ''; // grouping options (group select/MultiSelect)
|
|
@@ -254,6 +259,10 @@ var makeFormatOptions = function makeFormatOptions() {
|
|
|
254
259
|
optionDetails.isDisabled = disabledOptions.indexOf(id) >= 0;
|
|
255
260
|
}
|
|
256
261
|
|
|
262
|
+
if (listStyle || listItemProps) {
|
|
263
|
+
optionDetails.listItemProps = listStyle || listItemProps;
|
|
264
|
+
}
|
|
265
|
+
|
|
257
266
|
normalizedFormatOptions[id] = optionDetails;
|
|
258
267
|
normalizedAllOptions[id] = option;
|
|
259
268
|
revampOptions.push(optionDetails);
|